aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDana Dahlstrom <dahlstrom@google.com>2018-11-16 15:48:28 -0800
committerandroid-build-merger <android-build-merger@google.com>2018-11-16 15:48:28 -0800
commitaa69fb11851ac02f6bec3fffda9898b8cea6b2e3 (patch)
tree4b825dc642cb6eb9a060e54bf8d69288fbee4904
parent903e87fa82521d049fcbcd6d1e4575b793faa514 (diff)
parentc61c1fb07d7dca0ad277563d6d958c38546e27b8 (diff)
downloadjdk8u_jaxp-studio-master-dev-osx.tar.gz
am: c61c1fb07d Change-Id: I69c653ede4d031edf27cce9533a81017b05ca942
-rw-r--r--.hgignore7
-rw-r--r--.hgtags699
-rw-r--r--.jcheck/conf2
-rw-r--r--ASSEMBLY_EXCEPTION27
-rw-r--r--LICENSE347
-rw-r--r--README19
-rw-r--r--THIRD_PARTY_README3574
-rw-r--r--TRADEMARK41
-rw-r--r--build.properties92
-rw-r--r--build.xml217
-rw-r--r--make/BuildJaxp.gmk71
-rw-r--r--make/Makefile49
-rw-r--r--nbproject/findbugs.settings72
-rw-r--r--nbproject/project.xml68
-rw-r--r--nbproject/sqe.properties2
-rw-r--r--src/com/sun/java_cup/internal/runtime/Scanner.java45
-rw-r--r--src/com/sun/java_cup/internal/runtime/Symbol.java129
-rw-r--r--src/com/sun/java_cup/internal/runtime/lr_parser.java1251
-rw-r--r--src/com/sun/java_cup/internal/runtime/virtual_parse_stack.java169
-rw-r--r--src/com/sun/org/apache/bcel/internal/Constants.java790
-rw-r--r--src/com/sun/org/apache/bcel/internal/ExceptionConstants.java126
-rw-r--r--src/com/sun/org/apache/bcel/internal/Repository.java250
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/AccessFlags.java174
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/Attribute.java308
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/AttributeReader.java100
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/ClassFormatException.java71
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/ClassParser.java331
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/Code.java376
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/CodeException.java232
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/Constant.java151
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/ConstantCP.java157
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/ConstantClass.java157
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/ConstantDouble.java145
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/ConstantFieldref.java107
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/ConstantFloat.java144
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/ConstantInteger.java151
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/ConstantInterfaceMethodref.java107
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/ConstantLong.java142
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/ConstantMethodref.java107
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/ConstantNameAndType.java174
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/ConstantObject.java72
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/ConstantPool.java375
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/ConstantString.java150
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/ConstantUtf8.java150
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/ConstantValue.java181
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/Deprecated.java172
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/DescendingVisitor.java370
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/EmptyVisitor.java109
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/ExceptionTable.java205
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/Field.java168
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/FieldOrMethod.java226
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/InnerClass.java224
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/InnerClasses.java184
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/JavaClass.java826
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/LineNumber.java167
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/LineNumberTable.java243
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/LocalVariable.java262
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/LocalVariableTable.java199
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/LocalVariableTypeTable.java146
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/Method.java231
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/Node.java68
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/PMGClass.java192
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/Signature.java299
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/SourceFile.java176
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/StackMap.java188
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/StackMapEntry.java212
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/StackMapType.java175
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/Synthetic.java179
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/Unknown.java216
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/Utility.java1397
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/Visitor.java105
-rw-r--r--src/com/sun/org/apache/bcel/internal/classfile/package.html14
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/AALOAD.java90
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/AASTORE.java90
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/ACONST_NULL.java97
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/ALOAD.java95
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/ANEWARRAY.java117
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/ARETURN.java91
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/ARRAYLENGTH.java95
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/ASTORE.java95
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/ATHROW.java95
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/AllocationInstruction.java66
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/ArithmeticInstruction.java109
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/ArrayInstruction.java109
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/ArrayType.java159
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/BALOAD.java90
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/BASTORE.java90
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/BIPUSH.java134
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/BREAKPOINT.java82
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/BasicType.java110
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/BranchHandle.java153
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/BranchInstruction.java269
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/CALOAD.java90
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/CASTORE.java90
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/CHECKCAST.java120
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/CPInstruction.java169
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/ClassGen.java454
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/ClassGenException.java70
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/ClassObserver.java69
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/CodeExceptionGen.java211
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/CompoundInstruction.java78
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/ConstantPoolGen.java789
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/ConstantPushInstruction.java72
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/ConversionInstruction.java104
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/D2F.java90
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/D2I.java90
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/D2L.java90
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/DADD.java91
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/DALOAD.java90
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/DASTORE.java90
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/DCMPG.java96
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/DCMPL.java95
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/DCONST.java114
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/DDIV.java91
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/DLOAD.java95
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/DMUL.java91
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/DNEG.java88
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/DREM.java91
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/DRETURN.java90
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/DSTORE.java95
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/DSUB.java91
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/DUP.java87
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/DUP2.java87
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/DUP2_X1.java85
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/DUP2_X2.java85
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/DUP_X1.java85
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/DUP_X2.java85
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/EmptyVisitor.java247
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/ExceptionThrower.java82
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/F2D.java90
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/F2I.java90
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/F2L.java90
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/FADD.java90
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/FALOAD.java90
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/FASTORE.java90
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/FCMPG.java94
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/FCMPL.java94
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/FCONST.java116
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/FDIV.java90
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/FLOAD.java95
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/FMUL.java90
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/FNEG.java88
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/FREM.java90
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/FRETURN.java90
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/FSTORE.java95
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/FSUB.java90
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/FieldGen.java313
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/FieldGenOrMethodGen.java138
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/FieldInstruction.java118
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/FieldObserver.java69
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/FieldOrMethod.java120
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/GETFIELD.java120
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/GETSTATIC.java116
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/GOTO.java125
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/GOTO_W.java113
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/GotoInstruction.java78
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/I2B.java90
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/I2C.java90
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/I2D.java90
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/I2F.java90
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/I2L.java90
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/I2S.java88
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/IADD.java90
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/IALOAD.java91
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/IAND.java88
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/IASTORE.java91
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/ICONST.java112
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/IDIV.java97
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/IFEQ.java101
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/IFGE.java101
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/IFGT.java101
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/IFLE.java101
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/IFLT.java101
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/IFNE.java101
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/IFNONNULL.java100
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/IFNULL.java101
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/IF_ACMPEQ.java100
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/IF_ACMPNE.java101
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/IF_ICMPEQ.java101
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/IF_ICMPGE.java101
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/IF_ICMPGT.java101
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/IF_ICMPLE.java101
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/IF_ICMPLT.java101
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/IF_ICMPNE.java101
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/IINC.java186
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/ILOAD.java95
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/IMPDEP1.java83
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/IMPDEP2.java83
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/IMUL.java90
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/INEG.java88
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/INSTANCEOF.java109
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/INVOKEINTERFACE.java166
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/INVOKESPECIAL.java116
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/INVOKESTATIC.java113
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/INVOKEVIRTUAL.java115
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/IOR.java88
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/IREM.java97
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/IRETURN.java90
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/ISHL.java88
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/ISHR.java88
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/ISTORE.java95
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/ISUB.java90
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/IUSHR.java88
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/IXOR.java88
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/IfInstruction.java84
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/IndexedInstruction.java70
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/Instruction.java308
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/InstructionComparator.java112
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/InstructionConstants.java329
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/InstructionFactory.java626
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/InstructionHandle.java287
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/InstructionList.java1289
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/InstructionListObserver.java69
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/InstructionTargeter.java73
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/InvokeInstruction.java149
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/JSR.java122
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/JSR_W.java113
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/JsrInstruction.java118
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/L2D.java88
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/L2F.java88
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/L2I.java88
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/LADD.java89
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/LALOAD.java90
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/LAND.java89
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/LASTORE.java90
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/LCMP.java95
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/LCONST.java114
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/LDC.java175
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/LDC2_W.java119
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/LDC_W.java91
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/LDIV.java94
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/LLOAD.java92
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/LMUL.java89
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/LNEG.java88
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/LOOKUPSWITCH.java136
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/LOR.java88
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/LREM.java91
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/LRETURN.java88
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/LSHL.java88
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/LSHR.java88
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/LSTORE.java92
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/LSUB.java89
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/LUSHR.java88
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/LXOR.java88
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/LineNumberGen.java136
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/LoadClass.java89
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/LoadInstruction.java103
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/LocalVariableGen.java290
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/LocalVariableInstruction.java229
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/MONITORENTER.java91
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/MONITOREXIT.java91
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/MULTIANEWARRAY.java175
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/MethodGen.java1089
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/MethodObserver.java69
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/NEW.java114
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/NEWARRAY.java143
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/NOP.java83
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/NamedAndTyped.java73
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/ObjectType.java139
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/POP.java88
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/POP2.java88
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/PUSH.java198
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/PUTFIELD.java121
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/PUTSTATIC.java117
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/PopInstruction.java70
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/PushInstruction.java75
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/RET.java164
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/RETURN.java88
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/ReferenceType.java352
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/ReturnInstruction.java106
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/ReturnaddressType.java111
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/SALOAD.java88
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/SASTORE.java88
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/SIPUSH.java131
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/SWAP.java87
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/SWITCH.java186
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/Select.java267
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/StackConsumer.java70
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/StackInstruction.java85
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/StackProducer.java71
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/StoreInstruction.java103
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/TABLESWITCH.java150
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/TargetLostException.java103
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/Type.java290
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/TypedInstruction.java69
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/UnconditionalBranch.java69
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/VariableLengthInstruction.java72
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/Visitor.java250
-rw-r--r--src/com/sun/org/apache/bcel/internal/generic/package.html16
-rw-r--r--src/com/sun/org/apache/bcel/internal/package.html17
-rw-r--r--src/com/sun/org/apache/bcel/internal/util/AttributeHTML.java258
-rw-r--r--src/com/sun/org/apache/bcel/internal/util/BCELFactory.java360
-rw-r--r--src/com/sun/org/apache/bcel/internal/util/BCELifier.java307
-rw-r--r--src/com/sun/org/apache/bcel/internal/util/ByteSequence.java85
-rw-r--r--src/com/sun/org/apache/bcel/internal/util/Class2HTML.java266
-rw-r--r--src/com/sun/org/apache/bcel/internal/util/ClassLoader.java224
-rw-r--r--src/com/sun/org/apache/bcel/internal/util/ClassLoaderRepository.java157
-rw-r--r--src/com/sun/org/apache/bcel/internal/util/ClassPath.java384
-rw-r--r--src/com/sun/org/apache/bcel/internal/util/ClassQueue.java84
-rw-r--r--src/com/sun/org/apache/bcel/internal/util/ClassSet.java99
-rw-r--r--src/com/sun/org/apache/bcel/internal/util/ClassStack.java76
-rw-r--r--src/com/sun/org/apache/bcel/internal/util/ClassVector.java82
-rw-r--r--src/com/sun/org/apache/bcel/internal/util/CodeHTML.java621
-rw-r--r--src/com/sun/org/apache/bcel/internal/util/ConstantHTML.java265
-rw-r--r--src/com/sun/org/apache/bcel/internal/util/InstructionFinder.java443
-rw-r--r--src/com/sun/org/apache/bcel/internal/util/JavaWrapper.java155
-rw-r--r--src/com/sun/org/apache/bcel/internal/util/MethodHTML.java202
-rw-r--r--src/com/sun/org/apache/bcel/internal/util/Repository.java105
-rw-r--r--src/com/sun/org/apache/bcel/internal/util/SecuritySupport.java223
-rw-r--r--src/com/sun/org/apache/bcel/internal/util/SyntheticRepository.java207
-rw-r--r--src/com/sun/org/apache/bcel/internal/util/package.html25
-rw-r--r--src/com/sun/org/apache/regexp/internal/CharacterArrayCharacterIterator.java76
-rw-r--r--src/com/sun/org/apache/regexp/internal/CharacterIterator.java42
-rw-r--r--src/com/sun/org/apache/regexp/internal/RE.java1760
-rw-r--r--src/com/sun/org/apache/regexp/internal/RECompiler.java1520
-rw-r--r--src/com/sun/org/apache/regexp/internal/REDebugCompiler.java225
-rw-r--r--src/com/sun/org/apache/regexp/internal/REProgram.java158
-rw-r--r--src/com/sun/org/apache/regexp/internal/RESyntaxException.java43
-rw-r--r--src/com/sun/org/apache/regexp/internal/RETest.java883
-rw-r--r--src/com/sun/org/apache/regexp/internal/REUtil.java61
-rw-r--r--src/com/sun/org/apache/regexp/internal/ReaderCharacterIterator.java164
-rw-r--r--src/com/sun/org/apache/regexp/internal/StreamCharacterIterator.java161
-rw-r--r--src/com/sun/org/apache/regexp/internal/StringCharacterIterator.java62
-rw-r--r--src/com/sun/org/apache/regexp/internal/recompile.java137
-rw-r--r--src/com/sun/org/apache/xalan/internal/Version.java155
-rw-r--r--src/com/sun/org/apache/xalan/internal/XalanConstants.java266
-rw-r--r--src/com/sun/org/apache/xalan/internal/extensions/ExpressionContext.java95
-rw-r--r--src/com/sun/org/apache/xalan/internal/extensions/package.html28
-rw-r--r--src/com/sun/org/apache/xalan/internal/lib/ExsltBase.java86
-rw-r--r--src/com/sun/org/apache/xalan/internal/lib/ExsltCommon.java108
-rw-r--r--src/com/sun/org/apache/xalan/internal/lib/ExsltDatetime.java1122
-rw-r--r--src/com/sun/org/apache/xalan/internal/lib/ExsltDynamic.java616
-rw-r--r--src/com/sun/org/apache/xalan/internal/lib/ExsltMath.java391
-rw-r--r--src/com/sun/org/apache/xalan/internal/lib/ExsltSets.java241
-rw-r--r--src/com/sun/org/apache/xalan/internal/lib/ExsltStrings.java351
-rw-r--r--src/com/sun/org/apache/xalan/internal/lib/Extensions.java388
-rw-r--r--src/com/sun/org/apache/xalan/internal/lib/NodeInfo.java250
-rw-r--r--src/com/sun/org/apache/xalan/internal/lib/package.html29
-rw-r--r--src/com/sun/org/apache/xalan/internal/res/XSLMessages.java93
-rw-r--r--src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources.java1447
-rw-r--r--src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_de.java1447
-rw-r--r--src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_en.java33
-rw-r--r--src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_es.java1447
-rw-r--r--src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_fr.java1447
-rw-r--r--src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_it.java1447
-rw-r--r--src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ja.java1447
-rw-r--r--src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ko.java1447
-rw-r--r--src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_pt_BR.java1447
-rw-r--r--src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_sv.java1447
-rw-r--r--src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_CN.java1447
-rw-r--r--src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_TW.java1447
-rw-r--r--src/com/sun/org/apache/xalan/internal/res/XSLTInfo.properties32
-rw-r--r--src/com/sun/org/apache/xalan/internal/res/package.html28
-rw-r--r--src/com/sun/org/apache/xalan/internal/templates/Constants.java401
-rw-r--r--src/com/sun/org/apache/xalan/internal/templates/package.html15
-rw-r--r--src/com/sun/org/apache/xalan/internal/utils/ConfigurationError.java61
-rw-r--r--src/com/sun/org/apache/xalan/internal/utils/FactoryImpl.java57
-rw-r--r--src/com/sun/org/apache/xalan/internal/utils/FeatureManager.java124
-rw-r--r--src/com/sun/org/apache/xalan/internal/utils/FeaturePropertyBase.java215
-rw-r--r--src/com/sun/org/apache/xalan/internal/utils/ObjectFactory.java221
-rw-r--r--src/com/sun/org/apache/xalan/internal/utils/SecuritySupport.java345
-rw-r--r--src/com/sun/org/apache/xalan/internal/utils/XMLSecurityManager.java466
-rw-r--r--src/com/sun/org/apache/xalan/internal/utils/XMLSecurityPropertyManager.java102
-rw-r--r--src/com/sun/org/apache/xalan/internal/xslt/EnvironmentCheck.java1253
-rw-r--r--src/com/sun/org/apache/xalan/internal/xslt/Process.java1226
-rw-r--r--src/com/sun/org/apache/xalan/internal/xslt/package.html28
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/CollatorFactory.java37
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/DOM.java103
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/DOMCache.java58
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/DOMEnhancedForDTM.java47
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/NodeIterator.java86
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/ProcessorVersion.java51
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/StripFilter.java33
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/Translet.java57
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/TransletException.java48
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/cmdline/Compile.java171
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/cmdline/Transform.java292
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/cmdline/getopt/GetOpt.java258
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/cmdline/getopt/GetOptsException.java34
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/cmdline/getopt/IllegalArgumentException.java32
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/cmdline/getopt/MissingOptArgException.java35
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/AbsoluteLocationPath.java130
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/AbsolutePathPattern.java142
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/AlternativePattern.java102
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/AncestorPattern.java184
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/ApplyImports.java161
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/ApplyTemplates.java205
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/ArgumentList.java44
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/Attribute.java47
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/AttributeSet.java208
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/AttributeValue.java50
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/AttributeValueTemplate.java262
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/BinOpExpr.java132
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/BooleanCall.java59
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/BooleanExpr.java81
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/CallTemplate.java243
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/CastCall.java102
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/CastExpr.java241
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/CeilingCall.java50
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/Choose.java168
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/Closure.java52
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/Comment.java118
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/CompilerException.java56
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/ConcatCall.java97
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/Constants.java508
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/ContainsCall.java109
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/Copy.java159
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/CopyOf.java143
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/CurrentCall.java41
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/DecimalFormatting.java258
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/DocumentCall.java158
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/ElementAvailableCall.java95
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/EqualityExpr.java361
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/Expression.java224
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/Fallback.java81
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/FilterExpr.java254
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/FilterParentPath.java176
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/FilteredAbsoluteLocationPath.java127
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/FloorCall.java48
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/FlowList.java119
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/ForEach.java197
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/FormatNumberCall.java116
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/FunctionAvailableCall.java196
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/FunctionCall.java1148
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/GenerateIdCall.java57
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/IdKeyPattern.java129
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/IdPattern.java37
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/If.java112
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/IllegalCharException.java35
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/Import.java165
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/Include.java164
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/Instruction.java52
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/IntExpr.java58
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/Key.java301
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/KeyCall.java238
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/KeyPattern.java36
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/LangCall.java93
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/LastCall.java71
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/LiteralAttribute.java159
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/LiteralElement.java508
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/LiteralExpr.java87
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/LocalNameCall.java76
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/LocationPathPattern.java109
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/LogicalExpr.java235
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/Makefile.inc60
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/Message.java169
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/Mode.java1518
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/NameBase.java130
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/NameCall.java68
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/NamespaceAlias.java57
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/NamespaceUriCall.java69
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/NodeTest.java45
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/NotCall.java60
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/Number.java600
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/NumberCall.java70
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/Otherwise.java55
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/Output.java421
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/Param.java258
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/ParameterRef.java111
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/ParentLocationPath.java252
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/ParentPattern.java153
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/Parser.java1449
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/Pattern.java62
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/PositionCall.java69
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/Predicate.java619
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/ProcessingInstruction.java142
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/ProcessingInstructionPattern.java160
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/QName.java87
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/RealExpr.java58
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/RelationalExpr.java283
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/RelativeLocationPath.java33
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/RelativePathPattern.java30
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/RoundCall.java53
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/SimpleAttributeValue.java77
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/Sort.java734
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/SourceLoader.java44
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/StartsWithCall.java93
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/Step.java538
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/StepPattern.java534
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/StringCall.java76
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/StringLengthCall.java58
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/Stylesheet.java1447
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/SymbolTable.java295
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/SyntaxTreeNode.java902
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/Template.java339
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/TestSeq.java288
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/Text.java247
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/TopLevelElement.java100
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/TransletOutput.java148
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/UnaryOpExpr.java90
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/UnionPathExpr.java148
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/UnparsedEntityUriCall.java72
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/UnresolvedRef.java104
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/UnsupportedElement.java151
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/UseAttributeSets.java118
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/ValueOf.java140
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/Variable.java205
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/VariableBase.java299
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/VariableRef.java97
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/VariableRefBase.java165
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/When.java107
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/Whitespace.java532
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/WithParam.java252
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/XPathLexer.java1619
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/XPathParser.java3146
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/XSLTC.java1032
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/XslAttribute.java293
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/XslElement.java281
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/sym.java66
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/AttributeSetMethodGenerator.java79
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/BooleanType.java225
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ClassGenerator.java144
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/CompareGenerator.java120
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages.java1022
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ca.java863
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_cs.java863
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_de.java974
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_es.java974
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_fr.java974
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_it.java974
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ja.java974
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ko.java974
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_pt_BR.java974
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_sk.java863
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_sv.java974
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_zh_CN.java974
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_zh_TW.java974
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMsg.java326
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/FilterGenerator.java66
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/IntType.java302
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/InternalError.java37
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MarkerInstruction.java98
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MatchGenerator.java104
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MethodGenerator.java2145
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MethodType.java173
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MultiHashtable.java94
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NamedMethodGenerator.java67
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NodeCounterGenerator.java75
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NodeSetType.java331
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NodeSortRecordFactGenerator.java49
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NodeSortRecordGenerator.java65
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NodeType.java324
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NumberType.java39
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ObjectType.java179
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/OutlineableChunkEnd.java70
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/OutlineableChunkStart.java80
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/RealType.java343
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ReferenceType.java379
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ResultTreeType.java465
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/RtMethodGenerator.java70
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/SlotAllocator.java102
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/StringStack.java45
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/StringType.java231
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/TestGenerator.java117
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/Type.java298
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/TypeCheckError.java79
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/Util.java204
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/VoidType.java100
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/xpath.cup1116
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/compiler/xpath.lex260
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/dom/AbsoluteIterator.java101
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/dom/AdaptiveResultTreeImpl.java1346
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/dom/AnyNodeCounter.java131
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/dom/ArrayNodeListIterator.java91
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/dom/BitArray.java268
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/dom/CachedNodeListIterator.java115
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/dom/ClonedNodeListIterator.java83
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/dom/CollatorFactoryBase.java52
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/dom/CurrentNodeListFilter.java37
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/dom/CurrentNodeListIterator.java201
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/dom/DOMAdapter.java464
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/dom/DOMBuilder.java29
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/dom/DOMWSFilter.java133
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/dom/DocumentCache.java338
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/dom/DupFilterIterator.java166
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/dom/EmptyFilter.java34
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/dom/ExtendedSAX.java36
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/dom/Filter.java32
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/dom/FilterIterator.java120
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/dom/FilteredStepIterator.java56
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/dom/ForwardPositionIterator.java109
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/dom/KeyIndex.java900
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/dom/LoadDocument.java305
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/dom/MatchingIterator.java129
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/dom/MultiDOM.java720
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/dom/MultiValuedNodeHeapIterator.java296
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/dom/MultipleNodeCounter.java120
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/dom/NodeCounter.java416
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/dom/NodeIteratorBase.java172
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecord.java252
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecordFactory.java166
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/dom/NthIterator.java117
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/dom/SAXImpl.java1882
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/dom/SimpleResultTreeImpl.java1024
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/dom/SingleNodeCounter.java158
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/dom/SingletonIterator.java94
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/dom/SortSettings.java140
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/dom/SortingIterator.java151
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/dom/StepIterator.java140
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/dom/StripWhitespaceFilter.java34
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/dom/UnionIterator.java100
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/dom/XSLTCDTMManager.java448
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/javax.xml.transform.TransformerFactory1
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/runtime/AbstractTranslet.java798
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/runtime/Attributes.java65
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/runtime/BasisLibrary.java1688
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/runtime/Constants.java53
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages.java284
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ca.java234
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_cs.java234
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_de.java284
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_es.java284
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_fr.java284
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_it.java284
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ja.java284
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ko.java284
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_pt_BR.java284
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_sk.java234
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_sv.java284
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_zh_CN.java284
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_zh_TW.java284
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/runtime/InternalRuntimeError.java36
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/runtime/MessageHandler.java33
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/runtime/Node.java40
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/runtime/Operators.java60
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/runtime/Parameter.java48
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/runtime/StringValueHandler.java127
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/runtime/output/OutputBuffer.java36
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/runtime/output/StringOutputBuffer.java55
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/runtime/output/TransletOutputHandlerFactory.java272
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/runtime/output/WriterOutputBuffer.java97
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/trax/DOM2SAX.java484
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/trax/DOM2TO.java436
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/trax/OutputSettings.java49
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2DOM.java337
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2StAXBaseWriter.java248
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2StAXEventWriter.java420
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2StAXStreamWriter.java302
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/trax/SmartTransformerFactoryImpl.java455
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/trax/StAXEvent2SAX.java600
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/trax/StAXStream2SAX.java533
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesHandlerImpl.java347
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesImpl.java527
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/trax/TrAXFilter.java148
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java1613
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerHandlerImpl.java513
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java1412
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/trax/Util.java257
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/trax/XSLTCSource.java142
-rw-r--r--src/com/sun/org/apache/xalan/internal/xsltc/util/IntegerArray.java228
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/AbortException.java36
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/AttrImpl.java1239
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/AttrNSImpl.java352
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/AttributeMap.java606
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/CDATASectionImpl.java89
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/CharacterDataImpl.java425
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/ChildNode.java150
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/CommentImpl.java71
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/CoreDOMImplementationImpl.java488
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/CoreDocumentImpl.java2870
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/DOMConfigurationImpl.java1103
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/DOMErrorImpl.java136
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/DOMImplementationImpl.java151
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/DOMImplementationListImpl.java75
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/DOMImplementationSourceImpl.java136
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/DOMInputImpl.java391
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/DOMLocatorImpl.java162
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/DOMMessageFormatter.java143
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/DOMNormalizer.java2042
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/DOMOutputImpl.java173
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/DOMStringListImpl.java90
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/DOMXSImplementationSourceImpl.java100
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/DeepNodeListImpl.java247
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/DeferredAttrImpl.java145
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/DeferredAttrNSImpl.java130
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/DeferredCDATASectionImpl.java109
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/DeferredCommentImpl.java90
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/DeferredDOMImplementationImpl.java58
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/DeferredDocumentImpl.java2158
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/DeferredDocumentTypeImpl.java187
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/DeferredElementDefinitionImpl.java126
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/DeferredElementImpl.java138
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/DeferredElementNSImpl.java161
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/DeferredEntityImpl.java153
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/DeferredEntityReferenceImpl.java155
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/DeferredNode.java43
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/DeferredNotationImpl.java117
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/DeferredProcessingInstructionImpl.java94
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/DeferredTextImpl.java107
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/DocumentFragmentImpl.java155
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/DocumentImpl.java1379
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/DocumentTypeImpl.java558
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/ElementDefinitionImpl.java121
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/ElementImpl.java1178
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/ElementNSImpl.java489
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/EntityImpl.java367
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/EntityReferenceImpl.java402
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/LCount.java50
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/NamedNodeMapImpl.java630
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/NodeImpl.java2023
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/NodeIteratorImpl.java374
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/NodeListCache.java59
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/NotationImpl.java212
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/PSVIAttrNSImpl.java253
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/PSVIDOMImplementationImpl.java124
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/PSVIDocumentImpl.java150
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/PSVIElementNSImpl.java296
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/ParentNode.java1037
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/ProcessingInstructionImpl.java161
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/RangeExceptionImpl.java37
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/RangeImpl.java2085
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/TextImpl.java665
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/TreeWalkerImpl.java507
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/events/EventImpl.java135
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/events/MutationEventImpl.java112
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/org.apache.xerces.dom.DOMImplementationSourceImpl1
-rw-r--r--src/com/sun/org/apache/xerces/internal/dom/org.w3c.dom.DOMImplementationSourceList1
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/Constants.java941
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/ExternalSubsetResolver.java66
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/PropertyManager.java220
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/RevalidationHandler.java84
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/Version.java102
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/XML11DTDScannerImpl.java256
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/XML11DocumentScannerImpl.java510
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/XML11EntityScanner.java1499
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/XML11NSDocumentScannerImpl.java892
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/XML11NamespaceBinder.java106
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/XMLDTDScannerImpl.java2200
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java3292
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/XMLDocumentScannerImpl.java1499
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/XMLEntityDescription.java50
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/XMLEntityHandler.java119
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java3035
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/XMLEntityScanner.java2318
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/XMLErrorReporter.java612
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/XMLNSDocumentScannerImpl.java648
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/XMLNamespaceBinder.java889
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/XMLScanner.java1557
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/XMLStreamFilterImpl.java533
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/XMLStreamReaderImpl.java1366
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/XMLVersionDetector.java238
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dtd/BalancedDTDGrammar.java288
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dtd/DTDGrammar.java2651
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dtd/DTDGrammarBucket.java112
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dtd/XML11DTDProcessor.java128
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dtd/XML11DTDValidator.java126
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dtd/XML11NSDTDValidator.java266
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dtd/XMLAttributeDecl.java110
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dtd/XMLContentSpec.java336
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDDescription.java229
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDLoader.java559
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDProcessor.java1752
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDValidator.java2069
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDValidatorFilter.java93
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dtd/XMLElementDecl.java141
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dtd/XMLEntityDecl.java158
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dtd/XMLNSDTDValidator.java275
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dtd/XMLNotationDecl.java112
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dtd/XMLSimpleType.java212
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dtd/models/CMAny.java192
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dtd/models/CMBinOp.java191
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dtd/models/CMLeaf.java186
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dtd/models/CMNode.java190
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dtd/models/CMStateSet.java343
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dtd/models/CMUniOp.java143
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dtd/models/ContentModelValidator.java88
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dtd/models/DFAContentModel.java1033
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dtd/models/MixedContentModel.java258
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dtd/models/SimpleContentModel.java320
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/DTDDVFactory.java101
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/DVFactoryException.java42
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/DatatypeException.java110
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/DatatypeValidator.java45
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/InvalidDatatypeFacetException.java48
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/InvalidDatatypeValueException.java88
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/SchemaDVFactory.java149
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/ValidatedInfo.java98
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/ValidationContext.java67
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/XSFacets.java136
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/XSSimpleType.java203
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/dtd/DTDDVFactoryImpl.java81
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/dtd/ENTITYDatatypeValidator.java68
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/dtd/IDDatatypeValidator.java84
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/dtd/IDREFDatatypeValidator.java78
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/dtd/ListDatatypeValidator.java68
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/dtd/NMTOKENDatatypeValidator.java57
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/dtd/NOTATIONDatatypeValidator.java55
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/dtd/StringDatatypeValidator.java60
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/dtd/XML11DTDDVFactoryImpl.java79
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/dtd/XML11IDDatatypeValidator.java86
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/dtd/XML11IDREFDatatypeValidator.java80
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/dtd/XML11NMTOKENDatatypeValidator.java59
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/util/Base64.java307
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/util/ByteListImpl.java106
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/util/HexBin.java115
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/xs/AbstractDateTimeDV.java1178
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/xs/AnyAtomicDV.java44
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/xs/AnySimpleDV.java46
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/xs/AnyURIDV.java171
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/xs/Base64BinaryDV.java94
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/xs/BaseDVFactory.java250
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/xs/BaseSchemaDVFactory.java329
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/xs/BooleanDV.java55
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/xs/DateDV.java95
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/xs/DateTimeDV.java96
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/xs/DayDV.java119
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/xs/DayTimeDurationDV.java63
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/xs/DecimalDV.java392
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/xs/DoubleDV.java260
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/xs/DurationDV.java390
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/xs/EntityDV.java56
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/xs/ExtendedSchemaDVFactoryImpl.java86
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/xs/FloatDV.java241
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/xs/FullDVFactory.java168
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/xs/HexBinaryDV.java91
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/xs/IDDV.java55
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/xs/IDREFDV.java53
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/xs/IntegerDV.java44
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/xs/ListDV.java137
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/xs/MonthDV.java168
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/xs/MonthDayDV.java131
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/xs/PrecisionDecimalDV.java446
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/xs/QNameDV.java111
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/xs/SchemaDVFactoryImpl.java77
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/xs/SchemaDateTimeException.java39
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/xs/StringDV.java46
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/xs/TimeDV.java113
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/xs/TypeValidator.java110
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/xs/UnionDV.java47
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/xs/XSSimpleTypeDecl.java3398
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/xs/XSSimpleTypeDelegate.java219
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/xs/YearDV.java127
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/xs/YearMonthDV.java101
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/dv/xs/YearMonthDurationDV.java64
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/io/ASCIIReader.java247
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/io/MalformedByteSequenceException.java139
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/io/UCSReader.java311
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/io/UTF8Reader.java716
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages.properties69
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_de.properties69
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_es.properties69
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_fr.properties69
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_it.properties69
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_ja.properties69
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_ko.properties69
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_pt_BR.properties69
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_sv.properties69
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_zh_CN.properties69
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_zh_TW.properties69
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages.properties29
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_de.properties29
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_es.properties29
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_fr.properties29
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_it.properties29
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_ja.properties29
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_ko.properties29
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_pt_BR.properties29
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_sv.properties29
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_zh_CN.properties29
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_zh_TW.properties29
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages.properties29
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_de.properties29
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_es.properties29
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_fr.properties29
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_it.properties29
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_ja.properties29
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_ko.properties29
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_pt_BR.properties29
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_sv.properties29
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_zh_CN.properties29
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_zh_TW.properties29
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages.properties35
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_de.properties35
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_es.properties35
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_fr.properties35
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_it.properties35
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_ja.properties35
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_ko.properties35
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_pt_BR.properties35
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_sv.properties35
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_zh_CN.properties35
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_zh_TW.properties35
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages.properties36
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_de.properties36
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_es.properties36
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_fr.properties36
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_it.properties36
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_ja.properties36
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_ko.properties36
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_pt_BR.properties36
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_sv.properties36
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_zh_CN.properties36
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_zh_TW.properties36
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter.java121
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_de.java123
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_es.java123
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_fr.java123
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_it.java123
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_ja.java123
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_ko.java123
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_pt_BR.java123
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_sv.java123
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_zh_CN.java123
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_zh_TW.java123
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages.properties305
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_de.properties305
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_es.properties305
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_fr.properties305
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_it.properties305
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ja.properties305
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ko.properties305
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_pt_BR.properties305
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_sv.properties305
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_CN.properties305
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_TW.properties305
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages.properties291
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_de.properties291
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_es.properties291
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_fr.properties291
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_it.properties291
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_ja.properties291
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_ko.properties291
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_pt_BR.properties291
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_sv.properties291
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_zh_CN.properties291
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_zh_TW.properties291
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages.properties32
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_de.properties32
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_es.properties32
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_fr.properties32
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_it.properties32
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_ja.properties32
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_ko.properties32
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_pt_BR.properties32
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_sv.properties32
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_zh_CN.properties32
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_zh_TW.properties32
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages.properties26
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_de.properties26
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_es.properties26
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_fr.properties26
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_it.properties26
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_ja.properties26
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_ko.properties26
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_pt_BR.properties26
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_sv.properties26
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_zh_CN.properties26
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_zh_TW.properties26
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/validation/EntityState.java49
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/validation/ValidationManager.java85
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/validation/ValidationState.java212
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xpath/XPath.java2026
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xpath/XPathException.java61
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xpath/regex/BMPattern.java237
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xpath/regex/CaseInsensitiveMap.java176
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xpath/regex/Match.java186
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xpath/regex/Op.java254
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xpath/regex/ParseException.java55
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xpath/regex/ParserForXMLSchema.java513
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xpath/regex/REUtil.java335
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xpath/regex/RangeToken.java623
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xpath/regex/RegexParser.java1241
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xpath/regex/RegularExpression.java2446
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xpath/regex/Token.java1574
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message.properties41
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_de.properties41
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_es.properties41
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_fr.properties41
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_it.properties41
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_ja.properties41
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_ko.properties41
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_pt_BR.properties41
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_sv.properties41
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_zh_CN.properties41
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_zh_TW.properties41
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/AttributePSVImpl.java222
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/ElementPSVImpl.java277
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/SchemaGrammar.java1688
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/SchemaNamespaceSupport.java112
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/SchemaSymbols.java217
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/SubstitutionGroupHandler.java352
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaException.java53
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaLoader.java1394
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaValidator.java4307
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/XSAnnotationImpl.java187
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/XSAttributeDecl.java215
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/XSAttributeGroupDecl.java402
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/XSAttributeUseImpl.java153
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/XSComplexTypeDecl.java719
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/XSConstraints.java1533
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/XSDDescription.java274
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/XSDeclarationPool.java318
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/XSElementDecl.java388
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/XSGrammarBucket.java240
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/XSGroupDecl.java111
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/XSImplementationImpl.java119
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/XSLoaderImpl.java322
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/XSMessageFormatter.java95
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/XSModelGroupImpl.java246
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/XSModelImpl.java809
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/XSNotationDecl.java121
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/XSParticleDecl.java248
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/XSWildcardDecl.java599
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/identity/Field.java249
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/identity/FieldActivator.java88
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/identity/IdentityConstraint.java250
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/identity/KeyRef.java72
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/identity/Selector.java257
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/identity/UniqueOrKey.java51
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/identity/ValueStore.java70
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/identity/XPathMatcher.java522
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/models/CMBuilder.java450
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/models/CMNodeFactory.java168
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/models/XSAllCM.java224
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMBinOp.java141
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMLeaf.java135
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMRepeatingLeaf.java51
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMUniOp.java112
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMValidator.java111
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/models/XSDFACM.java1242
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/models/XSEmptyCM.java141
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/opti/AttrImpl.java152
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/opti/DefaultDocument.java291
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/opti/DefaultElement.java151
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/opti/DefaultNode.java218
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/opti/DefaultText.java238
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/opti/DefaultXMLDocumentHandler.java871
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/opti/ElementImpl.java274
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/opti/NamedNodeMapImpl.java88
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/opti/NodeImpl.java87
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaDOM.java461
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaDOMImplementation.java67
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaDOMParser.java611
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaParsingConfig.java1031
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/opti/TextImpl.java130
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/traversers/SchemaContentHandler.java382
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/traversers/StAXSchemaParser.java425
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAnnotationInfo.java72
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAttributeChecker.java1822
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAbstractIDConstraintTraverser.java194
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAbstractParticleTraverser.java385
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAbstractTraverser.java853
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAttributeGroupTraverser.java209
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAttributeTraverser.java488
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDComplexTypeTraverser.java1259
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDElementTraverser.java565
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDGroupTraverser.java269
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java4336
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDKeyrefTraverser.java125
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDNotationTraverser.java134
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDSimpleTypeTraverser.java522
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDUniqueOrKeyTraverser.java102
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDWildcardTraverser.java202
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDocumentInfo.java252
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/util/LSInputListImpl.java126
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/util/ObjectListImpl.java119
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/util/ShortListImpl.java124
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/util/SimpleLocator.java147
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/util/StringListImpl.java166
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/util/XInt.java52
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/util/XIntPool.java43
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/util/XSGrammarPool.java74
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/util/XSInputSource.java66
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/util/XSNamedMap4Types.java144
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/util/XSNamedMapImpl.java302
-rw-r--r--src/com/sun/org/apache/xerces/internal/impl/xs/util/XSObjectListImpl.java267
-rw-r--r--src/com/sun/org/apache/xerces/internal/jaxp/DefaultValidationErrorHandler.java62
-rw-r--r--src/com/sun/org/apache/xerces/internal/jaxp/DocumentBuilderFactoryImpl.java222
-rw-r--r--src/com/sun/org/apache/xerces/internal/jaxp/DocumentBuilderImpl.java413
-rw-r--r--src/com/sun/org/apache/xerces/internal/jaxp/JAXPConstants.java41
-rw-r--r--src/com/sun/org/apache/xerces/internal/jaxp/JAXPValidatorComponent.java599
-rw-r--r--src/com/sun/org/apache/xerces/internal/jaxp/SAXParserFactoryImpl.java212
-rw-r--r--src/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java738
-rw-r--r--src/com/sun/org/apache/xerces/internal/jaxp/SchemaValidatorConfiguration.java192
-rw-r--r--src/com/sun/org/apache/xerces/internal/jaxp/TeeXMLDocumentFilterImpl.java176
-rw-r--r--src/com/sun/org/apache/xerces/internal/jaxp/UnparsedEntityHandler.java262
-rw-r--r--src/com/sun/org/apache/xerces/internal/jaxp/datatype/DatatypeFactoryImpl.java652
-rw-r--r--src/com/sun/org/apache/xerces/internal/jaxp/datatype/DurationDayTimeImpl.java196
-rw-r--r--src/com/sun/org/apache/xerces/internal/jaxp/datatype/DurationImpl.java2020
-rw-r--r--src/com/sun/org/apache/xerces/internal/jaxp/datatype/DurationYearMonthImpl.java200
-rw-r--r--src/com/sun/org/apache/xerces/internal/jaxp/datatype/XMLGregorianCalendarImpl.java3093
-rw-r--r--src/com/sun/org/apache/xerces/internal/jaxp/datatype/javax.xml.datatype.DatatypeFactory1
-rw-r--r--src/com/sun/org/apache/xerces/internal/jaxp/javax.xml.parsers.DocumentBuilderFactory1
-rw-r--r--src/com/sun/org/apache/xerces/internal/jaxp/javax.xml.parsers.SAXParserFactory1
-rw-r--r--src/com/sun/org/apache/xerces/internal/jaxp/validation/AbstractXMLSchema.java109
-rw-r--r--src/com/sun/org/apache/xerces/internal/jaxp/validation/DOMDocumentHandler.java89
-rw-r--r--src/com/sun/org/apache/xerces/internal/jaxp/validation/DOMResultAugmentor.java258
-rw-r--r--src/com/sun/org/apache/xerces/internal/jaxp/validation/DOMResultBuilder.java373
-rw-r--r--src/com/sun/org/apache/xerces/internal/jaxp/validation/DOMValidatorHelper.java613
-rw-r--r--src/com/sun/org/apache/xerces/internal/jaxp/validation/DraconianErrorHandler.java62
-rw-r--r--src/com/sun/org/apache/xerces/internal/jaxp/validation/EmptyXMLSchema.java73
-rw-r--r--src/com/sun/org/apache/xerces/internal/jaxp/validation/ErrorHandlerAdaptor.java122
-rw-r--r--src/com/sun/org/apache/xerces/internal/jaxp/validation/JAXPValidationMessageFormatter.java102
-rw-r--r--src/com/sun/org/apache/xerces/internal/jaxp/validation/ReadOnlyGrammarPool.java65
-rw-r--r--src/com/sun/org/apache/xerces/internal/jaxp/validation/SimpleXMLSchema.java81
-rw-r--r--src/com/sun/org/apache/xerces/internal/jaxp/validation/SoftReferenceGrammarPool.java435
-rw-r--r--src/com/sun/org/apache/xerces/internal/jaxp/validation/StAXValidatorHelper.java119
-rw-r--r--src/com/sun/org/apache/xerces/internal/jaxp/validation/StreamValidatorHelper.java198
-rw-r--r--src/com/sun/org/apache/xerces/internal/jaxp/validation/Util.java77
-rw-r--r--src/com/sun/org/apache/xerces/internal/jaxp/validation/ValidatorHandlerImpl.java1087
-rw-r--r--src/com/sun/org/apache/xerces/internal/jaxp/validation/ValidatorHelper.java40
-rw-r--r--src/com/sun/org/apache/xerces/internal/jaxp/validation/ValidatorImpl.java281
-rw-r--r--src/com/sun/org/apache/xerces/internal/jaxp/validation/WeakReferenceXMLSchema.java62
-rw-r--r--src/com/sun/org/apache/xerces/internal/jaxp/validation/WrappedSAXException.java87
-rw-r--r--src/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchema.java66
-rw-r--r--src/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaFactory.java547
-rw-r--r--src/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaValidatorComponentManager.java561
-rw-r--r--src/com/sun/org/apache/xerces/internal/jaxp/validation/XSGrammarPoolContainer.java75
-rw-r--r--src/com/sun/org/apache/xerces/internal/jaxp/validation/javax.xml.validation.SchemaFactory1
-rw-r--r--src/com/sun/org/apache/xerces/internal/parsers/AbstractDOMParser.java2657
-rw-r--r--src/com/sun/org/apache/xerces/internal/parsers/AbstractSAXParser.java2417
-rw-r--r--src/com/sun/org/apache/xerces/internal/parsers/AbstractXMLDocumentParser.java812
-rw-r--r--src/com/sun/org/apache/xerces/internal/parsers/BasicParserConfiguration.java586
-rw-r--r--src/com/sun/org/apache/xerces/internal/parsers/CachingParserPool.java430
-rw-r--r--src/com/sun/org/apache/xerces/internal/parsers/DOMParser.java667
-rw-r--r--src/com/sun/org/apache/xerces/internal/parsers/DOMParserImpl.java1392
-rw-r--r--src/com/sun/org/apache/xerces/internal/parsers/DTDConfiguration.java883
-rw-r--r--src/com/sun/org/apache/xerces/internal/parsers/DTDParser.java481
-rw-r--r--src/com/sun/org/apache/xerces/internal/parsers/IntegratedParserConfiguration.java251
-rw-r--r--src/com/sun/org/apache/xerces/internal/parsers/NonValidatingConfiguration.java806
-rw-r--r--src/com/sun/org/apache/xerces/internal/parsers/SAXParser.java179
-rw-r--r--src/com/sun/org/apache/xerces/internal/parsers/SecurityConfiguration.java114
-rw-r--r--src/com/sun/org/apache/xerces/internal/parsers/StandardParserConfiguration.java385
-rw-r--r--src/com/sun/org/apache/xerces/internal/parsers/XIncludeAwareParserConfiguration.java297
-rw-r--r--src/com/sun/org/apache/xerces/internal/parsers/XIncludeParserConfiguration.java221
-rw-r--r--src/com/sun/org/apache/xerces/internal/parsers/XML11Configurable.java30
-rw-r--r--src/com/sun/org/apache/xerces/internal/parsers/XML11Configuration.java1562
-rw-r--r--src/com/sun/org/apache/xerces/internal/parsers/XML11DTDConfiguration.java1335
-rw-r--r--src/com/sun/org/apache/xerces/internal/parsers/XML11NonValidatingConfiguration.java1230
-rw-r--r--src/com/sun/org/apache/xerces/internal/parsers/XMLDocumentParser.java79
-rw-r--r--src/com/sun/org/apache/xerces/internal/parsers/XMLGrammarCachingConfiguration.java312
-rw-r--r--src/com/sun/org/apache/xerces/internal/parsers/XMLGrammarParser.java54
-rw-r--r--src/com/sun/org/apache/xerces/internal/parsers/XMLGrammarPreparser.java341
-rw-r--r--src/com/sun/org/apache/xerces/internal/parsers/XMLParser.java155
-rw-r--r--src/com/sun/org/apache/xerces/internal/parsers/XPointerParserConfiguration.java243
-rw-r--r--src/com/sun/org/apache/xerces/internal/parsers/org.apache.xerces.xni.parser.DTDConfiguration1
-rw-r--r--src/com/sun/org/apache/xerces/internal/parsers/org.apache.xerces.xni.parser.XML11Configuration1
-rw-r--r--src/com/sun/org/apache/xerces/internal/parsers/org.apache.xerces.xni.parser.XMLParserConfiguration1
-rw-r--r--src/com/sun/org/apache/xerces/internal/parsers/org.xml.sax.driver2
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/AttributesProxy.java192
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/AugmentationsImpl.java286
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/DOMEntityResolverWrapper.java170
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/DOMErrorHandlerWrapper.java422
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/DOMInputSource.java76
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/DOMUtil.java901
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/DatatypeMessageFormatter.java104
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/DefaultErrorHandler.java116
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/DraconianErrorHandler.java90
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/EncodingMap.java981
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/EntityResolver2Wrapper.java215
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/EntityResolverWrapper.java141
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/ErrorHandlerProxy.java80
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/ErrorHandlerWrapper.java232
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/FeatureState.java64
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/HTTPInputSource.java195
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/IntStack.java116
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/JAXPNamespaceContextWrapper.java150
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/LocatorProxy.java88
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/LocatorWrapper.java110
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/MessageFormatter.java60
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/NamespaceContextWrapper.java90
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/NamespaceSupport.java484
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/ParserConfigurationSettings.java332
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/PrimeNumberSequenceGenerator.java45
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/PropertyState.java62
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/SAX2XNI.java256
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/SAXInputSource.java164
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/SAXLocatorWrapper.java111
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/SAXMessageFormatter.java102
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/SecurityManager.java215
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/ShadowedSymbolTable.java121
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/StAXInputSource.java95
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/StAXLocationWrapper.java106
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/Status.java59
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/SymbolHash.java329
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/SymbolTable.java467
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/SynchronizedSymbolTable.java129
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/TeeXMLDocumentFilterImpl.java217
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/URI.java2210
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/XML11Char.java415
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/XMLAttributesImpl.java1296
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/XMLAttributesIteratorImpl.java102
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/XMLCatalogResolver.java586
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/XMLChar.java1065
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/XMLDocumentFilterImpl.java182
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/XMLEntityDescriptionImpl.java181
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/XMLErrorCode.java84
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/XMLGrammarPoolImpl.java366
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/XMLInputSourceAdaptor.java107
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/XMLResourceIdentifierImpl.java230
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/XMLStringBuffer.java230
-rw-r--r--src/com/sun/org/apache/xerces/internal/util/XMLSymbols.java103
-rw-r--r--src/com/sun/org/apache/xerces/internal/utils/ConfigurationError.java58
-rw-r--r--src/com/sun/org/apache/xerces/internal/utils/ObjectFactory.java231
-rw-r--r--src/com/sun/org/apache/xerces/internal/utils/SecuritySupport.java339
-rw-r--r--src/com/sun/org/apache/xerces/internal/utils/XMLLimitAnalyzer.java264
-rw-r--r--src/com/sun/org/apache/xerces/internal/utils/XMLSecurityManager.java581
-rw-r--r--src/com/sun/org/apache/xerces/internal/utils/XMLSecurityPropertyManager.java225
-rw-r--r--src/com/sun/org/apache/xerces/internal/xinclude/MultipleScopeNamespaceSupport.java196
-rw-r--r--src/com/sun/org/apache/xerces/internal/xinclude/SecuritySupport.java152
-rw-r--r--src/com/sun/org/apache/xerces/internal/xinclude/XInclude11TextReader.java62
-rw-r--r--src/com/sun/org/apache/xerces/internal/xinclude/XIncludeHandler.java3080
-rw-r--r--src/com/sun/org/apache/xerces/internal/xinclude/XIncludeMessageFormatter.java90
-rw-r--r--src/com/sun/org/apache/xerces/internal/xinclude/XIncludeNamespaceSupport.java95
-rw-r--r--src/com/sun/org/apache/xerces/internal/xinclude/XIncludeTextReader.java516
-rw-r--r--src/com/sun/org/apache/xerces/internal/xinclude/XPointerElementHandler.java763
-rw-r--r--src/com/sun/org/apache/xerces/internal/xinclude/XPointerFramework.java209
-rw-r--r--src/com/sun/org/apache/xerces/internal/xinclude/XPointerSchema.java45
-rw-r--r--src/com/sun/org/apache/xerces/internal/xni/Augmentations.java89
-rw-r--r--src/com/sun/org/apache/xerces/internal/xni/NamespaceContext.java179
-rw-r--r--src/com/sun/org/apache/xerces/internal/xni/QName.java243
-rw-r--r--src/com/sun/org/apache/xerces/internal/xni/XMLAttributes.java439
-rw-r--r--src/com/sun/org/apache/xerces/internal/xni/XMLDTDContentModelHandler.java273
-rw-r--r--src/com/sun/org/apache/xerces/internal/xni/XMLDTDHandler.java378
-rw-r--r--src/com/sun/org/apache/xerces/internal/xni/XMLDocumentFragmentHandler.java259
-rw-r--r--src/com/sun/org/apache/xerces/internal/xni/XMLDocumentHandler.java296
-rw-r--r--src/com/sun/org/apache/xerces/internal/xni/XMLLocator.java79
-rw-r--r--src/com/sun/org/apache/xerces/internal/xni/XMLResourceIdentifier.java64
-rw-r--r--src/com/sun/org/apache/xerces/internal/xni/XMLString.java191
-rw-r--r--src/com/sun/org/apache/xerces/internal/xni/XNIException.java96
-rw-r--r--src/com/sun/org/apache/xerces/internal/xni/grammars/Grammar.java55
-rw-r--r--src/com/sun/org/apache/xerces/internal/xni/grammars/XMLDTDDescription.java37
-rw-r--r--src/com/sun/org/apache/xerces/internal/xni/grammars/XMLGrammarDescription.java59
-rw-r--r--src/com/sun/org/apache/xerces/internal/xni/grammars/XMLGrammarLoader.java147
-rw-r--r--src/com/sun/org/apache/xerces/internal/xni/grammars/XMLGrammarPool.java105
-rw-r--r--src/com/sun/org/apache/xerces/internal/xni/grammars/XMLSchemaDescription.java138
-rw-r--r--src/com/sun/org/apache/xerces/internal/xni/grammars/XSGrammar.java55
-rw-r--r--src/com/sun/org/apache/xerces/internal/xni/parser/XMLComponent.java126
-rw-r--r--src/com/sun/org/apache/xerces/internal/xni/parser/XMLComponentManager.java90
-rw-r--r--src/com/sun/org/apache/xerces/internal/xni/parser/XMLConfigurationException.java99
-rw-r--r--src/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDContentModelFilter.java35
-rw-r--r--src/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDContentModelSource.java90
-rw-r--r--src/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDFilter.java35
-rw-r--r--src/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDScanner.java109
-rw-r--r--src/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDSource.java49
-rw-r--r--src/com/sun/org/apache/xerces/internal/xni/parser/XMLDocumentFilter.java36
-rw-r--r--src/com/sun/org/apache/xerces/internal/xni/parser/XMLDocumentScanner.java75
-rw-r--r--src/com/sun/org/apache/xerces/internal/xni/parser/XMLDocumentSource.java49
-rw-r--r--src/com/sun/org/apache/xerces/internal/xni/parser/XMLEntityResolver.java61
-rw-r--r--src/com/sun/org/apache/xerces/internal/xni/parser/XMLErrorHandler.java106
-rw-r--r--src/com/sun/org/apache/xerces/internal/xni/parser/XMLInputSource.java254
-rw-r--r--src/com/sun/org/apache/xerces/internal/xni/parser/XMLParseException.java181
-rw-r--r--src/com/sun/org/apache/xerces/internal/xni/parser/XMLParserConfiguration.java253
-rw-r--r--src/com/sun/org/apache/xerces/internal/xni/parser/XMLPullParserConfiguration.java97
-rw-r--r--src/com/sun/org/apache/xerces/internal/xpointer/ElementSchemePointer.java879
-rw-r--r--src/com/sun/org/apache/xerces/internal/xpointer/ShortHandPointer.java296
-rw-r--r--src/com/sun/org/apache/xerces/internal/xpointer/XPointerErrorHandler.java115
-rw-r--r--src/com/sun/org/apache/xerces/internal/xpointer/XPointerHandler.java1248
-rw-r--r--src/com/sun/org/apache/xerces/internal/xpointer/XPointerMessageFormatter.java97
-rw-r--r--src/com/sun/org/apache/xerces/internal/xpointer/XPointerPart.java132
-rw-r--r--src/com/sun/org/apache/xerces/internal/xpointer/XPointerProcessor.java104
-rw-r--r--src/com/sun/org/apache/xerces/internal/xs/AttributePSVI.java33
-rw-r--r--src/com/sun/org/apache/xerces/internal/xs/ElementPSVI.java50
-rw-r--r--src/com/sun/org/apache/xerces/internal/xs/ItemPSVI.java189
-rw-r--r--src/com/sun/org/apache/xerces/internal/xs/LSInputList.java50
-rw-r--r--src/com/sun/org/apache/xerces/internal/xs/PSVIProvider.java93
-rw-r--r--src/com/sun/org/apache/xerces/internal/xs/ShortList.java59
-rw-r--r--src/com/sun/org/apache/xerces/internal/xs/StringList.java57
-rw-r--r--src/com/sun/org/apache/xerces/internal/xs/XSAnnotation.java63
-rw-r--r--src/com/sun/org/apache/xerces/internal/xs/XSAttributeDeclaration.java111
-rw-r--r--src/com/sun/org/apache/xerces/internal/xs/XSAttributeGroupDefinition.java48
-rw-r--r--src/com/sun/org/apache/xerces/internal/xs/XSAttributeUse.java99
-rw-r--r--src/com/sun/org/apache/xerces/internal/xs/XSComplexTypeDefinition.java116
-rw-r--r--src/com/sun/org/apache/xerces/internal/xs/XSConstants.java345
-rw-r--r--src/com/sun/org/apache/xerces/internal/xs/XSElementDeclaration.java180
-rw-r--r--src/com/sun/org/apache/xerces/internal/xs/XSException.java56
-rw-r--r--src/com/sun/org/apache/xerces/internal/xs/XSFacet.java54
-rw-r--r--src/com/sun/org/apache/xerces/internal/xs/XSIDCDefinition.java72
-rw-r--r--src/com/sun/org/apache/xerces/internal/xs/XSImplementation.java51
-rw-r--r--src/com/sun/org/apache/xerces/internal/xs/XSLoader.java93
-rw-r--r--src/com/sun/org/apache/xerces/internal/xs/XSModel.java161
-rw-r--r--src/com/sun/org/apache/xerces/internal/xs/XSModelGroup.java66
-rw-r--r--src/com/sun/org/apache/xerces/internal/xs/XSModelGroupDefinition.java42
-rw-r--r--src/com/sun/org/apache/xerces/internal/xs/XSMultiValueFacet.java43
-rw-r--r--src/com/sun/org/apache/xerces/internal/xs/XSNamedMap.java69
-rw-r--r--src/com/sun/org/apache/xerces/internal/xs/XSNamespaceItem.java110
-rw-r--r--src/com/sun/org/apache/xerces/internal/xs/XSNamespaceItemList.java48
-rw-r--r--src/com/sun/org/apache/xerces/internal/xs/XSNotationDeclaration.java49
-rw-r--r--src/com/sun/org/apache/xerces/internal/xs/XSObject.java58
-rw-r--r--src/com/sun/org/apache/xerces/internal/xs/XSObjectList.java48
-rw-r--r--src/com/sun/org/apache/xerces/internal/xs/XSParticle.java55
-rw-r--r--src/com/sun/org/apache/xerces/internal/xs/XSSimpleTypeDefinition.java242
-rw-r--r--src/com/sun/org/apache/xerces/internal/xs/XSTerm.java30
-rw-r--r--src/com/sun/org/apache/xerces/internal/xs/XSTypeDefinition.java105
-rw-r--r--src/com/sun/org/apache/xerces/internal/xs/XSWildcard.java90
-rw-r--r--src/com/sun/org/apache/xerces/internal/xs/datatypes/ByteList.java64
-rw-r--r--src/com/sun/org/apache/xerces/internal/xs/datatypes/ObjectList.java62
-rw-r--r--src/com/sun/org/apache/xerces/internal/xs/datatypes/XSDateTime.java293
-rw-r--r--src/com/sun/org/apache/xerces/internal/xs/datatypes/XSDecimal.java67
-rw-r--r--src/com/sun/org/apache/xerces/internal/xs/datatypes/XSDouble.java35
-rw-r--r--src/com/sun/org/apache/xerces/internal/xs/datatypes/XSFloat.java35
-rw-r--r--src/com/sun/org/apache/xerces/internal/xs/datatypes/XSQName.java39
-rw-r--r--src/com/sun/org/apache/xerces/internal/xs/datatypes/package.html309
-rw-r--r--src/com/sun/org/apache/xml/internal/dtm/Axis.java222
-rw-r--r--src/com/sun/org/apache/xml/internal/dtm/DTM.java969
-rw-r--r--src/com/sun/org/apache/xml/internal/dtm/DTMAxisIterator.java112
-rw-r--r--src/com/sun/org/apache/xml/internal/dtm/DTMAxisTraverser.java118
-rw-r--r--src/com/sun/org/apache/xml/internal/dtm/DTMConfigurationException.java101
-rw-r--r--src/com/sun/org/apache/xml/internal/dtm/DTMDOMException.java56
-rw-r--r--src/com/sun/org/apache/xml/internal/dtm/DTMException.java385
-rw-r--r--src/com/sun/org/apache/xml/internal/dtm/DTMFilter.java190
-rw-r--r--src/com/sun/org/apache/xml/internal/dtm/DTMIterator.java346
-rw-r--r--src/com/sun/org/apache/xml/internal/dtm/DTMManager.java441
-rw-r--r--src/com/sun/org/apache/xml/internal/dtm/DTMWSFilter.java58
-rw-r--r--src/com/sun/org/apache/xml/internal/dtm/ref/ChunkedIntArray.java308
-rw-r--r--src/com/sun/org/apache/xml/internal/dtm/ref/CoroutineManager.java346
-rw-r--r--src/com/sun/org/apache/xml/internal/dtm/ref/CoroutineParser.java142
-rw-r--r--src/com/sun/org/apache/xml/internal/dtm/ref/CustomStringPool.java91
-rw-r--r--src/com/sun/org/apache/xml/internal/dtm/ref/DTMAxisIterNodeList.java144
-rw-r--r--src/com/sun/org/apache/xml/internal/dtm/ref/DTMAxisIteratorBase.java283
-rw-r--r--src/com/sun/org/apache/xml/internal/dtm/ref/DTMChildIterNodeList.java121
-rw-r--r--src/com/sun/org/apache/xml/internal/dtm/ref/DTMDefaultBase.java2371
-rw-r--r--src/com/sun/org/apache/xml/internal/dtm/ref/DTMDefaultBaseIterators.java2195
-rw-r--r--src/com/sun/org/apache/xml/internal/dtm/ref/DTMDefaultBaseTraversers.java1747
-rw-r--r--src/com/sun/org/apache/xml/internal/dtm/ref/DTMDocumentImpl.java2413
-rw-r--r--src/com/sun/org/apache/xml/internal/dtm/ref/DTMManagerDefault.java861
-rw-r--r--src/com/sun/org/apache/xml/internal/dtm/ref/DTMNamedNodeMap.java302
-rw-r--r--src/com/sun/org/apache/xml/internal/dtm/ref/DTMNodeIterator.java188
-rw-r--r--src/com/sun/org/apache/xml/internal/dtm/ref/DTMNodeList.java129
-rw-r--r--src/com/sun/org/apache/xml/internal/dtm/ref/DTMNodeListBase.java83
-rw-r--r--src/com/sun/org/apache/xml/internal/dtm/ref/DTMNodeProxy.java2415
-rw-r--r--src/com/sun/org/apache/xml/internal/dtm/ref/DTMSafeStringPool.java112
-rw-r--r--src/com/sun/org/apache/xml/internal/dtm/ref/DTMStringPool.java193
-rw-r--r--src/com/sun/org/apache/xml/internal/dtm/ref/DTMTreeWalker.java405
-rw-r--r--src/com/sun/org/apache/xml/internal/dtm/ref/EmptyIterator.java64
-rw-r--r--src/com/sun/org/apache/xml/internal/dtm/ref/ExpandedNameTable.java393
-rw-r--r--src/com/sun/org/apache/xml/internal/dtm/ref/ExtendedType.java147
-rw-r--r--src/com/sun/org/apache/xml/internal/dtm/ref/IncrementalSAXSource.java91
-rw-r--r--src/com/sun/org/apache/xml/internal/dtm/ref/IncrementalSAXSource_Filter.java813
-rw-r--r--src/com/sun/org/apache/xml/internal/dtm/ref/IncrementalSAXSource_Xerces.java457
-rw-r--r--src/com/sun/org/apache/xml/internal/dtm/ref/NodeLocator.java112
-rw-r--r--src/com/sun/org/apache/xml/internal/dtm/ref/dom2dtm/DOM2DTM.java1765
-rw-r--r--src/com/sun/org/apache/xml/internal/dtm/ref/dom2dtm/DOM2DTMdefaultNamespaceDeclarationNode.java680
-rw-r--r--src/com/sun/org/apache/xml/internal/dtm/ref/sax2dtm/SAX2DTM.java2540
-rw-r--r--src/com/sun/org/apache/xml/internal/dtm/ref/sax2dtm/SAX2DTM2.java3385
-rw-r--r--src/com/sun/org/apache/xml/internal/dtm/ref/sax2dtm/SAX2RTFDTM.java364
-rw-r--r--src/com/sun/org/apache/xml/internal/res/XMLErrorResources.java450
-rw-r--r--src/com/sun/org/apache/xml/internal/res/XMLErrorResources_ca.java443
-rw-r--r--src/com/sun/org/apache/xml/internal/res/XMLErrorResources_cs.java443
-rw-r--r--src/com/sun/org/apache/xml/internal/res/XMLErrorResources_de.java450
-rw-r--r--src/com/sun/org/apache/xml/internal/res/XMLErrorResources_en.java33
-rw-r--r--src/com/sun/org/apache/xml/internal/res/XMLErrorResources_es.java450
-rw-r--r--src/com/sun/org/apache/xml/internal/res/XMLErrorResources_fr.java450
-rw-r--r--src/com/sun/org/apache/xml/internal/res/XMLErrorResources_it.java450
-rw-r--r--src/com/sun/org/apache/xml/internal/res/XMLErrorResources_ja.java450
-rw-r--r--src/com/sun/org/apache/xml/internal/res/XMLErrorResources_ko.java450
-rw-r--r--src/com/sun/org/apache/xml/internal/res/XMLErrorResources_pt_BR.java450
-rw-r--r--src/com/sun/org/apache/xml/internal/res/XMLErrorResources_sk.java443
-rw-r--r--src/com/sun/org/apache/xml/internal/res/XMLErrorResources_sv.java450
-rw-r--r--src/com/sun/org/apache/xml/internal/res/XMLErrorResources_tr.java443
-rw-r--r--src/com/sun/org/apache/xml/internal/res/XMLErrorResources_zh_CN.java450
-rw-r--r--src/com/sun/org/apache/xml/internal/res/XMLErrorResources_zh_HK.java77
-rw-r--r--src/com/sun/org/apache/xml/internal/res/XMLErrorResources_zh_TW.java450
-rw-r--r--src/com/sun/org/apache/xml/internal/res/XMLMessages.java159
-rw-r--r--src/com/sun/org/apache/xml/internal/resolver/Catalog.java2204
-rw-r--r--src/com/sun/org/apache/xml/internal/resolver/CatalogEntry.java251
-rw-r--r--src/com/sun/org/apache/xml/internal/resolver/CatalogException.java168
-rw-r--r--src/com/sun/org/apache/xml/internal/resolver/CatalogManager.java846
-rw-r--r--src/com/sun/org/apache/xml/internal/resolver/Resolver.java694
-rw-r--r--src/com/sun/org/apache/xml/internal/resolver/helpers/BootstrapResolver.java200
-rw-r--r--src/com/sun/org/apache/xml/internal/resolver/helpers/Debug.java111
-rw-r--r--src/com/sun/org/apache/xml/internal/resolver/helpers/FileURL.java93
-rw-r--r--src/com/sun/org/apache/xml/internal/resolver/helpers/Namespaces.java114
-rw-r--r--src/com/sun/org/apache/xml/internal/resolver/helpers/PublicId.java161
-rw-r--r--src/com/sun/org/apache/xml/internal/resolver/readers/CatalogReader.java81
-rw-r--r--src/com/sun/org/apache/xml/internal/resolver/readers/DOMCatalogParser.java53
-rw-r--r--src/com/sun/org/apache/xml/internal/resolver/readers/DOMCatalogReader.java243
-rw-r--r--src/com/sun/org/apache/xml/internal/resolver/readers/ExtendedXMLCatalogReader.java187
-rw-r--r--src/com/sun/org/apache/xml/internal/resolver/readers/OASISXMLCatalogReader.java541
-rw-r--r--src/com/sun/org/apache/xml/internal/resolver/readers/SAXCatalogParser.java45
-rw-r--r--src/com/sun/org/apache/xml/internal/resolver/readers/SAXCatalogReader.java502
-rw-r--r--src/com/sun/org/apache/xml/internal/resolver/readers/SAXParserHandler.java150
-rw-r--r--src/com/sun/org/apache/xml/internal/resolver/readers/TR9401CatalogReader.java143
-rw-r--r--src/com/sun/org/apache/xml/internal/resolver/readers/TextCatalogReader.java303
-rw-r--r--src/com/sun/org/apache/xml/internal/resolver/readers/XCatalogReader.java188
-rw-r--r--src/com/sun/org/apache/xml/internal/resolver/tools/CatalogResolver.java343
-rw-r--r--src/com/sun/org/apache/xml/internal/resolver/tools/ResolvingParser.java446
-rw-r--r--src/com/sun/org/apache/xml/internal/resolver/tools/ResolvingXMLFilter.java353
-rw-r--r--src/com/sun/org/apache/xml/internal/resolver/tools/ResolvingXMLReader.java97
-rw-r--r--src/com/sun/org/apache/xml/internal/serialize/BaseMarkupSerializer.java1967
-rw-r--r--src/com/sun/org/apache/xml/internal/serialize/DOMSerializer.java79
-rw-r--r--src/com/sun/org/apache/xml/internal/serialize/DOMSerializerImpl.java1205
-rw-r--r--src/com/sun/org/apache/xml/internal/serialize/ElementState.java108
-rw-r--r--src/com/sun/org/apache/xml/internal/serialize/EncodingInfo.java271
-rw-r--r--src/com/sun/org/apache/xml/internal/serialize/Encodings.java124
-rw-r--r--src/com/sun/org/apache/xml/internal/serialize/HTMLEntities.res290
-rw-r--r--src/com/sun/org/apache/xml/internal/serialize/HTMLSerializer.java876
-rw-r--r--src/com/sun/org/apache/xml/internal/serialize/HTMLdtd.java556
-rw-r--r--src/com/sun/org/apache/xml/internal/serialize/IndentPrinter.java365
-rw-r--r--src/com/sun/org/apache/xml/internal/serialize/LineSeparator.java57
-rw-r--r--src/com/sun/org/apache/xml/internal/serialize/Method.java63
-rw-r--r--src/com/sun/org/apache/xml/internal/serialize/OutputFormat.java961
-rw-r--r--src/com/sun/org/apache/xml/internal/serialize/Printer.java364
-rw-r--r--src/com/sun/org/apache/xml/internal/serialize/SecuritySupport.java152
-rw-r--r--src/com/sun/org/apache/xml/internal/serialize/Serializer.java123
-rw-r--r--src/com/sun/org/apache/xml/internal/serialize/SerializerFactory.java151
-rw-r--r--src/com/sun/org/apache/xml/internal/serialize/SerializerFactoryImpl.java116
-rw-r--r--src/com/sun/org/apache/xml/internal/serialize/TextSerializer.java390
-rw-r--r--src/com/sun/org/apache/xml/internal/serialize/XHTMLSerializer.java104
-rw-r--r--src/com/sun/org/apache/xml/internal/serialize/XML11Serializer.java537
-rw-r--r--src/com/sun/org/apache/xml/internal/serialize/XMLSerializer.java1464
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/AttributesImplSerializer.java238
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/CharInfo.java746
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/DOMSerializer.java68
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/ElemContext.java221
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/ElemDesc.java180
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/EmptySerializer.java752
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/EncodingInfo.java514
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/Encodings.java566
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/Encodings.properties118
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/ExtendedContentHandler.java273
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/ExtendedLexicalHandler.java41
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/HTMLEntities.properties314
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/Method.java78
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/NamespaceMappings.java327
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/OutputPropertiesFactory.java539
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/OutputPropertyUtils.java85
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/SerializationHandler.java134
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/Serializer.java223
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/SerializerBase.java1402
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/SerializerConstants.java61
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/SerializerFactory.java179
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/SerializerTrace.java155
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/SerializerTraceWriter.java343
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/ToHTMLSAXHandler.java747
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/ToHTMLStream.java2320
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/ToSAXHandler.java440
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/ToStream.java3389
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/ToTextSAXHandler.java414
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/ToTextStream.java636
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/ToUnknownStream.java1338
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/ToXMLSAXHandler.java778
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/ToXMLStream.java656
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/TransformStateSetter.java58
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/TreeWalker.java510
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/Version.java152
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/WriterChain.java84
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/WriterToASCI.java157
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/WriterToUTF8Buffered.java505
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/XMLEntities.properties32
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/XSLOutputAttributes.java184
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/output_html.properties46
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/output_text.properties39
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/output_unknown.properties48
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/output_xml.properties48
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/package.html45
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/utils/AttList.java265
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/utils/BoolStack.java206
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/utils/DOM2Helper.java136
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/utils/Messages.java272
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/utils/MsgKey.java102
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages.java205
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ca.java130
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_cs.java122
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_de.java205
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_en.java32
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_es.java205
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_fr.java205
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_it.java205
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ja.java205
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ko.java205
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_pt_BR.java205
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_sv.java205
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_zh_CN.java205
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_zh_TW.java205
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/utils/StringToIntTable.java205
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/utils/SystemIDResolver.java304
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/utils/URI.java1671
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/utils/Utils.java43
-rw-r--r--src/com/sun/org/apache/xml/internal/serializer/utils/WrappedRuntimeException.java83
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/AttList.java256
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/BoolStack.java204
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/CharKey.java86
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/Constants.java114
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/DOM2Helper.java316
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/DOMBuilder.java790
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/DOMHelper.java1330
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/DOMOrder.java43
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/DefaultErrorHandler.java344
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/ElemDesc.java193
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/FastStringBuffer.java1298
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/Hashtree2Node.java142
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/IntStack.java213
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/IntVector.java421
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/ListingErrorHandler.java567
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/LocaleUtility.java88
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/MutableAttrListImpl.java141
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/NSInfo.java112
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/NameSpace.java61
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/NodeConsumer.java42
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/NodeVector.java741
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/ObjectPool.java175
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/ObjectStack.java217
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/ObjectVector.java433
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/PrefixResolver.java74
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/PrefixResolverDefault.java147
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/QName.java711
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/RawCharacterHandler.java44
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/SAXSourceLocator.java172
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/SerializableLocatorImpl.java227
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/StopParseException.java42
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/StringBufferPool.java62
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/StringComparable.java215
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/StringToIntTable.java198
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/StringToStringTable.java244
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/StringToStringTableVector.java201
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/StringVector.java225
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/StylesheetPIHandler.java342
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/SuballocatedByteVector.java500
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/SuballocatedIntVector.java559
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/SystemIDResolver.java297
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/ThreadControllerWrapper.java126
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/TreeWalker.java489
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/Trie.java207
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/URI.java1692
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/UnImplNode.java2054
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/WrappedRuntimeException.java76
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/WrongParserException.java42
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/XML11Char.java432
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/XMLChar.java669
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/XMLCharacterRecognizer.java111
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/XMLReaderManager.java257
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/XMLString.java691
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/XMLStringDefault.java820
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/XMLStringFactory.java73
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/XMLStringFactoryDefault.java86
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/package.html29
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/res/CharArrayWrapper.java44
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/res/IntArrayWrapper.java44
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/res/LongArrayWrapper.java44
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/res/StringArrayWrapper.java44
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/res/XResourceBundle.java75
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/res/XResourceBundleBase.java52
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/res/XResources_de.java76
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/res/XResources_en.java76
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/res/XResources_es.java76
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/res/XResources_fr.java76
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/res/XResources_it.java76
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/res/XResources_ja_JP_A.java89
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/res/XResources_ja_JP_HA.java89
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/res/XResources_ja_JP_HI.java90
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/res/XResources_ja_JP_I.java89
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/res/XResources_ko.java83
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/res/XResources_sv.java76
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/res/XResources_zh_CN.java83
-rw-r--r--src/com/sun/org/apache/xml/internal/utils/res/XResources_zh_TW.java83
-rw-r--r--src/com/sun/org/apache/xpath/internal/Arg.java267
-rw-r--r--src/com/sun/org/apache/xpath/internal/CachedXPathAPI.java337
-rw-r--r--src/com/sun/org/apache/xpath/internal/Expression.java591
-rw-r--r--src/com/sun/org/apache/xpath/internal/ExpressionNode.java53
-rw-r--r--src/com/sun/org/apache/xpath/internal/ExpressionOwner.java46
-rw-r--r--src/com/sun/org/apache/xpath/internal/ExtensionsProvider.java62
-rw-r--r--src/com/sun/org/apache/xpath/internal/FoundIndex.java39
-rw-r--r--src/com/sun/org/apache/xpath/internal/NodeSet.java1372
-rw-r--r--src/com/sun/org/apache/xpath/internal/NodeSetDTM.java1249
-rw-r--r--src/com/sun/org/apache/xpath/internal/SourceTree.java54
-rw-r--r--src/com/sun/org/apache/xpath/internal/SourceTreeManager.java392
-rw-r--r--src/com/sun/org/apache/xpath/internal/VariableStack.java520
-rw-r--r--src/com/sun/org/apache/xpath/internal/WhitespaceStrippingElementMatcher.java56
-rw-r--r--src/com/sun/org/apache/xpath/internal/XPath.java645
-rw-r--r--src/com/sun/org/apache/xpath/internal/XPathAPI.java285
-rw-r--r--src/com/sun/org/apache/xpath/internal/XPathContext.java1324
-rw-r--r--src/com/sun/org/apache/xpath/internal/XPathException.java330
-rw-r--r--src/com/sun/org/apache/xpath/internal/XPathFactory.java52
-rw-r--r--src/com/sun/org/apache/xpath/internal/XPathProcessorException.java56
-rw-r--r--src/com/sun/org/apache/xpath/internal/XPathVisitable.java43
-rw-r--r--src/com/sun/org/apache/xpath/internal/XPathVisitor.java204
-rw-r--r--src/com/sun/org/apache/xpath/internal/axes/AttributeIterator.java77
-rw-r--r--src/com/sun/org/apache/xpath/internal/axes/AxesWalker.java592
-rw-r--r--src/com/sun/org/apache/xpath/internal/axes/BasicTestIterator.java227
-rw-r--r--src/com/sun/org/apache/xpath/internal/axes/ChildIterator.java123
-rw-r--r--src/com/sun/org/apache/xpath/internal/axes/ChildTestIterator.java180
-rw-r--r--src/com/sun/org/apache/xpath/internal/axes/ContextNodeList.java138
-rw-r--r--src/com/sun/org/apache/xpath/internal/axes/DescendantIterator.java383
-rw-r--r--src/com/sun/org/apache/xpath/internal/axes/FilterExprIterator.java216
-rw-r--r--src/com/sun/org/apache/xpath/internal/axes/FilterExprIteratorSimple.java316
-rw-r--r--src/com/sun/org/apache/xpath/internal/axes/FilterExprWalker.java352
-rw-r--r--src/com/sun/org/apache/xpath/internal/axes/HasPositionalPredChecker.java125
-rw-r--r--src/com/sun/org/apache/xpath/internal/axes/IteratorPool.java121
-rw-r--r--src/com/sun/org/apache/xpath/internal/axes/LocPathIterator.java1035
-rw-r--r--src/com/sun/org/apache/xpath/internal/axes/MatchPatternIterator.java333
-rw-r--r--src/com/sun/org/apache/xpath/internal/axes/NodeSequence.java961
-rw-r--r--src/com/sun/org/apache/xpath/internal/axes/OneStepIterator.java347
-rw-r--r--src/com/sun/org/apache/xpath/internal/axes/OneStepIteratorForward.java174
-rw-r--r--src/com/sun/org/apache/xpath/internal/axes/PathComponent.java37
-rw-r--r--src/com/sun/org/apache/xpath/internal/axes/PredicatedNodeTest.java649
-rw-r--r--src/com/sun/org/apache/xpath/internal/axes/RTFIterator.java44
-rw-r--r--src/com/sun/org/apache/xpath/internal/axes/ReverseAxesWalker.java249
-rw-r--r--src/com/sun/org/apache/xpath/internal/axes/SelfIteratorNoPredicate.java130
-rw-r--r--src/com/sun/org/apache/xpath/internal/axes/SubContextList.java54
-rw-r--r--src/com/sun/org/apache/xpath/internal/axes/UnionChildIterator.java152
-rw-r--r--src/com/sun/org/apache/xpath/internal/axes/UnionPathIterator.java586
-rw-r--r--src/com/sun/org/apache/xpath/internal/axes/WalkerFactory.java1827
-rw-r--r--src/com/sun/org/apache/xpath/internal/axes/WalkingIterator.java365
-rw-r--r--src/com/sun/org/apache/xpath/internal/axes/WalkingIteratorSorted.java216
-rw-r--r--src/com/sun/org/apache/xpath/internal/axes/package.html29
-rw-r--r--src/com/sun/org/apache/xpath/internal/compiler/Compiler.java1270
-rw-r--r--src/com/sun/org/apache/xpath/internal/compiler/FuncLoader.java109
-rw-r--r--src/com/sun/org/apache/xpath/internal/compiler/FunctionTable.java410
-rw-r--r--src/com/sun/org/apache/xpath/internal/compiler/Keywords.java390
-rw-r--r--src/com/sun/org/apache/xpath/internal/compiler/Lexer.java664
-rw-r--r--src/com/sun/org/apache/xpath/internal/compiler/OpCodes.java634
-rw-r--r--src/com/sun/org/apache/xpath/internal/compiler/OpMap.java457
-rw-r--r--src/com/sun/org/apache/xpath/internal/compiler/OpMapVector.java118
-rw-r--r--src/com/sun/org/apache/xpath/internal/compiler/PsuedoNames.java61
-rw-r--r--src/com/sun/org/apache/xpath/internal/compiler/XPathDumper.java33
-rw-r--r--src/com/sun/org/apache/xpath/internal/compiler/XPathParser.java2403
-rw-r--r--src/com/sun/org/apache/xpath/internal/compiler/package.html28
-rw-r--r--src/com/sun/org/apache/xpath/internal/domapi/XPathEvaluatorImpl.java273
-rw-r--r--src/com/sun/org/apache/xpath/internal/domapi/XPathExpressionImpl.java185
-rw-r--r--src/com/sun/org/apache/xpath/internal/domapi/XPathNSResolverImpl.java63
-rw-r--r--src/com/sun/org/apache/xpath/internal/domapi/XPathNamespaceImpl.java324
-rw-r--r--src/com/sun/org/apache/xpath/internal/domapi/XPathResultImpl.java512
-rw-r--r--src/com/sun/org/apache/xpath/internal/domapi/XPathStylesheetDOM3Exception.java63
-rw-r--r--src/com/sun/org/apache/xpath/internal/domapi/package.html28
-rw-r--r--src/com/sun/org/apache/xpath/internal/functions/FuncBoolean.java50
-rw-r--r--src/com/sun/org/apache/xpath/internal/functions/FuncCeiling.java49
-rw-r--r--src/com/sun/org/apache/xpath/internal/functions/FuncConcat.java92
-rw-r--r--src/com/sun/org/apache/xpath/internal/functions/FuncContains.java59
-rw-r--r--src/com/sun/org/apache/xpath/internal/functions/FuncCount.java66
-rw-r--r--src/com/sun/org/apache/xpath/internal/functions/FuncCurrent.java84
-rw-r--r--src/com/sun/org/apache/xpath/internal/functions/FuncDoclocation.java73
-rw-r--r--src/com/sun/org/apache/xpath/internal/functions/FuncExtElementAvailable.java99
-rw-r--r--src/com/sun/org/apache/xpath/internal/functions/FuncExtFunction.java342
-rw-r--r--src/com/sun/org/apache/xpath/internal/functions/FuncExtFunctionAvailable.java106
-rw-r--r--src/com/sun/org/apache/xpath/internal/functions/FuncFalse.java58
-rw-r--r--src/com/sun/org/apache/xpath/internal/functions/FuncFloor.java49
-rw-r--r--src/com/sun/org/apache/xpath/internal/functions/FuncGenerateId.java64
-rw-r--r--src/com/sun/org/apache/xpath/internal/functions/FuncId.java153
-rw-r--r--src/com/sun/org/apache/xpath/internal/functions/FuncLang.java84
-rw-r--r--src/com/sun/org/apache/xpath/internal/functions/FuncLast.java108
-rw-r--r--src/com/sun/org/apache/xpath/internal/functions/FuncLocalPart.java59
-rw-r--r--src/com/sun/org/apache/xpath/internal/functions/FuncNamespace.java80
-rw-r--r--src/com/sun/org/apache/xpath/internal/functions/FuncNormalizeSpace.java88
-rw-r--r--src/com/sun/org/apache/xpath/internal/functions/FuncNot.java49
-rw-r--r--src/com/sun/org/apache/xpath/internal/functions/FuncNumber.java49
-rw-r--r--src/com/sun/org/apache/xpath/internal/functions/FuncPosition.java136
-rw-r--r--src/com/sun/org/apache/xpath/internal/functions/FuncQname.java65
-rw-r--r--src/com/sun/org/apache/xpath/internal/functions/FuncRound.java54
-rw-r--r--src/com/sun/org/apache/xpath/internal/functions/FuncStartsWith.java50
-rw-r--r--src/com/sun/org/apache/xpath/internal/functions/FuncString.java49
-rw-r--r--src/com/sun/org/apache/xpath/internal/functions/FuncStringLength.java49
-rw-r--r--src/com/sun/org/apache/xpath/internal/functions/FuncSubstring.java126
-rw-r--r--src/com/sun/org/apache/xpath/internal/functions/FuncSubstringAfter.java57
-rw-r--r--src/com/sun/org/apache/xpath/internal/functions/FuncSubstringBefore.java55
-rw-r--r--src/com/sun/org/apache/xpath/internal/functions/FuncSum.java67
-rw-r--r--src/com/sun/org/apache/xpath/internal/functions/FuncSystemProperty.java188
-rw-r--r--src/com/sun/org/apache/xpath/internal/functions/FuncTranslate.java90
-rw-r--r--src/com/sun/org/apache/xpath/internal/functions/FuncTrue.java58
-rw-r--r--src/com/sun/org/apache/xpath/internal/functions/FuncUnparsedEntityURI.java57
-rw-r--r--src/com/sun/org/apache/xpath/internal/functions/Function.java146
-rw-r--r--src/com/sun/org/apache/xpath/internal/functions/Function2Args.java186
-rw-r--r--src/com/sun/org/apache/xpath/internal/functions/Function3Args.java185
-rw-r--r--src/com/sun/org/apache/xpath/internal/functions/FunctionDef1Arg.java169
-rw-r--r--src/com/sun/org/apache/xpath/internal/functions/FunctionMultiArgs.java238
-rw-r--r--src/com/sun/org/apache/xpath/internal/functions/FunctionOneArg.java176
-rw-r--r--src/com/sun/org/apache/xpath/internal/functions/WrongNumberArgsException.java45
-rw-r--r--src/com/sun/org/apache/xpath/internal/functions/package.html31
-rw-r--r--src/com/sun/org/apache/xpath/internal/jaxp/JAXPExtensionsProvider.java214
-rw-r--r--src/com/sun/org/apache/xpath/internal/jaxp/JAXPPrefixResolver.java128
-rw-r--r--src/com/sun/org/apache/xpath/internal/jaxp/JAXPVariableStack.java74
-rw-r--r--src/com/sun/org/apache/xpath/internal/jaxp/XPathExpressionImpl.java380
-rw-r--r--src/com/sun/org/apache/xpath/internal/jaxp/XPathFactoryImpl.java328
-rw-r--r--src/com/sun/org/apache/xpath/internal/jaxp/XPathImpl.java537
-rw-r--r--src/com/sun/org/apache/xpath/internal/objects/DTMXRTreeFrag.java60
-rw-r--r--src/com/sun/org/apache/xpath/internal/objects/XBoolean.java170
-rw-r--r--src/com/sun/org/apache/xpath/internal/objects/XBooleanStatic.java71
-rw-r--r--src/com/sun/org/apache/xpath/internal/objects/XMLStringFactoryImpl.java103
-rw-r--r--src/com/sun/org/apache/xpath/internal/objects/XNodeSet.java971
-rw-r--r--src/com/sun/org/apache/xpath/internal/objects/XNodeSetForDOM.java130
-rw-r--r--src/com/sun/org/apache/xpath/internal/objects/XNull.java132
-rw-r--r--src/com/sun/org/apache/xpath/internal/objects/XNumber.java439
-rw-r--r--src/com/sun/org/apache/xpath/internal/objects/XObject.java761
-rw-r--r--src/com/sun/org/apache/xpath/internal/objects/XObjectFactory.java163
-rw-r--r--src/com/sun/org/apache/xpath/internal/objects/XRTreeFrag.java303
-rw-r--r--src/com/sun/org/apache/xpath/internal/objects/XRTreeFragSelectWrapper.java156
-rw-r--r--src/com/sun/org/apache/xpath/internal/objects/XString.java1124
-rw-r--r--src/com/sun/org/apache/xpath/internal/objects/XStringForChars.java218
-rw-r--r--src/com/sun/org/apache/xpath/internal/objects/XStringForFSB.java988
-rw-r--r--src/com/sun/org/apache/xpath/internal/objects/package.html29
-rw-r--r--src/com/sun/org/apache/xpath/internal/operations/And.java77
-rw-r--r--src/com/sun/org/apache/xpath/internal/operations/Bool.java70
-rw-r--r--src/com/sun/org/apache/xpath/internal/operations/Div.java69
-rw-r--r--src/com/sun/org/apache/xpath/internal/operations/Equals.java76
-rw-r--r--src/com/sun/org/apache/xpath/internal/operations/Gt.java51
-rw-r--r--src/com/sun/org/apache/xpath/internal/operations/Gte.java52
-rw-r--r--src/com/sun/org/apache/xpath/internal/operations/Lt.java51
-rw-r--r--src/com/sun/org/apache/xpath/internal/operations/Lte.java51
-rw-r--r--src/com/sun/org/apache/xpath/internal/operations/Minus.java70
-rw-r--r--src/com/sun/org/apache/xpath/internal/operations/Mod.java69
-rw-r--r--src/com/sun/org/apache/xpath/internal/operations/Mult.java68
-rw-r--r--src/com/sun/org/apache/xpath/internal/operations/Neg.java67
-rw-r--r--src/com/sun/org/apache/xpath/internal/operations/NotEquals.java51
-rw-r--r--src/com/sun/org/apache/xpath/internal/operations/Number.java71
-rw-r--r--src/com/sun/org/apache/xpath/internal/operations/Operation.java214
-rw-r--r--src/com/sun/org/apache/xpath/internal/operations/Or.java77
-rw-r--r--src/com/sun/org/apache/xpath/internal/operations/Plus.java69
-rw-r--r--src/com/sun/org/apache/xpath/internal/operations/Quo.java54
-rw-r--r--src/com/sun/org/apache/xpath/internal/operations/String.java49
-rw-r--r--src/com/sun/org/apache/xpath/internal/operations/UnaryOperation.java165
-rw-r--r--src/com/sun/org/apache/xpath/internal/operations/Variable.java399
-rw-r--r--src/com/sun/org/apache/xpath/internal/operations/VariableSafeAbsRef.java75
-rw-r--r--src/com/sun/org/apache/xpath/internal/operations/package.html28
-rw-r--r--src/com/sun/org/apache/xpath/internal/package.html29
-rw-r--r--src/com/sun/org/apache/xpath/internal/patterns/ContextMatchStepPattern.java181
-rw-r--r--src/com/sun/org/apache/xpath/internal/patterns/FunctionPattern.java250
-rw-r--r--src/com/sun/org/apache/xpath/internal/patterns/NodeTest.java694
-rw-r--r--src/com/sun/org/apache/xpath/internal/patterns/NodeTestFilter.java41
-rw-r--r--src/com/sun/org/apache/xpath/internal/patterns/StepPattern.java1055
-rw-r--r--src/com/sun/org/apache/xpath/internal/patterns/UnionPattern.java220
-rw-r--r--src/com/sun/org/apache/xpath/internal/patterns/package.html28
-rw-r--r--src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources.java936
-rw-r--r--src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_de.java936
-rw-r--r--src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_en.java33
-rw-r--r--src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_es.java936
-rw-r--r--src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_fr.java936
-rw-r--r--src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_it.java936
-rw-r--r--src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_ja.java936
-rw-r--r--src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_ko.java936
-rw-r--r--src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_pt_BR.java936
-rw-r--r--src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_sv.java936
-rw-r--r--src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_zh_CN.java936
-rw-r--r--src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_zh_TW.java936
-rw-r--r--src/com/sun/org/apache/xpath/internal/res/XPATHMessages.java149
-rw-r--r--src/com/sun/org/apache/xpath/internal/res/package.html32
-rw-r--r--src/com/sun/xml/internal/stream/Entity.java475
-rw-r--r--src/com/sun/xml/internal/stream/EventFilterSupport.java111
-rw-r--r--src/com/sun/xml/internal/stream/StaxEntityResolverWrapper.java84
-rw-r--r--src/com/sun/xml/internal/stream/StaxErrorReporter.java187
-rw-r--r--src/com/sun/xml/internal/stream/StaxXMLInputSource.java88
-rw-r--r--src/com/sun/xml/internal/stream/XMLBufferListener.java50
-rw-r--r--src/com/sun/xml/internal/stream/XMLEntityReader.java302
-rw-r--r--src/com/sun/xml/internal/stream/XMLEntityStorage.java625
-rw-r--r--src/com/sun/xml/internal/stream/XMLEventReaderImpl.java287
-rw-r--r--src/com/sun/xml/internal/stream/XMLInputFactoryImpl.java305
-rw-r--r--src/com/sun/xml/internal/stream/XMLOutputFactoryImpl.java199
-rw-r--r--src/com/sun/xml/internal/stream/dtd/DTDGrammarUtil.java498
-rw-r--r--src/com/sun/xml/internal/stream/dtd/nonvalidating/DTDGrammar.java878
-rw-r--r--src/com/sun/xml/internal/stream/dtd/nonvalidating/XMLAttributeDecl.java62
-rw-r--r--src/com/sun/xml/internal/stream/dtd/nonvalidating/XMLElementDecl.java83
-rw-r--r--src/com/sun/xml/internal/stream/dtd/nonvalidating/XMLNotationDecl.java71
-rw-r--r--src/com/sun/xml/internal/stream/dtd/nonvalidating/XMLSimpleType.java173
-rw-r--r--src/com/sun/xml/internal/stream/events/AttributeImpl.java161
-rw-r--r--src/com/sun/xml/internal/stream/events/CharacterEvent.java196
-rw-r--r--src/com/sun/xml/internal/stream/events/CommentEvent.java76
-rw-r--r--src/com/sun/xml/internal/stream/events/DTDEvent.java104
-rw-r--r--src/com/sun/xml/internal/stream/events/DummyEvent.java258
-rw-r--r--src/com/sun/xml/internal/stream/events/EndDocumentEvent.java61
-rw-r--r--src/com/sun/xml/internal/stream/events/EndElementEvent.java124
-rw-r--r--src/com/sun/xml/internal/stream/events/EntityDeclarationImpl.java150
-rw-r--r--src/com/sun/xml/internal/stream/events/EntityReferenceEvent.java80
-rw-r--r--src/com/sun/xml/internal/stream/events/LocationImpl.java84
-rw-r--r--src/com/sun/xml/internal/stream/events/NamedEvent.java83
-rw-r--r--src/com/sun/xml/internal/stream/events/NamespaceImpl.java101
-rw-r--r--src/com/sun/xml/internal/stream/events/NotationDeclarationImpl.java103
-rw-r--r--src/com/sun/xml/internal/stream/events/ProcessingInstructionEvent.java101
-rw-r--r--src/com/sun/xml/internal/stream/events/StartDocumentEvent.java173
-rw-r--r--src/com/sun/xml/internal/stream/events/StartElementEvent.java231
-rw-r--r--src/com/sun/xml/internal/stream/events/XMLEventAllocatorImpl.java257
-rw-r--r--src/com/sun/xml/internal/stream/events/XMLEventFactoryImpl.java201
-rw-r--r--src/com/sun/xml/internal/stream/javax.xml.stream.XMLEventFactory1
-rw-r--r--src/com/sun/xml/internal/stream/javax.xml.stream.XMLInputFactory1
-rw-r--r--src/com/sun/xml/internal/stream/javax.xml.stream.XMLOutputFactory1
-rw-r--r--src/com/sun/xml/internal/stream/util/BufferAllocator.java121
-rw-r--r--src/com/sun/xml/internal/stream/util/ReadOnlyIterator.java67
-rw-r--r--src/com/sun/xml/internal/stream/util/ThreadLocalBufferAllocator.java53
-rw-r--r--src/com/sun/xml/internal/stream/writers/UTF8OutputStreamWriter.java149
-rw-r--r--src/com/sun/xml/internal/stream/writers/WriterUtility.java254
-rw-r--r--src/com/sun/xml/internal/stream/writers/XMLDOMWriterImpl.java742
-rw-r--r--src/com/sun/xml/internal/stream/writers/XMLEventWriterImpl.java261
-rw-r--r--src/com/sun/xml/internal/stream/writers/XMLOutputSource.java45
-rw-r--r--src/com/sun/xml/internal/stream/writers/XMLStreamWriterImpl.java2206
-rw-r--r--src/com/sun/xml/internal/stream/writers/XMLWriter.java260
-rw-r--r--src/javax/xml/XMLConstants.java392
-rw-r--r--src/javax/xml/datatype/DatatypeConfigurationException.java79
-rw-r--r--src/javax/xml/datatype/DatatypeConstants.java274
-rw-r--r--src/javax/xml/datatype/DatatypeFactory.java1074
-rw-r--r--src/javax/xml/datatype/Duration.java988
-rw-r--r--src/javax/xml/datatype/FactoryFinder.java311
-rw-r--r--src/javax/xml/datatype/SecuritySupport.java106
-rw-r--r--src/javax/xml/datatype/XMLGregorianCalendar.java1062
-rw-r--r--src/javax/xml/datatype/package.html170
-rw-r--r--src/javax/xml/namespace/NamespaceContext.java288
-rw-r--r--src/javax/xml/namespace/QName.java516
-rw-r--r--src/javax/xml/namespace/package.html54
-rw-r--r--src/javax/xml/parsers/DocumentBuilder.java348
-rw-r--r--src/javax/xml/parsers/DocumentBuilderFactory.java607
-rw-r--r--src/javax/xml/parsers/FactoryConfigurationError.java135
-rw-r--r--src/javax/xml/parsers/FactoryFinder.java316
-rw-r--r--src/javax/xml/parsers/ParserConfigurationException.java56
-rw-r--r--src/javax/xml/parsers/SAXParser.java555
-rw-r--r--src/javax/xml/parsers/SAXParserFactory.java443
-rw-r--r--src/javax/xml/parsers/SecuritySupport.java110
-rw-r--r--src/javax/xml/parsers/package.html51
-rw-r--r--src/javax/xml/stream/EventFilter.java50
-rw-r--r--src/javax/xml/stream/FactoryConfigurationError.java125
-rw-r--r--src/javax/xml/stream/FactoryFinder.java375
-rw-r--r--src/javax/xml/stream/Location.java77
-rw-r--r--src/javax/xml/stream/SecuritySupport.java110
-rw-r--r--src/javax/xml/stream/StreamFilter.java51
-rw-r--r--src/javax/xml/stream/XMLEventFactory.java464
-rw-r--r--src/javax/xml/stream/XMLEventReader.java106
-rw-r--r--src/javax/xml/stream/XMLEventWriter.java256
-rw-r--r--src/javax/xml/stream/XMLInputFactory.java510
-rw-r--r--src/javax/xml/stream/XMLOutputFactory.java359
-rw-r--r--src/javax/xml/stream/XMLReporter.java65
-rw-r--r--src/javax/xml/stream/XMLResolver.java60
-rw-r--r--src/javax/xml/stream/XMLStreamConstants.java127
-rw-r--r--src/javax/xml/stream/XMLStreamException.java130
-rw-r--r--src/javax/xml/stream/XMLStreamReader.java704
-rw-r--r--src/javax/xml/stream/XMLStreamWriter.java528
-rw-r--r--src/javax/xml/stream/events/Attribute.java69
-rw-r--r--src/javax/xml/stream/events/Characters.java76
-rw-r--r--src/javax/xml/stream/events/Comment.java45
-rw-r--r--src/javax/xml/stream/events/DTD.java74
-rw-r--r--src/javax/xml/stream/events/EndDocument.java42
-rw-r--r--src/javax/xml/stream/events/EndElement.java59
-rw-r--r--src/javax/xml/stream/events/EntityDeclaration.java80
-rw-r--r--src/javax/xml/stream/events/EntityReference.java62
-rw-r--r--src/javax/xml/stream/events/Namespace.java59
-rw-r--r--src/javax/xml/stream/events/NotationDeclaration.java58
-rw-r--r--src/javax/xml/stream/events/ProcessingInstruction.java52
-rw-r--r--src/javax/xml/stream/events/StartDocument.java74
-rw-r--r--src/javax/xml/stream/events/StartElement.java117
-rw-r--r--src/javax/xml/stream/events/XMLEvent.java178
-rw-r--r--src/javax/xml/stream/util/EventReaderDelegate.java134
-rw-r--r--src/javax/xml/stream/util/StreamReaderDelegate.java287
-rw-r--r--src/javax/xml/stream/util/XMLEventAllocator.java82
-rw-r--r--src/javax/xml/stream/util/XMLEventConsumer.java58
-rw-r--r--src/javax/xml/transform/ErrorListener.java117
-rw-r--r--src/javax/xml/transform/FactoryFinder.java349
-rw-r--r--src/javax/xml/transform/OutputKeys.java200
-rw-r--r--src/javax/xml/transform/Result.java86
-rw-r--r--src/javax/xml/transform/SecuritySupport.java108
-rw-r--r--src/javax/xml/transform/Source.java53
-rw-r--r--src/javax/xml/transform/SourceLocator.java96
-rw-r--r--src/javax/xml/transform/Templates.java82
-rw-r--r--src/javax/xml/transform/Transformer.java339
-rw-r--r--src/javax/xml/transform/TransformerConfigurationException.java102
-rw-r--r--src/javax/xml/transform/TransformerException.java370
-rw-r--r--src/javax/xml/transform/TransformerFactory.java419
-rw-r--r--src/javax/xml/transform/TransformerFactoryConfigurationError.java130
-rw-r--r--src/javax/xml/transform/URIResolver.java50
-rw-r--r--src/javax/xml/transform/dom/DOMLocator.java49
-rw-r--r--src/javax/xml/transform/dom/DOMResult.java362
-rw-r--r--src/javax/xml/transform/dom/DOMSource.java137
-rw-r--r--src/javax/xml/transform/dom/package.html70
-rw-r--r--src/javax/xml/transform/overview.html291
-rw-r--r--src/javax/xml/transform/package.html233
-rw-r--r--src/javax/xml/transform/sax/SAXResult.java144
-rw-r--r--src/javax/xml/transform/sax/SAXSource.java209
-rw-r--r--src/javax/xml/transform/sax/SAXTransformerFactory.java150
-rw-r--r--src/javax/xml/transform/sax/TemplatesHandler.java68
-rw-r--r--src/javax/xml/transform/sax/TransformerHandler.java76
-rw-r--r--src/javax/xml/transform/sax/package.html104
-rw-r--r--src/javax/xml/transform/stax/StAXResult.java183
-rw-r--r--src/javax/xml/transform/stax/StAXSource.java236
-rw-r--r--src/javax/xml/transform/stax/package.html73
-rw-r--r--src/javax/xml/transform/stream/StreamResult.java203
-rw-r--r--src/javax/xml/transform/stream/StreamSource.java284
-rw-r--r--src/javax/xml/transform/stream/package.html64
-rw-r--r--src/javax/xml/validation/Schema.java104
-rw-r--r--src/javax/xml/validation/SchemaFactory.java800
-rw-r--r--src/javax/xml/validation/SchemaFactoryConfigurationError.java80
-rw-r--r--src/javax/xml/validation/SchemaFactoryFinder.java448
-rw-r--r--src/javax/xml/validation/SchemaFactoryLoader.java68
-rw-r--r--src/javax/xml/validation/SecuritySupport.java163
-rw-r--r--src/javax/xml/validation/TypeInfoProvider.java197
-rw-r--r--src/javax/xml/validation/Validator.java524
-rw-r--r--src/javax/xml/validation/ValidatorHandler.java485
-rw-r--r--src/javax/xml/validation/package.html124
-rw-r--r--src/javax/xml/xpath/SecuritySupport.java160
-rw-r--r--src/javax/xml/xpath/XPath.java319
-rw-r--r--src/javax/xml/xpath/XPathConstants.java84
-rw-r--r--src/javax/xml/xpath/XPathException.java176
-rw-r--r--src/javax/xml/xpath/XPathExpression.java200
-rw-r--r--src/javax/xml/xpath/XPathExpressionException.java74
-rw-r--r--src/javax/xml/xpath/XPathFactory.java390
-rw-r--r--src/javax/xml/xpath/XPathFactoryConfigurationException.java73
-rw-r--r--src/javax/xml/xpath/XPathFactoryFinder.java444
-rw-r--r--src/javax/xml/xpath/XPathFunction.java56
-rw-r--r--src/javax/xml/xpath/XPathFunctionException.java72
-rw-r--r--src/javax/xml/xpath/XPathFunctionResolver.java66
-rw-r--r--src/javax/xml/xpath/XPathVariableResolver.java58
-rw-r--r--src/javax/xml/xpath/package.html282
-rw-r--r--src/org/w3c/dom/Attr.java304
-rw-r--r--src/org/w3c/dom/CDATASection.java83
-rw-r--r--src/org/w3c/dom/CharacterData.java182
-rw-r--r--src/org/w3c/dom/Comment.java59
-rw-r--r--src/org/w3c/dom/DOMConfiguration.java442
-rw-r--r--src/org/w3c/dom/DOMError.java116
-rw-r--r--src/org/w3c/dom/DOMErrorHandler.java74
-rw-r--r--src/org/w3c/dom/DOMException.java162
-rw-r--r--src/org/w3c/dom/DOMImplementation.java165
-rw-r--r--src/org/w3c/dom/DOMImplementationList.java72
-rw-r--r--src/org/w3c/dom/DOMImplementationSource.java88
-rw-r--r--src/org/w3c/dom/DOMLocator.java87
-rw-r--r--src/org/w3c/dom/DOMStringList.java79
-rw-r--r--src/org/w3c/dom/Document.java844
-rw-r--r--src/org/w3c/dom/DocumentFragment.java82
-rw-r--r--src/org/w3c/dom/DocumentType.java112
-rw-r--r--src/org/w3c/dom/Element.java468
-rw-r--r--src/org/w3c/dom/Entity.java119
-rw-r--r--src/org/w3c/dom/EntityReference.java72
-rw-r--r--src/org/w3c/dom/NameList.java97
-rw-r--r--src/org/w3c/dom/NamedNodeMap.java212
-rw-r--r--src/org/w3c/dom/Node.java953
-rw-r--r--src/org/w3c/dom/NodeList.java70
-rw-r--r--src/org/w3c/dom/Notation.java69
-rw-r--r--src/org/w3c/dom/ProcessingInstruction.java80
-rw-r--r--src/org/w3c/dom/Text.java187
-rw-r--r--src/org/w3c/dom/TypeInfo.java214
-rw-r--r--src/org/w3c/dom/UserDataHandler.java101
-rw-r--r--src/org/w3c/dom/bootstrap/DOMImplementationRegistry.java429
-rw-r--r--src/org/w3c/dom/css/CSS2Properties.java1806
-rw-r--r--src/org/w3c/dom/css/CSSCharsetRule.java80
-rw-r--r--src/org/w3c/dom/css/CSSFontFaceRule.java57
-rw-r--r--src/org/w3c/dom/css/CSSImportRule.java73
-rw-r--r--src/org/w3c/dom/css/CSSMediaRule.java105
-rw-r--r--src/org/w3c/dom/css/CSSPageRule.java73
-rw-r--r--src/org/w3c/dom/css/CSSPrimitiveValue.java325
-rw-r--r--src/org/w3c/dom/css/CSSRule.java126
-rw-r--r--src/org/w3c/dom/css/CSSRuleList.java72
-rw-r--r--src/org/w3c/dom/css/CSSStyleDeclaration.java191
-rw-r--r--src/org/w3c/dom/css/CSSStyleRule.java76
-rw-r--r--src/org/w3c/dom/css/CSSStyleSheet.java114
-rw-r--r--src/org/w3c/dom/css/CSSUnknownRule.java51
-rw-r--r--src/org/w3c/dom/css/CSSValue.java100
-rw-r--r--src/org/w3c/dom/css/CSSValueList.java75
-rw-r--r--src/org/w3c/dom/css/Counter.java67
-rw-r--r--src/org/w3c/dom/css/DOMImplementationCSS.java69
-rw-r--r--src/org/w3c/dom/css/DocumentCSS.java79
-rw-r--r--src/org/w3c/dom/css/ElementCSSInlineStyle.java61
-rw-r--r--src/org/w3c/dom/css/RGBColor.java76
-rw-r--r--src/org/w3c/dom/css/Rect.java73
-rw-r--r--src/org/w3c/dom/css/ViewCSS.java72
-rw-r--r--src/org/w3c/dom/events/DocumentEvent.java85
-rw-r--r--src/org/w3c/dom/events/Event.java170
-rw-r--r--src/org/w3c/dom/events/EventException.java65
-rw-r--r--src/org/w3c/dom/events/EventListener.java70
-rw-r--r--src/org/w3c/dom/events/EventTarget.java131
-rw-r--r--src/org/w3c/dom/events/MouseEvent.java185
-rw-r--r--src/org/w3c/dom/events/MutationEvent.java137
-rw-r--r--src/org/w3c/dom/events/UIEvent.java87
-rw-r--r--src/org/w3c/dom/html/HTMLAnchorElement.java140
-rw-r--r--src/org/w3c/dom/html/HTMLAppletElement.java131
-rw-r--r--src/org/w3c/dom/html/HTMLAreaElement.java107
-rw-r--r--src/org/w3c/dom/html/HTMLBRElement.java56
-rw-r--r--src/org/w3c/dom/html/HTMLBaseElement.java62
-rw-r--r--src/org/w3c/dom/html/HTMLBaseFontElement.java71
-rw-r--r--src/org/w3c/dom/html/HTMLBodyElement.java97
-rw-r--r--src/org/w3c/dom/html/HTMLButtonElement.java95
-rw-r--r--src/org/w3c/dom/html/HTMLCollection.java85
-rw-r--r--src/org/w3c/dom/html/HTMLDListElement.java56
-rw-r--r--src/org/w3c/dom/html/HTMLDOMImplementation.java63
-rw-r--r--src/org/w3c/dom/html/HTMLDirectoryElement.java57
-rw-r--r--src/org/w3c/dom/html/HTMLDivElement.java56
-rw-r--r--src/org/w3c/dom/html/HTMLDocument.java183
-rw-r--r--src/org/w3c/dom/html/HTMLElement.java94
-rw-r--r--src/org/w3c/dom/html/HTMLFieldSetElement.java56
-rw-r--r--src/org/w3c/dom/html/HTMLFontElement.java71
-rw-r--r--src/org/w3c/dom/html/HTMLFormElement.java115
-rw-r--r--src/org/w3c/dom/html/HTMLFrameElement.java114
-rw-r--r--src/org/w3c/dom/html/HTMLFrameSetElement.java63
-rw-r--r--src/org/w3c/dom/html/HTMLHRElement.java78
-rw-r--r--src/org/w3c/dom/html/HTMLHeadElement.java56
-rw-r--r--src/org/w3c/dom/html/HTMLHeadingElement.java57
-rw-r--r--src/org/w3c/dom/html/HTMLHtmlElement.java57
-rw-r--r--src/org/w3c/dom/html/HTMLIFrameElement.java127
-rw-r--r--src/org/w3c/dom/html/HTMLImageElement.java138
-rw-r--r--src/org/w3c/dom/html/HTMLInputElement.java225
-rw-r--r--src/org/w3c/dom/html/HTMLIsIndexElement.java63
-rw-r--r--src/org/w3c/dom/html/HTMLLIElement.java64
-rw-r--r--src/org/w3c/dom/html/HTMLLabelElement.java70
-rw-r--r--src/org/w3c/dom/html/HTMLLegendElement.java71
-rw-r--r--src/org/w3c/dom/html/HTMLLinkElement.java112
-rw-r--r--src/org/w3c/dom/html/HTMLMapElement.java61
-rw-r--r--src/org/w3c/dom/html/HTMLMenuElement.java57
-rw-r--r--src/org/w3c/dom/html/HTMLMetaElement.java77
-rw-r--r--src/org/w3c/dom/html/HTMLModElement.java64
-rw-r--r--src/org/w3c/dom/html/HTMLOListElement.java70
-rw-r--r--src/org/w3c/dom/html/HTMLObjectElement.java188
-rw-r--r--src/org/w3c/dom/html/HTMLOptGroupElement.java64
-rw-r--r--src/org/w3c/dom/html/HTMLOptionElement.java106
-rw-r--r--src/org/w3c/dom/html/HTMLParagraphElement.java56
-rw-r--r--src/org/w3c/dom/html/HTMLParamElement.java79
-rw-r--r--src/org/w3c/dom/html/HTMLPreElement.java56
-rw-r--r--src/org/w3c/dom/html/HTMLQuoteElement.java57
-rw-r--r--src/org/w3c/dom/html/HTMLScriptElement.java95
-rw-r--r--src/org/w3c/dom/html/HTMLSelectElement.java162
-rw-r--r--src/org/w3c/dom/html/HTMLStyleElement.java70
-rw-r--r--src/org/w3c/dom/html/HTMLTableCaptionElement.java56
-rw-r--r--src/org/w3c/dom/html/HTMLTableCellElement.java154
-rw-r--r--src/org/w3c/dom/html/HTMLTableColElement.java91
-rw-r--r--src/org/w3c/dom/html/HTMLTableElement.java217
-rw-r--r--src/org/w3c/dom/html/HTMLTableRowElement.java131
-rw-r--r--src/org/w3c/dom/html/HTMLTableSectionElement.java113
-rw-r--r--src/org/w3c/dom/html/HTMLTextAreaElement.java142
-rw-r--r--src/org/w3c/dom/html/HTMLTitleElement.java55
-rw-r--r--src/org/w3c/dom/html/HTMLUListElement.java63
-rw-r--r--src/org/w3c/dom/ls/DOMImplementationLS.java151
-rw-r--r--src/org/w3c/dom/ls/LSException.java76
-rw-r--r--src/org/w3c/dom/ls/LSInput.java247
-rw-r--r--src/org/w3c/dom/ls/LSLoadEvent.java64
-rw-r--r--src/org/w3c/dom/ls/LSOutput.java135
-rw-r--r--src/org/w3c/dom/ls/LSParser.java495
-rw-r--r--src/org/w3c/dom/ls/LSParserFilter.java201
-rw-r--r--src/org/w3c/dom/ls/LSProgressEvent.java77
-rw-r--r--src/org/w3c/dom/ls/LSResourceResolver.java110
-rw-r--r--src/org/w3c/dom/ls/LSSerializer.java465
-rw-r--r--src/org/w3c/dom/ls/LSSerializerFilter.java92
-rw-r--r--src/org/w3c/dom/package.html13
-rw-r--r--src/org/w3c/dom/ranges/DocumentRange.java62
-rw-r--r--src/org/w3c/dom/ranges/Range.java445
-rw-r--r--src/org/w3c/dom/ranges/RangeException.java68
-rw-r--r--src/org/w3c/dom/ranges/package.html111
-rw-r--r--src/org/w3c/dom/stylesheets/DocumentStyle.java63
-rw-r--r--src/org/w3c/dom/stylesheets/LinkStyle.java60
-rw-r--r--src/org/w3c/dom/stylesheets/MediaList.java114
-rw-r--r--src/org/w3c/dom/stylesheets/StyleSheet.java132
-rw-r--r--src/org/w3c/dom/stylesheets/StyleSheetList.java71
-rw-r--r--src/org/w3c/dom/traversal/DocumentTraversal.java122
-rw-r--r--src/org/w3c/dom/traversal/NodeFilter.java173
-rw-r--r--src/org/w3c/dom/traversal/NodeIterator.java138
-rw-r--r--src/org/w3c/dom/traversal/TreeWalker.java208
-rw-r--r--src/org/w3c/dom/views/AbstractView.java56
-rw-r--r--src/org/w3c/dom/views/DocumentView.java59
-rw-r--r--src/org/w3c/dom/xpath/COPYRIGHT.html106
-rw-r--r--src/org/w3c/dom/xpath/XPathEvaluator.java162
-rw-r--r--src/org/w3c/dom/xpath/XPathException.java68
-rw-r--r--src/org/w3c/dom/xpath/XPathExpression.java95
-rw-r--r--src/org/w3c/dom/xpath/XPathNSResolver.java64
-rw-r--r--src/org/w3c/dom/xpath/XPathNamespace.java94
-rw-r--r--src/org/w3c/dom/xpath/XPathResult.java241
-rw-r--r--src/org/xml/sax/AttributeList.java217
-rw-r--r--src/org/xml/sax/Attributes.java281
-rw-r--r--src/org/xml/sax/COPYING12
-rw-r--r--src/org/xml/sax/COPYING.txt39
-rw-r--r--src/org/xml/sax/ContentHandler.java443
-rw-r--r--src/org/xml/sax/DTDHandler.java141
-rw-r--r--src/org/xml/sax/DocumentHandler.java256
-rw-r--r--src/org/xml/sax/EntityResolver.java143
-rw-r--r--src/org/xml/sax/ErrorHandler.java163
-rw-r--r--src/org/xml/sax/HandlerBase.java393
-rw-r--r--src/org/xml/sax/InputSource.java360
-rw-r--r--src/org/xml/sax/Locator.java160
-rw-r--r--src/org/xml/sax/Parser.java233
-rw-r--r--src/org/xml/sax/SAXException.java188
-rw-r--r--src/org/xml/sax/SAXNotRecognizedException.java79
-rw-r--r--src/org/xml/sax/SAXNotSupportedException.java79
-rw-r--r--src/org/xml/sax/SAXParseException.java313
-rw-r--r--src/org/xml/sax/XMLFilter.java89
-rw-r--r--src/org/xml/sax/XMLReader.java428
-rw-r--r--src/org/xml/sax/ext/Attributes2.java156
-rw-r--r--src/org/xml/sax/ext/Attributes2Impl.java332
-rw-r--r--src/org/xml/sax/ext/DeclHandler.java170
-rw-r--r--src/org/xml/sax/ext/DefaultHandler2.java154
-rw-r--r--src/org/xml/sax/ext/EntityResolver2.java221
-rw-r--r--src/org/xml/sax/ext/LexicalHandler.java236
-rw-r--r--src/org/xml/sax/ext/Locator2.java99
-rw-r--r--src/org/xml/sax/ext/Locator2Impl.java125
-rw-r--r--src/org/xml/sax/ext/package.html46
-rw-r--r--src/org/xml/sax/helpers/AttributeListImpl.java336
-rw-r--r--src/org/xml/sax/helpers/AttributesImpl.java641
-rw-r--r--src/org/xml/sax/helpers/DefaultHandler.java491
-rw-r--r--src/org/xml/sax/helpers/LocatorImpl.java238
-rw-r--r--src/org/xml/sax/helpers/NamespaceSupport.java850
-rw-r--r--src/org/xml/sax/helpers/NewInstance.java87
-rw-r--r--src/org/xml/sax/helpers/ParserAdapter.java1071
-rw-r--r--src/org/xml/sax/helpers/ParserFactory.java147
-rw-r--r--src/org/xml/sax/helpers/SecuritySupport.java108
-rw-r--r--src/org/xml/sax/helpers/XMLFilterImpl.java737
-rw-r--r--src/org/xml/sax/helpers/XMLReaderAdapter.java562
-rw-r--r--src/org/xml/sax/helpers/XMLReaderFactory.java244
-rw-r--r--src/org/xml/sax/helpers/package.html11
-rw-r--r--src/org/xml/sax/package.html297
2076 files changed, 0 insertions, 592773 deletions
diff --git a/.hgignore b/.hgignore
deleted file mode 100644
index 970fc82..0000000
--- a/.hgignore
+++ /dev/null
@@ -1,7 +0,0 @@
-^build/
-^dist/
-^drop/
-^drop_included/
-^webrev/
-/nbproject/private/
-^.hgtip
diff --git a/.hgtags b/.hgtags
deleted file mode 100644
index 0575ee8..0000000
--- a/.hgtags
+++ /dev/null
@@ -1,699 +0,0 @@
-6ce5f4757bde08f7470cbb9f0b46da8f2f3d4f56 jdk7-b24
-a3b3ba7d6034dc754b51ddc3d281399ac1cae5f1 jdk7-b25
-da43cb85fac1646d6f97e4a35e510bbfdff97bdb jdk7-b26
-bafed478d67c3acf7744aaad88b9404261ea6739 jdk7-b27
-b996318955c0ad8e9fa0ffb56c74f626786e863f jdk7-b28
-617ee8607cfd5fd81f233f3c0b690f85084687a0 jdk7-b29
-2d94a238a1641d074e6032dcdceed461d6f85d6a jdk7-b30
-255d64ee287e926e8629dd80bc67690e65eeba30 jdk7-b31
-400a5ee432cc2db9031e06852ddde9264a192b48 jdk7-b32
-95375835527f0bf06124ce984266e2ad5de8a6dc jdk7-b33
-01facdf8cabdeaaf68cca037aef56cc5f074897f jdk7-b34
-eac46d1eb7f0935ba04f1c7929ec15423fd0309e jdk7-b35
-c84ca638db42a8b6b227b4e3b63bca192c5ca634 jdk7-b36
-af49591bc486d82aa04b832257de0d18adc9af52 jdk7-b37
-e9f750f0a3a00413a7b77028b2ecdabb7129ae32 jdk7-b38
-831b80be6cea8e7d7da197ccdac5fd4c701a5033 jdk7-b39
-54946f466e2c047c44c903f1bec400b685c2508e jdk7-b40
-0758bd3e2852e4f931ba211cc4d48f589450eeb4 jdk7-b41
-036e0dca841a5a17f784d15c86a9da88d2a6f1e6 jdk7-b42
-96fe28d4a9131e1a97bfe00f779e5626cd09c4d0 jdk7-b43
-b203df0741af3eb08687bc5eb798bac87363758d jdk7-b44
-0f113667880d335cfa2c35721b1b45144fb757f5 jdk7-b45
-b2271877894af809b7703767fe8d4e38591a02a2 jdk7-b46
-d711ad1954b294957737ea386cfd4d3c05028a36 jdk7-b47
-39de90eb4822cafaacc69edd67ab5547e55ae920 jdk7-b48
-5c1f24531903573c1830775432276da567243f9c jdk7-b49
-e8514e2be76d90889ebdb90d627aca2db5c150c6 jdk7-b50
-ae890d80d5dffcd4dc77a1f17d768e192d1852c7 jdk7-b51
-69ad87dc25cbcaaaded4727199395ad0c78bc427 jdk7-b52
-e8837366d3fd72f7c7a47ebfdbd5106c16156f12 jdk7-b53
-946a9f0c493261fa6a010dc33e61b9b535ba80c1 jdk7-b54
-039945fba683ee6773a721e2bd4e449f6133769a jdk7-b55
-c197c6801271c60f9c9f5d18fcc95b59e76dcd54 jdk7-b56
-e4851e9f7be26fc52a628be06ffa8aaea0919bd7 jdk7-b57
-13bf67d8c6341b841d268985cabaf747f2652bc8 jdk7-b58
-75113d7ce083048e7576b9d0d60a4e80db6b181f jdk7-b59
-259aef5045a155eb6a2f8dd0e2429c6dbe0f652f jdk7-b60
-f1ac756616eaaad795f77f7f5e7f7c7bfdc9c1de jdk7-b61
-a97dd57a62604c35c79bc2fa77a612ed547f6135 jdk7-b62
-ae449e9c04c1fe651bd30f0f4d4cc24ba794e0c4 jdk7-b63
-a10eec7a1edf536f39b5828d8623054dbc62c2b7 jdk7-b64
-008c662e0ee9a91aebb75e46b97de979083d5c1c jdk7-b65
-22f9d5d5b5fe0f47048f41e6c6e54fee5edad0ec jdk7-b66
-a033af8d824a408d3ac602205ecdefc128749e1e jdk7-b67
-83b2a9331383f9db7a49350d4cb13b7635f6b861 jdk7-b68
-a4ab0d6ded63bed0fd1e5be55d38090e0ee5efb7 jdk7-b69
-c83f0106b78a85c7e614d27a328675460b2081cf jdk7-b70
-ff94d8ce0daded647bb326630e643d010357afce jdk7-b71
-37c805b6156fd492c12301688b54a6bcca39e729 jdk7-b72
-feb05980f9f2964e6bc2b3a8532f9b3054c2289b jdk7-b73
-ea7b88c676dd8b269bc858a4a17c14dc96c8aed1 jdk7-b74
-555fb78ee4cebed082ca7ddabff46d2e5b4c9026 jdk7-b75
-233a4871d3364ec305efd4a58cfd676620a03a90 jdk7-b76
-bfadab8c7b1bf806a49d3e1bc19ec919717f057a jdk7-b77
-7a12d3789e1b07a560fc79568b991818d617ede2 jdk7-b78
-b1005c504358c18694c84e95fec16b28cdce7ae1 jdk7-b79
-9219574db5936367114b0f31469837f27d5a375a jdk7-b80
-204e59d488cdaa9eafa8cb7164ea955b5a9d4a51 jdk7-b81
-c876ad22e4bf9d3c6460080db7ace478e29a3ff9 jdk7-b82
-309a0a7fc6ceb1c9fc3a85b3608e97ef8f7b0dfd jdk7-b83
-32c0cf01d555747918529a6ff9e06b0090c7a474 jdk7-b84
-6c0ccabb430dacdcd4479f8b197980d5da4eeb66 jdk7-b85
-81c0f115bbe5d3bcf59864465b5eca5538567c79 jdk7-b86
-8b493f1aa136d86de0885fcba15262c4fa2b1412 jdk7-b87
-d8ebd15910034f2ba50b2f129f959f86cca01419 jdk7-b88
-d2818fd2b036f3b3154a9a7de41afcf4ac679c1b jdk7-b89
-c5d932ee326d6f7fd4634b11c7185ea82d184df2 jdk7-b90
-b89b2c3044a298d542f84a2e9d957202b7d8cdb9 jdk7-b91
-e6a40e4bb10499fb6ee9db71ab5654e5a17ab75b jdk7-b92
-c725ca829c5aa4b50a8ed5728579ec8809fbfb1d jdk7-b93
-2de307cd3b4e71127e75dff70809c1b1fbc1a494 jdk7-b94
-07050840f98cda357aa6a8d416fdccbd03038d35 jdk7-b95
-9510ed0e1c7ab46a8b6659234e1dc7786407a72b jdk7-b96
-ca01ec32561fee1855630b68a2fcd0042257a8ef jdk7-b97
-d4adf4f2d14c7b79df0a81de884b6b57c6850802 jdk7-b98
-7ef8469021fbc824ac49d57c83a14b1bb08f1766 jdk7-b99
-d524be5ef62e8b8cb890c59a5d2c19ef0ab50d45 jdk7-b100
-17f62a566a2020fd908e77106ed885e0c4e7c14d jdk7-b101
-15573625af97d01c4e24549041cba7584da7fe88 jdk7-b102
-b7722e8788644507c10bb69a137de422d0300b24 jdk7-b103
-d42c4acb6424a094bdafe2ad9c8c1c7ca7fb7b7e jdk7-b104
-3233b9a4c12ef2663a356d08bb141c02736c7f49 jdk7-b105
-5ba8469212a6cab95ca652eea414b753be7d245a jdk7-b106
-20ee37c1372a3eaefa49b426c6eb68a2e8f5d6e2 jdk7-b107
-7d379f8934caf255f53def1310c0ef0f1b512601 jdk7-b108
-0f382d6120fc07aed2209484a42458cabf405916 jdk7-b109
-d422dbdd09766269344b796b3a46a5b3f74557e1 jdk7-b110
-8106c747067c905d814a737a57fea0e29057b33f jdk7-b111
-1b05254242881527b4d5d711295c0fe708c8823a jdk7-b112
-bc0c84ce54c34d3e8b0604b94da0d7c75c26755e jdk7-b113
-d57197d22c2bfc39d1a860040f655b466ab46f52 jdk7-b114
-dc1612e1d3ac08eb8fcad764daff21c9247d33c9 jdk7-b115
-f8d4e6c6cfce1cda23fcbd144628a9791a9e1a63 jdk7-b116
-9ee4d96e893436a48607924227dadd2d93b9b00d jdk7-b117
-b2f6d9c4f12ffd307a5de40455b2b61b31a5cb79 jdk7-b118
-9ee900f01c5872551c06f33ae909662ffd8463ac jdk7-b119
-4821de0908defe647fcdaab4485f98873e24dea0 jdk7-b120
-63dae40fa19fd3bf4689ea2f3c1d9d690e1abcee jdk7-b121
-03ff13d19c8fa983cbab6542930a7f352e9b5b33 jdk7-b122
-e2aedea6495d61557326928de20dbb2d78fdd9aa jdk7-b123
-57ed1f3bec72924cdad102f9bf90f7449ea7bb83 jdk7-b124
-6c9bdee0cc3a8912acc5189cc092b8cba6851f9d jdk7-b125
-2fde639439c1fb3fbc44f533d48bb2916e813312 jdk7-b126
-c532d6dbc8d18d55b5d693599ee5cd8250e16eb4 jdk7-b127
-a42c6132c746c86e9fc27ec80cbd699f6ee5edca jdk7-b128
-f5b60c5a310f992c6ca627d17ca3e042f0e0b2c3 jdk7-b129
-ab107c1bc4b918404b191838c455e9b2892389f3 jdk7-b130
-eab6f27131e4e2f0af0016b35b18ae65cdd249d9 jdk7-b131
-abe04c59a556a3821c30bd8839e3c74f5d4281d1 jdk7-b132
-8e1148c7911b02e00a727461525f239da025cab7 jdk7-b133
-d56b326ae0544fc16c3e0d0285876f3c82054db2 jdk7-b134
-4aa9916693dc1078580c1865e6f2584046851e5a jdk7-b135
-1759daa85d33800bd578853f9531f9de73f70fc7 jdk7-b136
-1d87f7460cde7f8f30af668490f82b52b879bfd8 jdk7-b137
-be3758943770a0a3dd4be6a1cb4063507c4d7062 jdk7-b138
-28c7c0ed2444607829ba11ad827f8d52197a2830 jdk7-b139
-c8136fd161c83917f87e93b14fa2ba3483f9be83 jdk7-b140
-e1b5ef243445bf836d095fd44866e1771ef99374 jdk7-b141
-7d067af4b25e4b7e6b28bef48527d67f8650e6c5 jdk7-b142
-16b847e9bbd747f9d27785b2fc20d4d720cca893 jdk7-b143
-39bf6dcaab2336326b21743cef7042d0a2de9ba0 jdk7-b144
-10ca7570f47f2ae4132648f7e8da1a05f1a98a15 jdk7-b145
-bcd31fa1e3c6f51b4fdd427ef905188cdac57164 jdk7-b146
-fc268cd1dd5d2e903ccd4b0275e1f9c2461ed30c jdk7-b147
-4f0fcb812767594fe9de509f946b56942db5a2f0 jdk8-b01
-ca4d6ad55a660f0469882e85b4dacf7822d50abf jdk8-b02
-7a74371ce0c64108b857c497ae130dfe9514532c jdk8-b03
-acbcadef0b21582abf406f07f1b74d2b8f80dc01 jdk8-b04
-ff0a3d78e7a22743eabbaa71e9d17b2f094ddf62 jdk8-b05
-d7b8192e7277c49b9c702f4c4fd99bd83ba947ea jdk8-b06
-c114306576dcc1cb871a48058b41bf7d87ce882a jdk8-b07
-de4794dd69c48b08029d158a972993ff9d5627df jdk8-b08
-93554324c014282571aeeb48552ad00d3fedb089 jdk8-b09
-d21a4d5141c04bc9e88f2c0253121d449b66d667 jdk8-b10
-d1b7a4f6dd2065fdeafbcdfd9dcc0072da8c6881 jdk8-b11
-ca977d167697a561c04894187fc1c4d927582ffa jdk8-b12
-bcc739229f6384786c7ac0b52c1822c85674dcf1 jdk8-b13
-9d0c9d638757cb09de18933b946fa04b4f3fb94f jdk8-b14
-804f666d6d44e33caac12ad8da3d2780ac44ef72 jdk8-b15
-09eb517404b059607aca30cdd1af83ffc57eafeb jdk8-b17
-09eb517404b059607aca30cdd1af83ffc57eafeb jdk8-b16
-ebec6a7e8d4e481d205a2109ddeea8121d76db7f jdk8-b18
-dffeb62b1a7fc8b316bf58fe5479323f3661894e jdk8-b19
-f052abb8f37444ba77858913887d0d92795dd6b8 jdk8-b20
-d41eeadf5c1344b88c5051a997aec9e1ad7ce1db jdk8-b21
-cf9d6ec44f891236ad18451021d6dcd57dc82f7b jdk8-b22
-95102fd334183d15dc98a95dd0d749527b6c7300 jdk8-b23
-7836655e2495646c462f13de73dcc3ada197b64f jdk8-b24
-bb694c151fc7b5c8f9edc8af6a80738530feacaf jdk8-b25
-dbb7283c197b27da1fc12ae8a83785c851b68c12 jdk8-b26
-80c47eb83d24fdd64bbb48f288bd6d4f03e0ec88 jdk8-b27
-f3244c1f04864d35c41fa8d13669faf4f65b81e2 jdk8-b28
-25099a745e1a43579b6af86b3e052b2e50958753 jdk8-b29
-3be30c25a8255803652b5c466336055d36e2ba21 jdk8-b30
-94aabe098916440ae7911866311c9617d8481a36 jdk8-b31
-60960fbc75df8be4c1a2504aa69fc1428cc94f93 jdk8-b32
-9bcab2b8b8ea578e594916a3d3df6dbec7984bcb jdk8-b33
-8b91a897a04486cf901af0de7f684a3eb31f121f jdk8-b34
-e187f3ede64965dc2979df9a211107cd3d38eacb jdk8-b35
-cfd288fe1d3e2b700838342e70d71d44ac991af5 jdk8-b36
-90204bfab4e2bed402badcc997cbf8446ab5669f jdk8-b37
-5bbe0cb6f2f2d7ce292da77bf4fa9d618d770a78 jdk8-b38
-f95fdbe525c88ef0d57dc1390be6582a8af5e07c jdk8-b39
-9ecfdbd6aed4702674eaede2023b4a19513d6b36 jdk8-b40
-6f5c0e17415de7a9c74900ef4ba12f47accdf88b jdk8-b41
-39ee03c1602155ff02e5feb6cd44869452f24cf7 jdk8-b42
-eff4ece9c8bc43b3ce2b3758574c4c20147f0689 jdk8-b43
-0b3f3a4ce13930430b32b616a717dfc7fe385b28 jdk8-b44
-57476f66e13c55eea2f2fe2b858369a4c64b9936 jdk8-b45
-300f45e990643af230d6cca39477ff62c44a9a54 jdk8-b46
-404521944ac9383afda7d55d60713b212c730646 jdk8-b47
-1c88da9a1365797e49be77ae42c34bbc0a3c3f0c jdk8-b48
-f81e981eca7b63316cf9d778f93903a4fc62161d jdk8-b49
-2791ec55f66b57a702349c649567a391e6301f4e jdk8-b50
-dc1ea77ed9d9746e0f98bb1268987c3596c8b4b5 jdk8-b51
-bd3c00d5761408954cc29ffb82016a76cbc90b43 jdk8-b52
-2c566f25c39f0087464b73e3bcf1c1421d0f2a7e jdk8-b53
-7dd81ccb7c1134df70969b3068b1e98def701746 jdk8-b54
-7c2363666890c6675194948fbcd74d81ddb84298 jdk8-b55
-f19d63b2119a0092f016203981ffef5cc31bc3c5 jdk8-b56
-7c9475c7618cb131bcd7470f859bf43c5e5f9905 jdk8-b57
-1cb19abb3f7b40bf233b349cd2f51f02d37a9f5b jdk8-b58
-af9e8b0f1900b631a8a0fcccff9f1514fe58c808 jdk8-b59
-2d1dff5310daaf226421a8c92823cb8afcf35f31 jdk8-b60
-6b1db0b41d2f6e2a7b3bdbc8a8db823b47752906 jdk8-b61
-5d0fa0108d028c05753a47bcf2a598357dabf0c0 jdk8-b62
-192d8a244bc36427757866e9fb3a08938c0e674c jdk8-b63
-27ab79568c34abf80958d5fa8c04fd1740d243da jdk8-b64
-5cf3c69a93d6d088a1cdfa28031d4f0f9438c0de jdk8-b65
-e6af1ad464e3d9b1154b9f9ed9a5373b97d129fc jdk8-b66
-83df3493ca3cf0be077f1d0dd90119456f266f54 jdk8-b67
-b854e70084214e9dcf1b37373f6e4b1a68760e03 jdk8-b68
-789a855de959f7e9600e57759c6c3dbb0b24d78b jdk8-b69
-6ec9edffc286c9c9ac96c9cd2050b01cb5d514a8 jdk8-b70
-499be952a291cec1dc774a84a238941d6faf772d jdk8-b71
-bdf2af722a6b54fca47d8c51d17a1b8f41dd7a3e jdk8-b72
-84946404d1e1de003ed2bf218ef8d48906a90e37 jdk8-b73
-2087e24a4357eceb6432e94918e75fdc706a27d6 jdk8-b74
-ff0b73a6b3f6cea644d37d56d746a37743419fa7 jdk8-b75
-0c08593944d0cd30645f6e1e4946c51ff2b10c8c jdk8-b76
-573e789c187a69a3ae00bffd26eb35c0f4a60636 jdk8-b77
-00958c5a7070bd578aa8b70773cb3f204a9c1be1 jdk8-b78
-58fa065dd5d663d62f85402461388fb7a92656fa jdk8-b79
-4873a0499bc3bd263b7dd3b551a2b4e275ab5a0b jdk8-b80
-ef3495555a4c6e706a3058c18aa229b14220de0b jdk8-b81
-d5a58291f09a5081eaf22c2a6ab2f9ced4b78882 jdk8-b82
-a46d69a1a8ec9652a48114823535372e1c980799 jdk8-b83
-f5f40094ffcc1230e2a5f76ea4c968645369be6c jdk8-b84
-41b50e2c5ea3f4aa1af729e1deb1678cb3e1ef9c jdk8-b85
-ca71ec37b2efc9c3f0971ebabb3a6eb1213d76de jdk8-b86
-eddbc8ad2435a89f64729512337c9f2669e4dd85 jdk8-b87
-7122f7bb0fcc8a39e5254402119b2ee3fa0ad313 jdk8-b88
-893d2ba8bbea3a8d090e51d8eaea285b390789ea jdk8-b89
-668acc0e1034bc1bec6d02be92e0dd4a63d0667e jdk8-b90
-e3065fb07877c7e96e8b93416fe2ab9a4c9eb2a5 jdk8-b91
-1ab5d8d6eab81e65c6c3cf21739474cd67a0e7cf jdk8-b92
-d583a491d63c49eeda4869525048075da1cb596e jdk8-b93
-c84658e1740df64931005a9bc4c8ecef38eb47c3 jdk8-b94
-b8c5f4b6f0fffb44618fc609a584953c4ed67c0b jdk8-b95
-6121efd299235b057f3de94b0a4158c388c2907c jdk8-b96
-6c830db28d21108f32af990ecf4d80a75887980d jdk8-b97
-15e5bb51bc0cd89304dc2f7f29b4c8002e632353 jdk8-b98
-adf49c3ef83c160d53ece623049b2cdccaf78fc7 jdk8-b99
-5d1974c1d7b9a86431bc253dc5a6a52d4586622e jdk8-b100
-0a7432f898e579ea35e8c51e3edab37f949168e4 jdk8-b101
-7cffafa606e9fb865e7b5e6a56e0a681ce5cf617 jdk8-b102
-b1ceab582fc6d795b20aaa8a3fde2eba34af9399 jdk8-b103
-a22fe9bd01e6c7e7ddc7995dfc9471711692b8d1 jdk8-b104
-09a46ec11f880154886c70be03aff5ab2ddf0ab7 jdk8-b105
-d3be8e3b429df917e72c1c23e7920c651219b587 jdk8-b106
-d6a32e3831aab20a9a3bc78cdc0a60aaad725c6c jdk8-b107
-8ade3eed63da87067a7137c111f684a821e9e531 jdk8-b108
-02bfab2aa93899e0f02584f1e85537485a196553 jdk8-b109
-4c84c5b447b09aff27f3b72667ab3a5401e85968 jdk8-b110
-17ee0d3e97fdb412e48f14d87f504946a708f846 jdk8-b111
-c1f9158fbb9c2da50f6946fffd974e8236e08447 jdk8-b112
-0046d2278204b7eff76803fc4623cb48c7e6384d jdk8-b113
-1b1e12117fe2840e5d21ae9a4b309e4f981f3ea8 jdk8-b114
-f610fd46463e6b0533dd92bce11a1e7d84984e64 jdk8-b115
-e757eb9aee3d6bec7da074c47e07616104a8df33 jdk8-b116
-c1d234d4f16472a5163464420fa00b25ffa5298a jdk8-b117
-e4e5069250e717defcb556e2f6be291460988c51 jdk8-b118
-69a930376c70beb9877970128bad0f04cb0c6eb1 jdk8-b119
-64d8b228a72cf9082b1a9a881c81188ccffde234 jdk8-b120
-4045edd35e8ba73bfdc23ce8961b9640d4145fe5 jdk8-b121
-93bf25903af0a8eaec78d7b1ab85a5b812c9aef2 jdk8-b122
-4e35b5b6d2e5e27772d59a70a54e5d04fc801a64 jdk8-b123
-1a28f773c8943113187e393bfd80885dedac3ccd jdk8u20-b00
-83bb924238f800db68fb6f60142cc5149d7a9bf6 jdk8-b124
-d987792919e12eafc8b9042b11f9c353d7c428b8 jdk8u20-b01
-83bb924238f800db68fb6f60142cc5149d7a9bf6 jdk8-b125
-390cc275c04c4d7c8a14a895e9bcdc57621af966 jdk8-b126
-b68cdb63a70bca7aad284946107d5d8dd1dbc663 jdk8-b127
-b1839922f10c0c88dea683590fa093d1d382046c jdk8-b128
-b7752cea7c813fb8b1d3bf2e05e8f93331cc7f1d jdk8-b129
-0cb0cd01521845c2d6f5172a9ef1783d4c8bd668 jdk8-b130
-79d8b7fac21d263db5e5ebd3b830a3cf98509541 jdk8-b131
-5993346020d14a1c2c7003588c584366db7921f5 jdk8-b132
-22b63601be6f04fcb2c3b563261f14869954b44a jdk8u5-b01
-bd97ff5f82588c627869218df02a9c2dbb9402d0 jdk8u5-b02
-195b74b3e57905b6d6c9ed9b32139c6781ba7d28 jdk8u5-b03
-106fdcde4b8a6981be13dac34a3de99d6fece97c jdk8u5-b04
-8f859b1b0f0b18ee7e231d6887b18b5721c2404e jdk8u11-b00
-57c695af3fe838c36eaef647f2af543cd60533e4 jdk8u5-b05
-0000000000000000000000000000000000000000 jdk8u5-b05
-8f859b1b0f0b18ee7e231d6887b18b5721c2404e jdk8u5-b05
-e22bc548b58a695eede0304399777314ae473562 jdk8u5-b06
-0f96584b02b399df706bec2052a7fe48bdc6058b jdk8u5-b07
-bbe60534528d2e8118957aaa74a75bedc1c3819a jdk8u5-b08
-d9b3ef4511434cf55870d42b6caa6a5618bc47ce jdk8u5-b09
-4b32ee8d711251e90ade1d958a51e134c3d387c9 jdk8u5-b10
-c17a827bec287f4c7565c72c195667e52154772b jdk8u5-b11
-0e5317cbe451d57f9ffcbb835de07fe553a8aa34 jdk8u5-b12
-a303ebb338518a716c267b17986634e3574e7cfe jdk8u5-b13
-acd066c854b11ffed62d8f132205f222963f4f1e jdk8u5-b31
-3e1631f54539cc21770659dcf61440693ac5fa79 jdk8u11-b01
-6eaf565691a13328e82473d70dfd0feb8fb2f5e8 jdk8u11-b02
-36d713c3339ad945521d298eeb21c67ee856344e jdk8u11-b03
-a25020bdca11acad85454a35a9912fd1b4168d83 jdk8u11-b04
-65e5ee249ebc81c0ccfff23946a0a2a6d4becdcc jdk8u11-b05
-beafeb0b7a178a3906bcb7dcf46f3c9a9c9717c5 jdk8u11-b06
-1923c759e5ed7e9a92512797269d997cae1135b8 jdk8u11-b07
-61faafa45502e4e6db6ce9026d2a7f2121dcae3f jdk8u11-b08
-a01fd971ef667977a131f5fbaaee300e500424c3 jdk8u11-b09
-1d894a9d308c4b3a64e876097c2e0e1e577cfd73 jdk8u11-b10
-41edd71af41f1100b965e0fab88f97d3c130e3de jdk8u11-b11
-838183af6d700c91b914843992ffa0212bcb7ddc jdk8u11-b12
-40590bbe6fc244dbdec4b660963bcfc25bd2fec1 jdk8u11-b31
-de9ec1246a0c5c0b32ce3818386019fd4a6fceaa jdk8u20-b02
-47cdfe271b1e97e5906eb1b96cd7d15f0717a118 jdk8u20-b03
-f6742d0cf71201f1ffd0584c1f2990df343bc5eb jdk8u20-b04
-fc6ca92688ef0625d20881a9c90523d49b1773d4 jdk8u20-b05
-0cb0cd01521845c2d6f5172a9ef1783d4c8bd668 jdk8-b130
-79d8b7fac21d263db5e5ebd3b830a3cf98509541 jdk8-b131
-5993346020d14a1c2c7003588c584366db7921f5 jdk8-b132
-7b1a6da8ad82b8f576f21ae0692e825395f8b31b jdk8u20-b06
-30b8baceb72bcec111c6aad37eef96d18c09e4ef jdk8u20-b07
-68e2ea32f92731b8ad8157252116db89903b51a3 jdk8u20-b08
-b706e9775bf7512845120740870f717341e2b497 jdk8u20-b09
-c356de7051ea6d25de07ef86f60eb6647eaaf2d0 jdk8u20-b10
-40b6440e569e5f7a00f5763eddc6dc8ae24421f1 jdk8u20-b11
-8f49f969030574e46a52f3bcbd77790045a2ec07 jdk8u20-b12
-7777dd4143599310853e1e9ea52f8b79b2948c15 jdk8u20-b13
-641333dd7ce2b46d4b8366d7194798c3fb28bb55 jdk8u20-b14
-d03960b97ec8adc537f92bae9754e9ca6303880c jdk8u20-b15
-cbde689ca74add6f9e47ba7e753d4dc9a28dfd16 jdk8u20-b16
-3218a2d7eddbb058af4468c5721b3a87f4eb23bf jdk8u20-b17
-262363175ec8cd9f6f78b33d567f1161e2e7d494 jdk8u20-b18
-beb64f6b1989bc49954a4aa26ada54a91eef69eb jdk8u20-b19
-255d961955e4fdb83ce105ae990c26b87022363f jdk8u20-b20
-3a1bba8076da4e54882123e98e219eab1c31ccef jdk8u20-b21
-bf115689d89bb82dc1efbe0348657e993715e850 jdk8u20-b22
-d6ded60cfdc53861ae7d1a010f95b5036d610e80 jdk8u20-b23
-dd09d8b9edefb5684941941e5d9b35c84ee066f3 jdk8u20-b24
-dd09d8b9edefb5684941941e5d9b35c84ee066f3 jdk8u20-b25
-938b9d502c2b0f9684151e1b1f47cf7052db1502 jdk8u20-b26
-f734649a3f89316d84fc669fdbf7bbff92e7291a jdk8u20-b31
-d791a17744d50a456d60ee5118d8cb9633bb36d2 jdk8u20-b32
-65e5ee249ebc81c0ccfff23946a0a2a6d4becdcc jdk8u25-b00
-b29277565edfdece4e3928b135d4fd86ae141e4f jdk8u25-b01
-09df5bda467090041090873f71d418eebcadf516 jdk8u25-b02
-f3567e6bed22eaf89c3c7d64e0b1fa308707260f jdk8u25-b03
-a4d0f11cf08d5dae91c5e9ad387b1ff88388503d jdk8u25-b04
-0c4917cea678dc2a3745baca74016f0d6f169012 jdk8u25-b05
-e84d78dd9e0533eb11c26b69727c044898d19f60 jdk8u25-b06
-7aaaec31a0331ad091abedf81c928b47a982222d jdk8u25-b07
-e48a4594f19ad119bc27d89c53dd35d11ed6da7d jdk8u25-b08
-a09893b8f617912569196d7bd64a96c349796be0 jdk8u25-b09
-85de91b6e953c8c21ac5e6d9a5e284f86d759680 jdk8u25-b10
-5c1ac461fef7fe0f810bd9d6051db5a24247de1d jdk8u25-b11
-c078e904db0a7be650e4ba2d665277785e2216b0 jdk8u25-b12
-24184cfe0f8b0da0f349933ae7b5cc16455a52b8 jdk8u25-b13
-90f3b8b970a8bb3173083111248372afdc61652d jdk8u25-b14
-f5ac2e242bb95be0a3deddf37362178202086137 jdk8u25-b15
-df68b132a471ed1e825a79bd1d8acb47d2bcc04f jdk8u25-b16
-7a721e57b38ff6c1d34af0b86f6482540a815d90 jdk8u25-b17
-fddbc00bde281d7d437b052262e921ed51de8b9a jdk8u25-b18
-30420a31a81f21e363f412ae9801b7467c8cc908 jdk8u25-b31
-b4231e682f98c8f7037e00fe6ef446d05a01811b jdk8u25-b32
-1c17ffddb76625e835d225c84a8c6ff23c1e5729 jdk8u25-b33
-19b6e16343925a4bf27879795b530d4f64e5d262 jdk8u31-b00
-469792d179304c9b3218930112547577e1aecb77 jdk8u31-b01
-adbd3e31ef1a95b3f80a77dfbb843d52c053c6d3 jdk8u31-b02
-d7961ca9afbc744674eb3ffda8ef2003158f3ea6 jdk8u31-b03
-3bcd38c92f216e6e0fd74742720b6f786301953e jdk8u31-b04
-17bca3fe325b353929e0eda3f1aaa7cc2806b93d jdk8u31-b05
-a1ab81b8cc36b156f272b20da62922d7f8aa6fe9 jdk8u31-b06
-573b761785f798a8b5366a87aceb7324b312f747 jdk8u31-b07
-43f0821902a71c1fccc99be36a0b205b1ae79183 jdk8u31-b08
-630b05fb2ddcdaeda6269ddb74357f651b73d6d7 jdk8u31-b09
-b5165ac3556e95c42a295d3cbeef8cd6e5607b25 jdk8u31-b10
-f475dbc70345904bda6b520af43955e244292886 jdk8u31-b11
-6563e438377f2086253577e08593b1ddfb901eff jdk8u31-b12
-1dd828fd98f1b84de5dcadb904322b711e7489ff jdk8u31-b13
-dcc563c9db9ef290a0783378d43a039cd92a08e3 jdk8u31-b31
-119f4ae3151f4134a5e62034e66a4c17f524838b jdk8u31-b32
-d8a594fd8507343dc23fa18c01b17c96fced47fd jdk8u31-b33
-68f0cd7d60d45df8e4b73a85e31a16aa025d9278 jdk8u31-b34
-3a1bba8076da4e54882123e98e219eab1c31ccef jdk8u40-b00
-f219da378d0768ff042d77221e5d20676ecc16f0 jdk8u40-b01
-16ef2134c32a4e60b5a60105b371163aa5936278 jdk8u40-b02
-d73144ee471d4d4c49db94b3cc8990479961499a jdk8u40-b03
-23c1a41d75adc6fc57f69528c2c804079f449d94 jdk8u40-b04
-8d60cebf6a0c1cf1a5669e49deb795a1445e826b jdk8u40-b05
-50a2adfa57fcbbe1587991d53f58d227070a24db jdk8u40-b06
-b2210de1587b16ca1d1d781b55e19bc70724c62b jdk8u40-b07
-641eb6543c7186d1c2c26eaf96803b1e6b411d9a jdk8u40-b08
-c45c0ee4160026207cef1850c215c2691d43a97d jdk8u40-b09
-1f5248bc0714a45160525d48bfcf455b9cdf86a3 jdk8u40-b10
-0bf6dbb6ac4e2258d4d832bb949cb1be2402a899 jdk8u40-b11
-b0cde44bdbfd6339128ca5a7dbbbffaaecac793a jdk8u40-b12
-9df027c40f0fe150f609f1a5e731b7e649923f2b jdk8u40-b13
-d8886dede94dedcad66e6d770dac6b8bca1eb51d jdk8u40-b14
-ed46c05af2570feed5ea264eca02f223055109e9 jdk8u40-b15
-cda81fbeec94b31dba27a043fbf58f442524cdf5 jdk8u40-b16
-cb63029168a52d62d82c3325f1092405c318e78c jdk8u40-b17
-6103f5a8119a85937ae006f18b8dfc04f73315d0 jdk8u40-b18
-3b73732d6886dc8155f0c1fbb125ca60d9e2fd2b jdk8u40-b19
-7bfc889330e0ec1fd495990eaa0d7f0c390b7304 jdk8u40-b20
-78d90db9de2801eec010ccb9f0db3caf969dfc3b jdk8u40-b21
-54a13451ce243f2159ed3996e6efcf374a5750ca jdk8u40-b22
-e07fbae1efeac4e50514384caa7d226af7414114 jdk8u40-b23
-048cebd17f73f23ce2295e360f31c1b6788195aa jdk8u40-b24
-4c0d4c38279c5790aa5b61b03c4cfa9b2a58bc72 jdk8u40-b25
-f693ef62c207dd0290957c95bd62ab653afe4626 jdk8u40-b26
-56f6ca79467d04eb95383102046836b6ac7d2811 jdk8u40-b27
-7e43d4e20a33b8b6bd06112e39d367b51de921a7 jdk8u40-b31
-8facbe662ec106f1aae271f5c59909e124938c40 jdk8u40-b32
-b02301aeab79b1ee7859aeeb994fa5ba31105734 jdk8u40-b33
-9286acc600a779acb8bcfab38e82d4f50704afe3 jdk8u45-b00
-9fded65e1d36e3388111955d50ebf8511dd0345e jdk8u45-b01
-62566a3dbe5982565ce3e468ee3980b7937a86cc jdk8u45-b02
-629096783c27510c656229b1adc7fb180cada9c6 jdk8u45-b03
-85585012b976b72665f8f7740526bde25ccc62e4 jdk8u45-b04
-da025bade645f0d1e0ef2f825320bd5af0c23eba jdk8u45-b05
-49bc5472ded41c77dabb0840d385cbee1d60d8e9 jdk8u45-b06
-061930bd7d8fc2f05042e7eeb32adff1759c6d62 jdk8u45-b07
-50fba38f3a29f55baaae2da9b392bf9abc8389c1 jdk8u45-b08
-f893d8b9a0d148951014610b1aab2ba0a5105dfe jdk8u45-b09
-4de18a629048b90e0d875b9c0bd31800f1cc02ae jdk8u45-b10
-d4042340fe0aa9d33a161890e179bc21b6c7b8e6 jdk8u45-b11
-91d1102264e9b58b2ada4b5f112d472f0d86092b jdk8u45-b12
-a15025742f201f05ead3d731780a4ad437524491 jdk8u45-b13
-e0167ec9d7596ab9ac52a8c3b85c1aef5d3fbd92 jdk8u45-b14
-bf813e10d0bac17866ef2389baa8a1e6494e7800 jdk8u45-b15
-74452b827b62c31220709d14a65e71f37795199a jdk8u45-b31
-90fe13eb35388e095383bcb81eeb6d24875e3054 jdk8u45-b32
-3206c35f8a0ed724f5b2085dac3aa185b4c82cd5 jdk8u45-b33
-6739f3bca0d1a75f679ddbac66a1fba77d6b3a7a jdk8u45-b34
-46b54d3830f20a6a2573c1de168573eec221dc36 jdk8u45-b35
-30e45caf06c25d6740f498077ecdcba54da2265d jdk8u45-b36
-d5839b67be4eb681d59bc6d243b8438baec2f07e jdk8u45-b37
-ef437e576e3654f6f9c0cc116a0a824f382b9007 jdk8u51-b00
-d6ddc9950ff55dc9be44704ed59555e221a8fcc9 jdk8u51-b01
-da0ad0f75f08d8fbb4ee4d395e4386a4660b854e jdk8u51-b02
-34737dfadd630afba60b6ad63a696ae335d7e960 jdk8u51-b03
-75f055aeee9f9cab28a58e1deea9ecb8885b63d0 jdk8u51-b04
-5e57ca784de9ce92547c12d0bc3795c42794b962 jdk8u51-b05
-36c97b41563b7bed72014da6e497398c78616d5b jdk8u51-b06
-046bcf8f8e0059fa53136b06547112933d5284d6 jdk8u51-b07
-710b56801de0147716d91be7226b125b5a64c2ef jdk8u51-b08
-3b4c837abdf678ea2e60efcd2d20cc9ff1123c06 jdk8u51-b09
-7aacd8c67160af67f7c9d81974d021eeb229929e jdk8u51-b10
-04005432fba4982e5c073be55b917f8a11c838f0 jdk8u51-b11
-966c04d5702882603a02f5ba4a4e5d19d47960f6 jdk8u51-b12
-3f5353208a226a31d9ad86018a17fe5f3b102d4b jdk8u51-b13
-361ad9121468776eee1d647044481d80e8334ffa jdk8u51-b14
-14975d905d764c5a18b60b991b97375d42dcecd7 jdk8u51-b15
-050f5654fa19db518b354f06a67e0e1f03284a41 jdk8u51-b16
-4519799749671cef69091e354b7cd52496f6d970 jdk8u51-b31
-975b01e6be932672edd527f6efe4b430d7bcf07a jdk8u51-b32
-59aea46232797f247aab869d751e4b8090eb4789 jdk8u51-b33
-55657ee85e8e4157836bb4b748d76234b1360e95 jdk8u51-b34
-3b73732d6886dc8155f0c1fbb125ca60d9e2fd2b jdk8u60-b00
-b0e15cd169a93080c4e30e9eb3061d0b329bf38c jdk8u60-b01
-0b64e727bdb06c82caa02ef25ac2552ce3314537 jdk8u60-b02
-0c3f4e5092d20ed76754fdb3002bebb46952375e jdk8u60-b03
-bd05a145e589b5bc200898a34d2d0f78372e9ed0 jdk8u60-b04
-13a5799e90e958eea7c72bc93829d709a1053995 jdk8u60-b05
-b265b39444379ccd9d4038a8f10c0527f12ba06f jdk8u60-b06
-51eab6899806b399bcca4533ab01362a306e4d0b jdk8u60-b07
-0ef3e20f1d48ddf8b1845039f97dc1174d0701ad jdk8u60-b08
-566ff4ee50bbfbb9f414289b8206be077f07294e jdk8u60-b09
-497d106d476db2eaa0e0ca2756e211fdf9f0d34e jdk8u60-b10
-c8c6e549d1a6e454aa9fd5965a966f5e3a870e60 jdk8u60-b11
-412597b17df8a4109b4fcf32687785c2c93ac536 jdk8u60-b12
-c61fbe5729d4d6ce5522f357b95f285bada8b440 jdk8u60-b13
-ddb4bf8a306a8b0d94ca639994b2b420632d40b3 jdk8u60-b14
-040ce4bf5a41047116a0be643d791b9c76c412b3 jdk8u60-b15
-3cb841defba069c891f80fb03e2c71dad995ae6a jdk8u60-b16
-e882f38df713cac5cec98e18a013a81ce9fad0d3 jdk8u60-b17
-ee389d2cb785317ae0b8bb2c73e72daf9435824d jdk8u60-b18
-a86893381fbb1c03ee743b691a7b7d6a90903eca jdk8u60-b19
-7d03050620d74e6e6b60c9e64b5b8cbe557c8201 jdk8u60-b20
-def8014e497099d6f1b1fc64554b15345a574a96 jdk8u60-b21
-bc1ad5d83a65339c40a17406ea38d2ea8cbb9807 jdk8u60-b22
-9d6b607dcbf820cfec17d6f8775d8649630cfb35 jdk8u60-b23
-c8ea5afd3d53a31b2aae76bc814e7384cae87b87 jdk8u60-b24
-7a74fd4791e866c031df3c22cfc19ce71d3d952e jdk8u60-b25
-9db1721b527eee3b41ff73fcd36ae052227bbf59 jdk8u60-b26
-8f260851e05111c39353a6a4d06e752e7c86ec31 jdk8u60-b27
-37e7f34c2231d99a4ef3eb2c0b1a6899828f11f7 jdk8u60-b31
-393ae594ae7c3f4a776c976e38fb4598ae1c69fd jdk8u60-b32
-d6ef96871920e6f6a0c437850c5afb6d7fc5b4f8 jdk8u52-b06
-aa8bfb1b3e83bdda687d6c065bb51174d8cc5a81 jdk8u52-b07
-d6ef96871920e6f6a0c437850c5afb6d7fc5b4f8 jdk8u65-b00
-04ad73240341cb02d20bb5510f1a66d9e67c4437 jdk8u65-b01
-bd0b41c3c7d4de40c32ee63ec26cd315799a5fbe jdk8u65-b02
-c68c94b3f7f95b1406ecbcf13fd3558192485e19 jdk8u65-b03
-9f9e85cded9f1891115db7d67d18af223c54f5a7 jdk8u65-b04
-977d4ac5561ee94009f70848b1ef7b26230545e0 jdk8u65-b05
-f98b8f06a46ad7d7ab19179c8465c2861bf1a7f6 jdk8u65-b06
-977fdc7ce23e19e43eb7353cdecf09b5b7dfeab3 jdk8u65-b07
-e46c609d4dfda54114ad79955a465355cbc1e230 jdk8u65-b08
-392abce5f026cfe44635f5d6231668d77993c637 jdk8u65-b09
-17bbcffe748d20003332b8c4e6e94cb15a96d725 jdk8u65-b10
-17bbcffe748d20003332b8c4e6e94cb15a96d725 jdk8u65-b10
-0000000000000000000000000000000000000000 jdk8u65-b10
-0000000000000000000000000000000000000000 jdk8u65-b10
-2da19171bdfff7d997009fd1776e86a18f4f7531 jdk8u65-b10
-992064f34aef6eec053701097e5ff6341e4e4172 jdk8u65-b11
-9ee795292f6a23d1ddc224efb5c4ae0f074e5aef jdk8u65-b12
-905f3128a1bf1e26fc23d5374856a78669aa5831 jdk8u65-b13
-294ba041e04544b7abb18c08141ceb4e891d1e66 jdk8u65-b14
-973119b82b13f5138fe7df6be831e86310542717 jdk8u65-b15
-782a028b22af03b2e9018f960bd977fdb2b440f8 jdk8u65-b16
-b6b6756b041d47befdb48b2a71e254f61539b95a jdk8u65-b17
-bc1ad5d83a65339c40a17406ea38d2ea8cbb9807 jdk8u66-b00
-0f2ed27c7d793cee4d91591c6a0b1a730e985906 jdk8u66-b01
-096038a770142b0e6501d04d03283165da9661c6 jdk8u66-b02
-b6ac3a1b7a2c6ba396e894ac5b965ea2ab10cf3d jdk8u66-b07
-87cb8f939ec67923a21dc97436d09f48dad22ecb jdk8u66-b08
-50c5c22f8520993a4ffccaf66b48fa8834f01c35 jdk8u66-b09
-069e64abd19ec46bf85d7b6bf27b1b310d0ae9b7 jdk8u66-b10
-7fdbb05280f4440fcf3bd115097b67f17e2b030c jdk8u66-b11
-d857d6033bf1499c015ef2a2313f53a3e6491df3 jdk8u66-b12
-6e9d5443defdc9ed595528794b82c64a049d5e28 jdk8u66-b13
-94b6e3ddc19334578abefbc44a7ec6f9e20a6e24 jdk8u66-b14
-25cf8ddfc8bf163211d1dfd79f31765cac58eef5 jdk8u66-b15
-40ce5a6d733d44d93cbd5c0105a820ad7a7f4754 jdk8u66-b16
-fc348901e958842a757d59c6b35846d13ab86793 jdk8u66-b17
-4ae0c2d6dd24931f3f271e645221e5331e351c00 jdk8u66-b18
-8af7da6c13af3c95bc9933e6d1e0d83648f6c0ae jdk8u66-b31
-1db6026e38d41f217bcbe2b619711b850c1788f4 jdk8u66-b32
-a85030db026108135a95b86c343280ed7bda322a jdk8u66-b33
-59dc259db9ad7d7eaa98b9540734bd5c22d9bc86 jdk8u66-b34
-a9f8281d8391e90f255bb754d1d6b31dba18e77d jdk8u66-b35
-d11c3bc0881a83bacfd8fd25f7c8d29cb405afe5 jdk8u66-b36
-700dc6c623439c5df98253fba49387919dd8732d jdk8u71-b00
-f13e36a4ac819281990312f13f156dbb6f913371 jdk8u71-b01
-90bca51fcdaa065b823ece61e4b0af1ad81955e5 jdk8u71-b02
-33134f35eea3fbffd695d24229d7894c7c2cf14f jdk8u71-b03
-28922f863973b2dc0c87b767685958ec7fc13b97 jdk8u71-b04
-6c783cdd685f6fc8bbc25e4debb07c2096f7b64a jdk8u71-b05
-ae391e3b725697f17e739eaf6b669af10c54ed28 jdk8u71-b06
-5cadfe102e5c7fa1d5ea37991a3e7fc0337e7fab jdk8u71-b07
-6efaec82e8da45264718ce9391bc02f196da63a0 jdk8u71-b08
-19185d4e00661de65f3707328b014e3a011f5456 jdk8u71-b09
-d2d1de379f90baea494a747bacfddf6b0591089b jdk8u71-b10
-e71972e92232ad5bb17c79609d75ad3b8062bf10 jdk8u71-b11
-17f54afcb17f19dfa18680814376bbe06ca81e12 jdk8u71-b12
-260ef1c987a2d566d7caf7de4f31eb30c144f73b jdk8u71-b13
-079fe6e5b8526a2b8b92de5ffcab52d2e1abf3f0 jdk8u71-b14
-16a7adec5fae8bb84e415bbeda6da704f38a6156 jdk8u71-b15
-60e623d06ebdcdc681943b16f00a87aeedf46873 jdk8u72-b00
-176a2ce2e2d6fd07964eca60c28c6b0049d7bc4d jdk8u72-b01
-3c5915665396301b730f808f8f5aa6e95b7c6113 jdk8u72-b02
-fb395cc3de779ad4274063c2a1d876194bcfaabf jdk8u72-b03
-5b5626716c88646895c4ada9ed1a35b24e7148c8 jdk8u72-b04
-1636e47c2d48d92827dac1493d292ebe19a2e108 jdk8u72-b05
-3a3863b12884f6167261f995b5eb0b8c69495f30 jdk8u72-b06
-8045ef94fd11dbda897404de345d1ea1eef52a01 jdk8u72-b07
-be05920afa17d374bc853d890a1575db097ac91c jdk8u72-b08
-8404d311c13333d4b2455bb75bf1aa10a7e55bc2 jdk8u72-b09
-619ab54940fc02e32966ceedcbd7726d7b50ee97 jdk8u72-b10
-8cff3169fa7b95c47599c1312e4dae97ea5228f3 jdk8u72-b11
-68b880e0f5de1d49914790f1a6e5c6e4c3847434 jdk8u72-b12
-58630fde67f4ba7b0fbe8509bb0b105f065383a8 jdk8u72-b13
-05c35ec04d298ad11a97a0c82e54e4468542c6e7 jdk8u72-b14
-1bcc418943405c5ef677eb3f63783683261bd2d3 jdk8u72-b15
-aeecbaa27f807ce0656a108cd0e81669724b8d1b jdk8u73-b00
-9009a8b2b55256764dd304902b04a3dea2597684 jdk8u73-b01
-7a021985ef009c3a88a206d6f295f17e382f98b9 jdk8u73-b02
-2e7b89c7f79794b872e73708fdaa3ed9331ec45d jdk8u74-b00
-aa9485a887b7e983f9743c9c114de2055055300d jdk8u74-b01
-b3325c0526621f9ddf82738373cc8f8947dab195 jdk8u74-b02
-2b3d0e6f3cd179e2346679af2a8881bb6b20f968 jdk8u72-b31
-aeecbaa27f807ce0656a108cd0e81669724b8d1b jdk8u73-b00
-9009a8b2b55256764dd304902b04a3dea2597684 jdk8u73-b01
-7a021985ef009c3a88a206d6f295f17e382f98b9 jdk8u73-b02
-2e7b89c7f79794b872e73708fdaa3ed9331ec45d jdk8u74-b00
-aa9485a887b7e983f9743c9c114de2055055300d jdk8u74-b01
-b3325c0526621f9ddf82738373cc8f8947dab195 jdk8u74-b02
-c583ac51e2c78d6c59786b447986baf7b961518d jdk8u74-b31
-4c8fd0814bf0bcbc9666a29e1daa35c64c7bb57a jdk8u74-b32
-8cc52edbb741c42e09f4b132ca0a759d3de6f848 jdk8u77-b00
-8f0ed89698a28138065b6b941769650627636745 jdk8u77-b01
-27f1130320a55b6b89024cb8baa93c8767c516d2 jdk8u77-b02
-1c71899e85662239085fab94ad5c26441e7a80cd jdk8u77-b03
-a49d8c7db1e5b3ab84561069bd4ae63579139878 jdk8u77-b31
-eca165c0654ac2e1926b50655e5ed5e9b73ca674 jdk8u75-b00
-06cdf5dc679e0fef7c8e37c5c712b2c5891c1444 jdk8u75-b01
-26c297e9f11b78b55cdefd22849ae4fe55042a5b jdk8u75-b02
-2a292503c55704cb7f898fa195d76682c0ea6a72 jdk8u75-b03
-cb072b12f5dbe3a249d596078d98a34ec9364187 jdk8u101-b00
-cb072b12f5dbe3a249d596078d98a34ec9364187 jdk8u75-b04
-40ccc40d58450eb4518348f6b34885c5a711675a jdk8u75-b05
-e77acebebfdc2f84b1217be3a6a2eb4c205afda5 jdk8u75-b06
-e5423deded19531b7288480b059209c825046ce4 jdk8u75-b07
-8244c2d885d412c07ae63b502d0b1f8cf4f9f38d jdk8u75-b08
-1b3ef7edccbcee10699c647da23b98cfe7ec1ed7 jdk8u75-b09
-e926cbc930ff727229191242a145ac625ddd7fa0 jdk8u75-b10
-ce9b845453027a7a6309398b1ca2f32cf1534ae5 jdk8u75-b12
-8cc52edbb741c42e09f4b132ca0a759d3de6f848 jdk8u77-b00
-8f0ed89698a28138065b6b941769650627636745 jdk8u77-b01
-27f1130320a55b6b89024cb8baa93c8767c516d2 jdk8u77-b02
-1c71899e85662239085fab94ad5c26441e7a80cd jdk8u77-b03
-6b0d1f04c4808aaab32771e0892ac83e66714ecb jdk8u91-b00
-817898d53814da42f567995c921f3ea90016dccc jdk8u91-b13
-f6bda5729ff86e9691cd51f04261c3942974cecc jdk8u91-b14
-8b0bf55a041ae5657b1ae9e74e68258e8d36dda4 jdk8u91-b15
-acbcb6682c9b3e66f9cc61a6a62e8cb5f24c75d3 jdk8u76-b00
-b3c914ad842d61818e0c5850409f77478b13acc6 jdk8u76-b01
-7711933ec18462ece8a1b9a9527ec873c520b1ab jdk8u76-b02
-11dd1c13f1bd75f58fc0b020c767f2c331abb2a7 jdk8u76-b03
-1cc1c3510fd8b9fa2a18bfad3984ca16069f013e jdk8u76-b04
-ec9701b3846be6da61b15c3b1f453077404f7b6a jdk8u76-b05
-ce8019f21943996b9770e8f9d35a6c076c73bb82 jdk8u76-b06
-3f1a028c152eaa1cf9ca97ed6c7ebc239b0967be jdk8u76-b07
-74c0b275d2ddc6e197677adc28532ee6025559a6 jdk8u76-b08
-2e5841f57df44b0f49e49ef3b827a7babf51bca7 jdk8u76-b09
-8c4b258892025ee4d5df4109f974ba4665ee1208 jdk8u76-b10
-6afc87bdaa7b93855e152aad437305ce0a42251a jdk8u76-b11
-233768376a3649b3f1f4653fe1c433271fc776ee jdk8u76-b12
-7e43e115dfafee70152a01b99aa9de25b4410570 jdk8u92-b00
-1bce84411d37ecf9a4335d1348f4b2f0b7ab6e08 jdk8u92-b13
-fb9f98ed6ef2505a424864f0a9468e59298fede6 jdk8u92-b14
-ac887193179bae82fd1cdf4d8c463457163a6535 jdk8u92-b31
-edce55dd16423b70ebdb36a14b3e6c62d223637b jdk8u92-b32
-69550dfee4b1adb5c73175f0555dd69e7436ca8b jdk8u92-b33
-75757308d2785ab9dc36fddf022e6d3f6e9246a6 jdk8u92-b34
-cb072b12f5dbe3a249d596078d98a34ec9364187 jdk8u81-b00
-fb5e0a18ad7d49134616879d1a500b1356e12fd4 jdk8u101-b01
-c7aeb4e55b0f7de8c5bd2a6e41dc5c54c4239271 jdk8u101-b02
-c678c1a31a553ebe7a8fd3888acc282dbd975e3b jdk8u101-b03
-a6a032a5490f4000bdfb25a2f604b22bcdf95ecf jdk8u101-b04
-80f389596bfaa22d4d2282b8417b98a53241f2aa jdk8u101-b05
-03f2bf9410ef2aad8d8a5ab0432ae0dbdf8bfd62 jdk8u101-b06
-39e620ddf0bb8c6a6d6f0588c71d5f43d8bcc987 jdk8u101-b07
-20b4715976338d4307c2d70e205ce88f31fbd7e7 jdk8u101-b08
-97939d061a0e492c6c2b464df44373165ecc15d2 jdk8u101-b09
-0066fe71b1203e103f7e1a2354bd94f65fdf38fd jdk8u101-b10
-0878a0a5fdabeec872e878f4737d96edee8b1393 jdk8u101-b11
-ddcc10eeb9d3367eb4b3fa0cd4d118e6dbc8850e jdk8u101-b12
-8ee36eca2124f4ea14d0b7ef844d5d7070eb0dd1 jdk8u101-b13
-acbcb6682c9b3e66f9cc61a6a62e8cb5f24c75d3 jdk8u76-b00
-b3c914ad842d61818e0c5850409f77478b13acc6 jdk8u76-b01
-7711933ec18462ece8a1b9a9527ec873c520b1ab jdk8u76-b02
-11dd1c13f1bd75f58fc0b020c767f2c331abb2a7 jdk8u76-b03
-1cc1c3510fd8b9fa2a18bfad3984ca16069f013e jdk8u76-b04
-b96204430344538b19eea491a8cb4ad1ba711c39 jdk8u102-b00
-b96204430344538b19eea491a8cb4ad1ba711c39 jdk8u82-b00
-7ae23fadd851d39b3c4f1a88cdb5e087e174afd5 jdk8u102-b01
-760d26dbaa27603ee94a746e47f166e6470290c2 jdk8u102-b02
-9be3e75c8f466e69f21a0894731a3863d48bcf43 jdk8u102-b03
-58469c50677dfcf88b7b2f740ac71c7e1d1dd1d2 jdk8u102-b04
-f5cb21e3a36196f1c8c224d6b17d88dec37f7e49 jdk8u102-b05
-545ae88cd091d1e362537971b0c6f1b8d4327b9e jdk8u102-b06
-f563e46f3083e1c542a6bf3e11547d297c9da8fa jdk8u102-b07
-c9f8318eb6315719d79a3fa4791d73da42e73fe2 jdk8u102-b08
-8f5ebb91ab3a341a6f7db7ede8113a4f52a6ab26 jdk8u102-b09
-018c7ebb858c5cd3af8e9b11b03e4e05663250b4 jdk8u102-b10
-429621d25778abb1ab7a0ede8dc48d5606f76108 jdk8u102-b11
-fef62f7eb59982f2c92a3bb135c6ae4d6a466328 jdk8u102-b12
-e9de037c3b4c7691662d996c49b42f3e639e65ee jdk8u102-b13
-1f032000ff4b70c3adc02669b6324880199f8db8 jdk8u102-b14
-ff603463199f8a2140cb97fd3ff98046dfeecb3f jdk8u102-b31
-58dea534c1d49731a40de645cfa3450949f31d26 jdk8u102-b32
-d31aad84c2727e40792cba85073713424b6b209f jdk8u102-b33
-6d28aaf99e9383e968654867e9fd2195046f33f4 jdk8u102-b34
-d3c5785df6b5aacdba20221b2f819aae93becac7 jdk8u102-b35
-a6a032a5490f4000bdfb25a2f604b22bcdf95ecf jdk8u111-b00
-4389b3cda88c98df36b36116999c4591a9b8e12c jdk8u111-b01
-1ffc284c45e0fb86c066b832d7be50766b68eb25 jdk8u111-b02
-f518fa45f0f04dbadd026a390254b57169a0c8ab jdk8u111-b03
-4daccb30c04496252bf7d43de8e2ee0471e4319f jdk8u111-b04
-9bbba018c96a17c5b5583e26a38d3c1e910178ef jdk8u111-b05
-bd3773524c2de38524496097d7d8bc2c1cc39e96 jdk8u111-b06
-9c8856c6b82e4b9773896322146c3b1d6d12a6ec jdk8u111-b07
-76e3e209e51c17546b484b0ac95e77cbb949e4cf jdk8u111-b08
-c4301c045c79b8984346d705999d08475792418b jdk8u111-b09
-ea4555b9d9130771e228fdf0f33b783bcbc3172c jdk8u111-b10
-d80acd543dcb4ddb011dec05da364727da907ec2 jdk8u111-b11
-59b4011136ae60b43855f99d316119ca61d84460 jdk8u111-b12
-41ed5205949c82e729533e897382b39342029cff jdk8u111-b13
-f1d0b6e8107011c46fca3621bcf8c0a873f379f7 jdk8u111-b14
-4e861d8430460a72ee3e5c79a85e772b06684adc jdk8u112-b00
-664dd77016540cb9cee7b1bfa27a0a6970f7cf1f jdk8u112-b01
-80ce57123e23ff53f19c034ea5892b186730ddf3 jdk8u112-b02
-fa8960424b5baf4aa0c1e0172115e85317f04127 jdk8u112-b03
-cfc0c92fdbac159ab3434b96d650324cf6dc91dd jdk8u112-b04
-e677228a078a680d8761b3fd22938effe9f7e18d jdk8u112-b06
-7ebdc1fa55fa3f0c21cc009bf1bb8cfd39a92099 jdk8u112-b07
-6ee652d363bb2e0a9f7f0ea7d0d8f4de727aec7c jdk8u112-b08
-45d7c35417517939a600614f0dd0cb16a3098937 jdk8u112-b09
-17cfa0cd7c3c621236f4dd891f8808c3a03c3542 jdk8u112-b10
-ed365ea4cf5fb4d9407e9484f0cb5cd2e2c7786c jdk8u112-b11
-382516531501b0136ae56e9bccc6d09de805ce39 jdk8u112-b12
-eca53abf6800f86146fbcc0e81af4346526e3ad0 jdk8u112-b13
-15749f6d0d05bc1acc005643ba494ff09387cbdc jdk8u112-b14
-b07754d40ea6415af3b267327e748522ea17b131 jdk8u112-b15
-66ef33852d93fe8469724cbdbbdd57dd0e506a6f jdk8u112-b16
-376ba5ed85cc43ef8f13eddc592126e42887ac60 jdk8u112-b31
-9bbba018c96a17c5b5583e26a38d3c1e910178ef jdk8u121-b00
-21da1526aeaf09fde06ec0a5504b564b591f7d03 jdk8u121-b01
-a0ad630d453b3b3c5b1185056a9216281f3085cd jdk8u121-b02
-e76bf2e89efd4b98fa399e4c7db489fc86275257 jdk8u121-b03
-05ac2cb9826a084578dd3b52582323b2473da631 jdk8u121-b04
-49e1091960832ddb247de2825414577d398ba15f jdk8u121-b05
-e31f5ceba6bf5ab6ddfdd1bffef3536e6af8f78b jdk8u121-b06
-d12a9b165b4789915a6ef267099db9721a9887f8 jdk8u121-b07
-c7325d95eaba9e5ef329527107bafc68346d4264 jdk8u121-b08
-f805dcb18704a7028b9d193e8fe661381d473213 jdk8u121-b09
-989c624fdc1f306f1b6068b0529268a46e21ee6b jdk8u121-b10
-77c3d617ae4c28c6e29d51411ab2b2c9eb24683f jdk8u121-b11
-f9cb265fd35fc60dccd75075614f8e897af92ab3 jdk8u121-b12
-b8d4e47240711ff66f9347483d20c84466d75c89 jdk8u121-b13
-2e5a470691f23ebf8d1f0f0dea8ef7de9a70a943 jdk8u122-b00
-cbb8efe139275a4e7c541f9e45eb410c27a5ea61 jdk8u122-b01
-e279f24557d43d8edfe313cb1a53add7ac6ceb2c jdk8u122-b02
-4d0371f160495cc61e3b57ca2d57884c2b9f9068 jdk8u122-b03
-4d0371f160495cc61e3b57ca2d57884c2b9f9068 jdk8u122-b03
-0000000000000000000000000000000000000000 jdk8u122-b03
-0000000000000000000000000000000000000000 jdk8u122-b03
-95728234c69f848fda20c3d107a2a14405e8e8bd jdk8u122-b03
-540ca507f5e33ad46c85750f5df110522454cb2d jdk8u122-b04
-7f6d0e9a119670bb83ab2961503471d73f8a5f7e jdk8u132-b00
-4203c092a35355406709027827e9130f79dd96ca jdk8u152-b00
-bedfdbc290ac3c771c107a644250c1985f26fb2f jdk8u152-b01
diff --git a/.jcheck/conf b/.jcheck/conf
deleted file mode 100644
index 5bd24b1..0000000
--- a/.jcheck/conf
+++ /dev/null
@@ -1,2 +0,0 @@
-project=jdk8
-bugids=dup
diff --git a/ASSEMBLY_EXCEPTION b/ASSEMBLY_EXCEPTION
deleted file mode 100644
index 065b8d9..0000000
--- a/ASSEMBLY_EXCEPTION
+++ /dev/null
@@ -1,27 +0,0 @@
-
-OPENJDK ASSEMBLY EXCEPTION
-
-The OpenJDK source code made available by Oracle America, Inc. (Oracle) at
-openjdk.java.net ("OpenJDK Code") is distributed under the terms of the GNU
-General Public License <http://www.gnu.org/copyleft/gpl.html> version 2
-only ("GPL2"), with the following clarification and special exception.
-
- Linking this OpenJDK Code statically or dynamically with other code
- is making a combined work based on this library. Thus, the terms
- and conditions of GPL2 cover the whole combination.
-
- As a special exception, Oracle gives you permission to link this
- OpenJDK Code with certain code licensed by Oracle as indicated at
- http://openjdk.java.net/legal/exception-modules-2007-05-08.html
- ("Designated Exception Modules") to produce an executable,
- regardless of the license terms of the Designated Exception Modules,
- and to copy and distribute the resulting executable under GPL2,
- provided that the Designated Exception Modules continue to be
- governed by the licenses under which they were offered by Oracle.
-
-As such, it allows licensees and sublicensees of Oracle's GPL2 OpenJDK Code
-to build an executable that includes those portions of necessary code that
-Oracle could not provide under GPL2 (or that Oracle has provided under GPL2
-with the Classpath exception). If you modify or add to the OpenJDK code,
-that new GPL2 code may still be combined with Designated Exception Modules
-if the new code is made subject to this exception by its copyright holder.
diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index 8b400c7..0000000
--- a/LICENSE
+++ /dev/null
@@ -1,347 +0,0 @@
-The GNU General Public License (GPL)
-
-Version 2, June 1991
-
-Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-Everyone is permitted to copy and distribute verbatim copies of this license
-document, but changing it is not allowed.
-
-Preamble
-
-The licenses for most software are designed to take away your freedom to share
-and change it. By contrast, the GNU General Public License is intended to
-guarantee your freedom to share and change free software--to make sure the
-software is free for all its users. This General Public License applies to
-most of the Free Software Foundation's software and to any other program whose
-authors commit to using it. (Some other Free Software Foundation software is
-covered by the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
-When we speak of free software, we are referring to freedom, not price. Our
-General Public Licenses are designed to make sure that you have the freedom to
-distribute copies of free software (and charge for this service if you wish),
-that you receive source code or can get it if you want it, that you can change
-the software or use pieces of it in new free programs; and that you know you
-can do these things.
-
-To protect your rights, we need to make restrictions that forbid anyone to deny
-you these rights or to ask you to surrender the rights. These restrictions
-translate to certain responsibilities for you if you distribute copies of the
-software, or if you modify it.
-
-For example, if you distribute copies of such a program, whether gratis or for
-a fee, you must give the recipients all the rights that you have. You must
-make sure that they, too, receive or can get the source code. And you must
-show them these terms so they know their rights.
-
-We protect your rights with two steps: (1) copyright the software, and (2)
-offer you this license which gives you legal permission to copy, distribute
-and/or modify the software.
-
-Also, for each author's protection and ours, we want to make certain that
-everyone understands that there is no warranty for this free software. If the
-software is modified by someone else and passed on, we want its recipients to
-know that what they have is not the original, so that any problems introduced
-by others will not reflect on the original authors' reputations.
-
-Finally, any free program is threatened constantly by software patents. We
-wish to avoid the danger that redistributors of a free program will
-individually obtain patent licenses, in effect making the program proprietary.
-To prevent this, we have made it clear that any patent must be licensed for
-everyone's free use or not licensed at all.
-
-The precise terms and conditions for copying, distribution and modification
-follow.
-
-TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-0. This License applies to any program or other work which contains a notice
-placed by the copyright holder saying it may be distributed under the terms of
-this General Public License. The "Program", below, refers to any such program
-or work, and a "work based on the Program" means either the Program or any
-derivative work under copyright law: that is to say, a work containing the
-Program or a portion of it, either verbatim or with modifications and/or
-translated into another language. (Hereinafter, translation is included
-without limitation in the term "modification".) Each licensee is addressed as
-"you".
-
-Activities other than copying, distribution and modification are not covered by
-this License; they are outside its scope. The act of running the Program is
-not restricted, and the output from the Program is covered only if its contents
-constitute a work based on the Program (independent of having been made by
-running the Program). Whether that is true depends on what the Program does.
-
-1. You may copy and distribute verbatim copies of the Program's source code as
-you receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice and
-disclaimer of warranty; keep intact all the notices that refer to this License
-and to the absence of any warranty; and give any other recipients of the
-Program a copy of this License along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and you may
-at your option offer warranty protection in exchange for a fee.
-
-2. You may modify your copy or copies of the Program or any portion of it, thus
-forming a work based on the Program, and copy and distribute such modifications
-or work under the terms of Section 1 above, provided that you also meet all of
-these conditions:
-
- a) You must cause the modified files to carry prominent notices stating
- that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in whole or
- in part contains or is derived from the Program or any part thereof, to be
- licensed as a whole at no charge to all third parties under the terms of
- this License.
-
- c) If the modified program normally reads commands interactively when run,
- you must cause it, when started running for such interactive use in the
- most ordinary way, to print or display an announcement including an
- appropriate copyright notice and a notice that there is no warranty (or
- else, saying that you provide a warranty) and that users may redistribute
- the program under these conditions, and telling the user how to view a copy
- of this License. (Exception: if the Program itself is interactive but does
- not normally print such an announcement, your work based on the Program is
- not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If identifiable
-sections of that work are not derived from the Program, and can be reasonably
-considered independent and separate works in themselves, then this License, and
-its terms, do not apply to those sections when you distribute them as separate
-works. But when you distribute the same sections as part of a whole which is a
-work based on the Program, the distribution of the whole must be on the terms
-of this License, whose permissions for other licensees extend to the entire
-whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest your
-rights to work written entirely by you; rather, the intent is to exercise the
-right to control the distribution of derivative or collective works based on
-the Program.
-
-In addition, mere aggregation of another work not based on the Program with the
-Program (or with a work based on the Program) on a volume of a storage or
-distribution medium does not bring the other work under the scope of this
-License.
-
-3. You may copy and distribute the Program (or a work based on it, under
-Section 2) in object code or executable form under the terms of Sections 1 and
-2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable source
- code, which must be distributed under the terms of Sections 1 and 2 above
- on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three years, to
- give any third party, for a charge no more than your cost of physically
- performing source distribution, a complete machine-readable copy of the
- corresponding source code, to be distributed under the terms of Sections 1
- and 2 above on a medium customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer to
- distribute corresponding source code. (This alternative is allowed only
- for noncommercial distribution and only if you received the program in
- object code or executable form with such an offer, in accord with
- Subsection b above.)
-
-The source code for a work means the preferred form of the work for making
-modifications to it. For an executable work, complete source code means all
-the source code for all modules it contains, plus any associated interface
-definition files, plus the scripts used to control compilation and installation
-of the executable. However, as a special exception, the source code
-distributed need not include anything that is normally distributed (in either
-source or binary form) with the major components (compiler, kernel, and so on)
-of the operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the source
-code from the same place counts as distribution of the source code, even though
-third parties are not compelled to copy the source along with the object code.
-
-4. You may not copy, modify, sublicense, or distribute the Program except as
-expressly provided under this License. Any attempt otherwise to copy, modify,
-sublicense or distribute the Program is void, and will automatically terminate
-your rights under this License. However, parties who have received copies, or
-rights, from you under this License will not have their licenses terminated so
-long as such parties remain in full compliance.
-
-5. You are not required to accept this License, since you have not signed it.
-However, nothing else grants you permission to modify or distribute the Program
-or its derivative works. These actions are prohibited by law if you do not
-accept this License. Therefore, by modifying or distributing the Program (or
-any work based on the Program), you indicate your acceptance of this License to
-do so, and all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-6. Each time you redistribute the Program (or any work based on the Program),
-the recipient automatically receives a license from the original licensor to
-copy, distribute or modify the Program subject to these terms and conditions.
-You may not impose any further restrictions on the recipients' exercise of the
-rights granted herein. You are not responsible for enforcing compliance by
-third parties to this License.
-
-7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues), conditions
-are imposed on you (whether by court order, agreement or otherwise) that
-contradict the conditions of this License, they do not excuse you from the
-conditions of this License. If you cannot distribute so as to satisfy
-simultaneously your obligations under this License and any other pertinent
-obligations, then as a consequence you may not distribute the Program at all.
-For example, if a patent license would not permit royalty-free redistribution
-of the Program by all those who receive copies directly or indirectly through
-you, then the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply and
-the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any patents or
-other property right claims or to contest validity of any such claims; this
-section has the sole purpose of protecting the integrity of the free software
-distribution system, which is implemented by public license practices. Many
-people have made generous contributions to the wide range of software
-distributed through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing to
-distribute software through any other system and a licensee cannot impose that
-choice.
-
-This section is intended to make thoroughly clear what is believed to be a
-consequence of the rest of this License.
-
-8. If the distribution and/or use of the Program is restricted in certain
-countries either by patents or by copyrighted interfaces, the original
-copyright holder who places the Program under this License may add an explicit
-geographical distribution limitation excluding those countries, so that
-distribution is permitted only in or among countries not thus excluded. In
-such case, this License incorporates the limitation as if written in the body
-of this License.
-
-9. The Free Software Foundation may publish revised and/or new versions of the
-General Public License from time to time. Such new versions will be similar in
-spirit to the present version, but may differ in detail to address new problems
-or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any later
-version", you have the option of following the terms and conditions either of
-that version or of any later version published by the Free Software Foundation.
-If the Program does not specify a version number of this License, you may
-choose any version ever published by the Free Software Foundation.
-
-10. If you wish to incorporate parts of the Program into other free programs
-whose distribution conditions are different, write to the author to ask for
-permission. For software which is copyrighted by the Free Software Foundation,
-write to the Free Software Foundation; we sometimes make exceptions for this.
-Our decision will be guided by the two goals of preserving the free status of
-all derivatives of our free software and of promoting the sharing and reuse of
-software generally.
-
-NO WARRANTY
-
-11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR
-THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE
-STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE
-PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
-INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
-PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE,
-YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL
-ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE
-PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
-INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA
-BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER
-OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
-END OF TERMS AND CONDITIONS
-
-How to Apply These Terms to Your New Programs
-
-If you develop a new program, and you want it to be of the greatest possible
-use to the public, the best way to achieve this is to make it free software
-which everyone can redistribute and change under these terms.
-
-To do so, attach the following notices to the program. It is safest to attach
-them to the start of each source file to most effectively convey the exclusion
-of warranty; and each file should have at least the "copyright" line and a
-pointer to where the full notice is found.
-
- One line to give the program's name and a brief idea of what it does.
-
- Copyright (C) <year> <name of author>
-
- This program is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the Free
- Software Foundation; either version 2 of the License, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this when it
-starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author Gnomovision comes
- with ABSOLUTELY NO WARRANTY; for details type 'show w'. This is free
- software, and you are welcome to redistribute it under certain conditions;
- type 'show c' for details.
-
-The hypothetical commands 'show w' and 'show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may be
-called something other than 'show w' and 'show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your school,
-if any, to sign a "copyright disclaimer" for the program, if necessary. Here
-is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- 'Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- signature of Ty Coon, 1 April 1989
-
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General Public
-License instead of this License.
-
-
-"CLASSPATH" EXCEPTION TO THE GPL
-
-Certain source files distributed by Oracle America and/or its affiliates are
-subject to the following clarification and special exception to the GPL, but
-only where Oracle has expressly included in the particular source file's header
-the words "Oracle designates this particular file as subject to the "Classpath"
-exception as provided by Oracle in the LICENSE file that accompanied this code."
-
- Linking this library statically or dynamically with other modules is making
- a combined work based on this library. Thus, the terms and conditions of
- the GNU General Public License cover the whole combination.
-
- As a special exception, the copyright holders of this library give you
- permission to link this library with independent modules to produce an
- executable, regardless of the license terms of these independent modules,
- and to copy and distribute the resulting executable under terms of your
- choice, provided that you also meet, for each linked independent module,
- the terms and conditions of the license of that module. An independent
- module is a module which is not derived from or based on this library. If
- you modify this library, you may extend this exception to your version of
- the library, but you are not obligated to do so. If you do not wish to do
- so, delete this exception statement from your version.
diff --git a/README b/README
deleted file mode 100644
index 4d65125..0000000
--- a/README
+++ /dev/null
@@ -1,19 +0,0 @@
-README:
-
- This file should be located at the top of the Mercurial repository.
-
- See http://openjdk.java.net/ for more information about the OpenJDK.
-
- See ../README-builds.html for complete details on build machine requirements.
-
-Simple Build Instructions:
- This repository can be loaded as a NetBeans project, built with ant, or
- built with GNU make, e.g.
- ant
- -OR-
- cd make && gnumake
-
- The built files that will be imported into the jdk build will be in the
- "dist" directory.
- Help information is available by running "ant -projecthelp" or "make help".
-
diff --git a/THIRD_PARTY_README b/THIRD_PARTY_README
deleted file mode 100644
index 2b20da2..0000000
--- a/THIRD_PARTY_README
+++ /dev/null
@@ -1,3574 +0,0 @@
-DO NOT TRANSLATE OR LOCALIZE.
------------------------------
-
-%% This notice is provided with respect to ASM Bytecode Manipulation
-Framework v5.0.3, which may be included with JRE 8, and JDK 8, and
-OpenJDK 8.
-
---- begin of LICENSE ---
-
-Copyright (c) 2000-2011 France Télécom
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
-2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
-3. Neither the name of the copyright holders nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGE.
-
---- end of LICENSE ---
-
---------------------------------------------------------------------------------
-
-%% This notice is provided with respect to BSDiff v4.3, which may be
-included with JRE 8, JDK 8, and OpenJDK 8.
-
---- begin of LICENSE ---
-
-Copyright 2003-2005 Colin Percival
-All rights reserved
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted providing that the following conditions
-are met:
-1. Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
-2. Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
-IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
-
---- end of LICENSE ---
-
--------------------------------------------------------------------------------
-
-%% This notice is provided with respect to CodeViewer 1.0, which may be
-included with JDK 8.
-
---- begin of LICENSE ---
-
-Copyright 1999 by CoolServlets.com.
-
-Any errors or suggested improvements to this class can be reported as
-instructed on CoolServlets.com. We hope you enjoy this program... your
-comments will encourage further development! This software is distributed
-under the terms of the BSD License. Redistribution and use in source and
-binary forms, with or without modification, are permitted provided that the
-following conditions are met:
-
-1. Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
-2. Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
-Neither name of CoolServlets.com nor the names of its contributors may be
-used to endorse or promote products derived from this software without
-specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY COOLSERVLETS.COM AND CONTRIBUTORS ``AS IS'' AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-
-
---- end of LICENSE ---
-
--------------------------------------------------------------------------------
-
-%% This notice is provided with respect to Cryptix AES 3.2.0, which may be
-included with JRE 8, JDK 8, and OpenJDK 8.
-
---- begin of LICENSE ---
-
-Cryptix General License
-
-Copyright (c) 1995-2005 The Cryptix Foundation Limited.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
- 1. Redistributions of source code must retain the copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in
- the documentation and/or other materials provided with the
- distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE CRYPTIX FOUNDATION LIMITED AND
-CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
-INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-IN NO EVENT SHALL THE CRYPTIX FOUNDATION LIMITED OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
-IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
---- end of LICENSE ---
-
--------------------------------------------------------------------------------
-
-%% This notice is provided with respect to CUP Parser Generator for
-Java 0.10k, which may be included with JRE 8, JDK 8, and OpenJDK 8.
-
---- begin of LICENSE ---
-
-Copyright 1996-1999 by Scott Hudson, Frank Flannery, C. Scott Ananian
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted, provided
-that the above copyright notice appear in all copies and that both the
-copyright notice and this permission notice and warranty disclaimer appear in
-supporting documentation, and that the names of the authors or their
-employers not be used in advertising or publicity pertaining to distribution of
-the software without specific, written prior permission.
-
-The authors and their employers disclaim all warranties with regard to
-this software, including all implied warranties of merchantability and fitness.
-In no event shall the authors or their employers be liable for any special,
-indirect or consequential damages or any damages whatsoever resulting from
-loss of use, data or profits, whether in an action of contract, negligence or
-other tortious action, arising out of or in connection with the use or
-performance of this software.
-
---- end of LICENSE ---
-
--------------------------------------------------------------------------------
-
-%% This notice is provided with respect to Document Object Model (DOM) Level 2
-& 3, which may be included with JRE 8, JDK 8, and OpenJDK 8.
-
---- begin of LICENSE ---
-
-W3C SOFTWARE NOTICE AND LICENSE
-
-http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
-
-This work (and included software, documentation such as READMEs, or other
-related items) is being provided by the copyright holders under the following
-license. By obtaining, using and/or copying this work, you (the licensee)
-agree that you have read, understood, and will comply with the following terms
-and conditions.
-
-Permission to copy, modify, and distribute this software and its
-documentation, with or without modification, for any purpose and without fee
-or royalty is hereby granted, provided that you include the following on ALL
-copies of the software and documentation or portions thereof, including
-modifications:
-
- 1.The full text of this NOTICE in a location viewable to users of the
- redistributed or derivative work.
-
- 2.Any pre-existing intellectual property disclaimers, notices, or terms and
- conditions. If none exist, the W3C Software Short Notice should be included
- (hypertext is preferred, text is permitted) within the body of any
- redistributed or derivative code.
-
- 3.Notice of any changes or modifications to the files, including the date
- changes were made. (We recommend you provide URIs to the location from
- which the code is derived.)
-
-THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS
-MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT
-LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR
-PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY
-THIRD PARTY PATENTS,COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
-
-COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL
-OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR
-DOCUMENTATION. The name and trademarks of copyright holders may NOT be used
-in advertising or publicity pertaining to the software without specific,
-written prior permission. Title to copyright in this software and any
-associated documentation will at all times remain with copyright holders.
-
-____________________________________
-
-This formulation of W3C's notice and license became active on December 31
-2002. This version removes the copyright ownership notice such that this
-license can be used with materials other than those owned by the W3C, reflects
-that ERCIM is now a host of the W3C, includes references to this specific
-dated version of the license, and removes the ambiguous grant of "use".
-Otherwise, this version is the same as the previous version and is written so
-as to preserve the Free Software Foundation's assessment of GPL compatibility
-and OSI's certification under the Open Source Definition. Please see our
-Copyright FAQ for common questions about using materials from our site,
-including specific terms and conditions for packages like libwww, Amaya, and
-Jigsaw. Other questions about this notice can be directed to
-site-policy@w3.org.
-
---- end of LICENSE ---
-
--------------------------------------------------------------------------------
-
-%% This notice is provided with respect to Dynalink v0.5, which may be
-included with JRE 8, JDK 8, and OpenJDK 8.
-
---- begin of LICENSE ---
-
-Copyright (c) 2009-2013, Attila Szegedi
-
-All rights reserved.Redistribution and use in source and binary forms, with or
-without modification, are permitted provided that the following conditions are
-met:* Redistributions of source code must retain the above copyright notice,
-this list of conditions and the following disclaimer. * Redistributions in
-binary form must reproduce the above copyright notice, this list of
-conditions and the following disclaimer in the documentation and/or other
-materials provided with the distribution. * Neither the name of Attila
-Szegedi nor the names of its contributors may be used to endorse or promote
-products derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THEPOSSIBILITY OF SUCH DAMAGE.
-
---- end of LICENSE ---
-
--------------------------------------------------------------------------------
-
-%% This notice is provided with respect to Elliptic Curve Cryptography, which
-may be included with JRE 8, JDK 8, and OpenJDK 8.
-
-You are receiving a copy of the Elliptic Curve Cryptography library in source
-form with the JDK 8 and OpenJDK 8 source distributions, and as object code in
-the JRE 8 & JDK 8 runtimes.
-
-In the case of the JRE 8 & JDK 8 runtimes, the terms of the Oracle license do
-NOT apply to the Elliptic Curve Cryptography library; it is licensed under the
-following license, separately from Oracle's JDK & JRE. If you do not wish to
-install the Elliptic Curve Cryptography library, you may delete the library
-named libsunec.so (on Solaris and Linux systems) or sunec.dll (on Windows
-systems) from the JRE bin directory reserved for native libraries.
-
-
---- begin of LICENSE ---
-
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL. It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
- This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it. You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
- When we speak of free software, we are referring to freedom of use,
-not price. Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
- To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights. These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
- For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you. You must make sure that they, too, receive or can get the source
-code. If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it. And you must show them these terms so they know their rights.
-
- We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
- To protect each distributor, we want to make it very clear that
-there is no warranty for the free library. Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-
- Finally, software patents pose a constant threat to the existence of
-any free program. We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder. Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
- Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License. This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License. We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
- When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library. The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom. The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
- We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License. It also provides other free software developers Less
-of an advantage over competing non-free programs. These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries. However, the Lesser license provides advantages in certain
-special circumstances.
-
- For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard. To achieve this, non-free programs must be
-allowed to use the library. A more frequent case is that a free
-library does the same job as widely used non-free libraries. In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
- In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software. For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
- Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
- The precise terms and conditions for copying, distribution and
-modification follow. Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library". The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-
- GNU LESSER GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
- A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
- The "Library", below, refers to any such software library or work
-which has been distributed under these terms. A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language. (Hereinafter, translation is
-included without limitation in the term "modification".)
-
- "Source code" for a work means the preferred form of the work for
-making modifications to it. For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
- Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it). Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
- 1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
- You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
- 2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) The modified work must itself be a software library.
-
- b) You must cause the files modified to carry prominent notices
- stating that you changed the files and the date of any change.
-
- c) You must cause the whole of the work to be licensed at no
- charge to all third parties under the terms of this License.
-
- d) If a facility in the modified Library refers to a function or a
- table of data to be supplied by an application program that uses
- the facility, other than as an argument passed when the facility
- is invoked, then you must make a good faith effort to ensure that,
- in the event an application does not supply such function or
- table, the facility still operates, and performs whatever part of
- its purpose remains meaningful.
-
- (For example, a function in a library to compute square roots has
- a purpose that is entirely well-defined independent of the
- application. Therefore, Subsection 2d requires that any
- application-supplied function or table used by this function must
- be optional: if the application does not supply it, the square
- root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library. To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License. (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.) Do not make any other change in
-these notices.
-
- Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
- This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
- 4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
- If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library". Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
- However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library". The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
- When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library. The
-threshold for this to be true is not precisely defined by law.
-
- If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work. (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
- Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
- 6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
- You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License. You must supply a copy of this License. If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License. Also, you must do one
-of these things:
-
- a) Accompany the work with the complete corresponding
- machine-readable source code for the Library including whatever
- changes were used in the work (which must be distributed under
- Sections 1 and 2 above); and, if the work is an executable linked
- with the Library, with the complete machine-readable "work that
- uses the Library", as object code and/or source code, so that the
- user can modify the Library and then relink to produce a modified
- executable containing the modified Library. (It is understood
- that the user who changes the contents of definitions files in the
- Library will not necessarily be able to recompile the application
- to use the modified definitions.)
-
- b) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (1) uses at run time a
- copy of the library already present on the user's computer system,
- rather than copying library functions into the executable, and (2)
- will operate properly with a modified version of the library, if
- the user installs one, as long as the modified version is
- interface-compatible with the version that the work was made with.
-
- c) Accompany the work with a written offer, valid for at
- least three years, to give the same user the materials
- specified in Subsection 6a, above, for a charge no more
- than the cost of performing this distribution.
-
- d) If distribution of the work is made by offering access to copy
- from a designated place, offer equivalent access to copy the above
- specified materials from the same place.
-
- e) Verify that the user has already received a copy of these
- materials or that you have already sent this user a copy.
-
- For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it. However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
- It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system. Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
- 7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
- a) Accompany the combined library with a copy of the same work
- based on the Library, uncombined with any other library
- facilities. This must be distributed under the terms of the
- Sections above.
-
- b) Give prominent notice with the combined library of the fact
- that part of it is a work based on the Library, and explaining
- where to find the accompanying uncombined form of the same work.
-
- 8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License. Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License. However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
- 9. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Library or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
- 10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-
- 11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all. For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded. In such case, this License incorporates the limitation as if
-written in the body of this License.
-
- 13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation. If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
- 14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission. For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this. Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
- NO WARRANTY
-
- 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Libraries
-
- If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change. You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
- To apply these terms, attach the following notices to the library. It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
- <one line to give the library's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the
- library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
- <signature of Ty Coon>, 1 April 1990
- Ty Coon, President of Vice
-
-That's all there is to it!
-
---- end of LICENSE ---
-
--------------------------------------------------------------------------------
-
-%% This notice is provided with respect to ECMAScript Language
-Specification ECMA-262 Edition 5.1 which may be included with
-JRE 8, JDK 8, and OpenJDK 8.
-
---- begin of LICENSE ---
-
-Copyright notice
-Copyright © 2011 Ecma International
-Ecma International
-Rue du Rhone 114
-CH-1204 Geneva
-Tel: +41 22 849 6000
-Fax: +41 22 849 6001
-Web: http://www.ecma-international.org
-
-This document and possible translations of it may be copied and furnished to
-others, and derivative works that comment on or otherwise explain it or assist
-in its implementation may be prepared, copied, published, and distributed, in
-whole or in part, without restriction of any kind, provided that the above
-copyright notice and this section are included on all such copies and derivative
-works. However, this document itself may not be modified in any way, including
-by removing the copyright notice or references to Ecma International, except as
-needed for the purpose of developing any document or deliverable produced by
-Ecma International (in which case the rules applied to copyrights must be
-followed) or as required to translate it into languages other than English. The
-limited permissions granted above are perpetual and will not be revoked by Ecma
-International or its successors or assigns. This document and the information
-contained herein is provided on an "AS IS" basis and ECMA INTERNATIONAL
-DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY
-WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY OWNERSHIP
-RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR
-PURPOSE." Software License
-
-All Software contained in this document ("Software)" is protected by copyright
-and is being made available under the "BSD License", included below. This
-Software may be subject to third party rights (rights from parties other than
-Ecma International), including patent rights, and no licenses under such third
-party rights are granted under this license even if the third party concerned is
-a member of Ecma International. SEE THE ECMA CODE OF CONDUCT IN PATENT MATTERS
-AVAILABLE AT http://www.ecma-international.org/memento/codeofconduct.htm FOR
-INFORMATION REGARDING THE LICENSING OF PATENT CLAIMS THAT ARE REQUIRED TO
-IMPLEMENT ECMA INTERNATIONAL STANDARDS*. Redistribution and use in source and
-binary forms, with or without modification, are permitted provided that the
-following conditions are met:
-
-1. Redistributions of source code must retain the above copyright notice, this
-list of conditions and the following disclaimer.
-
-2. Redistributions in binary form must reproduce the above copyright notice,
-this list of conditions and the following disclaimer in the documentation and/or
-other materials provided with the distribution.
-
-3. Neither the name of the authors nor Ecma International may be used to endorse
-or promote products derived from this software without specific prior written
-permission.
-
-THIS SOFTWARE IS PROVIDED BY THE ECMA INTERNATIONAL "AS IS" AND ANY EXPRESS OR
-IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
-SHALL ECMA INTERNATIONAL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
-IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
-OF SUCH DAMAGE.
---- end of LICENSE ---
-
-%% This notice is provided with respect to Dynalink library which is included
-with the Nashorn technology.
-
---- begin of LICENSE ---
-Copyright (c) 2009-2013, Attila Szegedi
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-* Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-* Neither the name of the copyright holder nor the names of
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
-IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
-TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER
-BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
---- end of LICENSE ---
-
-%% This notice is provided with respect to Joni library which is included
-with the Nashorn technology.
-
---- begin of LICENSE ---
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-of the Software, and to permit persons to whom the Software is furnished to do
-so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-
---- end of LICENSE ---
-
--------------------------------------------------------------------------------
-
-%% This notice is provided with respect to FontConfig 2.5, which may be
-included with JRE 8, JDK 8, and OpenJDK 8 source distributions on
-Linux and Solaris.
-
---- begin of LICENSE ---
-
-Copyright © 2001,2003 Keith Packard
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that the
-above copyright notice appear in all copies and that both that copyright
-notice and this permission notice appear in supporting documentation, and that
-the name of Keith Packard not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior permission.
-Keith Packard makes no representations about the suitability of this software
-for any purpose. It is provided "as is" without express or implied warranty.
-
-KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL KEITH
-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
-DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
-CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-
---- end of LICENSE ---
-
--------------------------------------------------------------------------------
-
-%% This notice is provided with respect to IAIK PKCS#11 Wrapper,
-which may be included with JRE 8, JDK 8, and OpenJDK 8.
-
---- begin of LICENSE ---
-
-IAIK PKCS#11 Wrapper License
-
-Copyright (c) 2002 Graz University of Technology. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-1. Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
-2. Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
-3. The end-user documentation included with the redistribution, if any, must
- include the following acknowledgment:
-
- "This product includes software developed by IAIK of Graz University of
- Technology."
-
- Alternately, this acknowledgment may appear in the software itself, if and
- wherever such third-party acknowledgments normally appear.
-
-4. The names "Graz University of Technology" and "IAIK of Graz University of
- Technology" must not be used to endorse or promote products derived from this
- software without prior written permission.
-
-5. Products derived from this software may not be called "IAIK PKCS Wrapper",
- nor may "IAIK" appear in their name, without prior written permission of
- Graz University of Technology.
-
-THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES,
-INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-LICENSOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
-OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
-
---- end of LICENSE ---
-
--------------------------------------------------------------------------------
-
-%% This notice is provided with respect to ICU4C 4.0.1 and ICU4J 4.4, which
-may be included with JRE 8, JDK 8, and OpenJDK 8.
-
---- begin of LICENSE ---
-
-Copyright (c) 1995-2010 International Business Machines Corporation and others
-
-All rights reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, and/or sell copies of the
-Software, and to permit persons to whom the Software is furnished to do so,
-provided that the above copyright notice(s) and this permission notice appear
-in all copies of the Software and that both the above copyright notice(s) and
-this permission notice appear in supporting documentation.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN
-NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE
-LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY
-DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
-CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-Except as contained in this notice, the name of a copyright holder shall not
-be used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization of the copyright holder.
-All trademarks and registered trademarks mentioned herein are the property of
-their respective owners.
-
---- end of LICENSE ---
-
--------------------------------------------------------------------------------
-
-%% This notice is provided with respect to IJG JPEG 6b, which may be
-included with JRE 8, JDK 8, and OpenJDK 8.
-
---- begin of LICENSE ---
-
-This software is copyright (C) 1991-1998, Thomas G. Lane.
-All Rights Reserved except as specified below.
-
-Permission is hereby granted to use, copy, modify, and distribute this
-software (or portions thereof) for any purpose, without fee, subject to these
-conditions:
-(1) If any part of the source code for this software is distributed, then this
-README file must be included, with this copyright and no-warranty notice
-unaltered; and any additions, deletions, or changes to the original files
-must be clearly indicated in accompanying documentation.
-(2) If only executable code is distributed, then the accompanying
-documentation must state that "this software is based in part on the work of
-the Independent JPEG Group".
-(3) Permission for use of this software is granted only if the user accepts
-full responsibility for any undesirable consequences; the authors accept
-NO LIABILITY for damages of any kind.
-
-These conditions apply to any software derived from or based on the IJG code,
-not just to the unmodified library. If you use our work, you ought to
-acknowledge us.
-
-Permission is NOT granted for the use of any IJG author's name or company name
-in advertising or publicity relating to this software or products derived from
-it. This software may be referred to only as "the Independent JPEG Group's
-software".
-
-We specifically permit and encourage the use of this software as the basis of
-commercial products, provided that all warranty or liability claims are
-assumed by the product vendor.
-
---- end of LICENSE ---
-
---------------------------------------------------------------------------------
-
-%% This notice is provided with respect to Joni v1.1.9, which may be
-included with JRE 8, JDK 8, and OpenJDK 8.
-
---- begin of LICENSE ---
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-
---- end of LICENSE ---
-
--------------------------------------------------------------------------------
-
-%% This notice is provided with respect to JOpt-Simple v3.0, which may be
-included with JRE 8, JDK 8, and OpenJDK 8.
-
---- begin of LICENSE ---
-
- Copyright (c) 2004-2009 Paul R. Holser, Jr.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
---- end of LICENSE ---
-
---------------------------------------------------------------------------------
-
-%% This notice is provided with respect to Kerberos functionality, which
-which may be included with JRE 8, JDK 8, and OpenJDK 8.
-
---- begin of LICENSE ---
-
- (C) Copyright IBM Corp. 1999 All Rights Reserved.
- Copyright 1997 The Open Group Research Institute. All rights reserved.
-
---- end of LICENSE ---
-
--------------------------------------------------------------------------------
-
-%% This notice is provided with respect to Kerberos functionality from
-FundsXpress, INC., which may be included with JRE 8, JDK 8, and OpenJDK 8.
-
---- begin of LICENSE ---
-
- Copyright (C) 1998 by the FundsXpress, INC.
-
- All rights reserved.
-
- Export of this software from the United States of America may require
- a specific license from the United States Government. It is the
- responsibility of any person or organization contemplating export to
- obtain such a license before exporting.
-
- WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
- distribute this software and its documentation for any purpose and
- without fee is hereby granted, provided that the above copyright
- notice appear in all copies and that both that copyright notice and
- this permission notice appear in supporting documentation, and that
- the name of FundsXpress. not be used in advertising or publicity pertaining
- to distribution of the software without specific, written prior
- permission. FundsXpress makes no representations about the suitability of
- this software for any purpose. It is provided "as is" without express
- or implied warranty.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-
-
---- end of LICENSE ---
-
--------------------------------------------------------------------------------
-
-%% This notice is provided with respect to Kronos OpenGL headers, which may be
-included with JDK 8 and OpenJDK 8 source distributions.
-
---- begin of LICENSE ---
-
- Copyright (c) 2007 The Khronos Group Inc.
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and/or associated documentation files (the "Materials"), to
- deal in the Materials without restriction, including without limitation the
- rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- sell copies of the Materials, and to permit persons to whom the Materials are
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Materials.
-
- THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS IN THE
- MATERIALS.
-
---- end of LICENSE ---
-
--------------------------------------------------------------------------------
-
-%% Portions Copyright Eastman Kodak Company 1992
-
--------------------------------------------------------------------------------
-
-%% This notice is provided with respect to libpng 1.6.16, which may be
-included with JRE 8, JDK 8, and OpenJDK 8.
-
---- begin of LICENSE ---
-
-This copy of the libpng notices is provided for your convenience. In case of
-any discrepancy between this copy and the notices in the file png.h that is
-included in the libpng distribution, the latter shall prevail.
-
-COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
-
-If you modify libpng you may insert additional notices immediately following
-this sentence.
-
-This code is released under the libpng license.
-
-libpng versions 1.2.6, August 15, 2004, through 1.6.16, December 22, 2014, are
-Copyright (c) 2004, 2006-2014 Glenn Randers-Pehrson, and are
-distributed according to the same disclaimer and license as libpng-1.2.5
-with the following individual added to the list of Contributing Authors
-
- Cosmin Truta
-
-libpng versions 1.0.7, July 1, 2000, through 1.2.5 - October 3, 2002, are
-Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are
-distributed according to the same disclaimer and license as libpng-1.0.6
-with the following individuals added to the list of Contributing Authors
-
- Simon-Pierre Cadieux
- Eric S. Raymond
- Gilles Vollant
-
-and with the following additions to the disclaimer:
-
- There is no warranty against interference with your enjoyment of the
- library or against infringement. There is no warranty that our
- efforts or the library will fulfill any of your particular purposes
- or needs. This library is provided with all faults, and the entire
- risk of satisfactory quality, performance, accuracy, and effort is with
- the user.
-
-libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
-Copyright (c) 1998, 1999 Glenn Randers-Pehrson, and are
-distributed according to the same disclaimer and license as libpng-0.96,
-with the following individuals added to the list of Contributing Authors:
-
- Tom Lane
- Glenn Randers-Pehrson
- Willem van Schaik
-
-libpng versions 0.89, June 1996, through 0.96, May 1997, are
-Copyright (c) 1996, 1997 Andreas Dilger
-Distributed according to the same disclaimer and license as libpng-0.88,
-with the following individuals added to the list of Contributing Authors:
-
- John Bowler
- Kevin Bracey
- Sam Bushell
- Magnus Holmgren
- Greg Roelofs
- Tom Tanner
-
-libpng versions 0.5, May 1995, through 0.88, January 1996, are
-Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
-
-For the purposes of this copyright and license, "Contributing Authors"
-is defined as the following set of individuals:
-
- Andreas Dilger
- Dave Martindale
- Guy Eric Schalnat
- Paul Schmidt
- Tim Wegner
-
-The PNG Reference Library is supplied "AS IS". The Contributing Authors
-and Group 42, Inc. disclaim all warranties, expressed or implied,
-including, without limitation, the warranties of merchantability and of
-fitness for any purpose. The Contributing Authors and Group 42, Inc.
-assume no liability for direct, indirect, incidental, special, exemplary,
-or consequential damages, which may result from the use of the PNG
-Reference Library, even if advised of the possibility of such damage.
-
-Permission is hereby granted to use, copy, modify, and distribute this
-source code, or portions hereof, for any purpose, without fee, subject
-to the following restrictions:
-
-1. The origin of this source code must not be misrepresented.
-
-2. Altered versions must be plainly marked as such and must not
- be misrepresented as being the original source.
-
-3. This Copyright notice may not be removed or altered from any
- source or altered source distribution.
-
-The Contributing Authors and Group 42, Inc. specifically permit, without
-fee, and encourage the use of this source code as a component to
-supporting the PNG file format in commercial products. If you use this
-source code in a product, acknowledgment is not required but would be
-appreciated.
-
-
-A "png_get_copyright" function is available, for convenient use in "about"
-boxes and the like:
-
- printf("%s",png_get_copyright(NULL));
-
-Also, the PNG logo (in PNG format, of course) is supplied in the
-files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31).
-
-Libpng is OSI Certified Open Source Software. OSI Certified Open Source is a
-certification mark of the Open Source Initiative.
-
-Glenn Randers-Pehrson
-glennrp at users.sourceforge.net
-December 22, 2014
-
---- end of LICENSE ---
-
--------------------------------------------------------------------------------
-
-%% This notice is provided with respect to GIFLIB 5.1.1 & libungif 4.1.3, which may be
-included with JRE 8, JDK 8, and OpenJDK 8.
-
---- begin of LICENSE ---
-
-The GIFLIB distribution is Copyright (c) 1997 Eric S. Raymond
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-
---- end of LICENSE ---
-
--------------------------------------------------------------------------------
-
-%% This notice is provided with respect to Little CMS 2.7, which may be
-included with JRE 8, JDK 8, and OpenJDK 8.
-
---- begin of LICENSE ---
-
-Little CMS
-Copyright (c) 1998-2015 Marti Maria Saguer
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-
---- end of LICENSE ---
-
--------------------------------------------------------------------------------
-
-%% Lucida is a registered trademark or trademark of Bigelow & Holmes in the
-U.S. and other countries.
-
--------------------------------------------------------------------------------
-
-%% This notice is provided with respect to Mesa 3D Graphics Library v4.1,
-which may be included with JRE 8, JDK 8, and OpenJDK 8 source distributions.
-
---- begin of LICENSE ---
-
- Mesa 3-D graphics library
- Version: 4.1
-
- Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
-
- Permission is hereby granted, free of charge, to any person obtaining a
- copy of this software and associated documentation files (the "Software"),
- to deal in the Software without restriction, including without limitation
- the rights to use, copy, modify, merge, publish, distribute, sublicense,
- and/or sell copies of the Software, and to permit persons to whom the
- Software is furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
---- end of LICENSE ---
-
--------------------------------------------------------------------------------
-
-%% This notice is provided with respect to Mozilla Network Security
-Services (NSS), which is supplied with the JDK test suite in the OpenJDK
-source code repository. It is licensed under Mozilla Public License (MPL),
-version 2.0.
-
-The NSS libraries are supplied in executable form, built from unmodified
-NSS source code labeled with the "NSS_3_16_RTM" HG tag.
-
-The NSS source code is available in the OpenJDK source code repository at:
- jdk/test/sun/security/pkcs11/nss/src
-
-The NSS libraries are available in the OpenJDK source code repository at:
- jdk/test/sun/security/pkcs11/nss/lib
-
---- begin of LICENSE ---
-
-Mozilla Public License Version 2.0
-==================================
-
-1. Definitions
---------------
-
-1.1. "Contributor"
- means each individual or legal entity that creates, contributes to
- the creation of, or owns Covered Software.
-
-1.2. "Contributor Version"
- means the combination of the Contributions of others (if any) used
- by a Contributor and that particular Contributor's Contribution.
-
-1.3. "Contribution"
- means Covered Software of a particular Contributor.
-
-1.4. "Covered Software"
- means Source Code Form to which the initial Contributor has attached
- the notice in Exhibit A, the Executable Form of such Source Code
- Form, and Modifications of such Source Code Form, in each case
- including portions thereof.
-
-1.5. "Incompatible With Secondary Licenses"
- means
-
- (a) that the initial Contributor has attached the notice described
- in Exhibit B to the Covered Software; or
-
- (b) that the Covered Software was made available under the terms of
- version 1.1 or earlier of the License, but not also under the
- terms of a Secondary License.
-
-1.6. "Executable Form"
- means any form of the work other than Source Code Form.
-
-1.7. "Larger Work"
- means a work that combines Covered Software with other material, in
- a separate file or files, that is not Covered Software.
-
-1.8. "License"
- means this document.
-
-1.9. "Licensable"
- means having the right to grant, to the maximum extent possible,
- whether at the time of the initial grant or subsequently, any and
- all of the rights conveyed by this License.
-
-1.10. "Modifications"
- means any of the following:
-
- (a) any file in Source Code Form that results from an addition to,
- deletion from, or modification of the contents of Covered
- Software; or
-
- (b) any new file in Source Code Form that contains any Covered
- Software.
-
-1.11. "Patent Claims" of a Contributor
- means any patent claim(s), including without limitation, method,
- process, and apparatus claims, in any patent Licensable by such
- Contributor that would be infringed, but for the grant of the
- License, by the making, using, selling, offering for sale, having
- made, import, or transfer of either its Contributions or its
- Contributor Version.
-
-1.12. "Secondary License"
- means either the GNU General Public License, Version 2.0, the GNU
- Lesser General Public License, Version 2.1, the GNU Affero General
- Public License, Version 3.0, or any later versions of those
- licenses.
-
-1.13. "Source Code Form"
- means the form of the work preferred for making modifications.
-
-1.14. "You" (or "Your")
- means an individual or a legal entity exercising rights under this
- License. For legal entities, "You" includes any entity that
- controls, is controlled by, or is under common control with You. For
- purposes of this definition, "control" means (a) the power, direct
- or indirect, to cause the direction or management of such entity,
- whether by contract or otherwise, or (b) ownership of more than
- fifty percent (50%) of the outstanding shares or beneficial
- ownership of such entity.
-
-2. License Grants and Conditions
---------------------------------
-
-2.1. Grants
-
-Each Contributor hereby grants You a world-wide, royalty-free,
-non-exclusive license:
-
-(a) under intellectual property rights (other than patent or trademark)
- Licensable by such Contributor to use, reproduce, make available,
- modify, display, perform, distribute, and otherwise exploit its
- Contributions, either on an unmodified basis, with Modifications, or
- as part of a Larger Work; and
-
-(b) under Patent Claims of such Contributor to make, use, sell, offer
- for sale, have made, import, and otherwise transfer either its
- Contributions or its Contributor Version.
-
-2.2. Effective Date
-
-The licenses granted in Section 2.1 with respect to any Contribution
-become effective for each Contribution on the date the Contributor first
-distributes such Contribution.
-
-2.3. Limitations on Grant Scope
-
-The licenses granted in this Section 2 are the only rights granted under
-this License. No additional rights or licenses will be implied from the
-distribution or licensing of Covered Software under this License.
-Notwithstanding Section 2.1(b) above, no patent license is granted by a
-Contributor:
-
-(a) for any code that a Contributor has removed from Covered Software;
- or
-
-(b) for infringements caused by: (i) Your and any other third party's
- modifications of Covered Software, or (ii) the combination of its
- Contributions with other software (except as part of its Contributor
- Version); or
-
-(c) under Patent Claims infringed by Covered Software in the absence of
- its Contributions.
-
-This License does not grant any rights in the trademarks, service marks,
-or logos of any Contributor (except as may be necessary to comply with
-the notice requirements in Section 3.4).
-
-2.4. Subsequent Licenses
-
-No Contributor makes additional grants as a result of Your choice to
-distribute the Covered Software under a subsequent version of this
-License (see Section 10.2) or under the terms of a Secondary License (if
-permitted under the terms of Section 3.3).
-
-2.5. Representation
-
-Each Contributor represents that the Contributor believes its
-Contributions are its original creation(s) or it has sufficient rights
-to grant the rights to its Contributions conveyed by this License.
-
-2.6. Fair Use
-
-This License is not intended to limit any rights You have under
-applicable copyright doctrines of fair use, fair dealing, or other
-equivalents.
-
-2.7. Conditions
-
-Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
-in Section 2.1.
-
-3. Responsibilities
--------------------
-
-3.1. Distribution of Source Form
-
-All distribution of Covered Software in Source Code Form, including any
-Modifications that You create or to which You contribute, must be under
-the terms of this License. You must inform recipients that the Source
-Code Form of the Covered Software is governed by the terms of this
-License, and how they can obtain a copy of this License. You may not
-attempt to alter or restrict the recipients' rights in the Source Code
-Form.
-
-3.2. Distribution of Executable Form
-
-If You distribute Covered Software in Executable Form then:
-
-(a) such Covered Software must also be made available in Source Code
- Form, as described in Section 3.1, and You must inform recipients of
- the Executable Form how they can obtain a copy of such Source Code
- Form by reasonable means in a timely manner, at a charge no more
- than the cost of distribution to the recipient; and
-
-(b) You may distribute such Executable Form under the terms of this
- License, or sublicense it under different terms, provided that the
- license for the Executable Form does not attempt to limit or alter
- the recipients' rights in the Source Code Form under this License.
-
-3.3. Distribution of a Larger Work
-
-You may create and distribute a Larger Work under terms of Your choice,
-provided that You also comply with the requirements of this License for
-the Covered Software. If the Larger Work is a combination of Covered
-Software with a work governed by one or more Secondary Licenses, and the
-Covered Software is not Incompatible With Secondary Licenses, this
-License permits You to additionally distribute such Covered Software
-under the terms of such Secondary License(s), so that the recipient of
-the Larger Work may, at their option, further distribute the Covered
-Software under the terms of either this License or such Secondary
-License(s).
-
-3.4. Notices
-
-You may not remove or alter the substance of any license notices
-(including copyright notices, patent notices, disclaimers of warranty,
-or limitations of liability) contained within the Source Code Form of
-the Covered Software, except that You may alter any license notices to
-the extent required to remedy known factual inaccuracies.
-
-3.5. Application of Additional Terms
-
-You may choose to offer, and to charge a fee for, warranty, support,
-indemnity or liability obligations to one or more recipients of Covered
-Software. However, You may do so only on Your own behalf, and not on
-behalf of any Contributor. You must make it absolutely clear that any
-such warranty, support, indemnity, or liability obligation is offered by
-You alone, and You hereby agree to indemnify every Contributor for any
-liability incurred by such Contributor as a result of warranty, support,
-indemnity or liability terms You offer. You may include additional
-disclaimers of warranty and limitations of liability specific to any
-jurisdiction.
-
-4. Inability to Comply Due to Statute or Regulation
----------------------------------------------------
-
-If it is impossible for You to comply with any of the terms of this
-License with respect to some or all of the Covered Software due to
-statute, judicial order, or regulation then You must: (a) comply with
-the terms of this License to the maximum extent possible; and (b)
-describe the limitations and the code they affect. Such description must
-be placed in a text file included with all distributions of the Covered
-Software under this License. Except to the extent prohibited by statute
-or regulation, such description must be sufficiently detailed for a
-recipient of ordinary skill to be able to understand it.
-
-5. Termination
---------------
-
-5.1. The rights granted under this License will terminate automatically
-if You fail to comply with any of its terms. However, if You become
-compliant, then the rights granted under this License from a particular
-Contributor are reinstated (a) provisionally, unless and until such
-Contributor explicitly and finally terminates Your grants, and (b) on an
-ongoing basis, if such Contributor fails to notify You of the
-non-compliance by some reasonable means prior to 60 days after You have
-come back into compliance. Moreover, Your grants from a particular
-Contributor are reinstated on an ongoing basis if such Contributor
-notifies You of the non-compliance by some reasonable means, this is the
-first time You have received notice of non-compliance with this License
-from such Contributor, and You become compliant prior to 30 days after
-Your receipt of the notice.
-
-5.2. If You initiate litigation against any entity by asserting a patent
-infringement claim (excluding declaratory judgment actions,
-counter-claims, and cross-claims) alleging that a Contributor Version
-directly or indirectly infringes any patent, then the rights granted to
-You by any and all Contributors for the Covered Software under Section
-2.1 of this License shall terminate.
-
-5.3. In the event of termination under Sections 5.1 or 5.2 above, all
-end user license agreements (excluding distributors and resellers) which
-have been validly granted by You or Your distributors under this License
-prior to termination shall survive termination.
-
-************************************************************************
-* *
-* 6. Disclaimer of Warranty *
-* ------------------------- *
-* *
-* Covered Software is provided under this License on an "as is" *
-* basis, without warranty of any kind, either expressed, implied, or *
-* statutory, including, without limitation, warranties that the *
-* Covered Software is free of defects, merchantable, fit for a *
-* particular purpose or non-infringing. The entire risk as to the *
-* quality and performance of the Covered Software is with You. *
-* Should any Covered Software prove defective in any respect, You *
-* (not any Contributor) assume the cost of any necessary servicing, *
-* repair, or correction. This disclaimer of warranty constitutes an *
-* essential part of this License. No use of any Covered Software is *
-* authorized under this License except under this disclaimer. *
-* *
-************************************************************************
-
-************************************************************************
-* *
-* 7. Limitation of Liability *
-* -------------------------- *
-* *
-* Under no circumstances and under no legal theory, whether tort *
-* (including negligence), contract, or otherwise, shall any *
-* Contributor, or anyone who distributes Covered Software as *
-* permitted above, be liable to You for any direct, indirect, *
-* special, incidental, or consequential damages of any character *
-* including, without limitation, damages for lost profits, loss of *
-* goodwill, work stoppage, computer failure or malfunction, or any *
-* and all other commercial damages or losses, even if such party *
-* shall have been informed of the possibility of such damages. This *
-* limitation of liability shall not apply to liability for death or *
-* personal injury resulting from such party's negligence to the *
-* extent applicable law prohibits such limitation. Some *
-* jurisdictions do not allow the exclusion or limitation of *
-* incidental or consequential damages, so this exclusion and *
-* limitation may not apply to You. *
-* *
-************************************************************************
-
-8. Litigation
--------------
-
-Any litigation relating to this License may be brought only in the
-courts of a jurisdiction where the defendant maintains its principal
-place of business and such litigation shall be governed by laws of that
-jurisdiction, without reference to its conflict-of-law provisions.
-Nothing in this Section shall prevent a party's ability to bring
-cross-claims or counter-claims.
-
-9. Miscellaneous
-----------------
-
-This License represents the complete agreement concerning the subject
-matter hereof. If any provision of this License is held to be
-unenforceable, such provision shall be reformed only to the extent
-necessary to make it enforceable. Any law or regulation which provides
-that the language of a contract shall be construed against the drafter
-shall not be used to construe this License against a Contributor.
-
-10. Versions of the License
----------------------------
-
-10.1. New Versions
-
-Mozilla Foundation is the license steward. Except as provided in Section
-10.3, no one other than the license steward has the right to modify or
-publish new versions of this License. Each version will be given a
-distinguishing version number.
-
-10.2. Effect of New Versions
-
-You may distribute the Covered Software under the terms of the version
-of the License under which You originally received the Covered Software,
-or under the terms of any subsequent version published by the license
-steward.
-
-10.3. Modified Versions
-
-If you create software not governed by this License, and you want to
-create a new license for such software, you may create and use a
-modified version of this License if you rename the license and remove
-any references to the name of the license steward (except to note that
-such modified license differs from this License).
-
-10.4. Distributing Source Code Form that is Incompatible With Secondary
-Licenses
-
-If You choose to distribute Source Code Form that is Incompatible With
-Secondary Licenses under the terms of this version of the License, the
-notice described in Exhibit B of this License must be attached.
-
-Exhibit A - Source Code Form License Notice
--------------------------------------------
-
- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-If it is not possible or desirable to put the notice in a particular
-file, then You may include the notice in a location (such as a LICENSE
-file in a relevant directory) where a recipient would be likely to look
-for such a notice.
-
-You may add additional accurate notices of copyright ownership.
-
-Exhibit B - "Incompatible With Secondary Licenses" Notice
----------------------------------------------------------
-
- This Source Code Form is "Incompatible With Secondary Licenses", as
- defined by the Mozilla Public License, v. 2.0.
-
---- end of LICENSE ---
-
--------------------------------------------------------------------------------
-
-%% This notice is provided with respect to PC/SC Lite for Suse Linux v.1.1.1,
-which may be included with JRE 8, JDK 8, and OpenJDK 8 on Linux and Solaris.
-
---- begin of LICENSE ---
-
-Copyright (c) 1999-2004 David Corcoran <corcoran@linuxnet.com>
-Copyright (c) 1999-2004 Ludovic Rousseau <ludovic.rousseau (at) free.fr>
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-3. All advertising materials mentioning features or use of this software
- must display the following acknowledgement:
- This product includes software developed by:
- David Corcoran <corcoran@linuxnet.com>
- http://www.linuxnet.com (MUSCLE)
-4. The name of the author may not be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-Changes to this license can be made only by the copyright author with
-explicit written consent.
-
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
---- end of LICENSE ---
-
--------------------------------------------------------------------------------
-
-%% This notice is provided with respect to PorterStemmer v4, which may be
-included with JRE 8, JDK 8, and OpenJDK 8.
-
---- begin of LICENSE ---
-
-See: http://tartarus.org/~martin/PorterStemmer
-
-The software is completely free for any purpose, unless notes at the head of
-the program text indicates otherwise (which is rare). In any case, the notes
-about licensing are never more restrictive than the BSD License.
-
-In every case where the software is not written by me (Martin Porter), this
-licensing arrangement has been endorsed by the contributor, and it is
-therefore unnecessary to ask the contributor again to confirm it.
-
-I have not asked any contributors (or their employers, if they have them) for
-proofs that they have the right to distribute their software in this way.
-
---- end of LICENSE ---
-
--------------------------------------------------------------------------------
-
-%% This notice is provided with respect to Relax NG Object/Parser v.20050510,
-which may be included with JRE 8, JDK 8, and OpenJDK 8.
-
---- begin of LICENSE ---
-
-Copyright (c) Kohsuke Kawaguchi
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions: The above copyright
-notice and this permission notice shall be included in all copies or
-substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-
---- end of LICENSE ---
-
--------------------------------------------------------------------------------
-
-%% This notice is provided with respect to RelaxNGCC v1.12, which may be
-included with JRE 8, JDK 8, and OpenJDK 8.
-
---- begin of LICENSE ---
-
-Copyright (c) 2000-2003 Daisuke Okajima and Kohsuke Kawaguchi.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-1. Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
-2. Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
-3. The end-user documentation included with the redistribution, if any, must
- include the following acknowledgment:
-
- "This product includes software developed by Daisuke Okajima
- and Kohsuke Kawaguchi (http://relaxngcc.sf.net/)."
-
-Alternately, this acknowledgment may appear in the software itself, if and
-wherever such third-party acknowledgments normally appear.
-
-4. The names of the copyright holders must not be used to endorse or promote
- products derived from this software without prior written permission. For
- written permission, please contact the copyright holders.
-
-5. Products derived from this software may not be called "RELAXNGCC", nor may
- "RELAXNGCC" appear in their name, without prior written permission of the
- copyright holders.
-
-THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES,
-INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.IN NO EVENT SHALL THE APACHE
-SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
---- end of LICENSE ---
-
--------------------------------------------------------------------------------
-
-%% This notice is provided with respect to SAX 2.0.1, which may be included
-with JRE 8, JDK 8, and OpenJDK 8.
-
---- begin of LICENSE ---
-
- SAX is free!
-
- In fact, it's not possible to own a license to SAX, since it's been placed in
- the public domain.
-
- No Warranty
-
- Because SAX is released to the public domain, there is no warranty for the
- design or for the software implementation, to the extent permitted by
- applicable law. Except when otherwise stated in writing the copyright holders
- and/or other parties provide SAX "as is" without warranty of any kind, either
- expressed or implied, including, but not limited to, the implied warranties
- of merchantability and fitness for a particular purpose. The entire risk as
- to the quality and performance of SAX is with you. Should SAX prove
- defective, you assume the cost of all necessary servicing, repair or
- correction.
-
- In no event unless required by applicable law or agreed to in writing will
- any copyright holder, or any other party who may modify and/or redistribute
- SAX, be liable to you for damages, including any general, special, incidental
- or consequential damages arising out of the use or inability to use SAX
- (including but not limited to loss of data or data being rendered inaccurate
- or losses sustained by you or third parties or a failure of the SAX to
- operate with any other programs), even if such holder or other party has been
- advised of the possibility of such damages.
-
- Copyright Disclaimers
-
- This page includes statements to that effect by David Megginson, who would
- have been able to claim copyright for the original work. SAX 1.0
-
- Version 1.0 of the Simple API for XML (SAX), created collectively by the
- membership of the XML-DEV mailing list, is hereby released into the public
- domain.
-
- No one owns SAX: you may use it freely in both commercial and non-commercial
- applications, bundle it with your software distribution, include it on a
- CD-ROM, list the source code in a book, mirror the documentation at your own
- web site, or use it in any other way you see fit.
-
- David Megginson, sax@megginson.com
- 1998-05-11
-
- SAX 2.0
-
- I hereby abandon any property rights to SAX 2.0 (the Simple API for XML), and
- release all of the SAX 2.0 source code, compiled code, and documentation
- contained in this distribution into the Public Domain. SAX comes with NO
- WARRANTY or guarantee of fitness for any purpose.
-
- David Megginson, david@megginson.com
- 2000-05-05
-
---- end of LICENSE ---
-
--------------------------------------------------------------------------------
-
-%% This notice is provided with respect to SoftFloat version 2b, which may be
-included with JRE 8, JDK 8, and OpenJDK 8 on Linux/ARM.
-
---- begin of LICENSE ---
-
-Use of any of this software is governed by the terms of the license below:
-
-SoftFloat was written by me, John R. Hauser. This work was made possible in
-part by the International Computer Science Institute, located at Suite 600,
-1947 Center Street, Berkeley, California 94704. Funding was partially
-provided by the National Science Foundation under grant MIP-9311980. The
-original version of this code was written as part of a project to build
-a fixed-point vector processor in collaboration with the University of
-California at Berkeley, overseen by Profs. Nelson Morgan and John Wawrzynek.
-
-THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort
-has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT
-TIMES RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO
-PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ALL
-LOSSES, COSTS, OR OTHER PROBLEMS THEY INCUR DUE TO THE SOFTWARE, AND WHO
-FURTHERMORE EFFECTIVELY INDEMNIFY JOHN HAUSER AND THE INTERNATIONAL COMPUTER
-SCIENCE INSTITUTE (possibly via similar legal warning) AGAINST ALL LOSSES,
-COSTS, OR OTHER PROBLEMS INCURRED BY THEIR CUSTOMERS AND CLIENTS DUE TO THE
-SOFTWARE.
-
-Derivative works are acceptable, even for commercial purposes, provided
-that the minimal documentation requirements stated in the source code are
-satisfied.
-
---- end of LICENSE ---
-
--------------------------------------------------------------------------------
-
-%% This notice is provided with respect to Sparkle 1.5,
-which may be included with JRE 8 on Mac OS X.
-
---- begin of LICENSE ---
-
-Copyright (c) 2012 Sparkle.org and Andy Matuschak
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-
---- end of LICENSE ---
-
--------------------------------------------------------------------------------
-
-%% Portions licensed from Taligent, Inc.
-
--------------------------------------------------------------------------------
-
-%% This notice is provided with respect to Thai Dictionary, which may be
-included with JRE 8, JDK 8, and OpenJDK 8.
-
---- begin of LICENSE ---
-
-Copyright (C) 1982 The Royal Institute, Thai Royal Government.
-
-Copyright (C) 1998 National Electronics and Computer Technology Center,
-National Science and Technology Development Agency,
-Ministry of Science Technology and Environment,
-Thai Royal Government.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-
---- end of LICENSE ---
-
--------------------------------------------------------------------------------
-
-%% This notice is provided with respect to Unicode 6.2.0 & CLDR 21.0.1
-which may be included with JRE 8, JDK 8, and OpenJDK 8.
-
---- begin of LICENSE ---
-
-Unicode Terms of Use
-
-For the general privacy policy governing access to this site, see the Unicode
-Privacy Policy. For trademark usage, see the Unicode® Consortium Name and
-Trademark Usage Policy.
-
-A. Unicode Copyright.
- 1. Copyright © 1991-2013 Unicode, Inc. All rights reserved.
-
- 2. Certain documents and files on this website contain a legend indicating
- that "Modification is permitted." Any person is hereby authorized,
- without fee, to modify such documents and files to create derivative
- works conforming to the Unicode® Standard, subject to Terms and
- Conditions herein.
-
- 3. Any person is hereby authorized, without fee, to view, use, reproduce,
- and distribute all documents and files solely for informational
- purposes in the creation of products supporting the Unicode Standard,
- subject to the Terms and Conditions herein.
-
- 4. Further specifications of rights and restrictions pertaining to the use
- of the particular set of data files known as the "Unicode Character
- Database" can be found in Exhibit 1.
-
- 5. Each version of the Unicode Standard has further specifications of
- rights and restrictions of use. For the book editions (Unicode 5.0 and
- earlier), these are found on the back of the title page. The online
- code charts carry specific restrictions. All other files, including
- online documentation of the core specification for Unicode 6.0 and
- later, are covered under these general Terms of Use.
-
- 6. No license is granted to "mirror" the Unicode website where a fee is
- charged for access to the "mirror" site.
-
- 7. Modification is not permitted with respect to this document. All copies
- of this document must be verbatim.
-
-B. Restricted Rights Legend. Any technical data or software which is licensed
- to the United States of America, its agencies and/or instrumentalities
- under this Agreement is commercial technical data or commercial computer
- software developed exclusively at private expense as defined in FAR 2.101,
- or DFARS 252.227-7014 (June 1995), as applicable. For technical data, use,
- duplication, or disclosure by the Government is subject to restrictions as
- set forth in DFARS 202.227-7015 Technical Data, Commercial and Items (Nov
- 1995) and this Agreement. For Software, in accordance with FAR 12-212 or
- DFARS 227-7202, as applicable, use, duplication or disclosure by the
- Government is subject to the restrictions set forth in this Agreement.
-
-C. Warranties and Disclaimers.
- 1. This publication and/or website may include technical or typographical
- errors or other inaccuracies . Changes are periodically added to the
- information herein; these changes will be incorporated in new editions
- of the publication and/or website. Unicode may make improvements and/or
- changes in the product(s) and/or program(s) described in this
- publication and/or website at any time.
-
- 2. If this file has been purchased on magnetic or optical media from
- Unicode, Inc. the sole and exclusive remedy for any claim will be
- exchange of the defective media within ninety (90) days of original
- purchase.
-
- 3. EXCEPT AS PROVIDED IN SECTION C.2, THIS PUBLICATION AND/OR SOFTWARE IS
- PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND EITHER EXPRESS, IMPLIED,
- OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
- UNICODE AND ITS LICENSORS ASSUME NO RESPONSIBILITY FOR ERRORS OR
- OMISSIONS IN THIS PUBLICATION AND/OR SOFTWARE OR OTHER DOCUMENTS WHICH
- ARE REFERENCED BY OR LINKED TO THIS PUBLICATION OR THE UNICODE WEBSITE.
-
-D. Waiver of Damages. In no event shall Unicode or its licensors be liable for
- any special, incidental, indirect or consequential damages of any kind, or
- any damages whatsoever, whether or not Unicode was advised of the
- possibility of the damage, including, without limitation, those resulting
- from the following: loss of use, data or profits, in connection with the
- use, modification or distribution of this information or its derivatives.
-
-E.Trademarks & Logos.
- 1. The Unicode Word Mark and the Unicode Logo are trademarks of Unicode,
- Inc. “The Unicode Consortium†and “Unicode, Inc.†are trade names of
- Unicode, Inc. Use of the information and materials found on this
- website indicates your acknowledgement of Unicode, Inc.’s exclusive
- worldwide rights in the Unicode Word Mark, the Unicode Logo, and the
- Unicode trade names.
-
- 2. The Unicode Consortium Name and Trademark Usage Policy (“Trademark
- Policyâ€) are incorporated herein by reference and you agree to abide by
- the provisions of the Trademark Policy, which may be changed from time
- to time in the sole discretion of Unicode, Inc.
-
- 3. All third party trademarks referenced herein are the property of their
- respective owners.
-
-Miscellaneous.
- 1. Jurisdiction and Venue. This server is operated from a location in the
- State of California, United States of America. Unicode makes no
- representation that the materials are appropriate for use in other
- locations. If you access this server from other locations, you are
- responsible for compliance with local laws. This Agreement, all use of
- this site and any claims and damages resulting from use of this site are
- governed solely by the laws of the State of California without regard to
- any principles which would apply the laws of a different jurisdiction.
- The user agrees that any disputes regarding this site shall be resolved
- solely in the courts located in Santa Clara County, California. The user
- agrees said courts have personal jurisdiction and agree to waive any
- right to transfer the dispute to any other forum.
-
- 2. Modification by Unicode. Unicode shall have the right to modify this
- Agreement at any time by posting it to this site. The user may not
- assign any part of this Agreement without Unicode’s prior written
- consent.
-
- 3. Taxes. The user agrees to pay any taxes arising from access to this
- website or use of the information herein, except for those based on
- Unicode’s net income.
-
- 4. Severability. If any provision of this Agreement is declared invalid or
- unenforceable, the remaining provisions of this Agreement shall remain
- in effect.
-
- 5. Entire Agreement. This Agreement constitutes the entire agreement
- between the parties.
-
-EXHIBIT 1
-UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE
-
-Unicode Data Files include all data files under the directories
-http://www.unicode.org/Public/, http://www.unicode.org/reports/, and
-http://www.unicode.org/cldr/data/. Unicode Data Files do not include PDF
-online code charts under the directory http://www.unicode.org/Public/.
-Software includes any source code published in the Unicode Standard or under
-the directories http://www.unicode.org/Public/,
-http://www.unicode.org/reports/, and http://www.unicode.org/cldr/data/.
-
-NOTICE TO USER: Carefully read the following legal agreement. BY DOWNLOADING,
-INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S DATA FILES ("DATA
-FILES"), AND/OR SOFTWARE ("SOFTWARE"), YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO
-BE BOUND BY, ALL OF THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT
-AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR
-SOFTWARE.
-
-COPYRIGHT AND PERMISSION NOTICE
-
-Copyright © 1991-2012 Unicode, Inc. All rights reserved. Distributed under the
-Terms of Use in http://www.unicode.org/copyright.html.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of the Unicode data files and any associated documentation (the "Data Files")
-or Unicode software and any associated documentation (the "Software") to deal
-in the Data Files or Software without restriction, including without
-limitation the rights to use, copy, modify, merge, publish, distribute, and/or
-sell copies of the Data Files or Software, and to permit persons to whom the
-Data Files or Software are furnished to do so, provided that (a) the above
-copyright notice(s) and this permission notice appear with all copies of the
-Data Files or Software, (b) both the above copyright notice(s) and this
-permission notice appear in associated documentation, and (c) there is clear
-notice in each modified Data File or in the Software as well as in the
-documentation associated with the Data File(s) or Software that the data or
-software has been modified.
-
-THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
-KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD
-PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN
-THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
-DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
-PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE
-DATA FILES OR SOFTWARE.
-
-Except as contained in this notice, the name of a copyright holder shall not
-be used in advertising or otherwise to promote the sale, use or other dealings
-in these Data Files or Software without prior written authorization of the
-copyright holder.
-
-Unicode and the Unicode logo are trademarks of Unicode, Inc. in the United
-States and other countries. All third party trademarks referenced herein are
-the property of their respective owners.
-
---- end of LICENSE ---
-
--------------------------------------------------------------------------------
-
-%% This notice is provided with respect to UPX v3.01, which may be included
-with JRE 8 on Windows.
-
---- begin of LICENSE ---
-
-Use of any of this software is governed by the terms of the license below:
-
-
- ooooo ooo ooooooooo. ooooooo ooooo
- `888' `8' `888 `Y88. `8888 d8'
- 888 8 888 .d88' Y888..8P
- 888 8 888ooo88P' `8888'
- 888 8 888 .8PY888.
- `88. .8' 888 d8' `888b
- `YbodP' o888o o888o o88888o
-
-
- The Ultimate Packer for eXecutables
- Copyright (c) 1996-2000 Markus Oberhumer & Laszlo Molnar
- http://wildsau.idv.uni-linz.ac.at/mfx/upx.html
- http://www.nexus.hu/upx
- http://upx.tsx.org
-
-
-PLEASE CAREFULLY READ THIS LICENSE AGREEMENT, ESPECIALLY IF YOU PLAN
-TO MODIFY THE UPX SOURCE CODE OR USE A MODIFIED UPX VERSION.
-
-
-ABSTRACT
-========
-
- UPX and UCL are copyrighted software distributed under the terms
- of the GNU General Public License (hereinafter the "GPL").
-
- The stub which is imbedded in each UPX compressed program is part
- of UPX and UCL, and contains code that is under our copyright. The
- terms of the GNU General Public License still apply as compressing
- a program is a special form of linking with our stub.
-
- As a special exception we grant the free usage of UPX for all
- executables, including commercial programs.
- See below for details and restrictions.
-
-
-COPYRIGHT
-=========
-
- UPX and UCL are copyrighted software. All rights remain with the authors.
-
- UPX is Copyright (C) 1996-2000 Markus Franz Xaver Johannes Oberhumer
- UPX is Copyright (C) 1996-2000 Laszlo Molnar
-
- UCL is Copyright (C) 1996-2000 Markus Franz Xaver Johannes Oberhumer
-
-
-GNU GENERAL PUBLIC LICENSE
-==========================
-
- UPX and the UCL library are free software; you can redistribute them
- and/or modify them under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2 of
- the License, or (at your option) any later version.
-
- UPX and UCL are distributed in the hope that they will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; see the file COPYING.
-
-
-SPECIAL EXCEPTION FOR COMPRESSED EXECUTABLES
-============================================
-
- The stub which is imbedded in each UPX compressed program is part
- of UPX and UCL, and contains code that is under our copyright. The
- terms of the GNU General Public License still apply as compressing
- a program is a special form of linking with our stub.
-
- Hereby Markus F.X.J. Oberhumer and Laszlo Molnar grant you special
- permission to freely use and distribute all UPX compressed programs
- (including commercial ones), subject to the following restrictions:
-
- 1. You must compress your program with a completely unmodified UPX
- version; either with our precompiled version, or (at your option)
- with a self compiled version of the unmodified UPX sources as
- distributed by us.
- 2. This also implies that the UPX stub must be completely unmodfied, i.e.
- the stub imbedded in your compressed program must be byte-identical
- to the stub that is produced by the official unmodified UPX version.
- 3. The decompressor and any other code from the stub must exclusively get
- used by the unmodified UPX stub for decompressing your program at
- program startup. No portion of the stub may get read, copied,
- called or otherwise get used or accessed by your program.
-
-
-ANNOTATIONS
-===========
-
- - You can use a modified UPX version or modified UPX stub only for
- programs that are compatible with the GNU General Public License.
-
- - We grant you special permission to freely use and distribute all UPX
- compressed programs. But any modification of the UPX stub (such as,
- but not limited to, removing our copyright string or making your
- program non-decompressible) will immediately revoke your right to
- use and distribute a UPX compressed program.
-
- - UPX is not a software protection tool; by requiring that you use
- the unmodified UPX version for your proprietary programs we
- make sure that any user can decompress your program. This protects
- both you and your users as nobody can hide malicious code -
- any program that cannot be decompressed is highly suspicious
- by definition.
-
- - You can integrate all or part of UPX and UCL into projects that
- are compatible with the GNU GPL, but obviously you cannot grant
- any special exceptions beyond the GPL for our code in your project.
-
- - We want to actively support manufacturers of virus scanners and
- similar security software. Please contact us if you would like to
- incorporate parts of UPX or UCL into such a product.
-
-
-
-Markus F.X.J. Oberhumer Laszlo Molnar
-markus.oberhumer@jk.uni-linz.ac.at ml1050@cdata.tvnet.hu
-
-Linz, Austria, 25 Feb 2000
-
-Additional License(s)
-
-The UPX license file is at http://upx.sourceforge.net/upx-license.html.
-
---- end of LICENSE ---
-
--------------------------------------------------------------------------------
-
-%% This notice is provided with respect to Xfree86-VidMode Extension 1.0,
-which may be included with JRE 8, JDK 8, and OpenJDK 8 on Linux and Solaris.
-
---- begin of LICENSE ---
-
-Version 1.1 of XFree86 ProjectLicence.
-
-Copyright (C) 1994-2004 The XFree86 Project, Inc. All rights reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicence, and/or sell
-copies of the Software, and to permit persons to whom the Software is furnished
-to do so,subject to the following conditions:
-
- 1. Redistributions of source code must retain the above copyright
- notice,this list of conditions, and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution, and in the same place
- and form as other copyright, license and disclaimer information.
-
- 3. The end-user documentation included with the redistribution, if any,must
- include the following acknowledgment: "This product includes
- software developed by The XFree86 Project, Inc (http://www.xfree86.org/) and
- its contributors", in the same place and form as other third-party
- acknowledgments. Alternately, this acknowledgment may appear in the software
- itself, in the same form and location as other such third-party
- acknowledgments.
-
- 4. Except as contained in this notice, the name of The XFree86 Project,Inc
- shall not be used in advertising or otherwise to promote the sale, use
- or other dealings in this Software without prior written authorization from
- The XFree86 Project, Inc.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- WARRANTIES,INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
- EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL,SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO,PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
- DAMAGE.
-
---- end of LICENSE ---
-
--------------------------------------------------------------------------------
-
-%% This notice is provided with respect to X Window System 6.8.2, which may be
-included with JRE 8, JDK 8, and OpenJDK 8 on Linux and Solaris.
-
---- begin of LICENSE ---
-
- Licenses
-The X.Org Foundation March 2004
-
-1. Introduction
-
-The X.org Foundation X Window System distribution is a compilation of code and
-documentation from many sources. This document is intended primarily as a
-guide to the licenses used in the distribution: you must check each file
-and/or package for precise redistribution terms. None-the-less, this summary
-may be useful to many users. No software incorporating the XFree86 1.1 license
-has been incorporated.
-
-This document is based on the compilation from XFree86.
-
-2. XFree86 License
-
-XFree86 code without an explicit copyright is covered by the following
-copyright/license:
-
-Copyright (C) 1994-2003 The XFree86 Project, Inc. All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the XFree86 Project shall not
-be used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the XFree86 Project.
-
-3. Other Licenses
-
-Portions of code are covered by the following licenses/copyrights. See
-individual files for the copyright dates.
-
-3.1. X/MIT Copyrights
-
-3.1.1. X Consortium
-
-Copyright (C) <date> X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE X
-CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
-ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings in
-this Software without prior written authorization from the X Consortium.
-
-X Window System is a trademark of X Consortium, Inc.
-
-3.1.2. The Open Group
-
-Copyright <date> The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that the
-above copyright notice appear in all copies and that both that copyright
-notice and this permission notice appear in supporting documentation.
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
-ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings in
-this Software without prior written authorization from The Open Group. 3.2.
-Berkeley-based copyrights:
-
-o
-3.2.1. General
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- 3. The name of the author may not be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
-EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
-IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE. 3.2.2. UCB/LBL
-
-Copyright (c) 1993 The Regents of the University of California. All rights
-reserved.
-
-This software was developed by the Computer Systems Engineering group at
-Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and contributed to
-Berkeley.
-
-All advertising materials mentioning features or use of this software must
-display the following acknowledgement: This product includes software
-developed by the University of California, Lawrence Berkeley Laboratory.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- 3. All advertising materials mentioning features or use of this software
- must display the following acknowledgement: This product includes software
- developed by the University of California, Berkeley and its contributors.
-
- 4. Neither the name of the University nor the names of its contributors may
- be used to endorse or promote products derived from this software without
- specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
-EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 3.2.3. The
-NetBSD Foundation, Inc.
-
-Copyright (c) 2003 The NetBSD Foundation, Inc. All rights reserved.
-
-This code is derived from software contributed to The NetBSD Foundation by Ben
-Collver <collver1@attbi.com>
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- 3. All advertising materials mentioning features or use of this software
- must display the following acknowledgement: This product includes software
- developed by the NetBSD Foundation, Inc. and its contributors.
-
- 4. Neither the name of The NetBSD Foundation nor the names of its
- contributors may be used to endorse or promote products derived from this
- software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS ``AS
-IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 3.2.4. Theodore
-Ts'o.
-
-Copyright Theodore Ts'o, 1994, 1995, 1996, 1997, 1998, 1999. All rights
-reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- and the entire permission notice in its entirety, including the disclaimer
- of warranties.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- 3. he name of the author may not be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
-INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE, ALL OF WHICH ARE HEREBY DISCLAIMED. IN NO
-EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
-IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE. 3.2.5. Theo de Raadt and Damien Miller
-
-Copyright (c) 1995,1999 Theo de Raadt. All rights reserved. Copyright (c)
-2001-2002 Damien Miller. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
-EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
-IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE. 3.2.6. Todd C. Miller
-
-Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
-
-Permission to use, copy, modify, and distribute this software for any purpose
-with or without fee is hereby granted, provided that the above copyright
-notice and this permission notice appear in all copies.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND TODD C. MILLER DISCLAIMS ALL WARRANTIES
-WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL TODD C. MILLER BE LIABLE FOR
-ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
-OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
-CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 3.2.7. Thomas
-Winischhofer
-
-Copyright (C) 2001-2004 Thomas Winischhofer
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- 3. The name of the author may not be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESSED OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
-EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
-IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE. 3.3. NVIDIA Corp
-
-Copyright (c) 1996 NVIDIA, Corp. All rights reserved.
-
-NOTICE TO USER: The source code is copyrighted under U.S. and international
-laws. NVIDIA, Corp. of Sunnyvale, California owns the copyright and as design
-patents pending on the design and interface of the NV chips. Users and
-possessors of this source code are hereby granted a nonexclusive, royalty-free
-copyright and design patent license to use this code in individual and
-commercial software.
-
-Any use of this source code must include, in the user documentation and
-internal comments to the code, notices to the end user as follows:
-
-Copyright (c) 1996 NVIDIA, Corp. NVIDIA design patents pending in the U.S. and
-foreign countries.
-
-NVIDIA, CORP. MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE
-CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED
-WARRANTY OF ANY KIND. NVIDIA, CORP. DISCLAIMS ALL WARRANTIES WITH REGARD TO
-THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA, CORP. BE LIABLE
-FOR ANY SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
-DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
-CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE CODE. 3.4. GLX Public
-License
-
-GLX PUBLIC LICENSE (Version 1.0 (2/11/99)) ("License")
-
-Subject to any third party claims, Silicon Graphics, Inc. ("SGI") hereby
-grants permission to Recipient (defined below), under Recipient's copyrights
-in the Original Software (defined below), to use, copy, modify, merge,
-publish, distribute, sublicense and/or sell copies of Subject Software
-(defined below), and to permit persons to whom the Subject Software is
-furnished in accordance with this License to do the same, subject to all of
-the following terms and conditions, which Recipient accepts by engaging in any
-such use, copying, modifying, merging, publishing, distributing, sublicensing
-or selling:
-
-1. Definitions.
-
- (a) "Original Software" means source code of computer software code which
- is described in Exhibit A as Original Software.
-
- (b) "Modifications" means any addition to or deletion from the substance
- or structure of either the Original Software or any previous
- Modifications. When Subject Software is released as a series of files, a
- Modification means (i) any addition to or deletion from the contents of a
- file containing Original Software or previous Modifications and (ii) any
- new file that contains any part of the Original Code or previous
- Modifications.
-
- (c) "Subject Software" means the Original Software or Modifications or the
- combination of the Original Software and Modifications, or portions of any
- of the foregoing.
-
- (d) "Recipient" means an individual or a legal entity exercising rights
- under, and complying with all of the terms of, this License. For legal
- entities, "Recipient" includes any entity which controls, is controlled
- by, or is under common control with Recipient. For purposes of this
- definition, "control" of an entity means (a) the power, direct or
- indirect, to direct or manage such entity, or (b) ownership of fifty
- percent (50%) or more of the outstanding shares or beneficial ownership of
- such entity.
-
-2. Redistribution of Source Code Subject to These Terms. Redistributions of
-Subject Software in source code form must retain the notice set forth in
-Exhibit A, below, in every file. A copy of this License must be included in
-any documentation for such Subject Software where the recipients' rights
-relating to Subject Software are described. Recipient may distribute the
-source code version of Subject Software under a license of Recipient's choice,
-which may contain terms different from this License, provided that (i)
-Recipient is in compliance with the terms of this License, and (ii) the
-license terms include this Section 2 and Sections 3, 4, 7, 8, 10, 12 and 13 of
-this License, which terms may not be modified or superseded by any other terms
-of such license. If Recipient distributes the source code version under a
-different license Recipient must make it absolutely clear that any terms which
-differ from this License are offered by Recipient alone, not by SGI. Recipient
-hereby agrees to indemnify SGI for any liability incurred by SGI as a result
-of any such terms Recipient offers.
-
-3. Redistribution in Executable Form. The notice set forth in Exhibit A must
-be conspicuously included in any notice in an executable version of Subject
-Software, related documentation or collateral in which Recipient describes the
-user's rights relating to the Subject Software. Recipient may distribute the
-executable version of Subject Software under a license of Recipient's choice,
-which may contain terms different from this License, provided that (i)
-Recipient is in compliance with the terms of this License, and (ii) the
-license terms include this Section 3 and Sections 4, 7, 8, 10, 12 and 13 of
-this License, which terms may not be modified or superseded by any other terms
-of such license. If Recipient distributes the executable version under a
-different license Recipient must make it absolutely clear that any terms which
-differ from this License are offered by Recipient alone, not by SGI. Recipient
-hereby agrees to indemnify SGI for any liability incurred by SGI as a result
-of any such terms Recipient offers.
-
-4. Termination. This License and the rights granted hereunder will terminate
-automatically if Recipient fails to comply with terms herein and fails to cure
-such breach within 30 days of the breach. Any sublicense to the Subject
-Software which is properly granted shall survive any termination of this
-License absent termination by the terms of such sublicense. Provisions which,
-by their nature, must remain in effect beyond the termination of this License
-shall survive.
-
-5. No Trademark Rights. This License does not grant any rights to use any
-trade name, trademark or service mark whatsoever. No trade name, trademark or
-service mark of SGI may be used to endorse or promote products derived from
-the Subject Software without prior written permission of SGI.
-
-6. No Other Rights. This License does not grant any rights with respect to the
-OpenGL API or to any software or hardware implementation thereof or to any
-other software whatsoever, nor shall any other rights or licenses not
-expressly granted hereunder arise by implication, estoppel or otherwise with
-respect to the Subject Software. Title to and ownership of the Original
-Software at all times remains with SGI. All rights in the Original Software
-not expressly granted under this License are reserved.
-
-7. Compliance with Laws; Non-Infringement. Recipient shall comply with all
-applicable laws and regulations in connection with use and distribution of the
-Subject Software, including but not limited to, all export and import control
-laws and regulations of the U.S. government and other countries. Recipient may
-not distribute Subject Software that (i) in any way infringes (directly or
-contributorily) the rights (including patent, copyright, trade secret,
-trademark or other intellectual property rights of any kind) of any other
-person or entity or (ii) breaches any representation or warranty, express,
-implied or statutory, which under any applicable law it might be deemed to
-have been distributed.
-
-8. Claims of Infringement. If Recipient at any time has knowledge of any one
-or more third party claims that reproduction, modification, use, distribution,
-import or sale of Subject Software (including particular functionality or code
-incorporated in Subject Software) infringes the third party's intellectual
-property rights, Recipient must place in a well-identified web page bearing
-the title "LEGAL" a description of each such claim and a description of the
-party making each such claim in sufficient detail that a user of the Subject
-Software will know whom to contact regarding the claim. Also, upon gaining
-such knowledge of any such claim, Recipient must conspicuously include the URL
-for such web page in the Exhibit A notice required under Sections 2 and 3,
-above, and in the text of any related documentation, license agreement or
-collateral in which Recipient describes end user's rights relating to the
-Subject Software. If Recipient obtains such knowledge after it makes Subject
-Software available to any other person or entity, Recipient shall take other
-steps (such as notifying appropriate mailing lists or newsgroups) reasonably
-calculated to inform those who received the Subject Software that new
-knowledge has been obtained.
-
-9. DISCLAIMER OF WARRANTY. SUBJECT SOFTWARE IS PROVIDED ON AN "AS IS" BASIS,
-WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT
-LIMITATION, WARRANTIES THAT THE SUBJECT SOFTWARE IS FREE OF DEFECTS,
-MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON- INFRINGING. SGI ASSUMES NO
-RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE. SHOULD ANY SOFTWARE
-PROVE DEFECTIVE IN ANY RESPECT, SGI ASSUMES NO COST OR LIABILITY FOR ANY
-SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN
-ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY SUBJECT SOFTWARE IS AUTHORIZED
-HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
-
-10. LIMITATION OF LIABILITY. UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY,
-WHETHER TORT (INCLUDING, WITHOUT LIMITATION, NEGLIGENCE OR STRICT LIABILITY),
-CONTRACT, OR OTHERWISE, SHALL SGI OR ANY SGI LICENSOR BE LIABLE FOR ANY
-DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
-CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK
-STOPPAGE, LOSS OF DATA, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
-COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF
-THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY
-TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SGI's NEGLIGENCE TO
-THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT
-ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
-THAT EXCLUSION AND LIMITATION MAY NOT APPLY TO RECIPIENT.
-
-11. Indemnity. Recipient shall be solely responsible for damages arising,
-directly or indirectly, out of its utilization of rights under this License.
-Recipient will defend, indemnify and hold harmless Silicon Graphics, Inc. from
-and against any loss, liability, damages, costs or expenses (including the
-payment of reasonable attorneys fees) arising out of Recipient's use,
-modification, reproduction and distribution of the Subject Software or out of
-any representation or warranty made by Recipient.
-
-12. U.S. Government End Users. The Subject Software is a "commercial item"
-consisting of "commercial computer software" as such terms are defined in
-title 48 of the Code of Federal Regulations and all U.S. Government End Users
-acquire only the rights set forth in this License and are subject to the terms
-of this License.
-
-13. Miscellaneous. This License represents the complete agreement concerning
-subject matter hereof. If any provision of this License is held to be
-unenforceable, such provision shall be reformed so as to achieve as nearly as
-possible the same economic effect as the original provision and the remainder
-of this License will remain in effect. This License shall be governed by and
-construed in accordance with the laws of the United States and the State of
-California as applied to agreements entered into and to be performed entirely
-within California between California residents. Any litigation relating to
-this License shall be subject to the exclusive jurisdiction of the Federal
-Courts of the Northern District of California (or, absent subject matter
-jurisdiction in such courts, the courts of the State of California), with
-venue lying exclusively in Santa Clara County, California, with the losing
-party responsible for costs, including without limitation, court costs and
-reasonable attorneys fees and expenses. The application of the United Nations
-Convention on Contracts for the International Sale of Goods is expressly
-excluded. Any law or regulation which provides that the language of a contract
-shall be construed against the drafter shall not apply to this License.
-
-Exhibit A
-
-The contents of this file are subject to Sections 2, 3, 4, 7, 8, 10, 12 and 13
-of the GLX Public License Version 1.0 (the "License"). You may not use this
-file except in compliance with those sections of the License. You may obtain a
-copy of the License at Silicon Graphics, Inc., attn: Legal Services, 2011 N.
-Shoreline Blvd., Mountain View, CA 94043 or at
-http://www.sgi.com/software/opensource/glx/license.html.
-
-Software distributed under the License is distributed on an "AS IS" basis. ALL
-WARRANTIES ARE DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED
-WARRANTIES OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR PURPOSE OR OF NON-
-INFRINGEMENT. See the License for the specific language governing rights and
-limitations under the License.
-
-The Original Software is GLX version 1.2 source code, released February, 1999.
-The developer of the Original Software is Silicon Graphics, Inc. Those
-portions of the Subject Software created by Silicon Graphics, Inc. are
-Copyright (c) 1991-9 Silicon Graphics, Inc. All Rights Reserved. 3.5. CID
-Font Code Public License
-
-CID FONT CODE PUBLIC LICENSE (Version 1.0 (3/31/99))("License")
-
-Subject to any applicable third party claims, Silicon Graphics, Inc. ("SGI")
-hereby grants permission to Recipient (defined below), under SGI's copyrights
-in the Original Software (defined below), to use, copy, modify, merge,
-publish, distribute, sublicense and/or sell copies of Subject Software
-(defined below) in both source code and executable form, and to permit persons
-to whom the Subject Software is furnished in accordance with this License to
-do the same, subject to all of the following terms and conditions, which
-Recipient accepts by engaging in any such use, copying, modifying, merging,
-publication, distributing, sublicensing or selling:
-
-1. Definitions.
-
- a. "Original Software" means source code of computer software code that is
- described in Exhibit A as Original Software.
-
- b. "Modifications" means any addition to or deletion from the substance or
- structure of either the Original Software or any previous Modifications.
- When Subject Software is released as a series of files, a Modification
- means (i) any addition to or deletion from the contents of a file
- containing Original Software or previous Modifications and (ii) any new
- file that contains any part of the Original Code or previous
- Modifications.
-
- c. "Subject Software" means the Original Software or Modifications or the
- combination of the Original Software and Modifications, or portions of any
- of the foregoing.
-
- d. "Recipient" means an individual or a legal entity exercising rights
- under the terms of this License. For legal entities, "Recipient" includes
- any entity that controls, is controlled by, or is under common control
- with Recipient. For purposes of this definition, "control" of an entity
- means (i) the power, direct or indirect, to direct or manage such entity,
- or (ii) ownership of fifty percent (50%) or more of the outstanding shares
- or beneficial ownership of such entity.
-
- e. "Required Notice" means the notice set forth in Exhibit A to this
- License.
-
- f. "Accompanying Technology" means any software or other technology that
- is not a Modification and that is distributed or made publicly available
- by Recipient with the Subject Software. Separate software files that do
- not contain any Original Software or any previous Modification shall not
- be deemed a Modification, even if such software files are aggregated as
- part of a product, or in any medium of storage, with any file that does
- contain Original Software or any previous Modification.
-
-2. License Terms. All distribution of the Subject Software must be made
-subject to the terms of this License. A copy of this License and the Required
-Notice must be included in any documentation for Subject Software where
-Recipient's rights relating to Subject Software and/or any Accompanying
-Technology are described. Distributions of Subject Software in source code
-form must also include the Required Notice in every file distributed. In
-addition, a ReadMe file entitled "Important Legal Notice" must be distributed
-with each distribution of one or more files that incorporate Subject Software.
-That file must be included with distributions made in both source code and
-executable form. A copy of the License and the Required Notice must be
-included in that file. Recipient may distribute Accompanying Technology under
-a license of Recipient's choice, which may contain terms different from this
-License, provided that (i) Recipient is in compliance with the terms of this
-License, (ii) such other license terms do not modify or supersede the terms of
-this License as applicable to the Subject Software, (iii) Recipient hereby
-indemnifies SGI for any liability incurred by SGI as a result of the
-distribution of Accompanying Technology or the use of other license terms.
-
-3. Termination. This License and the rights granted hereunder will terminate
-automatically if Recipient fails to comply with terms herein and fails to cure
-such breach within 30 days of the breach. Any sublicense to the Subject
-Software that is properly granted shall survive any termination of this
-License absent termination by the terms of such sublicense. Provisions which,
-by their nature, must remain in effect beyond the termination of this License
-shall survive.
-
-4. Trademark Rights. This License does not grant any rights to use any trade
-name, trademark or service mark whatsoever. No trade name, trademark or
-service mark of SGI may be used to endorse or promote products derived from or
-incorporating any Subject Software without prior written permission of SGI.
-
-5. No Other Rights. No rights or licenses not expressly granted hereunder
-shall arise by implication, estoppel or otherwise. Title to and ownership of
-the Original Software at all times remains with SGI. All rights in the
-Original Software not expressly granted under this License are reserved.
-
-6. Compliance with Laws; Non-Infringement. Recipient shall comply with all
-applicable laws and regulations in connection with use and distribution of the
-Subject Software, including but not limited to, all export and import control
-laws and regulations of the U.S. government and other countries. Recipient may
-not distribute Subject Software that (i) in any way infringes (directly or
-contributorily) the rights (including patent, copyright, trade secret,
-trademark or other intellectual property rights of any kind) of any other
-person or entity, or (ii) breaches any representation or warranty, express,
-implied or statutory, which under any applicable law it might be deemed to
-have been distributed.
-
-7. Claims of Infringement. If Recipient at any time has knowledge of any one
-or more third party claims that reproduction, modification, use, distribution,
-import or sale of Subject Software (including particular functionality or code
-incorporated in Subject Software) infringes the third party's intellectual
-property rights, Recipient must place in a well-identified web page bearing
-the title "LEGAL" a description of each such claim and a description of the
-party making each such claim in sufficient detail that a user of the Subject
-Software will know whom to contact regarding the claim. Also, upon gaining
-such knowledge of any such claim, Recipient must conspicuously include the URL
-for such web page in the Required Notice, and in the text of any related
-documentation, license agreement or collateral in which Recipient describes
-end user's rights relating to the Subject Software. If Recipient obtains such
-knowledge after it makes Subject Software available to any other person or
-entity, Recipient shall take other steps (such as notifying appropriate
-mailing lists or newsgroups) reasonably calculated to provide such knowledge
-to those who received the Subject Software.
-
-8. DISCLAIMER OF WARRANTY. SUBJECT SOFTWARE IS PROVIDED ON AN "AS IS" BASIS,
-WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT
-LIMITATION, WARRANTIES THAT THE SUBJECT SOFTWARE IS FREE OF DEFECTS,
-MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. SGI ASSUMES NO
-RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE. SHOULD ANY SOFTWARE
-PROVE DEFECTIVE IN ANY RESPECT, SGI ASSUMES NO COST OR LIABILITY FOR ANY
-SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN
-ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY SUBJECT SOFTWARE IS AUTHORIZED
-HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
-
-9. LIMITATION OF LIABILITY. UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY,
-WHETHER TORT (INCLUDING, WITHOUT LIMITATION, NEGLIGENCE OR STRICT LIABILITY),
-CONTRACT, OR OTHERWISE, SHALL SGI OR ANY SGI LICENSOR BE LIABLE FOR ANY CLAIM,
-DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SUBJECT SOFTWARE OR
-THE USE OR OTHER DEALINGS IN THE SUBJECT SOFTWARE. SOME JURISDICTIONS DO NOT
-ALLOW THE EXCLUSION OR LIMITATION OF CERTAIN DAMAGES, SO THIS EXCLUSION AND
-LIMITATION MAY NOT APPLY TO RECIPIENT TO THE EXTENT SO DISALLOWED.
-
-10. Indemnity. Recipient shall be solely responsible for damages arising,
-directly or indirectly, out of its utilization of rights under this License.
-Recipient will defend, indemnify and hold SGI and its successors and assigns
-harmless from and against any loss, liability, damages, costs or expenses
-(including the payment of reasonable attorneys fees) arising out of
-(Recipient's use, modification, reproduction and distribution of the Subject
-Software or out of any representation or warranty made by Recipient.
-
-11. U.S. Government End Users. The Subject Software is a "commercial item"
-consisting of "commercial computer software" as such terms are defined in
-title 48 of the Code of Federal Regulations and all U.S. Government End Users
-acquire only the rights set forth in this License and are subject to the terms
-of this License.
-
-12. Miscellaneous. This License represents the complete agreement concerning
-subject matter hereof. If any provision of this License is held to be
-unenforceable by any judicial or administrative authority having proper
-jurisdiction with respect thereto, such provision shall be reformed so as to
-achieve as nearly as possible the same economic effect as the original
-provision and the remainder of this License will remain in effect. This
-License shall be governed by and construed in accordance with the laws of the
-United States and the State of California as applied to agreements entered
-into and to be performed entirely within California between California
-residents. Any litigation relating to this License shall be subject to the
-exclusive jurisdiction of the Federal Courts of the Northern District of
-California (or, absent subject matter jurisdiction in such courts, the courts
-of the State of California), with venue lying exclusively in Santa Clara
-County, California, with the losing party responsible for costs, including
-without limitation, court costs and reasonable attorneys fees and expenses.
-The application of the United Nations Convention on Contracts for the
-International Sale of Goods is expressly excluded. Any law or regulation that
-provides that the language of a contract shall be construed against the
-drafter shall not apply to this License.
-
-Exhibit A
-
-Copyright (c) 1994-1999 Silicon Graphics, Inc.
-
-The contents of this file are subject to the CID Font Code Public License
-Version 1.0 (the "License"). You may not use this file except in compliance
-with the License. You may obtain a copy of the License at Silicon Graphics,
-Inc., attn: Legal Services, 2011 N. Shoreline Blvd., Mountain View, CA 94043
-or at http://www.sgi.com/software/opensource/cid/license.html
-
-Software distributed under the License is distributed on an "AS IS" basis. ALL
-WARRANTIES ARE DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED
-WARRANTIES OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR PURPOSE OR OF
-NON-INFRINGEMENT. See the License for the specific language governing rights
-and limitations under the License.
-
-The Original Software (as defined in the License) is CID font code that was
-developed by Silicon Graphics, Inc. Those portions of the Subject Software (as
-defined in the License) that were created by Silicon Graphics, Inc. are
-Copyright (c) 1994-1999 Silicon Graphics, Inc. All Rights Reserved.
-
-[NOTE: When using this text in connection with Subject Software delivered
-solely in object code form, Recipient may replace the words "this file" with
-"this software" in both the first and second sentences.] 3.6. Bitstream Vera
-Fonts Copyright
-
-The fonts have a generous copyright, allowing derivative works (as long as
-"Bitstream" or "Vera" are not in the names), and full redistribution (so long
-as they are not *sold* by themselves). They can be be bundled, redistributed
-and sold with any software.
-
-The fonts are distributed under the following copyright:
-
-Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is a
-trademark of Bitstream, Inc.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of the fonts accompanying this license ("Fonts") and associated documentation
-files (the "Font Software"), to reproduce and distribute the Font Software,
-including without limitation the rights to use, copy, merge, publish,
-distribute, and/or sell copies of the Font Software, and to permit persons to
-whom the Font Software is furnished to do so, subject to the following
-conditions:
-
-The above copyright and trademark notices and this permission notice shall be
-included in all copies of one or more of the Font Software typefaces.
-
-The Font Software may be modified, altered, or added to, and in particular the
-designs of glyphs or characters in the Fonts may be modified and additional
-glyphs or characters may be added to the Fonts, only if the fonts are renamed
-to names not containing either the words "Bitstream" or the word "Vera".
-
-This License becomes null and void to the extent applicable to Fonts or Font
-Software that has been modified and is distributed under the "Bitstream Vera"
-names.
-
-The Font Software may be sold as part of a larger software package but no copy
-of one or more of the Font Software typefaces may be sold by itself.
-
-THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
-TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME FOUNDATION
-BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL,
-SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO
-USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.
-
-Except as contained in this notice, the names of Gnome, the Gnome Foundation,
-and Bitstream Inc., shall not be used in advertising or otherwise to promote
-the sale, use or other dealings in this Font Software without prior written
-authorization from the Gnome Foundation or Bitstream Inc., respectively. For
-further information, contact: fonts at gnome dot org. 3.7. Bigelow & Holmes
-Inc and URW++ GmbH Luxi font license
-
-Luxi fonts copyright (c) 2001 by Bigelow & Holmes Inc. Luxi font instruction
-code copyright (c) 2001 by URW++ GmbH. All Rights Reserved. Luxi is a
-registered trademark of Bigelow & Holmes Inc.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of these Fonts and associated documentation files (the "Font Software"), to
-deal in the Font Software, including without limitation the rights to use,
-copy, merge, publish, distribute, sublicense, and/or sell copies of the Font
-Software, and to permit persons to whom the Font Software is furnished to do
-so, subject to the following conditions:
-
-The above copyright and trademark notices and this permission notice shall be
-included in all copies of one or more of the Font Software.
-
-The Font Software may not be modified, altered, or added to, and in particular
-the designs of glyphs or characters in the Fonts may not be modified nor may
-additional glyphs or characters be added to the Fonts. This License becomes
-null and void when the Fonts or Font Software have been modified.
-
-THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
-TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BIGELOW & HOLMES INC. OR URW++
-GMBH. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY
-GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR
-INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT
-SOFTWARE.
-
-Except as contained in this notice, the names of Bigelow & Holmes Inc. and
-URW++ GmbH. shall not be used in advertising or otherwise to promote the sale,
-use or other dealings in this Font Software without prior written
-authorization from Bigelow & Holmes Inc. and URW++ GmbH.
-
-For further information, contact:
-
-info@urwpp.de or design@bigelowandholmes.com
-
-
---- end of LICENSE ---
-
--------------------------------------------------------------------------------
-
-%% This notice is provided with respect to zlib v1.2.8, which may be included
-with JRE 8, JDK 8, and OpenJDK 8.
-
---- begin of LICENSE ---
-
- version 1.2.8, April 28th, 2013
-
- Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-
- Jean-loup Gailly Mark Adler
- jloup@gzip.org madler@alumni.caltech.edu
-
---- end of LICENSE ---
-
--------------------------------------------------------------------------------
-
-%% This notice is provided with respect to the following which may be
-included with JRE 8, JDK 8, and OpenJDK 8.
-
- Apache Commons Math 3.2
- Apache Derby 10.11.1.2
- Apache Jakarta BCEL 5.1
- Apache Jakarta Regexp 1.4
- Apache Santuario XML Security for Java 1.5.4
- Apache Xalan-Java 2.7.1
- Apache Xerces Java 2.10.0
- Apache XML Resolver 1.1
- Dynalink 0.5
-
-
---- begin of LICENSE ---
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
---- end of LICENSE ---
-
--------------------------------------------------------------------------------
-
diff --git a/TRADEMARK b/TRADEMARK
deleted file mode 100644
index 6587baf..0000000
--- a/TRADEMARK
+++ /dev/null
@@ -1,41 +0,0 @@
-OpenJDK Trademark Notice
-Version 1.1, 2008/3/10
-
-OpenJDK (the "Name") is a trademark of Sun Microsystems, Inc. (the "Owner").
-Owner permits any person obtaining a copy of this software (the "Software")
-which is based on original software retrieved from one of the following
-websites: http://download.java.net/openjdk, http://hg.openjdk.java.net/jdk6,
-or http://openjdk.java.net (each a "Website", with the original software made
-available by the Owner on a Website being known as the "Website Software") to
-use the Name in package names and version strings of the Software subject to
-the following conditions:
-
- - The Software is a substantially complete implementation of the OpenJDK
- development kit or runtime environment code made available by Owner on a
- Website, and the vast majority of the Software code is identical to the
- upstream Website Software;
-
- - No permission is hereby granted to use the Name in any other manner,
- unless such use constitutes "fair use."
-
- - The Owner makes no warranties of any kind respecting the Name and all
- representations and warranties, including any implied warranty of
- merchantability, fitness for a particular purpose or non-infringement
- are hereby disclaimed; and
-
- - This notice and the following legend are included in all copies of the
- Software or portions of it:
-
- OpenJDK is a trademark or registered trademark of Sun Microsystems,
- Inc. in the United States and other countries.
-
-The Name may also be used in connection with descriptions of the Software that
-constitute "fair use," such as "derived from the OpenJDK code base" or "based
-on the OpenJDK source code."
-
-Owner intends to revise this Notice as necessary in order to meet the needs of
-the OpenJDK Community. Please send questions or comments about this Notice to
-Sun Microsystems at openjdk-tm@sun.com. Revisions to this Notice will be
-announced on the public mailing list announce@openjdk.java.net, to which you
-may subscribe by visiting http://mail.openjdk.java.net. The latest version of
-this Notice may be found at http://openjdk.java.net/legal.
diff --git a/build.properties b/build.properties
deleted file mode 100644
index 9240acc..0000000
--- a/build.properties
+++ /dev/null
@@ -1,92 +0,0 @@
-#
-# Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation. Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-# This is the JDK used to build and run the bootstrap version of javac.
-# The bootstrap javac is used to compile both boostrap versions of the
-# other tools, and product versions of all the tools.
-# Override this path as needed, either on the command line or in
-# one of the standard user build.properties files (see build.xml)
-javac.jar=${bootstrap.dir}/lib/javac.jar
-
-# The tools.jar is needed in the classpath to compile these sources
-jdk.home=${java.home}/..
-tools.jar=${jdk.home}/lib/tools.jar
-
-# options for the <javac> tasks used to compile the tools
-javac.source = 7
-javac.target = 7
-javac.debug = true
-javac.no.jdk.warnings = -XDignore.symbol.file=true
-# set the following to -version to verify the versions of javac being used
-javac.version.opt =
-# in time, there should be no exceptions to -Xlint:all
-#javac.lint.opts = -Xlint:all,-unchecked,-deprecation,-fallthrough,-cast,-serial
-javac.lint.opts=
-
-# JVM memory size
-javac.memoryInitialSize = 256m
-javac.memoryMaximumSize = 512m
-
-#------------------------------------------------------------
-
-# Root of output directories
-output.dir=.
-
-# Built files
-build.dir=${output.dir}/build
-build.classes.dir=${build.dir}/classes
-
-# Distributed results
-dist.dir=${output.dir}/dist
-dist.lib.dir=${dist.dir}/lib
-dist.classes.jar=${dist.lib.dir}/classes.jar
-dist.src.zip=${dist.lib.dir}/src.zip
-
-# Sanity information
-sanity.info= Sanity Settings:${line.separator}\
- ant.home=${ant.home}${line.separator}\
- ant.version=${ant.version}${line.separator}\
- ant.java.version=${ant.java.version}${line.separator}\
- java.home=${java.home}${line.separator}\
- java.version=${java.version}${line.separator}\
- os.name=${os.name}${line.separator}\
- os.arch=${os.arch}${line.separator}\
- os.version=${os.version}${line.separator}\
- bootstrap.dir=${bootstrap.dir}${line.separator}\
- javac.jar=${javac.jar}${line.separator}\
- javac.memoryInitialSize=${javac.memoryInitialSize}${line.separator}\
- javac.memoryMaximumSize=${javac.memoryMaximumSize}${line.separator}\
- javac.source=${javac.source}${line.separator}\
- javac.debug=${javac.debug}${line.separator}\
- javac.target=${javac.target}${line.separator}\
- javac.version.opt=${javac.version.opt}${line.separator}\
- javac.lint.opts=${javac.lint.opts}${line.separator}\
- javac.no.jdk.warnings=${javac.no.jdk.warnings}${line.separator}\
- output.dir=${output.dir}${line.separator}\
- build.dir=${build.dir}${line.separator}\
- dist.dir=${dist.dir}${line.separator}\
-${line.separator}
-
-#------------------------------------------------------------
diff --git a/build.xml b/build.xml
deleted file mode 100644
index 72cdca2..0000000
--- a/build.xml
+++ /dev/null
@@ -1,217 +0,0 @@
-<?xml version="1.0"?>
-<!--
- Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation. Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<project name="jaxp" default="all" basedir=".">
-
- <!-- For 'ant -p' or 'ant -projecthelp' -->
-
- <description>
- Ant build script for the ${ant.project.name} part of the jdk.
-
- Input Properties: (see build.properties for the ant defaults)
- bootstrap.dir - dir with lib/javac.jar, added to javac bootclasspath
- javac.debug - true or false for debug classfiles
- javac.target - classfile version target
- javac.source - source version
-
- Run 'make help' for help using the Makefile.
- </description>
-
- <!-- Project build properties. -->
- <property file="build.properties"/>
-
- <!-- Source dir def -->
- <property name="jaxp.src.dir" value="src"/>
- <path id="src.dir.id">
- <pathelement path="${jaxp.src.dir}"/>
- </path>
-
- <!-- Initialization of directories needed for build. -->
- <target name="init">
- <mkdir dir="${build.dir}"/>
- <mkdir dir="${build.classes.dir}"/>
- <mkdir dir="${dist.dir}"/>
- <mkdir dir="${dist.lib.dir}"/>
- </target>
-
- <!-- Sanity checks and settings -->
- <target name="sanity"
- depends="-javac-jar-exists"
- description="Display settings of configuration values">
- <echo message="${sanity.info}"/>
- </target>
-
- <!-- Check for bootstrap javac.jar file, warn if missing. -->
- <condition property="javac.jar.exists">
- <available file="${javac.jar}" type="file"/>
- </condition>
- <target name="-javac-jar-exists"
- unless="javac.jar.exists">
- <echo message="WARNING: Cannot find ${javac.jar}"/>
- </target>
-
- <!-- Creation of distribution files to jdk build process. -->
- <target name="dist"
- depends="init, build, -dist-classes-jar, -dist-src-zip"
- description="Create all built distribution files.">
- </target>
- <target name="-dist-classes-jar-uptodate"
- depends="init">
- <condition property="dist.classes.jar.uptodate">
- <and>
- <available file="${dist.classes.jar}" type="file"/>
- <uptodate targetfile="${dist.classes.jar}">
- <srcfiles dir="${build.classes.dir}" includes="**"/>
- </uptodate>
- </and>
- </condition>
- </target>
- <target name="-dist-classes-jar"
- depends="init, -dist-classes-jar-uptodate"
- unless="dist.classes.jar.uptodate">
- <delete file="${dist.classes.jar}"/>
- <jar file="${dist.classes.jar}" basedir="${build.classes.dir}"/>
- </target>
-
- <!-- Special build area setup. -->
- <target name="-build-setup" depends="init">
- <mkdir dir="${build.classes.dir}"/>
- <copy todir="${build.classes.dir}">
- <fileset dir="${jaxp.src.dir}"
- includes="**/*.properties"/>
- </copy>
- <replaceregexp match="#(.*)$" replace="#" flags="gm">
- <fileset dir="${build.classes.dir}" includes="**/*.properties"/>
- </replaceregexp>
- </target>
-
- <!-- Create src.zip. -->
- <target name="-dist-src-zip" depends="init">
- <zip file="${dist.src.zip}" basedir="${jaxp.src.dir}"/>
- </target>
-
- <!-- Build (compilation) of sources to class files. -->
- <target name="build"
- depends="compile, -build-setup">
- </target>
- <target name="compile"
- depends="init">
- <mkdir dir="${build.classes.dir}"/>
- <javac
- includeAntRuntime="false"
- classpath="${build.classes.dir}:${tools.jar}"
- fork="true"
- destdir="${build.classes.dir}"
- memoryInitialSize="${javac.memoryInitialSize}"
- memoryMaximumSize="${javac.memoryMaximumSize}"
- source="${javac.source}"
- debug="${javac.debug}"
- target="${javac.target}">
- <compilerarg value="-J-Xbootclasspath/p:${javac.jar}"/>
- <compilerarg line="${javac.version.opt} ${javac.lint.opts} ${javac.no.jdk.warnings}"/>
- <src refid="src.dir.id"/>
- </javac>
- </target>
-
- <!-- Test. (FIXME: Need to know how to run tests.) -->
- <target name="test"
- depends="init, dist">
- <echo message="FIXME: How do you run the tests"/>
- </target>
-
- <!-- Populate source area if needed. -->
- <target name="source"
- depends="init"
- description="Populate all source file directories">
- </target>
-
- <!-- Clean up compiled files. -->
- <target name="clean"
- description="Delete all generated files">
- <delete dir="${build.dir}"/>
- <delete dir="${dist.dir}"/>
- </target>
-
- <!-- Clean up compiled files and all imported source files. -->
- <target name="clobber"
- depends="clean"
- description="Delete all generated files, including imported sources">
- </target>
-
- <target name="-banner">
- <echo message="+---------------------------------------+"/>
- <echo message="+ Starting ant project ${ant.project.name} +"/>
- <echo message="+---------------------------------------+"/>
- </target>
-
- <!-- Do everything but test. -->
- <target name="all"
- depends="-banner, sanity, dist"
- description="Build everything.">
- <echo message="+---------------------------------------+"/>
- <echo message="+ Finishing ant project ${ant.project.name}"/>
- <echo message="+---------------------------------------+"/>
- </target>
-
- <target name="javadoc" depends="init" description="Build basic Javadoc for public packages.">
- <property name="javadoc.options" value=""/> <!-- default, can be overridden per user or per project -->
- <!-- Note: even with this default value, includes/excludes
- from share.src.dir get javadoc'd; see packageset below -->
- <property name="javadoc.packagenames" value="none"/> <!-- default, can be overridden per user or per project -->
- <property name="javadoc.dir" value="${build.dir}/docs/api"/>
- <property name="includes" value="**"/>
- <javadoc destdir="${javadoc.dir}" source="1.5"
- windowtitle="UNOFFICIAL" failonerror="true" use="true"
- author="false" version="false"
- packagenames="${javadoc.packagenames}">
- <header><![CDATA[<strong>Unofficial Javadoc</strong> generated from developer sources for preview purposes only]]></header>
- <arg line="${javadoc.options}"/>
- <bootclasspath>
- <path location="${java.home}/lib/rt.jar"/>
- <path location="${build.classes.dir}"/>
- </bootclasspath>
- <sourcepath>
- <pathelement location="${jaxp.src.dir}"/>
- </sourcepath>
- <!-- XXX just <fileset> (restricted further to **/*.java) and no <packageset> -->
- <!-- means that {@link some.package} will not work, which is no good. -->
- <!-- (It correctly skips excluded single classes, but not if packageset is also included, -->
- <!-- which also causes duplicates in the class index for included files.) -->
- <packageset dir="${jaxp.src.dir}" includes="${includes}" excludes="${excludes}">
- <or>
- <filename name="javax/"/>
- <filename name="org/w3c/"/>
- <filename name="org/xml/sax/"/>
- </or>
- </packageset>
- </javadoc>
- </target>
- <target name="javadoc-nb" depends="javadoc" if="netbeans.home">
- <property name="javadoc.dir=" value="${build.dir}/docs/api"/>
- <nbbrowse file="${javadoc.dir}/index.html"/>
- </target>
-
-</project>
diff --git a/make/BuildJaxp.gmk b/make/BuildJaxp.gmk
deleted file mode 100644
index 7950b0c..0000000
--- a/make/BuildJaxp.gmk
+++ /dev/null
@@ -1,71 +0,0 @@
-#
-# Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation. Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-# This must be the first rule
-default: all
-
--include $(SPEC)
-include MakeBase.gmk
-include JavaCompilation.gmk
-
-DISABLE_JAXP_WARNINGS := -Xlint:all,-deprecation,-unchecked,-rawtypes,-cast,-serial,-dep-ann,-static,-fallthrough
-
-# The generate new bytecode uses the new compiler for to generate bytecode
-# for the new jdk that is being built. The code compiled by this setup
-# cannot necessarily be run with the boot jdk.
-$(eval $(call SetupJavaCompiler,GENERATE_NEWBYTECODE_DEBUG, \
- JVM := $(JAVA), \
- JAVAC := $(NEW_JAVAC), \
- FLAGS := -XDignore.symbol.file=true $(DISABLE_JAXP_WARNINGS) -g, \
- SERVER_DIR := $(SJAVAC_SERVER_DIR), \
- SERVER_JVM := $(SJAVAC_SERVER_JAVA)))
-
-$(eval $(call SetupJavaCompilation,BUILD_JAXP, \
- SETUP := GENERATE_NEWBYTECODE_DEBUG, \
- SRC := $(JAXP_TOPDIR)/src, \
- BIN := $(JAXP_OUTPUTDIR)/classes, \
- SRCZIP := $(JAXP_OUTPUTDIR)/dist/lib/src.zip))
-
-# Imitate the property cleaning mechanism in the old build. This will likely be replaced
-# by the unified functionality in JavaCompilation.gmk, but keep it the same as old build
-# for now, even though it actually breaks properties containing # in the value.
-# Using nawk to avoid solaris sed.
-$(JAXP_OUTPUTDIR)/classes/%.properties: $(JAXP_TOPDIR)/src/%.properties
- $(MKDIR) -p $(@D)
- $(RM) $@ $@.tmp
- $(CAT) $< | LANG=C $(NAWK) '{ sub(/#.*$$/,"#"); print }' > $@.tmp
- $(MV) $@.tmp $@
-
-SRC_PROP_FILES := $(shell $(FIND) $(JAXP_TOPDIR)/src -name "*.properties")
-TARGET_PROP_FILES := $(patsubst $(JAXP_TOPDIR)/src/%, $(JAXP_OUTPUTDIR)/classes/%, $(SRC_PROP_FILES))
-
-$(eval $(call SetupArchive,ARCHIVE_JAXP, $(BUILD_JAXP) $(TARGET_PROP_FILES), \
- SRCS := $(JAXP_OUTPUTDIR)/classes, \
- SUFFIXES := .class .properties, \
- JAR := $(JAXP_OUTPUTDIR)/dist/lib/classes.jar))
-
-all: $(JAXP_OUTPUTDIR)/dist/lib/classes.jar $(JAXP_OUTPUTDIR)/dist/lib/src.zip
-
-.PHONY: default all
diff --git a/make/Makefile b/make/Makefile
deleted file mode 100644
index 4570070..0000000
--- a/make/Makefile
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation. Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-# Locate this Makefile
-ifeq ($(filter /%, $(lastword $(MAKEFILE_LIST))), )
- makefile_path := $(CURDIR)/$(lastword $(MAKEFILE_LIST))
-else
- makefile_path := $(lastword $(MAKEFILE_LIST))
-endif
-repo_dir := $(patsubst %/make/Makefile, %, $(makefile_path))
-
-# What is the name of this subsystem (langtools, corba, etc)?
-subsystem_name := $(notdir $(repo_dir))
-
-# Try to locate top-level makefile
-top_level_makefile := $(repo_dir)/../Makefile
-ifneq ($(wildcard $(top_level_makefile)), )
- $(info Will run $(subsystem_name) target on top-level Makefile)
- $(info WARNING: This is a non-recommended way of building!)
- $(info ===================================================)
-else
- $(info Cannot locate top-level Makefile. Is this repo not checked out as part of a complete forest?)
- $(error Build from top-level Makefile instead)
-endif
-
-all:
- @$(MAKE) -f $(top_level_makefile) $(subsystem_name)
diff --git a/nbproject/findbugs.settings b/nbproject/findbugs.settings
deleted file mode 100644
index a5d7631..0000000
--- a/nbproject/findbugs.settings
+++ /dev/null
@@ -1,72 +0,0 @@
-#FindBugs User Preferences
-#Tue Jun 30 18:33:11 PDT 2009
-detectorAbnormalFinallyBlockReturn=AbnormalFinallyBlockReturn|false
-detectorAbstractClassEmptyMethods=AbstractClassEmptyMethods|false
-detectorAbstractOverriddenMethod=AbstractOverriddenMethod|false
-detectorArrayBasedCollections=ArrayBasedCollections|false
-detectorArrayWrappedCallByReference=ArrayWrappedCallByReference|false
-detectorBloatedAssignmentScope=BloatedAssignmentScope|false
-detectorBloatedSynchronizedBlock=BloatedSynchronizedBlock|false
-detectorClassEnvy=ClassEnvy|false
-detectorCollectStatistics=CollectStatistics|false
-detectorConfusingAutoboxedOverloading=ConfusingAutoboxedOverloading|false
-detectorConstantListIndex=ConstantListIndex|false
-detectorCopiedOverriddenMethod=CopiedOverriddenMethod|false
-detectorCustomBuiltXML=CustomBuiltXML|false
-detectorCyclomaticComplexity=CyclomaticComplexity|false
-detectorDateComparison=DateComparison|false
-detectorDeclaredRuntimeException=DeclaredRuntimeException|false
-detectorDeletingWhileIterating=DeletingWhileIterating|false
-detectorDubiousListCollection=DubiousListCollection|false
-detectorFieldCouldBeLocal=FieldCouldBeLocal|false
-detectorFinalParameters=FinalParameters|false
-detectorFloatingPointLoops=FloatingPointLoops|false
-detectorInefficientStringBuffering=InefficientStringBuffering|false
-detectorInheritanceTypeChecking=InheritanceTypeChecking|false
-detectorJDBCVendorReliance=JDBCVendorReliance|false
-detectorListIndexedIterating=ListIndexedIterating|false
-detectorLiteralStringComparison=LiteralStringComparison|false
-detectorLocalSynchronizedCollection=LocalSynchronizedCollection|false
-detectorLostExceptionStackTrace=LostExceptionStackTrace|false
-detectorManualArrayCopy=ManualArrayCopy|false
-detectorMethodReturnsConstant=MethodReturnsConstant|false
-detectorNeedlessAutoboxing=NeedlessAutoboxing|false
-detectorNeedlessCustomSerialization=NeedlessCustomSerialization|false
-detectorNeedlessInstanceRetrieval=NeedlessInstanceRetrieval|false
-detectorNeedlessMemberCollectionSynchronization=NeedlessMemberCollectionSynchronization|false
-detectorNonCollectionMethodUse=NonCollectionMethodUse|false
-detectorNonOwnedSynchronization=NonOwnedSynchronization|false
-detectorNonRecycleableTaglibs=NonRecycleableTaglibs|false
-detectorOrphanedDOMNode=OrphanedDOMNode|false
-detectorOverlyConcreteParameter=OverlyConcreteParameter|false
-detectorParallelLists=ParallelLists|false
-detectorPartiallyConstructedObjectAccess=PartiallyConstructedObjectAccess|false
-detectorPossibleIncompleteSerialization=PossibleIncompleteSerialization|false
-detectorPossibleMemoryBloat=PossibleMemoryBloat|false
-detectorPossiblyRedundantMethodCalls=PossiblyRedundantMethodCalls|false
-detectorSQLInLoop=SQLInLoop|false
-detectorSection508Compliance=Section508Compliance|false
-detectorSillynessPotPourri=SillynessPotPourri|false
-detectorSloppyClassReflection=SloppyClassReflection|false
-detectorSluggishGui=SluggishGui|false
-detectorSpoiledChildInterfaceImplementor=SpoiledChildInterfaceImplementor|false
-detectorSpuriousThreadStates=SpuriousThreadStates|false
-detectorStaticArrayCreatedInMethod=StaticArrayCreatedInMethod|false
-detectorStaticMethodInstanceInvocation=StaticMethodInstanceInvocation|false
-detectorSuspiciousComparatorReturnValues=SuspiciousComparatorReturnValues|false
-detectorSuspiciousJDKVersionUse=SuspiciousJDKVersionUse|false
-detectorSuspiciousWaitOnConcurrentObject=SuspiciousWaitOnConcurrentObject|false
-detectorSyncCollectionIterators=SyncCollectionIterators|false
-detectorTailRecursion=TailRecursion|false
-detectorUnnecessaryStoreBeforeReturn=UnnecessaryStoreBeforeReturn|false
-detectorUnrelatedCollectionContents=UnrelatedCollectionContents|false
-detectorUnrelatedReturnValues=UnrelatedReturnValues|false
-detectorUseAddAll=UseAddAll|false
-detectorUseCharacterParameterizedMethod=UseCharacterParameterizedMethod|false
-detectorUseEnumCollections=UseEnumCollections|false
-detectorUseSplit=UseSplit|false
-detectorUseToArray=UseToArray|false
-detector_threshold=2
-effort=default
-filter_settings=Medium|BAD_PRACTICE,CORRECTNESS,I18N,MALICIOUS_CODE,MT_CORRECTNESS,PERFORMANCE,SECURITY,STYLE|false
-filter_settings_neg=|
diff --git a/nbproject/project.xml b/nbproject/project.xml
deleted file mode 100644
index 4d3322c..0000000
--- a/nbproject/project.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://www.netbeans.org/ns/project/1">
- <type>org.netbeans.modules.ant.freeform</type>
- <configuration>
- <general-data xmlns="http://www.netbeans.org/ns/freeform-project/1">
- <name>jaxp</name>
- </general-data>
- <general-data xmlns="http://www.netbeans.org/ns/freeform-project/2">
- <!-- Do not use Project Properties customizer when editing this file manually. -->
- <name>jaxp</name>
- <properties/>
- <folders>
- <source-folder>
- <label>jaxp</label>
- <location>.</location>
- <encoding>UTF-8</encoding>
- </source-folder>
- <source-folder>
- <label>src</label>
- <type>java</type>
- <location>src</location>
- <encoding>UTF-8</encoding>
- </source-folder>
- </folders>
- <ide-actions>
- <action name="build">
- <target>build</target>
- </action>
- <action name="clean">
- <target>clean</target>
- </action>
- <action name="rebuild">
- <target>clean</target>
- <target>build</target>
- </action>
- <action name="javadoc">
- <target>javadoc-nb</target>
- </action>
- </ide-actions>
- <view>
- <items>
- <source-folder style="packages">
- <label>src</label>
- <location>src</location>
- </source-folder>
- <source-file>
- <location>build.xml</location>
- </source-file>
- </items>
- <context-menu>
- <ide-action name="build"/>
- <ide-action name="rebuild"/>
- <ide-action name="clean"/>
- <ide-action name="javadoc"/>
- </context-menu>
- </view>
- <subprojects/>
- </general-data>
- <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/1">
- <compilation-unit>
- <package-root>src</package-root>
- </compilation-unit>
- </java-data>
- <preferences xmlns="http://www.netbeans.org/ns/auxiliary-configuration-preferences/1">
- <module name="org-netbeans-modules-editor-indent"/>
- </preferences>
- </configuration>
-</project>
diff --git a/nbproject/sqe.properties b/nbproject/sqe.properties
deleted file mode 100644
index 978ef5b..0000000
--- a/nbproject/sqe.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-#Path to FindbugsSettingsFile (relative)
-findbugs.settings.file=findbugs.settings
diff --git a/src/com/sun/java_cup/internal/runtime/Scanner.java b/src/com/sun/java_cup/internal/runtime/Scanner.java
deleted file mode 100644
index a390688..0000000
--- a/src/com/sun/java_cup/internal/runtime/Scanner.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java_cup.internal.runtime;
-
-/**
- * Defines the Scanner interface, which CUP uses in the default
- * implementation of <code>lr_parser.scan()</code>. Integration
- * of scanners implementing <code>Scanner</code> is facilitated.
- *
- * @author David MacMahon <davidm@smartsc.com>
- */
-
-/* *************************************************
- Interface Scanner
-
- Declares the next_token() method that should be
- implemented by scanners. This method is typically
- called by lr_parser.scan().
- ***************************************************/
-public interface Scanner {
- public Symbol next_token() throws java.lang.Exception;
-}
diff --git a/src/com/sun/java_cup/internal/runtime/Symbol.java b/src/com/sun/java_cup/internal/runtime/Symbol.java
deleted file mode 100644
index d25e2e8..0000000
--- a/src/com/sun/java_cup/internal/runtime/Symbol.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.java_cup.internal.runtime;
-
-/**
- * Defines the Symbol class, which is used to represent all terminals
- * and nonterminals while parsing. The lexer should pass CUP Symbols
- * and CUP returns a Symbol.
- *
- * @author Frank Flannery
- */
-
-/* ****************************************************************
- Class Symbol
- what the parser expects to receive from the lexer.
- the token is identified as follows:
- sym: the symbol type
- parse_state: the parse state.
- value: is the lexical value of type Object
- left : is the left position in the original input file
- right: is the right position in the original input file
-******************************************************************/
-
-public class Symbol {
-
-/*******************************
- Constructor for l,r values
- *******************************/
-
- public Symbol(int id, int l, int r, Object o) {
- this(id);
- left = l;
- right = r;
- value = o;
- }
-
-/*******************************
- Constructor for no l,r values
-********************************/
-
- public Symbol(int id, Object o) {
- this(id);
- left = -1;
- right = -1;
- value = o;
- }
-
-/*****************************
- Constructor for no value
- ***************************/
-
- public Symbol(int sym_num, int l, int r) {
- sym = sym_num;
- left = l;
- right = r;
- value = null;
- }
-
-/***********************************
- Constructor for no value or l,r
-***********************************/
-
- public Symbol(int sym_num) {
- this(sym_num, -1);
- left = -1;
- right = -1;
- value = null;
- }
-
-/***********************************
- Constructor to give a start state
-***********************************/
- public Symbol(int sym_num, int state)
- {
- sym = sym_num;
- parse_state = state;
- }
-
-/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** The symbol number of the terminal or non terminal being represented */
- public int sym;
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** The parse state to be recorded on the parse stack with this symbol.
- * This field is for the convenience of the parser and shouldn't be
- * modified except by the parser.
- */
- public int parse_state;
- /** This allows us to catch some errors caused by scanners recycling
- * symbols. For the use of the parser only. [CSA, 23-Jul-1999] */
- boolean used_by_parser = false;
-
-/*******************************
- The data passed to parser
- *******************************/
-
- public int left, right;
- public Object value;
-
- /*****************************
- Printing this token out. (Override for pretty-print).
- ****************************/
- public String toString() { return "#"+sym; }
-}
diff --git a/src/com/sun/java_cup/internal/runtime/lr_parser.java b/src/com/sun/java_cup/internal/runtime/lr_parser.java
deleted file mode 100644
index a94dff8..0000000
--- a/src/com/sun/java_cup/internal/runtime/lr_parser.java
+++ /dev/null
@@ -1,1251 +0,0 @@
-/*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.java_cup.internal.runtime;
-
-import java.util.Stack;
-
-/** This class implements a skeleton table driven LR parser. In general,
- * LR parsers are a form of bottom up shift-reduce parsers. Shift-reduce
- * parsers act by shifting input onto a parse stack until the Symbols
- * matching the right hand side of a production appear on the top of the
- * stack. Once this occurs, a reduce is performed. This involves removing
- * the Symbols corresponding to the right hand side of the production
- * (the so called "handle") and replacing them with the non-terminal from
- * the left hand side of the production. <p>
- *
- * To control the decision of whether to shift or reduce at any given point,
- * the parser uses a state machine (the "viable prefix recognition machine"
- * built by the parser generator). The current state of the machine is placed
- * on top of the parse stack (stored as part of a Symbol object representing
- * a terminal or non terminal). The parse action table is consulted
- * (using the current state and the current lookahead Symbol as indexes) to
- * determine whether to shift or to reduce. When the parser shifts, it
- * changes to a new state by pushing a new Symbol (containing a new state)
- * onto the stack. When the parser reduces, it pops the handle (right hand
- * side of a production) off the stack. This leaves the parser in the state
- * it was in before any of those Symbols were matched. Next the reduce-goto
- * table is consulted (using the new state and current lookahead Symbol as
- * indexes) to determine a new state to go to. The parser then shifts to
- * this goto state by pushing the left hand side Symbol of the production
- * (also containing the new state) onto the stack.<p>
- *
- * This class actually provides four LR parsers. The methods parse() and
- * debug_parse() provide two versions of the main parser (the only difference
- * being that debug_parse() emits debugging trace messages as it parses).
- * In addition to these main parsers, the error recovery mechanism uses two
- * more. One of these is used to simulate "parsing ahead" in the input
- * without carrying out actions (to verify that a potential error recovery
- * has worked), and the other is used to parse through buffered "parse ahead"
- * input in order to execute all actions and re-synchronize the actual parser
- * configuration.<p>
- *
- * This is an abstract class which is normally filled out by a subclass
- * generated by the JavaCup parser generator. In addition to supplying
- * the actual parse tables, generated code also supplies methods which
- * invoke various pieces of user supplied code, provide access to certain
- * special Symbols (e.g., EOF and error), etc. Specifically, the following
- * abstract methods are normally supplied by generated code:
- * <dl compact>
- * <dt> short[][] production_table()
- * <dd> Provides a reference to the production table (indicating the index of
- * the left hand side non terminal and the length of the right hand side
- * for each production in the grammar).
- * <dt> short[][] action_table()
- * <dd> Provides a reference to the parse action table.
- * <dt> short[][] reduce_table()
- * <dd> Provides a reference to the reduce-goto table.
- * <dt> int start_state()
- * <dd> Indicates the index of the start state.
- * <dt> int start_production()
- * <dd> Indicates the index of the starting production.
- * <dt> int EOF_sym()
- * <dd> Indicates the index of the EOF Symbol.
- * <dt> int error_sym()
- * <dd> Indicates the index of the error Symbol.
- * <dt> Symbol do_action()
- * <dd> Executes a piece of user supplied action code. This always comes at
- * the point of a reduce in the parse, so this code also allocates and
- * fills in the left hand side non terminal Symbol object that is to be
- * pushed onto the stack for the reduce.
- * <dt> void init_actions()
- * <dd> Code to initialize a special object that encapsulates user supplied
- * actions (this object is used by do_action() to actually carry out the
- * actions).
- * </dl>
- *
- * In addition to these routines that <i>must</i> be supplied by the
- * generated subclass there are also a series of routines that <i>may</i>
- * be supplied. These include:
- * <dl>
- * <dt> Symbol scan()
- * <dd> Used to get the next input Symbol from the scanner.
- * <dt> Scanner getScanner()
- * <dd> Used to provide a scanner for the default implementation of
- * scan().
- * <dt> int error_sync_size()
- * <dd> This determines how many Symbols past the point of an error
- * must be parsed without error in order to consider a recovery to
- * be valid. This defaults to 3. Values less than 2 are not
- * recommended.
- * <dt> void report_error(String message, Object info)
- * <dd> This method is called to report an error. The default implementation
- * simply prints a message to System.err and where the error occurred.
- * This method is often replaced in order to provide a more sophisticated
- * error reporting mechanism.
- * <dt> void report_fatal_error(String message, Object info)
- * <dd> This method is called when a fatal error that cannot be recovered from
- * is encountered. In the default implementation, it calls
- * report_error() to emit a message, then throws an exception.
- * <dt> void syntax_error(Symbol cur_token)
- * <dd> This method is called as soon as syntax error is detected (but
- * before recovery is attempted). In the default implementation it
- * invokes: report_error("Syntax error", null);
- * <dt> void unrecovered_syntax_error(Symbol cur_token)
- * <dd> This method is called if syntax error recovery fails. In the default
- * implementation it invokes:<br>
- * report_fatal_error("Couldn't repair and continue parse", null);
- * </dl>
- *
- * @see com.sun.java_cup.internal.runtime.Symbol
- * @see com.sun.java_cup.internal.runtime.Symbol
- * @see com.sun.java_cup.internal.runtime.virtual_parse_stack
- * @author Frank Flannery
- */
-
-public abstract class lr_parser {
-
- /*-----------------------------------------------------------*/
- /*--- Constructor(s) ----------------------------------------*/
- /*-----------------------------------------------------------*/
-
- /** Simple constructor. */
- public lr_parser()
- {
- /* nothing to do here */
- }
-
- /** Constructor that sets the default scanner. [CSA/davidm] */
- public lr_parser(Scanner s) {
- this(); /* in case default constructor someday does something */
- setScanner(s);
- }
-
- /*-----------------------------------------------------------*/
- /*--- (Access to) Static (Class) Variables ------------------*/
- /*-----------------------------------------------------------*/
-
- /** The default number of Symbols after an error we much match to consider
- * it recovered from.
- */
- protected final static int _error_sync_size = 3;
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** The number of Symbols after an error we much match to consider it
- * recovered from.
- */
- protected int error_sync_size() {return _error_sync_size; }
-
- /*-----------------------------------------------------------*/
- /*--- (Access to) Instance Variables ------------------------*/
- /*-----------------------------------------------------------*/
-
- /** Table of production information (supplied by generated subclass).
- * This table contains one entry per production and is indexed by
- * the negative-encoded values (reduce actions) in the action_table.
- * Each entry has two parts, the index of the non-terminal on the
- * left hand side of the production, and the number of Symbols
- * on the right hand side.
- */
- public abstract short[][] production_table();
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** The action table (supplied by generated subclass). This table is
- * indexed by state and terminal number indicating what action is to
- * be taken when the parser is in the given state (i.e., the given state
- * is on top of the stack) and the given terminal is next on the input.
- * States are indexed using the first dimension, however, the entries for
- * a given state are compacted and stored in adjacent index, value pairs
- * which are searched for rather than accessed directly (see get_action()).
- * The actions stored in the table will be either shifts, reduces, or
- * errors. Shifts are encoded as positive values (one greater than the
- * state shifted to). Reduces are encoded as negative values (one less
- * than the production reduced by). Error entries are denoted by zero.
- *
- * @see com.sun.java_cup.internal.runtime.lr_parser#get_action
- */
- public abstract short[][] action_table();
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** The reduce-goto table (supplied by generated subclass). This
- * table is indexed by state and non-terminal number and contains
- * state numbers. States are indexed using the first dimension, however,
- * the entries for a given state are compacted and stored in adjacent
- * index, value pairs which are searched for rather than accessed
- * directly (see get_reduce()). When a reduce occurs, the handle
- * (corresponding to the RHS of the matched production) is popped off
- * the stack. The new top of stack indicates a state. This table is
- * then indexed by that state and the LHS of the reducing production to
- * indicate where to "shift" to.
- *
- * @see com.sun.java_cup.internal.runtime.lr_parser#get_reduce
- */
- public abstract short[][] reduce_table();
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** The index of the start state (supplied by generated subclass). */
- public abstract int start_state();
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** The index of the start production (supplied by generated subclass). */
- public abstract int start_production();
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** The index of the end of file terminal Symbol (supplied by generated
- * subclass).
- */
- public abstract int EOF_sym();
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** The index of the special error Symbol (supplied by generated subclass). */
- public abstract int error_sym();
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** Internal flag to indicate when parser should quit. */
- protected boolean _done_parsing = false;
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** This method is called to indicate that the parser should quit. This is
- * normally called by an accept action, but can be used to cancel parsing
- * early in other circumstances if desired.
- */
- public void done_parsing()
- {
- _done_parsing = true;
- }
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
- /* Global parse state shared by parse(), error recovery, and
- * debugging routines */
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** Indication of the index for top of stack (for use by actions). */
- protected int tos;
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** The current lookahead Symbol. */
- protected Symbol cur_token;
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** The parse stack itself. */
- protected Stack stack = new Stack();
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** Direct reference to the production table. */
- protected short[][] production_tab;
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** Direct reference to the action table. */
- protected short[][] action_tab;
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** Direct reference to the reduce-goto table. */
- protected short[][] reduce_tab;
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** This is the scanner object used by the default implementation
- * of scan() to get Symbols. To avoid name conflicts with existing
- * code, this field is private. [CSA/davidm] */
- private Scanner _scanner;
-
- /**
- * Simple accessor method to set the default scanner.
- */
- public void setScanner(Scanner s) { _scanner = s; }
-
- /**
- * Simple accessor method to get the default scanner.
- */
- public Scanner getScanner() { return _scanner; }
-
- /*-----------------------------------------------------------*/
- /*--- General Methods ---------------------------------------*/
- /*-----------------------------------------------------------*/
-
- /** Perform a bit of user supplied action code (supplied by generated
- * subclass). Actions are indexed by an internal action number assigned
- * at parser generation time.
- *
- * @param act_num the internal index of the action to be performed.
- * @param parser the parser object we are acting for.
- * @param stack the parse stack of that object.
- * @param top the index of the top element of the parse stack.
- */
- public abstract Symbol do_action(
- int act_num,
- lr_parser parser,
- Stack stack,
- int top)
- throws java.lang.Exception;
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** User code for initialization inside the parser. Typically this
- * initializes the scanner. This is called before the parser requests
- * the first Symbol. Here this is just a placeholder for subclasses that
- * might need this and we perform no action. This method is normally
- * overridden by the generated code using this contents of the "init with"
- * clause as its body.
- */
- public void user_init() throws java.lang.Exception { }
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** Initialize the action object. This is called before the parser does
- * any parse actions. This is filled in by generated code to create
- * an object that encapsulates all action code.
- */
- protected abstract void init_actions() throws java.lang.Exception;
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** Get the next Symbol from the input (supplied by generated subclass).
- * Once end of file has been reached, all subsequent calls to scan
- * should return an EOF Symbol (which is Symbol number 0). By default
- * this method returns getScanner().next_token(); this implementation
- * can be overriden by the generated parser using the code declared in
- * the "scan with" clause. Do not recycle objects; every call to
- * scan() should return a fresh object.
- */
- public Symbol scan() throws java.lang.Exception {
- return getScanner().next_token();
- }
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** Report a fatal error. This method takes a message string and an
- * additional object (to be used by specializations implemented in
- * subclasses). Here in the base class a very simple implementation
- * is provided which reports the error then throws an exception.
- *
- * @param message an error message.
- * @param info an extra object reserved for use by specialized subclasses.
- */
- public void report_fatal_error(
- String message,
- Object info)
- throws java.lang.Exception
- {
- /* stop parsing (not really necessary since we throw an exception, but) */
- done_parsing();
-
- /* use the normal error message reporting to put out the message */
- report_error(message, info);
-
- /* throw an exception */
- throw new Exception("Can't recover from previous error(s)");
- }
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** Report a non fatal error (or warning). This method takes a message
- * string and an additional object (to be used by specializations
- * implemented in subclasses). Here in the base class a very simple
- * implementation is provided which simply prints the message to
- * System.err.
- *
- * @param message an error message.
- * @param info an extra object reserved for use by specialized subclasses.
- */
- public void report_error(String message, Object info)
- {
- System.err.print(message);
- if (info instanceof Symbol)
- if (((Symbol)info).left != -1)
- System.err.println(" at character " + ((Symbol)info).left +
- " of input");
- else System.err.println("");
- else System.err.println("");
- }
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** This method is called when a syntax error has been detected and recovery
- * is about to be invoked. Here in the base class we just emit a
- * "Syntax error" error message.
- *
- * @param cur_token the current lookahead Symbol.
- */
- public void syntax_error(Symbol cur_token)
- {
- report_error("Syntax error", cur_token);
- }
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** This method is called if it is determined that syntax error recovery
- * has been unsuccessful. Here in the base class we report a fatal error.
- *
- * @param cur_token the current lookahead Symbol.
- */
- public void unrecovered_syntax_error(Symbol cur_token)
- throws java.lang.Exception
- {
- report_fatal_error("Couldn't repair and continue parse", cur_token);
- }
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** Fetch an action from the action table. The table is broken up into
- * rows, one per state (rows are indexed directly by state number).
- * Within each row, a list of index, value pairs are given (as sequential
- * entries in the table), and the list is terminated by a default entry
- * (denoted with a Symbol index of -1). To find the proper entry in a row
- * we do a linear or binary search (depending on the size of the row).
- *
- * @param state the state index of the action being accessed.
- * @param sym the Symbol index of the action being accessed.
- */
- protected final short get_action(int state, int sym)
- {
- short tag;
- int first, last, probe;
- short[] row = action_tab[state];
-
- /* linear search if we are < 10 entries */
- if (row.length < 20)
- for (probe = 0; probe < row.length; probe++)
- {
- /* is this entry labeled with our Symbol or the default? */
- tag = row[probe++];
- if (tag == sym || tag == -1)
- {
- /* return the next entry */
- return row[probe];
- }
- }
- /* otherwise binary search */
- else
- {
- first = 0;
- last = (row.length-1)/2 - 1; /* leave out trailing default entry */
- while (first <= last)
- {
- probe = (first+last)/2;
- if (sym == row[probe*2])
- return row[probe*2+1];
- else if (sym > row[probe*2])
- first = probe+1;
- else
- last = probe-1;
- }
-
- /* not found, use the default at the end */
- return row[row.length-1];
- }
-
- /* shouldn't happened, but if we run off the end we return the
- default (error == 0) */
- return 0;
- }
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** Fetch a state from the reduce-goto table. The table is broken up into
- * rows, one per state (rows are indexed directly by state number).
- * Within each row, a list of index, value pairs are given (as sequential
- * entries in the table), and the list is terminated by a default entry
- * (denoted with a Symbol index of -1). To find the proper entry in a row
- * we do a linear search.
- *
- * @param state the state index of the entry being accessed.
- * @param sym the Symbol index of the entry being accessed.
- */
- protected final short get_reduce(int state, int sym)
- {
- short tag;
- short[] row = reduce_tab[state];
-
- /* if we have a null row we go with the default */
- if (row == null)
- return -1;
-
- for (int probe = 0; probe < row.length; probe++)
- {
- /* is this entry labeled with our Symbol or the default? */
- tag = row[probe++];
- if (tag == sym || tag == -1)
- {
- /* return the next entry */
- return row[probe];
- }
- }
- /* if we run off the end we return the default (error == -1) */
- return -1;
- }
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** This method provides the main parsing routine. It returns only when
- * done_parsing() has been called (typically because the parser has
- * accepted, or a fatal error has been reported). See the header
- * documentation for the class regarding how shift/reduce parsers operate
- * and how the various tables are used.
- */
- public Symbol parse() throws java.lang.Exception
- {
- /* the current action code */
- int act;
-
- /* the Symbol/stack element returned by a reduce */
- Symbol lhs_sym = null;
-
- /* information about production being reduced with */
- short handle_size, lhs_sym_num;
-
- /* set up direct reference to tables to drive the parser */
-
- production_tab = production_table();
- action_tab = action_table();
- reduce_tab = reduce_table();
-
- /* initialize the action encapsulation object */
- init_actions();
-
- /* do user initialization */
- user_init();
-
- /* get the first token */
- cur_token = scan();
-
- /* push dummy Symbol with start state to get us underway */
- stack.removeAllElements();
- stack.push(new Symbol(0, start_state()));
- tos = 0;
-
- /* continue until we are told to stop */
- for (_done_parsing = false; !_done_parsing; )
- {
- /* Check current token for freshness. */
- if (cur_token.used_by_parser)
- throw new Error("Symbol recycling detected (fix your scanner).");
-
- /* current state is always on the top of the stack */
-
- /* look up action out of the current state with the current input */
- act = get_action(((Symbol)stack.peek()).parse_state, cur_token.sym);
-
- /* decode the action -- > 0 encodes shift */
- if (act > 0)
- {
- /* shift to the encoded state by pushing it on the stack */
- cur_token.parse_state = act-1;
- cur_token.used_by_parser = true;
- stack.push(cur_token);
- tos++;
-
- /* advance to the next Symbol */
- cur_token = scan();
- }
- /* if its less than zero, then it encodes a reduce action */
- else if (act < 0)
- {
- /* perform the action for the reduce */
- lhs_sym = do_action((-act)-1, this, stack, tos);
-
- /* look up information about the production */
- lhs_sym_num = production_tab[(-act)-1][0];
- handle_size = production_tab[(-act)-1][1];
-
- /* pop the handle off the stack */
- for (int i = 0; i < handle_size; i++)
- {
- stack.pop();
- tos--;
- }
-
- /* look up the state to go to from the one popped back to */
- act = get_reduce(((Symbol)stack.peek()).parse_state, lhs_sym_num);
-
- /* shift to that state */
- lhs_sym.parse_state = act;
- lhs_sym.used_by_parser = true;
- stack.push(lhs_sym);
- tos++;
- }
- /* finally if the entry is zero, we have an error */
- else if (act == 0)
- {
- /* call user syntax error reporting routine */
- syntax_error(cur_token);
-
- /* try to error recover */
- if (!error_recovery(false))
- {
- /* if that fails give up with a fatal syntax error */
- unrecovered_syntax_error(cur_token);
-
- /* just in case that wasn't fatal enough, end parse */
- done_parsing();
- } else {
- lhs_sym = (Symbol)stack.peek();
- }
- }
- }
- return lhs_sym;
- }
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** Write a debugging message to System.err for the debugging version
- * of the parser.
- *
- * @param mess the text of the debugging message.
- */
- public void debug_message(String mess)
- {
- System.err.println(mess);
- }
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** Dump the parse stack for debugging purposes. */
- public void dump_stack()
- {
- if (stack == null)
- {
- debug_message("# Stack dump requested, but stack is null");
- return;
- }
-
- debug_message("============ Parse Stack Dump ============");
-
- /* dump the stack */
- for (int i=0; i<stack.size(); i++)
- {
- debug_message("Symbol: " + ((Symbol)stack.elementAt(i)).sym +
- " State: " + ((Symbol)stack.elementAt(i)).parse_state);
- }
- debug_message("==========================================");
- }
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** Do debug output for a reduce.
- *
- * @param prod_num the production we are reducing with.
- * @param nt_num the index of the LHS non terminal.
- * @param rhs_size the size of the RHS.
- */
- public void debug_reduce(int prod_num, int nt_num, int rhs_size)
- {
- debug_message("# Reduce with prod #" + prod_num + " [NT=" + nt_num +
- ", " + "SZ=" + rhs_size + "]");
- }
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** Do debug output for shift.
- *
- * @param shift_tkn the Symbol being shifted onto the stack.
- */
- public void debug_shift(Symbol shift_tkn)
- {
- debug_message("# Shift under term #" + shift_tkn.sym +
- " to state #" + shift_tkn.parse_state);
- }
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** Do debug output for stack state. [CSA]
- */
- public void debug_stack() {
- StringBuffer sb=new StringBuffer("## STACK:");
- for (int i=0; i<stack.size(); i++) {
- Symbol s = (Symbol) stack.elementAt(i);
- sb.append(" <state "+s.parse_state+", sym "+s.sym+">");
- if ((i%3)==2 || (i==(stack.size()-1))) {
- debug_message(sb.toString());
- sb = new StringBuffer(" ");
- }
- }
- }
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** Perform a parse with debugging output. This does exactly the
- * same things as parse(), except that it calls debug_shift() and
- * debug_reduce() when shift and reduce moves are taken by the parser
- * and produces various other debugging messages.
- */
- public Symbol debug_parse()
- throws java.lang.Exception
- {
- /* the current action code */
- int act;
-
- /* the Symbol/stack element returned by a reduce */
- Symbol lhs_sym = null;
-
- /* information about production being reduced with */
- short handle_size, lhs_sym_num;
-
- /* set up direct reference to tables to drive the parser */
- production_tab = production_table();
- action_tab = action_table();
- reduce_tab = reduce_table();
-
- debug_message("# Initializing parser");
-
- /* initialize the action encapsulation object */
- init_actions();
-
- /* do user initialization */
- user_init();
-
- /* the current Symbol */
- cur_token = scan();
-
- debug_message("# Current Symbol is #" + cur_token.sym);
-
- /* push dummy Symbol with start state to get us underway */
- stack.removeAllElements();
- stack.push(new Symbol(0, start_state()));
- tos = 0;
-
- /* continue until we are told to stop */
- for (_done_parsing = false; !_done_parsing; )
- {
- /* Check current token for freshness. */
- if (cur_token.used_by_parser)
- throw new Error("Symbol recycling detected (fix your scanner).");
-
- /* current state is always on the top of the stack */
- //debug_stack();
-
- /* look up action out of the current state with the current input */
- act = get_action(((Symbol)stack.peek()).parse_state, cur_token.sym);
-
- /* decode the action -- > 0 encodes shift */
- if (act > 0)
- {
- /* shift to the encoded state by pushing it on the stack */
- cur_token.parse_state = act-1;
- cur_token.used_by_parser = true;
- debug_shift(cur_token);
- stack.push(cur_token);
- tos++;
-
- /* advance to the next Symbol */
- cur_token = scan();
- debug_message("# Current token is " + cur_token);
- }
- /* if its less than zero, then it encodes a reduce action */
- else if (act < 0)
- {
- /* perform the action for the reduce */
- lhs_sym = do_action((-act)-1, this, stack, tos);
-
- /* look up information about the production */
- lhs_sym_num = production_tab[(-act)-1][0];
- handle_size = production_tab[(-act)-1][1];
-
- debug_reduce((-act)-1, lhs_sym_num, handle_size);
-
- /* pop the handle off the stack */
- for (int i = 0; i < handle_size; i++)
- {
- stack.pop();
- tos--;
- }
-
- /* look up the state to go to from the one popped back to */
- act = get_reduce(((Symbol)stack.peek()).parse_state, lhs_sym_num);
- debug_message("# Reduce rule: top state " +
- ((Symbol)stack.peek()).parse_state +
- ", lhs sym " + lhs_sym_num + " -> state " + act);
-
- /* shift to that state */
- lhs_sym.parse_state = act;
- lhs_sym.used_by_parser = true;
- stack.push(lhs_sym);
- tos++;
-
- debug_message("# Goto state #" + act);
- }
- /* finally if the entry is zero, we have an error */
- else if (act == 0)
- {
- /* call user syntax error reporting routine */
- syntax_error(cur_token);
-
- /* try to error recover */
- if (!error_recovery(true))
- {
- /* if that fails give up with a fatal syntax error */
- unrecovered_syntax_error(cur_token);
-
- /* just in case that wasn't fatal enough, end parse */
- done_parsing();
- } else {
- lhs_sym = (Symbol)stack.peek();
- }
- }
- }
- return lhs_sym;
- }
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
- /* Error recovery code */
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** Attempt to recover from a syntax error. This returns false if recovery
- * fails, true if it succeeds. Recovery happens in 4 steps. First we
- * pop the parse stack down to a point at which we have a shift out
- * of the top-most state on the error Symbol. This represents the
- * initial error recovery configuration. If no such configuration is
- * found, then we fail. Next a small number of "lookahead" or "parse
- * ahead" Symbols are read into a buffer. The size of this buffer is
- * determined by error_sync_size() and determines how many Symbols beyond
- * the error must be matched to consider the recovery a success. Next,
- * we begin to discard Symbols in attempt to get past the point of error
- * to a point where we can continue parsing. After each Symbol, we attempt
- * to "parse ahead" though the buffered lookahead Symbols. The "parse ahead"
- * process simulates that actual parse, but does not modify the real
- * parser's configuration, nor execute any actions. If we can parse all
- * the stored Symbols without error, then the recovery is considered a
- * success. Once a successful recovery point is determined, we do an
- * actual parse over the stored input -- modifying the real parse
- * configuration and executing all actions. Finally, we return the the
- * normal parser to continue with the overall parse.
- *
- * @param debug should we produce debugging messages as we parse.
- */
- protected boolean error_recovery(boolean debug)
- throws java.lang.Exception
- {
- if (debug) debug_message("# Attempting error recovery");
-
- /* first pop the stack back into a state that can shift on error and
- do that shift (if that fails, we fail) */
- if (!find_recovery_config(debug))
- {
- if (debug) debug_message("# Error recovery fails");
- return false;
- }
-
- /* read ahead to create lookahead we can parse multiple times */
- read_lookahead();
-
- /* repeatedly try to parse forward until we make it the required dist */
- for (;;)
- {
- /* try to parse forward, if it makes it, bail out of loop */
- if (debug) debug_message("# Trying to parse ahead");
- if (try_parse_ahead(debug))
- {
- break;
- }
-
- /* if we are now at EOF, we have failed */
- if (lookahead[0].sym == EOF_sym())
- {
- if (debug) debug_message("# Error recovery fails at EOF");
- return false;
- }
-
- /* otherwise, we consume another Symbol and try again */
- if (debug)
- debug_message("# Consuming Symbol #" + cur_err_token().sym);
- restart_lookahead();
- }
-
- /* we have consumed to a point where we can parse forward */
- if (debug) debug_message("# Parse-ahead ok, going back to normal parse");
-
- /* do the real parse (including actions) across the lookahead */
- parse_lookahead(debug);
-
- /* we have success */
- return true;
- }
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** Determine if we can shift under the special error Symbol out of the
- * state currently on the top of the (real) parse stack.
- */
- protected boolean shift_under_error()
- {
- /* is there a shift under error Symbol */
- return get_action(((Symbol)stack.peek()).parse_state, error_sym()) > 0;
- }
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** Put the (real) parse stack into error recovery configuration by
- * popping the stack down to a state that can shift on the special
- * error Symbol, then doing the shift. If no suitable state exists on
- * the stack we return false
- *
- * @param debug should we produce debugging messages as we parse.
- */
- protected boolean find_recovery_config(boolean debug)
- {
- Symbol error_token;
- int act;
-
- if (debug) debug_message("# Finding recovery state on stack");
-
- /* Remember the right-position of the top symbol on the stack */
- int right_pos = ((Symbol)stack.peek()).right;
- int left_pos = ((Symbol)stack.peek()).left;
-
- /* pop down until we can shift under error Symbol */
- while (!shift_under_error())
- {
- /* pop the stack */
- if (debug)
- debug_message("# Pop stack by one, state was # " +
- ((Symbol)stack.peek()).parse_state);
- left_pos = ((Symbol)stack.pop()).left;
- tos--;
-
- /* if we have hit bottom, we fail */
- if (stack.empty())
- {
- if (debug) debug_message("# No recovery state found on stack");
- return false;
- }
- }
-
- /* state on top of the stack can shift under error, find the shift */
- act = get_action(((Symbol)stack.peek()).parse_state, error_sym());
- if (debug)
- {
- debug_message("# Recover state found (#" +
- ((Symbol)stack.peek()).parse_state + ")");
- debug_message("# Shifting on error to state #" + (act-1));
- }
-
- /* build and shift a special error Symbol */
- error_token = new Symbol(error_sym(), left_pos, right_pos);
- error_token.parse_state = act-1;
- error_token.used_by_parser = true;
- stack.push(error_token);
- tos++;
-
- return true;
- }
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** Lookahead Symbols used for attempting error recovery "parse aheads". */
- protected Symbol lookahead[];
-
- /** Position in lookahead input buffer used for "parse ahead". */
- protected int lookahead_pos;
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** Read from input to establish our buffer of "parse ahead" lookahead
- * Symbols.
- */
- protected void read_lookahead() throws java.lang.Exception
- {
- /* create the lookahead array */
- lookahead = new Symbol[error_sync_size()];
-
- /* fill in the array */
- for (int i = 0; i < error_sync_size(); i++)
- {
- lookahead[i] = cur_token;
- cur_token = scan();
- }
-
- /* start at the beginning */
- lookahead_pos = 0;
- }
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** Return the current lookahead in our error "parse ahead" buffer. */
- protected Symbol cur_err_token() { return lookahead[lookahead_pos]; }
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** Advance to next "parse ahead" input Symbol. Return true if we have
- * input to advance to, false otherwise.
- */
- protected boolean advance_lookahead()
- {
- /* advance the input location */
- lookahead_pos++;
-
- /* return true if we didn't go off the end */
- return lookahead_pos < error_sync_size();
- }
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** Reset the parse ahead input to one Symbol past where we started error
- * recovery (this consumes one new Symbol from the real input).
- */
- protected void restart_lookahead() throws java.lang.Exception
- {
- /* move all the existing input over */
- for (int i = 1; i < error_sync_size(); i++)
- lookahead[i-1] = lookahead[i];
-
- /* read a new Symbol into the last spot */
- cur_token = scan();
- lookahead[error_sync_size()-1] = cur_token;
-
- /* reset our internal position marker */
- lookahead_pos = 0;
- }
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** Do a simulated parse forward (a "parse ahead") from the current
- * stack configuration using stored lookahead input and a virtual parse
- * stack. Return true if we make it all the way through the stored
- * lookahead input without error. This basically simulates the action of
- * parse() using only our saved "parse ahead" input, and not executing any
- * actions.
- *
- * @param debug should we produce debugging messages as we parse.
- */
- protected boolean try_parse_ahead(boolean debug)
- throws java.lang.Exception
- {
- int act;
- short lhs, rhs_size;
-
- /* create a virtual stack from the real parse stack */
- virtual_parse_stack vstack = new virtual_parse_stack(stack);
-
- /* parse until we fail or get past the lookahead input */
- for (;;)
- {
- /* look up the action from the current state (on top of stack) */
- act = get_action(vstack.top(), cur_err_token().sym);
-
- /* if its an error, we fail */
- if (act == 0) return false;
-
- /* > 0 encodes a shift */
- if (act > 0)
- {
- /* push the new state on the stack */
- vstack.push(act-1);
-
- if (debug) debug_message("# Parse-ahead shifts Symbol #" +
- cur_err_token().sym + " into state #" + (act-1));
-
- /* advance simulated input, if we run off the end, we are done */
- if (!advance_lookahead()) return true;
- }
- /* < 0 encodes a reduce */
- else
- {
- /* if this is a reduce with the start production we are done */
- if ((-act)-1 == start_production())
- {
- if (debug) debug_message("# Parse-ahead accepts");
- return true;
- }
-
- /* get the lhs Symbol and the rhs size */
- lhs = production_tab[(-act)-1][0];
- rhs_size = production_tab[(-act)-1][1];
-
- /* pop handle off the stack */
- for (int i = 0; i < rhs_size; i++)
- vstack.pop();
-
- if (debug)
- debug_message("# Parse-ahead reduces: handle size = " +
- rhs_size + " lhs = #" + lhs + " from state #" + vstack.top());
-
- /* look up goto and push it onto the stack */
- vstack.push(get_reduce(vstack.top(), lhs));
- if (debug)
- debug_message("# Goto state #" + vstack.top());
- }
- }
- }
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** Parse forward using stored lookahead Symbols. In this case we have
- * already verified that parsing will make it through the stored lookahead
- * Symbols and we are now getting back to the point at which we can hand
- * control back to the normal parser. Consequently, this version of the
- * parser performs all actions and modifies the real parse configuration.
- * This returns once we have consumed all the stored input or we accept.
- *
- * @param debug should we produce debugging messages as we parse.
- */
- protected void parse_lookahead(boolean debug)
- throws java.lang.Exception
- {
- /* the current action code */
- int act;
-
- /* the Symbol/stack element returned by a reduce */
- Symbol lhs_sym = null;
-
- /* information about production being reduced with */
- short handle_size, lhs_sym_num;
-
- /* restart the saved input at the beginning */
- lookahead_pos = 0;
-
- if (debug)
- {
- debug_message("# Reparsing saved input with actions");
- debug_message("# Current Symbol is #" + cur_err_token().sym);
- debug_message("# Current state is #" +
- ((Symbol)stack.peek()).parse_state);
- }
-
- /* continue until we accept or have read all lookahead input */
- while(!_done_parsing)
- {
- /* current state is always on the top of the stack */
-
- /* look up action out of the current state with the current input */
- act =
- get_action(((Symbol)stack.peek()).parse_state, cur_err_token().sym);
-
- /* decode the action -- > 0 encodes shift */
- if (act > 0)
- {
- /* shift to the encoded state by pushing it on the stack */
- cur_err_token().parse_state = act-1;
- cur_err_token().used_by_parser = true;
- if (debug) debug_shift(cur_err_token());
- stack.push(cur_err_token());
- tos++;
-
- /* advance to the next Symbol, if there is none, we are done */
- if (!advance_lookahead())
- {
- if (debug) debug_message("# Completed reparse");
-
- /* scan next Symbol so we can continue parse */
- // BUGFIX by Chris Harris <ckharris@ucsd.edu>:
- // correct a one-off error by commenting out
- // this next line.
- /*cur_token = scan();*/
-
- /* go back to normal parser */
- return;
- }
-
- if (debug)
- debug_message("# Current Symbol is #" + cur_err_token().sym);
- }
- /* if its less than zero, then it encodes a reduce action */
- else if (act < 0)
- {
- /* perform the action for the reduce */
- lhs_sym = do_action((-act)-1, this, stack, tos);
-
- /* look up information about the production */
- lhs_sym_num = production_tab[(-act)-1][0];
- handle_size = production_tab[(-act)-1][1];
-
- if (debug) debug_reduce((-act)-1, lhs_sym_num, handle_size);
-
- /* pop the handle off the stack */
- for (int i = 0; i < handle_size; i++)
- {
- stack.pop();
- tos--;
- }
-
- /* look up the state to go to from the one popped back to */
- act = get_reduce(((Symbol)stack.peek()).parse_state, lhs_sym_num);
-
- /* shift to that state */
- lhs_sym.parse_state = act;
- lhs_sym.used_by_parser = true;
- stack.push(lhs_sym);
- tos++;
-
- if (debug) debug_message("# Goto state #" + act);
-
- }
- /* finally if the entry is zero, we have an error
- (shouldn't happen here, but...)*/
- else if (act == 0)
- {
- report_fatal_error("Syntax error", lhs_sym);
- return;
- }
- }
-
-
- }
-
- /*-----------------------------------------------------------*/
-
- /** Utility function: unpacks parse tables from strings */
- protected static short[][] unpackFromStrings(String[] sa)
- {
- // Concatanate initialization strings.
- StringBuffer sb = new StringBuffer(sa[0]);
- for (int i=1; i<sa.length; i++)
- sb.append(sa[i]);
- int n=0; // location in initialization string
- int size1 = (((int)sb.charAt(n))<<16) | ((int)sb.charAt(n+1)); n+=2;
- short[][] result = new short[size1][];
- for (int i=0; i<size1; i++) {
- int size2 = (((int)sb.charAt(n))<<16) | ((int)sb.charAt(n+1)); n+=2;
- result[i] = new short[size2];
- for (int j=0; j<size2; j++)
- result[i][j] = (short) (sb.charAt(n++)-2);
- }
- return result;
- }
-}
diff --git a/src/com/sun/java_cup/internal/runtime/virtual_parse_stack.java b/src/com/sun/java_cup/internal/runtime/virtual_parse_stack.java
deleted file mode 100644
index 93824c8..0000000
--- a/src/com/sun/java_cup/internal/runtime/virtual_parse_stack.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package com.sun.java_cup.internal.runtime;
-
-import java.util.Stack;
-
-/** This class implements a temporary or "virtual" parse stack that
- * replaces the top portion of the actual parse stack (the part that
- * has been changed by some set of operations) while maintaining its
- * original contents. This data structure is used when the parse needs
- * to "parse ahead" to determine if a given error recovery attempt will
- * allow the parse to continue far enough to consider it successful. Once
- * success or failure of parse ahead is determined the system then
- * reverts to the original parse stack (which has not actually been
- * modified). Since parse ahead does not execute actions, only parse
- * state is maintained on the virtual stack, not full Symbol objects.
- *
- * @see com.sun.java_cup.internal.runtime.lr_parser
- * @author Frank Flannery
- */
-
-public class virtual_parse_stack {
- /*-----------------------------------------------------------*/
- /*--- Constructor(s) ----------------------------------------*/
- /*-----------------------------------------------------------*/
-
- /** Constructor to build a virtual stack out of a real stack. */
- public virtual_parse_stack(Stack shadowing_stack) throws java.lang.Exception
- {
- /* sanity check */
- if (shadowing_stack == null)
- throw new Exception(
- "Internal parser error: attempt to create null virtual stack");
-
- /* set up our internals */
- real_stack = shadowing_stack;
- vstack = new Stack();
- real_next = 0;
-
- /* get one element onto the virtual portion of the stack */
- get_from_real();
- }
-
- /*-----------------------------------------------------------*/
- /*--- (Access to) Instance Variables ------------------------*/
- /*-----------------------------------------------------------*/
-
- /** The real stack that we shadow. This is accessed when we move off
- * the bottom of the virtual portion of the stack, but is always left
- * unmodified.
- */
- protected Stack real_stack;
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** Top of stack indicator for where we leave off in the real stack.
- * This is measured from top of stack, so 0 would indicate that no
- * elements have been "moved" from the real to virtual stack.
- */
- protected int real_next;
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** The virtual top portion of the stack. This stack contains Integer
- * objects with state numbers. This stack shadows the top portion
- * of the real stack within the area that has been modified (via operations
- * on the virtual stack). When this portion of the stack becomes empty we
- * transfer elements from the underlying stack onto this stack.
- */
- protected Stack vstack;
-
- /*-----------------------------------------------------------*/
- /*--- General Methods ---------------------------------------*/
- /*-----------------------------------------------------------*/
-
- /** Transfer an element from the real to the virtual stack. This assumes
- * that the virtual stack is currently empty.
- */
- protected void get_from_real()
- {
- Symbol stack_sym;
-
- /* don't transfer if the real stack is empty */
- if (real_next >= real_stack.size()) return;
-
- /* get a copy of the first Symbol we have not transfered */
- stack_sym = (Symbol)real_stack.elementAt(real_stack.size()-1-real_next);
-
- /* record the transfer */
- real_next++;
-
- /* put the state number from the Symbol onto the virtual stack */
- vstack.push(new Integer(stack_sym.parse_state));
- }
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** Indicate whether the stack is empty. */
- public boolean empty()
- {
- /* if vstack is empty then we were unable to transfer onto it and
- the whole thing is empty. */
- return vstack.empty();
- }
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** Return value on the top of the stack (without popping it). */
- public int top() throws java.lang.Exception
- {
- if (vstack.empty())
- throw new Exception(
- "Internal parser error: top() called on empty virtual stack");
-
- return ((Integer)vstack.peek()).intValue();
- }
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** Pop the stack. */
- public void pop() throws java.lang.Exception
- {
- if (vstack.empty())
- throw new Exception(
- "Internal parser error: pop from empty virtual stack");
-
- /* pop it */
- vstack.pop();
-
- /* if we are now empty transfer an element (if there is one) */
- if (vstack.empty())
- get_from_real();
- }
-
- /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
-
- /** Push a state number onto the stack. */
- public void push(int state_num)
- {
- vstack.push(new Integer(state_num));
- }
-
- /*-----------------------------------------------------------*/
-
-}
diff --git a/src/com/sun/org/apache/bcel/internal/Constants.java b/src/com/sun/org/apache/bcel/internal/Constants.java
deleted file mode 100644
index d7fc6bc..0000000
--- a/src/com/sun/org/apache/bcel/internal/Constants.java
+++ /dev/null
@@ -1,790 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * Constants for the project, mostly defined in the JVM specification.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public interface Constants {
- /** Major and minor version of the code.
- */
- public final static short MAJOR_1_1 = 45;
- public final static short MINOR_1_1 = 3;
- public final static short MAJOR_1_2 = 46;
- public final static short MINOR_1_2 = 0;
- public final static short MAJOR_1_3 = 47;
- public final static short MINOR_1_3 = 0;
- public final static short MAJOR = MAJOR_1_1; // Defaults
- public final static short MINOR = MINOR_1_1;
-
- /** Maximum value for an unsigned short.
- */
- public final static int MAX_SHORT = 65535; // 2^16 - 1
-
- /** Maximum value for an unsigned byte.
- */
- public final static int MAX_BYTE = 255; // 2^8 - 1
-
- /** Access flags for classes, fields and methods.
- */
- public final static short ACC_PUBLIC = 0x0001;
- public final static short ACC_PRIVATE = 0x0002;
- public final static short ACC_PROTECTED = 0x0004;
- public final static short ACC_STATIC = 0x0008;
-
- public final static short ACC_FINAL = 0x0010;
- public final static short ACC_SYNCHRONIZED = 0x0020;
- public final static short ACC_VOLATILE = 0x0040;
- public final static short ACC_TRANSIENT = 0x0080;
-
- public final static short ACC_NATIVE = 0x0100;
- public final static short ACC_INTERFACE = 0x0200;
- public final static short ACC_ABSTRACT = 0x0400;
- public final static short ACC_STRICT = 0x0800;
-
- // Applies to classes compiled by new compilers only
- public final static short ACC_SUPER = 0x0020;
-
- public final static short MAX_ACC_FLAG = ACC_STRICT;
-
- public final static String[] ACCESS_NAMES = {
- "public", "private", "protected", "static", "final", "synchronized",
- "volatile", "transient", "native", "interface", "abstract", "strictfp"
- };
-
- /** Tags in constant pool to denote type of constant.
- */
- public final static byte CONSTANT_Utf8 = 1;
- public final static byte CONSTANT_Integer = 3;
- public final static byte CONSTANT_Float = 4;
- public final static byte CONSTANT_Long = 5;
- public final static byte CONSTANT_Double = 6;
- public final static byte CONSTANT_Class = 7;
- public final static byte CONSTANT_Fieldref = 9;
- public final static byte CONSTANT_String = 8;
- public final static byte CONSTANT_Methodref = 10;
- public final static byte CONSTANT_InterfaceMethodref = 11;
- public final static byte CONSTANT_NameAndType = 12;
-
- public final static String[] CONSTANT_NAMES = {
- "", "CONSTANT_Utf8", "", "CONSTANT_Integer",
- "CONSTANT_Float", "CONSTANT_Long", "CONSTANT_Double",
- "CONSTANT_Class", "CONSTANT_String", "CONSTANT_Fieldref",
- "CONSTANT_Methodref", "CONSTANT_InterfaceMethodref",
- "CONSTANT_NameAndType" };
-
- /** The name of the static initializer, also called &quot;class
- * initialization method&quot; or &quot;interface initialization
- * method&quot;. This is &quot;&lt;clinit&gt;&quot;.
- */
- public final static String STATIC_INITIALIZER_NAME = "<clinit>";
-
- /** The name of every constructor method in a class, also called
- * &quot;instance initialization method&quot;. This is &quot;&lt;init&gt;&quot;.
- */
- public final static String CONSTRUCTOR_NAME = "<init>";
-
- /** The names of the interfaces implemented by arrays */
- public final static String[] INTERFACES_IMPLEMENTED_BY_ARRAYS = {"java.lang.Cloneable", "java.io.Serializable"};
-
- /**
- * Limitations of the Java Virtual Machine.
- * See The Java Virtual Machine Specification, Second Edition, page 152, chapter 4.10.
- */
- public static final int MAX_CP_ENTRIES = 65535;
- public static final int MAX_CODE_SIZE = 65536; //bytes
-
- /** Java VM opcodes.
- */
- public static final short NOP = 0;
- public static final short ACONST_NULL = 1;
- public static final short ICONST_M1 = 2;
- public static final short ICONST_0 = 3;
- public static final short ICONST_1 = 4;
- public static final short ICONST_2 = 5;
- public static final short ICONST_3 = 6;
- public static final short ICONST_4 = 7;
- public static final short ICONST_5 = 8;
- public static final short LCONST_0 = 9;
- public static final short LCONST_1 = 10;
- public static final short FCONST_0 = 11;
- public static final short FCONST_1 = 12;
- public static final short FCONST_2 = 13;
- public static final short DCONST_0 = 14;
- public static final short DCONST_1 = 15;
- public static final short BIPUSH = 16;
- public static final short SIPUSH = 17;
- public static final short LDC = 18;
- public static final short LDC_W = 19;
- public static final short LDC2_W = 20;
- public static final short ILOAD = 21;
- public static final short LLOAD = 22;
- public static final short FLOAD = 23;
- public static final short DLOAD = 24;
- public static final short ALOAD = 25;
- public static final short ILOAD_0 = 26;
- public static final short ILOAD_1 = 27;
- public static final short ILOAD_2 = 28;
- public static final short ILOAD_3 = 29;
- public static final short LLOAD_0 = 30;
- public static final short LLOAD_1 = 31;
- public static final short LLOAD_2 = 32;
- public static final short LLOAD_3 = 33;
- public static final short FLOAD_0 = 34;
- public static final short FLOAD_1 = 35;
- public static final short FLOAD_2 = 36;
- public static final short FLOAD_3 = 37;
- public static final short DLOAD_0 = 38;
- public static final short DLOAD_1 = 39;
- public static final short DLOAD_2 = 40;
- public static final short DLOAD_3 = 41;
- public static final short ALOAD_0 = 42;
- public static final short ALOAD_1 = 43;
- public static final short ALOAD_2 = 44;
- public static final short ALOAD_3 = 45;
- public static final short IALOAD = 46;
- public static final short LALOAD = 47;
- public static final short FALOAD = 48;
- public static final short DALOAD = 49;
- public static final short AALOAD = 50;
- public static final short BALOAD = 51;
- public static final short CALOAD = 52;
- public static final short SALOAD = 53;
- public static final short ISTORE = 54;
- public static final short LSTORE = 55;
- public static final short FSTORE = 56;
- public static final short DSTORE = 57;
- public static final short ASTORE = 58;
- public static final short ISTORE_0 = 59;
- public static final short ISTORE_1 = 60;
- public static final short ISTORE_2 = 61;
- public static final short ISTORE_3 = 62;
- public static final short LSTORE_0 = 63;
- public static final short LSTORE_1 = 64;
- public static final short LSTORE_2 = 65;
- public static final short LSTORE_3 = 66;
- public static final short FSTORE_0 = 67;
- public static final short FSTORE_1 = 68;
- public static final short FSTORE_2 = 69;
- public static final short FSTORE_3 = 70;
- public static final short DSTORE_0 = 71;
- public static final short DSTORE_1 = 72;
- public static final short DSTORE_2 = 73;
- public static final short DSTORE_3 = 74;
- public static final short ASTORE_0 = 75;
- public static final short ASTORE_1 = 76;
- public static final short ASTORE_2 = 77;
- public static final short ASTORE_3 = 78;
- public static final short IASTORE = 79;
- public static final short LASTORE = 80;
- public static final short FASTORE = 81;
- public static final short DASTORE = 82;
- public static final short AASTORE = 83;
- public static final short BASTORE = 84;
- public static final short CASTORE = 85;
- public static final short SASTORE = 86;
- public static final short POP = 87;
- public static final short POP2 = 88;
- public static final short DUP = 89;
- public static final short DUP_X1 = 90;
- public static final short DUP_X2 = 91;
- public static final short DUP2 = 92;
- public static final short DUP2_X1 = 93;
- public static final short DUP2_X2 = 94;
- public static final short SWAP = 95;
- public static final short IADD = 96;
- public static final short LADD = 97;
- public static final short FADD = 98;
- public static final short DADD = 99;
- public static final short ISUB = 100;
- public static final short LSUB = 101;
- public static final short FSUB = 102;
- public static final short DSUB = 103;
- public static final short IMUL = 104;
- public static final short LMUL = 105;
- public static final short FMUL = 106;
- public static final short DMUL = 107;
- public static final short IDIV = 108;
- public static final short LDIV = 109;
- public static final short FDIV = 110;
- public static final short DDIV = 111;
- public static final short IREM = 112;
- public static final short LREM = 113;
- public static final short FREM = 114;
- public static final short DREM = 115;
- public static final short INEG = 116;
- public static final short LNEG = 117;
- public static final short FNEG = 118;
- public static final short DNEG = 119;
- public static final short ISHL = 120;
- public static final short LSHL = 121;
- public static final short ISHR = 122;
- public static final short LSHR = 123;
- public static final short IUSHR = 124;
- public static final short LUSHR = 125;
- public static final short IAND = 126;
- public static final short LAND = 127;
- public static final short IOR = 128;
- public static final short LOR = 129;
- public static final short IXOR = 130;
- public static final short LXOR = 131;
- public static final short IINC = 132;
- public static final short I2L = 133;
- public static final short I2F = 134;
- public static final short I2D = 135;
- public static final short L2I = 136;
- public static final short L2F = 137;
- public static final short L2D = 138;
- public static final short F2I = 139;
- public static final short F2L = 140;
- public static final short F2D = 141;
- public static final short D2I = 142;
- public static final short D2L = 143;
- public static final short D2F = 144;
- public static final short I2B = 145;
- public static final short INT2BYTE = 145; // Old notion
- public static final short I2C = 146;
- public static final short INT2CHAR = 146; // Old notion
- public static final short I2S = 147;
- public static final short INT2SHORT = 147; // Old notion
- public static final short LCMP = 148;
- public static final short FCMPL = 149;
- public static final short FCMPG = 150;
- public static final short DCMPL = 151;
- public static final short DCMPG = 152;
- public static final short IFEQ = 153;
- public static final short IFNE = 154;
- public static final short IFLT = 155;
- public static final short IFGE = 156;
- public static final short IFGT = 157;
- public static final short IFLE = 158;
- public static final short IF_ICMPEQ = 159;
- public static final short IF_ICMPNE = 160;
- public static final short IF_ICMPLT = 161;
- public static final short IF_ICMPGE = 162;
- public static final short IF_ICMPGT = 163;
- public static final short IF_ICMPLE = 164;
- public static final short IF_ACMPEQ = 165;
- public static final short IF_ACMPNE = 166;
- public static final short GOTO = 167;
- public static final short JSR = 168;
- public static final short RET = 169;
- public static final short TABLESWITCH = 170;
- public static final short LOOKUPSWITCH = 171;
- public static final short IRETURN = 172;
- public static final short LRETURN = 173;
- public static final short FRETURN = 174;
- public static final short DRETURN = 175;
- public static final short ARETURN = 176;
- public static final short RETURN = 177;
- public static final short GETSTATIC = 178;
- public static final short PUTSTATIC = 179;
- public static final short GETFIELD = 180;
- public static final short PUTFIELD = 181;
- public static final short INVOKEVIRTUAL = 182;
- public static final short INVOKESPECIAL = 183;
- public static final short INVOKENONVIRTUAL = 183; // Old name in JDK 1.0
- public static final short INVOKESTATIC = 184;
- public static final short INVOKEINTERFACE = 185;
- public static final short NEW = 187;
- public static final short NEWARRAY = 188;
- public static final short ANEWARRAY = 189;
- public static final short ARRAYLENGTH = 190;
- public static final short ATHROW = 191;
- public static final short CHECKCAST = 192;
- public static final short INSTANCEOF = 193;
- public static final short MONITORENTER = 194;
- public static final short MONITOREXIT = 195;
- public static final short WIDE = 196;
- public static final short MULTIANEWARRAY = 197;
- public static final short IFNULL = 198;
- public static final short IFNONNULL = 199;
- public static final short GOTO_W = 200;
- public static final short JSR_W = 201;
-
- /**
- * Non-legal opcodes, may be used by JVM internally.
- */
- public static final short BREAKPOINT = 202;
- public static final short LDC_QUICK = 203;
- public static final short LDC_W_QUICK = 204;
- public static final short LDC2_W_QUICK = 205;
- public static final short GETFIELD_QUICK = 206;
- public static final short PUTFIELD_QUICK = 207;
- public static final short GETFIELD2_QUICK = 208;
- public static final short PUTFIELD2_QUICK = 209;
- public static final short GETSTATIC_QUICK = 210;
- public static final short PUTSTATIC_QUICK = 211;
- public static final short GETSTATIC2_QUICK = 212;
- public static final short PUTSTATIC2_QUICK = 213;
- public static final short INVOKEVIRTUAL_QUICK = 214;
- public static final short INVOKENONVIRTUAL_QUICK = 215;
- public static final short INVOKESUPER_QUICK = 216;
- public static final short INVOKESTATIC_QUICK = 217;
- public static final short INVOKEINTERFACE_QUICK = 218;
- public static final short INVOKEVIRTUALOBJECT_QUICK = 219;
- public static final short NEW_QUICK = 221;
- public static final short ANEWARRAY_QUICK = 222;
- public static final short MULTIANEWARRAY_QUICK = 223;
- public static final short CHECKCAST_QUICK = 224;
- public static final short INSTANCEOF_QUICK = 225;
- public static final short INVOKEVIRTUAL_QUICK_W = 226;
- public static final short GETFIELD_QUICK_W = 227;
- public static final short PUTFIELD_QUICK_W = 228;
- public static final short IMPDEP1 = 254;
- public static final short IMPDEP2 = 255;
-
- /**
- * For internal purposes only.
- */
- public static final short PUSH = 4711;
- public static final short SWITCH = 4712;
-
- /**
- * Illegal codes
- */
- public static final short UNDEFINED = -1;
- public static final short UNPREDICTABLE = -2;
- public static final short RESERVED = -3;
- public static final String ILLEGAL_OPCODE = "<illegal opcode>";
- public static final String ILLEGAL_TYPE = "<illegal type>";
-
- public static final byte T_BOOLEAN = 4;
- public static final byte T_CHAR = 5;
- public static final byte T_FLOAT = 6;
- public static final byte T_DOUBLE = 7;
- public static final byte T_BYTE = 8;
- public static final byte T_SHORT = 9;
- public static final byte T_INT = 10;
- public static final byte T_LONG = 11;
-
- public static final byte T_VOID = 12; // Non-standard
- public static final byte T_ARRAY = 13;
- public static final byte T_OBJECT = 14;
- public static final byte T_REFERENCE = 14; // Deprecated
- public static final byte T_UNKNOWN = 15;
- public static final byte T_ADDRESS = 16;
-
- /** The primitive type names corresponding to the T_XX constants,
- * e.g., TYPE_NAMES[T_INT] = "int"
- */
- public static final String[] TYPE_NAMES = {
- ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE,
- "boolean", "char", "float", "double", "byte", "short", "int", "long",
- "void", "array", "object", "unknown" // Non-standard
- };
-
- /** The primitive class names corresponding to the T_XX constants,
- * e.g., CLASS_TYPE_NAMES[T_INT] = "java.lang.Integer"
- */
- public static final String[] CLASS_TYPE_NAMES = {
- ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE,
- "java.lang.Boolean", "java.lang.Character", "java.lang.Float",
- "java.lang.Double", "java.lang.Byte", "java.lang.Short",
- "java.lang.Integer", "java.lang.Long", "java.lang.Void",
- ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE
- };
-
- /** The signature characters corresponding to primitive types,
- * e.g., SHORT_TYPE_NAMES[T_INT] = "I"
- */
- public static final String[] SHORT_TYPE_NAMES = {
- ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE,
- "Z", "C", "F", "D", "B", "S", "I", "J",
- "V", ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE
- };
-
- /**
- * Number of byte code operands, i.e., number of bytes after the tag byte
- * itself.
- */
- public static final short[] NO_OF_OPERANDS = {
- 0/*nop*/, 0/*aconst_null*/, 0/*iconst_m1*/, 0/*iconst_0*/,
- 0/*iconst_1*/, 0/*iconst_2*/, 0/*iconst_3*/, 0/*iconst_4*/,
- 0/*iconst_5*/, 0/*lconst_0*/, 0/*lconst_1*/, 0/*fconst_0*/,
- 0/*fconst_1*/, 0/*fconst_2*/, 0/*dconst_0*/, 0/*dconst_1*/,
- 1/*bipush*/, 2/*sipush*/, 1/*ldc*/, 2/*ldc_w*/, 2/*ldc2_w*/,
- 1/*iload*/, 1/*lload*/, 1/*fload*/, 1/*dload*/, 1/*aload*/,
- 0/*iload_0*/, 0/*iload_1*/, 0/*iload_2*/, 0/*iload_3*/,
- 0/*lload_0*/, 0/*lload_1*/, 0/*lload_2*/, 0/*lload_3*/,
- 0/*fload_0*/, 0/*fload_1*/, 0/*fload_2*/, 0/*fload_3*/,
- 0/*dload_0*/, 0/*dload_1*/, 0/*dload_2*/, 0/*dload_3*/,
- 0/*aload_0*/, 0/*aload_1*/, 0/*aload_2*/, 0/*aload_3*/,
- 0/*iaload*/, 0/*laload*/, 0/*faload*/, 0/*daload*/,
- 0/*aaload*/, 0/*baload*/, 0/*caload*/, 0/*saload*/,
- 1/*istore*/, 1/*lstore*/, 1/*fstore*/, 1/*dstore*/,
- 1/*astore*/, 0/*istore_0*/, 0/*istore_1*/, 0/*istore_2*/,
- 0/*istore_3*/, 0/*lstore_0*/, 0/*lstore_1*/, 0/*lstore_2*/,
- 0/*lstore_3*/, 0/*fstore_0*/, 0/*fstore_1*/, 0/*fstore_2*/,
- 0/*fstore_3*/, 0/*dstore_0*/, 0/*dstore_1*/, 0/*dstore_2*/,
- 0/*dstore_3*/, 0/*astore_0*/, 0/*astore_1*/, 0/*astore_2*/,
- 0/*astore_3*/, 0/*iastore*/, 0/*lastore*/, 0/*fastore*/,
- 0/*dastore*/, 0/*aastore*/, 0/*bastore*/, 0/*castore*/,
- 0/*sastore*/, 0/*pop*/, 0/*pop2*/, 0/*dup*/, 0/*dup_x1*/,
- 0/*dup_x2*/, 0/*dup2*/, 0/*dup2_x1*/, 0/*dup2_x2*/, 0/*swap*/,
- 0/*iadd*/, 0/*ladd*/, 0/*fadd*/, 0/*dadd*/, 0/*isub*/,
- 0/*lsub*/, 0/*fsub*/, 0/*dsub*/, 0/*imul*/, 0/*lmul*/,
- 0/*fmul*/, 0/*dmul*/, 0/*idiv*/, 0/*ldiv*/, 0/*fdiv*/,
- 0/*ddiv*/, 0/*irem*/, 0/*lrem*/, 0/*frem*/, 0/*drem*/,
- 0/*ineg*/, 0/*lneg*/, 0/*fneg*/, 0/*dneg*/, 0/*ishl*/,
- 0/*lshl*/, 0/*ishr*/, 0/*lshr*/, 0/*iushr*/, 0/*lushr*/,
- 0/*iand*/, 0/*land*/, 0/*ior*/, 0/*lor*/, 0/*ixor*/, 0/*lxor*/,
- 2/*iinc*/, 0/*i2l*/, 0/*i2f*/, 0/*i2d*/, 0/*l2i*/, 0/*l2f*/,
- 0/*l2d*/, 0/*f2i*/, 0/*f2l*/, 0/*f2d*/, 0/*d2i*/, 0/*d2l*/,
- 0/*d2f*/, 0/*i2b*/, 0/*i2c*/, 0/*i2s*/, 0/*lcmp*/, 0/*fcmpl*/,
- 0/*fcmpg*/, 0/*dcmpl*/, 0/*dcmpg*/, 2/*ifeq*/, 2/*ifne*/,
- 2/*iflt*/, 2/*ifge*/, 2/*ifgt*/, 2/*ifle*/, 2/*if_icmpeq*/,
- 2/*if_icmpne*/, 2/*if_icmplt*/, 2/*if_icmpge*/, 2/*if_icmpgt*/,
- 2/*if_icmple*/, 2/*if_acmpeq*/, 2/*if_acmpne*/, 2/*goto*/,
- 2/*jsr*/, 1/*ret*/, UNPREDICTABLE/*tableswitch*/, UNPREDICTABLE/*lookupswitch*/,
- 0/*ireturn*/, 0/*lreturn*/, 0/*freturn*/,
- 0/*dreturn*/, 0/*areturn*/, 0/*return*/,
- 2/*getstatic*/, 2/*putstatic*/, 2/*getfield*/,
- 2/*putfield*/, 2/*invokevirtual*/, 2/*invokespecial*/, 2/*invokestatic*/,
- 4/*invokeinterface*/, UNDEFINED, 2/*new*/,
- 1/*newarray*/, 2/*anewarray*/,
- 0/*arraylength*/, 0/*athrow*/, 2/*checkcast*/,
- 2/*instanceof*/, 0/*monitorenter*/,
- 0/*monitorexit*/, UNPREDICTABLE/*wide*/, 3/*multianewarray*/,
- 2/*ifnull*/, 2/*ifnonnull*/, 4/*goto_w*/,
- 4/*jsr_w*/, 0/*breakpoint*/, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, RESERVED/*impdep1*/, RESERVED/*impdep2*/
- };
-
- /**
- * How the byte code operands are to be interpreted.
- */
- public static final short[][] TYPE_OF_OPERANDS = {
- {}/*nop*/, {}/*aconst_null*/, {}/*iconst_m1*/, {}/*iconst_0*/,
- {}/*iconst_1*/, {}/*iconst_2*/, {}/*iconst_3*/, {}/*iconst_4*/,
- {}/*iconst_5*/, {}/*lconst_0*/, {}/*lconst_1*/, {}/*fconst_0*/,
- {}/*fconst_1*/, {}/*fconst_2*/, {}/*dconst_0*/, {}/*dconst_1*/,
- {T_BYTE}/*bipush*/, {T_SHORT}/*sipush*/, {T_BYTE}/*ldc*/,
- {T_SHORT}/*ldc_w*/, {T_SHORT}/*ldc2_w*/,
- {T_BYTE}/*iload*/, {T_BYTE}/*lload*/, {T_BYTE}/*fload*/,
- {T_BYTE}/*dload*/, {T_BYTE}/*aload*/, {}/*iload_0*/,
- {}/*iload_1*/, {}/*iload_2*/, {}/*iload_3*/, {}/*lload_0*/,
- {}/*lload_1*/, {}/*lload_2*/, {}/*lload_3*/, {}/*fload_0*/,
- {}/*fload_1*/, {}/*fload_2*/, {}/*fload_3*/, {}/*dload_0*/,
- {}/*dload_1*/, {}/*dload_2*/, {}/*dload_3*/, {}/*aload_0*/,
- {}/*aload_1*/, {}/*aload_2*/, {}/*aload_3*/, {}/*iaload*/,
- {}/*laload*/, {}/*faload*/, {}/*daload*/, {}/*aaload*/,
- {}/*baload*/, {}/*caload*/, {}/*saload*/, {T_BYTE}/*istore*/,
- {T_BYTE}/*lstore*/, {T_BYTE}/*fstore*/, {T_BYTE}/*dstore*/,
- {T_BYTE}/*astore*/, {}/*istore_0*/, {}/*istore_1*/,
- {}/*istore_2*/, {}/*istore_3*/, {}/*lstore_0*/, {}/*lstore_1*/,
- {}/*lstore_2*/, {}/*lstore_3*/, {}/*fstore_0*/, {}/*fstore_1*/,
- {}/*fstore_2*/, {}/*fstore_3*/, {}/*dstore_0*/, {}/*dstore_1*/,
- {}/*dstore_2*/, {}/*dstore_3*/, {}/*astore_0*/, {}/*astore_1*/,
- {}/*astore_2*/, {}/*astore_3*/, {}/*iastore*/, {}/*lastore*/,
- {}/*fastore*/, {}/*dastore*/, {}/*aastore*/, {}/*bastore*/,
- {}/*castore*/, {}/*sastore*/, {}/*pop*/, {}/*pop2*/, {}/*dup*/,
- {}/*dup_x1*/, {}/*dup_x2*/, {}/*dup2*/, {}/*dup2_x1*/,
- {}/*dup2_x2*/, {}/*swap*/, {}/*iadd*/, {}/*ladd*/, {}/*fadd*/,
- {}/*dadd*/, {}/*isub*/, {}/*lsub*/, {}/*fsub*/, {}/*dsub*/,
- {}/*imul*/, {}/*lmul*/, {}/*fmul*/, {}/*dmul*/, {}/*idiv*/,
- {}/*ldiv*/, {}/*fdiv*/, {}/*ddiv*/, {}/*irem*/, {}/*lrem*/,
- {}/*frem*/, {}/*drem*/, {}/*ineg*/, {}/*lneg*/, {}/*fneg*/,
- {}/*dneg*/, {}/*ishl*/, {}/*lshl*/, {}/*ishr*/, {}/*lshr*/,
- {}/*iushr*/, {}/*lushr*/, {}/*iand*/, {}/*land*/, {}/*ior*/,
- {}/*lor*/, {}/*ixor*/, {}/*lxor*/, {T_BYTE, T_BYTE}/*iinc*/,
- {}/*i2l*/, {}/*i2f*/, {}/*i2d*/, {}/*l2i*/, {}/*l2f*/, {}/*l2d*/,
- {}/*f2i*/, {}/*f2l*/, {}/*f2d*/, {}/*d2i*/, {}/*d2l*/, {}/*d2f*/,
- {}/*i2b*/, {}/*i2c*/,{}/*i2s*/, {}/*lcmp*/, {}/*fcmpl*/,
- {}/*fcmpg*/, {}/*dcmpl*/, {}/*dcmpg*/, {T_SHORT}/*ifeq*/,
- {T_SHORT}/*ifne*/, {T_SHORT}/*iflt*/, {T_SHORT}/*ifge*/,
- {T_SHORT}/*ifgt*/, {T_SHORT}/*ifle*/, {T_SHORT}/*if_icmpeq*/,
- {T_SHORT}/*if_icmpne*/, {T_SHORT}/*if_icmplt*/,
- {T_SHORT}/*if_icmpge*/, {T_SHORT}/*if_icmpgt*/,
- {T_SHORT}/*if_icmple*/, {T_SHORT}/*if_acmpeq*/,
- {T_SHORT}/*if_acmpne*/, {T_SHORT}/*goto*/, {T_SHORT}/*jsr*/,
- {T_BYTE}/*ret*/, {}/*tableswitch*/, {}/*lookupswitch*/,
- {}/*ireturn*/, {}/*lreturn*/, {}/*freturn*/, {}/*dreturn*/,
- {}/*areturn*/, {}/*return*/, {T_SHORT}/*getstatic*/,
- {T_SHORT}/*putstatic*/, {T_SHORT}/*getfield*/,
- {T_SHORT}/*putfield*/, {T_SHORT}/*invokevirtual*/,
- {T_SHORT}/*invokespecial*/, {T_SHORT}/*invokestatic*/,
- {T_SHORT, T_BYTE, T_BYTE}/*invokeinterface*/, {},
- {T_SHORT}/*new*/, {T_BYTE}/*newarray*/,
- {T_SHORT}/*anewarray*/, {}/*arraylength*/, {}/*athrow*/,
- {T_SHORT}/*checkcast*/, {T_SHORT}/*instanceof*/,
- {}/*monitorenter*/, {}/*monitorexit*/, {T_BYTE}/*wide*/,
- {T_SHORT, T_BYTE}/*multianewarray*/, {T_SHORT}/*ifnull*/,
- {T_SHORT}/*ifnonnull*/, {T_INT}/*goto_w*/, {T_INT}/*jsr_w*/,
- {}/*breakpoint*/, {}, {}, {}, {}, {}, {}, {},
- {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {},
- {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {},
- {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {},
- {}/*impdep1*/, {}/*impdep2*/
- };
-
- /**
- * Names of opcodes.
- */
- public static final String[] OPCODE_NAMES = {
- "nop", "aconst_null", "iconst_m1", "iconst_0", "iconst_1",
- "iconst_2", "iconst_3", "iconst_4", "iconst_5", "lconst_0",
- "lconst_1", "fconst_0", "fconst_1", "fconst_2", "dconst_0",
- "dconst_1", "bipush", "sipush", "ldc", "ldc_w", "ldc2_w", "iload",
- "lload", "fload", "dload", "aload", "iload_0", "iload_1", "iload_2",
- "iload_3", "lload_0", "lload_1", "lload_2", "lload_3", "fload_0",
- "fload_1", "fload_2", "fload_3", "dload_0", "dload_1", "dload_2",
- "dload_3", "aload_0", "aload_1", "aload_2", "aload_3", "iaload",
- "laload", "faload", "daload", "aaload", "baload", "caload", "saload",
- "istore", "lstore", "fstore", "dstore", "astore", "istore_0",
- "istore_1", "istore_2", "istore_3", "lstore_0", "lstore_1",
- "lstore_2", "lstore_3", "fstore_0", "fstore_1", "fstore_2",
- "fstore_3", "dstore_0", "dstore_1", "dstore_2", "dstore_3",
- "astore_0", "astore_1", "astore_2", "astore_3", "iastore", "lastore",
- "fastore", "dastore", "aastore", "bastore", "castore", "sastore",
- "pop", "pop2", "dup", "dup_x1", "dup_x2", "dup2", "dup2_x1",
- "dup2_x2", "swap", "iadd", "ladd", "fadd", "dadd", "isub", "lsub",
- "fsub", "dsub", "imul", "lmul", "fmul", "dmul", "idiv", "ldiv",
- "fdiv", "ddiv", "irem", "lrem", "frem", "drem", "ineg", "lneg",
- "fneg", "dneg", "ishl", "lshl", "ishr", "lshr", "iushr", "lushr",
- "iand", "land", "ior", "lor", "ixor", "lxor", "iinc", "i2l", "i2f",
- "i2d", "l2i", "l2f", "l2d", "f2i", "f2l", "f2d", "d2i", "d2l", "d2f",
- "i2b", "i2c", "i2s", "lcmp", "fcmpl", "fcmpg",
- "dcmpl", "dcmpg", "ifeq", "ifne", "iflt", "ifge", "ifgt", "ifle",
- "if_icmpeq", "if_icmpne", "if_icmplt", "if_icmpge", "if_icmpgt",
- "if_icmple", "if_acmpeq", "if_acmpne", "goto", "jsr", "ret",
- "tableswitch", "lookupswitch", "ireturn", "lreturn", "freturn",
- "dreturn", "areturn", "return", "getstatic", "putstatic", "getfield",
- "putfield", "invokevirtual", "invokespecial", "invokestatic",
- "invokeinterface", ILLEGAL_OPCODE, "new", "newarray", "anewarray",
- "arraylength", "athrow", "checkcast", "instanceof", "monitorenter",
- "monitorexit", "wide", "multianewarray", "ifnull", "ifnonnull",
- "goto_w", "jsr_w", "breakpoint", ILLEGAL_OPCODE, ILLEGAL_OPCODE,
- ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
- ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
- ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
- ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
- ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
- ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
- ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
- ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
- ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
- ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
- ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
- ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
- ILLEGAL_OPCODE, "impdep1", "impdep2"
- };
-
- /**
- * Number of words consumed on operand stack by instructions.
- */
- public static final int[] CONSUME_STACK = {
- 0/*nop*/, 0/*aconst_null*/, 0/*iconst_m1*/, 0/*iconst_0*/, 0/*iconst_1*/,
- 0/*iconst_2*/, 0/*iconst_3*/, 0/*iconst_4*/, 0/*iconst_5*/, 0/*lconst_0*/,
- 0/*lconst_1*/, 0/*fconst_0*/, 0/*fconst_1*/, 0/*fconst_2*/, 0/*dconst_0*/,
- 0/*dconst_1*/, 0/*bipush*/, 0/*sipush*/, 0/*ldc*/, 0/*ldc_w*/, 0/*ldc2_w*/, 0/*iload*/,
- 0/*lload*/, 0/*fload*/, 0/*dload*/, 0/*aload*/, 0/*iload_0*/, 0/*iload_1*/, 0/*iload_2*/,
- 0/*iload_3*/, 0/*lload_0*/, 0/*lload_1*/, 0/*lload_2*/, 0/*lload_3*/, 0/*fload_0*/,
- 0/*fload_1*/, 0/*fload_2*/, 0/*fload_3*/, 0/*dload_0*/, 0/*dload_1*/, 0/*dload_2*/,
- 0/*dload_3*/, 0/*aload_0*/, 0/*aload_1*/, 0/*aload_2*/, 0/*aload_3*/, 2/*iaload*/,
- 2/*laload*/, 2/*faload*/, 2/*daload*/, 2/*aaload*/, 2/*baload*/, 2/*caload*/, 2/*saload*/,
- 1/*istore*/, 2/*lstore*/, 1/*fstore*/, 2/*dstore*/, 1/*astore*/, 1/*istore_0*/,
- 1/*istore_1*/, 1/*istore_2*/, 1/*istore_3*/, 2/*lstore_0*/, 2/*lstore_1*/,
- 2/*lstore_2*/, 2/*lstore_3*/, 1/*fstore_0*/, 1/*fstore_1*/, 1/*fstore_2*/,
- 1/*fstore_3*/, 2/*dstore_0*/, 2/*dstore_1*/, 2/*dstore_2*/, 2/*dstore_3*/,
- 1/*astore_0*/, 1/*astore_1*/, 1/*astore_2*/, 1/*astore_3*/, 3/*iastore*/, 4/*lastore*/,
- 3/*fastore*/, 4/*dastore*/, 3/*aastore*/, 3/*bastore*/, 3/*castore*/, 3/*sastore*/,
- 1/*pop*/, 2/*pop2*/, 1/*dup*/, 2/*dup_x1*/, 3/*dup_x2*/, 2/*dup2*/, 3/*dup2_x1*/,
- 4/*dup2_x2*/, 2/*swap*/, 2/*iadd*/, 4/*ladd*/, 2/*fadd*/, 4/*dadd*/, 2/*isub*/, 4/*lsub*/,
- 2/*fsub*/, 4/*dsub*/, 2/*imul*/, 4/*lmul*/, 2/*fmul*/, 4/*dmul*/, 2/*idiv*/, 4/*ldiv*/,
- 2/*fdiv*/, 4/*ddiv*/, 2/*irem*/, 4/*lrem*/, 2/*frem*/, 4/*drem*/, 1/*ineg*/, 2/*lneg*/,
- 1/*fneg*/, 2/*dneg*/, 2/*ishl*/, 3/*lshl*/, 2/*ishr*/, 3/*lshr*/, 2/*iushr*/, 3/*lushr*/,
- 2/*iand*/, 4/*land*/, 2/*ior*/, 4/*lor*/, 2/*ixor*/, 4/*lxor*/, 0/*iinc*/,
- 1/*i2l*/, 1/*i2f*/, 1/*i2d*/, 2/*l2i*/, 2/*l2f*/, 2/*l2d*/, 1/*f2i*/, 1/*f2l*/,
- 1/*f2d*/, 2/*d2i*/, 2/*d2l*/, 2/*d2f*/, 1/*i2b*/, 1/*i2c*/, 1/*i2s*/,
- 4/*lcmp*/, 2/*fcmpl*/, 2/*fcmpg*/, 4/*dcmpl*/, 4/*dcmpg*/, 1/*ifeq*/, 1/*ifne*/,
- 1/*iflt*/, 1/*ifge*/, 1/*ifgt*/, 1/*ifle*/, 2/*if_icmpeq*/, 2/*if_icmpne*/, 2/*if_icmplt*/,
- 2 /*if_icmpge*/, 2/*if_icmpgt*/, 2/*if_icmple*/, 2/*if_acmpeq*/, 2/*if_acmpne*/,
- 0/*goto*/, 0/*jsr*/, 0/*ret*/, 1/*tableswitch*/, 1/*lookupswitch*/, 1/*ireturn*/,
- 2/*lreturn*/, 1/*freturn*/, 2/*dreturn*/, 1/*areturn*/, 0/*return*/, 0/*getstatic*/,
- UNPREDICTABLE/*putstatic*/, 1/*getfield*/, UNPREDICTABLE/*putfield*/,
- UNPREDICTABLE/*invokevirtual*/, UNPREDICTABLE/*invokespecial*/,
- UNPREDICTABLE/*invokestatic*/,
- UNPREDICTABLE/*invokeinterface*/, UNDEFINED, 0/*new*/, 1/*newarray*/, 1/*anewarray*/,
- 1/*arraylength*/, 1/*athrow*/, 1/*checkcast*/, 1/*instanceof*/, 1/*monitorenter*/,
- 1/*monitorexit*/, 0/*wide*/, UNPREDICTABLE/*multianewarray*/, 1/*ifnull*/, 1/*ifnonnull*/,
- 0/*goto_w*/, 0/*jsr_w*/, 0/*breakpoint*/, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNPREDICTABLE/*impdep1*/, UNPREDICTABLE/*impdep2*/
- };
-
- /**
- * Number of words produced onto operand stack by instructions.
- */
- public static final int[] PRODUCE_STACK = {
- 0/*nop*/, 1/*aconst_null*/, 1/*iconst_m1*/, 1/*iconst_0*/, 1/*iconst_1*/,
- 1/*iconst_2*/, 1/*iconst_3*/, 1/*iconst_4*/, 1/*iconst_5*/, 2/*lconst_0*/,
- 2/*lconst_1*/, 1/*fconst_0*/, 1/*fconst_1*/, 1/*fconst_2*/, 2/*dconst_0*/,
- 2/*dconst_1*/, 1/*bipush*/, 1/*sipush*/, 1/*ldc*/, 1/*ldc_w*/, 2/*ldc2_w*/, 1/*iload*/,
- 2/*lload*/, 1/*fload*/, 2/*dload*/, 1/*aload*/, 1/*iload_0*/, 1/*iload_1*/, 1/*iload_2*/,
- 1/*iload_3*/, 2/*lload_0*/, 2/*lload_1*/, 2/*lload_2*/, 2/*lload_3*/, 1/*fload_0*/,
- 1/*fload_1*/, 1/*fload_2*/, 1/*fload_3*/, 2/*dload_0*/, 2/*dload_1*/, 2/*dload_2*/,
- 2/*dload_3*/, 1/*aload_0*/, 1/*aload_1*/, 1/*aload_2*/, 1/*aload_3*/, 1/*iaload*/,
- 2/*laload*/, 1/*faload*/, 2/*daload*/, 1/*aaload*/, 1/*baload*/, 1/*caload*/, 1/*saload*/,
- 0/*istore*/, 0/*lstore*/, 0/*fstore*/, 0/*dstore*/, 0/*astore*/, 0/*istore_0*/,
- 0/*istore_1*/, 0/*istore_2*/, 0/*istore_3*/, 0/*lstore_0*/, 0/*lstore_1*/,
- 0/*lstore_2*/, 0/*lstore_3*/, 0/*fstore_0*/, 0/*fstore_1*/, 0/*fstore_2*/,
- 0/*fstore_3*/, 0/*dstore_0*/, 0/*dstore_1*/, 0/*dstore_2*/, 0/*dstore_3*/,
- 0/*astore_0*/, 0/*astore_1*/, 0/*astore_2*/, 0/*astore_3*/, 0/*iastore*/, 0/*lastore*/,
- 0/*fastore*/, 0/*dastore*/, 0/*aastore*/, 0/*bastore*/, 0/*castore*/, 0/*sastore*/,
- 0/*pop*/, 0/*pop2*/, 2/*dup*/, 3/*dup_x1*/, 4/*dup_x2*/, 4/*dup2*/, 5/*dup2_x1*/,
- 6/*dup2_x2*/, 2/*swap*/, 1/*iadd*/, 2/*ladd*/, 1/*fadd*/, 2/*dadd*/, 1/*isub*/, 2/*lsub*/,
- 1/*fsub*/, 2/*dsub*/, 1/*imul*/, 2/*lmul*/, 1/*fmul*/, 2/*dmul*/, 1/*idiv*/, 2/*ldiv*/,
- 1/*fdiv*/, 2/*ddiv*/, 1/*irem*/, 2/*lrem*/, 1/*frem*/, 2/*drem*/, 1/*ineg*/, 2/*lneg*/,
- 1/*fneg*/, 2/*dneg*/, 1/*ishl*/, 2/*lshl*/, 1/*ishr*/, 2/*lshr*/, 1/*iushr*/, 2/*lushr*/,
- 1/*iand*/, 2/*land*/, 1/*ior*/, 2/*lor*/, 1/*ixor*/, 2/*lxor*/,
- 0/*iinc*/, 2/*i2l*/, 1/*i2f*/, 2/*i2d*/, 1/*l2i*/, 1/*l2f*/, 2/*l2d*/, 1/*f2i*/,
- 2/*f2l*/, 2/*f2d*/, 1/*d2i*/, 2/*d2l*/, 1/*d2f*/,
- 1/*i2b*/, 1/*i2c*/, 1/*i2s*/, 1/*lcmp*/, 1/*fcmpl*/, 1/*fcmpg*/,
- 1/*dcmpl*/, 1/*dcmpg*/, 0/*ifeq*/, 0/*ifne*/, 0/*iflt*/, 0/*ifge*/, 0/*ifgt*/, 0/*ifle*/,
- 0/*if_icmpeq*/, 0/*if_icmpne*/, 0/*if_icmplt*/, 0/*if_icmpge*/, 0/*if_icmpgt*/,
- 0/*if_icmple*/, 0/*if_acmpeq*/, 0/*if_acmpne*/, 0/*goto*/, 1/*jsr*/, 0/*ret*/,
- 0/*tableswitch*/, 0/*lookupswitch*/, 0/*ireturn*/, 0/*lreturn*/, 0/*freturn*/,
- 0/*dreturn*/, 0/*areturn*/, 0/*return*/, UNPREDICTABLE/*getstatic*/, 0/*putstatic*/,
- UNPREDICTABLE/*getfield*/, 0/*putfield*/, UNPREDICTABLE/*invokevirtual*/,
- UNPREDICTABLE/*invokespecial*/, UNPREDICTABLE/*invokestatic*/,
- UNPREDICTABLE/*invokeinterface*/, UNDEFINED, 1/*new*/, 1/*newarray*/, 1/*anewarray*/,
- 1/*arraylength*/, 1/*athrow*/, 1/*checkcast*/, 1/*instanceof*/, 0/*monitorenter*/,
- 0/*monitorexit*/, 0/*wide*/, 1/*multianewarray*/, 0/*ifnull*/, 0/*ifnonnull*/,
- 0/*goto_w*/, 1/*jsr_w*/, 0/*breakpoint*/, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
- UNDEFINED, UNPREDICTABLE/*impdep1*/, UNPREDICTABLE/*impdep2*/
- };
-
- /** Attributes and their corresponding names.
- */
- public static final byte ATTR_UNKNOWN = -1;
- public static final byte ATTR_SOURCE_FILE = 0;
- public static final byte ATTR_CONSTANT_VALUE = 1;
- public static final byte ATTR_CODE = 2;
- public static final byte ATTR_EXCEPTIONS = 3;
- public static final byte ATTR_LINE_NUMBER_TABLE = 4;
- public static final byte ATTR_LOCAL_VARIABLE_TABLE = 5;
- public static final byte ATTR_INNER_CLASSES = 6;
- public static final byte ATTR_SYNTHETIC = 7;
- public static final byte ATTR_DEPRECATED = 8;
- public static final byte ATTR_PMG = 9;
- public static final byte ATTR_SIGNATURE = 10;
- public static final byte ATTR_STACK_MAP = 11;
- public static final byte ATTR_LOCAL_VARIABLE_TYPE_TABLE = 12;
-
- public static final short KNOWN_ATTRIBUTES = 13;
-
- public static final String[] ATTRIBUTE_NAMES = {
- "SourceFile", "ConstantValue", "Code", "Exceptions",
- "LineNumberTable", "LocalVariableTable",
- "InnerClasses", "Synthetic", "Deprecated",
- "PMGClass", "Signature", "StackMap",
- "LocalVariableTypeTable"
- };
-
- /** Constants used in the StackMap attribute.
- */
- public static final byte ITEM_Bogus = 0;
- public static final byte ITEM_Integer = 1;
- public static final byte ITEM_Float = 2;
- public static final byte ITEM_Double = 3;
- public static final byte ITEM_Long = 4;
- public static final byte ITEM_Null = 5;
- public static final byte ITEM_InitObject = 6;
- public static final byte ITEM_Object = 7;
- public static final byte ITEM_NewObject = 8;
-
- public static final String[] ITEM_NAMES = {
- "Bogus", "Integer", "Float", "Double", "Long",
- "Null", "InitObject", "Object", "NewObject"
- };
-}
diff --git a/src/com/sun/org/apache/bcel/internal/ExceptionConstants.java b/src/com/sun/org/apache/bcel/internal/ExceptionConstants.java
deleted file mode 100644
index 8fd3204..0000000
--- a/src/com/sun/org/apache/bcel/internal/ExceptionConstants.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * Exception constants.
- *
- * @author <A HREF="http://www.inf.fu-berlin.de/~ehaase">E. Haase</A>
- */
-public interface ExceptionConstants {
- /** The mother of all exceptions
- */
- public static final Class THROWABLE = Throwable.class;
-
- /** Super class of any run-time exception
- */
- public static final Class RUNTIME_EXCEPTION = RuntimeException.class;
-
- /** Super class of any linking exception (aka Linkage Error)
- */
- public static final Class LINKING_EXCEPTION = LinkageError.class;
-
- /** Linking Exceptions
- */
- public static final Class CLASS_CIRCULARITY_ERROR = ClassCircularityError.class;
- public static final Class CLASS_FORMAT_ERROR = ClassFormatError.class;
- public static final Class EXCEPTION_IN_INITIALIZER_ERROR = ExceptionInInitializerError.class;
- public static final Class INCOMPATIBLE_CLASS_CHANGE_ERROR = IncompatibleClassChangeError.class;
- public static final Class ABSTRACT_METHOD_ERROR = AbstractMethodError.class;
- public static final Class ILLEGAL_ACCESS_ERROR = IllegalAccessError.class;
- public static final Class INSTANTIATION_ERROR = InstantiationError.class;
- public static final Class NO_SUCH_FIELD_ERROR = NoSuchFieldError.class;
- public static final Class NO_SUCH_METHOD_ERROR = NoSuchMethodError.class;
- public static final Class NO_CLASS_DEF_FOUND_ERROR = NoClassDefFoundError.class;
- public static final Class UNSATISFIED_LINK_ERROR = UnsatisfiedLinkError.class;
- public static final Class VERIFY_ERROR = VerifyError.class;
-
- /* UnsupportedClassVersionError is new in JDK 1.2 */
- //public static final Class UnsupportedClassVersionError = UnsupportedClassVersionError.class;
-
- /** Run-Time Exceptions
- */
- public static final Class NULL_POINTER_EXCEPTION = NullPointerException.class;
- public static final Class ARRAY_INDEX_OUT_OF_BOUNDS_EXCEPTION = ArrayIndexOutOfBoundsException.class;
- public static final Class ARITHMETIC_EXCEPTION = ArithmeticException.class;
- public static final Class NEGATIVE_ARRAY_SIZE_EXCEPTION = NegativeArraySizeException.class;
- public static final Class CLASS_CAST_EXCEPTION = ClassCastException.class;
- public static final Class ILLEGAL_MONITOR_STATE = IllegalMonitorStateException.class;
-
- /** Pre-defined exception arrays according to chapters 5.1-5.4 of the Java Virtual
- * Machine Specification
- */
- public static final Class[] EXCS_CLASS_AND_INTERFACE_RESOLUTION = {
- NO_CLASS_DEF_FOUND_ERROR, CLASS_FORMAT_ERROR, VERIFY_ERROR, ABSTRACT_METHOD_ERROR,
- EXCEPTION_IN_INITIALIZER_ERROR, ILLEGAL_ACCESS_ERROR
- }; // Chapter 5.1
-
- public static final Class[] EXCS_FIELD_AND_METHOD_RESOLUTION = {
- NO_SUCH_FIELD_ERROR, ILLEGAL_ACCESS_ERROR, NO_SUCH_METHOD_ERROR
- }; // Chapter 5.2
-
- public static final Class[] EXCS_INTERFACE_METHOD_RESOLUTION = new Class[0]; // Chapter 5.3 (as below)
- public static final Class[] EXCS_STRING_RESOLUTION = new Class[0];
- // Chapter 5.4 (no errors but the ones that _always_ could happen! How stupid.)
-
- public static final Class[] EXCS_ARRAY_EXCEPTION = {
- NULL_POINTER_EXCEPTION, ARRAY_INDEX_OUT_OF_BOUNDS_EXCEPTION
- };
-
-}
diff --git a/src/com/sun/org/apache/bcel/internal/Repository.java b/src/com/sun/org/apache/bcel/internal/Repository.java
deleted file mode 100644
index ca7c65a..0000000
--- a/src/com/sun/org/apache/bcel/internal/Repository.java
+++ /dev/null
@@ -1,250 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.classfile.JavaClass;
-import com.sun.org.apache.bcel.internal.util.*;
-import java.io.*;
-
-/**
- * The repository maintains informations about class interdependencies, e.g.,
- * whether a class is a sub-class of another. Delegates actual class loading
- * to SyntheticRepository with current class path by default.
- *
- * @see com.sun.org.apache.bcel.internal.util.Repository
- * @see com.sun.org.apache.bcel.internal.util.SyntheticRepository
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public abstract class Repository {
- private static com.sun.org.apache.bcel.internal.util.Repository _repository =
- SyntheticRepository.getInstance();
-
- /** @return currently used repository instance
- */
- public static com.sun.org.apache.bcel.internal.util.Repository getRepository() {
- return _repository;
- }
-
- /** Set repository instance to be used for class loading
- */
- public static void setRepository(com.sun.org.apache.bcel.internal.util.Repository rep) {
- _repository = rep;
- }
-
- /** Lookup class somewhere found on your CLASSPATH, or whereever the
- * repository instance looks for it.
- *
- * @return class object for given fully qualified class name, or null
- * if the class could not be found or parsed correctly
- */
- public static JavaClass lookupClass(String class_name) {
- try {
- JavaClass clazz = _repository.findClass(class_name);
-
- if(clazz == null) {
- return _repository.loadClass(class_name);
- } else {
- return clazz;
- }
- } catch(ClassNotFoundException ex) { return null; }
- }
-
- /**
- * Try to find class source via getResourceAsStream().
- * @see Class
- * @return JavaClass object for given runtime class
- */
- public static JavaClass lookupClass(Class clazz) {
- try {
- return _repository.loadClass(clazz);
- } catch(ClassNotFoundException ex) { return null; }
- }
-
- /** @return class file object for given Java class.
- */
- public static ClassPath.ClassFile lookupClassFile(String class_name) {
- try {
- return ClassPath.SYSTEM_CLASS_PATH.getClassFile(class_name);
- } catch(IOException e) { return null; }
- }
-
- /** Clear the repository.
- */
- public static void clearCache() {
- _repository.clear();
- }
-
- /**
- * Add clazz to repository if there isn't an equally named class already in there.
- *
- * @return old entry in repository
- */
- public static JavaClass addClass(JavaClass clazz) {
- JavaClass old = _repository.findClass(clazz.getClassName());
- _repository.storeClass(clazz);
- return old;
- }
-
- /**
- * Remove class with given (fully qualified) name from repository.
- */
- public static void removeClass(String clazz) {
- _repository.removeClass(_repository.findClass(clazz));
- }
-
- /**
- * Remove given class from repository.
- */
- public static void removeClass(JavaClass clazz) {
- _repository.removeClass(clazz);
- }
-
- /**
- * @return list of super classes of clazz in ascending order, i.e.,
- * Object is always the last element
- */
- public static JavaClass[] getSuperClasses(JavaClass clazz) {
- return clazz.getSuperClasses();
- }
-
- /**
- * @return list of super classes of clazz in ascending order, i.e.,
- * Object is always the last element. return "null", if class
- * cannot be found.
- */
- public static JavaClass[] getSuperClasses(String class_name) {
- JavaClass jc = lookupClass(class_name);
- return (jc == null? null : getSuperClasses(jc));
- }
-
- /**
- * @return all interfaces implemented by class and its super
- * classes and the interfaces that those interfaces extend, and so on.
- * (Some people call this a transitive hull).
- */
- public static JavaClass[] getInterfaces(JavaClass clazz) {
- return clazz.getAllInterfaces();
- }
-
- /**
- * @return all interfaces implemented by class and its super
- * classes and the interfaces that extend those interfaces, and so on
- */
- public static JavaClass[] getInterfaces(String class_name) {
- return getInterfaces(lookupClass(class_name));
- }
-
- /**
- * Equivalent to runtime "instanceof" operator.
- * @return true, if clazz is an instance of super_class
- */
- public static boolean instanceOf(JavaClass clazz, JavaClass super_class) {
- return clazz.instanceOf(super_class);
- }
-
- /**
- * @return true, if clazz is an instance of super_class
- */
- public static boolean instanceOf(String clazz, String super_class) {
- return instanceOf(lookupClass(clazz), lookupClass(super_class));
- }
-
- /**
- * @return true, if clazz is an instance of super_class
- */
- public static boolean instanceOf(JavaClass clazz, String super_class) {
- return instanceOf(clazz, lookupClass(super_class));
- }
-
- /**
- * @return true, if clazz is an instance of super_class
- */
- public static boolean instanceOf(String clazz, JavaClass super_class) {
- return instanceOf(lookupClass(clazz), super_class);
- }
-
- /**
- * @return true, if clazz is an implementation of interface inter
- */
- public static boolean implementationOf(JavaClass clazz, JavaClass inter) {
- return clazz.implementationOf(inter);
- }
-
- /**
- * @return true, if clazz is an implementation of interface inter
- */
- public static boolean implementationOf(String clazz, String inter) {
- return implementationOf(lookupClass(clazz), lookupClass(inter));
- }
-
- /**
- * @return true, if clazz is an implementation of interface inter
- */
- public static boolean implementationOf(JavaClass clazz, String inter) {
- return implementationOf(clazz, lookupClass(inter));
- }
-
- /**
- * @return true, if clazz is an implementation of interface inter
- */
- public static boolean implementationOf(String clazz, JavaClass inter) {
- return implementationOf(lookupClass(clazz), inter);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/AccessFlags.java b/src/com/sun/org/apache/bcel/internal/classfile/AccessFlags.java
deleted file mode 100644
index ad50a97..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/AccessFlags.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-
-/**
- * Super class for all objects that have modifiers like private, final, ...
- * I.e. classes, fields, and methods.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public abstract class AccessFlags implements java.io.Serializable {
- protected int access_flags;
-
- public AccessFlags() {}
-
- /**
- * @param a inital access flags
- */
- public AccessFlags(int a) {
- access_flags = a;
- }
-
- /**
- * @return Access flags of the object aka. "modifiers".
- */
- public final int getAccessFlags() { return access_flags; }
-
- /**
- * @return Access flags of the object aka. "modifiers".
- */
- public final int getModifiers() { return access_flags; }
-
- /** Set access flags aka "modifiers".
- * @param access_flags Access flags of the object.
- */
- public final void setAccessFlags(int access_flags) {
- this.access_flags = access_flags;
- }
-
- /** Set access flags aka "modifiers".
- * @param access_flags Access flags of the object.
- */
- public final void setModifiers(int access_flags) {
- setAccessFlags(access_flags);
- }
-
- private final void setFlag(int flag, boolean set) {
- if((access_flags & flag) != 0) { // Flag is set already
- if(!set) // Delete flag ?
- access_flags ^= flag;
- } else { // Flag not set
- if(set) // Set flag ?
- access_flags |= flag;
- }
- }
-
- public final void isPublic(boolean flag) { setFlag(Constants.ACC_PUBLIC, flag); }
- public final boolean isPublic() {
- return (access_flags & Constants.ACC_PUBLIC) != 0;
- }
-
- public final void isPrivate(boolean flag) { setFlag(Constants.ACC_PRIVATE, flag); }
- public final boolean isPrivate() {
- return (access_flags & Constants.ACC_PRIVATE) != 0;
- }
-
- public final void isProtected(boolean flag) { setFlag(Constants.ACC_PROTECTED, flag); }
- public final boolean isProtected() {
- return (access_flags & Constants.ACC_PROTECTED) != 0;
- }
-
- public final void isStatic(boolean flag) { setFlag(Constants.ACC_STATIC, flag); }
- public final boolean isStatic() {
- return (access_flags & Constants.ACC_STATIC) != 0;
- }
-
- public final void isFinal(boolean flag) { setFlag(Constants.ACC_FINAL, flag); }
- public final boolean isFinal() {
- return (access_flags & Constants.ACC_FINAL) != 0;
- }
-
- public final void isSynchronized(boolean flag) { setFlag(Constants.ACC_SYNCHRONIZED, flag); }
- public final boolean isSynchronized() {
- return (access_flags & Constants.ACC_SYNCHRONIZED) != 0;
- }
-
- public final void isVolatile(boolean flag) { setFlag(Constants.ACC_VOLATILE, flag); }
- public final boolean isVolatile() {
- return (access_flags & Constants.ACC_VOLATILE) != 0;
- }
-
- public final void isTransient(boolean flag) { setFlag(Constants.ACC_TRANSIENT, flag); }
- public final boolean isTransient() {
- return (access_flags & Constants.ACC_TRANSIENT) != 0;
- }
-
- public final void isNative(boolean flag) { setFlag(Constants.ACC_NATIVE, flag); }
- public final boolean isNative() {
- return (access_flags & Constants.ACC_NATIVE) != 0;
- }
-
- public final void isInterface(boolean flag) { setFlag(Constants.ACC_INTERFACE, flag); }
- public final boolean isInterface() {
- return (access_flags & Constants.ACC_INTERFACE) != 0;
- }
-
- public final void isAbstract(boolean flag) { setFlag(Constants.ACC_ABSTRACT, flag); }
- public final boolean isAbstract() {
- return (access_flags & Constants.ACC_ABSTRACT) != 0;
- }
-
- public final void isStrictfp(boolean flag) { setFlag(Constants.ACC_STRICT, flag); }
- public final boolean isStrictfp() {
- return (access_flags & Constants.ACC_STRICT) != 0;
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/Attribute.java b/src/com/sun/org/apache/bcel/internal/classfile/Attribute.java
deleted file mode 100644
index 204bb25..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/Attribute.java
+++ /dev/null
@@ -1,308 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import java.io.*;
-import java.util.HashMap;
-
-/**
- * Abstract super class for <em>Attribute</em> objects. Currently the
- * <em>ConstantValue</em>, <em>SourceFile</em>, <em>Code</em>,
- * <em>Exceptiontable</em>, <em>LineNumberTable</em>,
- * <em>LocalVariableTable</em>, <em>InnerClasses</em> and
- * <em>Synthetic</em> attributes are supported. The
- * <em>Unknown</em> attribute stands for non-standard-attributes.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see ConstantValue
- * @see SourceFile
- * @see Code
- * @see Unknown
- * @see ExceptionTable
- * @see LineNumberTable
- * @see LocalVariableTable
- * @see InnerClasses
- * @see Synthetic
- * @see Deprecated
- * @see Signature
-*/
-public abstract class Attribute implements Cloneable, Node, Serializable {
- protected int name_index; // Points to attribute name in constant pool
- protected int length; // Content length of attribute field
- protected byte tag; // Tag to distiguish subclasses
- protected ConstantPool constant_pool;
-
- protected Attribute(byte tag, int name_index, int length,
- ConstantPool constant_pool) {
- this.tag = tag;
- this.name_index = name_index;
- this.length = length;
- this.constant_pool = constant_pool;
- }
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- public abstract void accept(Visitor v);
-
- /**
- * Dump attribute to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- public void dump(DataOutputStream file) throws IOException
- {
- file.writeShort(name_index);
- file.writeInt(length);
- }
-
- private static HashMap readers = new HashMap();
-
- /** Add an Attribute reader capable of parsing (user-defined) attributes
- * named "name". You should not add readers for the standard attributes
- * such as "LineNumberTable", because those are handled internally.
- *
- * @param name the name of the attribute as stored in the class file
- * @param r the reader object
- */
- public static void addAttributeReader(String name, AttributeReader r) {
- readers.put(name, r);
- }
-
- /** Remove attribute reader
- *
- * @param name the name of the attribute as stored in the class file
- */
- public static void removeAttributeReader(String name) {
- readers.remove(name);
- }
-
- /* Class method reads one attribute from the input data stream.
- * This method must not be accessible from the outside. It is
- * called by the Field and Method constructor methods.
- *
- * @see Field
- * @see Method
- * @param file Input stream
- * @param constant_pool Array of constants
- * @return Attribute
- * @throws IOException
- * @throws ClassFormatException
- */
- public static final Attribute readAttribute(DataInputStream file,
- ConstantPool constant_pool)
- throws IOException, ClassFormatException
- {
- ConstantUtf8 c;
- String name;
- int name_index;
- int length;
- byte tag = Constants.ATTR_UNKNOWN; // Unknown attribute
-
- // Get class name from constant pool via `name_index' indirection
- name_index = (int)file.readUnsignedShort();
- c = (ConstantUtf8)constant_pool.getConstant(name_index,
- Constants.CONSTANT_Utf8);
- name = c.getBytes();
-
- // Length of data in bytes
- length = file.readInt();
-
- // Compare strings to find known attribute
- for(byte i=0; i < Constants.KNOWN_ATTRIBUTES; i++) {
- if(name.equals(Constants.ATTRIBUTE_NAMES[i])) {
- tag = i; // found!
- break;
- }
- }
-
- // Call proper constructor, depending on `tag'
- switch(tag) {
- case Constants.ATTR_UNKNOWN:
- AttributeReader r = (AttributeReader)readers.get(name);
-
- if(r != null)
- return r.createAttribute(name_index, length, file, constant_pool);
- else
- return new Unknown(name_index, length, file, constant_pool);
-
- case Constants.ATTR_CONSTANT_VALUE:
- return new ConstantValue(name_index, length, file, constant_pool);
-
- case Constants.ATTR_SOURCE_FILE:
- return new SourceFile(name_index, length, file, constant_pool);
-
- case Constants.ATTR_CODE:
- return new Code(name_index, length, file, constant_pool);
-
- case Constants.ATTR_EXCEPTIONS:
- return new ExceptionTable(name_index, length, file, constant_pool);
-
- case Constants.ATTR_LINE_NUMBER_TABLE:
- return new LineNumberTable(name_index, length, file, constant_pool);
-
- case Constants.ATTR_LOCAL_VARIABLE_TABLE:
- return new LocalVariableTable(name_index, length, file, constant_pool);
-
- case Constants.ATTR_LOCAL_VARIABLE_TYPE_TABLE:
- return new LocalVariableTypeTable(name_index, length, file, constant_pool);
-
- case Constants.ATTR_INNER_CLASSES:
- return new InnerClasses(name_index, length, file, constant_pool);
-
- case Constants.ATTR_SYNTHETIC:
- return new Synthetic(name_index, length, file, constant_pool);
-
- case Constants.ATTR_DEPRECATED:
- return new Deprecated(name_index, length, file, constant_pool);
-
- case Constants.ATTR_PMG:
- return new PMGClass(name_index, length, file, constant_pool);
-
- case Constants.ATTR_SIGNATURE:
- return new Signature(name_index, length, file, constant_pool);
-
- case Constants.ATTR_STACK_MAP:
- return new StackMap(name_index, length, file, constant_pool);
-
- default: // Never reached
- throw new IllegalStateException("Ooops! default case reached.");
- }
- }
-
- /**
- * @return Length of attribute field in bytes.
- */
- public final int getLength() { return length; }
-
- /**
- * @param Attribute length in bytes.
- */
- public final void setLength(int length) {
- this.length = length;
- }
-
- /**
- * @param name_index of attribute.
- */
- public final void setNameIndex(int name_index) {
- this.name_index = name_index;
- }
-
- /**
- * @return Name index in constant pool of attribute name.
- */
- public final int getNameIndex() { return name_index; }
-
- /**
- * @return Tag of attribute, i.e., its type. Value may not be altered, thus
- * there is no setTag() method.
- */
- public final byte getTag() { return tag; }
-
- /**
- * @return Constant pool used by this object.
- * @see ConstantPool
- */
- public final ConstantPool getConstantPool() { return constant_pool; }
-
- /**
- * @param constant_pool Constant pool to be used for this object.
- * @see ConstantPool
- */
- public final void setConstantPool(ConstantPool constant_pool) {
- this.constant_pool = constant_pool;
- }
-
- /**
- * Use copy() if you want to have a deep copy(), i.e., with all references
- * copied correctly.
- *
- * @return shallow copy of this attribute
- */
- public Object clone() {
- Object o = null;
-
- try {
- o = super.clone();
- } catch(CloneNotSupportedException e) {
- e.printStackTrace(); // Never occurs
- }
-
- return o;
- }
-
- /**
- * @return deep copy of this attribute
- */
- public abstract Attribute copy(ConstantPool constant_pool);
-
- /**
- * @return attribute name.
- */
- public String toString() {
- return Constants.ATTRIBUTE_NAMES[tag];
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/AttributeReader.java b/src/com/sun/org/apache/bcel/internal/classfile/AttributeReader.java
deleted file mode 100644
index d1f3951..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/AttributeReader.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * Unknown (non-standard) attributes may be read via user-defined factory
- * objects that can be registered with the Attribute.addAttributeReader
- * method. These factory objects should implement this interface.
-
- * @see Attribute
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public interface AttributeReader {
- /**
- When this attribute reader is added via the static method
- Attribute.addAttributeReader, an attribute name is associated with it.
- As the class file parser parses attributes, it will call various
- AttributeReaders based on the name of the attributes it is
- constructing.
-
- @param name_index An index into the constant pool, indexing a
- ConstantUtf8 that represents the name of the attribute.
-
- @param length The length of the data contained in the attribute. This
- is written into the constant pool and should agree with what the
- factory expects the length to be.
-
- @param file This is the data input stream that the factory needs to read
- its data from.
-
- @param constant_pool This is the constant pool associated with the
- Attribute that we are constructing.
-
- @return The user-defined AttributeReader should take this data and use
- it to construct an attribute. In the case of errors, a null can be
- returned which will cause the parsing of the class file to fail.
-
- @see Attribute#addAttributeReader( String, AttributeReader )
- */
- public Attribute createAttribute(int name_index,
- int length,
- java.io.DataInputStream file,
- ConstantPool constant_pool);
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/ClassFormatException.java b/src/com/sun/org/apache/bcel/internal/classfile/ClassFormatException.java
deleted file mode 100644
index 203faf3..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/ClassFormatException.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * Thrown when the BCEL attempts to read a class file and determines
- * that the file is malformed or otherwise cannot be interpreted as a
- * class file.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class ClassFormatException extends RuntimeException {
- public ClassFormatException() { super(); }
- public ClassFormatException(String s) { super(s); }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/ClassParser.java b/src/com/sun/org/apache/bcel/internal/classfile/ClassParser.java
deleted file mode 100644
index d8f32fc..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/ClassParser.java
+++ /dev/null
@@ -1,331 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import java.io.*;
-import java.util.zip.*;
-
-/**
- * Wrapper class that parses a given Java .class file. The method <A
- * href ="#parse">parse</A> returns a <A href ="JavaClass.html">
- * JavaClass</A> object on success. When an I/O error or an
- * inconsistency occurs an appropiate exception is propagated back to
- * the caller.
- *
- * The structure and the names comply, except for a few conveniences,
- * exactly with the <A href="ftp://java.sun.com/docs/specs/vmspec.ps">
- * JVM specification 1.0</a>. See this paper for
- * further details about the structure of a bytecode file.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public final class ClassParser {
- private DataInputStream file;
- private ZipFile zip;
- private String file_name;
- private int class_name_index, superclass_name_index;
- private int major, minor; // Compiler version
- private int access_flags; // Access rights of parsed class
- private int[] interfaces; // Names of implemented interfaces
- private ConstantPool constant_pool; // collection of constants
- private Field[] fields; // class fields, i.e., its variables
- private Method[] methods; // methods defined in the class
- private Attribute[] attributes; // attributes defined in the class
- private boolean is_zip; // Loaded from zip file
-
- private static final int BUFSIZE = 8192;
-
- /**
- * Parse class from the given stream.
- *
- * @param file Input stream
- * @param file_name File name
- */
- public ClassParser(InputStream file, String file_name) {
- this.file_name = file_name;
-
- String clazz = file.getClass().getName(); // Not a very clean solution ...
- is_zip = clazz.startsWith("java.util.zip.") || clazz.startsWith("java.util.jar.");
-
- if(file instanceof DataInputStream) // Is already a data stream
- this.file = (DataInputStream)file;
- else
- this.file = new DataInputStream(new BufferedInputStream(file, BUFSIZE));
- }
-
- /** Parse class from given .class file.
- *
- * @param file_name file name
- * @throws IOException
- */
- public ClassParser(String file_name) throws IOException
- {
- is_zip = false;
- this.file_name = file_name;
- file = new DataInputStream(new BufferedInputStream
- (new FileInputStream(file_name), BUFSIZE));
- }
-
- /** Parse class from given .class file in a ZIP-archive
- *
- * @param file_name file name
- * @throws IOException
- */
- public ClassParser(String zip_file, String file_name) throws IOException
- {
- is_zip = true;
- zip = new ZipFile(zip_file);
- ZipEntry entry = zip.getEntry(file_name);
-
- this.file_name = file_name;
-
- file = new DataInputStream(new BufferedInputStream(zip.getInputStream(entry),
- BUFSIZE));
- }
-
- /**
- * Parse the given Java class file and return an object that represents
- * the contained data, i.e., constants, methods, fields and commands.
- * A <em>ClassFormatException</em> is raised, if the file is not a valid
- * .class file. (This does not include verification of the byte code as it
- * is performed by the java interpreter).
- *
- * @return Class object representing the parsed class file
- * @throws IOException
- * @throws ClassFormatException
- */
- public JavaClass parse() throws IOException, ClassFormatException
- {
- /****************** Read headers ********************************/
- // Check magic tag of class file
- readID();
-
- // Get compiler version
- readVersion();
-
- /****************** Read constant pool and related **************/
- // Read constant pool entries
- readConstantPool();
-
- // Get class information
- readClassInfo();
-
- // Get interface information, i.e., implemented interfaces
- readInterfaces();
-
- /****************** Read class fields and methods ***************/
- // Read class fields, i.e., the variables of the class
- readFields();
-
- // Read class methods, i.e., the functions in the class
- readMethods();
-
- // Read class attributes
- readAttributes();
-
- // Check for unknown variables
- //Unknown[] u = Unknown.getUnknownAttributes();
- //for(int i=0; i < u.length; i++)
- // System.err.println("WARNING: " + u[i]);
-
- // Everything should have been read now
- // if(file.available() > 0) {
- // int bytes = file.available();
- // byte[] buf = new byte[bytes];
- // file.read(buf);
-
- // if(!(is_zip && (buf.length == 1))) {
- // System.err.println("WARNING: Trailing garbage at end of " + file_name);
- // System.err.println(bytes + " extra bytes: " + Utility.toHexString(buf));
- // }
- // }
-
- // Read everything of interest, so close the file
- file.close();
- if(zip != null)
- zip.close();
-
- // Return the information we have gathered in a new object
- return new JavaClass(class_name_index, superclass_name_index,
- file_name, major, minor, access_flags,
- constant_pool, interfaces, fields,
- methods, attributes, is_zip? JavaClass.ZIP : JavaClass.FILE);
- }
-
- /**
- * Read information about the attributes of the class.
- * @throws IOException
- * @throws ClassFormatException
- */
- private final void readAttributes() throws IOException, ClassFormatException
- {
- int attributes_count;
-
- attributes_count = file.readUnsignedShort();
- attributes = new Attribute[attributes_count];
-
- for(int i=0; i < attributes_count; i++)
- attributes[i] = Attribute.readAttribute(file, constant_pool);
- }
-
- /**
- * Read information about the class and its super class.
- * @throws IOException
- * @throws ClassFormatException
- */
- private final void readClassInfo() throws IOException, ClassFormatException
- {
- access_flags = file.readUnsignedShort();
-
- /* Interfaces are implicitely abstract, the flag should be set
- * according to the JVM specification.
- */
- if((access_flags & Constants.ACC_INTERFACE) != 0)
- access_flags |= Constants.ACC_ABSTRACT;
-
- if(((access_flags & Constants.ACC_ABSTRACT) != 0) &&
- ((access_flags & Constants.ACC_FINAL) != 0 ))
- throw new ClassFormatException("Class can't be both final and abstract");
-
- class_name_index = file.readUnsignedShort();
- superclass_name_index = file.readUnsignedShort();
- }
- /**
- * Read constant pool entries.
- * @throws IOException
- * @throws ClassFormatException
- */
- private final void readConstantPool() throws IOException, ClassFormatException
- {
- constant_pool = new ConstantPool(file);
- }
-
- /**
- * Read information about the fields of the class, i.e., its variables.
- * @throws IOException
- * @throws ClassFormatException
- */
- private final void readFields() throws IOException, ClassFormatException
- {
- int fields_count;
-
- fields_count = file.readUnsignedShort();
- fields = new Field[fields_count];
-
- for(int i=0; i < fields_count; i++)
- fields[i] = new Field(file, constant_pool);
- }
-
- /******************** Private utility methods **********************/
-
- /**
- * Check whether the header of the file is ok.
- * Of course, this has to be the first action on successive file reads.
- * @throws IOException
- * @throws ClassFormatException
- */
- private final void readID() throws IOException, ClassFormatException
- {
- int magic = 0xCAFEBABE;
-
- if(file.readInt() != magic)
- throw new ClassFormatException(file_name + " is not a Java .class file");
- }
- /**
- * Read information about the interfaces implemented by this class.
- * @throws IOException
- * @throws ClassFormatException
- */
- private final void readInterfaces() throws IOException, ClassFormatException
- {
- int interfaces_count;
-
- interfaces_count = file.readUnsignedShort();
- interfaces = new int[interfaces_count];
-
- for(int i=0; i < interfaces_count; i++)
- interfaces[i] = file.readUnsignedShort();
- }
- /**
- * Read information about the methods of the class.
- * @throws IOException
- * @throws ClassFormatException
- */
- private final void readMethods() throws IOException, ClassFormatException
- {
- int methods_count;
-
- methods_count = file.readUnsignedShort();
- methods = new Method[methods_count];
-
- for(int i=0; i < methods_count; i++)
- methods[i] = new Method(file, constant_pool);
- }
- /**
- * Read major and minor version of compiler which created the file.
- * @throws IOException
- * @throws ClassFormatException
- */
- private final void readVersion() throws IOException, ClassFormatException
- {
- minor = file.readUnsignedShort();
- major = file.readUnsignedShort();
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/Code.java b/src/com/sun/org/apache/bcel/internal/classfile/Code.java
deleted file mode 100644
index f7ace6f..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/Code.java
+++ /dev/null
@@ -1,376 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import java.io.*;
-
-/**
- * This class represents a chunk of Java byte code contained in a
- * method. It is instantiated by the
- * <em>Attribute.readAttribute()</em> method. A <em>Code</em>
- * attribute contains informations about operand stack, local
- * variables, byte code and the exceptions handled within this
- * method.
- *
- * This attribute has attributes itself, namely <em>LineNumberTable</em> which
- * is used for debugging purposes and <em>LocalVariableTable</em> which
- * contains information about the local variables.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see Attribute
- * @see CodeException
- * @see LineNumberTable
- * @see LocalVariableTable
- */
-public final class Code extends Attribute {
- private int max_stack; // Maximum size of stack used by this method
- private int max_locals; // Number of local variables
- private int code_length; // Length of code in bytes
- private byte[] code; // Actual byte code
-
- private int exception_table_length;
- private CodeException[] exception_table; // Table of handled exceptions
- private int attributes_count; // Attributes of code: LineNumber
- private Attribute[] attributes; // or LocalVariable
-
- /**
- * Initialize from another object. Note that both objects use the same
- * references (shallow copy). Use copy() for a physical copy.
- */
- public Code(Code c) {
- this(c.getNameIndex(), c.getLength(), c.getMaxStack(), c.getMaxLocals(),
- c.getCode(), c.getExceptionTable(), c.getAttributes(),
- c.getConstantPool());
- }
-
- /**
- * @param name_index Index pointing to the name <em>Code</em>
- * @param length Content length in bytes
- * @param file Input stream
- * @param constant_pool Array of constants
- */
- Code(int name_index, int length, DataInputStream file,
- ConstantPool constant_pool) throws IOException
- {
- // Initialize with some default values which will be overwritten later
- this(name_index, length,
- file.readUnsignedShort(), file.readUnsignedShort(),
- (byte[])null, (CodeException[])null, (Attribute[])null,
- constant_pool);
-
- code_length = file.readInt();
- code = new byte[code_length]; // Read byte code
- file.readFully(code);
-
- /* Read exception table that contains all regions where an exception
- * handler is active, i.e., a try { ... } catch() block.
- */
- exception_table_length = file.readUnsignedShort();
- exception_table = new CodeException[exception_table_length];
-
- for(int i=0; i < exception_table_length; i++)
- exception_table[i] = new CodeException(file);
-
- /* Read all attributes, currently `LineNumberTable' and
- * `LocalVariableTable'
- */
- attributes_count = file.readUnsignedShort();
- attributes = new Attribute[attributes_count];
- for(int i=0; i < attributes_count; i++)
- attributes[i] = Attribute.readAttribute(file, constant_pool);
-
- /* Adjust length, because of setAttributes in this(), s.b. length
- * is incorrect, because it didn't take the internal attributes
- * into account yet! Very subtle bug, fixed in 3.1.1.
- */
- this.length = length;
- }
-
- /**
- * @param name_index Index pointing to the name <em>Code</em>
- * @param length Content length in bytes
- * @param max_stack Maximum size of stack
- * @param max_locals Number of local variables
- * @param code Actual byte code
- * @param exception_table Table of handled exceptions
- * @param attributes Attributes of code: LineNumber or LocalVariable
- * @param constant_pool Array of constants
- */
- public Code(int name_index, int length,
- int max_stack, int max_locals,
- byte[] code,
- CodeException[] exception_table,
- Attribute[] attributes,
- ConstantPool constant_pool)
- {
- super(Constants.ATTR_CODE, name_index, length, constant_pool);
-
- this.max_stack = max_stack;
- this.max_locals = max_locals;
-
- setCode(code);
- setExceptionTable(exception_table);
- setAttributes(attributes); // Overwrites length!
- }
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitCode(this);
- }
-
- /**
- * Dump code attribute to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- public final void dump(DataOutputStream file) throws IOException
- {
- super.dump(file);
-
- file.writeShort(max_stack);
- file.writeShort(max_locals);
- file.writeInt(code_length);
- file.write(code, 0, code_length);
-
- file.writeShort(exception_table_length);
- for(int i=0; i < exception_table_length; i++)
- exception_table[i].dump(file);
-
- file.writeShort(attributes_count);
- for(int i=0; i < attributes_count; i++)
- attributes[i].dump(file);
- }
-
- /**
- * @return Collection of code attributes.
- * @see Attribute
- */
- public final Attribute[] getAttributes() { return attributes; }
-
- /**
- * @return LineNumberTable of Code, if it has one
- */
- public LineNumberTable getLineNumberTable() {
- for(int i=0; i < attributes_count; i++)
- if(attributes[i] instanceof LineNumberTable)
- return (LineNumberTable)attributes[i];
-
- return null;
- }
-
- /**
- * @return LocalVariableTable of Code, if it has one
- */
- public LocalVariableTable getLocalVariableTable() {
- for(int i=0; i < attributes_count; i++)
- if(attributes[i] instanceof LocalVariableTable)
- return (LocalVariableTable)attributes[i];
-
- return null;
- }
-
- /**
- * @return Actual byte code of the method.
- */
- public final byte[] getCode() { return code; }
-
- /**
- * @return Table of handled exceptions.
- * @see CodeException
- */
- public final CodeException[] getExceptionTable() { return exception_table; }
-
- /**
- * @return Number of local variables.
- */
- public final int getMaxLocals() { return max_locals; }
-
- /**
- * @return Maximum size of stack used by this method.
- */
-
- public final int getMaxStack() { return max_stack; }
-
- /**
- * @return the internal length of this code attribute (minus the first 6 bytes)
- * and excluding all its attributes
- */
- private final int getInternalLength() {
- return 2 /*max_stack*/ + 2 /*max_locals*/ + 4 /*code length*/
- + code_length /*byte-code*/
- + 2 /*exception-table length*/
- + 8 * exception_table_length /* exception table */
- + 2 /* attributes count */;
- }
-
- /**
- * @return the full size of this code attribute, minus its first 6 bytes,
- * including the size of all its contained attributes
- */
- private final int calculateLength() {
- int len = 0;
-
- for(int i=0; i < attributes_count; i++)
- len += attributes[i].length + 6 /*attribute header size*/;
-
- return len + getInternalLength();
- }
-
- /**
- * @param attributes.
- */
- public final void setAttributes(Attribute[] attributes) {
- this.attributes = attributes;
- attributes_count = (attributes == null)? 0 : attributes.length;
- length = calculateLength(); // Adjust length
- }
-
- /**
- * @param code byte code
- */
- public final void setCode(byte[] code) {
- this.code = code;
- code_length = (code == null)? 0 : code.length;
- }
-
- /**
- * @param exception_table exception table
- */
- public final void setExceptionTable(CodeException[] exception_table) {
- this.exception_table = exception_table;
- exception_table_length = (exception_table == null)? 0 :
- exception_table.length;
- }
-
- /**
- * @param max_locals maximum number of local variables
- */
- public final void setMaxLocals(int max_locals) {
- this.max_locals = max_locals;
- }
-
- /**
- * @param max_stack maximum stack size
- */
- public final void setMaxStack(int max_stack) {
- this.max_stack = max_stack;
- }
-
- /**
- * @return String representation of code chunk.
- */
- public final String toString(boolean verbose) {
- StringBuffer buf;
-
- buf = new StringBuffer("Code(max_stack = " + max_stack +
- ", max_locals = " + max_locals +
- ", code_length = " + code_length + ")\n" +
- Utility.codeToString(code, constant_pool, 0, -1, verbose));
-
- if(exception_table_length > 0) {
- buf.append("\nException handler(s) = \n" + "From\tTo\tHandler\tType\n");
-
- for(int i=0; i < exception_table_length; i++)
- buf.append(exception_table[i].toString(constant_pool, verbose) + "\n");
- }
-
- if(attributes_count > 0) {
- buf.append("\nAttribute(s) = \n");
-
- for(int i=0; i < attributes_count; i++)
- buf.append(attributes[i].toString() + "\n");
- }
-
- return buf.toString();
- }
-
- /**
- * @return String representation of code chunk.
- */
- public final String toString() {
- return toString(true);
- }
-
- /**
- * @return deep copy of this attribute
- */
- public Attribute copy(ConstantPool constant_pool) {
- Code c = (Code)clone();
- c.code = (byte[])code.clone();
- c.constant_pool = constant_pool;
-
- c.exception_table = new CodeException[exception_table_length];
- for(int i=0; i < exception_table_length; i++)
- c.exception_table[i] = exception_table[i].copy();
-
- c.attributes = new Attribute[attributes_count];
- for(int i=0; i < attributes_count; i++)
- c.attributes[i] = attributes[i].copy(constant_pool);
-
- return c;
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/CodeException.java b/src/com/sun/org/apache/bcel/internal/classfile/CodeException.java
deleted file mode 100644
index 4cf1725..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/CodeException.java
+++ /dev/null
@@ -1,232 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import java.io.*;
-
-/**
- * This class represents an entry in the exception table of the <em>Code</em>
- * attribute and is used only there. It contains a range in which a
- * particular exception handler is active.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see Code
- */
-public final class CodeException
- implements Cloneable, Constants, Node, Serializable
-{
- private int start_pc; // Range in the code the exception handler is
- private int end_pc; // active. start_pc is inclusive, end_pc exclusive
- private int handler_pc; /* Starting address of exception handler, i.e.,
- * an offset from start of code.
- */
- private int catch_type; /* If this is zero the handler catches any
- * exception, otherwise it points to the
- * exception class which is to be caught.
- */
- /**
- * Initialize from another object.
- */
- public CodeException(CodeException c) {
- this(c.getStartPC(), c.getEndPC(), c.getHandlerPC(), c.getCatchType());
- }
-
- /**
- * Construct object from file stream.
- * @param file Input stream
- * @throws IOException
- */
- CodeException(DataInputStream file) throws IOException
- {
- this(file.readUnsignedShort(), file.readUnsignedShort(),
- file.readUnsignedShort(), file.readUnsignedShort());
- }
-
- /**
- * @param start_pc Range in the code the exception handler is active,
- * start_pc is inclusive while
- * @param end_pc is exclusive
- * @param handler_pc Starting address of exception handler, i.e.,
- * an offset from start of code.
- * @param catch_type If zero the handler catches any
- * exception, otherwise it points to the exception class which is
- * to be caught.
- */
- public CodeException(int start_pc, int end_pc, int handler_pc,
- int catch_type)
- {
- this.start_pc = start_pc;
- this.end_pc = end_pc;
- this.handler_pc = handler_pc;
- this.catch_type = catch_type;
- }
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitCodeException(this);
- }
- /**
- * Dump code exception to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- public final void dump(DataOutputStream file) throws IOException
- {
- file.writeShort(start_pc);
- file.writeShort(end_pc);
- file.writeShort(handler_pc);
- file.writeShort(catch_type);
- }
-
- /**
- * @return 0, if the handler catches any exception, otherwise it points to
- * the exception class which is to be caught.
- */
- public final int getCatchType() { return catch_type; }
-
- /**
- * @return Exclusive end index of the region where the handler is active.
- */
- public final int getEndPC() { return end_pc; }
-
- /**
- * @return Starting address of exception handler, relative to the code.
- */
- public final int getHandlerPC() { return handler_pc; }
-
- /**
- * @return Inclusive start index of the region where the handler is active.
- */
- public final int getStartPC() { return start_pc; }
-
- /**
- * @param catch_type.
- */
- public final void setCatchType(int catch_type) {
- this.catch_type = catch_type;
- }
-
- /**
- * @param end_pc end of handled block
- */
- public final void setEndPC(int end_pc) {
- this.end_pc = end_pc;
- }
-
- /**
- * @param handler_pc where the actual code is
- */
- public final void setHandlerPC(int handler_pc) {
- this.handler_pc = handler_pc;
- }
-
- /**
- * @param start_pc start of handled block
- */
- public final void setStartPC(int start_pc) {
- this.start_pc = start_pc;
- }
-
- /**
- * @return String representation.
- */
- public final String toString() {
- return "CodeException(start_pc = " + start_pc +
- ", end_pc = " + end_pc +
- ", handler_pc = " + handler_pc + ", catch_type = " + catch_type + ")";
- }
-
- /**
- * @return String representation.
- */
- public final String toString(ConstantPool cp, boolean verbose) {
- String str;
-
- if(catch_type == 0)
- str = "<Any exception>(0)";
- else
- str = Utility.compactClassName(cp.getConstantString(catch_type, CONSTANT_Class), false) +
- (verbose? "(" + catch_type + ")" : "");
-
- return start_pc + "\t" + end_pc + "\t" + handler_pc + "\t" + str;
- }
-
- public final String toString(ConstantPool cp) {
- return toString(cp, true);
- }
-
- /**
- * @return deep copy of this object
- */
- public CodeException copy() {
- try {
- return (CodeException)clone();
- } catch(CloneNotSupportedException e) {}
-
- return null;
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/Constant.java b/src/com/sun/org/apache/bcel/internal/classfile/Constant.java
deleted file mode 100644
index 931b8e2..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/Constant.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import java.io.*;
-
-/**
- * Abstract superclass for classes to represent the different constant types
- * in the constant pool of a class file. The classes keep closely to
- * the JVM specification.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public abstract class Constant implements Cloneable, Node, Serializable {
- /* In fact this tag is redundant since we can distinguish different
- * `Constant' objects by their type, i.e., via `instanceof'. In some
- * places we will use the tag for switch()es anyway.
- *
- * First, we want match the specification as closely as possible. Second we
- * need the tag as an index to select the corresponding class name from the
- * `CONSTANT_NAMES' array.
- */
- protected byte tag;
-
- Constant(byte tag) { this.tag = tag; }
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- public abstract void accept(Visitor v);
-
- public abstract void dump(DataOutputStream file) throws IOException;
-
- /**
- * @return Tag of constant, i.e., its type. No setTag() method to avoid
- * confusion.
- */
- public final byte getTag() { return tag; }
-
- /**
- * @return String representation.
- */
- public String toString() {
- return Constants.CONSTANT_NAMES[tag] + "[" + tag + "]";
- }
-
- /**
- * @return deep copy of this constant
- */
- public Constant copy() {
- try {
- return (Constant)super.clone();
- } catch(CloneNotSupportedException e) {}
-
- return null;
- }
-
- public Object clone() throws CloneNotSupportedException {
- return super.clone();
- }
-
- /**
- * Read one constant from the given file, the type depends on a tag byte.
- *
- * @param file Input stream
- * @return Constant object
- */
- static final Constant readConstant(DataInputStream file)
- throws IOException, ClassFormatException
- {
- byte b = file.readByte(); // Read tag byte
-
- switch(b) {
- case Constants.CONSTANT_Class: return new ConstantClass(file);
- case Constants.CONSTANT_Fieldref: return new ConstantFieldref(file);
- case Constants.CONSTANT_Methodref: return new ConstantMethodref(file);
- case Constants.CONSTANT_InterfaceMethodref: return new
- ConstantInterfaceMethodref(file);
- case Constants.CONSTANT_String: return new ConstantString(file);
- case Constants.CONSTANT_Integer: return new ConstantInteger(file);
- case Constants.CONSTANT_Float: return new ConstantFloat(file);
- case Constants.CONSTANT_Long: return new ConstantLong(file);
- case Constants.CONSTANT_Double: return new ConstantDouble(file);
- case Constants.CONSTANT_NameAndType: return new ConstantNameAndType(file);
- case Constants.CONSTANT_Utf8: return new ConstantUtf8(file);
- default:
- throw new ClassFormatException("Invalid byte tag in constant pool: " + b);
- }
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/ConstantCP.java b/src/com/sun/org/apache/bcel/internal/classfile/ConstantCP.java
deleted file mode 100644
index b12d752..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/ConstantCP.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import java.io.*;
-import com.sun.org.apache.bcel.internal.Constants;
-
-/**
- * Abstract super class for Fieldref and Methodref constants.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see ConstantFieldref
- * @see ConstantMethodref
- * @see ConstantInterfaceMethodref
- */
-public abstract class ConstantCP extends Constant {
- /** References to the constants containing the class and the field signature
- */
- protected int class_index, name_and_type_index;
-
- /**
- * Initialize from another object.
- */
- public ConstantCP(ConstantCP c) {
- this(c.getTag(), c.getClassIndex(), c.getNameAndTypeIndex());
- }
-
- /**
- * Initialize instance from file data.
- *
- * @param tag Constant type tag
- * @param file Input stream
- * @throws IOException
- */
- ConstantCP(byte tag, DataInputStream file) throws IOException
- {
- this(tag, file.readUnsignedShort(), file.readUnsignedShort());
- }
-
- /**
- * @param class_index Reference to the class containing the field
- * @param name_and_type_index and the field signature
- */
- protected ConstantCP(byte tag, int class_index,
- int name_and_type_index) {
- super(tag);
- this.class_index = class_index;
- this.name_and_type_index = name_and_type_index;
- }
-
- /**
- * Dump constant field reference to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- public final void dump(DataOutputStream file) throws IOException
- {
- file.writeByte(tag);
- file.writeShort(class_index);
- file.writeShort(name_and_type_index);
- }
-
- /**
- * @return Reference (index) to class this field or method belongs to.
- */
- public final int getClassIndex() { return class_index; }
-
- /**
- * @return Reference (index) to signature of the field.
- */
- public final int getNameAndTypeIndex() { return name_and_type_index; }
-
- /**
- * @param class_index points to Constant_class
- */
- public final void setClassIndex(int class_index) {
- this.class_index = class_index;
- }
-
- /**
- * @return Class this field belongs to.
- */
- public String getClass(ConstantPool cp) {
- return cp.constantToString(class_index, Constants.CONSTANT_Class);
- }
-
- /**
- * @param name_and_type_index points to Constant_NameAndType
- */
- public final void setNameAndTypeIndex(int name_and_type_index) {
- this.name_and_type_index = name_and_type_index;
- }
-
- /**
- * @return String representation.
- */
- public final String toString() {
- return super.toString() + "(class_index = " + class_index +
- ", name_and_type_index = " + name_and_type_index + ")";
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/ConstantClass.java b/src/com/sun/org/apache/bcel/internal/classfile/ConstantClass.java
deleted file mode 100644
index e047ca8..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/ConstantClass.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import java.io.*;
-
-/**
- * This class is derived from the abstract
- * <A HREF="com.sun.org.apache.bcel.internal.classfile.Constant.html">Constant</A> class
- * and represents a reference to a (external) class.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see Constant
- */
-public final class ConstantClass extends Constant implements ConstantObject {
- private int name_index; // Identical to ConstantString except for the name
-
- /**
- * Initialize from another object.
- */
- public ConstantClass(ConstantClass c) {
- this(c.getNameIndex());
- }
-
- /**
- * Initialize instance from file data.
- *
- * @param file Input stream
- * @throws IOException
- */
- ConstantClass(DataInputStream file) throws IOException
- {
- this(file.readUnsignedShort());
- }
-
- /**
- * @param name_index Name index in constant pool. Should refer to a
- * ConstantUtf8.
- */
- public ConstantClass(int name_index) {
- super(Constants.CONSTANT_Class);
- this.name_index = name_index;
- }
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitConstantClass(this);
- }
-
- /**
- * Dump constant class to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- public final void dump(DataOutputStream file) throws IOException
- {
- file.writeByte(tag);
- file.writeShort(name_index);
- }
-
- /**
- * @return Name index in constant pool of class name.
- */
- public final int getNameIndex() { return name_index; }
-
- /**
- * @param name_index.
- */
- public final void setNameIndex(int name_index) {
- this.name_index = name_index;
- }
-
-
- /** @return String object
- */
- public Object getConstantValue(ConstantPool cp) {
- Constant c = cp.getConstant(name_index, Constants.CONSTANT_Utf8);
- return ((ConstantUtf8)c).getBytes();
- }
-
- /** @return dereferenced string
- */
- public String getBytes(ConstantPool cp) {
- return (String)getConstantValue(cp);
- }
-
- /**
- * @return String representation.
- */
- public final String toString() {
- return super.toString() + "(name_index = " + name_index + ")";
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/ConstantDouble.java b/src/com/sun/org/apache/bcel/internal/classfile/ConstantDouble.java
deleted file mode 100644
index 74e7ef8..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/ConstantDouble.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import java.io.*;
-
-/**
- * This class is derived from the abstract
- * <A HREF="com.sun.org.apache.bcel.internal.classfile.Constant.html">Constant</A> class
- * and represents a reference to a Double object.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see Constant
- */
-public final class ConstantDouble extends Constant implements ConstantObject {
- private double bytes;
-
- /**
- * @param bytes Data
- */
- public ConstantDouble(double bytes) {
- super(Constants.CONSTANT_Double);
- this.bytes = bytes;
- }
-
- /**
- * Initialize from another object.
- */
- public ConstantDouble(ConstantDouble c) {
- this(c.getBytes());
- }
-
- /**
- * Initialize instance from file data.
- *
- * @param file Input stream
- * @throws IOException
- */
- ConstantDouble(DataInputStream file) throws IOException
- {
- this(file.readDouble());
- }
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitConstantDouble(this);
- }
- /**
- * Dump constant double to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- public final void dump(DataOutputStream file) throws IOException
- {
- file.writeByte(tag);
- file.writeDouble(bytes);
- }
- /**
- * @return data, i.e., 8 bytes.
- */
- public final double getBytes() { return bytes; }
- /**
- * @param bytes.
- */
- public final void setBytes(double bytes) {
- this.bytes = bytes;
- }
- /**
- * @return String representation.
- */
- public final String toString()
- {
- return super.toString() + "(bytes = " + bytes + ")";
- }
-
- /** @return Double object
- */
- public Object getConstantValue(ConstantPool cp) {
- return new Double(bytes);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/ConstantFieldref.java b/src/com/sun/org/apache/bcel/internal/classfile/ConstantFieldref.java
deleted file mode 100644
index 5d76e11..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/ConstantFieldref.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import java.io.*;
-
-/**
- * This class represents a constant pool reference to a field.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public final class ConstantFieldref extends ConstantCP {
- /**
- * Initialize from another object.
- */
- public ConstantFieldref(ConstantFieldref c) {
- super(Constants.CONSTANT_Fieldref, c.getClassIndex(), c.getNameAndTypeIndex());
- }
-
- /**
- * Initialize instance from file data.
- *
- * @param file input stream
- * @throws IOException
- */
- ConstantFieldref(DataInputStream file) throws IOException
- {
- super(Constants.CONSTANT_Fieldref, file);
- }
-
- /**
- * @param class_index Reference to the class containing the Field
- * @param name_and_type_index and the Field signature
- */
- public ConstantFieldref(int class_index,
- int name_and_type_index) {
- super(Constants.CONSTANT_Fieldref, class_index, name_and_type_index);
- }
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of Fields,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitConstantFieldref(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/ConstantFloat.java b/src/com/sun/org/apache/bcel/internal/classfile/ConstantFloat.java
deleted file mode 100644
index e18eb14..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/ConstantFloat.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import java.io.*;
-
-/**
- * This class is derived from the abstract
- * <A HREF="com.sun.org.apache.bcel.internal.classfile.Constant.html">Constant</A> class
- * and represents a reference to a float object.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see Constant
- */
-public final class ConstantFloat extends Constant implements ConstantObject {
- private float bytes;
-
- /**
- * @param bytes Data
- */
- public ConstantFloat(float bytes)
- {
- super(Constants.CONSTANT_Float);
- this.bytes = bytes;
- }
- /**
- * Initialize from another object. Note that both objects use the same
- * references (shallow copy). Use clone() for a physical copy.
- */
- public ConstantFloat(ConstantFloat c) {
- this(c.getBytes());
- }
- /**
- * Initialize instance from file data.
- *
- * @param file Input stream
- * @throws IOException
- */
- ConstantFloat(DataInputStream file) throws IOException
- {
- this(file.readFloat());
- }
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitConstantFloat(this);
- }
- /**
- * Dump constant float to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- public final void dump(DataOutputStream file) throws IOException
- {
- file.writeByte(tag);
- file.writeFloat(bytes);
- }
- /**
- * @return data, i.e., 4 bytes.
- */
- public final float getBytes() { return bytes; }
- /**
- * @param bytes.
- */
- public final void setBytes(float bytes) {
- this.bytes = bytes;
- }
-
- /**
- * @return String representation.
- */
- public final String toString() {
- return super.toString() + "(bytes = " + bytes + ")";
- }
-
- /** @return Float object
- */
- public Object getConstantValue(ConstantPool cp) {
- return new Float(bytes);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/ConstantInteger.java b/src/com/sun/org/apache/bcel/internal/classfile/ConstantInteger.java
deleted file mode 100644
index a1e811e..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/ConstantInteger.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-
-import com.sun.org.apache.bcel.internal.Constants;
-import java.io.*;
-
-/**
- * This class is derived from the abstract
- * <A HREF="com.sun.org.apache.bcel.internal.classfile.Constant.html">Constant</A> class
- * and represents a reference to an int object.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see Constant
- */
-public final class ConstantInteger extends Constant implements ConstantObject {
- private int bytes;
-
- /**
- * @param bytes Data
- */
- public ConstantInteger(int bytes)
- {
- super(Constants.CONSTANT_Integer);
- this.bytes = bytes;
- }
-
- /**
- * Initialize from another object.
- */
- public ConstantInteger(ConstantInteger c) {
- this(c.getBytes());
- }
-
- /**
- * Initialize instance from file data.
- *
- * @param file Input stream
- * @throws IOException
- */
- ConstantInteger(DataInputStream file) throws IOException
- {
- this(file.readInt());
- }
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitConstantInteger(this);
- }
-
- /**
- * Dump constant integer to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- public final void dump(DataOutputStream file) throws IOException
- {
- file.writeByte(tag);
- file.writeInt(bytes);
- }
-
- /**
- * @return data, i.e., 4 bytes.
- */
- public final int getBytes() { return bytes; }
-
- /**
- * @param bytes.
- */
- public final void setBytes(int bytes) {
- this.bytes = bytes;
- }
-
- /**
- * @return String representation.
- */
- public final String toString() {
- return super.toString() + "(bytes = " + bytes + ")";
- }
-
- /** @return Integer object
- */
- public Object getConstantValue(ConstantPool cp) {
- return new Integer(bytes);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/ConstantInterfaceMethodref.java b/src/com/sun/org/apache/bcel/internal/classfile/ConstantInterfaceMethodref.java
deleted file mode 100644
index 46b7426..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/ConstantInterfaceMethodref.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import java.io.*;
-
-/**
- * This class represents a constant pool reference to an interface method.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public final class ConstantInterfaceMethodref extends ConstantCP {
- /**
- * Initialize from another object.
- */
- public ConstantInterfaceMethodref(ConstantInterfaceMethodref c) {
- super(Constants.CONSTANT_InterfaceMethodref, c.getClassIndex(), c.getNameAndTypeIndex());
- }
-
- /**
- * Initialize instance from file data.
- *
- * @param file input stream
- * @throws IOException
- */
- ConstantInterfaceMethodref(DataInputStream file) throws IOException
- {
- super(Constants.CONSTANT_InterfaceMethodref, file);
- }
-
- /**
- * @param class_index Reference to the class containing the method
- * @param name_and_type_index and the method signature
- */
- public ConstantInterfaceMethodref(int class_index,
- int name_and_type_index) {
- super(Constants.CONSTANT_InterfaceMethodref, class_index, name_and_type_index);
- }
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitConstantInterfaceMethodref(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/ConstantLong.java b/src/com/sun/org/apache/bcel/internal/classfile/ConstantLong.java
deleted file mode 100644
index e29a7c9..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/ConstantLong.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import java.io.*;
-
-/**
- * This class is derived from the abstract
- * <A HREF="com.sun.org.apache.bcel.internal.classfile.Constant.html">Constant</A> class
- * and represents a reference to a long object.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see Constant
- */
-public final class ConstantLong extends Constant implements ConstantObject {
- private long bytes;
-
- /**
- * @param bytes Data
- */
- public ConstantLong(long bytes)
- {
- super(Constants.CONSTANT_Long);
- this.bytes = bytes;
- }
- /**
- * Initialize from another object.
- */
- public ConstantLong(ConstantLong c) {
- this(c.getBytes());
- }
- /**
- * Initialize instance from file data.
- *
- * @param file Input stream
- * @throws IOException
- */
- ConstantLong(DataInputStream file) throws IOException
- {
- this(file.readLong());
- }
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitConstantLong(this);
- }
- /**
- * Dump constant long to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- public final void dump(DataOutputStream file) throws IOException
- {
- file.writeByte(tag);
- file.writeLong(bytes);
- }
- /**
- * @return data, i.e., 8 bytes.
- */
- public final long getBytes() { return bytes; }
- /**
- * @param bytes.
- */
- public final void setBytes(long bytes) {
- this.bytes = bytes;
- }
- /**
- * @return String representation.
- */
- public final String toString() {
- return super.toString() + "(bytes = " + bytes + ")";
- }
-
- /** @return Long object
- */
- public Object getConstantValue(ConstantPool cp) {
- return new Long(bytes);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/ConstantMethodref.java b/src/com/sun/org/apache/bcel/internal/classfile/ConstantMethodref.java
deleted file mode 100644
index 044c99b..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/ConstantMethodref.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import java.io.*;
-
-/**
- * This class represents a constant pool reference to a method.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public final class ConstantMethodref extends ConstantCP {
- /**
- * Initialize from another object.
- */
- public ConstantMethodref(ConstantMethodref c) {
- super(Constants.CONSTANT_Methodref, c.getClassIndex(), c.getNameAndTypeIndex());
- }
-
- /**
- * Initialize instance from file data.
- *
- * @param file input stream
- * @throws IOException
- */
- ConstantMethodref(DataInputStream file) throws IOException
- {
- super(Constants.CONSTANT_Methodref, file);
- }
-
- /**
- * @param class_index Reference to the class containing the method
- * @param name_and_type_index and the method signature
- */
- public ConstantMethodref(int class_index,
- int name_and_type_index) {
- super(Constants.CONSTANT_Methodref, class_index, name_and_type_index);
- }
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitConstantMethodref(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/ConstantNameAndType.java b/src/com/sun/org/apache/bcel/internal/classfile/ConstantNameAndType.java
deleted file mode 100644
index 19ad468..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/ConstantNameAndType.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import java.io.*;
-
-/**
- * This class is derived from the abstract
- * <A HREF="com.sun.org.apache.bcel.internal.classfile.Constant.html">Constant</A> class
- * and represents a reference to the name and signature
- * of a field or method.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see Constant
- */
-public final class ConstantNameAndType extends Constant {
- private int name_index; // Name of field/method
- private int signature_index; // and its signature.
-
- /**
- * Initialize from another object.
- */
- public ConstantNameAndType(ConstantNameAndType c) {
- this(c.getNameIndex(), c.getSignatureIndex());
- }
-
- /**
- * Initialize instance from file data.
- *
- * @param file Input stream
- * @throws IOException
- */
- ConstantNameAndType(DataInputStream file) throws IOException
- {
- this((int)file.readUnsignedShort(), (int)file.readUnsignedShort());
- }
-
- /**
- * @param name_index Name of field/method
- * @param signature_index and its signature
- */
- public ConstantNameAndType(int name_index,
- int signature_index)
- {
- super(Constants.CONSTANT_NameAndType);
- this.name_index = name_index;
- this.signature_index = signature_index;
- }
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitConstantNameAndType(this);
- }
-
- /**
- * Dump name and signature index to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- public final void dump(DataOutputStream file) throws IOException
- {
- file.writeByte(tag);
- file.writeShort(name_index);
- file.writeShort(signature_index);
- }
-
- /**
- * @return Name index in constant pool of field/method name.
- */
- public final int getNameIndex() { return name_index; }
-
- /** @return name
- */
- public final String getName(ConstantPool cp) {
- return cp.constantToString(getNameIndex(), Constants.CONSTANT_Utf8);
- }
-
- /**
- * @return Index in constant pool of field/method signature.
- */
- public final int getSignatureIndex() { return signature_index; }
-
- /** @return signature
- */
- public final String getSignature(ConstantPool cp) {
- return cp.constantToString(getSignatureIndex(), Constants.CONSTANT_Utf8);
- }
-
- /**
- * @param name_index.
- */
- public final void setNameIndex(int name_index) {
- this.name_index = name_index;
- }
-
- /**
- * @param signature_index.
- */
- public final void setSignatureIndex(int signature_index) {
- this.signature_index = signature_index;
- }
-
- /**
- * @return String representation
- */
- public final String toString() {
- return super.toString() + "(name_index = " + name_index +
- ", signature_index = " + signature_index + ")";
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/ConstantObject.java b/src/com/sun/org/apache/bcel/internal/classfile/ConstantObject.java
deleted file mode 100644
index 61440e5..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/ConstantObject.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * This interface denotes those constants that have a "natural" value,
- * such as ConstantLong, ConstantString, etc..
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see Constant
- */
-public interface ConstantObject {
- /** @return object representing the constant, e.g., Long for ConstantLong
- */
- public abstract Object getConstantValue(ConstantPool cp);
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/ConstantPool.java b/src/com/sun/org/apache/bcel/internal/classfile/ConstantPool.java
deleted file mode 100644
index 091e70c..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/ConstantPool.java
+++ /dev/null
@@ -1,375 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import java.io.*;
-
-/**
- * This class represents the constant pool, i.e., a table of constants, of
- * a parsed classfile. It may contain null references, due to the JVM
- * specification that skips an entry after an 8-byte constant (double,
- * long) entry. Those interested in generating constant pools
- * programatically should see <a href="../generic/ConstantPoolGen.html">
- * ConstantPoolGen</a>.
-
- * @see Constant
- * @see com.sun.org.apache.bcel.internal.generic.ConstantPoolGen
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class ConstantPool implements Cloneable, Node, Serializable {
- private int constant_pool_count;
- private Constant[] constant_pool;
-
- /**
- * @param constant_pool Array of constants
- */
- public ConstantPool(Constant[] constant_pool)
- {
- setConstantPool(constant_pool);
- }
-
- /**
- * Read constants from given file stream.
- *
- * @param file Input stream
- * @throws IOException
- * @throws ClassFormatException
- */
- ConstantPool(DataInputStream file) throws IOException, ClassFormatException
- {
- byte tag;
-
- constant_pool_count = file.readUnsignedShort();
- constant_pool = new Constant[constant_pool_count];
-
- /* constant_pool[0] is unused by the compiler and may be used freely
- * by the implementation.
- */
- for(int i=1; i < constant_pool_count; i++) {
- constant_pool[i] = Constant.readConstant(file);
-
- /* Quote from the JVM specification:
- * "All eight byte constants take up two spots in the constant pool.
- * If this is the n'th byte in the constant pool, then the next item
- * will be numbered n+2"
- *
- * Thus we have to increment the index counter.
- */
- tag = constant_pool[i].getTag();
- if((tag == Constants.CONSTANT_Double) || (tag == Constants.CONSTANT_Long))
- i++;
- }
- }
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitConstantPool(this);
- }
-
- /**
- * Resolve constant to a string representation.
- *
- * @param constant Constant to be printed
- * @return String representation
- */
- public String constantToString(Constant c)
- throws ClassFormatException
- {
- String str;
- int i;
- byte tag = c.getTag();
-
- switch(tag) {
- case Constants.CONSTANT_Class:
- i = ((ConstantClass)c).getNameIndex();
- c = getConstant(i, Constants.CONSTANT_Utf8);
- str = Utility.compactClassName(((ConstantUtf8)c).getBytes(), false);
- break;
-
- case Constants.CONSTANT_String:
- i = ((ConstantString)c).getStringIndex();
- c = getConstant(i, Constants.CONSTANT_Utf8);
- str = "\"" + escape(((ConstantUtf8)c).getBytes()) + "\"";
- break;
-
- case Constants.CONSTANT_Utf8: str = ((ConstantUtf8)c).getBytes(); break;
- case Constants.CONSTANT_Double: str = "" + ((ConstantDouble)c).getBytes(); break;
- case Constants.CONSTANT_Float: str = "" + ((ConstantFloat)c).getBytes(); break;
- case Constants.CONSTANT_Long: str = "" + ((ConstantLong)c).getBytes(); break;
- case Constants.CONSTANT_Integer: str = "" + ((ConstantInteger)c).getBytes(); break;
-
- case Constants.CONSTANT_NameAndType:
- str = (constantToString(((ConstantNameAndType)c).getNameIndex(),
- Constants.CONSTANT_Utf8) + " " +
- constantToString(((ConstantNameAndType)c).getSignatureIndex(),
- Constants.CONSTANT_Utf8));
- break;
-
- case Constants.CONSTANT_InterfaceMethodref: case Constants.CONSTANT_Methodref:
- case Constants.CONSTANT_Fieldref:
- str = (constantToString(((ConstantCP)c).getClassIndex(),
- Constants.CONSTANT_Class) + "." +
- constantToString(((ConstantCP)c).getNameAndTypeIndex(),
- Constants.CONSTANT_NameAndType));
- break;
-
- default: // Never reached
- throw new RuntimeException("Unknown constant type " + tag);
- }
-
- return str;
- }
-
- private static final String escape(String str) {
- int len = str.length();
- StringBuffer buf = new StringBuffer(len + 5);
- char[] ch = str.toCharArray();
-
- for(int i=0; i < len; i++) {
- switch(ch[i]) {
- case '\n' : buf.append("\\n"); break;
- case '\r' : buf.append("\\r"); break;
- case '\t' : buf.append("\\t"); break;
- case '\b' : buf.append("\\b"); break;
- case '"' : buf.append("\\\""); break;
- default: buf.append(ch[i]);
- }
- }
-
- return buf.toString();
- }
-
-
- /**
- * Retrieve constant at `index' from constant pool and resolve it to
- * a string representation.
- *
- * @param index of constant in constant pool
- * @param tag expected type
- * @return String representation
- */
- public String constantToString(int index, byte tag)
- throws ClassFormatException
- {
- Constant c = getConstant(index, tag);
- return constantToString(c);
- }
-
- /**
- * Dump constant pool to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- public void dump(DataOutputStream file) throws IOException
- {
- file.writeShort(constant_pool_count);
-
- for(int i=1; i < constant_pool_count; i++)
- if(constant_pool[i] != null)
- constant_pool[i].dump(file);
- }
-
- /**
- * Get constant from constant pool.
- *
- * @param index Index in constant pool
- * @return Constant value
- * @see Constant
- */
- public Constant getConstant(int index) {
- if (index >= constant_pool.length || index < 0)
- throw new ClassFormatException("Invalid constant pool reference: " +
- index + ". Constant pool size is: " +
- constant_pool.length);
- return constant_pool[index];
- }
-
- /**
- * Get constant from constant pool and check whether it has the
- * expected type.
- *
- * @param index Index in constant pool
- * @param tag Tag of expected constant, i.e., its type
- * @return Constant value
- * @see Constant
- * @throws ClassFormatException
- */
- public Constant getConstant(int index, byte tag)
- throws ClassFormatException
- {
- Constant c;
-
- c = getConstant(index);
-
- if(c == null)
- throw new ClassFormatException("Constant pool at index " + index + " is null.");
-
- if(c.getTag() == tag)
- return c;
- else
- throw new ClassFormatException("Expected class `" + Constants.CONSTANT_NAMES[tag] +
- "' at index " + index + " and got " + c);
- }
-
- /**
- * @return Array of constants.
- * @see Constant
- */
- public Constant[] getConstantPool() { return constant_pool; }
- /**
- * Get string from constant pool and bypass the indirection of
- * `ConstantClass' and `ConstantString' objects. I.e. these classes have
- * an index field that points to another entry of the constant pool of
- * type `ConstantUtf8' which contains the real data.
- *
- * @param index Index in constant pool
- * @param tag Tag of expected constant, either ConstantClass or ConstantString
- * @return Contents of string reference
- * @see ConstantClass
- * @see ConstantString
- * @throws ClassFormatException
- */
- public String getConstantString(int index, byte tag)
- throws ClassFormatException
- {
- Constant c;
- int i;
-
- c = getConstant(index, tag);
-
- /* This switch() is not that elegant, since the two classes have the
- * same contents, they just differ in the name of the index
- * field variable.
- * But we want to stick to the JVM naming conventions closely though
- * we could have solved these more elegantly by using the same
- * variable name or by subclassing.
- */
- switch(tag) {
- case Constants.CONSTANT_Class: i = ((ConstantClass)c).getNameIndex(); break;
- case Constants.CONSTANT_String: i = ((ConstantString)c).getStringIndex(); break;
- default:
- throw new RuntimeException("getConstantString called with illegal tag " + tag);
- }
-
- // Finally get the string from the constant pool
- c = getConstant(i, Constants.CONSTANT_Utf8);
- return ((ConstantUtf8)c).getBytes();
- }
- /**
- * @return Length of constant pool.
- */
- public int getLength()
- {
- return constant_pool_count;
- }
-
- /**
- * @param constant Constant to set
- */
- public void setConstant(int index, Constant constant) {
- constant_pool[index] = constant;
- }
-
- /**
- * @param constant_pool
- */
- public void setConstantPool(Constant[] constant_pool) {
- this.constant_pool = constant_pool;
- constant_pool_count = (constant_pool == null)? 0 : constant_pool.length;
- }
- /**
- * @return String representation.
- */
- public String toString() {
- StringBuffer buf = new StringBuffer();
-
- for(int i=1; i < constant_pool_count; i++)
- buf.append(i + ")" + constant_pool[i] + "\n");
-
- return buf.toString();
- }
-
- /**
- * @return deep copy of this constant pool
- */
- public ConstantPool copy() {
- ConstantPool c = null;
-
- try {
- c = (ConstantPool)clone();
- } catch(CloneNotSupportedException e) {}
-
- c.constant_pool = new Constant[constant_pool_count];
-
- for(int i=1; i < constant_pool_count; i++) {
- if(constant_pool[i] != null)
- c.constant_pool[i] = constant_pool[i].copy();
- }
-
- return c;
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/ConstantString.java b/src/com/sun/org/apache/bcel/internal/classfile/ConstantString.java
deleted file mode 100644
index 40ea529..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/ConstantString.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import java.io.*;
-
-/**
- * This class is derived from the abstract
- * <A HREF="com.sun.org.apache.bcel.internal.classfile.Constant.html">Constant</A> class
- * and represents a reference to a String object.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see Constant
- */
-public final class ConstantString extends Constant implements ConstantObject {
- private int string_index; // Identical to ConstantClass except for this name
-
- /**
- * Initialize from another object.
- */
- public ConstantString(ConstantString c) {
- this(c.getStringIndex());
- }
- /**
- * Initialize instance from file data.
- *
- * @param file Input stream
- * @throws IOException
- */
- ConstantString(DataInputStream file) throws IOException
- {
- this((int)file.readUnsignedShort());
- }
- /**
- * @param string_index Index of Constant_Utf8 in constant pool
- */
- public ConstantString(int string_index)
- {
- super(Constants.CONSTANT_String);
- this.string_index = string_index;
- }
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitConstantString(this);
- }
- /**
- * Dump constant field reference to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- public final void dump(DataOutputStream file) throws IOException
- {
- file.writeByte(tag);
- file.writeShort(string_index);
- }
- /**
- * @return Index in constant pool of the string (ConstantUtf8).
- */
- public final int getStringIndex() { return string_index; }
- /**
- * @param string_index.
- */
- public final void setStringIndex(int string_index) {
- this.string_index = string_index;
- }
- /**
- * @return String representation.
- */
- public final String toString()
- {
- return super.toString() + "(string_index = " + string_index + ")";
- }
-
- /** @return String object
- */
- public Object getConstantValue(ConstantPool cp) {
- Constant c = cp.getConstant(string_index, Constants.CONSTANT_Utf8);
- return ((ConstantUtf8)c).getBytes();
- }
-
- /** @return dereferenced string
- */
- public String getBytes(ConstantPool cp) {
- return (String)getConstantValue(cp);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/ConstantUtf8.java b/src/com/sun/org/apache/bcel/internal/classfile/ConstantUtf8.java
deleted file mode 100644
index 32e9555..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/ConstantUtf8.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import java.io.*;
-
-/**
- * This class is derived from the abstract
- * <A HREF="com.sun.org.apache.bcel.internal.classfile.Constant.html">Constant</A> class
- * and represents a reference to a Utf8 encoded string.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see Constant
- */
-public final class ConstantUtf8 extends Constant {
- private String bytes;
-
- /**
- * Initialize from another object.
- */
- public ConstantUtf8(ConstantUtf8 c) {
- this(c.getBytes());
- }
-
- /**
- * Initialize instance from file data.
- *
- * @param file Input stream
- * @throws IOException
- */
- ConstantUtf8(DataInputStream file) throws IOException
- {
- super(Constants.CONSTANT_Utf8);
-
- bytes = file.readUTF();
- }
-
- /**
- * @param bytes Data
- */
- public ConstantUtf8(String bytes)
- {
- super(Constants.CONSTANT_Utf8);
-
- if(bytes == null)
- throw new IllegalArgumentException("bytes must not be null!");
-
- this.bytes = bytes;
- }
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitConstantUtf8(this);
- }
-
- /**
- * Dump String in Utf8 format to file stream.
- *
- * @param file Output file stream
- * @throws IOException
- */
- public final void dump(DataOutputStream file) throws IOException
- {
- file.writeByte(tag);
- file.writeUTF(bytes);
- }
-
- /**
- * @return Data converted to string.
- */
- public final String getBytes() { return bytes; }
-
- /**
- * @param bytes.
- */
- public final void setBytes(String bytes) {
- this.bytes = bytes;
- }
-
- /**
- * @return String representation
- */
- public final String toString()
- {
- return super.toString() + "(\"" + Utility.replace(bytes, "\n", "\\n") + "\")";
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/ConstantValue.java b/src/com/sun/org/apache/bcel/internal/classfile/ConstantValue.java
deleted file mode 100644
index e16d47b..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/ConstantValue.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import java.io.*;
-
-/**
- * This class is derived from <em>Attribute</em> and represents a constant
- * value, i.e., a default value for initializing a class field.
- * This class is instantiated by the <em>Attribute.readAttribute()</em> method.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see Attribute
- */
-public final class ConstantValue extends Attribute {
- private int constantvalue_index;
-
- /**
- * Initialize from another object. Note that both objects use the same
- * references (shallow copy). Use clone() for a physical copy.
- */
- public ConstantValue(ConstantValue c) {
- this(c.getNameIndex(), c.getLength(), c.getConstantValueIndex(),
- c.getConstantPool());
- }
-
- /**
- * Construct object from file stream.
- * @param name_index Name index in constant pool
- * @param length Content length in bytes
- * @param file Input stream
- * @param constant_pool Array of constants
- * @throw IOException
- */
- ConstantValue(int name_index, int length, DataInputStream file,
- ConstantPool constant_pool) throws IOException
- {
- this(name_index, length, (int)file.readUnsignedShort(), constant_pool);
- }
-
- /**
- * @param name_index Name index in constant pool
- * @param length Content length in bytes
- * @param constantvalue_index Index in constant pool
- * @param constant_pool Array of constants
- */
- public ConstantValue(int name_index, int length,
- int constantvalue_index,
- ConstantPool constant_pool)
- {
- super(Constants.ATTR_CONSTANT_VALUE, name_index, length, constant_pool);
- this.constantvalue_index = constantvalue_index;
- }
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitConstantValue(this);
- }
- /**
- * Dump constant value attribute to file stream on binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- public final void dump(DataOutputStream file) throws IOException
- {
- super.dump(file);
- file.writeShort(constantvalue_index);
- }
- /**
- * @return Index in constant pool of constant value.
- */
- public final int getConstantValueIndex() { return constantvalue_index; }
-
- /**
- * @param constantvalue_index.
- */
- public final void setConstantValueIndex(int constantvalue_index) {
- this.constantvalue_index = constantvalue_index;
- }
-
- /**
- * @return String representation of constant value.
- */
- public final String toString() {
- Constant c = constant_pool.getConstant(constantvalue_index);
-
- String buf;
- int i;
-
- // Print constant to string depending on its type
- switch(c.getTag()) {
- case Constants.CONSTANT_Long: buf = "" + ((ConstantLong)c).getBytes(); break;
- case Constants.CONSTANT_Float: buf = "" + ((ConstantFloat)c).getBytes(); break;
- case Constants.CONSTANT_Double: buf = "" + ((ConstantDouble)c).getBytes(); break;
- case Constants.CONSTANT_Integer: buf = "" + ((ConstantInteger)c).getBytes(); break;
- case Constants.CONSTANT_String:
- i = ((ConstantString)c).getStringIndex();
- c = constant_pool.getConstant(i, Constants.CONSTANT_Utf8);
- buf = "\"" + Utility.convertString(((ConstantUtf8)c).getBytes()) + "\"";
- break;
-
- default:
- throw new IllegalStateException("Type of ConstValue invalid: " + c);
- }
-
- return buf;
- }
-
- /**
- * @return deep copy of this attribute
- */
- public Attribute copy(ConstantPool constant_pool) {
- ConstantValue c = (ConstantValue)clone();
- c.constant_pool = constant_pool;
- return c;
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/Deprecated.java b/src/com/sun/org/apache/bcel/internal/classfile/Deprecated.java
deleted file mode 100644
index 096f77f..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/Deprecated.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import java.io.*;
-
-/**
- * This class is derived from <em>Attribute</em> and denotes that this is a
- * deprecated method.
- * It is instantiated from the <em>Attribute.readAttribute()</em> method.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see Attribute
- */
-public final class Deprecated extends Attribute {
- private byte[] bytes;
-
- /**
- * Initialize from another object. Note that both objects use the same
- * references (shallow copy). Use clone() for a physical copy.
- */
- public Deprecated(Deprecated c) {
- this(c.getNameIndex(), c.getLength(), c.getBytes(), c.getConstantPool());
- }
-
- /**
- * @param name_index Index in constant pool to CONSTANT_Utf8
- * @param length Content length in bytes
- * @param bytes Attribute contents
- * @param constant_pool Array of constants
- */
- public Deprecated(int name_index, int length, byte[] bytes,
- ConstantPool constant_pool)
- {
- super(Constants.ATTR_DEPRECATED, name_index, length, constant_pool);
- this.bytes = bytes;
- }
-
- /**
- * Construct object from file stream.
- * @param name_index Index in constant pool to CONSTANT_Utf8
- * @param length Content length in bytes
- * @param file Input stream
- * @param constant_pool Array of constants
- * @throws IOException
- */
- Deprecated(int name_index, int length, DataInputStream file,
- ConstantPool constant_pool) throws IOException
- {
- this(name_index, length, (byte [])null, constant_pool);
-
- if(length > 0) {
- bytes = new byte[length];
- file.readFully(bytes);
- System.err.println("Deprecated attribute with length > 0");
- }
- }
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitDeprecated(this);
- }
-
- /**
- * Dump source file attribute to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- public final void dump(DataOutputStream file) throws IOException
- {
- super.dump(file);
-
- if(length > 0)
- file.write(bytes, 0, length);
- }
-
- /**
- * @return data bytes.
- */
- public final byte[] getBytes() { return bytes; }
-
- /**
- * @param bytes.
- */
- public final void setBytes(byte[] bytes) {
- this.bytes = bytes;
- }
-
- /**
- * @return attribute name
- */
- public final String toString() {
- return Constants.ATTRIBUTE_NAMES[Constants.ATTR_DEPRECATED];
- }
-
- /**
- * @return deep copy of this attribute
- */
- public Attribute copy(ConstantPool constant_pool) {
- Deprecated c = (Deprecated)clone();
-
- if(bytes != null)
- c.bytes = (byte[])bytes.clone();
-
- c.constant_pool = constant_pool;
- return c;
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/DescendingVisitor.java b/src/com/sun/org/apache/bcel/internal/classfile/DescendingVisitor.java
deleted file mode 100644
index 763eca6..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/DescendingVisitor.java
+++ /dev/null
@@ -1,370 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import java.util.Stack;
-
-/**
- * Traverses a JavaClass with another Visitor object 'piggy-backed'
- * that is applied to all components of a JavaClass object. I.e. this
- * class supplies the traversal strategy, other classes can make use
- * of it.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class DescendingVisitor implements Visitor {
- private JavaClass clazz;
- private Visitor visitor;
- private Stack stack = new Stack();
-
- /** @return container of current entitity, i.e., predecessor during traversal
- */
- public Object predecessor() {
- return predecessor(0);
- }
-
- /**
- * @param level nesting level, i.e., 0 returns the direct predecessor
- * @return container of current entitity, i.e., predecessor during traversal
- */
- public Object predecessor(int level) {
- int size = stack.size();
-
- if((size < 2) || (level < 0))
- return null;
- else
- return stack.elementAt(size - (level + 2)); // size - 1 == current
- }
-
- /** @return current object
- */
- public Object current() {
- return stack.peek();
- }
-
- /**
- * @param clazz Class to traverse
- * @param visitor visitor object to apply to all components
- */
- public DescendingVisitor(JavaClass clazz, Visitor visitor) {
- this.clazz = clazz;
- this.visitor = visitor;
- }
-
- /**
- * Start traversal.
- */
- public void visit() { clazz.accept(this); }
-
- public void visitJavaClass(JavaClass clazz) {
- stack.push(clazz);
- clazz.accept(visitor);
-
- Field[] fields = clazz.getFields();
- for(int i=0; i < fields.length; i++)
- fields[i].accept(this);
-
- Method[] methods = clazz.getMethods();
- for(int i=0; i < methods.length; i++)
- methods[i].accept(this);
-
- Attribute[] attributes = clazz.getAttributes();
- for(int i=0; i < attributes.length; i++)
- attributes[i].accept(this);
-
- clazz.getConstantPool().accept(this);
- stack.pop();
- }
-
- public void visitField(Field field) {
- stack.push(field);
- field.accept(visitor);
-
- Attribute[] attributes = field.getAttributes();
- for(int i=0; i < attributes.length; i++)
- attributes[i].accept(this);
- stack.pop();
- }
-
- public void visitConstantValue(ConstantValue cv) {
- stack.push(cv);
- cv.accept(visitor);
- stack.pop();
- }
-
- public void visitMethod(Method method) {
- stack.push(method);
- method.accept(visitor);
-
- Attribute[] attributes = method.getAttributes();
- for(int i=0; i < attributes.length; i++)
- attributes[i].accept(this);
-
- stack.pop();
- }
-
- public void visitExceptionTable(ExceptionTable table) {
- stack.push(table);
- table.accept(visitor);
- stack.pop();
- }
-
- public void visitCode(Code code) {
- stack.push(code);
- code.accept(visitor);
-
- CodeException[] table = code.getExceptionTable();
- for(int i=0; i < table.length; i++)
- table[i].accept(this);
-
- Attribute[] attributes = code.getAttributes();
- for(int i=0; i < attributes.length; i++)
- attributes[i].accept(this);
- stack.pop();
- }
-
- public void visitCodeException(CodeException ce) {
- stack.push(ce);
- ce.accept(visitor);
- stack.pop();
- }
-
- public void visitLineNumberTable(LineNumberTable table) {
- stack.push(table);
- table.accept(visitor);
-
- LineNumber[] numbers = table.getLineNumberTable();
- for(int i=0; i < numbers.length; i++)
- numbers[i].accept(this);
- stack.pop();
- }
-
- public void visitLineNumber(LineNumber number) {
- stack.push(number);
- number.accept(visitor);
- stack.pop();
- }
-
- public void visitLocalVariableTable(LocalVariableTable table) {
- stack.push(table);
- table.accept(visitor);
-
- LocalVariable[] vars = table.getLocalVariableTable();
- for(int i=0; i < vars.length; i++)
- vars[i].accept(this);
- stack.pop();
- }
-
- public void visitLocalVariableTypeTable(LocalVariableTypeTable obj) {
- stack.push(obj);
- obj.accept(visitor);
-
- LocalVariable[] vars = obj.getLocalVariableTypeTable();
- for(int i=0; i < vars.length; i++)
- vars[i].accept(this);
- stack.pop();
- }
-
- public void visitStackMap(StackMap table) {
- stack.push(table);
- table.accept(visitor);
-
- StackMapEntry[] vars = table.getStackMap();
-
- for(int i=0; i < vars.length; i++)
- vars[i].accept(this);
- stack.pop();
- }
-
- public void visitStackMapEntry(StackMapEntry var) {
- stack.push(var);
- var.accept(visitor);
- stack.pop();
- }
-
- public void visitLocalVariable(LocalVariable var) {
- stack.push(var);
- var.accept(visitor);
- stack.pop();
- }
-
- public void visitConstantPool(ConstantPool cp) {
- stack.push(cp);
- cp.accept(visitor);
-
- Constant[] constants = cp.getConstantPool();
- for(int i=1; i < constants.length; i++) {
- if(constants[i] != null)
- constants[i].accept(this);
- }
-
- stack.pop();
- }
-
- public void visitConstantClass(ConstantClass constant) {
- stack.push(constant);
- constant.accept(visitor);
- stack.pop();
- }
-
- public void visitConstantDouble(ConstantDouble constant) {
- stack.push(constant);
- constant.accept(visitor);
- stack.pop();
- }
-
- public void visitConstantFieldref(ConstantFieldref constant) {
- stack.push(constant);
- constant.accept(visitor);
- stack.pop();
- }
-
- public void visitConstantFloat(ConstantFloat constant) {
- stack.push(constant);
- constant.accept(visitor);
- stack.pop();
- }
-
- public void visitConstantInteger(ConstantInteger constant) {
- stack.push(constant);
- constant.accept(visitor);
- stack.pop();
- }
-
- public void visitConstantInterfaceMethodref(ConstantInterfaceMethodref constant) {
- stack.push(constant);
- constant.accept(visitor);
- stack.pop();
- }
-
- public void visitConstantLong(ConstantLong constant) {
- stack.push(constant);
- constant.accept(visitor);
- stack.pop();
- }
-
- public void visitConstantMethodref(ConstantMethodref constant) {
- stack.push(constant);
- constant.accept(visitor);
- stack.pop();
- }
-
- public void visitConstantNameAndType(ConstantNameAndType constant) {
- stack.push(constant);
- constant.accept(visitor);
- stack.pop();
- }
-
- public void visitConstantString(ConstantString constant) {
- stack.push(constant);
- constant.accept(visitor);
- stack.pop();
- }
-
- public void visitConstantUtf8(ConstantUtf8 constant) {
- stack.push(constant);
- constant.accept(visitor);
- stack.pop();
- }
-
- public void visitInnerClasses(InnerClasses ic) {
- stack.push(ic);
- ic.accept(visitor);
-
- InnerClass[] ics = ic.getInnerClasses();
- for(int i=0; i < ics.length; i++)
- ics[i].accept(this);
- stack.pop();
- }
-
- public void visitInnerClass(InnerClass inner) {
- stack.push(inner);
- inner.accept(visitor);
- stack.pop();
- }
-
- public void visitDeprecated(Deprecated attribute) {
- stack.push(attribute);
- attribute.accept(visitor);
- stack.pop();
- }
-
- public void visitSignature(Signature attribute) {
- stack.push(attribute);
- attribute.accept(visitor);
- stack.pop();
- }
-
- public void visitSourceFile(SourceFile attribute) {
- stack.push(attribute);
- attribute.accept(visitor);
- stack.pop();
- }
-
- public void visitSynthetic(Synthetic attribute) {
- stack.push(attribute);
- attribute.accept(visitor);
- stack.pop();
- }
-
- public void visitUnknown(Unknown attribute) {
- stack.push(attribute);
- attribute.accept(visitor);
- stack.pop();
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/EmptyVisitor.java b/src/com/sun/org/apache/bcel/internal/classfile/EmptyVisitor.java
deleted file mode 100644
index 32a1cc1..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/EmptyVisitor.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.classfile.*;
-import com.sun.org.apache.bcel.internal.*;
-
-/**
- * Visitor with empty method bodies, can be extended and used in conjunction with the
- * DescendingVisitor class, e.g.
- *
- * By courtesy of David Spencer.
- *
- * @see DescendingVisitor
- *
- */
-public class EmptyVisitor implements Visitor {
- protected EmptyVisitor() { }
-
- public void visitCode(Code obj) {}
- public void visitCodeException(CodeException obj) {}
- public void visitConstantClass(ConstantClass obj) {}
- public void visitConstantDouble(ConstantDouble obj) {}
- public void visitConstantFieldref(ConstantFieldref obj) {}
- public void visitConstantFloat(ConstantFloat obj) {}
- public void visitConstantInteger(ConstantInteger obj) {}
- public void visitConstantInterfaceMethodref(ConstantInterfaceMethodref obj) {}
- public void visitConstantLong(ConstantLong obj) {}
- public void visitConstantMethodref(ConstantMethodref obj) {}
- public void visitConstantNameAndType(ConstantNameAndType obj) {}
- public void visitConstantPool(ConstantPool obj) {}
- public void visitConstantString(ConstantString obj) {}
- public void visitConstantUtf8(ConstantUtf8 obj) {}
- public void visitConstantValue(ConstantValue obj) {}
- public void visitDeprecated(Deprecated obj) {}
- public void visitExceptionTable(ExceptionTable obj) {}
- public void visitField(Field obj) {}
- public void visitInnerClass(InnerClass obj) {}
- public void visitInnerClasses(InnerClasses obj) {}
- public void visitJavaClass(JavaClass obj) {}
- public void visitLineNumber(LineNumber obj) {}
- public void visitLineNumberTable(LineNumberTable obj) {}
- public void visitLocalVariable(LocalVariable obj) {}
- public void visitLocalVariableTable(LocalVariableTable obj) {}
- public void visitLocalVariableTypeTable(LocalVariableTypeTable obj) {}
- public void visitMethod(Method obj) {}
- public void visitSignature(Signature obj) {}
- public void visitSourceFile(SourceFile obj) {}
- public void visitSynthetic(Synthetic obj) {}
- public void visitUnknown(Unknown obj) {}
- public void visitStackMap(StackMap obj) {}
- public void visitStackMapEntry(StackMapEntry obj) {}
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/ExceptionTable.java b/src/com/sun/org/apache/bcel/internal/classfile/ExceptionTable.java
deleted file mode 100644
index 0a9e1dc..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/ExceptionTable.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import java.io.*;
-
-/**
- * This class represents the table of exceptions that are thrown by a
- * method. This attribute may be used once per method. The name of
- * this class is <em>ExceptionTable</em> for historical reasons; The
- * Java Virtual Machine Specification, Second Edition defines this
- * attribute using the name <em>Exceptions</em> (which is inconsistent
- * with the other classes).
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see Code
- */
-public final class ExceptionTable extends Attribute {
- private int number_of_exceptions; // Table of indices into
- private int[] exception_index_table; // constant pool
-
- /**
- * Initialize from another object. Note that both objects use the same
- * references (shallow copy). Use copy() for a physical copy.
- */
- public ExceptionTable(ExceptionTable c) {
- this(c.getNameIndex(), c.getLength(), c.getExceptionIndexTable(),
- c.getConstantPool());
- }
-
- /**
- * @param name_index Index in constant pool
- * @param length Content length in bytes
- * @param exception_index_table Table of indices in constant pool
- * @param constant_pool Array of constants
- */
- public ExceptionTable(int name_index, int length,
- int[] exception_index_table,
- ConstantPool constant_pool)
- {
- super(Constants.ATTR_EXCEPTIONS, name_index, length, constant_pool);
- setExceptionIndexTable(exception_index_table);
- }
-
- /**
- * Construct object from file stream.
- * @param name_index Index in constant pool
- * @param length Content length in bytes
- * @param file Input stream
- * @param constant_pool Array of constants
- * @throws IOException
- */
- ExceptionTable(int name_index, int length, DataInputStream file,
- ConstantPool constant_pool) throws IOException
- {
- this(name_index, length, (int[])null, constant_pool);
-
- number_of_exceptions = file.readUnsignedShort();
- exception_index_table = new int[number_of_exceptions];
-
- for(int i=0; i < number_of_exceptions; i++)
- exception_index_table[i] = file.readUnsignedShort();
- }
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitExceptionTable(this);
- }
-
- /**
- * Dump exceptions attribute to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- public final void dump(DataOutputStream file) throws IOException
- {
- super.dump(file);
- file.writeShort(number_of_exceptions);
- for(int i=0; i < number_of_exceptions; i++)
- file.writeShort(exception_index_table[i]);
- }
-
- /**
- * @return Array of indices into constant pool of thrown exceptions.
- */
- public final int[] getExceptionIndexTable() {return exception_index_table;}
- /**
- * @return Length of exception table.
- */
- public final int getNumberOfExceptions() { return number_of_exceptions; }
-
- /**
- * @return class names of thrown exceptions
- */
- public final String[] getExceptionNames() {
- String[] names = new String[number_of_exceptions];
- for(int i=0; i < number_of_exceptions; i++)
- names[i] = constant_pool.getConstantString(exception_index_table[i],
- Constants.CONSTANT_Class).
- replace('/', '.');
- return names;
- }
-
- /**
- * @param exception_index_table.
- * Also redefines number_of_exceptions according to table length.
- */
- public final void setExceptionIndexTable(int[] exception_index_table) {
- this.exception_index_table = exception_index_table;
- number_of_exceptions = (exception_index_table == null)? 0 :
- exception_index_table.length;
- }
- /**
- * @return String representation, i.e., a list of thrown exceptions.
- */
- public final String toString() {
- StringBuffer buf = new StringBuffer("");
- String str;
-
- for(int i=0; i < number_of_exceptions; i++) {
- str = constant_pool.getConstantString(exception_index_table[i],
- Constants.CONSTANT_Class);
- buf.append(Utility.compactClassName(str, false));
-
- if(i < number_of_exceptions - 1)
- buf.append(", ");
- }
-
- return buf.toString();
- }
-
- /**
- * @return deep copy of this attribute
- */
- public Attribute copy(ConstantPool constant_pool) {
- ExceptionTable c = (ExceptionTable)clone();
- c.exception_index_table = (int[])exception_index_table.clone();
- c.constant_pool = constant_pool;
- return c;
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/Field.java b/src/com/sun/org/apache/bcel/internal/classfile/Field.java
deleted file mode 100644
index 6bc42ee..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/Field.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import com.sun.org.apache.bcel.internal.Constants;
-import com.sun.org.apache.bcel.internal.generic.Type;
-import java.io.*;
-
-/**
- * This class represents the field info structure, i.e., the representation
- * for a variable in the class. See JVM specification for details.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public final class Field extends FieldOrMethod {
- /**
- * Initialize from another object. Note that both objects use the same
- * references (shallow copy). Use clone() for a physical copy.
- */
- public Field(Field c) {
- super(c);
- }
-
- /**
- * Construct object from file stream.
- * @param file Input stream
- */
- Field(DataInputStream file, ConstantPool constant_pool)
- throws IOException, ClassFormatException
- {
- super(file, constant_pool);
- }
-
- /**
- * @param access_flags Access rights of field
- * @param name_index Points to field name in constant pool
- * @param signature_index Points to encoded signature
- * @param attributes Collection of attributes
- * @param constant_pool Array of constants
- */
- public Field(int access_flags, int name_index, int signature_index,
- Attribute[] attributes, ConstantPool constant_pool)
- {
- super(access_flags, name_index, signature_index, attributes, constant_pool);
- }
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitField(this);
- }
-
- /**
- * @return constant value associated with this field (may be null)
- */
- public final ConstantValue getConstantValue() {
- for(int i=0; i < attributes_count; i++)
- if(attributes[i].getTag() == Constants.ATTR_CONSTANT_VALUE)
- return (ConstantValue)attributes[i];
-
- return null;
- }
-
- /**
- * Return string representation close to declaration format,
- * `public static final short MAX = 100', e.g..
- *
- * @return String representation of field, including the signature.
- */
- public final String toString() {
- String name, signature, access; // Short cuts to constant pool
-
- // Get names from constant pool
- access = Utility.accessToString(access_flags);
- access = access.equals("")? "" : (access + " ");
- signature = Utility.signatureToString(getSignature());
- name = getName();
-
- StringBuffer buf = new StringBuffer(access + signature + " " + name);
- ConstantValue cv = getConstantValue();
-
- if(cv != null)
- buf.append(" = " + cv);
-
- for(int i=0; i < attributes_count; i++) {
- Attribute a = attributes[i];
-
- if(!(a instanceof ConstantValue))
- buf.append(" [" + a.toString() + "]");
- }
-
- return buf.toString();
- }
-
- /**
- * @return deep copy of this field
- */
- public final Field copy(ConstantPool constant_pool) {
- return (Field)copy_(constant_pool);
- }
-
- /**
- * @return type of field
- */
- public Type getType() {
- return Type.getReturnType(getSignature());
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/FieldOrMethod.java b/src/com/sun/org/apache/bcel/internal/classfile/FieldOrMethod.java
deleted file mode 100644
index 86b7da2..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/FieldOrMethod.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import com.sun.org.apache.bcel.internal.Constants;
-import java.io.*;
-
-/**
- * Abstract super class for fields and methods.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public abstract class FieldOrMethod extends AccessFlags implements Cloneable, Node {
- protected int name_index; // Points to field name in constant pool
- protected int signature_index; // Points to encoded signature
- protected int attributes_count;// No. of attributes
- protected Attribute[] attributes; // Collection of attributes
- protected ConstantPool constant_pool;
-
- FieldOrMethod() {}
-
- /**
- * Initialize from another object. Note that both objects use the same
- * references (shallow copy). Use clone() for a physical copy.
- */
- protected FieldOrMethod(FieldOrMethod c) {
- this(c.getAccessFlags(), c.getNameIndex(), c.getSignatureIndex(),
- c.getAttributes(), c.getConstantPool());
- }
-
- /**
- * Construct object from file stream.
- * @param file Input stream
- * @throws IOException
- * @throws ClassFormatException
- */
- protected FieldOrMethod(DataInputStream file, ConstantPool constant_pool)
- throws IOException, ClassFormatException
- {
- this(file.readUnsignedShort(), file.readUnsignedShort(),
- file.readUnsignedShort(), null, constant_pool);
-
- attributes_count = file.readUnsignedShort();
- attributes = new Attribute[attributes_count];
- for(int i=0; i < attributes_count; i++)
- attributes[i] = Attribute.readAttribute(file, constant_pool);
- }
-
- /**
- * @param access_flags Access rights of method
- * @param name_index Points to field name in constant pool
- * @param signature_index Points to encoded signature
- * @param attributes Collection of attributes
- * @param constant_pool Array of constants
- */
- protected FieldOrMethod(int access_flags, int name_index, int signature_index,
- Attribute[] attributes, ConstantPool constant_pool)
- {
- this.access_flags = access_flags;
- this.name_index = name_index;
- this.signature_index = signature_index;
- this.constant_pool = constant_pool;
-
- setAttributes(attributes);
- }
-
- /**
- * Dump object to file stream on binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- public final void dump(DataOutputStream file) throws IOException
- {
- file.writeShort(access_flags);
- file.writeShort(name_index);
- file.writeShort(signature_index);
- file.writeShort(attributes_count);
-
- for(int i=0; i < attributes_count; i++)
- attributes[i].dump(file);
- }
-
- /**
- * @return Collection of object attributes.
- */
- public final Attribute[] getAttributes() { return attributes; }
-
- /**
- * @param attributes Collection of object attributes.
- */
- public final void setAttributes(Attribute[] attributes) {
- this.attributes = attributes;
- attributes_count = (attributes == null)? 0 : attributes.length;
- }
-
- /**
- * @return Constant pool used by this object.
- */
- public final ConstantPool getConstantPool() { return constant_pool; }
-
- /**
- * @param constant_pool Constant pool to be used for this object.
- */
- public final void setConstantPool(ConstantPool constant_pool) {
- this.constant_pool = constant_pool;
- }
-
- /**
- * @return Index in constant pool of object's name.
- */
- public final int getNameIndex() { return name_index; }
-
- /**
- * @param name_index Index in constant pool of object's name.
- */
- public final void setNameIndex(int name_index) {
- this.name_index = name_index;
- }
-
- /**
- * @return Index in constant pool of field signature.
- */
- public final int getSignatureIndex() { return signature_index; }
-
- /**
- * @param signature_index Index in constant pool of field signature.
- */
- public final void setSignatureIndex(int signature_index) {
- this.signature_index = signature_index;
- }
-
- /**
- * @return Name of object, i.e., method name or field name
- */
- public final String getName() {
- ConstantUtf8 c;
- c = (ConstantUtf8)constant_pool.getConstant(name_index,
- Constants.CONSTANT_Utf8);
- return c.getBytes();
- }
-
- /**
- * @return String representation of object's type signature (java style)
- */
- public final String getSignature() {
- ConstantUtf8 c;
- c = (ConstantUtf8)constant_pool.getConstant(signature_index,
- Constants.CONSTANT_Utf8);
- return c.getBytes();
- }
-
- /**
- * @return deep copy of this field
- */
- protected FieldOrMethod copy_(ConstantPool constant_pool) {
- FieldOrMethod c = null;
-
- try {
- c = (FieldOrMethod)clone();
- } catch(CloneNotSupportedException e) {}
-
- c.constant_pool = constant_pool;
- c.attributes = new Attribute[attributes_count];
-
- for(int i=0; i < attributes_count; i++)
- c.attributes[i] = attributes[i].copy(constant_pool);
-
- return c;
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/InnerClass.java b/src/com/sun/org/apache/bcel/internal/classfile/InnerClass.java
deleted file mode 100644
index 8693fa6..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/InnerClass.java
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import java.io.*;
-
-/**
- * This class represents a inner class attribute, i.e., the class
- * indices of the inner and outer classes, the name and the attributes
- * of the inner class.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see InnerClasses
- */
-public final class InnerClass implements Cloneable, Node {
- private int inner_class_index;
- private int outer_class_index;
- private int inner_name_index;
- private int inner_access_flags;
-
- /**
- * Initialize from another object.
- */
- public InnerClass(InnerClass c) {
- this(c.getInnerClassIndex(), c.getOuterClassIndex(), c.getInnerNameIndex(),
- c.getInnerAccessFlags());
- }
-
- /**
- * Construct object from file stream.
- * @param file Input stream
- * @throws IOException
- */
- InnerClass(DataInputStream file) throws IOException
- {
- this(file.readUnsignedShort(), file.readUnsignedShort(),
- file.readUnsignedShort(), file.readUnsignedShort());
- }
-
- /**
- * @param inner_class_index Class index in constant pool of inner class
- * @param outer_class_index Class index in constant pool of outer class
- * @param inner_name_index Name index in constant pool of inner class
- * @param inner_access_flags Access flags of inner class
- */
- public InnerClass(int inner_class_index, int outer_class_index,
- int inner_name_index, int inner_access_flags)
- {
- this.inner_class_index = inner_class_index;
- this.outer_class_index = outer_class_index;
- this.inner_name_index = inner_name_index;
- this.inner_access_flags = inner_access_flags;
- }
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitInnerClass(this);
- }
- /**
- * Dump inner class attribute to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- public final void dump(DataOutputStream file) throws IOException
- {
- file.writeShort(inner_class_index);
- file.writeShort(outer_class_index);
- file.writeShort(inner_name_index);
- file.writeShort(inner_access_flags);
- }
- /**
- * @return access flags of inner class.
- */
- public final int getInnerAccessFlags() { return inner_access_flags; }
- /**
- * @return class index of inner class.
- */
- public final int getInnerClassIndex() { return inner_class_index; }
- /**
- * @return name index of inner class.
- */
- public final int getInnerNameIndex() { return inner_name_index; }
- /**
- * @return class index of outer class.
- */
- public final int getOuterClassIndex() { return outer_class_index; }
- /**
- * @param inner_access_flags.
- */
- public final void setInnerAccessFlags(int inner_access_flags) {
- this.inner_access_flags = inner_access_flags;
- }
- /**
- * @param inner_class_index.
- */
- public final void setInnerClassIndex(int inner_class_index) {
- this.inner_class_index = inner_class_index;
- }
- /**
- * @param inner_name_index.
- */
- public final void setInnerNameIndex(int inner_name_index) {
- this.inner_name_index = inner_name_index;
- }
- /**
- * @param outer_class_index.
- */
- public final void setOuterClassIndex(int outer_class_index) {
- this.outer_class_index = outer_class_index;
- }
- /**
- * @return String representation.
- */
- public final String toString() {
- return "InnerClass(" + inner_class_index + ", " + outer_class_index +
- ", " + inner_name_index + ", " + inner_access_flags + ")";
- }
-
- /**
- * @return Resolved string representation
- */
- public final String toString(ConstantPool constant_pool) {
- String inner_class_name, outer_class_name, inner_name, access;
-
- inner_class_name = constant_pool.getConstantString(inner_class_index,
- Constants.CONSTANT_Class);
- inner_class_name = Utility.compactClassName(inner_class_name);
-
- if (outer_class_index != 0) {
- outer_class_name = constant_pool.getConstantString(outer_class_index,
- Constants.CONSTANT_Class);
- outer_class_name = Utility.compactClassName(outer_class_name);
- }
- else
- outer_class_name = "<not a member>";
-
- if(inner_name_index != 0)
- inner_name = ((ConstantUtf8)constant_pool.
- getConstant(inner_name_index, Constants.CONSTANT_Utf8)).getBytes();
- else
- inner_name = "<anonymous>";
-
- access = Utility.accessToString(inner_access_flags, true);
- access = access.equals("")? "" : (access + " ");
-
- return "InnerClass:" + access + inner_class_name +
- "(\"" + outer_class_name + "\", \"" + inner_name + "\")";
- }
-
- /**
- * @return deep copy of this object
- */
- public InnerClass copy() {
- try {
- return (InnerClass)clone();
- } catch(CloneNotSupportedException e) {}
-
- return null;
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/InnerClasses.java b/src/com/sun/org/apache/bcel/internal/classfile/InnerClasses.java
deleted file mode 100644
index da32036..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/InnerClasses.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import java.io.*;
-
-/**
- * This class is derived from <em>Attribute</em> and denotes that this class
- * is an Inner class of another.
- * to the source file of this class.
- * It is instantiated from the <em>Attribute.readAttribute()</em> method.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see Attribute
- */
-public final class InnerClasses extends Attribute {
- private InnerClass[] inner_classes;
- private int number_of_classes;
-
- /**
- * Initialize from another object. Note that both objects use the same
- * references (shallow copy). Use clone() for a physical copy.
- */
- public InnerClasses(InnerClasses c) {
- this(c.getNameIndex(), c.getLength(), c.getInnerClasses(),
- c.getConstantPool());
- }
-
- /**
- * @param name_index Index in constant pool to CONSTANT_Utf8
- * @param length Content length in bytes
- * @param inner_classes array of inner classes attributes
- * @param constant_pool Array of constants
- * @param sourcefile_index Index in constant pool to CONSTANT_Utf8
- */
- public InnerClasses(int name_index, int length,
- InnerClass[] inner_classes,
- ConstantPool constant_pool)
- {
- super(Constants.ATTR_INNER_CLASSES, name_index, length, constant_pool);
- setInnerClasses(inner_classes);
- }
-
- /**
- * Construct object from file stream.
- *
- * @param name_index Index in constant pool to CONSTANT_Utf8
- * @param length Content length in bytes
- * @param file Input stream
- * @param constant_pool Array of constants
- * @throws IOException
- */
- InnerClasses(int name_index, int length, DataInputStream file,
- ConstantPool constant_pool) throws IOException
- {
- this(name_index, length, (InnerClass[])null, constant_pool);
-
- number_of_classes = file.readUnsignedShort();
- inner_classes = new InnerClass[number_of_classes];
-
- for(int i=0; i < number_of_classes; i++)
- inner_classes[i] = new InnerClass(file);
- }
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitInnerClasses(this);
- }
- /**
- * Dump source file attribute to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- public final void dump(DataOutputStream file) throws IOException
- {
- super.dump(file);
- file.writeShort(number_of_classes);
-
- for(int i=0; i < number_of_classes; i++)
- inner_classes[i].dump(file);
- }
-
- /**
- * @return array of inner class "records"
- */
- public final InnerClass[] getInnerClasses() { return inner_classes; }
-
- /**
- * @param inner_classes.
- */
- public final void setInnerClasses(InnerClass[] inner_classes) {
- this.inner_classes = inner_classes;
- number_of_classes = (inner_classes == null)? 0 : inner_classes.length;
- }
-
- /**
- * @return String representation.
- */
- public final String toString() {
- StringBuffer buf = new StringBuffer();
-
- for(int i=0; i < number_of_classes; i++)
- buf.append(inner_classes[i].toString(constant_pool) + "\n");
-
- return buf.toString();
- }
-
- /**
- * @return deep copy of this attribute
- */
- public Attribute copy(ConstantPool constant_pool) {
- InnerClasses c = (InnerClasses)clone();
-
- c.inner_classes = new InnerClass[number_of_classes];
- for(int i=0; i < number_of_classes; i++)
- c.inner_classes[i] = inner_classes[i].copy();
-
- c.constant_pool = constant_pool;
- return c;
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/JavaClass.java b/src/com/sun/org/apache/bcel/internal/classfile/JavaClass.java
deleted file mode 100644
index 4d28f2a..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/JavaClass.java
+++ /dev/null
@@ -1,826 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import com.sun.org.apache.bcel.internal.util.SyntheticRepository;
-import com.sun.org.apache.bcel.internal.util.ClassVector;
-import com.sun.org.apache.bcel.internal.util.ClassQueue;
-import com.sun.org.apache.bcel.internal.generic.Type;
-import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
-
-import java.io.*;
-import java.util.StringTokenizer;
-
-/**
- * Represents a Java class, i.e., the data structures, constant pool,
- * fields, methods and commands contained in a Java .class file.
- * See <a href="ftp://java.sun.com/docs/specs/">JVM
- * specification</a> for details.
-
- * The intent of this class is to represent a parsed or otherwise existing
- * class file. Those interested in programatically generating classes
- * should see the <a href="../generic/ClassGen.html">ClassGen</a> class.
-
- * @version $Id: JavaClass.java,v 1.4 2007-07-19 04:34:42 ofung Exp $
- * @see com.sun.org.apache.bcel.internal.generic.ClassGen
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class JavaClass extends AccessFlags implements Cloneable, Node {
- private String file_name;
- private String package_name;
- private String source_file_name = "<Unknown>";
- private int class_name_index;
- private int superclass_name_index;
- private String class_name;
- private String superclass_name;
- private int major, minor; // Compiler version
- private ConstantPool constant_pool; // Constant pool
- private int[] interfaces; // implemented interfaces
- private String[] interface_names;
- private Field[] fields; // Fields, i.e., variables of class
- private Method[] methods; // methods defined in the class
- private Attribute[] attributes; // attributes defined in the class
- private byte source = HEAP; // Generated in memory
-
- public static final byte HEAP = 1;
- public static final byte FILE = 2;
- public static final byte ZIP = 3;
-
- static boolean debug = false; // Debugging on/off
- static char sep = '/'; // directory separator
-
- /**
- * In cases where we go ahead and create something,
- * use the default SyntheticRepository, because we
- * don't know any better.
- */
- private transient com.sun.org.apache.bcel.internal.util.Repository repository =
- SyntheticRepository.getInstance();
-
- /**
- * Constructor gets all contents as arguments.
- *
- * @param class_name_index Index into constant pool referencing a
- * ConstantClass that represents this class.
- * @param superclass_name_index Index into constant pool referencing a
- * ConstantClass that represents this class's superclass.
- * @param file_name File name
- * @param major Major compiler version
- * @param minor Minor compiler version
- * @param access_flags Access rights defined by bit flags
- * @param constant_pool Array of constants
- * @param interfaces Implemented interfaces
- * @param fields Class fields
- * @param methods Class methods
- * @param attributes Class attributes
- * @param source Read from file or generated in memory?
- */
- public JavaClass(int class_name_index,
- int superclass_name_index,
- String file_name,
- int major,
- int minor,
- int access_flags,
- ConstantPool constant_pool,
- int[] interfaces,
- Field[] fields,
- Method[] methods,
- Attribute[] attributes,
- byte source)
- {
- if(interfaces == null) // Allowed for backward compatibility
- interfaces = new int[0];
- if(attributes == null)
- this.attributes = new Attribute[0];
- if(fields == null)
- fields = new Field[0];
- if(methods == null)
- methods = new Method[0];
-
- this.class_name_index = class_name_index;
- this.superclass_name_index = superclass_name_index;
- this.file_name = file_name;
- this.major = major;
- this.minor = minor;
- this.access_flags = access_flags;
- this.constant_pool = constant_pool;
- this.interfaces = interfaces;
- this.fields = fields;
- this.methods = methods;
- this.attributes = attributes;
- this.source = source;
-
- // Get source file name if available
- for(int i=0; i < attributes.length; i++) {
- if(attributes[i] instanceof SourceFile) {
- source_file_name = ((SourceFile)attributes[i]).getSourceFileName();
- break;
- }
- }
-
- /* According to the specification the following entries must be of type
- * `ConstantClass' but we check that anyway via the
- * `ConstPool.getConstant' method.
- */
- class_name = constant_pool.getConstantString(class_name_index,
- Constants.CONSTANT_Class);
- class_name = Utility.compactClassName(class_name, false);
-
- int index = class_name.lastIndexOf('.');
- if(index < 0)
- package_name = "";
- else
- package_name = class_name.substring(0, index);
-
- if(superclass_name_index > 0) { // May be zero -> class is java.lang.Object
- superclass_name = constant_pool.getConstantString(superclass_name_index,
- Constants.CONSTANT_Class);
- superclass_name = Utility.compactClassName(superclass_name, false);
- }
- else
- superclass_name = "java.lang.Object";
-
- interface_names = new String[interfaces.length];
- for(int i=0; i < interfaces.length; i++) {
- String str = constant_pool.getConstantString(interfaces[i], Constants.CONSTANT_Class);
- interface_names[i] = Utility.compactClassName(str, false);
- }
- }
-
- /**
- * Constructor gets all contents as arguments.
- *
- * @param class_name_index Class name
- * @param superclass_name_index Superclass name
- * @param file_name File name
- * @param major Major compiler version
- * @param minor Minor compiler version
- * @param access_flags Access rights defined by bit flags
- * @param constant_pool Array of constants
- * @param interfaces Implemented interfaces
- * @param fields Class fields
- * @param methods Class methods
- * @param attributes Class attributes
- */
- public JavaClass(int class_name_index,
- int superclass_name_index,
- String file_name,
- int major,
- int minor,
- int access_flags,
- ConstantPool constant_pool,
- int[] interfaces,
- Field[] fields,
- Method[] methods,
- Attribute[] attributes) {
- this(class_name_index, superclass_name_index, file_name, major, minor, access_flags,
- constant_pool, interfaces, fields, methods, attributes, HEAP);
- }
-
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitJavaClass(this);
- }
-
- /* Print debug information depending on `JavaClass.debug'
- */
- static final void Debug(String str) {
- if(debug)
- System.out.println(str);
- }
-
- /**
- * Dump class to a file.
- *
- * @param file Output file
- * @throws IOException
- */
- public void dump(File file) throws IOException
- {
- String parent = file.getParent();
-
- if(parent != null) {
- File dir = new File(parent);
-
- if(dir != null)
- dir.mkdirs();
- }
-
- dump(new DataOutputStream(new FileOutputStream(file)));
- }
-
- /**
- * Dump class to a file named file_name.
- *
- * @param file_name Output file name
- * @exception IOException
- */
- public void dump(String file_name) throws IOException
- {
- dump(new File(file_name));
- }
-
- /**
- * @return class in binary format
- */
- public byte[] getBytes() {
- ByteArrayOutputStream s = new ByteArrayOutputStream();
- DataOutputStream ds = new DataOutputStream(s);
-
- try {
- dump(ds);
- } catch(IOException e) {
- e.printStackTrace();
- } finally {
- try { ds.close(); } catch(IOException e2) { e2.printStackTrace(); }
- }
-
- return s.toByteArray();
- }
-
- /**
- * Dump Java class to output stream in binary format.
- *
- * @param file Output stream
- * @exception IOException
- */
- public void dump(OutputStream file) throws IOException {
- dump(new DataOutputStream(file));
- }
-
- /**
- * Dump Java class to output stream in binary format.
- *
- * @param file Output stream
- * @exception IOException
- */
- public void dump(DataOutputStream file) throws IOException
- {
- file.writeInt(0xcafebabe);
- file.writeShort(minor);
- file.writeShort(major);
-
- constant_pool.dump(file);
-
- file.writeShort(access_flags);
- file.writeShort(class_name_index);
- file.writeShort(superclass_name_index);
-
- file.writeShort(interfaces.length);
- for(int i=0; i < interfaces.length; i++)
- file.writeShort(interfaces[i]);
-
- file.writeShort(fields.length);
- for(int i=0; i < fields.length; i++)
- fields[i].dump(file);
-
- file.writeShort(methods.length);
- for(int i=0; i < methods.length; i++)
- methods[i].dump(file);
-
- if(attributes != null) {
- file.writeShort(attributes.length);
- for(int i=0; i < attributes.length; i++)
- attributes[i].dump(file);
- }
- else
- file.writeShort(0);
-
- file.close();
- }
-
- /**
- * @return Attributes of the class.
- */
- public Attribute[] getAttributes() { return attributes; }
-
- /**
- * @return Class name.
- */
- public String getClassName() { return class_name; }
-
- /**
- * @return Package name.
- */
- public String getPackageName() { return package_name; }
-
- /**
- * @return Class name index.
- */
- public int getClassNameIndex() { return class_name_index; }
-
- /**
- * @return Constant pool.
- */
- public ConstantPool getConstantPool() { return constant_pool; }
-
- /**
- * @return Fields, i.e., variables of the class. Like the JVM spec
- * mandates for the classfile format, these fields are those specific to
- * this class, and not those of the superclass or superinterfaces.
- */
- public Field[] getFields() { return fields; }
-
- /**
- * @return File name of class, aka SourceFile attribute value
- */
- public String getFileName() { return file_name; }
-
- /**
- * @return Names of implemented interfaces.
- */
- public String[] getInterfaceNames() { return interface_names; }
-
- /**
- * @return Indices in constant pool of implemented interfaces.
- */
- public int[] getInterfaceIndices() { return interfaces; }
-
- /**
- * @return Major number of class file version.
- */
- public int getMajor() { return major; }
-
- /**
- * @return Methods of the class.
- */
- public Method[] getMethods() { return methods; }
-
- /**
- * @return A com.sun.org.apache.bcel.internal.classfile.Method corresponding to
- * java.lang.reflect.Method if any
- */
- public Method getMethod(java.lang.reflect.Method m) {
- for(int i = 0; i < methods.length; i++) {
- Method method = methods[i];
-
- if(m.getName().equals(method.getName()) &&
- (m.getModifiers() == method.getModifiers()) &&
- Type.getSignature(m).equals(method.getSignature())) {
- return method;
- }
- }
-
- return null;
- }
-
- /**
- * @return Minor number of class file version.
- */
- public int getMinor() { return minor; }
-
- /**
- * @return sbsolute path to file where this class was read from
- */
- public String getSourceFileName() { return source_file_name; }
-
- /**
- * @return Superclass name.
- */
- public String getSuperclassName() { return superclass_name; }
-
- /**
- * @return Class name index.
- */
- public int getSuperclassNameIndex() { return superclass_name_index; }
-
- static {
- // Debugging ... on/off
- String debug = null, sep = null;
-
- try {
- debug = SecuritySupport.getSystemProperty("JavaClass.debug");
- // Get path separator either / or \ usually
- sep = SecuritySupport.getSystemProperty("file.separator");
- }
- catch (SecurityException e) {
- // falls through
- }
-
- if(debug != null)
- JavaClass.debug = new Boolean(debug).booleanValue();
-
- if(sep != null)
- try {
- JavaClass.sep = sep.charAt(0);
- } catch(StringIndexOutOfBoundsException e) {} // Never reached
- }
-
- /**
- * @param attributes .
- */
- public void setAttributes(Attribute[] attributes) {
- this.attributes = attributes;
- }
-
- /**
- * @param class_name .
- */
- public void setClassName(String class_name) {
- this.class_name = class_name;
- }
-
- /**
- * @param class_name_index .
- */
- public void setClassNameIndex(int class_name_index) {
- this.class_name_index = class_name_index;
- }
-
- /**
- * @param constant_pool .
- */
- public void setConstantPool(ConstantPool constant_pool) {
- this.constant_pool = constant_pool;
- }
-
- /**
- * @param fields .
- */
- public void setFields(Field[] fields) {
- this.fields = fields;
- }
-
- /**
- * Set File name of class, aka SourceFile attribute value
- */
- public void setFileName(String file_name) {
- this.file_name = file_name;
- }
-
- /**
- * @param interface_names .
- */
- public void setInterfaceNames(String[] interface_names) {
- this.interface_names = interface_names;
- }
-
- /**
- * @param interfaces .
- */
- public void setInterfaces(int[] interfaces) {
- this.interfaces = interfaces;
- }
-
- /**
- * @param major .
- */
- public void setMajor(int major) {
- this.major = major;
- }
-
- /**
- * @param methods .
- */
- public void setMethods(Method[] methods) {
- this.methods = methods;
- }
-
- /**
- * @param minor .
- */
- public void setMinor(int minor) {
- this.minor = minor;
- }
-
- /**
- * Set absolute path to file this class was read from.
- */
- public void setSourceFileName(String source_file_name) {
- this.source_file_name = source_file_name;
- }
-
- /**
- * @param superclass_name .
- */
- public void setSuperclassName(String superclass_name) {
- this.superclass_name = superclass_name;
- }
-
- /**
- * @param superclass_name_index .
- */
- public void setSuperclassNameIndex(int superclass_name_index) {
- this.superclass_name_index = superclass_name_index;
- }
-
- /**
- * @return String representing class contents.
- */
- public String toString() {
- String access = Utility.accessToString(access_flags, true);
- access = access.equals("")? "" : (access + " ");
-
- StringBuffer buf = new StringBuffer(access +
- Utility.classOrInterface(access_flags) +
- " " +
- class_name + " extends " +
- Utility.compactClassName(superclass_name,
- false) + '\n');
- int size = interfaces.length;
-
- if(size > 0) {
- buf.append("implements\t\t");
-
- for(int i=0; i < size; i++) {
- buf.append(interface_names[i]);
- if(i < size - 1)
- buf.append(", ");
- }
-
- buf.append('\n');
- }
-
- buf.append("filename\t\t" + file_name + '\n');
- buf.append("compiled from\t\t" + source_file_name + '\n');
- buf.append("compiler version\t" + major + "." + minor + '\n');
- buf.append("access flags\t\t" + access_flags + '\n');
- buf.append("constant pool\t\t" + constant_pool.getLength() + " entries\n");
- buf.append("ACC_SUPER flag\t\t" + isSuper() + "\n");
-
- if(attributes.length > 0) {
- buf.append("\nAttribute(s):\n");
- for(int i=0; i < attributes.length; i++)
- buf.append(indent(attributes[i]));
- }
-
- if(fields.length > 0) {
- buf.append("\n" + fields.length + " fields:\n");
- for(int i=0; i < fields.length; i++)
- buf.append("\t" + fields[i] + '\n');
- }
-
- if(methods.length > 0) {
- buf.append("\n" + methods.length + " methods:\n");
- for(int i=0; i < methods.length; i++)
- buf.append("\t" + methods[i] + '\n');
- }
-
- return buf.toString();
- }
-
- private static final String indent(Object obj) {
- StringTokenizer tok = new StringTokenizer(obj.toString(), "\n");
- StringBuffer buf = new StringBuffer();
-
- while(tok.hasMoreTokens())
- buf.append("\t" + tok.nextToken() + "\n");
-
- return buf.toString();
- }
-
- /**
- * @return deep copy of this class
- */
- public JavaClass copy() {
- JavaClass c = null;
-
- try {
- c = (JavaClass)clone();
- } catch(CloneNotSupportedException e) {}
-
- c.constant_pool = constant_pool.copy();
- c.interfaces = (int[])interfaces.clone();
- c.interface_names = (String[])interface_names.clone();
-
- c.fields = new Field[fields.length];
- for(int i=0; i < fields.length; i++)
- c.fields[i] = fields[i].copy(c.constant_pool);
-
- c.methods = new Method[methods.length];
- for(int i=0; i < methods.length; i++)
- c.methods[i] = methods[i].copy(c.constant_pool);
-
- c.attributes = new Attribute[attributes.length];
- for(int i=0; i < attributes.length; i++)
- c.attributes[i] = attributes[i].copy(c.constant_pool);
-
- return c;
- }
-
- public final boolean isSuper() {
- return (access_flags & Constants.ACC_SUPER) != 0;
- }
-
- public final boolean isClass() {
- return (access_flags & Constants.ACC_INTERFACE) == 0;
- }
-
- /** @return returns either HEAP (generated), FILE, or ZIP
- */
- public final byte getSource() {
- return source;
- }
-
- /********************* New repository functionality *********************/
-
- /**
- * Gets the ClassRepository which holds its definition. By default
- * this is the same as SyntheticRepository.getInstance();
- */
- public com.sun.org.apache.bcel.internal.util.Repository getRepository() {
- return repository;
- }
-
- /**
- * Sets the ClassRepository which loaded the JavaClass.
- * Should be called immediately after parsing is done.
- */
- public void setRepository(com.sun.org.apache.bcel.internal.util.Repository repository) {
- this.repository = repository;
- }
-
- /** Equivalent to runtime "instanceof" operator.
- *
- * @return true if this JavaClass is derived from teh super class
- */
- public final boolean instanceOf(JavaClass super_class) {
- if(this.equals(super_class))
- return true;
-
- JavaClass[] super_classes = getSuperClasses();
-
- for(int i=0; i < super_classes.length; i++) {
- if(super_classes[i].equals(super_class)) {
- return true;
- }
- }
-
- if(super_class.isInterface()) {
- return implementationOf(super_class);
- }
-
- return false;
- }
-
- /**
- * @return true, if clazz is an implementation of interface inter
- */
- public boolean implementationOf(JavaClass inter) {
- if(!inter.isInterface()) {
- throw new IllegalArgumentException(inter.getClassName() + " is no interface");
- }
-
- if(this.equals(inter)) {
- return true;
- }
-
- JavaClass[] super_interfaces = getAllInterfaces();
-
- for(int i=0; i < super_interfaces.length; i++) {
- if(super_interfaces[i].equals(inter)) {
- return true;
- }
- }
-
- return false;
- }
-
- /**
- * @return the superclass for this JavaClass object, or null if this
- * is java.lang.Object
- */
- public JavaClass getSuperClass() {
- if("java.lang.Object".equals(getClassName())) {
- return null;
- }
-
- try {
- return repository.loadClass(getSuperclassName());
- } catch(ClassNotFoundException e) {
- System.err.println(e);
- return null;
- }
- }
-
- /**
- * @return list of super classes of this class in ascending order, i.e.,
- * java.lang.Object is always the last element
- */
- public JavaClass[] getSuperClasses() {
- JavaClass clazz = this;
- ClassVector vec = new ClassVector();
-
- for(clazz = clazz.getSuperClass(); clazz != null;
- clazz = clazz.getSuperClass())
- {
- vec.addElement(clazz);
- }
-
- return vec.toArray();
- }
-
- /**
- * Get interfaces directly implemented by this JavaClass.
- */
- public JavaClass[] getInterfaces() {
- String[] interfaces = getInterfaceNames();
- JavaClass[] classes = new JavaClass[interfaces.length];
-
- try {
- for(int i = 0; i < interfaces.length; i++) {
- classes[i] = repository.loadClass(interfaces[i]);
- }
- } catch(ClassNotFoundException e) {
- System.err.println(e);
- return null;
- }
-
- return classes;
- }
-
- /**
- * Get all interfaces implemented by this JavaClass (transitively).
- */
- public JavaClass[] getAllInterfaces() {
- ClassQueue queue = new ClassQueue();
- ClassVector vec = new ClassVector();
-
- queue.enqueue(this);
-
- while(!queue.empty()) {
- JavaClass clazz = queue.dequeue();
-
- JavaClass souper = clazz.getSuperClass();
- JavaClass[] interfaces = clazz.getInterfaces();
-
- if(clazz.isInterface()) {
- vec.addElement(clazz);
- } else {
- if(souper != null) {
- queue.enqueue(souper);
- }
- }
-
- for(int i = 0; i < interfaces.length; i++) {
- queue.enqueue(interfaces[i]);
- }
- }
-
- return vec.toArray();
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/LineNumber.java b/src/com/sun/org/apache/bcel/internal/classfile/LineNumber.java
deleted file mode 100644
index ec8b472..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/LineNumber.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import java.io.*;
-
-/**
- * This class represents a (PC offset, line number) pair, i.e., a line number in
- * the source that corresponds to a relative address in the byte code. This
- * is used for debugging purposes.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see LineNumberTable
- */
-public final class LineNumber implements Cloneable, Node, Serializable {
- private int start_pc; // Program Counter (PC) corresponds to line
- private int line_number; // number in source file
-
- /**
- * Initialize from another object.
- */
- public LineNumber(LineNumber c) {
- this(c.getStartPC(), c.getLineNumber());
- }
-
- /**
- * Construct object from file stream.
- * @param file Input stream
- * @throws IOException
- */
- LineNumber(DataInputStream file) throws IOException
- {
- this(file.readUnsignedShort(), file.readUnsignedShort());
- }
-
- /**
- * @param start_pc Program Counter (PC) corresponds to
- * @param line_number line number in source file
- */
- public LineNumber(int start_pc, int line_number)
- {
- this.start_pc = start_pc;
- this.line_number = line_number;
- }
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitLineNumber(this);
- }
-
- /**
- * Dump line number/pc pair to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- public final void dump(DataOutputStream file) throws IOException
- {
- file.writeShort(start_pc);
- file.writeShort(line_number);
-
- }
- /**
- * @return Corresponding source line
- */
- public final int getLineNumber() { return line_number; }
-
- /**
- * @return PC in code
- */
- public final int getStartPC() { return start_pc; }
-
- /**
- * @param line_number.
- */
- public final void setLineNumber(int line_number) {
- this.line_number = line_number;
- }
-
- /**
- * @param start_pc.
- */
- public final void setStartPC(int start_pc) {
- this.start_pc = start_pc;
- }
-
- /**
- * @return String representation
- */
- public final String toString() {
- return "LineNumber(" + start_pc + ", " + line_number + ")";
- }
-
- /**
- * @return deep copy of this object
- */
- public LineNumber copy() {
- try {
- return (LineNumber)clone();
- } catch(CloneNotSupportedException e) {}
-
- return null;
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/LineNumberTable.java b/src/com/sun/org/apache/bcel/internal/classfile/LineNumberTable.java
deleted file mode 100644
index 1fa9bfe..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/LineNumberTable.java
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import java.io.*;
-
-/**
- * This class represents a table of line numbers for debugging
- * purposes. This attribute is used by the <em>Code</em> attribute. It
- * contains pairs of PCs and line numbers.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see Code
- * @see LineNumber
- */
-public final class LineNumberTable extends Attribute {
- private int line_number_table_length;
- private LineNumber[] line_number_table; // Table of line/numbers pairs
-
- /*
- * Initialize from another object. Note that both objects use the same
- * references (shallow copy). Use copy() for a physical copy.
- */
- public LineNumberTable(LineNumberTable c) {
- this(c.getNameIndex(), c.getLength(), c.getLineNumberTable(),
- c.getConstantPool());
- }
-
- /*
- * @param name_index Index of name
- * @param length Content length in bytes
- * @param line_number_table Table of line/numbers pairs
- * @param constant_pool Array of constants
- */
- public LineNumberTable(int name_index, int length,
- LineNumber[] line_number_table,
- ConstantPool constant_pool)
- {
- super(Constants.ATTR_LINE_NUMBER_TABLE, name_index, length, constant_pool);
- setLineNumberTable(line_number_table);
- }
-
- /**
- * Construct object from file stream.
- * @param name_index Index of name
- * @param length Content length in bytes
- * @param file Input stream
- * @throws IOException
- * @param constant_pool Array of constants
- */
- LineNumberTable(int name_index, int length, DataInputStream file,
- ConstantPool constant_pool) throws IOException
- {
- this(name_index, length, (LineNumber[])null, constant_pool);
- line_number_table_length = (file.readUnsignedShort());
- line_number_table = new LineNumber[line_number_table_length];
-
- for(int i=0; i < line_number_table_length; i++)
- line_number_table[i] = new LineNumber(file);
- }
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitLineNumberTable(this);
- }
- /**
- * Dump line number table attribute to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- public final void dump(DataOutputStream file) throws IOException
- {
- super.dump(file);
- file.writeShort(line_number_table_length);
- for(int i=0; i < line_number_table_length; i++)
- line_number_table[i].dump(file);
- }
-
- /**
- * @return Array of (pc offset, line number) pairs.
- */
- public final LineNumber[] getLineNumberTable() { return line_number_table; }
-
- /**
- * @param line_number_table.
- */
- public final void setLineNumberTable(LineNumber[] line_number_table) {
- this.line_number_table = line_number_table;
-
- line_number_table_length = (line_number_table == null)? 0 :
- line_number_table.length;
- }
-
- /**
- * @return String representation.
- */
- public final String toString() {
- StringBuffer buf = new StringBuffer();
- StringBuffer line = new StringBuffer();
-
- for(int i=0; i < line_number_table_length; i++) {
- line.append(line_number_table[i].toString());
-
- if(i < line_number_table_length - 1)
- line.append(", ");
-
- if(line.length() > 72) {
- line.append('\n');
- buf.append(line);
- line.setLength(0);
- }
- }
-
- buf.append(line);
-
- return buf.toString();
- }
-
- /**
- * Map byte code positions to source code lines.
- *
- * @param pos byte code offset
- * @return corresponding line in source code
- */
- public int getSourceLine(int pos) {
- int l = 0, r = line_number_table_length-1;
-
- if(r < 0) // array is empty
- return -1;
-
- int min_index = -1, min=-1;
-
- /* Do a binary search since the array is ordered.
- */
- do {
- int i = (l + r) / 2;
- int j = line_number_table[i].getStartPC();
-
- if(j == pos)
- return line_number_table[i].getLineNumber();
- else if(pos < j) // else constrain search area
- r = i - 1;
- else // pos > j
- l = i + 1;
-
- /* If exact match can't be found (which is the most common case)
- * return the line number that corresponds to the greatest index less
- * than pos.
- */
- if(j < pos && j > min) {
- min = j;
- min_index = i;
- }
- } while(l <= r);
-
- /* It's possible that we did not find any valid entry for the bytecode
- * offset we were looking for.
- */
- if (min_index < 0)
- return -1;
-
- return line_number_table[min_index].getLineNumber();
- }
-
- /**
- * @return deep copy of this attribute
- */
- public Attribute copy(ConstantPool constant_pool) {
- LineNumberTable c = (LineNumberTable)clone();
-
- c.line_number_table = new LineNumber[line_number_table_length];
- for(int i=0; i < line_number_table_length; i++)
- c.line_number_table[i] = line_number_table[i].copy();
-
- c.constant_pool = constant_pool;
- return c;
- }
-
- public final int getTableLength() { return line_number_table_length; }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/LocalVariable.java b/src/com/sun/org/apache/bcel/internal/classfile/LocalVariable.java
deleted file mode 100644
index a80bc3b..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/LocalVariable.java
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import java.io.*;
-
-/**
- * This class represents a local variable within a method. It contains its
- * scope, name, signature and index on the method's frame.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see LocalVariableTable
- */
-public final class LocalVariable
- implements Constants, Cloneable, Node, Serializable
-{
- private int start_pc; // Range in which the variable is valid
- private int length;
- private int name_index; // Index in constant pool of variable name
- private int signature_index; // Index of variable signature
- private int index; /* Variable is `index'th local variable on
- * this method's frame.
- */
-
- private ConstantPool constant_pool;
-
- /**
- * Initialize from another object. Note that both objects use the same
- * references (shallow copy). Use copy() for a physical copy.
- */
- public LocalVariable(LocalVariable c) {
- this(c.getStartPC(), c.getLength(), c.getNameIndex(),
- c.getSignatureIndex(), c.getIndex(), c.getConstantPool());
- }
-
- /**
- * Construct object from file stream.
- * @param file Input stream
- * @throws IOException
- */
- LocalVariable(DataInputStream file, ConstantPool constant_pool)
- throws IOException
- {
- this(file.readUnsignedShort(), file.readUnsignedShort(),
- file.readUnsignedShort(), file.readUnsignedShort(),
- file.readUnsignedShort(), constant_pool);
- }
-
- /**
- * @param start_pc Range in which the variable
- * @param length ... is valid
- * @param name_index Index in constant pool of variable name
- * @param signature_index Index of variable's signature
- * @param index Variable is `index'th local variable on the method's frame
- * @param constant_pool Array of constants
- */
- public LocalVariable(int start_pc, int length, int name_index,
- int signature_index, int index,
- ConstantPool constant_pool)
- {
- this.start_pc = start_pc;
- this.length = length;
- this.name_index = name_index;
- this.signature_index = signature_index;
- this.index = index;
- this.constant_pool = constant_pool;
- }
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitLocalVariable(this);
- }
-
- /**
- * Dump local variable to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- public final void dump(DataOutputStream file) throws IOException
- {
- file.writeShort(start_pc);
- file.writeShort(length);
- file.writeShort(name_index);
- file.writeShort(signature_index);
- file.writeShort(index);
- }
-
- /**
- * @return Constant pool used by this object.
- */
- public final ConstantPool getConstantPool() { return constant_pool; }
-
- /**
- * @return Variable is valid within getStartPC() .. getStartPC()+getLength()
- */
- public final int getLength() { return length; }
-
- /**
- * @return Variable name.
- */
- public final String getName() {
- ConstantUtf8 c;
-
- c = (ConstantUtf8)constant_pool.getConstant(name_index, CONSTANT_Utf8);
- return c.getBytes();
- }
-
- /**
- * @return Index in constant pool of variable name.
- */
- public final int getNameIndex() { return name_index; }
-
- /**
- * @return Signature.
- */
- public final String getSignature() {
- ConstantUtf8 c;
- c = (ConstantUtf8)constant_pool.getConstant(signature_index,
- CONSTANT_Utf8);
- return c.getBytes();
- }
-
- /**
- * @return Index in constant pool of variable signature.
- */
- public final int getSignatureIndex() { return signature_index; }
-
- /**
- * @return index of register where variable is stored
- */
- public final int getIndex() { return index; }
-
- /**
- * @return Start of range where he variable is valid
- */
- public final int getStartPC() { return start_pc; }
-
- /**
- * @param constant_pool Constant pool to be used for this object.
- */
- public final void setConstantPool(ConstantPool constant_pool) {
- this.constant_pool = constant_pool;
- }
-
- /**
- * @param length.
- */
- public final void setLength(int length) {
- this.length = length;
- }
-
- /**
- * @param name_index.
- */
- public final void setNameIndex(int name_index) {
- this.name_index = name_index;
- }
-
- /**
- * @param signature_index.
- */
- public final void setSignatureIndex(int signature_index) {
- this.signature_index = signature_index;
- }
-
- /**
- * @param index.
- */
- public final void setIndex(int index) { this.index = index; }
-
- /**
- * @param start_pc Specify range where the local variable is valid.
- */
- public final void setStartPC(int start_pc) {
- this.start_pc = start_pc;
- }
-
- /**
- * @return string representation.
- */
- public final String toString() {
- String name = getName(), signature = Utility.signatureToString(getSignature());
-
- return "LocalVariable(start_pc = " + start_pc + ", length = " + length +
- ", index = " + index + ":" + signature + " " + name + ")";
- }
-
- /**
- * @return deep copy of this object
- */
- public LocalVariable copy() {
- try {
- return (LocalVariable)clone();
- } catch(CloneNotSupportedException e) {}
-
- return null;
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/LocalVariableTable.java b/src/com/sun/org/apache/bcel/internal/classfile/LocalVariableTable.java
deleted file mode 100644
index db0631f..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/LocalVariableTable.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import java.io.*;
-
-/**
- * This class represents colection of local variables in a
- * method. This attribute is contained in the <em>Code</em> attribute.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see Code
- * @see LocalVariable
- */
-public class LocalVariableTable extends Attribute {
- private int local_variable_table_length; // Table of local
- private LocalVariable[] local_variable_table; // variables
-
- /**
- * Initialize from another object. Note that both objects use the same
- * references (shallow copy). Use copy() for a physical copy.
- */
- public LocalVariableTable(LocalVariableTable c) {
- this(c.getNameIndex(), c.getLength(), c.getLocalVariableTable(),
- c.getConstantPool());
- }
-
- /**
- * @param name_index Index in constant pool to `LocalVariableTable'
- * @param length Content length in bytes
- * @param local_variable_table Table of local variables
- * @param constant_pool Array of constants
- */
- public LocalVariableTable(int name_index, int length,
- LocalVariable[] local_variable_table,
- ConstantPool constant_pool)
- {
- super(Constants.ATTR_LOCAL_VARIABLE_TABLE, name_index, length, constant_pool);
- setLocalVariableTable(local_variable_table);
- }
-
- /**
- * Construct object from file stream.
- * @param name_index Index in constant pool
- * @param length Content length in bytes
- * @param file Input stream
- * @param constant_pool Array of constants
- * @throws IOException
- */
- LocalVariableTable(int name_index, int length, DataInputStream file,
- ConstantPool constant_pool) throws IOException
- {
- this(name_index, length, (LocalVariable[])null, constant_pool);
-
- local_variable_table_length = (file.readUnsignedShort());
- local_variable_table = new LocalVariable[local_variable_table_length];
-
- for(int i=0; i < local_variable_table_length; i++)
- local_variable_table[i] = new LocalVariable(file, constant_pool);
- }
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitLocalVariableTable(this);
- }
-
- /**
- * Dump local variable table attribute to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- public final void dump(DataOutputStream file) throws IOException
- {
- super.dump(file);
- file.writeShort(local_variable_table_length);
- for(int i=0; i < local_variable_table_length; i++)
- local_variable_table[i].dump(file);
- }
-
- /**
- * @return Array of local variables of method.
- */
- public final LocalVariable[] getLocalVariableTable() {
- return local_variable_table;
- }
-
- /** @return first matching variable using index
- */
- public final LocalVariable getLocalVariable(int index) {
- for(int i=0; i < local_variable_table_length; i++)
- if(local_variable_table[i].getIndex() == index)
- return local_variable_table[i];
-
- return null;
- }
-
- public final void setLocalVariableTable(LocalVariable[] local_variable_table)
- {
- this.local_variable_table = local_variable_table;
- local_variable_table_length = (local_variable_table == null)? 0 :
- local_variable_table.length;
- }
-
- /**
- * @return String representation.
- */
- public final String toString() {
- StringBuffer buf = new StringBuffer("");
-
- for(int i=0; i < local_variable_table_length; i++) {
- buf.append(local_variable_table[i].toString());
-
- if(i < local_variable_table_length - 1)
- buf.append('\n');
- }
-
- return buf.toString();
- }
-
- /**
- * @return deep copy of this attribute
- */
- public Attribute copy(ConstantPool constant_pool) {
- LocalVariableTable c = (LocalVariableTable)clone();
-
- c.local_variable_table = new LocalVariable[local_variable_table_length];
- for(int i=0; i < local_variable_table_length; i++)
- c.local_variable_table[i] = local_variable_table[i].copy();
-
- c.constant_pool = constant_pool;
- return c;
- }
-
- public final int getTableLength() { return local_variable_table_length; }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/LocalVariableTypeTable.java b/src/com/sun/org/apache/bcel/internal/classfile/LocalVariableTypeTable.java
deleted file mode 100644
index 472f53a..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/LocalVariableTypeTable.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import java.io.*;
-
-// The new table is used when generic types are about...
-
-//LocalVariableTable_attribute {
-// u2 attribute_name_index;
-// u4 attribute_length;
-// u2 local_variable_table_length;
-// { u2 start_pc;
-// u2 length;
-// u2 name_index;
-// u2 descriptor_index;
-// u2 index;
-// } local_variable_table[local_variable_table_length];
-// }
-
-//LocalVariableTypeTable_attribute {
-// u2 attribute_name_index;
-// u4 attribute_length;
-// u2 local_variable_type_table_length;
-// {
-// u2 start_pc;
-// u2 length;
-// u2 name_index;
-// u2 signature_index;
-// u2 index;
-// } local_variable_type_table[local_variable_type_table_length];
-// }
-// J5TODO: Needs some testing !
-public class LocalVariableTypeTable extends Attribute {
- private static final long serialVersionUID = -1082157891095177114L;
-private int local_variable_type_table_length; // Table of local
- private LocalVariable[] local_variable_type_table; // variables
-
- public LocalVariableTypeTable(LocalVariableTypeTable c) {
- this(c.getNameIndex(), c.getLength(), c.getLocalVariableTypeTable(),
- c.getConstantPool());
- }
-
- public LocalVariableTypeTable(int name_index, int length,
- LocalVariable[] local_variable_table,
- ConstantPool constant_pool)
- {
- super(Constants.ATTR_LOCAL_VARIABLE_TYPE_TABLE, name_index, length, constant_pool);
- setLocalVariableTable(local_variable_table);
- }
-
- LocalVariableTypeTable(int nameIdx, int len, DataInputStream dis,ConstantPool cpool) throws IOException {
- this(nameIdx, len, (LocalVariable[])null, cpool);
-
- local_variable_type_table_length = (dis.readUnsignedShort());
- local_variable_type_table = new LocalVariable[local_variable_type_table_length];
-
- for(int i=0; i < local_variable_type_table_length; i++)
- local_variable_type_table[i] = new LocalVariable(dis, cpool);
- }
-
- @Override
-public void accept(Visitor v) {
- v.visitLocalVariableTypeTable(this);
- }
-
- @Override
-public final void dump(DataOutputStream file) throws IOException
- {
- super.dump(file);
- file.writeShort(local_variable_type_table_length);
- for(int i=0; i < local_variable_type_table_length; i++)
- local_variable_type_table[i].dump(file);
- }
-
- public final LocalVariable[] getLocalVariableTypeTable() {
- return local_variable_type_table;
- }
-
- public final LocalVariable getLocalVariable(int index) {
- for(int i=0; i < local_variable_type_table_length; i++)
- if(local_variable_type_table[i].getIndex() == index)
- return local_variable_type_table[i];
-
- return null;
- }
-
- public final void setLocalVariableTable(LocalVariable[] local_variable_table)
- {
- this.local_variable_type_table = local_variable_table;
- local_variable_type_table_length = (local_variable_table == null)? 0 :
- local_variable_table.length;
- }
-
- /**
- * @return String representation.
- */
- @Override
-public final String toString() {
- StringBuilder buf = new StringBuilder();
-
- for(int i=0; i < local_variable_type_table_length; i++) {
- buf.append(local_variable_type_table[i].toString());
-
- if(i < local_variable_type_table_length - 1) buf.append('\n');
- }
-
- return buf.toString();
- }
-
- /**
- * @return deep copy of this attribute
- */
- @Override
-public Attribute copy(ConstantPool constant_pool) {
- LocalVariableTypeTable c = (LocalVariableTypeTable)clone();
-
- c.local_variable_type_table = new LocalVariable[local_variable_type_table_length];
- for(int i=0; i < local_variable_type_table_length; i++)
- c.local_variable_type_table[i] = local_variable_type_table[i].copy();
-
- c.constant_pool = constant_pool;
- return c;
- }
-
- public final int getTableLength() { return local_variable_type_table_length; }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/Method.java b/src/com/sun/org/apache/bcel/internal/classfile/Method.java
deleted file mode 100644
index 63d7689..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/Method.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import com.sun.org.apache.bcel.internal.Constants;
-import com.sun.org.apache.bcel.internal.generic.Type;
-import java.io.*;
-
-/**
- * This class represents the method info structure, i.e., the representation
- * for a method in the class. See JVM specification for details.
- * A method has access flags, a name, a signature and a number of attributes.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public final class Method extends FieldOrMethod {
- /**
- * Empty constructor, all attributes have to be defined via `setXXX'
- * methods. Use at your own risk.
- */
- public Method() {}
-
- /**
- * Initialize from another object. Note that both objects use the same
- * references (shallow copy). Use clone() for a physical copy.
- */
- public Method(Method c) {
- super(c);
- }
-
- /**
- * Construct object from file stream.
- * @param file Input stream
- * @throws IOException
- * @throws ClassFormatException
- */
- Method(DataInputStream file, ConstantPool constant_pool)
- throws IOException, ClassFormatException
- {
- super(file, constant_pool);
- }
-
- /**
- * @param access_flags Access rights of method
- * @param name_index Points to field name in constant pool
- * @param signature_index Points to encoded signature
- * @param attributes Collection of attributes
- * @param constant_pool Array of constants
- */
- public Method(int access_flags, int name_index, int signature_index,
- Attribute[] attributes, ConstantPool constant_pool)
- {
- super(access_flags, name_index, signature_index, attributes, constant_pool);
- }
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitMethod(this);
- }
-
- /**
- * @return Code attribute of method, if any
- */
- public final Code getCode() {
- for(int i=0; i < attributes_count; i++)
- if(attributes[i] instanceof Code)
- return (Code)attributes[i];
-
- return null;
- }
-
- /**
- * @return ExceptionTable attribute of method, if any, i.e., list all
- * exceptions the method may throw not exception handlers!
- */
- public final ExceptionTable getExceptionTable() {
- for(int i=0; i < attributes_count; i++)
- if(attributes[i] instanceof ExceptionTable)
- return (ExceptionTable)attributes[i];
-
- return null;
- }
-
- /** @return LocalVariableTable of code attribute if any, i.e. the call is forwarded
- * to the Code atribute.
- */
- public final LocalVariableTable getLocalVariableTable() {
- Code code = getCode();
-
- if(code != null)
- return code.getLocalVariableTable();
- else
- return null;
- }
-
- /** @return LineNumberTable of code attribute if any, i.e. the call is forwarded
- * to the Code atribute.
- */
- public final LineNumberTable getLineNumberTable() {
- Code code = getCode();
-
- if(code != null)
- return code.getLineNumberTable();
- else
- return null;
- }
-
- /**
- * Return string representation close to declaration format,
- * `public static void _main(String[] args) throws IOException', e.g.
- *
- * @return String representation of the method.
- */
- public final String toString() {
- ConstantUtf8 c;
- String name, signature, access; // Short cuts to constant pool
- StringBuffer buf;
-
- access = Utility.accessToString(access_flags);
-
- // Get name and signature from constant pool
- c = (ConstantUtf8)constant_pool.getConstant(signature_index,
- Constants.CONSTANT_Utf8);
- signature = c.getBytes();
-
- c = (ConstantUtf8)constant_pool.getConstant(name_index, Constants.CONSTANT_Utf8);
- name = c.getBytes();
-
- signature = Utility.methodSignatureToString(signature, name, access, true,
- getLocalVariableTable());
- buf = new StringBuffer(signature);
-
- for(int i=0; i < attributes_count; i++) {
- Attribute a = attributes[i];
-
- if(!((a instanceof Code) || (a instanceof ExceptionTable)))
- buf.append(" [" + a.toString() + "]");
- }
-
- ExceptionTable e = getExceptionTable();
- if(e != null) {
- String str = e.toString();
- if(!str.equals(""))
- buf.append("\n\t\tthrows " + str);
- }
-
- return buf.toString();
- }
-
- /**
- * @return deep copy of this method
- */
- public final Method copy(ConstantPool constant_pool) {
- return (Method)copy_(constant_pool);
- }
-
- /**
- * @return return type of method
- */
- public Type getReturnType() {
- return Type.getReturnType(getSignature());
- }
-
- /**
- * @return array of method argument types
- */
- public Type[] getArgumentTypes() {
- return Type.getArgumentTypes(getSignature());
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/Node.java b/src/com/sun/org/apache/bcel/internal/classfile/Node.java
deleted file mode 100644
index 8d239c4..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/Node.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * Denote class to have an accept method();
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public interface Node {
- public void accept(Visitor obj);
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/PMGClass.java b/src/com/sun/org/apache/bcel/internal/classfile/PMGClass.java
deleted file mode 100644
index 999d876..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/PMGClass.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import java.io.*;
-
-/**
- * This class is derived from <em>Attribute</em> and represents a reference
- * to a <a href="http://www.inf.fu-berlin.de/~bokowski/pmgjava/index.html">PMG</a>
- * attribute.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see Attribute
- */
-public final class PMGClass extends Attribute {
- private int pmg_class_index, pmg_index;
-
- /**
- * Initialize from another object. Note that both objects use the same
- * references (shallow copy). Use clone() for a physical copy.
- */
- public PMGClass(PMGClass c) {
- this(c.getNameIndex(), c.getLength(), c.getPMGIndex(), c.getPMGClassIndex(),
- c.getConstantPool());
- }
-
- /**
- * Construct object from file stream.
- * @param name_index Index in constant pool to CONSTANT_Utf8
- * @param length Content length in bytes
- * @param file Input stream
- * @param constant_pool Array of constants
- * @throws IOException
- */
- PMGClass(int name_index, int length, DataInputStream file,
- ConstantPool constant_pool) throws IOException
- {
- this(name_index, length, file.readUnsignedShort(), file.readUnsignedShort(),
- constant_pool);
- }
-
- /**
- * @param name_index Index in constant pool to CONSTANT_Utf8
- * @param length Content length in bytes
- * @param constant_pool Array of constants
- * @param PMGClass_index Index in constant pool to CONSTANT_Utf8
- */
- public PMGClass(int name_index, int length, int pmg_index, int pmg_class_index,
- ConstantPool constant_pool)
- {
- super(Constants.ATTR_PMG, name_index, length, constant_pool);
- this.pmg_index = pmg_index;
- this.pmg_class_index = pmg_class_index;
- }
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- System.err.println("Visiting non-standard PMGClass object");
- }
-
- /**
- * Dump source file attribute to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- public final void dump(DataOutputStream file) throws IOException
- {
- super.dump(file);
- file.writeShort(pmg_index);
- file.writeShort(pmg_class_index);
- }
-
- /**
- * @return Index in constant pool of source file name.
- */
- public final int getPMGClassIndex() { return pmg_class_index; }
-
- /**
- * @param PMGClass_index.
- */
- public final void setPMGClassIndex(int pmg_class_index) {
- this.pmg_class_index = pmg_class_index;
- }
-
- /**
- * @return Index in constant pool of source file name.
- */
- public final int getPMGIndex() { return pmg_index; }
-
- /**
- * @param PMGClass_index.
- */
- public final void setPMGIndex(int pmg_index) {
- this.pmg_index = pmg_index;
- }
-
- /**
- * @return PMG name.
- */
- public final String getPMGName() {
- ConstantUtf8 c = (ConstantUtf8)constant_pool.getConstant(pmg_index,
- Constants.CONSTANT_Utf8);
- return c.getBytes();
- }
-
- /**
- * @return PMG class name.
- */
- public final String getPMGClassName() {
- ConstantUtf8 c = (ConstantUtf8)constant_pool.getConstant(pmg_class_index,
- Constants.CONSTANT_Utf8);
- return c.getBytes();
- }
-
- /**
- * @return String representation
- */
- public final String toString() {
- return "PMGClass(" + getPMGName() + ", " + getPMGClassName() + ")";
- }
-
- /**
- * @return deep copy of this attribute
- */
- public Attribute copy(ConstantPool constant_pool) {
- return (PMGClass)clone();
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/Signature.java b/src/com/sun/org/apache/bcel/internal/classfile/Signature.java
deleted file mode 100644
index e0b9cc5..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/Signature.java
+++ /dev/null
@@ -1,299 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import java.io.*;
-
-/**
- * This class is derived from <em>Attribute</em> and represents a reference
- * to a <href="http://wwwipd.ira.uka.de/~pizza/gj/">GJ</a> attribute.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see Attribute
- */
-public final class Signature extends Attribute {
- private int signature_index;
-
- /**
- * Initialize from another object. Note that both objects use the same
- * references (shallow copy). Use clone() for a physical copy.
- */
- public Signature(Signature c) {
- this(c.getNameIndex(), c.getLength(), c.getSignatureIndex(), c.getConstantPool());
- }
-
- /**
- * Construct object from file stream.
- * @param name_index Index in constant pool to CONSTANT_Utf8
- * @param length Content length in bytes
- * @param file Input stream
- * @param constant_pool Array of constants
- * @throws IOException
- */
- Signature(int name_index, int length, DataInputStream file,
- ConstantPool constant_pool) throws IOException
- {
- this(name_index, length, file.readUnsignedShort(), constant_pool);
- }
-
- /**
- * @param name_index Index in constant pool to CONSTANT_Utf8
- * @param length Content length in bytes
- * @param constant_pool Array of constants
- * @param Signature_index Index in constant pool to CONSTANT_Utf8
- */
- public Signature(int name_index, int length, int signature_index,
- ConstantPool constant_pool)
- {
- super(Constants.ATTR_SIGNATURE, name_index, length, constant_pool);
- this.signature_index = signature_index;
- }
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- System.err.println("Visiting non-standard Signature object");
- v.visitSignature(this);
- }
-
- /**
- * Dump source file attribute to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- public final void dump(DataOutputStream file) throws IOException
- {
- super.dump(file);
- file.writeShort(signature_index);
- }
-
- /**
- * @return Index in constant pool of source file name.
- */
- public final int getSignatureIndex() { return signature_index; }
-
- /**
- * @param Signature_index.
- */
- public final void setSignatureIndex(int signature_index) {
- this.signature_index = signature_index;
- }
-
- /**
- * @return GJ signature.
- */
- public final String getSignature() {
- ConstantUtf8 c = (ConstantUtf8)constant_pool.getConstant(signature_index,
- Constants.CONSTANT_Utf8);
- return c.getBytes();
- }
-
- /**
- * Extends ByteArrayInputStream to make 'unreading' chars possible.
- */
- private static final class MyByteArrayInputStream extends ByteArrayInputStream {
- MyByteArrayInputStream(String data) { super(data.getBytes()); }
- final int mark() { return pos; }
- final String getData() { return new String(buf); }
- final void reset(int p) { pos = p; }
- final void unread() { if(pos > 0) pos--; }
- }
-
- private static boolean identStart(int ch) {
- return ch == 'T' || ch == 'L';
- }
-
- private static boolean identPart(int ch) {
- return ch == '/' || ch == ';';
- }
-
- private static final void matchIdent(MyByteArrayInputStream in, StringBuffer buf) {
- int ch;
-
- if((ch = in.read()) == -1)
- throw new RuntimeException("Illegal signature: " + in.getData() +
- " no ident, reaching EOF");
-
- //System.out.println("return from ident:" + (char)ch);
-
- if(!identStart(ch)) {
- StringBuffer buf2 = new StringBuffer();
-
- int count = 1;
- while(Character.isJavaIdentifierPart((char)ch)) {
- buf2.append((char)ch);
- count++;
- ch = in.read();
- }
-
- if(ch == ':') { // Ok, formal parameter
- in.skip("Ljava/lang/Object".length());
- buf.append(buf2);
-
- ch = in.read();
- in.unread();
- //System.out.println("so far:" + buf2 + ":next:" +(char)ch);
- } else {
- for(int i=0; i < count; i++)
- in.unread();
- }
-
- return;
- }
-
- StringBuffer buf2 = new StringBuffer();
- ch = in.read();
-
- do {
- buf2.append((char)ch);
- ch = in.read();
- //System.out.println("within ident:"+ (char)ch);
-
- } while((ch != -1) && (Character.isJavaIdentifierPart((char)ch) || (ch == '/')));
-
- buf.append(buf2.toString().replace('/', '.'));
-
- //System.out.println("regular return ident:"+ (char)ch + ":" + buf2);
-
- if(ch != -1)
- in.unread();
- }
-
- private static final void matchGJIdent(MyByteArrayInputStream in,
- StringBuffer buf)
- {
- int ch;
-
- matchIdent(in, buf);
-
- ch = in.read();
- if((ch == '<') || ch == '(') { // Parameterized or method
- //System.out.println("Enter <");
- buf.append((char)ch);
- matchGJIdent(in, buf);
-
- while(((ch = in.read()) != '>') && (ch != ')')) { // List of parameters
- if(ch == -1)
- throw new RuntimeException("Illegal signature: " + in.getData() +
- " reaching EOF");
-
- //System.out.println("Still no >");
- buf.append(", ");
- in.unread();
- matchGJIdent(in, buf); // Recursive call
- }
-
- //System.out.println("Exit >");
-
- buf.append((char)ch);
- } else
- in.unread();
-
- ch = in.read();
- if(identStart(ch)) {
- in.unread();
- matchGJIdent(in, buf);
- } else if(ch == ')') {
- in.unread();
- return;
- } else if(ch != ';')
- throw new RuntimeException("Illegal signature: " + in.getData() + " read " +
- (char)ch);
- }
-
- public static String translate(String s) {
- //System.out.println("Sig:" + s);
- StringBuffer buf = new StringBuffer();
-
- matchGJIdent(new MyByteArrayInputStream(s), buf);
-
- return buf.toString();
- }
-
- public static final boolean isFormalParameterList(String s) {
- return s.startsWith("<") && (s.indexOf(':') > 0);
- }
-
- public static final boolean isActualParameterList(String s) {
- return s.startsWith("L") && s.endsWith(">;");
- }
-
- /**
- * @return String representation
- */
- public final String toString() {
- String s = getSignature();
-
- return "Signature(" + s + ")";
- }
-
- /**
- * @return deep copy of this attribute
- */
- public Attribute copy(ConstantPool constant_pool) {
- return (Signature)clone();
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/SourceFile.java b/src/com/sun/org/apache/bcel/internal/classfile/SourceFile.java
deleted file mode 100644
index 5120cd6..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/SourceFile.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import java.io.*;
-
-/**
- * This class is derived from <em>Attribute</em> and represents a reference
- * to the source file of this class. At most one SourceFile attribute
- * should appear per classfile. The intention of this class is that it is
- * instantiated from the <em>Attribute.readAttribute()</em> method.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see Attribute
- */
-public final class SourceFile extends Attribute {
- private int sourcefile_index;
-
- /**
- * Initialize from another object. Note that both objects use the same
- * references (shallow copy). Use clone() for a physical copy.
- */
- public SourceFile(SourceFile c) {
- this(c.getNameIndex(), c.getLength(), c.getSourceFileIndex(),
- c.getConstantPool());
- }
-
- /**
- * Construct object from file stream.
- * @param name_index Index in constant pool to CONSTANT_Utf8
- * @param length Content length in bytes
- * @param file Input stream
- * @param constant_pool Array of constants
- * @throws IOException
- */
- SourceFile(int name_index, int length, DataInputStream file,
- ConstantPool constant_pool) throws IOException
- {
- this(name_index, length, file.readUnsignedShort(), constant_pool);
- }
-
- /**
- * @param name_index Index in constant pool to CONSTANT_Utf8, which
- * should represent the string "SourceFile".
- * @param length Content length in bytes, the value should be 2.
- * @param constant_pool The constant pool that this attribute is
- * associated with.
- * @param sourcefile_index Index in constant pool to CONSTANT_Utf8. This
- * string will be interpreted as the name of the file from which this
- * class was compiled. It will not be interpreted as indicating the name
- * of the directory contqining the file or an absolute path; this
- * information has to be supplied the consumer of this attribute - in
- * many cases, the JVM.
- */
- public SourceFile(int name_index, int length, int sourcefile_index,
- ConstantPool constant_pool)
- {
- super(Constants.ATTR_SOURCE_FILE, name_index, length, constant_pool);
- this.sourcefile_index = sourcefile_index;
- }
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitSourceFile(this);
- }
-
- /**
- * Dump source file attribute to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- public final void dump(DataOutputStream file) throws IOException
- {
- super.dump(file);
- file.writeShort(sourcefile_index);
- }
-
- /**
- * @return Index in constant pool of source file name.
- */
- public final int getSourceFileIndex() { return sourcefile_index; }
-
- /**
- * @param sourcefile_index.
- */
- public final void setSourceFileIndex(int sourcefile_index) {
- this.sourcefile_index = sourcefile_index;
- }
-
- /**
- * @return Source file name.
- */
- public final String getSourceFileName() {
- ConstantUtf8 c = (ConstantUtf8)constant_pool.getConstant(sourcefile_index,
- Constants.CONSTANT_Utf8);
- return c.getBytes();
- }
-
- /**
- * @return String representation
- */
- public final String toString() {
- return "SourceFile(" + getSourceFileName() + ")";
- }
-
- /**
- * @return deep copy of this attribute
- */
- public Attribute copy(ConstantPool constant_pool) {
- return (SourceFile)clone();
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/StackMap.java b/src/com/sun/org/apache/bcel/internal/classfile/StackMap.java
deleted file mode 100644
index 4d44a6f..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/StackMap.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import java.io.*;
-
-/**
- * This class represents a stack map attribute used for
- * preverification of Java classes for the <a
- * href="http://java.sun.com/j2me/"> Java 2 Micro Edition</a>
- * (J2ME). This attribute is used by the <a
- * href="http://java.sun.com/products/cldc/">KVM</a> and contained
- * within the Code attribute of a method. See CLDC specification
- * 5.3.1.2
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see Code
- * @see StackMapEntry
- * @see StackMapType
- */
-public final class StackMap extends Attribute implements Node {
- private int map_length;
- private StackMapEntry[] map; // Table of stack map entries
-
- /*
- * @param name_index Index of name
- * @param length Content length in bytes
- * @param map Table of stack map entries
- * @param constant_pool Array of constants
- */
- public StackMap(int name_index, int length, StackMapEntry[] map,
- ConstantPool constant_pool)
- {
- super(Constants.ATTR_STACK_MAP, name_index, length, constant_pool);
-
- setStackMap(map);
- }
-
- /**
- * Construct object from file stream.
- * @param name_index Index of name
- * @param length Content length in bytes
- * @param file Input stream
- * @throws IOException
- * @param constant_pool Array of constants
- */
- StackMap(int name_index, int length, DataInputStream file,
- ConstantPool constant_pool) throws IOException
- {
- this(name_index, length, (StackMapEntry[])null, constant_pool);
-
- map_length = file.readUnsignedShort();
- map = new StackMapEntry[map_length];
-
- for(int i=0; i < map_length; i++)
- map[i] = new StackMapEntry(file, constant_pool);
- }
-
- /**
- * Dump line number table attribute to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- public final void dump(DataOutputStream file) throws IOException
- {
- super.dump(file);
- file.writeShort(map_length);
- for(int i=0; i < map_length; i++)
- map[i].dump(file);
- }
-
- /**
- * @return Array of stack map entries
- */
- public final StackMapEntry[] getStackMap() { return map; }
-
- /**
- * @param map Array of stack map entries
- */
- public final void setStackMap(StackMapEntry[] map) {
- this.map = map;
-
- map_length = (map == null)? 0 : map.length;
- }
-
- /**
- * @return String representation.
- */
- public final String toString() {
- StringBuffer buf = new StringBuffer("StackMap(");
-
- for(int i=0; i < map_length; i++) {
- buf.append(map[i].toString());
-
- if(i < map_length - 1)
- buf.append(", ");
- }
-
- buf.append(')');
-
- return buf.toString();
- }
-
- /**
- * @return deep copy of this attribute
- */
- public Attribute copy(ConstantPool constant_pool) {
- StackMap c = (StackMap)clone();
-
- c.map = new StackMapEntry[map_length];
- for(int i=0; i < map_length; i++)
- c.map[i] = map[i].copy();
-
- c.constant_pool = constant_pool;
- return c;
- }
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackMap(this);
- }
-
- public final int getMapLength() { return map_length; }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/StackMapEntry.java b/src/com/sun/org/apache/bcel/internal/classfile/StackMapEntry.java
deleted file mode 100644
index 5b5c46f..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/StackMapEntry.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import java.io.*;
-
-/**
- * This class represents a stack map entry recording the types of
- * local variables and the the of stack items at a given byte code offset.
- * See CLDC specification 5.3.1.2
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see StackMap
- * @see StackMapType
- */
-public final class StackMapEntry implements Cloneable {
- private int byte_code_offset;
- private int number_of_locals;
- private StackMapType[] types_of_locals;
- private int number_of_stack_items;
- private StackMapType[] types_of_stack_items;
- private ConstantPool constant_pool;
-
- /**
- * Construct object from file stream.
- * @param file Input stream
- * @throws IOException
- */
- StackMapEntry(DataInputStream file, ConstantPool constant_pool) throws IOException
- {
- this(file.readShort(), file.readShort(), null, -1, null, constant_pool);
-
- types_of_locals = new StackMapType[number_of_locals];
- for(int i=0; i < number_of_locals; i++)
- types_of_locals[i] = new StackMapType(file, constant_pool);
-
- number_of_stack_items = file.readShort();
- types_of_stack_items = new StackMapType[number_of_stack_items];
- for(int i=0; i < number_of_stack_items; i++)
- types_of_stack_items[i] = new StackMapType(file, constant_pool);
- }
-
- public StackMapEntry(int byte_code_offset, int number_of_locals,
- StackMapType[] types_of_locals,
- int number_of_stack_items,
- StackMapType[] types_of_stack_items,
- ConstantPool constant_pool) {
- this.byte_code_offset = byte_code_offset;
- this.number_of_locals = number_of_locals;
- this.types_of_locals = types_of_locals;
- this.number_of_stack_items = number_of_stack_items;
- this.types_of_stack_items = types_of_stack_items;
- this.constant_pool = constant_pool;
- }
-
- /**
- * Dump stack map entry
- *
- * @param file Output file stream
- * @throws IOException
- */
- public final void dump(DataOutputStream file) throws IOException
- {
- file.writeShort(byte_code_offset);
-
- file.writeShort(number_of_locals);
- for(int i=0; i < number_of_locals; i++)
- types_of_locals[i].dump(file);
-
- file.writeShort(number_of_stack_items);
- for(int i=0; i < number_of_stack_items; i++)
- types_of_stack_items[i].dump(file);
- }
-
- /**
- * @return String representation.
- */
- public final String toString() {
- StringBuffer buf = new StringBuffer("(offset=" + byte_code_offset);
-
- if(number_of_locals > 0) {
- buf.append(", locals={");
-
- for(int i=0; i < number_of_locals; i++) {
- buf.append(types_of_locals[i]);
- if(i < number_of_locals - 1)
- buf.append(", ");
- }
-
- buf.append("}");
- }
-
- if(number_of_stack_items > 0) {
- buf.append(", stack items={");
-
- for(int i=0; i < number_of_stack_items; i++) {
- buf.append(types_of_stack_items[i]);
- if(i < number_of_stack_items - 1)
- buf.append(", ");
- }
-
- buf.append("}");
- }
-
- buf.append(")");
-
- return buf.toString();
- }
-
-
- public void setByteCodeOffset(int b) { byte_code_offset = b; }
- public int getByteCodeOffset() { return byte_code_offset; }
- public void setNumberOfLocals(int n) { number_of_locals = n; }
- public int getNumberOfLocals() { return number_of_locals; }
- public void setTypesOfLocals(StackMapType[] t) { types_of_locals = t; }
- public StackMapType[] getTypesOfLocals() { return types_of_locals; }
- public void setNumberOfStackItems(int n) { number_of_stack_items = n; }
- public int getNumberOfStackItems() { return number_of_stack_items; }
- public void setTypesOfStackItems(StackMapType[] t) { types_of_stack_items = t; }
- public StackMapType[] getTypesOfStackItems() { return types_of_stack_items; }
-
- /**
- * @return deep copy of this object
- */
- public StackMapEntry copy() {
- try {
- return (StackMapEntry)clone();
- } catch(CloneNotSupportedException e) {}
-
- return null;
- }
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackMapEntry(this);
- }
-
- /**
- * @return Constant pool used by this object.
- */
- public final ConstantPool getConstantPool() { return constant_pool; }
-
- /**
- * @param constant_pool Constant pool to be used for this object.
- */
- public final void setConstantPool(ConstantPool constant_pool) {
- this.constant_pool = constant_pool;
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/StackMapType.java b/src/com/sun/org/apache/bcel/internal/classfile/StackMapType.java
deleted file mode 100644
index 357d53d..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/StackMapType.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import java.io.*;
-
-/**
- * This class represents the type of a local variable or item on stack
- * used in the StackMap entries.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see StackMapEntry
- * @see StackMap
- * @see Constants
- */
-public final class StackMapType implements Cloneable {
- private byte type;
- private int index = -1; // Index to CONSTANT_Class or offset
- private ConstantPool constant_pool;
-
- /**
- * Construct object from file stream.
- * @param file Input stream
- * @throws IOException
- */
- StackMapType(DataInputStream file, ConstantPool constant_pool) throws IOException
- {
- this(file.readByte(), -1, constant_pool);
-
- if(hasIndex())
- setIndex(file.readShort());
-
- setConstantPool(constant_pool);
- }
-
- /**
- * @param type type tag as defined in the Constants interface
- * @param index index to constant pool, or byte code offset
- */
- public StackMapType(byte type, int index, ConstantPool constant_pool) {
- setType(type);
- setIndex(index);
- setConstantPool(constant_pool);
- }
-
- public void setType(byte t) {
- if((t < Constants.ITEM_Bogus) || (t > Constants.ITEM_NewObject))
- throw new RuntimeException("Illegal type for StackMapType: " + t);
- type = t;
- }
-
- public byte getType() { return type; }
- public void setIndex(int t) { index = t; }
-
- /** @return index to constant pool if type == ITEM_Object, or offset
- * in byte code, if type == ITEM_NewObject, and -1 otherwise
- */
- public int getIndex() { return index; }
-
- /**
- * Dump type entries to file.
- *
- * @param file Output file stream
- * @throws IOException
- */
- public final void dump(DataOutputStream file) throws IOException
- {
- file.writeByte(type);
- if(hasIndex())
- file.writeShort(getIndex());
- }
-
- /** @return true, if type is either ITEM_Object or ITEM_NewObject
- */
- public final boolean hasIndex() {
- return ((type == Constants.ITEM_Object) ||
- (type == Constants.ITEM_NewObject));
- }
-
- private String printIndex() {
- if(type == Constants.ITEM_Object)
- return ", class=" + constant_pool.constantToString(index, Constants.CONSTANT_Class);
- else if(type == Constants.ITEM_NewObject)
- return ", offset=" + index;
- else
- return "";
- }
-
- /**
- * @return String representation
- */
- public final String toString() {
- return "(type=" + Constants.ITEM_NAMES[type] + printIndex() + ")";
- }
-
- /**
- * @return deep copy of this object
- */
- public StackMapType copy() {
- try {
- return (StackMapType)clone();
- } catch(CloneNotSupportedException e) {}
-
- return null;
- }
-
- /**
- * @return Constant pool used by this object.
- */
- public final ConstantPool getConstantPool() { return constant_pool; }
-
- /**
- * @param constant_pool Constant pool to be used for this object.
- */
- public final void setConstantPool(ConstantPool constant_pool) {
- this.constant_pool = constant_pool;
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/Synthetic.java b/src/com/sun/org/apache/bcel/internal/classfile/Synthetic.java
deleted file mode 100644
index 4b743a6..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/Synthetic.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import java.io.*;
-
-/**
- * This class is derived from <em>Attribute</em> and declares this class as
- * `synthetic', i.e., it needs special handling. The JVM specification
- * states "A class member that does not appear in the source code must be
- * marked using a Synthetic attribute." It may appear in the ClassFile
- * attribute table, a field_info table or a method_info table. This class
- * is intended to be instantiated from the
- * <em>Attribute.readAttribute()</em> method.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see Attribute
- */
-public final class Synthetic extends Attribute {
- private byte[] bytes;
-
- /**
- * Initialize from another object. Note that both objects use the same
- * references (shallow copy). Use copy() for a physical copy.
- */
- public Synthetic(Synthetic c) {
- this(c.getNameIndex(), c.getLength(), c.getBytes(), c.getConstantPool());
- }
-
- /**
- * @param name_index Index in constant pool to CONSTANT_Utf8, which
- * should represent the string "Synthetic".
- * @param length Content length in bytes - should be zero.
- * @param bytes Attribute contents
- * @param constant_pool The constant pool this attribute is associated
- * with.
- */
- public Synthetic(int name_index, int length, byte[] bytes,
- ConstantPool constant_pool)
- {
- super(Constants.ATTR_SYNTHETIC, name_index, length, constant_pool);
- this.bytes = bytes;
- }
-
- /**
- * Construct object from file stream.
- * @param name_index Index in constant pool to CONSTANT_Utf8
- * @param length Content length in bytes
- * @param file Input stream
- * @param constant_pool Array of constants
- * @throws IOException
- */
- Synthetic(int name_index, int length, DataInputStream file,
- ConstantPool constant_pool) throws IOException
- {
- this(name_index, length, (byte [])null, constant_pool);
-
- if(length > 0) {
- bytes = new byte[length];
- file.readFully(bytes);
- System.err.println("Synthetic attribute with length > 0");
- }
- }
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitSynthetic(this);
- }
- /**
- * Dump source file attribute to file stream in binary format.
- *
- * @param file Output file stream
- * @throws IOException
- */
- public final void dump(DataOutputStream file) throws IOException
- {
- super.dump(file);
- if(length > 0)
- file.write(bytes, 0, length);
- }
- /**
- * @return data bytes.
- */
- public final byte[] getBytes() { return bytes; }
-
- /**
- * @param bytes.
- */
- public final void setBytes(byte[] bytes) {
- this.bytes = bytes;
- }
-
- /**
- * @return String representation.
- */
- public final String toString() {
- StringBuffer buf = new StringBuffer("Synthetic");
-
- if(length > 0)
- buf.append(" " + Utility.toHexString(bytes));
-
- return buf.toString();
- }
-
- /**
- * @return deep copy of this attribute
- */
- public Attribute copy(ConstantPool constant_pool) {
- Synthetic c = (Synthetic)clone();
-
- if(bytes != null)
- c.bytes = (byte[])bytes.clone();
-
- c.constant_pool = constant_pool;
- return c;
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/Unknown.java b/src/com/sun/org/apache/bcel/internal/classfile/Unknown.java
deleted file mode 100644
index 16fc476..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/Unknown.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import java.io.*;
-import java.util.*;
-
-/**
- * This class represents a reference to an unknown (i.e.,
- * application-specific) attribute of a class. It is instantiated from the
- * <em>Attribute.readAttribute()</em> method. Applications that need to
- * read in application-specific attributes should create an <a
- * href="./AttributeReader.html">AttributeReader</a> implementation and
- * attach it via <a
- * href="./Attribute.html#addAttributeReader(java.lang.String,
- * com.sun.org.apache.bcel.internal.classfile.AttributeReader)">Attribute.addAttributeReader</a>.
-
- *
- * @see com.sun.org.apache.bcel.internal.classfile.Attribute
- * @see com.sun.org.apache.bcel.internal.classfile.AttributeReader
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public final class Unknown extends Attribute {
- private byte[] bytes;
- private String name;
-
- private static HashMap unknown_attributes = new HashMap();
-
- /** @return array of unknown attributes, but just one for each kind.
- */
- static Unknown[] getUnknownAttributes() {
- Unknown[] unknowns = new Unknown[unknown_attributes.size()];
- Iterator entries = unknown_attributes.values().iterator();
-
- for(int i=0; entries.hasNext(); i++)
- unknowns[i] = (Unknown)entries.next();
-
- unknown_attributes.clear();
- return unknowns;
- }
-
- /**
- * Initialize from another object. Note that both objects use the same
- * references (shallow copy). Use clone() for a physical copy.
- */
- public Unknown(Unknown c) {
- this(c.getNameIndex(), c.getLength(), c.getBytes(), c.getConstantPool());
- }
-
- /**
- * Create a non-standard attribute.
- *
- * @param name_index Index in constant pool
- * @param length Content length in bytes
- * @param bytes Attribute contents
- * @param constant_pool Array of constants
- */
- public Unknown(int name_index, int length, byte[] bytes,
- ConstantPool constant_pool)
- {
- super(Constants.ATTR_UNKNOWN, name_index, length, constant_pool);
- this.bytes = bytes;
-
- name = ((ConstantUtf8)constant_pool.getConstant(name_index,
- Constants.CONSTANT_Utf8)).getBytes();
- unknown_attributes.put(name, this);
- }
-
- /**
- * Construct object from file stream.
- * @param name_index Index in constant pool
- * @param length Content length in bytes
- * @param file Input stream
- * @param constant_pool Array of constants
- * @throws IOException
- */
- Unknown(int name_index, int length, DataInputStream file,
- ConstantPool constant_pool)
- throws IOException
- {
- this(name_index, length, (byte [])null, constant_pool);
-
- if(length > 0) {
- bytes = new byte[length];
- file.readFully(bytes);
- }
- }
-
- /**
- * Called by objects that are traversing the nodes of the tree implicitely
- * defined by the contents of a Java class. I.e., the hierarchy of methods,
- * fields, attributes, etc. spawns a tree of objects.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitUnknown(this);
- }
- /**
- * Dump unknown bytes to file stream.
- *
- * @param file Output file stream
- * @throws IOException
- */
- public final void dump(DataOutputStream file) throws IOException
- {
- super.dump(file);
- if(length > 0)
- file.write(bytes, 0, length);
- }
- /**
- * @return data bytes.
- */
- public final byte[] getBytes() { return bytes; }
-
- /**
- * @return name of attribute.
- */
- public final String getName() { return name; }
-
- /**
- * @param bytes.
- */
- public final void setBytes(byte[] bytes) {
- this.bytes = bytes;
- }
-
- /**
- * @return String representation.
- */
- public final String toString() {
- if(length == 0 || bytes == null)
- return "(Unknown attribute " + name + ")";
-
- String hex;
- if(length > 10) {
- byte[] tmp = new byte[10];
- System.arraycopy(bytes, 0, tmp, 0, 10);
- hex = Utility.toHexString(tmp) + "... (truncated)";
- }
- else
- hex = Utility.toHexString(bytes);
-
- return "(Unknown attribute " + name + ": " + hex + ")";
- }
-
- /**
- * @return deep copy of this attribute
- */
- public Attribute copy(ConstantPool constant_pool) {
- Unknown c = (Unknown)clone();
-
- if(bytes != null)
- c.bytes = (byte[])bytes.clone();
-
- c.constant_pool = constant_pool;
- return c;
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/Utility.java b/src/com/sun/org/apache/bcel/internal/classfile/Utility.java
deleted file mode 100644
index 9e4cddc..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/Utility.java
+++ /dev/null
@@ -1,1397 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import com.sun.org.apache.bcel.internal.util.ByteSequence;
-import java.io.*;
-import java.util.ArrayList;
-import java.util.zip.*;
-
-/**
- * Utility functions that do not really belong to any class in particular.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public abstract class Utility {
- private static int consumed_chars; /* How many chars have been consumed
- * during parsing in signatureToString().
- * Read by methodSignatureToString().
- * Set by side effect,but only internally.
- */
- private static boolean wide=false; /* The `WIDE' instruction is used in the
- * byte code to allow 16-bit wide indices
- * for local variables. This opcode
- * precedes an `ILOAD', e.g.. The opcode
- * immediately following takes an extra
- * byte which is combined with the
- * following byte to form a
- * 16-bit value.
- */
- /**
- * Convert bit field of flags into string such as `static final'.
- *
- * @param access_flags Access flags
- * @return String representation of flags
- */
- public static final String accessToString(int access_flags) {
- return accessToString(access_flags, false);
- }
-
- /**
- * Convert bit field of flags into string such as `static final'.
- *
- * Special case: Classes compiled with new compilers and with the
- * `ACC_SUPER' flag would be said to be "synchronized". This is
- * because SUN used the same value for the flags `ACC_SUPER' and
- * `ACC_SYNCHRONIZED'.
- *
- * @param access_flags Access flags
- * @param for_class access flags are for class qualifiers ?
- * @return String representation of flags
- */
- public static final String accessToString(int access_flags,
- boolean for_class)
- {
- StringBuffer buf = new StringBuffer();
-
- int p = 0;
- for(int i=0; p < Constants.MAX_ACC_FLAG; i++) { // Loop through known flags
- p = pow2(i);
-
- if((access_flags & p) != 0) {
- /* Special case: Classes compiled with new compilers and with the
- * `ACC_SUPER' flag would be said to be "synchronized". This is
- * because SUN used the same value for the flags `ACC_SUPER' and
- * `ACC_SYNCHRONIZED'.
- */
- if(for_class && ((p == Constants.ACC_SUPER) || (p == Constants.ACC_INTERFACE)))
- continue;
-
- buf.append(Constants.ACCESS_NAMES[i] + " ");
- }
- }
-
- return buf.toString().trim();
- }
-
- /**
- * @return "class" or "interface", depending on the ACC_INTERFACE flag
- */
- public static final String classOrInterface(int access_flags) {
- return ((access_flags & Constants.ACC_INTERFACE) != 0)? "interface" : "class";
- }
-
- /**
- * Disassemble a byte array of JVM byte codes starting from code line
- * `index' and return the disassembled string representation. Decode only
- * `num' opcodes (including their operands), use -1 if you want to
- * decompile everything.
- *
- * @param code byte code array
- * @param constant_pool Array of constants
- * @param index offset in `code' array
- * <EM>(number of opcodes, not bytes!)</EM>
- * @param length number of opcodes to decompile, -1 for all
- * @param verbose be verbose, e.g. print constant pool index
- * @return String representation of byte codes
- */
- public static final String codeToString(byte[] code,
- ConstantPool constant_pool,
- int index, int length, boolean verbose)
- {
- StringBuffer buf = new StringBuffer(code.length * 20); // Should be sufficient
- ByteSequence stream = new ByteSequence(code);
-
- try {
- for(int i=0; i < index; i++) // Skip `index' lines of code
- codeToString(stream, constant_pool, verbose);
-
- for(int i=0; stream.available() > 0; i++) {
- if((length < 0) || (i < length)) {
- String indices = fillup(stream.getIndex() + ":", 6, true, ' ');
- buf.append(indices + codeToString(stream, constant_pool, verbose) + '\n');
- }
- }
- } catch(IOException e) {
- System.out.println(buf.toString());
- e.printStackTrace();
- throw new ClassFormatException("Byte code error: " + e);
- }
-
- return buf.toString();
- }
-
- public static final String codeToString(byte[] code,
- ConstantPool constant_pool,
- int index, int length) {
- return codeToString(code, constant_pool, index, length, true);
- }
-
- /**
- * Disassemble a stream of byte codes and return the
- * string representation.
- *
- * @param bytes stream of bytes
- * @param constant_pool Array of constants
- * @param verbose be verbose, e.g. print constant pool index
- * @return String representation of byte code
- */
- public static final String codeToString(ByteSequence bytes,
- ConstantPool constant_pool, boolean verbose)
- throws IOException
- {
- short opcode = (short)bytes.readUnsignedByte();
- int default_offset=0, low, high, npairs;
- int index, vindex, constant;
- int[] match, jump_table;
- int no_pad_bytes=0, offset;
- StringBuffer buf = new StringBuffer(Constants.OPCODE_NAMES[opcode]);
-
- /* Special case: Skip (0-3) padding bytes, i.e., the
- * following bytes are 4-byte-aligned
- */
- if((opcode == Constants.TABLESWITCH) || (opcode == Constants.LOOKUPSWITCH)) {
- int remainder = bytes.getIndex() % 4;
- no_pad_bytes = (remainder == 0)? 0 : 4 - remainder;
-
- for(int i=0; i < no_pad_bytes; i++) {
- byte b;
-
- if((b=bytes.readByte()) != 0)
- System.err.println("Warning: Padding byte != 0 in " +
- Constants.OPCODE_NAMES[opcode] + ":" + b);
- }
-
- // Both cases have a field default_offset in common
- default_offset = bytes.readInt();
- }
-
- switch(opcode) {
- /* Table switch has variable length arguments.
- */
- case Constants.TABLESWITCH:
- low = bytes.readInt();
- high = bytes.readInt();
-
- offset = bytes.getIndex() - 12 - no_pad_bytes - 1;
- default_offset += offset;
-
- buf.append("\tdefault = " + default_offset + ", low = " + low +
- ", high = " + high + "(");
-
- jump_table = new int[high - low + 1];
- for(int i=0; i < jump_table.length; i++) {
- jump_table[i] = offset + bytes.readInt();
- buf.append(jump_table[i]);
-
- if(i < jump_table.length - 1)
- buf.append(", ");
- }
- buf.append(")");
-
- break;
-
- /* Lookup switch has variable length arguments.
- */
- case Constants.LOOKUPSWITCH: {
-
- npairs = bytes.readInt();
- offset = bytes.getIndex() - 8 - no_pad_bytes - 1;
-
- match = new int[npairs];
- jump_table = new int[npairs];
- default_offset += offset;
-
- buf.append("\tdefault = " + default_offset + ", npairs = " + npairs +
- " (");
-
- for(int i=0; i < npairs; i++) {
- match[i] = bytes.readInt();
-
- jump_table[i] = offset + bytes.readInt();
-
- buf.append("(" + match[i] + ", " + jump_table[i] + ")");
-
- if(i < npairs - 1)
- buf.append(", ");
- }
- buf.append(")");
- }
- break;
-
- /* Two address bytes + offset from start of byte stream form the
- * jump target
- */
- case Constants.GOTO: case Constants.IFEQ: case Constants.IFGE: case Constants.IFGT:
- case Constants.IFLE: case Constants.IFLT: case Constants.JSR: case Constants.IFNE:
- case Constants.IFNONNULL: case Constants.IFNULL: case Constants.IF_ACMPEQ:
- case Constants.IF_ACMPNE: case Constants.IF_ICMPEQ: case Constants.IF_ICMPGE: case Constants.IF_ICMPGT:
- case Constants.IF_ICMPLE: case Constants.IF_ICMPLT: case Constants.IF_ICMPNE:
- buf.append("\t\t#" + ((bytes.getIndex() - 1) + bytes.readShort()));
- break;
-
- /* 32-bit wide jumps
- */
- case Constants.GOTO_W: case Constants.JSR_W:
- buf.append("\t\t#" + ((bytes.getIndex() - 1) + bytes.readInt()));
- break;
-
- /* Index byte references local variable (register)
- */
- case Constants.ALOAD: case Constants.ASTORE: case Constants.DLOAD: case Constants.DSTORE: case Constants.FLOAD:
- case Constants.FSTORE: case Constants.ILOAD: case Constants.ISTORE: case Constants.LLOAD: case Constants.LSTORE:
- case Constants.RET:
- if(wide) {
- vindex = bytes.readUnsignedShort();
- wide=false; // Clear flag
- }
- else
- vindex = bytes.readUnsignedByte();
-
- buf.append("\t\t%" + vindex);
- break;
-
- /*
- * Remember wide byte which is used to form a 16-bit address in the
- * following instruction. Relies on that the method is called again with
- * the following opcode.
- */
- case Constants.WIDE:
- wide = true;
- buf.append("\t(wide)");
- break;
-
- /* Array of basic type.
- */
- case Constants.NEWARRAY:
- buf.append("\t\t<" + Constants.TYPE_NAMES[bytes.readByte()] + ">");
- break;
-
- /* Access object/class fields.
- */
- case Constants.GETFIELD: case Constants.GETSTATIC: case Constants.PUTFIELD: case Constants.PUTSTATIC:
- index = bytes.readUnsignedShort();
- buf.append("\t\t" +
- constant_pool.constantToString(index, Constants.CONSTANT_Fieldref) +
- (verbose? " (" + index + ")" : ""));
- break;
-
- /* Operands are references to classes in constant pool
- */
- case Constants.NEW:
- case Constants.CHECKCAST:
- buf.append("\t");
- case Constants.INSTANCEOF:
- index = bytes.readUnsignedShort();
- buf.append("\t<" + constant_pool.constantToString(index,
- Constants.CONSTANT_Class) +
- ">" + (verbose? " (" + index + ")" : ""));
- break;
-
- /* Operands are references to methods in constant pool
- */
- case Constants.INVOKESPECIAL: case Constants.INVOKESTATIC: case Constants.INVOKEVIRTUAL:
- index = bytes.readUnsignedShort();
- buf.append("\t" + constant_pool.constantToString(index,
- Constants.CONSTANT_Methodref) +
- (verbose? " (" + index + ")" : ""));
- break;
-
- case Constants.INVOKEINTERFACE:
- index = bytes.readUnsignedShort();
- int nargs = bytes.readUnsignedByte(); // historical, redundant
- buf.append("\t" +
- constant_pool.constantToString(index,
- Constants.CONSTANT_InterfaceMethodref) +
- (verbose? " (" + index + ")\t" : "") + nargs + "\t" +
- bytes.readUnsignedByte()); // Last byte is a reserved space
- break;
-
- /* Operands are references to items in constant pool
- */
- case Constants.LDC_W: case Constants.LDC2_W:
- index = bytes.readUnsignedShort();
-
- buf.append("\t\t" + constant_pool.constantToString
- (index, constant_pool.getConstant(index).getTag()) +
- (verbose? " (" + index + ")" : ""));
- break;
-
- case Constants.LDC:
- index = bytes.readUnsignedByte();
-
- buf.append("\t\t" +
- constant_pool.constantToString
- (index, constant_pool.getConstant(index).getTag()) +
- (verbose? " (" + index + ")" : ""));
- break;
-
- /* Array of references.
- */
- case Constants.ANEWARRAY:
- index = bytes.readUnsignedShort();
-
- buf.append("\t\t<" + compactClassName(constant_pool.getConstantString
- (index, Constants.CONSTANT_Class), false) +
- ">" + (verbose? " (" + index + ")": ""));
- break;
-
- /* Multidimensional array of references.
- */
- case Constants.MULTIANEWARRAY: {
- index = bytes.readUnsignedShort();
- int dimensions = bytes.readUnsignedByte();
-
- buf.append("\t<" + compactClassName(constant_pool.getConstantString
- (index, Constants.CONSTANT_Class), false) +
- ">\t" + dimensions + (verbose? " (" + index + ")" : ""));
- }
- break;
-
- /* Increment local variable.
- */
- case Constants.IINC:
- if(wide) {
- vindex = bytes.readUnsignedShort();
- constant = bytes.readShort();
- wide = false;
- }
- else {
- vindex = bytes.readUnsignedByte();
- constant = bytes.readByte();
- }
- buf.append("\t\t%" + vindex + "\t" + constant);
- break;
-
- default:
- if(Constants.NO_OF_OPERANDS[opcode] > 0) {
- for(int i=0; i < Constants.TYPE_OF_OPERANDS[opcode].length; i++) {
- buf.append("\t\t");
- switch(Constants.TYPE_OF_OPERANDS[opcode][i]) {
- case Constants.T_BYTE: buf.append(bytes.readByte()); break;
- case Constants.T_SHORT: buf.append(bytes.readShort()); break;
- case Constants.T_INT: buf.append(bytes.readInt()); break;
-
- default: // Never reached
- System.err.println("Unreachable default case reached!");
- buf.setLength(0);
- }
- }
- }
- }
-
- return buf.toString();
- }
-
- public static final String codeToString(ByteSequence bytes, ConstantPool constant_pool)
- throws IOException
- {
- return codeToString(bytes, constant_pool, true);
- }
-
- /**
- * Shorten long class names, <em>java/lang/String</em> becomes
- * <em>String</em>.
- *
- * @param str The long class name
- * @return Compacted class name
- */
- public static final String compactClassName(String str) {
- return compactClassName(str, true);
- }
-
- /**
- * Shorten long class name <em>str</em>, i.e., chop off the <em>prefix</em>,
- * if the
- * class name starts with this string and the flag <em>chopit</em> is true.
- * Slashes <em>/</em> are converted to dots <em>.</em>.
- *
- * @param str The long class name
- * @param prefix The prefix the get rid off
- * @param chopit Flag that determines whether chopping is executed or not
- * @return Compacted class name
- */
- public static final String compactClassName(String str,
- String prefix,
- boolean chopit)
- {
- int len = prefix.length();
-
- str = str.replace('/', '.'); // Is `/' on all systems, even DOS
-
- if(chopit) {
- // If string starts with `prefix' and contains no further dots
- if(str.startsWith(prefix) &&
- (str.substring(len).indexOf('.') == -1))
- str = str.substring(len);
- }
-
- return str;
- }
-
- /**
- * Shorten long class names, <em>java/lang/String</em> becomes
- * <em>java.lang.String</em>,
- * e.g.. If <em>chopit</em> is <em>true</em> the prefix <em>java.lang</em>
- * is also removed.
- *
- * @param str The long class name
- * @param chopit Flag that determines whether chopping is executed or not
- * @return Compacted class name
- */
- public static final String compactClassName(String str, boolean chopit) {
- return compactClassName(str, "java.lang.", chopit);
- }
-
- private static final boolean is_digit(char ch) {
- return (ch >= '0') && (ch <= '9');
- }
-
- private static final boolean is_space(char ch) {
- return (ch == ' ') || (ch == '\t') || (ch == '\r') || (ch == '\n');
- }
-
- /**
- * @return `flag' with bit `i' set to 1
- */
- public static final int setBit(int flag, int i) {
- return flag | pow2(i);
- }
-
- /**
- * @return `flag' with bit `i' set to 0
- */
- public static final int clearBit(int flag, int i) {
- int bit = pow2(i);
- return (flag & bit) == 0? flag : flag ^ bit;
- }
-
- /**
- * @return true, if bit `i' in `flag' is set
- */
- public static final boolean isSet(int flag, int i) {
- return (flag & pow2(i)) != 0;
- }
-
- /**
- * Converts string containing the method return and argument types
- * to a byte code method signature.
- *
- * @param ret Return type of method
- * @param argv Types of method arguments
- * @return Byte code representation of method signature
- */
- public final static String methodTypeToSignature(String ret, String[] argv)
- throws ClassFormatException
- {
- StringBuffer buf = new StringBuffer("(");
- String str;
-
- if(argv != null)
- for(int i=0; i < argv.length; i++) {
- str = getSignature(argv[i]);
-
- if(str.endsWith("V")) // void can't be a method argument
- throw new ClassFormatException("Invalid type: " + argv[i]);
-
- buf.append(str);
- }
-
- str = getSignature(ret);
-
- buf.append(")" + str);
-
- return buf.toString();
- }
-
- /**
- * @param signature Method signature
- * @return Array of argument types
- * @throws ClassFormatException
- */
- public static final String[] methodSignatureArgumentTypes(String signature)
- throws ClassFormatException
- {
- return methodSignatureArgumentTypes(signature, true);
- }
-
- /**
- * @param signature Method signature
- * @param chopit Shorten class names ?
- * @return Array of argument types
- * @throws ClassFormatException
- */
- public static final String[] methodSignatureArgumentTypes(String signature,
- boolean chopit)
- throws ClassFormatException
- {
- ArrayList vec = new ArrayList();
- int index;
- String[] types;
-
- try { // Read all declarations between for `(' and `)'
- if(signature.charAt(0) != '(')
- throw new ClassFormatException("Invalid method signature: " + signature);
-
- index = 1; // current string position
-
- while(signature.charAt(index) != ')') {
- vec.add(signatureToString(signature.substring(index), chopit));
- index += consumed_chars; // update position
- }
- } catch(StringIndexOutOfBoundsException e) { // Should never occur
- throw new ClassFormatException("Invalid method signature: " + signature);
- }
-
- types = new String[vec.size()];
- vec.toArray(types);
- return types;
- }
- /**
- * @param signature Method signature
- * @return return type of method
- * @throws ClassFormatException
- */
- public static final String methodSignatureReturnType(String signature)
- throws ClassFormatException
- {
- return methodSignatureReturnType(signature, true);
- }
- /**
- * @param signature Method signature
- * @param chopit Shorten class names ?
- * @return return type of method
- * @throws ClassFormatException
- */
- public static final String methodSignatureReturnType(String signature,
- boolean chopit)
- throws ClassFormatException
- {
- int index;
- String type;
-
- try {
- // Read return type after `)'
- index = signature.lastIndexOf(')') + 1;
- type = signatureToString(signature.substring(index), chopit);
- } catch(StringIndexOutOfBoundsException e) { // Should never occur
- throw new ClassFormatException("Invalid method signature: " + signature);
- }
-
- return type;
- }
-
- /**
- * Converts method signature to string with all class names compacted.
- *
- * @param signature to convert
- * @param name of method
- * @param access flags of method
- * @return Human readable signature
- */
- public static final String methodSignatureToString(String signature,
- String name,
- String access) {
- return methodSignatureToString(signature, name, access, true);
- }
-
- public static final String methodSignatureToString(String signature,
- String name,
- String access,
- boolean chopit) {
- return methodSignatureToString(signature, name, access, chopit, null);
- }
-
- /**
- * A return type signature represents the return value from a method.
- * It is a series of bytes in the following grammar:
- *
- * <return_signature> ::= <field_type> | V
- *
- * The character V indicates that the method returns no value. Otherwise, the
- * signature indicates the type of the return value.
- * An argument signature represents an argument passed to a method:
- *
- * <argument_signature> ::= <field_type>
- *
- * A method signature represents the arguments that the method expects, and
- * the value that it returns.
- * <method_signature> ::= (<arguments_signature>) <return_signature>
- * <arguments_signature>::= <argument_signature>*
- *
- * This method converts such a string into a Java type declaration like
- * `void _main(String[])' and throws a `ClassFormatException' when the parsed
- * type is invalid.
- *
- * @param signature Method signature
- * @param name Method name
- * @param access Method access rights
- * @return Java type declaration
- * @throws ClassFormatException
- */
- public static final String methodSignatureToString(String signature,
- String name,
- String access,
- boolean chopit,
- LocalVariableTable vars)
- throws ClassFormatException
- {
- StringBuffer buf = new StringBuffer("(");
- String type;
- int index;
- int var_index = (access.indexOf("static") >= 0)? 0 : 1;
-
- try { // Read all declarations between for `(' and `)'
- if(signature.charAt(0) != '(')
- throw new ClassFormatException("Invalid method signature: " + signature);
-
- index = 1; // current string position
-
- while(signature.charAt(index) != ')') {
- String param_type = signatureToString(signature.substring(index), chopit);
- buf.append(param_type);
-
- if(vars != null) {
- LocalVariable l = vars.getLocalVariable(var_index);
-
- if(l != null)
- buf.append(" " + l.getName());
- } else
- buf.append(" arg" + var_index);
-
- if("double".equals(param_type) || "long".equals(param_type))
- var_index += 2;
- else
- var_index++;
-
- buf.append(", ");
- index += consumed_chars; // update position
- }
-
- index++; // update position
-
- // Read return type after `)'
- type = signatureToString(signature.substring(index), chopit);
-
- } catch(StringIndexOutOfBoundsException e) { // Should never occur
- throw new ClassFormatException("Invalid method signature: " + signature);
- }
-
- if(buf.length() > 1) // Tack off the extra ", "
- buf.setLength(buf.length() - 2);
-
- buf.append(")");
-
- return access + ((access.length() > 0)? " " : "") + // May be an empty string
- type + " " + name + buf.toString();
- }
-
- // Guess what this does
- private static final int pow2(int n) {
- return 1 << n;
- }
-
- /**
- * Replace all occurences of <em>old</em> in <em>str</em> with <em>new</em>.
- *
- * @param str String to permute
- * @param old String to be replaced
- * @param new Replacement string
- * @return new String object
- */
- public static final String replace(String str, String old, String new_) {
- int index, old_index;
- StringBuffer buf = new StringBuffer();
-
- try {
- if((index = str.indexOf(old)) != -1) { // `old' found in str
- old_index = 0; // String start offset
-
- // While we have something to replace
- while((index = str.indexOf(old, old_index)) != -1) {
- buf.append(str.substring(old_index, index)); // append prefix
- buf.append(new_); // append replacement
-
- old_index = index + old.length(); // Skip `old'.length chars
- }
-
- buf.append(str.substring(old_index)); // append rest of string
- str = buf.toString();
- }
- } catch(StringIndexOutOfBoundsException e) { // Should not occur
- System.err.println(e);
- }
-
- return str;
- }
-
- /**
- * Converts signature to string with all class names compacted.
- *
- * @param signature to convert
- * @return Human readable signature
- */
- public static final String signatureToString(String signature) {
- return signatureToString(signature, true);
- }
-
- /**
- * The field signature represents the value of an argument to a function or
- * the value of a variable. It is a series of bytes generated by the
- * following grammar:
- *
- * <PRE>
- * <field_signature> ::= <field_type>
- * <field_type> ::= <base_type>|<object_type>|<array_type>
- * <base_type> ::= B|C|D|F|I|J|S|Z
- * <object_type> ::= L<fullclassname>;
- * <array_type> ::= [<field_type>
- *
- * The meaning of the base types is as follows:
- * B byte signed byte
- * C char character
- * D double double precision IEEE float
- * F float single precision IEEE float
- * I int integer
- * J long long integer
- * L<fullclassname>; ... an object of the given class
- * S short signed short
- * Z boolean true or false
- * [<field sig> ... array
- * </PRE>
- *
- * This method converts this string into a Java type declaration such as
- * `String[]' and throws a `ClassFormatException' when the parsed type is
- * invalid.
- *
- * @param signature Class signature
- * @param chopit Flag that determines whether chopping is executed or not
- * @return Java type declaration
- * @throws ClassFormatException
- */
- public static final String signatureToString(String signature,
- boolean chopit)
- {
- consumed_chars = 1; // This is the default, read just one char like `B'
-
- try {
- switch(signature.charAt(0)) {
- case 'B' : return "byte";
- case 'C' : return "char";
- case 'D' : return "double";
- case 'F' : return "float";
- case 'I' : return "int";
- case 'J' : return "long";
-
- case 'L' : { // Full class name
- int index = signature.indexOf(';'); // Look for closing `;'
-
- if(index < 0)
- throw new ClassFormatException("Invalid signature: " + signature);
-
- consumed_chars = index + 1; // "Lblabla;" `L' and `;' are removed
-
- return compactClassName(signature.substring(1, index), chopit);
- }
-
- case 'S' : return "short";
- case 'Z' : return "boolean";
-
- case '[' : { // Array declaration
- int n;
- StringBuffer buf, brackets;
- String type;
- char ch;
- int consumed_chars; // Shadows global var
-
- brackets = new StringBuffer(); // Accumulate []'s
-
- // Count opening brackets and look for optional size argument
- for(n=0; signature.charAt(n) == '['; n++)
- brackets.append("[]");
-
- consumed_chars = n; // Remember value
-
- // The rest of the string denotes a `<field_type>'
- type = signatureToString(signature.substring(n), chopit);
-
- Utility.consumed_chars += consumed_chars;
- return type + brackets.toString();
- }
-
- case 'V' : return "void";
-
- default : throw new ClassFormatException("Invalid signature: `" +
- signature + "'");
- }
- } catch(StringIndexOutOfBoundsException e) { // Should never occur
- throw new ClassFormatException("Invalid signature: " + e + ":" + signature);
- }
- }
-
- /** Parse Java type such as "char", or "java.lang.String[]" and return the
- * signature in byte code format, e.g. "C" or "[Ljava/lang/String;" respectively.
- *
- * @param type Java type
- * @return byte code signature
- */
- public static String getSignature(String type) {
- StringBuffer buf = new StringBuffer();
- char[] chars = type.toCharArray();
- boolean char_found = false, delim = false;
- int index = -1;
-
- loop:
- for(int i=0; i < chars.length; i++) {
- switch(chars[i]) {
- case ' ': case '\t': case '\n': case '\r': case '\f':
- if(char_found)
- delim = true;
- break;
-
- case '[':
- if(!char_found)
- throw new RuntimeException("Illegal type: " + type);
-
- index = i;
- break loop;
-
- default:
- char_found = true;
- if(!delim)
- buf.append(chars[i]);
- }
- }
-
- int brackets = 0;
-
- if(index > 0)
- brackets = countBrackets(type.substring(index));
-
- type = buf.toString();
- buf.setLength(0);
-
- for(int i=0; i < brackets; i++)
- buf.append('[');
-
- boolean found = false;
-
- for(int i=Constants.T_BOOLEAN; (i <= Constants.T_VOID) && !found; i++) {
- if(Constants.TYPE_NAMES[i].equals(type)) {
- found = true;
- buf.append(Constants.SHORT_TYPE_NAMES[i]);
- }
- }
-
- if(!found) // Class name
- buf.append('L' + type.replace('.', '/') + ';');
-
- return buf.toString();
- }
-
- private static int countBrackets(String brackets) {
- char[] chars = brackets.toCharArray();
- int count = 0;
- boolean open = false;
-
- for(int i=0; i<chars.length; i++) {
- switch(chars[i]) {
- case '[':
- if(open)
- throw new RuntimeException("Illegally nested brackets:" + brackets);
- open = true;
- break;
-
- case ']':
- if(!open)
- throw new RuntimeException("Illegally nested brackets:" + brackets);
- open = false;
- count++;
- break;
-
- default:
- // Don't care
- }
- }
-
- if(open)
- throw new RuntimeException("Illegally nested brackets:" + brackets);
-
- return count;
- }
-
- /**
- * Return type of method signature as a byte value as defined in <em>Constants</em>
- *
- * @param signature in format described above
- * @return type of method signature
- * @see Constants
- */
- public static final byte typeOfMethodSignature(String signature)
- throws ClassFormatException
- {
- int index;
-
- try {
- if(signature.charAt(0) != '(')
- throw new ClassFormatException("Invalid method signature: " + signature);
-
- index = signature.lastIndexOf(')') + 1;
- return typeOfSignature(signature.substring(index));
- } catch(StringIndexOutOfBoundsException e) {
- throw new ClassFormatException("Invalid method signature: " + signature);
- }
- }
-
- /**
- * Return type of signature as a byte value as defined in <em>Constants</em>
- *
- * @param signature in format described above
- * @return type of signature
- * @see Constants
- */
- public static final byte typeOfSignature(String signature)
- throws ClassFormatException
- {
- try {
- switch(signature.charAt(0)) {
- case 'B' : return Constants.T_BYTE;
- case 'C' : return Constants.T_CHAR;
- case 'D' : return Constants.T_DOUBLE;
- case 'F' : return Constants.T_FLOAT;
- case 'I' : return Constants.T_INT;
- case 'J' : return Constants.T_LONG;
- case 'L' : return Constants.T_REFERENCE;
- case '[' : return Constants.T_ARRAY;
- case 'V' : return Constants.T_VOID;
- case 'Z' : return Constants.T_BOOLEAN;
- case 'S' : return Constants.T_SHORT;
- default:
- throw new ClassFormatException("Invalid method signature: " + signature);
- }
- } catch(StringIndexOutOfBoundsException e) {
- throw new ClassFormatException("Invalid method signature: " + signature);
- }
- }
-
- /** Map opcode names to opcode numbers. E.g., return Constants.ALOAD for "aload"
- */
- public static short searchOpcode(String name) {
- name = name.toLowerCase();
-
- for(short i=0; i < Constants.OPCODE_NAMES.length; i++)
- if(Constants.OPCODE_NAMES[i].equals(name))
- return i;
-
- return -1;
- }
-
- /**
- * Convert (signed) byte to (unsigned) short value, i.e., all negative
- * values become positive.
- */
- private static final short byteToShort(byte b) {
- return (b < 0)? (short)(256 + b) : (short)b;
- }
-
- /** Convert bytes into hexidecimal string
- *
- * @return bytes as hexidecimal string, e.g. 00 FA 12 ...
- */
- public static final String toHexString(byte[] bytes) {
- StringBuffer buf = new StringBuffer();
-
- for(int i=0; i < bytes.length; i++) {
- short b = byteToShort(bytes[i]);
- String hex = Integer.toString(b, 0x10);
-
- if(b < 0x10) // just one digit, prepend '0'
- buf.append('0');
-
- buf.append(hex);
-
- if(i < bytes.length - 1)
- buf.append(' ');
- }
-
- return buf.toString();
- }
-
- /**
- * Return a string for an integer justified left or right and filled up with
- * `fill' characters if necessary.
- *
- * @param i integer to format
- * @param length length of desired string
- * @param left_justify format left or right
- * @param fill fill character
- * @return formatted int
- */
- public static final String format(int i, int length, boolean left_justify, char fill) {
- return fillup(Integer.toString(i), length, left_justify, fill);
- }
-
- /**
- * Fillup char with up to length characters with char `fill' and justify it left or right.
- *
- * @param str string to format
- * @param length length of desired string
- * @param left_justify format left or right
- * @param fill fill character
- * @return formatted string
- */
- public static final String fillup(String str, int length, boolean left_justify, char fill) {
- int len = length - str.length();
- char[] buf = new char[(len < 0)? 0 : len];
-
- for(int j=0; j < buf.length; j++)
- buf[j] = fill;
-
- if(left_justify)
- return str + new String(buf);
- else
- return new String(buf) + str;
- }
-
- static final boolean equals(byte[] a, byte[] b) {
- int size;
-
- if((size=a.length) != b.length)
- return false;
-
- for(int i=0; i < size; i++)
- if(a[i] != b[i])
- return false;
-
- return true;
- }
-
- public static final void printArray(PrintStream out, Object[] obj) {
- out.println(printArray(obj, true));
- }
-
- public static final void printArray(PrintWriter out, Object[] obj) {
- out.println(printArray(obj, true));
- }
-
- public static final String printArray(Object[] obj) {
- return printArray(obj, true);
- }
-
- public static final String printArray(Object[] obj, boolean braces) {
- return printArray(obj, braces, false);
- }
-
- public static final String printArray(Object[] obj, boolean braces,
- boolean quote) {
- if(obj == null)
- return null;
-
- StringBuffer buf = new StringBuffer();
- if(braces)
- buf.append('{');
-
- for(int i=0; i < obj.length; i++) {
- if(obj[i] != null) {
- buf.append((quote? "\"" : "") + obj[i].toString() + (quote? "\"" : ""));
- } else {
- buf.append("null");
- }
-
- if(i < obj.length - 1) {
- buf.append(", ");
- }
- }
-
- if(braces)
- buf.append('}');
-
- return buf.toString();
- }
-
- /** @return true, if character is one of (a, ... z, A, ... Z, 0, ... 9, _)
- */
- public static boolean isJavaIdentifierPart(char ch) {
- return ((ch >= 'a') && (ch <= 'z')) ||
- ((ch >= 'A') && (ch <= 'Z')) ||
- ((ch >= '0') && (ch <= '9')) ||
- (ch == '_');
- }
-
- /** Encode byte array it into Java identifier string, i.e., a string
- * that only contains the following characters: (a, ... z, A, ... Z,
- * 0, ... 9, _, $). The encoding algorithm itself is not too
- * clever: if the current byte's ASCII value already is a valid Java
- * identifier part, leave it as it is. Otherwise it writes the
- * escape character($) followed by <p><ul><li> the ASCII value as a
- * hexadecimal string, if the value is not in the range
- * 200..247</li> <li>a Java identifier char not used in a lowercase
- * hexadecimal string, if the value is in the range
- * 200..247</li><ul></p>
- *
- * <p>This operation inflates the original byte array by roughly 40-50%</p>
- *
- * @param bytes the byte array to convert
- * @param compress use gzip to minimize string
- */
- public static String encode(byte[] bytes, boolean compress) throws IOException {
- if(compress) {
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- GZIPOutputStream gos = new GZIPOutputStream(baos);
-
- gos.write(bytes, 0, bytes.length);
- gos.close();
- baos.close();
-
- bytes = baos.toByteArray();
- }
-
- CharArrayWriter caw = new CharArrayWriter();
- JavaWriter jw = new JavaWriter(caw);
-
- for(int i=0; i < bytes.length; i++) {
- int in = bytes[i] & 0x000000ff; // Normalize to unsigned
- jw.write(in);
- }
-
- return caw.toString();
- }
-
- /** Decode a string back to a byte array.
- *
- * @param bytes the byte array to convert
- * @param uncompress use gzip to uncompress the stream of bytes
- */
- public static byte[] decode(String s, boolean uncompress) throws IOException {
- char[] chars = s.toCharArray();
-
- CharArrayReader car = new CharArrayReader(chars);
- JavaReader jr = new JavaReader(car);
-
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
-
- int ch;
-
- while((ch = jr.read()) >= 0) {
- bos.write(ch);
- }
-
- bos.close();
- car.close();
- jr.close();
-
- byte[] bytes = bos.toByteArray();
-
- if(uncompress) {
- GZIPInputStream gis = new GZIPInputStream(new ByteArrayInputStream(bytes));
-
- byte[] tmp = new byte[bytes.length * 3]; // Rough estimate
- int count = 0;
- int b;
-
- while((b = gis.read()) >= 0)
- tmp[count++] = (byte)b;
-
- bytes = new byte[count];
- System.arraycopy(tmp, 0, bytes, 0, count);
- }
-
- return bytes;
- }
-
- // A-Z, g-z, _, $
- private static final int FREE_CHARS = 48;
- private static int[] CHAR_MAP = new int[FREE_CHARS];
- private static int[] MAP_CHAR = new int[256]; // Reverse map
- private static final char ESCAPE_CHAR = '$';
-
- static {
- int j = 0, k = 0;
- for(int i='A'; i <= 'Z'; i++) {
- CHAR_MAP[j] = i;
- MAP_CHAR[i] = j;
- j++;
- }
-
- for(int i='g'; i <= 'z'; i++) {
- CHAR_MAP[j] = i;
- MAP_CHAR[i] = j;
- j++;
- }
-
- CHAR_MAP[j] = '$';
- MAP_CHAR['$'] = j;
- j++;
-
- CHAR_MAP[j] = '_';
- MAP_CHAR['_'] = j;
- }
-
- /** Decode characters into bytes.
- * Used by <a href="Utility.html#decode(java.lang.String, boolean)">decode()</a>
- */
- private static class JavaReader extends FilterReader {
- public JavaReader(Reader in) {
- super(in);
- }
-
- public int read() throws IOException {
- int b = in.read();
-
- if(b != ESCAPE_CHAR) {
- return b;
- } else {
- int i = in.read();
-
- if(i < 0)
- return -1;
-
- if(((i >= '0') && (i <= '9')) || ((i >= 'a') && (i <= 'f'))) { // Normal escape
- int j = in.read();
-
- if(j < 0)
- return -1;
-
- char[] tmp = { (char)i, (char)j };
- int s = Integer.parseInt(new String(tmp), 16);
-
- return s;
- } else { // Special escape
- return MAP_CHAR[i];
- }
- }
- }
-
- public int read(char[] cbuf, int off, int len) throws IOException {
- for(int i=0; i < len; i++)
- cbuf[off + i] = (char)read();
-
- return len;
- }
- }
-
- /** Encode bytes into valid java identifier characters.
- * Used by <a href="Utility.html#encode(byte[], boolean)">encode()</a>
- */
- private static class JavaWriter extends FilterWriter {
- public JavaWriter(Writer out) {
- super(out);
- }
-
- public void write(int b) throws IOException {
- if(isJavaIdentifierPart((char)b) && (b != ESCAPE_CHAR)) {
- out.write(b);
- } else {
- out.write(ESCAPE_CHAR); // Escape character
-
- // Special escape
- if(b >= 0 && b < FREE_CHARS) {
- out.write(CHAR_MAP[b]);
- } else { // Normal escape
- char[] tmp = Integer.toHexString(b).toCharArray();
-
- if(tmp.length == 1) {
- out.write('0');
- out.write(tmp[0]);
- } else {
- out.write(tmp[0]);
- out.write(tmp[1]);
- }
- }
- }
- }
-
- public void write(char[] cbuf, int off, int len) throws IOException {
- for(int i=0; i < len; i++)
- write(cbuf[off + i]);
- }
-
- public void write(String str, int off, int len) throws IOException {
- write(str.toCharArray(), off, len);
- }
- }
-
- /**
- * Escape all occurences of newline chars '\n', quotes \", etc.
- */
- public static final String convertString(String label) {
- char[] ch = label.toCharArray();
- StringBuffer buf = new StringBuffer();
-
- for(int i=0; i < ch.length; i++) {
- switch(ch[i]) {
- case '\n':
- buf.append("\\n"); break;
- case '\r':
- buf.append("\\r"); break;
- case '\"':
- buf.append("\\\""); break;
- case '\'':
- buf.append("\\'"); break;
- case '\\':
- buf.append("\\\\"); break;
- default:
- buf.append(ch[i]); break;
- }
- }
-
- return buf.toString();
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/Visitor.java b/src/com/sun/org/apache/bcel/internal/classfile/Visitor.java
deleted file mode 100644
index a076768..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/Visitor.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.classfile;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * Interface to make use of the Visitor pattern programming style.
- * I.e. a class that implements this interface can traverse the contents of
- * a Java class just by calling the `accept' method which all classes have.
- *
- * Implemented by wish of
- * <A HREF="http://www.inf.fu-berlin.de/~bokowski">Boris Bokowski</A>.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public interface Visitor {
- public void visitCode(Code obj);
- public void visitCodeException(CodeException obj);
- public void visitConstantClass(ConstantClass obj);
- public void visitConstantDouble(ConstantDouble obj);
- public void visitConstantFieldref(ConstantFieldref obj);
- public void visitConstantFloat(ConstantFloat obj);
- public void visitConstantInteger(ConstantInteger obj);
- public void visitConstantInterfaceMethodref(ConstantInterfaceMethodref obj);
- public void visitConstantLong(ConstantLong obj);
- public void visitConstantMethodref(ConstantMethodref obj);
- public void visitConstantNameAndType(ConstantNameAndType obj);
- public void visitConstantPool(ConstantPool obj);
- public void visitConstantString(ConstantString obj);
- public void visitConstantUtf8(ConstantUtf8 obj);
- public void visitConstantValue(ConstantValue obj);
- public void visitDeprecated(Deprecated obj);
- public void visitExceptionTable(ExceptionTable obj);
- public void visitField(Field obj);
- public void visitInnerClass(InnerClass obj);
- public void visitInnerClasses(InnerClasses obj);
- public void visitJavaClass(JavaClass obj);
- public void visitLineNumber(LineNumber obj);
- public void visitLineNumberTable(LineNumberTable obj);
- public void visitLocalVariable(LocalVariable obj);
- public void visitLocalVariableTable(LocalVariableTable obj);
- public void visitLocalVariableTypeTable(LocalVariableTypeTable obj);
- public void visitMethod(Method obj);
- public void visitSignature(Signature obj);
- public void visitSourceFile(SourceFile obj);
- public void visitSynthetic(Synthetic obj);
- public void visitUnknown(Unknown obj);
- public void visitStackMap(StackMap obj);
- public void visitStackMapEntry(StackMapEntry obj);
-}
diff --git a/src/com/sun/org/apache/bcel/internal/classfile/package.html b/src/com/sun/org/apache/bcel/internal/classfile/package.html
deleted file mode 100644
index ff0ab4d..0000000
--- a/src/com/sun/org/apache/bcel/internal/classfile/package.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-$Id: package.html,v 1.1.2.1 2005/07/31 23:46:33 jeffsuttor Exp $
--->
-</head>
-<body bgcolor="white">
-<p>
-This package contains the classes that describe the structure of a
-Java class file and a class file parser.
-</p>
-</body>
-</html>
diff --git a/src/com/sun/org/apache/bcel/internal/generic/AALOAD.java b/src/com/sun/org/apache/bcel/internal/generic/AALOAD.java
deleted file mode 100644
index 914d5b3..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/AALOAD.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * AALOAD - Load reference from array
- * <PRE>Stack: ..., arrayref, index -&gt; value</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class AALOAD extends ArrayInstruction implements StackProducer {
- /** Load reference from array
- */
- public AALOAD() {
- super(com.sun.org.apache.bcel.internal.Constants.AALOAD);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackProducer(this);
- v.visitExceptionThrower(this);
- v.visitTypedInstruction(this);
- v.visitArrayInstruction(this);
- v.visitAALOAD(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/AASTORE.java b/src/com/sun/org/apache/bcel/internal/generic/AASTORE.java
deleted file mode 100644
index e8a2ddd..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/AASTORE.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * AASTORE - Store into reference array
- * <PRE>Stack: ..., arrayref, index, value -&gt; ...</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class AASTORE extends ArrayInstruction implements StackConsumer {
- /** Store into reference array
- */
- public AASTORE() {
- super(com.sun.org.apache.bcel.internal.Constants.AASTORE);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackConsumer(this);
- v.visitExceptionThrower(this);
- v.visitTypedInstruction(this);
- v.visitArrayInstruction(this);
- v.visitAASTORE(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/ACONST_NULL.java b/src/com/sun/org/apache/bcel/internal/generic/ACONST_NULL.java
deleted file mode 100644
index 7d10035..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/ACONST_NULL.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * ACONST_NULL - Push null reference
- * <PRE>Stack: ... -&gt; ..., null</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class ACONST_NULL extends Instruction
- implements PushInstruction, TypedInstruction {
- /**
- * Push null reference
- */
- public ACONST_NULL() {
- super(com.sun.org.apache.bcel.internal.Constants.ACONST_NULL, (short)1);
- }
-
- /** @return Type.NULL
- */
- public Type getType(ConstantPoolGen cp) {
- return Type.NULL;
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackProducer(this);
- v.visitPushInstruction(this);
- v.visitTypedInstruction(this);
- v.visitACONST_NULL(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/ALOAD.java b/src/com/sun/org/apache/bcel/internal/generic/ALOAD.java
deleted file mode 100644
index 2d0a113..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/ALOAD.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * ALOAD - Load reference from local variable
- * <PRE>Stack: ... -&gt; ..., objectref</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class ALOAD extends LoadInstruction {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- ALOAD() {
- super(com.sun.org.apache.bcel.internal.Constants.ALOAD, com.sun.org.apache.bcel.internal.Constants.ALOAD_0);
- }
-
- /** Load reference from local variable
- * @param n index of local variable
- */
- public ALOAD(int n) {
- super(com.sun.org.apache.bcel.internal.Constants.ALOAD, com.sun.org.apache.bcel.internal.Constants.ALOAD_0, n);
- }
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- super.accept(v);
- v.visitALOAD(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/ANEWARRAY.java b/src/com/sun/org/apache/bcel/internal/generic/ANEWARRAY.java
deleted file mode 100644
index 4ab5550..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/ANEWARRAY.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import com.sun.org.apache.bcel.internal.ExceptionConstants;
-
-/**
- * ANEWARRAY - Create new array of references
- * <PRE>Stack: ..., count -&gt; ..., arrayref</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class ANEWARRAY extends CPInstruction
- implements LoadClass, AllocationInstruction, ExceptionThrower, StackProducer {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- ANEWARRAY() {}
-
- public ANEWARRAY(int index) {
- super(com.sun.org.apache.bcel.internal.Constants.ANEWARRAY, index);
- }
-
- public Class[] getExceptions(){
- Class[] cs = new Class[1 + ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION.length];
-
- System.arraycopy(ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION, 0,
- cs, 0, ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION.length);
- cs[ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION.length] =
- ExceptionConstants.NEGATIVE_ARRAY_SIZE_EXCEPTION;
- return cs;
- }
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitLoadClass(this);
- v.visitAllocationInstruction(this);
- v.visitExceptionThrower(this);
- v.visitStackProducer(this);
- v.visitTypedInstruction(this);
- v.visitCPInstruction(this);
- v.visitANEWARRAY(this);
- }
-
- public ObjectType getLoadClassType(ConstantPoolGen cpg) {
- Type t = getType(cpg);
-
- if (t instanceof ArrayType){
- t = ((ArrayType) t).getBasicType();
- }
-
- return (t instanceof ObjectType)? (ObjectType) t : null;
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/ARETURN.java b/src/com/sun/org/apache/bcel/internal/generic/ARETURN.java
deleted file mode 100644
index b0c7389..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/ARETURN.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * ARETURN - Return reference from method
- * <PRE>Stack: ..., objectref -&gt; &lt;empty&gt;</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class ARETURN extends ReturnInstruction {
- /**
- * Return reference from method
- */
- public ARETURN() {
- super(com.sun.org.apache.bcel.internal.Constants.ARETURN);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitExceptionThrower(this);
- v.visitTypedInstruction(this);
- v.visitStackConsumer(this);
- v.visitReturnInstruction(this);
- v.visitARETURN(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/ARRAYLENGTH.java b/src/com/sun/org/apache/bcel/internal/generic/ARRAYLENGTH.java
deleted file mode 100644
index 33f10e6..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/ARRAYLENGTH.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * ARRAYLENGTH - Get length of array
- * <PRE>Stack: ..., arrayref -&gt; ..., length</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class ARRAYLENGTH extends Instruction
- implements ExceptionThrower, StackProducer {
- /** Get length of array
- */
- public ARRAYLENGTH() {
- super(com.sun.org.apache.bcel.internal.Constants.ARRAYLENGTH, (short)1);
- }
-
- /** @return exceptions this instruction may cause
- */
- public Class[] getExceptions() {
- return new Class[] { com.sun.org.apache.bcel.internal.ExceptionConstants.NULL_POINTER_EXCEPTION };
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitExceptionThrower(this);
- v.visitStackProducer(this);
- v.visitARRAYLENGTH(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/ASTORE.java b/src/com/sun/org/apache/bcel/internal/generic/ASTORE.java
deleted file mode 100644
index 4b15efe..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/ASTORE.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * ASTORE - Store reference into local variable
- * <PRE>Stack ..., objectref -&gt; ... </PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class ASTORE extends StoreInstruction {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- ASTORE() {
- super(com.sun.org.apache.bcel.internal.Constants.ASTORE, com.sun.org.apache.bcel.internal.Constants.ASTORE_0);
- }
-
- /** Store reference into local variable
- * @param n index of local variable
- */
- public ASTORE(int n) {
- super(com.sun.org.apache.bcel.internal.Constants.ASTORE, com.sun.org.apache.bcel.internal.Constants.ASTORE_0, n);
- }
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- super.accept(v);
- v.visitASTORE(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/ATHROW.java b/src/com/sun/org/apache/bcel/internal/generic/ATHROW.java
deleted file mode 100644
index f0afea7..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/ATHROW.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * ATHROW - Throw exception
- * <PRE>Stack: ..., objectref -&gt; objectref</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class ATHROW extends Instruction implements UnconditionalBranch, ExceptionThrower {
- /**
- * Throw exception
- */
- public ATHROW() {
- super(com.sun.org.apache.bcel.internal.Constants.ATHROW, (short)1);
- }
-
- /** @return exceptions this instruction may cause
- */
- public Class[] getExceptions() {
- return new Class[] { com.sun.org.apache.bcel.internal.ExceptionConstants.THROWABLE };
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitUnconditionalBranch(this);
- v.visitExceptionThrower(this);
- v.visitATHROW(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/AllocationInstruction.java b/src/com/sun/org/apache/bcel/internal/generic/AllocationInstruction.java
deleted file mode 100644
index 1006440..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/AllocationInstruction.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * Denote family of instructions that allocates space in the heap.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public interface AllocationInstruction {}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/ArithmeticInstruction.java b/src/com/sun/org/apache/bcel/internal/generic/ArithmeticInstruction.java
deleted file mode 100644
index 5b35a8c..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/ArithmeticInstruction.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import com.sun.org.apache.bcel.internal.Constants;
-/**
- * Super class for the family of arithmetic instructions.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public abstract class ArithmeticInstruction extends Instruction
- implements TypedInstruction, StackProducer, StackConsumer {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- ArithmeticInstruction() {}
-
- /**
- * @param opcode of instruction
- */
- protected ArithmeticInstruction(short opcode) {
- super(opcode, (short)1);
- }
-
- /** @return type associated with the instruction
- */
- public Type getType(ConstantPoolGen cp) {
- switch(opcode) {
- case Constants.DADD: case Constants.DDIV: case Constants.DMUL:
- case Constants.DNEG: case Constants.DREM: case Constants.DSUB:
- return Type.DOUBLE;
-
- case Constants.FADD: case Constants.FDIV: case Constants.FMUL:
- case Constants.FNEG: case Constants.FREM: case Constants.FSUB:
- return Type.FLOAT;
-
- case Constants.IADD: case Constants.IAND: case Constants.IDIV:
- case Constants.IMUL: case Constants.INEG: case Constants.IOR: case Constants.IREM:
- case Constants.ISHL: case Constants.ISHR: case Constants.ISUB:
- case Constants.IUSHR: case Constants.IXOR:
- return Type.INT;
-
- case Constants.LADD: case Constants.LAND: case Constants.LDIV:
- case Constants.LMUL: case Constants.LNEG: case Constants.LOR: case Constants.LREM:
- case Constants.LSHL: case Constants.LSHR: case Constants.LSUB:
- case Constants.LUSHR: case Constants.LXOR:
- return Type.LONG;
-
- default: // Never reached
- throw new ClassGenException("Unknown type " + opcode);
- }
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/ArrayInstruction.java b/src/com/sun/org/apache/bcel/internal/generic/ArrayInstruction.java
deleted file mode 100644
index 5b902c3..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/ArrayInstruction.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * Super class for instructions dealing with array access such as IALOAD.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public abstract class ArrayInstruction extends Instruction
- implements ExceptionThrower, TypedInstruction {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- ArrayInstruction() {}
-
- /**
- * @param opcode of instruction
- */
- protected ArrayInstruction(short opcode) {
- super(opcode, (short)1);
- }
-
- public Class[] getExceptions() {
- return com.sun.org.apache.bcel.internal.ExceptionConstants.EXCS_ARRAY_EXCEPTION;
- }
-
- /** @return type associated with the instruction
- */
- public Type getType(ConstantPoolGen cp) {
- switch(opcode) {
- case com.sun.org.apache.bcel.internal.Constants.IALOAD: case com.sun.org.apache.bcel.internal.Constants.IASTORE:
- return Type.INT;
- case com.sun.org.apache.bcel.internal.Constants.CALOAD: case com.sun.org.apache.bcel.internal.Constants.CASTORE:
- return Type.CHAR;
- case com.sun.org.apache.bcel.internal.Constants.BALOAD: case com.sun.org.apache.bcel.internal.Constants.BASTORE:
- return Type.BYTE;
- case com.sun.org.apache.bcel.internal.Constants.SALOAD: case com.sun.org.apache.bcel.internal.Constants.SASTORE:
- return Type.SHORT;
- case com.sun.org.apache.bcel.internal.Constants.LALOAD: case com.sun.org.apache.bcel.internal.Constants.LASTORE:
- return Type.LONG;
- case com.sun.org.apache.bcel.internal.Constants.DALOAD: case com.sun.org.apache.bcel.internal.Constants.DASTORE:
- return Type.DOUBLE;
- case com.sun.org.apache.bcel.internal.Constants.FALOAD: case com.sun.org.apache.bcel.internal.Constants.FASTORE:
- return Type.FLOAT;
- case com.sun.org.apache.bcel.internal.Constants.AALOAD: case com.sun.org.apache.bcel.internal.Constants.AASTORE:
- return Type.OBJECT;
-
- default: throw new ClassGenException("Oops: unknown case in switch" + opcode);
- }
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/ArrayType.java b/src/com/sun/org/apache/bcel/internal/generic/ArrayType.java
deleted file mode 100644
index 54bd83a..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/ArrayType.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import com.sun.org.apache.bcel.internal.Constants;
-
-/**
- * Denotes array type, such as int[][]
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public final class ArrayType extends ReferenceType {
- private int dimensions;
- private Type basic_type;
-
- /**
- * Convenience constructor for array type, e.g. int[]
- *
- * @param type array type, e.g. T_INT
- */
- public ArrayType(byte type, int dimensions) {
- this(BasicType.getType(type), dimensions);
- }
-
- /**
- * Convenience constructor for reference array type, e.g. Object[]
- *
- * @param class_name complete name of class (java.lang.String, e.g.)
- */
- public ArrayType(String class_name, int dimensions) {
- this(new ObjectType(class_name), dimensions);
- }
-
- /**
- * Constructor for array of given type
- *
- * @param type type of array (may be an array itself)
- */
- public ArrayType(Type type, int dimensions) {
- super(Constants.T_ARRAY, "<dummy>");
-
- if((dimensions < 1) || (dimensions > Constants.MAX_BYTE))
- throw new ClassGenException("Invalid number of dimensions: " + dimensions);
-
- switch(type.getType()) {
- case Constants.T_ARRAY:
- ArrayType array = (ArrayType)type;
- this.dimensions = dimensions + array.dimensions;
- basic_type = array.basic_type;
- break;
-
- case Constants.T_VOID:
- throw new ClassGenException("Invalid type: void[]");
-
- default: // Basic type or reference
- this.dimensions = dimensions;
- basic_type = type;
- break;
- }
-
- StringBuffer buf = new StringBuffer();
- for(int i=0; i < this.dimensions; i++)
- buf.append('[');
-
- buf.append(basic_type.getSignature());
-
- signature = buf.toString();
- }
-
- /**
- * @return basic type of array, i.e., for int[][][] the basic type is int
- */
- public Type getBasicType() {
- return basic_type;
- }
-
- /**
- * @return element type of array, i.e., for int[][][] the element type is int[][]
- */
- public Type getElementType() {
- if(dimensions == 1)
- return basic_type;
- else
- return new ArrayType(basic_type, dimensions - 1);
- }
-
- /** @return number of dimensions of array
- */
- public int getDimensions() { return dimensions; }
-
- /** @return a hash code value for the object.
- */
- public int hashCode() { return basic_type.hashCode() ^ dimensions; }
-
- /** @return true if both type objects refer to the same array type.
- */
- public boolean equals(Object type) {
- if(type instanceof ArrayType) {
- ArrayType array = (ArrayType)type;
- return (array.dimensions == dimensions) && array.basic_type.equals(basic_type);
- } else
- return false;
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/BALOAD.java b/src/com/sun/org/apache/bcel/internal/generic/BALOAD.java
deleted file mode 100644
index 9ed9afa..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/BALOAD.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * BALOAD - Load byte or boolean from array
- * <PRE>Stack: ..., arrayref, index -&gt; ..., value</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class BALOAD extends ArrayInstruction implements StackProducer {
- /** Load byte or boolean from array
- */
- public BALOAD() {
- super(com.sun.org.apache.bcel.internal.Constants.BALOAD);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackProducer(this);
- v.visitExceptionThrower(this);
- v.visitTypedInstruction(this);
- v.visitArrayInstruction(this);
- v.visitBALOAD(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/BASTORE.java b/src/com/sun/org/apache/bcel/internal/generic/BASTORE.java
deleted file mode 100644
index 300719e..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/BASTORE.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * BASTORE - Store into byte or boolean array
- * <PRE>Stack: ..., arrayref, index, value -&gt; ...</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class BASTORE extends ArrayInstruction implements StackConsumer {
- /** Store byte or boolean into array
- */
- public BASTORE() {
- super(com.sun.org.apache.bcel.internal.Constants.BASTORE);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackConsumer(this);
- v.visitExceptionThrower(this);
- v.visitTypedInstruction(this);
- v.visitArrayInstruction(this);
- v.visitBASTORE(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/BIPUSH.java b/src/com/sun/org/apache/bcel/internal/generic/BIPUSH.java
deleted file mode 100644
index 0ed9962..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/BIPUSH.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import java.io.*;
-import com.sun.org.apache.bcel.internal.util.ByteSequence;
-
-/**
- * BIPUSH - Push byte on stack
- *
- * <PRE>Stack: ... -&gt; ..., value</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class BIPUSH extends Instruction implements ConstantPushInstruction {
- private byte b;
-
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- BIPUSH() {}
-
- /** Push byte on stack
- */
- public BIPUSH(byte b) {
- super(com.sun.org.apache.bcel.internal.Constants.BIPUSH, (short)2);
- this.b = b;
- }
-
- /**
- * Dump instruction as byte code to stream out.
- */
- public void dump(DataOutputStream out) throws IOException {
- super.dump(out);
- out.writeByte(b);
- }
-
- /**
- * @return mnemonic for instruction
- */
- public String toString(boolean verbose) {
- return super.toString(verbose) + " " + b;
- }
-
- /**
- * Read needed data (e.g. index) from file.
- */
- protected void initFromFile(ByteSequence bytes, boolean wide) throws IOException
- {
- length = 2;
- b = bytes.readByte();
- }
-
- public Number getValue() { return new Integer(b); }
-
- /** @return Type.BYTE
- */
- public Type getType(ConstantPoolGen cp) {
- return Type.BYTE;
- }
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitPushInstruction(this);
- v.visitStackProducer(this);
- v.visitTypedInstruction(this);
- v.visitConstantPushInstruction(this);
- v.visitBIPUSH(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/BREAKPOINT.java b/src/com/sun/org/apache/bcel/internal/generic/BREAKPOINT.java
deleted file mode 100644
index 0490be6..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/BREAKPOINT.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * BREAKPOINT, JVM dependent, ignored by default
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class BREAKPOINT extends Instruction {
- public BREAKPOINT() {
- super(com.sun.org.apache.bcel.internal.Constants.BREAKPOINT, (short)1);
- }
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitBREAKPOINT(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/BasicType.java b/src/com/sun/org/apache/bcel/internal/generic/BasicType.java
deleted file mode 100644
index c7340a6..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/BasicType.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import com.sun.org.apache.bcel.internal.Constants;
-
-/**
- * Denotes basic type such as int.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public final class BasicType extends Type {
- /**
- * Constructor for basic types such as int, long, `void'
- *
- * @param type one of T_INT, T_BOOLEAN, ..., T_VOID
- * @see com.sun.org.apache.bcel.internal.Constants
- */
- BasicType(byte type) {
- super(type, Constants.SHORT_TYPE_NAMES[type]);
-
- if((type < Constants.T_BOOLEAN) || (type > Constants.T_VOID))
- throw new ClassGenException("Invalid type: " + type);
- }
-
- public static final BasicType getType(byte type) {
- switch(type) {
- case Constants.T_VOID: return VOID;
- case Constants.T_BOOLEAN: return BOOLEAN;
- case Constants.T_BYTE: return BYTE;
- case Constants.T_SHORT: return SHORT;
- case Constants.T_CHAR: return CHAR;
- case Constants.T_INT: return INT;
- case Constants.T_LONG: return LONG;
- case Constants.T_DOUBLE: return DOUBLE;
- case Constants.T_FLOAT: return FLOAT;
-
- default:
- throw new ClassGenException("Invalid type: " + type);
- }
- }
-
- /** @return true if both type objects refer to the same type
- */
- @Override
- public boolean equals(Object type) {
- return (type instanceof BasicType)?
- ((BasicType)type).type == this.type : false;
- }
-
- @Override
- public int hashCode() {
- return type;
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/BranchHandle.java b/src/com/sun/org/apache/bcel/internal/generic/BranchHandle.java
deleted file mode 100644
index 1f7cbb0..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/BranchHandle.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * BranchHandle is returned by specialized InstructionList.append() whenever a
- * BranchInstruction is appended. This is useful when the target of this
- * instruction is not known at time of creation and must be set later
- * via setTarget().
- *
- * @see InstructionHandle
- * @see Instruction
- * @see InstructionList
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public final class BranchHandle extends InstructionHandle {
- private BranchInstruction bi; // An alias in fact, but saves lots of casts
-
- private BranchHandle(BranchInstruction i) {
- super(i);
- bi = i;
- }
-
- /** Factory methods.
- */
- private static BranchHandle bh_list = null; // List of reusable handles
-
- static final BranchHandle getBranchHandle(BranchInstruction i) {
- if(bh_list == null)
- return new BranchHandle(i);
- else {
- BranchHandle bh = bh_list;
- bh_list = (BranchHandle)bh.next;
-
- bh.setInstruction(i);
-
- return bh;
- }
- }
-
- /** Handle adds itself to the list of resuable handles.
- */
- protected void addHandle() {
- next = bh_list;
- bh_list = this;
- }
-
- /* Override InstructionHandle methods: delegate to branch instruction.
- * Through this overriding all access to the private i_position field should
- * be prevented.
- */
- public int getPosition() { return bi.position; }
-
- void setPosition(int pos) {
- i_position = bi.position = pos;
- }
-
- protected int updatePosition(int offset, int max_offset) {
- int x = bi.updatePosition(offset, max_offset);
- i_position = bi.position;
- return x;
- }
-
- /**
- * Pass new target to instruction.
- */
- public void setTarget(InstructionHandle ih) {
- bi.setTarget(ih);
- }
-
- /**
- * Update target of instruction.
- */
- public void updateTarget(InstructionHandle old_ih, InstructionHandle new_ih) {
- bi.updateTarget(old_ih, new_ih);
- }
-
- /**
- * @return target of instruction.
- */
- public InstructionHandle getTarget() {
- return bi.getTarget();
- }
-
- /**
- * Set new contents. Old instruction is disposed and may not be used anymore.
- */
- public void setInstruction(Instruction i) {
- super.setInstruction(i);
-
- if(!(i instanceof BranchInstruction))
- throw new ClassGenException("Assigning " + i +
- " to branch handle which is not a branch instruction");
-
- bi = (BranchInstruction)i;
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/BranchInstruction.java b/src/com/sun/org/apache/bcel/internal/generic/BranchInstruction.java
deleted file mode 100644
index 36960f8..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/BranchInstruction.java
+++ /dev/null
@@ -1,269 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import java.io.*;
-import com.sun.org.apache.bcel.internal.util.ByteSequence;
-
-/**
- * Abstract super class for branching instructions like GOTO, IFEQ, etc..
- * Branch instructions may have a variable length, namely GOTO, JSR,
- * LOOKUPSWITCH and TABLESWITCH.
- *
- * @see InstructionList
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public abstract class BranchInstruction extends Instruction implements InstructionTargeter {
- protected int index; // Branch target relative to this instruction
- protected InstructionHandle target; // Target object in instruction list
- protected int position; // Byte code offset
-
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- BranchInstruction() {}
-
- /** Common super constructor
- * @param opcodee Instruction opcode
- * @param target instruction to branch to
- */
- protected BranchInstruction(short opcode, InstructionHandle target) {
- super(opcode, (short)3);
- setTarget(target);
- }
-
- /**
- * Dump instruction as byte code to stream out.
- * @param out Output stream
- */
- @Override
- public void dump(DataOutputStream out) throws IOException {
- out.writeByte(opcode);
-
- index = getTargetOffset();
-
- if(Math.abs(index) >= 32767) // too large for short
- throw new ClassGenException("Branch target offset too large for short");
-
- out.writeShort(index); // May be negative, i.e., point backwards
- }
-
- /**
- * @param target branch target
- * @return the offset to `target' relative to this instruction
- */
- protected int getTargetOffset(InstructionHandle target) {
- if(target == null)
- throw new ClassGenException("Target of " + super.toString(true) +
- " is invalid null handle");
-
- int t = target.getPosition();
-
- if(t < 0)
- throw new ClassGenException("Invalid branch target position offset for " +
- super.toString(true) + ":" + t + ":" + target);
-
- return t - position;
- }
-
- /**
- * @return the offset to this instruction's target
- */
- protected int getTargetOffset() { return getTargetOffset(target); }
-
- /**
- * Called by InstructionList.setPositions when setting the position for every
- * instruction. In the presence of variable length instructions `setPositions'
- * performs multiple passes over the instruction list to calculate the
- * correct (byte) positions and offsets by calling this function.
- *
- * @param offset additional offset caused by preceding (variable length) instructions
- * @param max_offset the maximum offset that may be caused by these instructions
- * @return additional offset caused by possible change of this instruction's length
- */
- protected int updatePosition(int offset, int max_offset) {
- position += offset;
- return 0;
- }
-
- /**
- * Long output format:
- *
- * &lt;position in byte code&gt;
- * &lt;name of opcode&gt; "["&lt;opcode number&gt;"]"
- * "("&lt;length of instruction&gt;")"
- * "&lt;"&lt;target instruction&gt;"&gt;" "@"&lt;branch target offset&gt;
- *
- * @param verbose long/short format switch
- * @return mnemonic for instruction
- */
- @Override
- public String toString(boolean verbose) {
- String s = super.toString(verbose);
- String t = "null";
-
- if(verbose) {
- if(target != null) {
- if(target.getInstruction() == this)
- t = "<points to itself>";
- else if(target.getInstruction() == null)
- t = "<null instruction!!!?>";
- else
- t = target.getInstruction().toString(false); // Avoid circles
- }
- } else {
- if(target != null) {
- index = getTargetOffset();
- t = "" + (index + position);
- }
- }
-
- return s + " -> " + t;
- }
-
- /**
- * Read needed data (e.g. index) from file. Conversion to a InstructionHandle
- * is done in InstructionList(byte[]).
- *
- * @param bytes input stream
- * @param wide wide prefix?
- * @see InstructionList
- */
- @Override
- protected void initFromFile(ByteSequence bytes, boolean wide) throws IOException
- {
- length = 3;
- index = bytes.readShort();
- }
-
- /**
- * @return target offset in byte code
- */
- public final int getIndex() { return index; }
-
- /**
- * @return target of branch instruction
- */
- public InstructionHandle getTarget() { return target; }
-
- /**
- * Set branch target
- * @param target branch target
- */
- public final void setTarget(InstructionHandle target) {
- notifyTargetChanging(this.target, this);
- this.target = target;
- notifyTargetChanged(this.target, this);
- }
-
- /**
- * Used by BranchInstruction, LocalVariableGen, CodeExceptionGen.
- * Must be called before the target is actually changed in the
- * InstructionTargeter.
- */
- static void notifyTargetChanging(InstructionHandle old_ih,
- InstructionTargeter t) {
- if(old_ih != null) {
- old_ih.removeTargeter(t);
- }
- }
-
- /**
- * Used by BranchInstruction, LocalVariableGen, CodeExceptionGen.
- * Must be called after the target is actually changed in the
- * InstructionTargeter.
- */
- static void notifyTargetChanged(InstructionHandle new_ih,
- InstructionTargeter t) {
- if(new_ih != null) {
- new_ih.addTargeter(t);
- }
- }
-
- /**
- * @param old_ih old target
- * @param new_ih new target
- */
- @Override
- public void updateTarget(InstructionHandle old_ih, InstructionHandle new_ih) {
- if(target == old_ih)
- setTarget(new_ih);
- else
- throw new ClassGenException("Not targeting " + old_ih + ", but " + target);
- }
-
- /**
- * @return true, if ih is target of this instruction
- */
- @Override
- public boolean containsTarget(InstructionHandle ih) {
- return (target == ih);
- }
-
- /**
- * Inform target that it's not targeted anymore.
- */
- @Override
- void dispose() {
- setTarget(null);
- index=-1;
- position=-1;
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/CALOAD.java b/src/com/sun/org/apache/bcel/internal/generic/CALOAD.java
deleted file mode 100644
index f738f00..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/CALOAD.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * CALOAD - Load char from array
- * <PRE>Stack: ..., arrayref, index -&gt; ..., value</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class CALOAD extends ArrayInstruction implements StackProducer {
- /** Load char from array
- */
- public CALOAD() {
- super(com.sun.org.apache.bcel.internal.Constants.CALOAD);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackProducer(this);
- v.visitExceptionThrower(this);
- v.visitTypedInstruction(this);
- v.visitArrayInstruction(this);
- v.visitCALOAD(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/CASTORE.java b/src/com/sun/org/apache/bcel/internal/generic/CASTORE.java
deleted file mode 100644
index 94187cc..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/CASTORE.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * CASTORE - Store into char array
- * <PRE>Stack: ..., arrayref, index, value -&gt; ...</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class CASTORE extends ArrayInstruction implements StackConsumer {
- /** Store char into array
- */
- public CASTORE() {
- super(com.sun.org.apache.bcel.internal.Constants.CASTORE);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackConsumer(this);
- v.visitExceptionThrower(this);
- v.visitTypedInstruction(this);
- v.visitArrayInstruction(this);
- v.visitCASTORE(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/CHECKCAST.java b/src/com/sun/org/apache/bcel/internal/generic/CHECKCAST.java
deleted file mode 100644
index 20302f9..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/CHECKCAST.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import com.sun.org.apache.bcel.internal.ExceptionConstants;
-/**
- * CHECKCAST - Check whether object is of given type
- * <PRE>Stack: ..., objectref -&gt; ..., objectref</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class CHECKCAST extends CPInstruction
- implements LoadClass, ExceptionThrower, StackProducer, StackConsumer {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- CHECKCAST() {}
-
- /** Check whether object is of given type
- * @param n index to class in constant pool
- */
- public CHECKCAST(int index) {
- super(com.sun.org.apache.bcel.internal.Constants.CHECKCAST, index);
- }
-
- /** @return exceptions this instruction may cause
- */
- public Class[] getExceptions() {
- Class[] cs = new Class[1 + ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION.length];
-
- System.arraycopy(ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION, 0,
- cs, 0, ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION.length);
- cs[ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION.length] =
- ExceptionConstants.CLASS_CAST_EXCEPTION;
- return cs;
- }
-
- public ObjectType getLoadClassType(ConstantPoolGen cpg) {
- Type t = getType(cpg);
-
- if(t instanceof ArrayType)
- t = ((ArrayType) t).getBasicType();
-
- return (t instanceof ObjectType)? (ObjectType) t : null;
- }
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitLoadClass(this);
- v.visitExceptionThrower(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitTypedInstruction(this);
- v.visitCPInstruction(this);
- v.visitCHECKCAST(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/CPInstruction.java b/src/com/sun/org/apache/bcel/internal/generic/CPInstruction.java
deleted file mode 100644
index 5f9650b..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/CPInstruction.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import java.io.*;
-import com.sun.org.apache.bcel.internal.util.ByteSequence;
-import com.sun.org.apache.bcel.internal.Constants;
-import com.sun.org.apache.bcel.internal.classfile.*;
-
-/**
- * Abstract super class for instructions that use an index into the
- * constant pool such as LDC, INVOKEVIRTUAL, etc.
- *
- * @see ConstantPoolGen
- * @see LDC
- * @see INVOKEVIRTUAL
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public abstract class CPInstruction extends Instruction
- implements TypedInstruction, IndexedInstruction
-{
- protected int index; // index to constant pool
-
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- CPInstruction() {}
-
- /**
- * @param index to constant pool
- */
- protected CPInstruction(short opcode, int index) {
- super(opcode, (short)3);
- setIndex(index);
- }
-
- /**
- * Dump instruction as byte code to stream out.
- * @param out Output stream
- */
- public void dump(DataOutputStream out) throws IOException {
- out.writeByte(opcode);
- out.writeShort(index);
- }
-
- /**
- * Long output format:
- *
- * &lt;name of opcode&gt; "["&lt;opcode number&gt;"]"
- * "("&lt;length of instruction&gt;")" "&lt;"&lt; constant pool index&gt;"&gt;"
- *
- * @param verbose long/short format switch
- * @return mnemonic for instruction
- */
- public String toString(boolean verbose) {
- return super.toString(verbose) + " " + index;
- }
-
- /**
- * @return mnemonic for instruction with symbolic references resolved
- */
- public String toString(ConstantPool cp) {
- Constant c = cp.getConstant(index);
- String str = cp.constantToString(c);
-
- if(c instanceof ConstantClass)
- str = str.replace('.', '/');
-
- return com.sun.org.apache.bcel.internal.Constants.OPCODE_NAMES[opcode] + " " + str;
- }
-
- /**
- * Read needed data (i.e., index) from file.
- * @param bytes input stream
- * @param wide wide prefix?
- */
- protected void initFromFile(ByteSequence bytes, boolean wide)
- throws IOException
- {
- setIndex(bytes.readUnsignedShort());
- length = 3;
- }
-
- /**
- * @return index in constant pool referred by this instruction.
- */
- public final int getIndex() { return index; }
-
- /**
- * Set the index to constant pool.
- * @param index in constant pool.
- */
- public void setIndex(int index) {
- if(index < 0)
- throw new ClassGenException("Negative index value: " + index);
-
- this.index = index;
- }
-
- /** @return type related with this instruction.
- */
- public Type getType(ConstantPoolGen cpg) {
- ConstantPool cp = cpg.getConstantPool();
- String name = cp.getConstantString(index, com.sun.org.apache.bcel.internal.Constants.CONSTANT_Class);
-
- if(!name.startsWith("["))
- name = "L" + name + ";";
-
- return Type.getType(name);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/ClassGen.java b/src/com/sun/org/apache/bcel/internal/generic/ClassGen.java
deleted file mode 100644
index 005a50b..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/ClassGen.java
+++ /dev/null
@@ -1,454 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import com.sun.org.apache.bcel.internal.classfile.*;
-import java.util.ArrayList;
-import java.util.Iterator;
-
-/**
- * Template class for building up a java class. May be initialized with an
- * existing java class (file).
- *
- * @see JavaClass
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class ClassGen extends AccessFlags implements Cloneable {
- /* Corresponds to the fields found in a JavaClass object.
- */
- private String class_name, super_class_name, file_name;
- private int class_name_index = -1, superclass_name_index = -1;
- private int major = Constants.MAJOR_1_1, minor = Constants.MINOR_1_1;
-
- private ConstantPoolGen cp; // Template for building up constant pool
-
- // ArrayLists instead of arrays to gather fields, methods, etc.
- private ArrayList field_vec = new ArrayList();
- private ArrayList method_vec = new ArrayList();
- private ArrayList attribute_vec = new ArrayList();
- private ArrayList interface_vec = new ArrayList();
-
- /** Convenience constructor to set up some important values initially.
- *
- * @param class_name fully qualified class name
- * @param super_class_name fully qualified superclass name
- * @param file_name source file name
- * @param access_flags access qualifiers
- * @param interfaces implemented interfaces
- * @param cp constant pool to use
- */
- public ClassGen(String class_name, String super_class_name, String file_name,
- int access_flags, String[] interfaces, ConstantPoolGen cp) {
- this.class_name = class_name;
- this.super_class_name = super_class_name;
- this.file_name = file_name;
- this.access_flags = access_flags;
- this.cp = cp;
-
- // Put everything needed by default into the constant pool and the vectors
- if(file_name != null)
- addAttribute(new SourceFile(cp.addUtf8("SourceFile"), 2,
- cp.addUtf8(file_name), cp.getConstantPool()));
-
- class_name_index = cp.addClass(class_name);
- superclass_name_index = cp.addClass(super_class_name);
-
- if(interfaces != null)
- for(int i=0; i < interfaces.length; i++)
- addInterface(interfaces[i]);
- }
-
- /** Convenience constructor to set up some important values initially.
- *
- * @param class_name fully qualified class name
- * @param super_class_name fully qualified superclass name
- * @param file_name source file name
- * @param access_flags access qualifiers
- * @param interfaces implemented interfaces
- */
- public ClassGen(String class_name, String super_class_name, String file_name,
- int access_flags, String[] interfaces) {
- this(class_name, super_class_name, file_name, access_flags, interfaces,
- new ConstantPoolGen());
- }
-
- /**
- * Initialize with existing class.
- * @param clazz JavaClass object (e.g. read from file)
- */
- public ClassGen(JavaClass clazz) {
- class_name_index = clazz.getClassNameIndex();
- superclass_name_index = clazz.getSuperclassNameIndex();
- class_name = clazz.getClassName();
- super_class_name = clazz.getSuperclassName();
- file_name = clazz.getSourceFileName();
- access_flags = clazz.getAccessFlags();
- cp = new ConstantPoolGen(clazz.getConstantPool());
- major = clazz.getMajor();
- minor = clazz.getMinor();
-
- Attribute[] attributes = clazz.getAttributes();
- Method[] methods = clazz.getMethods();
- Field[] fields = clazz.getFields();
- String[] interfaces = clazz.getInterfaceNames();
-
- for(int i=0; i < interfaces.length; i++)
- addInterface(interfaces[i]);
-
- for(int i=0; i < attributes.length; i++)
- addAttribute(attributes[i]);
-
- for(int i=0; i < methods.length; i++)
- addMethod(methods[i]);
-
- for(int i=0; i < fields.length; i++)
- addField(fields[i]);
- }
-
- /**
- * @return the (finally) built up Java class object.
- */
- public JavaClass getJavaClass() {
- int[] interfaces = getInterfaces();
- Field[] fields = getFields();
- Method[] methods = getMethods();
- Attribute[] attributes = getAttributes();
-
- // Must be last since the above calls may still add something to it
- ConstantPool cp = this.cp.getFinalConstantPool();
-
- return new JavaClass(class_name_index, superclass_name_index,
- file_name, major, minor, access_flags,
- cp, interfaces, fields, methods, attributes);
- }
-
- /**
- * Add an interface to this class, i.e., this class has to implement it.
- * @param name interface to implement (fully qualified class name)
- */
- public void addInterface(String name) {
- interface_vec.add(name);
- }
-
- /**
- * Remove an interface from this class.
- * @param name interface to remove (fully qualified name)
- */
- public void removeInterface(String name) {
- interface_vec.remove(name);
- }
-
- /**
- * @return major version number of class file
- */
- public int getMajor() { return major; }
-
- /** Set major version number of class file, default value is 45 (JDK 1.1)
- * @param major major version number
- */
- public void setMajor(int major) {
- this.major = major;
- }
-
- /** Set minor version number of class file, default value is 3 (JDK 1.1)
- * @param minor minor version number
- */
- public void setMinor(int minor) {
- this.minor = minor;
- }
-
- /**
- * @return minor version number of class file
- */
- public int getMinor() { return minor; }
-
- /**
- * Add an attribute to this class.
- * @param a attribute to add
- */
- public void addAttribute(Attribute a) { attribute_vec.add(a); }
-
- /**
- * Add a method to this class.
- * @param m method to add
- */
- public void addMethod(Method m) { method_vec.add(m); }
-
- /**
- * Convenience method.
- *
- * Add an empty constructor to this class that does nothing but calling super().
- * @param access rights for constructor
- */
- public void addEmptyConstructor(int access_flags) {
- InstructionList il = new InstructionList();
- il.append(InstructionConstants.THIS); // Push `this'
- il.append(new INVOKESPECIAL(cp.addMethodref(super_class_name,
- "<init>", "()V")));
- il.append(InstructionConstants.RETURN);
-
- MethodGen mg = new MethodGen(access_flags, Type.VOID, Type.NO_ARGS, null,
- "<init>", class_name, il, cp);
- mg.setMaxStack(1);
- addMethod(mg.getMethod());
- }
-
- /**
- * Add a field to this class.
- * @param f field to add
- */
- public void addField(Field f) { field_vec.add(f); }
-
- public boolean containsField(Field f) { return field_vec.contains(f); }
-
- /** @return field object with given name, or null
- */
- public Field containsField(String name) {
- for(Iterator e=field_vec.iterator(); e.hasNext(); ) {
- Field f = (Field)e.next();
- if(f.getName().equals(name))
- return f;
- }
-
- return null;
- }
-
- /** @return method object with given name and signature, or null
- */
- public Method containsMethod(String name, String signature) {
- for(Iterator e=method_vec.iterator(); e.hasNext();) {
- Method m = (Method)e.next();
- if(m.getName().equals(name) && m.getSignature().equals(signature))
- return m;
- }
-
- return null;
- }
-
- /**
- * Remove an attribute from this class.
- * @param a attribute to remove
- */
- public void removeAttribute(Attribute a) { attribute_vec.remove(a); }
-
- /**
- * Remove a method from this class.
- * @param m method to remove
- */
- public void removeMethod(Method m) { method_vec.remove(m); }
-
- /** Replace given method with new one. If the old one does not exist
- * add the new_ method to the class anyway.
- */
- public void replaceMethod(Method old, Method new_) {
- if(new_ == null)
- throw new ClassGenException("Replacement method must not be null");
-
- int i = method_vec.indexOf(old);
-
- if(i < 0)
- method_vec.add(new_);
- else
- method_vec.set(i, new_);
- }
-
- /** Replace given field with new one. If the old one does not exist
- * add the new_ field to the class anyway.
- */
- public void replaceField(Field old, Field new_) {
- if(new_ == null)
- throw new ClassGenException("Replacement method must not be null");
-
- int i = field_vec.indexOf(old);
-
- if(i < 0)
- field_vec.add(new_);
- else
- field_vec.set(i, new_);
- }
-
- /**
- * Remove a field to this class.
- * @param f field to remove
- */
- public void removeField(Field f) { field_vec.remove(f); }
-
- public String getClassName() { return class_name; }
- public String getSuperclassName() { return super_class_name; }
- public String getFileName() { return file_name; }
-
- public void setClassName(String name) {
- class_name = name.replace('/', '.');
- class_name_index = cp.addClass(name);
- }
-
- public void setSuperclassName(String name) {
- super_class_name = name.replace('/', '.');
- superclass_name_index = cp.addClass(name);
- }
-
- public Method[] getMethods() {
- Method[] methods = new Method[method_vec.size()];
- method_vec.toArray(methods);
- return methods;
- }
-
- public void setMethods(Method[] methods) {
- method_vec.clear();
- for(int m=0; m<methods.length; m++)
- addMethod(methods[m]);
- }
-
- public void setMethodAt(Method method, int pos) {
- method_vec.set(pos, method);
- }
-
- public Method getMethodAt(int pos) {
- return (Method)method_vec.get(pos);
- }
-
- public String[] getInterfaceNames() {
- int size = interface_vec.size();
- String[] interfaces = new String[size];
-
- interface_vec.toArray(interfaces);
- return interfaces;
- }
-
- public int[] getInterfaces() {
- int size = interface_vec.size();
- int[] interfaces = new int[size];
-
- for(int i=0; i < size; i++)
- interfaces[i] = cp.addClass((String)interface_vec.get(i));
-
- return interfaces;
- }
-
- public Field[] getFields() {
- Field[] fields = new Field[field_vec.size()];
- field_vec.toArray(fields);
- return fields;
- }
-
- public Attribute[] getAttributes() {
- Attribute[] attributes = new Attribute[attribute_vec.size()];
- attribute_vec.toArray(attributes);
- return attributes;
- }
-
- public ConstantPoolGen getConstantPool() { return cp; }
- public void setConstantPool(ConstantPoolGen constant_pool) {
- cp = constant_pool;
- }
-
- public void setClassNameIndex(int class_name_index) {
- this.class_name_index = class_name_index;
- class_name = cp.getConstantPool().
- getConstantString(class_name_index, Constants.CONSTANT_Class).replace('/', '.');
- }
-
- public void setSuperclassNameIndex(int superclass_name_index) {
- this.superclass_name_index = superclass_name_index;
- super_class_name = cp.getConstantPool().
- getConstantString(superclass_name_index, Constants.CONSTANT_Class).replace('/', '.');
- }
-
- public int getSuperclassNameIndex() { return superclass_name_index; }
-
- public int getClassNameIndex() { return class_name_index; }
-
- private ArrayList observers;
-
- /** Add observer for this object.
- */
- public void addObserver(ClassObserver o) {
- if(observers == null)
- observers = new ArrayList();
-
- observers.add(o);
- }
-
- /** Remove observer for this object.
- */
- public void removeObserver(ClassObserver o) {
- if(observers != null)
- observers.remove(o);
- }
-
- /** Call notify() method on all observers. This method is not called
- * automatically whenever the state has changed, but has to be
- * called by the user after he has finished editing the object.
- */
- public void update() {
- if(observers != null)
- for(Iterator e = observers.iterator(); e.hasNext(); )
- ((ClassObserver)e.next()).notify(this);
- }
-
- public Object clone() {
- try {
- return super.clone();
- } catch(CloneNotSupportedException e) {
- System.err.println(e);
- return null;
- }
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/ClassGenException.java b/src/com/sun/org/apache/bcel/internal/generic/ClassGenException.java
deleted file mode 100644
index bc4bb71..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/ClassGenException.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * Thrown on internal errors. Extends RuntimeException so it hasn't to be declared
- * in the throws clause every time.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class ClassGenException extends RuntimeException {
- public ClassGenException() { super(); }
- public ClassGenException(String s) { super(s); }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/ClassObserver.java b/src/com/sun/org/apache/bcel/internal/generic/ClassObserver.java
deleted file mode 100644
index 3ef714d..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/ClassObserver.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * Implement this interface if you're interested in changes to a ClassGen object
- * and register yourself with addObserver().
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public interface ClassObserver {
- public void notify(ClassGen clazz);
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/CodeExceptionGen.java b/src/com/sun/org/apache/bcel/internal/generic/CodeExceptionGen.java
deleted file mode 100644
index 0fb252b..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/CodeExceptionGen.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.classfile.*;
-
-/**
- * This class represents an exception handler, i.e., specifies the region where
- * a handler is active and an instruction where the actual handling is done.
- * pool as parameters. Opposed to the JVM specification the end of the handled
- * region is set to be inclusive, i.e. all instructions between start and end
- * are protected including the start and end instructions (handles) themselves.
- * The end of the region is automatically mapped to be exclusive when calling
- * getCodeException(), i.e., there is no difference semantically.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see MethodGen
- * @see CodeException
- * @see InstructionHandle
- */
-public final class CodeExceptionGen
- implements InstructionTargeter, Cloneable, java.io.Serializable {
- private InstructionHandle start_pc;
- private InstructionHandle end_pc;
- private InstructionHandle handler_pc;
- private ObjectType catch_type;
-
- /**
- * Add an exception handler, i.e., specify region where a handler is active and an
- * instruction where the actual handling is done.
- *
- * @param start_pc Start of handled region (inclusive)
- * @param end_pc End of handled region (inclusive)
- * @param handler_pc Where handling is done
- * @param catch_type which exception is handled, null for ANY
- */
- public CodeExceptionGen(InstructionHandle start_pc, InstructionHandle end_pc,
- InstructionHandle handler_pc, ObjectType catch_type) {
- setStartPC(start_pc);
- setEndPC(end_pc);
- setHandlerPC(handler_pc);
- this.catch_type = catch_type;
- }
-
- /**
- * Get CodeException object.<BR>
- *
- * This relies on that the instruction list has already been dumped
- * to byte code or or that the `setPositions' methods has been
- * called for the instruction list.
- *
- * @param cp constant pool
- */
- public CodeException getCodeException(ConstantPoolGen cp) {
- return new CodeException(start_pc.getPosition(),
- end_pc.getPosition() + end_pc.getInstruction().getLength(),
- handler_pc.getPosition(),
- (catch_type == null)? 0 : cp.addClass(catch_type));
- }
-
- /* Set start of handler
- * @param start_pc Start of handled region (inclusive)
- */
- public final void setStartPC(InstructionHandle start_pc) {
- BranchInstruction.notifyTargetChanging(this.start_pc, this);
- this.start_pc = start_pc;
- BranchInstruction.notifyTargetChanged(this.start_pc, this);
- }
-
- /* Set end of handler
- * @param end_pc End of handled region (inclusive)
- */
- public final void setEndPC(InstructionHandle end_pc) {
- BranchInstruction.notifyTargetChanging(this.end_pc, this);
- this.end_pc = end_pc;
- BranchInstruction.notifyTargetChanged(this.end_pc, this);
- }
-
- /* Set handler code
- * @param handler_pc Start of handler
- */
- public final void setHandlerPC(InstructionHandle handler_pc) {
- BranchInstruction.notifyTargetChanging(this.handler_pc, this);
- this.handler_pc = handler_pc;
- BranchInstruction.notifyTargetChanged(this.handler_pc, this);
- }
-
- /**
- * @param old_ih old target, either start or end
- * @param new_ih new target
- */
- @Override
- public void updateTarget(InstructionHandle old_ih, InstructionHandle new_ih) {
- boolean targeted = false;
-
- if(start_pc == old_ih) {
- targeted = true;
- setStartPC(new_ih);
- }
-
- if(end_pc == old_ih) {
- targeted = true;
- setEndPC(new_ih);
- }
-
- if(handler_pc == old_ih) {
- targeted = true;
- setHandlerPC(new_ih);
- }
-
- if(!targeted)
- throw new ClassGenException("Not targeting " + old_ih + ", but {" + start_pc + ", " +
- end_pc + ", " + handler_pc + "}");
- }
-
- /**
- * @return true, if ih is target of this handler
- */
- @Override
- public boolean containsTarget(InstructionHandle ih) {
- return (start_pc == ih) || (end_pc == ih) || (handler_pc == ih);
- }
-
- /** Sets the type of the Exception to catch. Set 'null' for ANY. */
- public void setCatchType(ObjectType catch_type) { this.catch_type = catch_type; }
- /** Gets the type of the Exception to catch, 'null' for ANY. */
- public ObjectType getCatchType() { return catch_type; }
-
- /** @return start of handled region (inclusive)
- */
- public InstructionHandle getStartPC() { return start_pc; }
-
- /** @return end of handled region (inclusive)
- */
- public InstructionHandle getEndPC() { return end_pc; }
-
- /** @return start of handler
- */
- public InstructionHandle getHandlerPC() { return handler_pc; }
-
- @Override
- public String toString() {
- return "CodeExceptionGen(" + start_pc + ", " + end_pc + ", " + handler_pc + ")";
- }
-
- @Override
- public Object clone() {
- try {
- return super.clone();
- } catch(CloneNotSupportedException e) {
- System.err.println(e);
- return null;
- }
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/CompoundInstruction.java b/src/com/sun/org/apache/bcel/internal/generic/CompoundInstruction.java
deleted file mode 100644
index b543a2e..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/CompoundInstruction.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * Wrapper class for `compound' operations, virtual instructions that
- * don't exist as byte code, but give a useful meaning. For example,
- * the (virtual) PUSH instruction takes an arbitray argument and produces the
- * appropiate code at dump time (ICONST, LDC, BIPUSH, ...). Also you can use the
- * SWITCH instruction as a useful template for either LOOKUPSWITCH or
- * TABLESWITCH.
- *
- * The interface provides the possibilty for the user to write
- * `templates' or `macros' for such reuseable code patterns.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see PUSH
- * @see SWITCH
- */
-public interface CompoundInstruction {
- public InstructionList getInstructionList();
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/ConstantPoolGen.java b/src/com/sun/org/apache/bcel/internal/generic/ConstantPoolGen.java
deleted file mode 100644
index 1b53aeb..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/ConstantPoolGen.java
+++ /dev/null
@@ -1,789 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import com.sun.org.apache.bcel.internal.classfile.*;
-import java.util.HashMap;
-
-/**
- * This class is used to build up a constant pool. The user adds
- * constants via `addXXX' methods, `addString', `addClass',
- * etc.. These methods return an index into the constant
- * pool. Finally, `getFinalConstantPool()' returns the constant pool
- * built up. Intermediate versions of the constant pool can be
- * obtained with `getConstantPool()'. A constant pool has capacity for
- * Constants.MAX_SHORT entries. Note that the first (0) is used by the
- * JVM and that Double and Long constants need two slots.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see Constant
- */
-public class ConstantPoolGen implements java.io.Serializable {
- protected int size = 1024; // Inital size, sufficient in most cases
- protected Constant[] constants = new Constant[size];
- protected int index = 1; // First entry (0) used by JVM
-
- private static final String METHODREF_DELIM = ":";
- private static final String IMETHODREF_DELIM = "#";
- private static final String FIELDREF_DELIM = "&";
- private static final String NAT_DELIM = "%";
-
- private static class Index implements java.io.Serializable {
- int index;
- Index(int i) { index = i; }
- }
-
- /**
- * Initialize with given array of constants.
- *
- * @param c array of given constants, new ones will be appended
- */
- public ConstantPoolGen(Constant[] cs) {
- if(cs.length > size) {
- size = cs.length;
- constants = new Constant[size];
- }
-
- System.arraycopy(cs, 0, constants, 0, cs.length);
-
- if(cs.length > 0)
- index = cs.length;
-
- for(int i=1; i < index; i++) {
- Constant c = constants[i];
-
- if(c instanceof ConstantString) {
- ConstantString s = (ConstantString)c;
- ConstantUtf8 u8 = (ConstantUtf8)constants[s.getStringIndex()];
-
- string_table.put(u8.getBytes(), new Index(i));
- } else if(c instanceof ConstantClass) {
- ConstantClass s = (ConstantClass)c;
- ConstantUtf8 u8 = (ConstantUtf8)constants[s.getNameIndex()];
-
- class_table.put(u8.getBytes(), new Index(i));
- } else if(c instanceof ConstantNameAndType) {
- ConstantNameAndType n = (ConstantNameAndType)c;
- ConstantUtf8 u8 = (ConstantUtf8)constants[n.getNameIndex()];
- ConstantUtf8 u8_2 = (ConstantUtf8)constants[n.getSignatureIndex()];
-
- n_a_t_table.put(u8.getBytes() + NAT_DELIM + u8_2.getBytes(), new Index(i));
- } else if(c instanceof ConstantUtf8) {
- ConstantUtf8 u = (ConstantUtf8)c;
-
- utf8_table.put(u.getBytes(), new Index(i));
- } else if(c instanceof ConstantCP) {
- ConstantCP m = (ConstantCP)c;
- ConstantClass clazz = (ConstantClass)constants[m.getClassIndex()];
- ConstantNameAndType n = (ConstantNameAndType)constants[m.getNameAndTypeIndex()];
-
- ConstantUtf8 u8 = (ConstantUtf8)constants[clazz.getNameIndex()];
- String class_name = u8.getBytes().replace('/', '.');
-
- u8 = (ConstantUtf8)constants[n.getNameIndex()];
- String method_name = u8.getBytes();
-
- u8 = (ConstantUtf8)constants[n.getSignatureIndex()];
- String signature = u8.getBytes();
-
- String delim = METHODREF_DELIM;
-
- if(c instanceof ConstantInterfaceMethodref)
- delim = IMETHODREF_DELIM;
- else if(c instanceof ConstantFieldref)
- delim = FIELDREF_DELIM;
-
- cp_table.put(class_name + delim + method_name + delim + signature, new Index(i));
- }
- }
- }
-
- /**
- * Initialize with given constant pool.
- */
- public ConstantPoolGen(ConstantPool cp) {
- this(cp.getConstantPool());
- }
-
- /**
- * Create empty constant pool.
- */
- public ConstantPoolGen() {}
-
- /** Resize internal array of constants.
- */
- protected void adjustSize() {
- if(index + 3 >= size) {
- Constant[] cs = constants;
-
- size *= 2;
- constants = new Constant[size];
- System.arraycopy(cs, 0, constants, 0, index);
- }
- }
-
- private HashMap string_table = new HashMap();
-
- /**
- * Look for ConstantString in ConstantPool containing String `str'.
- *
- * @param str String to search for
- * @return index on success, -1 otherwise
- */
- public int lookupString(String str) {
- Index index = (Index)string_table.get(str);
- return (index != null)? index.index : -1;
- }
-
- /**
- * Add a new String constant to the ConstantPool, if it is not already in there.
- *
- * @param str String to add
- * @return index of entry
- */
- public int addString(String str) {
- int ret;
-
- if((ret = lookupString(str)) != -1)
- return ret; // Already in CP
-
- int utf8 = addUtf8(str);
-
- adjustSize();
-
- ConstantString s = new ConstantString(utf8);
-
- ret = index;
- constants[index++] = s;
-
- string_table.put(str, new Index(ret));
-
- return ret;
- }
-
- private HashMap class_table = new HashMap();
-
- /**
- * Look for ConstantClass in ConstantPool named `str'.
- *
- * @param str String to search for
- * @return index on success, -1 otherwise
- */
- public int lookupClass(String str) {
- Index index = (Index)class_table.get(str.replace('.', '/'));
- return (index != null)? index.index : -1;
- }
-
- private int addClass_(String clazz) {
- int ret;
-
- if((ret = lookupClass(clazz)) != -1)
- return ret; // Already in CP
-
- adjustSize();
-
- ConstantClass c = new ConstantClass(addUtf8(clazz));
-
- ret = index;
- constants[index++] = c;
-
- class_table.put(clazz, new Index(ret));
-
- return ret;
- }
-
- /**
- * Add a new Class reference to the ConstantPool, if it is not already in there.
- *
- * @param str Class to add
- * @return index of entry
- */
- public int addClass(String str) {
- return addClass_(str.replace('.', '/'));
- }
-
- /**
- * Add a new Class reference to the ConstantPool for a given type.
- *
- * @param str Class to add
- * @return index of entry
- */
- public int addClass(ObjectType type) {
- return addClass(type.getClassName());
- }
-
- /**
- * Add a reference to an array class (e.g. String[][]) as needed by MULTIANEWARRAY
- * instruction, e.g. to the ConstantPool.
- *
- * @param type type of array class
- * @return index of entry
- */
- public int addArrayClass(ArrayType type) {
- return addClass_(type.getSignature());
- }
-
- /**
- * Look for ConstantInteger in ConstantPool.
- *
- * @param n integer number to look for
- * @return index on success, -1 otherwise
- */
- public int lookupInteger(int n) {
- for(int i=1; i < index; i++) {
- if(constants[i] instanceof ConstantInteger) {
- ConstantInteger c = (ConstantInteger)constants[i];
-
- if(c.getBytes() == n)
- return i;
- }
- }
-
- return -1;
- }
-
- /**
- * Add a new Integer constant to the ConstantPool, if it is not already in there.
- *
- * @param n integer number to add
- * @return index of entry
- */
- public int addInteger(int n) {
- int ret;
-
- if((ret = lookupInteger(n)) != -1)
- return ret; // Already in CP
-
- adjustSize();
-
- ret = index;
- constants[index++] = new ConstantInteger(n);
-
- return ret;
- }
-
- /**
- * Look for ConstantFloat in ConstantPool.
- *
- * @param n Float number to look for
- * @return index on success, -1 otherwise
- */
- public int lookupFloat(float n) {
- int bits = Float.floatToIntBits(n);
-
- for(int i=1; i < index; i++) {
- if(constants[i] instanceof ConstantFloat) {
- ConstantFloat c = (ConstantFloat)constants[i];
-
- if(Float.floatToIntBits(c.getBytes()) == bits)
- return i;
- }
- }
-
- return -1;
- }
-
- /**
- * Add a new Float constant to the ConstantPool, if it is not already in there.
- *
- * @param n Float number to add
- * @return index of entry
- */
- public int addFloat(float n) {
- int ret;
-
- if((ret = lookupFloat(n)) != -1)
- return ret; // Already in CP
-
- adjustSize();
-
- ret = index;
- constants[index++] = new ConstantFloat(n);
-
- return ret;
- }
-
- private HashMap utf8_table = new HashMap();
-
- /**
- * Look for ConstantUtf8 in ConstantPool.
- *
- * @param n Utf8 string to look for
- * @return index on success, -1 otherwise
- */
- public int lookupUtf8(String n) {
- Index index = (Index)utf8_table.get(n);
-
- return (index != null)? index.index : -1;
- }
-
- /**
- * Add a new Utf8 constant to the ConstantPool, if it is not already in there.
- *
- * @param n Utf8 string to add
- * @return index of entry
- */
- public int addUtf8(String n) {
- int ret;
-
- if((ret = lookupUtf8(n)) != -1)
- return ret; // Already in CP
-
- adjustSize();
-
- ret = index;
- constants[index++] = new ConstantUtf8(n);
-
- utf8_table.put(n, new Index(ret));
-
- return ret;
- }
-
- /**
- * Look for ConstantLong in ConstantPool.
- *
- * @param n Long number to look for
- * @return index on success, -1 otherwise
- */
- public int lookupLong(long n) {
- for(int i=1; i < index; i++) {
- if(constants[i] instanceof ConstantLong) {
- ConstantLong c = (ConstantLong)constants[i];
-
- if(c.getBytes() == n)
- return i;
- }
- }
-
- return -1;
- }
-
- /**
- * Add a new long constant to the ConstantPool, if it is not already in there.
- *
- * @param n Long number to add
- * @return index of entry
- */
- public int addLong(long n) {
- int ret;
-
- if((ret = lookupLong(n)) != -1)
- return ret; // Already in CP
-
- adjustSize();
-
- ret = index;
- constants[index] = new ConstantLong(n);
- index += 2; // Wastes one entry according to spec
-
- return ret;
- }
-
- /**
- * Look for ConstantDouble in ConstantPool.
- *
- * @param n Double number to look for
- * @return index on success, -1 otherwise
- */
- public int lookupDouble(double n) {
- long bits = Double.doubleToLongBits(n);
-
- for(int i=1; i < index; i++) {
- if(constants[i] instanceof ConstantDouble) {
- ConstantDouble c = (ConstantDouble)constants[i];
-
- if(Double.doubleToLongBits(c.getBytes()) == bits)
- return i;
- }
- }
-
- return -1;
- }
-
- /**
- * Add a new double constant to the ConstantPool, if it is not already in there.
- *
- * @param n Double number to add
- * @return index of entry
- */
- public int addDouble(double n) {
- int ret;
-
- if((ret = lookupDouble(n)) != -1)
- return ret; // Already in CP
-
- adjustSize();
-
- ret = index;
- constants[index] = new ConstantDouble(n);
- index += 2; // Wastes one entry according to spec
-
- return ret;
- }
-
- private HashMap n_a_t_table = new HashMap();
-
- /**
- * Look for ConstantNameAndType in ConstantPool.
- *
- * @param name of variable/method
- * @param signature of variable/method
- * @return index on success, -1 otherwise
- */
- public int lookupNameAndType(String name, String signature) {
- Index index = (Index)n_a_t_table.get(name + NAT_DELIM + signature);
- return (index != null)? index.index : -1;
- }
-
- /**
- * Add a new NameAndType constant to the ConstantPool if it is not already
- * in there.
- *
- * @param n NameAndType string to add
- * @return index of entry
- */
- public int addNameAndType(String name, String signature) {
- int ret;
- int name_index, signature_index;
-
- if((ret = lookupNameAndType(name, signature)) != -1)
- return ret; // Already in CP
-
- adjustSize();
-
- name_index = addUtf8(name);
- signature_index = addUtf8(signature);
- ret = index;
- constants[index++] = new ConstantNameAndType(name_index, signature_index);
-
- n_a_t_table.put(name + NAT_DELIM + signature, new Index(ret));
- return ret;
- }
-
- private HashMap cp_table = new HashMap();
-
- /**
- * Look for ConstantMethodref in ConstantPool.
- *
- * @param class_name Where to find method
- * @param method_name Guess what
- * @param signature return and argument types
- * @return index on success, -1 otherwise
- */
- public int lookupMethodref(String class_name, String method_name, String signature) {
- Index index = (Index)cp_table.get(class_name + METHODREF_DELIM + method_name +
- METHODREF_DELIM + signature);
- return (index != null)? index.index : -1;
- }
-
- public int lookupMethodref(MethodGen method) {
- return lookupMethodref(method.getClassName(), method.getName(),
- method.getSignature());
- }
-
- /**
- * Add a new Methodref constant to the ConstantPool, if it is not already
- * in there.
- *
- * @param n Methodref string to add
- * @return index of entry
- */
- public int addMethodref(String class_name, String method_name, String signature) {
- int ret, class_index, name_and_type_index;
-
- if((ret = lookupMethodref(class_name, method_name, signature)) != -1)
- return ret; // Already in CP
-
- adjustSize();
-
- name_and_type_index = addNameAndType(method_name, signature);
- class_index = addClass(class_name);
- ret = index;
- constants[index++] = new ConstantMethodref(class_index, name_and_type_index);
-
- cp_table.put(class_name + METHODREF_DELIM + method_name +
- METHODREF_DELIM + signature, new Index(ret));
-
- return ret;
- }
-
- public int addMethodref(MethodGen method) {
- return addMethodref(method.getClassName(), method.getName(),
- method.getSignature());
- }
-
- /**
- * Look for ConstantInterfaceMethodref in ConstantPool.
- *
- * @param class_name Where to find method
- * @param method_name Guess what
- * @param signature return and argument types
- * @return index on success, -1 otherwise
- */
- public int lookupInterfaceMethodref(String class_name, String method_name, String signature) {
- Index index = (Index)cp_table.get(class_name + IMETHODREF_DELIM + method_name +
- IMETHODREF_DELIM + signature);
- return (index != null)? index.index : -1;
- }
-
- public int lookupInterfaceMethodref(MethodGen method) {
- return lookupInterfaceMethodref(method.getClassName(), method.getName(),
- method.getSignature());
- }
-
- /**
- * Add a new InterfaceMethodref constant to the ConstantPool, if it is not already
- * in there.
- *
- * @param n InterfaceMethodref string to add
- * @return index of entry
- */
- public int addInterfaceMethodref(String class_name, String method_name, String signature) {
- int ret, class_index, name_and_type_index;
-
- if((ret = lookupInterfaceMethodref(class_name, method_name, signature)) != -1)
- return ret; // Already in CP
-
- adjustSize();
-
- class_index = addClass(class_name);
- name_and_type_index = addNameAndType(method_name, signature);
- ret = index;
- constants[index++] = new ConstantInterfaceMethodref(class_index, name_and_type_index);
-
- cp_table.put(class_name + IMETHODREF_DELIM + method_name +
- IMETHODREF_DELIM + signature, new Index(ret));
-
- return ret;
- }
-
- public int addInterfaceMethodref(MethodGen method) {
- return addInterfaceMethodref(method.getClassName(), method.getName(),
- method.getSignature());
- }
-
- /**
- * Look for ConstantFieldref in ConstantPool.
- *
- * @param class_name Where to find method
- * @param field_name Guess what
- * @param signature return and argument types
- * @return index on success, -1 otherwise
- */
- public int lookupFieldref(String class_name, String field_name, String signature) {
- Index index = (Index)cp_table.get(class_name + FIELDREF_DELIM + field_name +
- FIELDREF_DELIM + signature);
- return (index != null)? index.index : -1;
- }
-
- /**
- * Add a new Fieldref constant to the ConstantPool, if it is not already
- * in there.
- *
- * @param n Fieldref string to add
- * @return index of entry
- */
- public int addFieldref(String class_name, String field_name, String signature) {
- int ret;
- int class_index, name_and_type_index;
-
- if((ret = lookupFieldref(class_name, field_name, signature)) != -1)
- return ret; // Already in CP
-
- adjustSize();
-
- class_index = addClass(class_name);
- name_and_type_index = addNameAndType(field_name, signature);
- ret = index;
- constants[index++] = new ConstantFieldref(class_index, name_and_type_index);
-
- cp_table.put(class_name + FIELDREF_DELIM + field_name + FIELDREF_DELIM + signature, new Index(ret));
-
- return ret;
- }
-
- /**
- * @param i index in constant pool
- * @return constant pool entry at index i
- */
- public Constant getConstant(int i) { return constants[i]; }
-
- /**
- * Use with care!
- *
- * @param i index in constant pool
- * @param c new constant pool entry at index i
- */
- public void setConstant(int i, Constant c) { constants[i] = c; }
-
- /**
- * @return intermediate constant pool
- */
- public ConstantPool getConstantPool() {
- return new ConstantPool(constants);
- }
-
- /**
- * @return current size of constant pool
- */
- public int getSize() {
- return index;
- }
-
- /**
- * @return constant pool with proper length
- */
- public ConstantPool getFinalConstantPool() {
- Constant[] cs = new Constant[index];
-
- System.arraycopy(constants, 0, cs, 0, index);
-
- return new ConstantPool(cs);
- }
-
- /**
- * @return String representation.
- */
- public String toString() {
- StringBuffer buf = new StringBuffer();
-
- for(int i=1; i < index; i++)
- buf.append(i + ")" + constants[i] + "\n");
-
- return buf.toString();
- }
-
- /** Import constant from another ConstantPool and return new index.
- */
- public int addConstant(Constant c, ConstantPoolGen cp) {
- Constant[] constants = cp.getConstantPool().getConstantPool();
-
- switch(c.getTag()) {
- case Constants.CONSTANT_String: {
- ConstantString s = (ConstantString)c;
- ConstantUtf8 u8 = (ConstantUtf8)constants[s.getStringIndex()];
-
- return addString(u8.getBytes());
- }
-
- case Constants.CONSTANT_Class: {
- ConstantClass s = (ConstantClass)c;
- ConstantUtf8 u8 = (ConstantUtf8)constants[s.getNameIndex()];
-
- return addClass(u8.getBytes());
- }
-
- case Constants.CONSTANT_NameAndType: {
- ConstantNameAndType n = (ConstantNameAndType)c;
- ConstantUtf8 u8 = (ConstantUtf8)constants[n.getNameIndex()];
- ConstantUtf8 u8_2 = (ConstantUtf8)constants[n.getSignatureIndex()];
-
- return addNameAndType(u8.getBytes(), u8_2.getBytes());
- }
-
- case Constants.CONSTANT_Utf8:
- return addUtf8(((ConstantUtf8)c).getBytes());
-
- case Constants.CONSTANT_Double:
- return addDouble(((ConstantDouble)c).getBytes());
-
- case Constants.CONSTANT_Float:
- return addFloat(((ConstantFloat)c).getBytes());
-
- case Constants.CONSTANT_Long:
- return addLong(((ConstantLong)c).getBytes());
-
- case Constants.CONSTANT_Integer:
- return addInteger(((ConstantInteger)c).getBytes());
-
- case Constants.CONSTANT_InterfaceMethodref: case Constants.CONSTANT_Methodref:
- case Constants.CONSTANT_Fieldref: {
- ConstantCP m = (ConstantCP)c;
- ConstantClass clazz = (ConstantClass)constants[m.getClassIndex()];
- ConstantNameAndType n = (ConstantNameAndType)constants[m.getNameAndTypeIndex()];
- ConstantUtf8 u8 = (ConstantUtf8)constants[clazz.getNameIndex()];
- String class_name = u8.getBytes().replace('/', '.');
-
- u8 = (ConstantUtf8)constants[n.getNameIndex()];
- String name = u8.getBytes();
-
- u8 = (ConstantUtf8)constants[n.getSignatureIndex()];
- String signature = u8.getBytes();
-
- switch(c.getTag()) {
- case Constants.CONSTANT_InterfaceMethodref:
- return addInterfaceMethodref(class_name, name, signature);
-
- case Constants.CONSTANT_Methodref:
- return addMethodref(class_name, name, signature);
-
- case Constants.CONSTANT_Fieldref:
- return addFieldref(class_name, name, signature);
-
- default: // Never reached
- throw new RuntimeException("Unknown constant type " + c);
- }
- }
-
- default: // Never reached
- throw new RuntimeException("Unknown constant type " + c);
- }
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/ConstantPushInstruction.java b/src/com/sun/org/apache/bcel/internal/generic/ConstantPushInstruction.java
deleted file mode 100644
index e7ad698..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/ConstantPushInstruction.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * Denotes a push instruction that produces a literal on the stack
- * such as SIPUSH, BIPUSH, ICONST, etc.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
-
- * @see ICONST
- * @see SIPUSH
- */
-public interface ConstantPushInstruction extends PushInstruction, TypedInstruction {
- public Number getValue();
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/ConversionInstruction.java b/src/com/sun/org/apache/bcel/internal/generic/ConversionInstruction.java
deleted file mode 100644
index 8227ab0..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/ConversionInstruction.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import com.sun.org.apache.bcel.internal.Constants;
-/**
- * Super class for the x2y family of instructions.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public abstract class ConversionInstruction extends Instruction
- implements TypedInstruction, StackProducer, StackConsumer {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- ConversionInstruction() {}
-
- /**
- * @param opcode opcode of instruction
- */
- protected ConversionInstruction(short opcode) {
- super(opcode, (short)1);
- }
-
- /** @return type associated with the instruction
- */
- public Type getType(ConstantPoolGen cp) {
- switch(opcode) {
- case Constants.D2I: case Constants.F2I: case Constants.L2I:
- return Type.INT;
- case Constants.D2F: case Constants.I2F: case Constants.L2F:
- return Type.FLOAT;
- case Constants.D2L: case Constants.F2L: case Constants.I2L:
- return Type.LONG;
- case Constants.F2D: case Constants.I2D: case Constants.L2D:
- return Type.DOUBLE;
- case Constants.I2B:
- return Type.BYTE;
- case Constants.I2C:
- return Type.CHAR;
- case Constants.I2S:
- return Type.SHORT;
-
- default: // Never reached
- throw new ClassGenException("Unknown type " + opcode);
- }
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/D2F.java b/src/com/sun/org/apache/bcel/internal/generic/D2F.java
deleted file mode 100644
index b19d59f..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/D2F.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * D2F - Convert double to float
- * <PRE>Stack: ..., value.word1, value.word2 -&gt; ..., result</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class D2F extends ConversionInstruction {
- /** Convert double to float
- */
- public D2F() {
- super(com.sun.org.apache.bcel.internal.Constants.D2F);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitConversionInstruction(this);
- v.visitD2F(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/D2I.java b/src/com/sun/org/apache/bcel/internal/generic/D2I.java
deleted file mode 100644
index 9aff1f1..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/D2I.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * D2I - Convert double to int
- * <PRE>Stack: ..., value.word1, value.word2 -&gt; ..., result</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class D2I extends ConversionInstruction {
- /** Convert double to int
- */
- public D2I() {
- super(com.sun.org.apache.bcel.internal.Constants.D2I);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitConversionInstruction(this);
- v.visitD2I(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/D2L.java b/src/com/sun/org/apache/bcel/internal/generic/D2L.java
deleted file mode 100644
index 9cb87a2..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/D2L.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * D2L - Convert double to long
- * <PRE>Stack: ..., value.word1, value.word2 -&gt; ..., result.word1, result.word2</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class D2L extends ConversionInstruction {
- /** Convert double to long
- */
- public D2L() {
- super(com.sun.org.apache.bcel.internal.Constants.D2L);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitConversionInstruction(this);
- v.visitD2L(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/DADD.java b/src/com/sun/org/apache/bcel/internal/generic/DADD.java
deleted file mode 100644
index 190790b..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/DADD.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * DADD - Add doubles
- * <PRE>Stack: ..., value1.word1, value1.word2, value2.word1, value2.word2 -&gt;</PRE>
- * ..., result.word1, result1.word2
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class DADD extends ArithmeticInstruction {
- /** Add doubles
- */
- public DADD() {
- super(com.sun.org.apache.bcel.internal.Constants.DADD);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitArithmeticInstruction(this);
- v.visitDADD(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/DALOAD.java b/src/com/sun/org/apache/bcel/internal/generic/DALOAD.java
deleted file mode 100644
index ab3b361..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/DALOAD.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * DALOAD - Load double from array
- * <PRE>Stack: ..., arrayref, index -&gt; ..., result.word1, result.word2</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class DALOAD extends ArrayInstruction implements StackProducer {
- /** Load double from array
- */
- public DALOAD() {
- super(com.sun.org.apache.bcel.internal.Constants.DALOAD);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackProducer(this);
- v.visitExceptionThrower(this);
- v.visitTypedInstruction(this);
- v.visitArrayInstruction(this);
- v.visitDALOAD(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/DASTORE.java b/src/com/sun/org/apache/bcel/internal/generic/DASTORE.java
deleted file mode 100644
index b615479..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/DASTORE.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * DASTORE - Store into double array
- * <PRE>Stack: ..., arrayref, index, value.word1, value.word2 -&gt; ...</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class DASTORE extends ArrayInstruction implements StackConsumer {
- /** Store double into array
- */
- public DASTORE() {
- super(com.sun.org.apache.bcel.internal.Constants.DASTORE);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackConsumer(this);
- v.visitExceptionThrower(this);
- v.visitTypedInstruction(this);
- v.visitArrayInstruction(this);
- v.visitDASTORE(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/DCMPG.java b/src/com/sun/org/apache/bcel/internal/generic/DCMPG.java
deleted file mode 100644
index 3ea2fd8..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/DCMPG.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * DCMPG - Compare doubles: value1 > value2
- * <PRE>Stack: ..., value1.word1, value1.word2, value2.word1, value2.word2 -&gt;</PRE>
- * ..., result
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class DCMPG extends Instruction
- implements TypedInstruction, StackProducer, StackConsumer {
-
- public DCMPG() {
- super(com.sun.org.apache.bcel.internal.Constants.DCMPG, (short)1);
- }
-
- /** @return Type.DOUBLE
- */
- public Type getType(ConstantPoolGen cp) {
- return Type.DOUBLE;
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitDCMPG(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/DCMPL.java b/src/com/sun/org/apache/bcel/internal/generic/DCMPL.java
deleted file mode 100644
index 1b9c5bd..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/DCMPL.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * DCMPL - Compare doubles: value1 < value2
- * <PRE>Stack: ..., value1.word1, value1.word2, value2.word1, value2.word2 -&gt;</PRE>
- * ..., result
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class DCMPL extends Instruction
- implements TypedInstruction, StackProducer, StackConsumer {
- public DCMPL() {
- super(com.sun.org.apache.bcel.internal.Constants.DCMPL, (short)1);
- }
-
- /** @return Type.DOUBLE
- */
- public Type getType(ConstantPoolGen cp) {
- return Type.DOUBLE;
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitDCMPL(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/DCONST.java b/src/com/sun/org/apache/bcel/internal/generic/DCONST.java
deleted file mode 100644
index 8d43e09..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/DCONST.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * DCONST - Push 0.0 or 1.0, other values cause an exception
- *
- * <PRE>Stack: ... -&gt; ..., </PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class DCONST extends Instruction
- implements ConstantPushInstruction, TypedInstruction {
- private double value;
-
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- DCONST() {}
-
- public DCONST(double f) {
- super(com.sun.org.apache.bcel.internal.Constants.DCONST_0, (short)1);
-
- if(f == 0.0)
- opcode = com.sun.org.apache.bcel.internal.Constants.DCONST_0;
- else if(f == 1.0)
- opcode = com.sun.org.apache.bcel.internal.Constants.DCONST_1;
- else
- throw new ClassGenException("DCONST can be used only for 0.0 and 1.0: " + f);
-
- value = f;
- }
-
- public Number getValue() { return new Double(value); }
-
- /** @return Type.DOUBLE
- */
- public Type getType(ConstantPoolGen cp) {
- return Type.DOUBLE;
- }
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitPushInstruction(this);
- v.visitStackProducer(this);
- v.visitTypedInstruction(this);
- v.visitConstantPushInstruction(this);
- v.visitDCONST(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/DDIV.java b/src/com/sun/org/apache/bcel/internal/generic/DDIV.java
deleted file mode 100644
index 103bcc3..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/DDIV.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * DDIV - Divide doubles
- * <PRE>Stack: ..., value1.word1, value1.word2, value2.word1, value2.word2 -&gt;</PRE>
- * ..., result.word1, result.word2
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class DDIV extends ArithmeticInstruction {
- /** Divide doubles
- */
- public DDIV() {
- super(com.sun.org.apache.bcel.internal.Constants.DDIV);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitArithmeticInstruction(this);
- v.visitDDIV(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/DLOAD.java b/src/com/sun/org/apache/bcel/internal/generic/DLOAD.java
deleted file mode 100644
index 0da6a5b..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/DLOAD.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * DLOAD - Load double from local variable
- * <PRE>Stack ... -&gt; ..., result.word1, result.word2</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class DLOAD extends LoadInstruction {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- DLOAD() {
- super(com.sun.org.apache.bcel.internal.Constants.DLOAD, com.sun.org.apache.bcel.internal.Constants.DLOAD_0);
- }
-
- /** Load double from local variable
- * @param n index of local variable
- */
- public DLOAD(int n) {
- super(com.sun.org.apache.bcel.internal.Constants.DLOAD, com.sun.org.apache.bcel.internal.Constants.DLOAD_0, n);
- }
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- super.accept(v);
- v.visitDLOAD(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/DMUL.java b/src/com/sun/org/apache/bcel/internal/generic/DMUL.java
deleted file mode 100644
index ff31fad..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/DMUL.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * DMUL - Multiply doubles
- * <PRE>Stack: ..., value1.word1, value1.word2, value2.word1, value2.word2 -&gt;</PRE>
- * ..., result.word1, result.word2
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class DMUL extends ArithmeticInstruction {
- /** Multiply doubles
- */
- public DMUL() {
- super(com.sun.org.apache.bcel.internal.Constants.DMUL);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitArithmeticInstruction(this);
- v.visitDMUL(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/DNEG.java b/src/com/sun/org/apache/bcel/internal/generic/DNEG.java
deleted file mode 100644
index 7bf5917..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/DNEG.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * DNEG - Negate double
- * <PRE>Stack: ..., value.word1, value.word2 -&gt; ..., result.word1, result.word2</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class DNEG extends ArithmeticInstruction {
- public DNEG() {
- super(com.sun.org.apache.bcel.internal.Constants.DNEG);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitArithmeticInstruction(this);
- v.visitDNEG(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/DREM.java b/src/com/sun/org/apache/bcel/internal/generic/DREM.java
deleted file mode 100644
index 5ccd563..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/DREM.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * DREM - Remainder of doubles
- * <PRE>Stack: ..., value1.word1, value1.word2, value2.word1, value2.word2 -&gt;</PRE>
- * ..., result.word1, result.word2
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class DREM extends ArithmeticInstruction {
- /** Remainder of doubles
- */
- public DREM() {
- super(com.sun.org.apache.bcel.internal.Constants.DREM);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitArithmeticInstruction(this);
- v.visitDREM(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/DRETURN.java b/src/com/sun/org/apache/bcel/internal/generic/DRETURN.java
deleted file mode 100644
index 68329eb..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/DRETURN.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * DRETURN - Return double from method
- * <PRE>Stack: ..., value.word1, value.word2 -&gt; &lt;empty&gt;</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class DRETURN extends ReturnInstruction {
- /** Return double from method
- */
- public DRETURN() {
- super(com.sun.org.apache.bcel.internal.Constants.DRETURN);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitExceptionThrower(this);
- v.visitTypedInstruction(this);
- v.visitStackConsumer(this);
- v.visitReturnInstruction(this);
- v.visitDRETURN(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/DSTORE.java b/src/com/sun/org/apache/bcel/internal/generic/DSTORE.java
deleted file mode 100644
index f9c41f8..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/DSTORE.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * DSTORE - Store double into local variable
- * <pre>Stack: ..., value.word1, value.word2 -&gt; ... </PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class DSTORE extends StoreInstruction {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- DSTORE() {
- super(com.sun.org.apache.bcel.internal.Constants.DSTORE, com.sun.org.apache.bcel.internal.Constants.DSTORE_0);
- }
-
- /** Store double into local variable
- * @param n index of local variable
- */
- public DSTORE(int n) {
- super(com.sun.org.apache.bcel.internal.Constants.DSTORE, com.sun.org.apache.bcel.internal.Constants.DSTORE_0, n);
- }
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- super.accept(v);
- v.visitDSTORE(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/DSUB.java b/src/com/sun/org/apache/bcel/internal/generic/DSUB.java
deleted file mode 100644
index e904257..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/DSUB.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * DSUB - Substract doubles
- * <PRE>Stack: ..., value1.word1, value1.word2, value2.word1, value2.word2 -&gt;</PRE>
- * ..., result.word1, result.word2
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class DSUB extends ArithmeticInstruction {
- /** Substract doubles
- */
- public DSUB() {
- super(com.sun.org.apache.bcel.internal.Constants.DSUB);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitArithmeticInstruction(this);
- v.visitDSUB(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/DUP.java b/src/com/sun/org/apache/bcel/internal/generic/DUP.java
deleted file mode 100644
index 161dfe4..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/DUP.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * DUP - Duplicate top operand stack word
- * <PRE>Stack: ..., word -&gt; ..., word, word</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class DUP extends StackInstruction implements PushInstruction {
- public DUP() {
- super(com.sun.org.apache.bcel.internal.Constants.DUP);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackProducer(this);
- v.visitPushInstruction(this);
- v.visitStackInstruction(this);
- v.visitDUP(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/DUP2.java b/src/com/sun/org/apache/bcel/internal/generic/DUP2.java
deleted file mode 100644
index cbd1972..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/DUP2.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * DUP2 - Duplicate two top operand stack words
- * <PRE>Stack: ..., word2, word1 -&gt; ..., word2, word1, word2, word1</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class DUP2 extends StackInstruction implements PushInstruction {
- public DUP2() {
- super(com.sun.org.apache.bcel.internal.Constants.DUP2);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackProducer(this);
- v.visitPushInstruction(this);
- v.visitStackInstruction(this);
- v.visitDUP2(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/DUP2_X1.java b/src/com/sun/org/apache/bcel/internal/generic/DUP2_X1.java
deleted file mode 100644
index 6362c07..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/DUP2_X1.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * DUP2_X1 - Duplicate two top operand stack words and put three down
- * <PRE>Stack: ..., word3, word2, word1 -&gt; ..., word2, word1, word3, word2, word1</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class DUP2_X1 extends StackInstruction {
- public DUP2_X1() {
- super(com.sun.org.apache.bcel.internal.Constants.DUP2_X1);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackInstruction(this);
- v.visitDUP2_X1(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/DUP2_X2.java b/src/com/sun/org/apache/bcel/internal/generic/DUP2_X2.java
deleted file mode 100644
index d806b12..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/DUP2_X2.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * DUP2_X2 - Duplicate two top operand stack words and put four down
- * <PRE>Stack: ..., word4, word3, word2, word1 -&gt; ..., word2, word1, word4, word3, word2, word1</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class DUP2_X2 extends StackInstruction {
- public DUP2_X2() {
- super(com.sun.org.apache.bcel.internal.Constants.DUP2_X2);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackInstruction(this);
- v.visitDUP2_X2(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/DUP_X1.java b/src/com/sun/org/apache/bcel/internal/generic/DUP_X1.java
deleted file mode 100644
index 7f5b9b7..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/DUP_X1.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * DUP_X1 - Duplicate top operand stack word and put two down
- * <PRE>Stack: ..., word2, word1 -&gt; ..., word1, word2, word1</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class DUP_X1 extends StackInstruction {
- public DUP_X1() {
- super(com.sun.org.apache.bcel.internal.Constants.DUP_X1);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackInstruction(this);
- v.visitDUP_X1(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/DUP_X2.java b/src/com/sun/org/apache/bcel/internal/generic/DUP_X2.java
deleted file mode 100644
index 94c3608..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/DUP_X2.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * DUP_X2 - Duplicate top operand stack word and put three down
- * <PRE>Stack: ..., word3, word2, word1 -&gt; ..., word1, word3, word2, word1</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class DUP_X2 extends StackInstruction {
- public DUP_X2() {
- super(com.sun.org.apache.bcel.internal.Constants.DUP_X2);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackInstruction(this);
- v.visitDUP_X2(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/EmptyVisitor.java b/src/com/sun/org/apache/bcel/internal/generic/EmptyVisitor.java
deleted file mode 100644
index fdc77b1..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/EmptyVisitor.java
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * Supplies empty method bodies to be overridden by subclasses.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public abstract class EmptyVisitor implements Visitor {
- public void visitStackInstruction(StackInstruction obj) { }
- public void visitLocalVariableInstruction(LocalVariableInstruction obj) { }
- public void visitBranchInstruction(BranchInstruction obj) { }
- public void visitLoadClass(LoadClass obj) { }
- public void visitFieldInstruction(FieldInstruction obj) { }
- public void visitIfInstruction(IfInstruction obj) { }
- public void visitConversionInstruction(ConversionInstruction obj) { }
- public void visitPopInstruction(PopInstruction obj) { }
- public void visitJsrInstruction(JsrInstruction obj) { }
- public void visitGotoInstruction(GotoInstruction obj) { }
- public void visitStoreInstruction(StoreInstruction obj) { }
- public void visitTypedInstruction(TypedInstruction obj) { }
- public void visitSelect(Select obj) { }
- public void visitUnconditionalBranch(UnconditionalBranch obj) { }
- public void visitPushInstruction(PushInstruction obj) { }
- public void visitArithmeticInstruction(ArithmeticInstruction obj) { }
- public void visitCPInstruction(CPInstruction obj) { }
- public void visitInvokeInstruction(InvokeInstruction obj) { }
- public void visitArrayInstruction(ArrayInstruction obj) { }
- public void visitAllocationInstruction(AllocationInstruction obj) { }
- public void visitReturnInstruction(ReturnInstruction obj) { }
- public void visitFieldOrMethod(FieldOrMethod obj) { }
- public void visitConstantPushInstruction(ConstantPushInstruction obj) { }
- public void visitExceptionThrower(ExceptionThrower obj) { }
- public void visitLoadInstruction(LoadInstruction obj) { }
- public void visitVariableLengthInstruction(VariableLengthInstruction obj) { }
- public void visitStackProducer(StackProducer obj) { }
- public void visitStackConsumer(StackConsumer obj) { }
- public void visitACONST_NULL(ACONST_NULL obj) { }
- public void visitGETSTATIC(GETSTATIC obj) { }
- public void visitIF_ICMPLT(IF_ICMPLT obj) { }
- public void visitMONITOREXIT(MONITOREXIT obj) { }
- public void visitIFLT(IFLT obj) { }
- public void visitLSTORE(LSTORE obj) { }
- public void visitPOP2(POP2 obj) { }
- public void visitBASTORE(BASTORE obj) { }
- public void visitISTORE(ISTORE obj) { }
- public void visitCHECKCAST(CHECKCAST obj) { }
- public void visitFCMPG(FCMPG obj) { }
- public void visitI2F(I2F obj) { }
- public void visitATHROW(ATHROW obj) { }
- public void visitDCMPL(DCMPL obj) { }
- public void visitARRAYLENGTH(ARRAYLENGTH obj) { }
- public void visitDUP(DUP obj) { }
- public void visitINVOKESTATIC(INVOKESTATIC obj) { }
- public void visitLCONST(LCONST obj) { }
- public void visitDREM(DREM obj) { }
- public void visitIFGE(IFGE obj) { }
- public void visitCALOAD(CALOAD obj) { }
- public void visitLASTORE(LASTORE obj) { }
- public void visitI2D(I2D obj) { }
- public void visitDADD(DADD obj) { }
- public void visitINVOKESPECIAL(INVOKESPECIAL obj) { }
- public void visitIAND(IAND obj) { }
- public void visitPUTFIELD(PUTFIELD obj) { }
- public void visitILOAD(ILOAD obj) { }
- public void visitDLOAD(DLOAD obj) { }
- public void visitDCONST(DCONST obj) { }
- public void visitNEW(NEW obj) { }
- public void visitIFNULL(IFNULL obj) { }
- public void visitLSUB(LSUB obj) { }
- public void visitL2I(L2I obj) { }
- public void visitISHR(ISHR obj) { }
- public void visitTABLESWITCH(TABLESWITCH obj) { }
- public void visitIINC(IINC obj) { }
- public void visitDRETURN(DRETURN obj) { }
- public void visitFSTORE(FSTORE obj) { }
- public void visitDASTORE(DASTORE obj) { }
- public void visitIALOAD(IALOAD obj) { }
- public void visitDDIV(DDIV obj) { }
- public void visitIF_ICMPGE(IF_ICMPGE obj) { }
- public void visitLAND(LAND obj) { }
- public void visitIDIV(IDIV obj) { }
- public void visitLOR(LOR obj) { }
- public void visitCASTORE(CASTORE obj) { }
- public void visitFREM(FREM obj) { }
- public void visitLDC(LDC obj) { }
- public void visitBIPUSH(BIPUSH obj) { }
- public void visitDSTORE(DSTORE obj) { }
- public void visitF2L(F2L obj) { }
- public void visitFMUL(FMUL obj) { }
- public void visitLLOAD(LLOAD obj) { }
- public void visitJSR(JSR obj) { }
- public void visitFSUB(FSUB obj) { }
- public void visitSASTORE(SASTORE obj) { }
- public void visitALOAD(ALOAD obj) { }
- public void visitDUP2_X2(DUP2_X2 obj) { }
- public void visitRETURN(RETURN obj) { }
- public void visitDALOAD(DALOAD obj) { }
- public void visitSIPUSH(SIPUSH obj) { }
- public void visitDSUB(DSUB obj) { }
- public void visitL2F(L2F obj) { }
- public void visitIF_ICMPGT(IF_ICMPGT obj) { }
- public void visitF2D(F2D obj) { }
- public void visitI2L(I2L obj) { }
- public void visitIF_ACMPNE(IF_ACMPNE obj) { }
- public void visitPOP(POP obj) { }
- public void visitI2S(I2S obj) { }
- public void visitIFEQ(IFEQ obj) { }
- public void visitSWAP(SWAP obj) { }
- public void visitIOR(IOR obj) { }
- public void visitIREM(IREM obj) { }
- public void visitIASTORE(IASTORE obj) { }
- public void visitNEWARRAY(NEWARRAY obj) { }
- public void visitINVOKEINTERFACE(INVOKEINTERFACE obj) { }
- public void visitINEG(INEG obj) { }
- public void visitLCMP(LCMP obj) { }
- public void visitJSR_W(JSR_W obj) { }
- public void visitMULTIANEWARRAY(MULTIANEWARRAY obj) { }
- public void visitDUP_X2(DUP_X2 obj) { }
- public void visitSALOAD(SALOAD obj) { }
- public void visitIFNONNULL(IFNONNULL obj) { }
- public void visitDMUL(DMUL obj) { }
- public void visitIFNE(IFNE obj) { }
- public void visitIF_ICMPLE(IF_ICMPLE obj) { }
- public void visitLDC2_W(LDC2_W obj) { }
- public void visitGETFIELD(GETFIELD obj) { }
- public void visitLADD(LADD obj) { }
- public void visitNOP(NOP obj) { }
- public void visitFALOAD(FALOAD obj) { }
- public void visitINSTANCEOF(INSTANCEOF obj) { }
- public void visitIFLE(IFLE obj) { }
- public void visitLXOR(LXOR obj) { }
- public void visitLRETURN(LRETURN obj) { }
- public void visitFCONST(FCONST obj) { }
- public void visitIUSHR(IUSHR obj) { }
- public void visitBALOAD(BALOAD obj) { }
- public void visitDUP2(DUP2 obj) { }
- public void visitIF_ACMPEQ(IF_ACMPEQ obj) { }
- public void visitIMPDEP1(IMPDEP1 obj) { }
- public void visitMONITORENTER(MONITORENTER obj) { }
- public void visitLSHL(LSHL obj) { }
- public void visitDCMPG(DCMPG obj) { }
- public void visitD2L(D2L obj) { }
- public void visitIMPDEP2(IMPDEP2 obj) { }
- public void visitL2D(L2D obj) { }
- public void visitRET(RET obj) { }
- public void visitIFGT(IFGT obj) { }
- public void visitIXOR(IXOR obj) { }
- public void visitINVOKEVIRTUAL(INVOKEVIRTUAL obj) { }
- public void visitFASTORE(FASTORE obj) { }
- public void visitIRETURN(IRETURN obj) { }
- public void visitIF_ICMPNE(IF_ICMPNE obj) { }
- public void visitFLOAD(FLOAD obj) { }
- public void visitLDIV(LDIV obj) { }
- public void visitPUTSTATIC(PUTSTATIC obj) { }
- public void visitAALOAD(AALOAD obj) { }
- public void visitD2I(D2I obj) { }
- public void visitIF_ICMPEQ(IF_ICMPEQ obj) { }
- public void visitAASTORE(AASTORE obj) { }
- public void visitARETURN(ARETURN obj) { }
- public void visitDUP2_X1(DUP2_X1 obj) { }
- public void visitFNEG(FNEG obj) { }
- public void visitGOTO_W(GOTO_W obj) { }
- public void visitD2F(D2F obj) { }
- public void visitGOTO(GOTO obj) { }
- public void visitISUB(ISUB obj) { }
- public void visitF2I(F2I obj) { }
- public void visitDNEG(DNEG obj) { }
- public void visitICONST(ICONST obj) { }
- public void visitFDIV(FDIV obj) { }
- public void visitI2B(I2B obj) { }
- public void visitLNEG(LNEG obj) { }
- public void visitLREM(LREM obj) { }
- public void visitIMUL(IMUL obj) { }
- public void visitIADD(IADD obj) { }
- public void visitLSHR(LSHR obj) { }
- public void visitLOOKUPSWITCH(LOOKUPSWITCH obj) { }
- public void visitDUP_X1(DUP_X1 obj) { }
- public void visitFCMPL(FCMPL obj) { }
- public void visitI2C(I2C obj) { }
- public void visitLMUL(LMUL obj) { }
- public void visitLUSHR(LUSHR obj) { }
- public void visitISHL(ISHL obj) { }
- public void visitLALOAD(LALOAD obj) { }
- public void visitASTORE(ASTORE obj) { }
- public void visitANEWARRAY(ANEWARRAY obj) { }
- public void visitFRETURN(FRETURN obj) { }
- public void visitFADD(FADD obj) { }
- public void visitBREAKPOINT(BREAKPOINT obj) { }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/ExceptionThrower.java b/src/com/sun/org/apache/bcel/internal/generic/ExceptionThrower.java
deleted file mode 100644
index 23b8490..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/ExceptionThrower.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * Denote an instruction that may throw a run-time or a linking
- * exception (or both) during execution. This is not quite the truth
- * as such; because all instructions may throw an
- * java.lang.VirtualMachineError. These exceptions are omitted.
- *
- * The Lava Language Specification specifies exactly which
- * <i>RUN-TIME</i> and which <i>LINKING</i> exceptions each
- * instruction may throw which is reflected by the implementers. Due
- * to the structure of the JVM specification, it may be possible that
- * an Instruction implementing this interface returns a Class[] of
- * size 0.
- *
- * Please note that we speak of an "exception" here when we mean any
- * "Throwable" object; so this term is equally used for "Exception"
- * and "Error" objects.
- *
- * @author <A HREF="http://www.inf.fu-berlin.de/~ehaase">Enver Haase</A>
- */
-public interface ExceptionThrower {
- public java.lang.Class[] getExceptions();
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/F2D.java b/src/com/sun/org/apache/bcel/internal/generic/F2D.java
deleted file mode 100644
index 49b1ae6..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/F2D.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * F2D - Convert float to double
- * <PRE>Stack: ..., value -&gt; ..., result.word1, result.word2</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class F2D extends ConversionInstruction {
- /** Convert float to double
- */
- public F2D() {
- super(com.sun.org.apache.bcel.internal.Constants.F2D);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitConversionInstruction(this);
- v.visitF2D(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/F2I.java b/src/com/sun/org/apache/bcel/internal/generic/F2I.java
deleted file mode 100644
index 471a9f4..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/F2I.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * F2I - Convert float to int
- * <PRE>Stack: ..., value -&gt; ..., result</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class F2I extends ConversionInstruction {
- /** Convert float to int
- */
- public F2I() {
- super(com.sun.org.apache.bcel.internal.Constants.F2I);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitConversionInstruction(this);
- v.visitF2I(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/F2L.java b/src/com/sun/org/apache/bcel/internal/generic/F2L.java
deleted file mode 100644
index 6742507..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/F2L.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * F2L - Convert float to long
- * <PRE>Stack: ..., value -&gt; ..., result.word1, result.word2</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class F2L extends ConversionInstruction {
- /** Convert float to long
- */
- public F2L() {
- super(com.sun.org.apache.bcel.internal.Constants.F2L);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitConversionInstruction(this);
- v.visitF2L(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/FADD.java b/src/com/sun/org/apache/bcel/internal/generic/FADD.java
deleted file mode 100644
index 3daab62..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/FADD.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * FADD - Add floats
- * <PRE>Stack: ..., value1, value2 -&gt; result</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class FADD extends ArithmeticInstruction {
- /** Add floats
- */
- public FADD() {
- super(com.sun.org.apache.bcel.internal.Constants.FADD);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitArithmeticInstruction(this);
- v.visitFADD(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/FALOAD.java b/src/com/sun/org/apache/bcel/internal/generic/FALOAD.java
deleted file mode 100644
index f820015..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/FALOAD.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * FALOAD - Load float from array
- * <PRE>Stack: ..., arrayref, index -&gt; ..., value</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class FALOAD extends ArrayInstruction implements StackProducer {
- /** Load float from array
- */
- public FALOAD() {
- super(com.sun.org.apache.bcel.internal.Constants.FALOAD);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackProducer(this);
- v.visitExceptionThrower(this);
- v.visitTypedInstruction(this);
- v.visitArrayInstruction(this);
- v.visitFALOAD(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/FASTORE.java b/src/com/sun/org/apache/bcel/internal/generic/FASTORE.java
deleted file mode 100644
index 48336d1..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/FASTORE.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * FASTORE - Store into float array
- * <PRE>Stack: ..., arrayref, index, value -&gt; ...</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class FASTORE extends ArrayInstruction implements StackConsumer {
- /** Store float into array
- */
- public FASTORE() {
- super(com.sun.org.apache.bcel.internal.Constants.FASTORE);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackConsumer(this);
- v.visitExceptionThrower(this);
- v.visitTypedInstruction(this);
- v.visitArrayInstruction(this);
- v.visitFASTORE(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/FCMPG.java b/src/com/sun/org/apache/bcel/internal/generic/FCMPG.java
deleted file mode 100644
index c1926e1..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/FCMPG.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * FCMPG - Compare floats: value1 > value2
- * <PRE>Stack: ..., value1, value2 -&gt; ..., result</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class FCMPG extends Instruction
- implements TypedInstruction, StackProducer, StackConsumer {
- public FCMPG() {
- super(com.sun.org.apache.bcel.internal.Constants.FCMPG, (short)1);
- }
-
- /** @return Type.FLOAT
- */
- public Type getType(ConstantPoolGen cp) {
- return Type.FLOAT;
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitFCMPG(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/FCMPL.java b/src/com/sun/org/apache/bcel/internal/generic/FCMPL.java
deleted file mode 100644
index 4ed62bf..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/FCMPL.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * FCMPL - Compare floats: value1 < value2
- * <PRE>Stack: ..., value1, value2 -&gt; ..., result</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class FCMPL extends Instruction
- implements TypedInstruction, StackProducer, StackConsumer {
- public FCMPL() {
- super(com.sun.org.apache.bcel.internal.Constants.FCMPL, (short)1);
- }
-
- /** @return Type.FLOAT
- */
- public Type getType(ConstantPoolGen cp) {
- return Type.FLOAT;
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitFCMPL(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/FCONST.java b/src/com/sun/org/apache/bcel/internal/generic/FCONST.java
deleted file mode 100644
index 12e8bcd..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/FCONST.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * FCONST - Push 0.0, 1.0 or 2.0, other values cause an exception
- *
- * <PRE>Stack: ... -&gt; ..., </PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class FCONST extends Instruction
- implements ConstantPushInstruction, TypedInstruction {
- private float value;
-
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- FCONST() {}
-
- public FCONST(float f) {
- super(com.sun.org.apache.bcel.internal.Constants.FCONST_0, (short)1);
-
- if(f == 0.0)
- opcode = com.sun.org.apache.bcel.internal.Constants.FCONST_0;
- else if(f == 1.0)
- opcode = com.sun.org.apache.bcel.internal.Constants.FCONST_1;
- else if(f == 2.0)
- opcode = com.sun.org.apache.bcel.internal.Constants.FCONST_2;
- else
- throw new ClassGenException("FCONST can be used only for 0.0, 1.0 and 2.0: " + f);
-
- value = f;
- }
-
- public Number getValue() { return new Float(value); }
-
- /** @return Type.FLOAT
- */
- public Type getType(ConstantPoolGen cp) {
- return Type.FLOAT;
- }
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitPushInstruction(this);
- v.visitStackProducer(this);
- v.visitTypedInstruction(this);
- v.visitConstantPushInstruction(this);
- v.visitFCONST(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/FDIV.java b/src/com/sun/org/apache/bcel/internal/generic/FDIV.java
deleted file mode 100644
index 639ea5b..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/FDIV.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * FDIV - Divide floats
- * <PRE>Stack: ..., value1, value2 -&gt; result</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class FDIV extends ArithmeticInstruction {
- /** Divide floats
- */
- public FDIV() {
- super(com.sun.org.apache.bcel.internal.Constants.FDIV);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitArithmeticInstruction(this);
- v.visitFDIV(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/FLOAD.java b/src/com/sun/org/apache/bcel/internal/generic/FLOAD.java
deleted file mode 100644
index 6ffb86d..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/FLOAD.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * FLOAD - Load float from local variable
- * <PRE>Stack ... -&gt; ..., result</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class FLOAD extends LoadInstruction {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- FLOAD() {
- super(com.sun.org.apache.bcel.internal.Constants.FLOAD, com.sun.org.apache.bcel.internal.Constants.FLOAD_0);
- }
-
- /** Load float from local variable
- * @param n index of local variable
- */
- public FLOAD(int n) {
- super(com.sun.org.apache.bcel.internal.Constants.FLOAD, com.sun.org.apache.bcel.internal.Constants.FLOAD_0, n);
- }
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- super.accept(v);
- v.visitFLOAD(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/FMUL.java b/src/com/sun/org/apache/bcel/internal/generic/FMUL.java
deleted file mode 100644
index f8fc49e..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/FMUL.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * FMUL - Multiply floats
- * <PRE>Stack: ..., value1, value2 -&gt; result</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class FMUL extends ArithmeticInstruction {
- /** Multiply floats
- */
- public FMUL() {
- super(com.sun.org.apache.bcel.internal.Constants.FMUL);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitArithmeticInstruction(this);
- v.visitFMUL(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/FNEG.java b/src/com/sun/org/apache/bcel/internal/generic/FNEG.java
deleted file mode 100644
index 6428fb6..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/FNEG.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * FNEG - Negate float
- * <PRE>Stack: ..., value -&gt; ..., result</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class FNEG extends ArithmeticInstruction {
- public FNEG() {
- super(com.sun.org.apache.bcel.internal.Constants.FNEG);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitArithmeticInstruction(this);
- v.visitFNEG(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/FREM.java b/src/com/sun/org/apache/bcel/internal/generic/FREM.java
deleted file mode 100644
index 6ec99a0..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/FREM.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * FREM - Remainder of floats
- * <PRE>Stack: ..., value1, value2 -&gt; result</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class FREM extends ArithmeticInstruction {
- /** Remainder of floats
- */
- public FREM() {
- super(com.sun.org.apache.bcel.internal.Constants.FREM);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitArithmeticInstruction(this);
- v.visitFREM(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/FRETURN.java b/src/com/sun/org/apache/bcel/internal/generic/FRETURN.java
deleted file mode 100644
index 32e9a80..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/FRETURN.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * FRETURN - Return float from method
- * <PRE>Stack: ..., value -&gt; &lt;empty&gt;</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class FRETURN extends ReturnInstruction {
- /** Return float from method
- */
- public FRETURN() {
- super(com.sun.org.apache.bcel.internal.Constants.FRETURN);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitExceptionThrower(this);
- v.visitTypedInstruction(this);
- v.visitStackConsumer(this);
- v.visitReturnInstruction(this);
- v.visitFRETURN(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/FSTORE.java b/src/com/sun/org/apache/bcel/internal/generic/FSTORE.java
deleted file mode 100644
index bf80791..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/FSTORE.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * FSTORE - Store float into local variable
- * <PRE>Stack: ..., value -&gt; ... </PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class FSTORE extends StoreInstruction {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- FSTORE() {
- super(com.sun.org.apache.bcel.internal.Constants.FSTORE, com.sun.org.apache.bcel.internal.Constants.FSTORE_0);
- }
-
- /** Store float into local variable
- * @param n index of local variable
- */
- public FSTORE(int n) {
- super(com.sun.org.apache.bcel.internal.Constants.FSTORE, com.sun.org.apache.bcel.internal.Constants.FSTORE_0, n);
- }
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- super.accept(v);
- v.visitFSTORE(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/FSUB.java b/src/com/sun/org/apache/bcel/internal/generic/FSUB.java
deleted file mode 100644
index da59fcf..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/FSUB.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * FSUB - Substract floats
- * <PRE>Stack: ..., value1, value2 -&gt; result</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class FSUB extends ArithmeticInstruction {
- /** Substract floats
- */
- public FSUB() {
- super(com.sun.org.apache.bcel.internal.Constants.FSUB);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitArithmeticInstruction(this);
- v.visitFSUB(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/FieldGen.java b/src/com/sun/org/apache/bcel/internal/generic/FieldGen.java
deleted file mode 100644
index 290a3c0..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/FieldGen.java
+++ /dev/null
@@ -1,313 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import com.sun.org.apache.bcel.internal.classfile.*;
-import java.util.ArrayList;
-import java.util.Iterator;
-
-/**
- * Template class for building up a field. The only extraordinary thing
- * one can do is to add a constant value attribute to a field (which must of
- * course be compatible with to the declared type).
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see Field
- */
-public class FieldGen extends FieldGenOrMethodGen {
- private Object value = null;
-
- /**
- * Declare a field. If it is static (isStatic() == true) and has a
- * basic type like int or String it may have an initial value
- * associated with it as defined by setInitValue().
- *
- * @param access_flags access qualifiers
- * @param type field type
- * @param name field name
- * @param cp constant pool
- */
- public FieldGen(int access_flags, Type type, String name, ConstantPoolGen cp) {
- setAccessFlags(access_flags);
- setType(type);
- setName(name);
- setConstantPool(cp);
- }
-
- /**
- * Instantiate from existing field.
- *
- * @param field Field object
- * @param cp constant pool (must contain the same entries as the field's constant pool)
- */
- public FieldGen(Field field, ConstantPoolGen cp) {
- this(field.getAccessFlags(), Type.getType(field.getSignature()), field.getName(), cp);
-
- Attribute[] attrs = field.getAttributes();
-
- for(int i=0; i < attrs.length; i++) {
- if(attrs[i] instanceof ConstantValue)
- setValue(((ConstantValue)attrs[i]).getConstantValueIndex());
- else
- addAttribute(attrs[i]);
- }
- }
-
- private void setValue(int index) {
- ConstantPool cp = this.cp.getConstantPool();
- Constant c = cp.getConstant(index);
- value = ((ConstantObject)c).getConstantValue(cp);
- }
-
- /**
- * Set (optional) initial value of field, otherwise it will be set to null/0/false
- * by the JVM automatically.
- */
- public void setInitValue(String str) {
- checkType(new ObjectType("java.lang.String"));
-
- if(str != null)
- value = str;
- }
-
- public void setInitValue(long l) {
- checkType(Type.LONG);
-
- if(l != 0L)
- value = new Long(l);
- }
-
- public void setInitValue(int i) {
- checkType(Type.INT);
-
- if(i != 0)
- value = new Integer(i);
- }
-
- public void setInitValue(short s) {
- checkType(Type.SHORT);
-
- if(s != 0)
- value = new Integer(s);
- }
-
- public void setInitValue(char c) {
- checkType(Type.CHAR);
-
- if(c != 0)
- value = new Integer(c);
- }
-
- public void setInitValue(byte b) {
- checkType(Type.BYTE);
-
- if(b != 0)
- value = new Integer(b);
- }
-
- public void setInitValue(boolean b) {
- checkType(Type.BOOLEAN);
-
- if(b)
- value = new Integer(1);
- }
-
- public void setInitValue(float f) {
- checkType(Type.FLOAT);
-
- if(f != 0.0)
- value = new Float(f);
- }
-
- public void setInitValue(double d) {
- checkType(Type.DOUBLE);
-
- if(d != 0.0)
- value = new Double(d);
- }
-
- /** Remove any initial value.
- */
- public void cancelInitValue() {
- value = null;
- }
-
- private void checkType(Type atype) {
- if(type == null)
- throw new ClassGenException("You haven't defined the type of the field yet");
-
- if(!isFinal())
- throw new ClassGenException("Only final fields may have an initial value!");
-
- if(!type.equals(atype))
- throw new ClassGenException("Types are not compatible: " + type + " vs. " + atype);
- }
-
- /**
- * Get field object after having set up all necessary values.
- */
- public Field getField() {
- String signature = getSignature();
- int name_index = cp.addUtf8(name);
- int signature_index = cp.addUtf8(signature);
-
- if(value != null) {
- checkType(type);
- int index = addConstant();
- addAttribute(new ConstantValue(cp.addUtf8("ConstantValue"),
- 2, index, cp.getConstantPool()));
- }
-
- return new Field(access_flags, name_index, signature_index, getAttributes(),
- cp.getConstantPool());
- }
-
- private int addConstant() {
- switch(type.getType()) {
- case Constants.T_INT: case Constants.T_CHAR: case Constants.T_BYTE:
- case Constants.T_BOOLEAN: case Constants.T_SHORT:
- return cp.addInteger(((Integer)value).intValue());
-
- case Constants.T_FLOAT:
- return cp.addFloat(((Float)value).floatValue());
-
- case Constants.T_DOUBLE:
- return cp.addDouble(((Double)value).doubleValue());
-
- case Constants.T_LONG:
- return cp.addLong(((Long)value).longValue());
-
- case Constants.T_REFERENCE:
- return cp.addString(((String)value));
-
- default:
- throw new RuntimeException("Oops: Unhandled : " + type.getType());
- }
- }
-
- public String getSignature() { return type.getSignature(); }
-
- private ArrayList observers;
-
- /** Add observer for this object.
- */
- public void addObserver(FieldObserver o) {
- if(observers == null)
- observers = new ArrayList();
-
- observers.add(o);
- }
-
- /** Remove observer for this object.
- */
- public void removeObserver(FieldObserver o) {
- if(observers != null)
- observers.remove(o);
- }
-
- /** Call notify() method on all observers. This method is not called
- * automatically whenever the state has changed, but has to be
- * called by the user after he has finished editing the object.
- */
- public void update() {
- if(observers != null)
- for(Iterator e = observers.iterator(); e.hasNext(); )
- ((FieldObserver)e.next()).notify(this);
- }
-
- public String getInitValue() {
- if(value != null) {
- return value.toString();
- } else
- return null;
- }
-
- /**
- * Return string representation close to declaration format,
- * `public static final short MAX = 100', e.g..
- *
- * @return String representation of field
- */
- public final String toString() {
- String name, signature, access; // Short cuts to constant pool
-
- access = Utility.accessToString(access_flags);
- access = access.equals("")? "" : (access + " ");
- signature = type.toString();
- name = getName();
-
- StringBuffer buf = new StringBuffer(access + signature + " " + name);
- String value = getInitValue();
-
- if(value != null)
- buf.append(" = " + value);
-
- return buf.toString();
- }
-
- /** @return deep copy of this field
- */
- public FieldGen copy(ConstantPoolGen cp) {
- FieldGen fg = (FieldGen)clone();
-
- fg.setConstantPool(cp);
- return fg;
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/FieldGenOrMethodGen.java b/src/com/sun/org/apache/bcel/internal/generic/FieldGenOrMethodGen.java
deleted file mode 100644
index e75d8d8..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/FieldGenOrMethodGen.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-import com.sun.org.apache.bcel.internal.Constants;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.classfile.*;
-import java.util.ArrayList;
-
-/**
- * Super class for FieldGen and MethodGen objects, since they have
- * some methods in common!
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public abstract class FieldGenOrMethodGen extends AccessFlags
- implements NamedAndTyped, Cloneable
-{
- protected String name;
- protected Type type;
- protected ConstantPoolGen cp;
- private ArrayList attribute_vec = new ArrayList();
-
- protected FieldGenOrMethodGen() {}
-
- public void setType(Type type) {
- if(type.getType() == Constants.T_ADDRESS)
- throw new IllegalArgumentException("Type can not be " + type);
-
- this.type = type;
- }
- public Type getType() { return type; }
-
- /** @return name of method/field.
- */
- public String getName() { return name; }
- public void setName(String name) { this.name = name; }
-
- public ConstantPoolGen getConstantPool() { return cp; }
- public void setConstantPool(ConstantPoolGen cp) { this.cp = cp; }
-
- /**
- * Add an attribute to this method. Currently, the JVM knows about
- * the `Code', `ConstantValue', `Synthetic' and `Exceptions'
- * attributes. Other attributes will be ignored by the JVM but do no
- * harm.
- *
- * @param a attribute to be added
- */
- public void addAttribute(Attribute a) { attribute_vec.add(a); }
-
- /**
- * Remove an attribute.
- */
- public void removeAttribute(Attribute a) { attribute_vec.remove(a); }
-
- /**
- * Remove all attributes.
- */
- public void removeAttributes() { attribute_vec.clear(); }
-
- /**
- * @return all attributes of this method.
- */
- public Attribute[] getAttributes() {
- Attribute[] attributes = new Attribute[attribute_vec.size()];
- attribute_vec.toArray(attributes);
- return attributes;
- }
-
- /** @return signature of method/field.
- */
- public abstract String getSignature();
-
- public Object clone() {
- try {
- return super.clone();
- } catch(CloneNotSupportedException e) {
- System.err.println(e);
- return null;
- }
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/FieldInstruction.java b/src/com/sun/org/apache/bcel/internal/generic/FieldInstruction.java
deleted file mode 100644
index 1c9f6e3..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/FieldInstruction.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.classfile.ConstantPool;
-import com.sun.org.apache.bcel.internal.classfile.ConstantUtf8;
-import com.sun.org.apache.bcel.internal.classfile.ConstantNameAndType;
-import com.sun.org.apache.bcel.internal.classfile.ConstantCP;
-import com.sun.org.apache.bcel.internal.classfile.*;
-
-/**
- * Super class for the GET/PUTxxx family of instructions.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public abstract class FieldInstruction extends FieldOrMethod
- implements TypedInstruction {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- FieldInstruction() {}
-
- /**
- * @param index to constant pool
- */
- protected FieldInstruction(short opcode, int index) {
- super(opcode, index);
- }
-
- /**
- * @return mnemonic for instruction with symbolic references resolved
- */
- public String toString(ConstantPool cp) {
- return com.sun.org.apache.bcel.internal.Constants.OPCODE_NAMES[opcode] + " " +
- cp.constantToString(index, com.sun.org.apache.bcel.internal.Constants.CONSTANT_Fieldref);
- }
-
- /** @return size of field (1 or 2)
- */
- protected int getFieldSize(ConstantPoolGen cpg) {
- return getType(cpg).getSize();
- }
-
- /** @return return type of referenced field
- */
- public Type getType(ConstantPoolGen cpg) {
- return getFieldType(cpg);
- }
-
- /** @return type of field
- */
- public Type getFieldType(ConstantPoolGen cpg) {
- return Type.getType(getSignature(cpg));
- }
-
- /** @return name of referenced field.
- */
- public String getFieldName(ConstantPoolGen cpg) {
- return getName(cpg);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/FieldObserver.java b/src/com/sun/org/apache/bcel/internal/generic/FieldObserver.java
deleted file mode 100644
index e4d7ba5..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/FieldObserver.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * Imnplement this interface if you're interested in changes to a FieldGen object
- * and register yourself with addObserver().
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public interface FieldObserver {
- public void notify(FieldGen field);
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/FieldOrMethod.java b/src/com/sun/org/apache/bcel/internal/generic/FieldOrMethod.java
deleted file mode 100644
index ac4e83b..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/FieldOrMethod.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import com.sun.org.apache.bcel.internal.classfile.*;
-
-/**
- * Super class for InvokeInstruction and FieldInstruction, since they have
- * some methods in common!
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public abstract class FieldOrMethod extends CPInstruction implements LoadClass {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- FieldOrMethod() {}
-
- /**
- * @param index to constant pool
- */
- protected FieldOrMethod(short opcode, int index) {
- super(opcode, index);
- }
-
- /** @return signature of referenced method/field.
- */
- public String getSignature(ConstantPoolGen cpg) {
- ConstantPool cp = cpg.getConstantPool();
- ConstantCP cmr = (ConstantCP)cp.getConstant(index);
- ConstantNameAndType cnat = (ConstantNameAndType)cp.getConstant(cmr.getNameAndTypeIndex());
-
- return ((ConstantUtf8)cp.getConstant(cnat.getSignatureIndex())).getBytes();
- }
-
- /** @return name of referenced method/field.
- */
- public String getName(ConstantPoolGen cpg) {
- ConstantPool cp = cpg.getConstantPool();
- ConstantCP cmr = (ConstantCP)cp.getConstant(index);
- ConstantNameAndType cnat = (ConstantNameAndType)cp.getConstant(cmr.getNameAndTypeIndex());
- return ((ConstantUtf8)cp.getConstant(cnat.getNameIndex())).getBytes();
- }
-
- /** @return name of the referenced class/interface
- */
- public String getClassName(ConstantPoolGen cpg) {
- ConstantPool cp = cpg.getConstantPool();
- ConstantCP cmr = (ConstantCP)cp.getConstant(index);
- return cp.getConstantString(cmr.getClassIndex(), com.sun.org.apache.bcel.internal.Constants.CONSTANT_Class).replace('/', '.');
- }
-
- /** @return type of the referenced class/interface
- */
- public ObjectType getClassType(ConstantPoolGen cpg) {
- return new ObjectType(getClassName(cpg));
- }
-
- /** @return type of the referenced class/interface
- */
- public ObjectType getLoadClassType(ConstantPoolGen cpg) {
- return getClassType(cpg);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/GETFIELD.java b/src/com/sun/org/apache/bcel/internal/generic/GETFIELD.java
deleted file mode 100644
index 139f139..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/GETFIELD.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import com.sun.org.apache.bcel.internal.ExceptionConstants;
-
-/**
- * GETFIELD - Fetch field from object
- * <PRE>Stack: ..., objectref -&gt; ..., value</PRE>
- * OR
- * <PRE>Stack: ..., objectref -&gt; ..., value.word1, value.word2</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class GETFIELD extends FieldInstruction
- implements ExceptionThrower, StackConsumer, StackProducer {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- GETFIELD() {}
-
- public GETFIELD(int index) {
- super(Constants.GETFIELD, index);
- }
-
- public int produceStack(ConstantPoolGen cpg) { return getFieldSize(cpg); }
-
- public Class[] getExceptions() {
- Class[] cs = new Class[2 + ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length];
-
- System.arraycopy(ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION, 0,
- cs, 0, ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length);
-
- cs[ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length+1] =
- ExceptionConstants.INCOMPATIBLE_CLASS_CHANGE_ERROR;
- cs[ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length] =
- ExceptionConstants.NULL_POINTER_EXCEPTION;
-
- return cs;
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitExceptionThrower(this);
- v.visitStackConsumer(this);
- v.visitStackProducer(this);
- v.visitTypedInstruction(this);
- v.visitLoadClass(this);
- v.visitCPInstruction(this);
- v.visitFieldOrMethod(this);
- v.visitFieldInstruction(this);
- v.visitGETFIELD(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/GETSTATIC.java b/src/com/sun/org/apache/bcel/internal/generic/GETSTATIC.java
deleted file mode 100644
index 1968ce3..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/GETSTATIC.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import com.sun.org.apache.bcel.internal.ExceptionConstants;
-
-/**
- * GETSTATIC - Fetch static field from class
- * <PRE>Stack: ..., -&gt; ..., value</PRE>
- * OR
- * <PRE>Stack: ..., -&gt; ..., value.word1, value.word2</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class GETSTATIC extends FieldInstruction implements PushInstruction, ExceptionThrower {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- GETSTATIC() {}
-
- public GETSTATIC(int index) {
- super(Constants.GETSTATIC, index);
- }
-
- public int produceStack(ConstantPoolGen cpg) { return getFieldSize(cpg); }
-
- public Class[] getExceptions() {
- Class[] cs = new Class[1 + ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length];
-
- System.arraycopy(ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION, 0,
- cs, 0, ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length);
- cs[ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length] =
- ExceptionConstants.INCOMPATIBLE_CLASS_CHANGE_ERROR;
-
- return cs;
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackProducer(this);
- v.visitPushInstruction(this);
- v.visitExceptionThrower(this);
- v.visitTypedInstruction(this);
- v.visitLoadClass(this);
- v.visitCPInstruction(this);
- v.visitFieldOrMethod(this);
- v.visitFieldInstruction(this);
- v.visitGETSTATIC(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/GOTO.java b/src/com/sun/org/apache/bcel/internal/generic/GOTO.java
deleted file mode 100644
index cfdb421..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/GOTO.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import java.io.*;
-
-/**
- * GOTO - Branch always (to relative offset, not absolute address)
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class GOTO extends GotoInstruction implements VariableLengthInstruction {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- GOTO() {}
-
- public GOTO(InstructionHandle target) {
- super(com.sun.org.apache.bcel.internal.Constants.GOTO, target);
- }
-
- /**
- * Dump instruction as byte code to stream out.
- * @param out Output stream
- */
- public void dump(DataOutputStream out) throws IOException {
- index = getTargetOffset();
- if(opcode == com.sun.org.apache.bcel.internal.Constants.GOTO)
- super.dump(out);
- else { // GOTO_W
- index = getTargetOffset();
- out.writeByte(opcode);
- out.writeInt(index);
- }
- }
-
- /** Called in pass 2 of InstructionList.setPositions() in order to update
- * the branch target, that may shift due to variable length instructions.
- */
- protected int updatePosition(int offset, int max_offset) {
- int i = getTargetOffset(); // Depending on old position value
-
- position += offset; // Position may be shifted by preceding expansions
-
- if(Math.abs(i) >= (32767 - max_offset)) { // to large for short (estimate)
- opcode = com.sun.org.apache.bcel.internal.Constants.GOTO_W;
- length = 5;
- return 2; // 5 - 3
- }
-
- return 0;
- }
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitVariableLengthInstruction(this);
- v.visitUnconditionalBranch(this);
- v.visitBranchInstruction(this);
- v.visitGotoInstruction(this);
- v.visitGOTO(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/GOTO_W.java b/src/com/sun/org/apache/bcel/internal/generic/GOTO_W.java
deleted file mode 100644
index b494482..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/GOTO_W.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import java.io.*;
-import com.sun.org.apache.bcel.internal.util.ByteSequence;
-
-/**
- * GOTO_W - Branch always (to relative offset, not absolute address)
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class GOTO_W extends GotoInstruction {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- GOTO_W() {}
-
- public GOTO_W(InstructionHandle target) {
- super(com.sun.org.apache.bcel.internal.Constants.GOTO_W, target);
- length = 5;
- }
-
- /**
- * Dump instruction as byte code to stream out.
- * @param out Output stream
- */
- public void dump(DataOutputStream out) throws IOException {
- index = getTargetOffset();
- out.writeByte(opcode);
- out.writeInt(index);
- }
-
- /**
- * Read needed data (e.g. index) from file.
- */
- protected void initFromFile(ByteSequence bytes, boolean wide) throws IOException
- {
- index = bytes.readInt();
- length = 5;
- }
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitUnconditionalBranch(this);
- v.visitBranchInstruction(this);
- v.visitGotoInstruction(this);
- v.visitGOTO_W(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/GotoInstruction.java b/src/com/sun/org/apache/bcel/internal/generic/GotoInstruction.java
deleted file mode 100644
index 2beaea5..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/GotoInstruction.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * Super class for GOTO
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public abstract class GotoInstruction extends BranchInstruction
- implements UnconditionalBranch
-{
- GotoInstruction(short opcode, InstructionHandle target) {
- super(opcode, target);
- }
-
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- GotoInstruction(){}
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/I2B.java b/src/com/sun/org/apache/bcel/internal/generic/I2B.java
deleted file mode 100644
index c933cf4..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/I2B.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * I2B - Convert int to byte
- * <PRE>Stack: ..., value -&gt; ..., result</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class I2B extends ConversionInstruction {
- /** Convert int to byte
- */
- public I2B() {
- super(com.sun.org.apache.bcel.internal.Constants.I2B);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitConversionInstruction(this);
- v.visitI2B(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/I2C.java b/src/com/sun/org/apache/bcel/internal/generic/I2C.java
deleted file mode 100644
index 7da43e4..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/I2C.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * I2C - Convert int to char
- * <PRE>Stack: ..., value -&gt; ..., result</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class I2C extends ConversionInstruction {
- /** Convert int to char
- */
- public I2C() {
- super(com.sun.org.apache.bcel.internal.Constants.I2C);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitConversionInstruction(this);
- v.visitI2C(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/I2D.java b/src/com/sun/org/apache/bcel/internal/generic/I2D.java
deleted file mode 100644
index a75907a..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/I2D.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * I2D - Convert int to double
- * <PRE>Stack: ..., value -&gt; ..., result.word1, result.word2</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class I2D extends ConversionInstruction {
- /** Convert int to double
- */
- public I2D() {
- super(com.sun.org.apache.bcel.internal.Constants.I2D);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitConversionInstruction(this);
- v.visitI2D(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/I2F.java b/src/com/sun/org/apache/bcel/internal/generic/I2F.java
deleted file mode 100644
index 7ec7bef..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/I2F.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * I2F - Convert int to float
- * <PRE>Stack: ..., value -&gt; ..., result</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class I2F extends ConversionInstruction {
- /** Convert int to float
- */
- public I2F() {
- super(com.sun.org.apache.bcel.internal.Constants.I2F);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitConversionInstruction(this);
- v.visitI2F(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/I2L.java b/src/com/sun/org/apache/bcel/internal/generic/I2L.java
deleted file mode 100644
index 4663588..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/I2L.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * I2L - Convert int to long
- * <PRE>Stack: ..., value -&gt; ..., result.word1, result.word2</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class I2L extends ConversionInstruction {
- /** Convert int to long
- */
- public I2L() {
- super(com.sun.org.apache.bcel.internal.Constants.I2L);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitConversionInstruction(this);
- v.visitI2L(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/I2S.java b/src/com/sun/org/apache/bcel/internal/generic/I2S.java
deleted file mode 100644
index 52a71a6..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/I2S.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * I2S - Convert int to short
- * <PRE>Stack: ..., value -&gt; ..., result</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class I2S extends ConversionInstruction {
- public I2S() {
- super(com.sun.org.apache.bcel.internal.Constants.I2S);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitConversionInstruction(this);
- v.visitI2S(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/IADD.java b/src/com/sun/org/apache/bcel/internal/generic/IADD.java
deleted file mode 100644
index ac804e5..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/IADD.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * IADD - Add ints
- * <PRE>Stack: ..., value1, value2 -&gt; result</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class IADD extends ArithmeticInstruction {
- /** Add ints
- */
- public IADD() {
- super(com.sun.org.apache.bcel.internal.Constants.IADD);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitArithmeticInstruction(this);
- v.visitIADD(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/IALOAD.java b/src/com/sun/org/apache/bcel/internal/generic/IALOAD.java
deleted file mode 100644
index 0e99934..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/IALOAD.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * IALOAD - Load int from array
- * <PRE>Stack: ..., arrayref, index -&gt; ..., value</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class IALOAD extends ArrayInstruction implements StackProducer {
- /**
- * Load int from array
- */
- public IALOAD() {
- super(com.sun.org.apache.bcel.internal.Constants.IALOAD);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackProducer(this);
- v.visitExceptionThrower(this);
- v.visitTypedInstruction(this);
- v.visitArrayInstruction(this);
- v.visitIALOAD(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/IAND.java b/src/com/sun/org/apache/bcel/internal/generic/IAND.java
deleted file mode 100644
index 6982685..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/IAND.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * IAND - Bitwise AND int
- * <PRE>Stack: ..., value1, value2 -&gt; ..., result</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class IAND extends ArithmeticInstruction {
- public IAND() {
- super(com.sun.org.apache.bcel.internal.Constants.IAND);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitArithmeticInstruction(this);
- v.visitIAND(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/IASTORE.java b/src/com/sun/org/apache/bcel/internal/generic/IASTORE.java
deleted file mode 100644
index cf1277f..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/IASTORE.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * IASTORE - Store into int array
- * <PRE>Stack: ..., arrayref, index, value -&gt; ...</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class IASTORE extends ArrayInstruction implements StackConsumer {
- /**
- * Store into int array
- */
- public IASTORE() {
- super(com.sun.org.apache.bcel.internal.Constants.IASTORE);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackConsumer(this);
- v.visitExceptionThrower(this);
- v.visitTypedInstruction(this);
- v.visitArrayInstruction(this);
- v.visitIASTORE(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/ICONST.java b/src/com/sun/org/apache/bcel/internal/generic/ICONST.java
deleted file mode 100644
index 52d1eec..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/ICONST.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * ICONST - Push value between -1, ..., 5, other values cause an exception
- *
- * <PRE>Stack: ... -&gt; ..., </PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class ICONST extends Instruction
- implements ConstantPushInstruction, TypedInstruction {
- private int value;
-
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- ICONST() {}
-
- public ICONST(int i) {
- super(com.sun.org.apache.bcel.internal.Constants.ICONST_0, (short)1);
-
- if((i >= -1) && (i <= 5))
- opcode = (short)(com.sun.org.apache.bcel.internal.Constants.ICONST_0 + i); // Even works for i == -1
- else
- throw new ClassGenException("ICONST can be used only for value between -1 and 5: " +
- i);
- value = i;
- }
-
- public Number getValue() { return new Integer(value); }
-
- /** @return Type.INT
- */
- public Type getType(ConstantPoolGen cp) {
- return Type.INT;
- }
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitPushInstruction(this);
- v.visitStackProducer(this);
- v.visitTypedInstruction(this);
- v.visitConstantPushInstruction(this);
- v.visitICONST(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/IDIV.java b/src/com/sun/org/apache/bcel/internal/generic/IDIV.java
deleted file mode 100644
index fba149b..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/IDIV.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * IDIV - Divide ints
- * <PRE>Stack: ..., value1, value2 -&gt; result</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class IDIV extends ArithmeticInstruction implements ExceptionThrower {
- /** Divide ints
- */
- public IDIV() {
- super(com.sun.org.apache.bcel.internal.Constants.IDIV);
- }
-
- /** @return exceptions this instruction may cause
- */
- public Class[] getExceptions() {
- return new Class[] { com.sun.org.apache.bcel.internal.ExceptionConstants.ARITHMETIC_EXCEPTION };
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitExceptionThrower(this);
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitArithmeticInstruction(this);
- v.visitIDIV(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/IFEQ.java b/src/com/sun/org/apache/bcel/internal/generic/IFEQ.java
deleted file mode 100644
index 73496cb..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/IFEQ.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * IFEQ - Branch if int comparison with zero succeeds
- *
- * <PRE>Stack: ..., value -&gt; ...</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class IFEQ extends IfInstruction {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- IFEQ() {}
-
- public IFEQ(InstructionHandle target) {
- super(com.sun.org.apache.bcel.internal.Constants.IFEQ, target);
- }
-
- /**
- * @return negation of instruction, e.g. IFEQ.negate() == IFNE
- */
- public IfInstruction negate() {
- return new IFNE(target);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackConsumer(this);
- v.visitBranchInstruction(this);
- v.visitIfInstruction(this);
- v.visitIFEQ(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/IFGE.java b/src/com/sun/org/apache/bcel/internal/generic/IFGE.java
deleted file mode 100644
index 73a14a4..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/IFGE.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * IFGE - Branch if int comparison with zero succeeds
- *
- * <PRE>Stack: ..., value -&gt; ...</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class IFGE extends IfInstruction {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- IFGE() {}
-
- public IFGE(InstructionHandle target) {
- super(com.sun.org.apache.bcel.internal.Constants.IFGE, target);
- }
-
- /**
- * @return negation of instruction
- */
- public IfInstruction negate() {
- return new IFLT(target);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackConsumer(this);
- v.visitBranchInstruction(this);
- v.visitIfInstruction(this);
- v.visitIFGE(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/IFGT.java b/src/com/sun/org/apache/bcel/internal/generic/IFGT.java
deleted file mode 100644
index 167826c..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/IFGT.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * IFGT - Branch if int comparison with zero succeeds
- *
- * <PRE>Stack: ..., value -&gt; ...</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class IFGT extends IfInstruction {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- IFGT() {}
-
- public IFGT(InstructionHandle target) {
- super(com.sun.org.apache.bcel.internal.Constants.IFGT, target);
- }
-
- /**
- * @return negation of instruction
- */
- public IfInstruction negate() {
- return new IFLE(target);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackConsumer(this);
- v.visitBranchInstruction(this);
- v.visitIfInstruction(this);
- v.visitIFGT(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/IFLE.java b/src/com/sun/org/apache/bcel/internal/generic/IFLE.java
deleted file mode 100644
index 84b7fa3..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/IFLE.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * IFLE - Branch if int comparison with zero succeeds
- *
- * <PRE>Stack: ..., value -&gt; ...</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class IFLE extends IfInstruction {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- IFLE() {}
-
- public IFLE(InstructionHandle target) {
- super(com.sun.org.apache.bcel.internal.Constants.IFLE, target);
- }
-
- /**
- * @return negation of instruction
- */
- public IfInstruction negate() {
- return new IFGT(target);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackConsumer(this);
- v.visitBranchInstruction(this);
- v.visitIfInstruction(this);
- v.visitIFLE(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/IFLT.java b/src/com/sun/org/apache/bcel/internal/generic/IFLT.java
deleted file mode 100644
index 5f904cd..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/IFLT.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * IFLT - Branch if int comparison with zero succeeds
- *
- * <PRE>Stack: ..., value -&gt; ...</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class IFLT extends IfInstruction {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- IFLT() {}
-
- public IFLT(InstructionHandle target) {
- super(com.sun.org.apache.bcel.internal.Constants.IFLT, target);
- }
-
- /**
- * @return negation of instruction
- */
- public IfInstruction negate() {
- return new IFGE(target);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackConsumer(this);
- v.visitBranchInstruction(this);
- v.visitIfInstruction(this);
- v.visitIFLT(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/IFNE.java b/src/com/sun/org/apache/bcel/internal/generic/IFNE.java
deleted file mode 100644
index 0baf4a8..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/IFNE.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * IFNE - Branch if int comparison with zero succeeds
- *
- * <PRE>Stack: ..., value -&gt; ...</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class IFNE extends IfInstruction {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- IFNE() {}
-
- public IFNE(InstructionHandle target) {
- super(com.sun.org.apache.bcel.internal.Constants.IFNE, target);
- }
-
- /**
- * @return negation of instruction
- */
- public IfInstruction negate() {
- return new IFEQ(target);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackConsumer(this);
- v.visitBranchInstruction(this);
- v.visitIfInstruction(this);
- v.visitIFNE(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/IFNONNULL.java b/src/com/sun/org/apache/bcel/internal/generic/IFNONNULL.java
deleted file mode 100644
index 9131bb2..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/IFNONNULL.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * IFNONNULL - Branch if reference is not null
- *
- * <PRE>Stack: ..., reference -&gt; ...</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class IFNONNULL extends IfInstruction {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- IFNONNULL() {}
-
- public IFNONNULL(InstructionHandle target) {
- super(com.sun.org.apache.bcel.internal.Constants.IFNONNULL, target);
- }
-
- /**
- * @return negation of instruction
- */
- public IfInstruction negate() {
- return new IFNULL(target);
- }
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackConsumer(this);
- v.visitBranchInstruction(this);
- v.visitIfInstruction(this);
- v.visitIFNONNULL(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/IFNULL.java b/src/com/sun/org/apache/bcel/internal/generic/IFNULL.java
deleted file mode 100644
index 1a5ccaf..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/IFNULL.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * IFNULL - Branch if reference is not null
- *
- * <PRE>Stack: ..., reference -&gt; ...</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class IFNULL extends IfInstruction {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- IFNULL() {}
-
- public IFNULL(InstructionHandle target) {
- super(com.sun.org.apache.bcel.internal.Constants.IFNULL, target);
- }
-
- /**
- * @return negation of instruction
- */
- public IfInstruction negate() {
- return new IFNONNULL(target);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackConsumer(this);
- v.visitBranchInstruction(this);
- v.visitIfInstruction(this);
- v.visitIFNULL(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/IF_ACMPEQ.java b/src/com/sun/org/apache/bcel/internal/generic/IF_ACMPEQ.java
deleted file mode 100644
index 7c0920f..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/IF_ACMPEQ.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * IF_ACMPEQ - Branch if reference comparison succeeds
- *
- * <PRE>Stack: ..., value1, value2 -&gt; ...</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class IF_ACMPEQ extends IfInstruction {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- IF_ACMPEQ() {}
-
- public IF_ACMPEQ(InstructionHandle target) {
- super(com.sun.org.apache.bcel.internal.Constants.IF_ACMPEQ, target);
- }
-
- /**
- * @return negation of instruction
- */
- public IfInstruction negate() {
- return new IF_ACMPNE(target);
- }
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackConsumer(this);
- v.visitBranchInstruction(this);
- v.visitIfInstruction(this);
- v.visitIF_ACMPEQ(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/IF_ACMPNE.java b/src/com/sun/org/apache/bcel/internal/generic/IF_ACMPNE.java
deleted file mode 100644
index 2813007..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/IF_ACMPNE.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * IF_ACMPNE - Branch if reference comparison doesn't succeed
- *
- * <PRE>Stack: ..., value1, value2 -&gt; ...</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class IF_ACMPNE extends IfInstruction {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- IF_ACMPNE() {}
-
- public IF_ACMPNE(InstructionHandle target) {
- super(com.sun.org.apache.bcel.internal.Constants.IF_ACMPNE, target);
- }
-
- /**
- * @return negation of instruction
- */
- public IfInstruction negate() {
- return new IF_ACMPEQ(target);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackConsumer(this);
- v.visitBranchInstruction(this);
- v.visitIfInstruction(this);
- v.visitIF_ACMPNE(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/IF_ICMPEQ.java b/src/com/sun/org/apache/bcel/internal/generic/IF_ICMPEQ.java
deleted file mode 100644
index a145736..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/IF_ICMPEQ.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * IF_ICMPEQ - Branch if int comparison succeeds
- *
- * <PRE>Stack: ..., value1, value2 -&gt; ...</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class IF_ICMPEQ extends IfInstruction {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- IF_ICMPEQ() {}
-
- public IF_ICMPEQ(InstructionHandle target) {
- super(com.sun.org.apache.bcel.internal.Constants.IF_ICMPEQ, target);
- }
-
- /**
- * @return negation of instruction
- */
- public IfInstruction negate() {
- return new IF_ICMPNE(target);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackConsumer(this);
- v.visitBranchInstruction(this);
- v.visitIfInstruction(this);
- v.visitIF_ICMPEQ(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/IF_ICMPGE.java b/src/com/sun/org/apache/bcel/internal/generic/IF_ICMPGE.java
deleted file mode 100644
index c629f2c..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/IF_ICMPGE.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * IF_ICMPGE - Branch if int comparison succeeds
- *
- * <PRE>Stack: ..., value1, value2 -&gt; ...</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class IF_ICMPGE extends IfInstruction {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- IF_ICMPGE() {}
-
- public IF_ICMPGE(InstructionHandle target) {
- super(com.sun.org.apache.bcel.internal.Constants.IF_ICMPGE, target);
- }
-
- /**
- * @return negation of instruction
- */
- public IfInstruction negate() {
- return new IF_ICMPLT(target);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackConsumer(this);
- v.visitBranchInstruction(this);
- v.visitIfInstruction(this);
- v.visitIF_ICMPGE(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/IF_ICMPGT.java b/src/com/sun/org/apache/bcel/internal/generic/IF_ICMPGT.java
deleted file mode 100644
index 013a72e..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/IF_ICMPGT.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * IF_ICMPGT - Branch if int comparison succeeds
- *
- * <PRE>Stack: ..., value1, value2 -&gt; ...</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class IF_ICMPGT extends IfInstruction {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- IF_ICMPGT() {}
-
- public IF_ICMPGT(InstructionHandle target) {
- super(com.sun.org.apache.bcel.internal.Constants.IF_ICMPGT, target);
- }
-
- /**
- * @return negation of instruction
- */
- public IfInstruction negate() {
- return new IF_ICMPLE(target);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackConsumer(this);
- v.visitBranchInstruction(this);
- v.visitIfInstruction(this);
- v.visitIF_ICMPGT(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/IF_ICMPLE.java b/src/com/sun/org/apache/bcel/internal/generic/IF_ICMPLE.java
deleted file mode 100644
index 7ada132..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/IF_ICMPLE.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * IF_ICMPLE - Branch if int comparison succeeds
- *
- * <PRE>Stack: ..., value1, value2 -&gt; ...</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class IF_ICMPLE extends IfInstruction {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- IF_ICMPLE() {}
-
- public IF_ICMPLE(InstructionHandle target) {
- super(com.sun.org.apache.bcel.internal.Constants.IF_ICMPLE, target);
- }
-
- /**
- * @return negation of instruction
- */
- public IfInstruction negate() {
- return new IF_ICMPGT(target);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackConsumer(this);
- v.visitBranchInstruction(this);
- v.visitIfInstruction(this);
- v.visitIF_ICMPLE(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/IF_ICMPLT.java b/src/com/sun/org/apache/bcel/internal/generic/IF_ICMPLT.java
deleted file mode 100644
index 833f06c..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/IF_ICMPLT.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * IF_ICMPLT - Branch if int comparison succeeds
- *
- * <PRE>Stack: ..., value1, value2 -&gt; ...</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class IF_ICMPLT extends IfInstruction {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- IF_ICMPLT() {}
-
- public IF_ICMPLT(InstructionHandle target) {
- super(com.sun.org.apache.bcel.internal.Constants.IF_ICMPLT, target);
- }
-
- /**
- * @return negation of instruction
- */
- public IfInstruction negate() {
- return new IF_ICMPGE(target);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackConsumer(this);
- v.visitBranchInstruction(this);
- v.visitIfInstruction(this);
- v.visitIF_ICMPLT(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/IF_ICMPNE.java b/src/com/sun/org/apache/bcel/internal/generic/IF_ICMPNE.java
deleted file mode 100644
index ae5ae87..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/IF_ICMPNE.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * IF_ICMPNE - Branch if int comparison doesn't succeed
- *
- * <PRE>Stack: ..., value1, value2 -&gt; ...</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class IF_ICMPNE extends IfInstruction {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- IF_ICMPNE() {}
-
- public IF_ICMPNE(InstructionHandle target) {
- super(com.sun.org.apache.bcel.internal.Constants.IF_ICMPNE, target);
- }
-
- /**
- * @return negation of instruction
- */
- public IfInstruction negate() {
- return new IF_ICMPEQ(target);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackConsumer(this);
- v.visitBranchInstruction(this);
- v.visitIfInstruction(this);
- v.visitIF_ICMPNE(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/IINC.java b/src/com/sun/org/apache/bcel/internal/generic/IINC.java
deleted file mode 100644
index 9286007..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/IINC.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import java.io.*;
-import com.sun.org.apache.bcel.internal.util.ByteSequence;
-
-/**
- * IINC - Increment local variable by constant
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class IINC extends LocalVariableInstruction {
- private boolean wide;
- private int c;
-
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- IINC() {}
-
- /**
- * @param n index of local variable
- * @param c increment factor
- */
- public IINC(int n, int c) {
- super(); // Default behaviour of LocalVariableInstruction causes error
-
- this.opcode = com.sun.org.apache.bcel.internal.Constants.IINC;
- this.length = (short)3;
-
- setIndex(n); // May set wide as side effect
- setIncrement(c);
- }
-
- /**
- * Dump instruction as byte code to stream out.
- * @param out Output stream
- */
- public void dump(DataOutputStream out) throws IOException {
- if(wide) // Need WIDE prefix ?
- out.writeByte(com.sun.org.apache.bcel.internal.Constants.WIDE);
-
- out.writeByte(opcode);
-
- if(wide) {
- out.writeShort(n);
- out.writeShort(c);
- } else {
- out.writeByte(n);
- out.writeByte(c);
- }
- }
-
- private final void setWide() {
- if(wide = ((n > com.sun.org.apache.bcel.internal.Constants.MAX_SHORT) ||
- (Math.abs(c) > Byte.MAX_VALUE)))
- length = 6; // wide byte included
- else
- length = 3;
- }
-
- /**
- * Read needed data (e.g. index) from file.
- */
- protected void initFromFile(ByteSequence bytes, boolean wide) throws IOException
- {
- this.wide = wide;
-
- if(wide) {
- length = 6;
- n = bytes.readUnsignedShort();
- c = bytes.readShort();
- } else {
- length = 3;
- n = bytes.readUnsignedByte();
- c = bytes.readByte();
- }
- }
-
- /**
- * @return mnemonic for instruction
- */
- public String toString(boolean verbose) {
- return super.toString(verbose) + " " + c;
- }
-
- /**
- * Set index of local variable.
- */
- public final void setIndex(int n) {
- if(n < 0)
- throw new ClassGenException("Negative index value: " + n);
-
- this.n = n;
- setWide();
- }
-
- /**
- * @return increment factor
- */
- public final int getIncrement() { return c; }
-
- /**
- * Set increment factor.
- */
- public final void setIncrement(int c) {
- this.c = c;
- setWide();
- }
-
- /** @return int type
- */
- public Type getType(ConstantPoolGen cp) {
- return Type.INT;
- }
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitLocalVariableInstruction(this);
- v.visitIINC(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/ILOAD.java b/src/com/sun/org/apache/bcel/internal/generic/ILOAD.java
deleted file mode 100644
index 05989d9..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/ILOAD.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * ILOAD - Load int from local variable onto stack
- * <PRE>Stack: ... -&gt; ..., result</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class ILOAD extends LoadInstruction {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- ILOAD() {
- super(com.sun.org.apache.bcel.internal.Constants.ILOAD, com.sun.org.apache.bcel.internal.Constants.ILOAD_0);
- }
-
- /** Load int from local variable
- * @param n index of local variable
- */
- public ILOAD(int n) {
- super(com.sun.org.apache.bcel.internal.Constants.ILOAD, com.sun.org.apache.bcel.internal.Constants.ILOAD_0, n);
- }
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- super.accept(v);
- v.visitILOAD(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/IMPDEP1.java b/src/com/sun/org/apache/bcel/internal/generic/IMPDEP1.java
deleted file mode 100644
index 281f087..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/IMPDEP1.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * IMPDEP1 - Implementation dependent
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class IMPDEP1 extends Instruction {
- public IMPDEP1() {
- super(com.sun.org.apache.bcel.internal.Constants.IMPDEP1, (short)1);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitIMPDEP1(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/IMPDEP2.java b/src/com/sun/org/apache/bcel/internal/generic/IMPDEP2.java
deleted file mode 100644
index ba5789b..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/IMPDEP2.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * IMPDEP2 - Implementation dependent
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class IMPDEP2 extends Instruction {
- public IMPDEP2() {
- super(com.sun.org.apache.bcel.internal.Constants.IMPDEP2, (short)1);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitIMPDEP2(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/IMUL.java b/src/com/sun/org/apache/bcel/internal/generic/IMUL.java
deleted file mode 100644
index 1df780f..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/IMUL.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * IMUL - Multiply ints
- * <PRE>Stack: ..., value1, value2 -&gt; result</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class IMUL extends ArithmeticInstruction {
- /** Multiply ints
- */
- public IMUL() {
- super(com.sun.org.apache.bcel.internal.Constants.IMUL);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitArithmeticInstruction(this);
- v.visitIMUL(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/INEG.java b/src/com/sun/org/apache/bcel/internal/generic/INEG.java
deleted file mode 100644
index fa8931d..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/INEG.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * INEG - Negate int
- * <PRE>Stack: ..., value -&gt; ..., result</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class INEG extends ArithmeticInstruction {
- public INEG() {
- super(com.sun.org.apache.bcel.internal.Constants.INEG);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitArithmeticInstruction(this);
- v.visitINEG(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/INSTANCEOF.java b/src/com/sun/org/apache/bcel/internal/generic/INSTANCEOF.java
deleted file mode 100644
index ed1c491..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/INSTANCEOF.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * INSTANCEOF - Determine if object is of given type
- * <PRE>Stack: ..., objectref -&gt; ..., result</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class INSTANCEOF extends CPInstruction
- implements LoadClass, ExceptionThrower, StackProducer, StackConsumer {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- INSTANCEOF() {}
-
- public INSTANCEOF(int index) {
- super(com.sun.org.apache.bcel.internal.Constants.INSTANCEOF, index);
- }
-
- public Class[] getExceptions() {
- return com.sun.org.apache.bcel.internal.ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION;
- }
-
- public ObjectType getLoadClassType(ConstantPoolGen cpg) {
- Type t = getType(cpg);
-
- if(t instanceof ArrayType)
- t = ((ArrayType) t).getBasicType();
-
- return (t instanceof ObjectType)? (ObjectType) t : null;
- }
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitLoadClass(this);
- v.visitExceptionThrower(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitTypedInstruction(this);
- v.visitCPInstruction(this);
- v.visitINSTANCEOF(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/INVOKEINTERFACE.java b/src/com/sun/org/apache/bcel/internal/generic/INVOKEINTERFACE.java
deleted file mode 100644
index aed34bd..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/INVOKEINTERFACE.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import com.sun.org.apache.bcel.internal.classfile.ConstantPool;
-import com.sun.org.apache.bcel.internal.Constants;
-import com.sun.org.apache.bcel.internal.ExceptionConstants;
-
-import java.io.*;
-import com.sun.org.apache.bcel.internal.util.ByteSequence;
-
-/**
- * INVOKEINTERFACE - Invoke interface method
- * <PRE>Stack: ..., objectref, [arg1, [arg2 ...]] -&gt; ...</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public final class INVOKEINTERFACE extends InvokeInstruction {
- private int nargs; // Number of arguments on stack (number of stack slots), called "count" in vmspec2
-
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- INVOKEINTERFACE() {}
-
- public INVOKEINTERFACE(int index, int nargs) {
- super(Constants.INVOKEINTERFACE, index);
- length = 5;
-
- if(nargs < 1)
- throw new ClassGenException("Number of arguments must be > 0 " + nargs);
-
- this.nargs = nargs;
- }
-
- /**
- * Dump instruction as byte code to stream out.
- * @param out Output stream
- */
- public void dump(DataOutputStream out) throws IOException {
- out.writeByte(opcode);
- out.writeShort(index);
- out.writeByte(nargs);
- out.writeByte(0);
- }
-
- /**
- * The <B>count</B> argument according to the Java Language Specification,
- * Second Edition.
- */
- public int getCount() { return nargs; }
-
- /**
- * Read needed data (i.e., index) from file.
- */
- protected void initFromFile(ByteSequence bytes, boolean wide)
- throws IOException
- {
- super.initFromFile(bytes, wide);
-
- length = 5;
- nargs = bytes.readUnsignedByte();
- bytes.readByte(); // Skip 0 byte
- }
-
- /**
- * @return mnemonic for instruction with symbolic references resolved
- */
- public String toString(ConstantPool cp) {
- return super.toString(cp) + " " + nargs;
- }
-
- public int consumeStack(ConstantPoolGen cpg) { // nargs is given in byte-code
- return nargs; // nargs includes this reference
- }
-
- public Class[] getExceptions() {
- Class[] cs = new Class[4 + ExceptionConstants.EXCS_INTERFACE_METHOD_RESOLUTION.length];
-
- System.arraycopy(ExceptionConstants.EXCS_INTERFACE_METHOD_RESOLUTION, 0,
- cs, 0, ExceptionConstants.EXCS_INTERFACE_METHOD_RESOLUTION.length);
-
- cs[ExceptionConstants.EXCS_INTERFACE_METHOD_RESOLUTION.length+3] = ExceptionConstants.INCOMPATIBLE_CLASS_CHANGE_ERROR;
- cs[ExceptionConstants.EXCS_INTERFACE_METHOD_RESOLUTION.length+2] = ExceptionConstants.ILLEGAL_ACCESS_ERROR;
- cs[ExceptionConstants.EXCS_INTERFACE_METHOD_RESOLUTION.length+1] = ExceptionConstants.ABSTRACT_METHOD_ERROR;
- cs[ExceptionConstants.EXCS_INTERFACE_METHOD_RESOLUTION.length] = ExceptionConstants.UNSATISFIED_LINK_ERROR;
-
- return cs;
- }
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitExceptionThrower(this);
- v.visitTypedInstruction(this);
- v.visitStackConsumer(this);
- v.visitStackProducer(this);
- v.visitLoadClass(this);
- v.visitCPInstruction(this);
- v.visitFieldOrMethod(this);
- v.visitInvokeInstruction(this);
- v.visitINVOKEINTERFACE(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/INVOKESPECIAL.java b/src/com/sun/org/apache/bcel/internal/generic/INVOKESPECIAL.java
deleted file mode 100644
index d40deed..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/INVOKESPECIAL.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import com.sun.org.apache.bcel.internal.Constants;
-import com.sun.org.apache.bcel.internal.ExceptionConstants;
-
-/**
- * INVOKESPECIAL - Invoke instance method; special handling for superclass, private
- * and instance initialization method invocations
- *
- * <PRE>Stack: ..., objectref, [arg1, [arg2 ...]] -&gt; ...</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class INVOKESPECIAL extends InvokeInstruction {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- INVOKESPECIAL() {}
-
- public INVOKESPECIAL(int index) {
- super(Constants.INVOKESPECIAL, index);
- }
-
- public Class[] getExceptions() {
- Class[] cs = new Class[4 + ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length];
-
- System.arraycopy(ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION, 0,
- cs, 0, ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length);
-
- cs[ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length+3] = ExceptionConstants.UNSATISFIED_LINK_ERROR;
- cs[ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length+2] = ExceptionConstants.ABSTRACT_METHOD_ERROR;
- cs[ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length+1] = ExceptionConstants.INCOMPATIBLE_CLASS_CHANGE_ERROR;
- cs[ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length] = ExceptionConstants.NULL_POINTER_EXCEPTION;
-
- return cs;
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitExceptionThrower(this);
- v.visitTypedInstruction(this);
- v.visitStackConsumer(this);
- v.visitStackProducer(this);
- v.visitLoadClass(this);
- v.visitCPInstruction(this);
- v.visitFieldOrMethod(this);
- v.visitInvokeInstruction(this);
- v.visitINVOKESPECIAL(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/INVOKESTATIC.java b/src/com/sun/org/apache/bcel/internal/generic/INVOKESTATIC.java
deleted file mode 100644
index 2a32c69..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/INVOKESTATIC.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import com.sun.org.apache.bcel.internal.Constants;
-import com.sun.org.apache.bcel.internal.ExceptionConstants;
-
-/**
- * INVOKESTATIC - Invoke a class (static) method
- *
- * <PRE>Stack: ..., [arg1, [arg2 ...]] -&gt; ...</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class INVOKESTATIC extends InvokeInstruction {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- INVOKESTATIC() {}
-
- public INVOKESTATIC(int index) {
- super(Constants.INVOKESTATIC, index);
- }
-
- public Class[] getExceptions() {
- Class[] cs = new Class[2 + ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length];
-
- System.arraycopy(ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION, 0,
- cs, 0, ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length);
-
- cs[ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length] = ExceptionConstants.UNSATISFIED_LINK_ERROR;
- cs[ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length+1] = ExceptionConstants.INCOMPATIBLE_CLASS_CHANGE_ERROR;
-
- return cs;
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitExceptionThrower(this);
- v.visitTypedInstruction(this);
- v.visitStackConsumer(this);
- v.visitStackProducer(this);
- v.visitLoadClass(this);
- v.visitCPInstruction(this);
- v.visitFieldOrMethod(this);
- v.visitInvokeInstruction(this);
- v.visitINVOKESTATIC(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/INVOKEVIRTUAL.java b/src/com/sun/org/apache/bcel/internal/generic/INVOKEVIRTUAL.java
deleted file mode 100644
index a4ffe5b..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/INVOKEVIRTUAL.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import com.sun.org.apache.bcel.internal.Constants;
-import com.sun.org.apache.bcel.internal.ExceptionConstants;
-
-/**
- * INVOKEVIRTUAL - Invoke instance method; dispatch based on class
- *
- * <PRE>Stack: ..., objectref, [arg1, [arg2 ...]] -&gt; ...</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class INVOKEVIRTUAL extends InvokeInstruction {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- INVOKEVIRTUAL() {}
-
- public INVOKEVIRTUAL(int index) {
- super(Constants.INVOKEVIRTUAL, index);
- }
-
- public Class[] getExceptions() {
- Class[] cs = new Class[4 + ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length];
-
- System.arraycopy(ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION, 0,
- cs, 0, ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length);
-
- cs[ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length+3] = ExceptionConstants.UNSATISFIED_LINK_ERROR;
- cs[ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length+2] = ExceptionConstants.ABSTRACT_METHOD_ERROR;
- cs[ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length+1] = ExceptionConstants.INCOMPATIBLE_CLASS_CHANGE_ERROR;
- cs[ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length] = ExceptionConstants.NULL_POINTER_EXCEPTION;
-
- return cs;
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitExceptionThrower(this);
- v.visitTypedInstruction(this);
- v.visitStackConsumer(this);
- v.visitStackProducer(this);
- v.visitLoadClass(this);
- v.visitCPInstruction(this);
- v.visitFieldOrMethod(this);
- v.visitInvokeInstruction(this);
- v.visitINVOKEVIRTUAL(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/IOR.java b/src/com/sun/org/apache/bcel/internal/generic/IOR.java
deleted file mode 100644
index 8cf0f09..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/IOR.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * IOR - Bitwise OR int
- * <PRE>Stack: ..., value1, value2 -&gt; ..., result</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class IOR extends ArithmeticInstruction {
- public IOR() {
- super(com.sun.org.apache.bcel.internal.Constants.IOR);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitArithmeticInstruction(this);
- v.visitIOR(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/IREM.java b/src/com/sun/org/apache/bcel/internal/generic/IREM.java
deleted file mode 100644
index 650f773..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/IREM.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * IREM - Remainder of int
- * <PRE>Stack: ..., value1, value2 -&gt; result</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class IREM extends ArithmeticInstruction implements ExceptionThrower {
- /** Remainder of ints
- */
- public IREM() {
- super(com.sun.org.apache.bcel.internal.Constants.IREM);
- }
-
- /** @return exceptions this instruction may cause
- */
- public Class[] getExceptions() {
- return new Class[] { com.sun.org.apache.bcel.internal.ExceptionConstants.ARITHMETIC_EXCEPTION };
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitExceptionThrower(this);
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitArithmeticInstruction(this);
- v.visitIREM(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/IRETURN.java b/src/com/sun/org/apache/bcel/internal/generic/IRETURN.java
deleted file mode 100644
index 9678b5b..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/IRETURN.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * IRETURN - Return int from method
- * <PRE>Stack: ..., value -&gt; &lt;empty&gt;</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class IRETURN extends ReturnInstruction {
- /** Return int from method
- */
- public IRETURN() {
- super(com.sun.org.apache.bcel.internal.Constants.IRETURN);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitExceptionThrower(this);
- v.visitTypedInstruction(this);
- v.visitStackConsumer(this);
- v.visitReturnInstruction(this);
- v.visitIRETURN(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/ISHL.java b/src/com/sun/org/apache/bcel/internal/generic/ISHL.java
deleted file mode 100644
index 5f26b9a..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/ISHL.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * ISHL - Arithmetic shift left int
- * <PRE>Stack: ..., value1, value2 -&gt; ..., result</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class ISHL extends ArithmeticInstruction {
- public ISHL() {
- super(com.sun.org.apache.bcel.internal.Constants.ISHL);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitArithmeticInstruction(this);
- v.visitISHL(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/ISHR.java b/src/com/sun/org/apache/bcel/internal/generic/ISHR.java
deleted file mode 100644
index 6a3cb3e..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/ISHR.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * ISHR - Arithmetic shift right int
- * <PRE>Stack: ..., value1, value2 -&gt; ..., result</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class ISHR extends ArithmeticInstruction {
- public ISHR() {
- super(com.sun.org.apache.bcel.internal.Constants.ISHR);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitArithmeticInstruction(this);
- v.visitISHR(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/ISTORE.java b/src/com/sun/org/apache/bcel/internal/generic/ISTORE.java
deleted file mode 100644
index 22cd14d..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/ISTORE.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * ISTORE - Store int from stack into local variable
- * <PRE>Stack: ..., value -&gt; ... </PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class ISTORE extends StoreInstruction {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- ISTORE() {
- super(com.sun.org.apache.bcel.internal.Constants.ISTORE, com.sun.org.apache.bcel.internal.Constants.ISTORE_0);
- }
-
- /** Store int into local variable
- * @param n index of local variable
- */
- public ISTORE(int n) {
- super(com.sun.org.apache.bcel.internal.Constants.ISTORE, com.sun.org.apache.bcel.internal.Constants.ISTORE_0, n);
- }
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- super.accept(v);
- v.visitISTORE(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/ISUB.java b/src/com/sun/org/apache/bcel/internal/generic/ISUB.java
deleted file mode 100644
index 413e9d4..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/ISUB.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * ISUB - Substract ints
- * <PRE>Stack: ..., value1, value2 -&gt; result</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class ISUB extends ArithmeticInstruction {
- /** Substract ints
- */
- public ISUB() {
- super(com.sun.org.apache.bcel.internal.Constants.ISUB);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitArithmeticInstruction(this);
- v.visitISUB(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/IUSHR.java b/src/com/sun/org/apache/bcel/internal/generic/IUSHR.java
deleted file mode 100644
index 917ad39..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/IUSHR.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * IUSHR - Logical shift right int
- * <PRE>Stack: ..., value1, value2 -&gt; ..., result</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class IUSHR extends ArithmeticInstruction {
- public IUSHR() {
- super(com.sun.org.apache.bcel.internal.Constants.IUSHR);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitArithmeticInstruction(this);
- v.visitIUSHR(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/IXOR.java b/src/com/sun/org/apache/bcel/internal/generic/IXOR.java
deleted file mode 100644
index d51ad6c..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/IXOR.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * IXOR - Bitwise XOR int
- * <PRE>Stack: ..., value1, value2 -&gt; ..., result</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class IXOR extends ArithmeticInstruction {
- public IXOR() {
- super(com.sun.org.apache.bcel.internal.Constants.IXOR);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitArithmeticInstruction(this);
- v.visitIXOR(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/IfInstruction.java b/src/com/sun/org/apache/bcel/internal/generic/IfInstruction.java
deleted file mode 100644
index e5fa484..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/IfInstruction.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * Super class for the IFxxx family of instructions.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public abstract class IfInstruction extends BranchInstruction implements StackConsumer {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- IfInstruction() {}
-
- /**
- * @param instruction Target instruction to branch to
- */
- protected IfInstruction(short opcode, InstructionHandle target) {
- super(opcode, target);
- }
-
- /**
- * @return negation of instruction, e.g. IFEQ.negate() == IFNE
- */
- public abstract IfInstruction negate();
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/IndexedInstruction.java b/src/com/sun/org/apache/bcel/internal/generic/IndexedInstruction.java
deleted file mode 100644
index db8e05f..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/IndexedInstruction.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * Denote entity that refers to an index, e.g. local variable instructions,
- * RET, CPInstruction, etc.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public interface IndexedInstruction {
- public int getIndex();
- public void setIndex(int index);
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/Instruction.java b/src/com/sun/org/apache/bcel/internal/generic/Instruction.java
deleted file mode 100644
index ed58b5d..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/Instruction.java
+++ /dev/null
@@ -1,308 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import com.sun.org.apache.bcel.internal.classfile.Utility;
-import com.sun.org.apache.bcel.internal.classfile.ConstantPool;
-import java.io.*;
-import com.sun.org.apache.bcel.internal.util.ByteSequence;
-
-/**
- * Abstract super class for all Java byte codes.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public abstract class Instruction implements Cloneable, Serializable {
- protected short length = 1; // Length of instruction in bytes
- protected short opcode = -1; // Opcode number
-
- private static InstructionComparator cmp = InstructionComparator.DEFAULT;
-
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- Instruction() {}
-
- public Instruction(short opcode, short length) {
- this.length = length;
- this.opcode = opcode;
- }
-
- /**
- * Dump instruction as byte code to stream out.
- * @param out Output stream
- */
- public void dump(DataOutputStream out) throws IOException {
- out.writeByte(opcode); // Common for all instructions
- }
-
- /** @return name of instruction, i.e., opcode name
- */
- public String getName() {
- return Constants.OPCODE_NAMES[opcode];
- }
-
- /**
- * Long output format:
- *
- * &lt;name of opcode&gt; "["&lt;opcode number&gt;"]"
- * "("&lt;length of instruction&gt;")"
- *
- * @param verbose long/short format switch
- * @return mnemonic for instruction
- */
- public String toString(boolean verbose) {
- if(verbose)
- return getName() + "[" + opcode + "](" + length + ")";
- else
- return getName();
- }
-
- /**
- * @return mnemonic for instruction in verbose format
- */
- public String toString() {
- return toString(true);
- }
-
- /**
- * @return mnemonic for instruction with sumbolic references resolved
- */
- public String toString(ConstantPool cp) {
- return toString(false);
- }
-
- /**
- * Use with caution, since `BranchInstruction's have a `target' reference which
- * is not copied correctly (only basic types are). This also applies for
- * `Select' instructions with their multiple branch targets.
- *
- * @see BranchInstruction
- * @return (shallow) copy of an instruction
- */
- public Instruction copy() {
- Instruction i = null;
-
- // "Constant" instruction, no need to duplicate
- if(InstructionConstants.INSTRUCTIONS[this.getOpcode()] != null)
- i = this;
- else {
- try {
- i = (Instruction)clone();
- } catch(CloneNotSupportedException e) {
- System.err.println(e);
- }
- }
-
- return i;
- }
-
- /**
- * Read needed data (e.g. index) from file.
- *
- * @param bytes byte sequence to read from
- * @param wide "wide" instruction flag
- */
- protected void initFromFile(ByteSequence bytes, boolean wide)
- throws IOException
- {}
-
- /**
- * Read an instruction from (byte code) input stream and return the
- * appropiate object.
- *
- * @param file file to read from
- * @return instruction object being read
- */
- public static final Instruction readInstruction(ByteSequence bytes)
- throws IOException
- {
- boolean wide = false;
- short opcode = (short)bytes.readUnsignedByte();
- Instruction obj = null;
-
- if(opcode == Constants.WIDE) { // Read next opcode after wide byte
- wide = true;
- opcode = (short)bytes.readUnsignedByte();
- }
-
- if(InstructionConstants.INSTRUCTIONS[opcode] != null)
- return InstructionConstants.INSTRUCTIONS[opcode]; // Used predefined immutable object, if available
-
- /* Find appropiate class, instantiate an (empty) instruction object
- * and initialize it by hand.
- */
- Class clazz;
-
- try {
- clazz = Class.forName(className(opcode));
- } catch (ClassNotFoundException cnfe){
- // If a class by that name does not exist, the opcode is illegal.
- // Note that IMPDEP1, IMPDEP2, BREAKPOINT are also illegal in a sense.
- throw new ClassGenException("Illegal opcode detected.");
- }
-
- try {
- obj = (Instruction)clazz.newInstance();
-
- if(wide && !((obj instanceof LocalVariableInstruction) ||
- (obj instanceof IINC) ||
- (obj instanceof RET)))
- throw new Exception("Illegal opcode after wide: " + opcode);
-
- obj.setOpcode(opcode);
- obj.initFromFile(bytes, wide); // Do further initializations, if any
- // Byte code offset set in InstructionList
- } catch(Exception e) { throw new ClassGenException(e.toString()); }
-
- return obj;
- }
-
- private static final String className(short opcode) {
- String name = Constants.OPCODE_NAMES[opcode].toUpperCase();
-
- /* ICONST_0, etc. will be shortened to ICONST, etc., since ICONST_0 and the like
- * are not implemented (directly).
- */
- try {
- int len = name.length();
- char ch1 = name.charAt(len - 2), ch2 = name.charAt(len - 1);
-
- if((ch1 == '_') && (ch2 >= '0') && (ch2 <= '5'))
- name = name.substring(0, len - 2);
-
- if(name.equals("ICONST_M1")) // Special case
- name = "ICONST";
- } catch(StringIndexOutOfBoundsException e) { System.err.println(e); }
-
- return "com.sun.org.apache.bcel.internal.generic." + name;
- }
-
- /**
- * This method also gives right results for instructions whose
- * effect on the stack depends on the constant pool entry they
- * reference.
- * @return Number of words consumed from stack by this instruction,
- * or Constants.UNPREDICTABLE, if this can not be computed statically
- */
- public int consumeStack(ConstantPoolGen cpg) {
- return Constants.CONSUME_STACK[opcode];
- }
-
- /**
- * This method also gives right results for instructions whose
- * effect on the stack depends on the constant pool entry they
- * reference.
- * @return Number of words produced onto stack by this instruction,
- * or Constants.UNPREDICTABLE, if this can not be computed statically
- */
- public int produceStack(ConstantPoolGen cpg) {
- return Constants.PRODUCE_STACK[opcode];
- }
-
- /**
- * @return this instructions opcode
- */
- public short getOpcode() { return opcode; }
-
- /**
- * @return length (in bytes) of instruction
- */
- public int getLength() { return length; }
-
- /**
- * Needed in readInstruction.
- */
- private void setOpcode(short opcode) { this.opcode = opcode; }
-
- /** Some instructions may be reused, so don't do anything by default.
- */
- void dispose() {}
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public abstract void accept(Visitor v);
-
- /** Get Comparator object used in the equals() method to determine
- * equality of instructions.
- *
- * @return currently used comparator for equals()
- */
- public static InstructionComparator getComparator() { return cmp; }
-
- /** Set comparator to be used for equals().
- */
- public static void setComparator(InstructionComparator c) { cmp = c; }
-
- /** Check for equality, delegated to comparator
- * @return true if that is an Instruction and has the same opcode
- */
- public boolean equals(Object that) {
- return (that instanceof Instruction)?
- cmp.equals(this, (Instruction)that) : false;
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/InstructionComparator.java b/src/com/sun/org/apache/bcel/internal/generic/InstructionComparator.java
deleted file mode 100644
index 5a42652..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/InstructionComparator.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * Equality of instructions isn't clearly to be defined. You might
- * wish, for example, to compare whether instructions have the same
- * meaning. E.g., whether two INVOKEVIRTUALs describe the same
- * call.<br>The DEFAULT comparator however, considers two instructions
- * to be equal if they have same opcode and point to the same indexes
- * (if any) in the constant pool or the same local variable index. Branch
- * instructions must have the same target.
- *
- * @see Instruction
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public interface InstructionComparator {
- public static final InstructionComparator DEFAULT =
- new InstructionComparator() {
- public boolean equals(Instruction i1, Instruction i2) {
- if(i1.opcode == i2.opcode) {
- if(i1 instanceof Select) {
- InstructionHandle[] t1 = ((Select)i1).getTargets();
- InstructionHandle[] t2 = ((Select)i2).getTargets();
-
- if(t1.length == t2.length) {
- for(int i = 0; i < t1.length; i++) {
- if(t1[i] != t2[i]) {
- return false;
- }
- }
-
- return true;
- }
- } else if(i1 instanceof BranchInstruction) {
- return ((BranchInstruction)i1).target ==
- ((BranchInstruction)i2).target;
- } else if(i1 instanceof ConstantPushInstruction) {
- return ((ConstantPushInstruction)i1).getValue().
- equals(((ConstantPushInstruction)i2).getValue());
- } else if(i1 instanceof IndexedInstruction) {
- return ((IndexedInstruction)i1).getIndex() ==
- ((IndexedInstruction)i2).getIndex();
- } else if(i1 instanceof NEWARRAY) {
- return ((NEWARRAY)i1).getTypecode() == ((NEWARRAY)i2).getTypecode();
- } else {
- return true;
- }
- }
-
- return false;
- }
- };
-
- public boolean equals(Instruction i1, Instruction i2);
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/InstructionConstants.java b/src/com/sun/org/apache/bcel/internal/generic/InstructionConstants.java
deleted file mode 100644
index 1ff55dd..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/InstructionConstants.java
+++ /dev/null
@@ -1,329 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-
-/**
- * This interface contains shareable instruction objects.
- *
- * In order to save memory you can use some instructions multiply,
- * since they have an immutable state and are directly derived from
- * Instruction. I.e. they have no instance fields that could be
- * changed. Since some of these instructions like ICONST_0 occur
- * very frequently this can save a lot of time and space. This
- * feature is an adaptation of the FlyWeight design pattern, we
- * just use an array instead of a factory.
- *
- * The Instructions can also accessed directly under their names, so
- * it's possible to write il.append(Instruction.ICONST_0);
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public interface InstructionConstants {
- /** Predefined instruction objects
- */
- public static final Instruction NOP = new NOP();
- public static final Instruction ACONST_NULL = new ACONST_NULL();
- public static final Instruction ICONST_M1 = new ICONST(-1);
- public static final Instruction ICONST_0 = new ICONST(0);
- public static final Instruction ICONST_1 = new ICONST(1);
- public static final Instruction ICONST_2 = new ICONST(2);
- public static final Instruction ICONST_3 = new ICONST(3);
- public static final Instruction ICONST_4 = new ICONST(4);
- public static final Instruction ICONST_5 = new ICONST(5);
- public static final Instruction LCONST_0 = new LCONST(0);
- public static final Instruction LCONST_1 = new LCONST(1);
- public static final Instruction FCONST_0 = new FCONST(0);
- public static final Instruction FCONST_1 = new FCONST(1);
- public static final Instruction FCONST_2 = new FCONST(2);
- public static final Instruction DCONST_0 = new DCONST(0);
- public static final Instruction DCONST_1 = new DCONST(1);
- public static final ArrayInstruction IALOAD = new IALOAD();
- public static final ArrayInstruction LALOAD = new LALOAD();
- public static final ArrayInstruction FALOAD = new FALOAD();
- public static final ArrayInstruction DALOAD = new DALOAD();
- public static final ArrayInstruction AALOAD = new AALOAD();
- public static final ArrayInstruction BALOAD = new BALOAD();
- public static final ArrayInstruction CALOAD = new CALOAD();
- public static final ArrayInstruction SALOAD = new SALOAD();
- public static final ArrayInstruction IASTORE = new IASTORE();
- public static final ArrayInstruction LASTORE = new LASTORE();
- public static final ArrayInstruction FASTORE = new FASTORE();
- public static final ArrayInstruction DASTORE = new DASTORE();
- public static final ArrayInstruction AASTORE = new AASTORE();
- public static final ArrayInstruction BASTORE = new BASTORE();
- public static final ArrayInstruction CASTORE = new CASTORE();
- public static final ArrayInstruction SASTORE = new SASTORE();
- public static final StackInstruction POP = new POP();
- public static final StackInstruction POP2 = new POP2();
- public static final StackInstruction DUP = new DUP();
- public static final StackInstruction DUP_X1 = new DUP_X1();
- public static final StackInstruction DUP_X2 = new DUP_X2();
- public static final StackInstruction DUP2 = new DUP2();
- public static final StackInstruction DUP2_X1 = new DUP2_X1();
- public static final StackInstruction DUP2_X2 = new DUP2_X2();
- public static final StackInstruction SWAP = new SWAP();
- public static final ArithmeticInstruction IADD = new IADD();
- public static final ArithmeticInstruction LADD = new LADD();
- public static final ArithmeticInstruction FADD = new FADD();
- public static final ArithmeticInstruction DADD = new DADD();
- public static final ArithmeticInstruction ISUB = new ISUB();
- public static final ArithmeticInstruction LSUB = new LSUB();
- public static final ArithmeticInstruction FSUB = new FSUB();
- public static final ArithmeticInstruction DSUB = new DSUB();
- public static final ArithmeticInstruction IMUL = new IMUL();
- public static final ArithmeticInstruction LMUL = new LMUL();
- public static final ArithmeticInstruction FMUL = new FMUL();
- public static final ArithmeticInstruction DMUL = new DMUL();
- public static final ArithmeticInstruction IDIV = new IDIV();
- public static final ArithmeticInstruction LDIV = new LDIV();
- public static final ArithmeticInstruction FDIV = new FDIV();
- public static final ArithmeticInstruction DDIV = new DDIV();
- public static final ArithmeticInstruction IREM = new IREM();
- public static final ArithmeticInstruction LREM = new LREM();
- public static final ArithmeticInstruction FREM = new FREM();
- public static final ArithmeticInstruction DREM = new DREM();
- public static final ArithmeticInstruction INEG = new INEG();
- public static final ArithmeticInstruction LNEG = new LNEG();
- public static final ArithmeticInstruction FNEG = new FNEG();
- public static final ArithmeticInstruction DNEG = new DNEG();
- public static final ArithmeticInstruction ISHL = new ISHL();
- public static final ArithmeticInstruction LSHL = new LSHL();
- public static final ArithmeticInstruction ISHR = new ISHR();
- public static final ArithmeticInstruction LSHR = new LSHR();
- public static final ArithmeticInstruction IUSHR = new IUSHR();
- public static final ArithmeticInstruction LUSHR = new LUSHR();
- public static final ArithmeticInstruction IAND = new IAND();
- public static final ArithmeticInstruction LAND = new LAND();
- public static final ArithmeticInstruction IOR = new IOR();
- public static final ArithmeticInstruction LOR = new LOR();
- public static final ArithmeticInstruction IXOR = new IXOR();
- public static final ArithmeticInstruction LXOR = new LXOR();
- public static final ConversionInstruction I2L = new I2L();
- public static final ConversionInstruction I2F = new I2F();
- public static final ConversionInstruction I2D = new I2D();
- public static final ConversionInstruction L2I = new L2I();
- public static final ConversionInstruction L2F = new L2F();
- public static final ConversionInstruction L2D = new L2D();
- public static final ConversionInstruction F2I = new F2I();
- public static final ConversionInstruction F2L = new F2L();
- public static final ConversionInstruction F2D = new F2D();
- public static final ConversionInstruction D2I = new D2I();
- public static final ConversionInstruction D2L = new D2L();
- public static final ConversionInstruction D2F = new D2F();
- public static final ConversionInstruction I2B = new I2B();
- public static final ConversionInstruction I2C = new I2C();
- public static final ConversionInstruction I2S = new I2S();
- public static final Instruction LCMP = new LCMP();
- public static final Instruction FCMPL = new FCMPL();
- public static final Instruction FCMPG = new FCMPG();
- public static final Instruction DCMPL = new DCMPL();
- public static final Instruction DCMPG = new DCMPG();
- public static final ReturnInstruction IRETURN = new IRETURN();
- public static final ReturnInstruction LRETURN = new LRETURN();
- public static final ReturnInstruction FRETURN = new FRETURN();
- public static final ReturnInstruction DRETURN = new DRETURN();
- public static final ReturnInstruction ARETURN = new ARETURN();
- public static final ReturnInstruction RETURN = new RETURN();
- public static final Instruction ARRAYLENGTH = new ARRAYLENGTH();
- public static final Instruction ATHROW = new ATHROW();
- public static final Instruction MONITORENTER = new MONITORENTER();
- public static final Instruction MONITOREXIT = new MONITOREXIT();
-
- /** You can use these constants in multiple places safely, if you can guarantee
- * that you will never alter their internal values, e.g. call setIndex().
- */
- public static final LocalVariableInstruction THIS = new ALOAD(0);
- public static final LocalVariableInstruction ALOAD_0 = THIS;
- public static final LocalVariableInstruction ALOAD_1 = new ALOAD(1);
- public static final LocalVariableInstruction ALOAD_2 = new ALOAD(2);
- public static final LocalVariableInstruction ILOAD_0 = new ILOAD(0);
- public static final LocalVariableInstruction ILOAD_1 = new ILOAD(1);
- public static final LocalVariableInstruction ILOAD_2 = new ILOAD(2);
- public static final LocalVariableInstruction ASTORE_0 = new ASTORE(0);
- public static final LocalVariableInstruction ASTORE_1 = new ASTORE(1);
- public static final LocalVariableInstruction ASTORE_2 = new ASTORE(2);
- public static final LocalVariableInstruction ISTORE_0 = new ISTORE(0);
- public static final LocalVariableInstruction ISTORE_1 = new ISTORE(1);
- public static final LocalVariableInstruction ISTORE_2 = new ISTORE(2);
-
-
- /** Get object via its opcode, for immutable instructions like
- * branch instructions entries are set to null.
- */
- public static final Instruction[] INSTRUCTIONS = new Instruction[256];
-
- /** Interfaces may have no static initializers, so we simulate this
- * with an inner class.
- */
- static final Clinit bla = new Clinit();
-
- static class Clinit {
- Clinit() {
- INSTRUCTIONS[Constants.NOP] = NOP;
- INSTRUCTIONS[Constants.ACONST_NULL] = ACONST_NULL;
- INSTRUCTIONS[Constants.ICONST_M1] = ICONST_M1;
- INSTRUCTIONS[Constants.ICONST_0] = ICONST_0;
- INSTRUCTIONS[Constants.ICONST_1] = ICONST_1;
- INSTRUCTIONS[Constants.ICONST_2] = ICONST_2;
- INSTRUCTIONS[Constants.ICONST_3] = ICONST_3;
- INSTRUCTIONS[Constants.ICONST_4] = ICONST_4;
- INSTRUCTIONS[Constants.ICONST_5] = ICONST_5;
- INSTRUCTIONS[Constants.LCONST_0] = LCONST_0;
- INSTRUCTIONS[Constants.LCONST_1] = LCONST_1;
- INSTRUCTIONS[Constants.FCONST_0] = FCONST_0;
- INSTRUCTIONS[Constants.FCONST_1] = FCONST_1;
- INSTRUCTIONS[Constants.FCONST_2] = FCONST_2;
- INSTRUCTIONS[Constants.DCONST_0] = DCONST_0;
- INSTRUCTIONS[Constants.DCONST_1] = DCONST_1;
- INSTRUCTIONS[Constants.IALOAD] = IALOAD;
- INSTRUCTIONS[Constants.LALOAD] = LALOAD;
- INSTRUCTIONS[Constants.FALOAD] = FALOAD;
- INSTRUCTIONS[Constants.DALOAD] = DALOAD;
- INSTRUCTIONS[Constants.AALOAD] = AALOAD;
- INSTRUCTIONS[Constants.BALOAD] = BALOAD;
- INSTRUCTIONS[Constants.CALOAD] = CALOAD;
- INSTRUCTIONS[Constants.SALOAD] = SALOAD;
- INSTRUCTIONS[Constants.IASTORE] = IASTORE;
- INSTRUCTIONS[Constants.LASTORE] = LASTORE;
- INSTRUCTIONS[Constants.FASTORE] = FASTORE;
- INSTRUCTIONS[Constants.DASTORE] = DASTORE;
- INSTRUCTIONS[Constants.AASTORE] = AASTORE;
- INSTRUCTIONS[Constants.BASTORE] = BASTORE;
- INSTRUCTIONS[Constants.CASTORE] = CASTORE;
- INSTRUCTIONS[Constants.SASTORE] = SASTORE;
- INSTRUCTIONS[Constants.POP] = POP;
- INSTRUCTIONS[Constants.POP2] = POP2;
- INSTRUCTIONS[Constants.DUP] = DUP;
- INSTRUCTIONS[Constants.DUP_X1] = DUP_X1;
- INSTRUCTIONS[Constants.DUP_X2] = DUP_X2;
- INSTRUCTIONS[Constants.DUP2] = DUP2;
- INSTRUCTIONS[Constants.DUP2_X1] = DUP2_X1;
- INSTRUCTIONS[Constants.DUP2_X2] = DUP2_X2;
- INSTRUCTIONS[Constants.SWAP] = SWAP;
- INSTRUCTIONS[Constants.IADD] = IADD;
- INSTRUCTIONS[Constants.LADD] = LADD;
- INSTRUCTIONS[Constants.FADD] = FADD;
- INSTRUCTIONS[Constants.DADD] = DADD;
- INSTRUCTIONS[Constants.ISUB] = ISUB;
- INSTRUCTIONS[Constants.LSUB] = LSUB;
- INSTRUCTIONS[Constants.FSUB] = FSUB;
- INSTRUCTIONS[Constants.DSUB] = DSUB;
- INSTRUCTIONS[Constants.IMUL] = IMUL;
- INSTRUCTIONS[Constants.LMUL] = LMUL;
- INSTRUCTIONS[Constants.FMUL] = FMUL;
- INSTRUCTIONS[Constants.DMUL] = DMUL;
- INSTRUCTIONS[Constants.IDIV] = IDIV;
- INSTRUCTIONS[Constants.LDIV] = LDIV;
- INSTRUCTIONS[Constants.FDIV] = FDIV;
- INSTRUCTIONS[Constants.DDIV] = DDIV;
- INSTRUCTIONS[Constants.IREM] = IREM;
- INSTRUCTIONS[Constants.LREM] = LREM;
- INSTRUCTIONS[Constants.FREM] = FREM;
- INSTRUCTIONS[Constants.DREM] = DREM;
- INSTRUCTIONS[Constants.INEG] = INEG;
- INSTRUCTIONS[Constants.LNEG] = LNEG;
- INSTRUCTIONS[Constants.FNEG] = FNEG;
- INSTRUCTIONS[Constants.DNEG] = DNEG;
- INSTRUCTIONS[Constants.ISHL] = ISHL;
- INSTRUCTIONS[Constants.LSHL] = LSHL;
- INSTRUCTIONS[Constants.ISHR] = ISHR;
- INSTRUCTIONS[Constants.LSHR] = LSHR;
- INSTRUCTIONS[Constants.IUSHR] = IUSHR;
- INSTRUCTIONS[Constants.LUSHR] = LUSHR;
- INSTRUCTIONS[Constants.IAND] = IAND;
- INSTRUCTIONS[Constants.LAND] = LAND;
- INSTRUCTIONS[Constants.IOR] = IOR;
- INSTRUCTIONS[Constants.LOR] = LOR;
- INSTRUCTIONS[Constants.IXOR] = IXOR;
- INSTRUCTIONS[Constants.LXOR] = LXOR;
- INSTRUCTIONS[Constants.I2L] = I2L;
- INSTRUCTIONS[Constants.I2F] = I2F;
- INSTRUCTIONS[Constants.I2D] = I2D;
- INSTRUCTIONS[Constants.L2I] = L2I;
- INSTRUCTIONS[Constants.L2F] = L2F;
- INSTRUCTIONS[Constants.L2D] = L2D;
- INSTRUCTIONS[Constants.F2I] = F2I;
- INSTRUCTIONS[Constants.F2L] = F2L;
- INSTRUCTIONS[Constants.F2D] = F2D;
- INSTRUCTIONS[Constants.D2I] = D2I;
- INSTRUCTIONS[Constants.D2L] = D2L;
- INSTRUCTIONS[Constants.D2F] = D2F;
- INSTRUCTIONS[Constants.I2B] = I2B;
- INSTRUCTIONS[Constants.I2C] = I2C;
- INSTRUCTIONS[Constants.I2S] = I2S;
- INSTRUCTIONS[Constants.LCMP] = LCMP;
- INSTRUCTIONS[Constants.FCMPL] = FCMPL;
- INSTRUCTIONS[Constants.FCMPG] = FCMPG;
- INSTRUCTIONS[Constants.DCMPL] = DCMPL;
- INSTRUCTIONS[Constants.DCMPG] = DCMPG;
- INSTRUCTIONS[Constants.IRETURN] = IRETURN;
- INSTRUCTIONS[Constants.LRETURN] = LRETURN;
- INSTRUCTIONS[Constants.FRETURN] = FRETURN;
- INSTRUCTIONS[Constants.DRETURN] = DRETURN;
- INSTRUCTIONS[Constants.ARETURN] = ARETURN;
- INSTRUCTIONS[Constants.RETURN] = RETURN;
- INSTRUCTIONS[Constants.ARRAYLENGTH] = ARRAYLENGTH;
- INSTRUCTIONS[Constants.ATHROW] = ATHROW;
- INSTRUCTIONS[Constants.MONITORENTER] = MONITORENTER;
- INSTRUCTIONS[Constants.MONITOREXIT] = MONITOREXIT;
- }
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/InstructionFactory.java b/src/com/sun/org/apache/bcel/internal/generic/InstructionFactory.java
deleted file mode 100644
index f7378aa..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/InstructionFactory.java
+++ /dev/null
@@ -1,626 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import com.sun.org.apache.bcel.internal.Constants;
-
-/**
- * Instances of this class may be used, e.g., to generate typed
- * versions of instructions. Its main purpose is to be used as the
- * byte code generating backend of a compiler. You can subclass it to
- * add your own create methods.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see Constants
- */
-public class InstructionFactory
- implements InstructionConstants, java.io.Serializable
-{
- protected ClassGen cg;
- protected ConstantPoolGen cp;
-
- public InstructionFactory(ClassGen cg, ConstantPoolGen cp) {
- this.cg = cg;
- this.cp = cp;
- }
-
- /** Initialize with ClassGen object
- */
- public InstructionFactory(ClassGen cg) {
- this(cg, cg.getConstantPool());
- }
-
- /** Initialize just with ConstantPoolGen object
- */
- public InstructionFactory(ConstantPoolGen cp) {
- this(null, cp);
- }
-
- /** Create an invoke instruction.
- *
- * @param class_name name of the called class
- * @param name name of the called method
- * @param ret_type return type of method
- * @param arg_types argument types of method
- * @param kind how to invoke, i.e., INVOKEINTERFACE, INVOKESTATIC, INVOKEVIRTUAL,
- * or INVOKESPECIAL
- * @see Constants
- */
- public InvokeInstruction createInvoke(String class_name, String name, Type ret_type,
- Type[] arg_types, short kind) {
- int index;
- int nargs = 0;
- String signature = Type.getMethodSignature(ret_type, arg_types);
-
- for(int i=0; i < arg_types.length; i++) // Count size of arguments
- nargs += arg_types[i].getSize();
-
- if(kind == Constants.INVOKEINTERFACE)
- index = cp.addInterfaceMethodref(class_name, name, signature);
- else
- index = cp.addMethodref(class_name, name, signature);
-
- switch(kind) {
- case Constants.INVOKESPECIAL: return new INVOKESPECIAL(index);
- case Constants.INVOKEVIRTUAL: return new INVOKEVIRTUAL(index);
- case Constants.INVOKESTATIC: return new INVOKESTATIC(index);
- case Constants.INVOKEINTERFACE: return new INVOKEINTERFACE(index, nargs + 1);
- default:
- throw new RuntimeException("Oops: Unknown invoke kind:" + kind);
- }
- }
-
- /** Create a call to the most popular System.out.println() method.
- *
- * @param s the string to print
- */
- public InstructionList createPrintln(String s) {
- InstructionList il = new InstructionList();
- int out = cp.addFieldref("java.lang.System", "out",
- "Ljava/io/PrintStream;");
- int println = cp.addMethodref("java.io.PrintStream", "println",
- "(Ljava/lang/String;)V");
-
- il.append(new GETSTATIC(out));
- il.append(new PUSH(cp, s));
- il.append(new INVOKEVIRTUAL(println));
-
- return il;
- }
-
- /** Uses PUSH to push a constant value onto the stack.
- * @param value must be of type Number, Boolean, Character or String
- */
- public Instruction createConstant(Object value) {
- PUSH push;
-
- if(value instanceof Number)
- push = new PUSH(cp, (Number)value);
- else if(value instanceof String)
- push = new PUSH(cp, (String)value);
- else if(value instanceof Boolean)
- push = new PUSH(cp, (Boolean)value);
- else if(value instanceof Character)
- push = new PUSH(cp, (Character)value);
- else
- throw new ClassGenException("Illegal type: " + value.getClass());
-
- return push.getInstruction();
- }
-
- private static class MethodObject {
- Type[] arg_types;
- Type result_type;
- String[] arg_names;
- String class_name;
- String name;
- int access;
-
- MethodObject(String c, String n, Type r, Type[] a, int acc) {
- class_name = c;
- name = n;
- result_type = r;
- arg_types = a;
- access = acc;
- }
- }
-
- private InvokeInstruction createInvoke(MethodObject m, short kind) {
- return createInvoke(m.class_name, m.name, m.result_type, m.arg_types, kind);
- }
-
- private static MethodObject[] append_mos = {
- new MethodObject("java.lang.StringBuffer", "append", Type.STRINGBUFFER,
- new Type[] { Type.STRING }, Constants.ACC_PUBLIC),
- new MethodObject("java.lang.StringBuffer", "append", Type.STRINGBUFFER,
- new Type[] { Type.OBJECT }, Constants.ACC_PUBLIC),
- null, null, // indices 2, 3
- new MethodObject("java.lang.StringBuffer", "append", Type.STRINGBUFFER,
- new Type[] { Type.BOOLEAN }, Constants.ACC_PUBLIC),
- new MethodObject("java.lang.StringBuffer", "append", Type.STRINGBUFFER,
- new Type[] { Type.CHAR }, Constants.ACC_PUBLIC),
- new MethodObject("java.lang.StringBuffer", "append", Type.STRINGBUFFER,
- new Type[] { Type.FLOAT }, Constants.ACC_PUBLIC),
- new MethodObject("java.lang.StringBuffer", "append", Type.STRINGBUFFER,
- new Type[] { Type.DOUBLE }, Constants.ACC_PUBLIC),
- new MethodObject("java.lang.StringBuffer", "append", Type.STRINGBUFFER,
- new Type[] { Type.INT }, Constants.ACC_PUBLIC),
- new MethodObject("java.lang.StringBuffer", "append", Type.STRINGBUFFER, // No append(byte)
- new Type[] { Type.INT }, Constants.ACC_PUBLIC),
- new MethodObject("java.lang.StringBuffer", "append", Type.STRINGBUFFER, // No append(short)
- new Type[] { Type.INT }, Constants.ACC_PUBLIC),
- new MethodObject("java.lang.StringBuffer", "append", Type.STRINGBUFFER,
- new Type[] { Type.LONG }, Constants.ACC_PUBLIC)
- };
-
- private static final boolean isString(Type type) {
- return ((type instanceof ObjectType) &&
- ((ObjectType)type).getClassName().equals("java.lang.String"));
- }
-
- public Instruction createAppend(Type type) {
- byte t = type.getType();
-
- if(isString(type))
- return createInvoke(append_mos[0], Constants.INVOKEVIRTUAL);
-
- switch(t) {
- case Constants.T_BOOLEAN:
- case Constants.T_CHAR:
- case Constants.T_FLOAT:
- case Constants.T_DOUBLE:
- case Constants.T_BYTE:
- case Constants.T_SHORT:
- case Constants.T_INT:
- case Constants.T_LONG
- : return createInvoke(append_mos[t], Constants.INVOKEVIRTUAL);
- case Constants.T_ARRAY:
- case Constants.T_OBJECT:
- return createInvoke(append_mos[1], Constants.INVOKEVIRTUAL);
- default:
- throw new RuntimeException("Oops: No append for this type? " + type);
- }
- }
-
- /** Create a field instruction.
- *
- * @param class_name name of the accessed class
- * @param name name of the referenced field
- * @param type type of field
- * @param kind how to access, i.e., GETFIELD, PUTFIELD, GETSTATIC, PUTSTATIC
- * @see Constants
- */
- public FieldInstruction createFieldAccess(String class_name, String name, Type type, short kind) {
- int index;
- String signature = type.getSignature();
-
- index = cp.addFieldref(class_name, name, signature);
-
- switch(kind) {
- case Constants.GETFIELD: return new GETFIELD(index);
- case Constants.PUTFIELD: return new PUTFIELD(index);
- case Constants.GETSTATIC: return new GETSTATIC(index);
- case Constants.PUTSTATIC: return new PUTSTATIC(index);
-
- default:
- throw new RuntimeException("Oops: Unknown getfield kind:" + kind);
- }
- }
-
- /** Create reference to `this'
- */
- public static Instruction createThis() {
- return new ALOAD(0);
- }
-
- /** Create typed return
- */
- public static ReturnInstruction createReturn(Type type) {
- switch(type.getType()) {
- case Constants.T_ARRAY:
- case Constants.T_OBJECT: return ARETURN;
- case Constants.T_INT:
- case Constants.T_SHORT:
- case Constants.T_BOOLEAN:
- case Constants.T_CHAR:
- case Constants.T_BYTE: return IRETURN;
- case Constants.T_FLOAT: return FRETURN;
- case Constants.T_DOUBLE: return DRETURN;
- case Constants.T_LONG: return LRETURN;
- case Constants.T_VOID: return RETURN;
-
- default:
- throw new RuntimeException("Invalid type: " + type);
- }
- }
-
- private static final ArithmeticInstruction createBinaryIntOp(char first, String op) {
- switch(first) {
- case '-' : return ISUB;
- case '+' : return IADD;
- case '%' : return IREM;
- case '*' : return IMUL;
- case '/' : return IDIV;
- case '&' : return IAND;
- case '|' : return IOR;
- case '^' : return IXOR;
- case '<' : return ISHL;
- case '>' : return op.equals(">>>")? (ArithmeticInstruction)IUSHR :
- (ArithmeticInstruction)ISHR;
- default: throw new RuntimeException("Invalid operand " + op);
- }
- }
-
- private static final ArithmeticInstruction createBinaryLongOp(char first, String op) {
- switch(first) {
- case '-' : return LSUB;
- case '+' : return LADD;
- case '%' : return LREM;
- case '*' : return LMUL;
- case '/' : return LDIV;
- case '&' : return LAND;
- case '|' : return LOR;
- case '^' : return LXOR;
- case '<' : return LSHL;
- case '>' : return op.equals(">>>")? (ArithmeticInstruction)LUSHR :
- (ArithmeticInstruction)LSHR;
- default: throw new RuntimeException("Invalid operand " + op);
- }
- }
-
- private static final ArithmeticInstruction createBinaryFloatOp(char op) {
- switch(op) {
- case '-' : return FSUB;
- case '+' : return FADD;
- case '*' : return FMUL;
- case '/' : return FDIV;
- default: throw new RuntimeException("Invalid operand " + op);
- }
- }
-
- private static final ArithmeticInstruction createBinaryDoubleOp(char op) {
- switch(op) {
- case '-' : return DSUB;
- case '+' : return DADD;
- case '*' : return DMUL;
- case '/' : return DDIV;
- default: throw new RuntimeException("Invalid operand " + op);
- }
- }
-
- /**
- * Create binary operation for simple basic types, such as int and float.
- *
- * @param op operation, such as "+", "*", "<<", etc.
- */
- public static ArithmeticInstruction createBinaryOperation(String op, Type type) {
- char first = op.toCharArray()[0];
-
- switch(type.getType()) {
- case Constants.T_BYTE:
- case Constants.T_SHORT:
- case Constants.T_INT:
- case Constants.T_CHAR: return createBinaryIntOp(first, op);
- case Constants.T_LONG: return createBinaryLongOp(first, op);
- case Constants.T_FLOAT: return createBinaryFloatOp(first);
- case Constants.T_DOUBLE: return createBinaryDoubleOp(first);
- default: throw new RuntimeException("Invalid type " + type);
- }
- }
-
- /**
- * @param size size of operand, either 1 (int, e.g.) or 2 (double)
- */
- public static StackInstruction createPop(int size) {
- return (size == 2)? (StackInstruction)POP2 :
- (StackInstruction)POP;
- }
-
- /**
- * @param size size of operand, either 1 (int, e.g.) or 2 (double)
- */
- public static StackInstruction createDup(int size) {
- return (size == 2)? (StackInstruction)DUP2 :
- (StackInstruction)DUP;
- }
-
- /**
- * @param size size of operand, either 1 (int, e.g.) or 2 (double)
- */
- public static StackInstruction createDup_2(int size) {
- return (size == 2)? (StackInstruction)DUP2_X2 :
- (StackInstruction)DUP_X2;
- }
-
- /**
- * @param size size of operand, either 1 (int, e.g.) or 2 (double)
- */
- public static StackInstruction createDup_1(int size) {
- return (size == 2)? (StackInstruction)DUP2_X1 :
- (StackInstruction)DUP_X1;
- }
-
- /**
- * @param index index of local variable
- */
- public static LocalVariableInstruction createStore(Type type, int index) {
- switch(type.getType()) {
- case Constants.T_BOOLEAN:
- case Constants.T_CHAR:
- case Constants.T_BYTE:
- case Constants.T_SHORT:
- case Constants.T_INT: return new ISTORE(index);
- case Constants.T_FLOAT: return new FSTORE(index);
- case Constants.T_DOUBLE: return new DSTORE(index);
- case Constants.T_LONG: return new LSTORE(index);
- case Constants.T_ARRAY:
- case Constants.T_OBJECT: return new ASTORE(index);
- default: throw new RuntimeException("Invalid type " + type);
- }
- }
-
- /**
- * @param index index of local variable
- */
- public static LocalVariableInstruction createLoad(Type type, int index) {
- switch(type.getType()) {
- case Constants.T_BOOLEAN:
- case Constants.T_CHAR:
- case Constants.T_BYTE:
- case Constants.T_SHORT:
- case Constants.T_INT: return new ILOAD(index);
- case Constants.T_FLOAT: return new FLOAD(index);
- case Constants.T_DOUBLE: return new DLOAD(index);
- case Constants.T_LONG: return new LLOAD(index);
- case Constants.T_ARRAY:
- case Constants.T_OBJECT: return new ALOAD(index);
- default: throw new RuntimeException("Invalid type " + type);
- }
- }
-
- /**
- * @param type type of elements of array, i.e., array.getElementType()
- */
- public static ArrayInstruction createArrayLoad(Type type) {
- switch(type.getType()) {
- case Constants.T_BOOLEAN:
- case Constants.T_BYTE: return BALOAD;
- case Constants.T_CHAR: return CALOAD;
- case Constants.T_SHORT: return SALOAD;
- case Constants.T_INT: return IALOAD;
- case Constants.T_FLOAT: return FALOAD;
- case Constants.T_DOUBLE: return DALOAD;
- case Constants.T_LONG: return LALOAD;
- case Constants.T_ARRAY:
- case Constants.T_OBJECT: return AALOAD;
- default: throw new RuntimeException("Invalid type " + type);
- }
- }
-
- /**
- * @param type type of elements of array, i.e., array.getElementType()
- */
- public static ArrayInstruction createArrayStore(Type type) {
- switch(type.getType()) {
- case Constants.T_BOOLEAN:
- case Constants.T_BYTE: return BASTORE;
- case Constants.T_CHAR: return CASTORE;
- case Constants.T_SHORT: return SASTORE;
- case Constants.T_INT: return IASTORE;
- case Constants.T_FLOAT: return FASTORE;
- case Constants.T_DOUBLE: return DASTORE;
- case Constants.T_LONG: return LASTORE;
- case Constants.T_ARRAY:
- case Constants.T_OBJECT: return AASTORE;
- default: throw new RuntimeException("Invalid type " + type);
- }
- }
-
-
- /** Create conversion operation for two stack operands, this may be an I2C, instruction, e.g.,
- * if the operands are basic types and CHECKCAST if they are reference types.
- */
- public Instruction createCast(Type src_type, Type dest_type) {
- if((src_type instanceof BasicType) && (dest_type instanceof BasicType)) {
- byte dest = dest_type.getType();
- byte src = src_type.getType();
-
- if(dest == Constants.T_LONG && (src == Constants.T_CHAR || src == Constants.T_BYTE ||
- src == Constants.T_SHORT))
- src = Constants.T_INT;
-
- String[] short_names = { "C", "F", "D", "B", "S", "I", "L" };
-
- String name = "com.sun.org.apache.bcel.internal.generic." + short_names[src - Constants.T_CHAR] +
- "2" + short_names[dest - Constants.T_CHAR];
-
- Instruction i = null;
- try {
- i = (Instruction)java.lang.Class.forName(name).newInstance();
- } catch(Exception e) {
- throw new RuntimeException("Could not find instruction: " + name);
- }
-
- return i;
- } else if((src_type instanceof ReferenceType) && (dest_type instanceof ReferenceType)) {
- if(dest_type instanceof ArrayType)
- return new CHECKCAST(cp.addArrayClass((ArrayType)dest_type));
- else
- return new CHECKCAST(cp.addClass(((ObjectType)dest_type).getClassName()));
- }
- else
- throw new RuntimeException("Can not cast " + src_type + " to " + dest_type);
- }
-
- public GETFIELD createGetField(String class_name, String name, Type t) {
- return new GETFIELD(cp.addFieldref(class_name, name, t.getSignature()));
- }
-
- public GETSTATIC createGetStatic(String class_name, String name, Type t) {
- return new GETSTATIC(cp.addFieldref(class_name, name, t.getSignature()));
- }
-
- public PUTFIELD createPutField(String class_name, String name, Type t) {
- return new PUTFIELD(cp.addFieldref(class_name, name, t.getSignature()));
- }
-
- public PUTSTATIC createPutStatic(String class_name, String name, Type t) {
- return new PUTSTATIC(cp.addFieldref(class_name, name, t.getSignature()));
- }
-
- public CHECKCAST createCheckCast(ReferenceType t) {
- if(t instanceof ArrayType)
- return new CHECKCAST(cp.addArrayClass((ArrayType)t));
- else
- return new CHECKCAST(cp.addClass((ObjectType)t));
- }
-
- public INSTANCEOF createInstanceOf(ReferenceType t) {
- if(t instanceof ArrayType)
- return new INSTANCEOF(cp.addArrayClass((ArrayType)t));
- else
- return new INSTANCEOF(cp.addClass((ObjectType)t));
- }
-
- public NEW createNew(ObjectType t) {
- return new NEW(cp.addClass(t));
- }
-
- public NEW createNew(String s) {
- return createNew(new ObjectType(s));
- }
-
- /** Create new array of given size and type.
- * @return an instruction that creates the corresponding array at runtime, i.e. is an AllocationInstruction
- */
- public Instruction createNewArray(Type t, short dim) {
- if(dim == 1) {
- if(t instanceof ObjectType)
- return new ANEWARRAY(cp.addClass((ObjectType)t));
- else if(t instanceof ArrayType)
- return new ANEWARRAY(cp.addArrayClass((ArrayType)t));
- else
- return new NEWARRAY(((BasicType)t).getType());
- } else {
- ArrayType at;
-
- if(t instanceof ArrayType)
- at = (ArrayType)t;
- else
- at = new ArrayType(t, dim);
-
- return new MULTIANEWARRAY(cp.addArrayClass(at), dim);
- }
- }
-
- /** Create "null" value for reference types, 0 for basic types like int
- */
- public static Instruction createNull(Type type) {
- switch(type.getType()) {
- case Constants.T_ARRAY:
- case Constants.T_OBJECT: return ACONST_NULL;
- case Constants.T_INT:
- case Constants.T_SHORT:
- case Constants.T_BOOLEAN:
- case Constants.T_CHAR:
- case Constants.T_BYTE: return ICONST_0;
- case Constants.T_FLOAT: return FCONST_0;
- case Constants.T_DOUBLE: return DCONST_0;
- case Constants.T_LONG: return LCONST_0;
- case Constants.T_VOID: return NOP;
-
- default:
- throw new RuntimeException("Invalid type: " + type);
- }
- }
-
- /** Create branch instruction by given opcode, except LOOKUPSWITCH and TABLESWITCH.
- * For those you should use the SWITCH compound instruction.
- */
- public static BranchInstruction createBranchInstruction(short opcode, InstructionHandle target) {
- switch(opcode) {
- case Constants.IFEQ: return new IFEQ(target);
- case Constants.IFNE: return new IFNE(target);
- case Constants.IFLT: return new IFLT(target);
- case Constants.IFGE: return new IFGE(target);
- case Constants.IFGT: return new IFGT(target);
- case Constants.IFLE: return new IFLE(target);
- case Constants.IF_ICMPEQ: return new IF_ICMPEQ(target);
- case Constants.IF_ICMPNE: return new IF_ICMPNE(target);
- case Constants.IF_ICMPLT: return new IF_ICMPLT(target);
- case Constants.IF_ICMPGE: return new IF_ICMPGE(target);
- case Constants.IF_ICMPGT: return new IF_ICMPGT(target);
- case Constants.IF_ICMPLE: return new IF_ICMPLE(target);
- case Constants.IF_ACMPEQ: return new IF_ACMPEQ(target);
- case Constants.IF_ACMPNE: return new IF_ACMPNE(target);
- case Constants.GOTO: return new GOTO(target);
- case Constants.JSR: return new JSR(target);
- case Constants.IFNULL: return new IFNULL(target);
- case Constants.IFNONNULL: return new IFNONNULL(target);
- case Constants.GOTO_W: return new GOTO_W(target);
- case Constants.JSR_W: return new JSR_W(target);
- default:
- throw new RuntimeException("Invalid opcode: " + opcode);
- }
- }
-
- public void setClassGen(ClassGen c) { cg = c; }
- public ClassGen getClassGen() { return cg; }
- public void setConstantPool(ConstantPoolGen c) { cp = c; }
- public ConstantPoolGen getConstantPool() { return cp; }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/InstructionHandle.java b/src/com/sun/org/apache/bcel/internal/generic/InstructionHandle.java
deleted file mode 100644
index 6594e01..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/InstructionHandle.java
+++ /dev/null
@@ -1,287 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.classfile.Utility;
-import java.util.HashSet;
-import java.util.Collection;
-import java.util.HashMap;
-
-/**
- * Instances of this class give users a handle to the instructions contained in
- * an InstructionList. Instruction objects may be used more than once within a
- * list, this is useful because it saves memory and may be much faster.
- *
- * Within an InstructionList an InstructionHandle object is wrapped
- * around all instructions, i.e., it implements a cell in a
- * doubly-linked list. From the outside only the next and the
- * previous instruction (handle) are accessible. One
- * can traverse the list via an Enumeration returned by
- * InstructionList.elements().
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see Instruction
- * @see BranchHandle
- * @see InstructionList
- */
-public class InstructionHandle implements java.io.Serializable {
- InstructionHandle next, prev; // Will be set from the outside
- Instruction instruction;
- protected int i_position = -1; // byte code offset of instruction
- private HashSet targeters;
- private HashMap attributes;
-
- public final InstructionHandle getNext() { return next; }
- public final InstructionHandle getPrev() { return prev; }
- public final Instruction getInstruction() { return instruction; }
-
- /**
- * Replace current instruction contained in this handle.
- * Old instruction is disposed using Instruction.dispose().
- */
- public void setInstruction(Instruction i) { // Overridden in BranchHandle
- if(i == null)
- throw new ClassGenException("Assigning null to handle");
-
- if((this.getClass() != BranchHandle.class) && (i instanceof BranchInstruction))
- throw new ClassGenException("Assigning branch instruction " + i + " to plain handle");
-
- if(instruction != null)
- instruction.dispose();
-
- instruction = i;
- }
-
- /**
- * Temporarily swap the current instruction, without disturbing
- * anything. Meant to be used by a debugger, implementing
- * breakpoints. Current instruction is returned.
- */
- public Instruction swapInstruction(Instruction i) {
- Instruction oldInstruction = instruction;
- instruction = i;
- return oldInstruction;
- }
-
- /*private*/ protected InstructionHandle(Instruction i) {
- setInstruction(i);
- }
-
- private static InstructionHandle ih_list = null; // List of reusable handles
-
- /** Factory method.
- */
- static final InstructionHandle getInstructionHandle(Instruction i) {
- if(ih_list == null)
- return new InstructionHandle(i);
- else {
- InstructionHandle ih = ih_list;
- ih_list = ih.next;
-
- ih.setInstruction(i);
-
- return ih;
- }
- }
-
- /**
- * Called by InstructionList.setPositions when setting the position for every
- * instruction. In the presence of variable length instructions `setPositions()'
- * performs multiple passes over the instruction list to calculate the
- * correct (byte) positions and offsets by calling this function.
- *
- * @param offset additional offset caused by preceding (variable length) instructions
- * @param max_offset the maximum offset that may be caused by these instructions
- * @return additional offset caused by possible change of this instruction's length
- */
- protected int updatePosition(int offset, int max_offset) {
- i_position += offset;
- return 0;
- }
-
- /** @return the position, i.e., the byte code offset of the contained
- * instruction. This is accurate only after
- * InstructionList.setPositions() has been called.
- */
- public int getPosition() { return i_position; }
-
- /** Set the position, i.e., the byte code offset of the contained
- * instruction.
- */
- void setPosition(int pos) { i_position = pos; }
-
- /** Overridden in BranchHandle
- */
- protected void addHandle() {
- next = ih_list;
- ih_list = this;
- }
-
- /**
- * Delete contents, i.e., remove user access and make handle reusable.
- */
- void dispose() {
- next = prev = null;
- instruction.dispose();
- instruction = null;
- i_position = -1;
- attributes = null;
- removeAllTargeters();
- addHandle();
- }
-
- /** Remove all targeters, if any.
- */
- public void removeAllTargeters() {
- if(targeters != null)
- targeters.clear();
- }
-
- /**
- * Denote this handle isn't referenced anymore by t.
- */
- public void removeTargeter(InstructionTargeter t) {
- targeters.remove(t);
- }
-
- /**
- * Denote this handle is being referenced by t.
- */
- public void addTargeter(InstructionTargeter t) {
- if(targeters == null)
- targeters = new HashSet();
-
- //if(!targeters.contains(t))
- targeters.add(t);
- }
-
- public boolean hasTargeters() {
- return (targeters != null) && (targeters.size() > 0);
- }
-
- /**
- * @return null, if there are no targeters
- */
- public InstructionTargeter[] getTargeters() {
- if(!hasTargeters())
- return null;
-
- InstructionTargeter[] t = new InstructionTargeter[targeters.size()];
- targeters.toArray(t);
- return t;
- }
-
- /** @return a (verbose) string representation of the contained instruction.
- */
- public String toString(boolean verbose) {
- return Utility.format(i_position, 4, false, ' ') + ": " + instruction.toString(verbose);
- }
-
- /** @return a string representation of the contained instruction.
- */
- public String toString() {
- return toString(true);
- }
-
- /** Add an attribute to an instruction handle.
- *
- * @param key the key object to store/retrieve the attribute
- * @param attr the attribute to associate with this handle
- */
- public void addAttribute(Object key, Object attr) {
- if(attributes == null)
- attributes = new HashMap(3);
-
- attributes.put(key, attr);
- }
-
- /** Delete an attribute of an instruction handle.
- *
- * @param key the key object to retrieve the attribute
- */
- public void removeAttribute(Object key) {
- if(attributes != null)
- attributes.remove(key);
- }
-
- /** Get attribute of an instruction handle.
- *
- * @param key the key object to store/retrieve the attribute
- */
- public Object getAttribute(Object key) {
- if(attributes != null)
- return attributes.get(key);
-
- return null;
- }
-
- /** @return all attributes associated with this handle
- */
- public Collection getAttributes() {
- return attributes.values();
- }
-
- /** Convenience method, simply calls accept() on the contained instruction.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- instruction.accept(v);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/InstructionList.java b/src/com/sun/org/apache/bcel/internal/generic/InstructionList.java
deleted file mode 100644
index 235950f..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/InstructionList.java
+++ /dev/null
@@ -1,1289 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import com.sun.org.apache.bcel.internal.classfile.Constant;
-import com.sun.org.apache.bcel.internal.util.ByteSequence;
-import java.io.*;
-import java.util.Iterator;
-import java.util.HashMap;
-import java.util.ArrayList;
-
-/**
- * This class is a container for a list of <a
- * href="Instruction.html">Instruction</a> objects. Instructions can
- * be appended, inserted, moved, deleted, etc.. Instructions are being
- * wrapped into <a
- * href="InstructionHandle.html">InstructionHandles</a> objects that
- * are returned upon append/insert operations. They give the user
- * (read only) access to the list structure, such that it can be traversed and
- * manipulated in a controlled way.
- *
- * A list is finally dumped to a byte code array with <a
- * href="#getByteCode()">getByteCode</a>.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see Instruction
- * @see InstructionHandle
- * @see BranchHandle
- */
-public class InstructionList implements Serializable {
- private InstructionHandle start = null, end = null;
- private int length = 0; // number of elements in list
- private int[] byte_positions; // byte code offsets corresponding to instructions
-
- /**
- * Create (empty) instruction list.
- */
- public InstructionList() {}
-
- /**
- * Create instruction list containing one instruction.
- * @param i initial instruction
- */
- public InstructionList(Instruction i) {
- append(i);
- }
-
- /**
- * Create instruction list containing one instruction.
- * @param i initial instruction
- */
- public InstructionList(BranchInstruction i) {
- append(i);
- }
-
- /**
- * Initialize list with (nonnull) compound instruction. Consumes argument
- * list, i.e., it becomes empty.
- *
- * @param c compound instruction (list)
- */
- public InstructionList(CompoundInstruction c) {
- append(c.getInstructionList());
- }
-
- /**
- * Test for empty list.
- */
- public boolean isEmpty() { return start == null; } // && end == null
-
- /**
- * Find the target instruction (handle) that corresponds to the given target
- * position (byte code offset).
- *
- * @param ihs array of instruction handles, i.e. il.getInstructionHandles()
- * @param pos array of positions corresponding to ihs, i.e. il.getInstructionPositions()
- * @param count length of arrays
- * @param target target position to search for
- * @return target position's instruction handle if available
- */
- public static InstructionHandle findHandle(InstructionHandle[] ihs,
- int[] pos, int count,
- int target) {
- int l=0, r = count - 1;
-
- /* Do a binary search since the pos array is orderd.
- */
- do {
- int i = (l + r) / 2;
- int j = pos[i];
-
- if(j == target) // target found
- return ihs[i];
- else if(target < j) // else constrain search area
- r = i - 1;
- else // target > j
- l = i + 1;
- } while(l <= r);
-
- return null;
- }
-
- /**
- * Get instruction handle for instruction at byte code position pos.
- * This only works properly, if the list is freshly initialized from a byte array or
- * setPositions() has been called before this method.
- *
- * @param pos byte code position to search for
- * @return target position's instruction handle if available
- */
- public InstructionHandle findHandle(int pos) {
- InstructionHandle[] ihs = getInstructionHandles();
- return findHandle(ihs, byte_positions, length, pos);
- }
-
- /**
- * Initialize instruction list from byte array.
- *
- * @param code byte array containing the instructions
- */
- public InstructionList(byte[] code) {
- ByteSequence bytes = new ByteSequence(code);
- InstructionHandle[] ihs = new InstructionHandle[code.length];
- int[] pos = new int[code.length]; // Can't be more than that
- int count = 0; // Contains actual length
-
- /* Pass 1: Create an object for each byte code and append them
- * to the list.
- */
- try {
- while(bytes.available() > 0) {
- // Remember byte offset and associate it with the instruction
- int off = bytes.getIndex();
- pos[count] = off;
-
- /* Read one instruction from the byte stream, the byte position is set
- * accordingly.
- */
- Instruction i = Instruction.readInstruction(bytes);
- InstructionHandle ih;
- if(i instanceof BranchInstruction) // Use proper append() method
- ih = append((BranchInstruction)i);
- else
- ih = append(i);
-
- ih.setPosition(off);
- ihs[count] = ih;
-
- count++;
- }
- } catch(IOException e) { throw new ClassGenException(e.toString()); }
-
- byte_positions = new int[count]; // Trim to proper size
- System.arraycopy(pos, 0, byte_positions, 0, count);
-
- /* Pass 2: Look for BranchInstruction and update their targets, i.e.,
- * convert offsets to instruction handles.
- */
- for(int i=0; i < count; i++) {
- if(ihs[i] instanceof BranchHandle) {
- BranchInstruction bi = (BranchInstruction)ihs[i].instruction;
- int target = bi.position + bi.getIndex(); /* Byte code position:
- * relative -> absolute. */
- // Search for target position
- InstructionHandle ih = findHandle(ihs, pos, count, target);
-
- if(ih == null) // Search failed
- throw new ClassGenException("Couldn't find target for branch: " + bi);
-
- bi.setTarget(ih); // Update target
-
- // If it is a Select instruction, update all branch targets
- if(bi instanceof Select) { // Either LOOKUPSWITCH or TABLESWITCH
- Select s = (Select)bi;
- int[] indices = s.getIndices();
-
- for(int j=0; j < indices.length; j++) {
- target = bi.position + indices[j];
- ih = findHandle(ihs, pos, count, target);
-
- if(ih == null) // Search failed
- throw new ClassGenException("Couldn't find target for switch: " + bi);
-
- s.setTarget(j, ih); // Update target
- }
- }
- }
- }
- }
-
- /**
- * Append another list after instruction (handle) ih contained in this list.
- * Consumes argument list, i.e., it becomes empty.
- *
- * @param ih where to append the instruction list
- * @param il Instruction list to append to this one
- * @return instruction handle pointing to the <B>first</B> appended instruction
- */
- public InstructionHandle append(InstructionHandle ih, InstructionList il) {
- if(il == null)
- throw new ClassGenException("Appending null InstructionList");
-
- if(il.isEmpty()) // Nothing to do
- return ih;
-
- InstructionHandle next = ih.next, ret = il.start;
-
- ih.next = il.start;
- il.start.prev = ih;
-
- il.end.next = next;
-
- if(next != null) // i == end ?
- next.prev = il.end;
- else
- end = il.end; // Update end ...
-
- length += il.length; // Update length
-
- il.clear();
-
- return ret;
- }
-
- /**
- * Append another list after instruction i contained in this list.
- * Consumes argument list, i.e., it becomes empty.
- *
- * @param i where to append the instruction list
- * @param il Instruction list to append to this one
- * @return instruction handle pointing to the <B>first</B> appended instruction
- */
- public InstructionHandle append(Instruction i, InstructionList il) {
- InstructionHandle ih;
-
- if((ih = findInstruction2(i)) == null) // Also applies for empty list
- throw new ClassGenException("Instruction " + i +
- " is not contained in this list.");
-
- return append(ih, il);
- }
-
- /**
- * Append another list to this one.
- * Consumes argument list, i.e., it becomes empty.
- *
- * @param il list to append to end of this list
- * @return instruction handle of the <B>first</B> appended instruction
- */
- public InstructionHandle append(InstructionList il) {
- if(il == null)
- throw new ClassGenException("Appending null InstructionList");
-
- if(il.isEmpty()) // Nothing to do
- return null;
-
- if(isEmpty()) {
- start = il.start;
- end = il.end;
- length = il.length;
-
- il.clear();
-
- return start;
- } else
- return append(end, il); // was end.instruction
- }
-
- /**
- * Append an instruction to the end of this list.
- *
- * @param ih instruction to append
- */
- private void append(InstructionHandle ih) {
- if(isEmpty()) {
- start = end = ih;
- ih.next = ih.prev = null;
- }
- else {
- end.next = ih;
- ih.prev = end;
- ih.next = null;
- end = ih;
- }
-
- length++; // Update length
- }
-
- /**
- * Append an instruction to the end of this list.
- *
- * @param i instruction to append
- * @return instruction handle of the appended instruction
- */
- public InstructionHandle append(Instruction i) {
- InstructionHandle ih = InstructionHandle.getInstructionHandle(i);
- append(ih);
-
- return ih;
- }
-
- /**
- * Append a branch instruction to the end of this list.
- *
- * @param i branch instruction to append
- * @return branch instruction handle of the appended instruction
- */
- public BranchHandle append(BranchInstruction i) {
- BranchHandle ih = BranchHandle.getBranchHandle(i);
- append(ih);
-
- return ih;
- }
-
- /**
- * Append a single instruction j after another instruction i, which
- * must be in this list of course!
- *
- * @param i Instruction in list
- * @param j Instruction to append after i in list
- * @return instruction handle of the first appended instruction
- */
- public InstructionHandle append(Instruction i, Instruction j) {
- return append(i, new InstructionList(j));
- }
-
- /**
- * Append a compound instruction, after instruction i.
- *
- * @param i Instruction in list
- * @param c The composite instruction (containing an InstructionList)
- * @return instruction handle of the first appended instruction
- */
- public InstructionHandle append(Instruction i, CompoundInstruction c) {
- return append(i, c.getInstructionList());
- }
-
- /**
- * Append a compound instruction.
- *
- * @param c The composite instruction (containing an InstructionList)
- * @return instruction handle of the first appended instruction
- */
- public InstructionHandle append(CompoundInstruction c) {
- return append(c.getInstructionList());
- }
-
- /**
- * Append a compound instruction.
- *
- * @param ih where to append the instruction list
- * @param c The composite instruction (containing an InstructionList)
- * @return instruction handle of the first appended instruction
- */
- public InstructionHandle append(InstructionHandle ih, CompoundInstruction c) {
- return append(ih, c.getInstructionList());
- }
-
- /**
- * Append an instruction after instruction (handle) ih contained in this list.
- *
- * @param ih where to append the instruction list
- * @param i Instruction to append
- * @return instruction handle pointing to the <B>first</B> appended instruction
- */
- public InstructionHandle append(InstructionHandle ih, Instruction i) {
- return append(ih, new InstructionList(i));
- }
-
- /**
- * Append an instruction after instruction (handle) ih contained in this list.
- *
- * @param ih where to append the instruction list
- * @param i Instruction to append
- * @return instruction handle pointing to the <B>first</B> appended instruction
- */
- public BranchHandle append(InstructionHandle ih, BranchInstruction i) {
- BranchHandle bh = BranchHandle.getBranchHandle(i);
- InstructionList il = new InstructionList();
- il.append(bh);
-
- append(ih, il);
-
- return bh;
- }
-
- /**
- * Insert another list before Instruction handle ih contained in this list.
- * Consumes argument list, i.e., it becomes empty.
- *
- * @param i where to append the instruction list
- * @param il Instruction list to insert
- * @return instruction handle of the first inserted instruction
- */
- public InstructionHandle insert(InstructionHandle ih, InstructionList il) {
- if(il == null)
- throw new ClassGenException("Inserting null InstructionList");
-
- if(il.isEmpty()) // Nothing to do
- return ih;
-
- InstructionHandle prev = ih.prev, ret = il.start;
-
- ih.prev = il.end;
- il.end.next = ih;
-
- il.start.prev = prev;
-
- if(prev != null) // ih == start ?
- prev.next = il.start;
- else
- start = il.start; // Update start ...
-
- length += il.length; // Update length
-
- il.clear();
-
- return ret;
- }
-
- /**
- * Insert another list.
- *
- * @param il list to insert before start of this list
- * @return instruction handle of the first inserted instruction
- */
- public InstructionHandle insert(InstructionList il) {
- if(isEmpty()) {
- append(il); // Code is identical for this case
- return start;
- }
- else
- return insert(start, il);
- }
-
- /**
- * Insert an instruction at start of this list.
- *
- * @param ih instruction to insert
- */
- private void insert(InstructionHandle ih) {
- if(isEmpty()) {
- start = end = ih;
- ih.next = ih.prev = null;
- } else {
- start.prev = ih;
- ih.next = start;
- ih.prev = null;
- start = ih;
- }
-
- length++;
- }
-
- /**
- * Insert another list before Instruction i contained in this list.
- * Consumes argument list, i.e., it becomes empty.
- *
- * @param i where to append the instruction list
- * @param il Instruction list to insert
- * @return instruction handle pointing to the first inserted instruction,
- * i.e., il.getStart()
- */
- public InstructionHandle insert(Instruction i, InstructionList il) {
- InstructionHandle ih;
-
- if((ih = findInstruction1(i)) == null)
- throw new ClassGenException("Instruction " + i +
- " is not contained in this list.");
-
- return insert(ih, il);
- }
-
- /**
- * Insert an instruction at start of this list.
- *
- * @param i instruction to insert
- * @return instruction handle of the inserted instruction
- */
- public InstructionHandle insert(Instruction i) {
- InstructionHandle ih = InstructionHandle.getInstructionHandle(i);
- insert(ih);
-
- return ih;
- }
-
- /**
- * Insert a branch instruction at start of this list.
- *
- * @param i branch instruction to insert
- * @return branch instruction handle of the appended instruction
- */
- public BranchHandle insert(BranchInstruction i) {
- BranchHandle ih = BranchHandle.getBranchHandle(i);
- insert(ih);
- return ih;
- }
-
- /**
- * Insert a single instruction j before another instruction i, which
- * must be in this list of course!
- *
- * @param i Instruction in list
- * @param j Instruction to insert before i in list
- * @return instruction handle of the first inserted instruction
- */
- public InstructionHandle insert(Instruction i, Instruction j) {
- return insert(i, new InstructionList(j));
- }
-
- /**
- * Insert a compound instruction before instruction i.
- *
- * @param i Instruction in list
- * @param c The composite instruction (containing an InstructionList)
- * @return instruction handle of the first inserted instruction
- */
- public InstructionHandle insert(Instruction i, CompoundInstruction c) {
- return insert(i, c.getInstructionList());
- }
-
- /**
- * Insert a compound instruction.
- *
- * @param c The composite instruction (containing an InstructionList)
- * @return instruction handle of the first inserted instruction
- */
- public InstructionHandle insert(CompoundInstruction c) {
- return insert(c.getInstructionList());
- }
-
- /**
- * Insert an instruction before instruction (handle) ih contained in this list.
- *
- * @param ih where to insert to the instruction list
- * @param i Instruction to insert
- * @return instruction handle of the first inserted instruction
- */
- public InstructionHandle insert(InstructionHandle ih, Instruction i) {
- return insert(ih, new InstructionList(i));
- }
-
- /**
- * Insert a compound instruction.
- *
- * @param ih where to insert the instruction list
- * @param c The composite instruction (containing an InstructionList)
- * @return instruction handle of the first inserted instruction
- */
- public InstructionHandle insert(InstructionHandle ih, CompoundInstruction c) {
- return insert(ih, c.getInstructionList());
- }
-
- /**
- * Insert an instruction before instruction (handle) ih contained in this list.
- *
- * @param ih where to insert to the instruction list
- * @param i Instruction to insert
- * @return instruction handle of the first inserted instruction
- */
- public BranchHandle insert(InstructionHandle ih, BranchInstruction i) {
- BranchHandle bh = BranchHandle.getBranchHandle(i);
- InstructionList il = new InstructionList();
- il.append(bh);
-
- insert(ih, il);
-
- return bh;
- }
-
- /**
- * Take all instructions (handles) from "start" to "end" and append them after the
- * new location "target". Of course, "end" must be after "start" and target must
- * not be located withing this range. If you want to move something to the start of
- * the list use null as value for target.<br>
- * Any instruction targeters pointing to handles within the block, keep their targets.
- *
- * @param start of moved block
- * @param end of moved block
- * @param target of moved block
- */
- public void move(InstructionHandle start, InstructionHandle end, InstructionHandle target) {
- // Step 1: Check constraints
-
- if((start == null) || (end == null))
- throw new ClassGenException("Invalid null handle: From " + start + " to " + end);
-
- if((target == start) || (target == end))
- throw new ClassGenException("Invalid range: From " + start + " to " + end +
- " contains target " + target);
-
- for(InstructionHandle ih = start; ih != end.next; ih = ih.next) {
- if(ih == null) // At end of list, end not found yet
- throw new ClassGenException("Invalid range: From " + start + " to " + end);
- else if(ih == target) // target may be null
- throw new ClassGenException("Invalid range: From " + start + " to " + end +
- " contains target " + target);
- }
-
- // Step 2: Temporarily remove the given instructions from the list
-
- InstructionHandle prev = start.prev, next = end.next;
-
- if(prev != null)
- prev.next = next;
- else // start == this.start!
- this.start = next;
-
- if(next != null)
- next.prev = prev;
- else // end == this.end!
- this.end = prev;
-
- start.prev = end.next = null;
-
- // Step 3: append after target
-
- if(target == null) { // append to start of list
- end.next = this.start;
- this.start = start;
- } else {
- next = target.next;
-
- target.next = start;
- start.prev = target;
- end.next = next;
-
- if(next != null)
- next.prev = end;
- }
- }
-
- /**
- * Move a single instruction (handle) to a new location.
- *
- * @param ih moved instruction
- * @param target new location of moved instruction
- */
- public void move(InstructionHandle ih, InstructionHandle target) {
- move(ih, ih, target);
- }
-
- /**
- * Remove from instruction `prev' to instruction `next' both contained
- * in this list. Throws TargetLostException when one of the removed instruction handles
- * is still being targeted.
- *
- * @param prev where to start deleting (predecessor, exclusive)
- * @param next where to end deleting (successor, exclusive)
- */
- private void remove(InstructionHandle prev, InstructionHandle next)
- throws TargetLostException
- {
- InstructionHandle first, last; // First and last deleted instruction
-
- if((prev == null) && (next == null)) { // singleton list
- first = last = start;
- start = end = null;
- } else {
- if(prev == null) { // At start of list
- first = start;
- start = next;
- } else {
- first = prev.next;
- prev.next = next;
- }
-
- if(next == null) { // At end of list
- last = end;
- end = prev;
- } else {
- last = next.prev;
- next.prev = prev;
- }
- }
-
- first.prev = null; // Completely separated from rest of list
- last.next = null;
-
- ArrayList target_vec = new ArrayList();
-
- for(InstructionHandle ih=first; ih != null; ih = ih.next)
- ih.getInstruction().dispose(); // e.g. BranchInstructions release their targets
-
- StringBuffer buf = new StringBuffer("{ ");
- for(InstructionHandle ih=first; ih != null; ih = next) {
- next = ih.next;
- length--;
-
- if(ih.hasTargeters()) { // Still got targeters?
- target_vec.add(ih);
- buf.append(ih.toString(true) + " ");
- ih.next = ih.prev = null;
- } else
- ih.dispose();
- }
-
- buf.append("}");
-
- if(!target_vec.isEmpty()) {
- InstructionHandle[] targeted = new InstructionHandle[target_vec.size()];
- target_vec.toArray(targeted);
- throw new TargetLostException(targeted, buf.toString());
- }
- }
-
- /**
- * Remove instruction from this list. The corresponding Instruction
- * handles must not be reused!
- *
- * @param ih instruction (handle) to remove
- */
- public void delete(InstructionHandle ih) throws TargetLostException {
- remove(ih.prev, ih.next);
- }
-
- /**
- * Remove instruction from this list. The corresponding Instruction
- * handles must not be reused!
- *
- * @param i instruction to remove
- */
- public void delete(Instruction i) throws TargetLostException {
- InstructionHandle ih;
-
- if((ih = findInstruction1(i)) == null)
- throw new ClassGenException("Instruction " + i +
- " is not contained in this list.");
- delete(ih);
- }
-
- /**
- * Remove instructions from instruction `from' to instruction `to' contained
- * in this list. The user must ensure that `from' is an instruction before
- * `to', or risk havoc. The corresponding Instruction handles must not be reused!
- *
- * @param from where to start deleting (inclusive)
- * @param to where to end deleting (inclusive)
- */
- public void delete(InstructionHandle from, InstructionHandle to)
- throws TargetLostException
- {
- remove(from.prev, to.next);
- }
-
- /**
- * Remove instructions from instruction `from' to instruction `to' contained
- * in this list. The user must ensure that `from' is an instruction before
- * `to', or risk havoc. The corresponding Instruction handles must not be reused!
- *
- * @param from where to start deleting (inclusive)
- * @param to where to end deleting (inclusive)
- */
- public void delete(Instruction from, Instruction to) throws TargetLostException {
- InstructionHandle from_ih, to_ih;
-
- if((from_ih = findInstruction1(from)) == null)
- throw new ClassGenException("Instruction " + from +
- " is not contained in this list.");
-
- if((to_ih = findInstruction2(to)) == null)
- throw new ClassGenException("Instruction " + to +
- " is not contained in this list.");
- delete(from_ih, to_ih);
- }
-
- /**
- * Search for given Instruction reference, start at beginning of list.
- *
- * @param i instruction to search for
- * @return instruction found on success, null otherwise
- */
- private InstructionHandle findInstruction1(Instruction i) {
- for(InstructionHandle ih=start; ih != null; ih = ih.next)
- if(ih.instruction == i)
- return ih;
-
- return null;
- }
-
- /**
- * Search for given Instruction reference, start at end of list
- *
- * @param i instruction to search for
- * @return instruction found on success, null otherwise
- */
- private InstructionHandle findInstruction2(Instruction i) {
- for(InstructionHandle ih=end; ih != null; ih = ih.prev)
- if(ih.instruction == i)
- return ih;
-
- return null;
- }
-
- public boolean contains(InstructionHandle i) {
- if(i == null)
- return false;
-
- for(InstructionHandle ih=start; ih != null; ih = ih.next)
- if(ih == i)
- return true;
-
- return false;
- }
-
- public boolean contains(Instruction i) {
- return findInstruction1(i) != null;
- }
-
- public void setPositions() {
- setPositions(false);
- }
-
- /**
- * Give all instructions their position number (offset in byte stream), i.e.,
- * make the list ready to be dumped.
- *
- * @param check Perform sanity checks, e.g. if all targeted instructions really belong
- * to this list
- */
- public void setPositions(boolean check) {
- int max_additional_bytes = 0, additional_bytes = 0;
- int index = 0, count = 0;
- int[] pos = new int[length];
-
- /* Pass 0: Sanity checks
- */
- if(check) {
- for(InstructionHandle ih=start; ih != null; ih = ih.next) {
- Instruction i = ih.instruction;
-
- if(i instanceof BranchInstruction) { // target instruction within list?
- Instruction inst = ((BranchInstruction)i).getTarget().instruction;
- if(!contains(inst))
- throw new ClassGenException("Branch target of " +
- Constants.OPCODE_NAMES[i.opcode] + ":" +
- inst + " not in instruction list");
-
- if(i instanceof Select) {
- InstructionHandle[] targets = ((Select)i).getTargets();
-
- for(int j=0; j < targets.length; j++) {
- inst = targets[j].instruction;
- if(!contains(inst))
- throw new ClassGenException("Branch target of " +
- Constants.OPCODE_NAMES[i.opcode] + ":" +
- inst + " not in instruction list");
- }
- }
-
- if(!(ih instanceof BranchHandle))
- throw new ClassGenException("Branch instruction " +
- Constants.OPCODE_NAMES[i.opcode] + ":" +
- inst + " not contained in BranchHandle.");
-
- }
- }
- }
-
- /* Pass 1: Set position numbers and sum up the maximum number of bytes an
- * instruction may be shifted.
- */
- for(InstructionHandle ih=start; ih != null; ih = ih.next) {
- Instruction i = ih.instruction;
-
- ih.setPosition(index);
- pos[count++] = index;
-
- /* Get an estimate about how many additional bytes may be added, because
- * BranchInstructions may have variable length depending on the target
- * offset (short vs. int) or alignment issues (TABLESWITCH and
- * LOOKUPSWITCH).
- */
- switch(i.getOpcode()) {
- case Constants.JSR: case Constants.GOTO:
- max_additional_bytes += 2;
- break;
-
- case Constants.TABLESWITCH: case Constants.LOOKUPSWITCH:
- max_additional_bytes += 3;
- break;
- }
-
- index += i.getLength();
- }
-
- /* Pass 2: Expand the variable-length (Branch)Instructions depending on
- * the target offset (short or int) and ensure that branch targets are
- * within this list.
- */
- for(InstructionHandle ih=start; ih != null; ih = ih.next)
- additional_bytes += ih.updatePosition(additional_bytes, max_additional_bytes);
-
- /* Pass 3: Update position numbers (which may have changed due to the
- * preceding expansions), like pass 1.
- */
- index=count=0;
- for(InstructionHandle ih=start; ih != null; ih = ih.next) {
- Instruction i = ih.instruction;
-
- ih.setPosition(index);
- pos[count++] = index;
- index += i.getLength();
- }
-
- byte_positions = new int[count]; // Trim to proper size
- System.arraycopy(pos, 0, byte_positions, 0, count);
- }
-
- /**
- * When everything is finished, use this method to convert the instruction
- * list into an array of bytes.
- *
- * @return the byte code ready to be dumped
- */
- public byte[] getByteCode() {
- // Update position indices of instructions
- setPositions();
-
- ByteArrayOutputStream b = new ByteArrayOutputStream();
- DataOutputStream out = new DataOutputStream(b);
-
- try {
- for(InstructionHandle ih=start; ih != null; ih = ih.next) {
- Instruction i = ih.instruction;
- i.dump(out); // Traverse list
- }
- } catch(IOException e) {
- System.err.println(e);
- return null;
- }
-
- return b.toByteArray();
- }
-
- /**
- * @return an array of instructions without target information for branch instructions.
- */
- public Instruction[] getInstructions() {
- ByteSequence bytes = new ByteSequence(getByteCode());
- ArrayList instructions = new ArrayList();
-
- try {
- while(bytes.available() > 0) {
- instructions.add(Instruction.readInstruction(bytes));
- }
- } catch(IOException e) { throw new ClassGenException(e.toString()); }
-
- Instruction[] result = new Instruction[instructions.size()];
- instructions.toArray(result);
- return result;
- }
-
- public String toString() {
- return toString(true);
- }
-
- /**
- * @param verbose toggle output format
- * @return String containing all instructions in this list.
- */
- public String toString(boolean verbose) {
- StringBuffer buf = new StringBuffer();
-
- for(InstructionHandle ih=start; ih != null; ih = ih.next) {
- buf.append(ih.toString(verbose) + "\n");
- }
-
- return buf.toString();
- }
-
- /**
- * @return Enumeration that lists all instructions (handles)
- */
- public Iterator iterator() {
- return new Iterator() {
- private InstructionHandle ih = start;
-
- public Object next() {
- InstructionHandle i = ih;
- ih = ih.next;
- return i;
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- public boolean hasNext() { return ih != null; }
- };
- }
-
- /**
- * @return array containing all instructions (handles)
- */
- public InstructionHandle[] getInstructionHandles() {
- InstructionHandle[] ihs = new InstructionHandle[length];
- InstructionHandle ih = start;
-
- for(int i=0; i < length; i++) {
- ihs[i] = ih;
- ih = ih.next;
- }
-
- return ihs;
- }
-
- /**
- * Get positions (offsets) of all instructions in the list. This relies on that
- * the list has been freshly created from an byte code array, or that setPositions()
- * has been called. Otherwise this may be inaccurate.
- *
- * @return array containing all instruction's offset in byte code
- */
- public int[] getInstructionPositions() { return byte_positions; }
-
- /**
- * @return complete, i.e., deep copy of this list
- */
- public InstructionList copy() {
- HashMap map = new HashMap();
- InstructionList il = new InstructionList();
-
- /* Pass 1: Make copies of all instructions, append them to the new list
- * and associate old instruction references with the new ones, i.e.,
- * a 1:1 mapping.
- */
- for(InstructionHandle ih=start; ih != null; ih = ih.next) {
- Instruction i = ih.instruction;
- Instruction c = i.copy(); // Use clone for shallow copy
-
- if(c instanceof BranchInstruction)
- map.put(ih, il.append((BranchInstruction)c));
- else
- map.put(ih, il.append(c));
- }
-
- /* Pass 2: Update branch targets.
- */
- InstructionHandle ih=start;
- InstructionHandle ch=il.start;
-
- while(ih != null) {
- Instruction i = ih.instruction;
- Instruction c = ch.instruction;
-
- if(i instanceof BranchInstruction) {
- BranchInstruction bi = (BranchInstruction)i;
- BranchInstruction bc = (BranchInstruction)c;
- InstructionHandle itarget = bi.getTarget(); // old target
-
- // New target is in hash map
- bc.setTarget((InstructionHandle)map.get(itarget));
-
- if(bi instanceof Select) { // Either LOOKUPSWITCH or TABLESWITCH
- InstructionHandle[] itargets = ((Select)bi).getTargets();
- InstructionHandle[] ctargets = ((Select)bc).getTargets();
-
- for(int j=0; j < itargets.length; j++) { // Update all targets
- ctargets[j] = (InstructionHandle)map.get(itargets[j]);
- }
- }
- }
-
- ih = ih.next;
- ch = ch.next;
- }
-
- return il;
- }
-
- /** Replace all references to the old constant pool with references to the new
- * constant pool
- */
- public void replaceConstantPool(ConstantPoolGen old_cp, ConstantPoolGen new_cp) {
- for(InstructionHandle ih=start; ih != null; ih = ih.next) {
- Instruction i = ih.instruction;
-
- if(i instanceof CPInstruction) {
- CPInstruction ci = (CPInstruction)i;
- Constant c = old_cp.getConstant(ci.getIndex());
- ci.setIndex(new_cp.addConstant(c, old_cp));
- }
- }
- }
-
- private void clear() {
- start = end = null;
- length = 0;
- }
-
- /**
- * Delete contents of list. Provides besser memory utilization,
- * because the system then may reuse the instruction handles. This
- * method is typically called right after
- * <href="MethodGen.html#getMethod()">MethodGen.getMethod()</a>.
- */
- public void dispose() {
- // Traverse in reverse order, because ih.next is overwritten
- for(InstructionHandle ih=end; ih != null; ih = ih.prev)
- /* Causes BranchInstructions to release target and targeters, because it
- * calls dispose() on the contained instruction.
- */
- ih.dispose();
-
- clear();
- }
-
- /**
- * @return start of list
- */
- public InstructionHandle getStart() { return start; }
-
- /**
- * @return end of list
- */
- public InstructionHandle getEnd() { return end; }
-
- /**
- * @return length of list (Number of instructions, not bytes)
- */
- public int getLength() { return length; }
-
- /**
- * @return length of list (Number of instructions, not bytes)
- */
- public int size() { return length; }
-
- /**
- * Redirect all references from old_target to new_target, i.e., update targets
- * of branch instructions.
- *
- * @param old_target the old target instruction handle
- * @param new_target the new target instruction handle
- */
- public void redirectBranches(InstructionHandle old_target,
- InstructionHandle new_target) {
- for(InstructionHandle ih = start; ih != null; ih = ih.next) {
- Instruction i = ih.getInstruction();
-
- if(i instanceof BranchInstruction) {
- BranchInstruction b = (BranchInstruction)i;
- InstructionHandle target = b.getTarget();
-
- if(target == old_target)
- b.setTarget(new_target);
-
- if(b instanceof Select) { // Either LOOKUPSWITCH or TABLESWITCH
- InstructionHandle[] targets = ((Select)b).getTargets();
-
- for(int j=0; j < targets.length; j++) // Update targets
- if(targets[j] == old_target)
- ((Select)b).setTarget(j, new_target);
- }
- }
- }
- }
-
- /**
- * Redirect all references of local variables from old_target to new_target.
- *
- * @param lg array of local variables
- * @param old_target the old target instruction handle
- * @param new_target the new target instruction handle
- * @see MethodGen
- */
- public void redirectLocalVariables(LocalVariableGen[] lg,
- InstructionHandle old_target,
- InstructionHandle new_target) {
- for(int i=0; i < lg.length; i++) {
- InstructionHandle start = lg[i].getStart();
- InstructionHandle end = lg[i].getEnd();
-
- if(start == old_target)
- lg[i].setStart(new_target);
-
- if(end == old_target)
- lg[i].setEnd(new_target);
- }
- }
-
- /**
- * Redirect all references of exception handlers from old_target to new_target.
- *
- * @param exceptions array of exception handlers
- * @param old_target the old target instruction handle
- * @param new_target the new target instruction handle
- * @see MethodGen
- */
- public void redirectExceptionHandlers(CodeExceptionGen[] exceptions,
- InstructionHandle old_target,
- InstructionHandle new_target) {
- for(int i=0; i < exceptions.length; i++) {
- if(exceptions[i].getStartPC() == old_target)
- exceptions[i].setStartPC(new_target);
-
- if(exceptions[i].getEndPC() == old_target)
- exceptions[i].setEndPC(new_target);
-
- if(exceptions[i].getHandlerPC() == old_target)
- exceptions[i].setHandlerPC(new_target);
- }
- }
-
- private ArrayList observers;
-
- /** Add observer for this object.
- */
- public void addObserver(InstructionListObserver o) {
- if(observers == null)
- observers = new ArrayList();
-
- observers.add(o);
- }
-
- /** Remove observer for this object.
- */
- public void removeObserver(InstructionListObserver o) {
- if(observers != null)
- observers.remove(o);
- }
-
- /** Call notify() method on all observers. This method is not called
- * automatically whenever the state has changed, but has to be
- * called by the user after he has finished editing the object.
- */
- public void update() {
- if(observers != null)
- for(Iterator e = observers.iterator(); e.hasNext(); )
- ((InstructionListObserver)e.next()).notify(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/InstructionListObserver.java b/src/com/sun/org/apache/bcel/internal/generic/InstructionListObserver.java
deleted file mode 100644
index 91ad321..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/InstructionListObserver.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * Implement this interface if you're interested in changes to an InstructionList object
- * and register yourself with addObserver().
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public interface InstructionListObserver {
- public void notify(InstructionList list);
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/InstructionTargeter.java b/src/com/sun/org/apache/bcel/internal/generic/InstructionTargeter.java
deleted file mode 100644
index 3eaeb3a..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/InstructionTargeter.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * Denote that a class targets InstructionHandles within an InstructionList. Namely
- * the following implementers:
- *
- * @see BranchHandle
- * @see LocalVariableGen
- * @see CodeExceptionGen
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public interface InstructionTargeter {
- public boolean containsTarget(InstructionHandle ih);
- public void updateTarget(InstructionHandle old_ih, InstructionHandle new_ih);
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/InvokeInstruction.java b/src/com/sun/org/apache/bcel/internal/generic/InvokeInstruction.java
deleted file mode 100644
index cae2bd5..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/InvokeInstruction.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import com.sun.org.apache.bcel.internal.Constants;
-import com.sun.org.apache.bcel.internal.classfile.*;
-import java.util.StringTokenizer;
-
-/**
- * Super class for the INVOKExxx family of instructions.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public abstract class InvokeInstruction extends FieldOrMethod
- implements ExceptionThrower, TypedInstruction, StackConsumer, StackProducer {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- InvokeInstruction() {}
-
- /**
- * @param index to constant pool
- */
- protected InvokeInstruction(short opcode, int index) {
- super(opcode, index);
- }
-
- /**
- * @return mnemonic for instruction with symbolic references resolved
- */
- public String toString(ConstantPool cp) {
- Constant c = cp.getConstant(index);
- StringTokenizer tok = new StringTokenizer(cp.constantToString(c));
-
- return Constants.OPCODE_NAMES[opcode] + " " +
- tok.nextToken().replace('.', '/') + tok.nextToken();
- }
-
- /**
- * Also works for instructions whose stack effect depends on the
- * constant pool entry they reference.
- * @return Number of words consumed from stack by this instruction
- */
- public int consumeStack(ConstantPoolGen cpg) {
- String signature = getSignature(cpg);
- Type[] args = Type.getArgumentTypes(signature);
- int sum;
-
- if(opcode == Constants.INVOKESTATIC)
- sum = 0;
- else
- sum = 1; // this reference
-
- int n = args.length;
- for (int i = 0; i < n; i++)
- sum += args[i].getSize();
-
- return sum;
- }
-
- /**
- * Also works for instructions whose stack effect depends on the
- * constant pool entry they reference.
- * @return Number of words produced onto stack by this instruction
- */
- public int produceStack(ConstantPoolGen cpg) {
- return getReturnType(cpg).getSize();
- }
-
- /** @return return type of referenced method.
- */
- public Type getType(ConstantPoolGen cpg) {
- return getReturnType(cpg);
- }
-
- /** @return name of referenced method.
- */
- public String getMethodName(ConstantPoolGen cpg) {
- return getName(cpg);
- }
-
- /** @return return type of referenced method.
- */
- public Type getReturnType(ConstantPoolGen cpg) {
- return Type.getReturnType(getSignature(cpg));
- }
-
- /** @return argument types of referenced method.
- */
- public Type[] getArgumentTypes(ConstantPoolGen cpg) {
- return Type.getArgumentTypes(getSignature(cpg));
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/JSR.java b/src/com/sun/org/apache/bcel/internal/generic/JSR.java
deleted file mode 100644
index d5b563b..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/JSR.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import java.io.*;
-
-/**
- * JSR - Jump to subroutine
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class JSR extends JsrInstruction implements VariableLengthInstruction {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- JSR() {}
-
- public JSR(InstructionHandle target) {
- super(com.sun.org.apache.bcel.internal.Constants.JSR, target);
- }
-
- /**
- * Dump instruction as byte code to stream out.
- * @param out Output stream
- */
- public void dump(DataOutputStream out) throws IOException {
- index = getTargetOffset();
- if(opcode == com.sun.org.apache.bcel.internal.Constants.JSR)
- super.dump(out);
- else { // JSR_W
- index = getTargetOffset();
- out.writeByte(opcode);
- out.writeInt(index);
- }
- }
-
- protected int updatePosition(int offset, int max_offset) {
- int i = getTargetOffset(); // Depending on old position value
-
- position += offset; // Position may be shifted by preceding expansions
-
- if(Math.abs(i) >= (32767 - max_offset)) { // to large for short (estimate)
- opcode = com.sun.org.apache.bcel.internal.Constants.JSR_W;
- length = 5;
- return 2; // 5 - 3
- }
-
- return 0;
- }
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackProducer(this);
- v.visitVariableLengthInstruction(this);
- v.visitBranchInstruction(this);
- v.visitJsrInstruction(this);
- v.visitJSR(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/JSR_W.java b/src/com/sun/org/apache/bcel/internal/generic/JSR_W.java
deleted file mode 100644
index 32ceb29..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/JSR_W.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import java.io.*;
-import com.sun.org.apache.bcel.internal.util.ByteSequence;
-
-/**
- * JSR_W - Jump to subroutine
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class JSR_W extends JsrInstruction {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- JSR_W() {}
-
- public JSR_W(InstructionHandle target) {
- super(com.sun.org.apache.bcel.internal.Constants.JSR_W, target);
- length = 5;
- }
-
- /**
- * Dump instruction as byte code to stream out.
- * @param out Output stream
- */
- public void dump(DataOutputStream out) throws IOException {
- index = getTargetOffset();
- out.writeByte(opcode);
- out.writeInt(index);
- }
-
- /**
- * Read needed data (e.g. index) from file.
- */
- protected void initFromFile(ByteSequence bytes, boolean wide) throws IOException
- {
- index = bytes.readInt();
- length = 5;
- }
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackProducer(this);
- v.visitBranchInstruction(this);
- v.visitJsrInstruction(this);
- v.visitJSR_W(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/JsrInstruction.java b/src/com/sun/org/apache/bcel/internal/generic/JsrInstruction.java
deleted file mode 100644
index f71e165..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/JsrInstruction.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * Super class for JSR - Jump to subroutine
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public abstract class JsrInstruction extends BranchInstruction
- implements UnconditionalBranch, TypedInstruction, StackProducer
-{
- JsrInstruction(short opcode, InstructionHandle target) {
- super(opcode, target);
- }
-
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- JsrInstruction(){}
-
- /** @return return address type
- */
- public Type getType(ConstantPoolGen cp) {
- return new ReturnaddressType(physicalSuccessor());
- }
-
- /**
- * Returns an InstructionHandle to the physical successor
- * of this JsrInstruction. <B>For this method to work,
- * this JsrInstruction object must not be shared between
- * multiple InstructionHandle objects!</B>
- * Formally, there must not be InstructionHandle objects
- * i, j where i != j and i.getInstruction() == this ==
- * j.getInstruction().
- * @return an InstructionHandle to the "next" instruction that
- * will be executed when RETurned from a subroutine.
- */
- public InstructionHandle physicalSuccessor(){
- InstructionHandle ih = this.target;
-
- // Rewind!
- while(ih.getPrev() != null)
- ih = ih.getPrev();
-
- // Find the handle for "this" JsrInstruction object.
- while(ih.getInstruction() != this)
- ih = ih.getNext();
-
- InstructionHandle toThis = ih;
-
- while(ih != null){
- ih = ih.getNext();
- if ((ih != null) && (ih.getInstruction() == this))
- throw new RuntimeException("physicalSuccessor() called on a shared JsrInstruction.");
- }
-
- // Return the physical successor
- return toThis.getNext();
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/L2D.java b/src/com/sun/org/apache/bcel/internal/generic/L2D.java
deleted file mode 100644
index 8d14914..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/L2D.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * L2D - Convert long to double
- * <PRE>Stack: ..., value.word1, value.word2 -&gt; ..., result.word1, result.word2</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class L2D extends ConversionInstruction {
- public L2D() {
- super(com.sun.org.apache.bcel.internal.Constants.L2D);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitConversionInstruction(this);
- v.visitL2D(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/L2F.java b/src/com/sun/org/apache/bcel/internal/generic/L2F.java
deleted file mode 100644
index 36571d6..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/L2F.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * L2F - Convert long to float
- * <PRE>Stack: ..., value.word1, value.word2 -&gt; ..., result</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class L2F extends ConversionInstruction {
- public L2F() {
- super(com.sun.org.apache.bcel.internal.Constants.L2F);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitConversionInstruction(this);
- v.visitL2F(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/L2I.java b/src/com/sun/org/apache/bcel/internal/generic/L2I.java
deleted file mode 100644
index cacf3ad..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/L2I.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * L2I - Convert long to int
- * <PRE>Stack: ..., value.word1, value.word2 -&gt; ..., result</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class L2I extends ConversionInstruction {
- public L2I() {
- super(com.sun.org.apache.bcel.internal.Constants.L2I);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitConversionInstruction(this);
- v.visitL2I(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/LADD.java b/src/com/sun/org/apache/bcel/internal/generic/LADD.java
deleted file mode 100644
index 6ab1f42..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/LADD.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * LADD - Add longs
- * <PRE>Stack: ..., value1.word1, value1.word2, value2.word1, value2.word2 -&gt;</PRE>
- * ..., result.word1, result.word2
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class LADD extends ArithmeticInstruction {
- public LADD() {
- super(com.sun.org.apache.bcel.internal.Constants.LADD);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitArithmeticInstruction(this);
- v.visitLADD(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/LALOAD.java b/src/com/sun/org/apache/bcel/internal/generic/LALOAD.java
deleted file mode 100644
index e7185ac..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/LALOAD.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * LALOAD - Load long from array
- * <PRE>Stack: ..., arrayref, index -&gt; ..., value1, value2</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class LALOAD extends ArrayInstruction implements StackProducer {
- /** Load long from array
- */
- public LALOAD() {
- super(com.sun.org.apache.bcel.internal.Constants.LALOAD);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackProducer(this);
- v.visitExceptionThrower(this);
- v.visitTypedInstruction(this);
- v.visitArrayInstruction(this);
- v.visitLALOAD(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/LAND.java b/src/com/sun/org/apache/bcel/internal/generic/LAND.java
deleted file mode 100644
index c225cac..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/LAND.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * LAND - Bitwise AND longs
- * <PRE>Stack: ..., value1.word1, value1.word2, value2.word1, value2.word2 -&gt;</PRE>
- * ..., result.word1, result.word2
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class LAND extends ArithmeticInstruction {
- public LAND() {
- super(com.sun.org.apache.bcel.internal.Constants.LAND);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitArithmeticInstruction(this);
- v.visitLAND(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/LASTORE.java b/src/com/sun/org/apache/bcel/internal/generic/LASTORE.java
deleted file mode 100644
index c0e928a..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/LASTORE.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * LASTORE - Store into long array
- * <PRE>Stack: ..., arrayref, index, value.word1, value.word2 -&gt; ...</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class LASTORE extends ArrayInstruction implements StackConsumer {
- /** Store long into array
- */
- public LASTORE() {
- super(com.sun.org.apache.bcel.internal.Constants.LASTORE);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackConsumer(this);
- v.visitExceptionThrower(this);
- v.visitTypedInstruction(this);
- v.visitArrayInstruction(this);
- v.visitLASTORE(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/LCMP.java b/src/com/sun/org/apache/bcel/internal/generic/LCMP.java
deleted file mode 100644
index 05c1aee..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/LCMP.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * LCMP - Compare longs:
- * <PRE>Stack: ..., value1.word1, value1.word2, value2.word1, value2.word2 -&gt;</PRE>
- * ..., result <= -1, 0, 1>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class LCMP extends Instruction
- implements TypedInstruction, StackProducer, StackConsumer
-{
- public LCMP() {
- super(com.sun.org.apache.bcel.internal.Constants.LCMP, (short)1);
- }
-
- /** @return Type.LONG
- */
- public Type getType(ConstantPoolGen cp) {
- return Type.LONG;
- }
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitLCMP(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/LCONST.java b/src/com/sun/org/apache/bcel/internal/generic/LCONST.java
deleted file mode 100644
index 7fe94a2..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/LCONST.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * LCONST - Push 0 or 1, other values cause an exception
- *
- * <PRE>Stack: ... -&gt; ..., </PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class LCONST extends Instruction
- implements ConstantPushInstruction, TypedInstruction {
- private long value;
-
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- LCONST() {}
-
- public LCONST(long l) {
- super(com.sun.org.apache.bcel.internal.Constants.LCONST_0, (short)1);
-
- if(l == 0)
- opcode = com.sun.org.apache.bcel.internal.Constants.LCONST_0;
- else if(l == 1)
- opcode = com.sun.org.apache.bcel.internal.Constants.LCONST_1;
- else
- throw new ClassGenException("LCONST can be used only for 0 and 1: " + l);
-
- value = l;
- }
-
- public Number getValue() { return new Long(value); }
-
- /** @return Type.LONG
- */
- public Type getType(ConstantPoolGen cp) {
- return Type.LONG;
- }
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitPushInstruction(this);
- v.visitStackProducer(this);
- v.visitTypedInstruction(this);
- v.visitConstantPushInstruction(this);
- v.visitLCONST(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/LDC.java b/src/com/sun/org/apache/bcel/internal/generic/LDC.java
deleted file mode 100644
index 001d80e..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/LDC.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import java.io.*;
-import com.sun.org.apache.bcel.internal.util.ByteSequence;
-
-/**
- * LDC - Push item from constant pool.
- *
- * <PRE>Stack: ... -&gt; ..., item</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class LDC extends CPInstruction
- implements PushInstruction, ExceptionThrower, TypedInstruction {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- LDC() {}
-
- public LDC(int index) {
- super(com.sun.org.apache.bcel.internal.Constants.LDC_W, index);
- setSize();
- }
-
- // Adjust to proper size
- protected final void setSize() {
- if(index <= com.sun.org.apache.bcel.internal.Constants.MAX_BYTE) { // Fits in one byte?
- opcode = com.sun.org.apache.bcel.internal.Constants.LDC;
- length = 2;
- } else {
- opcode = com.sun.org.apache.bcel.internal.Constants.LDC_W;
- length = 3;
- }
- }
-
- /**
- * Dump instruction as byte code to stream out.
- * @param out Output stream
- */
- public void dump(DataOutputStream out) throws IOException {
- out.writeByte(opcode);
-
- if(length == 2)
- out.writeByte(index);
- else // Applies for LDC_W
- out.writeShort(index);
- }
-
- /**
- * Set the index to constant pool and adjust size.
- */
- public final void setIndex(int index) {
- super.setIndex(index);
- setSize();
- }
-
- /**
- * Read needed data (e.g. index) from file.
- */
- protected void initFromFile(ByteSequence bytes, boolean wide)
- throws IOException
- {
- length = 2;
- index = bytes.readUnsignedByte();
- }
-
- public Object getValue(ConstantPoolGen cpg) {
- com.sun.org.apache.bcel.internal.classfile.Constant c = cpg.getConstantPool().getConstant(index);
-
- switch(c.getTag()) {
- case com.sun.org.apache.bcel.internal.Constants.CONSTANT_String:
- int i = ((com.sun.org.apache.bcel.internal.classfile.ConstantString)c).getStringIndex();
- c = cpg.getConstantPool().getConstant(i);
- return ((com.sun.org.apache.bcel.internal.classfile.ConstantUtf8)c).getBytes();
-
- case com.sun.org.apache.bcel.internal.Constants.CONSTANT_Float:
- return new Float(((com.sun.org.apache.bcel.internal.classfile.ConstantFloat)c).getBytes());
-
- case com.sun.org.apache.bcel.internal.Constants.CONSTANT_Integer:
- return new Integer(((com.sun.org.apache.bcel.internal.classfile.ConstantInteger)c).getBytes());
-
- default: // Never reached
- throw new RuntimeException("Unknown or invalid constant type at " + index);
- }
- }
-
- public Type getType(ConstantPoolGen cpg) {
- switch(cpg.getConstantPool().getConstant(index).getTag()) {
- case com.sun.org.apache.bcel.internal.Constants.CONSTANT_String: return Type.STRING;
- case com.sun.org.apache.bcel.internal.Constants.CONSTANT_Float: return Type.FLOAT;
- case com.sun.org.apache.bcel.internal.Constants.CONSTANT_Integer: return Type.INT;
- default: // Never reached
- throw new RuntimeException("Unknown or invalid constant type at " + index);
- }
- }
-
- public Class[] getExceptions() {
- return com.sun.org.apache.bcel.internal.ExceptionConstants.EXCS_STRING_RESOLUTION;
- }
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackProducer(this);
- v.visitPushInstruction(this);
- v.visitExceptionThrower(this);
- v.visitTypedInstruction(this);
- v.visitCPInstruction(this);
- v.visitLDC(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/LDC2_W.java b/src/com/sun/org/apache/bcel/internal/generic/LDC2_W.java
deleted file mode 100644
index 4a97a20..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/LDC2_W.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * LDC2_W - Push long or double from constant pool
- *
- * <PRE>Stack: ... -&gt; ..., item.word1, item.word2</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class LDC2_W extends CPInstruction
- implements PushInstruction, TypedInstruction {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- LDC2_W() {}
-
- public LDC2_W(int index) {
- super(com.sun.org.apache.bcel.internal.Constants.LDC2_W, index);
- }
-
- public Type getType(ConstantPoolGen cpg) {
- switch(cpg.getConstantPool().getConstant(index).getTag()) {
- case com.sun.org.apache.bcel.internal.Constants.CONSTANT_Long: return Type.LONG;
- case com.sun.org.apache.bcel.internal.Constants.CONSTANT_Double: return Type.DOUBLE;
- default: // Never reached
- throw new RuntimeException("Unknown constant type " + opcode);
- }
- }
-
- public Number getValue(ConstantPoolGen cpg) {
- com.sun.org.apache.bcel.internal.classfile.Constant c = cpg.getConstantPool().getConstant(index);
-
- switch(c.getTag()) {
- case com.sun.org.apache.bcel.internal.Constants.CONSTANT_Long:
- return new Long(((com.sun.org.apache.bcel.internal.classfile.ConstantLong)c).getBytes());
-
- case com.sun.org.apache.bcel.internal.Constants.CONSTANT_Double:
- return new Double(((com.sun.org.apache.bcel.internal.classfile.ConstantDouble)c).getBytes());
-
- default: // Never reached
- throw new RuntimeException("Unknown or invalid constant type at " + index);
- }
- }
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackProducer(this);
- v.visitPushInstruction(this);
- v.visitTypedInstruction(this);
- v.visitCPInstruction(this);
- v.visitLDC2_W(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/LDC_W.java b/src/com/sun/org/apache/bcel/internal/generic/LDC_W.java
deleted file mode 100644
index 640554e..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/LDC_W.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import java.io.IOException;
-import com.sun.org.apache.bcel.internal.util.ByteSequence;
-
-/**
- * LDC_W - Push item from constant pool (wide index)
- *
- * <PRE>Stack: ... -&gt; ..., item.word1, item.word2</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class LDC_W extends LDC {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- LDC_W() {}
-
- public LDC_W(int index) {
- super(index);
- }
-
- /**
- * Read needed data (i.e., index) from file.
- */
- protected void initFromFile(ByteSequence bytes, boolean wide)
- throws IOException
- {
- setIndex(bytes.readUnsignedShort());
- // Override just in case it has been changed
- opcode = com.sun.org.apache.bcel.internal.Constants.LDC_W;
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/LDIV.java b/src/com/sun/org/apache/bcel/internal/generic/LDIV.java
deleted file mode 100644
index 754696e..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/LDIV.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * LDIV - Divide longs
- * <PRE>Stack: ..., value1.word1, value1.word2, value2.word1, value2.word2 -&gt;</PRE>
- * ..., result.word1, result.word2
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class LDIV extends ArithmeticInstruction implements ExceptionThrower {
- public LDIV() {
- super(com.sun.org.apache.bcel.internal.Constants.LDIV);
- }
-
- public Class[] getExceptions() {
- return new Class[] { com.sun.org.apache.bcel.internal.ExceptionConstants.ARITHMETIC_EXCEPTION };
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitExceptionThrower(this);
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitArithmeticInstruction(this);
- v.visitLDIV(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/LLOAD.java b/src/com/sun/org/apache/bcel/internal/generic/LLOAD.java
deleted file mode 100644
index 1276d37..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/LLOAD.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * LLOAD - Load long from local variable
- *<PRE>Stack ... -&GT; ..., result.word1, result.word2</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class LLOAD extends LoadInstruction {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- LLOAD() {
- super(com.sun.org.apache.bcel.internal.Constants.LLOAD, com.sun.org.apache.bcel.internal.Constants.LLOAD_0);
- }
-
- public LLOAD(int n) {
- super(com.sun.org.apache.bcel.internal.Constants.LLOAD, com.sun.org.apache.bcel.internal.Constants.LLOAD_0, n);
- }
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- super.accept(v);
- v.visitLLOAD(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/LMUL.java b/src/com/sun/org/apache/bcel/internal/generic/LMUL.java
deleted file mode 100644
index 16cb083..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/LMUL.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * LMUL - Multiply longs
- * <PRE>Stack: ..., value1.word1, value1.word2, value2.word1, value2.word2 -&gt;</PRE>
- * ..., result.word1, result.word2
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class LMUL extends ArithmeticInstruction {
- public LMUL() {
- super(com.sun.org.apache.bcel.internal.Constants.LMUL);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitArithmeticInstruction(this);
- v.visitLMUL(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/LNEG.java b/src/com/sun/org/apache/bcel/internal/generic/LNEG.java
deleted file mode 100644
index 61df1bb..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/LNEG.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * LNEG - Negate long
- * <PRE>Stack: ..., value.word1, value.word2 -&gt; ..., result.word1, result.word2</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class LNEG extends ArithmeticInstruction {
- public LNEG() {
- super(com.sun.org.apache.bcel.internal.Constants.LNEG);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitArithmeticInstruction(this);
- v.visitLNEG(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/LOOKUPSWITCH.java b/src/com/sun/org/apache/bcel/internal/generic/LOOKUPSWITCH.java
deleted file mode 100644
index 1918884..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/LOOKUPSWITCH.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import java.io.*;
-import com.sun.org.apache.bcel.internal.util.ByteSequence;
-
-/**
- * LOOKUPSWITCH - Switch with unordered set of values
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see SWITCH
- */
-public class LOOKUPSWITCH extends Select {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- LOOKUPSWITCH() {}
-
- public LOOKUPSWITCH(int[] match, InstructionHandle[] targets,
- InstructionHandle target) {
- super(com.sun.org.apache.bcel.internal.Constants.LOOKUPSWITCH, match, targets, target);
-
- length = (short)(9 + match_length * 8); /* alignment remainder assumed
- * 0 here, until dump time. */
- fixed_length = length;
- }
-
- /**
- * Dump instruction as byte code to stream out.
- * @param out Output stream
- */
- public void dump(DataOutputStream out) throws IOException {
- super.dump(out);
- out.writeInt(match_length); // npairs
-
- for(int i=0; i < match_length; i++) {
- out.writeInt(match[i]); // match-offset pairs
- out.writeInt(indices[i] = getTargetOffset(targets[i]));
- }
- }
-
- /**
- * Read needed data (e.g. index) from file.
- */
- protected void initFromFile(ByteSequence bytes, boolean wide) throws IOException
- {
- super.initFromFile(bytes, wide); // reads padding
-
- match_length = bytes.readInt();
- fixed_length = (short)(9 + match_length * 8);
- length = (short)(fixed_length + padding);
-
- match = new int[match_length];
- indices = new int[match_length];
- targets = new InstructionHandle[match_length];
-
- for(int i=0; i < match_length; i++) {
- match[i] = bytes.readInt();
- indices[i] = bytes.readInt();
- }
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitVariableLengthInstruction(this);
- v.visitStackProducer(this);
- v.visitBranchInstruction(this);
- v.visitSelect(this);
- v.visitLOOKUPSWITCH(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/LOR.java b/src/com/sun/org/apache/bcel/internal/generic/LOR.java
deleted file mode 100644
index baf7933..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/LOR.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * LOR - Bitwise OR long
- * <PRE>Stack: ..., value1, value2 -&gt; ..., result</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class LOR extends ArithmeticInstruction {
- public LOR() {
- super(com.sun.org.apache.bcel.internal.Constants.LOR);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitArithmeticInstruction(this);
- v.visitLOR(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/LREM.java b/src/com/sun/org/apache/bcel/internal/generic/LREM.java
deleted file mode 100644
index 293684a..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/LREM.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * LREM - Remainder of long
- * <PRE>Stack: ..., value1, value2 -&gt; result</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class LREM extends ArithmeticInstruction implements ExceptionThrower {
- public LREM() {
- super(com.sun.org.apache.bcel.internal.Constants.LREM);
- }
-
- public Class[] getExceptions() { return new Class[] { com.sun.org.apache.bcel.internal.ExceptionConstants.ARITHMETIC_EXCEPTION }; }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitExceptionThrower(this);
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitArithmeticInstruction(this);
- v.visitLREM(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/LRETURN.java b/src/com/sun/org/apache/bcel/internal/generic/LRETURN.java
deleted file mode 100644
index 480ba01..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/LRETURN.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * LRETURN - Return long from method
- * <PRE>Stack: ..., value.word1, value.word2 -&gt; &lt;empty&gt;</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class LRETURN extends ReturnInstruction {
- public LRETURN() {
- super(com.sun.org.apache.bcel.internal.Constants.LRETURN);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitExceptionThrower(this);
- v.visitTypedInstruction(this);
- v.visitStackConsumer(this);
- v.visitReturnInstruction(this);
- v.visitLRETURN(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/LSHL.java b/src/com/sun/org/apache/bcel/internal/generic/LSHL.java
deleted file mode 100644
index 780ef7a..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/LSHL.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * LSHL - Arithmetic shift left long
- * <PRE>Stack: ..., value1.word1, value1.word2, value2 -&gt; ..., result.word1, result.word2</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class LSHL extends ArithmeticInstruction {
- public LSHL() {
- super(com.sun.org.apache.bcel.internal.Constants.LSHL);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitArithmeticInstruction(this);
- v.visitLSHL(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/LSHR.java b/src/com/sun/org/apache/bcel/internal/generic/LSHR.java
deleted file mode 100644
index b4993b5..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/LSHR.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * LSHR - Arithmetic shift right long
- * <PRE>Stack: ..., value1.word1, value1.word2, value2 -&gt; ..., result.word1, result.word2</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class LSHR extends ArithmeticInstruction {
- public LSHR() {
- super(com.sun.org.apache.bcel.internal.Constants.LSHR);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitArithmeticInstruction(this);
- v.visitLSHR(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/LSTORE.java b/src/com/sun/org/apache/bcel/internal/generic/LSTORE.java
deleted file mode 100644
index 41d3481..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/LSTORE.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * LSTORE - Store long into local variable
- * <PRE>Stack: ..., value.word1, value.word2 -&gt; ... </PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class LSTORE extends StoreInstruction {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- LSTORE() {
- super(com.sun.org.apache.bcel.internal.Constants.LSTORE, com.sun.org.apache.bcel.internal.Constants.LSTORE_0);
- }
-
- public LSTORE(int n) {
- super(com.sun.org.apache.bcel.internal.Constants.LSTORE, com.sun.org.apache.bcel.internal.Constants.LSTORE_0, n);
- }
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- super.accept(v);
- v.visitLSTORE(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/LSUB.java b/src/com/sun/org/apache/bcel/internal/generic/LSUB.java
deleted file mode 100644
index 38ea67d..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/LSUB.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * LSUB - Substract longs
- * <PRE>Stack: ..., value1.word1, value1.word2, value2.word1, value2.word2 -&gt;</PRE>
- * ..., result.word1, result.word2
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class LSUB extends ArithmeticInstruction {
- public LSUB() {
- super(com.sun.org.apache.bcel.internal.Constants.LSUB);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitArithmeticInstruction(this);
- v.visitLSUB(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/LUSHR.java b/src/com/sun/org/apache/bcel/internal/generic/LUSHR.java
deleted file mode 100644
index 6d89c27..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/LUSHR.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * LUSHR - Logical shift right long
- * <PRE>Stack: ..., value1, value2 -&gt; ..., result</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class LUSHR extends ArithmeticInstruction {
- public LUSHR() {
- super(com.sun.org.apache.bcel.internal.Constants.LUSHR);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitArithmeticInstruction(this);
- v.visitLUSHR(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/LXOR.java b/src/com/sun/org/apache/bcel/internal/generic/LXOR.java
deleted file mode 100644
index 6ebd5da..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/LXOR.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * LXOR - Bitwise XOR long
- * <PRE>Stack: ..., value1, value2 -&gt; ..., result</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class LXOR extends ArithmeticInstruction {
- public LXOR() {
- super(com.sun.org.apache.bcel.internal.Constants.LXOR);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitTypedInstruction(this);
- v.visitStackProducer(this);
- v.visitStackConsumer(this);
- v.visitArithmeticInstruction(this);
- v.visitLXOR(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/LineNumberGen.java b/src/com/sun/org/apache/bcel/internal/generic/LineNumberGen.java
deleted file mode 100644
index a8427a8..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/LineNumberGen.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.classfile.*;
-
-/**
- * This class represents a line number within a method, i.e., give an instruction
- * a line number corresponding to the source code line.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see LineNumber
- * @see MethodGen
- */
-public class LineNumberGen
- implements InstructionTargeter, Cloneable, java.io.Serializable
-{
- private InstructionHandle ih;
- private int src_line;
-
- /**
- * Create a line number.
- *
- * @param ih instruction handle to reference
- */
- public LineNumberGen(InstructionHandle ih, int src_line) {
- setInstruction(ih);
- setSourceLine(src_line);
- }
-
- /**
- * @return true, if ih is target of this line number
- */
- @Override
- public boolean containsTarget(InstructionHandle ih) {
- return this.ih == ih;
- }
-
- /**
- * @param old_ih old target
- * @param new_ih new target
- */
- @Override
- public void updateTarget(InstructionHandle old_ih, InstructionHandle new_ih) {
- if(old_ih != ih)
- throw new ClassGenException("Not targeting " + old_ih + ", but " + ih + "}");
- else
- setInstruction(new_ih);
- }
-
- /**
- * Get LineNumber attribute .
- *
- * This relies on that the instruction list has already been dumped to byte code or
- * or that the `setPositions' methods has been called for the instruction list.
- */
- public LineNumber getLineNumber() {
- return new LineNumber(ih.getPosition(), src_line);
- }
-
- public final void setInstruction(InstructionHandle ih) {
- BranchInstruction.notifyTargetChanging(this.ih, this);
- this.ih = ih;
- BranchInstruction.notifyTargetChanged(this.ih, this);
- }
-
- @Override
- public Object clone() {
- try {
- return super.clone();
- } catch(CloneNotSupportedException e) {
- System.err.println(e);
- return null;
- }
- }
-
- public InstructionHandle getInstruction() { return ih; }
- public void setSourceLine(int src_line) { this.src_line = src_line; }
- public int getSourceLine() { return src_line; }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/LoadClass.java b/src/com/sun/org/apache/bcel/internal/generic/LoadClass.java
deleted file mode 100644
index e401904..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/LoadClass.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * Denotes that an instruction may start the process of loading and resolving
- * the referenced class in the Virtual Machine.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public interface LoadClass {
- /**
- * Returns the ObjectType of the referenced class or interface
- * that may be loaded and resolved.
- * @return object type that may be loaded or null if a primitive is
- * referenced
- */
- public ObjectType getLoadClassType(ConstantPoolGen cpg);
-
- /**
- * Returns the type associated with this instruction.
- * LoadClass instances are always typed, but this type
- * does not always refer to the type of the class or interface
- * that it possibly forces to load. For example, GETFIELD would
- * return the type of the field and not the type of the class
- * where the field is defined.
- * If no class is forced to be loaded, <B>null</B> is returned.
- * An example for this is an ANEWARRAY instruction that creates
- * an int[][].
- * @see #getLoadClassType(ConstantPoolGen)
- */
- public Type getType(ConstantPoolGen cpg);
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/LoadInstruction.java b/src/com/sun/org/apache/bcel/internal/generic/LoadInstruction.java
deleted file mode 100644
index a35e020..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/LoadInstruction.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * Denotes an unparameterized instruction to load a value from a local
- * variable, e.g. ILOAD.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public abstract class LoadInstruction extends LocalVariableInstruction
- implements PushInstruction
-{
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- * tag and length are defined in readInstruction and initFromFile, respectively.
- */
- LoadInstruction(short canon_tag, short c_tag) {
- super(canon_tag, c_tag);
- }
-
- /**
- * @param opcode Instruction opcode
- * @param c_tag Instruction number for compact version, ALOAD_0, e.g.
- * @param n local variable index (unsigned short)
- */
- protected LoadInstruction(short opcode, short c_tag, int n) {
- super(opcode, c_tag, n);
- }
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackProducer(this);
- v.visitPushInstruction(this);
- v.visitTypedInstruction(this);
- v.visitLocalVariableInstruction(this);
- v.visitLoadInstruction(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/LocalVariableGen.java b/src/com/sun/org/apache/bcel/internal/generic/LocalVariableGen.java
deleted file mode 100644
index 1f2fd86..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/LocalVariableGen.java
+++ /dev/null
@@ -1,290 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import com.sun.org.apache.bcel.internal.classfile.*;
-import java.util.Objects;
-
-/**
- * This class represents a local variable within a method. It contains its
- * scope, name and type. The generated LocalVariable object can be obtained
- * with getLocalVariable which needs the instruction list and the constant
- * pool as parameters.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see LocalVariable
- * @see MethodGen
- */
-public class LocalVariableGen
- implements InstructionTargeter, NamedAndTyped, Cloneable,
- java.io.Serializable
-{
- private final int index;
- private String name;
- private Type type;
- private InstructionHandle start, end;
-
- /**
- * Generate a local variable that with index `index'. Note that double and long
- * variables need two indexs. Index indices have to be provided by the user.
- *
- * @param index index of local variable
- * @param name its name
- * @param type its type
- * @param start from where the instruction is valid (null means from the start)
- * @param end until where the instruction is valid (null means to the end)
- */
- public LocalVariableGen(int index, String name, Type type,
- InstructionHandle start, InstructionHandle end) {
- if((index < 0) || (index > Constants.MAX_SHORT))
- throw new ClassGenException("Invalid index index: " + index);
-
- this.name = name;
- this.type = type;
- this.index = index;
- setStart(start);
- setEnd(end);
- }
-
- /**
- * Get LocalVariable object.
- *
- * This relies on that the instruction list has already been dumped to byte code or
- * or that the `setPositions' methods has been called for the instruction list.
- *
- * Note that for local variables whose scope end at the last
- * instruction of the method's code, the JVM specification is ambiguous:
- * both a start_pc+length ending at the last instruction and
- * start_pc+length ending at first index beyond the end of the code are
- * valid.
- *
- * @param il instruction list (byte code) which this variable belongs to
- * @param cp constant pool
- */
- public LocalVariable getLocalVariable(ConstantPoolGen cp) {
- int start_pc = start.getPosition();
- int length = end.getPosition() - start_pc;
-
- if(length > 0)
- length += end.getInstruction().getLength();
-
- int name_index = cp.addUtf8(name);
- int signature_index = cp.addUtf8(type.getSignature());
-
- return new LocalVariable(start_pc, length, name_index,
- signature_index, index, cp.getConstantPool());
- }
-
- public int getIndex() { return index; }
- @Override
- public void setName(String name) { this.name = name; }
- @Override
- public String getName() { return name; }
- @Override
- public void setType(Type type) { this.type = type; }
- @Override
- public Type getType() { return type; }
-
- public InstructionHandle getStart() { return start; }
- public InstructionHandle getEnd() { return end; }
-
- /**
- * Remove this from any known HashSet in which it might be registered.
- */
- void notifyTargetChanging() {
- // hashCode depends on 'index', 'start', and 'end'.
- // Therefore before changing any of these values we
- // need to unregister 'this' from any HashSet where
- // this is registered, and then we need to add it
- // back...
-
- // Unregister 'this' from the HashSet held by 'start'.
- BranchInstruction.notifyTargetChanging(this.start, this);
- if (this.end != this.start) {
- // Since hashCode() is going to change we need to unregister
- // 'this' both form 'start' and 'end'.
- // Unregister 'this' from the HashSet held by 'end'.
- BranchInstruction.notifyTargetChanging(this.end, this);
- }
- }
-
- /**
- * Add back 'this' in all HashSet in which it should be registered.
- **/
- void notifyTargetChanged() {
- // hashCode depends on 'index', 'start', and 'end'.
- // Therefore before changing any of these values we
- // need to unregister 'this' from any HashSet where
- // this is registered, and then we need to add it
- // back...
-
- // Register 'this' in the HashSet held by start.
- BranchInstruction.notifyTargetChanged(this.start, this);
- if (this.end != this.start) {
- // Since hashCode() has changed we need to register
- // 'this' again in 'end'.
- // Add back 'this' in the HashSet held by 'end'.
- BranchInstruction.notifyTargetChanged(this.end, this);
- }
- }
-
- public final void setStart(InstructionHandle start) {
-
- // Call notifyTargetChanging *before* modifying this,
- // as the code triggered by notifyTargetChanging
- // depends on this pointing to the 'old' start.
- notifyTargetChanging();
-
- this.start = start;
-
- // call notifyTargetChanged *after* modifying this,
- // as the code triggered by notifyTargetChanged
- // depends on this pointing to the 'new' start.
- notifyTargetChanged();
- }
-
- public final void setEnd(InstructionHandle end) {
- // call notifyTargetChanging *before* modifying this,
- // as the code triggered by notifyTargetChanging
- // depends on this pointing to the 'old' end.
- // Unregister 'this' from the HashSet held by the 'old' end.
- notifyTargetChanging();
-
- this.end = end;
-
- // call notifyTargetChanged *after* modifying this,
- // as the code triggered by notifyTargetChanged
- // depends on this pointing to the 'new' end.
- // Register 'this' in the HashSet held by the 'new' end.
- notifyTargetChanged();
-
- }
-
- /**
- * @param old_ih old target, either start or end
- * @param new_ih new target
- */
- @Override
- public void updateTarget(InstructionHandle old_ih, InstructionHandle new_ih) {
- boolean targeted = false;
-
- if(start == old_ih) {
- targeted = true;
- setStart(new_ih);
- }
-
- if(end == old_ih) {
- targeted = true;
- setEnd(new_ih);
- }
-
- if(!targeted)
- throw new ClassGenException("Not targeting " + old_ih + ", but {" + start + ", " +
- end + "}");
- }
-
- /**
- * @return true, if ih is target of this variable
- */
- @Override
- public boolean containsTarget(InstructionHandle ih) {
- return (start == ih) || (end == ih);
- }
-
- /**
- * We consider two local variables to be equal, if they use the same index and
- * are valid in the same range.
- */
- @Override
- public boolean equals(Object o) {
- if (o==this)
- return true;
-
- if(!(o instanceof LocalVariableGen))
- return false;
-
- LocalVariableGen l = (LocalVariableGen)o;
- return (l.index == index) && (l.start == start) && (l.end == end);
- }
-
- @Override
- public int hashCode() {
- int hash = 7;
- hash = 59 * hash + this.index;
- hash = 59 * hash + Objects.hashCode(this.start);
- hash = 59 * hash + Objects.hashCode(this.end);
- return hash;
- }
-
- @Override
- public String toString() {
- return "LocalVariableGen(" + name + ", " + type + ", " + start + ", " + end + ")";
- }
-
- @Override
- public Object clone() {
- try {
- return super.clone();
- } catch(CloneNotSupportedException e) {
- System.err.println(e);
- return null;
- }
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/LocalVariableInstruction.java b/src/com/sun/org/apache/bcel/internal/generic/LocalVariableInstruction.java
deleted file mode 100644
index f10b91d..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/LocalVariableInstruction.java
+++ /dev/null
@@ -1,229 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import java.io.*;
-import com.sun.org.apache.bcel.internal.util.ByteSequence;
-import com.sun.org.apache.bcel.internal.classfile.Utility;
-import com.sun.org.apache.bcel.internal.Constants;
-
-/**
- * Abstract super class for instructions dealing with local variables.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public abstract class LocalVariableInstruction extends Instruction
- implements TypedInstruction, IndexedInstruction {
- protected int n = -1; // index of referenced variable
- private short c_tag = -1; // compact version, such as ILOAD_0
- private short canon_tag = -1; // canonical tag such as ILOAD
-
- private final boolean wide() { return n > Constants.MAX_BYTE; }
-
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- * tag and length are defined in readInstruction and initFromFile, respectively.
- */
- LocalVariableInstruction(short canon_tag, short c_tag) {
- super();
- this.canon_tag = canon_tag;
- this.c_tag = c_tag;
- }
-
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Also used by IINC()!
- */
- LocalVariableInstruction() {
- }
-
- /**
- * @param opcode Instruction opcode
- * @param c_tag Instruction number for compact version, ALOAD_0, e.g.
- * @param n local variable index (unsigned short)
- */
- protected LocalVariableInstruction(short opcode, short c_tag, int n) {
- super(opcode, (short)2);
-
- this.c_tag = c_tag;
- canon_tag = opcode;
-
- setIndex(n);
- }
-
- /**
- * Dump instruction as byte code to stream out.
- * @param out Output stream
- */
- public void dump(DataOutputStream out) throws IOException {
- if(wide()) // Need WIDE prefix ?
- out.writeByte(Constants.WIDE);
-
- out.writeByte(opcode);
-
- if(length > 1) { // Otherwise ILOAD_n, instruction, e.g.
- if(wide())
- out.writeShort(n);
- else
- out.writeByte(n);
- }
- }
-
- /**
- * Long output format:
- *
- * &lt;name of opcode&gt; "["&lt;opcode number&gt;"]"
- * "("&lt;length of instruction&gt;")" "&lt;"&lt; local variable index&gt;"&gt;"
- *
- * @param verbose long/short format switch
- * @return mnemonic for instruction
- */
- public String toString(boolean verbose) {
- if(((opcode >= Constants.ILOAD_0) &&
- (opcode <= Constants.ALOAD_3)) ||
- ((opcode >= Constants.ISTORE_0) &&
- (opcode <= Constants.ASTORE_3)))
- return super.toString(verbose);
- else
- return super.toString(verbose) + " " + n;
- }
-
- /**
- * Read needed data (e.g. index) from file.
- * PRE: (ILOAD <= tag <= ALOAD_3) || (ISTORE <= tag <= ASTORE_3)
- */
- protected void initFromFile(ByteSequence bytes, boolean wide)
- throws IOException
- {
- if(wide) {
- n = bytes.readUnsignedShort();
- length = 4;
- } else if(((opcode >= Constants.ILOAD) &&
- (opcode <= Constants.ALOAD)) ||
- ((opcode >= Constants.ISTORE) &&
- (opcode <= Constants.ASTORE))) {
- n = bytes.readUnsignedByte();
- length = 2;
- } else if(opcode <= Constants.ALOAD_3) { // compact load instruction such as ILOAD_2
- n = (opcode - Constants.ILOAD_0) % 4;
- length = 1;
- } else { // Assert ISTORE_0 <= tag <= ASTORE_3
- n = (opcode - Constants.ISTORE_0) % 4;
- length = 1;
- }
- }
-
- /**
- * @return local variable index referred by this instruction.
- */
- public final int getIndex() { return n; }
-
- /**
- * Set the local variable index
- */
- public void setIndex(int n) {
- if((n < 0) || (n > Constants.MAX_SHORT))
- throw new ClassGenException("Illegal value: " + n);
-
- this.n = n;
-
- if(n >= 0 && n <= 3) { // Use more compact instruction xLOAD_n
- opcode = (short)(c_tag + n);
- length = 1;
- } else {
- opcode = canon_tag;
-
- if(wide()) // Need WIDE prefix ?
- length = 4;
- else
- length = 2;
- }
- }
-
- /** @return canonical tag for instruction, e.g., ALOAD for ALOAD_0
- */
- public short getCanonicalTag() {
- return canon_tag;
- }
-
- /**
- * Returns the type associated with the instruction -
- * in case of ALOAD or ASTORE Type.OBJECT is returned.
- * This is just a bit incorrect, because ALOAD and ASTORE
- * may work on every ReferenceType (including Type.NULL) and
- * ASTORE may even work on a ReturnaddressType .
- * @return type associated with the instruction
- */
- public Type getType(ConstantPoolGen cp) {
- switch(canon_tag) {
- case Constants.ILOAD: case Constants.ISTORE:
- return Type.INT;
- case Constants.LLOAD: case Constants.LSTORE:
- return Type.LONG;
- case Constants.DLOAD: case Constants.DSTORE:
- return Type.DOUBLE;
- case Constants.FLOAD: case Constants.FSTORE:
- return Type.FLOAT;
- case Constants.ALOAD: case Constants.ASTORE:
- return Type.OBJECT;
-
- default: throw new ClassGenException("Oops: unknown case in switch" + canon_tag);
- }
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/MONITORENTER.java b/src/com/sun/org/apache/bcel/internal/generic/MONITORENTER.java
deleted file mode 100644
index e50dde4..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/MONITORENTER.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * MONITORENTER - Enter monitor for object
- * <PRE>Stack: ..., objectref -&gt; ...</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class MONITORENTER extends Instruction
- implements ExceptionThrower, StackConsumer {
- public MONITORENTER() {
- super(com.sun.org.apache.bcel.internal.Constants.MONITORENTER, (short)1);
- }
-
- public Class[] getExceptions() {
- return new Class[] { com.sun.org.apache.bcel.internal.ExceptionConstants.NULL_POINTER_EXCEPTION };
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitExceptionThrower(this);
- v.visitStackConsumer(this);
- v.visitMONITORENTER(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/MONITOREXIT.java b/src/com/sun/org/apache/bcel/internal/generic/MONITOREXIT.java
deleted file mode 100644
index c088aa8..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/MONITOREXIT.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * MONITOREXIT - Exit monitor for object
- * <PRE>Stack: ..., objectref -&gt; ...</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class MONITOREXIT extends Instruction
- implements ExceptionThrower, StackConsumer {
- public MONITOREXIT() {
- super(com.sun.org.apache.bcel.internal.Constants.MONITOREXIT, (short)1);
- }
-
- public Class[] getExceptions() {
- return new Class[] { com.sun.org.apache.bcel.internal.ExceptionConstants.NULL_POINTER_EXCEPTION };
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitExceptionThrower(this);
- v.visitStackConsumer(this);
- v.visitMONITOREXIT(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/MULTIANEWARRAY.java b/src/com/sun/org/apache/bcel/internal/generic/MULTIANEWARRAY.java
deleted file mode 100644
index 6a49011..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/MULTIANEWARRAY.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import java.io.*;
-import com.sun.org.apache.bcel.internal.util.ByteSequence;
-import com.sun.org.apache.bcel.internal.classfile.ConstantPool;
-import com.sun.org.apache.bcel.internal.ExceptionConstants;
-
-/**
- * MULTIANEWARRAY - Create new mutidimensional array of references
- * <PRE>Stack: ..., count1, [count2, ...] -&gt; ..., arrayref</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class MULTIANEWARRAY extends CPInstruction implements LoadClass, AllocationInstruction, ExceptionThrower {
- private short dimensions;
-
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- MULTIANEWARRAY() {}
-
- public MULTIANEWARRAY(int index, short dimensions) {
- super(com.sun.org.apache.bcel.internal.Constants.MULTIANEWARRAY, index);
-
- if(dimensions < 1)
- throw new ClassGenException("Invalid dimensions value: " + dimensions);
-
- this.dimensions = dimensions;
- length = 4;
- }
-
- /**
- * Dump instruction as byte code to stream out.
- * @param out Output stream
- */
- public void dump(DataOutputStream out) throws IOException {
- out.writeByte(opcode);
- out.writeShort(index);
- out.writeByte(dimensions);
- }
-
- /**
- * Read needed data (i.e., no. dimension) from file.
- */
- protected void initFromFile(ByteSequence bytes, boolean wide)
- throws IOException
- {
- super.initFromFile(bytes, wide);
- dimensions = bytes.readByte();
- length = 4;
- }
-
- /**
- * @return number of dimensions to be created
- */
- public final short getDimensions() { return dimensions; }
-
- /**
- * @return mnemonic for instruction
- */
- public String toString(boolean verbose) {
- return super.toString(verbose) + " " + index + " " + dimensions;
- }
-
- /**
- * @return mnemonic for instruction with symbolic references resolved
- */
- public String toString(ConstantPool cp) {
- return super.toString(cp) + " " + dimensions;
- }
-
- /**
- * Also works for instructions whose stack effect depends on the
- * constant pool entry they reference.
- * @return Number of words consumed from stack by this instruction
- */
- public int consumeStack(ConstantPoolGen cpg) { return dimensions; }
-
- public Class[] getExceptions() {
- Class[] cs = new Class[2 + ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION.length];
-
- System.arraycopy(ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION, 0,
- cs, 0, ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION.length);
-
- cs[ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION.length+1] = ExceptionConstants.NEGATIVE_ARRAY_SIZE_EXCEPTION;
- cs[ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION.length] = ExceptionConstants.ILLEGAL_ACCESS_ERROR;
-
- return cs;
- }
-
- public ObjectType getLoadClassType(ConstantPoolGen cpg) {
- Type t = getType(cpg);
-
- if (t instanceof ArrayType){
- t = ((ArrayType) t).getBasicType();
- }
-
- return (t instanceof ObjectType)? (ObjectType) t : null;
- }
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitLoadClass(this);
- v.visitAllocationInstruction(this);
- v.visitExceptionThrower(this);
- v.visitTypedInstruction(this);
- v.visitCPInstruction(this);
- v.visitMULTIANEWARRAY(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/MethodGen.java b/src/com/sun/org/apache/bcel/internal/generic/MethodGen.java
deleted file mode 100644
index 6934582..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/MethodGen.java
+++ /dev/null
@@ -1,1089 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import com.sun.org.apache.bcel.internal.classfile.*;
-import java.util.*;
-
-/**
- * Template class for building up a method. This is done by defining exception
- * handlers, adding thrown exceptions, local variables and attributes, whereas
- * the `LocalVariableTable' and `LineNumberTable' attributes will be set
- * automatically for the code. Use stripAttributes() if you don't like this.
- *
- * While generating code it may be necessary to insert NOP operations. You can
- * use the `removeNOPs' method to get rid off them.
- * The resulting method object can be obtained via the `getMethod()' method.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @author <A HREF="http://www.vmeng.com/beard">Patrick C. Beard</A> [setMaxStack()]
- * @see InstructionList
- * @see Method
- */
-public class MethodGen extends FieldGenOrMethodGen {
- private String class_name;
- private Type[] arg_types;
- private String[] arg_names;
- private int max_locals;
- private int max_stack;
- private InstructionList il;
- private boolean strip_attributes;
-
- private ArrayList variable_vec = new ArrayList();
- private ArrayList type_vec = new ArrayList();
- private ArrayList line_number_vec = new ArrayList();
- private ArrayList exception_vec = new ArrayList();
- private ArrayList throws_vec = new ArrayList();
- private ArrayList code_attrs_vec = new ArrayList();
-
- /**
- * Declare method. If the method is non-static the constructor
- * automatically declares a local variable `$this' in slot 0. The
- * actual code is contained in the `il' parameter, which may further
- * manipulated by the user. But he must take care not to remove any
- * instruction (handles) that are still referenced from this object.
- *
- * For example one may not add a local variable and later remove the
- * instructions it refers to without causing havoc. It is safe
- * however if you remove that local variable, too.
- *
- * @param access_flags access qualifiers
- * @param return_type method type
- * @param arg_types argument types
- * @param arg_names argument names (if this is null, default names will be provided
- * for them)
- * @param method_name name of method
- * @param class_name class name containing this method (may be null, if you don't care)
- * @param il instruction list associated with this method, may be null only for
- * abstract or native methods
- * @param cp constant pool
- */
- public MethodGen(int access_flags, Type return_type, Type[] arg_types,
- String[] arg_names, String method_name, String class_name,
- InstructionList il, ConstantPoolGen cp) {
- setAccessFlags(access_flags);
- setType(return_type);
- setArgumentTypes(arg_types);
- setArgumentNames(arg_names);
- setName(method_name);
- setClassName(class_name);
- setInstructionList(il);
- setConstantPool(cp);
-
- boolean abstract_ = isAbstract() || isNative();
- InstructionHandle start = null;
- InstructionHandle end = null;
-
- if(!abstract_) {
- start = il.getStart();
- end = il.getEnd();
-
- /* Add local variables, namely the implicit `this' and the arguments
- */
- if(!isStatic() && (class_name != null)) { // Instance method -> `this' is local var 0
- addLocalVariable("this", new ObjectType(class_name), start, end);
- }
- }
-
- if(arg_types != null) {
- int size = arg_types.length;
-
- for(int i=0; i < size; i++) {
- if(Type.VOID == arg_types[i]) {
- throw new ClassGenException("'void' is an illegal argument type for a method");
- }
- }
-
- if(arg_names != null) { // Names for variables provided?
- if(size != arg_names.length)
- throw new ClassGenException("Mismatch in argument array lengths: " +
- size + " vs. " + arg_names.length);
- } else { // Give them dummy names
- arg_names = new String[size];
-
- for(int i=0; i < size; i++)
- arg_names[i] = "arg" + i;
-
- setArgumentNames(arg_names);
- }
-
- if(!abstract_) {
- for(int i=0; i < size; i++) {
- addLocalVariable(arg_names[i], arg_types[i], start, end);
- }
- }
- }
- }
-
- /**
- * Instantiate from existing method.
- *
- * @param m method
- * @param class_name class name containing this method
- * @param cp constant pool
- */
- public MethodGen(Method m, String class_name, ConstantPoolGen cp) {
- this(m.getAccessFlags(), Type.getReturnType(m.getSignature()),
- Type.getArgumentTypes(m.getSignature()), null /* may be overridden anyway */,
- m.getName(), class_name,
- ((m.getAccessFlags() & (Constants.ACC_ABSTRACT | Constants.ACC_NATIVE)) == 0)?
- new InstructionList(m.getCode().getCode()) : null,
- cp);
-
- Attribute[] attributes = m.getAttributes();
- for(int i=0; i < attributes.length; i++) {
- Attribute a = attributes[i];
-
- if(a instanceof Code) {
- Code c = (Code)a;
- setMaxStack(c.getMaxStack());
- setMaxLocals(c.getMaxLocals());
-
- CodeException[] ces = c.getExceptionTable();
-
- if(ces != null) {
- for(int j=0; j < ces.length; j++) {
- CodeException ce = ces[j];
- int type = ce.getCatchType();
- ObjectType c_type = null;
-
- if(type > 0) {
- String cen = m.getConstantPool().getConstantString(type, Constants.CONSTANT_Class);
- c_type = new ObjectType(cen);
- }
-
- int end_pc = ce.getEndPC();
- int length = m.getCode().getCode().length;
-
- InstructionHandle end;
-
- if(length == end_pc) { // May happen, because end_pc is exclusive
- end = il.getEnd();
- } else {
- end = il.findHandle(end_pc);
- end = end.getPrev(); // Make it inclusive
- }
-
- addExceptionHandler(il.findHandle(ce.getStartPC()), end,
- il.findHandle(ce.getHandlerPC()), c_type);
- }
- }
-
- Attribute[] c_attributes = c.getAttributes();
- for(int j=0; j < c_attributes.length; j++) {
- a = c_attributes[j];
-
- if(a instanceof LineNumberTable) {
- LineNumber[] ln = ((LineNumberTable)a).getLineNumberTable();
-
- for(int k=0; k < ln.length; k++) {
- LineNumber l = ln[k];
- addLineNumber(il.findHandle(l.getStartPC()), l.getLineNumber());
- }
- } else if(a instanceof LocalVariableTable) {
- LocalVariable[] lv = ((LocalVariableTable)a).getLocalVariableTable();
-
- removeLocalVariables();
-
- for(int k=0; k < lv.length; k++) {
- LocalVariable l = lv[k];
- InstructionHandle start = il.findHandle(l.getStartPC());
- InstructionHandle end = il.findHandle(l.getStartPC() + l.getLength());
-
- // Repair malformed handles
- if(null == start) {
- start = il.getStart();
- }
-
- if(null == end) {
- end = il.getEnd();
- }
-
- addLocalVariable(l.getName(), Type.getType(l.getSignature()),
- l.getIndex(), start, end);
- }
- } else if (a instanceof LocalVariableTypeTable) {
- LocalVariable[] lv = ((LocalVariableTypeTable) a).getLocalVariableTypeTable();
- removeLocalVariableTypes();
- for (int k = 0; k < lv.length; k++) {
- LocalVariable l = lv[k];
- InstructionHandle start = il.findHandle(l.getStartPC());
- InstructionHandle end = il.findHandle(l.getStartPC() + l.getLength());
- // Repair malformed handles
- if (null == start) {
- start = il.getStart();
- }
- if (null == end) {
- end = il.getEnd();
- }
- addLocalVariableType(l.getName(), Type.getType(l.getSignature()), l
- .getIndex(), start, end);
- }
- } else
- addCodeAttribute(a);
- }
- } else if(a instanceof ExceptionTable) {
- String[] names = ((ExceptionTable)a).getExceptionNames();
- for(int j=0; j < names.length; j++)
- addException(names[j]);
- } else
- addAttribute(a);
- }
- }
-
- /**
- * Adds a local variable to this method.
- *
- * @param name variable name
- * @param type variable type
- * @param slot the index of the local variable, if type is long or double, the next available
- * index is slot+2
- * @param start from where the variable is valid
- * @param end until where the variable is valid
- * @return new local variable object
- * @see LocalVariable
- */
- public LocalVariableGen addLocalVariable(String name, Type type, int slot,
- InstructionHandle start,
- InstructionHandle end) {
- byte t = type.getType();
-
- if(t != Constants.T_ADDRESS) {
- int add = type.getSize();
-
- if(slot + add > max_locals)
- max_locals = slot + add;
-
- LocalVariableGen l = new LocalVariableGen(slot, name, type, start, end);
- int i;
-
- if((i = variable_vec.indexOf(l)) >= 0) // Overwrite if necessary
- variable_vec.set(i, l);
- else
- variable_vec.add(l);
-
- return l;
- } else {
- throw new IllegalArgumentException("Can not use " + type +
- " as type for local variable");
-
- }
- }
-
- /**
- * Adds a local variable to this method and assigns an index automatically.
- *
- * @param name variable name
- * @param type variable type
- * @param start from where the variable is valid, if this is null,
- * it is valid from the start
- * @param end until where the variable is valid, if this is null,
- * it is valid to the end
- * @return new local variable object
- * @see LocalVariable
- */
- public LocalVariableGen addLocalVariable(String name, Type type,
- InstructionHandle start,
- InstructionHandle end) {
- return addLocalVariable(name, type, max_locals, start, end);
- }
-
- /**
- * Remove a local variable, its slot will not be reused, if you do not use addLocalVariable
- * with an explicit index argument.
- */
- public void removeLocalVariable(LocalVariableGen l) {
- variable_vec.remove(l);
- }
-
- /**
- * Remove all local variables.
- */
- public void removeLocalVariables() {
- variable_vec.clear();
- }
-
- /**
- * Sort local variables by index
- */
- private static final void sort(LocalVariableGen[] vars, int l, int r) {
- int i = l, j = r;
- int m = vars[(l + r) / 2].getIndex();
- LocalVariableGen h;
-
- do {
- while(vars[i].getIndex() < m) i++;
- while(m < vars[j].getIndex()) j--;
-
- if(i <= j) {
- h=vars[i]; vars[i]=vars[j]; vars[j]=h; // Swap elements
- i++; j--;
- }
- } while(i <= j);
-
- if(l < j) sort(vars, l, j);
- if(i < r) sort(vars, i, r);
- }
-
- /*
- * If the range of the variable has not been set yet, it will be set to be valid from
- * the start to the end of the instruction list.
- *
- * @return array of declared local variables sorted by index
- */
- public LocalVariableGen[] getLocalVariables() {
- int size = variable_vec.size();
- LocalVariableGen[] lg = new LocalVariableGen[size];
- variable_vec.toArray(lg);
-
- for(int i=0; i < size; i++) {
- if(lg[i].getStart() == null)
- lg[i].setStart(il.getStart());
-
- if(lg[i].getEnd() == null)
- lg[i].setEnd(il.getEnd());
- }
-
- if(size > 1)
- sort(lg, 0, size - 1);
-
- return lg;
- }
-
- /*
- * If the range of the variable has not been set yet, it will be set to be
- * val id from the start to the end of the instruction list.
- *
- * @return array of declared local variable types sorted by index
- */
- private LocalVariableGen[] getLocalVariableTypes() {
- int size = type_vec.size();
- LocalVariableGen[] lg = new LocalVariableGen[size];
- type_vec.toArray(lg);
-
- for(int i=0; i < size; i++) {
- if(lg[i].getStart() == null)
- lg[i].setStart(il.getStart());
-
- if(lg[i].getEnd() == null)
- lg[i].setEnd(il.getEnd());
- }
-
- if(size > 1)
- sort(lg, 0, size - 1);
-
- return lg;
- }
-
- /**
- * @return `LocalVariableTable' attribute of all the local variables of this method.
- */
- public LocalVariableTable getLocalVariableTable(ConstantPoolGen cp) {
- LocalVariableGen[] lg = getLocalVariables();
- int size = lg.length;
- LocalVariable[] lv = new LocalVariable[size];
-
- for(int i=0; i < size; i++)
- lv[i] = lg[i].getLocalVariable(cp);
-
- return new LocalVariableTable(cp.addUtf8("LocalVariableTable"),
- 2 + lv.length * 10, lv, cp.getConstantPool());
- }
-
- /**
- * @return `LocalVariableTypeTable' attribute of all the local variable
- * types of this method.
- */
- public LocalVariableTypeTable getLocalVariableTypeTable(ConstantPoolGen cp) {
- LocalVariableGen[] lg = getLocalVariableTypes();
- int size = lg.length;
- LocalVariable[] lv = new LocalVariable[size];
-
- for(int i=0; i < size; i++)
- lv[i] = lg[i].getLocalVariable(cp);
-
- return new LocalVariableTypeTable(cp.addUtf8("LocalVariableTypeTable"),
- 2 + lv.length * 10, lv, cp.getConstantPool());
- }
-
- /**
- * Adds a local variable type to this method.
- *
- * @param name variable name
- * @param type variable type
- * @param slot the index of the local variable, if type is long or double, the next available
- * index is slot+2
- * @param start from where the variable is valid
- * @param end until where the variable is valid
- * @return new local variable object
- * @see LocalVariable
- */
- private LocalVariableGen addLocalVariableType(String name, Type type, int slot,
- InstructionHandle start,
- InstructionHandle end) {
- byte t = type.getType();
-
- if(t != Constants.T_ADDRESS) {
- int add = type.getSize();
-
- if(slot + add > max_locals)
- max_locals = slot + add;
-
- LocalVariableGen l = new LocalVariableGen(slot, name, type, start, end);
- int i;
-
- if((i = type_vec.indexOf(l)) >= 0) // Overwrite if necessary
- type_vec.set(i, l);
- else
- type_vec.add(l);
-
- return l;
- } else {
- throw new IllegalArgumentException("Can not use " + type +
- " as type for local variable");
-
- }
- }
-
- /**
- * Remove all local variable types.
- */
- private void removeLocalVariableTypes() {
- type_vec.clear();
- }
-
- /**
- * Give an instruction a line number corresponding to the source code line.
- *
- * @param ih instruction to tag
- * @return new line number object
- * @see LineNumber
- */
- public LineNumberGen addLineNumber(InstructionHandle ih, int src_line) {
- LineNumberGen l = new LineNumberGen(ih, src_line);
- line_number_vec.add(l);
- return l;
- }
-
- /**
- * Remove a line number.
- */
- public void removeLineNumber(LineNumberGen l) {
- line_number_vec.remove(l);
- }
-
- /**
- * Remove all line numbers.
- */
- public void removeLineNumbers() {
- line_number_vec.clear();
- }
-
- /*
- * @return array of line numbers
- */
- public LineNumberGen[] getLineNumbers() {
- LineNumberGen[] lg = new LineNumberGen[line_number_vec.size()];
- line_number_vec.toArray(lg);
- return lg;
- }
-
- /**
- * @return `LineNumberTable' attribute of all the local variables of this method.
- */
- public LineNumberTable getLineNumberTable(ConstantPoolGen cp) {
- int size = line_number_vec.size();
- LineNumber[] ln = new LineNumber[size];
-
- try {
- for(int i=0; i < size; i++)
- ln[i] = ((LineNumberGen)line_number_vec.get(i)).getLineNumber();
- } catch(ArrayIndexOutOfBoundsException e) {} // Never occurs
-
- return new LineNumberTable(cp.addUtf8("LineNumberTable"),
- 2 + ln.length * 4, ln, cp.getConstantPool());
- }
-
- /**
- * Add an exception handler, i.e., specify region where a handler is active and an
- * instruction where the actual handling is done.
- *
- * @param start_pc Start of region (inclusive)
- * @param end_pc End of region (inclusive)
- * @param handler_pc Where handling is done
- * @param catch_type class type of handled exception or null if any
- * exception is handled
- * @return new exception handler object
- */
- public CodeExceptionGen addExceptionHandler(InstructionHandle start_pc,
- InstructionHandle end_pc,
- InstructionHandle handler_pc,
- ObjectType catch_type) {
- if((start_pc == null) || (end_pc == null) || (handler_pc == null))
- throw new ClassGenException("Exception handler target is null instruction");
-
- CodeExceptionGen c = new CodeExceptionGen(start_pc, end_pc,
- handler_pc, catch_type);
- exception_vec.add(c);
- return c;
- }
-
- /**
- * Remove an exception handler.
- */
- public void removeExceptionHandler(CodeExceptionGen c) {
- exception_vec.remove(c);
- }
-
- /**
- * Remove all line numbers.
- */
- public void removeExceptionHandlers() {
- exception_vec.clear();
- }
-
- /*
- * @return array of declared exception handlers
- */
- public CodeExceptionGen[] getExceptionHandlers() {
- CodeExceptionGen[] cg = new CodeExceptionGen[exception_vec.size()];
- exception_vec.toArray(cg);
- return cg;
- }
-
- /**
- * @return code exceptions for `Code' attribute
- */
- private CodeException[] getCodeExceptions() {
- int size = exception_vec.size();
- CodeException[] c_exc = new CodeException[size];
-
- try {
- for(int i=0; i < size; i++) {
- CodeExceptionGen c = (CodeExceptionGen)exception_vec.get(i);
- c_exc[i] = c.getCodeException(cp);
- }
- } catch(ArrayIndexOutOfBoundsException e) {}
-
- return c_exc;
- }
-
- /**
- * Add an exception possibly thrown by this method.
- *
- * @param class_name (fully qualified) name of exception
- */
- public void addException(String class_name) {
- throws_vec.add(class_name);
- }
-
- /**
- * Remove an exception.
- */
- public void removeException(String c) {
- throws_vec.remove(c);
- }
-
- /**
- * Remove all exceptions.
- */
- public void removeExceptions() {
- throws_vec.clear();
- }
-
- /*
- * @return array of thrown exceptions
- */
- public String[] getExceptions() {
- String[] e = new String[throws_vec.size()];
- throws_vec.toArray(e);
- return e;
- }
-
- /**
- * @return `Exceptions' attribute of all the exceptions thrown by this method.
- */
- private ExceptionTable getExceptionTable(ConstantPoolGen cp) {
- int size = throws_vec.size();
- int[] ex = new int[size];
-
- try {
- for(int i=0; i < size; i++)
- ex[i] = cp.addClass((String)throws_vec.get(i));
- } catch(ArrayIndexOutOfBoundsException e) {}
-
- return new ExceptionTable(cp.addUtf8("Exceptions"),
- 2 + 2 * size, ex, cp.getConstantPool());
- }
-
- /**
- * Add an attribute to the code. Currently, the JVM knows about the
- * LineNumberTable, LocalVariableTable and StackMap attributes,
- * where the former two will be generated automatically and the
- * latter is used for the MIDP only. Other attributes will be
- * ignored by the JVM but do no harm.
- *
- * @param a attribute to be added
- */
- public void addCodeAttribute(Attribute a) { code_attrs_vec.add(a); }
-
- /**
- * Remove a code attribute.
- */
- public void removeCodeAttribute(Attribute a) { code_attrs_vec.remove(a); }
-
- /**
- * Remove all code attributes.
- */
- public void removeCodeAttributes() {
- code_attrs_vec.clear();
- }
-
- /**
- * @return all attributes of this method.
- */
- public Attribute[] getCodeAttributes() {
- Attribute[] attributes = new Attribute[code_attrs_vec.size()];
- code_attrs_vec.toArray(attributes);
- return attributes;
- }
-
- /**
- * Get method object. Never forget to call setMaxStack() or setMaxStack(max), respectively,
- * before calling this method (the same applies for max locals).
- *
- * @return method object
- */
- public Method getMethod() {
- String signature = getSignature();
- int name_index = cp.addUtf8(name);
- int signature_index = cp.addUtf8(signature);
-
- /* Also updates positions of instructions, i.e., their indices
- */
- byte[] byte_code = null;
-
- if(il != null)
- byte_code = il.getByteCode();
-
- LineNumberTable lnt = null;
- LocalVariableTable lvt = null;
- LocalVariableTypeTable lvtt = null;
-
- /* Create LocalVariableTable, LocalvariableTypeTable, and LineNumberTable
- * attributes (for debuggers, e.g.)
- */
- if((variable_vec.size() > 0) && !strip_attributes)
- addCodeAttribute(lvt = getLocalVariableTable(cp));
-
- if((type_vec.size() > 0) && !strip_attributes)
- addCodeAttribute(lvtt = getLocalVariableTypeTable(cp));
-
- if((line_number_vec.size() > 0) && !strip_attributes)
- addCodeAttribute(lnt = getLineNumberTable(cp));
-
- Attribute[] code_attrs = getCodeAttributes();
-
- /* Each attribute causes 6 additional header bytes
- */
- int attrs_len = 0;
- for(int i=0; i < code_attrs.length; i++)
- attrs_len += (code_attrs[i].getLength() + 6);
-
- CodeException[] c_exc = getCodeExceptions();
- int exc_len = c_exc.length * 8; // Every entry takes 8 bytes
-
- Code code = null;
-
- if((il != null) && !isAbstract()) {
- // Remove any stale code attribute
- Attribute[] attributes = getAttributes();
- for(int i=0; i < attributes.length; i++) {
- Attribute a = attributes[i];
-
- if(a instanceof Code)
- removeAttribute(a);
- }
-
- code = new Code(cp.addUtf8("Code"),
- 8 + byte_code.length + // prologue byte code
- 2 + exc_len + // exceptions
- 2 + attrs_len, // attributes
- max_stack, max_locals,
- byte_code, c_exc,
- code_attrs,
- cp.getConstantPool());
-
- addAttribute(code);
- }
-
- ExceptionTable et = null;
-
- if(throws_vec.size() > 0)
- addAttribute(et = getExceptionTable(cp)); // Add `Exceptions' if there are "throws" clauses
-
- Method m = new Method(access_flags, name_index, signature_index,
- getAttributes(), cp.getConstantPool());
-
- // Undo effects of adding attributes
- if(lvt != null) removeCodeAttribute(lvt);
- if(lvtt != null) removeCodeAttribute(lvtt);
- if(lnt != null) removeCodeAttribute(lnt);
- if(code != null) removeAttribute(code);
- if(et != null) removeAttribute(et);
-
- return m;
- }
-
- /**
- * Remove all NOPs from the instruction list (if possible) and update every
- * object refering to them, i.e., branch instructions, local variables and
- * exception handlers.
- */
- public void removeNOPs() {
- if(il != null) {
- InstructionHandle next;
- /* Check branch instructions.
- */
- for(InstructionHandle ih = il.getStart(); ih != null; ih = next) {
- next = ih.next;
-
- if((next != null) && (ih.getInstruction() instanceof NOP)) {
- try {
- il.delete(ih);
- } catch(TargetLostException e) {
- InstructionHandle[] targets = e.getTargets();
-
- for(int i=0; i < targets.length; i++) {
- InstructionTargeter[] targeters = targets[i].getTargeters();
-
- for(int j=0; j < targeters.length; j++)
- targeters[j].updateTarget(targets[i], next);
- }
- }
- }
- }
- }
- }
-
- /**
- * Set maximum number of local variables.
- */
- public void setMaxLocals(int m) { max_locals = m; }
- public int getMaxLocals() { return max_locals; }
-
- /**
- * Set maximum stack size for this method.
- */
- public void setMaxStack(int m) { max_stack = m; }
- public int getMaxStack() { return max_stack; }
-
- /** @return class that contains this method
- */
- public String getClassName() { return class_name; }
- public void setClassName(String class_name) { this.class_name = class_name; }
-
- public void setReturnType(Type return_type) { setType(return_type); }
- public Type getReturnType() { return getType(); }
-
- public void setArgumentTypes(Type[] arg_types) { this.arg_types = arg_types; }
- public Type[] getArgumentTypes() { return (Type[])arg_types.clone(); }
- public void setArgumentType(int i, Type type) { arg_types[i] = type; }
- public Type getArgumentType(int i) { return arg_types[i]; }
-
- public void setArgumentNames(String[] arg_names) { this.arg_names = arg_names; }
- public String[] getArgumentNames() { return (String[])arg_names.clone(); }
- public void setArgumentName(int i, String name) { arg_names[i] = name; }
- public String getArgumentName(int i) { return arg_names[i]; }
-
- public InstructionList getInstructionList() { return il; }
- public void setInstructionList(InstructionList il) { this.il = il; }
-
- public String getSignature() {
- return Type.getMethodSignature(type, arg_types);
- }
-
- /**
- * Computes max. stack size by performing control flow analysis.
- */
- public void setMaxStack() {
- if(il != null)
- max_stack = getMaxStack(cp, il, getExceptionHandlers());
- else
- max_stack = 0;
- }
-
- /**
- * Compute maximum number of local variables.
- */
- public void setMaxLocals() {
- if(il != null) {
- int max = isStatic()? 0 : 1;
-
- if(arg_types != null)
- for(int i=0; i < arg_types.length; i++)
- max += arg_types[i].getSize();
-
- for(InstructionHandle ih = il.getStart(); ih != null; ih = ih.getNext()) {
- Instruction ins = ih.getInstruction();
-
- if((ins instanceof LocalVariableInstruction) ||
- (ins instanceof RET) || (ins instanceof IINC))
- {
- int index = ((IndexedInstruction)ins).getIndex() +
- ((TypedInstruction)ins).getType(cp).getSize();
-
- if(index > max)
- max = index;
- }
- }
-
- max_locals = max;
- } else
- max_locals = 0;
- }
-
- /** Do not/Do produce attributes code attributesLineNumberTable and
- * LocalVariableTable, like javac -O
- */
- public void stripAttributes(boolean flag) { strip_attributes = flag; }
-
- static final class BranchTarget {
- InstructionHandle target;
- int stackDepth;
-
- BranchTarget(InstructionHandle target, int stackDepth) {
- this.target = target;
- this.stackDepth = stackDepth;
- }
- }
-
- static final class BranchStack {
- Stack branchTargets = new Stack();
- Hashtable visitedTargets = new Hashtable();
-
- public void push(InstructionHandle target, int stackDepth) {
- if(visited(target))
- return;
-
- branchTargets.push(visit(target, stackDepth));
- }
-
- public BranchTarget pop() {
- if(!branchTargets.empty()) {
- BranchTarget bt = (BranchTarget) branchTargets.pop();
- return bt;
- }
-
- return null;
- }
-
- private final BranchTarget visit(InstructionHandle target, int stackDepth) {
- BranchTarget bt = new BranchTarget(target, stackDepth);
- visitedTargets.put(target, bt);
-
- return bt;
- }
-
- private final boolean visited(InstructionHandle target) {
- return (visitedTargets.get(target) != null);
- }
- }
-
- /**
- * Computes stack usage of an instruction list by performing control flow analysis.
- *
- * @return maximum stack depth used by method
- */
- public static int getMaxStack(ConstantPoolGen cp, InstructionList il, CodeExceptionGen[] et) {
- BranchStack branchTargets = new BranchStack();
-
- /* Initially, populate the branch stack with the exception
- * handlers, because these aren't (necessarily) branched to
- * explicitly. in each case, the stack will have depth 1,
- * containing the exception object.
- */
- for (int i = 0; i < et.length; i++) {
- InstructionHandle handler_pc = et[i].getHandlerPC();
- if (handler_pc != null)
- branchTargets.push(handler_pc, 1);
- }
-
- int stackDepth = 0, maxStackDepth = 0;
- InstructionHandle ih = il.getStart();
-
- while(ih != null) {
- Instruction instruction = ih.getInstruction();
- short opcode = instruction.getOpcode();
- int delta = instruction.produceStack(cp) - instruction.consumeStack(cp);
-
- stackDepth += delta;
- if(stackDepth > maxStackDepth)
- maxStackDepth = stackDepth;
-
- // choose the next instruction based on whether current is a branch.
- if(instruction instanceof BranchInstruction) {
- BranchInstruction branch = (BranchInstruction) instruction;
- if(instruction instanceof Select) {
- // explore all of the select's targets. the default target is handled below.
- Select select = (Select) branch;
- InstructionHandle[] targets = select.getTargets();
- for (int i = 0; i < targets.length; i++)
- branchTargets.push(targets[i], stackDepth);
- // nothing to fall through to.
- ih = null;
- } else if(!(branch instanceof IfInstruction)) {
- // if an instruction that comes back to following PC,
- // push next instruction, with stack depth reduced by 1.
- if(opcode == Constants.JSR || opcode == Constants.JSR_W)
- branchTargets.push(ih.getNext(), stackDepth - 1);
- ih = null;
- }
- // for all branches, the target of the branch is pushed on the branch stack.
- // conditional branches have a fall through case, selects don't, and
- // jsr/jsr_w return to the next instruction.
- branchTargets.push(branch.getTarget(), stackDepth);
- } else {
- // check for instructions that terminate the method.
- if(opcode == Constants.ATHROW || opcode == Constants.RET ||
- (opcode >= Constants.IRETURN && opcode <= Constants.RETURN))
- ih = null;
- }
- // normal case, go to the next instruction.
- if(ih != null)
- ih = ih.getNext();
- // if we have no more instructions, see if there are any deferred branches to explore.
- if(ih == null) {
- BranchTarget bt = branchTargets.pop();
- if (bt != null) {
- ih = bt.target;
- stackDepth = bt.stackDepth;
- }
- }
- }
-
- return maxStackDepth;
- }
-
- private ArrayList observers;
-
- /** Add observer for this object.
- */
- public void addObserver(MethodObserver o) {
- if(observers == null)
- observers = new ArrayList();
-
- observers.add(o);
- }
-
- /** Remove observer for this object.
- */
- public void removeObserver(MethodObserver o) {
- if(observers != null)
- observers.remove(o);
- }
-
- /** Call notify() method on all observers. This method is not called
- * automatically whenever the state has changed, but has to be
- * called by the user after he has finished editing the object.
- */
- public void update() {
- if(observers != null)
- for(Iterator e = observers.iterator(); e.hasNext(); )
- ((MethodObserver)e.next()).notify(this);
- }
-
- /**
- * Return string representation close to declaration format,
- * `public static void _main(String[]) throws IOException', e.g.
- *
- * @return String representation of the method.
- */
- public final String toString() {
- String access = Utility.accessToString(access_flags);
- String signature = Type.getMethodSignature(type, arg_types);
-
- signature = Utility.methodSignatureToString(signature, name, access,
- true, getLocalVariableTable(cp));
-
- StringBuffer buf = new StringBuffer(signature);
-
- if(throws_vec.size() > 0) {
- for(Iterator e = throws_vec.iterator(); e.hasNext(); )
- buf.append("\n\t\tthrows " + e.next());
- }
-
- return buf.toString();
- }
-
- /** @return deep copy of this method
- */
- public MethodGen copy(String class_name, ConstantPoolGen cp) {
- Method m = ((MethodGen)clone()).getMethod();
- MethodGen mg = new MethodGen(m, class_name, this.cp);
-
- if(this.cp != cp) {
- mg.setConstantPool(cp);
- mg.getInstructionList().replaceConstantPool(this.cp, cp);
- }
-
- return mg;
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/MethodObserver.java b/src/com/sun/org/apache/bcel/internal/generic/MethodObserver.java
deleted file mode 100644
index 1135984..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/MethodObserver.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * Implement this interface if you're interested in changes to a MethodGen object
- * and register yourself with addObserver().
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public interface MethodObserver {
- public void notify(MethodGen method);
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/NEW.java b/src/com/sun/org/apache/bcel/internal/generic/NEW.java
deleted file mode 100644
index de0e2f8..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/NEW.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import java.io.*;
-import com.sun.org.apache.bcel.internal.ExceptionConstants;
-
-/**
- * NEW - Create new object
- * <PRE>Stack: ... -&gt; ..., objectref</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class NEW extends CPInstruction
- implements LoadClass, AllocationInstruction, ExceptionThrower, StackProducer {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- NEW() {}
-
- public NEW(int index) {
- super(com.sun.org.apache.bcel.internal.Constants.NEW, index);
- }
-
- public Class[] getExceptions(){
- Class[] cs = new Class[2 + ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION.length];
-
- System.arraycopy(ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION, 0,
- cs, 0, ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION.length);
-
- cs[ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION.length+1] = ExceptionConstants.INSTANTIATION_ERROR;
- cs[ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION.length] = ExceptionConstants.ILLEGAL_ACCESS_ERROR;
-
- return cs;
- }
-
- public ObjectType getLoadClassType(ConstantPoolGen cpg) {
- return (ObjectType)getType(cpg);
- }
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitLoadClass(this);
- v.visitAllocationInstruction(this);
- v.visitExceptionThrower(this);
- v.visitStackProducer(this);
- v.visitTypedInstruction(this);
- v.visitCPInstruction(this);
- v.visitNEW(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/NEWARRAY.java b/src/com/sun/org/apache/bcel/internal/generic/NEWARRAY.java
deleted file mode 100644
index b6d716e..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/NEWARRAY.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import java.io.*;
-import com.sun.org.apache.bcel.internal.util.ByteSequence;
-
-/**
- * NEWARRAY - Create new array of basic type (int, short, ...)
- * <PRE>Stack: ..., count -&gt; ..., arrayref</PRE>
- * type must be one of T_INT, T_SHORT, ...
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class NEWARRAY extends Instruction
- implements AllocationInstruction, ExceptionThrower, StackProducer {
- private byte type;
-
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- NEWARRAY() {}
-
- public NEWARRAY(byte type) {
- super(com.sun.org.apache.bcel.internal.Constants.NEWARRAY, (short)2);
- this.type = type;
- }
-
- public NEWARRAY(BasicType type) {
- this(type.getType());
- }
-
- /**
- * Dump instruction as byte code to stream out.
- * @param out Output stream
- */
- public void dump(DataOutputStream out) throws IOException {
- out.writeByte(opcode);
- out.writeByte(type);
- }
-
- /**
- * @return numeric code for basic element type
- */
- public final byte getTypecode() { return type; }
-
- /**
- * @return type of constructed array
- */
- public final Type getType() {
- return new ArrayType(BasicType.getType(type), 1);
- }
-
- /**
- * @return mnemonic for instruction
- */
- public String toString(boolean verbose) {
- return super.toString(verbose) + " " + com.sun.org.apache.bcel.internal.Constants.TYPE_NAMES[type];
- }
- /**
- * Read needed data (e.g. index) from file.
- */
- protected void initFromFile(ByteSequence bytes, boolean wide) throws IOException
- {
- type = bytes.readByte();
- length = 2;
- }
-
- public Class[] getExceptions() {
- return new Class[] { com.sun.org.apache.bcel.internal.ExceptionConstants.NEGATIVE_ARRAY_SIZE_EXCEPTION };
- }
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitAllocationInstruction(this);
- v.visitExceptionThrower(this);
- v.visitStackProducer(this);
- v.visitNEWARRAY(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/NOP.java b/src/com/sun/org/apache/bcel/internal/generic/NOP.java
deleted file mode 100644
index 1e6ee0a..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/NOP.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * NOP - Do nothing
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class NOP extends Instruction {
- public NOP() {
- super(com.sun.org.apache.bcel.internal.Constants.NOP, (short)1);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitNOP(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/NamedAndTyped.java b/src/com/sun/org/apache/bcel/internal/generic/NamedAndTyped.java
deleted file mode 100644
index a1501f4..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/NamedAndTyped.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * Denote entity that has both name and type. This is true for local variables,
- * methods and fields.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public interface NamedAndTyped {
- public String getName();
- public Type getType();
- public void setName(String name);
- public void setType(Type type);
-
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/ObjectType.java b/src/com/sun/org/apache/bcel/internal/generic/ObjectType.java
deleted file mode 100644
index a506edd..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/ObjectType.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import com.sun.org.apache.bcel.internal.Constants;
-import com.sun.org.apache.bcel.internal.Repository;
-import com.sun.org.apache.bcel.internal.classfile.JavaClass;
-
-/**
- * Denotes reference such as java.lang.String.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public final class ObjectType extends ReferenceType {
- private String class_name; // Class name of type
-
- /**
- * @param class_name fully qualified class name, e.g. java.lang.String
- */
- public ObjectType(String class_name) {
- super(Constants.T_REFERENCE, "L" + class_name.replace('.', '/') + ";");
- this.class_name = class_name.replace('/', '.');
- }
-
- /** @return name of referenced class
- */
- public String getClassName() { return class_name; }
-
- /** @return a hash code value for the object.
- */
- public int hashCode() { return class_name.hashCode(); }
-
- /** @return true if both type objects refer to the same class.
- */
- public boolean equals(Object type) {
- return (type instanceof ObjectType)?
- ((ObjectType)type).class_name.equals(class_name) : false;
- }
-
- /**
- * If "this" doesn't reference a class, it references an interface
- * or a non-existant entity.
- */
- public boolean referencesClass(){
- JavaClass jc = Repository.lookupClass(class_name);
- if (jc == null)
- return false;
- else
- return jc.isClass();
- }
-
- /**
- * If "this" doesn't reference an interface, it references a class
- * or a non-existant entity.
- */
- public boolean referencesInterface(){
- JavaClass jc = Repository.lookupClass(class_name);
- if (jc == null)
- return false;
- else
- return !jc.isClass();
- }
-
- public boolean subclassOf(ObjectType superclass){
- if (this.referencesInterface() || superclass.referencesInterface())
- return false;
-
- return Repository.instanceOf(this.class_name, superclass.class_name);
- }
-
- /**
- * Java Virtual Machine Specification edition 2, 5.4.4 Access Control
- */
- public boolean accessibleTo(ObjectType accessor) {
- JavaClass jc = Repository.lookupClass(class_name);
-
- if(jc.isPublic()) {
- return true;
- } else {
- JavaClass acc = Repository.lookupClass(accessor.class_name);
- return acc.getPackageName().equals(jc.getPackageName());
- }
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/POP.java b/src/com/sun/org/apache/bcel/internal/generic/POP.java
deleted file mode 100644
index 300a6be..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/POP.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * POP - Pop top operand stack word
- *
- * <PRE>Stack: ..., word -&gt; ...</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class POP extends StackInstruction implements PopInstruction {
- public POP() {
- super(com.sun.org.apache.bcel.internal.Constants.POP);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackConsumer(this);
- v.visitPopInstruction(this);
- v.visitStackInstruction(this);
- v.visitPOP(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/POP2.java b/src/com/sun/org/apache/bcel/internal/generic/POP2.java
deleted file mode 100644
index aebcada..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/POP2.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * POP2 - Pop two top operand stack words
- *
- * <PRE>Stack: ..., word2, word1 -&gt; ...</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class POP2 extends StackInstruction implements PopInstruction {
- public POP2() {
- super(com.sun.org.apache.bcel.internal.Constants.POP2);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackConsumer(this);
- v.visitPopInstruction(this);
- v.visitStackInstruction(this);
- v.visitPOP2(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/PUSH.java b/src/com/sun/org/apache/bcel/internal/generic/PUSH.java
deleted file mode 100644
index 31a7884..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/PUSH.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import com.sun.org.apache.bcel.internal.Constants;
-import java.io.*;
-
-/**
- * Wrapper class for push operations, which are implemented either as BIPUSH,
- * LDC or xCONST_n instructions.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public final class PUSH
- implements CompoundInstruction, VariableLengthInstruction, InstructionConstants
-{
- private Instruction instruction;
-
- /**
- * This constructor also applies for values of type short, char, byte
- *
- * @param cp Constant pool
- * @param value to be pushed
- */
- public PUSH(ConstantPoolGen cp, int value) {
- if((value >= -1) && (value <= 5)) // Use ICONST_n
- instruction = INSTRUCTIONS[Constants.ICONST_0 + value];
- else if((value >= -128) && (value <= 127)) // Use BIPUSH
- instruction = new BIPUSH((byte)value);
- else if((value >= -32768) && (value <= 32767)) // Use SIPUSH
- instruction = new SIPUSH((short)value);
- else // If everything fails create a Constant pool entry
- instruction = new LDC(cp.addInteger(value));
- }
-
- /**
- * @param cp Constant pool
- * @param value to be pushed
- */
- public PUSH(ConstantPoolGen cp, boolean value) {
- instruction = INSTRUCTIONS[Constants.ICONST_0 + (value? 1 : 0)];
- }
-
- /**
- * @param cp Constant pool
- * @param value to be pushed
- */
- public PUSH(ConstantPoolGen cp, float value) {
- if(value == 0.0)
- instruction = FCONST_0;
- else if(value == 1.0)
- instruction = FCONST_1;
- else if(value == 2.0)
- instruction = FCONST_2;
- else // Create a Constant pool entry
- instruction = new LDC(cp.addFloat(value));
- }
-
- /**
- * @param cp Constant pool
- * @param value to be pushed
- */
- public PUSH(ConstantPoolGen cp, long value) {
- if(value == 0)
- instruction = LCONST_0;
- else if(value == 1)
- instruction = LCONST_1;
- else // Create a Constant pool entry
- instruction = new LDC2_W(cp.addLong(value));
- }
-
- /**
- * @param cp Constant pool
- * @param value to be pushed
- */
- public PUSH(ConstantPoolGen cp, double value) {
- if(value == 0.0)
- instruction = DCONST_0;
- else if(value == 1.0)
- instruction = DCONST_1;
- else // Create a Constant pool entry
- instruction = new LDC2_W(cp.addDouble(value));
- }
-
- /**
- * @param cp Constant pool
- * @param value to be pushed
- */
- public PUSH(ConstantPoolGen cp, String value) {
- if(value == null)
- instruction = ACONST_NULL;
- else // Create a Constant pool entry
- instruction = new LDC(cp.addString(value));
- }
-
- /**
- * @param cp Constant pool
- * @param value to be pushed
- */
- public PUSH(ConstantPoolGen cp, Number value) {
- if((value instanceof Integer) || (value instanceof Short) || (value instanceof Byte))
- instruction = new PUSH(cp, value.intValue()).instruction;
- else if(value instanceof Double)
- instruction = new PUSH(cp, value.doubleValue()).instruction;
- else if(value instanceof Float)
- instruction = new PUSH(cp, value.floatValue()).instruction;
- else if(value instanceof Long)
- instruction = new PUSH(cp, value.longValue()).instruction;
- else
- throw new ClassGenException("What's this: " + value);
- }
-
- /**
- * @param cp Constant pool
- * @param value to be pushed
- */
- public PUSH(ConstantPoolGen cp, Character value) {
- this(cp, (int)value.charValue());
- }
-
- /**
- * @param cp Constant pool
- * @param value to be pushed
- */
- public PUSH(ConstantPoolGen cp, Boolean value) {
- this(cp, value.booleanValue());
- }
-
- public final InstructionList getInstructionList() {
- return new InstructionList(instruction);
- }
-
- public final Instruction getInstruction() {
- return instruction;
- }
-
- /**
- * @return mnemonic for instruction
- */
- public String toString() {
- return instruction.toString() + " (PUSH)";
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/PUTFIELD.java b/src/com/sun/org/apache/bcel/internal/generic/PUTFIELD.java
deleted file mode 100644
index 9572554..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/PUTFIELD.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import com.sun.org.apache.bcel.internal.ExceptionConstants;
-
-/**
- * PUTFIELD - Put field in object
- * <PRE>Stack: ..., objectref, value -&gt; ...</PRE>
- * OR
- * <PRE>Stack: ..., objectref, value.word1, value.word2 -&gt; ...</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class PUTFIELD
- extends FieldInstruction
- implements PopInstruction,ExceptionThrower{
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- PUTFIELD() {}
-
- public PUTFIELD(int index) {
- super(Constants.PUTFIELD, index);
- }
-
- public int consumeStack(ConstantPoolGen cpg) { return getFieldSize(cpg) + 1; }
-
- public Class[] getExceptions() {
- Class[] cs = new Class[2 + ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length];
-
- System.arraycopy(ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION, 0,
- cs, 0, ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length);
-
- cs[ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length+1] =
- ExceptionConstants.INCOMPATIBLE_CLASS_CHANGE_ERROR;
- cs[ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length] =
- ExceptionConstants.NULL_POINTER_EXCEPTION;
-
- return cs;
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitExceptionThrower(this);
- v.visitStackConsumer(this);
- v.visitPopInstruction(this);
- v.visitTypedInstruction(this);
- v.visitLoadClass(this);
- v.visitCPInstruction(this);
- v.visitFieldOrMethod(this);
- v.visitFieldInstruction(this);
- v.visitPUTFIELD(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/PUTSTATIC.java b/src/com/sun/org/apache/bcel/internal/generic/PUTSTATIC.java
deleted file mode 100644
index a4116b6..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/PUTSTATIC.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import com.sun.org.apache.bcel.internal.ExceptionConstants;
-
-/**
- * PUTSTATIC - Put static field in class
- * <PRE>Stack: ..., value -&gt; ...</PRE>
- * OR
- * <PRE>Stack: ..., value.word1, value.word2 -&gt; ...</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class PUTSTATIC extends FieldInstruction
- implements ExceptionThrower, PopInstruction {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- PUTSTATIC() {}
-
- public PUTSTATIC(int index) {
- super(Constants.PUTSTATIC, index);
- }
-
- public int consumeStack(ConstantPoolGen cpg) { return getFieldSize(cpg); }
-
- public Class[] getExceptions() {
- Class[] cs = new Class[1 + ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length];
-
- System.arraycopy(ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION, 0,
- cs, 0, ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length);
- cs[ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length] =
- ExceptionConstants.INCOMPATIBLE_CLASS_CHANGE_ERROR;
-
- return cs;
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitExceptionThrower(this);
- v.visitStackConsumer(this);
- v.visitPopInstruction(this);
- v.visitTypedInstruction(this);
- v.visitLoadClass(this);
- v.visitCPInstruction(this);
- v.visitFieldOrMethod(this);
- v.visitFieldInstruction(this);
- v.visitPUTSTATIC(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/PopInstruction.java b/src/com/sun/org/apache/bcel/internal/generic/PopInstruction.java
deleted file mode 100644
index 4168d2f..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/PopInstruction.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * Denotes an unparameterized instruction to pop a value on top from the stack,
- * such as ISTORE, POP, PUTSTATIC.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see ISTORE
- * @see POP
- */
-public interface PopInstruction extends StackConsumer {
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/PushInstruction.java b/src/com/sun/org/apache/bcel/internal/generic/PushInstruction.java
deleted file mode 100644
index f143c97..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/PushInstruction.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * Denotes an unparameterized instruction to produce a value on top of the stack,
- * such as ILOAD, LDC, SIPUSH, DUP, ICONST, etc.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
-
- * @see ILOAD
- * @see ICONST
- * @see LDC
- * @see DUP
- * @see SIPUSH
- * @see GETSTATIC
- */
-public interface PushInstruction extends StackProducer {
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/RET.java b/src/com/sun/org/apache/bcel/internal/generic/RET.java
deleted file mode 100644
index 27e242a..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/RET.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import java.io.*;
-import com.sun.org.apache.bcel.internal.util.ByteSequence;
-
-/**
- * RET - Return from subroutine
- *
- * <PRE>Stack: ..., -&gt; ..., address</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class RET extends Instruction implements IndexedInstruction, TypedInstruction {
- private boolean wide;
- private int index; // index to local variable containg the return address
-
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- RET() {}
-
- public RET(int index) {
- super(com.sun.org.apache.bcel.internal.Constants.RET, (short)2);
- setIndex(index); // May set wide as side effect
- }
-
- /**
- * Dump instruction as byte code to stream out.
- * @param out Output stream
- */
- public void dump(DataOutputStream out) throws IOException {
- if(wide)
- out.writeByte(com.sun.org.apache.bcel.internal.Constants.WIDE);
-
- out.writeByte(opcode);
-
- if(wide)
- out.writeShort(index);
- else
- out.writeByte(index);
- }
-
- private final void setWide() {
- if(wide = index > com.sun.org.apache.bcel.internal.Constants.MAX_BYTE)
- length = 4; // Including the wide byte
- else
- length = 2;
- }
-
- /**
- * Read needed data (e.g. index) from file.
- */
- protected void initFromFile(ByteSequence bytes, boolean wide) throws IOException
- {
- this.wide = wide;
-
- if(wide) {
- index = bytes.readUnsignedShort();
- length = 4;
- } else {
- index = bytes.readUnsignedByte();
- length = 2;
- }
- }
-
- /**
- * @return index of local variable containg the return address
- */
- public final int getIndex() { return index; }
-
- /**
- * Set index of local variable containg the return address
- */
- public final void setIndex(int n) {
- if(n < 0)
- throw new ClassGenException("Negative index value: " + n);
-
- index = n;
- setWide();
- }
-
- /**
- * @return mnemonic for instruction
- */
- public String toString(boolean verbose) {
- return super.toString(verbose) + " " + index;
- }
-
- /** @return return address type
- */
- public Type getType(ConstantPoolGen cp) {
- return ReturnaddressType.NO_TARGET;
- }
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitRET(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/RETURN.java b/src/com/sun/org/apache/bcel/internal/generic/RETURN.java
deleted file mode 100644
index f937e50..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/RETURN.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * RETURN - Return from void method
- * <PRE>Stack: ... -&gt; &lt;empty&gt;</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class RETURN extends ReturnInstruction {
- public RETURN() {
- super(com.sun.org.apache.bcel.internal.Constants.RETURN);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitExceptionThrower(this);
- v.visitTypedInstruction(this);
- v.visitStackConsumer(this);
- v.visitReturnInstruction(this);
- v.visitRETURN(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/ReferenceType.java b/src/com/sun/org/apache/bcel/internal/generic/ReferenceType.java
deleted file mode 100644
index 0956b58..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/ReferenceType.java
+++ /dev/null
@@ -1,352 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import com.sun.org.apache.bcel.internal.Repository;
-import com.sun.org.apache.bcel.internal.classfile.JavaClass;
-
-/**
- * Super class for object and array types.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public abstract class ReferenceType extends Type {
- protected ReferenceType(byte t, String s) {
- super(t, s);
- }
-
- /** Class is non-abstract but not instantiable from the outside
- */
- ReferenceType() {
- super(Constants.T_OBJECT, "<null object>");
- }
-
- /**
- * Return true iff this type is castable to another type t as defined in
- * the JVM specification. The case where this is Type.NULL is not
- * defined (see the CHECKCAST definition in the JVM specification).
- * However, because e.g. CHECKCAST doesn't throw a
- * ClassCastException when casting a null reference to any Object,
- * true is returned in this case.
- */
- public boolean isCastableTo(Type t) {
- if (this.equals(Type.NULL))
- return true; // If this is ever changed in isAssignmentCompatible()
-
- return isAssignmentCompatibleWith(t);
- /* Yes, it's true: It's the same definition.
- * See vmspec2 AASTORE / CHECKCAST definitions.
- */
- }
-
- /**
- * Return true iff this is assignment compatible with another type t
- * as defined in the JVM specification; see the AASTORE definition
- * there.
- */
- public boolean isAssignmentCompatibleWith(Type t) {
- if (!(t instanceof ReferenceType))
- return false;
-
- ReferenceType T = (ReferenceType) t;
-
- if (this.equals(Type.NULL))
- return true; // This is not explicitely stated, but clear. Isn't it?
-
- /* If this is a class type then
- */
- if ((this instanceof ObjectType) && (((ObjectType) this).referencesClass())) {
- /* If T is a class type, then this must be the same class as T,
- or this must be a subclass of T;
- */
- if ((T instanceof ObjectType) && (((ObjectType) T).referencesClass())) {
- if (this.equals(T))
- return true;
-
- if (Repository.instanceOf(((ObjectType) this).getClassName(),
- ((ObjectType) T).getClassName()))
- return true;
- }
-
- /* If T is an interface type, this must implement interface T.
- */
- if ((T instanceof ObjectType) && (((ObjectType) T).referencesInterface())) {
- if (Repository.implementationOf(((ObjectType) this).getClassName(),
- ((ObjectType) T).getClassName()))
- return true;
- }
- }
-
- /* If this is an interface type, then:
- */
- if ((this instanceof ObjectType) && (((ObjectType) this).referencesInterface())) {
- /* If T is a class type, then T must be Object (2.4.7).
- */
- if ((T instanceof ObjectType) && (((ObjectType) T).referencesClass())) {
- if (T.equals(Type.OBJECT)) return true;
- }
-
- /* If T is an interface type, then T must be the same interface
- * as this or a superinterface of this (2.13.2).
- */
- if ((T instanceof ObjectType) && (((ObjectType) T).referencesInterface())) {
- if (this.equals(T)) return true;
- if (Repository.implementationOf(((ObjectType) this).getClassName(),
- ((ObjectType) T).getClassName()))
- return true;
- }
- }
-
- /* If this is an array type, namely, the type SC[], that is, an
- * array of components of type SC, then:
- */
- if (this instanceof ArrayType) {
- /* If T is a class type, then T must be Object (2.4.7).
- */
- if ((T instanceof ObjectType) && (((ObjectType) T).referencesClass())) {
- if (T.equals(Type.OBJECT)) return true;
- }
-
- /* If T is an array type TC[], that is, an array of components
- * of type TC, then one of the following must be true:
- */
- if (T instanceof ArrayType) {
- /* TC and SC are the same primitive type (2.4.1).
- */
- Type sc = ((ArrayType) this).getElementType();
- Type tc = ((ArrayType) this).getElementType();
-
- if (sc instanceof BasicType && tc instanceof BasicType && sc.equals(tc))
- return true;
-
- /* TC and SC are reference types (2.4.6), and type SC is
- * assignable to TC by these runtime rules.
- */
- if (tc instanceof ReferenceType && sc instanceof ReferenceType &&
- ((ReferenceType) sc).isAssignmentCompatibleWith((ReferenceType) tc))
- return true;
- }
-
- /* If T is an interface type, T must be one of the interfaces implemented by arrays (2.15). */
- // TODO: Check if this is still valid or find a way to dynamically find out which
- // interfaces arrays implement. However, as of the JVM specification edition 2, there
- // are at least two different pages where assignment compatibility is defined and
- // on one of them "interfaces implemented by arrays" is exchanged with "'Cloneable' or
- // 'java.io.Serializable'"
- if ((T instanceof ObjectType) && (((ObjectType) T).referencesInterface())) {
- for (int ii = 0; ii < Constants.INTERFACES_IMPLEMENTED_BY_ARRAYS.length; ii++) {
- if (T.equals(new ObjectType(Constants.INTERFACES_IMPLEMENTED_BY_ARRAYS[ii]))) return true;
- }
- }
- }
- return false; // default.
- }
-
- /**
- * This commutative operation returns the first common superclass (narrowest ReferenceType
- * referencing a class, not an interface).
- * If one of the types is a superclass of the other, the former is returned.
- * If "this" is Type.NULL, then t is returned.
- * If t is Type.NULL, then "this" is returned.
- * If "this" equals t ['this.equals(t)'] "this" is returned.
- * If "this" or t is an ArrayType, then Type.OBJECT is returned;
- * unless their dimensions match. Then an ArrayType of the same
- * number of dimensions is returned, with its basic type being the
- * first common super class of the basic types of "this" and t.
- * If "this" or t is a ReferenceType referencing an interface, then Type.OBJECT is returned.
- * If not all of the two classes' superclasses cannot be found, "null" is returned.
- * See the JVM specification edition 2, "4.9.2 The Bytecode Verifier".
- */
- public ReferenceType getFirstCommonSuperclass(ReferenceType t) {
- if (this.equals(Type.NULL)) return t;
- if (t.equals(Type.NULL)) return this;
- if (this.equals(t)) return this;
- /*
- * TODO: Above sounds a little arbitrary. On the other hand, there is
- * no object referenced by Type.NULL so we can also say all the objects
- * referenced by Type.NULL were derived from java.lang.Object.
- * However, the Java Language's "instanceof" operator proves us wrong:
- * "null" is not referring to an instance of java.lang.Object :)
- */
-
- /* This code is from a bug report by Konstantin Shagin <konst@cs.technion.ac.il> */
-
- if ((this instanceof ArrayType) && (t instanceof ArrayType)) {
- ArrayType arrType1 = (ArrayType) this;
- ArrayType arrType2 = (ArrayType) t;
- if (
- (arrType1.getDimensions() == arrType2.getDimensions()) &&
- arrType1.getBasicType() instanceof ObjectType &&
- arrType2.getBasicType() instanceof ObjectType) {
- return new ArrayType(
- ((ObjectType) arrType1.getBasicType()).getFirstCommonSuperclass((ObjectType) arrType2.getBasicType()),
- arrType1.getDimensions()
- );
-
- }
- }
-
- if ((this instanceof ArrayType) || (t instanceof ArrayType))
- return Type.OBJECT;
- // TODO: Is there a proof of OBJECT being the direct ancestor of every ArrayType?
-
- if (((this instanceof ObjectType) && ((ObjectType) this).referencesInterface()) ||
- ((t instanceof ObjectType) && ((ObjectType) t).referencesInterface()))
- return Type.OBJECT;
- // TODO: The above line is correct comparing to the vmspec2. But one could
- // make class file verification a bit stronger here by using the notion of
- // superinterfaces or even castability or assignment compatibility.
-
-
- // this and t are ObjectTypes, see above.
- ObjectType thiz = (ObjectType) this;
- ObjectType other = (ObjectType) t;
- JavaClass[] thiz_sups = Repository.getSuperClasses(thiz.getClassName());
- JavaClass[] other_sups = Repository.getSuperClasses(other.getClassName());
-
- if ((thiz_sups == null) || (other_sups == null)) {
- return null;
- }
-
- // Waaahh...
- JavaClass[] this_sups = new JavaClass[thiz_sups.length + 1];
- JavaClass[] t_sups = new JavaClass[other_sups.length + 1];
- System.arraycopy(thiz_sups, 0, this_sups, 1, thiz_sups.length);
- System.arraycopy(other_sups, 0, t_sups, 1, other_sups.length);
- this_sups[0] = Repository.lookupClass(thiz.getClassName());
- t_sups[0] = Repository.lookupClass(other.getClassName());
-
- for (int i = 0; i < t_sups.length; i++) {
- for (int j = 0; j < this_sups.length; j++) {
- if (this_sups[j].equals(t_sups[i])) return new ObjectType(this_sups[j].getClassName());
- }
- }
-
- // Huh? Did you ask for Type.OBJECT's superclass??
- return null;
- }
-
- /**
- * This commutative operation returns the first common superclass (narrowest ReferenceType
- * referencing a class, not an interface).
- * If one of the types is a superclass of the other, the former is returned.
- * If "this" is Type.NULL, then t is returned.
- * If t is Type.NULL, then "this" is returned.
- * If "this" equals t ['this.equals(t)'] "this" is returned.
- * If "this" or t is an ArrayType, then Type.OBJECT is returned.
- * If "this" or t is a ReferenceType referencing an interface, then Type.OBJECT is returned.
- * If not all of the two classes' superclasses cannot be found, "null" is returned.
- * See the JVM specification edition 2, "4.9.2 The Bytecode Verifier".
- *
- * @deprecated use getFirstCommonSuperclass(ReferenceType t) which has
- * slightly changed semantics.
- */
- public ReferenceType firstCommonSuperclass(ReferenceType t) {
- if (this.equals(Type.NULL)) return t;
- if (t.equals(Type.NULL)) return this;
- if (this.equals(t)) return this;
- /*
- * TODO: Above sounds a little arbitrary. On the other hand, there is
- * no object referenced by Type.NULL so we can also say all the objects
- * referenced by Type.NULL were derived from java.lang.Object.
- * However, the Java Language's "instanceof" operator proves us wrong:
- * "null" is not referring to an instance of java.lang.Object :)
- */
-
- if ((this instanceof ArrayType) || (t instanceof ArrayType))
- return Type.OBJECT;
- // TODO: Is there a proof of OBJECT being the direct ancestor of every ArrayType?
-
- if (((this instanceof ObjectType) && ((ObjectType) this).referencesInterface()) ||
- ((t instanceof ObjectType) && ((ObjectType) t).referencesInterface()))
- return Type.OBJECT;
- // TODO: The above line is correct comparing to the vmspec2. But one could
- // make class file verification a bit stronger here by using the notion of
- // superinterfaces or even castability or assignment compatibility.
-
-
- // this and t are ObjectTypes, see above.
- ObjectType thiz = (ObjectType) this;
- ObjectType other = (ObjectType) t;
- JavaClass[] thiz_sups = Repository.getSuperClasses(thiz.getClassName());
- JavaClass[] other_sups = Repository.getSuperClasses(other.getClassName());
-
- if ((thiz_sups == null) || (other_sups == null)) {
- return null;
- }
-
- // Waaahh...
- JavaClass[] this_sups = new JavaClass[thiz_sups.length + 1];
- JavaClass[] t_sups = new JavaClass[other_sups.length + 1];
- System.arraycopy(thiz_sups, 0, this_sups, 1, thiz_sups.length);
- System.arraycopy(other_sups, 0, t_sups, 1, other_sups.length);
- this_sups[0] = Repository.lookupClass(thiz.getClassName());
- t_sups[0] = Repository.lookupClass(other.getClassName());
-
- for (int i = 0; i < t_sups.length; i++) {
- for (int j = 0; j < this_sups.length; j++) {
- if (this_sups[j].equals(t_sups[i])) return new ObjectType(this_sups[j].getClassName());
- }
- }
-
- // Huh? Did you ask for Type.OBJECT's superclass??
- return null;
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/ReturnInstruction.java b/src/com/sun/org/apache/bcel/internal/generic/ReturnInstruction.java
deleted file mode 100644
index 63181d0..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/ReturnInstruction.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import com.sun.org.apache.bcel.internal.Constants;
-import com.sun.org.apache.bcel.internal.ExceptionConstants;
-
-/**
- * Super class for the xRETURN family of instructions.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public abstract class ReturnInstruction extends Instruction
- implements ExceptionThrower, TypedInstruction, StackConsumer {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- ReturnInstruction() {}
-
- /**
- * @param opcode of instruction
- */
- protected ReturnInstruction(short opcode) {
- super(opcode, (short)1);
- }
-
- public Type getType() {
- switch(opcode) {
- case Constants.IRETURN: return Type.INT;
- case Constants.LRETURN: return Type.LONG;
- case Constants.FRETURN: return Type.FLOAT;
- case Constants.DRETURN: return Type.DOUBLE;
- case Constants.ARETURN: return Type.OBJECT;
- case Constants.RETURN: return Type.VOID;
-
- default: // Never reached
- throw new ClassGenException("Unknown type " + opcode);
- }
- }
-
- public Class[] getExceptions() {
- return new Class[] { ExceptionConstants.ILLEGAL_MONITOR_STATE };
- }
-
- /** @return type associated with the instruction
- */
- public Type getType(ConstantPoolGen cp) {
- return getType();
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/ReturnaddressType.java b/src/com/sun/org/apache/bcel/internal/generic/ReturnaddressType.java
deleted file mode 100644
index 501efdd..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/ReturnaddressType.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import com.sun.org.apache.bcel.internal.Constants;
-import java.util.Objects;
-
-/**
- * Returnaddress, the type JSR or JSR_W instructions push upon the stack.
- *
- * see vmspec2 3.3.3
- * @author <A HREF="http://www.inf.fu-berlin.de/~ehaase">Enver Haase</A>
- */
-public class ReturnaddressType extends Type {
-
- public static final ReturnaddressType NO_TARGET = new ReturnaddressType();
- private InstructionHandle returnTarget;
-
- /**
- * A Returnaddress [that doesn't know where to return to].
- */
- private ReturnaddressType(){
- super(Constants.T_ADDRESS, "<return address>");
- }
-
- /**
- * Creates a ReturnaddressType object with a target.
- */
- public ReturnaddressType(InstructionHandle returnTarget) {
- super(Constants.T_ADDRESS, "<return address targeting "+returnTarget+">");
- this.returnTarget = returnTarget;
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(this.returnTarget);
- }
-
- /**
- * Returns if the two Returnaddresses refer to the same target.
- */
- @Override
- public boolean equals(Object rat){
- if(!(rat instanceof ReturnaddressType))
- return false;
-
- return ((ReturnaddressType)rat).returnTarget.equals(this.returnTarget);
- }
-
- /**
- * @return the target of this ReturnaddressType
- */
- public InstructionHandle getTarget(){
- return returnTarget;
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/SALOAD.java b/src/com/sun/org/apache/bcel/internal/generic/SALOAD.java
deleted file mode 100644
index 06d03ac..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/SALOAD.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * SALOAD - Load short from array
- * <PRE>Stack: ..., arrayref, index -&gt; ..., value</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class SALOAD extends ArrayInstruction implements StackProducer {
- public SALOAD() {
- super(com.sun.org.apache.bcel.internal.Constants.SALOAD);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackProducer(this);
- v.visitExceptionThrower(this);
- v.visitTypedInstruction(this);
- v.visitArrayInstruction(this);
- v.visitSALOAD(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/SASTORE.java b/src/com/sun/org/apache/bcel/internal/generic/SASTORE.java
deleted file mode 100644
index 9b20b93..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/SASTORE.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * SASTORE - Store into short array
- * <PRE>Stack: ..., arrayref, index, value -&gt; ...</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class SASTORE extends ArrayInstruction implements StackConsumer {
- public SASTORE() {
- super(com.sun.org.apache.bcel.internal.Constants.SASTORE);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackConsumer(this);
- v.visitExceptionThrower(this);
- v.visitTypedInstruction(this);
- v.visitArrayInstruction(this);
- v.visitSASTORE(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/SIPUSH.java b/src/com/sun/org/apache/bcel/internal/generic/SIPUSH.java
deleted file mode 100644
index e171731..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/SIPUSH.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import java.io.*;
-import com.sun.org.apache.bcel.internal.util.ByteSequence;
-
-/**
- * SIPUSH - Push short
- *
- * <PRE>Stack: ... -&gt; ..., value</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class SIPUSH extends Instruction implements ConstantPushInstruction {
- private short b;
-
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- SIPUSH() {}
-
- public SIPUSH(short b) {
- super(com.sun.org.apache.bcel.internal.Constants.SIPUSH, (short)3);
- this.b = b;
- }
-
- /**
- * Dump instruction as short code to stream out.
- */
- public void dump(DataOutputStream out) throws IOException {
- super.dump(out);
- out.writeShort(b);
- }
-
- /**
- * @return mnemonic for instruction
- */
- public String toString(boolean verbose) {
- return super.toString(verbose) + " " + b;
- }
-
- /**
- * Read needed data (e.g. index) from file.
- */
- protected void initFromFile(ByteSequence bytes, boolean wide) throws IOException
- {
- length = 3;
- b = bytes.readShort();
- }
-
- public Number getValue() { return new Integer(b); }
-
- /** @return Type.SHORT
- */
- public Type getType(ConstantPoolGen cp) {
- return Type.SHORT;
- }
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitPushInstruction(this);
- v.visitStackProducer(this);
- v.visitTypedInstruction(this);
- v.visitConstantPushInstruction(this);
- v.visitSIPUSH(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/SWAP.java b/src/com/sun/org/apache/bcel/internal/generic/SWAP.java
deleted file mode 100644
index 625cbdb..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/SWAP.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * SWAP - Swa top operand stack word
- * <PRE>Stack: ..., word2, word1 -&gt; ..., word1, word2</PRE>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class SWAP extends StackInstruction implements StackConsumer, StackProducer {
- public SWAP() {
- super(com.sun.org.apache.bcel.internal.Constants.SWAP);
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackConsumer(this);
- v.visitStackProducer(this);
- v.visitStackInstruction(this);
- v.visitSWAP(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/SWITCH.java b/src/com/sun/org/apache/bcel/internal/generic/SWITCH.java
deleted file mode 100644
index df1fd81..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/SWITCH.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * SWITCH - Branch depending on int value, generates either LOOKUPSWITCH or
- * TABLESWITCH instruction, depending on whether the match values (int[]) can be
- * sorted with no gaps between the numbers.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public final class SWITCH implements CompoundInstruction {
- private int[] match;
- private InstructionHandle[] targets;
- private Select instruction;
- private int match_length;
-
- /**
- * Template for switch() constructs. If the match array can be
- * sorted in ascending order with gaps no larger than max_gap
- * between the numbers, a TABLESWITCH instruction is generated, and
- * a LOOKUPSWITCH otherwise. The former may be more efficient, but
- * needs more space.
- *
- * Note, that the key array always will be sorted, though we leave
- * the original arrays unaltered.
- *
- * @param match array of match values (case 2: ... case 7: ..., etc.)
- * @param targets the instructions to be branched to for each case
- * @param target the default target
- * @param max_gap maximum gap that may between case branches
- */
- public SWITCH(int[] match, InstructionHandle[] targets,
- InstructionHandle target, int max_gap) {
- this.match = (int[])match.clone();
- this.targets = (InstructionHandle[])targets.clone();
-
- if((match_length = match.length) < 2) // (almost) empty switch, or just default
- instruction = new TABLESWITCH(match, targets, target);
- else {
- sort(0, match_length - 1);
-
- if(matchIsOrdered(max_gap)) {
- fillup(max_gap, target);
-
- instruction = new TABLESWITCH(this.match, this.targets, target);
- }
- else
- instruction = new LOOKUPSWITCH(this.match, this.targets, target);
- }
- }
-
- public SWITCH(int[] match, InstructionHandle[] targets,
- InstructionHandle target) {
- this(match, targets, target, 1);
- }
-
- private final void fillup(int max_gap, InstructionHandle target) {
- int max_size = match_length + match_length * max_gap;
- int[] m_vec = new int[max_size];
- InstructionHandle[] t_vec = new InstructionHandle[max_size];
- int count = 1;
-
- m_vec[0] = match[0];
- t_vec[0] = targets[0];
-
- for(int i=1; i < match_length; i++) {
- int prev = match[i-1];
- int gap = match[i] - prev;
-
- for(int j=1; j < gap; j++) {
- m_vec[count] = prev + j;
- t_vec[count] = target;
- count++;
- }
-
- m_vec[count] = match[i];
- t_vec[count] = targets[i];
- count++;
- }
-
- match = new int[count];
- targets = new InstructionHandle[count];
-
- System.arraycopy(m_vec, 0, match, 0, count);
- System.arraycopy(t_vec, 0, targets, 0, count);
- }
-
- /**
- * Sort match and targets array with QuickSort.
- */
- private final void sort(int l, int r) {
- int i = l, j = r;
- int h, m = match[(l + r) / 2];
- InstructionHandle h2;
-
- do {
- while(match[i] < m) i++;
- while(m < match[j]) j--;
-
- if(i <= j) {
- h=match[i]; match[i]=match[j]; match[j]=h; // Swap elements
- h2=targets[i]; targets[i]=targets[j]; targets[j]=h2; // Swap instructions, too
- i++; j--;
- }
- } while(i <= j);
-
- if(l < j) sort(l, j);
- if(i < r) sort(i, r);
- }
-
- /**
- * @return match is sorted in ascending order with no gap bigger than max_gap?
- */
- private final boolean matchIsOrdered(int max_gap) {
- for(int i=1; i < match_length; i++)
- if(match[i] - match[i-1] > max_gap)
- return false;
-
- return true;
- }
-
- public final InstructionList getInstructionList() {
- return new InstructionList(instruction);
- }
-
- public final Instruction getInstruction() {
- return instruction;
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/Select.java b/src/com/sun/org/apache/bcel/internal/generic/Select.java
deleted file mode 100644
index 0cf47f6..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/Select.java
+++ /dev/null
@@ -1,267 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import java.io.*;
-import com.sun.org.apache.bcel.internal.util.ByteSequence;
-
-/**
- * Select - Abstract super class for LOOKUPSWITCH and TABLESWITCH instructions.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see LOOKUPSWITCH
- * @see TABLESWITCH
- * @see InstructionList
- */
-public abstract class Select extends BranchInstruction
- implements VariableLengthInstruction, StackProducer
-{
- protected int[] match; // matches, i.e., case 1: ...
- protected int[] indices; // target offsets
- protected InstructionHandle[] targets; // target objects in instruction list
- protected int fixed_length; // fixed length defined by subclasses
- protected int match_length; // number of cases
- protected int padding = 0; // number of pad bytes for alignment
-
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- Select() {}
-
- /**
- * (Match, target) pairs for switch.
- * `Match' and `targets' must have the same length of course.
- *
- * @param match array of matching values
- * @param targets instruction targets
- * @param target default instruction target
- */
- Select(short opcode, int[] match, InstructionHandle[] targets,
- InstructionHandle target) {
- super(opcode, target);
-
- this.targets = targets;
- for(int i=0; i < targets.length; i++) {
- BranchInstruction.notifyTargetChanged(targets[i], this);
- }
-
- this.match = match;
-
- if((match_length = match.length) != targets.length)
- throw new ClassGenException("Match and target array have not the same length");
-
- indices = new int[match_length];
- }
-
- /**
- * Since this is a variable length instruction, it may shift the following
- * instructions which then need to update their position.
- *
- * Called by InstructionList.setPositions when setting the position for every
- * instruction. In the presence of variable length instructions `setPositions'
- * performs multiple passes over the instruction list to calculate the
- * correct (byte) positions and offsets by calling this function.
- *
- * @param offset additional offset caused by preceding (variable length) instructions
- * @param max_offset the maximum offset that may be caused by these instructions
- * @return additional offset caused by possible change of this instruction's length
- */
- @Override
- protected int updatePosition(int offset, int max_offset) {
- position += offset; // Additional offset caused by preceding SWITCHs, GOTOs, etc.
-
- short old_length = length;
-
- /* Alignment on 4-byte-boundary, + 1, because of tag byte.
- */
- padding = (4 - ((position + 1) % 4)) % 4;
- length = (short)(fixed_length + padding); // Update length
-
- return length - old_length;
- }
-
- /**
- * Dump instruction as byte code to stream out.
- * @param out Output stream
- */
- @Override
- public void dump(DataOutputStream out) throws IOException {
- out.writeByte(opcode);
-
- for(int i=0; i < padding; i++) // Padding bytes
- out.writeByte(0);
-
- index = getTargetOffset(); // Write default target offset
- out.writeInt(index);
- }
-
- /**
- * Read needed data (e.g. index) from file.
- */
- @Override
- protected void initFromFile(ByteSequence bytes, boolean wide) throws IOException
- {
- padding = (4 - (bytes.getIndex() % 4)) % 4; // Compute number of pad bytes
-
- for(int i=0; i < padding; i++) {
- bytes.readByte();
- }
-
- // Default branch target common for both cases (TABLESWITCH, LOOKUPSWITCH)
- index = bytes.readInt();
- }
-
- /**
- * @return mnemonic for instruction
- */
- @Override
- public String toString(boolean verbose) {
- final StringBuilder buf = new StringBuilder(super.toString(verbose));
-
- if(verbose) {
- for(int i=0; i < match_length; i++) {
- String s = "null";
-
- if(targets[i] != null)
- s = targets[i].getInstruction().toString();
-
- buf.append("(").append(match[i]).append(", ")
- .append(s).append(" = {").append(indices[i]).append("})");
- }
- }
- else
- buf.append(" ...");
-
- return buf.toString();
- }
-
- /**
- * Set branch target for `i'th case
- */
- public final void setTarget(int i, InstructionHandle target) {
- notifyTargetChanging(targets[i], this);
- targets[i] = target;
- notifyTargetChanged(targets[i], this);
- }
-
- /**
- * @param old_ih old target
- * @param new_ih new target
- */
- @Override
- public void updateTarget(InstructionHandle old_ih, InstructionHandle new_ih) {
- boolean targeted = false;
-
- if(target == old_ih) {
- targeted = true;
- setTarget(new_ih);
- }
-
- for(int i=0; i < targets.length; i++) {
- if(targets[i] == old_ih) {
- targeted = true;
- setTarget(i, new_ih);
- }
- }
-
- if(!targeted)
- throw new ClassGenException("Not targeting " + old_ih);
- }
-
- /**
- * @return true, if ih is target of this instruction
- */
- @Override
- public boolean containsTarget(InstructionHandle ih) {
- if(target == ih)
- return true;
-
- for(int i=0; i < targets.length; i++)
- if(targets[i] == ih)
- return true;
-
- return false;
- }
-
- /**
- * Inform targets that they're not targeted anymore.
- */
- @Override
- void dispose() {
- super.dispose();
-
- for(int i=0; i < targets.length; i++)
- targets[i].removeTargeter(this);
- }
-
- /**
- * @return array of match indices
- */
- public int[] getMatchs() { return match; }
-
- /**
- * @return array of match target offsets
- */
- public int[] getIndices() { return indices; }
-
- /**
- * @return array of match targets
- */
- public InstructionHandle[] getTargets() { return targets; }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/StackConsumer.java b/src/com/sun/org/apache/bcel/internal/generic/StackConsumer.java
deleted file mode 100644
index efea4a6..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/StackConsumer.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * Denote an instruction that may consume a value from the stack.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public interface StackConsumer {
- /** @return how many words are consumed from stack
- */
- public int consumeStack(ConstantPoolGen cpg);
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/StackInstruction.java b/src/com/sun/org/apache/bcel/internal/generic/StackInstruction.java
deleted file mode 100644
index b6a0c39..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/StackInstruction.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * Super class for stack operations like DUP and POP.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public abstract class StackInstruction extends Instruction {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- StackInstruction() {}
-
- /**
- * @param opcode instruction opcode
- */
- protected StackInstruction(short opcode) {
- super(opcode, (short)1);
- }
-
- /** @return Type.UNKNOWN
- */
- public Type getType(ConstantPoolGen cp) {
- return Type.UNKNOWN;
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/StackProducer.java b/src/com/sun/org/apache/bcel/internal/generic/StackProducer.java
deleted file mode 100644
index dc1231c..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/StackProducer.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * Denote an instruction that may produce a value on top of the stack
- * (this excludes DUP_X1, e.g.)
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public interface StackProducer {
- /** @return how many words are produced on stack
- */
- public int produceStack(ConstantPoolGen cpg);
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/StoreInstruction.java b/src/com/sun/org/apache/bcel/internal/generic/StoreInstruction.java
deleted file mode 100644
index ed3197a..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/StoreInstruction.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * Denotes an unparameterized instruction to store a value into a local variable,
- * e.g. ISTORE.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public abstract class StoreInstruction extends LocalVariableInstruction
- implements PopInstruction
-{
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- * tag and length are defined in readInstruction and initFromFile, respectively.
- */
- StoreInstruction(short canon_tag, short c_tag) {
- super(canon_tag, c_tag);
- }
-
- /**
- * @param opcode Instruction opcode
- * @param c_tag Instruction number for compact version, ASTORE_0, e.g.
- * @param n local variable index (unsigned short)
- */
- protected StoreInstruction(short opcode, short c_tag, int n) {
- super(opcode, c_tag, n);
- }
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitStackConsumer(this);
- v.visitPopInstruction(this);
- v.visitTypedInstruction(this);
- v.visitLocalVariableInstruction(this);
- v.visitStoreInstruction(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/TABLESWITCH.java b/src/com/sun/org/apache/bcel/internal/generic/TABLESWITCH.java
deleted file mode 100644
index 5fb9075..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/TABLESWITCH.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import java.io.*;
-import com.sun.org.apache.bcel.internal.util.ByteSequence;
-
-/**
- * TABLESWITCH - Switch within given range of values, i.e., low..high
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see SWITCH
- */
-public class TABLESWITCH extends Select {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- TABLESWITCH() {}
-
- /**
- * @param match sorted array of match values, match[0] must be low value,
- * match[match_length - 1] high value
- * @param targets where to branch for matched values
- * @param target default branch
- */
- public TABLESWITCH(int[] match, InstructionHandle[] targets,
- InstructionHandle target) {
- super(com.sun.org.apache.bcel.internal.Constants.TABLESWITCH, match, targets, target);
-
- length = (short)(13 + match_length * 4); /* Alignment remainder assumed
- * 0 here, until dump time */
- fixed_length = length;
- }
-
- /**
- * Dump instruction as byte code to stream out.
- * @param out Output stream
- */
- public void dump(DataOutputStream out) throws IOException {
- super.dump(out);
-
- int low = (match_length > 0)? match[0] : 0;
- out.writeInt(low);
-
- int high = (match_length > 0)? match[match_length - 1] : 0;
- out.writeInt(high);
-
- for(int i=0; i < match_length; i++) // jump offsets
- out.writeInt(indices[i] = getTargetOffset(targets[i]));
- }
-
- /**
- * Read needed data (e.g. index) from file.
- */
- protected void initFromFile(ByteSequence bytes, boolean wide) throws IOException
- {
- super.initFromFile(bytes, wide);
-
- int low = bytes.readInt();
- int high = bytes.readInt();
-
- match_length = high - low + 1;
- fixed_length = (short)(13 + match_length * 4);
- length = (short)(fixed_length + padding);
-
- match = new int[match_length];
- indices = new int[match_length];
- targets = new InstructionHandle[match_length];
-
- for(int i=low; i <= high; i++)
- match[i - low] = i;
-
- for(int i=0; i < match_length; i++) {
- indices[i] = bytes.readInt();
- }
- }
-
-
- /**
- * Call corresponding visitor method(s). The order is:
- * Call visitor methods of implemented interfaces first, then
- * call methods according to the class hierarchy in descending order,
- * i.e., the most specific visitXXX() call comes last.
- *
- * @param v Visitor object
- */
- public void accept(Visitor v) {
- v.visitVariableLengthInstruction(this);
- v.visitStackProducer(this);
- v.visitBranchInstruction(this);
- v.visitSelect(this);
- v.visitTABLESWITCH(this);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/TargetLostException.java b/src/com/sun/org/apache/bcel/internal/generic/TargetLostException.java
deleted file mode 100644
index fcac0fe..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/TargetLostException.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * Thrown by InstructionList.remove() when one or multiple disposed instruction
- * are still being referenced by a InstructionTargeter object. I.e. the
- * InstructionTargeter has to be notified that (one of) the InstructionHandle it
- * is referencing is being removed from the InstructionList and thus not valid anymore.
- *
- * Making this an exception instead of a return value forces the user to handle
- * these case explicitely in a try { ... } catch. The following code illustrates
- * how this may be done:
- *
- * <PRE>
- * ...
- * try {
- * il.delete(start_ih, end_ih);
- * } catch(TargetLostException e) {
- * InstructionHandle[] targets = e.getTargets();
- * for(int i=0; i < targets.length; i++) {
- * InstructionTargeter[] targeters = targets[i].getTargeters();
- *
- * for(int j=0; j < targeters.length; j++)
- * targeters[j].updateTarget(targets[i], new_target);
- * }
- * }
- * </PRE>
- *
- * @see InstructionHandle
- * @see InstructionList
- * @see InstructionTargeter
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public final class TargetLostException extends Exception {
- private InstructionHandle[] targets;
-
- TargetLostException(InstructionHandle[] t, String mesg) {
- super(mesg);
- targets = t;
- }
-
- /**
- * @return list of instructions still being targeted.
- */
- public InstructionHandle[] getTargets() { return targets; }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/Type.java b/src/com/sun/org/apache/bcel/internal/generic/Type.java
deleted file mode 100644
index b496ed8..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/Type.java
+++ /dev/null
@@ -1,290 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.Constants;
-import com.sun.org.apache.bcel.internal.classfile.*;
-import java.util.ArrayList;
-
-/**
- * Abstract super class for all possible java types, namely basic types
- * such as int, object types like String and array types, e.g. int[]
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public abstract class Type implements java.io.Serializable {
- protected byte type;
- protected String signature; // signature for the type
-
- /** Predefined constants
- */
- public static final BasicType VOID = new BasicType(Constants.T_VOID);
- public static final BasicType BOOLEAN = new BasicType(Constants.T_BOOLEAN);
- public static final BasicType INT = new BasicType(Constants.T_INT);
- public static final BasicType SHORT = new BasicType(Constants.T_SHORT);
- public static final BasicType BYTE = new BasicType(Constants.T_BYTE);
- public static final BasicType LONG = new BasicType(Constants.T_LONG);
- public static final BasicType DOUBLE = new BasicType(Constants.T_DOUBLE);
- public static final BasicType FLOAT = new BasicType(Constants.T_FLOAT);
- public static final BasicType CHAR = new BasicType(Constants.T_CHAR);
- public static final ObjectType OBJECT = new ObjectType("java.lang.Object");
- public static final ObjectType STRING = new ObjectType("java.lang.String");
- public static final ObjectType STRINGBUFFER = new ObjectType("java.lang.StringBuffer");
- public static final ObjectType THROWABLE = new ObjectType("java.lang.Throwable");
- public static final Type[] NO_ARGS = new Type[0];
- public static final ReferenceType NULL = new ReferenceType(){};
- public static final Type UNKNOWN = new Type(Constants.T_UNKNOWN,
- "<unknown object>"){};
-
- protected Type(byte t, String s) {
- type = t;
- signature = s;
- }
-
- /**
- * @return signature for given type.
- */
- public String getSignature() { return signature; }
-
- /**
- * @return type as defined in Constants
- */
- public byte getType() { return type; }
-
- /**
- * @return stack size of this type (2 for long and double, 0 for void, 1 otherwise)
- */
- public int getSize() {
- switch(type) {
- case Constants.T_DOUBLE:
- case Constants.T_LONG: return 2;
- case Constants.T_VOID: return 0;
- default: return 1;
- }
- }
-
- /**
- * @return Type string, e.g. `int[]'
- */
- public String toString() {
- return ((this.equals(Type.NULL) || (type >= Constants.T_UNKNOWN)))? signature :
- Utility.signatureToString(signature, false);
- }
-
- /**
- * Convert type to Java method signature, e.g. int[] f(java.lang.String x)
- * becomes (Ljava/lang/String;)[I
- *
- * @param return_type what the method returns
- * @param arg_types what are the argument types
- * @return method signature for given type(s).
- */
- public static String getMethodSignature(Type return_type, Type[] arg_types) {
- StringBuffer buf = new StringBuffer("(");
- int length = (arg_types == null)? 0 : arg_types.length;
-
- for(int i=0; i < length; i++)
- buf.append(arg_types[i].getSignature());
-
- buf.append(')');
- buf.append(return_type.getSignature());
-
- return buf.toString();
- }
-
- private static int consumed_chars=0; // Remember position in string, see getArgumentTypes
-
- /**
- * Convert signature to a Type object.
- * @param signature signature string such as Ljava/lang/String;
- * @return type object
- */
- public static final Type getType(String signature)
- throws StringIndexOutOfBoundsException
- {
- byte type = Utility.typeOfSignature(signature);
-
- if(type <= Constants.T_VOID) {
- consumed_chars = 1;
- return BasicType.getType(type);
- } else if(type == Constants.T_ARRAY) {
- int dim=0;
- do { // Count dimensions
- dim++;
- } while(signature.charAt(dim) == '[');
-
- // Recurse, but just once, if the signature is ok
- Type t = getType(signature.substring(dim));
-
- consumed_chars += dim; // update counter
-
- return new ArrayType(t, dim);
- } else { // type == T_REFERENCE
- int index = signature.indexOf(';'); // Look for closing `;'
-
- if(index < 0)
- throw new ClassFormatException("Invalid signature: " + signature);
-
- consumed_chars = index + 1; // "Lblabla;" `L' and `;' are removed
-
- return new ObjectType(signature.substring(1, index).replace('/', '.'));
- }
- }
-
- /**
- * Convert return value of a method (signature) to a Type object.
- *
- * @param signature signature string such as (Ljava/lang/String;)V
- * @return return type
- */
- public static Type getReturnType(String signature) {
- try {
- // Read return type after `)'
- int index = signature.lastIndexOf(')') + 1;
- return getType(signature.substring(index));
- } catch(StringIndexOutOfBoundsException e) { // Should never occur
- throw new ClassFormatException("Invalid method signature: " + signature);
- }
- }
-
- /**
- * Convert arguments of a method (signature) to an array of Type objects.
- * @param signature signature string such as (Ljava/lang/String;)V
- * @return array of argument types
- */
- public static Type[] getArgumentTypes(String signature) {
- ArrayList vec = new ArrayList();
- int index;
- Type[] types;
-
- try { // Read all declarations between for `(' and `)'
- if(signature.charAt(0) != '(')
- throw new ClassFormatException("Invalid method signature: " + signature);
-
- index = 1; // current string position
-
- while(signature.charAt(index) != ')') {
- vec.add(getType(signature.substring(index)));
- index += consumed_chars; // update position
- }
- } catch(StringIndexOutOfBoundsException e) { // Should never occur
- throw new ClassFormatException("Invalid method signature: " + signature);
- }
-
- types = new Type[vec.size()];
- vec.toArray(types);
- return types;
- }
-
- /** Convert runtime java.lang.Class to BCEL Type object.
- * @param cl Java class
- * @return corresponding Type object
- */
- public static Type getType(java.lang.Class cl) {
- if(cl == null) {
- throw new IllegalArgumentException("Class must not be null");
- }
-
- /* That's an amzingly easy case, because getName() returns
- * the signature. That's what we would have liked anyway.
- */
- if(cl.isArray()) {
- return getType(cl.getName());
- } else if(cl.isPrimitive()) {
- if(cl == Integer.TYPE) {
- return INT;
- } else if(cl == Void.TYPE) {
- return VOID;
- } else if(cl == Double.TYPE) {
- return DOUBLE;
- } else if(cl == Float.TYPE) {
- return FLOAT;
- } else if(cl == Boolean.TYPE) {
- return BOOLEAN;
- } else if(cl == Byte.TYPE) {
- return BYTE;
- } else if(cl == Short.TYPE) {
- return SHORT;
- } else if(cl == Byte.TYPE) {
- return BYTE;
- } else if(cl == Long.TYPE) {
- return LONG;
- } else if(cl == Character.TYPE) {
- return CHAR;
- } else {
- throw new IllegalStateException("Ooops, what primitive type is " + cl);
- }
- } else { // "Real" class
- return new ObjectType(cl.getName());
- }
- }
-
- public static String getSignature(java.lang.reflect.Method meth) {
- StringBuffer sb = new StringBuffer("(");
- Class[] params = meth.getParameterTypes(); // avoid clone
-
- for(int j = 0; j < params.length; j++) {
- sb.append(getType(params[j]).getSignature());
- }
-
- sb.append(")");
- sb.append(getType(meth.getReturnType()).getSignature());
- return sb.toString();
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/TypedInstruction.java b/src/com/sun/org/apache/bcel/internal/generic/TypedInstruction.java
deleted file mode 100644
index 09ddae4..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/TypedInstruction.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * Get the type associated with an instruction, int for ILOAD, or the type
- * of the field of a PUTFIELD instruction, e.g..
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public interface TypedInstruction {
- public Type getType(ConstantPoolGen cpg);
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/UnconditionalBranch.java b/src/com/sun/org/apache/bcel/internal/generic/UnconditionalBranch.java
deleted file mode 100644
index c310a46..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/UnconditionalBranch.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * Denotes an instruction to perform an unconditional branch, i.e., GOTO, JSR.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
-
- * @see GOTO
- * @see JSR
- */
-public interface UnconditionalBranch {}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/VariableLengthInstruction.java b/src/com/sun/org/apache/bcel/internal/generic/VariableLengthInstruction.java
deleted file mode 100644
index 9026a16..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/VariableLengthInstruction.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * Denotes an instruction to be a variable length instruction, such as
- * GOTO, JSR, LOOKUPSWITCH and TABLESWITCH.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
-
- * @see GOTO
- * @see JSR
- * @see LOOKUPSWITCH
- * @see TABLESWITCH
- */
-public interface VariableLengthInstruction {}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/Visitor.java b/src/com/sun/org/apache/bcel/internal/generic/Visitor.java
deleted file mode 100644
index 97c4469..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/Visitor.java
+++ /dev/null
@@ -1,250 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.generic;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * Interface implementing the Visitor pattern programming style.
- * I.e., a class that implements this interface can handle all types of
- * instructions with the properly typed methods just by calling the accept()
- * method.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public interface Visitor {
- public void visitStackInstruction(StackInstruction obj);
- public void visitLocalVariableInstruction(LocalVariableInstruction obj);
- public void visitBranchInstruction(BranchInstruction obj);
- public void visitLoadClass(LoadClass obj);
- public void visitFieldInstruction(FieldInstruction obj);
- public void visitIfInstruction(IfInstruction obj);
- public void visitConversionInstruction(ConversionInstruction obj);
- public void visitPopInstruction(PopInstruction obj);
- public void visitStoreInstruction(StoreInstruction obj);
- public void visitTypedInstruction(TypedInstruction obj);
- public void visitSelect(Select obj);
- public void visitJsrInstruction(JsrInstruction obj);
- public void visitGotoInstruction(GotoInstruction obj);
- public void visitUnconditionalBranch(UnconditionalBranch obj);
- public void visitPushInstruction(PushInstruction obj);
- public void visitArithmeticInstruction(ArithmeticInstruction obj);
- public void visitCPInstruction(CPInstruction obj);
- public void visitInvokeInstruction(InvokeInstruction obj);
- public void visitArrayInstruction(ArrayInstruction obj);
- public void visitAllocationInstruction(AllocationInstruction obj);
- public void visitReturnInstruction(ReturnInstruction obj);
- public void visitFieldOrMethod(FieldOrMethod obj);
- public void visitConstantPushInstruction(ConstantPushInstruction obj);
- public void visitExceptionThrower(ExceptionThrower obj);
- public void visitLoadInstruction(LoadInstruction obj);
- public void visitVariableLengthInstruction(VariableLengthInstruction obj);
- public void visitStackProducer(StackProducer obj);
- public void visitStackConsumer(StackConsumer obj);
- public void visitACONST_NULL(ACONST_NULL obj);
- public void visitGETSTATIC(GETSTATIC obj);
- public void visitIF_ICMPLT(IF_ICMPLT obj);
- public void visitMONITOREXIT(MONITOREXIT obj);
- public void visitIFLT(IFLT obj);
- public void visitLSTORE(LSTORE obj);
- public void visitPOP2(POP2 obj);
- public void visitBASTORE(BASTORE obj);
- public void visitISTORE(ISTORE obj);
- public void visitCHECKCAST(CHECKCAST obj);
- public void visitFCMPG(FCMPG obj);
- public void visitI2F(I2F obj);
- public void visitATHROW(ATHROW obj);
- public void visitDCMPL(DCMPL obj);
- public void visitARRAYLENGTH(ARRAYLENGTH obj);
- public void visitDUP(DUP obj);
- public void visitINVOKESTATIC(INVOKESTATIC obj);
- public void visitLCONST(LCONST obj);
- public void visitDREM(DREM obj);
- public void visitIFGE(IFGE obj);
- public void visitCALOAD(CALOAD obj);
- public void visitLASTORE(LASTORE obj);
- public void visitI2D(I2D obj);
- public void visitDADD(DADD obj);
- public void visitINVOKESPECIAL(INVOKESPECIAL obj);
- public void visitIAND(IAND obj);
- public void visitPUTFIELD(PUTFIELD obj);
- public void visitILOAD(ILOAD obj);
- public void visitDLOAD(DLOAD obj);
- public void visitDCONST(DCONST obj);
- public void visitNEW(NEW obj);
- public void visitIFNULL(IFNULL obj);
- public void visitLSUB(LSUB obj);
- public void visitL2I(L2I obj);
- public void visitISHR(ISHR obj);
- public void visitTABLESWITCH(TABLESWITCH obj);
- public void visitIINC(IINC obj);
- public void visitDRETURN(DRETURN obj);
- public void visitFSTORE(FSTORE obj);
- public void visitDASTORE(DASTORE obj);
- public void visitIALOAD(IALOAD obj);
- public void visitDDIV(DDIV obj);
- public void visitIF_ICMPGE(IF_ICMPGE obj);
- public void visitLAND(LAND obj);
- public void visitIDIV(IDIV obj);
- public void visitLOR(LOR obj);
- public void visitCASTORE(CASTORE obj);
- public void visitFREM(FREM obj);
- public void visitLDC(LDC obj);
- public void visitBIPUSH(BIPUSH obj);
- public void visitDSTORE(DSTORE obj);
- public void visitF2L(F2L obj);
- public void visitFMUL(FMUL obj);
- public void visitLLOAD(LLOAD obj);
- public void visitJSR(JSR obj);
- public void visitFSUB(FSUB obj);
- public void visitSASTORE(SASTORE obj);
- public void visitALOAD(ALOAD obj);
- public void visitDUP2_X2(DUP2_X2 obj);
- public void visitRETURN(RETURN obj);
- public void visitDALOAD(DALOAD obj);
- public void visitSIPUSH(SIPUSH obj);
- public void visitDSUB(DSUB obj);
- public void visitL2F(L2F obj);
- public void visitIF_ICMPGT(IF_ICMPGT obj);
- public void visitF2D(F2D obj);
- public void visitI2L(I2L obj);
- public void visitIF_ACMPNE(IF_ACMPNE obj);
- public void visitPOP(POP obj);
- public void visitI2S(I2S obj);
- public void visitIFEQ(IFEQ obj);
- public void visitSWAP(SWAP obj);
- public void visitIOR(IOR obj);
- public void visitIREM(IREM obj);
- public void visitIASTORE(IASTORE obj);
- public void visitNEWARRAY(NEWARRAY obj);
- public void visitINVOKEINTERFACE(INVOKEINTERFACE obj);
- public void visitINEG(INEG obj);
- public void visitLCMP(LCMP obj);
- public void visitJSR_W(JSR_W obj);
- public void visitMULTIANEWARRAY(MULTIANEWARRAY obj);
- public void visitDUP_X2(DUP_X2 obj);
- public void visitSALOAD(SALOAD obj);
- public void visitIFNONNULL(IFNONNULL obj);
- public void visitDMUL(DMUL obj);
- public void visitIFNE(IFNE obj);
- public void visitIF_ICMPLE(IF_ICMPLE obj);
- public void visitLDC2_W(LDC2_W obj);
- public void visitGETFIELD(GETFIELD obj);
- public void visitLADD(LADD obj);
- public void visitNOP(NOP obj);
- public void visitFALOAD(FALOAD obj);
- public void visitINSTANCEOF(INSTANCEOF obj);
- public void visitIFLE(IFLE obj);
- public void visitLXOR(LXOR obj);
- public void visitLRETURN(LRETURN obj);
- public void visitFCONST(FCONST obj);
- public void visitIUSHR(IUSHR obj);
- public void visitBALOAD(BALOAD obj);
- public void visitDUP2(DUP2 obj);
- public void visitIF_ACMPEQ(IF_ACMPEQ obj);
- public void visitIMPDEP1(IMPDEP1 obj);
- public void visitMONITORENTER(MONITORENTER obj);
- public void visitLSHL(LSHL obj);
- public void visitDCMPG(DCMPG obj);
- public void visitD2L(D2L obj);
- public void visitIMPDEP2(IMPDEP2 obj);
- public void visitL2D(L2D obj);
- public void visitRET(RET obj);
- public void visitIFGT(IFGT obj);
- public void visitIXOR(IXOR obj);
- public void visitINVOKEVIRTUAL(INVOKEVIRTUAL obj);
- public void visitFASTORE(FASTORE obj);
- public void visitIRETURN(IRETURN obj);
- public void visitIF_ICMPNE(IF_ICMPNE obj);
- public void visitFLOAD(FLOAD obj);
- public void visitLDIV(LDIV obj);
- public void visitPUTSTATIC(PUTSTATIC obj);
- public void visitAALOAD(AALOAD obj);
- public void visitD2I(D2I obj);
- public void visitIF_ICMPEQ(IF_ICMPEQ obj);
- public void visitAASTORE(AASTORE obj);
- public void visitARETURN(ARETURN obj);
- public void visitDUP2_X1(DUP2_X1 obj);
- public void visitFNEG(FNEG obj);
- public void visitGOTO_W(GOTO_W obj);
- public void visitD2F(D2F obj);
- public void visitGOTO(GOTO obj);
- public void visitISUB(ISUB obj);
- public void visitF2I(F2I obj);
- public void visitDNEG(DNEG obj);
- public void visitICONST(ICONST obj);
- public void visitFDIV(FDIV obj);
- public void visitI2B(I2B obj);
- public void visitLNEG(LNEG obj);
- public void visitLREM(LREM obj);
- public void visitIMUL(IMUL obj);
- public void visitIADD(IADD obj);
- public void visitLSHR(LSHR obj);
- public void visitLOOKUPSWITCH(LOOKUPSWITCH obj);
- public void visitDUP_X1(DUP_X1 obj);
- public void visitFCMPL(FCMPL obj);
- public void visitI2C(I2C obj);
- public void visitLMUL(LMUL obj);
- public void visitLUSHR(LUSHR obj);
- public void visitISHL(ISHL obj);
- public void visitLALOAD(LALOAD obj);
- public void visitASTORE(ASTORE obj);
- public void visitANEWARRAY(ANEWARRAY obj);
- public void visitFRETURN(FRETURN obj);
- public void visitFADD(FADD obj);
- public void visitBREAKPOINT(BREAKPOINT obj);
-}
diff --git a/src/com/sun/org/apache/bcel/internal/generic/package.html b/src/com/sun/org/apache/bcel/internal/generic/package.html
deleted file mode 100644
index e39189b..0000000
--- a/src/com/sun/org/apache/bcel/internal/generic/package.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-$Id: package.html,v 1.1.2.1 2005/07/31 23:45:27 jeffsuttor Exp $
--->
-</head>
-<body bgcolor="white">
-<p>
-This package contains the "generic" part of the
-<a href="http://jakarta.apache.org/bcel/">Byte Code Engineering
-Library</a>, i.e., classes to dynamically modify class objects and
-byte code instructions.
-</p>
-</body>
-</html>
diff --git a/src/com/sun/org/apache/bcel/internal/package.html b/src/com/sun/org/apache/bcel/internal/package.html
deleted file mode 100644
index 92de99d..0000000
--- a/src/com/sun/org/apache/bcel/internal/package.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-$Id: package.html,v 1.1.2.1 2005/07/31 23:46:55 jeffsuttor Exp $
--->
-</head>
-<body bgcolor="white">
-<p>
-This package contains basic classes for the
-<a href="http://jakarta.apache.org/bcel/">Byte Code Engineering Library</a>
- and constants defined by the
-<a href="http://www.javasoft.com/docs/books/vmspec/index.html">
- JVM specification</a>.
-</p>
-</body>
-</html>
diff --git a/src/com/sun/org/apache/bcel/internal/util/AttributeHTML.java b/src/com/sun/org/apache/bcel/internal/util/AttributeHTML.java
deleted file mode 100644
index 3cafcba..0000000
--- a/src/com/sun/org/apache/bcel/internal/util/AttributeHTML.java
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.util;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.classfile.*;
-import java.io.*;
-
-/**
- * Convert found attributes into HTML file.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- *
- */
-final class AttributeHTML implements com.sun.org.apache.bcel.internal.Constants {
- private String class_name; // name of current class
- private PrintWriter file; // file to write to
- private int attr_count = 0;
- private ConstantHTML constant_html;
- private ConstantPool constant_pool;
-
- AttributeHTML(String dir, String class_name, ConstantPool constant_pool,
- ConstantHTML constant_html) throws IOException
- {
- this.class_name = class_name;
- this.constant_pool = constant_pool;
- this.constant_html = constant_html;
-
- file = new PrintWriter(new FileOutputStream(dir + class_name + "_attributes.html"));
- file.println("<HTML><BODY BGCOLOR=\"#C0C0C0\"><TABLE BORDER=0>");
- }
-
- private final String codeLink(int link, int method_number) {
- return "<A HREF=\"" + class_name + "_code.html#code" +
- method_number + "@" + link + "\" TARGET=Code>" +
- link + "</A>";
- }
-
- final void close() {
- file.println("</TABLE></BODY></HTML>");
- file.close();
- }
-
- final void writeAttribute(Attribute attribute, String anchor) throws IOException {
- writeAttribute(attribute, anchor, 0);
- }
-
- final void writeAttribute(Attribute attribute, String anchor, int method_number) throws IOException {
- byte tag = attribute.getTag();
- int index;
-
- if(tag == ATTR_UNKNOWN) // Don't know what to do about this one
- return;
-
- attr_count++; // Increment number of attributes found so far
-
- if(attr_count % 2 == 0)
- file.print("<TR BGCOLOR=\"#C0C0C0\"><TD>");
- else
- file.print("<TR BGCOLOR=\"#A0A0A0\"><TD>");
-
- file.println("<H4><A NAME=\"" + anchor + "\">" + attr_count + " " + ATTRIBUTE_NAMES[tag] + "</A></H4>");
-
- /* Handle different attributes
- */
- switch(tag) {
- case ATTR_CODE:
- Code c = (Code)attribute;
-
- // Some directly printable values
- file.print("<UL><LI>Maximum stack size = " + c.getMaxStack() +
- "</LI>\n<LI>Number of local variables = " +
- c.getMaxLocals() + "</LI>\n<LI><A HREF=\"" + class_name +
- "_code.html#method" + method_number + "\" TARGET=Code>Byte code</A></LI></UL>\n");
-
- // Get handled exceptions and list them
- CodeException[] ce = c.getExceptionTable();
- int len = ce.length;
-
- if(len > 0) {
- file.print("<P><B>Exceptions handled</B><UL>");
-
- for(int i=0; i < len; i++) {
- int catch_type = ce[i].getCatchType(); // Index in constant pool
-
- file.print("<LI>");
-
- if(catch_type != 0)
- file.print(constant_html.referenceConstant(catch_type)); // Create Link to _cp.html
- else
- file.print("Any Exception");
-
- file.print("<BR>(Ranging from lines " + codeLink(ce[i].getStartPC(), method_number) +
- " to " + codeLink(ce[i].getEndPC(), method_number) + ", handled at line " +
- codeLink(ce[i].getHandlerPC(), method_number) + ")</LI>");
- }
- file.print("</UL>");
- }
- break;
-
- case ATTR_CONSTANT_VALUE:
- index = ((ConstantValue)attribute).getConstantValueIndex();
-
- // Reference _cp.html
- file.print("<UL><LI><A HREF=\"" + class_name + "_cp.html#cp" + index +
- "\" TARGET=\"ConstantPool\">Constant value index(" + index +")</A></UL>\n");
- break;
-
- case ATTR_SOURCE_FILE:
- index = ((SourceFile)attribute).getSourceFileIndex();
-
- // Reference _cp.html
- file.print("<UL><LI><A HREF=\"" + class_name + "_cp.html#cp" + index +
- "\" TARGET=\"ConstantPool\">Source file index(" + index +")</A></UL>\n");
- break;
-
- case ATTR_EXCEPTIONS:
- // List thrown exceptions
- int[] indices = ((ExceptionTable)attribute).getExceptionIndexTable();
-
- file.print("<UL>");
-
- for(int i=0; i < indices.length; i++)
- file.print("<LI><A HREF=\"" + class_name + "_cp.html#cp" + indices[i] +
- "\" TARGET=\"ConstantPool\">Exception class index(" + indices[i] + ")</A>\n");
-
- file.print("</UL>\n");
- break;
-
- case ATTR_LINE_NUMBER_TABLE:
- LineNumber[] line_numbers =((LineNumberTable)attribute).getLineNumberTable();
-
- // List line number pairs
- file.print("<P>");
-
- for(int i=0; i < line_numbers.length; i++) {
- file.print("(" + line_numbers[i].getStartPC() + ",&nbsp;" + line_numbers[i].getLineNumber() + ")");
-
- if(i < line_numbers.length - 1)
- file.print(", "); // breakable
- }
- break;
-
- case ATTR_LOCAL_VARIABLE_TABLE:
- LocalVariable[] vars = ((LocalVariableTable)attribute).getLocalVariableTable();
-
- // List name, range and type
- file.print("<UL>");
-
- for(int i=0; i < vars.length; i++) {
- index = vars[i].getSignatureIndex();
- String signature = ((ConstantUtf8)constant_pool.getConstant(index, CONSTANT_Utf8)).getBytes();
- signature = Utility.signatureToString(signature, false);
- int start = vars[i].getStartPC();
- int end = (start + vars[i].getLength());
-
- file.println("<LI>" + Class2HTML.referenceType(signature) +
- "&nbsp;<B>" + vars[i].getName() + "</B> in slot %" + vars[i].getIndex() +
- "<BR>Valid from lines " +
- "<A HREF=\"" + class_name + "_code.html#code" + method_number + "@" + start + "\" TARGET=Code>" +
- start + "</A> to " +
- "<A HREF=\"" + class_name + "_code.html#code" + method_number + "@" + end + "\" TARGET=Code>" +
- end + "</A></LI>");
- }
- file.print("</UL>\n");
-
- break;
-
- case ATTR_INNER_CLASSES:
- InnerClass[] classes = ((InnerClasses)attribute).getInnerClasses();
-
- // List inner classes
- file.print("<UL>");
-
- for(int i=0; i < classes.length; i++) {
- String name, access;
-
- index = classes[i].getInnerNameIndex();
- if(index > 0)
- name =((ConstantUtf8)constant_pool.getConstant(index, CONSTANT_Utf8)).getBytes();
- else
- name = "&lt;anonymous&gt;";
-
- access = Utility.accessToString(classes[i].getInnerAccessFlags());
-
- file.print("<LI><FONT COLOR=\"#FF0000\">" + access + "</FONT> "+
- constant_html.referenceConstant(classes[i].getInnerClassIndex()) +
- " in&nbsp;class " +
- constant_html.referenceConstant(classes[i].getOuterClassIndex()) +
- " named " + name + "</LI>\n");
- }
-
- file.print("</UL>\n");
- break;
-
- default: // Such as Unknown attribute or Deprecated
- file.print("<P>" + attribute.toString());
- }
-
- file.println("</TD></TR>");
- file.flush();
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/util/BCELFactory.java b/src/com/sun/org/apache/bcel/internal/util/BCELFactory.java
deleted file mode 100644
index a3b2543..0000000
--- a/src/com/sun/org/apache/bcel/internal/util/BCELFactory.java
+++ /dev/null
@@ -1,360 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.util;
-
-import com.sun.org.apache.bcel.internal.generic.*;
-import com.sun.org.apache.bcel.internal.classfile.Utility;
-import com.sun.org.apache.bcel.internal.Constants;
-import java.io.PrintWriter;
-import java.util.*;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-/**
- * Factory creates il.append() statements, and sets instruction targets.
- * A helper class for BCELifier.
- *
- * @see BCELifier
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-class BCELFactory extends EmptyVisitor {
- private MethodGen _mg;
- private PrintWriter _out;
- private ConstantPoolGen _cp;
-
- BCELFactory(MethodGen mg, PrintWriter out) {
- _mg = mg;
- _cp = mg.getConstantPool();
- _out = out;
- }
-
- private HashMap branch_map = new HashMap(); // Map<Instruction, InstructionHandle>
-
- public void start() {
- if(!_mg.isAbstract() && !_mg.isNative()) {
- for(InstructionHandle ih = _mg.getInstructionList().getStart();
- ih != null; ih = ih.getNext()) {
- Instruction i = ih.getInstruction();
-
- if(i instanceof BranchInstruction) {
- branch_map.put(i, ih); // memorize container
- }
-
- if(ih.hasTargeters()) {
- if(i instanceof BranchInstruction) {
- _out.println(" InstructionHandle ih_" + ih.getPosition() + ";");
- } else {
- _out.print(" InstructionHandle ih_" + ih.getPosition() + " = ");
- }
- } else {
- _out.print(" ");
- }
-
- if(!visitInstruction(i))
- i.accept(this);
- }
-
- updateBranchTargets();
- updateExceptionHandlers();
- }
- }
-
- private boolean visitInstruction(Instruction i) {
- short opcode = i.getOpcode();
-
- if((InstructionConstants.INSTRUCTIONS[opcode] != null) &&
- !(i instanceof ConstantPushInstruction) &&
- !(i instanceof ReturnInstruction)) { // Handled below
- _out.println("il.append(InstructionConstants." +
- i.getName().toUpperCase() + ");");
- return true;
- }
-
- return false;
- }
-
- public void visitLocalVariableInstruction(LocalVariableInstruction i) {
- short opcode = i.getOpcode();
- Type type = i.getType(_cp);
-
- if(opcode == Constants.IINC) {
- _out.println("il.append(new IINC(" + i.getIndex() + ", " +
- ((IINC)i).getIncrement() + "));");
- } else {
- String kind = (opcode < Constants.ISTORE)? "Load" : "Store";
- _out.println("il.append(_factory.create" + kind + "(" +
- BCELifier.printType(type) + ", " +
- i.getIndex() + "));");
- }
- }
-
- public void visitArrayInstruction(ArrayInstruction i) {
- short opcode = i.getOpcode();
- Type type = i.getType(_cp);
- String kind = (opcode < Constants.IASTORE)? "Load" : "Store";
-
- _out.println("il.append(_factory.createArray" + kind + "(" +
- BCELifier.printType(type) + "));");
- }
-
- public void visitFieldInstruction(FieldInstruction i) {
- short opcode = i.getOpcode();
-
- String class_name = i.getClassName(_cp);
- String field_name = i.getFieldName(_cp);
- Type type = i.getFieldType(_cp);
-
- _out.println("il.append(_factory.createFieldAccess(\"" +
- class_name + "\", \"" + field_name + "\", " +
- BCELifier.printType(type) + ", " +
- "Constants." + Constants.OPCODE_NAMES[opcode].toUpperCase() +
- "));");
- }
-
- public void visitInvokeInstruction(InvokeInstruction i) {
- short opcode = i.getOpcode();
- String class_name = i.getClassName(_cp);
- String method_name = i.getMethodName(_cp);
- Type type = i.getReturnType(_cp);
- Type[] arg_types = i.getArgumentTypes(_cp);
-
- _out.println("il.append(_factory.createInvoke(\"" +
- class_name + "\", \"" + method_name + "\", " +
- BCELifier.printType(type) + ", " +
- BCELifier.printArgumentTypes(arg_types) + ", " +
- "Constants." + Constants.OPCODE_NAMES[opcode].toUpperCase() +
- "));");
- }
-
- public void visitAllocationInstruction(AllocationInstruction i) {
- Type type;
-
- if(i instanceof CPInstruction) {
- type = ((CPInstruction)i).getType(_cp);
- } else {
- type = ((NEWARRAY)i).getType();
- }
-
- short opcode = ((Instruction)i).getOpcode();
- int dim = 1;
-
- switch(opcode) {
- case Constants.NEW:
- _out.println("il.append(_factory.createNew(\"" +
- ((ObjectType)type).getClassName() + "\"));");
- break;
-
- case Constants.MULTIANEWARRAY:
- dim = ((MULTIANEWARRAY)i).getDimensions();
-
- case Constants.ANEWARRAY:
- case Constants.NEWARRAY:
- _out.println("il.append(_factory.createNewArray(" +
- BCELifier.printType(type) + ", (short) " + dim + "));");
- break;
-
- default:
- throw new RuntimeException("Oops: " + opcode);
- }
- }
-
- private void createConstant(Object value) {
- String embed = value.toString();
-
- if(value instanceof String)
- embed = '"' + Utility.convertString(value.toString()) + '"';
- else if(value instanceof Character)
- embed = "(char)0x" + Integer.toHexString(((Character)value).charValue());
-
- _out.println("il.append(new PUSH(_cp, " + embed + "));");
- }
-
- public void visitLDC(LDC i) {
- createConstant(i.getValue(_cp));
- }
-
- public void visitLDC2_W(LDC2_W i) {
- createConstant(i.getValue(_cp));
- }
-
- public void visitConstantPushInstruction(ConstantPushInstruction i) {
- createConstant(i.getValue());
- }
-
- public void visitINSTANCEOF(INSTANCEOF i) {
- Type type = i.getType(_cp);
-
- _out.println("il.append(new INSTANCEOF(_cp.addClass(" +
- BCELifier.printType(type) + ")));");
- }
-
- public void visitCHECKCAST(CHECKCAST i) {
- Type type = i.getType(_cp);
-
- _out.println("il.append(_factory.createCheckCast(" +
- BCELifier.printType(type) + "));");
- }
-
- public void visitReturnInstruction(ReturnInstruction i) {
- Type type = i.getType(_cp);
-
- _out.println("il.append(_factory.createReturn(" +
- BCELifier.printType(type) + "));");
- }
-
- // Memorize BranchInstructions that need an update
- private ArrayList branches = new ArrayList();
-
- public void visitBranchInstruction(BranchInstruction bi) {
- BranchHandle bh = (BranchHandle)branch_map.get(bi);
- int pos = bh.getPosition();
- String name = bi.getName() + "_" + pos;
-
- if(bi instanceof Select) {
- Select s = (Select)bi;
- branches.add(bi);
-
- StringBuffer args = new StringBuffer("new int[] { ");
- int[] matchs = s.getMatchs();
-
- for(int i=0; i < matchs.length; i++) {
- args.append(matchs[i]);
-
- if(i < matchs.length - 1)
- args.append(", ");
- }
-
- args.append(" }");
-
- _out.print(" Select " + name + " = new " +
- bi.getName().toUpperCase() + "(" + args +
- ", new InstructionHandle[] { ");
-
- for(int i=0; i < matchs.length; i++) {
- _out.print("null");
-
- if(i < matchs.length - 1)
- _out.print(", ");
- }
-
- _out.println(");");
- } else {
- int t_pos = bh.getTarget().getPosition();
- String target;
-
- if(pos > t_pos) {
- target = "ih_" + t_pos;
- } else {
- branches.add(bi);
- target = "null";
- }
-
- _out.println(" BranchInstruction " + name +
- " = _factory.createBranchInstruction(" +
- "Constants." + bi.getName().toUpperCase() + ", " +
- target + ");");
- }
-
- if(bh.hasTargeters())
- _out.println(" ih_" + pos + " = il.append(" + name + ");");
- else
- _out.println(" il.append(" + name + ");");
- }
-
- public void visitRET(RET i) {
- _out.println("il.append(new RET(" + i.getIndex() + ")));");
- }
-
- private void updateBranchTargets() {
- for(Iterator i = branches.iterator(); i.hasNext(); ) {
- BranchInstruction bi = (BranchInstruction)i.next();
- BranchHandle bh = (BranchHandle)branch_map.get(bi);
- int pos = bh.getPosition();
- String name = bi.getName() + "_" + pos;
- int t_pos = bh.getTarget().getPosition();
-
- _out.println(" " + name + ".setTarget(ih_" + t_pos + ");");
-
- if(bi instanceof Select) {
- InstructionHandle[] ihs = ((Select)bi).getTargets();
-
- for(int j = 0; j < ihs.length; j++) {
- t_pos = ihs[j].getPosition();
-
- _out.println(" " + name + ".setTarget(" + j +
- ", ih_" + t_pos + ");");
- }
- }
- }
- }
-
- private void updateExceptionHandlers() {
- CodeExceptionGen[] handlers = _mg.getExceptionHandlers();
-
- for(int i=0; i < handlers.length; i++) {
- CodeExceptionGen h = handlers[i];
- String type = (h.getCatchType() == null)?
- "null" : BCELifier.printType(h.getCatchType());
-
- _out.println(" method.addExceptionHandler(" +
- "ih_" + h.getStartPC().getPosition() + ", " +
- "ih_" + h.getEndPC().getPosition() + ", " +
- "ih_" + h.getHandlerPC().getPosition() + ", " +
- type + ");");
- }
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/util/BCELifier.java b/src/com/sun/org/apache/bcel/internal/util/BCELifier.java
deleted file mode 100644
index 87a8244..0000000
--- a/src/com/sun/org/apache/bcel/internal/util/BCELifier.java
+++ /dev/null
@@ -1,307 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.util;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import com.sun.org.apache.bcel.internal.classfile.*;
-import com.sun.org.apache.bcel.internal.generic.*;
-import com.sun.org.apache.bcel.internal.Repository;
-import com.sun.org.apache.bcel.internal.Constants;
-import java.io.*;
-
-/**
- * This class takes a given JavaClass object and converts it to a
- * Java program that creates that very class using BCEL. This
- * gives new users of BCEL a useful example showing how things
- * are done with BCEL. It does not cover all features of BCEL,
- * but tries to mimic hand-written code as close as possible.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class BCELifier extends com.sun.org.apache.bcel.internal.classfile.EmptyVisitor {
- private JavaClass _clazz;
- private PrintWriter _out;
- private ConstantPoolGen _cp;
-
- /** @param clazz Java class to "decompile"
- * @param out where to output Java program
- */
- public BCELifier(JavaClass clazz, OutputStream out) {
- _clazz = clazz;
- _out = new PrintWriter(out);
- _cp = new ConstantPoolGen(_clazz.getConstantPool());
- }
-
- /** Start Java code generation
- */
- public void start() {
- visitJavaClass(_clazz);
- _out.flush();
- }
-
- public void visitJavaClass(JavaClass clazz) {
- String class_name = clazz.getClassName();
- String super_name = clazz.getSuperclassName();
- String package_name = clazz.getPackageName();
- String inter = Utility.printArray(clazz.getInterfaceNames(),
- false, true);
- if(!"".equals(package_name)) {
- class_name = class_name.substring(package_name.length() + 1);
- _out.println("package " + package_name + ";\n");
- }
-
- _out.println("import com.sun.org.apache.bcel.internal.generic.*;");
- _out.println("import com.sun.org.apache.bcel.internal.classfile.*;");
- _out.println("import com.sun.org.apache.bcel.internal.*;");
- _out.println("import java.io.*;\n");
-
- _out.println("public class " + class_name + "Creator implements Constants {");
- _out.println(" private InstructionFactory _factory;");
- _out.println(" private ConstantPoolGen _cp;");
- _out.println(" private ClassGen _cg;\n");
-
- _out.println(" public " + class_name + "Creator() {");
- _out.println(" _cg = new ClassGen(\"" +
- (("".equals(package_name))? class_name :
- package_name + "." + class_name) +
- "\", \"" + super_name + "\", " +
- "\"" + clazz.getSourceFileName() + "\", " +
- printFlags(clazz.getAccessFlags(), true) + ", " +
- "new String[] { " + inter + " });\n");
-
- _out.println(" _cp = _cg.getConstantPool();");
- _out.println(" _factory = new InstructionFactory(_cg, _cp);");
- _out.println(" }\n");
-
- printCreate();
-
- Field[] fields = clazz.getFields();
-
- if(fields.length > 0) {
- _out.println(" private void createFields() {");
- _out.println(" FieldGen field;");
-
- for(int i=0; i < fields.length; i++) {
- fields[i].accept(this);
- }
-
- _out.println(" }\n");
- }
-
- Method[] methods = clazz.getMethods();
-
- for(int i=0; i < methods.length; i++) {
- _out.println(" private void createMethod_" + i + "() {");
-
- methods[i].accept(this);
- _out.println(" }\n");
- }
-
- printMain();
- _out.println("}");
- }
-
- private void printCreate() {
- _out.println(" public void create(OutputStream out) throws IOException {");
-
- Field[] fields = _clazz.getFields();
- if(fields.length > 0) {
- _out.println(" createFields();");
- }
-
- Method[] methods = _clazz.getMethods();
- for(int i=0; i < methods.length; i++) {
- _out.println(" createMethod_" + i + "();");
- }
-
- _out.println(" _cg.getJavaClass().dump(out);");
-
- _out.println(" }\n");
- }
-
- private void printMain() {
- String class_name = _clazz.getClassName();
-
- _out.println(" public static void _main(String[] args) throws Exception {");
- _out.println(" " + class_name + "Creator creator = new " +
- class_name + "Creator();");
- _out.println(" creator.create(new FileOutputStream(\"" + class_name +
- ".class\"));");
- _out.println(" }");
- }
-
- public void visitField(Field field) {
- _out.println("\n field = new FieldGen(" +
- printFlags(field.getAccessFlags()) +
- ", " + printType(field.getSignature()) + ", \"" +
- field.getName() + "\", _cp);");
-
- ConstantValue cv = field.getConstantValue();
-
- if(cv != null) {
- String value = cv.toString();
- _out.println(" field.setInitValue(" + value + ")");
- }
-
- _out.println(" _cg.addField(field.getField());");
- }
-
- public void visitMethod(Method method) {
- MethodGen mg = new MethodGen(method, _clazz.getClassName(), _cp);
-
- Type result_type = mg.getReturnType();
- Type[] arg_types = mg.getArgumentTypes();
-
- _out.println(" InstructionList il = new InstructionList();");
- _out.println(" MethodGen method = new MethodGen(" +
- printFlags(method.getAccessFlags()) +
- ", " + printType(result_type) +
- ", " + printArgumentTypes(arg_types) + ", " +
- "new String[] { " +
- Utility.printArray(mg.getArgumentNames(), false, true) +
- " }, \"" + method.getName() + "\", \"" +
- _clazz.getClassName() + "\", il, _cp);\n");
-
- BCELFactory factory = new BCELFactory(mg, _out);
- factory.start();
-
- _out.println(" method.setMaxStack();");
- _out.println(" method.setMaxLocals();");
- _out.println(" _cg.addMethod(method.getMethod());");
- _out.println(" il.dispose();");
- }
-
- static String printFlags(int flags) {
- return printFlags(flags, false);
- }
-
- static String printFlags(int flags, boolean for_class) {
- if(flags == 0)
- return "0";
-
- StringBuffer buf = new StringBuffer();
- for(int i=0, pow=1; i <= Constants.MAX_ACC_FLAG; i++) {
- if((flags & pow) != 0) {
- if((pow == Constants.ACC_SYNCHRONIZED) && for_class)
- buf.append("ACC_SUPER | ");
- else
- buf.append("ACC_" + Constants.ACCESS_NAMES[i].toUpperCase() + " | ");
- }
-
- pow <<= 1;
- }
-
- String str = buf.toString();
- return str.substring(0, str.length() - 3);
- }
-
- static String printArgumentTypes(Type[] arg_types) {
- if(arg_types.length == 0)
- return "Type.NO_ARGS";
-
- StringBuffer args = new StringBuffer();
-
- for(int i=0; i < arg_types.length; i++) {
- args.append(printType(arg_types[i]));
-
- if(i < arg_types.length - 1)
- args.append(", ");
- }
-
- return "new Type[] { " + args.toString() + " }";
- }
-
- static String printType(Type type) {
- return printType(type.getSignature());
- }
-
- static String printType(String signature) {
- Type type = Type.getType(signature);
- byte t = type.getType();
-
- if(t <= Constants.T_VOID) {
- return "Type." + Constants.TYPE_NAMES[t].toUpperCase();
- } else if(type.toString().equals("java.lang.String")) {
- return "Type.STRING";
- } else if(type.toString().equals("java.lang.Object")) {
- return "Type.OBJECT";
- } else if(type.toString().equals("java.lang.StringBuffer")) {
- return "Type.STRINGBUFFER";
- } else if(type instanceof ArrayType) {
- ArrayType at = (ArrayType)type;
-
- return "new ArrayType(" + printType(at.getBasicType()) +
- ", " + at.getDimensions() + ")";
- } else {
- return "new ObjectType(\"" + Utility.signatureToString(signature, false) +
- "\")";
- }
- }
-
- /** Default _main method
- */
- public static void _main(String[] argv) throws Exception {
- JavaClass java_class;
- String name = argv[0];
-
- if((java_class = Repository.lookupClass(name)) == null)
- java_class = new ClassParser(name).parse(); // May throw IOException
-
- BCELifier bcelifier = new BCELifier(java_class, System.out);
- bcelifier.start();
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/util/ByteSequence.java b/src/com/sun/org/apache/bcel/internal/util/ByteSequence.java
deleted file mode 100644
index e0dacd7..0000000
--- a/src/com/sun/org/apache/bcel/internal/util/ByteSequence.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.util;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import java.io.*;
-
-/**
- * Utility class that implements a sequence of bytes which can be read
- * via the `readByte()' method. This is used to implement a wrapper for the
- * Java byte code stream to gain some more readability.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public final class ByteSequence extends DataInputStream {
- private ByteArrayStream byte_stream;
-
- public ByteSequence(byte[] bytes) {
- super(new ByteArrayStream(bytes));
- byte_stream = (ByteArrayStream)in;
- }
-
- public final int getIndex() { return byte_stream.getPosition(); }
- final void unreadByte() { byte_stream.unreadByte(); }
-
- private static final class ByteArrayStream extends ByteArrayInputStream {
- ByteArrayStream(byte[] bytes) { super(bytes); }
- final int getPosition() { return pos; } // is protected in ByteArrayInputStream
- final void unreadByte() { if(pos > 0) pos--; }
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/util/Class2HTML.java b/src/com/sun/org/apache/bcel/internal/util/Class2HTML.java
deleted file mode 100644
index 5a9e094..0000000
--- a/src/com/sun/org/apache/bcel/internal/util/Class2HTML.java
+++ /dev/null
@@ -1,266 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.util;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import java.io.*;
-import java.util.BitSet;
-import com.sun.org.apache.bcel.internal.classfile.*;
-import com.sun.org.apache.bcel.internal.Constants;
-
-/**
- * Read class file(s) and convert them into HTML files.
- *
- * Given a JavaClass object "class" that is in package "package" five files
- * will be created in the specified directory.
- *
- * <OL>
- * <LI> "package"."class".html as the main file which defines the frames for
- * the following subfiles.
- * <LI> "package"."class"_attributes.html contains all (known) attributes found in the file
- * <LI> "package"."class"_cp.html contains the constant pool
- * <LI> "package"."class"_code.html contains the byte code
- * <LI> "package"."class"_methods.html contains references to all methods and fields of the class
- * </OL>
- *
- * All subfiles reference each other appropiately, e.g. clicking on a
- * method in the Method's frame will jump to the appropiate method in
- * the Code frame.
- *
- * @version $Id: Class2HTML.java,v 1.3 2007-07-19 04:34:52 ofung Exp $
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
-*/
-public class Class2HTML implements Constants
-{
- private JavaClass java_class; // current class object
- private String dir;
-
- private static String class_package; // name of package, unclean to make it static, but ...
- private static String class_name; // name of current class, dito
- private static ConstantPool constant_pool;
-
- /**
- * Write contents of the given JavaClass into HTML files.
- *
- * @param java_class The class to write
- * @param dir The directory to put the files in
- */
- public Class2HTML(JavaClass java_class, String dir) throws IOException {
- Method[] methods = java_class.getMethods();
-
- this.java_class = java_class;
- this.dir = dir;
- class_name = java_class.getClassName(); // Remember full name
- constant_pool = java_class.getConstantPool();
-
- // Get package name by tacking off everything after the last `.'
- int index = class_name.lastIndexOf('.');
- if(index > -1)
- class_package = class_name.substring(0, index);
- else
- class_package = ""; // default package
-
- ConstantHTML constant_html = new ConstantHTML(dir, class_name, class_package, methods,
- constant_pool);
-
- /* Attributes can't be written in one step, so we just open a file
- * which will be written consequently.
- */
- AttributeHTML attribute_html = new AttributeHTML(dir, class_name, constant_pool, constant_html);
-
- MethodHTML method_html = new MethodHTML(dir, class_name, methods, java_class.getFields(),
- constant_html, attribute_html);
- // Write main file (with frames, yuk)
- writeMainHTML(attribute_html);
- new CodeHTML(dir, class_name, methods, constant_pool, constant_html);
- attribute_html.close();
- }
-
- public static void _main(String argv[])
- {
- String[] file_name = new String[argv.length];
- int files=0;
- ClassParser parser=null;
- JavaClass java_class=null;
- String zip_file = null;
- char sep = SecuritySupport.getSystemProperty("file.separator").toCharArray()[0];
- String dir = "." + sep; // Where to store HTML files
-
- try {
- /* Parse command line arguments.
- */
- for(int i=0; i < argv.length; i++) {
- if(argv[i].charAt(0) == '-') { // command line switch
- if(argv[i].equals("-d")) { // Specify target directory, default '.'
- dir = argv[++i];
-
- if(!dir.endsWith("" + sep))
- dir = dir + sep;
-
- new File(dir).mkdirs(); // Create target directory if necessary
- }
- else if(argv[i].equals("-zip"))
- zip_file = argv[++i];
- else
- System.out.println("Unknown option " + argv[i]);
- }
- else // add file name to list */
- file_name[files++] = argv[i];
- }
-
- if(files == 0)
- System.err.println("Class2HTML: No input files specified.");
- else { // Loop through files ...
- for(int i=0; i < files; i++) {
- System.out.print("Processing " + file_name[i] + "...");
- if(zip_file == null)
- parser = new ClassParser(file_name[i]); // Create parser object from file
- else
- parser = new ClassParser(zip_file, file_name[i]); // Create parser object from zip file
-
- java_class = parser.parse();
- new Class2HTML(java_class, dir);
- System.out.println("Done.");
- }
- }
- } catch(Exception e) {
- System.out.println(e);
- e.printStackTrace(System.out);
- }
- }
-
- /**
- * Utility method that converts a class reference in the constant pool,
- * i.e., an index to a string.
- */
- static String referenceClass(int index) {
- String str = constant_pool.getConstantString(index, CONSTANT_Class);
- str = Utility.compactClassName(str);
- str = Utility.compactClassName(str, class_package + ".", true);
-
- return "<A HREF=\"" + class_name + "_cp.html#cp" + index +
- "\" TARGET=ConstantPool>" + str + "</A>";
- }
-
- static final String referenceType(String type) {
- String short_type = Utility.compactClassName(type);
- short_type = Utility.compactClassName(short_type, class_package + ".", true);
-
- int index = type.indexOf('['); // Type is an array?
- if(index > -1)
- type = type.substring(0, index); // Tack of the `['
-
- // test for basic type
- if(type.equals("int") || type.equals("short") || type.equals("boolean") || type.equals("void") ||
- type.equals("char") || type.equals("byte") || type.equals("long") || type.equals("double") ||
- type.equals("float"))
- return "<FONT COLOR=\"#00FF00\">" + type + "</FONT>";
- else
- return "<A HREF=\"" + type + ".html\" TARGET=_top>" + short_type + "</A>";
- }
-
- static String toHTML(String str) {
- StringBuffer buf = new StringBuffer();
-
- try { // Filter any characters HTML doesn't like such as < and > in particular
- for(int i=0; i < str.length(); i++) {
- char ch;
-
- switch(ch=str.charAt(i)) {
- case '<': buf.append("&lt;"); break;
- case '>': buf.append("&gt;"); break;
- case '\n': buf.append("\\n"); break;
- case '\r': buf.append("\\r"); break;
- default: buf.append(ch);
- }
- }
- } catch(StringIndexOutOfBoundsException e) {} // Never occurs
-
- return buf.toString();
- }
-
- private void writeMainHTML(AttributeHTML attribute_html) throws IOException {
- PrintWriter file = new PrintWriter(new FileOutputStream(dir + class_name + ".html"));
- Attribute[] attributes = java_class.getAttributes();
-
- file.println("<HTML>\n" + "<HEAD><TITLE>Documentation for " + class_name + "</TITLE>" +
- "</HEAD>\n" +
- "<FRAMESET BORDER=1 cols=\"30%,*\">\n" +
- "<FRAMESET BORDER=1 rows=\"80%,*\">\n" +
-
- "<FRAME NAME=\"ConstantPool\" SRC=\"" + class_name + "_cp.html" + "\"\n MARGINWIDTH=\"0\" " +
- "MARGINHEIGHT=\"0\" FRAMEBORDER=\"1\" SCROLLING=\"AUTO\">\n" +
- "<FRAME NAME=\"Attributes\" SRC=\"" + class_name + "_attributes.html" +
- "\"\n MARGINWIDTH=\"0\" " +
- "MARGINHEIGHT=\"0\" FRAMEBORDER=\"1\" SCROLLING=\"AUTO\">\n" +
- "</FRAMESET>\n" +
-
- "<FRAMESET BORDER=1 rows=\"80%,*\">\n" +
- "<FRAME NAME=\"Code\" SRC=\"" + class_name + "_code.html\"\n MARGINWIDTH=0 " +
- "MARGINHEIGHT=0 FRAMEBORDER=1 SCROLLING=\"AUTO\">\n" +
- "<FRAME NAME=\"Methods\" SRC=\"" + class_name + "_methods.html\"\n MARGINWIDTH=0 " +
- "MARGINHEIGHT=0 FRAMEBORDER=1 SCROLLING=\"AUTO\">\n" +
- "</FRAMESET></FRAMESET></HTML>"
- );
-
- file.close();
-
- for(int i=0; i < attributes.length; i++)
- attribute_html.writeAttribute(attributes[i], "class" + i);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/util/ClassLoader.java b/src/com/sun/org/apache/bcel/internal/util/ClassLoader.java
deleted file mode 100644
index 1be5b3b..0000000
--- a/src/com/sun/org/apache/bcel/internal/util/ClassLoader.java
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.util;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import java.util.Hashtable;
-import java.io.*;
-import com.sun.org.apache.bcel.internal.*;
-import com.sun.org.apache.bcel.internal.classfile.*;
-
-/**
- * <p>Drop in replacement for the standard class loader of the JVM. You can use it
- * in conjunction with the JavaWrapper to dynamically modify/create classes
- * as they're requested.</p>
- *
- * <p>This class loader recognizes special requests in a distinct
- * format, i.e., when the name of the requested class contains with
- * "$$BCEL$$" it calls the createClass() method with that name
- * (everything bevor the $$BCEL$$ is considered to be the package
- * name. You can subclass the class loader and override that
- * method. "Normal" classes class can be modified by overriding the
- * modifyClass() method which is called just before defineClass().</p>
- *
- * <p>There may be a number of packages where you have to use the default
- * class loader (which may also be faster). You can define the set of packages
- * where to use the system class loader in the constructor. The default value contains
- * "java.", "sun.", "javax."</p>
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see JavaWrapper
- * @see ClassPath
- */
-public class ClassLoader extends java.lang.ClassLoader {
- private Hashtable classes = new Hashtable(); // Hashtable is synchronized thus thread-safe
- private String[] ignored_packages = {
- "java.", "javax.", "sun."
- };
- private Repository repository = SyntheticRepository.getInstance();
- private java.lang.ClassLoader deferTo = ClassLoader.getSystemClassLoader();
-
- public ClassLoader() {
- }
-
- public ClassLoader(java.lang.ClassLoader deferTo) {
- this.deferTo = deferTo;
- this.repository = new ClassLoaderRepository(deferTo);
- }
-
- /** @param ignored_packages classes contained in these packages will be loaded
- * with the system class loader
- */
- public ClassLoader(String[] ignored_packages) {
- addIgnoredPkgs(ignored_packages);
- }
-
- public ClassLoader(java.lang.ClassLoader deferTo, String [] ignored_packages) {
- this.deferTo = deferTo;
- this.repository = new ClassLoaderRepository(deferTo);
-
- addIgnoredPkgs(ignored_packages);
- }
-
- private void addIgnoredPkgs(String[] ignored_packages) {
- String[] new_p = new String[ignored_packages.length + this.ignored_packages.length];
-
- System.arraycopy(this.ignored_packages, 0, new_p, 0, this.ignored_packages.length);
- System.arraycopy(ignored_packages, 0, new_p, this.ignored_packages.length,
- ignored_packages.length);
-
- this.ignored_packages = new_p;
- }
-
- protected Class loadClass(String class_name, boolean resolve)
- throws ClassNotFoundException
- {
- Class cl = null;
-
- /* First try: lookup hash table.
- */
- if((cl=(Class)classes.get(class_name)) == null) {
- /* Second try: Load system class using system class loader. You better
- * don't mess around with them.
- */
- for(int i=0; i < ignored_packages.length; i++) {
- if(class_name.startsWith(ignored_packages[i])) {
- cl = deferTo.loadClass(class_name);
- break;
- }
- }
-
- if(cl == null) {
- JavaClass clazz = null;
-
- /* Third try: Special request?
- */
- if(class_name.indexOf("$$BCEL$$") >= 0)
- clazz = createClass(class_name);
- else { // Fourth try: Load classes via repository
- if ((clazz = repository.loadClass(class_name)) != null) {
- clazz = modifyClass(clazz);
- }
- else
- throw new ClassNotFoundException(class_name);
- }
-
- if(clazz != null) {
- byte[] bytes = clazz.getBytes();
- cl = defineClass(class_name, bytes, 0, bytes.length);
- } else // Fourth try: Use default class loader
- cl = Class.forName(class_name);
- }
-
- if(resolve)
- resolveClass(cl);
- }
-
- classes.put(class_name, cl);
-
- return cl;
- }
-
- /** Override this method if you want to alter a class before it gets actually
- * loaded. Does nothing by default.
- */
- protected JavaClass modifyClass(JavaClass clazz) {
- return clazz;
- }
-
- /**
- * Override this method to create you own classes on the fly. The
- * name contains the special token $$BCEL$$. Everything before that
- * token is consddered to be a package name. You can encode you own
- * arguments into the subsequent string. You must regard however not
- * to use any "illegal" characters, i.e., characters that may not
- * appear in a Java class name too<br>
- *
- * The default implementation interprets the string as a encoded compressed
- * Java class, unpacks and decodes it with the Utility.decode() method, and
- * parses the resulting byte array and returns the resulting JavaClass object.
- *
- * @param class_name compressed byte code with "$$BCEL$$" in it
- */
- protected JavaClass createClass(String class_name) {
- int index = class_name.indexOf("$$BCEL$$");
- String real_name = class_name.substring(index + 8);
-
- JavaClass clazz = null;
- try {
- byte[] bytes = Utility.decode(real_name, true);
- ClassParser parser = new ClassParser(new ByteArrayInputStream(bytes), "foo");
-
- clazz = parser.parse();
- } catch(Throwable e) {
- e.printStackTrace();
- return null;
- }
-
- // Adapt the class name to the passed value
- ConstantPool cp = clazz.getConstantPool();
-
- ConstantClass cl = (ConstantClass)cp.getConstant(clazz.getClassNameIndex(),
- Constants.CONSTANT_Class);
- ConstantUtf8 name = (ConstantUtf8)cp.getConstant(cl.getNameIndex(),
- Constants.CONSTANT_Utf8);
- name.setBytes(class_name.replace('.', '/'));
-
- return clazz;
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/util/ClassLoaderRepository.java b/src/com/sun/org/apache/bcel/internal/util/ClassLoaderRepository.java
deleted file mode 100644
index eec10f4..0000000
--- a/src/com/sun/org/apache/bcel/internal/util/ClassLoaderRepository.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.util;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import java.io.*;
-
-import java.util.Map;
-import java.util.HashMap;
-
-import com.sun.org.apache.bcel.internal.classfile.*;
-
-/**
- * The repository maintains information about which classes have
- * been loaded.
- *
- * It loads its data from the ClassLoader implementation
- * passed into its constructor.
- *
- * @see com.sun.org.apache.bcel.internal.Repository
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @author David Dixon-Peugh
- */
-public class ClassLoaderRepository
- implements Repository
-{
- private java.lang.ClassLoader loader;
- private HashMap loadedClasses =
- new HashMap(); // CLASSNAME X JAVACLASS
-
- public ClassLoaderRepository( java.lang.ClassLoader loader ) {
- this.loader = loader;
- }
-
- /**
- * Store a new JavaClass into this Repository.
- */
- public void storeClass( JavaClass clazz ) {
- loadedClasses.put( clazz.getClassName(),
- clazz );
- clazz.setRepository( this );
- }
-
- /**
- * Remove class from repository
- */
- public void removeClass(JavaClass clazz) {
- loadedClasses.remove(clazz.getClassName());
- }
-
- /**
- * Find an already defined JavaClass.
- */
- public JavaClass findClass( String className ) {
- if ( loadedClasses.containsKey( className )) {
- return (JavaClass) loadedClasses.get( className );
- } else {
- return null;
- }
- }
-
- /**
- * Lookup a JavaClass object from the Class Name provided.
- */
- public JavaClass loadClass( String className )
- throws ClassNotFoundException
- {
- String classFile = className.replace('.', '/');
-
- JavaClass RC = findClass( className );
- if (RC != null) { return RC; }
-
- try {
- InputStream is =
- loader.getResourceAsStream( classFile + ".class" );
-
- if(is == null) {
- throw new ClassNotFoundException(className + " not found.");
- }
-
- ClassParser parser = new ClassParser( is, className );
- RC = parser.parse();
-
- storeClass( RC );
-
- return RC;
- } catch (IOException e) {
- throw new ClassNotFoundException( e.toString() );
- }
- }
-
- public JavaClass loadClass(Class clazz) throws ClassNotFoundException {
- return loadClass(clazz.getName());
- }
-
- /** Clear all entries from cache.
- */
- public void clear() {
- loadedClasses.clear();
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/util/ClassPath.java b/src/com/sun/org/apache/bcel/internal/util/ClassPath.java
deleted file mode 100644
index 0cd5021..0000000
--- a/src/com/sun/org/apache/bcel/internal/util/ClassPath.java
+++ /dev/null
@@ -1,384 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.util;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import java.util.*;
-import java.util.zip.*;
-import java.io.*;
-
-/**
- * Responsible for loading (class) files from the CLASSPATH. Inspired by
- * sun.tools.ClassPath.
- *
- * @version $Id: ClassPath.java,v 1.4 2007-07-19 04:34:52 ofung Exp $
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class ClassPath implements Serializable {
- public static final ClassPath SYSTEM_CLASS_PATH = new ClassPath();
-
- private PathEntry[] paths;
- private String class_path;
-
- /**
- * Search for classes in given path.
- */
- public ClassPath(String class_path) {
- this.class_path = class_path;
-
- ArrayList vec = new ArrayList();
-
- for(StringTokenizer tok=new StringTokenizer(class_path,
- SecuritySupport.getSystemProperty("path.separator"));
- tok.hasMoreTokens();)
- {
- String path = tok.nextToken();
-
- if(!path.equals("")) {
- File file = new File(path);
-
- try {
- if(SecuritySupport.getFileExists(file)) {
- if(file.isDirectory())
- vec.add(new Dir(path));
- else
- vec.add(new Zip(new ZipFile(file)));
- }
- } catch(IOException e) {
- System.err.println("CLASSPATH component " + file + ": " + e);
- }
- }
- }
-
- paths = new PathEntry[vec.size()];
- vec.toArray(paths);
- }
-
- /**
- * Search for classes in CLASSPATH.
- * @deprecated Use SYSTEM_CLASS_PATH constant
- */
- public ClassPath() {
- // this(getClassPath());
- this("");
- }
-
- /** @return used class path string
- */
- public String toString() {
- return class_path;
- }
-
- public int hashCode() {
- return class_path.hashCode();
- }
-
- public boolean equals(Object o) {
- if(o instanceof ClassPath) {
- return class_path.equals(((ClassPath)o).class_path);
- }
-
- return false;
- }
-
- private static final void getPathComponents(String path, ArrayList list) {
- if(path != null) {
- StringTokenizer tok = new StringTokenizer(path, File.pathSeparator);
-
- while(tok.hasMoreTokens()) {
- String name = tok.nextToken();
- File file = new File(name);
-
- if(SecuritySupport.getFileExists(file)) {
- list.add(name);
- }
- }
- }
- }
-
- /** Checks for class path components in the following properties:
- * "java.class.path", "sun.boot.class.path", "java.ext.dirs"
- *
- * @return class path as used by default by BCEL
- */
- public static final String getClassPath() {
-
- String class_path, boot_path, ext_path;
-
- try {
- class_path = SecuritySupport.getSystemProperty("java.class.path");
- boot_path = SecuritySupport.getSystemProperty("sun.boot.class.path");
- ext_path = SecuritySupport.getSystemProperty("java.ext.dirs");
- }
- catch (SecurityException e) {
- return "";
- }
-
- ArrayList list = new ArrayList();
-
- getPathComponents(class_path, list);
- getPathComponents(boot_path, list);
-
- ArrayList dirs = new ArrayList();
- getPathComponents(ext_path, dirs);
-
- for(Iterator e = dirs.iterator(); e.hasNext(); ) {
- File ext_dir = new File((String)e.next());
- String[] extensions = SecuritySupport.getFileList(ext_dir, new FilenameFilter() {
- public boolean accept(File dir, String name) {
- name = name.toLowerCase();
- return name.endsWith(".zip") || name.endsWith(".jar");
- }
- });
-
- if(extensions != null)
- for(int i=0; i < extensions.length; i++)
- list.add(ext_path + File.separatorChar + extensions[i]);
- }
-
- StringBuffer buf = new StringBuffer();
-
- for(Iterator e = list.iterator(); e.hasNext(); ) {
- buf.append((String)e.next());
-
- if(e.hasNext())
- buf.append(File.pathSeparatorChar);
- }
-
- return buf.toString().intern();
- }
-
- /**
- * @param name fully qualified class name, e.g. java.lang.String
- * @return input stream for class
- */
- public InputStream getInputStream(String name) throws IOException {
- return getInputStream(name, ".class");
- }
-
- /**
- * Return stream for class or resource on CLASSPATH.
- *
- * @param name fully qualified file name, e.g. java/lang/String
- * @param suffix file name ends with suff, e.g. .java
- * @return input stream for file on class path
- */
- public InputStream getInputStream(String name, String suffix) throws IOException {
- InputStream is = null;
-
- try {
- is = getClass().getClassLoader().getResourceAsStream(name + suffix);
- } catch(Exception e) { }
-
- if(is != null)
- return is;
-
- return getClassFile(name, suffix).getInputStream();
- }
-
- /**
- * @param name fully qualified file name, e.g. java/lang/String
- * @param suffix file name ends with suff, e.g. .java
- * @return class file for the java class
- */
- public ClassFile getClassFile(String name, String suffix) throws IOException {
- for(int i=0; i < paths.length; i++) {
- ClassFile cf;
-
- if((cf = paths[i].getClassFile(name, suffix)) != null)
- return cf;
- }
-
- throw new IOException("Couldn't find: " + name + suffix);
- }
-
- /**
- * @param name fully qualified class name, e.g. java.lang.String
- * @return input stream for class
- */
- public ClassFile getClassFile(String name) throws IOException {
- return getClassFile(name, ".class");
- }
-
- /**
- * @param name fully qualified file name, e.g. java/lang/String
- * @param suffix file name ends with suffix, e.g. .java
- * @return byte array for file on class path
- */
- public byte[] getBytes(String name, String suffix) throws IOException {
- InputStream is = getInputStream(name, suffix);
-
- if(is == null)
- throw new IOException("Couldn't find: " + name + suffix);
-
- DataInputStream dis = new DataInputStream(is);
- byte[] bytes = new byte[is.available()];
- dis.readFully(bytes);
- dis.close(); is.close();
-
- return bytes;
- }
-
- /**
- * @return byte array for class
- */
- public byte[] getBytes(String name) throws IOException {
- return getBytes(name, ".class");
- }
-
- /**
- * @param name name of file to search for, e.g. java/lang/String.java
- * @return full (canonical) path for file
- */
- public String getPath(String name) throws IOException {
- int index = name.lastIndexOf('.');
- String suffix = "";
-
- if(index > 0) {
- suffix = name.substring(index);
- name = name.substring(0, index);
- }
-
- return getPath(name, suffix);
- }
-
- /**
- * @param name name of file to search for, e.g. java/lang/String
- * @param suffix file name suffix, e.g. .java
- * @return full (canonical) path for file, if it exists
- */
- public String getPath(String name, String suffix) throws IOException {
- return getClassFile(name, suffix).getPath();
- }
-
- private static abstract class PathEntry implements Serializable {
- abstract ClassFile getClassFile(String name, String suffix) throws IOException;
- }
-
- /** Contains information about file/ZIP entry of the Java class.
- */
- public interface ClassFile {
- /** @return input stream for class file.
- */
- public abstract InputStream getInputStream() throws IOException;
-
- /** @return canonical path to class file.
- */
- public abstract String getPath();
-
- /** @return base path of found class, i.e. class is contained relative
- * to that path, which may either denote a directory, or zip file
- */
- public abstract String getBase();
-
- /** @return modification time of class file.
- */
- public abstract long getTime();
-
- /** @return size of class file.
- */
- public abstract long getSize();
- }
-
- private static class Dir extends PathEntry {
- private String dir;
-
- Dir(String d) { dir = d; }
-
- ClassFile getClassFile(String name, String suffix) throws IOException {
- final File file = new File(dir + File.separatorChar +
- name.replace('.', File.separatorChar) + suffix);
-
- return SecuritySupport.getFileExists(file)? new ClassFile() {
- public InputStream getInputStream() throws IOException { return new FileInputStream(file); }
-
- public String getPath() { try {
- return file.getCanonicalPath();
- } catch(IOException e) { return null; }
-
- }
- public long getTime() { return file.lastModified(); }
- public long getSize() { return file.length(); }
- public String getBase() { return dir; }
-
- } : null;
- }
-
- public String toString() { return dir; }
- }
-
- private static class Zip extends PathEntry {
- private ZipFile zip;
-
- Zip(ZipFile z) { zip = z; }
-
- ClassFile getClassFile(String name, String suffix) throws IOException {
- final ZipEntry entry = zip.getEntry(name.replace('.', '/') + suffix);
-
- return (entry != null)? new ClassFile() {
- public InputStream getInputStream() throws IOException { return zip.getInputStream(entry); }
- public String getPath() { return entry.toString(); }
- public long getTime() { return entry.getTime(); }
- public long getSize() { return entry.getSize(); }
- public String getBase() {
- return zip.getName();
- }
- } : null;
- }
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/util/ClassQueue.java b/src/com/sun/org/apache/bcel/internal/util/ClassQueue.java
deleted file mode 100644
index 2817094..0000000
--- a/src/com/sun/org/apache/bcel/internal/util/ClassQueue.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.util;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import java.util.LinkedList;
-import com.sun.org.apache.bcel.internal.classfile.JavaClass;
-
-/**
- * Utility class implementing a (typesafe) queue of JavaClass
- * objects.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see ClassVector
-*/
-public class ClassQueue implements java.io.Serializable {
- protected LinkedList vec = new LinkedList();
-
- public void enqueue(JavaClass clazz) { vec.addLast(clazz); }
-
- public JavaClass dequeue() {
- return (JavaClass)vec.removeFirst();
- }
-
- public boolean empty() { return vec.isEmpty(); }
-
- public String toString() {
- return vec.toString();
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/util/ClassSet.java b/src/com/sun/org/apache/bcel/internal/util/ClassSet.java
deleted file mode 100644
index e7ea2e4..0000000
--- a/src/com/sun/org/apache/bcel/internal/util/ClassSet.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.util;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import java.util.HashMap;
-import java.util.Collection;
-import com.sun.org.apache.bcel.internal.classfile.JavaClass;
-
-/**
- * Utility class implementing a (typesafe) set of JavaClass objects.
- * Since JavaClass has no equals() method, the name of the class is
- * used for comparison.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see ClassStack
-*/
-public class ClassSet implements java.io.Serializable {
- private HashMap _map = new HashMap();
-
- public boolean add(JavaClass clazz) {
- boolean result = false;
-
- if(!_map.containsKey(clazz.getClassName())) {
- result = true;
- _map.put(clazz.getClassName(), clazz);
- }
-
- return result;
- }
-
- public void remove(JavaClass clazz) { _map.remove(clazz.getClassName()); }
- public boolean empty() { return _map.isEmpty(); }
-
- public JavaClass[] toArray() {
- Collection values = _map.values();
- JavaClass[] classes = new JavaClass[values.size()];
- values.toArray(classes);
- return classes;
- }
-
- public String[] getClassNames() {
- return (String[])_map.keySet().toArray(new String[_map.keySet().size()]);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/util/ClassStack.java b/src/com/sun/org/apache/bcel/internal/util/ClassStack.java
deleted file mode 100644
index 87029e2..0000000
--- a/src/com/sun/org/apache/bcel/internal/util/ClassStack.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.util;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import java.util.Stack;
-import com.sun.org.apache.bcel.internal.classfile.JavaClass;
-
-/**
- * Utility class implementing a (typesafe) stack of JavaClass objects.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see Stack
-*/
-public class ClassStack implements java.io.Serializable {
- private Stack stack = new Stack();
-
- public void push(JavaClass clazz) { stack.push(clazz); }
- public JavaClass pop() { return (JavaClass)stack.pop(); }
- public JavaClass top() { return (JavaClass)stack.peek(); }
- public boolean empty() { return stack.empty(); }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/util/ClassVector.java b/src/com/sun/org/apache/bcel/internal/util/ClassVector.java
deleted file mode 100644
index 28c4789..0000000
--- a/src/com/sun/org/apache/bcel/internal/util/ClassVector.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.util;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-import java.util.ArrayList;
-import com.sun.org.apache.bcel.internal.classfile.JavaClass;
-
-/**
- * Utility class implementing a (typesafe) collection of JavaClass
- * objects. Contains the most important methods of a Vector.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see ClassQueue
-*/
-public class ClassVector implements java.io.Serializable {
- protected ArrayList vec = new ArrayList();
-
- public void addElement(JavaClass clazz) { vec.add(clazz); }
- public JavaClass elementAt(int index) { return (JavaClass)vec.get(index); }
- public void removeElementAt(int index) { vec.remove(index); }
-
- public JavaClass[] toArray() {
- JavaClass[] classes = new JavaClass[vec.size()];
- vec.toArray(classes);
- return classes;
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/util/CodeHTML.java b/src/com/sun/org/apache/bcel/internal/util/CodeHTML.java
deleted file mode 100644
index cae2ea6..0000000
--- a/src/com/sun/org/apache/bcel/internal/util/CodeHTML.java
+++ /dev/null
@@ -1,621 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.util;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.classfile.*;
-import java.io.*;
-import java.util.BitSet;
-
-/**
- * Convert code into HTML file.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- *
- */
-final class CodeHTML implements com.sun.org.apache.bcel.internal.Constants {
- private String class_name; // name of current class
- private Method[] methods; // Methods to print
- private PrintWriter file; // file to write to
- private BitSet goto_set;
- private ConstantPool constant_pool;
- private ConstantHTML constant_html;
- private static boolean wide=false;
-
- CodeHTML(String dir, String class_name,
- Method[] methods, ConstantPool constant_pool,
- ConstantHTML constant_html) throws IOException
- {
- this.class_name = class_name;
- this.methods = methods;
- this.constant_pool = constant_pool;
- this.constant_html = constant_html;
-
- file = new PrintWriter(new FileOutputStream(dir + class_name + "_code.html"));
- file.println("<HTML><BODY BGCOLOR=\"#C0C0C0\">");
-
- for(int i=0; i < methods.length; i++)
- writeMethod(methods[i], i);
-
- file.println("</BODY></HTML>");
- file.close();
- }
-
- /**
- * Disassemble a stream of byte codes and return the
- * string representation.
- *
- * @param stream data input stream
- * @return String representation of byte code
- */
- private final String codeToHTML(ByteSequence bytes, int method_number)
- throws IOException
- {
- short opcode = (short)bytes.readUnsignedByte();
- StringBuffer buf;
- String name, signature;
- int default_offset=0, low, high;
- int index, class_index, vindex, constant;
- int[] jump_table;
- int no_pad_bytes=0, offset;
-
- buf = new StringBuffer("<TT>" + OPCODE_NAMES[opcode] + "</TT></TD><TD>");
-
- /* Special case: Skip (0-3) padding bytes, i.e., the
- * following bytes are 4-byte-aligned
- */
- if((opcode == TABLESWITCH) || (opcode == LOOKUPSWITCH)) {
- int remainder = bytes.getIndex() % 4;
- no_pad_bytes = (remainder == 0)? 0 : 4 - remainder;
-
- for(int i=0; i < no_pad_bytes; i++)
- bytes.readByte();
-
- // Both cases have a field default_offset in common
- default_offset = bytes.readInt();
- }
-
- switch(opcode) {
- case TABLESWITCH:
- low = bytes.readInt();
- high = bytes.readInt();
-
- offset = bytes.getIndex() - 12 - no_pad_bytes - 1;
- default_offset += offset;
-
- buf.append("<TABLE BORDER=1><TR>");
-
- // Print switch indices in first row (and default)
- jump_table = new int[high - low + 1];
- for(int i=0; i < jump_table.length; i++) {
- jump_table[i] = offset + bytes.readInt();
-
- buf.append("<TH>" + (low + i) + "</TH>");
- }
- buf.append("<TH>default</TH></TR>\n<TR>");
-
- // Print target and default indices in second row
- for(int i=0; i < jump_table.length; i++)
- buf.append("<TD><A HREF=\"#code" + method_number + "@" +
- jump_table[i] + "\">" + jump_table[i] + "</A></TD>");
- buf.append("<TD><A HREF=\"#code" + method_number + "@" +
- default_offset + "\">" + default_offset + "</A></TD></TR>\n</TABLE>\n");
-
- break;
-
- /* Lookup switch has variable length arguments.
- */
- case LOOKUPSWITCH:
- int npairs = bytes.readInt();
- offset = bytes.getIndex() - 8 - no_pad_bytes - 1;
- jump_table = new int[npairs];
- default_offset += offset;
-
- buf.append("<TABLE BORDER=1><TR>");
-
- // Print switch indices in first row (and default)
- for(int i=0; i < npairs; i++) {
- int match = bytes.readInt();
-
- jump_table[i] = offset + bytes.readInt();
- buf.append("<TH>" + match + "</TH>");
- }
- buf.append("<TH>default</TH></TR>\n<TR>");
-
- // Print target and default indices in second row
- for(int i=0; i < npairs; i++)
- buf.append("<TD><A HREF=\"#code" + method_number + "@" +
- jump_table[i] + "\">" + jump_table[i] + "</A></TD>");
- buf.append("<TD><A HREF=\"#code" + method_number + "@" +
- default_offset + "\">" + default_offset + "</A></TD></TR>\n</TABLE>\n");
- break;
-
- /* Two address bytes + offset from start of byte stream form the
- * jump target.
- */
- case GOTO: case IFEQ: case IFGE: case IFGT:
- case IFLE: case IFLT:
- case IFNE: case IFNONNULL: case IFNULL: case IF_ACMPEQ:
- case IF_ACMPNE: case IF_ICMPEQ: case IF_ICMPGE: case IF_ICMPGT:
- case IF_ICMPLE: case IF_ICMPLT: case IF_ICMPNE: case JSR:
-
- index = (int)(bytes.getIndex() + bytes.readShort() - 1);
-
- buf.append("<A HREF=\"#code" + method_number + "@" + index + "\">" + index + "</A>");
- break;
-
- /* Same for 32-bit wide jumps
- */
- case GOTO_W: case JSR_W:
- int windex = bytes.getIndex() + bytes.readInt() - 1;
- buf.append("<A HREF=\"#code" + method_number + "@" + windex + "\">" +
- windex + "</A>");
- break;
-
- /* Index byte references local variable (register)
- */
- case ALOAD: case ASTORE: case DLOAD: case DSTORE: case FLOAD:
- case FSTORE: case ILOAD: case ISTORE: case LLOAD: case LSTORE:
- case RET:
- if(wide) {
- vindex = bytes.readShort();
- wide=false; // Clear flag
- }
- else
- vindex = bytes.readUnsignedByte();
-
- buf.append("%" + vindex);
- break;
-
- /*
- * Remember wide byte which is used to form a 16-bit address in the
- * following instruction. Relies on that the method is called again with
- * the following opcode.
- */
- case WIDE:
- wide = true;
- buf.append("(wide)");
- break;
-
- /* Array of basic type.
- */
- case NEWARRAY:
- buf.append("<FONT COLOR=\"#00FF00\">" + TYPE_NAMES[bytes.readByte()] + "</FONT>");
- break;
-
- /* Access object/class fields.
- */
- case GETFIELD: case GETSTATIC: case PUTFIELD: case PUTSTATIC:
- index = bytes.readShort();
- ConstantFieldref c1 = (ConstantFieldref)constant_pool.getConstant(index, CONSTANT_Fieldref);
-
- class_index = c1.getClassIndex();
- name = constant_pool.getConstantString(class_index, CONSTANT_Class);
- name = Utility.compactClassName(name, false);
-
- index = c1.getNameAndTypeIndex();
- String field_name = constant_pool.constantToString(index, CONSTANT_NameAndType);
-
- if(name.equals(class_name)) { // Local field
- buf.append("<A HREF=\"" + class_name + "_methods.html#field" + field_name +
- "\" TARGET=Methods>" + field_name + "</A>\n");
- }
- else
- buf.append(constant_html.referenceConstant(class_index) + "." + field_name);
-
- break;
-
- /* Operands are references to classes in constant pool
- */
- case CHECKCAST: case INSTANCEOF: case NEW:
- index = bytes.readShort();
- buf.append(constant_html.referenceConstant(index));
- break;
-
- /* Operands are references to methods in constant pool
- */
- case INVOKESPECIAL: case INVOKESTATIC: case INVOKEVIRTUAL: case INVOKEINTERFACE:
- int m_index = bytes.readShort();
- String str;
-
- if(opcode == INVOKEINTERFACE) { // Special treatment needed
- int nargs = bytes.readUnsignedByte(); // Redundant
- int reserved = bytes.readUnsignedByte(); // Reserved
-
- ConstantInterfaceMethodref c=(ConstantInterfaceMethodref)constant_pool.getConstant(m_index, CONSTANT_InterfaceMethodref);
-
- class_index = c.getClassIndex();
- str = constant_pool.constantToString(c);
- index = c.getNameAndTypeIndex();
- }
- else {
- ConstantMethodref c = (ConstantMethodref)constant_pool.getConstant(m_index, CONSTANT_Methodref);
- class_index = c.getClassIndex();
-
- str = constant_pool.constantToString(c);
- index = c.getNameAndTypeIndex();
- }
-
- name = Class2HTML.referenceClass(class_index);
- str = Class2HTML.toHTML(constant_pool.constantToString(constant_pool.getConstant(index, CONSTANT_NameAndType)));
-
- // Get signature, i.e., types
- ConstantNameAndType c2 = (ConstantNameAndType)constant_pool.
- getConstant(index, CONSTANT_NameAndType);
- signature = constant_pool.constantToString(c2.getSignatureIndex(),
- CONSTANT_Utf8);
- String[] args = Utility.methodSignatureArgumentTypes(signature, false);
- String type = Utility.methodSignatureReturnType(signature, false);
-
- buf.append(name + ".<A HREF=\"" + class_name + "_cp.html#cp" + m_index +
- "\" TARGET=ConstantPool>" + str + "</A>" + "(");
-
- // List arguments
- for(int i=0; i < args.length; i++) {
- buf.append(Class2HTML.referenceType(args[i]));
-
- if(i < args.length - 1)
- buf.append(", ");
- }
- // Attach return type
- buf.append("):" + Class2HTML.referenceType(type));
-
- break;
-
- /* Operands are references to items in constant pool
- */
- case LDC_W: case LDC2_W:
- index = bytes.readShort();
-
- buf.append("<A HREF=\"" + class_name + "_cp.html#cp" + index +
- "\" TARGET=\"ConstantPool\">" +
- Class2HTML.toHTML(constant_pool.constantToString(index,
- constant_pool.
- getConstant(index).getTag()))+
- "</a>");
- break;
-
- case LDC:
- index = bytes.readUnsignedByte();
- buf.append("<A HREF=\"" + class_name + "_cp.html#cp" + index +
- "\" TARGET=\"ConstantPool\">" +
- Class2HTML.toHTML(constant_pool.constantToString(index,
- constant_pool.
- getConstant(index).getTag()))+
- "</a>");
- break;
-
- /* Array of references.
- */
- case ANEWARRAY:
- index = bytes.readShort();
-
- buf.append(constant_html.referenceConstant(index));
- break;
-
- /* Multidimensional array of references.
- */
- case MULTIANEWARRAY:
- index = bytes.readShort();
- int dimensions = bytes.readByte();
- buf.append(constant_html.referenceConstant(index) + ":" + dimensions + "-dimensional");
- break;
-
- /* Increment local variable.
- */
- case IINC:
- if(wide) {
- vindex = bytes.readShort();
- constant = bytes.readShort();
- wide = false;
- }
- else {
- vindex = bytes.readUnsignedByte();
- constant = bytes.readByte();
- }
- buf.append("%" + vindex + " " + constant);
- break;
-
- default:
- if(NO_OF_OPERANDS[opcode] > 0) {
- for(int i=0; i < TYPE_OF_OPERANDS[opcode].length; i++) {
- switch(TYPE_OF_OPERANDS[opcode][i]) {
- case T_BYTE:
- buf.append(bytes.readUnsignedByte());
- break;
-
- case T_SHORT: // Either branch or index
- buf.append(bytes.readShort());
- break;
-
- case T_INT:
- buf.append(bytes.readInt());
- break;
-
- default: // Never reached
- System.err.println("Unreachable default case reached!");
- System.exit(-1);
- }
- buf.append("&nbsp;");
- }
- }
- }
-
- buf.append("</TD>");
- return buf.toString();
- }
-
- /**
- * Find all target addresses in code, so that they can be marked
- * with &lt;A NAME = ...&gt;. Target addresses are kept in an BitSet object.
- */
- private final void findGotos(ByteSequence bytes, Method method, Code code)
- throws IOException
- {
- int index;
- goto_set = new BitSet(bytes.available());
- int opcode;
-
- /* First get Code attribute from method and the exceptions handled
- * (try .. catch) in this method. We only need the line number here.
- */
-
- if(code != null) {
- CodeException[] ce = code.getExceptionTable();
- int len = ce.length;
-
- for(int i=0; i < len; i++) {
- goto_set.set(ce[i].getStartPC());
- goto_set.set(ce[i].getEndPC());
- goto_set.set(ce[i].getHandlerPC());
- }
-
- // Look for local variables and their range
- Attribute[] attributes = code.getAttributes();
- for(int i=0; i < attributes.length; i++) {
- if(attributes[i].getTag() == ATTR_LOCAL_VARIABLE_TABLE) {
- LocalVariable[] vars = ((LocalVariableTable)attributes[i]).getLocalVariableTable();
-
- for(int j=0; j < vars.length; j++) {
- int start = vars[j].getStartPC();
- int end = (int)(start + vars[j].getLength());
- goto_set.set(start);
- goto_set.set(end);
- }
- break;
- }
- }
- }
-
- // Get target addresses from GOTO, JSR, TABLESWITCH, etc.
- for(int i=0; bytes.available() > 0; i++) {
- opcode = bytes.readUnsignedByte();
- //System.out.println(OPCODE_NAMES[opcode]);
- switch(opcode) {
- case TABLESWITCH: case LOOKUPSWITCH:
- //bytes.readByte(); // Skip already read byte
-
- int remainder = bytes.getIndex() % 4;
- int no_pad_bytes = (remainder == 0)? 0 : 4 - remainder;
- int default_offset, offset;
-
- for(int j=0; j < no_pad_bytes; j++)
- bytes.readByte();
-
- // Both cases have a field default_offset in common
- default_offset = bytes.readInt();
-
- if(opcode == TABLESWITCH) {
- int low = bytes.readInt();
- int high = bytes.readInt();
-
- offset = bytes.getIndex() - 12 - no_pad_bytes - 1;
- default_offset += offset;
- goto_set.set(default_offset);
-
- for(int j=0; j < (high - low + 1); j++) {
- index = offset + bytes.readInt();
- goto_set.set(index);
- }
- }
- else { // LOOKUPSWITCH
- int npairs = bytes.readInt();
-
- offset = bytes.getIndex() - 8 - no_pad_bytes - 1;
- default_offset += offset;
- goto_set.set(default_offset);
-
- for(int j=0; j < npairs; j++) {
- int match = bytes.readInt();
-
- index = offset + bytes.readInt();
- goto_set.set(index);
- }
- }
- break;
-
- case GOTO: case IFEQ: case IFGE: case IFGT:
- case IFLE: case IFLT:
- case IFNE: case IFNONNULL: case IFNULL: case IF_ACMPEQ:
- case IF_ACMPNE: case IF_ICMPEQ: case IF_ICMPGE: case IF_ICMPGT:
- case IF_ICMPLE: case IF_ICMPLT: case IF_ICMPNE: case JSR:
- //bytes.readByte(); // Skip already read byte
- index = bytes.getIndex() + bytes.readShort() - 1;
-
- goto_set.set(index);
- break;
-
- case GOTO_W: case JSR_W:
- //bytes.readByte(); // Skip already read byte
- index = bytes.getIndex() + bytes.readInt() - 1;
- goto_set.set(index);
- break;
-
- default:
- bytes.unreadByte();
- codeToHTML(bytes, 0); // Ignore output
- }
- }
- }
-
- /**
- * Write a single method with the byte code associated with it.
- */
- private void writeMethod(Method method, int method_number)
- throws IOException
- {
- // Get raw signature
- String signature = method.getSignature();
- // Get array of strings containing the argument types
- String[] args = Utility.methodSignatureArgumentTypes(signature, false);
- // Get return type string
- String type = Utility.methodSignatureReturnType(signature, false);
- // Get method name
- String name = method.getName();
- String html_name = Class2HTML.toHTML(name);
- // Get method's access flags
- String access = Utility.accessToString(method.getAccessFlags());
- access = Utility.replace(access, " ", "&nbsp;");
- // Get the method's attributes, the Code Attribute in particular
- Attribute[] attributes= method.getAttributes();
-
- file.print("<P><B><FONT COLOR=\"#FF0000\">" + access + "</FONT>&nbsp;" +
- "<A NAME=method" + method_number + ">" + Class2HTML.referenceType(type) +
- "</A>&nbsp<A HREF=\"" + class_name + "_methods.html#method" + method_number +
- "\" TARGET=Methods>" + html_name + "</A>(");
-
- for(int i=0; i < args.length; i++) {
- file.print(Class2HTML.referenceType(args[i]));
- if(i < args.length - 1)
- file.print(",&nbsp;");
- }
-
- file.println(")</B></P>");
-
- Code c=null;
- byte[] code=null;
-
- if(attributes.length > 0) {
- file.print("<H4>Attributes</H4><UL>\n");
- for(int i=0; i < attributes.length; i++) {
- byte tag = attributes[i].getTag();
-
- if(tag != ATTR_UNKNOWN)
- file.print("<LI><A HREF=\"" + class_name + "_attributes.html#method" + method_number + "@" + i +
- "\" TARGET=Attributes>" + ATTRIBUTE_NAMES[tag] + "</A></LI>\n");
- else
- file.print("<LI>" + attributes[i] + "</LI>");
-
- if(tag == ATTR_CODE) {
- c = (Code)attributes[i];
- Attribute[] attributes2 = c.getAttributes();
- code = c.getCode();
-
- file.print("<UL>");
- for(int j=0; j < attributes2.length; j++) {
- tag = attributes2[j].getTag();
- file.print("<LI><A HREF=\"" + class_name + "_attributes.html#" +
- "method" + method_number + "@" + i + "@" + j + "\" TARGET=Attributes>" +
- ATTRIBUTE_NAMES[tag] + "</A></LI>\n");
-
- }
- file.print("</UL>");
- }
- }
- file.println("</UL>");
- }
-
- if(code != null) { // No code, an abstract method, e.g.
- //System.out.println(name + "\n" + Utility.codeToString(code, constant_pool, 0, -1));
-
- // Print the byte code
- ByteSequence stream = new ByteSequence(code);
- stream.mark(stream.available());
- findGotos(stream, method, c);
- stream.reset();
-
- file.println("<TABLE BORDER=0><TR><TH ALIGN=LEFT>Byte<BR>offset</TH>" +
- "<TH ALIGN=LEFT>Instruction</TH><TH ALIGN=LEFT>Argument</TH>");
-
- for(int i=0; stream.available() > 0; i++) {
- int offset = stream.getIndex();
- String str = codeToHTML(stream, method_number);
- String anchor = "";
-
- /* Set an anchor mark if this line is targetted by a goto, jsr, etc.
- * Defining an anchor for every line is very inefficient!
- */
- if(goto_set.get(offset))
- anchor = "<A NAME=code" + method_number + "@" + offset + "></A>";
-
- String anchor2;
- if(stream.getIndex() == code.length) // last loop
- anchor2 = "<A NAME=code" + method_number + "@" + code.length + ">" + offset + "</A>";
- else
- anchor2 = "" + offset;
-
- file.println("<TR VALIGN=TOP><TD>" + anchor2 + "</TD><TD>" + anchor + str + "</TR>");
- }
-
- // Mark last line, may be targetted from Attributes window
- file.println("<TR><TD> </A></TD></TR>");
- file.println("</TABLE>");
- }
-
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/util/ConstantHTML.java b/src/com/sun/org/apache/bcel/internal/util/ConstantHTML.java
deleted file mode 100644
index 52f3591..0000000
--- a/src/com/sun/org/apache/bcel/internal/util/ConstantHTML.java
+++ /dev/null
@@ -1,265 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-
-package com.sun.org.apache.bcel.internal.util;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.classfile.*;
-import java.io.*;
-
-/**
- * Convert constant pool into HTML file.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- *
- */
-final class ConstantHTML implements com.sun.org.apache.bcel.internal.Constants {
- private String class_name; // name of current class
- private String class_package; // name of package
- private ConstantPool constant_pool; // reference to constant pool
- private PrintWriter file; // file to write to
- private String[] constant_ref; // String to return for cp[i]
- private Constant[] constants; // The constants in the cp
- private Method[] methods;
-
- ConstantHTML(String dir, String class_name, String class_package, Method[] methods,
- ConstantPool constant_pool) throws IOException
- {
- this.class_name = class_name;
- this.class_package = class_package;
- this.constant_pool = constant_pool;
- this.methods = methods;
- constants = constant_pool.getConstantPool();
- file = new PrintWriter(new FileOutputStream(dir + class_name + "_cp.html"));
- constant_ref = new String[constants.length];
- constant_ref[0] = "&lt;unknown&gt;";
-
- file.println("<HTML><BODY BGCOLOR=\"#C0C0C0\"><TABLE BORDER=0>");
-
- // Loop through constants, constants[0] is reserved
- for(int i=1; i < constants.length; i++) {
- if(i % 2 == 0)
- file.print("<TR BGCOLOR=\"#C0C0C0\"><TD>");
- else
- file.print("<TR BGCOLOR=\"#A0A0A0\"><TD>");
-
- if(constants[i] != null)
- writeConstant(i);
-
- file.print("</TD></TR>\n");
- }
-
- file.println("</TABLE></BODY></HTML>");
- file.close();
- }
-
- String referenceConstant(int index) {
- return constant_ref[index];
- }
-
- private void writeConstant(int index) {
- byte tag = constants[index].getTag();
- int class_index, name_index;
- String ref;
-
- // The header is always the same
- file.println("<H4> <A NAME=cp" + index + ">" + index + "</A> " + CONSTANT_NAMES[tag] + "</H4>");
-
- /* For every constant type get the needed parameters and print them appropiately
- */
- switch(tag) {
- case CONSTANT_InterfaceMethodref:
- case CONSTANT_Methodref:
- // Get class_index and name_and_type_index, depending on type
- if(tag == CONSTANT_Methodref) {
- ConstantMethodref c = (ConstantMethodref)constant_pool.getConstant(index, CONSTANT_Methodref);
- class_index = c.getClassIndex();
- name_index = c.getNameAndTypeIndex();
- }
- else {
- ConstantInterfaceMethodref c1 = (ConstantInterfaceMethodref)constant_pool.getConstant(index, CONSTANT_InterfaceMethodref);
- class_index = c1.getClassIndex();
- name_index = c1.getNameAndTypeIndex();
- }
-
- // Get method name and its class
- String method_name = constant_pool.constantToString(name_index, CONSTANT_NameAndType);
- String html_method_name = Class2HTML.toHTML(method_name);
-
- // Partially compacted class name, i.e., / -> .
- String method_class = constant_pool.constantToString(class_index, CONSTANT_Class);
- String short_method_class = Utility.compactClassName(method_class); // I.e., remove java.lang.
- short_method_class = Utility.compactClassName(method_class); // I.e., remove java.lang.
- short_method_class = Utility.compactClassName(short_method_class, class_package + ".", true); // Remove class package prefix
-
- // Get method signature
- ConstantNameAndType c2 = (ConstantNameAndType)constant_pool.getConstant(name_index, CONSTANT_NameAndType);
- String signature = constant_pool.constantToString(c2.getSignatureIndex(), CONSTANT_Utf8);
- // Get array of strings containing the argument types
- String[] args = Utility.methodSignatureArgumentTypes(signature, false);
-
- // Get return type string
- String type = Utility.methodSignatureReturnType(signature, false);
- String ret_type = Class2HTML.referenceType(type);
-
- StringBuffer buf = new StringBuffer("(");
- for(int i=0; i < args.length; i++) {
- buf.append(Class2HTML.referenceType(args[i]));
- if(i < args.length - 1)
- buf.append(",&nbsp;");
- }
- buf.append(")");
-
- String arg_types = buf.toString();
-
- if(method_class.equals(class_name)) // Method is local to class
- ref = "<A HREF=\"" + class_name + "_code.html#method" + getMethodNumber(method_name + signature) +
- "\" TARGET=Code>" + html_method_name + "</A>";
- else
- ref = "<A HREF=\"" + method_class + ".html" + "\" TARGET=_top>" + short_method_class +
- "</A>." + html_method_name;
-
- constant_ref[index] = ret_type + "&nbsp;<A HREF=\"" + class_name + "_cp.html#cp" + class_index +
- "\" TARGET=Constants>" +
- short_method_class + "</A>.<A HREF=\"" + class_name + "_cp.html#cp" +
- index + "\" TARGET=ConstantPool>" + html_method_name + "</A>&nbsp;" + arg_types;
-
- file.println("<P><TT>" + ret_type + "&nbsp;" + ref + arg_types + "&nbsp;</TT>\n<UL>" +
- "<LI><A HREF=\"#cp" + class_index + "\">Class index(" + class_index + ")</A>\n" +
- "<LI><A HREF=\"#cp" + name_index + "\">NameAndType index(" + name_index + ")</A></UL>");
- break;
-
- case CONSTANT_Fieldref:
- // Get class_index and name_and_type_index
- ConstantFieldref c3 = (ConstantFieldref)constant_pool.getConstant(index, CONSTANT_Fieldref);
- class_index = c3.getClassIndex();
- name_index = c3.getNameAndTypeIndex();
-
- // Get method name and its class (compacted)
- String field_class = constant_pool.constantToString(class_index, CONSTANT_Class);
- String short_field_class = Utility.compactClassName(field_class); // I.e., remove java.lang.
- short_field_class = Utility.compactClassName(short_field_class, class_package + ".", true); // Remove class package prefix
-
- String field_name = constant_pool.constantToString(name_index, CONSTANT_NameAndType);
-
- if(field_class.equals(class_name)) // Field is local to class
- ref = "<A HREF=\"" + field_class + "_methods.html#field" +
- field_name + "\" TARGET=Methods>" + field_name + "</A>";
- else
- ref = "<A HREF=\"" + field_class + ".html\" TARGET=_top>" +
- short_field_class + "</A>." + field_name + "\n";
-
- constant_ref[index] = "<A HREF=\"" + class_name + "_cp.html#cp" + class_index + "\" TARGET=Constants>" +
- short_field_class + "</A>.<A HREF=\"" + class_name + "_cp.html#cp" +
- index + "\" TARGET=ConstantPool>" + field_name + "</A>";
-
- file.println("<P><TT>" + ref + "</TT><BR>\n" + "<UL>" +
- "<LI><A HREF=\"#cp" + class_index + "\">Class(" + class_index + ")</A><BR>\n" +
- "<LI><A HREF=\"#cp" + name_index + "\">NameAndType(" + name_index + ")</A></UL>");
- break;
-
- case CONSTANT_Class:
- ConstantClass c4 = (ConstantClass)constant_pool.getConstant(index, CONSTANT_Class);
- name_index = c4.getNameIndex();
- String class_name2 = constant_pool.constantToString(index, tag); // / -> .
- String short_class_name = Utility.compactClassName(class_name2); // I.e., remove java.lang.
- short_class_name = Utility.compactClassName(short_class_name, class_package + ".", true); // Remove class package prefix
-
- ref = "<A HREF=\"" + class_name2 + ".html\" TARGET=_top>" + short_class_name + "</A>";
- constant_ref[index] = "<A HREF=\"" + class_name + "_cp.html#cp" + index +
- "\" TARGET=ConstantPool>" + short_class_name + "</A>";
-
- file.println("<P><TT>" + ref + "</TT><UL>" +
- "<LI><A HREF=\"#cp" + name_index + "\">Name index(" + name_index + ")</A></UL>\n");
- break;
-
- case CONSTANT_String:
- ConstantString c5 = (ConstantString)constant_pool.getConstant(index, CONSTANT_String);
- name_index = c5.getStringIndex();
-
- String str = Class2HTML.toHTML(constant_pool.constantToString(index, tag));
-
- file.println("<P><TT>" + str + "</TT><UL>" +
- "<LI><A HREF=\"#cp" + name_index + "\">Name index(" + name_index + ")</A></UL>\n");
- break;
-
- case CONSTANT_NameAndType:
- ConstantNameAndType c6 = (ConstantNameAndType)constant_pool.getConstant(index, CONSTANT_NameAndType);
- name_index = c6.getNameIndex();
- int signature_index = c6.getSignatureIndex();
-
- file.println("<P><TT>" + Class2HTML.toHTML(constant_pool.constantToString(index, tag)) + "</TT><UL>" +
- "<LI><A HREF=\"#cp" + name_index + "\">Name index(" + name_index + ")</A>\n" +
- "<LI><A HREF=\"#cp" + signature_index + "\">Signature index(" +
- signature_index + ")</A></UL>\n");
- break;
-
- default:
- file.println("<P><TT>" + Class2HTML.toHTML(constant_pool.constantToString(index, tag)) + "</TT>\n");
- } // switch
- }
-
- private final int getMethodNumber(String str) {
- for(int i=0; i < methods.length; i++) {
- String cmp = methods[i].getName() + methods[i].getSignature();
- if(cmp.equals(str))
- return i;
- }
- return -1;
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/util/InstructionFinder.java b/src/com/sun/org/apache/bcel/internal/util/InstructionFinder.java
deleted file mode 100644
index 162afd1..0000000
--- a/src/com/sun/org/apache/bcel/internal/util/InstructionFinder.java
+++ /dev/null
@@ -1,443 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.util;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import java.util.*;
-import com.sun.org.apache.bcel.internal.Constants;
-import com.sun.org.apache.bcel.internal.generic.*;
-import com.sun.org.apache.regexp.internal.*;
-
-/**
- * InstructionFinder is a tool to search for given instructions patterns,
- * i.e., match sequences of instructions in an instruction list via
- * regular expressions. This can be used, e.g., in order to implement
- * a peep hole optimizer that looks for code patterns and replaces
- * them with faster equivalents.
- *
- * <p>This class internally uses the <a href="http://jakarta.apache.org/regexp/">
- * Regexp</a> package to search for regular expressions.
- *
- * A typical application would look like this:
-<pre>
- InstructionFinder f = new InstructionFinder(il);
- String pat = "IfInstruction ICONST_0 GOTO ICONST_1 NOP (IFEQ|IFNE)";
-
- for(Iterator i = f.search(pat, constraint); i.hasNext(); ) {
- InstructionHandle[] match = (InstructionHandle[])i.next();
- ...
- il.delete(match[1], match[5]);
- ...
- }
-</pre>
- * @author <A HREF="http://www.berlin.de/~markus.dahm/">M. Dahm</A>
- * @see Instruction
- * @see InstructionList
- */
-public class InstructionFinder {
- private static final int OFFSET = 32767; // char + OFFSET is outside of LATIN-1
- private static final int NO_OPCODES = 256; // Potential number, some are not used
-
- private static final HashMap map = new HashMap(); // Map<String,Pattern>
-
- private InstructionList il;
- private String il_string; // instruction list as string
- private InstructionHandle[] handles; // map instruction list to array
-
- /**
- * @param il instruction list to search for given patterns
- */
- public InstructionFinder(InstructionList il) {
- this.il = il;
- reread();
- }
-
- /**
- * Reread the instruction list, e.g., after you've altered the list upon a match.
- */
- public final void reread() {
- int size = il.getLength();
- char[] buf = new char[size]; // Create a string with length equal to il length
- handles = il.getInstructionHandles();
-
- // Map opcodes to characters
- for(int i=0; i < size; i++)
- buf[i] = makeChar(handles[i].getInstruction().getOpcode());
-
- il_string = new String(buf);
- }
-
- /**
- * Map symbolic instruction names like "getfield" to a single character.
- *
- * @param pattern instruction pattern in lower case
- * @return encoded string for a pattern such as "BranchInstruction".
- */
- private static final String mapName(String pattern) {
- String result = (String)map.get(pattern);
-
- if(result != null)
- return result;
-
- for(short i=0; i < NO_OPCODES; i++)
- if(pattern.equals(Constants.OPCODE_NAMES[i]))
- return "" + makeChar(i);
-
- throw new RuntimeException("Instruction unknown: " + pattern);
- }
-
- /**
- * Replace symbolic names of instructions with the appropiate character and remove
- * all white space from string. Meta characters such as +, * are ignored.
- *
- * @param pattern The pattern to compile
- * @return translated regular expression string
- */
- private static final String compilePattern(String pattern) {
- String lower = pattern.toLowerCase();
- StringBuffer buf = new StringBuffer();
- int size = pattern.length();
-
- for(int i=0; i < size; i++) {
- char ch = lower.charAt(i);
-
- if(Character.isLetterOrDigit(ch)) {
- StringBuffer name = new StringBuffer();
-
- while((Character.isLetterOrDigit(ch) || ch == '_') && i < size) {
- name.append(ch);
-
- if(++i < size)
- ch = lower.charAt(i);
- else
- break;
- }
-
- i--;
-
- buf.append(mapName(name.toString()));
- } else if(!Character.isWhitespace(ch))
- buf.append(ch);
- }
-
- return buf.toString();
- }
-
- /**
- * @return the matched piece of code as an array of instruction (handles)
- */
- private InstructionHandle[] getMatch(int matched_from, int match_length) {
- InstructionHandle[] match = new InstructionHandle[match_length];
- System.arraycopy(handles, matched_from, match, 0, match_length);
-
- return match;
- }
-
- /**
- * Search for the given pattern in the instruction list. You can search for any valid
- * opcode via its symbolic name, e.g. "istore". You can also use a super class or
- * an interface name to match a whole set of instructions, e.g. "BranchInstruction" or
- * "LoadInstruction". "istore" is also an alias for all "istore_x" instructions. Additional
- * aliases are "if" for "ifxx", "if_icmp" for "if_icmpxx", "if_acmp" for "if_acmpxx".
- *
- * Consecutive instruction names must be separated by white space which will be removed
- * during the compilation of the pattern.
- *
- * For the rest the usual pattern matching rules for regular expressions apply.<P>
- * Example pattern:
- * <pre>
- search("BranchInstruction NOP ((IfInstruction|GOTO)+ ISTORE Instruction)*");
- * </pre>
- *
- * <p>If you alter the instruction list upon a match such that other
- * matching areas are affected, you should call reread() to update
- * the finder and call search() again, because the matches are cached.
- *
- * @param pattern the instruction pattern to search for, where case is ignored
- * @param from where to start the search in the instruction list
- * @param constraint optional CodeConstraint to check the found code pattern for
- * user-defined constraints
- * @return iterator of matches where e.nextElement() returns an array of instruction handles
- * describing the matched area
- */
- public final Iterator search(String pattern, InstructionHandle from,
- CodeConstraint constraint)
- {
- String search = compilePattern(pattern);
- int start = -1;
-
- for(int i=0; i < handles.length; i++) {
- if(handles[i] == from) {
- start = i; // Where to start search from (index)
- break;
- }
- }
-
- if(start == -1)
- throw new ClassGenException("Instruction handle " + from +
- " not found in instruction list.");
- try {
- RE regex = new RE(search);
- ArrayList matches = new ArrayList();
-
- while(start < il_string.length() && regex.match(il_string, start)) {
- int startExpr = regex.getParenStart(0);
- int endExpr = regex.getParenEnd(0);
- int lenExpr = regex.getParenLength(0);
-
- InstructionHandle[] match = getMatch(startExpr, lenExpr);
-
- if((constraint == null) || constraint.checkCode(match))
- matches.add(match);
- start = endExpr;
- }
-
- return matches.iterator();
- } catch(RESyntaxException e) {
- System.err.println(e);
- }
-
- return null;
- }
-
- /**
- * Start search beginning from the start of the given instruction list.
- *
- * @param pattern the instruction pattern to search for, where case is ignored
- * @return iterator of matches where e.nextElement()
- * returns an array of instruction handles describing the matched
- * area
- */
- public final Iterator search(String pattern) {
- return search(pattern, il.getStart(), null);
- }
-
- /**
- * Start search beginning from `from'.
- *
- * @param pattern the instruction pattern to search for, where case is ignored
- * @param from where to start the search in the instruction list
- * @return iterator of matches where e.nextElement() returns an array of instruction handles
- * describing the matched area
- */
- public final Iterator search(String pattern, InstructionHandle from) {
- return search(pattern, from, null);
- }
-
- /**
- * Start search beginning from the start of the given instruction list.
- * Check found matches with the constraint object.
- *
- * @param pattern the instruction pattern to search for, case is ignored
- * @param constraint constraints to be checked on matching code
- * @return instruction handle or `null' if the match failed
- */
- public final Iterator search(String pattern, CodeConstraint constraint) {
- return search(pattern, il.getStart(), constraint);
- }
-
- /**
- * Convert opcode number to char.
- */
- private static final char makeChar(short opcode) {
- return (char)(opcode + OFFSET);
- }
-
- /**
- * @return the inquired instruction list
- */
- public final InstructionList getInstructionList() { return il; }
-
- /**
- * Code patterns found may be checked using an additional
- * user-defined constraint object whether they really match the needed criterion.
- * I.e., check constraints that can not expressed with regular expressions.
- *
- */
- public interface CodeConstraint {
- /**
- * @param match array of instructions matching the requested pattern
- * @return true if the matched area is really useful
- */
- public boolean checkCode(InstructionHandle[] match);
- }
-
- // Initialize pattern map
-
- static {
- map.put("arithmeticinstruction", "(irem|lrem|iand|ior|ineg|isub|lneg|fneg|fmul|ldiv|fadd|lxor|frem|idiv|land|ixor|ishr|fsub|lshl|fdiv|iadd|lor|dmul|lsub|ishl|imul|lmul|lushr|dneg|iushr|lshr|ddiv|drem|dadd|ladd|dsub)");
- map.put("invokeinstruction", "(invokevirtual|invokeinterface|invokestatic|invokespecial)");
- map.put("arrayinstruction", "(baload|aastore|saload|caload|fastore|lastore|iaload|castore|iastore|aaload|bastore|sastore|faload|laload|daload|dastore)");
- map.put("gotoinstruction", "(goto|goto_w)");
- map.put("conversioninstruction", "(d2l|l2d|i2s|d2i|l2i|i2b|l2f|d2f|f2i|i2d|i2l|f2d|i2c|f2l|i2f)");
- map.put("localvariableinstruction", "(fstore|iinc|lload|dstore|dload|iload|aload|astore|istore|fload|lstore)");
- map.put("loadinstruction", "(fload|dload|lload|iload|aload)");
- map.put("fieldinstruction", "(getfield|putstatic|getstatic|putfield)");
- map.put("cpinstruction", "(ldc2_w|invokeinterface|multianewarray|putstatic|instanceof|getstatic|checkcast|getfield|invokespecial|ldc_w|invokestatic|invokevirtual|putfield|ldc|new|anewarray)");
- map.put("stackinstruction", "(dup2|swap|dup2_x2|pop|pop2|dup|dup2_x1|dup_x2|dup_x1)");
- map.put("branchinstruction", "(ifle|if_acmpne|if_icmpeq|if_acmpeq|ifnonnull|goto_w|iflt|ifnull|if_icmpne|tableswitch|if_icmple|ifeq|if_icmplt|jsr_w|if_icmpgt|ifgt|jsr|goto|ifne|ifge|lookupswitch|if_icmpge)");
- map.put("returninstruction", "(lreturn|ireturn|freturn|dreturn|areturn|return)");
- map.put("storeinstruction", "(istore|fstore|dstore|astore|lstore)");
- map.put("select", "(tableswitch|lookupswitch)");
- map.put("ifinstruction", "(ifeq|ifgt|if_icmpne|if_icmpeq|ifge|ifnull|ifne|if_icmple|if_icmpge|if_acmpeq|if_icmplt|if_acmpne|ifnonnull|iflt|if_icmpgt|ifle)");
- map.put("jsrinstruction", "(jsr|jsr_w)");
- map.put("variablelengthinstruction", "(tableswitch|jsr|goto|lookupswitch)");
- map.put("unconditionalbranch", "(goto|jsr|jsr_w|athrow|goto_w)");
- map.put("constantpushinstruction", "(dconst|bipush|sipush|fconst|iconst|lconst)");
- map.put("typedinstruction", "(imul|lsub|aload|fload|lor|new|aaload|fcmpg|iand|iaload|lrem|idiv|d2l|isub|dcmpg|dastore|ret|f2d|f2i|drem|iinc|i2c|checkcast|frem|lreturn|astore|lushr|daload|dneg|fastore|istore|lshl|ldiv|lstore|areturn|ishr|ldc_w|invokeinterface|aastore|lxor|ishl|l2d|i2f|return|faload|sipush|iushr|caload|instanceof|invokespecial|putfield|fmul|ireturn|laload|d2f|lneg|ixor|i2l|fdiv|lastore|multianewarray|i2b|getstatic|i2d|putstatic|fcmpl|saload|ladd|irem|dload|jsr_w|dconst|dcmpl|fsub|freturn|ldc|aconst_null|castore|lmul|ldc2_w|dadd|iconst|f2l|ddiv|dstore|land|jsr|anewarray|dmul|bipush|dsub|sastore|d2i|i2s|lshr|iadd|l2i|lload|bastore|fstore|fneg|iload|fadd|baload|fconst|ior|ineg|dreturn|l2f|lconst|getfield|invokevirtual|invokestatic|iastore)");
- map.put("popinstruction", "(fstore|dstore|pop|pop2|astore|putstatic|istore|lstore)");
- map.put("allocationinstruction", "(multianewarray|new|anewarray|newarray)");
- map.put("indexedinstruction", "(lload|lstore|fload|ldc2_w|invokeinterface|multianewarray|astore|dload|putstatic|instanceof|getstatic|checkcast|getfield|invokespecial|dstore|istore|iinc|ldc_w|ret|fstore|invokestatic|iload|putfield|invokevirtual|ldc|new|aload|anewarray)");
- map.put("pushinstruction", "(dup|lload|dup2|bipush|fload|ldc2_w|sipush|lconst|fconst|dload|getstatic|ldc_w|aconst_null|dconst|iload|ldc|iconst|aload)");
- map.put("stackproducer", "(imul|lsub|aload|fload|lor|new|aaload|fcmpg|iand|iaload|lrem|idiv|d2l|isub|dcmpg|dup|f2d|f2i|drem|i2c|checkcast|frem|lushr|daload|dneg|lshl|ldiv|ishr|ldc_w|invokeinterface|lxor|ishl|l2d|i2f|faload|sipush|iushr|caload|instanceof|invokespecial|fmul|laload|d2f|lneg|ixor|i2l|fdiv|getstatic|i2b|swap|i2d|dup2|fcmpl|saload|ladd|irem|dload|jsr_w|dconst|dcmpl|fsub|ldc|arraylength|aconst_null|tableswitch|lmul|ldc2_w|iconst|dadd|f2l|ddiv|land|jsr|anewarray|dmul|bipush|dsub|d2i|newarray|i2s|lshr|iadd|lload|l2i|fneg|iload|fadd|baload|fconst|lookupswitch|ior|ineg|lconst|l2f|getfield|invokevirtual|invokestatic)");
- map.put("stackconsumer", "(imul|lsub|lor|iflt|fcmpg|if_icmpgt|iand|ifeq|if_icmplt|lrem|ifnonnull|idiv|d2l|isub|dcmpg|dastore|if_icmpeq|f2d|f2i|drem|i2c|checkcast|frem|lreturn|astore|lushr|pop2|monitorexit|dneg|fastore|istore|lshl|ldiv|lstore|areturn|if_icmpge|ishr|monitorenter|invokeinterface|aastore|lxor|ishl|l2d|i2f|return|iushr|instanceof|invokespecial|fmul|ireturn|d2f|lneg|ixor|pop|i2l|ifnull|fdiv|lastore|i2b|if_acmpeq|ifge|swap|i2d|putstatic|fcmpl|ladd|irem|dcmpl|fsub|freturn|ifgt|castore|lmul|dadd|f2l|ddiv|dstore|land|if_icmpne|if_acmpne|dmul|dsub|sastore|ifle|d2i|i2s|lshr|iadd|l2i|bastore|fstore|fneg|fadd|ior|ineg|ifne|dreturn|l2f|if_icmple|getfield|invokevirtual|invokestatic|iastore)");
- map.put("exceptionthrower", "(irem|lrem|laload|putstatic|baload|dastore|areturn|getstatic|ldiv|anewarray|iastore|castore|idiv|saload|lastore|fastore|putfield|lreturn|caload|getfield|return|aastore|freturn|newarray|instanceof|multianewarray|athrow|faload|iaload|aaload|dreturn|monitorenter|checkcast|bastore|arraylength|new|invokevirtual|sastore|ldc_w|ireturn|invokespecial|monitorexit|invokeinterface|ldc|invokestatic|daload)");
- map.put("loadclass", "(multianewarray|invokeinterface|instanceof|invokespecial|putfield|checkcast|putstatic|invokevirtual|new|getstatic|invokestatic|getfield|anewarray)");
- map.put("instructiontargeter", "(ifle|if_acmpne|if_icmpeq|if_acmpeq|ifnonnull|goto_w|iflt|ifnull|if_icmpne|tableswitch|if_icmple|ifeq|if_icmplt|jsr_w|if_icmpgt|ifgt|jsr|goto|ifne|ifge|lookupswitch|if_icmpge)");
-
- // Some aliases
- map.put("if_icmp", "(if_icmpne|if_icmpeq|if_icmple|if_icmpge|if_icmplt|if_icmpgt)");
- map.put("if_acmp", "(if_acmpeq|if_acmpne)");
- map.put("if", "(ifeq|ifne|iflt|ifge|ifgt|ifle)");
-
- // Precompile some aliases first
- map.put("iconst", precompile(Constants.ICONST_0, Constants.ICONST_5, Constants.ICONST_M1));
- map.put("lconst", new String(new char[] { '(', makeChar(Constants.LCONST_0), '|',
- makeChar(Constants.LCONST_1), ')' }));
- map.put("dconst", new String(new char[] { '(', makeChar(Constants.DCONST_0), '|',
- makeChar(Constants.DCONST_1), ')' }));
- map.put("fconst", new String(new char[] { '(', makeChar(Constants.FCONST_0), '|',
- makeChar(Constants.FCONST_1), ')' }));
-
- map.put("iload", precompile(Constants.ILOAD_0, Constants.ILOAD_3, Constants.ILOAD));
- map.put("dload", precompile(Constants.DLOAD_0, Constants.DLOAD_3, Constants.DLOAD));
- map.put("fload", precompile(Constants.FLOAD_0, Constants.FLOAD_3, Constants.FLOAD));
- map.put("aload", precompile(Constants.ALOAD_0, Constants.ALOAD_3, Constants.ALOAD));
-
- map.put("istore", precompile(Constants.ISTORE_0, Constants.ISTORE_3, Constants.ISTORE));
- map.put("dstore", precompile(Constants.DSTORE_0, Constants.DSTORE_3, Constants.DSTORE));
- map.put("fstore", precompile(Constants.FSTORE_0, Constants.FSTORE_3, Constants.FSTORE));
- map.put("astore", precompile(Constants.ASTORE_0, Constants.ASTORE_3, Constants.ASTORE));
-
- // Compile strings
-
- for(Iterator i = map.keySet().iterator(); i.hasNext(); ) {
- String key = (String)i.next();
- String value = (String)map.get(key);
-
- char ch = value.charAt(1); // Omit already precompiled patterns
- if(ch < OFFSET) {
- map.put(key, compilePattern(value)); // precompile all patterns
- }
- }
-
- // Add instruction alias to match anything
-
- StringBuffer buf = new StringBuffer("(");
-
- for(short i=0; i < NO_OPCODES; i++) {
- if(Constants.NO_OF_OPERANDS[i] != Constants.UNDEFINED) { // Not an invalid opcode
- buf.append(makeChar(i));
-
- if(i < NO_OPCODES - 1)
- buf.append('|');
- }
- }
- buf.append(')');
-
- map.put("instruction", buf.toString());
- }
-
- private static String precompile(short from, short to, short extra) {
- StringBuffer buf = new StringBuffer("(");
-
- for(short i=from; i <= to; i++) {
- buf.append(makeChar(i));
- buf.append('|');
- }
-
- buf.append(makeChar(extra));
- buf.append(")");
- return buf.toString();
- }
-
- /*
- * Internal debugging routines.
- */
- private static final String pattern2string(String pattern) {
- return pattern2string(pattern, true);
- }
-
- private static final String pattern2string(String pattern, boolean make_string) {
- StringBuffer buf = new StringBuffer();
-
- for(int i=0; i < pattern.length(); i++) {
- char ch = pattern.charAt(i);
-
- if(ch >= OFFSET) {
- if(make_string)
- buf.append(Constants.OPCODE_NAMES[ch - OFFSET]);
- else
- buf.append((int)(ch - OFFSET));
- } else
- buf.append(ch);
- }
-
- return buf.toString();
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/util/JavaWrapper.java b/src/com/sun/org/apache/bcel/internal/util/JavaWrapper.java
deleted file mode 100644
index 1540f6d..0000000
--- a/src/com/sun/org/apache/bcel/internal/util/JavaWrapper.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.util;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import java.lang.reflect.*;
-
-/**
- * Java interpreter replacement, i.e., wrapper that uses its own ClassLoader
- * to modify/generate classes as they're requested. You can take this as a template
- * for your own applications.<br>
- * Call this wrapper with
- * <pre>java com.sun.org.apache.bcel.internal.util.JavaWrapper &lt;real.class.name&gt; [arguments]</pre>
- * <p>
- * To use your own class loader you can set the "bcel.classloader" system property
- * which defaults to "com.sun.org.apache.bcel.internal.util.ClassLoader", e.g., with
- * <pre>java com.sun.org.apache.bcel.internal.util.JavaWrapper -Dbcel.classloader=foo.MyLoader &lt;real.class.name&gt; [arguments]</pre>
- * </p>
- *
- * @version $Id: JavaWrapper.java,v 1.3 2007-07-19 04:34:52 ofung Exp $
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @see ClassLoader
- */
-public class JavaWrapper {
- private java.lang.ClassLoader loader;
-
- private static java.lang.ClassLoader getClassLoader() {
- String s = SecuritySupport.getSystemProperty("bcel.classloader");
-
- if((s == null) || "".equals(s))
- s = "com.sun.org.apache.bcel.internal.util.ClassLoader";
-
- try {
- return (java.lang.ClassLoader)Class.forName(s).newInstance();
- } catch(Exception e) {
- throw new RuntimeException(e.toString());
- }
- }
-
- public JavaWrapper(java.lang.ClassLoader loader) {
- this.loader = loader;
- }
-
- public JavaWrapper() {
- this(getClassLoader());
- }
-
- /** Runs the _main method of the given class with the arguments passed in argv
- *
- * @param class_name the fully qualified class name
- * @param argv the arguments just as you would pass them directly
- */
- public void runMain(String class_name, String[] argv) throws ClassNotFoundException
- {
- Class cl = loader.loadClass(class_name);
- Method method = null;
-
- try {
- method = cl.getMethod("_main", new Class[] { argv.getClass() });
-
- /* Method _main is sane ?
- */
- int m = method.getModifiers();
- Class r = method.getReturnType();
-
- if(!(Modifier.isPublic(m) && Modifier.isStatic(m)) ||
- Modifier.isAbstract(m) || (r != Void.TYPE))
- throw new NoSuchMethodException();
- } catch(NoSuchMethodException no) {
- System.out.println("In class " + class_name +
- ": public static void _main(String[] argv) is not defined");
- return;
- }
-
- try {
- method.invoke(null, new Object[] { argv });
- } catch(Exception ex) {
- ex.printStackTrace();
- }
- }
-
- /** Default _main method used as wrapper, expects the fully qualified class name
- * of the real class as the first argument.
- */
- public static void _main(String[] argv) throws Exception {
- /* Expects class name as first argument, other arguments are by-passed.
- */
- if(argv.length == 0) {
- System.out.println("Missing class name.");
- return;
- }
-
- String class_name = argv[0];
- String[] new_argv = new String[argv.length - 1];
- System.arraycopy(argv, 1, new_argv, 0, new_argv.length);
-
- JavaWrapper wrapper = new JavaWrapper();
- wrapper.runMain(class_name, new_argv);
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/util/MethodHTML.java b/src/com/sun/org/apache/bcel/internal/util/MethodHTML.java
deleted file mode 100644
index d6d5429..0000000
--- a/src/com/sun/org/apache/bcel/internal/util/MethodHTML.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.util;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.classfile.*;
-import java.io.*;
-
-/**
- * Convert methods and fields into HTML file.
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- *
- */
-final class MethodHTML implements com.sun.org.apache.bcel.internal.Constants {
- private String class_name; // name of current class
- private PrintWriter file; // file to write to
- private ConstantHTML constant_html;
- private AttributeHTML attribute_html;
-
- MethodHTML(String dir, String class_name,
- Method[] methods, Field[] fields,
- ConstantHTML constant_html, AttributeHTML attribute_html) throws IOException
- {
- this.class_name = class_name;
- this.attribute_html = attribute_html;
- this.constant_html = constant_html;
-
- file = new PrintWriter(new FileOutputStream(dir + class_name + "_methods.html"));
-
- file.println("<HTML><BODY BGCOLOR=\"#C0C0C0\"><TABLE BORDER=0>");
- file.println("<TR><TH ALIGN=LEFT>Access&nbsp;flags</TH><TH ALIGN=LEFT>Type</TH>" +
- "<TH ALIGN=LEFT>Field&nbsp;name</TH></TR>");
- for(int i=0; i < fields.length; i++)
- writeField(fields[i]);
- file.println("</TABLE>");
-
- file.println("<TABLE BORDER=0><TR><TH ALIGN=LEFT>Access&nbsp;flags</TH>" +
- "<TH ALIGN=LEFT>Return&nbsp;type</TH><TH ALIGN=LEFT>Method&nbsp;name</TH>" +
- "<TH ALIGN=LEFT>Arguments</TH></TR>");
- for(int i=0; i < methods.length; i++)
- writeMethod(methods[i], i);
-
- file.println("</TABLE></BODY></HTML>");
- file.close();
- }
-
- /**
- * Print field of class.
- *
- * @param field field to print
- * @exception java.io.IOException
- */
- private void writeField(Field field) throws IOException {
- String type = Utility.signatureToString(field.getSignature());
- String name = field.getName();
- String access = Utility.accessToString(field.getAccessFlags());
- Attribute[] attributes;
-
- access = Utility.replace(access, " ", "&nbsp;");
-
- file.print("<TR><TD><FONT COLOR=\"#FF0000\">" + access + "</FONT></TD>\n<TD>" +
- Class2HTML.referenceType(type) + "</TD><TD><A NAME=\"field" + name + "\">" +
- name + "</A></TD>");
-
- attributes = field.getAttributes();
-
- // Write them to the Attributes.html file with anchor "<name>[<i>]"
- for(int i=0; i < attributes.length; i++)
- attribute_html.writeAttribute(attributes[i], name + "@" + i);
-
- for(int i=0; i < attributes.length; i++) {
- if(attributes[i].getTag() == ATTR_CONSTANT_VALUE) { // Default value
- String str = ((ConstantValue)attributes[i]).toString();
-
- // Reference attribute in _attributes.html
- file.print("<TD>= <A HREF=\"" + class_name + "_attributes.html#" +
- name + "@" + i + "\" TARGET=\"Attributes\">" + str + "</TD>\n");
- break;
- }
- }
-
- file.println("</TR>");
- }
-
- private final void writeMethod(Method method, int method_number) throws IOException {
- // Get raw signature
- String signature = method.getSignature();
- // Get array of strings containing the argument types
- String[] args = Utility.methodSignatureArgumentTypes(signature, false);
- // Get return type string
- String type = Utility.methodSignatureReturnType(signature, false);
- // Get method name
- String name = method.getName(), html_name;
- // Get method's access flags
- String access = Utility.accessToString(method.getAccessFlags());
- // Get the method's attributes, the Code Attribute in particular
- Attribute[] attributes = method.getAttributes();
-
- /* HTML doesn't like names like <clinit> and spaces are places to break
- * lines. Both we don't want...
- */
- access = Utility.replace(access, " ", "&nbsp;");
- html_name = Class2HTML.toHTML(name);
-
- file.print("<TR VALIGN=TOP><TD><FONT COLOR=\"#FF0000\"><A NAME=method" + method_number + ">" +
- access + "</A></FONT></TD>");
-
- file.print("<TD>" + Class2HTML.referenceType(type) + "</TD><TD>" +
- "<A HREF=" + class_name + "_code.html#method" + method_number +
- " TARGET=Code>" + html_name + "</A></TD>\n<TD>(");
-
- for(int i=0; i < args.length; i++) {
- file.print(Class2HTML.referenceType(args[i]));
- if(i < args.length - 1)
- file.print(", ");
- }
-
- file.print(")</TD></TR>");
-
- // Check for thrown exceptions
- for(int i=0; i < attributes.length; i++) {
- attribute_html.writeAttribute(attributes[i], "method" + method_number + "@" + i,
- method_number);
-
- byte tag = attributes[i].getTag();
- if(tag == ATTR_EXCEPTIONS) {
- file.print("<TR VALIGN=TOP><TD COLSPAN=2></TD><TH ALIGN=LEFT>throws</TH><TD>");
- int[] exceptions = ((ExceptionTable)attributes[i]).getExceptionIndexTable();
-
- for(int j=0; j < exceptions.length; j++) {
- file.print(constant_html.referenceConstant(exceptions[j]));
-
- if(j < exceptions.length - 1)
- file.print(", ");
- }
- file.println("</TD></TR>");
- } else if(tag == ATTR_CODE) {
- Attribute[] c_a = ((Code)attributes[i]).getAttributes();
-
- for(int j=0; j < c_a.length; j++)
- attribute_html.writeAttribute(c_a[j], "method" + method_number + "@" + i + "@" + j,
- method_number);
- }
- }
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/util/Repository.java b/src/com/sun/org/apache/bcel/internal/util/Repository.java
deleted file mode 100644
index d588ba9..0000000
--- a/src/com/sun/org/apache/bcel/internal/util/Repository.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.util;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import com.sun.org.apache.bcel.internal.classfile.JavaClass;
-
-/**
- * Abstract definition of a class repository. Instances may be used
- * to load classes from different sources and may be used in the
- * Repository.setRepository method.
- *
- * @see com.sun.org.apache.bcel.internal.Repository
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @author David Dixon-Peugh
- */
-public interface Repository extends java.io.Serializable {
- /**
- * Store the provided class under "clazz.getClassName()"
- */
- public void storeClass(JavaClass clazz);
-
- /**
- * Remove class from repository
- */
- public void removeClass(JavaClass clazz);
-
- /**
- * Find the class with the name provided, if the class
- * isn't there, return NULL.
- */
- public JavaClass findClass(String className);
-
- /**
- * Find the class with the name provided, if the class
- * isn't there, make an attempt to load it.
- */
- public JavaClass loadClass(String className)
- throws java.lang.ClassNotFoundException;
-
- /**
- * Find the JavaClass instance for the given run-time class object
- */
- public JavaClass loadClass(Class clazz)
- throws java.lang.ClassNotFoundException;
-
- /** Clear all entries from cache.
- */
- public void clear();
-}
diff --git a/src/com/sun/org/apache/bcel/internal/util/SecuritySupport.java b/src/com/sun/org/apache/bcel/internal/util/SecuritySupport.java
deleted file mode 100644
index 22f8d39..0000000
--- a/src/com/sun/org/apache/bcel/internal/util/SecuritySupport.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2002-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.bcel.internal.util;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FilenameFilter;
-import java.io.InputStream;
-import java.lang.ClassLoader;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-import java.util.ListResourceBundle;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * This class is duplicated for each subpackage so keep it in sync. It is
- * package private and therefore is not exposed as part of any API.
- *
- * @xerces.internal
- */
-public final class SecuritySupport {
-
- private static final SecuritySupport securitySupport = new SecuritySupport();
-
- /**
- * Return an instance of this class.
- */
- public static SecuritySupport getInstance() {
- return securitySupport;
- }
-
- static ClassLoader getContextClassLoader() {
- return (ClassLoader) AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- ClassLoader cl = null;
- try {
- cl = Thread.currentThread().getContextClassLoader();
- } catch (SecurityException ex) {
- }
- return cl;
- }
- });
- }
-
- static ClassLoader getSystemClassLoader() {
- return (ClassLoader) AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- ClassLoader cl = null;
- try {
- cl = ClassLoader.getSystemClassLoader();
- } catch (SecurityException ex) {
- }
- return cl;
- }
- });
- }
-
- static ClassLoader getParentClassLoader(final ClassLoader cl) {
- return (ClassLoader) AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- ClassLoader parent = null;
- try {
- parent = cl.getParent();
- } catch (SecurityException ex) {
- }
-
- // eliminate loops in case of the boot
- // ClassLoader returning itself as a parent
- return (parent == cl) ? null : parent;
- }
- });
- }
-
- public static String getSystemProperty(final String propName) {
- return (String) AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return System.getProperty(propName);
- }
- });
- }
-
- static FileInputStream getFileInputStream(final File file)
- throws FileNotFoundException {
- try {
- return (FileInputStream) AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws FileNotFoundException {
- return new FileInputStream(file);
- }
- });
- } catch (PrivilegedActionException e) {
- throw (FileNotFoundException) e.getException();
- }
- }
-
- /**
- * Return resource using the same classloader for the ObjectFactory by
- * default or bootclassloader when Security Manager is in place
- */
- public static InputStream getResourceAsStream(final String name) {
- if (System.getSecurityManager() != null) {
- return getResourceAsStream(null, name);
- } else {
- return getResourceAsStream(findClassLoader(), name);
- }
- }
-
- public static InputStream getResourceAsStream(final ClassLoader cl,
- final String name) {
- return (InputStream) AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- InputStream ris;
- if (cl == null) {
- ris = Object.class.getResourceAsStream("/" + name);
- } else {
- ris = cl.getResourceAsStream(name);
- }
- return ris;
- }
- });
- }
-
- /**
- * Gets a resource bundle using the specified base name, the default locale,
- * and the caller's class loader.
- *
- * @param bundle the base name of the resource bundle, a fully qualified
- * class name
- * @return a resource bundle for the given base name and the default locale
- */
- public static ListResourceBundle getResourceBundle(String bundle) {
- return getResourceBundle(bundle, Locale.getDefault());
- }
-
- /**
- * Gets a resource bundle using the specified base name and locale, and the
- * caller's class loader.
- *
- * @param bundle the base name of the resource bundle, a fully qualified
- * class name
- * @param locale the locale for which a resource bundle is desired
- * @return a resource bundle for the given base name and locale
- */
- public static ListResourceBundle getResourceBundle(final String bundle, final Locale locale) {
- return AccessController.doPrivileged(new PrivilegedAction<ListResourceBundle>() {
- public ListResourceBundle run() {
- try {
- return (ListResourceBundle) ResourceBundle.getBundle(bundle, locale);
- } catch (MissingResourceException e) {
- try {
- return (ListResourceBundle) ResourceBundle.getBundle(bundle, new Locale("en", "US"));
- } catch (MissingResourceException e2) {
- throw new MissingResourceException(
- "Could not load any resource bundle by " + bundle, bundle, "");
- }
- }
- }
- });
- }
-
- public static String[] getFileList(final File f, final FilenameFilter filter) {
- return ((String[]) AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return f.list(filter);
- }
- }));
- }
-
- public static boolean getFileExists(final File f) {
- return ((Boolean) AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return f.exists() ? Boolean.TRUE : Boolean.FALSE;
- }
- })).booleanValue();
- }
-
- static long getLastModified(final File f) {
- return ((Long) AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return new Long(f.lastModified());
- }
- })).longValue();
- }
-
-
- /**
- * Figure out which ClassLoader to use.
- */
- public static ClassLoader findClassLoader()
- {
- if (System.getSecurityManager()!=null) {
- //this will ensure bootclassloader is used
- return null;
- } else {
- return SecuritySupport.class.getClassLoader();
- }
- } // findClassLoader():ClassLoader
-
- private SecuritySupport() {
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/util/SyntheticRepository.java b/src/com/sun/org/apache/bcel/internal/util/SyntheticRepository.java
deleted file mode 100644
index ddc647a..0000000
--- a/src/com/sun/org/apache/bcel/internal/util/SyntheticRepository.java
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.util;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache BCEL" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache BCEL", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import java.io.*;
-
-import java.util.Map;
-import java.util.HashMap;
-
-import com.sun.org.apache.bcel.internal.classfile.*;
-
-/**
- * This repository is used in situations where a Class is created
- * outside the realm of a ClassLoader. Classes are loaded from
- * the file systems using the paths specified in the given
- * class path. By default, this is the value returned by
- * ClassPath.getClassPath().
- * <br>
- * It is designed to be used as a singleton, however it
- * can also be used with custom classpaths.
- *
-/**
- * Abstract definition of a class repository. Instances may be used
- * to load classes from different sources and may be used in the
- * Repository.setRepository method.
- *
- * @see com.sun.org.apache.bcel.internal.Repository
- *
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- * @author David Dixon-Peugh
- */
-public class SyntheticRepository implements Repository {
- private static final String DEFAULT_PATH = ClassPath.getClassPath();
-
- private static HashMap _instances = new HashMap(); // CLASSPATH X REPOSITORY
-
- private ClassPath _path = null;
- private HashMap _loadedClasses = new HashMap(); // CLASSNAME X JAVACLASS
-
- private SyntheticRepository(ClassPath path) {
- _path = path;
- }
-
- public static SyntheticRepository getInstance() {
- return getInstance(ClassPath.SYSTEM_CLASS_PATH);
- }
-
- public static SyntheticRepository getInstance(ClassPath classPath) {
- SyntheticRepository rep = (SyntheticRepository)_instances.get(classPath);
-
- if(rep == null) {
- rep = new SyntheticRepository(classPath);
- _instances.put(classPath, rep);
- }
-
- return rep;
- }
-
- /**
- * Store a new JavaClass instance into this Repository.
- */
- public void storeClass(JavaClass clazz) {
- _loadedClasses.put(clazz.getClassName(), clazz);
- clazz.setRepository(this);
- }
-
- /**
- * Remove class from repository
- */
- public void removeClass(JavaClass clazz) {
- _loadedClasses.remove(clazz.getClassName());
- }
-
- /**
- * Find an already defined (cached) JavaClass object by name.
- */
- public JavaClass findClass(String className) {
- return (JavaClass)_loadedClasses.get(className);
- }
-
- /**
- * Load a JavaClass object for the given class name using
- * the CLASSPATH environment variable.
- */
- public JavaClass loadClass(String className)
- throws ClassNotFoundException
- {
- if(className == null || className.equals("")) {
- throw new IllegalArgumentException("Invalid class name " + className);
- }
-
- className = className.replace('/', '.'); // Just in case, canonical form
-
- try {
- return loadClass(_path.getInputStream(className), className);
- } catch(IOException e) {
- throw new ClassNotFoundException("Exception while looking for class " +
- className + ": " + e.toString());
- }
- }
-
- /**
- * Try to find class source via getResourceAsStream().
- * @see Class
- * @return JavaClass object for given runtime class
- */
- public JavaClass loadClass(Class clazz) throws ClassNotFoundException {
- String className = clazz.getName();
- String name = className;
- int i = name.lastIndexOf('.');
-
- if(i > 0) {
- name = name.substring(i + 1);
- }
-
- return loadClass(clazz.getResourceAsStream(name + ".class"), className);
- }
-
- private JavaClass loadClass(InputStream is, String className)
- throws ClassNotFoundException
- {
- JavaClass clazz = findClass(className);
-
- if(clazz != null) {
- return clazz;
- }
-
- try {
- if(is != null) {
- ClassParser parser = new ClassParser(is, className);
- clazz = parser.parse();
-
- storeClass(clazz);
-
- return clazz;
- }
- } catch(IOException e) {
- throw new ClassNotFoundException("Exception while looking for class " +
- className + ": " + e.toString());
- }
-
- throw new ClassNotFoundException("SyntheticRepository could not load " +
- className);
- }
-
- /** Clear all entries from cache.
- */
- public void clear() {
- _loadedClasses.clear();
- }
-}
diff --git a/src/com/sun/org/apache/bcel/internal/util/package.html b/src/com/sun/org/apache/bcel/internal/util/package.html
deleted file mode 100644
index b14ec46..0000000
--- a/src/com/sun/org/apache/bcel/internal/util/package.html
+++ /dev/null
@@ -1,25 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-$Id: package.html,v 1.1.2.1 2005/07/31 23:46:57 jeffsuttor Exp $
--->
-</head>
-<body bgcolor="white">
-<p>
-This package contains utility classes for the
-<a href="http://jakarta.apache.org/bcel/">Byte Code Engineering
-Library</a>, namely:
-</p>
-<p>
-<ul>
-<li>Collection classes for JavaClass objects</li>
-<li>A converter for class files to HTML</li>
-<li>A tool to find instructions patterns via regular expressions</li>
-<li>A class to find classes as defined in the CLASSPATH</li>
-<li>A class loader that allows to create clases at run time</li>
-</ul>
-
-</p>
-</body>
-</html>
diff --git a/src/com/sun/org/apache/regexp/internal/CharacterArrayCharacterIterator.java b/src/com/sun/org/apache/regexp/internal/CharacterArrayCharacterIterator.java
deleted file mode 100644
index 6382d47..0000000
--- a/src/com/sun/org/apache/regexp/internal/CharacterArrayCharacterIterator.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.regexp.internal;
-
-/**
- * Encapsulates char[] as CharacterIterator
- *
- * @author <a href="mailto:ales.novak@netbeans.com">Ales Novak</a>
- */
-public final class CharacterArrayCharacterIterator implements CharacterIterator
-{
- /** encapsulated */
- private final char[] src;
- /** offset in the char array */
- private final int off;
- /** used portion of the array */
- private final int len;
-
- /** @param src - encapsulated String */
- public CharacterArrayCharacterIterator(char[] src, int off, int len)
- {
- this.src = src;
- this.off = off;
- this.len = len;
- }
-
- /** @return a substring */
- public String substring(int beginIndex, int endIndex)
- {
- if (endIndex > len) {
- throw new IndexOutOfBoundsException("endIndex=" + endIndex
- + "; sequence size=" + len);
- }
- if (beginIndex < 0 || beginIndex > endIndex) {
- throw new IndexOutOfBoundsException("beginIndex=" + beginIndex
- + "; endIndex=" + endIndex);
- }
- return new String(src, off + beginIndex, endIndex - beginIndex);
- }
-
- /** @return a substring */
- public String substring(int beginIndex)
- {
- return substring(beginIndex, len);
- }
-
- /** @return a character at the specified position. */
- public char charAt(int pos)
- {
- return src[off + pos];
- }
-
- /** @return <tt>true</tt> iff if the specified index is after the end of the character stream */
- public boolean isEnd(int pos)
- {
- return (pos >= len);
- }
-}
diff --git a/src/com/sun/org/apache/regexp/internal/CharacterIterator.java b/src/com/sun/org/apache/regexp/internal/CharacterIterator.java
deleted file mode 100644
index 69db536..0000000
--- a/src/com/sun/org/apache/regexp/internal/CharacterIterator.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.regexp.internal;
-
-/**
- * Encapsulates different types of character sources - String, InputStream, ...
- * Defines a set of common methods
- *
- * @author <a href="mailto:ales.novak@netbeans.com">Ales Novak</a>
- */
-public interface CharacterIterator
-{
- /** @return a substring */
- String substring(int beginIndex, int endIndex);
-
- /** @return a substring */
- String substring(int beginIndex);
-
- /** @return a character at the specified position. */
- char charAt(int pos);
-
- /** @return <tt>true</tt> iff if the specified index is after the end of the character stream */
- boolean isEnd(int pos);
-}
diff --git a/src/com/sun/org/apache/regexp/internal/RE.java b/src/com/sun/org/apache/regexp/internal/RE.java
deleted file mode 100644
index 0cdc012..0000000
--- a/src/com/sun/org/apache/regexp/internal/RE.java
+++ /dev/null
@@ -1,1760 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.regexp.internal;
-
-import java.io.Serializable;
-import java.util.Vector;
-
-/**
- * RE is an efficient, lightweight regular expression evaluator/matcher
- * class. Regular expressions are pattern descriptions which enable
- * sophisticated matching of strings. In addition to being able to
- * match a string against a pattern, you can also extract parts of the
- * match. This is especially useful in text parsing! Details on the
- * syntax of regular expression patterns are given below.
- *
- * <p>
- * To compile a regular expression (RE), you can simply construct an RE
- * matcher object from the string specification of the pattern, like this:
- *
- * <pre>
- * RE r = new RE("a*b");
- * </pre>
- *
- * <p>
- * Once you have done this, you can call either of the RE.match methods to
- * perform matching on a String. For example:
- *
- * <pre>
- * boolean matched = r.match("aaaab");
- * </pre>
- *
- * will cause the boolean matched to be set to true because the
- * pattern "a*b" matches the string "aaaab".
- *
- * <p>
- * If you were interested in the <i>number</i> of a's which matched the
- * first part of our example expression, you could change the expression to
- * "(a*)b". Then when you compiled the expression and matched it against
- * something like "xaaaab", you would get results like this:
- *
- * <pre>
- * RE r = new RE("(a*)b"); // Compile expression
- * boolean matched = r.match("xaaaab"); // Match against "xaaaab"
- *
- * String wholeExpr = r.getParen(0); // wholeExpr will be 'aaaab'
- * String insideParens = r.getParen(1); // insideParens will be 'aaaa'
- *
- * int startWholeExpr = r.getParenStart(0); // startWholeExpr will be index 1
- * int endWholeExpr = r.getParenEnd(0); // endWholeExpr will be index 6
- * int lenWholeExpr = r.getParenLength(0); // lenWholeExpr will be 5
- *
- * int startInside = r.getParenStart(1); // startInside will be index 1
- * int endInside = r.getParenEnd(1); // endInside will be index 5
- * int lenInside = r.getParenLength(1); // lenInside will be 4
- * </pre>
- *
- * You can also refer to the contents of a parenthesized expression
- * within a regular expression itself. This is called a
- * 'backreference'. The first backreference in a regular expression is
- * denoted by \1, the second by \2 and so on. So the expression:
- *
- * <pre>
- * ([0-9]+)=\1
- * </pre>
- *
- * will match any string of the form n=n (like 0=0 or 2=2).
- *
- * <p>
- * The full regular expression syntax accepted by RE is described here:
- *
- * <pre>
- *
- * <b><font face=times roman>Characters</font></b>
- *
- * <i>unicodeChar</i> Matches any identical unicode character
- * \ Used to quote a meta-character (like '*')
- * \\ Matches a single '\' character
- * \0nnn Matches a given octal character
- * \xhh Matches a given 8-bit hexadecimal character
- * \\uhhhh Matches a given 16-bit hexadecimal character
- * \t Matches an ASCII tab character
- * \n Matches an ASCII newline character
- * \r Matches an ASCII return character
- * \f Matches an ASCII form feed character
- *
- *
- * <b><font face=times roman>Character Classes</font></b>
- *
- * [abc] Simple character class
- * [a-zA-Z] Character class with ranges
- * [^abc] Negated character class
- * </pre>
- *
- * <b>NOTE:</b> Incomplete ranges will be interpreted as &quot;starts
- * from zero&quot; or &quot;ends with last character&quot;.
- * <br>
- * I.e. [-a] is the same as [\\u0000-a], and [a-] is the same as [a-\\uFFFF],
- * [-] means &quot;all characters&quot;.
- *
- * <pre>
- *
- * <b><font face=times roman>Standard POSIX Character Classes</font></b>
- *
- * [:alnum:] Alphanumeric characters.
- * [:alpha:] Alphabetic characters.
- * [:blank:] Space and tab characters.
- * [:cntrl:] Control characters.
- * [:digit:] Numeric characters.
- * [:graph:] Characters that are printable and are also visible.
- * (A space is printable, but not visible, while an
- * `a' is both.)
- * [:lower:] Lower-case alphabetic characters.
- * [:print:] Printable characters (characters that are not
- * control characters.)
- * [:punct:] Punctuation characters (characters that are not letter,
- * digits, control characters, or space characters).
- * [:space:] Space characters (such as space, tab, and formfeed,
- * to name a few).
- * [:upper:] Upper-case alphabetic characters.
- * [:xdigit:] Characters that are hexadecimal digits.
- *
- *
- * <b><font face=times roman>Non-standard POSIX-style Character Classes</font></b>
- *
- * [:javastart:] Start of a Java identifier
- * [:javapart:] Part of a Java identifier
- *
- *
- * <b><font face=times roman>Predefined Classes</font></b>
- *
- * . Matches any character other than newline
- * \w Matches a "word" character (alphanumeric plus "_")
- * \W Matches a non-word character
- * \s Matches a whitespace character
- * \S Matches a non-whitespace character
- * \d Matches a digit character
- * \D Matches a non-digit character
- *
- *
- * <b><font face=times roman>Boundary Matchers</font></b>
- *
- * ^ Matches only at the beginning of a line
- * $ Matches only at the end of a line
- * \b Matches only at a word boundary
- * \B Matches only at a non-word boundary
- *
- *
- * <b><font face=times roman>Greedy Closures</font></b>
- *
- * A* Matches A 0 or more times (greedy)
- * A+ Matches A 1 or more times (greedy)
- * A? Matches A 1 or 0 times (greedy)
- * A{n} Matches A exactly n times (greedy)
- * A{n,} Matches A at least n times (greedy)
- * A{n,m} Matches A at least n but not more than m times (greedy)
- *
- *
- * <b><font face=times roman>Reluctant Closures</font></b>
- *
- * A*? Matches A 0 or more times (reluctant)
- * A+? Matches A 1 or more times (reluctant)
- * A?? Matches A 0 or 1 times (reluctant)
- *
- *
- * <b><font face=times roman>Logical Operators</font></b>
- *
- * AB Matches A followed by B
- * A|B Matches either A or B
- * (A) Used for subexpression grouping
- * (?:A) Used for subexpression clustering (just like grouping but
- * no backrefs)
- *
- *
- * <b><font face=times roman>Backreferences</font></b>
- *
- * \1 Backreference to 1st parenthesized subexpression
- * \2 Backreference to 2nd parenthesized subexpression
- * \3 Backreference to 3rd parenthesized subexpression
- * \4 Backreference to 4th parenthesized subexpression
- * \5 Backreference to 5th parenthesized subexpression
- * \6 Backreference to 6th parenthesized subexpression
- * \7 Backreference to 7th parenthesized subexpression
- * \8 Backreference to 8th parenthesized subexpression
- * \9 Backreference to 9th parenthesized subexpression
- * </pre>
- *
- * <p>
- * All closure operators (+, *, ?, {m,n}) are greedy by default, meaning
- * that they match as many elements of the string as possible without
- * causing the overall match to fail. If you want a closure to be
- * reluctant (non-greedy), you can simply follow it with a '?'. A
- * reluctant closure will match as few elements of the string as
- * possible when finding matches. {m,n} closures don't currently
- * support reluctancy.
- *
- * <p>
- * <b><font face="times roman">Line terminators</font></b>
- * <br>
- * A line terminator is a one- or two-character sequence that marks
- * the end of a line of the input character sequence. The following
- * are recognized as line terminators:
- * <ul>
- * <li>A newline (line feed) character ('\n'),</li>
- * <li>A carriage-return character followed immediately by a newline character ("\r\n"),</li>
- * <li>A standalone carriage-return character ('\r'),</li>
- * <li>A next-line character ('\u0085'),</li>
- * <li>A line-separator character ('\u2028'), or</li>
- * <li>A paragraph-separator character ('\u2029).</li>
- * </ul>
- *
- * <p>
- * RE runs programs compiled by the RECompiler class. But the RE
- * matcher class does not include the actual regular expression compiler
- * for reasons of efficiency. In fact, if you want to pre-compile one
- * or more regular expressions, the 'recompile' class can be invoked
- * from the command line to produce compiled output like this:
- *
- * <pre>
- * // Pre-compiled regular expression "a*b"
- * char[] re1Instructions =
- * {
- * 0x007c, 0x0000, 0x001a, 0x007c, 0x0000, 0x000d, 0x0041,
- * 0x0001, 0x0004, 0x0061, 0x007c, 0x0000, 0x0003, 0x0047,
- * 0x0000, 0xfff6, 0x007c, 0x0000, 0x0003, 0x004e, 0x0000,
- * 0x0003, 0x0041, 0x0001, 0x0004, 0x0062, 0x0045, 0x0000,
- * 0x0000,
- * };
- *
- *
- * REProgram re1 = new REProgram(re1Instructions);
- * </pre>
- *
- * You can then construct a regular expression matcher (RE) object from
- * the pre-compiled expression re1 and thus avoid the overhead of
- * compiling the expression at runtime. If you require more dynamic
- * regular expressions, you can construct a single RECompiler object and
- * re-use it to compile each expression. Similarly, you can change the
- * program run by a given matcher object at any time. However, RE and
- * RECompiler are not threadsafe (for efficiency reasons, and because
- * requiring thread safety in this class is deemed to be a rare
- * requirement), so you will need to construct a separate compiler or
- * matcher object for each thread (unless you do thread synchronization
- * yourself). Once expression compiled into the REProgram object, REProgram
- * can be safely shared across multiple threads and RE objects.
- *
- * <br><p><br>
- *
- * <font color="red">
- * <i>ISSUES:</i>
- *
- * <ul>
- * <li>com.weusours.util.re is not currently compatible with all
- * standard POSIX regcomp flags</li>
- * <li>com.weusours.util.re does not support POSIX equivalence classes
- * ([=foo=] syntax) (I18N/locale issue)</li>
- * <li>com.weusours.util.re does not support nested POSIX character
- * classes (definitely should, but not completely trivial)</li>
- * <li>com.weusours.util.re Does not support POSIX character collation
- * concepts ([.foo.] syntax) (I18N/locale issue)</li>
- * <li>Should there be different matching styles (simple, POSIX, Perl etc?)</li>
- * <li>Should RE support character iterators (for backwards RE matching!)?</li>
- * <li>Should RE support reluctant {m,n} closures (does anyone care)?</li>
- * <li>Not *all* possibilities are considered for greediness when backreferences
- * are involved (as POSIX suggests should be the case). The POSIX RE
- * "(ac*)c*d[ac]*\1", when matched against "acdacaa" should yield a match
- * of acdacaa where \1 is "a". This is not the case in this RE package,
- * and actually Perl doesn't go to this extent either! Until someone
- * actually complains about this, I'm not sure it's worth "fixing".
- * If it ever is fixed, test #137 in RETest.txt should be updated.</li>
- * </ul>
- *
- * </font>
- *
- * @see recompile
- * @see RECompiler
- *
- * @author <a href="mailto:jonl@muppetlabs.com">Jonathan Locke</a>
- * @author <a href="mailto:ts@sch-fer.de">Tobias Sch&auml;fer</a>
- */
-public class RE implements Serializable
-{
- /**
- * Specifies normal, case-sensitive matching behaviour.
- */
- public static final int MATCH_NORMAL = 0x0000;
-
- /**
- * Flag to indicate that matching should be case-independent (folded)
- */
- public static final int MATCH_CASEINDEPENDENT = 0x0001;
-
- /**
- * Newlines should match as BOL/EOL (^ and $)
- */
- public static final int MATCH_MULTILINE = 0x0002;
-
- /**
- * Consider all input a single body of text - newlines are matched by .
- */
- public static final int MATCH_SINGLELINE = 0x0004;
-
- /************************************************
- * *
- * The format of a node in a program is: *
- * *
- * [ OPCODE ] [ OPDATA ] [ OPNEXT ] [ OPERAND ] *
- * *
- * char OPCODE - instruction *
- * char OPDATA - modifying data *
- * char OPNEXT - next node (relative offset) *
- * *
- ************************************************/
-
- // Opcode Char Opdata/Operand Meaning
- // ---------- ---------- --------------- --------------------------------------------------
- static final char OP_END = 'E'; // end of program
- static final char OP_BOL = '^'; // match only if at beginning of line
- static final char OP_EOL = '$'; // match only if at end of line
- static final char OP_ANY = '.'; // match any single character except newline
- static final char OP_ANYOF = '['; // count/ranges match any char in the list of ranges
- static final char OP_BRANCH = '|'; // node match this alternative or the next one
- static final char OP_ATOM = 'A'; // length/string length of string followed by string itself
- static final char OP_STAR = '*'; // node kleene closure
- static final char OP_PLUS = '+'; // node positive closure
- static final char OP_MAYBE = '?'; // node optional closure
- static final char OP_ESCAPE = '\\'; // escape special escape code char class (escape is E_* code)
- static final char OP_OPEN = '('; // number nth opening paren
- static final char OP_OPEN_CLUSTER = '<'; // opening cluster
- static final char OP_CLOSE = ')'; // number nth closing paren
- static final char OP_CLOSE_CLUSTER = '>'; // closing cluster
- static final char OP_BACKREF = '#'; // number reference nth already matched parenthesized string
- static final char OP_GOTO = 'G'; // nothing but a (back-)pointer
- static final char OP_NOTHING = 'N'; // match null string such as in '(a|)'
- static final char OP_RELUCTANTSTAR = '8'; // none/expr reluctant '*' (mnemonic for char is unshifted '*')
- static final char OP_RELUCTANTPLUS = '='; // none/expr reluctant '+' (mnemonic for char is unshifted '+')
- static final char OP_RELUCTANTMAYBE = '/'; // none/expr reluctant '?' (mnemonic for char is unshifted '?')
- static final char OP_POSIXCLASS = 'P'; // classid one of the posix character classes
-
- // Escape codes
- static final char E_ALNUM = 'w'; // Alphanumeric
- static final char E_NALNUM = 'W'; // Non-alphanumeric
- static final char E_BOUND = 'b'; // Word boundary
- static final char E_NBOUND = 'B'; // Non-word boundary
- static final char E_SPACE = 's'; // Whitespace
- static final char E_NSPACE = 'S'; // Non-whitespace
- static final char E_DIGIT = 'd'; // Digit
- static final char E_NDIGIT = 'D'; // Non-digit
-
- // Posix character classes
- static final char POSIX_CLASS_ALNUM = 'w'; // Alphanumerics
- static final char POSIX_CLASS_ALPHA = 'a'; // Alphabetics
- static final char POSIX_CLASS_BLANK = 'b'; // Blanks
- static final char POSIX_CLASS_CNTRL = 'c'; // Control characters
- static final char POSIX_CLASS_DIGIT = 'd'; // Digits
- static final char POSIX_CLASS_GRAPH = 'g'; // Graphic characters
- static final char POSIX_CLASS_LOWER = 'l'; // Lowercase characters
- static final char POSIX_CLASS_PRINT = 'p'; // Printable characters
- static final char POSIX_CLASS_PUNCT = '!'; // Punctuation
- static final char POSIX_CLASS_SPACE = 's'; // Spaces
- static final char POSIX_CLASS_UPPER = 'u'; // Uppercase characters
- static final char POSIX_CLASS_XDIGIT = 'x'; // Hexadecimal digits
- static final char POSIX_CLASS_JSTART = 'j'; // Java identifier start
- static final char POSIX_CLASS_JPART = 'k'; // Java identifier part
-
- // Limits
- static final int maxNode = 65536; // Maximum number of nodes in a program
- static final int MAX_PAREN = 16; // Number of paren pairs (only 9 can be backrefs)
-
- // Node layout constants
- static final int offsetOpcode = 0; // Opcode offset (first character)
- static final int offsetOpdata = 1; // Opdata offset (second char)
- static final int offsetNext = 2; // Next index offset (third char)
- static final int nodeSize = 3; // Node size (in chars)
-
- // State of current program
- REProgram program; // Compiled regular expression 'program'
- transient CharacterIterator search; // The string being matched against
- int matchFlags; // Match behaviour flags
- int maxParen = MAX_PAREN;
-
- // Parenthesized subexpressions
- transient int parenCount; // Number of subexpressions matched (num open parens + 1)
- transient int start0; // Cache of start[0]
- transient int end0; // Cache of start[0]
- transient int start1; // Cache of start[1]
- transient int end1; // Cache of start[1]
- transient int start2; // Cache of start[2]
- transient int end2; // Cache of start[2]
- transient int[] startn; // Lazy-alloced array of sub-expression starts
- transient int[] endn; // Lazy-alloced array of sub-expression ends
-
- // Backreferences
- transient int[] startBackref; // Lazy-alloced array of backref starts
- transient int[] endBackref; // Lazy-alloced array of backref ends
-
- /**
- * Constructs a regular expression matcher from a String by compiling it
- * using a new instance of RECompiler. If you will be compiling many
- * expressions, you may prefer to use a single RECompiler object instead.
- *
- * @param pattern The regular expression pattern to compile.
- * @exception RESyntaxException Thrown if the regular expression has invalid syntax.
- * @see RECompiler
- * @see recompile
- */
- public RE(String pattern) throws RESyntaxException
- {
- this(pattern, MATCH_NORMAL);
- }
-
- /**
- * Constructs a regular expression matcher from a String by compiling it
- * using a new instance of RECompiler. If you will be compiling many
- * expressions, you may prefer to use a single RECompiler object instead.
- *
- * @param pattern The regular expression pattern to compile.
- * @param matchFlags The matching style
- * @exception RESyntaxException Thrown if the regular expression has invalid syntax.
- * @see RECompiler
- * @see recompile
- */
- public RE(String pattern, int matchFlags) throws RESyntaxException
- {
- this(new RECompiler().compile(pattern));
- setMatchFlags(matchFlags);
- }
-
- /**
- * Construct a matcher for a pre-compiled regular expression from program
- * (bytecode) data. Permits special flags to be passed in to modify matching
- * behaviour.
- *
- * @param program Compiled regular expression program (see RECompiler and/or recompile)
- * @param matchFlags One or more of the RE match behaviour flags (RE.MATCH_*):
- *
- * <pre>
- * MATCH_NORMAL // Normal (case-sensitive) matching
- * MATCH_CASEINDEPENDENT // Case folded comparisons
- * MATCH_MULTILINE // Newline matches as BOL/EOL
- * </pre>
- *
- * @see RECompiler
- * @see REProgram
- * @see recompile
- */
- public RE(REProgram program, int matchFlags)
- {
- setProgram(program);
- setMatchFlags(matchFlags);
- }
-
- /**
- * Construct a matcher for a pre-compiled regular expression from program
- * (bytecode) data.
- *
- * @param program Compiled regular expression program
- * @see RECompiler
- * @see recompile
- */
- public RE(REProgram program)
- {
- this(program, MATCH_NORMAL);
- }
-
- /**
- * Constructs a regular expression matcher with no initial program.
- * This is likely to be an uncommon practice, but is still supported.
- */
- public RE()
- {
- this((REProgram)null, MATCH_NORMAL);
- }
-
- /**
- * Converts a 'simplified' regular expression to a full regular expression
- *
- * @param pattern The pattern to convert
- * @return The full regular expression
- */
- public static String simplePatternToFullRegularExpression(String pattern)
- {
- StringBuffer buf = new StringBuffer();
- for (int i = 0; i < pattern.length(); i++)
- {
- char c = pattern.charAt(i);
- switch (c)
- {
- case '*':
- buf.append(".*");
- break;
-
- case '.':
- case '[':
- case ']':
- case '\\':
- case '+':
- case '?':
- case '{':
- case '}':
- case '$':
- case '^':
- case '|':
- case '(':
- case ')':
- buf.append('\\');
- default:
- buf.append(c);
- break;
- }
- }
- return buf.toString();
- }
-
- /**
- * Sets match behaviour flags which alter the way RE does matching.
- * @param matchFlags One or more of the RE match behaviour flags (RE.MATCH_*):
- *
- * <pre>
- * MATCH_NORMAL // Normal (case-sensitive) matching
- * MATCH_CASEINDEPENDENT // Case folded comparisons
- * MATCH_MULTILINE // Newline matches as BOL/EOL
- * </pre>
- */
- public void setMatchFlags(int matchFlags)
- {
- this.matchFlags = matchFlags;
- }
-
- /**
- * Returns the current match behaviour flags.
- * @return Current match behaviour flags (RE.MATCH_*).
- *
- * <pre>
- * MATCH_NORMAL // Normal (case-sensitive) matching
- * MATCH_CASEINDEPENDENT // Case folded comparisons
- * MATCH_MULTILINE // Newline matches as BOL/EOL
- * </pre>
- *
- * @see #setMatchFlags
- */
- public int getMatchFlags()
- {
- return matchFlags;
- }
-
- /**
- * Sets the current regular expression program used by this matcher object.
- *
- * @param program Regular expression program compiled by RECompiler.
- * @see RECompiler
- * @see REProgram
- * @see recompile
- */
- public void setProgram(REProgram program)
- {
- this.program = program;
- if (program != null && program.maxParens != -1) {
- this.maxParen = program.maxParens;
- } else {
- this.maxParen = MAX_PAREN;
- }
- }
-
- /**
- * Returns the current regular expression program in use by this matcher object.
- *
- * @return Regular expression program
- * @see #setProgram
- */
- public REProgram getProgram()
- {
- return program;
- }
-
- /**
- * Returns the number of parenthesized subexpressions available after a successful match.
- *
- * @return Number of available parenthesized subexpressions
- */
- public int getParenCount()
- {
- return parenCount;
- }
-
- /**
- * Gets the contents of a parenthesized subexpression after a successful match.
- *
- * @param which Nesting level of subexpression
- * @return String
- */
- public String getParen(int which)
- {
- int start;
- if (which < parenCount && (start = getParenStart(which)) >= 0)
- {
- return search.substring(start, getParenEnd(which));
- }
- return null;
- }
-
- /**
- * Returns the start index of a given paren level.
- *
- * @param which Nesting level of subexpression
- * @return String index
- */
- public final int getParenStart(int which)
- {
- if (which < parenCount)
- {
- switch (which)
- {
- case 0:
- return start0;
-
- case 1:
- return start1;
-
- case 2:
- return start2;
-
- default:
- if (startn == null)
- {
- allocParens();
- }
- return startn[which];
- }
- }
- return -1;
- }
-
- /**
- * Returns the end index of a given paren level.
- *
- * @param which Nesting level of subexpression
- * @return String index
- */
- public final int getParenEnd(int which)
- {
- if (which < parenCount)
- {
- switch (which)
- {
- case 0:
- return end0;
-
- case 1:
- return end1;
-
- case 2:
- return end2;
-
- default:
- if (endn == null)
- {
- allocParens();
- }
- return endn[which];
- }
- }
- return -1;
- }
-
- /**
- * Returns the length of a given paren level.
- *
- * @param which Nesting level of subexpression
- * @return Number of characters in the parenthesized subexpression
- */
- public final int getParenLength(int which)
- {
- if (which < parenCount)
- {
- return getParenEnd(which) - getParenStart(which);
- }
- return -1;
- }
-
- /**
- * Sets the start of a paren level
- *
- * @param which Which paren level
- * @param i Index in input array
- */
- protected final void setParenStart(int which, int i)
- {
- if (which < parenCount)
- {
- switch (which)
- {
- case 0:
- start0 = i;
- break;
-
- case 1:
- start1 = i;
- break;
-
- case 2:
- start2 = i;
- break;
-
- default:
- if (startn == null)
- {
- allocParens();
- }
- startn[which] = i;
- break;
- }
- }
- }
-
- /**
- * Sets the end of a paren level
- *
- * @param which Which paren level
- * @param i Index in input array
- */
- protected final void setParenEnd(int which, int i)
- {
- if (which < parenCount)
- {
- switch (which)
- {
- case 0:
- end0 = i;
- break;
-
- case 1:
- end1 = i;
- break;
-
- case 2:
- end2 = i;
- break;
-
- default:
- if (endn == null)
- {
- allocParens();
- }
- endn[which] = i;
- break;
- }
- }
- }
-
- /**
- * Throws an Error representing an internal error condition probably resulting
- * from a bug in the regular expression compiler (or possibly data corruption).
- * In practice, this should be very rare.
- *
- * @param s Error description
- */
- protected void internalError(String s) throws Error
- {
- throw new Error("RE internal error: " + s);
- }
-
- /**
- * Performs lazy allocation of subexpression arrays
- */
- private final void allocParens()
- {
- // Allocate arrays for subexpressions
- startn = new int[maxParen];
- endn = new int[maxParen];
-
- // Set sub-expression pointers to invalid values
- for (int i = 0; i < maxParen; i++)
- {
- startn[i] = -1;
- endn[i] = -1;
- }
- }
-
- /**
- * Try to match a string against a subset of nodes in the program
- *
- * @param firstNode Node to start at in program
- * @param lastNode Last valid node (used for matching a subexpression without
- * matching the rest of the program as well).
- * @param idxStart Starting position in character array
- * @return Final input array index if match succeeded. -1 if not.
- */
- protected int matchNodes(int firstNode, int lastNode, int idxStart)
- {
- // Our current place in the string
- int idx = idxStart;
-
- // Loop while node is valid
- int next, opcode, opdata;
- int idxNew;
- char[] instruction = program.instruction;
- for (int node = firstNode; node < lastNode; )
- {
- opcode = instruction[node + offsetOpcode];
- next = node + (short)instruction[node + offsetNext];
- opdata = instruction[node + offsetOpdata];
-
- switch (opcode)
- {
- case OP_RELUCTANTMAYBE:
- {
- int once = 0;
- do
- {
- // Try to match the rest without using the reluctant subexpr
- if ((idxNew = matchNodes(next, maxNode, idx)) != -1)
- {
- return idxNew;
- }
- }
- while ((once++ == 0) && (idx = matchNodes(node + nodeSize, next, idx)) != -1);
- return -1;
- }
-
- case OP_RELUCTANTPLUS:
- while ((idx = matchNodes(node + nodeSize, next, idx)) != -1)
- {
- // Try to match the rest without using the reluctant subexpr
- if ((idxNew = matchNodes(next, maxNode, idx)) != -1)
- {
- return idxNew;
- }
- }
- return -1;
-
- case OP_RELUCTANTSTAR:
- do
- {
- // Try to match the rest without using the reluctant subexpr
- if ((idxNew = matchNodes(next, maxNode, idx)) != -1)
- {
- return idxNew;
- }
- }
- while ((idx = matchNodes(node + nodeSize, next, idx)) != -1);
- return -1;
-
- case OP_OPEN:
-
- // Match subexpression
- if ((program.flags & REProgram.OPT_HASBACKREFS) != 0)
- {
- startBackref[opdata] = idx;
- }
- if ((idxNew = matchNodes(next, maxNode, idx)) != -1)
- {
- // Increase valid paren count
- if ((opdata + 1) > parenCount)
- {
- parenCount = opdata + 1;
- }
-
- // Don't set paren if already set later on
- if (getParenStart(opdata) == -1)
- {
- setParenStart(opdata, idx);
- }
- }
- return idxNew;
-
- case OP_CLOSE:
-
- // Done matching subexpression
- if ((program.flags & REProgram.OPT_HASBACKREFS) != 0)
- {
- endBackref[opdata] = idx;
- }
- if ((idxNew = matchNodes(next, maxNode, idx)) != -1)
- {
- // Increase valid paren count
- if ((opdata + 1) > parenCount)
- {
- parenCount = opdata + 1;
- }
-
- // Don't set paren if already set later on
- if (getParenEnd(opdata) == -1)
- {
- setParenEnd(opdata, idx);
- }
- }
- return idxNew;
-
- case OP_OPEN_CLUSTER:
- case OP_CLOSE_CLUSTER:
- // starting or ending the matching of a subexpression which has no backref.
- return matchNodes( next, maxNode, idx );
-
- case OP_BACKREF:
- {
- // Get the start and end of the backref
- int s = startBackref[opdata];
- int e = endBackref[opdata];
-
- // We don't know the backref yet
- if (s == -1 || e == -1)
- {
- return -1;
- }
-
- // The backref is empty size
- if (s == e)
- {
- break;
- }
-
- // Get the length of the backref
- int l = e - s;
-
- // If there's not enough input left, give up.
- if (search.isEnd(idx + l - 1))
- {
- return -1;
- }
-
- // Case fold the backref?
- final boolean caseFold =
- ((matchFlags & MATCH_CASEINDEPENDENT) != 0);
- // Compare backref to input
- for (int i = 0; i < l; i++)
- {
- if (compareChars(search.charAt(idx++), search.charAt(s + i), caseFold) != 0)
- {
- return -1;
- }
- }
- }
- break;
-
- case OP_BOL:
-
- // Fail if we're not at the start of the string
- if (idx != 0)
- {
- // If we're multiline matching, we could still be at the start of a line
- if ((matchFlags & MATCH_MULTILINE) == MATCH_MULTILINE)
- {
- // If not at start of line, give up
- if (idx <= 0 || !isNewline(idx - 1)) {
- return -1;
- } else {
- break;
- }
- }
- return -1;
- }
- break;
-
- case OP_EOL:
-
- // If we're not at the end of string
- if (!search.isEnd(0) && !search.isEnd(idx))
- {
- // If we're multi-line matching
- if ((matchFlags & MATCH_MULTILINE) == MATCH_MULTILINE)
- {
- // Give up if we're not at the end of a line
- if (!isNewline(idx)) {
- return -1;
- } else {
- break;
- }
- }
- return -1;
- }
- break;
-
- case OP_ESCAPE:
-
- // Which escape?
- switch (opdata)
- {
- // Word boundary match
- case E_NBOUND:
- case E_BOUND:
- {
- char cLast = ((idx == 0) ? '\n' : search.charAt(idx - 1));
- char cNext = ((search.isEnd(idx)) ? '\n' : search.charAt(idx));
- if ((Character.isLetterOrDigit(cLast) == Character.isLetterOrDigit(cNext)) == (opdata == E_BOUND))
- {
- return -1;
- }
- }
- break;
-
- // Alpha-numeric, digit, space, javaLetter, javaLetterOrDigit
- case E_ALNUM:
- case E_NALNUM:
- case E_DIGIT:
- case E_NDIGIT:
- case E_SPACE:
- case E_NSPACE:
-
- // Give up if out of input
- if (search.isEnd(idx))
- {
- return -1;
- }
-
- char c = search.charAt(idx);
-
- // Switch on escape
- switch (opdata)
- {
- case E_ALNUM:
- case E_NALNUM:
- if (!((Character.isLetterOrDigit(c) || c == '_') == (opdata == E_ALNUM)))
- {
- return -1;
- }
- break;
-
- case E_DIGIT:
- case E_NDIGIT:
- if (!(Character.isDigit(c) == (opdata == E_DIGIT)))
- {
- return -1;
- }
- break;
-
- case E_SPACE:
- case E_NSPACE:
- if (!(Character.isWhitespace(c) == (opdata == E_SPACE)))
- {
- return -1;
- }
- break;
- }
- idx++;
- break;
-
- default:
- internalError("Unrecognized escape '" + opdata + "'");
- }
- break;
-
- case OP_ANY:
-
- if ((matchFlags & MATCH_SINGLELINE) == MATCH_SINGLELINE) {
- // Match anything
- if (search.isEnd(idx))
- {
- return -1;
- }
- }
- else
- {
- // Match anything but a newline
- if (search.isEnd(idx) || isNewline(idx))
- {
- return -1;
- }
- }
- idx++;
- break;
-
- case OP_ATOM:
- {
- // Match an atom value
- if (search.isEnd(idx))
- {
- return -1;
- }
-
- // Get length of atom and starting index
- int lenAtom = opdata;
- int startAtom = node + nodeSize;
-
- // Give up if not enough input remains to have a match
- if (search.isEnd(lenAtom + idx - 1))
- {
- return -1;
- }
-
- // Match atom differently depending on casefolding flag
- final boolean caseFold =
- ((matchFlags & MATCH_CASEINDEPENDENT) != 0);
-
- for (int i = 0; i < lenAtom; i++)
- {
- if (compareChars(search.charAt(idx++), instruction[startAtom + i], caseFold) != 0)
- {
- return -1;
- }
- }
- }
- break;
-
- case OP_POSIXCLASS:
- {
- // Out of input?
- if (search.isEnd(idx))
- {
- return -1;
- }
-
- switch (opdata)
- {
- case POSIX_CLASS_ALNUM:
- if (!Character.isLetterOrDigit(search.charAt(idx)))
- {
- return -1;
- }
- break;
-
- case POSIX_CLASS_ALPHA:
- if (!Character.isLetter(search.charAt(idx)))
- {
- return -1;
- }
- break;
-
- case POSIX_CLASS_DIGIT:
- if (!Character.isDigit(search.charAt(idx)))
- {
- return -1;
- }
- break;
-
- case POSIX_CLASS_BLANK: // JWL - bugbug: is this right??
- if (!Character.isSpaceChar(search.charAt(idx)))
- {
- return -1;
- }
- break;
-
- case POSIX_CLASS_SPACE:
- if (!Character.isWhitespace(search.charAt(idx)))
- {
- return -1;
- }
- break;
-
- case POSIX_CLASS_CNTRL:
- if (Character.getType(search.charAt(idx)) != Character.CONTROL)
- {
- return -1;
- }
- break;
-
- case POSIX_CLASS_GRAPH: // JWL - bugbug???
- switch (Character.getType(search.charAt(idx)))
- {
- case Character.MATH_SYMBOL:
- case Character.CURRENCY_SYMBOL:
- case Character.MODIFIER_SYMBOL:
- case Character.OTHER_SYMBOL:
- break;
-
- default:
- return -1;
- }
- break;
-
- case POSIX_CLASS_LOWER:
- if (Character.getType(search.charAt(idx)) != Character.LOWERCASE_LETTER)
- {
- return -1;
- }
- break;
-
- case POSIX_CLASS_UPPER:
- if (Character.getType(search.charAt(idx)) != Character.UPPERCASE_LETTER)
- {
- return -1;
- }
- break;
-
- case POSIX_CLASS_PRINT:
- if (Character.getType(search.charAt(idx)) == Character.CONTROL)
- {
- return -1;
- }
- break;
-
- case POSIX_CLASS_PUNCT:
- {
- int type = Character.getType(search.charAt(idx));
- switch(type)
- {
- case Character.DASH_PUNCTUATION:
- case Character.START_PUNCTUATION:
- case Character.END_PUNCTUATION:
- case Character.CONNECTOR_PUNCTUATION:
- case Character.OTHER_PUNCTUATION:
- break;
-
- default:
- return -1;
- }
- }
- break;
-
- case POSIX_CLASS_XDIGIT: // JWL - bugbug??
- {
- boolean isXDigit = ((search.charAt(idx) >= '0' && search.charAt(idx) <= '9') ||
- (search.charAt(idx) >= 'a' && search.charAt(idx) <= 'f') ||
- (search.charAt(idx) >= 'A' && search.charAt(idx) <= 'F'));
- if (!isXDigit)
- {
- return -1;
- }
- }
- break;
-
- case POSIX_CLASS_JSTART:
- if (!Character.isJavaIdentifierStart(search.charAt(idx)))
- {
- return -1;
- }
- break;
-
- case POSIX_CLASS_JPART:
- if (!Character.isJavaIdentifierPart(search.charAt(idx)))
- {
- return -1;
- }
- break;
-
- default:
- internalError("Bad posix class");
- break;
- }
-
- // Matched.
- idx++;
- }
- break;
-
- case OP_ANYOF:
- {
- // Out of input?
- if (search.isEnd(idx))
- {
- return -1;
- }
-
- // Get character to match against character class and maybe casefold
- char c = search.charAt(idx);
- boolean caseFold = (matchFlags & MATCH_CASEINDEPENDENT) != 0;
- // Loop through character class checking our match character
- int idxRange = node + nodeSize;
- int idxEnd = idxRange + (opdata * 2);
- boolean match = false;
- for (int i = idxRange; !match && i < idxEnd; )
- {
- // Get start, end and match characters
- char s = instruction[i++];
- char e = instruction[i++];
-
- match = ((compareChars(c, s, caseFold) >= 0)
- && (compareChars(c, e, caseFold) <= 0));
- }
-
- // Fail if we didn't match the character class
- if (!match)
- {
- return -1;
- }
- idx++;
- }
- break;
-
- case OP_BRANCH:
- {
- // Check for choices
- if (instruction[next + offsetOpcode] != OP_BRANCH)
- {
- // If there aren't any other choices, just evaluate this branch.
- node += nodeSize;
- continue;
- }
-
- // Try all available branches
- short nextBranch;
- do
- {
- // Try matching the branch against the string
- if ((idxNew = matchNodes(node + nodeSize, maxNode, idx)) != -1)
- {
- return idxNew;
- }
-
- // Go to next branch (if any)
- nextBranch = (short)instruction[node + offsetNext];
- node += nextBranch;
- }
- while (nextBranch != 0 && (instruction[node + offsetOpcode] == OP_BRANCH));
-
- // Failed to match any branch!
- return -1;
- }
-
- case OP_NOTHING:
- case OP_GOTO:
-
- // Just advance to the next node without doing anything
- break;
-
- case OP_END:
-
- // Match has succeeded!
- setParenEnd(0, idx);
- return idx;
-
- default:
-
- // Corrupt program
- internalError("Invalid opcode '" + opcode + "'");
- }
-
- // Advance to the next node in the program
- node = next;
- }
-
- // We "should" never end up here
- internalError("Corrupt program");
- return -1;
- }
-
- /**
- * Match the current regular expression program against the current
- * input string, starting at index i of the input string. This method
- * is only meant for internal use.
- *
- * @param i The input string index to start matching at
- * @return True if the input matched the expression
- */
- protected boolean matchAt(int i)
- {
- // Initialize start pointer, paren cache and paren count
- start0 = -1;
- end0 = -1;
- start1 = -1;
- end1 = -1;
- start2 = -1;
- end2 = -1;
- startn = null;
- endn = null;
- parenCount = 1;
- setParenStart(0, i);
-
- // Allocate backref arrays (unless optimizations indicate otherwise)
- if ((program.flags & REProgram.OPT_HASBACKREFS) != 0)
- {
- startBackref = new int[maxParen];
- endBackref = new int[maxParen];
- }
-
- // Match against string
- int idx;
- if ((idx = matchNodes(0, maxNode, i)) != -1)
- {
- setParenEnd(0, idx);
- return true;
- }
-
- // Didn't match
- parenCount = 0;
- return false;
- }
-
- /**
- * Matches the current regular expression program against a character array,
- * starting at a given index.
- *
- * @param search String to match against
- * @param i Index to start searching at
- * @return True if string matched
- */
- public boolean match(String search, int i)
- {
- return match(new StringCharacterIterator(search), i);
- }
-
- /**
- * Matches the current regular expression program against a character array,
- * starting at a given index.
- *
- * @param search String to match against
- * @param i Index to start searching at
- * @return True if string matched
- */
- public boolean match(CharacterIterator search, int i)
- {
- // There is no compiled program to search with!
- if (program == null)
- {
- // This should be uncommon enough to be an error case rather
- // than an exception (which would have to be handled everywhere)
- internalError("No RE program to run!");
- }
-
- // Save string to search
- this.search = search;
-
- // Can we optimize the search by looking for a prefix string?
- if (program.prefix == null)
- {
- // Unprefixed matching must try for a match at each character
- for ( ;! search.isEnd(i - 1); i++)
- {
- // Try a match at index i
- if (matchAt(i))
- {
- return true;
- }
- }
- return false;
- }
- else
- {
- // Prefix-anchored matching is possible
- boolean caseIndependent = (matchFlags & MATCH_CASEINDEPENDENT) != 0;
- char[] prefix = program.prefix;
- for ( ; !search.isEnd(i + prefix.length - 1); i++)
- {
- int j = i;
- int k = 0;
-
- boolean match;
- do {
- // If there's a mismatch of any character in the prefix, give up
- match = (compareChars(search.charAt(j++), prefix[k++], caseIndependent) == 0);
- } while (match && k < prefix.length);
-
- // See if the whole prefix string matched
- if (k == prefix.length)
- {
- // We matched the full prefix at firstChar, so try it
- if (matchAt(i))
- {
- return true;
- }
- }
- }
- return false;
- }
- }
-
- /**
- * Matches the current regular expression program against a String.
- *
- * @param search String to match against
- * @return True if string matched
- */
- public boolean match(String search)
- {
- return match(search, 0);
- }
-
- /**
- * Splits a string into an array of strings on regular expression boundaries.
- * This function works the same way as the Perl function of the same name.
- * Given a regular expression of "[ab]+" and a string to split of
- * "xyzzyababbayyzabbbab123", the result would be the array of Strings
- * "[xyzzy, yyz, 123]".
- *
- * <p>Please note that the first string in the resulting array may be an empty
- * string. This happens when the very first character of input string is
- * matched by the pattern.
- *
- * @param s String to split on this regular exression
- * @return Array of strings
- */
- public String[] split(String s)
- {
- // Create new vector
- Vector v = new Vector();
-
- // Start at position 0 and search the whole string
- int pos = 0;
- int len = s.length();
-
- // Try a match at each position
- while (pos < len && match(s, pos))
- {
- // Get start of match
- int start = getParenStart(0);
-
- // Get end of match
- int newpos = getParenEnd(0);
-
- // Check if no progress was made
- if (newpos == pos)
- {
- v.addElement(s.substring(pos, start + 1));
- newpos++;
- }
- else
- {
- v.addElement(s.substring(pos, start));
- }
-
- // Move to new position
- pos = newpos;
- }
-
- // Push remainder if it's not empty
- String remainder = s.substring(pos);
- if (remainder.length() != 0)
- {
- v.addElement(remainder);
- }
-
- // Return vector as an array of strings
- String[] ret = new String[v.size()];
- v.copyInto(ret);
- return ret;
- }
-
- /**
- * Flag bit that indicates that subst should replace all occurrences of this
- * regular expression.
- */
- public static final int REPLACE_ALL = 0x0000;
-
- /**
- * Flag bit that indicates that subst should only replace the first occurrence
- * of this regular expression.
- */
- public static final int REPLACE_FIRSTONLY = 0x0001;
-
- /**
- * Flag bit that indicates that subst should replace backreferences
- */
- public static final int REPLACE_BACKREFERENCES = 0x0002;
-
- /**
- * Substitutes a string for this regular expression in another string.
- * This method works like the Perl function of the same name.
- * Given a regular expression of "a*b", a String to substituteIn of
- * "aaaabfooaaabgarplyaaabwackyb" and the substitution String "-", the
- * resulting String returned by subst would be "-foo-garply-wacky-".
- *
- * @param substituteIn String to substitute within
- * @param substitution String to substitute for all matches of this regular expression.
- * @return The string substituteIn with zero or more occurrences of the current
- * regular expression replaced with the substitution String (if this regular
- * expression object doesn't match at any position, the original String is returned
- * unchanged).
- */
- public String subst(String substituteIn, String substitution)
- {
- return subst(substituteIn, substitution, REPLACE_ALL);
- }
-
- /**
- * Substitutes a string for this regular expression in another string.
- * This method works like the Perl function of the same name.
- * Given a regular expression of "a*b", a String to substituteIn of
- * "aaaabfooaaabgarplyaaabwackyb" and the substitution String "-", the
- * resulting String returned by subst would be "-foo-garply-wacky-".
- * <p>
- * It is also possible to reference the contents of a parenthesized expression
- * with $0, $1, ... $9. A regular expression of "http://[\\.\\w\\-\\?/~_@&=%]+",
- * a String to substituteIn of "visit us: http://www.apache.org!" and the
- * substitution String "&lt;a href=\"$0\"&gt;$0&lt;/a&gt;", the resulting String
- * returned by subst would be
- * "visit us: &lt;a href=\"http://www.apache.org\"&gt;http://www.apache.org&lt;/a&gt;!".
- * <p>
- * <i>Note:</i> $0 represents the whole match.
- *
- * @param substituteIn String to substitute within
- * @param substitution String to substitute for matches of this regular expression
- * @param flags One or more bitwise flags from REPLACE_*. If the REPLACE_FIRSTONLY
- * flag bit is set, only the first occurrence of this regular expression is replaced.
- * If the bit is not set (REPLACE_ALL), all occurrences of this pattern will be
- * replaced. If the flag REPLACE_BACKREFERENCES is set, all backreferences will
- * be processed.
- * @return The string substituteIn with zero or more occurrences of the current
- * regular expression replaced with the substitution String (if this regular
- * expression object doesn't match at any position, the original String is returned
- * unchanged).
- */
- public String subst(String substituteIn, String substitution, int flags)
- {
- // String to return
- StringBuffer ret = new StringBuffer();
-
- // Start at position 0 and search the whole string
- int pos = 0;
- int len = substituteIn.length();
-
- // Try a match at each position
- while (pos < len && match(substituteIn, pos))
- {
- // Append string before match
- ret.append(substituteIn.substring(pos, getParenStart(0)));
-
- if ((flags & REPLACE_BACKREFERENCES) != 0)
- {
- // Process backreferences
- int lCurrentPosition = 0;
- int lLastPosition = -2;
- int lLength = substitution.length();
- boolean bAddedPrefix = false;
-
- while ((lCurrentPosition = substitution.indexOf("$", lCurrentPosition)) >= 0)
- {
- if ((lCurrentPosition == 0 || substitution.charAt(lCurrentPosition - 1) != '\\')
- && lCurrentPosition+1 < lLength)
- {
- char c = substitution.charAt(lCurrentPosition + 1);
- if (c >= '0' && c <= '9')
- {
- if (bAddedPrefix == false)
- {
- // Append everything between the beginning of the
- // substitution string and the current $ sign
- ret.append(substitution.substring(0, lCurrentPosition));
- bAddedPrefix = true;
- }
- else
- {
- // Append everything between the last and the current $ sign
- ret.append(substitution.substring(lLastPosition + 2, lCurrentPosition));
- }
-
- // Append the parenthesized expression
- // Note: if a parenthesized expression of the requested
- // index is not available "null" is added to the string
- ret.append(getParen(c - '0'));
- lLastPosition = lCurrentPosition;
- }
- }
-
- // Move forward, skipping past match
- lCurrentPosition++;
- }
-
- // Append everything after the last $ sign
- ret.append(substitution.substring(lLastPosition + 2, lLength));
- }
- else
- {
- // Append substitution without processing backreferences
- ret.append(substitution);
- }
-
- // Move forward, skipping past match
- int newpos = getParenEnd(0);
-
- // We always want to make progress!
- if (newpos == pos)
- {
- newpos++;
- }
-
- // Try new position
- pos = newpos;
-
- // Break out if we're only supposed to replace one occurrence
- if ((flags & REPLACE_FIRSTONLY) != 0)
- {
- break;
- }
- }
-
- // If there's remaining input, append it
- if (pos < len)
- {
- ret.append(substituteIn.substring(pos));
- }
-
- // Return string buffer as string
- return ret.toString();
- }
-
- /**
- * Returns an array of Strings, whose toString representation matches a regular
- * expression. This method works like the Perl function of the same name. Given
- * a regular expression of "a*b" and an array of String objects of [foo, aab, zzz,
- * aaaab], the array of Strings returned by grep would be [aab, aaaab].
- *
- * @param search Array of Objects to search
- * @return Array of Strings whose toString() value matches this regular expression.
- */
- public String[] grep(Object[] search)
- {
- // Create new vector to hold return items
- Vector v = new Vector();
-
- // Traverse array of objects
- for (int i = 0; i < search.length; i++)
- {
- // Get next object as a string
- String s = search[i].toString();
-
- // If it matches this regexp, add it to the list
- if (match(s))
- {
- v.addElement(s);
- }
- }
-
- // Return vector as an array of strings
- String[] ret = new String[v.size()];
- v.copyInto(ret);
- return ret;
- }
-
- /**
- * @return true if character at i-th position in the <code>search</code> string is a newline
- */
- private boolean isNewline(int i)
- {
- char nextChar = search.charAt(i);
-
- if (nextChar == '\n' || nextChar == '\r' || nextChar == '\u0085'
- || nextChar == '\u2028' || nextChar == '\u2029')
- {
- return true;
- }
-
- return false;
- }
-
- /**
- * Compares two characters.
- *
- * @param c1 first character to compare.
- * @param c2 second character to compare.
- * @param caseIndependent whether comparision is case insensitive or not.
- * @return negative, 0, or positive integer as the first character
- * less than, equal to, or greater then the second.
- */
- private int compareChars(char c1, char c2, boolean caseIndependent)
- {
- if (caseIndependent)
- {
- c1 = Character.toLowerCase(c1);
- c2 = Character.toLowerCase(c2);
- }
- return ((int)c1 - (int)c2);
- }
-}
diff --git a/src/com/sun/org/apache/regexp/internal/RECompiler.java b/src/com/sun/org/apache/regexp/internal/RECompiler.java
deleted file mode 100644
index 23874ee..0000000
--- a/src/com/sun/org/apache/regexp/internal/RECompiler.java
+++ /dev/null
@@ -1,1520 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.regexp.internal;
-
-import com.sun.org.apache.regexp.internal.RE;
-import java.util.Hashtable;
-
-/**
- * A regular expression compiler class. This class compiles a pattern string into a
- * regular expression program interpretable by the RE evaluator class. The 'recompile'
- * command line tool uses this compiler to pre-compile regular expressions for use
- * with RE. For a description of the syntax accepted by RECompiler and what you can
- * do with regular expressions, see the documentation for the RE matcher class.
- *
- * @see RE
- * @see recompile
- *
- * @author <a href="mailto:jonl@muppetlabs.com">Jonathan Locke</a>
- * @author <a href="mailto:gholam@xtra.co.nz">Michael McCallum</a>
- */
-public class RECompiler
-{
- // The compiled program
- char[] instruction; // The compiled RE 'program' instruction buffer
- int lenInstruction; // The amount of the program buffer currently in use
-
- // Input state for compiling regular expression
- String pattern; // Input string
- int len; // Length of the pattern string
- int idx; // Current input index into ac
- int parens; // Total number of paren pairs
-
- // Node flags
- static final int NODE_NORMAL = 0; // No flags (nothing special)
- static final int NODE_NULLABLE = 1; // True if node is potentially null
- static final int NODE_TOPLEVEL = 2; // True if top level expr
-
- // Special types of 'escapes'
- static final int ESC_MASK = 0xffff0; // Escape complexity mask
- static final int ESC_BACKREF = 0xfffff; // Escape is really a backreference
- static final int ESC_COMPLEX = 0xffffe; // Escape isn't really a true character
- static final int ESC_CLASS = 0xffffd; // Escape represents a whole class of characters
-
- // {m,n} stacks
- int maxBrackets = 10; // Maximum number of bracket pairs
- static final int bracketUnbounded = -1; // Unbounded value
- int brackets = 0; // Number of bracket sets
- int[] bracketStart = null; // Starting point
- int[] bracketEnd = null; // Ending point
- int[] bracketMin = null; // Minimum number of matches
- int[] bracketOpt = null; // Additional optional matches
-
- // Lookup table for POSIX character class names
- static Hashtable hashPOSIX = new Hashtable();
- static
- {
- hashPOSIX.put("alnum", new Character(RE.POSIX_CLASS_ALNUM));
- hashPOSIX.put("alpha", new Character(RE.POSIX_CLASS_ALPHA));
- hashPOSIX.put("blank", new Character(RE.POSIX_CLASS_BLANK));
- hashPOSIX.put("cntrl", new Character(RE.POSIX_CLASS_CNTRL));
- hashPOSIX.put("digit", new Character(RE.POSIX_CLASS_DIGIT));
- hashPOSIX.put("graph", new Character(RE.POSIX_CLASS_GRAPH));
- hashPOSIX.put("lower", new Character(RE.POSIX_CLASS_LOWER));
- hashPOSIX.put("print", new Character(RE.POSIX_CLASS_PRINT));
- hashPOSIX.put("punct", new Character(RE.POSIX_CLASS_PUNCT));
- hashPOSIX.put("space", new Character(RE.POSIX_CLASS_SPACE));
- hashPOSIX.put("upper", new Character(RE.POSIX_CLASS_UPPER));
- hashPOSIX.put("xdigit", new Character(RE.POSIX_CLASS_XDIGIT));
- hashPOSIX.put("javastart", new Character(RE.POSIX_CLASS_JSTART));
- hashPOSIX.put("javapart", new Character(RE.POSIX_CLASS_JPART));
- }
-
- /**
- * Constructor. Creates (initially empty) storage for a regular expression program.
- */
- public RECompiler()
- {
- // Start off with a generous, yet reasonable, initial size
- instruction = new char[128];
- lenInstruction = 0;
- }
-
- /**
- * Ensures that n more characters can fit in the program buffer.
- * If n more can't fit, then the size is doubled until it can.
- * @param n Number of additional characters to ensure will fit.
- */
- void ensure(int n)
- {
- // Get current program length
- int curlen = instruction.length;
-
- // If the current length + n more is too much
- if (lenInstruction + n >= curlen)
- {
- // Double the size of the program array until n more will fit
- while (lenInstruction + n >= curlen)
- {
- curlen *= 2;
- }
-
- // Allocate new program array and move data into it
- char[] newInstruction = new char[curlen];
- System.arraycopy(instruction, 0, newInstruction, 0, lenInstruction);
- instruction = newInstruction;
- }
- }
-
- /**
- * Emit a single character into the program stream.
- * @param c Character to add
- */
- void emit(char c)
- {
- // Make room for character
- ensure(1);
-
- // Add character
- instruction[lenInstruction++] = c;
- }
-
- /**
- * Inserts a node with a given opcode and opdata at insertAt. The node relative next
- * pointer is initialized to 0.
- * @param opcode Opcode for new node
- * @param opdata Opdata for new node (only the low 16 bits are currently used)
- * @param insertAt Index at which to insert the new node in the program
- */
- void nodeInsert(char opcode, int opdata, int insertAt)
- {
- // Make room for a new node
- ensure(RE.nodeSize);
-
- // Move everything from insertAt to the end down nodeSize elements
- System.arraycopy(instruction, insertAt, instruction, insertAt + RE.nodeSize, lenInstruction - insertAt);
- instruction[insertAt + RE.offsetOpcode] = opcode;
- instruction[insertAt + RE.offsetOpdata] = (char)opdata;
- instruction[insertAt + RE.offsetNext] = 0;
- lenInstruction += RE.nodeSize;
- }
-
- /**
- * Appends a node to the end of a node chain
- * @param node Start of node chain to traverse
- * @param pointTo Node to have the tail of the chain point to
- */
- void setNextOfEnd(int node, int pointTo)
- {
- // Traverse the chain until the next offset is 0
- int next = instruction[node + RE.offsetNext];
- // while the 'node' is not the last in the chain
- // and the 'node' is not the last in the program.
- while ( next != 0 && node < lenInstruction )
- {
- // if the node we are supposed to point to is in the chain then
- // point to the end of the program instead.
- // Michael McCallum <gholam@xtra.co.nz>
- // FIXME: // This is a _hack_ to stop infinite programs.
- // I believe that the implementation of the reluctant matches is wrong but
- // have not worked out a better way yet.
- if ( node == pointTo ) {
- pointTo = lenInstruction;
- }
- node += next;
- next = instruction[node + RE.offsetNext];
- }
- // if we have reached the end of the program then dont set the pointTo.
- // im not sure if this will break any thing but passes all the tests.
- if ( node < lenInstruction ) {
- // Point the last node in the chain to pointTo.
- instruction[node + RE.offsetNext] = (char)(short)(pointTo - node);
- }
- }
-
- /**
- * Adds a new node
- * @param opcode Opcode for node
- * @param opdata Opdata for node (only the low 16 bits are currently used)
- * @return Index of new node in program
- */
- int node(char opcode, int opdata)
- {
- // Make room for a new node
- ensure(RE.nodeSize);
-
- // Add new node at end
- instruction[lenInstruction + RE.offsetOpcode] = opcode;
- instruction[lenInstruction + RE.offsetOpdata] = (char)opdata;
- instruction[lenInstruction + RE.offsetNext] = 0;
- lenInstruction += RE.nodeSize;
-
- // Return index of new node
- return lenInstruction - RE.nodeSize;
- }
-
-
- /**
- * Throws a new internal error exception
- * @exception Error Thrown in the event of an internal error.
- */
- void internalError() throws Error
- {
- throw new Error("Internal error!");
- }
-
- /**
- * Throws a new syntax error exception
- * @exception RESyntaxException Thrown if the regular expression has invalid syntax.
- */
- void syntaxError(String s) throws RESyntaxException
- {
- throw new RESyntaxException(s);
- }
-
- /**
- * Allocate storage for brackets only as needed
- */
- void allocBrackets()
- {
- // Allocate bracket stacks if not already done
- if (bracketStart == null)
- {
- // Allocate storage
- bracketStart = new int[maxBrackets];
- bracketEnd = new int[maxBrackets];
- bracketMin = new int[maxBrackets];
- bracketOpt = new int[maxBrackets];
-
- // Initialize to invalid values
- for (int i = 0; i < maxBrackets; i++)
- {
- bracketStart[i] = bracketEnd[i] = bracketMin[i] = bracketOpt[i] = -1;
- }
- }
- }
-
- /** Enlarge storage for brackets only as needed. */
- synchronized void reallocBrackets() {
- // trick the tricky
- if (bracketStart == null) {
- allocBrackets();
- }
-
- int new_size = maxBrackets * 2;
- int[] new_bS = new int[new_size];
- int[] new_bE = new int[new_size];
- int[] new_bM = new int[new_size];
- int[] new_bO = new int[new_size];
- // Initialize to invalid values
- for (int i=brackets; i<new_size; i++) {
- new_bS[i] = new_bE[i] = new_bM[i] = new_bO[i] = -1;
- }
- System.arraycopy(bracketStart,0, new_bS,0, brackets);
- System.arraycopy(bracketEnd,0, new_bE,0, brackets);
- System.arraycopy(bracketMin,0, new_bM,0, brackets);
- System.arraycopy(bracketOpt,0, new_bO,0, brackets);
- bracketStart = new_bS;
- bracketEnd = new_bE;
- bracketMin = new_bM;
- bracketOpt = new_bO;
- maxBrackets = new_size;
- }
-
- /**
- * Match bracket {m,n} expression put results in bracket member variables
- * @exception RESyntaxException Thrown if the regular expression has invalid syntax.
- */
- void bracket() throws RESyntaxException
- {
- // Current character must be a '{'
- if (idx >= len || pattern.charAt(idx++) != '{')
- {
- internalError();
- }
-
- // Next char must be a digit
- if (idx >= len || !Character.isDigit(pattern.charAt(idx)))
- {
- syntaxError("Expected digit");
- }
-
- // Get min ('m' of {m,n}) number
- StringBuffer number = new StringBuffer();
- while (idx < len && Character.isDigit(pattern.charAt(idx)))
- {
- number.append(pattern.charAt(idx++));
- }
- try
- {
- bracketMin[brackets] = Integer.parseInt(number.toString());
- }
- catch (NumberFormatException e)
- {
- syntaxError("Expected valid number");
- }
-
- // If out of input, fail
- if (idx >= len)
- {
- syntaxError("Expected comma or right bracket");
- }
-
- // If end of expr, optional limit is 0
- if (pattern.charAt(idx) == '}')
- {
- idx++;
- bracketOpt[brackets] = 0;
- return;
- }
-
- // Must have at least {m,} and maybe {m,n}.
- if (idx >= len || pattern.charAt(idx++) != ',')
- {
- syntaxError("Expected comma");
- }
-
- // If out of input, fail
- if (idx >= len)
- {
- syntaxError("Expected comma or right bracket");
- }
-
- // If {m,} max is unlimited
- if (pattern.charAt(idx) == '}')
- {
- idx++;
- bracketOpt[brackets] = bracketUnbounded;
- return;
- }
-
- // Next char must be a digit
- if (idx >= len || !Character.isDigit(pattern.charAt(idx)))
- {
- syntaxError("Expected digit");
- }
-
- // Get max number
- number.setLength(0);
- while (idx < len && Character.isDigit(pattern.charAt(idx)))
- {
- number.append(pattern.charAt(idx++));
- }
- try
- {
- bracketOpt[brackets] = Integer.parseInt(number.toString()) - bracketMin[brackets];
- }
- catch (NumberFormatException e)
- {
- syntaxError("Expected valid number");
- }
-
- // Optional repetitions must be >= 0
- if (bracketOpt[brackets] < 0)
- {
- syntaxError("Bad range");
- }
-
- // Must have close brace
- if (idx >= len || pattern.charAt(idx++) != '}')
- {
- syntaxError("Missing close brace");
- }
- }
-
- /**
- * Match an escape sequence. Handles quoted chars and octal escapes as well
- * as normal escape characters. Always advances the input stream by the
- * right amount. This code "understands" the subtle difference between an
- * octal escape and a backref. You can access the type of ESC_CLASS or
- * ESC_COMPLEX or ESC_BACKREF by looking at pattern[idx - 1].
- * @return ESC_* code or character if simple escape
- * @exception RESyntaxException Thrown if the regular expression has invalid syntax.
- */
- int escape() throws RESyntaxException
- {
- // "Shouldn't" happen
- if (pattern.charAt(idx) != '\\')
- {
- internalError();
- }
-
- // Escape shouldn't occur as last character in string!
- if (idx + 1 == len)
- {
- syntaxError("Escape terminates string");
- }
-
- // Switch on character after backslash
- idx += 2;
- char escapeChar = pattern.charAt(idx - 1);
- switch (escapeChar)
- {
- case RE.E_BOUND:
- case RE.E_NBOUND:
- return ESC_COMPLEX;
-
- case RE.E_ALNUM:
- case RE.E_NALNUM:
- case RE.E_SPACE:
- case RE.E_NSPACE:
- case RE.E_DIGIT:
- case RE.E_NDIGIT:
- return ESC_CLASS;
-
- case 'u':
- case 'x':
- {
- // Exact required hex digits for escape type
- int hexDigits = (escapeChar == 'u' ? 4 : 2);
-
- // Parse up to hexDigits characters from input
- int val = 0;
- for ( ; idx < len && hexDigits-- > 0; idx++)
- {
- // Get char
- char c = pattern.charAt(idx);
-
- // If it's a hexadecimal digit (0-9)
- if (c >= '0' && c <= '9')
- {
- // Compute new value
- val = (val << 4) + c - '0';
- }
- else
- {
- // If it's a hexadecimal letter (a-f)
- c = Character.toLowerCase(c);
- if (c >= 'a' && c <= 'f')
- {
- // Compute new value
- val = (val << 4) + (c - 'a') + 10;
- }
- else
- {
- // If it's not a valid digit or hex letter, the escape must be invalid
- // because hexDigits of input have not been absorbed yet.
- syntaxError("Expected " + hexDigits + " hexadecimal digits after \\" + escapeChar);
- }
- }
- }
- return val;
- }
-
- case 't':
- return '\t';
-
- case 'n':
- return '\n';
-
- case 'r':
- return '\r';
-
- case 'f':
- return '\f';
-
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
-
- // An octal escape starts with a 0 or has two digits in a row
- if ((idx < len && Character.isDigit(pattern.charAt(idx))) || escapeChar == '0')
- {
- // Handle \nnn octal escapes
- int val = escapeChar - '0';
- if (idx < len && Character.isDigit(pattern.charAt(idx)))
- {
- val = ((val << 3) + (pattern.charAt(idx++) - '0'));
- if (idx < len && Character.isDigit(pattern.charAt(idx)))
- {
- val = ((val << 3) + (pattern.charAt(idx++) - '0'));
- }
- }
- return val;
- }
-
- // It's actually a backreference (\[1-9]), not an escape
- return ESC_BACKREF;
-
- default:
-
- // Simple quoting of a character
- return escapeChar;
- }
- }
-
- /**
- * Compile a character class
- * @return Index of class node
- * @exception RESyntaxException Thrown if the regular expression has invalid syntax.
- */
- int characterClass() throws RESyntaxException
- {
- // Check for bad calling or empty class
- if (pattern.charAt(idx) != '[')
- {
- internalError();
- }
-
- // Check for unterminated or empty class
- if ((idx + 1) >= len || pattern.charAt(++idx) == ']')
- {
- syntaxError("Empty or unterminated class");
- }
-
- // Check for POSIX character class
- if (idx < len && pattern.charAt(idx) == ':')
- {
- // Skip colon
- idx++;
-
- // POSIX character classes are denoted with lowercase ASCII strings
- int idxStart = idx;
- while (idx < len && pattern.charAt(idx) >= 'a' && pattern.charAt(idx) <= 'z')
- {
- idx++;
- }
-
- // Should be a ":]" to terminate the POSIX character class
- if ((idx + 1) < len && pattern.charAt(idx) == ':' && pattern.charAt(idx + 1) == ']')
- {
- // Get character class
- String charClass = pattern.substring(idxStart, idx);
-
- // Select the POSIX class id
- Character i = (Character)hashPOSIX.get(charClass);
- if (i != null)
- {
- // Move past colon and right bracket
- idx += 2;
-
- // Return new POSIX character class node
- return node(RE.OP_POSIXCLASS, i.charValue());
- }
- syntaxError("Invalid POSIX character class '" + charClass + "'");
- }
- syntaxError("Invalid POSIX character class syntax");
- }
-
- // Try to build a class. Create OP_ANYOF node
- int ret = node(RE.OP_ANYOF, 0);
-
- // Parse class declaration
- char CHAR_INVALID = Character.MAX_VALUE;
- char last = CHAR_INVALID;
- char simpleChar = 0;
- boolean include = true;
- boolean definingRange = false;
- int idxFirst = idx;
- char rangeStart = Character.MIN_VALUE;
- char rangeEnd;
- RERange range = new RERange();
- while (idx < len && pattern.charAt(idx) != ']')
- {
-
- switchOnCharacter:
-
- // Switch on character
- switch (pattern.charAt(idx))
- {
- case '^':
- include = !include;
- if (idx == idxFirst)
- {
- range.include(Character.MIN_VALUE, Character.MAX_VALUE, true);
- }
- idx++;
- continue;
-
- case '\\':
- {
- // Escape always advances the stream
- int c;
- switch (c = escape ())
- {
- case ESC_COMPLEX:
- case ESC_BACKREF:
-
- // Word boundaries and backrefs not allowed in a character class!
- syntaxError("Bad character class");
-
- case ESC_CLASS:
-
- // Classes can't be an endpoint of a range
- if (definingRange)
- {
- syntaxError("Bad character class");
- }
-
- // Handle specific type of class (some are ok)
- switch (pattern.charAt(idx - 1))
- {
- case RE.E_NSPACE:
- case RE.E_NDIGIT:
- case RE.E_NALNUM:
- syntaxError("Bad character class");
-
- case RE.E_SPACE:
- range.include('\t', include);
- range.include('\r', include);
- range.include('\f', include);
- range.include('\n', include);
- range.include('\b', include);
- range.include(' ', include);
- break;
-
- case RE.E_ALNUM:
- range.include('a', 'z', include);
- range.include('A', 'Z', include);
- range.include('_', include);
-
- // Fall through!
-
- case RE.E_DIGIT:
- range.include('0', '9', include);
- break;
- }
-
- // Make last char invalid (can't be a range start)
- last = CHAR_INVALID;
- break;
-
- default:
-
- // Escape is simple so treat as a simple char
- simpleChar = (char) c;
- break switchOnCharacter;
- }
- }
- continue;
-
- case '-':
-
- // Start a range if one isn't already started
- if (definingRange)
- {
- syntaxError("Bad class range");
- }
- definingRange = true;
-
- // If no last character, start of range is 0
- rangeStart = (last == CHAR_INVALID ? 0 : last);
-
- // Premature end of range. define up to Character.MAX_VALUE
- if ((idx + 1) < len && pattern.charAt(++idx) == ']')
- {
- simpleChar = Character.MAX_VALUE;
- break;
- }
- continue;
-
- default:
- simpleChar = pattern.charAt(idx++);
- break;
- }
-
- // Handle simple character simpleChar
- if (definingRange)
- {
- // if we are defining a range make it now
- rangeEnd = simpleChar;
-
- // Actually create a range if the range is ok
- if (rangeStart >= rangeEnd)
- {
- syntaxError("Bad character class");
- }
- range.include(rangeStart, rangeEnd, include);
-
- // We are done defining the range
- last = CHAR_INVALID;
- definingRange = false;
- }
- else
- {
- // If simple character and not start of range, include it
- if (idx >= len || pattern.charAt(idx) != '-')
- {
- range.include(simpleChar, include);
- }
- last = simpleChar;
- }
- }
-
- // Shouldn't be out of input
- if (idx == len)
- {
- syntaxError("Unterminated character class");
- }
-
- // Absorb the ']' end of class marker
- idx++;
-
- // Emit character class definition
- instruction[ret + RE.offsetOpdata] = (char)range.num;
- for (int i = 0; i < range.num; i++)
- {
- emit((char)range.minRange[i]);
- emit((char)range.maxRange[i]);
- }
- return ret;
- }
-
- /**
- * Absorb an atomic character string. This method is a little tricky because
- * it can un-include the last character of string if a closure operator follows.
- * This is correct because *+? have higher precedence than concatentation (thus
- * ABC* means AB(C*) and NOT (ABC)*).
- * @return Index of new atom node
- * @exception RESyntaxException Thrown if the regular expression has invalid syntax.
- */
- int atom() throws RESyntaxException
- {
- // Create a string node
- int ret = node(RE.OP_ATOM, 0);
-
- // Length of atom
- int lenAtom = 0;
-
- // Loop while we've got input
-
- atomLoop:
-
- while (idx < len)
- {
- // Is there a next char?
- if ((idx + 1) < len)
- {
- char c = pattern.charAt(idx + 1);
-
- // If the next 'char' is an escape, look past the whole escape
- if (pattern.charAt(idx) == '\\')
- {
- int idxEscape = idx;
- escape();
- if (idx < len)
- {
- c = pattern.charAt(idx);
- }
- idx = idxEscape;
- }
-
- // Switch on next char
- switch (c)
- {
- case '{':
- case '?':
- case '*':
- case '+':
-
- // If the next character is a closure operator and our atom is non-empty, the
- // current character should bind to the closure operator rather than the atom
- if (lenAtom != 0)
- {
- break atomLoop;
- }
- }
- }
-
- // Switch on current char
- switch (pattern.charAt(idx))
- {
- case ']':
- case '^':
- case '$':
- case '.':
- case '[':
- case '(':
- case ')':
- case '|':
- break atomLoop;
-
- case '{':
- case '?':
- case '*':
- case '+':
-
- // We should have an atom by now
- if (lenAtom == 0)
- {
- // No atom before closure
- syntaxError("Missing operand to closure");
- }
- break atomLoop;
-
- case '\\':
-
- {
- // Get the escaped character (advances input automatically)
- int idxBeforeEscape = idx;
- int c = escape();
-
- // Check if it's a simple escape (as opposed to, say, a backreference)
- if ((c & ESC_MASK) == ESC_MASK)
- {
- // Not a simple escape, so backup to where we were before the escape.
- idx = idxBeforeEscape;
- break atomLoop;
- }
-
- // Add escaped char to atom
- emit((char) c);
- lenAtom++;
- }
- break;
-
- default:
-
- // Add normal character to atom
- emit(pattern.charAt(idx++));
- lenAtom++;
- break;
- }
- }
-
- // This "shouldn't" happen
- if (lenAtom == 0)
- {
- internalError();
- }
-
- // Emit the atom length into the program
- instruction[ret + RE.offsetOpdata] = (char)lenAtom;
- return ret;
- }
-
- /**
- * Match a terminal node.
- * @param flags Flags
- * @return Index of terminal node (closeable)
- * @exception RESyntaxException Thrown if the regular expression has invalid syntax.
- */
- int terminal(int[] flags) throws RESyntaxException
- {
- switch (pattern.charAt(idx))
- {
- case RE.OP_EOL:
- case RE.OP_BOL:
- case RE.OP_ANY:
- return node(pattern.charAt(idx++), 0);
-
- case '[':
- return characterClass();
-
- case '(':
- return expr(flags);
-
- case ')':
- syntaxError("Unexpected close paren");
-
- case '|':
- internalError();
-
- case ']':
- syntaxError("Mismatched class");
-
- case 0:
- syntaxError("Unexpected end of input");
-
- case '?':
- case '+':
- case '{':
- case '*':
- syntaxError("Missing operand to closure");
-
- case '\\':
- {
- // Don't forget, escape() advances the input stream!
- int idxBeforeEscape = idx;
-
- // Switch on escaped character
- switch (escape())
- {
- case ESC_CLASS:
- case ESC_COMPLEX:
- flags[0] &= ~NODE_NULLABLE;
- return node(RE.OP_ESCAPE, pattern.charAt(idx - 1));
-
- case ESC_BACKREF:
- {
- char backreference = (char)(pattern.charAt(idx - 1) - '0');
- if (parens <= backreference)
- {
- syntaxError("Bad backreference");
- }
- flags[0] |= NODE_NULLABLE;
- return node(RE.OP_BACKREF, backreference);
- }
-
- default:
-
- // We had a simple escape and we want to have it end up in
- // an atom, so we back up and fall though to the default handling
- idx = idxBeforeEscape;
- flags[0] &= ~NODE_NULLABLE;
- break;
- }
- }
- }
-
- // Everything above either fails or returns.
- // If it wasn't one of the above, it must be the start of an atom.
- flags[0] &= ~NODE_NULLABLE;
- return atom();
- }
-
- /**
- * Compile a possibly closured terminal
- * @param flags Flags passed by reference
- * @return Index of closured node
- * @exception RESyntaxException Thrown if the regular expression has invalid syntax.
- */
- int closure(int[] flags) throws RESyntaxException
- {
- // Before terminal
- int idxBeforeTerminal = idx;
-
- // Values to pass by reference to terminal()
- int[] terminalFlags = { NODE_NORMAL };
-
- // Get terminal symbol
- int ret = terminal(terminalFlags);
-
- // Or in flags from terminal symbol
- flags[0] |= terminalFlags[0];
-
- // Advance input, set NODE_NULLABLE flag and do sanity checks
- if (idx >= len)
- {
- return ret;
- }
- boolean greedy = true;
- char closureType = pattern.charAt(idx);
- switch (closureType)
- {
- case '?':
- case '*':
-
- // The current node can be null
- flags[0] |= NODE_NULLABLE;
-
- case '+':
-
- // Eat closure character
- idx++;
-
- case '{':
-
- // Don't allow blantant stupidity
- int opcode = instruction[ret + RE.offsetOpcode];
- if (opcode == RE.OP_BOL || opcode == RE.OP_EOL)
- {
- syntaxError("Bad closure operand");
- }
- if ((terminalFlags[0] & NODE_NULLABLE) != 0)
- {
- syntaxError("Closure operand can't be nullable");
- }
- break;
- }
-
- // If the next character is a '?', make the closure non-greedy (reluctant)
- if (idx < len && pattern.charAt(idx) == '?')
- {
- idx++;
- greedy = false;
- }
-
- if (greedy)
- {
- // Actually do the closure now
- switch (closureType)
- {
- case '{':
- {
- // We look for our bracket in the list
- boolean found = false;
- int i;
- allocBrackets();
- for (i = 0; i < brackets; i++)
- {
- if (bracketStart[i] == idx)
- {
- found = true;
- break;
- }
- }
-
- // If its not in the list we parse the {m,n}
- if (!found)
- {
- if (brackets >= maxBrackets)
- {
- reallocBrackets();
- }
- bracketStart[brackets] = idx;
- bracket();
- bracketEnd[brackets] = idx;
- i = brackets++;
- }
-
- // Process min first
- if (bracketMin[i]-- > 0)
- {
- if (bracketMin[i] > 0 || bracketOpt[i] != 0) {
- // Rewind stream and run it through again - more matchers coming
- for (int j = 0; j < brackets; j++) {
- if (j != i && bracketStart[j] < idx
- && bracketStart[j] >= idxBeforeTerminal)
- {
- brackets--;
- bracketStart[j] = bracketStart[brackets];
- bracketEnd[j] = bracketEnd[brackets];
- bracketMin[j] = bracketMin[brackets];
- bracketOpt[j] = bracketOpt[brackets];
- }
- }
-
- idx = idxBeforeTerminal;
- } else {
- // Bug #1030: No optinal matches - no need to rewind
- idx = bracketEnd[i];
- }
- break;
- }
-
- // Do the right thing for maximum ({m,})
- if (bracketOpt[i] == bracketUnbounded)
- {
- // Drop through now and closure expression.
- // We are done with the {m,} expr, so skip rest
- closureType = '*';
- bracketOpt[i] = 0;
- idx = bracketEnd[i];
- }
- else
- if (bracketOpt[i]-- > 0)
- {
- if (bracketOpt[i] > 0)
- {
- // More optional matchers - 'play it again sam!'
- idx = idxBeforeTerminal;
- } else {
- // Bug #1030: We are done - this one is last and optional
- idx = bracketEnd[i];
- }
- // Drop through to optionally close
- closureType = '?';
- }
- else
- {
- // Rollback terminal - neither min nor opt matchers present
- lenInstruction = ret;
- node(RE.OP_NOTHING, 0);
-
- // We are done. skip the rest of {m,n} expr
- idx = bracketEnd[i];
- break;
- }
- }
-
- // Fall through!
-
- case '?':
- case '*':
-
- if (!greedy)
- {
- break;
- }
-
- if (closureType == '?')
- {
- // X? is compiled as (X|)
- nodeInsert(RE.OP_BRANCH, 0, ret); // branch before X
- setNextOfEnd(ret, node (RE.OP_BRANCH, 0)); // inserted branch to option
- int nothing = node (RE.OP_NOTHING, 0); // which is OP_NOTHING
- setNextOfEnd(ret, nothing); // point (second) branch to OP_NOTHING
- setNextOfEnd(ret + RE.nodeSize, nothing); // point the end of X to OP_NOTHING node
- }
-
- if (closureType == '*')
- {
- // X* is compiled as (X{gotoX}|)
- nodeInsert(RE.OP_BRANCH, 0, ret); // branch before X
- setNextOfEnd(ret + RE.nodeSize, node(RE.OP_BRANCH, 0)); // end of X points to an option
- setNextOfEnd(ret + RE.nodeSize, node(RE.OP_GOTO, 0)); // to goto
- setNextOfEnd(ret + RE.nodeSize, ret); // the start again
- setNextOfEnd(ret, node(RE.OP_BRANCH, 0)); // the other option is
- setNextOfEnd(ret, node(RE.OP_NOTHING, 0)); // OP_NOTHING
- }
- break;
-
- case '+':
- {
- // X+ is compiled as X({gotoX}|)
- int branch;
- branch = node(RE.OP_BRANCH, 0); // a new branch
- setNextOfEnd(ret, branch); // is added to the end of X
- setNextOfEnd(node(RE.OP_GOTO, 0), ret); // one option is to go back to the start
- setNextOfEnd(branch, node(RE.OP_BRANCH, 0)); // the other option
- setNextOfEnd(ret, node(RE.OP_NOTHING, 0)); // is OP_NOTHING
- }
- break;
- }
- }
- else
- {
- // Add end after closured subexpr
- setNextOfEnd(ret, node(RE.OP_END, 0));
-
- // Actually do the closure now
- switch (closureType)
- {
- case '?':
- nodeInsert(RE.OP_RELUCTANTMAYBE, 0, ret);
- break;
-
- case '*':
- nodeInsert(RE.OP_RELUCTANTSTAR, 0, ret);
- break;
-
- case '+':
- nodeInsert(RE.OP_RELUCTANTPLUS, 0, ret);
- break;
- }
-
- // Point to the expr after the closure
- setNextOfEnd(ret, lenInstruction);
- }
- return ret;
- }
-
- /**
- * Compile one branch of an or operator (implements concatenation)
- * @param flags Flags passed by reference
- * @return Pointer to branch node
- * @exception RESyntaxException Thrown if the regular expression has invalid syntax.
- */
- int branch(int[] flags) throws RESyntaxException
- {
- // Get each possibly closured piece and concat
- int node;
- int ret = node(RE.OP_BRANCH, 0);
- int chain = -1;
- int[] closureFlags = new int[1];
- boolean nullable = true;
- while (idx < len && pattern.charAt(idx) != '|' && pattern.charAt(idx) != ')')
- {
- // Get new node
- closureFlags[0] = NODE_NORMAL;
- node = closure(closureFlags);
- if (closureFlags[0] == NODE_NORMAL)
- {
- nullable = false;
- }
-
- // If there's a chain, append to the end
- if (chain != -1)
- {
- setNextOfEnd(chain, node);
- }
-
- // Chain starts at current
- chain = node;
- }
-
- // If we don't run loop, make a nothing node
- if (chain == -1)
- {
- node(RE.OP_NOTHING, 0);
- }
-
- // Set nullable flag for this branch
- if (nullable)
- {
- flags[0] |= NODE_NULLABLE;
- }
- return ret;
- }
-
- /**
- * Compile an expression with possible parens around it. Paren matching
- * is done at this level so we can tie the branch tails together.
- * @param flags Flag value passed by reference
- * @return Node index of expression in instruction array
- * @exception RESyntaxException Thrown if the regular expression has invalid syntax.
- */
- int expr(int[] flags) throws RESyntaxException
- {
- // Create open paren node unless we were called from the top level (which has no parens)
- int paren = -1;
- int ret = -1;
- int closeParens = parens;
- if ((flags[0] & NODE_TOPLEVEL) == 0 && pattern.charAt(idx) == '(')
- {
- // if its a cluster ( rather than a proper subexpression ie with backrefs )
- if ( idx + 2 < len && pattern.charAt( idx + 1 ) == '?' && pattern.charAt( idx + 2 ) == ':' )
- {
- paren = 2;
- idx += 3;
- ret = node( RE.OP_OPEN_CLUSTER, 0 );
- }
- else
- {
- paren = 1;
- idx++;
- ret = node(RE.OP_OPEN, parens++);
- }
- }
- flags[0] &= ~NODE_TOPLEVEL;
-
- // Create a branch node
- int branch = branch(flags);
- if (ret == -1)
- {
- ret = branch;
- }
- else
- {
- setNextOfEnd(ret, branch);
- }
-
- // Loop through branches
- while (idx < len && pattern.charAt(idx) == '|')
- {
- idx++;
- branch = branch(flags);
- setNextOfEnd(ret, branch);
- }
-
- // Create an ending node (either a close paren or an OP_END)
- int end;
- if ( paren > 0 )
- {
- if (idx < len && pattern.charAt(idx) == ')')
- {
- idx++;
- }
- else
- {
- syntaxError("Missing close paren");
- }
- if ( paren == 1 )
- {
- end = node(RE.OP_CLOSE, closeParens);
- }
- else
- {
- end = node( RE.OP_CLOSE_CLUSTER, 0 );
- }
- }
- else
- {
- end = node(RE.OP_END, 0);
- }
-
- // Append the ending node to the ret nodelist
- setNextOfEnd(ret, end);
-
- // Hook the ends of each branch to the end node
- int currentNode = ret;
- int nextNodeOffset = instruction[ currentNode + RE.offsetNext ];
- // while the next node o
- while ( nextNodeOffset != 0 && currentNode < lenInstruction )
- {
- // If branch, make the end of the branch's operand chain point to the end node.
- if ( instruction[ currentNode + RE.offsetOpcode ] == RE.OP_BRANCH )
- {
- setNextOfEnd( currentNode + RE.nodeSize, end );
- }
- nextNodeOffset = instruction[ currentNode + RE.offsetNext ];
- currentNode += nextNodeOffset;
- }
-
- // Return the node list
- return ret;
- }
-
- /**
- * Compiles a regular expression pattern into a program runnable by the pattern
- * matcher class 'RE'.
- * @param pattern Regular expression pattern to compile (see RECompiler class
- * for details).
- * @return A compiled regular expression program.
- * @exception RESyntaxException Thrown if the regular expression has invalid syntax.
- * @see RECompiler
- * @see RE
- */
- public REProgram compile(String pattern) throws RESyntaxException
- {
- // Initialize variables for compilation
- this.pattern = pattern; // Save pattern in instance variable
- len = pattern.length(); // Precompute pattern length for speed
- idx = 0; // Set parsing index to the first character
- lenInstruction = 0; // Set emitted instruction count to zero
- parens = 1; // Set paren level to 1 (the implicit outer parens)
- brackets = 0; // No bracketed closures yet
-
- // Initialize pass by reference flags value
- int[] flags = { NODE_TOPLEVEL };
-
- // Parse expression
- expr(flags);
-
- // Should be at end of input
- if (idx != len)
- {
- if (pattern.charAt(idx) == ')')
- {
- syntaxError("Unmatched close paren");
- }
- syntaxError("Unexpected input remains");
- }
-
- // Return the result
- char[] ins = new char[lenInstruction];
- System.arraycopy(instruction, 0, ins, 0, lenInstruction);
- return new REProgram(parens, ins);
- }
-
- /**
- * Local, nested class for maintaining character ranges for character classes.
- */
- class RERange
- {
- int size = 16; // Capacity of current range arrays
- int[] minRange = new int[size]; // Range minima
- int[] maxRange = new int[size]; // Range maxima
- int num = 0; // Number of range array elements in use
-
- /**
- * Deletes the range at a given index from the range lists
- * @param index Index of range to delete from minRange and maxRange arrays.
- */
- void delete(int index)
- {
- // Return if no elements left or index is out of range
- if (num == 0 || index >= num)
- {
- return;
- }
-
- // Move elements down
- while (++index < num)
- {
- if (index - 1 >= 0)
- {
- minRange[index-1] = minRange[index];
- maxRange[index-1] = maxRange[index];
- }
- }
-
- // One less element now
- num--;
- }
-
- /**
- * Merges a range into the range list, coalescing ranges if possible.
- * @param min Minimum end of range
- * @param max Maximum end of range
- */
- void merge(int min, int max)
- {
- // Loop through ranges
- for (int i = 0; i < num; i++)
- {
- // Min-max is subsumed by minRange[i]-maxRange[i]
- if (min >= minRange[i] && max <= maxRange[i])
- {
- return;
- }
-
- // Min-max subsumes minRange[i]-maxRange[i]
- else if (min <= minRange[i] && max >= maxRange[i])
- {
- delete(i);
- merge(min, max);
- return;
- }
-
- // Min is in the range, but max is outside
- else if (min >= minRange[i] && min <= maxRange[i])
- {
- delete(i);
- min = minRange[i];
- merge(min, max);
- return;
- }
-
- // Max is in the range, but min is outside
- else if (max >= minRange[i] && max <= maxRange[i])
- {
- delete(i);
- max = maxRange[i];
- merge(min, max);
- return;
- }
- }
-
- // Must not overlap any other ranges
- if (num >= size)
- {
- size *= 2;
- int[] newMin = new int[size];
- int[] newMax = new int[size];
- System.arraycopy(minRange, 0, newMin, 0, num);
- System.arraycopy(maxRange, 0, newMax, 0, num);
- minRange = newMin;
- maxRange = newMax;
- }
- minRange[num] = min;
- maxRange[num] = max;
- num++;
- }
-
- /**
- * Removes a range by deleting or shrinking all other ranges
- * @param min Minimum end of range
- * @param max Maximum end of range
- */
- void remove(int min, int max)
- {
- // Loop through ranges
- for (int i = 0; i < num; i++)
- {
- // minRange[i]-maxRange[i] is subsumed by min-max
- if (minRange[i] >= min && maxRange[i] <= max)
- {
- delete(i);
- i--;
- return;
- }
-
- // min-max is subsumed by minRange[i]-maxRange[i]
- else if (min >= minRange[i] && max <= maxRange[i])
- {
- int minr = minRange[i];
- int maxr = maxRange[i];
- delete(i);
- if (minr < min)
- {
- merge(minr, min - 1);
- }
- if (max < maxr)
- {
- merge(max + 1, maxr);
- }
- return;
- }
-
- // minRange is in the range, but maxRange is outside
- else if (minRange[i] >= min && minRange[i] <= max)
- {
- minRange[i] = max + 1;
- return;
- }
-
- // maxRange is in the range, but minRange is outside
- else if (maxRange[i] >= min && maxRange[i] <= max)
- {
- maxRange[i] = min - 1;
- return;
- }
- }
- }
-
- /**
- * Includes (or excludes) the range from min to max, inclusive.
- * @param min Minimum end of range
- * @param max Maximum end of range
- * @param include True if range should be included. False otherwise.
- */
- void include(int min, int max, boolean include)
- {
- if (include)
- {
- merge(min, max);
- }
- else
- {
- remove(min, max);
- }
- }
-
- /**
- * Includes a range with the same min and max
- * @param minmax Minimum and maximum end of range (inclusive)
- * @param include True if range should be included. False otherwise.
- */
- void include(char minmax, boolean include)
- {
- include(minmax, minmax, include);
- }
- }
-}
diff --git a/src/com/sun/org/apache/regexp/internal/REDebugCompiler.java b/src/com/sun/org/apache/regexp/internal/REDebugCompiler.java
deleted file mode 100644
index 815d4fd..0000000
--- a/src/com/sun/org/apache/regexp/internal/REDebugCompiler.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.regexp.internal;
-
-import java.io.PrintWriter;
-import java.util.Hashtable;
-
-/**
- * A subclass of RECompiler which can dump a regular expression program
- * for debugging purposes.
- *
- * @author <a href="mailto:jonl@muppetlabs.com">Jonathan Locke</a>
- */
-public class REDebugCompiler extends RECompiler
-{
- /**
- * Mapping from opcodes to descriptive strings
- */
- static Hashtable hashOpcode = new Hashtable();
- static
- {
- hashOpcode.put(new Integer(RE.OP_RELUCTANTSTAR), "OP_RELUCTANTSTAR");
- hashOpcode.put(new Integer(RE.OP_RELUCTANTPLUS), "OP_RELUCTANTPLUS");
- hashOpcode.put(new Integer(RE.OP_RELUCTANTMAYBE), "OP_RELUCTANTMAYBE");
- hashOpcode.put(new Integer(RE.OP_END), "OP_END");
- hashOpcode.put(new Integer(RE.OP_BOL), "OP_BOL");
- hashOpcode.put(new Integer(RE.OP_EOL), "OP_EOL");
- hashOpcode.put(new Integer(RE.OP_ANY), "OP_ANY");
- hashOpcode.put(new Integer(RE.OP_ANYOF), "OP_ANYOF");
- hashOpcode.put(new Integer(RE.OP_BRANCH), "OP_BRANCH");
- hashOpcode.put(new Integer(RE.OP_ATOM), "OP_ATOM");
- hashOpcode.put(new Integer(RE.OP_STAR), "OP_STAR");
- hashOpcode.put(new Integer(RE.OP_PLUS), "OP_PLUS");
- hashOpcode.put(new Integer(RE.OP_MAYBE), "OP_MAYBE");
- hashOpcode.put(new Integer(RE.OP_NOTHING), "OP_NOTHING");
- hashOpcode.put(new Integer(RE.OP_GOTO), "OP_GOTO");
- hashOpcode.put(new Integer(RE.OP_ESCAPE), "OP_ESCAPE");
- hashOpcode.put(new Integer(RE.OP_OPEN), "OP_OPEN");
- hashOpcode.put(new Integer(RE.OP_CLOSE), "OP_CLOSE");
- hashOpcode.put(new Integer(RE.OP_BACKREF), "OP_BACKREF");
- hashOpcode.put(new Integer(RE.OP_POSIXCLASS), "OP_POSIXCLASS");
- hashOpcode.put(new Integer(RE.OP_OPEN_CLUSTER), "OP_OPEN_CLUSTER");
- hashOpcode.put(new Integer(RE.OP_CLOSE_CLUSTER), "OP_CLOSE_CLUSTER");
- }
-
- /**
- * Returns a descriptive string for an opcode.
- * @param opcode Opcode to convert to a string
- * @return Description of opcode
- */
- String opcodeToString(char opcode)
- {
- // Get string for opcode
- String ret =(String)hashOpcode.get(new Integer(opcode));
-
- // Just in case we have a corrupt program
- if (ret == null)
- {
- ret = "OP_????";
- }
- return ret;
- }
-
- /**
- * Return a string describing a (possibly unprintable) character.
- * @param c Character to convert to a printable representation
- * @return String representation of character
- */
- String charToString(char c)
- {
- // If it's unprintable, convert to '\###'
- if (c < ' ' || c > 127)
- {
- return "\\" + (int)c;
- }
-
- // Return the character as a string
- return String.valueOf(c);
- }
-
- /**
- * Returns a descriptive string for a node in a regular expression program.
- * @param node Node to describe
- * @return Description of node
- */
- String nodeToString(int node)
- {
- // Get opcode and opdata for node
- char opcode = instruction[node + RE.offsetOpcode];
- int opdata = (int)instruction[node + RE.offsetOpdata];
-
- // Return opcode as a string and opdata value
- return opcodeToString(opcode) + ", opdata = " + opdata;
- }
-
- /**
- * Inserts a node with a given opcode and opdata at insertAt. The node relative next
- * pointer is initialized to 0.
- * @param opcode Opcode for new node
- * @param opdata Opdata for new node (only the low 16 bits are currently used)
- * @param insertAt Index at which to insert the new node in the program * /
- void nodeInsert(char opcode, int opdata, int insertAt) {
- System.out.println( "====> " + opcode + " " + opdata + " " + insertAt );
- PrintWriter writer = new PrintWriter( System.out );
- dumpProgram( writer );
- super.nodeInsert( opcode, opdata, insertAt );
- System.out.println( "====< " );
- dumpProgram( writer );
- writer.flush();
- }/**/
-
-
- /**
- * Appends a node to the end of a node chain
- * @param node Start of node chain to traverse
- * @param pointTo Node to have the tail of the chain point to * /
- void setNextOfEnd(int node, int pointTo) {
- System.out.println( "====> " + node + " " + pointTo );
- PrintWriter writer = new PrintWriter( System.out );
- dumpProgram( writer );
- super.setNextOfEnd( node, pointTo );
- System.out.println( "====< " );
- dumpProgram( writer );
- writer.flush();
- }/**/
-
-
- /**
- * Dumps the current program to a PrintWriter
- * @param p PrintWriter for program dump output
- */
- public void dumpProgram(PrintWriter p)
- {
- // Loop through the whole program
- for (int i = 0; i < lenInstruction; )
- {
- // Get opcode, opdata and next fields of current program node
- char opcode = instruction[i + RE.offsetOpcode];
- char opdata = instruction[i + RE.offsetOpdata];
- short next = (short)instruction[i + RE.offsetNext];
-
- // Display the current program node
- p.print(i + ". " + nodeToString(i) + ", next = ");
-
- // If there's no next, say 'none', otherwise give absolute index of next node
- if (next == 0)
- {
- p.print("none");
- }
- else
- {
- p.print(i + next);
- }
-
- // Move past node
- i += RE.nodeSize;
-
- // If character class
- if (opcode == RE.OP_ANYOF)
- {
- // Opening bracket for start of char class
- p.print(", [");
-
- // Show each range in the char class
- int rangeCount = opdata;
- for (int r = 0; r < rangeCount; r++)
- {
- // Get first and last chars in range
- char charFirst = instruction[i++];
- char charLast = instruction[i++];
-
- // Print range as X-Y, unless range encompasses only one char
- if (charFirst == charLast)
- {
- p.print(charToString(charFirst));
- }
- else
- {
- p.print(charToString(charFirst) + "-" + charToString(charLast));
- }
- }
-
- // Annotate the end of the char class
- p.print("]");
- }
-
- // If atom
- if (opcode == RE.OP_ATOM)
- {
- // Open quote
- p.print(", \"");
-
- // Print each character in the atom
- for (int len = opdata; len-- != 0; )
- {
- p.print(charToString(instruction[i++]));
- }
-
- // Close quote
- p.print("\"");
- }
-
- // Print a newline
- p.println("");
- }
- }
-}
diff --git a/src/com/sun/org/apache/regexp/internal/REProgram.java b/src/com/sun/org/apache/regexp/internal/REProgram.java
deleted file mode 100644
index f7a39ce..0000000
--- a/src/com/sun/org/apache/regexp/internal/REProgram.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.regexp.internal;
-
-import java.io.Serializable;
-
-/**
- * A class that holds compiled regular expressions. This is exposed mainly
- * for use by the recompile utility (which helps you produce precompiled
- * REProgram objects). You should not otherwise need to work directly with
- * this class.
-*
- * @see RE
- * @see RECompiler
- *
- * @author <a href="mailto:jonl@muppetlabs.com">Jonathan Locke</a>
- */
-public class REProgram implements Serializable
-{
- static final int OPT_HASBACKREFS = 1;
-
- char[] instruction; // The compiled regular expression 'program'
- int lenInstruction; // The amount of the instruction buffer in use
- char[] prefix; // Prefix string optimization
- int flags; // Optimization flags (REProgram.OPT_*)
- int maxParens = -1;
-
- /**
- * Constructs a program object from a character array
- * @param instruction Character array with RE opcode instructions in it
- */
- public REProgram(char[] instruction)
- {
- this(instruction, instruction.length);
- }
-
- /**
- * Constructs a program object from a character array
- * @param parens Count of parens in the program
- * @param instruction Character array with RE opcode instructions in it
- */
- public REProgram(int parens, char[] instruction)
- {
- this(instruction, instruction.length);
- this.maxParens = parens;
- }
-
- /**
- * Constructs a program object from a character array
- * @param instruction Character array with RE opcode instructions in it
- * @param lenInstruction Amount of instruction array in use
- */
- public REProgram(char[] instruction, int lenInstruction)
- {
- setInstructions(instruction, lenInstruction);
- }
-
- /**
- * Returns a copy of the current regular expression program in a character
- * array that is exactly the right length to hold the program. If there is
- * no program compiled yet, getInstructions() will return null.
- * @return A copy of the current compiled RE program
- */
- public char[] getInstructions()
- {
- // Ensure program has been compiled!
- if (lenInstruction != 0)
- {
- // Return copy of program
- char[] ret = new char[lenInstruction];
- System.arraycopy(instruction, 0, ret, 0, lenInstruction);
- return ret;
- }
- return null;
- }
-
- /**
- * Sets a new regular expression program to run. It is this method which
- * performs any special compile-time search optimizations. Currently only
- * two optimizations are in place - one which checks for backreferences
- * (so that they can be lazily allocated) and another which attempts to
- * find an prefix anchor string so that substantial amounts of input can
- * potentially be skipped without running the actual program.
- * @param instruction Program instruction buffer
- * @param lenInstruction Length of instruction buffer in use
- */
- public void setInstructions(char[] instruction, int lenInstruction)
- {
- // Save reference to instruction array
- this.instruction = instruction;
- this.lenInstruction = lenInstruction;
-
- // Initialize other program-related variables
- flags = 0;
- prefix = null;
-
- // Try various compile-time optimizations if there's a program
- if (instruction != null && lenInstruction != 0)
- {
- // If the first node is a branch
- if (lenInstruction >= RE.nodeSize && instruction[0 + RE.offsetOpcode] == RE.OP_BRANCH)
- {
- // to the end node
- int next = instruction[0 + RE.offsetNext];
- if (instruction[next + RE.offsetOpcode] == RE.OP_END)
- {
- // and the branch starts with an atom
- if (lenInstruction >= (RE.nodeSize * 2) && instruction[RE.nodeSize + RE.offsetOpcode] == RE.OP_ATOM)
- {
- // then get that atom as an prefix because there's no other choice
- int lenAtom = instruction[RE.nodeSize + RE.offsetOpdata];
- prefix = new char[lenAtom];
- System.arraycopy(instruction, RE.nodeSize * 2, prefix, 0, lenAtom);
- }
- }
- }
-
- BackrefScanLoop:
-
- // Check for backreferences
- for (int i = 0; i < lenInstruction; i += RE.nodeSize)
- {
- switch (instruction[i + RE.offsetOpcode])
- {
- case RE.OP_ANYOF:
- i += (instruction[i + RE.offsetOpdata] * 2);
- break;
-
- case RE.OP_ATOM:
- i += instruction[i + RE.offsetOpdata];
- break;
-
- case RE.OP_BACKREF:
- flags |= OPT_HASBACKREFS;
- break BackrefScanLoop;
- }
- }
- }
- }
-}
diff --git a/src/com/sun/org/apache/regexp/internal/RESyntaxException.java b/src/com/sun/org/apache/regexp/internal/RESyntaxException.java
deleted file mode 100644
index a13f901..0000000
--- a/src/com/sun/org/apache/regexp/internal/RESyntaxException.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.regexp.internal;
-
-/**
- * Exception thrown to indicate a syntax error in a regular expression.
- * This is a non-checked exception because you should only have problems compiling
- * a regular expression during development.
- * If you are making regular expresion programs dynamically then you can catch it
- * if you wish. But should not be forced to.
- *
- * @author <a href="mailto:jonl@muppetlabs.com">Jonathan Locke</a>
- * @author <a href="mailto:gholam@xtra.co.nz>Michael McCallum</a>
- */
-public class RESyntaxException extends RuntimeException
-{
- /**
- * Constructor.
- * @param s Further description of the syntax error
- */
- public RESyntaxException(String s)
- {
- super("Syntax error: " + s);
- }
-}
diff --git a/src/com/sun/org/apache/regexp/internal/RETest.java b/src/com/sun/org/apache/regexp/internal/RETest.java
deleted file mode 100644
index 463776d..0000000
--- a/src/com/sun/org/apache/regexp/internal/RETest.java
+++ /dev/null
@@ -1,883 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.regexp.internal;
-
-import java.io.BufferedReader;
-import java.io.FileReader;
-import java.io.InputStreamReader;
-import java.io.PrintWriter;
-import java.io.File;
-import java.io.ByteArrayOutputStream;
-import java.io.ObjectOutputStream;
-import java.io.ByteArrayInputStream;
-import java.io.ObjectInputStream;
-import java.io.StringBufferInputStream;
-import java.io.StringReader;
-import java.io.IOException;
-
-/**
- * Data driven (and optionally interactive) testing harness to exercise regular
- * expression compiler and matching engine.
- *
- * @author <a href="mailto:jonl@muppetlabs.com">Jonathan Locke</a>
- * @author <a href="mailto:jon@latchkey.com">Jon S. Stevens</a>
- * @author <a href="mailto:gholam@xtra.co.nz">Michael McCallum</a>
- */
-public class RETest
-{
- // True if we want to see output from success cases
- static final boolean showSuccesses = false;
-
- // A new line character.
- static final String NEW_LINE = System.getProperty( "line.separator" );
-
- // Construct a debug compiler
- REDebugCompiler compiler = new REDebugCompiler();
-
- /**
- * Main program entrypoint. If an argument is given, it will be compiled
- * and interactive matching will ensue. If no argument is given, the
- * file RETest.txt will be used as automated testing input.
- * @param args Command line arguments (optional regular expression)
- */
- public static void main(String[] args)
- {
- try
- {
- if (!test( args )) {
- System.exit(1);
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- System.exit(1);
- }
- }
-
- /**
- * Testing entrypoint.
- * @param args Command line arguments
- * @exception Exception thrown in case of error
- */
- public static boolean test( String[] args ) throws Exception
- {
- RETest test = new RETest();
- // Run interactive tests against a single regexp
- if (args.length == 2)
- {
- test.runInteractiveTests(args[1]);
- }
- else if (args.length == 1)
- {
- // Run automated tests
- test.runAutomatedTests(args[0]);
- }
- else
- {
- System.out.println( "Usage: RETest ([-i] [regex]) ([/path/to/testfile.txt])" );
- System.out.println( "By Default will run automated tests from file 'docs/RETest.txt' ..." );
- System.out.println();
- test.runAutomatedTests("docs/RETest.txt");
- }
- return test.failures == 0;
- }
-
- /**
- * Constructor
- */
- public RETest()
- {
- }
-
- /**
- * Compile and test matching against a single expression
- * @param expr Expression to compile and test
- */
- void runInteractiveTests(String expr)
- {
- RE r = new RE();
- try
- {
- // Compile expression
- r.setProgram(compiler.compile(expr));
-
- // Show expression
- say("" + NEW_LINE + "" + expr + "" + NEW_LINE + "");
-
- // Show program for compiled expression
- PrintWriter writer = new PrintWriter( System.out );
- compiler.dumpProgram( writer );
- writer.flush();
-
- boolean running = true;
- // Test matching against compiled expression
- while ( running )
- {
- // Read from keyboard
- BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
- System.out.print("> ");
- System.out.flush();
- String match = br.readLine();
-
- if ( match != null )
- {
- // Try a match against the keyboard input
- if (r.match(match))
- {
- say("Match successful.");
- }
- else
- {
- say("Match failed.");
- }
-
- // Show subparen registers
- showParens(r);
- }
- else
- {
- running = false;
- System.out.println();
- }
- }
- }
- catch (Exception e)
- {
- say("Error: " + e.toString());
- e.printStackTrace();
- }
- }
-
- /**
- * Exit with a fatal error.
- * @param s Last famous words before exiting
- */
- void die(String s)
- {
- say("FATAL ERROR: " + s);
- System.exit(-1);
- }
-
- /**
- * Fail with an error. Will print a big failure message to System.out.
- *
- * @param log Output before failure
- * @param s Failure description
- */
- void fail(StringBuffer log, String s)
- {
- System.out.print(log.toString());
- fail(s);
- }
-
- /**
- * Fail with an error. Will print a big failure message to System.out.
- *
- * @param s Failure description
- */
- void fail(String s)
- {
- failures++;
- say("" + NEW_LINE + "");
- say("*******************************************************");
- say("********************* FAILURE! **********************");
- say("*******************************************************");
- say("" + NEW_LINE + "");
- say(s);
- say("");
- // make sure the writer gets flushed.
- if (compiler != null) {
- PrintWriter writer = new PrintWriter( System.out );
- compiler.dumpProgram( writer );
- writer.flush();
- say("" + NEW_LINE + "");
- }
- }
-
- /**
- * Say something to standard out
- * @param s What to say
- */
- void say(String s)
- {
- System.out.println(s);
- }
-
- /**
- * Dump parenthesized subexpressions found by a regular expression matcher object
- * @param r Matcher object with results to show
- */
- void showParens(RE r)
- {
- // Loop through each paren
- for (int i = 0; i < r.getParenCount(); i++)
- {
- // Show paren register
- say("$" + i + " = " + r.getParen(i));
- }
- }
-
- /*
- * number in automated test
- */
- int testCount = 0;
-
- /*
- * Count of failures in automated test
- */
- int failures = 0;
-
- /**
- * Run automated tests in RETest.txt file (from Perl 4.0 test battery)
- * @exception Exception thrown in case of error
- */
- void runAutomatedTests(String testDocument) throws Exception
- {
- long ms = System.currentTimeMillis();
-
- // Some unit tests
- testPrecompiledRE();
- testSplitAndGrep();
- testSubst();
- testOther();
-
- // Test from script file
- File testInput = new File(testDocument);
- if (! testInput.exists()) {
- throw new Exception ("Could not find: " + testDocument);
- }
-
- BufferedReader br = new BufferedReader(new FileReader(testInput));
- try
- {
- // While input is available, parse lines
- while (br.ready())
- {
- RETestCase testcase = getNextTestCase(br);
- if (testcase != null) {
- testcase.runTest();
- }
- }
- }
- finally
- {
- br.close();
- }
-
- // Show match time
- say(NEW_LINE + NEW_LINE + "Match time = " + (System.currentTimeMillis() - ms) + " ms.");
-
- // Print final results
- if (failures > 0) {
- say("*************** THERE ARE FAILURES! *******************");
- }
- say("Tests complete. " + testCount + " tests, " + failures + " failure(s).");
- }
-
- /**
- * Run automated unit test
- * @exception Exception thrown in case of error
- */
- void testOther() throws Exception
- {
- // Serialization test 1: Compile regexp and serialize/deserialize it
- RE r = new RE("(a*)b");
- say("Serialized/deserialized (a*)b");
- ByteArrayOutputStream out = new ByteArrayOutputStream(128);
- new ObjectOutputStream(out).writeObject(r);
- ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
- r = (RE)new ObjectInputStream(in).readObject();
- if (!r.match("aaab"))
- {
- fail("Did not match 'aaab' with deserialized RE.");
- } else {
- say("aaaab = true");
- showParens(r);
- }
-
- // Serialization test 2: serialize/deserialize used regexp
- out.reset();
- say("Deserialized (a*)b");
- new ObjectOutputStream(out).writeObject(r);
- in = new ByteArrayInputStream(out.toByteArray());
- r = (RE)new ObjectInputStream(in).readObject();
- if (r.getParenCount() != 0)
- {
- fail("Has parens after deserialization.");
- }
- if (!r.match("aaab"))
- {
- fail("Did not match 'aaab' with deserialized RE.");
- } else {
- say("aaaab = true");
- showParens(r);
- }
-
- // Test MATCH_CASEINDEPENDENT
- r = new RE("abc(\\w*)");
- say("MATCH_CASEINDEPENDENT abc(\\w*)");
- r.setMatchFlags(RE.MATCH_CASEINDEPENDENT);
- say("abc(d*)");
- if (!r.match("abcddd"))
- {
- fail("Did not match 'abcddd'.");
- } else {
- say("abcddd = true");
- showParens(r);
- }
-
- if (!r.match("aBcDDdd"))
- {
- fail("Did not match 'aBcDDdd'.");
- } else {
- say("aBcDDdd = true");
- showParens(r);
- }
-
- if (!r.match("ABCDDDDD"))
- {
- fail("Did not match 'ABCDDDDD'.");
- } else {
- say("ABCDDDDD = true");
- showParens(r);
- }
-
- r = new RE("(A*)b\\1");
- r.setMatchFlags(RE.MATCH_CASEINDEPENDENT);
- if (!r.match("AaAaaaBAAAAAA"))
- {
- fail("Did not match 'AaAaaaBAAAAAA'.");
- } else {
- say("AaAaaaBAAAAAA = true");
- showParens(r);
- }
-
- r = new RE("[A-Z]*");
- r.setMatchFlags(RE.MATCH_CASEINDEPENDENT);
- if (!r.match("CaBgDe12"))
- {
- fail("Did not match 'CaBgDe12'.");
- } else {
- say("CaBgDe12 = true");
- showParens(r);
- }
-
- // Test MATCH_MULTILINE. Test for eol/bol symbols.
- r = new RE("^abc$", RE.MATCH_MULTILINE);
- if (!r.match("\nabc")) {
- fail("\"\\nabc\" doesn't match \"^abc$\"");
- }
- if (!r.match("\rabc")) {
- fail("\"\\rabc\" doesn't match \"^abc$\"");
- }
- if (!r.match("\r\nabc")) {
- fail("\"\\r\\nabc\" doesn't match \"^abc$\"");
- }
- if (!r.match("\u0085abc")) {
- fail("\"\\u0085abc\" doesn't match \"^abc$\"");
- }
- if (!r.match("\u2028abc")) {
- fail("\"\\u2028abc\" doesn't match \"^abc$\"");
- }
- if (!r.match("\u2029abc")) {
- fail("\"\\u2029abc\" doesn't match \"^abc$\"");
- }
-
- // Test MATCH_MULTILINE. Test that '.' does not matches new line.
- r = new RE("^a.*b$", RE.MATCH_MULTILINE);
- if (r.match("a\nb")) {
- fail("\"a\\nb\" matches \"^a.*b$\"");
- }
- if (r.match("a\rb")) {
- fail("\"a\\rb\" matches \"^a.*b$\"");
- }
- if (r.match("a\r\nb")) {
- fail("\"a\\r\\nb\" matches \"^a.*b$\"");
- }
- if (r.match("a\u0085b")) {
- fail("\"a\\u0085b\" matches \"^a.*b$\"");
- }
- if (r.match("a\u2028b")) {
- fail("\"a\\u2028b\" matches \"^a.*b$\"");
- }
- if (r.match("a\u2029b")) {
- fail("\"a\\u2029b\" matches \"^a.*b$\"");
- }
- }
-
- private void testPrecompiledRE()
- {
- // Pre-compiled regular expression "a*b"
- char[] re1Instructions =
- {
- 0x007c, 0x0000, 0x001a, 0x007c, 0x0000, 0x000d, 0x0041,
- 0x0001, 0x0004, 0x0061, 0x007c, 0x0000, 0x0003, 0x0047,
- 0x0000, 0xfff6, 0x007c, 0x0000, 0x0003, 0x004e, 0x0000,
- 0x0003, 0x0041, 0x0001, 0x0004, 0x0062, 0x0045, 0x0000,
- 0x0000,
- };
-
- REProgram re1 = new REProgram(re1Instructions);
-
- // Simple test of pre-compiled regular expressions
- RE r = new RE(re1);
- say("a*b");
- boolean result = r.match("aaab");
- say("aaab = " + result);
- showParens(r);
- if (!result) {
- fail("\"aaab\" doesn't match to precompiled \"a*b\"");
- }
-
- result = r.match("b");
- say("b = " + result);
- showParens(r);
- if (!result) {
- fail("\"b\" doesn't match to precompiled \"a*b\"");
- }
-
- result = r.match("c");
- say("c = " + result);
- showParens(r);
- if (result) {
- fail("\"c\" matches to precompiled \"a*b\"");
- }
-
- result = r.match("ccccaaaaab");
- say("ccccaaaaab = " + result);
- showParens(r);
- if (!result) {
- fail("\"ccccaaaaab\" doesn't match to precompiled \"a*b\"");
- }
- }
-
- private void testSplitAndGrep()
- {
- String[] expected = {"xxxx", "xxxx", "yyyy", "zzz"};
- RE r = new RE("a*b");
- String[] s = r.split("xxxxaabxxxxbyyyyaaabzzz");
- for (int i = 0; i < expected.length && i < s.length; i++) {
- assertEquals("Wrong splitted part", expected[i], s[i]);
- }
- assertEquals("Wrong number of splitted parts", expected.length,
- s.length);
-
- r = new RE("x+");
- expected = new String[] {"xxxx", "xxxx"};
- s = r.grep(s);
- for (int i = 0; i < s.length; i++)
- {
- say("s[" + i + "] = " + s[i]);
- assertEquals("Grep fails", expected[i], s[i]);
- }
- assertEquals("Wrong number of string found by grep", expected.length,
- s.length);
- }
-
- private void testSubst()
- {
- RE r = new RE("a*b");
- String expected = "-foo-garply-wacky-";
- String actual = r.subst("aaaabfooaaabgarplyaaabwackyb", "-");
- assertEquals("Wrong result of substitution in \"a*b\"", expected, actual);
-
- // Test subst() with backreferences
- r = new RE("http://[\\.\\w\\-\\?/~_@&=%]+");
- actual = r.subst("visit us: http://www.apache.org!",
- "1234<a href=\"$0\">$0</a>", RE.REPLACE_BACKREFERENCES);
- assertEquals("Wrong subst() result", "visit us: 1234<a href=\"http://www.apache.org\">http://www.apache.org</a>!", actual);
-
- // Test subst() with backreferences without leading characters
- // before first backreference
- r = new RE("(.*?)=(.*)");
- actual = r.subst("variable=value",
- "$1_test_$212", RE.REPLACE_BACKREFERENCES);
- assertEquals("Wrong subst() result", "variable_test_value12", actual);
-
- // Test subst() with NO backreferences
- r = new RE("^a$");
- actual = r.subst("a",
- "b", RE.REPLACE_BACKREFERENCES);
- assertEquals("Wrong subst() result", "b", actual);
-
- // Test subst() with NO backreferences
- r = new RE("^a$", RE.MATCH_MULTILINE);
- actual = r.subst("\r\na\r\n",
- "b", RE.REPLACE_BACKREFERENCES);
- assertEquals("Wrong subst() result", "\r\nb\r\n", actual);
- }
-
- public void assertEquals(String message, String expected, String actual)
- {
- if (expected != null && !expected.equals(actual)
- || actual != null && !actual.equals(expected))
- {
- fail(message + " (expected \"" + expected
- + "\", actual \"" + actual + "\")");
- }
- }
-
- public void assertEquals(String message, int expected, int actual)
- {
- if (expected != actual) {
- fail(message + " (expected \"" + expected
- + "\", actual \"" + actual + "\")");
- }
- }
-
- /**
- * Converts yesno string to boolean.
- * @param yesno string representation of expected result
- * @return true if yesno is "YES", false if yesno is "NO"
- * stops program otherwise.
- */
- private boolean getExpectedResult(String yesno)
- {
- if ("NO".equals(yesno))
- {
- return false;
- }
- else if ("YES".equals(yesno))
- {
- return true;
- }
- else
- {
- // Bad test script
- die("Test script error!");
- return false; //to please javac
- }
- }
-
- /**
- * Finds next test description in a given script.
- * @param br <code>BufferedReader</code> for a script file
- * @return strign tag for next test description
- * @exception IOException if some io problems occured
- */
- private String findNextTest(BufferedReader br) throws IOException
- {
- String number = "";
-
- while (br.ready())
- {
- number = br.readLine();
- if (number == null)
- {
- break;
- }
- number = number.trim();
- if (number.startsWith("#"))
- {
- break;
- }
- if (!number.equals(""))
- {
- say("Script error. Line = " + number);
- System.exit(-1);
- }
- }
- return number;
- }
-
- /**
- * Creates testcase for the next test description in the script file.
- * @param br <code>BufferedReader</code> for script file.
- * @return a new tescase or null.
- * @exception IOException if some io problems occured
- */
- private RETestCase getNextTestCase(BufferedReader br) throws IOException
- {
- // Find next re test case
- final String tag = findNextTest(br);
-
- // Are we done?
- if (!br.ready())
- {
- return null;
- }
-
- // Get expression
- final String expr = br.readLine();
-
- // Get test information
- final String matchAgainst = br.readLine();
- final boolean badPattern = "ERR".equals(matchAgainst);
- boolean shouldMatch = false;
- int expectedParenCount = 0;
- String[] expectedParens = null;
-
- if (!badPattern) {
- shouldMatch = getExpectedResult(br.readLine().trim());
- if (shouldMatch) {
- expectedParenCount = Integer.parseInt(br.readLine().trim());
- expectedParens = new String[expectedParenCount];
- for (int i = 0; i < expectedParenCount; i++) {
- expectedParens[i] = br.readLine();
- }
- }
- }
-
- return new RETestCase(this, tag, expr, matchAgainst, badPattern,
- shouldMatch, expectedParens);
- }
-}
-
-final class RETestCase
-{
- final private StringBuffer log = new StringBuffer();
- final private int number;
- final private String tag; // number from script file
- final private String pattern;
- final private String toMatch;
- final private boolean badPattern;
- final private boolean shouldMatch;
- final private String[] parens;
- final private RETest test;
- private RE regexp;
-
- public RETestCase(RETest test, String tag, String pattern,
- String toMatch, boolean badPattern,
- boolean shouldMatch, String[] parens)
- {
- this.number = ++test.testCount;
- this.test = test;
- this.tag = tag;
- this.pattern = pattern;
- this.toMatch = toMatch;
- this.badPattern = badPattern;
- this.shouldMatch = shouldMatch;
- if (parens != null) {
- this.parens = new String[parens.length];
- for (int i = 0; i < parens.length; i++) {
- this.parens[i] = parens[i];
- }
- } else {
- this.parens = null;
- }
- }
-
- public void runTest()
- {
- test.say(tag + "(" + number + "): " + pattern);
- if (testCreation()) {
- testMatch();
- }
- }
-
- boolean testCreation()
- {
- try
- {
- // Compile it
- regexp = new RE();
- regexp.setProgram(test.compiler.compile(pattern));
- // Expression didn't cause an expected error
- if (badPattern)
- {
- test.fail(log, "Was expected to be an error, but wasn't.");
- return false;
- }
-
- return true;
- }
- // Some expressions *should* cause exceptions to be thrown
- catch (Exception e)
- {
- // If it was supposed to be an error, report success and continue
- if (badPattern)
- {
- log.append(" Match: ERR\n");
- success("Produces an error (" + e.toString() + "), as expected.");
- return false;
- }
-
- // Wasn't supposed to be an error
- String message = (e.getMessage() == null) ? e.toString() : e.getMessage();
- test.fail(log, "Produces an unexpected exception \"" + message + "\"");
- e.printStackTrace();
- }
- catch (Error e)
- {
- // Internal error happened
- test.fail(log, "Compiler threw fatal error \"" + e.getMessage() + "\"");
- e.printStackTrace();
- }
-
- return false;
- }
-
- private void testMatch()
- {
- log.append(" Match against: '" + toMatch + "'\n");
- // Try regular matching
- try
- {
- // Match against the string
- boolean result = regexp.match(toMatch);
- log.append(" Matched: " + (result ? "YES" : "NO") + "\n");
-
- // Check result, parens, and iterators
- if (checkResult(result) && (!shouldMatch || checkParens()))
- {
- // test match(CharacterIterator, int)
- // for every CharacterIterator implementation.
- log.append(" Match using StringCharacterIterator\n");
- if (!tryMatchUsingCI(new StringCharacterIterator(toMatch)))
- return;
-
- log.append(" Match using CharacterArrayCharacterIterator\n");
- if (!tryMatchUsingCI(new CharacterArrayCharacterIterator(toMatch.toCharArray(), 0, toMatch.length())))
- return;
-
- log.append(" Match using StreamCharacterIterator\n");
- if (!tryMatchUsingCI(new StreamCharacterIterator(new StringBufferInputStream(toMatch))))
- return;
-
- log.append(" Match using ReaderCharacterIterator\n");
- if (!tryMatchUsingCI(new ReaderCharacterIterator(new StringReader(toMatch))))
- return;
- }
- }
- // Matcher blew it
- catch(Exception e)
- {
- test.fail(log, "Matcher threw exception: " + e.toString());
- e.printStackTrace();
- }
- // Internal error
- catch(Error e)
- {
- test.fail(log, "Matcher threw fatal error \"" + e.getMessage() + "\"");
- e.printStackTrace();
- }
- }
-
- private boolean checkResult(boolean result)
- {
- // Write status
- if (result == shouldMatch) {
- success((shouldMatch ? "Matched" : "Did not match")
- + " \"" + toMatch + "\", as expected:");
- return true;
- } else {
- if (shouldMatch) {
- test.fail(log, "Did not match \"" + toMatch + "\", when expected to.");
- } else {
- test.fail(log, "Matched \"" + toMatch + "\", when not expected to.");
- }
- return false;
- }
- }
-
- private boolean checkParens()
- {
- // Show subexpression registers
- if (RETest.showSuccesses)
- {
- test.showParens(regexp);
- }
-
- log.append(" Paren count: " + regexp.getParenCount() + "\n");
- if (!assertEquals(log, "Wrong number of parens", parens.length, regexp.getParenCount()))
- {
- return false;
- }
-
- // Check registers against expected contents
- for (int p = 0; p < regexp.getParenCount(); p++)
- {
- log.append(" Paren " + p + ": " + regexp.getParen(p) + "\n");
-
- // Compare expected result with actual
- if ("null".equals(parens[p]) && regexp.getParen(p) == null)
- {
- // Consider "null" in test file equal to null
- continue;
- }
- if (!assertEquals(log, "Wrong register " + p, parens[p], regexp.getParen(p)))
- {
- return false;
- }
- }
-
- return true;
- }
-
- boolean tryMatchUsingCI(CharacterIterator matchAgainst)
- {
- try {
- boolean result = regexp.match(matchAgainst, 0);
- log.append(" Match: " + (result ? "YES" : "NO") + "\n");
- return checkResult(result) && (!shouldMatch || checkParens());
- }
- // Matcher blew it
- catch(Exception e)
- {
- test.fail(log, "Matcher threw exception: " + e.toString());
- e.printStackTrace();
- }
- // Internal error
- catch(Error e)
- {
- test.fail(log, "Matcher threw fatal error \"" + e.getMessage() + "\"");
- e.printStackTrace();
- }
- return false;
- }
-
- public boolean assertEquals(StringBuffer log, String message, String expected, String actual)
- {
- if (expected != null && !expected.equals(actual)
- || actual != null && !actual.equals(expected))
- {
- test.fail(log, message + " (expected \"" + expected
- + "\", actual \"" + actual + "\")");
- return false;
- }
- return true;
- }
-
- public boolean assertEquals(StringBuffer log, String message, int expected, int actual)
- {
- if (expected != actual) {
- test.fail(log, message + " (expected \"" + expected
- + "\", actual \"" + actual + "\")");
- return false;
- }
- return true;
- }
-
- /**
- * Show a success
- * @param s Success story
- */
- void success(String s)
- {
- if (RETest.showSuccesses)
- {
- test.say("" + RETest.NEW_LINE + "-----------------------" + RETest.NEW_LINE + "");
- test.say("Expression #" + (number) + " \"" + pattern + "\" ");
- test.say("Success: " + s);
- }
- }
-}
diff --git a/src/com/sun/org/apache/regexp/internal/REUtil.java b/src/com/sun/org/apache/regexp/internal/REUtil.java
deleted file mode 100644
index 10907ec..0000000
--- a/src/com/sun/org/apache/regexp/internal/REUtil.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.regexp.internal;
-
-/**
- * This is a class that contains utility helper methods for this package.
- *
- * @author <a href="mailto:jonl@muppetlabs.com">Jonathan Locke</a>
- */
-public class REUtil
-{
- /** complex: */
- private static final String complexPrefix = "complex:";
-
- /**
- * Creates a regular expression, permitting simple or complex syntax
- * @param expression The expression, beginning with a prefix if it's complex or
- * having no prefix if it's simple
- * @param matchFlags Matching style flags
- * @return The regular expression object
- * @exception RESyntaxException thrown in case of error
- */
- public static RE createRE(String expression, int matchFlags) throws RESyntaxException
- {
- if (expression.startsWith(complexPrefix))
- {
- return new RE(expression.substring(complexPrefix.length()), matchFlags);
- }
- return new RE(RE.simplePatternToFullRegularExpression(expression), matchFlags);
- }
-
- /**
- * Creates a regular expression, permitting simple or complex syntax
- * @param expression The expression, beginning with a prefix if it's complex or
- * having no prefix if it's simple
- * @return The regular expression object
- * @exception RESyntaxException thrown in case of error
- */
- public static RE createRE(String expression) throws RESyntaxException
- {
- return createRE(expression, RE.MATCH_NORMAL);
- }
-}
diff --git a/src/com/sun/org/apache/regexp/internal/ReaderCharacterIterator.java b/src/com/sun/org/apache/regexp/internal/ReaderCharacterIterator.java
deleted file mode 100644
index 7eafff4..0000000
--- a/src/com/sun/org/apache/regexp/internal/ReaderCharacterIterator.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.regexp.internal;
-
-import java.io.Reader;
-import java.io.IOException;
-
-/**
- * Encapsulates java.io.Reader as CharacterIterator
- *
- * @author <a href="mailto:ales.novak@netbeans.com">Ales Novak</a>
- */
-public final class ReaderCharacterIterator implements CharacterIterator
-{
- /** Underlying reader */
- private final Reader reader;
-
- /** Buffer of read chars */
- private final StringBuffer buff;
-
- /** read end? */
- private boolean closed;
-
- /** @param reader a Reader, which is parsed */
- public ReaderCharacterIterator(Reader reader)
- {
- this.reader = reader;
- this.buff = new StringBuffer(512);
- this.closed = false;
- }
-
- /** @return a substring */
- public String substring(int beginIndex, int endIndex)
- {
- try
- {
- ensure(endIndex);
- return buff.toString().substring(beginIndex, endIndex);
- }
- catch (IOException e)
- {
- throw new StringIndexOutOfBoundsException(e.getMessage());
- }
- }
-
- /** @return a substring */
- public String substring(int beginIndex)
- {
- try
- {
- readAll();
- return buff.toString().substring(beginIndex);
- }
- catch (IOException e)
- {
- throw new StringIndexOutOfBoundsException(e.getMessage());
- }
- }
-
- /** @return a character at the specified position. */
- public char charAt(int pos)
- {
- try
- {
- ensure(pos);
- return buff.charAt(pos);
- }
- catch (IOException e)
- {
- throw new StringIndexOutOfBoundsException(e.getMessage());
- }
- }
-
- /** @return <tt>true</tt> iff if the specified index is after the end of the character stream */
- public boolean isEnd(int pos)
- {
- if (buff.length() > pos)
- {
- return false;
- }
- else
- {
- try
- {
- ensure(pos);
- return (buff.length() <= pos);
- }
- catch (IOException e)
- {
- throw new StringIndexOutOfBoundsException(e.getMessage());
- }
- }
- }
-
- /** Reads n characters from the stream and appends them to the buffer */
- private int read(int n) throws IOException
- {
- if (closed)
- {
- return 0;
- }
-
- char[] c = new char[n];
- int count = 0;
- int read = 0;
-
- do
- {
- read = reader.read(c);
- if (read < 0) // EOF
- {
- closed = true;
- break;
- }
- count += read;
- buff.append(c, 0, read);
- }
- while (count < n);
-
- return count;
- }
-
- /** Reads rest of the stream. */
- private void readAll() throws IOException
- {
- while(! closed)
- {
- read(1000);
- }
- }
-
- /** Reads chars up to the idx */
- private void ensure(int idx) throws IOException
- {
- if (closed)
- {
- return;
- }
-
- if (idx < buff.length())
- {
- return;
- }
- read(idx + 1 - buff.length());
- }
-}
diff --git a/src/com/sun/org/apache/regexp/internal/StreamCharacterIterator.java b/src/com/sun/org/apache/regexp/internal/StreamCharacterIterator.java
deleted file mode 100644
index e489065..0000000
--- a/src/com/sun/org/apache/regexp/internal/StreamCharacterIterator.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.regexp.internal;
-
-import java.io.InputStream;
-import java.io.IOException;
-
-/**
- * Encapsulates java.io.InputStream as CharacterIterator.
- *
- * @author <a href="mailto:ales.novak@netbeans.com">Ales Novak</a>
- */
-public final class StreamCharacterIterator implements CharacterIterator
-{
- /** Underlying is */
- private final InputStream is;
-
- /** Buffer of read chars */
- private final StringBuffer buff;
-
- /** read end? */
- private boolean closed;
-
- /** @param is an InputStream, which is parsed */
- public StreamCharacterIterator(InputStream is)
- {
- this.is = is;
- this.buff = new StringBuffer(512);
- this.closed = false;
- }
-
- /** @return a substring */
- public String substring(int beginIndex, int endIndex)
- {
- try
- {
- ensure(endIndex);
- return buff.toString().substring(beginIndex, endIndex);
- }
- catch (IOException e)
- {
- throw new StringIndexOutOfBoundsException(e.getMessage());
- }
- }
-
- /** @return a substring */
- public String substring(int beginIndex)
- {
- try
- {
- readAll();
- return buff.toString().substring(beginIndex);
- }
- catch (IOException e)
- {
- throw new StringIndexOutOfBoundsException(e.getMessage());
- }
- }
-
-
- /** @return a character at the specified position. */
- public char charAt(int pos)
- {
- try
- {
- ensure(pos);
- return buff.charAt(pos);
- }
- catch (IOException e)
- {
- throw new StringIndexOutOfBoundsException(e.getMessage());
- }
- }
-
- /** @return <tt>true</tt> iff if the specified index is after the end of the character stream */
- public boolean isEnd(int pos)
- {
- if (buff.length() > pos)
- {
- return false;
- }
- else
- {
- try
- {
- ensure(pos);
- return (buff.length() <= pos);
- }
- catch (IOException e)
- {
- throw new StringIndexOutOfBoundsException(e.getMessage());
- }
- }
- }
-
- /** Reads n characters from the stream and appends them to the buffer */
- private int read(int n) throws IOException
- {
- if (closed)
- {
- return 0;
- }
-
- int c;
- int i = n;
- while (--i >= 0)
- {
- c = is.read();
- if (c < 0) // EOF
- {
- closed = true;
- break;
- }
- buff.append((char) c);
- }
- return n - i;
- }
-
- /** Reads rest of the stream. */
- private void readAll() throws IOException
- {
- while(! closed)
- {
- read(1000);
- }
- }
-
- /** Reads chars up to the idx */
- private void ensure(int idx) throws IOException
- {
- if (closed)
- {
- return;
- }
-
- if (idx < buff.length())
- {
- return;
- }
-
- read(idx + 1 - buff.length());
- }
-}
diff --git a/src/com/sun/org/apache/regexp/internal/StringCharacterIterator.java b/src/com/sun/org/apache/regexp/internal/StringCharacterIterator.java
deleted file mode 100644
index bc6c859..0000000
--- a/src/com/sun/org/apache/regexp/internal/StringCharacterIterator.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.regexp.internal;
-
-/**
- * Encapsulates String as CharacterIterator.
- *
- * @author <a href="mailto:ales.novak@netbeans.com">Ales Novak</a>
- */
-public final class StringCharacterIterator implements CharacterIterator
-{
- /** encapsulated */
- private final String src;
-
- /** @param src - encapsulated String */
- public StringCharacterIterator(String src)
- {
- this.src = src;
- }
-
- /** @return a substring */
- public String substring(int beginIndex, int endIndex)
- {
- return src.substring(beginIndex, endIndex);
- }
-
- /** @return a substring */
- public String substring(int beginIndex)
- {
- return src.substring(beginIndex);
- }
-
- /** @return a character at the specified position. */
- public char charAt(int pos)
- {
- return src.charAt(pos);
- }
-
- /** @return <tt>true</tt> iff if the specified index is after the end of the character stream */
- public boolean isEnd(int pos)
- {
- return (pos >= src.length());
- }
-}
diff --git a/src/com/sun/org/apache/regexp/internal/recompile.java b/src/com/sun/org/apache/regexp/internal/recompile.java
deleted file mode 100644
index fc0cbb3..0000000
--- a/src/com/sun/org/apache/regexp/internal/recompile.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.regexp.internal;
-
-import com.sun.org.apache.regexp.internal.RECompiler;
-import com.sun.org.apache.regexp.internal.RESyntaxException;
-
-/**
- * 'recompile' is a command line tool that pre-compiles one or more regular expressions
- * for use with the regular expression matcher class 'RE'. For example, the command
- * "java recompile a*b" produces output like this:
- *
- * <pre>
- *
- * // Pre-compiled regular expression "a*b"
- * char[] re1Instructions =
- * {
- * 0x007c, 0x0000, 0x001a, 0x007c, 0x0000, 0x000d, 0x0041,
- * 0x0001, 0x0004, 0x0061, 0x007c, 0x0000, 0x0003, 0x0047,
- * 0x0000, 0xfff6, 0x007c, 0x0000, 0x0003, 0x004e, 0x0000,
- * 0x0003, 0x0041, 0x0001, 0x0004, 0x0062, 0x0045, 0x0000,
- * 0x0000,
- * };
- *
- * REProgram re1 = new REProgram(re1Instructions);
- *
- * </pre>
- *
- * By pasting this output into your code, you can construct a regular expression matcher
- * (RE) object directly from the pre-compiled data (the character array re1), thus avoiding
- * the overhead of compiling the expression at runtime. For example:
- *
- * <pre>
- *
- * RE r = new RE(re1);
- *
- * </pre>
- *
- * @see RE
- * @see RECompiler
- *
- * @author <a href="mailto:jonl@muppetlabs.com">Jonathan Locke</a>
- */
-public class recompile
-{
- /**
- * Main application entrypoint.
- * @param arg Command line arguments
- */
- static public void main(String[] arg)
- {
- // Create a compiler object
- RECompiler r = new RECompiler();
-
- // Print usage if arguments are incorrect
- if (arg.length <= 0 || arg.length % 2 != 0)
- {
- System.out.println("Usage: recompile <patternname> <pattern>");
- System.exit(0);
- }
-
- // Loop through arguments, compiling each
- for (int i = 0; i < arg.length; i += 2)
- {
- try
- {
- // Compile regular expression
- String name = arg[i];
- String pattern = arg[i+1];
- String instructions = name + "PatternInstructions";
-
- // Output program as a nice, formatted character array
- System.out.print("\n // Pre-compiled regular expression '" + pattern + "'\n"
- + " private static char[] " + instructions + " = \n {");
-
- // Compile program for pattern
- REProgram program = r.compile(pattern);
-
- // Number of columns in output
- int numColumns = 7;
-
- // Loop through program
- char[] p = program.getInstructions();
- for (int j = 0; j < p.length; j++)
- {
- // End of column?
- if ((j % numColumns) == 0)
- {
- System.out.print("\n ");
- }
-
- // Print character as padded hex number
- String hex = Integer.toHexString(p[j]);
- while (hex.length() < 4)
- {
- hex = "0" + hex;
- }
- System.out.print("0x" + hex + ", ");
- }
-
- // End of program block
- System.out.println("\n };");
- System.out.println("\n private static RE " + name + "Pattern = new RE(new REProgram(" + instructions + "));");
- }
- catch (RESyntaxException e)
- {
- System.out.println("Syntax error in expression \"" + arg[i] + "\": " + e.toString());
- }
- catch (Exception e)
- {
- System.out.println("Unexpected exception: " + e.toString());
- }
- catch (Error e)
- {
- System.out.println("Internal error: " + e.toString());
- }
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/Version.java b/src/com/sun/org/apache/xalan/internal/Version.java
deleted file mode 100644
index be9c19d..0000000
--- a/src/com/sun/org/apache/xalan/internal/Version.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Version.java,v 1.1.2.1 2005/08/01 02:11:19 jeffsuttor Exp $
- */
-package com.sun.org.apache.xalan.internal;
-
-/**
- * Administrative class to keep track of the version number of
- * the Xalan release.
- * <P>This class implements the upcoming standard of having
- * org.apache.project-name.Version.getVersion() be a standard way
- * to get version information. This class will replace the older
- * com.sun.org.apache.xalan.internal.processor.Version class.</P>
- * <P>See also: com/sun/org/apache/xalan/internal/res/XSLTInfo.properties for
- * information about the version of the XSLT spec we support.</P>
- * @xsl.usage general
- */
-public class Version
-{
-
- /**
- * Get the basic version string for the current Xalan release.
- * Version String formatted like
- * <CODE>"<B>Xalan</B> <B>Java</B> v.r[.dd| <B>D</B>nn]"</CODE>.
- *
- * Futurework: have this read version info from jar manifest.
- *
- * @return String denoting our current version
- */
- public static String getVersion()
- {
- return getProduct()+" "+getImplementationLanguage()+" "
- +getMajorVersionNum()+"."+getReleaseVersionNum()+"."
- +( (getDevelopmentVersionNum() > 0) ?
- ("D"+getDevelopmentVersionNum()) : (""+getMaintenanceVersionNum()));
- }
-
- /**
- * Print the processor version to the command line.
- *
- * @param argv command line arguments, unused.
- */
- public static void _main(String argv[])
- {
- System.out.println(getVersion());
- }
-
- /**
- * Name of product: Xalan.
- */
- public static String getProduct()
- {
- return "Xalan";
- }
-
- /**
- * Implementation Language: Java.
- */
- public static String getImplementationLanguage()
- {
- return "Java";
- }
-
-
- /**
- * Major version number.
- * Version number. This changes only when there is a
- * significant, externally apparent enhancement from
- * the previous release. 'n' represents the n'th
- * version.
- *
- * Clients should carefully consider the implications
- * of new versions as external interfaces and behaviour
- * may have changed.
- */
- public static int getMajorVersionNum()
- {
- return 2;
-
- }
-
- /**
- * Release Number.
- * Release number. This changes when:
- * - a new set of functionality is to be added, eg,
- * implementation of a new W3C specification.
- * - API or behaviour change.
- * - its designated as a reference release.
- */
- public static int getReleaseVersionNum()
- {
- return 7;
- }
-
- /**
- * Maintenance Drop Number.
- * Optional identifier used to designate maintenance
- * drop applied to a specific release and contains
- * fixes for defects reported. It maintains compatibility
- * with the release and contains no API changes.
- * When missing, it designates the final and complete
- * development drop for a release.
- */
- public static int getMaintenanceVersionNum()
- {
- return 0;
- }
-
- /**
- * Development Drop Number.
- * Optional identifier designates development drop of
- * a specific release. D01 is the first development drop
- * of a new release.
- *
- * Development drops are works in progress towards a
- * compeleted, final release. A specific development drop
- * may not completely implement all aspects of a new
- * feature, which may take several development drops to
- * complete. At the point of the final drop for the
- * release, the D suffix will be omitted.
- *
- * Each 'D' drops can contain functional enhancements as
- * well as defect fixes. 'D' drops may not be as stable as
- * the final releases.
- */
- public static int getDevelopmentVersionNum()
- {
- try {
- if ((new String("")).length() == 0)
- return 0;
- else
- return Integer.parseInt("");
- } catch (NumberFormatException nfe) {
- return 0;
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/XalanConstants.java b/src/com/sun/org/apache/xalan/internal/XalanConstants.java
deleted file mode 100644
index d77dfb0..0000000
--- a/src/com/sun/org/apache/xalan/internal/XalanConstants.java
+++ /dev/null
@@ -1,266 +0,0 @@
-/*
- * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.org.apache.xalan.internal;
-
-import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
-
-/**
- * Commonly used constants.
- *
- * @author Huizhe Wang, Oracle
- *
- * @version $Id: Constants.java,v 1.14 2011-06-07 04:39:40 joehw Exp $
- */
-public final class XalanConstants {
-
- //
- // Constants
- //
- //Xerces security manager
- public static final String SECURITY_MANAGER =
- "http://apache.org/xml/properties/security-manager";
-
- //
- // Implementation limits: API properties
- //
- /** Oracle JAXP property prefix ("http://www.oracle.com/xml/jaxp/properties/"). */
- public static final String ORACLE_JAXP_PROPERTY_PREFIX =
- "http://www.oracle.com/xml/jaxp/properties/";
- /**
- * JDK entity expansion limit; Note that the existing system property
- * "entityExpansionLimit" with no prefix is still observed
- */
- public static final String JDK_ENTITY_EXPANSION_LIMIT =
- ORACLE_JAXP_PROPERTY_PREFIX + "entityExpansionLimit";
-
- /**
- * JDK element attribute limit; Note that the existing system property
- * "elementAttributeLimit" with no prefix is still observed
- */
- public static final String JDK_ELEMENT_ATTRIBUTE_LIMIT =
- ORACLE_JAXP_PROPERTY_PREFIX + "elementAttributeLimit";
-
- /**
- * JDK maxOccur limit; Note that the existing system property
- * "maxOccurLimit" with no prefix is still observed
- */
- public static final String JDK_MAX_OCCUR_LIMIT =
- ORACLE_JAXP_PROPERTY_PREFIX + "maxOccurLimit";
-
- /**
- * JDK total entity size limit
- */
- public static final String JDK_TOTAL_ENTITY_SIZE_LIMIT =
- ORACLE_JAXP_PROPERTY_PREFIX + "totalEntitySizeLimit";
-
- /**
- * JDK maximum general entity size limit
- */
- public static final String JDK_GENERAL_ENTITY_SIZE_LIMIT =
- ORACLE_JAXP_PROPERTY_PREFIX + "maxGeneralEntitySizeLimit";
-
- /**
- * JDK node count limit in entities that limits the total number of nodes
- * in all of entity references.
- */
- public static final String JDK_ENTITY_REPLACEMENT_LIMIT =
- ORACLE_JAXP_PROPERTY_PREFIX + "entityReplacementLimit";
-
- /**
- * JDK maximum parameter entity size limit
- */
- public static final String JDK_PARAMETER_ENTITY_SIZE_LIMIT =
- ORACLE_JAXP_PROPERTY_PREFIX + "maxParameterEntitySizeLimit";
- /**
- * JDK maximum XML name limit
- */
- public static final String JDK_XML_NAME_LIMIT =
- ORACLE_JAXP_PROPERTY_PREFIX + "maxXMLNameLimit";
-
- /**
- * JDK maxElementDepth limit
- */
- public static final String JDK_MAX_ELEMENT_DEPTH =
- ORACLE_JAXP_PROPERTY_PREFIX + "maxElementDepth";
-
- /**
- * JDK property indicating whether the parser shall print out entity
- * count information
- * Value: a string "yes" means print, "no" or any other string means not.
- */
- public static final String JDK_ENTITY_COUNT_INFO =
- ORACLE_JAXP_PROPERTY_PREFIX + "getEntityCountInfo";
-
- //
- // Implementation limits: corresponding System Properties of the above
- // API properties
- //
- /**
- * JDK entity expansion limit; Note that the existing system property
- * "entityExpansionLimit" with no prefix is still observed
- */
- public static final String SP_ENTITY_EXPANSION_LIMIT = "jdk.xml.entityExpansionLimit";
-
- /**
- * JDK element attribute limit; Note that the existing system property
- * "elementAttributeLimit" with no prefix is still observed
- */
- public static final String SP_ELEMENT_ATTRIBUTE_LIMIT = "jdk.xml.elementAttributeLimit";
-
- /**
- * JDK maxOccur limit; Note that the existing system property
- * "maxOccurLimit" with no prefix is still observed
- */
- public static final String SP_MAX_OCCUR_LIMIT = "jdk.xml.maxOccurLimit";
-
- /**
- * JDK total entity size limit
- */
- public static final String SP_TOTAL_ENTITY_SIZE_LIMIT = "jdk.xml.totalEntitySizeLimit";
-
- /**
- * JDK maximum general entity size limit
- */
- public static final String SP_GENERAL_ENTITY_SIZE_LIMIT = "jdk.xml.maxGeneralEntitySizeLimit";
-
- /**
- * JDK node count limit in entities that limits the total number of nodes
- * in all of entity references.
- */
- public static final String SP_ENTITY_REPLACEMENT_LIMIT = "jdk.xml.entityReplacementLimit";
-
- /**
- * JDK maximum parameter entity size limit
- */
- public static final String SP_PARAMETER_ENTITY_SIZE_LIMIT = "jdk.xml.maxParameterEntitySizeLimit";
- /**
- * JDK maximum XML name limit
- */
- public static final String SP_XML_NAME_LIMIT = "jdk.xml.maxXMLNameLimit";
-
- /**
- * JDK maxElementDepth limit
- */
- public static final String SP_MAX_ELEMENT_DEPTH = "jdk.xml.maxElementDepth";
-
- /**
- * JDK TransformerFactory and Transformer attribute that specifies a class
- * loader that will be used for extension functions class loading
- * Value: a "null", the default value, means that the default EF class loading
- * path will be used.
- * Instance of ClassLoader: the specified instance of ClassLoader will be used
- * for extension functions loading during translation process
- */
- public static final String JDK_EXTENSION_CLASSLOADER = "jdk.xml.transform.extensionClassLoader";
-
- //legacy System Properties
- public final static String ENTITY_EXPANSION_LIMIT = "entityExpansionLimit";
- public static final String ELEMENT_ATTRIBUTE_LIMIT = "elementAttributeLimit" ;
- public final static String MAX_OCCUR_LIMIT = "maxOccurLimit";
-
- /**
- * A string "yes" that can be used for properties such as getEntityCountInfo
- */
- public static final String JDK_YES = "yes";
-
- // Oracle Feature:
- /**
- * <p>Use Service Mechanism</p>
- *
- * <ul>
- * <li>
- * {@code true} instruct an object to use service mechanism to
- * find a service implementation. This is the default behavior.
- * </li>
- * <li>
- * {@code false} instruct an object to skip service mechanism and
- * use the default implementation for that service.
- * </li>
- * </ul>
- */
- public static final String ORACLE_FEATURE_SERVICE_MECHANISM = "http://www.oracle.com/feature/use-service-mechanism";
-
-
- //System Properties corresponding to ACCESS_EXTERNAL_* properties
- public static final String SP_ACCESS_EXTERNAL_STYLESHEET = "javax.xml.accessExternalStylesheet";
- public static final String SP_ACCESS_EXTERNAL_DTD = "javax.xml.accessExternalDTD";
-
- //all access keyword
- public static final String ACCESS_EXTERNAL_ALL = "all";
-
- /**
- * Default value when FEATURE_SECURE_PROCESSING (FSP) is set to true
- */
- public static final String EXTERNAL_ACCESS_DEFAULT_FSP = "";
-
- /**
- * FEATURE_SECURE_PROCESSING (FSP) is false by default
- */
- public static final String EXTERNAL_ACCESS_DEFAULT = ACCESS_EXTERNAL_ALL;
-
- public static final String XML_SECURITY_PROPERTY_MANAGER =
- ORACLE_JAXP_PROPERTY_PREFIX + "xmlSecurityPropertyManager";
-
- /**
- * Feature enableExtensionFunctions
- */
- public static final String ORACLE_ENABLE_EXTENSION_FUNCTION =
- ORACLE_JAXP_PROPERTY_PREFIX + "enableExtensionFunctions";
- public static final String SP_ORACLE_ENABLE_EXTENSION_FUNCTION = "javax.xml.enableExtensionFunctions";
-
- /**
- * Values for a feature
- */
- public static final String FEATURE_TRUE = "true";
- public static final String FEATURE_FALSE = "false";
-
- /**
- * Check if we're in jdk8 or above
- */
- public static final boolean IS_JDK8_OR_ABOVE = isJavaVersionAtLeast(8);
-
- /*
- * Check the version of the current JDK against that specified in the
- * parameter
- *
- * There is a proposal to change the java version string to:
- * MAJOR.MINOR.FU.CPU.PSU-BUILDNUMBER_BUGIDNUMBER_OPTIONAL
- * This method would work with both the current format and that proposed
- *
- * @param compareTo a JDK version to be compared to
- * @return true if the current version is the same or above that represented
- * by the parameter
- */
- public static boolean isJavaVersionAtLeast(int compareTo) {
- String javaVersion = SecuritySupport.getSystemProperty("java.version");
- String versions[] = javaVersion.split("\\.", 3);
- if (Integer.parseInt(versions[0]) >= compareTo ||
- Integer.parseInt(versions[1]) >= compareTo) {
- return true;
- }
- return false;
- }
-} // class Constants
diff --git a/src/com/sun/org/apache/xalan/internal/extensions/ExpressionContext.java b/src/com/sun/org/apache/xalan/internal/extensions/ExpressionContext.java
deleted file mode 100644
index 703e2af..0000000
--- a/src/com/sun/org/apache/xalan/internal/extensions/ExpressionContext.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ExpressionContext.java,v 1.2.4.1 2005/09/10 19:34:03 jeffsuttor Exp $
- */
-package com.sun.org.apache.xalan.internal.extensions;
-
-import javax.xml.transform.ErrorListener;
-
-import com.sun.org.apache.xpath.internal.objects.XObject;
-import org.w3c.dom.Node;
-import org.w3c.dom.traversal.NodeIterator;
-
-/**
- * An object that implements this interface can supply
- * information about the current XPath expression context.
- */
-public interface ExpressionContext
-{
-
- /**
- * Get the current context node.
- * @return The current context node.
- */
- public Node getContextNode();
-
- /**
- * Get the current context node list.
- * @return An iterator for the current context list, as
- * defined in XSLT.
- */
- public NodeIterator getContextNodes();
-
- /**
- * Get the error listener.
- * @return The registered error listener.
- */
- public ErrorListener getErrorListener();
-
- /**
- * Get the value of a node as a number.
- * @param n Node to be converted to a number. May be null.
- * @return value of n as a number.
- */
- public double toNumber(Node n);
-
- /**
- * Get the value of a node as a string.
- * @param n Node to be converted to a string. May be null.
- * @return value of n as a string, or an empty string if n is null.
- */
- public String toString(Node n);
-
- /**
- * Get a variable based on it's qualified name.
- *
- * @param qname The qualified name of the variable.
- *
- * @return The evaluated value of the variable.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject getVariableOrParam(com.sun.org.apache.xml.internal.utils.QName qname)
- throws javax.xml.transform.TransformerException;
-
- /**
- * Get the XPathContext that owns this ExpressionContext.
- *
- * Note: exslt:function requires the XPathContext to access
- * the variable stack and TransformerImpl.
- *
- * @return The current XPathContext.
- * @throws javax.xml.transform.TransformerException
- */
- public com.sun.org.apache.xpath.internal.XPathContext getXPathContext()
- throws javax.xml.transform.TransformerException;
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/extensions/package.html b/src/com/sun/org/apache/xalan/internal/extensions/package.html
deleted file mode 100644
index 8d1d379..0000000
--- a/src/com/sun/org/apache/xalan/internal/extensions/package.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!--
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
--->
-<!--
- * Copyright 2000-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
--->
-<!-- $Id -->
-<html>
- <title>Xalan Extension Mechanism Package.</title>
- <body>
- <p>Implementation of Xalan Extension Mechanism.<p>
- </body>
-</html>
-
-
diff --git a/src/com/sun/org/apache/xalan/internal/lib/ExsltBase.java b/src/com/sun/org/apache/xalan/internal/lib/ExsltBase.java
deleted file mode 100644
index 31f80b8..0000000
--- a/src/com/sun/org/apache/xalan/internal/lib/ExsltBase.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ExsltBase.java,v 1.1.2.1 2005/08/01 02:08:51 jeffsuttor Exp $
- */
-package com.sun.org.apache.xalan.internal.lib;
-
-import com.sun.org.apache.xml.internal.dtm.ref.DTMNodeProxy;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * The base class for some EXSLT extension classes.
- * It contains common utility methods to be used by the sub-classes.
- */
-public abstract class ExsltBase
-{
- /**
- * Return the string value of a Node
- *
- * @param n The Node.
- * @return The string value of the Node
- */
- protected static String toString(Node n)
- {
- if (n instanceof DTMNodeProxy)
- return ((DTMNodeProxy)n).getStringValue();
- else
- {
- String value = n.getNodeValue();
- if (value == null)
- {
- NodeList nodelist = n.getChildNodes();
- StringBuffer buf = new StringBuffer();
- for (int i = 0; i < nodelist.getLength(); i++)
- {
- Node childNode = nodelist.item(i);
- buf.append(toString(childNode));
- }
- return buf.toString();
- }
- else
- return value;
- }
- }
-
- /**
- * Convert the string value of a Node to a number.
- * Return NaN if the string is not a valid number.
- *
- * @param n The Node.
- * @return The number value of the Node
- */
- protected static double toNumber(Node n)
- {
- double d = 0.0;
- String str = toString(n);
- try
- {
- d = Double.valueOf(str).doubleValue();
- }
- catch (NumberFormatException e)
- {
- d= Double.NaN;
- }
- return d;
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/lib/ExsltCommon.java b/src/com/sun/org/apache/xalan/internal/lib/ExsltCommon.java
deleted file mode 100644
index b4493c0..0000000
--- a/src/com/sun/org/apache/xalan/internal/lib/ExsltCommon.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ExsltCommon.java,v 1.2.4.1 2005/09/15 02:45:24 jeffsuttor Exp $
- */
-package com.sun.org.apache.xalan.internal.lib;
-
-import com.sun.org.apache.xalan.internal.extensions.ExpressionContext;
-import com.sun.org.apache.xml.internal.dtm.DTMIterator;
-import com.sun.org.apache.xml.internal.dtm.ref.DTMNodeIterator;
-import com.sun.org.apache.xpath.internal.NodeSet;
-
-/**
- * This class contains EXSLT common extension functions.
- * It is accessed by specifying a namespace URI as follows:
- * <pre>
- * xmlns:exslt="http://exslt.org/common"
- * </pre>
- *
- * The documentation for each function has been copied from the relevant
- * EXSLT Implementer page.
- *
- * @see <a href="http://www.exslt.org/">EXSLT</a>
- * @xsl.usage general
- */
-public class ExsltCommon
-{
- /**
- * The exsl:object-type function returns a string giving the type of the object passed
- * as the argument. The possible object types are: 'string', 'number', 'boolean',
- * 'node-set', 'RTF', or 'external'.
- *
- * Most XSLT object types can be coerced to each other without error. However, there are
- * certain coercions that raise errors, most importantly treating anything other than a
- * node set as a node set. Authors of utilities such as named templates or user-defined
- * extension functions may wish to give some flexibility in the parameter and argument values
- * that are accepted by the utility; the exsl:object-type function enables them to do so.
- *
- * The Xalan extensions MethodResolver converts 'object-type' to 'objectType'.
- *
- * @param obj The object to be typed.
- * @return objectType 'string', 'number', 'boolean', 'node-set', 'RTF', or 'external'.
- *
- * @see <a href="http://www.exslt.org/">EXSLT</a>
- */
- public static String objectType (Object obj)
- {
- if (obj instanceof String)
- return "string";
- else if (obj instanceof Boolean)
- return "boolean";
- else if (obj instanceof Number)
- return "number";
- else if (obj instanceof DTMNodeIterator)
- {
- DTMIterator dtmI = ((DTMNodeIterator)obj).getDTMIterator();
- if (dtmI instanceof com.sun.org.apache.xpath.internal.axes.RTFIterator)
- return "RTF";
- else
- return "node-set";
- }
- else
- return "unknown";
- }
-
- /**
- * The exsl:node-set function converts a result tree fragment (which is what you get
- * when you use the content of xsl:variable rather than its select attribute to give
- * a variable value) into a node set. This enables you to process the XML that you create
- * within a variable, and therefore do multi-step processing.
- *
- * You can also use this function to turn a string into a text node, which is helpful
- * if you want to pass a string to a function that only accepts a node set.
- *
- * The Xalan extensions MethodResolver converts 'node-set' to 'nodeSet'.
- *
- * @param myProcessor is passed in by the Xalan extension processor
- * @param rtf The result tree fragment to be converted to a node-set.
- *
- * @return node-set with the contents of the result tree fragment.
- *
- * Note: Already implemented in the xalan namespace as nodeset.
- *
- * @see <a href="http://www.exslt.org/">EXSLT</a>
- */
- public static NodeSet nodeSet(ExpressionContext myProcessor, Object rtf)
- {
- return Extensions.nodeset(myProcessor, rtf);
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/lib/ExsltDatetime.java b/src/com/sun/org/apache/xalan/internal/lib/ExsltDatetime.java
deleted file mode 100644
index d717d8d..0000000
--- a/src/com/sun/org/apache/xalan/internal/lib/ExsltDatetime.java
+++ /dev/null
@@ -1,1122 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ExsltDatetime.java,v 1.2.4.1 2005/09/10 18:50:49 jeffsuttor Exp $
- */
-
-package com.sun.org.apache.xalan.internal.lib;
-
-
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.Locale;
-import java.util.TimeZone;
-
-import com.sun.org.apache.xpath.internal.objects.XBoolean;
-import com.sun.org.apache.xpath.internal.objects.XNumber;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-/**
- * This class contains EXSLT dates and times extension functions.
- * It is accessed by specifying a namespace URI as follows:
- * <pre>
- * xmlns:datetime="http://exslt.org/dates-and-times"
- * </pre>
- *
- * The documentation for each function has been copied from the relevant
- * EXSLT Implementer page.
- *
- * @see <a href="http://www.exslt.org/">EXSLT</a>
- * @xsl.usage general
- */
-
-public class ExsltDatetime
-{
- // Datetime formats (era and zone handled separately).
- static final String dt = "yyyy-MM-dd'T'HH:mm:ss";
- static final String d = "yyyy-MM-dd";
- static final String gym = "yyyy-MM";
- static final String gy = "yyyy";
- static final String gmd = "--MM-dd";
- static final String gm = "--MM--";
- static final String gd = "---dd";
- static final String t = "HH:mm:ss";
- static final String EMPTY_STR = "";
-
- /**
- * The date:date-time function returns the current date and time as a date/time string.
- * The date/time string that's returned must be a string in the format defined as the
- * lexical representation of xs:dateTime in
- * <a href="http://www.w3.org/TR/xmlschema-2/#dateTime">[3.2.7 dateTime]</a> of
- * <a href="http://www.w3.org/TR/xmlschema-2/">[XML Schema Part 2: Datatypes]</a>.
- * The date/time format is basically CCYY-MM-DDThh:mm:ss, although implementers should consult
- * <a href="http://www.w3.org/TR/xmlschema-2/">[XML Schema Part 2: Datatypes]</a> and
- * <a href="http://www.iso.ch/markete/8601.pdf">[ISO 8601]</a> for details.
- * The date/time string format must include a time zone, either a Z to indicate Coordinated
- * Universal Time or a + or - followed by the difference between the difference from UTC
- * represented as hh:mm.
- */
- public static String dateTime()
- {
- Calendar cal = Calendar.getInstance();
- Date datetime = cal.getTime();
- // Format for date and time.
- SimpleDateFormat dateFormat = new SimpleDateFormat(dt);
-
- StringBuffer buff = new StringBuffer(dateFormat.format(datetime));
- // Must also include offset from UTF.
- // Get the offset (in milliseconds).
- int offset = cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET);
- // If there is no offset, we have "Coordinated
- // Universal Time."
- if (offset == 0)
- buff.append("Z");
- else
- {
- // Convert milliseconds to hours and minutes
- int hrs = offset/(60*60*1000);
- // In a few cases, the time zone may be +/-hh:30.
- int min = offset%(60*60*1000);
- char posneg = hrs < 0? '-': '+';
- buff.append(posneg).append(formatDigits(hrs)).append(':').append(formatDigits(min));
- }
- return buff.toString();
- }
-
- /**
- * Represent the hours and minutes with two-digit strings.
- * @param q hrs or minutes.
- * @return two-digit String representation of hrs or minutes.
- */
- private static String formatDigits(int q)
- {
- String dd = String.valueOf(Math.abs(q));
- return dd.length() == 1 ? '0' + dd : dd;
- }
-
- /**
- * The date:date function returns the date specified in the date/time string given
- * as the argument. If no argument is given, then the current local date/time, as
- * returned by date:date-time is used as a default argument.
- * The date/time string that's returned must be a string in the format defined as the
- * lexical representation of xs:dateTime in
- * <a href="http://www.w3.org/TR/xmlschema-2/#dateTime">[3.2.7 dateTime]</a> of
- * <a href="http://www.w3.org/TR/xmlschema-2/">[XML Schema Part 2: Datatypes]</a>.
- * If the argument is not in either of these formats, date:date returns an empty string ('').
- * The date/time format is basically CCYY-MM-DDThh:mm:ss, although implementers should consult
- * <a href="http://www.w3.org/TR/xmlschema-2/">[XML Schema Part 2: Datatypes]</a> and
- * <a href="http://www.iso.ch/markete/8601.pdf">[ISO 8601]</a> for details.
- * The date is returned as a string with a lexical representation as defined for xs:date in
- * [3.2.9 date] of [XML Schema Part 2: Datatypes]. The date format is basically CCYY-MM-DD,
- * although implementers should consult [XML Schema Part 2: Datatypes] and [ISO 8601] for details.
- * If no argument is given or the argument date/time specifies a time zone, then the date string
- * format must include a time zone, either a Z to indicate Coordinated Universal Time or a + or -
- * followed by the difference between the difference from UTC represented as hh:mm. If an argument
- * is specified and it does not specify a time zone, then the date string format must not include
- * a time zone.
- */
- public static String date(String datetimeIn)
- throws ParseException
- {
- String[] edz = getEraDatetimeZone(datetimeIn);
- String leader = edz[0];
- String datetime = edz[1];
- String zone = edz[2];
- if (datetime == null || zone == null)
- return EMPTY_STR;
-
- String[] formatsIn = {dt, d};
- String formatOut = d;
- Date date = testFormats(datetime, formatsIn);
- if (date == null) return EMPTY_STR;
-
- SimpleDateFormat dateFormat = new SimpleDateFormat(formatOut);
- dateFormat.setLenient(false);
- String dateOut = dateFormat.format(date);
- if (dateOut.length() == 0)
- return EMPTY_STR;
- else
- return (leader + dateOut + zone);
- }
-
-
- /**
- * See above.
- */
- public static String date()
- {
- String datetime = dateTime().toString();
- String date = datetime.substring(0, datetime.indexOf("T"));
- String zone = datetime.substring(getZoneStart(datetime));
- return (date + zone);
- }
-
- /**
- * The date:time function returns the time specified in the date/time string given
- * as the argument. If no argument is given, then the current local date/time, as
- * returned by date:date-time is used as a default argument.
- * The date/time string that's returned must be a string in the format defined as the
- * lexical representation of xs:dateTime in
- * <a href="http://www.w3.org/TR/xmlschema-2/#dateTime">[3.2.7 dateTime]</a> of
- * <a href="http://www.w3.org/TR/xmlschema-2/">[XML Schema Part 2: Datatypes]</a>.
- * If the argument string is not in this format, date:time returns an empty string ('').
- * The date/time format is basically CCYY-MM-DDThh:mm:ss, although implementers should consult
- * <a href="http://www.w3.org/TR/xmlschema-2/">[XML Schema Part 2: Datatypes]</a> and
- * <a href="http://www.iso.ch/markete/8601.pdf">[ISO 8601]</a> for details.
- * The date is returned as a string with a lexical representation as defined for xs:time in
- * <a href="http://www.w3.org/TR/xmlschema-2/#time">[3.2.8 time]</a> of [XML Schema Part 2: Datatypes].
- * The time format is basically hh:mm:ss, although implementers should consult [XML Schema Part 2:
- * Datatypes] and [ISO 8601] for details.
- * If no argument is given or the argument date/time specifies a time zone, then the time string
- * format must include a time zone, either a Z to indicate Coordinated Universal Time or a + or -
- * followed by the difference between the difference from UTC represented as hh:mm. If an argument
- * is specified and it does not specify a time zone, then the time string format must not include
- * a time zone.
- */
- public static String time(String timeIn)
- throws ParseException
- {
- String[] edz = getEraDatetimeZone(timeIn);
- String time = edz[1];
- String zone = edz[2];
- if (time == null || zone == null)
- return EMPTY_STR;
-
- String[] formatsIn = {dt, d, t};
- String formatOut = t;
- Date date = testFormats(time, formatsIn);
- if (date == null) return EMPTY_STR;
- SimpleDateFormat dateFormat = new SimpleDateFormat(formatOut);
- String out = dateFormat.format(date);
- return (out + zone);
- }
-
- /**
- * See above.
- */
- public static String time()
- {
- String datetime = dateTime().toString();
- String time = datetime.substring(datetime.indexOf("T")+1);
-
- // The datetime() function returns the zone on the datetime string. If we
- // append it, we get the zone substring duplicated.
- // Fix for JIRA 2013
-
- // String zone = datetime.substring(getZoneStart(datetime));
- // return (time + zone);
- return (time);
- }
-
- /**
- * The date:year function returns the year of a date as a number. If no
- * argument is given, then the current local date/time, as returned by
- * date:date-time is used as a default argument.
- * The date/time string specified as the first argument must be a right-truncated
- * string in the format defined as the lexical representation of xs:dateTime in one
- * of the formats defined in
- * <a href="http://www.w3.org/TR/xmlschema-2/">[XML Schema Part 2: Datatypes]</a>.
- * The permitted formats are as follows:
- * xs:dateTime (CCYY-MM-DDThh:mm:ss)
- * xs:date (CCYY-MM-DD)
- * xs:gYearMonth (CCYY-MM)
- * xs:gYear (CCYY)
- * If the date/time string is not in one of these formats, then NaN is returned.
- */
- public static double year(String datetimeIn)
- throws ParseException
- {
- String[] edz = getEraDatetimeZone(datetimeIn);
- boolean ad = edz[0].length() == 0; // AD (Common Era -- empty leader)
- String datetime = edz[1];
- if (datetime == null)
- return Double.NaN;
-
- String[] formats = {dt, d, gym, gy};
- double yr = getNumber(datetime, formats, Calendar.YEAR);
- if (ad || yr == Double.NaN)
- return yr;
- else
- return -yr;
- }
-
- /**
- * See above.
- */
- public static double year()
- {
- Calendar cal = Calendar.getInstance();
- return cal.get(Calendar.YEAR);
- }
-
- /**
- * The date:month-in-year function returns the month of a date as a number. If no argument
- * is given, then the current local date/time, as returned by date:date-time is used
- * as a default argument.
- * The date/time string specified as the first argument is a left or right-truncated
- * string in the format defined as the lexical representation of xs:dateTime in one of
- * the formats defined in
- * <a href="http://www.w3.org/TR/xmlschema-2/">[XML Schema Part 2: Datatypes]</a>.
- * The permitted formats are as follows:
- * xs:dateTime (CCYY-MM-DDThh:mm:ss)
- * xs:date (CCYY-MM-DD)
- * xs:gYearMonth (CCYY-MM)
- * xs:gMonth (--MM--)
- * xs:gMonthDay (--MM-DD)
- * If the date/time string is not in one of these formats, then NaN is returned.
- */
- public static double monthInYear(String datetimeIn)
- throws ParseException
- {
- String[] edz = getEraDatetimeZone(datetimeIn);
- String datetime = edz[1];
- if (datetime == null)
- return Double.NaN;
-
- String[] formats = {dt, d, gym, gm, gmd};
- return getNumber(datetime, formats, Calendar.MONTH) + 1;
- }
-
- /**
- * See above.
- */
- public static double monthInYear()
- {
- Calendar cal = Calendar.getInstance();
- return cal.get(Calendar.MONTH) + 1;
- }
-
- /**
- * The date:week-in-year function returns the week of the year as a number. If no argument
- * is given, then the current local date/time, as returned by date:date-time is used as the
- * default argument. For the purposes of numbering, counting follows ISO 8601: week 1 in a year
- * is the week containing the first Thursday of the year, with new weeks beginning on a Monday.
- * The date/time string specified as the argument is a right-truncated string in the format
- * defined as the lexical representation of xs:dateTime in one of the formats defined in
- * <a href="http://www.w3.org/TR/xmlschema-2/">[XML Schema Part 2: Datatypes]</a>. The
- * permitted formats are as follows:
- * xs:dateTime (CCYY-MM-DDThh:mm:ss)
- * xs:date (CCYY-MM-DD)
- * If the date/time string is not in one of these formats, then NaN is returned.
- */
- public static double weekInYear(String datetimeIn)
- throws ParseException
- {
- String[] edz = getEraDatetimeZone(datetimeIn);
- String datetime = edz[1];
- if (datetime == null)
- return Double.NaN;
-
- String[] formats = {dt, d};
- return getNumber(datetime, formats, Calendar.WEEK_OF_YEAR);
- }
-
- /**
- * See above.
- */
- public static double weekInYear()
- {
- Calendar cal = Calendar.getInstance();
- return cal.get(Calendar.WEEK_OF_YEAR);
- }
-
- /**
- * The date:day-in-year function returns the day of a date in a year
- * as a number. If no argument is given, then the current local
- * date/time, as returned by date:date-time is used the default argument.
- * The date/time string specified as the argument is a right-truncated
- * string in the format defined as the lexical representation of xs:dateTime
- * in one of the formats defined in
- * <a href="http://www.w3.org/TR/xmlschema-2/">[XML Schema Part 2: Datatypes]</a>.
- * The permitted formats are as follows:
- * xs:dateTime (CCYY-MM-DDThh:mm:ss)
- * xs:date (CCYY-MM-DD)
- * If the date/time string is not in one of these formats, then NaN is returned.
- */
- public static double dayInYear(String datetimeIn)
- throws ParseException
- {
- String[] edz = getEraDatetimeZone(datetimeIn);
- String datetime = edz[1];
- if (datetime == null)
- return Double.NaN;
-
- String[] formats = {dt, d};
- return getNumber(datetime, formats, Calendar.DAY_OF_YEAR);
- }
-
- /**
- * See above.
- */
- public static double dayInYear()
- {
- Calendar cal = Calendar.getInstance();
- return cal.get(Calendar.DAY_OF_YEAR);
- }
-
-
- /**
- * The date:day-in-month function returns the day of a date as a number.
- * If no argument is given, then the current local date/time, as returned
- * by date:date-time is used the default argument.
- * The date/time string specified as the argument is a left or right-truncated
- * string in the format defined as the lexical representation of xs:dateTime
- * in one of the formats defined in
- * <a href="http://www.w3.org/TR/xmlschema-2/">[XML Schema Part 2: Datatypes]</a>.
- * The permitted formats are as follows:
- * xs:dateTime (CCYY-MM-DDThh:mm:ss)
- * xs:date (CCYY-MM-DD)
- * xs:gMonthDay (--MM-DD)
- * xs:gDay (---DD)
- * If the date/time string is not in one of these formats, then NaN is returned.
- */
- public static double dayInMonth(String datetimeIn)
- throws ParseException
- {
- String[] edz = getEraDatetimeZone(datetimeIn);
- String datetime = edz[1];
- String[] formats = {dt, d, gmd, gd};
- double day = getNumber(datetime, formats, Calendar.DAY_OF_MONTH);
- return day;
- }
-
- /**
- * See above.
- */
- public static double dayInMonth()
- {
- Calendar cal = Calendar.getInstance();
- return cal.get(Calendar.DAY_OF_MONTH);
- }
-
- /**
- * The date:day-of-week-in-month function returns the day-of-the-week
- * in a month of a date as a number (e.g. 3 for the 3rd Tuesday in May).
- * If no argument is given, then the current local date/time, as returned
- * by date:date-time is used the default argument.
- * The date/time string specified as the argument is a right-truncated string
- * in the format defined as the lexical representation of xs:dateTime in one
- * of the formats defined in
- * <a href="http://www.w3.org/TR/xmlschema-2/">[XML Schema Part 2: Datatypes]</a>.
- * The permitted formats are as follows:
- * xs:dateTime (CCYY-MM-DDThh:mm:ss)
- * xs:date (CCYY-MM-DD)
- * If the date/time string is not in one of these formats, then NaN is returned.
- */
- public static double dayOfWeekInMonth(String datetimeIn)
- throws ParseException
- {
- String[] edz = getEraDatetimeZone(datetimeIn);
- String datetime = edz[1];
- if (datetime == null)
- return Double.NaN;
-
- String[] formats = {dt, d};
- return getNumber(datetime, formats, Calendar.DAY_OF_WEEK_IN_MONTH);
- }
-
- /**
- * See above.
- */
- public static double dayOfWeekInMonth()
- {
- Calendar cal = Calendar.getInstance();
- return cal.get(Calendar.DAY_OF_WEEK_IN_MONTH);
- }
-
-
- /**
- * The date:day-in-week function returns the day of the week given in a
- * date as a number. If no argument is given, then the current local date/time,
- * as returned by date:date-time is used the default argument.
- * The date/time string specified as the argument is a right-truncated string
- * in the format defined as the lexical representation of xs:dateTime in one
- * of the formats defined in
- * <a href="http://www.w3.org/TR/xmlschema-2/">[XML Schema Part 2: Datatypes]</a>.
- * The permitted formats are as follows:
- * xs:dateTime (CCYY-MM-DDThh:mm:ss)
- * xs:date (CCYY-MM-DD)
- * If the date/time string is not in one of these formats, then NaN is returned.
- The numbering of days of the week starts at 1 for Sunday, 2 for Monday and so on up to 7 for Saturday.
- */
- public static double dayInWeek(String datetimeIn)
- throws ParseException
- {
- String[] edz = getEraDatetimeZone(datetimeIn);
- String datetime = edz[1];
- if (datetime == null)
- return Double.NaN;
-
- String[] formats = {dt, d};
- return getNumber(datetime, formats, Calendar.DAY_OF_WEEK);
- }
-
- /**
- * See above.
- */
- public static double dayInWeek()
- {
- Calendar cal = Calendar.getInstance();
- return cal.get(Calendar.DAY_OF_WEEK);
- }
-
- /**
- * The date:hour-in-day function returns the hour of the day as a number.
- * If no argument is given, then the current local date/time, as returned
- * by date:date-time is used the default argument.
- * The date/time string specified as the argument is a right-truncated
- * string in the format defined as the lexical representation of xs:dateTime
- * in one of the formats defined in
- * <a href="http://www.w3.org/TR/xmlschema-2/">[XML Schema Part 2: Datatypes]</a>.
- * The permitted formats are as follows:
- * xs:dateTime (CCYY-MM-DDThh:mm:ss)
- * xs:time (hh:mm:ss)
- * If the date/time string is not in one of these formats, then NaN is returned.
- */
- public static double hourInDay(String datetimeIn)
- throws ParseException
- {
- String[] edz = getEraDatetimeZone(datetimeIn);
- String datetime = edz[1];
- if (datetime == null)
- return Double.NaN;
-
- String[] formats = {dt, t};
- return getNumber(datetime, formats, Calendar.HOUR_OF_DAY);
- }
-
- /**
- * See above.
- */
- public static double hourInDay()
- {
- Calendar cal = Calendar.getInstance();
- return cal.get(Calendar.HOUR_OF_DAY);
- }
-
- /**
- * The date:minute-in-hour function returns the minute of the hour
- * as a number. If no argument is given, then the current local
- * date/time, as returned by date:date-time is used the default argument.
- * The date/time string specified as the argument is a right-truncated
- * string in the format defined as the lexical representation of xs:dateTime
- * in one of the formats defined in
- * <a href="http://www.w3.org/TR/xmlschema-2/">[XML Schema Part 2: Datatypes]</a>.
- * The permitted formats are as follows:
- * xs:dateTime (CCYY-MM-DDThh:mm:ss)
- * xs:time (hh:mm:ss)
- * If the date/time string is not in one of these formats, then NaN is returned.
- */
- public static double minuteInHour(String datetimeIn)
- throws ParseException
- {
- String[] edz = getEraDatetimeZone(datetimeIn);
- String datetime = edz[1];
- if (datetime == null)
- return Double.NaN;
-
- String[] formats = {dt,t};
- return getNumber(datetime, formats, Calendar.MINUTE);
- }
-
- /**
- * See above.
- */
- public static double minuteInHour()
- {
- Calendar cal = Calendar.getInstance();
- return cal.get(Calendar.MINUTE);
- }
-
- /**
- * The date:second-in-minute function returns the second of the minute
- * as a number. If no argument is given, then the current local
- * date/time, as returned by date:date-time is used the default argument.
- * The date/time string specified as the argument is a right-truncated
- * string in the format defined as the lexical representation of xs:dateTime
- * in one of the formats defined in
- * <a href="http://www.w3.org/TR/xmlschema-2/">[XML Schema Part 2: Datatypes]</a>.
- * The permitted formats are as follows:
- * xs:dateTime (CCYY-MM-DDThh:mm:ss)
- * xs:time (hh:mm:ss)
- * If the date/time string is not in one of these formats, then NaN is returned.
- */
- public static double secondInMinute(String datetimeIn)
- throws ParseException
- {
- String[] edz = getEraDatetimeZone(datetimeIn);
- String datetime = edz[1];
- if (datetime == null)
- return Double.NaN;
-
- String[] formats = {dt, t};
- return getNumber(datetime, formats, Calendar.SECOND);
- }
-
- /**
- * See above.
- */
- public static double secondInMinute()
- {
- Calendar cal = Calendar.getInstance();
- return cal.get(Calendar.SECOND);
- }
-
- /**
- * The date:leap-year function returns true if the year given in a date
- * is a leap year. If no argument is given, then the current local
- * date/time, as returned by date:date-time is used as a default argument.
- * The date/time string specified as the first argument must be a
- * right-truncated string in the format defined as the lexical representation
- * of xs:dateTime in one of the formats defined in
- * <a href="http://www.w3.org/TR/xmlschema-2/">[XML Schema Part 2: Datatypes]</a>.
- * The permitted formats are as follows:
- * xs:dateTime (CCYY-MM-DDThh:mm:ss)
- * xs:date (CCYY-MM-DD)
- * xs:gYearMonth (CCYY-MM)
- * xs:gYear (CCYY)
- * If the date/time string is not in one of these formats, then NaN is returned.
- */
- public static XObject leapYear(String datetimeIn)
- throws ParseException
- {
- String[] edz = getEraDatetimeZone(datetimeIn);
- String datetime = edz[1];
- if (datetime == null)
- return new XNumber(Double.NaN);
-
- String[] formats = {dt, d, gym, gy};
- double dbl = getNumber(datetime, formats, Calendar.YEAR);
- if (dbl == Double.NaN)
- return new XNumber(Double.NaN);
- int yr = (int)dbl;
- return new XBoolean(yr % 400 == 0 || (yr % 100 != 0 && yr % 4 == 0));
- }
-
- /**
- * See above.
- */
- public static boolean leapYear()
- {
- Calendar cal = Calendar.getInstance();
- int yr = (int)cal.get(Calendar.YEAR);
- return (yr % 400 == 0 || (yr % 100 != 0 && yr % 4 == 0));
- }
-
- /**
- * The date:month-name function returns the full name of the month of a date.
- * If no argument is given, then the current local date/time, as returned by
- * date:date-time is used the default argument.
- * The date/time string specified as the argument is a left or right-truncated
- * string in the format defined as the lexical representation of xs:dateTime in
- * one of the formats defined in
- * <a href="http://www.w3.org/TR/xmlschema-2/">[XML Schema Part 2: Datatypes]</a>.
- * The permitted formats are as follows:
- * xs:dateTime (CCYY-MM-DDThh:mm:ss)
- * xs:date (CCYY-MM-DD)
- * xs:gYearMonth (CCYY-MM)
- * xs:gMonth (--MM--)
- * If the date/time string is not in one of these formats, then an empty string ('')
- * is returned.
- * The result is an English month name: one of 'January', 'February', 'March',
- * 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November'
- * or 'December'.
- */
- public static String monthName(String datetimeIn)
- throws ParseException
- {
- String[] edz = getEraDatetimeZone(datetimeIn);
- String datetime = edz[1];
- if (datetime == null)
- return EMPTY_STR;
-
- String[] formatsIn = {dt, d, gym, gm};
- String formatOut = "MMMM";
- return getNameOrAbbrev(datetimeIn, formatsIn, formatOut);
- }
-
- /**
- * See above.
- */
- public static String monthName()
- {
- Calendar cal = Calendar.getInstance();
- String format = "MMMM";
- return getNameOrAbbrev(format);
- }
-
- /**
- * The date:month-abbreviation function returns the abbreviation of the month of
- * a date. If no argument is given, then the current local date/time, as returned
- * by date:date-time is used the default argument.
- * The date/time string specified as the argument is a left or right-truncated
- * string in the format defined as the lexical representation of xs:dateTime in
- * one of the formats defined in
- * <a href="http://www.w3.org/TR/xmlschema-2/">[XML Schema Part 2: Datatypes]</a>.
- * The permitted formats are as follows:
- * xs:dateTime (CCYY-MM-DDThh:mm:ss)
- * xs:date (CCYY-MM-DD)
- * xs:gYearMonth (CCYY-MM)
- * xs:gMonth (--MM--)
- * If the date/time string is not in one of these formats, then an empty string ('')
- * is returned.
- * The result is a three-letter English month abbreviation: one of 'Jan', 'Feb', 'Mar',
- * 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov' or 'Dec'.
- * An implementation of this extension function in the EXSLT date namespace must conform
- * to the behaviour described in this document.
- */
- public static String monthAbbreviation(String datetimeIn)
- throws ParseException
- {
- String[] edz = getEraDatetimeZone(datetimeIn);
- String datetime = edz[1];
- if (datetime == null)
- return EMPTY_STR;
-
- String[] formatsIn = {dt, d, gym, gm};
- String formatOut = "MMM";
- return getNameOrAbbrev(datetimeIn, formatsIn, formatOut);
- }
-
- /**
- * See above.
- */
- public static String monthAbbreviation()
- {
- String format = "MMM";
- return getNameOrAbbrev(format);
- }
-
- /**
- * The date:day-name function returns the full name of the day of the week
- * of a date. If no argument is given, then the current local date/time,
- * as returned by date:date-time is used the default argument.
- * The date/time string specified as the argument is a left or right-truncated
- * string in the format defined as the lexical representation of xs:dateTime
- * in one of the formats defined in
- * <a href="http://www.w3.org/TR/xmlschema-2/">[XML Schema Part 2: Datatypes]</a>.
- * The permitted formats are as follows:
- * xs:dateTime (CCYY-MM-DDThh:mm:ss)
- * xs:date (CCYY-MM-DD)
- * If the date/time string is not in one of these formats, then the empty string ('')
- * is returned.
- * The result is an English day name: one of 'Sunday', 'Monday', 'Tuesday', 'Wednesday',
- * 'Thursday' or 'Friday'.
- * An implementation of this extension function in the EXSLT date namespace must conform
- * to the behaviour described in this document.
- */
- public static String dayName(String datetimeIn)
- throws ParseException
- {
- String[] edz = getEraDatetimeZone(datetimeIn);
- String datetime = edz[1];
- if (datetime == null)
- return EMPTY_STR;
-
- String[] formatsIn = {dt, d};
- String formatOut = "EEEE";
- return getNameOrAbbrev(datetimeIn, formatsIn, formatOut);
- }
-
- /**
- * See above.
- */
- public static String dayName()
- {
- String format = "EEEE";
- return getNameOrAbbrev(format);
- }
-
- /**
- * The date:day-abbreviation function returns the abbreviation of the day
- * of the week of a date. If no argument is given, then the current local
- * date/time, as returned by date:date-time is used the default argument.
- * The date/time string specified as the argument is a left or right-truncated
- * string in the format defined as the lexical representation of xs:dateTime
- * in one of the formats defined in
- * <a href="http://www.w3.org/TR/xmlschema-2/">[XML Schema Part 2: Datatypes]</a>.
- * The permitted formats are as follows:
- * xs:dateTime (CCYY-MM-DDThh:mm:ss)
- * xs:date (CCYY-MM-DD)
- * If the date/time string is not in one of these formats, then the empty string
- * ('') is returned.
- * The result is a three-letter English day abbreviation: one of 'Sun', 'Mon', 'Tue',
- * 'Wed', 'Thu' or 'Fri'.
- * An implementation of this extension function in the EXSLT date namespace must conform
- * to the behaviour described in this document.
- */
- public static String dayAbbreviation(String datetimeIn)
- throws ParseException
- {
- String[] edz = getEraDatetimeZone(datetimeIn);
- String datetime = edz[1];
- if (datetime == null)
- return EMPTY_STR;
-
- String[] formatsIn = {dt, d};
- String formatOut = "EEE";
- return getNameOrAbbrev(datetimeIn, formatsIn, formatOut);
- }
-
- /**
- * See above.
- */
- public static String dayAbbreviation()
- {
- String format = "EEE";
- return getNameOrAbbrev(format);
- }
-
- /**
- * Returns an array with the 3 components that a datetime input string
- * may contain: - (for BC era), datetime, and zone. If the zone is not
- * valid, return null for that component.
- */
- private static String[] getEraDatetimeZone(String in)
- {
- String leader = "";
- String datetime = in;
- String zone = "";
- if (in.charAt(0)=='-' && !in.startsWith("--"))
- {
- leader = "-"; // '+' is implicit , not allowed
- datetime = in.substring(1);
- }
- int z = getZoneStart(datetime);
- if (z > 0)
- {
- zone = datetime.substring(z);
- datetime = datetime.substring(0, z);
- }
- else if (z == -2)
- zone = null;
- //System.out.println("'" + leader + "' " + datetime + " " + zone);
- return new String[]{leader, datetime, zone};
- }
-
- /**
- * Get the start of zone information if the input ends
- * with 'Z' or +/-hh:mm. If a zone string is not
- * found, return -1; if the zone string is invalid,
- * return -2.
- */
- private static int getZoneStart (String datetime)
- {
- if (datetime.indexOf("Z") == datetime.length()-1)
- return datetime.length()-1;
- else if (datetime.length() >=6
- && datetime.charAt(datetime.length()-3) == ':'
- && (datetime.charAt(datetime.length()-6) == '+'
- || datetime.charAt(datetime.length()-6) == '-'))
- {
- try
- {
- SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm");
- dateFormat.setLenient(false);
- Date d = dateFormat.parse(datetime.substring(datetime.length() -5));
- return datetime.length()-6;
- }
- catch (ParseException pe)
- {
- System.out.println("ParseException " + pe.getErrorOffset());
- return -2; // Invalid.
- }
-
- }
- return -1; // No zone information.
- }
-
- /**
- * Attempt to parse an input string with the allowed formats, returning
- * null if none of the formats work.
- */
- private static Date testFormats (String in, String[] formats)
- throws ParseException
- {
- for (int i = 0; i <formats.length; i++)
- {
- try
- {
- SimpleDateFormat dateFormat = new SimpleDateFormat(formats[i]);
- dateFormat.setLenient(false);
- return dateFormat.parse(in);
- }
- catch (ParseException pe)
- {
- }
- }
- return null;
- }
-
-
- /**
- * Parse the input string and return the corresponding calendar field
- * number.
- */
- private static double getNumber(String in, String[] formats, int calField)
- throws ParseException
- {
- Calendar cal = Calendar.getInstance();
- cal.setLenient(false);
- // Try the allowed formats, from longest to shortest.
- Date date = testFormats(in, formats);
- if (date == null) return Double.NaN;
- cal.setTime(date);
- return cal.get(calField);
- }
-
- /**
- * Get the full name or abbreviation of the month or day.
- */
- private static String getNameOrAbbrev(String in,
- String[] formatsIn,
- String formatOut)
- throws ParseException
- {
- for (int i = 0; i <formatsIn.length; i++) // from longest to shortest.
- {
- try
- {
- SimpleDateFormat dateFormat = new SimpleDateFormat(formatsIn[i], Locale.ENGLISH);
- dateFormat.setLenient(false);
- Date dt = dateFormat.parse(in);
- dateFormat.applyPattern(formatOut);
- return dateFormat.format(dt);
- }
- catch (ParseException pe)
- {
- }
- }
- return "";
- }
- /**
- * Get the full name or abbreviation for the current month or day
- * (no input string).
- */
- private static String getNameOrAbbrev(String format)
- {
- Calendar cal = Calendar.getInstance();
- SimpleDateFormat dateFormat = new SimpleDateFormat(format, Locale.ENGLISH);
- return dateFormat.format(cal.getTime());
- }
-
- /**
- * The date:format-date function formats a date/time according to a pattern.
- * <p>
- * The first argument to date:format-date specifies the date/time to be
- * formatted. It must be right or left-truncated date/time strings in one of
- * the formats defined in
- * <a href="http://www.w3.org/TR/xmlschema-2/">[XML Schema Part 2: Datatypes]</a>.
- * The permitted formats are as follows:
- * <ul>
- * <li>xs:dateTime (CCYY-MM-DDThh:mm:ss)
- * <li>xs:date (CCYY-MM-DD)
- * <li>xs:time (hh:mm:ss)
- * <li>xs:gYearMonth (CCYY-MM)
- * <li>xs:gYear (CCYY)
- * <li>xs:gMonthDay (--MM-DD)
- * <li>xs:gMonth (--MM--)
- * <li>xs:gDay (---DD)
- * </ul>
- * The second argument is a string that gives the format pattern used to
- * format the date. The format pattern must be in the syntax specified by
- * the JDK 1.1 SimpleDateFormat class. The format pattern string is
- * interpreted as described for the JDK 1.1 SimpleDateFormat class.
- * <p>
- * If the date/time format is right-truncated (i.e. in a format other than
- * xs:time, or xs:dateTime) then any missing components are assumed to be as
- * follows: if no month is specified, it is given a month of 01; if no day
- * is specified, it is given a day of 01; if no time is specified, it is
- * given a time of 00:00:00.
- * <p>
- * If the date/time format is left-truncated (i.e. xs:time, xs:gMonthDay,
- * xs:gMonth or xs:gDay) and the format pattern has a token that uses a
- * component that is missing from the date/time format used, then that token
- * is replaced with an empty string ('') within the result.
- *
- * The author is Helg Bredow (helg.bredow@kalido.com)
- */
- public static String formatDate(String dateTime, String pattern)
- {
- final String yearSymbols = "Gy";
- final String monthSymbols = "M";
- final String daySymbols = "dDEFwW";
- TimeZone timeZone;
- String zone;
-
- // Get the timezone information if it was supplied and modify the
- // dateTime so that SimpleDateFormat will understand it.
- if (dateTime.endsWith("Z") || dateTime.endsWith("z"))
- {
- timeZone = TimeZone.getTimeZone("GMT");
- dateTime = dateTime.substring(0, dateTime.length()-1) + "GMT";
- zone = "z";
- }
- else if ((dateTime.length() >= 6)
- && (dateTime.charAt(dateTime.length()-3) == ':')
- && ((dateTime.charAt(dateTime.length()-6) == '+')
- || (dateTime.charAt(dateTime.length()-6) == '-')))
- {
- String offset = dateTime.substring(dateTime.length()-6);
-
- if ("+00:00".equals(offset) || "-00:00".equals(offset))
- {
- timeZone = TimeZone.getTimeZone("GMT");
- }
- else
- {
- timeZone = TimeZone.getTimeZone("GMT" + offset);
- }
- zone = "z";
- // Need to adjust it since SimpleDateFormat requires GMT+hh:mm but
- // we have +hh:mm.
- dateTime = dateTime.substring(0, dateTime.length()-6) + "GMT" + offset;
- }
- else
- {
- // Assume local time.
- timeZone = TimeZone.getDefault();
- zone = "";
- // Leave off the timezone since SimpleDateFormat will assume local
- // time if time zone is not included.
- }
- String[] formats = {dt + zone, d, gym, gy};
-
- // Try the time format first. We need to do this to prevent
- // SimpleDateFormat from interpreting a time as a year. i.e we just need
- // to check if it's a time before we check it's a year.
- try
- {
- SimpleDateFormat inFormat = new SimpleDateFormat(t + zone);
- inFormat.setLenient(false);
- Date d= inFormat.parse(dateTime);
- SimpleDateFormat outFormat = new SimpleDateFormat(strip
- (yearSymbols + monthSymbols + daySymbols, pattern));
- outFormat.setTimeZone(timeZone);
- return outFormat.format(d);
- }
- catch (ParseException pe)
- {
- }
-
- // Try the right truncated formats.
- for (int i = 0; i < formats.length; i++)
- {
- try
- {
- SimpleDateFormat inFormat = new SimpleDateFormat(formats[i]);
- inFormat.setLenient(false);
- Date d = inFormat.parse(dateTime);
- SimpleDateFormat outFormat = new SimpleDateFormat(pattern);
- outFormat.setTimeZone(timeZone);
- return outFormat.format(d);
- }
- catch (ParseException pe)
- {
- }
- }
-
- // Now try the left truncated ones. The Java format() function doesn't
- // return the correct strings in this case. We strip any pattern
- // symbols that shouldn't be output so that they are not defaulted to
- // inappropriate values in the output.
- try
- {
- SimpleDateFormat inFormat = new SimpleDateFormat(gmd);
- inFormat.setLenient(false);
- Date d = inFormat.parse(dateTime);
- SimpleDateFormat outFormat = new SimpleDateFormat(strip(yearSymbols, pattern));
- outFormat.setTimeZone(timeZone);
- return outFormat.format(d);
- }
- catch (ParseException pe)
- {
- }
- try
- {
- SimpleDateFormat inFormat = new SimpleDateFormat(gm);
- inFormat.setLenient(false);
- Date d = inFormat.parse(dateTime);
- SimpleDateFormat outFormat = new SimpleDateFormat(strip(yearSymbols, pattern));
- outFormat.setTimeZone(timeZone);
- return outFormat.format(d);
- }
- catch (ParseException pe)
- {
- }
- try
- {
- SimpleDateFormat inFormat = new SimpleDateFormat(gd);
- inFormat.setLenient(false);
- Date d = inFormat.parse(dateTime);
- SimpleDateFormat outFormat = new SimpleDateFormat(strip(yearSymbols + monthSymbols, pattern));
- outFormat.setTimeZone(timeZone);
- return outFormat.format(d);
- }
- catch (ParseException pe)
- {
- }
- return EMPTY_STR;
- }
-
- /**
- * Strips occurrences of the given character from a date format pattern.
- * @param symbols list of symbols to strip.
- * @param pattern
- * @return
- */
- private static String strip(String symbols, String pattern)
- {
- int quoteSemaphore = 0;
- int i = 0;
- StringBuffer result = new StringBuffer(pattern.length());
-
- while (i < pattern.length())
- {
- char ch = pattern.charAt(i);
- if (ch == '\'')
- {
- // Assume it's an openening quote so simply copy the quoted
- // text to the result. There is nothing to strip here.
- int endQuote = pattern.indexOf('\'', i + 1);
- if (endQuote == -1)
- {
- endQuote = pattern.length();
- }
- result.append(pattern.substring(i, endQuote));
- i = endQuote++;
- }
- else if (symbols.indexOf(ch) > -1)
- {
- // The char needs to be stripped.
- i++;
- }
- else
- {
- result.append(ch);
- i++;
- }
- }
- return result.toString();
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/lib/ExsltDynamic.java b/src/com/sun/org/apache/xalan/internal/lib/ExsltDynamic.java
deleted file mode 100644
index 7f55d89..0000000
--- a/src/com/sun/org/apache/xalan/internal/lib/ExsltDynamic.java
+++ /dev/null
@@ -1,616 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ExsltDynamic.java,v 1.1.2.1 2005/08/01 02:08:51 jeffsuttor Exp $
- */
-package com.sun.org.apache.xalan.internal.lib;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.transform.TransformerException;
-
-import com.sun.org.apache.xalan.internal.extensions.ExpressionContext;
-import com.sun.org.apache.xalan.internal.res.XSLMessages;
-import com.sun.org.apache.xalan.internal.res.XSLTErrorResources;
-import com.sun.org.apache.xpath.internal.NodeSet;
-import com.sun.org.apache.xpath.internal.NodeSetDTM;
-import com.sun.org.apache.xpath.internal.XPath;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XBoolean;
-import com.sun.org.apache.xpath.internal.objects.XNodeSet;
-import com.sun.org.apache.xpath.internal.objects.XNumber;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-
-import org.xml.sax.SAXNotSupportedException;
-
-/**
- * This class contains EXSLT dynamic extension functions.
- *
- * It is accessed by specifying a namespace URI as follows:
- * <pre>
- * xmlns:dyn="http://exslt.org/dynamic"
- * </pre>
- * The documentation for each function has been copied from the relevant
- * EXSLT Implementer page.
- *
- * @see <a href="http://www.exslt.org/">EXSLT</a>
-
- * @xsl.usage general
- */
-public class ExsltDynamic extends ExsltBase
-{
-
- public static final String EXSL_URI = "http://exslt.org/common";
-
- /**
- * The dyn:max function calculates the maximum value for the nodes passed as
- * the first argument, where the value of each node is calculated dynamically
- * using an XPath expression passed as a string as the second argument.
- * <p>
- * The expressions are evaluated relative to the nodes passed as the first argument.
- * In other words, the value for each node is calculated by evaluating the XPath
- * expression with all context information being the same as that for the call to
- * the dyn:max function itself, except for the following:
- * <p>
- * <ul>
- * <li>the context node is the node whose value is being calculated.</li>
- * <li>the context position is the position of the node within the node set passed as
- * the first argument to the dyn:max function, arranged in document order.</li>
- * <li>the context size is the number of nodes passed as the first argument to the
- * dyn:max function.</li>
- * </ul>
- * <p>
- * The dyn:max function returns the maximum of these values, calculated in exactly
- * the same way as for math:max.
- * <p>
- * If the expression string passed as the second argument is an invalid XPath
- * expression (including an empty string), this function returns NaN.
- * <p>
- * This function must take a second argument. To calculate the maximum of a set of
- * nodes based on their string values, you should use the math:max function.
- *
- * @param myContext The ExpressionContext passed by the extension processor
- * @param nl The node set
- * @param expr The expression string
- *
- * @return The maximum evaluation value
- */
- public static double max(ExpressionContext myContext, NodeList nl, String expr)
- throws SAXNotSupportedException
- {
-
- XPathContext xctxt = null;
- if (myContext instanceof XPathContext.XPathExpressionContext)
- xctxt = ((XPathContext.XPathExpressionContext) myContext).getXPathContext();
- else
- throw new SAXNotSupportedException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_CONTEXT_PASSED, new Object[]{myContext }));
-
- if (expr == null || expr.length() == 0)
- return Double.NaN;
-
- NodeSetDTM contextNodes = new NodeSetDTM(nl, xctxt);
- xctxt.pushContextNodeList(contextNodes);
-
- double maxValue = - Double.MAX_VALUE;
- for (int i = 0; i < contextNodes.getLength(); i++)
- {
- int contextNode = contextNodes.item(i);
- xctxt.pushCurrentNode(contextNode);
-
- double result = 0;
- try
- {
- XPath dynamicXPath = new XPath(expr, xctxt.getSAXLocator(),
- xctxt.getNamespaceContext(),
- XPath.SELECT);
- result = dynamicXPath.execute(xctxt, contextNode, xctxt.getNamespaceContext()).num();
- }
- catch (TransformerException e)
- {
- xctxt.popCurrentNode();
- xctxt.popContextNodeList();
- return Double.NaN;
- }
-
- xctxt.popCurrentNode();
-
- if (result > maxValue)
- maxValue = result;
- }
-
- xctxt.popContextNodeList();
- return maxValue;
-
- }
-
- /**
- * The dyn:min function calculates the minimum value for the nodes passed as the
- * first argument, where the value of each node is calculated dynamically using
- * an XPath expression passed as a string as the second argument.
- * <p>
- * The expressions are evaluated relative to the nodes passed as the first argument.
- * In other words, the value for each node is calculated by evaluating the XPath
- * expression with all context information being the same as that for the call to
- * the dyn:min function itself, except for the following:
- * <p>
- * <ul>
- * <li>the context node is the node whose value is being calculated.</li>
- * <li>the context position is the position of the node within the node set passed
- * as the first argument to the dyn:min function, arranged in document order.</li>
- * <li>the context size is the number of nodes passed as the first argument to the
- * dyn:min function.</li>
- * </ul>
- * <p>
- * The dyn:min function returns the minimum of these values, calculated in exactly
- * the same way as for math:min.
- * <p>
- * If the expression string passed as the second argument is an invalid XPath expression
- * (including an empty string), this function returns NaN.
- * <p>
- * This function must take a second argument. To calculate the minimum of a set of
- * nodes based on their string values, you should use the math:min function.
- *
- * @param myContext The ExpressionContext passed by the extension processor
- * @param nl The node set
- * @param expr The expression string
- *
- * @return The minimum evaluation value
- */
- public static double min(ExpressionContext myContext, NodeList nl, String expr)
- throws SAXNotSupportedException
- {
-
- XPathContext xctxt = null;
- if (myContext instanceof XPathContext.XPathExpressionContext)
- xctxt = ((XPathContext.XPathExpressionContext) myContext).getXPathContext();
- else
- throw new SAXNotSupportedException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_CONTEXT_PASSED, new Object[]{myContext }));
-
- if (expr == null || expr.length() == 0)
- return Double.NaN;
-
- NodeSetDTM contextNodes = new NodeSetDTM(nl, xctxt);
- xctxt.pushContextNodeList(contextNodes);
-
- double minValue = Double.MAX_VALUE;
- for (int i = 0; i < nl.getLength(); i++)
- {
- int contextNode = contextNodes.item(i);
- xctxt.pushCurrentNode(contextNode);
-
- double result = 0;
- try
- {
- XPath dynamicXPath = new XPath(expr, xctxt.getSAXLocator(),
- xctxt.getNamespaceContext(),
- XPath.SELECT);
- result = dynamicXPath.execute(xctxt, contextNode, xctxt.getNamespaceContext()).num();
- }
- catch (TransformerException e)
- {
- xctxt.popCurrentNode();
- xctxt.popContextNodeList();
- return Double.NaN;
- }
-
- xctxt.popCurrentNode();
-
- if (result < minValue)
- minValue = result;
- }
-
- xctxt.popContextNodeList();
- return minValue;
-
- }
-
- /**
- * The dyn:sum function calculates the sum for the nodes passed as the first argument,
- * where the value of each node is calculated dynamically using an XPath expression
- * passed as a string as the second argument.
- * <p>
- * The expressions are evaluated relative to the nodes passed as the first argument.
- * In other words, the value for each node is calculated by evaluating the XPath
- * expression with all context information being the same as that for the call to
- * the dyn:sum function itself, except for the following:
- * <p>
- * <ul>
- * <li>the context node is the node whose value is being calculated.</li>
- * <li>the context position is the position of the node within the node set passed as
- * the first argument to the dyn:sum function, arranged in document order.</li>
- * <li>the context size is the number of nodes passed as the first argument to the
- * dyn:sum function.</li>
- * </ul>
- * <p>
- * The dyn:sum function returns the sumimum of these values, calculated in exactly
- * the same way as for sum.
- * <p>
- * If the expression string passed as the second argument is an invalid XPath
- * expression (including an empty string), this function returns NaN.
- * <p>
- * This function must take a second argument. To calculate the sumimum of a set of
- * nodes based on their string values, you should use the sum function.
- *
- * @param myContext The ExpressionContext passed by the extension processor
- * @param nl The node set
- * @param expr The expression string
- *
- * @return The sum of the evaluation value on each node
- */
- public static double sum(ExpressionContext myContext, NodeList nl, String expr)
- throws SAXNotSupportedException
- {
- XPathContext xctxt = null;
- if (myContext instanceof XPathContext.XPathExpressionContext)
- xctxt = ((XPathContext.XPathExpressionContext) myContext).getXPathContext();
- else
- throw new SAXNotSupportedException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_CONTEXT_PASSED, new Object[]{myContext }));
-
- if (expr == null || expr.length() == 0)
- return Double.NaN;
-
- NodeSetDTM contextNodes = new NodeSetDTM(nl, xctxt);
- xctxt.pushContextNodeList(contextNodes);
-
- double sum = 0;
- for (int i = 0; i < nl.getLength(); i++)
- {
- int contextNode = contextNodes.item(i);
- xctxt.pushCurrentNode(contextNode);
-
- double result = 0;
- try
- {
- XPath dynamicXPath = new XPath(expr, xctxt.getSAXLocator(),
- xctxt.getNamespaceContext(),
- XPath.SELECT);
- result = dynamicXPath.execute(xctxt, contextNode, xctxt.getNamespaceContext()).num();
- }
- catch (TransformerException e)
- {
- xctxt.popCurrentNode();
- xctxt.popContextNodeList();
- return Double.NaN;
- }
-
- xctxt.popCurrentNode();
-
- sum = sum + result;
-
- }
-
- xctxt.popContextNodeList();
- return sum;
- }
-
- /**
- * The dyn:map function evaluates the expression passed as the second argument for
- * each of the nodes passed as the first argument, and returns a node set of those values.
- * <p>
- * The expressions are evaluated relative to the nodes passed as the first argument.
- * In other words, the value for each node is calculated by evaluating the XPath
- * expression with all context information being the same as that for the call to
- * the dyn:map function itself, except for the following:
- * <p>
- * <ul>
- * <li>The context node is the node whose value is being calculated.</li>
- * <li>the context position is the position of the node within the node set passed
- * as the first argument to the dyn:map function, arranged in document order.</li>
- * <li>the context size is the number of nodes passed as the first argument to the
- * dyn:map function.</li>
- * </ul>
- * <p>
- * If the expression string passed as the second argument is an invalid XPath
- * expression (including an empty string), this function returns an empty node set.
- * <p>
- * If the XPath expression evaluates as a node set, the dyn:map function returns
- * the union of the node sets returned by evaluating the expression for each of the
- * nodes in the first argument. Note that this may mean that the node set resulting
- * from the call to the dyn:map function contains a different number of nodes from
- * the number in the node set passed as the first argument to the function.
- * <p>
- * If the XPath expression evaluates as a number, the dyn:map function returns a
- * node set containing one exsl:number element (namespace http://exslt.org/common)
- * for each node in the node set passed as the first argument to the dyn:map function,
- * in document order. The string value of each exsl:number element is the same as
- * the result of converting the number resulting from evaluating the expression to
- * a string as with the number function, with the exception that Infinity results
- * in an exsl:number holding the highest number the implementation can store, and
- * -Infinity results in an exsl:number holding the lowest number the implementation
- * can store.
- * <p>
- * If the XPath expression evaluates as a boolean, the dyn:map function returns a
- * node set containing one exsl:boolean element (namespace http://exslt.org/common)
- * for each node in the node set passed as the first argument to the dyn:map function,
- * in document order. The string value of each exsl:boolean element is 'true' if the
- * expression evaluates as true for the node, and '' if the expression evaluates as
- * false.
- * <p>
- * Otherwise, the dyn:map function returns a node set containing one exsl:string
- * element (namespace http://exslt.org/common) for each node in the node set passed
- * as the first argument to the dyn:map function, in document order. The string
- * value of each exsl:string element is the same as the result of converting the
- * result of evaluating the expression for the relevant node to a string as with
- * the string function.
- *
- * @param myContext The ExpressionContext passed by the extension processor
- * @param nl The node set
- * @param expr The expression string
- *
- * @return The node set after evaluation
- */
- public static NodeList map(ExpressionContext myContext, NodeList nl, String expr)
- throws SAXNotSupportedException
- {
- XPathContext xctxt = null;
- Document lDoc = null;
-
- if (myContext instanceof XPathContext.XPathExpressionContext)
- xctxt = ((XPathContext.XPathExpressionContext) myContext).getXPathContext();
- else
- throw new SAXNotSupportedException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_CONTEXT_PASSED, new Object[]{myContext }));
-
- if (expr == null || expr.length() == 0)
- return new NodeSet();
-
- NodeSetDTM contextNodes = new NodeSetDTM(nl, xctxt);
- xctxt.pushContextNodeList(contextNodes);
-
- NodeSet resultSet = new NodeSet();
- resultSet.setShouldCacheNodes(true);
-
- for (int i = 0; i < nl.getLength(); i++)
- {
- int contextNode = contextNodes.item(i);
- xctxt.pushCurrentNode(contextNode);
-
- XObject object = null;
- try
- {
- XPath dynamicXPath = new XPath(expr, xctxt.getSAXLocator(),
- xctxt.getNamespaceContext(),
- XPath.SELECT);
- object = dynamicXPath.execute(xctxt, contextNode, xctxt.getNamespaceContext());
-
- if (object instanceof XNodeSet)
- {
- NodeList nodelist = null;
- nodelist = ((XNodeSet)object).nodelist();
-
- for (int k = 0; k < nodelist.getLength(); k++)
- {
- Node n = nodelist.item(k);
- if (!resultSet.contains(n))
- resultSet.addNode(n);
- }
- }
- else
- {
- if (lDoc == null)
- {
- DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
- dbf.setNamespaceAware(true);
- DocumentBuilder db = dbf.newDocumentBuilder();
- lDoc = db.newDocument();
- }
-
- Element element = null;
- if (object instanceof XNumber)
- element = lDoc.createElementNS(EXSL_URI, "exsl:number");
- else if (object instanceof XBoolean)
- element = lDoc.createElementNS(EXSL_URI, "exsl:boolean");
- else
- element = lDoc.createElementNS(EXSL_URI, "exsl:string");
-
- Text textNode = lDoc.createTextNode(object.str());
- element.appendChild(textNode);
- resultSet.addNode(element);
- }
- }
- catch (Exception e)
- {
- xctxt.popCurrentNode();
- xctxt.popContextNodeList();
- return new NodeSet();
- }
-
- xctxt.popCurrentNode();
-
- }
-
- xctxt.popContextNodeList();
- return resultSet;
- }
-
- /**
- * The dyn:evaluate function evaluates a string as an XPath expression and returns
- * the resulting value, which might be a boolean, number, string, node set, result
- * tree fragment or external object. The sole argument is the string to be evaluated.
- * <p>
- * If the expression string passed as the second argument is an invalid XPath
- * expression (including an empty string), this function returns an empty node set.
- * <p>
- * You should only use this function if the expression must be constructed dynamically,
- * otherwise it is much more efficient to use the expression literally.
- *
- * @param myContext The ExpressionContext passed by the extension processor
- * @param xpathExpr The XPath expression string
- *
- * @return The evaluation result
- */
- public static XObject evaluate(ExpressionContext myContext, String xpathExpr)
- throws SAXNotSupportedException
- {
- if (myContext instanceof XPathContext.XPathExpressionContext)
- {
- XPathContext xctxt = null;
- try
- {
- xctxt = ((XPathContext.XPathExpressionContext) myContext).getXPathContext();
- XPath dynamicXPath = new XPath(xpathExpr, xctxt.getSAXLocator(),
- xctxt.getNamespaceContext(),
- XPath.SELECT);
-
- return dynamicXPath.execute(xctxt, myContext.getContextNode(),
- xctxt.getNamespaceContext());
- }
- catch (TransformerException e)
- {
- return new XNodeSet(xctxt.getDTMManager());
- }
- }
- else
- throw new SAXNotSupportedException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_CONTEXT_PASSED, new Object[]{myContext })); //"Invalid context passed to evaluate "
- }
-
- /**
- * The dyn:closure function creates a node set resulting from transitive closure of
- * evaluating the expression passed as the second argument on each of the nodes passed
- * as the first argument, then on the node set resulting from that and so on until no
- * more nodes are found. For example:
- * <pre>
- * dyn:closure(., '*')
- * </pre>
- * returns all the descendant elements of the node (its element children, their
- * children, their children's children and so on).
- * <p>
- * The expression is thus evaluated several times, each with a different node set
- * acting as the context of the expression. The first time the expression is
- * evaluated, the context node set is the first argument passed to the dyn:closure
- * function. In other words, the node set for each node is calculated by evaluating
- * the XPath expression with all context information being the same as that for
- * the call to the dyn:closure function itself, except for the following:
- * <p>
- * <ul>
- * <li>the context node is the node whose value is being calculated.</li>
- * <li>the context position is the position of the node within the node set passed
- * as the first argument to the dyn:closure function, arranged in document order.</li>
- * <li>the context size is the number of nodes passed as the first argument to the
- * dyn:closure function.</li>
- * <li>the current node is the node whose value is being calculated.</li>
- * </ul>
- * <p>
- * The result for a particular iteration is the union of the node sets resulting
- * from evaluting the expression for each of the nodes in the source node set for
- * that iteration. This result is then used as the source node set for the next
- * iteration, and so on. The result of the function as a whole is the union of
- * the node sets generated by each iteration.
- * <p>
- * If the expression string passed as the second argument is an invalid XPath
- * expression (including an empty string) or an expression that does not return a
- * node set, this function returns an empty node set.
- *
- * @param myContext The ExpressionContext passed by the extension processor
- * @param nl The node set
- * @param expr The expression string
- *
- * @return The node set after evaluation
- */
- public static NodeList closure(ExpressionContext myContext, NodeList nl, String expr)
- throws SAXNotSupportedException
- {
- XPathContext xctxt = null;
- if (myContext instanceof XPathContext.XPathExpressionContext)
- xctxt = ((XPathContext.XPathExpressionContext) myContext).getXPathContext();
- else
- throw new SAXNotSupportedException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_CONTEXT_PASSED, new Object[]{myContext }));
-
- if (expr == null || expr.length() == 0)
- return new NodeSet();
-
- NodeSet closureSet = new NodeSet();
- closureSet.setShouldCacheNodes(true);
-
- NodeList iterationList = nl;
- do
- {
-
- NodeSet iterationSet = new NodeSet();
-
- NodeSetDTM contextNodes = new NodeSetDTM(iterationList, xctxt);
- xctxt.pushContextNodeList(contextNodes);
-
- for (int i = 0; i < iterationList.getLength(); i++)
- {
- int contextNode = contextNodes.item(i);
- xctxt.pushCurrentNode(contextNode);
-
- XObject object = null;
- try
- {
- XPath dynamicXPath = new XPath(expr, xctxt.getSAXLocator(),
- xctxt.getNamespaceContext(),
- XPath.SELECT);
- object = dynamicXPath.execute(xctxt, contextNode, xctxt.getNamespaceContext());
-
- if (object instanceof XNodeSet)
- {
- NodeList nodelist = null;
- nodelist = ((XNodeSet)object).nodelist();
-
- for (int k = 0; k < nodelist.getLength(); k++)
- {
- Node n = nodelist.item(k);
- if (!iterationSet.contains(n))
- iterationSet.addNode(n);
- }
- }
- else
- {
- xctxt.popCurrentNode();
- xctxt.popContextNodeList();
- return new NodeSet();
- }
- }
- catch (TransformerException e)
- {
- xctxt.popCurrentNode();
- xctxt.popContextNodeList();
- return new NodeSet();
- }
-
- xctxt.popCurrentNode();
-
- }
-
- xctxt.popContextNodeList();
-
- iterationList = iterationSet;
-
- for (int i = 0; i < iterationList.getLength(); i++)
- {
- Node n = iterationList.item(i);
- if (!closureSet.contains(n))
- closureSet.addNode(n);
- }
-
- } while(iterationList.getLength() > 0);
-
- return closureSet;
-
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/lib/ExsltMath.java b/src/com/sun/org/apache/xalan/internal/lib/ExsltMath.java
deleted file mode 100644
index 6066832..0000000
--- a/src/com/sun/org/apache/xalan/internal/lib/ExsltMath.java
+++ /dev/null
@@ -1,391 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ExsltMath.java,v 1.1.2.1 2005/08/01 02:08:50 jeffsuttor Exp $
- */
-package com.sun.org.apache.xalan.internal.lib;
-
-import com.sun.org.apache.xpath.internal.NodeSet;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * This class contains EXSLT math extension functions.
- * It is accessed by specifying a namespace URI as follows:
- * <pre>
- * xmlns:math="http://exslt.org/math"
- * </pre>
- *
- * The documentation for each function has been copied from the relevant
- * EXSLT Implementer page.
- *
- * @see <a href="http://www.exslt.org/">EXSLT</a>
-
- * @xsl.usage general
- */
-public class ExsltMath extends ExsltBase
-{
- // Constants
- private static String PI = "3.1415926535897932384626433832795028841971693993751";
- private static String E = "2.71828182845904523536028747135266249775724709369996";
- private static String SQRRT2 = "1.41421356237309504880168872420969807856967187537694";
- private static String LN2 = "0.69314718055994530941723212145817656807550013436025";
- private static String LN10 = "2.302585092994046";
- private static String LOG2E = "1.4426950408889633";
- private static String SQRT1_2 = "0.7071067811865476";
-
- /**
- * The math:max function returns the maximum value of the nodes passed as the argument.
- * The maximum value is defined as follows. The node set passed as an argument is sorted
- * in descending order as it would be by xsl:sort with a data type of number. The maximum
- * is the result of converting the string value of the first node in this sorted list to
- * a number using the number function.
- * <p>
- * If the node set is empty, or if the result of converting the string values of any of the
- * nodes to a number is NaN, then NaN is returned.
- *
- * @param nl The NodeList for the node-set to be evaluated.
- *
- * @return the maximum value found, NaN if any node cannot be converted to a number.
- *
- * @see <a href="http://www.exslt.org/">EXSLT</a>
- */
- public static double max (NodeList nl)
- {
- if (nl == null || nl.getLength() == 0)
- return Double.NaN;
-
- double m = - Double.MAX_VALUE;
- for (int i = 0; i < nl.getLength(); i++)
- {
- Node n = nl.item(i);
- double d = toNumber(n);
- if (Double.isNaN(d))
- return Double.NaN;
- else if (d > m)
- m = d;
- }
-
- return m;
- }
-
- /**
- * The math:min function returns the minimum value of the nodes passed as the argument.
- * The minimum value is defined as follows. The node set passed as an argument is sorted
- * in ascending order as it would be by xsl:sort with a data type of number. The minimum
- * is the result of converting the string value of the first node in this sorted list to
- * a number using the number function.
- * <p>
- * If the node set is empty, or if the result of converting the string values of any of
- * the nodes to a number is NaN, then NaN is returned.
- *
- * @param nl The NodeList for the node-set to be evaluated.
- *
- * @return the minimum value found, NaN if any node cannot be converted to a number.
- *
- * @see <a href="http://www.exslt.org/">EXSLT</a>
- */
- public static double min (NodeList nl)
- {
- if (nl == null || nl.getLength() == 0)
- return Double.NaN;
-
- double m = Double.MAX_VALUE;
- for (int i = 0; i < nl.getLength(); i++)
- {
- Node n = nl.item(i);
- double d = toNumber(n);
- if (Double.isNaN(d))
- return Double.NaN;
- else if (d < m)
- m = d;
- }
-
- return m;
- }
-
- /**
- * The math:highest function returns the nodes in the node set whose value is the maximum
- * value for the node set. The maximum value for the node set is the same as the value as
- * calculated by math:max. A node has this maximum value if the result of converting its
- * string value to a number as if by the number function is equal to the maximum value,
- * where the equality comparison is defined as a numerical comparison using the = operator.
- * <p>
- * If any of the nodes in the node set has a non-numeric value, the math:max function will
- * return NaN. The definition numeric comparisons entails that NaN != NaN. Therefore if any
- * of the nodes in the node set has a non-numeric value, math:highest will return an empty
- * node set.
- *
- * @param nl The NodeList for the node-set to be evaluated.
- *
- * @return node-set with nodes containing the maximum value found, an empty node-set
- * if any node cannot be converted to a number.
- */
- public static NodeList highest (NodeList nl)
- {
- double maxValue = max(nl);
-
- NodeSet highNodes = new NodeSet();
- highNodes.setShouldCacheNodes(true);
-
- if (Double.isNaN(maxValue))
- return highNodes; // empty Nodeset
-
- for (int i = 0; i < nl.getLength(); i++)
- {
- Node n = nl.item(i);
- double d = toNumber(n);
- if (d == maxValue)
- highNodes.addElement(n);
- }
- return highNodes;
- }
-
- /**
- * The math:lowest function returns the nodes in the node set whose value is the minimum value
- * for the node set. The minimum value for the node set is the same as the value as calculated
- * by math:min. A node has this minimum value if the result of converting its string value to
- * a number as if by the number function is equal to the minimum value, where the equality
- * comparison is defined as a numerical comparison using the = operator.
- * <p>
- * If any of the nodes in the node set has a non-numeric value, the math:min function will return
- * NaN. The definition numeric comparisons entails that NaN != NaN. Therefore if any of the nodes
- * in the node set has a non-numeric value, math:lowest will return an empty node set.
- *
- * @param nl The NodeList for the node-set to be evaluated.
- *
- * @return node-set with nodes containing the minimum value found, an empty node-set
- * if any node cannot be converted to a number.
- *
- */
- public static NodeList lowest (NodeList nl)
- {
- double minValue = min(nl);
-
- NodeSet lowNodes = new NodeSet();
- lowNodes.setShouldCacheNodes(true);
-
- if (Double.isNaN(minValue))
- return lowNodes; // empty Nodeset
-
- for (int i = 0; i < nl.getLength(); i++)
- {
- Node n = nl.item(i);
- double d = toNumber(n);
- if (d == minValue)
- lowNodes.addElement(n);
- }
- return lowNodes;
- }
-
- /**
- * The math:abs function returns the absolute value of a number.
- *
- * @param num A number
- * @return The absolute value of the number
- */
- public static double abs(double num)
- {
- return Math.abs(num);
- }
-
- /**
- * The math:acos function returns the arccosine value of a number.
- *
- * @param num A number
- * @return The arccosine value of the number
- */
- public static double acos(double num)
- {
- return Math.acos(num);
- }
-
- /**
- * The math:asin function returns the arcsine value of a number.
- *
- * @param num A number
- * @return The arcsine value of the number
- */
- public static double asin(double num)
- {
- return Math.asin(num);
- }
-
- /**
- * The math:atan function returns the arctangent value of a number.
- *
- * @param num A number
- * @return The arctangent value of the number
- */
- public static double atan(double num)
- {
- return Math.atan(num);
- }
-
- /**
- * The math:atan2 function returns the angle ( in radians ) from the X axis to a point (y,x).
- *
- * @param num1 The X axis value
- * @param num2 The Y axis value
- * @return The angle (in radians) from the X axis to a point (y,x)
- */
- public static double atan2(double num1, double num2)
- {
- return Math.atan2(num1, num2);
- }
-
- /**
- * The math:cos function returns cosine of the passed argument.
- *
- * @param num A number
- * @return The cosine value of the number
- */
- public static double cos(double num)
- {
- return Math.cos(num);
- }
-
- /**
- * The math:exp function returns e (the base of natural logarithms) raised to a power.
- *
- * @param num A number
- * @return The value of e raised to the given power
- */
- public static double exp(double num)
- {
- return Math.exp(num);
- }
-
- /**
- * The math:log function returns the natural logarithm of a number.
- *
- * @param num A number
- * @return The natural logarithm of the number
- */
- public static double log(double num)
- {
- return Math.log(num);
- }
-
- /**
- * The math:power function returns the value of a base expression taken to a specified power.
- *
- * @param num1 The base
- * @param num2 The power
- * @return The value of the base expression taken to the specified power
- */
- public static double power(double num1, double num2)
- {
- return Math.pow(num1, num2);
- }
-
- /**
- * The math:random function returns a random number from 0 to 1.
- *
- * @return A random double from 0 to 1
- */
- public static double random()
- {
- return Math.random();
- }
-
- /**
- * The math:sin function returns the sine of the number.
- *
- * @param num A number
- * @return The sine value of the number
- */
- public static double sin(double num)
- {
- return Math.sin(num);
- }
-
- /**
- * The math:sqrt function returns the square root of a number.
- *
- * @param num A number
- * @return The square root of the number
- */
- public static double sqrt(double num)
- {
- return Math.sqrt(num);
- }
-
- /**
- * The math:tan function returns the tangent of the number passed as an argument.
- *
- * @param num A number
- * @return The tangent value of the number
- */
- public static double tan(double num)
- {
- return Math.tan(num);
- }
-
- /**
- * The math:constant function returns the specified constant to a set precision.
- * The possible constants are:
- * <pre>
- * PI
- * E
- * SQRRT2
- * LN2
- * LN10
- * LOG2E
- * SQRT1_2
- * </pre>
- * @param name The name of the constant
- * @param precision The precision
- * @return The value of the specified constant to the given precision
- */
- public static double constant(String name, double precision)
- {
- String value = null;
- if (name.equals("PI"))
- value = PI;
- else if (name.equals("E"))
- value = E;
- else if (name.equals("SQRRT2"))
- value = SQRRT2;
- else if (name.equals("LN2"))
- value = LN2;
- else if (name.equals("LN10"))
- value = LN10;
- else if (name.equals("LOG2E"))
- value = LOG2E;
- else if (name.equals("SQRT1_2"))
- value = SQRT1_2;
-
- if (value != null)
- {
- int bits = new Double(precision).intValue();
-
- if (bits <= value.length())
- value = value.substring(0, bits);
-
- return Double.parseDouble(value);
- }
- else
- return Double.NaN;
-
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/lib/ExsltSets.java b/src/com/sun/org/apache/xalan/internal/lib/ExsltSets.java
deleted file mode 100644
index 46d5df1..0000000
--- a/src/com/sun/org/apache/xalan/internal/lib/ExsltSets.java
+++ /dev/null
@@ -1,241 +0,0 @@
-/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ExsltSets.java,v 1.1.2.1 2005/08/01 02:08:50 jeffsuttor Exp $
- */
-package com.sun.org.apache.xalan.internal.lib;
-
-import com.sun.org.apache.xml.internal.utils.DOMHelper;
-import com.sun.org.apache.xpath.internal.NodeSet;
-import java.util.HashMap;
-import java.util.Map;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * This class contains EXSLT set extension functions.
- * It is accessed by specifying a namespace URI as follows:
- * <pre>
- * xmlns:set="http://exslt.org/sets"
- * </pre>
- *
- * The documentation for each function has been copied from the relevant
- * EXSLT Implementer page.
- *
- * @see <a href="http://www.exslt.org/">EXSLT</a>
- * @xsl.usage general
- */
-public class ExsltSets extends ExsltBase
-{
- /**
- * The set:leading function returns the nodes in the node set passed as the first argument that
- * precede, in document order, the first node in the node set passed as the second argument. If
- * the first node in the second node set is not contained in the first node set, then an empty
- * node set is returned. If the second node set is empty, then the first node set is returned.
- *
- * @param nl1 NodeList for first node-set.
- * @param nl2 NodeList for second node-set.
- * @return a NodeList containing the nodes in nl1 that precede in document order the first
- * node in nl2; an empty node-set if the first node in nl2 is not in nl1; all of nl1 if nl2
- * is empty.
- *
- * @see <a href="http://www.exslt.org/">EXSLT</a>
- */
- public static NodeList leading (NodeList nl1, NodeList nl2)
- {
- if (nl2.getLength() == 0)
- return nl1;
-
- NodeSet ns1 = new NodeSet(nl1);
- NodeSet leadNodes = new NodeSet();
- Node endNode = nl2.item(0);
- if (!ns1.contains(endNode))
- return leadNodes; // empty NodeSet
-
- for (int i = 0; i < nl1.getLength(); i++)
- {
- Node testNode = nl1.item(i);
- if (DOMHelper.isNodeAfter(testNode, endNode)
- && !DOMHelper.isNodeTheSame(testNode, endNode))
- leadNodes.addElement(testNode);
- }
- return leadNodes;
- }
-
- /**
- * The set:trailing function returns the nodes in the node set passed as the first argument that
- * follow, in document order, the first node in the node set passed as the second argument. If
- * the first node in the second node set is not contained in the first node set, then an empty
- * node set is returned. If the second node set is empty, then the first node set is returned.
- *
- * @param nl1 NodeList for first node-set.
- * @param nl2 NodeList for second node-set.
- * @return a NodeList containing the nodes in nl1 that follow in document order the first
- * node in nl2; an empty node-set if the first node in nl2 is not in nl1; all of nl1 if nl2
- * is empty.
- *
- * @see <a href="http://www.exslt.org/">EXSLT</a>
- */
- public static NodeList trailing (NodeList nl1, NodeList nl2)
- {
- if (nl2.getLength() == 0)
- return nl1;
-
- NodeSet ns1 = new NodeSet(nl1);
- NodeSet trailNodes = new NodeSet();
- Node startNode = nl2.item(0);
- if (!ns1.contains(startNode))
- return trailNodes; // empty NodeSet
-
- for (int i = 0; i < nl1.getLength(); i++)
- {
- Node testNode = nl1.item(i);
- if (DOMHelper.isNodeAfter(startNode, testNode)
- && !DOMHelper.isNodeTheSame(startNode, testNode))
- trailNodes.addElement(testNode);
- }
- return trailNodes;
- }
-
- /**
- * The set:intersection function returns a node set comprising the nodes that are within
- * both the node sets passed as arguments to it.
- *
- * @param nl1 NodeList for first node-set.
- * @param nl2 NodeList for second node-set.
- * @return a NodeList containing the nodes in nl1 that are also
- * in nl2.
- *
- * @see <a href="http://www.exslt.org/">EXSLT</a>
- */
- public static NodeList intersection(NodeList nl1, NodeList nl2)
- {
- NodeSet ns1 = new NodeSet(nl1);
- NodeSet ns2 = new NodeSet(nl2);
- NodeSet inter = new NodeSet();
-
- inter.setShouldCacheNodes(true);
-
- for (int i = 0; i < ns1.getLength(); i++)
- {
- Node n = ns1.elementAt(i);
-
- if (ns2.contains(n))
- inter.addElement(n);
- }
-
- return inter;
- }
-
- /**
- * The set:difference function returns the difference between two node sets - those nodes that
- * are in the node set passed as the first argument that are not in the node set passed as the
- * second argument.
- *
- * @param nl1 NodeList for first node-set.
- * @param nl2 NodeList for second node-set.
- * @return a NodeList containing the nodes in nl1 that are not in nl2.
- *
- * @see <a href="http://www.exslt.org/">EXSLT</a>
- */
- public static NodeList difference(NodeList nl1, NodeList nl2)
- {
- NodeSet ns1 = new NodeSet(nl1);
- NodeSet ns2 = new NodeSet(nl2);
-
- NodeSet diff = new NodeSet();
-
- diff.setShouldCacheNodes(true);
-
- for (int i = 0; i < ns1.getLength(); i++)
- {
- Node n = ns1.elementAt(i);
-
- if (!ns2.contains(n))
- diff.addElement(n);
- }
-
- return diff;
- }
-
- /**
- * The set:distinct function returns a subset of the nodes contained in the node-set NS passed
- * as the first argument. Specifically, it selects a node N if there is no node in NS that has
- * the same string value as N, and that precedes N in document order.
- *
- * @param nl NodeList for the node-set.
- * @return a NodeList with nodes from nl containing distinct string values.
- * In other words, if more than one node in nl contains the same string value,
- * only include the first such node found.
- *
- * @see <a href="http://www.exslt.org/">EXSLT</a>
- */
- public static NodeList distinct(NodeList nl)
- {
- NodeSet dist = new NodeSet();
- dist.setShouldCacheNodes(true);
-
- Map<String, Node> stringTable = new HashMap<>();
-
- for (int i = 0; i < nl.getLength(); i++)
- {
- Node currNode = nl.item(i);
- String key = toString(currNode);
-
- if (key == null)
- dist.addElement(currNode);
- else if (!stringTable.containsKey(key))
- {
- stringTable.put(key, currNode);
- dist.addElement(currNode);
- }
- }
-
- return dist;
- }
-
- /**
- * The set:has-same-node function returns true if the node set passed as the first argument shares
- * any nodes with the node set passed as the second argument. If there are no nodes that are in both
- * node sets, then it returns false.
- *
- * The Xalan extensions MethodResolver converts 'has-same-node' to 'hasSameNode'.
- *
- * Note: Not to be confused with hasSameNodes in the Xalan namespace, which returns true if
- * the two node sets contain the exactly the same nodes (perhaps in a different order),
- * otherwise false.
- *
- * @see <a href="http://www.exslt.org/">EXSLT</a>
- */
- public static boolean hasSameNode(NodeList nl1, NodeList nl2)
- {
-
- NodeSet ns1 = new NodeSet(nl1);
- NodeSet ns2 = new NodeSet(nl2);
-
- for (int i = 0; i < ns1.getLength(); i++)
- {
- if (ns2.contains(ns1.elementAt(i)))
- return true;
- }
- return false;
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/lib/ExsltStrings.java b/src/com/sun/org/apache/xalan/internal/lib/ExsltStrings.java
deleted file mode 100644
index aa8bea5..0000000
--- a/src/com/sun/org/apache/xalan/internal/lib/ExsltStrings.java
+++ /dev/null
@@ -1,351 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ExsltStrings.java,v 1.1.2.1 2005/08/01 02:08:48 jeffsuttor Exp $
- */
-package com.sun.org.apache.xalan.internal.lib;
-
-import java.util.StringTokenizer;
-
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.FactoryConfigurationError;
-import javax.xml.parsers.ParserConfigurationException;
-
-import com.sun.org.apache.xpath.internal.NodeSet;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-
-/**
- * This class contains EXSLT strings extension functions.
- *
- * It is accessed by specifying a namespace URI as follows:
- * <pre>
- * xmlns:str="http://exslt.org/strings"
- * </pre>
- * The documentation for each function has been copied from the relevant
- * EXSLT Implementer page.
- *
- * @see <a href="http://www.exslt.org/">EXSLT</a>
-
- * @xsl.usage general
- */
-public class ExsltStrings extends ExsltBase
-{
- static final String JDK_DEFAULT_DOM = "com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl";
-
- /**
- * The str:align function aligns a string within another string.
- * <p>
- * The first argument gives the target string to be aligned. The second argument gives
- * the padding string within which it is to be aligned.
- * <p>
- * If the target string is shorter than the padding string then a range of characters
- * in the padding string are repaced with those in the target string. Which characters
- * are replaced depends on the value of the third argument, which gives the type of
- * alignment. It can be one of 'left', 'right' or 'center'. If no third argument is
- * given or if it is not one of these values, then it defaults to left alignment.
- * <p>
- * With left alignment, the range of characters replaced by the target string begins
- * with the first character in the padding string. With right alignment, the range of
- * characters replaced by the target string ends with the last character in the padding
- * string. With center alignment, the range of characters replaced by the target string
- * is in the middle of the padding string, such that either the number of unreplaced
- * characters on either side of the range is the same or there is one less on the left
- * than there is on the right.
- * <p>
- * If the target string is longer than the padding string, then it is truncated to be
- * the same length as the padding string and returned.
- *
- * @param targetStr The target string
- * @param paddingStr The padding string
- * @param type The type of alignment
- *
- * @return The string after alignment
- */
- public static String align(String targetStr, String paddingStr, String type)
- {
- if (targetStr.length() >= paddingStr.length())
- return targetStr.substring(0, paddingStr.length());
-
- if (type.equals("right"))
- {
- return paddingStr.substring(0, paddingStr.length() - targetStr.length()) + targetStr;
- }
- else if (type.equals("center"))
- {
- int startIndex = (paddingStr.length() - targetStr.length()) / 2;
- return paddingStr.substring(0, startIndex) + targetStr + paddingStr.substring(startIndex + targetStr.length());
- }
- // Default is left
- else
- {
- return targetStr + paddingStr.substring(targetStr.length());
- }
- }
-
- /**
- * See above
- */
- public static String align(String targetStr, String paddingStr)
- {
- return align(targetStr, paddingStr, "left");
- }
-
- /**
- * The str:concat function takes a node set and returns the concatenation of the
- * string values of the nodes in that node set. If the node set is empty, it returns
- * an empty string.
- *
- * @param nl A node set
- * @return The concatenation of the string values of the nodes in that node set
- */
- public static String concat(NodeList nl)
- {
- StringBuffer sb = new StringBuffer();
- for (int i = 0; i < nl.getLength(); i++)
- {
- Node node = nl.item(i);
- String value = toString(node);
-
- if (value != null && value.length() > 0)
- sb.append(value);
- }
-
- return sb.toString();
- }
-
- /**
- * The str:padding function creates a padding string of a certain length.
- * The first argument gives the length of the padding string to be created.
- * The second argument gives a string to be used to create the padding. This
- * string is repeated as many times as is necessary to create a string of the
- * length specified by the first argument; if the string is more than a character
- * long, it may have to be truncated to produce the required length. If no second
- * argument is specified, it defaults to a space (' '). If the second argument is
- * an empty string, str:padding returns an empty string.
- *
- * @param length The length of the padding string to be created
- * @param pattern The string to be used as pattern
- *
- * @return A padding string of the given length
- */
- public static String padding(double length, String pattern)
- {
- if (pattern == null || pattern.length() == 0)
- return "";
-
- StringBuffer sb = new StringBuffer();
- int len = (int)length;
- int numAdded = 0;
- int index = 0;
- while (numAdded < len)
- {
- if (index == pattern.length())
- index = 0;
-
- sb.append(pattern.charAt(index));
- index++;
- numAdded++;
- }
-
- return sb.toString();
- }
-
- /**
- * See above
- */
- public static String padding(double length)
- {
- return padding(length, " ");
- }
-
- /**
- * The str:split function splits up a string and returns a node set of token
- * elements, each containing one token from the string.
- * <p>
- * The first argument is the string to be split. The second argument is a pattern
- * string. The string given by the first argument is split at any occurrence of
- * this pattern. For example:
- * <pre>
- * str:split('a, simple, list', ', ') gives the node set consisting of:
- *
- * <token>a</token>
- * <token>simple</token>
- * <token>list</token>
- * </pre>
- * If the second argument is omitted, the default is the string '&#x20;' (i.e. a space).
- *
- * @param str The string to be split
- * @param pattern The pattern
- *
- * @return A node set of split tokens
- */
- public static NodeList split(String str, String pattern)
- {
-
-
- NodeSet resultSet = new NodeSet();
- resultSet.setShouldCacheNodes(true);
-
- boolean done = false;
- int fromIndex = 0;
- int matchIndex = 0;
- String token = null;
-
- while (!done && fromIndex < str.length())
- {
- matchIndex = str.indexOf(pattern, fromIndex);
- if (matchIndex >= 0)
- {
- token = str.substring(fromIndex, matchIndex);
- fromIndex = matchIndex + pattern.length();
- }
- else
- {
- done = true;
- token = str.substring(fromIndex);
- }
-
- Document doc = getDocument();
- synchronized (doc)
- {
- Element element = doc.createElement("token");
- Text text = doc.createTextNode(token);
- element.appendChild(text);
- resultSet.addNode(element);
- }
- }
-
- return resultSet;
- }
-
- /**
- * See above
- */
- public static NodeList split(String str)
- {
- return split(str, " ");
- }
-
- /**
- * The str:tokenize function splits up a string and returns a node set of token
- * elements, each containing one token from the string.
- * <p>
- * The first argument is the string to be tokenized. The second argument is a
- * string consisting of a number of characters. Each character in this string is
- * taken as a delimiting character. The string given by the first argument is split
- * at any occurrence of any of these characters. For example:
- * <pre>
- * str:tokenize('2001-06-03T11:40:23', '-T:') gives the node set consisting of:
- *
- * <token>2001</token>
- * <token>06</token>
- * <token>03</token>
- * <token>11</token>
- * <token>40</token>
- * <token>23</token>
- * </pre>
- * If the second argument is omitted, the default is the string '&#x9;&#xA;&#xD;&#x20;'
- * (i.e. whitespace characters).
- * <p>
- * If the second argument is an empty string, the function returns a set of token
- * elements, each of which holds a single character.
- * <p>
- * Note: This one is different from the tokenize extension function in the Xalan
- * namespace. The one in Xalan returns a set of Text nodes, while this one wraps
- * the Text nodes inside the token Element nodes.
- *
- * @param toTokenize The string to be tokenized
- * @param delims The delimiter string
- *
- * @return A node set of split token elements
- */
- public static NodeList tokenize(String toTokenize, String delims)
- {
-
-
- NodeSet resultSet = new NodeSet();
-
- if (delims != null && delims.length() > 0)
- {
- StringTokenizer lTokenizer = new StringTokenizer(toTokenize, delims);
-
- Document doc = getDocument();
- synchronized (doc)
- {
- while (lTokenizer.hasMoreTokens())
- {
- Element element = doc.createElement("token");
- element.appendChild(doc.createTextNode(lTokenizer.nextToken()));
- resultSet.addNode(element);
- }
- }
- }
- // If the delimiter is an empty string, create one token Element for
- // every single character.
- else
- {
-
- Document doc = getDocument();
- synchronized (doc)
- {
- for (int i = 0; i < toTokenize.length(); i++)
- {
- Element element = doc.createElement("token");
- element.appendChild(doc.createTextNode(toTokenize.substring(i, i+1)));
- resultSet.addNode(element);
- }
- }
- }
-
- return resultSet;
- }
-
- /**
- * See above
- */
- public static NodeList tokenize(String toTokenize)
- {
- return tokenize(toTokenize, " \t\n\r");
- }
-
- /**
- * @return an instance of DOM Document
- */
- private static Document getDocument()
- {
- try
- {
- if (System.getSecurityManager() == null) {
- return DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
- } else {
- return DocumentBuilderFactory.newInstance(JDK_DEFAULT_DOM, null).newDocumentBuilder().newDocument();
- }
- }
- catch(ParserConfigurationException pce)
- {
- throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(pce);
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/lib/Extensions.java b/src/com/sun/org/apache/xalan/internal/lib/Extensions.java
deleted file mode 100644
index e914709..0000000
--- a/src/com/sun/org/apache/xalan/internal/lib/Extensions.java
+++ /dev/null
@@ -1,388 +0,0 @@
-/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Extensions.java,v 1.2.4.1 2005/09/10 18:53:32 jeffsuttor Exp $
- */
-package com.sun.org.apache.xalan.internal.lib;
-
-import com.sun.org.apache.xalan.internal.extensions.ExpressionContext;
-import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
-import com.sun.org.apache.xalan.internal.xslt.EnvironmentCheck;
-import com.sun.org.apache.xpath.internal.NodeSet;
-import com.sun.org.apache.xpath.internal.objects.XBoolean;
-import com.sun.org.apache.xpath.internal.objects.XNumber;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-import java.util.Hashtable;
-import java.util.Map;
-import java.util.StringTokenizer;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-import org.w3c.dom.traversal.NodeIterator;
-import org.xml.sax.SAXNotSupportedException;
-
-/**
- * This class contains many of the Xalan-supplied extensions.
- * It is accessed by specifying a namespace URI as follows:
- * <pre>
- * xmlns:xalan="http://xml.apache.org/xalan"
- * </pre>
- * @xsl.usage general
- */
-public class Extensions
-{
- static final String JDK_DEFAULT_DOM = "com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl";
- /**
- * Constructor Extensions
- *
- */
- private Extensions(){} // Make sure class cannot be instantiated
-
- /**
- * This method is an extension that implements as a Xalan extension
- * the node-set function also found in xt and saxon.
- * If the argument is a Result Tree Fragment, then <code>nodeset</code>
- * returns a node-set consisting of a single root node as described in
- * section 11.1 of the XSLT 1.0 Recommendation. If the argument is a
- * node-set, <code>nodeset</code> returns a node-set. If the argument
- * is a string, number, or boolean, then <code>nodeset</code> returns
- * a node-set consisting of a single root node with a single text node
- * child that is the result of calling the XPath string() function on the
- * passed parameter. If the argument is anything else, then a node-set
- * is returned consisting of a single root node with a single text node
- * child that is the result of calling the java <code>toString()</code>
- * method on the passed argument.
- * Most of the
- * actual work here is done in <code>MethodResolver</code> and
- * <code>XRTreeFrag</code>.
- * @param myProcessor Context passed by the extension processor
- * @param rtf Argument in the stylesheet to the nodeset extension function
- *
- * NEEDSDOC ($objectName$) @return
- */
- public static NodeSet nodeset(ExpressionContext myProcessor, Object rtf)
- {
-
- String textNodeValue;
-
- if (rtf instanceof NodeIterator)
- {
- return new NodeSet((NodeIterator) rtf);
- }
- else
- {
- if (rtf instanceof String)
- {
- textNodeValue = (String) rtf;
- }
- else if (rtf instanceof Boolean)
- {
- textNodeValue = new XBoolean(((Boolean) rtf).booleanValue()).str();
- }
- else if (rtf instanceof Double)
- {
- textNodeValue = new XNumber(((Double) rtf).doubleValue()).str();
- }
- else
- {
- textNodeValue = rtf.toString();
- }
-
- // This no longer will work right since the DTM.
- // Document myDoc = myProcessor.getContextNode().getOwnerDocument();
- Document myDoc = getDocument();
-
- Text textNode = myDoc.createTextNode(textNodeValue);
- DocumentFragment docFrag = myDoc.createDocumentFragment();
-
- docFrag.appendChild(textNode);
-
- return new NodeSet(docFrag);
- }
- }
-
- /**
- * Returns the intersection of two node-sets.
- *
- * @param nl1 NodeList for first node-set
- * @param nl2 NodeList for second node-set
- * @return a NodeList containing the nodes in nl1 that are also in nl2
- *
- * Note: The usage of this extension function in the xalan namespace
- * is deprecated. Please use the same function in the EXSLT sets extension
- * (http://exslt.org/sets).
- */
- public static NodeList intersection(NodeList nl1, NodeList nl2)
- {
- return ExsltSets.intersection(nl1, nl2);
- }
-
- /**
- * Returns the difference between two node-sets.
- *
- * @param nl1 NodeList for first node-set
- * @param nl2 NodeList for second node-set
- * @return a NodeList containing the nodes in nl1 that are not in nl2
- *
- * Note: The usage of this extension function in the xalan namespace
- * is deprecated. Please use the same function in the EXSLT sets extension
- * (http://exslt.org/sets).
- */
- public static NodeList difference(NodeList nl1, NodeList nl2)
- {
- return ExsltSets.difference(nl1, nl2);
- }
-
- /**
- * Returns node-set containing distinct string values.
- *
- * @param nl NodeList for node-set
- * @return a NodeList with nodes from nl containing distinct string values.
- * In other words, if more than one node in nl contains the same string value,
- * only include the first such node found.
- *
- * Note: The usage of this extension function in the xalan namespace
- * is deprecated. Please use the same function in the EXSLT sets extension
- * (http://exslt.org/sets).
- */
- public static NodeList distinct(NodeList nl)
- {
- return ExsltSets.distinct(nl);
- }
-
- /**
- * Returns true if both node-sets contain the same set of nodes.
- *
- * @param nl1 NodeList for first node-set
- * @param nl2 NodeList for second node-set
- * @return true if nl1 and nl2 contain exactly the same set of nodes.
- */
- public static boolean hasSameNodes(NodeList nl1, NodeList nl2)
- {
-
- NodeSet ns1 = new NodeSet(nl1);
- NodeSet ns2 = new NodeSet(nl2);
-
- if (ns1.getLength() != ns2.getLength())
- return false;
-
- for (int i = 0; i < ns1.getLength(); i++)
- {
- Node n = ns1.elementAt(i);
-
- if (!ns2.contains(n))
- return false;
- }
-
- return true;
- }
-
- /**
- * Returns the result of evaluating the argument as a string containing
- * an XPath expression. Used where the XPath expression is not known until
- * run-time. The expression is evaluated as if the run-time value of the
- * argument appeared in place of the evaluate function call at compile time.
- *
- * @param myContext an <code>ExpressionContext</code> passed in by the
- * extension mechanism. This must be an XPathContext.
- * @param xpathExpr The XPath expression to be evaluated.
- * @return the XObject resulting from evaluating the XPath
- *
- * @throws SAXNotSupportedException
- *
- * Note: The usage of this extension function in the xalan namespace
- * is deprecated. Please use the same function in the EXSLT dynamic extension
- * (http://exslt.org/dynamic).
- */
- public static XObject evaluate(ExpressionContext myContext, String xpathExpr)
- throws SAXNotSupportedException
- {
- return ExsltDynamic.evaluate(myContext, xpathExpr);
- }
-
- /**
- * Returns a NodeSet containing one text node for each token in the first argument.
- * Delimiters are specified in the second argument.
- * Tokens are determined by a call to <code>StringTokenizer</code>.
- * If the first argument is an empty string or contains only delimiters, the result
- * will be an empty NodeSet.
- *
- * Contributed to XalanJ1 by <a href="mailto:benoit.cerrina@writeme.com">Benoit Cerrina</a>.
- *
- * @param toTokenize The string to be split into text tokens.
- * @param delims The delimiters to use.
- * @return a NodeSet as described above.
- */
- public static NodeList tokenize(String toTokenize, String delims)
- {
-
- Document doc = getDocument();
-
- StringTokenizer lTokenizer = new StringTokenizer(toTokenize, delims);
- NodeSet resultSet = new NodeSet();
-
- synchronized (doc)
- {
- while (lTokenizer.hasMoreTokens())
- {
- resultSet.addNode(doc.createTextNode(lTokenizer.nextToken()));
- }
- }
-
- return resultSet;
- }
-
- /**
- * Returns a NodeSet containing one text node for each token in the first argument.
- * Delimiters are whitespace. That is, the delimiters that are used are tab (&#x09),
- * linefeed (&#x0A), return (&#x0D), and space (&#x20).
- * Tokens are determined by a call to <code>StringTokenizer</code>.
- * If the first argument is an empty string or contains only delimiters, the result
- * will be an empty NodeSet.
- *
- * Contributed to XalanJ1 by <a href="mailto:benoit.cerrina@writeme.com">Benoit Cerrina</a>.
- *
- * @param toTokenize The string to be split into text tokens.
- * @return a NodeSet as described above.
- */
- public static NodeList tokenize(String toTokenize)
- {
- return tokenize(toTokenize, " \t\n\r");
- }
-
- /**
- * Return a Node of basic debugging information from the
- * EnvironmentCheck utility about the Java environment.
- *
- * <p>Simply calls the {@link com.sun.org.apache.xalan.internal.xslt.EnvironmentCheck}
- * utility to grab info about the Java environment and CLASSPATH,
- * etc., and then returns the resulting Node. Stylesheets can
- * then maniuplate this data or simply xsl:copy-of the Node. Note
- * that we first attempt to load the more advanced
- * org.apache.env.Which utility by reflection; only if that fails
- * to we still use the internal version. Which is available from
- * <a href="http://xml.apache.org/commons/">http://xml.apache.org/commons/</a>.</p>
- *
- * <p>We throw a WrappedRuntimeException in the unlikely case
- * that reading information from the environment throws us an
- * exception. (Is this really the best thing to do?)</p>
- *
- * @param myContext an <code>ExpressionContext</code> passed in by the
- * extension mechanism. This must be an XPathContext.
- * @return a Node as described above.
- */
- public static Node checkEnvironment(ExpressionContext myContext)
- {
-
- Document factoryDocument = getDocument();
-
- Node resultNode = null;
- try
- {
- // First use reflection to try to load Which, which is a
- // better version of EnvironmentCheck
- resultNode = checkEnvironmentUsingWhich(myContext, factoryDocument);
-
- if (null != resultNode)
- return resultNode;
-
- // If reflection failed, fallback to our internal EnvironmentCheck
- EnvironmentCheck envChecker = new EnvironmentCheck();
- Map<String, Object> h = envChecker.getEnvironmentHash();
- resultNode = factoryDocument.createElement("checkEnvironmentExtension");
- envChecker.appendEnvironmentReport(resultNode, factoryDocument, h);
- envChecker = null;
- }
- catch(Exception e)
- {
- throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(e);
- }
-
- return resultNode;
- }
-
- /**
- * Private worker method to attempt to use org.apache.env.Which.
- *
- * @param myContext an <code>ExpressionContext</code> passed in by the
- * extension mechanism. This must be an XPathContext.
- * @param factoryDocument providing createElement services, etc.
- * @return a Node with environment info; null if any error
- */
- private static Node checkEnvironmentUsingWhich(ExpressionContext myContext,
- Document factoryDocument)
- {
- final String WHICH_CLASSNAME = "org.apache.env.Which";
- final String WHICH_METHODNAME = "which";
- final Class WHICH_METHOD_ARGS[] = { java.util.Hashtable.class,
- java.lang.String.class,
- java.lang.String.class };
- try
- {
- // Use reflection to try to find xml-commons utility 'Which'
- Class clazz = ObjectFactory.findProviderClass(WHICH_CLASSNAME, true);
- if (null == clazz)
- return null;
-
- // Fully qualify names since this is the only method they're used in
- java.lang.reflect.Method method = clazz.getMethod(WHICH_METHODNAME, WHICH_METHOD_ARGS);
- Hashtable report = new Hashtable();
-
- // Call the method with our Hashtable, common options, and ignore return value
- Object[] methodArgs = { report, "XmlCommons;Xalan;Xerces;Crimson;Ant", "" };
- Object returnValue = method.invoke(null, methodArgs);
-
- // Create a parent to hold the report and append hash to it
- Node resultNode = factoryDocument.createElement("checkEnvironmentExtension");
- com.sun.org.apache.xml.internal.utils.Hashtree2Node.appendHashToNode(report, "whichReport",
- resultNode, factoryDocument);
-
- return resultNode;
- }
- catch (Throwable t)
- {
- // Simply return null; no need to report error
- return null;
- }
- }
-
- /**
- * @return an instance of DOM Document
- */
- private static Document getDocument()
- {
- try
- {
- if (System.getSecurityManager() == null) {
- return DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
- } else {
- return DocumentBuilderFactory.newInstance(JDK_DEFAULT_DOM, null).newDocumentBuilder().newDocument();
- }
- }
- catch(ParserConfigurationException pce)
- {
- throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(pce);
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/lib/NodeInfo.java b/src/com/sun/org/apache/xalan/internal/lib/NodeInfo.java
deleted file mode 100644
index 05caa00..0000000
--- a/src/com/sun/org/apache/xalan/internal/lib/NodeInfo.java
+++ /dev/null
@@ -1,250 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: NodeInfo.java,v 1.2.4.1 2005/09/10 18:54:37 jeffsuttor Exp $
- */
-
-package com.sun.org.apache.xalan.internal.lib;
-
-import javax.xml.transform.SourceLocator;
-
-import com.sun.org.apache.xalan.internal.extensions.ExpressionContext;
-import com.sun.org.apache.xml.internal.dtm.ref.DTMNodeProxy;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * <code>NodeInfo</code> defines a set of XSLT extension functions to be
- * used from stylesheets.
- *
- * @author <a href="mailto:ovidiu@cup.hp.com">Ovidiu Predescu</a>
- * @since May 24, 2001
- */
-public class NodeInfo
-{
- /**
- * <code>systemId</code> returns the system id of the current
- * context node.
- *
- * @param context an <code>ExpressionContext</code> value
- * @return a <code>String</code> value
- */
- public static String systemId(ExpressionContext context)
- {
- Node contextNode = context.getContextNode();
- int nodeHandler = ((DTMNodeProxy)contextNode).getDTMNodeNumber();
- SourceLocator locator = ((DTMNodeProxy)contextNode).getDTM()
- .getSourceLocatorFor(nodeHandler);
-
- if (locator != null)
- return locator.getSystemId();
- else
- return null;
- }
-
- /**
- * <code>systemId</code> returns the system id of the node passed as
- * argument. If a node set is passed as argument, the system id of
- * the first node in the set is returned.
- *
- * @param nodeList a <code>NodeList</code> value
- * @return a <code>String</code> value
- */
- public static String systemId(NodeList nodeList)
- {
- if (nodeList == null || nodeList.getLength() == 0)
- return null;
-
- Node node = nodeList.item(0);
- int nodeHandler = ((DTMNodeProxy)node).getDTMNodeNumber();
- SourceLocator locator = ((DTMNodeProxy)node).getDTM()
- .getSourceLocatorFor(nodeHandler);
-
- if (locator != null)
- return locator.getSystemId();
- else
- return null;
- }
-
- /**
- * <code>publicId</code> returns the public identifier of the current
- * context node.
- *
- * Xalan does not currently record this value, and will return null.
- *
- * @param context an <code>ExpressionContext</code> value
- * @return a <code>String</code> value
- */
- public static String publicId(ExpressionContext context)
- {
- Node contextNode = context.getContextNode();
- int nodeHandler = ((DTMNodeProxy)contextNode).getDTMNodeNumber();
- SourceLocator locator = ((DTMNodeProxy)contextNode).getDTM()
- .getSourceLocatorFor(nodeHandler);
-
- if (locator != null)
- return locator.getPublicId();
- else
- return null;
- }
-
- /**
- * <code>publicId</code> returns the public identifier of the node passed as
- * argument. If a node set is passed as argument, the public identifier of
- * the first node in the set is returned.
- *
- * Xalan does not currently record this value, and will return null.
- *
- * @param nodeList a <code>NodeList</code> value
- * @return a <code>String</code> value
- */
- public static String publicId(NodeList nodeList)
- {
- if (nodeList == null || nodeList.getLength() == 0)
- return null;
-
- Node node = nodeList.item(0);
- int nodeHandler = ((DTMNodeProxy)node).getDTMNodeNumber();
- SourceLocator locator = ((DTMNodeProxy)node).getDTM()
- .getSourceLocatorFor(nodeHandler);
-
- if (locator != null)
- return locator.getPublicId();
- else
- return null;
- }
-
- /**
- * <code>lineNumber</code> returns the line number of the current
- * context node.
- *
- * NOTE: Xalan does not normally record location information for each node.
- * To obtain it, you must set the custom TrAX attribute
- * "http://xml.apache.org/xalan/features/source_location"
- * true in the TransformerFactory before generating the Transformer and executing
- * the stylesheet. Storage cost per node will be noticably increased in this mode.
- *
- * @param context an <code>ExpressionContext</code> value
- * @return an <code>int</code> value. This may be -1 to indicate that the
- * line number is not known.
- */
- public static int lineNumber(ExpressionContext context)
- {
- Node contextNode = context.getContextNode();
- int nodeHandler = ((DTMNodeProxy)contextNode).getDTMNodeNumber();
- SourceLocator locator = ((DTMNodeProxy)contextNode).getDTM()
- .getSourceLocatorFor(nodeHandler);
-
- if (locator != null)
- return locator.getLineNumber();
- else
- return -1;
- }
-
- /**
- * <code>lineNumber</code> returns the line number of the node
- * passed as argument. If a node set is passed as argument, the line
- * number of the first node in the set is returned.
- *
- * NOTE: Xalan does not normally record location information for each node.
- * To obtain it, you must set the custom TrAX attribute
- * "http://xml.apache.org/xalan/features/source_location"
- * true in the TransformerFactory before generating the Transformer and executing
- * the stylesheet. Storage cost per node will be noticably increased in this mode.
- *
- * @param nodeList a <code>NodeList</code> value
- * @return an <code>int</code> value. This may be -1 to indicate that the
- * line number is not known.
- */
- public static int lineNumber(NodeList nodeList)
- {
- if (nodeList == null || nodeList.getLength() == 0)
- return -1;
-
- Node node = nodeList.item(0);
- int nodeHandler = ((DTMNodeProxy)node).getDTMNodeNumber();
- SourceLocator locator = ((DTMNodeProxy)node).getDTM()
- .getSourceLocatorFor(nodeHandler);
-
- if (locator != null)
- return locator.getLineNumber();
- else
- return -1;
- }
-
- /**
- * <code>columnNumber</code> returns the column number of the
- * current context node.
- *
- * NOTE: Xalan does not normally record location information for each node.
- * To obtain it, you must set the custom TrAX attribute
- * "http://xml.apache.org/xalan/features/source_location"
- * true in the TransformerFactory before generating the Transformer and executing
- * the stylesheet. Storage cost per node will be noticably increased in this mode.
- *
- * @param context an <code>ExpressionContext</code> value
- * @return an <code>int</code> value. This may be -1 to indicate that the
- * column number is not known.
- */
- public static int columnNumber(ExpressionContext context)
- {
- Node contextNode = context.getContextNode();
- int nodeHandler = ((DTMNodeProxy)contextNode).getDTMNodeNumber();
- SourceLocator locator = ((DTMNodeProxy)contextNode).getDTM()
- .getSourceLocatorFor(nodeHandler);
-
- if (locator != null)
- return locator.getColumnNumber();
- else
- return -1;
- }
-
- /**
- * <code>columnNumber</code> returns the column number of the node
- * passed as argument. If a node set is passed as argument, the line
- * number of the first node in the set is returned.
- *
- * NOTE: Xalan does not normally record location information for each node.
- * To obtain it, you must set the custom TrAX attribute
- * "http://xml.apache.org/xalan/features/source_location"
- * true in the TransformerFactory before generating the Transformer and executing
- * the stylesheet. Storage cost per node will be noticably increased in this mode.
- *
- * @param nodeList a <code>NodeList</code> value
- * @return an <code>int</code> value. This may be -1 to indicate that the
- * column number is not known.
- */
- public static int columnNumber(NodeList nodeList)
- {
- if (nodeList == null || nodeList.getLength() == 0)
- return -1;
-
- Node node = nodeList.item(0);
- int nodeHandler = ((DTMNodeProxy)node).getDTMNodeNumber();
- SourceLocator locator = ((DTMNodeProxy)node).getDTM()
- .getSourceLocatorFor(nodeHandler);
-
- if (locator != null)
- return locator.getColumnNumber();
- else
- return -1;
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/lib/package.html b/src/com/sun/org/apache/xalan/internal/lib/package.html
deleted file mode 100644
index b621168..0000000
--- a/src/com/sun/org/apache/xalan/internal/lib/package.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<!--
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
--->
-<!--
- * Copyright 2000-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
--->
-<!-- $Id: package.html,v 1.1.2.1 2005/08/01 02:08:50 jeffsuttor Exp $ -->
-<html>
- <title>Xalan and EXSLT Extensions.</title>
- <body>
- <p>Extension elements and functions shipped with Xalan-Java, including EXSLT functions.</p>
- <p>We are adding extensions to this package.<p>
- </body>
-</html>
-
-
diff --git a/src/com/sun/org/apache/xalan/internal/res/XSLMessages.java b/src/com/sun/org/apache/xalan/internal/res/XSLMessages.java
deleted file mode 100644
index 00d11e9..0000000
--- a/src/com/sun/org/apache/xalan/internal/res/XSLMessages.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XSLMessages.java,v 1.2.4.1 2005/09/09 07:41:10 pvedula Exp $
- */
-package com.sun.org.apache.xalan.internal.res;
-
-import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
-import java.util.ListResourceBundle;
-
-import com.sun.org.apache.xpath.internal.res.XPATHMessages;
-
-/**
- * Sets things up for issuing error messages. This class is misnamed, and should
- * be called XalanMessages, or some such.
- *
- * @xsl.usage internal
- */
-public class XSLMessages extends XPATHMessages {
-
- /**
- * The language specific resource object for Xalan messages.
- */
- private static ListResourceBundle XSLTBundle = null;
- /**
- * The class name of the Xalan error message string table.
- */
- private static final String XSLT_ERROR_RESOURCES =
- "com.sun.org.apache.xalan.internal.res.XSLTErrorResources";
-
- /**
- * Creates a message from the specified key and replacement arguments,
- * localized to the given locale.
- *
- * @param msgKey The key for the message text.
- * @param args The arguments to be used as replacement text in the message
- * created.
- *
- * @return The formatted message string.
- */
- public static String createMessage(String msgKey, Object args[]) //throws Exception
- {
- if (XSLTBundle == null) {
- XSLTBundle = SecuritySupport.getResourceBundle(XSLT_ERROR_RESOURCES);
- }
-
- if (XSLTBundle != null) {
- return createMsg(XSLTBundle, msgKey, args);
- } else {
- return "Could not load any resource bundles.";
- }
- }
-
- /**
- * Creates a message from the specified key and replacement arguments,
- * localized to the given locale.
- *
- * @param msgKey The key for the message text.
- * @param args The arguments to be used as replacement text in the message
- * created.
- *
- * @return The formatted warning string.
- */
- public static String createWarning(String msgKey, Object args[]) //throws Exception
- {
- if (XSLTBundle == null) {
- XSLTBundle = SecuritySupport.getResourceBundle(XSLT_ERROR_RESOURCES);
- }
-
- if (XSLTBundle != null) {
- return createMsg(XSLTBundle, msgKey, args);
- } else {
- return "Could not load any resource bundles.";
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources.java b/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources.java
deleted file mode 100644
index 5ef374f..0000000
--- a/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources.java
+++ /dev/null
@@ -1,1447 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xalan.internal.res;
-
-import java.util.ListResourceBundle;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * Set up error messages.
- * We build a two dimensional array of message keys and
- * message strings. In order to add a new message here,
- * you need to first add a String constant. And
- * you need to enter key , value pair as part of contents
- * Array. You also need to update MAX_CODE for error strings
- * and MAX_WARNING for warnings ( Needed for only information
- * purpose )
- */
-public class XSLTErrorResources extends ListResourceBundle
-{
-
-/*
- * This file contains error and warning messages related to Xalan Error
- * Handling.
- *
- * General notes to translators:
- *
- * 1) Xalan (or more properly, Xalan-interpretive) and XSLTC are names of
- * components.
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- * XSLTC is an acronym for XSLT Compiler.
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 5) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 6) "Translet" is an invented term that describes the class file that
- * results from compiling an XML stylesheet into a Java class.
- *
- * 7) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- */
-
- /*
- * Static variables
- */
- public static final String ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX =
- "ER_INVALID_SET_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX";
-
- public static final String ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX_FOR_DEFAULT =
- "ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX_FOR_DEFAULT";
-
- public static final String ER_NO_CURLYBRACE = "ER_NO_CURLYBRACE";
- public static final String ER_FUNCTION_NOT_SUPPORTED = "ER_FUNCTION_NOT_SUPPORTED";
- public static final String ER_ILLEGAL_ATTRIBUTE = "ER_ILLEGAL_ATTRIBUTE";
- public static final String ER_NULL_SOURCENODE_APPLYIMPORTS = "ER_NULL_SOURCENODE_APPLYIMPORTS";
- public static final String ER_CANNOT_ADD = "ER_CANNOT_ADD";
- public static final String ER_NULL_SOURCENODE_HANDLEAPPLYTEMPLATES="ER_NULL_SOURCENODE_HANDLEAPPLYTEMPLATES";
- public static final String ER_NO_NAME_ATTRIB = "ER_NO_NAME_ATTRIB";
- public static final String ER_TEMPLATE_NOT_FOUND = "ER_TEMPLATE_NOT_FOUND";
- public static final String ER_CANT_RESOLVE_NAME_AVT = "ER_CANT_RESOLVE_NAME_AVT";
- public static final String ER_REQUIRES_ATTRIB = "ER_REQUIRES_ATTRIB";
- public static final String ER_MUST_HAVE_TEST_ATTRIB = "ER_MUST_HAVE_TEST_ATTRIB";
- public static final String ER_BAD_VAL_ON_LEVEL_ATTRIB =
- "ER_BAD_VAL_ON_LEVEL_ATTRIB";
- public static final String ER_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML =
- "ER_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML";
- public static final String ER_PROCESSINGINSTRUCTION_NOTVALID_NCNAME =
- "ER_PROCESSINGINSTRUCTION_NOTVALID_NCNAME";
- public static final String ER_NEED_MATCH_ATTRIB = "ER_NEED_MATCH_ATTRIB";
- public static final String ER_NEED_NAME_OR_MATCH_ATTRIB =
- "ER_NEED_NAME_OR_MATCH_ATTRIB";
- public static final String ER_CANT_RESOLVE_NSPREFIX =
- "ER_CANT_RESOLVE_NSPREFIX";
- public static final String ER_ILLEGAL_VALUE = "ER_ILLEGAL_VALUE";
- public static final String ER_NO_OWNERDOC = "ER_NO_OWNERDOC";
- public static final String ER_ELEMTEMPLATEELEM_ERR ="ER_ELEMTEMPLATEELEM_ERR";
- public static final String ER_NULL_CHILD = "ER_NULL_CHILD";
- public static final String ER_NEED_SELECT_ATTRIB = "ER_NEED_SELECT_ATTRIB";
- public static final String ER_NEED_TEST_ATTRIB = "ER_NEED_TEST_ATTRIB";
- public static final String ER_NEED_NAME_ATTRIB = "ER_NEED_NAME_ATTRIB";
- public static final String ER_NO_CONTEXT_OWNERDOC = "ER_NO_CONTEXT_OWNERDOC";
- public static final String ER_COULD_NOT_CREATE_XML_PROC_LIAISON =
- "ER_COULD_NOT_CREATE_XML_PROC_LIAISON";
- public static final String ER_PROCESS_NOT_SUCCESSFUL =
- "ER_PROCESS_NOT_SUCCESSFUL";
- public static final String ER_NOT_SUCCESSFUL = "ER_NOT_SUCCESSFUL";
- public static final String ER_ENCODING_NOT_SUPPORTED =
- "ER_ENCODING_NOT_SUPPORTED";
- public static final String ER_COULD_NOT_CREATE_TRACELISTENER =
- "ER_COULD_NOT_CREATE_TRACELISTENER";
- public static final String ER_KEY_REQUIRES_NAME_ATTRIB =
- "ER_KEY_REQUIRES_NAME_ATTRIB";
- public static final String ER_KEY_REQUIRES_MATCH_ATTRIB =
- "ER_KEY_REQUIRES_MATCH_ATTRIB";
- public static final String ER_KEY_REQUIRES_USE_ATTRIB =
- "ER_KEY_REQUIRES_USE_ATTRIB";
- public static final String ER_REQUIRES_ELEMENTS_ATTRIB =
- "ER_REQUIRES_ELEMENTS_ATTRIB";
- public static final String ER_MISSING_PREFIX_ATTRIB =
- "ER_MISSING_PREFIX_ATTRIB";
- public static final String ER_BAD_STYLESHEET_URL = "ER_BAD_STYLESHEET_URL";
- public static final String ER_FILE_NOT_FOUND = "ER_FILE_NOT_FOUND";
- public static final String ER_IOEXCEPTION = "ER_IOEXCEPTION";
- public static final String ER_NO_HREF_ATTRIB = "ER_NO_HREF_ATTRIB";
- public static final String ER_STYLESHEET_INCLUDES_ITSELF =
- "ER_STYLESHEET_INCLUDES_ITSELF";
- public static final String ER_PROCESSINCLUDE_ERROR ="ER_PROCESSINCLUDE_ERROR";
- public static final String ER_MISSING_LANG_ATTRIB = "ER_MISSING_LANG_ATTRIB";
- public static final String ER_MISSING_CONTAINER_ELEMENT_COMPONENT =
- "ER_MISSING_CONTAINER_ELEMENT_COMPONENT";
- public static final String ER_CAN_ONLY_OUTPUT_TO_ELEMENT =
- "ER_CAN_ONLY_OUTPUT_TO_ELEMENT";
- public static final String ER_PROCESS_ERROR = "ER_PROCESS_ERROR";
- public static final String ER_UNIMPLNODE_ERROR = "ER_UNIMPLNODE_ERROR";
- public static final String ER_NO_SELECT_EXPRESSION ="ER_NO_SELECT_EXPRESSION";
- public static final String ER_CANNOT_SERIALIZE_XSLPROCESSOR =
- "ER_CANNOT_SERIALIZE_XSLPROCESSOR";
- public static final String ER_NO_INPUT_STYLESHEET = "ER_NO_INPUT_STYLESHEET";
- public static final String ER_FAILED_PROCESS_STYLESHEET =
- "ER_FAILED_PROCESS_STYLESHEET";
- public static final String ER_COULDNT_PARSE_DOC = "ER_COULDNT_PARSE_DOC";
- public static final String ER_COULDNT_FIND_FRAGMENT =
- "ER_COULDNT_FIND_FRAGMENT";
- public static final String ER_NODE_NOT_ELEMENT = "ER_NODE_NOT_ELEMENT";
- public static final String ER_FOREACH_NEED_MATCH_OR_NAME_ATTRIB =
- "ER_FOREACH_NEED_MATCH_OR_NAME_ATTRIB";
- public static final String ER_TEMPLATES_NEED_MATCH_OR_NAME_ATTRIB =
- "ER_TEMPLATES_NEED_MATCH_OR_NAME_ATTRIB";
- public static final String ER_NO_CLONE_OF_DOCUMENT_FRAG =
- "ER_NO_CLONE_OF_DOCUMENT_FRAG";
- public static final String ER_CANT_CREATE_ITEM = "ER_CANT_CREATE_ITEM";
- public static final String ER_XMLSPACE_ILLEGAL_VALUE =
- "ER_XMLSPACE_ILLEGAL_VALUE";
- public static final String ER_NO_XSLKEY_DECLARATION =
- "ER_NO_XSLKEY_DECLARATION";
- public static final String ER_CANT_CREATE_URL = "ER_CANT_CREATE_URL";
- public static final String ER_XSLFUNCTIONS_UNSUPPORTED =
- "ER_XSLFUNCTIONS_UNSUPPORTED";
- public static final String ER_PROCESSOR_ERROR = "ER_PROCESSOR_ERROR";
- public static final String ER_NOT_ALLOWED_INSIDE_STYLESHEET =
- "ER_NOT_ALLOWED_INSIDE_STYLESHEET";
- public static final String ER_RESULTNS_NOT_SUPPORTED =
- "ER_RESULTNS_NOT_SUPPORTED";
- public static final String ER_DEFAULTSPACE_NOT_SUPPORTED =
- "ER_DEFAULTSPACE_NOT_SUPPORTED";
- public static final String ER_INDENTRESULT_NOT_SUPPORTED =
- "ER_INDENTRESULT_NOT_SUPPORTED";
- public static final String ER_ILLEGAL_ATTRIB = "ER_ILLEGAL_ATTRIB";
- public static final String ER_UNKNOWN_XSL_ELEM = "ER_UNKNOWN_XSL_ELEM";
- public static final String ER_BAD_XSLSORT_USE = "ER_BAD_XSLSORT_USE";
- public static final String ER_MISPLACED_XSLWHEN = "ER_MISPLACED_XSLWHEN";
- public static final String ER_XSLWHEN_NOT_PARENTED_BY_XSLCHOOSE =
- "ER_XSLWHEN_NOT_PARENTED_BY_XSLCHOOSE";
- public static final String ER_MISPLACED_XSLOTHERWISE =
- "ER_MISPLACED_XSLOTHERWISE";
- public static final String ER_XSLOTHERWISE_NOT_PARENTED_BY_XSLCHOOSE =
- "ER_XSLOTHERWISE_NOT_PARENTED_BY_XSLCHOOSE";
- public static final String ER_NOT_ALLOWED_INSIDE_TEMPLATE =
- "ER_NOT_ALLOWED_INSIDE_TEMPLATE";
- public static final String ER_UNKNOWN_EXT_NS_PREFIX =
- "ER_UNKNOWN_EXT_NS_PREFIX";
- public static final String ER_IMPORTS_AS_FIRST_ELEM =
- "ER_IMPORTS_AS_FIRST_ELEM";
- public static final String ER_IMPORTING_ITSELF = "ER_IMPORTING_ITSELF";
- public static final String ER_XMLSPACE_ILLEGAL_VAL ="ER_XMLSPACE_ILLEGAL_VAL";
- public static final String ER_PROCESSSTYLESHEET_NOT_SUCCESSFUL =
- "ER_PROCESSSTYLESHEET_NOT_SUCCESSFUL";
- public static final String ER_SAX_EXCEPTION = "ER_SAX_EXCEPTION";
- public static final String ER_XSLT_ERROR = "ER_XSLT_ERROR";
- public static final String ER_CURRENCY_SIGN_ILLEGAL=
- "ER_CURRENCY_SIGN_ILLEGAL";
- public static final String ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM =
- "ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM";
- public static final String ER_CANT_RESOLVE_PREFIX_OF_NON_PREFIX_RESOLVER =
- "ER_CANT_RESOLVE_PREFIX_OF_NON_PREFIX_RESOLVER";
- public static final String ER_REDIRECT_COULDNT_GET_FILENAME =
- "ER_REDIRECT_COULDNT_GET_FILENAME";
- public static final String ER_CANNOT_BUILD_FORMATTERLISTENER_IN_REDIRECT =
- "ER_CANNOT_BUILD_FORMATTERLISTENER_IN_REDIRECT";
- public static final String ER_INVALID_PREFIX_IN_EXCLUDERESULTPREFIX =
- "ER_INVALID_PREFIX_IN_EXCLUDERESULTPREFIX";
- public static final String ER_MISSING_NS_URI = "ER_MISSING_NS_URI";
- public static final String ER_MISSING_ARG_FOR_OPTION =
- "ER_MISSING_ARG_FOR_OPTION";
- public static final String ER_INVALID_OPTION = "ER_INVALID_OPTION";
- public static final String ER_MALFORMED_FORMAT_STRING =
- "ER_MALFORMED_FORMAT_STRING";
- public static final String ER_STYLESHEET_REQUIRES_VERSION_ATTRIB =
- "ER_STYLESHEET_REQUIRES_VERSION_ATTRIB";
- public static final String ER_ILLEGAL_ATTRIBUTE_VALUE =
- "ER_ILLEGAL_ATTRIBUTE_VALUE";
- public static final String ER_CHOOSE_REQUIRES_WHEN ="ER_CHOOSE_REQUIRES_WHEN";
- public static final String ER_NO_APPLY_IMPORT_IN_FOR_EACH =
- "ER_NO_APPLY_IMPORT_IN_FOR_EACH";
- public static final String ER_CANT_USE_DTM_FOR_OUTPUT =
- "ER_CANT_USE_DTM_FOR_OUTPUT";
- public static final String ER_CANT_USE_DTM_FOR_INPUT =
- "ER_CANT_USE_DTM_FOR_INPUT";
- public static final String ER_CALL_TO_EXT_FAILED = "ER_CALL_TO_EXT_FAILED";
- public static final String ER_PREFIX_MUST_RESOLVE = "ER_PREFIX_MUST_RESOLVE";
- public static final String ER_INVALID_UTF16_SURROGATE =
- "ER_INVALID_UTF16_SURROGATE";
- public static final String ER_XSLATTRSET_USED_ITSELF =
- "ER_XSLATTRSET_USED_ITSELF";
- public static final String ER_CANNOT_MIX_XERCESDOM ="ER_CANNOT_MIX_XERCESDOM";
- public static final String ER_TOO_MANY_LISTENERS = "ER_TOO_MANY_LISTENERS";
- public static final String ER_IN_ELEMTEMPLATEELEM_READOBJECT =
- "ER_IN_ELEMTEMPLATEELEM_READOBJECT";
- public static final String ER_DUPLICATE_NAMED_TEMPLATE =
- "ER_DUPLICATE_NAMED_TEMPLATE";
- public static final String ER_INVALID_KEY_CALL = "ER_INVALID_KEY_CALL";
- public static final String ER_REFERENCING_ITSELF = "ER_REFERENCING_ITSELF";
- public static final String ER_ILLEGAL_DOMSOURCE_INPUT =
- "ER_ILLEGAL_DOMSOURCE_INPUT";
- public static final String ER_CLASS_NOT_FOUND_FOR_OPTION =
- "ER_CLASS_NOT_FOUND_FOR_OPTION";
- public static final String ER_REQUIRED_ELEM_NOT_FOUND =
- "ER_REQUIRED_ELEM_NOT_FOUND";
- public static final String ER_INPUT_CANNOT_BE_NULL ="ER_INPUT_CANNOT_BE_NULL";
- public static final String ER_URI_CANNOT_BE_NULL = "ER_URI_CANNOT_BE_NULL";
- public static final String ER_FILE_CANNOT_BE_NULL = "ER_FILE_CANNOT_BE_NULL";
- public static final String ER_SOURCE_CANNOT_BE_NULL =
- "ER_SOURCE_CANNOT_BE_NULL";
- public static final String ER_CANNOT_INIT_BSFMGR = "ER_CANNOT_INIT_BSFMGR";
- public static final String ER_CANNOT_CMPL_EXTENSN = "ER_CANNOT_CMPL_EXTENSN";
- public static final String ER_CANNOT_CREATE_EXTENSN =
- "ER_CANNOT_CREATE_EXTENSN";
- public static final String ER_INSTANCE_MTHD_CALL_REQUIRES =
- "ER_INSTANCE_MTHD_CALL_REQUIRES";
- public static final String ER_INVALID_ELEMENT_NAME ="ER_INVALID_ELEMENT_NAME";
- public static final String ER_ELEMENT_NAME_METHOD_STATIC =
- "ER_ELEMENT_NAME_METHOD_STATIC";
- public static final String ER_EXTENSION_FUNC_UNKNOWN =
- "ER_EXTENSION_FUNC_UNKNOWN";
- public static final String ER_MORE_MATCH_CONSTRUCTOR =
- "ER_MORE_MATCH_CONSTRUCTOR";
- public static final String ER_MORE_MATCH_METHOD = "ER_MORE_MATCH_METHOD";
- public static final String ER_MORE_MATCH_ELEMENT = "ER_MORE_MATCH_ELEMENT";
- public static final String ER_INVALID_CONTEXT_PASSED =
- "ER_INVALID_CONTEXT_PASSED";
- public static final String ER_POOL_EXISTS = "ER_POOL_EXISTS";
- public static final String ER_NO_DRIVER_NAME = "ER_NO_DRIVER_NAME";
- public static final String ER_NO_URL = "ER_NO_URL";
- public static final String ER_POOL_SIZE_LESSTHAN_ONE =
- "ER_POOL_SIZE_LESSTHAN_ONE";
- public static final String ER_INVALID_DRIVER = "ER_INVALID_DRIVER";
- public static final String ER_NO_STYLESHEETROOT = "ER_NO_STYLESHEETROOT";
- public static final String ER_ILLEGAL_XMLSPACE_VALUE =
- "ER_ILLEGAL_XMLSPACE_VALUE";
- public static final String ER_PROCESSFROMNODE_FAILED =
- "ER_PROCESSFROMNODE_FAILED";
- public static final String ER_RESOURCE_COULD_NOT_LOAD =
- "ER_RESOURCE_COULD_NOT_LOAD";
- public static final String ER_BUFFER_SIZE_LESSTHAN_ZERO =
- "ER_BUFFER_SIZE_LESSTHAN_ZERO";
- public static final String ER_UNKNOWN_ERROR_CALLING_EXTENSION =
- "ER_UNKNOWN_ERROR_CALLING_EXTENSION";
- public static final String ER_NO_NAMESPACE_DECL = "ER_NO_NAMESPACE_DECL";
- public static final String ER_ELEM_CONTENT_NOT_ALLOWED =
- "ER_ELEM_CONTENT_NOT_ALLOWED";
- public static final String ER_STYLESHEET_DIRECTED_TERMINATION =
- "ER_STYLESHEET_DIRECTED_TERMINATION";
- public static final String ER_ONE_OR_TWO = "ER_ONE_OR_TWO";
- public static final String ER_TWO_OR_THREE = "ER_TWO_OR_THREE";
- public static final String ER_COULD_NOT_LOAD_RESOURCE =
- "ER_COULD_NOT_LOAD_RESOURCE";
- public static final String ER_CANNOT_INIT_DEFAULT_TEMPLATES =
- "ER_CANNOT_INIT_DEFAULT_TEMPLATES";
- public static final String ER_RESULT_NULL = "ER_RESULT_NULL";
- public static final String ER_RESULT_COULD_NOT_BE_SET =
- "ER_RESULT_COULD_NOT_BE_SET";
- public static final String ER_NO_OUTPUT_SPECIFIED = "ER_NO_OUTPUT_SPECIFIED";
- public static final String ER_CANNOT_TRANSFORM_TO_RESULT_TYPE =
- "ER_CANNOT_TRANSFORM_TO_RESULT_TYPE";
- public static final String ER_CANNOT_TRANSFORM_SOURCE_TYPE =
- "ER_CANNOT_TRANSFORM_SOURCE_TYPE";
- public static final String ER_NULL_CONTENT_HANDLER ="ER_NULL_CONTENT_HANDLER";
- public static final String ER_NULL_ERROR_HANDLER = "ER_NULL_ERROR_HANDLER";
- public static final String ER_CANNOT_CALL_PARSE = "ER_CANNOT_CALL_PARSE";
- public static final String ER_NO_PARENT_FOR_FILTER ="ER_NO_PARENT_FOR_FILTER";
- public static final String ER_NO_STYLESHEET_IN_MEDIA =
- "ER_NO_STYLESHEET_IN_MEDIA";
- public static final String ER_NO_STYLESHEET_PI = "ER_NO_STYLESHEET_PI";
- public static final String ER_NOT_SUPPORTED = "ER_NOT_SUPPORTED";
- public static final String ER_PROPERTY_VALUE_BOOLEAN =
- "ER_PROPERTY_VALUE_BOOLEAN";
- public static final String ER_COULD_NOT_FIND_EXTERN_SCRIPT =
- "ER_COULD_NOT_FIND_EXTERN_SCRIPT";
- public static final String ER_RESOURCE_COULD_NOT_FIND =
- "ER_RESOURCE_COULD_NOT_FIND";
- public static final String ER_OUTPUT_PROPERTY_NOT_RECOGNIZED =
- "ER_OUTPUT_PROPERTY_NOT_RECOGNIZED";
- public static final String ER_FAILED_CREATING_ELEMLITRSLT =
- "ER_FAILED_CREATING_ELEMLITRSLT";
- public static final String ER_VALUE_SHOULD_BE_NUMBER =
- "ER_VALUE_SHOULD_BE_NUMBER";
- public static final String ER_VALUE_SHOULD_EQUAL = "ER_VALUE_SHOULD_EQUAL";
- public static final String ER_FAILED_CALLING_METHOD =
- "ER_FAILED_CALLING_METHOD";
- public static final String ER_FAILED_CREATING_ELEMTMPL =
- "ER_FAILED_CREATING_ELEMTMPL";
- public static final String ER_CHARS_NOT_ALLOWED = "ER_CHARS_NOT_ALLOWED";
- public static final String ER_ATTR_NOT_ALLOWED = "ER_ATTR_NOT_ALLOWED";
- public static final String ER_BAD_VALUE = "ER_BAD_VALUE";
- public static final String ER_ATTRIB_VALUE_NOT_FOUND =
- "ER_ATTRIB_VALUE_NOT_FOUND";
- public static final String ER_ATTRIB_VALUE_NOT_RECOGNIZED =
- "ER_ATTRIB_VALUE_NOT_RECOGNIZED";
- public static final String ER_NULL_URI_NAMESPACE = "ER_NULL_URI_NAMESPACE";
- public static final String ER_NUMBER_TOO_BIG = "ER_NUMBER_TOO_BIG";
- public static final String ER_CANNOT_FIND_SAX1_DRIVER =
- "ER_CANNOT_FIND_SAX1_DRIVER";
- public static final String ER_SAX1_DRIVER_NOT_LOADED =
- "ER_SAX1_DRIVER_NOT_LOADED";
- public static final String ER_SAX1_DRIVER_NOT_INSTANTIATED =
- "ER_SAX1_DRIVER_NOT_INSTANTIATED" ;
- public static final String ER_SAX1_DRIVER_NOT_IMPLEMENT_PARSER =
- "ER_SAX1_DRIVER_NOT_IMPLEMENT_PARSER";
- public static final String ER_PARSER_PROPERTY_NOT_SPECIFIED =
- "ER_PARSER_PROPERTY_NOT_SPECIFIED";
- public static final String ER_PARSER_ARG_CANNOT_BE_NULL =
- "ER_PARSER_ARG_CANNOT_BE_NULL" ;
- public static final String ER_FEATURE = "ER_FEATURE";
- public static final String ER_PROPERTY = "ER_PROPERTY" ;
- public static final String ER_NULL_ENTITY_RESOLVER ="ER_NULL_ENTITY_RESOLVER";
- public static final String ER_NULL_DTD_HANDLER = "ER_NULL_DTD_HANDLER" ;
- public static final String ER_NO_DRIVER_NAME_SPECIFIED =
- "ER_NO_DRIVER_NAME_SPECIFIED";
- public static final String ER_NO_URL_SPECIFIED = "ER_NO_URL_SPECIFIED";
- public static final String ER_POOLSIZE_LESS_THAN_ONE =
- "ER_POOLSIZE_LESS_THAN_ONE";
- public static final String ER_INVALID_DRIVER_NAME = "ER_INVALID_DRIVER_NAME";
- public static final String ER_ERRORLISTENER = "ER_ERRORLISTENER";
- public static final String ER_ASSERT_NO_TEMPLATE_PARENT =
- "ER_ASSERT_NO_TEMPLATE_PARENT";
- public static final String ER_ASSERT_REDUNDENT_EXPR_ELIMINATOR =
- "ER_ASSERT_REDUNDENT_EXPR_ELIMINATOR";
- public static final String ER_NOT_ALLOWED_IN_POSITION =
- "ER_NOT_ALLOWED_IN_POSITION";
- public static final String ER_NONWHITESPACE_NOT_ALLOWED_IN_POSITION =
- "ER_NONWHITESPACE_NOT_ALLOWED_IN_POSITION";
- public static final String ER_NAMESPACE_CONTEXT_NULL_NAMESPACE =
- "ER_NAMESPACE_CONTEXT_NULL_NAMESPACE";
- public static final String ER_NAMESPACE_CONTEXT_NULL_PREFIX =
- "ER_NAMESPACE_CONTEXT_NULL_PREFIX";
- public static final String ER_XPATH_RESOLVER_NULL_QNAME =
- "ER_XPATH_RESOLVER_NULL_QNAME";
- public static final String ER_XPATH_RESOLVER_NEGATIVE_ARITY =
- "ER_XPATH_RESOLVER_NEGATIVE_ARITY";
- public static final String INVALID_TCHAR = "INVALID_TCHAR";
- public static final String INVALID_QNAME = "INVALID_QNAME";
- public static final String INVALID_ENUM = "INVALID_ENUM";
- public static final String INVALID_NMTOKEN = "INVALID_NMTOKEN";
- public static final String INVALID_NCNAME = "INVALID_NCNAME";
- public static final String INVALID_BOOLEAN = "INVALID_BOOLEAN";
- public static final String INVALID_NUMBER = "INVALID_NUMBER";
- public static final String ER_ARG_LITERAL = "ER_ARG_LITERAL";
- public static final String ER_DUPLICATE_GLOBAL_VAR ="ER_DUPLICATE_GLOBAL_VAR";
- public static final String ER_DUPLICATE_VAR = "ER_DUPLICATE_VAR";
- public static final String ER_TEMPLATE_NAME_MATCH = "ER_TEMPLATE_NAME_MATCH";
- public static final String ER_INVALID_PREFIX = "ER_INVALID_PREFIX";
- public static final String ER_NO_ATTRIB_SET = "ER_NO_ATTRIB_SET";
- public static final String ER_FUNCTION_NOT_FOUND =
- "ER_FUNCTION_NOT_FOUND";
- public static final String ER_CANT_HAVE_CONTENT_AND_SELECT =
- "ER_CANT_HAVE_CONTENT_AND_SELECT";
- public static final String ER_INVALID_SET_PARAM_VALUE = "ER_INVALID_SET_PARAM_VALUE";
- public static final String ER_SET_FEATURE_NULL_NAME =
- "ER_SET_FEATURE_NULL_NAME";
- public static final String ER_GET_FEATURE_NULL_NAME =
- "ER_GET_FEATURE_NULL_NAME";
- public static final String ER_UNSUPPORTED_FEATURE =
- "ER_UNSUPPORTED_FEATURE";
- public static final String ER_EXTENSION_ELEMENT_NOT_ALLOWED_IN_SECURE_PROCESSING =
- "ER_EXTENSION_ELEMENT_NOT_ALLOWED_IN_SECURE_PROCESSING";
-
- public static final String WG_FOUND_CURLYBRACE = "WG_FOUND_CURLYBRACE";
- public static final String WG_COUNT_ATTRIB_MATCHES_NO_ANCESTOR =
- "WG_COUNT_ATTRIB_MATCHES_NO_ANCESTOR";
- public static final String WG_EXPR_ATTRIB_CHANGED_TO_SELECT =
- "WG_EXPR_ATTRIB_CHANGED_TO_SELECT";
- public static final String WG_NO_LOCALE_IN_FORMATNUMBER =
- "WG_NO_LOCALE_IN_FORMATNUMBER";
- public static final String WG_LOCALE_NOT_FOUND = "WG_LOCALE_NOT_FOUND";
- public static final String WG_CANNOT_MAKE_URL_FROM ="WG_CANNOT_MAKE_URL_FROM";
- public static final String WG_CANNOT_LOAD_REQUESTED_DOC =
- "WG_CANNOT_LOAD_REQUESTED_DOC";
- public static final String WG_CANNOT_FIND_COLLATOR ="WG_CANNOT_FIND_COLLATOR";
- public static final String WG_FUNCTIONS_SHOULD_USE_URL =
- "WG_FUNCTIONS_SHOULD_USE_URL";
- public static final String WG_ENCODING_NOT_SUPPORTED_USING_UTF8 =
- "WG_ENCODING_NOT_SUPPORTED_USING_UTF8";
- public static final String WG_ENCODING_NOT_SUPPORTED_USING_JAVA =
- "WG_ENCODING_NOT_SUPPORTED_USING_JAVA";
- public static final String WG_SPECIFICITY_CONFLICTS =
- "WG_SPECIFICITY_CONFLICTS";
- public static final String WG_PARSING_AND_PREPARING =
- "WG_PARSING_AND_PREPARING";
- public static final String WG_ATTR_TEMPLATE = "WG_ATTR_TEMPLATE";
- public static final String WG_CONFLICT_BETWEEN_XSLSTRIPSPACE_AND_XSLPRESERVESPACE = "WG_CONFLICT_BETWEEN_XSLSTRIPSPACE_AND_XSLPRESERVESP";
- public static final String WG_ATTRIB_NOT_HANDLED = "WG_ATTRIB_NOT_HANDLED";
- public static final String WG_NO_DECIMALFORMAT_DECLARATION =
- "WG_NO_DECIMALFORMAT_DECLARATION";
- public static final String WG_OLD_XSLT_NS = "WG_OLD_XSLT_NS";
- public static final String WG_ONE_DEFAULT_XSLDECIMALFORMAT_ALLOWED =
- "WG_ONE_DEFAULT_XSLDECIMALFORMAT_ALLOWED";
- public static final String WG_XSLDECIMALFORMAT_NAMES_MUST_BE_UNIQUE =
- "WG_XSLDECIMALFORMAT_NAMES_MUST_BE_UNIQUE";
- public static final String WG_ILLEGAL_ATTRIBUTE = "WG_ILLEGAL_ATTRIBUTE";
- public static final String WG_COULD_NOT_RESOLVE_PREFIX =
- "WG_COULD_NOT_RESOLVE_PREFIX";
- public static final String WG_STYLESHEET_REQUIRES_VERSION_ATTRIB =
- "WG_STYLESHEET_REQUIRES_VERSION_ATTRIB";
- public static final String WG_ILLEGAL_ATTRIBUTE_NAME =
- "WG_ILLEGAL_ATTRIBUTE_NAME";
- public static final String WG_ILLEGAL_ATTRIBUTE_VALUE =
- "WG_ILLEGAL_ATTRIBUTE_VALUE";
- public static final String WG_EMPTY_SECOND_ARG = "WG_EMPTY_SECOND_ARG";
- public static final String WG_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML =
- "WG_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML";
- public static final String WG_PROCESSINGINSTRUCTION_NOTVALID_NCNAME =
- "WG_PROCESSINGINSTRUCTION_NOTVALID_NCNAME";
- public static final String WG_ILLEGAL_ATTRIBUTE_POSITION =
- "WG_ILLEGAL_ATTRIBUTE_POSITION";
- public static final String NO_MODIFICATION_ALLOWED_ERR =
- "NO_MODIFICATION_ALLOWED_ERR";
-
- /*
- * Now fill in the message text.
- * Then fill in the message text for that message code in the
- * array. Use the new error code as the index into the array.
- */
-
- // Error messages...
-
- /** Get the lookup table for error messages.
- *
- * @return The message lookup table.
- */
- public Object[][] getContents()
- {
- return new Object[][] {
-
- /** Error message ID that has a null message, but takes in a single object. */
- {"ER0000" , "{0}" },
-
- { ER_NO_CURLYBRACE,
- "Error: Can not have '{' within expression"},
-
- { ER_ILLEGAL_ATTRIBUTE ,
- "{0} has an illegal attribute: {1}"},
-
- {ER_NULL_SOURCENODE_APPLYIMPORTS ,
- "sourceNode is null in xsl:apply-imports!"},
-
- {ER_CANNOT_ADD,
- "Can not add {0} to {1}"},
-
- { ER_NULL_SOURCENODE_HANDLEAPPLYTEMPLATES,
- "sourceNode is null in handleApplyTemplatesInstruction!"},
-
- { ER_NO_NAME_ATTRIB,
- "{0} must have a name attribute."},
-
- {ER_TEMPLATE_NOT_FOUND,
- "Could not find template named: {0}"},
-
- {ER_CANT_RESOLVE_NAME_AVT,
- "Could not resolve name AVT in xsl:call-template."},
-
- {ER_REQUIRES_ATTRIB,
- "{0} requires attribute: {1}"},
-
- { ER_MUST_HAVE_TEST_ATTRIB,
- "{0} must have a ''test'' attribute."},
-
- {ER_BAD_VAL_ON_LEVEL_ATTRIB,
- "Bad value on level attribute: {0}"},
-
- {ER_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML,
- "processing-instruction name can not be 'xml'"},
-
- { ER_PROCESSINGINSTRUCTION_NOTVALID_NCNAME,
- "processing-instruction name must be a valid NCName: {0}"},
-
- { ER_NEED_MATCH_ATTRIB,
- "{0} must have a match attribute if it has a mode."},
-
- { ER_NEED_NAME_OR_MATCH_ATTRIB,
- "{0} requires either a name or a match attribute."},
-
- {ER_CANT_RESOLVE_NSPREFIX,
- "Can not resolve namespace prefix: {0}"},
-
- { ER_ILLEGAL_VALUE,
- "xml:space has an illegal value: {0}"},
-
- { ER_NO_OWNERDOC,
- "Child node does not have an owner document!"},
-
- { ER_ELEMTEMPLATEELEM_ERR,
- "ElemTemplateElement error: {0}"},
-
- { ER_NULL_CHILD,
- "Trying to add a null child!"},
-
- { ER_NEED_SELECT_ATTRIB,
- "{0} requires a select attribute."},
-
- { ER_NEED_TEST_ATTRIB ,
- "xsl:when must have a 'test' attribute."},
-
- { ER_NEED_NAME_ATTRIB,
- "xsl:with-param must have a 'name' attribute."},
-
- { ER_NO_CONTEXT_OWNERDOC,
- "context does not have an owner document!"},
-
- {ER_COULD_NOT_CREATE_XML_PROC_LIAISON,
- "Could not create XML TransformerFactory Liaison: {0}"},
-
- {ER_PROCESS_NOT_SUCCESSFUL,
- "Xalan: Process was not successful."},
-
- { ER_NOT_SUCCESSFUL,
- "Xalan: was not successful."},
-
- { ER_ENCODING_NOT_SUPPORTED,
- "Encoding not supported: {0}"},
-
- {ER_COULD_NOT_CREATE_TRACELISTENER,
- "Could not create TraceListener: {0}"},
-
- {ER_KEY_REQUIRES_NAME_ATTRIB,
- "xsl:key requires a 'name' attribute!"},
-
- { ER_KEY_REQUIRES_MATCH_ATTRIB,
- "xsl:key requires a 'match' attribute!"},
-
- { ER_KEY_REQUIRES_USE_ATTRIB,
- "xsl:key requires a 'use' attribute!"},
-
- { ER_REQUIRES_ELEMENTS_ATTRIB,
- "(StylesheetHandler) {0} requires an ''elements'' attribute!"},
-
- { ER_MISSING_PREFIX_ATTRIB,
- "(StylesheetHandler) {0} attribute ''prefix'' is missing"},
-
- { ER_BAD_STYLESHEET_URL,
- "Stylesheet URL is bad: {0}"},
-
- { ER_FILE_NOT_FOUND,
- "Stylesheet file was not found: {0}"},
-
- { ER_IOEXCEPTION,
- "Had IO Exception with stylesheet file: {0}"},
-
- { ER_NO_HREF_ATTRIB,
- "(StylesheetHandler) Could not find href attribute for {0}"},
-
- { ER_STYLESHEET_INCLUDES_ITSELF,
- "(StylesheetHandler) {0} is directly or indirectly including itself!"},
-
- { ER_PROCESSINCLUDE_ERROR,
- "StylesheetHandler.processInclude error, {0}"},
-
- { ER_MISSING_LANG_ATTRIB,
- "(StylesheetHandler) {0} attribute ''lang'' is missing"},
-
- { ER_MISSING_CONTAINER_ELEMENT_COMPONENT,
- "(StylesheetHandler) misplaced {0} element?? Missing container element ''component''"},
-
- { ER_CAN_ONLY_OUTPUT_TO_ELEMENT,
- "Can only output to an Element, DocumentFragment, Document, or PrintWriter."},
-
- { ER_PROCESS_ERROR,
- "StylesheetRoot.process error"},
-
- { ER_UNIMPLNODE_ERROR,
- "UnImplNode error: {0}"},
-
- { ER_NO_SELECT_EXPRESSION,
- "Error! Did not find xpath select expression (-select)."},
-
- { ER_CANNOT_SERIALIZE_XSLPROCESSOR,
- "Can not serialize an XSLProcessor!"},
-
- { ER_NO_INPUT_STYLESHEET,
- "Stylesheet input was not specified!"},
-
- { ER_FAILED_PROCESS_STYLESHEET,
- "Failed to process stylesheet!"},
-
- { ER_COULDNT_PARSE_DOC,
- "Could not parse {0} document!"},
-
- { ER_COULDNT_FIND_FRAGMENT,
- "Could not find fragment: {0}"},
-
- { ER_NODE_NOT_ELEMENT,
- "Node pointed to by fragment identifier was not an element: {0}"},
-
- { ER_FOREACH_NEED_MATCH_OR_NAME_ATTRIB,
- "for-each must have either a match or name attribute"},
-
- { ER_TEMPLATES_NEED_MATCH_OR_NAME_ATTRIB,
- "templates must have either a match or name attribute"},
-
- { ER_NO_CLONE_OF_DOCUMENT_FRAG,
- "No clone of a document fragment!"},
-
- { ER_CANT_CREATE_ITEM,
- "Can not create item in result tree: {0}"},
-
- { ER_XMLSPACE_ILLEGAL_VALUE,
- "xml:space in the source XML has an illegal value: {0}"},
-
- { ER_NO_XSLKEY_DECLARATION,
- "There is no xsl:key declaration for {0}!"},
-
- { ER_CANT_CREATE_URL,
- "Error! Cannot create url for: {0}"},
-
- { ER_XSLFUNCTIONS_UNSUPPORTED,
- "xsl:functions is unsupported"},
-
- { ER_PROCESSOR_ERROR,
- "XSLT TransformerFactory Error"},
-
- { ER_NOT_ALLOWED_INSIDE_STYLESHEET,
- "(StylesheetHandler) {0} not allowed inside a stylesheet!"},
-
- { ER_RESULTNS_NOT_SUPPORTED,
- "result-ns no longer supported! Use xsl:output instead."},
-
- { ER_DEFAULTSPACE_NOT_SUPPORTED,
- "default-space no longer supported! Use xsl:strip-space or xsl:preserve-space instead."},
-
- { ER_INDENTRESULT_NOT_SUPPORTED,
- "indent-result no longer supported! Use xsl:output instead."},
-
- { ER_ILLEGAL_ATTRIB,
- "(StylesheetHandler) {0} has an illegal attribute: {1}"},
-
- { ER_UNKNOWN_XSL_ELEM,
- "Unknown XSL element: {0}"},
-
- { ER_BAD_XSLSORT_USE,
- "(StylesheetHandler) xsl:sort can only be used with xsl:apply-templates or xsl:for-each."},
-
- { ER_MISPLACED_XSLWHEN,
- "(StylesheetHandler) misplaced xsl:when!"},
-
- { ER_XSLWHEN_NOT_PARENTED_BY_XSLCHOOSE,
- "(StylesheetHandler) xsl:when not parented by xsl:choose!"},
-
- { ER_MISPLACED_XSLOTHERWISE,
- "(StylesheetHandler) misplaced xsl:otherwise!"},
-
- { ER_XSLOTHERWISE_NOT_PARENTED_BY_XSLCHOOSE,
- "(StylesheetHandler) xsl:otherwise not parented by xsl:choose!"},
-
- { ER_NOT_ALLOWED_INSIDE_TEMPLATE,
- "(StylesheetHandler) {0} is not allowed inside a template!"},
-
- { ER_UNKNOWN_EXT_NS_PREFIX,
- "(StylesheetHandler) {0} extension namespace prefix {1} unknown"},
-
- { ER_IMPORTS_AS_FIRST_ELEM,
- "(StylesheetHandler) Imports can only occur as the first elements in the stylesheet!"},
-
- { ER_IMPORTING_ITSELF,
- "(StylesheetHandler) {0} is directly or indirectly importing itself!"},
-
- { ER_XMLSPACE_ILLEGAL_VAL,
- "(StylesheetHandler) " + "xml:space has an illegal value: {0}"},
-
- { ER_PROCESSSTYLESHEET_NOT_SUCCESSFUL,
- "processStylesheet not succesfull!"},
-
- { ER_SAX_EXCEPTION,
- "SAX Exception"},
-
-// add this message to fix bug 21478
- { ER_FUNCTION_NOT_SUPPORTED,
- "Function not supported!"},
-
- { ER_XSLT_ERROR,
- "XSLT Error"},
-
- { ER_CURRENCY_SIGN_ILLEGAL,
- "currency sign is not allowed in format pattern string"},
-
- { ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM,
- "Document function not supported in Stylesheet DOM!"},
-
- { ER_CANT_RESOLVE_PREFIX_OF_NON_PREFIX_RESOLVER,
- "Can't resolve prefix of non-Prefix resolver!"},
-
- { ER_REDIRECT_COULDNT_GET_FILENAME,
- "Redirect extension: Could not get filename - file or select attribute must return vald string."},
-
- { ER_CANNOT_BUILD_FORMATTERLISTENER_IN_REDIRECT,
- "Can not build FormatterListener in Redirect extension!"},
-
- { ER_INVALID_PREFIX_IN_EXCLUDERESULTPREFIX,
- "Prefix in exclude-result-prefixes is not valid: {0}"},
-
- { ER_MISSING_NS_URI,
- "Missing namespace URI for specified prefix"},
-
- { ER_MISSING_ARG_FOR_OPTION,
- "Missing argument for option: {0}"},
-
- { ER_INVALID_OPTION,
- "Invalid option: {0}"},
-
- { ER_MALFORMED_FORMAT_STRING,
- "Malformed format string: {0}"},
-
- { ER_STYLESHEET_REQUIRES_VERSION_ATTRIB,
- "xsl:stylesheet requires a 'version' attribute!"},
-
- { ER_ILLEGAL_ATTRIBUTE_VALUE,
- "Attribute: {0} has an illegal value: {1}"},
-
- { ER_CHOOSE_REQUIRES_WHEN,
- "xsl:choose requires an xsl:when"},
-
- { ER_NO_APPLY_IMPORT_IN_FOR_EACH,
- "xsl:apply-imports not allowed in a xsl:for-each"},
-
- { ER_CANT_USE_DTM_FOR_OUTPUT,
- "Cannot use a DTMLiaison for an output DOM node... pass a com.sun.org.apache.xpath.internal.DOM2Helper instead!"},
-
- { ER_CANT_USE_DTM_FOR_INPUT,
- "Cannot use a DTMLiaison for a input DOM node... pass a com.sun.org.apache.xpath.internal.DOM2Helper instead!"},
-
- { ER_CALL_TO_EXT_FAILED,
- "Call to extension element failed: {0}"},
-
- { ER_PREFIX_MUST_RESOLVE,
- "Prefix must resolve to a namespace: {0}"},
-
- { ER_INVALID_UTF16_SURROGATE,
- "Invalid UTF-16 surrogate detected: {0} ?"},
-
- { ER_XSLATTRSET_USED_ITSELF,
- "xsl:attribute-set {0} used itself, which will cause an infinite loop."},
-
- { ER_CANNOT_MIX_XERCESDOM,
- "Can not mix non Xerces-DOM input with Xerces-DOM output!"},
-
- { ER_TOO_MANY_LISTENERS,
- "addTraceListenersToStylesheet - TooManyListenersException"},
-
- { ER_IN_ELEMTEMPLATEELEM_READOBJECT,
- "In ElemTemplateElement.readObject: {0}"},
-
- { ER_DUPLICATE_NAMED_TEMPLATE,
- "Found more than one template named: {0}"},
-
- { ER_INVALID_KEY_CALL,
- "Invalid function call: recursive key() calls are not allowed"},
-
- { ER_REFERENCING_ITSELF,
- "Variable {0} is directly or indirectly referencing itself!"},
-
- { ER_ILLEGAL_DOMSOURCE_INPUT,
- "The input node can not be null for a DOMSource for newTemplates!"},
-
- { ER_CLASS_NOT_FOUND_FOR_OPTION,
- "Class file not found for option {0}"},
-
- { ER_REQUIRED_ELEM_NOT_FOUND,
- "Required Element not found: {0}"},
-
- { ER_INPUT_CANNOT_BE_NULL,
- "InputStream cannot be null"},
-
- { ER_URI_CANNOT_BE_NULL,
- "URI cannot be null"},
-
- { ER_FILE_CANNOT_BE_NULL,
- "File cannot be null"},
-
- { ER_SOURCE_CANNOT_BE_NULL,
- "InputSource cannot be null"},
-
- { ER_CANNOT_INIT_BSFMGR,
- "Could not initialize BSF Manager"},
-
- { ER_CANNOT_CMPL_EXTENSN,
- "Could not compile extension"},
-
- { ER_CANNOT_CREATE_EXTENSN,
- "Could not create extension: {0} because of: {1}"},
-
- { ER_INSTANCE_MTHD_CALL_REQUIRES,
- "Instance method call to method {0} requires an Object instance as first argument"},
-
- { ER_INVALID_ELEMENT_NAME,
- "Invalid element name specified {0}"},
-
- { ER_ELEMENT_NAME_METHOD_STATIC,
- "Element name method must be static {0}"},
-
- { ER_EXTENSION_FUNC_UNKNOWN,
- "Extension function {0} : {1} is unknown"},
-
- { ER_MORE_MATCH_CONSTRUCTOR,
- "More than one best match for constructor for {0}"},
-
- { ER_MORE_MATCH_METHOD,
- "More than one best match for method {0}"},
-
- { ER_MORE_MATCH_ELEMENT,
- "More than one best match for element method {0}"},
-
- { ER_INVALID_CONTEXT_PASSED,
- "Invalid context passed to evaluate {0}"},
-
- { ER_POOL_EXISTS,
- "Pool already exists"},
-
- { ER_NO_DRIVER_NAME,
- "No driver Name specified"},
-
- { ER_NO_URL,
- "No URL specified"},
-
- { ER_POOL_SIZE_LESSTHAN_ONE,
- "Pool size is less than one!"},
-
- { ER_INVALID_DRIVER,
- "Invalid driver name specified!"},
-
- { ER_NO_STYLESHEETROOT,
- "Did not find the stylesheet root!"},
-
- { ER_ILLEGAL_XMLSPACE_VALUE,
- "Illegal value for xml:space"},
-
- { ER_PROCESSFROMNODE_FAILED,
- "processFromNode failed"},
-
- { ER_RESOURCE_COULD_NOT_LOAD,
- "The resource [ {0} ] could not load: {1} \n {2} \t {3}"},
-
- { ER_BUFFER_SIZE_LESSTHAN_ZERO,
- "Buffer size <=0"},
-
- { ER_UNKNOWN_ERROR_CALLING_EXTENSION,
- "Unknown error when calling extension"},
-
- { ER_NO_NAMESPACE_DECL,
- "Prefix {0} does not have a corresponding namespace declaration"},
-
- { ER_ELEM_CONTENT_NOT_ALLOWED,
- "Element content not allowed for lang=javaclass {0}"},
-
- { ER_STYLESHEET_DIRECTED_TERMINATION,
- "Stylesheet directed termination"},
-
- { ER_ONE_OR_TWO,
- "1 or 2"},
-
- { ER_TWO_OR_THREE,
- "2 or 3"},
-
- { ER_COULD_NOT_LOAD_RESOURCE,
- "Could not load {0} (check CLASSPATH), now using just the defaults"},
-
- { ER_CANNOT_INIT_DEFAULT_TEMPLATES,
- "Cannot initialize default templates"},
-
- { ER_RESULT_NULL,
- "Result should not be null"},
-
- { ER_RESULT_COULD_NOT_BE_SET,
- "Result could not be set"},
-
- { ER_NO_OUTPUT_SPECIFIED,
- "No output specified"},
-
- { ER_CANNOT_TRANSFORM_TO_RESULT_TYPE,
- "Can''t transform to a Result of type {0}"},
-
- { ER_CANNOT_TRANSFORM_SOURCE_TYPE,
- "Can''t transform a Source of type {0}"},
-
- { ER_NULL_CONTENT_HANDLER,
- "Null content handler"},
-
- { ER_NULL_ERROR_HANDLER,
- "Null error handler"},
-
- { ER_CANNOT_CALL_PARSE,
- "parse can not be called if the ContentHandler has not been set"},
-
- { ER_NO_PARENT_FOR_FILTER,
- "No parent for filter"},
-
- { ER_NO_STYLESHEET_IN_MEDIA,
- "No stylesheet found in: {0}, media= {1}"},
-
- { ER_NO_STYLESHEET_PI,
- "No xml-stylesheet PI found in: {0}"},
-
- { ER_NOT_SUPPORTED,
- "Not supported: {0}"},
-
- { ER_PROPERTY_VALUE_BOOLEAN,
- "Value for property {0} should be a Boolean instance"},
-
- { ER_COULD_NOT_FIND_EXTERN_SCRIPT,
- "Could not get to external script at {0}"},
-
- { ER_RESOURCE_COULD_NOT_FIND,
- "The resource [ {0} ] could not be found.\n {1}"},
-
- { ER_OUTPUT_PROPERTY_NOT_RECOGNIZED,
- "Output property not recognized: {0}"},
-
- { ER_FAILED_CREATING_ELEMLITRSLT,
- "Failed creating ElemLiteralResult instance"},
-
- //Earlier (JDK 1.4 XALAN 2.2-D11) at key code '204' the key name was ER_PRIORITY_NOT_PARSABLE
- // In latest Xalan code base key name is ER_VALUE_SHOULD_BE_NUMBER. This should also be taken care
- //in locale specific files like XSLTErrorResources_de.java, XSLTErrorResources_fr.java etc.
- //NOTE: Not only the key name but message has also been changed.
- { ER_VALUE_SHOULD_BE_NUMBER,
- "Value for {0} should contain a parsable number"},
-
- { ER_VALUE_SHOULD_EQUAL,
- "Value for {0} should equal yes or no"},
-
- { ER_FAILED_CALLING_METHOD,
- "Failed calling {0} method"},
-
- { ER_FAILED_CREATING_ELEMTMPL,
- "Failed creating ElemTemplateElement instance"},
-
- { ER_CHARS_NOT_ALLOWED,
- "Characters are not allowed at this point in the document"},
-
- { ER_ATTR_NOT_ALLOWED,
- "\"{0}\" attribute is not allowed on the {1} element!"},
-
- { ER_BAD_VALUE,
- "{0} bad value {1} "},
-
- { ER_ATTRIB_VALUE_NOT_FOUND,
- "{0} attribute value not found "},
-
- { ER_ATTRIB_VALUE_NOT_RECOGNIZED,
- "{0} attribute value not recognized "},
-
- { ER_NULL_URI_NAMESPACE,
- "Attempting to generate a namespace prefix with a null URI"},
-
- { ER_NUMBER_TOO_BIG,
- "Attempting to format a number bigger than the largest Long integer"},
-
- { ER_CANNOT_FIND_SAX1_DRIVER,
- "Cannot find SAX1 driver class {0}"},
-
- { ER_SAX1_DRIVER_NOT_LOADED,
- "SAX1 driver class {0} found but cannot be loaded"},
-
- { ER_SAX1_DRIVER_NOT_INSTANTIATED,
- "SAX1 driver class {0} loaded but cannot be instantiated"},
-
- { ER_SAX1_DRIVER_NOT_IMPLEMENT_PARSER,
- "SAX1 driver class {0} does not implement org.xml.sax.Parser"},
-
- { ER_PARSER_PROPERTY_NOT_SPECIFIED,
- "System property org.xml.sax.parser not specified"},
-
- { ER_PARSER_ARG_CANNOT_BE_NULL,
- "Parser argument must not be null"},
-
- { ER_FEATURE,
- "Feature: {0}"},
-
- { ER_PROPERTY,
- "Property: {0}"},
-
- { ER_NULL_ENTITY_RESOLVER,
- "Null entity resolver"},
-
- { ER_NULL_DTD_HANDLER,
- "Null DTD handler"},
-
- { ER_NO_DRIVER_NAME_SPECIFIED,
- "No Driver Name Specified!"},
-
- { ER_NO_URL_SPECIFIED,
- "No URL Specified!"},
-
- { ER_POOLSIZE_LESS_THAN_ONE,
- "Pool size is less than 1!"},
-
- { ER_INVALID_DRIVER_NAME,
- "Invalid Driver Name Specified!"},
-
- { ER_ERRORLISTENER,
- "ErrorListener"},
-
-
-// Note to translators: The following message should not normally be displayed
-// to users. It describes a situation in which the processor has detected
-// an internal consistency problem in itself, and it provides this message
-// for the developer to help diagnose the problem. The name
-// 'ElemTemplateElement' is the name of a class, and should not be
-// translated.
- { ER_ASSERT_NO_TEMPLATE_PARENT,
- "Programmer's error! The expression has no ElemTemplateElement parent!"},
-
-
-// Note to translators: The following message should not normally be displayed
-// to users. It describes a situation in which the processor has detected
-// an internal consistency problem in itself, and it provides this message
-// for the developer to help diagnose the problem. The substitution text
-// provides further information in order to diagnose the problem. The name
-// 'RedundentExprEliminator' is the name of a class, and should not be
-// translated.
- { ER_ASSERT_REDUNDENT_EXPR_ELIMINATOR,
- "Programmer''s assertion in RedundentExprEliminator: {0}"},
-
- { ER_NOT_ALLOWED_IN_POSITION,
- "{0} is not allowed in this position in the stylesheet!"},
-
- { ER_NONWHITESPACE_NOT_ALLOWED_IN_POSITION,
- "Non-whitespace text is not allowed in this position in the stylesheet!"},
-
- // This code is shared with warning codes.
- // SystemId Unknown
- { INVALID_TCHAR,
- "Illegal value: {1} used for CHAR attribute: {0}. An attribute of type CHAR must be only 1 character!"},
-
- // Note to translators: The following message is used if the value of
- // an attribute in a stylesheet is invalid. "QNAME" is the XML data-type of
- // the attribute, and should not be translated. The substitution text {1} is
- // the attribute value and {0} is the attribute name.
- //The following codes are shared with the warning codes...
- { INVALID_QNAME,
- "Illegal value: {1} used for QNAME attribute: {0}"},
-
- // Note to translators: The following message is used if the value of
- // an attribute in a stylesheet is invalid. "ENUM" is the XML data-type of
- // the attribute, and should not be translated. The substitution text {1} is
- // the attribute value, {0} is the attribute name, and {2} is a list of valid
- // values.
- { INVALID_ENUM,
- "Illegal value: {1} used for ENUM attribute: {0}. Valid values are: {2}."},
-
-// Note to translators: The following message is used if the value of
-// an attribute in a stylesheet is invalid. "NMTOKEN" is the XML data-type
-// of the attribute, and should not be translated. The substitution text {1} is
-// the attribute value and {0} is the attribute name.
- { INVALID_NMTOKEN,
- "Illegal value: {1} used for NMTOKEN attribute: {0} "},
-
-// Note to translators: The following message is used if the value of
-// an attribute in a stylesheet is invalid. "NCNAME" is the XML data-type
-// of the attribute, and should not be translated. The substitution text {1} is
-// the attribute value and {0} is the attribute name.
- { INVALID_NCNAME,
- "Illegal value: {1} used for NCNAME attribute: {0} "},
-
-// Note to translators: The following message is used if the value of
-// an attribute in a stylesheet is invalid. "boolean" is the XSLT data-type
-// of the attribute, and should not be translated. The substitution text {1} is
-// the attribute value and {0} is the attribute name.
- { INVALID_BOOLEAN,
- "Illegal value: {1} used for boolean attribute: {0} "},
-
-// Note to translators: The following message is used if the value of
-// an attribute in a stylesheet is invalid. "number" is the XSLT data-type
-// of the attribute, and should not be translated. The substitution text {1} is
-// the attribute value and {0} is the attribute name.
- { INVALID_NUMBER,
- "Illegal value: {1} used for number attribute: {0} "},
-
-
- // End of shared codes...
-
-// Note to translators: A "match pattern" is a special form of XPath expression
-// that is used for matching patterns. The substitution text is the name of
-// a function. The message indicates that when this function is referenced in
-// a match pattern, its argument must be a string literal (or constant.)
-// ER_ARG_LITERAL - new error message for bugzilla //5202
- { ER_ARG_LITERAL,
- "Argument to {0} in match pattern must be a literal."},
-
-// Note to translators: The following message indicates that two definitions of
-// a variable. A "global variable" is a variable that is accessible everywher
-// in the stylesheet.
-// ER_DUPLICATE_GLOBAL_VAR - new error message for bugzilla #790
- { ER_DUPLICATE_GLOBAL_VAR,
- "Duplicate global variable declaration."},
-
-
-// Note to translators: The following message indicates that two definitions of
-// a variable were encountered.
-// ER_DUPLICATE_VAR - new error message for bugzilla #790
- { ER_DUPLICATE_VAR,
- "Duplicate variable declaration."},
-
- // Note to translators: "xsl:template, "name" and "match" are XSLT keywords
- // which must not be translated.
- // ER_TEMPLATE_NAME_MATCH - new error message for bugzilla #789
- { ER_TEMPLATE_NAME_MATCH,
- "xsl:template must have a name or match attribute (or both)"},
-
- // Note to translators: "exclude-result-prefixes" is an XSLT keyword which
- // should not be translated. The message indicates that a namespace prefix
- // encountered as part of the value of the exclude-result-prefixes attribute
- // was in error.
- // ER_INVALID_PREFIX - new error message for bugzilla #788
- { ER_INVALID_PREFIX,
- "Prefix in exclude-result-prefixes is not valid: {0}"},
-
- // Note to translators: An "attribute set" is a set of attributes that can
- // be added to an element in the output document as a group. The message
- // indicates that there was a reference to an attribute set named {0} that
- // was never defined.
- // ER_NO_ATTRIB_SET - new error message for bugzilla #782
- { ER_NO_ATTRIB_SET,
- "attribute-set named {0} does not exist"},
-
- // Note to translators: This message indicates that there was a reference
- // to a function named {0} for which no function definition could be found.
- { ER_FUNCTION_NOT_FOUND,
- "The function named {0} does not exist"},
-
- // Note to translators: This message indicates that the XSLT instruction
- // that is named by the substitution text {0} must not contain other XSLT
- // instructions (content) or a "select" attribute. The word "select" is
- // an XSLT keyword in this case and must not be translated.
- { ER_CANT_HAVE_CONTENT_AND_SELECT,
- "The {0} element must not have both content and a select attribute."},
-
- // Note to translators: This message indicates that the value argument
- // of setParameter must be a valid Java Object.
- { ER_INVALID_SET_PARAM_VALUE,
- "The value of param {0} must be a valid Java Object"},
-
- { ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX_FOR_DEFAULT,
- "The result-prefix attribute of an xsl:namespace-alias element has the value '#default', but there is no declaration of the default namespace in scope for the element"},
-
- { ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX,
- "The result-prefix attribute of an xsl:namespace-alias element has the value ''{0}'', but there is no namespace declaration for the prefix ''{0}'' in scope for the element."},
-
- { ER_SET_FEATURE_NULL_NAME,
- "The feature name cannot be null in TransformerFactory.setFeature(String name, boolean value)."},
-
- { ER_GET_FEATURE_NULL_NAME,
- "The feature name cannot be null in TransformerFactory.getFeature(String name)."},
-
- { ER_UNSUPPORTED_FEATURE,
- "Cannot set the feature ''{0}'' on this TransformerFactory."},
-
- { ER_EXTENSION_ELEMENT_NOT_ALLOWED_IN_SECURE_PROCESSING,
- "Use of the extension element ''{0}'' is not allowed when the secure processing feature is set to true."},
-
- { ER_NAMESPACE_CONTEXT_NULL_NAMESPACE,
- "Cannot get the prefix for a null namespace uri."},
-
- { ER_NAMESPACE_CONTEXT_NULL_PREFIX,
- "Cannot get the namespace uri for null prefix."},
-
- { ER_XPATH_RESOLVER_NULL_QNAME,
- "The function name cannot be null."},
-
- { ER_XPATH_RESOLVER_NEGATIVE_ARITY,
- "The arity cannot be negative."},
- // Warnings...
-
- { WG_FOUND_CURLYBRACE,
- "Found '}' but no attribute template open!"},
-
- { WG_COUNT_ATTRIB_MATCHES_NO_ANCESTOR,
- "Warning: count attribute does not match an ancestor in xsl:number! Target = {0}"},
-
- { WG_EXPR_ATTRIB_CHANGED_TO_SELECT,
- "Old syntax: The name of the 'expr' attribute has been changed to 'select'."},
-
- { WG_NO_LOCALE_IN_FORMATNUMBER,
- "Xalan doesn't yet handle the locale name in the format-number function."},
-
- { WG_LOCALE_NOT_FOUND,
- "Warning: Could not find locale for xml:lang={0}"},
-
- { WG_CANNOT_MAKE_URL_FROM,
- "Can not make URL from: {0}"},
-
- { WG_CANNOT_LOAD_REQUESTED_DOC,
- "Can not load requested doc: {0}"},
-
- { WG_CANNOT_FIND_COLLATOR,
- "Could not find Collator for <sort xml:lang={0}"},
-
- { WG_FUNCTIONS_SHOULD_USE_URL,
- "Old syntax: the functions instruction should use a url of {0}"},
-
- { WG_ENCODING_NOT_SUPPORTED_USING_UTF8,
- "encoding not supported: {0}, using UTF-8"},
-
- { WG_ENCODING_NOT_SUPPORTED_USING_JAVA,
- "encoding not supported: {0}, using Java {1}"},
-
- { WG_SPECIFICITY_CONFLICTS,
- "Specificity conflicts found: {0} Last found in stylesheet will be used."},
-
- { WG_PARSING_AND_PREPARING,
- "========= Parsing and preparing {0} =========="},
-
- { WG_ATTR_TEMPLATE,
- "Attr Template, {0}"},
-
- { WG_CONFLICT_BETWEEN_XSLSTRIPSPACE_AND_XSLPRESERVESPACE,
- "Match conflict between xsl:strip-space and xsl:preserve-space"},
-
- { WG_ATTRIB_NOT_HANDLED,
- "Xalan does not yet handle the {0} attribute!"},
-
- { WG_NO_DECIMALFORMAT_DECLARATION,
- "No declaration found for decimal format: {0}"},
-
- { WG_OLD_XSLT_NS,
- "Missing or incorrect XSLT Namespace. "},
-
- { WG_ONE_DEFAULT_XSLDECIMALFORMAT_ALLOWED,
- "Only one default xsl:decimal-format declaration is allowed."},
-
- { WG_XSLDECIMALFORMAT_NAMES_MUST_BE_UNIQUE,
- "xsl:decimal-format names must be unique. Name \"{0}\" has been duplicated."},
-
- { WG_ILLEGAL_ATTRIBUTE,
- "{0} has an illegal attribute: {1}"},
-
- { WG_COULD_NOT_RESOLVE_PREFIX,
- "Could not resolve namespace prefix: {0}. The node will be ignored."},
-
- { WG_STYLESHEET_REQUIRES_VERSION_ATTRIB,
- "xsl:stylesheet requires a 'version' attribute!"},
-
- { WG_ILLEGAL_ATTRIBUTE_NAME,
- "Illegal attribute name: {0}"},
-
- { WG_ILLEGAL_ATTRIBUTE_VALUE,
- "Illegal value used for attribute {0}: {1}"},
-
- { WG_EMPTY_SECOND_ARG,
- "Resulting nodeset from second argument of document function is empty. Return an empty node-set."},
-
- //Following are the new WARNING keys added in XALAN code base after Jdk 1.4 (Xalan 2.2-D11)
-
- // Note to translators: "name" and "xsl:processing-instruction" are keywords
- // and must not be translated.
- { WG_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML,
- "The value of the 'name' attribute of xsl:processing-instruction name must not be 'xml'"},
-
- // Note to translators: "name" and "xsl:processing-instruction" are keywords
- // and must not be translated. "NCName" is an XML data-type and must not be
- // translated.
- { WG_PROCESSINGINSTRUCTION_NOTVALID_NCNAME,
- "The value of the ''name'' attribute of xsl:processing-instruction must be a valid NCName: {0}"},
-
- // Note to translators: This message is reported if the stylesheet that is
- // being processed attempted to construct an XML document with an attribute in a
- // place other than on an element. The substitution text specifies the name of
- // the attribute.
- { WG_ILLEGAL_ATTRIBUTE_POSITION,
- "Cannot add attribute {0} after child nodes or before an element is produced. Attribute will be ignored."},
-
- { NO_MODIFICATION_ALLOWED_ERR,
- "An attempt is made to modify an object where modifications are not allowed."
- },
-
- //Check: WHY THERE IS A GAP B/W NUMBERS in the XSLTErrorResources properties file?
-
- // Other miscellaneous text used inside the code...
- { "ui_language", "en"},
- { "help_language", "en" },
- { "language", "en" },
- { "BAD_CODE", "Parameter to createMessage was out of bounds"},
- { "FORMAT_FAILED", "Exception thrown during messageFormat call"},
- { "version", ">>>>>>> Xalan Version "},
- { "version2", "<<<<<<<"},
- { "yes", "yes"},
- { "line", "Line #"},
- { "column","Column #"},
- { "xsldone", "XSLProcessor: done"},
-
-
- // Note to translators: The following messages provide usage information
- // for the Xalan Process command line. "Process" is the name of a Java class,
- // and should not be translated.
- { "xslProc_option", "Xalan-J command line Process class options:"},
- { "xslProc_option", "Xalan-J command line Process class options\u003a"},
- { "xslProc_invalid_xsltc_option", "The option {0} is not supported in XSLTC mode."},
- { "xslProc_invalid_xalan_option", "The option {0} can only be used with -XSLTC."},
- { "xslProc_no_input", "Error: No stylesheet or input xml is specified. Run this command without any option for usage instructions."},
- { "xslProc_common_options", "-Common Options-"},
- { "xslProc_xalan_options", "-Options for Xalan-"},
- { "xslProc_xsltc_options", "-Options for XSLTC-"},
- { "xslProc_return_to_continue", "(press <return> to continue)"},
-
- // Note to translators: The option name and the parameter name do not need to
- // be translated. Only translate the messages in parentheses. Note also that
- // leading whitespace in the messages is used to indent the usage information
- // for each option in the English messages.
- // Do not translate the keywords: XSLTC, SAX, DOM and DTM.
- { "optionXSLTC", " [-XSLTC (use XSLTC for transformation)]"},
- { "optionIN", " [-IN inputXMLURL]"},
- { "optionXSL", " [-XSL XSLTransformationURL]"},
- { "optionOUT", " [-OUT outputFileName]"},
- { "optionLXCIN", " [-LXCIN compiledStylesheetFileNameIn]"},
- { "optionLXCOUT", " [-LXCOUT compiledStylesheetFileNameOutOut]"},
- { "optionPARSER", " [-PARSER fully qualified class name of parser liaison]"},
- { "optionE", " [-E (Do not expand entity refs)]"},
- { "optionV", " [-E (Do not expand entity refs)]"},
- { "optionQC", " [-QC (Quiet Pattern Conflicts Warnings)]"},
- { "optionQ", " [-Q (Quiet Mode)]"},
- { "optionLF", " [-LF (Use linefeeds only on output {default is CR/LF})]"},
- { "optionCR", " [-CR (Use carriage returns only on output {default is CR/LF})]"},
- { "optionESCAPE", " [-ESCAPE (Which characters to escape {default is <>&\"\'\\r\\n}]"},
- { "optionINDENT", " [-INDENT (Control how many spaces to indent {default is 0})]"},
- { "optionTT", " [-TT (Trace the templates as they are being called.)]"},
- { "optionTG", " [-TG (Trace each generation event.)]"},
- { "optionTS", " [-TS (Trace each selection event.)]"},
- { "optionTTC", " [-TTC (Trace the template children as they are being processed.)]"},
- { "optionTCLASS", " [-TCLASS (TraceListener class for trace extensions.)]"},
- { "optionVALIDATE", " [-VALIDATE (Set whether validation occurs. Validation is off by default.)]"},
- { "optionEDUMP", " [-EDUMP {optional filename} (Do stackdump on error.)]"},
- { "optionXML", " [-XML (Use XML formatter and add XML header.)]"},
- { "optionTEXT", " [-TEXT (Use simple Text formatter.)]"},
- { "optionHTML", " [-HTML (Use HTML formatter.)]"},
- { "optionPARAM", " [-PARAM name expression (Set a stylesheet parameter)]"},
- { "noParsermsg1", "XSL Process was not successful."},
- { "noParsermsg2", "** Could not find parser **"},
- { "noParsermsg3", "Please check your classpath."},
- { "noParsermsg4", "If you don't have IBM's XML Parser for Java, you can download it from"},
- { "noParsermsg5", "IBM's AlphaWorks: http://www.alphaworks.ibm.com/formula/xml"},
- { "optionURIRESOLVER", " [-URIRESOLVER full class name (URIResolver to be used to resolve URIs)]"},
- { "optionENTITYRESOLVER", " [-ENTITYRESOLVER full class name (EntityResolver to be used to resolve entities)]"},
- { "optionCONTENTHANDLER", " [-CONTENTHANDLER full class name (ContentHandler to be used to serialize output)]"},
- { "optionLINENUMBERS", " [-L use line numbers for source document]"},
- { "optionSECUREPROCESSING", " [-SECURE (set the secure processing feature to true.)]"},
-
- // Following are the new options added in XSLTErrorResources.properties files after Jdk 1.4 (Xalan 2.2-D11)
-
-
- { "optionMEDIA", " [-MEDIA mediaType (use media attribute to find stylesheet associated with a document.)]"},
- { "optionFLAVOR", " [-FLAVOR flavorName (Explicitly use s2s=SAX or d2d=DOM to do transform.)] "}, // Added by sboag/scurcuru; experimental
- { "optionDIAG", " [-DIAG (Print overall milliseconds transform took.)]"},
- { "optionINCREMENTAL", " [-INCREMENTAL (request incremental DTM construction by setting http://xml.apache.org/xalan/features/incremental true.)]"},
- { "optionNOOPTIMIMIZE", " [-NOOPTIMIMIZE (request no stylesheet optimization processing by setting http://xml.apache.org/xalan/features/optimize false.)]"},
- { "optionRL", " [-RL recursionlimit (assert numeric limit on stylesheet recursion depth.)]"},
- { "optionXO", " [-XO [transletName] (assign the name to the generated translet)]"},
- { "optionXD", " [-XD destinationDirectory (specify a destination directory for translet)]"},
- { "optionXJ", " [-XJ jarfile (packages translet classes into a jar file of name <jarfile>)]"},
- { "optionXP", " [-XP package (specifies a package name prefix for all generated translet classes)]"},
-
- //AddITIONAL STRINGS that need L10n
- // Note to translators: The following message describes usage of a particular
- // command-line option that is used to enable the "template inlining"
- // optimization. The optimization involves making a copy of the code
- // generated for a template in another template that refers to it.
- { "optionXN", " [-XN (enables template inlining)]" },
- { "optionXX", " [-XX (turns on additional debugging message output)]"},
- { "optionXT" , " [-XT (use translet to transform if possible)]"},
- { "diagTiming"," --------- Transform of {0} via {1} took {2} ms" },
- { "recursionTooDeep","Template nesting too deep. nesting = {0}, template {1} {2}" },
- { "nameIs", "name is" },
- { "matchPatternIs", "match pattern is" }
-
- };
-
- }
- // ================= INFRASTRUCTURE ======================
-
- /** String for use when a bad error code was encountered. */
- public static final String BAD_CODE = "BAD_CODE";
-
- /** String for use when formatting of the error string failed. */
- public static final String FORMAT_FAILED = "FORMAT_FAILED";
-
- /** General error string. */
- public static final String ERROR_STRING = "#error";
-
- /** String to prepend to error messages. */
- public static final String ERROR_HEADER = "Error: ";
-
- /** String to prepend to warning messages. */
- public static final String WARNING_HEADER = "Warning: ";
-
- /** String to specify the XSLT module. */
- public static final String XSL_HEADER = "XSLT ";
-
- /** String to specify the XML parser module. */
- public static final String XML_HEADER = "XML ";
-
- /** I don't think this is used any more.
- * @deprecated */
- public static final String QUERY_HEADER = "PATTERN ";
-
-
- }
diff --git a/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_de.java b/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_de.java
deleted file mode 100644
index d1a408f..0000000
--- a/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_de.java
+++ /dev/null
@@ -1,1447 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xalan.internal.res;
-
-import java.util.ListResourceBundle;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * Set up error messages.
- * We build a two dimensional array of message keys and
- * message strings. In order to add a new message here,
- * you need to first add a String constant. And
- * you need to enter key , value pair as part of contents
- * Array. You also need to update MAX_CODE for error strings
- * and MAX_WARNING for warnings ( Needed for only information
- * purpose )
- */
-public class XSLTErrorResources_de extends ListResourceBundle
-{
-
-/*
- * This file contains error and warning messages related to Xalan Error
- * Handling.
- *
- * General notes to translators:
- *
- * 1) Xalan (or more properly, Xalan-interpretive) and XSLTC are names of
- * components.
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- * XSLTC is an acronym for XSLT Compiler.
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 5) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 6) "Translet" is an invented term that describes the class file that
- * results from compiling an XML stylesheet into a Java class.
- *
- * 7) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- */
-
- /*
- * Static variables
- */
- public static final String ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX =
- "ER_INVALID_SET_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX";
-
- public static final String ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX_FOR_DEFAULT =
- "ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX_FOR_DEFAULT";
-
- public static final String ER_NO_CURLYBRACE = "ER_NO_CURLYBRACE";
- public static final String ER_FUNCTION_NOT_SUPPORTED = "ER_FUNCTION_NOT_SUPPORTED";
- public static final String ER_ILLEGAL_ATTRIBUTE = "ER_ILLEGAL_ATTRIBUTE";
- public static final String ER_NULL_SOURCENODE_APPLYIMPORTS = "ER_NULL_SOURCENODE_APPLYIMPORTS";
- public static final String ER_CANNOT_ADD = "ER_CANNOT_ADD";
- public static final String ER_NULL_SOURCENODE_HANDLEAPPLYTEMPLATES="ER_NULL_SOURCENODE_HANDLEAPPLYTEMPLATES";
- public static final String ER_NO_NAME_ATTRIB = "ER_NO_NAME_ATTRIB";
- public static final String ER_TEMPLATE_NOT_FOUND = "ER_TEMPLATE_NOT_FOUND";
- public static final String ER_CANT_RESOLVE_NAME_AVT = "ER_CANT_RESOLVE_NAME_AVT";
- public static final String ER_REQUIRES_ATTRIB = "ER_REQUIRES_ATTRIB";
- public static final String ER_MUST_HAVE_TEST_ATTRIB = "ER_MUST_HAVE_TEST_ATTRIB";
- public static final String ER_BAD_VAL_ON_LEVEL_ATTRIB =
- "ER_BAD_VAL_ON_LEVEL_ATTRIB";
- public static final String ER_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML =
- "ER_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML";
- public static final String ER_PROCESSINGINSTRUCTION_NOTVALID_NCNAME =
- "ER_PROCESSINGINSTRUCTION_NOTVALID_NCNAME";
- public static final String ER_NEED_MATCH_ATTRIB = "ER_NEED_MATCH_ATTRIB";
- public static final String ER_NEED_NAME_OR_MATCH_ATTRIB =
- "ER_NEED_NAME_OR_MATCH_ATTRIB";
- public static final String ER_CANT_RESOLVE_NSPREFIX =
- "ER_CANT_RESOLVE_NSPREFIX";
- public static final String ER_ILLEGAL_VALUE = "ER_ILLEGAL_VALUE";
- public static final String ER_NO_OWNERDOC = "ER_NO_OWNERDOC";
- public static final String ER_ELEMTEMPLATEELEM_ERR ="ER_ELEMTEMPLATEELEM_ERR";
- public static final String ER_NULL_CHILD = "ER_NULL_CHILD";
- public static final String ER_NEED_SELECT_ATTRIB = "ER_NEED_SELECT_ATTRIB";
- public static final String ER_NEED_TEST_ATTRIB = "ER_NEED_TEST_ATTRIB";
- public static final String ER_NEED_NAME_ATTRIB = "ER_NEED_NAME_ATTRIB";
- public static final String ER_NO_CONTEXT_OWNERDOC = "ER_NO_CONTEXT_OWNERDOC";
- public static final String ER_COULD_NOT_CREATE_XML_PROC_LIAISON =
- "ER_COULD_NOT_CREATE_XML_PROC_LIAISON";
- public static final String ER_PROCESS_NOT_SUCCESSFUL =
- "ER_PROCESS_NOT_SUCCESSFUL";
- public static final String ER_NOT_SUCCESSFUL = "ER_NOT_SUCCESSFUL";
- public static final String ER_ENCODING_NOT_SUPPORTED =
- "ER_ENCODING_NOT_SUPPORTED";
- public static final String ER_COULD_NOT_CREATE_TRACELISTENER =
- "ER_COULD_NOT_CREATE_TRACELISTENER";
- public static final String ER_KEY_REQUIRES_NAME_ATTRIB =
- "ER_KEY_REQUIRES_NAME_ATTRIB";
- public static final String ER_KEY_REQUIRES_MATCH_ATTRIB =
- "ER_KEY_REQUIRES_MATCH_ATTRIB";
- public static final String ER_KEY_REQUIRES_USE_ATTRIB =
- "ER_KEY_REQUIRES_USE_ATTRIB";
- public static final String ER_REQUIRES_ELEMENTS_ATTRIB =
- "ER_REQUIRES_ELEMENTS_ATTRIB";
- public static final String ER_MISSING_PREFIX_ATTRIB =
- "ER_MISSING_PREFIX_ATTRIB";
- public static final String ER_BAD_STYLESHEET_URL = "ER_BAD_STYLESHEET_URL";
- public static final String ER_FILE_NOT_FOUND = "ER_FILE_NOT_FOUND";
- public static final String ER_IOEXCEPTION = "ER_IOEXCEPTION";
- public static final String ER_NO_HREF_ATTRIB = "ER_NO_HREF_ATTRIB";
- public static final String ER_STYLESHEET_INCLUDES_ITSELF =
- "ER_STYLESHEET_INCLUDES_ITSELF";
- public static final String ER_PROCESSINCLUDE_ERROR ="ER_PROCESSINCLUDE_ERROR";
- public static final String ER_MISSING_LANG_ATTRIB = "ER_MISSING_LANG_ATTRIB";
- public static final String ER_MISSING_CONTAINER_ELEMENT_COMPONENT =
- "ER_MISSING_CONTAINER_ELEMENT_COMPONENT";
- public static final String ER_CAN_ONLY_OUTPUT_TO_ELEMENT =
- "ER_CAN_ONLY_OUTPUT_TO_ELEMENT";
- public static final String ER_PROCESS_ERROR = "ER_PROCESS_ERROR";
- public static final String ER_UNIMPLNODE_ERROR = "ER_UNIMPLNODE_ERROR";
- public static final String ER_NO_SELECT_EXPRESSION ="ER_NO_SELECT_EXPRESSION";
- public static final String ER_CANNOT_SERIALIZE_XSLPROCESSOR =
- "ER_CANNOT_SERIALIZE_XSLPROCESSOR";
- public static final String ER_NO_INPUT_STYLESHEET = "ER_NO_INPUT_STYLESHEET";
- public static final String ER_FAILED_PROCESS_STYLESHEET =
- "ER_FAILED_PROCESS_STYLESHEET";
- public static final String ER_COULDNT_PARSE_DOC = "ER_COULDNT_PARSE_DOC";
- public static final String ER_COULDNT_FIND_FRAGMENT =
- "ER_COULDNT_FIND_FRAGMENT";
- public static final String ER_NODE_NOT_ELEMENT = "ER_NODE_NOT_ELEMENT";
- public static final String ER_FOREACH_NEED_MATCH_OR_NAME_ATTRIB =
- "ER_FOREACH_NEED_MATCH_OR_NAME_ATTRIB";
- public static final String ER_TEMPLATES_NEED_MATCH_OR_NAME_ATTRIB =
- "ER_TEMPLATES_NEED_MATCH_OR_NAME_ATTRIB";
- public static final String ER_NO_CLONE_OF_DOCUMENT_FRAG =
- "ER_NO_CLONE_OF_DOCUMENT_FRAG";
- public static final String ER_CANT_CREATE_ITEM = "ER_CANT_CREATE_ITEM";
- public static final String ER_XMLSPACE_ILLEGAL_VALUE =
- "ER_XMLSPACE_ILLEGAL_VALUE";
- public static final String ER_NO_XSLKEY_DECLARATION =
- "ER_NO_XSLKEY_DECLARATION";
- public static final String ER_CANT_CREATE_URL = "ER_CANT_CREATE_URL";
- public static final String ER_XSLFUNCTIONS_UNSUPPORTED =
- "ER_XSLFUNCTIONS_UNSUPPORTED";
- public static final String ER_PROCESSOR_ERROR = "ER_PROCESSOR_ERROR";
- public static final String ER_NOT_ALLOWED_INSIDE_STYLESHEET =
- "ER_NOT_ALLOWED_INSIDE_STYLESHEET";
- public static final String ER_RESULTNS_NOT_SUPPORTED =
- "ER_RESULTNS_NOT_SUPPORTED";
- public static final String ER_DEFAULTSPACE_NOT_SUPPORTED =
- "ER_DEFAULTSPACE_NOT_SUPPORTED";
- public static final String ER_INDENTRESULT_NOT_SUPPORTED =
- "ER_INDENTRESULT_NOT_SUPPORTED";
- public static final String ER_ILLEGAL_ATTRIB = "ER_ILLEGAL_ATTRIB";
- public static final String ER_UNKNOWN_XSL_ELEM = "ER_UNKNOWN_XSL_ELEM";
- public static final String ER_BAD_XSLSORT_USE = "ER_BAD_XSLSORT_USE";
- public static final String ER_MISPLACED_XSLWHEN = "ER_MISPLACED_XSLWHEN";
- public static final String ER_XSLWHEN_NOT_PARENTED_BY_XSLCHOOSE =
- "ER_XSLWHEN_NOT_PARENTED_BY_XSLCHOOSE";
- public static final String ER_MISPLACED_XSLOTHERWISE =
- "ER_MISPLACED_XSLOTHERWISE";
- public static final String ER_XSLOTHERWISE_NOT_PARENTED_BY_XSLCHOOSE =
- "ER_XSLOTHERWISE_NOT_PARENTED_BY_XSLCHOOSE";
- public static final String ER_NOT_ALLOWED_INSIDE_TEMPLATE =
- "ER_NOT_ALLOWED_INSIDE_TEMPLATE";
- public static final String ER_UNKNOWN_EXT_NS_PREFIX =
- "ER_UNKNOWN_EXT_NS_PREFIX";
- public static final String ER_IMPORTS_AS_FIRST_ELEM =
- "ER_IMPORTS_AS_FIRST_ELEM";
- public static final String ER_IMPORTING_ITSELF = "ER_IMPORTING_ITSELF";
- public static final String ER_XMLSPACE_ILLEGAL_VAL ="ER_XMLSPACE_ILLEGAL_VAL";
- public static final String ER_PROCESSSTYLESHEET_NOT_SUCCESSFUL =
- "ER_PROCESSSTYLESHEET_NOT_SUCCESSFUL";
- public static final String ER_SAX_EXCEPTION = "ER_SAX_EXCEPTION";
- public static final String ER_XSLT_ERROR = "ER_XSLT_ERROR";
- public static final String ER_CURRENCY_SIGN_ILLEGAL=
- "ER_CURRENCY_SIGN_ILLEGAL";
- public static final String ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM =
- "ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM";
- public static final String ER_CANT_RESOLVE_PREFIX_OF_NON_PREFIX_RESOLVER =
- "ER_CANT_RESOLVE_PREFIX_OF_NON_PREFIX_RESOLVER";
- public static final String ER_REDIRECT_COULDNT_GET_FILENAME =
- "ER_REDIRECT_COULDNT_GET_FILENAME";
- public static final String ER_CANNOT_BUILD_FORMATTERLISTENER_IN_REDIRECT =
- "ER_CANNOT_BUILD_FORMATTERLISTENER_IN_REDIRECT";
- public static final String ER_INVALID_PREFIX_IN_EXCLUDERESULTPREFIX =
- "ER_INVALID_PREFIX_IN_EXCLUDERESULTPREFIX";
- public static final String ER_MISSING_NS_URI = "ER_MISSING_NS_URI";
- public static final String ER_MISSING_ARG_FOR_OPTION =
- "ER_MISSING_ARG_FOR_OPTION";
- public static final String ER_INVALID_OPTION = "ER_INVALID_OPTION";
- public static final String ER_MALFORMED_FORMAT_STRING =
- "ER_MALFORMED_FORMAT_STRING";
- public static final String ER_STYLESHEET_REQUIRES_VERSION_ATTRIB =
- "ER_STYLESHEET_REQUIRES_VERSION_ATTRIB";
- public static final String ER_ILLEGAL_ATTRIBUTE_VALUE =
- "ER_ILLEGAL_ATTRIBUTE_VALUE";
- public static final String ER_CHOOSE_REQUIRES_WHEN ="ER_CHOOSE_REQUIRES_WHEN";
- public static final String ER_NO_APPLY_IMPORT_IN_FOR_EACH =
- "ER_NO_APPLY_IMPORT_IN_FOR_EACH";
- public static final String ER_CANT_USE_DTM_FOR_OUTPUT =
- "ER_CANT_USE_DTM_FOR_OUTPUT";
- public static final String ER_CANT_USE_DTM_FOR_INPUT =
- "ER_CANT_USE_DTM_FOR_INPUT";
- public static final String ER_CALL_TO_EXT_FAILED = "ER_CALL_TO_EXT_FAILED";
- public static final String ER_PREFIX_MUST_RESOLVE = "ER_PREFIX_MUST_RESOLVE";
- public static final String ER_INVALID_UTF16_SURROGATE =
- "ER_INVALID_UTF16_SURROGATE";
- public static final String ER_XSLATTRSET_USED_ITSELF =
- "ER_XSLATTRSET_USED_ITSELF";
- public static final String ER_CANNOT_MIX_XERCESDOM ="ER_CANNOT_MIX_XERCESDOM";
- public static final String ER_TOO_MANY_LISTENERS = "ER_TOO_MANY_LISTENERS";
- public static final String ER_IN_ELEMTEMPLATEELEM_READOBJECT =
- "ER_IN_ELEMTEMPLATEELEM_READOBJECT";
- public static final String ER_DUPLICATE_NAMED_TEMPLATE =
- "ER_DUPLICATE_NAMED_TEMPLATE";
- public static final String ER_INVALID_KEY_CALL = "ER_INVALID_KEY_CALL";
- public static final String ER_REFERENCING_ITSELF = "ER_REFERENCING_ITSELF";
- public static final String ER_ILLEGAL_DOMSOURCE_INPUT =
- "ER_ILLEGAL_DOMSOURCE_INPUT";
- public static final String ER_CLASS_NOT_FOUND_FOR_OPTION =
- "ER_CLASS_NOT_FOUND_FOR_OPTION";
- public static final String ER_REQUIRED_ELEM_NOT_FOUND =
- "ER_REQUIRED_ELEM_NOT_FOUND";
- public static final String ER_INPUT_CANNOT_BE_NULL ="ER_INPUT_CANNOT_BE_NULL";
- public static final String ER_URI_CANNOT_BE_NULL = "ER_URI_CANNOT_BE_NULL";
- public static final String ER_FILE_CANNOT_BE_NULL = "ER_FILE_CANNOT_BE_NULL";
- public static final String ER_SOURCE_CANNOT_BE_NULL =
- "ER_SOURCE_CANNOT_BE_NULL";
- public static final String ER_CANNOT_INIT_BSFMGR = "ER_CANNOT_INIT_BSFMGR";
- public static final String ER_CANNOT_CMPL_EXTENSN = "ER_CANNOT_CMPL_EXTENSN";
- public static final String ER_CANNOT_CREATE_EXTENSN =
- "ER_CANNOT_CREATE_EXTENSN";
- public static final String ER_INSTANCE_MTHD_CALL_REQUIRES =
- "ER_INSTANCE_MTHD_CALL_REQUIRES";
- public static final String ER_INVALID_ELEMENT_NAME ="ER_INVALID_ELEMENT_NAME";
- public static final String ER_ELEMENT_NAME_METHOD_STATIC =
- "ER_ELEMENT_NAME_METHOD_STATIC";
- public static final String ER_EXTENSION_FUNC_UNKNOWN =
- "ER_EXTENSION_FUNC_UNKNOWN";
- public static final String ER_MORE_MATCH_CONSTRUCTOR =
- "ER_MORE_MATCH_CONSTRUCTOR";
- public static final String ER_MORE_MATCH_METHOD = "ER_MORE_MATCH_METHOD";
- public static final String ER_MORE_MATCH_ELEMENT = "ER_MORE_MATCH_ELEMENT";
- public static final String ER_INVALID_CONTEXT_PASSED =
- "ER_INVALID_CONTEXT_PASSED";
- public static final String ER_POOL_EXISTS = "ER_POOL_EXISTS";
- public static final String ER_NO_DRIVER_NAME = "ER_NO_DRIVER_NAME";
- public static final String ER_NO_URL = "ER_NO_URL";
- public static final String ER_POOL_SIZE_LESSTHAN_ONE =
- "ER_POOL_SIZE_LESSTHAN_ONE";
- public static final String ER_INVALID_DRIVER = "ER_INVALID_DRIVER";
- public static final String ER_NO_STYLESHEETROOT = "ER_NO_STYLESHEETROOT";
- public static final String ER_ILLEGAL_XMLSPACE_VALUE =
- "ER_ILLEGAL_XMLSPACE_VALUE";
- public static final String ER_PROCESSFROMNODE_FAILED =
- "ER_PROCESSFROMNODE_FAILED";
- public static final String ER_RESOURCE_COULD_NOT_LOAD =
- "ER_RESOURCE_COULD_NOT_LOAD";
- public static final String ER_BUFFER_SIZE_LESSTHAN_ZERO =
- "ER_BUFFER_SIZE_LESSTHAN_ZERO";
- public static final String ER_UNKNOWN_ERROR_CALLING_EXTENSION =
- "ER_UNKNOWN_ERROR_CALLING_EXTENSION";
- public static final String ER_NO_NAMESPACE_DECL = "ER_NO_NAMESPACE_DECL";
- public static final String ER_ELEM_CONTENT_NOT_ALLOWED =
- "ER_ELEM_CONTENT_NOT_ALLOWED";
- public static final String ER_STYLESHEET_DIRECTED_TERMINATION =
- "ER_STYLESHEET_DIRECTED_TERMINATION";
- public static final String ER_ONE_OR_TWO = "ER_ONE_OR_TWO";
- public static final String ER_TWO_OR_THREE = "ER_TWO_OR_THREE";
- public static final String ER_COULD_NOT_LOAD_RESOURCE =
- "ER_COULD_NOT_LOAD_RESOURCE";
- public static final String ER_CANNOT_INIT_DEFAULT_TEMPLATES =
- "ER_CANNOT_INIT_DEFAULT_TEMPLATES";
- public static final String ER_RESULT_NULL = "ER_RESULT_NULL";
- public static final String ER_RESULT_COULD_NOT_BE_SET =
- "ER_RESULT_COULD_NOT_BE_SET";
- public static final String ER_NO_OUTPUT_SPECIFIED = "ER_NO_OUTPUT_SPECIFIED";
- public static final String ER_CANNOT_TRANSFORM_TO_RESULT_TYPE =
- "ER_CANNOT_TRANSFORM_TO_RESULT_TYPE";
- public static final String ER_CANNOT_TRANSFORM_SOURCE_TYPE =
- "ER_CANNOT_TRANSFORM_SOURCE_TYPE";
- public static final String ER_NULL_CONTENT_HANDLER ="ER_NULL_CONTENT_HANDLER";
- public static final String ER_NULL_ERROR_HANDLER = "ER_NULL_ERROR_HANDLER";
- public static final String ER_CANNOT_CALL_PARSE = "ER_CANNOT_CALL_PARSE";
- public static final String ER_NO_PARENT_FOR_FILTER ="ER_NO_PARENT_FOR_FILTER";
- public static final String ER_NO_STYLESHEET_IN_MEDIA =
- "ER_NO_STYLESHEET_IN_MEDIA";
- public static final String ER_NO_STYLESHEET_PI = "ER_NO_STYLESHEET_PI";
- public static final String ER_NOT_SUPPORTED = "ER_NOT_SUPPORTED";
- public static final String ER_PROPERTY_VALUE_BOOLEAN =
- "ER_PROPERTY_VALUE_BOOLEAN";
- public static final String ER_COULD_NOT_FIND_EXTERN_SCRIPT =
- "ER_COULD_NOT_FIND_EXTERN_SCRIPT";
- public static final String ER_RESOURCE_COULD_NOT_FIND =
- "ER_RESOURCE_COULD_NOT_FIND";
- public static final String ER_OUTPUT_PROPERTY_NOT_RECOGNIZED =
- "ER_OUTPUT_PROPERTY_NOT_RECOGNIZED";
- public static final String ER_FAILED_CREATING_ELEMLITRSLT =
- "ER_FAILED_CREATING_ELEMLITRSLT";
- public static final String ER_VALUE_SHOULD_BE_NUMBER =
- "ER_VALUE_SHOULD_BE_NUMBER";
- public static final String ER_VALUE_SHOULD_EQUAL = "ER_VALUE_SHOULD_EQUAL";
- public static final String ER_FAILED_CALLING_METHOD =
- "ER_FAILED_CALLING_METHOD";
- public static final String ER_FAILED_CREATING_ELEMTMPL =
- "ER_FAILED_CREATING_ELEMTMPL";
- public static final String ER_CHARS_NOT_ALLOWED = "ER_CHARS_NOT_ALLOWED";
- public static final String ER_ATTR_NOT_ALLOWED = "ER_ATTR_NOT_ALLOWED";
- public static final String ER_BAD_VALUE = "ER_BAD_VALUE";
- public static final String ER_ATTRIB_VALUE_NOT_FOUND =
- "ER_ATTRIB_VALUE_NOT_FOUND";
- public static final String ER_ATTRIB_VALUE_NOT_RECOGNIZED =
- "ER_ATTRIB_VALUE_NOT_RECOGNIZED";
- public static final String ER_NULL_URI_NAMESPACE = "ER_NULL_URI_NAMESPACE";
- public static final String ER_NUMBER_TOO_BIG = "ER_NUMBER_TOO_BIG";
- public static final String ER_CANNOT_FIND_SAX1_DRIVER =
- "ER_CANNOT_FIND_SAX1_DRIVER";
- public static final String ER_SAX1_DRIVER_NOT_LOADED =
- "ER_SAX1_DRIVER_NOT_LOADED";
- public static final String ER_SAX1_DRIVER_NOT_INSTANTIATED =
- "ER_SAX1_DRIVER_NOT_INSTANTIATED" ;
- public static final String ER_SAX1_DRIVER_NOT_IMPLEMENT_PARSER =
- "ER_SAX1_DRIVER_NOT_IMPLEMENT_PARSER";
- public static final String ER_PARSER_PROPERTY_NOT_SPECIFIED =
- "ER_PARSER_PROPERTY_NOT_SPECIFIED";
- public static final String ER_PARSER_ARG_CANNOT_BE_NULL =
- "ER_PARSER_ARG_CANNOT_BE_NULL" ;
- public static final String ER_FEATURE = "ER_FEATURE";
- public static final String ER_PROPERTY = "ER_PROPERTY" ;
- public static final String ER_NULL_ENTITY_RESOLVER ="ER_NULL_ENTITY_RESOLVER";
- public static final String ER_NULL_DTD_HANDLER = "ER_NULL_DTD_HANDLER" ;
- public static final String ER_NO_DRIVER_NAME_SPECIFIED =
- "ER_NO_DRIVER_NAME_SPECIFIED";
- public static final String ER_NO_URL_SPECIFIED = "ER_NO_URL_SPECIFIED";
- public static final String ER_POOLSIZE_LESS_THAN_ONE =
- "ER_POOLSIZE_LESS_THAN_ONE";
- public static final String ER_INVALID_DRIVER_NAME = "ER_INVALID_DRIVER_NAME";
- public static final String ER_ERRORLISTENER = "ER_ERRORLISTENER";
- public static final String ER_ASSERT_NO_TEMPLATE_PARENT =
- "ER_ASSERT_NO_TEMPLATE_PARENT";
- public static final String ER_ASSERT_REDUNDENT_EXPR_ELIMINATOR =
- "ER_ASSERT_REDUNDENT_EXPR_ELIMINATOR";
- public static final String ER_NOT_ALLOWED_IN_POSITION =
- "ER_NOT_ALLOWED_IN_POSITION";
- public static final String ER_NONWHITESPACE_NOT_ALLOWED_IN_POSITION =
- "ER_NONWHITESPACE_NOT_ALLOWED_IN_POSITION";
- public static final String ER_NAMESPACE_CONTEXT_NULL_NAMESPACE =
- "ER_NAMESPACE_CONTEXT_NULL_NAMESPACE";
- public static final String ER_NAMESPACE_CONTEXT_NULL_PREFIX =
- "ER_NAMESPACE_CONTEXT_NULL_PREFIX";
- public static final String ER_XPATH_RESOLVER_NULL_QNAME =
- "ER_XPATH_RESOLVER_NULL_QNAME";
- public static final String ER_XPATH_RESOLVER_NEGATIVE_ARITY =
- "ER_XPATH_RESOLVER_NEGATIVE_ARITY";
- public static final String INVALID_TCHAR = "INVALID_TCHAR";
- public static final String INVALID_QNAME = "INVALID_QNAME";
- public static final String INVALID_ENUM = "INVALID_ENUM";
- public static final String INVALID_NMTOKEN = "INVALID_NMTOKEN";
- public static final String INVALID_NCNAME = "INVALID_NCNAME";
- public static final String INVALID_BOOLEAN = "INVALID_BOOLEAN";
- public static final String INVALID_NUMBER = "INVALID_NUMBER";
- public static final String ER_ARG_LITERAL = "ER_ARG_LITERAL";
- public static final String ER_DUPLICATE_GLOBAL_VAR ="ER_DUPLICATE_GLOBAL_VAR";
- public static final String ER_DUPLICATE_VAR = "ER_DUPLICATE_VAR";
- public static final String ER_TEMPLATE_NAME_MATCH = "ER_TEMPLATE_NAME_MATCH";
- public static final String ER_INVALID_PREFIX = "ER_INVALID_PREFIX";
- public static final String ER_NO_ATTRIB_SET = "ER_NO_ATTRIB_SET";
- public static final String ER_FUNCTION_NOT_FOUND =
- "ER_FUNCTION_NOT_FOUND";
- public static final String ER_CANT_HAVE_CONTENT_AND_SELECT =
- "ER_CANT_HAVE_CONTENT_AND_SELECT";
- public static final String ER_INVALID_SET_PARAM_VALUE = "ER_INVALID_SET_PARAM_VALUE";
- public static final String ER_SET_FEATURE_NULL_NAME =
- "ER_SET_FEATURE_NULL_NAME";
- public static final String ER_GET_FEATURE_NULL_NAME =
- "ER_GET_FEATURE_NULL_NAME";
- public static final String ER_UNSUPPORTED_FEATURE =
- "ER_UNSUPPORTED_FEATURE";
- public static final String ER_EXTENSION_ELEMENT_NOT_ALLOWED_IN_SECURE_PROCESSING =
- "ER_EXTENSION_ELEMENT_NOT_ALLOWED_IN_SECURE_PROCESSING";
-
- public static final String WG_FOUND_CURLYBRACE = "WG_FOUND_CURLYBRACE";
- public static final String WG_COUNT_ATTRIB_MATCHES_NO_ANCESTOR =
- "WG_COUNT_ATTRIB_MATCHES_NO_ANCESTOR";
- public static final String WG_EXPR_ATTRIB_CHANGED_TO_SELECT =
- "WG_EXPR_ATTRIB_CHANGED_TO_SELECT";
- public static final String WG_NO_LOCALE_IN_FORMATNUMBER =
- "WG_NO_LOCALE_IN_FORMATNUMBER";
- public static final String WG_LOCALE_NOT_FOUND = "WG_LOCALE_NOT_FOUND";
- public static final String WG_CANNOT_MAKE_URL_FROM ="WG_CANNOT_MAKE_URL_FROM";
- public static final String WG_CANNOT_LOAD_REQUESTED_DOC =
- "WG_CANNOT_LOAD_REQUESTED_DOC";
- public static final String WG_CANNOT_FIND_COLLATOR ="WG_CANNOT_FIND_COLLATOR";
- public static final String WG_FUNCTIONS_SHOULD_USE_URL =
- "WG_FUNCTIONS_SHOULD_USE_URL";
- public static final String WG_ENCODING_NOT_SUPPORTED_USING_UTF8 =
- "WG_ENCODING_NOT_SUPPORTED_USING_UTF8";
- public static final String WG_ENCODING_NOT_SUPPORTED_USING_JAVA =
- "WG_ENCODING_NOT_SUPPORTED_USING_JAVA";
- public static final String WG_SPECIFICITY_CONFLICTS =
- "WG_SPECIFICITY_CONFLICTS";
- public static final String WG_PARSING_AND_PREPARING =
- "WG_PARSING_AND_PREPARING";
- public static final String WG_ATTR_TEMPLATE = "WG_ATTR_TEMPLATE";
- public static final String WG_CONFLICT_BETWEEN_XSLSTRIPSPACE_AND_XSLPRESERVESPACE = "WG_CONFLICT_BETWEEN_XSLSTRIPSPACE_AND_XSLPRESERVESP";
- public static final String WG_ATTRIB_NOT_HANDLED = "WG_ATTRIB_NOT_HANDLED";
- public static final String WG_NO_DECIMALFORMAT_DECLARATION =
- "WG_NO_DECIMALFORMAT_DECLARATION";
- public static final String WG_OLD_XSLT_NS = "WG_OLD_XSLT_NS";
- public static final String WG_ONE_DEFAULT_XSLDECIMALFORMAT_ALLOWED =
- "WG_ONE_DEFAULT_XSLDECIMALFORMAT_ALLOWED";
- public static final String WG_XSLDECIMALFORMAT_NAMES_MUST_BE_UNIQUE =
- "WG_XSLDECIMALFORMAT_NAMES_MUST_BE_UNIQUE";
- public static final String WG_ILLEGAL_ATTRIBUTE = "WG_ILLEGAL_ATTRIBUTE";
- public static final String WG_COULD_NOT_RESOLVE_PREFIX =
- "WG_COULD_NOT_RESOLVE_PREFIX";
- public static final String WG_STYLESHEET_REQUIRES_VERSION_ATTRIB =
- "WG_STYLESHEET_REQUIRES_VERSION_ATTRIB";
- public static final String WG_ILLEGAL_ATTRIBUTE_NAME =
- "WG_ILLEGAL_ATTRIBUTE_NAME";
- public static final String WG_ILLEGAL_ATTRIBUTE_VALUE =
- "WG_ILLEGAL_ATTRIBUTE_VALUE";
- public static final String WG_EMPTY_SECOND_ARG = "WG_EMPTY_SECOND_ARG";
- public static final String WG_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML =
- "WG_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML";
- public static final String WG_PROCESSINGINSTRUCTION_NOTVALID_NCNAME =
- "WG_PROCESSINGINSTRUCTION_NOTVALID_NCNAME";
- public static final String WG_ILLEGAL_ATTRIBUTE_POSITION =
- "WG_ILLEGAL_ATTRIBUTE_POSITION";
- public static final String NO_MODIFICATION_ALLOWED_ERR =
- "NO_MODIFICATION_ALLOWED_ERR";
-
- /*
- * Now fill in the message text.
- * Then fill in the message text for that message code in the
- * array. Use the new error code as the index into the array.
- */
-
- // Error messages...
-
- /** Get the lookup table for error messages.
- *
- * @return The message lookup table.
- */
- public Object[][] getContents()
- {
- return new Object[][] {
-
- /** Error message ID that has a null message, but takes in a single object. */
- {"ER0000" , "{0}" },
-
- { ER_NO_CURLYBRACE,
- "Fehler: \"{\" darf nicht im Ausdruck enthalten sein"},
-
- { ER_ILLEGAL_ATTRIBUTE ,
- "{0} hat ein ung\u00FCltiges Attribut: {1}"},
-
- {ER_NULL_SOURCENODE_APPLYIMPORTS ,
- "sourceNode ist null in xsl:apply-imports."},
-
- {ER_CANNOT_ADD,
- "{0} kann nicht zu {1} hinzugef\u00FCgt werden"},
-
- { ER_NULL_SOURCENODE_HANDLEAPPLYTEMPLATES,
- "sourceNode ist null in handleApplyTemplatesInstruction."},
-
- { ER_NO_NAME_ATTRIB,
- "{0} muss \u00FCber ein \"name\"-Attribut verf\u00FCgen."},
-
- {ER_TEMPLATE_NOT_FOUND,
- "Vorlage mit Namen {0} konnte nicht gefunden werden"},
-
- {ER_CANT_RESOLVE_NAME_AVT,
- "Namens-AVT in xsl:call-template konnte nicht aufgel\u00F6st werden."},
-
- {ER_REQUIRES_ATTRIB,
- "{0} erfordert Attribut: {1}"},
-
- { ER_MUST_HAVE_TEST_ATTRIB,
- "{0} muss \u00FCber ein \"test\"-Attribut verf\u00FCgen."},
-
- {ER_BAD_VAL_ON_LEVEL_ATTRIB,
- "Ung\u00FCltiger Wert bei Ebenenattribut: {0}"},
-
- {ER_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML,
- "processing-instruction-Name darf nicht \"xml\" lauten"},
-
- { ER_PROCESSINGINSTRUCTION_NOTVALID_NCNAME,
- "processing-instruction-Name muss ein g\u00FCltiger NCName sein: {0}"},
-
- { ER_NEED_MATCH_ATTRIB,
- "{0} muss \u00FCber ein \"match\"-Attribut verf\u00FCgen, wenn ein Modus vorhanden ist."},
-
- { ER_NEED_NAME_OR_MATCH_ATTRIB,
- "{0} erfordert entweder ein \"name\"- oder ein \"match\"-Attribut."},
-
- {ER_CANT_RESOLVE_NSPREFIX,
- "Namespace-Pr\u00E4fix kann nicht aufgel\u00F6st werden: {0}"},
-
- { ER_ILLEGAL_VALUE,
- "xml:space hat einen ung\u00FCltigen Wert: {0}"},
-
- { ER_NO_OWNERDOC,
- "Der untergeordnete Knoten hat kein Eigent\u00FCmerdokument."},
-
- { ER_ELEMTEMPLATEELEM_ERR,
- "ElemTemplateElement-Fehler: {0}"},
-
- { ER_NULL_CHILD,
- "Es wird versucht, ein leeres untergeordnetes Element hinzuzuf\u00FCgen."},
-
- { ER_NEED_SELECT_ATTRIB,
- "{0} erfordert ein \"select\"-Attribut."},
-
- { ER_NEED_TEST_ATTRIB ,
- "xsl:when muss \u00FCber ein \"test\"-Attribut verf\u00FCgen."},
-
- { ER_NEED_NAME_ATTRIB,
- "xsl:with-param muss \u00FCber ein \"name\"-Attribut verf\u00FCgen."},
-
- { ER_NO_CONTEXT_OWNERDOC,
- "Kontext hat kein Eigent\u00FCmerdokument."},
-
- {ER_COULD_NOT_CREATE_XML_PROC_LIAISON,
- "XML-TransformerFactory-Liaison konnte nicht erstellt werden: {0}"},
-
- {ER_PROCESS_NOT_SUCCESSFUL,
- "Xalan: Prozess war nicht erfolgreich."},
-
- { ER_NOT_SUCCESSFUL,
- "Xalan: War nicht erfolgreich."},
-
- { ER_ENCODING_NOT_SUPPORTED,
- "Codierung nicht unterst\u00FCtzt: {0}"},
-
- {ER_COULD_NOT_CREATE_TRACELISTENER,
- "TraceListener konnte nicht erstellt werden: {0}"},
-
- {ER_KEY_REQUIRES_NAME_ATTRIB,
- "xsl:key erfordert ein \"name\"-Attribut."},
-
- { ER_KEY_REQUIRES_MATCH_ATTRIB,
- "xsl:key erfordert ein \"match\"-Attribut."},
-
- { ER_KEY_REQUIRES_USE_ATTRIB,
- "xsl:key erfordert ein \"use\"-Attribut."},
-
- { ER_REQUIRES_ELEMENTS_ATTRIB,
- "(StylesheetHandler) {0} erfordert ein \"elements\"-Attribut."},
-
- { ER_MISSING_PREFIX_ATTRIB,
- "(StylesheetHandler) {0} Attribut \"prefix\" fehlt"},
-
- { ER_BAD_STYLESHEET_URL,
- "Stylesheet-URL ist ung\u00FCltig: {0}"},
-
- { ER_FILE_NOT_FOUND,
- "Stylesheet-Datei wurde nicht gefunden: {0}"},
-
- { ER_IOEXCEPTION,
- "IO-Ausnahme bei Stylesheet-Datei: {0}"},
-
- { ER_NO_HREF_ATTRIB,
- "(StylesheetHandler) \"href\"-Attribut f\u00FCr {0} konnte nicht gefunden werden"},
-
- { ER_STYLESHEET_INCLUDES_ITSELF,
- "(StylesheetHandler) {0} schlie\u00DFt sich direkt oder indirekt selbst mit ein."},
-
- { ER_PROCESSINCLUDE_ERROR,
- "StylesheetHandler.processInclude-Fehler, {0}"},
-
- { ER_MISSING_LANG_ATTRIB,
- "(StylesheetHandler) {0}: Das Attribut \"lang\" fehlt"},
-
- { ER_MISSING_CONTAINER_ELEMENT_COMPONENT,
- "(StylesheetHandler) Element {0} an falscher Position?? Fehlendes Containerelement ''component''"},
-
- { ER_CAN_ONLY_OUTPUT_TO_ELEMENT,
- "Ausgabe kann nur an ein Element, DocumentFragment, Dokument oder PrintWriter erfolgen."},
-
- { ER_PROCESS_ERROR,
- "StylesheetRoot.process-Fehler"},
-
- { ER_UNIMPLNODE_ERROR,
- "UnImplNode-Fehler: {0}"},
-
- { ER_NO_SELECT_EXPRESSION,
- "Fehler. xpath-Auswahlausdruck (-select) nicht gefunden."},
-
- { ER_CANNOT_SERIALIZE_XSLPROCESSOR,
- "XSLProcessor kann nicht serialisiert werden."},
-
- { ER_NO_INPUT_STYLESHEET,
- "Stylesheet-Eingabe wurde nicht angegeben."},
-
- { ER_FAILED_PROCESS_STYLESHEET,
- "Verarbeitung des Stylesheet nicht erfolgreich."},
-
- { ER_COULDNT_PARSE_DOC,
- "{0}-Dokument konnte nicht geparst werden."},
-
- { ER_COULDNT_FIND_FRAGMENT,
- "Fragment konnte nicht gefunden werden: {0}"},
-
- { ER_NODE_NOT_ELEMENT,
- "Fragment-ID verwies auf einen Knoten, der kein Element war: {0}"},
-
- { ER_FOREACH_NEED_MATCH_OR_NAME_ATTRIB,
- "for-each muss entweder ein \"match\"- oder ein \"name\"-Attribut haben"},
-
- { ER_TEMPLATES_NEED_MATCH_OR_NAME_ATTRIB,
- "Vorlagen m\u00FCssen entweder ein \"match\"- oder ein \"name\"-Attribut haben"},
-
- { ER_NO_CLONE_OF_DOCUMENT_FRAG,
- "Kein Clone eines Dokumentfragments."},
-
- { ER_CANT_CREATE_ITEM,
- "Element in Ergebnisbaum kann nicht erstellt werden: {0}"},
-
- { ER_XMLSPACE_ILLEGAL_VALUE,
- "xml:space in Quell-XML hat einen ung\u00FCltigen Wert: {0}"},
-
- { ER_NO_XSLKEY_DECLARATION,
- "Keine xsl:key-Deklaration f\u00FCr {0} vorhanden."},
-
- { ER_CANT_CREATE_URL,
- "Fehler. URL f\u00FCr {0} kann nicht erstellt werden"},
-
- { ER_XSLFUNCTIONS_UNSUPPORTED,
- "xsl:functions nicht unterst\u00FCtzt"},
-
- { ER_PROCESSOR_ERROR,
- "XSLT-TransformerFactory-Fehler"},
-
- { ER_NOT_ALLOWED_INSIDE_STYLESHEET,
- "(StylesheetHandler) {0} nicht zul\u00E4ssig in einem Stylesheet."},
-
- { ER_RESULTNS_NOT_SUPPORTED,
- "result-ns wird nicht mehr unterst\u00FCtzt. Verwenden Sie stattdessen xsl:output."},
-
- { ER_DEFAULTSPACE_NOT_SUPPORTED,
- "default-space wird nicht mehr unterst\u00FCtzt. Verwenden Sie stattdessen xsl:strip-space oder xsl:preserve-space."},
-
- { ER_INDENTRESULT_NOT_SUPPORTED,
- "indent-result wird nicht mehr unterst\u00FCtzt. Verwenden Sie stattdessen xsl:output."},
-
- { ER_ILLEGAL_ATTRIB,
- "(StylesheetHandler) {0} hat ein ung\u00FCltiges Attribut: {1}"},
-
- { ER_UNKNOWN_XSL_ELEM,
- "Unbekanntes XSL-Element: {0}"},
-
- { ER_BAD_XSLSORT_USE,
- "(StylesheetHandler) xsl:sort kann nur mit xsl:apply-templates oder xsl:for-each verwendet werden."},
-
- { ER_MISPLACED_XSLWHEN,
- "(StylesheetHandler) xsl:when steht an der falschen Position."},
-
- { ER_XSLWHEN_NOT_PARENTED_BY_XSLCHOOSE,
- "(StylesheetHandler) xsl:when hat nicht das \u00FCbergeordnete Element xsl:choose."},
-
- { ER_MISPLACED_XSLOTHERWISE,
- "(StylesheetHandler) xsl:otherwise steht an der falschen Position."},
-
- { ER_XSLOTHERWISE_NOT_PARENTED_BY_XSLCHOOSE,
- "(StylesheetHandler) xsl:otherwise hat nicht das \u00FCbergeordnete Element xsl:choose."},
-
- { ER_NOT_ALLOWED_INSIDE_TEMPLATE,
- "(StylesheetHandler) {0} nicht zul\u00E4ssig in einer Vorlage."},
-
- { ER_UNKNOWN_EXT_NS_PREFIX,
- "(StylesheetHandler) {0}: Erweiterung des Namespace-Pr\u00E4fixes {1} ist unbekannt"},
-
- { ER_IMPORTS_AS_FIRST_ELEM,
- "(StylesheetHandler) Importe k\u00F6nnen nur als erste Elemente in einem Stylesheet auftreten."},
-
- { ER_IMPORTING_ITSELF,
- "(StylesheetHandler) {0} importiert sich direkt oder indirekt selbst."},
-
- { ER_XMLSPACE_ILLEGAL_VAL,
- "(StylesheetHandler) xml:space hat einen ung\u00FCltigen Wert: {0}"},
-
- { ER_PROCESSSTYLESHEET_NOT_SUCCESSFUL,
- "processStylesheet nicht erfolgreich."},
-
- { ER_SAX_EXCEPTION,
- "SAX-Ausnahme"},
-
-// add this message to fix bug 21478
- { ER_FUNCTION_NOT_SUPPORTED,
- "Funktion nicht unterst\u00FCtzt."},
-
- { ER_XSLT_ERROR,
- "XSLT-Fehler"},
-
- { ER_CURRENCY_SIGN_ILLEGAL,
- "W\u00E4hrungssymbol nicht zul\u00E4ssig in Formatmuster-Zeichenfolge"},
-
- { ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM,
- "Dokumentfunktion nicht unterst\u00FCtzt in DOM-Stylesheet."},
-
- { ER_CANT_RESOLVE_PREFIX_OF_NON_PREFIX_RESOLVER,
- "Pr\u00E4fix eines Non-Pr\u00E4fix-Resolver kann nicht aufgel\u00F6st werden."},
-
- { ER_REDIRECT_COULDNT_GET_FILENAME,
- "Umleitungserweiterung: Dateiname konnte nicht abgerufen werden. \"file\"- oder \"select\"-Attribut muss eine g\u00FCltige Zeichenfolge zur\u00FCckgeben."},
-
- { ER_CANNOT_BUILD_FORMATTERLISTENER_IN_REDIRECT,
- "FormatterListener kann nicht in Umleitungserweiterung erstellt werden."},
-
- { ER_INVALID_PREFIX_IN_EXCLUDERESULTPREFIX,
- "Pr\u00E4fix in exclude-result-prefixes ist nicht g\u00FCltig: {0}"},
-
- { ER_MISSING_NS_URI,
- "Fehlender Namespace-URI f\u00FCr angegebenes Pr\u00E4fix"},
-
- { ER_MISSING_ARG_FOR_OPTION,
- "Fehlendes Argument f\u00FCr Option: {0}"},
-
- { ER_INVALID_OPTION,
- "Ung\u00FCltige Option: {0}"},
-
- { ER_MALFORMED_FORMAT_STRING,
- "Fehlerhafte Formatzeichenfolge: {0}"},
-
- { ER_STYLESHEET_REQUIRES_VERSION_ATTRIB,
- "xsl:stylesheet erfordert ein \"version\"-Attribut."},
-
- { ER_ILLEGAL_ATTRIBUTE_VALUE,
- "Attribut {0} hat einen ung\u00FCltigen Wert: {1}"},
-
- { ER_CHOOSE_REQUIRES_WHEN,
- "xsl:choose erfordert xsl:when"},
-
- { ER_NO_APPLY_IMPORT_IN_FOR_EACH,
- "xsl:apply-imports nicht zul\u00E4ssig in xsl:for-each"},
-
- { ER_CANT_USE_DTM_FOR_OUTPUT,
- "DTMLiaison kann nicht f\u00FCr einen Ausgabe-DOM-Knoten verwendet werden. \u00DCbergeben Sie stattdessen einen com.sun.org.apache.xpath.internal.DOM2Helper."},
-
- { ER_CANT_USE_DTM_FOR_INPUT,
- "DTMLiaison kann nicht f\u00FCr einen Eingabe-DOM-Knoten verwendet werden. \u00DCbergeben Sie stattdessen einen com.sun.org.apache.xpath.internal.DOM2Helper."},
-
- { ER_CALL_TO_EXT_FAILED,
- "Aufruf von Erweiterungselement nicht erfolgreich: {0}"},
-
- { ER_PREFIX_MUST_RESOLVE,
- "Pr\u00E4fix muss in einen Namespace aufgel\u00F6st werden: {0}"},
-
- { ER_INVALID_UTF16_SURROGATE,
- "Ung\u00FCltige UTF-16-Ersetzung festgestellt: {0}?"},
-
- { ER_XSLATTRSET_USED_ITSELF,
- "xsl:attribute-set {0} hat sich selbst verwendet. Dies f\u00FChrt zu einer Endlosschleife."},
-
- { ER_CANNOT_MIX_XERCESDOM,
- "Nicht-Xerces-DOM-Eingabe kann nicht mit Xerces-DOM-Ausgabe gemischt werden."},
-
- { ER_TOO_MANY_LISTENERS,
- "addTraceListenersToStylesheet - TooManyListenersException"},
-
- { ER_IN_ELEMTEMPLATEELEM_READOBJECT,
- "In ElemTemplateElement.readObject: {0}"},
-
- { ER_DUPLICATE_NAMED_TEMPLATE,
- "Mehrere Vorlagen mit den Namen {0} gefunden"},
-
- { ER_INVALID_KEY_CALL,
- "Ung\u00FCltiger Funktionsaufruf: Rekursive key()-Aufrufe sind nicht zul\u00E4ssig"},
-
- { ER_REFERENCING_ITSELF,
- "Variable {0} verweist direkt oder indirekt auf sich selbst."},
-
- { ER_ILLEGAL_DOMSOURCE_INPUT,
- "Der Eingabeknoten darf nicht null sein f\u00FCr eine DOMSource f\u00FCr newTemplates."},
-
- { ER_CLASS_NOT_FOUND_FOR_OPTION,
- "Klassendatei nicht gefunden f\u00FCr Option {0}"},
-
- { ER_REQUIRED_ELEM_NOT_FOUND,
- "Erforderliches Element nicht gefunden: {0}"},
-
- { ER_INPUT_CANNOT_BE_NULL,
- "InputStream darf nicht null sein"},
-
- { ER_URI_CANNOT_BE_NULL,
- "URI darf nicht null sein"},
-
- { ER_FILE_CANNOT_BE_NULL,
- "Datei darf nicht null sein"},
-
- { ER_SOURCE_CANNOT_BE_NULL,
- "InputSource darf nicht null sein"},
-
- { ER_CANNOT_INIT_BSFMGR,
- "BSF-Manager konnte nicht initialisiert werden"},
-
- { ER_CANNOT_CMPL_EXTENSN,
- "Erweiterung konnte nicht kompiliert werden"},
-
- { ER_CANNOT_CREATE_EXTENSN,
- "Erweiterung {0} konnte nicht erstellt werden; Grund: {1}"},
-
- { ER_INSTANCE_MTHD_CALL_REQUIRES,
- "Der Aufruf einer Instanzmethode von Methode {0} erfordert eine Objektinstanz als erstes Argument"},
-
- { ER_INVALID_ELEMENT_NAME,
- "Ung\u00FCltiger Elementname angegeben {0}"},
-
- { ER_ELEMENT_NAME_METHOD_STATIC,
- "Elementnamenmethode muss statisch sein {0}"},
-
- { ER_EXTENSION_FUNC_UNKNOWN,
- "Erweiterungsfunktion {0} : {1} ist unbekannt"},
-
- { ER_MORE_MATCH_CONSTRUCTOR,
- "Mehrere passende \u00DCbereinstimmungen f\u00FCr Constructor f\u00FCr {0}"},
-
- { ER_MORE_MATCH_METHOD,
- "Mehrere passende \u00DCbereinstimmungen f\u00FCr Methode {0}"},
-
- { ER_MORE_MATCH_ELEMENT,
- "Mehrere passende \u00DCbereinstimmungen f\u00FCr Elementmethode {0}"},
-
- { ER_INVALID_CONTEXT_PASSED,
- "Ung\u00FCltiger Kontext zur Auswertung von {0} \u00FCbergeben"},
-
- { ER_POOL_EXISTS,
- "Pool ist bereits vorhanden"},
-
- { ER_NO_DRIVER_NAME,
- "Kein Treibername angegeben"},
-
- { ER_NO_URL,
- "Keine URL angegeben"},
-
- { ER_POOL_SIZE_LESSTHAN_ONE,
- "Poolgr\u00F6\u00DFe ist kleiner als eins."},
-
- { ER_INVALID_DRIVER,
- "Ung\u00FCltiger Treibername angegeben."},
-
- { ER_NO_STYLESHEETROOT,
- "Stylesheet-Root wurde nicht gefunden."},
-
- { ER_ILLEGAL_XMLSPACE_VALUE,
- "Ung\u00FCltiger Wert f\u00FCr xml:space"},
-
- { ER_PROCESSFROMNODE_FAILED,
- "processFromNode nicht erfolgreich"},
-
- { ER_RESOURCE_COULD_NOT_LOAD,
- "Ressource [ {0} ] konnte nicht geladen werden: {1} \n {2} \t {3}"},
-
- { ER_BUFFER_SIZE_LESSTHAN_ZERO,
- "Puffergr\u00F6\u00DFe <=0"},
-
- { ER_UNKNOWN_ERROR_CALLING_EXTENSION,
- "Unbekannter Fehler bei Aufruf von Erweiterung"},
-
- { ER_NO_NAMESPACE_DECL,
- "Pr\u00E4fix {0} hat keine entsprechende Namespace-Deklaration"},
-
- { ER_ELEM_CONTENT_NOT_ALLOWED,
- "Element-Content nicht zul\u00E4ssig f\u00FCr lang=javaclass {0}"},
-
- { ER_STYLESHEET_DIRECTED_TERMINATION,
- "Stylesheet f\u00FChrte zu Abbruch"},
-
- { ER_ONE_OR_TWO,
- "1 oder 2"},
-
- { ER_TWO_OR_THREE,
- "2 oder 3"},
-
- { ER_COULD_NOT_LOAD_RESOURCE,
- "{0} konnte nicht geladen werden (CLASSPATH pr\u00FCfen); die Standardwerte werden verwendet"},
-
- { ER_CANNOT_INIT_DEFAULT_TEMPLATES,
- "Standardvorlagen k\u00F6nnen nicht initialisiert werden"},
-
- { ER_RESULT_NULL,
- "Ergebnis darf nicht null sein"},
-
- { ER_RESULT_COULD_NOT_BE_SET,
- "Ergebnis konnte nicht festgelegt werden"},
-
- { ER_NO_OUTPUT_SPECIFIED,
- "Keine Ausgabe angegeben"},
-
- { ER_CANNOT_TRANSFORM_TO_RESULT_TYPE,
- "Transformation in ein Ergebnis mit Typ {0} nicht m\u00F6glich"},
-
- { ER_CANNOT_TRANSFORM_SOURCE_TYPE,
- "Transformation einer Quelle mit Typ {0} nicht m\u00F6glich"},
-
- { ER_NULL_CONTENT_HANDLER,
- "Null-Content-Handler"},
-
- { ER_NULL_ERROR_HANDLER,
- "Null-Error Handler"},
-
- { ER_CANNOT_CALL_PARSE,
- "Parsen kann nicht aufgerufen werden, wenn der ContentHandler nicht festgelegt wurde"},
-
- { ER_NO_PARENT_FOR_FILTER,
- "Kein \u00FCbergeordnetes Objekt f\u00FCr Filter"},
-
- { ER_NO_STYLESHEET_IN_MEDIA,
- "Kein Stylesheet gefunden in: {0}, Datentr\u00E4ger = {1}"},
-
- { ER_NO_STYLESHEET_PI,
- "Keine Verarbeitungsanweisung f\u00FCr xml-stylesheet gefunden in: {0}"},
-
- { ER_NOT_SUPPORTED,
- "Nicht unterst\u00FCtzt: {0}"},
-
- { ER_PROPERTY_VALUE_BOOLEAN,
- "Wert f\u00FCr Eigenschaft {0} muss eine boolesche Instanz sein"},
-
- { ER_COULD_NOT_FIND_EXTERN_SCRIPT,
- "Externes Skript bei {0} konnte nicht abgerufen werden"},
-
- { ER_RESOURCE_COULD_NOT_FIND,
- "Ressource [ {0} ] konnte nicht gefunden werden.\n {1}"},
-
- { ER_OUTPUT_PROPERTY_NOT_RECOGNIZED,
- "Ausgabeeigenschaft nicht erkannt: {0}"},
-
- { ER_FAILED_CREATING_ELEMLITRSLT,
- "ElemLiteralResult-Instanz konnte nicht erstellt werden"},
-
- //Earlier (JDK 1.4 XALAN 2.2-D11) at key code '204' the key name was ER_PRIORITY_NOT_PARSABLE
- // In latest Xalan code base key name is ER_VALUE_SHOULD_BE_NUMBER. This should also be taken care
- //in locale specific files like XSLTErrorResources_de.java, XSLTErrorResources_fr.java etc.
- //NOTE: Not only the key name but message has also been changed.
- { ER_VALUE_SHOULD_BE_NUMBER,
- "Wert f\u00FCr {0} sollte eine parsef\u00E4hige Zahl enthalten"},
-
- { ER_VALUE_SHOULD_EQUAL,
- "Wert f\u00FCr {0} muss \"Ja\" oder \"Nein\" entsprechen"},
-
- { ER_FAILED_CALLING_METHOD,
- "{0}-Methode konnte nicht aufgerufen werden"},
-
- { ER_FAILED_CREATING_ELEMTMPL,
- "ElemTemplateElement-Instanz konnte nicht erstellt werden"},
-
- { ER_CHARS_NOT_ALLOWED,
- "An dieser Stelle im Dokument sind keine Zeichen zul\u00E4ssig"},
-
- { ER_ATTR_NOT_ALLOWED,
- "\"{0}\"-Attribut ist nicht zul\u00E4ssig beim {1}-Element."},
-
- { ER_BAD_VALUE,
- "{0} ung\u00FCltiger Wert {1} "},
-
- { ER_ATTRIB_VALUE_NOT_FOUND,
- "{0}-Attributwert nicht gefunden "},
-
- { ER_ATTRIB_VALUE_NOT_RECOGNIZED,
- "{0}-Attributwert nicht erkannt "},
-
- { ER_NULL_URI_NAMESPACE,
- "Versuch, ein Namespace-Pr\u00E4fix mit einem Null-URI zu generieren"},
-
- { ER_NUMBER_TOO_BIG,
- "Versuch, eine Zahl zu formatieren, die gr\u00F6\u00DFer als die gr\u00F6\u00DFte Long-Ganzzahl ist"},
-
- { ER_CANNOT_FIND_SAX1_DRIVER,
- "SAX1-Treiberklasse {0} kann nicht gefunden werden"},
-
- { ER_SAX1_DRIVER_NOT_LOADED,
- "SAX1-Treiberklasse {0} gefunden, kann aber nicht geladen werden"},
-
- { ER_SAX1_DRIVER_NOT_INSTANTIATED,
- "SAX1-Treiberklasse {0} geladen, kann aber nicht instanziiert werden"},
-
- { ER_SAX1_DRIVER_NOT_IMPLEMENT_PARSER,
- "SAX1-Treiberklasse {0} implementiert org.xml.sax.Parser nicht"},
-
- { ER_PARSER_PROPERTY_NOT_SPECIFIED,
- "Systemeigenschaft \"org.xml.sax.parser\" nicht angegeben"},
-
- { ER_PARSER_ARG_CANNOT_BE_NULL,
- "Parserargument darf nicht null sein"},
-
- { ER_FEATURE,
- "Feature: {0}"},
-
- { ER_PROPERTY,
- "Eigenschaft: {0}"},
-
- { ER_NULL_ENTITY_RESOLVER,
- "Null-Entity-Resolver"},
-
- { ER_NULL_DTD_HANDLER,
- "Null-DTD-Handler"},
-
- { ER_NO_DRIVER_NAME_SPECIFIED,
- "Kein Treibername angegeben."},
-
- { ER_NO_URL_SPECIFIED,
- "Keine URL angegeben."},
-
- { ER_POOLSIZE_LESS_THAN_ONE,
- "Poolgr\u00F6\u00DFe ist kleiner als 1."},
-
- { ER_INVALID_DRIVER_NAME,
- "Ung\u00FCltiger Treibername angegeben."},
-
- { ER_ERRORLISTENER,
- "ErrorListener"},
-
-
-// Note to translators: The following message should not normally be displayed
-// to users. It describes a situation in which the processor has detected
-// an internal consistency problem in itself, and it provides this message
-// for the developer to help diagnose the problem. The name
-// 'ElemTemplateElement' is the name of a class, and should not be
-// translated.
- { ER_ASSERT_NO_TEMPLATE_PARENT,
- "Programmiererfehler. Der Ausdruck hat kein \u00FCbergeordnetes ElemTemplateElement-Objekt."},
-
-
-// Note to translators: The following message should not normally be displayed
-// to users. It describes a situation in which the processor has detected
-// an internal consistency problem in itself, and it provides this message
-// for the developer to help diagnose the problem. The substitution text
-// provides further information in order to diagnose the problem. The name
-// 'RedundentExprEliminator' is the name of a class, and should not be
-// translated.
- { ER_ASSERT_REDUNDENT_EXPR_ELIMINATOR,
- "Programmierer-Assertion in RedundentExprEliminator: {0}"},
-
- { ER_NOT_ALLOWED_IN_POSITION,
- "{0} ist an dieser Position im Stylesheet nicht zul\u00E4ssig."},
-
- { ER_NONWHITESPACE_NOT_ALLOWED_IN_POSITION,
- "Anderer Text als Leerstellen ist an dieser Position im Stylesheet nicht zul\u00E4ssig."},
-
- // This code is shared with warning codes.
- // SystemId Unknown
- { INVALID_TCHAR,
- "Ung\u00FCltiger Wert {1} f\u00FCr CHAR-Attribut {0} verwendet. Ein Attribut des Typs CHAR darf nur 1 Zeichen enthalten."},
-
- // Note to translators: The following message is used if the value of
- // an attribute in a stylesheet is invalid. "QNAME" is the XML data-type of
- // the attribute, and should not be translated. The substitution text {1} is
- // the attribute value and {0} is the attribute name.
- //The following codes are shared with the warning codes...
- { INVALID_QNAME,
- "Ung\u00FCltiger Wert {1} f\u00FCr QNAME-Attribut {0} verwendet"},
-
- // Note to translators: The following message is used if the value of
- // an attribute in a stylesheet is invalid. "ENUM" is the XML data-type of
- // the attribute, and should not be translated. The substitution text {1} is
- // the attribute value, {0} is the attribute name, and {2} is a list of valid
- // values.
- { INVALID_ENUM,
- "Ung\u00FCltiger Wert {1} f\u00FCr ENUM-Attribut {0} verwendet. G\u00FCltige Werte sind: {2}."},
-
-// Note to translators: The following message is used if the value of
-// an attribute in a stylesheet is invalid. "NMTOKEN" is the XML data-type
-// of the attribute, and should not be translated. The substitution text {1} is
-// the attribute value and {0} is the attribute name.
- { INVALID_NMTOKEN,
- "Ung\u00FCltiger Wert {1} f\u00FCr NMTOKEN-Attribut {0} verwendet "},
-
-// Note to translators: The following message is used if the value of
-// an attribute in a stylesheet is invalid. "NCNAME" is the XML data-type
-// of the attribute, and should not be translated. The substitution text {1} is
-// the attribute value and {0} is the attribute name.
- { INVALID_NCNAME,
- "Ung\u00FCltiger Wert {1} f\u00FCr NCNAME-Attribut {0} verwendet "},
-
-// Note to translators: The following message is used if the value of
-// an attribute in a stylesheet is invalid. "boolean" is the XSLT data-type
-// of the attribute, and should not be translated. The substitution text {1} is
-// the attribute value and {0} is the attribute name.
- { INVALID_BOOLEAN,
- "Ung\u00FCltiger Wert {1} f\u00FCr \"Boolean\"-Attribut {0} verwendet "},
-
-// Note to translators: The following message is used if the value of
-// an attribute in a stylesheet is invalid. "number" is the XSLT data-type
-// of the attribute, and should not be translated. The substitution text {1} is
-// the attribute value and {0} is the attribute name.
- { INVALID_NUMBER,
- "Ung\u00FCltiger Wert {1} f\u00FCr \"Number\"-Attribut {0} verwendet "},
-
-
- // End of shared codes...
-
-// Note to translators: A "match pattern" is a special form of XPath expression
-// that is used for matching patterns. The substitution text is the name of
-// a function. The message indicates that when this function is referenced in
-// a match pattern, its argument must be a string literal (or constant.)
-// ER_ARG_LITERAL - new error message for bugzilla //5202
- { ER_ARG_LITERAL,
- "Argument f\u00FCr {0} in Vergleichsmuster muss ein Literal sein."},
-
-// Note to translators: The following message indicates that two definitions of
-// a variable. A "global variable" is a variable that is accessible everywher
-// in the stylesheet.
-// ER_DUPLICATE_GLOBAL_VAR - new error message for bugzilla #790
- { ER_DUPLICATE_GLOBAL_VAR,
- "Doppelte Deklaration einer globalen Variable."},
-
-
-// Note to translators: The following message indicates that two definitions of
-// a variable were encountered.
-// ER_DUPLICATE_VAR - new error message for bugzilla #790
- { ER_DUPLICATE_VAR,
- "Doppelte Variablendeklaration."},
-
- // Note to translators: "xsl:template, "name" and "match" are XSLT keywords
- // which must not be translated.
- // ER_TEMPLATE_NAME_MATCH - new error message for bugzilla #789
- { ER_TEMPLATE_NAME_MATCH,
- "xsl:template muss ein \"name\"- oder \"match\"-Attribut (oder beides) haben"},
-
- // Note to translators: "exclude-result-prefixes" is an XSLT keyword which
- // should not be translated. The message indicates that a namespace prefix
- // encountered as part of the value of the exclude-result-prefixes attribute
- // was in error.
- // ER_INVALID_PREFIX - new error message for bugzilla #788
- { ER_INVALID_PREFIX,
- "Pr\u00E4fix in exclude-result-prefixes ist nicht g\u00FCltig: {0}"},
-
- // Note to translators: An "attribute set" is a set of attributes that can
- // be added to an element in the output document as a group. The message
- // indicates that there was a reference to an attribute set named {0} that
- // was never defined.
- // ER_NO_ATTRIB_SET - new error message for bugzilla #782
- { ER_NO_ATTRIB_SET,
- "attribute-set mit Namen {0} ist nicht vorhanden"},
-
- // Note to translators: This message indicates that there was a reference
- // to a function named {0} for which no function definition could be found.
- { ER_FUNCTION_NOT_FOUND,
- "Funktion mit Namen {0} ist nicht vorhanden"},
-
- // Note to translators: This message indicates that the XSLT instruction
- // that is named by the substitution text {0} must not contain other XSLT
- // instructions (content) or a "select" attribute. The word "select" is
- // an XSLT keyword in this case and must not be translated.
- { ER_CANT_HAVE_CONTENT_AND_SELECT,
- "{0}-Element darf weder Content noch ein \"select\"-Attribut enthalten."},
-
- // Note to translators: This message indicates that the value argument
- // of setParameter must be a valid Java Object.
- { ER_INVALID_SET_PARAM_VALUE,
- "Wert von Parameter {0} muss ein g\u00FCltiges Java-Objekt sein"},
-
- { ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX_FOR_DEFAULT,
- "Das result-prefix-Attribut eines xsl:namespace-alias-Elements hat den Wert \"#default\", es ist aber keine Deklaration des Standard-Namespace im G\u00FCltigkeitsbereich f\u00FCr das Element vorhanden"},
-
- { ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX,
- "Das result-prefix-Attribut eines xsl:namespace-alias-Elements hat den Wert \"{0}\", es ist aber keine Namespace-Deklaration f\u00FCr das Pr\u00E4fix \"{0}\" im G\u00FCltigkeitsbereich f\u00FCr das Element vorhanden."},
-
- { ER_SET_FEATURE_NULL_NAME,
- "Der Featurename darf nicht null in TransformerFactory.setFeature(Zeichenfolgenname, boolescher Wert) sein."},
-
- { ER_GET_FEATURE_NULL_NAME,
- "Der Featurename darf nicht null in TransformerFactory.getFeature(Zeichenfolgenname) sein."},
-
- { ER_UNSUPPORTED_FEATURE,
- "Das Feature \"{0}\" kann nicht f\u00FCr diese TransformerFactory festgelegt werden."},
-
- { ER_EXTENSION_ELEMENT_NOT_ALLOWED_IN_SECURE_PROCESSING,
- "Verwendung des Erweiterungselements \"{0}\" ist nicht zul\u00E4ssig, wenn das Feature f\u00FCr die sichere Verarbeitung auf \"true\" gesetzt ist."},
-
- { ER_NAMESPACE_CONTEXT_NULL_NAMESPACE,
- "Pr\u00E4fix f\u00FCr Null-Namespace-URI kann nicht abgerufen werden."},
-
- { ER_NAMESPACE_CONTEXT_NULL_PREFIX,
- "Namespace-URI f\u00FCr Nullpr\u00E4fix kann nicht abgerufen werden."},
-
- { ER_XPATH_RESOLVER_NULL_QNAME,
- "Funktionsname darf nicht null sein."},
-
- { ER_XPATH_RESOLVER_NEGATIVE_ARITY,
- "Argumentanzahl darf nicht negativ sein."},
- // Warnings...
-
- { WG_FOUND_CURLYBRACE,
- "\"}\" gefunden, aber keine Attributvorlage ist ge\u00F6ffnet."},
-
- { WG_COUNT_ATTRIB_MATCHES_NO_ANCESTOR,
- "Warnung: \"count\"-Attribut entspricht keinem Vorg\u00E4nger in xsl:number. Ziel = {0}"},
-
- { WG_EXPR_ATTRIB_CHANGED_TO_SELECT,
- "Alte Syntax: Der Name des \"expr\"-Attributs wurde in \"select\" ge\u00E4ndert."},
-
- { WG_NO_LOCALE_IN_FORMATNUMBER,
- "Xalan verarbeitet noch nicht den Gebietsschemanamen in der format-number-Funktion."},
-
- { WG_LOCALE_NOT_FOUND,
- "Warnung: Gebietsschema f\u00FCr xml:lang={0} konnte nicht gefunden werden"},
-
- { WG_CANNOT_MAKE_URL_FROM,
- "URL kann nicht erstellt werden aus: {0}"},
-
- { WG_CANNOT_LOAD_REQUESTED_DOC,
- "Angefordertes Dokument kann nicht geladen werden: {0}"},
-
- { WG_CANNOT_FIND_COLLATOR,
- "Collator f\u00FCr <sort xml:lang={0} konnte nicht gefunden werden"},
-
- { WG_FUNCTIONS_SHOULD_USE_URL,
- "Alte Syntax: Die Funktionsanweisung muss eine URL von {0} sein"},
-
- { WG_ENCODING_NOT_SUPPORTED_USING_UTF8,
- "Codierung nicht unterst\u00FCtzt: {0}. UTF-8 wird verwendet"},
-
- { WG_ENCODING_NOT_SUPPORTED_USING_JAVA,
- "Codierung nicht unterst\u00FCtzt: {0}. Java {1} wird verwendet"},
-
- { WG_SPECIFICITY_CONFLICTS,
- "Genauigkeitskonflikte gefunden: {0} Letzte in Stylesheet gefundene Angabe wird verwendet."},
-
- { WG_PARSING_AND_PREPARING,
- "========= {0} wird geparst und vorbereitet =========="},
-
- { WG_ATTR_TEMPLATE,
- "Attributvorlage {0}"},
-
- { WG_CONFLICT_BETWEEN_XSLSTRIPSPACE_AND_XSLPRESERVESPACE,
- "\u00DCbereinstimmungskonflikt zwischen xsl:strip-space und xsl:preserve-space"},
-
- { WG_ATTRIB_NOT_HANDLED,
- "Xalan verarbeitet noch nicht das {0}-Attribut."},
-
- { WG_NO_DECIMALFORMAT_DECLARATION,
- "Keine Deklaration f\u00FCr Dezimalformat gefunden: {0}"},
-
- { WG_OLD_XSLT_NS,
- "Fehlender oder falscher XSLT-Namespace. "},
-
- { WG_ONE_DEFAULT_XSLDECIMALFORMAT_ALLOWED,
- "Nur eine Standard-xsl:decimal-format-Deklaration ist zul\u00E4ssig."},
-
- { WG_XSLDECIMALFORMAT_NAMES_MUST_BE_UNIQUE,
- "xsl:decimal-format-Namen m\u00FCssen eindeutig sein. Name \"{0}\" wurde dupliziert."},
-
- { WG_ILLEGAL_ATTRIBUTE,
- "{0} hat ein ung\u00FCltiges Attribut: {1}"},
-
- { WG_COULD_NOT_RESOLVE_PREFIX,
- "Namespace-Pr\u00E4fix konnte nicht aufgel\u00F6st werden: {0}. Der Knoten wird ignoriert."},
-
- { WG_STYLESHEET_REQUIRES_VERSION_ATTRIB,
- "xsl:stylesheet erfordert ein \"version\"-Attribut."},
-
- { WG_ILLEGAL_ATTRIBUTE_NAME,
- "Ung\u00FCltiger Attributname: {0}"},
-
- { WG_ILLEGAL_ATTRIBUTE_VALUE,
- "Ung\u00FCltiger Wert f\u00FCr Attribut {0}: {1}"},
-
- { WG_EMPTY_SECOND_ARG,
- "Resultierendes NodeSet aus zweitem Argument von Dokumentfunktion ist leer. Geben Sie ein leeres NodeSet zur\u00FCck."},
-
- //Following are the new WARNING keys added in XALAN code base after Jdk 1.4 (Xalan 2.2-D11)
-
- // Note to translators: "name" and "xsl:processing-instruction" are keywords
- // and must not be translated.
- { WG_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML,
- "Der Wert des \"name\"-Attributs des xsl:processing-instruction-Namens darf nicht \"xml\" sein"},
-
- // Note to translators: "name" and "xsl:processing-instruction" are keywords
- // and must not be translated. "NCName" is an XML data-type and must not be
- // translated.
- { WG_PROCESSINGINSTRUCTION_NOTVALID_NCNAME,
- "Der Wert des \"name\"-Attributs von xsl:processing-instruction muss ein g\u00FCltiger NCName sein: {0}"},
-
- // Note to translators: This message is reported if the stylesheet that is
- // being processed attempted to construct an XML document with an attribute in a
- // place other than on an element. The substitution text specifies the name of
- // the attribute.
- { WG_ILLEGAL_ATTRIBUTE_POSITION,
- "Attribut {0} kann nicht nach untergeordneten Knoten oder vor dem Erstellen eines Elements hinzugef\u00FCgt werden. Attribut wird ignoriert."},
-
- { NO_MODIFICATION_ALLOWED_ERR,
- "Es wurde versucht, ein Objekt zu \u00E4ndern, bei dem \u00C4nderungen nicht zul\u00E4ssig sind."
- },
-
- //Check: WHY THERE IS A GAP B/W NUMBERS in the XSLTErrorResources properties file?
-
- // Other miscellaneous text used inside the code...
- { "ui_language", "de"},
- { "help_language", "de" },
- { "language", "de" },
- { "BAD_CODE", "Parameter f\u00FCr createMessage war au\u00DFerhalb des g\u00FCltigen Bereichs"},
- { "FORMAT_FAILED", "Ausnahme bei messageFormat-Aufruf ausgel\u00F6st"},
- { "version", ">>>>>>> Xalan-Version "},
- { "version2", "<<<<<<<"},
- { "yes", "Ja"},
- { "line", "Zeilennummer"},
- { "column","Spaltennummer"},
- { "xsldone", "XSLProcessor: Fertig"},
-
-
- // Note to translators: The following messages provide usage information
- // for the Xalan Process command line. "Process" is the name of a Java class,
- // and should not be translated.
- { "xslProc_option", "Xalan-J-Befehlszeile - \"Process\"-Klassenoptionen:"},
- { "xslProc_option", "Xalan-J-Befehlszeile - \"Process\"-Klassenoptionen:"},
- { "xslProc_invalid_xsltc_option", "Option {0} wird im XSLTC-Modus nicht unterst\u00FCtzt."},
- { "xslProc_invalid_xalan_option", "Option {0} kann nur mit -XSLTC verwendet werden."},
- { "xslProc_no_input", "Fehler: Kein Stylesheet und keine Eingabe-XML angegeben. F\u00FChren Sie diesen Befehl ohne Optionen f\u00FCr Verwendungsanweisungen aus."},
- { "xslProc_common_options", "-Allgemeine Optionen-"},
- { "xslProc_xalan_options", "-Optionen f\u00FCr Xalan-"},
- { "xslProc_xsltc_options", "-Optionen f\u00FCr XSLTC-"},
- { "xslProc_return_to_continue", "(dr\u00FCcken Sie die <Eingabetaste>, um fortzufahren)"},
-
- // Note to translators: The option name and the parameter name do not need to
- // be translated. Only translate the messages in parentheses. Note also that
- // leading whitespace in the messages is used to indent the usage information
- // for each option in the English messages.
- // Do not translate the keywords: XSLTC, SAX, DOM and DTM.
- { "optionXSLTC", " [-XSLTC (XSLTC f\u00FCr Transformation verwenden)]"},
- { "optionIN", " [-IN inputXMLURL]"},
- { "optionXSL", " [-XSL XSLTransformationURL]"},
- { "optionOUT", " [-OUT outputFileName]"},
- { "optionLXCIN", " [-LXCIN compiledStylesheetFileNameIn]"},
- { "optionLXCOUT", " [-LXCOUT compiledStylesheetFileNameOutOut]"},
- { "optionPARSER", " [-PARSER fully qualified class name of parser liaison]"},
- { "optionE", " [-E (Entityreferenzen nicht einblenden)]"},
- { "optionV", " [-E (Entityreferenzen nicht einblenden)]"},
- { "optionQC", " [-QC (Stille Musterkonfliktwarnungen)]"},
- { "optionQ", " [-Q (Silent-Modus)]"},
- { "optionLF", " [-LF (Nur Zeilenvorsch\u00FCbe bei Ausgabe verwenden {Standard ist CR/LF})]"},
- { "optionCR", " [-CR (Nur Zeilenschaltungen bei Ausgabe verwenden {Standard ist CR/LF})]"},
- { "optionESCAPE", " [-ESCAPE (Escapezeichen {Standard ist <>&\"'\r\n}]"},
- { "optionINDENT", " [-INDENT (Steuern, wie viele Leerzeichen der Einzug enthalten soll {Standard ist 0})]"},
- { "optionTT", " [-TT (Vorlagen verfolgen, wenn diese aufgerufen werden.)]"},
- { "optionTG", " [-TG (Jedes Generierungsereignis verfolgen.)]"},
- { "optionTS", " [-TS (Jedes Auswahlereignis verfolgen.)]"},
- { "optionTTC", " [-TTC (Untergeordnete Vorlagen verfolgen, wenn diese verarbeitet werden.)]"},
- { "optionTCLASS", " [-TCLASS (TraceListener-Klasse f\u00FCr Traceerweiterungen.)]"},
- { "optionVALIDATE", " [-VALIDATE (Festlegen, ob die Validierung ausgef\u00FChrt wird. Validierung ist standardm\u00E4\u00DFig ausgeschaltet.)]"},
- { "optionEDUMP", " [-EDUMP {optionaler Dateiname} (Stack Dump bei Fehler vornehmen.)]"},
- { "optionXML", " [-XML (XML-Formatter verwenden und XML-Header hinzuf\u00FCgen.)]"},
- { "optionTEXT", " [-TEXT (Einfachen Text-Formatter verwenden.)]"},
- { "optionHTML", " [-HTML (HTML-Formatter verwenden.)]"},
- { "optionPARAM", " [-PARAM name expression (Stylesheet-Parameter festlegen)]"},
- { "noParsermsg1", "XSL-Prozess war nicht erfolgreich."},
- { "noParsermsg2", "** Parser konnte nicht gefunden werden **"},
- { "noParsermsg3", "Pr\u00FCfen Sie den Classpath."},
- { "noParsermsg4", "Wenn Sie nicht \u00FCber den XML-Parser f\u00FCr Java von IBM verf\u00FCgen, k\u00F6nnen Sie ihn hier herunterladen:"},
- { "noParsermsg5", "IBMs AlphaWorks: http://www.alphaworks.ibm.com/formula/xml"},
- { "optionURIRESOLVER", " [-URIRESOLVER full class name (URIResolver f\u00FCr die Aufl\u00F6sung von URIs)]"},
- { "optionENTITYRESOLVER", " [-ENTITYRESOLVER full class name (EntityResolver f\u00FCr die Aufl\u00F6sung von Entitys)]"},
- { "optionCONTENTHANDLER", " [-CONTENTHANDLER full class name (ContentHandler f\u00FCr die Serialisierung der Ausgabe)]"},
- { "optionLINENUMBERS", " [-L use line numbers for source document]"},
- { "optionSECUREPROCESSING", " [-SECURE (Feature f\u00FCr die sichere Verarbeitung auf \"true\" setzen.)]"},
-
- // Following are the new options added in XSLTErrorResources.properties files after Jdk 1.4 (Xalan 2.2-D11)
-
-
- { "optionMEDIA", " [-MEDIA mediaType (\"media\"-Attribut verwenden, um mit einem Dokument verkn\u00FCpftes Stylesheet zu finden.)]"},
- { "optionFLAVOR", " [-FLAVOR flavorName (s2s=SAX oder d2d=DOM explizit f\u00FCr Transformation verwenden.)] "}, // Added by sboag/scurcuru; experimental
- { "optionDIAG", " [-DIAG (Gesamtdauer der Transformation in Millisekunden drucken.)]"},
- { "optionINCREMENTAL", " [-INCREMENTAL (inkrementelle DTM-Konstruktion anfordern, indem http://xml.apache.org/xalan/features/incremental auf \"true\" gesetzt wird.)]"},
- { "optionNOOPTIMIMIZE", " [-NOOPTIMIMIZE (keine Stylesheet-Optimierungsverarbeitung anfordern, indem http://xml.apache.org/xalan/features/optimize auf \"false\" gesetzt wird.)]"},
- { "optionRL", " [-RL recursionlimit (numerischen Grenzwert f\u00FCr Stylesheet-Rekursionstiefe bekannt machen.)]"},
- { "optionXO", " [-XO [transletName] (Name dem generierten Translet zuweisen)]"},
- { "optionXD", " [-XD destinationDirectory (Zielverzeichnis f\u00FCr Translet angeben)]"},
- { "optionXJ", " [-XJ jarfile (verpackt Translet-Klassen in einer JAR-Datei mit dem Namen <jarfile>)]"},
- { "optionXP", " [-XP package (gibt ein Packagenamenspr\u00E4fix f\u00FCr alle generierten Translet-Klassen an)]"},
-
- //AddITIONAL STRINGS that need L10n
- // Note to translators: The following message describes usage of a particular
- // command-line option that is used to enable the "template inlining"
- // optimization. The optimization involves making a copy of the code
- // generated for a template in another template that refers to it.
- { "optionXN", " [-XN (aktiviert Vorlagen-Inlining)]" },
- { "optionXX", " [-XX (schaltet die zus\u00E4tzliche Debugging-Meldungsausgabe ein)]"},
- { "optionXT" , " [-XT (wenn m\u00F6glich, Translet f\u00FCr Transformation verwenden)]"},
- { "diagTiming"," --------- Transformation von {0} \u00FCber {1} dauerte {2} ms" },
- { "recursionTooDeep","Vorlagenverschachtelung zu tief. Verschachtelung = {0}, Vorlage {1} {2}" },
- { "nameIs", "Name ist" },
- { "matchPatternIs", "Vergleichsmuster ist" }
-
- };
-
- }
- // ================= INFRASTRUCTURE ======================
-
- /** String for use when a bad error code was encountered. */
- public static final String BAD_CODE = "BAD_CODE";
-
- /** String for use when formatting of the error string failed. */
- public static final String FORMAT_FAILED = "FORMAT_FAILED";
-
- /** General error string. */
- public static final String ERROR_STRING = "#error";
-
- /** String to prepend to error messages. */
- public static final String ERROR_HEADER = "Error: ";
-
- /** String to prepend to warning messages. */
- public static final String WARNING_HEADER = "Warning: ";
-
- /** String to specify the XSLT module. */
- public static final String XSL_HEADER = "XSLT ";
-
- /** String to specify the XML parser module. */
- public static final String XML_HEADER = "XML ";
-
- /** I don't think this is used any more.
- * @deprecated */
- public static final String QUERY_HEADER = "PATTERN ";
-
-
- }
diff --git a/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_en.java b/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_en.java
deleted file mode 100644
index fb5348b..0000000
--- a/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_en.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XSLTErrorResources_en.java,v 1.2.4.1 2005/09/13 10:18:30 pvedula Exp $
- */
-package com.sun.org.apache.xalan.internal.res;
-
-
-/**
- * Default implementation of XSLTErrorResources. This is just
- * an empty class.
- * @xsl.usage advanced
- */
-public class XSLTErrorResources_en extends XSLTErrorResources
-{
-}
diff --git a/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_es.java b/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_es.java
deleted file mode 100644
index ef0b0f6..0000000
--- a/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_es.java
+++ /dev/null
@@ -1,1447 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xalan.internal.res;
-
-import java.util.ListResourceBundle;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * Set up error messages.
- * We build a two dimensional array of message keys and
- * message strings. In order to add a new message here,
- * you need to first add a String constant. And
- * you need to enter key , value pair as part of contents
- * Array. You also need to update MAX_CODE for error strings
- * and MAX_WARNING for warnings ( Needed for only information
- * purpose )
- */
-public class XSLTErrorResources_es extends ListResourceBundle
-{
-
-/*
- * This file contains error and warning messages related to Xalan Error
- * Handling.
- *
- * General notes to translators:
- *
- * 1) Xalan (or more properly, Xalan-interpretive) and XSLTC are names of
- * components.
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- * XSLTC is an acronym for XSLT Compiler.
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 5) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 6) "Translet" is an invented term that describes the class file that
- * results from compiling an XML stylesheet into a Java class.
- *
- * 7) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- */
-
- /*
- * Static variables
- */
- public static final String ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX =
- "ER_INVALID_SET_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX";
-
- public static final String ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX_FOR_DEFAULT =
- "ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX_FOR_DEFAULT";
-
- public static final String ER_NO_CURLYBRACE = "ER_NO_CURLYBRACE";
- public static final String ER_FUNCTION_NOT_SUPPORTED = "ER_FUNCTION_NOT_SUPPORTED";
- public static final String ER_ILLEGAL_ATTRIBUTE = "ER_ILLEGAL_ATTRIBUTE";
- public static final String ER_NULL_SOURCENODE_APPLYIMPORTS = "ER_NULL_SOURCENODE_APPLYIMPORTS";
- public static final String ER_CANNOT_ADD = "ER_CANNOT_ADD";
- public static final String ER_NULL_SOURCENODE_HANDLEAPPLYTEMPLATES="ER_NULL_SOURCENODE_HANDLEAPPLYTEMPLATES";
- public static final String ER_NO_NAME_ATTRIB = "ER_NO_NAME_ATTRIB";
- public static final String ER_TEMPLATE_NOT_FOUND = "ER_TEMPLATE_NOT_FOUND";
- public static final String ER_CANT_RESOLVE_NAME_AVT = "ER_CANT_RESOLVE_NAME_AVT";
- public static final String ER_REQUIRES_ATTRIB = "ER_REQUIRES_ATTRIB";
- public static final String ER_MUST_HAVE_TEST_ATTRIB = "ER_MUST_HAVE_TEST_ATTRIB";
- public static final String ER_BAD_VAL_ON_LEVEL_ATTRIB =
- "ER_BAD_VAL_ON_LEVEL_ATTRIB";
- public static final String ER_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML =
- "ER_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML";
- public static final String ER_PROCESSINGINSTRUCTION_NOTVALID_NCNAME =
- "ER_PROCESSINGINSTRUCTION_NOTVALID_NCNAME";
- public static final String ER_NEED_MATCH_ATTRIB = "ER_NEED_MATCH_ATTRIB";
- public static final String ER_NEED_NAME_OR_MATCH_ATTRIB =
- "ER_NEED_NAME_OR_MATCH_ATTRIB";
- public static final String ER_CANT_RESOLVE_NSPREFIX =
- "ER_CANT_RESOLVE_NSPREFIX";
- public static final String ER_ILLEGAL_VALUE = "ER_ILLEGAL_VALUE";
- public static final String ER_NO_OWNERDOC = "ER_NO_OWNERDOC";
- public static final String ER_ELEMTEMPLATEELEM_ERR ="ER_ELEMTEMPLATEELEM_ERR";
- public static final String ER_NULL_CHILD = "ER_NULL_CHILD";
- public static final String ER_NEED_SELECT_ATTRIB = "ER_NEED_SELECT_ATTRIB";
- public static final String ER_NEED_TEST_ATTRIB = "ER_NEED_TEST_ATTRIB";
- public static final String ER_NEED_NAME_ATTRIB = "ER_NEED_NAME_ATTRIB";
- public static final String ER_NO_CONTEXT_OWNERDOC = "ER_NO_CONTEXT_OWNERDOC";
- public static final String ER_COULD_NOT_CREATE_XML_PROC_LIAISON =
- "ER_COULD_NOT_CREATE_XML_PROC_LIAISON";
- public static final String ER_PROCESS_NOT_SUCCESSFUL =
- "ER_PROCESS_NOT_SUCCESSFUL";
- public static final String ER_NOT_SUCCESSFUL = "ER_NOT_SUCCESSFUL";
- public static final String ER_ENCODING_NOT_SUPPORTED =
- "ER_ENCODING_NOT_SUPPORTED";
- public static final String ER_COULD_NOT_CREATE_TRACELISTENER =
- "ER_COULD_NOT_CREATE_TRACELISTENER";
- public static final String ER_KEY_REQUIRES_NAME_ATTRIB =
- "ER_KEY_REQUIRES_NAME_ATTRIB";
- public static final String ER_KEY_REQUIRES_MATCH_ATTRIB =
- "ER_KEY_REQUIRES_MATCH_ATTRIB";
- public static final String ER_KEY_REQUIRES_USE_ATTRIB =
- "ER_KEY_REQUIRES_USE_ATTRIB";
- public static final String ER_REQUIRES_ELEMENTS_ATTRIB =
- "ER_REQUIRES_ELEMENTS_ATTRIB";
- public static final String ER_MISSING_PREFIX_ATTRIB =
- "ER_MISSING_PREFIX_ATTRIB";
- public static final String ER_BAD_STYLESHEET_URL = "ER_BAD_STYLESHEET_URL";
- public static final String ER_FILE_NOT_FOUND = "ER_FILE_NOT_FOUND";
- public static final String ER_IOEXCEPTION = "ER_IOEXCEPTION";
- public static final String ER_NO_HREF_ATTRIB = "ER_NO_HREF_ATTRIB";
- public static final String ER_STYLESHEET_INCLUDES_ITSELF =
- "ER_STYLESHEET_INCLUDES_ITSELF";
- public static final String ER_PROCESSINCLUDE_ERROR ="ER_PROCESSINCLUDE_ERROR";
- public static final String ER_MISSING_LANG_ATTRIB = "ER_MISSING_LANG_ATTRIB";
- public static final String ER_MISSING_CONTAINER_ELEMENT_COMPONENT =
- "ER_MISSING_CONTAINER_ELEMENT_COMPONENT";
- public static final String ER_CAN_ONLY_OUTPUT_TO_ELEMENT =
- "ER_CAN_ONLY_OUTPUT_TO_ELEMENT";
- public static final String ER_PROCESS_ERROR = "ER_PROCESS_ERROR";
- public static final String ER_UNIMPLNODE_ERROR = "ER_UNIMPLNODE_ERROR";
- public static final String ER_NO_SELECT_EXPRESSION ="ER_NO_SELECT_EXPRESSION";
- public static final String ER_CANNOT_SERIALIZE_XSLPROCESSOR =
- "ER_CANNOT_SERIALIZE_XSLPROCESSOR";
- public static final String ER_NO_INPUT_STYLESHEET = "ER_NO_INPUT_STYLESHEET";
- public static final String ER_FAILED_PROCESS_STYLESHEET =
- "ER_FAILED_PROCESS_STYLESHEET";
- public static final String ER_COULDNT_PARSE_DOC = "ER_COULDNT_PARSE_DOC";
- public static final String ER_COULDNT_FIND_FRAGMENT =
- "ER_COULDNT_FIND_FRAGMENT";
- public static final String ER_NODE_NOT_ELEMENT = "ER_NODE_NOT_ELEMENT";
- public static final String ER_FOREACH_NEED_MATCH_OR_NAME_ATTRIB =
- "ER_FOREACH_NEED_MATCH_OR_NAME_ATTRIB";
- public static final String ER_TEMPLATES_NEED_MATCH_OR_NAME_ATTRIB =
- "ER_TEMPLATES_NEED_MATCH_OR_NAME_ATTRIB";
- public static final String ER_NO_CLONE_OF_DOCUMENT_FRAG =
- "ER_NO_CLONE_OF_DOCUMENT_FRAG";
- public static final String ER_CANT_CREATE_ITEM = "ER_CANT_CREATE_ITEM";
- public static final String ER_XMLSPACE_ILLEGAL_VALUE =
- "ER_XMLSPACE_ILLEGAL_VALUE";
- public static final String ER_NO_XSLKEY_DECLARATION =
- "ER_NO_XSLKEY_DECLARATION";
- public static final String ER_CANT_CREATE_URL = "ER_CANT_CREATE_URL";
- public static final String ER_XSLFUNCTIONS_UNSUPPORTED =
- "ER_XSLFUNCTIONS_UNSUPPORTED";
- public static final String ER_PROCESSOR_ERROR = "ER_PROCESSOR_ERROR";
- public static final String ER_NOT_ALLOWED_INSIDE_STYLESHEET =
- "ER_NOT_ALLOWED_INSIDE_STYLESHEET";
- public static final String ER_RESULTNS_NOT_SUPPORTED =
- "ER_RESULTNS_NOT_SUPPORTED";
- public static final String ER_DEFAULTSPACE_NOT_SUPPORTED =
- "ER_DEFAULTSPACE_NOT_SUPPORTED";
- public static final String ER_INDENTRESULT_NOT_SUPPORTED =
- "ER_INDENTRESULT_NOT_SUPPORTED";
- public static final String ER_ILLEGAL_ATTRIB = "ER_ILLEGAL_ATTRIB";
- public static final String ER_UNKNOWN_XSL_ELEM = "ER_UNKNOWN_XSL_ELEM";
- public static final String ER_BAD_XSLSORT_USE = "ER_BAD_XSLSORT_USE";
- public static final String ER_MISPLACED_XSLWHEN = "ER_MISPLACED_XSLWHEN";
- public static final String ER_XSLWHEN_NOT_PARENTED_BY_XSLCHOOSE =
- "ER_XSLWHEN_NOT_PARENTED_BY_XSLCHOOSE";
- public static final String ER_MISPLACED_XSLOTHERWISE =
- "ER_MISPLACED_XSLOTHERWISE";
- public static final String ER_XSLOTHERWISE_NOT_PARENTED_BY_XSLCHOOSE =
- "ER_XSLOTHERWISE_NOT_PARENTED_BY_XSLCHOOSE";
- public static final String ER_NOT_ALLOWED_INSIDE_TEMPLATE =
- "ER_NOT_ALLOWED_INSIDE_TEMPLATE";
- public static final String ER_UNKNOWN_EXT_NS_PREFIX =
- "ER_UNKNOWN_EXT_NS_PREFIX";
- public static final String ER_IMPORTS_AS_FIRST_ELEM =
- "ER_IMPORTS_AS_FIRST_ELEM";
- public static final String ER_IMPORTING_ITSELF = "ER_IMPORTING_ITSELF";
- public static final String ER_XMLSPACE_ILLEGAL_VAL ="ER_XMLSPACE_ILLEGAL_VAL";
- public static final String ER_PROCESSSTYLESHEET_NOT_SUCCESSFUL =
- "ER_PROCESSSTYLESHEET_NOT_SUCCESSFUL";
- public static final String ER_SAX_EXCEPTION = "ER_SAX_EXCEPTION";
- public static final String ER_XSLT_ERROR = "ER_XSLT_ERROR";
- public static final String ER_CURRENCY_SIGN_ILLEGAL=
- "ER_CURRENCY_SIGN_ILLEGAL";
- public static final String ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM =
- "ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM";
- public static final String ER_CANT_RESOLVE_PREFIX_OF_NON_PREFIX_RESOLVER =
- "ER_CANT_RESOLVE_PREFIX_OF_NON_PREFIX_RESOLVER";
- public static final String ER_REDIRECT_COULDNT_GET_FILENAME =
- "ER_REDIRECT_COULDNT_GET_FILENAME";
- public static final String ER_CANNOT_BUILD_FORMATTERLISTENER_IN_REDIRECT =
- "ER_CANNOT_BUILD_FORMATTERLISTENER_IN_REDIRECT";
- public static final String ER_INVALID_PREFIX_IN_EXCLUDERESULTPREFIX =
- "ER_INVALID_PREFIX_IN_EXCLUDERESULTPREFIX";
- public static final String ER_MISSING_NS_URI = "ER_MISSING_NS_URI";
- public static final String ER_MISSING_ARG_FOR_OPTION =
- "ER_MISSING_ARG_FOR_OPTION";
- public static final String ER_INVALID_OPTION = "ER_INVALID_OPTION";
- public static final String ER_MALFORMED_FORMAT_STRING =
- "ER_MALFORMED_FORMAT_STRING";
- public static final String ER_STYLESHEET_REQUIRES_VERSION_ATTRIB =
- "ER_STYLESHEET_REQUIRES_VERSION_ATTRIB";
- public static final String ER_ILLEGAL_ATTRIBUTE_VALUE =
- "ER_ILLEGAL_ATTRIBUTE_VALUE";
- public static final String ER_CHOOSE_REQUIRES_WHEN ="ER_CHOOSE_REQUIRES_WHEN";
- public static final String ER_NO_APPLY_IMPORT_IN_FOR_EACH =
- "ER_NO_APPLY_IMPORT_IN_FOR_EACH";
- public static final String ER_CANT_USE_DTM_FOR_OUTPUT =
- "ER_CANT_USE_DTM_FOR_OUTPUT";
- public static final String ER_CANT_USE_DTM_FOR_INPUT =
- "ER_CANT_USE_DTM_FOR_INPUT";
- public static final String ER_CALL_TO_EXT_FAILED = "ER_CALL_TO_EXT_FAILED";
- public static final String ER_PREFIX_MUST_RESOLVE = "ER_PREFIX_MUST_RESOLVE";
- public static final String ER_INVALID_UTF16_SURROGATE =
- "ER_INVALID_UTF16_SURROGATE";
- public static final String ER_XSLATTRSET_USED_ITSELF =
- "ER_XSLATTRSET_USED_ITSELF";
- public static final String ER_CANNOT_MIX_XERCESDOM ="ER_CANNOT_MIX_XERCESDOM";
- public static final String ER_TOO_MANY_LISTENERS = "ER_TOO_MANY_LISTENERS";
- public static final String ER_IN_ELEMTEMPLATEELEM_READOBJECT =
- "ER_IN_ELEMTEMPLATEELEM_READOBJECT";
- public static final String ER_DUPLICATE_NAMED_TEMPLATE =
- "ER_DUPLICATE_NAMED_TEMPLATE";
- public static final String ER_INVALID_KEY_CALL = "ER_INVALID_KEY_CALL";
- public static final String ER_REFERENCING_ITSELF = "ER_REFERENCING_ITSELF";
- public static final String ER_ILLEGAL_DOMSOURCE_INPUT =
- "ER_ILLEGAL_DOMSOURCE_INPUT";
- public static final String ER_CLASS_NOT_FOUND_FOR_OPTION =
- "ER_CLASS_NOT_FOUND_FOR_OPTION";
- public static final String ER_REQUIRED_ELEM_NOT_FOUND =
- "ER_REQUIRED_ELEM_NOT_FOUND";
- public static final String ER_INPUT_CANNOT_BE_NULL ="ER_INPUT_CANNOT_BE_NULL";
- public static final String ER_URI_CANNOT_BE_NULL = "ER_URI_CANNOT_BE_NULL";
- public static final String ER_FILE_CANNOT_BE_NULL = "ER_FILE_CANNOT_BE_NULL";
- public static final String ER_SOURCE_CANNOT_BE_NULL =
- "ER_SOURCE_CANNOT_BE_NULL";
- public static final String ER_CANNOT_INIT_BSFMGR = "ER_CANNOT_INIT_BSFMGR";
- public static final String ER_CANNOT_CMPL_EXTENSN = "ER_CANNOT_CMPL_EXTENSN";
- public static final String ER_CANNOT_CREATE_EXTENSN =
- "ER_CANNOT_CREATE_EXTENSN";
- public static final String ER_INSTANCE_MTHD_CALL_REQUIRES =
- "ER_INSTANCE_MTHD_CALL_REQUIRES";
- public static final String ER_INVALID_ELEMENT_NAME ="ER_INVALID_ELEMENT_NAME";
- public static final String ER_ELEMENT_NAME_METHOD_STATIC =
- "ER_ELEMENT_NAME_METHOD_STATIC";
- public static final String ER_EXTENSION_FUNC_UNKNOWN =
- "ER_EXTENSION_FUNC_UNKNOWN";
- public static final String ER_MORE_MATCH_CONSTRUCTOR =
- "ER_MORE_MATCH_CONSTRUCTOR";
- public static final String ER_MORE_MATCH_METHOD = "ER_MORE_MATCH_METHOD";
- public static final String ER_MORE_MATCH_ELEMENT = "ER_MORE_MATCH_ELEMENT";
- public static final String ER_INVALID_CONTEXT_PASSED =
- "ER_INVALID_CONTEXT_PASSED";
- public static final String ER_POOL_EXISTS = "ER_POOL_EXISTS";
- public static final String ER_NO_DRIVER_NAME = "ER_NO_DRIVER_NAME";
- public static final String ER_NO_URL = "ER_NO_URL";
- public static final String ER_POOL_SIZE_LESSTHAN_ONE =
- "ER_POOL_SIZE_LESSTHAN_ONE";
- public static final String ER_INVALID_DRIVER = "ER_INVALID_DRIVER";
- public static final String ER_NO_STYLESHEETROOT = "ER_NO_STYLESHEETROOT";
- public static final String ER_ILLEGAL_XMLSPACE_VALUE =
- "ER_ILLEGAL_XMLSPACE_VALUE";
- public static final String ER_PROCESSFROMNODE_FAILED =
- "ER_PROCESSFROMNODE_FAILED";
- public static final String ER_RESOURCE_COULD_NOT_LOAD =
- "ER_RESOURCE_COULD_NOT_LOAD";
- public static final String ER_BUFFER_SIZE_LESSTHAN_ZERO =
- "ER_BUFFER_SIZE_LESSTHAN_ZERO";
- public static final String ER_UNKNOWN_ERROR_CALLING_EXTENSION =
- "ER_UNKNOWN_ERROR_CALLING_EXTENSION";
- public static final String ER_NO_NAMESPACE_DECL = "ER_NO_NAMESPACE_DECL";
- public static final String ER_ELEM_CONTENT_NOT_ALLOWED =
- "ER_ELEM_CONTENT_NOT_ALLOWED";
- public static final String ER_STYLESHEET_DIRECTED_TERMINATION =
- "ER_STYLESHEET_DIRECTED_TERMINATION";
- public static final String ER_ONE_OR_TWO = "ER_ONE_OR_TWO";
- public static final String ER_TWO_OR_THREE = "ER_TWO_OR_THREE";
- public static final String ER_COULD_NOT_LOAD_RESOURCE =
- "ER_COULD_NOT_LOAD_RESOURCE";
- public static final String ER_CANNOT_INIT_DEFAULT_TEMPLATES =
- "ER_CANNOT_INIT_DEFAULT_TEMPLATES";
- public static final String ER_RESULT_NULL = "ER_RESULT_NULL";
- public static final String ER_RESULT_COULD_NOT_BE_SET =
- "ER_RESULT_COULD_NOT_BE_SET";
- public static final String ER_NO_OUTPUT_SPECIFIED = "ER_NO_OUTPUT_SPECIFIED";
- public static final String ER_CANNOT_TRANSFORM_TO_RESULT_TYPE =
- "ER_CANNOT_TRANSFORM_TO_RESULT_TYPE";
- public static final String ER_CANNOT_TRANSFORM_SOURCE_TYPE =
- "ER_CANNOT_TRANSFORM_SOURCE_TYPE";
- public static final String ER_NULL_CONTENT_HANDLER ="ER_NULL_CONTENT_HANDLER";
- public static final String ER_NULL_ERROR_HANDLER = "ER_NULL_ERROR_HANDLER";
- public static final String ER_CANNOT_CALL_PARSE = "ER_CANNOT_CALL_PARSE";
- public static final String ER_NO_PARENT_FOR_FILTER ="ER_NO_PARENT_FOR_FILTER";
- public static final String ER_NO_STYLESHEET_IN_MEDIA =
- "ER_NO_STYLESHEET_IN_MEDIA";
- public static final String ER_NO_STYLESHEET_PI = "ER_NO_STYLESHEET_PI";
- public static final String ER_NOT_SUPPORTED = "ER_NOT_SUPPORTED";
- public static final String ER_PROPERTY_VALUE_BOOLEAN =
- "ER_PROPERTY_VALUE_BOOLEAN";
- public static final String ER_COULD_NOT_FIND_EXTERN_SCRIPT =
- "ER_COULD_NOT_FIND_EXTERN_SCRIPT";
- public static final String ER_RESOURCE_COULD_NOT_FIND =
- "ER_RESOURCE_COULD_NOT_FIND";
- public static final String ER_OUTPUT_PROPERTY_NOT_RECOGNIZED =
- "ER_OUTPUT_PROPERTY_NOT_RECOGNIZED";
- public static final String ER_FAILED_CREATING_ELEMLITRSLT =
- "ER_FAILED_CREATING_ELEMLITRSLT";
- public static final String ER_VALUE_SHOULD_BE_NUMBER =
- "ER_VALUE_SHOULD_BE_NUMBER";
- public static final String ER_VALUE_SHOULD_EQUAL = "ER_VALUE_SHOULD_EQUAL";
- public static final String ER_FAILED_CALLING_METHOD =
- "ER_FAILED_CALLING_METHOD";
- public static final String ER_FAILED_CREATING_ELEMTMPL =
- "ER_FAILED_CREATING_ELEMTMPL";
- public static final String ER_CHARS_NOT_ALLOWED = "ER_CHARS_NOT_ALLOWED";
- public static final String ER_ATTR_NOT_ALLOWED = "ER_ATTR_NOT_ALLOWED";
- public static final String ER_BAD_VALUE = "ER_BAD_VALUE";
- public static final String ER_ATTRIB_VALUE_NOT_FOUND =
- "ER_ATTRIB_VALUE_NOT_FOUND";
- public static final String ER_ATTRIB_VALUE_NOT_RECOGNIZED =
- "ER_ATTRIB_VALUE_NOT_RECOGNIZED";
- public static final String ER_NULL_URI_NAMESPACE = "ER_NULL_URI_NAMESPACE";
- public static final String ER_NUMBER_TOO_BIG = "ER_NUMBER_TOO_BIG";
- public static final String ER_CANNOT_FIND_SAX1_DRIVER =
- "ER_CANNOT_FIND_SAX1_DRIVER";
- public static final String ER_SAX1_DRIVER_NOT_LOADED =
- "ER_SAX1_DRIVER_NOT_LOADED";
- public static final String ER_SAX1_DRIVER_NOT_INSTANTIATED =
- "ER_SAX1_DRIVER_NOT_INSTANTIATED" ;
- public static final String ER_SAX1_DRIVER_NOT_IMPLEMENT_PARSER =
- "ER_SAX1_DRIVER_NOT_IMPLEMENT_PARSER";
- public static final String ER_PARSER_PROPERTY_NOT_SPECIFIED =
- "ER_PARSER_PROPERTY_NOT_SPECIFIED";
- public static final String ER_PARSER_ARG_CANNOT_BE_NULL =
- "ER_PARSER_ARG_CANNOT_BE_NULL" ;
- public static final String ER_FEATURE = "ER_FEATURE";
- public static final String ER_PROPERTY = "ER_PROPERTY" ;
- public static final String ER_NULL_ENTITY_RESOLVER ="ER_NULL_ENTITY_RESOLVER";
- public static final String ER_NULL_DTD_HANDLER = "ER_NULL_DTD_HANDLER" ;
- public static final String ER_NO_DRIVER_NAME_SPECIFIED =
- "ER_NO_DRIVER_NAME_SPECIFIED";
- public static final String ER_NO_URL_SPECIFIED = "ER_NO_URL_SPECIFIED";
- public static final String ER_POOLSIZE_LESS_THAN_ONE =
- "ER_POOLSIZE_LESS_THAN_ONE";
- public static final String ER_INVALID_DRIVER_NAME = "ER_INVALID_DRIVER_NAME";
- public static final String ER_ERRORLISTENER = "ER_ERRORLISTENER";
- public static final String ER_ASSERT_NO_TEMPLATE_PARENT =
- "ER_ASSERT_NO_TEMPLATE_PARENT";
- public static final String ER_ASSERT_REDUNDENT_EXPR_ELIMINATOR =
- "ER_ASSERT_REDUNDENT_EXPR_ELIMINATOR";
- public static final String ER_NOT_ALLOWED_IN_POSITION =
- "ER_NOT_ALLOWED_IN_POSITION";
- public static final String ER_NONWHITESPACE_NOT_ALLOWED_IN_POSITION =
- "ER_NONWHITESPACE_NOT_ALLOWED_IN_POSITION";
- public static final String ER_NAMESPACE_CONTEXT_NULL_NAMESPACE =
- "ER_NAMESPACE_CONTEXT_NULL_NAMESPACE";
- public static final String ER_NAMESPACE_CONTEXT_NULL_PREFIX =
- "ER_NAMESPACE_CONTEXT_NULL_PREFIX";
- public static final String ER_XPATH_RESOLVER_NULL_QNAME =
- "ER_XPATH_RESOLVER_NULL_QNAME";
- public static final String ER_XPATH_RESOLVER_NEGATIVE_ARITY =
- "ER_XPATH_RESOLVER_NEGATIVE_ARITY";
- public static final String INVALID_TCHAR = "INVALID_TCHAR";
- public static final String INVALID_QNAME = "INVALID_QNAME";
- public static final String INVALID_ENUM = "INVALID_ENUM";
- public static final String INVALID_NMTOKEN = "INVALID_NMTOKEN";
- public static final String INVALID_NCNAME = "INVALID_NCNAME";
- public static final String INVALID_BOOLEAN = "INVALID_BOOLEAN";
- public static final String INVALID_NUMBER = "INVALID_NUMBER";
- public static final String ER_ARG_LITERAL = "ER_ARG_LITERAL";
- public static final String ER_DUPLICATE_GLOBAL_VAR ="ER_DUPLICATE_GLOBAL_VAR";
- public static final String ER_DUPLICATE_VAR = "ER_DUPLICATE_VAR";
- public static final String ER_TEMPLATE_NAME_MATCH = "ER_TEMPLATE_NAME_MATCH";
- public static final String ER_INVALID_PREFIX = "ER_INVALID_PREFIX";
- public static final String ER_NO_ATTRIB_SET = "ER_NO_ATTRIB_SET";
- public static final String ER_FUNCTION_NOT_FOUND =
- "ER_FUNCTION_NOT_FOUND";
- public static final String ER_CANT_HAVE_CONTENT_AND_SELECT =
- "ER_CANT_HAVE_CONTENT_AND_SELECT";
- public static final String ER_INVALID_SET_PARAM_VALUE = "ER_INVALID_SET_PARAM_VALUE";
- public static final String ER_SET_FEATURE_NULL_NAME =
- "ER_SET_FEATURE_NULL_NAME";
- public static final String ER_GET_FEATURE_NULL_NAME =
- "ER_GET_FEATURE_NULL_NAME";
- public static final String ER_UNSUPPORTED_FEATURE =
- "ER_UNSUPPORTED_FEATURE";
- public static final String ER_EXTENSION_ELEMENT_NOT_ALLOWED_IN_SECURE_PROCESSING =
- "ER_EXTENSION_ELEMENT_NOT_ALLOWED_IN_SECURE_PROCESSING";
-
- public static final String WG_FOUND_CURLYBRACE = "WG_FOUND_CURLYBRACE";
- public static final String WG_COUNT_ATTRIB_MATCHES_NO_ANCESTOR =
- "WG_COUNT_ATTRIB_MATCHES_NO_ANCESTOR";
- public static final String WG_EXPR_ATTRIB_CHANGED_TO_SELECT =
- "WG_EXPR_ATTRIB_CHANGED_TO_SELECT";
- public static final String WG_NO_LOCALE_IN_FORMATNUMBER =
- "WG_NO_LOCALE_IN_FORMATNUMBER";
- public static final String WG_LOCALE_NOT_FOUND = "WG_LOCALE_NOT_FOUND";
- public static final String WG_CANNOT_MAKE_URL_FROM ="WG_CANNOT_MAKE_URL_FROM";
- public static final String WG_CANNOT_LOAD_REQUESTED_DOC =
- "WG_CANNOT_LOAD_REQUESTED_DOC";
- public static final String WG_CANNOT_FIND_COLLATOR ="WG_CANNOT_FIND_COLLATOR";
- public static final String WG_FUNCTIONS_SHOULD_USE_URL =
- "WG_FUNCTIONS_SHOULD_USE_URL";
- public static final String WG_ENCODING_NOT_SUPPORTED_USING_UTF8 =
- "WG_ENCODING_NOT_SUPPORTED_USING_UTF8";
- public static final String WG_ENCODING_NOT_SUPPORTED_USING_JAVA =
- "WG_ENCODING_NOT_SUPPORTED_USING_JAVA";
- public static final String WG_SPECIFICITY_CONFLICTS =
- "WG_SPECIFICITY_CONFLICTS";
- public static final String WG_PARSING_AND_PREPARING =
- "WG_PARSING_AND_PREPARING";
- public static final String WG_ATTR_TEMPLATE = "WG_ATTR_TEMPLATE";
- public static final String WG_CONFLICT_BETWEEN_XSLSTRIPSPACE_AND_XSLPRESERVESPACE = "WG_CONFLICT_BETWEEN_XSLSTRIPSPACE_AND_XSLPRESERVESP";
- public static final String WG_ATTRIB_NOT_HANDLED = "WG_ATTRIB_NOT_HANDLED";
- public static final String WG_NO_DECIMALFORMAT_DECLARATION =
- "WG_NO_DECIMALFORMAT_DECLARATION";
- public static final String WG_OLD_XSLT_NS = "WG_OLD_XSLT_NS";
- public static final String WG_ONE_DEFAULT_XSLDECIMALFORMAT_ALLOWED =
- "WG_ONE_DEFAULT_XSLDECIMALFORMAT_ALLOWED";
- public static final String WG_XSLDECIMALFORMAT_NAMES_MUST_BE_UNIQUE =
- "WG_XSLDECIMALFORMAT_NAMES_MUST_BE_UNIQUE";
- public static final String WG_ILLEGAL_ATTRIBUTE = "WG_ILLEGAL_ATTRIBUTE";
- public static final String WG_COULD_NOT_RESOLVE_PREFIX =
- "WG_COULD_NOT_RESOLVE_PREFIX";
- public static final String WG_STYLESHEET_REQUIRES_VERSION_ATTRIB =
- "WG_STYLESHEET_REQUIRES_VERSION_ATTRIB";
- public static final String WG_ILLEGAL_ATTRIBUTE_NAME =
- "WG_ILLEGAL_ATTRIBUTE_NAME";
- public static final String WG_ILLEGAL_ATTRIBUTE_VALUE =
- "WG_ILLEGAL_ATTRIBUTE_VALUE";
- public static final String WG_EMPTY_SECOND_ARG = "WG_EMPTY_SECOND_ARG";
- public static final String WG_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML =
- "WG_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML";
- public static final String WG_PROCESSINGINSTRUCTION_NOTVALID_NCNAME =
- "WG_PROCESSINGINSTRUCTION_NOTVALID_NCNAME";
- public static final String WG_ILLEGAL_ATTRIBUTE_POSITION =
- "WG_ILLEGAL_ATTRIBUTE_POSITION";
- public static final String NO_MODIFICATION_ALLOWED_ERR =
- "NO_MODIFICATION_ALLOWED_ERR";
-
- /*
- * Now fill in the message text.
- * Then fill in the message text for that message code in the
- * array. Use the new error code as the index into the array.
- */
-
- // Error messages...
-
- /** Get the lookup table for error messages.
- *
- * @return The message lookup table.
- */
- public Object[][] getContents()
- {
- return new Object[][] {
-
- /** Error message ID that has a null message, but takes in a single object. */
- {"ER0000" , "{0}" },
-
- { ER_NO_CURLYBRACE,
- "Error: no puede haber'{' en la expresi\u00F3n"},
-
- { ER_ILLEGAL_ATTRIBUTE ,
- "{0} tiene un atributo no permitido: {1}"},
-
- {ER_NULL_SOURCENODE_APPLYIMPORTS ,
- "sourceNode es nulo en xsl:apply-imports."},
-
- {ER_CANNOT_ADD,
- "No se puede agregar {0} a {1}"},
-
- { ER_NULL_SOURCENODE_HANDLEAPPLYTEMPLATES,
- "sourceNode es nulo en handleApplyTemplatesInstruction"},
-
- { ER_NO_NAME_ATTRIB,
- "{0} debe tener un atributo name."},
-
- {ER_TEMPLATE_NOT_FOUND,
- "No se ha encontrado la plantilla llamada: {0}"},
-
- {ER_CANT_RESOLVE_NAME_AVT,
- "No se ha podido resolver el AVT del nombre en xsl:call-template."},
-
- {ER_REQUIRES_ATTRIB,
- "{0} necesita el atributo: {1}"},
-
- { ER_MUST_HAVE_TEST_ATTRIB,
- "{0} debe tener un atributo ''test''."},
-
- {ER_BAD_VAL_ON_LEVEL_ATTRIB,
- "Valor err\u00F3neo en el atributo level: {0}"},
-
- {ER_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML,
- "el nombre de instrucci\u00F3n de procesamiento no puede ser 'xml'"},
-
- { ER_PROCESSINGINSTRUCTION_NOTVALID_NCNAME,
- "el nombre de instrucci\u00F3n de procesamiento debe ser un NCName v\u00E1lido: {0}"},
-
- { ER_NEED_MATCH_ATTRIB,
- "{0} debe tener un atributo match si tiene un modo."},
-
- { ER_NEED_NAME_OR_MATCH_ATTRIB,
- "{0} necesita un atributo name o match."},
-
- {ER_CANT_RESOLVE_NSPREFIX,
- "No se puede resolver el prefijo de espacio de nombres: {0}"},
-
- { ER_ILLEGAL_VALUE,
- "xml:space tiene un valor no permitido: {0}"},
-
- { ER_NO_OWNERDOC,
- "El nodo secundario no tiene un documento de propietario."},
-
- { ER_ELEMTEMPLATEELEM_ERR,
- "Error de ElemTemplateElement: {0}"},
-
- { ER_NULL_CHILD,
- "Intentando agregar un secundario nulo."},
-
- { ER_NEED_SELECT_ATTRIB,
- "{0} necesita un atributo select."},
-
- { ER_NEED_TEST_ATTRIB ,
- "xsl:when debe tener un atributo 'test'."},
-
- { ER_NEED_NAME_ATTRIB,
- "xsl:with-param debe tener un atributo 'name'."},
-
- { ER_NO_CONTEXT_OWNERDOC,
- "El contexto no tiene un documento de propietario."},
-
- {ER_COULD_NOT_CREATE_XML_PROC_LIAISON,
- "No se ha podido crear el enlace TransformerFactory XML: {0}"},
-
- {ER_PROCESS_NOT_SUCCESSFUL,
- "Xalan: el proceso no se ha realizado correctamente."},
-
- { ER_NOT_SUCCESSFUL,
- "Xalan: no se ha realizado correctamente."},
-
- { ER_ENCODING_NOT_SUPPORTED,
- "Codificaci\u00F3n no soportada: {0}"},
-
- {ER_COULD_NOT_CREATE_TRACELISTENER,
- "No se ha podido crear TraceListener: {0}"},
-
- {ER_KEY_REQUIRES_NAME_ATTRIB,
- "xsl:key necesita un atributo 'name'."},
-
- { ER_KEY_REQUIRES_MATCH_ATTRIB,
- "xsl:key necesita un atributo 'match'."},
-
- { ER_KEY_REQUIRES_USE_ATTRIB,
- "xsl:key necesita un atributo 'use'."},
-
- { ER_REQUIRES_ELEMENTS_ATTRIB,
- "(StylesheetHandler) {0} necesita un atributo ''elements''."},
-
- { ER_MISSING_PREFIX_ATTRIB,
- "(StylesheetHandler) Falta el valor de ''prefix'' del atributo {0}"},
-
- { ER_BAD_STYLESHEET_URL,
- "La URL de hoja de estilo no es v\u00E1lida: {0}"},
-
- { ER_FILE_NOT_FOUND,
- "No se ha encontrado el archivo de hoja de estilo: {0}"},
-
- { ER_IOEXCEPTION,
- "Ten\u00EDa una excepci\u00F3n de E/S con el archivo de hoja de estilo: {0}"},
-
- { ER_NO_HREF_ATTRIB,
- "(StylesheetHandler) No se ha encontrado el atributo href para {0}"},
-
- { ER_STYLESHEET_INCLUDES_ITSELF,
- "(StylesheetHandler) {0} se incluye directa o indirectamente."},
-
- { ER_PROCESSINCLUDE_ERROR,
- "Error de StylesheetHandler.processInclude, {0}"},
-
- { ER_MISSING_LANG_ATTRIB,
- "(StylesheetHandler) Falta el atributo ''lang'' {0}"},
-
- { ER_MISSING_CONTAINER_ELEMENT_COMPONENT,
- "(StylesheetHandler) \u00BFElemento {0} mal colocado? Falta el elemento contenedor ''component''"},
-
- { ER_CAN_ONLY_OUTPUT_TO_ELEMENT,
- "La salida s\u00F3lo puede realizarse en Element, DocumentFragment, Document o PrintWriter."},
-
- { ER_PROCESS_ERROR,
- "Error de StylesheetRoot.process"},
-
- { ER_UNIMPLNODE_ERROR,
- "Error de UnImplNode: {0}"},
-
- { ER_NO_SELECT_EXPRESSION,
- "\u00A1Error! No se ha encontrado la expresi\u00F3n de selecci\u00F3n xpath (-select)."},
-
- { ER_CANNOT_SERIALIZE_XSLPROCESSOR,
- "No se puede serializar un procesador XSL."},
-
- { ER_NO_INPUT_STYLESHEET,
- "No se ha especificado la entrada de hoja de estilo."},
-
- { ER_FAILED_PROCESS_STYLESHEET,
- "Fallo al procesar la hoja de estilo."},
-
- { ER_COULDNT_PARSE_DOC,
- "No se ha podido analizar el documento {0}."},
-
- { ER_COULDNT_FIND_FRAGMENT,
- "No se ha encontrado el fragmento: {0}"},
-
- { ER_NODE_NOT_ELEMENT,
- "El nodo apuntado por el identificador de fragmento no era un elemento: {0}"},
-
- { ER_FOREACH_NEED_MATCH_OR_NAME_ATTRIB,
- "for-each debe tener un atributo name o match."},
-
- { ER_TEMPLATES_NEED_MATCH_OR_NAME_ATTRIB,
- "las plantillas deben tener un atributo name o match."},
-
- { ER_NO_CLONE_OF_DOCUMENT_FRAG,
- "No hay ninguna clonaci\u00F3n de un fragmento de documento."},
-
- { ER_CANT_CREATE_ITEM,
- "No se puede crear el elemento en el \u00E1rbol de resultados: {0}"},
-
- { ER_XMLSPACE_ILLEGAL_VALUE,
- "xml:space en el XML de origen tiene un valor no v\u00E1lido: {0}"},
-
- { ER_NO_XSLKEY_DECLARATION,
- "No hay ninguna declaraci\u00F3n xsl:key para {0}."},
-
- { ER_CANT_CREATE_URL,
- "Error. No se puede crear la URL para: {0}"},
-
- { ER_XSLFUNCTIONS_UNSUPPORTED,
- "xsl:functions no est\u00E1 soportado"},
-
- { ER_PROCESSOR_ERROR,
- "Error de TransformerFactory de XSLT"},
-
- { ER_NOT_ALLOWED_INSIDE_STYLESHEET,
- "(StylesheetHandler) {0} no permitido en una hoja de estilo."},
-
- { ER_RESULTNS_NOT_SUPPORTED,
- "result-ns ya no est\u00E1 soportado. Utilice xsl:output en su lugar."},
-
- { ER_DEFAULTSPACE_NOT_SUPPORTED,
- "default-space ya no est\u00E1 soportado. Utilice xsl:strip-space o xsl:preserve-space en su lugar."},
-
- { ER_INDENTRESULT_NOT_SUPPORTED,
- "indent-result ya no est\u00E1 soportado. Utilice xsl:output en su lugar."},
-
- { ER_ILLEGAL_ATTRIB,
- "(StylesheetHandler) {0} tiene un atributo no permitido: {1}"},
-
- { ER_UNKNOWN_XSL_ELEM,
- "Elemento XSL desconocido: {0}"},
-
- { ER_BAD_XSLSORT_USE,
- "(StylesheetHandler) xsl:sort s\u00F3lo se puede utilizar con xsl:apply-templates o xsl:for-each."},
-
- { ER_MISPLACED_XSLWHEN,
- "(StylesheetHandler) ha colocado xsl:when incorrectamente."},
-
- { ER_XSLWHEN_NOT_PARENTED_BY_XSLCHOOSE,
- "(StylesheetHandler) xsl:when sin principal de xsl:choose."},
-
- { ER_MISPLACED_XSLOTHERWISE,
- "(StylesheetHandler) ha colocado xsl:otherwise de forma incorrecta."},
-
- { ER_XSLOTHERWISE_NOT_PARENTED_BY_XSLCHOOSE,
- "(StylesheetHandler) xsl:otherwise sin principal de xsl:choose."},
-
- { ER_NOT_ALLOWED_INSIDE_TEMPLATE,
- "(StylesheetHandler) {0} no est\u00E1 permitido en una plantilla."},
-
- { ER_UNKNOWN_EXT_NS_PREFIX,
- "(StylesheetHandler) prefijo {1} de espacio de nombres de extensi\u00F3n {0} desconocido"},
-
- { ER_IMPORTS_AS_FIRST_ELEM,
- "(StylesheetHandler) Las importaciones s\u00F3lo se pueden realizar como los primeros elementos en la hoja de estilo."},
-
- { ER_IMPORTING_ITSELF,
- "(StylesheetHandler) {0} se est\u00E1 importando directa o indirectamente."},
-
- { ER_XMLSPACE_ILLEGAL_VAL,
- "(StylesheetHandler) xml:space tiene un valor no permitido: {0}"},
-
- { ER_PROCESSSTYLESHEET_NOT_SUCCESSFUL,
- "processStylesheet no se ha realizado correctamente."},
-
- { ER_SAX_EXCEPTION,
- "Excepci\u00F3n SAX"},
-
-// add this message to fix bug 21478
- { ER_FUNCTION_NOT_SUPPORTED,
- "Funci\u00F3n no soportada."},
-
- { ER_XSLT_ERROR,
- "Error de XSLT"},
-
- { ER_CURRENCY_SIGN_ILLEGAL,
- "el s\u00EDmbolo de moneda no est\u00E1 permitido en la cadena de patr\u00F3n de formato"},
-
- { ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM,
- "La funci\u00F3n de documento no est\u00E1 soportada en DOM de la hoja de estilo."},
-
- { ER_CANT_RESOLVE_PREFIX_OF_NON_PREFIX_RESOLVER,
- "No se puede resolver el prefijo del sistema de resoluci\u00F3n sin prefijo."},
-
- { ER_REDIRECT_COULDNT_GET_FILENAME,
- "Extensi\u00F3n de redireccionamiento: no se ha podido obtener el nombre de archivo - el atributo file o select debe devolver una cadena v\u00E1lida."},
-
- { ER_CANNOT_BUILD_FORMATTERLISTENER_IN_REDIRECT,
- "No se puede crear FormatterListener en la extensi\u00F3n de redireccionamiento."},
-
- { ER_INVALID_PREFIX_IN_EXCLUDERESULTPREFIX,
- "El prefijo en exclude-result-prefixes no es v\u00E1lido: {0}"},
-
- { ER_MISSING_NS_URI,
- "Falta el URI del espacio de nombres para el prefijo especificado"},
-
- { ER_MISSING_ARG_FOR_OPTION,
- "Falta un argumento para la opci\u00F3n: {0}"},
-
- { ER_INVALID_OPTION,
- "Opci\u00F3n no v\u00E1lida: {0}"},
-
- { ER_MALFORMED_FORMAT_STRING,
- "Cadena con formato incorrecto: {0}"},
-
- { ER_STYLESHEET_REQUIRES_VERSION_ATTRIB,
- "xsl:stylesheet necesita un atributo 'version'."},
-
- { ER_ILLEGAL_ATTRIBUTE_VALUE,
- "El atributo: {0} tiene un valor no permitido: {1}"},
-
- { ER_CHOOSE_REQUIRES_WHEN,
- "xsl:choose necesita un xsl:when"},
-
- { ER_NO_APPLY_IMPORT_IN_FOR_EACH,
- "xsl:apply-imports no permitido en un xsl:for-each"},
-
- { ER_CANT_USE_DTM_FOR_OUTPUT,
- "No se puede utilizar un DTMLiaison para un nodo DOM de salida... transfiera com.sun.org.apache.xpath.internal.DOM2Helper en su lugar,"},
-
- { ER_CANT_USE_DTM_FOR_INPUT,
- "No se puede utilizar un DTMLiaison para un nodo DOM de entrada... transfiera com.sun.org.apache.xpath.internal.DOM2Helper en su lugar,"},
-
- { ER_CALL_TO_EXT_FAILED,
- "Fallo de la llamada al elemento de extensi\u00F3n: {0}"},
-
- { ER_PREFIX_MUST_RESOLVE,
- "El prefijo se debe resolver en un espacio de nombres: {0}"},
-
- { ER_INVALID_UTF16_SURROGATE,
- "\u00BFSe ha detectado un sustituto UTF-16 no v\u00E1lido: {0}?"},
-
- { ER_XSLATTRSET_USED_ITSELF,
- "xsl:attribute-set {0} se utiliza a s\u00ED mismo, lo que causar\u00E1 un bucle infinito."},
-
- { ER_CANNOT_MIX_XERCESDOM,
- "No se puede mezclar una entrada DOM que no es de Xerces con una salida DOM de Xerces."},
-
- { ER_TOO_MANY_LISTENERS,
- "addTraceListenersToStylesheet - TooManyListenersException"},
-
- { ER_IN_ELEMTEMPLATEELEM_READOBJECT,
- "En ElemTemplateElement.readObject: {0}"},
-
- { ER_DUPLICATE_NAMED_TEMPLATE,
- "Se ha encontrado m\u00E1s de una plantilla con el nombre: {0}"},
-
- { ER_INVALID_KEY_CALL,
- "Llamada de funci\u00F3n no v\u00E1lida: las llamadas recursive key() no est\u00E1n permitidas"},
-
- { ER_REFERENCING_ITSELF,
- "La variable {0} hace referencia a s\u00ED misma de forma directa o indirecta."},
-
- { ER_ILLEGAL_DOMSOURCE_INPUT,
- "El nodo de entrada no puede ser nulo para un DOMSource de nuevas plantillas."},
-
- { ER_CLASS_NOT_FOUND_FOR_OPTION,
- "No se ha encontrado el archivo de clase para la opci\u00F3n {0}"},
-
- { ER_REQUIRED_ELEM_NOT_FOUND,
- "No se ha encontrado el elemento necesario: {0}"},
-
- { ER_INPUT_CANNOT_BE_NULL,
- "InputStream no puede ser nulo"},
-
- { ER_URI_CANNOT_BE_NULL,
- "El URI no puede ser nulo"},
-
- { ER_FILE_CANNOT_BE_NULL,
- "El archivo no puede ser nulo"},
-
- { ER_SOURCE_CANNOT_BE_NULL,
- "InputSource no puede ser nulo"},
-
- { ER_CANNOT_INIT_BSFMGR,
- "No se ha podido inicializar el gestor de BSF"},
-
- { ER_CANNOT_CMPL_EXTENSN,
- "No se ha podido compilar la extensi\u00F3n"},
-
- { ER_CANNOT_CREATE_EXTENSN,
- "No se ha podido crear la extensi\u00F3n: {0} debido a: {1}"},
-
- { ER_INSTANCE_MTHD_CALL_REQUIRES,
- "La llamada del m\u00E9todo de instancia al m\u00E9todo {0} necesita una instancia de objeto como primer argumento"},
-
- { ER_INVALID_ELEMENT_NAME,
- "Se ha especificado un nombre de elemento no v\u00E1lido {0}"},
-
- { ER_ELEMENT_NAME_METHOD_STATIC,
- "El m\u00E9todo del nombre del elemento debe ser est\u00E1tico {0}"},
-
- { ER_EXTENSION_FUNC_UNKNOWN,
- "La funci\u00F3n de extensi\u00F3n {0} : {1} es desconocida"},
-
- { ER_MORE_MATCH_CONSTRUCTOR,
- "Hay m\u00E1s de una mejor coincidencia para el constructor de {0}"},
-
- { ER_MORE_MATCH_METHOD,
- "Hay m\u00E1s de una mejor coincidencia para el m\u00E9todo {0}"},
-
- { ER_MORE_MATCH_ELEMENT,
- "Hay m\u00E1s de una mejor coincidencia para el m\u00E9todo de elemento {0}"},
-
- { ER_INVALID_CONTEXT_PASSED,
- "Se ha transferido un contexto no v\u00E1lido para evaluar {0}"},
-
- { ER_POOL_EXISTS,
- "El pool ya existe"},
-
- { ER_NO_DRIVER_NAME,
- "No se ha especificado ning\u00FAn nombre de controlador"},
-
- { ER_NO_URL,
- "No se ha especificado ninguna URL"},
-
- { ER_POOL_SIZE_LESSTHAN_ONE,
- "El tama\u00F1o del pool es inferior a uno."},
-
- { ER_INVALID_DRIVER,
- "Se ha especificado un nombre de controlador no v\u00E1lido."},
-
- { ER_NO_STYLESHEETROOT,
- "No se ha encontrado la ra\u00EDz de la hoja de estilo."},
-
- { ER_ILLEGAL_XMLSPACE_VALUE,
- "Valor no permitido para xml:space"},
-
- { ER_PROCESSFROMNODE_FAILED,
- "Fallo de processFromNode"},
-
- { ER_RESOURCE_COULD_NOT_LOAD,
- "No se ha podido cargar el recurso [ {0} ]: {1} \n {2} \t {3}"},
-
- { ER_BUFFER_SIZE_LESSTHAN_ZERO,
- "Tama\u00F1o de buffer menor o igual que 0"},
-
- { ER_UNKNOWN_ERROR_CALLING_EXTENSION,
- "Error desconocido al llamar a la extensi\u00F3n"},
-
- { ER_NO_NAMESPACE_DECL,
- "El prefijo {0} no tiene una declaraci\u00F3n de espacio de nombres correspondiente"},
-
- { ER_ELEM_CONTENT_NOT_ALLOWED,
- "Contenido de elemento no permitido para lang=javaclass {0}"},
-
- { ER_STYLESHEET_DIRECTED_TERMINATION,
- "Terminaci\u00F3n dirigida de hoja de estilo"},
-
- { ER_ONE_OR_TWO,
- "1 o 2"},
-
- { ER_TWO_OR_THREE,
- "2 o 3"},
-
- { ER_COULD_NOT_LOAD_RESOURCE,
- "No se ha podido cargar {0} (marcar CLASSPATH), actualmente s\u00F3lo se utilizan los valores por defecto"},
-
- { ER_CANNOT_INIT_DEFAULT_TEMPLATES,
- "No se pueden inicializar las plantillas por defecto"},
-
- { ER_RESULT_NULL,
- "El resultado no debe ser nulo"},
-
- { ER_RESULT_COULD_NOT_BE_SET,
- "No se ha podido definir el resultado"},
-
- { ER_NO_OUTPUT_SPECIFIED,
- "No se ha especificado ninguna salida"},
-
- { ER_CANNOT_TRANSFORM_TO_RESULT_TYPE,
- "No se puede transformar en un resultado de tipo {0}"},
-
- { ER_CANNOT_TRANSFORM_SOURCE_TYPE,
- "No se puede transformar en un origen de tipo {0}"},
-
- { ER_NULL_CONTENT_HANDLER,
- "Manejador de contenido nulo"},
-
- { ER_NULL_ERROR_HANDLER,
- "Manejador de errores nulo"},
-
- { ER_CANNOT_CALL_PARSE,
- "no se puede realizar el an\u00E1lisis si no se ha definido el manejador de contenido"},
-
- { ER_NO_PARENT_FOR_FILTER,
- "Ning\u00FAn principal para el filtro"},
-
- { ER_NO_STYLESHEET_IN_MEDIA,
- "No se ha encontrado ninguna hoja de estilo en: {0}, soporte= {1}"},
-
- { ER_NO_STYLESHEET_PI,
- "No se ha encontrado ning\u00FAn PI de hoja de estilo XML en: {0}"},
-
- { ER_NOT_SUPPORTED,
- "No soportado: {0}"},
-
- { ER_PROPERTY_VALUE_BOOLEAN,
- "El valor para la propiedad {0} debe ser una instancia booleana"},
-
- { ER_COULD_NOT_FIND_EXTERN_SCRIPT,
- "No se ha podido obtener un script externo en {0}"},
-
- { ER_RESOURCE_COULD_NOT_FIND,
- "No se ha encontrado el recurso [ {0} ].\n{1}"},
-
- { ER_OUTPUT_PROPERTY_NOT_RECOGNIZED,
- "Propiedad de salida no reconocida: {0}"},
-
- { ER_FAILED_CREATING_ELEMLITRSLT,
- "Fallo al crear la instancia ElemLiteralResult"},
-
- //Earlier (JDK 1.4 XALAN 2.2-D11) at key code '204' the key name was ER_PRIORITY_NOT_PARSABLE
- // In latest Xalan code base key name is ER_VALUE_SHOULD_BE_NUMBER. This should also be taken care
- //in locale specific files like XSLTErrorResources_de.java, XSLTErrorResources_fr.java etc.
- //NOTE: Not only the key name but message has also been changed.
- { ER_VALUE_SHOULD_BE_NUMBER,
- "El valor para {0} no debe contener un n\u00FAmero que pueda analizarse"},
-
- { ER_VALUE_SHOULD_EQUAL,
- "El valor para {0} debe ser igual a s\u00ED o no."},
-
- { ER_FAILED_CALLING_METHOD,
- "Fallo al llamar al m\u00E9todo {0}"},
-
- { ER_FAILED_CREATING_ELEMTMPL,
- "Fallo al crear la instancia ElemTemplateElement"},
-
- { ER_CHARS_NOT_ALLOWED,
- "En este momento, no se permite el uso de caracteres en el documento"},
-
- { ER_ATTR_NOT_ALLOWED,
- "El atributo \"{0}\" no est\u00E1 permitido en el elemento {1}."},
-
- { ER_BAD_VALUE,
- "{0} valor incorrecto {1} "},
-
- { ER_ATTRIB_VALUE_NOT_FOUND,
- "No se ha encontrado el valor del atributo {0} "},
-
- { ER_ATTRIB_VALUE_NOT_RECOGNIZED,
- "El valor del atributo {0} no se ha reconocido "},
-
- { ER_NULL_URI_NAMESPACE,
- "Se est\u00E1 intentando generar un prefijo de espacio de nombres con un URI nulo"},
-
- { ER_NUMBER_TOO_BIG,
- "Se est\u00E1 intentando formatear un n\u00FAmero superior al entero largo m\u00E1s grande"},
-
- { ER_CANNOT_FIND_SAX1_DRIVER,
- "No se ha encontrado la clase de controlador SAX1 {0}"},
-
- { ER_SAX1_DRIVER_NOT_LOADED,
- "Se ha encontrado la clase de controlador SAX1 {0} pero no se puede cargar"},
-
- { ER_SAX1_DRIVER_NOT_INSTANTIATED,
- "Se ha cargado la clase de controlador SAX1 {0} pero no se puede instanciar"},
-
- { ER_SAX1_DRIVER_NOT_IMPLEMENT_PARSER,
- "La clase de controlador SAX1 {0} no implanta org.xml.sax.Parser"},
-
- { ER_PARSER_PROPERTY_NOT_SPECIFIED,
- "No se ha especificado la propiedad del sistema org.xml.sax.parser"},
-
- { ER_PARSER_ARG_CANNOT_BE_NULL,
- "El argumento del analizador no debe ser nulo"},
-
- { ER_FEATURE,
- "Funci\u00F3n: {0}"},
-
- { ER_PROPERTY,
- "Propiedad: {0}"},
-
- { ER_NULL_ENTITY_RESOLVER,
- "Sistema de resoluci\u00F3n de entidades nulo"},
-
- { ER_NULL_DTD_HANDLER,
- "Manejador DTD nulo"},
-
- { ER_NO_DRIVER_NAME_SPECIFIED,
- "No se ha especificado ning\u00FAn nombre de controlador"},
-
- { ER_NO_URL_SPECIFIED,
- "No se ha especificado ninguna URL"},
-
- { ER_POOLSIZE_LESS_THAN_ONE,
- "El tama\u00F1o del pool es inferior a 1."},
-
- { ER_INVALID_DRIVER_NAME,
- "Se ha especificado un nombre de controlador no v\u00E1lido."},
-
- { ER_ERRORLISTENER,
- "ErrorListener"},
-
-
-// Note to translators: The following message should not normally be displayed
-// to users. It describes a situation in which the processor has detected
-// an internal consistency problem in itself, and it provides this message
-// for the developer to help diagnose the problem. The name
-// 'ElemTemplateElement' is the name of a class, and should not be
-// translated.
- { ER_ASSERT_NO_TEMPLATE_PARENT,
- "Error del programador. La expresi\u00F3n no tiene el principal ElemTemplateElement."},
-
-
-// Note to translators: The following message should not normally be displayed
-// to users. It describes a situation in which the processor has detected
-// an internal consistency problem in itself, and it provides this message
-// for the developer to help diagnose the problem. The substitution text
-// provides further information in order to diagnose the problem. The name
-// 'RedundentExprEliminator' is the name of a class, and should not be
-// translated.
- { ER_ASSERT_REDUNDENT_EXPR_ELIMINATOR,
- "Afirmaci\u00F3n del programador en RedundentExprEliminator: {0}"},
-
- { ER_NOT_ALLOWED_IN_POSITION,
- "{0} no est\u00E1 permitido en esta posici\u00F3n de la hoja de estilo."},
-
- { ER_NONWHITESPACE_NOT_ALLOWED_IN_POSITION,
- "El texto distinto de un espacio en blanco no est\u00E1 permitido en esta posici\u00F3n de la hoja de estilo."},
-
- // This code is shared with warning codes.
- // SystemId Unknown
- { INVALID_TCHAR,
- "Valor no permitido: {1} utilizado para el atributo CHAR: {0}. Un atributo del tipo CHAR debe tener s\u00F3lo 1 car\u00E1cter."},
-
- // Note to translators: The following message is used if the value of
- // an attribute in a stylesheet is invalid. "QNAME" is the XML data-type of
- // the attribute, and should not be translated. The substitution text {1} is
- // the attribute value and {0} is the attribute name.
- //The following codes are shared with the warning codes...
- { INVALID_QNAME,
- "Valor no permitido: {1} utilizado para el atributo QNAME: {0}"},
-
- // Note to translators: The following message is used if the value of
- // an attribute in a stylesheet is invalid. "ENUM" is the XML data-type of
- // the attribute, and should not be translated. The substitution text {1} is
- // the attribute value, {0} is the attribute name, and {2} is a list of valid
- // values.
- { INVALID_ENUM,
- "Valor no permitido: {1} utilizado para el atributo ENUM: {0}. Los valores v\u00E1lidos son: {2}."},
-
-// Note to translators: The following message is used if the value of
-// an attribute in a stylesheet is invalid. "NMTOKEN" is the XML data-type
-// of the attribute, and should not be translated. The substitution text {1} is
-// the attribute value and {0} is the attribute name.
- { INVALID_NMTOKEN,
- "Valor no permitido: {1} utilizado para el atributo NMTOKEN: {0} "},
-
-// Note to translators: The following message is used if the value of
-// an attribute in a stylesheet is invalid. "NCNAME" is the XML data-type
-// of the attribute, and should not be translated. The substitution text {1} is
-// the attribute value and {0} is the attribute name.
- { INVALID_NCNAME,
- "Valor no permitido: {1} utilizado para el atributo NCNAME: {0} "},
-
-// Note to translators: The following message is used if the value of
-// an attribute in a stylesheet is invalid. "boolean" is the XSLT data-type
-// of the attribute, and should not be translated. The substitution text {1} is
-// the attribute value and {0} is the attribute name.
- { INVALID_BOOLEAN,
- "Valor no permitido: {1} utilizado para el atributo boolean: {0} "},
-
-// Note to translators: The following message is used if the value of
-// an attribute in a stylesheet is invalid. "number" is the XSLT data-type
-// of the attribute, and should not be translated. The substitution text {1} is
-// the attribute value and {0} is the attribute name.
- { INVALID_NUMBER,
- "Valor no permitido: {1} utilizado para el atributo number: {0} "},
-
-
- // End of shared codes...
-
-// Note to translators: A "match pattern" is a special form of XPath expression
-// that is used for matching patterns. The substitution text is the name of
-// a function. The message indicates that when this function is referenced in
-// a match pattern, its argument must be a string literal (or constant.)
-// ER_ARG_LITERAL - new error message for bugzilla //5202
- { ER_ARG_LITERAL,
- "El argumento para {0} en el patr\u00F3n de coincidencia no debe ser un valor literal."},
-
-// Note to translators: The following message indicates that two definitions of
-// a variable. A "global variable" is a variable that is accessible everywher
-// in the stylesheet.
-// ER_DUPLICATE_GLOBAL_VAR - new error message for bugzilla #790
- { ER_DUPLICATE_GLOBAL_VAR,
- "Duplicar declaraci\u00F3n de variable global."},
-
-
-// Note to translators: The following message indicates that two definitions of
-// a variable were encountered.
-// ER_DUPLICATE_VAR - new error message for bugzilla #790
- { ER_DUPLICATE_VAR,
- "Duplicar declaraci\u00F3n de variable."},
-
- // Note to translators: "xsl:template, "name" and "match" are XSLT keywords
- // which must not be translated.
- // ER_TEMPLATE_NAME_MATCH - new error message for bugzilla #789
- { ER_TEMPLATE_NAME_MATCH,
- "xsl:template debe tener un atributo name o match (o ambos)"},
-
- // Note to translators: "exclude-result-prefixes" is an XSLT keyword which
- // should not be translated. The message indicates that a namespace prefix
- // encountered as part of the value of the exclude-result-prefixes attribute
- // was in error.
- // ER_INVALID_PREFIX - new error message for bugzilla #788
- { ER_INVALID_PREFIX,
- "El prefijo en exclude-result-prefixes no es v\u00E1lido: {0}"},
-
- // Note to translators: An "attribute set" is a set of attributes that can
- // be added to an element in the output document as a group. The message
- // indicates that there was a reference to an attribute set named {0} that
- // was never defined.
- // ER_NO_ATTRIB_SET - new error message for bugzilla #782
- { ER_NO_ATTRIB_SET,
- "El juego de atributos con el nombre {0} no existe"},
-
- // Note to translators: This message indicates that there was a reference
- // to a function named {0} for which no function definition could be found.
- { ER_FUNCTION_NOT_FOUND,
- "La funci\u00F3n con el nombre {0} no existe"},
-
- // Note to translators: This message indicates that the XSLT instruction
- // that is named by the substitution text {0} must not contain other XSLT
- // instructions (content) or a "select" attribute. The word "select" is
- // an XSLT keyword in this case and must not be translated.
- { ER_CANT_HAVE_CONTENT_AND_SELECT,
- "El elemento {0} no debe tener contenido ni un atributo select."},
-
- // Note to translators: This message indicates that the value argument
- // of setParameter must be a valid Java Object.
- { ER_INVALID_SET_PARAM_VALUE,
- "El valor del par\u00E1metro {0} debe tener un objeto Java v\u00E1lido"},
-
- { ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX_FOR_DEFAULT,
- "El atributo result-prefix de un elemento xsl:namespace-alias tiene el valor ''#default', pero no hay ninguna declaraci\u00F3n del espacio de nombres por defecto en el \u00E1mbito para el elemento"},
-
- { ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX,
- "El atributo result-prefix de un elemento xsl:namespace-alias tiene el valor ''{0}'', pero no hay ninguna declaraci\u00F3n del espacio de nombres para el prefijo ''{0}'' en el \u00E1mbito para el elemento."},
-
- { ER_SET_FEATURE_NULL_NAME,
- "El nombre de funci\u00F3n no puede ser nulo en TransformerFactory.setFeature (nombre de cadena, valor booleano)."},
-
- { ER_GET_FEATURE_NULL_NAME,
- "El nombre de funci\u00F3n no puede ser nulo en TransformerFactory.getFeature (nombre de cadena)."},
-
- { ER_UNSUPPORTED_FEATURE,
- "No se puede definir la funci\u00F3n ''{0}''en esta f\u00E1brica del transformador."},
-
- { ER_EXTENSION_ELEMENT_NOT_ALLOWED_IN_SECURE_PROCESSING,
- "La utilizaci\u00F3n del elemento de extensi\u00F3n ''{0}'' no est\u00E1 permitida cuando la funci\u00F3n de procesamiento seguro se ha definido en true."},
-
- { ER_NAMESPACE_CONTEXT_NULL_NAMESPACE,
- "No se puede obtener el prefijo para un URI de espacio de nombres nulo."},
-
- { ER_NAMESPACE_CONTEXT_NULL_PREFIX,
- "No se puede obtener el URI de espacio de nombres para un prefijo nulo."},
-
- { ER_XPATH_RESOLVER_NULL_QNAME,
- "El nombre de la funci\u00F3n no puede ser nulo."},
-
- { ER_XPATH_RESOLVER_NEGATIVE_ARITY,
- "El n\u00FAmero de argumentos no puede ser negativo."},
- // Warnings...
-
- { WG_FOUND_CURLYBRACE,
- "Se han encontrado '}' pero no hay ninguna plantilla de atributos abierta."},
-
- { WG_COUNT_ATTRIB_MATCHES_NO_ANCESTOR,
- "Advertencia: el atributo count no coincide con un ascendiente en el destino xsl:number! = {0}"},
-
- { WG_EXPR_ATTRIB_CHANGED_TO_SELECT,
- "Sintaxis anterior: el nombre del atributo 'expr' se ha cambiado por el de 'select'."},
-
- { WG_NO_LOCALE_IN_FORMATNUMBER,
- "Xalan no maneja a\u00FAn el nombre de configuraci\u00F3n regional en la funci\u00F3n format-number."},
-
- { WG_LOCALE_NOT_FOUND,
- "Advertencia: no se ha encontrado la configuraci\u00F3n regional para xml:lang={0}"},
-
- { WG_CANNOT_MAKE_URL_FROM,
- "No se puede crear la URL desde: {0}"},
-
- { WG_CANNOT_LOAD_REQUESTED_DOC,
- "No se puede cargar el documento solicitado: {0}"},
-
- { WG_CANNOT_FIND_COLLATOR,
- "No se ha encontrado el intercalador para <sort xml:lang={0}"},
-
- { WG_FUNCTIONS_SHOULD_USE_URL,
- "Sintaxis anterior: la instrucci\u00F3n de las funciones debe utilizar una URL de {0}"},
-
- { WG_ENCODING_NOT_SUPPORTED_USING_UTF8,
- "codificaci\u00F3n no soportada: {0}, utilizando UTF-8"},
-
- { WG_ENCODING_NOT_SUPPORTED_USING_JAVA,
- "codificaci\u00F3n no soportada: {0}, utilizando Java {1}"},
-
- { WG_SPECIFICITY_CONFLICTS,
- "Se han encontrado conflictos de precisi\u00F3n: {0} Se utilizar\u00E1 la \u00FAltima encontrada en la hoja de estilo."},
-
- { WG_PARSING_AND_PREPARING,
- "========= Analizando y preparando {0} =========="},
-
- { WG_ATTR_TEMPLATE,
- "Plantilla de atributos, {0}"},
-
- { WG_CONFLICT_BETWEEN_XSLSTRIPSPACE_AND_XSLPRESERVESPACE,
- "Conflicto de coincidencia entre xsl:strip-space y xsl:preserve-space"},
-
- { WG_ATTRIB_NOT_HANDLED,
- "Xalan no maneja a\u00FAn el atributo {0}."},
-
- { WG_NO_DECIMALFORMAT_DECLARATION,
- "No se ha encontrado ninguna declaraci\u00F3n para el formato decimal: {0}"},
-
- { WG_OLD_XSLT_NS,
- "Falta el espacio de nombres XSLT o es incorrecto. "},
-
- { WG_ONE_DEFAULT_XSLDECIMALFORMAT_ALLOWED,
- "S\u00F3lo se permite una declaraci\u00F3n xsl:decimal-format por defecto."},
-
- { WG_XSLDECIMALFORMAT_NAMES_MUST_BE_UNIQUE,
- "Los nombres de xsl:decimal-format deben ser \u00FAnicos. El nombre \"{0}\" se ha duplicado."},
-
- { WG_ILLEGAL_ATTRIBUTE,
- "{0} tiene un atributo no permitido: {1}"},
-
- { WG_COULD_NOT_RESOLVE_PREFIX,
- "No se ha podido resolver el prefijo de espacio de nombres: {0}. El nodo se ignorar\u00E1."},
-
- { WG_STYLESHEET_REQUIRES_VERSION_ATTRIB,
- "xsl:stylesheet necesita un atributo 'version'."},
-
- { WG_ILLEGAL_ATTRIBUTE_NAME,
- "Nombre de atributo no permitido: {0}"},
-
- { WG_ILLEGAL_ATTRIBUTE_VALUE,
- "Se ha utilizado un valor no permitido para el atributo {0}: {1}"},
-
- { WG_EMPTY_SECOND_ARG,
- "El juego de nodos resultante del segundo argumento de la funci\u00F3n del documento est\u00E1 vac\u00EDo. Se ha devuelto un juego de nodos vac\u00EDo."},
-
- //Following are the new WARNING keys added in XALAN code base after Jdk 1.4 (Xalan 2.2-D11)
-
- // Note to translators: "name" and "xsl:processing-instruction" are keywords
- // and must not be translated.
- { WG_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML,
- "El valor del atributo 'name' del nombre de xsl:processing-instruction no debe ser 'xml'"},
-
- // Note to translators: "name" and "xsl:processing-instruction" are keywords
- // and must not be translated. "NCName" is an XML data-type and must not be
- // translated.
- { WG_PROCESSINGINSTRUCTION_NOTVALID_NCNAME,
- "El valor del atributo ''name'' de xsl:processing-instruction debe ser un NCName v\u00E1lido: {0}"},
-
- // Note to translators: This message is reported if the stylesheet that is
- // being processed attempted to construct an XML document with an attribute in a
- // place other than on an element. The substitution text specifies the name of
- // the attribute.
- { WG_ILLEGAL_ATTRIBUTE_POSITION,
- "No se puede agregar el atributo {0} despu\u00E9s de nodos secundarios o antes de que se produzca un elemento. Se ignorar\u00E1 el atributo."},
-
- { NO_MODIFICATION_ALLOWED_ERR,
- "Se ha realizado un intento de modificar un objeto en el que no est\u00E1n permitidas las modificaciones."
- },
-
- //Check: WHY THERE IS A GAP B/W NUMBERS in the XSLTErrorResources properties file?
-
- // Other miscellaneous text used inside the code...
- { "ui_language", "es"},
- { "help_language", "es" },
- { "language", "es" },
- { "BAD_CODE", "El par\u00E1metro para crear un mensaje est\u00E1 fuera de los l\u00EDmites"},
- { "FORMAT_FAILED", "Se ha emitido una excepci\u00F3n durante la llamada a messageFormat"},
- { "version", ">>>>>>> Versi\u00F3n Xalan "},
- { "version2", "<<<<<<<"},
- { "yes", "s\u00ED"},
- { "line", "N\u00BA de L\u00EDnea"},
- { "column","N\u00BA de Columna"},
- { "xsldone", "XSLProcessor: listo"},
-
-
- // Note to translators: The following messages provide usage information
- // for the Xalan Process command line. "Process" is the name of a Java class,
- // and should not be translated.
- { "xslProc_option", "Opciones de la clase Process de la l\u00EDnea de comandos Xalan-J :"},
- { "xslProc_option", "Opciones de la clase Process de la l\u00EDnea de comandos Xalan-J :"},
- { "xslProc_invalid_xsltc_option", "La opci\u00F3n {0} no est\u00E1 soportada en el modo XSLTC."},
- { "xslProc_invalid_xalan_option", "La opci\u00F3n {0} s\u00F3lo puede utilizarse con -XSLTC."},
- { "xslProc_no_input", "Error: no se ha especificado ninguna hoja de estilo o XML de entrada. Ejecute este comando sin ninguna opci\u00F3n para las instrucciones de uso."},
- { "xslProc_common_options", "-Opciones Comunes-"},
- { "xslProc_xalan_options", "-Opciones para Xalan-"},
- { "xslProc_xsltc_options", "-Opciones para XSLTC-"},
- { "xslProc_return_to_continue", "(pulse <intro> para continuar)"},
-
- // Note to translators: The option name and the parameter name do not need to
- // be translated. Only translate the messages in parentheses. Note also that
- // leading whitespace in the messages is used to indent the usage information
- // for each option in the English messages.
- // Do not translate the keywords: XSLTC, SAX, DOM and DTM.
- { "optionXSLTC", " [-XSLTC (utilizar XSLTC para la transformaci\u00F3n)]"},
- { "optionIN", " [-IN inputXMLURL]"},
- { "optionXSL", " [-XSL XSLTransformationURL]"},
- { "optionOUT", " [-OUT outputFileName]"},
- { "optionLXCIN", " [-LXCIN compiledStylesheetFileNameIn]"},
- { "optionLXCOUT", " [-LXCOUT compiledStylesheetFileNameOutOut]"},
- { "optionPARSER", " [-PARSER nombre de clase totalmente cualificado de enlace de analizador]"},
- { "optionE", " [-E (No ampliar referencias de entidad)]"},
- { "optionV", " [-E (No ampliar referencias de entidad)]"},
- { "optionQC", " [-QC (Advertencias de Conflictos de Patr\u00F3n Silencioso)]"},
- { "optionQ", " [-Q (Modo Silencioso)]"},
- { "optionLF", " [-LF (Utilizar saltos de l\u00EDnea s\u00F3lo en la salida {el valor por defecto es CR/LF})]"},
- { "optionCR", " [-CR (Utilizar retornos de carro s\u00F3lo en la salida {el valor por defecto es CR/LF})]"},
- { "optionESCAPE", " [-ESCAPE (Caracteres para introducir escape {el valor por defecto es <>&\"'\\r\\n}]"},
- { "optionINDENT", " [-INDENT (Control del n\u00FAmero de espacios para el sangrado {el valor por defecto es 0})]"},
- { "optionTT", " [-TT (Rastrear las plantillas como si se estuviesen llamando.)]"},
- { "optionTG", " [-TG (Rastrear cada evento de generaci\u00F3n.)]"},
- { "optionTS", " [-TS (Rastrear cada evento de selecci\u00F3n.)]"},
- { "optionTTC", " [-TTC (Rastrear los secundarios de plantilla como si se estuviesen procesando.)]"},
- { "optionTCLASS", " [-TCLASS (Clase TraceListener para las extensiones de rastreo.)]"},
- { "optionVALIDATE", " [-VALIDATE (Determinar si se produce la validaci\u00F3n. La validaci\u00F3n est\u00E1 desactivada por defecto.)]"},
- { "optionEDUMP", " [-EDUMP {nombre de archivo opcional} (Realizar volcado de pila si se produce el error.)]"},
- { "optionXML", " [-XML (Utilizar el formateador XML y agregar una cabecera XML.)]"},
- { "optionTEXT", " [-TEXT (Utilizar el formateador de texto simple.)]"},
- { "optionHTML", " [-HTML (Utilizar el formateador HTML.)]"},
- { "optionPARAM", " [-PARAM expresi\u00F3n de nombre (Definir un par\u00E1metro de hoja de estilo)]"},
- { "noParsermsg1", "El proceso XSL no se ha realizado correctamente."},
- { "noParsermsg2", "** No se ha encontrado el analizador **"},
- { "noParsermsg3", "Compruebe la classpath."},
- { "noParsermsg4", "Si no tiene un analizador XML de IBM para Java, puede descargarlo de"},
- { "noParsermsg5", "AlphaWorks de IBM: http://www.alphaworks.ibm.com/formula/xml"},
- { "optionURIRESOLVER", " [-URIRESOLVER nombre de clase completo (URIResolver se puede utilizar para resolver los URI)]"},
- { "optionENTITYRESOLVER", " [-ENTITYRESOLVER nombre de clase completo (EntityResolver utilizado para resolver entidades)]"},
- { "optionCONTENTHANDLER", " [-CONTENTHANDLER nombre de clase completo (ContentHandler utilizado para serializar la salida)]"},
- { "optionLINENUMBERS", " [-L utilizar n\u00FAmeros de l\u00EDnea para el documento de origen]"},
- { "optionSECUREPROCESSING", " [-SECURE (definir la funci\u00F3n de procesamiento seguro en true.)]"},
-
- // Following are the new options added in XSLTErrorResources.properties files after Jdk 1.4 (Xalan 2.2-D11)
-
-
- { "optionMEDIA", " [-MEDIA mediaType (utilice el atributo media para buscar la hoja de estilo asociada a un documento.)]"},
- { "optionFLAVOR", " [-FLAVOR flavorName (Utilizar expl\u00EDcitamente s2s=SAX o d2d=DOM para realizar la transformaci\u00F3n.)] "}, // Added by sboag/scurcuru; experimental
- { "optionDIAG", " [-DIAG (Imprimir tiempo total en milisegundos para la transformaci\u00F3n.)]"},
- { "optionINCREMENTAL", " [-INCREMENTAL (para solicitar la construcci\u00F3n DTM incremental, defina http://xml.apache.org/xalan/features/incremental en true.)]"},
- { "optionNOOPTIMIMIZE", " [-NOOPTIMIMIZE (para solicitar que no se produzca ning\u00FAn procesamiento de optimizaci\u00F3n de hoja de estilo, defina http://xml.apache.org/xalan/features/optimize en false.)]"},
- { "optionRL", " [-RL recursionlimit (afirmar l\u00EDmite num\u00E9rico en la profundidad de recursi\u00F3n de la hoja de estilo.)]"},
- { "optionXO", " [-XO [transletName] (asignar el nombre al translet generado)]"},
- { "optionXD", " [-XD destinationDirectory (especificar un directorio de destino para translet)]"},
- { "optionXJ", " [-XJ jarfile (empaqueta las clases de translet en un archivo jar llamado <archivo jar>)]"},
- { "optionXP", " [-XP package (especifica un prefijo de nombre de paquete para todas las clases de translet generadas)]"},
-
- //AddITIONAL STRINGS that need L10n
- // Note to translators: The following message describes usage of a particular
- // command-line option that is used to enable the "template inlining"
- // optimization. The optimization involves making a copy of the code
- // generated for a template in another template that refers to it.
- { "optionXN", " [-XN (permite poner en l\u00EDnea la plantilla)]" },
- { "optionXX", " [-XX (activa una salida de mensaje de depuraci\u00F3n adicional)]"},
- { "optionXT" , " [-XT (utilizar translet para la transformaci\u00F3n si es posible)]"},
- { "diagTiming"," --------- La transformaci\u00F3n de {0} mediante {1} ha tardado {2} ms" },
- { "recursionTooDeep","El anidamiento de plantilla es demasiado profundo. Anidamiento = {0}, plantilla {1} {2}" },
- { "nameIs", "el nombre es" },
- { "matchPatternIs", "el patr\u00F3n de coincidencia es" }
-
- };
-
- }
- // ================= INFRASTRUCTURE ======================
-
- /** String for use when a bad error code was encountered. */
- public static final String BAD_CODE = "BAD_CODE";
-
- /** String for use when formatting of the error string failed. */
- public static final String FORMAT_FAILED = "FORMAT_FAILED";
-
- /** General error string. */
- public static final String ERROR_STRING = "#error";
-
- /** String to prepend to error messages. */
- public static final String ERROR_HEADER = "Error: ";
-
- /** String to prepend to warning messages. */
- public static final String WARNING_HEADER = "Warning: ";
-
- /** String to specify the XSLT module. */
- public static final String XSL_HEADER = "XSLT ";
-
- /** String to specify the XML parser module. */
- public static final String XML_HEADER = "XML ";
-
- /** I don't think this is used any more.
- * @deprecated */
- public static final String QUERY_HEADER = "PATTERN ";
-
-
- }
diff --git a/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_fr.java b/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_fr.java
deleted file mode 100644
index 2ffbbba..0000000
--- a/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_fr.java
+++ /dev/null
@@ -1,1447 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xalan.internal.res;
-
-import java.util.ListResourceBundle;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * Set up error messages.
- * We build a two dimensional array of message keys and
- * message strings. In order to add a new message here,
- * you need to first add a String constant. And
- * you need to enter key , value pair as part of contents
- * Array. You also need to update MAX_CODE for error strings
- * and MAX_WARNING for warnings ( Needed for only information
- * purpose )
- */
-public class XSLTErrorResources_fr extends ListResourceBundle
-{
-
-/*
- * This file contains error and warning messages related to Xalan Error
- * Handling.
- *
- * General notes to translators:
- *
- * 1) Xalan (or more properly, Xalan-interpretive) and XSLTC are names of
- * components.
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- * XSLTC is an acronym for XSLT Compiler.
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 5) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 6) "Translet" is an invented term that describes the class file that
- * results from compiling an XML stylesheet into a Java class.
- *
- * 7) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- */
-
- /*
- * Static variables
- */
- public static final String ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX =
- "ER_INVALID_SET_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX";
-
- public static final String ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX_FOR_DEFAULT =
- "ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX_FOR_DEFAULT";
-
- public static final String ER_NO_CURLYBRACE = "ER_NO_CURLYBRACE";
- public static final String ER_FUNCTION_NOT_SUPPORTED = "ER_FUNCTION_NOT_SUPPORTED";
- public static final String ER_ILLEGAL_ATTRIBUTE = "ER_ILLEGAL_ATTRIBUTE";
- public static final String ER_NULL_SOURCENODE_APPLYIMPORTS = "ER_NULL_SOURCENODE_APPLYIMPORTS";
- public static final String ER_CANNOT_ADD = "ER_CANNOT_ADD";
- public static final String ER_NULL_SOURCENODE_HANDLEAPPLYTEMPLATES="ER_NULL_SOURCENODE_HANDLEAPPLYTEMPLATES";
- public static final String ER_NO_NAME_ATTRIB = "ER_NO_NAME_ATTRIB";
- public static final String ER_TEMPLATE_NOT_FOUND = "ER_TEMPLATE_NOT_FOUND";
- public static final String ER_CANT_RESOLVE_NAME_AVT = "ER_CANT_RESOLVE_NAME_AVT";
- public static final String ER_REQUIRES_ATTRIB = "ER_REQUIRES_ATTRIB";
- public static final String ER_MUST_HAVE_TEST_ATTRIB = "ER_MUST_HAVE_TEST_ATTRIB";
- public static final String ER_BAD_VAL_ON_LEVEL_ATTRIB =
- "ER_BAD_VAL_ON_LEVEL_ATTRIB";
- public static final String ER_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML =
- "ER_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML";
- public static final String ER_PROCESSINGINSTRUCTION_NOTVALID_NCNAME =
- "ER_PROCESSINGINSTRUCTION_NOTVALID_NCNAME";
- public static final String ER_NEED_MATCH_ATTRIB = "ER_NEED_MATCH_ATTRIB";
- public static final String ER_NEED_NAME_OR_MATCH_ATTRIB =
- "ER_NEED_NAME_OR_MATCH_ATTRIB";
- public static final String ER_CANT_RESOLVE_NSPREFIX =
- "ER_CANT_RESOLVE_NSPREFIX";
- public static final String ER_ILLEGAL_VALUE = "ER_ILLEGAL_VALUE";
- public static final String ER_NO_OWNERDOC = "ER_NO_OWNERDOC";
- public static final String ER_ELEMTEMPLATEELEM_ERR ="ER_ELEMTEMPLATEELEM_ERR";
- public static final String ER_NULL_CHILD = "ER_NULL_CHILD";
- public static final String ER_NEED_SELECT_ATTRIB = "ER_NEED_SELECT_ATTRIB";
- public static final String ER_NEED_TEST_ATTRIB = "ER_NEED_TEST_ATTRIB";
- public static final String ER_NEED_NAME_ATTRIB = "ER_NEED_NAME_ATTRIB";
- public static final String ER_NO_CONTEXT_OWNERDOC = "ER_NO_CONTEXT_OWNERDOC";
- public static final String ER_COULD_NOT_CREATE_XML_PROC_LIAISON =
- "ER_COULD_NOT_CREATE_XML_PROC_LIAISON";
- public static final String ER_PROCESS_NOT_SUCCESSFUL =
- "ER_PROCESS_NOT_SUCCESSFUL";
- public static final String ER_NOT_SUCCESSFUL = "ER_NOT_SUCCESSFUL";
- public static final String ER_ENCODING_NOT_SUPPORTED =
- "ER_ENCODING_NOT_SUPPORTED";
- public static final String ER_COULD_NOT_CREATE_TRACELISTENER =
- "ER_COULD_NOT_CREATE_TRACELISTENER";
- public static final String ER_KEY_REQUIRES_NAME_ATTRIB =
- "ER_KEY_REQUIRES_NAME_ATTRIB";
- public static final String ER_KEY_REQUIRES_MATCH_ATTRIB =
- "ER_KEY_REQUIRES_MATCH_ATTRIB";
- public static final String ER_KEY_REQUIRES_USE_ATTRIB =
- "ER_KEY_REQUIRES_USE_ATTRIB";
- public static final String ER_REQUIRES_ELEMENTS_ATTRIB =
- "ER_REQUIRES_ELEMENTS_ATTRIB";
- public static final String ER_MISSING_PREFIX_ATTRIB =
- "ER_MISSING_PREFIX_ATTRIB";
- public static final String ER_BAD_STYLESHEET_URL = "ER_BAD_STYLESHEET_URL";
- public static final String ER_FILE_NOT_FOUND = "ER_FILE_NOT_FOUND";
- public static final String ER_IOEXCEPTION = "ER_IOEXCEPTION";
- public static final String ER_NO_HREF_ATTRIB = "ER_NO_HREF_ATTRIB";
- public static final String ER_STYLESHEET_INCLUDES_ITSELF =
- "ER_STYLESHEET_INCLUDES_ITSELF";
- public static final String ER_PROCESSINCLUDE_ERROR ="ER_PROCESSINCLUDE_ERROR";
- public static final String ER_MISSING_LANG_ATTRIB = "ER_MISSING_LANG_ATTRIB";
- public static final String ER_MISSING_CONTAINER_ELEMENT_COMPONENT =
- "ER_MISSING_CONTAINER_ELEMENT_COMPONENT";
- public static final String ER_CAN_ONLY_OUTPUT_TO_ELEMENT =
- "ER_CAN_ONLY_OUTPUT_TO_ELEMENT";
- public static final String ER_PROCESS_ERROR = "ER_PROCESS_ERROR";
- public static final String ER_UNIMPLNODE_ERROR = "ER_UNIMPLNODE_ERROR";
- public static final String ER_NO_SELECT_EXPRESSION ="ER_NO_SELECT_EXPRESSION";
- public static final String ER_CANNOT_SERIALIZE_XSLPROCESSOR =
- "ER_CANNOT_SERIALIZE_XSLPROCESSOR";
- public static final String ER_NO_INPUT_STYLESHEET = "ER_NO_INPUT_STYLESHEET";
- public static final String ER_FAILED_PROCESS_STYLESHEET =
- "ER_FAILED_PROCESS_STYLESHEET";
- public static final String ER_COULDNT_PARSE_DOC = "ER_COULDNT_PARSE_DOC";
- public static final String ER_COULDNT_FIND_FRAGMENT =
- "ER_COULDNT_FIND_FRAGMENT";
- public static final String ER_NODE_NOT_ELEMENT = "ER_NODE_NOT_ELEMENT";
- public static final String ER_FOREACH_NEED_MATCH_OR_NAME_ATTRIB =
- "ER_FOREACH_NEED_MATCH_OR_NAME_ATTRIB";
- public static final String ER_TEMPLATES_NEED_MATCH_OR_NAME_ATTRIB =
- "ER_TEMPLATES_NEED_MATCH_OR_NAME_ATTRIB";
- public static final String ER_NO_CLONE_OF_DOCUMENT_FRAG =
- "ER_NO_CLONE_OF_DOCUMENT_FRAG";
- public static final String ER_CANT_CREATE_ITEM = "ER_CANT_CREATE_ITEM";
- public static final String ER_XMLSPACE_ILLEGAL_VALUE =
- "ER_XMLSPACE_ILLEGAL_VALUE";
- public static final String ER_NO_XSLKEY_DECLARATION =
- "ER_NO_XSLKEY_DECLARATION";
- public static final String ER_CANT_CREATE_URL = "ER_CANT_CREATE_URL";
- public static final String ER_XSLFUNCTIONS_UNSUPPORTED =
- "ER_XSLFUNCTIONS_UNSUPPORTED";
- public static final String ER_PROCESSOR_ERROR = "ER_PROCESSOR_ERROR";
- public static final String ER_NOT_ALLOWED_INSIDE_STYLESHEET =
- "ER_NOT_ALLOWED_INSIDE_STYLESHEET";
- public static final String ER_RESULTNS_NOT_SUPPORTED =
- "ER_RESULTNS_NOT_SUPPORTED";
- public static final String ER_DEFAULTSPACE_NOT_SUPPORTED =
- "ER_DEFAULTSPACE_NOT_SUPPORTED";
- public static final String ER_INDENTRESULT_NOT_SUPPORTED =
- "ER_INDENTRESULT_NOT_SUPPORTED";
- public static final String ER_ILLEGAL_ATTRIB = "ER_ILLEGAL_ATTRIB";
- public static final String ER_UNKNOWN_XSL_ELEM = "ER_UNKNOWN_XSL_ELEM";
- public static final String ER_BAD_XSLSORT_USE = "ER_BAD_XSLSORT_USE";
- public static final String ER_MISPLACED_XSLWHEN = "ER_MISPLACED_XSLWHEN";
- public static final String ER_XSLWHEN_NOT_PARENTED_BY_XSLCHOOSE =
- "ER_XSLWHEN_NOT_PARENTED_BY_XSLCHOOSE";
- public static final String ER_MISPLACED_XSLOTHERWISE =
- "ER_MISPLACED_XSLOTHERWISE";
- public static final String ER_XSLOTHERWISE_NOT_PARENTED_BY_XSLCHOOSE =
- "ER_XSLOTHERWISE_NOT_PARENTED_BY_XSLCHOOSE";
- public static final String ER_NOT_ALLOWED_INSIDE_TEMPLATE =
- "ER_NOT_ALLOWED_INSIDE_TEMPLATE";
- public static final String ER_UNKNOWN_EXT_NS_PREFIX =
- "ER_UNKNOWN_EXT_NS_PREFIX";
- public static final String ER_IMPORTS_AS_FIRST_ELEM =
- "ER_IMPORTS_AS_FIRST_ELEM";
- public static final String ER_IMPORTING_ITSELF = "ER_IMPORTING_ITSELF";
- public static final String ER_XMLSPACE_ILLEGAL_VAL ="ER_XMLSPACE_ILLEGAL_VAL";
- public static final String ER_PROCESSSTYLESHEET_NOT_SUCCESSFUL =
- "ER_PROCESSSTYLESHEET_NOT_SUCCESSFUL";
- public static final String ER_SAX_EXCEPTION = "ER_SAX_EXCEPTION";
- public static final String ER_XSLT_ERROR = "ER_XSLT_ERROR";
- public static final String ER_CURRENCY_SIGN_ILLEGAL=
- "ER_CURRENCY_SIGN_ILLEGAL";
- public static final String ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM =
- "ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM";
- public static final String ER_CANT_RESOLVE_PREFIX_OF_NON_PREFIX_RESOLVER =
- "ER_CANT_RESOLVE_PREFIX_OF_NON_PREFIX_RESOLVER";
- public static final String ER_REDIRECT_COULDNT_GET_FILENAME =
- "ER_REDIRECT_COULDNT_GET_FILENAME";
- public static final String ER_CANNOT_BUILD_FORMATTERLISTENER_IN_REDIRECT =
- "ER_CANNOT_BUILD_FORMATTERLISTENER_IN_REDIRECT";
- public static final String ER_INVALID_PREFIX_IN_EXCLUDERESULTPREFIX =
- "ER_INVALID_PREFIX_IN_EXCLUDERESULTPREFIX";
- public static final String ER_MISSING_NS_URI = "ER_MISSING_NS_URI";
- public static final String ER_MISSING_ARG_FOR_OPTION =
- "ER_MISSING_ARG_FOR_OPTION";
- public static final String ER_INVALID_OPTION = "ER_INVALID_OPTION";
- public static final String ER_MALFORMED_FORMAT_STRING =
- "ER_MALFORMED_FORMAT_STRING";
- public static final String ER_STYLESHEET_REQUIRES_VERSION_ATTRIB =
- "ER_STYLESHEET_REQUIRES_VERSION_ATTRIB";
- public static final String ER_ILLEGAL_ATTRIBUTE_VALUE =
- "ER_ILLEGAL_ATTRIBUTE_VALUE";
- public static final String ER_CHOOSE_REQUIRES_WHEN ="ER_CHOOSE_REQUIRES_WHEN";
- public static final String ER_NO_APPLY_IMPORT_IN_FOR_EACH =
- "ER_NO_APPLY_IMPORT_IN_FOR_EACH";
- public static final String ER_CANT_USE_DTM_FOR_OUTPUT =
- "ER_CANT_USE_DTM_FOR_OUTPUT";
- public static final String ER_CANT_USE_DTM_FOR_INPUT =
- "ER_CANT_USE_DTM_FOR_INPUT";
- public static final String ER_CALL_TO_EXT_FAILED = "ER_CALL_TO_EXT_FAILED";
- public static final String ER_PREFIX_MUST_RESOLVE = "ER_PREFIX_MUST_RESOLVE";
- public static final String ER_INVALID_UTF16_SURROGATE =
- "ER_INVALID_UTF16_SURROGATE";
- public static final String ER_XSLATTRSET_USED_ITSELF =
- "ER_XSLATTRSET_USED_ITSELF";
- public static final String ER_CANNOT_MIX_XERCESDOM ="ER_CANNOT_MIX_XERCESDOM";
- public static final String ER_TOO_MANY_LISTENERS = "ER_TOO_MANY_LISTENERS";
- public static final String ER_IN_ELEMTEMPLATEELEM_READOBJECT =
- "ER_IN_ELEMTEMPLATEELEM_READOBJECT";
- public static final String ER_DUPLICATE_NAMED_TEMPLATE =
- "ER_DUPLICATE_NAMED_TEMPLATE";
- public static final String ER_INVALID_KEY_CALL = "ER_INVALID_KEY_CALL";
- public static final String ER_REFERENCING_ITSELF = "ER_REFERENCING_ITSELF";
- public static final String ER_ILLEGAL_DOMSOURCE_INPUT =
- "ER_ILLEGAL_DOMSOURCE_INPUT";
- public static final String ER_CLASS_NOT_FOUND_FOR_OPTION =
- "ER_CLASS_NOT_FOUND_FOR_OPTION";
- public static final String ER_REQUIRED_ELEM_NOT_FOUND =
- "ER_REQUIRED_ELEM_NOT_FOUND";
- public static final String ER_INPUT_CANNOT_BE_NULL ="ER_INPUT_CANNOT_BE_NULL";
- public static final String ER_URI_CANNOT_BE_NULL = "ER_URI_CANNOT_BE_NULL";
- public static final String ER_FILE_CANNOT_BE_NULL = "ER_FILE_CANNOT_BE_NULL";
- public static final String ER_SOURCE_CANNOT_BE_NULL =
- "ER_SOURCE_CANNOT_BE_NULL";
- public static final String ER_CANNOT_INIT_BSFMGR = "ER_CANNOT_INIT_BSFMGR";
- public static final String ER_CANNOT_CMPL_EXTENSN = "ER_CANNOT_CMPL_EXTENSN";
- public static final String ER_CANNOT_CREATE_EXTENSN =
- "ER_CANNOT_CREATE_EXTENSN";
- public static final String ER_INSTANCE_MTHD_CALL_REQUIRES =
- "ER_INSTANCE_MTHD_CALL_REQUIRES";
- public static final String ER_INVALID_ELEMENT_NAME ="ER_INVALID_ELEMENT_NAME";
- public static final String ER_ELEMENT_NAME_METHOD_STATIC =
- "ER_ELEMENT_NAME_METHOD_STATIC";
- public static final String ER_EXTENSION_FUNC_UNKNOWN =
- "ER_EXTENSION_FUNC_UNKNOWN";
- public static final String ER_MORE_MATCH_CONSTRUCTOR =
- "ER_MORE_MATCH_CONSTRUCTOR";
- public static final String ER_MORE_MATCH_METHOD = "ER_MORE_MATCH_METHOD";
- public static final String ER_MORE_MATCH_ELEMENT = "ER_MORE_MATCH_ELEMENT";
- public static final String ER_INVALID_CONTEXT_PASSED =
- "ER_INVALID_CONTEXT_PASSED";
- public static final String ER_POOL_EXISTS = "ER_POOL_EXISTS";
- public static final String ER_NO_DRIVER_NAME = "ER_NO_DRIVER_NAME";
- public static final String ER_NO_URL = "ER_NO_URL";
- public static final String ER_POOL_SIZE_LESSTHAN_ONE =
- "ER_POOL_SIZE_LESSTHAN_ONE";
- public static final String ER_INVALID_DRIVER = "ER_INVALID_DRIVER";
- public static final String ER_NO_STYLESHEETROOT = "ER_NO_STYLESHEETROOT";
- public static final String ER_ILLEGAL_XMLSPACE_VALUE =
- "ER_ILLEGAL_XMLSPACE_VALUE";
- public static final String ER_PROCESSFROMNODE_FAILED =
- "ER_PROCESSFROMNODE_FAILED";
- public static final String ER_RESOURCE_COULD_NOT_LOAD =
- "ER_RESOURCE_COULD_NOT_LOAD";
- public static final String ER_BUFFER_SIZE_LESSTHAN_ZERO =
- "ER_BUFFER_SIZE_LESSTHAN_ZERO";
- public static final String ER_UNKNOWN_ERROR_CALLING_EXTENSION =
- "ER_UNKNOWN_ERROR_CALLING_EXTENSION";
- public static final String ER_NO_NAMESPACE_DECL = "ER_NO_NAMESPACE_DECL";
- public static final String ER_ELEM_CONTENT_NOT_ALLOWED =
- "ER_ELEM_CONTENT_NOT_ALLOWED";
- public static final String ER_STYLESHEET_DIRECTED_TERMINATION =
- "ER_STYLESHEET_DIRECTED_TERMINATION";
- public static final String ER_ONE_OR_TWO = "ER_ONE_OR_TWO";
- public static final String ER_TWO_OR_THREE = "ER_TWO_OR_THREE";
- public static final String ER_COULD_NOT_LOAD_RESOURCE =
- "ER_COULD_NOT_LOAD_RESOURCE";
- public static final String ER_CANNOT_INIT_DEFAULT_TEMPLATES =
- "ER_CANNOT_INIT_DEFAULT_TEMPLATES";
- public static final String ER_RESULT_NULL = "ER_RESULT_NULL";
- public static final String ER_RESULT_COULD_NOT_BE_SET =
- "ER_RESULT_COULD_NOT_BE_SET";
- public static final String ER_NO_OUTPUT_SPECIFIED = "ER_NO_OUTPUT_SPECIFIED";
- public static final String ER_CANNOT_TRANSFORM_TO_RESULT_TYPE =
- "ER_CANNOT_TRANSFORM_TO_RESULT_TYPE";
- public static final String ER_CANNOT_TRANSFORM_SOURCE_TYPE =
- "ER_CANNOT_TRANSFORM_SOURCE_TYPE";
- public static final String ER_NULL_CONTENT_HANDLER ="ER_NULL_CONTENT_HANDLER";
- public static final String ER_NULL_ERROR_HANDLER = "ER_NULL_ERROR_HANDLER";
- public static final String ER_CANNOT_CALL_PARSE = "ER_CANNOT_CALL_PARSE";
- public static final String ER_NO_PARENT_FOR_FILTER ="ER_NO_PARENT_FOR_FILTER";
- public static final String ER_NO_STYLESHEET_IN_MEDIA =
- "ER_NO_STYLESHEET_IN_MEDIA";
- public static final String ER_NO_STYLESHEET_PI = "ER_NO_STYLESHEET_PI";
- public static final String ER_NOT_SUPPORTED = "ER_NOT_SUPPORTED";
- public static final String ER_PROPERTY_VALUE_BOOLEAN =
- "ER_PROPERTY_VALUE_BOOLEAN";
- public static final String ER_COULD_NOT_FIND_EXTERN_SCRIPT =
- "ER_COULD_NOT_FIND_EXTERN_SCRIPT";
- public static final String ER_RESOURCE_COULD_NOT_FIND =
- "ER_RESOURCE_COULD_NOT_FIND";
- public static final String ER_OUTPUT_PROPERTY_NOT_RECOGNIZED =
- "ER_OUTPUT_PROPERTY_NOT_RECOGNIZED";
- public static final String ER_FAILED_CREATING_ELEMLITRSLT =
- "ER_FAILED_CREATING_ELEMLITRSLT";
- public static final String ER_VALUE_SHOULD_BE_NUMBER =
- "ER_VALUE_SHOULD_BE_NUMBER";
- public static final String ER_VALUE_SHOULD_EQUAL = "ER_VALUE_SHOULD_EQUAL";
- public static final String ER_FAILED_CALLING_METHOD =
- "ER_FAILED_CALLING_METHOD";
- public static final String ER_FAILED_CREATING_ELEMTMPL =
- "ER_FAILED_CREATING_ELEMTMPL";
- public static final String ER_CHARS_NOT_ALLOWED = "ER_CHARS_NOT_ALLOWED";
- public static final String ER_ATTR_NOT_ALLOWED = "ER_ATTR_NOT_ALLOWED";
- public static final String ER_BAD_VALUE = "ER_BAD_VALUE";
- public static final String ER_ATTRIB_VALUE_NOT_FOUND =
- "ER_ATTRIB_VALUE_NOT_FOUND";
- public static final String ER_ATTRIB_VALUE_NOT_RECOGNIZED =
- "ER_ATTRIB_VALUE_NOT_RECOGNIZED";
- public static final String ER_NULL_URI_NAMESPACE = "ER_NULL_URI_NAMESPACE";
- public static final String ER_NUMBER_TOO_BIG = "ER_NUMBER_TOO_BIG";
- public static final String ER_CANNOT_FIND_SAX1_DRIVER =
- "ER_CANNOT_FIND_SAX1_DRIVER";
- public static final String ER_SAX1_DRIVER_NOT_LOADED =
- "ER_SAX1_DRIVER_NOT_LOADED";
- public static final String ER_SAX1_DRIVER_NOT_INSTANTIATED =
- "ER_SAX1_DRIVER_NOT_INSTANTIATED" ;
- public static final String ER_SAX1_DRIVER_NOT_IMPLEMENT_PARSER =
- "ER_SAX1_DRIVER_NOT_IMPLEMENT_PARSER";
- public static final String ER_PARSER_PROPERTY_NOT_SPECIFIED =
- "ER_PARSER_PROPERTY_NOT_SPECIFIED";
- public static final String ER_PARSER_ARG_CANNOT_BE_NULL =
- "ER_PARSER_ARG_CANNOT_BE_NULL" ;
- public static final String ER_FEATURE = "ER_FEATURE";
- public static final String ER_PROPERTY = "ER_PROPERTY" ;
- public static final String ER_NULL_ENTITY_RESOLVER ="ER_NULL_ENTITY_RESOLVER";
- public static final String ER_NULL_DTD_HANDLER = "ER_NULL_DTD_HANDLER" ;
- public static final String ER_NO_DRIVER_NAME_SPECIFIED =
- "ER_NO_DRIVER_NAME_SPECIFIED";
- public static final String ER_NO_URL_SPECIFIED = "ER_NO_URL_SPECIFIED";
- public static final String ER_POOLSIZE_LESS_THAN_ONE =
- "ER_POOLSIZE_LESS_THAN_ONE";
- public static final String ER_INVALID_DRIVER_NAME = "ER_INVALID_DRIVER_NAME";
- public static final String ER_ERRORLISTENER = "ER_ERRORLISTENER";
- public static final String ER_ASSERT_NO_TEMPLATE_PARENT =
- "ER_ASSERT_NO_TEMPLATE_PARENT";
- public static final String ER_ASSERT_REDUNDENT_EXPR_ELIMINATOR =
- "ER_ASSERT_REDUNDENT_EXPR_ELIMINATOR";
- public static final String ER_NOT_ALLOWED_IN_POSITION =
- "ER_NOT_ALLOWED_IN_POSITION";
- public static final String ER_NONWHITESPACE_NOT_ALLOWED_IN_POSITION =
- "ER_NONWHITESPACE_NOT_ALLOWED_IN_POSITION";
- public static final String ER_NAMESPACE_CONTEXT_NULL_NAMESPACE =
- "ER_NAMESPACE_CONTEXT_NULL_NAMESPACE";
- public static final String ER_NAMESPACE_CONTEXT_NULL_PREFIX =
- "ER_NAMESPACE_CONTEXT_NULL_PREFIX";
- public static final String ER_XPATH_RESOLVER_NULL_QNAME =
- "ER_XPATH_RESOLVER_NULL_QNAME";
- public static final String ER_XPATH_RESOLVER_NEGATIVE_ARITY =
- "ER_XPATH_RESOLVER_NEGATIVE_ARITY";
- public static final String INVALID_TCHAR = "INVALID_TCHAR";
- public static final String INVALID_QNAME = "INVALID_QNAME";
- public static final String INVALID_ENUM = "INVALID_ENUM";
- public static final String INVALID_NMTOKEN = "INVALID_NMTOKEN";
- public static final String INVALID_NCNAME = "INVALID_NCNAME";
- public static final String INVALID_BOOLEAN = "INVALID_BOOLEAN";
- public static final String INVALID_NUMBER = "INVALID_NUMBER";
- public static final String ER_ARG_LITERAL = "ER_ARG_LITERAL";
- public static final String ER_DUPLICATE_GLOBAL_VAR ="ER_DUPLICATE_GLOBAL_VAR";
- public static final String ER_DUPLICATE_VAR = "ER_DUPLICATE_VAR";
- public static final String ER_TEMPLATE_NAME_MATCH = "ER_TEMPLATE_NAME_MATCH";
- public static final String ER_INVALID_PREFIX = "ER_INVALID_PREFIX";
- public static final String ER_NO_ATTRIB_SET = "ER_NO_ATTRIB_SET";
- public static final String ER_FUNCTION_NOT_FOUND =
- "ER_FUNCTION_NOT_FOUND";
- public static final String ER_CANT_HAVE_CONTENT_AND_SELECT =
- "ER_CANT_HAVE_CONTENT_AND_SELECT";
- public static final String ER_INVALID_SET_PARAM_VALUE = "ER_INVALID_SET_PARAM_VALUE";
- public static final String ER_SET_FEATURE_NULL_NAME =
- "ER_SET_FEATURE_NULL_NAME";
- public static final String ER_GET_FEATURE_NULL_NAME =
- "ER_GET_FEATURE_NULL_NAME";
- public static final String ER_UNSUPPORTED_FEATURE =
- "ER_UNSUPPORTED_FEATURE";
- public static final String ER_EXTENSION_ELEMENT_NOT_ALLOWED_IN_SECURE_PROCESSING =
- "ER_EXTENSION_ELEMENT_NOT_ALLOWED_IN_SECURE_PROCESSING";
-
- public static final String WG_FOUND_CURLYBRACE = "WG_FOUND_CURLYBRACE";
- public static final String WG_COUNT_ATTRIB_MATCHES_NO_ANCESTOR =
- "WG_COUNT_ATTRIB_MATCHES_NO_ANCESTOR";
- public static final String WG_EXPR_ATTRIB_CHANGED_TO_SELECT =
- "WG_EXPR_ATTRIB_CHANGED_TO_SELECT";
- public static final String WG_NO_LOCALE_IN_FORMATNUMBER =
- "WG_NO_LOCALE_IN_FORMATNUMBER";
- public static final String WG_LOCALE_NOT_FOUND = "WG_LOCALE_NOT_FOUND";
- public static final String WG_CANNOT_MAKE_URL_FROM ="WG_CANNOT_MAKE_URL_FROM";
- public static final String WG_CANNOT_LOAD_REQUESTED_DOC =
- "WG_CANNOT_LOAD_REQUESTED_DOC";
- public static final String WG_CANNOT_FIND_COLLATOR ="WG_CANNOT_FIND_COLLATOR";
- public static final String WG_FUNCTIONS_SHOULD_USE_URL =
- "WG_FUNCTIONS_SHOULD_USE_URL";
- public static final String WG_ENCODING_NOT_SUPPORTED_USING_UTF8 =
- "WG_ENCODING_NOT_SUPPORTED_USING_UTF8";
- public static final String WG_ENCODING_NOT_SUPPORTED_USING_JAVA =
- "WG_ENCODING_NOT_SUPPORTED_USING_JAVA";
- public static final String WG_SPECIFICITY_CONFLICTS =
- "WG_SPECIFICITY_CONFLICTS";
- public static final String WG_PARSING_AND_PREPARING =
- "WG_PARSING_AND_PREPARING";
- public static final String WG_ATTR_TEMPLATE = "WG_ATTR_TEMPLATE";
- public static final String WG_CONFLICT_BETWEEN_XSLSTRIPSPACE_AND_XSLPRESERVESPACE = "WG_CONFLICT_BETWEEN_XSLSTRIPSPACE_AND_XSLPRESERVESP";
- public static final String WG_ATTRIB_NOT_HANDLED = "WG_ATTRIB_NOT_HANDLED";
- public static final String WG_NO_DECIMALFORMAT_DECLARATION =
- "WG_NO_DECIMALFORMAT_DECLARATION";
- public static final String WG_OLD_XSLT_NS = "WG_OLD_XSLT_NS";
- public static final String WG_ONE_DEFAULT_XSLDECIMALFORMAT_ALLOWED =
- "WG_ONE_DEFAULT_XSLDECIMALFORMAT_ALLOWED";
- public static final String WG_XSLDECIMALFORMAT_NAMES_MUST_BE_UNIQUE =
- "WG_XSLDECIMALFORMAT_NAMES_MUST_BE_UNIQUE";
- public static final String WG_ILLEGAL_ATTRIBUTE = "WG_ILLEGAL_ATTRIBUTE";
- public static final String WG_COULD_NOT_RESOLVE_PREFIX =
- "WG_COULD_NOT_RESOLVE_PREFIX";
- public static final String WG_STYLESHEET_REQUIRES_VERSION_ATTRIB =
- "WG_STYLESHEET_REQUIRES_VERSION_ATTRIB";
- public static final String WG_ILLEGAL_ATTRIBUTE_NAME =
- "WG_ILLEGAL_ATTRIBUTE_NAME";
- public static final String WG_ILLEGAL_ATTRIBUTE_VALUE =
- "WG_ILLEGAL_ATTRIBUTE_VALUE";
- public static final String WG_EMPTY_SECOND_ARG = "WG_EMPTY_SECOND_ARG";
- public static final String WG_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML =
- "WG_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML";
- public static final String WG_PROCESSINGINSTRUCTION_NOTVALID_NCNAME =
- "WG_PROCESSINGINSTRUCTION_NOTVALID_NCNAME";
- public static final String WG_ILLEGAL_ATTRIBUTE_POSITION =
- "WG_ILLEGAL_ATTRIBUTE_POSITION";
- public static final String NO_MODIFICATION_ALLOWED_ERR =
- "NO_MODIFICATION_ALLOWED_ERR";
-
- /*
- * Now fill in the message text.
- * Then fill in the message text for that message code in the
- * array. Use the new error code as the index into the array.
- */
-
- // Error messages...
-
- /** Get the lookup table for error messages.
- *
- * @return The message lookup table.
- */
- public Object[][] getContents()
- {
- return new Object[][] {
-
- /** Error message ID that has a null message, but takes in a single object. */
- {"ER0000" , "{0}" },
-
- { ER_NO_CURLYBRACE,
- "Erreur : l'expression ne peut pas contenir le caract\u00E8re '{'"},
-
- { ER_ILLEGAL_ATTRIBUTE ,
- "{0} a un attribut non admis : {1}"},
-
- {ER_NULL_SOURCENODE_APPLYIMPORTS ,
- "La valeur de sourceNode est NULL dans xsl:apply-imports."},
-
- {ER_CANNOT_ADD,
- "Impossible d''ajouter {0} \u00E0 {1}"},
-
- { ER_NULL_SOURCENODE_HANDLEAPPLYTEMPLATES,
- "La valeur de sourceNode est NULL dans handleApplyTemplatesInstruction."},
-
- { ER_NO_NAME_ATTRIB,
- "{0} doit avoir un attribut ''name''."},
-
- {ER_TEMPLATE_NOT_FOUND,
- "Mod\u00E8le nomm\u00E9 {0} introuvable"},
-
- {ER_CANT_RESOLVE_NAME_AVT,
- "Impossible de r\u00E9soudre le nom AVT dans xsl:call-template."},
-
- {ER_REQUIRES_ATTRIB,
- "{0} exige l''attribut : {1}"},
-
- { ER_MUST_HAVE_TEST_ATTRIB,
- "{0} doit avoir un attribut ''test''."},
-
- {ER_BAD_VAL_ON_LEVEL_ATTRIB,
- "Valeur incorrecte sur l''attribut de niveau : {0}"},
-
- {ER_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML,
- "Le nom de processing-instruction ne peut pas \u00EAtre 'xml'"},
-
- { ER_PROCESSINGINSTRUCTION_NOTVALID_NCNAME,
- "Le nom de processing-instruction doit \u00EAtre un NCName valide : {0}"},
-
- { ER_NEED_MATCH_ATTRIB,
- "{0} doit avoir un attribut de correspondance s''il a un mode."},
-
- { ER_NEED_NAME_OR_MATCH_ATTRIB,
- "{0} exige un nom ou un attribut de correspondance."},
-
- {ER_CANT_RESOLVE_NSPREFIX,
- "Impossible de r\u00E9soudre le pr\u00E9fixe de l''espace de noms : {0}"},
-
- { ER_ILLEGAL_VALUE,
- "xml:space a une valeur non admise : {0}"},
-
- { ER_NO_OWNERDOC,
- "Le noeud enfant ne poss\u00E8de pas de document propri\u00E9taire."},
-
- { ER_ELEMTEMPLATEELEM_ERR,
- "Erreur ElemTemplateElement : {0}"},
-
- { ER_NULL_CHILD,
- "Tentative d'ajout d'un enfant NULL."},
-
- { ER_NEED_SELECT_ATTRIB,
- "{0} exige un attribut \"select\"."},
-
- { ER_NEED_TEST_ATTRIB ,
- "xsl:when doit avoir un attribut \"test\"."},
-
- { ER_NEED_NAME_ATTRIB,
- "xsl:with-param doit avoir un attribut \"name\"."},
-
- { ER_NO_CONTEXT_OWNERDOC,
- "le contexte ne poss\u00E8de pas de document propri\u00E9taire."},
-
- {ER_COULD_NOT_CREATE_XML_PROC_LIAISON,
- "Impossible de cr\u00E9er la liaison XML?? TransformerFactory : {0}"},
-
- {ER_PROCESS_NOT_SUCCESSFUL,
- "Xalan : le processus a \u00E9chou\u00E9."},
-
- { ER_NOT_SUCCESSFUL,
- "Xalan : \u00E9chec."},
-
- { ER_ENCODING_NOT_SUPPORTED,
- "Encodage non pris en charge : {0}"},
-
- {ER_COULD_NOT_CREATE_TRACELISTENER,
- "Impossible de cr\u00E9er TraceListener : {0}"},
-
- {ER_KEY_REQUIRES_NAME_ATTRIB,
- "xsl:key exige un attribut \"name\"."},
-
- { ER_KEY_REQUIRES_MATCH_ATTRIB,
- "xsl:key exige un attribut \"match\"."},
-
- { ER_KEY_REQUIRES_USE_ATTRIB,
- "xsl:key exige un attribut \"use\"."},
-
- { ER_REQUIRES_ELEMENTS_ATTRIB,
- "(StylesheetHandler) {0} exige un attribut ''elements''."},
-
- { ER_MISSING_PREFIX_ATTRIB,
- "(StylesheetHandler) L''attribut ''prefix'' {0} est manquant"},
-
- { ER_BAD_STYLESHEET_URL,
- "L''URL de feuille de style est incorrecte : {0}"},
-
- { ER_FILE_NOT_FOUND,
- "Fichier de feuille de style introuvable : {0}"},
-
- { ER_IOEXCEPTION,
- "Exception d''E/S avec le fichier de feuille de style : {0}"},
-
- { ER_NO_HREF_ATTRIB,
- "(StylesheetHandler) Attribut href introuvable pour {0}"},
-
- { ER_STYLESHEET_INCLUDES_ITSELF,
- "(StylesheetHandler) {0} s''inclut directement ou indirectement lui-m\u00EAme."},
-
- { ER_PROCESSINCLUDE_ERROR,
- "Erreur StylesheetHandler.processInclude, {0}"},
-
- { ER_MISSING_LANG_ATTRIB,
- "(StylesheetHandler) L''attribut \"lang\" {0} est manquant"},
-
- { ER_MISSING_CONTAINER_ELEMENT_COMPONENT,
- "(StylesheetHandler) l''\u00E9l\u00E9ment {0} est-il mal plac\u00E9? El\u00E9ment ''component'' du conteneur manquant"},
-
- { ER_CAN_ONLY_OUTPUT_TO_ELEMENT,
- "Sortie unique vers Element, DocumentFragment, Document ou PrintWriter."},
-
- { ER_PROCESS_ERROR,
- "Erreur StylesheetRoot.process"},
-
- { ER_UNIMPLNODE_ERROR,
- "Erreur UnImplNode : {0}"},
-
- { ER_NO_SELECT_EXPRESSION,
- "Erreur : expression de s\u00E9lection Xpath introuvable (-select)."},
-
- { ER_CANNOT_SERIALIZE_XSLPROCESSOR,
- "Impossible de s\u00E9rialiser un processeur XSL."},
-
- { ER_NO_INPUT_STYLESHEET,
- "L'entr\u00E9e de feuille de style n'a pas \u00E9t\u00E9 sp\u00E9cifi\u00E9e."},
-
- { ER_FAILED_PROCESS_STYLESHEET,
- "Echec du traitement de la feuille de style."},
-
- { ER_COULDNT_PARSE_DOC,
- "Impossible d''analyser le document {0}."},
-
- { ER_COULDNT_FIND_FRAGMENT,
- "Fragment introuvable : {0}"},
-
- { ER_NODE_NOT_ELEMENT,
- "Le noeud sur lequel pointe l''identificateur de fragment n''\u00E9tait pas un \u00E9l\u00E9ment : {0}"},
-
- { ER_FOREACH_NEED_MATCH_OR_NAME_ATTRIB,
- "l'\u00E9l\u00E9ment for-each doit avoir un attribut de nom ou de correspondance"},
-
- { ER_TEMPLATES_NEED_MATCH_OR_NAME_ATTRIB,
- "les mod\u00E8les doivent avoir un attribut de nom ou de correspondance"},
-
- { ER_NO_CLONE_OF_DOCUMENT_FRAG,
- "Aucun clone d'un fragment de document."},
-
- { ER_CANT_CREATE_ITEM,
- "Impossible de cr\u00E9er l''\u00E9l\u00E9ment dans l''arborescence de r\u00E9sultats : {0}"},
-
- { ER_XMLSPACE_ILLEGAL_VALUE,
- "xml:space dans le fichier XML source a une valeur non admise : {0}"},
-
- { ER_NO_XSLKEY_DECLARATION,
- "Il n''existe aucune d\u00E9claration xsl:key pour {0}."},
-
- { ER_CANT_CREATE_URL,
- "Erreur : impossible de cr\u00E9er l''URL pour : {0}"},
-
- { ER_XSLFUNCTIONS_UNSUPPORTED,
- "xsl:functions n'est pas pris en charge"},
-
- { ER_PROCESSOR_ERROR,
- "Erreur TransformerFactory XSLT"},
-
- { ER_NOT_ALLOWED_INSIDE_STYLESHEET,
- "(StylesheetHandler) {0} non autoris\u00E9 dans une feuille de style."},
-
- { ER_RESULTNS_NOT_SUPPORTED,
- "\u00E9l\u00E9ment result-ns plus pris en charge. Utilisez plut\u00F4t xsl:output."},
-
- { ER_DEFAULTSPACE_NOT_SUPPORTED,
- "\u00E9l\u00E9ment default-space plus pris en charge. Utilisez plut\u00F4t xsl:strip-space ou xsl:preserve-space."},
-
- { ER_INDENTRESULT_NOT_SUPPORTED,
- "\u00E9l\u00E9ment indent-result plus pris en charge. Utilisez plut\u00F4t xsl:output."},
-
- { ER_ILLEGAL_ATTRIB,
- "(StylesheetHandler) {0} a un attribut non admis : {1}"},
-
- { ER_UNKNOWN_XSL_ELEM,
- "El\u00E9ment XSL inconnu : {0}"},
-
- { ER_BAD_XSLSORT_USE,
- "(StylesheetHandler) xsl:sort ne peut \u00EAtre utilis\u00E9 qu'avec xsl:apply-templates ou xsl:for-each."},
-
- { ER_MISPLACED_XSLWHEN,
- "(StylesheetHandler) xsl:when mal plac\u00E9."},
-
- { ER_XSLWHEN_NOT_PARENTED_BY_XSLCHOOSE,
- "(StylesheetHandler) xsl:choose n'a affect\u00E9 aucun parent \u00E0 xsl:when."},
-
- { ER_MISPLACED_XSLOTHERWISE,
- "(StylesheetHandler) xsl:otherwise mal plac\u00E9."},
-
- { ER_XSLOTHERWISE_NOT_PARENTED_BY_XSLCHOOSE,
- "(StylesheetHandler) xsl:choose n'a affect\u00E9 aucun parent \u00E0 xsl:otherwise."},
-
- { ER_NOT_ALLOWED_INSIDE_TEMPLATE,
- "(StylesheetHandler) {0} n''est pas autoris\u00E9 dans un mod\u00E8le."},
-
- { ER_UNKNOWN_EXT_NS_PREFIX,
- "(StylesheetHandler) Pr\u00E9fixe {1} de l''espace de noms de l''extension {0} inconnu"},
-
- { ER_IMPORTS_AS_FIRST_ELEM,
- "(StylesheetHandler) Les imports ne peuvent s'appliquer que sur les premiers \u00E9l\u00E9ments de la feuille de style."},
-
- { ER_IMPORTING_ITSELF,
- "(StylesheetHandler) {0} s''importe directement ou indirectement lui-m\u00EAme."},
-
- { ER_XMLSPACE_ILLEGAL_VAL,
- "(StylesheetHandler) xml:space a une valeur non admise : {0}"},
-
- { ER_PROCESSSTYLESHEET_NOT_SUCCESSFUL,
- "Echec de processStylesheet."},
-
- { ER_SAX_EXCEPTION,
- "Exception SAX"},
-
-// add this message to fix bug 21478
- { ER_FUNCTION_NOT_SUPPORTED,
- "Fonction non prise en charge."},
-
- { ER_XSLT_ERROR,
- "Erreur XSLT"},
-
- { ER_CURRENCY_SIGN_ILLEGAL,
- "le symbole de devise n'est pas autoris\u00E9 dans la cha\u00EEne du mod\u00E8le de format"},
-
- { ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM,
- "Fonction de document non prise en charge dans l'objet DOM de la feuille de style."},
-
- { ER_CANT_RESOLVE_PREFIX_OF_NON_PREFIX_RESOLVER,
- "Impossible de r\u00E9soudre le pr\u00E9fixe du r\u00E9solveur non-Prefix."},
-
- { ER_REDIRECT_COULDNT_GET_FILENAME,
- "Extension Redirect : impossible d'obtenir le nom de fichier. L'attribut \"file\" ou \"select\" doit renvoyer une cha\u00EEne valide."},
-
- { ER_CANNOT_BUILD_FORMATTERLISTENER_IN_REDIRECT,
- "Impossible de cr\u00E9er FormatterListener dans l'extension Redirect."},
-
- { ER_INVALID_PREFIX_IN_EXCLUDERESULTPREFIX,
- "Le pr\u00E9fixe de l''\u00E9l\u00E9ment exclude-result-prefixes n''est pas valide : {0}"},
-
- { ER_MISSING_NS_URI,
- "URI d'espace de noms manquant pour le pr\u00E9fixe sp\u00E9cifi\u00E9"},
-
- { ER_MISSING_ARG_FOR_OPTION,
- "Argument manquant pour l''option : {0}"},
-
- { ER_INVALID_OPTION,
- "Option non valide : {0}"},
-
- { ER_MALFORMED_FORMAT_STRING,
- "Format de cha\u00EEne incorrect : {0}"},
-
- { ER_STYLESHEET_REQUIRES_VERSION_ATTRIB,
- "xsl:stylesheet exige un attribut de version."},
-
- { ER_ILLEGAL_ATTRIBUTE_VALUE,
- "L''attribut {0} a une valeur non admise : {1}"},
-
- { ER_CHOOSE_REQUIRES_WHEN,
- "xsl:choose exige un \u00E9l\u00E9ment xsl:when"},
-
- { ER_NO_APPLY_IMPORT_IN_FOR_EACH,
- "xsl:apply-imports non autoris\u00E9 dans un \u00E9l\u00E9ment xsl:for-each"},
-
- { ER_CANT_USE_DTM_FOR_OUTPUT,
- "Impossible d'utiliser un \u00E9l\u00E9ment DTMLiaison pour un noeud DOM de sortie... Transmettez plut\u00F4t un \u00E9l\u00E9ment com.sun.org.apache.xpath.internal.DOM2Helper."},
-
- { ER_CANT_USE_DTM_FOR_INPUT,
- "Impossible d'utiliser un \u00E9l\u00E9ment DTMLiaison pour un noeud DOM d'entr\u00E9e... Transmettez plut\u00F4t un \u00E9l\u00E9ment com.sun.org.apache.xpath.internal.DOM2Helper."},
-
- { ER_CALL_TO_EXT_FAILED,
- "Echec de l''appel de l''\u00E9l\u00E9ment d''extension : {0}"},
-
- { ER_PREFIX_MUST_RESOLVE,
- "Le pr\u00E9fixe doit \u00EAtre r\u00E9solu en espace de noms : {0}"},
-
- { ER_INVALID_UTF16_SURROGATE,
- "Substitut UTF-16 non valide d\u00E9tect\u00E9 : {0} ?"},
-
- { ER_XSLATTRSET_USED_ITSELF,
- "xsl:attribute-set {0} s''est utilis\u00E9 lui-m\u00EAme, ce qui g\u00E9n\u00E8re une boucle sans fin."},
-
- { ER_CANNOT_MIX_XERCESDOM,
- "Impossible de combiner une entr\u00E9e non Xerces-DOM et une sortie Xerces-DOM."},
-
- { ER_TOO_MANY_LISTENERS,
- "addTraceListenersToStylesheet - TooManyListenersException"},
-
- { ER_IN_ELEMTEMPLATEELEM_READOBJECT,
- "Dans ElemTemplateElement.readObject : {0}"},
-
- { ER_DUPLICATE_NAMED_TEMPLATE,
- "Plusieurs mod\u00E8les nomm\u00E9s {0} ont \u00E9t\u00E9 trouv\u00E9s"},
-
- { ER_INVALID_KEY_CALL,
- "Appel de fonction non valide : les appels de touche r\u00E9cursive () ne sont pas autoris\u00E9s"},
-
- { ER_REFERENCING_ITSELF,
- "La variable {0} fait directement ou indirectement r\u00E9f\u00E9rence \u00E0 elle-m\u00EAme."},
-
- { ER_ILLEGAL_DOMSOURCE_INPUT,
- "Le noeud d'entr\u00E9e ne peut pas \u00EAtre NULL pour un \u00E9l\u00E9ment DOMSource de newTemplates."},
-
- { ER_CLASS_NOT_FOUND_FOR_OPTION,
- "Fichier de classe introuvable pour l''option {0}"},
-
- { ER_REQUIRED_ELEM_NOT_FOUND,
- "El\u00E9ment obligatoire introuvable : {0}"},
-
- { ER_INPUT_CANNOT_BE_NULL,
- "InputStream ne peut pas \u00EAtre NULL"},
-
- { ER_URI_CANNOT_BE_NULL,
- "L'URI ne peut pas \u00EAtre NULL"},
-
- { ER_FILE_CANNOT_BE_NULL,
- "Le fichier ne peut pas \u00EAtre NULL"},
-
- { ER_SOURCE_CANNOT_BE_NULL,
- "InputSource ne peut pas \u00EAtre NULL"},
-
- { ER_CANNOT_INIT_BSFMGR,
- "Impossible d'initialiser le gestionnaire BSF"},
-
- { ER_CANNOT_CMPL_EXTENSN,
- "Impossible de compiler l'extension"},
-
- { ER_CANNOT_CREATE_EXTENSN,
- "Impossible de cr\u00E9er l''extension {0}. Cause : {1}"},
-
- { ER_INSTANCE_MTHD_CALL_REQUIRES,
- "L''appel de la m\u00E9thode d''instance {0} exige une instance d''objet comme premier argument"},
-
- { ER_INVALID_ELEMENT_NAME,
- "Nom d''\u00E9l\u00E9ment sp\u00E9cifi\u00E9 {0} non valide"},
-
- { ER_ELEMENT_NAME_METHOD_STATIC,
- "La m\u00E9thode du nom d''\u00E9l\u00E9ment doit \u00EAtre statique {0}"},
-
- { ER_EXTENSION_FUNC_UNKNOWN,
- "La fonction d''extension {0} : {1} est inconnue"},
-
- { ER_MORE_MATCH_CONSTRUCTOR,
- "Plusieurs meilleures concordances du constructeur pour {0}"},
-
- { ER_MORE_MATCH_METHOD,
- "Plusieurs meilleures concordances pour la m\u00E9thode {0}"},
-
- { ER_MORE_MATCH_ELEMENT,
- "Plusieurs meilleures concordances pour la m\u00E9thode d''\u00E9l\u00E9ment {0}"},
-
- { ER_INVALID_CONTEXT_PASSED,
- "Contexte transmis pour \u00E9valuation {0} non valide"},
-
- { ER_POOL_EXISTS,
- "Le pool existe d\u00E9j\u00E0"},
-
- { ER_NO_DRIVER_NAME,
- "Aucun nom de pilote indiqu\u00E9"},
-
- { ER_NO_URL,
- "Aucune URL indiqu\u00E9e"},
-
- { ER_POOL_SIZE_LESSTHAN_ONE,
- "La taille de pool est inf\u00E9rieure \u00E0 1."},
-
- { ER_INVALID_DRIVER,
- "Nom de pilote indiqu\u00E9 non valide."},
-
- { ER_NO_STYLESHEETROOT,
- "Racine de la feuille de style introuvable."},
-
- { ER_ILLEGAL_XMLSPACE_VALUE,
- "Valeur non admise pour xml:space"},
-
- { ER_PROCESSFROMNODE_FAILED,
- "Echec de processFromNode"},
-
- { ER_RESOURCE_COULD_NOT_LOAD,
- "La ressource [ {0} ] n''a pas pu charger : {1} \n {2} \t {3}"},
-
- { ER_BUFFER_SIZE_LESSTHAN_ZERO,
- "Taille du tampon <=0"},
-
- { ER_UNKNOWN_ERROR_CALLING_EXTENSION,
- "Erreur inconnue lors de l'appel de l'extension"},
-
- { ER_NO_NAMESPACE_DECL,
- "Le pr\u00E9fixe {0} n''a pas de d\u00E9claration d''espace de noms correspondante"},
-
- { ER_ELEM_CONTENT_NOT_ALLOWED,
- "Contenu d''\u00E9l\u00E9ment non autoris\u00E9 pour lang=javaclass {0}"},
-
- { ER_STYLESHEET_DIRECTED_TERMINATION,
- "Fin du r\u00E9acheminement de la feuille de style"},
-
- { ER_ONE_OR_TWO,
- "1 ou 2"},
-
- { ER_TWO_OR_THREE,
- "2 ou 3"},
-
- { ER_COULD_NOT_LOAD_RESOURCE,
- "Impossible de charger {0} (v\u00E9rifier CLASSPATH), les valeurs par d\u00E9faut sont donc employ\u00E9es"},
-
- { ER_CANNOT_INIT_DEFAULT_TEMPLATES,
- "Impossible d'initialiser les mod\u00E8les default"},
-
- { ER_RESULT_NULL,
- "Le r\u00E9sultat ne doit pas \u00EAtre NULL"},
-
- { ER_RESULT_COULD_NOT_BE_SET,
- "Le r\u00E9sultat n'a pas pu \u00EAtre d\u00E9fini"},
-
- { ER_NO_OUTPUT_SPECIFIED,
- "Aucune sortie sp\u00E9cifi\u00E9e"},
-
- { ER_CANNOT_TRANSFORM_TO_RESULT_TYPE,
- "Impossible de transformer le r\u00E9sultat en r\u00E9sultat de type {0}"},
-
- { ER_CANNOT_TRANSFORM_SOURCE_TYPE,
- "Impossible de transformer une source de type {0}"},
-
- { ER_NULL_CONTENT_HANDLER,
- "Gestionnaire de contenu NULL"},
-
- { ER_NULL_ERROR_HANDLER,
- "Gestionnaire d'erreurs NULL"},
-
- { ER_CANNOT_CALL_PARSE,
- "impossible d'appeler l'analyse si le gestionnaire de contenu n'est pas d\u00E9fini"},
-
- { ER_NO_PARENT_FOR_FILTER,
- "Aucun parent pour le filtre"},
-
- { ER_NO_STYLESHEET_IN_MEDIA,
- "Aucune feuille de style trouv\u00E9e dans : {0}, support = {1}"},
-
- { ER_NO_STYLESHEET_PI,
- "Aucune instruction de traitement (PI) xml-stylesheet trouv\u00E9e dans : {0}"},
-
- { ER_NOT_SUPPORTED,
- "Non pris en charge : {0}"},
-
- { ER_PROPERTY_VALUE_BOOLEAN,
- "La valeur de la propri\u00E9t\u00E9 {0} doit \u00EAtre une instance Boolean"},
-
- { ER_COULD_NOT_FIND_EXTERN_SCRIPT,
- "Impossible d''acc\u00E9der au script externe \u00E0 {0}"},
-
- { ER_RESOURCE_COULD_NOT_FIND,
- "La ressource [ {0} ] est introuvable.\n {1}"},
-
- { ER_OUTPUT_PROPERTY_NOT_RECOGNIZED,
- "Propri\u00E9t\u00E9 de sortie non reconnue : {0}"},
-
- { ER_FAILED_CREATING_ELEMLITRSLT,
- "Echec de la cr\u00E9ation de l'instance ElemLiteralResult"},
-
- //Earlier (JDK 1.4 XALAN 2.2-D11) at key code '204' the key name was ER_PRIORITY_NOT_PARSABLE
- // In latest Xalan code base key name is ER_VALUE_SHOULD_BE_NUMBER. This should also be taken care
- //in locale specific files like XSLTErrorResources_de.java, XSLTErrorResources_fr.java etc.
- //NOTE: Not only the key name but message has also been changed.
- { ER_VALUE_SHOULD_BE_NUMBER,
- "La valeur de {0} doit contenir un nombre pouvant \u00EAtre analys\u00E9"},
-
- { ER_VALUE_SHOULD_EQUAL,
- "La valeur de {0} doit \u00EAtre \u00E9gale \u00E0 oui ou non"},
-
- { ER_FAILED_CALLING_METHOD,
- "Echec de l''appel de la m\u00E9thode {0}"},
-
- { ER_FAILED_CREATING_ELEMTMPL,
- "Echec de la cr\u00E9ation de l'instance ElemTemplateElement"},
-
- { ER_CHARS_NOT_ALLOWED,
- "Les caract\u00E8res ne sont pas autoris\u00E9s \u00E0 ce point du document"},
-
- { ER_ATTR_NOT_ALLOWED,
- "L''attribut \"{0}\" n''est pas autoris\u00E9 sur l''\u00E9l\u00E9ment {1}."},
-
- { ER_BAD_VALUE,
- "Valeur incorrecte de {0} : {1} "},
-
- { ER_ATTRIB_VALUE_NOT_FOUND,
- "Valeur d''attribut {0} introuvable "},
-
- { ER_ATTRIB_VALUE_NOT_RECOGNIZED,
- "Valeur d''attribut {0} non reconnue "},
-
- { ER_NULL_URI_NAMESPACE,
- "Tentative de g\u00E9n\u00E9ration d'un pr\u00E9fixe d'espace de noms avec un URI NULL"},
-
- { ER_NUMBER_TOO_BIG,
- "Tentative de formatage d'un nombre sup\u00E9rieur \u00E0 l'entier de type Long le plus grand"},
-
- { ER_CANNOT_FIND_SAX1_DRIVER,
- "Classe de pilote SAX1 {0} introuvable"},
-
- { ER_SAX1_DRIVER_NOT_LOADED,
- "Classe de pilote SAX1 {0} trouv\u00E9e mais pas charg\u00E9e"},
-
- { ER_SAX1_DRIVER_NOT_INSTANTIATED,
- "Classe de pilote SAX1 {0} charg\u00E9e mais pas instanci\u00E9e"},
-
- { ER_SAX1_DRIVER_NOT_IMPLEMENT_PARSER,
- "La classe de pilote SAX1 {0} n''impl\u00E9mente pas org.xml.sax.Parser"},
-
- { ER_PARSER_PROPERTY_NOT_SPECIFIED,
- "Propri\u00E9t\u00E9 syst\u00E8me org.xml.sax.parser non indiqu\u00E9e"},
-
- { ER_PARSER_ARG_CANNOT_BE_NULL,
- "L'argument d'analyseur ne doit pas \u00EAtre NULL"},
-
- { ER_FEATURE,
- "Fonctionnalit\u00E9 : {0}"},
-
- { ER_PROPERTY,
- "Propri\u00E9t\u00E9 : {0}"},
-
- { ER_NULL_ENTITY_RESOLVER,
- "R\u00E9solveur d'entit\u00E9 NULL"},
-
- { ER_NULL_DTD_HANDLER,
- "Gestionnaire DTD NULL"},
-
- { ER_NO_DRIVER_NAME_SPECIFIED,
- "Aucun nom de pilote indiqu\u00E9."},
-
- { ER_NO_URL_SPECIFIED,
- "Aucune URL indiqu\u00E9e."},
-
- { ER_POOLSIZE_LESS_THAN_ONE,
- "La taille de pool est inf\u00E9rieure \u00E0 1."},
-
- { ER_INVALID_DRIVER_NAME,
- "Nom de pilote indiqu\u00E9 non valide."},
-
- { ER_ERRORLISTENER,
- "ErrorListener"},
-
-
-// Note to translators: The following message should not normally be displayed
-// to users. It describes a situation in which the processor has detected
-// an internal consistency problem in itself, and it provides this message
-// for the developer to help diagnose the problem. The name
-// 'ElemTemplateElement' is the name of a class, and should not be
-// translated.
- { ER_ASSERT_NO_TEMPLATE_PARENT,
- "Erreur du programmeur. L'expression n'a pas de parent ElemTemplateElement."},
-
-
-// Note to translators: The following message should not normally be displayed
-// to users. It describes a situation in which the processor has detected
-// an internal consistency problem in itself, and it provides this message
-// for the developer to help diagnose the problem. The substitution text
-// provides further information in order to diagnose the problem. The name
-// 'RedundentExprEliminator' is the name of a class, and should not be
-// translated.
- { ER_ASSERT_REDUNDENT_EXPR_ELIMINATOR,
- "Assertion du programmeur dans RedundentExprEliminator : {0}"},
-
- { ER_NOT_ALLOWED_IN_POSITION,
- "{0} n''est pas autoris\u00E9 \u00E0 cet emplacement de la feuille de style."},
-
- { ER_NONWHITESPACE_NOT_ALLOWED_IN_POSITION,
- "Le texte imprimable n'est pas autoris\u00E9 \u00E0 cet emplacement de la feuille de style."},
-
- // This code is shared with warning codes.
- // SystemId Unknown
- { INVALID_TCHAR,
- "Valeur non admise {1} utilis\u00E9e pour l''attribut CHAR : {0}. Un attribut de type CHAR ne doit \u00EAtre compos\u00E9 que d''un caract\u00E8re."},
-
- // Note to translators: The following message is used if the value of
- // an attribute in a stylesheet is invalid. "QNAME" is the XML data-type of
- // the attribute, and should not be translated. The substitution text {1} is
- // the attribute value and {0} is the attribute name.
- //The following codes are shared with the warning codes...
- { INVALID_QNAME,
- "Valeur non admise {1} utilis\u00E9e pour l''attribut QNAME : {0}"},
-
- // Note to translators: The following message is used if the value of
- // an attribute in a stylesheet is invalid. "ENUM" is the XML data-type of
- // the attribute, and should not be translated. The substitution text {1} is
- // the attribute value, {0} is the attribute name, and {2} is a list of valid
- // values.
- { INVALID_ENUM,
- "Valeur non admise {1} utilis\u00E9e pour l''attribut ENUM : {0}. Les valeurs valides sont les suivantes : {2}."},
-
-// Note to translators: The following message is used if the value of
-// an attribute in a stylesheet is invalid. "NMTOKEN" is the XML data-type
-// of the attribute, and should not be translated. The substitution text {1} is
-// the attribute value and {0} is the attribute name.
- { INVALID_NMTOKEN,
- "Valeur non admise {1} utilis\u00E9e pour l''attribut NMTOKEN : {0} "},
-
-// Note to translators: The following message is used if the value of
-// an attribute in a stylesheet is invalid. "NCNAME" is the XML data-type
-// of the attribute, and should not be translated. The substitution text {1} is
-// the attribute value and {0} is the attribute name.
- { INVALID_NCNAME,
- "Valeur non admise {1} utilis\u00E9e pour l''attribut NCNAME : {0} "},
-
-// Note to translators: The following message is used if the value of
-// an attribute in a stylesheet is invalid. "boolean" is the XSLT data-type
-// of the attribute, and should not be translated. The substitution text {1} is
-// the attribute value and {0} is the attribute name.
- { INVALID_BOOLEAN,
- "Valeur non admise {1} utilis\u00E9e pour l''attribut \"boolean\" : {0} "},
-
-// Note to translators: The following message is used if the value of
-// an attribute in a stylesheet is invalid. "number" is the XSLT data-type
-// of the attribute, and should not be translated. The substitution text {1} is
-// the attribute value and {0} is the attribute name.
- { INVALID_NUMBER,
- "Valeur non admise {1} utilis\u00E9e pour l''attribut \"number\" : {0} "},
-
-
- // End of shared codes...
-
-// Note to translators: A "match pattern" is a special form of XPath expression
-// that is used for matching patterns. The substitution text is the name of
-// a function. The message indicates that when this function is referenced in
-// a match pattern, its argument must be a string literal (or constant.)
-// ER_ARG_LITERAL - new error message for bugzilla //5202
- { ER_ARG_LITERAL,
- "L''argument pour {0} dans le mod\u00E8le de recherche doit \u00EAtre un litt\u00E9ral."},
-
-// Note to translators: The following message indicates that two definitions of
-// a variable. A "global variable" is a variable that is accessible everywher
-// in the stylesheet.
-// ER_DUPLICATE_GLOBAL_VAR - new error message for bugzilla #790
- { ER_DUPLICATE_GLOBAL_VAR,
- "D\u00E9claration de variable globale en double."},
-
-
-// Note to translators: The following message indicates that two definitions of
-// a variable were encountered.
-// ER_DUPLICATE_VAR - new error message for bugzilla #790
- { ER_DUPLICATE_VAR,
- "D\u00E9claration de variable en double."},
-
- // Note to translators: "xsl:template, "name" and "match" are XSLT keywords
- // which must not be translated.
- // ER_TEMPLATE_NAME_MATCH - new error message for bugzilla #789
- { ER_TEMPLATE_NAME_MATCH,
- "xsl:template doit avoir un attribut \"name\" ou \"match\" (ou les deux)"},
-
- // Note to translators: "exclude-result-prefixes" is an XSLT keyword which
- // should not be translated. The message indicates that a namespace prefix
- // encountered as part of the value of the exclude-result-prefixes attribute
- // was in error.
- // ER_INVALID_PREFIX - new error message for bugzilla #788
- { ER_INVALID_PREFIX,
- "Le pr\u00E9fixe de l''\u00E9l\u00E9ment exclude-result-prefixes n''est pas valide : {0}"},
-
- // Note to translators: An "attribute set" is a set of attributes that can
- // be added to an element in the output document as a group. The message
- // indicates that there was a reference to an attribute set named {0} that
- // was never defined.
- // ER_NO_ATTRIB_SET - new error message for bugzilla #782
- { ER_NO_ATTRIB_SET,
- "L''ensemble d''attributs nomm\u00E9 {0} n''existe pas"},
-
- // Note to translators: This message indicates that there was a reference
- // to a function named {0} for which no function definition could be found.
- { ER_FUNCTION_NOT_FOUND,
- "La fonction nomm\u00E9e {0} n''existe pas"},
-
- // Note to translators: This message indicates that the XSLT instruction
- // that is named by the substitution text {0} must not contain other XSLT
- // instructions (content) or a "select" attribute. The word "select" is
- // an XSLT keyword in this case and must not be translated.
- { ER_CANT_HAVE_CONTENT_AND_SELECT,
- "L''\u00E9l\u00E9ment {0} ne doit pas avoir \u00E0 la fois un attribut \"select\" et un attribut de contenu."},
-
- // Note to translators: This message indicates that the value argument
- // of setParameter must be a valid Java Object.
- { ER_INVALID_SET_PARAM_VALUE,
- "La valeur du param\u00E8tre {0} doit \u00EAtre un objet Java valide"},
-
- { ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX_FOR_DEFAULT,
- "L'attribut result-prefix d'un \u00E9l\u00E9ment xsl:namespace-alias a la valeur \"#default\", mais il n'existe aucune d\u00E9claration de l'espace de noms par d\u00E9faut dans la port\u00E9e pour l'\u00E9l\u00E9ment"},
-
- { ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX,
- "L''attribut result-prefix d''un \u00E9l\u00E9ment xsl:namespace-alias a la valeur ''{0}'', mais il n''existe aucune d\u00E9claration d''espace de noms pour le pr\u00E9fixe ''{0}'' dans la port\u00E9e pour l''\u00E9l\u00E9ment."},
-
- { ER_SET_FEATURE_NULL_NAME,
- "Le nom de la fonctionnalit\u00E9 ne peut pas \u00EAtre NULL dans TransformerFactory.setFeature (cha\u00EEne pour le nom, valeur bool\u00E9enne)."},
-
- { ER_GET_FEATURE_NULL_NAME,
- "Le nom de la fonctionnalit\u00E9 ne peut pas \u00EAtre NULL dans TransformerFactory.getFeature (cha\u00EEne pour le nom)."},
-
- { ER_UNSUPPORTED_FEATURE,
- "Impossible de d\u00E9finir la fonctionnalit\u00E9 ''{0}'' sur cette propri\u00E9t\u00E9 TransformerFactory."},
-
- { ER_EXTENSION_ELEMENT_NOT_ALLOWED_IN_SECURE_PROCESSING,
- "L''utilisation de l''\u00E9l\u00E9ment d''extension ''{0}'' n''est pas autoris\u00E9e lorsque la fonctionnalit\u00E9 de traitement s\u00E9curis\u00E9 est d\u00E9finie sur True."},
-
- { ER_NAMESPACE_CONTEXT_NULL_NAMESPACE,
- "Impossible d'obtenir le pr\u00E9fixe pour un URI d'espace de noms NULL."},
-
- { ER_NAMESPACE_CONTEXT_NULL_PREFIX,
- "Impossible d'obtenir l'URI d'espace de noms pour le pr\u00E9fixe NULL."},
-
- { ER_XPATH_RESOLVER_NULL_QNAME,
- "Le nom de fonction ne peut pas \u00EAtre NULL."},
-
- { ER_XPATH_RESOLVER_NEGATIVE_ARITY,
- "L'arit\u00E9 ne peut pas \u00EAtre n\u00E9gative."},
- // Warnings...
-
- { WG_FOUND_CURLYBRACE,
- "'}' trouv\u00E9 mais aucun mod\u00E8le d'attribut ouvert."},
-
- { WG_COUNT_ATTRIB_MATCHES_NO_ANCESTOR,
- "Avertissement : l''attribut \"count\" ne correspond pas \u00E0 un anc\u00EAtre dans xsl:number ! Cible = {0}"},
-
- { WG_EXPR_ATTRIB_CHANGED_TO_SELECT,
- "Ancienne syntaxe : le nom de l'attribut \"expr\" a \u00E9t\u00E9 modifi\u00E9 en \"select\"."},
-
- { WG_NO_LOCALE_IN_FORMATNUMBER,
- "Xalan ne g\u00E8re pas encore le nom de l'environnement local dans la fonction format-number."},
-
- { WG_LOCALE_NOT_FOUND,
- "Avertissement : environnement local introuvable pour xml:lang={0}"},
-
- { WG_CANNOT_MAKE_URL_FROM,
- "Impossible de cr\u00E9er une URL \u00E0 partir de : {0}"},
-
- { WG_CANNOT_LOAD_REQUESTED_DOC,
- "Impossible de charger le document demand\u00E9 : {0}"},
-
- { WG_CANNOT_FIND_COLLATOR,
- "Collator introuvable pour <sort xml:lang={0}"},
-
- { WG_FUNCTIONS_SHOULD_USE_URL,
- "Ancienne syntaxe : l''instruction de la fonction doit utiliser une URL de {0}"},
-
- { WG_ENCODING_NOT_SUPPORTED_USING_UTF8,
- "encodage non pris en charge : {0}, avec UTF-8"},
-
- { WG_ENCODING_NOT_SUPPORTED_USING_JAVA,
- "encodage non pris en charge : {0}, avec Java {1}"},
-
- { WG_SPECIFICITY_CONFLICTS,
- "Conflits de sp\u00E9cificit\u00E9 d\u00E9tect\u00E9s : {0} Les derniers \u00E9l\u00E9ments trouv\u00E9s dans la feuille de style seront utilis\u00E9s."},
-
- { WG_PARSING_AND_PREPARING,
- "========= Analyse et pr\u00E9paration de {0} =========="},
-
- { WG_ATTR_TEMPLATE,
- "Mod\u00E8le attr, {0}"},
-
- { WG_CONFLICT_BETWEEN_XSLSTRIPSPACE_AND_XSLPRESERVESPACE,
- "Conflit de correspondance entre xsl:strip-space et xsl:preserve-space"},
-
- { WG_ATTRIB_NOT_HANDLED,
- "Xalan ne g\u00E8re pas encore l''attribut {0}."},
-
- { WG_NO_DECIMALFORMAT_DECLARATION,
- "Aucune d\u00E9claration trouv\u00E9e pour le format d\u00E9cimal : {0}"},
-
- { WG_OLD_XSLT_NS,
- "Espace de noms XSLT incorrect ou manquant. "},
-
- { WG_ONE_DEFAULT_XSLDECIMALFORMAT_ALLOWED,
- "Une seule d\u00E9claration xsl:decimal-format par d\u00E9faut est autoris\u00E9e."},
-
- { WG_XSLDECIMALFORMAT_NAMES_MUST_BE_UNIQUE,
- "Les noms xsl:decimal-format doivent \u00EAtre uniques. Le nom \"{0}\" a \u00E9t\u00E9 dupliqu\u00E9."},
-
- { WG_ILLEGAL_ATTRIBUTE,
- "{0} a un attribut non admis : {1}"},
-
- { WG_COULD_NOT_RESOLVE_PREFIX,
- "Impossible de r\u00E9soudre le pr\u00E9fixe d''espace de noms : {0}. Le noeud ne sera pas pris en compte."},
-
- { WG_STYLESHEET_REQUIRES_VERSION_ATTRIB,
- "xsl:stylesheet exige un attribut de version."},
-
- { WG_ILLEGAL_ATTRIBUTE_NAME,
- "Nom d''attribut non admis : {0}"},
-
- { WG_ILLEGAL_ATTRIBUTE_VALUE,
- "Valeur non admise utilis\u00E9e pour l''attribut {0} : {1}"},
-
- { WG_EMPTY_SECOND_ARG,
- "Le jeu de noeuds r\u00E9sultant du deuxi\u00E8me argument de la fonction de document est vide. Renvoyez un jeu de noeuds vide."},
-
- //Following are the new WARNING keys added in XALAN code base after Jdk 1.4 (Xalan 2.2-D11)
-
- // Note to translators: "name" and "xsl:processing-instruction" are keywords
- // and must not be translated.
- { WG_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML,
- "La valeur de l'attribut \"name\" du nom xsl:processing-instruction ne doit pas \u00EAtre \"xml\""},
-
- // Note to translators: "name" and "xsl:processing-instruction" are keywords
- // and must not be translated. "NCName" is an XML data-type and must not be
- // translated.
- { WG_PROCESSINGINSTRUCTION_NOTVALID_NCNAME,
- "La valeur de l''attribut ''name'' de xsl:processing-instruction doit \u00EAtre un NCName valide : {0}"},
-
- // Note to translators: This message is reported if the stylesheet that is
- // being processed attempted to construct an XML document with an attribute in a
- // place other than on an element. The substitution text specifies the name of
- // the attribute.
- { WG_ILLEGAL_ATTRIBUTE_POSITION,
- "Impossible d''ajouter l''attribut {0} apr\u00E8s des noeuds enfant ou avant la production d''un \u00E9l\u00E9ment. L''attribut est ignor\u00E9."},
-
- { NO_MODIFICATION_ALLOWED_ERR,
- "Une tentative de modification d'un objet a \u00E9t\u00E9 effectu\u00E9e alors que les modifications ne sont pas autoris\u00E9es."
- },
-
- //Check: WHY THERE IS A GAP B/W NUMBERS in the XSLTErrorResources properties file?
-
- // Other miscellaneous text used inside the code...
- { "ui_language", "fr"},
- { "help_language", "fr" },
- { "language", "fr" },
- { "BAD_CODE", "Le param\u00E8tre createMessage \u00E9tait hors limites"},
- { "FORMAT_FAILED", "Exception g\u00E9n\u00E9r\u00E9e pendant l'appel messageFormat"},
- { "version", ">>>>>>> Version Xalan "},
- { "version2", "<<<<<<<"},
- { "yes", "oui"},
- { "line", "Ligne n\u00B0"},
- { "column","Colonne n\u00B0"},
- { "xsldone", "XSLProcessor : termin\u00E9"},
-
-
- // Note to translators: The following messages provide usage information
- // for the Xalan Process command line. "Process" is the name of a Java class,
- // and should not be translated.
- { "xslProc_option", "Options de classe \"Process\" de ligne de commande Xalan-J :"},
- { "xslProc_option", "Options de classe \"Process\" de ligne de commande Xalan-J :"},
- { "xslProc_invalid_xsltc_option", "L''option {0} n''est pas prise en charge dans le mode XSLTC."},
- { "xslProc_invalid_xalan_option", "L''option {0} ne peut \u00EAtre utilis\u00E9e qu''avec -XSLTC."},
- { "xslProc_no_input", "Erreur : aucune feuille de style ou aucun fichier XML d'entr\u00E9e n'est sp\u00E9cifi\u00E9. Ex\u00E9cutez cette commande sans option concernant les instructions d'utilisation."},
- { "xslProc_common_options", "-Options communes-"},
- { "xslProc_xalan_options", "-Options pour Xalan-"},
- { "xslProc_xsltc_options", "-Options pour XSLTC-"},
- { "xslProc_return_to_continue", "(appuyez sur la touche <Entr\u00E9e> pour continuer)"},
-
- // Note to translators: The option name and the parameter name do not need to
- // be translated. Only translate the messages in parentheses. Note also that
- // leading whitespace in the messages is used to indent the usage information
- // for each option in the English messages.
- // Do not translate the keywords: XSLTC, SAX, DOM and DTM.
- { "optionXSLTC", " [-XSLTC (utiliser XSLTC pour la transformation)]"},
- { "optionIN", " [-IN inputXMLURL]"},
- { "optionXSL", " [-XSL XSLTransformationURL]"},
- { "optionOUT", " [-OUT outputFileName]"},
- { "optionLXCIN", " [-LXCIN compiledStylesheetFileNameIn]"},
- { "optionLXCOUT", " [-LXCOUT compiledStylesheetFileNameOutOut]"},
- { "optionPARSER", " [Nom de classe qualifi\u00E9 complet -PARSER de liaison d'analyseur]"},
- { "optionE", " [-E (Ne pas d\u00E9velopper les r\u00E9f\u00E9rences d'entit\u00E9)]"},
- { "optionV", " [-E (Ne pas d\u00E9velopper les r\u00E9f\u00E9rences d'entit\u00E9)]"},
- { "optionQC", " [-QC (Avertissements de conflits de mod\u00E8les en mode silencieux)]"},
- { "optionQ", " [-Q (Mode silencieux)]"},
- { "optionLF", " [-LF (Utiliser les retours \u00E0 la ligne uniquement en sortie {valeur par d\u00E9faut : CR/LF})]"},
- { "optionCR", " [-CR (Utiliser les retours chariot uniquement en sortie {valeur par d\u00E9faut : CR/LF})]"},
- { "optionESCAPE", " [-ESCAPE (Avec caract\u00E8res d'espacement {valeur par d\u00E9faut : <>&\"'\\r\\n}]"},
- { "optionINDENT", " [-INDENT (Contr\u00F4ler le nombre d'espaces \u00E0 mettre en retrait {valeur par d\u00E9faut : 0})]"},
- { "optionTT", " [-TT (G\u00E9n\u00E9rer une trace des mod\u00E8les pendant qu'ils sont appel\u00E9s.)]"},
- { "optionTG", " [-TG (G\u00E9n\u00E9rer une trace de chaque \u00E9v\u00E9nement de g\u00E9n\u00E9ration.)]"},
- { "optionTS", " [-TS (G\u00E9n\u00E9rer une trace de chaque \u00E9v\u00E9nement de s\u00E9lection.)]"},
- { "optionTTC", " [-TTC (G\u00E9n\u00E9rer une trace des enfants de mod\u00E8le pendant qu'ils sont trait\u00E9s.)]"},
- { "optionTCLASS", " [-TCLASS (Classe TraceListener pour les extensions de trace.)]"},
- { "optionVALIDATE", " [-VALIDATE (D\u00E9finir si la validation est effectu\u00E9e. Par d\u00E9faut, la validation est d\u00E9sactiv\u00E9e.)]"},
- { "optionEDUMP", " [-EDUMP {nom de fichier facultatif} (Effectuer le vidage de la pile sur l'erreur.)]"},
- { "optionXML", " [-XML (Utiliser le programme de formatage XML et ajouter un en-t\u00EAte XML.)]"},
- { "optionTEXT", " [-TEXT (Utiliser le formatage de texte simple.)]"},
- { "optionHTML", " [-HTML (Utiliser le formatage HTML.)]"},
- { "optionPARAM", " [-PARAM Expression de nom (D\u00E9finir un param\u00E8tre de feuille de style)]"},
- { "noParsermsg1", "Echec du processus XSL."},
- { "noParsermsg2", "** Analyseur introuvable **"},
- { "noParsermsg3", "V\u00E9rifiez votre variable d'environnement CLASSPATH."},
- { "noParsermsg4", "Si vous ne disposez pas de l'analyseur XML pour Java d'IBM, vous pouvez le t\u00E9l\u00E9charger sur le site"},
- { "noParsermsg5", "AlphaWorks d'IBM : http://www.alphaworks.ibm.com/formula/xml"},
- { "optionURIRESOLVER", " [-URIRESOLVER Nom de classe complet (URIResolver \u00E0 utiliser pour r\u00E9soudre les URI)]"},
- { "optionENTITYRESOLVER", " [-ENTITYRESOLVER Nom de classe complet (EntityResolver \u00E0 utiliser pour r\u00E9soudre les entit\u00E9s)]"},
- { "optionCONTENTHANDLER", " [-CONTENTHANDLER Nom de classe complet (ContentHandler \u00E0 utiliser pour s\u00E9rialiser la sortie)]"},
- { "optionLINENUMBERS", " [-L Utiliser les num\u00E9ros de ligne pour le document source]"},
- { "optionSECUREPROCESSING", " [-SECURE (D\u00E9finir la fonctionnalit\u00E9 de traitement s\u00E9curis\u00E9 sur True)]"},
-
- // Following are the new options added in XSLTErrorResources.properties files after Jdk 1.4 (Xalan 2.2-D11)
-
-
- { "optionMEDIA", " [-MEDIA mediaType (Utiliser l'attribut de support pour trouver la feuille de style associ\u00E9e \u00E0 un document)]"},
- { "optionFLAVOR", " [-FLAVOR flavorName (Utiliser explicitement s2s=SAX ou d2d=DOM pour effectuer la transformation)] "}, // Added by sboag/scurcuru; experimental
- { "optionDIAG", " [-DIAG (Afficher la dur\u00E9e totale de la transformation, en millisecondes)]"},
- { "optionINCREMENTAL", " [-INCREMENTAL (Demander la construction DTM incr\u00E9mentielle en d\u00E9finissant http://xml.apache.org/xalan/features/incremental true)]"},
- { "optionNOOPTIMIMIZE", " [-NOOPTIMIMIZE (Ne demander aucune optimisation de la feuille de style en d\u00E9finissant http://xml.apache.org/xalan/features/optimize false)]"},
- { "optionRL", " [-RL recursionlimit (Assertion d'une limite num\u00E9rique sur la profondeur de r\u00E9cursivit\u00E9 de la feuille de style)]"},
- { "optionXO", " [-XO [transletName] (Affecter le nom au translet g\u00E9n\u00E9r\u00E9)]"},
- { "optionXD", " [-XD destinationDirectory (Indiquer un r\u00E9pertoire de destination pour le translet)]"},
- { "optionXJ", " [-XJ jarfile (Packager les classes de translet dans un fichier JAR nomm\u00E9 <jarfile>)]"},
- { "optionXP", " [-XP package (Indique un pr\u00E9fixe de nom de package pour toutes les classes de translet g\u00E9n\u00E9r\u00E9es)]"},
-
- //AddITIONAL STRINGS that need L10n
- // Note to translators: The following message describes usage of a particular
- // command-line option that is used to enable the "template inlining"
- // optimization. The optimization involves making a copy of the code
- // generated for a template in another template that refers to it.
- { "optionXN", " [-XN (Activer automatiquement l'image \"inline\" du mod\u00E8le)]" },
- { "optionXX", " [-XX (Activer la sortie de messages de d\u00E9bogage suppl\u00E9mentaires)]"},
- { "optionXT" , " [-XT (Utiliser le translet pour la transformation si possible)]"},
- { "diagTiming"," --------- La transformation de {0} via {1} a pris {2} ms" },
- { "recursionTooDeep","Imbrication de mod\u00E8le trop profonde. Imbrication = {0}, mod\u00E8le {1} {2}" },
- { "nameIs", "le nom est" },
- { "matchPatternIs", "le mod\u00E8le de recherche est" }
-
- };
-
- }
- // ================= INFRASTRUCTURE ======================
-
- /** String for use when a bad error code was encountered. */
- public static final String BAD_CODE = "BAD_CODE";
-
- /** String for use when formatting of the error string failed. */
- public static final String FORMAT_FAILED = "FORMAT_FAILED";
-
- /** General error string. */
- public static final String ERROR_STRING = "#error";
-
- /** String to prepend to error messages. */
- public static final String ERROR_HEADER = "Error: ";
-
- /** String to prepend to warning messages. */
- public static final String WARNING_HEADER = "Warning: ";
-
- /** String to specify the XSLT module. */
- public static final String XSL_HEADER = "XSLT ";
-
- /** String to specify the XML parser module. */
- public static final String XML_HEADER = "XML ";
-
- /** I don't think this is used any more.
- * @deprecated */
- public static final String QUERY_HEADER = "PATTERN ";
-
-
- }
diff --git a/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_it.java b/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_it.java
deleted file mode 100644
index aae3c36..0000000
--- a/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_it.java
+++ /dev/null
@@ -1,1447 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xalan.internal.res;
-
-import java.util.ListResourceBundle;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * Set up error messages.
- * We build a two dimensional array of message keys and
- * message strings. In order to add a new message here,
- * you need to first add a String constant. And
- * you need to enter key , value pair as part of contents
- * Array. You also need to update MAX_CODE for error strings
- * and MAX_WARNING for warnings ( Needed for only information
- * purpose )
- */
-public class XSLTErrorResources_it extends ListResourceBundle
-{
-
-/*
- * This file contains error and warning messages related to Xalan Error
- * Handling.
- *
- * General notes to translators:
- *
- * 1) Xalan (or more properly, Xalan-interpretive) and XSLTC are names of
- * components.
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- * XSLTC is an acronym for XSLT Compiler.
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 5) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 6) "Translet" is an invented term that describes the class file that
- * results from compiling an XML stylesheet into a Java class.
- *
- * 7) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- */
-
- /*
- * Static variables
- */
- public static final String ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX =
- "ER_INVALID_SET_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX";
-
- public static final String ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX_FOR_DEFAULT =
- "ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX_FOR_DEFAULT";
-
- public static final String ER_NO_CURLYBRACE = "ER_NO_CURLYBRACE";
- public static final String ER_FUNCTION_NOT_SUPPORTED = "ER_FUNCTION_NOT_SUPPORTED";
- public static final String ER_ILLEGAL_ATTRIBUTE = "ER_ILLEGAL_ATTRIBUTE";
- public static final String ER_NULL_SOURCENODE_APPLYIMPORTS = "ER_NULL_SOURCENODE_APPLYIMPORTS";
- public static final String ER_CANNOT_ADD = "ER_CANNOT_ADD";
- public static final String ER_NULL_SOURCENODE_HANDLEAPPLYTEMPLATES="ER_NULL_SOURCENODE_HANDLEAPPLYTEMPLATES";
- public static final String ER_NO_NAME_ATTRIB = "ER_NO_NAME_ATTRIB";
- public static final String ER_TEMPLATE_NOT_FOUND = "ER_TEMPLATE_NOT_FOUND";
- public static final String ER_CANT_RESOLVE_NAME_AVT = "ER_CANT_RESOLVE_NAME_AVT";
- public static final String ER_REQUIRES_ATTRIB = "ER_REQUIRES_ATTRIB";
- public static final String ER_MUST_HAVE_TEST_ATTRIB = "ER_MUST_HAVE_TEST_ATTRIB";
- public static final String ER_BAD_VAL_ON_LEVEL_ATTRIB =
- "ER_BAD_VAL_ON_LEVEL_ATTRIB";
- public static final String ER_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML =
- "ER_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML";
- public static final String ER_PROCESSINGINSTRUCTION_NOTVALID_NCNAME =
- "ER_PROCESSINGINSTRUCTION_NOTVALID_NCNAME";
- public static final String ER_NEED_MATCH_ATTRIB = "ER_NEED_MATCH_ATTRIB";
- public static final String ER_NEED_NAME_OR_MATCH_ATTRIB =
- "ER_NEED_NAME_OR_MATCH_ATTRIB";
- public static final String ER_CANT_RESOLVE_NSPREFIX =
- "ER_CANT_RESOLVE_NSPREFIX";
- public static final String ER_ILLEGAL_VALUE = "ER_ILLEGAL_VALUE";
- public static final String ER_NO_OWNERDOC = "ER_NO_OWNERDOC";
- public static final String ER_ELEMTEMPLATEELEM_ERR ="ER_ELEMTEMPLATEELEM_ERR";
- public static final String ER_NULL_CHILD = "ER_NULL_CHILD";
- public static final String ER_NEED_SELECT_ATTRIB = "ER_NEED_SELECT_ATTRIB";
- public static final String ER_NEED_TEST_ATTRIB = "ER_NEED_TEST_ATTRIB";
- public static final String ER_NEED_NAME_ATTRIB = "ER_NEED_NAME_ATTRIB";
- public static final String ER_NO_CONTEXT_OWNERDOC = "ER_NO_CONTEXT_OWNERDOC";
- public static final String ER_COULD_NOT_CREATE_XML_PROC_LIAISON =
- "ER_COULD_NOT_CREATE_XML_PROC_LIAISON";
- public static final String ER_PROCESS_NOT_SUCCESSFUL =
- "ER_PROCESS_NOT_SUCCESSFUL";
- public static final String ER_NOT_SUCCESSFUL = "ER_NOT_SUCCESSFUL";
- public static final String ER_ENCODING_NOT_SUPPORTED =
- "ER_ENCODING_NOT_SUPPORTED";
- public static final String ER_COULD_NOT_CREATE_TRACELISTENER =
- "ER_COULD_NOT_CREATE_TRACELISTENER";
- public static final String ER_KEY_REQUIRES_NAME_ATTRIB =
- "ER_KEY_REQUIRES_NAME_ATTRIB";
- public static final String ER_KEY_REQUIRES_MATCH_ATTRIB =
- "ER_KEY_REQUIRES_MATCH_ATTRIB";
- public static final String ER_KEY_REQUIRES_USE_ATTRIB =
- "ER_KEY_REQUIRES_USE_ATTRIB";
- public static final String ER_REQUIRES_ELEMENTS_ATTRIB =
- "ER_REQUIRES_ELEMENTS_ATTRIB";
- public static final String ER_MISSING_PREFIX_ATTRIB =
- "ER_MISSING_PREFIX_ATTRIB";
- public static final String ER_BAD_STYLESHEET_URL = "ER_BAD_STYLESHEET_URL";
- public static final String ER_FILE_NOT_FOUND = "ER_FILE_NOT_FOUND";
- public static final String ER_IOEXCEPTION = "ER_IOEXCEPTION";
- public static final String ER_NO_HREF_ATTRIB = "ER_NO_HREF_ATTRIB";
- public static final String ER_STYLESHEET_INCLUDES_ITSELF =
- "ER_STYLESHEET_INCLUDES_ITSELF";
- public static final String ER_PROCESSINCLUDE_ERROR ="ER_PROCESSINCLUDE_ERROR";
- public static final String ER_MISSING_LANG_ATTRIB = "ER_MISSING_LANG_ATTRIB";
- public static final String ER_MISSING_CONTAINER_ELEMENT_COMPONENT =
- "ER_MISSING_CONTAINER_ELEMENT_COMPONENT";
- public static final String ER_CAN_ONLY_OUTPUT_TO_ELEMENT =
- "ER_CAN_ONLY_OUTPUT_TO_ELEMENT";
- public static final String ER_PROCESS_ERROR = "ER_PROCESS_ERROR";
- public static final String ER_UNIMPLNODE_ERROR = "ER_UNIMPLNODE_ERROR";
- public static final String ER_NO_SELECT_EXPRESSION ="ER_NO_SELECT_EXPRESSION";
- public static final String ER_CANNOT_SERIALIZE_XSLPROCESSOR =
- "ER_CANNOT_SERIALIZE_XSLPROCESSOR";
- public static final String ER_NO_INPUT_STYLESHEET = "ER_NO_INPUT_STYLESHEET";
- public static final String ER_FAILED_PROCESS_STYLESHEET =
- "ER_FAILED_PROCESS_STYLESHEET";
- public static final String ER_COULDNT_PARSE_DOC = "ER_COULDNT_PARSE_DOC";
- public static final String ER_COULDNT_FIND_FRAGMENT =
- "ER_COULDNT_FIND_FRAGMENT";
- public static final String ER_NODE_NOT_ELEMENT = "ER_NODE_NOT_ELEMENT";
- public static final String ER_FOREACH_NEED_MATCH_OR_NAME_ATTRIB =
- "ER_FOREACH_NEED_MATCH_OR_NAME_ATTRIB";
- public static final String ER_TEMPLATES_NEED_MATCH_OR_NAME_ATTRIB =
- "ER_TEMPLATES_NEED_MATCH_OR_NAME_ATTRIB";
- public static final String ER_NO_CLONE_OF_DOCUMENT_FRAG =
- "ER_NO_CLONE_OF_DOCUMENT_FRAG";
- public static final String ER_CANT_CREATE_ITEM = "ER_CANT_CREATE_ITEM";
- public static final String ER_XMLSPACE_ILLEGAL_VALUE =
- "ER_XMLSPACE_ILLEGAL_VALUE";
- public static final String ER_NO_XSLKEY_DECLARATION =
- "ER_NO_XSLKEY_DECLARATION";
- public static final String ER_CANT_CREATE_URL = "ER_CANT_CREATE_URL";
- public static final String ER_XSLFUNCTIONS_UNSUPPORTED =
- "ER_XSLFUNCTIONS_UNSUPPORTED";
- public static final String ER_PROCESSOR_ERROR = "ER_PROCESSOR_ERROR";
- public static final String ER_NOT_ALLOWED_INSIDE_STYLESHEET =
- "ER_NOT_ALLOWED_INSIDE_STYLESHEET";
- public static final String ER_RESULTNS_NOT_SUPPORTED =
- "ER_RESULTNS_NOT_SUPPORTED";
- public static final String ER_DEFAULTSPACE_NOT_SUPPORTED =
- "ER_DEFAULTSPACE_NOT_SUPPORTED";
- public static final String ER_INDENTRESULT_NOT_SUPPORTED =
- "ER_INDENTRESULT_NOT_SUPPORTED";
- public static final String ER_ILLEGAL_ATTRIB = "ER_ILLEGAL_ATTRIB";
- public static final String ER_UNKNOWN_XSL_ELEM = "ER_UNKNOWN_XSL_ELEM";
- public static final String ER_BAD_XSLSORT_USE = "ER_BAD_XSLSORT_USE";
- public static final String ER_MISPLACED_XSLWHEN = "ER_MISPLACED_XSLWHEN";
- public static final String ER_XSLWHEN_NOT_PARENTED_BY_XSLCHOOSE =
- "ER_XSLWHEN_NOT_PARENTED_BY_XSLCHOOSE";
- public static final String ER_MISPLACED_XSLOTHERWISE =
- "ER_MISPLACED_XSLOTHERWISE";
- public static final String ER_XSLOTHERWISE_NOT_PARENTED_BY_XSLCHOOSE =
- "ER_XSLOTHERWISE_NOT_PARENTED_BY_XSLCHOOSE";
- public static final String ER_NOT_ALLOWED_INSIDE_TEMPLATE =
- "ER_NOT_ALLOWED_INSIDE_TEMPLATE";
- public static final String ER_UNKNOWN_EXT_NS_PREFIX =
- "ER_UNKNOWN_EXT_NS_PREFIX";
- public static final String ER_IMPORTS_AS_FIRST_ELEM =
- "ER_IMPORTS_AS_FIRST_ELEM";
- public static final String ER_IMPORTING_ITSELF = "ER_IMPORTING_ITSELF";
- public static final String ER_XMLSPACE_ILLEGAL_VAL ="ER_XMLSPACE_ILLEGAL_VAL";
- public static final String ER_PROCESSSTYLESHEET_NOT_SUCCESSFUL =
- "ER_PROCESSSTYLESHEET_NOT_SUCCESSFUL";
- public static final String ER_SAX_EXCEPTION = "ER_SAX_EXCEPTION";
- public static final String ER_XSLT_ERROR = "ER_XSLT_ERROR";
- public static final String ER_CURRENCY_SIGN_ILLEGAL=
- "ER_CURRENCY_SIGN_ILLEGAL";
- public static final String ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM =
- "ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM";
- public static final String ER_CANT_RESOLVE_PREFIX_OF_NON_PREFIX_RESOLVER =
- "ER_CANT_RESOLVE_PREFIX_OF_NON_PREFIX_RESOLVER";
- public static final String ER_REDIRECT_COULDNT_GET_FILENAME =
- "ER_REDIRECT_COULDNT_GET_FILENAME";
- public static final String ER_CANNOT_BUILD_FORMATTERLISTENER_IN_REDIRECT =
- "ER_CANNOT_BUILD_FORMATTERLISTENER_IN_REDIRECT";
- public static final String ER_INVALID_PREFIX_IN_EXCLUDERESULTPREFIX =
- "ER_INVALID_PREFIX_IN_EXCLUDERESULTPREFIX";
- public static final String ER_MISSING_NS_URI = "ER_MISSING_NS_URI";
- public static final String ER_MISSING_ARG_FOR_OPTION =
- "ER_MISSING_ARG_FOR_OPTION";
- public static final String ER_INVALID_OPTION = "ER_INVALID_OPTION";
- public static final String ER_MALFORMED_FORMAT_STRING =
- "ER_MALFORMED_FORMAT_STRING";
- public static final String ER_STYLESHEET_REQUIRES_VERSION_ATTRIB =
- "ER_STYLESHEET_REQUIRES_VERSION_ATTRIB";
- public static final String ER_ILLEGAL_ATTRIBUTE_VALUE =
- "ER_ILLEGAL_ATTRIBUTE_VALUE";
- public static final String ER_CHOOSE_REQUIRES_WHEN ="ER_CHOOSE_REQUIRES_WHEN";
- public static final String ER_NO_APPLY_IMPORT_IN_FOR_EACH =
- "ER_NO_APPLY_IMPORT_IN_FOR_EACH";
- public static final String ER_CANT_USE_DTM_FOR_OUTPUT =
- "ER_CANT_USE_DTM_FOR_OUTPUT";
- public static final String ER_CANT_USE_DTM_FOR_INPUT =
- "ER_CANT_USE_DTM_FOR_INPUT";
- public static final String ER_CALL_TO_EXT_FAILED = "ER_CALL_TO_EXT_FAILED";
- public static final String ER_PREFIX_MUST_RESOLVE = "ER_PREFIX_MUST_RESOLVE";
- public static final String ER_INVALID_UTF16_SURROGATE =
- "ER_INVALID_UTF16_SURROGATE";
- public static final String ER_XSLATTRSET_USED_ITSELF =
- "ER_XSLATTRSET_USED_ITSELF";
- public static final String ER_CANNOT_MIX_XERCESDOM ="ER_CANNOT_MIX_XERCESDOM";
- public static final String ER_TOO_MANY_LISTENERS = "ER_TOO_MANY_LISTENERS";
- public static final String ER_IN_ELEMTEMPLATEELEM_READOBJECT =
- "ER_IN_ELEMTEMPLATEELEM_READOBJECT";
- public static final String ER_DUPLICATE_NAMED_TEMPLATE =
- "ER_DUPLICATE_NAMED_TEMPLATE";
- public static final String ER_INVALID_KEY_CALL = "ER_INVALID_KEY_CALL";
- public static final String ER_REFERENCING_ITSELF = "ER_REFERENCING_ITSELF";
- public static final String ER_ILLEGAL_DOMSOURCE_INPUT =
- "ER_ILLEGAL_DOMSOURCE_INPUT";
- public static final String ER_CLASS_NOT_FOUND_FOR_OPTION =
- "ER_CLASS_NOT_FOUND_FOR_OPTION";
- public static final String ER_REQUIRED_ELEM_NOT_FOUND =
- "ER_REQUIRED_ELEM_NOT_FOUND";
- public static final String ER_INPUT_CANNOT_BE_NULL ="ER_INPUT_CANNOT_BE_NULL";
- public static final String ER_URI_CANNOT_BE_NULL = "ER_URI_CANNOT_BE_NULL";
- public static final String ER_FILE_CANNOT_BE_NULL = "ER_FILE_CANNOT_BE_NULL";
- public static final String ER_SOURCE_CANNOT_BE_NULL =
- "ER_SOURCE_CANNOT_BE_NULL";
- public static final String ER_CANNOT_INIT_BSFMGR = "ER_CANNOT_INIT_BSFMGR";
- public static final String ER_CANNOT_CMPL_EXTENSN = "ER_CANNOT_CMPL_EXTENSN";
- public static final String ER_CANNOT_CREATE_EXTENSN =
- "ER_CANNOT_CREATE_EXTENSN";
- public static final String ER_INSTANCE_MTHD_CALL_REQUIRES =
- "ER_INSTANCE_MTHD_CALL_REQUIRES";
- public static final String ER_INVALID_ELEMENT_NAME ="ER_INVALID_ELEMENT_NAME";
- public static final String ER_ELEMENT_NAME_METHOD_STATIC =
- "ER_ELEMENT_NAME_METHOD_STATIC";
- public static final String ER_EXTENSION_FUNC_UNKNOWN =
- "ER_EXTENSION_FUNC_UNKNOWN";
- public static final String ER_MORE_MATCH_CONSTRUCTOR =
- "ER_MORE_MATCH_CONSTRUCTOR";
- public static final String ER_MORE_MATCH_METHOD = "ER_MORE_MATCH_METHOD";
- public static final String ER_MORE_MATCH_ELEMENT = "ER_MORE_MATCH_ELEMENT";
- public static final String ER_INVALID_CONTEXT_PASSED =
- "ER_INVALID_CONTEXT_PASSED";
- public static final String ER_POOL_EXISTS = "ER_POOL_EXISTS";
- public static final String ER_NO_DRIVER_NAME = "ER_NO_DRIVER_NAME";
- public static final String ER_NO_URL = "ER_NO_URL";
- public static final String ER_POOL_SIZE_LESSTHAN_ONE =
- "ER_POOL_SIZE_LESSTHAN_ONE";
- public static final String ER_INVALID_DRIVER = "ER_INVALID_DRIVER";
- public static final String ER_NO_STYLESHEETROOT = "ER_NO_STYLESHEETROOT";
- public static final String ER_ILLEGAL_XMLSPACE_VALUE =
- "ER_ILLEGAL_XMLSPACE_VALUE";
- public static final String ER_PROCESSFROMNODE_FAILED =
- "ER_PROCESSFROMNODE_FAILED";
- public static final String ER_RESOURCE_COULD_NOT_LOAD =
- "ER_RESOURCE_COULD_NOT_LOAD";
- public static final String ER_BUFFER_SIZE_LESSTHAN_ZERO =
- "ER_BUFFER_SIZE_LESSTHAN_ZERO";
- public static final String ER_UNKNOWN_ERROR_CALLING_EXTENSION =
- "ER_UNKNOWN_ERROR_CALLING_EXTENSION";
- public static final String ER_NO_NAMESPACE_DECL = "ER_NO_NAMESPACE_DECL";
- public static final String ER_ELEM_CONTENT_NOT_ALLOWED =
- "ER_ELEM_CONTENT_NOT_ALLOWED";
- public static final String ER_STYLESHEET_DIRECTED_TERMINATION =
- "ER_STYLESHEET_DIRECTED_TERMINATION";
- public static final String ER_ONE_OR_TWO = "ER_ONE_OR_TWO";
- public static final String ER_TWO_OR_THREE = "ER_TWO_OR_THREE";
- public static final String ER_COULD_NOT_LOAD_RESOURCE =
- "ER_COULD_NOT_LOAD_RESOURCE";
- public static final String ER_CANNOT_INIT_DEFAULT_TEMPLATES =
- "ER_CANNOT_INIT_DEFAULT_TEMPLATES";
- public static final String ER_RESULT_NULL = "ER_RESULT_NULL";
- public static final String ER_RESULT_COULD_NOT_BE_SET =
- "ER_RESULT_COULD_NOT_BE_SET";
- public static final String ER_NO_OUTPUT_SPECIFIED = "ER_NO_OUTPUT_SPECIFIED";
- public static final String ER_CANNOT_TRANSFORM_TO_RESULT_TYPE =
- "ER_CANNOT_TRANSFORM_TO_RESULT_TYPE";
- public static final String ER_CANNOT_TRANSFORM_SOURCE_TYPE =
- "ER_CANNOT_TRANSFORM_SOURCE_TYPE";
- public static final String ER_NULL_CONTENT_HANDLER ="ER_NULL_CONTENT_HANDLER";
- public static final String ER_NULL_ERROR_HANDLER = "ER_NULL_ERROR_HANDLER";
- public static final String ER_CANNOT_CALL_PARSE = "ER_CANNOT_CALL_PARSE";
- public static final String ER_NO_PARENT_FOR_FILTER ="ER_NO_PARENT_FOR_FILTER";
- public static final String ER_NO_STYLESHEET_IN_MEDIA =
- "ER_NO_STYLESHEET_IN_MEDIA";
- public static final String ER_NO_STYLESHEET_PI = "ER_NO_STYLESHEET_PI";
- public static final String ER_NOT_SUPPORTED = "ER_NOT_SUPPORTED";
- public static final String ER_PROPERTY_VALUE_BOOLEAN =
- "ER_PROPERTY_VALUE_BOOLEAN";
- public static final String ER_COULD_NOT_FIND_EXTERN_SCRIPT =
- "ER_COULD_NOT_FIND_EXTERN_SCRIPT";
- public static final String ER_RESOURCE_COULD_NOT_FIND =
- "ER_RESOURCE_COULD_NOT_FIND";
- public static final String ER_OUTPUT_PROPERTY_NOT_RECOGNIZED =
- "ER_OUTPUT_PROPERTY_NOT_RECOGNIZED";
- public static final String ER_FAILED_CREATING_ELEMLITRSLT =
- "ER_FAILED_CREATING_ELEMLITRSLT";
- public static final String ER_VALUE_SHOULD_BE_NUMBER =
- "ER_VALUE_SHOULD_BE_NUMBER";
- public static final String ER_VALUE_SHOULD_EQUAL = "ER_VALUE_SHOULD_EQUAL";
- public static final String ER_FAILED_CALLING_METHOD =
- "ER_FAILED_CALLING_METHOD";
- public static final String ER_FAILED_CREATING_ELEMTMPL =
- "ER_FAILED_CREATING_ELEMTMPL";
- public static final String ER_CHARS_NOT_ALLOWED = "ER_CHARS_NOT_ALLOWED";
- public static final String ER_ATTR_NOT_ALLOWED = "ER_ATTR_NOT_ALLOWED";
- public static final String ER_BAD_VALUE = "ER_BAD_VALUE";
- public static final String ER_ATTRIB_VALUE_NOT_FOUND =
- "ER_ATTRIB_VALUE_NOT_FOUND";
- public static final String ER_ATTRIB_VALUE_NOT_RECOGNIZED =
- "ER_ATTRIB_VALUE_NOT_RECOGNIZED";
- public static final String ER_NULL_URI_NAMESPACE = "ER_NULL_URI_NAMESPACE";
- public static final String ER_NUMBER_TOO_BIG = "ER_NUMBER_TOO_BIG";
- public static final String ER_CANNOT_FIND_SAX1_DRIVER =
- "ER_CANNOT_FIND_SAX1_DRIVER";
- public static final String ER_SAX1_DRIVER_NOT_LOADED =
- "ER_SAX1_DRIVER_NOT_LOADED";
- public static final String ER_SAX1_DRIVER_NOT_INSTANTIATED =
- "ER_SAX1_DRIVER_NOT_INSTANTIATED" ;
- public static final String ER_SAX1_DRIVER_NOT_IMPLEMENT_PARSER =
- "ER_SAX1_DRIVER_NOT_IMPLEMENT_PARSER";
- public static final String ER_PARSER_PROPERTY_NOT_SPECIFIED =
- "ER_PARSER_PROPERTY_NOT_SPECIFIED";
- public static final String ER_PARSER_ARG_CANNOT_BE_NULL =
- "ER_PARSER_ARG_CANNOT_BE_NULL" ;
- public static final String ER_FEATURE = "ER_FEATURE";
- public static final String ER_PROPERTY = "ER_PROPERTY" ;
- public static final String ER_NULL_ENTITY_RESOLVER ="ER_NULL_ENTITY_RESOLVER";
- public static final String ER_NULL_DTD_HANDLER = "ER_NULL_DTD_HANDLER" ;
- public static final String ER_NO_DRIVER_NAME_SPECIFIED =
- "ER_NO_DRIVER_NAME_SPECIFIED";
- public static final String ER_NO_URL_SPECIFIED = "ER_NO_URL_SPECIFIED";
- public static final String ER_POOLSIZE_LESS_THAN_ONE =
- "ER_POOLSIZE_LESS_THAN_ONE";
- public static final String ER_INVALID_DRIVER_NAME = "ER_INVALID_DRIVER_NAME";
- public static final String ER_ERRORLISTENER = "ER_ERRORLISTENER";
- public static final String ER_ASSERT_NO_TEMPLATE_PARENT =
- "ER_ASSERT_NO_TEMPLATE_PARENT";
- public static final String ER_ASSERT_REDUNDENT_EXPR_ELIMINATOR =
- "ER_ASSERT_REDUNDENT_EXPR_ELIMINATOR";
- public static final String ER_NOT_ALLOWED_IN_POSITION =
- "ER_NOT_ALLOWED_IN_POSITION";
- public static final String ER_NONWHITESPACE_NOT_ALLOWED_IN_POSITION =
- "ER_NONWHITESPACE_NOT_ALLOWED_IN_POSITION";
- public static final String ER_NAMESPACE_CONTEXT_NULL_NAMESPACE =
- "ER_NAMESPACE_CONTEXT_NULL_NAMESPACE";
- public static final String ER_NAMESPACE_CONTEXT_NULL_PREFIX =
- "ER_NAMESPACE_CONTEXT_NULL_PREFIX";
- public static final String ER_XPATH_RESOLVER_NULL_QNAME =
- "ER_XPATH_RESOLVER_NULL_QNAME";
- public static final String ER_XPATH_RESOLVER_NEGATIVE_ARITY =
- "ER_XPATH_RESOLVER_NEGATIVE_ARITY";
- public static final String INVALID_TCHAR = "INVALID_TCHAR";
- public static final String INVALID_QNAME = "INVALID_QNAME";
- public static final String INVALID_ENUM = "INVALID_ENUM";
- public static final String INVALID_NMTOKEN = "INVALID_NMTOKEN";
- public static final String INVALID_NCNAME = "INVALID_NCNAME";
- public static final String INVALID_BOOLEAN = "INVALID_BOOLEAN";
- public static final String INVALID_NUMBER = "INVALID_NUMBER";
- public static final String ER_ARG_LITERAL = "ER_ARG_LITERAL";
- public static final String ER_DUPLICATE_GLOBAL_VAR ="ER_DUPLICATE_GLOBAL_VAR";
- public static final String ER_DUPLICATE_VAR = "ER_DUPLICATE_VAR";
- public static final String ER_TEMPLATE_NAME_MATCH = "ER_TEMPLATE_NAME_MATCH";
- public static final String ER_INVALID_PREFIX = "ER_INVALID_PREFIX";
- public static final String ER_NO_ATTRIB_SET = "ER_NO_ATTRIB_SET";
- public static final String ER_FUNCTION_NOT_FOUND =
- "ER_FUNCTION_NOT_FOUND";
- public static final String ER_CANT_HAVE_CONTENT_AND_SELECT =
- "ER_CANT_HAVE_CONTENT_AND_SELECT";
- public static final String ER_INVALID_SET_PARAM_VALUE = "ER_INVALID_SET_PARAM_VALUE";
- public static final String ER_SET_FEATURE_NULL_NAME =
- "ER_SET_FEATURE_NULL_NAME";
- public static final String ER_GET_FEATURE_NULL_NAME =
- "ER_GET_FEATURE_NULL_NAME";
- public static final String ER_UNSUPPORTED_FEATURE =
- "ER_UNSUPPORTED_FEATURE";
- public static final String ER_EXTENSION_ELEMENT_NOT_ALLOWED_IN_SECURE_PROCESSING =
- "ER_EXTENSION_ELEMENT_NOT_ALLOWED_IN_SECURE_PROCESSING";
-
- public static final String WG_FOUND_CURLYBRACE = "WG_FOUND_CURLYBRACE";
- public static final String WG_COUNT_ATTRIB_MATCHES_NO_ANCESTOR =
- "WG_COUNT_ATTRIB_MATCHES_NO_ANCESTOR";
- public static final String WG_EXPR_ATTRIB_CHANGED_TO_SELECT =
- "WG_EXPR_ATTRIB_CHANGED_TO_SELECT";
- public static final String WG_NO_LOCALE_IN_FORMATNUMBER =
- "WG_NO_LOCALE_IN_FORMATNUMBER";
- public static final String WG_LOCALE_NOT_FOUND = "WG_LOCALE_NOT_FOUND";
- public static final String WG_CANNOT_MAKE_URL_FROM ="WG_CANNOT_MAKE_URL_FROM";
- public static final String WG_CANNOT_LOAD_REQUESTED_DOC =
- "WG_CANNOT_LOAD_REQUESTED_DOC";
- public static final String WG_CANNOT_FIND_COLLATOR ="WG_CANNOT_FIND_COLLATOR";
- public static final String WG_FUNCTIONS_SHOULD_USE_URL =
- "WG_FUNCTIONS_SHOULD_USE_URL";
- public static final String WG_ENCODING_NOT_SUPPORTED_USING_UTF8 =
- "WG_ENCODING_NOT_SUPPORTED_USING_UTF8";
- public static final String WG_ENCODING_NOT_SUPPORTED_USING_JAVA =
- "WG_ENCODING_NOT_SUPPORTED_USING_JAVA";
- public static final String WG_SPECIFICITY_CONFLICTS =
- "WG_SPECIFICITY_CONFLICTS";
- public static final String WG_PARSING_AND_PREPARING =
- "WG_PARSING_AND_PREPARING";
- public static final String WG_ATTR_TEMPLATE = "WG_ATTR_TEMPLATE";
- public static final String WG_CONFLICT_BETWEEN_XSLSTRIPSPACE_AND_XSLPRESERVESPACE = "WG_CONFLICT_BETWEEN_XSLSTRIPSPACE_AND_XSLPRESERVESP";
- public static final String WG_ATTRIB_NOT_HANDLED = "WG_ATTRIB_NOT_HANDLED";
- public static final String WG_NO_DECIMALFORMAT_DECLARATION =
- "WG_NO_DECIMALFORMAT_DECLARATION";
- public static final String WG_OLD_XSLT_NS = "WG_OLD_XSLT_NS";
- public static final String WG_ONE_DEFAULT_XSLDECIMALFORMAT_ALLOWED =
- "WG_ONE_DEFAULT_XSLDECIMALFORMAT_ALLOWED";
- public static final String WG_XSLDECIMALFORMAT_NAMES_MUST_BE_UNIQUE =
- "WG_XSLDECIMALFORMAT_NAMES_MUST_BE_UNIQUE";
- public static final String WG_ILLEGAL_ATTRIBUTE = "WG_ILLEGAL_ATTRIBUTE";
- public static final String WG_COULD_NOT_RESOLVE_PREFIX =
- "WG_COULD_NOT_RESOLVE_PREFIX";
- public static final String WG_STYLESHEET_REQUIRES_VERSION_ATTRIB =
- "WG_STYLESHEET_REQUIRES_VERSION_ATTRIB";
- public static final String WG_ILLEGAL_ATTRIBUTE_NAME =
- "WG_ILLEGAL_ATTRIBUTE_NAME";
- public static final String WG_ILLEGAL_ATTRIBUTE_VALUE =
- "WG_ILLEGAL_ATTRIBUTE_VALUE";
- public static final String WG_EMPTY_SECOND_ARG = "WG_EMPTY_SECOND_ARG";
- public static final String WG_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML =
- "WG_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML";
- public static final String WG_PROCESSINGINSTRUCTION_NOTVALID_NCNAME =
- "WG_PROCESSINGINSTRUCTION_NOTVALID_NCNAME";
- public static final String WG_ILLEGAL_ATTRIBUTE_POSITION =
- "WG_ILLEGAL_ATTRIBUTE_POSITION";
- public static final String NO_MODIFICATION_ALLOWED_ERR =
- "NO_MODIFICATION_ALLOWED_ERR";
-
- /*
- * Now fill in the message text.
- * Then fill in the message text for that message code in the
- * array. Use the new error code as the index into the array.
- */
-
- // Error messages...
-
- /** Get the lookup table for error messages.
- *
- * @return The message lookup table.
- */
- public Object[][] getContents()
- {
- return new Object[][] {
-
- /** Error message ID that has a null message, but takes in a single object. */
- {"ER0000" , "{0}" },
-
- { ER_NO_CURLYBRACE,
- "Errore: '{' non pu\u00F2 esistere nell'espressione"},
-
- { ER_ILLEGAL_ATTRIBUTE ,
- "{0} ha un attributo non valido: {1}"},
-
- {ER_NULL_SOURCENODE_APPLYIMPORTS ,
- "sourceNode nullo in xsl:apply-imports."},
-
- {ER_CANNOT_ADD,
- "Impossibile aggiungere {0} a {1}"},
-
- { ER_NULL_SOURCENODE_HANDLEAPPLYTEMPLATES,
- "sourceNode nullo in handleApplyTemplatesInstruction."},
-
- { ER_NO_NAME_ATTRIB,
- "{0} deve avere un attributo name."},
-
- {ER_TEMPLATE_NOT_FOUND,
- "Impossibile trovare il modello denominato {0}"},
-
- {ER_CANT_RESOLVE_NAME_AVT,
- "Impossibile risolvere l'AVT del nome in xsl:call-template."},
-
- {ER_REQUIRES_ATTRIB,
- "{0} richiede l''attributo: {1}"},
-
- { ER_MUST_HAVE_TEST_ATTRIB,
- "{0} deve avere un attributo \"test\"."},
-
- {ER_BAD_VAL_ON_LEVEL_ATTRIB,
- "Valore non valido per l''attributo level: {0}"},
-
- {ER_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML,
- "il nome processing-instruction non pu\u00F2 essere 'xml'"},
-
- { ER_PROCESSINGINSTRUCTION_NOTVALID_NCNAME,
- "il nome processing-instruction deve essere un NCName valido: {0}"},
-
- { ER_NEED_MATCH_ATTRIB,
- "{0} deve avere un attributo match se dispone di una modalit\u00E0."},
-
- { ER_NEED_NAME_OR_MATCH_ATTRIB,
- "{0} richiede un nome o un attributo match."},
-
- {ER_CANT_RESOLVE_NSPREFIX,
- "Impossibile risolvere il prefisso spazio di nomi {0}"},
-
- { ER_ILLEGAL_VALUE,
- "xml:space ha un valore non valido {0}"},
-
- { ER_NO_OWNERDOC,
- "Il nodo figlio non dispone di un documento proprietario."},
-
- { ER_ELEMTEMPLATEELEM_ERR,
- "Errore di ElemTemplateElement: {0}"},
-
- { ER_NULL_CHILD,
- "Tentativo di aggiungere un elemento figlio nullo."},
-
- { ER_NEED_SELECT_ATTRIB,
- "{0} richiede un attributo select."},
-
- { ER_NEED_TEST_ATTRIB ,
- "xsl:when deve avere un attributo 'test'."},
-
- { ER_NEED_NAME_ATTRIB,
- "xsl:with-param deve avere un attributo 'name'."},
-
- { ER_NO_CONTEXT_OWNERDOC,
- "il contesto non dispone di un documento proprietario."},
-
- {ER_COULD_NOT_CREATE_XML_PROC_LIAISON,
- "Impossibile creare la relazione TransformerFactory XML {0}"},
-
- {ER_PROCESS_NOT_SUCCESSFUL,
- "Xalan: processo non riuscito."},
-
- { ER_NOT_SUCCESSFUL,
- "Xalan: operazione non riuscita."},
-
- { ER_ENCODING_NOT_SUPPORTED,
- "Codifica non supportata: {0}"},
-
- {ER_COULD_NOT_CREATE_TRACELISTENER,
- "Impossibile creare TraceListener {0}"},
-
- {ER_KEY_REQUIRES_NAME_ATTRIB,
- "xsl:key richiede un attributo 'name'."},
-
- { ER_KEY_REQUIRES_MATCH_ATTRIB,
- "xsl:key richiede un attributo 'match'."},
-
- { ER_KEY_REQUIRES_USE_ATTRIB,
- "xsl:key richiede un attributo 'use'."},
-
- { ER_REQUIRES_ELEMENTS_ATTRIB,
- "(StylesheetHandler) {0} richiede un attributo ''elements''."},
-
- { ER_MISSING_PREFIX_ATTRIB,
- "(StylesheetHandler) {0} attributo ''prefix'' mancante"},
-
- { ER_BAD_STYLESHEET_URL,
- "URL del foglio di stile non valido: {0}"},
-
- { ER_FILE_NOT_FOUND,
- "File del foglio di stile non trovato: {0}"},
-
- { ER_IOEXCEPTION,
- "Eccezione IO con il file foglio di stile: {0}"},
-
- { ER_NO_HREF_ATTRIB,
- "(StylesheetHandler) Impossibile trovare l''attributo href per {0}"},
-
- { ER_STYLESHEET_INCLUDES_ITSELF,
- "(StylesheetHandler) {0} include s\u00E9 stesso direttamente o indirettamente."},
-
- { ER_PROCESSINCLUDE_ERROR,
- "Errore di StylesheetHandler.processInclude: {0}"},
-
- { ER_MISSING_LANG_ATTRIB,
- "(StylesheetHandler) {0} attributo ''lang'' mancante"},
-
- { ER_MISSING_CONTAINER_ELEMENT_COMPONENT,
- "(StylesheetHandler) posizione errata dell''elemento {0}. Elemento ''component'' del contenitore mancante."},
-
- { ER_CAN_ONLY_OUTPUT_TO_ELEMENT,
- "L'output pu\u00F2 essere eseguito solo su Element, DocumentFragment, Document o PrintWriter."},
-
- { ER_PROCESS_ERROR,
- "Errore di StylesheetRoot.process"},
-
- { ER_UNIMPLNODE_ERROR,
- "Errore di UnImplNode: {0}"},
-
- { ER_NO_SELECT_EXPRESSION,
- "Errore. L'espressione di selezione dell'xpath (-select) non \u00E8 stata trovata."},
-
- { ER_CANNOT_SERIALIZE_XSLPROCESSOR,
- "Impossibile serializzare un XSLProcessor."},
-
- { ER_NO_INPUT_STYLESHEET,
- "Input del foglio di stile non specificato."},
-
- { ER_FAILED_PROCESS_STYLESHEET,
- "Elaborazione del foglio di stile non riuscita."},
-
- { ER_COULDNT_PARSE_DOC,
- "Impossibile analizzare il documento {0}"},
-
- { ER_COULDNT_FIND_FRAGMENT,
- "Impossibile trovare il frammento {0}"},
-
- { ER_NODE_NOT_ELEMENT,
- "Il nodo a cui punta l''identificativo di frammento non \u00E8 un elemento: {0}"},
-
- { ER_FOREACH_NEED_MATCH_OR_NAME_ATTRIB,
- "for-each deve avere un attributo match o name"},
-
- { ER_TEMPLATES_NEED_MATCH_OR_NAME_ATTRIB,
- "templates deve avere un attributo match o name"},
-
- { ER_NO_CLONE_OF_DOCUMENT_FRAG,
- "Nessun duplicato di un frammento di documento."},
-
- { ER_CANT_CREATE_ITEM,
- "Impossibile creare una voce nella struttura dei risultati: {0}"},
-
- { ER_XMLSPACE_ILLEGAL_VALUE,
- "xml:space nell''XML di origine ha un valore non valido {0}"},
-
- { ER_NO_XSLKEY_DECLARATION,
- "Nessuna dichiarazione xsl:key per {0}."},
-
- { ER_CANT_CREATE_URL,
- "Errore. Impossibile creare l''URL per {0}"},
-
- { ER_XSLFUNCTIONS_UNSUPPORTED,
- "xsl:functions non supportato"},
-
- { ER_PROCESSOR_ERROR,
- "Errore di TransformerFactory XSLT"},
-
- { ER_NOT_ALLOWED_INSIDE_STYLESHEET,
- "(StylesheetHandler) {0} non consentito in un foglio di stile."},
-
- { ER_RESULTNS_NOT_SUPPORTED,
- "result-ns non pi\u00F9 supportato. Utilizzare xsl:output."},
-
- { ER_DEFAULTSPACE_NOT_SUPPORTED,
- "default-space non pi\u00F9 supportato. Utilizzare xsl:strip-space o xsl:preserve-space."},
-
- { ER_INDENTRESULT_NOT_SUPPORTED,
- "indent-result non pi\u00F9 supportato. Utilizzare xsl:output."},
-
- { ER_ILLEGAL_ATTRIB,
- "(StylesheetHandler) {0} ha un attributo non valido: {1}"},
-
- { ER_UNKNOWN_XSL_ELEM,
- "Elemento XSL sconosciuto: {0}"},
-
- { ER_BAD_XSLSORT_USE,
- "(StylesheetHandler) xsl:sort pu\u00F2 essere utilizzato solo con xsl:apply-templates o xsl:for-each."},
-
- { ER_MISPLACED_XSLWHEN,
- "(StylesheetHandler) posizione errata di xsl:when."},
-
- { ER_XSLWHEN_NOT_PARENTED_BY_XSLCHOOSE,
- "(StylesheetHandler) xsl:when non associato da xsl:choose."},
-
- { ER_MISPLACED_XSLOTHERWISE,
- "(StylesheetHandler) posizione errata di xsl:otherwise."},
-
- { ER_XSLOTHERWISE_NOT_PARENTED_BY_XSLCHOOSE,
- "(StylesheetHandler) xsl:otherwise non associato da xsl:choose."},
-
- { ER_NOT_ALLOWED_INSIDE_TEMPLATE,
- "(StylesheetHandler) {0} non consentito in un modello."},
-
- { ER_UNKNOWN_EXT_NS_PREFIX,
- "(StylesheetHandler) {0} prefisso spazio di nomi estensione {1} sconosciuto"},
-
- { ER_IMPORTS_AS_FIRST_ELEM,
- "(StylesheetHandler) Le importazioni possono essere eseguite solo come primi elementi nel foglio di stile."},
-
- { ER_IMPORTING_ITSELF,
- "(StylesheetHandler) {0} importa s\u00E9 stesso direttamente o indirettamente."},
-
- { ER_XMLSPACE_ILLEGAL_VAL,
- "(StylesheetHandler) xml:space ha un valore non valido {0}"},
-
- { ER_PROCESSSTYLESHEET_NOT_SUCCESSFUL,
- "processStylesheet non riuscito."},
-
- { ER_SAX_EXCEPTION,
- "Eccezione SAX"},
-
-// add this message to fix bug 21478
- { ER_FUNCTION_NOT_SUPPORTED,
- "Funzione non supportata."},
-
- { ER_XSLT_ERROR,
- "Errore XSLT"},
-
- { ER_CURRENCY_SIGN_ILLEGAL,
- "il simbolo della valuta non \u00E8 consentito in una stringa di pattern di formato"},
-
- { ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM,
- "Funzione del documento non supportata nel DOM del foglio di stile."},
-
- { ER_CANT_RESOLVE_PREFIX_OF_NON_PREFIX_RESOLVER,
- "Impossibile risolvere il prefisso di un resolver senza prefissi."},
-
- { ER_REDIRECT_COULDNT_GET_FILENAME,
- "Estensione di reindirizzamento: impossibile trovare il nome file. L'attributo file o select deve restituire una stringa valida."},
-
- { ER_CANNOT_BUILD_FORMATTERLISTENER_IN_REDIRECT,
- "Impossibile creare FormatterListener nell'estensione di reindirizzamento."},
-
- { ER_INVALID_PREFIX_IN_EXCLUDERESULTPREFIX,
- "Il prefisso in exclude-result-prefixes non \u00E8 valido: {0}"},
-
- { ER_MISSING_NS_URI,
- "URI dello spazio di nomi mancante per il prefisso specificato"},
-
- { ER_MISSING_ARG_FOR_OPTION,
- "Argomento mancante per l''opzione: {0}"},
-
- { ER_INVALID_OPTION,
- "Opzione non valida: {0}"},
-
- { ER_MALFORMED_FORMAT_STRING,
- "Stringa con formato errato: {0}"},
-
- { ER_STYLESHEET_REQUIRES_VERSION_ATTRIB,
- "xsl:stylesheet richiede un attributo 'version'."},
-
- { ER_ILLEGAL_ATTRIBUTE_VALUE,
- "L''attributo {0} ha un valore non valido {1}"},
-
- { ER_CHOOSE_REQUIRES_WHEN,
- "xsl:choose richiede xsl:when"},
-
- { ER_NO_APPLY_IMPORT_IN_FOR_EACH,
- "xsl:apply-imports non consentito in xsl:for-each"},
-
- { ER_CANT_USE_DTM_FOR_OUTPUT,
- "Impossibile utilizzare DTMLiaison per un nodo DOM di output... Passare com.sun.org.apache.xpath.internal.DOM2Helper."},
-
- { ER_CANT_USE_DTM_FOR_INPUT,
- "Impossibile utilizzare DTMLiaison per un nodo DOM di input... Passare com.sun.org.apache.xpath.internal.DOM2Helper."},
-
- { ER_CALL_TO_EXT_FAILED,
- "Chiamata all''elemento di estensione non riuscita: {0}"},
-
- { ER_PREFIX_MUST_RESOLVE,
- "Il prefisso deve essere risolto in uno spazio di nomi: {0}"},
-
- { ER_INVALID_UTF16_SURROGATE,
- "Rilevato surrogato UTF-16 non valido: {0}?"},
-
- { ER_XSLATTRSET_USED_ITSELF,
- "xsl:attribute-set {0} utilizza s\u00E9 stesso, il che pu\u00F2 causare un loop infinito."},
-
- { ER_CANNOT_MIX_XERCESDOM,
- "Impossibile unire input non Xerces-DOM con output Xerces-DOM."},
-
- { ER_TOO_MANY_LISTENERS,
- "addTraceListenersToStylesheet - TooManyListenersException"},
-
- { ER_IN_ELEMTEMPLATEELEM_READOBJECT,
- "In ElemTemplateElement.readObject: {0}"},
-
- { ER_DUPLICATE_NAMED_TEMPLATE,
- "Sono stati trovati pi\u00F9 modelli denominati {0}"},
-
- { ER_INVALID_KEY_CALL,
- "Chiamata di funzione non valida: non sono consentite chiamate recursive key()"},
-
- { ER_REFERENCING_ITSELF,
- "La variabile {0} fa riferimento a s\u00E9 stessa direttamente o indirettamente."},
-
- { ER_ILLEGAL_DOMSOURCE_INPUT,
- "Il nodo di input non pu\u00F2 essere nullo per un DOMSource per newTemplates."},
-
- { ER_CLASS_NOT_FOUND_FOR_OPTION,
- "File di classe non trovato per l''opzione {0}"},
-
- { ER_REQUIRED_ELEM_NOT_FOUND,
- "Elemento richiesto non trovato: {0}"},
-
- { ER_INPUT_CANNOT_BE_NULL,
- "InputStream non pu\u00F2 essere nullo"},
-
- { ER_URI_CANNOT_BE_NULL,
- "L'URI non pu\u00F2 essere nullo"},
-
- { ER_FILE_CANNOT_BE_NULL,
- "Il file non pu\u00F2 essere nullo"},
-
- { ER_SOURCE_CANNOT_BE_NULL,
- "InputSource non pu\u00F2 essere nullo"},
-
- { ER_CANNOT_INIT_BSFMGR,
- "Impossibile inizializzare BSF Manager"},
-
- { ER_CANNOT_CMPL_EXTENSN,
- "Impossibile compilare l'estensione"},
-
- { ER_CANNOT_CREATE_EXTENSN,
- "Impossibile creare l''estensione {0}. Motivo: {1}"},
-
- { ER_INSTANCE_MTHD_CALL_REQUIRES,
- "La chiamata del metodo di istanza {0} richiede un''istanza di oggetto come primo argomento"},
-
- { ER_INVALID_ELEMENT_NAME,
- "Specificato nome elemento {0} non valido"},
-
- { ER_ELEMENT_NAME_METHOD_STATIC,
- "Il metodo di nome elemento deve essere statico {0}"},
-
- { ER_EXTENSION_FUNC_UNKNOWN,
- "Funzione di estensione {0} : {1} sconosciuta"},
-
- { ER_MORE_MATCH_CONSTRUCTOR,
- "Esistono pi\u00F9 corrispondenze migliori per il costruttore di {0}"},
-
- { ER_MORE_MATCH_METHOD,
- "Esistono pi\u00F9 corrispondenze migliori per il metodo {0}"},
-
- { ER_MORE_MATCH_ELEMENT,
- "Esistono pi\u00F9 corrispondenze migliori per il metodo di elemento {0}"},
-
- { ER_INVALID_CONTEXT_PASSED,
- "Passato contesto non valido per valutare {0}"},
-
- { ER_POOL_EXISTS,
- "Il pool esiste gi\u00E0"},
-
- { ER_NO_DRIVER_NAME,
- "Nessun nome driver specificato"},
-
- { ER_NO_URL,
- "Nessun URL specificato"},
-
- { ER_POOL_SIZE_LESSTHAN_ONE,
- "La dimensione del pool \u00E8 minore di uno."},
-
- { ER_INVALID_DRIVER,
- "Specificato nome driver non valido."},
-
- { ER_NO_STYLESHEETROOT,
- "Radice del foglio di stile non trovata."},
-
- { ER_ILLEGAL_XMLSPACE_VALUE,
- "Valore non valido per xml:space"},
-
- { ER_PROCESSFROMNODE_FAILED,
- "processFromNode non riuscito"},
-
- { ER_RESOURCE_COULD_NOT_LOAD,
- "Impossibile caricare la risorsa [ {0} ]: {1} \n {2} \t {3}"},
-
- { ER_BUFFER_SIZE_LESSTHAN_ZERO,
- "Dimensione buffer <=0"},
-
- { ER_UNKNOWN_ERROR_CALLING_EXTENSION,
- "Errore sconosciuto durante la chiamata dell'estensione"},
-
- { ER_NO_NAMESPACE_DECL,
- "Il prefisso {0} non ha una dichiarazione di spazio di nomi corrispondente"},
-
- { ER_ELEM_CONTENT_NOT_ALLOWED,
- "Contenuto di elemento non consentito per lang=javaclass {0}"},
-
- { ER_STYLESHEET_DIRECTED_TERMINATION,
- "Il foglio di stile ha causato l'interruzione"},
-
- { ER_ONE_OR_TWO,
- "1 o 2"},
-
- { ER_TWO_OR_THREE,
- "2 o 3"},
-
- { ER_COULD_NOT_LOAD_RESOURCE,
- "Impossibile caricare {0} (verificare CLASSPATH); verranno utilizzati i valori predefiniti"},
-
- { ER_CANNOT_INIT_DEFAULT_TEMPLATES,
- "Impossibile inizializzare i modelli predefiniti"},
-
- { ER_RESULT_NULL,
- "Il risultato non deve essere nullo"},
-
- { ER_RESULT_COULD_NOT_BE_SET,
- "Impossibile impostare il risultato"},
-
- { ER_NO_OUTPUT_SPECIFIED,
- "Nessun output specificato"},
-
- { ER_CANNOT_TRANSFORM_TO_RESULT_TYPE,
- "Impossibile eseguire la trasformazione in un risultato di tipo {0}"},
-
- { ER_CANNOT_TRANSFORM_SOURCE_TYPE,
- "Impossibile eseguire la trasformazione in un''origine di tipo {0}"},
-
- { ER_NULL_CONTENT_HANDLER,
- "Handler dei contenuti nullo"},
-
- { ER_NULL_ERROR_HANDLER,
- "Handler degli errori nullo"},
-
- { ER_CANNOT_CALL_PARSE,
- "impossibile richiamare parse se non \u00E8 stato impostato ContentHandler"},
-
- { ER_NO_PARENT_FOR_FILTER,
- "Nessun elemento padre per il filtro"},
-
- { ER_NO_STYLESHEET_IN_MEDIA,
- "Nessun foglio di stile trovato in {0}, media= {1}."},
-
- { ER_NO_STYLESHEET_PI,
- "Nessun PI xml-stylesheet trovato in {0}"},
-
- { ER_NOT_SUPPORTED,
- "Non supportato: {0}"},
-
- { ER_PROPERTY_VALUE_BOOLEAN,
- "Il valore della propriet\u00E0 {0} deve essere un''istanza booleana"},
-
- { ER_COULD_NOT_FIND_EXTERN_SCRIPT,
- "Impossibile recuperare lo script esterno in {0}"},
-
- { ER_RESOURCE_COULD_NOT_FIND,
- "Risorsa [ {0} ] non trovata.\n {1}"},
-
- { ER_OUTPUT_PROPERTY_NOT_RECOGNIZED,
- "Propriet\u00E0 di output non riconosciuta: {0}"},
-
- { ER_FAILED_CREATING_ELEMLITRSLT,
- "Creazione dell'istanza ElemLiteralResult non riuscita"},
-
- //Earlier (JDK 1.4 XALAN 2.2-D11) at key code '204' the key name was ER_PRIORITY_NOT_PARSABLE
- // In latest Xalan code base key name is ER_VALUE_SHOULD_BE_NUMBER. This should also be taken care
- //in locale specific files like XSLTErrorResources_de.java, XSLTErrorResources_fr.java etc.
- //NOTE: Not only the key name but message has also been changed.
- { ER_VALUE_SHOULD_BE_NUMBER,
- "Il valore per {0} deve contenere un numero analizzabile"},
-
- { ER_VALUE_SHOULD_EQUAL,
- "Il valore per {0} deve corrispondere a yes o no"},
-
- { ER_FAILED_CALLING_METHOD,
- "Richiamo del metodo {0} non riuscito"},
-
- { ER_FAILED_CREATING_ELEMTMPL,
- "Creazione dell'istanza ElemTemplateElement non riuscita"},
-
- { ER_CHARS_NOT_ALLOWED,
- "Non sono consentiti caratteri in questo punto del documento"},
-
- { ER_ATTR_NOT_ALLOWED,
- "L''attributo \"{0}\" non \u00E8 consentito nell''elemento {1}."},
-
- { ER_BAD_VALUE,
- "{0} valore non valido {1} "},
-
- { ER_ATTRIB_VALUE_NOT_FOUND,
- "{0} valore di attributo non trovato "},
-
- { ER_ATTRIB_VALUE_NOT_RECOGNIZED,
- "{0} valore di attributo non riconosciuto "},
-
- { ER_NULL_URI_NAMESPACE,
- "Tentativo di generare un prefisso spazio di nomi con URI nullo"},
-
- { ER_NUMBER_TOO_BIG,
- "Tentativo di formattare un numero superiore a quello del numero intero di tipo Long pi\u00F9 grande"},
-
- { ER_CANNOT_FIND_SAX1_DRIVER,
- "Impossibile trovare la classe di driver SAX1 {0}"},
-
- { ER_SAX1_DRIVER_NOT_LOADED,
- "La classe di driver SAX1 {0} \u00E8 stata trovata, ma non pu\u00F2 essere caricata."},
-
- { ER_SAX1_DRIVER_NOT_INSTANTIATED,
- "La classe di driver SAX1 {0} \u00E8 stata caricata, ma non \u00E8 possibile creare un''istanza."},
-
- { ER_SAX1_DRIVER_NOT_IMPLEMENT_PARSER,
- "La classe di driver SAX1 {0} non implementa org.xml.sax.Parser"},
-
- { ER_PARSER_PROPERTY_NOT_SPECIFIED,
- "Propriet\u00E0 di sistema org.xml.sax.parser non specificata"},
-
- { ER_PARSER_ARG_CANNOT_BE_NULL,
- "L''argomento del parser non deve essere nullo"},
-
- { ER_FEATURE,
- "Funzione: {0}"},
-
- { ER_PROPERTY,
- "Propriet\u00E0: {0}"},
-
- { ER_NULL_ENTITY_RESOLVER,
- "Resolver di entit\u00E0 nullo"},
-
- { ER_NULL_DTD_HANDLER,
- "Handler DTD nullo"},
-
- { ER_NO_DRIVER_NAME_SPECIFIED,
- "Nessun nome driver specificato."},
-
- { ER_NO_URL_SPECIFIED,
- "Nessun URL specificato."},
-
- { ER_POOLSIZE_LESS_THAN_ONE,
- "La dimensione del pool \u00E8 minore di uno."},
-
- { ER_INVALID_DRIVER_NAME,
- "Specificato nome driver non valido."},
-
- { ER_ERRORLISTENER,
- "ErrorListener"},
-
-
-// Note to translators: The following message should not normally be displayed
-// to users. It describes a situation in which the processor has detected
-// an internal consistency problem in itself, and it provides this message
-// for the developer to help diagnose the problem. The name
-// 'ElemTemplateElement' is the name of a class, and should not be
-// translated.
- { ER_ASSERT_NO_TEMPLATE_PARENT,
- "Errore del programmatore. L'espressione non ha un elemento padre ElemTemplateElement."},
-
-
-// Note to translators: The following message should not normally be displayed
-// to users. It describes a situation in which the processor has detected
-// an internal consistency problem in itself, and it provides this message
-// for the developer to help diagnose the problem. The substitution text
-// provides further information in order to diagnose the problem. The name
-// 'RedundentExprEliminator' is the name of a class, and should not be
-// translated.
- { ER_ASSERT_REDUNDENT_EXPR_ELIMINATOR,
- "Asserzione del programmatore in RedundentExprEliminator: {0}"},
-
- { ER_NOT_ALLOWED_IN_POSITION,
- "{0} non consentito in questa posizione nel figlio di stile."},
-
- { ER_NONWHITESPACE_NOT_ALLOWED_IN_POSITION,
- "Testo senza spazi non consentito in questa posizione nel figlio di stile."},
-
- // This code is shared with warning codes.
- // SystemId Unknown
- { INVALID_TCHAR,
- "Valore non valido {1} utilizzato per l''attributo CHAR {0}. Un attributo di tipo CHAR deve avere un solo carattere."},
-
- // Note to translators: The following message is used if the value of
- // an attribute in a stylesheet is invalid. "QNAME" is the XML data-type of
- // the attribute, and should not be translated. The substitution text {1} is
- // the attribute value and {0} is the attribute name.
- //The following codes are shared with the warning codes...
- { INVALID_QNAME,
- "Valore non valido {1} utilizzato per l''attributo QNAME {0}"},
-
- // Note to translators: The following message is used if the value of
- // an attribute in a stylesheet is invalid. "ENUM" is the XML data-type of
- // the attribute, and should not be translated. The substitution text {1} is
- // the attribute value, {0} is the attribute name, and {2} is a list of valid
- // values.
- { INVALID_ENUM,
- "Valore non valido {1} utilizzato per l''attributo ENUM {0}. Valori validi: {2}."},
-
-// Note to translators: The following message is used if the value of
-// an attribute in a stylesheet is invalid. "NMTOKEN" is the XML data-type
-// of the attribute, and should not be translated. The substitution text {1} is
-// the attribute value and {0} is the attribute name.
- { INVALID_NMTOKEN,
- "Valore non valido {1} utilizzato per l''attributo NMTOKEN {0} "},
-
-// Note to translators: The following message is used if the value of
-// an attribute in a stylesheet is invalid. "NCNAME" is the XML data-type
-// of the attribute, and should not be translated. The substitution text {1} is
-// the attribute value and {0} is the attribute name.
- { INVALID_NCNAME,
- "Valore non valido {1} utilizzato per l''attributo NCNAME {0} "},
-
-// Note to translators: The following message is used if the value of
-// an attribute in a stylesheet is invalid. "boolean" is the XSLT data-type
-// of the attribute, and should not be translated. The substitution text {1} is
-// the attribute value and {0} is the attribute name.
- { INVALID_BOOLEAN,
- "Valore non valido {1} utilizzato per l''attributo booleano {0} "},
-
-// Note to translators: The following message is used if the value of
-// an attribute in a stylesheet is invalid. "number" is the XSLT data-type
-// of the attribute, and should not be translated. The substitution text {1} is
-// the attribute value and {0} is the attribute name.
- { INVALID_NUMBER,
- "Valore non valido {1} utilizzato per l''attributo numerico {0} "},
-
-
- // End of shared codes...
-
-// Note to translators: A "match pattern" is a special form of XPath expression
-// that is used for matching patterns. The substitution text is the name of
-// a function. The message indicates that when this function is referenced in
-// a match pattern, its argument must be a string literal (or constant.)
-// ER_ARG_LITERAL - new error message for bugzilla //5202
- { ER_ARG_LITERAL,
- "L''argomento per {0} nel pattern di corrispondenza deve essere un valore."},
-
-// Note to translators: The following message indicates that two definitions of
-// a variable. A "global variable" is a variable that is accessible everywher
-// in the stylesheet.
-// ER_DUPLICATE_GLOBAL_VAR - new error message for bugzilla #790
- { ER_DUPLICATE_GLOBAL_VAR,
- "Dichiarazione di variabili globali duplicate."},
-
-
-// Note to translators: The following message indicates that two definitions of
-// a variable were encountered.
-// ER_DUPLICATE_VAR - new error message for bugzilla #790
- { ER_DUPLICATE_VAR,
- "Dichiarazione di variabili duplicate."},
-
- // Note to translators: "xsl:template, "name" and "match" are XSLT keywords
- // which must not be translated.
- // ER_TEMPLATE_NAME_MATCH - new error message for bugzilla #789
- { ER_TEMPLATE_NAME_MATCH,
- "xsl:template deve avere un attributo name o match o entrambi"},
-
- // Note to translators: "exclude-result-prefixes" is an XSLT keyword which
- // should not be translated. The message indicates that a namespace prefix
- // encountered as part of the value of the exclude-result-prefixes attribute
- // was in error.
- // ER_INVALID_PREFIX - new error message for bugzilla #788
- { ER_INVALID_PREFIX,
- "Il prefisso in exclude-result-prefixes non \u00E8 valido: {0}"},
-
- // Note to translators: An "attribute set" is a set of attributes that can
- // be added to an element in the output document as a group. The message
- // indicates that there was a reference to an attribute set named {0} that
- // was never defined.
- // ER_NO_ATTRIB_SET - new error message for bugzilla #782
- { ER_NO_ATTRIB_SET,
- "il set di attributi denominato {0} non esiste"},
-
- // Note to translators: This message indicates that there was a reference
- // to a function named {0} for which no function definition could be found.
- { ER_FUNCTION_NOT_FOUND,
- "La funzione denominata {0} non esiste"},
-
- // Note to translators: This message indicates that the XSLT instruction
- // that is named by the substitution text {0} must not contain other XSLT
- // instructions (content) or a "select" attribute. The word "select" is
- // an XSLT keyword in this case and must not be translated.
- { ER_CANT_HAVE_CONTENT_AND_SELECT,
- "L''elemento {0} non deve avere entrambi gli attributi content e select."},
-
- // Note to translators: This message indicates that the value argument
- // of setParameter must be a valid Java Object.
- { ER_INVALID_SET_PARAM_VALUE,
- "Il valore del parametro {0} deve essere un oggetto Java valido"},
-
- { ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX_FOR_DEFAULT,
- "L'attributo result-prefix di un elemento xsl:namespace-alias ha il valore '#default', ma non esiste alcuna dichiarazione dello spazio di nomi predefinito nell'ambito per l'elemento."},
-
- { ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX,
- "L''attributo result-prefix di un elemento xsl:namespace-alias ha il valore ''{0}'', ma non esiste alcuna dichiarazione dello spazio di nomi per il prefisso ''{0}'' nell''ambito per l''elemento."},
-
- { ER_SET_FEATURE_NULL_NAME,
- "Il nome funzione non pu\u00F2 essere nullo in TransformerFactory.setFeature (nome stringa, valore booleano)."},
-
- { ER_GET_FEATURE_NULL_NAME,
- "Il nome funzione non pu\u00F2 essere nullo in TransformerFactory.getFeature (nome stringa)."},
-
- { ER_UNSUPPORTED_FEATURE,
- "Impossibile impostare la funzione ''{0}'' in questo TransformerFactory."},
-
- { ER_EXTENSION_ELEMENT_NOT_ALLOWED_IN_SECURE_PROCESSING,
- "Non \u00E8 consentito utilizzare l''elemento di estensione ''{0}'' se la funzione di elaborazione sicura \u00E8 impostata su true."},
-
- { ER_NAMESPACE_CONTEXT_NULL_NAMESPACE,
- "Impossibile recuperare il prefisso per un URI di spazio di nomi nullo."},
-
- { ER_NAMESPACE_CONTEXT_NULL_PREFIX,
- "Impossibile recuperare l'URI di spazio di nomi per un prefisso nullo."},
-
- { ER_XPATH_RESOLVER_NULL_QNAME,
- "Il nome funzione non pu\u00F2 essere nullo."},
-
- { ER_XPATH_RESOLVER_NEGATIVE_ARITY,
- "L'arity non pu\u00F2 essere negativa."},
- // Warnings...
-
- { WG_FOUND_CURLYBRACE,
- "Trovato '}', ma non esistono modelli di attributo aperti."},
-
- { WG_COUNT_ATTRIB_MATCHES_NO_ANCESTOR,
- "Avvertenza: l''attributo count non corrisponde a un predecessore in xsl:number. Destinazione = {0}"},
-
- { WG_EXPR_ATTRIB_CHANGED_TO_SELECT,
- "Sintassi obsoleta: il nome dell'attributo 'expr' \u00E8 stato cambiato in 'select'."},
-
- { WG_NO_LOCALE_IN_FORMATNUMBER,
- "Xalan non gestisce ancora il nome di impostazioni nazionali nella funzione format-number."},
-
- { WG_LOCALE_NOT_FOUND,
- "Avvertenza: impossibile trovare le impostazioni nazionali per xml:lang={0}"},
-
- { WG_CANNOT_MAKE_URL_FROM,
- "Impossibile creare un URL da {0}"},
-
- { WG_CANNOT_LOAD_REQUESTED_DOC,
- "Impossibile caricare il documento richiesto: {0}"},
-
- { WG_CANNOT_FIND_COLLATOR,
- "Impossibile trovare Collator per <sort xml:lang={0}"},
-
- { WG_FUNCTIONS_SHOULD_USE_URL,
- "Sintassi obsoleta: le istruzioni delle funzioni devono utilizzare un URL {0}"},
-
- { WG_ENCODING_NOT_SUPPORTED_USING_UTF8,
- "Codifica {0} non supportata. Verr\u00E0 utilizzata la codifica UTF-8."},
-
- { WG_ENCODING_NOT_SUPPORTED_USING_JAVA,
- "Codifica {0} non supportata. Verr\u00E0 utilizzata la codifica Java {1}."},
-
- { WG_SPECIFICITY_CONFLICTS,
- "Sono stati trovati conflitti di specificit\u00E0: {0}. Verr\u00E0 utilizzato l''ultimo trovato nel foglio di stile."},
-
- { WG_PARSING_AND_PREPARING,
- "========= Analisi e preparazione di {0} in corso =========="},
-
- { WG_ATTR_TEMPLATE,
- "Modello attributi {0}"},
-
- { WG_CONFLICT_BETWEEN_XSLSTRIPSPACE_AND_XSLPRESERVESPACE,
- "Conflitto di corrispondenza tra xsl:strip-space e xsl:preserve-space"},
-
- { WG_ATTRIB_NOT_HANDLED,
- "Xalan non gestisce ancora l''attributo {0}."},
-
- { WG_NO_DECIMALFORMAT_DECLARATION,
- "Nessuna dichiarazione trovata per il formato decimale: {0}"},
-
- { WG_OLD_XSLT_NS,
- "Spazio di nomi XSLT mancante o errato. "},
-
- { WG_ONE_DEFAULT_XSLDECIMALFORMAT_ALLOWED,
- "\u00C8 consentita una sola dichiarazione xsl:decimal-format predefinita."},
-
- { WG_XSLDECIMALFORMAT_NAMES_MUST_BE_UNIQUE,
- "I nomi xsl:decimal-format devono essere univoci. Il nome \"{0}\" \u00E8 stato duplicato."},
-
- { WG_ILLEGAL_ATTRIBUTE,
- "{0} ha un attributo non valido: {1}"},
-
- { WG_COULD_NOT_RESOLVE_PREFIX,
- "Impossibile risolvere il prefisso spazio di nomi {0}. Il nodo verr\u00E0 ignorato."},
-
- { WG_STYLESHEET_REQUIRES_VERSION_ATTRIB,
- "xsl:stylesheet richiede un attributo 'version'."},
-
- { WG_ILLEGAL_ATTRIBUTE_NAME,
- "Nome attributo non valido: {0}"},
-
- { WG_ILLEGAL_ATTRIBUTE_VALUE,
- "Valore non valido utilizzato per l''attributo {0}: {1}"},
-
- { WG_EMPTY_SECOND_ARG,
- "Il set di nodi risultante dal secondo argomento della funzione di documento \u00E8 vuoto. Verr\u00E0 restituito un set di nodi vuoto."},
-
- //Following are the new WARNING keys added in XALAN code base after Jdk 1.4 (Xalan 2.2-D11)
-
- // Note to translators: "name" and "xsl:processing-instruction" are keywords
- // and must not be translated.
- { WG_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML,
- "Il valore dell'attributo 'name' del nome xsl:processing-instruction non deve essere 'xml'"},
-
- // Note to translators: "name" and "xsl:processing-instruction" are keywords
- // and must not be translated. "NCName" is an XML data-type and must not be
- // translated.
- { WG_PROCESSINGINSTRUCTION_NOTVALID_NCNAME,
- "Il valore dell''attributo ''name'' di xsl:processing-instruction deve essere un NCName valido: {0}"},
-
- // Note to translators: This message is reported if the stylesheet that is
- // being processed attempted to construct an XML document with an attribute in a
- // place other than on an element. The substitution text specifies the name of
- // the attribute.
- { WG_ILLEGAL_ATTRIBUTE_POSITION,
- "Impossibile aggiungere l''attributo {0} dopo i nodi figlio o prima che sia prodotto un elemento. L''attributo verr\u00E0 ignorato."},
-
- { NO_MODIFICATION_ALLOWED_ERR,
- "Si \u00E8 tentato di modificare un oggetto non modificabile."
- },
-
- //Check: WHY THERE IS A GAP B/W NUMBERS in the XSLTErrorResources properties file?
-
- // Other miscellaneous text used inside the code...
- { "ui_language", "it"},
- { "help_language", "it" },
- { "language", "it" },
- { "BAD_CODE", "Parametro per createMessage fuori limite"},
- { "FORMAT_FAILED", "Eccezione durante la chiamata messageFormat"},
- { "version", ">>>>>>> Versione Xalan "},
- { "version2", "<<<<<<<"},
- { "yes", "s\u00EC"},
- { "line", "N. riga"},
- { "column","N. colonna"},
- { "xsldone", "XSLProcessor: operazione completata"},
-
-
- // Note to translators: The following messages provide usage information
- // for the Xalan Process command line. "Process" is the name of a Java class,
- // and should not be translated.
- { "xslProc_option", "Opzioni classe di processo per riga di comando Xalan-J:"},
- { "xslProc_option", "Opzioni classe di processo per riga di comando Xalan-J:"},
- { "xslProc_invalid_xsltc_option", "Opzione {0} non supportata in modalit\u00E0 XSLTC."},
- { "xslProc_invalid_xalan_option", "L''opzione {0} pu\u00F2 essere utilizzata solo con -XSLTC."},
- { "xslProc_no_input", "Errore: non \u00E8 stato specificato alcun foglio di stile o XML di input. Eseguire questo comando senza opzioni per visualizzare le istruzioni sull'uso."},
- { "xslProc_common_options", "-Opzioni comuni-"},
- { "xslProc_xalan_options", "-Opzioni per Xalan-"},
- { "xslProc_xsltc_options", "-Opzioni per XSLTC-"},
- { "xslProc_return_to_continue", "(premere <invio> per continuare)"},
-
- // Note to translators: The option name and the parameter name do not need to
- // be translated. Only translate the messages in parentheses. Note also that
- // leading whitespace in the messages is used to indent the usage information
- // for each option in the English messages.
- // Do not translate the keywords: XSLTC, SAX, DOM and DTM.
- { "optionXSLTC", " [-XSLTC (usa XSLTC per la trasformazione)]"},
- { "optionIN", " [-IN inputXMLURL]"},
- { "optionXSL", " [-XSL XSLTransformationURL]"},
- { "optionOUT", " [-OUT outputFileName]"},
- { "optionLXCIN", " [-LXCIN compiledStylesheetFileNameIn]"},
- { "optionLXCOUT", " [-LXCOUT compiledStylesheetFileNameOutOut]"},
- { "optionPARSER", " [-PARSER nome classe completamente qualificato per la relazione del parser]"},
- { "optionE", " [-E (non espande i riferimenti alle entit\u00E0)]"},
- { "optionV", " [-E (non espande i riferimenti alle entit\u00E0)]"},
- { "optionQC", " [-QC (avvertenze silenziose per i conflitti di pattern)]"},
- { "optionQ", " [-Q (modalit\u00E0 silenziosa)]"},
- { "optionLF", " [-LF (usa avanzamenti riga solo nell'output {il valore predefinito \u00E8 CR/LF})]"},
- { "optionCR", " [-CR (usa ritorni a capo solo nell'output {il valore predefinito \u00E8 CR/LF})]"},
- { "optionESCAPE", " [-ESCAPE (caratteri da sottoporre a escape {il valore predefinito \u00E8 <>&\"'\\r\\n}]"},
- { "optionINDENT", " [-INDENT (determina il numero di spazi da indentare {il valore predefinito \u00E8 0})]"},
- { "optionTT", " [-TT (tiene traccia dei modelli mentre vengono richiamati.)]"},
- { "optionTG", " [-TG (tiene traccia di ogni evento di generazione.)]"},
- { "optionTS", " [-TS (tiene traccia di ogni evento di selezione.)]"},
- { "optionTTC", " [-TTC (tiene traccia degli elementi secondari di modello mentre vengono elaborati.)]"},
- { "optionTCLASS", " [-TCLASS (classe TraceListener per tenere traccia delle estensioni.)]"},
- { "optionVALIDATE", " [-VALIDATE (imposta se viene eseguita la convalida che, per impostazione predefinita, \u00E8 disattivata.)]"},
- { "optionEDUMP", " [-EDUMP {nome file facoltativo} (esegue stackdump in caso di errore.)]"},
- { "optionXML", " [-XML (usa il formatter XML e aggiunge l'intestazione XML.)]"},
- { "optionTEXT", " [-TEXT (usa il formatter di testo semplice.)]"},
- { "optionHTML", " [-HTML (usa il formatter HTML.)]"},
- { "optionPARAM", " [-PARAM espressione nome (imposta un parametro di foglio di stile)]"},
- { "noParsermsg1", "Processo XSL non riuscito."},
- { "noParsermsg2", "** Impossibile trovare il parser **"},
- { "noParsermsg3", "Controllare il classpath."},
- { "noParsermsg4", "Se non \u00E8 disponibile un parser XML di IBM per Java, \u00E8 possibile scaricarlo da"},
- { "noParsermsg5", "AlphaWorks di IBM: http://www.alphaworks.ibm.com/formula/xml"},
- { "optionURIRESOLVER", " [-URIRESOLVER nome classe completo (URIResolver da utilizzare per risolvere gli URI)]"},
- { "optionENTITYRESOLVER", " [-ENTITYRESOLVER nome classe completo (EntityResolver da utilizzare per risolvere le entit\u00E0)]"},
- { "optionCONTENTHANDLER", " [-CONTENTHANDLER nome classe completo (ContentHandler da utilizzare per serializzare l'output)]"},
- { "optionLINENUMBERS", " [-L utilizza i numeri di riga per il documento di origine]"},
- { "optionSECUREPROCESSING", " [-SECURE (imposta la funzione di elaborazione sicura su true.)]"},
-
- // Following are the new options added in XSLTErrorResources.properties files after Jdk 1.4 (Xalan 2.2-D11)
-
-
- { "optionMEDIA", " [-MEDIA mediaType (utilizza l'attributo media per trovare il foglio di stile associato a un documento.)]"},
- { "optionFLAVOR", " [-FLAVOR flavorName (utilizza esplicitamente s2s=SAX o d2d=DOM per eseguire la trasformazione.)] "}, // Added by sboag/scurcuru; experimental
- { "optionDIAG", " [-DIAG (visualizza i millisecondi totali richiesti per la trasformazione.)]"},
- { "optionINCREMENTAL", " [-INCREMENTAL (richiede la creazione incrementale di DTM impostando http://xml.apache.org/xalan/features/incremental su true.)]"},
- { "optionNOOPTIMIMIZE", " [-NOOPTIMIMIZE (richiede che non venga elaborata l'ottimizzazione dei fogli di stile impostando http://xml.apache.org/xalan/features/optimize su false.)]"},
- { "optionRL", " [-RL recursionlimit (stabilisce un limite numerico sulla profondit\u00E0 ricorsiva dei fogli di stile.)]"},
- { "optionXO", " [-XO [transletName] (assegna un nome al translet creato)]"},
- { "optionXD", " [-XD destinationDirectory (specifica una directory di destinazione per il translet)]"},
- { "optionXJ", " [-XJ jarfile (crea un package di classi di translet in un file jar denominato <jarfile>)]"},
- { "optionXP", " [-XP package (specifica un prefisso nome package per tutte le classi di translet generate)]"},
-
- //AddITIONAL STRINGS that need L10n
- // Note to translators: The following message describes usage of a particular
- // command-line option that is used to enable the "template inlining"
- // optimization. The optimization involves making a copy of the code
- // generated for a template in another template that refers to it.
- { "optionXN", " [-XN (abilita l'inserimento in linea dei modelli)]" },
- { "optionXX", " [-XX (attiva l'output di altri messaggi di debug)]"},
- { "optionXT" , " [-XT (utilizza il translet per eseguire la trasformazione, se possibile.)]"},
- { "diagTiming"," --------- La trasformazione di {0} mediante {1} ha richiesto {2} ms" },
- { "recursionTooDeep","Nidificazione dei modelli troppo profonda. Nidificazione = {0}, modello {1} {2}." },
- { "nameIs", "il nome \u00E8" },
- { "matchPatternIs", "il pattern di corrispondenza \u00E8" }
-
- };
-
- }
- // ================= INFRASTRUCTURE ======================
-
- /** String for use when a bad error code was encountered. */
- public static final String BAD_CODE = "BAD_CODE";
-
- /** String for use when formatting of the error string failed. */
- public static final String FORMAT_FAILED = "FORMAT_FAILED";
-
- /** General error string. */
- public static final String ERROR_STRING = "#error";
-
- /** String to prepend to error messages. */
- public static final String ERROR_HEADER = "Error: ";
-
- /** String to prepend to warning messages. */
- public static final String WARNING_HEADER = "Warning: ";
-
- /** String to specify the XSLT module. */
- public static final String XSL_HEADER = "XSLT ";
-
- /** String to specify the XML parser module. */
- public static final String XML_HEADER = "XML ";
-
- /** I don't think this is used any more.
- * @deprecated */
- public static final String QUERY_HEADER = "PATTERN ";
-
-
- }
diff --git a/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ja.java b/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ja.java
deleted file mode 100644
index 7460d3e..0000000
--- a/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ja.java
+++ /dev/null
@@ -1,1447 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xalan.internal.res;
-
-import java.util.ListResourceBundle;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * Set up error messages.
- * We build a two dimensional array of message keys and
- * message strings. In order to add a new message here,
- * you need to first add a String constant. And
- * you need to enter key , value pair as part of contents
- * Array. You also need to update MAX_CODE for error strings
- * and MAX_WARNING for warnings ( Needed for only information
- * purpose )
- */
-public class XSLTErrorResources_ja extends ListResourceBundle
-{
-
-/*
- * This file contains error and warning messages related to Xalan Error
- * Handling.
- *
- * General notes to translators:
- *
- * 1) Xalan (or more properly, Xalan-interpretive) and XSLTC are names of
- * components.
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- * XSLTC is an acronym for XSLT Compiler.
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 5) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 6) "Translet" is an invented term that describes the class file that
- * results from compiling an XML stylesheet into a Java class.
- *
- * 7) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- */
-
- /*
- * Static variables
- */
- public static final String ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX =
- "ER_INVALID_SET_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX";
-
- public static final String ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX_FOR_DEFAULT =
- "ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX_FOR_DEFAULT";
-
- public static final String ER_NO_CURLYBRACE = "ER_NO_CURLYBRACE";
- public static final String ER_FUNCTION_NOT_SUPPORTED = "ER_FUNCTION_NOT_SUPPORTED";
- public static final String ER_ILLEGAL_ATTRIBUTE = "ER_ILLEGAL_ATTRIBUTE";
- public static final String ER_NULL_SOURCENODE_APPLYIMPORTS = "ER_NULL_SOURCENODE_APPLYIMPORTS";
- public static final String ER_CANNOT_ADD = "ER_CANNOT_ADD";
- public static final String ER_NULL_SOURCENODE_HANDLEAPPLYTEMPLATES="ER_NULL_SOURCENODE_HANDLEAPPLYTEMPLATES";
- public static final String ER_NO_NAME_ATTRIB = "ER_NO_NAME_ATTRIB";
- public static final String ER_TEMPLATE_NOT_FOUND = "ER_TEMPLATE_NOT_FOUND";
- public static final String ER_CANT_RESOLVE_NAME_AVT = "ER_CANT_RESOLVE_NAME_AVT";
- public static final String ER_REQUIRES_ATTRIB = "ER_REQUIRES_ATTRIB";
- public static final String ER_MUST_HAVE_TEST_ATTRIB = "ER_MUST_HAVE_TEST_ATTRIB";
- public static final String ER_BAD_VAL_ON_LEVEL_ATTRIB =
- "ER_BAD_VAL_ON_LEVEL_ATTRIB";
- public static final String ER_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML =
- "ER_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML";
- public static final String ER_PROCESSINGINSTRUCTION_NOTVALID_NCNAME =
- "ER_PROCESSINGINSTRUCTION_NOTVALID_NCNAME";
- public static final String ER_NEED_MATCH_ATTRIB = "ER_NEED_MATCH_ATTRIB";
- public static final String ER_NEED_NAME_OR_MATCH_ATTRIB =
- "ER_NEED_NAME_OR_MATCH_ATTRIB";
- public static final String ER_CANT_RESOLVE_NSPREFIX =
- "ER_CANT_RESOLVE_NSPREFIX";
- public static final String ER_ILLEGAL_VALUE = "ER_ILLEGAL_VALUE";
- public static final String ER_NO_OWNERDOC = "ER_NO_OWNERDOC";
- public static final String ER_ELEMTEMPLATEELEM_ERR ="ER_ELEMTEMPLATEELEM_ERR";
- public static final String ER_NULL_CHILD = "ER_NULL_CHILD";
- public static final String ER_NEED_SELECT_ATTRIB = "ER_NEED_SELECT_ATTRIB";
- public static final String ER_NEED_TEST_ATTRIB = "ER_NEED_TEST_ATTRIB";
- public static final String ER_NEED_NAME_ATTRIB = "ER_NEED_NAME_ATTRIB";
- public static final String ER_NO_CONTEXT_OWNERDOC = "ER_NO_CONTEXT_OWNERDOC";
- public static final String ER_COULD_NOT_CREATE_XML_PROC_LIAISON =
- "ER_COULD_NOT_CREATE_XML_PROC_LIAISON";
- public static final String ER_PROCESS_NOT_SUCCESSFUL =
- "ER_PROCESS_NOT_SUCCESSFUL";
- public static final String ER_NOT_SUCCESSFUL = "ER_NOT_SUCCESSFUL";
- public static final String ER_ENCODING_NOT_SUPPORTED =
- "ER_ENCODING_NOT_SUPPORTED";
- public static final String ER_COULD_NOT_CREATE_TRACELISTENER =
- "ER_COULD_NOT_CREATE_TRACELISTENER";
- public static final String ER_KEY_REQUIRES_NAME_ATTRIB =
- "ER_KEY_REQUIRES_NAME_ATTRIB";
- public static final String ER_KEY_REQUIRES_MATCH_ATTRIB =
- "ER_KEY_REQUIRES_MATCH_ATTRIB";
- public static final String ER_KEY_REQUIRES_USE_ATTRIB =
- "ER_KEY_REQUIRES_USE_ATTRIB";
- public static final String ER_REQUIRES_ELEMENTS_ATTRIB =
- "ER_REQUIRES_ELEMENTS_ATTRIB";
- public static final String ER_MISSING_PREFIX_ATTRIB =
- "ER_MISSING_PREFIX_ATTRIB";
- public static final String ER_BAD_STYLESHEET_URL = "ER_BAD_STYLESHEET_URL";
- public static final String ER_FILE_NOT_FOUND = "ER_FILE_NOT_FOUND";
- public static final String ER_IOEXCEPTION = "ER_IOEXCEPTION";
- public static final String ER_NO_HREF_ATTRIB = "ER_NO_HREF_ATTRIB";
- public static final String ER_STYLESHEET_INCLUDES_ITSELF =
- "ER_STYLESHEET_INCLUDES_ITSELF";
- public static final String ER_PROCESSINCLUDE_ERROR ="ER_PROCESSINCLUDE_ERROR";
- public static final String ER_MISSING_LANG_ATTRIB = "ER_MISSING_LANG_ATTRIB";
- public static final String ER_MISSING_CONTAINER_ELEMENT_COMPONENT =
- "ER_MISSING_CONTAINER_ELEMENT_COMPONENT";
- public static final String ER_CAN_ONLY_OUTPUT_TO_ELEMENT =
- "ER_CAN_ONLY_OUTPUT_TO_ELEMENT";
- public static final String ER_PROCESS_ERROR = "ER_PROCESS_ERROR";
- public static final String ER_UNIMPLNODE_ERROR = "ER_UNIMPLNODE_ERROR";
- public static final String ER_NO_SELECT_EXPRESSION ="ER_NO_SELECT_EXPRESSION";
- public static final String ER_CANNOT_SERIALIZE_XSLPROCESSOR =
- "ER_CANNOT_SERIALIZE_XSLPROCESSOR";
- public static final String ER_NO_INPUT_STYLESHEET = "ER_NO_INPUT_STYLESHEET";
- public static final String ER_FAILED_PROCESS_STYLESHEET =
- "ER_FAILED_PROCESS_STYLESHEET";
- public static final String ER_COULDNT_PARSE_DOC = "ER_COULDNT_PARSE_DOC";
- public static final String ER_COULDNT_FIND_FRAGMENT =
- "ER_COULDNT_FIND_FRAGMENT";
- public static final String ER_NODE_NOT_ELEMENT = "ER_NODE_NOT_ELEMENT";
- public static final String ER_FOREACH_NEED_MATCH_OR_NAME_ATTRIB =
- "ER_FOREACH_NEED_MATCH_OR_NAME_ATTRIB";
- public static final String ER_TEMPLATES_NEED_MATCH_OR_NAME_ATTRIB =
- "ER_TEMPLATES_NEED_MATCH_OR_NAME_ATTRIB";
- public static final String ER_NO_CLONE_OF_DOCUMENT_FRAG =
- "ER_NO_CLONE_OF_DOCUMENT_FRAG";
- public static final String ER_CANT_CREATE_ITEM = "ER_CANT_CREATE_ITEM";
- public static final String ER_XMLSPACE_ILLEGAL_VALUE =
- "ER_XMLSPACE_ILLEGAL_VALUE";
- public static final String ER_NO_XSLKEY_DECLARATION =
- "ER_NO_XSLKEY_DECLARATION";
- public static final String ER_CANT_CREATE_URL = "ER_CANT_CREATE_URL";
- public static final String ER_XSLFUNCTIONS_UNSUPPORTED =
- "ER_XSLFUNCTIONS_UNSUPPORTED";
- public static final String ER_PROCESSOR_ERROR = "ER_PROCESSOR_ERROR";
- public static final String ER_NOT_ALLOWED_INSIDE_STYLESHEET =
- "ER_NOT_ALLOWED_INSIDE_STYLESHEET";
- public static final String ER_RESULTNS_NOT_SUPPORTED =
- "ER_RESULTNS_NOT_SUPPORTED";
- public static final String ER_DEFAULTSPACE_NOT_SUPPORTED =
- "ER_DEFAULTSPACE_NOT_SUPPORTED";
- public static final String ER_INDENTRESULT_NOT_SUPPORTED =
- "ER_INDENTRESULT_NOT_SUPPORTED";
- public static final String ER_ILLEGAL_ATTRIB = "ER_ILLEGAL_ATTRIB";
- public static final String ER_UNKNOWN_XSL_ELEM = "ER_UNKNOWN_XSL_ELEM";
- public static final String ER_BAD_XSLSORT_USE = "ER_BAD_XSLSORT_USE";
- public static final String ER_MISPLACED_XSLWHEN = "ER_MISPLACED_XSLWHEN";
- public static final String ER_XSLWHEN_NOT_PARENTED_BY_XSLCHOOSE =
- "ER_XSLWHEN_NOT_PARENTED_BY_XSLCHOOSE";
- public static final String ER_MISPLACED_XSLOTHERWISE =
- "ER_MISPLACED_XSLOTHERWISE";
- public static final String ER_XSLOTHERWISE_NOT_PARENTED_BY_XSLCHOOSE =
- "ER_XSLOTHERWISE_NOT_PARENTED_BY_XSLCHOOSE";
- public static final String ER_NOT_ALLOWED_INSIDE_TEMPLATE =
- "ER_NOT_ALLOWED_INSIDE_TEMPLATE";
- public static final String ER_UNKNOWN_EXT_NS_PREFIX =
- "ER_UNKNOWN_EXT_NS_PREFIX";
- public static final String ER_IMPORTS_AS_FIRST_ELEM =
- "ER_IMPORTS_AS_FIRST_ELEM";
- public static final String ER_IMPORTING_ITSELF = "ER_IMPORTING_ITSELF";
- public static final String ER_XMLSPACE_ILLEGAL_VAL ="ER_XMLSPACE_ILLEGAL_VAL";
- public static final String ER_PROCESSSTYLESHEET_NOT_SUCCESSFUL =
- "ER_PROCESSSTYLESHEET_NOT_SUCCESSFUL";
- public static final String ER_SAX_EXCEPTION = "ER_SAX_EXCEPTION";
- public static final String ER_XSLT_ERROR = "ER_XSLT_ERROR";
- public static final String ER_CURRENCY_SIGN_ILLEGAL=
- "ER_CURRENCY_SIGN_ILLEGAL";
- public static final String ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM =
- "ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM";
- public static final String ER_CANT_RESOLVE_PREFIX_OF_NON_PREFIX_RESOLVER =
- "ER_CANT_RESOLVE_PREFIX_OF_NON_PREFIX_RESOLVER";
- public static final String ER_REDIRECT_COULDNT_GET_FILENAME =
- "ER_REDIRECT_COULDNT_GET_FILENAME";
- public static final String ER_CANNOT_BUILD_FORMATTERLISTENER_IN_REDIRECT =
- "ER_CANNOT_BUILD_FORMATTERLISTENER_IN_REDIRECT";
- public static final String ER_INVALID_PREFIX_IN_EXCLUDERESULTPREFIX =
- "ER_INVALID_PREFIX_IN_EXCLUDERESULTPREFIX";
- public static final String ER_MISSING_NS_URI = "ER_MISSING_NS_URI";
- public static final String ER_MISSING_ARG_FOR_OPTION =
- "ER_MISSING_ARG_FOR_OPTION";
- public static final String ER_INVALID_OPTION = "ER_INVALID_OPTION";
- public static final String ER_MALFORMED_FORMAT_STRING =
- "ER_MALFORMED_FORMAT_STRING";
- public static final String ER_STYLESHEET_REQUIRES_VERSION_ATTRIB =
- "ER_STYLESHEET_REQUIRES_VERSION_ATTRIB";
- public static final String ER_ILLEGAL_ATTRIBUTE_VALUE =
- "ER_ILLEGAL_ATTRIBUTE_VALUE";
- public static final String ER_CHOOSE_REQUIRES_WHEN ="ER_CHOOSE_REQUIRES_WHEN";
- public static final String ER_NO_APPLY_IMPORT_IN_FOR_EACH =
- "ER_NO_APPLY_IMPORT_IN_FOR_EACH";
- public static final String ER_CANT_USE_DTM_FOR_OUTPUT =
- "ER_CANT_USE_DTM_FOR_OUTPUT";
- public static final String ER_CANT_USE_DTM_FOR_INPUT =
- "ER_CANT_USE_DTM_FOR_INPUT";
- public static final String ER_CALL_TO_EXT_FAILED = "ER_CALL_TO_EXT_FAILED";
- public static final String ER_PREFIX_MUST_RESOLVE = "ER_PREFIX_MUST_RESOLVE";
- public static final String ER_INVALID_UTF16_SURROGATE =
- "ER_INVALID_UTF16_SURROGATE";
- public static final String ER_XSLATTRSET_USED_ITSELF =
- "ER_XSLATTRSET_USED_ITSELF";
- public static final String ER_CANNOT_MIX_XERCESDOM ="ER_CANNOT_MIX_XERCESDOM";
- public static final String ER_TOO_MANY_LISTENERS = "ER_TOO_MANY_LISTENERS";
- public static final String ER_IN_ELEMTEMPLATEELEM_READOBJECT =
- "ER_IN_ELEMTEMPLATEELEM_READOBJECT";
- public static final String ER_DUPLICATE_NAMED_TEMPLATE =
- "ER_DUPLICATE_NAMED_TEMPLATE";
- public static final String ER_INVALID_KEY_CALL = "ER_INVALID_KEY_CALL";
- public static final String ER_REFERENCING_ITSELF = "ER_REFERENCING_ITSELF";
- public static final String ER_ILLEGAL_DOMSOURCE_INPUT =
- "ER_ILLEGAL_DOMSOURCE_INPUT";
- public static final String ER_CLASS_NOT_FOUND_FOR_OPTION =
- "ER_CLASS_NOT_FOUND_FOR_OPTION";
- public static final String ER_REQUIRED_ELEM_NOT_FOUND =
- "ER_REQUIRED_ELEM_NOT_FOUND";
- public static final String ER_INPUT_CANNOT_BE_NULL ="ER_INPUT_CANNOT_BE_NULL";
- public static final String ER_URI_CANNOT_BE_NULL = "ER_URI_CANNOT_BE_NULL";
- public static final String ER_FILE_CANNOT_BE_NULL = "ER_FILE_CANNOT_BE_NULL";
- public static final String ER_SOURCE_CANNOT_BE_NULL =
- "ER_SOURCE_CANNOT_BE_NULL";
- public static final String ER_CANNOT_INIT_BSFMGR = "ER_CANNOT_INIT_BSFMGR";
- public static final String ER_CANNOT_CMPL_EXTENSN = "ER_CANNOT_CMPL_EXTENSN";
- public static final String ER_CANNOT_CREATE_EXTENSN =
- "ER_CANNOT_CREATE_EXTENSN";
- public static final String ER_INSTANCE_MTHD_CALL_REQUIRES =
- "ER_INSTANCE_MTHD_CALL_REQUIRES";
- public static final String ER_INVALID_ELEMENT_NAME ="ER_INVALID_ELEMENT_NAME";
- public static final String ER_ELEMENT_NAME_METHOD_STATIC =
- "ER_ELEMENT_NAME_METHOD_STATIC";
- public static final String ER_EXTENSION_FUNC_UNKNOWN =
- "ER_EXTENSION_FUNC_UNKNOWN";
- public static final String ER_MORE_MATCH_CONSTRUCTOR =
- "ER_MORE_MATCH_CONSTRUCTOR";
- public static final String ER_MORE_MATCH_METHOD = "ER_MORE_MATCH_METHOD";
- public static final String ER_MORE_MATCH_ELEMENT = "ER_MORE_MATCH_ELEMENT";
- public static final String ER_INVALID_CONTEXT_PASSED =
- "ER_INVALID_CONTEXT_PASSED";
- public static final String ER_POOL_EXISTS = "ER_POOL_EXISTS";
- public static final String ER_NO_DRIVER_NAME = "ER_NO_DRIVER_NAME";
- public static final String ER_NO_URL = "ER_NO_URL";
- public static final String ER_POOL_SIZE_LESSTHAN_ONE =
- "ER_POOL_SIZE_LESSTHAN_ONE";
- public static final String ER_INVALID_DRIVER = "ER_INVALID_DRIVER";
- public static final String ER_NO_STYLESHEETROOT = "ER_NO_STYLESHEETROOT";
- public static final String ER_ILLEGAL_XMLSPACE_VALUE =
- "ER_ILLEGAL_XMLSPACE_VALUE";
- public static final String ER_PROCESSFROMNODE_FAILED =
- "ER_PROCESSFROMNODE_FAILED";
- public static final String ER_RESOURCE_COULD_NOT_LOAD =
- "ER_RESOURCE_COULD_NOT_LOAD";
- public static final String ER_BUFFER_SIZE_LESSTHAN_ZERO =
- "ER_BUFFER_SIZE_LESSTHAN_ZERO";
- public static final String ER_UNKNOWN_ERROR_CALLING_EXTENSION =
- "ER_UNKNOWN_ERROR_CALLING_EXTENSION";
- public static final String ER_NO_NAMESPACE_DECL = "ER_NO_NAMESPACE_DECL";
- public static final String ER_ELEM_CONTENT_NOT_ALLOWED =
- "ER_ELEM_CONTENT_NOT_ALLOWED";
- public static final String ER_STYLESHEET_DIRECTED_TERMINATION =
- "ER_STYLESHEET_DIRECTED_TERMINATION";
- public static final String ER_ONE_OR_TWO = "ER_ONE_OR_TWO";
- public static final String ER_TWO_OR_THREE = "ER_TWO_OR_THREE";
- public static final String ER_COULD_NOT_LOAD_RESOURCE =
- "ER_COULD_NOT_LOAD_RESOURCE";
- public static final String ER_CANNOT_INIT_DEFAULT_TEMPLATES =
- "ER_CANNOT_INIT_DEFAULT_TEMPLATES";
- public static final String ER_RESULT_NULL = "ER_RESULT_NULL";
- public static final String ER_RESULT_COULD_NOT_BE_SET =
- "ER_RESULT_COULD_NOT_BE_SET";
- public static final String ER_NO_OUTPUT_SPECIFIED = "ER_NO_OUTPUT_SPECIFIED";
- public static final String ER_CANNOT_TRANSFORM_TO_RESULT_TYPE =
- "ER_CANNOT_TRANSFORM_TO_RESULT_TYPE";
- public static final String ER_CANNOT_TRANSFORM_SOURCE_TYPE =
- "ER_CANNOT_TRANSFORM_SOURCE_TYPE";
- public static final String ER_NULL_CONTENT_HANDLER ="ER_NULL_CONTENT_HANDLER";
- public static final String ER_NULL_ERROR_HANDLER = "ER_NULL_ERROR_HANDLER";
- public static final String ER_CANNOT_CALL_PARSE = "ER_CANNOT_CALL_PARSE";
- public static final String ER_NO_PARENT_FOR_FILTER ="ER_NO_PARENT_FOR_FILTER";
- public static final String ER_NO_STYLESHEET_IN_MEDIA =
- "ER_NO_STYLESHEET_IN_MEDIA";
- public static final String ER_NO_STYLESHEET_PI = "ER_NO_STYLESHEET_PI";
- public static final String ER_NOT_SUPPORTED = "ER_NOT_SUPPORTED";
- public static final String ER_PROPERTY_VALUE_BOOLEAN =
- "ER_PROPERTY_VALUE_BOOLEAN";
- public static final String ER_COULD_NOT_FIND_EXTERN_SCRIPT =
- "ER_COULD_NOT_FIND_EXTERN_SCRIPT";
- public static final String ER_RESOURCE_COULD_NOT_FIND =
- "ER_RESOURCE_COULD_NOT_FIND";
- public static final String ER_OUTPUT_PROPERTY_NOT_RECOGNIZED =
- "ER_OUTPUT_PROPERTY_NOT_RECOGNIZED";
- public static final String ER_FAILED_CREATING_ELEMLITRSLT =
- "ER_FAILED_CREATING_ELEMLITRSLT";
- public static final String ER_VALUE_SHOULD_BE_NUMBER =
- "ER_VALUE_SHOULD_BE_NUMBER";
- public static final String ER_VALUE_SHOULD_EQUAL = "ER_VALUE_SHOULD_EQUAL";
- public static final String ER_FAILED_CALLING_METHOD =
- "ER_FAILED_CALLING_METHOD";
- public static final String ER_FAILED_CREATING_ELEMTMPL =
- "ER_FAILED_CREATING_ELEMTMPL";
- public static final String ER_CHARS_NOT_ALLOWED = "ER_CHARS_NOT_ALLOWED";
- public static final String ER_ATTR_NOT_ALLOWED = "ER_ATTR_NOT_ALLOWED";
- public static final String ER_BAD_VALUE = "ER_BAD_VALUE";
- public static final String ER_ATTRIB_VALUE_NOT_FOUND =
- "ER_ATTRIB_VALUE_NOT_FOUND";
- public static final String ER_ATTRIB_VALUE_NOT_RECOGNIZED =
- "ER_ATTRIB_VALUE_NOT_RECOGNIZED";
- public static final String ER_NULL_URI_NAMESPACE = "ER_NULL_URI_NAMESPACE";
- public static final String ER_NUMBER_TOO_BIG = "ER_NUMBER_TOO_BIG";
- public static final String ER_CANNOT_FIND_SAX1_DRIVER =
- "ER_CANNOT_FIND_SAX1_DRIVER";
- public static final String ER_SAX1_DRIVER_NOT_LOADED =
- "ER_SAX1_DRIVER_NOT_LOADED";
- public static final String ER_SAX1_DRIVER_NOT_INSTANTIATED =
- "ER_SAX1_DRIVER_NOT_INSTANTIATED" ;
- public static final String ER_SAX1_DRIVER_NOT_IMPLEMENT_PARSER =
- "ER_SAX1_DRIVER_NOT_IMPLEMENT_PARSER";
- public static final String ER_PARSER_PROPERTY_NOT_SPECIFIED =
- "ER_PARSER_PROPERTY_NOT_SPECIFIED";
- public static final String ER_PARSER_ARG_CANNOT_BE_NULL =
- "ER_PARSER_ARG_CANNOT_BE_NULL" ;
- public static final String ER_FEATURE = "ER_FEATURE";
- public static final String ER_PROPERTY = "ER_PROPERTY" ;
- public static final String ER_NULL_ENTITY_RESOLVER ="ER_NULL_ENTITY_RESOLVER";
- public static final String ER_NULL_DTD_HANDLER = "ER_NULL_DTD_HANDLER" ;
- public static final String ER_NO_DRIVER_NAME_SPECIFIED =
- "ER_NO_DRIVER_NAME_SPECIFIED";
- public static final String ER_NO_URL_SPECIFIED = "ER_NO_URL_SPECIFIED";
- public static final String ER_POOLSIZE_LESS_THAN_ONE =
- "ER_POOLSIZE_LESS_THAN_ONE";
- public static final String ER_INVALID_DRIVER_NAME = "ER_INVALID_DRIVER_NAME";
- public static final String ER_ERRORLISTENER = "ER_ERRORLISTENER";
- public static final String ER_ASSERT_NO_TEMPLATE_PARENT =
- "ER_ASSERT_NO_TEMPLATE_PARENT";
- public static final String ER_ASSERT_REDUNDENT_EXPR_ELIMINATOR =
- "ER_ASSERT_REDUNDENT_EXPR_ELIMINATOR";
- public static final String ER_NOT_ALLOWED_IN_POSITION =
- "ER_NOT_ALLOWED_IN_POSITION";
- public static final String ER_NONWHITESPACE_NOT_ALLOWED_IN_POSITION =
- "ER_NONWHITESPACE_NOT_ALLOWED_IN_POSITION";
- public static final String ER_NAMESPACE_CONTEXT_NULL_NAMESPACE =
- "ER_NAMESPACE_CONTEXT_NULL_NAMESPACE";
- public static final String ER_NAMESPACE_CONTEXT_NULL_PREFIX =
- "ER_NAMESPACE_CONTEXT_NULL_PREFIX";
- public static final String ER_XPATH_RESOLVER_NULL_QNAME =
- "ER_XPATH_RESOLVER_NULL_QNAME";
- public static final String ER_XPATH_RESOLVER_NEGATIVE_ARITY =
- "ER_XPATH_RESOLVER_NEGATIVE_ARITY";
- public static final String INVALID_TCHAR = "INVALID_TCHAR";
- public static final String INVALID_QNAME = "INVALID_QNAME";
- public static final String INVALID_ENUM = "INVALID_ENUM";
- public static final String INVALID_NMTOKEN = "INVALID_NMTOKEN";
- public static final String INVALID_NCNAME = "INVALID_NCNAME";
- public static final String INVALID_BOOLEAN = "INVALID_BOOLEAN";
- public static final String INVALID_NUMBER = "INVALID_NUMBER";
- public static final String ER_ARG_LITERAL = "ER_ARG_LITERAL";
- public static final String ER_DUPLICATE_GLOBAL_VAR ="ER_DUPLICATE_GLOBAL_VAR";
- public static final String ER_DUPLICATE_VAR = "ER_DUPLICATE_VAR";
- public static final String ER_TEMPLATE_NAME_MATCH = "ER_TEMPLATE_NAME_MATCH";
- public static final String ER_INVALID_PREFIX = "ER_INVALID_PREFIX";
- public static final String ER_NO_ATTRIB_SET = "ER_NO_ATTRIB_SET";
- public static final String ER_FUNCTION_NOT_FOUND =
- "ER_FUNCTION_NOT_FOUND";
- public static final String ER_CANT_HAVE_CONTENT_AND_SELECT =
- "ER_CANT_HAVE_CONTENT_AND_SELECT";
- public static final String ER_INVALID_SET_PARAM_VALUE = "ER_INVALID_SET_PARAM_VALUE";
- public static final String ER_SET_FEATURE_NULL_NAME =
- "ER_SET_FEATURE_NULL_NAME";
- public static final String ER_GET_FEATURE_NULL_NAME =
- "ER_GET_FEATURE_NULL_NAME";
- public static final String ER_UNSUPPORTED_FEATURE =
- "ER_UNSUPPORTED_FEATURE";
- public static final String ER_EXTENSION_ELEMENT_NOT_ALLOWED_IN_SECURE_PROCESSING =
- "ER_EXTENSION_ELEMENT_NOT_ALLOWED_IN_SECURE_PROCESSING";
-
- public static final String WG_FOUND_CURLYBRACE = "WG_FOUND_CURLYBRACE";
- public static final String WG_COUNT_ATTRIB_MATCHES_NO_ANCESTOR =
- "WG_COUNT_ATTRIB_MATCHES_NO_ANCESTOR";
- public static final String WG_EXPR_ATTRIB_CHANGED_TO_SELECT =
- "WG_EXPR_ATTRIB_CHANGED_TO_SELECT";
- public static final String WG_NO_LOCALE_IN_FORMATNUMBER =
- "WG_NO_LOCALE_IN_FORMATNUMBER";
- public static final String WG_LOCALE_NOT_FOUND = "WG_LOCALE_NOT_FOUND";
- public static final String WG_CANNOT_MAKE_URL_FROM ="WG_CANNOT_MAKE_URL_FROM";
- public static final String WG_CANNOT_LOAD_REQUESTED_DOC =
- "WG_CANNOT_LOAD_REQUESTED_DOC";
- public static final String WG_CANNOT_FIND_COLLATOR ="WG_CANNOT_FIND_COLLATOR";
- public static final String WG_FUNCTIONS_SHOULD_USE_URL =
- "WG_FUNCTIONS_SHOULD_USE_URL";
- public static final String WG_ENCODING_NOT_SUPPORTED_USING_UTF8 =
- "WG_ENCODING_NOT_SUPPORTED_USING_UTF8";
- public static final String WG_ENCODING_NOT_SUPPORTED_USING_JAVA =
- "WG_ENCODING_NOT_SUPPORTED_USING_JAVA";
- public static final String WG_SPECIFICITY_CONFLICTS =
- "WG_SPECIFICITY_CONFLICTS";
- public static final String WG_PARSING_AND_PREPARING =
- "WG_PARSING_AND_PREPARING";
- public static final String WG_ATTR_TEMPLATE = "WG_ATTR_TEMPLATE";
- public static final String WG_CONFLICT_BETWEEN_XSLSTRIPSPACE_AND_XSLPRESERVESPACE = "WG_CONFLICT_BETWEEN_XSLSTRIPSPACE_AND_XSLPRESERVESP";
- public static final String WG_ATTRIB_NOT_HANDLED = "WG_ATTRIB_NOT_HANDLED";
- public static final String WG_NO_DECIMALFORMAT_DECLARATION =
- "WG_NO_DECIMALFORMAT_DECLARATION";
- public static final String WG_OLD_XSLT_NS = "WG_OLD_XSLT_NS";
- public static final String WG_ONE_DEFAULT_XSLDECIMALFORMAT_ALLOWED =
- "WG_ONE_DEFAULT_XSLDECIMALFORMAT_ALLOWED";
- public static final String WG_XSLDECIMALFORMAT_NAMES_MUST_BE_UNIQUE =
- "WG_XSLDECIMALFORMAT_NAMES_MUST_BE_UNIQUE";
- public static final String WG_ILLEGAL_ATTRIBUTE = "WG_ILLEGAL_ATTRIBUTE";
- public static final String WG_COULD_NOT_RESOLVE_PREFIX =
- "WG_COULD_NOT_RESOLVE_PREFIX";
- public static final String WG_STYLESHEET_REQUIRES_VERSION_ATTRIB =
- "WG_STYLESHEET_REQUIRES_VERSION_ATTRIB";
- public static final String WG_ILLEGAL_ATTRIBUTE_NAME =
- "WG_ILLEGAL_ATTRIBUTE_NAME";
- public static final String WG_ILLEGAL_ATTRIBUTE_VALUE =
- "WG_ILLEGAL_ATTRIBUTE_VALUE";
- public static final String WG_EMPTY_SECOND_ARG = "WG_EMPTY_SECOND_ARG";
- public static final String WG_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML =
- "WG_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML";
- public static final String WG_PROCESSINGINSTRUCTION_NOTVALID_NCNAME =
- "WG_PROCESSINGINSTRUCTION_NOTVALID_NCNAME";
- public static final String WG_ILLEGAL_ATTRIBUTE_POSITION =
- "WG_ILLEGAL_ATTRIBUTE_POSITION";
- public static final String NO_MODIFICATION_ALLOWED_ERR =
- "NO_MODIFICATION_ALLOWED_ERR";
-
- /*
- * Now fill in the message text.
- * Then fill in the message text for that message code in the
- * array. Use the new error code as the index into the array.
- */
-
- // Error messages...
-
- /** Get the lookup table for error messages.
- *
- * @return The message lookup table.
- */
- public Object[][] getContents()
- {
- return new Object[][] {
-
- /** Error message ID that has a null message, but takes in a single object. */
- {"ER0000" , "{0}" },
-
- { ER_NO_CURLYBRACE,
- "\u30A8\u30E9\u30FC: \u5F0F\u5185\u306B'{'\u3092\u6301\u3064\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093"},
-
- { ER_ILLEGAL_ATTRIBUTE ,
- "{0}\u306B\u4E0D\u6B63\u306A\u5C5E\u6027\u304C\u3042\u308A\u307E\u3059: {1}"},
-
- {ER_NULL_SOURCENODE_APPLYIMPORTS ,
- "sourceNode\u306Fxsl:apply-imports\u5185\u3067null\u3067\u3059\u3002"},
-
- {ER_CANNOT_ADD,
- "{0}\u3092{1}\u306B\u8FFD\u52A0\u3067\u304D\u307E\u305B\u3093"},
-
- { ER_NULL_SOURCENODE_HANDLEAPPLYTEMPLATES,
- "sourceNode\u306FhandleApplyTemplatesInstruction\u5185\u3067null\u3067\u3059\u3002"},
-
- { ER_NO_NAME_ATTRIB,
- "{0}\u306B\u306Fname\u5C5E\u6027\u304C\u5FC5\u8981\u3067\u3059\u3002"},
-
- {ER_TEMPLATE_NOT_FOUND,
- "\u540D\u524D{0}\u306E\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F"},
-
- {ER_CANT_RESOLVE_NAME_AVT,
- "xsl:call-template\u306E\u540D\u524DAVT\u3092\u89E3\u6C7A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002"},
-
- {ER_REQUIRES_ATTRIB,
- "{0}\u306F\u5C5E\u6027{1}\u304C\u5FC5\u8981\u3067\u3059"},
-
- { ER_MUST_HAVE_TEST_ATTRIB,
- "{0}\u306F''test''\u5C5E\u6027\u3092\u6301\u3064\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002"},
-
- {ER_BAD_VAL_ON_LEVEL_ATTRIB,
- "level\u5C5E\u6027\u306E\u5024\u304C\u4E0D\u6B63\u3067\u3059: {0}"},
-
- {ER_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML,
- "processing-instruction\u540D\u306F'xml'\u306B\u3067\u304D\u307E\u305B\u3093"},
-
- { ER_PROCESSINGINSTRUCTION_NOTVALID_NCNAME,
- "processing-instruction\u540D\u306F\u6709\u52B9\u306ANCName\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059: {0}"},
-
- { ER_NEED_MATCH_ATTRIB,
- "\u30E2\u30FC\u30C9\u304C\u3042\u308B\u5834\u5408\u3001{0}\u306B\u306Fmatch\u5C5E\u6027\u304C\u5FC5\u8981\u3067\u3059\u3002"},
-
- { ER_NEED_NAME_OR_MATCH_ATTRIB,
- "{0}\u306B\u306Fname\u307E\u305F\u306Fmatch\u5C5E\u6027\u304C\u5FC5\u8981\u3067\u3059\u3002"},
-
- {ER_CANT_RESOLVE_NSPREFIX,
- "\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u306E\u63A5\u982D\u8F9E\u3092\u89E3\u6C7A\u3067\u304D\u307E\u305B\u3093: {0}"},
-
- { ER_ILLEGAL_VALUE,
- "xml:space\u306E\u5024\u304C\u4E0D\u6B63\u3067\u3059: {0}"},
-
- { ER_NO_OWNERDOC,
- "\u5B50\u30CE\u30FC\u30C9\u306B\u6240\u6709\u8005\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u304C\u3042\u308A\u307E\u305B\u3093\u3002"},
-
- { ER_ELEMTEMPLATEELEM_ERR,
- "ElemTemplateElement\u30A8\u30E9\u30FC: {0}"},
-
- { ER_NULL_CHILD,
- "null\u306E\u5B50\u3092\u8FFD\u52A0\u3057\u3088\u3046\u3068\u3057\u307E\u3057\u305F\u3002"},
-
- { ER_NEED_SELECT_ATTRIB,
- "{0}\u306B\u306Fselect\u5C5E\u6027\u304C\u5FC5\u8981\u3067\u3059\u3002"},
-
- { ER_NEED_TEST_ATTRIB ,
- "xsl:when\u306B\u306F'test'\u5C5E\u6027\u304C\u5FC5\u8981\u3067\u3059\u3002"},
-
- { ER_NEED_NAME_ATTRIB,
- "xsl:with-param\u306B\u306F'name'\u5C5E\u6027\u304C\u5FC5\u8981\u3067\u3059\u3002"},
-
- { ER_NO_CONTEXT_OWNERDOC,
- "\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u306B\u6240\u6709\u8005\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u304C\u3042\u308A\u307E\u305B\u3093\u3002"},
-
- {ER_COULD_NOT_CREATE_XML_PROC_LIAISON,
- "XML TransformerFactory Liaison\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F: {0}"},
-
- {ER_PROCESS_NOT_SUCCESSFUL,
- "Xalan: \u30D7\u30ED\u30BB\u30B9\u306F\u6210\u529F\u3057\u307E\u305B\u3093\u3067\u3057\u305F\u3002"},
-
- { ER_NOT_SUCCESSFUL,
- "Xalan: \u306F\u6210\u529F\u3057\u307E\u305B\u3093\u3067\u3057\u305F\u3002"},
-
- { ER_ENCODING_NOT_SUPPORTED,
- "\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0{0}\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093"},
-
- {ER_COULD_NOT_CREATE_TRACELISTENER,
- "TraceListener\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F: {0}"},
-
- {ER_KEY_REQUIRES_NAME_ATTRIB,
- "xsl:key\u306B\u306F'name'\u5C5E\u6027\u304C\u5FC5\u8981\u3067\u3059\u3002"},
-
- { ER_KEY_REQUIRES_MATCH_ATTRIB,
- "xsl:key\u306B\u306F'match'\u5C5E\u6027\u304C\u5FC5\u8981\u3067\u3059\u3002"},
-
- { ER_KEY_REQUIRES_USE_ATTRIB,
- "xsl:key\u306B\u306F'use'\u5C5E\u6027\u304C\u5FC5\u8981\u3067\u3059\u3002"},
-
- { ER_REQUIRES_ELEMENTS_ATTRIB,
- "(StylesheetHandler) {0}\u306B\u306F''elements''\u5C5E\u6027\u304C\u5FC5\u8981\u3067\u3059\u3002"},
-
- { ER_MISSING_PREFIX_ATTRIB,
- "(StylesheetHandler) {0}\u5C5E\u6027''prefix''\u304C\u3042\u308A\u307E\u305B\u3093"},
-
- { ER_BAD_STYLESHEET_URL,
- "\u30B9\u30BF\u30A4\u30EB\u30B7\u30FC\u30C8URL\u304C\u4E0D\u6B63\u3067\u3059: {0}"},
-
- { ER_FILE_NOT_FOUND,
- "\u30B9\u30BF\u30A4\u30EB\u30B7\u30FC\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F: {0}"},
-
- { ER_IOEXCEPTION,
- "\u30B9\u30BF\u30A4\u30EB\u30B7\u30FC\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB\u306B\u5165\u51FA\u529B\u4F8B\u5916\u304C\u3042\u308A\u307E\u3059: {0}"},
-
- { ER_NO_HREF_ATTRIB,
- "(StylesheetHandler) {0}\u306Ehref\u5C5E\u6027\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F"},
-
- { ER_STYLESHEET_INCLUDES_ITSELF,
- "(StylesheetHandler) {0}\u306F\u305D\u308C\u81EA\u4F53\u3092\u76F4\u63A5\u7684\u307E\u305F\u306F\u9593\u63A5\u7684\u306B\u542B\u3093\u3067\u3044\u307E\u3059\u3002"},
-
- { ER_PROCESSINCLUDE_ERROR,
- "StylesheetHandler.processInclude\u30A8\u30E9\u30FC\u3001{0}"},
-
- { ER_MISSING_LANG_ATTRIB,
- "(StylesheetHandler) {0}\u5C5E\u6027''lang''\u304C\u3042\u308A\u307E\u305B\u3093"},
-
- { ER_MISSING_CONTAINER_ELEMENT_COMPONENT,
- "(StylesheetHandler) {0}\u8981\u7D20\u306E\u914D\u7F6E\u304C\u4E0D\u6B63\u3067\u3059\u3002\u30B3\u30F3\u30C6\u30CA\u8981\u7D20''component''\u304C\u3042\u308A\u307E\u305B\u3093"},
-
- { ER_CAN_ONLY_OUTPUT_TO_ELEMENT,
- "Element\u3001DocumentFragment\u3001Document\u307E\u305F\u306FPrintWriter\u306B\u306E\u307F\u51FA\u529B\u3067\u304D\u307E\u3059\u3002"},
-
- { ER_PROCESS_ERROR,
- "StylesheetRoot.process\u30A8\u30E9\u30FC"},
-
- { ER_UNIMPLNODE_ERROR,
- "UnImplNode\u30A8\u30E9\u30FC: {0}"},
-
- { ER_NO_SELECT_EXPRESSION,
- "\u30A8\u30E9\u30FC\u3002xpath\u9078\u629E\u5F0F(-select)\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002"},
-
- { ER_CANNOT_SERIALIZE_XSLPROCESSOR,
- "XSLProcessor\u3092\u30B7\u30EA\u30A2\u30E9\u30A4\u30BA\u3067\u304D\u307E\u305B\u3093\u3002"},
-
- { ER_NO_INPUT_STYLESHEET,
- "\u30B9\u30BF\u30A4\u30EB\u30B7\u30FC\u30C8\u5165\u529B\u304C\u6307\u5B9A\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002"},
-
- { ER_FAILED_PROCESS_STYLESHEET,
- "\u30B9\u30BF\u30A4\u30EB\u30B7\u30FC\u30C8\u306E\u51E6\u7406\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002"},
-
- { ER_COULDNT_PARSE_DOC,
- "{0}\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3092\u89E3\u6790\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002"},
-
- { ER_COULDNT_FIND_FRAGMENT,
- "\u30D5\u30E9\u30B0\u30E1\u30F3\u30C8\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F: {0}"},
-
- { ER_NODE_NOT_ELEMENT,
- "\u30D5\u30E9\u30B0\u30E1\u30F3\u30C8\u8B58\u5225\u5B50\u306B\u3088\u3063\u3066\u6307\u793A\u3055\u308C\u305F\u30CE\u30FC\u30C9\u306F\u8981\u7D20\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3067\u3057\u305F: {0}"},
-
- { ER_FOREACH_NEED_MATCH_OR_NAME_ATTRIB,
- "for-each\u306Fmatch\u307E\u305F\u306Fname\u5C5E\u6027\u3092\u6301\u3064\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
-
- { ER_TEMPLATES_NEED_MATCH_OR_NAME_ATTRIB,
- "\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u306Fmatch\u307E\u305F\u306Fname\u5C5E\u6027\u3092\u6301\u3064\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
-
- { ER_NO_CLONE_OF_DOCUMENT_FRAG,
- "\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u30FB\u30D5\u30E9\u30B0\u30E1\u30F3\u30C8\u306E\u30AF\u30ED\u30FC\u30F3\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093\u3002"},
-
- { ER_CANT_CREATE_ITEM,
- "\u7D50\u679C\u30C4\u30EA\u30FC\u306B\u9805\u76EE\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093: {0}"},
-
- { ER_XMLSPACE_ILLEGAL_VALUE,
- "\u30BD\u30FC\u30B9XML\u306Exml:space\u306E\u5024\u304C\u4E0D\u6B63\u3067\u3059: {0}"},
-
- { ER_NO_XSLKEY_DECLARATION,
- "{0}\u306Exsl:key\u5BA3\u8A00\u304C\u3042\u308A\u307E\u305B\u3093\u3002"},
-
- { ER_CANT_CREATE_URL,
- "\u30A8\u30E9\u30FC\u3002{0}\u306EURL\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093"},
-
- { ER_XSLFUNCTIONS_UNSUPPORTED,
- "xsl:functions\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093"},
-
- { ER_PROCESSOR_ERROR,
- "XSLT TransformerFactory\u30A8\u30E9\u30FC"},
-
- { ER_NOT_ALLOWED_INSIDE_STYLESHEET,
- "(StylesheetHandler) {0}\u306F\u30B9\u30BF\u30A4\u30EB\u30B7\u30FC\u30C8\u5185\u3067\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093\u3002"},
-
- { ER_RESULTNS_NOT_SUPPORTED,
- "result-ns\u306F\u73FE\u5728\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u304B\u308F\u308A\u306Bxsl:output\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
-
- { ER_DEFAULTSPACE_NOT_SUPPORTED,
- "default-space\u306F\u73FE\u5728\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u304B\u308F\u308A\u306Bxsl:strip-space\u307E\u305F\u306Fxsl:preserve-space\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
-
- { ER_INDENTRESULT_NOT_SUPPORTED,
- "indent-result\u306F\u73FE\u5728\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u304B\u308F\u308A\u306Bxsl:output\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
-
- { ER_ILLEGAL_ATTRIB,
- "(StylesheetHandler) {0}\u306B\u306F\u4E0D\u6B63\u306A\u5C5E\u6027\u304C\u3042\u308A\u307E\u3059: {1}"},
-
- { ER_UNKNOWN_XSL_ELEM,
- "\u4E0D\u660E\u306AXSL\u8981\u7D20: {0}"},
-
- { ER_BAD_XSLSORT_USE,
- "(StylesheetHandler) xsl:sort\u306F\u3001xsl:apply-templates\u307E\u305F\u306Fxsl:for-each\u3068\u3068\u3082\u306B\u306E\u307F\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002"},
-
- { ER_MISPLACED_XSLWHEN,
- "(StylesheetHandler) xsl:when\u306E\u914D\u7F6E\u304C\u4E0D\u6B63\u3067\u3059\u3002"},
-
- { ER_XSLWHEN_NOT_PARENTED_BY_XSLCHOOSE,
- "(StylesheetHandler) xsl:when\u306E\u89AA\u304Cxsl:choose\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002"},
-
- { ER_MISPLACED_XSLOTHERWISE,
- "(StylesheetHandler) xsl:otherwise\u306E\u914D\u7F6E\u304C\u4E0D\u6B63\u3067\u3059\u3002"},
-
- { ER_XSLOTHERWISE_NOT_PARENTED_BY_XSLCHOOSE,
- "(StylesheetHandler) xsl:otherwise\u306E\u89AA\u304Cxsl:choose\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002"},
-
- { ER_NOT_ALLOWED_INSIDE_TEMPLATE,
- "(StylesheetHandler) {0}\u306F\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u5185\u3067\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093\u3002"},
-
- { ER_UNKNOWN_EXT_NS_PREFIX,
- "(StylesheetHandler) \u4E0D\u660E\u306A{0}\u62E1\u5F35\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u306E\u63A5\u982D\u8F9E{1}\u3067\u3059"},
-
- { ER_IMPORTS_AS_FIRST_ELEM,
- "(StylesheetHandler) \u30A4\u30F3\u30DD\u30FC\u30C8\u306F\u30B9\u30BF\u30A4\u30EB\u30B7\u30FC\u30C8\u306E\u6700\u521D\u306E\u8981\u7D20\u3068\u3057\u3066\u306E\u307F\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002"},
-
- { ER_IMPORTING_ITSELF,
- "(StylesheetHandler) {0}\u306F\u305D\u308C\u81EA\u4F53\u3092\u76F4\u63A5\u307E\u305F\u306F\u9593\u63A5\u7684\u306B\u30A4\u30F3\u30DD\u30FC\u30C8\u3057\u3066\u3044\u307E\u3059\u3002"},
-
- { ER_XMLSPACE_ILLEGAL_VAL,
- "(StylesheetHandler) xml:space\u306E\u5024\u304C\u4E0D\u6B63\u3067\u3059: {0}"},
-
- { ER_PROCESSSTYLESHEET_NOT_SUCCESSFUL,
- "processStylesheet\u306F\u5931\u6557\u3057\u307E\u3057\u305F\u3002"},
-
- { ER_SAX_EXCEPTION,
- "SAX\u4F8B\u5916"},
-
-// add this message to fix bug 21478
- { ER_FUNCTION_NOT_SUPPORTED,
- "\u95A2\u6570\u304C\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"},
-
- { ER_XSLT_ERROR,
- "XSLT\u30A8\u30E9\u30FC"},
-
- { ER_CURRENCY_SIGN_ILLEGAL,
- "\u901A\u8CA8\u8A18\u53F7\u306F\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u30FB\u30D1\u30BF\u30FC\u30F3\u6587\u5B57\u5217\u5185\u3067\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093"},
-
- { ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM,
- "\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u95A2\u6570\u306F\u30B9\u30BF\u30A4\u30EB\u30B7\u30FC\u30C8DOM\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"},
-
- { ER_CANT_RESOLVE_PREFIX_OF_NON_PREFIX_RESOLVER,
- "\u975E\u63A5\u982D\u8F9E\u30EA\u30BE\u30EB\u30D0\u306E\u63A5\u982D\u8F9E\u3092\u89E3\u6C7A\u3067\u304D\u307E\u305B\u3093\u3002"},
-
- { ER_REDIRECT_COULDNT_GET_FILENAME,
- "\u30EA\u30C0\u30A4\u30EC\u30AF\u30C8\u62E1\u5F35: \u30D5\u30A1\u30A4\u30EB\u540D\u3092\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F - file\u307E\u305F\u306Fselect\u5C5E\u6027\u304C\u6709\u52B9\u306A\u6587\u5B57\u5217\u3092\u8FD4\u3059\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002"},
-
- { ER_CANNOT_BUILD_FORMATTERLISTENER_IN_REDIRECT,
- "\u30EA\u30C0\u30A4\u30EC\u30AF\u30C8\u62E1\u5F35\u3067FormatterListener\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093\u3002"},
-
- { ER_INVALID_PREFIX_IN_EXCLUDERESULTPREFIX,
- "exclude-result-prefixes\u306E\u63A5\u982D\u8F9E\u304C\u7121\u52B9\u3067\u3059: {0}"},
-
- { ER_MISSING_NS_URI,
- "\u6307\u5B9A\u3057\u305F\u63A5\u982D\u8F9E\u306E\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9URI\u304C\u3042\u308A\u307E\u305B\u3093"},
-
- { ER_MISSING_ARG_FOR_OPTION,
- "\u30AA\u30D7\u30B7\u30E7\u30F3{0}\u306E\u5F15\u6570\u304C\u3042\u308A\u307E\u305B\u3093"},
-
- { ER_INVALID_OPTION,
- "\u7121\u52B9\u306A\u30AA\u30D7\u30B7\u30E7\u30F3: {0}"},
-
- { ER_MALFORMED_FORMAT_STRING,
- "\u4E0D\u6B63\u306A\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u306E\u6587\u5B57\u5217\u3067\u3059: {0}"},
-
- { ER_STYLESHEET_REQUIRES_VERSION_ATTRIB,
- "xsl:stylesheet\u306F'version'\u5C5E\u6027\u304C\u5FC5\u8981\u3067\u3059\u3002"},
-
- { ER_ILLEGAL_ATTRIBUTE_VALUE,
- "\u5C5E\u6027{0}\u306E\u5024\u304C\u4E0D\u6B63\u3067\u3059: {1}"},
-
- { ER_CHOOSE_REQUIRES_WHEN,
- "xsl:choose\u306Fxsl:when\u304C\u5FC5\u8981\u3067\u3059"},
-
- { ER_NO_APPLY_IMPORT_IN_FOR_EACH,
- "xsl:apply-imports\u306Fxsl:for-each\u5185\u3067\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093"},
-
- { ER_CANT_USE_DTM_FOR_OUTPUT,
- "\u51FA\u529BDOM\u30CE\u30FC\u30C9\u306BDTMLiaison\u3092\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093...\u304B\u308F\u308A\u306Bcom.sun.org.apache.xpath.internal.DOM2Helper\u3092\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
-
- { ER_CANT_USE_DTM_FOR_INPUT,
- "\u5165\u529BDOM\u30CE\u30FC\u30C9\u306BDTMLiaison\u3092\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093...\u304B\u308F\u308A\u306Bcom.sun.org.apache.xpath.internal.DOM2Helper\u3092\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
-
- { ER_CALL_TO_EXT_FAILED,
- "\u62E1\u5F35\u8981\u7D20\u306E\u547C\u51FA\u3057\u304C\u5931\u6557\u3057\u307E\u3057\u305F: {0}"},
-
- { ER_PREFIX_MUST_RESOLVE,
- "\u63A5\u982D\u8F9E\u306F\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u306B\u89E3\u6C7A\u3055\u308C\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059: {0}"},
-
- { ER_INVALID_UTF16_SURROGATE,
- "\u7121\u52B9\u306AUTF-16\u30B5\u30ED\u30B2\u30FC\u30C8\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F: {0}\u3002"},
-
- { ER_XSLATTRSET_USED_ITSELF,
- "xsl:attribute-set {0}\u304C\u305D\u308C\u81EA\u4F53\u3092\u4F7F\u7528\u3057\u3001\u7121\u9650\u30EB\u30FC\u30D7\u304C\u767A\u751F\u3057\u307E\u3059\u3002"},
-
- { ER_CANNOT_MIX_XERCESDOM,
- "\u975EXerces-DOM\u5165\u529B\u3068Xerces-DOM\u51FA\u529B\u3092\u540C\u6642\u306B\u4F7F\u7528\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002"},
-
- { ER_TOO_MANY_LISTENERS,
- "addTraceListenersToStylesheet - TooManyListenersException"},
-
- { ER_IN_ELEMTEMPLATEELEM_READOBJECT,
- "ElemTemplateElement.readObject\u5185: {0}"},
-
- { ER_DUPLICATE_NAMED_TEMPLATE,
- "\u540D\u524D{0}\u306E\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u304C\u8907\u6570\u898B\u3064\u304B\u308A\u307E\u3057\u305F"},
-
- { ER_INVALID_KEY_CALL,
- "\u7121\u52B9\u306A\u95A2\u6570\u547C\u51FA\u3057: \u518D\u5E30\u7684\u306Akey()\u306E\u547C\u51FA\u3057\u306F\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093"},
-
- { ER_REFERENCING_ITSELF,
- "\u5909\u6570{0}\u306F\u305D\u308C\u81EA\u4F53\u3092\u76F4\u63A5\u307E\u305F\u306F\u9593\u63A5\u7684\u306B\u53C2\u7167\u3057\u3066\u3044\u307E\u3059\u3002"},
-
- { ER_ILLEGAL_DOMSOURCE_INPUT,
- "newTemplates\u306EDOMSource\u306B\u3064\u3044\u3066\u5165\u529B\u30CE\u30FC\u30C9\u3092null\u306B\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002"},
-
- { ER_CLASS_NOT_FOUND_FOR_OPTION,
- "\u30AA\u30D7\u30B7\u30E7\u30F3{0}\u306B\u3064\u3044\u3066\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093"},
-
- { ER_REQUIRED_ELEM_NOT_FOUND,
- "\u5FC5\u9808\u8981\u7D20\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: {0}"},
-
- { ER_INPUT_CANNOT_BE_NULL,
- "InputStream\u3092null\u306B\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093"},
-
- { ER_URI_CANNOT_BE_NULL,
- "URI\u3092null\u306B\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093"},
-
- { ER_FILE_CANNOT_BE_NULL,
- "\u30D5\u30A1\u30A4\u30EB\u3092null\u306B\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093"},
-
- { ER_SOURCE_CANNOT_BE_NULL,
- "InputSource\u3092null\u306B\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093"},
-
- { ER_CANNOT_INIT_BSFMGR,
- "BSF\u30DE\u30CD\u30FC\u30B8\u30E3\u3092\u521D\u671F\u5316\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F"},
-
- { ER_CANNOT_CMPL_EXTENSN,
- "\u62E1\u5F35\u3092\u30B3\u30F3\u30D1\u30A4\u30EB\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F"},
-
- { ER_CANNOT_CREATE_EXTENSN,
- "{1}\u304C\u539F\u56E0\u3067\u62E1\u5F35{0}\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F"},
-
- { ER_INSTANCE_MTHD_CALL_REQUIRES,
- "\u30E1\u30BD\u30C3\u30C9{0}\u306E\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u30FB\u30E1\u30BD\u30C3\u30C9\u547C\u51FA\u3057\u3067\u306F\u3001\u6700\u521D\u306E\u5F15\u6570\u3068\u3057\u3066\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u30FB\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u304C\u5FC5\u8981\u3067\u3059"},
-
- { ER_INVALID_ELEMENT_NAME,
- "\u7121\u52B9\u306A\u8981\u7D20\u540D\u304C\u6307\u5B9A\u3055\u308C\u307E\u3057\u305F{0}"},
-
- { ER_ELEMENT_NAME_METHOD_STATIC,
- "\u8981\u7D20\u540D\u30E1\u30BD\u30C3\u30C9\u306Fstatic {0}\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
-
- { ER_EXTENSION_FUNC_UNKNOWN,
- "\u62E1\u5F35\u95A2\u6570{0} : {1}\u304C\u4E0D\u660E\u3067\u3059"},
-
- { ER_MORE_MATCH_CONSTRUCTOR,
- "{0}\u306E\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u306B\u8907\u6570\u306E\u6700\u9069\u4E00\u81F4\u304C\u3042\u308A\u307E\u3059"},
-
- { ER_MORE_MATCH_METHOD,
- "\u30E1\u30BD\u30C3\u30C9{0}\u306B\u8907\u6570\u306E\u6700\u9069\u4E00\u81F4\u304C\u3042\u308A\u307E\u3059"},
-
- { ER_MORE_MATCH_ELEMENT,
- "\u8981\u7D20\u30E1\u30BD\u30C3\u30C9{0}\u306B\u8907\u6570\u306E\u6700\u9069\u4E00\u81F4\u304C\u3042\u308A\u307E\u3059"},
-
- { ER_INVALID_CONTEXT_PASSED,
- "{0}\u3092\u8A55\u4FA1\u3059\u308B\u305F\u3081\u306B\u7121\u52B9\u306A\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u304C\u6E21\u3055\u308C\u307E\u3057\u305F"},
-
- { ER_POOL_EXISTS,
- "\u30D7\u30FC\u30EB\u306F\u3059\u3067\u306B\u5B58\u5728\u3057\u307E\u3059"},
-
- { ER_NO_DRIVER_NAME,
- "\u30C9\u30E9\u30A4\u30D0\u540D\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093"},
-
- { ER_NO_URL,
- "URL\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093"},
-
- { ER_POOL_SIZE_LESSTHAN_ONE,
- "\u30D7\u30FC\u30EB\u30FB\u30B5\u30A4\u30BA\u304C1\u3088\u308A\u5C0F\u3055\u3044\u3067\u3059\u3002"},
-
- { ER_INVALID_DRIVER,
- "\u7121\u52B9\u306A\u30C9\u30E9\u30A4\u30D0\u540D\u304C\u6307\u5B9A\u3055\u308C\u307E\u3057\u305F\u3002"},
-
- { ER_NO_STYLESHEETROOT,
- "\u30B9\u30BF\u30A4\u30EB\u30B7\u30FC\u30C8\u30FB\u30EB\u30FC\u30C8\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002"},
-
- { ER_ILLEGAL_XMLSPACE_VALUE,
- "xml:space\u306E\u5024\u304C\u4E0D\u6B63\u3067\u3059"},
-
- { ER_PROCESSFROMNODE_FAILED,
- "processFromNode\u304C\u5931\u6557\u3057\u307E\u3057\u305F"},
-
- { ER_RESOURCE_COULD_NOT_LOAD,
- "\u30EA\u30BD\u30FC\u30B9[ {0} ]\u3092\u30ED\u30FC\u30C9\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F: {1} \n {2} \t {3}"},
-
- { ER_BUFFER_SIZE_LESSTHAN_ZERO,
- "\u30D0\u30C3\u30D5\u30A1\u30FB\u30B5\u30A4\u30BA<=0"},
-
- { ER_UNKNOWN_ERROR_CALLING_EXTENSION,
- "\u62E1\u5F35\u3092\u547C\u3073\u51FA\u3059\u3068\u304D\u306B\u4E0D\u660E\u306A\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F"},
-
- { ER_NO_NAMESPACE_DECL,
- "\u63A5\u982D\u8F9E{0}\u306B\u306F\u3001\u5BFE\u5FDC\u3059\u308B\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u5BA3\u8A00\u304C\u3042\u308A\u307E\u305B\u3093"},
-
- { ER_ELEM_CONTENT_NOT_ALLOWED,
- "\u8981\u7D20\u306E\u5185\u5BB9\u306Flang=javaclass {0}\u306B\u3064\u3044\u3066\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093"},
-
- { ER_STYLESHEET_DIRECTED_TERMINATION,
- "\u30B9\u30BF\u30A4\u30EB\u30B7\u30FC\u30C8\u306B\u3088\u308A\u7D42\u4E86\u304C\u6307\u793A\u3055\u308C\u307E\u3057\u305F"},
-
- { ER_ONE_OR_TWO,
- "1\u307E\u305F\u306F2"},
-
- { ER_TWO_OR_THREE,
- "2\u307E\u305F\u306F3"},
-
- { ER_COULD_NOT_LOAD_RESOURCE,
- "{0}\u3092\u30ED\u30FC\u30C9\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F(CLASSPATH\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044)\u3002\u73FE\u5728\u306F\u5358\u306B\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u4F7F\u7528\u3057\u3066\u3044\u307E\u3059"},
-
- { ER_CANNOT_INIT_DEFAULT_TEMPLATES,
- "\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u3092\u521D\u671F\u5316\u3067\u304D\u307E\u305B\u3093"},
-
- { ER_RESULT_NULL,
- "\u7D50\u679C\u306Fnull\u306B\u3067\u304D\u307E\u305B\u3093"},
-
- { ER_RESULT_COULD_NOT_BE_SET,
- "\u7D50\u679C\u3092\u8A2D\u5B9A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F"},
-
- { ER_NO_OUTPUT_SPECIFIED,
- "\u51FA\u529B\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093"},
-
- { ER_CANNOT_TRANSFORM_TO_RESULT_TYPE,
- "\u30BF\u30A4\u30D7{0}\u306E\u7D50\u679C\u306B\u5909\u63DB\u3067\u304D\u307E\u305B\u3093"},
-
- { ER_CANNOT_TRANSFORM_SOURCE_TYPE,
- "\u30BF\u30A4\u30D7{0}\u306E\u30BD\u30FC\u30B9\u306B\u5909\u63DB\u3067\u304D\u307E\u305B\u3093"},
-
- { ER_NULL_CONTENT_HANDLER,
- "Null\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u30FB\u30CF\u30F3\u30C9\u30E9"},
-
- { ER_NULL_ERROR_HANDLER,
- "Null\u306E\u30A8\u30E9\u30FC\u30FB\u30CF\u30F3\u30C9\u30E9"},
-
- { ER_CANNOT_CALL_PARSE,
- "ContentHandler\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u306A\u3044\u5834\u5408\u3001\u89E3\u6790\u3092\u547C\u3073\u51FA\u3059\u3053\u3068\u304C\u3067\u304D\u307E\u305B\u3093"},
-
- { ER_NO_PARENT_FOR_FILTER,
- "\u30D5\u30A3\u30EB\u30BF\u306E\u89AA\u304C\u3042\u308A\u307E\u305B\u3093"},
-
- { ER_NO_STYLESHEET_IN_MEDIA,
- "\u30B9\u30BF\u30A4\u30EB\u30B7\u30FC\u30C8\u304C{0}\u306B\u3042\u308A\u307E\u305B\u3093\u3002\u30E1\u30C7\u30A3\u30A2= {1}"},
-
- { ER_NO_STYLESHEET_PI,
- "xml-stylesheet PI\u304C{0}\u306B\u898B\u3064\u304B\u308A\u307E\u305B\u3093"},
-
- { ER_NOT_SUPPORTED,
- "\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093: {0}"},
-
- { ER_PROPERTY_VALUE_BOOLEAN,
- "\u30D7\u30ED\u30D1\u30C6\u30A3{0}\u306E\u5024\u306FBoolean\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
-
- { ER_COULD_NOT_FIND_EXTERN_SCRIPT,
- "{0}\u306E\u5916\u90E8\u30B9\u30AF\u30EA\u30D7\u30C8\u306B\u5230\u9054\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F"},
-
- { ER_RESOURCE_COULD_NOT_FIND,
- "\u30EA\u30BD\u30FC\u30B9[ {0} ]\u306F\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002\n {1}"},
-
- { ER_OUTPUT_PROPERTY_NOT_RECOGNIZED,
- "\u51FA\u529B\u30D7\u30ED\u30D1\u30C6\u30A3\u304C\u8A8D\u8B58\u3055\u308C\u307E\u305B\u3093: {0}"},
-
- { ER_FAILED_CREATING_ELEMLITRSLT,
- "ElemLiteralResult\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u306E\u4F5C\u6210\u306B\u5931\u6557\u3057\u307E\u3057\u305F"},
-
- //Earlier (JDK 1.4 XALAN 2.2-D11) at key code '204' the key name was ER_PRIORITY_NOT_PARSABLE
- // In latest Xalan code base key name is ER_VALUE_SHOULD_BE_NUMBER. This should also be taken care
- //in locale specific files like XSLTErrorResources_de.java, XSLTErrorResources_fr.java etc.
- //NOTE: Not only the key name but message has also been changed.
- { ER_VALUE_SHOULD_BE_NUMBER,
- "{0}\u306E\u5024\u306B\u306F\u89E3\u6790\u53EF\u80FD\u306A\u6570\u5024\u304C\u542B\u307E\u308C\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
-
- { ER_VALUE_SHOULD_EQUAL,
- "{0}\u306E\u5024\u306Fyes\u307E\u305F\u306Fno\u306B\u7B49\u3057\u3044\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
-
- { ER_FAILED_CALLING_METHOD,
- "{0}\u30E1\u30BD\u30C3\u30C9\u306E\u547C\u51FA\u3057\u306B\u5931\u6557\u3057\u307E\u3057\u305F"},
-
- { ER_FAILED_CREATING_ELEMTMPL,
- "ElemTemplateElement\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u306E\u4F5C\u6210\u306B\u5931\u6557\u3057\u307E\u3057\u305F"},
-
- { ER_CHARS_NOT_ALLOWED,
- "\u6587\u5B57\u306F\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u3053\u306E\u30DD\u30A4\u30F3\u30C8\u3067\u306F\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093"},
-
- { ER_ATTR_NOT_ALLOWED,
- "\"{0}\"\u5C5E\u6027\u306F{1}\u8981\u7D20\u3067\u306F\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093\u3002"},
-
- { ER_BAD_VALUE,
- "{0}\u306E\u4E0D\u6B63\u306A\u5024{1} "},
-
- { ER_ATTRIB_VALUE_NOT_FOUND,
- "{0}\u5C5E\u6027\u5024\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093 "},
-
- { ER_ATTRIB_VALUE_NOT_RECOGNIZED,
- "{0}\u5C5E\u6027\u5024\u304C\u8A8D\u8B58\u3055\u308C\u307E\u305B\u3093 "},
-
- { ER_NULL_URI_NAMESPACE,
- "null\u306EURI\u3092\u6301\u3064\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u306E\u63A5\u982D\u8F9E\u3092\u751F\u6210\u3057\u3088\u3046\u3068\u3057\u307E\u3057\u305F"},
-
- { ER_NUMBER_TOO_BIG,
- "\u6700\u5927\u306ELong\u6574\u6570\u3088\u308A\u3082\u5927\u304D\u3044\u6570\u5024\u3092\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u3057\u3088\u3046\u3068\u3057\u307E\u3057\u305F"},
-
- { ER_CANNOT_FIND_SAX1_DRIVER,
- "SAX1\u30C9\u30E9\u30A4\u30D0\u30FB\u30AF\u30E9\u30B9{0}\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093"},
-
- { ER_SAX1_DRIVER_NOT_LOADED,
- "SAX1\u30C9\u30E9\u30A4\u30D0\u30FB\u30AF\u30E9\u30B9{0}\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u304C\u30ED\u30FC\u30C9\u3067\u304D\u307E\u305B\u3093"},
-
- { ER_SAX1_DRIVER_NOT_INSTANTIATED,
- "SAX1\u30C9\u30E9\u30A4\u30D0\u30FB\u30AF\u30E9\u30B9{0}\u304C\u30ED\u30FC\u30C9\u3055\u308C\u307E\u3057\u305F\u304C\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u5316\u3067\u304D\u307E\u305B\u3093"},
-
- { ER_SAX1_DRIVER_NOT_IMPLEMENT_PARSER,
- "SAX1\u30C9\u30E9\u30A4\u30D0\u30FB\u30AF\u30E9\u30B9{0}\u306Forg.xml.sax.Parser\u3092\u5B9F\u88C5\u3067\u304D\u307E\u305B\u3093"},
-
- { ER_PARSER_PROPERTY_NOT_SPECIFIED,
- "\u30B7\u30B9\u30C6\u30E0\u30FB\u30D7\u30ED\u30D1\u30C6\u30A3org.xml.sax.parser\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093"},
-
- { ER_PARSER_ARG_CANNOT_BE_NULL,
- "\u30D1\u30FC\u30B5\u30FC\u5F15\u6570\u306Fnull\u3067\u306A\u3044\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
-
- { ER_FEATURE,
- "\u6A5F\u80FD: {0}"},
-
- { ER_PROPERTY,
- "\u30D7\u30ED\u30D1\u30C6\u30A3: {0}"},
-
- { ER_NULL_ENTITY_RESOLVER,
- "Null\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u30FB\u30EA\u30BE\u30EB\u30D0"},
-
- { ER_NULL_DTD_HANDLER,
- "Null DTD\u30CF\u30F3\u30C9\u30E9"},
-
- { ER_NO_DRIVER_NAME_SPECIFIED,
- "\u30C9\u30E9\u30A4\u30D0\u540D\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"},
-
- { ER_NO_URL_SPECIFIED,
- "URL\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"},
-
- { ER_POOLSIZE_LESS_THAN_ONE,
- "\u30D7\u30FC\u30EB\u30FB\u30B5\u30A4\u30BA\u304C1\u3088\u308A\u5C0F\u3055\u3044\u3067\u3059\u3002"},
-
- { ER_INVALID_DRIVER_NAME,
- "\u7121\u52B9\u306A\u30C9\u30E9\u30A4\u30D0\u540D\u304C\u6307\u5B9A\u3055\u308C\u307E\u3057\u305F\u3002"},
-
- { ER_ERRORLISTENER,
- "ErrorListener"},
-
-
-// Note to translators: The following message should not normally be displayed
-// to users. It describes a situation in which the processor has detected
-// an internal consistency problem in itself, and it provides this message
-// for the developer to help diagnose the problem. The name
-// 'ElemTemplateElement' is the name of a class, and should not be
-// translated.
- { ER_ASSERT_NO_TEMPLATE_PARENT,
- "\u30D7\u30ED\u30B0\u30E9\u30DE\u306E\u30A8\u30E9\u30FC\u3002\u5F0F\u306BElemTemplateElement\u306E\u89AA\u304C\u3042\u308A\u307E\u305B\u3093\u3002"},
-
-
-// Note to translators: The following message should not normally be displayed
-// to users. It describes a situation in which the processor has detected
-// an internal consistency problem in itself, and it provides this message
-// for the developer to help diagnose the problem. The substitution text
-// provides further information in order to diagnose the problem. The name
-// 'RedundentExprEliminator' is the name of a class, and should not be
-// translated.
- { ER_ASSERT_REDUNDENT_EXPR_ELIMINATOR,
- "RedundentExprEliminator\u3067\u306E\u30D7\u30ED\u30B0\u30E9\u30DE\u306E\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3: {0}"},
-
- { ER_NOT_ALLOWED_IN_POSITION,
- "{0}\u306F\u30B9\u30BF\u30A4\u30EB\u30B7\u30FC\u30C8\u306E\u3053\u306E\u4F4D\u7F6E\u3067\u306F\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093\u3002"},
-
- { ER_NONWHITESPACE_NOT_ALLOWED_IN_POSITION,
- "\u7A7A\u767D\u4EE5\u5916\u306E\u30C6\u30AD\u30B9\u30C8\u306F\u30B9\u30BF\u30A4\u30EB\u30B7\u30FC\u30C8\u306E\u3053\u306E\u4F4D\u7F6E\u3067\u306F\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093\u3002"},
-
- // This code is shared with warning codes.
- // SystemId Unknown
- { INVALID_TCHAR,
- "\u4E0D\u6B63\u306A\u5024: {1}\u304CCHAR\u5C5E\u6027{0}\u306B\u4F7F\u7528\u3055\u308C\u307E\u3057\u305F\u3002CHAR\u578B\u306E\u5C5E\u6027\u306F1\u6587\u5B57\u306E\u307F\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002"},
-
- // Note to translators: The following message is used if the value of
- // an attribute in a stylesheet is invalid. "QNAME" is the XML data-type of
- // the attribute, and should not be translated. The substitution text {1} is
- // the attribute value and {0} is the attribute name.
- //The following codes are shared with the warning codes...
- { INVALID_QNAME,
- "\u4E0D\u6B63\u306A\u5024: {1}\u304CQNAME\u5C5E\u6027{0}\u306B\u4F7F\u7528\u3055\u308C\u307E\u3057\u305F"},
-
- // Note to translators: The following message is used if the value of
- // an attribute in a stylesheet is invalid. "ENUM" is the XML data-type of
- // the attribute, and should not be translated. The substitution text {1} is
- // the attribute value, {0} is the attribute name, and {2} is a list of valid
- // values.
- { INVALID_ENUM,
- "\u4E0D\u6B63\u306A\u5024: {1}\u304CENUM\u5C5E\u6027{0}\u306B\u4F7F\u7528\u3055\u308C\u307E\u3057\u305F\u3002\u6709\u52B9\u306A\u5024\u306F{2}\u3067\u3059\u3002"},
-
-// Note to translators: The following message is used if the value of
-// an attribute in a stylesheet is invalid. "NMTOKEN" is the XML data-type
-// of the attribute, and should not be translated. The substitution text {1} is
-// the attribute value and {0} is the attribute name.
- { INVALID_NMTOKEN,
- "\u4E0D\u6B63\u306A\u5024: {1}\u304CNMTOKEN\u5C5E\u6027{0}\u306B\u4F7F\u7528\u3055\u308C\u307E\u3057\u305F "},
-
-// Note to translators: The following message is used if the value of
-// an attribute in a stylesheet is invalid. "NCNAME" is the XML data-type
-// of the attribute, and should not be translated. The substitution text {1} is
-// the attribute value and {0} is the attribute name.
- { INVALID_NCNAME,
- "\u4E0D\u6B63\u306A\u5024: {1}\u304CNCNAME\u5C5E\u6027{0}\u306B\u4F7F\u7528\u3055\u308C\u307E\u3057\u305F "},
-
-// Note to translators: The following message is used if the value of
-// an attribute in a stylesheet is invalid. "boolean" is the XSLT data-type
-// of the attribute, and should not be translated. The substitution text {1} is
-// the attribute value and {0} is the attribute name.
- { INVALID_BOOLEAN,
- "\u4E0D\u6B63\u306A\u5024: {1}\u304Cboolean\u5C5E\u6027{0}\u306B\u4F7F\u7528\u3055\u308C\u307E\u3057\u305F "},
-
-// Note to translators: The following message is used if the value of
-// an attribute in a stylesheet is invalid. "number" is the XSLT data-type
-// of the attribute, and should not be translated. The substitution text {1} is
-// the attribute value and {0} is the attribute name.
- { INVALID_NUMBER,
- "\u4E0D\u6B63\u306A\u5024: {1}\u304C\u6570\u5024\u5C5E\u6027{0}\u306B\u4F7F\u7528\u3055\u308C\u307E\u3057\u305F "},
-
-
- // End of shared codes...
-
-// Note to translators: A "match pattern" is a special form of XPath expression
-// that is used for matching patterns. The substitution text is the name of
-// a function. The message indicates that when this function is referenced in
-// a match pattern, its argument must be a string literal (or constant.)
-// ER_ARG_LITERAL - new error message for bugzilla //5202
- { ER_ARG_LITERAL,
- "\u4E00\u81F4\u30D1\u30BF\u30FC\u30F3\u306B\u304A\u3051\u308B{0}\u306E\u5F15\u6570\u306F\u30EA\u30C6\u30E9\u30EB\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002"},
-
-// Note to translators: The following message indicates that two definitions of
-// a variable. A "global variable" is a variable that is accessible everywher
-// in the stylesheet.
-// ER_DUPLICATE_GLOBAL_VAR - new error message for bugzilla #790
- { ER_DUPLICATE_GLOBAL_VAR,
- "\u30B0\u30ED\u30FC\u30D0\u30EB\u5909\u6570\u5BA3\u8A00\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059\u3002"},
-
-
-// Note to translators: The following message indicates that two definitions of
-// a variable were encountered.
-// ER_DUPLICATE_VAR - new error message for bugzilla #790
- { ER_DUPLICATE_VAR,
- "\u5909\u6570\u5BA3\u8A00\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059\u3002"},
-
- // Note to translators: "xsl:template, "name" and "match" are XSLT keywords
- // which must not be translated.
- // ER_TEMPLATE_NAME_MATCH - new error message for bugzilla #789
- { ER_TEMPLATE_NAME_MATCH,
- "xsl:template\u306B\u306Fname\u5C5E\u6027\u307E\u305F\u306Fmatch\u5C5E\u6027(\u3042\u308B\u3044\u306F\u4E21\u65B9)\u304C\u5FC5\u8981\u3067\u3059"},
-
- // Note to translators: "exclude-result-prefixes" is an XSLT keyword which
- // should not be translated. The message indicates that a namespace prefix
- // encountered as part of the value of the exclude-result-prefixes attribute
- // was in error.
- // ER_INVALID_PREFIX - new error message for bugzilla #788
- { ER_INVALID_PREFIX,
- "exclude-result-prefixes\u306E\u63A5\u982D\u8F9E\u304C\u7121\u52B9\u3067\u3059: {0}"},
-
- // Note to translators: An "attribute set" is a set of attributes that can
- // be added to an element in the output document as a group. The message
- // indicates that there was a reference to an attribute set named {0} that
- // was never defined.
- // ER_NO_ATTRIB_SET - new error message for bugzilla #782
- { ER_NO_ATTRIB_SET,
- "{0}\u3068\u3044\u3046\u540D\u524D\u306Eattribute-set\u306F\u5B58\u5728\u3057\u307E\u305B\u3093"},
-
- // Note to translators: This message indicates that there was a reference
- // to a function named {0} for which no function definition could be found.
- { ER_FUNCTION_NOT_FOUND,
- "{0}\u3068\u3044\u3046\u540D\u524D\u306E\u6A5F\u80FD\u306F\u5B58\u5728\u3057\u307E\u305B\u3093"},
-
- // Note to translators: This message indicates that the XSLT instruction
- // that is named by the substitution text {0} must not contain other XSLT
- // instructions (content) or a "select" attribute. The word "select" is
- // an XSLT keyword in this case and must not be translated.
- { ER_CANT_HAVE_CONTENT_AND_SELECT,
- "{0}\u8981\u7D20\u306B\u306F\u30B3\u30F3\u30C6\u30F3\u30C4\u3068select\u5C5E\u6027\u306E\u4E21\u65B9\u3092\u542B\u3081\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002"},
-
- // Note to translators: This message indicates that the value argument
- // of setParameter must be a valid Java Object.
- { ER_INVALID_SET_PARAM_VALUE,
- "\u30D1\u30E9\u30E1\u30FC\u30BF{0}\u306F\u6709\u52B9\u306AJava\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
-
- { ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX_FOR_DEFAULT,
- "xsl:namespace-alias\u8981\u7D20\u306Eresult-prefix\u5C5E\u6027\u306B\u5024'#default'\u304C\u3042\u308A\u307E\u3059\u304C\u3001\u8981\u7D20\u306E\u30B9\u30B3\u30FC\u30D7\u5185\u306B\u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u306E\u5BA3\u8A00\u304C\u3042\u308A\u307E\u305B\u3093"},
-
- { ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX,
- "xsl:namespace-alias\u8981\u7D20\u306Eresult-prefix\u5C5E\u6027\u306B\u5024''{0}''\u304C\u3042\u308A\u307E\u3059\u304C\u3001\u8981\u7D20\u306E\u30B9\u30B3\u30FC\u30D7\u5185\u306B\u63A5\u982D\u8F9E''{0}''\u306E\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u5BA3\u8A00\u304C\u3042\u308A\u307E\u305B\u3093\u3002"},
-
- { ER_SET_FEATURE_NULL_NAME,
- "\u6A5F\u80FD\u540D\u306FTransformerFactory.setFeature(String name, boolean value)\u5185\u3067null\u306B\u3067\u304D\u307E\u305B\u3093\u3002"},
-
- { ER_GET_FEATURE_NULL_NAME,
- "\u6A5F\u80FD\u540D\u306FTransformerFactory.getFeature(String name)\u5185\u3067null\u306B\u3067\u304D\u307E\u305B\u3093\u3002"},
-
- { ER_UNSUPPORTED_FEATURE,
- "\u6A5F\u80FD''{0}''\u3092\u3053\u306ETransformerFactory\u306B\u8A2D\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002"},
-
- { ER_EXTENSION_ELEMENT_NOT_ALLOWED_IN_SECURE_PROCESSING,
- "\u30BB\u30AD\u30E5\u30A2\u51E6\u7406\u6A5F\u80FD\u304Ctrue\u306B\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u308B\u3068\u304D\u3001\u62E1\u5F35\u8981\u7D20''{0}''\u306E\u4F7F\u7528\u306F\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093\u3002"},
-
- { ER_NAMESPACE_CONTEXT_NULL_NAMESPACE,
- "null\u306E\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9URI\u306B\u3064\u3044\u3066\u63A5\u982D\u8F9E\u3092\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093\u3002"},
-
- { ER_NAMESPACE_CONTEXT_NULL_PREFIX,
- "null\u306E\u63A5\u982D\u8F9E\u306B\u3064\u3044\u3066\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9URI\u3092\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093\u3002"},
-
- { ER_XPATH_RESOLVER_NULL_QNAME,
- "\u6A5F\u80FD\u540D\u3092null\u306B\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002"},
-
- { ER_XPATH_RESOLVER_NEGATIVE_ARITY,
- "arity\u3092\u8CA0\u306B\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002"},
- // Warnings...
-
- { WG_FOUND_CURLYBRACE,
- "'}'\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u304C\u5C5E\u6027\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u304C\u958B\u3044\u3066\u3044\u307E\u305B\u3093\u3002"},
-
- { WG_COUNT_ATTRIB_MATCHES_NO_ANCESTOR,
- "\u8B66\u544A: count\u5C5E\u6027\u304Cxsl:number\u5185\u306E\u7956\u5148\u3068\u4E00\u81F4\u3057\u307E\u305B\u3093\u3002\u30BF\u30FC\u30B2\u30C3\u30C8= {0}"},
-
- { WG_EXPR_ATTRIB_CHANGED_TO_SELECT,
- "\u53E4\u3044\u69CB\u6587: 'expr'\u5C5E\u6027\u306E\u540D\u524D\u304C'select'\u306B\u5909\u66F4\u3055\u308C\u307E\u3057\u305F\u3002"},
-
- { WG_NO_LOCALE_IN_FORMATNUMBER,
- "Xalan\u306Fformat-number\u95A2\u6570\u5185\u306E\u30ED\u30B1\u30FC\u30EB\u540D\u3092\u307E\u3060\u51E6\u7406\u3067\u304D\u307E\u305B\u3093\u3002"},
-
- { WG_LOCALE_NOT_FOUND,
- "\u8B66\u544A: xml:lang={0}\u306E\u30ED\u30B1\u30FC\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F"},
-
- { WG_CANNOT_MAKE_URL_FROM,
- "{0}\u304B\u3089URL\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093"},
-
- { WG_CANNOT_LOAD_REQUESTED_DOC,
- "\u30EA\u30AF\u30A8\u30B9\u30C8\u3055\u308C\u305F\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8{0}\u3092\u30ED\u30FC\u30C9\u3067\u304D\u307E\u305B\u3093"},
-
- { WG_CANNOT_FIND_COLLATOR,
- "<sort xml:lang={0}\u306E\u30B3\u30EC\u30FC\u30BF\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F"},
-
- { WG_FUNCTIONS_SHOULD_USE_URL,
- "\u53E4\u3044\u69CB\u6587: \u95A2\u6570\u547D\u4EE4\u306F{0}\u306EURL\u3092\u4F7F\u7528\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
-
- { WG_ENCODING_NOT_SUPPORTED_USING_UTF8,
- "\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0{0}\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002UTF-8\u3092\u4F7F\u7528\u3057\u307E\u3059"},
-
- { WG_ENCODING_NOT_SUPPORTED_USING_JAVA,
- "\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0{0}\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002Java {1}\u3092\u4F7F\u7528\u3057\u307E\u3059"},
-
- { WG_SPECIFICITY_CONFLICTS,
- "\u7279\u7570\u6027\u306E\u7AF6\u5408\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F: {0}\u3002\u30B9\u30BF\u30A4\u30EB\u30B7\u30FC\u30C8\u5185\u3067\u6700\u5F8C\u306B\u898B\u3064\u304B\u3063\u305F\u3082\u306E\u304C\u4F7F\u7528\u3055\u308C\u307E\u3059\u3002"},
-
- { WG_PARSING_AND_PREPARING,
- "========= {0}\u306E\u89E3\u6790\u304A\u3088\u3073\u6E96\u5099\u4E2D =========="},
-
- { WG_ATTR_TEMPLATE,
- "\u5C5E\u6027\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u3001{0}"},
-
- { WG_CONFLICT_BETWEEN_XSLSTRIPSPACE_AND_XSLPRESERVESPACE,
- "xsl:strip-space\u3068xsl:preserve-space\u306E\u9593\u3067\u4E00\u81F4\u304C\u7AF6\u5408\u3057\u3066\u3044\u307E\u3059"},
-
- { WG_ATTRIB_NOT_HANDLED,
- "Xalan\u306F{0}\u5C5E\u6027\u3092\u307E\u3060\u51E6\u7406\u3057\u307E\u305B\u3093\u3002"},
-
- { WG_NO_DECIMALFORMAT_DECLARATION,
- "10\u9032\u6570\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8{0}\u306E\u5BA3\u8A00\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093"},
-
- { WG_OLD_XSLT_NS,
- "XSLT\u306E\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u304C\u306A\u3044\u304B\u4E0D\u6B63\u3067\u3059\u3002 "},
-
- { WG_ONE_DEFAULT_XSLDECIMALFORMAT_ALLOWED,
- "\u30C7\u30D5\u30A9\u30EB\u30C8\u306Exsl:decimal-format\u5BA3\u8A00\u306F1\u3064\u306E\u307F\u8A31\u53EF\u3055\u308C\u307E\u3059\u3002"},
-
- { WG_XSLDECIMALFORMAT_NAMES_MUST_BE_UNIQUE,
- "xsl:decimal-format\u540D\u306F\u56FA\u6709\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\u540D\u524D\"{0}\"\u306F\u91CD\u8907\u3057\u3066\u3044\u307E\u3059\u3002"},
-
- { WG_ILLEGAL_ATTRIBUTE,
- "{0}\u306B\u4E0D\u6B63\u306A\u5C5E\u6027\u304C\u3042\u308A\u307E\u3059: {1}"},
-
- { WG_COULD_NOT_RESOLVE_PREFIX,
- "\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u306E\u63A5\u982D\u8F9E{0}\u3092\u89E3\u6C7A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30CE\u30FC\u30C9\u306F\u7121\u8996\u3055\u308C\u307E\u3059\u3002"},
-
- { WG_STYLESHEET_REQUIRES_VERSION_ATTRIB,
- "xsl:stylesheet\u306F'version'\u5C5E\u6027\u304C\u5FC5\u8981\u3067\u3059\u3002"},
-
- { WG_ILLEGAL_ATTRIBUTE_NAME,
- "\u4E0D\u6B63\u306A\u5C5E\u6027\u540D: {0}"},
-
- { WG_ILLEGAL_ATTRIBUTE_VALUE,
- "\u7121\u52B9\u306A\u5024\u304C\u5C5E\u6027{0}\u306B\u4F7F\u7528\u3055\u308C\u307E\u3057\u305F: {1}"},
-
- { WG_EMPTY_SECOND_ARG,
- "\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u95A2\u6570\u306E2\u756A\u76EE\u306E\u5F15\u6570\u304B\u3089\u306E\u7D50\u679C\u30CE\u30FC\u30C9\u30BB\u30C3\u30C8\u304C\u7A7A\u3067\u3059\u3002\u7A7A\u306E\u30CE\u30FC\u30C9\u30BB\u30C3\u30C8\u3092\u8FD4\u3057\u307E\u3059\u3002"},
-
- //Following are the new WARNING keys added in XALAN code base after Jdk 1.4 (Xalan 2.2-D11)
-
- // Note to translators: "name" and "xsl:processing-instruction" are keywords
- // and must not be translated.
- { WG_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML,
- "xsl:processing-instruction\u540D\u306E'name'\u5C5E\u6027\u306E\u5024\u306F'xml'\u3067\u306A\u3044\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
-
- // Note to translators: "name" and "xsl:processing-instruction" are keywords
- // and must not be translated. "NCName" is an XML data-type and must not be
- // translated.
- { WG_PROCESSINGINSTRUCTION_NOTVALID_NCNAME,
- "xsl:processing-instruction\u306E''name''\u5C5E\u6027\u306E\u5024\u306F\u6709\u52B9\u306ANCName\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059: {0}"},
-
- // Note to translators: This message is reported if the stylesheet that is
- // being processed attempted to construct an XML document with an attribute in a
- // place other than on an element. The substitution text specifies the name of
- // the attribute.
- { WG_ILLEGAL_ATTRIBUTE_POSITION,
- "\u5B50\u30CE\u30FC\u30C9\u306E\u5F8C\u307E\u305F\u306F\u8981\u7D20\u304C\u751F\u6210\u3055\u308C\u308B\u524D\u306B\u5C5E\u6027{0}\u3092\u8FFD\u52A0\u3067\u304D\u307E\u305B\u3093\u3002\u5C5E\u6027\u306F\u7121\u8996\u3055\u308C\u307E\u3059\u3002"},
-
- { NO_MODIFICATION_ALLOWED_ERR,
- "\u5909\u66F4\u304C\u8A31\u53EF\u3055\u308C\u3066\u3044\u306A\u3044\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u3092\u5909\u66F4\u3057\u3088\u3046\u3068\u3057\u307E\u3057\u305F\u3002"
- },
-
- //Check: WHY THERE IS A GAP B/W NUMBERS in the XSLTErrorResources properties file?
-
- // Other miscellaneous text used inside the code...
- { "ui_language", "ja"},
- { "help_language", "ja" },
- { "language", "ja" },
- { "BAD_CODE", "createMessage\u306E\u30D1\u30E9\u30E1\u30FC\u30BF\u304C\u7BC4\u56F2\u5916\u3067\u3059"},
- { "FORMAT_FAILED", "messageFormat\u306E\u547C\u51FA\u3057\u4E2D\u306B\u4F8B\u5916\u304C\u30B9\u30ED\u30FC\u3055\u308C\u307E\u3057\u305F"},
- { "version", ">>>>>>> Xalan\u30D0\u30FC\u30B8\u30E7\u30F3 "},
- { "version2", "<<<<<<<"},
- { "yes", "yes"},
- { "line", "\u884C\u756A\u53F7"},
- { "column","\u5217\u756A\u53F7"},
- { "xsldone", "XSLProcessor: \u5B8C\u4E86\u3057\u307E\u3057\u305F"},
-
-
- // Note to translators: The following messages provide usage information
- // for the Xalan Process command line. "Process" is the name of a Java class,
- // and should not be translated.
- { "xslProc_option", "Xalan-J\u30B3\u30DE\u30F3\u30C9\u884C\u30D7\u30ED\u30BB\u30B9\u30FB\u30AF\u30E9\u30B9\u306E\u30AA\u30D7\u30B7\u30E7\u30F3:"},
- { "xslProc_option", "Xalan-J\u30B3\u30DE\u30F3\u30C9\u884C\u30D7\u30ED\u30BB\u30B9\u30FB\u30AF\u30E9\u30B9\u306E\u30AA\u30D7\u30B7\u30E7\u30F3:"},
- { "xslProc_invalid_xsltc_option", "\u30AA\u30D7\u30B7\u30E7\u30F3{0}\u306FXSLTC\u30E2\u30FC\u30C9\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"},
- { "xslProc_invalid_xalan_option", "\u30AA\u30D7\u30B7\u30E7\u30F3{0}\u306F-XSLTC\u3068\u3068\u3082\u306B\u306E\u307F\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002"},
- { "xslProc_no_input", "\u30A8\u30E9\u30FC: \u30B9\u30BF\u30A4\u30EB\u30B7\u30FC\u30C8\u307E\u305F\u306F\u5165\u529Bxml\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u4F7F\u7528\u65B9\u6CD5\u306E\u6307\u793A\u306B\u3064\u3044\u3066\u306F\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u4ED8\u3051\u305A\u306B\u3053\u306E\u30B3\u30DE\u30F3\u30C9\u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
- { "xslProc_common_options", "-\u5171\u901A\u30AA\u30D7\u30B7\u30E7\u30F3-"},
- { "xslProc_xalan_options", "-Xalan\u7528\u30AA\u30D7\u30B7\u30E7\u30F3-"},
- { "xslProc_xsltc_options", "-XSLTC\u7528\u30AA\u30D7\u30B7\u30E7\u30F3-"},
- { "xslProc_return_to_continue", "(\u7D9A\u884C\u3059\u308B\u306B\u306F<return>\u3092\u62BC\u3057\u3066\u304F\u3060\u3055\u3044)"},
-
- // Note to translators: The option name and the parameter name do not need to
- // be translated. Only translate the messages in parentheses. Note also that
- // leading whitespace in the messages is used to indent the usage information
- // for each option in the English messages.
- // Do not translate the keywords: XSLTC, SAX, DOM and DTM.
- { "optionXSLTC", " [-XSLTC (\u5909\u63DB\u306BXSLTC\u3092\u4F7F\u7528)]"},
- { "optionIN", " [-IN inputXMLURL]"},
- { "optionXSL", " [-XSL XSLTransformationURL]"},
- { "optionOUT", " [-OUT outputFileName]"},
- { "optionLXCIN", " [-LXCIN compiledStylesheetFileNameIn]"},
- { "optionLXCOUT", " [-LXCOUT compiledStylesheetFileNameOutOut]"},
- { "optionPARSER", " [-PARSER \u30D1\u30FC\u30B5\u30FC\u30FB\u30EA\u30A8\u30BE\u30F3\u306E\u5B8C\u5168\u4FEE\u98FE\u30AF\u30E9\u30B9\u540D]"},
- { "optionE", " [-E (\u5B9F\u4F53\u53C2\u7167\u3092\u62E1\u5F35\u3057\u306A\u3044)]"},
- { "optionV", " [-E (\u5B9F\u4F53\u53C2\u7167\u3092\u62E1\u5F35\u3057\u306A\u3044)]"},
- { "optionQC", " [-QC (\u6291\u5236\u30D1\u30BF\u30FC\u30F3\u7AF6\u5408\u306E\u8B66\u544A)]"},
- { "optionQ", " [-Q (\u6291\u5236\u30E2\u30FC\u30C9)]"},
- { "optionLF", " [-LF (\u51FA\u529B\u3067\u306E\u307F\u6539\u884C\u3092\u4F7F\u7528{\u30C7\u30D5\u30A9\u30EB\u30C8\u306FCR/LF})]"},
- { "optionCR", " [-CR (\u51FA\u529B\u3067\u306E\u307F\u6539\u884C\u3092\u4F7F\u7528{\u30C7\u30D5\u30A9\u30EB\u30C8\u306FCR/LF})]"},
- { "optionESCAPE", " [-ESCAPE (\u30A8\u30B9\u30B1\u30FC\u30D7\u3059\u308B\u6587\u5B57{\u30C7\u30D5\u30A9\u30EB\u30C8\u306F<>&\"'\\r\\n}]"},
- { "optionINDENT", " [-INDENT (\u30A4\u30F3\u30C7\u30F3\u30C8\u3059\u308B\u7A7A\u767D\u6587\u5B57\u6570\u3092\u5236\u5FA1{\u30C7\u30D5\u30A9\u30EB\u30C8\u306F0})]"},
- { "optionTT", " [-TT (\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u304C\u547C\u3073\u51FA\u3055\u308C\u305F\u3068\u304D\u306B\u30C8\u30EC\u30FC\u30B9\u3059\u308B\u3002)]"},
- { "optionTG", " [-TG (\u5404\u751F\u6210\u30A4\u30D9\u30F3\u30C8\u3092\u30C8\u30EC\u30FC\u30B9\u3059\u308B\u3002)]"},
- { "optionTS", " [-TS (\u5404\u9078\u629E\u30A4\u30D9\u30F3\u30C8\u3092\u30C8\u30EC\u30FC\u30B9\u3059\u308B\u3002)]"},
- { "optionTTC", " [-TTC (\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u306E\u5B50\u304C\u51E6\u7406\u3055\u308C\u308B\u3068\u304D\u306B\u30C8\u30EC\u30FC\u30B9\u3059\u308B\u3002)]"},
- { "optionTCLASS", " [-TCLASS (\u30C8\u30EC\u30FC\u30B9\u62E1\u5F35\u7528\u306ETraceListener\u30AF\u30E9\u30B9\u3002)]"},
- { "optionVALIDATE", " [-VALIDATE (\u691C\u8A3C\u3092\u5B9F\u884C\u3059\u308B\u304B\u3069\u3046\u304B\u3092\u8A2D\u5B9A\u3059\u308B\u3002\u691C\u8A3C\u306F\u30C7\u30D5\u30A9\u30EB\u30C8\u3067\u306F\u30AA\u30D5\u3002)]"},
- { "optionEDUMP", " [-EDUMP {optional filename} (\u30A8\u30E9\u30FC\u6642\u306Bstackdump\u3092\u5B9F\u884C\u3059\u308B\u3002)]"},
- { "optionXML", " [-XML (XML\u30D5\u30A9\u30FC\u30DE\u30C3\u30BF\u3092\u4F7F\u7528\u3057\u3066XML\u30D8\u30C3\u30C0\u30FC\u3092\u8FFD\u52A0\u3059\u308B\u3002)]"},
- { "optionTEXT", " [-TEXT (\u30B7\u30F3\u30D7\u30EB\u30FB\u30C6\u30AD\u30B9\u30C8\u30FB\u30D5\u30A9\u30FC\u30DE\u30C3\u30BF\u3092\u4F7F\u7528\u3059\u308B\u3002)]"},
- { "optionHTML", " [-HTML (HTML\u30D5\u30A9\u30FC\u30DE\u30C3\u30BF\u3092\u4F7F\u7528\u3059\u308B\u3002)]"},
- { "optionPARAM", " [-PARAM name expression (\u30B9\u30BF\u30A4\u30EB\u30B7\u30FC\u30C8\u30FB\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u8A2D\u5B9A\u3059\u308B)]"},
- { "noParsermsg1", "XSL\u30D7\u30ED\u30BB\u30B9\u306F\u6210\u529F\u3057\u307E\u305B\u3093\u3067\u3057\u305F\u3002"},
- { "noParsermsg2", "** \u30D1\u30FC\u30B5\u30FC\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F **"},
- { "noParsermsg3", "\u30AF\u30E9\u30B9\u30D1\u30B9\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
- { "noParsermsg4", "IBM\u306EJava\u7528XML\u30D1\u30FC\u30B5\u30FC\u304C\u306A\u3044\u5834\u5408\u3001\u6B21\u306E\u30B5\u30A4\u30C8\u304B\u3089\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u3067\u304D\u307E\u3059"},
- { "noParsermsg5", "IBM\u306EAlphaWorks: http://www.alphaworks.ibm.com/formula/xml"},
- { "optionURIRESOLVER", " [-URIRESOLVER full class name (URI\u306E\u89E3\u6C7A\u306B\u4F7F\u7528\u3055\u308C\u308BURIResolver)]"},
- { "optionENTITYRESOLVER", " [-ENTITYRESOLVER full class name (\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u306E\u89E3\u6C7A\u306B\u4F7F\u7528\u3055\u308C\u308BEntityResolver)]"},
- { "optionCONTENTHANDLER", " [-CONTENTHANDLER full class name (\u51FA\u529B\u306E\u30B7\u30EA\u30A2\u30E9\u30A4\u30BA\u306B\u4F7F\u7528\u3055\u308C\u308BContentHandler)]"},
- { "optionLINENUMBERS", " [-L \u30BD\u30FC\u30B9\u30FB\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u884C\u756A\u53F7\u3092\u4F7F\u7528]"},
- { "optionSECUREPROCESSING", " [-SECURE (\u30BB\u30AD\u30E5\u30A2\u51E6\u7406\u6A5F\u80FD\u3092true\u306B\u8A2D\u5B9A\u3059\u308B\u3002)]"},
-
- // Following are the new options added in XSLTErrorResources.properties files after Jdk 1.4 (Xalan 2.2-D11)
-
-
- { "optionMEDIA", " [-MEDIA mediaType (\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306B\u95A2\u9023\u4ED8\u3051\u3089\u308C\u305F\u30B9\u30BF\u30A4\u30EB\u30B7\u30FC\u30C8\u3092\u898B\u3064\u3051\u308B\u305F\u3081\u306B\u30E1\u30C7\u30A3\u30A2\u5C5E\u6027\u3092\u4F7F\u7528\u3059\u308B\u3002)]"},
- { "optionFLAVOR", " [-FLAVOR flavorName (\u5909\u63DB\u3092\u884C\u3046\u305F\u3081\u306Bs2s=SAX\u307E\u305F\u306Fd2d=DOM\u3092\u660E\u793A\u7684\u306B\u4F7F\u7528\u3059\u308B\u3002)] "}, // Added by sboag/scurcuru; experimental
- { "optionDIAG", " [-DIAG (\u5909\u63DB\u306B\u304B\u304B\u3063\u305F\u5408\u8A08\u30DF\u30EA\u79D2\u6570\u3092\u51FA\u529B\u3059\u308B\u3002)]"},
- { "optionINCREMENTAL", " [-INCREMENTAL (http://xml.apache.org/xalan/features/incremental\u3092true\u306B\u8A2D\u5B9A\u3059\u308B\u3053\u3068\u306B\u3088\u3063\u3066\u5897\u5206DTM\u69CB\u7BC9\u3092\u30EA\u30AF\u30A8\u30B9\u30C8\u3059\u308B\u3002)]"},
- { "optionNOOPTIMIMIZE", " [-NOOPTIMIMIZE (http://xml.apache.org/xalan/features/optimize\u3092false\u306B\u8A2D\u5B9A\u3059\u308B\u3053\u3068\u306B\u3088\u3063\u3066\u30B9\u30BF\u30A4\u30EB\u30B7\u30FC\u30C8\u6700\u9069\u5316\u51E6\u7406\u3092\u30EA\u30AF\u30A8\u30B9\u30C8\u3057\u306A\u3044\u3002)]"},
- { "optionRL", " [-RL recursionlimit (\u30B9\u30BF\u30A4\u30EB\u30B7\u30FC\u30C8\u306E\u518D\u5E30\u306E\u6DF1\u3055\u306B\u3064\u3044\u3066\u6570\u5024\u4E0A\u306E\u5236\u9650\u3092\u30A2\u30B5\u30FC\u30C8\u3059\u308B\u3002)]"},
- { "optionXO", " [-XO [transletName] (\u751F\u6210\u6E08translet\u306B\u540D\u524D\u3092\u5272\u308A\u5F53\u3066\u308B)]"},
- { "optionXD", " [-XD destinationDirectory (translet\u306E\u5B9B\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u6307\u5B9A\u3059\u308B)]"},
- { "optionXJ", " [-XJ jarfile (translet\u30AF\u30E9\u30B9\u3092\u540D\u524D<jarfile>\u306Ejar\u30D5\u30A1\u30A4\u30EB\u306B\u30D1\u30C3\u30B1\u30FC\u30B8\u3059\u308B)]"},
- { "optionXP", " [-XP package (\u3059\u3079\u3066\u306E\u751F\u6210\u6E08translet\u30AF\u30E9\u30B9\u7528\u306B\u30D1\u30C3\u30B1\u30FC\u30B8\u540D\u63A5\u982D\u8F9E\u3092\u6307\u5B9A\u3059\u308B)]"},
-
- //AddITIONAL STRINGS that need L10n
- // Note to translators: The following message describes usage of a particular
- // command-line option that is used to enable the "template inlining"
- // optimization. The optimization involves making a copy of the code
- // generated for a template in another template that refers to it.
- { "optionXN", " [-XN (\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u306E\u30A4\u30F3\u30E9\u30A4\u30F3\u5316\u3092\u6709\u52B9\u306B\u3059\u308B)]" },
- { "optionXX", " [-XX (\u8FFD\u52A0\u306E\u30C7\u30D0\u30C3\u30B0\u30FB\u30E1\u30C3\u30BB\u30FC\u30B8\u51FA\u529B\u3092\u30AA\u30F3\u306B\u3059\u308B)]"},
- { "optionXT" , " [-XT (\u53EF\u80FD\u306A\u5834\u5408\u306F\u5909\u63DB\u306E\u305F\u3081\u306Btranslet\u3092\u4F7F\u7528\u3059\u308B)]"},
- { "diagTiming"," --------- {1}\u306B\u3088\u308B{0}\u306E\u5909\u63DB\u306B{2}\u30DF\u30EA\u79D2\u304B\u304B\u308A\u307E\u3057\u305F" },
- { "recursionTooDeep","\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u306E\u30CD\u30B9\u30C8\u304C\u6DF1\u3059\u304E\u307E\u3059\u3002\u30CD\u30B9\u30C8= {0}\u3001\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8{1} {2}" },
- { "nameIs", "\u540D\u524D:" },
- { "matchPatternIs", "\u4E00\u81F4\u30D1\u30BF\u30FC\u30F3:" }
-
- };
-
- }
- // ================= INFRASTRUCTURE ======================
-
- /** String for use when a bad error code was encountered. */
- public static final String BAD_CODE = "BAD_CODE";
-
- /** String for use when formatting of the error string failed. */
- public static final String FORMAT_FAILED = "FORMAT_FAILED";
-
- /** General error string. */
- public static final String ERROR_STRING = "#error";
-
- /** String to prepend to error messages. */
- public static final String ERROR_HEADER = "Error: ";
-
- /** String to prepend to warning messages. */
- public static final String WARNING_HEADER = "Warning: ";
-
- /** String to specify the XSLT module. */
- public static final String XSL_HEADER = "XSLT ";
-
- /** String to specify the XML parser module. */
- public static final String XML_HEADER = "XML ";
-
- /** I don't think this is used any more.
- * @deprecated */
- public static final String QUERY_HEADER = "PATTERN ";
-
-
- }
diff --git a/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ko.java b/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ko.java
deleted file mode 100644
index fe292ee..0000000
--- a/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ko.java
+++ /dev/null
@@ -1,1447 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xalan.internal.res;
-
-import java.util.ListResourceBundle;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * Set up error messages.
- * We build a two dimensional array of message keys and
- * message strings. In order to add a new message here,
- * you need to first add a String constant. And
- * you need to enter key , value pair as part of contents
- * Array. You also need to update MAX_CODE for error strings
- * and MAX_WARNING for warnings ( Needed for only information
- * purpose )
- */
-public class XSLTErrorResources_ko extends ListResourceBundle
-{
-
-/*
- * This file contains error and warning messages related to Xalan Error
- * Handling.
- *
- * General notes to translators:
- *
- * 1) Xalan (or more properly, Xalan-interpretive) and XSLTC are names of
- * components.
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- * XSLTC is an acronym for XSLT Compiler.
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 5) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 6) "Translet" is an invented term that describes the class file that
- * results from compiling an XML stylesheet into a Java class.
- *
- * 7) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- */
-
- /*
- * Static variables
- */
- public static final String ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX =
- "ER_INVALID_SET_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX";
-
- public static final String ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX_FOR_DEFAULT =
- "ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX_FOR_DEFAULT";
-
- public static final String ER_NO_CURLYBRACE = "ER_NO_CURLYBRACE";
- public static final String ER_FUNCTION_NOT_SUPPORTED = "ER_FUNCTION_NOT_SUPPORTED";
- public static final String ER_ILLEGAL_ATTRIBUTE = "ER_ILLEGAL_ATTRIBUTE";
- public static final String ER_NULL_SOURCENODE_APPLYIMPORTS = "ER_NULL_SOURCENODE_APPLYIMPORTS";
- public static final String ER_CANNOT_ADD = "ER_CANNOT_ADD";
- public static final String ER_NULL_SOURCENODE_HANDLEAPPLYTEMPLATES="ER_NULL_SOURCENODE_HANDLEAPPLYTEMPLATES";
- public static final String ER_NO_NAME_ATTRIB = "ER_NO_NAME_ATTRIB";
- public static final String ER_TEMPLATE_NOT_FOUND = "ER_TEMPLATE_NOT_FOUND";
- public static final String ER_CANT_RESOLVE_NAME_AVT = "ER_CANT_RESOLVE_NAME_AVT";
- public static final String ER_REQUIRES_ATTRIB = "ER_REQUIRES_ATTRIB";
- public static final String ER_MUST_HAVE_TEST_ATTRIB = "ER_MUST_HAVE_TEST_ATTRIB";
- public static final String ER_BAD_VAL_ON_LEVEL_ATTRIB =
- "ER_BAD_VAL_ON_LEVEL_ATTRIB";
- public static final String ER_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML =
- "ER_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML";
- public static final String ER_PROCESSINGINSTRUCTION_NOTVALID_NCNAME =
- "ER_PROCESSINGINSTRUCTION_NOTVALID_NCNAME";
- public static final String ER_NEED_MATCH_ATTRIB = "ER_NEED_MATCH_ATTRIB";
- public static final String ER_NEED_NAME_OR_MATCH_ATTRIB =
- "ER_NEED_NAME_OR_MATCH_ATTRIB";
- public static final String ER_CANT_RESOLVE_NSPREFIX =
- "ER_CANT_RESOLVE_NSPREFIX";
- public static final String ER_ILLEGAL_VALUE = "ER_ILLEGAL_VALUE";
- public static final String ER_NO_OWNERDOC = "ER_NO_OWNERDOC";
- public static final String ER_ELEMTEMPLATEELEM_ERR ="ER_ELEMTEMPLATEELEM_ERR";
- public static final String ER_NULL_CHILD = "ER_NULL_CHILD";
- public static final String ER_NEED_SELECT_ATTRIB = "ER_NEED_SELECT_ATTRIB";
- public static final String ER_NEED_TEST_ATTRIB = "ER_NEED_TEST_ATTRIB";
- public static final String ER_NEED_NAME_ATTRIB = "ER_NEED_NAME_ATTRIB";
- public static final String ER_NO_CONTEXT_OWNERDOC = "ER_NO_CONTEXT_OWNERDOC";
- public static final String ER_COULD_NOT_CREATE_XML_PROC_LIAISON =
- "ER_COULD_NOT_CREATE_XML_PROC_LIAISON";
- public static final String ER_PROCESS_NOT_SUCCESSFUL =
- "ER_PROCESS_NOT_SUCCESSFUL";
- public static final String ER_NOT_SUCCESSFUL = "ER_NOT_SUCCESSFUL";
- public static final String ER_ENCODING_NOT_SUPPORTED =
- "ER_ENCODING_NOT_SUPPORTED";
- public static final String ER_COULD_NOT_CREATE_TRACELISTENER =
- "ER_COULD_NOT_CREATE_TRACELISTENER";
- public static final String ER_KEY_REQUIRES_NAME_ATTRIB =
- "ER_KEY_REQUIRES_NAME_ATTRIB";
- public static final String ER_KEY_REQUIRES_MATCH_ATTRIB =
- "ER_KEY_REQUIRES_MATCH_ATTRIB";
- public static final String ER_KEY_REQUIRES_USE_ATTRIB =
- "ER_KEY_REQUIRES_USE_ATTRIB";
- public static final String ER_REQUIRES_ELEMENTS_ATTRIB =
- "ER_REQUIRES_ELEMENTS_ATTRIB";
- public static final String ER_MISSING_PREFIX_ATTRIB =
- "ER_MISSING_PREFIX_ATTRIB";
- public static final String ER_BAD_STYLESHEET_URL = "ER_BAD_STYLESHEET_URL";
- public static final String ER_FILE_NOT_FOUND = "ER_FILE_NOT_FOUND";
- public static final String ER_IOEXCEPTION = "ER_IOEXCEPTION";
- public static final String ER_NO_HREF_ATTRIB = "ER_NO_HREF_ATTRIB";
- public static final String ER_STYLESHEET_INCLUDES_ITSELF =
- "ER_STYLESHEET_INCLUDES_ITSELF";
- public static final String ER_PROCESSINCLUDE_ERROR ="ER_PROCESSINCLUDE_ERROR";
- public static final String ER_MISSING_LANG_ATTRIB = "ER_MISSING_LANG_ATTRIB";
- public static final String ER_MISSING_CONTAINER_ELEMENT_COMPONENT =
- "ER_MISSING_CONTAINER_ELEMENT_COMPONENT";
- public static final String ER_CAN_ONLY_OUTPUT_TO_ELEMENT =
- "ER_CAN_ONLY_OUTPUT_TO_ELEMENT";
- public static final String ER_PROCESS_ERROR = "ER_PROCESS_ERROR";
- public static final String ER_UNIMPLNODE_ERROR = "ER_UNIMPLNODE_ERROR";
- public static final String ER_NO_SELECT_EXPRESSION ="ER_NO_SELECT_EXPRESSION";
- public static final String ER_CANNOT_SERIALIZE_XSLPROCESSOR =
- "ER_CANNOT_SERIALIZE_XSLPROCESSOR";
- public static final String ER_NO_INPUT_STYLESHEET = "ER_NO_INPUT_STYLESHEET";
- public static final String ER_FAILED_PROCESS_STYLESHEET =
- "ER_FAILED_PROCESS_STYLESHEET";
- public static final String ER_COULDNT_PARSE_DOC = "ER_COULDNT_PARSE_DOC";
- public static final String ER_COULDNT_FIND_FRAGMENT =
- "ER_COULDNT_FIND_FRAGMENT";
- public static final String ER_NODE_NOT_ELEMENT = "ER_NODE_NOT_ELEMENT";
- public static final String ER_FOREACH_NEED_MATCH_OR_NAME_ATTRIB =
- "ER_FOREACH_NEED_MATCH_OR_NAME_ATTRIB";
- public static final String ER_TEMPLATES_NEED_MATCH_OR_NAME_ATTRIB =
- "ER_TEMPLATES_NEED_MATCH_OR_NAME_ATTRIB";
- public static final String ER_NO_CLONE_OF_DOCUMENT_FRAG =
- "ER_NO_CLONE_OF_DOCUMENT_FRAG";
- public static final String ER_CANT_CREATE_ITEM = "ER_CANT_CREATE_ITEM";
- public static final String ER_XMLSPACE_ILLEGAL_VALUE =
- "ER_XMLSPACE_ILLEGAL_VALUE";
- public static final String ER_NO_XSLKEY_DECLARATION =
- "ER_NO_XSLKEY_DECLARATION";
- public static final String ER_CANT_CREATE_URL = "ER_CANT_CREATE_URL";
- public static final String ER_XSLFUNCTIONS_UNSUPPORTED =
- "ER_XSLFUNCTIONS_UNSUPPORTED";
- public static final String ER_PROCESSOR_ERROR = "ER_PROCESSOR_ERROR";
- public static final String ER_NOT_ALLOWED_INSIDE_STYLESHEET =
- "ER_NOT_ALLOWED_INSIDE_STYLESHEET";
- public static final String ER_RESULTNS_NOT_SUPPORTED =
- "ER_RESULTNS_NOT_SUPPORTED";
- public static final String ER_DEFAULTSPACE_NOT_SUPPORTED =
- "ER_DEFAULTSPACE_NOT_SUPPORTED";
- public static final String ER_INDENTRESULT_NOT_SUPPORTED =
- "ER_INDENTRESULT_NOT_SUPPORTED";
- public static final String ER_ILLEGAL_ATTRIB = "ER_ILLEGAL_ATTRIB";
- public static final String ER_UNKNOWN_XSL_ELEM = "ER_UNKNOWN_XSL_ELEM";
- public static final String ER_BAD_XSLSORT_USE = "ER_BAD_XSLSORT_USE";
- public static final String ER_MISPLACED_XSLWHEN = "ER_MISPLACED_XSLWHEN";
- public static final String ER_XSLWHEN_NOT_PARENTED_BY_XSLCHOOSE =
- "ER_XSLWHEN_NOT_PARENTED_BY_XSLCHOOSE";
- public static final String ER_MISPLACED_XSLOTHERWISE =
- "ER_MISPLACED_XSLOTHERWISE";
- public static final String ER_XSLOTHERWISE_NOT_PARENTED_BY_XSLCHOOSE =
- "ER_XSLOTHERWISE_NOT_PARENTED_BY_XSLCHOOSE";
- public static final String ER_NOT_ALLOWED_INSIDE_TEMPLATE =
- "ER_NOT_ALLOWED_INSIDE_TEMPLATE";
- public static final String ER_UNKNOWN_EXT_NS_PREFIX =
- "ER_UNKNOWN_EXT_NS_PREFIX";
- public static final String ER_IMPORTS_AS_FIRST_ELEM =
- "ER_IMPORTS_AS_FIRST_ELEM";
- public static final String ER_IMPORTING_ITSELF = "ER_IMPORTING_ITSELF";
- public static final String ER_XMLSPACE_ILLEGAL_VAL ="ER_XMLSPACE_ILLEGAL_VAL";
- public static final String ER_PROCESSSTYLESHEET_NOT_SUCCESSFUL =
- "ER_PROCESSSTYLESHEET_NOT_SUCCESSFUL";
- public static final String ER_SAX_EXCEPTION = "ER_SAX_EXCEPTION";
- public static final String ER_XSLT_ERROR = "ER_XSLT_ERROR";
- public static final String ER_CURRENCY_SIGN_ILLEGAL=
- "ER_CURRENCY_SIGN_ILLEGAL";
- public static final String ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM =
- "ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM";
- public static final String ER_CANT_RESOLVE_PREFIX_OF_NON_PREFIX_RESOLVER =
- "ER_CANT_RESOLVE_PREFIX_OF_NON_PREFIX_RESOLVER";
- public static final String ER_REDIRECT_COULDNT_GET_FILENAME =
- "ER_REDIRECT_COULDNT_GET_FILENAME";
- public static final String ER_CANNOT_BUILD_FORMATTERLISTENER_IN_REDIRECT =
- "ER_CANNOT_BUILD_FORMATTERLISTENER_IN_REDIRECT";
- public static final String ER_INVALID_PREFIX_IN_EXCLUDERESULTPREFIX =
- "ER_INVALID_PREFIX_IN_EXCLUDERESULTPREFIX";
- public static final String ER_MISSING_NS_URI = "ER_MISSING_NS_URI";
- public static final String ER_MISSING_ARG_FOR_OPTION =
- "ER_MISSING_ARG_FOR_OPTION";
- public static final String ER_INVALID_OPTION = "ER_INVALID_OPTION";
- public static final String ER_MALFORMED_FORMAT_STRING =
- "ER_MALFORMED_FORMAT_STRING";
- public static final String ER_STYLESHEET_REQUIRES_VERSION_ATTRIB =
- "ER_STYLESHEET_REQUIRES_VERSION_ATTRIB";
- public static final String ER_ILLEGAL_ATTRIBUTE_VALUE =
- "ER_ILLEGAL_ATTRIBUTE_VALUE";
- public static final String ER_CHOOSE_REQUIRES_WHEN ="ER_CHOOSE_REQUIRES_WHEN";
- public static final String ER_NO_APPLY_IMPORT_IN_FOR_EACH =
- "ER_NO_APPLY_IMPORT_IN_FOR_EACH";
- public static final String ER_CANT_USE_DTM_FOR_OUTPUT =
- "ER_CANT_USE_DTM_FOR_OUTPUT";
- public static final String ER_CANT_USE_DTM_FOR_INPUT =
- "ER_CANT_USE_DTM_FOR_INPUT";
- public static final String ER_CALL_TO_EXT_FAILED = "ER_CALL_TO_EXT_FAILED";
- public static final String ER_PREFIX_MUST_RESOLVE = "ER_PREFIX_MUST_RESOLVE";
- public static final String ER_INVALID_UTF16_SURROGATE =
- "ER_INVALID_UTF16_SURROGATE";
- public static final String ER_XSLATTRSET_USED_ITSELF =
- "ER_XSLATTRSET_USED_ITSELF";
- public static final String ER_CANNOT_MIX_XERCESDOM ="ER_CANNOT_MIX_XERCESDOM";
- public static final String ER_TOO_MANY_LISTENERS = "ER_TOO_MANY_LISTENERS";
- public static final String ER_IN_ELEMTEMPLATEELEM_READOBJECT =
- "ER_IN_ELEMTEMPLATEELEM_READOBJECT";
- public static final String ER_DUPLICATE_NAMED_TEMPLATE =
- "ER_DUPLICATE_NAMED_TEMPLATE";
- public static final String ER_INVALID_KEY_CALL = "ER_INVALID_KEY_CALL";
- public static final String ER_REFERENCING_ITSELF = "ER_REFERENCING_ITSELF";
- public static final String ER_ILLEGAL_DOMSOURCE_INPUT =
- "ER_ILLEGAL_DOMSOURCE_INPUT";
- public static final String ER_CLASS_NOT_FOUND_FOR_OPTION =
- "ER_CLASS_NOT_FOUND_FOR_OPTION";
- public static final String ER_REQUIRED_ELEM_NOT_FOUND =
- "ER_REQUIRED_ELEM_NOT_FOUND";
- public static final String ER_INPUT_CANNOT_BE_NULL ="ER_INPUT_CANNOT_BE_NULL";
- public static final String ER_URI_CANNOT_BE_NULL = "ER_URI_CANNOT_BE_NULL";
- public static final String ER_FILE_CANNOT_BE_NULL = "ER_FILE_CANNOT_BE_NULL";
- public static final String ER_SOURCE_CANNOT_BE_NULL =
- "ER_SOURCE_CANNOT_BE_NULL";
- public static final String ER_CANNOT_INIT_BSFMGR = "ER_CANNOT_INIT_BSFMGR";
- public static final String ER_CANNOT_CMPL_EXTENSN = "ER_CANNOT_CMPL_EXTENSN";
- public static final String ER_CANNOT_CREATE_EXTENSN =
- "ER_CANNOT_CREATE_EXTENSN";
- public static final String ER_INSTANCE_MTHD_CALL_REQUIRES =
- "ER_INSTANCE_MTHD_CALL_REQUIRES";
- public static final String ER_INVALID_ELEMENT_NAME ="ER_INVALID_ELEMENT_NAME";
- public static final String ER_ELEMENT_NAME_METHOD_STATIC =
- "ER_ELEMENT_NAME_METHOD_STATIC";
- public static final String ER_EXTENSION_FUNC_UNKNOWN =
- "ER_EXTENSION_FUNC_UNKNOWN";
- public static final String ER_MORE_MATCH_CONSTRUCTOR =
- "ER_MORE_MATCH_CONSTRUCTOR";
- public static final String ER_MORE_MATCH_METHOD = "ER_MORE_MATCH_METHOD";
- public static final String ER_MORE_MATCH_ELEMENT = "ER_MORE_MATCH_ELEMENT";
- public static final String ER_INVALID_CONTEXT_PASSED =
- "ER_INVALID_CONTEXT_PASSED";
- public static final String ER_POOL_EXISTS = "ER_POOL_EXISTS";
- public static final String ER_NO_DRIVER_NAME = "ER_NO_DRIVER_NAME";
- public static final String ER_NO_URL = "ER_NO_URL";
- public static final String ER_POOL_SIZE_LESSTHAN_ONE =
- "ER_POOL_SIZE_LESSTHAN_ONE";
- public static final String ER_INVALID_DRIVER = "ER_INVALID_DRIVER";
- public static final String ER_NO_STYLESHEETROOT = "ER_NO_STYLESHEETROOT";
- public static final String ER_ILLEGAL_XMLSPACE_VALUE =
- "ER_ILLEGAL_XMLSPACE_VALUE";
- public static final String ER_PROCESSFROMNODE_FAILED =
- "ER_PROCESSFROMNODE_FAILED";
- public static final String ER_RESOURCE_COULD_NOT_LOAD =
- "ER_RESOURCE_COULD_NOT_LOAD";
- public static final String ER_BUFFER_SIZE_LESSTHAN_ZERO =
- "ER_BUFFER_SIZE_LESSTHAN_ZERO";
- public static final String ER_UNKNOWN_ERROR_CALLING_EXTENSION =
- "ER_UNKNOWN_ERROR_CALLING_EXTENSION";
- public static final String ER_NO_NAMESPACE_DECL = "ER_NO_NAMESPACE_DECL";
- public static final String ER_ELEM_CONTENT_NOT_ALLOWED =
- "ER_ELEM_CONTENT_NOT_ALLOWED";
- public static final String ER_STYLESHEET_DIRECTED_TERMINATION =
- "ER_STYLESHEET_DIRECTED_TERMINATION";
- public static final String ER_ONE_OR_TWO = "ER_ONE_OR_TWO";
- public static final String ER_TWO_OR_THREE = "ER_TWO_OR_THREE";
- public static final String ER_COULD_NOT_LOAD_RESOURCE =
- "ER_COULD_NOT_LOAD_RESOURCE";
- public static final String ER_CANNOT_INIT_DEFAULT_TEMPLATES =
- "ER_CANNOT_INIT_DEFAULT_TEMPLATES";
- public static final String ER_RESULT_NULL = "ER_RESULT_NULL";
- public static final String ER_RESULT_COULD_NOT_BE_SET =
- "ER_RESULT_COULD_NOT_BE_SET";
- public static final String ER_NO_OUTPUT_SPECIFIED = "ER_NO_OUTPUT_SPECIFIED";
- public static final String ER_CANNOT_TRANSFORM_TO_RESULT_TYPE =
- "ER_CANNOT_TRANSFORM_TO_RESULT_TYPE";
- public static final String ER_CANNOT_TRANSFORM_SOURCE_TYPE =
- "ER_CANNOT_TRANSFORM_SOURCE_TYPE";
- public static final String ER_NULL_CONTENT_HANDLER ="ER_NULL_CONTENT_HANDLER";
- public static final String ER_NULL_ERROR_HANDLER = "ER_NULL_ERROR_HANDLER";
- public static final String ER_CANNOT_CALL_PARSE = "ER_CANNOT_CALL_PARSE";
- public static final String ER_NO_PARENT_FOR_FILTER ="ER_NO_PARENT_FOR_FILTER";
- public static final String ER_NO_STYLESHEET_IN_MEDIA =
- "ER_NO_STYLESHEET_IN_MEDIA";
- public static final String ER_NO_STYLESHEET_PI = "ER_NO_STYLESHEET_PI";
- public static final String ER_NOT_SUPPORTED = "ER_NOT_SUPPORTED";
- public static final String ER_PROPERTY_VALUE_BOOLEAN =
- "ER_PROPERTY_VALUE_BOOLEAN";
- public static final String ER_COULD_NOT_FIND_EXTERN_SCRIPT =
- "ER_COULD_NOT_FIND_EXTERN_SCRIPT";
- public static final String ER_RESOURCE_COULD_NOT_FIND =
- "ER_RESOURCE_COULD_NOT_FIND";
- public static final String ER_OUTPUT_PROPERTY_NOT_RECOGNIZED =
- "ER_OUTPUT_PROPERTY_NOT_RECOGNIZED";
- public static final String ER_FAILED_CREATING_ELEMLITRSLT =
- "ER_FAILED_CREATING_ELEMLITRSLT";
- public static final String ER_VALUE_SHOULD_BE_NUMBER =
- "ER_VALUE_SHOULD_BE_NUMBER";
- public static final String ER_VALUE_SHOULD_EQUAL = "ER_VALUE_SHOULD_EQUAL";
- public static final String ER_FAILED_CALLING_METHOD =
- "ER_FAILED_CALLING_METHOD";
- public static final String ER_FAILED_CREATING_ELEMTMPL =
- "ER_FAILED_CREATING_ELEMTMPL";
- public static final String ER_CHARS_NOT_ALLOWED = "ER_CHARS_NOT_ALLOWED";
- public static final String ER_ATTR_NOT_ALLOWED = "ER_ATTR_NOT_ALLOWED";
- public static final String ER_BAD_VALUE = "ER_BAD_VALUE";
- public static final String ER_ATTRIB_VALUE_NOT_FOUND =
- "ER_ATTRIB_VALUE_NOT_FOUND";
- public static final String ER_ATTRIB_VALUE_NOT_RECOGNIZED =
- "ER_ATTRIB_VALUE_NOT_RECOGNIZED";
- public static final String ER_NULL_URI_NAMESPACE = "ER_NULL_URI_NAMESPACE";
- public static final String ER_NUMBER_TOO_BIG = "ER_NUMBER_TOO_BIG";
- public static final String ER_CANNOT_FIND_SAX1_DRIVER =
- "ER_CANNOT_FIND_SAX1_DRIVER";
- public static final String ER_SAX1_DRIVER_NOT_LOADED =
- "ER_SAX1_DRIVER_NOT_LOADED";
- public static final String ER_SAX1_DRIVER_NOT_INSTANTIATED =
- "ER_SAX1_DRIVER_NOT_INSTANTIATED" ;
- public static final String ER_SAX1_DRIVER_NOT_IMPLEMENT_PARSER =
- "ER_SAX1_DRIVER_NOT_IMPLEMENT_PARSER";
- public static final String ER_PARSER_PROPERTY_NOT_SPECIFIED =
- "ER_PARSER_PROPERTY_NOT_SPECIFIED";
- public static final String ER_PARSER_ARG_CANNOT_BE_NULL =
- "ER_PARSER_ARG_CANNOT_BE_NULL" ;
- public static final String ER_FEATURE = "ER_FEATURE";
- public static final String ER_PROPERTY = "ER_PROPERTY" ;
- public static final String ER_NULL_ENTITY_RESOLVER ="ER_NULL_ENTITY_RESOLVER";
- public static final String ER_NULL_DTD_HANDLER = "ER_NULL_DTD_HANDLER" ;
- public static final String ER_NO_DRIVER_NAME_SPECIFIED =
- "ER_NO_DRIVER_NAME_SPECIFIED";
- public static final String ER_NO_URL_SPECIFIED = "ER_NO_URL_SPECIFIED";
- public static final String ER_POOLSIZE_LESS_THAN_ONE =
- "ER_POOLSIZE_LESS_THAN_ONE";
- public static final String ER_INVALID_DRIVER_NAME = "ER_INVALID_DRIVER_NAME";
- public static final String ER_ERRORLISTENER = "ER_ERRORLISTENER";
- public static final String ER_ASSERT_NO_TEMPLATE_PARENT =
- "ER_ASSERT_NO_TEMPLATE_PARENT";
- public static final String ER_ASSERT_REDUNDENT_EXPR_ELIMINATOR =
- "ER_ASSERT_REDUNDENT_EXPR_ELIMINATOR";
- public static final String ER_NOT_ALLOWED_IN_POSITION =
- "ER_NOT_ALLOWED_IN_POSITION";
- public static final String ER_NONWHITESPACE_NOT_ALLOWED_IN_POSITION =
- "ER_NONWHITESPACE_NOT_ALLOWED_IN_POSITION";
- public static final String ER_NAMESPACE_CONTEXT_NULL_NAMESPACE =
- "ER_NAMESPACE_CONTEXT_NULL_NAMESPACE";
- public static final String ER_NAMESPACE_CONTEXT_NULL_PREFIX =
- "ER_NAMESPACE_CONTEXT_NULL_PREFIX";
- public static final String ER_XPATH_RESOLVER_NULL_QNAME =
- "ER_XPATH_RESOLVER_NULL_QNAME";
- public static final String ER_XPATH_RESOLVER_NEGATIVE_ARITY =
- "ER_XPATH_RESOLVER_NEGATIVE_ARITY";
- public static final String INVALID_TCHAR = "INVALID_TCHAR";
- public static final String INVALID_QNAME = "INVALID_QNAME";
- public static final String INVALID_ENUM = "INVALID_ENUM";
- public static final String INVALID_NMTOKEN = "INVALID_NMTOKEN";
- public static final String INVALID_NCNAME = "INVALID_NCNAME";
- public static final String INVALID_BOOLEAN = "INVALID_BOOLEAN";
- public static final String INVALID_NUMBER = "INVALID_NUMBER";
- public static final String ER_ARG_LITERAL = "ER_ARG_LITERAL";
- public static final String ER_DUPLICATE_GLOBAL_VAR ="ER_DUPLICATE_GLOBAL_VAR";
- public static final String ER_DUPLICATE_VAR = "ER_DUPLICATE_VAR";
- public static final String ER_TEMPLATE_NAME_MATCH = "ER_TEMPLATE_NAME_MATCH";
- public static final String ER_INVALID_PREFIX = "ER_INVALID_PREFIX";
- public static final String ER_NO_ATTRIB_SET = "ER_NO_ATTRIB_SET";
- public static final String ER_FUNCTION_NOT_FOUND =
- "ER_FUNCTION_NOT_FOUND";
- public static final String ER_CANT_HAVE_CONTENT_AND_SELECT =
- "ER_CANT_HAVE_CONTENT_AND_SELECT";
- public static final String ER_INVALID_SET_PARAM_VALUE = "ER_INVALID_SET_PARAM_VALUE";
- public static final String ER_SET_FEATURE_NULL_NAME =
- "ER_SET_FEATURE_NULL_NAME";
- public static final String ER_GET_FEATURE_NULL_NAME =
- "ER_GET_FEATURE_NULL_NAME";
- public static final String ER_UNSUPPORTED_FEATURE =
- "ER_UNSUPPORTED_FEATURE";
- public static final String ER_EXTENSION_ELEMENT_NOT_ALLOWED_IN_SECURE_PROCESSING =
- "ER_EXTENSION_ELEMENT_NOT_ALLOWED_IN_SECURE_PROCESSING";
-
- public static final String WG_FOUND_CURLYBRACE = "WG_FOUND_CURLYBRACE";
- public static final String WG_COUNT_ATTRIB_MATCHES_NO_ANCESTOR =
- "WG_COUNT_ATTRIB_MATCHES_NO_ANCESTOR";
- public static final String WG_EXPR_ATTRIB_CHANGED_TO_SELECT =
- "WG_EXPR_ATTRIB_CHANGED_TO_SELECT";
- public static final String WG_NO_LOCALE_IN_FORMATNUMBER =
- "WG_NO_LOCALE_IN_FORMATNUMBER";
- public static final String WG_LOCALE_NOT_FOUND = "WG_LOCALE_NOT_FOUND";
- public static final String WG_CANNOT_MAKE_URL_FROM ="WG_CANNOT_MAKE_URL_FROM";
- public static final String WG_CANNOT_LOAD_REQUESTED_DOC =
- "WG_CANNOT_LOAD_REQUESTED_DOC";
- public static final String WG_CANNOT_FIND_COLLATOR ="WG_CANNOT_FIND_COLLATOR";
- public static final String WG_FUNCTIONS_SHOULD_USE_URL =
- "WG_FUNCTIONS_SHOULD_USE_URL";
- public static final String WG_ENCODING_NOT_SUPPORTED_USING_UTF8 =
- "WG_ENCODING_NOT_SUPPORTED_USING_UTF8";
- public static final String WG_ENCODING_NOT_SUPPORTED_USING_JAVA =
- "WG_ENCODING_NOT_SUPPORTED_USING_JAVA";
- public static final String WG_SPECIFICITY_CONFLICTS =
- "WG_SPECIFICITY_CONFLICTS";
- public static final String WG_PARSING_AND_PREPARING =
- "WG_PARSING_AND_PREPARING";
- public static final String WG_ATTR_TEMPLATE = "WG_ATTR_TEMPLATE";
- public static final String WG_CONFLICT_BETWEEN_XSLSTRIPSPACE_AND_XSLPRESERVESPACE = "WG_CONFLICT_BETWEEN_XSLSTRIPSPACE_AND_XSLPRESERVESP";
- public static final String WG_ATTRIB_NOT_HANDLED = "WG_ATTRIB_NOT_HANDLED";
- public static final String WG_NO_DECIMALFORMAT_DECLARATION =
- "WG_NO_DECIMALFORMAT_DECLARATION";
- public static final String WG_OLD_XSLT_NS = "WG_OLD_XSLT_NS";
- public static final String WG_ONE_DEFAULT_XSLDECIMALFORMAT_ALLOWED =
- "WG_ONE_DEFAULT_XSLDECIMALFORMAT_ALLOWED";
- public static final String WG_XSLDECIMALFORMAT_NAMES_MUST_BE_UNIQUE =
- "WG_XSLDECIMALFORMAT_NAMES_MUST_BE_UNIQUE";
- public static final String WG_ILLEGAL_ATTRIBUTE = "WG_ILLEGAL_ATTRIBUTE";
- public static final String WG_COULD_NOT_RESOLVE_PREFIX =
- "WG_COULD_NOT_RESOLVE_PREFIX";
- public static final String WG_STYLESHEET_REQUIRES_VERSION_ATTRIB =
- "WG_STYLESHEET_REQUIRES_VERSION_ATTRIB";
- public static final String WG_ILLEGAL_ATTRIBUTE_NAME =
- "WG_ILLEGAL_ATTRIBUTE_NAME";
- public static final String WG_ILLEGAL_ATTRIBUTE_VALUE =
- "WG_ILLEGAL_ATTRIBUTE_VALUE";
- public static final String WG_EMPTY_SECOND_ARG = "WG_EMPTY_SECOND_ARG";
- public static final String WG_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML =
- "WG_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML";
- public static final String WG_PROCESSINGINSTRUCTION_NOTVALID_NCNAME =
- "WG_PROCESSINGINSTRUCTION_NOTVALID_NCNAME";
- public static final String WG_ILLEGAL_ATTRIBUTE_POSITION =
- "WG_ILLEGAL_ATTRIBUTE_POSITION";
- public static final String NO_MODIFICATION_ALLOWED_ERR =
- "NO_MODIFICATION_ALLOWED_ERR";
-
- /*
- * Now fill in the message text.
- * Then fill in the message text for that message code in the
- * array. Use the new error code as the index into the array.
- */
-
- // Error messages...
-
- /** Get the lookup table for error messages.
- *
- * @return The message lookup table.
- */
- public Object[][] getContents()
- {
- return new Object[][] {
-
- /** Error message ID that has a null message, but takes in a single object. */
- {"ER0000" , "{0}" },
-
- { ER_NO_CURLYBRACE,
- "\uC624\uB958: \uD45C\uD604\uC2DD\uC5D0\uB294 '{'\uAC00 \uD3EC\uD568\uB420 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_ILLEGAL_ATTRIBUTE ,
- "{0}\uC5D0 \uC798\uBABB\uB41C \uC18D\uC131\uC774 \uC788\uC74C: {1}"},
-
- {ER_NULL_SOURCENODE_APPLYIMPORTS ,
- "xsl:apply-imports\uC758 sourceNode\uAC00 \uB110\uC785\uB2C8\uB2E4!"},
-
- {ER_CANNOT_ADD,
- "{1}\uC5D0 {0}\uC744(\uB97C) \uCD94\uAC00\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_NULL_SOURCENODE_HANDLEAPPLYTEMPLATES,
- "handleApplyTemplatesInstruction\uC758 sourceNode\uAC00 \uB110\uC785\uB2C8\uB2E4!"},
-
- { ER_NO_NAME_ATTRIB,
- "{0}\uC5D0\uB294 name \uC18D\uC131\uC774 \uC788\uC5B4\uC57C \uD569\uB2C8\uB2E4."},
-
- {ER_TEMPLATE_NOT_FOUND,
- "\uBA85\uBA85\uB41C \uD15C\uD50C\uB9AC\uD2B8\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC74C: {0}"},
-
- {ER_CANT_RESOLVE_NAME_AVT,
- "xsl:call-template\uC5D0\uC11C \uC774\uB984 AVT\uB97C \uBD84\uC11D\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- {ER_REQUIRES_ATTRIB,
- "{0}\uC5D0 \uC18D\uC131\uC774 \uD544\uC694\uD568: {1}"},
-
- { ER_MUST_HAVE_TEST_ATTRIB,
- "{0}\uC5D0\uB294 ''test'' \uC18D\uC131\uC774 \uC788\uC5B4\uC57C \uD569\uB2C8\uB2E4."},
-
- {ER_BAD_VAL_ON_LEVEL_ATTRIB,
- "level \uC18D\uC131\uC5D0 \uC798\uBABB\uB41C \uAC12\uC774 \uC788\uC74C: {0}"},
-
- {ER_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML,
- "processing-instruction \uC774\uB984\uC740 'xml'\uC77C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_PROCESSINGINSTRUCTION_NOTVALID_NCNAME,
- "processing-instruction \uC774\uB984\uC740 \uC801\uD569\uD55C NCName\uC774\uC5B4\uC57C \uD568: {0}"},
-
- { ER_NEED_MATCH_ATTRIB,
- "{0}\uC5D0 \uBAA8\uB4DC\uAC00 \uC788\uC744 \uACBD\uC6B0 match \uC18D\uC131\uC774 \uC788\uC5B4\uC57C \uD569\uB2C8\uB2E4."},
-
- { ER_NEED_NAME_OR_MATCH_ATTRIB,
- "{0}\uC5D0\uB294 name \uB610\uB294 match \uC18D\uC131\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."},
-
- {ER_CANT_RESOLVE_NSPREFIX,
- "\uB124\uC784\uC2A4\uD398\uC774\uC2A4 \uC811\uB450\uC5B4\uB97C \uBD84\uC11D\uD560 \uC218 \uC5C6\uC74C: {0}"},
-
- { ER_ILLEGAL_VALUE,
- "xml:space\uC5D0 \uC798\uBABB\uB41C \uAC12\uC774 \uC788\uC74C: {0}"},
-
- { ER_NO_OWNERDOC,
- "\uD558\uC704 \uB178\uB4DC\uC5D0 \uC18C\uC720\uC790 \uBB38\uC11C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4!"},
-
- { ER_ELEMTEMPLATEELEM_ERR,
- "ElemTemplateElement \uC624\uB958: {0}"},
-
- { ER_NULL_CHILD,
- "\uB110 \uD558\uC704\uB97C \uCD94\uAC00\uD558\uB824\uACE0 \uC2DC\uB3C4\uD558\uB294 \uC911\uC785\uB2C8\uB2E4!"},
-
- { ER_NEED_SELECT_ATTRIB,
- "{0}\uC5D0\uB294 select \uC18D\uC131\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."},
-
- { ER_NEED_TEST_ATTRIB ,
- "xsl:when\uC5D0\uB294 'test' \uC18D\uC131\uC774 \uC788\uC5B4\uC57C \uD569\uB2C8\uB2E4."},
-
- { ER_NEED_NAME_ATTRIB,
- "xsl:with-param\uC5D0\uB294 'name' \uC18D\uC131\uC774 \uC788\uC5B4\uC57C \uD569\uB2C8\uB2E4."},
-
- { ER_NO_CONTEXT_OWNERDOC,
- "\uCEE8\uD14D\uC2A4\uD2B8\uC5D0 \uC18C\uC720\uC790 \uBB38\uC11C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4!"},
-
- {ER_COULD_NOT_CREATE_XML_PROC_LIAISON,
- "XML TransformerFactory \uC5F0\uACB0\uC744 \uC0DD\uC131\uD560 \uC218 \uC5C6\uC74C: {0}"},
-
- {ER_PROCESS_NOT_SUCCESSFUL,
- "Xalan: \uD504\uB85C\uC138\uC2A4\uB97C \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4."},
-
- { ER_NOT_SUCCESSFUL,
- "Xalan: \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4."},
-
- { ER_ENCODING_NOT_SUPPORTED,
- "\uC778\uCF54\uB529\uC774 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC74C: {0}"},
-
- {ER_COULD_NOT_CREATE_TRACELISTENER,
- "TraceListener\uB97C \uC0DD\uC131\uD560 \uC218 \uC5C6\uC74C: {0}"},
-
- {ER_KEY_REQUIRES_NAME_ATTRIB,
- "xsl:key\uC5D0\uB294 'name' \uC18D\uC131\uC774 \uD544\uC694\uD569\uB2C8\uB2E4!"},
-
- { ER_KEY_REQUIRES_MATCH_ATTRIB,
- "xsl:key\uC5D0\uB294 'match' \uC18D\uC131\uC774 \uD544\uC694\uD569\uB2C8\uB2E4!"},
-
- { ER_KEY_REQUIRES_USE_ATTRIB,
- "xsl:key\uC5D0\uB294 'use' \uC18D\uC131\uC774 \uD544\uC694\uD569\uB2C8\uB2E4!"},
-
- { ER_REQUIRES_ELEMENTS_ATTRIB,
- "(StylesheetHandler) {0}\uC5D0\uB294 ''elements'' \uC18D\uC131\uC774 \uD544\uC694\uD569\uB2C8\uB2E4!"},
-
- { ER_MISSING_PREFIX_ATTRIB,
- "(StylesheetHandler) {0} \uC18D\uC131 ''prefix''\uAC00 \uB204\uB77D\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
-
- { ER_BAD_STYLESHEET_URL,
- "\uC2A4\uD0C0\uC77C\uC2DC\uD2B8 URL\uC774 \uC798\uBABB\uB428: {0}"},
-
- { ER_FILE_NOT_FOUND,
- "\uC2A4\uD0C0\uC77C\uC2DC\uD2B8 \uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC74C: {0}"},
-
- { ER_IOEXCEPTION,
- "\uC2A4\uD0C0\uC77C\uC2DC\uD2B8 \uD30C\uC77C\uC5D0 IO \uC608\uC678\uC0AC\uD56D \uBC1C\uC0DD: {0}"},
-
- { ER_NO_HREF_ATTRIB,
- "(StylesheetHandler) {0}\uC5D0 \uB300\uD55C href \uC18D\uC131\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_STYLESHEET_INCLUDES_ITSELF,
- "(StylesheetHandler) {0}\uC5D0 \uC9C1\uC811 \uB610\uB294 \uAC04\uC811\uC801\uC73C\uB85C \uC790\uC2E0\uC774 \uD3EC\uD568\uB418\uC5B4 \uC788\uC2B5\uB2C8\uB2E4!"},
-
- { ER_PROCESSINCLUDE_ERROR,
- "StylesheetHandler.processInclude \uC624\uB958, {0}"},
-
- { ER_MISSING_LANG_ATTRIB,
- "(StylesheetHandler) {0} \uC18D\uC131 ''lang''\uAC00 \uB204\uB77D\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
-
- { ER_MISSING_CONTAINER_ELEMENT_COMPONENT,
- "(StylesheetHandler) {0} \uC694\uC18C\uC758 \uC704\uCE58\uAC00 \uC798\uBABB\uB41C \uAC83 \uAC19\uC2B5\uB2C8\uB2E4. \uCEE8\uD14C\uC774\uB108 \uC694\uC18C ''component''\uAC00 \uB204\uB77D\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
-
- { ER_CAN_ONLY_OUTPUT_TO_ELEMENT,
- "Element, DocumentFragment, Document \uB610\uB294 PrintWriter\uC5D0\uB9CC \uCD9C\uB825\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4."},
-
- { ER_PROCESS_ERROR,
- "StylesheetRoot.process \uC624\uB958"},
-
- { ER_UNIMPLNODE_ERROR,
- "UnImplNode \uC624\uB958: {0}"},
-
- { ER_NO_SELECT_EXPRESSION,
- "\uC624\uB958: xpath select \uD45C\uD604\uC2DD(-select)\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_CANNOT_SERIALIZE_XSLPROCESSOR,
- "XSLProcessor\uB97C \uC9C1\uB82C\uD654\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4!"},
-
- { ER_NO_INPUT_STYLESHEET,
- "\uC2A4\uD0C0\uC77C\uC2DC\uD2B8 \uC785\uB825\uAC12\uC774 \uC9C0\uC815\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4!"},
-
- { ER_FAILED_PROCESS_STYLESHEET,
- "\uC2A4\uD0C0\uC77C\uC2DC\uD2B8 \uCC98\uB9AC\uB97C \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4!"},
-
- { ER_COULDNT_PARSE_DOC,
- "{0} \uBB38\uC11C\uC758 \uAD6C\uBB38\uC744 \uBD84\uC11D\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4!"},
-
- { ER_COULDNT_FIND_FRAGMENT,
- "\uBD80\uBD84\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC74C: {0}"},
-
- { ER_NODE_NOT_ELEMENT,
- "\uBD80\uBD84 \uC2DD\uBCC4\uC790\uAC00 \uAC00\uB9AC\uD0A8 \uB178\uB4DC\uB294 \uC694\uC18C\uAC00 \uC544\uB2D8: {0}"},
-
- { ER_FOREACH_NEED_MATCH_OR_NAME_ATTRIB,
- "for-each\uC5D0\uB294 match \uB610\uB294 name \uC18D\uC131\uC774 \uC788\uC5B4\uC57C \uD569\uB2C8\uB2E4."},
-
- { ER_TEMPLATES_NEED_MATCH_OR_NAME_ATTRIB,
- "templates\uC5D0\uB294 match \uB610\uB294 name \uC18D\uC131\uC774 \uC788\uC5B4\uC57C \uD569\uB2C8\uB2E4."},
-
- { ER_NO_CLONE_OF_DOCUMENT_FRAG,
- "\uBB38\uC11C \uBD80\uBD84\uC758 \uBCF5\uC81C\uBCF8\uC774 \uC5C6\uC2B5\uB2C8\uB2E4!"},
-
- { ER_CANT_CREATE_ITEM,
- "\uACB0\uACFC \uD2B8\uB9AC\uC5D0 \uD56D\uBAA9\uC744 \uC0DD\uC131\uD560 \uC218 \uC5C6\uC74C: {0}"},
-
- { ER_XMLSPACE_ILLEGAL_VALUE,
- "\uC18C\uC2A4 XML\uC758 xml:space\uC5D0 \uC798\uBABB\uB41C \uAC12\uC774 \uC788\uC74C: {0}"},
-
- { ER_NO_XSLKEY_DECLARATION,
- "{0}\uC5D0 \uB300\uD55C xsl:key \uC120\uC5B8\uC774 \uC5C6\uC2B5\uB2C8\uB2E4!"},
-
- { ER_CANT_CREATE_URL,
- "\uC624\uB958: {0}\uC5D0 \uB300\uD55C URL\uC744 \uC0DD\uC131\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_XSLFUNCTIONS_UNSUPPORTED,
- "xsl:functions\uB294 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
-
- { ER_PROCESSOR_ERROR,
- "XSLT TransformerFactory \uC624\uB958"},
-
- { ER_NOT_ALLOWED_INSIDE_STYLESHEET,
- "(StylesheetHandler) \uC2A4\uD0C0\uC77C\uC2DC\uD2B8\uC5D0\uC11C\uB294 {0}\uC774(\uAC00) \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4!"},
-
- { ER_RESULTNS_NOT_SUPPORTED,
- "result-ns\uB294 \uB354 \uC774\uC0C1 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4! \uB300\uC2E0 xsl:output\uC744 \uC0AC\uC6A9\uD558\uC2ED\uC2DC\uC624."},
-
- { ER_DEFAULTSPACE_NOT_SUPPORTED,
- "default-space\uB294 \uB354 \uC774\uC0C1 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4! \uB300\uC2E0 xsl:strip-space \uB610\uB294 xsl:preserve-space\uB97C \uC0AC\uC6A9\uD558\uC2ED\uC2DC\uC624."},
-
- { ER_INDENTRESULT_NOT_SUPPORTED,
- "indent-result\uB294 \uB354 \uC774\uC0C1 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4! \uB300\uC2E0 xsl:output\uC744 \uC0AC\uC6A9\uD558\uC2ED\uC2DC\uC624."},
-
- { ER_ILLEGAL_ATTRIB,
- "(StylesheetHandler) {0}\uC5D0 \uC798\uBABB\uB41C \uC18D\uC131\uC774 \uC788\uC74C: {1}"},
-
- { ER_UNKNOWN_XSL_ELEM,
- "\uC54C \uC218 \uC5C6\uB294 XSL \uC694\uC18C: {0}"},
-
- { ER_BAD_XSLSORT_USE,
- "(StylesheetHandler) xsl:sort\uB294 xsl:apply-templates \uB610\uB294 xsl:for-each\uC640 \uD568\uAED8\uB9CC \uC0AC\uC6A9\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4."},
-
- { ER_MISPLACED_XSLWHEN,
- "(StylesheetHandler) xsl:when\uC758 \uC704\uCE58\uAC00 \uC798\uBABB\uB418\uC5C8\uC2B5\uB2C8\uB2E4!"},
-
- { ER_XSLWHEN_NOT_PARENTED_BY_XSLCHOOSE,
- "(StylesheetHandler) xsl:when\uC774 xsl:choose\uC5D0 \uC758\uD574 \uC0C1\uC704\uB85C \uC9C0\uC815\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4!"},
-
- { ER_MISPLACED_XSLOTHERWISE,
- "(StylesheetHandler) xsl:otherwise\uC758 \uC704\uCE58\uAC00 \uC798\uBABB\uB418\uC5C8\uC2B5\uB2C8\uB2E4!"},
-
- { ER_XSLOTHERWISE_NOT_PARENTED_BY_XSLCHOOSE,
- "(StylesheetHandler) xsl:otherwise\uAC00 xsl:choose\uC5D0 \uC758\uD574 \uC0C1\uC704\uB85C \uC9C0\uC815\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4!"},
-
- { ER_NOT_ALLOWED_INSIDE_TEMPLATE,
- "(StylesheetHandler) \uD15C\uD50C\uB9AC\uD2B8\uC5D0\uC11C\uB294 {0}\uC774(\uAC00) \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4!"},
-
- { ER_UNKNOWN_EXT_NS_PREFIX,
- "(StylesheetHandler) {0} \uD655\uC7A5 \uB124\uC784\uC2A4\uD398\uC774\uC2A4 \uC811\uB450\uC5B4 {1}\uC744(\uB97C) \uC54C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_IMPORTS_AS_FIRST_ELEM,
- "(StylesheetHandler) \uC2A4\uD0C0\uC77C\uC2DC\uD2B8\uC758 \uCCAB\uBC88\uC9F8 \uC694\uC18C\uB85C\uB9CC \uC784\uD3EC\uD2B8\uB97C \uC218\uD589\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4!"},
-
- { ER_IMPORTING_ITSELF,
- "(StylesheetHandler) {0}\uC774(\uAC00) \uC9C1\uC811 \uB610\uB294 \uAC04\uC811\uC801\uC73C\uB85C \uC790\uC2E0\uC744 \uC784\uD3EC\uD2B8\uD558\uACE0 \uC788\uC2B5\uB2C8\uB2E4!"},
-
- { ER_XMLSPACE_ILLEGAL_VAL,
- "(StylesheetHandler) xml:space\uC5D0 \uC798\uBABB\uB41C \uAC12\uC774 \uC788\uC74C: {0}"},
-
- { ER_PROCESSSTYLESHEET_NOT_SUCCESSFUL,
- "processStylesheet\uB97C \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4!"},
-
- { ER_SAX_EXCEPTION,
- "SAX \uC608\uC678\uC0AC\uD56D"},
-
-// add this message to fix bug 21478
- { ER_FUNCTION_NOT_SUPPORTED,
- "\uD568\uC218\uAC00 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4!"},
-
- { ER_XSLT_ERROR,
- "XSLT \uC624\uB958"},
-
- { ER_CURRENCY_SIGN_ILLEGAL,
- "\uD615\uC2DD \uD328\uD134 \uBB38\uC790\uC5F4\uC5D0\uC11C\uB294 \uD1B5\uD654 \uAE30\uD638\uAC00 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
-
- { ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM,
- "Document \uD568\uC218\uB294 \uC2A4\uD0C0\uC77C\uC2DC\uD2B8 DOM\uC5D0\uC11C \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4!"},
-
- { ER_CANT_RESOLVE_PREFIX_OF_NON_PREFIX_RESOLVER,
- "\uBE44\uC811\uB450\uC5B4 \uBD84\uC11D\uAE30\uC758 \uC811\uB450\uC5B4\uB97C \uBD84\uC11D\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4!"},
-
- { ER_REDIRECT_COULDNT_GET_FILENAME,
- "\uC7AC\uC9C0\uC815 \uD655\uC7A5: \uD30C\uC77C \uC774\uB984\uC744 \uAC00\uC838\uC62C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. file \uB610\uB294 select \uC18D\uC131\uC740 \uC801\uD569\uD55C \uBB38\uC790\uC5F4\uC744 \uBC18\uD658\uD574\uC57C \uD569\uB2C8\uB2E4."},
-
- { ER_CANNOT_BUILD_FORMATTERLISTENER_IN_REDIRECT,
- "\uC7AC\uC9C0\uC815 \uD655\uC7A5\uC5D0 FormatterListener\uB97C \uC0DD\uC131\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4!"},
-
- { ER_INVALID_PREFIX_IN_EXCLUDERESULTPREFIX,
- "exclude-result-prefixes\uC758 \uC811\uB450\uC5B4\uAC00 \uBD80\uC801\uD569\uD568: {0}"},
-
- { ER_MISSING_NS_URI,
- "\uC9C0\uC815\uB41C \uC811\uB450\uC5B4\uC5D0 \uB300\uD55C \uB124\uC784\uC2A4\uD398\uC774\uC2A4 URI\uAC00 \uB204\uB77D\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
-
- { ER_MISSING_ARG_FOR_OPTION,
- "\uC635\uC158\uC5D0 \uB300\uD55C \uC778\uC218\uAC00 \uB204\uB77D\uB428: {0}"},
-
- { ER_INVALID_OPTION,
- "\uBD80\uC801\uD569\uD55C \uC635\uC158: {0}"},
-
- { ER_MALFORMED_FORMAT_STRING,
- "\uC798\uBABB\uB41C \uD615\uC2DD \uBB38\uC790\uC5F4: {0}"},
-
- { ER_STYLESHEET_REQUIRES_VERSION_ATTRIB,
- "xsl:stylesheet\uC5D0\uB294 'version' \uC18D\uC131\uC774 \uD544\uC694\uD569\uB2C8\uB2E4!"},
-
- { ER_ILLEGAL_ATTRIBUTE_VALUE,
- "{0} \uC18D\uC131\uC5D0 \uC798\uBABB\uB41C \uAC12\uC774 \uC788\uC74C: {1}"},
-
- { ER_CHOOSE_REQUIRES_WHEN,
- "xsl:choose\uC5D0\uB294 xsl:when\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."},
-
- { ER_NO_APPLY_IMPORT_IN_FOR_EACH,
- "xsl:for-each\uC5D0\uC11C\uB294 xsl:apply-imports\uAC00 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
-
- { ER_CANT_USE_DTM_FOR_OUTPUT,
- "\uCD9C\uB825 DOM \uB178\uB4DC\uC5D0 DTMLiaison\uC744 \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uB300\uC2E0 com.sun.org.apache.xpath.internal.DOM2Helper\uB97C \uC804\uB2EC\uD558\uC2ED\uC2DC\uC624!"},
-
- { ER_CANT_USE_DTM_FOR_INPUT,
- "\uC785\uB825 DOM \uB178\uB4DC\uC5D0 DTMLiaison\uC744 \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uB300\uC2E0 com.sun.org.apache.xpath.internal.DOM2Helper\uB97C \uC804\uB2EC\uD558\uC2ED\uC2DC\uC624!"},
-
- { ER_CALL_TO_EXT_FAILED,
- "\uD655\uC7A5 \uC694\uC18C\uC5D0 \uB300\uD55C \uD638\uCD9C \uC2E4\uD328: {0}"},
-
- { ER_PREFIX_MUST_RESOLVE,
- "\uC811\uB450\uC5B4\uB294 \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uB85C \uBD84\uC11D\uB418\uC5B4\uC57C \uD568: {0}"},
-
- { ER_INVALID_UTF16_SURROGATE,
- "\uBD80\uC801\uD569\uD55C UTF-16 \uB300\uB9AC \uC694\uC18C\uAC00 \uAC10\uC9C0\uB428: {0}"},
-
- { ER_XSLATTRSET_USED_ITSELF,
- "xsl:attribute-set {0}\uC774(\uAC00) \uC790\uC2E0\uC744 \uC0AC\uC6A9\uD588\uC2B5\uB2C8\uB2E4. \uC774 \uACBD\uC6B0 \uBB34\uD55C \uB8E8\uD504\uAC00 \uBC1C\uC0DD\uD569\uB2C8\uB2E4."},
-
- { ER_CANNOT_MIX_XERCESDOM,
- "\uBE44Xerces-DOM \uC785\uB825\uACFC Xerces-DOM \uCD9C\uB825\uC744 \uD568\uAED8 \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4!"},
-
- { ER_TOO_MANY_LISTENERS,
- "addTraceListenersToStylesheet - TooManyListenersException"},
-
- { ER_IN_ELEMTEMPLATEELEM_READOBJECT,
- "ElemTemplateElement.readObject\uC5D0 \uC624\uB958 \uBC1C\uC0DD: {0}"},
-
- { ER_DUPLICATE_NAMED_TEMPLATE,
- "\uBA85\uBA85\uB41C \uD15C\uD50C\uB9AC\uD2B8\uB97C \uB450 \uAC1C \uC774\uC0C1 \uCC3E\uC74C: {0}"},
-
- { ER_INVALID_KEY_CALL,
- "\uBD80\uC801\uD569\uD55C \uD568\uC218 \uD638\uCD9C: recursive key() \uD638\uCD9C\uC740 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
-
- { ER_REFERENCING_ITSELF,
- "{0} \uBCC0\uC218\uAC00 \uC9C1\uC811 \uB610\uB294 \uAC04\uC811\uC801\uC73C\uB85C \uC790\uC2E0\uC744 \uCC38\uC870\uD558\uACE0 \uC788\uC2B5\uB2C8\uB2E4!"},
-
- { ER_ILLEGAL_DOMSOURCE_INPUT,
- "newTemplates\uC758 DOMSource\uC5D0 \uB300\uD55C \uC785\uB825 \uB178\uB4DC\uB294 \uB110\uC77C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4!"},
-
- { ER_CLASS_NOT_FOUND_FOR_OPTION,
- "{0} \uC635\uC158\uC5D0 \uB300\uD55C \uD074\uB798\uC2A4 \uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_REQUIRED_ELEM_NOT_FOUND,
- "\uD544\uC218 \uC694\uC18C\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC74C: {0}"},
-
- { ER_INPUT_CANNOT_BE_NULL,
- "InputStream\uC740 \uB110\uC77C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_URI_CANNOT_BE_NULL,
- "URI\uB294 \uB110\uC77C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_FILE_CANNOT_BE_NULL,
- "\uD30C\uC77C\uC740 \uB110\uC77C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_SOURCE_CANNOT_BE_NULL,
- "InputSource\uB294 \uB110\uC77C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_CANNOT_INIT_BSFMGR,
- "BSF \uAD00\uB9AC\uC790\uB97C \uCD08\uAE30\uD654\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_CANNOT_CMPL_EXTENSN,
- "\uD655\uC7A5\uC744 \uCEF4\uD30C\uC77C\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_CANNOT_CREATE_EXTENSN,
- "{0} \uD655\uC7A5\uC744 \uC0DD\uC131\uD560 \uC218 \uC5C6\uB294 \uC6D0\uC778: {1}"},
-
- { ER_INSTANCE_MTHD_CALL_REQUIRES,
- "{0} \uBA54\uC18C\uB4DC\uC5D0 \uB300\uD55C \uC778\uC2A4\uD134\uC2A4 \uBA54\uC18C\uB4DC\uC5D0\uB294 \uAC1D\uCCB4 \uC778\uC2A4\uD134\uC2A4\uAC00 \uCCAB\uBC88\uC9F8 \uC778\uC218\uB85C \uD544\uC694\uD569\uB2C8\uB2E4."},
-
- { ER_INVALID_ELEMENT_NAME,
- "\uBD80\uC801\uD569\uD55C \uC694\uC18C \uC774\uB984\uC774 \uC9C0\uC815\uB428: {0}"},
-
- { ER_ELEMENT_NAME_METHOD_STATIC,
- "\uC694\uC18C \uC774\uB984 \uBA54\uC18C\uB4DC\uB294 \uC815\uC801 {0}\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4."},
-
- { ER_EXTENSION_FUNC_UNKNOWN,
- "\uD655\uC7A5 \uD568\uC218 {0}: {1}\uC744(\uB97C) \uC54C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_MORE_MATCH_CONSTRUCTOR,
- "{0}\uC5D0 \uB300\uD55C \uC0DD\uC131\uC790\uC640 \uAC00\uC7A5 \uC798 \uC77C\uCE58\uD558\uB294 \uD56D\uBAA9\uC774 \uB450 \uAC1C \uC774\uC0C1 \uC788\uC2B5\uB2C8\uB2E4."},
-
- { ER_MORE_MATCH_METHOD,
- "{0} \uBA54\uC18C\uB4DC\uC640 \uAC00\uC7A5 \uC798 \uC77C\uCE58\uD558\uB294 \uD56D\uBAA9\uC774 \uB450 \uAC1C \uC774\uC0C1 \uC788\uC2B5\uB2C8\uB2E4."},
-
- { ER_MORE_MATCH_ELEMENT,
- "\uC694\uC18C \uBA54\uC18C\uB4DC {0}\uACFC(\uC640) \uAC00\uC7A5 \uC798 \uC77C\uCE58\uD558\uB294 \uD56D\uBAA9\uC774 \uB450 \uAC1C \uC774\uC0C1 \uC788\uC2B5\uB2C8\uB2E4."},
-
- { ER_INVALID_CONTEXT_PASSED,
- "{0} \uD3C9\uAC00\uB97C \uC704\uD574 \uBD80\uC801\uD569\uD55C \uCEE8\uD14D\uC2A4\uD2B8\uAC00 \uC804\uB2EC\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
-
- { ER_POOL_EXISTS,
- "\uD480\uC774 \uC874\uC7AC\uD569\uB2C8\uB2E4."},
-
- { ER_NO_DRIVER_NAME,
- "\uC9C0\uC815\uB41C \uB4DC\uB77C\uC774\uBC84 \uC774\uB984\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_NO_URL,
- "\uC9C0\uC815\uB41C URL\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_POOL_SIZE_LESSTHAN_ONE,
- "\uD480 \uD06C\uAE30\uAC00 1\uBCF4\uB2E4 \uC791\uC2B5\uB2C8\uB2E4!"},
-
- { ER_INVALID_DRIVER,
- "\uBD80\uC801\uD569\uD55C \uB4DC\uB77C\uC774\uBC84 \uC774\uB984\uC774 \uC9C0\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4!"},
-
- { ER_NO_STYLESHEETROOT,
- "\uC2A4\uD0C0\uC77C\uC2DC\uD2B8 \uB8E8\uD2B8\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4!"},
-
- { ER_ILLEGAL_XMLSPACE_VALUE,
- "xml:space\uC5D0 \uB300\uD55C \uAC12\uC774 \uC798\uBABB\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
-
- { ER_PROCESSFROMNODE_FAILED,
- "processFromNode\uB97C \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4."},
-
- { ER_RESOURCE_COULD_NOT_LOAD,
- "[{0}] \uB9AC\uC18C\uC2A4\uAC00 \uB2E4\uC74C\uC744 \uB85C\uB4DC\uD560 \uC218 \uC5C6\uC74C: {1} \n {2} \t {3}"},
-
- { ER_BUFFER_SIZE_LESSTHAN_ZERO,
- "\uBC84\uD37C \uD06C\uAE30 <=0"},
-
- { ER_UNKNOWN_ERROR_CALLING_EXTENSION,
- "\uD655\uC7A5\uC744 \uD638\uCD9C\uD558\uB294 \uC911 \uC54C \uC218 \uC5C6\uB294 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4."},
-
- { ER_NO_NAMESPACE_DECL,
- "{0} \uC811\uB450\uC5B4\uC5D0 \uD574\uB2F9\uD558\uB294 \uB124\uC784\uC2A4\uD398\uC774\uC2A4 \uC120\uC5B8\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_ELEM_CONTENT_NOT_ALLOWED,
- "lang=javaclass {0}\uC5D0 \uB300\uD574\uC11C\uB294 \uC694\uC18C \uCF58\uD150\uCE20\uAC00 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
-
- { ER_STYLESHEET_DIRECTED_TERMINATION,
- "\uC2A4\uD0C0\uC77C\uC2DC\uD2B8\uAC00 \uC885\uB8CC\uB97C \uC9C0\uC815\uD588\uC2B5\uB2C8\uB2E4."},
-
- { ER_ONE_OR_TWO,
- "1 \uB610\uB294 2"},
-
- { ER_TWO_OR_THREE,
- "2 \uB610\uB294 3"},
-
- { ER_COULD_NOT_LOAD_RESOURCE,
- "{0}\uC744(\uB97C) \uB85C\uB4DC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. CLASSPATH\uB97C \uD655\uC778\uD558\uC2ED\uC2DC\uC624. \uD604\uC7AC \uAE30\uBCF8\uAC12\uB9CC \uC0AC\uC6A9\uD558\uB294 \uC911\uC785\uB2C8\uB2E4."},
-
- { ER_CANNOT_INIT_DEFAULT_TEMPLATES,
- "\uAE30\uBCF8 \uD15C\uD50C\uB9AC\uD2B8\uB97C \uCD08\uAE30\uD654\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_RESULT_NULL,
- "\uACB0\uACFC\uB294 \uB110\uC774 \uC544\uB2C8\uC5B4\uC57C \uD569\uB2C8\uB2E4."},
-
- { ER_RESULT_COULD_NOT_BE_SET,
- "\uACB0\uACFC\uB97C \uC124\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_NO_OUTPUT_SPECIFIED,
- "\uC9C0\uC815\uB41C \uCD9C\uB825\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_CANNOT_TRANSFORM_TO_RESULT_TYPE,
- "{0} \uC720\uD615\uC758 \uACB0\uACFC\uB85C \uBCC0\uD658\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_CANNOT_TRANSFORM_SOURCE_TYPE,
- "{0} \uC720\uD615\uC758 \uC18C\uC2A4\uB97C \uBCC0\uD658\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_NULL_CONTENT_HANDLER,
- "\uB110 \uCF58\uD150\uCE20 \uCC98\uB9AC\uAE30"},
-
- { ER_NULL_ERROR_HANDLER,
- "\uB110 \uC624\uB958 \uCC98\uB9AC\uAE30"},
-
- { ER_CANNOT_CALL_PARSE,
- "ContentHandler\uAC00 \uC124\uC815\uB418\uC9C0 \uC54A\uC740 \uACBD\uC6B0 parse\uB97C \uD638\uCD9C\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_NO_PARENT_FOR_FILTER,
- "\uD544\uD130\uC5D0 \uB300\uD55C \uC0C1\uC704\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_NO_STYLESHEET_IN_MEDIA,
- "{0}\uC5D0\uC11C \uC2A4\uD0C0\uC77C\uC2DC\uD2B8\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uB9E4\uCCB4 = {1}"},
-
- { ER_NO_STYLESHEET_PI,
- "{0}\uC5D0\uC11C xml-stylesheet PI\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_NOT_SUPPORTED,
- "\uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC74C: {0}"},
-
- { ER_PROPERTY_VALUE_BOOLEAN,
- "{0} \uC18D\uC131\uC5D0 \uB300\uD55C \uAC12\uC740 \uBD80\uC6B8 \uC778\uC2A4\uD134\uC2A4\uC5EC\uC57C \uD569\uB2C8\uB2E4."},
-
- { ER_COULD_NOT_FIND_EXTERN_SCRIPT,
- "{0}\uC5D0 \uC788\uB294 \uC678\uBD80 \uC2A4\uD06C\uB9BD\uD2B8\uB85C \uAC00\uC838\uC62C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_RESOURCE_COULD_NOT_FIND,
- "[{0}] \uB9AC\uC18C\uC2A4\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.\n {1}"},
-
- { ER_OUTPUT_PROPERTY_NOT_RECOGNIZED,
- "\uCD9C\uB825 \uC18D\uC131\uC744 \uC778\uC2DD\uD560 \uC218 \uC5C6\uC74C: {0}"},
-
- { ER_FAILED_CREATING_ELEMLITRSLT,
- "ElemLiteralResult \uC778\uC2A4\uD134\uC2A4 \uC0DD\uC131\uC744 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4."},
-
- //Earlier (JDK 1.4 XALAN 2.2-D11) at key code '204' the key name was ER_PRIORITY_NOT_PARSABLE
- // In latest Xalan code base key name is ER_VALUE_SHOULD_BE_NUMBER. This should also be taken care
- //in locale specific files like XSLTErrorResources_de.java, XSLTErrorResources_fr.java etc.
- //NOTE: Not only the key name but message has also been changed.
- { ER_VALUE_SHOULD_BE_NUMBER,
- "{0}\uC5D0 \uB300\uD55C \uAC12\uC5D0\uB294 \uAD6C\uBB38\uC744 \uBD84\uC11D\uD560 \uC218 \uC788\uB294 \uC22B\uC790\uAC00 \uD3EC\uD568\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4."},
-
- { ER_VALUE_SHOULD_EQUAL,
- "{0}\uC5D0 \uB300\uD55C \uAC12\uC740 yes \uB610\uB294 no\uC5EC\uC57C \uD569\uB2C8\uB2E4."},
-
- { ER_FAILED_CALLING_METHOD,
- "{0} \uBA54\uC18C\uB4DC \uD638\uCD9C\uC744 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4."},
-
- { ER_FAILED_CREATING_ELEMTMPL,
- "ElemTemplateElement \uC778\uC2A4\uD134\uC2A4 \uC0DD\uC131\uC744 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4."},
-
- { ER_CHARS_NOT_ALLOWED,
- "\uBB38\uC11C\uC758 \uC774 \uC9C0\uC810\uC5D0\uC11C\uB294 \uBB38\uC790\uAC00 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
-
- { ER_ATTR_NOT_ALLOWED,
- "{1} \uC694\uC18C\uC5D0\uC11C\uB294 \"{0}\" \uC18D\uC131\uC774 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4!"},
-
- { ER_BAD_VALUE,
- "{0}: \uC798\uBABB\uB41C \uAC12 {1} "},
-
- { ER_ATTRIB_VALUE_NOT_FOUND,
- "{0} \uC18D\uC131\uAC12\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. "},
-
- { ER_ATTRIB_VALUE_NOT_RECOGNIZED,
- "{0} \uC18D\uC131\uAC12\uC744 \uC778\uC2DD\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. "},
-
- { ER_NULL_URI_NAMESPACE,
- "\uB110 URI\uB97C \uC0AC\uC6A9\uD558\uC5EC \uB124\uC784\uC2A4\uD398\uC774\uC2A4 \uC811\uB450\uC5B4\uB97C \uC0DD\uC131\uD558\uB824\uACE0 \uC2DC\uB3C4\uD558\uB294 \uC911"},
-
- { ER_NUMBER_TOO_BIG,
- "\uAC00\uC7A5 \uD070 Long \uC815\uC218\uBCF4\uB2E4 \uD070 \uC22B\uC790\uC758 \uD615\uC2DD\uC744 \uC9C0\uC815\uD558\uB824\uACE0 \uC2DC\uB3C4\uD558\uB294 \uC911"},
-
- { ER_CANNOT_FIND_SAX1_DRIVER,
- "SAX1 \uB4DC\uB77C\uC774\uBC84 \uD074\uB798\uC2A4 {0}\uC744(\uB97C) \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_SAX1_DRIVER_NOT_LOADED,
- "SAX1 \uB4DC\uB77C\uC774\uBC84 \uD074\uB798\uC2A4 {0}\uC774(\uAC00) \uBC1C\uACAC\uB418\uC5C8\uC9C0\uB9CC \uD574\uB2F9 \uD074\uB798\uC2A4\uB97C \uB85C\uB4DC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_SAX1_DRIVER_NOT_INSTANTIATED,
- "SAX1 \uB4DC\uB77C\uC774\uBC84 \uD074\uB798\uC2A4 {0}\uC774(\uAC00) \uB85C\uB4DC\uB418\uC5C8\uC9C0\uB9CC \uD574\uB2F9 \uD074\uB798\uC2A4\uB97C \uC778\uC2A4\uD134\uC2A4\uD654\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_SAX1_DRIVER_NOT_IMPLEMENT_PARSER,
- "SAX1 \uB4DC\uB77C\uC774\uBC84 \uD074\uB798\uC2A4 {0}\uC774(\uAC00) org.xml.sax.Parser\uB97C \uAD6C\uD604\uD558\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."},
-
- { ER_PARSER_PROPERTY_NOT_SPECIFIED,
- "\uC2DC\uC2A4\uD15C \uC18D\uC131 org.xml.sax.parser\uAC00 \uC9C0\uC815\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."},
-
- { ER_PARSER_ARG_CANNOT_BE_NULL,
- "\uAD6C\uBB38 \uBD84\uC11D\uAE30 \uC778\uC218\uB294 \uB110\uC774 \uC544\uB2C8\uC5B4\uC57C \uD569\uB2C8\uB2E4."},
-
- { ER_FEATURE,
- "\uAE30\uB2A5: {0}"},
-
- { ER_PROPERTY,
- "\uC18D\uC131: {0}"},
-
- { ER_NULL_ENTITY_RESOLVER,
- "\uB110 \uC5D4\uD2F0\uD2F0 \uBD84\uC11D\uAE30"},
-
- { ER_NULL_DTD_HANDLER,
- "\uB110 DTD \uCC98\uB9AC\uAE30"},
-
- { ER_NO_DRIVER_NAME_SPECIFIED,
- "\uC9C0\uC815\uB41C \uB4DC\uB77C\uC774\uBC84 \uC774\uB984\uC774 \uC5C6\uC2B5\uB2C8\uB2E4!"},
-
- { ER_NO_URL_SPECIFIED,
- "\uC9C0\uC815\uB41C URL\uC774 \uC5C6\uC2B5\uB2C8\uB2E4!"},
-
- { ER_POOLSIZE_LESS_THAN_ONE,
- "\uD480 \uD06C\uAE30\uAC00 1 \uBBF8\uB9CC\uC785\uB2C8\uB2E4!"},
-
- { ER_INVALID_DRIVER_NAME,
- "\uBD80\uC801\uD569\uD55C \uB4DC\uB77C\uC774\uBC84 \uC774\uB984\uC774 \uC9C0\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4!"},
-
- { ER_ERRORLISTENER,
- "ErrorListener"},
-
-
-// Note to translators: The following message should not normally be displayed
-// to users. It describes a situation in which the processor has detected
-// an internal consistency problem in itself, and it provides this message
-// for the developer to help diagnose the problem. The name
-// 'ElemTemplateElement' is the name of a class, and should not be
-// translated.
- { ER_ASSERT_NO_TEMPLATE_PARENT,
- "\uD504\uB85C\uADF8\uB798\uBA38 \uC624\uB958\uC785\uB2C8\uB2E4! \uD45C\uD604\uC2DD\uC5D0 ElemTemplateElement \uC0C1\uC704\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4!"},
-
-
-// Note to translators: The following message should not normally be displayed
-// to users. It describes a situation in which the processor has detected
-// an internal consistency problem in itself, and it provides this message
-// for the developer to help diagnose the problem. The substitution text
-// provides further information in order to diagnose the problem. The name
-// 'RedundentExprEliminator' is the name of a class, and should not be
-// translated.
- { ER_ASSERT_REDUNDENT_EXPR_ELIMINATOR,
- "RedundentExprEliminator\uC5D0 \uD504\uB85C\uADF8\uB798\uBA38 \uAC80\uC99D\uC774 \uC788\uC74C: {0}"},
-
- { ER_NOT_ALLOWED_IN_POSITION,
- "\uC2A4\uD0C0\uC77C\uC2DC\uD2B8\uC758 \uC774 \uC704\uCE58\uC5D0\uB294 {0}\uC774(\uAC00) \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4!"},
-
- { ER_NONWHITESPACE_NOT_ALLOWED_IN_POSITION,
- "\uC2A4\uD0C0\uC77C\uC2DC\uD2B8\uC758 \uC774 \uC704\uCE58\uC5D0\uB294 \uACF5\uBC31\uC774 \uC544\uB2CC \uD14D\uC2A4\uD2B8\uB294 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4!"},
-
- // This code is shared with warning codes.
- // SystemId Unknown
- { INVALID_TCHAR,
- "\uC798\uBABB\uB41C \uAC12: {1}\uC774(\uAC00) CHAR \uC18D\uC131\uC5D0 \uC0AC\uC6A9\uB428: {0}. CHAR \uC720\uD615\uC758 \uC18D\uC131\uC740 1\uC790\uC5EC\uC57C \uD569\uB2C8\uB2E4!"},
-
- // Note to translators: The following message is used if the value of
- // an attribute in a stylesheet is invalid. "QNAME" is the XML data-type of
- // the attribute, and should not be translated. The substitution text {1} is
- // the attribute value and {0} is the attribute name.
- //The following codes are shared with the warning codes...
- { INVALID_QNAME,
- "\uC798\uBABB\uB41C \uAC12: {1}\uC774(\uAC00) QNAME \uC18D\uC131\uC5D0 \uC0AC\uC6A9\uB428: {0}"},
-
- // Note to translators: The following message is used if the value of
- // an attribute in a stylesheet is invalid. "ENUM" is the XML data-type of
- // the attribute, and should not be translated. The substitution text {1} is
- // the attribute value, {0} is the attribute name, and {2} is a list of valid
- // values.
- { INVALID_ENUM,
- "\uC798\uBABB\uB41C \uAC12: {1}\uC774(\uAC00) ENUM \uC18D\uC131\uC5D0 \uC0AC\uC6A9\uB428: {0}. \uC801\uD569\uD55C \uAC12: {2}."},
-
-// Note to translators: The following message is used if the value of
-// an attribute in a stylesheet is invalid. "NMTOKEN" is the XML data-type
-// of the attribute, and should not be translated. The substitution text {1} is
-// the attribute value and {0} is the attribute name.
- { INVALID_NMTOKEN,
- "\uC798\uBABB\uB41C \uAC12: {1}\uC774(\uAC00) NMTOKEN \uC18D\uC131\uC5D0 \uC0AC\uC6A9\uB428: {0} "},
-
-// Note to translators: The following message is used if the value of
-// an attribute in a stylesheet is invalid. "NCNAME" is the XML data-type
-// of the attribute, and should not be translated. The substitution text {1} is
-// the attribute value and {0} is the attribute name.
- { INVALID_NCNAME,
- "\uC798\uBABB\uB41C \uAC12: {1}\uC774(\uAC00) NCNAME \uC18D\uC131\uC5D0 \uC0AC\uC6A9\uB428: {0} "},
-
-// Note to translators: The following message is used if the value of
-// an attribute in a stylesheet is invalid. "boolean" is the XSLT data-type
-// of the attribute, and should not be translated. The substitution text {1} is
-// the attribute value and {0} is the attribute name.
- { INVALID_BOOLEAN,
- "\uC798\uBABB\uB41C \uAC12: {1}\uC774(\uAC00) boolean \uC18D\uC131\uC5D0 \uC0AC\uC6A9\uB428: {0} "},
-
-// Note to translators: The following message is used if the value of
-// an attribute in a stylesheet is invalid. "number" is the XSLT data-type
-// of the attribute, and should not be translated. The substitution text {1} is
-// the attribute value and {0} is the attribute name.
- { INVALID_NUMBER,
- "\uC798\uBABB\uB41C \uAC12: {1}\uC774(\uAC00) number \uC18D\uC131\uC5D0 \uC0AC\uC6A9\uB428: {0} "},
-
-
- // End of shared codes...
-
-// Note to translators: A "match pattern" is a special form of XPath expression
-// that is used for matching patterns. The substitution text is the name of
-// a function. The message indicates that when this function is referenced in
-// a match pattern, its argument must be a string literal (or constant.)
-// ER_ARG_LITERAL - new error message for bugzilla //5202
- { ER_ARG_LITERAL,
- "\uC77C\uCE58 \uD328\uD134\uC758 {0}\uC5D0 \uB300\uD55C \uC778\uC218\uB294 \uB9AC\uD130\uB7F4\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4."},
-
-// Note to translators: The following message indicates that two definitions of
-// a variable. A "global variable" is a variable that is accessible everywher
-// in the stylesheet.
-// ER_DUPLICATE_GLOBAL_VAR - new error message for bugzilla #790
- { ER_DUPLICATE_GLOBAL_VAR,
- "\uC804\uC5ED \uBCC0\uC218 \uC120\uC5B8\uC774 \uC911\uBCF5\uB429\uB2C8\uB2E4."},
-
-
-// Note to translators: The following message indicates that two definitions of
-// a variable were encountered.
-// ER_DUPLICATE_VAR - new error message for bugzilla #790
- { ER_DUPLICATE_VAR,
- "\uBCC0\uC218 \uC120\uC5B8\uC774 \uC911\uBCF5\uB429\uB2C8\uB2E4."},
-
- // Note to translators: "xsl:template, "name" and "match" are XSLT keywords
- // which must not be translated.
- // ER_TEMPLATE_NAME_MATCH - new error message for bugzilla #789
- { ER_TEMPLATE_NAME_MATCH,
- "xsl:template\uC5D0\uB294 name \uB610\uB294 match \uC18D\uC131 \uC911 \uD558\uB098\uAC00 \uC788\uAC70\uB098 \uBAA8\uB450 \uC788\uC5B4\uC57C \uD569\uB2C8\uB2E4."},
-
- // Note to translators: "exclude-result-prefixes" is an XSLT keyword which
- // should not be translated. The message indicates that a namespace prefix
- // encountered as part of the value of the exclude-result-prefixes attribute
- // was in error.
- // ER_INVALID_PREFIX - new error message for bugzilla #788
- { ER_INVALID_PREFIX,
- "exclude-result-prefixes\uC758 \uC811\uB450\uC5B4\uAC00 \uBD80\uC801\uD569\uD568: {0}"},
-
- // Note to translators: An "attribute set" is a set of attributes that can
- // be added to an element in the output document as a group. The message
- // indicates that there was a reference to an attribute set named {0} that
- // was never defined.
- // ER_NO_ATTRIB_SET - new error message for bugzilla #782
- { ER_NO_ATTRIB_SET,
- "\uC774\uB984\uC774 {0}\uC778 attribute-set\uAC00 \uC874\uC7AC\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
-
- // Note to translators: This message indicates that there was a reference
- // to a function named {0} for which no function definition could be found.
- { ER_FUNCTION_NOT_FOUND,
- "\uC774\uB984\uC774 {0}\uC778 \uD568\uC218\uAC00 \uC874\uC7AC\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
-
- // Note to translators: This message indicates that the XSLT instruction
- // that is named by the substitution text {0} must not contain other XSLT
- // instructions (content) or a "select" attribute. The word "select" is
- // an XSLT keyword in this case and must not be translated.
- { ER_CANT_HAVE_CONTENT_AND_SELECT,
- "{0} \uC694\uC18C\uC5D0\uB294 content \uC18D\uC131\uACFC select \uC18D\uC131\uC774 \uD568\uAED8 \uD3EC\uD568\uB418\uC9C0 \uC54A\uC544\uC57C \uD569\uB2C8\uB2E4."},
-
- // Note to translators: This message indicates that the value argument
- // of setParameter must be a valid Java Object.
- { ER_INVALID_SET_PARAM_VALUE,
- "{0} \uB9E4\uAC1C\uBCC0\uC218\uC758 \uAC12\uC740 \uC801\uD569\uD55C Java \uAC1D\uCCB4\uC5EC\uC57C \uD569\uB2C8\uB2E4."},
-
- { ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX_FOR_DEFAULT,
- "xsl:namespace-alias \uC694\uC18C\uC758 result-prefix \uC18D\uC131\uC5D0 \uB300\uD55C \uAC12\uC740 '#default'\uC774\uC9C0\uB9CC \uC694\uC18C\uC5D0 \uB300\uD55C \uBC94\uC704\uC5D0\uC11C \uAE30\uBCF8 \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uAC00 \uC120\uC5B8\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."},
-
- { ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX,
- "xsl:namespace-alias \uC694\uC18C\uC758 result-prefix \uC18D\uC131\uC5D0 \uB300\uD55C \uAC12\uC740 ''{0}''\uC774\uC9C0\uB9CC \uC694\uC18C\uC5D0 \uB300\uD55C \uBC94\uC704\uC5D0\uC11C ''{0}'' \uC811\uB450\uC5B4\uC758 \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uAC00 \uC120\uC5B8\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."},
-
- { ER_SET_FEATURE_NULL_NAME,
- "\uAE30\uB2A5 \uC774\uB984\uC740 TransformerFactory.setFeature(\uBB38\uC790\uC5F4 \uC774\uB984, \uBD80\uC6B8 \uAC12)\uC5D0\uC11C \uB110\uC77C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_GET_FEATURE_NULL_NAME,
- "\uAE30\uB2A5 \uC774\uB984\uC740 TransformerFactory.getFeature(\uBB38\uC790\uC5F4 \uC774\uB984)\uC5D0\uC11C \uB110\uC77C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_UNSUPPORTED_FEATURE,
- "\uC774 TransformerFactory\uC5D0\uC11C ''{0}'' \uAE30\uB2A5\uC744 \uC124\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_EXTENSION_ELEMENT_NOT_ALLOWED_IN_SECURE_PROCESSING,
- "\uBCF4\uC548 \uCC98\uB9AC \uAE30\uB2A5\uC774 true\uB85C \uC124\uC815\uB41C \uACBD\uC6B0 \uD655\uC7A5 \uC694\uC18C ''{0}''\uC744(\uB97C) \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_NAMESPACE_CONTEXT_NULL_NAMESPACE,
- "\uB110 \uB124\uC784\uC2A4\uD398\uC774\uC2A4 URI\uC5D0 \uB300\uD55C \uC811\uB450\uC5B4\uB97C \uAC00\uC838\uC62C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_NAMESPACE_CONTEXT_NULL_PREFIX,
- "\uB110 \uC811\uB450\uC5B4\uC5D0 \uB300\uD55C \uB124\uC784\uC2A4\uD398\uC774\uC2A4 URI\uB97C \uAC00\uC838\uC62C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_XPATH_RESOLVER_NULL_QNAME,
- "\uD568\uC218 \uC774\uB984\uC740 \uB110\uC77C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_XPATH_RESOLVER_NEGATIVE_ARITY,
- "\uC778\uC790 \uC218\uB294 \uC74C\uC218\uC77C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
- // Warnings...
-
- { WG_FOUND_CURLYBRACE,
- "'}'\uB97C \uCC3E\uC558\uC9C0\uB9CC \uC5F4\uB824 \uC788\uB294 \uC18D\uC131 \uD15C\uD50C\uB9AC\uD2B8\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4!"},
-
- { WG_COUNT_ATTRIB_MATCHES_NO_ANCESTOR,
- "\uACBD\uACE0: count \uC18D\uC131\uC774 xsl:number\uC758 \uC870\uC0C1\uACFC \uC77C\uCE58\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4! \uB300\uC0C1 = {0}"},
-
- { WG_EXPR_ATTRIB_CHANGED_TO_SELECT,
- "\uC774\uC804 \uAD6C\uBB38: 'expr' \uC18D\uC131\uC758 \uC774\uB984\uC774 'select'\uB85C \uBCC0\uACBD\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
-
- { WG_NO_LOCALE_IN_FORMATNUMBER,
- "Xalan\uC774 format-number \uD568\uC218\uC5D0\uC11C \uB85C\uCF00\uC77C \uC774\uB984\uC744 \uC544\uC9C1 \uCC98\uB9AC\uD558\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."},
-
- { WG_LOCALE_NOT_FOUND,
- "\uACBD\uACE0: xml:lang={0}\uC5D0 \uB300\uD55C \uB85C\uCF00\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { WG_CANNOT_MAKE_URL_FROM,
- "{0}\uC5D0\uC11C URL\uC744 \uC0DD\uC131\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { WG_CANNOT_LOAD_REQUESTED_DOC,
- "\uC694\uCCAD\uB41C \uBB38\uC11C\uB97C \uB85C\uB4DC\uD560 \uC218 \uC5C6\uC74C: {0}"},
-
- { WG_CANNOT_FIND_COLLATOR,
- "<sort xml:lang={0}\uC5D0 \uB300\uD55C \uBCD1\uD569\uAE30\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { WG_FUNCTIONS_SHOULD_USE_URL,
- "\uC774\uC804 \uAD6C\uBB38: \uD568\uC218 \uBA85\uB839\uC5D0 {0} URL\uC774 \uC0AC\uC6A9\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4."},
-
- { WG_ENCODING_NOT_SUPPORTED_USING_UTF8,
- "\uC778\uCF54\uB529\uC774 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC74C: {0}. UTF-8\uC744 \uC0AC\uC6A9\uD558\uB294 \uC911\uC785\uB2C8\uB2E4."},
-
- { WG_ENCODING_NOT_SUPPORTED_USING_JAVA,
- "\uC778\uCF54\uB529\uC774 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC74C: {0}. Java {1}\uC744(\uB97C) \uC0AC\uC6A9\uD558\uB294 \uC911\uC785\uB2C8\uB2E4."},
-
- { WG_SPECIFICITY_CONFLICTS,
- "\uD2B9\uC218 \uCDA9\uB3CC\uC774 \uBC1C\uACAC\uB428: {0}. \uC2A4\uD0C0\uC77C\uC2DC\uD2B8\uC5D0\uC11C \uBC1C\uACAC\uB41C \uB9C8\uC9C0\uB9C9 \uD56D\uBAA9\uC774 \uC0AC\uC6A9\uB429\uB2C8\uB2E4."},
-
- { WG_PARSING_AND_PREPARING,
- "========= \uAD6C\uBB38 \uBD84\uC11D \uD6C4 {0} \uC900\uBE44 \uC911 =========="},
-
- { WG_ATTR_TEMPLATE,
- "\uC18D\uC131 \uD15C\uD50C\uB9AC\uD2B8, {0}"},
-
- { WG_CONFLICT_BETWEEN_XSLSTRIPSPACE_AND_XSLPRESERVESPACE,
- "xsl:strip-space\uC640 xsl:preserve-space \uAC04\uC758 \uC77C\uCE58 \uCDA9\uB3CC"},
-
- { WG_ATTRIB_NOT_HANDLED,
- "Xalan\uC774 {0} \uC18D\uC131\uC744 \uC544\uC9C1 \uCC98\uB9AC\uD558\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4!"},
-
- { WG_NO_DECIMALFORMAT_DECLARATION,
- "\uC2ED\uC9C4\uC218 \uD615\uC2DD\uC5D0 \uB300\uD55C \uC120\uC5B8\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC74C: {0}"},
-
- { WG_OLD_XSLT_NS,
- "XSLT \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uAC00 \uB204\uB77D\uB418\uAC70\uB098 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. "},
-
- { WG_ONE_DEFAULT_XSLDECIMALFORMAT_ALLOWED,
- "\uAE30\uBCF8 xsl:decimal-format \uC120\uC5B8\uC740 \uD558\uB098\uB9CC \uD5C8\uC6A9\uB429\uB2C8\uB2E4."},
-
- { WG_XSLDECIMALFORMAT_NAMES_MUST_BE_UNIQUE,
- "xsl:decimal-format \uC774\uB984\uC740 \uACE0\uC720\uD574\uC57C \uD569\uB2C8\uB2E4. \"{0}\" \uC774\uB984\uC774 \uC911\uBCF5\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
-
- { WG_ILLEGAL_ATTRIBUTE,
- "{0}\uC5D0 \uC798\uBABB\uB41C \uC18D\uC131\uC774 \uC788\uC74C: {1}"},
-
- { WG_COULD_NOT_RESOLVE_PREFIX,
- "\uB124\uC784\uC2A4\uD398\uC774\uC2A4 \uC811\uB450\uC5B4\uB97C \uBD84\uC11D\uD560 \uC218 \uC5C6\uC74C: {0}. \uB178\uB4DC\uAC00 \uBB34\uC2DC\uB429\uB2C8\uB2E4."},
-
- { WG_STYLESHEET_REQUIRES_VERSION_ATTRIB,
- "xsl:stylesheet\uC5D0\uB294 'version' \uC18D\uC131\uC774 \uD544\uC694\uD569\uB2C8\uB2E4!"},
-
- { WG_ILLEGAL_ATTRIBUTE_NAME,
- "\uC798\uBABB\uB41C \uC18D\uC131 \uC774\uB984: {0}"},
-
- { WG_ILLEGAL_ATTRIBUTE_VALUE,
- "{0} \uC18D\uC131\uC5D0 \uC798\uBABB\uB41C \uAC12\uC774 \uC0AC\uC6A9\uB428: {1}"},
-
- { WG_EMPTY_SECOND_ARG,
- "document \uD568\uC218\uC758 \uB450\uBC88\uC9F8 \uC778\uC218\uC5D0\uC11C \uACB0\uACFC\uB85C \uB098\uD0C0\uB09C nodeset\uAC00 \uBE44\uC5B4 \uC788\uC2B5\uB2C8\uB2E4. \uBE48 node-set\uAC00 \uBC18\uD658\uB429\uB2C8\uB2E4."},
-
- //Following are the new WARNING keys added in XALAN code base after Jdk 1.4 (Xalan 2.2-D11)
-
- // Note to translators: "name" and "xsl:processing-instruction" are keywords
- // and must not be translated.
- { WG_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML,
- "xsl:processing-instruction \uC774\uB984\uC758 'name' \uC18D\uC131\uAC12\uC740 'xml'\uC774 \uC544\uB2C8\uC5B4\uC57C \uD569\uB2C8\uB2E4."},
-
- // Note to translators: "name" and "xsl:processing-instruction" are keywords
- // and must not be translated. "NCName" is an XML data-type and must not be
- // translated.
- { WG_PROCESSINGINSTRUCTION_NOTVALID_NCNAME,
- "xsl:processing-instruction\uC758 ''name'' \uC18D\uC131\uAC12\uC740 \uC801\uD569\uD55C NCName\uC774\uC5B4\uC57C \uD568: {0}"},
-
- // Note to translators: This message is reported if the stylesheet that is
- // being processed attempted to construct an XML document with an attribute in a
- // place other than on an element. The substitution text specifies the name of
- // the attribute.
- { WG_ILLEGAL_ATTRIBUTE_POSITION,
- "\uD558\uC704 \uB178\uB4DC\uAC00 \uC0DD\uC131\uB41C \uD6C4 \uB610\uB294 \uC694\uC18C\uAC00 \uC0DD\uC131\uB418\uAE30 \uC804\uC5D0 {0} \uC18D\uC131\uC744 \uCD94\uAC00\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uC18D\uC131\uC774 \uBB34\uC2DC\uB429\uB2C8\uB2E4."},
-
- { NO_MODIFICATION_ALLOWED_ERR,
- "\uC218\uC815\uC774 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uB294 \uAC1D\uCCB4\uB97C \uC218\uC815\uD558\uB824\uACE0 \uC2DC\uB3C4\uD588\uC2B5\uB2C8\uB2E4."
- },
-
- //Check: WHY THERE IS A GAP B/W NUMBERS in the XSLTErrorResources properties file?
-
- // Other miscellaneous text used inside the code...
- { "ui_language", "ko"},
- { "help_language", "ko" },
- { "language", "ko" },
- { "BAD_CODE", "createMessage\uC5D0 \uB300\uD55C \uB9E4\uAC1C\uBCC0\uC218\uAC00 \uBC94\uC704\uB97C \uBC97\uC5B4\uB0AC\uC2B5\uB2C8\uB2E4."},
- { "FORMAT_FAILED", "messageFormat \uD638\uCD9C \uC911 \uC608\uC678\uC0AC\uD56D\uC774 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4."},
- { "version", ">>>>>>> Xalan \uBC84\uC804 "},
- { "version2", "<<<<<<<"},
- { "yes", "\uC608"},
- { "line", "\uD589 \uBC88\uD638"},
- { "column","\uC5F4 \uBC88\uD638"},
- { "xsldone", "XSLProcessor: \uC644\uB8CC"},
-
-
- // Note to translators: The following messages provide usage information
- // for the Xalan Process command line. "Process" is the name of a Java class,
- // and should not be translated.
- { "xslProc_option", "Xalan-J \uBA85\uB839\uD589 Process \uD074\uB798\uC2A4 \uC635\uC158:"},
- { "xslProc_option", "Xalan-J \uBA85\uB839\uD589 Process \uD074\uB798\uC2A4 \uC635\uC158:"},
- { "xslProc_invalid_xsltc_option", "XSLTC \uBAA8\uB4DC\uC5D0\uC11C\uB294 {0} \uC635\uC158\uC774 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
- { "xslProc_invalid_xalan_option", "{0} \uC635\uC158\uC740 -XSLTC\uC5D0\uB9CC \uC0AC\uC6A9\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4."},
- { "xslProc_no_input", "\uC624\uB958: \uC9C0\uC815\uB41C \uC2A4\uD0C0\uC77C\uC2DC\uD2B8 \uB610\uB294 \uC785\uB825 xml\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. \uC0AC\uC6A9\uBC95 \uC9C0\uCE68\uC5D0 \uB300\uD55C \uC635\uC158 \uC5C6\uC774 \uC774 \uBA85\uB839\uC744 \uC2E4\uD589\uD558\uC2ED\uC2DC\uC624."},
- { "xslProc_common_options", "-\uC77C\uBC18 \uC635\uC158-"},
- { "xslProc_xalan_options", "-Xalan \uC635\uC158-"},
- { "xslProc_xsltc_options", "-XSLTC \uC635\uC158-"},
- { "xslProc_return_to_continue", "(\uACC4\uC18D\uD558\uB824\uBA74 <Return> \uD0A4\uB97C \uB204\uB974\uC2ED\uC2DC\uC624.)"},
-
- // Note to translators: The option name and the parameter name do not need to
- // be translated. Only translate the messages in parentheses. Note also that
- // leading whitespace in the messages is used to indent the usage information
- // for each option in the English messages.
- // Do not translate the keywords: XSLTC, SAX, DOM and DTM.
- { "optionXSLTC", " [-XSLTC(\uBCC0\uD658\uC5D0 XSLTC \uC0AC\uC6A9)]"},
- { "optionIN", " [-IN inputXMLURL]"},
- { "optionXSL", " [-XSL XSLTransformationURL]"},
- { "optionOUT", " [-OUT outputFileName]"},
- { "optionLXCIN", " [-LXCIN compiledStylesheetFileNameIn]"},
- { "optionLXCOUT", " [-LXCOUT compiledStylesheetFileNameOutOut]"},
- { "optionPARSER", " [-PARSER \uAD6C\uBB38 \uBD84\uC11D\uAE30 \uC5F0\uACB0\uC758 \uC804\uCCB4 \uD074\uB798\uC2A4 \uC774\uB984]"},
- { "optionE", " [-E(\uC5D4\uD2F0\uD2F0 \uCC38\uC870 \uD655\uC7A5 \uC548\uD568)]"},
- { "optionV", " [-E(\uC5D4\uD2F0\uD2F0 \uCC38\uC870 \uD655\uC7A5 \uC548\uD568)]"},
- { "optionQC", " [-QC(\uC790\uB3D9 \uD328\uD134 \uCDA9\uB3CC \uACBD\uACE0)]"},
- { "optionQ", " [-Q(\uC790\uB3D9 \uBAA8\uB4DC)]"},
- { "optionLF", " [-LF(\uCD9C\uB825\uC5D0\uB9CC \uC904 \uBC14\uAFC8 \uC0AC\uC6A9 {\uAE30\uBCF8\uAC12: CR/LF})]"},
- { "optionCR", " [-CR(\uCD9C\uB825\uC5D0\uB9CC \uCE90\uB9AC\uC9C0 \uB9AC\uD134 \uC0AC\uC6A9 {\uAE30\uBCF8\uAC12: CR/LF})]"},
- { "optionESCAPE", " [-ESCAPE(\uC774\uC2A4\uCF00\uC774\uD504 \uBB38\uC790 {\uAE30\uBCF8\uAC12: <>&\"'\\r\\n}]"},
- { "optionINDENT", " [-INDENT(\uB4E4\uC5EC \uC4F8 \uACF5\uBC31 \uC218 \uC81C\uC5B4 {\uAE30\uBCF8\uAC12: 0})]"},
- { "optionTT", " [-TT(\uD15C\uD50C\uB9AC\uD2B8 \uD638\uCD9C \uC2DC \uCD94\uC801)]"},
- { "optionTG", " [-TG(\uAC01 \uC0DD\uC131 \uC774\uBCA4\uD2B8 \uCD94\uC801)]"},
- { "optionTS", " [-TS(\uAC01 \uC120\uD0DD \uC774\uBCA4\uD2B8 \uCD94\uC801)]"},
- { "optionTTC", " [-TTC(\uD15C\uD50C\uB9AC\uD2B8 \uD558\uC704 \uD56D\uBAA9 \uCC98\uB9AC \uC2DC \uCD94\uC801)]"},
- { "optionTCLASS", " [-TCLASS(\uCD94\uC801 \uD655\uC7A5\uC5D0 \uB300\uD55C TraceListener \uD074\uB798\uC2A4)]"},
- { "optionVALIDATE", " [-VALIDATE(\uAC80\uC99D \uC5EC\uBD80 \uC124\uC815. \uAE30\uBCF8\uC801\uC73C\uB85C \uAC80\uC99D\uC740 \uD574\uC81C\uB418\uC5B4 \uC788\uC74C)]"},
- { "optionEDUMP", " [-EDUMP {\uC120\uD0DD\uC801 \uD30C\uC77C \uC774\uB984}(\uC624\uB958 \uBC1C\uC0DD \uC2DC \uC2A4\uD0DD \uB364\uD504)]"},
- { "optionXML", " [-XML(XML \uD3EC\uB9F7\uD130 \uC0AC\uC6A9 \uBC0F XML \uD5E4\uB354 \uCD94\uAC00)]"},
- { "optionTEXT", " [-TEXT(\uAC04\uB2E8\uD55C \uD14D\uC2A4\uD2B8 \uD3EC\uB9F7\uD130 \uC0AC\uC6A9)]"},
- { "optionHTML", " [-HTML(HTML \uD3EC\uB9F7\uD130 \uC0AC\uC6A9)]"},
- { "optionPARAM", " [-PARAM \uC774\uB984 \uD45C\uD604\uC2DD(\uC2A4\uD0C0\uC77C\uC2DC\uD2B8 \uB9E4\uAC1C\uBCC0\uC218 \uC124\uC815)]"},
- { "noParsermsg1", "XSL \uD504\uB85C\uC138\uC2A4\uB97C \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4."},
- { "noParsermsg2", "** \uAD6C\uBB38 \uBD84\uC11D\uAE30\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC74C **"},
- { "noParsermsg3", "\uD074\uB798\uC2A4 \uACBD\uB85C\uB97C \uD655\uC778\uD558\uC2ED\uC2DC\uC624."},
- { "noParsermsg4", "IBM\uC758 Java\uC6A9 XML \uAD6C\uBB38 \uBD84\uC11D\uAE30\uAC00 \uC5C6\uC744 \uACBD\uC6B0 \uB2E4\uC74C \uC704\uCE58\uC5D0\uC11C \uB2E4\uC6B4\uB85C\uB4DC\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4."},
- { "noParsermsg5", "IBM AlphaWorks: http://www.alphaworks.ibm.com/formula/xml"},
- { "optionURIRESOLVER", " [-URIRESOLVER \uC804\uCCB4 \uD074\uB798\uC2A4 \uC774\uB984(URI \uBD84\uC11D\uC5D0 \uC0AC\uC6A9\uD560 URIResolver)]"},
- { "optionENTITYRESOLVER", " [-ENTITYRESOLVER \uC804\uCCB4 \uD074\uB798\uC2A4 \uC774\uB984(\uC5D4\uD2F0\uD2F0 \uBD84\uC11D\uC5D0 \uC0AC\uC6A9\uD560 EntityResolver)]"},
- { "optionCONTENTHANDLER", " [-CONTENTHANDLER \uC804\uCCB4 \uD074\uB798\uC2A4 \uC774\uB984(\uCD9C\uB825 \uC9C1\uB82C\uD654\uC5D0 \uC0AC\uC6A9\uD560 ContentHandler)]"},
- { "optionLINENUMBERS", " [-L(\uC18C\uC2A4 \uBB38\uC11C\uC5D0 \uD589 \uBC88\uD638 \uC0AC\uC6A9)]"},
- { "optionSECUREPROCESSING", " [-SECURE(\uBCF4\uC548 \uCC98\uB9AC \uAE30\uB2A5\uC744 true\uB85C \uC124\uC815)]"},
-
- // Following are the new options added in XSLTErrorResources.properties files after Jdk 1.4 (Xalan 2.2-D11)
-
-
- { "optionMEDIA", " [-MEDIA mediaType(media \uC18D\uC131\uC744 \uC0AC\uC6A9\uD558\uC5EC \uBB38\uC11C\uC640 \uC5F0\uAD00\uB41C \uC2A4\uD0C0\uC77C\uC2DC\uD2B8 \uCC3E\uAE30)]"},
- { "optionFLAVOR", " [-FLAVOR flavorName(\uBCC0\uD658\uC5D0 \uBA85\uC2DC\uC801\uC73C\uB85C s2s=SAX \uB610\uB294 d2d=DOM \uC0AC\uC6A9)] "}, // Added by sboag/scurcuru; experimental
- { "optionDIAG", " [-DIAG(\uBCC0\uD658\uC5D0 \uAC78\uB9B0 \uCD1D \uC2DC\uAC04(\uBC00\uB9AC\uCD08) \uC778\uC1C4)]"},
- { "optionINCREMENTAL", " [-INCREMENTAL(http://xml.apache.org/xalan/features/incremental\uC744 true\uB85C \uC124\uC815\uD558\uC5EC \uC99D\uBD84\uC801 DTM \uC0DD\uC131 \uC694\uCCAD)]"},
- { "optionNOOPTIMIMIZE", " [-NOOPTIMIMIZE(http://xml.apache.org/xalan/features/optimize\uB97C false\uB85C \uC124\uC815\uD558\uC5EC \uC2A4\uD0C0\uC77C\uC2DC\uD2B8 \uCD5C\uC801\uD654 \uCC98\uB9AC \uC548\uD568 \uC694\uCCAD)]"},
- { "optionRL", " [-RL recursionlimit(\uC2A4\uD0C0\uC77C\uC2DC\uD2B8 \uC21C\uD658 \uAE4A\uC774\uC5D0 \uB300\uD55C \uC22B\uC790 \uC81C\uD55C \uAC80\uC99D)]"},
- { "optionXO", " [-XO [transletName](\uC0DD\uC131\uB41C translet\uC5D0 \uC774\uB984 \uC9C0\uC815)]"},
- { "optionXD", " [-XD destinationDirectory(translet\uC5D0 \uB300\uD55C \uB300\uC0C1 \uB514\uB809\uD1A0\uB9AC \uC9C0\uC815)]"},
- { "optionXJ", " [-XJ jarfile(translet \uD074\uB798\uC2A4\uB97C <jarfile> \uC774\uB984\uC758 jar \uD30C\uC77C\uB85C \uD328\uD0A4\uC9C0\uD654)]"},
- { "optionXP", " [-XP package(\uC0DD\uC131\uB41C \uBAA8\uB4E0 translet \uD074\uB798\uC2A4\uC5D0 \uB300\uD55C \uD328\uD0A4\uC9C0 \uC774\uB984 \uC811\uB450\uC5B4 \uC9C0\uC815)]"},
-
- //AddITIONAL STRINGS that need L10n
- // Note to translators: The following message describes usage of a particular
- // command-line option that is used to enable the "template inlining"
- // optimization. The optimization involves making a copy of the code
- // generated for a template in another template that refers to it.
- { "optionXN", " [-XN(\uD15C\uD50C\uB9AC\uD2B8 \uC778\uB77C\uC778\uC744 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815)]" },
- { "optionXX", " [-XX(\uCD94\uAC00 \uB514\uBC84\uAE45 \uBA54\uC2DC\uC9C0 \uCD9C\uB825 \uC124\uC815)]"},
- { "optionXT" , " [-XT(\uAC00\uB2A5\uD55C \uACBD\uC6B0 \uBCC0\uD658\uC5D0 translet \uC0AC\uC6A9)]"},
- { "diagTiming"," --------- {1}\uC744(\uB97C) \uD1B5\uD55C {0} \uBCC0\uD658\uC5D0 {2}\uBC00\uB9AC\uCD08\uAC00 \uAC78\uB838\uC2B5\uB2C8\uB2E4." },
- { "recursionTooDeep","\uD15C\uD50C\uB9AC\uD2B8\uAC00 \uB108\uBB34 \uAE4A\uAC8C \uC911\uCCA9\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uC911\uCCA9 = {0}, \uD15C\uD50C\uB9AC\uD2B8: {1} {2}" },
- { "nameIs", "\uC774\uB984:" },
- { "matchPatternIs", "\uC77C\uCE58 \uD328\uD134:" }
-
- };
-
- }
- // ================= INFRASTRUCTURE ======================
-
- /** String for use when a bad error code was encountered. */
- public static final String BAD_CODE = "BAD_CODE";
-
- /** String for use when formatting of the error string failed. */
- public static final String FORMAT_FAILED = "FORMAT_FAILED";
-
- /** General error string. */
- public static final String ERROR_STRING = "#error";
-
- /** String to prepend to error messages. */
- public static final String ERROR_HEADER = "Error: ";
-
- /** String to prepend to warning messages. */
- public static final String WARNING_HEADER = "Warning: ";
-
- /** String to specify the XSLT module. */
- public static final String XSL_HEADER = "XSLT ";
-
- /** String to specify the XML parser module. */
- public static final String XML_HEADER = "XML ";
-
- /** I don't think this is used any more.
- * @deprecated */
- public static final String QUERY_HEADER = "PATTERN ";
-
-
- }
diff --git a/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_pt_BR.java b/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_pt_BR.java
deleted file mode 100644
index 7eedeb8..0000000
--- a/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_pt_BR.java
+++ /dev/null
@@ -1,1447 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xalan.internal.res;
-
-import java.util.ListResourceBundle;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * Set up error messages.
- * We build a two dimensional array of message keys and
- * message strings. In order to add a new message here,
- * you need to first add a String constant. And
- * you need to enter key , value pair as part of contents
- * Array. You also need to update MAX_CODE for error strings
- * and MAX_WARNING for warnings ( Needed for only information
- * purpose )
- */
-public class XSLTErrorResources_pt_BR extends ListResourceBundle
-{
-
-/*
- * This file contains error and warning messages related to Xalan Error
- * Handling.
- *
- * General notes to translators:
- *
- * 1) Xalan (or more properly, Xalan-interpretive) and XSLTC are names of
- * components.
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- * XSLTC is an acronym for XSLT Compiler.
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 5) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 6) "Translet" is an invented term that describes the class file that
- * results from compiling an XML stylesheet into a Java class.
- *
- * 7) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- */
-
- /*
- * Static variables
- */
- public static final String ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX =
- "ER_INVALID_SET_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX";
-
- public static final String ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX_FOR_DEFAULT =
- "ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX_FOR_DEFAULT";
-
- public static final String ER_NO_CURLYBRACE = "ER_NO_CURLYBRACE";
- public static final String ER_FUNCTION_NOT_SUPPORTED = "ER_FUNCTION_NOT_SUPPORTED";
- public static final String ER_ILLEGAL_ATTRIBUTE = "ER_ILLEGAL_ATTRIBUTE";
- public static final String ER_NULL_SOURCENODE_APPLYIMPORTS = "ER_NULL_SOURCENODE_APPLYIMPORTS";
- public static final String ER_CANNOT_ADD = "ER_CANNOT_ADD";
- public static final String ER_NULL_SOURCENODE_HANDLEAPPLYTEMPLATES="ER_NULL_SOURCENODE_HANDLEAPPLYTEMPLATES";
- public static final String ER_NO_NAME_ATTRIB = "ER_NO_NAME_ATTRIB";
- public static final String ER_TEMPLATE_NOT_FOUND = "ER_TEMPLATE_NOT_FOUND";
- public static final String ER_CANT_RESOLVE_NAME_AVT = "ER_CANT_RESOLVE_NAME_AVT";
- public static final String ER_REQUIRES_ATTRIB = "ER_REQUIRES_ATTRIB";
- public static final String ER_MUST_HAVE_TEST_ATTRIB = "ER_MUST_HAVE_TEST_ATTRIB";
- public static final String ER_BAD_VAL_ON_LEVEL_ATTRIB =
- "ER_BAD_VAL_ON_LEVEL_ATTRIB";
- public static final String ER_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML =
- "ER_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML";
- public static final String ER_PROCESSINGINSTRUCTION_NOTVALID_NCNAME =
- "ER_PROCESSINGINSTRUCTION_NOTVALID_NCNAME";
- public static final String ER_NEED_MATCH_ATTRIB = "ER_NEED_MATCH_ATTRIB";
- public static final String ER_NEED_NAME_OR_MATCH_ATTRIB =
- "ER_NEED_NAME_OR_MATCH_ATTRIB";
- public static final String ER_CANT_RESOLVE_NSPREFIX =
- "ER_CANT_RESOLVE_NSPREFIX";
- public static final String ER_ILLEGAL_VALUE = "ER_ILLEGAL_VALUE";
- public static final String ER_NO_OWNERDOC = "ER_NO_OWNERDOC";
- public static final String ER_ELEMTEMPLATEELEM_ERR ="ER_ELEMTEMPLATEELEM_ERR";
- public static final String ER_NULL_CHILD = "ER_NULL_CHILD";
- public static final String ER_NEED_SELECT_ATTRIB = "ER_NEED_SELECT_ATTRIB";
- public static final String ER_NEED_TEST_ATTRIB = "ER_NEED_TEST_ATTRIB";
- public static final String ER_NEED_NAME_ATTRIB = "ER_NEED_NAME_ATTRIB";
- public static final String ER_NO_CONTEXT_OWNERDOC = "ER_NO_CONTEXT_OWNERDOC";
- public static final String ER_COULD_NOT_CREATE_XML_PROC_LIAISON =
- "ER_COULD_NOT_CREATE_XML_PROC_LIAISON";
- public static final String ER_PROCESS_NOT_SUCCESSFUL =
- "ER_PROCESS_NOT_SUCCESSFUL";
- public static final String ER_NOT_SUCCESSFUL = "ER_NOT_SUCCESSFUL";
- public static final String ER_ENCODING_NOT_SUPPORTED =
- "ER_ENCODING_NOT_SUPPORTED";
- public static final String ER_COULD_NOT_CREATE_TRACELISTENER =
- "ER_COULD_NOT_CREATE_TRACELISTENER";
- public static final String ER_KEY_REQUIRES_NAME_ATTRIB =
- "ER_KEY_REQUIRES_NAME_ATTRIB";
- public static final String ER_KEY_REQUIRES_MATCH_ATTRIB =
- "ER_KEY_REQUIRES_MATCH_ATTRIB";
- public static final String ER_KEY_REQUIRES_USE_ATTRIB =
- "ER_KEY_REQUIRES_USE_ATTRIB";
- public static final String ER_REQUIRES_ELEMENTS_ATTRIB =
- "ER_REQUIRES_ELEMENTS_ATTRIB";
- public static final String ER_MISSING_PREFIX_ATTRIB =
- "ER_MISSING_PREFIX_ATTRIB";
- public static final String ER_BAD_STYLESHEET_URL = "ER_BAD_STYLESHEET_URL";
- public static final String ER_FILE_NOT_FOUND = "ER_FILE_NOT_FOUND";
- public static final String ER_IOEXCEPTION = "ER_IOEXCEPTION";
- public static final String ER_NO_HREF_ATTRIB = "ER_NO_HREF_ATTRIB";
- public static final String ER_STYLESHEET_INCLUDES_ITSELF =
- "ER_STYLESHEET_INCLUDES_ITSELF";
- public static final String ER_PROCESSINCLUDE_ERROR ="ER_PROCESSINCLUDE_ERROR";
- public static final String ER_MISSING_LANG_ATTRIB = "ER_MISSING_LANG_ATTRIB";
- public static final String ER_MISSING_CONTAINER_ELEMENT_COMPONENT =
- "ER_MISSING_CONTAINER_ELEMENT_COMPONENT";
- public static final String ER_CAN_ONLY_OUTPUT_TO_ELEMENT =
- "ER_CAN_ONLY_OUTPUT_TO_ELEMENT";
- public static final String ER_PROCESS_ERROR = "ER_PROCESS_ERROR";
- public static final String ER_UNIMPLNODE_ERROR = "ER_UNIMPLNODE_ERROR";
- public static final String ER_NO_SELECT_EXPRESSION ="ER_NO_SELECT_EXPRESSION";
- public static final String ER_CANNOT_SERIALIZE_XSLPROCESSOR =
- "ER_CANNOT_SERIALIZE_XSLPROCESSOR";
- public static final String ER_NO_INPUT_STYLESHEET = "ER_NO_INPUT_STYLESHEET";
- public static final String ER_FAILED_PROCESS_STYLESHEET =
- "ER_FAILED_PROCESS_STYLESHEET";
- public static final String ER_COULDNT_PARSE_DOC = "ER_COULDNT_PARSE_DOC";
- public static final String ER_COULDNT_FIND_FRAGMENT =
- "ER_COULDNT_FIND_FRAGMENT";
- public static final String ER_NODE_NOT_ELEMENT = "ER_NODE_NOT_ELEMENT";
- public static final String ER_FOREACH_NEED_MATCH_OR_NAME_ATTRIB =
- "ER_FOREACH_NEED_MATCH_OR_NAME_ATTRIB";
- public static final String ER_TEMPLATES_NEED_MATCH_OR_NAME_ATTRIB =
- "ER_TEMPLATES_NEED_MATCH_OR_NAME_ATTRIB";
- public static final String ER_NO_CLONE_OF_DOCUMENT_FRAG =
- "ER_NO_CLONE_OF_DOCUMENT_FRAG";
- public static final String ER_CANT_CREATE_ITEM = "ER_CANT_CREATE_ITEM";
- public static final String ER_XMLSPACE_ILLEGAL_VALUE =
- "ER_XMLSPACE_ILLEGAL_VALUE";
- public static final String ER_NO_XSLKEY_DECLARATION =
- "ER_NO_XSLKEY_DECLARATION";
- public static final String ER_CANT_CREATE_URL = "ER_CANT_CREATE_URL";
- public static final String ER_XSLFUNCTIONS_UNSUPPORTED =
- "ER_XSLFUNCTIONS_UNSUPPORTED";
- public static final String ER_PROCESSOR_ERROR = "ER_PROCESSOR_ERROR";
- public static final String ER_NOT_ALLOWED_INSIDE_STYLESHEET =
- "ER_NOT_ALLOWED_INSIDE_STYLESHEET";
- public static final String ER_RESULTNS_NOT_SUPPORTED =
- "ER_RESULTNS_NOT_SUPPORTED";
- public static final String ER_DEFAULTSPACE_NOT_SUPPORTED =
- "ER_DEFAULTSPACE_NOT_SUPPORTED";
- public static final String ER_INDENTRESULT_NOT_SUPPORTED =
- "ER_INDENTRESULT_NOT_SUPPORTED";
- public static final String ER_ILLEGAL_ATTRIB = "ER_ILLEGAL_ATTRIB";
- public static final String ER_UNKNOWN_XSL_ELEM = "ER_UNKNOWN_XSL_ELEM";
- public static final String ER_BAD_XSLSORT_USE = "ER_BAD_XSLSORT_USE";
- public static final String ER_MISPLACED_XSLWHEN = "ER_MISPLACED_XSLWHEN";
- public static final String ER_XSLWHEN_NOT_PARENTED_BY_XSLCHOOSE =
- "ER_XSLWHEN_NOT_PARENTED_BY_XSLCHOOSE";
- public static final String ER_MISPLACED_XSLOTHERWISE =
- "ER_MISPLACED_XSLOTHERWISE";
- public static final String ER_XSLOTHERWISE_NOT_PARENTED_BY_XSLCHOOSE =
- "ER_XSLOTHERWISE_NOT_PARENTED_BY_XSLCHOOSE";
- public static final String ER_NOT_ALLOWED_INSIDE_TEMPLATE =
- "ER_NOT_ALLOWED_INSIDE_TEMPLATE";
- public static final String ER_UNKNOWN_EXT_NS_PREFIX =
- "ER_UNKNOWN_EXT_NS_PREFIX";
- public static final String ER_IMPORTS_AS_FIRST_ELEM =
- "ER_IMPORTS_AS_FIRST_ELEM";
- public static final String ER_IMPORTING_ITSELF = "ER_IMPORTING_ITSELF";
- public static final String ER_XMLSPACE_ILLEGAL_VAL ="ER_XMLSPACE_ILLEGAL_VAL";
- public static final String ER_PROCESSSTYLESHEET_NOT_SUCCESSFUL =
- "ER_PROCESSSTYLESHEET_NOT_SUCCESSFUL";
- public static final String ER_SAX_EXCEPTION = "ER_SAX_EXCEPTION";
- public static final String ER_XSLT_ERROR = "ER_XSLT_ERROR";
- public static final String ER_CURRENCY_SIGN_ILLEGAL=
- "ER_CURRENCY_SIGN_ILLEGAL";
- public static final String ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM =
- "ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM";
- public static final String ER_CANT_RESOLVE_PREFIX_OF_NON_PREFIX_RESOLVER =
- "ER_CANT_RESOLVE_PREFIX_OF_NON_PREFIX_RESOLVER";
- public static final String ER_REDIRECT_COULDNT_GET_FILENAME =
- "ER_REDIRECT_COULDNT_GET_FILENAME";
- public static final String ER_CANNOT_BUILD_FORMATTERLISTENER_IN_REDIRECT =
- "ER_CANNOT_BUILD_FORMATTERLISTENER_IN_REDIRECT";
- public static final String ER_INVALID_PREFIX_IN_EXCLUDERESULTPREFIX =
- "ER_INVALID_PREFIX_IN_EXCLUDERESULTPREFIX";
- public static final String ER_MISSING_NS_URI = "ER_MISSING_NS_URI";
- public static final String ER_MISSING_ARG_FOR_OPTION =
- "ER_MISSING_ARG_FOR_OPTION";
- public static final String ER_INVALID_OPTION = "ER_INVALID_OPTION";
- public static final String ER_MALFORMED_FORMAT_STRING =
- "ER_MALFORMED_FORMAT_STRING";
- public static final String ER_STYLESHEET_REQUIRES_VERSION_ATTRIB =
- "ER_STYLESHEET_REQUIRES_VERSION_ATTRIB";
- public static final String ER_ILLEGAL_ATTRIBUTE_VALUE =
- "ER_ILLEGAL_ATTRIBUTE_VALUE";
- public static final String ER_CHOOSE_REQUIRES_WHEN ="ER_CHOOSE_REQUIRES_WHEN";
- public static final String ER_NO_APPLY_IMPORT_IN_FOR_EACH =
- "ER_NO_APPLY_IMPORT_IN_FOR_EACH";
- public static final String ER_CANT_USE_DTM_FOR_OUTPUT =
- "ER_CANT_USE_DTM_FOR_OUTPUT";
- public static final String ER_CANT_USE_DTM_FOR_INPUT =
- "ER_CANT_USE_DTM_FOR_INPUT";
- public static final String ER_CALL_TO_EXT_FAILED = "ER_CALL_TO_EXT_FAILED";
- public static final String ER_PREFIX_MUST_RESOLVE = "ER_PREFIX_MUST_RESOLVE";
- public static final String ER_INVALID_UTF16_SURROGATE =
- "ER_INVALID_UTF16_SURROGATE";
- public static final String ER_XSLATTRSET_USED_ITSELF =
- "ER_XSLATTRSET_USED_ITSELF";
- public static final String ER_CANNOT_MIX_XERCESDOM ="ER_CANNOT_MIX_XERCESDOM";
- public static final String ER_TOO_MANY_LISTENERS = "ER_TOO_MANY_LISTENERS";
- public static final String ER_IN_ELEMTEMPLATEELEM_READOBJECT =
- "ER_IN_ELEMTEMPLATEELEM_READOBJECT";
- public static final String ER_DUPLICATE_NAMED_TEMPLATE =
- "ER_DUPLICATE_NAMED_TEMPLATE";
- public static final String ER_INVALID_KEY_CALL = "ER_INVALID_KEY_CALL";
- public static final String ER_REFERENCING_ITSELF = "ER_REFERENCING_ITSELF";
- public static final String ER_ILLEGAL_DOMSOURCE_INPUT =
- "ER_ILLEGAL_DOMSOURCE_INPUT";
- public static final String ER_CLASS_NOT_FOUND_FOR_OPTION =
- "ER_CLASS_NOT_FOUND_FOR_OPTION";
- public static final String ER_REQUIRED_ELEM_NOT_FOUND =
- "ER_REQUIRED_ELEM_NOT_FOUND";
- public static final String ER_INPUT_CANNOT_BE_NULL ="ER_INPUT_CANNOT_BE_NULL";
- public static final String ER_URI_CANNOT_BE_NULL = "ER_URI_CANNOT_BE_NULL";
- public static final String ER_FILE_CANNOT_BE_NULL = "ER_FILE_CANNOT_BE_NULL";
- public static final String ER_SOURCE_CANNOT_BE_NULL =
- "ER_SOURCE_CANNOT_BE_NULL";
- public static final String ER_CANNOT_INIT_BSFMGR = "ER_CANNOT_INIT_BSFMGR";
- public static final String ER_CANNOT_CMPL_EXTENSN = "ER_CANNOT_CMPL_EXTENSN";
- public static final String ER_CANNOT_CREATE_EXTENSN =
- "ER_CANNOT_CREATE_EXTENSN";
- public static final String ER_INSTANCE_MTHD_CALL_REQUIRES =
- "ER_INSTANCE_MTHD_CALL_REQUIRES";
- public static final String ER_INVALID_ELEMENT_NAME ="ER_INVALID_ELEMENT_NAME";
- public static final String ER_ELEMENT_NAME_METHOD_STATIC =
- "ER_ELEMENT_NAME_METHOD_STATIC";
- public static final String ER_EXTENSION_FUNC_UNKNOWN =
- "ER_EXTENSION_FUNC_UNKNOWN";
- public static final String ER_MORE_MATCH_CONSTRUCTOR =
- "ER_MORE_MATCH_CONSTRUCTOR";
- public static final String ER_MORE_MATCH_METHOD = "ER_MORE_MATCH_METHOD";
- public static final String ER_MORE_MATCH_ELEMENT = "ER_MORE_MATCH_ELEMENT";
- public static final String ER_INVALID_CONTEXT_PASSED =
- "ER_INVALID_CONTEXT_PASSED";
- public static final String ER_POOL_EXISTS = "ER_POOL_EXISTS";
- public static final String ER_NO_DRIVER_NAME = "ER_NO_DRIVER_NAME";
- public static final String ER_NO_URL = "ER_NO_URL";
- public static final String ER_POOL_SIZE_LESSTHAN_ONE =
- "ER_POOL_SIZE_LESSTHAN_ONE";
- public static final String ER_INVALID_DRIVER = "ER_INVALID_DRIVER";
- public static final String ER_NO_STYLESHEETROOT = "ER_NO_STYLESHEETROOT";
- public static final String ER_ILLEGAL_XMLSPACE_VALUE =
- "ER_ILLEGAL_XMLSPACE_VALUE";
- public static final String ER_PROCESSFROMNODE_FAILED =
- "ER_PROCESSFROMNODE_FAILED";
- public static final String ER_RESOURCE_COULD_NOT_LOAD =
- "ER_RESOURCE_COULD_NOT_LOAD";
- public static final String ER_BUFFER_SIZE_LESSTHAN_ZERO =
- "ER_BUFFER_SIZE_LESSTHAN_ZERO";
- public static final String ER_UNKNOWN_ERROR_CALLING_EXTENSION =
- "ER_UNKNOWN_ERROR_CALLING_EXTENSION";
- public static final String ER_NO_NAMESPACE_DECL = "ER_NO_NAMESPACE_DECL";
- public static final String ER_ELEM_CONTENT_NOT_ALLOWED =
- "ER_ELEM_CONTENT_NOT_ALLOWED";
- public static final String ER_STYLESHEET_DIRECTED_TERMINATION =
- "ER_STYLESHEET_DIRECTED_TERMINATION";
- public static final String ER_ONE_OR_TWO = "ER_ONE_OR_TWO";
- public static final String ER_TWO_OR_THREE = "ER_TWO_OR_THREE";
- public static final String ER_COULD_NOT_LOAD_RESOURCE =
- "ER_COULD_NOT_LOAD_RESOURCE";
- public static final String ER_CANNOT_INIT_DEFAULT_TEMPLATES =
- "ER_CANNOT_INIT_DEFAULT_TEMPLATES";
- public static final String ER_RESULT_NULL = "ER_RESULT_NULL";
- public static final String ER_RESULT_COULD_NOT_BE_SET =
- "ER_RESULT_COULD_NOT_BE_SET";
- public static final String ER_NO_OUTPUT_SPECIFIED = "ER_NO_OUTPUT_SPECIFIED";
- public static final String ER_CANNOT_TRANSFORM_TO_RESULT_TYPE =
- "ER_CANNOT_TRANSFORM_TO_RESULT_TYPE";
- public static final String ER_CANNOT_TRANSFORM_SOURCE_TYPE =
- "ER_CANNOT_TRANSFORM_SOURCE_TYPE";
- public static final String ER_NULL_CONTENT_HANDLER ="ER_NULL_CONTENT_HANDLER";
- public static final String ER_NULL_ERROR_HANDLER = "ER_NULL_ERROR_HANDLER";
- public static final String ER_CANNOT_CALL_PARSE = "ER_CANNOT_CALL_PARSE";
- public static final String ER_NO_PARENT_FOR_FILTER ="ER_NO_PARENT_FOR_FILTER";
- public static final String ER_NO_STYLESHEET_IN_MEDIA =
- "ER_NO_STYLESHEET_IN_MEDIA";
- public static final String ER_NO_STYLESHEET_PI = "ER_NO_STYLESHEET_PI";
- public static final String ER_NOT_SUPPORTED = "ER_NOT_SUPPORTED";
- public static final String ER_PROPERTY_VALUE_BOOLEAN =
- "ER_PROPERTY_VALUE_BOOLEAN";
- public static final String ER_COULD_NOT_FIND_EXTERN_SCRIPT =
- "ER_COULD_NOT_FIND_EXTERN_SCRIPT";
- public static final String ER_RESOURCE_COULD_NOT_FIND =
- "ER_RESOURCE_COULD_NOT_FIND";
- public static final String ER_OUTPUT_PROPERTY_NOT_RECOGNIZED =
- "ER_OUTPUT_PROPERTY_NOT_RECOGNIZED";
- public static final String ER_FAILED_CREATING_ELEMLITRSLT =
- "ER_FAILED_CREATING_ELEMLITRSLT";
- public static final String ER_VALUE_SHOULD_BE_NUMBER =
- "ER_VALUE_SHOULD_BE_NUMBER";
- public static final String ER_VALUE_SHOULD_EQUAL = "ER_VALUE_SHOULD_EQUAL";
- public static final String ER_FAILED_CALLING_METHOD =
- "ER_FAILED_CALLING_METHOD";
- public static final String ER_FAILED_CREATING_ELEMTMPL =
- "ER_FAILED_CREATING_ELEMTMPL";
- public static final String ER_CHARS_NOT_ALLOWED = "ER_CHARS_NOT_ALLOWED";
- public static final String ER_ATTR_NOT_ALLOWED = "ER_ATTR_NOT_ALLOWED";
- public static final String ER_BAD_VALUE = "ER_BAD_VALUE";
- public static final String ER_ATTRIB_VALUE_NOT_FOUND =
- "ER_ATTRIB_VALUE_NOT_FOUND";
- public static final String ER_ATTRIB_VALUE_NOT_RECOGNIZED =
- "ER_ATTRIB_VALUE_NOT_RECOGNIZED";
- public static final String ER_NULL_URI_NAMESPACE = "ER_NULL_URI_NAMESPACE";
- public static final String ER_NUMBER_TOO_BIG = "ER_NUMBER_TOO_BIG";
- public static final String ER_CANNOT_FIND_SAX1_DRIVER =
- "ER_CANNOT_FIND_SAX1_DRIVER";
- public static final String ER_SAX1_DRIVER_NOT_LOADED =
- "ER_SAX1_DRIVER_NOT_LOADED";
- public static final String ER_SAX1_DRIVER_NOT_INSTANTIATED =
- "ER_SAX1_DRIVER_NOT_INSTANTIATED" ;
- public static final String ER_SAX1_DRIVER_NOT_IMPLEMENT_PARSER =
- "ER_SAX1_DRIVER_NOT_IMPLEMENT_PARSER";
- public static final String ER_PARSER_PROPERTY_NOT_SPECIFIED =
- "ER_PARSER_PROPERTY_NOT_SPECIFIED";
- public static final String ER_PARSER_ARG_CANNOT_BE_NULL =
- "ER_PARSER_ARG_CANNOT_BE_NULL" ;
- public static final String ER_FEATURE = "ER_FEATURE";
- public static final String ER_PROPERTY = "ER_PROPERTY" ;
- public static final String ER_NULL_ENTITY_RESOLVER ="ER_NULL_ENTITY_RESOLVER";
- public static final String ER_NULL_DTD_HANDLER = "ER_NULL_DTD_HANDLER" ;
- public static final String ER_NO_DRIVER_NAME_SPECIFIED =
- "ER_NO_DRIVER_NAME_SPECIFIED";
- public static final String ER_NO_URL_SPECIFIED = "ER_NO_URL_SPECIFIED";
- public static final String ER_POOLSIZE_LESS_THAN_ONE =
- "ER_POOLSIZE_LESS_THAN_ONE";
- public static final String ER_INVALID_DRIVER_NAME = "ER_INVALID_DRIVER_NAME";
- public static final String ER_ERRORLISTENER = "ER_ERRORLISTENER";
- public static final String ER_ASSERT_NO_TEMPLATE_PARENT =
- "ER_ASSERT_NO_TEMPLATE_PARENT";
- public static final String ER_ASSERT_REDUNDENT_EXPR_ELIMINATOR =
- "ER_ASSERT_REDUNDENT_EXPR_ELIMINATOR";
- public static final String ER_NOT_ALLOWED_IN_POSITION =
- "ER_NOT_ALLOWED_IN_POSITION";
- public static final String ER_NONWHITESPACE_NOT_ALLOWED_IN_POSITION =
- "ER_NONWHITESPACE_NOT_ALLOWED_IN_POSITION";
- public static final String ER_NAMESPACE_CONTEXT_NULL_NAMESPACE =
- "ER_NAMESPACE_CONTEXT_NULL_NAMESPACE";
- public static final String ER_NAMESPACE_CONTEXT_NULL_PREFIX =
- "ER_NAMESPACE_CONTEXT_NULL_PREFIX";
- public static final String ER_XPATH_RESOLVER_NULL_QNAME =
- "ER_XPATH_RESOLVER_NULL_QNAME";
- public static final String ER_XPATH_RESOLVER_NEGATIVE_ARITY =
- "ER_XPATH_RESOLVER_NEGATIVE_ARITY";
- public static final String INVALID_TCHAR = "INVALID_TCHAR";
- public static final String INVALID_QNAME = "INVALID_QNAME";
- public static final String INVALID_ENUM = "INVALID_ENUM";
- public static final String INVALID_NMTOKEN = "INVALID_NMTOKEN";
- public static final String INVALID_NCNAME = "INVALID_NCNAME";
- public static final String INVALID_BOOLEAN = "INVALID_BOOLEAN";
- public static final String INVALID_NUMBER = "INVALID_NUMBER";
- public static final String ER_ARG_LITERAL = "ER_ARG_LITERAL";
- public static final String ER_DUPLICATE_GLOBAL_VAR ="ER_DUPLICATE_GLOBAL_VAR";
- public static final String ER_DUPLICATE_VAR = "ER_DUPLICATE_VAR";
- public static final String ER_TEMPLATE_NAME_MATCH = "ER_TEMPLATE_NAME_MATCH";
- public static final String ER_INVALID_PREFIX = "ER_INVALID_PREFIX";
- public static final String ER_NO_ATTRIB_SET = "ER_NO_ATTRIB_SET";
- public static final String ER_FUNCTION_NOT_FOUND =
- "ER_FUNCTION_NOT_FOUND";
- public static final String ER_CANT_HAVE_CONTENT_AND_SELECT =
- "ER_CANT_HAVE_CONTENT_AND_SELECT";
- public static final String ER_INVALID_SET_PARAM_VALUE = "ER_INVALID_SET_PARAM_VALUE";
- public static final String ER_SET_FEATURE_NULL_NAME =
- "ER_SET_FEATURE_NULL_NAME";
- public static final String ER_GET_FEATURE_NULL_NAME =
- "ER_GET_FEATURE_NULL_NAME";
- public static final String ER_UNSUPPORTED_FEATURE =
- "ER_UNSUPPORTED_FEATURE";
- public static final String ER_EXTENSION_ELEMENT_NOT_ALLOWED_IN_SECURE_PROCESSING =
- "ER_EXTENSION_ELEMENT_NOT_ALLOWED_IN_SECURE_PROCESSING";
-
- public static final String WG_FOUND_CURLYBRACE = "WG_FOUND_CURLYBRACE";
- public static final String WG_COUNT_ATTRIB_MATCHES_NO_ANCESTOR =
- "WG_COUNT_ATTRIB_MATCHES_NO_ANCESTOR";
- public static final String WG_EXPR_ATTRIB_CHANGED_TO_SELECT =
- "WG_EXPR_ATTRIB_CHANGED_TO_SELECT";
- public static final String WG_NO_LOCALE_IN_FORMATNUMBER =
- "WG_NO_LOCALE_IN_FORMATNUMBER";
- public static final String WG_LOCALE_NOT_FOUND = "WG_LOCALE_NOT_FOUND";
- public static final String WG_CANNOT_MAKE_URL_FROM ="WG_CANNOT_MAKE_URL_FROM";
- public static final String WG_CANNOT_LOAD_REQUESTED_DOC =
- "WG_CANNOT_LOAD_REQUESTED_DOC";
- public static final String WG_CANNOT_FIND_COLLATOR ="WG_CANNOT_FIND_COLLATOR";
- public static final String WG_FUNCTIONS_SHOULD_USE_URL =
- "WG_FUNCTIONS_SHOULD_USE_URL";
- public static final String WG_ENCODING_NOT_SUPPORTED_USING_UTF8 =
- "WG_ENCODING_NOT_SUPPORTED_USING_UTF8";
- public static final String WG_ENCODING_NOT_SUPPORTED_USING_JAVA =
- "WG_ENCODING_NOT_SUPPORTED_USING_JAVA";
- public static final String WG_SPECIFICITY_CONFLICTS =
- "WG_SPECIFICITY_CONFLICTS";
- public static final String WG_PARSING_AND_PREPARING =
- "WG_PARSING_AND_PREPARING";
- public static final String WG_ATTR_TEMPLATE = "WG_ATTR_TEMPLATE";
- public static final String WG_CONFLICT_BETWEEN_XSLSTRIPSPACE_AND_XSLPRESERVESPACE = "WG_CONFLICT_BETWEEN_XSLSTRIPSPACE_AND_XSLPRESERVESP";
- public static final String WG_ATTRIB_NOT_HANDLED = "WG_ATTRIB_NOT_HANDLED";
- public static final String WG_NO_DECIMALFORMAT_DECLARATION =
- "WG_NO_DECIMALFORMAT_DECLARATION";
- public static final String WG_OLD_XSLT_NS = "WG_OLD_XSLT_NS";
- public static final String WG_ONE_DEFAULT_XSLDECIMALFORMAT_ALLOWED =
- "WG_ONE_DEFAULT_XSLDECIMALFORMAT_ALLOWED";
- public static final String WG_XSLDECIMALFORMAT_NAMES_MUST_BE_UNIQUE =
- "WG_XSLDECIMALFORMAT_NAMES_MUST_BE_UNIQUE";
- public static final String WG_ILLEGAL_ATTRIBUTE = "WG_ILLEGAL_ATTRIBUTE";
- public static final String WG_COULD_NOT_RESOLVE_PREFIX =
- "WG_COULD_NOT_RESOLVE_PREFIX";
- public static final String WG_STYLESHEET_REQUIRES_VERSION_ATTRIB =
- "WG_STYLESHEET_REQUIRES_VERSION_ATTRIB";
- public static final String WG_ILLEGAL_ATTRIBUTE_NAME =
- "WG_ILLEGAL_ATTRIBUTE_NAME";
- public static final String WG_ILLEGAL_ATTRIBUTE_VALUE =
- "WG_ILLEGAL_ATTRIBUTE_VALUE";
- public static final String WG_EMPTY_SECOND_ARG = "WG_EMPTY_SECOND_ARG";
- public static final String WG_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML =
- "WG_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML";
- public static final String WG_PROCESSINGINSTRUCTION_NOTVALID_NCNAME =
- "WG_PROCESSINGINSTRUCTION_NOTVALID_NCNAME";
- public static final String WG_ILLEGAL_ATTRIBUTE_POSITION =
- "WG_ILLEGAL_ATTRIBUTE_POSITION";
- public static final String NO_MODIFICATION_ALLOWED_ERR =
- "NO_MODIFICATION_ALLOWED_ERR";
-
- /*
- * Now fill in the message text.
- * Then fill in the message text for that message code in the
- * array. Use the new error code as the index into the array.
- */
-
- // Error messages...
-
- /** Get the lookup table for error messages.
- *
- * @return The message lookup table.
- */
- public Object[][] getContents()
- {
- return new Object[][] {
-
- /** Error message ID that has a null message, but takes in a single object. */
- {"ER0000" , "{0}" },
-
- { ER_NO_CURLYBRACE,
- "Erro: N\u00E3o \u00E9 poss\u00EDvel utilizar ''{'' na express\u00E3o"},
-
- { ER_ILLEGAL_ATTRIBUTE ,
- "{0} tem um atributo inv\u00E1lido: {1}"},
-
- {ER_NULL_SOURCENODE_APPLYIMPORTS ,
- "sourceNode \u00E9 nulo em xsl:apply-imports!"},
-
- {ER_CANNOT_ADD,
- "N\u00E3o \u00E9 poss\u00EDvel adicionar {0} a {1}"},
-
- { ER_NULL_SOURCENODE_HANDLEAPPLYTEMPLATES,
- "sourceNode \u00E9 nulo em handleApplyTemplatesInstruction!"},
-
- { ER_NO_NAME_ATTRIB,
- "{0} deve ter um atributo de nome."},
-
- {ER_TEMPLATE_NOT_FOUND,
- "N\u00E3o foi poss\u00EDvel localizar o modelo com o nome: {0}"},
-
- {ER_CANT_RESOLVE_NAME_AVT,
- "N\u00E3o foi poss\u00EDvel resolver o nome AVT em xsl:call-template."},
-
- {ER_REQUIRES_ATTRIB,
- "{0} requer o atributo: {1}"},
-
- { ER_MUST_HAVE_TEST_ATTRIB,
- "{0} deve ter um atributo ''test''."},
-
- {ER_BAD_VAL_ON_LEVEL_ATTRIB,
- "Valor inv\u00E1lido no atributo de n\u00EDvel: {0}"},
-
- {ER_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML,
- "o nome da instru\u00E7\u00E3o de processamento n\u00E3o pode ser 'xml'"},
-
- { ER_PROCESSINGINSTRUCTION_NOTVALID_NCNAME,
- "o nome da instru\u00E7\u00E3o de processamento deve ser um NCName v\u00E1lido: {0}"},
-
- { ER_NEED_MATCH_ATTRIB,
- "{0} deve ter um atributo de correspond\u00EAncia se tiver um modo."},
-
- { ER_NEED_NAME_OR_MATCH_ATTRIB,
- "{0} requer um atributo de nome ou de correspond\u00EAncia."},
-
- {ER_CANT_RESOLVE_NSPREFIX,
- "N\u00E3o \u00E9 poss\u00EDvel resolver o prefixo do namespace: {0}"},
-
- { ER_ILLEGAL_VALUE,
- "xml:space tem um valor inv\u00E1lido: {0}"},
-
- { ER_NO_OWNERDOC,
- "O n\u00F3 filho n\u00E3o tem um documento de propriet\u00E1rio!"},
-
- { ER_ELEMTEMPLATEELEM_ERR,
- "Erro de ElemTemplateElement: {0}"},
-
- { ER_NULL_CHILD,
- "Tentativa de adicionar um filho nulo!"},
-
- { ER_NEED_SELECT_ATTRIB,
- "{0} requer um atributo de sele\u00E7\u00E3o."},
-
- { ER_NEED_TEST_ATTRIB ,
- "xsl:when deve ter um atributo 'test'."},
-
- { ER_NEED_NAME_ATTRIB,
- "xsl:with-param deve ter um atributo 'name'."},
-
- { ER_NO_CONTEXT_OWNERDOC,
- "o contexto n\u00E3o tem um documento de propriet\u00E1rio!"},
-
- {ER_COULD_NOT_CREATE_XML_PROC_LIAISON,
- "N\u00E3o foi poss\u00EDvel criar a Liga\u00E7\u00E3o TransformerFactory XML: {0}"},
-
- {ER_PROCESS_NOT_SUCCESSFUL,
- "Xalan: O processo n\u00E3o foi bem-sucedido."},
-
- { ER_NOT_SUCCESSFUL,
- "Xalan: N\u00E3o foi bem-sucedido."},
-
- { ER_ENCODING_NOT_SUPPORTED,
- "Codifica\u00E7\u00E3o n\u00E3o suportada: {0}"},
-
- {ER_COULD_NOT_CREATE_TRACELISTENER,
- "N\u00E3o foi poss\u00EDvel criar TraceListener: {0}"},
-
- {ER_KEY_REQUIRES_NAME_ATTRIB,
- "xsl:key requer um atributo 'name'!"},
-
- { ER_KEY_REQUIRES_MATCH_ATTRIB,
- "xsl:key requer um atributo 'match'!"},
-
- { ER_KEY_REQUIRES_USE_ATTRIB,
- "xsl:key requer um atributo 'use'!"},
-
- { ER_REQUIRES_ELEMENTS_ATTRIB,
- "(StylesheetHandler) {0} requer um atributo ''elements''!"},
-
- { ER_MISSING_PREFIX_ATTRIB,
- "(StylesheetHandler) o atributo ''prefix'' de {0} n\u00E3o foi encontrado"},
-
- { ER_BAD_STYLESHEET_URL,
- "O URL da Folha de Estilos est\u00E1 incorreto: {0}"},
-
- { ER_FILE_NOT_FOUND,
- "O arquivo da folha de estilos n\u00E3o foi encontrado: {0}"},
-
- { ER_IOEXCEPTION,
- "Exce\u00E7\u00E3o de E/S com o arquivo de folha de estilos: {0}"},
-
- { ER_NO_HREF_ATTRIB,
- "(StylesheetHandler) N\u00E3o foi poss\u00EDvel encontrar o atributo href para {0}"},
-
- { ER_STYLESHEET_INCLUDES_ITSELF,
- "(StylesheetHandler) A folha de estilos {0} est\u00E1 incluindo a si mesma direta ou indiretamente!"},
-
- { ER_PROCESSINCLUDE_ERROR,
- "Erro de StylesheetHandler.processInclude: {0}"},
-
- { ER_MISSING_LANG_ATTRIB,
- "(StylesheetHandler) O atributo ''lang'' de {0} n\u00E3o foi encontrado"},
-
- { ER_MISSING_CONTAINER_ELEMENT_COMPONENT,
- "(StylesheetHandler) elemento {0} incorretamente posicionado?? Elemento ''component'' do container n\u00E3o encontrado"},
-
- { ER_CAN_ONLY_OUTPUT_TO_ELEMENT,
- "Sa\u00EDda permitida somente para Element, DocumentFragment, Document ou PrintWriter."},
-
- { ER_PROCESS_ERROR,
- "Erro de StylesheetRoot.process"},
-
- { ER_UNIMPLNODE_ERROR,
- "Erro de UnImplNode: {0}"},
-
- { ER_NO_SELECT_EXPRESSION,
- "Erro! N\u00E3o foi poss\u00EDvel localizar a express\u00E3o de sele\u00E7\u00E3o xpath (-select)."},
-
- { ER_CANNOT_SERIALIZE_XSLPROCESSOR,
- "N\u00E3o \u00E9 poss\u00EDvel serializar um XSLProcessor!"},
-
- { ER_NO_INPUT_STYLESHEET,
- "A entrada da folha de estilos n\u00E3o foi especificada!"},
-
- { ER_FAILED_PROCESS_STYLESHEET,
- "Falha ao processar a folha de estilos!"},
-
- { ER_COULDNT_PARSE_DOC,
- "N\u00E3o foi poss\u00EDvel fazer parsing do documento {0}!"},
-
- { ER_COULDNT_FIND_FRAGMENT,
- "N\u00E3o foi poss\u00EDvel localizar o fragmento: {0}"},
-
- { ER_NODE_NOT_ELEMENT,
- "O n\u00F3 indicado pelo identificador de fragmento n\u00E3o era um elemento: {0}"},
-
- { ER_FOREACH_NEED_MATCH_OR_NAME_ATTRIB,
- "for-each deve ter um atributo de correspond\u00EAncia ou de nome"},
-
- { ER_TEMPLATES_NEED_MATCH_OR_NAME_ATTRIB,
- "os modelos devem ter um atributo de correspond\u00EAncia ou de nome"},
-
- { ER_NO_CLONE_OF_DOCUMENT_FRAG,
- "N\u00E3o h\u00E1 clone de um fragmento de documento!"},
-
- { ER_CANT_CREATE_ITEM,
- "N\u00E3o \u00E9 poss\u00EDvel criar um item em uma \u00E1rvore de resultados: {0}"},
-
- { ER_XMLSPACE_ILLEGAL_VALUE,
- "xml:space no XML de origem tem um valor inv\u00E1lido: {0}"},
-
- { ER_NO_XSLKEY_DECLARATION,
- "N\u00E3o h\u00E1 uma declara\u00E7\u00E3o de xsl:key para {0}!"},
-
- { ER_CANT_CREATE_URL,
- "Erro! N\u00E3o \u00E9 poss\u00EDvel criar o url para: {0}"},
-
- { ER_XSLFUNCTIONS_UNSUPPORTED,
- "xsl:functions n\u00E3o \u00E9 suportado"},
-
- { ER_PROCESSOR_ERROR,
- "Erro de TransformerFactory XSLT"},
-
- { ER_NOT_ALLOWED_INSIDE_STYLESHEET,
- "(StylesheetHandler) {0} n\u00E3o \u00E9 permitido em uma folha de estilos!"},
-
- { ER_RESULTNS_NOT_SUPPORTED,
- "result-ns n\u00E3o \u00E9 mais suportado! Em vez disso, use xsl:output."},
-
- { ER_DEFAULTSPACE_NOT_SUPPORTED,
- "padr\u00E3o-space n\u00E3o \u00E9 mais suportado! Em vez disso, use xsl:strip-space ou xsl:preserve-space."},
-
- { ER_INDENTRESULT_NOT_SUPPORTED,
- "indent-result n\u00E3o \u00E9 mais suportado! Em vez disso, use xsl:output."},
-
- { ER_ILLEGAL_ATTRIB,
- "(StylesheetHandler) {0} tem um atributo inv\u00E1lido: {1}"},
-
- { ER_UNKNOWN_XSL_ELEM,
- "Elemento XSL desconhecido: {0}"},
-
- { ER_BAD_XSLSORT_USE,
- "(StylesheetHandler) xsl:sort s\u00F3 pode ser usado com xsl:apply-templates ou xsl:for-each."},
-
- { ER_MISPLACED_XSLWHEN,
- "(StylesheetHandler) xsl:when posicionado incorretamente!"},
-
- { ER_XSLWHEN_NOT_PARENTED_BY_XSLCHOOSE,
- "(StylesheetHandler) xsl:when n\u00E3o relacionado a xsl:choose!"},
-
- { ER_MISPLACED_XSLOTHERWISE,
- "(StylesheetHandler) xsl:otherwise posicionado incorretamente!"},
-
- { ER_XSLOTHERWISE_NOT_PARENTED_BY_XSLCHOOSE,
- "(StylesheetHandler) xsl:otherwise n\u00E3o relacionado a xsl:choose!"},
-
- { ER_NOT_ALLOWED_INSIDE_TEMPLATE,
- "(StylesheetHandler) {0} n\u00E3o \u00E9 permitido em um modelo!"},
-
- { ER_UNKNOWN_EXT_NS_PREFIX,
- "(StylesheetHandler) prefixo {1} de namespace da extens\u00E3o de {0} desconhecido"},
-
- { ER_IMPORTS_AS_FIRST_ELEM,
- "(StylesheetHandler) As importa\u00E7\u00F5es s\u00F3 podem ocorrer como os primeiros elementos na folha de estilos!"},
-
- { ER_IMPORTING_ITSELF,
- "(StylesheetHandler) A folha de estilos {0} est\u00E1 importando a si mesmo(a) direta ou indiretamente!"},
-
- { ER_XMLSPACE_ILLEGAL_VAL,
- "(StylesheetHandler) xml:space tem um valor inv\u00E1lido: {0}"},
-
- { ER_PROCESSSTYLESHEET_NOT_SUCCESSFUL,
- "processStylesheet malsucedido!"},
-
- { ER_SAX_EXCEPTION,
- "Exce\u00E7\u00E3o de SAX"},
-
-// add this message to fix bug 21478
- { ER_FUNCTION_NOT_SUPPORTED,
- "Fun\u00E7\u00E3o n\u00E3o suportada!"},
-
- { ER_XSLT_ERROR,
- "Erro de XSLT"},
-
- { ER_CURRENCY_SIGN_ILLEGAL,
- "sinal de moeda n\u00E3o permitido na string de padr\u00E3o de formato"},
-
- { ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM,
- "Fun\u00E7\u00E3o do documento n\u00E3o suportada no DOM da Folha de estilos!"},
-
- { ER_CANT_RESOLVE_PREFIX_OF_NON_PREFIX_RESOLVER,
- "N\u00E3o \u00E9 poss\u00EDvel resolver o prefixo de um resolvedor sem Prefixo!"},
-
- { ER_REDIRECT_COULDNT_GET_FILENAME,
- "Redirecionar extens\u00E3o: N\u00E3o foi poss\u00EDvel obter o nome do arquivo - o arquivo ou o atributo de sele\u00E7\u00E3o deve retornar uma string v\u00E1lida."},
-
- { ER_CANNOT_BUILD_FORMATTERLISTENER_IN_REDIRECT,
- "N\u00E3o \u00E9 poss\u00EDvel criar FormatterListener na extens\u00E3o de Redirecionamento!"},
-
- { ER_INVALID_PREFIX_IN_EXCLUDERESULTPREFIX,
- "O prefixo em exclude-result-prefixes n\u00E3o \u00E9 v\u00E1lido: {0}"},
-
- { ER_MISSING_NS_URI,
- "URI do namespace n\u00E3o encontrado para o prefixo especificado"},
-
- { ER_MISSING_ARG_FOR_OPTION,
- "Argumento n\u00E3o encontrado para a op\u00E7\u00E3o: {0}"},
-
- { ER_INVALID_OPTION,
- "Op\u00E7\u00E3o inv\u00E1lida: {0}"},
-
- { ER_MALFORMED_FORMAT_STRING,
- "String de formato incorreta: {0}"},
-
- { ER_STYLESHEET_REQUIRES_VERSION_ATTRIB,
- "xsl:stylesheet requer um atributo 'version'!"},
-
- { ER_ILLEGAL_ATTRIBUTE_VALUE,
- "Atributo: {0} tem um valor inv\u00E1lido: {1}"},
-
- { ER_CHOOSE_REQUIRES_WHEN,
- "xsl:choose requer um xsl:when"},
-
- { ER_NO_APPLY_IMPORT_IN_FOR_EACH,
- "xsl:apply-imports n\u00E3o permitido em um xsl:for-each"},
-
- { ER_CANT_USE_DTM_FOR_OUTPUT,
- "N\u00E3o \u00E9 poss\u00EDvel usar um DTMLiaison para um n\u00F3 DOM de sa\u00EDda... em vez disso, especifique um com.sun.org.apache.xpath.internal.DOM2Helper!"},
-
- { ER_CANT_USE_DTM_FOR_INPUT,
- "N\u00E3o \u00E9 poss\u00EDvel usar um DTMLiaison para um n\u00F3 DOM de entrada... em vez disso, especifique um com.sun.org.apache.xpath.internal.DOM2Helper!"},
-
- { ER_CALL_TO_EXT_FAILED,
- "Falha ao chamar o elemento da extens\u00E3o: {0}"},
-
- { ER_PREFIX_MUST_RESOLVE,
- "O prefixo deve ser resolvido para um namespace: {0}"},
-
- { ER_INVALID_UTF16_SURROGATE,
- "Foi detectado um substituto de UTF-16 inv\u00E1lido: {0} ?"},
-
- { ER_XSLATTRSET_USED_ITSELF,
- "xsl:attribute-set {0} usou ele mesmo, o que causar\u00E1 um loop infinito."},
-
- { ER_CANNOT_MIX_XERCESDOM,
- "N\u00E3o \u00E9 poss\u00EDvel misturar entrada n\u00E3o Xerces-DOM com sa\u00EDda Xerces-DOM!"},
-
- { ER_TOO_MANY_LISTENERS,
- "addTraceListenersToStylesheet - TooManyListenersException"},
-
- { ER_IN_ELEMTEMPLATEELEM_READOBJECT,
- "No ElemTemplateElement.readObject: {0}"},
-
- { ER_DUPLICATE_NAMED_TEMPLATE,
- "Foi encontrado mais de um modelo com o nome: {0}"},
-
- { ER_INVALID_KEY_CALL,
- "Chamada de fun\u00E7\u00E3o inv\u00E1lida: chamadas recursivas de key() n\u00E3o s\u00E3o permitidas"},
-
- { ER_REFERENCING_ITSELF,
- "A vari\u00E1vel {0} est\u00E1 importando ela mesma de forma direta ou indireta!"},
-
- { ER_ILLEGAL_DOMSOURCE_INPUT,
- "O n\u00F3 de entrada n\u00E3o pode ser nulo para um DOMSource para newTemplates!"},
-
- { ER_CLASS_NOT_FOUND_FOR_OPTION,
- "O arquivo de classe n\u00E3o foi encontrado para a op\u00E7\u00E3o {0}"},
-
- { ER_REQUIRED_ELEM_NOT_FOUND,
- "Elemento Obrigat\u00F3rio n\u00E3o encontrado: {0}"},
-
- { ER_INPUT_CANNOT_BE_NULL,
- "InputStream n\u00E3o pode ser nulo"},
-
- { ER_URI_CANNOT_BE_NULL,
- "O URI n\u00E3o pode ser nulo"},
-
- { ER_FILE_CANNOT_BE_NULL,
- "O arquivo n\u00E3o pode ser nulo"},
-
- { ER_SOURCE_CANNOT_BE_NULL,
- "InputSource n\u00E3o pode ser nulo"},
-
- { ER_CANNOT_INIT_BSFMGR,
- "N\u00E3o foi poss\u00EDvel inicializar o Gerenciador de BSF"},
-
- { ER_CANNOT_CMPL_EXTENSN,
- "N\u00E3o foi poss\u00EDvel compilar a extens\u00E3o"},
-
- { ER_CANNOT_CREATE_EXTENSN,
- "N\u00E3o foi poss\u00EDvel criar a extens\u00E3o: {0} em decorr\u00EAncia de: {1}"},
-
- { ER_INSTANCE_MTHD_CALL_REQUIRES,
- "A chamada do m\u00E9todo da inst\u00E2ncia para o m\u00E9todo {0} exige uma inst\u00E2ncia do Objeto como primeiro argumento"},
-
- { ER_INVALID_ELEMENT_NAME,
- "Nome de elemento inv\u00E1lido especificado {0}"},
-
- { ER_ELEMENT_NAME_METHOD_STATIC,
- "O m\u00E9todo do nome do elemento deve ser est\u00E1tico {0}"},
-
- { ER_EXTENSION_FUNC_UNKNOWN,
- "Fun\u00E7\u00E3o da extens\u00E3o {0} : {1} desconhecido"},
-
- { ER_MORE_MATCH_CONSTRUCTOR,
- "H\u00E1 mais de uma melhor correspond\u00EAncia para o construtor em rela\u00E7\u00E3o a {0}"},
-
- { ER_MORE_MATCH_METHOD,
- "H\u00E1 mais de uma melhor correspond\u00EAncia para o m\u00E9todo {0}"},
-
- { ER_MORE_MATCH_ELEMENT,
- "H\u00E1 mais de uma melhor correspond\u00EAncia para o m\u00E9todo do elemento {0}"},
-
- { ER_INVALID_CONTEXT_PASSED,
- "Contexto inv\u00E1lido especificado para avaliar {0}"},
-
- { ER_POOL_EXISTS,
- "O pool j\u00E1 existe"},
-
- { ER_NO_DRIVER_NAME,
- "Nenhum Nome do driver especificado"},
-
- { ER_NO_URL,
- "Nenhum URL especificado"},
-
- { ER_POOL_SIZE_LESSTHAN_ONE,
- "O tamanho do pool \u00E9 menor que um!"},
-
- { ER_INVALID_DRIVER,
- "Nome do driver inv\u00E1lido especificado!"},
-
- { ER_NO_STYLESHEETROOT,
- "A raiz da folha de estilos n\u00E3o foi encontrada!"},
-
- { ER_ILLEGAL_XMLSPACE_VALUE,
- "Valor inv\u00E1lido para xml:space"},
-
- { ER_PROCESSFROMNODE_FAILED,
- "Falha em processFromNode"},
-
- { ER_RESOURCE_COULD_NOT_LOAD,
- "O recurso [ {0} ] n\u00E3o foi carregado: {1} \n {2} \t {3}"},
-
- { ER_BUFFER_SIZE_LESSTHAN_ZERO,
- "Tamanho do buffer <=0"},
-
- { ER_UNKNOWN_ERROR_CALLING_EXTENSION,
- "Erro desconhecido ao chamar a extens\u00E3o"},
-
- { ER_NO_NAMESPACE_DECL,
- "O prefixo {0} n\u00E3o tem uma declara\u00E7\u00E3o de namespace correspondente"},
-
- { ER_ELEM_CONTENT_NOT_ALLOWED,
- "Conte\u00FAdo do elemento n\u00E3o permitido para lang=javaclass {0}"},
-
- { ER_STYLESHEET_DIRECTED_TERMINATION,
- "T\u00E9rmino direcionado da folha de estilos"},
-
- { ER_ONE_OR_TWO,
- "1 ou 2"},
-
- { ER_TWO_OR_THREE,
- "2 ou 3"},
-
- { ER_COULD_NOT_LOAD_RESOURCE,
- "N\u00E3o foi poss\u00EDvel carregar {0} (verificar CLASSPATH); usando agora apenas os padr\u00F5es"},
-
- { ER_CANNOT_INIT_DEFAULT_TEMPLATES,
- "N\u00E3o \u00E9 poss\u00EDvel inicializar os modelos padr\u00E3o"},
-
- { ER_RESULT_NULL,
- "O resultado n\u00E3o deve ser nulo"},
-
- { ER_RESULT_COULD_NOT_BE_SET,
- "N\u00E3o foi poss\u00EDvel definir o resultado"},
-
- { ER_NO_OUTPUT_SPECIFIED,
- "Nenhuma sa\u00EDda especificada"},
-
- { ER_CANNOT_TRANSFORM_TO_RESULT_TYPE,
- "N\u00E3o \u00E9 poss\u00EDvel transformar um Resultado do tipo {0}"},
-
- { ER_CANNOT_TRANSFORM_SOURCE_TYPE,
- "N\u00E3o \u00E9 poss\u00EDvel transformar uma Origem do tipo {0}"},
-
- { ER_NULL_CONTENT_HANDLER,
- "Handler de conte\u00FAdo nulo"},
-
- { ER_NULL_ERROR_HANDLER,
- "Handler de erro nulo"},
-
- { ER_CANNOT_CALL_PARSE,
- "o parsing n\u00E3o poder\u00E1 ser chamado se o ContentHandler n\u00E3o tiver sido definido"},
-
- { ER_NO_PARENT_FOR_FILTER,
- "Nenhum pai para o filtro"},
-
- { ER_NO_STYLESHEET_IN_MEDIA,
- "Nenhuma folha de estilos encontrada em: {0}, m\u00EDdia= {1}"},
-
- { ER_NO_STYLESHEET_PI,
- "Nenhum PI de xml-stylesheet encontrado em: {0}"},
-
- { ER_NOT_SUPPORTED,
- "N\u00E3o suportado: {0}"},
-
- { ER_PROPERTY_VALUE_BOOLEAN,
- "O valor da propriedade {0} deve ser uma inst\u00E2ncia Booliana"},
-
- { ER_COULD_NOT_FIND_EXTERN_SCRIPT,
- "N\u00E3o foi poss\u00EDvel obter um script externo em {0}"},
-
- { ER_RESOURCE_COULD_NOT_FIND,
- "N\u00E3o foi poss\u00EDvel encontrar o recurso [ {0} ].\n {1}"},
-
- { ER_OUTPUT_PROPERTY_NOT_RECOGNIZED,
- "Propriedade de sa\u00EDda n\u00E3o reconhecida: {0}"},
-
- { ER_FAILED_CREATING_ELEMLITRSLT,
- "Falha ao criar a inst\u00E2ncia ElemLiteralResult"},
-
- //Earlier (JDK 1.4 XALAN 2.2-D11) at key code '204' the key name was ER_PRIORITY_NOT_PARSABLE
- // In latest Xalan code base key name is ER_VALUE_SHOULD_BE_NUMBER. This should also be taken care
- //in locale specific files like XSLTErrorResources_de.java, XSLTErrorResources_fr.java etc.
- //NOTE: Not only the key name but message has also been changed.
- { ER_VALUE_SHOULD_BE_NUMBER,
- "O valor para {0} deve conter um n\u00FAmero pass\u00EDvel de parsing"},
-
- { ER_VALUE_SHOULD_EQUAL,
- "O valor para {0} deve ser igual a sim ou n\u00E3o"},
-
- { ER_FAILED_CALLING_METHOD,
- "Falha ao chamar o m\u00E9todo {0}"},
-
- { ER_FAILED_CREATING_ELEMTMPL,
- "Falha ao criar a inst\u00E2ncia ElemTemplateElement"},
-
- { ER_CHARS_NOT_ALLOWED,
- "Os caracteres n\u00E3o s\u00E3o permitidos neste ponto do documento"},
-
- { ER_ATTR_NOT_ALLOWED,
- "O atributo \"{0}\" n\u00E3o \u00E9 permitido no elemento {1}!"},
-
- { ER_BAD_VALUE,
- "{0} valor incorreto {1} "},
-
- { ER_ATTRIB_VALUE_NOT_FOUND,
- "valor do atributo {0} n\u00E3o encontrado "},
-
- { ER_ATTRIB_VALUE_NOT_RECOGNIZED,
- "Valor do atributo {0} n\u00E3o reconhecido "},
-
- { ER_NULL_URI_NAMESPACE,
- "Tentativa de gerar um prefixo do namespace com um URI nulo"},
-
- { ER_NUMBER_TOO_BIG,
- "Tentativa de formatar um n\u00FAmero maior que o n\u00FAmero inteiro Longo maior"},
-
- { ER_CANNOT_FIND_SAX1_DRIVER,
- "N\u00E3o \u00E9 poss\u00EDvel localizar a classe do driver SAX1 {0}"},
-
- { ER_SAX1_DRIVER_NOT_LOADED,
- "A classe do driver SAX1 {0} foi encontrada, mas n\u00E3o pode ser carregada"},
-
- { ER_SAX1_DRIVER_NOT_INSTANTIATED,
- "A classe do driver SAX1 {0} foi carregada, mas n\u00E3o pode ser instanciada"},
-
- { ER_SAX1_DRIVER_NOT_IMPLEMENT_PARSER,
- "A classe do driver SAX1 {0} n\u00E3o implementa org.xml.sax.Parser"},
-
- { ER_PARSER_PROPERTY_NOT_SPECIFIED,
- "A propriedade do sistema org.xml.sax.parser n\u00E3o foi especificada"},
-
- { ER_PARSER_ARG_CANNOT_BE_NULL,
- "O argumento de parser n\u00E3o pode ser nulo"},
-
- { ER_FEATURE,
- "Recurso: {0}"},
-
- { ER_PROPERTY,
- "Propriedade: {0}"},
-
- { ER_NULL_ENTITY_RESOLVER,
- "Resolvedor da entidade nulo"},
-
- { ER_NULL_DTD_HANDLER,
- "Handler de DTD nulo"},
-
- { ER_NO_DRIVER_NAME_SPECIFIED,
- "Nenhum Nome do Driver Especificado!"},
-
- { ER_NO_URL_SPECIFIED,
- "Nenhum URL Especificado!"},
-
- { ER_POOLSIZE_LESS_THAN_ONE,
- "O tamanho do pool \u00E9 menor que 1!"},
-
- { ER_INVALID_DRIVER_NAME,
- "Nome do Driver Especificado Inv\u00E1lido!"},
-
- { ER_ERRORLISTENER,
- "ErrorListener"},
-
-
-// Note to translators: The following message should not normally be displayed
-// to users. It describes a situation in which the processor has detected
-// an internal consistency problem in itself, and it provides this message
-// for the developer to help diagnose the problem. The name
-// 'ElemTemplateElement' is the name of a class, and should not be
-// translated.
- { ER_ASSERT_NO_TEMPLATE_PARENT,
- "Erro do programador! A express\u00E3o n\u00E3o tem ElemTemplateElement pai!"},
-
-
-// Note to translators: The following message should not normally be displayed
-// to users. It describes a situation in which the processor has detected
-// an internal consistency problem in itself, and it provides this message
-// for the developer to help diagnose the problem. The substitution text
-// provides further information in order to diagnose the problem. The name
-// 'RedundentExprEliminator' is the name of a class, and should not be
-// translated.
- { ER_ASSERT_REDUNDENT_EXPR_ELIMINATOR,
- "Asser\u00E7\u00E3o do Programador no RedundentExprEliminator: {0}"},
-
- { ER_NOT_ALLOWED_IN_POSITION,
- "{0} n\u00E3o \u00E9 permitido(a) nesta posi\u00E7\u00E3o na folha de estilos!"},
-
- { ER_NONWHITESPACE_NOT_ALLOWED_IN_POSITION,
- "Texto sem espa\u00E7o em branco n\u00E3o permitido nesta posi\u00E7\u00E3o na folha de estilos!"},
-
- // This code is shared with warning codes.
- // SystemId Unknown
- { INVALID_TCHAR,
- "Valor inv\u00E1lido: {1} usado para o atributo CHAR: {0}. Um atributo do tipo CHAR deve ter somente 1 caractere!"},
-
- // Note to translators: The following message is used if the value of
- // an attribute in a stylesheet is invalid. "QNAME" is the XML data-type of
- // the attribute, and should not be translated. The substitution text {1} is
- // the attribute value and {0} is the attribute name.
- //The following codes are shared with the warning codes...
- { INVALID_QNAME,
- "Valor inv\u00E1lido: {1} usado para o atributo QNAME: {0}"},
-
- // Note to translators: The following message is used if the value of
- // an attribute in a stylesheet is invalid. "ENUM" is the XML data-type of
- // the attribute, and should not be translated. The substitution text {1} is
- // the attribute value, {0} is the attribute name, and {2} is a list of valid
- // values.
- { INVALID_ENUM,
- "Valor inv\u00E1lido: {1} usado para o atributo ENUM: {0}. Os valores v\u00E1lidos s\u00E3o: {2}."},
-
-// Note to translators: The following message is used if the value of
-// an attribute in a stylesheet is invalid. "NMTOKEN" is the XML data-type
-// of the attribute, and should not be translated. The substitution text {1} is
-// the attribute value and {0} is the attribute name.
- { INVALID_NMTOKEN,
- "Valor inv\u00E1lido: {1} usado para o atributo NMTOKEN: {0} "},
-
-// Note to translators: The following message is used if the value of
-// an attribute in a stylesheet is invalid. "NCNAME" is the XML data-type
-// of the attribute, and should not be translated. The substitution text {1} is
-// the attribute value and {0} is the attribute name.
- { INVALID_NCNAME,
- "Valor inv\u00E1lido: {1} usado para o atributo NCNAME: {0} "},
-
-// Note to translators: The following message is used if the value of
-// an attribute in a stylesheet is invalid. "boolean" is the XSLT data-type
-// of the attribute, and should not be translated. The substitution text {1} is
-// the attribute value and {0} is the attribute name.
- { INVALID_BOOLEAN,
- "Valor inv\u00E1lido: {1} usado para o atributo boolean: {0} "},
-
-// Note to translators: The following message is used if the value of
-// an attribute in a stylesheet is invalid. "number" is the XSLT data-type
-// of the attribute, and should not be translated. The substitution text {1} is
-// the attribute value and {0} is the attribute name.
- { INVALID_NUMBER,
- "Valor inv\u00E1lido: {1} usado para o atributo do n\u00FAmero: {0} "},
-
-
- // End of shared codes...
-
-// Note to translators: A "match pattern" is a special form of XPath expression
-// that is used for matching patterns. The substitution text is the name of
-// a function. The message indicates that when this function is referenced in
-// a match pattern, its argument must be a string literal (or constant.)
-// ER_ARG_LITERAL - new error message for bugzilla //5202
- { ER_ARG_LITERAL,
- "O argumento para {0} no padr\u00E3o de correspond\u00EAncia deve ser um literal."},
-
-// Note to translators: The following message indicates that two definitions of
-// a variable. A "global variable" is a variable that is accessible everywher
-// in the stylesheet.
-// ER_DUPLICATE_GLOBAL_VAR - new error message for bugzilla #790
- { ER_DUPLICATE_GLOBAL_VAR,
- "Declara\u00E7\u00E3o de vari\u00E1vel global duplicada."},
-
-
-// Note to translators: The following message indicates that two definitions of
-// a variable were encountered.
-// ER_DUPLICATE_VAR - new error message for bugzilla #790
- { ER_DUPLICATE_VAR,
- "Declara\u00E7\u00E3o de vari\u00E1vel duplicada."},
-
- // Note to translators: "xsl:template, "name" and "match" are XSLT keywords
- // which must not be translated.
- // ER_TEMPLATE_NAME_MATCH - new error message for bugzilla #789
- { ER_TEMPLATE_NAME_MATCH,
- "xsl:template deve ter um atributo name ou match (ou ambos)"},
-
- // Note to translators: "exclude-result-prefixes" is an XSLT keyword which
- // should not be translated. The message indicates that a namespace prefix
- // encountered as part of the value of the exclude-result-prefixes attribute
- // was in error.
- // ER_INVALID_PREFIX - new error message for bugzilla #788
- { ER_INVALID_PREFIX,
- "O prefixo em exclude-result-prefixes n\u00E3o \u00E9 v\u00E1lido: {0}"},
-
- // Note to translators: An "attribute set" is a set of attributes that can
- // be added to an element in the output document as a group. The message
- // indicates that there was a reference to an attribute set named {0} that
- // was never defined.
- // ER_NO_ATTRIB_SET - new error message for bugzilla #782
- { ER_NO_ATTRIB_SET,
- "o conjunto de atributos com o nome {0} n\u00E3o existe"},
-
- // Note to translators: This message indicates that there was a reference
- // to a function named {0} for which no function definition could be found.
- { ER_FUNCTION_NOT_FOUND,
- "A fun\u00E7\u00E3o com o nome {0} n\u00E3o existe"},
-
- // Note to translators: This message indicates that the XSLT instruction
- // that is named by the substitution text {0} must not contain other XSLT
- // instructions (content) or a "select" attribute. The word "select" is
- // an XSLT keyword in this case and must not be translated.
- { ER_CANT_HAVE_CONTENT_AND_SELECT,
- "O elemento {0} n\u00E3o deve ter um conte\u00FAdo e um atributo select."},
-
- // Note to translators: This message indicates that the value argument
- // of setParameter must be a valid Java Object.
- { ER_INVALID_SET_PARAM_VALUE,
- "O valor do par\u00E2metro {0} deve ser um Objeto Java v\u00E1lido"},
-
- { ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX_FOR_DEFAULT,
- "O atributo result-prefix de um elemento xsl:namespace-alias tem o valor '#padr\u00E3o', mas n\u00E3o h\u00E1 declara\u00E7\u00E3o do namespace padr\u00E3o no escopo do elemento"},
-
- { ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX,
- "O atributo result-prefix de um elemento xsl:namespace-alias tem o valor ''{0}'', mas n\u00E3o h\u00E1 declara\u00E7\u00E3o de namespace para o prefixo ''{0}'' no escopo do elemento."},
-
- { ER_SET_FEATURE_NULL_NAME,
- "O nome do recurso n\u00E3o pode ser nulo em TransformerFactory.setFeature(Nome da string, valor booliano)."},
-
- { ER_GET_FEATURE_NULL_NAME,
- "O nome do recurso n\u00E3o pode ser nulo em TransformerFactory.getFeature(Nome da string)."},
-
- { ER_UNSUPPORTED_FEATURE,
- "N\u00E3o \u00E9 poss\u00EDvel definir o recurso ''{0}'' nesta TransformerFactory."},
-
- { ER_EXTENSION_ELEMENT_NOT_ALLOWED_IN_SECURE_PROCESSING,
- "O uso do elemento da extens\u00E3o ''{0}'' n\u00E3o ser\u00E1 permitido quando o recurso de processamento seguro for definido como verdadeiro."},
-
- { ER_NAMESPACE_CONTEXT_NULL_NAMESPACE,
- "N\u00E3o \u00E9 poss\u00EDvel obter o prefixo de um uri de namespace nulo."},
-
- { ER_NAMESPACE_CONTEXT_NULL_PREFIX,
- "N\u00E3o \u00E9 poss\u00EDvel obter o uri do namespace do prefixo nulo."},
-
- { ER_XPATH_RESOLVER_NULL_QNAME,
- "O nome da fun\u00E7\u00E3o n\u00E3o pode ser nulo."},
-
- { ER_XPATH_RESOLVER_NEGATIVE_ARITY,
- "A aridade n\u00E3o pode ser negativa."},
- // Warnings...
-
- { WG_FOUND_CURLYBRACE,
- "Encontrou '}', mas nenhum modelo do atributo estava aberto!"},
-
- { WG_COUNT_ATTRIB_MATCHES_NO_ANCESTOR,
- "Advert\u00EAncia: o atributo de contagem n\u00E3o corresponde a um ancestral no xsl:number! Alvo = {0}"},
-
- { WG_EXPR_ATTRIB_CHANGED_TO_SELECT,
- "Sintaxe antiga: O nome do atributo 'expr' foi alterado para 'select'."},
-
- { WG_NO_LOCALE_IN_FORMATNUMBER,
- "O Xalan ainda n\u00E3o trata o nome das configura\u00E7\u00F5es regionais na fun\u00E7\u00E3o format-number."},
-
- { WG_LOCALE_NOT_FOUND,
- "Advert\u00EAncia: N\u00E3o foi poss\u00EDvel encontrar o nome das configura\u00E7\u00F5es regionais de xml:lang={0}"},
-
- { WG_CANNOT_MAKE_URL_FROM,
- "N\u00E3o \u00E9 poss\u00EDvel criar o URL de: {0}"},
-
- { WG_CANNOT_LOAD_REQUESTED_DOC,
- "N\u00E3o \u00E9 poss\u00EDvel carregar o doc solicitado: {0}"},
-
- { WG_CANNOT_FIND_COLLATOR,
- "N\u00E3o foi poss\u00EDvel localizar o Agrupador para <sort xml:lang={0}"},
-
- { WG_FUNCTIONS_SHOULD_USE_URL,
- "Sintaxe antiga: a instru\u00E7\u00E3o das fun\u00E7\u00F5es deve usar um url de {0}"},
-
- { WG_ENCODING_NOT_SUPPORTED_USING_UTF8,
- "codifica\u00E7\u00E3o n\u00E3o suportada: {0}, usando UTF-8"},
-
- { WG_ENCODING_NOT_SUPPORTED_USING_JAVA,
- "codifica\u00E7\u00E3o n\u00E3o suportada: {0}, usando Java {1}"},
-
- { WG_SPECIFICITY_CONFLICTS,
- "Conflitos de especificidade encontrados: {0} Ser\u00E1 usado o \u00FAltimo encontrado na folha de estilos."},
-
- { WG_PARSING_AND_PREPARING,
- "========= Fazendo parsing e preparando {0} =========="},
-
- { WG_ATTR_TEMPLATE,
- "Modelo do Atributo, {0}"},
-
- { WG_CONFLICT_BETWEEN_XSLSTRIPSPACE_AND_XSLPRESERVESPACE,
- "Conflito correspondente entre xsl:strip-space e xsl:preserve-space"},
-
- { WG_ATTRIB_NOT_HANDLED,
- "O Xalan ainda n\u00E3o trata o atributo {0}!"},
-
- { WG_NO_DECIMALFORMAT_DECLARATION,
- "Nenhuma declara\u00E7\u00E3o encontrada para o formato decimal: {0}"},
-
- { WG_OLD_XSLT_NS,
- "Namespace de XSLT n\u00E3o encontrado ou incorreto. "},
-
- { WG_ONE_DEFAULT_XSLDECIMALFORMAT_ALLOWED,
- "\u00C9 permitida somente uma declara\u00E7\u00E3o de xsl:decimal-format padr\u00E3o."},
-
- { WG_XSLDECIMALFORMAT_NAMES_MUST_BE_UNIQUE,
- "os nomes de xsl:decimal-format devem ser exclusivos. O nome \"{0}\" foi duplicado."},
-
- { WG_ILLEGAL_ATTRIBUTE,
- "{0} tem um atributo inv\u00E1lido: {1}"},
-
- { WG_COULD_NOT_RESOLVE_PREFIX,
- "N\u00E3o foi poss\u00EDvel resolver o prefixo do namespace: {0}. O n\u00F3 ser\u00E1 ignorado."},
-
- { WG_STYLESHEET_REQUIRES_VERSION_ATTRIB,
- "xsl:stylesheet requer um atributo 'version'!"},
-
- { WG_ILLEGAL_ATTRIBUTE_NAME,
- "Nome do atributo inv\u00E1lido: {0}"},
-
- { WG_ILLEGAL_ATTRIBUTE_VALUE,
- "Valor inv\u00E1lido usado para o atributo {0}: {1}"},
-
- { WG_EMPTY_SECOND_ARG,
- "O conjunto de n\u00F3s resultante do segundo argumento da fun\u00E7\u00E3o do documento est\u00E1 vazio. Retorne um conjunto de n\u00F3s vazio."},
-
- //Following are the new WARNING keys added in XALAN code base after Jdk 1.4 (Xalan 2.2-D11)
-
- // Note to translators: "name" and "xsl:processing-instruction" are keywords
- // and must not be translated.
- { WG_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML,
- "O valor do atributo 'name' do nome de xsl:processing-instruction n\u00E3o deve ser 'xml'"},
-
- // Note to translators: "name" and "xsl:processing-instruction" are keywords
- // and must not be translated. "NCName" is an XML data-type and must not be
- // translated.
- { WG_PROCESSINGINSTRUCTION_NOTVALID_NCNAME,
- "O valor do atributo ''name'' de xsl:processing-instruction deve ser um NCName v\u00E1lido: {0}"},
-
- // Note to translators: This message is reported if the stylesheet that is
- // being processed attempted to construct an XML document with an attribute in a
- // place other than on an element. The substitution text specifies the name of
- // the attribute.
- { WG_ILLEGAL_ATTRIBUTE_POSITION,
- "N\u00E3o \u00E9 poss\u00EDvel adicionar o atributo {0} depois dos n\u00F3s filhos ou antes que um elemento seja produzido. O atributo ser\u00E1 ignorado."},
-
- { NO_MODIFICATION_ALLOWED_ERR,
- "Foi feita uma tentativa de modificar um objeto no qual n\u00E3o s\u00E3o permitidas modifica\u00E7\u00F5es."
- },
-
- //Check: WHY THERE IS A GAP B/W NUMBERS in the XSLTErrorResources properties file?
-
- // Other miscellaneous text used inside the code...
- { "ui_language", "pt-BR"},
- { "help_language", "pt-BR" },
- { "language", "pt-BR" },
- { "BAD_CODE", "O par\u00E2metro para createMessage estava fora dos limites"},
- { "FORMAT_FAILED", "Exce\u00E7\u00E3o gerada durante a chamada messageFormat"},
- { "version", ">>>>>>> Vers\u00E3o do Xalan "},
- { "version2", "<<<<<<<"},
- { "yes", "sim"},
- { "line", "N\u00B0 da Linha"},
- { "column","N\u00B0 da Coluna"},
- { "xsldone", "XSLProcessor: conclu\u00EDdo"},
-
-
- // Note to translators: The following messages provide usage information
- // for the Xalan Process command line. "Process" is the name of a Java class,
- // and should not be translated.
- { "xslProc_option", "Op\u00E7\u00F5es da classe Process da linha de comandos do Xalan-J:"},
- { "xslProc_option", "Op\u00E7\u00F5es da classe Process da linha de comandos do Xalan-J:"},
- { "xslProc_invalid_xsltc_option", "A op\u00E7\u00E3o {0} n\u00E3o \u00E9 suportada no modo XSLTC."},
- { "xslProc_invalid_xalan_option", "A op\u00E7\u00E3o {0} s\u00F3 pode ser usada com -XSLTC."},
- { "xslProc_no_input", "Erro: N\u00E3o foi especificada uma folha de estilos ou um xml de entrada . Execute este comando sem nenhuma op\u00E7\u00E3o para instru\u00E7\u00F5es de uso."},
- { "xslProc_common_options", "-Op\u00E7\u00F5es Comuns-"},
- { "xslProc_xalan_options", "-Op\u00E7\u00F5es para Xalan-"},
- { "xslProc_xsltc_options", "-Op\u00E7\u00F5es para XSLTC-"},
- { "xslProc_return_to_continue", "(pressione <return> para continuar)"},
-
- // Note to translators: The option name and the parameter name do not need to
- // be translated. Only translate the messages in parentheses. Note also that
- // leading whitespace in the messages is used to indent the usage information
- // for each option in the English messages.
- // Do not translate the keywords: XSLTC, SAX, DOM and DTM.
- { "optionXSLTC", " [-XSLTC (use XSLTC para transforma\u00E7\u00E3o)]"},
- { "optionIN", " [-IN inputXMLURL]"},
- { "optionXSL", " [-XSL XSLTransformationURL]"},
- { "optionOUT", " [-OUT outputFileName]"},
- { "optionLXCIN", " [-LXCIN compiledStylesheetFileNameIn]"},
- { "optionLXCOUT", " [-LXCOUT compiledStylesheetFileNameOutOut]"},
- { "optionPARSER", " [-PARSER nome da classe totalmente qualificado de liaison de parser]"},
- { "optionE", " [-E (N\u00E3o expandir refer\u00EAncias da entidade)]"},
- { "optionV", " [-E (N\u00E3o expandir refer\u00EAncias da entidade)]"},
- { "optionQC", " [-QC (Advert\u00EAncias de Conflitos do Padr\u00E3o Silencioso)]"},
- { "optionQ", " [-Q (Modo Silencioso)]"},
- { "optionLF", " [-LF (Usar alimenta\u00E7\u00F5es de linha somente na sa\u00EDda {o padr\u00E3o \u00E9 CR/LF})]"},
- { "optionCR", " [-CR (Use retornos de carro somente na sa\u00EDda {o padr\u00E3o \u00E9 CR/LF})]"},
- { "optionESCAPE", " [-ESCAPE (Quais caracteres devem ser identificados como escape {o padr\u00E3o \u00E9 <>&\"'\\r\\n}]"},
- { "optionINDENT", " [-INDENT (Controla quantos espa\u00E7os devem ser recuados {o padr\u00E3o \u00E9 0})]"},
- { "optionTT", " [-TT (Rastreia os modelos \u00E0 medida que s\u00E3o chamados.)]"},
- { "optionTG", " [-TG (Rastreia cada evento de gera\u00E7\u00E3o.)]"},
- { "optionTS", " [-TS (Rastreia cada evento de sele\u00E7\u00E3o.)]"},
- { "optionTTC", " [-TTC (Rastreia os filhos do modelo \u00E0 medida que s\u00E3o processados.)]"},
- { "optionTCLASS", " [-TCLASS (Classe TraceListener para extens\u00F5es de rastreamento.)]"},
- { "optionVALIDATE", " [-VALIDATE (Define se ocorre valida\u00E7\u00E3o. Por padr\u00E3o, a valida\u00E7\u00E3o fica desativada.)]"},
- { "optionEDUMP", " [-EDUMP {nome do arquivo opcional} (Execute um dump de pilha em caso de erro.)]"},
- { "optionXML", " [-XML (Use o formatador XML e adicione o cabe\u00E7alho XML.)]"},
- { "optionTEXT", " [-TEXT (Use o formatador de Texto simples.)]"},
- { "optionHTML", " [-HTML (Use o formatador HTML.)]"},
- { "optionPARAM", " [-PARAM express\u00E3o do nome (Defina um par\u00E2metro da folha de estilos)]"},
- { "noParsermsg1", "Processo XSL malsucedido."},
- { "noParsermsg2", "** N\u00E3o foi poss\u00EDvel localizar o parser **"},
- { "noParsermsg3", "Verifique seu classpath."},
- { "noParsermsg4", "Se voc\u00EA n\u00E3o tiver um Parser XML da IBM para Java, poder\u00E1 fazer download dele em"},
- { "noParsermsg5", "AlphaWorks da IBM: http://www.alphaworks.ibm.com/formula/xml"},
- { "optionURIRESOLVER", " [-URIRESOLVER nome completo da classe (URIResolver a ser usado para resolver URIs)]"},
- { "optionENTITYRESOLVER", " [-ENTITYRESOLVER nome completo da classe (EntityResolver a ser usado para resolver entidades)]"},
- { "optionCONTENTHANDLER", " [-CONTENTHANDLER nome completo da classe (ContentHandler a ser usado para serializar a sa\u00EDda)]"},
- { "optionLINENUMBERS", " [-L usa os n\u00FAmeros de linha dos documentos de origem]"},
- { "optionSECUREPROCESSING", " [-SECURE (define o recurso de processamento seguro como verdadeiro.)]"},
-
- // Following are the new options added in XSLTErrorResources.properties files after Jdk 1.4 (Xalan 2.2-D11)
-
-
- { "optionMEDIA", " [-MEDIA mediaType (use o atributo de m\u00EDdia para localizar a folha de estilos associada a um documento.)]"},
- { "optionFLAVOR", " [-FLAVOR flavorName (Use explicitamente s2s=SAX ou d2d=DOM para fazer a transforma\u00E7\u00E3o.)] "}, // Added by sboag/scurcuru; experimental
- { "optionDIAG", " [-DIAG (Imprimir transforma\u00E7\u00E3o geral de milissegundos detectada.)]"},
- { "optionINCREMENTAL", " [-INCREMENTAL (solicitar a constru\u00E7\u00E3o de DTM incremental, definindo http://xml.apache.org/xalan/features/incremental como verdadeiro.)]"},
- { "optionNOOPTIMIMIZE", " [-NOOPTIMIMIZE (solicite o n\u00E3o processamento de otimiza\u00E7\u00E3o da folha de estilos definindo http://xml.apache.org/xalan/features/optimize como falso.)]"},
- { "optionRL", " [-RL recursionlimit (limite num\u00E9rico de asser\u00E7\u00E3o na profundidade de recurs\u00E3o da folha de estilos.)]"},
- { "optionXO", " [-XO [transletName] (atribui o nome ao translet gerado)]"},
- { "optionXD", " [-XD destinationDirectory (especificar um diret\u00F3rio de destino para translet)]"},
- { "optionXJ", " [-XJ jarfile (empacotar classes do translet em um arquivo jar com o nome <jarfile>)]"},
- { "optionXP", " [-XP pacote (especifica um prefixo de nome do pacote para todas as classes translet geradas)]"},
-
- //AddITIONAL STRINGS that need L10n
- // Note to translators: The following message describes usage of a particular
- // command-line option that is used to enable the "template inlining"
- // optimization. The optimization involves making a copy of the code
- // generated for a template in another template that refers to it.
- { "optionXN", " [-XN (ativa a inser\u00E7\u00E3o do modelo)]" },
- { "optionXX", " [-XX (ativa a sa\u00EDda da mensagem de depura\u00E7\u00E3o adicional)]"},
- { "optionXT" , " [-XT (usar o translet para transformar, se poss\u00EDvel)]"},
- { "diagTiming"," --------- A transforma\u00E7\u00E3o de {0} por meio de {1} levou {2} ms" },
- { "recursionTooDeep","Aninhamento do modelo muito profundo. aninhamento = {0}, modelo {1} {2}" },
- { "nameIs", "o nome \u00E9" },
- { "matchPatternIs", "o padr\u00E3o de correspond\u00EAncia \u00E9" }
-
- };
-
- }
- // ================= INFRASTRUCTURE ======================
-
- /** String for use when a bad error code was encountered. */
- public static final String BAD_CODE = "BAD_CODE";
-
- /** String for use when formatting of the error string failed. */
- public static final String FORMAT_FAILED = "FORMAT_FAILED";
-
- /** General error string. */
- public static final String ERROR_STRING = "#error";
-
- /** String to prepend to error messages. */
- public static final String ERROR_HEADER = "Error: ";
-
- /** String to prepend to warning messages. */
- public static final String WARNING_HEADER = "Warning: ";
-
- /** String to specify the XSLT module. */
- public static final String XSL_HEADER = "XSLT ";
-
- /** String to specify the XML parser module. */
- public static final String XML_HEADER = "XML ";
-
- /** I don't think this is used any more.
- * @deprecated */
- public static final String QUERY_HEADER = "PATTERN ";
-
-
- }
diff --git a/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_sv.java b/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_sv.java
deleted file mode 100644
index 183697b..0000000
--- a/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_sv.java
+++ /dev/null
@@ -1,1447 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xalan.internal.res;
-
-import java.util.ListResourceBundle;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * Set up error messages.
- * We build a two dimensional array of message keys and
- * message strings. In order to add a new message here,
- * you need to first add a String constant. And
- * you need to enter key , value pair as part of contents
- * Array. You also need to update MAX_CODE for error strings
- * and MAX_WARNING for warnings ( Needed for only information
- * purpose )
- */
-public class XSLTErrorResources_sv extends ListResourceBundle
-{
-
-/*
- * This file contains error and warning messages related to Xalan Error
- * Handling.
- *
- * General notes to translators:
- *
- * 1) Xalan (or more properly, Xalan-interpretive) and XSLTC are names of
- * components.
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- * XSLTC is an acronym for XSLT Compiler.
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 5) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 6) "Translet" is an invented term that describes the class file that
- * results from compiling an XML stylesheet into a Java class.
- *
- * 7) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- */
-
- /*
- * Static variables
- */
- public static final String ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX =
- "ER_INVALID_SET_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX";
-
- public static final String ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX_FOR_DEFAULT =
- "ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX_FOR_DEFAULT";
-
- public static final String ER_NO_CURLYBRACE = "ER_NO_CURLYBRACE";
- public static final String ER_FUNCTION_NOT_SUPPORTED = "ER_FUNCTION_NOT_SUPPORTED";
- public static final String ER_ILLEGAL_ATTRIBUTE = "ER_ILLEGAL_ATTRIBUTE";
- public static final String ER_NULL_SOURCENODE_APPLYIMPORTS = "ER_NULL_SOURCENODE_APPLYIMPORTS";
- public static final String ER_CANNOT_ADD = "ER_CANNOT_ADD";
- public static final String ER_NULL_SOURCENODE_HANDLEAPPLYTEMPLATES="ER_NULL_SOURCENODE_HANDLEAPPLYTEMPLATES";
- public static final String ER_NO_NAME_ATTRIB = "ER_NO_NAME_ATTRIB";
- public static final String ER_TEMPLATE_NOT_FOUND = "ER_TEMPLATE_NOT_FOUND";
- public static final String ER_CANT_RESOLVE_NAME_AVT = "ER_CANT_RESOLVE_NAME_AVT";
- public static final String ER_REQUIRES_ATTRIB = "ER_REQUIRES_ATTRIB";
- public static final String ER_MUST_HAVE_TEST_ATTRIB = "ER_MUST_HAVE_TEST_ATTRIB";
- public static final String ER_BAD_VAL_ON_LEVEL_ATTRIB =
- "ER_BAD_VAL_ON_LEVEL_ATTRIB";
- public static final String ER_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML =
- "ER_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML";
- public static final String ER_PROCESSINGINSTRUCTION_NOTVALID_NCNAME =
- "ER_PROCESSINGINSTRUCTION_NOTVALID_NCNAME";
- public static final String ER_NEED_MATCH_ATTRIB = "ER_NEED_MATCH_ATTRIB";
- public static final String ER_NEED_NAME_OR_MATCH_ATTRIB =
- "ER_NEED_NAME_OR_MATCH_ATTRIB";
- public static final String ER_CANT_RESOLVE_NSPREFIX =
- "ER_CANT_RESOLVE_NSPREFIX";
- public static final String ER_ILLEGAL_VALUE = "ER_ILLEGAL_VALUE";
- public static final String ER_NO_OWNERDOC = "ER_NO_OWNERDOC";
- public static final String ER_ELEMTEMPLATEELEM_ERR ="ER_ELEMTEMPLATEELEM_ERR";
- public static final String ER_NULL_CHILD = "ER_NULL_CHILD";
- public static final String ER_NEED_SELECT_ATTRIB = "ER_NEED_SELECT_ATTRIB";
- public static final String ER_NEED_TEST_ATTRIB = "ER_NEED_TEST_ATTRIB";
- public static final String ER_NEED_NAME_ATTRIB = "ER_NEED_NAME_ATTRIB";
- public static final String ER_NO_CONTEXT_OWNERDOC = "ER_NO_CONTEXT_OWNERDOC";
- public static final String ER_COULD_NOT_CREATE_XML_PROC_LIAISON =
- "ER_COULD_NOT_CREATE_XML_PROC_LIAISON";
- public static final String ER_PROCESS_NOT_SUCCESSFUL =
- "ER_PROCESS_NOT_SUCCESSFUL";
- public static final String ER_NOT_SUCCESSFUL = "ER_NOT_SUCCESSFUL";
- public static final String ER_ENCODING_NOT_SUPPORTED =
- "ER_ENCODING_NOT_SUPPORTED";
- public static final String ER_COULD_NOT_CREATE_TRACELISTENER =
- "ER_COULD_NOT_CREATE_TRACELISTENER";
- public static final String ER_KEY_REQUIRES_NAME_ATTRIB =
- "ER_KEY_REQUIRES_NAME_ATTRIB";
- public static final String ER_KEY_REQUIRES_MATCH_ATTRIB =
- "ER_KEY_REQUIRES_MATCH_ATTRIB";
- public static final String ER_KEY_REQUIRES_USE_ATTRIB =
- "ER_KEY_REQUIRES_USE_ATTRIB";
- public static final String ER_REQUIRES_ELEMENTS_ATTRIB =
- "ER_REQUIRES_ELEMENTS_ATTRIB";
- public static final String ER_MISSING_PREFIX_ATTRIB =
- "ER_MISSING_PREFIX_ATTRIB";
- public static final String ER_BAD_STYLESHEET_URL = "ER_BAD_STYLESHEET_URL";
- public static final String ER_FILE_NOT_FOUND = "ER_FILE_NOT_FOUND";
- public static final String ER_IOEXCEPTION = "ER_IOEXCEPTION";
- public static final String ER_NO_HREF_ATTRIB = "ER_NO_HREF_ATTRIB";
- public static final String ER_STYLESHEET_INCLUDES_ITSELF =
- "ER_STYLESHEET_INCLUDES_ITSELF";
- public static final String ER_PROCESSINCLUDE_ERROR ="ER_PROCESSINCLUDE_ERROR";
- public static final String ER_MISSING_LANG_ATTRIB = "ER_MISSING_LANG_ATTRIB";
- public static final String ER_MISSING_CONTAINER_ELEMENT_COMPONENT =
- "ER_MISSING_CONTAINER_ELEMENT_COMPONENT";
- public static final String ER_CAN_ONLY_OUTPUT_TO_ELEMENT =
- "ER_CAN_ONLY_OUTPUT_TO_ELEMENT";
- public static final String ER_PROCESS_ERROR = "ER_PROCESS_ERROR";
- public static final String ER_UNIMPLNODE_ERROR = "ER_UNIMPLNODE_ERROR";
- public static final String ER_NO_SELECT_EXPRESSION ="ER_NO_SELECT_EXPRESSION";
- public static final String ER_CANNOT_SERIALIZE_XSLPROCESSOR =
- "ER_CANNOT_SERIALIZE_XSLPROCESSOR";
- public static final String ER_NO_INPUT_STYLESHEET = "ER_NO_INPUT_STYLESHEET";
- public static final String ER_FAILED_PROCESS_STYLESHEET =
- "ER_FAILED_PROCESS_STYLESHEET";
- public static final String ER_COULDNT_PARSE_DOC = "ER_COULDNT_PARSE_DOC";
- public static final String ER_COULDNT_FIND_FRAGMENT =
- "ER_COULDNT_FIND_FRAGMENT";
- public static final String ER_NODE_NOT_ELEMENT = "ER_NODE_NOT_ELEMENT";
- public static final String ER_FOREACH_NEED_MATCH_OR_NAME_ATTRIB =
- "ER_FOREACH_NEED_MATCH_OR_NAME_ATTRIB";
- public static final String ER_TEMPLATES_NEED_MATCH_OR_NAME_ATTRIB =
- "ER_TEMPLATES_NEED_MATCH_OR_NAME_ATTRIB";
- public static final String ER_NO_CLONE_OF_DOCUMENT_FRAG =
- "ER_NO_CLONE_OF_DOCUMENT_FRAG";
- public static final String ER_CANT_CREATE_ITEM = "ER_CANT_CREATE_ITEM";
- public static final String ER_XMLSPACE_ILLEGAL_VALUE =
- "ER_XMLSPACE_ILLEGAL_VALUE";
- public static final String ER_NO_XSLKEY_DECLARATION =
- "ER_NO_XSLKEY_DECLARATION";
- public static final String ER_CANT_CREATE_URL = "ER_CANT_CREATE_URL";
- public static final String ER_XSLFUNCTIONS_UNSUPPORTED =
- "ER_XSLFUNCTIONS_UNSUPPORTED";
- public static final String ER_PROCESSOR_ERROR = "ER_PROCESSOR_ERROR";
- public static final String ER_NOT_ALLOWED_INSIDE_STYLESHEET =
- "ER_NOT_ALLOWED_INSIDE_STYLESHEET";
- public static final String ER_RESULTNS_NOT_SUPPORTED =
- "ER_RESULTNS_NOT_SUPPORTED";
- public static final String ER_DEFAULTSPACE_NOT_SUPPORTED =
- "ER_DEFAULTSPACE_NOT_SUPPORTED";
- public static final String ER_INDENTRESULT_NOT_SUPPORTED =
- "ER_INDENTRESULT_NOT_SUPPORTED";
- public static final String ER_ILLEGAL_ATTRIB = "ER_ILLEGAL_ATTRIB";
- public static final String ER_UNKNOWN_XSL_ELEM = "ER_UNKNOWN_XSL_ELEM";
- public static final String ER_BAD_XSLSORT_USE = "ER_BAD_XSLSORT_USE";
- public static final String ER_MISPLACED_XSLWHEN = "ER_MISPLACED_XSLWHEN";
- public static final String ER_XSLWHEN_NOT_PARENTED_BY_XSLCHOOSE =
- "ER_XSLWHEN_NOT_PARENTED_BY_XSLCHOOSE";
- public static final String ER_MISPLACED_XSLOTHERWISE =
- "ER_MISPLACED_XSLOTHERWISE";
- public static final String ER_XSLOTHERWISE_NOT_PARENTED_BY_XSLCHOOSE =
- "ER_XSLOTHERWISE_NOT_PARENTED_BY_XSLCHOOSE";
- public static final String ER_NOT_ALLOWED_INSIDE_TEMPLATE =
- "ER_NOT_ALLOWED_INSIDE_TEMPLATE";
- public static final String ER_UNKNOWN_EXT_NS_PREFIX =
- "ER_UNKNOWN_EXT_NS_PREFIX";
- public static final String ER_IMPORTS_AS_FIRST_ELEM =
- "ER_IMPORTS_AS_FIRST_ELEM";
- public static final String ER_IMPORTING_ITSELF = "ER_IMPORTING_ITSELF";
- public static final String ER_XMLSPACE_ILLEGAL_VAL ="ER_XMLSPACE_ILLEGAL_VAL";
- public static final String ER_PROCESSSTYLESHEET_NOT_SUCCESSFUL =
- "ER_PROCESSSTYLESHEET_NOT_SUCCESSFUL";
- public static final String ER_SAX_EXCEPTION = "ER_SAX_EXCEPTION";
- public static final String ER_XSLT_ERROR = "ER_XSLT_ERROR";
- public static final String ER_CURRENCY_SIGN_ILLEGAL=
- "ER_CURRENCY_SIGN_ILLEGAL";
- public static final String ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM =
- "ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM";
- public static final String ER_CANT_RESOLVE_PREFIX_OF_NON_PREFIX_RESOLVER =
- "ER_CANT_RESOLVE_PREFIX_OF_NON_PREFIX_RESOLVER";
- public static final String ER_REDIRECT_COULDNT_GET_FILENAME =
- "ER_REDIRECT_COULDNT_GET_FILENAME";
- public static final String ER_CANNOT_BUILD_FORMATTERLISTENER_IN_REDIRECT =
- "ER_CANNOT_BUILD_FORMATTERLISTENER_IN_REDIRECT";
- public static final String ER_INVALID_PREFIX_IN_EXCLUDERESULTPREFIX =
- "ER_INVALID_PREFIX_IN_EXCLUDERESULTPREFIX";
- public static final String ER_MISSING_NS_URI = "ER_MISSING_NS_URI";
- public static final String ER_MISSING_ARG_FOR_OPTION =
- "ER_MISSING_ARG_FOR_OPTION";
- public static final String ER_INVALID_OPTION = "ER_INVALID_OPTION";
- public static final String ER_MALFORMED_FORMAT_STRING =
- "ER_MALFORMED_FORMAT_STRING";
- public static final String ER_STYLESHEET_REQUIRES_VERSION_ATTRIB =
- "ER_STYLESHEET_REQUIRES_VERSION_ATTRIB";
- public static final String ER_ILLEGAL_ATTRIBUTE_VALUE =
- "ER_ILLEGAL_ATTRIBUTE_VALUE";
- public static final String ER_CHOOSE_REQUIRES_WHEN ="ER_CHOOSE_REQUIRES_WHEN";
- public static final String ER_NO_APPLY_IMPORT_IN_FOR_EACH =
- "ER_NO_APPLY_IMPORT_IN_FOR_EACH";
- public static final String ER_CANT_USE_DTM_FOR_OUTPUT =
- "ER_CANT_USE_DTM_FOR_OUTPUT";
- public static final String ER_CANT_USE_DTM_FOR_INPUT =
- "ER_CANT_USE_DTM_FOR_INPUT";
- public static final String ER_CALL_TO_EXT_FAILED = "ER_CALL_TO_EXT_FAILED";
- public static final String ER_PREFIX_MUST_RESOLVE = "ER_PREFIX_MUST_RESOLVE";
- public static final String ER_INVALID_UTF16_SURROGATE =
- "ER_INVALID_UTF16_SURROGATE";
- public static final String ER_XSLATTRSET_USED_ITSELF =
- "ER_XSLATTRSET_USED_ITSELF";
- public static final String ER_CANNOT_MIX_XERCESDOM ="ER_CANNOT_MIX_XERCESDOM";
- public static final String ER_TOO_MANY_LISTENERS = "ER_TOO_MANY_LISTENERS";
- public static final String ER_IN_ELEMTEMPLATEELEM_READOBJECT =
- "ER_IN_ELEMTEMPLATEELEM_READOBJECT";
- public static final String ER_DUPLICATE_NAMED_TEMPLATE =
- "ER_DUPLICATE_NAMED_TEMPLATE";
- public static final String ER_INVALID_KEY_CALL = "ER_INVALID_KEY_CALL";
- public static final String ER_REFERENCING_ITSELF = "ER_REFERENCING_ITSELF";
- public static final String ER_ILLEGAL_DOMSOURCE_INPUT =
- "ER_ILLEGAL_DOMSOURCE_INPUT";
- public static final String ER_CLASS_NOT_FOUND_FOR_OPTION =
- "ER_CLASS_NOT_FOUND_FOR_OPTION";
- public static final String ER_REQUIRED_ELEM_NOT_FOUND =
- "ER_REQUIRED_ELEM_NOT_FOUND";
- public static final String ER_INPUT_CANNOT_BE_NULL ="ER_INPUT_CANNOT_BE_NULL";
- public static final String ER_URI_CANNOT_BE_NULL = "ER_URI_CANNOT_BE_NULL";
- public static final String ER_FILE_CANNOT_BE_NULL = "ER_FILE_CANNOT_BE_NULL";
- public static final String ER_SOURCE_CANNOT_BE_NULL =
- "ER_SOURCE_CANNOT_BE_NULL";
- public static final String ER_CANNOT_INIT_BSFMGR = "ER_CANNOT_INIT_BSFMGR";
- public static final String ER_CANNOT_CMPL_EXTENSN = "ER_CANNOT_CMPL_EXTENSN";
- public static final String ER_CANNOT_CREATE_EXTENSN =
- "ER_CANNOT_CREATE_EXTENSN";
- public static final String ER_INSTANCE_MTHD_CALL_REQUIRES =
- "ER_INSTANCE_MTHD_CALL_REQUIRES";
- public static final String ER_INVALID_ELEMENT_NAME ="ER_INVALID_ELEMENT_NAME";
- public static final String ER_ELEMENT_NAME_METHOD_STATIC =
- "ER_ELEMENT_NAME_METHOD_STATIC";
- public static final String ER_EXTENSION_FUNC_UNKNOWN =
- "ER_EXTENSION_FUNC_UNKNOWN";
- public static final String ER_MORE_MATCH_CONSTRUCTOR =
- "ER_MORE_MATCH_CONSTRUCTOR";
- public static final String ER_MORE_MATCH_METHOD = "ER_MORE_MATCH_METHOD";
- public static final String ER_MORE_MATCH_ELEMENT = "ER_MORE_MATCH_ELEMENT";
- public static final String ER_INVALID_CONTEXT_PASSED =
- "ER_INVALID_CONTEXT_PASSED";
- public static final String ER_POOL_EXISTS = "ER_POOL_EXISTS";
- public static final String ER_NO_DRIVER_NAME = "ER_NO_DRIVER_NAME";
- public static final String ER_NO_URL = "ER_NO_URL";
- public static final String ER_POOL_SIZE_LESSTHAN_ONE =
- "ER_POOL_SIZE_LESSTHAN_ONE";
- public static final String ER_INVALID_DRIVER = "ER_INVALID_DRIVER";
- public static final String ER_NO_STYLESHEETROOT = "ER_NO_STYLESHEETROOT";
- public static final String ER_ILLEGAL_XMLSPACE_VALUE =
- "ER_ILLEGAL_XMLSPACE_VALUE";
- public static final String ER_PROCESSFROMNODE_FAILED =
- "ER_PROCESSFROMNODE_FAILED";
- public static final String ER_RESOURCE_COULD_NOT_LOAD =
- "ER_RESOURCE_COULD_NOT_LOAD";
- public static final String ER_BUFFER_SIZE_LESSTHAN_ZERO =
- "ER_BUFFER_SIZE_LESSTHAN_ZERO";
- public static final String ER_UNKNOWN_ERROR_CALLING_EXTENSION =
- "ER_UNKNOWN_ERROR_CALLING_EXTENSION";
- public static final String ER_NO_NAMESPACE_DECL = "ER_NO_NAMESPACE_DECL";
- public static final String ER_ELEM_CONTENT_NOT_ALLOWED =
- "ER_ELEM_CONTENT_NOT_ALLOWED";
- public static final String ER_STYLESHEET_DIRECTED_TERMINATION =
- "ER_STYLESHEET_DIRECTED_TERMINATION";
- public static final String ER_ONE_OR_TWO = "ER_ONE_OR_TWO";
- public static final String ER_TWO_OR_THREE = "ER_TWO_OR_THREE";
- public static final String ER_COULD_NOT_LOAD_RESOURCE =
- "ER_COULD_NOT_LOAD_RESOURCE";
- public static final String ER_CANNOT_INIT_DEFAULT_TEMPLATES =
- "ER_CANNOT_INIT_DEFAULT_TEMPLATES";
- public static final String ER_RESULT_NULL = "ER_RESULT_NULL";
- public static final String ER_RESULT_COULD_NOT_BE_SET =
- "ER_RESULT_COULD_NOT_BE_SET";
- public static final String ER_NO_OUTPUT_SPECIFIED = "ER_NO_OUTPUT_SPECIFIED";
- public static final String ER_CANNOT_TRANSFORM_TO_RESULT_TYPE =
- "ER_CANNOT_TRANSFORM_TO_RESULT_TYPE";
- public static final String ER_CANNOT_TRANSFORM_SOURCE_TYPE =
- "ER_CANNOT_TRANSFORM_SOURCE_TYPE";
- public static final String ER_NULL_CONTENT_HANDLER ="ER_NULL_CONTENT_HANDLER";
- public static final String ER_NULL_ERROR_HANDLER = "ER_NULL_ERROR_HANDLER";
- public static final String ER_CANNOT_CALL_PARSE = "ER_CANNOT_CALL_PARSE";
- public static final String ER_NO_PARENT_FOR_FILTER ="ER_NO_PARENT_FOR_FILTER";
- public static final String ER_NO_STYLESHEET_IN_MEDIA =
- "ER_NO_STYLESHEET_IN_MEDIA";
- public static final String ER_NO_STYLESHEET_PI = "ER_NO_STYLESHEET_PI";
- public static final String ER_NOT_SUPPORTED = "ER_NOT_SUPPORTED";
- public static final String ER_PROPERTY_VALUE_BOOLEAN =
- "ER_PROPERTY_VALUE_BOOLEAN";
- public static final String ER_COULD_NOT_FIND_EXTERN_SCRIPT =
- "ER_COULD_NOT_FIND_EXTERN_SCRIPT";
- public static final String ER_RESOURCE_COULD_NOT_FIND =
- "ER_RESOURCE_COULD_NOT_FIND";
- public static final String ER_OUTPUT_PROPERTY_NOT_RECOGNIZED =
- "ER_OUTPUT_PROPERTY_NOT_RECOGNIZED";
- public static final String ER_FAILED_CREATING_ELEMLITRSLT =
- "ER_FAILED_CREATING_ELEMLITRSLT";
- public static final String ER_VALUE_SHOULD_BE_NUMBER =
- "ER_VALUE_SHOULD_BE_NUMBER";
- public static final String ER_VALUE_SHOULD_EQUAL = "ER_VALUE_SHOULD_EQUAL";
- public static final String ER_FAILED_CALLING_METHOD =
- "ER_FAILED_CALLING_METHOD";
- public static final String ER_FAILED_CREATING_ELEMTMPL =
- "ER_FAILED_CREATING_ELEMTMPL";
- public static final String ER_CHARS_NOT_ALLOWED = "ER_CHARS_NOT_ALLOWED";
- public static final String ER_ATTR_NOT_ALLOWED = "ER_ATTR_NOT_ALLOWED";
- public static final String ER_BAD_VALUE = "ER_BAD_VALUE";
- public static final String ER_ATTRIB_VALUE_NOT_FOUND =
- "ER_ATTRIB_VALUE_NOT_FOUND";
- public static final String ER_ATTRIB_VALUE_NOT_RECOGNIZED =
- "ER_ATTRIB_VALUE_NOT_RECOGNIZED";
- public static final String ER_NULL_URI_NAMESPACE = "ER_NULL_URI_NAMESPACE";
- public static final String ER_NUMBER_TOO_BIG = "ER_NUMBER_TOO_BIG";
- public static final String ER_CANNOT_FIND_SAX1_DRIVER =
- "ER_CANNOT_FIND_SAX1_DRIVER";
- public static final String ER_SAX1_DRIVER_NOT_LOADED =
- "ER_SAX1_DRIVER_NOT_LOADED";
- public static final String ER_SAX1_DRIVER_NOT_INSTANTIATED =
- "ER_SAX1_DRIVER_NOT_INSTANTIATED" ;
- public static final String ER_SAX1_DRIVER_NOT_IMPLEMENT_PARSER =
- "ER_SAX1_DRIVER_NOT_IMPLEMENT_PARSER";
- public static final String ER_PARSER_PROPERTY_NOT_SPECIFIED =
- "ER_PARSER_PROPERTY_NOT_SPECIFIED";
- public static final String ER_PARSER_ARG_CANNOT_BE_NULL =
- "ER_PARSER_ARG_CANNOT_BE_NULL" ;
- public static final String ER_FEATURE = "ER_FEATURE";
- public static final String ER_PROPERTY = "ER_PROPERTY" ;
- public static final String ER_NULL_ENTITY_RESOLVER ="ER_NULL_ENTITY_RESOLVER";
- public static final String ER_NULL_DTD_HANDLER = "ER_NULL_DTD_HANDLER" ;
- public static final String ER_NO_DRIVER_NAME_SPECIFIED =
- "ER_NO_DRIVER_NAME_SPECIFIED";
- public static final String ER_NO_URL_SPECIFIED = "ER_NO_URL_SPECIFIED";
- public static final String ER_POOLSIZE_LESS_THAN_ONE =
- "ER_POOLSIZE_LESS_THAN_ONE";
- public static final String ER_INVALID_DRIVER_NAME = "ER_INVALID_DRIVER_NAME";
- public static final String ER_ERRORLISTENER = "ER_ERRORLISTENER";
- public static final String ER_ASSERT_NO_TEMPLATE_PARENT =
- "ER_ASSERT_NO_TEMPLATE_PARENT";
- public static final String ER_ASSERT_REDUNDENT_EXPR_ELIMINATOR =
- "ER_ASSERT_REDUNDENT_EXPR_ELIMINATOR";
- public static final String ER_NOT_ALLOWED_IN_POSITION =
- "ER_NOT_ALLOWED_IN_POSITION";
- public static final String ER_NONWHITESPACE_NOT_ALLOWED_IN_POSITION =
- "ER_NONWHITESPACE_NOT_ALLOWED_IN_POSITION";
- public static final String ER_NAMESPACE_CONTEXT_NULL_NAMESPACE =
- "ER_NAMESPACE_CONTEXT_NULL_NAMESPACE";
- public static final String ER_NAMESPACE_CONTEXT_NULL_PREFIX =
- "ER_NAMESPACE_CONTEXT_NULL_PREFIX";
- public static final String ER_XPATH_RESOLVER_NULL_QNAME =
- "ER_XPATH_RESOLVER_NULL_QNAME";
- public static final String ER_XPATH_RESOLVER_NEGATIVE_ARITY =
- "ER_XPATH_RESOLVER_NEGATIVE_ARITY";
- public static final String INVALID_TCHAR = "INVALID_TCHAR";
- public static final String INVALID_QNAME = "INVALID_QNAME";
- public static final String INVALID_ENUM = "INVALID_ENUM";
- public static final String INVALID_NMTOKEN = "INVALID_NMTOKEN";
- public static final String INVALID_NCNAME = "INVALID_NCNAME";
- public static final String INVALID_BOOLEAN = "INVALID_BOOLEAN";
- public static final String INVALID_NUMBER = "INVALID_NUMBER";
- public static final String ER_ARG_LITERAL = "ER_ARG_LITERAL";
- public static final String ER_DUPLICATE_GLOBAL_VAR ="ER_DUPLICATE_GLOBAL_VAR";
- public static final String ER_DUPLICATE_VAR = "ER_DUPLICATE_VAR";
- public static final String ER_TEMPLATE_NAME_MATCH = "ER_TEMPLATE_NAME_MATCH";
- public static final String ER_INVALID_PREFIX = "ER_INVALID_PREFIX";
- public static final String ER_NO_ATTRIB_SET = "ER_NO_ATTRIB_SET";
- public static final String ER_FUNCTION_NOT_FOUND =
- "ER_FUNCTION_NOT_FOUND";
- public static final String ER_CANT_HAVE_CONTENT_AND_SELECT =
- "ER_CANT_HAVE_CONTENT_AND_SELECT";
- public static final String ER_INVALID_SET_PARAM_VALUE = "ER_INVALID_SET_PARAM_VALUE";
- public static final String ER_SET_FEATURE_NULL_NAME =
- "ER_SET_FEATURE_NULL_NAME";
- public static final String ER_GET_FEATURE_NULL_NAME =
- "ER_GET_FEATURE_NULL_NAME";
- public static final String ER_UNSUPPORTED_FEATURE =
- "ER_UNSUPPORTED_FEATURE";
- public static final String ER_EXTENSION_ELEMENT_NOT_ALLOWED_IN_SECURE_PROCESSING =
- "ER_EXTENSION_ELEMENT_NOT_ALLOWED_IN_SECURE_PROCESSING";
-
- public static final String WG_FOUND_CURLYBRACE = "WG_FOUND_CURLYBRACE";
- public static final String WG_COUNT_ATTRIB_MATCHES_NO_ANCESTOR =
- "WG_COUNT_ATTRIB_MATCHES_NO_ANCESTOR";
- public static final String WG_EXPR_ATTRIB_CHANGED_TO_SELECT =
- "WG_EXPR_ATTRIB_CHANGED_TO_SELECT";
- public static final String WG_NO_LOCALE_IN_FORMATNUMBER =
- "WG_NO_LOCALE_IN_FORMATNUMBER";
- public static final String WG_LOCALE_NOT_FOUND = "WG_LOCALE_NOT_FOUND";
- public static final String WG_CANNOT_MAKE_URL_FROM ="WG_CANNOT_MAKE_URL_FROM";
- public static final String WG_CANNOT_LOAD_REQUESTED_DOC =
- "WG_CANNOT_LOAD_REQUESTED_DOC";
- public static final String WG_CANNOT_FIND_COLLATOR ="WG_CANNOT_FIND_COLLATOR";
- public static final String WG_FUNCTIONS_SHOULD_USE_URL =
- "WG_FUNCTIONS_SHOULD_USE_URL";
- public static final String WG_ENCODING_NOT_SUPPORTED_USING_UTF8 =
- "WG_ENCODING_NOT_SUPPORTED_USING_UTF8";
- public static final String WG_ENCODING_NOT_SUPPORTED_USING_JAVA =
- "WG_ENCODING_NOT_SUPPORTED_USING_JAVA";
- public static final String WG_SPECIFICITY_CONFLICTS =
- "WG_SPECIFICITY_CONFLICTS";
- public static final String WG_PARSING_AND_PREPARING =
- "WG_PARSING_AND_PREPARING";
- public static final String WG_ATTR_TEMPLATE = "WG_ATTR_TEMPLATE";
- public static final String WG_CONFLICT_BETWEEN_XSLSTRIPSPACE_AND_XSLPRESERVESPACE = "WG_CONFLICT_BETWEEN_XSLSTRIPSPACE_AND_XSLPRESERVESP";
- public static final String WG_ATTRIB_NOT_HANDLED = "WG_ATTRIB_NOT_HANDLED";
- public static final String WG_NO_DECIMALFORMAT_DECLARATION =
- "WG_NO_DECIMALFORMAT_DECLARATION";
- public static final String WG_OLD_XSLT_NS = "WG_OLD_XSLT_NS";
- public static final String WG_ONE_DEFAULT_XSLDECIMALFORMAT_ALLOWED =
- "WG_ONE_DEFAULT_XSLDECIMALFORMAT_ALLOWED";
- public static final String WG_XSLDECIMALFORMAT_NAMES_MUST_BE_UNIQUE =
- "WG_XSLDECIMALFORMAT_NAMES_MUST_BE_UNIQUE";
- public static final String WG_ILLEGAL_ATTRIBUTE = "WG_ILLEGAL_ATTRIBUTE";
- public static final String WG_COULD_NOT_RESOLVE_PREFIX =
- "WG_COULD_NOT_RESOLVE_PREFIX";
- public static final String WG_STYLESHEET_REQUIRES_VERSION_ATTRIB =
- "WG_STYLESHEET_REQUIRES_VERSION_ATTRIB";
- public static final String WG_ILLEGAL_ATTRIBUTE_NAME =
- "WG_ILLEGAL_ATTRIBUTE_NAME";
- public static final String WG_ILLEGAL_ATTRIBUTE_VALUE =
- "WG_ILLEGAL_ATTRIBUTE_VALUE";
- public static final String WG_EMPTY_SECOND_ARG = "WG_EMPTY_SECOND_ARG";
- public static final String WG_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML =
- "WG_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML";
- public static final String WG_PROCESSINGINSTRUCTION_NOTVALID_NCNAME =
- "WG_PROCESSINGINSTRUCTION_NOTVALID_NCNAME";
- public static final String WG_ILLEGAL_ATTRIBUTE_POSITION =
- "WG_ILLEGAL_ATTRIBUTE_POSITION";
- public static final String NO_MODIFICATION_ALLOWED_ERR =
- "NO_MODIFICATION_ALLOWED_ERR";
-
- /*
- * Now fill in the message text.
- * Then fill in the message text for that message code in the
- * array. Use the new error code as the index into the array.
- */
-
- // Error messages...
-
- /** Get the lookup table for error messages.
- *
- * @return The message lookup table.
- */
- public Object[][] getContents()
- {
- return new Object[][] {
-
- /** Error message ID that has a null message, but takes in a single object. */
- {"ER0000" , "{0}" },
-
- { ER_NO_CURLYBRACE,
- "Fel: Uttryck kan inte inneh\u00E5lla '{'"},
-
- { ER_ILLEGAL_ATTRIBUTE ,
- "{0} har ett otill\u00E5tet attribut: {1}"},
-
- {ER_NULL_SOURCENODE_APPLYIMPORTS ,
- "sourceNode \u00E4r null i xsl:apply-imports!"},
-
- {ER_CANNOT_ADD,
- "Kan inte addera {0} till {1}"},
-
- { ER_NULL_SOURCENODE_HANDLEAPPLYTEMPLATES,
- "sourceNode \u00E4r null i handleApplyTemplatesInstruction!"},
-
- { ER_NO_NAME_ATTRIB,
- "{0} m\u00E5ste ha ett namnattribut."},
-
- {ER_TEMPLATE_NOT_FOUND,
- "Hittade inte mallen med namnet: {0}"},
-
- {ER_CANT_RESOLVE_NAME_AVT,
- "Kunde inte matcha namn-AVT i xsl:call-template."},
-
- {ER_REQUIRES_ATTRIB,
- "{0} kr\u00E4ver attribut: {1}"},
-
- { ER_MUST_HAVE_TEST_ATTRIB,
- "{0} m\u00E5ste ha ett ''test''-attribut."},
-
- {ER_BAD_VAL_ON_LEVEL_ATTRIB,
- "Felaktigt v\u00E4rde i niv\u00E5attribut: {0}"},
-
- {ER_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML,
- "Namn p\u00E5 bearbetningsinstruktion kan inte vara 'xml'"},
-
- { ER_PROCESSINGINSTRUCTION_NOTVALID_NCNAME,
- "Namn p\u00E5 bearbetningsinstruktion m\u00E5ste vara ett giltigt NCName: {0}"},
-
- { ER_NEED_MATCH_ATTRIB,
- "{0} m\u00E5ste ha ett matchningsattribut n\u00E4r det anger ett l\u00E4ge."},
-
- { ER_NEED_NAME_OR_MATCH_ATTRIB,
- "{0} kr\u00E4ver antingen ett namn eller ett matchningsattribut."},
-
- {ER_CANT_RESOLVE_NSPREFIX,
- "Kan inte matcha prefix f\u00F6r namnrymd: {0}"},
-
- { ER_ILLEGAL_VALUE,
- "xml:space har ett otill\u00E5tet v\u00E4rde: {0}"},
-
- { ER_NO_OWNERDOC,
- "Underordnad nod har inget \u00E4gardokument!"},
-
- { ER_ELEMTEMPLATEELEM_ERR,
- "ElemTemplateElement-fel: {0}"},
-
- { ER_NULL_CHILD,
- "F\u00F6rs\u00F6ker l\u00E4gga till en null-underordnad!"},
-
- { ER_NEED_SELECT_ATTRIB,
- "{0} kr\u00E4ver ett select-attribut."},
-
- { ER_NEED_TEST_ATTRIB ,
- "xsl:when m\u00E5ste ha ett 'test'-attribut."},
-
- { ER_NEED_NAME_ATTRIB,
- "xsl:with-parametern m\u00E5ste ha ett 'namn'-attribut."},
-
- { ER_NO_CONTEXT_OWNERDOC,
- "context har inget \u00E4gardokument!"},
-
- {ER_COULD_NOT_CREATE_XML_PROC_LIAISON,
- "Kunde inte skapa XML TransformerFactory Liaison: {0}"},
-
- {ER_PROCESS_NOT_SUCCESSFUL,
- "Xalan: Processen utf\u00F6rdes inte."},
-
- { ER_NOT_SUCCESSFUL,
- "Xalan: utf\u00F6rdes inte."},
-
- { ER_ENCODING_NOT_SUPPORTED,
- "Kodningen st\u00F6ds inte: {0}"},
-
- {ER_COULD_NOT_CREATE_TRACELISTENER,
- "Kunde inte TraceListener: {0}"},
-
- {ER_KEY_REQUIRES_NAME_ATTRIB,
- "xsl:key kr\u00E4ver ett 'namn'-attribut!"},
-
- { ER_KEY_REQUIRES_MATCH_ATTRIB,
- "xsl:key kr\u00E4ver ett 'matchning'-attribut!"},
-
- { ER_KEY_REQUIRES_USE_ATTRIB,
- "xsl:key kr\u00E4ver ett 'anv\u00E4nd'-attribut!"},
-
- { ER_REQUIRES_ELEMENTS_ATTRIB,
- "(StylesheetHandler) {0} kr\u00E4ver ett ''element''-attribut!"},
-
- { ER_MISSING_PREFIX_ATTRIB,
- "(StylesheetHandler) ''prefix'' f\u00F6r {0}-attribut saknas"},
-
- { ER_BAD_STYLESHEET_URL,
- "Formatmall-URL \u00E4r felaktig: {0}"},
-
- { ER_FILE_NOT_FOUND,
- "Formatmallfil kunde inte hittas: {0}"},
-
- { ER_IOEXCEPTION,
- "Fick IO-undantag med formatmallfil: {0}"},
-
- { ER_NO_HREF_ATTRIB,
- "(StylesheetHandler) Hittade inte href-attribut f\u00F6r {0}"},
-
- { ER_STYLESHEET_INCLUDES_ITSELF,
- "(StylesheetHandler) {0} inkluderar, direkt eller indirekt, sig sj\u00E4lv!"},
-
- { ER_PROCESSINCLUDE_ERROR,
- "StylesheetHandler.processInclude-fel, {0}"},
-
- { ER_MISSING_LANG_ATTRIB,
- "(StylesheetHandler) ''lang'' f\u00F6r {0}-attribut saknas"},
-
- { ER_MISSING_CONTAINER_ELEMENT_COMPONENT,
- "(StylesheetHandler) {0}-element?? \u00E4r felplacerat Container-elementet ''component'' saknas"},
-
- { ER_CAN_ONLY_OUTPUT_TO_ELEMENT,
- "Kan endast skicka utdata till ett Element, ett DocumentFragment, ett Document eller en PrintWriter."},
-
- { ER_PROCESS_ERROR,
- "StylesheetRoot.process-fel"},
-
- { ER_UNIMPLNODE_ERROR,
- "UnImplNode-fel: {0}"},
-
- { ER_NO_SELECT_EXPRESSION,
- "Fel! Hittade inte xpath select-uttryck (-select)."},
-
- { ER_CANNOT_SERIALIZE_XSLPROCESSOR,
- "Kan inte serialisera en XSLProcessor!"},
-
- { ER_NO_INPUT_STYLESHEET,
- "Formatmallindata ej angiven!"},
-
- { ER_FAILED_PROCESS_STYLESHEET,
- "Kunde inte behandla formatmall!"},
-
- { ER_COULDNT_PARSE_DOC,
- "Kunde inte tolka dokumentet {0}!"},
-
- { ER_COULDNT_FIND_FRAGMENT,
- "Hittade inte fragment: {0}"},
-
- { ER_NODE_NOT_ELEMENT,
- "Nod som pekades p\u00E5 av fragment-identifierare var inte ett element: {0}"},
-
- { ER_FOREACH_NEED_MATCH_OR_NAME_ATTRIB,
- "for-each kr\u00E4ver antingen en matchning eller ett namnattribut"},
-
- { ER_TEMPLATES_NEED_MATCH_OR_NAME_ATTRIB,
- "templates kr\u00E4ver antingen en matchning eller ett namnattribut"},
-
- { ER_NO_CLONE_OF_DOCUMENT_FRAG,
- "Ingen klon av ett dokumentfragment!"},
-
- { ER_CANT_CREATE_ITEM,
- "Kan inte skapa element i resultattr\u00E4d: {0}"},
-
- { ER_XMLSPACE_ILLEGAL_VALUE,
- "xml:space i k\u00E4ll-XML har ett otill\u00E5tet v\u00E4rde: {0}"},
-
- { ER_NO_XSLKEY_DECLARATION,
- "Det finns ingen xsl:key-deklaration f\u00F6r {0}!"},
-
- { ER_CANT_CREATE_URL,
- "Fel! Kan inte skapa URL f\u00F6r: {0}"},
-
- { ER_XSLFUNCTIONS_UNSUPPORTED,
- "xsl:functions st\u00F6ds inte"},
-
- { ER_PROCESSOR_ERROR,
- "XSLT TransformerFactory-fel"},
-
- { ER_NOT_ALLOWED_INSIDE_STYLESHEET,
- "(StylesheetHandler) {0} \u00E4r inte till\u00E5ten inne i en formatmall!"},
-
- { ER_RESULTNS_NOT_SUPPORTED,
- "result-ns st\u00F6ds inte l\u00E4ngre! Anv\u00E4nd xsl:output ist\u00E4llet."},
-
- { ER_DEFAULTSPACE_NOT_SUPPORTED,
- "default-space st\u00F6ds inte l\u00E4ngre! Anv\u00E4nd xsl:strip-space eller xsl:preserve-space ist\u00E4llet."},
-
- { ER_INDENTRESULT_NOT_SUPPORTED,
- "indent-result st\u00F6ds inte l\u00E4ngre! Anv\u00E4nd xsl:output ist\u00E4llet."},
-
- { ER_ILLEGAL_ATTRIB,
- "(StylesheetHandler) {0} har ett otill\u00E5tet attribut: {1}"},
-
- { ER_UNKNOWN_XSL_ELEM,
- "Ok\u00E4nt XSL-element: {0}"},
-
- { ER_BAD_XSLSORT_USE,
- "(StylesheetHandler) xsl:sort kan endast anv\u00E4ndas med xsl:apply-templates eller xsl:for-each."},
-
- { ER_MISPLACED_XSLWHEN,
- "(StylesheetHandler) felplacerade xsl:when!"},
-
- { ER_XSLWHEN_NOT_PARENTED_BY_XSLCHOOSE,
- "(StylesheetHandler) xsl:when h\u00E4rstammar inte fr\u00E5n xsl:choose!"},
-
- { ER_MISPLACED_XSLOTHERWISE,
- "(StylesheetHandler) felplacerade xsl:otherwise!"},
-
- { ER_XSLOTHERWISE_NOT_PARENTED_BY_XSLCHOOSE,
- "(StylesheetHandler) xsl:otherwise h\u00E4rstammar inte fr\u00E5n xsl:choose!"},
-
- { ER_NOT_ALLOWED_INSIDE_TEMPLATE,
- "(StylesheetHandler) {0} \u00E4r inte till\u00E5ten inne i en mall!"},
-
- { ER_UNKNOWN_EXT_NS_PREFIX,
- "(StylesheetHandler) ok\u00E4nt namnrymdsprefix {1} f\u00F6r till\u00E4gg {0}"},
-
- { ER_IMPORTS_AS_FIRST_ELEM,
- "(StylesheetHandler) Imports kan endast f\u00F6rekomma som de f\u00F6rsta elementen i formatmallen!"},
-
- { ER_IMPORTING_ITSELF,
- "(StylesheetHandler) {0} importerar, direkt eller indirekt, sig sj\u00E4lv!"},
-
- { ER_XMLSPACE_ILLEGAL_VAL,
- "(StylesheetHandler) xml:space har ett otill\u00E5tet v\u00E4rde: {0}"},
-
- { ER_PROCESSSTYLESHEET_NOT_SUCCESSFUL,
- "processStylesheet utf\u00F6rdes inte!"},
-
- { ER_SAX_EXCEPTION,
- "SAX-undantag"},
-
-// add this message to fix bug 21478
- { ER_FUNCTION_NOT_SUPPORTED,
- "Funktionen st\u00F6ds inte!"},
-
- { ER_XSLT_ERROR,
- "XSLT-fel"},
-
- { ER_CURRENCY_SIGN_ILLEGAL,
- "valutatecken \u00E4r inte till\u00E5tet i formatm\u00F6nsterstr\u00E4ng"},
-
- { ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM,
- "Dokumentfunktion st\u00F6ds inte i Stylesheet DOM!"},
-
- { ER_CANT_RESOLVE_PREFIX_OF_NON_PREFIX_RESOLVER,
- "Kan inte matcha prefix med matchning som saknar prefix!"},
-
- { ER_REDIRECT_COULDNT_GET_FILENAME,
- "Redirect-till\u00E4gg: Hittade inte filnamn - fil eller valattribut m\u00E5ste returnera giltig str\u00E4ng."},
-
- { ER_CANNOT_BUILD_FORMATTERLISTENER_IN_REDIRECT,
- "Kan inte bygga FormatterListener i Redirect-till\u00E4gg!"},
-
- { ER_INVALID_PREFIX_IN_EXCLUDERESULTPREFIX,
- "Prefix i exclude-result-prefixes \u00E4r inte giltigt: {0}"},
-
- { ER_MISSING_NS_URI,
- "Namnrymds-URI saknas f\u00F6r angivna prefix"},
-
- { ER_MISSING_ARG_FOR_OPTION,
- "Argument saknas f\u00F6r alternativet: {0}"},
-
- { ER_INVALID_OPTION,
- "Ogiltigt alternativ: {0}"},
-
- { ER_MALFORMED_FORMAT_STRING,
- "Felaktigt utformad formatstr\u00E4ng: {0}"},
-
- { ER_STYLESHEET_REQUIRES_VERSION_ATTRIB,
- "xsl:stylesheet kr\u00E4ver ett 'version'-attribut!"},
-
- { ER_ILLEGAL_ATTRIBUTE_VALUE,
- "Attribut: {0} har ett otill\u00E5tet v\u00E4rde: {1}"},
-
- { ER_CHOOSE_REQUIRES_WHEN,
- "xsl:choose kr\u00E4ver xsl:when"},
-
- { ER_NO_APPLY_IMPORT_IN_FOR_EACH,
- "xsl:apply-imports inte till\u00E5tet i xsl:for-each"},
-
- { ER_CANT_USE_DTM_FOR_OUTPUT,
- "Kan inte anv\u00E4nda DTMLiaison till en DOM utdatanod... skicka en com.sun.org.apache.xpath.internal.DOM2Helper ist\u00E4llet!"},
-
- { ER_CANT_USE_DTM_FOR_INPUT,
- "Kan inte anv\u00E4nda DTMLiaison till en DOM indatanod... skicka en com.sun.org.apache.xpath.internal.DOM2Helper ist\u00E4llet!"},
-
- { ER_CALL_TO_EXT_FAILED,
- "Anrop till till\u00E4ggselement utf\u00F6rdes inte: {0}"},
-
- { ER_PREFIX_MUST_RESOLVE,
- "Prefix m\u00E5ste matchas till en namnrymd: {0}"},
-
- { ER_INVALID_UTF16_SURROGATE,
- "Ogiltigt UTF-16-surrogat uppt\u00E4ckt: {0} ?"},
-
- { ER_XSLATTRSET_USED_ITSELF,
- "xsl:attribute-set {0} anv\u00E4nde sig sj\u00E4lvt, vilket kommer att orsaka en o\u00E4ndlig slinga."},
-
- { ER_CANNOT_MIX_XERCESDOM,
- "Kan inte blanda icke-Xerces-DOM-indata med Xerces-DOM-utdata!"},
-
- { ER_TOO_MANY_LISTENERS,
- "addTraceListenersToStylesheet - TooManyListenersException"},
-
- { ER_IN_ELEMTEMPLATEELEM_READOBJECT,
- "I ElemTemplateElement.readObject: {0}"},
-
- { ER_DUPLICATE_NAMED_TEMPLATE,
- "Hittade fler \u00E4n en mall med namnet: {0}"},
-
- { ER_INVALID_KEY_CALL,
- "Ogiltigt funktionsanrop: rekursiva key()-anrop \u00E4r inte till\u00E5tna"},
-
- { ER_REFERENCING_ITSELF,
- "Variabeln {0} refererar, direkt eller indirekt, till sig sj\u00E4lv!"},
-
- { ER_ILLEGAL_DOMSOURCE_INPUT,
- "Indatanoden till en DOMSource f\u00F6r newTemplates f\u00E5r inte vara null!"},
-
- { ER_CLASS_NOT_FOUND_FOR_OPTION,
- "Klassfil f\u00F6r alternativ {0} saknas"},
-
- { ER_REQUIRED_ELEM_NOT_FOUND,
- "Obligatoriska element hittades inte: {0}"},
-
- { ER_INPUT_CANNOT_BE_NULL,
- "InputStream kan inte vara null"},
-
- { ER_URI_CANNOT_BE_NULL,
- "URI kan inte vara null"},
-
- { ER_FILE_CANNOT_BE_NULL,
- "Fil kan inte vara null"},
-
- { ER_SOURCE_CANNOT_BE_NULL,
- "InputSource kan inte vara null"},
-
- { ER_CANNOT_INIT_BSFMGR,
- "Kunde inte initiera BSF Manager"},
-
- { ER_CANNOT_CMPL_EXTENSN,
- "Kunde inte kompilera till\u00E4gg"},
-
- { ER_CANNOT_CREATE_EXTENSN,
- "Kunde inte skapa till\u00E4gg: {0} p\u00E5 grund av: {1}"},
-
- { ER_INSTANCE_MTHD_CALL_REQUIRES,
- "Instansmetodanrop till metod {0} kr\u00E4ver en objektinstans som f\u00F6rsta argument"},
-
- { ER_INVALID_ELEMENT_NAME,
- "Ogiltigt elementnamn angivet {0}"},
-
- { ER_ELEMENT_NAME_METHOD_STATIC,
- "Elementnamnmetod m\u00E5ste vara statisk {0}"},
-
- { ER_EXTENSION_FUNC_UNKNOWN,
- "Till\u00E4ggsfunktion {0} : {1} \u00E4r ok\u00E4nd"},
-
- { ER_MORE_MATCH_CONSTRUCTOR,
- "Fler \u00E4n en b\u00E4sta matchning f\u00F6r konstruktor f\u00F6r {0}"},
-
- { ER_MORE_MATCH_METHOD,
- "Fler \u00E4n en b\u00E4sta matchning f\u00F6r metod {0}"},
-
- { ER_MORE_MATCH_ELEMENT,
- "Fler \u00E4n en b\u00E4sta matchning f\u00F6r elementmetod {0}"},
-
- { ER_INVALID_CONTEXT_PASSED,
- "Ogiltig kontext skickad f\u00F6r att utv\u00E4rdera {0}"},
-
- { ER_POOL_EXISTS,
- "Pool finns redan"},
-
- { ER_NO_DRIVER_NAME,
- "Inget drivrutinsnamn angivet"},
-
- { ER_NO_URL,
- "Ingen URL angiven"},
-
- { ER_POOL_SIZE_LESSTHAN_ONE,
- "Poolstorlek \u00E4r mindre \u00E4n ett!"},
-
- { ER_INVALID_DRIVER,
- "Ogiltigt drivrutinsnamn angivet!"},
-
- { ER_NO_STYLESHEETROOT,
- "Hittade inte formatmallen roten!"},
-
- { ER_ILLEGAL_XMLSPACE_VALUE,
- "Otill\u00E5tet v\u00E4rde f\u00F6r xml:space"},
-
- { ER_PROCESSFROMNODE_FAILED,
- "processFromNode utf\u00F6rdes inte"},
-
- { ER_RESOURCE_COULD_NOT_LOAD,
- "Resursen [ {0} ] kunde inte laddas: {1} \n {2} \t {3}"},
-
- { ER_BUFFER_SIZE_LESSTHAN_ZERO,
- "Buffertstorlek <=0"},
-
- { ER_UNKNOWN_ERROR_CALLING_EXTENSION,
- "Ok\u00E4nt fel vid anrop av till\u00E4gg"},
-
- { ER_NO_NAMESPACE_DECL,
- "Prefix {0} har ingen motsvarande namnrymdsdeklaration"},
-
- { ER_ELEM_CONTENT_NOT_ALLOWED,
- "Elementinneh\u00E5ll inte till\u00E5tet f\u00F6r lang=javaclass {0}"},
-
- { ER_STYLESHEET_DIRECTED_TERMINATION,
- "Avslutning via formatmall"},
-
- { ER_ONE_OR_TWO,
- "1 eller 2"},
-
- { ER_TWO_OR_THREE,
- "2 eller 3"},
-
- { ER_COULD_NOT_LOAD_RESOURCE,
- "Kunde inte ladda {0} (kontrollera CLASSPATH), anv\u00E4nder nu enbart standardv\u00E4rden"},
-
- { ER_CANNOT_INIT_DEFAULT_TEMPLATES,
- "Kan inte initiera standardmallar"},
-
- { ER_RESULT_NULL,
- "Result borde inte vara null"},
-
- { ER_RESULT_COULD_NOT_BE_SET,
- "Result kunde inte st\u00E4llas in"},
-
- { ER_NO_OUTPUT_SPECIFIED,
- "Ingen utdata angiven"},
-
- { ER_CANNOT_TRANSFORM_TO_RESULT_TYPE,
- "Kan inte omvandla till Result av typ {0}"},
-
- { ER_CANNOT_TRANSFORM_SOURCE_TYPE,
- "Kan inte omvandla Source av typ {0}"},
-
- { ER_NULL_CONTENT_HANDLER,
- "Inneh\u00E5llshanterare med v\u00E4rde null"},
-
- { ER_NULL_ERROR_HANDLER,
- "Felhanterare med v\u00E4rde null"},
-
- { ER_CANNOT_CALL_PARSE,
- "parse kan inte anropas om ContentHandler inte har satts"},
-
- { ER_NO_PARENT_FOR_FILTER,
- "Ingen \u00F6verordnad f\u00F6r filter"},
-
- { ER_NO_STYLESHEET_IN_MEDIA,
- "Formatmall saknas i: {0}, media= {1}"},
-
- { ER_NO_STYLESHEET_PI,
- "PI f\u00F6r xml-formatmall saknas i: {0}"},
-
- { ER_NOT_SUPPORTED,
- "Underst\u00F6ds inte: {0}"},
-
- { ER_PROPERTY_VALUE_BOOLEAN,
- "V\u00E4rde f\u00F6r egenskap {0} b\u00F6r vara en boolesk instans"},
-
- { ER_COULD_NOT_FIND_EXTERN_SCRIPT,
- "Kunde inte h\u00E4mta externt skript fr\u00E5n {0}"},
-
- { ER_RESOURCE_COULD_NOT_FIND,
- "Resursen [ {0} ] kunde inte h\u00E4mtas.\n {1}"},
-
- { ER_OUTPUT_PROPERTY_NOT_RECOGNIZED,
- "Utdataegenskap kan inte identifieras: {0}"},
-
- { ER_FAILED_CREATING_ELEMLITRSLT,
- "Kunde inte skapa instans av ElemLiteralResult"},
-
- //Earlier (JDK 1.4 XALAN 2.2-D11) at key code '204' the key name was ER_PRIORITY_NOT_PARSABLE
- // In latest Xalan code base key name is ER_VALUE_SHOULD_BE_NUMBER. This should also be taken care
- //in locale specific files like XSLTErrorResources_de.java, XSLTErrorResources_fr.java etc.
- //NOTE: Not only the key name but message has also been changed.
- { ER_VALUE_SHOULD_BE_NUMBER,
- "V\u00E4rdet f\u00F6r {0} b\u00F6r inneh\u00E5lla ett tal som kan tolkas"},
-
- { ER_VALUE_SHOULD_EQUAL,
- "V\u00E4rdet f\u00F6r {0} b\u00F6r vara ja eller nej"},
-
- { ER_FAILED_CALLING_METHOD,
- "Kunde inte anropa metoden {0}"},
-
- { ER_FAILED_CREATING_ELEMTMPL,
- "Kunde inte skapa instans av ElemTemplateElement"},
-
- { ER_CHARS_NOT_ALLOWED,
- "Tecken \u00E4r inte till\u00E5tna i dokumentet i det h\u00E4r skedet"},
-
- { ER_ATTR_NOT_ALLOWED,
- "Attributet \"{0}\" \u00E4r inte till\u00E5tet i elementet {1}!"},
-
- { ER_BAD_VALUE,
- "{0} felaktigt v\u00E4rde {1} "},
-
- { ER_ATTRIB_VALUE_NOT_FOUND,
- "Attributet {0} saknas "},
-
- { ER_ATTRIB_VALUE_NOT_RECOGNIZED,
- "Attributv\u00E4rdet {0} kan inte identifieras "},
-
- { ER_NULL_URI_NAMESPACE,
- "F\u00F6rs\u00F6ker generera ett namnrymdsprefix med en null-URI"},
-
- { ER_NUMBER_TOO_BIG,
- "F\u00F6rs\u00F6ker formatera ett tal som \u00E4r st\u00F6rre \u00E4n det st\u00F6rsta l\u00E5nga heltalet"},
-
- { ER_CANNOT_FIND_SAX1_DRIVER,
- "Hittar inte SAX1-drivrutinen klass {0}"},
-
- { ER_SAX1_DRIVER_NOT_LOADED,
- "SAX1-drivrutinen klass {0} hittades, men kan inte laddas"},
-
- { ER_SAX1_DRIVER_NOT_INSTANTIATED,
- "SAX1-drivrutinen klass {0} laddades, men kan inte instansieras"},
-
- { ER_SAX1_DRIVER_NOT_IMPLEMENT_PARSER,
- "SAX1-drivrutinen klass {0} implementerar inte org.xml.sax.Parser"},
-
- { ER_PARSER_PROPERTY_NOT_SPECIFIED,
- "Systemegenskapen org.xml.sax.parser \u00E4r inte angiven"},
-
- { ER_PARSER_ARG_CANNOT_BE_NULL,
- "Parserargument m\u00E5ste vara null"},
-
- { ER_FEATURE,
- "Funktion: {0}"},
-
- { ER_PROPERTY,
- "Egenskap: {0}"},
-
- { ER_NULL_ENTITY_RESOLVER,
- "Enhetsmatchning med v\u00E4rde null"},
-
- { ER_NULL_DTD_HANDLER,
- "DTD-hanterare med v\u00E4rde null"},
-
- { ER_NO_DRIVER_NAME_SPECIFIED,
- "Inget angivet drivrutinsnamn!"},
-
- { ER_NO_URL_SPECIFIED,
- "Ingen URL angiven!"},
-
- { ER_POOLSIZE_LESS_THAN_ONE,
- "Poolstorlek \u00E4r mindre \u00E4n ett!"},
-
- { ER_INVALID_DRIVER_NAME,
- "Ogiltigt drivrutinsnamn angivet!"},
-
- { ER_ERRORLISTENER,
- "ErrorListener"},
-
-
-// Note to translators: The following message should not normally be displayed
-// to users. It describes a situation in which the processor has detected
-// an internal consistency problem in itself, and it provides this message
-// for the developer to help diagnose the problem. The name
-// 'ElemTemplateElement' is the name of a class, and should not be
-// translated.
- { ER_ASSERT_NO_TEMPLATE_PARENT,
- "Programmerarfel! Uttrycket har ingen \u00F6verordnad ElemTemplateElement!"},
-
-
-// Note to translators: The following message should not normally be displayed
-// to users. It describes a situation in which the processor has detected
-// an internal consistency problem in itself, and it provides this message
-// for the developer to help diagnose the problem. The substitution text
-// provides further information in order to diagnose the problem. The name
-// 'RedundentExprEliminator' is the name of a class, and should not be
-// translated.
- { ER_ASSERT_REDUNDENT_EXPR_ELIMINATOR,
- "Programmerarens utsaga i RedundentExprEliminator: {0}"},
-
- { ER_NOT_ALLOWED_IN_POSITION,
- "{0} \u00E4r inte till\u00E5ten i denna position i formatmallen!"},
-
- { ER_NONWHITESPACE_NOT_ALLOWED_IN_POSITION,
- "Text utan blanktecken \u00E4r inte till\u00E5ten i denna position i formatmallen!"},
-
- // This code is shared with warning codes.
- // SystemId Unknown
- { INVALID_TCHAR,
- "Otill\u00E5tet v\u00E4rde: {1} anv\u00E4nds f\u00F6r CHAR-attributet: {0}. Ett attribut av CHAR-typ f\u00E5r bara ha 1 tecken!"},
-
- // Note to translators: The following message is used if the value of
- // an attribute in a stylesheet is invalid. "QNAME" is the XML data-type of
- // the attribute, and should not be translated. The substitution text {1} is
- // the attribute value and {0} is the attribute name.
- //The following codes are shared with the warning codes...
- { INVALID_QNAME,
- "Otill\u00E5tet v\u00E4rde: {1} anv\u00E4nds f\u00F6r QNAME-attributet: {0}"},
-
- // Note to translators: The following message is used if the value of
- // an attribute in a stylesheet is invalid. "ENUM" is the XML data-type of
- // the attribute, and should not be translated. The substitution text {1} is
- // the attribute value, {0} is the attribute name, and {2} is a list of valid
- // values.
- { INVALID_ENUM,
- "Otill\u00E5tet v\u00E4rde: {1} anv\u00E4nds f\u00F6r ENUM-attributet: {0}. Giltiga v\u00E4rden \u00E4r: {2}."},
-
-// Note to translators: The following message is used if the value of
-// an attribute in a stylesheet is invalid. "NMTOKEN" is the XML data-type
-// of the attribute, and should not be translated. The substitution text {1} is
-// the attribute value and {0} is the attribute name.
- { INVALID_NMTOKEN,
- "Otill\u00E5tet v\u00E4rde: {1} anv\u00E4nds f\u00F6r NMTOKEN-attributet: {0} "},
-
-// Note to translators: The following message is used if the value of
-// an attribute in a stylesheet is invalid. "NCNAME" is the XML data-type
-// of the attribute, and should not be translated. The substitution text {1} is
-// the attribute value and {0} is the attribute name.
- { INVALID_NCNAME,
- "Otill\u00E5tet v\u00E4rde: {1} anv\u00E4nds f\u00F6r NCNAME-attributet: {0} "},
-
-// Note to translators: The following message is used if the value of
-// an attribute in a stylesheet is invalid. "boolean" is the XSLT data-type
-// of the attribute, and should not be translated. The substitution text {1} is
-// the attribute value and {0} is the attribute name.
- { INVALID_BOOLEAN,
- "Otill\u00E5tet v\u00E4rde: {1} anv\u00E4nds f\u00F6r boolean-attributet: {0} "},
-
-// Note to translators: The following message is used if the value of
-// an attribute in a stylesheet is invalid. "number" is the XSLT data-type
-// of the attribute, and should not be translated. The substitution text {1} is
-// the attribute value and {0} is the attribute name.
- { INVALID_NUMBER,
- "Otill\u00E5tet v\u00E4rde: {1} anv\u00E4nds f\u00F6r number-attributet: {0} "},
-
-
- // End of shared codes...
-
-// Note to translators: A "match pattern" is a special form of XPath expression
-// that is used for matching patterns. The substitution text is the name of
-// a function. The message indicates that when this function is referenced in
-// a match pattern, its argument must be a string literal (or constant.)
-// ER_ARG_LITERAL - new error message for bugzilla //5202
- { ER_ARG_LITERAL,
- "Argument f\u00F6r {0} i matchningsm\u00F6nstret m\u00E5ste vara litteral."},
-
-// Note to translators: The following message indicates that two definitions of
-// a variable. A "global variable" is a variable that is accessible everywher
-// in the stylesheet.
-// ER_DUPLICATE_GLOBAL_VAR - new error message for bugzilla #790
- { ER_DUPLICATE_GLOBAL_VAR,
- "Dubbel deklaration av global variabel."},
-
-
-// Note to translators: The following message indicates that two definitions of
-// a variable were encountered.
-// ER_DUPLICATE_VAR - new error message for bugzilla #790
- { ER_DUPLICATE_VAR,
- "Dubbel deklaration av variabel."},
-
- // Note to translators: "xsl:template, "name" and "match" are XSLT keywords
- // which must not be translated.
- // ER_TEMPLATE_NAME_MATCH - new error message for bugzilla #789
- { ER_TEMPLATE_NAME_MATCH,
- "xsl:template m\u00E5ste ha name- och/eller match-attribut"},
-
- // Note to translators: "exclude-result-prefixes" is an XSLT keyword which
- // should not be translated. The message indicates that a namespace prefix
- // encountered as part of the value of the exclude-result-prefixes attribute
- // was in error.
- // ER_INVALID_PREFIX - new error message for bugzilla #788
- { ER_INVALID_PREFIX,
- "Prefix i exclude-result-prefixes \u00E4r inte giltigt: {0}"},
-
- // Note to translators: An "attribute set" is a set of attributes that can
- // be added to an element in the output document as a group. The message
- // indicates that there was a reference to an attribute set named {0} that
- // was never defined.
- // ER_NO_ATTRIB_SET - new error message for bugzilla #782
- { ER_NO_ATTRIB_SET,
- "attributserien {0} finns inte"},
-
- // Note to translators: This message indicates that there was a reference
- // to a function named {0} for which no function definition could be found.
- { ER_FUNCTION_NOT_FOUND,
- "Det finns ingen funktion med namnet {0}"},
-
- // Note to translators: This message indicates that the XSLT instruction
- // that is named by the substitution text {0} must not contain other XSLT
- // instructions (content) or a "select" attribute. The word "select" is
- // an XSLT keyword in this case and must not be translated.
- { ER_CANT_HAVE_CONTENT_AND_SELECT,
- "Elementet {0} kan inte ha b\u00E5de inneh\u00E5ll och select-attribut."},
-
- // Note to translators: This message indicates that the value argument
- // of setParameter must be a valid Java Object.
- { ER_INVALID_SET_PARAM_VALUE,
- "Parameterv\u00E4rdet f\u00F6r {0} m\u00E5ste vara giltigt Java-objekt"},
-
- { ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX_FOR_DEFAULT,
- "result-prefix-attributet i xsl:namespace-alias-element har v\u00E4rdet '#default', men det finns ingen deklaration av standardnamnrymd inom omfattningen av elementet"},
-
- { ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX,
- "result-prefix-attributet i xsl:namespace-alias-element har v\u00E4rdet ''{0}'', men det finns ingen deklaration av namnrymd f\u00F6r prefixet ''{0}'' inom omfattningen av elementet."},
-
- { ER_SET_FEATURE_NULL_NAME,
- "Funktionsnamnet kan inte vara null i TransformerFactory.setFeature(namn p\u00E5 str\u00E4ng, booleskt v\u00E4rde)."},
-
- { ER_GET_FEATURE_NULL_NAME,
- "Funktionsnamnet kan inte vara null i TransformerFactory.getFeature(namn p\u00E5 str\u00E4ng)."},
-
- { ER_UNSUPPORTED_FEATURE,
- "Kan inte st\u00E4lla in funktionen ''{0}'' i denna TransformerFactory."},
-
- { ER_EXTENSION_ELEMENT_NOT_ALLOWED_IN_SECURE_PROCESSING,
- "Anv\u00E4ndning av till\u00E4ggselementet ''{0}'' \u00E4r inte till\u00E5tet n\u00E4r s\u00E4ker bearbetning till\u00E4mpas."},
-
- { ER_NAMESPACE_CONTEXT_NULL_NAMESPACE,
- "Kan inte h\u00E4mta prefix f\u00F6r namnrymds-uri som \u00E4r null."},
-
- { ER_NAMESPACE_CONTEXT_NULL_PREFIX,
- "Kan inte h\u00E4mta namnrymds-uri f\u00F6r prefix som \u00E4r null."},
-
- { ER_XPATH_RESOLVER_NULL_QNAME,
- "Funktionsnamn f\u00E5r inte vara null."},
-
- { ER_XPATH_RESOLVER_NEGATIVE_ARITY,
- "Ariteten kan inte vara negativ."},
- // Warnings...
-
- { WG_FOUND_CURLYBRACE,
- "Hittade '}' men det finns ingen \u00F6ppen attributmall!"},
-
- { WG_COUNT_ATTRIB_MATCHES_NO_ANCESTOR,
- "Varning: r\u00E4knarattribut matchar inte \u00F6verordnad i xsl:number! Target = {0}"},
-
- { WG_EXPR_ATTRIB_CHANGED_TO_SELECT,
- "Gammal syntax: Namnet p\u00E5 'expr'-attributet har \u00E4ndrats till 'select'."},
-
- { WG_NO_LOCALE_IN_FORMATNUMBER,
- "Xalan hanterar \u00E4nnu inte spr\u00E5kkonventionen i funktionen format-number."},
-
- { WG_LOCALE_NOT_FOUND,
- "Varning: Hittade inte spr\u00E5kkonvention f\u00F6r xml:lang={0}"},
-
- { WG_CANNOT_MAKE_URL_FROM,
- "Kan inte skapa URL fr\u00E5n: {0}"},
-
- { WG_CANNOT_LOAD_REQUESTED_DOC,
- "Kan inte ladda beg\u00E4rt dokument: {0}"},
-
- { WG_CANNOT_FIND_COLLATOR,
- "Hittade inte kollationering f\u00F6r <sort xml:lang={0}"},
-
- { WG_FUNCTIONS_SHOULD_USE_URL,
- "Gammal syntax: funktionsinstruktionen b\u00F6r anv\u00E4nda url:en {0}"},
-
- { WG_ENCODING_NOT_SUPPORTED_USING_UTF8,
- "kodning underst\u00F6ds inte: {0}, anv\u00E4nder UTF-8"},
-
- { WG_ENCODING_NOT_SUPPORTED_USING_JAVA,
- "kodning underst\u00F6ds inte: {0}, anv\u00E4nder Java {1}"},
-
- { WG_SPECIFICITY_CONFLICTS,
- "Specifika konflikter hittades: {0} Senast hittade i formatmall kommer att anv\u00E4ndas."},
-
- { WG_PARSING_AND_PREPARING,
- "========= Tolkar och f\u00F6rbereder {0} =========="},
-
- { WG_ATTR_TEMPLATE,
- "Attributmall, {0}"},
-
- { WG_CONFLICT_BETWEEN_XSLSTRIPSPACE_AND_XSLPRESERVESPACE,
- "Matchningskonflikt mellan xsl:strip-space och xsl:preserve-space"},
-
- { WG_ATTRIB_NOT_HANDLED,
- "Xalan hanterar \u00E4nnu inte attributet {0}!"},
-
- { WG_NO_DECIMALFORMAT_DECLARATION,
- "Hittade ingen deklaration f\u00F6r decimalformatet: {0}"},
-
- { WG_OLD_XSLT_NS,
- "XSLT-namnrymd saknas eller \u00E4r inkorrekt. "},
-
- { WG_ONE_DEFAULT_XSLDECIMALFORMAT_ALLOWED,
- "Endast en standarddeklaration av xsl:decimal-format \u00E4r till\u00E5ten."},
-
- { WG_XSLDECIMALFORMAT_NAMES_MUST_BE_UNIQUE,
- "Namn p\u00E5 xsl:decimal-format m\u00E5ste vara unika. Namnet \"{0}\" har blivit duplicerat."},
-
- { WG_ILLEGAL_ATTRIBUTE,
- "{0} har ett otill\u00E5tet attribut: {1}"},
-
- { WG_COULD_NOT_RESOLVE_PREFIX,
- "Kunde inte matcha namnrymdsprefix: {0}. Noden ignoreras."},
-
- { WG_STYLESHEET_REQUIRES_VERSION_ATTRIB,
- "xsl:stylesheet kr\u00E4ver ett 'version'-attribut!"},
-
- { WG_ILLEGAL_ATTRIBUTE_NAME,
- "Otill\u00E5tet attributnamn: {0}"},
-
- { WG_ILLEGAL_ATTRIBUTE_VALUE,
- "Otill\u00E5tet v\u00E4rde anv\u00E4nds f\u00F6r attributet {0}: {1}"},
-
- { WG_EMPTY_SECOND_ARG,
- "Resulterande nodupps\u00E4ttning fr\u00E5n dokumentfunktionens andra argumentet \u00E4r tomt. En tom nodupps\u00E4ttning anv\u00E4nds."},
-
- //Following are the new WARNING keys added in XALAN code base after Jdk 1.4 (Xalan 2.2-D11)
-
- // Note to translators: "name" and "xsl:processing-instruction" are keywords
- // and must not be translated.
- { WG_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML,
- "'name'-attributets v\u00E4rde f\u00F6r xsl:processing-instruction kan inte vara 'xml'"},
-
- // Note to translators: "name" and "xsl:processing-instruction" are keywords
- // and must not be translated. "NCName" is an XML data-type and must not be
- // translated.
- { WG_PROCESSINGINSTRUCTION_NOTVALID_NCNAME,
- "''name''-attributets v\u00E4rde f\u00F6r xsl:processing-instruction m\u00E5ste vara giltigt NCName: {0}"},
-
- // Note to translators: This message is reported if the stylesheet that is
- // being processed attempted to construct an XML document with an attribute in a
- // place other than on an element. The substitution text specifies the name of
- // the attribute.
- { WG_ILLEGAL_ATTRIBUTE_POSITION,
- "Kan inte l\u00E4gga till attributet {0} efter underordnade noder eller innan ett element har skapats. Attributet ignoreras."},
-
- { NO_MODIFICATION_ALLOWED_ERR,
- "F\u00F6rs\u00F6ker \u00E4ndra ett objekt d\u00E4r \u00E4ndringar inte \u00E4r till\u00E5tna."
- },
-
- //Check: WHY THERE IS A GAP B/W NUMBERS in the XSLTErrorResources properties file?
-
- // Other miscellaneous text used inside the code...
- { "ui_language", "en"},
- { "help_language", "en" },
- { "language", "en" },
- { "BAD_CODE", "Parameter f\u00F6r createMessage ligger utanf\u00F6r gr\u00E4nsv\u00E4rdet"},
- { "FORMAT_FAILED", "Undantag utl\u00F6st vid messageFormat-anrop"},
- { "version", ">>>>>>> Xalan version "},
- { "version2", "<<<<<<<"},
- { "yes", "ja"},
- { "line", "Rad nr"},
- { "column","Kolumn nr"},
- { "xsldone", "XSLProcessor: utf\u00F6rd"},
-
-
- // Note to translators: The following messages provide usage information
- // for the Xalan Process command line. "Process" is the name of a Java class,
- // and should not be translated.
- { "xslProc_option", "Process-klassalternativ f\u00F6r Xalan-J-kommandorad:"},
- { "xslProc_option", "Process-klassalternativ f\u00F6r Xalan-J-kommandorad:"},
- { "xslProc_invalid_xsltc_option", "Alternativet {0} underst\u00F6ds inte i XSLTC-l\u00E4ge."},
- { "xslProc_invalid_xalan_option", "Alternativet {0} kan anv\u00E4ndas endast med -XSLTC."},
- { "xslProc_no_input", "Fel: Ingen formatmall eller indata-xml har angetts. K\u00F6r kommandot utan n\u00E5got alternativ f\u00F6r att visa syntax."},
- { "xslProc_common_options", "-Allm\u00E4nna alternativ-"},
- { "xslProc_xalan_options", "-Alternativ f\u00F6r Xalan-"},
- { "xslProc_xsltc_options", "-Alternativ f\u00F6r XSLTC-"},
- { "xslProc_return_to_continue", "(tryck p\u00E5 Enter f\u00F6r att forts\u00E4tta)"},
-
- // Note to translators: The option name and the parameter name do not need to
- // be translated. Only translate the messages in parentheses. Note also that
- // leading whitespace in the messages is used to indent the usage information
- // for each option in the English messages.
- // Do not translate the keywords: XSLTC, SAX, DOM and DTM.
- { "optionXSLTC", " [-XSLTC (anv\u00E4nd XSLTC f\u00F6r transformering)]"},
- { "optionIN", " [-IN inputXMLURL]"},
- { "optionXSL", " [-XSL XSLTransformationURL]"},
- { "optionOUT", " [-OUT outputFileName]"},
- { "optionLXCIN", " [-LXCIN compiledStylesheetFileNameIn]"},
- { "optionLXCOUT", " [-LXCOUT compiledStylesheetFileNameOutOut]"},
- { "optionPARSER", " [-PARSER fullt kvalificerat klassnamn p\u00E5 parserf\u00F6rbindelse]"},
- { "optionE", " [-E (Ut\u00F6ka inte enhetsreferenser)]"},
- { "optionV", " [-E (Ut\u00F6ka inte enhetsreferenser)]"},
- { "optionQC", " [-QC (Tysta m\u00F6nsterkonfliktvarningar)]"},
- { "optionQ", " [-Q (Tyst l\u00E4ge)]"},
- { "optionLF", " [-LF (Anv\u00E4nd radmatningar endast f\u00F6r utdata {standard \u00E4r CR/LF})]"},
- { "optionCR", " [-CR (Anv\u00E4nd radmatningar endast f\u00F6r utdata {standard \u00E4r CR/LF})]"},
- { "optionESCAPE", " [-ESCAPE (Vilka tecken \u00E4r skiftningstecken {standard \u00E4r <>&\"'\\r\\n}]"},
- { "optionINDENT", " [-INDENT (Best\u00E4m antal blanksteg f\u00F6r indrag {standard \u00E4r 0})]"},
- { "optionTT", " [-TT (Sp\u00E5ra mallar vid anrop.)]"},
- { "optionTG", " [-TG (Sp\u00E5ra varje generationsh\u00E4ndelse.)]"},
- { "optionTS", " [-TS (Sp\u00E5ra varje urvalsh\u00E4ndelse.)]"},
- { "optionTTC", " [-TTC (Sp\u00E5ra mallunderordnade n\u00E4r de bearbetas.)]"},
- { "optionTCLASS", " [-TCLASS (TraceListener-klass f\u00F6r sp\u00E5rningstill\u00E4gg.)]"},
- { "optionVALIDATE", " [-VALIDATE (St\u00E4ll in om validering utf\u00F6rs. Standard \u00E4r att validering \u00E4r avst\u00E4ngd.)]"},
- { "optionEDUMP", " [-EDUMP {valfritt filnamn} (G\u00F6r stackdump vid fel.)]"},
- { "optionXML", " [-XML (Anv\u00E4nd XML-formaterare och l\u00E4gg till XML-huvud.)]"},
- { "optionTEXT", " [-TEXT (Anv\u00E4nd enkel textformaterare.)]"},
- { "optionHTML", " [-HTML (Anv\u00E4nd HTML-formaterare.)]"},
- { "optionPARAM", " [-PARAM-namnuttryck (St\u00E4ll in parameter f\u00F6r formatmall)]"},
- { "noParsermsg1", "XSL-processen utf\u00F6rdes inte."},
- { "noParsermsg2", "** Hittade inte parser **"},
- { "noParsermsg3", "Kontrollera klass\u00F6kv\u00E4gen."},
- { "noParsermsg4", "Om du inte har IBMs XML Parser f\u00F6r Java kan du ladda ned den fr\u00E5n"},
- { "noParsermsg5", "IBMs AlphaWorks: http://www.alphaworks.ibm.com/formula/xml"},
- { "optionURIRESOLVER", " [-URIRESOLVER fullst\u00E4ndigt klassnamn (URIResolver som anv\u00E4nds vid matchning av URI-er)]"},
- { "optionENTITYRESOLVER", " [-ENTITYRESOLVER fullst\u00E4ndigt klassnamn (EntityResolver som anv\u00E4nds vid matchning av enheter)]"},
- { "optionCONTENTHANDLER", " [-CONTENTHANDLER fullst\u00E4ndigt klassnamn (ContentHandler som anv\u00E4nds vid serialisering av utdata)]"},
- { "optionLINENUMBERS", " [-L anv\u00E4nd radnummer i k\u00E4lldokument]"},
- { "optionSECUREPROCESSING", " [-SECURE (ange att s\u00E4ker bearbetning ska till\u00E4mpas.)]"},
-
- // Following are the new options added in XSLTErrorResources.properties files after Jdk 1.4 (Xalan 2.2-D11)
-
-
- { "optionMEDIA", " [-MEDIA mediaType (anv\u00E4nd medieattribut f\u00F6r att hitta formatmall som h\u00F6r ihop med dokument.)]"},
- { "optionFLAVOR", " [-FLAVOR flavorName (Anv\u00E4nd s2s=SAX eller d2d=DOM vid transformering.)] "}, // Added by sboag/scurcuru; experimental
- { "optionDIAG", " [-DIAG (Skriv ut tid f\u00F6r transformering i millisekunder.)]"},
- { "optionINCREMENTAL", " [-INCREMENTAL (beg\u00E4r inkrementell DTM-konstruktion genom att ange http://xml.apache.org/xalan/features/incremental true.)]"},
- { "optionNOOPTIMIMIZE", " [-NOOPTIMIMIZE (beg\u00E4r att ingen formatmallsoptimering utf\u00F6rs genom att ange http://xml.apache.org/xalan/features/optimize false.)]"},
- { "optionRL", " [-RL rekursionsgr\u00E4ns (verifiera numeriskt gr\u00E4nsv\u00E4rde f\u00F6r formatmallens rekursionsdjup.)]"},
- { "optionXO", " [-XO [transletName] (tilldela namnet till genererad translet)]"},
- { "optionXD", " [-XD destinationDirectory (ange destinationskatalog f\u00F6r translet)]"},
- { "optionXJ", " [-XJ jarfile (paketerar transletklasserna i en jar-fil med namnet <jarfile>)]"},
- { "optionXP", " [-XP package (anger paketnamnsprefix f\u00F6r alla genererade transletklasser)]"},
-
- //AddITIONAL STRINGS that need L10n
- // Note to translators: The following message describes usage of a particular
- // command-line option that is used to enable the "template inlining"
- // optimization. The optimization involves making a copy of the code
- // generated for a template in another template that refers to it.
- { "optionXN", " [-XN (aktiverar mallinfogning)]" },
- { "optionXX", " [-XX (aktiverar ytterligare fels\u00F6kningsmeddelanden)]"},
- { "optionXT" , " [-XT (anv\u00E4nder translet vid transformering om m\u00F6jligt)]"},
- { "diagTiming"," --------- Transformering av {0} via {1} tog {2} ms" },
- { "recursionTooDeep","Mallkapslingen \u00E4r f\u00F6r djup. kapsling = {0}, mall {1} {2}" },
- { "nameIs", "namnet \u00E4r" },
- { "matchPatternIs", "matchningsm\u00F6nstret \u00E4r" }
-
- };
-
- }
- // ================= INFRASTRUCTURE ======================
-
- /** String for use when a bad error code was encountered. */
- public static final String BAD_CODE = "BAD_CODE";
-
- /** String for use when formatting of the error string failed. */
- public static final String FORMAT_FAILED = "FORMAT_FAILED";
-
- /** General error string. */
- public static final String ERROR_STRING = "#error";
-
- /** String to prepend to error messages. */
- public static final String ERROR_HEADER = "Error: ";
-
- /** String to prepend to warning messages. */
- public static final String WARNING_HEADER = "Warning: ";
-
- /** String to specify the XSLT module. */
- public static final String XSL_HEADER = "XSLT ";
-
- /** String to specify the XML parser module. */
- public static final String XML_HEADER = "XML ";
-
- /** I don't think this is used any more.
- * @deprecated */
- public static final String QUERY_HEADER = "PATTERN ";
-
-
- }
diff --git a/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_CN.java b/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_CN.java
deleted file mode 100644
index bd8f9a5..0000000
--- a/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_CN.java
+++ /dev/null
@@ -1,1447 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xalan.internal.res;
-
-import java.util.ListResourceBundle;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * Set up error messages.
- * We build a two dimensional array of message keys and
- * message strings. In order to add a new message here,
- * you need to first add a String constant. And
- * you need to enter key , value pair as part of contents
- * Array. You also need to update MAX_CODE for error strings
- * and MAX_WARNING for warnings ( Needed for only information
- * purpose )
- */
-public class XSLTErrorResources_zh_CN extends ListResourceBundle
-{
-
-/*
- * This file contains error and warning messages related to Xalan Error
- * Handling.
- *
- * General notes to translators:
- *
- * 1) Xalan (or more properly, Xalan-interpretive) and XSLTC are names of
- * components.
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- * XSLTC is an acronym for XSLT Compiler.
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 5) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 6) "Translet" is an invented term that describes the class file that
- * results from compiling an XML stylesheet into a Java class.
- *
- * 7) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- */
-
- /*
- * Static variables
- */
- public static final String ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX =
- "ER_INVALID_SET_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX";
-
- public static final String ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX_FOR_DEFAULT =
- "ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX_FOR_DEFAULT";
-
- public static final String ER_NO_CURLYBRACE = "ER_NO_CURLYBRACE";
- public static final String ER_FUNCTION_NOT_SUPPORTED = "ER_FUNCTION_NOT_SUPPORTED";
- public static final String ER_ILLEGAL_ATTRIBUTE = "ER_ILLEGAL_ATTRIBUTE";
- public static final String ER_NULL_SOURCENODE_APPLYIMPORTS = "ER_NULL_SOURCENODE_APPLYIMPORTS";
- public static final String ER_CANNOT_ADD = "ER_CANNOT_ADD";
- public static final String ER_NULL_SOURCENODE_HANDLEAPPLYTEMPLATES="ER_NULL_SOURCENODE_HANDLEAPPLYTEMPLATES";
- public static final String ER_NO_NAME_ATTRIB = "ER_NO_NAME_ATTRIB";
- public static final String ER_TEMPLATE_NOT_FOUND = "ER_TEMPLATE_NOT_FOUND";
- public static final String ER_CANT_RESOLVE_NAME_AVT = "ER_CANT_RESOLVE_NAME_AVT";
- public static final String ER_REQUIRES_ATTRIB = "ER_REQUIRES_ATTRIB";
- public static final String ER_MUST_HAVE_TEST_ATTRIB = "ER_MUST_HAVE_TEST_ATTRIB";
- public static final String ER_BAD_VAL_ON_LEVEL_ATTRIB =
- "ER_BAD_VAL_ON_LEVEL_ATTRIB";
- public static final String ER_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML =
- "ER_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML";
- public static final String ER_PROCESSINGINSTRUCTION_NOTVALID_NCNAME =
- "ER_PROCESSINGINSTRUCTION_NOTVALID_NCNAME";
- public static final String ER_NEED_MATCH_ATTRIB = "ER_NEED_MATCH_ATTRIB";
- public static final String ER_NEED_NAME_OR_MATCH_ATTRIB =
- "ER_NEED_NAME_OR_MATCH_ATTRIB";
- public static final String ER_CANT_RESOLVE_NSPREFIX =
- "ER_CANT_RESOLVE_NSPREFIX";
- public static final String ER_ILLEGAL_VALUE = "ER_ILLEGAL_VALUE";
- public static final String ER_NO_OWNERDOC = "ER_NO_OWNERDOC";
- public static final String ER_ELEMTEMPLATEELEM_ERR ="ER_ELEMTEMPLATEELEM_ERR";
- public static final String ER_NULL_CHILD = "ER_NULL_CHILD";
- public static final String ER_NEED_SELECT_ATTRIB = "ER_NEED_SELECT_ATTRIB";
- public static final String ER_NEED_TEST_ATTRIB = "ER_NEED_TEST_ATTRIB";
- public static final String ER_NEED_NAME_ATTRIB = "ER_NEED_NAME_ATTRIB";
- public static final String ER_NO_CONTEXT_OWNERDOC = "ER_NO_CONTEXT_OWNERDOC";
- public static final String ER_COULD_NOT_CREATE_XML_PROC_LIAISON =
- "ER_COULD_NOT_CREATE_XML_PROC_LIAISON";
- public static final String ER_PROCESS_NOT_SUCCESSFUL =
- "ER_PROCESS_NOT_SUCCESSFUL";
- public static final String ER_NOT_SUCCESSFUL = "ER_NOT_SUCCESSFUL";
- public static final String ER_ENCODING_NOT_SUPPORTED =
- "ER_ENCODING_NOT_SUPPORTED";
- public static final String ER_COULD_NOT_CREATE_TRACELISTENER =
- "ER_COULD_NOT_CREATE_TRACELISTENER";
- public static final String ER_KEY_REQUIRES_NAME_ATTRIB =
- "ER_KEY_REQUIRES_NAME_ATTRIB";
- public static final String ER_KEY_REQUIRES_MATCH_ATTRIB =
- "ER_KEY_REQUIRES_MATCH_ATTRIB";
- public static final String ER_KEY_REQUIRES_USE_ATTRIB =
- "ER_KEY_REQUIRES_USE_ATTRIB";
- public static final String ER_REQUIRES_ELEMENTS_ATTRIB =
- "ER_REQUIRES_ELEMENTS_ATTRIB";
- public static final String ER_MISSING_PREFIX_ATTRIB =
- "ER_MISSING_PREFIX_ATTRIB";
- public static final String ER_BAD_STYLESHEET_URL = "ER_BAD_STYLESHEET_URL";
- public static final String ER_FILE_NOT_FOUND = "ER_FILE_NOT_FOUND";
- public static final String ER_IOEXCEPTION = "ER_IOEXCEPTION";
- public static final String ER_NO_HREF_ATTRIB = "ER_NO_HREF_ATTRIB";
- public static final String ER_STYLESHEET_INCLUDES_ITSELF =
- "ER_STYLESHEET_INCLUDES_ITSELF";
- public static final String ER_PROCESSINCLUDE_ERROR ="ER_PROCESSINCLUDE_ERROR";
- public static final String ER_MISSING_LANG_ATTRIB = "ER_MISSING_LANG_ATTRIB";
- public static final String ER_MISSING_CONTAINER_ELEMENT_COMPONENT =
- "ER_MISSING_CONTAINER_ELEMENT_COMPONENT";
- public static final String ER_CAN_ONLY_OUTPUT_TO_ELEMENT =
- "ER_CAN_ONLY_OUTPUT_TO_ELEMENT";
- public static final String ER_PROCESS_ERROR = "ER_PROCESS_ERROR";
- public static final String ER_UNIMPLNODE_ERROR = "ER_UNIMPLNODE_ERROR";
- public static final String ER_NO_SELECT_EXPRESSION ="ER_NO_SELECT_EXPRESSION";
- public static final String ER_CANNOT_SERIALIZE_XSLPROCESSOR =
- "ER_CANNOT_SERIALIZE_XSLPROCESSOR";
- public static final String ER_NO_INPUT_STYLESHEET = "ER_NO_INPUT_STYLESHEET";
- public static final String ER_FAILED_PROCESS_STYLESHEET =
- "ER_FAILED_PROCESS_STYLESHEET";
- public static final String ER_COULDNT_PARSE_DOC = "ER_COULDNT_PARSE_DOC";
- public static final String ER_COULDNT_FIND_FRAGMENT =
- "ER_COULDNT_FIND_FRAGMENT";
- public static final String ER_NODE_NOT_ELEMENT = "ER_NODE_NOT_ELEMENT";
- public static final String ER_FOREACH_NEED_MATCH_OR_NAME_ATTRIB =
- "ER_FOREACH_NEED_MATCH_OR_NAME_ATTRIB";
- public static final String ER_TEMPLATES_NEED_MATCH_OR_NAME_ATTRIB =
- "ER_TEMPLATES_NEED_MATCH_OR_NAME_ATTRIB";
- public static final String ER_NO_CLONE_OF_DOCUMENT_FRAG =
- "ER_NO_CLONE_OF_DOCUMENT_FRAG";
- public static final String ER_CANT_CREATE_ITEM = "ER_CANT_CREATE_ITEM";
- public static final String ER_XMLSPACE_ILLEGAL_VALUE =
- "ER_XMLSPACE_ILLEGAL_VALUE";
- public static final String ER_NO_XSLKEY_DECLARATION =
- "ER_NO_XSLKEY_DECLARATION";
- public static final String ER_CANT_CREATE_URL = "ER_CANT_CREATE_URL";
- public static final String ER_XSLFUNCTIONS_UNSUPPORTED =
- "ER_XSLFUNCTIONS_UNSUPPORTED";
- public static final String ER_PROCESSOR_ERROR = "ER_PROCESSOR_ERROR";
- public static final String ER_NOT_ALLOWED_INSIDE_STYLESHEET =
- "ER_NOT_ALLOWED_INSIDE_STYLESHEET";
- public static final String ER_RESULTNS_NOT_SUPPORTED =
- "ER_RESULTNS_NOT_SUPPORTED";
- public static final String ER_DEFAULTSPACE_NOT_SUPPORTED =
- "ER_DEFAULTSPACE_NOT_SUPPORTED";
- public static final String ER_INDENTRESULT_NOT_SUPPORTED =
- "ER_INDENTRESULT_NOT_SUPPORTED";
- public static final String ER_ILLEGAL_ATTRIB = "ER_ILLEGAL_ATTRIB";
- public static final String ER_UNKNOWN_XSL_ELEM = "ER_UNKNOWN_XSL_ELEM";
- public static final String ER_BAD_XSLSORT_USE = "ER_BAD_XSLSORT_USE";
- public static final String ER_MISPLACED_XSLWHEN = "ER_MISPLACED_XSLWHEN";
- public static final String ER_XSLWHEN_NOT_PARENTED_BY_XSLCHOOSE =
- "ER_XSLWHEN_NOT_PARENTED_BY_XSLCHOOSE";
- public static final String ER_MISPLACED_XSLOTHERWISE =
- "ER_MISPLACED_XSLOTHERWISE";
- public static final String ER_XSLOTHERWISE_NOT_PARENTED_BY_XSLCHOOSE =
- "ER_XSLOTHERWISE_NOT_PARENTED_BY_XSLCHOOSE";
- public static final String ER_NOT_ALLOWED_INSIDE_TEMPLATE =
- "ER_NOT_ALLOWED_INSIDE_TEMPLATE";
- public static final String ER_UNKNOWN_EXT_NS_PREFIX =
- "ER_UNKNOWN_EXT_NS_PREFIX";
- public static final String ER_IMPORTS_AS_FIRST_ELEM =
- "ER_IMPORTS_AS_FIRST_ELEM";
- public static final String ER_IMPORTING_ITSELF = "ER_IMPORTING_ITSELF";
- public static final String ER_XMLSPACE_ILLEGAL_VAL ="ER_XMLSPACE_ILLEGAL_VAL";
- public static final String ER_PROCESSSTYLESHEET_NOT_SUCCESSFUL =
- "ER_PROCESSSTYLESHEET_NOT_SUCCESSFUL";
- public static final String ER_SAX_EXCEPTION = "ER_SAX_EXCEPTION";
- public static final String ER_XSLT_ERROR = "ER_XSLT_ERROR";
- public static final String ER_CURRENCY_SIGN_ILLEGAL=
- "ER_CURRENCY_SIGN_ILLEGAL";
- public static final String ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM =
- "ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM";
- public static final String ER_CANT_RESOLVE_PREFIX_OF_NON_PREFIX_RESOLVER =
- "ER_CANT_RESOLVE_PREFIX_OF_NON_PREFIX_RESOLVER";
- public static final String ER_REDIRECT_COULDNT_GET_FILENAME =
- "ER_REDIRECT_COULDNT_GET_FILENAME";
- public static final String ER_CANNOT_BUILD_FORMATTERLISTENER_IN_REDIRECT =
- "ER_CANNOT_BUILD_FORMATTERLISTENER_IN_REDIRECT";
- public static final String ER_INVALID_PREFIX_IN_EXCLUDERESULTPREFIX =
- "ER_INVALID_PREFIX_IN_EXCLUDERESULTPREFIX";
- public static final String ER_MISSING_NS_URI = "ER_MISSING_NS_URI";
- public static final String ER_MISSING_ARG_FOR_OPTION =
- "ER_MISSING_ARG_FOR_OPTION";
- public static final String ER_INVALID_OPTION = "ER_INVALID_OPTION";
- public static final String ER_MALFORMED_FORMAT_STRING =
- "ER_MALFORMED_FORMAT_STRING";
- public static final String ER_STYLESHEET_REQUIRES_VERSION_ATTRIB =
- "ER_STYLESHEET_REQUIRES_VERSION_ATTRIB";
- public static final String ER_ILLEGAL_ATTRIBUTE_VALUE =
- "ER_ILLEGAL_ATTRIBUTE_VALUE";
- public static final String ER_CHOOSE_REQUIRES_WHEN ="ER_CHOOSE_REQUIRES_WHEN";
- public static final String ER_NO_APPLY_IMPORT_IN_FOR_EACH =
- "ER_NO_APPLY_IMPORT_IN_FOR_EACH";
- public static final String ER_CANT_USE_DTM_FOR_OUTPUT =
- "ER_CANT_USE_DTM_FOR_OUTPUT";
- public static final String ER_CANT_USE_DTM_FOR_INPUT =
- "ER_CANT_USE_DTM_FOR_INPUT";
- public static final String ER_CALL_TO_EXT_FAILED = "ER_CALL_TO_EXT_FAILED";
- public static final String ER_PREFIX_MUST_RESOLVE = "ER_PREFIX_MUST_RESOLVE";
- public static final String ER_INVALID_UTF16_SURROGATE =
- "ER_INVALID_UTF16_SURROGATE";
- public static final String ER_XSLATTRSET_USED_ITSELF =
- "ER_XSLATTRSET_USED_ITSELF";
- public static final String ER_CANNOT_MIX_XERCESDOM ="ER_CANNOT_MIX_XERCESDOM";
- public static final String ER_TOO_MANY_LISTENERS = "ER_TOO_MANY_LISTENERS";
- public static final String ER_IN_ELEMTEMPLATEELEM_READOBJECT =
- "ER_IN_ELEMTEMPLATEELEM_READOBJECT";
- public static final String ER_DUPLICATE_NAMED_TEMPLATE =
- "ER_DUPLICATE_NAMED_TEMPLATE";
- public static final String ER_INVALID_KEY_CALL = "ER_INVALID_KEY_CALL";
- public static final String ER_REFERENCING_ITSELF = "ER_REFERENCING_ITSELF";
- public static final String ER_ILLEGAL_DOMSOURCE_INPUT =
- "ER_ILLEGAL_DOMSOURCE_INPUT";
- public static final String ER_CLASS_NOT_FOUND_FOR_OPTION =
- "ER_CLASS_NOT_FOUND_FOR_OPTION";
- public static final String ER_REQUIRED_ELEM_NOT_FOUND =
- "ER_REQUIRED_ELEM_NOT_FOUND";
- public static final String ER_INPUT_CANNOT_BE_NULL ="ER_INPUT_CANNOT_BE_NULL";
- public static final String ER_URI_CANNOT_BE_NULL = "ER_URI_CANNOT_BE_NULL";
- public static final String ER_FILE_CANNOT_BE_NULL = "ER_FILE_CANNOT_BE_NULL";
- public static final String ER_SOURCE_CANNOT_BE_NULL =
- "ER_SOURCE_CANNOT_BE_NULL";
- public static final String ER_CANNOT_INIT_BSFMGR = "ER_CANNOT_INIT_BSFMGR";
- public static final String ER_CANNOT_CMPL_EXTENSN = "ER_CANNOT_CMPL_EXTENSN";
- public static final String ER_CANNOT_CREATE_EXTENSN =
- "ER_CANNOT_CREATE_EXTENSN";
- public static final String ER_INSTANCE_MTHD_CALL_REQUIRES =
- "ER_INSTANCE_MTHD_CALL_REQUIRES";
- public static final String ER_INVALID_ELEMENT_NAME ="ER_INVALID_ELEMENT_NAME";
- public static final String ER_ELEMENT_NAME_METHOD_STATIC =
- "ER_ELEMENT_NAME_METHOD_STATIC";
- public static final String ER_EXTENSION_FUNC_UNKNOWN =
- "ER_EXTENSION_FUNC_UNKNOWN";
- public static final String ER_MORE_MATCH_CONSTRUCTOR =
- "ER_MORE_MATCH_CONSTRUCTOR";
- public static final String ER_MORE_MATCH_METHOD = "ER_MORE_MATCH_METHOD";
- public static final String ER_MORE_MATCH_ELEMENT = "ER_MORE_MATCH_ELEMENT";
- public static final String ER_INVALID_CONTEXT_PASSED =
- "ER_INVALID_CONTEXT_PASSED";
- public static final String ER_POOL_EXISTS = "ER_POOL_EXISTS";
- public static final String ER_NO_DRIVER_NAME = "ER_NO_DRIVER_NAME";
- public static final String ER_NO_URL = "ER_NO_URL";
- public static final String ER_POOL_SIZE_LESSTHAN_ONE =
- "ER_POOL_SIZE_LESSTHAN_ONE";
- public static final String ER_INVALID_DRIVER = "ER_INVALID_DRIVER";
- public static final String ER_NO_STYLESHEETROOT = "ER_NO_STYLESHEETROOT";
- public static final String ER_ILLEGAL_XMLSPACE_VALUE =
- "ER_ILLEGAL_XMLSPACE_VALUE";
- public static final String ER_PROCESSFROMNODE_FAILED =
- "ER_PROCESSFROMNODE_FAILED";
- public static final String ER_RESOURCE_COULD_NOT_LOAD =
- "ER_RESOURCE_COULD_NOT_LOAD";
- public static final String ER_BUFFER_SIZE_LESSTHAN_ZERO =
- "ER_BUFFER_SIZE_LESSTHAN_ZERO";
- public static final String ER_UNKNOWN_ERROR_CALLING_EXTENSION =
- "ER_UNKNOWN_ERROR_CALLING_EXTENSION";
- public static final String ER_NO_NAMESPACE_DECL = "ER_NO_NAMESPACE_DECL";
- public static final String ER_ELEM_CONTENT_NOT_ALLOWED =
- "ER_ELEM_CONTENT_NOT_ALLOWED";
- public static final String ER_STYLESHEET_DIRECTED_TERMINATION =
- "ER_STYLESHEET_DIRECTED_TERMINATION";
- public static final String ER_ONE_OR_TWO = "ER_ONE_OR_TWO";
- public static final String ER_TWO_OR_THREE = "ER_TWO_OR_THREE";
- public static final String ER_COULD_NOT_LOAD_RESOURCE =
- "ER_COULD_NOT_LOAD_RESOURCE";
- public static final String ER_CANNOT_INIT_DEFAULT_TEMPLATES =
- "ER_CANNOT_INIT_DEFAULT_TEMPLATES";
- public static final String ER_RESULT_NULL = "ER_RESULT_NULL";
- public static final String ER_RESULT_COULD_NOT_BE_SET =
- "ER_RESULT_COULD_NOT_BE_SET";
- public static final String ER_NO_OUTPUT_SPECIFIED = "ER_NO_OUTPUT_SPECIFIED";
- public static final String ER_CANNOT_TRANSFORM_TO_RESULT_TYPE =
- "ER_CANNOT_TRANSFORM_TO_RESULT_TYPE";
- public static final String ER_CANNOT_TRANSFORM_SOURCE_TYPE =
- "ER_CANNOT_TRANSFORM_SOURCE_TYPE";
- public static final String ER_NULL_CONTENT_HANDLER ="ER_NULL_CONTENT_HANDLER";
- public static final String ER_NULL_ERROR_HANDLER = "ER_NULL_ERROR_HANDLER";
- public static final String ER_CANNOT_CALL_PARSE = "ER_CANNOT_CALL_PARSE";
- public static final String ER_NO_PARENT_FOR_FILTER ="ER_NO_PARENT_FOR_FILTER";
- public static final String ER_NO_STYLESHEET_IN_MEDIA =
- "ER_NO_STYLESHEET_IN_MEDIA";
- public static final String ER_NO_STYLESHEET_PI = "ER_NO_STYLESHEET_PI";
- public static final String ER_NOT_SUPPORTED = "ER_NOT_SUPPORTED";
- public static final String ER_PROPERTY_VALUE_BOOLEAN =
- "ER_PROPERTY_VALUE_BOOLEAN";
- public static final String ER_COULD_NOT_FIND_EXTERN_SCRIPT =
- "ER_COULD_NOT_FIND_EXTERN_SCRIPT";
- public static final String ER_RESOURCE_COULD_NOT_FIND =
- "ER_RESOURCE_COULD_NOT_FIND";
- public static final String ER_OUTPUT_PROPERTY_NOT_RECOGNIZED =
- "ER_OUTPUT_PROPERTY_NOT_RECOGNIZED";
- public static final String ER_FAILED_CREATING_ELEMLITRSLT =
- "ER_FAILED_CREATING_ELEMLITRSLT";
- public static final String ER_VALUE_SHOULD_BE_NUMBER =
- "ER_VALUE_SHOULD_BE_NUMBER";
- public static final String ER_VALUE_SHOULD_EQUAL = "ER_VALUE_SHOULD_EQUAL";
- public static final String ER_FAILED_CALLING_METHOD =
- "ER_FAILED_CALLING_METHOD";
- public static final String ER_FAILED_CREATING_ELEMTMPL =
- "ER_FAILED_CREATING_ELEMTMPL";
- public static final String ER_CHARS_NOT_ALLOWED = "ER_CHARS_NOT_ALLOWED";
- public static final String ER_ATTR_NOT_ALLOWED = "ER_ATTR_NOT_ALLOWED";
- public static final String ER_BAD_VALUE = "ER_BAD_VALUE";
- public static final String ER_ATTRIB_VALUE_NOT_FOUND =
- "ER_ATTRIB_VALUE_NOT_FOUND";
- public static final String ER_ATTRIB_VALUE_NOT_RECOGNIZED =
- "ER_ATTRIB_VALUE_NOT_RECOGNIZED";
- public static final String ER_NULL_URI_NAMESPACE = "ER_NULL_URI_NAMESPACE";
- public static final String ER_NUMBER_TOO_BIG = "ER_NUMBER_TOO_BIG";
- public static final String ER_CANNOT_FIND_SAX1_DRIVER =
- "ER_CANNOT_FIND_SAX1_DRIVER";
- public static final String ER_SAX1_DRIVER_NOT_LOADED =
- "ER_SAX1_DRIVER_NOT_LOADED";
- public static final String ER_SAX1_DRIVER_NOT_INSTANTIATED =
- "ER_SAX1_DRIVER_NOT_INSTANTIATED" ;
- public static final String ER_SAX1_DRIVER_NOT_IMPLEMENT_PARSER =
- "ER_SAX1_DRIVER_NOT_IMPLEMENT_PARSER";
- public static final String ER_PARSER_PROPERTY_NOT_SPECIFIED =
- "ER_PARSER_PROPERTY_NOT_SPECIFIED";
- public static final String ER_PARSER_ARG_CANNOT_BE_NULL =
- "ER_PARSER_ARG_CANNOT_BE_NULL" ;
- public static final String ER_FEATURE = "ER_FEATURE";
- public static final String ER_PROPERTY = "ER_PROPERTY" ;
- public static final String ER_NULL_ENTITY_RESOLVER ="ER_NULL_ENTITY_RESOLVER";
- public static final String ER_NULL_DTD_HANDLER = "ER_NULL_DTD_HANDLER" ;
- public static final String ER_NO_DRIVER_NAME_SPECIFIED =
- "ER_NO_DRIVER_NAME_SPECIFIED";
- public static final String ER_NO_URL_SPECIFIED = "ER_NO_URL_SPECIFIED";
- public static final String ER_POOLSIZE_LESS_THAN_ONE =
- "ER_POOLSIZE_LESS_THAN_ONE";
- public static final String ER_INVALID_DRIVER_NAME = "ER_INVALID_DRIVER_NAME";
- public static final String ER_ERRORLISTENER = "ER_ERRORLISTENER";
- public static final String ER_ASSERT_NO_TEMPLATE_PARENT =
- "ER_ASSERT_NO_TEMPLATE_PARENT";
- public static final String ER_ASSERT_REDUNDENT_EXPR_ELIMINATOR =
- "ER_ASSERT_REDUNDENT_EXPR_ELIMINATOR";
- public static final String ER_NOT_ALLOWED_IN_POSITION =
- "ER_NOT_ALLOWED_IN_POSITION";
- public static final String ER_NONWHITESPACE_NOT_ALLOWED_IN_POSITION =
- "ER_NONWHITESPACE_NOT_ALLOWED_IN_POSITION";
- public static final String ER_NAMESPACE_CONTEXT_NULL_NAMESPACE =
- "ER_NAMESPACE_CONTEXT_NULL_NAMESPACE";
- public static final String ER_NAMESPACE_CONTEXT_NULL_PREFIX =
- "ER_NAMESPACE_CONTEXT_NULL_PREFIX";
- public static final String ER_XPATH_RESOLVER_NULL_QNAME =
- "ER_XPATH_RESOLVER_NULL_QNAME";
- public static final String ER_XPATH_RESOLVER_NEGATIVE_ARITY =
- "ER_XPATH_RESOLVER_NEGATIVE_ARITY";
- public static final String INVALID_TCHAR = "INVALID_TCHAR";
- public static final String INVALID_QNAME = "INVALID_QNAME";
- public static final String INVALID_ENUM = "INVALID_ENUM";
- public static final String INVALID_NMTOKEN = "INVALID_NMTOKEN";
- public static final String INVALID_NCNAME = "INVALID_NCNAME";
- public static final String INVALID_BOOLEAN = "INVALID_BOOLEAN";
- public static final String INVALID_NUMBER = "INVALID_NUMBER";
- public static final String ER_ARG_LITERAL = "ER_ARG_LITERAL";
- public static final String ER_DUPLICATE_GLOBAL_VAR ="ER_DUPLICATE_GLOBAL_VAR";
- public static final String ER_DUPLICATE_VAR = "ER_DUPLICATE_VAR";
- public static final String ER_TEMPLATE_NAME_MATCH = "ER_TEMPLATE_NAME_MATCH";
- public static final String ER_INVALID_PREFIX = "ER_INVALID_PREFIX";
- public static final String ER_NO_ATTRIB_SET = "ER_NO_ATTRIB_SET";
- public static final String ER_FUNCTION_NOT_FOUND =
- "ER_FUNCTION_NOT_FOUND";
- public static final String ER_CANT_HAVE_CONTENT_AND_SELECT =
- "ER_CANT_HAVE_CONTENT_AND_SELECT";
- public static final String ER_INVALID_SET_PARAM_VALUE = "ER_INVALID_SET_PARAM_VALUE";
- public static final String ER_SET_FEATURE_NULL_NAME =
- "ER_SET_FEATURE_NULL_NAME";
- public static final String ER_GET_FEATURE_NULL_NAME =
- "ER_GET_FEATURE_NULL_NAME";
- public static final String ER_UNSUPPORTED_FEATURE =
- "ER_UNSUPPORTED_FEATURE";
- public static final String ER_EXTENSION_ELEMENT_NOT_ALLOWED_IN_SECURE_PROCESSING =
- "ER_EXTENSION_ELEMENT_NOT_ALLOWED_IN_SECURE_PROCESSING";
-
- public static final String WG_FOUND_CURLYBRACE = "WG_FOUND_CURLYBRACE";
- public static final String WG_COUNT_ATTRIB_MATCHES_NO_ANCESTOR =
- "WG_COUNT_ATTRIB_MATCHES_NO_ANCESTOR";
- public static final String WG_EXPR_ATTRIB_CHANGED_TO_SELECT =
- "WG_EXPR_ATTRIB_CHANGED_TO_SELECT";
- public static final String WG_NO_LOCALE_IN_FORMATNUMBER =
- "WG_NO_LOCALE_IN_FORMATNUMBER";
- public static final String WG_LOCALE_NOT_FOUND = "WG_LOCALE_NOT_FOUND";
- public static final String WG_CANNOT_MAKE_URL_FROM ="WG_CANNOT_MAKE_URL_FROM";
- public static final String WG_CANNOT_LOAD_REQUESTED_DOC =
- "WG_CANNOT_LOAD_REQUESTED_DOC";
- public static final String WG_CANNOT_FIND_COLLATOR ="WG_CANNOT_FIND_COLLATOR";
- public static final String WG_FUNCTIONS_SHOULD_USE_URL =
- "WG_FUNCTIONS_SHOULD_USE_URL";
- public static final String WG_ENCODING_NOT_SUPPORTED_USING_UTF8 =
- "WG_ENCODING_NOT_SUPPORTED_USING_UTF8";
- public static final String WG_ENCODING_NOT_SUPPORTED_USING_JAVA =
- "WG_ENCODING_NOT_SUPPORTED_USING_JAVA";
- public static final String WG_SPECIFICITY_CONFLICTS =
- "WG_SPECIFICITY_CONFLICTS";
- public static final String WG_PARSING_AND_PREPARING =
- "WG_PARSING_AND_PREPARING";
- public static final String WG_ATTR_TEMPLATE = "WG_ATTR_TEMPLATE";
- public static final String WG_CONFLICT_BETWEEN_XSLSTRIPSPACE_AND_XSLPRESERVESPACE = "WG_CONFLICT_BETWEEN_XSLSTRIPSPACE_AND_XSLPRESERVESP";
- public static final String WG_ATTRIB_NOT_HANDLED = "WG_ATTRIB_NOT_HANDLED";
- public static final String WG_NO_DECIMALFORMAT_DECLARATION =
- "WG_NO_DECIMALFORMAT_DECLARATION";
- public static final String WG_OLD_XSLT_NS = "WG_OLD_XSLT_NS";
- public static final String WG_ONE_DEFAULT_XSLDECIMALFORMAT_ALLOWED =
- "WG_ONE_DEFAULT_XSLDECIMALFORMAT_ALLOWED";
- public static final String WG_XSLDECIMALFORMAT_NAMES_MUST_BE_UNIQUE =
- "WG_XSLDECIMALFORMAT_NAMES_MUST_BE_UNIQUE";
- public static final String WG_ILLEGAL_ATTRIBUTE = "WG_ILLEGAL_ATTRIBUTE";
- public static final String WG_COULD_NOT_RESOLVE_PREFIX =
- "WG_COULD_NOT_RESOLVE_PREFIX";
- public static final String WG_STYLESHEET_REQUIRES_VERSION_ATTRIB =
- "WG_STYLESHEET_REQUIRES_VERSION_ATTRIB";
- public static final String WG_ILLEGAL_ATTRIBUTE_NAME =
- "WG_ILLEGAL_ATTRIBUTE_NAME";
- public static final String WG_ILLEGAL_ATTRIBUTE_VALUE =
- "WG_ILLEGAL_ATTRIBUTE_VALUE";
- public static final String WG_EMPTY_SECOND_ARG = "WG_EMPTY_SECOND_ARG";
- public static final String WG_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML =
- "WG_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML";
- public static final String WG_PROCESSINGINSTRUCTION_NOTVALID_NCNAME =
- "WG_PROCESSINGINSTRUCTION_NOTVALID_NCNAME";
- public static final String WG_ILLEGAL_ATTRIBUTE_POSITION =
- "WG_ILLEGAL_ATTRIBUTE_POSITION";
- public static final String NO_MODIFICATION_ALLOWED_ERR =
- "NO_MODIFICATION_ALLOWED_ERR";
-
- /*
- * Now fill in the message text.
- * Then fill in the message text for that message code in the
- * array. Use the new error code as the index into the array.
- */
-
- // Error messages...
-
- /** Get the lookup table for error messages.
- *
- * @return The message lookup table.
- */
- public Object[][] getContents()
- {
- return new Object[][] {
-
- /** Error message ID that has a null message, but takes in a single object. */
- {"ER0000" , "{0}" },
-
- { ER_NO_CURLYBRACE,
- "\u9519\u8BEF: \u8868\u8FBE\u5F0F\u4E2D\u4E0D\u80FD\u5305\u542B '{'"},
-
- { ER_ILLEGAL_ATTRIBUTE ,
- "{0}\u5177\u6709\u975E\u6CD5\u5C5E\u6027: {1}"},
-
- {ER_NULL_SOURCENODE_APPLYIMPORTS ,
- "sourceNode \u5728 xsl:apply-imports \u4E2D\u4E3A\u7A7A\u503C!"},
-
- {ER_CANNOT_ADD,
- "\u65E0\u6CD5\u5411{1}\u6DFB\u52A0{0}"},
-
- { ER_NULL_SOURCENODE_HANDLEAPPLYTEMPLATES,
- "sourceNode \u5728 handleApplyTemplatesInstruction \u4E2D\u4E3A\u7A7A\u503C!"},
-
- { ER_NO_NAME_ATTRIB,
- "{0}\u5FC5\u987B\u5177\u6709 name \u5C5E\u6027\u3002"},
-
- {ER_TEMPLATE_NOT_FOUND,
- "\u627E\u4E0D\u5230\u540D\u4E3A{0}\u7684\u6A21\u677F"},
-
- {ER_CANT_RESOLVE_NAME_AVT,
- "\u65E0\u6CD5\u89E3\u6790 xsl:call-template \u4E2D\u7684\u540D\u79F0 AVT\u3002"},
-
- {ER_REQUIRES_ATTRIB,
- "{0}\u9700\u8981\u5C5E\u6027: {1}"},
-
- { ER_MUST_HAVE_TEST_ATTRIB,
- "{0}\u5FC5\u987B\u5177\u6709 ''test'' \u5C5E\u6027\u3002"},
-
- {ER_BAD_VAL_ON_LEVEL_ATTRIB,
- "level \u5C5E\u6027\u7684\u503C\u9519\u8BEF: {0}"},
-
- {ER_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML,
- "processing-instruction \u540D\u79F0\u4E0D\u80FD\u4E3A 'xml'"},
-
- { ER_PROCESSINGINSTRUCTION_NOTVALID_NCNAME,
- "processing-instruction \u540D\u79F0\u5FC5\u987B\u662F\u6709\u6548\u7684 NCName: {0}"},
-
- { ER_NEED_MATCH_ATTRIB,
- "\u5982\u679C{0}\u5177\u6709\u67D0\u79CD\u6A21\u5F0F, \u5219\u5FC5\u987B\u5177\u6709 match \u5C5E\u6027\u3002"},
-
- { ER_NEED_NAME_OR_MATCH_ATTRIB,
- "{0}\u9700\u8981 name \u6216 match \u5C5E\u6027\u3002"},
-
- {ER_CANT_RESOLVE_NSPREFIX,
- "\u65E0\u6CD5\u89E3\u6790\u540D\u79F0\u7A7A\u95F4\u524D\u7F00: {0}"},
-
- { ER_ILLEGAL_VALUE,
- "xml:space \u5177\u6709\u975E\u6CD5\u503C: {0}"},
-
- { ER_NO_OWNERDOC,
- "\u5B50\u8282\u70B9\u6CA1\u6709\u6240\u6709\u8005\u6587\u6863!"},
-
- { ER_ELEMTEMPLATEELEM_ERR,
- "ElemTemplateElement \u9519\u8BEF: {0}"},
-
- { ER_NULL_CHILD,
- "\u6B63\u5728\u5C1D\u8BD5\u6DFB\u52A0\u7A7A\u5B50\u7EA7!"},
-
- { ER_NEED_SELECT_ATTRIB,
- "{0}\u9700\u8981 select \u5C5E\u6027\u3002"},
-
- { ER_NEED_TEST_ATTRIB ,
- "xsl:when \u5FC5\u987B\u5177\u6709 'test' \u5C5E\u6027\u3002"},
-
- { ER_NEED_NAME_ATTRIB,
- "xsl:with-param \u5FC5\u987B\u5177\u6709 'name' \u5C5E\u6027\u3002"},
-
- { ER_NO_CONTEXT_OWNERDOC,
- "\u4E0A\u4E0B\u6587\u6CA1\u6709\u6240\u6709\u8005\u6587\u6863!"},
-
- {ER_COULD_NOT_CREATE_XML_PROC_LIAISON,
- "\u65E0\u6CD5\u521B\u5EFA XML TransformerFactory Liaison: {0}"},
-
- {ER_PROCESS_NOT_SUCCESSFUL,
- "Xalan: \u8FDB\u7A0B\u672A\u6210\u529F\u3002"},
-
- { ER_NOT_SUCCESSFUL,
- "Xalan: \u672A\u6210\u529F\u3002"},
-
- { ER_ENCODING_NOT_SUPPORTED,
- "\u4E0D\u652F\u6301\u7F16\u7801: {0}"},
-
- {ER_COULD_NOT_CREATE_TRACELISTENER,
- "\u65E0\u6CD5\u521B\u5EFA TraceListener: {0}"},
-
- {ER_KEY_REQUIRES_NAME_ATTRIB,
- "xsl:key \u9700\u8981 'name' \u5C5E\u6027!"},
-
- { ER_KEY_REQUIRES_MATCH_ATTRIB,
- "xsl:key \u9700\u8981 'match' \u5C5E\u6027!"},
-
- { ER_KEY_REQUIRES_USE_ATTRIB,
- "xsl:key \u9700\u8981 'use' \u5C5E\u6027!"},
-
- { ER_REQUIRES_ELEMENTS_ATTRIB,
- "(StylesheetHandler) {0}\u9700\u8981 ''elements'' \u5C5E\u6027!"},
-
- { ER_MISSING_PREFIX_ATTRIB,
- "(StylesheetHandler) \u7F3A\u5C11{0}\u5C5E\u6027 ''prefix''"},
-
- { ER_BAD_STYLESHEET_URL,
- "\u6837\u5F0F\u8868 URL \u9519\u8BEF: {0}"},
-
- { ER_FILE_NOT_FOUND,
- "\u627E\u4E0D\u5230\u6837\u5F0F\u8868\u6587\u4EF6: {0}"},
-
- { ER_IOEXCEPTION,
- "\u6837\u5F0F\u8868\u6587\u4EF6\u51FA\u73B0 IO \u5F02\u5E38\u9519\u8BEF: {0}"},
-
- { ER_NO_HREF_ATTRIB,
- "(StylesheetHandler) \u627E\u4E0D\u5230{0}\u7684 href \u5C5E\u6027"},
-
- { ER_STYLESHEET_INCLUDES_ITSELF,
- "(StylesheetHandler) {0}\u76F4\u63A5\u6216\u95F4\u63A5\u5305\u542B\u5176\u81EA\u8EAB!"},
-
- { ER_PROCESSINCLUDE_ERROR,
- "StylesheetHandler.processInclude \u9519\u8BEF, {0}"},
-
- { ER_MISSING_LANG_ATTRIB,
- "(StylesheetHandler) \u7F3A\u5C11{0}\u5C5E\u6027 ''lang''"},
-
- { ER_MISSING_CONTAINER_ELEMENT_COMPONENT,
- "(StylesheetHandler) {0}\u5143\u7D20\u7684\u653E\u7F6E\u4F4D\u7F6E\u662F\u5426\u9519\u8BEF?? \u7F3A\u5C11\u5BB9\u5668\u5143\u7D20 ''component''"},
-
- { ER_CAN_ONLY_OUTPUT_TO_ELEMENT,
- "\u53EA\u80FD\u8F93\u51FA\u5230 Element, DocumentFragment, Document \u6216 PrintWriter\u3002"},
-
- { ER_PROCESS_ERROR,
- "StylesheetRoot.process \u9519\u8BEF"},
-
- { ER_UNIMPLNODE_ERROR,
- "UnImplNode \u9519\u8BEF: {0}"},
-
- { ER_NO_SELECT_EXPRESSION,
- "\u9519\u8BEF! \u627E\u4E0D\u5230 xpath \u9009\u62E9\u8868\u8FBE\u5F0F (-select)\u3002"},
-
- { ER_CANNOT_SERIALIZE_XSLPROCESSOR,
- "\u65E0\u6CD5\u5E8F\u5217\u5316 XSLProcessor!"},
-
- { ER_NO_INPUT_STYLESHEET,
- "\u672A\u6307\u5B9A\u6837\u5F0F\u8868\u8F93\u5165!"},
-
- { ER_FAILED_PROCESS_STYLESHEET,
- "\u65E0\u6CD5\u5904\u7406\u6837\u5F0F\u8868!"},
-
- { ER_COULDNT_PARSE_DOC,
- "\u65E0\u6CD5\u89E3\u6790{0}\u6587\u6863!"},
-
- { ER_COULDNT_FIND_FRAGMENT,
- "\u627E\u4E0D\u5230\u7247\u6BB5: {0}"},
-
- { ER_NODE_NOT_ELEMENT,
- "\u7247\u6BB5\u6807\u8BC6\u7B26\u6307\u5411\u7684\u8282\u70B9\u4E0D\u662F\u5143\u7D20: {0}"},
-
- { ER_FOREACH_NEED_MATCH_OR_NAME_ATTRIB,
- "for-each \u5FC5\u987B\u5177\u6709 match \u6216 name \u5C5E\u6027"},
-
- { ER_TEMPLATES_NEED_MATCH_OR_NAME_ATTRIB,
- "templates \u5FC5\u987B\u5177\u6709 match \u6216 name \u5C5E\u6027"},
-
- { ER_NO_CLONE_OF_DOCUMENT_FRAG,
- "\u4E0D\u80FD\u514B\u9686\u6587\u6863\u7247\u6BB5!"},
-
- { ER_CANT_CREATE_ITEM,
- "\u65E0\u6CD5\u5728\u7ED3\u679C\u6811\u4E2D\u521B\u5EFA\u9879: {0}"},
-
- { ER_XMLSPACE_ILLEGAL_VALUE,
- "\u6E90 XML \u4E2D\u7684 xml:space \u5177\u6709\u975E\u6CD5\u503C: {0}"},
-
- { ER_NO_XSLKEY_DECLARATION,
- "{0}\u6CA1\u6709 xsl:key \u58F0\u660E!"},
-
- { ER_CANT_CREATE_URL,
- "\u9519\u8BEF! \u65E0\u6CD5\u4E3A{0}\u521B\u5EFA url"},
-
- { ER_XSLFUNCTIONS_UNSUPPORTED,
- "\u4E0D\u652F\u6301 xsl:functions"},
-
- { ER_PROCESSOR_ERROR,
- "XSLT TransformerFactory \u9519\u8BEF"},
-
- { ER_NOT_ALLOWED_INSIDE_STYLESHEET,
- "(StylesheetHandler) \u6837\u5F0F\u8868\u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528{0}!"},
-
- { ER_RESULTNS_NOT_SUPPORTED,
- "\u4E0D\u518D\u652F\u6301 result-ns! \u8BF7\u6539\u7528 xsl:output\u3002"},
-
- { ER_DEFAULTSPACE_NOT_SUPPORTED,
- "\u4E0D\u518D\u652F\u6301 default-space! \u8BF7\u6539\u7528 xsl:strip-space \u6216 xsl:preserve-space\u3002"},
-
- { ER_INDENTRESULT_NOT_SUPPORTED,
- "\u4E0D\u518D\u652F\u6301 indent-result! \u8BF7\u6539\u7528 xsl:output\u3002"},
-
- { ER_ILLEGAL_ATTRIB,
- "(StylesheetHandler) {0}\u5177\u6709\u975E\u6CD5\u5C5E\u6027: {1}"},
-
- { ER_UNKNOWN_XSL_ELEM,
- "\u672A\u77E5 XSL \u5143\u7D20: {0}"},
-
- { ER_BAD_XSLSORT_USE,
- "(StylesheetHandler) xsl:sort \u53EA\u80FD\u4E0E xsl:apply-templates \u6216 xsl:for-each \u4E00\u8D77\u4F7F\u7528\u3002"},
-
- { ER_MISPLACED_XSLWHEN,
- "(StylesheetHandler) xsl:when \u7684\u653E\u7F6E\u4F4D\u7F6E\u9519\u8BEF!"},
-
- { ER_XSLWHEN_NOT_PARENTED_BY_XSLCHOOSE,
- "(StylesheetHandler) xsl:when \u7684\u7236\u7EA7\u4E0D\u662F xsl:choose!"},
-
- { ER_MISPLACED_XSLOTHERWISE,
- "(StylesheetHandler) xsl:otherwise \u7684\u653E\u7F6E\u4F4D\u7F6E\u9519\u8BEF!"},
-
- { ER_XSLOTHERWISE_NOT_PARENTED_BY_XSLCHOOSE,
- "(StylesheetHandler) xsl:otherwise \u7684\u7236\u7EA7\u4E0D\u662F xsl:choose!"},
-
- { ER_NOT_ALLOWED_INSIDE_TEMPLATE,
- "(StylesheetHandler) \u6A21\u677F\u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528{0}!"},
-
- { ER_UNKNOWN_EXT_NS_PREFIX,
- "(StylesheetHandler) {0}\u6269\u5C55\u540D\u79F0\u7A7A\u95F4\u524D\u7F00 {1} \u672A\u77E5"},
-
- { ER_IMPORTS_AS_FIRST_ELEM,
- "(StylesheetHandler) \u53EA\u80FD\u4F5C\u4E3A\u6837\u5F0F\u8868\u4E2D\u7684\u7B2C\u4E00\u4E2A\u5143\u7D20\u5BFC\u5165!"},
-
- { ER_IMPORTING_ITSELF,
- "(StylesheetHandler) {0}\u76F4\u63A5\u6216\u95F4\u63A5\u5BFC\u5165\u5176\u81EA\u8EAB!"},
-
- { ER_XMLSPACE_ILLEGAL_VAL,
- "(StylesheetHandler) xml:space \u5177\u6709\u975E\u6CD5\u503C: {0}"},
-
- { ER_PROCESSSTYLESHEET_NOT_SUCCESSFUL,
- "processStylesheet \u5931\u8D25!"},
-
- { ER_SAX_EXCEPTION,
- "SAX \u5F02\u5E38\u9519\u8BEF"},
-
-// add this message to fix bug 21478
- { ER_FUNCTION_NOT_SUPPORTED,
- "\u4E0D\u652F\u6301\u8BE5\u51FD\u6570!"},
-
- { ER_XSLT_ERROR,
- "XSLT \u9519\u8BEF"},
-
- { ER_CURRENCY_SIGN_ILLEGAL,
- "\u683C\u5F0F\u6A21\u5F0F\u5B57\u7B26\u4E32\u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528\u8D27\u5E01\u7B26\u53F7"},
-
- { ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM,
- "\u6837\u5F0F\u8868 DOM \u4E2D\u4E0D\u652F\u6301 Document \u51FD\u6570!"},
-
- { ER_CANT_RESOLVE_PREFIX_OF_NON_PREFIX_RESOLVER,
- "\u65E0\u6CD5\u89E3\u6790\u975E\u524D\u7F00\u89E3\u6790\u5668\u7684\u524D\u7F00!"},
-
- { ER_REDIRECT_COULDNT_GET_FILENAME,
- "\u91CD\u5B9A\u5411\u6269\u5C55: \u65E0\u6CD5\u83B7\u53D6\u6587\u4EF6\u540D - file \u6216 select \u5C5E\u6027\u5FC5\u987B\u8FD4\u56DE\u6709\u6548\u5B57\u7B26\u4E32\u3002"},
-
- { ER_CANNOT_BUILD_FORMATTERLISTENER_IN_REDIRECT,
- "\u65E0\u6CD5\u5728\u91CD\u5B9A\u5411\u6269\u5C55\u4E2D\u6784\u5EFA FormatterListener!"},
-
- { ER_INVALID_PREFIX_IN_EXCLUDERESULTPREFIX,
- "exclude-result-prefixes \u4E2D\u7684\u524D\u7F00\u65E0\u6548: {0}"},
-
- { ER_MISSING_NS_URI,
- "\u6307\u5B9A\u524D\u7F00\u7F3A\u5C11\u540D\u79F0\u7A7A\u95F4 URI"},
-
- { ER_MISSING_ARG_FOR_OPTION,
- "\u9009\u9879\u7F3A\u5C11\u53C2\u6570: {0}"},
-
- { ER_INVALID_OPTION,
- "\u9009\u9879\u65E0\u6548: {0}"},
-
- { ER_MALFORMED_FORMAT_STRING,
- "\u683C\u5F0F\u5B57\u7B26\u4E32\u7684\u683C\u5F0F\u9519\u8BEF: {0}"},
-
- { ER_STYLESHEET_REQUIRES_VERSION_ATTRIB,
- "xsl:stylesheet \u9700\u8981 'version' \u5C5E\u6027!"},
-
- { ER_ILLEGAL_ATTRIBUTE_VALUE,
- "\u5C5E\u6027{0}\u5177\u6709\u975E\u6CD5\u503C: {1}"},
-
- { ER_CHOOSE_REQUIRES_WHEN,
- "xsl:choose \u9700\u8981 xsl:when"},
-
- { ER_NO_APPLY_IMPORT_IN_FOR_EACH,
- "xsl:for-each \u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528 xsl:apply-imports"},
-
- { ER_CANT_USE_DTM_FOR_OUTPUT,
- "\u65E0\u6CD5\u5C06 DTMLiaison \u7528\u4E8E\u8F93\u51FA DOM \u8282\u70B9... \u8BF7\u6539\u4E3A\u4F20\u9012 com.sun.org.apache.xpath.internal.DOM2Helper!"},
-
- { ER_CANT_USE_DTM_FOR_INPUT,
- "\u65E0\u6CD5\u5C06 DTMLiaison \u7528\u4E8E\u8F93\u5165 DOM \u8282\u70B9... \u8BF7\u6539\u4E3A\u4F20\u9012 com.sun.org.apache.xpath.internal.DOM2Helper!"},
-
- { ER_CALL_TO_EXT_FAILED,
- "\u672A\u80FD\u8C03\u7528\u6269\u5C55\u5143\u7D20: {0}"},
-
- { ER_PREFIX_MUST_RESOLVE,
- "\u524D\u7F00\u5FC5\u987B\u89E3\u6790\u4E3A\u540D\u79F0\u7A7A\u95F4: {0}"},
-
- { ER_INVALID_UTF16_SURROGATE,
- "\u68C0\u6D4B\u5230\u65E0\u6548\u7684 UTF-16 \u4EE3\u7406: {0}?"},
-
- { ER_XSLATTRSET_USED_ITSELF,
- "xsl:attribute-set {0} \u4F7F\u7528\u5176\u81EA\u8EAB, \u8FD9\u5C06\u5BFC\u81F4\u65E0\u9650\u5FAA\u73AF\u3002"},
-
- { ER_CANNOT_MIX_XERCESDOM,
- "\u65E0\u6CD5\u6DF7\u5408\u975E Xerces-DOM \u8F93\u5165\u548C Xerces-DOM \u8F93\u51FA!"},
-
- { ER_TOO_MANY_LISTENERS,
- "addTraceListenersToStylesheet - TooManyListenersException"},
-
- { ER_IN_ELEMTEMPLATEELEM_READOBJECT,
- "\u5728 ElemTemplateElement.readObject \u4E2D: {0}"},
-
- { ER_DUPLICATE_NAMED_TEMPLATE,
- "\u627E\u5230\u591A\u4E2A\u540D\u4E3A{0}\u7684\u6A21\u677F"},
-
- { ER_INVALID_KEY_CALL,
- "\u51FD\u6570\u8C03\u7528\u65E0\u6548: \u4E0D\u5141\u8BB8\u9012\u5F52 key() \u8C03\u7528"},
-
- { ER_REFERENCING_ITSELF,
- "\u53D8\u91CF {0} \u76F4\u63A5\u6216\u95F4\u63A5\u5F15\u7528\u5176\u81EA\u8EAB!"},
-
- { ER_ILLEGAL_DOMSOURCE_INPUT,
- "\u5BF9\u4E8E newTemplates \u7684 DOMSource, \u8F93\u5165\u8282\u70B9\u4E0D\u80FD\u4E3A\u7A7A\u503C!"},
-
- { ER_CLASS_NOT_FOUND_FOR_OPTION,
- "\u627E\u4E0D\u5230\u9009\u9879{0}\u7684\u7C7B\u6587\u4EF6"},
-
- { ER_REQUIRED_ELEM_NOT_FOUND,
- "\u627E\u4E0D\u5230\u6240\u9700\u5143\u7D20: {0}"},
-
- { ER_INPUT_CANNOT_BE_NULL,
- "InputStream \u4E0D\u80FD\u4E3A\u7A7A\u503C"},
-
- { ER_URI_CANNOT_BE_NULL,
- "URI \u4E0D\u80FD\u4E3A\u7A7A\u503C"},
-
- { ER_FILE_CANNOT_BE_NULL,
- "File \u4E0D\u80FD\u4E3A\u7A7A\u503C"},
-
- { ER_SOURCE_CANNOT_BE_NULL,
- "InputSource \u4E0D\u80FD\u4E3A\u7A7A\u503C"},
-
- { ER_CANNOT_INIT_BSFMGR,
- "\u65E0\u6CD5\u521D\u59CB\u5316 BSF \u7BA1\u7406\u5668"},
-
- { ER_CANNOT_CMPL_EXTENSN,
- "\u65E0\u6CD5\u7F16\u8BD1\u6269\u5C55"},
-
- { ER_CANNOT_CREATE_EXTENSN,
- "\u65E0\u6CD5\u521B\u5EFA\u6269\u5C55: {0}, \u539F\u56E0: {1}"},
-
- { ER_INSTANCE_MTHD_CALL_REQUIRES,
- "\u5BF9\u65B9\u6CD5{0}\u7684\u5B9E\u4F8B\u65B9\u6CD5\u8C03\u7528\u9700\u8981\u5C06 Object \u5B9E\u4F8B\u4F5C\u4E3A\u7B2C\u4E00\u4E2A\u53C2\u6570"},
-
- { ER_INVALID_ELEMENT_NAME,
- "\u6307\u5B9A\u7684\u5143\u7D20\u540D\u79F0{0}\u65E0\u6548"},
-
- { ER_ELEMENT_NAME_METHOD_STATIC,
- "\u5143\u7D20\u540D\u79F0\u65B9\u6CD5\u5FC5\u987B\u662F static {0}"},
-
- { ER_EXTENSION_FUNC_UNKNOWN,
- "\u6269\u5C55\u51FD\u6570 {0}: {1} \u672A\u77E5"},
-
- { ER_MORE_MATCH_CONSTRUCTOR,
- "{0}\u7684\u6784\u9020\u5668\u5177\u6709\u591A\u4E2A\u6700\u4F73\u5339\u914D"},
-
- { ER_MORE_MATCH_METHOD,
- "\u65B9\u6CD5{0}\u5177\u6709\u591A\u4E2A\u6700\u4F73\u5339\u914D"},
-
- { ER_MORE_MATCH_ELEMENT,
- "\u5143\u7D20\u65B9\u6CD5{0}\u5177\u6709\u591A\u4E2A\u6700\u4F73\u5339\u914D"},
-
- { ER_INVALID_CONTEXT_PASSED,
- "\u4F20\u9012\u7684\u7528\u4E8E\u5BF9{0}\u6C42\u503C\u7684\u4E0A\u4E0B\u6587\u65E0\u6548"},
-
- { ER_POOL_EXISTS,
- "\u6C60\u5DF2\u5B58\u5728"},
-
- { ER_NO_DRIVER_NAME,
- "\u672A\u6307\u5B9A\u9A71\u52A8\u7A0B\u5E8F\u540D\u79F0"},
-
- { ER_NO_URL,
- "\u672A\u6307\u5B9A URL"},
-
- { ER_POOL_SIZE_LESSTHAN_ONE,
- "\u6C60\u5927\u5C0F\u5C0F\u4E8E 1!"},
-
- { ER_INVALID_DRIVER,
- "\u6307\u5B9A\u7684\u9A71\u52A8\u7A0B\u5E8F\u540D\u79F0\u65E0\u6548!"},
-
- { ER_NO_STYLESHEETROOT,
- "\u627E\u4E0D\u5230\u6837\u5F0F\u8868\u6839!"},
-
- { ER_ILLEGAL_XMLSPACE_VALUE,
- "xml:space \u7684\u503C\u975E\u6CD5"},
-
- { ER_PROCESSFROMNODE_FAILED,
- "processFromNode \u5931\u8D25"},
-
- { ER_RESOURCE_COULD_NOT_LOAD,
- "\u8D44\u6E90 [ {0} ] \u65E0\u6CD5\u52A0\u8F7D: {1} \n {2} \t {3}"},
-
- { ER_BUFFER_SIZE_LESSTHAN_ZERO,
- "\u7F13\u51B2\u533A\u5927\u5C0F <=0"},
-
- { ER_UNKNOWN_ERROR_CALLING_EXTENSION,
- "\u8C03\u7528\u6269\u5C55\u65F6\u51FA\u73B0\u672A\u77E5\u9519\u8BEF"},
-
- { ER_NO_NAMESPACE_DECL,
- "\u524D\u7F00 {0} \u6CA1\u6709\u5BF9\u5E94\u7684\u540D\u79F0\u7A7A\u95F4\u58F0\u660E"},
-
- { ER_ELEM_CONTENT_NOT_ALLOWED,
- "lang=javaclass {0}\u4E0D\u5141\u8BB8\u4F7F\u7528\u5143\u7D20\u5185\u5BB9"},
-
- { ER_STYLESHEET_DIRECTED_TERMINATION,
- "\u6837\u5F0F\u8868\u6307\u5411\u7EC8\u6B62"},
-
- { ER_ONE_OR_TWO,
- "1 \u6216 2"},
-
- { ER_TWO_OR_THREE,
- "2 \u6216 3"},
-
- { ER_COULD_NOT_LOAD_RESOURCE,
- "\u65E0\u6CD5\u52A0\u8F7D{0} (\u68C0\u67E5 CLASSPATH), \u73B0\u5728\u53EA\u4F7F\u7528\u9ED8\u8BA4\u503C"},
-
- { ER_CANNOT_INIT_DEFAULT_TEMPLATES,
- "\u65E0\u6CD5\u521D\u59CB\u5316\u9ED8\u8BA4\u6A21\u677F"},
-
- { ER_RESULT_NULL,
- "Result \u4E0D\u80FD\u4E3A\u7A7A\u503C"},
-
- { ER_RESULT_COULD_NOT_BE_SET,
- "\u65E0\u6CD5\u8BBE\u7F6E Result"},
-
- { ER_NO_OUTPUT_SPECIFIED,
- "\u672A\u6307\u5B9A\u8F93\u51FA"},
-
- { ER_CANNOT_TRANSFORM_TO_RESULT_TYPE,
- "\u65E0\u6CD5\u8F6C\u6362\u4E3A\u7C7B\u578B\u4E3A{0}\u7684 Result"},
-
- { ER_CANNOT_TRANSFORM_SOURCE_TYPE,
- "\u65E0\u6CD5\u8F6C\u6362\u7C7B\u578B\u4E3A{0}\u7684\u6E90"},
-
- { ER_NULL_CONTENT_HANDLER,
- "\u7A7A\u5185\u5BB9\u5904\u7406\u7A0B\u5E8F"},
-
- { ER_NULL_ERROR_HANDLER,
- "\u7A7A\u9519\u8BEF\u5904\u7406\u7A0B\u5E8F"},
-
- { ER_CANNOT_CALL_PARSE,
- "\u5982\u679C\u5C1A\u672A\u8BBE\u7F6E ContentHandler, \u5219\u65E0\u6CD5\u8C03\u7528 parse"},
-
- { ER_NO_PARENT_FOR_FILTER,
- "\u7B5B\u9009\u5668\u6CA1\u6709\u7236\u7EA7"},
-
- { ER_NO_STYLESHEET_IN_MEDIA,
- "\u5728{0}\u4E2D\u627E\u4E0D\u5230\u6837\u5F0F\u8868, \u4ECB\u8D28= {1}"},
-
- { ER_NO_STYLESHEET_PI,
- "\u5728{0}\u4E2D\u627E\u4E0D\u5230 xml-stylesheet PI"},
-
- { ER_NOT_SUPPORTED,
- "\u4E0D\u652F\u6301: {0}"},
-
- { ER_PROPERTY_VALUE_BOOLEAN,
- "\u5C5E\u6027{0}\u7684\u503C\u5E94\u4E3A Boolean \u5B9E\u4F8B"},
-
- { ER_COULD_NOT_FIND_EXTERN_SCRIPT,
- "\u65E0\u6CD5\u5728{0}\u4E2D\u83B7\u53D6\u5916\u90E8\u811A\u672C"},
-
- { ER_RESOURCE_COULD_NOT_FIND,
- "\u627E\u4E0D\u5230\u8D44\u6E90 [ {0} ]\u3002\n {1}"},
-
- { ER_OUTPUT_PROPERTY_NOT_RECOGNIZED,
- "\u65E0\u6CD5\u8BC6\u522B\u8F93\u51FA\u5C5E\u6027: {0}"},
-
- { ER_FAILED_CREATING_ELEMLITRSLT,
- "\u672A\u80FD\u521B\u5EFA ElemLiteralResult \u5B9E\u4F8B"},
-
- //Earlier (JDK 1.4 XALAN 2.2-D11) at key code '204' the key name was ER_PRIORITY_NOT_PARSABLE
- // In latest Xalan code base key name is ER_VALUE_SHOULD_BE_NUMBER. This should also be taken care
- //in locale specific files like XSLTErrorResources_de.java, XSLTErrorResources_fr.java etc.
- //NOTE: Not only the key name but message has also been changed.
- { ER_VALUE_SHOULD_BE_NUMBER,
- "{0}\u7684\u503C\u5E94\u5305\u542B\u53EF\u89E3\u6790\u7684\u6570\u5B57"},
-
- { ER_VALUE_SHOULD_EQUAL,
- "{0}\u7684\u503C\u5E94\u7B49\u4E8E\u201C\u662F\u201D\u6216\u201C\u5426\u201D"},
-
- { ER_FAILED_CALLING_METHOD,
- "\u672A\u80FD\u8C03\u7528{0}\u65B9\u6CD5"},
-
- { ER_FAILED_CREATING_ELEMTMPL,
- "\u672A\u80FD\u521B\u5EFA ElemTemplateElement \u5B9E\u4F8B"},
-
- { ER_CHARS_NOT_ALLOWED,
- "\u4E0D\u5141\u8BB8\u5728\u6587\u6863\u4E2D\u7684\u6B64\u4F4D\u7F6E\u5904\u4F7F\u7528\u5B57\u7B26"},
-
- { ER_ATTR_NOT_ALLOWED,
- "{1}\u5143\u7D20\u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528 \"{0}\" \u5C5E\u6027!"},
-
- { ER_BAD_VALUE,
- "{0}\u9519\u8BEF\u503C{1} "},
-
- { ER_ATTRIB_VALUE_NOT_FOUND,
- "\u627E\u4E0D\u5230{0}\u5C5E\u6027\u503C "},
-
- { ER_ATTRIB_VALUE_NOT_RECOGNIZED,
- "\u65E0\u6CD5\u8BC6\u522B{0}\u5C5E\u6027\u503C "},
-
- { ER_NULL_URI_NAMESPACE,
- "\u5C1D\u8BD5\u4F7F\u7528\u7A7A URI \u751F\u6210\u540D\u79F0\u7A7A\u95F4\u524D\u7F00"},
-
- { ER_NUMBER_TOO_BIG,
- "\u5C1D\u8BD5\u8BBE\u7F6E\u8D85\u8FC7\u6700\u5927\u957F\u6574\u578B\u7684\u6570\u5B57\u7684\u683C\u5F0F"},
-
- { ER_CANNOT_FIND_SAX1_DRIVER,
- "\u627E\u4E0D\u5230 SAX1 \u9A71\u52A8\u7A0B\u5E8F\u7C7B{0}"},
-
- { ER_SAX1_DRIVER_NOT_LOADED,
- "\u5DF2\u627E\u5230 SAX1 \u9A71\u52A8\u7A0B\u5E8F\u7C7B{0}, \u4F46\u65E0\u6CD5\u8FDB\u884C\u52A0\u8F7D"},
-
- { ER_SAX1_DRIVER_NOT_INSTANTIATED,
- "\u5DF2\u52A0\u8F7D SAX1 \u9A71\u52A8\u7A0B\u5E8F\u7C7B{0}, \u4F46\u65E0\u6CD5\u8FDB\u884C\u5B9E\u4F8B\u5316"},
-
- { ER_SAX1_DRIVER_NOT_IMPLEMENT_PARSER,
- "SAX1 \u9A71\u52A8\u7A0B\u5E8F\u7C7B {0} \u672A\u5B9E\u73B0 org.xml.sax.Parser"},
-
- { ER_PARSER_PROPERTY_NOT_SPECIFIED,
- "\u672A\u6307\u5B9A\u7CFB\u7EDF\u5C5E\u6027 org.xml.sax.parser"},
-
- { ER_PARSER_ARG_CANNOT_BE_NULL,
- "\u89E3\u6790\u5668\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A\u503C"},
-
- { ER_FEATURE,
- "\u529F\u80FD: {0}"},
-
- { ER_PROPERTY,
- "\u5C5E\u6027: {0}"},
-
- { ER_NULL_ENTITY_RESOLVER,
- "\u7A7A\u5B9E\u4F53\u89E3\u6790\u5668"},
-
- { ER_NULL_DTD_HANDLER,
- "\u7A7A DTD \u5904\u7406\u7A0B\u5E8F"},
-
- { ER_NO_DRIVER_NAME_SPECIFIED,
- "\u672A\u6307\u5B9A\u9A71\u52A8\u7A0B\u5E8F\u540D\u79F0!"},
-
- { ER_NO_URL_SPECIFIED,
- "\u672A\u6307\u5B9A URL!"},
-
- { ER_POOLSIZE_LESS_THAN_ONE,
- "\u6C60\u5927\u5C0F\u5C0F\u4E8E 1!"},
-
- { ER_INVALID_DRIVER_NAME,
- "\u6307\u5B9A\u7684\u9A71\u52A8\u7A0B\u5E8F\u540D\u79F0\u65E0\u6548!"},
-
- { ER_ERRORLISTENER,
- "ErrorListener"},
-
-
-// Note to translators: The following message should not normally be displayed
-// to users. It describes a situation in which the processor has detected
-// an internal consistency problem in itself, and it provides this message
-// for the developer to help diagnose the problem. The name
-// 'ElemTemplateElement' is the name of a class, and should not be
-// translated.
- { ER_ASSERT_NO_TEMPLATE_PARENT,
- "\u7A0B\u5E8F\u5458\u9519\u8BEF! \u8868\u8FBE\u5F0F\u6CA1\u6709 ElemTemplateElement \u7236\u7EA7!"},
-
-
-// Note to translators: The following message should not normally be displayed
-// to users. It describes a situation in which the processor has detected
-// an internal consistency problem in itself, and it provides this message
-// for the developer to help diagnose the problem. The substitution text
-// provides further information in order to diagnose the problem. The name
-// 'RedundentExprEliminator' is the name of a class, and should not be
-// translated.
- { ER_ASSERT_REDUNDENT_EXPR_ELIMINATOR,
- "RedundentExprEliminator \u4E2D\u7684\u7A0B\u5E8F\u5458\u65AD\u8A00: {0}"},
-
- { ER_NOT_ALLOWED_IN_POSITION,
- "\u4E0D\u5141\u8BB8\u5728\u6837\u5F0F\u8868\u4E2D\u7684\u6B64\u4F4D\u7F6E\u4F7F\u7528{0}!"},
-
- { ER_NONWHITESPACE_NOT_ALLOWED_IN_POSITION,
- "\u4E0D\u5141\u8BB8\u5728\u6837\u5F0F\u8868\u4E2D\u7684\u6B64\u4F4D\u7F6E\u4F7F\u7528\u975E\u7A7A\u767D\u6587\u672C!"},
-
- // This code is shared with warning codes.
- // SystemId Unknown
- { INVALID_TCHAR,
- "CHAR \u5C5E\u6027{0}\u4F7F\u7528\u4E86\u975E\u6CD5\u503C{1}\u3002CHAR \u7C7B\u578B\u7684\u5C5E\u6027\u53EA\u80FD\u4E3A 1 \u4E2A\u5B57\u7B26!"},
-
- // Note to translators: The following message is used if the value of
- // an attribute in a stylesheet is invalid. "QNAME" is the XML data-type of
- // the attribute, and should not be translated. The substitution text {1} is
- // the attribute value and {0} is the attribute name.
- //The following codes are shared with the warning codes...
- { INVALID_QNAME,
- "QNAME \u5C5E\u6027{0}\u4F7F\u7528\u4E86\u975E\u6CD5\u503C{1}"},
-
- // Note to translators: The following message is used if the value of
- // an attribute in a stylesheet is invalid. "ENUM" is the XML data-type of
- // the attribute, and should not be translated. The substitution text {1} is
- // the attribute value, {0} is the attribute name, and {2} is a list of valid
- // values.
- { INVALID_ENUM,
- "ENUM \u5C5E\u6027{0}\u4F7F\u7528\u4E86\u975E\u6CD5\u503C{1}\u3002\u6709\u6548\u503C\u4E3A: {2}\u3002"},
-
-// Note to translators: The following message is used if the value of
-// an attribute in a stylesheet is invalid. "NMTOKEN" is the XML data-type
-// of the attribute, and should not be translated. The substitution text {1} is
-// the attribute value and {0} is the attribute name.
- { INVALID_NMTOKEN,
- "NMTOKEN \u5C5E\u6027{0}\u4F7F\u7528\u4E86\u975E\u6CD5\u503C{1} "},
-
-// Note to translators: The following message is used if the value of
-// an attribute in a stylesheet is invalid. "NCNAME" is the XML data-type
-// of the attribute, and should not be translated. The substitution text {1} is
-// the attribute value and {0} is the attribute name.
- { INVALID_NCNAME,
- "NCNAME \u5C5E\u6027{0}\u4F7F\u7528\u4E86\u975E\u6CD5\u503C{1} "},
-
-// Note to translators: The following message is used if the value of
-// an attribute in a stylesheet is invalid. "boolean" is the XSLT data-type
-// of the attribute, and should not be translated. The substitution text {1} is
-// the attribute value and {0} is the attribute name.
- { INVALID_BOOLEAN,
- "Boolean \u5C5E\u6027{0}\u4F7F\u7528\u4E86\u975E\u6CD5\u503C{1} "},
-
-// Note to translators: The following message is used if the value of
-// an attribute in a stylesheet is invalid. "number" is the XSLT data-type
-// of the attribute, and should not be translated. The substitution text {1} is
-// the attribute value and {0} is the attribute name.
- { INVALID_NUMBER,
- "Number \u5C5E\u6027{0}\u4F7F\u7528\u4E86\u975E\u6CD5\u503C{1} "},
-
-
- // End of shared codes...
-
-// Note to translators: A "match pattern" is a special form of XPath expression
-// that is used for matching patterns. The substitution text is the name of
-// a function. The message indicates that when this function is referenced in
-// a match pattern, its argument must be a string literal (or constant.)
-// ER_ARG_LITERAL - new error message for bugzilla //5202
- { ER_ARG_LITERAL,
- "\u5339\u914D\u6A21\u5F0F\u4E2D\u7684{0}\u7684\u53C2\u6570\u5FC5\u987B\u4E3A\u6587\u5B57\u3002"},
-
-// Note to translators: The following message indicates that two definitions of
-// a variable. A "global variable" is a variable that is accessible everywher
-// in the stylesheet.
-// ER_DUPLICATE_GLOBAL_VAR - new error message for bugzilla #790
- { ER_DUPLICATE_GLOBAL_VAR,
- "\u5168\u5C40\u53D8\u91CF\u58F0\u660E\u91CD\u590D\u3002"},
-
-
-// Note to translators: The following message indicates that two definitions of
-// a variable were encountered.
-// ER_DUPLICATE_VAR - new error message for bugzilla #790
- { ER_DUPLICATE_VAR,
- "\u53D8\u91CF\u58F0\u660E\u91CD\u590D\u3002"},
-
- // Note to translators: "xsl:template, "name" and "match" are XSLT keywords
- // which must not be translated.
- // ER_TEMPLATE_NAME_MATCH - new error message for bugzilla #789
- { ER_TEMPLATE_NAME_MATCH,
- "xsl:template \u5FC5\u987B\u5177\u6709 name \u548C/\u6216 match \u5C5E\u6027"},
-
- // Note to translators: "exclude-result-prefixes" is an XSLT keyword which
- // should not be translated. The message indicates that a namespace prefix
- // encountered as part of the value of the exclude-result-prefixes attribute
- // was in error.
- // ER_INVALID_PREFIX - new error message for bugzilla #788
- { ER_INVALID_PREFIX,
- "exclude-result-prefixes \u4E2D\u7684\u524D\u7F00\u65E0\u6548: {0}"},
-
- // Note to translators: An "attribute set" is a set of attributes that can
- // be added to an element in the output document as a group. The message
- // indicates that there was a reference to an attribute set named {0} that
- // was never defined.
- // ER_NO_ATTRIB_SET - new error message for bugzilla #782
- { ER_NO_ATTRIB_SET,
- "\u540D\u4E3A{0}\u7684\u5C5E\u6027\u96C6\u4E0D\u5B58\u5728"},
-
- // Note to translators: This message indicates that there was a reference
- // to a function named {0} for which no function definition could be found.
- { ER_FUNCTION_NOT_FOUND,
- "\u540D\u4E3A{0}\u7684\u51FD\u6570\u4E0D\u5B58\u5728"},
-
- // Note to translators: This message indicates that the XSLT instruction
- // that is named by the substitution text {0} must not contain other XSLT
- // instructions (content) or a "select" attribute. The word "select" is
- // an XSLT keyword in this case and must not be translated.
- { ER_CANT_HAVE_CONTENT_AND_SELECT,
- "{0}\u5143\u7D20\u4E0D\u80FD\u540C\u65F6\u5177\u6709\u5185\u5BB9\u548C select \u5C5E\u6027\u3002"},
-
- // Note to translators: This message indicates that the value argument
- // of setParameter must be a valid Java Object.
- { ER_INVALID_SET_PARAM_VALUE,
- "\u53C2\u6570 {0} \u7684\u503C\u5FC5\u987B\u662F\u6709\u6548 Java \u5BF9\u8C61"},
-
- { ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX_FOR_DEFAULT,
- "xsl:namespace-alias \u5143\u7D20\u7684 result-prefix \u5C5E\u6027\u5177\u6709\u503C '#default', \u4F46\u8BE5\u5143\u7D20\u7684\u4F5C\u7528\u57DF\u4E2D\u6CA1\u6709\u9ED8\u8BA4\u540D\u79F0\u7A7A\u95F4\u7684\u58F0\u660E"},
-
- { ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX,
- "xsl:namespace-alias \u5143\u7D20\u7684 result-prefix \u5C5E\u6027\u5177\u6709\u503C ''{0}'', \u4F46\u8BE5\u5143\u7D20\u7684\u4F5C\u7528\u57DF\u4E2D\u6CA1\u6709\u524D\u7F00 ''{0}'' \u7684\u540D\u79F0\u7A7A\u95F4\u58F0\u660E\u3002"},
-
- { ER_SET_FEATURE_NULL_NAME,
- "TransformerFactory.setFeature(String name, boolean value) \u4E2D\u7684\u529F\u80FD\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A\u503C\u3002"},
-
- { ER_GET_FEATURE_NULL_NAME,
- "TransformerFactory.getFeature(String name) \u4E2D\u7684\u529F\u80FD\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A\u503C\u3002"},
-
- { ER_UNSUPPORTED_FEATURE,
- "\u65E0\u6CD5\u5BF9\u6B64 TransformerFactory \u8BBE\u7F6E\u529F\u80FD ''{0}''\u3002"},
-
- { ER_EXTENSION_ELEMENT_NOT_ALLOWED_IN_SECURE_PROCESSING,
- "\u5F53\u5B89\u5168\u5904\u7406\u529F\u80FD\u8BBE\u7F6E\u4E3A\u201C\u771F\u201D\u65F6, \u4E0D\u5141\u8BB8\u4F7F\u7528\u6269\u5C55\u5143\u7D20 ''{0}''\u3002"},
-
- { ER_NAMESPACE_CONTEXT_NULL_NAMESPACE,
- "\u65E0\u6CD5\u83B7\u53D6\u7A7A\u540D\u79F0\u7A7A\u95F4 uri \u7684\u524D\u7F00\u3002"},
-
- { ER_NAMESPACE_CONTEXT_NULL_PREFIX,
- "\u65E0\u6CD5\u83B7\u53D6\u7A7A\u524D\u7F00\u7684\u540D\u79F0\u7A7A\u95F4 uri\u3002"},
-
- { ER_XPATH_RESOLVER_NULL_QNAME,
- "\u51FD\u6570\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A\u503C\u3002"},
-
- { ER_XPATH_RESOLVER_NEGATIVE_ARITY,
- "\u5143\u6570\u4E0D\u80FD\u4E3A\u8D1F\u6570\u3002"},
- // Warnings...
-
- { WG_FOUND_CURLYBRACE,
- "\u5DF2\u627E\u5230 '}', \u4F46\u672A\u6253\u5F00\u5C5E\u6027\u6A21\u677F!"},
-
- { WG_COUNT_ATTRIB_MATCHES_NO_ANCESTOR,
- "\u8B66\u544A: count \u5C5E\u6027\u4E0E xsl:number \u4E2D\u7684 ancestor \u4E0D\u5339\u914D! \u76EE\u6807 = {0}"},
-
- { WG_EXPR_ATTRIB_CHANGED_TO_SELECT,
- "\u65E7\u8BED\u6CD5: 'expr' \u5C5E\u6027\u7684\u540D\u79F0\u5DF2\u66F4\u6539\u4E3A 'select'\u3002"},
-
- { WG_NO_LOCALE_IN_FORMATNUMBER,
- "Xalan \u5C1A\u672A\u5904\u7406 format-number \u51FD\u6570\u4E2D\u7684\u533A\u57DF\u8BBE\u7F6E\u540D\u79F0\u3002"},
-
- { WG_LOCALE_NOT_FOUND,
- "\u8B66\u544A: \u627E\u4E0D\u5230 xml:lang={0} \u7684\u533A\u57DF\u8BBE\u7F6E"},
-
- { WG_CANNOT_MAKE_URL_FROM,
- "\u65E0\u6CD5\u6839\u636E{0}\u751F\u6210 URL"},
-
- { WG_CANNOT_LOAD_REQUESTED_DOC,
- "\u65E0\u6CD5\u52A0\u8F7D\u8BF7\u6C42\u7684\u6587\u6863: {0}"},
-
- { WG_CANNOT_FIND_COLLATOR,
- "\u627E\u4E0D\u5230 <sort xml:lang={0} \u7684 Collator"},
-
- { WG_FUNCTIONS_SHOULD_USE_URL,
- "\u65E7\u8BED\u6CD5: \u51FD\u6570\u6307\u4EE4\u5E94\u4F7F\u7528{0}\u7684 url"},
-
- { WG_ENCODING_NOT_SUPPORTED_USING_UTF8,
- "\u4E0D\u652F\u6301\u7F16\u7801: {0}, \u4F7F\u7528 UTF-8"},
-
- { WG_ENCODING_NOT_SUPPORTED_USING_JAVA,
- "\u4E0D\u652F\u6301\u7F16\u7801: {0}, \u4F7F\u7528 Java {1}"},
-
- { WG_SPECIFICITY_CONFLICTS,
- "\u53D1\u73B0\u7279\u5F81\u51B2\u7A81: \u5C06\u4F7F\u7528\u4E0A\u6B21\u5728\u6837\u5F0F\u8868\u4E2D\u627E\u5230\u7684{0}\u3002"},
-
- { WG_PARSING_AND_PREPARING,
- "========= \u89E3\u6790\u548C\u51C6\u5907{0} =========="},
-
- { WG_ATTR_TEMPLATE,
- "\u5C5E\u6027\u6A21\u677F{0}"},
-
- { WG_CONFLICT_BETWEEN_XSLSTRIPSPACE_AND_XSLPRESERVESPACE,
- "xsl:strip-space \u548C xsl:preserve-space \u4E4B\u95F4\u5B58\u5728\u5339\u914D\u51B2\u7A81"},
-
- { WG_ATTRIB_NOT_HANDLED,
- "Xalan \u5C1A\u672A\u5904\u7406{0}\u5C5E\u6027!"},
-
- { WG_NO_DECIMALFORMAT_DECLARATION,
- "\u627E\u4E0D\u5230\u5341\u8FDB\u5236\u683C\u5F0F\u7684\u58F0\u660E: {0}"},
-
- { WG_OLD_XSLT_NS,
- "\u7F3A\u5C11 XSLT \u540D\u79F0\u7A7A\u95F4\u6216 XSLT \u540D\u79F0\u7A7A\u95F4\u9519\u8BEF\u3002"},
-
- { WG_ONE_DEFAULT_XSLDECIMALFORMAT_ALLOWED,
- "\u4EC5\u5141\u8BB8\u4F7F\u7528\u4E00\u4E2A\u9ED8\u8BA4\u7684 xsl:decimal-format \u58F0\u660E\u3002"},
-
- { WG_XSLDECIMALFORMAT_NAMES_MUST_BE_UNIQUE,
- "xsl:decimal-format \u540D\u79F0\u5FC5\u987B\u552F\u4E00\u3002\u540D\u79F0 \"{0}\" \u91CD\u590D\u3002"},
-
- { WG_ILLEGAL_ATTRIBUTE,
- "{0}\u5177\u6709\u975E\u6CD5\u5C5E\u6027: {1}"},
-
- { WG_COULD_NOT_RESOLVE_PREFIX,
- "\u65E0\u6CD5\u89E3\u6790\u540D\u79F0\u7A7A\u95F4\u524D\u7F00: {0}\u3002\u5C06\u5FFD\u7565\u8282\u70B9\u3002"},
-
- { WG_STYLESHEET_REQUIRES_VERSION_ATTRIB,
- "xsl:stylesheet \u9700\u8981 'version' \u5C5E\u6027!"},
-
- { WG_ILLEGAL_ATTRIBUTE_NAME,
- "\u975E\u6CD5\u5C5E\u6027\u540D\u79F0: {0}"},
-
- { WG_ILLEGAL_ATTRIBUTE_VALUE,
- "\u5C5E\u6027{0}\u4F7F\u7528\u4E86\u975E\u6CD5\u503C{1}"},
-
- { WG_EMPTY_SECOND_ARG,
- "\u6839\u636E document \u51FD\u6570\u7684\u7B2C\u4E8C\u4E2A\u53C2\u6570\u5F97\u5230\u7684\u8282\u70B9\u96C6\u4E3A\u7A7A\u3002\u8FD4\u56DE\u7A7A node-set\u3002"},
-
- //Following are the new WARNING keys added in XALAN code base after Jdk 1.4 (Xalan 2.2-D11)
-
- // Note to translators: "name" and "xsl:processing-instruction" are keywords
- // and must not be translated.
- { WG_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML,
- "xsl:processing-instruction \u540D\u79F0\u7684 'name' \u5C5E\u6027\u7684\u503C\u4E0D\u80FD\u4E3A 'xml'"},
-
- // Note to translators: "name" and "xsl:processing-instruction" are keywords
- // and must not be translated. "NCName" is an XML data-type and must not be
- // translated.
- { WG_PROCESSINGINSTRUCTION_NOTVALID_NCNAME,
- "xsl:processing-instruction \u7684 ''name'' \u5C5E\u6027\u7684\u503C\u5FC5\u987B\u662F\u6709\u6548\u7684 NCName: {0}"},
-
- // Note to translators: This message is reported if the stylesheet that is
- // being processed attempted to construct an XML document with an attribute in a
- // place other than on an element. The substitution text specifies the name of
- // the attribute.
- { WG_ILLEGAL_ATTRIBUTE_POSITION,
- "\u5728\u751F\u6210\u5B50\u8282\u70B9\u4E4B\u540E\u6216\u5728\u751F\u6210\u5143\u7D20\u4E4B\u524D\u65E0\u6CD5\u6DFB\u52A0\u5C5E\u6027 {0}\u3002\u5C06\u5FFD\u7565\u5C5E\u6027\u3002"},
-
- { NO_MODIFICATION_ALLOWED_ERR,
- "\u5C1D\u8BD5\u4FEE\u6539\u4E0D\u5141\u8BB8\u4FEE\u6539\u7684\u5BF9\u8C61\u3002"
- },
-
- //Check: WHY THERE IS A GAP B/W NUMBERS in the XSLTErrorResources properties file?
-
- // Other miscellaneous text used inside the code...
- { "ui_language", "en"},
- { "help_language", "en" },
- { "language", "en" },
- { "BAD_CODE", "createMessage \u7684\u53C2\u6570\u8D85\u51FA\u8303\u56F4"},
- { "FORMAT_FAILED", "\u8C03\u7528 messageFormat \u65F6\u629B\u51FA\u5F02\u5E38\u9519\u8BEF"},
- { "version", ">>>>>>> Xalan \u7248\u672C "},
- { "version2", "<<<<<<<"},
- { "yes", "\u662F"},
- { "line", "\u884C\u53F7"},
- { "column","\u5217\u53F7"},
- { "xsldone", "XSLProcessor: \u5B8C\u6210"},
-
-
- // Note to translators: The following messages provide usage information
- // for the Xalan Process command line. "Process" is the name of a Java class,
- // and should not be translated.
- { "xslProc_option", "Xalan-J \u547D\u4EE4\u884C Process \u7C7B\u9009\u9879:"},
- { "xslProc_option", "Xalan-J \u547D\u4EE4\u884C Process \u7C7B\u9009\u9879:"},
- { "xslProc_invalid_xsltc_option", "XSLTC \u6A21\u5F0F\u4E0B\u4E0D\u652F\u6301\u9009\u9879{0}\u3002"},
- { "xslProc_invalid_xalan_option", "\u9009\u9879{0}\u53EA\u80FD\u4E0E -XSLTC \u4E00\u8D77\u4F7F\u7528\u3002"},
- { "xslProc_no_input", "\u9519\u8BEF: \u672A\u6307\u5B9A\u6837\u5F0F\u8868\u6216\u8F93\u5165 xml\u3002\u8FD0\u884C\u6B64\u547D\u4EE4\u65F6, \u7528\u6CD5\u6307\u4EE4\u4E0D\u5E26\u4EFB\u4F55\u9009\u9879\u3002"},
- { "xslProc_common_options", "-\u516C\u7528\u9009\u9879-"},
- { "xslProc_xalan_options", "-Xalan \u7684\u9009\u9879-"},
- { "xslProc_xsltc_options", "-XSLTC \u7684\u9009\u9879-"},
- { "xslProc_return_to_continue", "(\u6309 <return> \u4EE5\u7EE7\u7EED)"},
-
- // Note to translators: The option name and the parameter name do not need to
- // be translated. Only translate the messages in parentheses. Note also that
- // leading whitespace in the messages is used to indent the usage information
- // for each option in the English messages.
- // Do not translate the keywords: XSLTC, SAX, DOM and DTM.
- { "optionXSLTC", " [-XSLTC (\u4F7F\u7528 XSLTC \u8FDB\u884C\u8F6C\u6362)]"},
- { "optionIN", " [-IN inputXMLURL]"},
- { "optionXSL", " [-XSL XSLTransformationURL]"},
- { "optionOUT", " [-OUT outputFileName]"},
- { "optionLXCIN", " [-LXCIN compiledStylesheetFileNameIn]"},
- { "optionLXCOUT", " [-LXCOUT compiledStylesheetFileNameOutOut]"},
- { "optionPARSER", " [-PARSER fully qualified class name of parser liaison]"},
- { "optionE", " [-E (\u4E0D\u5C55\u5F00\u5B9E\u4F53\u5F15\u7528)]"},
- { "optionV", " [-E (\u4E0D\u5C55\u5F00\u5B9E\u4F53\u5F15\u7528)]"},
- { "optionQC", " [-QC (\u65E0\u63D0\u793A\u6A21\u5F0F\u51B2\u7A81\u8B66\u544A)]"},
- { "optionQ", " [-Q (\u65E0\u63D0\u793A\u6A21\u5F0F)]"},
- { "optionLF", " [-LF (\u4EC5\u5728\u8F93\u51FA\u65F6\u4F7F\u7528\u6362\u884C\u7B26 {\u9ED8\u8BA4\u503C\u4E3A CR/LF})]"},
- { "optionCR", " [-CR (\u4EC5\u5728\u8F93\u51FA\u65F6\u4F7F\u7528\u56DE\u8F66 {\u9ED8\u8BA4\u503C\u4E3A CR/LF})]"},
- { "optionESCAPE", " [-ESCAPE (\u8981\u8F6C\u79FB\u7684\u5B57\u7B26 {\u9ED8\u8BA4\u503C\u4E3A <>&\"'\\r\\n}]"},
- { "optionINDENT", " [-INDENT (\u63A7\u5236\u8981\u7F29\u8FDB\u7684\u7A7A\u683C\u6570 {\u9ED8\u8BA4\u503C\u4E3A 0})]"},
- { "optionTT", " [-TT (\u5728\u8C03\u7528\u6A21\u677F\u65F6\u8DDF\u8E2A\u6A21\u677F\u3002)]"},
- { "optionTG", " [-TG (\u8DDF\u8E2A\u6BCF\u4E2A\u751F\u6210\u4E8B\u4EF6\u3002)]"},
- { "optionTS", " [-TS (\u8DDF\u8E2A\u6BCF\u4E2A\u9009\u62E9\u4E8B\u4EF6\u3002)]"},
- { "optionTTC", " [-TTC (\u5728\u5904\u7406\u6A21\u677F\u5B50\u7EA7\u65F6\u8DDF\u8E2A\u6A21\u677F\u5B50\u7EA7\u3002)]"},
- { "optionTCLASS", " [-TCLASS (\u7528\u4E8E\u8DDF\u8E2A\u6269\u5C55\u7684 TraceListener \u7C7B\u3002)]"},
- { "optionVALIDATE", " [-VALIDATE (\u8BBE\u7F6E\u662F\u5426\u8FDB\u884C\u9A8C\u8BC1\u3002\u9ED8\u8BA4\u60C5\u51B5\u4E0B, \u5C06\u7981\u6B62\u9A8C\u8BC1\u3002)]"},
- { "optionEDUMP", " [-EDUMP {optional filename} (\u5728\u51FA\u9519\u65F6\u6267\u884C\u5806\u6808\u8F6C\u50A8\u3002)]"},
- { "optionXML", " [-XML (\u4F7F\u7528 XML \u683C\u5F0F\u8BBE\u7F6E\u5DE5\u5177\u5E76\u6DFB\u52A0 XML \u6807\u5934\u3002)]"},
- { "optionTEXT", " [-TEXT (\u4F7F\u7528\u7B80\u5355\u6587\u672C\u683C\u5F0F\u8BBE\u7F6E\u5DE5\u5177\u3002)]"},
- { "optionHTML", " [-HTML (\u4F7F\u7528 HTML \u683C\u5F0F\u8BBE\u7F6E\u5DE5\u5177\u3002)]"},
- { "optionPARAM", " [-PARAM \u540D\u79F0\u8868\u8FBE\u5F0F (\u8BBE\u7F6E\u6837\u5F0F\u8868\u53C2\u6570)]"},
- { "noParsermsg1", "XSL \u8FDB\u7A0B\u672A\u6210\u529F\u3002"},
- { "noParsermsg2", "** \u627E\u4E0D\u5230\u89E3\u6790\u5668 **"},
- { "noParsermsg3", "\u8BF7\u68C0\u67E5\u60A8\u7684\u7C7B\u8DEF\u5F84\u3002"},
- { "noParsermsg4", "\u5982\u679C\u6CA1\u6709 IBM \u63D0\u4F9B\u7684 XML Parser for Java, \u5219\u53EF\u4EE5\u4ECE"},
- { "noParsermsg5", "IBM AlphaWorks \u8FDB\u884C\u4E0B\u8F7D, \u7F51\u5740\u4E3A: http://www.alphaworks.ibm.com/formula/xml"},
- { "optionURIRESOLVER", " [-URIRESOLVER \u5B8C\u6574\u7C7B\u540D (\u4F7F\u7528 URIResolver \u89E3\u6790 URI)]"},
- { "optionENTITYRESOLVER", " [-ENTITYRESOLVER \u5B8C\u6574\u7C7B\u540D (\u4F7F\u7528 EntityResolver \u89E3\u6790\u5B9E\u4F53)]"},
- { "optionCONTENTHANDLER", " [-CONTENTHANDLER \u5B8C\u6574\u7C7B\u540D (\u4F7F\u7528 ContentHandler \u5E8F\u5217\u5316\u8F93\u51FA)]"},
- { "optionLINENUMBERS", " [-L \u4F7F\u7528\u6E90\u6587\u6863\u7684\u884C\u53F7]"},
- { "optionSECUREPROCESSING", " [-SECURE (\u5C06\u5B89\u5168\u5904\u7406\u529F\u80FD\u8BBE\u7F6E\u4E3A\u201C\u771F\u201D\u3002)]"},
-
- // Following are the new options added in XSLTErrorResources.properties files after Jdk 1.4 (Xalan 2.2-D11)
-
-
- { "optionMEDIA", " [-MEDIA mediaType (\u4F7F\u7528 media \u5C5E\u6027\u67E5\u627E\u4E0E\u6587\u6863\u5173\u8054\u7684\u6837\u5F0F\u8868\u3002)]"},
- { "optionFLAVOR", " [-FLAVOR flavorName (\u660E\u786E\u4F7F\u7528 s2s=SAX \u6216 d2d=DOM \u6267\u884C\u8F6C\u6362\u3002)] "}, // Added by sboag/scurcuru; experimental
- { "optionDIAG", " [-DIAG (\u8F93\u51FA\u5168\u90E8\u8F6C\u6362\u65F6\u95F4 (\u6BEB\u79D2)\u3002)]"},
- { "optionINCREMENTAL", " [-INCREMENTAL (\u901A\u8FC7\u5C06 http://xml.apache.org/xalan/features/incremental \u8BBE\u7F6E\u4E3A\u201C\u771F\u201D\u6765\u8BF7\u6C42\u589E\u91CF DTM \u6784\u5EFA\u3002)]"},
- { "optionNOOPTIMIMIZE", " [-NOOPTIMIMIZE (\u901A\u8FC7\u5C06 http://xml.apache.org/xalan/features/optimize \u8BBE\u7F6E\u4E3A\u201C\u5047\u201D\u6765\u8BF7\u6C42\u4E0D\u6267\u884C\u6837\u5F0F\u8868\u4F18\u5316\u5904\u7406\u3002)]"},
- { "optionRL", " [-RL recursionlimit (\u58F0\u660E\u6837\u5F0F\u8868\u9012\u5F52\u6DF1\u5EA6\u7684\u6570\u5B57\u9650\u5236\u3002)]"},
- { "optionXO", " [-XO [transletName] (\u4E3A\u751F\u6210\u7684 translet \u5206\u914D\u540D\u79F0)]"},
- { "optionXD", " [-XD destinationDirectory (\u6307\u5B9A translet \u7684\u76EE\u6807\u76EE\u5F55)]"},
- { "optionXJ", " [-XJ jarfile (\u5C06 translet \u7C7B\u6253\u5305\u5230\u540D\u4E3A <jarfile> \u7684 jar \u6587\u4EF6\u4E2D)]"},
- { "optionXP", " [-XP package (\u4E3A\u751F\u6210\u7684\u6240\u6709 translet \u7C7B\u6307\u5B9A\u7A0B\u5E8F\u5305\u540D\u79F0\u524D\u7F00)]"},
-
- //AddITIONAL STRINGS that need L10n
- // Note to translators: The following message describes usage of a particular
- // command-line option that is used to enable the "template inlining"
- // optimization. The optimization involves making a copy of the code
- // generated for a template in another template that refers to it.
- { "optionXN", " [-XN (\u542F\u7528\u6A21\u677F\u5185\u5D4C)]" },
- { "optionXX", " [-XX (\u542F\u7528\u9644\u52A0\u8C03\u8BD5\u6D88\u606F\u8F93\u51FA)]"},
- { "optionXT" , " [-XT (\u5982\u679C\u53EF\u80FD, \u4F7F\u7528 translet \u8FDB\u884C\u8F6C\u6362)]"},
- { "diagTiming"," --------- \u901A\u8FC7{1}\u8F6C\u6362{0}\u82B1\u8D39\u4E86 {2} \u6BEB\u79D2\u7684\u65F6\u95F4" },
- { "recursionTooDeep","\u6A21\u677F\u5D4C\u5957\u592A\u6DF1\u3002\u5D4C\u5957 = {0}, \u6A21\u677F{1} {2}" },
- { "nameIs", "\u540D\u79F0\u4E3A" },
- { "matchPatternIs", "\u5339\u914D\u6A21\u5F0F\u4E3A" }
-
- };
-
- }
- // ================= INFRASTRUCTURE ======================
-
- /** String for use when a bad error code was encountered. */
- public static final String BAD_CODE = "BAD_CODE";
-
- /** String for use when formatting of the error string failed. */
- public static final String FORMAT_FAILED = "FORMAT_FAILED";
-
- /** General error string. */
- public static final String ERROR_STRING = "#error";
-
- /** String to prepend to error messages. */
- public static final String ERROR_HEADER = "Error: ";
-
- /** String to prepend to warning messages. */
- public static final String WARNING_HEADER = "Warning: ";
-
- /** String to specify the XSLT module. */
- public static final String XSL_HEADER = "XSLT ";
-
- /** String to specify the XML parser module. */
- public static final String XML_HEADER = "XML ";
-
- /** I don't think this is used any more.
- * @deprecated */
- public static final String QUERY_HEADER = "PATTERN ";
-
-
- }
diff --git a/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_TW.java b/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_TW.java
deleted file mode 100644
index ee8a11b..0000000
--- a/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_TW.java
+++ /dev/null
@@ -1,1447 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xalan.internal.res;
-
-import java.util.ListResourceBundle;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * Set up error messages.
- * We build a two dimensional array of message keys and
- * message strings. In order to add a new message here,
- * you need to first add a String constant. And
- * you need to enter key , value pair as part of contents
- * Array. You also need to update MAX_CODE for error strings
- * and MAX_WARNING for warnings ( Needed for only information
- * purpose )
- */
-public class XSLTErrorResources_zh_TW extends ListResourceBundle
-{
-
-/*
- * This file contains error and warning messages related to Xalan Error
- * Handling.
- *
- * General notes to translators:
- *
- * 1) Xalan (or more properly, Xalan-interpretive) and XSLTC are names of
- * components.
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- * XSLTC is an acronym for XSLT Compiler.
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 5) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 6) "Translet" is an invented term that describes the class file that
- * results from compiling an XML stylesheet into a Java class.
- *
- * 7) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- */
-
- /*
- * Static variables
- */
- public static final String ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX =
- "ER_INVALID_SET_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX";
-
- public static final String ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX_FOR_DEFAULT =
- "ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX_FOR_DEFAULT";
-
- public static final String ER_NO_CURLYBRACE = "ER_NO_CURLYBRACE";
- public static final String ER_FUNCTION_NOT_SUPPORTED = "ER_FUNCTION_NOT_SUPPORTED";
- public static final String ER_ILLEGAL_ATTRIBUTE = "ER_ILLEGAL_ATTRIBUTE";
- public static final String ER_NULL_SOURCENODE_APPLYIMPORTS = "ER_NULL_SOURCENODE_APPLYIMPORTS";
- public static final String ER_CANNOT_ADD = "ER_CANNOT_ADD";
- public static final String ER_NULL_SOURCENODE_HANDLEAPPLYTEMPLATES="ER_NULL_SOURCENODE_HANDLEAPPLYTEMPLATES";
- public static final String ER_NO_NAME_ATTRIB = "ER_NO_NAME_ATTRIB";
- public static final String ER_TEMPLATE_NOT_FOUND = "ER_TEMPLATE_NOT_FOUND";
- public static final String ER_CANT_RESOLVE_NAME_AVT = "ER_CANT_RESOLVE_NAME_AVT";
- public static final String ER_REQUIRES_ATTRIB = "ER_REQUIRES_ATTRIB";
- public static final String ER_MUST_HAVE_TEST_ATTRIB = "ER_MUST_HAVE_TEST_ATTRIB";
- public static final String ER_BAD_VAL_ON_LEVEL_ATTRIB =
- "ER_BAD_VAL_ON_LEVEL_ATTRIB";
- public static final String ER_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML =
- "ER_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML";
- public static final String ER_PROCESSINGINSTRUCTION_NOTVALID_NCNAME =
- "ER_PROCESSINGINSTRUCTION_NOTVALID_NCNAME";
- public static final String ER_NEED_MATCH_ATTRIB = "ER_NEED_MATCH_ATTRIB";
- public static final String ER_NEED_NAME_OR_MATCH_ATTRIB =
- "ER_NEED_NAME_OR_MATCH_ATTRIB";
- public static final String ER_CANT_RESOLVE_NSPREFIX =
- "ER_CANT_RESOLVE_NSPREFIX";
- public static final String ER_ILLEGAL_VALUE = "ER_ILLEGAL_VALUE";
- public static final String ER_NO_OWNERDOC = "ER_NO_OWNERDOC";
- public static final String ER_ELEMTEMPLATEELEM_ERR ="ER_ELEMTEMPLATEELEM_ERR";
- public static final String ER_NULL_CHILD = "ER_NULL_CHILD";
- public static final String ER_NEED_SELECT_ATTRIB = "ER_NEED_SELECT_ATTRIB";
- public static final String ER_NEED_TEST_ATTRIB = "ER_NEED_TEST_ATTRIB";
- public static final String ER_NEED_NAME_ATTRIB = "ER_NEED_NAME_ATTRIB";
- public static final String ER_NO_CONTEXT_OWNERDOC = "ER_NO_CONTEXT_OWNERDOC";
- public static final String ER_COULD_NOT_CREATE_XML_PROC_LIAISON =
- "ER_COULD_NOT_CREATE_XML_PROC_LIAISON";
- public static final String ER_PROCESS_NOT_SUCCESSFUL =
- "ER_PROCESS_NOT_SUCCESSFUL";
- public static final String ER_NOT_SUCCESSFUL = "ER_NOT_SUCCESSFUL";
- public static final String ER_ENCODING_NOT_SUPPORTED =
- "ER_ENCODING_NOT_SUPPORTED";
- public static final String ER_COULD_NOT_CREATE_TRACELISTENER =
- "ER_COULD_NOT_CREATE_TRACELISTENER";
- public static final String ER_KEY_REQUIRES_NAME_ATTRIB =
- "ER_KEY_REQUIRES_NAME_ATTRIB";
- public static final String ER_KEY_REQUIRES_MATCH_ATTRIB =
- "ER_KEY_REQUIRES_MATCH_ATTRIB";
- public static final String ER_KEY_REQUIRES_USE_ATTRIB =
- "ER_KEY_REQUIRES_USE_ATTRIB";
- public static final String ER_REQUIRES_ELEMENTS_ATTRIB =
- "ER_REQUIRES_ELEMENTS_ATTRIB";
- public static final String ER_MISSING_PREFIX_ATTRIB =
- "ER_MISSING_PREFIX_ATTRIB";
- public static final String ER_BAD_STYLESHEET_URL = "ER_BAD_STYLESHEET_URL";
- public static final String ER_FILE_NOT_FOUND = "ER_FILE_NOT_FOUND";
- public static final String ER_IOEXCEPTION = "ER_IOEXCEPTION";
- public static final String ER_NO_HREF_ATTRIB = "ER_NO_HREF_ATTRIB";
- public static final String ER_STYLESHEET_INCLUDES_ITSELF =
- "ER_STYLESHEET_INCLUDES_ITSELF";
- public static final String ER_PROCESSINCLUDE_ERROR ="ER_PROCESSINCLUDE_ERROR";
- public static final String ER_MISSING_LANG_ATTRIB = "ER_MISSING_LANG_ATTRIB";
- public static final String ER_MISSING_CONTAINER_ELEMENT_COMPONENT =
- "ER_MISSING_CONTAINER_ELEMENT_COMPONENT";
- public static final String ER_CAN_ONLY_OUTPUT_TO_ELEMENT =
- "ER_CAN_ONLY_OUTPUT_TO_ELEMENT";
- public static final String ER_PROCESS_ERROR = "ER_PROCESS_ERROR";
- public static final String ER_UNIMPLNODE_ERROR = "ER_UNIMPLNODE_ERROR";
- public static final String ER_NO_SELECT_EXPRESSION ="ER_NO_SELECT_EXPRESSION";
- public static final String ER_CANNOT_SERIALIZE_XSLPROCESSOR =
- "ER_CANNOT_SERIALIZE_XSLPROCESSOR";
- public static final String ER_NO_INPUT_STYLESHEET = "ER_NO_INPUT_STYLESHEET";
- public static final String ER_FAILED_PROCESS_STYLESHEET =
- "ER_FAILED_PROCESS_STYLESHEET";
- public static final String ER_COULDNT_PARSE_DOC = "ER_COULDNT_PARSE_DOC";
- public static final String ER_COULDNT_FIND_FRAGMENT =
- "ER_COULDNT_FIND_FRAGMENT";
- public static final String ER_NODE_NOT_ELEMENT = "ER_NODE_NOT_ELEMENT";
- public static final String ER_FOREACH_NEED_MATCH_OR_NAME_ATTRIB =
- "ER_FOREACH_NEED_MATCH_OR_NAME_ATTRIB";
- public static final String ER_TEMPLATES_NEED_MATCH_OR_NAME_ATTRIB =
- "ER_TEMPLATES_NEED_MATCH_OR_NAME_ATTRIB";
- public static final String ER_NO_CLONE_OF_DOCUMENT_FRAG =
- "ER_NO_CLONE_OF_DOCUMENT_FRAG";
- public static final String ER_CANT_CREATE_ITEM = "ER_CANT_CREATE_ITEM";
- public static final String ER_XMLSPACE_ILLEGAL_VALUE =
- "ER_XMLSPACE_ILLEGAL_VALUE";
- public static final String ER_NO_XSLKEY_DECLARATION =
- "ER_NO_XSLKEY_DECLARATION";
- public static final String ER_CANT_CREATE_URL = "ER_CANT_CREATE_URL";
- public static final String ER_XSLFUNCTIONS_UNSUPPORTED =
- "ER_XSLFUNCTIONS_UNSUPPORTED";
- public static final String ER_PROCESSOR_ERROR = "ER_PROCESSOR_ERROR";
- public static final String ER_NOT_ALLOWED_INSIDE_STYLESHEET =
- "ER_NOT_ALLOWED_INSIDE_STYLESHEET";
- public static final String ER_RESULTNS_NOT_SUPPORTED =
- "ER_RESULTNS_NOT_SUPPORTED";
- public static final String ER_DEFAULTSPACE_NOT_SUPPORTED =
- "ER_DEFAULTSPACE_NOT_SUPPORTED";
- public static final String ER_INDENTRESULT_NOT_SUPPORTED =
- "ER_INDENTRESULT_NOT_SUPPORTED";
- public static final String ER_ILLEGAL_ATTRIB = "ER_ILLEGAL_ATTRIB";
- public static final String ER_UNKNOWN_XSL_ELEM = "ER_UNKNOWN_XSL_ELEM";
- public static final String ER_BAD_XSLSORT_USE = "ER_BAD_XSLSORT_USE";
- public static final String ER_MISPLACED_XSLWHEN = "ER_MISPLACED_XSLWHEN";
- public static final String ER_XSLWHEN_NOT_PARENTED_BY_XSLCHOOSE =
- "ER_XSLWHEN_NOT_PARENTED_BY_XSLCHOOSE";
- public static final String ER_MISPLACED_XSLOTHERWISE =
- "ER_MISPLACED_XSLOTHERWISE";
- public static final String ER_XSLOTHERWISE_NOT_PARENTED_BY_XSLCHOOSE =
- "ER_XSLOTHERWISE_NOT_PARENTED_BY_XSLCHOOSE";
- public static final String ER_NOT_ALLOWED_INSIDE_TEMPLATE =
- "ER_NOT_ALLOWED_INSIDE_TEMPLATE";
- public static final String ER_UNKNOWN_EXT_NS_PREFIX =
- "ER_UNKNOWN_EXT_NS_PREFIX";
- public static final String ER_IMPORTS_AS_FIRST_ELEM =
- "ER_IMPORTS_AS_FIRST_ELEM";
- public static final String ER_IMPORTING_ITSELF = "ER_IMPORTING_ITSELF";
- public static final String ER_XMLSPACE_ILLEGAL_VAL ="ER_XMLSPACE_ILLEGAL_VAL";
- public static final String ER_PROCESSSTYLESHEET_NOT_SUCCESSFUL =
- "ER_PROCESSSTYLESHEET_NOT_SUCCESSFUL";
- public static final String ER_SAX_EXCEPTION = "ER_SAX_EXCEPTION";
- public static final String ER_XSLT_ERROR = "ER_XSLT_ERROR";
- public static final String ER_CURRENCY_SIGN_ILLEGAL=
- "ER_CURRENCY_SIGN_ILLEGAL";
- public static final String ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM =
- "ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM";
- public static final String ER_CANT_RESOLVE_PREFIX_OF_NON_PREFIX_RESOLVER =
- "ER_CANT_RESOLVE_PREFIX_OF_NON_PREFIX_RESOLVER";
- public static final String ER_REDIRECT_COULDNT_GET_FILENAME =
- "ER_REDIRECT_COULDNT_GET_FILENAME";
- public static final String ER_CANNOT_BUILD_FORMATTERLISTENER_IN_REDIRECT =
- "ER_CANNOT_BUILD_FORMATTERLISTENER_IN_REDIRECT";
- public static final String ER_INVALID_PREFIX_IN_EXCLUDERESULTPREFIX =
- "ER_INVALID_PREFIX_IN_EXCLUDERESULTPREFIX";
- public static final String ER_MISSING_NS_URI = "ER_MISSING_NS_URI";
- public static final String ER_MISSING_ARG_FOR_OPTION =
- "ER_MISSING_ARG_FOR_OPTION";
- public static final String ER_INVALID_OPTION = "ER_INVALID_OPTION";
- public static final String ER_MALFORMED_FORMAT_STRING =
- "ER_MALFORMED_FORMAT_STRING";
- public static final String ER_STYLESHEET_REQUIRES_VERSION_ATTRIB =
- "ER_STYLESHEET_REQUIRES_VERSION_ATTRIB";
- public static final String ER_ILLEGAL_ATTRIBUTE_VALUE =
- "ER_ILLEGAL_ATTRIBUTE_VALUE";
- public static final String ER_CHOOSE_REQUIRES_WHEN ="ER_CHOOSE_REQUIRES_WHEN";
- public static final String ER_NO_APPLY_IMPORT_IN_FOR_EACH =
- "ER_NO_APPLY_IMPORT_IN_FOR_EACH";
- public static final String ER_CANT_USE_DTM_FOR_OUTPUT =
- "ER_CANT_USE_DTM_FOR_OUTPUT";
- public static final String ER_CANT_USE_DTM_FOR_INPUT =
- "ER_CANT_USE_DTM_FOR_INPUT";
- public static final String ER_CALL_TO_EXT_FAILED = "ER_CALL_TO_EXT_FAILED";
- public static final String ER_PREFIX_MUST_RESOLVE = "ER_PREFIX_MUST_RESOLVE";
- public static final String ER_INVALID_UTF16_SURROGATE =
- "ER_INVALID_UTF16_SURROGATE";
- public static final String ER_XSLATTRSET_USED_ITSELF =
- "ER_XSLATTRSET_USED_ITSELF";
- public static final String ER_CANNOT_MIX_XERCESDOM ="ER_CANNOT_MIX_XERCESDOM";
- public static final String ER_TOO_MANY_LISTENERS = "ER_TOO_MANY_LISTENERS";
- public static final String ER_IN_ELEMTEMPLATEELEM_READOBJECT =
- "ER_IN_ELEMTEMPLATEELEM_READOBJECT";
- public static final String ER_DUPLICATE_NAMED_TEMPLATE =
- "ER_DUPLICATE_NAMED_TEMPLATE";
- public static final String ER_INVALID_KEY_CALL = "ER_INVALID_KEY_CALL";
- public static final String ER_REFERENCING_ITSELF = "ER_REFERENCING_ITSELF";
- public static final String ER_ILLEGAL_DOMSOURCE_INPUT =
- "ER_ILLEGAL_DOMSOURCE_INPUT";
- public static final String ER_CLASS_NOT_FOUND_FOR_OPTION =
- "ER_CLASS_NOT_FOUND_FOR_OPTION";
- public static final String ER_REQUIRED_ELEM_NOT_FOUND =
- "ER_REQUIRED_ELEM_NOT_FOUND";
- public static final String ER_INPUT_CANNOT_BE_NULL ="ER_INPUT_CANNOT_BE_NULL";
- public static final String ER_URI_CANNOT_BE_NULL = "ER_URI_CANNOT_BE_NULL";
- public static final String ER_FILE_CANNOT_BE_NULL = "ER_FILE_CANNOT_BE_NULL";
- public static final String ER_SOURCE_CANNOT_BE_NULL =
- "ER_SOURCE_CANNOT_BE_NULL";
- public static final String ER_CANNOT_INIT_BSFMGR = "ER_CANNOT_INIT_BSFMGR";
- public static final String ER_CANNOT_CMPL_EXTENSN = "ER_CANNOT_CMPL_EXTENSN";
- public static final String ER_CANNOT_CREATE_EXTENSN =
- "ER_CANNOT_CREATE_EXTENSN";
- public static final String ER_INSTANCE_MTHD_CALL_REQUIRES =
- "ER_INSTANCE_MTHD_CALL_REQUIRES";
- public static final String ER_INVALID_ELEMENT_NAME ="ER_INVALID_ELEMENT_NAME";
- public static final String ER_ELEMENT_NAME_METHOD_STATIC =
- "ER_ELEMENT_NAME_METHOD_STATIC";
- public static final String ER_EXTENSION_FUNC_UNKNOWN =
- "ER_EXTENSION_FUNC_UNKNOWN";
- public static final String ER_MORE_MATCH_CONSTRUCTOR =
- "ER_MORE_MATCH_CONSTRUCTOR";
- public static final String ER_MORE_MATCH_METHOD = "ER_MORE_MATCH_METHOD";
- public static final String ER_MORE_MATCH_ELEMENT = "ER_MORE_MATCH_ELEMENT";
- public static final String ER_INVALID_CONTEXT_PASSED =
- "ER_INVALID_CONTEXT_PASSED";
- public static final String ER_POOL_EXISTS = "ER_POOL_EXISTS";
- public static final String ER_NO_DRIVER_NAME = "ER_NO_DRIVER_NAME";
- public static final String ER_NO_URL = "ER_NO_URL";
- public static final String ER_POOL_SIZE_LESSTHAN_ONE =
- "ER_POOL_SIZE_LESSTHAN_ONE";
- public static final String ER_INVALID_DRIVER = "ER_INVALID_DRIVER";
- public static final String ER_NO_STYLESHEETROOT = "ER_NO_STYLESHEETROOT";
- public static final String ER_ILLEGAL_XMLSPACE_VALUE =
- "ER_ILLEGAL_XMLSPACE_VALUE";
- public static final String ER_PROCESSFROMNODE_FAILED =
- "ER_PROCESSFROMNODE_FAILED";
- public static final String ER_RESOURCE_COULD_NOT_LOAD =
- "ER_RESOURCE_COULD_NOT_LOAD";
- public static final String ER_BUFFER_SIZE_LESSTHAN_ZERO =
- "ER_BUFFER_SIZE_LESSTHAN_ZERO";
- public static final String ER_UNKNOWN_ERROR_CALLING_EXTENSION =
- "ER_UNKNOWN_ERROR_CALLING_EXTENSION";
- public static final String ER_NO_NAMESPACE_DECL = "ER_NO_NAMESPACE_DECL";
- public static final String ER_ELEM_CONTENT_NOT_ALLOWED =
- "ER_ELEM_CONTENT_NOT_ALLOWED";
- public static final String ER_STYLESHEET_DIRECTED_TERMINATION =
- "ER_STYLESHEET_DIRECTED_TERMINATION";
- public static final String ER_ONE_OR_TWO = "ER_ONE_OR_TWO";
- public static final String ER_TWO_OR_THREE = "ER_TWO_OR_THREE";
- public static final String ER_COULD_NOT_LOAD_RESOURCE =
- "ER_COULD_NOT_LOAD_RESOURCE";
- public static final String ER_CANNOT_INIT_DEFAULT_TEMPLATES =
- "ER_CANNOT_INIT_DEFAULT_TEMPLATES";
- public static final String ER_RESULT_NULL = "ER_RESULT_NULL";
- public static final String ER_RESULT_COULD_NOT_BE_SET =
- "ER_RESULT_COULD_NOT_BE_SET";
- public static final String ER_NO_OUTPUT_SPECIFIED = "ER_NO_OUTPUT_SPECIFIED";
- public static final String ER_CANNOT_TRANSFORM_TO_RESULT_TYPE =
- "ER_CANNOT_TRANSFORM_TO_RESULT_TYPE";
- public static final String ER_CANNOT_TRANSFORM_SOURCE_TYPE =
- "ER_CANNOT_TRANSFORM_SOURCE_TYPE";
- public static final String ER_NULL_CONTENT_HANDLER ="ER_NULL_CONTENT_HANDLER";
- public static final String ER_NULL_ERROR_HANDLER = "ER_NULL_ERROR_HANDLER";
- public static final String ER_CANNOT_CALL_PARSE = "ER_CANNOT_CALL_PARSE";
- public static final String ER_NO_PARENT_FOR_FILTER ="ER_NO_PARENT_FOR_FILTER";
- public static final String ER_NO_STYLESHEET_IN_MEDIA =
- "ER_NO_STYLESHEET_IN_MEDIA";
- public static final String ER_NO_STYLESHEET_PI = "ER_NO_STYLESHEET_PI";
- public static final String ER_NOT_SUPPORTED = "ER_NOT_SUPPORTED";
- public static final String ER_PROPERTY_VALUE_BOOLEAN =
- "ER_PROPERTY_VALUE_BOOLEAN";
- public static final String ER_COULD_NOT_FIND_EXTERN_SCRIPT =
- "ER_COULD_NOT_FIND_EXTERN_SCRIPT";
- public static final String ER_RESOURCE_COULD_NOT_FIND =
- "ER_RESOURCE_COULD_NOT_FIND";
- public static final String ER_OUTPUT_PROPERTY_NOT_RECOGNIZED =
- "ER_OUTPUT_PROPERTY_NOT_RECOGNIZED";
- public static final String ER_FAILED_CREATING_ELEMLITRSLT =
- "ER_FAILED_CREATING_ELEMLITRSLT";
- public static final String ER_VALUE_SHOULD_BE_NUMBER =
- "ER_VALUE_SHOULD_BE_NUMBER";
- public static final String ER_VALUE_SHOULD_EQUAL = "ER_VALUE_SHOULD_EQUAL";
- public static final String ER_FAILED_CALLING_METHOD =
- "ER_FAILED_CALLING_METHOD";
- public static final String ER_FAILED_CREATING_ELEMTMPL =
- "ER_FAILED_CREATING_ELEMTMPL";
- public static final String ER_CHARS_NOT_ALLOWED = "ER_CHARS_NOT_ALLOWED";
- public static final String ER_ATTR_NOT_ALLOWED = "ER_ATTR_NOT_ALLOWED";
- public static final String ER_BAD_VALUE = "ER_BAD_VALUE";
- public static final String ER_ATTRIB_VALUE_NOT_FOUND =
- "ER_ATTRIB_VALUE_NOT_FOUND";
- public static final String ER_ATTRIB_VALUE_NOT_RECOGNIZED =
- "ER_ATTRIB_VALUE_NOT_RECOGNIZED";
- public static final String ER_NULL_URI_NAMESPACE = "ER_NULL_URI_NAMESPACE";
- public static final String ER_NUMBER_TOO_BIG = "ER_NUMBER_TOO_BIG";
- public static final String ER_CANNOT_FIND_SAX1_DRIVER =
- "ER_CANNOT_FIND_SAX1_DRIVER";
- public static final String ER_SAX1_DRIVER_NOT_LOADED =
- "ER_SAX1_DRIVER_NOT_LOADED";
- public static final String ER_SAX1_DRIVER_NOT_INSTANTIATED =
- "ER_SAX1_DRIVER_NOT_INSTANTIATED" ;
- public static final String ER_SAX1_DRIVER_NOT_IMPLEMENT_PARSER =
- "ER_SAX1_DRIVER_NOT_IMPLEMENT_PARSER";
- public static final String ER_PARSER_PROPERTY_NOT_SPECIFIED =
- "ER_PARSER_PROPERTY_NOT_SPECIFIED";
- public static final String ER_PARSER_ARG_CANNOT_BE_NULL =
- "ER_PARSER_ARG_CANNOT_BE_NULL" ;
- public static final String ER_FEATURE = "ER_FEATURE";
- public static final String ER_PROPERTY = "ER_PROPERTY" ;
- public static final String ER_NULL_ENTITY_RESOLVER ="ER_NULL_ENTITY_RESOLVER";
- public static final String ER_NULL_DTD_HANDLER = "ER_NULL_DTD_HANDLER" ;
- public static final String ER_NO_DRIVER_NAME_SPECIFIED =
- "ER_NO_DRIVER_NAME_SPECIFIED";
- public static final String ER_NO_URL_SPECIFIED = "ER_NO_URL_SPECIFIED";
- public static final String ER_POOLSIZE_LESS_THAN_ONE =
- "ER_POOLSIZE_LESS_THAN_ONE";
- public static final String ER_INVALID_DRIVER_NAME = "ER_INVALID_DRIVER_NAME";
- public static final String ER_ERRORLISTENER = "ER_ERRORLISTENER";
- public static final String ER_ASSERT_NO_TEMPLATE_PARENT =
- "ER_ASSERT_NO_TEMPLATE_PARENT";
- public static final String ER_ASSERT_REDUNDENT_EXPR_ELIMINATOR =
- "ER_ASSERT_REDUNDENT_EXPR_ELIMINATOR";
- public static final String ER_NOT_ALLOWED_IN_POSITION =
- "ER_NOT_ALLOWED_IN_POSITION";
- public static final String ER_NONWHITESPACE_NOT_ALLOWED_IN_POSITION =
- "ER_NONWHITESPACE_NOT_ALLOWED_IN_POSITION";
- public static final String ER_NAMESPACE_CONTEXT_NULL_NAMESPACE =
- "ER_NAMESPACE_CONTEXT_NULL_NAMESPACE";
- public static final String ER_NAMESPACE_CONTEXT_NULL_PREFIX =
- "ER_NAMESPACE_CONTEXT_NULL_PREFIX";
- public static final String ER_XPATH_RESOLVER_NULL_QNAME =
- "ER_XPATH_RESOLVER_NULL_QNAME";
- public static final String ER_XPATH_RESOLVER_NEGATIVE_ARITY =
- "ER_XPATH_RESOLVER_NEGATIVE_ARITY";
- public static final String INVALID_TCHAR = "INVALID_TCHAR";
- public static final String INVALID_QNAME = "INVALID_QNAME";
- public static final String INVALID_ENUM = "INVALID_ENUM";
- public static final String INVALID_NMTOKEN = "INVALID_NMTOKEN";
- public static final String INVALID_NCNAME = "INVALID_NCNAME";
- public static final String INVALID_BOOLEAN = "INVALID_BOOLEAN";
- public static final String INVALID_NUMBER = "INVALID_NUMBER";
- public static final String ER_ARG_LITERAL = "ER_ARG_LITERAL";
- public static final String ER_DUPLICATE_GLOBAL_VAR ="ER_DUPLICATE_GLOBAL_VAR";
- public static final String ER_DUPLICATE_VAR = "ER_DUPLICATE_VAR";
- public static final String ER_TEMPLATE_NAME_MATCH = "ER_TEMPLATE_NAME_MATCH";
- public static final String ER_INVALID_PREFIX = "ER_INVALID_PREFIX";
- public static final String ER_NO_ATTRIB_SET = "ER_NO_ATTRIB_SET";
- public static final String ER_FUNCTION_NOT_FOUND =
- "ER_FUNCTION_NOT_FOUND";
- public static final String ER_CANT_HAVE_CONTENT_AND_SELECT =
- "ER_CANT_HAVE_CONTENT_AND_SELECT";
- public static final String ER_INVALID_SET_PARAM_VALUE = "ER_INVALID_SET_PARAM_VALUE";
- public static final String ER_SET_FEATURE_NULL_NAME =
- "ER_SET_FEATURE_NULL_NAME";
- public static final String ER_GET_FEATURE_NULL_NAME =
- "ER_GET_FEATURE_NULL_NAME";
- public static final String ER_UNSUPPORTED_FEATURE =
- "ER_UNSUPPORTED_FEATURE";
- public static final String ER_EXTENSION_ELEMENT_NOT_ALLOWED_IN_SECURE_PROCESSING =
- "ER_EXTENSION_ELEMENT_NOT_ALLOWED_IN_SECURE_PROCESSING";
-
- public static final String WG_FOUND_CURLYBRACE = "WG_FOUND_CURLYBRACE";
- public static final String WG_COUNT_ATTRIB_MATCHES_NO_ANCESTOR =
- "WG_COUNT_ATTRIB_MATCHES_NO_ANCESTOR";
- public static final String WG_EXPR_ATTRIB_CHANGED_TO_SELECT =
- "WG_EXPR_ATTRIB_CHANGED_TO_SELECT";
- public static final String WG_NO_LOCALE_IN_FORMATNUMBER =
- "WG_NO_LOCALE_IN_FORMATNUMBER";
- public static final String WG_LOCALE_NOT_FOUND = "WG_LOCALE_NOT_FOUND";
- public static final String WG_CANNOT_MAKE_URL_FROM ="WG_CANNOT_MAKE_URL_FROM";
- public static final String WG_CANNOT_LOAD_REQUESTED_DOC =
- "WG_CANNOT_LOAD_REQUESTED_DOC";
- public static final String WG_CANNOT_FIND_COLLATOR ="WG_CANNOT_FIND_COLLATOR";
- public static final String WG_FUNCTIONS_SHOULD_USE_URL =
- "WG_FUNCTIONS_SHOULD_USE_URL";
- public static final String WG_ENCODING_NOT_SUPPORTED_USING_UTF8 =
- "WG_ENCODING_NOT_SUPPORTED_USING_UTF8";
- public static final String WG_ENCODING_NOT_SUPPORTED_USING_JAVA =
- "WG_ENCODING_NOT_SUPPORTED_USING_JAVA";
- public static final String WG_SPECIFICITY_CONFLICTS =
- "WG_SPECIFICITY_CONFLICTS";
- public static final String WG_PARSING_AND_PREPARING =
- "WG_PARSING_AND_PREPARING";
- public static final String WG_ATTR_TEMPLATE = "WG_ATTR_TEMPLATE";
- public static final String WG_CONFLICT_BETWEEN_XSLSTRIPSPACE_AND_XSLPRESERVESPACE = "WG_CONFLICT_BETWEEN_XSLSTRIPSPACE_AND_XSLPRESERVESP";
- public static final String WG_ATTRIB_NOT_HANDLED = "WG_ATTRIB_NOT_HANDLED";
- public static final String WG_NO_DECIMALFORMAT_DECLARATION =
- "WG_NO_DECIMALFORMAT_DECLARATION";
- public static final String WG_OLD_XSLT_NS = "WG_OLD_XSLT_NS";
- public static final String WG_ONE_DEFAULT_XSLDECIMALFORMAT_ALLOWED =
- "WG_ONE_DEFAULT_XSLDECIMALFORMAT_ALLOWED";
- public static final String WG_XSLDECIMALFORMAT_NAMES_MUST_BE_UNIQUE =
- "WG_XSLDECIMALFORMAT_NAMES_MUST_BE_UNIQUE";
- public static final String WG_ILLEGAL_ATTRIBUTE = "WG_ILLEGAL_ATTRIBUTE";
- public static final String WG_COULD_NOT_RESOLVE_PREFIX =
- "WG_COULD_NOT_RESOLVE_PREFIX";
- public static final String WG_STYLESHEET_REQUIRES_VERSION_ATTRIB =
- "WG_STYLESHEET_REQUIRES_VERSION_ATTRIB";
- public static final String WG_ILLEGAL_ATTRIBUTE_NAME =
- "WG_ILLEGAL_ATTRIBUTE_NAME";
- public static final String WG_ILLEGAL_ATTRIBUTE_VALUE =
- "WG_ILLEGAL_ATTRIBUTE_VALUE";
- public static final String WG_EMPTY_SECOND_ARG = "WG_EMPTY_SECOND_ARG";
- public static final String WG_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML =
- "WG_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML";
- public static final String WG_PROCESSINGINSTRUCTION_NOTVALID_NCNAME =
- "WG_PROCESSINGINSTRUCTION_NOTVALID_NCNAME";
- public static final String WG_ILLEGAL_ATTRIBUTE_POSITION =
- "WG_ILLEGAL_ATTRIBUTE_POSITION";
- public static final String NO_MODIFICATION_ALLOWED_ERR =
- "NO_MODIFICATION_ALLOWED_ERR";
-
- /*
- * Now fill in the message text.
- * Then fill in the message text for that message code in the
- * array. Use the new error code as the index into the array.
- */
-
- // Error messages...
-
- /** Get the lookup table for error messages.
- *
- * @return The message lookup table.
- */
- public Object[][] getContents()
- {
- return new Object[][] {
-
- /** Error message ID that has a null message, but takes in a single object. */
- {"ER0000" , "{0}" },
-
- { ER_NO_CURLYBRACE,
- "\u932F\u8AA4: \u8868\u793A\u5F0F\u4E2D\u4E0D\u53EF\u6709 '{'"},
-
- { ER_ILLEGAL_ATTRIBUTE ,
- "{0} \u5177\u6709\u7121\u6548\u5C6C\u6027: {1}"},
-
- {ER_NULL_SOURCENODE_APPLYIMPORTS ,
- "sourceNode \u5728 xsl:apply-imports \u4E2D\u662F\u7A7A\u503C\uFF01"},
-
- {ER_CANNOT_ADD,
- "\u7121\u6CD5\u65B0\u589E {0} \u81F3 {1}"},
-
- { ER_NULL_SOURCENODE_HANDLEAPPLYTEMPLATES,
- "sourceNode \u5728 handleApplyTemplatesInstruction \u4E2D\u662F\u7A7A\u503C\uFF01"},
-
- { ER_NO_NAME_ATTRIB,
- "{0} \u5FC5\u9808\u6709\u540D\u7A31\u5C6C\u6027\u3002"},
-
- {ER_TEMPLATE_NOT_FOUND,
- "\u627E\u4E0D\u5230\u4E0B\u5217\u540D\u7A31\u7684\u6A23\u677F: {0}"},
-
- {ER_CANT_RESOLVE_NAME_AVT,
- "\u7121\u6CD5\u89E3\u6790 xsl:call-template \u4E2D\u7684\u540D\u7A31 AVT\u3002"},
-
- {ER_REQUIRES_ATTRIB,
- "{0} \u9700\u8981\u5C6C\u6027: {1}"},
-
- { ER_MUST_HAVE_TEST_ATTRIB,
- "{0} \u5FC5\u9808\u6709 ''test'' \u5C6C\u6027\u3002"},
-
- {ER_BAD_VAL_ON_LEVEL_ATTRIB,
- "\u932F\u8AA4\u7684\u503C\u4F4D\u65BC\u5C64\u6B21\u5C6C\u6027: {0}"},
-
- {ER_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML,
- "processing-instruction \u540D\u7A31\u4E0D\u53EF\u70BA 'xml'"},
-
- { ER_PROCESSINGINSTRUCTION_NOTVALID_NCNAME,
- "processing-instruction \u540D\u7A31\u5FC5\u9808\u662F\u6709\u6548\u7684 NCName: {0}"},
-
- { ER_NEED_MATCH_ATTRIB,
- "{0} \u82E5\u5177\u6709\u6A21\u5F0F\uFF0C\u5247\u5FC5\u9808\u6709\u914D\u5C0D\u5C6C\u6027\u3002"},
-
- { ER_NEED_NAME_OR_MATCH_ATTRIB,
- "{0} \u9700\u8981\u540D\u7A31\u6216\u914D\u5C0D\u5C6C\u6027\u3002"},
-
- {ER_CANT_RESOLVE_NSPREFIX,
- "\u7121\u6CD5\u89E3\u6790\u547D\u540D\u7A7A\u9593\u524D\u7F6E\u78BC: {0}"},
-
- { ER_ILLEGAL_VALUE,
- "xml:space \u5177\u6709\u7121\u6548\u503C: {0}"},
-
- { ER_NO_OWNERDOC,
- "\u5B50\u9805\u7BC0\u9EDE\u4E0D\u5177\u6709\u64C1\u6709\u8005\u6587\u4EF6\uFF01"},
-
- { ER_ELEMTEMPLATEELEM_ERR,
- "ElemTemplateElement \u932F\u8AA4: {0}"},
-
- { ER_NULL_CHILD,
- "\u5617\u8A66\u65B0\u589E\u7A7A\u503C\u5B50\u9805\uFF01"},
-
- { ER_NEED_SELECT_ATTRIB,
- "{0} \u9700\u8981\u9078\u53D6\u5C6C\u6027\u3002"},
-
- { ER_NEED_TEST_ATTRIB ,
- "xsl:when \u5FC5\u9808\u5177\u6709 'test' \u5C6C\u6027\u3002"},
-
- { ER_NEED_NAME_ATTRIB,
- "xsl:with-param \u5FC5\u9808\u5177\u6709 'name' \u5C6C\u6027\u3002"},
-
- { ER_NO_CONTEXT_OWNERDOC,
- "\u76F8\u95DC\u8CC7\u8A0A\u74B0\u5883\u4E0D\u5177\u6709\u64C1\u6709\u8005\u6587\u4EF6\uFF01"},
-
- {ER_COULD_NOT_CREATE_XML_PROC_LIAISON,
- "\u7121\u6CD5\u5EFA\u7ACB XML TransformerFactory Liaison: {0}"},
-
- {ER_PROCESS_NOT_SUCCESSFUL,
- "Xalan: \u8655\u7406\u4F5C\u696D\u5931\u6557\u3002"},
-
- { ER_NOT_SUCCESSFUL,
- "Xalan: \u5931\u6557\uFF01"},
-
- { ER_ENCODING_NOT_SUPPORTED,
- "\u4E0D\u652F\u63F4\u7DE8\u78BC: {0}"},
-
- {ER_COULD_NOT_CREATE_TRACELISTENER,
- "\u7121\u6CD5\u5EFA\u7ACB TraceListener: {0}"},
-
- {ER_KEY_REQUIRES_NAME_ATTRIB,
- "xsl:key \u9700\u8981 'name' \u5C6C\u6027\uFF01"},
-
- { ER_KEY_REQUIRES_MATCH_ATTRIB,
- "xsl:key \u9700\u8981 'match' \u5C6C\u6027\uFF01"},
-
- { ER_KEY_REQUIRES_USE_ATTRIB,
- "xsl:key \u9700\u8981 'use' \u5C6C\u6027\uFF01"},
-
- { ER_REQUIRES_ELEMENTS_ATTRIB,
- "(StylesheetHandler) {0} \u9700\u8981 ''elements'' \u5C6C\u6027\uFF01"},
-
- { ER_MISSING_PREFIX_ATTRIB,
- "(StylesheetHandler) \u907A\u6F0F {0} \u5C6C\u6027 ''prefix''"},
-
- { ER_BAD_STYLESHEET_URL,
- "\u6A23\u5F0F\u8868 URL \u932F\u8AA4: {0}"},
-
- { ER_FILE_NOT_FOUND,
- "\u627E\u4E0D\u5230\u6A23\u5F0F\u8868\u6A94\u6848: {0}"},
-
- { ER_IOEXCEPTION,
- "\u6A23\u5F0F\u8868\u6A94\u6848\u767C\u751F IO \u7570\u5E38\u72C0\u6CC1: {0}"},
-
- { ER_NO_HREF_ATTRIB,
- "(StylesheetHandler) \u627E\u4E0D\u5230 {0} \u7684 href \u5C6C\u6027"},
-
- { ER_STYLESHEET_INCLUDES_ITSELF,
- "(StylesheetHandler) {0} \u76F4\u63A5\u6216\u9593\u63A5\u5730\u5305\u542B\u672C\u8EAB\uFF01"},
-
- { ER_PROCESSINCLUDE_ERROR,
- "StylesheetHandler.processInclude \u932F\u8AA4\uFF0C{0}"},
-
- { ER_MISSING_LANG_ATTRIB,
- "(StylesheetHandler) \u907A\u6F0F {0} \u5C6C\u6027 ''lang''"},
-
- { ER_MISSING_CONTAINER_ELEMENT_COMPONENT,
- "(StylesheetHandler) {0} \u5143\u7D20\u7684\u4F4D\u7F6E\u932F\u8AA4\uFF1F\u907A\u6F0F\u5BB9\u5668\u5143\u7D20 ''component''"},
-
- { ER_CAN_ONLY_OUTPUT_TO_ELEMENT,
- "\u53EA\u80FD\u8F38\u51FA\u81F3 Element\u3001DocumentFragment\u3001Document \u6216 PrintWriter\u3002"},
-
- { ER_PROCESS_ERROR,
- "StylesheetRoot.process \u932F\u8AA4"},
-
- { ER_UNIMPLNODE_ERROR,
- "UnImplNode \u932F\u8AA4: {0}"},
-
- { ER_NO_SELECT_EXPRESSION,
- "\u932F\u8AA4\uFF01\u627E\u4E0D\u5230 xpath \u9078\u53D6\u8868\u793A\u5F0F (-select)\u3002"},
-
- { ER_CANNOT_SERIALIZE_XSLPROCESSOR,
- "\u7121\u6CD5\u5E8F\u5217\u5316 XSLProcessor\uFF01"},
-
- { ER_NO_INPUT_STYLESHEET,
- "\u672A\u6307\u5B9A\u6A23\u5F0F\u8868\u8F38\u5165\uFF01"},
-
- { ER_FAILED_PROCESS_STYLESHEET,
- "\u7121\u6CD5\u8655\u7406\u6A23\u5F0F\u8868\uFF01"},
-
- { ER_COULDNT_PARSE_DOC,
- "\u7121\u6CD5\u5256\u6790 {0} \u6587\u4EF6\uFF01"},
-
- { ER_COULDNT_FIND_FRAGMENT,
- "\u627E\u4E0D\u5230\u7247\u6BB5: {0}"},
-
- { ER_NODE_NOT_ELEMENT,
- "\u7247\u6BB5 ID \u6307\u5411\u7684\u7BC0\u9EDE\u4E0D\u662F\u5143\u7D20: {0}"},
-
- { ER_FOREACH_NEED_MATCH_OR_NAME_ATTRIB,
- "for-each \u5FC5\u9808\u6709\u914D\u5C0D\u6216\u540D\u7A31\u5C6C\u6027"},
-
- { ER_TEMPLATES_NEED_MATCH_OR_NAME_ATTRIB,
- "\u6A23\u677F\u5FC5\u9808\u6709\u914D\u5C0D\u6216\u540D\u7A31\u5C6C\u6027"},
-
- { ER_NO_CLONE_OF_DOCUMENT_FRAG,
- "\u6C92\u6709\u6587\u4EF6\u7247\u6BB5\u7684\u8907\u88FD\uFF01"},
-
- { ER_CANT_CREATE_ITEM,
- "\u7121\u6CD5\u5728\u7D50\u679C\u6A39\u72C0\u7D50\u69CB\u4E2D\u5EFA\u7ACB\u9805\u76EE: {0}"},
-
- { ER_XMLSPACE_ILLEGAL_VALUE,
- "\u4F86\u6E90 XML \u4E2D\u7684 xml:space \u5177\u6709\u7121\u6548\u503C: {0}"},
-
- { ER_NO_XSLKEY_DECLARATION,
- "{0} \u6C92\u6709 xsl:key \u5BA3\u544A\uFF01"},
-
- { ER_CANT_CREATE_URL,
- "\u932F\u8AA4\uFF01\u7121\u6CD5\u70BA {0} \u5EFA\u7ACB url"},
-
- { ER_XSLFUNCTIONS_UNSUPPORTED,
- "\u4E0D\u652F\u63F4 xsl:functions"},
-
- { ER_PROCESSOR_ERROR,
- "XSLT TransformerFactory \u932F\u8AA4"},
-
- { ER_NOT_ALLOWED_INSIDE_STYLESHEET,
- "(StylesheetHandler) \u6A23\u5F0F\u8868\u5167\u4E0D\u5141\u8A31 {0}\uFF01"},
-
- { ER_RESULTNS_NOT_SUPPORTED,
- "\u4E0D\u518D\u652F\u63F4 result-ns\uFF01\u8ACB\u6539\u7528 xsl:output\u3002"},
-
- { ER_DEFAULTSPACE_NOT_SUPPORTED,
- "\u4E0D\u518D\u652F\u63F4 default-space\uFF01\u8ACB\u6539\u7528 xsl:strip-space \u6216 xsl:preserve-space\u3002"},
-
- { ER_INDENTRESULT_NOT_SUPPORTED,
- "\u4E0D\u518D\u652F\u63F4 indent-result\uFF01\u8ACB\u6539\u7528 xsl:output\u3002"},
-
- { ER_ILLEGAL_ATTRIB,
- "(StylesheetHandler) {0} \u5177\u6709\u7121\u6548\u5C6C\u6027: {1}"},
-
- { ER_UNKNOWN_XSL_ELEM,
- "\u4E0D\u660E\u7684 XSL \u5143\u7D20: {0}"},
-
- { ER_BAD_XSLSORT_USE,
- "(StylesheetHandler) xsl:sort \u53EA\u80FD\u8207 xsl:apply-templates \u6216 xsl:for-each \u4E00\u8D77\u4F7F\u7528\u3002"},
-
- { ER_MISPLACED_XSLWHEN,
- "(StylesheetHandler) xsl:when \u4F4D\u7F6E\u932F\u8AA4\uFF01"},
-
- { ER_XSLWHEN_NOT_PARENTED_BY_XSLCHOOSE,
- "(StylesheetHandler) xsl:when \u7684\u7236\u9805\u4E0D\u662F xsl:choose\uFF01"},
-
- { ER_MISPLACED_XSLOTHERWISE,
- "(StylesheetHandler) xsl:otherwise \u4F4D\u7F6E\u932F\u8AA4\uFF01"},
-
- { ER_XSLOTHERWISE_NOT_PARENTED_BY_XSLCHOOSE,
- "(StylesheetHandler) xsl:otherwise \u7684\u7236\u9805\u4E0D\u662F xsl:choose\uFF01"},
-
- { ER_NOT_ALLOWED_INSIDE_TEMPLATE,
- "(StylesheetHandler) \u6A23\u677F\u5167\u4E0D\u5141\u8A31 {0}\uFF01"},
-
- { ER_UNKNOWN_EXT_NS_PREFIX,
- "(StylesheetHandler) \u4E0D\u660E\u7684 {0} \u64F4\u5145\u5957\u4EF6\u547D\u540D\u7A7A\u9593\u524D\u7F6E\u78BC {1}"},
-
- { ER_IMPORTS_AS_FIRST_ELEM,
- "(StylesheetHandler) \u532F\u5165\u53EA\u80FD\u767C\u751F\u65BC\u6A23\u5F0F\u8868\u4E2D\u7684\u7B2C\u4E00\u500B\u5143\u7D20\uFF01"},
-
- { ER_IMPORTING_ITSELF,
- "(StylesheetHandler) {0} \u76F4\u63A5\u6216\u9593\u63A5\u5730\u532F\u5165\u672C\u8EAB\uFF01"},
-
- { ER_XMLSPACE_ILLEGAL_VAL,
- "(StylesheetHandler) xml:space \u5177\u6709\u7121\u6548\u503C: {0}"},
-
- { ER_PROCESSSTYLESHEET_NOT_SUCCESSFUL,
- "processStylesheet \u5931\u6557\uFF01"},
-
- { ER_SAX_EXCEPTION,
- "SAX \u7570\u5E38\u72C0\u6CC1"},
-
-// add this message to fix bug 21478
- { ER_FUNCTION_NOT_SUPPORTED,
- "\u4E0D\u652F\u63F4\u51FD\u6578\uFF01"},
-
- { ER_XSLT_ERROR,
- "XSLT \u932F\u8AA4"},
-
- { ER_CURRENCY_SIGN_ILLEGAL,
- "\u683C\u5F0F\u6A23\u5F0F\u5B57\u4E32\u4E2D\u4E0D\u5141\u8A31\u8CA8\u5E63\u7B26\u865F"},
-
- { ER_DOCUMENT_FUNCTION_INVALID_IN_STYLESHEET_DOM,
- "Stylesheet DOM \u4E2D\u4E0D\u652F\u63F4\u6587\u4EF6\u51FD\u6578\uFF01"},
-
- { ER_CANT_RESOLVE_PREFIX_OF_NON_PREFIX_RESOLVER,
- "\u7121\u6CD5\u89E3\u6790\u975E\u524D\u7F6E\u78BC\u89E3\u6790\u5668\u7684\u524D\u7F6E\u78BC\uFF01"},
-
- { ER_REDIRECT_COULDNT_GET_FILENAME,
- "\u91CD\u5C0E\u64F4\u5145\u5957\u4EF6: \u7121\u6CD5\u53D6\u5F97\u6A94\u6848\u540D\u7A31 - \u6A94\u6848\u6216\u9078\u53D6\u5C6C\u6027\u5FC5\u9808\u50B3\u56DE\u6709\u6548\u5B57\u4E32\u3002"},
-
- { ER_CANNOT_BUILD_FORMATTERLISTENER_IN_REDIRECT,
- "\u7121\u6CD5\u5728\u91CD\u5C0E\u64F4\u5145\u5957\u4EF6\u4E2D\u5EFA\u7ACB FormatterListener\uFF01"},
-
- { ER_INVALID_PREFIX_IN_EXCLUDERESULTPREFIX,
- "exclude-result-prefixes \u4E2D\u7684\u524D\u7F6E\u78BC\u7121\u6548: {0}"},
-
- { ER_MISSING_NS_URI,
- "\u907A\u6F0F\u6307\u5B9A\u524D\u7F6E\u78BC\u7684\u547D\u540D\u7A7A\u9593 URI"},
-
- { ER_MISSING_ARG_FOR_OPTION,
- "\u907A\u6F0F\u9078\u9805\u7684\u5F15\u6578: {0}"},
-
- { ER_INVALID_OPTION,
- "\u7121\u6548\u7684\u9078\u9805: {0}"},
-
- { ER_MALFORMED_FORMAT_STRING,
- "\u683C\u5F0F\u932F\u8AA4\u7684\u683C\u5F0F\u5B57\u4E32: {0}"},
-
- { ER_STYLESHEET_REQUIRES_VERSION_ATTRIB,
- "xsl:stylesheet \u9700\u8981 'version' \u5C6C\u6027\uFF01"},
-
- { ER_ILLEGAL_ATTRIBUTE_VALUE,
- "\u5C6C\u6027: {0} \u5177\u6709\u7121\u6548\u503C: {1}"},
-
- { ER_CHOOSE_REQUIRES_WHEN,
- "xsl:choose \u9700\u8981 xsl:when"},
-
- { ER_NO_APPLY_IMPORT_IN_FOR_EACH,
- "xsl:for-each \u4E2D\u4E0D\u5141\u8A31 xsl:apply-imports"},
-
- { ER_CANT_USE_DTM_FOR_OUTPUT,
- "DTMLiaison \u7121\u6CD5\u7528\u65BC\u8F38\u51FA DOM \u7BC0\u9EDE\u3002\u8ACB\u6539\u70BA\u50B3\u9001 com.sun.org.apache.xpath.internal.DOM2Helper\uFF01"},
-
- { ER_CANT_USE_DTM_FOR_INPUT,
- "DTMLiaison \u7121\u6CD5\u7528\u65BC\u8F38\u5165 DOM \u7BC0\u9EDE\u3002\u8ACB\u6539\u70BA\u50B3\u9001 com.sun.org.apache.xpath.internal.DOM2Helper\uFF01"},
-
- { ER_CALL_TO_EXT_FAILED,
- "\u547C\u53EB\u64F4\u5145\u5957\u4EF6\u5143\u7D20\u5931\u6557: {0}"},
-
- { ER_PREFIX_MUST_RESOLVE,
- "\u524D\u7F6E\u78BC\u5FC5\u9808\u89E3\u6790\u70BA\u547D\u540D\u7A7A\u9593: {0}"},
-
- { ER_INVALID_UTF16_SURROGATE,
- "\u5075\u6E2C\u5230\u7121\u6548\u7684 UTF-16 \u4EE3\u7406: {0}\uFF1F"},
-
- { ER_XSLATTRSET_USED_ITSELF,
- "xsl:attribute-set {0} \u4F7F\u7528\u672C\u8EAB\uFF0C\u5982\u6B64\u5C07\u9020\u6210\u7121\u9650\u8FF4\u5708\u3002"},
-
- { ER_CANNOT_MIX_XERCESDOM,
- "\u7121\u6CD5\u6DF7\u5408\u975E Xerces-DOM \u8F38\u5165\u8207 Xerces-DOM \u8F38\u51FA\uFF01"},
-
- { ER_TOO_MANY_LISTENERS,
- "addTraceListenersToStylesheet - TooManyListenersException"},
-
- { ER_IN_ELEMTEMPLATEELEM_READOBJECT,
- "\u5728 ElemTemplateElement.readObject \u4E2D: {0}"},
-
- { ER_DUPLICATE_NAMED_TEMPLATE,
- "\u627E\u5230\u8D85\u904E\u4E00\u500B\u4E0B\u5217\u540D\u7A31\u7684\u6A23\u677F: {0}"},
-
- { ER_INVALID_KEY_CALL,
- "\u7121\u6548\u7684\u51FD\u6578\u547C\u53EB: \u4E0D\u5141\u8A31\u905E\u8FF4 key() \u547C\u53EB"},
-
- { ER_REFERENCING_ITSELF,
- "\u8B8A\u6578 {0} \u76F4\u63A5\u6216\u9593\u63A5\u5730\u53C3\u7167\u672C\u8EAB\uFF01"},
-
- { ER_ILLEGAL_DOMSOURCE_INPUT,
- "newTemplates \u4E4B DOMSource \u7684\u8F38\u5165\u7BC0\u9EDE\u4E0D\u53EF\u70BA\u7A7A\u503C\uFF01"},
-
- { ER_CLASS_NOT_FOUND_FOR_OPTION,
- "\u627E\u4E0D\u5230\u9078\u9805 {0} \u7684\u985E\u5225\u6A94\u6848"},
-
- { ER_REQUIRED_ELEM_NOT_FOUND,
- "\u627E\u4E0D\u5230\u9700\u8981\u7684\u5143\u7D20: {0}"},
-
- { ER_INPUT_CANNOT_BE_NULL,
- "InputStream \u4E0D\u53EF\u70BA\u7A7A\u503C"},
-
- { ER_URI_CANNOT_BE_NULL,
- "URI \u4E0D\u53EF\u70BA\u7A7A\u503C"},
-
- { ER_FILE_CANNOT_BE_NULL,
- "File \u4E0D\u53EF\u70BA\u7A7A\u503C"},
-
- { ER_SOURCE_CANNOT_BE_NULL,
- "InputSource \u4E0D\u53EF\u70BA\u7A7A\u503C"},
-
- { ER_CANNOT_INIT_BSFMGR,
- "\u7121\u6CD5\u8D77\u59CB BSF \u7BA1\u7406\u7A0B\u5F0F"},
-
- { ER_CANNOT_CMPL_EXTENSN,
- "\u7121\u6CD5\u7DE8\u8B6F\u64F4\u5145\u5957\u4EF6"},
-
- { ER_CANNOT_CREATE_EXTENSN,
- "\u7121\u6CD5\u5EFA\u7ACB\u64F4\u5145\u5957\u4EF6: {0}\uFF0C\u56E0\u70BA: {1}"},
-
- { ER_INSTANCE_MTHD_CALL_REQUIRES,
- "\u57F7\u884C\u8655\u7406\u65B9\u6CD5\u547C\u53EB\u65B9\u6CD5 {0} \u6642\uFF0C\u9700\u8981 Object \u57F7\u884C\u8655\u7406\u4F5C\u70BA\u7B2C\u4E00\u500B\u5F15\u6578"},
-
- { ER_INVALID_ELEMENT_NAME,
- "\u6307\u5B9A\u4E86\u7121\u6548\u7684\u5143\u7D20\u540D\u7A31 {0}"},
-
- { ER_ELEMENT_NAME_METHOD_STATIC,
- "\u5143\u7D20\u540D\u7A31\u65B9\u6CD5\u5FC5\u9808\u662F\u975C\u614B {0}"},
-
- { ER_EXTENSION_FUNC_UNKNOWN,
- "\u64F4\u5145\u5957\u4EF6\u51FD\u6578 {0} : {1} \u4E0D\u660E"},
-
- { ER_MORE_MATCH_CONSTRUCTOR,
- "{0} \u7684\u5EFA\u69CB\u5B50\u6709\u8D85\u904E\u4E00\u500B\u4EE5\u4E0A\u7684\u6700\u4F73\u914D\u5C0D"},
-
- { ER_MORE_MATCH_METHOD,
- "\u65B9\u6CD5 {0} \u6709\u8D85\u904E\u4E00\u500B\u4EE5\u4E0A\u7684\u6700\u4F73\u914D\u5C0D"},
-
- { ER_MORE_MATCH_ELEMENT,
- "\u5143\u7D20\u65B9\u6CD5 {0} \u6709\u8D85\u904E\u4E00\u500B\u4EE5\u4E0A\u7684\u6700\u4F73\u914D\u5C0D"},
-
- { ER_INVALID_CONTEXT_PASSED,
- "\u50B3\u9001\u4E86\u7121\u6548\u7684\u76F8\u95DC\u8CC7\u8A0A\u74B0\u5883\u4F86\u8A55\u4F30 {0}"},
-
- { ER_POOL_EXISTS,
- "\u96C6\u5340\u5DF2\u7D93\u5B58\u5728"},
-
- { ER_NO_DRIVER_NAME,
- "\u672A\u6307\u5B9A\u9A45\u52D5\u7A0B\u5F0F\u540D\u7A31"},
-
- { ER_NO_URL,
- "\u672A\u6307\u5B9A URL"},
-
- { ER_POOL_SIZE_LESSTHAN_ONE,
- "\u96C6\u5340\u5927\u5C0F\u5C0F\u65BC\u4E00\uFF01"},
-
- { ER_INVALID_DRIVER,
- "\u6307\u5B9A\u4E86\u7121\u6548\u7684\u9A45\u52D5\u7A0B\u5F0F\u540D\u7A31\uFF01"},
-
- { ER_NO_STYLESHEETROOT,
- "\u627E\u4E0D\u5230\u6A23\u5F0F\u8868\u6839\uFF01"},
-
- { ER_ILLEGAL_XMLSPACE_VALUE,
- "xml:space \u7684\u503C\u7121\u6548"},
-
- { ER_PROCESSFROMNODE_FAILED,
- "processFromNode \u5931\u6557"},
-
- { ER_RESOURCE_COULD_NOT_LOAD,
- "\u7121\u6CD5\u8F09\u5165\u8CC7\u6E90 [ {0} ]: {1} \n {2} \t {3}"},
-
- { ER_BUFFER_SIZE_LESSTHAN_ZERO,
- "\u7DE9\u885D\u5340\u5927\u5C0F <=0"},
-
- { ER_UNKNOWN_ERROR_CALLING_EXTENSION,
- "\u547C\u53EB\u64F4\u5145\u5957\u4EF6\u6642\uFF0C\u767C\u751F\u4E0D\u660E\u7684\u932F\u8AA4"},
-
- { ER_NO_NAMESPACE_DECL,
- "\u524D\u7F6E\u78BC {0} \u6C92\u6709\u5C0D\u61C9\u7684\u547D\u540D\u7A7A\u9593\u5BA3\u544A"},
-
- { ER_ELEM_CONTENT_NOT_ALLOWED,
- "\u5143\u7D20\u5167\u5BB9\u4E0D\u5141\u8A31 lang=javaclass {0}"},
-
- { ER_STYLESHEET_DIRECTED_TERMINATION,
- "\u6A23\u5F0F\u8868\u5C0E\u5411\u7684\u7D42\u6B62"},
-
- { ER_ONE_OR_TWO,
- "1 \u6216 2"},
-
- { ER_TWO_OR_THREE,
- "2 \u6216 3"},
-
- { ER_COULD_NOT_LOAD_RESOURCE,
- "\u7121\u6CD5\u8F09\u5165 {0} (\u6AA2\u67E5 CLASSPATH)\uFF0C\u76EE\u524D\u53EA\u4F7F\u7528\u9810\u8A2D\u503C"},
-
- { ER_CANNOT_INIT_DEFAULT_TEMPLATES,
- "\u7121\u6CD5\u8D77\u59CB\u9810\u8A2D\u6A23\u677F"},
-
- { ER_RESULT_NULL,
- "\u7D50\u679C\u4E0D\u61C9\u70BA\u7A7A\u503C"},
-
- { ER_RESULT_COULD_NOT_BE_SET,
- "\u7121\u6CD5\u8A2D\u5B9A\u7D50\u679C"},
-
- { ER_NO_OUTPUT_SPECIFIED,
- "\u672A\u6307\u5B9A\u8F38\u51FA"},
-
- { ER_CANNOT_TRANSFORM_TO_RESULT_TYPE,
- "\u7121\u6CD5\u8F49\u63DB\u70BA\u985E\u578B {0} \u7684\u7D50\u679C"},
-
- { ER_CANNOT_TRANSFORM_SOURCE_TYPE,
- "\u7121\u6CD5\u8F49\u63DB\u985E\u578B {0} \u7684\u4F86\u6E90"},
-
- { ER_NULL_CONTENT_HANDLER,
- "\u7A7A\u503C\u5167\u5BB9\u8655\u7406\u7A0B\u5F0F"},
-
- { ER_NULL_ERROR_HANDLER,
- "\u7A7A\u503C\u932F\u8AA4\u8655\u7406\u7A0B\u5F0F"},
-
- { ER_CANNOT_CALL_PARSE,
- "\u82E5\u672A\u8A2D\u5B9A ContentHandler\uFF0C\u5247\u7121\u6CD5\u547C\u53EB\u5256\u6790"},
-
- { ER_NO_PARENT_FOR_FILTER,
- "\u7BE9\u9078\u6C92\u6709\u7236\u9805"},
-
- { ER_NO_STYLESHEET_IN_MEDIA,
- "\u5728 {0} \u4E2D\u627E\u4E0D\u5230\u6A23\u5F0F\u8868\uFF0C\u5A92\u9AD4 = {1}"},
-
- { ER_NO_STYLESHEET_PI,
- "\u5728 {0} \u4E2D\u627E\u4E0D\u5230 xml-stylesheet PI"},
-
- { ER_NOT_SUPPORTED,
- "\u4E0D\u652F\u63F4: {0}"},
-
- { ER_PROPERTY_VALUE_BOOLEAN,
- "\u5C6C\u6027 {0} \u7684\u503C\u61C9\u70BA\u5E03\u6797\u57F7\u884C\u8655\u7406"},
-
- { ER_COULD_NOT_FIND_EXTERN_SCRIPT,
- "\u7121\u6CD5\u5728 {0} \u53D6\u5F97\u5916\u90E8\u547D\u4EE4\u6A94"},
-
- { ER_RESOURCE_COULD_NOT_FIND,
- "\u627E\u4E0D\u5230\u8CC7\u6E90 [ {0} ]\u3002\n{1}"},
-
- { ER_OUTPUT_PROPERTY_NOT_RECOGNIZED,
- "\u7121\u6CD5\u8FA8\u8B58\u7684\u8F38\u51FA\u5C6C\u6027: {0}"},
-
- { ER_FAILED_CREATING_ELEMLITRSLT,
- "\u7121\u6CD5\u5EFA\u7ACB ElemLiteralResult \u57F7\u884C\u8655\u7406"},
-
- //Earlier (JDK 1.4 XALAN 2.2-D11) at key code '204' the key name was ER_PRIORITY_NOT_PARSABLE
- // In latest Xalan code base key name is ER_VALUE_SHOULD_BE_NUMBER. This should also be taken care
- //in locale specific files like XSLTErrorResources_de.java, XSLTErrorResources_fr.java etc.
- //NOTE: Not only the key name but message has also been changed.
- { ER_VALUE_SHOULD_BE_NUMBER,
- "{0} \u7684\u503C\u61C9\u5305\u542B\u53EF\u5256\u6790\u7684\u6578\u5B57"},
-
- { ER_VALUE_SHOULD_EQUAL,
- "{0} \u7684\u503C\u61C9\u7B49\u65BC yes \u6216 no"},
-
- { ER_FAILED_CALLING_METHOD,
- "\u7121\u6CD5\u547C\u53EB {0} \u65B9\u6CD5"},
-
- { ER_FAILED_CREATING_ELEMTMPL,
- "\u7121\u6CD5\u5EFA\u7ACB ElemTemplateElement \u57F7\u884C\u8655\u7406"},
-
- { ER_CHARS_NOT_ALLOWED,
- "\u6587\u4EF6\u6B64\u8655\u4E0D\u5141\u8A31\u5B57\u5143"},
-
- { ER_ATTR_NOT_ALLOWED,
- "{1} \u5143\u7D20\u4E0D\u5141\u8A31 \"{0}\" \u5C6C\u6027\uFF01"},
-
- { ER_BAD_VALUE,
- "{0} \u7121\u6548\u503C {1} "},
-
- { ER_ATTRIB_VALUE_NOT_FOUND,
- "\u627E\u4E0D\u5230 {0} \u5C6C\u6027\u503C"},
-
- { ER_ATTRIB_VALUE_NOT_RECOGNIZED,
- "{0} \u5C6C\u6027\u503C\u7121\u6CD5\u8FA8\u8B58 "},
-
- { ER_NULL_URI_NAMESPACE,
- "\u5617\u8A66\u4EE5\u7A7A\u503C URI \u7522\u751F\u547D\u540D\u7A7A\u9593\u524D\u7F6E\u78BC"},
-
- { ER_NUMBER_TOO_BIG,
- "\u5617\u8A66\u683C\u5F0F\u5316\u5927\u65BC\u6700\u5927\u9577\u6574\u6578\u7684\u6578\u5B57"},
-
- { ER_CANNOT_FIND_SAX1_DRIVER,
- "\u627E\u4E0D\u5230 SAX1 \u9A45\u52D5\u7A0B\u5F0F\u985E\u5225 {0}"},
-
- { ER_SAX1_DRIVER_NOT_LOADED,
- "\u627E\u5230 SAX1 \u9A45\u52D5\u7A0B\u5F0F\u985E\u5225 {0}\uFF0C\u4F46\u7121\u6CD5\u8F09\u5165"},
-
- { ER_SAX1_DRIVER_NOT_INSTANTIATED,
- "\u5DF2\u8F09\u5165 SAX1 \u9A45\u52D5\u7A0B\u5F0F\u985E\u5225 {0}\uFF0C\u4F46\u7121\u6CD5\u5EFA\u7ACB"},
-
- { ER_SAX1_DRIVER_NOT_IMPLEMENT_PARSER,
- "SAX1 \u9A45\u52D5\u7A0B\u5F0F\u985E\u5225 {0} \u672A\u5BE6\u884C org.xml.sax.Parser"},
-
- { ER_PARSER_PROPERTY_NOT_SPECIFIED,
- "\u672A\u6307\u5B9A\u7CFB\u7D71\u5C6C\u6027 org.xml.sax.parser"},
-
- { ER_PARSER_ARG_CANNOT_BE_NULL,
- "\u5256\u6790\u5668\u5F15\u6578\u4E0D\u53EF\u70BA\u7A7A\u503C"},
-
- { ER_FEATURE,
- "\u529F\u80FD: {0}"},
-
- { ER_PROPERTY,
- "\u5C6C\u6027: {0}"},
-
- { ER_NULL_ENTITY_RESOLVER,
- "\u7A7A\u503C\u500B\u9AD4\u89E3\u6790\u5668"},
-
- { ER_NULL_DTD_HANDLER,
- "\u7A7A\u503C DTD \u8655\u7406\u7A0B\u5F0F"},
-
- { ER_NO_DRIVER_NAME_SPECIFIED,
- "\u672A\u6307\u5B9A\u9A45\u52D5\u7A0B\u5F0F\u540D\u7A31\uFF01"},
-
- { ER_NO_URL_SPECIFIED,
- "\u672A\u6307\u5B9A URL\uFF01"},
-
- { ER_POOLSIZE_LESS_THAN_ONE,
- "\u96C6\u5340\u5927\u5C0F\u5C0F\u65BC 1\uFF01"},
-
- { ER_INVALID_DRIVER_NAME,
- "\u6307\u5B9A\u4E86\u7121\u6548\u7684\u9A45\u52D5\u7A0B\u5F0F\u540D\u7A31\uFF01"},
-
- { ER_ERRORLISTENER,
- "ErrorListener"},
-
-
-// Note to translators: The following message should not normally be displayed
-// to users. It describes a situation in which the processor has detected
-// an internal consistency problem in itself, and it provides this message
-// for the developer to help diagnose the problem. The name
-// 'ElemTemplateElement' is the name of a class, and should not be
-// translated.
- { ER_ASSERT_NO_TEMPLATE_PARENT,
- "\u7A0B\u5F0F\u8A2D\u8A08\u4EBA\u54E1\u7684\u932F\u8AA4\uFF01\u8868\u793A\u5F0F\u6C92\u6709 ElemTemplateElement \u7236\u9805\uFF01"},
-
-
-// Note to translators: The following message should not normally be displayed
-// to users. It describes a situation in which the processor has detected
-// an internal consistency problem in itself, and it provides this message
-// for the developer to help diagnose the problem. The substitution text
-// provides further information in order to diagnose the problem. The name
-// 'RedundentExprEliminator' is the name of a class, and should not be
-// translated.
- { ER_ASSERT_REDUNDENT_EXPR_ELIMINATOR,
- "\u7A0B\u5F0F\u8A2D\u8A08\u4EBA\u54E1\u5728 RedundentExprEliminator \u4E2D\u7684\u5BA3\u544A: {0}"},
-
- { ER_NOT_ALLOWED_IN_POSITION,
- "\u6A23\u5F0F\u8868\u6B64\u4F4D\u7F6E\u4E0D\u5141\u8A31 {0}\uFF01"},
-
- { ER_NONWHITESPACE_NOT_ALLOWED_IN_POSITION,
- "\u6A23\u5F0F\u8868\u6B64\u4F4D\u7F6E\u4E0D\u5141\u8A31\u975E\u7A7A\u683C\u6587\u5B57\uFF01"},
-
- // This code is shared with warning codes.
- // SystemId Unknown
- { INVALID_TCHAR,
- "\u7121\u6548\u503C: {1} \u7528\u65BC CHAR \u5C6C\u6027: {0}\u3002\u985E\u578B CHAR \u7684\u5C6C\u6027\u5FC5\u9808\u50C5\u70BA 1 \u500B\u5B57\u5143\uFF01"},
-
- // Note to translators: The following message is used if the value of
- // an attribute in a stylesheet is invalid. "QNAME" is the XML data-type of
- // the attribute, and should not be translated. The substitution text {1} is
- // the attribute value and {0} is the attribute name.
- //The following codes are shared with the warning codes...
- { INVALID_QNAME,
- "\u7121\u6548\u503C: {1} \u7528\u65BC QNAME \u5C6C\u6027: {0}"},
-
- // Note to translators: The following message is used if the value of
- // an attribute in a stylesheet is invalid. "ENUM" is the XML data-type of
- // the attribute, and should not be translated. The substitution text {1} is
- // the attribute value, {0} is the attribute name, and {2} is a list of valid
- // values.
- { INVALID_ENUM,
- "\u7121\u6548\u503C: {1} \u7528\u65BC ENUM \u5C6C\u6027: {0}\u3002\u6709\u6548\u503C\u70BA: {2}\u3002"},
-
-// Note to translators: The following message is used if the value of
-// an attribute in a stylesheet is invalid. "NMTOKEN" is the XML data-type
-// of the attribute, and should not be translated. The substitution text {1} is
-// the attribute value and {0} is the attribute name.
- { INVALID_NMTOKEN,
- "\u7121\u6548\u503C: {1} \u7528\u65BC NMTOKEN \u5C6C\u6027: {0}"},
-
-// Note to translators: The following message is used if the value of
-// an attribute in a stylesheet is invalid. "NCNAME" is the XML data-type
-// of the attribute, and should not be translated. The substitution text {1} is
-// the attribute value and {0} is the attribute name.
- { INVALID_NCNAME,
- "\u7121\u6548\u503C: {1} \u7528\u65BC NCNAME \u5C6C\u6027: {0}"},
-
-// Note to translators: The following message is used if the value of
-// an attribute in a stylesheet is invalid. "boolean" is the XSLT data-type
-// of the attribute, and should not be translated. The substitution text {1} is
-// the attribute value and {0} is the attribute name.
- { INVALID_BOOLEAN,
- "\u7121\u6548\u503C: {1} \u7528\u65BC\u5E03\u6797\u5C6C\u6027: {0}"},
-
-// Note to translators: The following message is used if the value of
-// an attribute in a stylesheet is invalid. "number" is the XSLT data-type
-// of the attribute, and should not be translated. The substitution text {1} is
-// the attribute value and {0} is the attribute name.
- { INVALID_NUMBER,
- "\u7121\u6548\u503C: {1} \u7528\u65BC\u6578\u5B57\u5C6C\u6027: {0}"},
-
-
- // End of shared codes...
-
-// Note to translators: A "match pattern" is a special form of XPath expression
-// that is used for matching patterns. The substitution text is the name of
-// a function. The message indicates that when this function is referenced in
-// a match pattern, its argument must be a string literal (or constant.)
-// ER_ARG_LITERAL - new error message for bugzilla //5202
- { ER_ARG_LITERAL,
- "\u914D\u5C0D\u6A23\u5F0F\u4E2D {0} \u7684\u5F15\u6578\u5FC5\u9808\u662F\u6587\u5B57\u3002"},
-
-// Note to translators: The following message indicates that two definitions of
-// a variable. A "global variable" is a variable that is accessible everywher
-// in the stylesheet.
-// ER_DUPLICATE_GLOBAL_VAR - new error message for bugzilla #790
- { ER_DUPLICATE_GLOBAL_VAR,
- "\u91CD\u8907\u7684\u5168\u57DF\u8B8A\u6578\u5BA3\u544A\u3002"},
-
-
-// Note to translators: The following message indicates that two definitions of
-// a variable were encountered.
-// ER_DUPLICATE_VAR - new error message for bugzilla #790
- { ER_DUPLICATE_VAR,
- "\u91CD\u8907\u7684\u8B8A\u6578\u5BA3\u544A\u3002"},
-
- // Note to translators: "xsl:template, "name" and "match" are XSLT keywords
- // which must not be translated.
- // ER_TEMPLATE_NAME_MATCH - new error message for bugzilla #789
- { ER_TEMPLATE_NAME_MATCH,
- "xsl:template \u5FC5\u9808\u6709\u540D\u7A31\u6216\u914D\u5C0D\u5C6C\u6027 (\u6216\u5177\u6709\u5169\u8005)"},
-
- // Note to translators: "exclude-result-prefixes" is an XSLT keyword which
- // should not be translated. The message indicates that a namespace prefix
- // encountered as part of the value of the exclude-result-prefixes attribute
- // was in error.
- // ER_INVALID_PREFIX - new error message for bugzilla #788
- { ER_INVALID_PREFIX,
- "exclude-result-prefixes \u4E2D\u7684\u524D\u7F6E\u78BC\u7121\u6548: {0}"},
-
- // Note to translators: An "attribute set" is a set of attributes that can
- // be added to an element in the output document as a group. The message
- // indicates that there was a reference to an attribute set named {0} that
- // was never defined.
- // ER_NO_ATTRIB_SET - new error message for bugzilla #782
- { ER_NO_ATTRIB_SET,
- "\u4E0D\u5B58\u5728\u540D\u7A31\u70BA {0} \u7684 attribute-set"},
-
- // Note to translators: This message indicates that there was a reference
- // to a function named {0} for which no function definition could be found.
- { ER_FUNCTION_NOT_FOUND,
- "\u4E0D\u5B58\u5728\u540D\u7A31\u70BA {0} \u7684\u51FD\u6578"},
-
- // Note to translators: This message indicates that the XSLT instruction
- // that is named by the substitution text {0} must not contain other XSLT
- // instructions (content) or a "select" attribute. The word "select" is
- // an XSLT keyword in this case and must not be translated.
- { ER_CANT_HAVE_CONTENT_AND_SELECT,
- "{0} \u5143\u7D20\u4E0D\u53EF\u540C\u6642\u5177\u6709\u5167\u5BB9\u8207\u9078\u53D6\u5C6C\u6027\u3002"},
-
- // Note to translators: This message indicates that the value argument
- // of setParameter must be a valid Java Object.
- { ER_INVALID_SET_PARAM_VALUE,
- "\u53C3\u6578 {0} \u7684\u503C\u5FC5\u9808\u662F\u6709\u6548\u7684 Java \u7269\u4EF6"},
-
- { ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX_FOR_DEFAULT,
- "xsl:namespace-alias \u5143\u7D20\u7684 result-prefix \u5C6C\u6027\u5177\u6709\u503C '#default'\uFF0C\u4F46\u662F\u5143\u7D20\u7BC4\u570D\u4E2D\u6C92\u6709\u9810\u8A2D\u547D\u540D\u7A7A\u9593\u7684\u5BA3\u544A"},
-
- { ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX,
- "xsl:namespace-alias \u5143\u7D20\u7684 result-prefix \u5C6C\u6027\u5177\u6709\u503C ''{0}''\uFF0C\u4F46\u662F\u5143\u7D20\u7BC4\u570D\u4E2D\u6C92\u6709\u524D\u7F6E\u78BC ''{0}'' \u7684\u547D\u540D\u7A7A\u9593\u5BA3\u544A\u3002"},
-
- { ER_SET_FEATURE_NULL_NAME,
- "TransformerFactory.setFeature(\u5B57\u4E32\u540D\u7A31, \u5E03\u6797\u503C) \u4E2D\u7684\u529F\u80FD\u540D\u7A31\u4E0D\u53EF\u70BA\u7A7A\u503C\u3002"},
-
- { ER_GET_FEATURE_NULL_NAME,
- "TransformerFactory.getFeature(\u5B57\u4E32\u540D\u7A31) \u4E2D\u7684\u529F\u80FD\u540D\u7A31\u4E0D\u53EF\u70BA\u7A7A\u503C\u3002"},
-
- { ER_UNSUPPORTED_FEATURE,
- "\u7121\u6CD5\u5728\u6B64 TransformerFactory \u4E0A\u8A2D\u5B9A\u529F\u80FD ''{0}''\u3002"},
-
- { ER_EXTENSION_ELEMENT_NOT_ALLOWED_IN_SECURE_PROCESSING,
- "\u7576\u5B89\u5168\u8655\u7406\u529F\u80FD\u8A2D\u70BA\u771F\u6642\uFF0C\u4E0D\u5141\u8A31\u4F7F\u7528\u64F4\u5145\u5957\u4EF6\u5143\u7D20 ''{0}''\u3002"},
-
- { ER_NAMESPACE_CONTEXT_NULL_NAMESPACE,
- "\u7121\u6CD5\u53D6\u5F97\u7A7A\u503C\u547D\u540D\u7A7A\u9593 uri \u7684\u524D\u7F6E\u78BC\u3002"},
-
- { ER_NAMESPACE_CONTEXT_NULL_PREFIX,
- "\u7121\u6CD5\u53D6\u5F97\u7A7A\u503C\u524D\u7F6E\u78BC\u7684\u547D\u540D\u7A7A\u9593 uri\u3002"},
-
- { ER_XPATH_RESOLVER_NULL_QNAME,
- "\u51FD\u6578\u540D\u7A31\u4E0D\u53EF\u70BA\u7A7A\u503C\u3002"},
-
- { ER_XPATH_RESOLVER_NEGATIVE_ARITY,
- "Arity \u4E0D\u53EF\u70BA\u8CA0\u503C\u3002"},
- // Warnings...
-
- { WG_FOUND_CURLYBRACE,
- "\u627E\u5230 '}'\uFF0C\u4F46\u6C92\u6709\u958B\u555F\u7684\u5C6C\u6027\u6A23\u677F\uFF01"},
-
- { WG_COUNT_ATTRIB_MATCHES_NO_ANCESTOR,
- "\u8B66\u544A: \u8A08\u6578\u5C6C\u6027\u4E0D\u7B26\u5408 xsl:number \u4E2D\u7684\u7956\u7CFB\uFF01\u76EE\u6A19 = {0}"},
-
- { WG_EXPR_ATTRIB_CHANGED_TO_SELECT,
- "\u820A\u8A9E\u6CD5: 'expr' \u5C6C\u6027\u7684\u540D\u7A31\u5DF2\u8B8A\u66F4\u70BA 'select'\u3002"},
-
- { WG_NO_LOCALE_IN_FORMATNUMBER,
- "Xalan \u5C1A\u672A\u8655\u7406 format-number \u51FD\u6578\u4E2D\u7684\u5730\u5340\u8A2D\u5B9A\u540D\u7A31\u3002"},
-
- { WG_LOCALE_NOT_FOUND,
- "\u8B66\u544A: \u627E\u4E0D\u5230 xml:lang={0} \u7684\u5730\u5340\u8A2D\u5B9A"},
-
- { WG_CANNOT_MAKE_URL_FROM,
- "\u7121\u6CD5\u5F9E {0} \u5EFA\u7ACB URL"},
-
- { WG_CANNOT_LOAD_REQUESTED_DOC,
- "\u7121\u6CD5\u8F09\u5165\u8981\u6C42\u7684\u6587\u4EF6: {0}"},
-
- { WG_CANNOT_FIND_COLLATOR,
- "\u627E\u4E0D\u5230 <sort xml:lang={0} \u7684 Collator"},
-
- { WG_FUNCTIONS_SHOULD_USE_URL,
- "\u820A\u8A9E\u6CD5: \u51FD\u6578\u6307\u793A\u61C9\u4F7F\u7528 {0} \u7684 url"},
-
- { WG_ENCODING_NOT_SUPPORTED_USING_UTF8,
- "\u4E0D\u652F\u63F4\u7DE8\u78BC: {0}\uFF0C\u4F7F\u7528 UTF-8"},
-
- { WG_ENCODING_NOT_SUPPORTED_USING_JAVA,
- "\u4E0D\u652F\u63F4\u7DE8\u78BC: {0}\uFF0C\u4F7F\u7528 Java {1}"},
-
- { WG_SPECIFICITY_CONFLICTS,
- "\u767C\u73FE\u6307\u5B9A\u885D\u7A81: {0} \u5C07\u4F7F\u7528\u6A23\u5F0F\u8868\u4E2D\u6700\u5F8C\u627E\u5230\u7684\u9805\u76EE\u3002"},
-
- { WG_PARSING_AND_PREPARING,
- "========= \u5256\u6790\u8207\u6E96\u5099 {0} =========="},
-
- { WG_ATTR_TEMPLATE,
- "\u5C6C\u6027\u6A23\u677F\uFF0C{0}"},
-
- { WG_CONFLICT_BETWEEN_XSLSTRIPSPACE_AND_XSLPRESERVESPACE,
- "xsl:strip-space \u8207 xsl:preserve-space \u4E4B\u9593\u914D\u5C0D\u885D\u7A81"},
-
- { WG_ATTRIB_NOT_HANDLED,
- "Xalan \u5C1A\u672A\u8655\u7406 {0} \u5C6C\u6027\uFF01"},
-
- { WG_NO_DECIMALFORMAT_DECLARATION,
- "\u627E\u4E0D\u5230\u5341\u9032\u4F4D\u683C\u5F0F\u7684\u5BA3\u544A: {0}"},
-
- { WG_OLD_XSLT_NS,
- "\u907A\u6F0F\u6216\u4E0D\u6B63\u78BA\u7684 XSLT \u547D\u540D\u7A7A\u9593\u3002"},
-
- { WG_ONE_DEFAULT_XSLDECIMALFORMAT_ALLOWED,
- "\u53EA\u5141\u8A31\u4E00\u500B\u9810\u8A2D\u7684 xsl:decimal-format \u5BA3\u544A\u3002"},
-
- { WG_XSLDECIMALFORMAT_NAMES_MUST_BE_UNIQUE,
- "xsl:decimal-format \u540D\u7A31\u5FC5\u9808\u662F\u552F\u4E00\u7684\u540D\u7A31\u3002\u540D\u7A31 \"{0}\" \u91CD\u8907\u3002"},
-
- { WG_ILLEGAL_ATTRIBUTE,
- "{0} \u5177\u6709\u7121\u6548\u5C6C\u6027: {1}"},
-
- { WG_COULD_NOT_RESOLVE_PREFIX,
- "\u7121\u6CD5\u89E3\u6790\u547D\u540D\u7A7A\u9593\u524D\u7F6E\u78BC: {0}\u3002\u5C07\u5FFD\u7565\u6B64\u7BC0\u9EDE\u3002"},
-
- { WG_STYLESHEET_REQUIRES_VERSION_ATTRIB,
- "xsl:stylesheet \u9700\u8981 'version' \u5C6C\u6027\uFF01"},
-
- { WG_ILLEGAL_ATTRIBUTE_NAME,
- "\u7121\u6548\u7684\u5C6C\u6027\u540D\u7A31: {0}"},
-
- { WG_ILLEGAL_ATTRIBUTE_VALUE,
- "\u7528\u65BC\u5C6C\u6027 {0} \u7684\u7121\u6548\u503C: {1}"},
-
- { WG_EMPTY_SECOND_ARG,
- "\u6587\u4EF6\u51FD\u6578\u7B2C\u4E8C\u500B\u5F15\u6578\u7522\u751F\u7684\u7BC0\u9EDE\u96C6\u70BA\u7A7A\u767D\u3002\u50B3\u56DE\u7A7A\u767D\u7684 node-set\u3002"},
-
- //Following are the new WARNING keys added in XALAN code base after Jdk 1.4 (Xalan 2.2-D11)
-
- // Note to translators: "name" and "xsl:processing-instruction" are keywords
- // and must not be translated.
- { WG_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML,
- "xsl:processing-instruction \u540D\u7A31\u7684 'name' \u5C6C\u6027\u503C\u4E0D\u53EF\u70BA 'xml'"},
-
- // Note to translators: "name" and "xsl:processing-instruction" are keywords
- // and must not be translated. "NCName" is an XML data-type and must not be
- // translated.
- { WG_PROCESSINGINSTRUCTION_NOTVALID_NCNAME,
- "xsl:processing-instruction \u7684 ''name'' \u5C6C\u6027\u503C\u5FC5\u9808\u662F\u6709\u6548\u7684 NCName: {0}"},
-
- // Note to translators: This message is reported if the stylesheet that is
- // being processed attempted to construct an XML document with an attribute in a
- // place other than on an element. The substitution text specifies the name of
- // the attribute.
- { WG_ILLEGAL_ATTRIBUTE_POSITION,
- "\u5728\u7522\u751F\u5B50\u9805\u7BC0\u9EDE\u4E4B\u5F8C\uFF0C\u6216\u5728\u7522\u751F\u5143\u7D20\u4E4B\u524D\uFF0C\u4E0D\u53EF\u65B0\u589E\u5C6C\u6027 {0}\u3002\u5C6C\u6027\u6703\u88AB\u5FFD\u7565\u3002"},
-
- { NO_MODIFICATION_ALLOWED_ERR,
- "\u5617\u8A66\u4FEE\u6539\u4E0D\u5141\u8A31\u4FEE\u6539\u7684\u7269\u4EF6\u3002"
- },
-
- //Check: WHY THERE IS A GAP B/W NUMBERS in the XSLTErrorResources properties file?
-
- // Other miscellaneous text used inside the code...
- { "ui_language", "tw"},
- { "help_language", "tw" },
- { "language", "tw" },
- { "BAD_CODE", "createMessage \u7684\u53C3\u6578\u8D85\u51FA\u7BC4\u570D"},
- { "FORMAT_FAILED", "messageFormat \u547C\u53EB\u671F\u9593\u767C\u751F\u7570\u5E38\u72C0\u6CC1"},
- { "version", ">>>>>>> Xalan \u7248\u672C "},
- { "version2", "<<<<<<<"},
- { "yes", "\u662F"},
- { "line", "\u884C\u865F"},
- { "column","\u8CC7\u6599\u6B04\u7DE8\u865F"},
- { "xsldone", "XSLProcessor: \u5B8C\u6210"},
-
-
- // Note to translators: The following messages provide usage information
- // for the Xalan Process command line. "Process" is the name of a Java class,
- // and should not be translated.
- { "xslProc_option", "Xalan-J \u547D\u4EE4\u884C\u8655\u7406\u4F5C\u696D\u985E\u5225\u9078\u9805:"},
- { "xslProc_option", "Xalan-J \u547D\u4EE4\u884C\u8655\u7406\u4F5C\u696D\u985E\u5225\u9078\u9805:"},
- { "xslProc_invalid_xsltc_option", "XSLTC \u6A21\u5F0F\u4E2D\u4E0D\u652F\u63F4\u9078\u9805 {0}\u3002"},
- { "xslProc_invalid_xalan_option", "\u9078\u9805 {0} \u53EA\u80FD\u8207 -XSLTC \u4E00\u8D77\u4F7F\u7528\u3002"},
- { "xslProc_no_input", "\u932F\u8AA4: \u672A\u6307\u5B9A\u6A23\u5F0F\u8868\u6216\u8F38\u5165 xml\u3002\u4E0D\u4F7F\u7528\u4EFB\u4F55\u9078\u9805\u4F86\u57F7\u884C\u6B64\u547D\u4EE4\uFF0C\u53EF\u53D6\u5F97\u7528\u6CD5\u6307\u793A\u3002"},
- { "xslProc_common_options", "-\u4E00\u822C\u9078\u9805-"},
- { "xslProc_xalan_options", "-Xalan \u7684\u9078\u9805-"},
- { "xslProc_xsltc_options", "-XSLTC \u7684\u9078\u9805-"},
- { "xslProc_return_to_continue", "(\u6309 <return> \u4EE5\u7E7C\u7E8C)"},
-
- // Note to translators: The option name and the parameter name do not need to
- // be translated. Only translate the messages in parentheses. Note also that
- // leading whitespace in the messages is used to indent the usage information
- // for each option in the English messages.
- // Do not translate the keywords: XSLTC, SAX, DOM and DTM.
- { "optionXSLTC", " [-XSLTC (\u4F7F\u7528 XSLTC \u9032\u884C\u8F49\u63DB)]"},
- { "optionIN", " [-IN inputXMLURL]"},
- { "optionXSL", " [-XSL XSLTransformationURL]"},
- { "optionOUT", " [-OUT outputFileName]"},
- { "optionLXCIN", " [-LXCIN compiledStylesheetFileNameIn]"},
- { "optionLXCOUT", " [-LXCOUT compiledStylesheetFileNameOutOut]"},
- { "optionPARSER", " [-PARSER \u5256\u6790\u5668\u806F\u7D61\u7684\u5B8C\u6574\u985E\u5225\u540D\u7A31]"},
- { "optionE", " [-E (\u52FF\u5C55\u958B\u500B\u9AD4\u53C3\u7167)]"},
- { "optionV", " [-E (\u52FF\u5C55\u958B\u500B\u9AD4\u53C3\u7167)]"},
- { "optionQC", " [-QC (\u975C\u97F3\u6A23\u5F0F\u885D\u7A81\u8B66\u544A)]"},
- { "optionQ", " [-Q (\u975C\u97F3\u6A21\u5F0F)]"},
- { "optionLF", " [-LF (\u8F38\u51FA\u4E0A\u50C5\u4F7F\u7528\u63DB\u884C\u5B57\u5143 {\u9810\u8A2D\u70BA CR/LF})]"},
- { "optionCR", " [-CR (\u8F38\u51FA\u4E0A\u50C5\u4F7F\u7528\u6B78\u4F4D\u5B57\u5143 {\u9810\u8A2D\u70BA CR/LF})]"},
- { "optionESCAPE", " [-ESCAPE (\u8981\u9041\u96E2\u7684\u5B57\u5143 {\u9810\u8A2D\u70BA <>&\"'\\r\\n}]"},
- { "optionINDENT", " [-INDENT (\u63A7\u5236\u8981\u7E2E\u6392\u7684\u7A7A\u9593 {\u9810\u8A2D\u70BA 0})]"},
- { "optionTT", " [-TT (\u8FFD\u8E64\u547C\u53EB\u7684\u6A23\u677F\u3002)]"},
- { "optionTG", " [-TG (\u8FFD\u8E64\u6BCF\u500B\u7522\u751F\u4E8B\u4EF6\u3002)]"},
- { "optionTS", " [-TS (\u8FFD\u8E64\u6BCF\u500B\u9078\u53D6\u4E8B\u4EF6\u3002)]"},
- { "optionTTC", " [-TTC (\u8FFD\u8E64\u8655\u7406\u7684\u6A23\u677F\u5B50\u9805\u3002)]"},
- { "optionTCLASS", " [-TCLASS (\u8FFD\u8E64\u64F4\u5145\u5957\u4EF6\u7684 TraceListener \u985E\u5225\u3002)]"},
- { "optionVALIDATE", " [-VALIDATE (\u8A2D\u5B9A\u662F\u5426\u57F7\u884C\u9A57\u8B49\u3002\u9810\u8A2D\u4E0D\u6703\u57F7\u884C\u9A57\u8B49\u3002)]"},
- { "optionEDUMP", " [-EDUMP {\u9078\u64C7\u6027\u6A94\u6848\u540D\u7A31} (\u767C\u751F\u932F\u8AA4\u6642\u6703\u57F7\u884C\u5806\u758A\u50BE\u5370\u3002)]"},
- { "optionXML", " [-XML (\u4F7F\u7528 XML \u683C\u5F0F\u5668\u4E26\u65B0\u589E XML \u6A19\u982D\u3002)]"},
- { "optionTEXT", " [-TEXT (\u4F7F\u7528\u7C21\u55AE Text \u683C\u5F0F\u5668\u3002)]"},
- { "optionHTML", " [-HTML (\u4F7F\u7528 HTML \u683C\u5F0F\u5668\u3002)]"},
- { "optionPARAM", " [-PARAM \u540D\u7A31\u8868\u793A\u5F0F (\u8A2D\u5B9A\u6A23\u5F0F\u8868\u53C3\u6578)]"},
- { "noParsermsg1", "XSL \u8655\u7406\u4F5C\u696D\u5931\u6557\u3002"},
- { "noParsermsg2", "** \u627E\u4E0D\u5230\u5256\u6790\u5668 **"},
- { "noParsermsg3", "\u8ACB\u6AA2\u67E5\u985E\u5225\u8DEF\u5F91\u3002"},
- { "noParsermsg4", "\u82E5\u7121 IBM \u7684 XML Parser for Java\uFF0C\u53EF\u4E0B\u8F09\u81EA"},
- { "noParsermsg5", "IBM \u7684 AlphaWorks: http://www.alphaworks.ibm.com/formula/xml"},
- { "optionURIRESOLVER", " [-URIRESOLVER \u5B8C\u6574\u985E\u5225\u540D\u7A31 (\u7528\u4F86\u89E3\u6790 URI \u7684 URIResolver)]"},
- { "optionENTITYRESOLVER", " [-ENTITYRESOLVER \u5B8C\u6574\u985E\u5225\u540D\u7A31 (\u7528\u4F86\u89E3\u6790\u500B\u9AD4\u7684 EntityResolver )]"},
- { "optionCONTENTHANDLER", " [-CONTENTHANDLER \u5B8C\u6574\u985E\u5225\u540D\u7A31 (\u7528\u4F86\u5E8F\u5217\u5316\u8F38\u51FA\u7684 ContentHandler)]"},
- { "optionLINENUMBERS", " [-L \u4F7F\u7528\u884C\u865F\u65BC\u4F86\u6E90\u6587\u4EF6]"},
- { "optionSECUREPROCESSING", " [-SECURE (\u5C07\u5B89\u5168\u8655\u7406\u529F\u80FD\u8A2D\u70BA\u771F\u3002)]"},
-
- // Following are the new options added in XSLTErrorResources.properties files after Jdk 1.4 (Xalan 2.2-D11)
-
-
- { "optionMEDIA", " [-MEDIA mediaType (\u4F7F\u7528\u5A92\u9AD4\u5C6C\u6027\u4F86\u5C0B\u627E\u8207\u6587\u4EF6\u95DC\u806F\u7684\u6A23\u5F0F\u8868\u3002)]"},
- { "optionFLAVOR", " [-FLAVOR flavorName (\u660E\u78BA\u4F7F\u7528 s2s=SAX \u6216 d2d=DOM \u4F86\u57F7\u884C\u8F49\u63DB\u3002)] "}, // Added by sboag/scurcuru; experimental
- { "optionDIAG", " [-DIAG (\u5217\u5370\u8F49\u63DB\u6240\u9700\u8981\u7684\u5168\u90E8\u6BEB\u79D2\u3002)]"},
- { "optionINCREMENTAL", " [-INCREMENTAL (\u8A2D\u5B9A http://xml.apache.org/xalan/features/incremental \u70BA\u771F\uFF0C\u4EE5\u8981\u6C42\u6F38\u9032 DTM \u5EFA\u69CB\u3002)]"},
- { "optionNOOPTIMIMIZE", " [-NOOPTIMIMIZE (\u8A2D\u5B9A http://xml.apache.org/xalan/features/optimize \u70BA\u507D\uFF0C\u4EE5\u8981\u6C42\u7121\u6A23\u5F0F\u8868\u6700\u4F73\u5316\u8655\u7406\u3002)]"},
- { "optionRL", " [-RL recursionlimit (\u5BA3\u544A\u6A23\u5F0F\u8868\u905E\u8FF4\u6DF1\u5EA6\u7684\u6578\u5B57\u9650\u5236\u3002)]"},
- { "optionXO", " [-XO [transletName] (\u6307\u6D3E\u6240\u7522\u751F translet \u7684\u540D\u7A31)]"},
- { "optionXD", " [-XD destinationDirectory (\u6307\u5B9A translet \u7684\u76EE\u7684\u5730\u76EE\u9304)]"},
- { "optionXJ", " [-XJ jarfile (\u5C01\u88DD translet \u985E\u5225\u6210\u70BA\u540D\u7A31\u70BA <jarfile> \u7684 jar \u6A94\u6848)]"},
- { "optionXP", " [-XP \u5957\u88DD\u7A0B\u5F0F (\u6307\u5B9A\u6240\u6709\u7522\u751F\u7684 translet \u985E\u5225\u7684\u5957\u88DD\u7A0B\u5F0F\u540D\u7A31\u524D\u7F6E\u78BC)]"},
-
- //AddITIONAL STRINGS that need L10n
- // Note to translators: The following message describes usage of a particular
- // command-line option that is used to enable the "template inlining"
- // optimization. The optimization involves making a copy of the code
- // generated for a template in another template that refers to it.
- { "optionXN", " [-XN (\u555F\u7528\u6A23\u677F\u5167\u5D4C)]" },
- { "optionXX", " [-XX (\u958B\u555F\u984D\u5916\u7684\u9664\u932F\u8A0A\u606F\u8F38\u51FA)]"},
- { "optionXT" , " [-XT (\u82E5\u6709\u53EF\u80FD\uFF0C\u4F7F\u7528 translet \u4F86\u8F49\u63DB)]"},
- { "diagTiming"," --------- \u7D93\u7531 {1} \u7684 {0} \u8F49\u63DB\u6B77\u6642 {2} \u6BEB\u79D2" },
- { "recursionTooDeep","\u6A23\u677F\u5DE2\u72C0\u7D50\u69CB\u904E\u6DF1\u3002\u5DE2\u72C0\u7D50\u69CB = {0}\uFF0C\u6A23\u677F {1} {2}" },
- { "nameIs", "\u540D\u7A31\u70BA" },
- { "matchPatternIs", "\u914D\u5C0D\u6A23\u5F0F\u70BA" }
-
- };
-
- }
- // ================= INFRASTRUCTURE ======================
-
- /** String for use when a bad error code was encountered. */
- public static final String BAD_CODE = "BAD_CODE";
-
- /** String for use when formatting of the error string failed. */
- public static final String FORMAT_FAILED = "FORMAT_FAILED";
-
- /** General error string. */
- public static final String ERROR_STRING = "#error";
-
- /** String to prepend to error messages. */
- public static final String ERROR_HEADER = "Error: ";
-
- /** String to prepend to warning messages. */
- public static final String WARNING_HEADER = "Warning: ";
-
- /** String to specify the XSLT module. */
- public static final String XSL_HEADER = "XSLT ";
-
- /** String to specify the XML parser module. */
- public static final String XML_HEADER = "XML ";
-
- /** I don't think this is used any more.
- * @deprecated */
- public static final String QUERY_HEADER = "PATTERN ";
-
-
- }
diff --git a/src/com/sun/org/apache/xalan/internal/res/XSLTInfo.properties b/src/com/sun/org/apache/xalan/internal/res/XSLTInfo.properties
deleted file mode 100644
index d45d033..0000000
--- a/src/com/sun/org/apache/xalan/internal/res/XSLTInfo.properties
+++ /dev/null
@@ -1,32 +0,0 @@
-###########################################################################
-# reserved comment block
-# DO NOT REMOVE OR ALTER!
-###########################################################################
-###########################################################################
-# Copyright 2000-2004 The Apache Software Foundation.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-##########################################################################
-#
-# $Id: XSLTInfo.properties,v 1.1.2.1 2005/08/01 02:10:48 jeffsuttor Exp $
-#
-# XSLT Resource File
-#
-
-vendor=Apache Software Foundation
-vendor-url=http://xml.apache.org/xalan-j
-
-# Product Version: Xalan-Java @impl.version@
-
-# W3C XSL Transformations (XSLT) Version 1.0
-version=1.0
diff --git a/src/com/sun/org/apache/xalan/internal/res/package.html b/src/com/sun/org/apache/xalan/internal/res/package.html
deleted file mode 100644
index fac82d2..0000000
--- a/src/com/sun/org/apache/xalan/internal/res/package.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!--
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
--->
-<!--
- * Copyright 2000-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
--->
-<!-- $Id: package.html,v 1.1.2.1 2005/08/01 02:10:49 jeffsuttor Exp $ -->
-<html>
- <title>Xalan resource Package.</title>
- <body>
- <p>Contains strings that require internationalization.<p>
- </body>
-</html>
-
-
diff --git a/src/com/sun/org/apache/xalan/internal/templates/Constants.java b/src/com/sun/org/apache/xalan/internal/templates/Constants.java
deleted file mode 100644
index e4c7539..0000000
--- a/src/com/sun/org/apache/xalan/internal/templates/Constants.java
+++ /dev/null
@@ -1,401 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Constants.java,v 1.2.4.1 2005/09/10 19:50:56 jeffsuttor Exp $
- */
-package com.sun.org.apache.xalan.internal.templates;
-
-
-/**
- * Primary constants used in the TransformerImpl classes.
- * @xsl.usage advanced
- */
-public class Constants extends com.sun.org.apache.xml.internal.utils.Constants
-{
-
- /**
- * IDs for XSL element types. These are associated
- * with the string literals in the TransformerImpl class.
- * Don't change the numbers. NOTE THAT THESE ARE NOT IN
- * ALPHABETICAL ORDER!
- * (It's a pity Java doesn't have a real Enumerated Mnemonic
- * datatype... or a C-like preprocessor in lieu thereof which
- * could be used to generate and maintain synch between these lists.)
- */
- public static final int ELEMNAME_UNDEFINED = -1, ELEMNAME_WITHPARAM = 2,
- ELEMNAME_ADDATTRIBUTE = 4, ELEMNAME_ANCHOR = 22,
-
- // ELEMNAME_ANCHOR_PATTERN = 23,
- ELEMNAME_APPLY_TEMPLATES = 50, ELEMNAME_USE = 34, ELEMNAME_CHILDREN = 6,
- ELEMNAME_CHOOSE = 37, ELEMNAME_COMMENT = 59, // my own
- ELEMNAME_CONSTRUCT = 7, // my own
- ELEMNAME_CONTENTS = 8, ELEMNAME_COPY = 9,
- ELEMNAME_COPY_OF = 74,
- ELEMNAME_DECIMALFORMAT = 83,
- ELEMNAME_DEFINEATTRIBUTESET = 40,
-
- // ELEMNAME_DEFINECONSTANT = 29,
- // ELEMNAME_DEFINEMACRO = 10,
- ELEMNAME_DEFINESCRIPT = 11, ELEMNAME_DISPLAYIF = 12, // my own
- ELEMNAME_EMPTY = 14, ELEMNAME_EVAL = 15,
- ELEMNAME_EXPECTEDCHILDREN = 16,
- ELEMNAME_EXTENSION = 54,
- ELEMNAME_EXTENSIONHANDLER = 63,
- ELEMNAME_FOREACH = 28, ELEMNAME_KEY = 31,
- ELEMNAME_IF = 36, ELEMNAME_IMPORT = 26,
- ELEMNAME_INCLUDE = 27,
- ELEMNAME_CALLTEMPLATE = 17,
- ELEMNAME_PARAMVARIABLE = 41,
- ELEMNAME_NUMBER = 35, ELEMNAME_NSALIAS = 84,
- ELEMNAME_OTHERWISE = 39, ELEMNAME_PI = 58,
- ELEMNAME_PRESERVESPACE = 33,
- ELEMNAME_REMOVEATTRIBUTE = 5,
- ELEMNAME_TEMPLATE = 19, ELEMNAME_SORT = 64,
- ELEMNAME_STRIPSPACE = 32,
- ELEMNAME_STYLESHEET = 25, ELEMNAME_TEXT = 42,
- ELEMNAME_VALUEOF = 30, ELEMNAME_WHEN = 38,
-
- // Pattern by example support
- ELEMNAME_ROOT = 44, ELEMNAME_ANY = 45, ELEMNAME_ELEMENT = 46,
- ELEMNAME_TARGETELEMENT = 47, ELEMNAME_ATTRIBUTE = 48,
- ELEMNAME_TARGETATTRIBUTE = 49, ELEMNAME_URL = 52, // my own
- ELEMNAME_CALL = 55, // my own
-
- // ELEMNAME_WITHPARAM = 56,
- ELEMNAME_FALLBACK = 57, // my own
- ELEMNAME_TARGETPI = 60, // my own
- ELEMNAME_TARGETCOMMENT = 61, // my own
- ELEMNAME_TARGETTEXT = 62, // my own
- ELEMNAME_CSSSTYLECONVERSION = 65, // my own
- ELEMNAME_COUNTER = 66, ELEMNAME_COUNTERS = 67,
- ELEMNAME_COUNTERINCREMENT = 68, ELEMNAME_COUNTERRESET = 69,
- ELEMNAME_COUNTERSCOPE = 71, ELEMNAME_APPLY_IMPORTS = 72,
- ELEMNAME_VARIABLE = 73, ELEMNAME_MESSAGE = 75, ELEMNAME_LOCALE = 76,
- ELEMNAME_LITERALRESULT = 77, ELEMNAME_TEXTLITERALRESULT = 78,
- ELEMNAME_EXTENSIONCALL = 79, ELEMNAME_EXTENSIONDECL = 85,
- ELEMNAME_EXTENSIONSCRIPT = 86, ELEMNAME_OUTPUT = 80,
- ELEMNAME_COMPONENT = 81, ELEMNAME_SCRIPT = 82;
-
- // Next free number: 90 (88 and 89 used for EXSLT elements);
-
- /**
- * Literals for XSL element names. Note that there are more
- * names than IDs, because some names map to the same ID.
- */
- public static final String
- ELEMNAME_ANCHOR_STRING = "anchor",
- ELEMNAME_ANY_STRING = "any", // pattern-by-example support
- ELEMNAME_APPLY_IMPORTS_STRING = "apply-imports",
- ELEMNAME_APPLY_TEMPLATES_STRING = "apply-templates",
- ELEMNAME_ARG_STRING = "arg",
- ELEMNAME_ATTRIBUTESET_STRING = "attribute-set",
- ELEMNAME_ATTRIBUTE_STRING = "attribute", // pattern-by-example support
- ELEMNAME_CALLTEMPLATEARG_STRING = "invoke-arg",
- ELEMNAME_CALLTEMPLATE_STRING = "call-template",
- ELEMNAME_CALL_STRING = "call",
- ELEMNAME_CHILDREN_STRING = "children",
- ELEMNAME_CHOOSE_STRING = "choose",
- ELEMNAME_COMMENT_STRING = "comment",
- ELEMNAME_COMPONENT_STRING = "component",
- ELEMNAME_CONSTRUCT_STRING = "construct", // my own
- ELEMNAME_CONTENTS_STRING = "contents",
- ELEMNAME_COPY_OF_STRING ="copy-of",
- ELEMNAME_COPY_STRING = "copy",
- ELEMNAME_COUNTERINCREMENT_STRING = "counter-increment",
- ELEMNAME_COUNTERRESET_STRING = "counter-reset",
- ELEMNAME_COUNTERSCOPE_STRING = "counter-scope",
- ELEMNAME_COUNTERS_STRING = "counters",
- ELEMNAME_COUNTER_STRING = "counter",
- ELEMNAME_CSSSTYLECONVERSION_STRING = "css-style-conversion",
- ELEMNAME_DECIMALFORMAT_STRING = "decimal-format",
- ELEMNAME_DISPLAYIF_STRING = "display-if", // my own
- ELEMNAME_ELEMENT_STRING = "element", // pattern-by-example support
- ELEMNAME_EMPTY_STRING = "empty",
- ELEMNAME_EVAL_STRING = "eval",
- ELEMNAME_EXPECTEDCHILDREN_STRING = "expectedchildren",
- ELEMNAME_EXTENSIONHANDLER_STRING = "code-dispatcher",
- ELEMNAME_EXTENSION_STRING = "functions",
- ELEMNAME_FALLBACK_STRING = "fallback",
- ELEMNAME_FOREACH_STRING = "for-each",
- ELEMNAME_IF_STRING = "if",
- ELEMNAME_IMPORT_STRING = "import",
- ELEMNAME_INCLUDE_STRING = "include",
- ELEMNAME_KEY_STRING = "key",
- ELEMNAME_LOCALE_STRING = "locale",
- ELEMNAME_MESSAGE_STRING = "message",
- ELEMNAME_NSALIAS_STRING = "namespace-alias",
- ELEMNAME_NUMBER_STRING = "number",
- ELEMNAME_OTHERWISE_STRING = "otherwise",
- ELEMNAME_OUTPUT_STRING = "output",
- ELEMNAME_PARAMVARIABLE_STRING = "param",
- ELEMNAME_PI_OLD_STRING = "pi",
- ELEMNAME_PI_STRING = "processing-instruction",
- ELEMNAME_PRESERVESPACE_STRING = "preserve-space",
- ELEMNAME_ROOT_STRING = "root", // pattern-by-example support
- ELEMNAME_SCRIPT_STRING = "script",
- ELEMNAME_SORT_STRING = "sort",
- ELEMNAME_STRIPSPACE_STRING = "strip-space",
- ELEMNAME_STYLESHEET_STRING = "stylesheet",
- ELEMNAME_TARGETATTRIBUTE_STRING = "target-attribute", // pattern-by-example support
- ELEMNAME_TARGETCOMMENT_STRING = "target-comment",
- ELEMNAME_TARGETELEMENT_STRING = "target-element", // pattern-by-example support
- ELEMNAME_TARGETPI_STRING = "target-pi",
- ELEMNAME_TARGETTEXT_STRING = "target-text",
- ELEMNAME_TEMPLATE_STRING = "template",
- ELEMNAME_TEXT_STRING = "text",
- ELEMNAME_TRANSFORM_STRING = "transform",
- ELEMNAME_URL_STRING = "uri", // pattern-by-example support
- ELEMNAME_USE_STRING = "use",
- ELEMNAME_VALUEOF_STRING = "value-of",
- ELEMNAME_VARIABLE_STRING = "variable",
- ELEMNAME_WHEN_STRING = "when",
- ELEMNAME_WITHPARAM_STRING = "with-param";
-
- /**
- * Literals for EXSLT function elements.
- */
- public static final String
- EXSLT_ELEMNAME_FUNCTION_STRING = "function",
- EXSLT_ELEMNAME_FUNCRESULT_STRING = "result";
- public static final int
- EXSLT_ELEMNAME_FUNCTION = 88,
- EXSLT_ELEMNAME_FUNCRESULT = 89;
-
-
- /**
- * Literals for XSL attribute names. Note that there may be more
- * names than IDs, because some names may map to the same ID.
- */
- public static final String
- ATTRNAME_AMOUNT = "amount",
- ATTRNAME_ANCESTOR = "ancestor",
- ATTRNAME_ARCHIVE = "archive",
- ATTRNAME_ATTRIBUTE = "attribute",
- ATTRNAME_ATTRIBUTE_SET = "attribute-set",
- ATTRNAME_CASEORDER = "case-order",
- ATTRNAME_CLASS = "class",
- ATTRNAME_CLASSID = "classid",
- ATTRNAME_CODEBASE = "codebase",
- ATTRNAME_CODETYPE = "type",
- ATTRNAME_CONDITION = "condition",
- ATTRNAME_COPYTYPE = "copy-type",
- ATTRNAME_COUNT = "count",
- ATTRNAME_DATATYPE = "data-type",
- ATTRNAME_DECIMALSEPARATOR = "decimal-separator",
- ATTRNAME_DEFAULT = "default",
- ATTRNAME_DEFAULTSPACE = "default-space",
- ATTRNAME_DEPTH = "with-children",
- ATTRNAME_DIGIT = "digit",
- ATTRNAME_DIGITGROUPSEP = "digit-group-sep",
- ATTRNAME_DISABLE_OUTPUT_ESCAPING = "disable-output-escaping",
- ATTRNAME_ELEMENT = "element",
- ATTRNAME_ELEMENTS = "elements",
- ATTRNAME_EXCLUDE_RESULT_PREFIXES ="exclude-result-prefixes",
- ATTRNAME_EXPR = "expr",
- ATTRNAME_EXTENSIONELEMENTPREFIXES = "extension-element-prefixes",
- ATTRNAME_FORMAT = "format",
- ATTRNAME_FROM = "from",
- ATTRNAME_GROUPINGSEPARATOR = "grouping-separator",
- ATTRNAME_GROUPINGSIZE = "grouping-size",
- ATTRNAME_HREF = "href",
- ATTRNAME_ID = "id",
- ATTRNAME_IMPORTANCE = "importance",
- ATTRNAME_INDENTRESULT = "indent-result",
- ATTRNAME_INFINITY = "infinity",
- ATTRNAME_LANG = "lang",
- ATTRNAME_LETTERVALUE = "letter-value",
- ATTRNAME_LEVEL = "level",
- ATTRNAME_MATCH = "match",
- ATTRNAME_METHOD = "calls",
- ATTRNAME_MINUSSIGN = "minus-sign",
- ATTRNAME_MODE = "mode",
- ATTRNAME_NAME = "name",
- ATTRNAME_NAMESPACE = "namespace",
- ATTRNAME_NAN = "NaN",
- ATTRNAME_NDIGITSPERGROUP = "n-digits-per-group",
- ATTRNAME_NS = "ns",
- ATTRNAME_ONLY = "only",
- ATTRNAME_ORDER = "order",
- ATTRNAME_OUTPUT_CDATA_SECTION_ELEMENTS = "cdata-section-elements",
- ATTRNAME_OUTPUT_DOCTYPE_PUBLIC = "doctype-public",
- ATTRNAME_OUTPUT_DOCTYPE_SYSTEM = "doctype-system",
- ATTRNAME_OUTPUT_ENCODING = "encoding",
- ATTRNAME_OUTPUT_INDENT = "indent",
- ATTRNAME_OUTPUT_MEDIATYPE = "media-type",
- ATTRNAME_OUTPUT_METHOD = "method", // qname,
- ATTRNAME_OUTPUT_OMITXMLDECL = "omit-xml-declaration",
- ATTRNAME_OUTPUT_STANDALONE = "standalone",
- ATTRNAME_OUTPUT_VERSION = "version",
- ATTRNAME_PATTERNSEPARATOR = "pattern-separator",
- ATTRNAME_PERCENT = "percent",
- ATTRNAME_PERMILLE = "per-mille",
- ATTRNAME_PRIORITY = "priority",
- ATTRNAME_REFID = "refID",
- ATTRNAME_RESULTNS = "result-ns",
- ATTRNAME_RESULT_PREFIX = "result-prefix",
- ATTRNAME_SELECT = "select",
- ATTRNAME_SEQUENCESRC = "sequence-src",
- ATTRNAME_STYLE = "style",
- ATTRNAME_STYLESHEET_PREFIX = "stylesheet-prefix",
- ATTRNAME_TERMINATE = "terminate",
- ATTRNAME_TEST = "test",
- ATTRNAME_TOSTRING = "to-string",
- ATTRNAME_TYPE = "type",
- ATTRNAME_USE = "use",
- ATTRNAME_USEATTRIBUTESETS = "use-attribute-sets",
- ATTRNAME_VALUE = "value",
- ATTRNAME_VERSION = "version",
- ATTRNAME_XMLNS = "xmlns:", // namespace declaration prefix -- NOT an attribute by itself
- ATTRNAME_XMLNSDEF = "xmlns", // default namespace
- ATTRNAME_XMLSPACE = "xml:space",
- ATTRNAME_ZERODIGIT = "zero-digit";
-
- /** IDs for XSL attribute types. These are associated
- * with the string literals in the TransformerImpl class.
- * Don't change the numbers. NOTE THAT THESE ARE NOT IN
- * ALPHABETICAL ORDER!
- */
- public static final int TATTRNAME_OUTPUT_METHOD = 1, TATTRNAME_AMOUNT = 2,
- TATTRNAME_ANCESTOR = 3, TATTRNAME_ARCHIVE = 4,
- TATTRNAME_ATTRIBUTE = 5,
- TATTRNAME_ATTRIBUTE_SET = 6,
- TATTRNAME_CASEORDER = 7, TATTRNAME_CLASS = 8,
- TATTRNAME_CLASSID = 9, TATTRNAME_CODEBASE = 10,
- TATTRNAME_CODETYPE = 11, TATTRNAME_CONDITION = 12,
- TATTRNAME_COPYTYPE = 13, TATTRNAME_COUNT = 14,
- TATTRNAME_DATATYPE = 15, TATTRNAME_DEFAULT = 16,
- TATTRNAME_DEFAULTSPACE = 17, TATTRNAME_DEPTH = 18,
- TATTRNAME_DIGITGROUPSEP = 19,
- TATTRNAME_DISABLE_OUTPUT_ESCAPING = 20,
- TATTRNAME_ELEMENT = 21, TATTRNAME_ELEMENTS = 22,
- TATTRNAME_EXPR = 23,
- TATTRNAME_EXTENSIONELEMENTPREFIXES = 24,
- TATTRNAME_FORMAT = 25, TATTRNAME_FROM = 26,
- TATTRNAME_GROUPINGSEPARATOR = 27,
- TATTRNAME_GROUPINGSIZE = 28, TATTRNAME_HREF = 29,
- TATTRNAME_ID = 30, TATTRNAME_IMPORTANCE = 31,
- TATTRNAME_INDENTRESULT = 32, TATTRNAME_LANG = 33,
- TATTRNAME_LETTERVALUE = 34, TATTRNAME_LEVEL = 35,
- TATTRNAME_MATCH = 36, TATTRNAME_METHOD = 37,
- TATTRNAME_MODE = 38, TATTRNAME_NAME = 39,
- TATTRNAME_NAMESPACE = 40,
- TATTRNAME_NDIGITSPERGROUP = 41, TATTRNAME_NS = 42,
- TATTRNAME_ONLY = 43, TATTRNAME_ORDER = 44,
- TATTRNAME_OUTPUT_CDATA_SECTION_ELEMENTS = 45,
- TATTRNAME_OUTPUT_DOCTYPE_PUBLIC = 46,
- TATTRNAME_OUTPUT_DOCTYPE_SYSTEM = 47,
- TATTRNAME_OUTPUT_ENCODING = 48,
- TATTRNAME_OUTPUT_INDENT = 49,
- TATTRNAME_OUTPUT_MEDIATYPE = 50,
- TATTRNAME_OUTPUT_STANDALONE = 51,
- TATTRNAME_OUTPUT_VERSION = 52,
- TATTRNAME_OUTPUT_OMITXMLDECL = 53,
- TATTRNAME_PRIORITY = 54, TATTRNAME_REFID = 55,
- TATTRNAME_RESULTNS = 56, TATTRNAME_SELECT = 57,
- TATTRNAME_SEQUENCESRC = 58, TATTRNAME_STYLE = 59,
- TATTRNAME_TEST = 60, TATTRNAME_TOSTRING = 61,
- TATTRNAME_TYPE = 62, TATTRNAME_USE = 63,
- TATTRNAME_USEATTRIBUTESETS = 64,
- TATTRNAME_VALUE = 65, TATTRNAME_XMLNSDEF = 66,
- TATTRNAME_XMLNS = 67, TATTRNAME_XMLSPACE = 68,
- TATTRNAME_EXCLUDE_RESULT_PREFIXES = 69;
-
- /** Mnemonics for the possible values of the xsl:output element's
- * method= attribute:
- * <ul>
- * <li>ATTRVAL_OUTPUT_METHOD_XML = Use an XML formatter to
- * produce the output document (basic XSLT operation).</li>
- * <li>ATTRVAL_OUTPUT_METHOD_HTML: Use an HTML formatter to
- * produce the output document. When generating HTML documents,
- * this may yield better results; it does things like escaping
- * characters in href attributes.</li>
- * </li>ATTRVAL_OUTPUT_METHOD_TEXT: Use a Text formatter to
- * produce the output document. Generally the right choice if your
- * stylesheet wants to take over _all_ the details of formatting,
- * most often when producing something that isn't an XML or HTML
- * document.</li>
- * </ul>
- * */
- public static final String ATTRVAL_OUTPUT_METHOD_HTML = "html",
- ATTRVAL_OUTPUT_METHOD_XML = "xml",
- ATTRVAL_OUTPUT_METHOD_TEXT = "text";
-
-
- /* For space-att*/
- public static final int ATTRVAL_PRESERVE = 1, ATTRVAL_STRIP = 2;
-
-
- /** For indent-result */
- public static final boolean ATTRVAL_YES = true, ATTRVAL_NO = false;
-
-
- /** For letter-value attribute (part of conversion attributes). */
- public static final String ATTRVAL_ALPHABETIC = "alphabetic",
- ATTRVAL_OTHER = "other",
- ATTRVAL_TRADITIONAL = "traditional";
-
-
- /** For level attribute in xsl:number. */
- public static final String ATTRVAL_SINGLE = "single",
- ATTRVAL_MULTI = "multiple", ATTRVAL_ANY = "any";
-
-
- /** For Stylesheet-prefix and result-prefix in xsl:namespace-alias */
- public static final String ATTRVAL_DEFAULT_PREFIX = "#default";
-
- /** Integer equivalents for above */
- public static final int NUMBERLETTER_ALPHABETIC = 1, NUMBERLETTER_TRADITIONAL = 2;
-
- /** Integer equivelents for above */
- public static final int NUMBERLEVEL_SINGLE = 1, NUMBERLEVEL_MULTI = 2,
- NUMBERLEVEL_ANY = 3, MAX_MULTI_COUNTING_DEPTH = 32;
-
-
- /** some stuff for my patterns-by-example */
- public static final String ATTRVAL_THIS = ".", ATTRVAL_PARENT = "..",
- ATTRVAL_ANCESTOR = "ancestor", ATTRVAL_ID = "id";
-
-
- /** Stuff for sorting */
- public static final String ATTRVAL_DATATYPE_TEXT = "text",
- ATTRVAL_DATATYPE_NUMBER = "number",
- ATTRVAL_ORDER_ASCENDING = "ascending",
- ATTRVAL_ORDER_DESCENDING = "descending",
- ATTRVAL_CASEORDER_UPPER = "upper-first",
- ATTRVAL_CASEORDER_LOWER = "lower-first";
-
- /** Integer equivelents for DATATYPE attribute */
- public static final int SORTDATATYPE_TEXT = 1, SORTDATATYPE_NUMBER = 2;
-
- /** Integer equivelents for ORDER attribute */
- public static final int SORTORDER_ASCENDING = 1, SORTORDER_DESCENDING = 2;
-
- /** Integer equivelents for CASE-ORDER attribute */
- public static final int SORTCASEORDER_UPPERFIRST = 1, SORTCASEORDER_LOWERFIRST = 2;
-
- /** some stuff for Decimal-format */
- public static final String ATTRVAL_INFINITY = "Infinity",
- ATTRVAL_NAN = "NaN",
- DEFAULT_DECIMAL_FORMAT = "#default";
-
-
- /** temp dummy */
- public static final String ATTRNAME_XXXX = "XXXX";
-}
diff --git a/src/com/sun/org/apache/xalan/internal/templates/package.html b/src/com/sun/org/apache/xalan/internal/templates/package.html
deleted file mode 100644
index d72b9a7..0000000
--- a/src/com/sun/org/apache/xalan/internal/templates/package.html
+++ /dev/null
@@ -1,15 +0,0 @@
-<html>
-<head>
- <title>Xalan Templates Package.</title>
-<!--
-
- @(#)package.html 1.3 03/12/14
-
--->
-</head>
-<body bgcolor="white">
- <p> This package now only contain the classes used by XSLTC. In J2SE 1.5 only XSLTC is bundled as Transformer for supporting JAXP </P>
- </body>
-</html>
-
-
diff --git a/src/com/sun/org/apache/xalan/internal/utils/ConfigurationError.java b/src/com/sun/org/apache/xalan/internal/utils/ConfigurationError.java
deleted file mode 100644
index 5832f82..0000000
--- a/src/com/sun/org/apache/xalan/internal/utils/ConfigurationError.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ObjectFactory.java,v 1.2.4.1 2005/09/15 02:39:54 jeffsuttor Exp $
- */
-
-package com.sun.org.apache.xalan.internal.utils;
-
-/**
- * A configuration error. This was an internal class in ObjectFactory previously
- */
-public final class ConfigurationError
- extends Error {
-
- //
- // Data
- //
-
- /** Exception. */
- private Exception exception;
-
- //
- // Constructors
- //
-
- /**
- * Construct a new instance with the specified detail string and
- * exception.
- */
- ConfigurationError(String msg, Exception x) {
- super(msg);
- this.exception = x;
- } // <init>(String,Exception)
-
- //
- // methods
- //
-
- /** Returns the exception associated to this error. */
- public Exception getException() {
- return exception;
- } // getException():Exception
-
-} // class ConfigurationError
diff --git a/src/com/sun/org/apache/xalan/internal/utils/FactoryImpl.java b/src/com/sun/org/apache/xalan/internal/utils/FactoryImpl.java
deleted file mode 100644
index 973a7fd..0000000
--- a/src/com/sun/org/apache/xalan/internal/utils/FactoryImpl.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.org.apache.xalan.internal.utils;
-
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.SAXParserFactory;
-
-/**
- *
- * @author huizhe wang
- */
-public class FactoryImpl {
-
- static final String DBF = "com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl";
- static final String SF = "com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl";
-
- static public DocumentBuilderFactory getDOMFactory(boolean useServicesMechanism) {
- DocumentBuilderFactory dbf =
- useServicesMechanism ?
- DocumentBuilderFactory.newInstance() :
- DocumentBuilderFactory.newInstance( DBF,
- FactoryImpl.class.getClassLoader());
-
- return dbf;
- }
- static public SAXParserFactory getSAXFactory(boolean useServicesMechanism) {
- SAXParserFactory factory =
- useServicesMechanism ?
- SAXParserFactory.newInstance() :
- SAXParserFactory.newInstance(SF,
- FactoryImpl.class.getClassLoader());
- return factory;
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/utils/FeatureManager.java b/src/com/sun/org/apache/xalan/internal/utils/FeatureManager.java
deleted file mode 100644
index 8b77d50..0000000
--- a/src/com/sun/org/apache/xalan/internal/utils/FeatureManager.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.org.apache.xalan.internal.utils;
-
-
-import com.sun.org.apache.xalan.internal.XalanConstants;
-
-/**
- * This class manages security related properties
- *
- */
-public final class FeatureManager extends FeaturePropertyBase {
-
- /**
- * States of the settings of a property, in the order: default value, value
- * set by FEATURE_SECURE_PROCESSING, jaxp.properties file, jaxp system
- * properties, and jaxp api properties
- */
- public static enum State {
- //this order reflects the overriding order
- DEFAULT, FSP, JAXPDOTPROPERTIES, SYSTEMPROPERTY, APIPROPERTY
- }
-
- /**
- * Xalan Features
- */
- public static enum Feature {
- ORACLE_ENABLE_EXTENSION_FUNCTION(XalanConstants.ORACLE_ENABLE_EXTENSION_FUNCTION,
- "true");
-
- final String name;
- final String defaultValue;
-
- Feature(String name, String value) {
- this.name = name;
- this.defaultValue = value;
- }
-
- public boolean equalsName(String propertyName) {
- return (propertyName == null) ? false : name.equals(propertyName);
- }
-
- String defaultValue() {
- return defaultValue;
- }
- }
-
- /**
- * Default constructor. Establishes default values
- */
- public FeatureManager() {
- values = new String[Feature.values().length];
- for (Feature feature : Feature.values()) {
- values[feature.ordinal()] = feature.defaultValue();
- }
- //read system properties or jaxp.properties
- readSystemProperties();
- }
-
-
- /**
- * Check if the feature is enabled
- * @param feature name of the feature
- * @return true if enabled, false otherwise
- */
- public boolean isFeatureEnabled(Feature feature) {
- return Boolean.parseBoolean(values[feature.ordinal()]);
- }
-
- /**
- * Check if the feature is enabled
- * @param propertyName name of the feature
- * @return true if enabled, false otherwise
- */
- public boolean isFeatureEnabled(String propertyName) {
- return Boolean.parseBoolean(values[getIndex(propertyName)]);
- }
-
- /**
- * Get the index by property name
- * @param propertyName property name
- * @return the index of the property if found; return -1 if not
- */
- public int getIndex(String propertyName){
- for (Feature feature : Feature.values()) {
- if (feature.equalsName(propertyName)) {
- return feature.ordinal();
- }
- }
- return -1;
- }
-
- /**
- * Read from system properties, or those in jaxp.properties
- */
- private void readSystemProperties() {
- getSystemProperty(Feature.ORACLE_ENABLE_EXTENSION_FUNCTION,
- XalanConstants.SP_ORACLE_ENABLE_EXTENSION_FUNCTION);
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/utils/FeaturePropertyBase.java b/src/com/sun/org/apache/xalan/internal/utils/FeaturePropertyBase.java
deleted file mode 100644
index 3015024..0000000
--- a/src/com/sun/org/apache/xalan/internal/utils/FeaturePropertyBase.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.org.apache.xalan.internal.utils;
-
-import com.sun.org.apache.xalan.internal.XalanConstants;
-
-/**
- * This is the base class for features and properties
- *
- */
-public abstract class FeaturePropertyBase {
-
- /**
- * States of the settings of a property, in the order: default value, value
- * set by FEATURE_SECURE_PROCESSING, jaxp.properties file, jaxp system
- * properties, and jaxp api properties
- */
- public static enum State {
- //this order reflects the overriding order
- DEFAULT, FSP, JAXPDOTPROPERTIES, SYSTEMPROPERTY, APIPROPERTY
- }
-
-
- /**
- * Values of the properties as defined in enum Properties
- */
- String[] values = null;
- /**
- * States of the settings for each property in Properties above
- */
- State[] states = {State.DEFAULT, State.DEFAULT};
-
-
- /**
- * Set the value for a specific property.
- *
- * @param property the property
- * @param state the state of the property
- * @param value the value of the property
- */
- public void setValue(Enum property, State state, String value) {
- //only update if it shall override
- if (state.compareTo(states[property.ordinal()]) >= 0) {
- values[property.ordinal()] = value;
- states[property.ordinal()] = state;
- }
- }
-
- /**
- * Set the value of a property by its index
- * @param index the index of the property
- * @param state the state of the property
- * @param value the value of the property
- */
- public void setValue(int index, State state, String value) {
- //only update if it shall override
- if (state.compareTo(states[index]) >= 0) {
- values[index] = value;
- states[index] = state;
- }
- }
-
- /**
- * Set value by property name and state
- * @param propertyName property name
- * @param state the state of the property
- * @param value the value of the property
- * @return true if the property is managed by the security property manager;
- * false if otherwise.
- */
- public boolean setValue(String propertyName, State state, Object value) {
- int index = getIndex(propertyName);
- if (index > -1) {
- setValue(index, state, (String)value);
- return true;
- }
- return false;
- }
-
- /**
- * Set value by property name and state
- * @param propertyName property name
- * @param state the state of the property
- * @param value the value of the property
- * @return true if the property is managed by the security property manager;
- * false if otherwise.
- */
- public boolean setValue(String propertyName, State state, boolean value) {
- int index = getIndex(propertyName);
- if (index > -1) {
- if (value) {
- setValue(index, state, XalanConstants.FEATURE_TRUE);
- } else {
- setValue(index, state, XalanConstants.FEATURE_FALSE);
- }
- return true;
- }
- return false;
- }
-
- /**
- * Return the value of the specified property
- *
- * @param property the property
- * @return the value of the property
- */
- public String getValue(Enum property) {
- return values[property.ordinal()];
- }
-
- /**
- * Return the value of the specified property
- *
- * @param property the property
- * @return the value of the property
- */
- public String getValue(String property) {
- int index = getIndex(property);
- if (index > -1) {
- return getValueByIndex(index);
- }
- return null;
- }
-
- /**
- * Return the value of the specified property.
- *
- * @param propertyName the property name
- * @return the value of the property as a string. If a property is managed
- * by this manager, its value shall not be null.
- */
- public String getValueAsString(String propertyName) {
- int index = getIndex(propertyName);
- if (index > -1) {
- return getValueByIndex(index);
- }
-
- return null;
- }
-
- /**
- * Return the value of a property by its ordinal
- * @param index the index of a property
- * @return value of a property
- */
- public String getValueByIndex(int index) {
- return values[index];
- }
-
- /**
- * Get the index by property name
- * @param propertyName property name
- * @return the index of the property if found; return -1 if not
- */
- public abstract int getIndex(String propertyName);
-
- public <E extends Enum<E>> int getIndex(Class<E> property, String propertyName) {
- for (Enum<E> enumItem : property.getEnumConstants()) {
- if (enumItem.toString().equals(propertyName)) {
- //internally, ordinal is used as index
- return enumItem.ordinal();
- }
- }
- return -1;
- };
-
-
- /**
- * Read from system properties, or those in jaxp.properties
- *
- * @param property the property
- * @param systemProperty the name of the system property
- */
- void getSystemProperty(Enum property, String systemProperty) {
- try {
- String value = SecuritySupport.getSystemProperty(systemProperty);
- if (value != null) {
- values[property.ordinal()] = value;
- states[property.ordinal()] = State.SYSTEMPROPERTY;
- return;
- }
-
- value = SecuritySupport.readJAXPProperty(systemProperty);
- if (value != null) {
- values[property.ordinal()] = value;
- states[property.ordinal()] = State.JAXPDOTPROPERTIES;
- }
- } catch (NumberFormatException e) {
- //invalid setting ignored
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/utils/ObjectFactory.java b/src/com/sun/org/apache/xalan/internal/utils/ObjectFactory.java
deleted file mode 100644
index 8e82969..0000000
--- a/src/com/sun/org/apache/xalan/internal/utils/ObjectFactory.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ObjectFactory.java,v 1.2.4.1 2005/09/15 02:39:54 jeffsuttor Exp $
- */
-
-package com.sun.org.apache.xalan.internal.utils;
-
-/**
- * This class is duplicated for each JAXP subpackage so keep it in sync.
- * It is package private and therefore is not exposed as part of the JAXP
- * API.
- * <p>
- * This class was moved from the <code>javax.xml.parsers.ObjectFactory</code>
- * class and modified to be used as a general utility for creating objects
- * dynamically.
- *
- * @version $Id: ObjectFactory.java,v 1.11 2010-11-01 04:34:25 joehw Exp $
- */
-public class ObjectFactory {
-
- //
- // Constants
- //
- private static final String JAXP_INTERNAL = "com.sun.org.apache";
- private static final String STAX_INTERNAL = "com.sun.xml.internal";
-
- /** Set to true for debugging */
- private static final boolean DEBUG = false;
-
-
- /** Prints a message to standard error if debugging is enabled. */
- private static void debugPrintln(String msg) {
- if (DEBUG) {
- System.err.println("JAXP: " + msg);
- }
- } // debugPrintln(String)
-
- /**
- * Figure out which ClassLoader to use. For JDK 1.2 and later use
- * the context ClassLoader.
- */
- public static ClassLoader findClassLoader()
- {
- if (System.getSecurityManager()!=null) {
- //this will ensure bootclassloader is used
- return null;
- }
-
- // Figure out which ClassLoader to use for loading the provider
- // class. If there is a Context ClassLoader then use it.
- ClassLoader context = SecuritySupport.getContextClassLoader();
- ClassLoader system = SecuritySupport.getSystemClassLoader();
-
- ClassLoader chain = system;
- while (true) {
- if (context == chain) {
- // Assert: we are on JDK 1.1 or we have no Context ClassLoader
- // or any Context ClassLoader in chain of system classloader
- // (including extension ClassLoader) so extend to widest
- // ClassLoader (always look in system ClassLoader if Xalan
- // is in boot/extension/system classpath and in current
- // ClassLoader otherwise); normal classloaders delegate
- // back to system ClassLoader first so this widening doesn't
- // change the fact that context ClassLoader will be consulted
- ClassLoader current = ObjectFactory.class.getClassLoader();
-
- chain = system;
- while (true) {
- if (current == chain) {
- // Assert: Current ClassLoader in chain of
- // boot/extension/system ClassLoaders
- return system;
- }
- if (chain == null) {
- break;
- }
- chain = SecuritySupport.getParentClassLoader(chain);
- }
-
- // Assert: Current ClassLoader not in chain of
- // boot/extension/system ClassLoaders
- return current;
- }
-
- if (chain == null) {
- // boot ClassLoader reached
- break;
- }
-
- // Check for any extension ClassLoaders in chain up to
- // boot ClassLoader
- chain = SecuritySupport.getParentClassLoader(chain);
- }
-
- // Assert: Context ClassLoader not in chain of
- // boot/extension/system ClassLoaders
- return context;
- } // findClassLoader():ClassLoader
-
- /**
- * Create an instance of a class using the same class loader for the ObjectFactory by default
- * or boot class loader when Security Manager is in place
- */
- public static Object newInstance(String className, boolean doFallback)
- throws ConfigurationError
- {
- if (System.getSecurityManager()!=null) {
- return newInstance(className, null, doFallback);
- } else {
- return newInstance(className,
- findClassLoader (), doFallback);
- }
- }
-
- /**
- * Create an instance of a class using the specified ClassLoader
- */
- static Object newInstance(String className, ClassLoader cl,
- boolean doFallback)
- throws ConfigurationError
- {
- // assert(className != null);
- try{
- Class providerClass = findProviderClass(className, cl, doFallback);
- Object instance = providerClass.newInstance();
- if (DEBUG) debugPrintln("created new instance of " + providerClass +
- " using ClassLoader: " + cl);
- return instance;
- } catch (ClassNotFoundException x) {
- throw new ConfigurationError(
- "Provider " + className + " not found", x);
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider " + className + " could not be instantiated: " + x,
- x);
- }
- }
-
- /**
- * Find a Class using the same class loader for the ObjectFactory by default
- * or boot class loader when Security Manager is in place
- */
- public static Class<?> findProviderClass(String className, boolean doFallback)
- throws ClassNotFoundException, ConfigurationError
- {
- return findProviderClass (className,
- findClassLoader (), doFallback);
- }
-
- /**
- * Find a Class using the specified ClassLoader
- */
- private static Class<?> findProviderClass(String className, ClassLoader cl,
- boolean doFallback)
- throws ClassNotFoundException, ConfigurationError
- {
- //throw security exception if the calling thread is not allowed to access the
- //class. Restrict the access to the package classes as specified in java.security policy.
- SecurityManager security = System.getSecurityManager();
- try{
- if (security != null){
- if (className.startsWith(JAXP_INTERNAL) ||
- className.startsWith(STAX_INTERNAL)) {
- cl = null;
- } else {
- final int lastDot = className.lastIndexOf(".");
- String packageName = className;
- if (lastDot != -1) packageName = className.substring(0, lastDot);
- security.checkPackageAccess(packageName);
- }
- }
- }catch(SecurityException e){
- throw e;
- }
-
- Class<?> providerClass;
- if (cl == null) {
- providerClass = Class.forName(className, false, ObjectFactory.class.getClassLoader());
- } else {
- try {
- providerClass = cl.loadClass(className);
- } catch (ClassNotFoundException x) {
- if (doFallback) {
- // Fall back to current classloader
- ClassLoader current = ObjectFactory.class.getClassLoader();
- if (current == null) {
- providerClass = Class.forName(className);
- } else if (cl != current) {
- cl = current;
- providerClass = cl.loadClass(className);
- } else {
- throw x;
- }
- } else {
- throw x;
- }
- }
- }
-
- return providerClass;
- }
-
-} // class ObjectFactory
diff --git a/src/com/sun/org/apache/xalan/internal/utils/SecuritySupport.java b/src/com/sun/org/apache/xalan/internal/utils/SecuritySupport.java
deleted file mode 100644
index e581f9a..0000000
--- a/src/com/sun/org/apache/xalan/internal/utils/SecuritySupport.java
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2002-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: SecuritySupport.java,v 1.1.2.1 2005/08/01 02:08:48 jeffsuttor Exp $
- */
-
-package com.sun.org.apache.xalan.internal.utils;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-import java.util.ListResourceBundle;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-import java.util.Properties;
-
-/**
- * This class is duplicated for each subpackage so keep it in sync. It is
- * package private and therefore is not exposed as part of any API.
- *
- * @xerces.internal
- */
-public final class SecuritySupport {
-
- private static final SecuritySupport securitySupport = new SecuritySupport();
-
- /**
- * Return an instance of this class.
- */
- public static SecuritySupport getInstance() {
- return securitySupport;
- }
-
- public static ClassLoader getContextClassLoader() {
- return (ClassLoader) AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- ClassLoader cl = null;
- try {
- cl = Thread.currentThread().getContextClassLoader();
- } catch (SecurityException ex) {
- }
- return cl;
- }
- });
- }
-
- static ClassLoader getSystemClassLoader() {
- return (ClassLoader) AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- ClassLoader cl = null;
- try {
- cl = ClassLoader.getSystemClassLoader();
- } catch (SecurityException ex) {
- }
- return cl;
- }
- });
- }
-
- static ClassLoader getParentClassLoader(final ClassLoader cl) {
- return (ClassLoader) AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- ClassLoader parent = null;
- try {
- parent = cl.getParent();
- } catch (SecurityException ex) {
- }
-
- // eliminate loops in case of the boot
- // ClassLoader returning itself as a parent
- return (parent == cl) ? null : parent;
- }
- });
- }
-
- public static String getSystemProperty(final String propName) {
- return (String) AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return System.getProperty(propName);
- }
- });
- }
-
- public static String getSystemProperty(final String propName, final String def) {
- return (String) AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return System.getProperty(propName, def);
- }
- });
- }
-
- static FileInputStream getFileInputStream(final File file)
- throws FileNotFoundException {
- try {
- return (FileInputStream) AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws FileNotFoundException {
- return new FileInputStream(file);
- }
- });
- } catch (PrivilegedActionException e) {
- throw (FileNotFoundException)e.getException();
- }
- }
-
- /**
- * Return resource using the same classloader for the ObjectFactory by
- * default or bootclassloader when Security Manager is in place
- */
- public static InputStream getResourceAsStream(final String name) {
- if (System.getSecurityManager()!=null) {
- return getResourceAsStream(null, name);
- } else {
- return getResourceAsStream(ObjectFactory.findClassLoader(), name);
- }
- }
-
- public static InputStream getResourceAsStream(final ClassLoader cl,
- final String name) {
- return (InputStream) AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- InputStream ris;
- if (cl == null) {
- ris = Object.class.getResourceAsStream("/"+name);
- } else {
- ris = cl.getResourceAsStream(name);
- }
- return ris;
- }
- });
- }
-
- /**
- * Gets a resource bundle using the specified base name, the default locale, and the caller's class loader.
- * @param bundle the base name of the resource bundle, a fully qualified class name
- * @return a resource bundle for the given base name and the default locale
- */
- public static ListResourceBundle getResourceBundle(String bundle) {
- return getResourceBundle(bundle, Locale.getDefault());
- }
-
- /**
- * Gets a resource bundle using the specified base name and locale, and the caller's class loader.
- * @param bundle the base name of the resource bundle, a fully qualified class name
- * @param locale the locale for which a resource bundle is desired
- * @return a resource bundle for the given base name and locale
- */
- public static ListResourceBundle getResourceBundle(final String bundle, final Locale locale) {
- return AccessController.doPrivileged(new PrivilegedAction<ListResourceBundle>() {
- public ListResourceBundle run() {
- try {
- return (ListResourceBundle)ResourceBundle.getBundle(bundle, locale);
- } catch (MissingResourceException e) {
- try {
- return (ListResourceBundle)ResourceBundle.getBundle(bundle, new Locale("en", "US"));
- } catch (MissingResourceException e2) {
- throw new MissingResourceException(
- "Could not load any resource bundle by " + bundle, bundle, "");
- }
- }
- }
- });
- }
-
- public static boolean getFileExists(final File f) {
- return ((Boolean) AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return f.exists() ? Boolean.TRUE : Boolean.FALSE;
- }
- })).booleanValue();
- }
-
- static long getLastModified(final File f) {
- return ((Long) AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return new Long(f.lastModified());
- }
- })).longValue();
- }
-
- /**
- * Strip off path from an URI
- *
- * @param uri an URI with full path
- * @return the file name only
- */
- public static String sanitizePath(String uri) {
- if (uri == null) {
- return "";
- }
- int i = uri.lastIndexOf("/");
- if (i > 0) {
- return uri.substring(i+1, uri.length());
- }
- return "";
- }
-
- /**
- * Check the protocol used in the systemId against allowed protocols
- *
- * @param systemId the Id of the URI
- * @param allowedProtocols a list of allowed protocols separated by comma
- * @param accessAny keyword to indicate allowing any protocol
- * @return the name of the protocol if rejected, null otherwise
- */
- public static String checkAccess(String systemId, String allowedProtocols, String accessAny) throws IOException {
- if (systemId == null || (allowedProtocols != null &&
- allowedProtocols.equalsIgnoreCase(accessAny))) {
- return null;
- }
-
- String protocol;
- if (systemId.indexOf(":")==-1) {
- protocol = "file";
- } else {
- URL url = new URL(systemId);
- protocol = url.getProtocol();
- if (protocol.equalsIgnoreCase("jar")) {
- String path = url.getPath();
- protocol = path.substring(0, path.indexOf(":"));
- }
- }
-
- if (isProtocolAllowed(protocol, allowedProtocols)) {
- //access allowed
- return null;
- } else {
- return protocol;
- }
- }
-
- /**
- * Check if the protocol is in the allowed list of protocols. The check
- * is case-insensitive while ignoring whitespaces.
- *
- * @param protocol a protocol
- * @param allowedProtocols a list of allowed protocols
- * @return true if the protocol is in the list
- */
- private static boolean isProtocolAllowed(String protocol, String allowedProtocols) {
- if (allowedProtocols == null) {
- return false;
- }
- String temp[] = allowedProtocols.split(",");
- for (String t : temp) {
- t = t.trim();
- if (t.equalsIgnoreCase(protocol)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Read JAXP system property in this order: system property,
- * $java.home/lib/jaxp.properties if the system property is not specified
- *
- * @param propertyId the Id of the property
- * @return the value of the property
- */
- public static String getJAXPSystemProperty(String sysPropertyId) {
- String accessExternal = getSystemProperty(sysPropertyId);
- if (accessExternal == null) {
- accessExternal = readJAXPProperty(sysPropertyId);
- }
- return accessExternal;
- }
-
- /**
- * Read from $java.home/lib/jaxp.properties for the specified property
- * The program
- *
- * @param propertyId the Id of the property
- * @return the value of the property
- */
- static String readJAXPProperty(String propertyId) {
- String value = null;
- InputStream is = null;
- try {
- if (firstTime) {
- synchronized (cacheProps) {
- if (firstTime) {
- String configFile = getSystemProperty("java.home") + File.separator +
- "lib" + File.separator + "jaxp.properties";
- File f = new File(configFile);
- if (getFileExists(f)) {
- is = getFileInputStream(f);
- cacheProps.load(is);
- }
- firstTime = false;
- }
- }
- }
- value = cacheProps.getProperty(propertyId);
-
- }
- catch (Exception ex) {}
- finally {
- if (is != null) {
- try {
- is.close();
- } catch (IOException ex) {}
- }
- }
-
- return value;
- }
-
- /**
- * Cache for properties in java.home/lib/jaxp.properties
- */
- static final Properties cacheProps = new Properties();
-
- /**
- * Flag indicating if the program has tried reading java.home/lib/jaxp.properties
- */
- static volatile boolean firstTime = true;
-
- private SecuritySupport () {}
-}
diff --git a/src/com/sun/org/apache/xalan/internal/utils/XMLSecurityManager.java b/src/com/sun/org/apache/xalan/internal/utils/XMLSecurityManager.java
deleted file mode 100644
index 96bb46c..0000000
--- a/src/com/sun/org/apache/xalan/internal/utils/XMLSecurityManager.java
+++ /dev/null
@@ -1,466 +0,0 @@
-/*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.org.apache.xalan.internal.utils;
-
-import com.sun.org.apache.xalan.internal.XalanConstants;
-import java.util.concurrent.CopyOnWriteArrayList;
-import org.xml.sax.SAXException;
-
-
-/**
- * This class is not the same as that in Xerces. It is used to manage the
- * state of corresponding Xerces properties and pass the values over to
- * the Xerces Security Manager.
- *
- * @author Joe Wang Oracle Corp.
- *
- */
-public final class XMLSecurityManager {
-
- /**
- * States of the settings of a property, in the order: default value, value
- * set by FEATURE_SECURE_PROCESSING, jaxp.properties file, jaxp system
- * properties, and jaxp api properties
- */
- public static enum State {
- //this order reflects the overriding order
-
- DEFAULT("default"), FSP("FEATURE_SECURE_PROCESSING"),
- JAXPDOTPROPERTIES("jaxp.properties"), SYSTEMPROPERTY("system property"),
- APIPROPERTY("property");
-
- final String literal;
- State(String literal) {
- this.literal = literal;
- }
-
- String literal() {
- return literal;
- }
- }
-
- /**
- * Limits managed by the security manager
- */
- public static enum Limit {
-
- ENTITY_EXPANSION_LIMIT("EntityExpansionLimit", XalanConstants.JDK_ENTITY_EXPANSION_LIMIT,
- XalanConstants.SP_ENTITY_EXPANSION_LIMIT, 0, 64000),
- MAX_OCCUR_NODE_LIMIT("MaxOccurLimit", XalanConstants.JDK_MAX_OCCUR_LIMIT,
- XalanConstants.SP_MAX_OCCUR_LIMIT, 0, 5000),
- ELEMENT_ATTRIBUTE_LIMIT("ElementAttributeLimit", XalanConstants.JDK_ELEMENT_ATTRIBUTE_LIMIT,
- XalanConstants.SP_ELEMENT_ATTRIBUTE_LIMIT, 0, 10000),
- TOTAL_ENTITY_SIZE_LIMIT("TotalEntitySizeLimit", XalanConstants.JDK_TOTAL_ENTITY_SIZE_LIMIT,
- XalanConstants.SP_TOTAL_ENTITY_SIZE_LIMIT, 0, 50000000),
- GENERAL_ENTITY_SIZE_LIMIT("MaxEntitySizeLimit", XalanConstants.JDK_GENERAL_ENTITY_SIZE_LIMIT,
- XalanConstants.SP_GENERAL_ENTITY_SIZE_LIMIT, 0, 0),
- PARAMETER_ENTITY_SIZE_LIMIT("MaxEntitySizeLimit", XalanConstants.JDK_PARAMETER_ENTITY_SIZE_LIMIT,
- XalanConstants.SP_PARAMETER_ENTITY_SIZE_LIMIT, 0, 1000000),
- MAX_ELEMENT_DEPTH_LIMIT("MaxElementDepthLimit", XalanConstants.JDK_MAX_ELEMENT_DEPTH,
- XalanConstants.SP_MAX_ELEMENT_DEPTH, 0, 0),
- MAX_NAME_LIMIT("MaxXMLNameLimit", XalanConstants.JDK_XML_NAME_LIMIT,
- XalanConstants.SP_XML_NAME_LIMIT, 1000, 1000),
- ENTITY_REPLACEMENT_LIMIT("EntityReplacementLimit", XalanConstants.JDK_ENTITY_REPLACEMENT_LIMIT,
- XalanConstants.SP_ENTITY_REPLACEMENT_LIMIT, 0, 3000000);
-
- final String key;
- final String apiProperty;
- final String systemProperty;
- final int defaultValue;
- final int secureValue;
-
- Limit(String key, String apiProperty, String systemProperty, int value, int secureValue) {
- this.key = key;
- this.apiProperty = apiProperty;
- this.systemProperty = systemProperty;
- this.defaultValue = value;
- this.secureValue = secureValue;
- }
-
- public boolean equalsAPIPropertyName(String propertyName) {
- return (propertyName == null) ? false : apiProperty.equals(propertyName);
- }
-
- public boolean equalsSystemPropertyName(String propertyName) {
- return (propertyName == null) ? false : systemProperty.equals(propertyName);
- }
-
- public String key() {
- return key;
- }
-
- public String apiProperty() {
- return apiProperty;
- }
-
- String systemProperty() {
- return systemProperty;
- }
-
- public int defaultValue() {
- return defaultValue;
- }
-
- int secureValue() {
- return secureValue;
- }
- }
-
- /**
- * Map old property names with the new ones
- */
- public static enum NameMap {
-
- ENTITY_EXPANSION_LIMIT(XalanConstants.SP_ENTITY_EXPANSION_LIMIT,
- XalanConstants.ENTITY_EXPANSION_LIMIT),
- MAX_OCCUR_NODE_LIMIT(XalanConstants.SP_MAX_OCCUR_LIMIT,
- XalanConstants.MAX_OCCUR_LIMIT),
- ELEMENT_ATTRIBUTE_LIMIT(XalanConstants.SP_ELEMENT_ATTRIBUTE_LIMIT,
- XalanConstants.ELEMENT_ATTRIBUTE_LIMIT);
- final String newName;
- final String oldName;
-
- NameMap(String newName, String oldName) {
- this.newName = newName;
- this.oldName = oldName;
- }
-
- String getOldName(String newName) {
- if (newName.equals(this.newName)) {
- return oldName;
- }
- return null;
- }
- }
- /**
- * Values of the properties
- */
- private final int[] values;
- /**
- * States of the settings for each property
- */
- private State[] states;
- /**
- * States that determine if properties are set explicitly
- */
- private boolean[] isSet;
-
-
- /**
- * Index of the special entityCountInfo property
- */
- private final int indexEntityCountInfo = 10000;
- private String printEntityCountInfo = "";
-
- /**
- * Default constructor. Establishes default values for known security
- * vulnerabilities.
- */
- public XMLSecurityManager() {
- this(false);
- }
-
- /**
- * Instantiate Security Manager in accordance with the status of
- * secure processing
- * @param secureProcessing
- */
- public XMLSecurityManager(boolean secureProcessing) {
- values = new int[Limit.values().length];
- states = new State[Limit.values().length];
- isSet = new boolean[Limit.values().length];
- for (Limit limit : Limit.values()) {
- if (secureProcessing) {
- values[limit.ordinal()] = limit.secureValue();
- states[limit.ordinal()] = State.FSP;
- } else {
- values[limit.ordinal()] = limit.defaultValue();
- states[limit.ordinal()] = State.DEFAULT;
- }
- }
- //read system properties or jaxp.properties
- readSystemProperties();
- }
-
- /**
- * Setting FEATURE_SECURE_PROCESSING explicitly
- */
- public void setSecureProcessing(boolean secure) {
- for (Limit limit : Limit.values()) {
- if (secure) {
- setLimit(limit.ordinal(), State.FSP, limit.secureValue());
- } else {
- setLimit(limit.ordinal(), State.FSP, limit.defaultValue());
- }
- }
- }
-
- /**
- * Set limit by property name and state
- * @param propertyName property name
- * @param state the state of the property
- * @param value the value of the property
- * @return true if the property is managed by the security manager; false
- * if otherwise.
- */
- public boolean setLimit(String propertyName, State state, Object value) {
- int index = getIndex(propertyName);
- if (index > -1) {
- setLimit(index, state, value);
- return true;
- }
- return false;
- }
-
- /**
- * Set the value for a specific limit.
- *
- * @param limit the limit
- * @param state the state of the property
- * @param value the value of the property
- */
- public void setLimit(Limit limit, State state, int value) {
- setLimit(limit.ordinal(), state, value);
- }
-
- /**
- * Set the value of a property by its index
- *
- * @param index the index of the property
- * @param state the state of the property
- * @param value the value of the property
- */
- public void setLimit(int index, State state, Object value) {
- if (index == indexEntityCountInfo) {
- //if it's explicitly set, it's treated as yes no matter the value
- printEntityCountInfo = (String)value;
- } else {
- int temp = 0;
- try {
- temp = Integer.parseInt((String) value);
- if (temp < 0) {
- temp = 0;
- }
- } catch (NumberFormatException e) {}
- setLimit(index, state, temp); }
- }
-
- /**
- * Set the value of a property by its index
- *
- * @param index the index of the property
- * @param state the state of the property
- * @param value the value of the property
- */
- public void setLimit(int index, State state, int value) {
- if (index == indexEntityCountInfo) {
- //if it's explicitly set, it's treated as yes no matter the value
- printEntityCountInfo = XalanConstants.JDK_YES;
- } else {
- //only update if it shall override
- if (state.compareTo(states[index]) >= 0) {
- values[index] = value;
- states[index] = state;
- isSet[index] = true;
- }
- }
- }
-
-
- /**
- * Return the value of the specified property.
- *
- * @param propertyName the property name
- * @return the value of the property as a string. If a property is managed
- * by this manager, its value shall not be null.
- */
- public String getLimitAsString(String propertyName) {
- int index = getIndex(propertyName);
- if (index > -1) {
- return getLimitValueByIndex(index);
- }
-
- return null;
- }
-
- /**
- * Return the value of a property by its ordinal
- *
- * @param limit the property
- * @return value of a property
- */
- public String getLimitValueAsString(Limit limit) {
- return Integer.toString(values[limit.ordinal()]);
- }
-
- /**
- * Return the value of the specified property
- *
- * @param limit the property
- * @return the value of the property
- */
- public int getLimit(Limit limit) {
- return values[limit.ordinal()];
- }
-
- /**
- * Return the value of a property by its ordinal
- *
- * @param index the index of a property
- * @return value of a property
- */
- public int getLimitByIndex(int index) {
- return values[index];
- }
- /**
- * Return the value of a property by its index
- *
- * @param index the index of a property
- * @return limit of a property as a string
- */
- public String getLimitValueByIndex(int index) {
- if (index == indexEntityCountInfo) {
- return printEntityCountInfo;
- }
-
- return Integer.toString(values[index]);
- }
- /**
- * Return the state of the limit property
- *
- * @param limit the limit
- * @return the state of the limit property
- */
- public State getState(Limit limit) {
- return states[limit.ordinal()];
- }
-
- /**
- * Return the state of the limit property
- *
- * @param limit the limit
- * @return the state of the limit property
- */
- public String getStateLiteral(Limit limit) {
- return states[limit.ordinal()].literal();
- }
-
- /**
- * Get the index by property name
- *
- * @param propertyName property name
- * @return the index of the property if found; return -1 if not
- */
- public int getIndex(String propertyName) {
- for (Limit limit : Limit.values()) {
- if (limit.equalsAPIPropertyName(propertyName)) {
- //internally, ordinal is used as index
- return limit.ordinal();
- }
- }
- //special property to return entity count info
- if (propertyName.equals(XalanConstants.JDK_ENTITY_COUNT_INFO)) {
- return indexEntityCountInfo;
- }
- return -1;
- }
-
- /**
- * Indicate if a property is set explicitly
- * @param index
- * @return
- */
- public boolean isSet(int index) {
- return isSet[index];
- }
-
- public boolean printEntityCountInfo() {
- return printEntityCountInfo.equals(XalanConstants.JDK_YES);
- }
- /**
- * Read from system properties, or those in jaxp.properties
- */
- private void readSystemProperties() {
-
- for (Limit limit : Limit.values()) {
- if (!getSystemProperty(limit, limit.systemProperty())) {
- //if system property is not found, try the older form if any
- for (NameMap nameMap : NameMap.values()) {
- String oldName = nameMap.getOldName(limit.systemProperty());
- if (oldName != null) {
- getSystemProperty(limit, oldName);
- }
- }
- }
- }
-
- }
-
- // Array list to store printed warnings for each SAX parser used
- private static final CopyOnWriteArrayList<String> printedWarnings = new CopyOnWriteArrayList<>();
-
- /**
- * Prints out warnings if a parser does not support the specified feature/property.
- *
- * @param parserClassName the name of the parser class
- * @param propertyName the property name
- * @param exception the exception thrown by the parser
- */
- public static void printWarning(String parserClassName, String propertyName, SAXException exception) {
- String key = parserClassName+":"+propertyName;
- if (printedWarnings.addIfAbsent(key)) {
- System.err.println( "Warning: "+parserClassName+": "+exception.getMessage());
- }
- }
-
- /**
- * Read from system properties, or those in jaxp.properties
- *
- * @param property the type of the property
- * @param sysPropertyName the name of system property
- */
- private boolean getSystemProperty(Limit limit, String sysPropertyName) {
- try {
- String value = SecuritySupport.getSystemProperty(sysPropertyName);
- if (value != null && !value.equals("")) {
- values[limit.ordinal()] = Integer.parseInt(value);
- states[limit.ordinal()] = State.SYSTEMPROPERTY;
- return true;
- }
-
- value = SecuritySupport.readJAXPProperty(sysPropertyName);
- if (value != null && !value.equals("")) {
- values[limit.ordinal()] = Integer.parseInt(value);
- states[limit.ordinal()] = State.JAXPDOTPROPERTIES;
- return true;
- }
- } catch (NumberFormatException e) {
- //invalid setting
- throw new NumberFormatException("Invalid setting for system property: " + limit.systemProperty());
- }
- return false;
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/utils/XMLSecurityPropertyManager.java b/src/com/sun/org/apache/xalan/internal/utils/XMLSecurityPropertyManager.java
deleted file mode 100644
index 611120b..0000000
--- a/src/com/sun/org/apache/xalan/internal/utils/XMLSecurityPropertyManager.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.org.apache.xalan.internal.utils;
-
-
-import com.sun.org.apache.xalan.internal.XalanConstants;
-import javax.xml.XMLConstants;
-
-/**
- * This class manages security related properties
- *
- */
-public final class XMLSecurityPropertyManager extends FeaturePropertyBase {
-
- /**
- * Properties managed by the security property manager
- */
- public static enum Property {
- ACCESS_EXTERNAL_DTD(XMLConstants.ACCESS_EXTERNAL_DTD,
- XalanConstants.EXTERNAL_ACCESS_DEFAULT),
- ACCESS_EXTERNAL_STYLESHEET(XMLConstants.ACCESS_EXTERNAL_STYLESHEET,
- XalanConstants.EXTERNAL_ACCESS_DEFAULT);
-
- final String name;
- final String defaultValue;
-
- Property(String name, String value) {
- this.name = name;
- this.defaultValue = value;
- }
-
- public boolean equalsName(String propertyName) {
- return (propertyName == null) ? false : name.equals(propertyName);
- }
-
- String defaultValue() {
- return defaultValue;
- }
- }
-
-
- /**
- * Default constructor. Establishes default values
- */
- public XMLSecurityPropertyManager() {
- values = new String[Property.values().length];
- for (Property property : Property.values()) {
- values[property.ordinal()] = property.defaultValue();
- }
- //read system properties or jaxp.properties
- readSystemProperties();
- }
-
- /**
- * Get the index by property name
- * @param propertyName property name
- * @return the index of the property if found; return -1 if not
- */
- public int getIndex(String propertyName){
- for (Property property : Property.values()) {
- if (property.equalsName(propertyName)) {
- //internally, ordinal is used as index
- return property.ordinal();
- }
- }
- return -1;
- }
-
- /**
- * Read from system properties, or those in jaxp.properties
- */
- private void readSystemProperties() {
- getSystemProperty(Property.ACCESS_EXTERNAL_DTD,
- XalanConstants.SP_ACCESS_EXTERNAL_DTD);
- getSystemProperty(Property.ACCESS_EXTERNAL_STYLESHEET,
- XalanConstants.SP_ACCESS_EXTERNAL_STYLESHEET);
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xslt/EnvironmentCheck.java b/src/com/sun/org/apache/xalan/internal/xslt/EnvironmentCheck.java
deleted file mode 100644
index a9331f2..0000000
--- a/src/com/sun/org/apache/xalan/internal/xslt/EnvironmentCheck.java
+++ /dev/null
@@ -1,1253 +0,0 @@
-/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: EnvironmentCheck.java,v 1.2.4.1 2005/09/09 07:13:59 pvedula Exp $
- */
-package com.sun.org.apache.xalan.internal.xslt;
-
-import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
-import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.PrintWriter;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.StringTokenizer;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * Utility class to report simple information about the environment.
- * Simplistic reporting about certain classes found in your JVM may
- * help answer some FAQs for simple problems.
- *
- * <p>Usage-command line:
- * <code>
- * java com.sun.org.apache.xalan.internal.xslt.EnvironmentCheck [-out outFile]
- * </code></p>
- *
- * <p>Usage-from program:
- * <code>
- * boolean environmentOK =
- * (new EnvironmentCheck()).checkEnvironment(yourPrintWriter);
- * </code></p>
- *
- * <p>Usage-from stylesheet:
- * <code><pre>
- * &lt;?xml version="1.0"?&gt;
- * &lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
- * xmlns:xalan="http://xml.apache.org/xalan"
- * exclude-result-prefixes="xalan"&gt;
- * &lt;xsl:output indent="yes"/&gt;
- * &lt;xsl:template match="/"&gt;
- * &lt;xsl:copy-of select="xalan:checkEnvironment()"/&gt;
- * &lt;/xsl:template&gt;
- * &lt;/xsl:stylesheet&gt;
- * </pre></code></p>
- *
- * <p>Xalan users reporting problems are encouraged to use this class
- * to see if there are potential problems with their actual
- * Java environment <b>before</b> reporting a bug. Note that you
- * should both check from the JVM/JRE's command line as well as
- * temporarily calling checkEnvironment() directly from your code,
- * since the classpath may differ (especially for servlets, etc).</p>
- *
- * <p>Also see http://xml.apache.org/xalan-j/faq.html</p>
- *
- * <p>Note: This class is pretty simplistic:
- * results are not necessarily definitive nor will it find all
- * problems related to environment setup. Also, you should avoid
- * calling this in deployed production code, both because it is
- * quite slow and because it forces classes to get loaded.</p>
- *
- * <p>Note: This class explicitly has very limited compile-time
- * dependencies to enable easy compilation and usage even when
- * Xalan, DOM/SAX/JAXP, etc. are not present.</p>
- *
- * <p>Note: for an improved version of this utility, please see
- * the xml-commons' project Which utility which does the same kind
- * of thing but in a much simpler manner.</p>
- *
- * @author Shane_Curcuru@us.ibm.com
- * @version $Id: EnvironmentCheck.java,v 1.10 2010-11-01 04:34:13 joehw Exp $
- */
-public class EnvironmentCheck
-{
-
- /**
- * Command line runnability: checks for [-out outFilename] arg.
- * <p>Command line entrypoint; Sets output and calls
- * {@link #checkEnvironment(PrintWriter)}.</p>
- * @param args command line args
- */
- public static void main(String[] args)
- {
- // Default to System.out, autoflushing
- PrintWriter sendOutputTo = new PrintWriter(System.out, true);
-
- // Read our simplistic input args, if supplied
- for (int i = 0; i < args.length; i++)
- {
- if ("-out".equalsIgnoreCase(args[i]))
- {
- i++;
-
- if (i < args.length)
- {
- try
- {
- sendOutputTo = new PrintWriter(new FileWriter(args[i], true));
- }
- catch (Exception e)
- {
- System.err.println("# WARNING: -out " + args[i] + " threw "
- + e.toString());
- }
- }
- else
- {
- System.err.println(
- "# WARNING: -out argument should have a filename, output sent to console");
- }
- }
- }
-
- EnvironmentCheck app = new EnvironmentCheck();
- app.checkEnvironment(sendOutputTo);
- }
-
- /**
- * Programmatic entrypoint: Report on basic Java environment
- * and CLASSPATH settings that affect Xalan.
- *
- * <p>Note that this class is not advanced enough to tell you
- * everything about the environment that affects Xalan, and
- * sometimes reports errors that will not actually affect
- * Xalan's behavior. Currently, it very simplistically
- * checks the JVM's environment for some basic properties and
- * logs them out; it will report a problem if it finds a setting
- * or .jar file that is <i>likely</i> to cause problems.</p>
- *
- * <p>Advanced users can peruse the code herein to help them
- * investigate potential environment problems found; other users
- * may simply send the output from this tool along with any bugs
- * they submit to help us in the debugging process.</p>
- *
- * @param pw PrintWriter to send output to; can be sent to a
- * file that will look similar to a Properties file; defaults
- * to System.out if null
- * @return true if your environment appears to have no major
- * problems; false if potential environment problems found
- * @see #getEnvironmentHash()
- */
- public boolean checkEnvironment(PrintWriter pw)
- {
-
- // Use user-specified output writer if non-null
- if (null != pw)
- outWriter = pw;
-
- // Setup a hash to store various environment information in
- Map<String, Object> hash = getEnvironmentHash();
-
- // Check for ERROR keys in the hashtable, and print report
- boolean environmentHasErrors = writeEnvironmentReport(hash);
-
- if (environmentHasErrors)
- {
- // Note: many logMsg calls have # at the start to
- // fake a property-file like output
- logMsg("# WARNING: Potential problems found in your environment!");
- logMsg("# Check any 'ERROR' items above against the Xalan FAQs");
- logMsg("# to correct potential problems with your classes/jars");
- logMsg("# http://xml.apache.org/xalan-j/faq.html");
- if (null != outWriter)
- outWriter.flush();
- return false;
- }
- else
- {
- logMsg("# YAHOO! Your environment seems to be OK.");
- if (null != outWriter)
- outWriter.flush();
- return true;
- }
- }
-
- /**
- * Fill a hash with basic environment settings that affect Xalan.
- *
- * <p>Worker method called from various places.</p>
- * <p>Various system and CLASSPATH, etc. properties are put into
- * the hash as keys with a brief description of the current state
- * of that item as the value. Any serious problems will be put in
- * with a key that is prefixed with {@link #ERROR 'ERROR.'} so it
- * stands out in any resulting report; also a key with just that
- * constant will be set as well for any error.</p>
- * <p>Note that some legitimate cases are flaged as potential
- * errors - namely when a developer recompiles xalan.jar on their
- * own - and even a non-error state doesn't guaruntee that
- * everything in the environment is correct. But this will help
- * point out the most common classpath and system property
- * problems that we've seen.</p>
- *
- * @return Map full of useful environment info about Xalan and related
- * system properties, etc.
- */
- public Map<String, Object> getEnvironmentHash()
- {
- // Setup a hash to store various environment information in
- Map<String, Object> hash = new HashMap<>();
-
- // Call various worker methods to fill in the hash
- // These are explicitly separate for maintenance and so
- // advanced users could call them standalone
- checkJAXPVersion(hash);
- checkProcessorVersion(hash);
- checkParserVersion(hash);
- checkAntVersion(hash);
- if (!checkDOML3(hash)) {
- checkDOMVersion(hash);
- }
- checkSAXVersion(hash);
- checkSystemProperties(hash);
-
- return hash;
- }
-
- /**
- * Dump a basic Xalan environment report to outWriter.
- *
- * <p>This dumps a simple header and then each of the entries in
- * the Map to our PrintWriter; it does special processing
- * for entries that are .jars found in the classpath.</p>
- *
- * @param h Map of items to report on; presumably
- * filled in by our various check*() methods
- * @return true if your environment appears to have no major
- * problems; false if potential environment problems found
- * @see #appendEnvironmentReport(Node, Document, Map)
- * for an equivalent that appends to a Node instead
- */
- protected boolean writeEnvironmentReport(Map<String, Object> h)
- {
-
- if (null == h)
- {
- logMsg("# ERROR: writeEnvironmentReport called with null Map");
- return false;
- }
-
- boolean errors = false;
-
- logMsg(
- "#---- BEGIN writeEnvironmentReport($Revision: 1.10 $): Useful stuff found: ----");
-
- // Fake the Properties-like output
- for (Map.Entry<String, Object> entry : h.entrySet()) {
- String keyStr = entry.getKey();
- try {
- // Special processing for classes found..
- if (keyStr.startsWith(FOUNDCLASSES)) {
- List<Map> v = (ArrayList<Map>)entry.getValue();
- errors |= logFoundJars(v, keyStr);
- }
- // ..normal processing for all other entries
- else {
- // Note: we could just check for the ERROR key by itself,
- // since we now set that, but since we have to go
- // through the whole hash anyway, do it this way,
- // which is safer for maintenance
- if (keyStr.startsWith(ERROR)) {
- errors = true;
- }
- logMsg(keyStr + "=" + h.get(keyStr));
- }
- } catch (Exception e) {
- logMsg("Reading-" + keyStr + "= threw: " + e.toString());
- }
- }
-
- logMsg(
- "#----- END writeEnvironmentReport: Useful properties found: -----");
-
- return errors;
- }
-
- /** Prefixed to hash keys that signify serious problems. */
- public static final String ERROR = "ERROR.";
-
- /** Added to descriptions that signify potential problems. */
- public static final String WARNING = "WARNING.";
-
- /** Value for any error found. */
- public static final String ERROR_FOUND = "At least one error was found!";
-
- /** Prefixed to hash keys that signify version numbers. */
- public static final String VERSION = "version.";
-
- /** Prefixed to hash keys that signify .jars found in classpath. */
- public static final String FOUNDCLASSES = "foundclasses.";
-
- /** Marker that a class or .jar was found. */
- public static final String CLASS_PRESENT = "present-unknown-version";
-
- /** Marker that a class or .jar was not found. */
- public static final String CLASS_NOTPRESENT = "not-present";
-
- /** Listing of common .jar files that include Xalan-related classes. */
- public String[] jarNames =
- {
- "xalan.jar", "xalansamples.jar", "xalanj1compat.jar", "xalanservlet.jar",
- "serializer.jar", // Serializer (shared between Xalan & Xerces)
- "xerces.jar", // Xerces-J 1.x
- "xercesImpl.jar", // Xerces-J 2.x
- "testxsl.jar",
- "crimson.jar",
- "lotusxsl.jar",
- "jaxp.jar", "parser.jar", "dom.jar", "sax.jar", "xml.jar",
- "xml-apis.jar",
- "xsltc.jar"
- };
-
- /**
- * Print out report of .jars found in a classpath.
- *
- * Takes the information encoded from a checkPathForJars()
- * call and dumps it out to our PrintWriter.
- *
- * @param v List of Maps of .jar file info
- * @param desc description to print out in header
- *
- * @return false if OK, true if any .jars were reported
- * as having errors
- * @see #checkPathForJars(String, String[])
- */
- protected boolean logFoundJars(List<Map> v, String desc)
- {
-
- if ((null == v) || (v.size() < 1))
- return false;
-
- boolean errors = false;
-
- logMsg("#---- BEGIN Listing XML-related jars in: " + desc + " ----");
-
- for (Map<String, String> v1 : v) {
- for (Map.Entry<String, String> entry : v1.entrySet()) {
- String keyStr = entry.getKey();
- try {
- if (keyStr.startsWith(ERROR)) {
- errors = true;
- }
- logMsg(keyStr + "=" + entry.getValue());
-
- } catch (Exception e) {
- errors = true;
- logMsg("Reading-" + keyStr + "= threw: " + e.toString());
- }
- }
- }
-
- logMsg("#----- END Listing XML-related jars in: " + desc + " -----");
-
- return errors;
- }
-
- /**
- * Stylesheet extension entrypoint: Dump a basic Xalan
- * environment report from getEnvironmentHash() to a Node.
- *
- * <p>Copy of writeEnvironmentReport that creates a Node suitable
- * for other processing instead of a properties-like text output.
- * </p>
- * @param container Node to append our report to
- * @param factory Document providing createElement, etc. services
- * @param h Hash presumably from {@link #getEnvironmentHash()}
- * @see #writeEnvironmentReport(Map)
- * for an equivalent that writes to a PrintWriter instead
- */
- public void appendEnvironmentReport(Node container, Document factory, Map<String, Object> h)
- {
- if ((null == container) || (null == factory))
- {
- return;
- }
-
- try
- {
- Element envCheckNode = factory.createElement("EnvironmentCheck");
- envCheckNode.setAttribute("version", "$Revision: 1.10 $");
- container.appendChild(envCheckNode);
-
- if (null == h)
- {
- Element statusNode = factory.createElement("status");
- statusNode.setAttribute("result", "ERROR");
- statusNode.appendChild(factory.createTextNode("appendEnvironmentReport called with null Map!"));
- envCheckNode.appendChild(statusNode);
- return;
- }
-
- boolean errors = false;
-
- Element hashNode = factory.createElement("environment");
- envCheckNode.appendChild(hashNode);
-
- for (Map.Entry<String, Object> entry : h.entrySet()) {
- String keyStr = entry.getKey();
- try {
- // Special processing for classes found..
- if (keyStr.startsWith(FOUNDCLASSES)) {
- List<Map> v = (List<Map>)entry.getValue();
- // errors |= logFoundJars(v, keyStr);
- errors |= appendFoundJars(hashNode, factory, v, keyStr);
- } // ..normal processing for all other entries
- else {
- // Note: we could just check for the ERROR key by itself,
- // since we now set that, but since we have to go
- // through the whole hash anyway, do it this way,
- // which is safer for maintenance
- if (keyStr.startsWith(ERROR)) {
- errors = true;
- }
- Element node = factory.createElement("item");
- node.setAttribute("key", keyStr);
- node.appendChild(factory.createTextNode((String) h.get(keyStr)));
- hashNode.appendChild(node);
- }
- } catch (Exception e) {
- errors = true;
- Element node = factory.createElement("item");
- node.setAttribute("key", keyStr);
- node.appendChild(factory.createTextNode(ERROR + " Reading " + keyStr + " threw: " + e.toString()));
- hashNode.appendChild(node);
- }
- } // end of for...
-
- Element statusNode = factory.createElement("status");
- statusNode.setAttribute("result", (errors ? "ERROR" : "OK" ));
- envCheckNode.appendChild(statusNode);
- }
- catch (Exception e2)
- {
- System.err.println("appendEnvironmentReport threw: " + e2.toString());
- e2.printStackTrace();
- }
- }
-
- /**
- * Print out report of .jars found in a classpath.
- *
- * Takes the information encoded from a checkPathForJars()
- * call and dumps it out to our PrintWriter.
- *
- * @param container Node to append our report to
- * @param factory Document providing createElement, etc. services
- * @param v Map of Maps of .jar file info
- * @param desc description to print out in header
- *
- * @return false if OK, true if any .jars were reported
- * as having errors
- * @see #checkPathForJars(String, String[])
- */
- protected boolean appendFoundJars(Node container, Document factory,
- List<Map> v, String desc)
- {
-
- if ((null == v) || (v.size() < 1))
- return false;
-
- boolean errors = false;
-
- for (Map<String, String> v1 : v) {
- for (Map.Entry<String, String> entry : v1.entrySet()) {
- String keyStr = entry.getKey();
- try {
- if (keyStr.startsWith(ERROR)) {
- errors = true;
- }
- Element node = factory.createElement("foundJar");
- node.setAttribute("name", keyStr.substring(0, keyStr.indexOf("-")));
- node.setAttribute("desc", keyStr.substring(keyStr.indexOf("-") + 1));
- node.appendChild(factory.createTextNode(entry.getValue()));
- container.appendChild(node);
- } catch (Exception e) {
- errors = true;
- Element node = factory.createElement("foundJar");
- node.appendChild(factory.createTextNode(ERROR + " Reading " + keyStr + " threw: " + e.toString()));
- container.appendChild(node);
- }
- }
- }
- return errors;
- }
-
- /**
- * Fillin hash with info about SystemProperties.
- *
- * Logs java.class.path and other likely paths; then attempts
- * to search those paths for .jar files with Xalan-related classes.
- *
- * //@todo NOTE: We don't actually search java.ext.dirs for
- * // *.jar files therein! This should be updated
- *
- * @param h Map to put information in
- * @see #jarNames
- * @see #checkPathForJars(String, String[])
- */
- protected void checkSystemProperties(Map<String, Object> h)
- {
-
- if (null == h)
- h = new HashMap<>();
-
- // Grab java version for later use
- try
- {
- String javaVersion = SecuritySupport.getSystemProperty("java.version");
-
- h.put("java.version", javaVersion);
- }
- catch (SecurityException se)
- {
-
- // For applet context, etc.
- h.put(
- "java.version",
- "WARNING: SecurityException thrown accessing system version properties");
- }
-
- // Printout jar files on classpath(s) that may affect operation
- // Do this in order
- try
- {
-
- // This is present in all JVM's
- String cp = SecuritySupport.getSystemProperty("java.class.path");
-
- h.put("java.class.path", cp);
-
- List<Map> classpathJars = checkPathForJars(cp, jarNames);
-
- if (null != classpathJars) {
- h.put(FOUNDCLASSES + "java.class.path", classpathJars);
- }
-
- // Also check for JDK 1.2+ type classpaths
- String othercp = SecuritySupport.getSystemProperty("sun.boot.class.path");
-
- if (null != othercp) {
- h.put("sun.boot.class.path", othercp);
- classpathJars = checkPathForJars(othercp, jarNames);
-
- if (null != classpathJars) {
- h.put(FOUNDCLASSES + "sun.boot.class.path", classpathJars);
- }
- }
-
- //@todo NOTE: We don't actually search java.ext.dirs for
- // *.jar files therein! This should be updated
- othercp = SecuritySupport.getSystemProperty("java.ext.dirs");
-
- if (null != othercp)
- {
- h.put("java.ext.dirs", othercp);
-
- classpathJars = checkPathForJars(othercp, jarNames);
-
- if (null != classpathJars)
- h.put(FOUNDCLASSES + "java.ext.dirs", classpathJars);
- }
-
- //@todo also check other System properties' paths?
- // v2 = checkPathForJars(System.getProperty("sun.boot.library.path"), jarNames); // ?? may not be needed
- // v3 = checkPathForJars(System.getProperty("java.library.path"), jarNames); // ?? may not be needed
- }
- catch (SecurityException se2)
- {
- // For applet context, etc.
- h.put(
- "java.class.path",
- "WARNING: SecurityException thrown accessing system classpath properties");
- }
- }
-
- /**
- * Cheap-o listing of specified .jars found in the classpath.
- *
- * cp should be separated by the usual File.pathSeparator. We
- * then do a simplistic search of the path for any requested
- * .jar filenames, and return a listing of their names and
- * where (apparently) they came from.
- *
- * @param cp classpath to search
- * @param jars array of .jar base filenames to look for
- *
- * @return List of Maps filled with info about found .jars
- * @see #jarNames
- * @see #logFoundJars(Map, String)
- * @see #appendFoundJars(Node, Document, Map, String )
- * @see #getApparentVersion(String, long)
- */
- protected List<Map> checkPathForJars(String cp, String[] jars)
- {
-
- if ((null == cp) || (null == jars) || (0 == cp.length())
- || (0 == jars.length))
- return null;
-
- List<Map> v = new ArrayList<>();
- StringTokenizer st = new StringTokenizer(cp, File.pathSeparator);
-
- while (st.hasMoreTokens())
- {
-
- // Look at each classpath entry for each of our requested jarNames
- String filename = st.nextToken();
-
- for (int i = 0; i < jars.length; i++)
- {
- if (filename.indexOf(jars[i]) > -1)
- {
- File f = new File(filename);
-
- if (f.exists())
- {
-
- // If any requested jarName exists, report on
- // the details of that .jar file
- try {
- Map<String, String> h = new HashMap<>(2);
- // Note "-" char is looked for in appendFoundJars
- h.put(jars[i] + "-path", f.getAbsolutePath());
-
- // We won't bother reporting on the xalan.jar apparent version
- // since this requires knowing the jar size of the xalan.jar
- // before we build it.
- // For other jars, eg. xml-apis.jar and xercesImpl.jar, we
- // report the apparent version of the file we've found
- if (!("xalan.jar".equalsIgnoreCase(jars[i]))) {
- h.put(jars[i] + "-apparent.version",
- getApparentVersion(jars[i], f.length()));
- }
- v.add(h);
- } catch (Exception e) {
-
- /* no-op, don't add it */
- }
- } else {
- Map<String, String> h = new HashMap<>(2);
- // Note "-" char is looked for in appendFoundJars
- h.put(jars[i] + "-path", WARNING + " Classpath entry: "
- + filename + " does not exist");
- h.put(jars[i] + "-apparent.version", CLASS_NOTPRESENT);
- v.add(h);
- }
- }
- }
- }
-
- return v;
- }
-
- /**
- * Cheap-o method to determine the product version of a .jar.
- *
- * Currently does a lookup into a local table of some recent
- * shipped Xalan builds to determine where the .jar probably
- * came from. Note that if you recompile Xalan or Xerces
- * yourself this will likely report a potential error, since
- * we can't certify builds other than the ones we ship.
- * Only reports against selected posted Xalan-J builds.
- *
- * //@todo actually look up version info in manifests
- *
- * @param jarName base filename of the .jarfile
- * @param jarSize size of the .jarfile
- *
- * @return String describing where the .jar file probably
- * came from
- */
- protected String getApparentVersion(String jarName, long jarSize)
- {
- // If we found a matching size and it's for our
- // jar, then return it's description
- // Lookup in static JARVERSIONS Map
- String foundSize = JARVERSIONS.get(new Long(jarSize));
-
- if ((null != foundSize) && (foundSize.startsWith(jarName)))
- {
- return foundSize;
- }
- else
- {
- if ("xerces.jar".equalsIgnoreCase(jarName)
- || "xercesImpl.jar".equalsIgnoreCase(jarName))
-// || "xalan.jar".equalsIgnoreCase(jarName))
- {
-
- // For xalan.jar and xerces.jar/xercesImpl.jar, which we ship together:
- // The jar is not from a shipped copy of xalan-j, so
- // it's up to the user to ensure that it's compatible
- return jarName + " " + WARNING + CLASS_PRESENT;
- }
- else
- {
-
- // Otherwise, it's just a jar we don't have the version info calculated for
- return jarName + " " + CLASS_PRESENT;
- }
- }
- }
-
- /**
- * Report version information about JAXP interfaces.
- *
- * Currently distinguishes between JAXP 1.0.1 and JAXP 1.1,
- * and not found; only tests the interfaces, and does not
- * check for reference implementation versions.
- *
- * @param h Map to put information in
- */
- protected void checkJAXPVersion(Map<String, Object> h)
- {
-
- if (null == h)
- h = new HashMap<>();
-
- Class clazz = null;
-
- try
- {
- final String JAXP1_CLASS = "javax.xml.stream.XMLStreamConstants";
-
- clazz = ObjectFactory.findProviderClass(JAXP1_CLASS, true);
-
- // If we succeeded, we have JAXP 1.4 available
- h.put(VERSION + "JAXP", "1.4");
- }
- catch (Exception e)
- {
- h.put(ERROR + VERSION + "JAXP", "1.3");
- h.put(ERROR, ERROR_FOUND);
- }
- }
-
- /**
- * Report product version information from Xalan-J.
- *
- * Looks for version info in xalan.jar from Xalan-J products.
- *
- * @param h Map to put information in
- */
- protected void checkProcessorVersion(Map<String, Object> h)
- {
-
- if (null == h)
- h = new HashMap<>();
-
- try
- {
- final String XALAN1_VERSION_CLASS =
- "com.sun.org.apache.xalan.internal.xslt.XSLProcessorVersion";
-
- Class clazz = ObjectFactory.findProviderClass(XALAN1_VERSION_CLASS, true);
-
- // Found Xalan-J 1.x, grab it's version fields
- StringBuffer buf = new StringBuffer();
- Field f = clazz.getField("PRODUCT");
-
- buf.append(f.get(null));
- buf.append(';');
-
- f = clazz.getField("LANGUAGE");
-
- buf.append(f.get(null));
- buf.append(';');
-
- f = clazz.getField("S_VERSION");
-
- buf.append(f.get(null));
- buf.append(';');
- h.put(VERSION + "xalan1", buf.toString());
- }
- catch (Exception e1)
- {
- h.put(VERSION + "xalan1", CLASS_NOTPRESENT);
- }
-
- try
- {
- // NOTE: This is the old Xalan 2.0, 2.1, 2.2 version class,
- // is being replaced by class below
- final String XALAN2_VERSION_CLASS =
- "com.sun.org.apache.xalan.internal.processor.XSLProcessorVersion";
-
- Class clazz = ObjectFactory.findProviderClass(XALAN2_VERSION_CLASS, true);
-
- // Found Xalan-J 2.x, grab it's version fields
- StringBuffer buf = new StringBuffer();
- Field f = clazz.getField("S_VERSION");
- buf.append(f.get(null));
-
- h.put(VERSION + "xalan2x", buf.toString());
- }
- catch (Exception e2)
- {
- h.put(VERSION + "xalan2x", CLASS_NOTPRESENT);
- }
- try
- {
- // NOTE: This is the new Xalan 2.2+ version class
- final String XALAN2_2_VERSION_CLASS =
- "com.sun.org.apache.xalan.internal.Version";
- final String XALAN2_2_VERSION_METHOD = "getVersion";
- final Class noArgs[] = new Class[0];
-
- Class clazz = ObjectFactory.findProviderClass(XALAN2_2_VERSION_CLASS, true);
-
- Method method = clazz.getMethod(XALAN2_2_VERSION_METHOD, noArgs);
- Object returnValue = method.invoke(null, new Object[0]);
-
- h.put(VERSION + "xalan2_2", (String)returnValue);
- }
- catch (Exception e2)
- {
- h.put(VERSION + "xalan2_2", CLASS_NOTPRESENT);
- }
- }
-
- /**
- * Report product version information from common parsers.
- *
- * Looks for version info in xerces.jar/xercesImpl.jar/crimson.jar.
- *
- * //@todo actually look up version info in crimson manifest
- *
- * @param h Map to put information in
- */
- protected void checkParserVersion(Map<String, Object> h)
- {
-
- if (null == h)
- h = new HashMap<>();
-
- try
- {
- final String XERCES1_VERSION_CLASS = "com.sun.org.apache.xerces.internal.framework.Version";
-
- Class clazz = ObjectFactory.findProviderClass(XERCES1_VERSION_CLASS, true);
-
- // Found Xerces-J 1.x, grab it's version fields
- Field f = clazz.getField("fVersion");
- String parserVersion = (String) f.get(null);
-
- h.put(VERSION + "xerces1", parserVersion);
- }
- catch (Exception e)
- {
- h.put(VERSION + "xerces1", CLASS_NOTPRESENT);
- }
-
- // Look for xerces1 and xerces2 parsers separately
- try
- {
- final String XERCES2_VERSION_CLASS = "com.sun.org.apache.xerces.internal.impl.Version";
-
- Class clazz = ObjectFactory.findProviderClass(XERCES2_VERSION_CLASS, true);
-
- // Found Xerces-J 2.x, grab it's version fields
- Field f = clazz.getField("fVersion");
- String parserVersion = (String) f.get(null);
-
- h.put(VERSION + "xerces2", parserVersion);
- }
- catch (Exception e)
- {
- h.put(VERSION + "xerces2", CLASS_NOTPRESENT);
- }
-
- try
- {
- final String CRIMSON_CLASS = "org.apache.crimson.parser.Parser2";
-
- Class clazz = ObjectFactory.findProviderClass(CRIMSON_CLASS, true);
-
- //@todo determine specific crimson version
- h.put(VERSION + "crimson", CLASS_PRESENT);
- }
- catch (Exception e)
- {
- h.put(VERSION + "crimson", CLASS_NOTPRESENT);
- }
- }
-
- /**
- * Report product version information from Ant.
- *
- * @param h Map to put information in
- */
- protected void checkAntVersion(Map<String, Object> h)
- {
-
- if (null == h)
- h = new HashMap<>();
-
- try
- {
- final String ANT_VERSION_CLASS = "org.apache.tools.ant.Main";
- final String ANT_VERSION_METHOD = "getAntVersion"; // noArgs
- final Class noArgs[] = new Class[0];
-
- Class clazz = ObjectFactory.findProviderClass(ANT_VERSION_CLASS, true);
-
- Method method = clazz.getMethod(ANT_VERSION_METHOD, noArgs);
- Object returnValue = method.invoke(null, new Object[0]);
-
- h.put(VERSION + "ant", (String)returnValue);
- }
- catch (Exception e)
- {
- h.put(VERSION + "ant", CLASS_NOTPRESENT);
- }
- }
-
- /**
- * Report version info from DOM interfaces.
- *
- * @param h Map to put information in
- */
- protected boolean checkDOML3(Map<String, Object> h)
- {
-
- if (null == h)
- h = new HashMap<>();
-
- final String DOM_CLASS = "org.w3c.dom.Document";
- final String DOM_LEVEL3_METHOD = "getDoctype"; // no parameter
-
- try
- {
- Class clazz = ObjectFactory.findProviderClass(DOM_CLASS, true);
-
- Method method = clazz.getMethod(DOM_LEVEL3_METHOD, (Class<?>[])null);
-
- // If we succeeded, we have loaded interfaces from a
- // level 3 DOM somewhere
- h.put(VERSION + "DOM", "3.0");
- return true;
- }
- catch (Exception e)
- {
- return false;
- }
- }
-
- /**
- * Report version info from DOM interfaces.
- *
- * Currently distinguishes between pre-DOM level 2, the DOM
- * level 2 working draft, the DOM level 2 final draft,
- * and not found.
- *
- * @param h Map to put information in
- */
- protected void checkDOMVersion(Map<String, Object> h)
- {
-
- if (null == h)
- h = new HashMap<>();
-
- final String DOM_LEVEL2_CLASS = "org.w3c.dom.Document";
- final String DOM_LEVEL2_METHOD = "createElementNS"; // String, String
- final String DOM_LEVEL3_METHOD = "getDoctype"; // no parameter
- final String DOM_LEVEL2WD_CLASS = "org.w3c.dom.Node";
- final String DOM_LEVEL2WD_METHOD = "supported"; // String, String
- final String DOM_LEVEL2FD_CLASS = "org.w3c.dom.Node";
- final String DOM_LEVEL2FD_METHOD = "isSupported"; // String, String
- final Class twoStringArgs[] = { java.lang.String.class,
- java.lang.String.class };
-
- try
- {
- Class clazz = ObjectFactory.findProviderClass(DOM_LEVEL2_CLASS, true);
-
- Method method = clazz.getMethod(DOM_LEVEL2_METHOD, twoStringArgs);
-
- // If we succeeded, we have loaded interfaces from a
- // level 2 DOM somewhere
- h.put(VERSION + "DOM", "2.0");
-
- try
- {
- // Check for the working draft version, which is
- // commonly found, but won't work anymore
- clazz = ObjectFactory.findProviderClass(DOM_LEVEL2WD_CLASS, true);
-
- method = clazz.getMethod(DOM_LEVEL2WD_METHOD, twoStringArgs);
-
- h.put(ERROR + VERSION + "DOM.draftlevel", "2.0wd");
- h.put(ERROR, ERROR_FOUND);
- }
- catch (Exception e2)
- {
- try
- {
- // Check for the final draft version as well
- clazz = ObjectFactory.findProviderClass(DOM_LEVEL2FD_CLASS, true);
-
- method = clazz.getMethod(DOM_LEVEL2FD_METHOD, twoStringArgs);
-
- h.put(VERSION + "DOM.draftlevel", "2.0fd");
- }
- catch (Exception e3)
- {
- h.put(ERROR + VERSION + "DOM.draftlevel", "2.0unknown");
- h.put(ERROR, ERROR_FOUND);
- }
- }
- }
- catch (Exception e)
- {
- h.put(ERROR + VERSION + "DOM",
- "ERROR attempting to load DOM level 2 class: " + e.toString());
- h.put(ERROR, ERROR_FOUND);
- }
-
- //@todo load an actual DOM implmementation and query it as well
- //@todo load an actual DOM implmementation and check if
- // isNamespaceAware() == true, which is needed to parse
- // xsl stylesheet files into a DOM
- }
-
- /**
- * Report version info from SAX interfaces.
- *
- * Currently distinguishes between SAX 2, SAX 2.0beta2,
- * SAX1, and not found.
- *
- * @param h Map to put information in
- */
- protected void checkSAXVersion(Map<String, Object> h)
- {
-
- if (null == h)
- h = new HashMap<>();
-
- final String SAX_VERSION1_CLASS = "org.xml.sax.Parser";
- final String SAX_VERSION1_METHOD = "parse"; // String
- final String SAX_VERSION2_CLASS = "org.xml.sax.XMLReader";
- final String SAX_VERSION2_METHOD = "parse"; // String
- final String SAX_VERSION2BETA_CLASSNF = "org.xml.sax.helpers.AttributesImpl";
- final String SAX_VERSION2BETA_METHODNF = "setAttributes"; // Attributes
- final Class oneStringArg[] = { java.lang.String.class };
- // Note this introduces a minor compile dependency on SAX...
- final Class attributesArg[] = { org.xml.sax.Attributes.class };
-
- try
- {
- // This method was only added in the final SAX 2.0 release;
- // see changes.html "Changes from SAX 2.0beta2 to SAX 2.0prerelease"
- Class clazz = ObjectFactory.findProviderClass(SAX_VERSION2BETA_CLASSNF, true);
-
- Method method = clazz.getMethod(SAX_VERSION2BETA_METHODNF, attributesArg);
-
- // If we succeeded, we have loaded interfaces from a
- // real, final SAX version 2.0 somewhere
- h.put(VERSION + "SAX", "2.0");
- }
- catch (Exception e)
- {
- // If we didn't find the SAX 2.0 class, look for a 2.0beta2
- h.put(ERROR + VERSION + "SAX",
- "ERROR attempting to load SAX version 2 class: " + e.toString());
- h.put(ERROR, ERROR_FOUND);
-
- try
- {
- Class clazz = ObjectFactory.findProviderClass(SAX_VERSION2_CLASS, true);
-
- Method method = clazz.getMethod(SAX_VERSION2_METHOD, oneStringArg);
-
- // If we succeeded, we have loaded interfaces from a
- // SAX version 2.0beta2 or earlier; these might work but
- // you should really have the final SAX 2.0
- h.put(VERSION + "SAX-backlevel", "2.0beta2-or-earlier");
- }
- catch (Exception e2)
- {
- // If we didn't find the SAX 2.0beta2 class, look for a 1.0 one
- h.put(ERROR + VERSION + "SAX",
- "ERROR attempting to load SAX version 2 class: " + e.toString());
- h.put(ERROR, ERROR_FOUND);
-
- try
- {
- Class clazz = ObjectFactory.findProviderClass(SAX_VERSION1_CLASS, true);
-
- Method method = clazz.getMethod(SAX_VERSION1_METHOD, oneStringArg);
-
- // If we succeeded, we have loaded interfaces from a
- // SAX version 1.0 somewhere; which won't work very
- // well for JAXP 1.1 or beyond!
- h.put(VERSION + "SAX-backlevel", "1.0");
- }
- catch (Exception e3)
- {
- // If we didn't find the SAX 2.0 class, look for a 1.0 one
- // Note that either 1.0 or no SAX are both errors
- h.put(ERROR + VERSION + "SAX-backlevel",
- "ERROR attempting to load SAX version 1 class: " + e3.toString());
-
- }
- }
- }
- }
-
- /**
- * Manual table of known .jar sizes.
- * Only includes shipped versions of certain projects.
- * key=jarsize, value=jarname ' from ' distro name
- * Note assumption: two jars cannot have the same size!
- *
- * @see #getApparentVersion(String, long)
- */
- private static final Map<Long, String> JARVERSIONS;
-
- /**
- * Static initializer for JARVERSIONS table.
- * Doing this just once saves time and space.
- *
- * @see #getApparentVersion(String, long)
- */
- static
- {
- Map<Long, String> jarVersions = new HashMap<>();
- jarVersions.put(new Long(857192), "xalan.jar from xalan-j_1_1");
- jarVersions.put(new Long(440237), "xalan.jar from xalan-j_1_2");
- jarVersions.put(new Long(436094), "xalan.jar from xalan-j_1_2_1");
- jarVersions.put(new Long(426249), "xalan.jar from xalan-j_1_2_2");
- jarVersions.put(new Long(702536), "xalan.jar from xalan-j_2_0_0");
- jarVersions.put(new Long(720930), "xalan.jar from xalan-j_2_0_1");
- jarVersions.put(new Long(732330), "xalan.jar from xalan-j_2_1_0");
- jarVersions.put(new Long(872241), "xalan.jar from xalan-j_2_2_D10");
- jarVersions.put(new Long(882739), "xalan.jar from xalan-j_2_2_D11");
- jarVersions.put(new Long(923866), "xalan.jar from xalan-j_2_2_0");
- jarVersions.put(new Long(905872), "xalan.jar from xalan-j_2_3_D1");
- jarVersions.put(new Long(906122), "xalan.jar from xalan-j_2_3_0");
- jarVersions.put(new Long(906248), "xalan.jar from xalan-j_2_3_1");
- jarVersions.put(new Long(983377), "xalan.jar from xalan-j_2_4_D1");
- jarVersions.put(new Long(997276), "xalan.jar from xalan-j_2_4_0");
- jarVersions.put(new Long(1031036), "xalan.jar from xalan-j_2_4_1");
- // Stop recording xalan.jar sizes as of Xalan Java 2.5.0
-
- jarVersions.put(new Long(596540), "xsltc.jar from xalan-j_2_2_0");
- jarVersions.put(new Long(590247), "xsltc.jar from xalan-j_2_3_D1");
- jarVersions.put(new Long(589914), "xsltc.jar from xalan-j_2_3_0");
- jarVersions.put(new Long(589915), "xsltc.jar from xalan-j_2_3_1");
- jarVersions.put(new Long(1306667), "xsltc.jar from xalan-j_2_4_D1");
- jarVersions.put(new Long(1328227), "xsltc.jar from xalan-j_2_4_0");
- jarVersions.put(new Long(1344009), "xsltc.jar from xalan-j_2_4_1");
- jarVersions.put(new Long(1348361), "xsltc.jar from xalan-j_2_5_D1");
- // Stop recording xsltc.jar sizes as of Xalan Java 2.5.0
-
- jarVersions.put(new Long(1268634), "xsltc.jar-bundled from xalan-j_2_3_0");
-
- jarVersions.put(new Long(100196), "xml-apis.jar from xalan-j_2_2_0 or xalan-j_2_3_D1");
- jarVersions.put(new Long(108484), "xml-apis.jar from xalan-j_2_3_0, or xalan-j_2_3_1 from xml-commons-1.0.b2");
- jarVersions.put(new Long(109049), "xml-apis.jar from xalan-j_2_4_0 from xml-commons RIVERCOURT1 branch");
- jarVersions.put(new Long(113749), "xml-apis.jar from xalan-j_2_4_1 from factoryfinder-build of xml-commons RIVERCOURT1");
- jarVersions.put(new Long(124704), "xml-apis.jar from tck-jaxp-1_2_0 branch of xml-commons");
- jarVersions.put(new Long(124724), "xml-apis.jar from tck-jaxp-1_2_0 branch of xml-commons, tag: xml-commons-external_1_2_01");
- jarVersions.put(new Long(194205), "xml-apis.jar from head branch of xml-commons, tag: xml-commons-external_1_3_02");
-
- // If the below were more common I would update it to report
- // errors better; but this is so old hardly anyone has it
- jarVersions.put(new Long(424490), "xalan.jar from Xerces Tools releases - ERROR:DO NOT USE!");
-
- jarVersions.put(new Long(1591855), "xerces.jar from xalan-j_1_1 from xerces-1...");
- jarVersions.put(new Long(1498679), "xerces.jar from xalan-j_1_2 from xerces-1_2_0.bin");
- jarVersions.put(new Long(1484896), "xerces.jar from xalan-j_1_2_1 from xerces-1_2_1.bin");
- jarVersions.put(new Long(804460), "xerces.jar from xalan-j_1_2_2 from xerces-1_2_2.bin");
- jarVersions.put(new Long(1499244), "xerces.jar from xalan-j_2_0_0 from xerces-1_2_3.bin");
- jarVersions.put(new Long(1605266), "xerces.jar from xalan-j_2_0_1 from xerces-1_3_0.bin");
- jarVersions.put(new Long(904030), "xerces.jar from xalan-j_2_1_0 from xerces-1_4.bin");
- jarVersions.put(new Long(904030), "xerces.jar from xerces-1_4_0.bin");
- jarVersions.put(new Long(1802885), "xerces.jar from xerces-1_4_2.bin");
- jarVersions.put(new Long(1734594), "xerces.jar from Xerces-J-bin.2.0.0.beta3");
- jarVersions.put(new Long(1808883), "xerces.jar from xalan-j_2_2_D10,D11,D12 or xerces-1_4_3.bin");
- jarVersions.put(new Long(1812019), "xerces.jar from xalan-j_2_2_0");
- jarVersions.put(new Long(1720292), "xercesImpl.jar from xalan-j_2_3_D1");
- jarVersions.put(new Long(1730053), "xercesImpl.jar from xalan-j_2_3_0 or xalan-j_2_3_1 from xerces-2_0_0");
- jarVersions.put(new Long(1728861), "xercesImpl.jar from xalan-j_2_4_D1 from xerces-2_0_1");
- jarVersions.put(new Long(972027), "xercesImpl.jar from xalan-j_2_4_0 from xerces-2_1");
- jarVersions.put(new Long(831587), "xercesImpl.jar from xalan-j_2_4_1 from xerces-2_2");
- jarVersions.put(new Long(891817), "xercesImpl.jar from xalan-j_2_5_D1 from xerces-2_3");
- jarVersions.put(new Long(895924), "xercesImpl.jar from xerces-2_4");
- jarVersions.put(new Long(1010806), "xercesImpl.jar from Xerces-J-bin.2.6.2");
- jarVersions.put(new Long(1203860), "xercesImpl.jar from Xerces-J-bin.2.7.1");
-
- jarVersions.put(new Long(37485), "xalanj1compat.jar from xalan-j_2_0_0");
- jarVersions.put(new Long(38100), "xalanj1compat.jar from xalan-j_2_0_1");
-
- jarVersions.put(new Long(18779), "xalanservlet.jar from xalan-j_2_0_0");
- jarVersions.put(new Long(21453), "xalanservlet.jar from xalan-j_2_0_1");
- jarVersions.put(new Long(24826), "xalanservlet.jar from xalan-j_2_3_1 or xalan-j_2_4_1");
- jarVersions.put(new Long(24831), "xalanservlet.jar from xalan-j_2_4_1");
- // Stop recording xalanservlet.jar sizes as of Xalan Java 2.5.0; now a .war file
-
- // For those who've downloaded JAXP from sun
- jarVersions.put(new Long(5618), "jaxp.jar from jaxp1.0.1");
- jarVersions.put(new Long(136133), "parser.jar from jaxp1.0.1");
- jarVersions.put(new Long(28404), "jaxp.jar from jaxp-1.1");
- jarVersions.put(new Long(187162), "crimson.jar from jaxp-1.1");
- jarVersions.put(new Long(801714), "xalan.jar from jaxp-1.1");
- jarVersions.put(new Long(196399), "crimson.jar from crimson-1.1.1");
- jarVersions.put(new Long(33323), "jaxp.jar from crimson-1.1.1 or jakarta-ant-1.4.1b1");
- jarVersions.put(new Long(152717), "crimson.jar from crimson-1.1.2beta2");
- jarVersions.put(new Long(88143), "xml-apis.jar from crimson-1.1.2beta2");
- jarVersions.put(new Long(206384), "crimson.jar from crimson-1.1.3 or jakarta-ant-1.4.1b1");
-
- // jakarta-ant: since many people use ant these days
- jarVersions.put(new Long(136198), "parser.jar from jakarta-ant-1.3 or 1.2");
- jarVersions.put(new Long(5537), "jaxp.jar from jakarta-ant-1.3 or 1.2");
-
- JARVERSIONS = Collections.unmodifiableMap(jarVersions);
- }
-
- /** Simple PrintWriter we send output to; defaults to System.out. */
- protected PrintWriter outWriter = new PrintWriter(System.out, true);
-
- /**
- * Bottleneck output: calls outWriter.println(s).
- * @param s String to print
- */
- protected void logMsg(String s)
- {
- outWriter.println(s);
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xslt/Process.java b/src/com/sun/org/apache/xalan/internal/xslt/Process.java
deleted file mode 100644
index 67aa704..0000000
--- a/src/com/sun/org/apache/xalan/internal/xslt/Process.java
+++ /dev/null
@@ -1,1226 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Process.java,v 1.2.4.2 2005/09/15 18:21:57 jeffsuttor Exp $
- */
-package com.sun.org.apache.xalan.internal.xslt;
-
-import java.io.FileOutputStream;
-import java.io.FileWriter;
-import java.io.PrintWriter;
-import java.io.StringReader;
-import java.util.Properties;
-import java.util.ResourceBundle;
-import java.util.Vector;
-
-import javax.xml.XMLConstants;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Source;
-import javax.xml.transform.Templates;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.TransformerFactoryConfigurationError;
-import javax.xml.transform.URIResolver;
-import javax.xml.transform.dom.DOMResult;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.sax.SAXResult;
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.transform.sax.SAXTransformerFactory;
-import javax.xml.transform.sax.TransformerHandler;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.stream.StreamSource;
-
-import com.sun.org.apache.xalan.internal.Version;
-import com.sun.org.apache.xalan.internal.res.XSLMessages;
-import com.sun.org.apache.xalan.internal.res.XSLTErrorResources;
-import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
-import com.sun.org.apache.xalan.internal.utils.ConfigurationError;
-import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
-
-//J2SE does not support Xalan interpretive
-/*
-import com.sun.org.apache.xalan.internal.trace.PrintTraceListener;
-import com.sun.org.apache.xalan.internal.trace.TraceManager;
-import com.sun.org.apache.xalan.internal.transformer.XalanProperties;
-*/
-
-import com.sun.org.apache.xml.internal.utils.DefaultErrorHandler;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-import org.xml.sax.ContentHandler;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.InputSource;
-import org.xml.sax.XMLReader;
-import org.xml.sax.helpers.XMLReaderFactory;
-
-/**
- * The main() method handles the Xalan command-line interface.
- * @xsl.usage general
- */
-public class Process
-{
- /**
- * Prints argument options.
- *
- * @param resbundle Resource bundle
- */
- protected static void printArgOptions(ResourceBundle resbundle)
- {
- System.out.println(resbundle.getString("xslProc_option")); //"xslproc options: ");
- System.out.println("\n\t\t\t" + resbundle.getString("xslProc_common_options") + "\n");
- System.out.println(resbundle.getString("optionXSLTC")); //" [-XSLTC (use XSLTC for transformation)]
- System.out.println(resbundle.getString("optionIN")); //" [-IN inputXMLURL]");
- System.out.println(resbundle.getString("optionXSL")); //" [-XSL XSLTransformationURL]");
- System.out.println(resbundle.getString("optionOUT")); //" [-OUT outputFileName]");
-
- // System.out.println(resbundle.getString("optionE")); //" [-E (Do not expand entity refs)]");
- System.out.println(resbundle.getString("optionV")); //" [-V (Version info)]");
-
- // System.out.println(resbundle.getString("optionVALIDATE")); //" [-VALIDATE (Set whether validation occurs. Validation is off by default.)]");
- System.out.println(resbundle.getString("optionEDUMP")); //" [-EDUMP {optional filename} (Do stackdump on error.)]");
- System.out.println(resbundle.getString("optionXML")); //" [-XML (Use XML formatter and add XML header.)]");
- System.out.println(resbundle.getString("optionTEXT")); //" [-TEXT (Use simple Text formatter.)]");
- System.out.println(resbundle.getString("optionHTML")); //" [-HTML (Use HTML formatter.)]");
- System.out.println(resbundle.getString("optionPARAM")); //" [-PARAM name expression (Set a stylesheet parameter)]");
-
- System.out.println(resbundle.getString("optionMEDIA"));
- System.out.println(resbundle.getString("optionFLAVOR"));
- System.out.println(resbundle.getString("optionDIAG"));
- System.out.println(resbundle.getString("optionURIRESOLVER")); //" [-URIRESOLVER full class name (URIResolver to be used to resolve URIs)]");
- System.out.println(resbundle.getString("optionENTITYRESOLVER")); //" [-ENTITYRESOLVER full class name (EntityResolver to be used to resolve entities)]");
- waitForReturnKey(resbundle);
- System.out.println(resbundle.getString("optionCONTENTHANDLER")); //" [-CONTENTHANDLER full class name (ContentHandler to be used to serialize output)]");
- System.out.println(resbundle.getString("optionSECUREPROCESSING")); //" [-SECURE (set the secure processing feature to true)]");
-
- // J2SE does not support Xalan interpretive
- /*
- System.out.println("\n\t\t\t" + resbundle.getString("xslProc_xalan_options") + "\n");
-
- System.out.println(resbundle.getString("optionQC")); //" [-QC (Quiet Pattern Conflicts Warnings)]");
-
- // System.out.println(resbundle.getString("optionQ")); //" [-Q (Quiet Mode)]"); // sc 28-Feb-01 commented out
- System.out.println(resbundle.getString("optionTT")); //" [-TT (Trace the templates as they are being called.)]");
- System.out.println(resbundle.getString("optionTG")); //" [-TG (Trace each generation event.)]");
- System.out.println(resbundle.getString("optionTS")); //" [-TS (Trace each selection event.)]");
- System.out.println(resbundle.getString("optionTTC")); //" [-TTC (Trace the template children as they are being processed.)]");
- System.out.println(resbundle.getString("optionTCLASS")); //" [-TCLASS (TraceListener class for trace extensions.)]");
- System.out.println(resbundle.getString("optionLINENUMBERS")); //" [-L use line numbers]"
- System.out.println(resbundle.getString("optionINCREMENTAL"));
- System.out.println(resbundle.getString("optionNOOPTIMIMIZE"));
- System.out.println(resbundle.getString("optionRL"));
- */
-
- System.out.println("\n\t\t\t" + resbundle.getString("xslProc_xsltc_options") + "\n");
- System.out.println(resbundle.getString("optionXO"));
- waitForReturnKey(resbundle);
- System.out.println(resbundle.getString("optionXD"));
- System.out.println(resbundle.getString("optionXJ"));
- System.out.println(resbundle.getString("optionXP"));
- System.out.println(resbundle.getString("optionXN"));
- System.out.println(resbundle.getString("optionXX"));
- System.out.println(resbundle.getString("optionXT"));
- }
-
- /**
- * Command line interface to transform an XML document according to
- * the instructions found in an XSL stylesheet.
- * <p>The Process class provides basic functionality for
- * performing transformations from the command line. To see a
- * list of arguments supported, call with zero arguments.</p>
- * <p>To set stylesheet parameters from the command line, use
- * <code>-PARAM name expression</code>. If you want to set the
- * parameter to a string value, simply pass the string value
- * as-is, and it will be interpreted as a string. (Note: if
- * the value has spaces in it, you may need to quote it depending
- * on your shell environment).</p>
- *
- * @param argv Input parameters from command line
- */
- // J2SE does not support Xalan interpretive
- // main -> _main
- public static void _main(String argv[])
- {
-
- // Runtime.getRuntime().traceMethodCalls(false); // turns Java tracing off
- boolean doStackDumpOnError = false;
- boolean setQuietMode = false;
- boolean doDiag = false;
- String msg = null;
- boolean isSecureProcessing = false;
-
- // Runtime.getRuntime().traceMethodCalls(false);
- // Runtime.getRuntime().traceInstructions(false);
-
- /**
- * The default diagnostic writer...
- */
- java.io.PrintWriter diagnosticsWriter = new PrintWriter(System.err, true);
- java.io.PrintWriter dumpWriter = diagnosticsWriter;
- ResourceBundle resbundle =
- (SecuritySupport.getResourceBundle(
- com.sun.org.apache.xml.internal.utils.res.XResourceBundle.ERROR_RESOURCES));
- String flavor = "s2s";
-
- if (argv.length < 1)
- {
- printArgOptions(resbundle);
- }
- else
- {
- // J2SE does not support Xalan interpretive
- // false -> true
- boolean useXSLTC = true;
- for (int i = 0; i < argv.length; i++)
- {
- if ("-XSLTC".equalsIgnoreCase(argv[i]))
- {
- useXSLTC = true;
- }
- }
-
- TransformerFactory tfactory;
- if (useXSLTC)
- {
- String key = "javax.xml.transform.TransformerFactory";
- String value = "com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl";
- Properties props = System.getProperties();
- props.put(key, value);
- System.setProperties(props);
- }
-
- try
- {
- tfactory = TransformerFactory.newInstance();
- tfactory.setErrorListener(new DefaultErrorHandler());
- }
- catch (TransformerFactoryConfigurationError pfe)
- {
- pfe.printStackTrace(dumpWriter);
-// "XSL Process was not successful.");
- msg = XSLMessages.createMessage(
- XSLTErrorResources.ER_NOT_SUCCESSFUL, null);
- diagnosticsWriter.println(msg);
-
- tfactory = null; // shut up compiler
-
- doExit(msg);
- }
-
- boolean formatOutput = false;
- boolean useSourceLocation = false;
- String inFileName = null;
- String outFileName = null;
- String dumpFileName = null;
- String xslFileName = null;
- String treedumpFileName = null;
- // J2SE does not support Xalan interpretive
- /*
- PrintTraceListener tracer = null;
- */
- String outputType = null;
- String media = null;
- Vector params = new Vector();
- boolean quietConflictWarnings = false;
- URIResolver uriResolver = null;
- EntityResolver entityResolver = null;
- ContentHandler contentHandler = null;
- int recursionLimit=-1;
-
- for (int i = 0; i < argv.length; i++)
- {
- if ("-XSLTC".equalsIgnoreCase(argv[i]))
- {
- // The -XSLTC option has been processed.
- }
- // J2SE does not support Xalan interpretive
- /*
- else if ("-TT".equalsIgnoreCase(argv[i]))
- {
- if (!useXSLTC)
- {
- if (null == tracer)
- tracer = new PrintTraceListener(diagnosticsWriter);
-
- tracer.m_traceTemplates = true;
- }
- else
- printInvalidXSLTCOption("-TT");
-
- // tfactory.setTraceTemplates(true);
- }
- else if ("-TG".equalsIgnoreCase(argv[i]))
- {
- if (!useXSLTC)
- {
- if (null == tracer)
- tracer = new PrintTraceListener(diagnosticsWriter);
-
- tracer.m_traceGeneration = true;
- }
- else
- printInvalidXSLTCOption("-TG");
-
- // tfactory.setTraceSelect(true);
- }
- else if ("-TS".equalsIgnoreCase(argv[i]))
- {
- if (!useXSLTC)
- {
- if (null == tracer)
- tracer = new PrintTraceListener(diagnosticsWriter);
-
- tracer.m_traceSelection = true;
- }
- else
- printInvalidXSLTCOption("-TS");
-
- // tfactory.setTraceTemplates(true);
- }
- else if ("-TTC".equalsIgnoreCase(argv[i]))
- {
- if (!useXSLTC)
- {
- if (null == tracer)
- tracer = new PrintTraceListener(diagnosticsWriter);
-
- tracer.m_traceElements = true;
- }
- else
- printInvalidXSLTCOption("-TTC");
-
- // tfactory.setTraceTemplateChildren(true);
- }
- */
- else if ("-INDENT".equalsIgnoreCase(argv[i]))
- {
- int indentAmount;
-
- if (((i + 1) < argv.length) && (argv[i + 1].charAt(0) != '-'))
- {
- indentAmount = Integer.parseInt(argv[++i]);
- }
- else
- {
- indentAmount = 0;
- }
-
- // TBD:
- // xmlProcessorLiaison.setIndent(indentAmount);
- }
- else if ("-IN".equalsIgnoreCase(argv[i]))
- {
- if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-')
- inFileName = argv[++i];
- else
- System.err.println(
- XSLMessages.createMessage(
- XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION,
- new Object[]{ "-IN" })); //"Missing argument for);
- }
- else if ("-MEDIA".equalsIgnoreCase(argv[i]))
- {
- if (i + 1 < argv.length)
- media = argv[++i];
- else
- System.err.println(
- XSLMessages.createMessage(
- XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION,
- new Object[]{ "-MEDIA" })); //"Missing argument for);
- }
- else if ("-OUT".equalsIgnoreCase(argv[i]))
- {
- if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-')
- outFileName = argv[++i];
- else
- System.err.println(
- XSLMessages.createMessage(
- XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION,
- new Object[]{ "-OUT" })); //"Missing argument for);
- }
- else if ("-XSL".equalsIgnoreCase(argv[i]))
- {
- if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-')
- xslFileName = argv[++i];
- else
- System.err.println(
- XSLMessages.createMessage(
- XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION,
- new Object[]{ "-XSL" })); //"Missing argument for);
- }
- else if ("-FLAVOR".equalsIgnoreCase(argv[i]))
- {
- if (i + 1 < argv.length)
- {
- flavor = argv[++i];
- }
- else
- System.err.println(
- XSLMessages.createMessage(
- XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION,
- new Object[]{ "-FLAVOR" })); //"Missing argument for);
- }
- else if ("-PARAM".equalsIgnoreCase(argv[i]))
- {
- if (i + 2 < argv.length)
- {
- String name = argv[++i];
-
- params.addElement(name);
-
- String expression = argv[++i];
-
- params.addElement(expression);
- }
- else
- System.err.println(
- XSLMessages.createMessage(
- XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION,
- new Object[]{ "-PARAM" })); //"Missing argument for);
- }
- else if ("-E".equalsIgnoreCase(argv[i]))
- {
-
- // TBD:
- // xmlProcessorLiaison.setShouldExpandEntityRefs(false);
- }
- else if ("-V".equalsIgnoreCase(argv[i]))
- {
- diagnosticsWriter.println(resbundle.getString("version") //">>>>>>> Xalan Version "
- + Version.getVersion() + ", " +
-
- /* xmlProcessorLiaison.getParserDescription()+ */
- resbundle.getString("version2")); // "<<<<<<<");
- }
- // J2SE does not support Xalan interpretive
- /*
- else if ("-QC".equalsIgnoreCase(argv[i]))
- {
- if (!useXSLTC)
- quietConflictWarnings = true;
- else
- printInvalidXSLTCOption("-QC");
- }
- */
- else if ("-Q".equalsIgnoreCase(argv[i]))
- {
- setQuietMode = true;
- }
- else if ("-DIAG".equalsIgnoreCase(argv[i]))
- {
- doDiag = true;
- }
- else if ("-XML".equalsIgnoreCase(argv[i]))
- {
- outputType = "xml";
- }
- else if ("-TEXT".equalsIgnoreCase(argv[i]))
- {
- outputType = "text";
- }
- else if ("-HTML".equalsIgnoreCase(argv[i]))
- {
- outputType = "html";
- }
- else if ("-EDUMP".equalsIgnoreCase(argv[i]))
- {
- doStackDumpOnError = true;
-
- if (((i + 1) < argv.length) && (argv[i + 1].charAt(0) != '-'))
- {
- dumpFileName = argv[++i];
- }
- }
- else if ("-URIRESOLVER".equalsIgnoreCase(argv[i]))
- {
- if (i + 1 < argv.length)
- {
- try
- {
- uriResolver = (URIResolver) ObjectFactory.newInstance(argv[++i], true);
-
- tfactory.setURIResolver(uriResolver);
- }
- catch (ConfigurationError cnfe)
- {
- msg = XSLMessages.createMessage(
- XSLTErrorResources.ER_CLASS_NOT_FOUND_FOR_OPTION,
- new Object[]{ "-URIResolver" });
- System.err.println(msg);
- doExit(msg);
- }
- }
- else
- {
- msg = XSLMessages.createMessage(
- XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION,
- new Object[]{ "-URIResolver" }); //"Missing argument for);
- System.err.println(msg);
- doExit(msg);
- }
- }
- else if ("-ENTITYRESOLVER".equalsIgnoreCase(argv[i]))
- {
- if (i + 1 < argv.length)
- {
- try
- {
- entityResolver = (EntityResolver) ObjectFactory.newInstance(argv[++i], true);
- }
- catch (ConfigurationError cnfe)
- {
- msg = XSLMessages.createMessage(
- XSLTErrorResources.ER_CLASS_NOT_FOUND_FOR_OPTION,
- new Object[]{ "-EntityResolver" });
- System.err.println(msg);
- doExit(msg);
- }
- }
- else
- {
-// "Missing argument for);
- msg = XSLMessages.createMessage(
- XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION,
- new Object[]{ "-EntityResolver" });
- System.err.println(msg);
- doExit(msg);
- }
- }
- else if ("-CONTENTHANDLER".equalsIgnoreCase(argv[i]))
- {
- if (i + 1 < argv.length)
- {
- try
- {
- contentHandler = (ContentHandler) ObjectFactory.newInstance(argv[++i], true);
- }
- catch (ConfigurationError cnfe)
- {
- msg = XSLMessages.createMessage(
- XSLTErrorResources.ER_CLASS_NOT_FOUND_FOR_OPTION,
- new Object[]{ "-ContentHandler" });
- System.err.println(msg);
- doExit(msg);
- }
- }
- else
- {
-// "Missing argument for);
- msg = XSLMessages.createMessage(
- XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION,
- new Object[]{ "-ContentHandler" });
- System.err.println(msg);
- doExit(msg);
- }
- }
- // J2SE does not support Xalan interpretive
- /*
- else if ("-L".equalsIgnoreCase(argv[i]))
- {
- if (!useXSLTC)
- tfactory.setAttribute(XalanProperties.SOURCE_LOCATION, Boolean.TRUE);
- else
- printInvalidXSLTCOption("-L");
- }
- else if ("-INCREMENTAL".equalsIgnoreCase(argv[i]))
- {
- if (!useXSLTC)
- tfactory.setAttribute
- ("http://xml.apache.org/xalan/features/incremental",
- java.lang.Boolean.TRUE);
- else
- printInvalidXSLTCOption("-INCREMENTAL");
- }
- else if ("-NOOPTIMIZE".equalsIgnoreCase(argv[i]))
- {
- // Default is true.
- //
- // %REVIEW% We should have a generalized syntax for negative
- // switches... and probably should accept the inverse even
- // if it is the default.
- if (!useXSLTC)
- tfactory.setAttribute
- ("http://xml.apache.org/xalan/features/optimize",
- java.lang.Boolean.FALSE);
- else
- printInvalidXSLTCOption("-NOOPTIMIZE");
- }
- else if ("-RL".equalsIgnoreCase(argv[i]))
- {
- if (!useXSLTC)
- {
- if (i + 1 < argv.length)
- recursionLimit = Integer.parseInt(argv[++i]);
- else
- System.err.println(
- XSLMessages.createMessage(
- XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION,
- new Object[]{ "-rl" })); //"Missing argument for);
- }
- else
- {
- if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-')
- i++;
-
- printInvalidXSLTCOption("-RL");
- }
- }
- */
- // Generate the translet class and optionally specify the name
- // of the translet class.
- else if ("-XO".equalsIgnoreCase(argv[i]))
- {
- if (useXSLTC)
- {
- if (i + 1 < argv.length && argv[i+1].charAt(0) != '-')
- {
- tfactory.setAttribute("generate-translet", "true");
- tfactory.setAttribute("translet-name", argv[++i]);
- }
- else
- tfactory.setAttribute("generate-translet", "true");
- }
- else
- {
- if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-')
- i++;
- printInvalidXalanOption("-XO");
- }
- }
- // Specify the destination directory for the translet classes.
- else if ("-XD".equalsIgnoreCase(argv[i]))
- {
- if (useXSLTC)
- {
- if (i + 1 < argv.length && argv[i+1].charAt(0) != '-')
- tfactory.setAttribute("destination-directory", argv[++i]);
- else
- System.err.println(
- XSLMessages.createMessage(
- XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION,
- new Object[]{ "-XD" })); //"Missing argument for);
-
- }
- else
- {
- if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-')
- i++;
-
- printInvalidXalanOption("-XD");
- }
- }
- // Specify the jar file name which the translet classes are packaged into.
- else if ("-XJ".equalsIgnoreCase(argv[i]))
- {
- if (useXSLTC)
- {
- if (i + 1 < argv.length && argv[i+1].charAt(0) != '-')
- {
- tfactory.setAttribute("generate-translet", "true");
- tfactory.setAttribute("jar-name", argv[++i]);
- }
- else
- System.err.println(
- XSLMessages.createMessage(
- XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION,
- new Object[]{ "-XJ" })); //"Missing argument for);
- }
- else
- {
- if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-')
- i++;
-
- printInvalidXalanOption("-XJ");
- }
-
- }
- // Specify the package name prefix for the generated translet classes.
- else if ("-XP".equalsIgnoreCase(argv[i]))
- {
- if (useXSLTC)
- {
- if (i + 1 < argv.length && argv[i+1].charAt(0) != '-')
- tfactory.setAttribute("package-name", argv[++i]);
- else
- System.err.println(
- XSLMessages.createMessage(
- XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION,
- new Object[]{ "-XP" })); //"Missing argument for);
- }
- else
- {
- if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-')
- i++;
-
- printInvalidXalanOption("-XP");
- }
-
- }
- // Enable template inlining.
- else if ("-XN".equalsIgnoreCase(argv[i]))
- {
- if (useXSLTC)
- {
- tfactory.setAttribute("enable-inlining", "true");
- }
- else
- printInvalidXalanOption("-XN");
- }
- // Turns on additional debugging message output
- else if ("-XX".equalsIgnoreCase(argv[i]))
- {
- if (useXSLTC)
- {
- tfactory.setAttribute("debug", "true");
- }
- else
- printInvalidXalanOption("-XX");
- }
- // Create the Transformer from the translet if the translet class is newer
- // than the stylesheet.
- else if ("-XT".equalsIgnoreCase(argv[i]))
- {
- if (useXSLTC)
- {
- tfactory.setAttribute("auto-translet", "true");
- }
- else
- printInvalidXalanOption("-XT");
- }
- else if ("-SECURE".equalsIgnoreCase(argv[i]))
- {
- isSecureProcessing = true;
- try
- {
- tfactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
- }
- catch (TransformerConfigurationException e) {}
- }
- else
- System.err.println(
- XSLMessages.createMessage(
- XSLTErrorResources.ER_INVALID_OPTION, new Object[]{ argv[i] })); //"Invalid argument:);
- }
-
- // Print usage instructions if no xml and xsl file is specified in the command line
- if (inFileName == null && xslFileName == null)
- {
- msg = resbundle.getString("xslProc_no_input");
- System.err.println(msg);
- doExit(msg);
- }
-
- // Note that there are usage cases for calling us without a -IN arg
- // The main XSL transformation occurs here!
- try
- {
- long start = System.currentTimeMillis();
-
- if (null != dumpFileName)
- {
- dumpWriter = new PrintWriter(new FileWriter(dumpFileName));
- }
-
- Templates stylesheet = null;
-
- if (null != xslFileName)
- {
- if (flavor.equals("d2d"))
- {
-
- // Parse in the xml data into a DOM
- DocumentBuilderFactory dfactory =
- DocumentBuilderFactory.newInstance();
-
- dfactory.setNamespaceAware(true);
-
- if (isSecureProcessing)
- {
- try
- {
- dfactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
- }
- catch (ParserConfigurationException pce) {}
- }
-
- DocumentBuilder docBuilder = dfactory.newDocumentBuilder();
- Node xslDOM = docBuilder.parse(new InputSource(xslFileName));
-
- stylesheet = tfactory.newTemplates(new DOMSource(xslDOM,
- xslFileName));
- }
- else
- {
- // System.out.println("Calling newTemplates: "+xslFileName);
- stylesheet = tfactory.newTemplates(new StreamSource(xslFileName));
- // System.out.println("Done calling newTemplates: "+xslFileName);
- }
- }
-
- PrintWriter resultWriter;
- StreamResult strResult;
-
- if (null != outFileName)
- {
- strResult = new StreamResult(new FileOutputStream(outFileName));
- // One possible improvement might be to ensure this is
- // a valid URI before setting the systemId, but that
- // might have subtle changes that pre-existing users
- // might notice; we can think about that later -sc r1.46
- strResult.setSystemId(outFileName);
- }
- else
- {
- strResult = new StreamResult(System.out);
- // We used to default to incremental mode in this case.
- // We've since decided that since the -INCREMENTAL switch is
- // available, that default is probably not necessary nor
- // necessarily a good idea.
- }
-
- SAXTransformerFactory stf = (SAXTransformerFactory) tfactory;
-
- // J2SE does not support Xalan interpretive
- /*
- // This is currently controlled via TransformerFactoryImpl.
- if (!useXSLTC && useSourceLocation)
- stf.setAttribute(XalanProperties.SOURCE_LOCATION, Boolean.TRUE);
- */
-
- // Did they pass in a stylesheet, or should we get it from the
- // document?
- if (null == stylesheet)
- {
- Source source =
- stf.getAssociatedStylesheet(new StreamSource(inFileName), media,
- null, null);
-
- if (null != source)
- stylesheet = tfactory.newTemplates(source);
- else
- {
- if (null != media)
- throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_STYLESHEET_IN_MEDIA, new Object[]{inFileName, media})); //"No stylesheet found in: "
- // + inFileName + ", media="
- // + media);
- else
- throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_STYLESHEET_PI, new Object[]{inFileName})); //"No xml-stylesheet PI found in: "
- //+ inFileName);
- }
- }
-
- if (null != stylesheet)
- {
- Transformer transformer = flavor.equals("th") ? null : stylesheet.newTransformer();
- transformer.setErrorListener(new DefaultErrorHandler());
-
- // Override the output format?
- if (null != outputType)
- {
- transformer.setOutputProperty(OutputKeys.METHOD, outputType);
- }
-
- // J2SE does not support Xalan interpretive
- /*
- if (transformer instanceof com.sun.org.apache.xalan.internal.transformer.TransformerImpl)
- {
- com.sun.org.apache.xalan.internal.transformer.TransformerImpl impl = (com.sun.org.apache.xalan.internal.transformer.TransformerImpl)transformer;
- TraceManager tm = impl.getTraceManager();
-
- if (null != tracer)
- tm.addTraceListener(tracer);
-
- impl.setQuietConflictWarnings(quietConflictWarnings);
-
- // This is currently controlled via TransformerFactoryImpl.
- if (useSourceLocation)
- impl.setProperty(XalanProperties.SOURCE_LOCATION, Boolean.TRUE);
-
- if(recursionLimit>0)
- impl.setRecursionLimit(recursionLimit);
-
- // sc 28-Feb-01 if we re-implement this, please uncomment helpmsg in printArgOptions
- // impl.setDiagnosticsOutput( setQuietMode ? null : diagnosticsWriter );
- }
- */
-
- int nParams = params.size();
-
- for (int i = 0; i < nParams; i += 2)
- {
- transformer.setParameter((String) params.elementAt(i),
- (String) params.elementAt(i + 1));
- }
-
- if (uriResolver != null)
- transformer.setURIResolver(uriResolver);
-
- if (null != inFileName)
- {
- if (flavor.equals("d2d"))
- {
-
- // Parse in the xml data into a DOM
- DocumentBuilderFactory dfactory =
- DocumentBuilderFactory.newInstance();
-
- dfactory.setCoalescing(true);
- dfactory.setNamespaceAware(true);
-
- if (isSecureProcessing)
- {
- try
- {
- dfactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
- }
- catch (ParserConfigurationException pce) {}
- }
-
- DocumentBuilder docBuilder = dfactory.newDocumentBuilder();
-
- if (entityResolver != null)
- docBuilder.setEntityResolver(entityResolver);
-
- Node xmlDoc = docBuilder.parse(new InputSource(inFileName));
- Document doc = docBuilder.newDocument();
- org.w3c.dom.DocumentFragment outNode =
- doc.createDocumentFragment();
-
- transformer.transform(new DOMSource(xmlDoc, inFileName),
- new DOMResult(outNode));
-
- // Now serialize output to disk with identity transformer
- Transformer serializer = stf.newTransformer();
- serializer.setErrorListener(new DefaultErrorHandler());
-
- Properties serializationProps =
- stylesheet.getOutputProperties();
-
- serializer.setOutputProperties(serializationProps);
-
- if (contentHandler != null)
- {
- SAXResult result = new SAXResult(contentHandler);
-
- serializer.transform(new DOMSource(outNode), result);
- }
- else
- serializer.transform(new DOMSource(outNode), strResult);
- }
- else if (flavor.equals("th"))
- {
- for (int i = 0; i < 1; i++) // Loop for diagnosing bugs with inconsistent behavior
- {
- // System.out.println("Testing the TransformerHandler...");
-
- XMLReader reader = null;
-
- // Use JAXP1.1 ( if possible )
- try
- {
- javax.xml.parsers.SAXParserFactory factory =
- javax.xml.parsers.SAXParserFactory.newInstance();
-
- factory.setNamespaceAware(true);
-
- if (isSecureProcessing)
- {
- try
- {
- factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
- }
- catch (org.xml.sax.SAXException se) {}
- }
-
- javax.xml.parsers.SAXParser jaxpParser =
- factory.newSAXParser();
-
- reader = jaxpParser.getXMLReader();
- }
- catch (javax.xml.parsers.ParserConfigurationException ex)
- {
- throw new org.xml.sax.SAXException(ex);
- }
- catch (javax.xml.parsers.FactoryConfigurationError ex1)
- {
- throw new org.xml.sax.SAXException(ex1.toString());
- }
- catch (NoSuchMethodError ex2){}
- catch (AbstractMethodError ame){}
-
- if (null == reader)
- {
- reader = XMLReaderFactory.createXMLReader();
- }
-
- // J2SE does not support Xalan interpretive
- /*
- if (!useXSLTC)
- stf.setAttribute(com.sun.org.apache.xalan.internal.processor.TransformerFactoryImpl.FEATURE_INCREMENTAL,
- Boolean.TRUE);
- */
-
- TransformerHandler th = stf.newTransformerHandler(stylesheet);
-
- reader.setContentHandler(th);
- reader.setDTDHandler(th);
-
- if(th instanceof org.xml.sax.ErrorHandler)
- reader.setErrorHandler((org.xml.sax.ErrorHandler)th);
-
- try
- {
- reader.setProperty(
- "http://xml.org/sax/properties/lexical-handler", th);
- }
- catch (org.xml.sax.SAXNotRecognizedException e){}
- catch (org.xml.sax.SAXNotSupportedException e){}
- try
- {
- reader.setFeature("http://xml.org/sax/features/namespace-prefixes",
- true);
- } catch (org.xml.sax.SAXException se) {}
-
- th.setResult(strResult);
-
- reader.parse(new InputSource(inFileName));
- }
- }
- else
- {
- if (entityResolver != null)
- {
- XMLReader reader = null;
-
- // Use JAXP1.1 ( if possible )
- try
- {
- javax.xml.parsers.SAXParserFactory factory =
- javax.xml.parsers.SAXParserFactory.newInstance();
-
- factory.setNamespaceAware(true);
-
- if (isSecureProcessing)
- {
- try
- {
- factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
- }
- catch (org.xml.sax.SAXException se) {}
- }
-
- javax.xml.parsers.SAXParser jaxpParser =
- factory.newSAXParser();
-
- reader = jaxpParser.getXMLReader();
- }
- catch (javax.xml.parsers.ParserConfigurationException ex)
- {
- throw new org.xml.sax.SAXException(ex);
- }
- catch (javax.xml.parsers.FactoryConfigurationError ex1)
- {
- throw new org.xml.sax.SAXException(ex1.toString());
- }
- catch (NoSuchMethodError ex2){}
- catch (AbstractMethodError ame){}
-
- if (null == reader)
- {
- reader = XMLReaderFactory.createXMLReader();
- }
-
- reader.setEntityResolver(entityResolver);
-
- if (contentHandler != null)
- {
- SAXResult result = new SAXResult(contentHandler);
-
- transformer.transform(
- new SAXSource(reader, new InputSource(inFileName)),
- result);
- }
- else
- {
- transformer.transform(
- new SAXSource(reader, new InputSource(inFileName)),
- strResult);
- }
- }
- else if (contentHandler != null)
- {
- SAXResult result = new SAXResult(contentHandler);
-
- transformer.transform(new StreamSource(inFileName), result);
- }
- else
- {
- // System.out.println("Starting transform");
- transformer.transform(new StreamSource(inFileName),
- strResult);
- // System.out.println("Done with transform");
- }
- }
- }
- else
- {
- StringReader reader =
- new StringReader("<?xml version=\"1.0\"?> <doc/>");
-
- transformer.transform(new StreamSource(reader), strResult);
- }
- }
- else
- {
-// "XSL Process was not successful.");
- msg = XSLMessages.createMessage(
- XSLTErrorResources.ER_NOT_SUCCESSFUL, null);
- diagnosticsWriter.println(msg);
- doExit(msg);
- }
-
- // close output streams
- if (null != outFileName && strResult!=null)
- {
- java.io.OutputStream out = strResult.getOutputStream();
- java.io.Writer writer = strResult.getWriter();
- try
- {
- if (out != null) out.close();
- if (writer != null) writer.close();
- }
- catch(java.io.IOException ie) {}
- }
-
- long stop = System.currentTimeMillis();
- long millisecondsDuration = stop - start;
-
- if (doDiag)
- {
- Object[] msgArgs = new Object[]{ inFileName, xslFileName, new Long(millisecondsDuration) };
- msg = XSLMessages.createMessage("diagTiming", msgArgs);
- diagnosticsWriter.println('\n');
- diagnosticsWriter.println(msg);
- }
-
- }
- catch (Throwable throwable)
- {
- while (throwable
- instanceof com.sun.org.apache.xml.internal.utils.WrappedRuntimeException)
- {
- throwable =
- ((com.sun.org.apache.xml.internal.utils.WrappedRuntimeException) throwable).getException();
- }
-
- if ((throwable instanceof NullPointerException)
- || (throwable instanceof ClassCastException))
- doStackDumpOnError = true;
-
- diagnosticsWriter.println();
-
- if (doStackDumpOnError)
- throwable.printStackTrace(dumpWriter);
- else
- {
- DefaultErrorHandler.printLocation(diagnosticsWriter, throwable);
- diagnosticsWriter.println(
- XSLMessages.createMessage(XSLTErrorResources.ER_XSLT_ERROR, null)
- + " (" + throwable.getClass().getName() + "): "
- + throwable.getMessage());
- }
-
- // diagnosticsWriter.println(XSLMessages.createMessage(XSLTErrorResources.ER_NOT_SUCCESSFUL, null)); //"XSL Process was not successful.");
- if (null != dumpFileName)
- {
- dumpWriter.close();
- }
-
- doExit(throwable.getMessage());
- }
-
- if (null != dumpFileName)
- {
- dumpWriter.close();
- }
-
- if (null != diagnosticsWriter)
- {
-
- // diagnosticsWriter.close();
- }
-
- // if(!setQuietMode)
- // diagnosticsWriter.println(resbundle.getString("xsldone")); //"Xalan: done");
- // else
- // diagnosticsWriter.println(""); //"Xalan: done");
- }
- }
-
- /** It is _much_ easier to debug under VJ++ if I can set a single breakpoint
- * before this blows itself out of the water...
- * (I keep checking this in, it keeps vanishing. Grr!)
- * */
- static void doExit(String msg)
- {
- throw new RuntimeException(msg);
- }
-
- /**
- * Wait for a return key to continue
- *
- * @param resbundle The resource bundle
- */
- private static void waitForReturnKey(ResourceBundle resbundle)
- {
- System.out.println(resbundle.getString("xslProc_return_to_continue"));
- try
- {
- while (System.in.read() != '\n');
- }
- catch (java.io.IOException e) { }
- }
-
- /**
- * Print a message if an option cannot be used with -XSLTC.
- *
- * @param option The option String
- */
- private static void printInvalidXSLTCOption(String option)
- {
- System.err.println(XSLMessages.createMessage("xslProc_invalid_xsltc_option", new Object[]{option}));
- }
-
- /**
- * Print a message if an option can only be used with -XSLTC.
- *
- * @param option The option String
- */
- private static void printInvalidXalanOption(String option)
- {
- System.err.println(XSLMessages.createMessage("xslProc_invalid_xalan_option", new Object[]{option}));
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xslt/package.html b/src/com/sun/org/apache/xalan/internal/xslt/package.html
deleted file mode 100644
index 5915ebe..0000000
--- a/src/com/sun/org/apache/xalan/internal/xslt/package.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!--
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
--->
-<!--
- * Copyright 2000-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
--->
-<!-- $Id: package.html,v 1.2.4.1 2005/09/09 07:18:25 pvedula Exp $ -->
-<html>
- <title>Xalan command-line interface.</title>
- <body>
- <p>Implementation of Xalan command-line interface.<p>
- </body>
-</html>
-
-
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/CollatorFactory.java b/src/com/sun/org/apache/xalan/internal/xsltc/CollatorFactory.java
deleted file mode 100644
index a45c353..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/CollatorFactory.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: CollatorFactory.java,v 1.2.4.1 2005/08/31 10:16:33 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc;
-
-import java.text.Collator;
-import java.util.Locale;
-
-/**
- * @author W. Eliot Kimber (eliot@isogen.com)
- * @author Santiago Pericas-Geertsen
- */
-public interface CollatorFactory {
-
- public Collator getCollator(String lang, String country);
- public Collator getCollator(Locale locale);
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/DOM.java b/src/com/sun/org/apache/xalan/internal/xsltc/DOM.java
deleted file mode 100644
index 25ce372..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/DOM.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xalan.internal.xsltc;
-
-import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
-import com.sun.org.apache.xml.internal.serializer.SerializationHandler;
-import java.util.Map;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-public interface DOM {
- public final static int FIRST_TYPE = 0;
-
- public final static int NO_TYPE = -1;
-
- // 0 is reserved for NodeIterator.END
- public final static int NULL = 0;
-
- // used by some node iterators to know which node to return
- public final static int RETURN_CURRENT = 0;
- public final static int RETURN_PARENT = 1;
-
- // Constants used by getResultTreeFrag to indicate the types of the RTFs.
- public final static int SIMPLE_RTF = 0;
- public final static int ADAPTIVE_RTF = 1;
- public final static int TREE_RTF = 2;
-
- /** returns singleton iterator containg the document root */
- public DTMAxisIterator getIterator();
- public String getStringValue();
-
- public DTMAxisIterator getChildren(final int node);
- public DTMAxisIterator getTypedChildren(final int type);
- public DTMAxisIterator getAxisIterator(final int axis);
- public DTMAxisIterator getTypedAxisIterator(final int axis, final int type);
- public DTMAxisIterator getNthDescendant(int node, int n, boolean includeself);
- public DTMAxisIterator getNamespaceAxisIterator(final int axis, final int ns);
- public DTMAxisIterator getNodeValueIterator(DTMAxisIterator iter, int returnType,
- String value, boolean op);
- public DTMAxisIterator orderNodes(DTMAxisIterator source, int node);
- public String getNodeName(final int node);
- public String getNodeNameX(final int node);
- public String getNamespaceName(final int node);
- public int getExpandedTypeID(final int node);
- public int getNamespaceType(final int node);
- public int getParent(final int node);
- public int getAttributeNode(final int gType, final int element);
- public String getStringValueX(final int node);
- public void copy(final int node, SerializationHandler handler)
- throws TransletException;
- public void copy(DTMAxisIterator nodes, SerializationHandler handler)
- throws TransletException;
- public String shallowCopy(final int node, SerializationHandler handler)
- throws TransletException;
- public boolean lessThan(final int node1, final int node2);
- public void characters(final int textNode, SerializationHandler handler)
- throws TransletException;
- public Node makeNode(int index);
- public Node makeNode(DTMAxisIterator iter);
- public NodeList makeNodeList(int index);
- public NodeList makeNodeList(DTMAxisIterator iter);
- public String getLanguage(int node);
- public int getSize();
- public String getDocumentURI(int node);
- public void setFilter(StripFilter filter);
- public void setupMapping(String[] names, String[] urisArray, int[] typesArray, String[] namespaces);
- public boolean isElement(final int node);
- public boolean isAttribute(final int node);
- public String lookupNamespace(int node, String prefix)
- throws TransletException;
- public int getNodeIdent(final int nodehandle);
- public int getNodeHandle(final int nodeId);
- public DOM getResultTreeFrag(int initialSize, int rtfType);
- public DOM getResultTreeFrag(int initialSize, int rtfType, boolean addToDTMManager);
- public SerializationHandler getOutputDomBuilder();
- public int getNSType(int node);
- public int getDocument();
- public String getUnparsedEntityURI(String name);
- public Map<String, Integer> getElementsWithIDs();
- public void release();
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/DOMCache.java b/src/com/sun/org/apache/xalan/internal/xsltc/DOMCache.java
deleted file mode 100644
index 1a8efb1..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/DOMCache.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DOMCache.java,v 1.2.4.1 2005/08/31 10:23:55 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc;
-
-
-/**
- * @author Morten Jorgensen
- */
-public interface DOMCache {
-
- /**
- * This method is responsible for:
- *
- * (1) building the DOMImpl tree
- *
- * Parser _parser = new Parser();
- * DOMImpl _dom = new DOMImpl();
- * _parser.setDocumentHandler(_dom.getBuilder());
- * _parser.setDTDHandler(_dom.getBuilder());
- * _parser.parse(uri);
- *
- * (2) giving the translet an early opportunity to extract anything from
- * the DOMImpl that it would like
- *
- * translet.documentPrepass(_dom);
- *
- * (3) setting the document URI:
- *
- * _dom.setDocumentURI(uri);
- *
- * @param baseURI The base URI used by the document call.
- * @param href The href argument passed to the document function.
- * @param translet A reference to the translet requesting the document
- */
- public DOM retrieveDocument(String baseURI, String href, Translet translet);
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/DOMEnhancedForDTM.java b/src/com/sun/org/apache/xalan/internal/xsltc/DOMEnhancedForDTM.java
deleted file mode 100644
index f7e1b30..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/DOMEnhancedForDTM.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DOMEnhancedForDTM.java,v 1.2.4.1 2005/08/31 10:25:13 pvedula Exp $
- */
-package com.sun.org.apache.xalan.internal.xsltc;
-
-/**
- * Interface for SAXImpl which adds methods used at run-time, over and above
- * those provided by the XSLTC DOM interface. An attempt to avoid the current
- * "Is the DTM a DOM, if so is it a SAXImpl, . . .
- * which was producing some ugly replicated code
- * and introducing bugs where that multipathing had not been
- * done. This makes it easier to provide other DOM/DOMEnhancedForDTM
- * implementations, rather than hard-wiring XSLTC to SAXImpl.
- *
- * @author Joseph Kesselman
- *
- */
-public interface DOMEnhancedForDTM extends DOM {
- public short[] getMapping(String[] names, String[] uris, int[] types);
- public int[] getReverseMapping(String[] names, String[] uris, int[] types);
- public short[] getNamespaceMapping(String[] namespaces);
- public short[] getReverseNamespaceMapping(String[] namespaces);
- public String getDocumentURI();
- public void setDocumentURI(String uri);
- public int getExpandedTypeID2(int nodeHandle);
- public boolean hasDOMSource();
- public int getElementById(String idString);
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/NodeIterator.java b/src/com/sun/org/apache/xalan/internal/xsltc/NodeIterator.java
deleted file mode 100644
index 65039f4..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/NodeIterator.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: NodeIterator.java,v 1.2.4.1 2005/08/31 10:26:27 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-public interface NodeIterator extends Cloneable {
- public static final int END = DTM.NULL;
-
- /**
- * Callers should not call next() after it returns END.
- */
- public int next();
-
- /**
- * Resets the iterator to the last start node.
- */
- public NodeIterator reset();
-
- /**
- * Returns the number of elements in this iterator.
- */
- public int getLast();
-
- /**
- * Returns the position of the current node in the set.
- */
- public int getPosition();
-
- /**
- * Remembers the current node for the next call to gotoMark().
- */
- public void setMark();
-
- /**
- * Restores the current node remembered by setMark().
- */
- public void gotoMark();
-
- /**
- * Set start to END should 'close' the iterator,
- * i.e. subsequent call to next() should return END.
- */
- public NodeIterator setStartNode(int node);
-
- /**
- * True if this iterator has a reversed axis.
- */
- public boolean isReverse();
-
- /**
- * Returns a deep copy of this iterator.
- */
- public NodeIterator cloneIterator();
-
- /**
- * Prevents or allows iterator restarts.
- */
- public void setRestartable(boolean isRestartable);
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/ProcessorVersion.java b/src/com/sun/org/apache/xalan/internal/xsltc/ProcessorVersion.java
deleted file mode 100644
index f3d8e4d..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/ProcessorVersion.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ProcessorVersion.java,v 1.2.4.1 2005/08/31 10:30:36 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc;
-
-
-/**
- * Admin class that assigns a version number to the XSLTC software.
- * The version number is made up from three fields as in:
- * MAJOR.MINOR[.DELTA]. Fields are incremented based on the following:
- * DELTA field: changes for each bug fix, developer fixing the bug should
- * increment this field.
- * MINOR field: API changes or a milestone culminating from several
- * bug fixes. DELTA field goes to zero and MINOR is
- * incremented such as: {1.0,1.0.1,1.0.2,1.0.3,...1.0.18,1.1}
- * MAJOR field: milestone culminating in fundamental API changes or
- * architectural changes. MINOR field goes to zero
- * and MAJOR is incremented such as: {...,1.1.14,1.2,2.0}
- * Stability of a release follows: X.0 > X.X > X.X.X
- * @author G. Todd Miller
- */
-public class ProcessorVersion {
- private static int MAJOR = 1;
- private static int MINOR = 0;
- private static int DELTA = 0;
-
- public static void main(String[] args) {
- System.out.println("XSLTC version " + MAJOR + "." + MINOR +
- ((DELTA > 0) ? ("."+DELTA) : ("")));
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/StripFilter.java b/src/com/sun/org/apache/xalan/internal/xsltc/StripFilter.java
deleted file mode 100644
index ed5b878..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/StripFilter.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: StripFilter.java,v 1.2.4.1 2005/08/31 10:43:36 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc;
-
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-public interface StripFilter {
- public boolean stripSpace(DOM dom, int node, int type);
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/Translet.java b/src/com/sun/org/apache/xalan/internal/xsltc/Translet.java
deleted file mode 100644
index ca6ff50..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/Translet.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Translet.java,v 1.2.4.1 2005/08/31 10:46:27 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc;
-
-import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
-import com.sun.org.apache.xml.internal.serializer.SerializationHandler;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-public interface Translet {
-
- public void transform(DOM document, SerializationHandler handler)
- throws TransletException;
- public void transform(DOM document, SerializationHandler[] handlers)
- throws TransletException;
- public void transform(DOM document, DTMAxisIterator iterator,
- SerializationHandler handler)
- throws TransletException;
-
- public Object addParameter(String name, Object value);
-
- public void buildKeys(DOM document, DTMAxisIterator iterator,
- SerializationHandler handler, int root)
- throws TransletException;
- public void addAuxiliaryClass(Class auxClass);
- public Class getAuxiliaryClass(String className);
- public String[] getNamesArray();
- public String[] getUrisArray();
- public int[] getTypesArray();
- public String[] getNamespaceArray();
- public boolean useServicesMechnism();
- public void setServicesMechnism(boolean flag);
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/TransletException.java b/src/com/sun/org/apache/xalan/internal/xsltc/TransletException.java
deleted file mode 100644
index 19e12fe..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/TransletException.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: TransletException.java,v 1.2.4.1 2005/08/31 10:47:50 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc;
-
-import org.xml.sax.SAXException;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- */
-public final class TransletException extends SAXException {
- static final long serialVersionUID = -878916829521217293L;
-
- public TransletException() {
- super("Translet error");
- }
-
- public TransletException(Exception e) {
- super(e.toString());
- initCause(e);
- }
-
- public TransletException(String message) {
- super(message);
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/cmdline/Compile.java b/src/com/sun/org/apache/xalan/internal/xsltc/cmdline/Compile.java
deleted file mode 100644
index 9ab7e30..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/cmdline/Compile.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Compile.java,v 1.2.4.1 2005/08/31 11:24:13 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.cmdline;
-
-import com.sun.org.apache.xalan.internal.utils.FeatureManager;
-import java.io.File;
-import java.net.URL;
-import java.util.Vector;
-
-import com.sun.org.apache.xalan.internal.xsltc.cmdline.getopt.GetOpt;
-import com.sun.org.apache.xalan.internal.xsltc.cmdline.getopt.GetOptsException;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author G. Todd Miller
- * @author Morten Jorgensen
- */
-public final class Compile {
-
- // Versioning numbers for the compiler -v option output
- private static int VERSION_MAJOR = 1;
- private static int VERSION_MINOR = 4;
- private static int VERSION_DELTA = 0;
-
-
-
- // This variable should be set to false to prevent any methods in this
- // class from calling System.exit(). As this is a command-line tool,
- // calling System.exit() is normally OK, but we also want to allow for
- // this class being used in other ways as well.
- private static boolean _allowExit = true;
-
-
- public static void printUsage() {
- System.err.println("XSLTC version " +
- VERSION_MAJOR + "." + VERSION_MINOR +
- ((VERSION_DELTA > 0) ? ("." + VERSION_DELTA) : ("")) + "\n" +
- new ErrorMsg(ErrorMsg.COMPILE_USAGE_STR));
- if (_allowExit) System.exit(-1);
- }
-
- /**
- * This method implements the command line compiler. See the USAGE_STRING
- * constant for a description. It may make sense to move the command-line
- * handling to a separate package (ie. make one xsltc.cmdline.Compiler
- * class that contains this main() method and one xsltc.cmdline.Transform
- * class that contains the DefaultRun stuff).
- */
- public static void main(String[] args) {
- try {
- boolean inputIsURL = false;
- boolean useStdIn = false;
- boolean classNameSet = false;
- final GetOpt getopt = new GetOpt(args, "o:d:j:p:uxhsinv");
- if (args.length < 1) printUsage();
-
- final XSLTC xsltc = new XSLTC(true, new FeatureManager());
- xsltc.init();
-
- int c;
- while ((c = getopt.getNextOption()) != -1) {
- switch(c) {
- case 'i':
- useStdIn = true;
- break;
- case 'o':
- xsltc.setClassName(getopt.getOptionArg());
- classNameSet = true;
- break;
- case 'd':
- xsltc.setDestDirectory(getopt.getOptionArg());
- break;
- case 'p':
- xsltc.setPackageName(getopt.getOptionArg());
- break;
- case 'j':
- xsltc.setJarFileName(getopt.getOptionArg());
- break;
- case 'x':
- xsltc.setDebug(true);
- break;
- case 'u':
- inputIsURL = true;
- break;
- case 's':
- _allowExit = false;
- break;
- case 'n':
- xsltc.setTemplateInlining(true); // used to be 'false'
- break;
- case 'v':
- // fall through to case h
- case 'h':
- default:
- printUsage();
- break;
- }
- }
-
- boolean compileOK;
-
- if (useStdIn) {
- if (!classNameSet) {
- System.err.println(new ErrorMsg(ErrorMsg.COMPILE_STDIN_ERR));
- if (_allowExit) System.exit(-1);
- }
- compileOK = xsltc.compile(System.in, xsltc.getClassName());
- }
- else {
- // Generate a vector containg URLs for all stylesheets specified
- final String[] stylesheetNames = getopt.getCmdArgs();
- final Vector stylesheetVector = new Vector();
- for (int i = 0; i < stylesheetNames.length; i++) {
- final String name = stylesheetNames[i];
- URL url;
- if (inputIsURL)
- url = new URL(name);
- else
- url = (new File(name)).toURI().toURL();
- stylesheetVector.addElement(url);
- }
- compileOK = xsltc.compile(stylesheetVector);
- }
-
- // Compile the stylesheet and output class/jar file(s)
- if (compileOK) {
- xsltc.printWarnings();
- if (xsltc.getJarFileName() != null) xsltc.outputToJar();
- if (_allowExit) System.exit(0);
- }
- else {
- xsltc.printWarnings();
- xsltc.printErrors();
- if (_allowExit) System.exit(-1);
- }
- }
- catch (GetOptsException ex) {
- System.err.println(ex);
- printUsage(); // exits with code '-1'
- }
- catch (Exception e) {
- e.printStackTrace();
- if (_allowExit) System.exit(-1);
- }
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/cmdline/Transform.java b/src/com/sun/org/apache/xalan/internal/xsltc/cmdline/Transform.java
deleted file mode 100644
index a81cd77..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/cmdline/Transform.java
+++ /dev/null
@@ -1,292 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Transform.java,v 1.2.4.1 2005/09/12 09:07:33 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.cmdline;
-
-import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
-import com.sun.org.apache.xalan.internal.xsltc.DOMEnhancedForDTM;
-import com.sun.org.apache.xalan.internal.xsltc.StripFilter;
-import com.sun.org.apache.xalan.internal.xsltc.TransletException;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.dom.DOMWSFilter;
-import com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.Constants;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.Parameter;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.output.TransletOutputHandlerFactory;
-import com.sun.org.apache.xml.internal.dtm.DTMWSFilter;
-import com.sun.org.apache.xml.internal.serializer.SerializationHandler;
-import java.io.FileNotFoundException;
-import java.net.MalformedURLException;
-import java.net.UnknownHostException;
-import java.util.Vector;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-import javax.xml.transform.sax.SAXSource;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author G. Todd Miller
- * @author Morten Jorgensen
- */
-final public class Transform {
-
- private SerializationHandler _handler;
-
- private String _fileName;
- private String _className;
- private String _jarFileSrc;
- private boolean _isJarFileSpecified = false;
- private Vector _params = null;
- private boolean _uri, _debug;
- private int _iterations;
-
- public Transform(String className, String fileName,
- boolean uri, boolean debug, int iterations) {
- _fileName = fileName;
- _className = className;
- _uri = uri;
- _debug = debug;
- _iterations = iterations;
- }
-
- public String getFileName(){return _fileName;}
- public String getClassName(){return _className;}
-
- public void setParameters(Vector params) {
- _params = params;
- }
-
- private void setJarFileInputSrc(boolean flag, String jarFile) {
- // TODO: at this time we do not do anything with this
- // information, attempts to add the jarfile to the CLASSPATH
- // were successful via System.setProperty, but the effects
- // were not visible to the running JVM. For now we add jarfile
- // to CLASSPATH in the wrapper script that calls this program.
- _isJarFileSpecified = flag;
- // TODO verify jarFile exists...
- _jarFileSrc = jarFile;
- }
-
- private void doTransform() {
- try {
- final Class clazz = ObjectFactory.findProviderClass(_className, true);
- final AbstractTranslet translet = (AbstractTranslet)clazz.newInstance();
- translet.postInitialization();
-
- // Create a SAX parser and get the XMLReader object it uses
- final SAXParserFactory factory = SAXParserFactory.newInstance();
- try {
- factory.setFeature(Constants.NAMESPACE_FEATURE,true);
- }
- catch (Exception e) {
- factory.setNamespaceAware(true);
- }
- final SAXParser parser = factory.newSAXParser();
- final XMLReader reader = parser.getXMLReader();
-
- // Set the DOM's DOM builder as the XMLReader's SAX2 content handler
- XSLTCDTMManager dtmManager =
- XSLTCDTMManager.createNewDTMManagerInstance();
-
- DTMWSFilter wsfilter;
- if (translet != null && translet instanceof StripFilter) {
- wsfilter = new DOMWSFilter(translet);
- } else {
- wsfilter = null;
- }
-
- final DOMEnhancedForDTM dom =
- (DOMEnhancedForDTM)dtmManager.getDTM(
- new SAXSource(reader, new InputSource(_fileName)),
- false, wsfilter, true, false, translet.hasIdCall());
-
- dom.setDocumentURI(_fileName);
- translet.prepassDocument(dom);
-
- // Pass global parameters
- int n = _params.size();
- for (int i = 0; i < n; i++) {
- Parameter param = (Parameter) _params.elementAt(i);
- translet.addParameter(param._name, param._value);
- }
-
- // Transform the document
- TransletOutputHandlerFactory tohFactory =
- TransletOutputHandlerFactory.newInstance();
- tohFactory.setOutputType(TransletOutputHandlerFactory.STREAM);
- tohFactory.setEncoding(translet._encoding);
- tohFactory.setOutputMethod(translet._method);
-
- if (_iterations == -1) {
- translet.transform(dom, tohFactory.getSerializationHandler());
- }
- else if (_iterations > 0) {
- long mm = System.currentTimeMillis();
- for (int i = 0; i < _iterations; i++) {
- translet.transform(dom,
- tohFactory.getSerializationHandler());
- }
- mm = System.currentTimeMillis() - mm;
-
- System.err.println("\n<!--");
- System.err.println(" transform = "
- + (((double) mm) / ((double) _iterations))
- + " ms");
- System.err.println(" throughput = "
- + (1000.0 / (((double) mm)
- / ((double) _iterations)))
- + " tps");
- System.err.println("-->");
- }
- }
- catch (TransletException e) {
- if (_debug) e.printStackTrace();
- System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+
- e.getMessage());
- }
- catch (RuntimeException e) {
- if (_debug) e.printStackTrace();
- System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+
- e.getMessage());
- }
- catch (FileNotFoundException e) {
- if (_debug) e.printStackTrace();
- ErrorMsg err = new ErrorMsg(ErrorMsg.FILE_NOT_FOUND_ERR, _fileName);
- System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+
- err.toString());
- }
- catch (MalformedURLException e) {
- if (_debug) e.printStackTrace();
- ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_URI_ERR, _fileName);
- System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+
- err.toString());
- }
- catch (ClassNotFoundException e) {
- if (_debug) e.printStackTrace();
- ErrorMsg err= new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR,_className);
- System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+
- err.toString());
- }
- catch (UnknownHostException e) {
- if (_debug) e.printStackTrace();
- ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_URI_ERR, _fileName);
- System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+
- err.toString());
- }
- catch (SAXException e) {
- Exception ex = e.getException();
- if (_debug) {
- if (ex != null) ex.printStackTrace();
- e.printStackTrace();
- }
- System.err.print(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY));
- if (ex != null)
- System.err.println(ex.getMessage());
- else
- System.err.println(e.getMessage());
- }
- catch (Exception e) {
- if (_debug) e.printStackTrace();
- System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+
- e.getMessage());
- }
- }
-
- public static void printUsage() {
- System.err.println(new ErrorMsg(ErrorMsg.TRANSFORM_USAGE_STR));
- }
-
- public static void main(String[] args) {
- try {
- if (args.length > 0) {
- int i;
- int iterations = -1;
- boolean uri = false, debug = false;
- boolean isJarFileSpecified = false;
- String jarFile = null;
-
- // Parse options starting with '-'
- for (i = 0; i < args.length && args[i].charAt(0) == '-'; i++) {
- if (args[i].equals("-u")) {
- uri = true;
- }
- else if (args[i].equals("-x")) {
- debug = true;
- }
- else if (args[i].equals("-j")) {
- isJarFileSpecified = true;
- jarFile = args[++i];
- }
- else if (args[i].equals("-n")) {
- try {
- iterations = Integer.parseInt(args[++i]);
- }
- catch (NumberFormatException e) {
- // ignore
- }
- }
- else {
- printUsage();
- }
- }
-
- // Enough arguments left ?
- if (args.length - i < 2) printUsage();
-
- // Get document file and class name
- Transform handler = new Transform(args[i+1], args[i], uri,
- debug, iterations);
- handler.setJarFileInputSrc(isJarFileSpecified, jarFile);
-
- // Parse stylesheet parameters
- Vector params = new Vector();
- for (i += 2; i < args.length; i++) {
- final int equal = args[i].indexOf('=');
- if (equal > 0) {
- final String name = args[i].substring(0, equal);
- final String value = args[i].substring(equal+1);
- params.addElement(new Parameter(name, value));
- }
- else {
- printUsage();
- }
- }
-
- if (i == args.length) {
- handler.setParameters(params);
- handler.doTransform();
- }
- } else {
- printUsage();
- }
- }
- catch (Exception e) {
- e.printStackTrace();
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/cmdline/getopt/GetOpt.java b/src/com/sun/org/apache/xalan/internal/xsltc/cmdline/getopt/GetOpt.java
deleted file mode 100644
index 3e537c9..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/cmdline/getopt/GetOpt.java
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: GetOpt.java,v 1.2.4.1 2005/08/31 11:46:04 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.cmdline.getopt;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-
-
-/**
-* GetOpt is a Java equivalent to the C getopt() library function
-* discussed in man page getopt(3C). It provides command line
-* parsing for Java applications. It supports the most rules of the
-* command line standard (see man page intro(1)) including stacked
-* options such as '-sxm' (which is equivalent to -s -x -m); it
-* handles special '--' option that signifies the end of options.
-* Additionally this implementation of getopt will check for
-* mandatory arguments to options such as in the case of
-* '-d <file>' it will throw a MissingOptArgException if the
-* option argument '<file>' is not included on the commandline.
-* getopt(3C) does not check for this.
- * @author G Todd Miller
-*/
-public class GetOpt{
- public GetOpt(String[] args, String optString){
- theOptions = new ArrayList();
- int currOptIndex = 0;
- theCmdArgs = new ArrayList();
- theOptionMatcher = new OptionMatcher(optString);
- // fill in the options list
- for(int i=0; i<args.length; i++){
- String token = args[i];
- int tokenLength = token.length();
- if(token.equals("--")){ // end of opts
- currOptIndex = i+1; // set index of first operand
- break; // end of options
- }
- else if(token.startsWith("-") && tokenLength == 2){
- // simple option token such as '-s' found
- theOptions.add(new Option(token.charAt(1)));
- }
- else if(token.startsWith("-") && tokenLength > 2){
- // stacked options found, such as '-shm'
- // iterate thru the tokens after the dash and
- // add them to theOptions list
- for(int j=1; j<tokenLength; j++){
- theOptions.add(new Option(token.charAt(j)));
- }
- }
- else if(!token.startsWith("-")){
- // case 1- there are not options stored yet therefore
- // this must be an command argument, not an option argument
- if(theOptions.size() == 0){
- currOptIndex = i;
- break; // stop processing options
- }
- else {
- // case 2-
- // there are options stored, check to see if
- // this arg belong to the last arg stored
- int indexoflast=0;
- indexoflast = theOptions.size()-1;
- Option op = (Option)theOptions.get(indexoflast);
- char opLetter = op.getArgLetter();
- if(!op.hasArg() && theOptionMatcher.hasArg(opLetter)){
- op.setArg(token);
- }
- else{
- // case 3 -
- // the last option stored does not take
- // an argument, so again, this argument
- // must be a command argument, not
- // an option argument
- currOptIndex = i;
- break; // end of options
- }
- }
- }// end option does not start with "-"
- } // end for args loop
-
- // attach an iterator to list of options
- theOptionsIterator = theOptions.listIterator();
-
- // options are done, now fill out cmd arg list with remaining args
- for(int i=currOptIndex; i<args.length; i++){
- String token = args[i];
- theCmdArgs.add(token);
- }
- }
-
-
- /**
- * debugging routine to print out all options collected
- */
- public void printOptions(){
- for(ListIterator it=theOptions.listIterator(); it.hasNext();){
- Option opt = (Option)it.next();
- System.out.print("OPT =" + opt.getArgLetter());
- String arg = opt.getArgument();
- if(arg != null){
- System.out.print(" " + arg);
- }
- System.out.println();
- }
- }
-
- /**
- * gets the next option found in the commandline. Distinguishes
- * between two bad cases, one case is when an illegal option
- * is found, and then other case is when an option takes an
- * argument but no argument was found for that option.
- * If the option found was not declared in the optString, then
- * an IllegalArgumentException will be thrown (case 1).
- * If the next option found has been declared to take an argument,
- * and no such argument exists, then a MissingOptArgException
- * is thrown (case 2).
- * @param none
- * @return int - the next option found.
- * @throws IllegalArgumentException, MissingOptArgException.
- */
- public int getNextOption() throws IllegalArgumentException,
- MissingOptArgException
- {
- int retval = -1;
- if(theOptionsIterator.hasNext()){
- theCurrentOption = (Option)theOptionsIterator.next();
- char c = theCurrentOption.getArgLetter();
- boolean shouldHaveArg = theOptionMatcher.hasArg(c);
- String arg = theCurrentOption.getArgument();
- if(!theOptionMatcher.match(c)) {
- ErrorMsg msg = new ErrorMsg(ErrorMsg.ILLEGAL_CMDLINE_OPTION_ERR,
- new Character(c));
- throw (new IllegalArgumentException(msg.toString()));
- }
- else if(shouldHaveArg && (arg == null)) {
- ErrorMsg msg = new ErrorMsg(ErrorMsg.CMDLINE_OPT_MISSING_ARG_ERR,
- new Character(c));
- throw (new MissingOptArgException(msg.toString()));
- }
- retval = c;
- }
- return retval;
- }
-
- /**
- * gets the argument for the current parsed option. For example,
- * in case of '-d <file>', if current option parsed is 'd' then
- * getOptionArg() would return '<file>'.
- * @return String - argument for current parsed option.
- * @param none
- */
- public String getOptionArg(){
- String retval = null;
- String tmp = theCurrentOption.getArgument();
- char c = theCurrentOption.getArgLetter();
- if(theOptionMatcher.hasArg(c)){
- retval = tmp;
- }
- return retval;
- }
-
- /**
- * gets list of the commandline arguments. For example, in command
- * such as 'cmd -s -d file file2 file3 file4' with the usage
- * 'cmd [-s] [-d <file>] <file>...', getCmdArgs() would return
- * the list {file2, file3, file4}.
- * @return String[] - list of command arguments that may appear
- * after options and option arguments.
- * @params none
- */
- public String[] getCmdArgs(){
- String[] retval = new String[theCmdArgs.size()];
- int i=0;
- for(ListIterator it=theCmdArgs.listIterator(); it.hasNext();){
- retval[i++] = (String)it.next();
- }
- return retval;
- }
-
-
- private Option theCurrentOption = null;
- private ListIterator theOptionsIterator;
- private List theOptions = null;
- private List theCmdArgs = null;
- private OptionMatcher theOptionMatcher = null;
-
- ///////////////////////////////////////////////////////////
- //
- // Inner Classes
- //
- ///////////////////////////////////////////////////////////
-
- // inner class to model an option
- class Option{
- private char theArgLetter;
- private String theArgument = null;
- public Option(char argLetter) { theArgLetter = argLetter; }
- public void setArg(String arg) {
- theArgument = arg;
- }
- public boolean hasArg() { return (theArgument != null); }
- public char getArgLetter() { return theArgLetter; }
- public String getArgument() { return theArgument; }
- } // end class Option
-
-
- // inner class to query optString for a possible option match,
- // and whether or not a given legal option takes an argument.
- //
- class OptionMatcher{
- public OptionMatcher(String optString){
- theOptString = optString;
- }
- public boolean match(char c){
- boolean retval = false;
- if(theOptString.indexOf(c) != -1){
- retval = true;
- }
- return retval;
- }
- public boolean hasArg(char c){
- boolean retval = false;
- int index = theOptString.indexOf(c)+1;
- if (index == theOptString.length()){
- // reached end of theOptString
- retval = false;
- }
- else if(theOptString.charAt(index) == ':'){
- retval = true;
- }
- return retval;
- }
- private String theOptString = null;
- } // end class OptionMatcher
-}// end class GetOpt
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/cmdline/getopt/GetOptsException.java b/src/com/sun/org/apache/xalan/internal/xsltc/cmdline/getopt/GetOptsException.java
deleted file mode 100644
index fac6089..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/cmdline/getopt/GetOptsException.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: GetOptsException.java,v 1.2.4.1 2005/08/31 11:47:06 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.cmdline.getopt;
-
-/**
- * @author G Todd Miller
- */
-public class GetOptsException extends Exception{
- static final long serialVersionUID = 8736874967183039804L;
- public GetOptsException(String msg){
- super(msg);
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/cmdline/getopt/IllegalArgumentException.java b/src/com/sun/org/apache/xalan/internal/xsltc/cmdline/getopt/IllegalArgumentException.java
deleted file mode 100644
index 932f61e..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/cmdline/getopt/IllegalArgumentException.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: IllegalArgumentException.java,v 1.2.4.1 2005/08/31 11:47:56 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.cmdline.getopt;
-
-
-class IllegalArgumentException extends GetOptsException{
- static final long serialVersionUID = 8642122427294793651L;
- public IllegalArgumentException(String msg){
- super(msg);
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/cmdline/getopt/MissingOptArgException.java b/src/com/sun/org/apache/xalan/internal/xsltc/cmdline/getopt/MissingOptArgException.java
deleted file mode 100644
index c5e99b6..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/cmdline/getopt/MissingOptArgException.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: MissingOptArgException.java,v 1.2.4.1 2005/08/31 11:49:21 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.cmdline.getopt;
-
-
-/**
- * @author G Todd Miller
- */
-class MissingOptArgException extends GetOptsException{
- static final long serialVersionUID = -1972471465394544822L;
- public MissingOptArgException(String msg){
- super(msg);
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/AbsoluteLocationPath.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/AbsoluteLocationPath.java
deleted file mode 100644
index 8bfe6cb..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/AbsoluteLocationPath.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: AbsoluteLocationPath.java,v 1.2.4.1 2005/09/12 09:44:03 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.ALOAD;
-import com.sun.org.apache.bcel.internal.generic.ASTORE;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
-import com.sun.org.apache.bcel.internal.generic.NEW;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-final class AbsoluteLocationPath extends Expression {
- private Expression _path; // may be null
-
- public AbsoluteLocationPath() {
- _path = null;
- }
-
- public AbsoluteLocationPath(Expression path) {
- _path = path;
- if (path != null) {
- _path.setParent(this);
- }
- }
-
- public void setParser(Parser parser) {
- super.setParser(parser);
- if (_path != null) {
- _path.setParser(parser);
- }
- }
-
- public Expression getPath() {
- return(_path);
- }
-
- public String toString() {
- return "AbsoluteLocationPath(" +
- (_path != null ? _path.toString() : "null") + ')';
- }
-
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- if (_path != null) {
- final Type ptype = _path.typeCheck(stable);
- if (ptype instanceof NodeType) { // promote to node-set
- _path = new CastExpr(_path, Type.NodeSet);
- }
- }
- return _type = Type.NodeSet;
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- if (_path != null) {
- final int initAI = cpg.addMethodref(ABSOLUTE_ITERATOR,
- "<init>",
- "("
- + NODE_ITERATOR_SIG
- + ")V");
-
- // Compile relative path iterator(s)
- //
- // Backwards branches are prohibited if an uninitialized object is
- // on the stack by section 4.9.4 of the JVM Specification, 2nd Ed.
- // We don't know whether this code might contain backwards branches,
- // so we mustn't create the new object until after we've created
- // this argument to its constructor. Instead we calculate the
- // value of the argument to the constructor first, store it in
- // a temporary variable, create the object and reload the argument
- // from the temporary to avoid the problem.
- _path.translate(classGen, methodGen);
- LocalVariableGen relPathIterator
- = methodGen.addLocalVariable("abs_location_path_tmp",
- Util.getJCRefType(NODE_ITERATOR_SIG),
- null, null);
- relPathIterator.setStart(
- il.append(new ASTORE(relPathIterator.getIndex())));
-
- // Create new AbsoluteIterator
- il.append(new NEW(cpg.addClass(ABSOLUTE_ITERATOR)));
- il.append(DUP);
- relPathIterator.setEnd(
- il.append(new ALOAD(relPathIterator.getIndex())));
-
- // Initialize AbsoluteIterator with iterator from the stack
- il.append(new INVOKESPECIAL(initAI));
- }
- else {
- final int gitr = cpg.addInterfaceMethodref(DOM_INTF,
- "getIterator",
- "()"+NODE_ITERATOR_SIG);
- il.append(methodGen.loadDOM());
- il.append(new INVOKEINTERFACE(gitr, 1));
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/AbsolutePathPattern.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/AbsolutePathPattern.java
deleted file mode 100644
index c25bae4..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/AbsolutePathPattern.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: AbsolutePathPattern.java,v 1.2.4.1 2005/09/01 09:17:09 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.BranchHandle;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.GOTO_W;
-import com.sun.org.apache.bcel.internal.generic.IF_ICMPEQ;
-import com.sun.org.apache.bcel.internal.generic.ILOAD;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.ISTORE;
-import com.sun.org.apache.bcel.internal.generic.InstructionHandle;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-import com.sun.org.apache.xml.internal.dtm.DTM;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-final class AbsolutePathPattern extends LocationPathPattern {
- private final RelativePathPattern _left; // may be null
-
- public AbsolutePathPattern(RelativePathPattern left) {
- _left = left;
- if (left != null) {
- left.setParent(this);
- }
- }
-
- public void setParser(Parser parser) {
- super.setParser(parser);
- if (_left != null)
- _left.setParser(parser);
- }
-
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- return _left == null ? Type.Root : _left.typeCheck(stable);
- }
-
- public boolean isWildcard() {
- return false;
- }
-
- public StepPattern getKernelPattern() {
- return _left != null ? _left.getKernelPattern() : null;
- }
-
- public void reduceKernelPattern() {
- _left.reduceKernelPattern();
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- if (_left != null) {
- if (_left instanceof StepPattern) {
- final LocalVariableGen local =
- // absolute path pattern temporary
- methodGen.addLocalVariable2("apptmp",
- Util.getJCRefType(NODE_SIG),
- null);
- il.append(DUP);
- local.setStart(il.append(new ISTORE(local.getIndex())));
- _left.translate(classGen, methodGen);
- il.append(methodGen.loadDOM());
- local.setEnd(il.append(new ILOAD(local.getIndex())));
- methodGen.removeLocalVariable(local);
- }
- else {
- _left.translate(classGen, methodGen);
- }
- }
-
- final int getParent = cpg.addInterfaceMethodref(DOM_INTF,
- GET_PARENT,
- GET_PARENT_SIG);
- final int getType = cpg.addInterfaceMethodref(DOM_INTF,
- "getExpandedTypeID",
- "(I)I");
-
- InstructionHandle begin = il.append(methodGen.loadDOM());
- il.append(SWAP);
- il.append(new INVOKEINTERFACE(getParent, 2));
- if (_left instanceof AncestorPattern) {
- il.append(methodGen.loadDOM());
- il.append(SWAP);
- }
- il.append(new INVOKEINTERFACE(getType, 2));
- il.append(new PUSH(cpg, DTM.DOCUMENT_NODE));
-
- final BranchHandle skip = il.append(new IF_ICMPEQ(null));
- _falseList.add(il.append(new GOTO_W(null)));
- skip.setTarget(il.append(NOP));
-
- if (_left != null) {
- _left.backPatchTrueList(begin);
-
- /*
- * If _left is an ancestor pattern, backpatch this pattern's false
- * list to the loop that searches for more ancestors.
- */
- if (_left instanceof AncestorPattern) {
- final AncestorPattern ancestor = (AncestorPattern) _left;
- _falseList.backPatch(ancestor.getLoopHandle()); // clears list
- }
- _falseList.append(_left._falseList);
- }
- }
-
- public String toString() {
- return "absolutePathPattern(" + (_left != null ? _left.toString() : ")");
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/AlternativePattern.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/AlternativePattern.java
deleted file mode 100644
index 7adcb48..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/AlternativePattern.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: AlternativePattern.java,v 1.2.4.1 2005/09/01 09:18:46 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.GOTO;
-import com.sun.org.apache.bcel.internal.generic.InstructionHandle;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-final class AlternativePattern extends Pattern {
- private final Pattern _left;
- private final Pattern _right;
-
- /**
- * Construct an alternative pattern. The method <code>setParent</code>
- * should not be called in this case.
- */
- public AlternativePattern(Pattern left, Pattern right) {
- _left = left;
- _right = right;
- }
-
- public void setParser(Parser parser) {
- super.setParser(parser);
- _left.setParser(parser);
- _right.setParser(parser);
- }
-
- public Pattern getLeft() {
- return _left;
- }
-
- public Pattern getRight() {
- return _right;
- }
-
- /**
- * The type of an '|' is not really defined, hence null is returned.
- */
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- _left.typeCheck(stable);
- _right.typeCheck(stable);
- return null;
- }
-
- public double getPriority() {
- double left = _left.getPriority();
- double right = _right.getPriority();
-
- if (left < right)
- return(left);
- else
- return(right);
- }
-
- public String toString() {
- return "alternative(" + _left + ", " + _right + ')';
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final InstructionList il = methodGen.getInstructionList();
-
- _left.translate(classGen, methodGen);
- final InstructionHandle gotot = il.append(new GOTO(null));
- il.append(methodGen.loadContextNode());
- _right.translate(classGen, methodGen);
-
- _left._trueList.backPatch(gotot);
- _left._falseList.backPatch(gotot.getNext());
-
- _trueList.append(_right._trueList.add(gotot));
- _falseList.append(_right._falseList);
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/AncestorPattern.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/AncestorPattern.java
deleted file mode 100644
index 10bfa7d..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/AncestorPattern.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: AncestorPattern.java,v 1.2.4.1 2005/09/01 09:19:41 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.BranchHandle;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.GOTO;
-import com.sun.org.apache.bcel.internal.generic.IFLT;
-import com.sun.org.apache.bcel.internal.generic.ILOAD;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.ISTORE;
-import com.sun.org.apache.bcel.internal.generic.InstructionHandle;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Erwin Bolwidt <ejb@klomp.org>
- */
-final class AncestorPattern extends RelativePathPattern {
-
- private final Pattern _left; // may be null
- private final RelativePathPattern _right;
- private InstructionHandle _loop;
-
- public AncestorPattern(RelativePathPattern right) {
- this(null, right);
- }
-
- public AncestorPattern(Pattern left, RelativePathPattern right) {
- _left = left;
- (_right = right).setParent(this);
- if (left != null) {
- left.setParent(this);
- }
- }
-
- public InstructionHandle getLoopHandle() {
- return _loop;
- }
-
- public void setParser(Parser parser) {
- super.setParser(parser);
- if (_left != null) {
- _left.setParser(parser);
- }
- _right.setParser(parser);
- }
-
- public boolean isWildcard() {
- //!!! can be wildcard
- return false;
- }
-
- public StepPattern getKernelPattern() {
- return _right.getKernelPattern();
- }
-
- public void reduceKernelPattern() {
- _right.reduceKernelPattern();
- }
-
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- if (_left != null) {
- _left.typeCheck(stable);
- }
- return _right.typeCheck(stable);
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- InstructionHandle parent;
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- /*
- * The scope of this local var must be the entire method since
- * a another pattern may decide to jump back into the loop
- */
- final LocalVariableGen local =
- methodGen.addLocalVariable2("app", Util.getJCRefType(NODE_SIG),
- il.getEnd());
-
- final com.sun.org.apache.bcel.internal.generic.Instruction loadLocal =
- new ILOAD(local.getIndex());
- final com.sun.org.apache.bcel.internal.generic.Instruction storeLocal =
- new ISTORE(local.getIndex());
-
- if (_right instanceof StepPattern) {
- il.append(DUP);
- il.append(storeLocal);
- _right.translate(classGen, methodGen);
- il.append(methodGen.loadDOM());
- il.append(loadLocal);
- }
- else {
- _right.translate(classGen, methodGen);
-
- if (_right instanceof AncestorPattern) {
- il.append(methodGen.loadDOM());
- il.append(SWAP);
- }
- }
-
- if (_left != null) {
- final int getParent = cpg.addInterfaceMethodref(DOM_INTF,
- GET_PARENT,
- GET_PARENT_SIG);
- parent = il.append(new INVOKEINTERFACE(getParent, 2));
-
- il.append(DUP);
- il.append(storeLocal);
- _falseList.add(il.append(new IFLT(null)));
- il.append(loadLocal);
-
- _left.translate(classGen, methodGen);
-
- final SyntaxTreeNode p = getParent();
- if (p == null || p instanceof Instruction ||
- p instanceof TopLevelElement)
- {
- // do nothing
- }
- else {
- il.append(loadLocal);
- }
-
- final BranchHandle exit = il.append(new GOTO(null));
- _loop = il.append(methodGen.loadDOM());
- il.append(loadLocal);
- local.setEnd(_loop);
- il.append(new GOTO(parent));
- exit.setTarget(il.append(NOP));
- _left.backPatchFalseList(_loop);
-
- _trueList.append(_left._trueList);
- }
- else {
- il.append(POP2);
- }
-
- /*
- * If _right is an ancestor pattern, backpatch this pattern's false
- * list to the loop that searches for more ancestors.
- */
- if (_right instanceof AncestorPattern) {
- final AncestorPattern ancestor = (AncestorPattern) _right;
- _falseList.backPatch(ancestor.getLoopHandle()); // clears list
- }
-
- _trueList.append(_right._trueList);
- _falseList.append(_right._falseList);
- }
-
- public String toString() {
- return "AncestorPattern(" + _left + ", " + _right + ')';
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ApplyImports.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ApplyImports.java
deleted file mode 100644
index ceba568..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ApplyImports.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ApplyImports.java,v 1.2.4.1 2005/09/13 12:22:02 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import java.util.Enumeration;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
-import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.NEW;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-
-final class ApplyImports extends Instruction {
-
- private QName _modeName;
- private int _precedence;
-
- public void display(int indent) {
- indent(indent);
- Util.println("ApplyTemplates");
- indent(indent + IndentIncrement);
- if (_modeName != null) {
- indent(indent + IndentIncrement);
- Util.println("mode " + _modeName);
- }
- }
-
- /**
- * Returns true if this <xsl:apply-imports/> element has parameters
- */
- public boolean hasWithParams() {
- return hasContents();
- }
-
- /**
- * Determine the lowest import precedence for any stylesheet imported
- * or included by the stylesheet in which this <xsl:apply-imports/>
- * element occured. The templates that are imported by the stylesheet in
- * which this element occured will all have higher import precedence than
- * the integer returned by this method.
- */
- private int getMinPrecedence(int max) {
- // Move to root of include tree
- Stylesheet includeRoot = getStylesheet();
- while (includeRoot._includedFrom != null) {
- includeRoot = includeRoot._includedFrom;
- }
-
- return includeRoot.getMinimumDescendantPrecedence();
- }
-
- /**
- * Parse the attributes and contents of an <xsl:apply-imports/> element.
- */
- public void parseContents(Parser parser) {
- // Indicate to the top-level stylesheet that all templates must be
- // compiled into separate methods.
- Stylesheet stylesheet = getStylesheet();
- stylesheet.setTemplateInlining(false);
-
- // Get the mode we are currently in (might not be any)
- Template template = getTemplate();
- _modeName = template.getModeName();
- _precedence = template.getImportPrecedence();
-
- // Get the method name for <xsl:apply-imports/> in this mode
- stylesheet = parser.getTopLevelStylesheet();
-
- parseChildren(parser); // with-params
- }
-
- /**
- * Type-check the attributes/contents of an <xsl:apply-imports/> element.
- */
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- typeCheckContents(stable); // with-params
- return Type.Void;
- }
-
- /**
- * Translate call-template. A parameter frame is pushed only if
- * some template in the stylesheet uses parameters.
- */
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final Stylesheet stylesheet = classGen.getStylesheet();
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- final int current = methodGen.getLocalIndex("current");
-
- // Push the arguments that are passed to applyTemplates()
- il.append(classGen.loadTranslet());
- il.append(methodGen.loadDOM());
- il.append(methodGen.loadIterator());
- il.append(methodGen.loadHandler());
- il.append(methodGen.loadCurrentNode());
-
- // Push a new parameter frame in case imported template might expect
- // parameters. The apply-imports has nothing that it can pass.
- if (stylesheet.hasLocalParams()) {
- il.append(classGen.loadTranslet());
- final int pushFrame = cpg.addMethodref(TRANSLET_CLASS,
- PUSH_PARAM_FRAME,
- PUSH_PARAM_FRAME_SIG);
- il.append(new INVOKEVIRTUAL(pushFrame));
- }
-
- // Get the [min,max> precedence of all templates imported under the
- // current stylesheet
- final int maxPrecedence = _precedence;
- final int minPrecedence = getMinPrecedence(maxPrecedence);
- final Mode mode = stylesheet.getMode(_modeName);
-
- // Get name of appropriate apply-templates function for this
- // xsl:apply-imports instruction
- String functionName = mode.functionName(minPrecedence, maxPrecedence);
-
- // Construct the translet class-name and the signature of the method
- final String className = classGen.getStylesheet().getClassName();
- final String signature = classGen.getApplyTemplatesSigForImport();
- final int applyTemplates = cpg.addMethodref(className,
- functionName,
- signature);
- il.append(new INVOKEVIRTUAL(applyTemplates));
-
- // Pop any parameter frame that was pushed above.
- if (stylesheet.hasLocalParams()) {
- il.append(classGen.loadTranslet());
- final int pushFrame = cpg.addMethodref(TRANSLET_CLASS,
- POP_PARAM_FRAME,
- POP_PARAM_FRAME_SIG);
- il.append(new INVOKEVIRTUAL(pushFrame));
- }
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ApplyTemplates.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ApplyTemplates.java
deleted file mode 100644
index d7bc1ca..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ApplyTemplates.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeSetType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ReferenceType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ResultTreeType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-import com.sun.org.apache.xml.internal.utils.XML11Char;
-import java.util.Iterator;
-import java.util.Vector;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-final class ApplyTemplates extends Instruction {
- private Expression _select;
- private Type _type = null;
- private QName _modeName;
- private String _functionName;
-
- public void display(int indent) {
- indent(indent);
- Util.println("ApplyTemplates");
- indent(indent + IndentIncrement);
- Util.println("select " + _select.toString());
- if (_modeName != null) {
- indent(indent + IndentIncrement);
- Util.println("mode " + _modeName);
- }
- }
-
- public boolean hasWithParams() {
- return hasContents();
- }
-
- public void parseContents(Parser parser) {
- final String select = getAttribute("select");
- final String mode = getAttribute("mode");
-
- if (select.length() > 0) {
- _select = parser.parseExpression(this, "select", null);
-
- }
-
- if (mode.length() > 0) {
- if (!XML11Char.isXML11ValidQName(mode)) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_QNAME_ERR, mode, this);
- parser.reportError(Constants.ERROR, err);
- }
- _modeName = parser.getQNameIgnoreDefaultNs(mode);
- }
-
- // instantiate Mode if needed, cache (apply temp) function name
- _functionName =
- parser.getTopLevelStylesheet().getMode(_modeName).functionName();
- parseChildren(parser);// with-params
- }
-
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- if (_select != null) {
- _type = _select.typeCheck(stable);
- if (_type instanceof NodeType || _type instanceof ReferenceType) {
- _select = new CastExpr(_select, Type.NodeSet);
- _type = Type.NodeSet;
- }
- if (_type instanceof NodeSetType||_type instanceof ResultTreeType) {
- typeCheckContents(stable); // with-params
- return Type.Void;
- }
- throw new TypeCheckError(this);
- }
- else {
- typeCheckContents(stable); // with-params
- return Type.Void;
- }
- }
-
- /**
- * Translate call-template. A parameter frame is pushed only if
- * some template in the stylesheet uses parameters.
- */
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- boolean setStartNodeCalled = false;
- final Stylesheet stylesheet = classGen.getStylesheet();
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- final int current = methodGen.getLocalIndex("current");
-
- // check if sorting nodes is required
- final Vector<Sort> sortObjects = new Vector<>();
- for (final SyntaxTreeNode child : getContents()) {
- if (child instanceof Sort) {
- sortObjects.addElement((Sort)child);
- }
- }
-
- // Push a new parameter frame
- if (stylesheet.hasLocalParams() || hasContents()) {
- il.append(classGen.loadTranslet());
- final int pushFrame = cpg.addMethodref(TRANSLET_CLASS,
- PUSH_PARAM_FRAME,
- PUSH_PARAM_FRAME_SIG);
- il.append(new INVOKEVIRTUAL(pushFrame));
- // translate with-params
- translateContents(classGen, methodGen);
- }
-
-
- il.append(classGen.loadTranslet());
-
- // The 'select' expression is a result-tree
- if ((_type != null) && (_type instanceof ResultTreeType)) {
- // <xsl:sort> cannot be applied to a result tree - issue warning
- if (sortObjects.size() > 0) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.RESULT_TREE_SORT_ERR,this);
- getParser().reportError(WARNING, err);
- }
- // Put the result tree (a DOM adapter) on the stack
- _select.translate(classGen, methodGen);
- // Get back the DOM and iterator (not just iterator!!!)
- _type.translateTo(classGen, methodGen, Type.NodeSet);
- }
- else {
- il.append(methodGen.loadDOM());
-
- // compute node iterator for applyTemplates
- if (sortObjects.size() > 0) {
- Sort.translateSortIterator(classGen, methodGen,
- _select, sortObjects);
- int setStartNode = cpg.addInterfaceMethodref(NODE_ITERATOR,
- SET_START_NODE,
- "(I)"+
- NODE_ITERATOR_SIG);
- il.append(methodGen.loadCurrentNode());
- il.append(new INVOKEINTERFACE(setStartNode,2));
- setStartNodeCalled = true;
- }
- else {
- if (_select == null)
- Mode.compileGetChildren(classGen, methodGen, current);
- else
- _select.translate(classGen, methodGen);
- }
- }
-
- if (_select != null && !setStartNodeCalled) {
- _select.startIterator(classGen, methodGen);
- }
-
- //!!! need to instantiate all needed modes
- final String className = classGen.getStylesheet().getClassName();
- il.append(methodGen.loadHandler());
- final String applyTemplatesSig = classGen.getApplyTemplatesSig();
- final int applyTemplates = cpg.addMethodref(className,
- _functionName,
- applyTemplatesSig);
- il.append(new INVOKEVIRTUAL(applyTemplates));
-
- // unmap parameters to release temporary result trees
- for (final SyntaxTreeNode child : getContents()) {
- if (child instanceof WithParam) {
- ((WithParam)child).releaseResultTree(classGen, methodGen);
- }
- }
-
- // Pop parameter frame
- if (stylesheet.hasLocalParams() || hasContents()) {
- il.append(classGen.loadTranslet());
- final int popFrame = cpg.addMethodref(TRANSLET_CLASS,
- POP_PARAM_FRAME,
- POP_PARAM_FRAME_SIG);
- il.append(new INVOKEVIRTUAL(popFrame));
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ArgumentList.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ArgumentList.java
deleted file mode 100644
index 6c1757c..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ArgumentList.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ArgumentList.java,v 1.2.4.1 2005/09/01 10:18:19 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-final class ArgumentList {
- private final Expression _arg;
- private final ArgumentList _rest;
-
- public ArgumentList(Expression arg, ArgumentList rest) {
- _arg = arg;
- _rest = rest;
- }
-
- public String toString() {
- return _rest == null
- ? _arg.toString()
- : _arg.toString() + ", " + _rest.toString();
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Attribute.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Attribute.java
deleted file mode 100644
index 25f6b56..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Attribute.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Attribute.java,v 1.2.4.1 2005/09/01 10:20:59 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-final class Attribute extends Instruction {
- private QName _name;
-
- public void display(int indent) {
- indent(indent);
- Util.println("Attribute " + _name);
- displayContents(indent + IndentIncrement);
- }
-
- public void parseContents(Parser parser) {
- _name = parser.getQName(getAttribute("name"));
- parseChildren(parser);
- //!!! add text nodes
- //!!! take care of value templates
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/AttributeSet.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/AttributeSet.java
deleted file mode 100644
index 2bbcaf6..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/AttributeSet.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: AttributeSet.java,v 1.5 2005/09/28 13:48:04 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.AttributeSetMethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-import com.sun.org.apache.xml.internal.utils.XML11Char;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- */
-final class AttributeSet extends TopLevelElement {
-
- // This prefix is used for the method name of attribute set methods
- private static final String AttributeSetPrefix = "$as$";
-
- // Element contents
- private QName _name;
- private UseAttributeSets _useSets;
- private AttributeSet _mergeSet;
- private String _method;
- private boolean _ignore = false;
-
- /**
- * Returns the QName of this attribute set
- */
- public QName getName() {
- return _name;
- }
-
- /**
- * Returns the method name of this attribute set. This method name is
- * generated by the compiler (XSLTC)
- */
- public String getMethodName() {
- return _method;
- }
-
- /**
- * Call this method to prevent a method for being compiled for this set.
- * This is used in case several <xsl:attribute-set...> elements constitute
- * a single set (with one name). The last element will merge itself with
- * any previous set(s) with the same name and disable the other set(s).
- */
- public void ignore() {
- _ignore = true;
- }
-
- /**
- * Parse the contents of this attribute set. Recognised attributes are
- * "name" (required) and "use-attribute-sets" (optional).
- */
- public void parseContents(Parser parser) {
-
- // Get this attribute set's name
- final String name = getAttribute("name");
-
- if (!XML11Char.isXML11ValidQName(name)) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_QNAME_ERR, name, this);
- parser.reportError(Constants.ERROR, err);
- }
- _name = parser.getQNameIgnoreDefaultNs(name);
- if ((_name == null) || (_name.equals(EMPTYSTRING))) {
- ErrorMsg msg = new ErrorMsg(ErrorMsg.UNNAMED_ATTRIBSET_ERR, this);
- parser.reportError(Constants.ERROR, msg);
- }
-
- // Get any included attribute sets (similar to inheritance...)
- final String useSets = getAttribute("use-attribute-sets");
- if (useSets.length() > 0) {
- if (!Util.isValidQNames(useSets)) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_QNAME_ERR, useSets, this);
- parser.reportError(Constants.ERROR, err);
- }
- _useSets = new UseAttributeSets(useSets, parser);
- }
-
- // Parse the contents of this node. All child elements must be
- // <xsl:attribute> elements. Other elements cause an error.
- final List<SyntaxTreeNode> contents = getContents();
- final int count = contents.size();
- for (int i=0; i<count; i++) {
- SyntaxTreeNode child = contents.get(i);
- if (child instanceof XslAttribute) {
- parser.getSymbolTable().setCurrentNode(child);
- child.parseContents(parser);
- }
- else if (child instanceof Text) {
- // ignore
- }
- else {
- ErrorMsg msg = new ErrorMsg(ErrorMsg.ILLEGAL_CHILD_ERR, this);
- parser.reportError(Constants.ERROR, msg);
- }
- }
-
- // Point the symbol table back at us...
- parser.getSymbolTable().setCurrentNode(this);
- }
-
- /**
- * Type check the contents of this element
- */
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-
- if (_ignore) return (Type.Void);
-
- // _mergeSet Point to any previous definition of this attribute set
- _mergeSet = stable.addAttributeSet(this);
-
- _method = AttributeSetPrefix + getXSLTC().nextAttributeSetSerial();
-
- if (_useSets != null) _useSets.typeCheck(stable);
- typeCheckContents(stable);
- return Type.Void;
- }
-
- /**
- * Compile a method that outputs the attributes in this set
- */
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-
- if (_ignore) return;
-
- // Create a new method generator for an attribute set method
- methodGen = new AttributeSetMethodGenerator(_method, classGen);
-
- // Generate a reference to previous attribute-set definitions with the
- // same name first. Those later in the stylesheet take precedence.
- if (_mergeSet != null) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- final String methodName = _mergeSet.getMethodName();
-
- il.append(classGen.loadTranslet());
- il.append(methodGen.loadDOM());
- il.append(methodGen.loadIterator());
- il.append(methodGen.loadHandler());
- il.append(methodGen.loadCurrentNode());
- final int method = cpg.addMethodref(classGen.getClassName(),
- methodName, ATTR_SET_SIG);
- il.append(new INVOKESPECIAL(method));
- }
-
- // Translate other used attribute sets first, as local attributes
- // take precedence (last attributes overrides first)
- if (_useSets != null) _useSets.translate(classGen, methodGen);
-
- // Translate all local attributes
- final Iterator<SyntaxTreeNode> attributes = elements();
- while (attributes.hasNext()) {
- SyntaxTreeNode element = attributes.next();
- if (element instanceof XslAttribute) {
- final XslAttribute attribute = (XslAttribute)element;
- attribute.translate(classGen, methodGen);
- }
- }
- final InstructionList il = methodGen.getInstructionList();
- il.append(RETURN);
-
- classGen.addMethod(methodGen);
- }
-
- public String toString() {
- StringBuffer buf = new StringBuffer("attribute-set: ");
- // Translate all local attributes
- final Iterator<SyntaxTreeNode> attributes = elements();
- while (attributes.hasNext()) {
- final XslAttribute attribute =
- (XslAttribute)attributes.next();
- buf.append(attribute);
- }
- return(buf.toString());
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/AttributeValue.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/AttributeValue.java
deleted file mode 100644
index bd1a317..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/AttributeValue.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: AttributeValue.java,v 1.2.4.1 2005/09/01 10:25:49 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-abstract class AttributeValue extends Expression {
-
- public static final AttributeValue create(SyntaxTreeNode parent,
- String text, Parser parser) {
-
- AttributeValue result;
- if (text.indexOf('{') != -1) {
- result = new AttributeValueTemplate(text, parser, parent);
- }
- else if (text.indexOf('}') != -1) {
- result = new AttributeValueTemplate(text, parser, parent);
- }
- else {
- result = new SimpleAttributeValue(text);
- result.setParser(parser);
- result.setParent(parent);
- }
- return result;
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/AttributeValueTemplate.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/AttributeValueTemplate.java
deleted file mode 100644
index 9b58759..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/AttributeValueTemplate.java
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: AttributeValueTemplate.java,v 1.2.4.1 2005/09/01 10:26:57 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
-import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
-import com.sun.org.apache.bcel.internal.generic.Instruction;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.NEW;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import java.util.Iterator;
-import java.util.List;
-import java.util.NoSuchElementException;
-import java.util.StringTokenizer;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-final class AttributeValueTemplate extends AttributeValue {
-
- final static int OUT_EXPR = 0;
- final static int IN_EXPR = 1;
- final static int IN_EXPR_SQUOTES = 2;
- final static int IN_EXPR_DQUOTES = 3;
- final static String DELIMITER = "\uFFFE"; // A Unicode nonchar
-
- public AttributeValueTemplate(String value, Parser parser,
- SyntaxTreeNode parent)
- {
- setParent(parent);
- setParser(parser);
-
- try {
- parseAVTemplate(value, parser);
- }
- catch (NoSuchElementException e) {
- reportError(parent, parser,
- ErrorMsg.ATTR_VAL_TEMPLATE_ERR, value);
- }
- }
-
- /**
- * Two-pass parsing of ATVs. In the first pass, double curly braces are
- * replaced by one, and expressions are delimited using DELIMITER. The
- * second pass splits up the resulting buffer into literal and non-literal
- * expressions. Errors are reported during the first pass.
- */
- private void parseAVTemplate(String text, Parser parser) {
- StringTokenizer tokenizer =
- new StringTokenizer(text, "{}\"\'", true);
-
- /*
- * First pass: replace double curly braces and delimit expressions
- * Simple automaton to parse ATVs, delimit expressions and report
- * errors.
- */
- String t = null;
- String lookahead = null;
- StringBuffer buffer = new StringBuffer();
- int state = OUT_EXPR;
-
- while (tokenizer.hasMoreTokens()) {
- // Use lookahead if available
- if (lookahead != null) {
- t = lookahead;
- lookahead = null;
- }
- else {
- t = tokenizer.nextToken();
- }
-
- if (t.length() == 1) {
- switch (t.charAt(0)) {
- case '{':
- switch (state) {
- case OUT_EXPR:
- lookahead = tokenizer.nextToken();
- if (lookahead.equals("{")) {
- buffer.append(lookahead); // replace {{ by {
- lookahead = null;
- }
- else {
- buffer.append(DELIMITER);
- state = IN_EXPR;
- }
- break;
- case IN_EXPR:
- case IN_EXPR_SQUOTES:
- case IN_EXPR_DQUOTES:
- reportError(getParent(), parser,
- ErrorMsg.ATTR_VAL_TEMPLATE_ERR, text);
- break;
- }
- break;
- case '}':
- switch (state) {
- case OUT_EXPR:
- lookahead = tokenizer.nextToken();
- if (lookahead.equals("}")) {
- buffer.append(lookahead); // replace }} by }
- lookahead = null;
- }
- else {
- reportError(getParent(), parser,
- ErrorMsg.ATTR_VAL_TEMPLATE_ERR, text);
- }
- break;
- case IN_EXPR:
- buffer.append(DELIMITER);
- state = OUT_EXPR;
- break;
- case IN_EXPR_SQUOTES:
- case IN_EXPR_DQUOTES:
- buffer.append(t);
- break;
- }
- break;
- case '\'':
- switch (state) {
- case IN_EXPR:
- state = IN_EXPR_SQUOTES;
- break;
- case IN_EXPR_SQUOTES:
- state = IN_EXPR;
- break;
- case OUT_EXPR:
- case IN_EXPR_DQUOTES:
- break;
- }
- buffer.append(t);
- break;
- case '\"':
- switch (state) {
- case IN_EXPR:
- state = IN_EXPR_DQUOTES;
- break;
- case IN_EXPR_DQUOTES:
- state = IN_EXPR;
- break;
- case OUT_EXPR:
- case IN_EXPR_SQUOTES:
- break;
- }
- buffer.append(t);
- break;
- default:
- buffer.append(t);
- break;
- }
- }
- else {
- buffer.append(t);
- }
- }
-
- // Must be in OUT_EXPR at the end of parsing
- if (state != OUT_EXPR) {
- reportError(getParent(), parser,
- ErrorMsg.ATTR_VAL_TEMPLATE_ERR, text);
- }
-
- /*
- * Second pass: split up buffer into literal and non-literal expressions.
- */
- tokenizer = new StringTokenizer(buffer.toString(), DELIMITER, true);
-
- while (tokenizer.hasMoreTokens()) {
- t = tokenizer.nextToken();
-
- if (t.equals(DELIMITER)) {
- addElement(parser.parseExpression(this, tokenizer.nextToken()));
- tokenizer.nextToken(); // consume other delimiter
- }
- else {
- addElement(new LiteralExpr(t));
- }
- }
- }
-
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- final List<SyntaxTreeNode> contents = getContents();
- final int n = contents.size();
- for (int i = 0; i < n; i++) {
- final Expression exp = (Expression)contents.get(i);
- if (!exp.typeCheck(stable).identicalTo(Type.String)) {
- contents.set(i, new CastExpr(exp, Type.String));
- }
- }
- return _type = Type.String;
- }
-
- public String toString() {
- final StringBuffer buffer = new StringBuffer("AVT:[");
- final int count = elementCount();
- for (int i = 0; i < count; i++) {
- buffer.append(elementAt(i).toString());
- if (i < count - 1)
- buffer.append(' ');
- }
- return buffer.append(']').toString();
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- if (elementCount() == 1) {
- final Expression exp = (Expression)elementAt(0);
- exp.translate(classGen, methodGen);
- }
- else {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- final int initBuffer = cpg.addMethodref(STRING_BUFFER_CLASS,
- "<init>", "()V");
- final Instruction append =
- new INVOKEVIRTUAL(cpg.addMethodref(STRING_BUFFER_CLASS,
- "append",
- "(" + STRING_SIG + ")"
- + STRING_BUFFER_SIG));
-
- final int toString = cpg.addMethodref(STRING_BUFFER_CLASS,
- "toString",
- "()"+STRING_SIG);
- il.append(new NEW(cpg.addClass(STRING_BUFFER_CLASS)));
- il.append(DUP);
- il.append(new INVOKESPECIAL(initBuffer));
- // StringBuffer is on the stack
- final Iterator<SyntaxTreeNode> elements = elements();
- while (elements.hasNext()) {
- final Expression exp = (Expression)elements.next();
- exp.translate(classGen, methodGen);
- il.append(append);
- }
- il.append(new INVOKEVIRTUAL(toString));
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/BinOpExpr.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/BinOpExpr.java
deleted file mode 100644
index 8185d11..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/BinOpExpr.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: BinOpExpr.java,v 1.2.4.1 2005/09/01 11:42:27 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-final class BinOpExpr extends Expression {
- public static final int PLUS = 0;
- public static final int MINUS = 1;
- public static final int TIMES = 2;
- public static final int DIV = 3;
- public static final int MOD = 4;
-
- private static final String[] Ops = {
- "+", "-", "*", "/", "%"
- };
-
- private int _op;
- private Expression _left, _right;
-
- public BinOpExpr(int op, Expression left, Expression right) {
- _op = op;
- (_left = left).setParent(this);
- (_right = right).setParent(this);
- }
-
- /**
- * Returns true if this expressions contains a call to position(). This is
- * needed for context changes in node steps containing multiple predicates.
- */
- public boolean hasPositionCall() {
- if (_left.hasPositionCall()) return true;
- if (_right.hasPositionCall()) return true;
- return false;
- }
-
- /**
- * Returns true if this expressions contains a call to last()
- */
- public boolean hasLastCall() {
- return (_left.hasLastCall() || _right.hasLastCall());
- }
-
- public void setParser(Parser parser) {
- super.setParser(parser);
- _left.setParser(parser);
- _right.setParser(parser);
- }
-
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- final Type tleft = _left.typeCheck(stable);
- final Type tright = _right.typeCheck(stable);
- final MethodType ptype = lookupPrimop(stable, Ops[_op],
- new MethodType(Type.Void,
- tleft, tright));
- if (ptype != null) {
- final Type arg1 = (Type) ptype.argsType().elementAt(0);
- if (!arg1.identicalTo(tleft)) {
- _left = new CastExpr(_left, arg1);
- }
- final Type arg2 = (Type) ptype.argsType().elementAt(1);
- if (!arg2.identicalTo(tright)) {
- _right = new CastExpr(_right, arg1);
- }
- return _type = ptype.resultType();
- }
- throw new TypeCheckError(this);
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final InstructionList il = methodGen.getInstructionList();
-
- _left.translate(classGen, methodGen);
- _right.translate(classGen, methodGen);
-
- switch (_op) {
- case PLUS:
- il.append(_type.ADD());
- break;
- case MINUS:
- il.append(_type.SUB());
- break;
- case TIMES:
- il.append(_type.MUL());
- break;
- case DIV:
- il.append(_type.DIV());
- break;
- case MOD:
- il.append(_type.REM());
- break;
- default:
- ErrorMsg msg = new ErrorMsg(ErrorMsg.ILLEGAL_BINARY_OP_ERR, this);
- getParser().reportError(Constants.ERROR, msg);
- }
- }
-
- public String toString() {
- return Ops[_op] + '(' + _left + ", " + _right + ')';
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/BooleanCall.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/BooleanCall.java
deleted file mode 100644
index 16eb6d4..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/BooleanCall.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: BooleanCall.java,v 1.2.4.1 2005/09/01 11:43:50 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import java.util.Vector;
-
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-final class BooleanCall extends FunctionCall {
-
- private Expression _arg = null;
-
- public BooleanCall(QName fname, Vector arguments) {
- super(fname, arguments);
- _arg = argument(0);
- }
-
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- _arg.typeCheck(stable);
- return _type = Type.Boolean;
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- _arg.translate(classGen, methodGen);
- final Type targ = _arg.getType();
- if (!targ.identicalTo(Type.Boolean)) {
- _arg.startIterator(classGen, methodGen);
- targ.translateTo(classGen, methodGen, Type.Boolean);
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/BooleanExpr.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/BooleanExpr.java
deleted file mode 100644
index 27fe966..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/BooleanExpr.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: BooleanExpr.java,v 1.2.4.1 2005/09/01 11:44:57 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.GOTO;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-
-/**
- * This class implements inlined calls to the XSLT standard functions
- * true() and false().
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-final class BooleanExpr extends Expression {
- private boolean _value;
-
- public BooleanExpr(boolean value) {
- _value = value;
- }
-
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- _type = Type.Boolean;
- return _type;
- }
-
- public String toString() {
- return _value ? "true()" : "false()";
- }
-
- public boolean getValue() {
- return _value;
- }
-
- public boolean contextDependent() {
- return false;
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- ConstantPoolGen cpg = classGen.getConstantPool();
- InstructionList il = methodGen.getInstructionList();
- il.append(new PUSH(cpg, _value));
- }
-
- public void translateDesynthesized(ClassGenerator classGen,
- MethodGenerator methodGen) {
- final InstructionList il = methodGen.getInstructionList();
- if (_value) {
- il.append(NOP); // true list falls through
- }
- else {
- _falseList.add(il.append(new GOTO(null)));
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/CallTemplate.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/CallTemplate.java
deleted file mode 100644
index 2e2ca14..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/CallTemplate.java
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-import com.sun.org.apache.xml.internal.utils.XML11Char;
-
-import java.util.Vector;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Erwin Bolwidt <ejb@klomp.org>
- */
-final class CallTemplate extends Instruction {
-
- /**
- * Name of template to call.
- */
- private QName _name;
-
- /**
- * The array of effective parameters in this CallTemplate. An object in
- * this array can be either a WithParam or a Param if no WithParam
- * exists for a particular parameter.
- */
- private SyntaxTreeNode[] _parameters = null;
-
- /**
- * The corresponding template which this CallTemplate calls.
- */
- private Template _calleeTemplate = null;
-
- public void display(int indent) {
- indent(indent);
- System.out.print("CallTemplate");
- Util.println(" name " + _name);
- displayContents(indent + IndentIncrement);
- }
-
- public boolean hasWithParams() {
- return elementCount() > 0;
- }
-
- public void parseContents(Parser parser) {
- final String name = getAttribute("name");
- if (name.length() > 0) {
- if (!XML11Char.isXML11ValidQName(name)) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_QNAME_ERR, name, this);
- parser.reportError(Constants.ERROR, err);
- }
- _name = parser.getQNameIgnoreDefaultNs(name);
- }
- else {
- reportError(this, parser, ErrorMsg.REQUIRED_ATTR_ERR, "name");
- }
- parseChildren(parser);
- }
-
- /**
- * Verify that a template with this name exists.
- */
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- final Template template = stable.lookupTemplate(_name);
- if (template != null) {
- typeCheckContents(stable);
- }
- else {
- ErrorMsg err = new ErrorMsg(ErrorMsg.TEMPLATE_UNDEF_ERR,_name,this);
- throw new TypeCheckError(err);
- }
- return Type.Void;
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final Stylesheet stylesheet = classGen.getStylesheet();
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- // If there are Params in the stylesheet or WithParams in this call?
- if (stylesheet.hasLocalParams() || hasContents()) {
- _calleeTemplate = getCalleeTemplate();
-
- // Build the parameter list if the called template is simple named
- if (_calleeTemplate != null) {
- buildParameterList();
- }
- // This is only needed when the called template is not
- // a simple named template.
- else {
- // Push parameter frame
- final int push = cpg.addMethodref(TRANSLET_CLASS,
- PUSH_PARAM_FRAME,
- PUSH_PARAM_FRAME_SIG);
- il.append(classGen.loadTranslet());
- il.append(new INVOKEVIRTUAL(push));
- translateContents(classGen, methodGen);
- }
- }
-
- // Generate a valid Java method name
- final String className = stylesheet.getClassName();
- String methodName = Util.escape(_name.toString());
-
- // Load standard arguments
- il.append(classGen.loadTranslet());
- il.append(methodGen.loadDOM());
- il.append(methodGen.loadIterator());
- il.append(methodGen.loadHandler());
- il.append(methodGen.loadCurrentNode());
-
- // Initialize prefix of method signature
- StringBuffer methodSig = new StringBuffer("(" + DOM_INTF_SIG
- + NODE_ITERATOR_SIG + TRANSLET_OUTPUT_SIG + NODE_SIG);
-
- // If calling a simply named template, push actual arguments
- if (_calleeTemplate != null) {
- int numParams = _parameters.length;
-
- for (int i = 0; i < numParams; i++) {
- SyntaxTreeNode node = _parameters[i];
- methodSig.append(OBJECT_SIG); // append Object to signature
-
- // Push 'null' if Param to indicate no actual parameter specified
- if (node instanceof Param) {
- il.append(ACONST_NULL);
- }
- else { // translate WithParam
- node.translate(classGen, methodGen);
- }
- }
- }
-
- // Complete signature and generate invokevirtual call
- methodSig.append(")V");
- il.append(new INVOKEVIRTUAL(cpg.addMethodref(className,
- methodName,
- methodSig.toString())));
-
- // release temporary result trees
- if (_parameters != null) {
- for (int i = 0; i < _parameters.length; i++) {
- if (_parameters[i] instanceof WithParam) {
- ((WithParam)_parameters[i]).releaseResultTree(classGen, methodGen);
- }
- }
- }
-
- // Do not need to call Translet.popParamFrame() if we are
- // calling a simple named template.
- if (_calleeTemplate == null && (stylesheet.hasLocalParams() || hasContents())) {
- // Pop parameter frame
- final int pop = cpg.addMethodref(TRANSLET_CLASS,
- POP_PARAM_FRAME,
- POP_PARAM_FRAME_SIG);
- il.append(classGen.loadTranslet());
- il.append(new INVOKEVIRTUAL(pop));
- }
- }
-
- /**
- * Return the simple named template which this CallTemplate calls.
- * Return false if there is no matched template or the matched
- * template is not a simple named template.
- */
- public Template getCalleeTemplate() {
- Template foundTemplate
- = getXSLTC().getParser().getSymbolTable().lookupTemplate(_name);
-
- return foundTemplate.isSimpleNamedTemplate() ? foundTemplate : null;
- }
-
- /**
- * Build the list of effective parameters in this CallTemplate.
- * The parameters of the called template are put into the array first.
- * Then we visit the WithParam children of this CallTemplate and replace
- * the Param with a corresponding WithParam having the same name.
- */
- private void buildParameterList() {
- // Put the parameters from the called template into the array first.
- // This is to ensure the order of the parameters.
- Vector<Param> defaultParams = _calleeTemplate.getParameters();
- int numParams = defaultParams.size();
- _parameters = new SyntaxTreeNode[numParams];
- for (int i = 0; i < numParams; i++) {
- _parameters[i] = defaultParams.elementAt(i);
- }
-
- // Replace a Param with a WithParam if they have the same name.
- int count = elementCount();
- for (int i = 0; i < count; i++) {
- Object node = elementAt(i);
-
- // Ignore if not WithParam
- if (node instanceof WithParam) {
- WithParam withParam = (WithParam)node;
- QName name = withParam.getName();
-
- // Search for a Param with the same name
- for (int k = 0; k < numParams; k++) {
- SyntaxTreeNode parm = _parameters[k];
- if (parm instanceof Param
- && ((Param)parm).getName().equals(name)) {
- withParam.setDoParameterOptimization(true);
- _parameters[k] = withParam;
- break;
- }
- else if (parm instanceof WithParam
- && ((WithParam)parm).getName().equals(name)) {
- withParam.setDoParameterOptimization(true);
- _parameters[k] = withParam;
- break;
- }
- }
- }
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/CastCall.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/CastCall.java
deleted file mode 100644
index c1131f3..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/CastCall.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: CastCall.java,v 1.2.4.1 2005/09/01 11:47:58 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import java.util.Vector;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.CHECKCAST;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ObjectType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-
-/**
- * @author Santiago Pericas-Geertsen
- */
-final class CastCall extends FunctionCall {
-
- /**
- * Name of the class that is the target of the cast. Must be a
- * fully-qualified Java class Name.
- */
- private String _className;
-
- /**
- * A reference to the expression being casted.
- */
- private Expression _right;
-
- /**
- * Constructor.
- */
- public CastCall(QName fname, Vector arguments) {
- super(fname, arguments);
- }
-
- /**
- * Type check the two parameters for this function
- */
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- // Check that the function was passed exactly two arguments
- if (argumentCount() != 2) {
- throw new TypeCheckError(new ErrorMsg(ErrorMsg.ILLEGAL_ARG_ERR,
- getName(), this));
- }
-
- // The first argument must be a literal String
- Expression exp = argument(0);
- if (exp instanceof LiteralExpr) {
- _className = ((LiteralExpr) exp).getValue();
- _type = Type.newObjectType(_className);
- }
- else {
- throw new TypeCheckError(new ErrorMsg(ErrorMsg.NEED_LITERAL_ERR,
- getName(), this));
- }
-
- // Second argument must be of type reference or object
- _right = argument(1);
- Type tright = _right.typeCheck(stable);
- if (tright != Type.Reference &&
- tright instanceof ObjectType == false)
- {
- throw new TypeCheckError(new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
- tright, _type, this));
- }
-
- return _type;
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- _right.translate(classGen, methodGen);
- il.append(new CHECKCAST(cpg.addClass(_className)));
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/CastExpr.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/CastExpr.java
deleted file mode 100644
index e6f0b45..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/CastExpr.java
+++ /dev/null
@@ -1,241 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: CastExpr.java,v 1.2.4.1 2005/09/12 10:06:35 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.IF_ICMPNE;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.SIPUSH;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.BooleanType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MultiHashtable;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ResultTreeType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xml.internal.dtm.Axis;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- * @author Erwin Bolwidt <ejb@klomp.org>
- */
-final class CastExpr extends Expression {
- private final Expression _left;
-
- /**
- * Legal conversions between internal types.
- */
- private static final MultiHashtable<Type, Type> InternalTypeMap = new MultiHashtable<>();
-
- static {
- // Possible type conversions between internal types
- InternalTypeMap.put(Type.Boolean, Type.Boolean);
- InternalTypeMap.put(Type.Boolean, Type.Real);
- InternalTypeMap.put(Type.Boolean, Type.String);
- InternalTypeMap.put(Type.Boolean, Type.Reference);
- InternalTypeMap.put(Type.Boolean, Type.Object);
-
- InternalTypeMap.put(Type.Real, Type.Real);
- InternalTypeMap.put(Type.Real, Type.Int);
- InternalTypeMap.put(Type.Real, Type.Boolean);
- InternalTypeMap.put(Type.Real, Type.String);
- InternalTypeMap.put(Type.Real, Type.Reference);
- InternalTypeMap.put(Type.Real, Type.Object);
-
- InternalTypeMap.put(Type.Int, Type.Int);
- InternalTypeMap.put(Type.Int, Type.Real);
- InternalTypeMap.put(Type.Int, Type.Boolean);
- InternalTypeMap.put(Type.Int, Type.String);
- InternalTypeMap.put(Type.Int, Type.Reference);
- InternalTypeMap.put(Type.Int, Type.Object);
-
- InternalTypeMap.put(Type.String, Type.String);
- InternalTypeMap.put(Type.String, Type.Boolean);
- InternalTypeMap.put(Type.String, Type.Real);
- InternalTypeMap.put(Type.String, Type.Reference);
- InternalTypeMap.put(Type.String, Type.Object);
-
- InternalTypeMap.put(Type.NodeSet, Type.NodeSet);
- InternalTypeMap.put(Type.NodeSet, Type.Boolean);
- InternalTypeMap.put(Type.NodeSet, Type.Real);
- InternalTypeMap.put(Type.NodeSet, Type.String);
- InternalTypeMap.put(Type.NodeSet, Type.Node);
- InternalTypeMap.put(Type.NodeSet, Type.Reference);
- InternalTypeMap.put(Type.NodeSet, Type.Object);
-
- InternalTypeMap.put(Type.Node, Type.Node);
- InternalTypeMap.put(Type.Node, Type.Boolean);
- InternalTypeMap.put(Type.Node, Type.Real);
- InternalTypeMap.put(Type.Node, Type.String);
- InternalTypeMap.put(Type.Node, Type.NodeSet);
- InternalTypeMap.put(Type.Node, Type.Reference);
- InternalTypeMap.put(Type.Node, Type.Object);
-
- InternalTypeMap.put(Type.ResultTree, Type.ResultTree);
- InternalTypeMap.put(Type.ResultTree, Type.Boolean);
- InternalTypeMap.put(Type.ResultTree, Type.Real);
- InternalTypeMap.put(Type.ResultTree, Type.String);
- InternalTypeMap.put(Type.ResultTree, Type.NodeSet);
- InternalTypeMap.put(Type.ResultTree, Type.Reference);
- InternalTypeMap.put(Type.ResultTree, Type.Object);
-
- InternalTypeMap.put(Type.Reference, Type.Reference);
- InternalTypeMap.put(Type.Reference, Type.Boolean);
- InternalTypeMap.put(Type.Reference, Type.Int);
- InternalTypeMap.put(Type.Reference, Type.Real);
- InternalTypeMap.put(Type.Reference, Type.String);
- InternalTypeMap.put(Type.Reference, Type.Node);
- InternalTypeMap.put(Type.Reference, Type.NodeSet);
- InternalTypeMap.put(Type.Reference, Type.ResultTree);
- InternalTypeMap.put(Type.Reference, Type.Object);
-
- InternalTypeMap.put(Type.Object, Type.String);
-
- InternalTypeMap.put(Type.Void, Type.String);
-
- InternalTypeMap.makeUnmodifiable();
- }
-
- private boolean _typeTest = false;
-
- /**
- * Construct a cast expression and check that the conversion is
- * valid by calling typeCheck().
- */
- public CastExpr(Expression left, Type type) throws TypeCheckError {
- _left = left;
- _type = type; // use inherited field
-
- if ((_left instanceof Step) && (_type == Type.Boolean)) {
- Step step = (Step)_left;
- if ((step.getAxis() == Axis.SELF) && (step.getNodeType() != -1))
- _typeTest = true;
- }
-
- // check if conversion is valid
- setParser(left.getParser());
- setParent(left.getParent());
- left.setParent(this);
- typeCheck(left.getParser().getSymbolTable());
- }
-
- public Expression getExpr() {
- return _left;
- }
-
- /**
- * Returns true if this expressions contains a call to position(). This is
- * needed for context changes in node steps containing multiple predicates.
- */
- public boolean hasPositionCall() {
- return(_left.hasPositionCall());
- }
-
- public boolean hasLastCall() {
- return(_left.hasLastCall());
- }
-
- public String toString() {
- return "cast(" + _left + ", " + _type + ")";
- }
-
- /**
- * Type checking a cast expression amounts to verifying that the
- * type conversion is legal. Cast expressions are created during
- * type checking, but typeCheck() is usually not called on them.
- * As a result, this method is called from the constructor.
- */
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- Type tleft = _left.getType();
- if (tleft == null) {
- tleft = _left.typeCheck(stable);
- }
- if (tleft instanceof NodeType) {
- tleft = Type.Node; // multiple instances
- }
- else if (tleft instanceof ResultTreeType) {
- tleft = Type.ResultTree; // multiple instances
- }
- if (InternalTypeMap.maps(tleft, _type) != null) {
- return _type;
- }
- // throw new TypeCheckError(this);
- throw new TypeCheckError(new ErrorMsg(
- ErrorMsg.DATA_CONVERSION_ERR, tleft.toString(), _type.toString()));
- }
-
- public void translateDesynthesized(ClassGenerator classGen,
- MethodGenerator methodGen) {
- FlowList fl;
- final Type ltype = _left.getType();
-
- // This is a special case for the self:: axis. Instead of letting
- // the Step object create and iterator that we cast back to a single
- // node, we simply ask the DOM for the node type.
- if (_typeTest) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- final int idx = cpg.addInterfaceMethodref(DOM_INTF,
- "getExpandedTypeID",
- "(I)I");
- il.append(new SIPUSH((short)((Step)_left).getNodeType()));
- il.append(methodGen.loadDOM());
- il.append(methodGen.loadContextNode());
- il.append(new INVOKEINTERFACE(idx, 2));
- _falseList.add(il.append(new IF_ICMPNE(null)));
- }
- else {
-
- _left.translate(classGen, methodGen);
- if (_type != ltype) {
- _left.startIterator(classGen, methodGen);
- if (_type instanceof BooleanType) {
- fl = ltype.translateToDesynthesized(classGen, methodGen,
- _type);
- if (fl != null) {
- _falseList.append(fl);
- }
- }
- else {
- ltype.translateTo(classGen, methodGen, _type);
- }
- }
- }
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final Type ltype = _left.getType();
- _left.translate(classGen, methodGen);
- if (_type.identicalTo(ltype) == false) {
- _left.startIterator(classGen, methodGen);
- ltype.translateTo(classGen, methodGen, _type);
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/CeilingCall.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/CeilingCall.java
deleted file mode 100644
index b0b9de9..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/CeilingCall.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: CeilingCall.java,v 1.2.4.1 2005/09/01 11:59:19 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import java.util.Vector;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-final class CeilingCall extends FunctionCall {
- public CeilingCall(QName fname, Vector arguments) {
- super(fname, arguments);
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- argument(0).translate(classGen, methodGen);
- il.append(new INVOKESTATIC(cpg.addMethodref(MATH_CLASS,
- "ceil", "(D)D")));
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Choose.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Choose.java
deleted file mode 100644
index 0e23819..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Choose.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Choose.java,v 1.2.4.1 2005/09/01 12:00:14 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.BranchHandle;
-import com.sun.org.apache.bcel.internal.generic.GOTO;
-import com.sun.org.apache.bcel.internal.generic.IFEQ;
-import com.sun.org.apache.bcel.internal.generic.InstructionHandle;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.Vector;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- */
-final class Choose extends Instruction {
-
- /**
- * Display the element contents (a lot of when's and an otherwise)
- */
- public void display(int indent) {
- indent(indent);
- Util.println("Choose");
- indent(indent + IndentIncrement);
- displayContents(indent + IndentIncrement);
- }
-
- /**
- * Translate this Choose element. Generate a test-chain for the various
- * <xsl:when> elements and default to the <xsl:otherwise> if present.
- */
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final Vector whenElements = new Vector();
- Otherwise otherwise = null;
- Iterator<SyntaxTreeNode> elements = elements();
-
- // These two are for reporting errors only
- ErrorMsg error = null;
- final int line = getLineNumber();
-
- // Traverse all child nodes - must be either When or Otherwise
- while (elements.hasNext()) {
- SyntaxTreeNode element = elements.next();
- // Add a When child element
- if (element instanceof When) {
- whenElements.addElement(element);
- }
- // Add an Otherwise child element
- else if (element instanceof Otherwise) {
- if (otherwise == null) {
- otherwise = (Otherwise)element;
- }
- else {
- error = new ErrorMsg(ErrorMsg.MULTIPLE_OTHERWISE_ERR, this);
- getParser().reportError(Constants.ERROR, error);
- }
- }
- else if (element instanceof Text) {
- ((Text)element).ignore();
- }
- // It is an error if we find some other element here
- else {
- error = new ErrorMsg(ErrorMsg.WHEN_ELEMENT_ERR, this);
- getParser().reportError(Constants.ERROR, error);
- }
- }
-
- // Make sure that there is at least one <xsl:when> element
- if (whenElements.size() == 0) {
- error = new ErrorMsg(ErrorMsg.MISSING_WHEN_ERR, this);
- getParser().reportError(Constants.ERROR, error);
- return;
- }
-
- InstructionList il = methodGen.getInstructionList();
-
- // next element will hold a handle to the beginning of next
- // When/Otherwise if test on current When fails
- BranchHandle nextElement = null;
- Vector exitHandles = new Vector();
- InstructionHandle exit = null;
-
- Enumeration whens = whenElements.elements();
- while (whens.hasMoreElements()) {
- final When when = (When)whens.nextElement();
- final Expression test = when.getTest();
-
- InstructionHandle truec = il.getEnd();
-
- if (nextElement != null)
- nextElement.setTarget(il.append(NOP));
- test.translateDesynthesized(classGen, methodGen);
-
- if (test instanceof FunctionCall) {
- FunctionCall call = (FunctionCall)test;
- try {
- Type type = call.typeCheck(getParser().getSymbolTable());
- if (type != Type.Boolean) {
- test._falseList.add(il.append(new IFEQ(null)));
- }
- }
- catch (TypeCheckError e) {
- // handled later!
- }
- }
- // remember end of condition
- truec = il.getEnd();
-
- // The When object should be ignored completely in case it tests
- // for the support of a non-available element
- if (!when.ignore()) when.translateContents(classGen, methodGen);
-
- // goto exit after executing the body of when
- exitHandles.addElement(il.append(new GOTO(null)));
- if (whens.hasMoreElements() || otherwise != null) {
- nextElement = il.append(new GOTO(null));
- test.backPatchFalseList(nextElement);
- }
- else
- test.backPatchFalseList(exit = il.append(NOP));
- test.backPatchTrueList(truec.getNext());
- }
-
- // Translate any <xsl:otherwise> element
- if (otherwise != null) {
- nextElement.setTarget(il.append(NOP));
- otherwise.translateContents(classGen, methodGen);
- exit = il.append(NOP);
- }
-
- // now that end is known set targets of exit gotos
- Enumeration exitGotos = exitHandles.elements();
- while (exitGotos.hasMoreElements()) {
- BranchHandle gotoExit = (BranchHandle)exitGotos.nextElement();
- gotoExit.setTarget(exit);
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Closure.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Closure.java
deleted file mode 100644
index 06d7801..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Closure.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Closure.java,v 1.2.4.1 2005/09/01 12:01:23 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-/**
- * @author Santiago Pericas-Geertsen
- */
-public interface Closure {
-
- /**
- * Returns true if this closure is compiled in an inner class (i.e.
- * if this is a real closure).
- */
- public boolean inInnerClass();
-
- /**
- * Returns a reference to its parent closure or null if outermost.
- */
- public Closure getParentClosure();
-
- /**
- * Returns the name of the auxiliary class or null if this predicate
- * is compiled inside the Translet.
- */
- public String getInnerClassName();
-
- /**
- * Add new variable to the closure.
- */
- public void addVariable(VariableRefBase variableRef);
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Comment.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Comment.java
deleted file mode 100644
index 0b25a45..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Comment.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Comment.java,v 1.2.4.1 2005/09/01 12:02:37 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.GETFIELD;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- */
-final class Comment extends Instruction {
-
- public void parseContents(Parser parser) {
- parseChildren(parser);
- }
-
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- typeCheckContents(stable);
- return Type.String;
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- // Shortcut for literal strings
- Text rawText = null;
- if (elementCount() == 1) {
- Object content = elementAt(0);
- if (content instanceof Text) {
- rawText = (Text) content;
- }
- }
-
- // If the content is literal text, call comment(char[],int,int) or
- // comment(String), as appropriate. Otherwise, use a
- // StringValueHandler to gather the textual content of the xsl:comment
- // and call comment(String) with the result.
- if (rawText != null) {
- il.append(methodGen.loadHandler());
-
- if (rawText.canLoadAsArrayOffsetLength()) {
- rawText.loadAsArrayOffsetLength(classGen, methodGen);
- final int comment =
- cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
- "comment",
- "([CII)V");
- il.append(new INVOKEINTERFACE(comment, 4));
- } else {
- il.append(new PUSH(cpg, rawText.getText()));
- final int comment =
- cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
- "comment",
- "(" + STRING_SIG + ")V");
- il.append(new INVOKEINTERFACE(comment, 2));
- }
- } else {
- // Save the current handler base on the stack
- il.append(methodGen.loadHandler());
- il.append(DUP); // first arg to "comment" call
-
- // Get the translet's StringValueHandler
- il.append(classGen.loadTranslet());
- il.append(new GETFIELD(cpg.addFieldref(TRANSLET_CLASS,
- "stringValueHandler",
- STRING_VALUE_HANDLER_SIG)));
- il.append(DUP);
- il.append(methodGen.storeHandler());
-
- // translate contents with substituted handler
- translateContents(classGen, methodGen);
-
- // get String out of the handler
- il.append(new INVOKEVIRTUAL(cpg.addMethodref(STRING_VALUE_HANDLER,
- "getValue",
- "()" + STRING_SIG)));
- // call "comment"
- final int comment =
- cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
- "comment",
- "(" + STRING_SIG + ")V");
- il.append(new INVOKEINTERFACE(comment, 2));
- // Restore old handler base from stack
- il.append(methodGen.storeHandler());
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/CompilerException.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/CompilerException.java
deleted file mode 100644
index c8f673e..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/CompilerException.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: CompilerException.java,v 1.2.4.1 2005/09/01 12:04:22 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-/**
- * @author Morten Jorgensen
- */
-public final class CompilerException extends Exception {
- static final long serialVersionUID = 1732939618562742663L;
-
- private String _msg;
-
- public CompilerException() {
- super();
- }
-
- public CompilerException(Exception e) {
- super(e.toString());
- _msg = e.toString();
- }
-
- public CompilerException(String message) {
- super(message);
- _msg = message;
- }
-
- public String getMessage() {
- final int col = _msg.indexOf(':');
-
- if (col > -1)
- return(_msg.substring(col));
- else
- return(_msg);
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ConcatCall.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ConcatCall.java
deleted file mode 100644
index 4b3ac6a..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ConcatCall.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ConcatCall.java,v 1.2.4.1 2005/09/01 12:07:31 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import java.util.Vector;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
-import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
-import com.sun.org.apache.bcel.internal.generic.Instruction;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.NEW;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-final class ConcatCall extends FunctionCall {
- public ConcatCall(QName fname, Vector arguments) {
- super(fname, arguments);
- }
-
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- for (int i = 0; i < argumentCount(); i++) {
- final Expression exp = argument(i);
- if (!exp.typeCheck(stable).identicalTo(Type.String)) {
- setArgument(i, new CastExpr(exp, Type.String));
- }
- }
- return _type = Type.String;
- }
-
- /** translate leaves a String on the stack */
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- final int nArgs = argumentCount();
-
- switch (nArgs) {
- case 0:
- il.append(new PUSH(cpg, EMPTYSTRING));
- break;
-
- case 1:
- argument().translate(classGen, methodGen);
- break;
-
- default:
- final int initBuffer = cpg.addMethodref(STRING_BUFFER_CLASS,
- "<init>", "()V");
- final Instruction append =
- new INVOKEVIRTUAL(cpg.addMethodref(STRING_BUFFER_CLASS,
- "append",
- "("+STRING_SIG+")"
- +STRING_BUFFER_SIG));
-
- final int toString = cpg.addMethodref(STRING_BUFFER_CLASS,
- "toString",
- "()"+STRING_SIG);
-
- il.append(new NEW(cpg.addClass(STRING_BUFFER_CLASS)));
- il.append(DUP);
- il.append(new INVOKESPECIAL(initBuffer));
- for (int i = 0; i < nArgs; i++) {
- argument(i).translate(classGen, methodGen);
- il.append(append);
- }
- il.append(new INVOKEVIRTUAL(toString));
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Constants.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Constants.java
deleted file mode 100644
index 6dd5c14..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Constants.java
+++ /dev/null
@@ -1,508 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Constants.java,v 1.7 2006/06/19 19:49:04 spericas Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.InstructionConstants;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-public interface Constants extends InstructionConstants {
-
- // Error categories used to report errors to Parser.reportError()
-
- // Unexpected internal errors, such as null-ptr exceptions, etc.
- // Immediately terminates compilation, no translet produced
- public final int INTERNAL = 0;
- // XSLT elements that are not implemented and unsupported ext.
- // Immediately terminates compilation, no translet produced
- public final int UNSUPPORTED = 1;
- // Fatal error in the stylesheet input (parsing or content)
- // Immediately terminates compilation, no translet produced
- public final int FATAL = 2;
- // Other error in the stylesheet input (parsing or content)
- // Does not terminate compilation, no translet produced
- public final int ERROR = 3;
- // Other error in the stylesheet input (content errors only)
- // Does not terminate compilation, a translet is produced
- public final int WARNING = 4;
-
- public static final String EMPTYSTRING = "";
-
- public static final String NAMESPACE_FEATURE =
- "http://xml.org/sax/features/namespaces";
-
- public static final String TRANSLET_INTF
- = "com.sun.org.apache.xalan.internal.xsltc.Translet";
- public static final String TRANSLET_INTF_SIG
- = "Lcom/sun/org/apache/xalan/internal/xsltc/Translet;";
-
- public static final String ATTRIBUTES_SIG
- = "Lcom/sun/org/apache/xalan/internal/xsltc/runtime/Attributes;";
- public static final String NODE_ITERATOR_SIG
- = "Lcom/sun/org/apache/xml/internal/dtm/DTMAxisIterator;";
- public static final String DOM_INTF_SIG
- = "Lcom/sun/org/apache/xalan/internal/xsltc/DOM;";
- public static final String DOM_IMPL_CLASS
- = "com/sun/org/apache/xalan/internal/xsltc/DOM"; // xml/dtm/ref/DTMDefaultBaseIterators"; //xalan/xsltc/dom/DOMImpl";
- public static final String SAX_IMPL_CLASS
- = "com/sun/org/apache/xalan/internal/xsltc/DOM/SAXImpl";
- public static final String DOM_IMPL_SIG
- = "Lcom/sun/org/apache/xalan/internal/xsltc/dom/SAXImpl;"; //xml/dtm/ref/DTMDefaultBaseIterators"; //xalan/xsltc/dom/DOMImpl;";
- public static final String SAX_IMPL_SIG
- = "Lcom/sun/org/apache/xalan/internal/xsltc/dom/SAXImpl;";
- public static final String DOM_ADAPTER_CLASS
- = "com/sun/org/apache/xalan/internal/xsltc/dom/DOMAdapter";
- public static final String DOM_ADAPTER_SIG
- = "Lcom/sun/org/apache/xalan/internal/xsltc/dom/DOMAdapter;";
- public static final String MULTI_DOM_CLASS
- = "com.sun.org.apache.xalan.internal.xsltc.dom.MultiDOM";
- public static final String MULTI_DOM_SIG
- = "Lcom/sun/org/apache/xalan/internal/xsltc/dom/MultiDOM;";
-
- public static final String STRING
- = "java.lang.String";
-
- public static final int ACC_PUBLIC
- = com.sun.org.apache.bcel.internal.Constants.ACC_PUBLIC;
- public static final int ACC_SUPER
- = com.sun.org.apache.bcel.internal.Constants.ACC_SUPER;
- public static final int ACC_FINAL
- = com.sun.org.apache.bcel.internal.Constants.ACC_FINAL;
- public static final int ACC_PRIVATE
- = com.sun.org.apache.bcel.internal.Constants.ACC_PRIVATE;
- public static final int ACC_PROTECTED
- = com.sun.org.apache.bcel.internal.Constants.ACC_PROTECTED;
- public static final int ACC_STATIC
- = com.sun.org.apache.bcel.internal.Constants.ACC_STATIC;
-
- public static final String STRING_SIG
- = "Ljava/lang/String;";
- public static final String STRING_BUFFER_SIG
- = "Ljava/lang/StringBuffer;";
- public static final String OBJECT_SIG
- = "Ljava/lang/Object;";
- public static final String DOUBLE_SIG
- = "Ljava/lang/Double;";
- public static final String INTEGER_SIG
- = "Ljava/lang/Integer;";
- public static final String COLLATOR_CLASS
- = "java/text/Collator";
- public static final String COLLATOR_SIG
- = "Ljava/text/Collator;";
-
- public static final String NODE
- = "int";
- public static final String NODE_ITERATOR
- = "com.sun.org.apache.xml.internal.dtm.DTMAxisIterator";
- public static final String NODE_ITERATOR_BASE
- = "com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase";
- public static final String SORT_ITERATOR
- = "com.sun.org.apache.xalan.internal.xsltc.dom.SortingIterator";
- public static final String SORT_ITERATOR_SIG
- = "Lcom.sun.org.apache.xalan.internal.xsltc.dom.SortingIterator;";
- public static final String NODE_SORT_RECORD
- = "com.sun.org.apache.xalan.internal.xsltc.dom.NodeSortRecord";
- public static final String NODE_SORT_FACTORY
- = "com/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecordFactory";
- public static final String NODE_SORT_RECORD_SIG
- = "Lcom/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecord;";
- public static final String NODE_SORT_FACTORY_SIG
- = "Lcom/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecordFactory;";
- public static final String LOCALE_CLASS
- = "java.util.Locale";
- public static final String LOCALE_SIG
- = "Ljava/util/Locale;";
- public static final String STRING_VALUE_HANDLER
- = "com.sun.org.apache.xalan.internal.xsltc.runtime.StringValueHandler";
- public static final String STRING_VALUE_HANDLER_SIG
- = "Lcom/sun/org/apache/xalan/internal/xsltc/runtime/StringValueHandler;";
- public static final String OUTPUT_HANDLER
- = "com/sun/org/apache/xml/internal/serializer/SerializationHandler";
- public static final String OUTPUT_HANDLER_SIG
- = "Lcom/sun/org/apache/xml/internal/serializer/SerializationHandler;";
- public static final String FILTER_INTERFACE
- = "com.sun.org.apache.xalan.internal.xsltc.dom.Filter";
- public static final String FILTER_INTERFACE_SIG
- = "Lcom/sun/org/apache/xalan/internal/xsltc/dom/Filter;";
- public static final String UNION_ITERATOR_CLASS
- = "com.sun.org.apache.xalan.internal.xsltc.dom.UnionIterator";
- public static final String STEP_ITERATOR_CLASS
- = "com.sun.org.apache.xalan.internal.xsltc.dom.StepIterator";
- public static final String CACHED_NODE_LIST_ITERATOR_CLASS
- = "com.sun.org.apache.xalan.internal.xsltc.dom.CachedNodeListIterator";
- public static final String NTH_ITERATOR_CLASS
- = "com.sun.org.apache.xalan.internal.xsltc.dom.NthIterator";
- public static final String ABSOLUTE_ITERATOR
- = "com.sun.org.apache.xalan.internal.xsltc.dom.AbsoluteIterator";
- public static final String DUP_FILTERED_ITERATOR
- = "com.sun.org.apache.xalan.internal.xsltc.dom.DupFilterIterator";
- public static final String CURRENT_NODE_LIST_ITERATOR
- = "com.sun.org.apache.xalan.internal.xsltc.dom.CurrentNodeListIterator";
- public static final String CURRENT_NODE_LIST_FILTER
- = "com.sun.org.apache.xalan.internal.xsltc.dom.CurrentNodeListFilter";
- public static final String CURRENT_NODE_LIST_ITERATOR_SIG
- = "Lcom/sun/org/apache/xalan/internal/xsltc/dom/CurrentNodeListIterator;";
- public static final String CURRENT_NODE_LIST_FILTER_SIG
- = "Lcom/sun/org/apache/xalan/internal/xsltc/dom/CurrentNodeListFilter;";
- public static final String FILTER_STEP_ITERATOR
- = "com.sun.org.apache.xalan.internal.xsltc.dom.FilteredStepIterator";
- public static final String FILTER_ITERATOR
- = "com.sun.org.apache.xalan.internal.xsltc.dom.FilterIterator";
- public static final String SINGLETON_ITERATOR
- = "com.sun.org.apache.xalan.internal.xsltc.dom.SingletonIterator";
- public static final String MATCHING_ITERATOR
- = "com.sun.org.apache.xalan.internal.xsltc.dom.MatchingIterator";
- public static final String NODE_SIG
- = "I";
- public static final String GET_PARENT
- = "getParent";
- public static final String GET_PARENT_SIG
- = "(" + NODE_SIG + ")" + NODE_SIG;
- public static final String NEXT_SIG
- = "()" + NODE_SIG;
- public static final String NEXT
- = "next";
- public static final String NEXTID
- = "nextNodeID";
- public static final String MAKE_NODE
- = "makeNode";
- public static final String MAKE_NODE_LIST
- = "makeNodeList";
- public static final String GET_UNPARSED_ENTITY_URI
- = "getUnparsedEntityURI";
- public static final String STRING_TO_REAL
- = "stringToReal";
- public static final String STRING_TO_REAL_SIG
- = "(" + STRING_SIG + ")D";
- public static final String STRING_TO_INT
- = "stringToInt";
- public static final String STRING_TO_INT_SIG
- = "(" + STRING_SIG + ")I";
-
- public static final String XSLT_PACKAGE
- = "com.sun.org.apache.xalan.internal.xsltc";
- public static final String COMPILER_PACKAGE
- = XSLT_PACKAGE + ".compiler";
- public static final String RUNTIME_PACKAGE
- = XSLT_PACKAGE + ".runtime";
- public static final String TRANSLET_CLASS
- = RUNTIME_PACKAGE + ".AbstractTranslet";
-
- public static final String TRANSLET_SIG
- = "Lcom/sun/org/apache/xalan/internal/xsltc/runtime/AbstractTranslet;";
- public static final String UNION_ITERATOR_SIG
- = "Lcom/sun/org/apache/xalan/internal/xsltc/dom/UnionIterator;";
- public static final String TRANSLET_OUTPUT_SIG
- = "Lcom/sun/org/apache/xml/internal/serializer/SerializationHandler;";
- public static final String MAKE_NODE_SIG
- = "(I)Lorg/w3c/dom/Node;";
- public static final String MAKE_NODE_SIG2
- = "(" + NODE_ITERATOR_SIG + ")Lorg/w3c/dom/Node;";
- public static final String MAKE_NODE_LIST_SIG
- = "(I)Lorg/w3c/dom/NodeList;";
- public static final String MAKE_NODE_LIST_SIG2
- = "(" + NODE_ITERATOR_SIG + ")Lorg/w3c/dom/NodeList;";
-
- public static final String STREAM_XML_OUTPUT
- = "com.sun.org.apache.xml.internal.serializer.ToXMLStream";
-
- public static final String OUTPUT_BASE
- = "com.sun.org.apache.xml.internal.serializer.SerializerBase";
-
- public static final String LOAD_DOCUMENT_CLASS
- = "com.sun.org.apache.xalan.internal.xsltc.dom.LoadDocument";
-
- public static final String KEY_INDEX_CLASS
- = "com/sun/org/apache/xalan/internal/xsltc/dom/KeyIndex";
- public static final String KEY_INDEX_SIG
- = "Lcom/sun/org/apache/xalan/internal/xsltc/dom/KeyIndex;";
-
- public static final String KEY_INDEX_ITERATOR_SIG
- = "Lcom/sun/org/apache/xalan/internal/xsltc/dom/KeyIndex$KeyIndexIterator;";
- public static final String DOM_INTF
- = "com.sun.org.apache.xalan.internal.xsltc.DOM";
- public static final String DOM_IMPL
- = "com.sun.org.apache.xalan.internal.xsltc.dom.SAXImpl";
- public static final String SAX_IMPL
- = "com.sun.org.apache.xalan.internal.xsltc.dom.SAXImpl";
- public static final String STRING_CLASS
- = "java.lang.String";
- public static final String OBJECT_CLASS
- = "java.lang.Object";
- public static final String BOOLEAN_CLASS
- = "java.lang.Boolean";
- public static final String STRING_BUFFER_CLASS
- = "java.lang.StringBuffer";
- public static final String STRING_WRITER
- = "java.io.StringWriter";
- public static final String WRITER_SIG
- = "Ljava/io/Writer;";
-
- public static final String TRANSLET_OUTPUT_BASE
- = "com.sun.org.apache.xalan.internal.xsltc.TransletOutputBase";
- // output interface
- public static final String TRANSLET_OUTPUT_INTERFACE
- = "com.sun.org.apache.xml.internal.serializer.SerializationHandler";
- public static final String BASIS_LIBRARY_CLASS
- = "com.sun.org.apache.xalan.internal.xsltc.runtime.BasisLibrary";
- public static final String ATTRIBUTE_LIST_IMPL_CLASS
- = "com.sun.org.apache.xalan.internal.xsltc.runtime.AttributeListImpl";
- public static final String DOUBLE_CLASS
- = "java.lang.Double";
- public static final String INTEGER_CLASS
- = "java.lang.Integer";
- public static final String RUNTIME_NODE_CLASS
- = "com.sun.org.apache.xalan.internal.xsltc.runtime.Node";
- public static final String MATH_CLASS
- = "java.lang.Math";
-
- public static final String BOOLEAN_VALUE
- = "booleanValue";
- public static final String BOOLEAN_VALUE_SIG
- = "()Z";
- public static final String INT_VALUE
- = "intValue";
- public static final String INT_VALUE_SIG
- = "()I";
- public static final String DOUBLE_VALUE
- = "doubleValue";
- public static final String DOUBLE_VALUE_SIG
- = "()D";
-
- public static final String DOM_PNAME
- = "dom";
- public static final String NODE_PNAME
- = "node";
- public static final String TRANSLET_OUTPUT_PNAME
- = "handler";
- public static final String ITERATOR_PNAME
- = "iterator";
- public static final String DOCUMENT_PNAME
- = "document";
- public static final String TRANSLET_PNAME
- = "translet";
-
- public static final String INVOKE_METHOD
- = "invokeMethod";
- public static final String GET_NODE_NAME
- = "getNodeNameX";
- public static final String CHARACTERSW
- = "characters";
- public static final String GET_CHILDREN
- = "getChildren";
- public static final String GET_TYPED_CHILDREN
- = "getTypedChildren";
- public static final String CHARACTERS
- = "characters";
- public static final String APPLY_TEMPLATES
- = "applyTemplates";
- public static final String GET_NODE_TYPE
- = "getNodeType";
- public static final String GET_NODE_VALUE
- = "getStringValueX";
- public static final String GET_ELEMENT_VALUE
- = "getElementValue";
- public static final String GET_ATTRIBUTE_VALUE
- = "getAttributeValue";
- public static final String HAS_ATTRIBUTE
- = "hasAttribute";
- public static final String ADD_ITERATOR
- = "addIterator";
- public static final String SET_START_NODE
- = "setStartNode";
- public static final String RESET
- = "reset";
-
- public static final String ATTR_SET_SIG
- = "(" + DOM_INTF_SIG + NODE_ITERATOR_SIG + TRANSLET_OUTPUT_SIG + "I)V";
-
- public static final String GET_NODE_NAME_SIG
- = "(" + NODE_SIG + ")" + STRING_SIG;
- public static final String CHARACTERSW_SIG
- = "(" + STRING_SIG + TRANSLET_OUTPUT_SIG + ")V";
- public static final String CHARACTERS_SIG
- = "(" + NODE_SIG + TRANSLET_OUTPUT_SIG + ")V";
- public static final String GET_CHILDREN_SIG
- = "(" + NODE_SIG +")" + NODE_ITERATOR_SIG;
- public static final String GET_TYPED_CHILDREN_SIG
- = "(I)" + NODE_ITERATOR_SIG;
- public static final String GET_NODE_TYPE_SIG
- = "()S";
- public static final String GET_NODE_VALUE_SIG
- = "(I)" + STRING_SIG;
- public static final String GET_ELEMENT_VALUE_SIG
- = "(I)" + STRING_SIG;
- public static final String GET_ATTRIBUTE_VALUE_SIG
- = "(II)" + STRING_SIG;
- public static final String HAS_ATTRIBUTE_SIG
- = "(II)Z";
- public static final String GET_ITERATOR_SIG
- = "()" + NODE_ITERATOR_SIG;
-
- public static final String NAMES_INDEX
- = "namesArray";
- public static final String NAMES_INDEX_SIG
- = "[" + STRING_SIG;
- public static final String URIS_INDEX
- = "urisArray";
- public static final String URIS_INDEX_SIG
- = "[" + STRING_SIG;
- public static final String TYPES_INDEX
- = "typesArray";
- public static final String TYPES_INDEX_SIG
- = "[I";
- public static final String NAMESPACE_INDEX
- = "namespaceArray";
- public static final String NAMESPACE_INDEX_SIG
- = "[" + STRING_SIG;
- public static final String HASIDCALL_INDEX
- = "_hasIdCall";
- public static final String HASIDCALL_INDEX_SIG
- = "Z";
- public static final String TRANSLET_VERSION_INDEX
- = "transletVersion";
- public static final String TRANSLET_VERSION_INDEX_SIG
- = "I";
-
- public static final String DOM_FIELD
- = "_dom";
- public static final String STATIC_NAMES_ARRAY_FIELD
- = "_sNamesArray";
- public static final String STATIC_URIS_ARRAY_FIELD
- = "_sUrisArray";
- public static final String STATIC_TYPES_ARRAY_FIELD
- = "_sTypesArray";
- public static final String STATIC_NAMESPACE_ARRAY_FIELD
- = "_sNamespaceArray";
- public static final String STATIC_CHAR_DATA_FIELD
- = "_scharData";
- public static final String STATIC_CHAR_DATA_FIELD_SIG
- = "[C";
- public static final String FORMAT_SYMBOLS_FIELD
- = "format_symbols";
-
- public static final String ITERATOR_FIELD_SIG
- = NODE_ITERATOR_SIG;
- public static final String NODE_FIELD
- = "node";
- public static final String NODE_FIELD_SIG
- = "I";
-
- public static final String EMPTYATTR_FIELD
- = "EmptyAttributes";
- public static final String ATTRIBUTE_LIST_FIELD
- = "attributeList";
- public static final String CLEAR_ATTRIBUTES
- = "clear";
- public static final String ADD_ATTRIBUTE
- = "addAttribute";
- public static final String ATTRIBUTE_LIST_IMPL_SIG
- = "Lcom/sun/org/apache/xalan/internal/xsltc/runtime/AttributeListImpl;";
- public static final String CLEAR_ATTRIBUTES_SIG
- = "()" + ATTRIBUTE_LIST_IMPL_SIG;
- public static final String ADD_ATTRIBUTE_SIG
- = "(" + STRING_SIG + STRING_SIG + ")" + ATTRIBUTE_LIST_IMPL_SIG;
-
- public static final String ADD_ITERATOR_SIG
- = "(" + NODE_ITERATOR_SIG +")" + UNION_ITERATOR_SIG;
-
- public static final String ORDER_ITERATOR
- = "orderNodes";
- public static final String ORDER_ITERATOR_SIG
- = "("+NODE_ITERATOR_SIG+"I)"+NODE_ITERATOR_SIG;
-
- public static final String SET_START_NODE_SIG
- = "(" + NODE_SIG + ")" + NODE_ITERATOR_SIG;
-
- public static final String NODE_COUNTER
- = "com.sun.org.apache.xalan.internal.xsltc.dom.NodeCounter";
- public static final String NODE_COUNTER_SIG
- = "Lcom/sun/org/apache/xalan/internal/xsltc/dom/NodeCounter;";
- public static final String DEFAULT_NODE_COUNTER
- = "com.sun.org.apache.xalan.internal.xsltc.dom.DefaultNodeCounter";
- public static final String DEFAULT_NODE_COUNTER_SIG
- = "Lcom/sun/org/apache/xalan/internal/xsltc/dom/DefaultNodeCounter;";
- public static final String TRANSLET_FIELD
- = "translet";
- public static final String TRANSLET_FIELD_SIG
- = TRANSLET_SIG;
-
- public static final String RESET_SIG
- = "()" + NODE_ITERATOR_SIG;
- public static final String GET_PARAMETER
- = "getParameter";
- public static final String ADD_PARAMETER
- = "addParameter";
- public static final String PUSH_PARAM_FRAME
- = "pushParamFrame";
- public static final String PUSH_PARAM_FRAME_SIG
- = "()V";
- public static final String POP_PARAM_FRAME
- = "popParamFrame";
- public static final String POP_PARAM_FRAME_SIG
- = "()V";
- public static final String GET_PARAMETER_SIG
- = "(" + STRING_SIG + ")" + OBJECT_SIG;
- public static final String ADD_PARAMETER_SIG
- = "(" + STRING_SIG + OBJECT_SIG + "Z)" + OBJECT_SIG;
-
- public static final String STRIP_SPACE
- = "stripSpace";
- public static final String STRIP_SPACE_INTF
- = "com/sun/org/apache/xalan/internal/xsltc/StripFilter";
- public static final String STRIP_SPACE_SIG
- = "Lcom/sun/org/apache/xalan/internal/xsltc/StripFilter;";
- public static final String STRIP_SPACE_PARAMS
- = "(Lcom/sun/org/apache/xalan/internal/xsltc/DOM;II)Z";
-
- public static final String GET_NODE_VALUE_ITERATOR
- = "getNodeValueIterator";
- public static final String GET_NODE_VALUE_ITERATOR_SIG
- = "("+NODE_ITERATOR_SIG+"I"+STRING_SIG+"Z)"+NODE_ITERATOR_SIG;
-
- public static final String GET_UNPARSED_ENTITY_URI_SIG
- = "("+STRING_SIG+")"+STRING_SIG;
-
- public static final int POSITION_INDEX = 2;
- public static final int LAST_INDEX = 3;
-
- public static final String XMLNS_PREFIX = "xmlns";
- public static final String XMLNS_STRING = "xmlns:";
- public static final String XMLNS_URI
- = "http://www.w3.org/2000/xmlns/";
- public static final String XSLT_URI
- = "http://www.w3.org/1999/XSL/Transform";
- public static final String XHTML_URI
- = "http://www.w3.org/1999/xhtml";
- public static final String TRANSLET_URI
- = "http://xml.apache.org/xalan/xsltc";
- public static final String REDIRECT_URI
- = "http://xml.apache.org/xalan/redirect";
- public static final String FALLBACK_CLASS
- = "com.sun.org.apache.xalan.internal.xsltc.compiler.Fallback";
-
- public static final int RTF_INITIAL_SIZE = 32;
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ContainsCall.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ContainsCall.java
deleted file mode 100644
index e0cd56c..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ContainsCall.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ContainsCall.java,v 1.2.4.1 2005/09/01 12:12:06 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import java.util.Vector;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.IFLT;
-import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- */
-final class ContainsCall extends FunctionCall {
-
- private Expression _base = null;
- private Expression _token = null;
-
- /**
- * Create a contains() call - two arguments, both strings
- */
- public ContainsCall(QName fname, Vector arguments) {
- super(fname, arguments);
- }
-
- /**
- * This XPath function returns true/false values
- */
- public boolean isBoolean() {
- return true;
- }
-
- /**
- * Type check the two parameters for this function
- */
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-
- // Check that the function was passed exactly two arguments
- if (argumentCount() != 2) {
- throw new TypeCheckError(ErrorMsg.ILLEGAL_ARG_ERR, getName(), this);
- }
-
- // The first argument must be a String, or cast to a String
- _base = argument(0);
- Type baseType = _base.typeCheck(stable);
- if (baseType != Type.String)
- _base = new CastExpr(_base, Type.String);
-
- // The second argument must also be a String, or cast to a String
- _token = argument(1);
- Type tokenType = _token.typeCheck(stable);
- if (tokenType != Type.String)
- _token = new CastExpr(_token, Type.String);
-
- return _type = Type.Boolean;
- }
-
- /**
- * Compile the expression - leave boolean expression on stack
- */
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- translateDesynthesized(classGen, methodGen);
- synthesize(classGen, methodGen);
- }
-
- /**
- * Compile expression and update true/false-lists
- */
- public void translateDesynthesized(ClassGenerator classGen,
- MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- _base.translate(classGen, methodGen);
- _token.translate(classGen, methodGen);
- il.append(new INVOKEVIRTUAL(cpg.addMethodref(STRING_CLASS,
- "indexOf",
- "("+STRING_SIG+")I")));
- _falseList.add(il.append(new IFLT(null)));
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Copy.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Copy.java
deleted file mode 100644
index 6c921bb..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Copy.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Copy.java,v 1.2.4.1 2005/09/01 12:14:32 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.ALOAD;
-import com.sun.org.apache.bcel.internal.generic.ASTORE;
-import com.sun.org.apache.bcel.internal.generic.BranchHandle;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.IFEQ;
-import com.sun.org.apache.bcel.internal.generic.IFNULL;
-import com.sun.org.apache.bcel.internal.generic.ILOAD;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
-import com.sun.org.apache.bcel.internal.generic.ISTORE;
-import com.sun.org.apache.bcel.internal.generic.InstructionHandle;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-final class Copy extends Instruction {
- private UseAttributeSets _useSets;
-
- public void parseContents(Parser parser) {
- final String useSets = getAttribute("use-attribute-sets");
- if (useSets.length() > 0) {
- if (!Util.isValidQNames(useSets)) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_QNAME_ERR, useSets, this);
- parser.reportError(Constants.ERROR, err);
- }
- _useSets = new UseAttributeSets(useSets, parser);
- }
- parseChildren(parser);
- }
-
- public void display(int indent) {
- indent(indent);
- Util.println("Copy");
- indent(indent + IndentIncrement);
- displayContents(indent + IndentIncrement);
- }
-
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- if (_useSets != null) {
- _useSets.typeCheck(stable);
- }
- typeCheckContents(stable);
- return Type.Void;
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- final LocalVariableGen name =
- methodGen.addLocalVariable2("name",
- Util.getJCRefType(STRING_SIG),
- null);
- final LocalVariableGen length =
- methodGen.addLocalVariable2("length",
- Util.getJCRefType("I"),
- null);
-
- // Get the name of the node to copy and save for later
- il.append(methodGen.loadDOM());
- il.append(methodGen.loadCurrentNode());
- il.append(methodGen.loadHandler());
- final int cpy = cpg.addInterfaceMethodref(DOM_INTF,
- "shallowCopy",
- "("
- + NODE_SIG
- + TRANSLET_OUTPUT_SIG
- + ")" + STRING_SIG);
- il.append(new INVOKEINTERFACE(cpy, 3));
- il.append(DUP);
- name.setStart(il.append(new ASTORE(name.getIndex())));
- final BranchHandle ifBlock1 = il.append(new IFNULL(null));
-
- // Get the length of the node name and save for later
- il.append(new ALOAD(name.getIndex()));
- final int lengthMethod = cpg.addMethodref(STRING_CLASS,"length","()I");
- il.append(new INVOKEVIRTUAL(lengthMethod));
- il.append(DUP);
- length.setStart(il.append(new ISTORE(length.getIndex())));
-
- // Ignore attribute sets if current node is ROOT. DOM.shallowCopy()
- // returns "" for ROOT, so skip attribute sets if length == 0
- final BranchHandle ifBlock4 = il.append(new IFEQ(null));
-
- // Copy in attribute sets if specified
- if (_useSets != null) {
- // If the parent of this element will result in an element being
- // output then we know that it is safe to copy out the attributes
- final SyntaxTreeNode parent = getParent();
- if ((parent instanceof LiteralElement) ||
- (parent instanceof LiteralElement)) {
- _useSets.translate(classGen, methodGen);
- }
- // If not we have to check to see if the copy will result in an
- // element being output.
- else {
- // check if element; if not skip to translate body
- il.append(new ILOAD(length.getIndex()));
- final BranchHandle ifBlock2 = il.append(new IFEQ(null));
- // length != 0 -> element -> do attribute sets
- _useSets.translate(classGen, methodGen);
- // not an element; root
- ifBlock2.setTarget(il.append(NOP));
- }
- }
-
- // Instantiate body of xsl:copy
- ifBlock4.setTarget(il.append(NOP));
- translateContents(classGen, methodGen);
-
- // Call the output handler's endElement() if we copied an element
- // (The DOM.shallowCopy() method calls startElement().)
- length.setEnd(il.append(new ILOAD(length.getIndex())));
- final BranchHandle ifBlock3 = il.append(new IFEQ(null));
- il.append(methodGen.loadHandler());
- name.setEnd(il.append(new ALOAD(name.getIndex())));
- il.append(methodGen.endElement());
-
- final InstructionHandle end = il.append(NOP);
- ifBlock1.setTarget(end);
- ifBlock3.setTarget(end);
- methodGen.removeLocalVariable(name);
- methodGen.removeLocalVariable(length);
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/CopyOf.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/CopyOf.java
deleted file mode 100644
index ed60f4f..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/CopyOf.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: CopyOf.java,v 1.2.4.1 2005/09/01 12:16:22 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
-import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeSetType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ReferenceType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ResultTreeType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-final class CopyOf extends Instruction {
- private Expression _select;
-
- public void display(int indent) {
- indent(indent);
- Util.println("CopyOf");
- indent(indent + IndentIncrement);
- Util.println("select " + _select.toString());
- }
-
- public void parseContents(Parser parser) {
- _select = parser.parseExpression(this, "select", null);
- // make sure required attribute(s) have been set
- if (_select.isDummy()) {
- reportError(this, parser, ErrorMsg.REQUIRED_ATTR_ERR, "select");
- return;
- }
- }
-
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- final Type tselect = _select.typeCheck(stable);
- if (tselect instanceof NodeType ||
- tselect instanceof NodeSetType ||
- tselect instanceof ReferenceType ||
- tselect instanceof ResultTreeType) {
- // falls through
- }
- else {
- _select = new CastExpr(_select, Type.String);
- }
- return Type.Void;
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- final Type tselect = _select.getType();
-
- final String CPY1_SIG = "("+NODE_ITERATOR_SIG+TRANSLET_OUTPUT_SIG+")V";
- final int cpy1 = cpg.addInterfaceMethodref(DOM_INTF, "copy", CPY1_SIG);
-
- final String CPY2_SIG = "("+NODE_SIG+TRANSLET_OUTPUT_SIG+")V";
- final int cpy2 = cpg.addInterfaceMethodref(DOM_INTF, "copy", CPY2_SIG);
-
- final String getDoc_SIG = "()"+NODE_SIG;
- final int getDoc = cpg.addInterfaceMethodref(DOM_INTF, "getDocument", getDoc_SIG);
-
-
- if (tselect instanceof NodeSetType) {
- il.append(methodGen.loadDOM());
-
- // push NodeIterator
- _select.translate(classGen, methodGen);
- _select.startIterator(classGen, methodGen);
-
- // call copy from the DOM 'library'
- il.append(methodGen.loadHandler());
- il.append(new INVOKEINTERFACE(cpy1, 3));
- }
- else if (tselect instanceof NodeType) {
- il.append(methodGen.loadDOM());
- _select.translate(classGen, methodGen);
- il.append(methodGen.loadHandler());
- il.append(new INVOKEINTERFACE(cpy2, 3));
- }
- else if (tselect instanceof ResultTreeType) {
- _select.translate(classGen, methodGen);
- // We want the whole tree, so we start with the root node
- il.append(DUP); //need a pointer to the DOM ;
- il.append(new INVOKEINTERFACE(getDoc,1)); //ICONST_0);
- il.append(methodGen.loadHandler());
- il.append(new INVOKEINTERFACE(cpy2, 3));
- }
- else if (tselect instanceof ReferenceType) {
- _select.translate(classGen, methodGen);
- il.append(methodGen.loadHandler());
- il.append(methodGen.loadCurrentNode());
- il.append(methodGen.loadDOM());
- final int copy = cpg.addMethodref(BASIS_LIBRARY_CLASS, "copy",
- "("
- + OBJECT_SIG
- + TRANSLET_OUTPUT_SIG
- + NODE_SIG
- + DOM_INTF_SIG
- + ")V");
- il.append(new INVOKESTATIC(copy));
- }
- else {
- il.append(classGen.loadTranslet());
- _select.translate(classGen, methodGen);
- il.append(methodGen.loadHandler());
- il.append(new INVOKEVIRTUAL(cpg.addMethodref(TRANSLET_CLASS,
- CHARACTERSW,
- CHARACTERSW_SIG)));
- }
-
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/CurrentCall.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/CurrentCall.java
deleted file mode 100644
index cca6ea3..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/CurrentCall.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: CurrentCall.java,v 1.2.4.1 2005/09/01 12:23:16 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-final class CurrentCall extends FunctionCall {
- public CurrentCall(QName fname) {
- super(fname);
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- methodGen.getInstructionList().append(methodGen.loadCurrentNode());
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/DecimalFormatting.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/DecimalFormatting.java
deleted file mode 100644
index 8c89eae..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/DecimalFormatting.java
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DecimalFormatting.java,v 1.2.4.1 2005/09/12 10:14:32 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.GETSTATIC;
-import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
-import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.NEW;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xml.internal.utils.XML11Char;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- */
-final class DecimalFormatting extends TopLevelElement {
-
- private static final String DFS_CLASS = "java.text.DecimalFormatSymbols";
- private static final String DFS_SIG = "Ljava/text/DecimalFormatSymbols;";
-
- private QName _name = null;
-
- /**
- * No type check needed for the <xsl:decimal-formatting/> element
- */
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- return Type.Void;
- }
-
- /**
- * Parse the name of the <xsl:decimal-formatting/> element
- */
- public void parseContents(Parser parser) {
- // Get the name of these decimal formatting symbols
- final String name = getAttribute("name");
- if (name.length() > 0) {
- if (!XML11Char.isXML11ValidQName(name)){
- ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_QNAME_ERR, name, this);
- parser.reportError(Constants.ERROR, err);
- }
- }
- _name = parser.getQNameIgnoreDefaultNs(name);
- if (_name == null) {
- _name = parser.getQNameIgnoreDefaultNs(EMPTYSTRING);
- }
-
- // Check if a set of symbols has already been registered under this name
- SymbolTable stable = parser.getSymbolTable();
- if (stable.getDecimalFormatting(_name) != null) {
- reportWarning(this, parser, ErrorMsg.SYMBOLS_REDEF_ERR,
- _name.toString());
- }
- else {
- stable.addDecimalFormatting(_name, this);
- }
- }
-
- /**
- * This method is called when the constructor is compiled in
- * Stylesheet.compileConstructor() and not as the syntax tree is traversed.
- */
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-
- ConstantPoolGen cpg = classGen.getConstantPool();
- InstructionList il = methodGen.getInstructionList();
-
- // DecimalFormatSymbols.<init>(Locale);
- // xsl:decimal-format - except for the NaN and infinity attributes.
- final int init = cpg.addMethodref(DFS_CLASS, "<init>",
- "("+LOCALE_SIG+")V");
-
- // Push the format name on the stack for call to addDecimalFormat()
- il.append(classGen.loadTranslet());
- il.append(new PUSH(cpg, _name.toString()));
-
- // Manufacture a DecimalFormatSymbols on the stack
- // for call to addDecimalFormat()
- // Use the US Locale as the default, as most of its settings
- // are equivalent to the default settings required of
- il.append(new NEW(cpg.addClass(DFS_CLASS)));
- il.append(DUP);
- il.append(new GETSTATIC(cpg.addFieldref(LOCALE_CLASS, "US",
- LOCALE_SIG)));
- il.append(new INVOKESPECIAL(init));
-
- String tmp = getAttribute("NaN");
- if ((tmp == null) || (tmp.equals(EMPTYSTRING))) {
- int nan = cpg.addMethodref(DFS_CLASS,
- "setNaN", "(Ljava/lang/String;)V");
- il.append(DUP);
- il.append(new PUSH(cpg, "NaN"));
- il.append(new INVOKEVIRTUAL(nan));
- }
-
- tmp = getAttribute("infinity");
- if ((tmp == null) || (tmp.equals(EMPTYSTRING))) {
- int inf = cpg.addMethodref(DFS_CLASS,
- "setInfinity",
- "(Ljava/lang/String;)V");
- il.append(DUP);
- il.append(new PUSH(cpg, "Infinity"));
- il.append(new INVOKEVIRTUAL(inf));
- }
-
- final int nAttributes = _attributes.getLength();
- for (int i = 0; i < nAttributes; i++) {
- final String name = _attributes.getQName(i);
- final String value = _attributes.getValue(i);
-
- boolean valid = true;
- int method = 0;
-
- if (name.equals("decimal-separator")) {
- // DecimalFormatSymbols.setDecimalSeparator();
- method = cpg.addMethodref(DFS_CLASS,
- "setDecimalSeparator", "(C)V");
- }
- else if (name.equals("grouping-separator")) {
- method = cpg.addMethodref(DFS_CLASS,
- "setGroupingSeparator", "(C)V");
- }
- else if (name.equals("minus-sign")) {
- method = cpg.addMethodref(DFS_CLASS,
- "setMinusSign", "(C)V");
- }
- else if (name.equals("percent")) {
- method = cpg.addMethodref(DFS_CLASS,
- "setPercent", "(C)V");
- }
- else if (name.equals("per-mille")) {
- method = cpg.addMethodref(DFS_CLASS,
- "setPerMill", "(C)V");
- }
- else if (name.equals("zero-digit")) {
- method = cpg.addMethodref(DFS_CLASS,
- "setZeroDigit", "(C)V");
- }
- else if (name.equals("digit")) {
- method = cpg.addMethodref(DFS_CLASS,
- "setDigit", "(C)V");
- }
- else if (name.equals("pattern-separator")) {
- method = cpg.addMethodref(DFS_CLASS,
- "setPatternSeparator", "(C)V");
- }
- else if (name.equals("NaN")) {
- method = cpg.addMethodref(DFS_CLASS,
- "setNaN", "(Ljava/lang/String;)V");
- il.append(DUP);
- il.append(new PUSH(cpg, value));
- il.append(new INVOKEVIRTUAL(method));
- valid = false;
- }
- else if (name.equals("infinity")) {
- method = cpg.addMethodref(DFS_CLASS,
- "setInfinity",
- "(Ljava/lang/String;)V");
- il.append(DUP);
- il.append(new PUSH(cpg, value));
- il.append(new INVOKEVIRTUAL(method));
- valid = false;
- }
- else {
- valid = false;
- }
-
- if (valid) {
- il.append(DUP);
- il.append(new PUSH(cpg, value.charAt(0)));
- il.append(new INVOKEVIRTUAL(method));
- }
-
- }
-
- final int put = cpg.addMethodref(TRANSLET_CLASS,
- "addDecimalFormat",
- "("+STRING_SIG+DFS_SIG+")V");
- il.append(new INVOKEVIRTUAL(put));
- }
-
- /**
- * Creates the default, nameless, DecimalFormat object in
- * AbstractTranslet's format_symbols hashtable.
- * This should be called for every stylesheet, and the entry
- * may be overridden by later nameless xsl:decimal-format instructions.
- */
- public static void translateDefaultDFS(ClassGenerator classGen,
- MethodGenerator methodGen) {
-
- ConstantPoolGen cpg = classGen.getConstantPool();
- InstructionList il = methodGen.getInstructionList();
- final int init = cpg.addMethodref(DFS_CLASS, "<init>",
- "("+LOCALE_SIG+")V");
-
- // Push the format name, which is empty, on the stack
- // for call to addDecimalFormat()
- il.append(classGen.loadTranslet());
- il.append(new PUSH(cpg, EMPTYSTRING));
-
- // Manufacture a DecimalFormatSymbols on the stack for
- // call to addDecimalFormat(). Use the US Locale as the
- // default, as most of its settings are equivalent to
- // the default settings required of xsl:decimal-format -
- // except for the NaN and infinity attributes.
- il.append(new NEW(cpg.addClass(DFS_CLASS)));
- il.append(DUP);
- il.append(new GETSTATIC(cpg.addFieldref(LOCALE_CLASS, "US",
- LOCALE_SIG)));
- il.append(new INVOKESPECIAL(init));
-
- int nan = cpg.addMethodref(DFS_CLASS,
- "setNaN", "(Ljava/lang/String;)V");
- il.append(DUP);
- il.append(new PUSH(cpg, "NaN"));
- il.append(new INVOKEVIRTUAL(nan));
-
- int inf = cpg.addMethodref(DFS_CLASS,
- "setInfinity",
- "(Ljava/lang/String;)V");
- il.append(DUP);
- il.append(new PUSH(cpg, "Infinity"));
- il.append(new INVOKEVIRTUAL(inf));
-
- final int put = cpg.addMethodref(TRANSLET_CLASS,
- "addDecimalFormat",
- "("+STRING_SIG+DFS_SIG+")V");
- il.append(new INVOKEVIRTUAL(put));
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/DocumentCall.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/DocumentCall.java
deleted file mode 100644
index 44063a3..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/DocumentCall.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DocumentCall.java,v 1.2.4.1 2005/09/01 14:10:13 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import java.util.Vector;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.GETFIELD;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-
-/**
- * @author Jacek Ambroziak
- * @author Morten Jorgensen
- */
-final class DocumentCall extends FunctionCall {
-
- private Expression _arg1 = null;
- private Expression _arg2 = null;
- private Type _arg1Type;
-
- /**
- * Default function call constructor
- */
- public DocumentCall(QName fname, Vector arguments) {
- super(fname, arguments);
- }
-
- /**
- * Type checks the arguments passed to the document() function. The first
- * argument can be any type (we must cast it to a string) and contains the
- * URI of the document
- */
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- // At least one argument - two at most
- final int ac = argumentCount();
- if ((ac < 1) || (ac > 2)) {
- ErrorMsg msg = new ErrorMsg(ErrorMsg.ILLEGAL_ARG_ERR, this);
- throw new TypeCheckError(msg);
- }
- if (getStylesheet() == null) {
- ErrorMsg msg = new ErrorMsg(ErrorMsg.ILLEGAL_ARG_ERR, this);
- throw new TypeCheckError(msg);
- }
-
- // Parse the first argument
- _arg1 = argument(0);
-
- if (_arg1 == null) {// should not happened
- ErrorMsg msg = new ErrorMsg(ErrorMsg.DOCUMENT_ARG_ERR, this);
- throw new TypeCheckError(msg);
- }
-
- _arg1Type = _arg1.typeCheck(stable);
- if ((_arg1Type != Type.NodeSet) && (_arg1Type != Type.String)) {
- _arg1 = new CastExpr(_arg1, Type.String);
- }
-
- // Parse the second argument
- if (ac == 2) {
- _arg2 = argument(1);
-
- if (_arg2 == null) {// should not happened
- ErrorMsg msg = new ErrorMsg(ErrorMsg.DOCUMENT_ARG_ERR, this);
- throw new TypeCheckError(msg);
- }
-
- final Type arg2Type = _arg2.typeCheck(stable);
-
- if (arg2Type.identicalTo(Type.Node)) {
- _arg2 = new CastExpr(_arg2, Type.NodeSet);
- } else if (arg2Type.identicalTo(Type.NodeSet)) {
- // falls through
- } else {
- ErrorMsg msg = new ErrorMsg(ErrorMsg.DOCUMENT_ARG_ERR, this);
- throw new TypeCheckError(msg);
- }
- }
-
- return _type = Type.NodeSet;
- }
-
- /**
- * Translates the document() function call to a call to LoadDocument()'s
- * static method document().
- */
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- final int ac = argumentCount();
-
- final int domField = cpg.addFieldref(classGen.getClassName(),
- DOM_FIELD,
- DOM_INTF_SIG);
-
- String docParamList = null;
- if (ac == 1) {
- // documentF(Object,String,AbstractTranslet,DOM)
- docParamList = "("+OBJECT_SIG+STRING_SIG+TRANSLET_SIG+DOM_INTF_SIG
- +")"+NODE_ITERATOR_SIG;
- } else { //ac == 2; ac < 1 or as >2 was tested in typeChec()
- // documentF(Object,DTMAxisIterator,String,AbstractTranslet,DOM)
- docParamList = "("+OBJECT_SIG+NODE_ITERATOR_SIG+STRING_SIG
- +TRANSLET_SIG+DOM_INTF_SIG+")"+NODE_ITERATOR_SIG;
- }
- final int docIdx = cpg.addMethodref(LOAD_DOCUMENT_CLASS, "documentF",
- docParamList);
-
-
- // The URI can be either a node-set or something else cast to a string
- _arg1.translate(classGen, methodGen);
- if (_arg1Type == Type.NodeSet) {
- _arg1.startIterator(classGen, methodGen);
- }
-
- if (ac == 2) {
- //_arg2 == null was tested in typeChec()
- _arg2.translate(classGen, methodGen);
- _arg2.startIterator(classGen, methodGen);
- }
-
- // Feck the rest of the parameters on the stack
- il.append(new PUSH(cpg, getStylesheet().getSystemId()));
- il.append(classGen.loadTranslet());
- il.append(DUP);
- il.append(new GETFIELD(domField));
- il.append(new INVOKESTATIC(docIdx));
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ElementAvailableCall.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ElementAvailableCall.java
deleted file mode 100644
index 4b49f1c..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ElementAvailableCall.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ElementAvailableCall.java,v 1.2.4.1 2005/09/01 14:13:01 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import java.util.Vector;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-final class ElementAvailableCall extends FunctionCall {
-
- public ElementAvailableCall(QName fname, Vector arguments) {
- super(fname, arguments);
- }
-
- /**
- * Force the argument to this function to be a literal string.
- */
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- if (argument() instanceof LiteralExpr) {
- return _type = Type.Boolean;
- }
- ErrorMsg err = new ErrorMsg(ErrorMsg.NEED_LITERAL_ERR,
- "element-available", this);
- throw new TypeCheckError(err);
- }
-
- /**
- * Returns an object representing the compile-time evaluation
- * of an expression. We are only using this for function-available
- * and element-available at this time.
- */
- public Object evaluateAtCompileTime() {
- return getResult() ? Boolean.TRUE : Boolean.FALSE;
- }
-
- /**
- * Returns the result that this function will return
- */
- public boolean getResult() {
- try {
- final LiteralExpr arg = (LiteralExpr) argument();
- final String qname = arg.getValue();
- final int index = qname.indexOf(':');
- final String localName = (index > 0) ?
- qname.substring(index + 1) : qname;
- return getParser().elementSupported(arg.getNamespace(),
- localName);
- }
- catch (ClassCastException e) {
- return false;
- }
- }
-
- /**
- * Calls to 'element-available' are resolved at compile time since
- * the namespaces declared in the stylsheet are not available at run
- * time. Consequently, arguments to this function must be literals.
- */
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final boolean result = getResult();
- methodGen.getInstructionList().append(new PUSH(cpg, result));
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/EqualityExpr.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/EqualityExpr.java
deleted file mode 100644
index e1d9b0a..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/EqualityExpr.java
+++ /dev/null
@@ -1,361 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: EqualityExpr.java,v 1.2.4.1 2005/09/12 10:16:52 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.BranchHandle;
-import com.sun.org.apache.bcel.internal.generic.BranchInstruction;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.GOTO;
-import com.sun.org.apache.bcel.internal.generic.IFEQ;
-import com.sun.org.apache.bcel.internal.generic.IFNE;
-import com.sun.org.apache.bcel.internal.generic.IF_ICMPEQ;
-import com.sun.org.apache.bcel.internal.generic.IF_ICMPNE;
-import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
-import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.BooleanType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.IntType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeSetType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NumberType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.RealType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ReferenceType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ResultTreeType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.StringType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.Operators;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- * @author Erwin Bolwidt <ejb@klomp.org>
- */
-final class EqualityExpr extends Expression {
-
- private final int _op;
- private Expression _left;
- private Expression _right;
-
- public EqualityExpr(int op, Expression left, Expression right) {
- _op = op;
- (_left = left).setParent(this);
- (_right = right).setParent(this);
- }
-
- public void setParser(Parser parser) {
- super.setParser(parser);
- _left.setParser(parser);
- _right.setParser(parser);
- }
-
- public String toString() {
- return Operators.getOpNames(_op) + '(' + _left + ", " + _right + ')';
- }
-
- public Expression getLeft() {
- return _left;
- }
-
- public Expression getRight() {
- return _right;
- }
-
- public boolean getOp() {
- return (_op != Operators.NE);
- }
-
- /**
- * Returns true if this expressions contains a call to position(). This is
- * needed for context changes in node steps containing multiple predicates.
- */
- public boolean hasPositionCall() {
- if (_left.hasPositionCall()) return true;
- if (_right.hasPositionCall()) return true;
- return false;
- }
-
- public boolean hasLastCall() {
- if (_left.hasLastCall()) return true;
- if (_right.hasLastCall()) return true;
- return false;
- }
-
- private void swapArguments() {
- final Expression temp = _left;
- _left = _right;
- _right = temp;
- }
-
- /**
- * Typing rules: see XSLT Reference by M. Kay page 345.
- */
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- final Type tleft = _left.typeCheck(stable);
- final Type tright = _right.typeCheck(stable);
-
- if (tleft.isSimple() && tright.isSimple()) {
- if (tleft != tright) {
- if (tleft instanceof BooleanType) {
- _right = new CastExpr(_right, Type.Boolean);
- }
- else if (tright instanceof BooleanType) {
- _left = new CastExpr(_left, Type.Boolean);
- }
- else if (tleft instanceof NumberType ||
- tright instanceof NumberType) {
- _left = new CastExpr(_left, Type.Real);
- _right = new CastExpr(_right, Type.Real);
- }
- else { // both compared as strings
- _left = new CastExpr(_left, Type.String);
- _right = new CastExpr(_right, Type.String);
- }
- }
- }
- else if (tleft instanceof ReferenceType) {
- _right = new CastExpr(_right, Type.Reference);
- }
- else if (tright instanceof ReferenceType) {
- _left = new CastExpr(_left, Type.Reference);
- }
- // the following 2 cases optimize @attr|.|.. = 'string'
- else if (tleft instanceof NodeType && tright == Type.String) {
- _left = new CastExpr(_left, Type.String);
- }
- else if (tleft == Type.String && tright instanceof NodeType) {
- _right = new CastExpr(_right, Type.String);
- }
- // optimize node/node
- else if (tleft instanceof NodeType && tright instanceof NodeType) {
- _left = new CastExpr(_left, Type.String);
- _right = new CastExpr(_right, Type.String);
- }
- else if (tleft instanceof NodeType && tright instanceof NodeSetType) {
- // compare(Node, NodeSet) will be invoked
- }
- else if (tleft instanceof NodeSetType && tright instanceof NodeType) {
- swapArguments(); // for compare(Node, NodeSet)
- }
- else {
- // At least one argument is of type node, node-set or result-tree
-
- // Promote an expression of type node to node-set
- if (tleft instanceof NodeType) {
- _left = new CastExpr(_left, Type.NodeSet);
- }
- if (tright instanceof NodeType) {
- _right = new CastExpr(_right, Type.NodeSet);
- }
-
- // If one arg is a node-set then make it the left one
- if (tleft.isSimple() ||
- tleft instanceof ResultTreeType &&
- tright instanceof NodeSetType) {
- swapArguments();
- }
-
- // Promote integers to doubles to have fewer compares
- if (_right.getType() instanceof IntType) {
- _right = new CastExpr(_right, Type.Real);
- }
- }
- return _type = Type.Boolean;
- }
-
- public void translateDesynthesized(ClassGenerator classGen,
- MethodGenerator methodGen) {
- final Type tleft = _left.getType();
- final InstructionList il = methodGen.getInstructionList();
-
- if (tleft instanceof BooleanType) {
- _left.translate(classGen, methodGen);
- _right.translate(classGen, methodGen);
- _falseList.add(il.append(_op == Operators.EQ ?
- (BranchInstruction)new IF_ICMPNE(null) :
- (BranchInstruction)new IF_ICMPEQ(null)));
- }
- else if (tleft instanceof NumberType) {
- _left.translate(classGen, methodGen);
- _right.translate(classGen, methodGen);
-
- if (tleft instanceof RealType) {
- il.append(DCMPG);
- _falseList.add(il.append(_op == Operators.EQ ?
- (BranchInstruction)new IFNE(null) :
- (BranchInstruction)new IFEQ(null)));
- }
- else {
- _falseList.add(il.append(_op == Operators.EQ ?
- (BranchInstruction)new IF_ICMPNE(null) :
- (BranchInstruction)new IF_ICMPEQ(null)));
- }
- }
- else {
- translate(classGen, methodGen);
- desynthesize(classGen, methodGen);
- }
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- final Type tleft = _left.getType();
- Type tright = _right.getType();
-
- if (tleft instanceof BooleanType || tleft instanceof NumberType) {
- translateDesynthesized(classGen, methodGen);
- synthesize(classGen, methodGen);
- return;
- }
-
- if (tleft instanceof StringType) {
- final int equals = cpg.addMethodref(STRING_CLASS,
- "equals",
- "(" + OBJECT_SIG +")Z");
- _left.translate(classGen, methodGen);
- _right.translate(classGen, methodGen);
- il.append(new INVOKEVIRTUAL(equals));
-
- if (_op == Operators.NE) {
- il.append(ICONST_1);
- il.append(IXOR); // not x <-> x xor 1
- }
- return;
- }
-
- BranchHandle truec, falsec;
-
- if (tleft instanceof ResultTreeType) {
- if (tright instanceof BooleanType) {
- _right.translate(classGen, methodGen);
- if (_op == Operators.NE) {
- il.append(ICONST_1);
- il.append(IXOR); // not x <-> x xor 1
- }
- return;
- }
-
- if (tright instanceof RealType) {
- _left.translate(classGen, methodGen);
- tleft.translateTo(classGen, methodGen, Type.Real);
- _right.translate(classGen, methodGen);
-
- il.append(DCMPG);
- falsec = il.append(_op == Operators.EQ ?
- (BranchInstruction) new IFNE(null) :
- (BranchInstruction) new IFEQ(null));
- il.append(ICONST_1);
- truec = il.append(new GOTO(null));
- falsec.setTarget(il.append(ICONST_0));
- truec.setTarget(il.append(NOP));
- return;
- }
-
- // Next, result-tree/string and result-tree/result-tree comparisons
-
- _left.translate(classGen, methodGen);
- tleft.translateTo(classGen, methodGen, Type.String);
- _right.translate(classGen, methodGen);
-
- if (tright instanceof ResultTreeType) {
- tright.translateTo(classGen, methodGen, Type.String);
- }
-
- final int equals = cpg.addMethodref(STRING_CLASS,
- "equals",
- "(" +OBJECT_SIG+ ")Z");
- il.append(new INVOKEVIRTUAL(equals));
-
- if (_op == Operators.NE) {
- il.append(ICONST_1);
- il.append(IXOR); // not x <-> x xor 1
- }
- return;
- }
-
- if (tleft instanceof NodeSetType && tright instanceof BooleanType) {
- _left.translate(classGen, methodGen);
- _left.startIterator(classGen, methodGen);
- Type.NodeSet.translateTo(classGen, methodGen, Type.Boolean);
- _right.translate(classGen, methodGen);
-
- il.append(IXOR); // x != y <-> x xor y
- if (_op == Operators.EQ) {
- il.append(ICONST_1);
- il.append(IXOR); // not x <-> x xor 1
- }
- return;
- }
-
- if (tleft instanceof NodeSetType && tright instanceof StringType) {
- _left.translate(classGen, methodGen);
- _left.startIterator(classGen, methodGen); // needed ?
- _right.translate(classGen, methodGen);
- il.append(new PUSH(cpg, _op));
- il.append(methodGen.loadDOM());
- final int cmp = cpg.addMethodref(BASIS_LIBRARY_CLASS,
- "compare",
- "("
- + tleft.toSignature()
- + tright.toSignature()
- + "I"
- + DOM_INTF_SIG
- + ")Z");
- il.append(new INVOKESTATIC(cmp));
- return;
- }
-
- // Next, node-set/t for t in {real, string, node-set, result-tree}
- _left.translate(classGen, methodGen);
- _left.startIterator(classGen, methodGen);
- _right.translate(classGen, methodGen);
- _right.startIterator(classGen, methodGen);
-
- // Cast a result tree to a string to use an existing compare
- if (tright instanceof ResultTreeType) {
- tright.translateTo(classGen, methodGen, Type.String);
- tright = Type.String;
- }
-
- // Call the appropriate compare() from the BasisLibrary
- il.append(new PUSH(cpg, _op));
- il.append(methodGen.loadDOM());
-
- final int compare = cpg.addMethodref(BASIS_LIBRARY_CLASS,
- "compare",
- "("
- + tleft.toSignature()
- + tright.toSignature()
- + "I"
- + DOM_INTF_SIG
- + ")Z");
- il.append(new INVOKESTATIC(compare));
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Expression.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Expression.java
deleted file mode 100644
index 64e440d..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Expression.java
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Expression.java,v 1.2.4.1 2005/09/01 14:17:51 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import java.util.Vector;
-
-import com.sun.org.apache.bcel.internal.generic.BranchHandle;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.GOTO_W;
-import com.sun.org.apache.bcel.internal.generic.IFEQ;
-import com.sun.org.apache.bcel.internal.generic.InstructionHandle;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.BooleanType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeSetType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- * @author Erwin Bolwidt <ejb@klomp.org>
- */
-abstract class Expression extends SyntaxTreeNode {
- /**
- * The type of this expression. It is set after calling
- * <code>typeCheck()</code>.
- */
- protected Type _type;
-
- /**
- * Instruction handles that comprise the true list.
- */
- protected FlowList _trueList = new FlowList();
-
- /**
- * Instruction handles that comprise the false list.
- */
- protected FlowList _falseList = new FlowList();
-
- public Type getType() {
- return _type;
- }
-
- public abstract String toString();
-
- public boolean hasPositionCall() {
- return false; // default should be 'false' for StepPattern
- }
-
- public boolean hasLastCall() {
- return false;
- }
-
- /**
- * Returns an object representing the compile-time evaluation
- * of an expression. We are only using this for function-available
- * and element-available at this time.
- */
- public Object evaluateAtCompileTime() {
- return null;
- }
-
- /**
- * Type check all the children of this node.
- */
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- return typeCheckContents(stable);
- }
-
- /**
- * Translate this node into JVM bytecodes.
- */
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- ErrorMsg msg = new ErrorMsg(ErrorMsg.NOT_IMPLEMENTED_ERR,
- getClass(), this);
- getParser().reportError(FATAL, msg);
- }
-
- /**
- * Translate this node into a fresh instruction list.
- * The original instruction list is saved and restored.
- */
- public final InstructionList compile(ClassGenerator classGen,
- MethodGenerator methodGen) {
- final InstructionList result, save = methodGen.getInstructionList();
- methodGen.setInstructionList(result = new InstructionList());
- translate(classGen, methodGen);
- methodGen.setInstructionList(save);
- return result;
- }
-
- /**
- * Redefined by expressions of type boolean that use flow lists.
- */
- public void translateDesynthesized(ClassGenerator classGen,
- MethodGenerator methodGen) {
- translate(classGen, methodGen);
- if (_type instanceof BooleanType) {
- desynthesize(classGen, methodGen);
- }
- }
-
- /**
- * If this expression is of type node-set and it is not a variable
- * reference, then call setStartNode() passing the context node.
- */
- public void startIterator(ClassGenerator classGen,
- MethodGenerator methodGen) {
- // Ignore if type is not node-set
- if (_type instanceof NodeSetType == false) {
- return;
- }
-
- // setStartNode() should not be called if expr is a variable ref
- Expression expr = this;
- if (expr instanceof CastExpr) {
- expr = ((CastExpr) expr).getExpr();
- }
- if (expr instanceof VariableRefBase == false) {
- final InstructionList il = methodGen.getInstructionList();
- il.append(methodGen.loadContextNode());
- il.append(methodGen.setStartNode());
- }
- }
-
- /**
- * Synthesize a boolean expression, i.e., either push a 0 or 1 onto the
- * operand stack for the next statement to succeed. Returns the handle
- * of the instruction to be backpatched.
- */
- public void synthesize(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- _trueList.backPatch(il.append(ICONST_1));
- final BranchHandle truec = il.append(new GOTO_W(null));
- _falseList.backPatch(il.append(ICONST_0));
- truec.setTarget(il.append(NOP));
- }
-
- public void desynthesize(ClassGenerator classGen,
- MethodGenerator methodGen) {
- final InstructionList il = methodGen.getInstructionList();
- _falseList.add(il.append(new IFEQ(null)));
- }
-
- public FlowList getFalseList() {
- return _falseList;
- }
-
- public FlowList getTrueList() {
- return _trueList;
- }
-
- public void backPatchFalseList(InstructionHandle ih) {
- _falseList.backPatch(ih);
- }
-
- public void backPatchTrueList(InstructionHandle ih) {
- _trueList.backPatch(ih);
- }
-
- /**
- * Search for a primop in the symbol table that matches the method type
- * <code>ctype</code>. Two methods match if they have the same arity.
- * If a primop is overloaded then the "closest match" is returned. The
- * first entry in the vector of primops that has the right arity is
- * considered to be the default one.
- */
- public MethodType lookupPrimop(SymbolTable stable, String op,
- MethodType ctype) {
- MethodType result = null;
- final Vector primop = stable.lookupPrimop(op);
- if (primop != null) {
- final int n = primop.size();
- int minDistance = Integer.MAX_VALUE;
- for (int i = 0; i < n; i++) {
- final MethodType ptype = (MethodType) primop.elementAt(i);
- // Skip if different arity
- if (ptype.argsCount() != ctype.argsCount()) {
- continue;
- }
-
- // The first method with the right arity is the default
- if (result == null) {
- result = ptype; // default method
- }
-
- // Check if better than last one found
- final int distance = ctype.distanceTo(ptype);
- if (distance < minDistance) {
- minDistance = distance;
- result = ptype;
- }
- }
- }
- return result;
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Fallback.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Fallback.java
deleted file mode 100644
index d04eb9a..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Fallback.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Fallback.java,v 1.2.4.1 2005/09/01 14:22:25 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-
-/**
- * @author Morten Jorgensen
- */
-final class Fallback extends Instruction {
-
- private boolean _active = false;
-
- /**
- * This element never produces any data on the stack
- */
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- if (_active) {
- return(typeCheckContents(stable));
- }
- else {
- return Type.Void;
- }
- }
-
- /**
- * Activate this fallback element
- */
- public void activate() {
- _active = true;
- }
-
- public String toString() {
- return("fallback");
- }
-
- /**
- * Parse contents only if this fallback element is put in place of
- * some unsupported element or non-XSLTC extension element
- */
- public void parseContents(Parser parser) {
- if (_active) parseChildren(parser);
- }
-
- /**
- * Translate contents only if this fallback element is put in place of
- * some unsupported element or non-XSLTC extension element
- */
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- if (_active) translateContents(classGen, methodGen);
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/FilterExpr.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/FilterExpr.java
deleted file mode 100644
index c484283..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/FilterExpr.java
+++ /dev/null
@@ -1,254 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FilterExpr.java,v 1.2.4.1 2005/09/12 10:22:50 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import java.util.Vector;
-
-import com.sun.org.apache.bcel.internal.generic.ALOAD;
-import com.sun.org.apache.bcel.internal.generic.ASTORE;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.ILOAD;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
-import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.ISTORE;
-import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
-import com.sun.org.apache.bcel.internal.generic.NEW;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeSetType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ReferenceType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- */
-class FilterExpr extends Expression {
-
- /**
- * Primary expression of this filter. I.e., 'e' in '(e)[p1]...[pn]'.
- */
- private Expression _primary;
-
- /**
- * Array of predicates in '(e)[p1]...[pn]'.
- */
- private final Vector _predicates;
-
- public FilterExpr(Expression primary, Vector predicates) {
- _primary = primary;
- _predicates = predicates;
- primary.setParent(this);
- }
-
- protected Expression getExpr() {
- if (_primary instanceof CastExpr)
- return ((CastExpr)_primary).getExpr();
- else
- return _primary;
- }
-
- public void setParser(Parser parser) {
- super.setParser(parser);
- _primary.setParser(parser);
- if (_predicates != null) {
- final int n = _predicates.size();
- for (int i = 0; i < n; i++) {
- final Expression exp = (Expression)_predicates.elementAt(i);
- exp.setParser(parser);
- exp.setParent(this);
- }
- }
- }
-
- public String toString() {
- return "filter-expr(" + _primary + ", " + _predicates + ")";
- }
-
- /**
- * Type check a FilterParentPath. If the filter is not a node-set add a
- * cast to node-set only if it is of reference type. This type coercion
- * is needed for expressions like $x where $x is a parameter reference.
- * All optimizations are turned off before type checking underlying
- * predicates.
- */
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- Type ptype = _primary.typeCheck(stable);
- boolean canOptimize = _primary instanceof KeyCall;
-
- if (ptype instanceof NodeSetType == false) {
- if (ptype instanceof ReferenceType) {
- _primary = new CastExpr(_primary, Type.NodeSet);
- }
- else {
- throw new TypeCheckError(this);
- }
- }
-
- // Type check predicates and turn all optimizations off if appropriate
- int n = _predicates.size();
- for (int i = 0; i < n; i++) {
- Predicate pred = (Predicate) _predicates.elementAt(i);
-
- if (!canOptimize) {
- pred.dontOptimize();
- }
- pred.typeCheck(stable);
- }
- return _type = Type.NodeSet;
- }
-
- /**
- * Translate a filter expression by pushing the appropriate iterator
- * onto the stack.
- */
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- translateFilterExpr(classGen, methodGen, _predicates == null ? -1 : _predicates.size() - 1);
- }
-
- private void translateFilterExpr(ClassGenerator classGen,
- MethodGenerator methodGen,
- int predicateIndex) {
- if (predicateIndex >= 0) {
- translatePredicates(classGen, methodGen, predicateIndex);
- }
- else {
- _primary.translate(classGen, methodGen);
- }
- }
-
- /**
- * Translate a sequence of predicates. Each predicate is translated
- * by constructing an instance of <code>CurrentNodeListIterator</code>
- * which is initialized from another iterator (recursive call), a
- * filter and a closure (call to translate on the predicate) and "this".
- */
- public void translatePredicates(ClassGenerator classGen,
- MethodGenerator methodGen,
- int predicateIndex) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- // If not predicates left, translate primary expression
- if (predicateIndex < 0) {
- translateFilterExpr(classGen, methodGen, predicateIndex);
- }
- else {
- // Get the next predicate to be translated
- Predicate predicate = (Predicate) _predicates.get(predicateIndex--);
-
- // Translate the rest of the predicates from right to left
- translatePredicates(classGen, methodGen, predicateIndex);
-
- if (predicate.isNthPositionFilter()) {
- int nthIteratorIdx = cpg.addMethodref(NTH_ITERATOR_CLASS,
- "<init>",
- "("+NODE_ITERATOR_SIG+"I)V");
-
- // Backwards branches are prohibited if an uninitialized object
- // is on the stack by section 4.9.4 of the JVM Specification,
- // 2nd Ed. We don't know whether this code might contain
- // backwards branches, so we mustn't create the new object unti
-
- // after we've created the suspect arguments to its constructor
-
- // Instead we calculate the values of the arguments to the
- // constructor first, store them in temporary variables, create
- // the object and reload the arguments from the temporaries to
- // avoid the problem.
- LocalVariableGen iteratorTemp
- = methodGen.addLocalVariable("filter_expr_tmp1",
- Util.getJCRefType(NODE_ITERATOR_SIG),
- null, null);
- iteratorTemp.setStart(
- il.append(new ASTORE(iteratorTemp.getIndex())));
-
- predicate.translate(classGen, methodGen);
- LocalVariableGen predicateValueTemp
- = methodGen.addLocalVariable("filter_expr_tmp2",
- Util.getJCRefType("I"),
- null, null);
- predicateValueTemp.setStart(
- il.append(new ISTORE(predicateValueTemp.getIndex())));
-
- il.append(new NEW(cpg.addClass(NTH_ITERATOR_CLASS)));
- il.append(DUP);
- iteratorTemp.setEnd(
- il.append(new ALOAD(iteratorTemp.getIndex())));
- predicateValueTemp.setEnd(
- il.append(new ILOAD(predicateValueTemp.getIndex())));
- il.append(new INVOKESPECIAL(nthIteratorIdx));
- } else {
- // Translate predicates from right to left
- final int initCNLI = cpg.addMethodref(CURRENT_NODE_LIST_ITERATOR,
- "<init>",
- "("+NODE_ITERATOR_SIG+"Z"+
- CURRENT_NODE_LIST_FILTER_SIG +
- NODE_SIG+TRANSLET_SIG+")V");
-
- // Backwards branches are prohibited if an uninitialized object is
- // on the stack by section 4.9.4 of the JVM Specification, 2nd Ed.
- // We don't know whether this code might contain backwards branches,
- // so we mustn't create the new object until after we've created
- // the suspect arguments to its constructor. Instead we calculate
- // the values of the arguments to the constructor first, store them
- // in temporary variables, create the object and reload the
- // arguments from the temporaries to avoid the problem.
-
-
- LocalVariableGen nodeIteratorTemp =
- methodGen.addLocalVariable("filter_expr_tmp1",
- Util.getJCRefType(NODE_ITERATOR_SIG),
- null, null);
- nodeIteratorTemp.setStart(
- il.append(new ASTORE(nodeIteratorTemp.getIndex())));
-
- predicate.translate(classGen, methodGen);
- LocalVariableGen filterTemp =
- methodGen.addLocalVariable("filter_expr_tmp2",
- Util.getJCRefType(CURRENT_NODE_LIST_FILTER_SIG),
- null, null);
- filterTemp.setStart(il.append(new ASTORE(filterTemp.getIndex())));
-
- // Create a CurrentNodeListIterator
- il.append(new NEW(cpg.addClass(CURRENT_NODE_LIST_ITERATOR)));
- il.append(DUP);
-
- // Initialize CurrentNodeListIterator
- nodeIteratorTemp.setEnd(
- il.append(new ALOAD(nodeIteratorTemp.getIndex())));
- il.append(ICONST_1);
- filterTemp.setEnd(il.append(new ALOAD(filterTemp.getIndex())));
- il.append(methodGen.loadCurrentNode());
- il.append(classGen.loadTranslet());
- il.append(new INVOKESPECIAL(initCNLI));
- }
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/FilterParentPath.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/FilterParentPath.java
deleted file mode 100644
index 2d3b75d..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/FilterParentPath.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FilterParentPath.java,v 1.2.4.1 2005/09/12 10:24:55 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.ALOAD;
-import com.sun.org.apache.bcel.internal.generic.ASTORE;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
-import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
-import com.sun.org.apache.bcel.internal.generic.NEW;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeSetType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ReferenceType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-final class FilterParentPath extends Expression {
-
- private Expression _filterExpr;
- private Expression _path;
- private boolean _hasDescendantAxis = false;
-
- public FilterParentPath(Expression filterExpr, Expression path) {
- (_path = path).setParent(this);
- (_filterExpr = filterExpr).setParent(this);
- }
-
- public void setParser(Parser parser) {
- super.setParser(parser);
- _filterExpr.setParser(parser);
- _path.setParser(parser);
- }
-
- public String toString() {
- return "FilterParentPath(" + _filterExpr + ", " + _path + ')';
- }
-
- public void setDescendantAxis() {
- _hasDescendantAxis = true;
- }
-
- /**
- * Type check a FilterParentPath. If the filter is not a node-set add a
- * cast to node-set only if it is of reference type. This type coercion is
- * needed for expressions like $x/LINE where $x is a parameter reference.
- */
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- final Type ftype = _filterExpr.typeCheck(stable);
- if (ftype instanceof NodeSetType == false) {
- if (ftype instanceof ReferenceType) {
- _filterExpr = new CastExpr(_filterExpr, Type.NodeSet);
- }
- /*
- else if (ftype instanceof ResultTreeType) {
- _filterExpr = new CastExpr(_filterExpr, Type.NodeSet);
- }
- */
- else if (ftype instanceof NodeType) {
- _filterExpr = new CastExpr(_filterExpr, Type.NodeSet);
- }
- else {
- throw new TypeCheckError(this);
- }
- }
-
- // Wrap single node path in a node set
- final Type ptype = _path.typeCheck(stable);
- if (!(ptype instanceof NodeSetType)) {
- _path = new CastExpr(_path, Type.NodeSet);
- }
-
- return _type = Type.NodeSet;
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- // Create new StepIterator
- final int initSI = cpg.addMethodref(STEP_ITERATOR_CLASS,
- "<init>",
- "("
- +NODE_ITERATOR_SIG
- +NODE_ITERATOR_SIG
- +")V");
-
- // Backwards branches are prohibited if an uninitialized object is
- // on the stack by section 4.9.4 of the JVM Specification, 2nd Ed.
- // We don't know whether this code might contain backwards branches,
- // so we mustn't create the new object until after we've created
- // the suspect arguments to its constructor. Instead we calculate
- // the values of the arguments to the constructor first, store them
- // in temporary variables, create the object and reload the
- // arguments from the temporaries to avoid the problem.
-
- // Recursively compile 2 iterators
- _filterExpr.translate(classGen, methodGen);
- LocalVariableGen filterTemp =
- methodGen.addLocalVariable("filter_parent_path_tmp1",
- Util.getJCRefType(NODE_ITERATOR_SIG),
- null, null);
- filterTemp.setStart(il.append(new ASTORE(filterTemp.getIndex())));
-
- _path.translate(classGen, methodGen);
- LocalVariableGen pathTemp =
- methodGen.addLocalVariable("filter_parent_path_tmp2",
- Util.getJCRefType(NODE_ITERATOR_SIG),
- null, null);
- pathTemp.setStart(il.append(new ASTORE(pathTemp.getIndex())));
-
- il.append(new NEW(cpg.addClass(STEP_ITERATOR_CLASS)));
- il.append(DUP);
- filterTemp.setEnd(il.append(new ALOAD(filterTemp.getIndex())));
- pathTemp.setEnd(il.append(new ALOAD(pathTemp.getIndex())));
-
- // Initialize StepIterator with iterators from the stack
- il.append(new INVOKESPECIAL(initSI));
-
- // This is a special case for the //* path with or without predicates
- if (_hasDescendantAxis) {
- final int incl = cpg.addMethodref(NODE_ITERATOR_BASE,
- "includeSelf",
- "()" + NODE_ITERATOR_SIG);
- il.append(new INVOKEVIRTUAL(incl));
- }
-
- SyntaxTreeNode parent = getParent();
-
- boolean parentAlreadyOrdered =
- (parent instanceof RelativeLocationPath)
- || (parent instanceof FilterParentPath)
- || (parent instanceof KeyCall)
- || (parent instanceof CurrentCall)
- || (parent instanceof DocumentCall);
-
- if (!parentAlreadyOrdered) {
- final int order = cpg.addInterfaceMethodref(DOM_INTF,
- ORDER_ITERATOR,
- ORDER_ITERATOR_SIG);
- il.append(methodGen.loadDOM());
- il.append(SWAP);
- il.append(methodGen.loadContextNode());
- il.append(new INVOKEINTERFACE(order, 3));
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/FilteredAbsoluteLocationPath.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/FilteredAbsoluteLocationPath.java
deleted file mode 100644
index 82174b5..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/FilteredAbsoluteLocationPath.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FilteredAbsoluteLocationPath.java,v 1.2.4.1 2005/09/12 10:26:50 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.ALOAD;
-import com.sun.org.apache.bcel.internal.generic.ASTORE;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
-import com.sun.org.apache.bcel.internal.generic.NEW;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-
-/**
- * @author G. Todd Miller
- */
-final class FilteredAbsoluteLocationPath extends Expression {
- private Expression _path; // may be null
-
- public FilteredAbsoluteLocationPath() {
- _path = null;
- }
-
- public FilteredAbsoluteLocationPath(Expression path) {
- _path = path;
- if (path != null) {
- _path.setParent(this);
- }
- }
-
- public void setParser(Parser parser) {
- super.setParser(parser);
- if (_path != null) {
- _path.setParser(parser);
- }
- }
-
- public Expression getPath() {
- return(_path);
- }
-
- public String toString() {
- return "FilteredAbsoluteLocationPath(" +
- (_path != null ? _path.toString() : "null") + ')';
- }
-
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- if (_path != null) {
- final Type ptype = _path.typeCheck(stable);
- if (ptype instanceof NodeType) { // promote to node-set
- _path = new CastExpr(_path, Type.NodeSet);
- }
- }
- return _type = Type.NodeSet;
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- if (_path != null) {
- final int initDFI = cpg.addMethodref(DUP_FILTERED_ITERATOR,
- "<init>",
- "("
- + NODE_ITERATOR_SIG
- + ")V");
-
- // Backwards branches are prohibited if an uninitialized object is
- // on the stack by section 4.9.4 of the JVM Specification, 2nd Ed.
- // We don't know whether this code might contain backwards branches,
- // so we mustn't create the new object until after we've created
- // the suspect arguments to its constructor. Instead we calculate
- // the values of the arguments to the constructor first, store them
- // in temporary variables, create the object and reload the
- // arguments from the temporaries to avoid the problem.
-
- // Compile relative path iterator(s)
- LocalVariableGen pathTemp =
- methodGen.addLocalVariable("filtered_absolute_location_path_tmp",
- Util.getJCRefType(NODE_ITERATOR_SIG),
- null, null);
- _path.translate(classGen, methodGen);
- pathTemp.setStart(il.append(new ASTORE(pathTemp.getIndex())));
-
- // Create new Dup Filter Iterator
- il.append(new NEW(cpg.addClass(DUP_FILTERED_ITERATOR)));
- il.append(DUP);
- pathTemp.setEnd(il.append(new ALOAD(pathTemp.getIndex())));
-
- // Initialize Dup Filter Iterator with iterator from the stack
- il.append(new INVOKESPECIAL(initDFI));
- }
- else {
- final int git = cpg.addInterfaceMethodref(DOM_INTF,
- "getIterator",
- "()"+NODE_ITERATOR_SIG);
- il.append(methodGen.loadDOM());
- il.append(new INVOKEINTERFACE(git, 1));
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/FloorCall.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/FloorCall.java
deleted file mode 100644
index bd39136..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/FloorCall.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FloorCall.java,v 1.2.4.1 2005/09/01 15:16:15 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import java.util.Vector;
-
-import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-final class FloorCall extends FunctionCall {
- public FloorCall(QName fname, Vector arguments) {
- super(fname, arguments);
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- argument().translate(classGen, methodGen);
- methodGen.getInstructionList()
- .append(new INVOKESTATIC(classGen.getConstantPool()
- .addMethodref(MATH_CLASS,
- "floor", "(D)D")));
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/FlowList.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/FlowList.java
deleted file mode 100644
index 43244b3..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/FlowList.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FlowList.java,v 1.2.4.1 2005/09/01 15:21:43 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import java.util.Iterator;
-import java.util.Vector;
-
-import com.sun.org.apache.bcel.internal.generic.BranchHandle;
-import com.sun.org.apache.bcel.internal.generic.InstructionHandle;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-public final class FlowList {
- private Vector _elements;
-
- public FlowList() {
- _elements = null;
- }
-
- public FlowList(InstructionHandle bh) {
- _elements = new Vector();
- _elements.addElement(bh);
- }
-
- public FlowList(FlowList list) {
- _elements = list._elements;
- }
-
- public FlowList add(InstructionHandle bh) {
- if (_elements == null) {
- _elements = new Vector();
- }
- _elements.addElement(bh);
- return this;
- }
-
- public FlowList append(FlowList right) {
- if (_elements == null) {
- _elements = right._elements;
- }
- else {
- final Vector temp = right._elements;
- if (temp != null) {
- final int n = temp.size();
- for (int i = 0; i < n; i++) {
- _elements.addElement(temp.elementAt(i));
- }
- }
- }
- return this;
- }
-
- /**
- * Back patch a flow list. All instruction handles must be branch handles.
- */
- public void backPatch(InstructionHandle target) {
- if (_elements != null) {
- final int n = _elements.size();
- for (int i = 0; i < n; i++) {
- BranchHandle bh = (BranchHandle)_elements.elementAt(i);
- bh.setTarget(target);
- }
- _elements.clear(); // avoid backpatching more than once
- }
- }
-
- /**
- * Redirect the handles from oldList to newList. "This" flow list
- * is assumed to be relative to oldList.
- */
- public FlowList copyAndRedirect(InstructionList oldList,
- InstructionList newList)
- {
- final FlowList result = new FlowList();
- if (_elements == null) {
- return result;
- }
-
- final int n = _elements.size();
- final Iterator oldIter = oldList.iterator();
- final Iterator newIter = newList.iterator();
-
- while (oldIter.hasNext()) {
- final InstructionHandle oldIh = (InstructionHandle) oldIter.next();
- final InstructionHandle newIh = (InstructionHandle) newIter.next();
-
- for (int i = 0; i < n; i++) {
- if (_elements.elementAt(i) == oldIh) {
- result.add(newIh);
- }
- }
- }
- return result;
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ForEach.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ForEach.java
deleted file mode 100644
index 9b350d7..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ForEach.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ForEach.java,v 1.2.4.1 2005/09/01 15:23:46 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.BranchHandle;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.GOTO;
-import com.sun.org.apache.bcel.internal.generic.IFGT;
-import com.sun.org.apache.bcel.internal.generic.InstructionHandle;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeSetType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ReferenceType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ResultTreeType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-import java.util.Iterator;
-import java.util.Vector;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- */
-final class ForEach extends Instruction {
-
- private Expression _select;
- private Type _type;
-
- public void display(int indent) {
- indent(indent);
- Util.println("ForEach");
- indent(indent + IndentIncrement);
- Util.println("select " + _select.toString());
- displayContents(indent + IndentIncrement);
- }
-
- public void parseContents(Parser parser) {
- _select = parser.parseExpression(this, "select", null);
-
- parseChildren(parser);
-
- // make sure required attribute(s) have been set
- if (_select.isDummy()) {
- reportError(this, parser, ErrorMsg.REQUIRED_ATTR_ERR, "select");
- }
- }
-
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- _type = _select.typeCheck(stable);
-
- if (_type instanceof ReferenceType || _type instanceof NodeType) {
- _select = new CastExpr(_select, Type.NodeSet);
- typeCheckContents(stable);
- return Type.Void;
- }
- if (_type instanceof NodeSetType||_type instanceof ResultTreeType) {
- typeCheckContents(stable);
- return Type.Void;
- }
- throw new TypeCheckError(this);
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- // Save current node and current iterator on the stack
- il.append(methodGen.loadCurrentNode());
- il.append(methodGen.loadIterator());
-
- // Collect sort objects associated with this instruction
- final Vector sortObjects = new Vector();
- Iterator<SyntaxTreeNode> children = elements();
- while (children.hasNext()) {
- final SyntaxTreeNode child = children.next();
- if (child instanceof Sort) {
- sortObjects.addElement(child);
- }
- }
-
- if ((_type != null) && (_type instanceof ResultTreeType)) {
- // Store existing DOM on stack - must be restored when loop is done
- il.append(methodGen.loadDOM());
-
- // <xsl:sort> cannot be applied to a result tree - issue warning
- if (sortObjects.size() > 0) {
- ErrorMsg msg = new ErrorMsg(ErrorMsg.RESULT_TREE_SORT_ERR,this);
- getParser().reportError(WARNING, msg);
- }
-
- // Put the result tree on the stack (DOM)
- _select.translate(classGen, methodGen);
- // Get an iterator for the whole DOM - excluding the root node
- _type.translateTo(classGen, methodGen, Type.NodeSet);
- // Store the result tree as the default DOM
- il.append(SWAP);
- il.append(methodGen.storeDOM());
- }
- else {
- // Compile node iterator
- if (sortObjects.size() > 0) {
- Sort.translateSortIterator(classGen, methodGen,
- _select, sortObjects);
- }
- else {
- _select.translate(classGen, methodGen);
- }
-
- if (_type instanceof ReferenceType == false) {
- il.append(methodGen.loadContextNode());
- il.append(methodGen.setStartNode());
- }
- }
-
-
- // Overwrite current iterator
- il.append(methodGen.storeIterator());
-
- // Give local variables (if any) default values before starting loop
- initializeVariables(classGen, methodGen);
-
- final BranchHandle nextNode = il.append(new GOTO(null));
- final InstructionHandle loop = il.append(NOP);
-
- translateContents(classGen, methodGen);
-
- nextNode.setTarget(il.append(methodGen.loadIterator()));
- il.append(methodGen.nextNode());
- il.append(DUP);
- il.append(methodGen.storeCurrentNode());
- il.append(new IFGT(loop));
-
- // Restore current DOM (if result tree was used instead for this loop)
- if ((_type != null) && (_type instanceof ResultTreeType)) {
- il.append(methodGen.storeDOM());
- }
-
- // Restore current node and current iterator from the stack
- il.append(methodGen.storeIterator());
- il.append(methodGen.storeCurrentNode());
- }
-
- /**
- * The code that is generated by nested for-each loops can appear to some
- * JVMs as if it is accessing un-initialized variables. We must add some
- * code that pushes the default variable value on the stack and pops it
- * into the variable slot. This is done by the Variable.initialize()
- * method. The code that we compile for this loop looks like this:
- *
- * initialize iterator
- * initialize variables <-- HERE!!!
- * goto Iterate
- * Loop: :
- * : (code for <xsl:for-each> contents)
- * :
- * Iterate: node = iterator.next();
- * if (node != END) goto Loop
- */
- public void initializeVariables(ClassGenerator classGen,
- MethodGenerator methodGen) {
- final int n = elementCount();
- for (int i = 0; i < n; i++) {
- final SyntaxTreeNode child = getContents().get(i);
- if (child instanceof Variable) {
- Variable var = (Variable)child;
- var.initialize(classGen, methodGen);
- }
- }
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/FormatNumberCall.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/FormatNumberCall.java
deleted file mode 100644
index 4aa9311..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/FormatNumberCall.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FormatNumberCall.java,v 1.2.4.1 2005/09/01 15:26:46 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import java.util.Vector;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
-import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.RealType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.StringType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- */
-final class FormatNumberCall extends FunctionCall {
- private Expression _value;
- private Expression _format;
- private Expression _name;
- private QName _resolvedQName = null;
-
- public FormatNumberCall(QName fname, Vector arguments) {
- super(fname, arguments);
- _value = argument(0);
- _format = argument(1);
- _name = argumentCount() == 3 ? argument(2) : null;
- }
-
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-
- // Inform stylesheet to instantiate a DecimalFormat object
- getStylesheet().numberFormattingUsed();
-
- final Type tvalue = _value.typeCheck(stable);
- if (tvalue instanceof RealType == false) {
- _value = new CastExpr(_value, Type.Real);
- }
- final Type tformat = _format.typeCheck(stable);
- if (tformat instanceof StringType == false) {
- _format = new CastExpr(_format, Type.String);
- }
- if (argumentCount() == 3) {
- final Type tname = _name.typeCheck(stable);
-
- if (_name instanceof LiteralExpr) {
- final LiteralExpr literal = (LiteralExpr) _name;
- _resolvedQName =
- getParser().getQNameIgnoreDefaultNs(literal.getValue());
- }
- else if (tname instanceof StringType == false) {
- _name = new CastExpr(_name, Type.String);
- }
- }
- return _type = Type.String;
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- _value.translate(classGen, methodGen);
- _format.translate(classGen, methodGen);
-
- final int fn3arg = cpg.addMethodref(BASIS_LIBRARY_CLASS,
- "formatNumber",
- "(DLjava/lang/String;"+
- "Ljava/text/DecimalFormat;)"+
- "Ljava/lang/String;");
- final int get = cpg.addMethodref(TRANSLET_CLASS,
- "getDecimalFormat",
- "(Ljava/lang/String;)"+
- "Ljava/text/DecimalFormat;");
-
- il.append(classGen.loadTranslet());
- if (_name == null) {
- il.append(new PUSH(cpg, EMPTYSTRING));
- }
- else if (_resolvedQName != null) {
- il.append(new PUSH(cpg, _resolvedQName.toString()));
- }
- else {
- _name.translate(classGen, methodGen);
- }
- il.append(new INVOKEVIRTUAL(get));
- il.append(new INVOKESTATIC(fn3arg));
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/FunctionAvailableCall.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/FunctionAvailableCall.java
deleted file mode 100644
index 8cad427..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/FunctionAvailableCall.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FunctionAvailableCall.java,v 1.2.4.1 2005/09/01 15:30:25 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.util.Vector;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
-
-/**
- * @author G. Todd Miller
- * @author Santiago Pericas-Geertsen
- */
-final class FunctionAvailableCall extends FunctionCall {
-
- private Expression _arg;
- private String _nameOfFunct = null;
- private String _namespaceOfFunct = null;
- private boolean _isFunctionAvailable = false;
-
- /**
- * Constructs a FunctionAvailableCall FunctionCall. Takes the
- * function name qname, for example, 'function-available', and
- * a list of arguments where the arguments must be instances of
- * LiteralExpression.
- */
- public FunctionAvailableCall(QName fname, Vector arguments) {
- super(fname, arguments);
- _arg = (Expression)arguments.elementAt(0);
- _type = null;
-
- if (_arg instanceof LiteralExpr) {
- LiteralExpr arg = (LiteralExpr) _arg;
- _namespaceOfFunct = arg.getNamespace();
- _nameOfFunct = arg.getValue();
-
- if (!isInternalNamespace()) {
- _isFunctionAvailable = hasMethods();
- }
- }
- }
-
- /**
- * Argument of function-available call must be literal, typecheck
- * returns the type of function-available to be boolean.
- */
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- if (_type != null) {
- return _type;
- }
- if (_arg instanceof LiteralExpr) {
- return _type = Type.Boolean;
- }
- ErrorMsg err = new ErrorMsg(ErrorMsg.NEED_LITERAL_ERR,
- "function-available", this);
- throw new TypeCheckError(err);
- }
-
- /**
- * Returns an object representing the compile-time evaluation
- * of an expression. We are only using this for function-available
- * and element-available at this time.
- */
- public Object evaluateAtCompileTime() {
- return getResult() ? Boolean.TRUE : Boolean.FALSE;
- }
-
- /**
- * for external java functions only: reports on whether or not
- * the specified method is found in the specifed class.
- */
- private boolean hasMethods() {
- LiteralExpr arg = (LiteralExpr)_arg;
-
- // Get the class name from the namespace uri
- String className = getClassNameFromUri(_namespaceOfFunct);
-
- // Get the method name from the argument to function-available
- String methodName = null;
- int colonIndex = _nameOfFunct.indexOf(":");
- if (colonIndex > 0) {
- String functionName = _nameOfFunct.substring(colonIndex+1);
- int lastDotIndex = functionName.lastIndexOf('.');
- if (lastDotIndex > 0) {
- methodName = functionName.substring(lastDotIndex+1);
- if (className != null && !className.equals(""))
- className = className + "." + functionName.substring(0, lastDotIndex);
- else
- className = functionName.substring(0, lastDotIndex);
- }
- else
- methodName = functionName;
- }
- else
- methodName = _nameOfFunct;
-
- if (className == null || methodName == null) {
- return false;
- }
-
- // Replace the '-' characters in the method name
- if (methodName.indexOf('-') > 0)
- methodName = replaceDash(methodName);
-
- try {
- final Class clazz = ObjectFactory.findProviderClass(className, true);
-
- if (clazz == null) {
- return false;
- }
-
- final Method[] methods = clazz.getMethods();
-
- for (int i = 0; i < methods.length; i++) {
- final int mods = methods[i].getModifiers();
-
- if (Modifier.isPublic(mods) && Modifier.isStatic(mods)
- && methods[i].getName().equals(methodName))
- {
- return true;
- }
- }
- }
- catch (ClassNotFoundException e) {
- return false;
- }
- return false;
- }
-
- /**
- * Reports on whether the function specified in the argument to
- * xslt function 'function-available' was found.
- */
- public boolean getResult() {
- if (_nameOfFunct == null) {
- return false;
- }
-
- if (isInternalNamespace()) {
- final Parser parser = getParser();
- _isFunctionAvailable =
- parser.functionSupported(Util.getLocalName(_nameOfFunct));
- }
- return _isFunctionAvailable;
- }
-
- /**
- * Return true if the namespace uri is null or it is the XSLTC translet uri.
- */
- private boolean isInternalNamespace() {
- return (_namespaceOfFunct == null ||
- _namespaceOfFunct.equals(EMPTYSTRING) ||
- _namespaceOfFunct.equals(TRANSLET_URI));
- }
-
- /**
- * Calls to 'function-available' are resolved at compile time since
- * the namespaces declared in the stylsheet are not available at run
- * time. Consequently, arguments to this function must be literals.
- */
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- methodGen.getInstructionList().append(new PUSH(cpg, getResult()));
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/FunctionCall.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/FunctionCall.java
deleted file mode 100644
index 11b3241..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/FunctionCall.java
+++ /dev/null
@@ -1,1148 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FunctionCall.java,v 1.2.4.1 2005/09/12 10:31:32 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.IFEQ;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
-import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
-import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
-import com.sun.org.apache.bcel.internal.generic.InstructionConstants;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.InvokeInstruction;
-import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
-import com.sun.org.apache.bcel.internal.generic.NEW;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.xalan.internal.utils.FeatureManager;
-import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.BooleanType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.IntType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MultiHashtable;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ObjectType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ReferenceType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Vector;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- * @author Erwin Bolwidt <ejb@klomp.org>
- * @author Todd Miller
- */
-class FunctionCall extends Expression {
-
- // Name of this function call
- private QName _fname;
- // Arguments to this function call (might not be any)
- private final Vector _arguments;
- // Empty argument list, used for certain functions
- private final static Vector EMPTY_ARG_LIST = new Vector(0);
-
- // Valid namespaces for Java function-call extension
- protected final static String EXT_XSLTC =
- TRANSLET_URI;
-
- protected final static String JAVA_EXT_XSLTC =
- EXT_XSLTC + "/java";
-
- protected final static String EXT_XALAN =
- "http://xml.apache.org/xalan";
-
- protected final static String JAVA_EXT_XALAN =
- "http://xml.apache.org/xalan/java";
-
- protected final static String JAVA_EXT_XALAN_OLD =
- "http://xml.apache.org/xslt/java";
-
- protected final static String EXSLT_COMMON =
- "http://exslt.org/common";
-
- protected final static String EXSLT_MATH =
- "http://exslt.org/math";
-
- protected final static String EXSLT_SETS =
- "http://exslt.org/sets";
-
- protected final static String EXSLT_DATETIME =
- "http://exslt.org/dates-and-times";
-
- protected final static String EXSLT_STRINGS =
- "http://exslt.org/strings";
-
- protected final static String XALAN_CLASSPACKAGE_NAMESPACE =
- "xalan://";
-
- // Namespace format constants
- protected final static int NAMESPACE_FORMAT_JAVA = 0;
- protected final static int NAMESPACE_FORMAT_CLASS = 1;
- protected final static int NAMESPACE_FORMAT_PACKAGE = 2;
- protected final static int NAMESPACE_FORMAT_CLASS_OR_PACKAGE = 3;
-
- // Namespace format
- private int _namespace_format = NAMESPACE_FORMAT_JAVA;
-
- /**
- * Stores reference to object for non-static Java calls
- */
- Expression _thisArgument = null;
-
- // External Java function's class/method/signature
- private String _className;
- private Class _clazz;
- private Method _chosenMethod;
- private Constructor _chosenConstructor;
- private MethodType _chosenMethodType;
-
- // Encapsulates all unsupported external function calls
- private boolean unresolvedExternal;
-
- // If FunctionCall is a external java constructor
- private boolean _isExtConstructor = false;
-
- // If the java method is static
- private boolean _isStatic = false;
-
- // Legal conversions between internal and Java types.
- private static final MultiHashtable<Type, JavaType> _internal2Java = new MultiHashtable<>();
-
- // Legal conversions between Java and internal types.
- private static final Map<Class<?>, Type> JAVA2INTERNAL;
-
- // The mappings between EXSLT extension namespaces and implementation classes
- private static final Map<String, String> EXTENSIONNAMESPACE;
-
- // Extension functions that are implemented in BasisLibrary
- private static final Map<String, String> EXTENSIONFUNCTION;
- /**
- * inner class to used in internal2Java mappings, contains
- * the Java type and the distance between the internal type and
- * the Java type.
- */
- static class JavaType {
- public Class<?> type;
- public int distance;
-
- public JavaType(Class type, int distance){
- this.type = type;
- this.distance = distance;
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(this.type);
- }
-
- @Override
- public boolean equals(Object query) {
- if (query == null) {
- return false;
- }
- if (query.getClass().isAssignableFrom(JavaType.class)) {
- return ((JavaType)query).type.equals(type);
- } else {
- return query.equals(type);
- }
- }
- }
-
- /**
- * Defines 2 conversion tables:
- * 1. From internal types to Java types and
- * 2. From Java types to internal types.
- * These two tables are used when calling external (Java) functions.
- */
- static {
- final Class<?> nodeClass, nodeListClass;
- try {
- nodeClass = Class.forName("org.w3c.dom.Node");
- nodeListClass = Class.forName("org.w3c.dom.NodeList");
- }
- catch (ClassNotFoundException e) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR,"org.w3c.dom.Node or NodeList");
- throw new ExceptionInInitializerError(err.toString());
- }
-
- // -- Internal to Java --------------------------------------------
-
- // Type.Boolean -> { boolean(0), Boolean(1), Object(2) }
- _internal2Java.put(Type.Boolean, new JavaType(Boolean.TYPE, 0));
- _internal2Java.put(Type.Boolean, new JavaType(Boolean.class, 1));
- _internal2Java.put(Type.Boolean, new JavaType(Object.class, 2));
-
- // Type.Real -> { double(0), Double(1), float(2), long(3), int(4),
- // short(5), byte(6), char(7), Object(8) }
- _internal2Java.put(Type.Real, new JavaType(Double.TYPE, 0));
- _internal2Java.put(Type.Real, new JavaType(Double.class, 1));
- _internal2Java.put(Type.Real, new JavaType(Float.TYPE, 2));
- _internal2Java.put(Type.Real, new JavaType(Long.TYPE, 3));
- _internal2Java.put(Type.Real, new JavaType(Integer.TYPE, 4));
- _internal2Java.put(Type.Real, new JavaType(Short.TYPE, 5));
- _internal2Java.put(Type.Real, new JavaType(Byte.TYPE, 6));
- _internal2Java.put(Type.Real, new JavaType(Character.TYPE, 7));
- _internal2Java.put(Type.Real, new JavaType(Object.class, 8));
-
- // Type.Int must be the same as Type.Real
- _internal2Java.put(Type.Int, new JavaType(Double.TYPE, 0));
- _internal2Java.put(Type.Int, new JavaType(Double.class, 1));
- _internal2Java.put(Type.Int, new JavaType(Float.TYPE, 2));
- _internal2Java.put(Type.Int, new JavaType(Long.TYPE, 3));
- _internal2Java.put(Type.Int, new JavaType(Integer.TYPE, 4));
- _internal2Java.put(Type.Int, new JavaType(Short.TYPE, 5));
- _internal2Java.put(Type.Int, new JavaType(Byte.TYPE, 6));
- _internal2Java.put(Type.Int, new JavaType(Character.TYPE, 7));
- _internal2Java.put(Type.Int, new JavaType(Object.class, 8));
-
- // Type.String -> { String(0), Object(1) }
- _internal2Java.put(Type.String, new JavaType(String.class, 0));
- _internal2Java.put(Type.String, new JavaType(Object.class, 1));
-
- // Type.NodeSet -> { NodeList(0), Node(1), Object(2), String(3) }
- _internal2Java.put(Type.NodeSet, new JavaType(nodeListClass, 0));
- _internal2Java.put(Type.NodeSet, new JavaType(nodeClass, 1));
- _internal2Java.put(Type.NodeSet, new JavaType(Object.class, 2));
- _internal2Java.put(Type.NodeSet, new JavaType(String.class, 3));
-
- // Type.Node -> { Node(0), NodeList(1), Object(2), String(3) }
- _internal2Java.put(Type.Node, new JavaType(nodeListClass, 0));
- _internal2Java.put(Type.Node, new JavaType(nodeClass, 1));
- _internal2Java.put(Type.Node, new JavaType(Object.class, 2));
- _internal2Java.put(Type.Node, new JavaType(String.class, 3));
-
- // Type.ResultTree -> { NodeList(0), Node(1), Object(2), String(3) }
- _internal2Java.put(Type.ResultTree, new JavaType(nodeListClass, 0));
- _internal2Java.put(Type.ResultTree, new JavaType(nodeClass, 1));
- _internal2Java.put(Type.ResultTree, new JavaType(Object.class, 2));
- _internal2Java.put(Type.ResultTree, new JavaType(String.class, 3));
-
- _internal2Java.put(Type.Reference, new JavaType(Object.class, 0));
-
- _internal2Java.makeUnmodifiable();
-
- Map<Class<?>, Type> java2Internal = new HashMap<>();
- Map<String, String> extensionNamespaceTable = new HashMap<>();
- Map<String, String> extensionFunctionTable = new HashMap<>();
-
- // Possible conversions between Java and internal types
- java2Internal.put(Boolean.TYPE, Type.Boolean);
- java2Internal.put(Void.TYPE, Type.Void);
- java2Internal.put(Character.TYPE, Type.Real);
- java2Internal.put(Byte.TYPE, Type.Real);
- java2Internal.put(Short.TYPE, Type.Real);
- java2Internal.put(Integer.TYPE, Type.Real);
- java2Internal.put(Long.TYPE, Type.Real);
- java2Internal.put(Float.TYPE, Type.Real);
- java2Internal.put(Double.TYPE, Type.Real);
-
- java2Internal.put(String.class, Type.String);
-
- java2Internal.put(Object.class, Type.Reference);
-
- // Conversions from org.w3c.dom.Node/NodeList to internal NodeSet
- java2Internal.put(nodeListClass, Type.NodeSet);
- java2Internal.put(nodeClass, Type.NodeSet);
-
- // Initialize the extension namespace table
- extensionNamespaceTable.put(EXT_XALAN, "com.sun.org.apache.xalan.internal.lib.Extensions");
- extensionNamespaceTable.put(EXSLT_COMMON, "com.sun.org.apache.xalan.internal.lib.ExsltCommon");
- extensionNamespaceTable.put(EXSLT_MATH, "com.sun.org.apache.xalan.internal.lib.ExsltMath");
- extensionNamespaceTable.put(EXSLT_SETS, "com.sun.org.apache.xalan.internal.lib.ExsltSets");
- extensionNamespaceTable.put(EXSLT_DATETIME, "com.sun.org.apache.xalan.internal.lib.ExsltDatetime");
- extensionNamespaceTable.put(EXSLT_STRINGS, "com.sun.org.apache.xalan.internal.lib.ExsltStrings");
-
- // Initialize the extension function table
- extensionFunctionTable.put(EXSLT_COMMON + ":nodeSet", "nodeset");
- extensionFunctionTable.put(EXSLT_COMMON + ":objectType", "objectType");
- extensionFunctionTable.put(EXT_XALAN + ":nodeset", "nodeset");
-
- JAVA2INTERNAL = Collections.unmodifiableMap(java2Internal);
- EXTENSIONNAMESPACE = Collections.unmodifiableMap(extensionNamespaceTable);
- EXTENSIONFUNCTION = Collections.unmodifiableMap(extensionFunctionTable);
-
- }
-
- public FunctionCall(QName fname, Vector arguments) {
- _fname = fname;
- _arguments = arguments;
- _type = null;
- }
-
- public FunctionCall(QName fname) {
- this(fname, EMPTY_ARG_LIST);
- }
-
- public String getName() {
- return(_fname.toString());
- }
-
- @Override
- public void setParser(Parser parser) {
- super.setParser(parser);
- if (_arguments != null) {
- final int n = _arguments.size();
- for (int i = 0; i < n; i++) {
- final Expression exp = (Expression)_arguments.elementAt(i);
- exp.setParser(parser);
- exp.setParent(this);
- }
- }
- }
-
- public String getClassNameFromUri(String uri)
- {
- String className = EXTENSIONNAMESPACE.get(uri);
-
- if (className != null)
- return className;
- else {
- if (uri.startsWith(JAVA_EXT_XSLTC)) {
- int length = JAVA_EXT_XSLTC.length() + 1;
- return (uri.length() > length) ? uri.substring(length) : EMPTYSTRING;
- }
- else if (uri.startsWith(JAVA_EXT_XALAN)) {
- int length = JAVA_EXT_XALAN.length() + 1;
- return (uri.length() > length) ? uri.substring(length) : EMPTYSTRING;
- }
- else if (uri.startsWith(JAVA_EXT_XALAN_OLD)) {
- int length = JAVA_EXT_XALAN_OLD.length() + 1;
- return (uri.length() > length) ? uri.substring(length) : EMPTYSTRING;
- }
- else {
- int index = uri.lastIndexOf('/');
- return (index > 0) ? uri.substring(index+1) : uri;
- }
- }
- }
-
- /**
- * Type check a function call. Since different type conversions apply,
- * type checking is different for standard and external (Java) functions.
- */
- @Override
- public Type typeCheck(SymbolTable stable)
- throws TypeCheckError
- {
- if (_type != null) return _type;
-
- final String namespace = _fname.getNamespace();
- String local = _fname.getLocalPart();
-
- if (isExtension()) {
- _fname = new QName(null, null, local);
- return typeCheckStandard(stable);
- }
- else if (isStandard()) {
- return typeCheckStandard(stable);
- }
- // Handle extension functions (they all have a namespace)
- else {
- try {
- _className = getClassNameFromUri(namespace);
-
- final int pos = local.lastIndexOf('.');
- if (pos > 0) {
- _isStatic = true;
- if (_className != null && _className.length() > 0) {
- _namespace_format = NAMESPACE_FORMAT_PACKAGE;
- _className = _className + "." + local.substring(0, pos);
- }
- else {
- _namespace_format = NAMESPACE_FORMAT_JAVA;
- _className = local.substring(0, pos);
- }
-
- _fname = new QName(namespace, null, local.substring(pos + 1));
- }
- else {
- if (_className != null && _className.length() > 0) {
- try {
- _clazz = ObjectFactory.findProviderClass(_className, true);
- _namespace_format = NAMESPACE_FORMAT_CLASS;
- }
- catch (ClassNotFoundException e) {
- _namespace_format = NAMESPACE_FORMAT_PACKAGE;
- }
- }
- else
- _namespace_format = NAMESPACE_FORMAT_JAVA;
-
- if (local.indexOf('-') > 0) {
- local = replaceDash(local);
- }
-
- String extFunction = EXTENSIONFUNCTION.get(namespace + ":" + local);
- if (extFunction != null) {
- _fname = new QName(null, null, extFunction);
- return typeCheckStandard(stable);
- }
- else
- _fname = new QName(namespace, null, local);
- }
-
- return typeCheckExternal(stable);
- }
- catch (TypeCheckError e) {
- ErrorMsg errorMsg = e.getErrorMsg();
- if (errorMsg == null) {
- final String name = _fname.getLocalPart();
- errorMsg = new ErrorMsg(ErrorMsg.METHOD_NOT_FOUND_ERR, name);
- }
- getParser().reportError(ERROR, errorMsg);
- return _type = Type.Void;
- }
- }
- }
-
- /**
- * Type check a call to a standard function. Insert CastExprs when needed.
- * If as a result of the insertion of a CastExpr a type check error is
- * thrown, then catch it and re-throw it with a new "this".
- */
- public Type typeCheckStandard(SymbolTable stable) throws TypeCheckError {
- _fname.clearNamespace(); // HACK!!!
-
- final int n = _arguments.size();
- final Vector argsType = typeCheckArgs(stable);
- final MethodType args = new MethodType(Type.Void, argsType);
- final MethodType ptype =
- lookupPrimop(stable, _fname.getLocalPart(), args);
-
- if (ptype != null) {
- for (int i = 0; i < n; i++) {
- final Type argType = (Type) ptype.argsType().elementAt(i);
- final Expression exp = (Expression)_arguments.elementAt(i);
- if (!argType.identicalTo(exp.getType())) {
- try {
- _arguments.setElementAt(new CastExpr(exp, argType), i);
- }
- catch (TypeCheckError e) {
- throw new TypeCheckError(this); // invalid conversion
- }
- }
- }
- _chosenMethodType = ptype;
- return _type = ptype.resultType();
- }
- throw new TypeCheckError(this);
- }
-
-
-
- public Type typeCheckConstructor(SymbolTable stable) throws TypeCheckError{
- final Vector constructors = findConstructors();
- if (constructors == null) {
- // Constructor not found in this class
- throw new TypeCheckError(ErrorMsg.CONSTRUCTOR_NOT_FOUND,
- _className);
-
- }
-
- final int nConstructors = constructors.size();
- final int nArgs = _arguments.size();
- final Vector argsType = typeCheckArgs(stable);
-
- // Try all constructors
- int bestConstrDistance = Integer.MAX_VALUE;
- _type = null; // reset
- for (int j, i = 0; i < nConstructors; i++) {
- // Check if all parameters to this constructor can be converted
- final Constructor constructor =
- (Constructor)constructors.elementAt(i);
- final Class[] paramTypes = constructor.getParameterTypes();
-
- Class<?> extType;
- int currConstrDistance = 0;
- for (j = 0; j < nArgs; j++) {
- // Convert from internal (translet) type to external (Java) type
- extType = paramTypes[j];
- final Type intType = (Type)argsType.elementAt(j);
- JavaType match = _internal2Java.maps(intType, new JavaType(extType, 0));
- if (match != null) {
- currConstrDistance += match.distance;
- }
- else if (intType instanceof ObjectType) {
- ObjectType objectType = (ObjectType)intType;
- if (objectType.getJavaClass() == extType)
- continue;
- else if (extType.isAssignableFrom(objectType.getJavaClass()))
- currConstrDistance += 1;
- else {
- currConstrDistance = Integer.MAX_VALUE;
- break;
- }
- }
- else {
- // no mapping available
- currConstrDistance = Integer.MAX_VALUE;
- break;
- }
- }
-
- if (j == nArgs && currConstrDistance < bestConstrDistance ) {
- _chosenConstructor = constructor;
- _isExtConstructor = true;
- bestConstrDistance = currConstrDistance;
-
- _type = (_clazz != null) ? Type.newObjectType(_clazz)
- : Type.newObjectType(_className);
- }
- }
-
- if (_type != null) {
- return _type;
- }
-
- throw new TypeCheckError(ErrorMsg.ARGUMENT_CONVERSION_ERR, getMethodSignature(argsType));
- }
-
-
- /**
- * Type check a call to an external (Java) method.
- * The method must be static an public, and a legal type conversion
- * must exist for all its arguments and its return type.
- * Every method of name <code>_fname</code> is inspected
- * as a possible candidate.
- */
- public Type typeCheckExternal(SymbolTable stable) throws TypeCheckError {
- int nArgs = _arguments.size();
- final String name = _fname.getLocalPart();
-
- // check if function is a contructor 'new'
- if (_fname.getLocalPart().equals("new")) {
- return typeCheckConstructor(stable);
- }
- // check if we are calling an instance method
- else {
- boolean hasThisArgument = false;
-
- if (nArgs == 0)
- _isStatic = true;
-
- if (!_isStatic) {
- if (_namespace_format == NAMESPACE_FORMAT_JAVA
- || _namespace_format == NAMESPACE_FORMAT_PACKAGE)
- hasThisArgument = true;
-
- Expression firstArg = (Expression)_arguments.elementAt(0);
- Type firstArgType = (Type)firstArg.typeCheck(stable);
-
- if (_namespace_format == NAMESPACE_FORMAT_CLASS
- && firstArgType instanceof ObjectType
- && _clazz != null
- && _clazz.isAssignableFrom(((ObjectType)firstArgType).getJavaClass()))
- hasThisArgument = true;
-
- if (hasThisArgument) {
- _thisArgument = (Expression) _arguments.elementAt(0);
- _arguments.remove(0); nArgs--;
- if (firstArgType instanceof ObjectType) {
- _className = ((ObjectType) firstArgType).getJavaClassName();
- }
- else
- throw new TypeCheckError(ErrorMsg.NO_JAVA_FUNCT_THIS_REF, name);
- }
- }
- else if (_className.length() == 0) {
- /*
- * Warn user if external function could not be resolved.
- * Warning will _NOT_ be issued is the call is properly
- * wrapped in an <xsl:if> or <xsl:when> element. For details
- * see If.parserContents() and When.parserContents()
- */
- final Parser parser = getParser();
- if (parser != null) {
- reportWarning(this, parser, ErrorMsg.FUNCTION_RESOLVE_ERR,
- _fname.toString());
- }
- unresolvedExternal = true;
- return _type = Type.Int; // use "Int" as "unknown"
- }
- }
-
- final Vector methods = findMethods();
-
- if (methods == null) {
- // Method not found in this class
- throw new TypeCheckError(ErrorMsg.METHOD_NOT_FOUND_ERR, _className + "." + name);
- }
-
- Class extType = null;
- final int nMethods = methods.size();
- final Vector argsType = typeCheckArgs(stable);
-
- // Try all methods to identify the best fit
- int bestMethodDistance = Integer.MAX_VALUE;
- _type = null; // reset internal type
- for (int j, i = 0; i < nMethods; i++) {
- // Check if all paramteters to this method can be converted
- final Method method = (Method)methods.elementAt(i);
- final Class[] paramTypes = method.getParameterTypes();
-
- int currMethodDistance = 0;
- for (j = 0; j < nArgs; j++) {
- // Convert from internal (translet) type to external (Java) type
- extType = paramTypes[j];
- final Type intType = (Type)argsType.elementAt(j);
- JavaType match = _internal2Java.maps(intType, new JavaType(extType, 0));
- if (match != null) {
- currMethodDistance += match.distance;
- }
- else {
- // no mapping available
- //
- // Allow a Reference type to match any external (Java) type at
- // the moment. The real type checking is performed at runtime.
- if (intType instanceof ReferenceType) {
- currMethodDistance += 1;
- }
- else if (intType instanceof ObjectType) {
- ObjectType object = (ObjectType)intType;
- if (extType.getName().equals(object.getJavaClassName()))
- currMethodDistance += 0;
- else if (extType.isAssignableFrom(object.getJavaClass()))
- currMethodDistance += 1;
- else {
- currMethodDistance = Integer.MAX_VALUE;
- break;
- }
- }
- else {
- currMethodDistance = Integer.MAX_VALUE;
- break;
- }
- }
- }
-
- if (j == nArgs) {
- // Check if the return type can be converted
- extType = method.getReturnType();
-
- _type = JAVA2INTERNAL.get(extType);
- if (_type == null) {
- _type = Type.newObjectType(extType);
- }
-
- // Use this method if all parameters & return type match
- if (_type != null && currMethodDistance < bestMethodDistance) {
- _chosenMethod = method;
- bestMethodDistance = currMethodDistance;
- }
- }
- }
-
- // It is an error if the chosen method is an instance menthod but we don't
- // have a this argument.
- if (_chosenMethod != null && _thisArgument == null &&
- !Modifier.isStatic(_chosenMethod.getModifiers())) {
- throw new TypeCheckError(ErrorMsg.NO_JAVA_FUNCT_THIS_REF, getMethodSignature(argsType));
- }
-
- if (_type != null) {
- if (_type == Type.NodeSet) {
- getXSLTC().setMultiDocument(true);
- }
- return _type;
- }
-
- throw new TypeCheckError(ErrorMsg.ARGUMENT_CONVERSION_ERR, getMethodSignature(argsType));
- }
-
- /**
- * Type check the actual arguments of this function call.
- */
- public Vector typeCheckArgs(SymbolTable stable) throws TypeCheckError {
- final Vector result = new Vector();
- final Enumeration e = _arguments.elements();
- while (e.hasMoreElements()) {
- final Expression exp = (Expression)e.nextElement();
- result.addElement(exp.typeCheck(stable));
- }
- return result;
- }
-
- protected final Expression argument(int i) {
- return (Expression)_arguments.elementAt(i);
- }
-
- protected final Expression argument() {
- return argument(0);
- }
-
- protected final int argumentCount() {
- return _arguments.size();
- }
-
- protected final void setArgument(int i, Expression exp) {
- _arguments.setElementAt(exp, i);
- }
-
- /**
- * Compile the function call and treat as an expression
- * Update true/false-lists.
- */
- @Override
- public void translateDesynthesized(ClassGenerator classGen,
- MethodGenerator methodGen)
- {
- Type type = Type.Boolean;
- if (_chosenMethodType != null)
- type = _chosenMethodType.resultType();
-
- final InstructionList il = methodGen.getInstructionList();
- translate(classGen, methodGen);
-
- if ((type instanceof BooleanType) || (type instanceof IntType)) {
- _falseList.add(il.append(new IFEQ(null)));
- }
- }
-
-
- /**
- * Translate a function call. The compiled code will leave the function's
- * return value on the JVM's stack.
- */
- @Override
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final int n = argumentCount();
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- final boolean isSecureProcessing = classGen.getParser().getXSLTC().isSecureProcessing();
- final boolean isExtensionFunctionEnabled = classGen.getParser().getXSLTC()
- .getFeature(FeatureManager.Feature.ORACLE_ENABLE_EXTENSION_FUNCTION);
- int index;
-
- // Translate calls to methods in the BasisLibrary
- if (isStandard() || isExtension()) {
- for (int i = 0; i < n; i++) {
- final Expression exp = argument(i);
- exp.translate(classGen, methodGen);
- exp.startIterator(classGen, methodGen);
- }
-
- // append "F" to the function's name
- final String name = _fname.toString().replace('-', '_') + "F";
- String args = Constants.EMPTYSTRING;
-
- // Special precautions for some method calls
- if (name.equals("sumF")) {
- args = DOM_INTF_SIG;
- il.append(methodGen.loadDOM());
- }
- else if (name.equals("normalize_spaceF")) {
- if (_chosenMethodType.toSignature(args).
- equals("()Ljava/lang/String;")) {
- args = "I"+DOM_INTF_SIG;
- il.append(methodGen.loadContextNode());
- il.append(methodGen.loadDOM());
- }
- }
-
- // Invoke the method in the basis library
- index = cpg.addMethodref(BASIS_LIBRARY_CLASS, name,
- _chosenMethodType.toSignature(args));
- il.append(new INVOKESTATIC(index));
- }
- // Add call to BasisLibrary.unresolved_externalF() to generate
- // run-time error message for unsupported external functions
- else if (unresolvedExternal) {
- index = cpg.addMethodref(BASIS_LIBRARY_CLASS,
- "unresolved_externalF",
- "(Ljava/lang/String;)V");
- il.append(new PUSH(cpg, _fname.toString()));
- il.append(new INVOKESTATIC(index));
- }
- else if (_isExtConstructor) {
- if (isSecureProcessing && !isExtensionFunctionEnabled)
- translateUnallowedExtension(cpg, il);
-
- final String clazz =
- _chosenConstructor.getDeclaringClass().getName();
- Class[] paramTypes = _chosenConstructor.getParameterTypes();
- LocalVariableGen[] paramTemp = new LocalVariableGen[n];
-
- // Backwards branches are prohibited if an uninitialized object is
- // on the stack by section 4.9.4 of the JVM Specification, 2nd Ed.
- // We don't know whether this code might contain backwards branches
- // so we mustn't create the new object until after we've created
- // the suspect arguments to its constructor. Instead we calculate
- // the values of the arguments to the constructor first, store them
- // in temporary variables, create the object and reload the
- // arguments from the temporaries to avoid the problem.
-
- for (int i = 0; i < n; i++) {
- final Expression exp = argument(i);
- Type expType = exp.getType();
- exp.translate(classGen, methodGen);
- // Convert the argument to its Java type
- exp.startIterator(classGen, methodGen);
- expType.translateTo(classGen, methodGen, paramTypes[i]);
- paramTemp[i] =
- methodGen.addLocalVariable("function_call_tmp"+i,
- expType.toJCType(),
- null, null);
- paramTemp[i].setStart(
- il.append(expType.STORE(paramTemp[i].getIndex())));
-
- }
-
- il.append(new NEW(cpg.addClass(_className)));
- il.append(InstructionConstants.DUP);
-
- for (int i = 0; i < n; i++) {
- final Expression arg = argument(i);
- paramTemp[i].setEnd(
- il.append(arg.getType().LOAD(paramTemp[i].getIndex())));
- }
-
- final StringBuffer buffer = new StringBuffer();
- buffer.append('(');
- for (int i = 0; i < paramTypes.length; i++) {
- buffer.append(getSignature(paramTypes[i]));
- }
- buffer.append(')');
- buffer.append("V");
-
- index = cpg.addMethodref(clazz,
- "<init>",
- buffer.toString());
- il.append(new INVOKESPECIAL(index));
-
- // Convert the return type back to our internal type
- (Type.Object).translateFrom(classGen, methodGen,
- _chosenConstructor.getDeclaringClass());
-
- }
- // Invoke function calls that are handled in separate classes
- else {
- if (isSecureProcessing && !isExtensionFunctionEnabled)
- translateUnallowedExtension(cpg, il);
-
- final String clazz = _chosenMethod.getDeclaringClass().getName();
- Class[] paramTypes = _chosenMethod.getParameterTypes();
-
- // Push "this" if it is an instance method
- if (_thisArgument != null) {
- _thisArgument.translate(classGen, methodGen);
- }
-
- for (int i = 0; i < n; i++) {
- final Expression exp = argument(i);
- exp.translate(classGen, methodGen);
- // Convert the argument to its Java type
- exp.startIterator(classGen, methodGen);
- exp.getType().translateTo(classGen, methodGen, paramTypes[i]);
- }
-
- final StringBuffer buffer = new StringBuffer();
- buffer.append('(');
- for (int i = 0; i < paramTypes.length; i++) {
- buffer.append(getSignature(paramTypes[i]));
- }
- buffer.append(')');
- buffer.append(getSignature(_chosenMethod.getReturnType()));
-
- if (_thisArgument != null && _clazz.isInterface()) {
- index = cpg.addInterfaceMethodref(clazz,
- _fname.getLocalPart(),
- buffer.toString());
- il.append(new INVOKEINTERFACE(index, n+1));
- }
- else {
- index = cpg.addMethodref(clazz,
- _fname.getLocalPart(),
- buffer.toString());
- il.append(_thisArgument != null ? (InvokeInstruction) new INVOKEVIRTUAL(index) :
- (InvokeInstruction) new INVOKESTATIC(index));
- }
-
- // Convert the return type back to our internal type
- _type.translateFrom(classGen, methodGen,
- _chosenMethod.getReturnType());
- }
- }
-
- @Override
- public String toString() {
- return "funcall(" + _fname + ", " + _arguments + ')';
- }
-
- public boolean isStandard() {
- final String namespace = _fname.getNamespace();
- return (namespace == null) || (namespace.equals(Constants.EMPTYSTRING));
- }
-
- public boolean isExtension() {
- final String namespace = _fname.getNamespace();
- return (namespace != null) && (namespace.equals(EXT_XSLTC));
- }
-
- /**
- * Returns a vector with all methods named <code>_fname</code>
- * after stripping its namespace or <code>null</code>
- * if no such methods exist.
- */
- private Vector findMethods() {
-
- Vector result = null;
- final String namespace = _fname.getNamespace();
-
- if (_className != null && _className.length() > 0) {
- final int nArgs = _arguments.size();
- try {
- if (_clazz == null) {
- final boolean isSecureProcessing = getXSLTC().isSecureProcessing();
- final boolean isExtensionFunctionEnabled = getXSLTC()
- .getFeature(FeatureManager.Feature.ORACLE_ENABLE_EXTENSION_FUNCTION);
-
- //Check if FSP and SM - only then proceed with loading
- if (namespace != null && isSecureProcessing
- && isExtensionFunctionEnabled
- && (namespace.startsWith(JAVA_EXT_XALAN)
- || namespace.startsWith(JAVA_EXT_XSLTC)
- || namespace.startsWith(JAVA_EXT_XALAN_OLD)
- || namespace.startsWith(XALAN_CLASSPACKAGE_NAMESPACE))) {
- _clazz = getXSLTC().loadExternalFunction(_className);
- } else {
- _clazz = ObjectFactory.findProviderClass(_className, true);
- }
-
- if (_clazz == null) {
- final ErrorMsg msg =
- new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, _className);
- getParser().reportError(Constants.ERROR, msg);
- }
- }
-
- final String methodName = _fname.getLocalPart();
- final Method[] methods = _clazz.getMethods();
-
- for (int i = 0; i < methods.length; i++) {
- final int mods = methods[i].getModifiers();
- // Is it public and same number of args ?
- if (Modifier.isPublic(mods)
- && methods[i].getName().equals(methodName)
- && methods[i].getParameterTypes().length == nArgs)
- {
- if (result == null) {
- result = new Vector();
- }
- result.addElement(methods[i]);
- }
- }
- }
- catch (ClassNotFoundException e) {
- final ErrorMsg msg = new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, _className);
- getParser().reportError(Constants.ERROR, msg);
- }
- }
- return result;
- }
-
- /**
- * Returns a vector with all constructors named <code>_fname</code>
- * after stripping its namespace or <code>null</code>
- * if no such methods exist.
- */
- private Vector findConstructors() {
- Vector result = null;
- final String namespace = _fname.getNamespace();
-
- final int nArgs = _arguments.size();
- try {
- if (_clazz == null) {
- _clazz = ObjectFactory.findProviderClass(_className, true);
-
- if (_clazz == null) {
- final ErrorMsg msg = new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, _className);
- getParser().reportError(Constants.ERROR, msg);
- }
- }
-
- final Constructor[] constructors = _clazz.getConstructors();
-
- for (int i = 0; i < constructors.length; i++) {
- final int mods = constructors[i].getModifiers();
- // Is it public, static and same number of args ?
- if (Modifier.isPublic(mods) &&
- constructors[i].getParameterTypes().length == nArgs)
- {
- if (result == null) {
- result = new Vector();
- }
- result.addElement(constructors[i]);
- }
- }
- }
- catch (ClassNotFoundException e) {
- final ErrorMsg msg = new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, _className);
- getParser().reportError(Constants.ERROR, msg);
- }
-
- return result;
- }
-
-
- /**
- * Compute the JVM signature for the class.
- */
- static final String getSignature(Class clazz) {
- if (clazz.isArray()) {
- final StringBuffer sb = new StringBuffer();
- Class cl = clazz;
- while (cl.isArray()) {
- sb.append("[");
- cl = cl.getComponentType();
- }
- sb.append(getSignature(cl));
- return sb.toString();
- }
- else if (clazz.isPrimitive()) {
- if (clazz == Integer.TYPE) {
- return "I";
- }
- else if (clazz == Byte.TYPE) {
- return "B";
- }
- else if (clazz == Long.TYPE) {
- return "J";
- }
- else if (clazz == Float.TYPE) {
- return "F";
- }
- else if (clazz == Double.TYPE) {
- return "D";
- }
- else if (clazz == Short.TYPE) {
- return "S";
- }
- else if (clazz == Character.TYPE) {
- return "C";
- }
- else if (clazz == Boolean.TYPE) {
- return "Z";
- }
- else if (clazz == Void.TYPE) {
- return "V";
- }
- else {
- final String name = clazz.toString();
- ErrorMsg err = new ErrorMsg(ErrorMsg.UNKNOWN_SIG_TYPE_ERR,name);
- throw new Error(err.toString());
- }
- }
- else {
- return "L" + clazz.getName().replace('.', '/') + ';';
- }
- }
-
- /**
- * Compute the JVM method descriptor for the method.
- */
- static final String getSignature(Method meth) {
- final StringBuffer sb = new StringBuffer();
- sb.append('(');
- final Class[] params = meth.getParameterTypes(); // avoid clone
- for (int j = 0; j < params.length; j++) {
- sb.append(getSignature(params[j]));
- }
- return sb.append(')').append(getSignature(meth.getReturnType()))
- .toString();
- }
-
- /**
- * Compute the JVM constructor descriptor for the constructor.
- */
- static final String getSignature(Constructor cons) {
- final StringBuffer sb = new StringBuffer();
- sb.append('(');
- final Class[] params = cons.getParameterTypes(); // avoid clone
- for (int j = 0; j < params.length; j++) {
- sb.append(getSignature(params[j]));
- }
- return sb.append(")V").toString();
- }
-
- /**
- * Return the signature of the current method
- */
- private String getMethodSignature(Vector argsType) {
- final StringBuffer buf = new StringBuffer(_className);
- buf.append('.').append(_fname.getLocalPart()).append('(');
-
- int nArgs = argsType.size();
- for (int i = 0; i < nArgs; i++) {
- final Type intType = (Type)argsType.elementAt(i);
- buf.append(intType.toString());
- if (i < nArgs - 1) buf.append(", ");
- }
-
- buf.append(')');
- return buf.toString();
- }
-
- /**
- * To support EXSLT extensions, convert names with dash to allowable Java names:
- * e.g., convert abc-xyz to abcXyz.
- * Note: dashes only appear in middle of an EXSLT function or element name.
- */
- protected static String replaceDash(String name)
- {
- char dash = '-';
- final StringBuilder buff = new StringBuilder("");
- for (int i = 0; i < name.length(); i++) {
- if (i > 0 && name.charAt(i-1) == dash)
- buff.append(Character.toUpperCase(name.charAt(i)));
- else if (name.charAt(i) != dash)
- buff.append(name.charAt(i));
- }
- return buff.toString();
- }
-
- /**
- * Translate code to call the BasisLibrary.unallowed_extensionF(String)
- * method.
- */
- private void translateUnallowedExtension(ConstantPoolGen cpg,
- InstructionList il) {
- int index = cpg.addMethodref(BASIS_LIBRARY_CLASS,
- "unallowed_extension_functionF",
- "(Ljava/lang/String;)V");
- il.append(new PUSH(cpg, _fname.toString()));
- il.append(new INVOKESTATIC(index));
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/GenerateIdCall.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/GenerateIdCall.java
deleted file mode 100644
index 9ffae41..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/GenerateIdCall.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: GenerateIdCall.java,v 1.2.4.1 2005/09/01 15:33:17 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import java.util.Vector;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-final class GenerateIdCall extends FunctionCall {
- public GenerateIdCall(QName fname, Vector arguments) {
- super(fname, arguments);
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final InstructionList il = methodGen.getInstructionList();
- if (argumentCount() == 0) {
- il.append(methodGen.loadContextNode());
- }
- else { // one argument
- argument().translate(classGen, methodGen);
- }
- final ConstantPoolGen cpg = classGen.getConstantPool();
- il.append(new INVOKESTATIC(cpg.addMethodref(BASIS_LIBRARY_CLASS,
- "generate_idF",
- // reuse signature
- GET_NODE_NAME_SIG)));
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/IdKeyPattern.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/IdKeyPattern.java
deleted file mode 100644
index 845117d..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/IdKeyPattern.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: IdKeyPattern.java,v 1.5 2005/09/28 13:48:10 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.GOTO;
-import com.sun.org.apache.bcel.internal.generic.IFNE;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-abstract class IdKeyPattern extends LocationPathPattern {
-
- protected RelativePathPattern _left = null;;
- private String _index = null;
- private String _value = null;;
-
- public IdKeyPattern(String index, String value) {
- _index = index;
- _value = value;
- }
-
- public String getIndexName() {
- return(_index);
- }
-
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- return Type.NodeSet;
- }
-
- public boolean isWildcard() {
- return false;
- }
-
- public void setLeft(RelativePathPattern left) {
- _left = left;
- }
-
- public StepPattern getKernelPattern() {
- return(null);
- }
-
- public void reduceKernelPattern() { }
-
- public String toString() {
- return "id/keyPattern(" + _index + ", " + _value + ')';
- }
-
- /**
- * This method is called when the constructor is compiled in
- * Stylesheet.compileConstructor() and not as the syntax tree is traversed.
- */
- public void translate(ClassGenerator classGen,
- MethodGenerator methodGen) {
-
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- // Returns the KeyIndex object of a given name
- final int getKeyIndex = cpg.addMethodref(TRANSLET_CLASS,
- "getKeyIndex",
- "(Ljava/lang/String;)"+
- KEY_INDEX_SIG);
-
- // Initialises a KeyIndex to return nodes with specific values
- final int lookupId = cpg.addMethodref(KEY_INDEX_CLASS,
- "containsID",
- "(ILjava/lang/Object;)I");
- final int lookupKey = cpg.addMethodref(KEY_INDEX_CLASS,
- "containsKey",
- "(ILjava/lang/Object;)I");
- final int getNodeIdent = cpg.addInterfaceMethodref(DOM_INTF,
- "getNodeIdent",
- "(I)"+NODE_SIG);
-
- // Call getKeyIndex in AbstractTranslet with the name of the key
- // to get the index for this key (which is also a node iterator).
- il.append(classGen.loadTranslet());
- il.append(new PUSH(cpg,_index));
- il.append(new INVOKEVIRTUAL(getKeyIndex));
-
- // Now use the value in the second argument to determine what nodes
- // the iterator should return.
- il.append(SWAP);
- il.append(new PUSH(cpg,_value));
- if (this instanceof IdPattern)
- {
- il.append(new INVOKEVIRTUAL(lookupId));
- }
- else
- {
- il.append(new INVOKEVIRTUAL(lookupKey));
- }
-
- _trueList.add(il.append(new IFNE(null)));
- _falseList.add(il.append(new GOTO(null)));
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/IdPattern.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/IdPattern.java
deleted file mode 100644
index ef3362c..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/IdPattern.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: IdPattern.java,v 1.2.4.1 2005/09/01 15:37:33 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-final class IdPattern extends IdKeyPattern {
-
- public IdPattern(String id) {
- super("##id",id);
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/If.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/If.java
deleted file mode 100644
index a92a6a0..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/If.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: If.java,v 1.2.4.1 2005/09/01 15:39:47 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.InstructionHandle;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.BooleanType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- */
-final class If extends Instruction {
-
- private Expression _test;
- private boolean _ignore = false;
-
- /**
- * Display the contents of this element
- */
- public void display(int indent) {
- indent(indent);
- Util.println("If");
- indent(indent + IndentIncrement);
- System.out.print("test ");
- Util.println(_test.toString());
- displayContents(indent + IndentIncrement);
- }
-
- /**
- * Parse the "test" expression and contents of this element.
- */
- public void parseContents(Parser parser) {
- // Parse the "test" expression
- _test = parser.parseExpression(this, "test", null);
-
- // Make sure required attribute(s) have been set
- if (_test.isDummy()) {
- reportError(this, parser, ErrorMsg.REQUIRED_ATTR_ERR, "test");
- return;
- }
-
- // Ignore xsl:if when test is false (function-available() and
- // element-available())
- Object result = _test.evaluateAtCompileTime();
- if (result != null && result instanceof Boolean) {
- _ignore = !((Boolean) result).booleanValue();
- }
-
- parseChildren(parser);
- }
-
- /**
- * Type-check the "test" expression and contents of this element.
- * The contents will be ignored if we know the test will always fail.
- */
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- // Type-check the "test" expression
- if (_test.typeCheck(stable) instanceof BooleanType == false) {
- _test = new CastExpr(_test, Type.Boolean);
- }
- // Type check the element contents
- if (!_ignore) {
- typeCheckContents(stable);
- }
- return Type.Void;
- }
-
- /**
- * Translate the "test" expression and contents of this element.
- * The contents will be ignored if we know the test will always fail.
- */
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final InstructionList il = methodGen.getInstructionList();
- _test.translateDesynthesized(classGen, methodGen);
- // remember end of condition
- final InstructionHandle truec = il.getEnd();
- if (!_ignore) {
- translateContents(classGen, methodGen);
- }
- _test.backPatchFalseList(il.append(NOP));
- _test.backPatchTrueList(truec.getNext());
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/IllegalCharException.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/IllegalCharException.java
deleted file mode 100644
index 62271b2..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/IllegalCharException.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: IllegalCharException.java,v 1.2.4.1 2005/09/13 12:39:15 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-class IllegalCharException extends Exception {
- static final long serialVersionUID = -667236676706226266L;
- public IllegalCharException(String s) {
- super(s);
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Import.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Import.java
deleted file mode 100644
index 5207f38..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Import.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Import.java,v 1.8 2007/04/09 21:30:40 joehw Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.xalan.internal.XalanConstants;
-import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xml.internal.utils.SystemIDResolver;
-import java.util.Iterator;
-import javax.xml.XMLConstants;
-import org.xml.sax.InputSource;
-import org.xml.sax.XMLReader;
-
-/**
- * @author Jacek Ambroziak
- * @author Morten Jorgensen
- * @author Erwin Bolwidt <ejb@klomp.org>
- * @author Gunnlaugur Briem <gthb@dimon.is>
- */
-final class Import extends TopLevelElement {
-
- private Stylesheet _imported = null;
-
- public Stylesheet getImportedStylesheet() {
- return _imported;
- }
-
- public void parseContents(final Parser parser) {
- final XSLTC xsltc = parser.getXSLTC();
- final Stylesheet context = parser.getCurrentStylesheet();
-
- try {
- String docToLoad = getAttribute("href");
- if (context.checkForLoop(docToLoad)) {
- final ErrorMsg msg = new ErrorMsg(ErrorMsg.CIRCULAR_INCLUDE_ERR,
- docToLoad, this);
- parser.reportError(Constants.FATAL, msg);
- return;
- }
-
- InputSource input = null;
- XMLReader reader = null;
- String currLoadedDoc = context.getSystemId();
- SourceLoader loader = context.getSourceLoader();
-
- // Use SourceLoader if available
- if (loader != null) {
- input = loader.loadSource(docToLoad, currLoadedDoc, xsltc);
- if (input != null) {
- docToLoad = input.getSystemId();
- reader = xsltc.getXMLReader();
- } else if (parser.errorsFound()) {
- return;
- }
- }
-
- // No SourceLoader or not resolved by SourceLoader
- if (input == null) {
- docToLoad = SystemIDResolver.getAbsoluteURI(docToLoad, currLoadedDoc);
- String accessError = SecuritySupport.checkAccess(docToLoad,
- (String)xsltc.getProperty(XMLConstants.ACCESS_EXTERNAL_STYLESHEET),
- XalanConstants.ACCESS_EXTERNAL_ALL);
-
- if (accessError != null) {
- final ErrorMsg msg = new ErrorMsg(ErrorMsg.ACCESSING_XSLT_TARGET_ERR,
- SecuritySupport.sanitizePath(docToLoad), accessError,
- this);
- parser.reportError(Constants.FATAL, msg);
- return;
- }
- input = new InputSource(docToLoad);
- }
-
- // Return if we could not resolve the URL
- if (input == null) {
- final ErrorMsg msg =
- new ErrorMsg(ErrorMsg.FILE_NOT_FOUND_ERR, docToLoad, this);
- parser.reportError(Constants.FATAL, msg);
- return;
- }
-
- final SyntaxTreeNode root;
- if (reader != null) {
- root = parser.parse(reader,input);
- }
- else {
- root = parser.parse(input);
- }
-
- if (root == null) return;
- _imported = parser.makeStylesheet(root);
- if (_imported == null) return;
-
- _imported.setSourceLoader(loader);
- _imported.setSystemId(docToLoad);
- _imported.setParentStylesheet(context);
- _imported.setImportingStylesheet(context);
- _imported.setTemplateInlining(context.getTemplateInlining());
-
- // precedence for the including stylesheet
- final int currPrecedence = parser.getCurrentImportPrecedence();
- final int nextPrecedence = parser.getNextImportPrecedence();
- _imported.setImportPrecedence(currPrecedence);
- context.setImportPrecedence(nextPrecedence);
- parser.setCurrentStylesheet(_imported);
- _imported.parseContents(parser);
-
- final Iterator<SyntaxTreeNode> elements = _imported.elements();
- final Stylesheet topStylesheet = parser.getTopLevelStylesheet();
- while (elements.hasNext()) {
- final SyntaxTreeNode element = elements.next();
- if (element instanceof TopLevelElement) {
- if (element instanceof Variable) {
- topStylesheet.addVariable((Variable) element);
- }
- else if (element instanceof Param) {
- topStylesheet.addParam((Param) element);
- }
- else {
- topStylesheet.addElement((TopLevelElement) element);
- }
- }
- }
- }
- catch (Exception e) {
- e.printStackTrace();
- }
- finally {
- parser.setCurrentStylesheet(context);
- }
- }
-
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- return Type.Void;
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- // do nothing
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Include.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Include.java
deleted file mode 100644
index 29d07d4..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Include.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Include.java,v 1.8 2007/04/09 21:30:41 joehw Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.xalan.internal.XalanConstants;
-import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xml.internal.utils.SystemIDResolver;
-import java.util.Iterator;
-import javax.xml.XMLConstants;
-import org.xml.sax.InputSource;
-import org.xml.sax.XMLReader;
-
-/**
- * @author Jacek Ambroziak
- * @author Morten Jorgensen
- * @author Erwin Bolwidt <ejb@klomp.org>
- * @author Gunnlaugur Briem <gthb@dimon.is>
- */
-final class Include extends TopLevelElement {
-
- private Stylesheet _included = null;
-
- public Stylesheet getIncludedStylesheet() {
- return _included;
- }
-
- public void parseContents(final Parser parser) {
- XSLTC xsltc = parser.getXSLTC();
- Stylesheet context = parser.getCurrentStylesheet();
-
- String docToLoad = getAttribute("href");
- try {
- if (context.checkForLoop(docToLoad)) {
- final ErrorMsg msg = new ErrorMsg(ErrorMsg.CIRCULAR_INCLUDE_ERR,
- docToLoad, this);
- parser.reportError(Constants.FATAL, msg);
- return;
- }
-
- InputSource input = null;
- XMLReader reader = null;
- String currLoadedDoc = context.getSystemId();
- SourceLoader loader = context.getSourceLoader();
-
- // Use SourceLoader if available
- if (loader != null) {
- input = loader.loadSource(docToLoad, currLoadedDoc, xsltc);
- if (input != null) {
- docToLoad = input.getSystemId();
- reader = xsltc.getXMLReader();
- } else if (parser.errorsFound()) {
- return;
- }
- }
-
- // No SourceLoader or not resolved by SourceLoader
- if (input == null) {
- docToLoad = SystemIDResolver.getAbsoluteURI(docToLoad, currLoadedDoc);
- String accessError = SecuritySupport.checkAccess(docToLoad,
- (String)xsltc.getProperty(XMLConstants.ACCESS_EXTERNAL_STYLESHEET),
- XalanConstants.ACCESS_EXTERNAL_ALL);
-
- if (accessError != null) {
- final ErrorMsg msg = new ErrorMsg(ErrorMsg.ACCESSING_XSLT_TARGET_ERR,
- SecuritySupport.sanitizePath(docToLoad), accessError,
- this);
- parser.reportError(Constants.FATAL, msg);
- return;
- }
- input = new InputSource(docToLoad);
- }
-
- // Return if we could not resolve the URL
- if (input == null) {
- final ErrorMsg msg =
- new ErrorMsg(ErrorMsg.FILE_NOT_FOUND_ERR, docToLoad, this);
- parser.reportError(Constants.FATAL, msg);
- return;
- }
-
- final SyntaxTreeNode root;
- if (reader != null) {
- root = parser.parse(reader,input);
- }
- else {
- root = parser.parse(input);
- }
-
- if (root == null) return;
- _included = parser.makeStylesheet(root);
- if (_included == null) return;
-
- _included.setSourceLoader(loader);
- _included.setSystemId(docToLoad);
- _included.setParentStylesheet(context);
- _included.setIncludingStylesheet(context);
- _included.setTemplateInlining(context.getTemplateInlining());
-
- // An included stylesheet gets the same import precedence
- // as the stylesheet that included it.
- final int precedence = context.getImportPrecedence();
- _included.setImportPrecedence(precedence);
- parser.setCurrentStylesheet(_included);
- _included.parseContents(parser);
-
- final Iterator<SyntaxTreeNode> elements = _included.elements();
- final Stylesheet topStylesheet = parser.getTopLevelStylesheet();
- while (elements.hasNext()) {
- final SyntaxTreeNode element = elements.next();
- if (element instanceof TopLevelElement) {
- if (element instanceof Variable) {
- topStylesheet.addVariable((Variable) element);
- }
- else if (element instanceof Param) {
- topStylesheet.addParam((Param) element);
- }
- else {
- topStylesheet.addElement((TopLevelElement) element);
- }
- }
- }
- }
- catch (Exception e) {
- e.printStackTrace();
- }
- finally {
- parser.setCurrentStylesheet(context);
- }
- }
-
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- return Type.Void;
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- // do nothing
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Instruction.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Instruction.java
deleted file mode 100644
index 50624cf..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Instruction.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Instruction.java,v 1.2.4.1 2005/09/01 15:45:11 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-abstract class Instruction extends SyntaxTreeNode {
- /**
- * Type check all the children of this node.
- */
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- return typeCheckContents(stable);
- }
-
- /**
- * Translate this node into JVM bytecodes.
- */
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- ErrorMsg msg = new ErrorMsg(ErrorMsg.NOT_IMPLEMENTED_ERR,
- getClass(), this);
- getParser().reportError(FATAL, msg);
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/IntExpr.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/IntExpr.java
deleted file mode 100644
index 06a581c..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/IntExpr.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: IntExpr.java,v 1.2.4.1 2005/09/01 15:46:32 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-final class IntExpr extends Expression {
- private final int _value;
-
- public IntExpr(int value) {
- _value = value;
- }
-
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- return _type = Type.Int;
- }
-
- public String toString() {
- return "int-expr(" + _value + ')';
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- ConstantPoolGen cpg = classGen.getConstantPool();
- InstructionList il = methodGen.getInstructionList();
- il.append(new PUSH(cpg, _value));
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Key.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Key.java
deleted file mode 100644
index fbedcc3..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Key.java
+++ /dev/null
@@ -1,301 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Key.java,v 1.6 2006/04/25 02:25:08 jeffsuttor Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.BranchHandle;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.GOTO;
-import com.sun.org.apache.bcel.internal.generic.IFEQ;
-import com.sun.org.apache.bcel.internal.generic.IFGE;
-import com.sun.org.apache.bcel.internal.generic.IFGT;
-import com.sun.org.apache.bcel.internal.generic.ILOAD;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
-import com.sun.org.apache.bcel.internal.generic.ISTORE;
-import com.sun.org.apache.bcel.internal.generic.InstructionHandle;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeSetType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.StringType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-import com.sun.org.apache.xml.internal.dtm.Axis;
-import com.sun.org.apache.xml.internal.utils.XML11Char;
-
-/**
- * @author Morten Jorgensen
- * @author Santiago Pericas-Geertsen
- */
-final class Key extends TopLevelElement {
-
- /**
- * The name of this key as defined in xsl:key.
- */
- private QName _name;
-
- /**
- * The pattern to match starting at the root node.
- */
- private Pattern _match;
-
- /**
- * The expression that generates the values for this key.
- */
- private Expression _use;
-
- /**
- * The type of the _use expression.
- */
- private Type _useType;
-
- /**
- * Parse the <xsl:key> element and attributes
- * @param parser A reference to the stylesheet parser
- */
- public void parseContents(Parser parser) {
-
- // Get the required attributes and parser XPath expressions
- final String name = getAttribute("name");
- if (!XML11Char.isXML11ValidQName(name)){
- ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_QNAME_ERR, name, this);
- parser.reportError(Constants.ERROR, err);
- }
-
- // Parse key name and add to symbol table
- _name = parser.getQNameIgnoreDefaultNs(name);
- getSymbolTable().addKey(_name, this);
-
- _match = parser.parsePattern(this, "match", null);
- _use = parser.parseExpression(this, "use", null);
-
- // Make sure required attribute(s) have been set
- if (_name == null) {
- reportError(this, parser, ErrorMsg.REQUIRED_ATTR_ERR, "name");
- return;
- }
- if (_match.isDummy()) {
- reportError(this, parser, ErrorMsg.REQUIRED_ATTR_ERR, "match");
- return;
- }
- if (_use.isDummy()) {
- reportError(this, parser, ErrorMsg.REQUIRED_ATTR_ERR, "use");
- return;
- }
- }
-
- /**
- * Returns a String-representation of this key's name
- * @return The key's name (from the <xsl:key> elements 'name' attribute).
- */
- public String getName() {
- return _name.toString();
- }
-
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- // Type check match pattern
- _match.typeCheck(stable);
-
- // Cast node values to string values (except for nodesets)
- _useType = _use.typeCheck(stable);
- if (_useType instanceof StringType == false &&
- _useType instanceof NodeSetType == false)
- {
- _use = new CastExpr(_use, Type.String);
- }
-
- return Type.Void;
- }
-
- /**
- * This method is called if the "use" attribute of the key contains a
- * node set. In this case we must traverse all nodes in the set and
- * create one entry in this key's index for each node in the set.
- */
- public void traverseNodeSet(ClassGenerator classGen,
- MethodGenerator methodGen,
- int buildKeyIndex) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- // DOM.getStringValueX(nodeIndex) => String
- final int getNodeValue = cpg.addInterfaceMethodref(DOM_INTF,
- GET_NODE_VALUE,
- "(I)"+STRING_SIG);
-
- final int getNodeIdent = cpg.addInterfaceMethodref(DOM_INTF,
- "getNodeIdent",
- "(I)"+NODE_SIG);
-
- // AbstractTranslet.SetKeyIndexDom(name, Dom) => void
- final int keyDom = cpg.addMethodref(TRANSLET_CLASS,
- "setKeyIndexDom",
- "("+STRING_SIG+DOM_INTF_SIG+")V");
-
-
- // This variable holds the id of the node we found with the "match"
- // attribute of xsl:key. This is the id we store, with the value we
- // get from the nodes we find here, in the index for this key.
- final LocalVariableGen parentNode =
- methodGen.addLocalVariable("parentNode",
- Util.getJCRefType("I"),
- null, null);
-
- // Get the 'parameter' from the stack and store it in a local var.
- parentNode.setStart(il.append(new ISTORE(parentNode.getIndex())));
-
- // Save current node and current iterator on the stack
- il.append(methodGen.loadCurrentNode());
- il.append(methodGen.loadIterator());
-
- // Overwrite current iterator with one that gives us only what we want
- _use.translate(classGen, methodGen);
- _use.startIterator(classGen, methodGen);
- il.append(methodGen.storeIterator());
-
- final BranchHandle nextNode = il.append(new GOTO(null));
- final InstructionHandle loop = il.append(NOP);
-
- // Prepare to call buildKeyIndex(String name, int node, String value);
- il.append(classGen.loadTranslet());
- il.append(new PUSH(cpg, _name.toString()));
- parentNode.setEnd(il.append(new ILOAD(parentNode.getIndex())));
-
- // Now get the node value and push it on the parameter stack
- il.append(methodGen.loadDOM());
- il.append(methodGen.loadCurrentNode());
- il.append(new INVOKEINTERFACE(getNodeValue, 2));
-
- // Finally do the call to add an entry in the index for this key.
- il.append(new INVOKEVIRTUAL(buildKeyIndex));
-
- il.append(classGen.loadTranslet());
- il.append(new PUSH(cpg, getName()));
- il.append(methodGen.loadDOM());
- il.append(new INVOKEVIRTUAL(keyDom));
-
- nextNode.setTarget(il.append(methodGen.loadIterator()));
- il.append(methodGen.nextNode());
-
- il.append(DUP);
- il.append(methodGen.storeCurrentNode());
- il.append(new IFGE(loop)); // Go on to next matching node....
-
- // Restore current node and current iterator from the stack
- il.append(methodGen.storeIterator());
- il.append(methodGen.storeCurrentNode());
- }
-
- /**
- * Gather all nodes that match the expression in the attribute "match"
- * and add one (or more) entries in this key's index.
- */
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- final int current = methodGen.getLocalIndex("current");
-
- // AbstractTranslet.buildKeyIndex(name,node_id,value) => void
- final int key = cpg.addMethodref(TRANSLET_CLASS,
- "buildKeyIndex",
- "("+STRING_SIG+"I"+STRING_SIG+")V");
-
- // AbstractTranslet.SetKeyIndexDom(name, Dom) => void
- final int keyDom = cpg.addMethodref(TRANSLET_CLASS,
- "setKeyIndexDom",
- "("+STRING_SIG+DOM_INTF_SIG+")V");
-
- final int getNodeIdent = cpg.addInterfaceMethodref(DOM_INTF,
- "getNodeIdent",
- "(I)"+NODE_SIG);
-
- // DOM.getAxisIterator(root) => NodeIterator
- final int git = cpg.addInterfaceMethodref(DOM_INTF,
- "getAxisIterator",
- "(I)"+NODE_ITERATOR_SIG);
-
- il.append(methodGen.loadCurrentNode());
- il.append(methodGen.loadIterator());
-
- // Get an iterator for all nodes in the DOM
- il.append(methodGen.loadDOM());
- il.append(new PUSH(cpg,Axis.DESCENDANT));
- il.append(new INVOKEINTERFACE(git, 2));
-
- // Reset the iterator to start with the root node
- il.append(methodGen.loadCurrentNode());
- il.append(methodGen.setStartNode());
- il.append(methodGen.storeIterator());
-
- // Loop for traversing all nodes in the DOM
- final BranchHandle nextNode = il.append(new GOTO(null));
- final InstructionHandle loop = il.append(NOP);
-
- // Check if the current node matches the pattern in "match"
- il.append(methodGen.loadCurrentNode());
- _match.translate(classGen, methodGen);
- _match.synthesize(classGen, methodGen); // Leaves 0 or 1 on stack
- final BranchHandle skipNode = il.append(new IFEQ(null));
-
- // If this is a node-set we must go through each node in the set
- if (_useType instanceof NodeSetType) {
- // Pass current node as parameter (we're indexing on that node)
- il.append(methodGen.loadCurrentNode());
- traverseNodeSet(classGen, methodGen, key);
- }
- else {
- il.append(classGen.loadTranslet());
- il.append(DUP);
- il.append(new PUSH(cpg, _name.toString()));
- il.append(DUP_X1);
- il.append(methodGen.loadCurrentNode());
- _use.translate(classGen, methodGen);
- il.append(new INVOKEVIRTUAL(key));
-
- il.append(methodGen.loadDOM());
- il.append(new INVOKEVIRTUAL(keyDom));
- }
-
- // Get the next node from the iterator and do loop again...
- final InstructionHandle skip = il.append(NOP);
-
- il.append(methodGen.loadIterator());
- il.append(methodGen.nextNode());
- il.append(DUP);
- il.append(methodGen.storeCurrentNode());
- il.append(new IFGT(loop));
-
- // Restore current node and current iterator from the stack
- il.append(methodGen.storeIterator());
- il.append(methodGen.storeCurrentNode());
-
- nextNode.setTarget(skip);
- skipNode.setTarget(skip);
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/KeyCall.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/KeyCall.java
deleted file mode 100644
index e85c8ed..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/KeyCall.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: KeyCall.java,v 1.7 2006/06/19 19:49:04 spericas Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import java.util.Vector;
-
-import com.sun.org.apache.bcel.internal.generic.ALOAD;
-import com.sun.org.apache.bcel.internal.generic.ASTORE;
-import com.sun.org.apache.bcel.internal.generic.BranchHandle;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.GOTO;
-import com.sun.org.apache.bcel.internal.generic.IFGT;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
-import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
-import com.sun.org.apache.bcel.internal.generic.InstructionHandle;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
-import com.sun.org.apache.bcel.internal.generic.NEW;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.StringType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-
-/**
- * @author Morten Jorgensen
- * @author Santiago Pericas-Geertsen
- */
-final class KeyCall extends FunctionCall {
-
- /**
- * The name of the key.
- */
- private Expression _name;
-
- /**
- * The value to look up in the key/index.
- */
- private Expression _value;
-
- /**
- * The value's data type.
- */
- private Type _valueType; // The value's data type
-
- /**
- * Expanded qname when name is literal.
- */
- private QName _resolvedQName = null;
-
- /**
- * Get the parameters passed to function:
- * key(String name, String value)
- * key(String name, NodeSet value)
- * The 'arguments' vector should contain two parameters for key() calls,
- * one holding the key name and one holding the value(s) to look up. The
- * vector has only one parameter for id() calls (the key name is always
- * "##id" for id() calls).
- *
- * @param fname The function name (should be 'key' or 'id')
- * @param arguments A vector containing the arguments the the function
- */
- public KeyCall(QName fname, Vector arguments) {
- super(fname, arguments);
- switch(argumentCount()) {
- case 1:
- _name = null;
- _value = argument(0);
- break;
- case 2:
- _name = argument(0);
- _value = argument(1);
- break;
- default:
- _name = _value = null;
- break;
- }
- }
-
- /**
- * If this call to key() is in a top-level element like another variable
- * or param, add a dependency between that top-level element and the
- * referenced key. For example,
- *
- * <xsl:key name="x" .../>
- * <xsl:variable name="y" select="key('x', 1)"/>
- *
- * and assuming this class represents "key('x', 1)", add a reference
- * between variable y and key x. Note that if 'x' is unknown statically
- * in key('x', 1), there's nothing we can do at this point.
- */
- public void addParentDependency() {
- // If name unknown statically, there's nothing we can do
- if (_resolvedQName == null) return;
-
- SyntaxTreeNode node = this;
- while (node != null && node instanceof TopLevelElement == false) {
- node = node.getParent();
- }
-
- TopLevelElement parent = (TopLevelElement) node;
- if (parent != null) {
- parent.addDependency(getSymbolTable().getKey(_resolvedQName));
- }
- }
-
- /**
- * Type check the parameters for the id() or key() function.
- * The index name (for key() call only) must be a string or convertable
- * to a string, and the lookup-value must be a string or a node-set.
- * @param stable The parser's symbol table
- * @throws TypeCheckError When the parameters have illegal type
- */
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- final Type returnType = super.typeCheck(stable);
-
- // Run type check on the key name (first argument) - must be a string,
- // and if it is not it must be converted to one using string() rules.
- if (_name != null) {
- final Type nameType = _name.typeCheck(stable);
-
- if (_name instanceof LiteralExpr) {
- final LiteralExpr literal = (LiteralExpr) _name;
- _resolvedQName =
- getParser().getQNameIgnoreDefaultNs(literal.getValue());
- }
- else if (nameType instanceof StringType == false) {
- _name = new CastExpr(_name, Type.String);
- }
- }
-
- // Run type check on the value for this key. This value can be of
- // any data type, so this should never cause any type-check errors.
- // If the value is a reference, then we have to defer the decision
- // of how to process it until run-time.
- // If the value is known not to be a node-set, then it should be
- // converted to a string before the lookup is done. If the value is
- // known to be a node-set then this process (convert to string, then
- // do lookup) should be applied to every node in the set, and the
- // result from all lookups should be added to the resulting node-set.
- _valueType = _value.typeCheck(stable);
-
- if (_valueType != Type.NodeSet
- && _valueType != Type.Reference
- && _valueType != Type.String) {
- _value = new CastExpr(_value, Type.String);
- _valueType = _value.typeCheck(stable);
- }
-
- // If in a top-level element, create dependency to the referenced key
- addParentDependency();
-
- return returnType;
- }
-
- /**
- * This method is called when the constructor is compiled in
- * Stylesheet.compileConstructor() and not as the syntax tree is traversed.
- * <p>This method will generate byte code that produces an iterator
- * for the nodes in the node set for the key or id function call.
- * @param classGen The Java class generator
- * @param methodGen The method generator
- */
- public void translate(ClassGenerator classGen,
- MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- // Returns the KeyIndex object of a given name
- final int getKeyIndex = cpg.addMethodref(TRANSLET_CLASS,
- "getKeyIndex",
- "(Ljava/lang/String;)"+
- KEY_INDEX_SIG);
-
- // KeyIndex.setDom(Dom, node) => void
- final int keyDom = cpg.addMethodref(KEY_INDEX_CLASS,
- "setDom",
- "(" + DOM_INTF_SIG + "I)V");
-
- // Initialises a KeyIndex to return nodes with specific values
- final int getKeyIterator =
- cpg.addMethodref(KEY_INDEX_CLASS,
- "getKeyIndexIterator",
- "(" + _valueType.toSignature() + "Z)"
- + KEY_INDEX_ITERATOR_SIG);
-
- // Initialise the index specified in the first parameter of key()
- il.append(classGen.loadTranslet());
- if (_name == null) {
- il.append(new PUSH(cpg,"##id"));
- } else if (_resolvedQName != null) {
- il.append(new PUSH(cpg, _resolvedQName.toString()));
- } else {
- _name.translate(classGen, methodGen);
- }
-
- // Generate following byte code:
- //
- // KeyIndex ki = translet.getKeyIndex(_name)
- // ki.setDom(translet.dom);
- // ki.getKeyIndexIterator(_value, true) - for key()
- // OR
- // ki.getKeyIndexIterator(_value, false) - for id()
- il.append(new INVOKEVIRTUAL(getKeyIndex));
- il.append(DUP);
- il.append(methodGen.loadDOM());
- il.append(methodGen.loadCurrentNode());
- il.append(new INVOKEVIRTUAL(keyDom));
-
- _value.translate(classGen, methodGen);
- il.append((_name != null) ? ICONST_1: ICONST_0);
- il.append(new INVOKEVIRTUAL(getKeyIterator));
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/KeyPattern.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/KeyPattern.java
deleted file mode 100644
index 5a8abdb..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/KeyPattern.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: KeyPattern.java,v 1.2.4.1 2005/09/01 15:50:14 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-final class KeyPattern extends IdKeyPattern {
-
- public KeyPattern(String index, String value) {
- super(index,value);
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/LangCall.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/LangCall.java
deleted file mode 100644
index ceb6bbf..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/LangCall.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: LangCall.java,v 1.2.4.1 2005/09/01 15:54:25 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import java.util.Vector;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.ILOAD;
-import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.FilterGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.StringType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-
-/**
- * @author Morten Jorgensen
- */
-final class LangCall extends FunctionCall {
- private Expression _lang;
- private Type _langType;
-
- /**
- * Get the parameters passed to function:
- * lang(string)
- */
- public LangCall(QName fname, Vector arguments) {
- super(fname, arguments);
- _lang = argument(0);
- }
-
- /**
- *
- */
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- _langType = _lang.typeCheck(stable);
- if (!(_langType instanceof StringType)) {
- _lang = new CastExpr(_lang, Type.String);
- }
- return Type.Boolean;
- }
-
- /**
- *
- */
- public Type getType() {
- return(Type.Boolean);
- }
-
- /**
- * This method is called when the constructor is compiled in
- * Stylesheet.compileConstructor() and not as the syntax tree is traversed.
- */
- public void translate(ClassGenerator classGen,
- MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- final int tst = cpg.addMethodref(BASIS_LIBRARY_CLASS,
- "testLanguage",
- "("+STRING_SIG+DOM_INTF_SIG+"I)Z");
- _lang.translate(classGen,methodGen);
- il.append(methodGen.loadDOM());
- if (classGen instanceof FilterGenerator)
- il.append(new ILOAD(1));
- else
- il.append(methodGen.loadContextNode());
- il.append(new INVOKESTATIC(tst));
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/LastCall.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/LastCall.java
deleted file mode 100644
index 7159ece..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/LastCall.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: LastCall.java,v 1.2.4.1 2005/09/01 15:55:34 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.ILOAD;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.CompareGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TestGenerator;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-final class LastCall extends FunctionCall {
-
- public LastCall(QName fname) {
- super(fname);
- }
-
- public boolean hasPositionCall() {
- return true;
- }
-
- public boolean hasLastCall() {
- return true;
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final InstructionList il = methodGen.getInstructionList();
-
- if (methodGen instanceof CompareGenerator) {
- il.append(((CompareGenerator)methodGen).loadLastNode());
- }
- else if (methodGen instanceof TestGenerator) {
- il.append(new ILOAD(LAST_INDEX));
- }
- else {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final int getLast = cpg.addInterfaceMethodref(NODE_ITERATOR,
- "getLast",
- "()I");
- il.append(methodGen.loadIterator());
- il.append(new INVOKEINTERFACE(getLast, 1));
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/LiteralAttribute.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/LiteralAttribute.java
deleted file mode 100644
index dc99a8d..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/LiteralAttribute.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: LiteralAttribute.java,v 1.2.4.1 2005/09/12 10:38:03 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-
-import com.sun.org.apache.xml.internal.serializer.ElemDesc;
-import com.sun.org.apache.xml.internal.serializer.SerializationHandler;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- */
-final class LiteralAttribute extends Instruction {
-
- private final String _name; // Attribute name (incl. prefix)
- private final AttributeValue _value; // Attribute value
-
- /**
- * Creates a new literal attribute (but does not insert it into the AST).
- * @param name the attribute name (incl. prefix) as a String.
- * @param value the attribute value.
- * @param parser the XSLT parser (wraps XPath parser).
- */
- public LiteralAttribute(String name, String value, Parser parser,
- SyntaxTreeNode parent)
- {
- _name = name;
- setParent(parent);
- _value = AttributeValue.create(this, value, parser);
- }
-
- public void display(int indent) {
- indent(indent);
- Util.println("LiteralAttribute name=" + _name + " value=" + _value);
- }
-
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- _value.typeCheck(stable);
- typeCheckContents(stable);
- return Type.Void;
- }
-
- protected boolean contextDependent() {
- return _value.contextDependent();
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- // push handler
- il.append(methodGen.loadHandler());
- // push attribute name - namespace prefix set by parent node
- il.append(new PUSH(cpg, _name));
- // push attribute value
- _value.translate(classGen, methodGen);
-
- // Generate code that calls SerializationHandler.addUniqueAttribute()
- // if all attributes are unique.
- SyntaxTreeNode parent = getParent();
- if (parent instanceof LiteralElement
- && ((LiteralElement)parent).allAttributesUnique()) {
-
- int flags = 0;
- boolean isHTMLAttrEmpty = false;
- ElemDesc elemDesc = ((LiteralElement)parent).getElemDesc();
-
- // Set the HTML flags
- if (elemDesc != null) {
- if (elemDesc.isAttrFlagSet(_name, ElemDesc.ATTREMPTY)) {
- flags = flags | SerializationHandler.HTML_ATTREMPTY;
- isHTMLAttrEmpty = true;
- }
- else if (elemDesc.isAttrFlagSet(_name, ElemDesc.ATTRURL)) {
- flags = flags | SerializationHandler.HTML_ATTRURL;
- }
- }
-
- if (_value instanceof SimpleAttributeValue) {
- String attrValue = ((SimpleAttributeValue)_value).toString();
-
- if (!hasBadChars(attrValue) && !isHTMLAttrEmpty) {
- flags = flags | SerializationHandler.NO_BAD_CHARS;
- }
- }
-
- il.append(new PUSH(cpg, flags));
- il.append(methodGen.uniqueAttribute());
- }
- else {
- // call attribute
- il.append(methodGen.attribute());
- }
- }
-
- /**
- * Return true if at least one character in the String is considered to
- * be a "bad" character. A bad character is one whose code is:
- * less than 32 (a space),
- * or greater than 126,
- * or it is one of '<', '>', '&' or '\"'.
- * This helps the serializer to decide whether the String needs to be escaped.
- */
- private boolean hasBadChars(String value) {
- char[] chars = value.toCharArray();
- int size = chars.length;
- for (int i = 0; i < size; i++) {
- char ch = chars[i];
- if (ch < 32 || 126 < ch || ch == '<' || ch == '>' || ch == '&' || ch == '\"')
- return true;
- }
- return false;
- }
-
- /**
- * Return the name of the attribute
- */
- public String getName() {
- return _name;
- }
-
- /**
- * Return the value of the attribute
- */
- public AttributeValue getValue() {
- return _value;
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/LiteralElement.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/LiteralElement.java
deleted file mode 100644
index c392cbe..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/LiteralElement.java
+++ /dev/null
@@ -1,508 +0,0 @@
-/*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-import com.sun.org.apache.xml.internal.serializer.ElemDesc;
-import com.sun.org.apache.xml.internal.serializer.ToHTMLStream;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- */
-final class LiteralElement extends Instruction {
-
- private String _name;
- private LiteralElement _literalElemParent = null;
- private List<SyntaxTreeNode> _attributeElements = null;
- private Map<String, String> _accessedPrefixes = null;
-
- // True if all attributes of this LRE are unique, i.e. they all have
- // different names. This flag is set to false if some attribute
- // names are not known at compile time.
- private boolean _allAttributesUnique = false;
-
- /**
- * Returns the QName for this literal element
- */
- public QName getName() {
- return _qname;
- }
-
- /**
- * Displays the contents of this literal element
- */
- public void display(int indent) {
- indent(indent);
- Util.println("LiteralElement name = " + _name);
- displayContents(indent + IndentIncrement);
- }
-
- /**
- * Returns the namespace URI for which a prefix is pointing to
- */
- private String accessedNamespace(String prefix) {
- if (_literalElemParent != null) {
- String result = _literalElemParent.accessedNamespace(prefix);
- if (result != null) {
- return result;
- }
- }
- return _accessedPrefixes != null ? _accessedPrefixes.get(prefix) : null;
- }
-
- /**
- * Method used to keep track of what namespaces that are references by
- * this literal element and its attributes. The output must contain a
- * definition for each namespace, so we stuff them in a map.
- */
- public void registerNamespace(String prefix, String uri,
- SymbolTable stable, boolean declared) {
-
- // Check if the parent has a declaration for this namespace
- if (_literalElemParent != null) {
- final String parentUri = _literalElemParent.accessedNamespace(prefix);
- if (parentUri != null && parentUri.equals(uri)) {
- return;
- }
- }
-
- // Check if we have any declared namespaces
- if (_accessedPrefixes == null) {
- _accessedPrefixes = new Hashtable<>();
- }
- else {
- if (!declared) {
- // Check if this node has a declaration for this namespace
- final String old = _accessedPrefixes.get(prefix);
- if (old != null) {
- if (old.equals(uri))
- return;
- else
- prefix = stable.generateNamespacePrefix();
- }
- }
- }
-
- if (!prefix.equals("xml")) {
- _accessedPrefixes.put(prefix,uri);
- }
- }
-
- /**
- * Translates the prefix of a QName according to the rules set in
- * the attributes of xsl:stylesheet. Also registers a QName to assure
- * that the output element contains the necessary namespace declarations.
- */
- private String translateQName(QName qname, SymbolTable stable) {
- // Break up the QName and get prefix:localname strings
- String localname = qname.getLocalPart();
- String prefix = qname.getPrefix();
-
- // Treat default namespace as "" and not null
- if (prefix == null)
- prefix = Constants.EMPTYSTRING;
- else if (prefix.equals(XMLNS_PREFIX))
- return(XMLNS_PREFIX);
-
- // Check if we must translate the prefix
- final String alternative = stable.lookupPrefixAlias(prefix);
- if (alternative != null) {
- stable.excludeNamespaces(prefix);
- prefix = alternative;
- }
-
- // Get the namespace this prefix refers to
- String uri = lookupNamespace(prefix);
- if (uri == null) return(localname);
-
- // Register the namespace as accessed
- registerNamespace(prefix, uri, stable, false);
-
- // Construct the new name for the element (may be unchanged)
- if (prefix != Constants.EMPTYSTRING)
- return(prefix+":"+localname);
- else
- return(localname);
- }
-
- /**
- * Add an attribute to this element
- */
- public void addAttribute(SyntaxTreeNode attribute) {
- if (_attributeElements == null) {
- _attributeElements = new ArrayList<>(2);
- }
- _attributeElements.add(attribute);
- }
-
- /**
- * Set the first attribute of this element
- */
- public void setFirstAttribute(SyntaxTreeNode attribute) {
- if (_attributeElements == null) {
- _attributeElements = new ArrayList<>(2);
- }
- _attributeElements.add(0, attribute);
- }
-
- /**
- * Type-check the contents of this element. The element itself does not
- * need any type checking as it leaves nothign on the JVM's stack.
- */
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- // Type-check all attributes
- if (_attributeElements != null) {
- for (SyntaxTreeNode node : _attributeElements) {
- node.typeCheck(stable);
- }
- }
- typeCheckContents(stable);
- return Type.Void;
- }
-
- /**
- * This method starts at a given node, traverses all namespace mappings,
- * and assembles a list of all prefixes that (for the given node) maps
- * to _ANY_ namespace URI. Used by literal result elements to determine
- */
- public Set<Map.Entry<String, String>> getNamespaceScope(SyntaxTreeNode node) {
- Map<String, String> all = new HashMap<>();
-
- while (node != null) {
- Map<String, String> mapping = node.getPrefixMapping();
- if (mapping != null) {
- for( String prefix : mapping.keySet()) {
- if (!all.containsKey(prefix)) {
- all.put(prefix, mapping.get(prefix));
- }
- }
- }
- node = node.getParent();
- }
- return all.entrySet();
- }
-
- /**
- * Determines the final QName for the element and its attributes.
- * Registers all namespaces that are used by the element/attributes
- */
- public void parseContents(Parser parser) {
- final SymbolTable stable = parser.getSymbolTable();
- stable.setCurrentNode(this);
-
- // Check if in a literal element context
- SyntaxTreeNode parent = getParent();
- if (parent != null && parent instanceof LiteralElement) {
- _literalElemParent = (LiteralElement) parent;
- }
-
- _name = translateQName(_qname, stable);
-
- // Process all attributes and register all namespaces they use
- final int count = _attributes.getLength();
- for (int i = 0; i < count; i++) {
- final QName qname = parser.getQName(_attributes.getQName(i));
- final String uri = qname.getNamespace();
- final String val = _attributes.getValue(i);
-
- // Handle xsl:use-attribute-sets. Attribute sets are placed first
- // in the vector or attributes to make sure that later local
- // attributes can override an attributes in the set.
- if (qname.equals(parser.getUseAttributeSets())) {
- if (!Util.isValidQNames(val)) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_QNAME_ERR, val, this);
- parser.reportError(Constants.ERROR, err);
- }
- setFirstAttribute(new UseAttributeSets(val, parser));
- }
- // Handle xsl:extension-element-prefixes
- else if (qname.equals(parser.getExtensionElementPrefixes())) {
- stable.excludeNamespaces(val);
- }
- // Handle xsl:exclude-result-prefixes
- else if (qname.equals(parser.getExcludeResultPrefixes())) {
- stable.excludeNamespaces(val);
- }
- else {
- // Ignore special attributes (e.g. xmlns:prefix and xmlns)
- final String prefix = qname.getPrefix();
- if (prefix != null && prefix.equals(XMLNS_PREFIX) ||
- prefix == null && qname.getLocalPart().equals(XMLNS_PREFIX) ||
- uri != null && uri.equals(XSLT_URI))
- {
- continue;
- }
-
- // Handle all other literal attributes
- final String name = translateQName(qname, stable);
- LiteralAttribute attr = new LiteralAttribute(name, val, parser, this);
- addAttribute(attr);
- attr.setParent(this);
- attr.parseContents(parser);
- }
- }
-
- // Register all namespaces that are in scope, except for those that
- // are listed in the xsl:stylesheet element's *-prefixes attributes
- Set<Map.Entry<String, String>> include = getNamespaceScope(this);
- for (Map.Entry<String, String> entry : include) {
- final String prefix = entry.getKey();
- if (!prefix.equals("xml")) {
- final String uri = lookupNamespace(prefix);
- if (uri != null && !stable.isExcludedNamespace(uri)) {
- registerNamespace(prefix, uri, stable, true);
- }
- }
- }
-
- parseChildren(parser);
-
- // Process all attributes and register all namespaces they use
- for (int i = 0; i < count; i++) {
- final QName qname = parser.getQName(_attributes.getQName(i));
- final String val = _attributes.getValue(i);
-
- // Handle xsl:extension-element-prefixes
- if (qname.equals(parser.getExtensionElementPrefixes())) {
- stable.unExcludeNamespaces(val);
- }
- // Handle xsl:exclude-result-prefixes
- else if (qname.equals(parser.getExcludeResultPrefixes())) {
- stable.unExcludeNamespaces(val);
- }
- }
- }
-
- protected boolean contextDependent() {
- return dependentContents();
- }
-
- /**
- * Compiles code that emits the literal element to the output handler,
- * first the start tag, then namespace declaration, then attributes,
- * then the element contents, and then the element end tag. Since the
- * value of an attribute may depend on a variable, variables must be
- * compiled first.
- */
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- // Check whether all attributes are unique.
- _allAttributesUnique = checkAttributesUnique();
-
- // Compile code to emit element start tag
- il.append(methodGen.loadHandler());
-
- il.append(new PUSH(cpg, _name));
- il.append(DUP2); // duplicate these 2 args for endElement
- il.append(methodGen.startElement());
-
- // The value of an attribute may depend on a (sibling) variable
- int j = 0;
- while (j < elementCount()) {
- final SyntaxTreeNode item = elementAt(j);
- if (item instanceof Variable) {
- item.translate(classGen, methodGen);
- }
- j++;
- }
-
- // Compile code to emit namespace attributes
- if (_accessedPrefixes != null) {
- for (Map.Entry<String, String> entry : _accessedPrefixes.entrySet()) {
- final String prefix = entry.getKey();
- final String uri = entry.getValue();
- il.append(methodGen.loadHandler());
- il.append(new PUSH(cpg, prefix));
- il.append(new PUSH(cpg, uri));
- il.append(methodGen.namespace());
- }
- }
-
- // Output all attributes
- if (_attributeElements != null) {
- for (SyntaxTreeNode node : _attributeElements) {
- if (!(node instanceof XslAttribute)) {
- node.translate(classGen, methodGen);
- }
- }
- }
-
- // Compile code to emit attributes and child elements
- translateContents(classGen, methodGen);
-
- // Compile code to emit element end tag
- il.append(methodGen.endElement());
- }
-
- /**
- * Return true if the output method is html.
- */
- private boolean isHTMLOutput() {
- return getStylesheet().getOutputMethod() == Stylesheet.HTML_OUTPUT;
- }
-
- /**
- * Return the ElemDesc object for an HTML element.
- * Return null if the output method is not HTML or this is not a
- * valid HTML element.
- */
- public ElemDesc getElemDesc() {
- if (isHTMLOutput()) {
- return ToHTMLStream.getElemDesc(_name);
- }
- else
- return null;
- }
-
- /**
- * Return true if all attributes of this LRE have unique names.
- */
- public boolean allAttributesUnique() {
- return _allAttributesUnique;
- }
-
- /**
- * Check whether all attributes are unique.
- */
- private boolean checkAttributesUnique() {
- boolean hasHiddenXslAttribute = canProduceAttributeNodes(this, true);
- if (hasHiddenXslAttribute)
- return false;
-
- if (_attributeElements != null) {
- int numAttrs = _attributeElements.size();
- Map<String, SyntaxTreeNode> attrsTable = null;
- for (int i = 0; i < numAttrs; i++) {
- SyntaxTreeNode node = _attributeElements.get(i);
-
- if (node instanceof UseAttributeSets) {
- return false;
- }
- else if (node instanceof XslAttribute) {
- if (attrsTable == null) {
- attrsTable = new HashMap<>();
- for (int k = 0; k < i; k++) {
- SyntaxTreeNode n = _attributeElements.get(k);
- if (n instanceof LiteralAttribute) {
- LiteralAttribute literalAttr = (LiteralAttribute)n;
- attrsTable.put(literalAttr.getName(), literalAttr);
- }
- }
- }
-
- XslAttribute xslAttr = (XslAttribute)node;
- AttributeValue attrName = xslAttr.getName();
- if (attrName instanceof AttributeValueTemplate) {
- return false;
- }
- else if (attrName instanceof SimpleAttributeValue) {
- SimpleAttributeValue simpleAttr = (SimpleAttributeValue)attrName;
- String name = simpleAttr.toString();
- if (name != null && attrsTable.get(name) != null)
- return false;
- else if (name != null) {
- attrsTable.put(name, xslAttr);
- }
- }
- }
- }
- }
- return true;
- }
-
- /**
- * Return true if the instructions under the given SyntaxTreeNode can produce attribute nodes
- * to an element. Only return false when we are sure that no attribute node is produced.
- * Return true if we are not sure. If the flag ignoreXslAttribute is true, the direct
- * <xsl:attribute> children of the current node are not included in the check.
- */
- private boolean canProduceAttributeNodes(SyntaxTreeNode node, boolean ignoreXslAttribute) {
- List<SyntaxTreeNode> contents = node.getContents();
- for (SyntaxTreeNode child : contents) {
- if (child instanceof Text) {
- Text text = (Text)child;
- if (text.isIgnore())
- continue;
- else
- return false;
- }
- // Cannot add an attribute to an element after children have been added to it.
- // We can safely return false when the instruction can produce an output node.
- else if (child instanceof LiteralElement
- || child instanceof ValueOf
- || child instanceof XslElement
- || child instanceof Comment
- || child instanceof Number
- || child instanceof ProcessingInstruction)
- return false;
- else if (child instanceof XslAttribute) {
- if (ignoreXslAttribute)
- continue;
- else
- return true;
- }
- // In general, there is no way to check whether <xsl:call-template> or
- // <xsl:apply-templates> can produce attribute nodes. <xsl:copy> and
- // <xsl:copy-of> can also copy attribute nodes to an element. Return
- // true in those cases to be safe.
- else if (child instanceof CallTemplate
- || child instanceof ApplyTemplates
- || child instanceof Copy
- || child instanceof CopyOf)
- return true;
- else if ((child instanceof If
- || child instanceof ForEach)
- && canProduceAttributeNodes(child, false)) {
- return true;
- }
- else if (child instanceof Choose) {
- List<SyntaxTreeNode> chooseContents = child.getContents();
- for (SyntaxTreeNode chooseChild : chooseContents) {
- if (chooseChild instanceof When || chooseChild instanceof Otherwise) {
- if (canProduceAttributeNodes(chooseChild, false))
- return true;
- }
- }
- }
- }
- return false;
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/LiteralExpr.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/LiteralExpr.java
deleted file mode 100644
index d97001c..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/LiteralExpr.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: LiteralExpr.java,v 1.2.4.1 2005/09/01 15:58:53 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-final class LiteralExpr extends Expression {
- private final String _value;
- private final String _namespace;
-
- /**
- * Creates a new literal expression node.
- * @param value the literal expression content/value.
- */
- public LiteralExpr(String value) {
- _value = value;
- _namespace = null;
- }
-
- /**
- * Creates a new literal expression node.
- * @param value the literal expression content/value.
- * @param namespace the namespace in which the expression exists.
- */
- public LiteralExpr(String value, String namespace) {
- _value = value;
- _namespace = namespace.equals(Constants.EMPTYSTRING) ? null : namespace;
- }
-
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- return _type = Type.String;
- }
-
- public String toString() {
- return "literal-expr(" + _value + ')';
- }
-
- protected boolean contextDependent() {
- return false;
- }
-
- protected String getValue() {
- return _value;
- }
-
- protected String getNamespace() {
- return _namespace;
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- il.append(new PUSH(cpg, _value));
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/LocalNameCall.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/LocalNameCall.java
deleted file mode 100644
index 8a9fcae..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/LocalNameCall.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: LocalNameCall.java,v 1.2.4.1 2005/09/01 16:00:21 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import java.util.Vector;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-
-/**
- * @author Morten Jorgensen
- */
-final class LocalNameCall extends NameBase {
-
- /**
- * Handles calls with no parameter (current node is implicit parameter).
- */
- public LocalNameCall(QName fname) {
- super(fname);
- }
-
- /**
- * Handles calls with one parameter (either node or node-set).
- */
- public LocalNameCall(QName fname, Vector arguments) {
- super(fname, arguments);
- }
-
- /**
- * This method is called when the constructor is compiled in
- * Stylesheet.compileConstructor() and not as the syntax tree is traversed.
- */
- public void translate(ClassGenerator classGen,
- MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- // Returns the name of a node in the DOM
- final int getNodeName = cpg.addInterfaceMethodref(DOM_INTF,
- "getNodeName",
- "(I)"+STRING_SIG);
-
- final int getLocalName = cpg.addMethodref(BASIS_LIBRARY_CLASS,
- "getLocalName",
- "(Ljava/lang/String;)"+
- "Ljava/lang/String;");
- super.translate(classGen, methodGen);
- il.append(new INVOKEINTERFACE(getNodeName, 2));
- il.append(new INVOKESTATIC(getLocalName));
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/LocationPathPattern.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/LocationPathPattern.java
deleted file mode 100644
index 391809d..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/LocationPathPattern.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: LocationPathPattern.java,v 1.2.4.1 2005/09/12 10:42:42 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xml.internal.dtm.Axis;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- */
-public abstract class LocationPathPattern extends Pattern {
- private Template _template;
- private int _importPrecedence;
- private double _priority = Double.NaN;
- private int _position = 0;
-
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- return Type.Void; // TODO
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- // TODO: What does it mean to translate a Pattern ?
- }
-
- public void setTemplate(final Template template) {
- _template = template;
- _priority = template.getPriority();
- _importPrecedence = template.getImportPrecedence();
- _position = template.getPosition();
- }
-
- public Template getTemplate() {
- return _template;
- }
-
- public final double getPriority() {
- return Double.isNaN(_priority) ? getDefaultPriority() : _priority;
- }
-
- public double getDefaultPriority() {
- return 0.5;
- }
-
- /**
- * This method is used by the Mode class to prioritise patterns and
- * template. This method is called for templates that are in the same
- * mode and that match on the same core pattern. The rules used are:
- * o) first check precedence - highest precedence wins
- * o) then check priority - highest priority wins
- * o) then check the position - the template that occured last wins
- */
- public boolean noSmallerThan(LocationPathPattern other) {
- if (_importPrecedence > other._importPrecedence) {
- return true;
- }
- else if (_importPrecedence == other._importPrecedence) {
- if (_priority > other._priority) {
- return true;
- }
- else if (_priority == other._priority) {
- if (_position > other._position) {
- return true;
- }
- }
- }
- return false;
- }
-
- public abstract StepPattern getKernelPattern();
-
- public abstract void reduceKernelPattern();
-
- public abstract boolean isWildcard();
-
- public int getAxis() {
- final StepPattern sp = getKernelPattern();
- return (sp != null) ? sp.getAxis() : Axis.CHILD;
- }
-
- public String toString() {
- return "root()";
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/LogicalExpr.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/LogicalExpr.java
deleted file mode 100644
index 6e295ba..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/LogicalExpr.java
+++ /dev/null
@@ -1,235 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: LogicalExpr.java,v 1.2.4.1 2005/09/01 16:03:31 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.GOTO;
-import com.sun.org.apache.bcel.internal.generic.InstructionHandle;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- */
-final class LogicalExpr extends Expression {
-
- public static final int OR = 0;
- public static final int AND = 1;
-
- private final int _op; // operator
- private Expression _left; // first operand
- private Expression _right; // second operand
-
- private static final String[] Ops = { "or", "and" };
-
- /**
- * Creates a new logical expression - either OR or AND. Note that the
- * left- and right-hand side expressions can also be logical expressions,
- * thus creating logical trees representing structures such as
- * (a and (b or c) and d), etc...
- */
- public LogicalExpr(int op, Expression left, Expression right) {
- _op = op;
- (_left = left).setParent(this);
- (_right = right).setParent(this);
- }
-
- /**
- * Returns true if this expressions contains a call to position(). This is
- * needed for context changes in node steps containing multiple predicates.
- */
- public boolean hasPositionCall() {
- return (_left.hasPositionCall() || _right.hasPositionCall());
- }
-
- /**
- * Returns true if this expressions contains a call to last()
- */
- public boolean hasLastCall() {
- return (_left.hasLastCall() || _right.hasLastCall());
- }
-
- /**
- * Returns an object representing the compile-time evaluation
- * of an expression. We are only using this for function-available
- * and element-available at this time.
- */
- public Object evaluateAtCompileTime() {
- final Object leftb = _left.evaluateAtCompileTime();
- final Object rightb = _right.evaluateAtCompileTime();
-
- // Return null if we can't evaluate at compile time
- if (leftb == null || rightb == null) {
- return null;
- }
-
- if (_op == AND) {
- return (leftb == Boolean.TRUE && rightb == Boolean.TRUE) ?
- Boolean.TRUE : Boolean.FALSE;
- }
- else {
- return (leftb == Boolean.TRUE || rightb == Boolean.TRUE) ?
- Boolean.TRUE : Boolean.FALSE;
- }
- }
-
- /**
- * Returns this logical expression's operator - OR or AND represented
- * by 0 and 1 respectively.
- */
- public int getOp() {
- return(_op);
- }
-
- /**
- * Override the SyntaxTreeNode.setParser() method to make sure that the
- * parser is set for sub-expressions
- */
- public void setParser(Parser parser) {
- super.setParser(parser);
- _left.setParser(parser);
- _right.setParser(parser);
- }
-
- /**
- * Returns a string describing this expression
- */
- public String toString() {
- return Ops[_op] + '(' + _left + ", " + _right + ')';
- }
-
- /**
- * Type-check this expression, and possibly child expressions.
- */
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- // Get the left and right operand types
- Type tleft = _left.typeCheck(stable);
- Type tright = _right.typeCheck(stable);
-
- // Check if the operator supports the two operand types
- MethodType wantType = new MethodType(Type.Void, tleft, tright);
- MethodType haveType = lookupPrimop(stable, Ops[_op], wantType);
-
- // Yes, the operation is supported
- if (haveType != null) {
- // Check if left-hand side operand must be type casted
- Type arg1 = (Type)haveType.argsType().elementAt(0);
- if (!arg1.identicalTo(tleft))
- _left = new CastExpr(_left, arg1);
- // Check if right-hand side operand must be type casted
- Type arg2 = (Type) haveType.argsType().elementAt(1);
- if (!arg2.identicalTo(tright))
- _right = new CastExpr(_right, arg1);
- // Return the result type for the operator we will use
- return _type = haveType.resultType();
- }
- throw new TypeCheckError(this);
- }
-
- /**
- * Compile the expression - leave boolean expression on stack
- */
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- translateDesynthesized(classGen, methodGen);
- synthesize(classGen, methodGen);
- }
-
- /**
- * Compile expression and update true/false-lists
- */
- public void translateDesynthesized(ClassGenerator classGen,
- MethodGenerator methodGen) {
-
- final InstructionList il = methodGen.getInstructionList();
- final SyntaxTreeNode parent = getParent();
-
- // Compile AND-expression
- if (_op == AND) {
-
- // Translate left hand side - must be true
- _left.translateDesynthesized(classGen, methodGen);
-
- // Need this for chaining any OR-expression children
- InstructionHandle middle = il.append(NOP);
-
- // Translate left right side - must be true
- _right.translateDesynthesized(classGen, methodGen);
-
- // Need this for chaining any OR-expression children
- InstructionHandle after = il.append(NOP);
-
- // Append child expression false-lists to our false-list
- _falseList.append(_right._falseList.append(_left._falseList));
-
- // Special case for OR-expression as a left child of AND.
- // The true-list of OR must point to second clause of AND.
- if ((_left instanceof LogicalExpr) &&
- (((LogicalExpr)_left).getOp() == OR)) {
- _left.backPatchTrueList(middle);
- }
- else if (_left instanceof NotCall) {
- _left.backPatchTrueList(middle);
- }
- else {
- _trueList.append(_left._trueList);
- }
-
- // Special case for OR-expression as a right child of AND
- // The true-list of OR must point to true-list of AND.
- if ((_right instanceof LogicalExpr) &&
- (((LogicalExpr)_right).getOp() == OR)) {
- _right.backPatchTrueList(after);
- }
- else if (_right instanceof NotCall) {
- _right.backPatchTrueList(after);
- }
- else {
- _trueList.append(_right._trueList);
- }
- }
- // Compile OR-expression
- else {
- // Translate left-hand side expression and produce true/false list
- _left.translateDesynthesized(classGen, methodGen);
-
- // This GOTO is used to skip over the code for the last test
- // in the case where the the first test succeeds
- InstructionHandle ih = il.append(new GOTO(null));
-
- // Translate right-hand side expression and produce true/false list
- _right.translateDesynthesized(classGen, methodGen);
-
- _left._trueList.backPatch(ih);
- _left._falseList.backPatch(ih.getNext());
-
- _falseList.append(_right._falseList);
- _trueList.add(ih).append(_right._trueList);
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Makefile.inc b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Makefile.inc
deleted file mode 100644
index 8c1f57a..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Makefile.inc
+++ /dev/null
@@ -1,60 +0,0 @@
-###########################################################################
-# reserved comment block
-# DO NOT REMOVE OR ALTER!
-###########################################################################
-##########################################################################
-# Copyright 2001-2004 The Apache Software Foundation.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-##########################################################################
-#
-# $Id: Makefile.inc,v 1.2 2004/02/17 16:32:49 minchau Exp $
-#
-####################################################################
-# #
-# Makefile.inc for XSLT compiler #
-# #
-####################################################################
-
-####################################################################
-# Useful macros #
-####################################################################
-
-JAVAC = javac
-#JAVAC_FLAGS = -g -d $(XSLT)/src/classes
-JAVAC_FLAGS = -sourcepath $(XSLT)/src
-JAVACC = javacc
-JAVACC_FLAGS = -static=FALSE
-JAVACUP = javacup
-JAVACUP_FLAGS =
-JAVALEX = jlex
-JAVALEX_FLAGS =
-
-####################################################################
-# Explicit rules #
-####################################################################
-
-.SUFFIXES: .java .class .jj .lex .cup
-
-.java.class:
- $(JAVAC) $(JAVAC_FLAGS) $<
-
-.jj.java:
- $(JAVACC) $(JAVACC_FLAGS) $<
-
-.cup.java:
- $(JAVACUP) $(JAVACUP_FLAGS) $<
-
-.lex.java:
- $(JAVALEX) $(JAVALEX_FLAGS) $<
-
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Message.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Message.java
deleted file mode 100644
index 034a267..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Message.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Message.java,v 1.2.4.1 2005/09/02 06:47:02 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
-import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.NEW;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- */
-final class Message extends Instruction {
- private boolean _terminate = false;
-
- public void parseContents(Parser parser) {
- String termstr = getAttribute("terminate");
- if (termstr != null) {
- _terminate = termstr.equals("yes");
- }
- parseChildren(parser);
- }
-
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- typeCheckContents(stable);
- return Type.Void;
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- // Load the translet (for call to displayMessage() function)
- il.append(classGen.loadTranslet());
-
- switch (elementCount()) {
- case 0:
- il.append(new PUSH(cpg, ""));
- break;
- case 1:
- SyntaxTreeNode child = (SyntaxTreeNode) elementAt(0);
- if (child instanceof Text) {
- il.append(new PUSH(cpg, ((Text) child).getText()));
- break;
- }
- // falls through
- default:
- // Push current output handler onto the stack
- il.append(methodGen.loadHandler());
-
- // Replace the current output handler by a ToXMLStream
- il.append(new NEW(cpg.addClass(STREAM_XML_OUTPUT)));
- il.append(methodGen.storeHandler());
-
- // Push a reference to a StringWriter
- il.append(new NEW(cpg.addClass(STRING_WRITER)));
- il.append(DUP);
- il.append(DUP);
- il.append(new INVOKESPECIAL(
- cpg.addMethodref(STRING_WRITER, "<init>", "()V")));
-
- // Load ToXMLStream
- il.append(methodGen.loadHandler());
- il.append(new INVOKESPECIAL(
- cpg.addMethodref(STREAM_XML_OUTPUT, "<init>",
- "()V")));
-
- // Invoke output.setWriter(STRING_WRITER)
- il.append(methodGen.loadHandler());
- il.append(SWAP);
- il.append(new INVOKEINTERFACE(
- cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
- "setWriter",
- "("+WRITER_SIG+")V"), 2));
-
- // Invoke output.setEncoding("UTF-8")
- il.append(methodGen.loadHandler());
- il.append(new PUSH(cpg, "UTF-8")); // other encodings?
- il.append(new INVOKEINTERFACE(
- cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
- "setEncoding",
- "("+STRING_SIG+")V"), 2));
-
- // Invoke output.setOmitXMLDeclaration(true)
- il.append(methodGen.loadHandler());
- il.append(ICONST_1);
- il.append(new INVOKEINTERFACE(
- cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
- "setOmitXMLDeclaration",
- "(Z)V"), 2));
-
- il.append(methodGen.loadHandler());
- il.append(new INVOKEINTERFACE(
- cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
- "startDocument",
- "()V"), 1));
-
- // Inline translation of contents
- translateContents(classGen, methodGen);
-
- il.append(methodGen.loadHandler());
- il.append(new INVOKEINTERFACE(
- cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
- "endDocument",
- "()V"), 1));
-
- // Call toString() on StringWriter
- il.append(new INVOKEVIRTUAL(
- cpg.addMethodref(STRING_WRITER, "toString",
- "()" + STRING_SIG)));
-
- // Restore old output handler
- il.append(SWAP);
- il.append(methodGen.storeHandler());
- break;
- }
-
- // Send the resulting string to the message handling method
- il.append(new INVOKEVIRTUAL(cpg.addMethodref(TRANSLET_CLASS,
- "displayMessage",
- "("+STRING_SIG+")V")));
-
- // If 'terminate' attribute is set to 'yes': Instanciate a
- // RunTimeException, but it on the stack and throw an exception
- if (_terminate == true) {
- // Create a new instance of RunTimeException
- final int einit = cpg.addMethodref("java.lang.RuntimeException",
- "<init>",
- "(Ljava/lang/String;)V");
- il.append(new NEW(cpg.addClass("java.lang.RuntimeException")));
- il.append(DUP);
- il.append(new PUSH(cpg,"Termination forced by an " +
- "xsl:message instruction"));
- il.append(new INVOKESPECIAL(einit));
- il.append(ATHROW);
- }
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Mode.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Mode.java
deleted file mode 100644
index 7fb86be..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Mode.java
+++ /dev/null
@@ -1,1518 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Mode.java,v 1.2.4.1 2005/09/19 05:18:11 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.BranchHandle;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.DUP;
-import com.sun.org.apache.bcel.internal.generic.GOTO_W;
-import com.sun.org.apache.bcel.internal.generic.IFLT;
-import com.sun.org.apache.bcel.internal.generic.ILOAD;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
-import com.sun.org.apache.bcel.internal.generic.ISTORE;
-import com.sun.org.apache.bcel.internal.generic.Instruction;
-import com.sun.org.apache.bcel.internal.generic.InstructionHandle;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
-import com.sun.org.apache.bcel.internal.generic.SWITCH;
-import com.sun.org.apache.bcel.internal.generic.TargetLostException;
-import com.sun.org.apache.bcel.internal.util.InstructionFinder;
-import com.sun.org.apache.xalan.internal.xsltc.DOM;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NamedMethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-import com.sun.org.apache.xml.internal.dtm.Axis;
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-import java.util.Vector;
-
-/**
- * Mode gathers all the templates belonging to a given mode;
- * it is responsible for generating an appropriate
- * applyTemplates + (mode name) method in the translet.
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- * @author Erwin Bolwidt <ejb@klomp.org>
- * @author G. Todd Miller
- */
-final class Mode implements Constants {
-
- /**
- * The name of this mode as defined in the stylesheet.
- */
- private final QName _name;
-
- /**
- * A reference to the stylesheet object that owns this mode.
- */
- private final Stylesheet _stylesheet;
-
- /**
- * The name of the method in which this mode is compiled.
- */
- private final String _methodName;
-
- /**
- * A vector of all the templates in this mode.
- */
- private Vector _templates;
-
- /**
- * Group for patterns with node()-type kernel and child axis.
- */
- private Vector _childNodeGroup = null;
-
- /**
- * Test sequence for patterns with node()-type kernel and child axis.
- */
- private TestSeq _childNodeTestSeq = null;
-
- /**
- * Group for patterns with node()-type kernel and attribute axis.
- */
- private Vector _attribNodeGroup = null;
-
- /**
- * Test sequence for patterns with node()-type kernel and attribute axis.
- */
- private TestSeq _attribNodeTestSeq = null;
-
- /**
- * Group for patterns with id() or key()-type kernel.
- */
- private Vector _idxGroup = null;
-
- /**
- * Test sequence for patterns with id() or key()-type kernel.
- */
- private TestSeq _idxTestSeq = null;
-
- /**
- * Group for patterns with any other kernel type.
- */
- private Vector[] _patternGroups;
-
- /**
- * Test sequence for patterns with any other kernel type.
- */
- private TestSeq[] _testSeq;
-
-
- /**
- * A mapping between templates and test sequences.
- */
- private Map<Template, Object> _neededTemplates = new HashMap<>();
-
- /**
- * A mapping between named templates and Mode objects.
- */
- private Map<Template, Mode> _namedTemplates = new HashMap<>();
-
- /**
- * A mapping between templates and instruction handles.
- */
- private Map<Template, InstructionHandle> _templateIHs = new HashMap<>();
-
- /**
- * A mapping between templates and instruction lists.
- */
- private Map<Template, InstructionList> _templateILs = new HashMap<>();
-
- /**
- * A reference to the pattern matching the root node.
- */
- private LocationPathPattern _rootPattern = null;
-
- /**
- * Stores ranges of template precendences for the compilation
- * of apply-imports.
- */
- private Map<Integer, Integer> _importLevels = null;
-
- /**
- * A mapping between key names and keys.
- */
- private Map<String, Key> _keys = null;
-
- /**
- * Variable index for the current node used in code generation.
- */
- private int _currentIndex;
-
- /**
- * Creates a new Mode.
- *
- * @param name A textual representation of the mode's QName
- * @param stylesheet The Stylesheet in which the mode occured
- * @param suffix A suffix to append to the method name for this mode
- * (normally a sequence number - still in a String).
- */
- public Mode(QName name, Stylesheet stylesheet, String suffix) {
- _name = name;
- _stylesheet = stylesheet;
- _methodName = APPLY_TEMPLATES + suffix;
- _templates = new Vector();
- _patternGroups = new Vector[32];
- }
-
- /**
- * Returns the name of the method (_not_ function) that will be
- * compiled for this mode. Normally takes the form 'applyTemplates()'
- * or * 'applyTemplates2()'.
- *
- * @return Method name for this mode
- */
- public String functionName() {
- return _methodName;
- }
-
- public String functionName(int min, int max) {
- if (_importLevels == null) {
- _importLevels = new HashMap<>();
- }
- _importLevels.put(max, min);
- return _methodName + '_' + max;
- }
-
- /**
- * Shortcut to get the class compiled for this mode (will be inlined).
- */
- private String getClassName() {
- return _stylesheet.getClassName();
- }
-
- public Stylesheet getStylesheet() {
- return _stylesheet;
- }
-
- public void addTemplate(Template template) {
- _templates.addElement(template);
- }
-
- private Vector quicksort(Vector templates, int p, int r) {
- if (p < r) {
- final int q = partition(templates, p, r);
- quicksort(templates, p, q);
- quicksort(templates, q + 1, r);
- }
- return templates;
- }
-
- private int partition(Vector templates, int p, int r) {
- final Template x = (Template)templates.elementAt(p);
- int i = p - 1;
- int j = r + 1;
- while (true) {
- while (x.compareTo((Template)templates.elementAt(--j)) > 0);
- while (x.compareTo((Template)templates.elementAt(++i)) < 0);
- if (i < j) {
- templates.set(j, templates.set(i, templates.elementAt(j)));
- }
- else {
- return j;
- }
- }
- }
-
- /**
- * Process all the test patterns in this mode
- */
- public void processPatterns(Map<String, Key> keys) {
- _keys = keys;
-
-/*
-System.out.println("Before Sort " + _name);
-for (int i = 0; i < _templates.size(); i++) {
- System.out.println("name = " + ((Template)_templates.elementAt(i)).getName());
- System.out.println("pattern = " + ((Template)_templates.elementAt(i)).getPattern());
- System.out.println("priority = " + ((Template)_templates.elementAt(i)).getPriority());
- System.out.println("position = " + ((Template)_templates.elementAt(i)).getPosition());
-}
-*/
-
- _templates = quicksort(_templates, 0, _templates.size() - 1);
-
-/*
-System.out.println("\n After Sort " + _name);
-for (int i = 0; i < _templates.size(); i++) {
- System.out.println("name = " + ((Template)_templates.elementAt(i)).getName());
- System.out.println("pattern = " + ((Template)_templates.elementAt(i)).getPattern());
- System.out.println("priority = " + ((Template)_templates.elementAt(i)).getPriority());
- System.out.println("position = " + ((Template)_templates.elementAt(i)).getPosition());
-}
-*/
-
- // Traverse all templates
- final Enumeration templates = _templates.elements();
- while (templates.hasMoreElements()) {
- // Get the next template
- final Template template = (Template)templates.nextElement();
-
- /*
- * Add this template to a table of named templates if it has a name.
- * If there are multiple templates with the same name, all but one
- * (the one with highest priority) will be disabled.
- */
- if (template.isNamed() && !template.disabled()) {
- _namedTemplates.put(template, this);
- }
-
- // Add this template to a test sequence if it has a pattern
- final Pattern pattern = template.getPattern();
- if (pattern != null) {
- flattenAlternative(pattern, template, keys);
- }
- }
- prepareTestSequences();
- }
-
- /**
- * This method will break up alternative patterns (ie. unions of patterns,
- * such as match="A/B | C/B") and add the basic patterns to their
- * respective pattern groups.
- */
- private void flattenAlternative(Pattern pattern,
- Template template,
- Map<String, Key> keys) {
- // Patterns on type id() and key() are special since they do not have
- // any kernel node type (it can be anything as long as the node is in
- // the id's or key's index).
- if (pattern instanceof IdKeyPattern) {
- final IdKeyPattern idkey = (IdKeyPattern)pattern;
- idkey.setTemplate(template);
- if (_idxGroup == null) _idxGroup = new Vector();
- _idxGroup.add(pattern);
- }
- // Alternative patterns are broken up and re-processed recursively
- else if (pattern instanceof AlternativePattern) {
- final AlternativePattern alt = (AlternativePattern)pattern;
- flattenAlternative(alt.getLeft(), template, keys);
- flattenAlternative(alt.getRight(), template, keys);
- }
- // Finally we have a pattern that can be added to a test sequence!
- else if (pattern instanceof LocationPathPattern) {
- final LocationPathPattern lpp = (LocationPathPattern)pattern;
- lpp.setTemplate(template);
- addPatternToGroup(lpp);
- }
- }
-
- /**
- * Group patterns by NodeTests of their last Step
- * Keep them sorted by priority within group
- */
- private void addPatternToGroup(final LocationPathPattern lpp) {
- // id() and key()-type patterns do not have a kernel type
- if (lpp instanceof IdKeyPattern) {
- addPattern(-1, lpp);
- }
- // Otherwise get the kernel pattern from the LPP
- else {
- // kernel pattern is the last (maybe only) Step
- final StepPattern kernel = lpp.getKernelPattern();
- if (kernel != null) {
- addPattern(kernel.getNodeType(), lpp);
- }
- else if (_rootPattern == null ||
- lpp.noSmallerThan(_rootPattern)) {
- _rootPattern = lpp;
- }
- }
- }
-
- /**
- * Adds a pattern to a pattern group
- */
- private void addPattern(int kernelType, LocationPathPattern pattern) {
- // Make sure the array of pattern groups is long enough
- final int oldLength = _patternGroups.length;
- if (kernelType >= oldLength) {
- Vector[] newGroups = new Vector[kernelType * 2];
- System.arraycopy(_patternGroups, 0, newGroups, 0, oldLength);
- _patternGroups = newGroups;
- }
-
- // Find the vector to put this pattern into
- Vector patterns;
-
- if (kernelType == DOM.NO_TYPE) {
- if (pattern.getAxis() == Axis.ATTRIBUTE) {
- patterns = (_attribNodeGroup == null) ?
- (_attribNodeGroup = new Vector(2)) : _attribNodeGroup;
- }
- else {
- patterns = (_childNodeGroup == null) ?
- (_childNodeGroup = new Vector(2)) : _childNodeGroup;
- }
- }
- else {
- patterns = (_patternGroups[kernelType] == null) ?
- (_patternGroups[kernelType] = new Vector(2)) :
- _patternGroups[kernelType];
- }
-
- if (patterns.size() == 0) {
- patterns.addElement(pattern);
- }
- else {
- boolean inserted = false;
- for (int i = 0; i < patterns.size(); i++) {
- final LocationPathPattern lppToCompare =
- (LocationPathPattern)patterns.elementAt(i);
-
- if (pattern.noSmallerThan(lppToCompare)) {
- inserted = true;
- patterns.insertElementAt(pattern, i);
- break;
- }
- }
- if (inserted == false) {
- patterns.addElement(pattern);
- }
- }
- }
-
- /**
- * Complete test sequences of a given type by adding all patterns
- * from a given group.
- */
- private void completeTestSequences(int nodeType, Vector patterns) {
- if (patterns != null) {
- if (_patternGroups[nodeType] == null) {
- _patternGroups[nodeType] = patterns;
- }
- else {
- final int m = patterns.size();
- for (int j = 0; j < m; j++) {
- addPattern(nodeType,
- (LocationPathPattern) patterns.elementAt(j));
- }
- }
- }
- }
-
- /**
- * Build test sequences. The first step is to complete the test sequences
- * by including patterns of "*" and "node()" kernel to all element test
- * sequences, and of "@*" to all attribute test sequences.
- */
- private void prepareTestSequences() {
- final Vector starGroup = _patternGroups[DTM.ELEMENT_NODE];
- final Vector atStarGroup = _patternGroups[DTM.ATTRIBUTE_NODE];
-
- // Complete test sequence for "text()" with "child::node()"
- completeTestSequences(DTM.TEXT_NODE, _childNodeGroup);
-
- // Complete test sequence for "*" with "child::node()"
- completeTestSequences(DTM.ELEMENT_NODE, _childNodeGroup);
-
- // Complete test sequence for "pi()" with "child::node()"
- completeTestSequences(DTM.PROCESSING_INSTRUCTION_NODE, _childNodeGroup);
-
- // Complete test sequence for "comment()" with "child::node()"
- completeTestSequences(DTM.COMMENT_NODE, _childNodeGroup);
-
- // Complete test sequence for "@*" with "attribute::node()"
- completeTestSequences(DTM.ATTRIBUTE_NODE, _attribNodeGroup);
-
- final Vector names = _stylesheet.getXSLTC().getNamesIndex();
- if (starGroup != null || atStarGroup != null ||
- _childNodeGroup != null || _attribNodeGroup != null)
- {
- final int n = _patternGroups.length;
-
- // Complete test sequence for user-defined types
- for (int i = DTM.NTYPES; i < n; i++) {
- if (_patternGroups[i] == null) continue;
-
- final String name = (String) names.elementAt(i - DTM.NTYPES);
-
- if (isAttributeName(name)) {
- // If an attribute then copy "@*" to its test sequence
- completeTestSequences(i, atStarGroup);
-
- // And also copy "attribute::node()" to its test sequence
- completeTestSequences(i, _attribNodeGroup);
- }
- else {
- // If an element then copy "*" to its test sequence
- completeTestSequences(i, starGroup);
-
- // And also copy "child::node()" to its test sequence
- completeTestSequences(i, _childNodeGroup);
- }
- }
- }
-
- _testSeq = new TestSeq[DTM.NTYPES + names.size()];
-
- final int n = _patternGroups.length;
- for (int i = 0; i < n; i++) {
- final Vector patterns = _patternGroups[i];
- if (patterns != null) {
- final TestSeq testSeq = new TestSeq(patterns, i, this);
-// System.out.println("testSeq[" + i + "] = " + testSeq);
- testSeq.reduce();
- _testSeq[i] = testSeq;
- testSeq.findTemplates(_neededTemplates);
- }
- }
-
- if (_childNodeGroup != null && _childNodeGroup.size() > 0) {
- _childNodeTestSeq = new TestSeq(_childNodeGroup, -1, this);
- _childNodeTestSeq.reduce();
- _childNodeTestSeq.findTemplates(_neededTemplates);
- }
-
-/*
- if (_attribNodeGroup != null && _attribNodeGroup.size() > 0) {
- _attribNodeTestSeq = new TestSeq(_attribNodeGroup, -1, this);
- _attribNodeTestSeq.reduce();
- _attribNodeTestSeq.findTemplates(_neededTemplates);
- }
-*/
-
- if (_idxGroup != null && _idxGroup.size() > 0) {
- _idxTestSeq = new TestSeq(_idxGroup, this);
- _idxTestSeq.reduce();
- _idxTestSeq.findTemplates(_neededTemplates);
- }
-
- if (_rootPattern != null) {
- // doesn't matter what is 'put', only key matters
- _neededTemplates.put(_rootPattern.getTemplate(), this);
- }
- }
-
- private void compileNamedTemplate(Template template,
- ClassGenerator classGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = new InstructionList();
- String methodName = Util.escape(template.getName().toString());
-
- int numParams = 0;
- if (template.isSimpleNamedTemplate()) {
- Vector parameters = template.getParameters();
- numParams = parameters.size();
- }
-
- // Initialize the types and names arrays for the NamedMethodGenerator.
- com.sun.org.apache.bcel.internal.generic.Type[] types =
- new com.sun.org.apache.bcel.internal.generic.Type[4 + numParams];
- String[] names = new String[4 + numParams];
- types[0] = Util.getJCRefType(DOM_INTF_SIG);
- types[1] = Util.getJCRefType(NODE_ITERATOR_SIG);
- types[2] = Util.getJCRefType(TRANSLET_OUTPUT_SIG);
- types[3] = com.sun.org.apache.bcel.internal.generic.Type.INT;
- names[0] = DOCUMENT_PNAME;
- names[1] = ITERATOR_PNAME;
- names[2] = TRANSLET_OUTPUT_PNAME;
- names[3] = NODE_PNAME;
-
- // For simple named templates, the signature of the generated method
- // is not fixed. It depends on the number of parameters declared in the
- // template.
- for (int i = 4; i < 4 + numParams; i++) {
- types[i] = Util.getJCRefType(OBJECT_SIG);
- names[i] = "param" + String.valueOf(i-4);
- }
-
- NamedMethodGenerator methodGen =
- new NamedMethodGenerator(ACC_PUBLIC,
- com.sun.org.apache.bcel.internal.generic.Type.VOID,
- types, names, methodName,
- getClassName(), il, cpg);
-
- il.append(template.compile(classGen, methodGen));
- il.append(RETURN);
-
- classGen.addMethod(methodGen);
- }
-
- private void compileTemplates(ClassGenerator classGen,
- MethodGenerator methodGen,
- InstructionHandle next)
- {
- Set<Template> templates = _namedTemplates.keySet();
- for (Template template : templates) {
- compileNamedTemplate(template, classGen);
- }
-
- templates = _neededTemplates.keySet();
- for (Template template : templates) {
- if (template.hasContents()) {
- // !!! TODO templates both named and matched
- InstructionList til = template.compile(classGen, methodGen);
- til.append(new GOTO_W(next));
- _templateILs.put(template, til);
- _templateIHs.put(template, til.getStart());
- }
- else {
- // empty template
- _templateIHs.put(template, next);
- }
- }
- }
-
- private void appendTemplateCode(InstructionList body) {
- for (Template template : _neededTemplates.keySet()) {
- final InstructionList iList = _templateILs.get(template);
- if (iList != null) {
- body.append(iList);
- }
-
- }
- }
-
- private void appendTestSequences(InstructionList body) {
- final int n = _testSeq.length;
- for (int i = 0; i < n; i++) {
- final TestSeq testSeq = _testSeq[i];
- if (testSeq != null) {
- InstructionList il = testSeq.getInstructionList();
- if (il != null)
- body.append(il);
- // else trivial TestSeq
- }
- }
- }
-
- public static void compileGetChildren(ClassGenerator classGen,
- MethodGenerator methodGen,
- int node) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- final int git = cpg.addInterfaceMethodref(DOM_INTF,
- GET_CHILDREN,
- GET_CHILDREN_SIG);
- il.append(methodGen.loadDOM());
- il.append(new ILOAD(node));
- il.append(new INVOKEINTERFACE(git, 2));
- }
-
- /**
- * Compiles the default handling for DOM elements: traverse all children
- */
- private InstructionList compileDefaultRecursion(ClassGenerator classGen,
- MethodGenerator methodGen,
- InstructionHandle next) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = new InstructionList();
- final String applyTemplatesSig = classGen.getApplyTemplatesSig();
- final int git = cpg.addInterfaceMethodref(DOM_INTF,
- GET_CHILDREN,
- GET_CHILDREN_SIG);
- final int applyTemplates = cpg.addMethodref(getClassName(),
- functionName(),
- applyTemplatesSig);
- il.append(classGen.loadTranslet());
- il.append(methodGen.loadDOM());
-
- il.append(methodGen.loadDOM());
- il.append(new ILOAD(_currentIndex));
- il.append(new INVOKEINTERFACE(git, 2));
- il.append(methodGen.loadHandler());
- il.append(new INVOKEVIRTUAL(applyTemplates));
- il.append(new GOTO_W(next));
- return il;
- }
-
- /**
- * Compiles the default action for DOM text nodes and attribute nodes:
- * output the node's text value
- */
- private InstructionList compileDefaultText(ClassGenerator classGen,
- MethodGenerator methodGen,
- InstructionHandle next) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = new InstructionList();
-
- final int chars = cpg.addInterfaceMethodref(DOM_INTF,
- CHARACTERS,
- CHARACTERS_SIG);
- il.append(methodGen.loadDOM());
- il.append(new ILOAD(_currentIndex));
- il.append(methodGen.loadHandler());
- il.append(new INVOKEINTERFACE(chars, 3));
- il.append(new GOTO_W(next));
- return il;
- }
-
- private InstructionList compileNamespaces(ClassGenerator classGen,
- MethodGenerator methodGen,
- boolean[] isNamespace,
- boolean[] isAttribute,
- boolean attrFlag,
- InstructionHandle defaultTarget) {
- final XSLTC xsltc = classGen.getParser().getXSLTC();
- final ConstantPoolGen cpg = classGen.getConstantPool();
-
- // Append switch() statement - namespace test dispatch loop
- final Vector namespaces = xsltc.getNamespaceIndex();
- final Vector names = xsltc.getNamesIndex();
- final int namespaceCount = namespaces.size() + 1;
- final int namesCount = names.size();
-
- final InstructionList il = new InstructionList();
- final int[] types = new int[namespaceCount];
- final InstructionHandle[] targets = new InstructionHandle[types.length];
-
- if (namespaceCount > 0) {
- boolean compiled = false;
-
- // Initialize targets for namespace() switch statement
- for (int i = 0; i < namespaceCount; i++) {
- targets[i] = defaultTarget;
- types[i] = i;
- }
-
- // Add test sequences for known namespace types
- for (int i = DTM.NTYPES; i < (DTM.NTYPES+namesCount); i++) {
- if ((isNamespace[i]) && (isAttribute[i] == attrFlag)) {
- String name = (String)names.elementAt(i-DTM.NTYPES);
- String namespace = name.substring(0,name.lastIndexOf(':'));
- final int type = xsltc.registerNamespace(namespace);
-
- if ((i < _testSeq.length) &&
- (_testSeq[i] != null)) {
- targets[type] =
- (_testSeq[i]).compile(classGen,
- methodGen,
- defaultTarget);
- compiled = true;
- }
- }
- }
-
- // Return "null" if no test sequences were compiled
- if (!compiled) return(null);
-
- // Append first code in applyTemplates() - get type of current node
- final int getNS = cpg.addInterfaceMethodref(DOM_INTF,
- "getNamespaceType",
- "(I)I");
- il.append(methodGen.loadDOM());
- il.append(new ILOAD(_currentIndex));
- il.append(new INVOKEINTERFACE(getNS, 2));
- il.append(new SWITCH(types, targets, defaultTarget));
- return(il);
- }
- else {
- return(null);
- }
- }
-
- /**
- * Compiles the applyTemplates() method and adds it to the translet.
- * This is the main dispatch method.
- */
- public void compileApplyTemplates(ClassGenerator classGen) {
- final XSLTC xsltc = classGen.getParser().getXSLTC();
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final Vector names = xsltc.getNamesIndex();
-
- // Create the applyTemplates() method
- final com.sun.org.apache.bcel.internal.generic.Type[] argTypes =
- new com.sun.org.apache.bcel.internal.generic.Type[3];
- argTypes[0] = Util.getJCRefType(DOM_INTF_SIG);
- argTypes[1] = Util.getJCRefType(NODE_ITERATOR_SIG);
- argTypes[2] = Util.getJCRefType(TRANSLET_OUTPUT_SIG);
-
- final String[] argNames = new String[3];
- argNames[0] = DOCUMENT_PNAME;
- argNames[1] = ITERATOR_PNAME;
- argNames[2] = TRANSLET_OUTPUT_PNAME;
-
- final InstructionList mainIL = new InstructionList();
- final MethodGenerator methodGen =
- new MethodGenerator(ACC_PUBLIC | ACC_FINAL,
- com.sun.org.apache.bcel.internal.generic.Type.VOID,
- argTypes, argNames, functionName(),
- getClassName(), mainIL,
- classGen.getConstantPool());
- methodGen.addException("com.sun.org.apache.xalan.internal.xsltc.TransletException");
- // Insert an extra NOP just to keep "current" from appearing as if it
- // has a value before the start of the loop.
- mainIL.append(NOP);
-
-
- // Create a local variable to hold the current node
- final LocalVariableGen current;
- current = methodGen.addLocalVariable2("current",
- com.sun.org.apache.bcel.internal.generic.Type.INT,
- null);
- _currentIndex = current.getIndex();
-
- // Create the "body" instruction list that will eventually hold the
- // code for the entire method (other ILs will be appended).
- final InstructionList body = new InstructionList();
- body.append(NOP);
-
- // Create an instruction list that contains the default next-node
- // iteration
- final InstructionList ilLoop = new InstructionList();
- ilLoop.append(methodGen.loadIterator());
- ilLoop.append(methodGen.nextNode());
- ilLoop.append(DUP);
- ilLoop.append(new ISTORE(_currentIndex));
-
- // The body of this code can get very large - large than can be handled
- // by a single IFNE(body.getStart()) instruction - need workaround:
- final BranchHandle ifeq = ilLoop.append(new IFLT(null));
- final BranchHandle loop = ilLoop.append(new GOTO_W(null));
- ifeq.setTarget(ilLoop.append(RETURN)); // applyTemplates() ends here!
- final InstructionHandle ihLoop = ilLoop.getStart();
-
- current.setStart(mainIL.append(new GOTO_W(ihLoop)));
-
- // Live range of "current" ends at end of loop
- current.setEnd(loop);
-
- // Compile default handling of elements (traverse children)
- InstructionList ilRecurse =
- compileDefaultRecursion(classGen, methodGen, ihLoop);
- InstructionHandle ihRecurse = ilRecurse.getStart();
-
- // Compile default handling of text/attribute nodes (output text)
- InstructionList ilText =
- compileDefaultText(classGen, methodGen, ihLoop);
- InstructionHandle ihText = ilText.getStart();
-
- // Distinguish attribute/element/namespace tests for further processing
- final int[] types = new int[DTM.NTYPES + names.size()];
- for (int i = 0; i < types.length; i++) {
- types[i] = i;
- }
-
- // Initialize isAttribute[] and isNamespace[] arrays
- final boolean[] isAttribute = new boolean[types.length];
- final boolean[] isNamespace = new boolean[types.length];
- for (int i = 0; i < names.size(); i++) {
- final String name = (String)names.elementAt(i);
- isAttribute[i + DTM.NTYPES] = isAttributeName(name);
- isNamespace[i + DTM.NTYPES] = isNamespaceName(name);
- }
-
- // Compile all templates - regardless of pattern type
- compileTemplates(classGen, methodGen, ihLoop);
-
- // Handle template with explicit "*" pattern
- final TestSeq elemTest = _testSeq[DTM.ELEMENT_NODE];
- InstructionHandle ihElem = ihRecurse;
- if (elemTest != null)
- ihElem = elemTest.compile(classGen, methodGen, ihRecurse);
-
- // Handle template with explicit "@*" pattern
- final TestSeq attrTest = _testSeq[DTM.ATTRIBUTE_NODE];
- InstructionHandle ihAttr = ihText;
- if (attrTest != null)
- ihAttr = attrTest.compile(classGen, methodGen, ihAttr);
-
- // Do tests for id() and key() patterns first
- InstructionList ilKey = null;
- if (_idxTestSeq != null) {
- loop.setTarget(_idxTestSeq.compile(classGen, methodGen, body.getStart()));
- ilKey = _idxTestSeq.getInstructionList();
- }
- else {
- loop.setTarget(body.getStart());
- }
-
- // If there is a match on node() we need to replace ihElem
- // and ihText if the priority of node() is higher
- if (_childNodeTestSeq != null) {
- // Compare priorities of node() and "*"
- double nodePrio = _childNodeTestSeq.getPriority();
- int nodePos = _childNodeTestSeq.getPosition();
- double elemPrio = (0 - Double.MAX_VALUE);
- int elemPos = Integer.MIN_VALUE;
-
- if (elemTest != null) {
- elemPrio = elemTest.getPriority();
- elemPos = elemTest.getPosition();
- }
- if (elemPrio == Double.NaN || elemPrio < nodePrio ||
- (elemPrio == nodePrio && elemPos < nodePos))
- {
- ihElem = _childNodeTestSeq.compile(classGen, methodGen, ihLoop);
- }
-
- // Compare priorities of node() and text()
- final TestSeq textTest = _testSeq[DTM.TEXT_NODE];
- double textPrio = (0 - Double.MAX_VALUE);
- int textPos = Integer.MIN_VALUE;
-
- if (textTest != null) {
- textPrio = textTest.getPriority();
- textPos = textTest.getPosition();
- }
- if (textPrio == Double.NaN || textPrio < nodePrio ||
- (textPrio == nodePrio && textPos < nodePos))
- {
- ihText = _childNodeTestSeq.compile(classGen, methodGen, ihLoop);
- _testSeq[DTM.TEXT_NODE] = _childNodeTestSeq;
- }
- }
-
- // Handle templates with "ns:*" pattern
- InstructionHandle elemNamespaceHandle = ihElem;
- InstructionList nsElem = compileNamespaces(classGen, methodGen,
- isNamespace, isAttribute,
- false, ihElem);
- if (nsElem != null) elemNamespaceHandle = nsElem.getStart();
-
- // Handle templates with "ns:@*" pattern
- InstructionHandle attrNamespaceHandle = ihAttr;
- InstructionList nsAttr = compileNamespaces(classGen, methodGen,
- isNamespace, isAttribute,
- true, ihAttr);
- if (nsAttr != null) attrNamespaceHandle = nsAttr.getStart();
-
- // Handle templates with "ns:elem" or "ns:@attr" pattern
- final InstructionHandle[] targets = new InstructionHandle[types.length];
- for (int i = DTM.NTYPES; i < targets.length; i++) {
- final TestSeq testSeq = _testSeq[i];
- // Jump straight to namespace tests ?
- if (isNamespace[i]) {
- if (isAttribute[i])
- targets[i] = attrNamespaceHandle;
- else
- targets[i] = elemNamespaceHandle;
- }
- // Test first, then jump to namespace tests
- else if (testSeq != null) {
- if (isAttribute[i])
- targets[i] = testSeq.compile(classGen, methodGen,
- attrNamespaceHandle);
- else
- targets[i] = testSeq.compile(classGen, methodGen,
- elemNamespaceHandle);
- }
- else {
- targets[i] = ihLoop;
- }
- }
-
-
- // Handle pattern with match on root node - default: traverse children
- targets[DTM.ROOT_NODE] = _rootPattern != null
- ? getTemplateInstructionHandle(_rootPattern.getTemplate())
- : ihRecurse;
-
- // Handle pattern with match on root node - default: traverse children
- targets[DTM.DOCUMENT_NODE] = _rootPattern != null
- ? getTemplateInstructionHandle(_rootPattern.getTemplate())
- : ihRecurse;
-
- // Handle any pattern with match on text nodes - default: output text
- targets[DTM.TEXT_NODE] = _testSeq[DTM.TEXT_NODE] != null
- ? _testSeq[DTM.TEXT_NODE].compile(classGen, methodGen, ihText)
- : ihText;
-
- // This DOM-type is not in use - default: process next node
- targets[DTM.NAMESPACE_NODE] = ihLoop;
-
- // Match unknown element in DOM - default: check for namespace match
- targets[DTM.ELEMENT_NODE] = elemNamespaceHandle;
-
- // Match unknown attribute in DOM - default: check for namespace match
- targets[DTM.ATTRIBUTE_NODE] = attrNamespaceHandle;
-
- // Match on processing instruction - default: process next node
- InstructionHandle ihPI = ihLoop;
- if (_childNodeTestSeq != null) ihPI = ihElem;
- if (_testSeq[DTM.PROCESSING_INSTRUCTION_NODE] != null)
- targets[DTM.PROCESSING_INSTRUCTION_NODE] =
- _testSeq[DTM.PROCESSING_INSTRUCTION_NODE].
- compile(classGen, methodGen, ihPI);
- else
- targets[DTM.PROCESSING_INSTRUCTION_NODE] = ihPI;
-
- // Match on comments - default: process next node
- InstructionHandle ihComment = ihLoop;
- if (_childNodeTestSeq != null) ihComment = ihElem;
- targets[DTM.COMMENT_NODE] = _testSeq[DTM.COMMENT_NODE] != null
- ? _testSeq[DTM.COMMENT_NODE].compile(classGen, methodGen, ihComment)
- : ihComment;
-
- // This DOM-type is not in use - default: process next node
- targets[DTM.CDATA_SECTION_NODE] = ihLoop;
-
- // This DOM-type is not in use - default: process next node
- targets[DTM.DOCUMENT_FRAGMENT_NODE] = ihLoop;
-
- // This DOM-type is not in use - default: process next node
- targets[DTM.DOCUMENT_TYPE_NODE] = ihLoop;
-
- // This DOM-type is not in use - default: process next node
- targets[DTM.ENTITY_NODE] = ihLoop;
-
- // This DOM-type is not in use - default: process next node
- targets[DTM.ENTITY_REFERENCE_NODE] = ihLoop;
-
- // This DOM-type is not in use - default: process next node
- targets[DTM.NOTATION_NODE] = ihLoop;
-
-
- // Now compile test sequences for various match patterns:
- for (int i = DTM.NTYPES; i < targets.length; i++) {
- final TestSeq testSeq = _testSeq[i];
- // Jump straight to namespace tests ?
- if ((testSeq == null) || (isNamespace[i])) {
- if (isAttribute[i])
- targets[i] = attrNamespaceHandle;
- else
- targets[i] = elemNamespaceHandle;
- }
- // Match on node type
- else {
- if (isAttribute[i])
- targets[i] = testSeq.compile(classGen, methodGen,
- attrNamespaceHandle);
- else
- targets[i] = testSeq.compile(classGen, methodGen,
- elemNamespaceHandle);
- }
- }
-
- if (ilKey != null) body.insert(ilKey);
-
- // Append first code in applyTemplates() - get type of current node
- final int getType = cpg.addInterfaceMethodref(DOM_INTF,
- "getExpandedTypeID",
- "(I)I");
- body.append(methodGen.loadDOM());
- body.append(new ILOAD(_currentIndex));
- body.append(new INVOKEINTERFACE(getType, 2));
-
- // Append switch() statement - main dispatch loop in applyTemplates()
- InstructionHandle disp = body.append(new SWITCH(types, targets, ihLoop));
-
- // Append all the "case:" statements
- appendTestSequences(body);
- // Append the actual template code
- appendTemplateCode(body);
-
- // Append NS:* node tests (if any)
- if (nsElem != null) body.append(nsElem);
- // Append NS:@* node tests (if any)
- if (nsAttr != null) body.append(nsAttr);
-
- // Append default action for element and root nodes
- body.append(ilRecurse);
- // Append default action for text and attribute nodes
- body.append(ilText);
-
- // putting together constituent instruction lists
- mainIL.append(body);
- // fall through to ilLoop
- mainIL.append(ilLoop);
-
- peepHoleOptimization(methodGen);
- classGen.addMethod(methodGen);
-
- // Compile method(s) for <xsl:apply-imports/> for this mode
- if (_importLevels != null) {
- for (Map.Entry<Integer, Integer> entry : _importLevels.entrySet()) {
- compileApplyImports(classGen, entry.getValue(), entry.getKey());
- }
- }
- }
-
- private void compileTemplateCalls(ClassGenerator classGen,
- MethodGenerator methodGen,
- InstructionHandle next, int min, int max){
- for (Template template : _neededTemplates.keySet()) {
- final int prec = template.getImportPrecedence();
- if ((prec >= min) && (prec < max)) {
- if (template.hasContents()) {
- InstructionList til = template.compile(classGen, methodGen);
- til.append(new GOTO_W(next));
- _templateILs.put(template, til);
- _templateIHs.put(template, til.getStart());
- }
- else {
- // empty template
- _templateIHs.put(template, next);
- }
- }
- }
- }
-
-
- public void compileApplyImports(ClassGenerator classGen, int min, int max) {
- final XSLTC xsltc = classGen.getParser().getXSLTC();
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final Vector names = xsltc.getNamesIndex();
-
- // Clear some datastructures
- _namedTemplates = new HashMap<>();
- _neededTemplates = new HashMap<>();
- _templateIHs = new HashMap<>();
- _templateILs = new HashMap<>();
- _patternGroups = new Vector[32];
- _rootPattern = null;
-
- // IMPORTANT: Save orignal & complete set of templates!!!!
- Vector oldTemplates = _templates;
-
- // Gather templates that are within the scope of this import
- _templates = new Vector();
- final Enumeration templates = oldTemplates.elements();
- while (templates.hasMoreElements()) {
- final Template template = (Template)templates.nextElement();
- final int prec = template.getImportPrecedence();
- if ((prec >= min) && (prec < max)) addTemplate(template);
- }
-
- // Process all patterns from those templates
- processPatterns(_keys);
-
- // Create the applyTemplates() method
- final com.sun.org.apache.bcel.internal.generic.Type[] argTypes =
- new com.sun.org.apache.bcel.internal.generic.Type[4];
- argTypes[0] = Util.getJCRefType(DOM_INTF_SIG);
- argTypes[1] = Util.getJCRefType(NODE_ITERATOR_SIG);
- argTypes[2] = Util.getJCRefType(TRANSLET_OUTPUT_SIG);
- argTypes[3] = com.sun.org.apache.bcel.internal.generic.Type.INT;
-
- final String[] argNames = new String[4];
- argNames[0] = DOCUMENT_PNAME;
- argNames[1] = ITERATOR_PNAME;
- argNames[2] = TRANSLET_OUTPUT_PNAME;
- argNames[3] = NODE_PNAME;
-
- final InstructionList mainIL = new InstructionList();
- final MethodGenerator methodGen =
- new MethodGenerator(ACC_PUBLIC | ACC_FINAL,
- com.sun.org.apache.bcel.internal.generic.Type.VOID,
- argTypes, argNames, functionName()+'_'+max,
- getClassName(), mainIL,
- classGen.getConstantPool());
- methodGen.addException("com.sun.org.apache.xalan.internal.xsltc.TransletException");
-
- // Create the local variable to hold the current node
- final LocalVariableGen current;
- current = methodGen.addLocalVariable2("current",
- com.sun.org.apache.bcel.internal.generic.Type.INT,
- null);
- _currentIndex = current.getIndex();
-
- mainIL.append(new ILOAD(methodGen.getLocalIndex(NODE_PNAME)));
- current.setStart(mainIL.append(new ISTORE(_currentIndex)));
-
- // Create the "body" instruction list that will eventually hold the
- // code for the entire method (other ILs will be appended).
- final InstructionList body = new InstructionList();
- body.append(NOP);
-
- // Create an instruction list that contains the default next-node
- // iteration
- final InstructionList ilLoop = new InstructionList();
- ilLoop.append(RETURN);
- final InstructionHandle ihLoop = ilLoop.getStart();
-
- // Compile default handling of elements (traverse children)
- InstructionList ilRecurse =
- compileDefaultRecursion(classGen, methodGen, ihLoop);
- InstructionHandle ihRecurse = ilRecurse.getStart();
-
- // Compile default handling of text/attribute nodes (output text)
- InstructionList ilText =
- compileDefaultText(classGen, methodGen, ihLoop);
- InstructionHandle ihText = ilText.getStart();
-
- // Distinguish attribute/element/namespace tests for further processing
- final int[] types = new int[DTM.NTYPES + names.size()];
- for (int i = 0; i < types.length; i++) {
- types[i] = i;
- }
-
- final boolean[] isAttribute = new boolean[types.length];
- final boolean[] isNamespace = new boolean[types.length];
- for (int i = 0; i < names.size(); i++) {
- final String name = (String)names.elementAt(i);
- isAttribute[i+DTM.NTYPES] = isAttributeName(name);
- isNamespace[i+DTM.NTYPES] = isNamespaceName(name);
- }
-
- // Compile all templates - regardless of pattern type
- compileTemplateCalls(classGen, methodGen, ihLoop, min, max);
-
- // Handle template with explicit "*" pattern
- final TestSeq elemTest = _testSeq[DTM.ELEMENT_NODE];
- InstructionHandle ihElem = ihRecurse;
- if (elemTest != null) {
- ihElem = elemTest.compile(classGen, methodGen, ihLoop);
- }
-
- // Handle template with explicit "@*" pattern
- final TestSeq attrTest = _testSeq[DTM.ATTRIBUTE_NODE];
- InstructionHandle ihAttr = ihLoop;
- if (attrTest != null) {
- ihAttr = attrTest.compile(classGen, methodGen, ihAttr);
- }
-
- // Do tests for id() and key() patterns first
- InstructionList ilKey = null;
- if (_idxTestSeq != null) {
- ilKey = _idxTestSeq.getInstructionList();
- }
-
- // If there is a match on node() we need to replace ihElem
- // and ihText if the priority of node() is higher
- if (_childNodeTestSeq != null) {
- // Compare priorities of node() and "*"
- double nodePrio = _childNodeTestSeq.getPriority();
- int nodePos = _childNodeTestSeq.getPosition();
- double elemPrio = (0 - Double.MAX_VALUE);
- int elemPos = Integer.MIN_VALUE;
-
- if (elemTest != null) {
- elemPrio = elemTest.getPriority();
- elemPos = elemTest.getPosition();
- }
-
- if (elemPrio == Double.NaN || elemPrio < nodePrio ||
- (elemPrio == nodePrio && elemPos < nodePos))
- {
- ihElem = _childNodeTestSeq.compile(classGen, methodGen, ihLoop);
- }
-
- // Compare priorities of node() and text()
- final TestSeq textTest = _testSeq[DTM.TEXT_NODE];
- double textPrio = (0 - Double.MAX_VALUE);
- int textPos = Integer.MIN_VALUE;
-
- if (textTest != null) {
- textPrio = textTest.getPriority();
- textPos = textTest.getPosition();
- }
-
- if (textPrio == Double.NaN || textPrio < nodePrio ||
- (textPrio == nodePrio && textPos < nodePos))
- {
- ihText = _childNodeTestSeq.compile(classGen, methodGen, ihLoop);
- _testSeq[DTM.TEXT_NODE] = _childNodeTestSeq;
- }
- }
-
- // Handle templates with "ns:*" pattern
- InstructionHandle elemNamespaceHandle = ihElem;
- InstructionList nsElem = compileNamespaces(classGen, methodGen,
- isNamespace, isAttribute,
- false, ihElem);
- if (nsElem != null) elemNamespaceHandle = nsElem.getStart();
-
- // Handle templates with "ns:@*" pattern
- InstructionList nsAttr = compileNamespaces(classGen, methodGen,
- isNamespace, isAttribute,
- true, ihAttr);
- InstructionHandle attrNamespaceHandle = ihAttr;
- if (nsAttr != null) attrNamespaceHandle = nsAttr.getStart();
-
- // Handle templates with "ns:elem" or "ns:@attr" pattern
- final InstructionHandle[] targets = new InstructionHandle[types.length];
- for (int i = DTM.NTYPES; i < targets.length; i++) {
- final TestSeq testSeq = _testSeq[i];
- // Jump straight to namespace tests ?
- if (isNamespace[i]) {
- if (isAttribute[i])
- targets[i] = attrNamespaceHandle;
- else
- targets[i] = elemNamespaceHandle;
- }
- // Test first, then jump to namespace tests
- else if (testSeq != null) {
- if (isAttribute[i])
- targets[i] = testSeq.compile(classGen, methodGen,
- attrNamespaceHandle);
- else
- targets[i] = testSeq.compile(classGen, methodGen,
- elemNamespaceHandle);
- }
- else {
- targets[i] = ihLoop;
- }
- }
-
- // Handle pattern with match on root node - default: traverse children
- targets[DTM.ROOT_NODE] = _rootPattern != null
- ? getTemplateInstructionHandle(_rootPattern.getTemplate())
- : ihRecurse;
- // Handle pattern with match on root node - default: traverse children
- targets[DTM.DOCUMENT_NODE] = _rootPattern != null
- ? getTemplateInstructionHandle(_rootPattern.getTemplate())
- : ihRecurse; // %HZ%: Was ihLoop in XSLTC_DTM branch
-
- // Handle any pattern with match on text nodes - default: loop
- targets[DTM.TEXT_NODE] = _testSeq[DTM.TEXT_NODE] != null
- ? _testSeq[DTM.TEXT_NODE].compile(classGen, methodGen, ihText)
- : ihText;
-
- // This DOM-type is not in use - default: process next node
- targets[DTM.NAMESPACE_NODE] = ihLoop;
-
- // Match unknown element in DOM - default: check for namespace match
- targets[DTM.ELEMENT_NODE] = elemNamespaceHandle;
-
- // Match unknown attribute in DOM - default: check for namespace match
- targets[DTM.ATTRIBUTE_NODE] = attrNamespaceHandle;
-
- // Match on processing instruction - default: loop
- InstructionHandle ihPI = ihLoop;
- if (_childNodeTestSeq != null) ihPI = ihElem;
- if (_testSeq[DTM.PROCESSING_INSTRUCTION_NODE] != null) {
- targets[DTM.PROCESSING_INSTRUCTION_NODE] =
- _testSeq[DTM.PROCESSING_INSTRUCTION_NODE].
- compile(classGen, methodGen, ihPI);
- }
- else {
- targets[DTM.PROCESSING_INSTRUCTION_NODE] = ihPI;
- }
-
- // Match on comments - default: process next node
- InstructionHandle ihComment = ihLoop;
- if (_childNodeTestSeq != null) ihComment = ihElem;
- targets[DTM.COMMENT_NODE] = _testSeq[DTM.COMMENT_NODE] != null
- ? _testSeq[DTM.COMMENT_NODE].compile(classGen, methodGen, ihComment)
- : ihComment;
-
- // This DOM-type is not in use - default: process next node
- targets[DTM.CDATA_SECTION_NODE] = ihLoop;
-
- // This DOM-type is not in use - default: process next node
- targets[DTM.DOCUMENT_FRAGMENT_NODE] = ihLoop;
-
- // This DOM-type is not in use - default: process next node
- targets[DTM.DOCUMENT_TYPE_NODE] = ihLoop;
-
- // This DOM-type is not in use - default: process next node
- targets[DTM.ENTITY_NODE] = ihLoop;
-
- // This DOM-type is not in use - default: process next node
- targets[DTM.ENTITY_REFERENCE_NODE] = ihLoop;
-
- // This DOM-type is not in use - default: process next node
- targets[DTM.NOTATION_NODE] = ihLoop;
-
-
-
- // Now compile test sequences for various match patterns:
- for (int i = DTM.NTYPES; i < targets.length; i++) {
- final TestSeq testSeq = _testSeq[i];
- // Jump straight to namespace tests ?
- if ((testSeq == null) || (isNamespace[i])) {
- if (isAttribute[i])
- targets[i] = attrNamespaceHandle;
- else
- targets[i] = elemNamespaceHandle;
- }
- // Match on node type
- else {
- if (isAttribute[i])
- targets[i] = testSeq.compile(classGen, methodGen,
- attrNamespaceHandle);
- else
- targets[i] = testSeq.compile(classGen, methodGen,
- elemNamespaceHandle);
- }
- }
-
- if (ilKey != null) body.insert(ilKey);
-
- // Append first code in applyTemplates() - get type of current node
- final int getType = cpg.addInterfaceMethodref(DOM_INTF,
- "getExpandedTypeID",
- "(I)I");
- body.append(methodGen.loadDOM());
- body.append(new ILOAD(_currentIndex));
- body.append(new INVOKEINTERFACE(getType, 2));
-
- // Append switch() statement - main dispatch loop in applyTemplates()
- InstructionHandle disp = body.append(new SWITCH(types,targets,ihLoop));
-
- // Append all the "case:" statements
- appendTestSequences(body);
- // Append the actual template code
- appendTemplateCode(body);
-
- // Append NS:* node tests (if any)
- if (nsElem != null) body.append(nsElem);
- // Append NS:@* node tests (if any)
- if (nsAttr != null) body.append(nsAttr);
-
- // Append default action for element and root nodes
- body.append(ilRecurse);
- // Append default action for text and attribute nodes
- body.append(ilText);
-
- // putting together constituent instruction lists
- mainIL.append(body);
-
- // Mark the end of the live range for the "current" variable
- current.setEnd(body.getEnd());
-
- // fall through to ilLoop
- mainIL.append(ilLoop);
-
- peepHoleOptimization(methodGen);
- classGen.addMethod(methodGen);
-
- // Restore original (complete) set of templates for this transformation
- _templates = oldTemplates;
- }
-
- /**
- * Peephole optimization.
- */
- private void peepHoleOptimization(MethodGenerator methodGen) {
- InstructionList il = methodGen.getInstructionList();
- InstructionFinder find = new InstructionFinder(il);
- InstructionHandle ih;
- String pattern;
-
- // LoadInstruction, POP => (removed)
- // pattern = "LoadInstruction POP";
- // changed to lower case - changing to all lower case although only the instruction with capital I
- // is creating a problem in the Turkish locale
- pattern = "loadinstruction pop";
-
- for (Iterator iter = find.search(pattern); iter.hasNext();) {
- InstructionHandle[] match = (InstructionHandle[]) iter.next();
- try {
- if (!match[0].hasTargeters() && !match[1].hasTargeters()) {
- il.delete(match[0], match[1]);
- }
- }
- catch (TargetLostException e) {
- // TODO: move target down into the list
- }
- }
-
- // ILOAD_N, ILOAD_N, SWAP, ISTORE_N => ILOAD_N
- // pattern = "ILOAD ILOAD SWAP ISTORE";
- // changed to lower case - changing to all lower case although only the instruction with capital I
- // is creating a problem in the Turkish locale
- pattern = "iload iload swap istore";
- for (Iterator iter = find.search(pattern); iter.hasNext();) {
- InstructionHandle[] match = (InstructionHandle[]) iter.next();
- try {
- com.sun.org.apache.bcel.internal.generic.ILOAD iload1 =
- (com.sun.org.apache.bcel.internal.generic.ILOAD) match[0].getInstruction();
- com.sun.org.apache.bcel.internal.generic.ILOAD iload2 =
- (com.sun.org.apache.bcel.internal.generic.ILOAD) match[1].getInstruction();
- com.sun.org.apache.bcel.internal.generic.ISTORE istore =
- (com.sun.org.apache.bcel.internal.generic.ISTORE) match[3].getInstruction();
-
- if (!match[1].hasTargeters() &&
- !match[2].hasTargeters() &&
- !match[3].hasTargeters() &&
- iload1.getIndex() == iload2.getIndex() &&
- iload2.getIndex() == istore.getIndex())
- {
- il.delete(match[1], match[3]);
- }
- }
- catch (TargetLostException e) {
- // TODO: move target down into the list
- }
- }
-
- // LoadInstruction_N, LoadInstruction_M, SWAP => LoadInstruction_M, LoadInstruction_N
- // pattern = "LoadInstruction LoadInstruction SWAP";
- // changed to lower case - changing to all lower case although only the instruction with capital I
- // is creating a problem in the Turkish locale
- pattern = "loadinstruction loadinstruction swap";
- for (Iterator iter = find.search(pattern); iter.hasNext();) {
- InstructionHandle[] match = (InstructionHandle[])iter.next();
- try {
- if (!match[0].hasTargeters() &&
- !match[1].hasTargeters() &&
- !match[2].hasTargeters())
- {
- Instruction load_m = match[1].getInstruction();
- il.insert(match[0], load_m);
- il.delete(match[1], match[2]);
- }
- }
- catch (TargetLostException e) {
- // TODO: move target down into the list
- }
- }
-
- // ALOAD_N ALOAD_N => ALOAD_N DUP
- // pattern = "ALOAD ALOAD";
- // changed to lower case - changing to all lower case although only the instruction with capital I
- // is creating a problem in the Turkish locale
- pattern = "aload aload";
- for (Iterator iter = find.search(pattern); iter.hasNext();) {
- InstructionHandle[] match = (InstructionHandle[])iter.next();
- try {
- if (!match[1].hasTargeters()) {
- com.sun.org.apache.bcel.internal.generic.ALOAD aload1 =
- (com.sun.org.apache.bcel.internal.generic.ALOAD) match[0].getInstruction();
- com.sun.org.apache.bcel.internal.generic.ALOAD aload2 =
- (com.sun.org.apache.bcel.internal.generic.ALOAD) match[1].getInstruction();
-
- if (aload1.getIndex() == aload2.getIndex()) {
- il.insert(match[1], new DUP());
- il.delete(match[1]);
- }
- }
- }
- catch (TargetLostException e) {
- // TODO: move target down into the list
- }
- }
- }
-
- public InstructionHandle getTemplateInstructionHandle(Template template) {
- return _templateIHs.get(template);
- }
-
- /**
- * Auxiliary method to determine if a qname is an attribute.
- */
- private static boolean isAttributeName(String qname) {
- final int col = qname.lastIndexOf(':') + 1;
- return (qname.charAt(col) == '@');
- }
-
- /**
- * Auxiliary method to determine if a qname is a namespace
- * qualified "*".
- */
- private static boolean isNamespaceName(String qname) {
- final int col = qname.lastIndexOf(':');
- return (col > -1 && qname.charAt(qname.length()-1) == '*');
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/NameBase.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/NameBase.java
deleted file mode 100644
index fc94c15..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/NameBase.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: NameBase.java,v 1.2.4.1 2005/09/02 10:17:31 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import java.util.Vector;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-
-/**
- * @author Morten Jorgensen
- * @author Erwin Bolwidt <ejb@klomp.org>
- */
-class NameBase extends FunctionCall {
-
- private Expression _param = null;
- private Type _paramType = Type.Node;
-
- /**
- * Handles calls with no parameter (current node is implicit parameter).
- */
- public NameBase(QName fname) {
- super(fname);
- }
-
- /**
- * Handles calls with one parameter (either node or node-set).
- */
- public NameBase(QName fname, Vector arguments) {
- super(fname, arguments);
- _param = argument(0);
- }
-
-
- /**
- * Check that we either have no parameters or one parameter that is
- * either a node or a node-set.
- */
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-
- // Check the argument type (if any)
- switch(argumentCount()) {
- case 0:
- _paramType = Type.Node;
- break;
- case 1:
- _paramType = _param.typeCheck(stable);
- break;
- default:
- throw new TypeCheckError(this);
- }
-
- // The argument has to be a node, a node-set or a node reference
- if ((_paramType != Type.NodeSet) &&
- (_paramType != Type.Node) &&
- (_paramType != Type.Reference)) {
- throw new TypeCheckError(this);
- }
-
- return (_type = Type.String);
- }
-
- public Type getType() {
- return _type;
- }
-
- /**
- * Translate the code required for getting the node for which the
- * QName, local-name or namespace URI should be extracted.
- */
- public void translate(ClassGenerator classGen,
- MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- il.append(methodGen.loadDOM());
-
- // Function was called with no parameters
- if (argumentCount() == 0) {
- il.append(methodGen.loadContextNode());
- }
- // Function was called with node parameter
- else if (_paramType == Type.Node) {
- _param.translate(classGen, methodGen);
- }
- else if (_paramType == Type.Reference) {
- _param.translate(classGen, methodGen);
- il.append(new INVOKESTATIC(cpg.addMethodref
- (BASIS_LIBRARY_CLASS,
- "referenceToNodeSet",
- "("
- + OBJECT_SIG
- + ")"
- + NODE_ITERATOR_SIG)));
- il.append(methodGen.nextNode());
- }
- // Function was called with node-set parameter
- else {
- _param.translate(classGen, methodGen);
- _param.startIterator(classGen, methodGen);
- il.append(methodGen.nextNode());
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/NameCall.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/NameCall.java
deleted file mode 100644
index cb169d0..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/NameCall.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: NameCall.java,v 1.2.4.1 2005/09/02 10:19:11 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import java.util.Vector;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- */
-final class NameCall extends NameBase {
-
- /**
- * Handles calls with no parameter (current node is implicit parameter).
- */
- public NameCall(QName fname) {
- super(fname);
- }
-
- /**
- * Handles calls with one parameter (either node or node-set).
- */
- public NameCall(QName fname, Vector arguments) {
- super(fname, arguments);
- }
-
- /**
- * Translate code that leaves a node's QName (as a String) on the stack
- */
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- final int getName = cpg.addInterfaceMethodref(DOM_INTF,
- GET_NODE_NAME,
- GET_NODE_NAME_SIG);
- super.translate(classGen, methodGen);
- il.append(new INVOKEINTERFACE(getName, 2));
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/NamespaceAlias.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/NamespaceAlias.java
deleted file mode 100644
index 8d48099..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/NamespaceAlias.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: NamespaceAlias.java,v 1.2.4.1 2005/09/02 10:20:55 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-final class NamespaceAlias extends TopLevelElement {
-
- private String sPrefix;
- private String rPrefix;
-
- /*
- * The namespace alias definitions given here have an impact only on
- * literal elements and literal attributes.
- */
- public void parseContents(Parser parser) {
- sPrefix = getAttribute("stylesheet-prefix");
- rPrefix = getAttribute("result-prefix");
- parser.getSymbolTable().addPrefixAlias(sPrefix,rPrefix);
- }
-
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- return Type.Void;
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- // do nada
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/NamespaceUriCall.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/NamespaceUriCall.java
deleted file mode 100644
index 2fe7f3f..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/NamespaceUriCall.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: NamespaceUriCall.java,v 1.2.4.1 2005/09/02 10:25:26 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import java.util.Vector;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-
-/**
- * @author Morten Jorgensen
- */
-final class NamespaceUriCall extends NameBase {
-
- /**
- * Handles calls with no parameter (current node is implicit parameter).
- */
- public NamespaceUriCall(QName fname) {
- super(fname);
- }
-
- /**
- * Handles calls with one parameter (either node or node-set).
- */
- public NamespaceUriCall(QName fname, Vector arguments) {
- super(fname, arguments);
- }
-
- /**
- * Translate code that leaves a node's namespace URI (as a String)
- * on the stack
- */
- public void translate(ClassGenerator classGen,
- MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- // Returns the string value for a node in the DOM
- final int getNamespace = cpg.addInterfaceMethodref(DOM_INTF,
- "getNamespaceName",
- "(I)"+STRING_SIG);
- super.translate(classGen, methodGen);
- il.append(new INVOKEINTERFACE(getNamespace, 2));
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/NodeTest.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/NodeTest.java
deleted file mode 100644
index 5ae7c89..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/NodeTest.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: NodeTest.java,v 1.2.4.1 2005/09/02 10:31:14 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.xalan.internal.xsltc.DOM;
-import com.sun.org.apache.xml.internal.dtm.DTM;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-public interface NodeTest {
- public static final int TEXT = DTM.TEXT_NODE;
- public static final int COMMENT = DTM.COMMENT_NODE;
- public static final int PI = DTM.PROCESSING_INSTRUCTION_NODE;
- public static final int ROOT = DTM.DOCUMENT_NODE;
- public static final int ELEMENT = DTM.ELEMENT_NODE;
- public static final int ATTRIBUTE = DTM.ATTRIBUTE_NODE;
-
- // generalized type
- public static final int GTYPE = DTM.NTYPES;
-
- public static final int ANODE = DOM.FIRST_TYPE - 1;
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/NotCall.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/NotCall.java
deleted file mode 100644
index bcc2463..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/NotCall.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: NotCall.java,v 1.2.4.1 2005/09/02 10:32:18 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import java.util.Vector;
-
-import com.sun.org.apache.bcel.internal.generic.BranchHandle;
-import com.sun.org.apache.bcel.internal.generic.GOTO;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-final class NotCall extends FunctionCall {
- public NotCall(QName fname, Vector arguments) {
- super(fname, arguments);
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final InstructionList il = methodGen.getInstructionList();
- argument().translate(classGen, methodGen);
- il.append(ICONST_1);
- il.append(IXOR);
- }
-
- public void translateDesynthesized(ClassGenerator classGen,
- MethodGenerator methodGen) {
- final InstructionList il = methodGen.getInstructionList();
- final Expression exp = argument();
- exp.translateDesynthesized(classGen, methodGen);
- final BranchHandle gotoh = il.append(new GOTO(null));
- _trueList = exp._falseList; // swap flow lists
- _falseList = exp._trueList;
- _falseList.add(gotoh);
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Number.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Number.java
deleted file mode 100644
index 9b586ac..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Number.java
+++ /dev/null
@@ -1,600 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Number.java,v 1.2.4.1 2005/09/21 09:40:51 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import java.util.ArrayList;
-
-import com.sun.org.apache.bcel.internal.classfile.Field;
-import com.sun.org.apache.bcel.internal.generic.ALOAD;
-import com.sun.org.apache.bcel.internal.generic.ILOAD;
-import com.sun.org.apache.bcel.internal.generic.ASTORE;
-import com.sun.org.apache.bcel.internal.generic.BranchHandle;
-import com.sun.org.apache.bcel.internal.generic.CHECKCAST;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.GETFIELD;
-import com.sun.org.apache.bcel.internal.generic.GOTO;
-import com.sun.org.apache.bcel.internal.generic.IFNONNULL;
-import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
-import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
-import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.D2I;
-import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
-import com.sun.org.apache.bcel.internal.generic.NEW;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.bcel.internal.generic.PUTFIELD;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MatchGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeCounterGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.RealType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-final class Number extends Instruction implements Closure {
- private static final int LEVEL_SINGLE = 0;
- private static final int LEVEL_MULTIPLE = 1;
- private static final int LEVEL_ANY = 2;
-
- static final private String[] ClassNames = {
- "com.sun.org.apache.xalan.internal.xsltc.dom.SingleNodeCounter", // LEVEL_SINGLE
- "com.sun.org.apache.xalan.internal.xsltc.dom.MultipleNodeCounter", // LEVEL_MULTIPLE
- "com.sun.org.apache.xalan.internal.xsltc.dom.AnyNodeCounter" // LEVEL_ANY
- };
-
- static final private String[] FieldNames = {
- "___single_node_counter", // LEVEL_SINGLE
- "___multiple_node_counter", // LEVEL_MULTIPLE
- "___any_node_counter" // LEVEL_ANY
- };
-
- private Pattern _from = null;
- private Pattern _count = null;
- private Expression _value = null;
-
- private AttributeValueTemplate _lang = null;
- private AttributeValueTemplate _format = null;
- private AttributeValueTemplate _letterValue = null;
- private AttributeValueTemplate _groupingSeparator = null;
- private AttributeValueTemplate _groupingSize = null;
-
- private int _level = LEVEL_SINGLE;
- private boolean _formatNeeded = false;
-
- private String _className = null;
- private ArrayList _closureVars = null;
-
- // -- Begin Closure interface --------------------
-
- /**
- * Returns true if this closure is compiled in an inner class (i.e.
- * if this is a real closure).
- */
- public boolean inInnerClass() {
- return (_className != null);
- }
-
- /**
- * Returns a reference to its parent closure or null if outermost.
- */
- public Closure getParentClosure() {
- return null;
- }
-
- /**
- * Returns the name of the auxiliary class or null if this predicate
- * is compiled inside the Translet.
- */
- public String getInnerClassName() {
- return _className;
- }
-
- /**
- * Add new variable to the closure.
- */
- public void addVariable(VariableRefBase variableRef) {
- if (_closureVars == null) {
- _closureVars = new ArrayList();
- }
-
- // Only one reference per variable
- if (!_closureVars.contains(variableRef)) {
- _closureVars.add(variableRef);
- }
- }
-
- // -- End Closure interface ----------------------
-
- public void parseContents(Parser parser) {
- final int count = _attributes.getLength();
-
- for (int i = 0; i < count; i++) {
- final String name = _attributes.getQName(i);
- final String value = _attributes.getValue(i);
-
- if (name.equals("value")) {
- _value = parser.parseExpression(this, name, null);
- }
- else if (name.equals("count")) {
- _count = parser.parsePattern(this, name, null);
- }
- else if (name.equals("from")) {
- _from = parser.parsePattern(this, name, null);
- }
- else if (name.equals("level")) {
- if (value.equals("single")) {
- _level = LEVEL_SINGLE;
- }
- else if (value.equals("multiple")) {
- _level = LEVEL_MULTIPLE;
- }
- else if (value.equals("any")) {
- _level = LEVEL_ANY;
- }
- }
- else if (name.equals("format")) {
- _format = new AttributeValueTemplate(value, parser, this);
- _formatNeeded = true;
- }
- else if (name.equals("lang")) {
- _lang = new AttributeValueTemplate(value, parser, this);
- _formatNeeded = true;
- }
- else if (name.equals("letter-value")) {
- _letterValue = new AttributeValueTemplate(value, parser, this);
- _formatNeeded = true;
- }
- else if (name.equals("grouping-separator")) {
- _groupingSeparator = new AttributeValueTemplate(value, parser, this);
- _formatNeeded = true;
- }
- else if (name.equals("grouping-size")) {
- _groupingSize = new AttributeValueTemplate(value, parser, this);
- _formatNeeded = true;
- }
- }
- }
-
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- if (_value != null) {
- Type tvalue = _value.typeCheck(stable);
- if (tvalue instanceof RealType == false) {
- _value = new CastExpr(_value, Type.Real);
- }
- }
- if (_count != null) {
- _count.typeCheck(stable);
- }
- if (_from != null) {
- _from.typeCheck(stable);
- }
- if (_format != null) {
- _format.typeCheck(stable);
- }
- if (_lang != null) {
- _lang.typeCheck(stable);
- }
- if (_letterValue != null) {
- _letterValue.typeCheck(stable);
- }
- if (_groupingSeparator != null) {
- _groupingSeparator.typeCheck(stable);
- }
- if (_groupingSize != null) {
- _groupingSize.typeCheck(stable);
- }
- return Type.Void;
- }
-
- /**
- * True if the has specified a value for this instance of number.
- */
- public boolean hasValue() {
- return _value != null;
- }
-
- /**
- * Returns <tt>true</tt> if this instance of number has neither
- * a from nor a count pattern.
- */
- public boolean isDefault() {
- return _from == null && _count == null;
- }
-
- private void compileDefault(ClassGenerator classGen,
- MethodGenerator methodGen) {
- int index;
- ConstantPoolGen cpg = classGen.getConstantPool();
- InstructionList il = methodGen.getInstructionList();
-
- int[] fieldIndexes = getXSLTC().getNumberFieldIndexes();
-
- if (fieldIndexes[_level] == -1) {
- Field defaultNode = new Field(ACC_PRIVATE,
- cpg.addUtf8(FieldNames[_level]),
- cpg.addUtf8(NODE_COUNTER_SIG),
- null,
- cpg.getConstantPool());
-
- // Add a new private field to this class
- classGen.addField(defaultNode);
-
- // Get a reference to the newly added field
- fieldIndexes[_level] = cpg.addFieldref(classGen.getClassName(),
- FieldNames[_level],
- NODE_COUNTER_SIG);
- }
-
- // Check if field is initialized (runtime)
- il.append(classGen.loadTranslet());
- il.append(new GETFIELD(fieldIndexes[_level]));
- final BranchHandle ifBlock1 = il.append(new IFNONNULL(null));
-
- // Create an instance of DefaultNodeCounter
- index = cpg.addMethodref(ClassNames[_level],
- "getDefaultNodeCounter",
- "(" + TRANSLET_INTF_SIG
- + DOM_INTF_SIG
- + NODE_ITERATOR_SIG
- + ")" + NODE_COUNTER_SIG);
- il.append(classGen.loadTranslet());
- il.append(methodGen.loadDOM());
- il.append(methodGen.loadIterator());
- il.append(new INVOKESTATIC(index));
- il.append(DUP);
-
- // Store the node counter in the field
- il.append(classGen.loadTranslet());
- il.append(SWAP);
- il.append(new PUTFIELD(fieldIndexes[_level]));
- final BranchHandle ifBlock2 = il.append(new GOTO(null));
-
- // Backpatch conditionals
- ifBlock1.setTarget(il.append(classGen.loadTranslet()));
- il.append(new GETFIELD(fieldIndexes[_level]));
-
- ifBlock2.setTarget(il.append(NOP));
- }
-
- /**
- * Compiles a constructor for the class <tt>_className</tt> that
- * inherits from {Any,Single,Multiple}NodeCounter. This constructor
- * simply calls the same constructor in the super class.
- */
- private void compileConstructor(ClassGenerator classGen) {
- MethodGenerator cons;
- final InstructionList il = new InstructionList();
- final ConstantPoolGen cpg = classGen.getConstantPool();
-
- cons = new MethodGenerator(ACC_PUBLIC,
- com.sun.org.apache.bcel.internal.generic.Type.VOID,
- new com.sun.org.apache.bcel.internal.generic.Type[] {
- Util.getJCRefType(TRANSLET_INTF_SIG),
- Util.getJCRefType(DOM_INTF_SIG),
- Util.getJCRefType(NODE_ITERATOR_SIG),
- com.sun.org.apache.bcel.internal.generic.Type.BOOLEAN
- },
- new String[] {
- "dom",
- "translet",
- "iterator",
- "hasFrom"
- },
- "<init>", _className, il, cpg);
-
- il.append(ALOAD_0); // this
- il.append(ALOAD_1); // translet
- il.append(ALOAD_2); // DOM
- il.append(new ALOAD(3)); // iterator
- il.append(new ILOAD(4)); // hasFrom
-
- int index = cpg.addMethodref(ClassNames[_level],
- "<init>",
- "(" + TRANSLET_INTF_SIG
- + DOM_INTF_SIG
- + NODE_ITERATOR_SIG
- + "Z)V");
- il.append(new INVOKESPECIAL(index));
- il.append(RETURN);
-
- classGen.addMethod(cons);
- }
-
- /**
- * This method compiles code that is common to matchesFrom() and
- * matchesCount() in the auxillary class.
- */
- private void compileLocals(NodeCounterGenerator nodeCounterGen,
- MatchGenerator matchGen,
- InstructionList il)
- {
- int field;
- LocalVariableGen local;
- ConstantPoolGen cpg = nodeCounterGen.getConstantPool();
-
- // Get NodeCounter._iterator and store locally
- local = matchGen.addLocalVariable("iterator",
- Util.getJCRefType(NODE_ITERATOR_SIG),
- null, null);
- field = cpg.addFieldref(NODE_COUNTER, "_iterator",
- ITERATOR_FIELD_SIG);
- il.append(ALOAD_0); // 'this' pointer on stack
- il.append(new GETFIELD(field));
- local.setStart(il.append(new ASTORE(local.getIndex())));
- matchGen.setIteratorIndex(local.getIndex());
-
- // Get NodeCounter._translet and store locally
- local = matchGen.addLocalVariable("translet",
- Util.getJCRefType(TRANSLET_SIG),
- null, null);
- field = cpg.addFieldref(NODE_COUNTER, "_translet",
- "Lcom/sun/org/apache/xalan/internal/xsltc/Translet;");
- il.append(ALOAD_0); // 'this' pointer on stack
- il.append(new GETFIELD(field));
- il.append(new CHECKCAST(cpg.addClass(TRANSLET_CLASS)));
- local.setStart(il.append(new ASTORE(local.getIndex())));
- nodeCounterGen.setTransletIndex(local.getIndex());
-
- // Get NodeCounter._document and store locally
- local = matchGen.addLocalVariable("document",
- Util.getJCRefType(DOM_INTF_SIG),
- null, null);
- field = cpg.addFieldref(_className, "_document", DOM_INTF_SIG);
- il.append(ALOAD_0); // 'this' pointer on stack
- il.append(new GETFIELD(field));
- // Make sure we have the correct DOM type on the stack!!!
- local.setStart(il.append(new ASTORE(local.getIndex())));
- matchGen.setDomIndex(local.getIndex());
- }
-
- private void compilePatterns(ClassGenerator classGen,
- MethodGenerator methodGen)
- {
- int current;
- int field;
- LocalVariableGen local;
- MatchGenerator matchGen;
- NodeCounterGenerator nodeCounterGen;
-
- _className = getXSLTC().getHelperClassName();
- nodeCounterGen = new NodeCounterGenerator(_className,
- ClassNames[_level],
- toString(),
- ACC_PUBLIC | ACC_SUPER,
- null,
- classGen.getStylesheet());
- InstructionList il = null;
- ConstantPoolGen cpg = nodeCounterGen.getConstantPool();
-
- // Add a new instance variable for each var in closure
- final int closureLen = (_closureVars == null) ? 0 :
- _closureVars.size();
-
- for (int i = 0; i < closureLen; i++) {
- VariableBase var =
- ((VariableRefBase) _closureVars.get(i)).getVariable();
-
- nodeCounterGen.addField(new Field(ACC_PUBLIC,
- cpg.addUtf8(var.getEscapedName()),
- cpg.addUtf8(var.getType().toSignature()),
- null, cpg.getConstantPool()));
- }
-
- // Add a single constructor to the class
- compileConstructor(nodeCounterGen);
-
- /*
- * Compile method matchesFrom()
- */
- if (_from != null) {
- il = new InstructionList();
- matchGen =
- new MatchGenerator(ACC_PUBLIC | ACC_FINAL,
- com.sun.org.apache.bcel.internal.generic.Type.BOOLEAN,
- new com.sun.org.apache.bcel.internal.generic.Type[] {
- com.sun.org.apache.bcel.internal.generic.Type.INT,
- },
- new String[] {
- "node",
- },
- "matchesFrom", _className, il, cpg);
-
- compileLocals(nodeCounterGen,matchGen,il);
-
- // Translate Pattern
- il.append(matchGen.loadContextNode());
- _from.translate(nodeCounterGen, matchGen);
- _from.synthesize(nodeCounterGen, matchGen);
- il.append(IRETURN);
-
- nodeCounterGen.addMethod(matchGen);
- }
-
- /*
- * Compile method matchesCount()
- */
- if (_count != null) {
- il = new InstructionList();
- matchGen = new MatchGenerator(ACC_PUBLIC | ACC_FINAL,
- com.sun.org.apache.bcel.internal.generic.Type.BOOLEAN,
- new com.sun.org.apache.bcel.internal.generic.Type[] {
- com.sun.org.apache.bcel.internal.generic.Type.INT,
- },
- new String[] {
- "node",
- },
- "matchesCount", _className, il, cpg);
-
- compileLocals(nodeCounterGen,matchGen,il);
-
- // Translate Pattern
- il.append(matchGen.loadContextNode());
- _count.translate(nodeCounterGen, matchGen);
- _count.synthesize(nodeCounterGen, matchGen);
-
- il.append(IRETURN);
-
- nodeCounterGen.addMethod(matchGen);
- }
-
- getXSLTC().dumpClass(nodeCounterGen.getJavaClass());
-
- // Push an instance of the newly created class
- cpg = classGen.getConstantPool();
- il = methodGen.getInstructionList();
-
- final int index = cpg.addMethodref(_className, "<init>",
- "(" + TRANSLET_INTF_SIG
- + DOM_INTF_SIG
- + NODE_ITERATOR_SIG
- + "Z)V");
- il.append(new NEW(cpg.addClass(_className)));
- il.append(DUP);
- il.append(classGen.loadTranslet());
- il.append(methodGen.loadDOM());
- il.append(methodGen.loadIterator());
- il.append(_from != null ? ICONST_1 : ICONST_0);
- il.append(new INVOKESPECIAL(index));
-
- // Initialize closure variables
- for (int i = 0; i < closureLen; i++) {
- final VariableRefBase varRef = (VariableRefBase) _closureVars.get(i);
- final VariableBase var = varRef.getVariable();
- final Type varType = var.getType();
-
- // Store variable in new closure
- il.append(DUP);
- il.append(var.loadInstruction());
- il.append(new PUTFIELD(
- cpg.addFieldref(_className, var.getEscapedName(),
- varType.toSignature())));
- }
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- int index;
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- // Push "this" for the call to characters()
- il.append(classGen.loadTranslet());
-
- if (hasValue()) {
- compileDefault(classGen, methodGen);
- _value.translate(classGen, methodGen);
-
- // Using java.lang.Math.floor(number + 0.5) to return a double value
- il.append(new PUSH(cpg, 0.5));
- il.append(DADD);
- index = cpg.addMethodref(MATH_CLASS, "floor", "(D)D");
- il.append(new INVOKESTATIC(index));
-
- // Call setValue on the node counter
- index = cpg.addMethodref(NODE_COUNTER,
- "setValue",
- "(D)" + NODE_COUNTER_SIG);
- il.append(new INVOKEVIRTUAL(index));
- }
- else if (isDefault()) {
- compileDefault(classGen, methodGen);
- }
- else {
- compilePatterns(classGen, methodGen);
- }
-
- // Call setStartNode()
- if (!hasValue()) {
- il.append(methodGen.loadContextNode());
- index = cpg.addMethodref(NODE_COUNTER,
- SET_START_NODE,
- "(I)" + NODE_COUNTER_SIG);
- il.append(new INVOKEVIRTUAL(index));
- }
-
- // Call getCounter() with or without args
- if (_formatNeeded) {
- if (_format != null) {
- _format.translate(classGen, methodGen);
- }
- else {
- il.append(new PUSH(cpg, "1"));
- }
-
- if (_lang != null) {
- _lang.translate(classGen, methodGen);
- }
- else {
- il.append(new PUSH(cpg, "en")); // TODO ??
- }
-
- if (_letterValue != null) {
- _letterValue.translate(classGen, methodGen);
- }
- else {
- il.append(new PUSH(cpg, Constants.EMPTYSTRING));
- }
-
- if (_groupingSeparator != null) {
- _groupingSeparator.translate(classGen, methodGen);
- }
- else {
- il.append(new PUSH(cpg, Constants.EMPTYSTRING));
- }
-
- if (_groupingSize != null) {
- _groupingSize.translate(classGen, methodGen);
- }
- else {
- il.append(new PUSH(cpg, "0"));
- }
-
- index = cpg.addMethodref(NODE_COUNTER, "getCounter",
- "(" + STRING_SIG + STRING_SIG
- + STRING_SIG + STRING_SIG
- + STRING_SIG + ")" + STRING_SIG);
- il.append(new INVOKEVIRTUAL(index));
- }
- else {
- index = cpg.addMethodref(NODE_COUNTER, "setDefaultFormatting",
- "()" + NODE_COUNTER_SIG);
- il.append(new INVOKEVIRTUAL(index));
-
- index = cpg.addMethodref(NODE_COUNTER, "getCounter",
- "()" + STRING_SIG);
- il.append(new INVOKEVIRTUAL(index));
- }
-
- // Output the resulting string to the handler
- il.append(methodGen.loadHandler());
- index = cpg.addMethodref(TRANSLET_CLASS,
- CHARACTERSW,
- CHARACTERSW_SIG);
- il.append(new INVOKEVIRTUAL(index));
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/NumberCall.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/NumberCall.java
deleted file mode 100644
index d621bf2..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/NumberCall.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: NumberCall.java,v 1.2.4.1 2005/09/02 10:39:10 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import java.util.Vector;
-
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-final class NumberCall extends FunctionCall {
-
- public NumberCall(QName fname, Vector arguments) {
- super(fname, arguments);
- }
-
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- if (argumentCount() > 0) {
- argument().typeCheck(stable);
- }
- return _type = Type.Real;
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final InstructionList il = methodGen.getInstructionList();
- Type targ;
-
- if (argumentCount() == 0) {
- il.append(methodGen.loadContextNode());
- targ = Type.Node;
- }
- else {
- final Expression arg = argument();
- arg.translate(classGen, methodGen);
- arg.startIterator(classGen, methodGen);
- targ = arg.getType();
- }
-
- if (!targ.identicalTo(Type.Real)) {
- targ.translateTo(classGen, methodGen, Type.Real);
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Otherwise.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Otherwise.java
deleted file mode 100644
index b135890..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Otherwise.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Otherwise.java,v 1.2.4.1 2005/09/02 10:58:56 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-final class Otherwise extends Instruction {
- public void display(int indent) {
- indent(indent);
- Util.println("Otherwise");
- indent(indent + IndentIncrement);
- displayContents(indent + IndentIncrement);
- }
-
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- typeCheckContents(stable);
- return Type.Void;
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final Parser parser = getParser();
- final ErrorMsg err = new ErrorMsg(ErrorMsg.STRAY_OTHERWISE_ERR, this);
- parser.reportError(Constants.ERROR, err);
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Output.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Output.java
deleted file mode 100644
index 0f183b9..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Output.java
+++ /dev/null
@@ -1,421 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Output.java,v 1.2.4.1 2005/09/12 10:53:00 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import java.io.OutputStreamWriter;
-import java.util.Properties;
-import java.util.StringTokenizer;
-
-import javax.xml.transform.OutputKeys;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.bcel.internal.generic.PUTFIELD;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-import com.sun.org.apache.xml.internal.serializer.Encodings;
-import com.sun.org.apache.xml.internal.utils.XML11Char;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- */
-final class Output extends TopLevelElement {
-
- // TODO: use three-value variables for boolean values: true/false/default
-
- // These attributes are extracted from the xsl:output element. They also
- // appear as fields (with the same type, only public) in the translet
- private String _version;
- private String _method;
- private String _encoding;
- private boolean _omitHeader = false;
- private String _standalone;
- private String _doctypePublic;
- private String _doctypeSystem;
- private String _cdata;
- private boolean _indent = false;
- private String _mediaType;
- private String _indentamount;
-
- // Disables this output element (when other element has higher precedence)
- private boolean _disabled = false;
-
- // Some global constants
- private final static String STRING_SIG = "Ljava/lang/String;";
- private final static String XML_VERSION = "1.0";
- private final static String HTML_VERSION = "4.0";
-
- /**
- * Displays the contents of this element (for debugging)
- */
- public void display(int indent) {
- indent(indent);
- Util.println("Output " + _method);
- }
-
- /**
- * Disables this <xsl:output> element in case where there are some other
- * <xsl:output> element (from a different imported/included stylesheet)
- * with higher precedence.
- */
- public void disable() {
- _disabled = true;
- }
-
- public boolean enabled() {
- return !_disabled;
- }
-
- public String getCdata() {
- return _cdata;
- }
-
- public String getOutputMethod() {
- return _method;
- }
-
- private void transferAttribute(Output previous, String qname) {
- if (!hasAttribute(qname) && previous.hasAttribute(qname)) {
- addAttribute(qname, previous.getAttribute(qname));
- }
- }
-
- public void mergeOutput(Output previous) {
- // Transfer attributes from previous xsl:output
- transferAttribute(previous, "version");
- transferAttribute(previous, "method");
- transferAttribute(previous, "encoding");
- transferAttribute(previous, "doctype-system");
- transferAttribute(previous, "doctype-public");
- transferAttribute(previous, "media-type");
- transferAttribute(previous, "indent");
- transferAttribute(previous, "omit-xml-declaration");
- transferAttribute(previous, "standalone");
-
- // Merge cdata-section-elements
- if (previous.hasAttribute("cdata-section-elements")) {
- // addAttribute works as a setter if it already exists
- addAttribute("cdata-section-elements",
- previous.getAttribute("cdata-section-elements") + ' ' +
- getAttribute("cdata-section-elements"));
- }
-
- // Transfer non-standard attributes as well
- String prefix = lookupPrefix("http://xml.apache.org/xalan");
- if (prefix != null) {
- transferAttribute(previous, prefix + ':' + "indent-amount");
- }
- prefix = lookupPrefix("http://xml.apache.org/xslt");
- if (prefix != null) {
- transferAttribute(previous, prefix + ':' + "indent-amount");
- }
- }
-
- /**
- * Scans the attribute list for the xsl:output instruction
- */
- public void parseContents(Parser parser) {
- final Properties outputProperties = new Properties();
-
- // Ask the parser if it wants this <xsl:output> element
- parser.setOutput(this);
-
- // Do nothing if other <xsl:output> element has higher precedence
- if (_disabled) return;
-
- String attrib = null;
-
- // Get the output version
- _version = getAttribute("version");
- if (_version.equals(Constants.EMPTYSTRING)) {
- _version = null;
- }
- else {
- outputProperties.setProperty(OutputKeys.VERSION, _version);
- }
-
- // Get the output method - "xml", "html", "text" or <qname> (but not ncname)
- _method = getAttribute("method");
- if (_method.equals(Constants.EMPTYSTRING)) {
- _method = null;
- }
- if (_method != null) {
- _method = _method.toLowerCase();
- if ((_method.equals("xml"))||
- (_method.equals("html"))||
- (_method.equals("text"))||
- ((XML11Char.isXML11ValidQName(_method)&&(_method.indexOf(":") > 0)))) {
- outputProperties.setProperty(OutputKeys.METHOD, _method);
- } else {
- reportError(this, parser, ErrorMsg.INVALID_METHOD_IN_OUTPUT, _method);
- }
- }
-
- // Get the output encoding - any value accepted here
- _encoding = getAttribute("encoding");
- if (_encoding.equals(Constants.EMPTYSTRING)) {
- _encoding = null;
- }
- else {
- try {
- // Create a write to verify encoding support
- String canonicalEncoding;
- canonicalEncoding = Encodings.convertMime2JavaEncoding(_encoding);
- OutputStreamWriter writer =
- new OutputStreamWriter(System.out, canonicalEncoding);
- }
- catch (java.io.UnsupportedEncodingException e) {
- ErrorMsg msg = new ErrorMsg(ErrorMsg.UNSUPPORTED_ENCODING,
- _encoding, this);
- parser.reportError(Constants.WARNING, msg);
- }
- outputProperties.setProperty(OutputKeys.ENCODING, _encoding);
- }
-
- // Should the XML header be omitted - translate to true/false
- attrib = getAttribute("omit-xml-declaration");
- if (!attrib.equals(Constants.EMPTYSTRING)) {
- if (attrib.equals("yes")) {
- _omitHeader = true;
- }
- outputProperties.setProperty(OutputKeys.OMIT_XML_DECLARATION, attrib);
- }
-
- // Add 'standalone' decaration to output - use text as is
- _standalone = getAttribute("standalone");
- if (_standalone.equals(Constants.EMPTYSTRING)) {
- _standalone = null;
- }
- else {
- outputProperties.setProperty(OutputKeys.STANDALONE, _standalone);
- }
-
- // Get system/public identifiers for output DOCTYPE declaration
- _doctypeSystem = getAttribute("doctype-system");
- if (_doctypeSystem.equals(Constants.EMPTYSTRING)) {
- _doctypeSystem = null;
- }
- else {
- outputProperties.setProperty(OutputKeys.DOCTYPE_SYSTEM, _doctypeSystem);
- }
-
-
- _doctypePublic = getAttribute("doctype-public");
- if (_doctypePublic.equals(Constants.EMPTYSTRING)) {
- _doctypePublic = null;
- }
- else {
- outputProperties.setProperty(OutputKeys.DOCTYPE_PUBLIC, _doctypePublic);
- }
-
- // Names the elements of whose text contents should be output as CDATA
- _cdata = getAttribute("cdata-section-elements");
- if (_cdata.equals(Constants.EMPTYSTRING)) {
- _cdata = null;
- }
- else {
- StringBuffer expandedNames = new StringBuffer();
- StringTokenizer tokens = new StringTokenizer(_cdata);
-
- // Make sure to store names in expanded form
- while (tokens.hasMoreTokens()) {
- String qname = tokens.nextToken();
- if (!XML11Char.isXML11ValidQName(qname)) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_QNAME_ERR, qname, this);
- parser.reportError(Constants.ERROR, err);
- }
- expandedNames.append(
- parser.getQName(qname).toString()).append(' ');
- }
- _cdata = expandedNames.toString();
- outputProperties.setProperty(OutputKeys.CDATA_SECTION_ELEMENTS,
- _cdata);
- }
-
- // Get the indent setting - only has effect for xml and html output
- attrib = getAttribute("indent");
- if (!attrib.equals(EMPTYSTRING)) {
- if (attrib.equals("yes")) {
- _indent = true;
- }
- outputProperties.setProperty(OutputKeys.INDENT, attrib);
- }
- else if (_method != null && _method.equals("html")) {
- _indent = true;
- }
-
- // indent-amount: extension attribute of xsl:output
- _indentamount = getAttribute(
- lookupPrefix("http://xml.apache.org/xalan"), "indent-amount");
- // Hack for supporting Old Namespace URI.
- if (_indentamount.equals(EMPTYSTRING)){
- _indentamount = getAttribute(
- lookupPrefix("http://xml.apache.org/xslt"), "indent-amount");
- }
- if (!_indentamount.equals(EMPTYSTRING)) {
- outputProperties.setProperty("indent_amount", _indentamount);
- }
-
- // Get the MIME type for the output file
- _mediaType = getAttribute("media-type");
- if (_mediaType.equals(Constants.EMPTYSTRING)) {
- _mediaType = null;
- }
- else {
- outputProperties.setProperty(OutputKeys.MEDIA_TYPE, _mediaType);
- }
-
- // Implied properties
- if (_method != null) {
- if (_method.equals("html")) {
- if (_version == null) {
- _version = HTML_VERSION;
- }
- if (_mediaType == null) {
- _mediaType = "text/html";
- }
- }
- else if (_method.equals("text")) {
- if (_mediaType == null) {
- _mediaType = "text/plain";
- }
- }
- }
-
- // Set output properties in current stylesheet
- parser.getCurrentStylesheet().setOutputProperties(outputProperties);
- }
-
- /**
- * Compile code that passes the information in this <xsl:output> element
- * to the appropriate fields in the translet
- */
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-
- // Do nothing if other <xsl:output> element has higher precedence
- if (_disabled) return;
-
- ConstantPoolGen cpg = classGen.getConstantPool();
- InstructionList il = methodGen.getInstructionList();
-
- int field = 0;
- il.append(classGen.loadTranslet());
-
- // Only update _version field if set and different from default
- if ((_version != null) && (!_version.equals(XML_VERSION))) {
- field = cpg.addFieldref(TRANSLET_CLASS, "_version", STRING_SIG);
- il.append(DUP);
- il.append(new PUSH(cpg, _version));
- il.append(new PUTFIELD(field));
- }
-
- // Only update _method field if "method" attribute used
- if (_method != null) {
- field = cpg.addFieldref(TRANSLET_CLASS, "_method", STRING_SIG);
- il.append(DUP);
- il.append(new PUSH(cpg, _method));
- il.append(new PUTFIELD(field));
- }
-
- // Only update if _encoding field is "encoding" attribute used
- if (_encoding != null) {
- field = cpg.addFieldref(TRANSLET_CLASS, "_encoding", STRING_SIG);
- il.append(DUP);
- il.append(new PUSH(cpg, _encoding));
- il.append(new PUTFIELD(field));
- }
-
- // Only update if "omit-xml-declaration" used and set to 'yes'
- if (_omitHeader) {
- field = cpg.addFieldref(TRANSLET_CLASS, "_omitHeader", "Z");
- il.append(DUP);
- il.append(new PUSH(cpg, _omitHeader));
- il.append(new PUTFIELD(field));
- }
-
- // Add 'standalone' decaration to output - use text as is
- if (_standalone != null) {
- field = cpg.addFieldref(TRANSLET_CLASS, "_standalone", STRING_SIG);
- il.append(DUP);
- il.append(new PUSH(cpg, _standalone));
- il.append(new PUTFIELD(field));
- }
-
- // Set system/public doctype only if both are set
- field = cpg.addFieldref(TRANSLET_CLASS,"_doctypeSystem",STRING_SIG);
- il.append(DUP);
- il.append(new PUSH(cpg, _doctypeSystem));
- il.append(new PUTFIELD(field));
- field = cpg.addFieldref(TRANSLET_CLASS,"_doctypePublic",STRING_SIG);
- il.append(DUP);
- il.append(new PUSH(cpg, _doctypePublic));
- il.append(new PUTFIELD(field));
-
- // Add 'medye-type' decaration to output - if used
- if (_mediaType != null) {
- field = cpg.addFieldref(TRANSLET_CLASS, "_mediaType", STRING_SIG);
- il.append(DUP);
- il.append(new PUSH(cpg, _mediaType));
- il.append(new PUTFIELD(field));
- }
-
- // Compile code to set output indentation on/off
- if (_indent) {
- field = cpg.addFieldref(TRANSLET_CLASS, "_indent", "Z");
- il.append(DUP);
- il.append(new PUSH(cpg, _indent));
- il.append(new PUTFIELD(field));
- }
-
- //Compile code to set indent amount.
- if(_indentamount != null && !_indentamount.equals(EMPTYSTRING)){
- field = cpg.addFieldref(TRANSLET_CLASS, "_indentamount", "I");
- il.append(DUP);
- il.append(new PUSH(cpg, Integer.parseInt(_indentamount)));
- il.append(new PUTFIELD(field));
- }
-
- // Forward to the translet any elements that should be output as CDATA
- if (_cdata != null) {
- int index = cpg.addMethodref(TRANSLET_CLASS,
- "addCdataElement",
- "(Ljava/lang/String;)V");
-
- StringTokenizer tokens = new StringTokenizer(_cdata);
- while (tokens.hasMoreTokens()) {
- il.append(DUP);
- il.append(new PUSH(cpg, tokens.nextToken()));
- il.append(new INVOKEVIRTUAL(index));
- }
- }
- il.append(POP); // Cleanup - pop last translet reference off stack
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Param.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Param.java
deleted file mode 100644
index 41c8ff3..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Param.java
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Param.java,v 1.2.4.1 2005/09/02 11:03:42 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.classfile.Field;
-import com.sun.org.apache.bcel.internal.generic.BranchHandle;
-import com.sun.org.apache.bcel.internal.generic.CHECKCAST;
-import com.sun.org.apache.bcel.internal.generic.IFNONNULL;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
-import com.sun.org.apache.bcel.internal.generic.Instruction;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.bcel.internal.generic.PUTFIELD;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ReferenceType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ObjectType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.BasisLibrary;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- * @author Erwin Bolwidt <ejb@klomp.org>
- * @author John Howard <JohnH@schemasoft.com>
- */
-final class Param extends VariableBase {
-
- /**
- * True if this Param is declared in a simple named template.
- * This is used to optimize codegen for parameter passing
- * in named templates.
- */
- private boolean _isInSimpleNamedTemplate = false;
-
- /**
- * Display variable as single string
- */
- public String toString() {
- return "param(" + _name + ")";
- }
-
- /**
- * Set the instruction for loading the value of this variable onto the
- * JVM stack and returns the old instruction.
- */
- public Instruction setLoadInstruction(Instruction instruction) {
- Instruction tmp = _loadInstruction;
- _loadInstruction = instruction;
- return tmp;
- }
-
- /**
- * Set the instruction for storing a value from the stack into this
- * variable and returns the old instruction.
- */
- public Instruction setStoreInstruction(Instruction instruction) {
- Instruction tmp = _storeInstruction;
- _storeInstruction = instruction;
- return tmp;
- }
-
- /**
- * Display variable in a full AST dump
- */
- public void display(int indent) {
- indent(indent);
- System.out.println("param " + _name);
- if (_select != null) {
- indent(indent + IndentIncrement);
- System.out.println("select " + _select.toString());
- }
- displayContents(indent + IndentIncrement);
- }
-
- /**
- * Parse the contents of the <xsl:param> element. This method must read
- * the 'name' (required) and 'select' (optional) attributes.
- */
- public void parseContents(Parser parser) {
-
- // Parse 'name' and 'select' attributes plus parameter contents
- super.parseContents(parser);
-
- // Add a ref to this param to its enclosing construct
- final SyntaxTreeNode parent = getParent();
- if (parent instanceof Stylesheet) {
- // Mark this as a global parameter
- _isLocal = false;
- // Check if a global variable with this name already exists...
- Param param = parser.getSymbolTable().lookupParam(_name);
- // ...and if it does we need to check import precedence
- if (param != null) {
- final int us = this.getImportPrecedence();
- final int them = param.getImportPrecedence();
- // It is an error if the two have the same import precedence
- if (us == them) {
- final String name = _name.toString();
- reportError(this, parser, ErrorMsg.VARIABLE_REDEF_ERR,name);
- }
- // Ignore this if previous definition has higher precedence
- else if (them > us) {
- _ignore = true;
- copyReferences(param);
- return;
- }
- else {
- param.copyReferences(this);
- param.disable();
- }
- }
- // Add this variable if we have higher precedence
- ((Stylesheet)parent).addParam(this);
- parser.getSymbolTable().addParam(this);
- }
- else if (parent instanceof Template) {
- Template template = (Template) parent;
- _isLocal = true;
- template.addParameter(this);
- if (template.isSimpleNamedTemplate()) {
- _isInSimpleNamedTemplate = true;
- }
- }
- }
-
- /**
- * Type-checks the parameter. The parameter type is determined by the
- * 'select' expression (if present) or is a result tree if the parameter
- * element has a body and no 'select' expression.
- */
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- if (_select != null) {
- _type = _select.typeCheck(stable);
- if (_type instanceof ReferenceType == false && !(_type instanceof ObjectType)) {
- _select = new CastExpr(_select, Type.Reference);
- }
- }
- else if (hasContents()) {
- typeCheckContents(stable);
- }
- _type = Type.Reference;
-
- // This element has no type (the parameter does, but the parameter
- // element itself does not).
- return Type.Void;
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- if (_ignore) return;
- _ignore = true;
-
- /*
- * To fix bug 24518 related to setting parameters of the form
- * {namespaceuri}localName which will get mapped to an instance
- * variable in the class.
- */
- final String name = BasisLibrary.mapQNameToJavaName(_name.toString());
- final String signature = _type.toSignature();
- final String className = _type.getClassName();
-
- if (isLocal()) {
- /*
- * If simple named template then generate a conditional init of the
- * param using its default value:
- * if (param == null) param = <default-value>
- */
- if (_isInSimpleNamedTemplate) {
- il.append(loadInstruction());
- BranchHandle ifBlock = il.append(new IFNONNULL(null));
- translateValue(classGen, methodGen);
- il.append(storeInstruction());
- ifBlock.setTarget(il.append(NOP));
- return;
- }
-
- il.append(classGen.loadTranslet());
- il.append(new PUSH(cpg, name));
- translateValue(classGen, methodGen);
- il.append(new PUSH(cpg, true));
-
- // Call addParameter() from this class
- il.append(new INVOKEVIRTUAL(cpg.addMethodref(TRANSLET_CLASS,
- ADD_PARAMETER,
- ADD_PARAMETER_SIG)));
- if (className != EMPTYSTRING) {
- il.append(new CHECKCAST(cpg.addClass(className)));
- }
-
- _type.translateUnBox(classGen, methodGen);
-
- if (_refs.isEmpty()) { // nobody uses the value
- il.append(_type.POP());
- _local = null;
- }
- else { // normal case
- _local = methodGen.addLocalVariable2(name,
- _type.toJCType(),
- il.getEnd());
- // Cache the result of addParameter() in a local variable
- il.append(_type.STORE(_local.getIndex()));
- }
- }
- else {
- if (classGen.containsField(name) == null) {
- classGen.addField(new Field(ACC_PUBLIC, cpg.addUtf8(name),
- cpg.addUtf8(signature),
- null, cpg.getConstantPool()));
- il.append(classGen.loadTranslet());
- il.append(DUP);
- il.append(new PUSH(cpg, name));
- translateValue(classGen, methodGen);
- il.append(new PUSH(cpg, true));
-
- // Call addParameter() from this class
- il.append(new INVOKEVIRTUAL(cpg.addMethodref(TRANSLET_CLASS,
- ADD_PARAMETER,
- ADD_PARAMETER_SIG)));
-
- _type.translateUnBox(classGen, methodGen);
-
- // Cache the result of addParameter() in a field
- if (className != EMPTYSTRING) {
- il.append(new CHECKCAST(cpg.addClass(className)));
- }
- il.append(new PUTFIELD(cpg.addFieldref(classGen.getClassName(),
- name, signature)));
- }
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ParameterRef.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ParameterRef.java
deleted file mode 100644
index ed051fa..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ParameterRef.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ParameterRef.java,v 1.2.4.1 2005/09/02 11:05:08 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.CHECKCAST;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.GETFIELD;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeSetType;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.BasisLibrary;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- * @author Erwin Bolwidt <ejb@klomp.org>
- */
-final class ParameterRef extends VariableRefBase {
-
- /**
- * Name of param being referenced.
- */
- QName _name = null;
-
- public ParameterRef(Param param) {
- super(param);
- _name = param._name;
-
- }
-
- public String toString() {
- return "parameter-ref("+_variable.getName()+'/'+_variable.getType()+')';
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- /*
- * To fix bug 24518 related to setting parameters of the form
- * {namespaceuri}localName, which will get mapped to an instance
- * variable in the class.
- */
- final String name = BasisLibrary.mapQNameToJavaName (_name.toString());
- final String signature = _type.toSignature();
-
- if (_variable.isLocal()) {
- if (classGen.isExternal()) {
- Closure variableClosure = _closure;
- while (variableClosure != null) {
- if (variableClosure.inInnerClass()) break;
- variableClosure = variableClosure.getParentClosure();
- }
-
- if (variableClosure != null) {
- il.append(ALOAD_0);
- il.append(new GETFIELD(
- cpg.addFieldref(variableClosure.getInnerClassName(),
- name, signature)));
- }
- else {
- il.append(_variable.loadInstruction());
- }
- }
- else {
- il.append(_variable.loadInstruction());
- }
- }
- else {
- final String className = classGen.getClassName();
- il.append(classGen.loadTranslet());
- if (classGen.isExternal()) {
- il.append(new CHECKCAST(cpg.addClass(className)));
- }
- il.append(new GETFIELD(cpg.addFieldref(className,name,signature)));
- }
-
- if (_variable.getType() instanceof NodeSetType) {
- // The method cloneIterator() also does resetting
- final int clone = cpg.addInterfaceMethodref(NODE_ITERATOR,
- "cloneIterator",
- "()" +
- NODE_ITERATOR_SIG);
- il.append(new INVOKEINTERFACE(clone, 1));
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ParentLocationPath.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ParentLocationPath.java
deleted file mode 100644
index 9ecd74a..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ParentLocationPath.java
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ParentLocationPath.java,v 1.2.4.1 2005/09/12 10:56:30 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.ALOAD;
-import com.sun.org.apache.bcel.internal.generic.ASTORE;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
-import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
-import com.sun.org.apache.bcel.internal.generic.NEW;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-import com.sun.org.apache.xml.internal.dtm.Axis;
-import com.sun.org.apache.xml.internal.dtm.DTM;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-final class ParentLocationPath extends RelativeLocationPath {
- private Expression _step;
- private final RelativeLocationPath _path;
- private Type stype;
- private boolean _orderNodes = false;
- private boolean _axisMismatch = false;
-
- public ParentLocationPath(RelativeLocationPath path, Expression step) {
- _path = path;
- _step = step;
- _path.setParent(this);
- _step.setParent(this);
-
- if (_step instanceof Step) {
- _axisMismatch = checkAxisMismatch();
- }
- }
-
- public void setAxis(int axis) {
- _path.setAxis(axis);
- }
-
- public int getAxis() {
- return _path.getAxis();
- }
-
- public RelativeLocationPath getPath() {
- return(_path);
- }
-
- public Expression getStep() {
- return(_step);
- }
-
- public void setParser(Parser parser) {
- super.setParser(parser);
- _step.setParser(parser);
- _path.setParser(parser);
- }
-
- public String toString() {
- return "ParentLocationPath(" + _path + ", " + _step + ')';
- }
-
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- stype = _step.typeCheck(stable);
- _path.typeCheck(stable);
-
- if (_axisMismatch) enableNodeOrdering();
-
- return _type = Type.NodeSet;
- }
-
- public void enableNodeOrdering() {
- SyntaxTreeNode parent = getParent();
- if (parent instanceof ParentLocationPath)
- ((ParentLocationPath)parent).enableNodeOrdering();
- else {
- _orderNodes = true;
- }
- }
-
- /**
- * This method is used to determine if this parent location path is a
- * combination of two step's with axes that will create duplicate or
- * unordered nodes.
- */
- public boolean checkAxisMismatch() {
-
- int left = _path.getAxis();
- int right = ((Step)_step).getAxis();
-
- if (((left == Axis.ANCESTOR) || (left == Axis.ANCESTORORSELF)) &&
- ((right == Axis.CHILD) ||
- (right == Axis.DESCENDANT) ||
- (right == Axis.DESCENDANTORSELF) ||
- (right == Axis.PARENT) ||
- (right == Axis.PRECEDING) ||
- (right == Axis.PRECEDINGSIBLING)))
- return true;
-
- if ((left == Axis.CHILD) &&
- (right == Axis.ANCESTOR) ||
- (right == Axis.ANCESTORORSELF) ||
- (right == Axis.PARENT) ||
- (right == Axis.PRECEDING))
- return true;
-
- if ((left == Axis.DESCENDANT) || (left == Axis.DESCENDANTORSELF))
- return true;
-
- if (((left == Axis.FOLLOWING) || (left == Axis.FOLLOWINGSIBLING)) &&
- ((right == Axis.FOLLOWING) ||
- (right == Axis.PARENT) ||
- (right == Axis.PRECEDING) ||
- (right == Axis.PRECEDINGSIBLING)))
- return true;
-
- if (((left == Axis.PRECEDING) || (left == Axis.PRECEDINGSIBLING)) &&
- ((right == Axis.DESCENDANT) ||
- (right == Axis.DESCENDANTORSELF) ||
- (right == Axis.FOLLOWING) ||
- (right == Axis.FOLLOWINGSIBLING) ||
- (right == Axis.PARENT) ||
- (right == Axis.PRECEDING) ||
- (right == Axis.PRECEDINGSIBLING)))
- return true;
-
- if ((right == Axis.FOLLOWING) && (left == Axis.CHILD)) {
- // Special case for '@*/following::*' expressions. The resulting
- // iterator is initialised with the parent's first child, and this
- // can cause duplicates in the output if the parent has more than
- // one attribute that matches the left step.
- if (_path instanceof Step) {
- int type = ((Step)_path).getNodeType();
- if (type == DTM.ATTRIBUTE_NODE) return true;
- }
- }
-
- return false;
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-
- // Compile path iterator
- _path.translate(classGen, methodGen); // iterator on stack....
-
- translateStep(classGen, methodGen);
- }
-
- public void translateStep(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- // Backwards branches are prohibited if an uninitialized object is
- // on the stack by section 4.9.4 of the JVM Specification, 2nd Ed.
- // We don't know whether this code might contain backwards branches
- // so we mustn't create the new object until after we've created
- // the suspect arguments to its constructor. Instead we calculate
- // the values of the arguments to the constructor first, store them
- // in temporary variables, create the object and reload the
- // arguments from the temporaries to avoid the problem.
-
- LocalVariableGen pathTemp
- = methodGen.addLocalVariable("parent_location_path_tmp1",
- Util.getJCRefType(NODE_ITERATOR_SIG),
- null, null);
- pathTemp.setStart(il.append(new ASTORE(pathTemp.getIndex())));
-
- _step.translate(classGen, methodGen);
- LocalVariableGen stepTemp
- = methodGen.addLocalVariable("parent_location_path_tmp2",
- Util.getJCRefType(NODE_ITERATOR_SIG),
- null, null);
- stepTemp.setStart(il.append(new ASTORE(stepTemp.getIndex())));
-
- // Create new StepIterator
- final int initSI = cpg.addMethodref(STEP_ITERATOR_CLASS,
- "<init>",
- "("
- +NODE_ITERATOR_SIG
- +NODE_ITERATOR_SIG
- +")V");
- il.append(new NEW(cpg.addClass(STEP_ITERATOR_CLASS)));
- il.append(DUP);
-
- pathTemp.setEnd(il.append(new ALOAD(pathTemp.getIndex())));
- stepTemp.setEnd(il.append(new ALOAD(stepTemp.getIndex())));
-
- // Initialize StepIterator with iterators from the stack
- il.append(new INVOKESPECIAL(initSI));
-
- // This is a special case for the //* path with or without predicates
- Expression stp = _step;
- if (stp instanceof ParentLocationPath)
- stp = ((ParentLocationPath)stp).getStep();
-
- if ((_path instanceof Step) && (stp instanceof Step)) {
- final int path = ((Step)_path).getAxis();
- final int step = ((Step)stp).getAxis();
- if ((path == Axis.DESCENDANTORSELF && step == Axis.CHILD) ||
- (path == Axis.PRECEDING && step == Axis.PARENT)) {
- final int incl = cpg.addMethodref(NODE_ITERATOR_BASE,
- "includeSelf",
- "()" + NODE_ITERATOR_SIG);
- il.append(new INVOKEVIRTUAL(incl));
- }
- }
-
- /*
- * If this pattern contains a sequence of descendant iterators we
- * run the risk of returning the same node several times. We put
- * a new iterator on top of the existing one to assure node order
- * and prevent returning a single node multiple times.
- */
- if (_orderNodes) {
- final int order = cpg.addInterfaceMethodref(DOM_INTF,
- ORDER_ITERATOR,
- ORDER_ITERATOR_SIG);
- il.append(methodGen.loadDOM());
- il.append(SWAP);
- il.append(methodGen.loadContextNode());
- il.append(new INVOKEINTERFACE(order, 3));
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ParentPattern.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ParentPattern.java
deleted file mode 100644
index 26b01a2..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ParentPattern.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ParentPattern.java,v 1.2.4.1 2005/09/02 11:10:09 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.ILOAD;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.ISTORE;
-import com.sun.org.apache.bcel.internal.generic.InstructionHandle;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-final class ParentPattern extends RelativePathPattern {
- private final Pattern _left;
- private final RelativePathPattern _right;
-
- public ParentPattern(Pattern left, RelativePathPattern right) {
- (_left = left).setParent(this);
- (_right = right).setParent(this);
- }
-
- public void setParser(Parser parser) {
- super.setParser(parser);
- _left.setParser(parser);
- _right.setParser(parser);
- }
-
- public boolean isWildcard() {
- return false;
- }
-
- public StepPattern getKernelPattern() {
- return _right.getKernelPattern();
- }
-
- public void reduceKernelPattern() {
- _right.reduceKernelPattern();
- }
-
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- _left.typeCheck(stable);
- return _right.typeCheck(stable);
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- final LocalVariableGen local =
- methodGen.addLocalVariable2("ppt",
- Util.getJCRefType(NODE_SIG),
- null);
-
- final com.sun.org.apache.bcel.internal.generic.Instruction loadLocal =
- new ILOAD(local.getIndex());
- final com.sun.org.apache.bcel.internal.generic.Instruction storeLocal =
- new ISTORE(local.getIndex());
-
- if (_right.isWildcard()) {
- il.append(methodGen.loadDOM());
- il.append(SWAP);
- }
- else if (_right instanceof StepPattern) {
- il.append(DUP);
- local.setStart(il.append(storeLocal));
-
- _right.translate(classGen, methodGen);
-
- il.append(methodGen.loadDOM());
- local.setEnd(il.append(loadLocal));
- }
- else {
- _right.translate(classGen, methodGen);
-
- if (_right instanceof AncestorPattern) {
- il.append(methodGen.loadDOM());
- il.append(SWAP);
- }
- }
-
- final int getParent = cpg.addInterfaceMethodref(DOM_INTF,
- GET_PARENT,
- GET_PARENT_SIG);
- il.append(new INVOKEINTERFACE(getParent, 2));
-
- final SyntaxTreeNode p = getParent();
- if (p == null || p instanceof Instruction ||
- p instanceof TopLevelElement)
- {
- _left.translate(classGen, methodGen);
- }
- else {
- il.append(DUP);
- InstructionHandle storeInst = il.append(storeLocal);
-
- if (local.getStart() == null) {
- local.setStart(storeInst);
- }
-
- _left.translate(classGen, methodGen);
-
- il.append(methodGen.loadDOM());
- local.setEnd(il.append(loadLocal));
- }
-
- methodGen.removeLocalVariable(local);
-
- /*
- * If _right is an ancestor pattern, backpatch _left false
- * list to the loop that searches for more ancestors.
- */
- if (_right instanceof AncestorPattern) {
- final AncestorPattern ancestor = (AncestorPattern) _right;
- _left.backPatchFalseList(ancestor.getLoopHandle()); // clears list
- }
-
- _trueList.append(_right._trueList.append(_left._trueList));
- _falseList.append(_right._falseList.append(_left._falseList));
- }
-
- public String toString() {
- return "Parent(" + _left + ", " + _right + ')';
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Parser.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Parser.java
deleted file mode 100644
index 7088850..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Parser.java
+++ /dev/null
@@ -1,1449 +0,0 @@
-/*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.java_cup.internal.runtime.Symbol;
-import com.sun.org.apache.xalan.internal.XalanConstants;
-import com.sun.org.apache.xalan.internal.utils.FactoryImpl;
-import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
-import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
-import com.sun.org.apache.xalan.internal.utils.XMLSecurityManager;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xml.internal.serializer.utils.SystemIDResolver;
-import java.io.File;
-import java.io.IOException;
-import java.io.StringReader;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Stack;
-import java.util.StringTokenizer;
-import javax.xml.XMLConstants;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-import org.xml.sax.Attributes;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.helpers.AttributesImpl;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author G. Todd Miller
- * @author Morten Jorgensen
- * @author Erwin Bolwidt <ejb@klomp.org>
- */
-public class Parser implements Constants, ContentHandler {
-
- private static final String XSL = "xsl"; // standard prefix
- private static final String TRANSLET = "translet"; // extension prefix
-
- private Locator _locator = null;
-
- private XSLTC _xsltc; // Reference to the compiler object.
- private XPathParser _xpathParser; // Reference to the XPath parser.
- private ArrayList<ErrorMsg> _errors; // Contains all compilation errors
- private ArrayList<ErrorMsg> _warnings; // Contains all compilation warnings
-
- private Map<String, String> _instructionClasses; // Maps instructions to classes
- private Map<String, String[]> _instructionAttrs; // reqd and opt attrs
- private Map<String, QName> _qNames;
- private Map<String, Map<String, QName>> _namespaces;
- private QName _useAttributeSets;
- private QName _excludeResultPrefixes;
- private QName _extensionElementPrefixes;
- private Map<String, Object> _variableScope;
- private Stylesheet _currentStylesheet;
- private SymbolTable _symbolTable; // Maps QNames to syntax-tree nodes
- private Output _output;
- private Template _template; // Reference to the template being parsed.
-
- private boolean _rootNamespaceDef; // Used for validity check
-
- private SyntaxTreeNode _root;
-
- private String _target;
-
- private int _currentImportPrecedence;
-
- private boolean _useServicesMechanism = true;
-
- public Parser(XSLTC xsltc, boolean useServicesMechanism) {
- _xsltc = xsltc;
- _useServicesMechanism = useServicesMechanism;
- }
-
- public void init() {
- _qNames = new HashMap<>(512);
- _namespaces = new HashMap<>();
- _instructionClasses = new HashMap<>();
- _instructionAttrs = new HashMap<>();
- _variableScope = new HashMap<>();
- _template = null;
- _errors = new ArrayList<>();
- _warnings = new ArrayList<>();
- _symbolTable = new SymbolTable();
- _xpathParser = new XPathParser(this);
- _currentStylesheet = null;
- _output = null;
- _root = null;
- _rootNamespaceDef = false;
- _currentImportPrecedence = 1;
-
- initStdClasses();
- initInstructionAttrs();
- initExtClasses();
- initSymbolTable();
-
- _useAttributeSets =
- getQName(XSLT_URI, XSL, "use-attribute-sets");
- _excludeResultPrefixes =
- getQName(XSLT_URI, XSL, "exclude-result-prefixes");
- _extensionElementPrefixes =
- getQName(XSLT_URI, XSL, "extension-element-prefixes");
- }
-
- public void setOutput(Output output) {
- if (_output != null) {
- if (_output.getImportPrecedence() <= output.getImportPrecedence()) {
- output.mergeOutput(_output);
- _output.disable();
- _output = output;
- }
- else {
- output.disable();
- }
- }
- else {
- _output = output;
- }
- }
-
- public Output getOutput() {
- return _output;
- }
-
- public Properties getOutputProperties() {
- return getTopLevelStylesheet().getOutputProperties();
- }
-
- public void addVariable(Variable var) {
- addVariableOrParam(var);
- }
-
- public void addParameter(Param param) {
- addVariableOrParam(param);
- }
-
- private void addVariableOrParam(VariableBase var) {
- Object existing = _variableScope.get(var.getName().getStringRep());
- if (existing != null) {
- if (existing instanceof Stack) {
- @SuppressWarnings("unchecked")
- Stack<VariableBase> stack = (Stack<VariableBase>)existing;
- stack.push(var);
- }
- else if (existing instanceof VariableBase) {
- Stack<VariableBase> stack = new Stack<>();
- stack.push((VariableBase)existing);
- stack.push(var);
- _variableScope.put(var.getName().getStringRep(), stack);
- }
- }
- else {
- _variableScope.put(var.getName().getStringRep(), var);
- }
- }
-
- public void removeVariable(QName name) {
- Object existing = _variableScope.get(name.getStringRep());
- if (existing instanceof Stack) {
- @SuppressWarnings("unchecked")
- Stack<VariableBase> stack = (Stack<VariableBase>)existing;
- if (!stack.isEmpty()) stack.pop();
- if (!stack.isEmpty()) return;
- }
- _variableScope.remove(name.getStringRep());
- }
-
- public VariableBase lookupVariable(QName name) {
- Object existing = _variableScope.get(name.getStringRep());
- if (existing instanceof VariableBase) {
- return (VariableBase)existing;
- }
- else if (existing instanceof Stack) {
- @SuppressWarnings("unchecked")
- Stack<VariableBase> stack = (Stack<VariableBase>)existing;
- return stack.peek();
- }
- return null;
- }
-
- public void setXSLTC(XSLTC xsltc) {
- _xsltc = xsltc;
- }
-
- public XSLTC getXSLTC() {
- return _xsltc;
- }
-
- public int getCurrentImportPrecedence() {
- return _currentImportPrecedence;
- }
-
- public int getNextImportPrecedence() {
- return ++_currentImportPrecedence;
- }
-
- public void setCurrentStylesheet(Stylesheet stylesheet) {
- _currentStylesheet = stylesheet;
- }
-
- public Stylesheet getCurrentStylesheet() {
- return _currentStylesheet;
- }
-
- public Stylesheet getTopLevelStylesheet() {
- return _xsltc.getStylesheet();
- }
-
- public QName getQNameSafe(final String stringRep) {
- // parse and retrieve namespace
- final int colon = stringRep.lastIndexOf(':');
- if (colon != -1) {
- final String prefix = stringRep.substring(0, colon);
- final String localname = stringRep.substring(colon + 1);
- String namespace = null;
-
- // Get the namespace uri from the symbol table
- if (prefix.equals(XMLNS_PREFIX) == false) {
- namespace = _symbolTable.lookupNamespace(prefix);
- if (namespace == null) namespace = EMPTYSTRING;
- }
- return getQName(namespace, prefix, localname);
- }
- else {
- final String uri = stringRep.equals(XMLNS_PREFIX) ? null
- : _symbolTable.lookupNamespace(EMPTYSTRING);
- return getQName(uri, null, stringRep);
- }
- }
-
- public QName getQName(final String stringRep) {
- return getQName(stringRep, true, false);
- }
-
- public QName getQNameIgnoreDefaultNs(final String stringRep) {
- return getQName(stringRep, true, true);
- }
-
- public QName getQName(final String stringRep, boolean reportError) {
- return getQName(stringRep, reportError, false);
- }
-
- private QName getQName(final String stringRep, boolean reportError,
- boolean ignoreDefaultNs)
- {
- // parse and retrieve namespace
- final int colon = stringRep.lastIndexOf(':');
- if (colon != -1) {
- final String prefix = stringRep.substring(0, colon);
- final String localname = stringRep.substring(colon + 1);
- String namespace = null;
-
- // Get the namespace uri from the symbol table
- if (prefix.equals(XMLNS_PREFIX) == false) {
- namespace = _symbolTable.lookupNamespace(prefix);
- if (namespace == null && reportError) {
- final int line = getLineNumber();
- ErrorMsg err = new ErrorMsg(ErrorMsg.NAMESPACE_UNDEF_ERR,
- line, prefix);
- reportError(ERROR, err);
- }
- }
- return getQName(namespace, prefix, localname);
- }
- else {
- if (stringRep.equals(XMLNS_PREFIX)) {
- ignoreDefaultNs = true;
- }
- final String defURI = ignoreDefaultNs ? null
- : _symbolTable.lookupNamespace(EMPTYSTRING);
- return getQName(defURI, null, stringRep);
- }
- }
-
- public QName getQName(String namespace, String prefix, String localname) {
- if (namespace == null || namespace.equals(EMPTYSTRING)) {
- QName name = _qNames.get(localname);
- if (name == null) {
- name = new QName(null, prefix, localname);
- _qNames.put(localname, name);
- }
- return name;
- }
- else {
- Map<String, QName> space = _namespaces.get(namespace);
- String lexicalQName =
- (prefix == null || prefix.length() == 0)
- ? localname
- : (prefix + ':' + localname);
-
- if (space == null) {
- final QName name = new QName(namespace, prefix, localname);
- _namespaces.put(namespace, space = new HashMap<>());
- space.put(lexicalQName, name);
- return name;
- }
- else {
- QName name = space.get(lexicalQName);
- if (name == null) {
- name = new QName(namespace, prefix, localname);
- space.put(lexicalQName, name);
- }
- return name;
- }
- }
- }
-
- public QName getQName(String scope, String name) {
- return getQName(scope + name);
- }
-
- public QName getQName(QName scope, QName name) {
- return getQName(scope.toString() + name.toString());
- }
-
- public QName getUseAttributeSets() {
- return _useAttributeSets;
- }
-
- public QName getExtensionElementPrefixes() {
- return _extensionElementPrefixes;
- }
-
- public QName getExcludeResultPrefixes() {
- return _excludeResultPrefixes;
- }
-
- /**
- * Create an instance of the <code>Stylesheet</code> class,
- * and then parse, typecheck and compile the instance.
- * Must be called after <code>parse()</code>.
- */
- public Stylesheet makeStylesheet(SyntaxTreeNode element)
- throws CompilerException {
- try {
- Stylesheet stylesheet;
-
- if (element instanceof Stylesheet) {
- stylesheet = (Stylesheet)element;
- }
- else {
- stylesheet = new Stylesheet();
- stylesheet.setSimplified();
- stylesheet.addElement(element);
- stylesheet.setAttributes((AttributesImpl) element.getAttributes());
-
- // Map the default NS if not already defined
- if (element.lookupNamespace(EMPTYSTRING) == null) {
- element.addPrefixMapping(EMPTYSTRING, EMPTYSTRING);
- }
- }
- stylesheet.setParser(this);
- return stylesheet;
- }
- catch (ClassCastException e) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.NOT_STYLESHEET_ERR, element);
- throw new CompilerException(err.toString());
- }
- }
-
- /**
- * Instanciates a SAX2 parser and generate the AST from the input.
- */
- public void createAST(Stylesheet stylesheet) {
- try {
- if (stylesheet != null) {
- stylesheet.parseContents(this);
- final Iterator<SyntaxTreeNode> elements = stylesheet.elements();
- while (elements.hasNext()) {
- SyntaxTreeNode child = elements.next();
- if (child instanceof Text) {
- final int l = getLineNumber();
- ErrorMsg err =
- new ErrorMsg(ErrorMsg.ILLEGAL_TEXT_NODE_ERR,l,null);
- reportError(ERROR, err);
- }
- }
- if (!errorsFound()) {
- stylesheet.typeCheck(_symbolTable);
- }
- }
- }
- catch (TypeCheckError e) {
- reportError(ERROR, new ErrorMsg(ErrorMsg.JAXP_COMPILE_ERR, e));
- }
- }
-
- /**
- * Parses a stylesheet and builds the internal abstract syntax tree
- * @param reader A SAX2 SAXReader (parser)
- * @param input A SAX2 InputSource can be passed to a SAX reader
- * @return The root of the abstract syntax tree
- */
- public SyntaxTreeNode parse(XMLReader reader, InputSource input) {
- try {
- // Parse the input document and build the abstract syntax tree
- reader.setContentHandler(this);
- reader.parse(input);
- // Find the start of the stylesheet within the tree
- return (SyntaxTreeNode)getStylesheet(_root);
- }
- catch (IOException e) {
- if (_xsltc.debug()) e.printStackTrace();
- reportError(ERROR,new ErrorMsg(ErrorMsg.JAXP_COMPILE_ERR, e));
- }
- catch (SAXException e) {
- Throwable ex = e.getException();
- if (_xsltc.debug()) {
- e.printStackTrace();
- if (ex != null) ex.printStackTrace();
- }
- reportError(ERROR, new ErrorMsg(ErrorMsg.JAXP_COMPILE_ERR, e));
- }
- catch (CompilerException e) {
- if (_xsltc.debug()) e.printStackTrace();
- reportError(ERROR, new ErrorMsg(ErrorMsg.JAXP_COMPILE_ERR, e));
- }
- catch (Exception e) {
- if (_xsltc.debug()) e.printStackTrace();
- reportError(ERROR, new ErrorMsg(ErrorMsg.JAXP_COMPILE_ERR, e));
- }
- return null;
- }
-
- /**
- * Parses a stylesheet and builds the internal abstract syntax tree
- * @param input A SAX2 InputSource can be passed to a SAX reader
- * @return The root of the abstract syntax tree
- */
- public SyntaxTreeNode parse(InputSource input) {
- try {
- // Create a SAX parser and get the XMLReader object it uses
- final SAXParserFactory factory = FactoryImpl.getSAXFactory(_useServicesMechanism);
-
- if (_xsltc.isSecureProcessing()) {
- try {
- factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
- }
- catch (SAXException e) {}
- }
-
- try {
- factory.setFeature(Constants.NAMESPACE_FEATURE,true);
- }
- catch (Exception e) {
- factory.setNamespaceAware(true);
- }
- final SAXParser parser = factory.newSAXParser();
- try {
- parser.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD,
- _xsltc.getProperty(XMLConstants.ACCESS_EXTERNAL_DTD));
- } catch (SAXNotRecognizedException e) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.WARNING_MSG,
- parser.getClass().getName() + ": " + e.getMessage());
- reportError(WARNING, err);
- }
-
- final XMLReader reader = parser.getXMLReader();
- String lastProperty = "";
- try {
- XMLSecurityManager securityManager =
- (XMLSecurityManager)_xsltc.getProperty(XalanConstants.SECURITY_MANAGER);
- for (XMLSecurityManager.Limit limit : XMLSecurityManager.Limit.values()) {
- lastProperty = limit.apiProperty();
- reader.setProperty(lastProperty, securityManager.getLimitValueAsString(limit));
- }
- if (securityManager.printEntityCountInfo()) {
- lastProperty = XalanConstants.JDK_ENTITY_COUNT_INFO;
- parser.setProperty(XalanConstants.JDK_ENTITY_COUNT_INFO, XalanConstants.JDK_YES);
- }
- } catch (SAXException se) {
- XMLSecurityManager.printWarning(reader.getClass().getName(), lastProperty, se);
- }
-
- return(parse(reader, input));
- }
- catch (ParserConfigurationException e) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.SAX_PARSER_CONFIG_ERR);
- reportError(ERROR, err);
- }
- catch (SAXParseException e){
- reportError(ERROR, new ErrorMsg(e.getMessage(),e.getLineNumber()));
- }
- catch (SAXException e) {
- reportError(ERROR, new ErrorMsg(e.getMessage()));
- }
- return null;
- }
-
- public SyntaxTreeNode getDocumentRoot() {
- return _root;
- }
-
- private String _PImedia = null;
- private String _PItitle = null;
- private String _PIcharset = null;
-
- /**
- * Set the parameters to use to locate the correct <?xml-stylesheet ...?>
- * processing instruction in the case where the input document is an
- * XML document with one or more references to a stylesheet.
- * @param media The media attribute to be matched. May be null, in which
- * case the prefered templates will be used (i.e. alternate = no).
- * @param title The value of the title attribute to match. May be null.
- * @param charset The value of the charset attribute to match. May be null.
- */
- protected void setPIParameters(String media, String title, String charset) {
- _PImedia = media;
- _PItitle = title;
- _PIcharset = charset;
- }
-
- /**
- * Extracts the DOM for the stylesheet. In the case of an embedded
- * stylesheet, it extracts the DOM subtree corresponding to the
- * embedded stylesheet that has an 'id' attribute whose value is the
- * same as the value declared in the <?xml-stylesheet...?> processing
- * instruction (P.I.). In the xml-stylesheet P.I. the value is labeled
- * as the 'href' data of the P.I. The extracted DOM representing the
- * stylesheet is returned as an Element object.
- */
- private SyntaxTreeNode getStylesheet(SyntaxTreeNode root)
- throws CompilerException {
-
- // Assume that this is a pure XSL stylesheet if there is not
- // <?xml-stylesheet ....?> processing instruction
- if (_target == null) {
- if (!_rootNamespaceDef) {
- ErrorMsg msg = new ErrorMsg(ErrorMsg.MISSING_XSLT_URI_ERR);
- throw new CompilerException(msg.toString());
- }
- return(root);
- }
-
- // Find the xsl:stylesheet or xsl:transform with this reference
- if (_target.charAt(0) == '#') {
- SyntaxTreeNode element = findStylesheet(root, _target.substring(1));
- if (element == null) {
- ErrorMsg msg = new ErrorMsg(ErrorMsg.MISSING_XSLT_TARGET_ERR,
- _target, root);
- throw new CompilerException(msg.toString());
- }
- return(element);
- }
- else {
- try {
- String path = _target;
- if (path.indexOf(":")==-1) {
- path = "file:" + path;
- }
- path = SystemIDResolver.getAbsoluteURI(path);
- String accessError = SecuritySupport.checkAccess(path,
- (String)_xsltc.getProperty(XMLConstants.ACCESS_EXTERNAL_STYLESHEET),
- XalanConstants.ACCESS_EXTERNAL_ALL);
- if (accessError != null) {
- ErrorMsg msg = new ErrorMsg(ErrorMsg.ACCESSING_XSLT_TARGET_ERR,
- SecuritySupport.sanitizePath(_target), accessError,
- root);
- throw new CompilerException(msg.toString());
- }
- } catch (IOException ex) {
- throw new CompilerException(ex);
- }
-
- return(loadExternalStylesheet(_target));
- }
- }
-
- /**
- * Find a Stylesheet element with a specific ID attribute value.
- * This method is used to find a Stylesheet node that is referred
- * in a <?xml-stylesheet ... ?> processing instruction.
- */
- private SyntaxTreeNode findStylesheet(SyntaxTreeNode root, String href) {
-
- if (root == null) return null;
-
- if (root instanceof Stylesheet) {
- String id = root.getAttribute("id");
- if (id.equals(href)) return root;
- }
- List<SyntaxTreeNode> children = root.getContents();
- if (children != null) {
- final int count = children.size();
- for (int i = 0; i < count; i++) {
- SyntaxTreeNode child = children.get(i);
- SyntaxTreeNode node = findStylesheet(child, href);
- if (node != null) return node;
- }
- }
- return null;
- }
-
- /**
- * For embedded stylesheets: Load an external file with stylesheet
- */
- private SyntaxTreeNode loadExternalStylesheet(String location)
- throws CompilerException {
-
- InputSource source;
-
- // Check if the location is URL or a local file
- if ((new File(location)).exists())
- source = new InputSource("file:"+location);
- else
- source = new InputSource(location);
-
- SyntaxTreeNode external = (SyntaxTreeNode)parse(source);
- return(external);
- }
-
- private void initAttrTable(String elementName, String[] attrs) {
- _instructionAttrs.put(getQName(XSLT_URI, XSL, elementName).getStringRep(),
- attrs);
- }
-
- private void initInstructionAttrs() {
- initAttrTable("template",
- new String[] {"match", "name", "priority", "mode"});
- initAttrTable("stylesheet",
- new String[] {"id", "version", "extension-element-prefixes",
- "exclude-result-prefixes"});
- initAttrTable("transform",
- new String[] {"id", "version", "extension-element-prefixes",
- "exclude-result-prefixes"});
- initAttrTable("text", new String[] {"disable-output-escaping"});
- initAttrTable("if", new String[] {"test"});
- initAttrTable("choose", new String[] {});
- initAttrTable("when", new String[] {"test"});
- initAttrTable("otherwise", new String[] {});
- initAttrTable("for-each", new String[] {"select"});
- initAttrTable("message", new String[] {"terminate"});
- initAttrTable("number",
- new String[] {"level", "count", "from", "value", "format", "lang",
- "letter-value", "grouping-separator", "grouping-size"});
- initAttrTable("comment", new String[] {});
- initAttrTable("copy", new String[] {"use-attribute-sets"});
- initAttrTable("copy-of", new String[] {"select"});
- initAttrTable("param", new String[] {"name", "select"});
- initAttrTable("with-param", new String[] {"name", "select"});
- initAttrTable("variable", new String[] {"name", "select"});
- initAttrTable("output",
- new String[] {"method", "version", "encoding",
- "omit-xml-declaration", "standalone", "doctype-public",
- "doctype-system", "cdata-section-elements", "indent",
- "media-type"});
- initAttrTable("sort",
- new String[] {"select", "order", "case-order", "lang", "data-type"});
- initAttrTable("key", new String[] {"name", "match", "use"});
- initAttrTable("fallback", new String[] {});
- initAttrTable("attribute", new String[] {"name", "namespace"});
- initAttrTable("attribute-set",
- new String[] {"name", "use-attribute-sets"});
- initAttrTable("value-of",
- new String[] {"select", "disable-output-escaping"});
- initAttrTable("element",
- new String[] {"name", "namespace", "use-attribute-sets"});
- initAttrTable("call-template", new String[] {"name"});
- initAttrTable("apply-templates", new String[] {"select", "mode"});
- initAttrTable("apply-imports", new String[] {});
- initAttrTable("decimal-format",
- new String[] {"name", "decimal-separator", "grouping-separator",
- "infinity", "minus-sign", "NaN", "percent", "per-mille",
- "zero-digit", "digit", "pattern-separator"});
- initAttrTable("import", new String[] {"href"});
- initAttrTable("include", new String[] {"href"});
- initAttrTable("strip-space", new String[] {"elements"});
- initAttrTable("preserve-space", new String[] {"elements"});
- initAttrTable("processing-instruction", new String[] {"name"});
- initAttrTable("namespace-alias",
- new String[] {"stylesheet-prefix", "result-prefix"});
- }
-
- /**
- * Initialize the _instructionClasses map, which maps XSL element
- * names to Java classes in this package.
- */
- private void initStdClasses() {
- initStdClass("template", "Template");
- initStdClass("stylesheet", "Stylesheet");
- initStdClass("transform", "Stylesheet");
- initStdClass("text", "Text");
- initStdClass("if", "If");
- initStdClass("choose", "Choose");
- initStdClass("when", "When");
- initStdClass("otherwise", "Otherwise");
- initStdClass("for-each", "ForEach");
- initStdClass("message", "Message");
- initStdClass("number", "Number");
- initStdClass("comment", "Comment");
- initStdClass("copy", "Copy");
- initStdClass("copy-of", "CopyOf");
- initStdClass("param", "Param");
- initStdClass("with-param", "WithParam");
- initStdClass("variable", "Variable");
- initStdClass("output", "Output");
- initStdClass("sort", "Sort");
- initStdClass("key", "Key");
- initStdClass("fallback", "Fallback");
- initStdClass("attribute", "XslAttribute");
- initStdClass("attribute-set", "AttributeSet");
- initStdClass("value-of", "ValueOf");
- initStdClass("element", "XslElement");
- initStdClass("call-template", "CallTemplate");
- initStdClass("apply-templates", "ApplyTemplates");
- initStdClass("apply-imports", "ApplyImports");
- initStdClass("decimal-format", "DecimalFormatting");
- initStdClass("import", "Import");
- initStdClass("include", "Include");
- initStdClass("strip-space", "Whitespace");
- initStdClass("preserve-space", "Whitespace");
- initStdClass("processing-instruction", "ProcessingInstruction");
- initStdClass("namespace-alias", "NamespaceAlias");
- }
-
- private void initStdClass(String elementName, String className) {
- _instructionClasses.put(getQName(XSLT_URI, XSL, elementName).getStringRep(),
- COMPILER_PACKAGE + '.' + className);
- }
-
- public boolean elementSupported(String namespace, String localName) {
- return(_instructionClasses.get(getQName(namespace, XSL, localName).getStringRep()) != null);
- }
-
- public boolean functionSupported(String fname) {
- return(_symbolTable.lookupPrimop(fname) != null);
- }
-
- private void initExtClasses() {
- initExtClass("output", "TransletOutput");
- initExtClass(REDIRECT_URI, "write", "TransletOutput");
- }
-
- private void initExtClass(String elementName, String className) {
- _instructionClasses.put(getQName(TRANSLET_URI, TRANSLET, elementName).getStringRep(),
- COMPILER_PACKAGE + '.' + className);
- }
-
- private void initExtClass(String namespace, String elementName, String className) {
- _instructionClasses.put(getQName(namespace, TRANSLET, elementName).getStringRep(),
- COMPILER_PACKAGE + '.' + className);
- }
-
- /**
- * Add primops and base functions to the symbol table.
- */
- @SuppressWarnings("unused")
- private void initSymbolTable() {
- MethodType I_V = new MethodType(Type.Int, Type.Void);
- MethodType I_R = new MethodType(Type.Int, Type.Real);
- MethodType I_S = new MethodType(Type.Int, Type.String);
- MethodType I_D = new MethodType(Type.Int, Type.NodeSet);
- MethodType R_I = new MethodType(Type.Real, Type.Int);
- MethodType R_V = new MethodType(Type.Real, Type.Void);
- MethodType R_R = new MethodType(Type.Real, Type.Real);
- MethodType R_D = new MethodType(Type.Real, Type.NodeSet);
- MethodType R_O = new MethodType(Type.Real, Type.Reference);
- MethodType I_I = new MethodType(Type.Int, Type.Int);
- MethodType D_O = new MethodType(Type.NodeSet, Type.Reference);
- MethodType D_V = new MethodType(Type.NodeSet, Type.Void);
- MethodType D_S = new MethodType(Type.NodeSet, Type.String);
- MethodType D_D = new MethodType(Type.NodeSet, Type.NodeSet);
- MethodType A_V = new MethodType(Type.Node, Type.Void);
- MethodType S_V = new MethodType(Type.String, Type.Void);
- MethodType S_S = new MethodType(Type.String, Type.String);
- MethodType S_A = new MethodType(Type.String, Type.Node);
- MethodType S_D = new MethodType(Type.String, Type.NodeSet);
- MethodType S_O = new MethodType(Type.String, Type.Reference);
- MethodType B_O = new MethodType(Type.Boolean, Type.Reference);
- MethodType B_V = new MethodType(Type.Boolean, Type.Void);
- MethodType B_B = new MethodType(Type.Boolean, Type.Boolean);
- MethodType B_S = new MethodType(Type.Boolean, Type.String);
- MethodType D_X = new MethodType(Type.NodeSet, Type.Object);
- MethodType R_RR = new MethodType(Type.Real, Type.Real, Type.Real);
- MethodType I_II = new MethodType(Type.Int, Type.Int, Type.Int);
- MethodType B_RR = new MethodType(Type.Boolean, Type.Real, Type.Real);
- MethodType B_II = new MethodType(Type.Boolean, Type.Int, Type.Int);
- MethodType S_SS = new MethodType(Type.String, Type.String, Type.String);
- MethodType S_DS = new MethodType(Type.String, Type.Real, Type.String);
- MethodType S_SR = new MethodType(Type.String, Type.String, Type.Real);
- MethodType O_SO = new MethodType(Type.Reference, Type.String, Type.Reference);
-
- MethodType D_SS =
- new MethodType(Type.NodeSet, Type.String, Type.String);
- MethodType D_SD =
- new MethodType(Type.NodeSet, Type.String, Type.NodeSet);
- MethodType B_BB =
- new MethodType(Type.Boolean, Type.Boolean, Type.Boolean);
- MethodType B_SS =
- new MethodType(Type.Boolean, Type.String, Type.String);
- MethodType S_SD =
- new MethodType(Type.String, Type.String, Type.NodeSet);
- MethodType S_DSS =
- new MethodType(Type.String, Type.Real, Type.String, Type.String);
- MethodType S_SRR =
- new MethodType(Type.String, Type.String, Type.Real, Type.Real);
- MethodType S_SSS =
- new MethodType(Type.String, Type.String, Type.String, Type.String);
-
- /*
- * Standard functions: implemented but not in this table concat().
- * When adding a new function make sure to uncomment
- * the corresponding line in <tt>FunctionAvailableCall</tt>.
- */
-
- // The following functions are inlined
-
- _symbolTable.addPrimop("current", A_V);
- _symbolTable.addPrimop("last", I_V);
- _symbolTable.addPrimop("position", I_V);
- _symbolTable.addPrimop("true", B_V);
- _symbolTable.addPrimop("false", B_V);
- _symbolTable.addPrimop("not", B_B);
- _symbolTable.addPrimop("name", S_V);
- _symbolTable.addPrimop("name", S_A);
- _symbolTable.addPrimop("generate-id", S_V);
- _symbolTable.addPrimop("generate-id", S_A);
- _symbolTable.addPrimop("ceiling", R_R);
- _symbolTable.addPrimop("floor", R_R);
- _symbolTable.addPrimop("round", R_R);
- _symbolTable.addPrimop("contains", B_SS);
- _symbolTable.addPrimop("number", R_O);
- _symbolTable.addPrimop("number", R_V);
- _symbolTable.addPrimop("boolean", B_O);
- _symbolTable.addPrimop("string", S_O);
- _symbolTable.addPrimop("string", S_V);
- _symbolTable.addPrimop("translate", S_SSS);
- _symbolTable.addPrimop("string-length", I_V);
- _symbolTable.addPrimop("string-length", I_S);
- _symbolTable.addPrimop("starts-with", B_SS);
- _symbolTable.addPrimop("format-number", S_DS);
- _symbolTable.addPrimop("format-number", S_DSS);
- _symbolTable.addPrimop("unparsed-entity-uri", S_S);
- _symbolTable.addPrimop("key", D_SS);
- _symbolTable.addPrimop("key", D_SD);
- _symbolTable.addPrimop("id", D_S);
- _symbolTable.addPrimop("id", D_D);
- _symbolTable.addPrimop("namespace-uri", S_V);
- _symbolTable.addPrimop("function-available", B_S);
- _symbolTable.addPrimop("element-available", B_S);
- _symbolTable.addPrimop("document", D_S);
- _symbolTable.addPrimop("document", D_V);
-
- // The following functions are implemented in the basis library
- _symbolTable.addPrimop("count", I_D);
- _symbolTable.addPrimop("sum", R_D);
- _symbolTable.addPrimop("local-name", S_V);
- _symbolTable.addPrimop("local-name", S_D);
- _symbolTable.addPrimop("namespace-uri", S_V);
- _symbolTable.addPrimop("namespace-uri", S_D);
- _symbolTable.addPrimop("substring", S_SR);
- _symbolTable.addPrimop("substring", S_SRR);
- _symbolTable.addPrimop("substring-after", S_SS);
- _symbolTable.addPrimop("substring-before", S_SS);
- _symbolTable.addPrimop("normalize-space", S_V);
- _symbolTable.addPrimop("normalize-space", S_S);
- _symbolTable.addPrimop("system-property", S_S);
-
- // Extensions
- _symbolTable.addPrimop("nodeset", D_O);
- _symbolTable.addPrimop("objectType", S_O);
- _symbolTable.addPrimop("cast", O_SO);
-
- // Operators +, -, *, /, % defined on real types.
- _symbolTable.addPrimop("+", R_RR);
- _symbolTable.addPrimop("-", R_RR);
- _symbolTable.addPrimop("*", R_RR);
- _symbolTable.addPrimop("/", R_RR);
- _symbolTable.addPrimop("%", R_RR);
-
- // Operators +, -, * defined on integer types.
- // Operators / and % are not defined on integers (may cause exception)
- _symbolTable.addPrimop("+", I_II);
- _symbolTable.addPrimop("-", I_II);
- _symbolTable.addPrimop("*", I_II);
-
- // Operators <, <= >, >= defined on real types.
- _symbolTable.addPrimop("<", B_RR);
- _symbolTable.addPrimop("<=", B_RR);
- _symbolTable.addPrimop(">", B_RR);
- _symbolTable.addPrimop(">=", B_RR);
-
- // Operators <, <= >, >= defined on int types.
- _symbolTable.addPrimop("<", B_II);
- _symbolTable.addPrimop("<=", B_II);
- _symbolTable.addPrimop(">", B_II);
- _symbolTable.addPrimop(">=", B_II);
-
- // Operators <, <= >, >= defined on boolean types.
- _symbolTable.addPrimop("<", B_BB);
- _symbolTable.addPrimop("<=", B_BB);
- _symbolTable.addPrimop(">", B_BB);
- _symbolTable.addPrimop(">=", B_BB);
-
- // Operators 'and' and 'or'.
- _symbolTable.addPrimop("or", B_BB);
- _symbolTable.addPrimop("and", B_BB);
-
- // Unary minus.
- _symbolTable.addPrimop("u-", R_R);
- _symbolTable.addPrimop("u-", I_I);
- }
-
- public SymbolTable getSymbolTable() {
- return _symbolTable;
- }
-
- public Template getTemplate() {
- return _template;
- }
-
- public void setTemplate(Template template) {
- _template = template;
- }
-
- private int _templateIndex = 0;
-
- public int getTemplateIndex() {
- return(_templateIndex++);
- }
-
- /**
- * Creates a new node in the abstract syntax tree. This node can be
- * o) a supported XSLT 1.0 element
- * o) an unsupported XSLT element (post 1.0)
- * o) a supported XSLT extension
- * o) an unsupported XSLT extension
- * o) a literal result element (not an XSLT element and not an extension)
- * Unsupported elements do not directly generate an error. We have to wait
- * until we have received all child elements of an unsupported element to
- * see if any <xsl:fallback> elements exist.
- */
-
- private boolean versionIsOne = true;
-
- public SyntaxTreeNode makeInstance(String uri, String prefix,
- String local, Attributes attributes)
- {
- SyntaxTreeNode node = null;
- QName qname = getQName(uri, prefix, local);
- String className = _instructionClasses.get(qname.getStringRep());
-
- if (className != null) {
- try {
- final Class<?> clazz = ObjectFactory.findProviderClass(className, true);
- node = (SyntaxTreeNode)clazz.newInstance();
- node.setQName(qname);
- node.setParser(this);
- if (_locator != null) {
- node.setLineNumber(getLineNumber());
- }
- if (node instanceof Stylesheet) {
- _xsltc.setStylesheet((Stylesheet)node);
- }
- checkForSuperfluousAttributes(node, attributes);
- }
- catch (ClassNotFoundException e) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, node);
- reportError(ERROR, err);
- }
- catch (Exception e) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.INTERNAL_ERR,
- e.getMessage(), node);
- reportError(FATAL, err);
- }
- }
- else {
- if (uri != null) {
- // Check if the element belongs in our namespace
- if (uri.equals(XSLT_URI)) {
- node = new UnsupportedElement(uri, prefix, local, false);
- UnsupportedElement element = (UnsupportedElement)node;
- ErrorMsg msg = new ErrorMsg(ErrorMsg.UNSUPPORTED_XSL_ERR,
- getLineNumber(),local);
- element.setErrorMessage(msg);
- if (versionIsOne) {
- reportError(UNSUPPORTED,msg);
- }
- }
- // Check if this is an XSLTC extension element
- else if (uri.equals(TRANSLET_URI)) {
- node = new UnsupportedElement(uri, prefix, local, true);
- UnsupportedElement element = (UnsupportedElement)node;
- ErrorMsg msg = new ErrorMsg(ErrorMsg.UNSUPPORTED_EXT_ERR,
- getLineNumber(),local);
- element.setErrorMessage(msg);
- }
- // Check if this is an extension of some other XSLT processor
- else {
- Stylesheet sheet = _xsltc.getStylesheet();
- if ((sheet != null) && (sheet.isExtension(uri))) {
- if (sheet != _parentStack.peek()) {
- node = new UnsupportedElement(uri, prefix, local, true);
- UnsupportedElement elem = (UnsupportedElement)node;
- ErrorMsg msg =
- new ErrorMsg(ErrorMsg.UNSUPPORTED_EXT_ERR,
- getLineNumber(),
- prefix+":"+local);
- elem.setErrorMessage(msg);
- }
- }
- }
- }
- if (node == null) {
- node = new LiteralElement();
- node.setLineNumber(getLineNumber());
- }
- }
- if ((node != null) && (node instanceof LiteralElement)) {
- ((LiteralElement)node).setQName(qname);
- }
- return(node);
- }
-
- /**
- * checks the list of attributes against a list of allowed attributes
- * for a particular element node.
- */
- private void checkForSuperfluousAttributes(SyntaxTreeNode node,
- Attributes attrs)
- {
- QName qname = node.getQName();
- boolean isStylesheet = (node instanceof Stylesheet);
- String[] legal = _instructionAttrs.get(qname.getStringRep());
- if (versionIsOne && legal != null) {
- int j;
- final int n = attrs.getLength();
-
- for (int i = 0; i < n; i++) {
- final String attrQName = attrs.getQName(i);
-
- if (isStylesheet && attrQName.equals("version")) {
- versionIsOne = attrs.getValue(i).equals("1.0");
- }
-
- // Ignore if special or if it has a prefix
- if (attrQName.startsWith("xml") ||
- attrQName.indexOf(':') > 0) continue;
-
- for (j = 0; j < legal.length; j++) {
- if (attrQName.equalsIgnoreCase(legal[j])) {
- break;
- }
- }
- if (j == legal.length) {
- final ErrorMsg err =
- new ErrorMsg(ErrorMsg.ILLEGAL_ATTRIBUTE_ERR,
- attrQName, node);
- // Workaround for the TCK failure ErrorListener.errorTests.error001..
- err.setWarningError(true);
- reportError(WARNING, err);
- }
- }
- }
- }
-
-
- /**
- * Parse an XPath expression:
- * @param parent - XSL element where the expression occured
- * @param exp - textual representation of the expression
- */
- public Expression parseExpression(SyntaxTreeNode parent, String exp) {
- return (Expression)parseTopLevel(parent, "<EXPRESSION>"+exp, null);
- }
-
- /**
- * Parse an XPath expression:
- * @param parent - XSL element where the expression occured
- * @param attr - name of this element's attribute to get expression from
- * @param def - default expression (if the attribute was not found)
- */
- public Expression parseExpression(SyntaxTreeNode parent,
- String attr, String def) {
- // Get the textual representation of the expression (if any)
- String exp = parent.getAttribute(attr);
- // Use the default expression if none was found
- if ((exp.length() == 0) && (def != null)) exp = def;
- // Invoke the XPath parser
- return (Expression)parseTopLevel(parent, "<EXPRESSION>"+exp, exp);
- }
-
- /**
- * Parse an XPath pattern:
- * @param parent - XSL element where the pattern occured
- * @param pattern - textual representation of the pattern
- */
- public Pattern parsePattern(SyntaxTreeNode parent, String pattern) {
- return (Pattern)parseTopLevel(parent, "<PATTERN>"+pattern, pattern);
- }
-
- /**
- * Parse an XPath pattern:
- * @param parent - XSL element where the pattern occured
- * @param attr - name of this element's attribute to get pattern from
- * @param def - default pattern (if the attribute was not found)
- */
- public Pattern parsePattern(SyntaxTreeNode parent,
- String attr, String def) {
- // Get the textual representation of the pattern (if any)
- String pattern = parent.getAttribute(attr);
- // Use the default pattern if none was found
- if ((pattern.length() == 0) && (def != null)) pattern = def;
- // Invoke the XPath parser
- return (Pattern)parseTopLevel(parent, "<PATTERN>"+pattern, pattern);
- }
-
- /**
- * Parse an XPath expression or pattern using the generated XPathParser
- * The method will return a Dummy node if the XPath parser fails.
- */
- private SyntaxTreeNode parseTopLevel(SyntaxTreeNode parent, String text,
- String expression) {
- int line = getLineNumber();
-
- try {
- _xpathParser.setScanner(new XPathLexer(new StringReader(text)));
- Symbol result = _xpathParser.parse(expression, line);
- if (result != null) {
- final SyntaxTreeNode node = (SyntaxTreeNode)result.value;
- if (node != null) {
- node.setParser(this);
- node.setParent(parent);
- node.setLineNumber(line);
- return node;
- }
- }
- reportError(ERROR, new ErrorMsg(ErrorMsg.XPATH_PARSER_ERR,
- expression, parent));
- }
- catch (Exception e) {
- if (_xsltc.debug()) e.printStackTrace();
- reportError(ERROR, new ErrorMsg(ErrorMsg.XPATH_PARSER_ERR,
- expression, parent));
- }
-
- // Return a dummy pattern (which is an expression)
- SyntaxTreeNode.Dummy.setParser(this);
- return SyntaxTreeNode.Dummy;
- }
-
- /************************ ERROR HANDLING SECTION ************************/
-
- /**
- * Returns true if there were any errors during compilation
- */
- public boolean errorsFound() {
- return _errors.size() > 0;
- }
-
- /**
- * Prints all compile-time errors
- */
- public void printErrors() {
- final int size = _errors.size();
- if (size > 0) {
- System.err.println(new ErrorMsg(ErrorMsg.COMPILER_ERROR_KEY));
- for (int i = 0; i < size; i++) {
- System.err.println(" " + _errors.get(i));
- }
- }
- }
-
- /**
- * Prints all compile-time warnings
- */
- public void printWarnings() {
- final int size = _warnings.size();
- if (size > 0) {
- System.err.println(new ErrorMsg(ErrorMsg.COMPILER_WARNING_KEY));
- for (int i = 0; i < size; i++) {
- System.err.println(" " + _warnings.get(i));
- }
- }
- }
-
- /**
- * Common error/warning message handler
- */
- public void reportError(final int category, final ErrorMsg error) {
- switch (category) {
- case Constants.INTERNAL:
- // Unexpected internal errors, such as null-ptr exceptions, etc.
- // Immediately terminates compilation, no translet produced
- _errors.add(error);
- break;
- case Constants.UNSUPPORTED:
- // XSLT elements that are not implemented and unsupported ext.
- // Immediately terminates compilation, no translet produced
- _errors.add(error);
- break;
- case Constants.FATAL:
- // Fatal error in the stylesheet input (parsing or content)
- // Immediately terminates compilation, no translet produced
- _errors.add(error);
- break;
- case Constants.ERROR:
- // Other error in the stylesheet input (parsing or content)
- // Does not terminate compilation, no translet produced
- _errors.add(error);
- break;
- case Constants.WARNING:
- // Other error in the stylesheet input (content errors only)
- // Does not terminate compilation, a translet is produced
- _warnings.add(error);
- break;
- }
- }
-
- public ArrayList<ErrorMsg> getErrors() {
- return _errors;
- }
-
- public ArrayList<ErrorMsg> getWarnings() {
- return _warnings;
- }
-
- /************************ SAX2 ContentHandler INTERFACE *****************/
-
- private Stack<SyntaxTreeNode> _parentStack = null;
- private Map<String, String> _prefixMapping = null;
-
- /**
- * SAX2: Receive notification of the beginning of a document.
- */
- public void startDocument() {
- _root = null;
- _target = null;
- _prefixMapping = null;
- _parentStack = new Stack<>();
- }
-
- /**
- * SAX2: Receive notification of the end of a document.
- */
- public void endDocument() { }
-
-
- /**
- * SAX2: Begin the scope of a prefix-URI Namespace mapping.
- * This has to be passed on to the symbol table!
- */
- public void startPrefixMapping(String prefix, String uri) {
- if (_prefixMapping == null) {
- _prefixMapping = new HashMap<>();
- }
- _prefixMapping.put(prefix, uri);
- }
-
- /**
- * SAX2: End the scope of a prefix-URI Namespace mapping.
- * This has to be passed on to the symbol table!
- */
- public void endPrefixMapping(String prefix) { }
-
- /**
- * SAX2: Receive notification of the beginning of an element.
- * The parser may re-use the attribute list that we're passed so
- * we clone the attributes in our own Attributes implementation
- */
- public void startElement(String uri, String localname,
- String qname, Attributes attributes)
- throws SAXException {
- final int col = qname.lastIndexOf(':');
- final String prefix = (col == -1) ? null : qname.substring(0, col);
-
- SyntaxTreeNode element = makeInstance(uri, prefix,
- localname, attributes);
- if (element == null) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.ELEMENT_PARSE_ERR,
- prefix+':'+localname);
- throw new SAXException(err.toString());
- }
-
- // If this is the root element of the XML document we need to make sure
- // that it contains a definition of the XSL namespace URI
- if (_root == null) {
- if ((_prefixMapping == null) ||
- (_prefixMapping.containsValue(Constants.XSLT_URI) == false))
- _rootNamespaceDef = false;
- else
- _rootNamespaceDef = true;
- _root = element;
- }
- else {
- SyntaxTreeNode parent = _parentStack.peek();
- parent.addElement(element);
- element.setParent(parent);
- }
- element.setAttributes(new AttributesImpl(attributes));
- element.setPrefixMapping(_prefixMapping);
-
- if (element instanceof Stylesheet) {
- // Extension elements and excluded elements have to be
- // handled at this point in order to correctly generate
- // Fallback elements from <xsl:fallback>s.
- getSymbolTable().setCurrentNode(element);
- ((Stylesheet)element).declareExtensionPrefixes(this);
- }
-
- _prefixMapping = null;
- _parentStack.push(element);
- }
-
- /**
- * SAX2: Receive notification of the end of an element.
- */
- public void endElement(String uri, String localname, String qname) {
- _parentStack.pop();
- }
-
- /**
- * SAX2: Receive notification of character data.
- */
- public void characters(char[] ch, int start, int length) {
- String string = new String(ch, start, length);
- SyntaxTreeNode parent = _parentStack.peek();
-
- if (string.length() == 0) return;
-
- // If this text occurs within an <xsl:text> element we append it
- // as-is to the existing text element
- if (parent instanceof Text) {
- ((Text)parent).setText(string);
- return;
- }
-
- // Ignore text nodes that occur directly under <xsl:stylesheet>
- if (parent instanceof Stylesheet) return;
-
- SyntaxTreeNode bro = parent.lastChild();
- if ((bro != null) && (bro instanceof Text)) {
- Text text = (Text)bro;
- if (!text.isTextElement()) {
- if ((length > 1) || ( ((int)ch[0]) < 0x100)) {
- text.setText(string);
- return;
- }
- }
- }
-
- // Add it as a regular text node otherwise
- parent.addElement(new Text(string));
- }
-
- private String getTokenValue(String token) {
- final int start = token.indexOf('"');
- final int stop = token.lastIndexOf('"');
- return token.substring(start+1, stop);
- }
-
- /**
- * SAX2: Receive notification of a processing instruction.
- * These require special handling for stylesheet PIs.
- */
- public void processingInstruction(String name, String value) {
- // We only handle the <?xml-stylesheet ...?> PI
- if ((_target == null) && (name.equals("xml-stylesheet"))) {
-
- String href = null; // URI of stylesheet found
- String media = null; // Media of stylesheet found
- String title = null; // Title of stylesheet found
- String charset = null; // Charset of stylesheet found
-
- // Get the attributes from the processing instruction
- StringTokenizer tokens = new StringTokenizer(value);
- while (tokens.hasMoreElements()) {
- String token = (String)tokens.nextElement();
- if (token.startsWith("href"))
- href = getTokenValue(token);
- else if (token.startsWith("media"))
- media = getTokenValue(token);
- else if (token.startsWith("title"))
- title = getTokenValue(token);
- else if (token.startsWith("charset"))
- charset = getTokenValue(token);
- }
-
- // Set the target to this PI's href if the parameters are
- // null or match the corresponding attributes of this PI.
- if ( ((_PImedia == null) || (_PImedia.equals(media))) &&
- ((_PItitle == null) || (_PImedia.equals(title))) &&
- ((_PIcharset == null) || (_PImedia.equals(charset))) ) {
- _target = href;
- }
- }
- }
-
- /**
- * IGNORED - all ignorable whitespace is ignored
- */
- public void ignorableWhitespace(char[] ch, int start, int length) { }
-
- /**
- * IGNORED - we do not have to do anything with skipped entities
- */
- public void skippedEntity(String name) { }
-
- /**
- * Store the document locator to later retrieve line numbers of all
- * elements from the stylesheet
- */
- public void setDocumentLocator(Locator locator) {
- _locator = locator;
- }
-
- /**
- * Get the line number, or zero
- * if there is no _locator.
- */
- private int getLineNumber() {
- int line = 0;
- if (_locator != null)
- line = _locator.getLineNumber();
- return line;
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Pattern.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Pattern.java
deleted file mode 100644
index 79b2e0e..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Pattern.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Pattern.java,v 1.2.4.1 2005/09/12 11:00:31 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-public abstract class Pattern extends Expression {
- /**
- * Returns the type of a pattern, which is always a <code>NodeType</code>.
- * A <code>NodeType</code> has a number of subtypes defined by
- * <code>NodeType._type</code> corresponding to each type of node.
- */
- public abstract Type typeCheck(SymbolTable stable) throws TypeCheckError;
-
- /**
- * Translate this node into JVM bytecodes. Patterns are translated as
- * boolean expressions with true/false lists. Before calling
- * <code>translate</code> on a pattern, make sure that the node being
- * matched is on top of the stack. After calling <code>translate</code>,
- * make sure to backpatch both true and false lists. True lists are the
- * default, in the sense that they always <em>"fall through"</em>. If this
- * is not the intended semantics (e.g., see
- * {@link com.sun.org.apache.xalan.internal.xsltc.compiler.AlternativePattern#translate})
- * then a GOTO must be appended to the instruction list after calling
- * <code>translate</code>.
- */
- public abstract void translate(ClassGenerator classGen,
- MethodGenerator methodGen);
-
- /**
- * Returns the priority of this pattern (section 5.5 in the XSLT spec).
- */
- public abstract double getPriority();
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/PositionCall.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/PositionCall.java
deleted file mode 100644
index f656aec..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/PositionCall.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: PositionCall.java,v 1.2.4.1 2005/09/02 11:17:10 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.ILOAD;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.CompareGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TestGenerator;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- */
-final class PositionCall extends FunctionCall {
-
- public PositionCall(QName fname) {
- super(fname);
- }
-
- public boolean hasPositionCall() {
- return true;
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final InstructionList il = methodGen.getInstructionList();
-
- if (methodGen instanceof CompareGenerator) {
- il.append(((CompareGenerator)methodGen).loadCurrentNode());
- }
- else if (methodGen instanceof TestGenerator) {
- il.append(new ILOAD(POSITION_INDEX));
- }
- else {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final int index = cpg.addInterfaceMethodref(NODE_ITERATOR,
- "getPosition",
- "()I");
-
- il.append(methodGen.loadIterator());
- il.append(new INVOKEINTERFACE(index,1));
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Predicate.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Predicate.java
deleted file mode 100644
index 4327f0d..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Predicate.java
+++ /dev/null
@@ -1,619 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Predicate.java,v 1.2.4.1 2005/09/12 11:02:18 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import java.util.ArrayList;
-
-import com.sun.org.apache.bcel.internal.classfile.Field;
-import com.sun.org.apache.bcel.internal.generic.ASTORE;
-import com.sun.org.apache.bcel.internal.generic.CHECKCAST;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.GETFIELD;
-import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
-import com.sun.org.apache.bcel.internal.generic.NEW;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.bcel.internal.generic.PUTFIELD;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.BooleanType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.FilterGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.IntType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NumberType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ReferenceType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ResultTreeType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TestGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.Operators;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- */
-final class Predicate extends Expression implements Closure {
-
- /**
- * The predicate's expression.
- */
- private Expression _exp = null;
-
- /**
- * This flag indicates if optimizations are turned on. The
- * method <code>dontOptimize()</code> can be called to turn
- * optimizations off.
- */
- private boolean _canOptimize = true;
-
- /**
- * Flag indicatig if the nth position optimization is on. It
- * is set in <code>typeCheck()</code>.
- */
- private boolean _nthPositionFilter = false;
-
- /**
- * Flag indicatig if the nth position descendant is on. It
- * is set in <code>typeCheck()</code>.
- */
- private boolean _nthDescendant = false;
-
- /**
- * Cached node type of the expression that owns this predicate.
- */
- int _ptype = -1;
-
- /**
- * Name of the inner class.
- */
- private String _className = null;
-
- /**
- * List of variables in closure.
- */
- private ArrayList _closureVars = null;
-
- /**
- * Reference to parent closure.
- */
- private Closure _parentClosure = null;
-
- /**
- * Cached value of method <code>getCompareValue()</code>.
- */
- private Expression _value = null;
-
- /**
- * Cached value of method <code>getCompareValue()</code>.
- */
- private Step _step = null;
-
- /**
- * Initializes a predicate.
- */
- public Predicate(Expression exp) {
- _exp = exp;
- _exp.setParent(this);
-
- }
-
- /**
- * Set the parser for this expression.
- */
- public void setParser(Parser parser) {
- super.setParser(parser);
- _exp.setParser(parser);
- }
-
- /**
- * Returns a boolean value indicating if the nth position optimization
- * is on. Must be call after type checking!
- */
- public boolean isNthPositionFilter() {
- return _nthPositionFilter;
- }
-
- /**
- * Returns a boolean value indicating if the nth descendant optimization
- * is on. Must be call after type checking!
- */
- public boolean isNthDescendant() {
- return _nthDescendant;
- }
-
- /**
- * Turns off all optimizations for this predicate.
- */
- public void dontOptimize() {
- _canOptimize = false;
- }
-
- /**
- * Returns true if the expression in this predicate contains a call
- * to position().
- */
- public boolean hasPositionCall() {
- return _exp.hasPositionCall();
- }
-
- /**
- * Returns true if the expression in this predicate contains a call
- * to last().
- */
- public boolean hasLastCall() {
- return _exp.hasLastCall();
- }
-
- // -- Begin Closure interface --------------------
-
- /**
- * Returns true if this closure is compiled in an inner class (i.e.
- * if this is a real closure).
- */
- public boolean inInnerClass() {
- return (_className != null);
- }
-
- /**
- * Returns a reference to its parent closure or null if outermost.
- */
- public Closure getParentClosure() {
- if (_parentClosure == null) {
- SyntaxTreeNode node = getParent();
- do {
- if (node instanceof Closure) {
- _parentClosure = (Closure) node;
- break;
- }
- if (node instanceof TopLevelElement) {
- break; // way up in the tree
- }
- node = node.getParent();
- } while (node != null);
- }
- return _parentClosure;
- }
-
- /**
- * Returns the name of the auxiliary class or null if this predicate
- * is compiled inside the Translet.
- */
- public String getInnerClassName() {
- return _className;
- }
-
- /**
- * Add new variable to the closure.
- */
- public void addVariable(VariableRefBase variableRef) {
- if (_closureVars == null) {
- _closureVars = new ArrayList();
- }
-
- // Only one reference per variable
- if (!_closureVars.contains(variableRef)) {
- _closureVars.add(variableRef);
-
- // Add variable to parent closure as well
- Closure parentClosure = getParentClosure();
- if (parentClosure != null) {
- parentClosure.addVariable(variableRef);
- }
- }
- }
-
- // -- End Closure interface ----------------------
-
- /**
- * Returns the node type of the expression owning this predicate. The
- * return value is cached in <code>_ptype</code>.
- */
- public int getPosType() {
- if (_ptype == -1) {
- SyntaxTreeNode parent = getParent();
- if (parent instanceof StepPattern) {
- _ptype = ((StepPattern)parent).getNodeType();
- }
- else if (parent instanceof AbsoluteLocationPath) {
- AbsoluteLocationPath path = (AbsoluteLocationPath)parent;
- Expression exp = path.getPath();
- if (exp instanceof Step) {
- _ptype = ((Step)exp).getNodeType();
- }
- }
- else if (parent instanceof VariableRefBase) {
- final VariableRefBase ref = (VariableRefBase)parent;
- final VariableBase var = ref.getVariable();
- final Expression exp = var.getExpression();
- if (exp instanceof Step) {
- _ptype = ((Step)exp).getNodeType();
- }
- }
- else if (parent instanceof Step) {
- _ptype = ((Step)parent).getNodeType();
- }
- }
- return _ptype;
- }
-
- public boolean parentIsPattern() {
- return (getParent() instanceof Pattern);
- }
-
- public Expression getExpr() {
- return _exp;
- }
-
- public String toString() {
- return "pred(" + _exp + ')';
- }
-
- /**
- * Type check a predicate expression. If the type of the expression is
- * number convert it to boolean by adding a comparison with position().
- * Note that if the expression is a parameter, we cannot distinguish
- * at compile time if its type is number or not. Hence, expressions of
- * reference type are always converted to booleans.
- *
- * This method may be called twice, before and after calling
- * <code>dontOptimize()</code>. If so, the second time it should honor
- * the new value of <code>_canOptimize</code>.
- */
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- Type texp = _exp.typeCheck(stable);
-
- // We need explicit type information for reference types - no good!
- if (texp instanceof ReferenceType) {
- _exp = new CastExpr(_exp, texp = Type.Real);
- }
-
- // A result tree fragment should not be cast directly to a number type,
- // but rather to a boolean value, and then to a numer (0 or 1).
- // Ref. section 11.2 of the XSLT 1.0 spec
- if (texp instanceof ResultTreeType) {
- _exp = new CastExpr(_exp, Type.Boolean);
- _exp = new CastExpr(_exp, Type.Real);
- texp = _exp.typeCheck(stable);
- }
-
- // Numerical types will be converted to a position filter
- if (texp instanceof NumberType) {
- // Cast any numerical types to an integer
- if (texp instanceof IntType == false) {
- _exp = new CastExpr(_exp, Type.Int);
- }
-
- if (_canOptimize) {
- // Nth position optimization. Expression must not depend on context
- _nthPositionFilter =
- !_exp.hasLastCall() && !_exp.hasPositionCall();
-
- // _nthDescendant optimization - only if _nthPositionFilter is on
- if (_nthPositionFilter) {
- SyntaxTreeNode parent = getParent();
- _nthDescendant = (parent instanceof Step) &&
- (parent.getParent() instanceof AbsoluteLocationPath);
- return _type = Type.NodeSet;
- }
- }
-
- // Reset optimization flags
- _nthPositionFilter = _nthDescendant = false;
-
- // Otherwise, expand [e] to [position() = e]
- final QName position =
- getParser().getQNameIgnoreDefaultNs("position");
- final PositionCall positionCall =
- new PositionCall(position);
- positionCall.setParser(getParser());
- positionCall.setParent(this);
-
- _exp = new EqualityExpr(Operators.EQ, positionCall,
- _exp);
- if (_exp.typeCheck(stable) != Type.Boolean) {
- _exp = new CastExpr(_exp, Type.Boolean);
- }
- return _type = Type.Boolean;
- }
- else {
- // All other types will be handled as boolean values
- if (texp instanceof BooleanType == false) {
- _exp = new CastExpr(_exp, Type.Boolean);
- }
- return _type = Type.Boolean;
- }
- }
-
- /**
- * Create a new "Filter" class implementing
- * <code>CurrentNodeListFilter</code>. Allocate registers for local
- * variables and local parameters passed in the closure to test().
- * Notice that local variables need to be "unboxed".
- */
- private void compileFilter(ClassGenerator classGen,
- MethodGenerator methodGen) {
- TestGenerator testGen;
- LocalVariableGen local;
- FilterGenerator filterGen;
-
- _className = getXSLTC().getHelperClassName();
- filterGen = new FilterGenerator(_className,
- "java.lang.Object",
- toString(),
- ACC_PUBLIC | ACC_SUPER,
- new String[] {
- CURRENT_NODE_LIST_FILTER
- },
- classGen.getStylesheet());
-
- final ConstantPoolGen cpg = filterGen.getConstantPool();
- final int length = (_closureVars == null) ? 0 : _closureVars.size();
-
- // Add a new instance variable for each var in closure
- for (int i = 0; i < length; i++) {
- VariableBase var = ((VariableRefBase) _closureVars.get(i)).getVariable();
-
- filterGen.addField(new Field(ACC_PUBLIC,
- cpg.addUtf8(var.getEscapedName()),
- cpg.addUtf8(var.getType().toSignature()),
- null, cpg.getConstantPool()));
- }
-
- final InstructionList il = new InstructionList();
- testGen = new TestGenerator(ACC_PUBLIC | ACC_FINAL,
- com.sun.org.apache.bcel.internal.generic.Type.BOOLEAN,
- new com.sun.org.apache.bcel.internal.generic.Type[] {
- com.sun.org.apache.bcel.internal.generic.Type.INT,
- com.sun.org.apache.bcel.internal.generic.Type.INT,
- com.sun.org.apache.bcel.internal.generic.Type.INT,
- com.sun.org.apache.bcel.internal.generic.Type.INT,
- Util.getJCRefType(TRANSLET_SIG),
- Util.getJCRefType(NODE_ITERATOR_SIG)
- },
- new String[] {
- "node",
- "position",
- "last",
- "current",
- "translet",
- "iterator"
- },
- "test", _className, il, cpg);
-
- // Store the dom in a local variable
- local = testGen.addLocalVariable("document",
- Util.getJCRefType(DOM_INTF_SIG),
- null, null);
- final String className = classGen.getClassName();
- il.append(filterGen.loadTranslet());
- il.append(new CHECKCAST(cpg.addClass(className)));
- il.append(new GETFIELD(cpg.addFieldref(className,
- DOM_FIELD, DOM_INTF_SIG)));
- local.setStart(il.append(new ASTORE(local.getIndex())));
-
- // Store the dom index in the test generator
- testGen.setDomIndex(local.getIndex());
-
- _exp.translate(filterGen, testGen);
- il.append(IRETURN);
-
- filterGen.addEmptyConstructor(ACC_PUBLIC);
- filterGen.addMethod(testGen);
-
- getXSLTC().dumpClass(filterGen.getJavaClass());
- }
-
- /**
- * Returns true if the predicate is a test for the existance of an
- * element or attribute. All we have to do is to get the first node
- * from the step, check if it is there, and then return true/false.
- */
- public boolean isBooleanTest() {
- return (_exp instanceof BooleanExpr);
- }
-
- /**
- * Method to see if we can optimise the predicate by using a specialised
- * iterator for expressions like '/foo/bar[@attr = $var]', which are
- * very common in many stylesheets
- */
- public boolean isNodeValueTest() {
- if (!_canOptimize) return false;
- return (getStep() != null && getCompareValue() != null);
- }
-
- /**
- * Returns the step in an expression of the form 'step = value'.
- * Null is returned if the expression is not of the right form.
- * Optimization if off if null is returned.
- */
- public Step getStep() {
- // Returned cached value if called more than once
- if (_step != null) {
- return _step;
- }
-
- // Nothing to do if _exp is null
- if (_exp == null) {
- return null;
- }
-
- // Ignore if not equality expression
- if (_exp instanceof EqualityExpr) {
- EqualityExpr exp = (EqualityExpr)_exp;
- Expression left = exp.getLeft();
- Expression right = exp.getRight();
-
- // Unwrap and set _step if appropriate
- if (left instanceof CastExpr) {
- left = ((CastExpr) left).getExpr();
- }
- if (left instanceof Step) {
- _step = (Step) left;
- }
-
- // Unwrap and set _step if appropriate
- if (right instanceof CastExpr) {
- right = ((CastExpr)right).getExpr();
- }
- if (right instanceof Step) {
- _step = (Step)right;
- }
- }
- return _step;
- }
-
- /**
- * Returns the value in an expression of the form 'step = value'.
- * A value may be either a literal string or a variable whose
- * type is string. Optimization if off if null is returned.
- */
- public Expression getCompareValue() {
- // Returned cached value if called more than once
- if (_value != null) {
- return _value;
- }
-
- // Nothing to to do if _exp is null
- if (_exp == null) {
- return null;
- }
-
- // Ignore if not an equality expression
- if (_exp instanceof EqualityExpr) {
- EqualityExpr exp = (EqualityExpr) _exp;
- Expression left = exp.getLeft();
- Expression right = exp.getRight();
-
- // Return if left is literal string
- if (left instanceof LiteralExpr) {
- _value = left;
- return _value;
- }
- // Return if left is a variable reference of type string
- if (left instanceof VariableRefBase &&
- left.getType() == Type.String)
- {
- _value = left;
- return _value;
- }
-
- // Return if right is literal string
- if (right instanceof LiteralExpr) {
- _value = right;
- return _value;
- }
- // Return if left is a variable reference whose type is string
- if (right instanceof VariableRefBase &&
- right.getType() == Type.String)
- {
- _value = right;
- return _value;
- }
- }
- return null;
- }
-
- /**
- * Translate a predicate expression. This translation pushes
- * two references on the stack: a reference to a newly created
- * filter object and a reference to the predicate's closure.
- */
- public void translateFilter(ClassGenerator classGen,
- MethodGenerator methodGen)
- {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- // Compile auxiliary class for filter
- compileFilter(classGen, methodGen);
-
- // Create new instance of filter
- il.append(new NEW(cpg.addClass(_className)));
- il.append(DUP);
- il.append(new INVOKESPECIAL(cpg.addMethodref(_className,
- "<init>", "()V")));
-
- // Initialize closure variables
- final int length = (_closureVars == null) ? 0 : _closureVars.size();
-
- for (int i = 0; i < length; i++) {
- VariableRefBase varRef = (VariableRefBase) _closureVars.get(i);
- VariableBase var = varRef.getVariable();
- Type varType = var.getType();
-
- il.append(DUP);
-
- // Find nearest closure implemented as an inner class
- Closure variableClosure = _parentClosure;
- while (variableClosure != null) {
- if (variableClosure.inInnerClass()) break;
- variableClosure = variableClosure.getParentClosure();
- }
-
- // Use getfield if in an inner class
- if (variableClosure != null) {
- il.append(ALOAD_0);
- il.append(new GETFIELD(
- cpg.addFieldref(variableClosure.getInnerClassName(),
- var.getEscapedName(), varType.toSignature())));
- }
- else {
- // Use a load of instruction if in translet class
- il.append(var.loadInstruction());
- }
-
- // Store variable in new closure
- il.append(new PUTFIELD(
- cpg.addFieldref(_className, var.getEscapedName(),
- varType.toSignature())));
- }
- }
-
- /**
- * Translate a predicate expression. If non of the optimizations apply
- * then this translation pushes two references on the stack: a reference
- * to a newly created filter object and a reference to the predicate's
- * closure. See class <code>Step</code> for further details.
- */
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- if (_nthPositionFilter || _nthDescendant) {
- _exp.translate(classGen, methodGen);
- }
- else if (isNodeValueTest() && (getParent() instanceof Step)) {
- _value.translate(classGen, methodGen);
- il.append(new CHECKCAST(cpg.addClass(STRING_CLASS)));
- il.append(new PUSH(cpg, ((EqualityExpr)_exp).getOp()));
- }
- else {
- translateFilter(classGen, methodGen);
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ProcessingInstruction.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ProcessingInstruction.java
deleted file mode 100644
index 53971c9..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ProcessingInstruction.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ProcessingInstruction.java,v 1.2.4.1 2005/09/12 11:03:05 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.ALOAD;
-import com.sun.org.apache.bcel.internal.generic.ASTORE;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.GETFIELD;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
-import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-import com.sun.org.apache.xml.internal.utils.XML11Char;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-final class ProcessingInstruction extends Instruction {
-
- private AttributeValue _name; // name treated as AVT (7.1.3)
- private boolean _isLiteral = false; // specified name is not AVT
-
- public void parseContents(Parser parser) {
- final String name = getAttribute("name");
-
- if (name.length() > 0) {
- _isLiteral = Util.isLiteral(name);
- if (_isLiteral) {
- if (!XML11Char.isXML11ValidNCName(name)) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_NCNAME_ERR, name, this);
- parser.reportError(Constants.ERROR, err);
- }
- }
- _name = AttributeValue.create(this, name, parser);
- }
- else
- reportError(this, parser, ErrorMsg.REQUIRED_ATTR_ERR, "name");
-
- if (name.equals("xml")) {
- reportError(this, parser, ErrorMsg.ILLEGAL_PI_ERR, "xml");
- }
- parseChildren(parser);
- }
-
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- _name.typeCheck(stable);
- typeCheckContents(stable);
- return Type.Void;
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- if (!_isLiteral) {
- // if the ncname is an AVT, then the ncname has to be checked at runtime if it is a valid ncname
- LocalVariableGen nameValue =
- methodGen.addLocalVariable2("nameValue",
- Util.getJCRefType(STRING_SIG),
- null);
-
- // store the name into a variable first so _name.translate only needs to be called once
- _name.translate(classGen, methodGen);
- nameValue.setStart(il.append(new ASTORE(nameValue.getIndex())));
- il.append(new ALOAD(nameValue.getIndex()));
-
- // call checkNCName if the name is an AVT
- final int check = cpg.addMethodref(BASIS_LIBRARY_CLASS, "checkNCName",
- "("
- +STRING_SIG
- +")V");
- il.append(new INVOKESTATIC(check));
-
- // Save the current handler base on the stack
- il.append(methodGen.loadHandler());
- il.append(DUP); // first arg to "attributes" call
-
- // load name value again
- nameValue.setEnd(il.append(new ALOAD(nameValue.getIndex())));
- } else {
- // Save the current handler base on the stack
- il.append(methodGen.loadHandler());
- il.append(DUP); // first arg to "attributes" call
-
- // Push attribute name
- _name.translate(classGen, methodGen);// 2nd arg
-
- }
-
- il.append(classGen.loadTranslet());
- il.append(new GETFIELD(cpg.addFieldref(TRANSLET_CLASS,
- "stringValueHandler",
- STRING_VALUE_HANDLER_SIG)));
- il.append(DUP);
- il.append(methodGen.storeHandler());
-
- // translate contents with substituted handler
- translateContents(classGen, methodGen);
-
- // get String out of the handler
- il.append(new INVOKEVIRTUAL(cpg.addMethodref(STRING_VALUE_HANDLER,
- "getValueOfPI",
- "()" + STRING_SIG)));
- // call "processingInstruction"
- final int processingInstruction =
- cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
- "processingInstruction",
- "(" + STRING_SIG + STRING_SIG + ")V");
- il.append(new INVOKEINTERFACE(processingInstruction, 3));
- // Restore old handler base from stack
- il.append(methodGen.storeHandler());
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ProcessingInstructionPattern.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ProcessingInstructionPattern.java
deleted file mode 100644
index 9fcdf1c..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ProcessingInstructionPattern.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ProcessingInstructionPattern.java,v 1.2.4.1 2005/09/12 11:04:08 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.BranchHandle;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.GOTO;
-import com.sun.org.apache.bcel.internal.generic.IFEQ;
-import com.sun.org.apache.bcel.internal.generic.IF_ICMPEQ;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
-import com.sun.org.apache.bcel.internal.generic.InstructionHandle;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xml.internal.dtm.Axis;
-import com.sun.org.apache.xml.internal.dtm.DTM;
-
-/**
- * @author Morten Jorgensen
- */
-final class ProcessingInstructionPattern extends StepPattern {
-
- private String _name = null;
- private boolean _typeChecked = false;
-
- /**
- * Handles calls with no parameter (current node is implicit parameter).
- */
- public ProcessingInstructionPattern(String name) {
- super(Axis.CHILD, DTM.PROCESSING_INSTRUCTION_NODE, null);
- _name = name;
- //if (_name.equals("*")) _typeChecked = true; no wildcard allowed!
- }
-
- /**
- *
- */
- public double getDefaultPriority() {
- return (_name != null) ? 0.0 : -0.5;
- }
- public String toString() {
- if (_predicates == null)
- return "processing-instruction("+_name+")";
- else
- return "processing-instruction("+_name+")"+_predicates;
- }
-
- public void reduceKernelPattern() {
- _typeChecked = true;
- }
-
- public boolean isWildcard() {
- return false;
- }
-
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- if (hasPredicates()) {
- // Type check all the predicates (e -> position() = e)
- final int n = _predicates.size();
- for (int i = 0; i < n; i++) {
- final Predicate pred = (Predicate)_predicates.elementAt(i);
- pred.typeCheck(stable);
- }
- }
- return Type.NodeSet;
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- // context node is on the stack
- int gname = cpg.addInterfaceMethodref(DOM_INTF,
- "getNodeName",
- "(I)Ljava/lang/String;");
- int cmp = cpg.addMethodref(STRING_CLASS,
- "equals", "(Ljava/lang/Object;)Z");
-
- // Push current node on the stack
- il.append(methodGen.loadCurrentNode());
- il.append(SWAP);
-
- // Overwrite current node with matching node
- il.append(methodGen.storeCurrentNode());
-
- // If pattern not reduced then check kernel
- if (!_typeChecked) {
- il.append(methodGen.loadCurrentNode());
- final int getType = cpg.addInterfaceMethodref(DOM_INTF,
- "getExpandedTypeID",
- "(I)I");
- il.append(methodGen.loadDOM());
- il.append(methodGen.loadCurrentNode());
- il.append(new INVOKEINTERFACE(getType, 2));
- il.append(new PUSH(cpg, DTM.PROCESSING_INSTRUCTION_NODE));
- _falseList.add(il.append(new IF_ICMPEQ(null)));
- }
-
- // Load the requested processing instruction name
- il.append(new PUSH(cpg, _name));
- // Load the current processing instruction's name
- il.append(methodGen.loadDOM());
- il.append(methodGen.loadCurrentNode());
- il.append(new INVOKEINTERFACE(gname, 2));
- // Compare the two strings
- il.append(new INVOKEVIRTUAL(cmp));
- _falseList.add(il.append(new IFEQ(null)));
-
- // Compile the expressions within the predicates
- if (hasPredicates()) {
- final int n = _predicates.size();
- for (int i = 0; i < n; i++) {
- Predicate pred = (Predicate)_predicates.elementAt(i);
- Expression exp = pred.getExpr();
- exp.translateDesynthesized(classGen, methodGen);
- _trueList.append(exp._trueList);
- _falseList.append(exp._falseList);
- }
- }
-
- // Backpatch true list and restore current iterator/node
- InstructionHandle restore;
- restore = il.append(methodGen.storeCurrentNode());
- backPatchTrueList(restore);
- BranchHandle skipFalse = il.append(new GOTO(null));
-
- // Backpatch false list and restore current iterator/node
- restore = il.append(methodGen.storeCurrentNode());
- backPatchFalseList(restore);
- _falseList.add(il.append(new GOTO(null)));
-
- // True list falls through
- skipFalse.setTarget(il.append(NOP));
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/QName.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/QName.java
deleted file mode 100644
index 896b216..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/QName.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: QName.java,v 1.2.4.1 2005/09/02 11:45:56 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- */
-final class QName {
- private final String _localname;
- private String _prefix;
- private String _namespace;
- private String _stringRep;
- private int _hashCode;
-
- public QName(String namespace, String prefix, String localname) {
- _namespace = namespace;
- _prefix = prefix;
- _localname = localname;
-
- _stringRep =
- (namespace != null && !namespace.equals(Constants.EMPTYSTRING)) ?
- (namespace + ':' + localname) : localname;
-
- _hashCode = _stringRep.hashCode() + 19; // cached for speed
- }
-
- public void clearNamespace() {
- _namespace = Constants.EMPTYSTRING;
- }
-
- public String toString() {
- return _stringRep;
- }
-
- public String getStringRep() {
- return _stringRep;
- }
-
- public boolean equals(Object other) {
- return (this == other)
- || (other instanceof QName
- && _stringRep.equals(((QName) other).getStringRep()));
- }
-
- public String getLocalPart() {
- return _localname;
- }
-
- public String getNamespace() {
- return _namespace;
- }
-
- public String getPrefix() {
- return _prefix;
- }
-
- public int hashCode() {
- return _hashCode;
- }
-
- public String dump() {
- return "QName: " + _namespace + "(" + _prefix + "):" + _localname;
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/RealExpr.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/RealExpr.java
deleted file mode 100644
index 5471fe5..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/RealExpr.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: RealExpr.java,v 1.2 2005/08/16 22:30:35 jeffsuttor Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-final class RealExpr extends Expression {
- private double _value;
-
- public RealExpr(double value) {
- _value = value;
- }
-
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- return _type = Type.Real;
- }
-
- public String toString() {
- return "real-expr(" + _value + ')';
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- ConstantPoolGen cpg = classGen.getConstantPool();
- InstructionList il = methodGen.getInstructionList();
- il.append(new PUSH(cpg, _value));
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/RelationalExpr.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/RelationalExpr.java
deleted file mode 100644
index fca7e67..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/RelationalExpr.java
+++ /dev/null
@@ -1,283 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: RelationalExpr.java,v 1.2.4.1 2005/09/12 11:05:00 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.BranchInstruction;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.BooleanType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.IntType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeSetType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.RealType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ReferenceType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ResultTreeType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.Operators;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-final class RelationalExpr extends Expression {
-
- private int _op;
- private Expression _left, _right;
-
- public RelationalExpr(int op, Expression left, Expression right) {
- _op = op;
- (_left = left).setParent(this);
- (_right = right).setParent(this);
- }
-
- public void setParser(Parser parser) {
- super.setParser(parser);
- _left.setParser(parser);
- _right.setParser(parser);
- }
-
- /**
- * Returns true if this expressions contains a call to position(). This is
- * needed for context changes in node steps containing multiple predicates.
- */
- public boolean hasPositionCall() {
- if (_left.hasPositionCall()) return true;
- if (_right.hasPositionCall()) return true;
- return false;
- }
-
- /**
- * Returns true if this expressions contains a call to last()
- */
- public boolean hasLastCall() {
- return (_left.hasLastCall() || _right.hasLastCall());
- }
-
- public boolean hasReferenceArgs() {
- return _left.getType() instanceof ReferenceType ||
- _right.getType() instanceof ReferenceType;
- }
-
- public boolean hasNodeArgs() {
- return _left.getType() instanceof NodeType ||
- _right.getType() instanceof NodeType;
- }
-
- public boolean hasNodeSetArgs() {
- return _left.getType() instanceof NodeSetType ||
- _right.getType() instanceof NodeSetType;
- }
-
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- Type tleft = _left.typeCheck(stable);
- Type tright = _right.typeCheck(stable);
-
- //bug fix # 2838, cast to reals if both are result tree fragments
- if (tleft instanceof ResultTreeType &&
- tright instanceof ResultTreeType )
- {
- _right = new CastExpr(_right, Type.Real);
- _left = new CastExpr(_left, Type.Real);
- return _type = Type.Boolean;
- }
-
- // If one is of reference type, then convert the other too
- if (hasReferenceArgs()) {
- Type type = null;
- Type typeL = null;
- Type typeR = null;
- if (tleft instanceof ReferenceType) {
- if (_left instanceof VariableRefBase) {
- VariableRefBase ref = (VariableRefBase)_left;
- VariableBase var = ref.getVariable();
- typeL = var.getType();
- }
- }
- if (tright instanceof ReferenceType) {
- if (_right instanceof VariableRefBase) {
- VariableRefBase ref = (VariableRefBase)_right;
- VariableBase var = ref.getVariable();
- typeR = var.getType();
- }
- }
- // bug fix # 2838
- if (typeL == null)
- type = typeR;
- else if (typeR == null)
- type = typeL;
- else {
- type = Type.Real;
- }
- if (type == null) type = Type.Real;
-
- _right = new CastExpr(_right, type);
- _left = new CastExpr(_left, type);
- return _type = Type.Boolean;
- }
-
- if (hasNodeSetArgs()) {
- // Ensure that the node-set is the left argument
- if (tright instanceof NodeSetType) {
- final Expression temp = _right; _right = _left; _left = temp;
- _op = (_op == Operators.GT) ? Operators.LT :
- (_op == Operators.LT) ? Operators.GT :
- (_op == Operators.GE) ? Operators.LE : Operators.GE;
- tright = _right.getType();
- }
-
- // Promote nodes to node sets
- if (tright instanceof NodeType) {
- _right = new CastExpr(_right, Type.NodeSet);
- }
- // Promote integer to doubles to have fewer compares
- if (tright instanceof IntType) {
- _right = new CastExpr(_right, Type.Real);
- }
- // Promote result-trees to strings
- if (tright instanceof ResultTreeType) {
- _right = new CastExpr(_right, Type.String);
- }
- return _type = Type.Boolean;
- }
-
- // In the node-boolean case, convert node to boolean first
- if (hasNodeArgs()) {
- if (tleft instanceof BooleanType) {
- _right = new CastExpr(_right, Type.Boolean);
- tright = Type.Boolean;
- }
- if (tright instanceof BooleanType) {
- _left = new CastExpr(_left, Type.Boolean);
- tleft = Type.Boolean;
- }
- }
-
- // Lookup the table of primops to find the best match
- MethodType ptype = lookupPrimop(stable, Operators.getOpNames(_op),
- new MethodType(Type.Void, tleft, tright));
-
- if (ptype != null) {
- Type arg1 = (Type) ptype.argsType().elementAt(0);
- if (!arg1.identicalTo(tleft)) {
- _left = new CastExpr(_left, arg1);
- }
- Type arg2 = (Type) ptype.argsType().elementAt(1);
- if (!arg2.identicalTo(tright)) {
- _right = new CastExpr(_right, arg1);
- }
- return _type = ptype.resultType();
- }
- throw new TypeCheckError(this);
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- if (hasNodeSetArgs() || hasReferenceArgs()) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- // Call compare() from the BasisLibrary
- _left.translate(classGen, methodGen);
- _left.startIterator(classGen, methodGen);
- _right.translate(classGen, methodGen);
- _right.startIterator(classGen, methodGen);
-
- il.append(new PUSH(cpg, _op));
- il.append(methodGen.loadDOM());
-
- int index = cpg.addMethodref(BASIS_LIBRARY_CLASS, "compare",
- "("
- + _left.getType().toSignature()
- + _right.getType().toSignature()
- + "I"
- + DOM_INTF_SIG
- + ")Z");
- il.append(new INVOKESTATIC(index));
- }
- else {
- translateDesynthesized(classGen, methodGen);
- synthesize(classGen, methodGen);
- }
- }
-
- public void translateDesynthesized(ClassGenerator classGen,
- MethodGenerator methodGen) {
- if (hasNodeSetArgs() || hasReferenceArgs()) {
- translate(classGen, methodGen);
- desynthesize(classGen, methodGen);
- }
- else {
- BranchInstruction bi = null;
- final InstructionList il = methodGen.getInstructionList();
-
- _left.translate(classGen, methodGen);
- _right.translate(classGen, methodGen);
-
- // TODO: optimize if one of the args is 0
-
- boolean tozero = false;
- Type tleft = _left.getType();
-
- if (tleft instanceof RealType) {
- il.append(tleft.CMP(_op == Operators.LT || _op == Operators.LE));
- tleft = Type.Int;
- tozero = true;
- }
-
- switch (_op) {
- case Operators.LT:
- bi = tleft.GE(tozero);
- break;
-
- case Operators.GT:
- bi = tleft.LE(tozero);
- break;
-
- case Operators.LE:
- bi = tleft.GT(tozero);
- break;
-
- case Operators.GE:
- bi = tleft.LT(tozero);
- break;
-
- default:
- ErrorMsg msg = new ErrorMsg(ErrorMsg.ILLEGAL_RELAT_OP_ERR,this);
- getParser().reportError(Constants.FATAL, msg);
- }
-
- _falseList.add(il.append(bi)); // must be backpatched
- }
- }
-
- public String toString() {
- return Operators.getOpNames(_op) + '(' + _left + ", " + _right + ')';
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/RelativeLocationPath.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/RelativeLocationPath.java
deleted file mode 100644
index 3b68004..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/RelativeLocationPath.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: RelativeLocationPath.java,v 1.2.4.1 2005/09/02 11:59:22 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-abstract class RelativeLocationPath extends Expression {
- public abstract int getAxis();
- public abstract void setAxis(int axis);
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/RelativePathPattern.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/RelativePathPattern.java
deleted file mode 100644
index 90bc2d9..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/RelativePathPattern.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: RelativePathPattern.java,v 1.2.4.1 2005/09/02 12:09:38 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-abstract class RelativePathPattern extends LocationPathPattern {}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/RoundCall.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/RoundCall.java
deleted file mode 100644
index 4a0d1fb..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/RoundCall.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: RoundCall.java,v 1.2.4.1 2005/09/02 12:12:35 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import java.util.Vector;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-final class RoundCall extends FunctionCall {
-
- public RoundCall(QName fname, Vector arguments) {
- super(fname, arguments);
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- // Get two copies of the argument on the stack
- argument().translate(classGen, methodGen);
- il.append(new INVOKESTATIC(cpg.addMethodref(BASIS_LIBRARY_CLASS,
- "roundF", "(D)D")));
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/SimpleAttributeValue.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/SimpleAttributeValue.java
deleted file mode 100644
index 131ed31..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/SimpleAttributeValue.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: SimpleAttributeValue.java,v 1.2.4.1 2005/09/05 08:58:46 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-final class SimpleAttributeValue extends AttributeValue {
-
- private String _value; // The attributes value (literate string).
-
- /**
- * Creates a new simple attribute value.
- * @param value the attribute value.
- */
- public SimpleAttributeValue(String value) {
- _value = value;
- }
-
- /**
- * Returns this attribute value's type (String).
- * @param stable The compiler/parser's symbol table
- */
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- return _type = Type.String;
- }
-
- public String toString() {
- return _value;
- }
-
- protected boolean contextDependent() {
- return false;
- }
-
- /**
- * Translate this attribute value into JVM bytecodes that pushes the
- * attribute value onto the JVM's stack.
- * @param classGen BCEL Java class generator
- * @param methodGen BCEL Java method generator
- */
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- il.append(new PUSH(cpg, _value));
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Sort.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Sort.java
deleted file mode 100644
index f7309e5..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Sort.java
+++ /dev/null
@@ -1,734 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Copyright 2001-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import java.util.ArrayList;
-import java.util.Vector;
-
-import com.sun.org.apache.bcel.internal.classfile.Field;
-import com.sun.org.apache.bcel.internal.generic.ALOAD;
-import com.sun.org.apache.bcel.internal.generic.ANEWARRAY;
-import com.sun.org.apache.bcel.internal.generic.ASTORE;
-import com.sun.org.apache.bcel.internal.generic.CHECKCAST;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.GETFIELD;
-import com.sun.org.apache.bcel.internal.generic.ILOAD;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
-import com.sun.org.apache.bcel.internal.generic.InstructionHandle;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
-import com.sun.org.apache.bcel.internal.generic.NEW;
-import com.sun.org.apache.bcel.internal.generic.NOP;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.bcel.internal.generic.PUTFIELD;
-import com.sun.org.apache.bcel.internal.generic.TABLESWITCH;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.CompareGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.IntType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeSortRecordFactGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeSortRecordGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.StringType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-import com.sun.org.apache.xml.internal.dtm.Axis;
-
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- */
-final class Sort extends Instruction implements Closure {
-
- private Expression _select;
- private AttributeValue _order;
- private AttributeValue _caseOrder;
- private AttributeValue _dataType;
- private String _lang; // bug! see 26869
-
- private String _className = null;
- private ArrayList<VariableRefBase> _closureVars = null;
- private boolean _needsSortRecordFactory = false;
-
- // -- Begin Closure interface --------------------
-
- /**
- * Returns true if this closure is compiled in an inner class (i.e.
- * if this is a real closure).
- */
- public boolean inInnerClass() {
- return (_className != null);
- }
-
- /**
- * Returns a reference to its parent closure or null if outermost.
- */
- public Closure getParentClosure() {
- return null;
- }
-
- /**
- * Returns the name of the auxiliary class or null if this predicate
- * is compiled inside the Translet.
- */
- public String getInnerClassName() {
- return _className;
- }
-
- /**
- * Add new variable to the closure.
- */
- public void addVariable(VariableRefBase variableRef) {
- if (_closureVars == null) {
- _closureVars = new ArrayList<>();
- }
-
- // Only one reference per variable
- if (!_closureVars.contains(variableRef)) {
- _closureVars.add(variableRef);
- _needsSortRecordFactory = true;
- }
- }
-
- // -- End Closure interface ----------------------
-
- private void setInnerClassName(String className) {
- _className = className;
- }
-
- /**
- * Parse the attributes of the xsl:sort element
- */
- public void parseContents(Parser parser) {
-
- final SyntaxTreeNode parent = getParent();
- if (!(parent instanceof ApplyTemplates) &&
- !(parent instanceof ForEach)) {
- reportError(this, parser, ErrorMsg.STRAY_SORT_ERR, null);
- return;
- }
-
- // Parse the select expression (node string value if no expression)
- _select = parser.parseExpression(this, "select", "string(.)");
-
- // Get the sort order; default is 'ascending'
- String val = getAttribute("order");
- if (val.length() == 0) val = "ascending";
- _order = AttributeValue.create(this, val, parser);
-
- // Get the sort data type; default is text
- val = getAttribute("data-type");
- if (val.length() == 0) {
- try {
- final Type type = _select.typeCheck(parser.getSymbolTable());
- if (type instanceof IntType)
- val = "number";
- else
- val = "text";
- }
- catch (TypeCheckError e) {
- val = "text";
- }
- }
- _dataType = AttributeValue.create(this, val, parser);
-
- _lang = getAttribute("lang"); // bug! see 26869
- // val = getAttribute("lang");
- // _lang = AttributeValue.create(this, val, parser);
- // Get the case order; default is language dependant
- val = getAttribute("case-order");
- _caseOrder = AttributeValue.create(this, val, parser);
-
- }
-
- /**
- * Run type checks on the attributes; expression must return a string
- * which we will use as a sort key
- */
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- final Type tselect = _select.typeCheck(stable);
-
- // If the sort data-type is not set we use the natural data-type
- // of the data we will sort
- if (!(tselect instanceof StringType)) {
- _select = new CastExpr(_select, Type.String);
- }
-
- _order.typeCheck(stable);
- _caseOrder.typeCheck(stable);
- _dataType.typeCheck(stable);
- return Type.Void;
- }
-
- /**
- * These two methods are needed in the static methods that compile the
- * overloaded NodeSortRecord.compareType() and NodeSortRecord.sortOrder()
- */
- public void translateSortType(ClassGenerator classGen,
- MethodGenerator methodGen) {
- _dataType.translate(classGen, methodGen);
- }
-
- public void translateSortOrder(ClassGenerator classGen,
- MethodGenerator methodGen) {
- _order.translate(classGen, methodGen);
- }
-
- public void translateCaseOrder(ClassGenerator classGen,
- MethodGenerator methodGen) {
- _caseOrder.translate(classGen, methodGen);
- }
-
- public void translateLang(ClassGenerator classGen,
- MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- il.append(new PUSH(cpg, _lang)); // bug! see 26869
- }
-
- /**
- * This method compiles code for the select expression for this
- * xsl:sort element. The method is called from the static code-generating
- * methods in this class.
- */
- public void translateSelect(ClassGenerator classGen,
- MethodGenerator methodGen) {
- _select.translate(classGen,methodGen);
- }
-
- /**
- * This method should not produce any code
- */
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- // empty
- }
-
- /**
- * Compiles code that instantiates a SortingIterator object.
- * This object's constructor needs referencdes to the current iterator
- * and a node sort record producing objects as its parameters.
- */
- public static void translateSortIterator(ClassGenerator classGen,
- MethodGenerator methodGen,
- Expression nodeSet,
- Vector<Sort> sortObjects)
- {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- // SortingIterator.SortingIterator(NodeIterator,NodeSortRecordFactory);
- final int init = cpg.addMethodref(SORT_ITERATOR, "<init>",
- "("
- + NODE_ITERATOR_SIG
- + NODE_SORT_FACTORY_SIG
- + ")V");
-
- // Backwards branches are prohibited if an uninitialized object is
- // on the stack by section 4.9.4 of the JVM Specification, 2nd Ed.
- // We don't know whether this code might contain backwards branches
- // so we mustn't create the new object until after we've created
- // the suspect arguments to its constructor. Instead we calculate
- // the values of the arguments to the constructor first, store them
- // in temporary variables, create the object and reload the
- // arguments from the temporaries to avoid the problem.
-
- LocalVariableGen nodesTemp =
- methodGen.addLocalVariable("sort_tmp1",
- Util.getJCRefType(NODE_ITERATOR_SIG),
- null, null);
-
- LocalVariableGen sortRecordFactoryTemp =
- methodGen.addLocalVariable("sort_tmp2",
- Util.getJCRefType(NODE_SORT_FACTORY_SIG),
- null, null);
-
- // Get the current node iterator
- if (nodeSet == null) { // apply-templates default
- final int children = cpg.addInterfaceMethodref(DOM_INTF,
- "getAxisIterator",
- "(I)"+
- NODE_ITERATOR_SIG);
- il.append(methodGen.loadDOM());
- il.append(new PUSH(cpg, Axis.CHILD));
- il.append(new INVOKEINTERFACE(children, 2));
- }
- else {
- nodeSet.translate(classGen, methodGen);
- }
-
- nodesTemp.setStart(il.append(new ASTORE(nodesTemp.getIndex())));
-
- // Compile the code for the NodeSortRecord producing class and pass
- // that as the last argument to the SortingIterator constructor.
- compileSortRecordFactory(sortObjects, classGen, methodGen);
- sortRecordFactoryTemp.setStart(
- il.append(new ASTORE(sortRecordFactoryTemp.getIndex())));
-
- il.append(new NEW(cpg.addClass(SORT_ITERATOR)));
- il.append(DUP);
- nodesTemp.setEnd(il.append(new ALOAD(nodesTemp.getIndex())));
- sortRecordFactoryTemp.setEnd(
- il.append(new ALOAD(sortRecordFactoryTemp.getIndex())));
- il.append(new INVOKESPECIAL(init));
- }
-
-
- /**
- * Compiles code that instantiates a NodeSortRecordFactory object which
- * will produce NodeSortRecord objects of a specific type.
- */
- public static void compileSortRecordFactory(Vector<Sort> sortObjects,
- ClassGenerator classGen, MethodGenerator methodGen)
- {
- String sortRecordClass =
- compileSortRecord(sortObjects, classGen, methodGen);
-
- boolean needsSortRecordFactory = false;
- final int nsorts = sortObjects.size();
- for (int i = 0; i < nsorts; i++) {
- final Sort sort = sortObjects.elementAt(i);
- needsSortRecordFactory |= sort._needsSortRecordFactory;
- }
-
- String sortRecordFactoryClass = NODE_SORT_FACTORY;
- if (needsSortRecordFactory) {
- sortRecordFactoryClass =
- compileSortRecordFactory(sortObjects, classGen, methodGen,
- sortRecordClass);
- }
-
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- // Backwards branches are prohibited if an uninitialized object is
- // on the stack by section 4.9.4 of the JVM Specification, 2nd Ed.
- // We don't know whether this code might contain backwards branches
- // so we mustn't create the new object until after we've created
- // the suspect arguments to its constructor. Instead we calculate
- // the values of the arguments to the constructor first, store them
- // in temporary variables, create the object and reload the
- // arguments from the temporaries to avoid the problem.
-
- // Compile code that initializes the static _sortOrder
- LocalVariableGen sortOrderTemp
- = methodGen.addLocalVariable("sort_order_tmp",
- Util.getJCRefType("[" + STRING_SIG),
- null, null);
- il.append(new PUSH(cpg, nsorts));
- il.append(new ANEWARRAY(cpg.addClass(STRING)));
- for (int level = 0; level < nsorts; level++) {
- final Sort sort = (Sort)sortObjects.elementAt(level);
- il.append(DUP);
- il.append(new PUSH(cpg, level));
- sort.translateSortOrder(classGen, methodGen);
- il.append(AASTORE);
- }
- sortOrderTemp.setStart(il.append(new ASTORE(sortOrderTemp.getIndex())));
-
- LocalVariableGen sortTypeTemp
- = methodGen.addLocalVariable("sort_type_tmp",
- Util.getJCRefType("[" + STRING_SIG),
- null, null);
- il.append(new PUSH(cpg, nsorts));
- il.append(new ANEWARRAY(cpg.addClass(STRING)));
- for (int level = 0; level < nsorts; level++) {
- final Sort sort = (Sort)sortObjects.elementAt(level);
- il.append(DUP);
- il.append(new PUSH(cpg, level));
- sort.translateSortType(classGen, methodGen);
- il.append(AASTORE);
- }
- sortTypeTemp.setStart(il.append(new ASTORE(sortTypeTemp.getIndex())));
-
- LocalVariableGen sortLangTemp
- = methodGen.addLocalVariable("sort_lang_tmp",
- Util.getJCRefType("[" + STRING_SIG),
- null, null);
- il.append(new PUSH(cpg, nsorts));
- il.append(new ANEWARRAY(cpg.addClass(STRING)));
- for (int level = 0; level < nsorts; level++) {
- final Sort sort = (Sort)sortObjects.elementAt(level);
- il.append(DUP);
- il.append(new PUSH(cpg, level));
- sort.translateLang(classGen, methodGen);
- il.append(AASTORE);
- }
- sortLangTemp.setStart(il.append(new ASTORE(sortLangTemp.getIndex())));
-
- LocalVariableGen sortCaseOrderTemp
- = methodGen.addLocalVariable("sort_case_order_tmp",
- Util.getJCRefType("[" + STRING_SIG),
- null, null);
- il.append(new PUSH(cpg, nsorts));
- il.append(new ANEWARRAY(cpg.addClass(STRING)));
- for (int level = 0; level < nsorts; level++) {
- final Sort sort = (Sort)sortObjects.elementAt(level);
- il.append(DUP);
- il.append(new PUSH(cpg, level));
- sort.translateCaseOrder(classGen, methodGen);
- il.append(AASTORE);
- }
- sortCaseOrderTemp.setStart(
- il.append(new ASTORE(sortCaseOrderTemp.getIndex())));
-
- il.append(new NEW(cpg.addClass(sortRecordFactoryClass)));
- il.append(DUP);
- il.append(methodGen.loadDOM());
- il.append(new PUSH(cpg, sortRecordClass));
- il.append(classGen.loadTranslet());
-
- sortOrderTemp.setEnd(il.append(new ALOAD(sortOrderTemp.getIndex())));
- sortTypeTemp.setEnd(il.append(new ALOAD(sortTypeTemp.getIndex())));
- sortLangTemp.setEnd(il.append(new ALOAD(sortLangTemp.getIndex())));
- sortCaseOrderTemp.setEnd(
- il.append(new ALOAD(sortCaseOrderTemp.getIndex())));
-
- il.append(new INVOKESPECIAL(
- cpg.addMethodref(sortRecordFactoryClass, "<init>",
- "(" + DOM_INTF_SIG
- + STRING_SIG
- + TRANSLET_INTF_SIG
- + "[" + STRING_SIG
- + "[" + STRING_SIG
- + "[" + STRING_SIG
- + "[" + STRING_SIG + ")V")));
-
- // Initialize closure variables in sortRecordFactory
- final ArrayList<VariableRefBase> dups = new ArrayList<>();
-
- for (int j = 0; j < nsorts; j++) {
- final Sort sort = (Sort) sortObjects.get(j);
- final int length = (sort._closureVars == null) ? 0 :
- sort._closureVars.size();
-
- for (int i = 0; i < length; i++) {
- VariableRefBase varRef = sort._closureVars.get(i);
-
- // Discard duplicate variable references
- if (dups.contains(varRef)) continue;
-
- final VariableBase var = varRef.getVariable();
-
- // Store variable in new closure
- il.append(DUP);
- il.append(var.loadInstruction());
- il.append(new PUTFIELD(
- cpg.addFieldref(sortRecordFactoryClass, var.getEscapedName(),
- var.getType().toSignature())));
- dups.add(varRef);
- }
- }
- }
-
- public static String compileSortRecordFactory(Vector<Sort> sortObjects,
- ClassGenerator classGen, MethodGenerator methodGen,
- String sortRecordClass)
- {
- final XSLTC xsltc = (sortObjects.firstElement()).getXSLTC();
- final String className = xsltc.getHelperClassName();
-
- final NodeSortRecordFactGenerator sortRecordFactory =
- new NodeSortRecordFactGenerator(className,
- NODE_SORT_FACTORY,
- className + ".java",
- ACC_PUBLIC | ACC_SUPER | ACC_FINAL,
- new String[] {},
- classGen.getStylesheet());
-
- ConstantPoolGen cpg = sortRecordFactory.getConstantPool();
-
- // Add a new instance variable for each var in closure
- final int nsorts = sortObjects.size();
- final ArrayList<VariableRefBase> dups = new ArrayList<>();
-
- for (int j = 0; j < nsorts; j++) {
- final Sort sort = sortObjects.get(j);
- final int length = (sort._closureVars == null) ? 0 :
- sort._closureVars.size();
-
- for (int i = 0; i < length; i++) {
- final VariableRefBase varRef = sort._closureVars.get(i);
-
- // Discard duplicate variable references
- if (dups.contains(varRef)) continue;
-
- final VariableBase var = varRef.getVariable();
- sortRecordFactory.addField(new Field(ACC_PUBLIC,
- cpg.addUtf8(var.getEscapedName()),
- cpg.addUtf8(var.getType().toSignature()),
- null, cpg.getConstantPool()));
- dups.add(varRef);
- }
- }
-
- // Define a constructor for this class
- final com.sun.org.apache.bcel.internal.generic.Type[] argTypes =
- new com.sun.org.apache.bcel.internal.generic.Type[7];
- argTypes[0] = Util.getJCRefType(DOM_INTF_SIG);
- argTypes[1] = Util.getJCRefType(STRING_SIG);
- argTypes[2] = Util.getJCRefType(TRANSLET_INTF_SIG);
- argTypes[3] = Util.getJCRefType("[" + STRING_SIG);
- argTypes[4] = Util.getJCRefType("[" + STRING_SIG);
- argTypes[5] = Util.getJCRefType("[" + STRING_SIG);
- argTypes[6] = Util.getJCRefType("[" + STRING_SIG);
-
- final String[] argNames = new String[7];
- argNames[0] = DOCUMENT_PNAME;
- argNames[1] = "className";
- argNames[2] = TRANSLET_PNAME;
- argNames[3] = "order";
- argNames[4] = "type";
- argNames[5] = "lang";
- argNames[6] = "case_order";
-
-
- InstructionList il = new InstructionList();
- final MethodGenerator constructor =
- new MethodGenerator(ACC_PUBLIC,
- com.sun.org.apache.bcel.internal.generic.Type.VOID,
- argTypes, argNames, "<init>",
- className, il, cpg);
-
- // Push all parameters onto the stack and called super.<init>()
- il.append(ALOAD_0);
- il.append(ALOAD_1);
- il.append(ALOAD_2);
- il.append(new ALOAD(3));
- il.append(new ALOAD(4));
- il.append(new ALOAD(5));
- il.append(new ALOAD(6));
- il.append(new ALOAD(7));
- il.append(new INVOKESPECIAL(cpg.addMethodref(NODE_SORT_FACTORY,
- "<init>",
- "(" + DOM_INTF_SIG
- + STRING_SIG
- + TRANSLET_INTF_SIG
- + "[" + STRING_SIG
- + "[" + STRING_SIG
- + "[" + STRING_SIG
- + "[" + STRING_SIG + ")V")));
- il.append(RETURN);
-
- // Override the definition of makeNodeSortRecord()
- il = new InstructionList();
- final MethodGenerator makeNodeSortRecord =
- new MethodGenerator(ACC_PUBLIC,
- Util.getJCRefType(NODE_SORT_RECORD_SIG),
- new com.sun.org.apache.bcel.internal.generic.Type[] {
- com.sun.org.apache.bcel.internal.generic.Type.INT,
- com.sun.org.apache.bcel.internal.generic.Type.INT },
- new String[] { "node", "last" }, "makeNodeSortRecord",
- className, il, cpg);
-
- il.append(ALOAD_0);
- il.append(ILOAD_1);
- il.append(ILOAD_2);
- il.append(new INVOKESPECIAL(cpg.addMethodref(NODE_SORT_FACTORY,
- "makeNodeSortRecord", "(II)" + NODE_SORT_RECORD_SIG)));
- il.append(DUP);
- il.append(new CHECKCAST(cpg.addClass(sortRecordClass)));
-
- // Initialize closure in record class
- final int ndups = dups.size();
- for (int i = 0; i < ndups; i++) {
- final VariableRefBase varRef = (VariableRefBase) dups.get(i);
- final VariableBase var = varRef.getVariable();
- final Type varType = var.getType();
-
- il.append(DUP);
-
- // Get field from factory class
- il.append(ALOAD_0);
- il.append(new GETFIELD(
- cpg.addFieldref(className,
- var.getEscapedName(), varType.toSignature())));
-
- // Put field in record class
- il.append(new PUTFIELD(
- cpg.addFieldref(sortRecordClass,
- var.getEscapedName(), varType.toSignature())));
- }
- il.append(POP);
- il.append(ARETURN);
-
- constructor.setMaxLocals();
- constructor.setMaxStack();
- sortRecordFactory.addMethod(constructor);
- makeNodeSortRecord.setMaxLocals();
- makeNodeSortRecord.setMaxStack();
- sortRecordFactory.addMethod(makeNodeSortRecord);
- xsltc.dumpClass(sortRecordFactory.getJavaClass());
-
- return className;
- }
-
- /**
- * Create a new auxillary class extending NodeSortRecord.
- */
- private static String compileSortRecord(Vector<Sort> sortObjects,
- ClassGenerator classGen,
- MethodGenerator methodGen) {
- final XSLTC xsltc = sortObjects.firstElement().getXSLTC();
- final String className = xsltc.getHelperClassName();
-
- // This generates a new class for handling this specific sort
- final NodeSortRecordGenerator sortRecord =
- new NodeSortRecordGenerator(className,
- NODE_SORT_RECORD,
- "sort$0.java",
- ACC_PUBLIC | ACC_SUPER | ACC_FINAL,
- new String[] {},
- classGen.getStylesheet());
-
- final ConstantPoolGen cpg = sortRecord.getConstantPool();
-
- // Add a new instance variable for each var in closure
- final int nsorts = sortObjects.size();
- final ArrayList<VariableRefBase> dups = new ArrayList<>();
-
- for (int j = 0; j < nsorts; j++) {
- final Sort sort = sortObjects.get(j);
-
- // Set the name of the inner class in this sort object
- sort.setInnerClassName(className);
-
- final int length = (sort._closureVars == null) ? 0 :
- sort._closureVars.size();
- for (int i = 0; i < length; i++) {
- final VariableRefBase varRef = (VariableRefBase) sort._closureVars.get(i);
-
- // Discard duplicate variable references
- if (dups.contains(varRef)) continue;
-
- final VariableBase var = varRef.getVariable();
- sortRecord.addField(new Field(ACC_PUBLIC,
- cpg.addUtf8(var.getEscapedName()),
- cpg.addUtf8(var.getType().toSignature()),
- null, cpg.getConstantPool()));
- dups.add(varRef);
- }
- }
-
- MethodGenerator init = compileInit(sortRecord, cpg, className);
- MethodGenerator extract = compileExtract(sortObjects, sortRecord,
- cpg, className);
- sortRecord.addMethod(init);
- sortRecord.addMethod(extract);
-
- xsltc.dumpClass(sortRecord.getJavaClass());
- return className;
- }
-
- /**
- * Create a constructor for the new class. Updates the reference to the
- * collator in the super calls only when the stylesheet specifies a new
- * language in xsl:sort.
- */
- private static MethodGenerator compileInit(NodeSortRecordGenerator sortRecord,
- ConstantPoolGen cpg,
- String className)
- {
- final InstructionList il = new InstructionList();
- final MethodGenerator init =
- new MethodGenerator(ACC_PUBLIC,
- com.sun.org.apache.bcel.internal.generic.Type.VOID,
- null, null, "<init>", className,
- il, cpg);
-
- // Call the constructor in the NodeSortRecord superclass
- il.append(ALOAD_0);
- il.append(new INVOKESPECIAL(cpg.addMethodref(NODE_SORT_RECORD,
- "<init>", "()V")));
-
-
-
- il.append(RETURN);
-
- return init;
- }
-
-
- /**
- * Compiles a method that overloads NodeSortRecord.extractValueFromDOM()
- */
- private static MethodGenerator compileExtract(Vector<Sort> sortObjects,
- NodeSortRecordGenerator sortRecord,
- ConstantPoolGen cpg,
- String className) {
- final InstructionList il = new InstructionList();
-
- // String NodeSortRecord.extractValueFromDOM(dom,node,level);
- final CompareGenerator extractMethod =
- new CompareGenerator(ACC_PUBLIC | ACC_FINAL,
- com.sun.org.apache.bcel.internal.generic.Type.STRING,
- new com.sun.org.apache.bcel.internal.generic.Type[] {
- Util.getJCRefType(DOM_INTF_SIG),
- com.sun.org.apache.bcel.internal.generic.Type.INT,
- com.sun.org.apache.bcel.internal.generic.Type.INT,
- Util.getJCRefType(TRANSLET_SIG),
- com.sun.org.apache.bcel.internal.generic.Type.INT
- },
- new String[] { "dom",
- "current",
- "level",
- "translet",
- "last"
- },
- "extractValueFromDOM", className, il, cpg);
-
- // Values needed for the switch statement
- final int levels = sortObjects.size();
- final int match[] = new int[levels];
- final InstructionHandle target[] = new InstructionHandle[levels];
- InstructionHandle tblswitch = null;
-
- // Compile switch statement only if the key has multiple levels
- if (levels > 1) {
- // Put the parameter to the swtich statement on the stack
- il.append(new ILOAD(extractMethod.getLocalIndex("level")));
- // Append the switch statement here later on
- tblswitch = il.append(new NOP());
- }
-
- // Append all the cases for the switch statment
- for (int level = 0; level < levels; level++) {
- match[level] = level;
- final Sort sort = sortObjects.elementAt(level);
- target[level] = il.append(NOP);
- sort.translateSelect(sortRecord, extractMethod);
- il.append(ARETURN);
- }
-
- // Compile def. target for switch statement if key has multiple levels
- if (levels > 1) {
- // Append the default target - it will _NEVER_ be reached
- InstructionHandle defaultTarget =
- il.append(new PUSH(cpg, EMPTYSTRING));
- il.insert(tblswitch,new TABLESWITCH(match, target, defaultTarget));
- il.append(ARETURN);
- }
-
- return extractMethod;
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/SourceLoader.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/SourceLoader.java
deleted file mode 100644
index cc07708..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/SourceLoader.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: SourceLoader.java,v 1.2.4.1 2005/09/05 09:02:30 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import org.xml.sax.InputSource;
-
-/**
- * @author Morten Jorgensen
- */
-public interface SourceLoader {
-
- /**
- * This interface is used to plug external document loaders into XSLTC
- * (used with the <xsl:include> and <xsl:import> elements.
- *
- * @param href The URI of the document to load
- * @param context The URI of the currently loaded document
- * @param xsltc The compiler that resuests the document
- * @return An InputSource with the loaded document
- */
- public InputSource loadSource(String href, String context, XSLTC xsltc);
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/StartsWithCall.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/StartsWithCall.java
deleted file mode 100644
index 5b946c9..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/StartsWithCall.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: StartsWithCall.java,v 1.2.4.1 2005/09/05 09:05:28 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import java.util.Vector;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- */
-final class StartsWithCall extends FunctionCall {
-
- private Expression _base = null;
- private Expression _token = null;
-
- /**
- * Create a starts-with() call - two arguments, both strings
- */
- public StartsWithCall(QName fname, Vector arguments) {
- super(fname, arguments);
- }
-
- /**
- * Type check the two parameters for this function
- */
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-
- // Check that the function was passed exactly two arguments
- if (argumentCount() != 2) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.ILLEGAL_ARG_ERR,
- getName(), this);
- throw new TypeCheckError(err);
- }
-
- // The first argument must be a String, or cast to a String
- _base = argument(0);
- Type baseType = _base.typeCheck(stable);
- if (baseType != Type.String)
- _base = new CastExpr(_base, Type.String);
-
- // The second argument must also be a String, or cast to a String
- _token = argument(1);
- Type tokenType = _token.typeCheck(stable);
- if (tokenType != Type.String)
- _token = new CastExpr(_token, Type.String);
-
- return _type = Type.Boolean;
- }
-
- /**
- * Compile the expression - leave boolean expression on stack
- */
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- _base.translate(classGen, methodGen);
- _token.translate(classGen, methodGen);
- il.append(new INVOKEVIRTUAL(cpg.addMethodref(STRING_CLASS,
- "startsWith",
- "("+STRING_SIG+")Z")));
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Step.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Step.java
deleted file mode 100644
index cca28f9..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Step.java
+++ /dev/null
@@ -1,538 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Step.java,v 1.6 2006/06/06 22:34:34 spericas Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import java.util.Vector;
-
-import com.sun.org.apache.bcel.internal.generic.ALOAD;
-import com.sun.org.apache.bcel.internal.generic.ASTORE;
-import com.sun.org.apache.bcel.internal.generic.CHECKCAST;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.ICONST;
-import com.sun.org.apache.bcel.internal.generic.ILOAD;
-import com.sun.org.apache.bcel.internal.generic.ISTORE;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
-import com.sun.org.apache.bcel.internal.generic.NEW;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.xalan.internal.xsltc.DOM;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-import com.sun.org.apache.xml.internal.dtm.Axis;
-import com.sun.org.apache.xml.internal.dtm.DTM;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- */
-final class Step extends RelativeLocationPath {
-
- /**
- * This step's axis as defined in class Axis.
- */
- private int _axis;
-
- /**
- * A vector of predicates (filters) defined on this step - may be null
- */
- private Vector _predicates;
-
- /**
- * Some simple predicates can be handled by this class (and not by the
- * Predicate class) and will be removed from the above vector as they are
- * handled. We use this boolean to remember if we did have any predicates.
- */
- private boolean _hadPredicates = false;
-
- /**
- * Type of the node test.
- */
- private int _nodeType;
-
- public Step(int axis, int nodeType, Vector predicates) {
- _axis = axis;
- _nodeType = nodeType;
- _predicates = predicates;
- }
-
- /**
- * Set the parser for this element and all child predicates
- */
- public void setParser(Parser parser) {
- super.setParser(parser);
- if (_predicates != null) {
- final int n = _predicates.size();
- for (int i = 0; i < n; i++) {
- final Predicate exp = (Predicate)_predicates.elementAt(i);
- exp.setParser(parser);
- exp.setParent(this);
- }
- }
- }
-
- /**
- * Define the axis (defined in Axis class) for this step
- */
- public int getAxis() {
- return _axis;
- }
-
- /**
- * Get the axis (defined in Axis class) for this step
- */
- public void setAxis(int axis) {
- _axis = axis;
- }
-
- /**
- * Returns the node-type for this step
- */
- public int getNodeType() {
- return _nodeType;
- }
-
- /**
- * Returns the vector containing all predicates for this step.
- */
- public Vector getPredicates() {
- return _predicates;
- }
-
- /**
- * Returns the vector containing all predicates for this step.
- */
- public void addPredicates(Vector predicates) {
- if (_predicates == null) {
- _predicates = predicates;
- }
- else {
- _predicates.addAll(predicates);
- }
- }
-
- /**
- * Returns 'true' if this step has a parent pattern.
- * This method will return 'false' if this step occurs on its own under
- * an element like <xsl:for-each> or <xsl:apply-templates>.
- */
- private boolean hasParentPattern() {
- final SyntaxTreeNode parent = getParent();
- return (parent instanceof ParentPattern ||
- parent instanceof ParentLocationPath ||
- parent instanceof UnionPathExpr ||
- parent instanceof FilterParentPath);
- }
-
- /**
- * Returns 'true' if this step has a parent location path.
- */
- private boolean hasParentLocationPath() {
- return getParent() instanceof ParentLocationPath;
- }
-
- /**
- * Returns 'true' if this step has any predicates
- */
- private boolean hasPredicates() {
- return _predicates != null && _predicates.size() > 0;
- }
-
- /**
- * Returns 'true' if this step is used within a predicate
- */
- private boolean isPredicate() {
- SyntaxTreeNode parent = this;
- while (parent != null) {
- parent = parent.getParent();
- if (parent instanceof Predicate) return true;
- }
- return false;
- }
-
- /**
- * True if this step is the abbreviated step '.'
- */
- public boolean isAbbreviatedDot() {
- return _nodeType == NodeTest.ANODE && _axis == Axis.SELF;
- }
-
-
- /**
- * True if this step is the abbreviated step '..'
- */
- public boolean isAbbreviatedDDot() {
- return _nodeType == NodeTest.ANODE && _axis == Axis.PARENT;
- }
-
- /**
- * Type check this step. The abbreviated steps '.' and '@attr' are
- * assigned type node if they have no predicates. All other steps
- * have type node-set.
- */
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-
- // Save this value for later - important for testing for special
- // combinations of steps and patterns than can be optimised
- _hadPredicates = hasPredicates();
-
- // Special case for '.'
- // in the case where '.' has a context such as book/.
- // or .[false()] we can not optimize the nodeset to a single node.
- if (isAbbreviatedDot()) {
- _type = (hasParentPattern() || hasPredicates() || hasParentLocationPath()) ?
- Type.NodeSet : Type.Node;
- }
- else {
- _type = Type.NodeSet;
- }
-
- // Type check all predicates (expressions applied to the step)
- if (_predicates != null) {
- final int n = _predicates.size();
- for (int i = 0; i < n; i++) {
- final Expression pred = (Expression)_predicates.elementAt(i);
- pred.typeCheck(stable);
- }
- }
-
- // Return either Type.Node or Type.NodeSet
- return _type;
- }
-
- /**
- * Translate a step by pushing the appropriate iterator onto the stack.
- * The abbreviated steps '.' and '@attr' do not create new iterators
- * if they are not part of a LocationPath and have no filters.
- * In these cases a node index instead of an iterator is pushed
- * onto the stack.
- */
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- translateStep(classGen, methodGen, hasPredicates() ? _predicates.size() - 1 : -1);
- }
-
- private void translateStep(ClassGenerator classGen,
- MethodGenerator methodGen,
- int predicateIndex) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- if (predicateIndex >= 0) {
- translatePredicates(classGen, methodGen, predicateIndex);
- } else {
- int star = 0;
- String name = null;
- final XSLTC xsltc = getParser().getXSLTC();
-
- if (_nodeType >= DTM.NTYPES) {
- final Vector ni = xsltc.getNamesIndex();
-
- name = (String)ni.elementAt(_nodeType-DTM.NTYPES);
- star = name.lastIndexOf('*');
- }
-
- // If it is an attribute, but not '@*', '@pre:*' or '@node()',
- // and has no parent
- if (_axis == Axis.ATTRIBUTE && _nodeType != NodeTest.ATTRIBUTE
- && _nodeType != NodeTest.ANODE && !hasParentPattern()
- && star == 0)
- {
- int iter = cpg.addInterfaceMethodref(DOM_INTF,
- "getTypedAxisIterator",
- "(II)"+NODE_ITERATOR_SIG);
- il.append(methodGen.loadDOM());
- il.append(new PUSH(cpg, Axis.ATTRIBUTE));
- il.append(new PUSH(cpg, _nodeType));
- il.append(new INVOKEINTERFACE(iter, 3));
- return;
- }
-
- SyntaxTreeNode parent = getParent();
- // Special case for '.'
- if (isAbbreviatedDot()) {
- if (_type == Type.Node) {
- // Put context node on stack if using Type.Node
- il.append(methodGen.loadContextNode());
- }
- else {
- if (parent instanceof ParentLocationPath){
- // Wrap the context node in a singleton iterator if not.
- int init = cpg.addMethodref(SINGLETON_ITERATOR,
- "<init>",
- "("+NODE_SIG+")V");
- il.append(new NEW(cpg.addClass(SINGLETON_ITERATOR)));
- il.append(DUP);
- il.append(methodGen.loadContextNode());
- il.append(new INVOKESPECIAL(init));
- } else {
- // DOM.getAxisIterator(int axis);
- int git = cpg.addInterfaceMethodref(DOM_INTF,
- "getAxisIterator",
- "(I)"+NODE_ITERATOR_SIG);
- il.append(methodGen.loadDOM());
- il.append(new PUSH(cpg, _axis));
- il.append(new INVOKEINTERFACE(git, 2));
- }
- }
- return;
- }
-
- // Special case for /foo/*/bar
- if ((parent instanceof ParentLocationPath) &&
- (parent.getParent() instanceof ParentLocationPath)) {
- if ((_nodeType == NodeTest.ELEMENT) && (!_hadPredicates)) {
- _nodeType = NodeTest.ANODE;
- }
- }
-
- // "ELEMENT" or "*" or "@*" or ".." or "@attr" with a parent.
- switch (_nodeType) {
- case NodeTest.ATTRIBUTE:
- _axis = Axis.ATTRIBUTE;
- case NodeTest.ANODE:
- // DOM.getAxisIterator(int axis);
- int git = cpg.addInterfaceMethodref(DOM_INTF,
- "getAxisIterator",
- "(I)"+NODE_ITERATOR_SIG);
- il.append(methodGen.loadDOM());
- il.append(new PUSH(cpg, _axis));
- il.append(new INVOKEINTERFACE(git, 2));
- break;
- default:
- if (star > 1) {
- final String namespace;
- if (_axis == Axis.ATTRIBUTE)
- namespace = name.substring(0,star-2);
- else
- namespace = name.substring(0,star-1);
-
- final int nsType = xsltc.registerNamespace(namespace);
- final int ns = cpg.addInterfaceMethodref(DOM_INTF,
- "getNamespaceAxisIterator",
- "(II)"+NODE_ITERATOR_SIG);
- il.append(methodGen.loadDOM());
- il.append(new PUSH(cpg, _axis));
- il.append(new PUSH(cpg, nsType));
- il.append(new INVOKEINTERFACE(ns, 3));
- break;
- }
- case NodeTest.ELEMENT:
- // DOM.getTypedAxisIterator(int axis, int type);
- final int ty = cpg.addInterfaceMethodref(DOM_INTF,
- "getTypedAxisIterator",
- "(II)"+NODE_ITERATOR_SIG);
- // Get the typed iterator we're after
- il.append(methodGen.loadDOM());
- il.append(new PUSH(cpg, _axis));
- il.append(new PUSH(cpg, _nodeType));
- il.append(new INVOKEINTERFACE(ty, 3));
-
- break;
- }
- }
- }
-
-
- /**
- * Translate a sequence of predicates. Each predicate is translated
- * by constructing an instance of <code>CurrentNodeListIterator</code>
- * which is initialized from another iterator (recursive call),
- * a filter and a closure (call to translate on the predicate) and "this".
- */
- public void translatePredicates(ClassGenerator classGen,
- MethodGenerator methodGen,
- int predicateIndex) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- int idx = 0;
-
- if (predicateIndex < 0) {
- translateStep(classGen, methodGen, predicateIndex);
- }
- else {
- final Predicate predicate = (Predicate) _predicates.get(predicateIndex--);
-
- // Special case for predicates that can use the NodeValueIterator
- // instead of an auxiliary class. Certain path/predicates pairs
- // are translated into a base path, on top of which we place a
- // node value iterator that tests for the desired value:
- // foo[@attr = 'str'] -> foo/@attr + test(value='str')
- // foo[bar = 'str'] -> foo/bar + test(value='str')
- // foo/bar[. = 'str'] -> foo/bar + test(value='str')
- if (predicate.isNodeValueTest()) {
- Step step = predicate.getStep();
-
- il.append(methodGen.loadDOM());
- // If the predicate's Step is simply '.' we translate this Step
- // and place the node test on top of the resulting iterator
- if (step.isAbbreviatedDot()) {
- translateStep(classGen, methodGen, predicateIndex);
- il.append(new ICONST(DOM.RETURN_CURRENT));
- }
- // Otherwise we create a parent location path with this Step and
- // the predicates Step, and place the node test on top of that
- else {
- ParentLocationPath path = new ParentLocationPath(this, step);
- _parent = step._parent = path; // Force re-parenting
-
- try {
- path.typeCheck(getParser().getSymbolTable());
- }
- catch (TypeCheckError e) { }
- translateStep(classGen, methodGen, predicateIndex);
- path.translateStep(classGen, methodGen);
- il.append(new ICONST(DOM.RETURN_PARENT));
- }
- predicate.translate(classGen, methodGen);
- idx = cpg.addInterfaceMethodref(DOM_INTF,
- GET_NODE_VALUE_ITERATOR,
- GET_NODE_VALUE_ITERATOR_SIG);
- il.append(new INVOKEINTERFACE(idx, 5));
- }
- // Handle '//*[n]' expression
- else if (predicate.isNthDescendant()) {
- il.append(methodGen.loadDOM());
- // il.append(new ICONST(NodeTest.ELEMENT));
- il.append(new PUSH(cpg, predicate.getPosType()));
- predicate.translate(classGen, methodGen);
- il.append(new ICONST(0));
- idx = cpg.addInterfaceMethodref(DOM_INTF,
- "getNthDescendant",
- "(IIZ)"+NODE_ITERATOR_SIG);
- il.append(new INVOKEINTERFACE(idx, 4));
- }
- // Handle 'elem[n]' expression
- else if (predicate.isNthPositionFilter()) {
- idx = cpg.addMethodref(NTH_ITERATOR_CLASS,
- "<init>",
- "("+NODE_ITERATOR_SIG+"I)V");
-
- // Backwards branches are prohibited if an uninitialized object
- // is on the stack by section 4.9.4 of the JVM Specification,
- // 2nd Ed. We don't know whether this code might contain
- // backwards branches, so we mustn't create the new object until
- // after we've created the suspect arguments to its constructor.
- // Instead we calculate the values of the arguments to the
- // constructor first, store them in temporary variables, create
- // the object and reload the arguments from the temporaries to
- // avoid the problem.
- translatePredicates(classGen, methodGen, predicateIndex); // recursive call
- LocalVariableGen iteratorTemp
- = methodGen.addLocalVariable("step_tmp1",
- Util.getJCRefType(NODE_ITERATOR_SIG),
- null, null);
- iteratorTemp.setStart(
- il.append(new ASTORE(iteratorTemp.getIndex())));
-
- predicate.translate(classGen, methodGen);
- LocalVariableGen predicateValueTemp
- = methodGen.addLocalVariable("step_tmp2",
- Util.getJCRefType("I"),
- null, null);
- predicateValueTemp.setStart(
- il.append(new ISTORE(predicateValueTemp.getIndex())));
-
- il.append(new NEW(cpg.addClass(NTH_ITERATOR_CLASS)));
- il.append(DUP);
- iteratorTemp.setEnd(
- il.append(new ALOAD(iteratorTemp.getIndex())));
- predicateValueTemp.setEnd(
- il.append(new ILOAD(predicateValueTemp.getIndex())));
- il.append(new INVOKESPECIAL(idx));
- }
- else {
- idx = cpg.addMethodref(CURRENT_NODE_LIST_ITERATOR,
- "<init>",
- "("
- + NODE_ITERATOR_SIG
- + CURRENT_NODE_LIST_FILTER_SIG
- + NODE_SIG
- + TRANSLET_SIG
- + ")V");
-
- // Backwards branches are prohibited if an uninitialized object
- // is on the stack by section 4.9.4 of the JVM Specification,
- // 2nd Ed. We don't know whether this code might contain
- // backwards branches, so we mustn't create the new object until
- // after we've created the suspect arguments to its constructor.
- // Instead we calculate the values of the arguments to the
- // constructor first, store them in temporary variables, create
- // the object and reload the arguments from the temporaries to
- // avoid the problem.
- translatePredicates(classGen, methodGen, predicateIndex); // recursive call
- LocalVariableGen iteratorTemp
- = methodGen.addLocalVariable("step_tmp1",
- Util.getJCRefType(NODE_ITERATOR_SIG),
- null, null);
- iteratorTemp.setStart(
- il.append(new ASTORE(iteratorTemp.getIndex())));
-
- predicate.translateFilter(classGen, methodGen);
- LocalVariableGen filterTemp
- = methodGen.addLocalVariable("step_tmp2",
- Util.getJCRefType(CURRENT_NODE_LIST_FILTER_SIG),
- null, null);
- filterTemp.setStart(
- il.append(new ASTORE(filterTemp.getIndex())));
- // create new CurrentNodeListIterator
- il.append(new NEW(cpg.addClass(CURRENT_NODE_LIST_ITERATOR)));
- il.append(DUP);
-
- iteratorTemp.setEnd(
- il.append(new ALOAD(iteratorTemp.getIndex())));
- filterTemp.setEnd(il.append(new ALOAD(filterTemp.getIndex())));
-
- il.append(methodGen.loadCurrentNode());
- il.append(classGen.loadTranslet());
- if (classGen.isExternal()) {
- final String className = classGen.getClassName();
- il.append(new CHECKCAST(cpg.addClass(className)));
- }
- il.append(new INVOKESPECIAL(idx));
- }
- }
- }
-
- /**
- * Returns a string representation of this step.
- */
- public String toString() {
- final StringBuffer buffer = new StringBuffer("step(\"");
- buffer.append(Axis.getNames(_axis)).append("\", ").append(_nodeType);
- if (_predicates != null) {
- final int n = _predicates.size();
- for (int i = 0; i < n; i++) {
- final Predicate pred = (Predicate)_predicates.elementAt(i);
- buffer.append(", ").append(pred.toString());
- }
- }
- return buffer.append(')').toString();
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/StepPattern.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/StepPattern.java
deleted file mode 100644
index 82582ae..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/StepPattern.java
+++ /dev/null
@@ -1,534 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: StepPattern.java,v 1.2.4.1 2005/09/12 11:13:19 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import java.util.Vector;
-
-import com.sun.org.apache.bcel.internal.classfile.Field;
-import com.sun.org.apache.bcel.internal.generic.ALOAD;
-import com.sun.org.apache.bcel.internal.generic.ASTORE;
-import com.sun.org.apache.bcel.internal.generic.BranchHandle;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.GETFIELD;
-import com.sun.org.apache.bcel.internal.generic.GOTO;
-import com.sun.org.apache.bcel.internal.generic.GOTO_W;
-import com.sun.org.apache.bcel.internal.generic.IFLT;
-import com.sun.org.apache.bcel.internal.generic.IFNE;
-import com.sun.org.apache.bcel.internal.generic.IFNONNULL;
-import com.sun.org.apache.bcel.internal.generic.IF_ICMPEQ;
-import com.sun.org.apache.bcel.internal.generic.IF_ICMPLT;
-import com.sun.org.apache.bcel.internal.generic.IF_ICMPNE;
-import com.sun.org.apache.bcel.internal.generic.ILOAD;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
-import com.sun.org.apache.bcel.internal.generic.ISTORE;
-import com.sun.org.apache.bcel.internal.generic.InstructionHandle;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
-import com.sun.org.apache.bcel.internal.generic.NEW;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.bcel.internal.generic.PUTFIELD;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-import com.sun.org.apache.xml.internal.dtm.Axis;
-import com.sun.org.apache.xml.internal.dtm.DTM;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Erwin Bolwidt <ejb@klomp.org>
- */
-class StepPattern extends RelativePathPattern {
-
- private static final int NO_CONTEXT = 0;
- private static final int SIMPLE_CONTEXT = 1;
- private static final int GENERAL_CONTEXT = 2;
-
- protected final int _axis;
- protected final int _nodeType;
- protected Vector _predicates;
-
- private Step _step = null;
- private boolean _isEpsilon = false;
- private int _contextCase;
-
- private double _priority = Double.MAX_VALUE;
-
- public StepPattern(int axis, int nodeType, Vector predicates) {
- _axis = axis;
- _nodeType = nodeType;
- _predicates = predicates;
- }
-
- public void setParser(Parser parser) {
- super.setParser(parser);
- if (_predicates != null) {
- final int n = _predicates.size();
- for (int i = 0; i < n; i++) {
- final Predicate exp = (Predicate)_predicates.elementAt(i);
- exp.setParser(parser);
- exp.setParent(this);
- }
- }
- }
-
- public int getNodeType() {
- return _nodeType;
- }
-
- public void setPriority(double priority) {
- _priority = priority;
- }
-
- public StepPattern getKernelPattern() {
- return this;
- }
-
- public boolean isWildcard() {
- return _isEpsilon && hasPredicates() == false;
- }
-
- public StepPattern setPredicates(Vector predicates) {
- _predicates = predicates;
- return(this);
- }
-
- protected boolean hasPredicates() {
- return _predicates != null && _predicates.size() > 0;
- }
-
- public double getDefaultPriority() {
- if (_priority != Double.MAX_VALUE) {
- return _priority;
- }
-
- if (hasPredicates()) {
- return 0.5;
- }
- else {
- switch(_nodeType) {
- case -1:
- return -0.5; // node()
- case 0:
- return 0.0;
- default:
- return (_nodeType >= NodeTest.GTYPE) ? 0.0 : -0.5;
- }
- }
- }
-
- public int getAxis() {
- return _axis;
- }
-
- public void reduceKernelPattern() {
- _isEpsilon = true;
- }
-
- public String toString() {
- final StringBuffer buffer = new StringBuffer("stepPattern(\"");
- buffer.append(Axis.getNames(_axis))
- .append("\", ")
- .append(_isEpsilon ?
- ("epsilon{" + Integer.toString(_nodeType) + "}") :
- Integer.toString(_nodeType));
- if (_predicates != null)
- buffer.append(", ").append(_predicates.toString());
- return buffer.append(')').toString();
- }
-
- private int analyzeCases() {
- boolean noContext = true;
- final int n = _predicates.size();
-
- for (int i = 0; i < n && noContext; i++) {
- Predicate pred = (Predicate) _predicates.elementAt(i);
- if (pred.isNthPositionFilter() ||
- pred.hasPositionCall() ||
- pred.hasLastCall())
- {
- noContext = false;
- }
- }
-
- if (noContext) {
- return NO_CONTEXT;
- }
- else if (n == 1) {
- return SIMPLE_CONTEXT;
- }
- return GENERAL_CONTEXT;
- }
-
- private String getNextFieldName() {
- return "__step_pattern_iter_" + getXSLTC().nextStepPatternSerial();
- }
-
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- if (hasPredicates()) {
- // Type check all the predicates (e -> position() = e)
- final int n = _predicates.size();
- for (int i = 0; i < n; i++) {
- final Predicate pred = (Predicate)_predicates.elementAt(i);
- pred.typeCheck(stable);
- }
-
- // Analyze context cases
- _contextCase = analyzeCases();
-
- Step step = null;
-
- // Create an instance of Step to do the translation
- if (_contextCase == SIMPLE_CONTEXT) {
- Predicate pred = (Predicate)_predicates.elementAt(0);
- if (pred.isNthPositionFilter()) {
- _contextCase = GENERAL_CONTEXT;
- step = new Step(_axis, _nodeType, _predicates);
- } else {
- step = new Step(_axis, _nodeType, null);
- }
- } else if (_contextCase == GENERAL_CONTEXT) {
- final int len = _predicates.size();
- for (int i = 0; i < len; i++) {
- ((Predicate)_predicates.elementAt(i)).dontOptimize();
- }
-
- step = new Step(_axis, _nodeType, _predicates);
- }
-
- if (step != null) {
- step.setParser(getParser());
- step.typeCheck(stable);
- _step = step;
- }
- }
- return _axis == Axis.CHILD ? Type.Element : Type.Attribute;
- }
-
- private void translateKernel(ClassGenerator classGen,
- MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- if (_nodeType == DTM.ELEMENT_NODE) {
- final int check = cpg.addInterfaceMethodref(DOM_INTF,
- "isElement", "(I)Z");
- il.append(methodGen.loadDOM());
- il.append(SWAP);
- il.append(new INVOKEINTERFACE(check, 2));
-
- // Need to allow for long jumps here
- final BranchHandle icmp = il.append(new IFNE(null));
- _falseList.add(il.append(new GOTO_W(null)));
- icmp.setTarget(il.append(NOP));
- }
- else if (_nodeType == DTM.ATTRIBUTE_NODE) {
- final int check = cpg.addInterfaceMethodref(DOM_INTF,
- "isAttribute", "(I)Z");
- il.append(methodGen.loadDOM());
- il.append(SWAP);
- il.append(new INVOKEINTERFACE(check, 2));
-
- // Need to allow for long jumps here
- final BranchHandle icmp = il.append(new IFNE(null));
- _falseList.add(il.append(new GOTO_W(null)));
- icmp.setTarget(il.append(NOP));
- }
- else {
- // context node is on the stack
- final int getEType = cpg.addInterfaceMethodref(DOM_INTF,
- "getExpandedTypeID",
- "(I)I");
- il.append(methodGen.loadDOM());
- il.append(SWAP);
- il.append(new INVOKEINTERFACE(getEType, 2));
- il.append(new PUSH(cpg, _nodeType));
-
- // Need to allow for long jumps here
- final BranchHandle icmp = il.append(new IF_ICMPEQ(null));
- _falseList.add(il.append(new GOTO_W(null)));
- icmp.setTarget(il.append(NOP));
- }
- }
-
- private void translateNoContext(ClassGenerator classGen,
- MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- // Push current node on the stack
- il.append(methodGen.loadCurrentNode());
- il.append(SWAP);
-
- // Overwrite current node with matching node
- il.append(methodGen.storeCurrentNode());
-
- // If pattern not reduced then check kernel
- if (!_isEpsilon) {
- il.append(methodGen.loadCurrentNode());
- translateKernel(classGen, methodGen);
- }
-
- // Compile the expressions within the predicates
- final int n = _predicates.size();
- for (int i = 0; i < n; i++) {
- Predicate pred = (Predicate)_predicates.elementAt(i);
- Expression exp = pred.getExpr();
- exp.translateDesynthesized(classGen, methodGen);
- _trueList.append(exp._trueList);
- _falseList.append(exp._falseList);
- }
-
- // Backpatch true list and restore current iterator/node
- InstructionHandle restore;
- restore = il.append(methodGen.storeCurrentNode());
- backPatchTrueList(restore);
- BranchHandle skipFalse = il.append(new GOTO(null));
-
- // Backpatch false list and restore current iterator/node
- restore = il.append(methodGen.storeCurrentNode());
- backPatchFalseList(restore);
- _falseList.add(il.append(new GOTO(null)));
-
- // True list falls through
- skipFalse.setTarget(il.append(NOP));
- }
-
- private void translateSimpleContext(ClassGenerator classGen,
- MethodGenerator methodGen) {
- int index;
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- // Store matching node into a local variable
- LocalVariableGen match;
- match = methodGen.addLocalVariable("step_pattern_tmp1",
- Util.getJCRefType(NODE_SIG),
- null, null);
- match.setStart(il.append(new ISTORE(match.getIndex())));
-
- // If pattern not reduced then check kernel
- if (!_isEpsilon) {
- il.append(new ILOAD(match.getIndex()));
- translateKernel(classGen, methodGen);
- }
-
- // Push current iterator and current node on the stack
- il.append(methodGen.loadCurrentNode());
- il.append(methodGen.loadIterator());
-
- // Create a new matching iterator using the matching node
- index = cpg.addMethodref(MATCHING_ITERATOR, "<init>",
- "(I" + NODE_ITERATOR_SIG + ")V");
-
- // Backwards branches are prohibited if an uninitialized object is
- // on the stack by section 4.9.4 of the JVM Specification, 2nd Ed.
- // We don't know whether this code might contain backwards branches,
- // so we mustn't create the new object until after we've created
- // the suspect arguments to its constructor. Instead we calculate
- // the values of the arguments to the constructor first, store them
- // in temporary variables, create the object and reload the
- // arguments from the temporaries to avoid the problem.
-
- _step.translate(classGen, methodGen);
- LocalVariableGen stepIteratorTemp =
- methodGen.addLocalVariable("step_pattern_tmp2",
- Util.getJCRefType(NODE_ITERATOR_SIG),
- null, null);
- stepIteratorTemp.setStart(
- il.append(new ASTORE(stepIteratorTemp.getIndex())));
-
- il.append(new NEW(cpg.addClass(MATCHING_ITERATOR)));
- il.append(DUP);
- il.append(new ILOAD(match.getIndex()));
- stepIteratorTemp.setEnd(
- il.append(new ALOAD(stepIteratorTemp.getIndex())));
- il.append(new INVOKESPECIAL(index));
-
- // Get the parent of the matching node
- il.append(methodGen.loadDOM());
- il.append(new ILOAD(match.getIndex()));
- index = cpg.addInterfaceMethodref(DOM_INTF, GET_PARENT, GET_PARENT_SIG);
- il.append(new INVOKEINTERFACE(index, 2));
-
- // Start the iterator with the parent
- il.append(methodGen.setStartNode());
-
- // Overwrite current iterator and current node
- il.append(methodGen.storeIterator());
- match.setEnd(il.append(new ILOAD(match.getIndex())));
- il.append(methodGen.storeCurrentNode());
-
- // Translate the expression of the predicate
- Predicate pred = (Predicate) _predicates.elementAt(0);
- Expression exp = pred.getExpr();
- exp.translateDesynthesized(classGen, methodGen);
-
- // Backpatch true list and restore current iterator/node
- InstructionHandle restore = il.append(methodGen.storeIterator());
- il.append(methodGen.storeCurrentNode());
- exp.backPatchTrueList(restore);
- BranchHandle skipFalse = il.append(new GOTO(null));
-
- // Backpatch false list and restore current iterator/node
- restore = il.append(methodGen.storeIterator());
- il.append(methodGen.storeCurrentNode());
- exp.backPatchFalseList(restore);
- _falseList.add(il.append(new GOTO(null)));
-
- // True list falls through
- skipFalse.setTarget(il.append(NOP));
- }
-
- private void translateGeneralContext(ClassGenerator classGen,
- MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- int iteratorIndex = 0;
- BranchHandle ifBlock = null;
- LocalVariableGen iter, node, node2;
- final String iteratorName = getNextFieldName();
-
- // Store node on the stack into a local variable
- node = methodGen.addLocalVariable("step_pattern_tmp1",
- Util.getJCRefType(NODE_SIG),
- null, null);
- node.setStart(il.append(new ISTORE(node.getIndex())));
-
- // Create a new local to store the iterator
- iter = methodGen.addLocalVariable("step_pattern_tmp2",
- Util.getJCRefType(NODE_ITERATOR_SIG),
- null, null);
-
- // Add a new private field if this is the main class
- if (!classGen.isExternal()) {
- final Field iterator =
- new Field(ACC_PRIVATE,
- cpg.addUtf8(iteratorName),
- cpg.addUtf8(NODE_ITERATOR_SIG),
- null, cpg.getConstantPool());
- classGen.addField(iterator);
- iteratorIndex = cpg.addFieldref(classGen.getClassName(),
- iteratorName,
- NODE_ITERATOR_SIG);
-
- il.append(classGen.loadTranslet());
- il.append(new GETFIELD(iteratorIndex));
- il.append(DUP);
- iter.setStart(il.append(new ASTORE(iter.getIndex())));
- ifBlock = il.append(new IFNONNULL(null));
- il.append(classGen.loadTranslet());
- }
-
- // Compile the step created at type checking time
- _step.translate(classGen, methodGen);
- InstructionHandle iterStore = il.append(new ASTORE(iter.getIndex()));
-
- // If in the main class update the field too
- if (!classGen.isExternal()) {
- il.append(new ALOAD(iter.getIndex()));
- il.append(new PUTFIELD(iteratorIndex));
- ifBlock.setTarget(il.append(NOP));
- } else {
- // If class is not external, start of range for iter variable was
- // set above
- iter.setStart(iterStore);
- }
-
- // Get the parent of the node on the stack
- il.append(methodGen.loadDOM());
- il.append(new ILOAD(node.getIndex()));
- int index = cpg.addInterfaceMethodref(DOM_INTF,
- GET_PARENT, GET_PARENT_SIG);
- il.append(new INVOKEINTERFACE(index, 2));
-
- // Initialize the iterator with the parent
- il.append(new ALOAD(iter.getIndex()));
- il.append(SWAP);
- il.append(methodGen.setStartNode());
-
- /*
- * Inline loop:
- *
- * int node2;
- * while ((node2 = iter.next()) != NodeIterator.END
- * && node2 < node);
- * return node2 == node;
- */
- BranchHandle skipNext;
- InstructionHandle begin, next;
- node2 = methodGen.addLocalVariable("step_pattern_tmp3",
- Util.getJCRefType(NODE_SIG),
- null, null);
-
- skipNext = il.append(new GOTO(null));
- next = il.append(new ALOAD(iter.getIndex()));
- node2.setStart(next);
- begin = il.append(methodGen.nextNode());
- il.append(DUP);
- il.append(new ISTORE(node2.getIndex()));
- _falseList.add(il.append(new IFLT(null))); // NodeIterator.END
-
- il.append(new ILOAD(node2.getIndex()));
- il.append(new ILOAD(node.getIndex()));
- iter.setEnd(il.append(new IF_ICMPLT(next)));
-
- node2.setEnd(il.append(new ILOAD(node2.getIndex())));
- node.setEnd(il.append(new ILOAD(node.getIndex())));
- _falseList.add(il.append(new IF_ICMPNE(null)));
-
- skipNext.setTarget(begin);
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- if (hasPredicates()) {
- switch (_contextCase) {
- case NO_CONTEXT:
- translateNoContext(classGen, methodGen);
- break;
-
- case SIMPLE_CONTEXT:
- translateSimpleContext(classGen, methodGen);
- break;
-
- default:
- translateGeneralContext(classGen, methodGen);
- break;
- }
- }
- else if (isWildcard()) {
- il.append(POP); // true list falls through
- }
- else {
- translateKernel(classGen, methodGen);
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/StringCall.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/StringCall.java
deleted file mode 100644
index ce2d98a..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/StringCall.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: StringCall.java,v 1.2.4.1 2005/09/05 09:08:15 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import java.util.Vector;
-
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-final class StringCall extends FunctionCall {
- public StringCall(QName fname, Vector arguments) {
- super(fname, arguments);
- }
-
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- final int argc = argumentCount();
- if (argc > 1) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.ILLEGAL_ARG_ERR, this);
- throw new TypeCheckError(err);
- }
-
- if (argc > 0) {
- argument().typeCheck(stable);
- }
- return _type = Type.String;
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final InstructionList il = methodGen.getInstructionList();
- Type targ;
-
- if (argumentCount() == 0) {
- il.append(methodGen.loadContextNode());
- targ = Type.Node;
- }
- else {
- final Expression arg = argument();
- arg.translate(classGen, methodGen);
- arg.startIterator(classGen, methodGen);
- targ = arg.getType();
- }
-
- if (!targ.identicalTo(Type.String)) {
- targ.translateTo(classGen, methodGen, Type.String);
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/StringLengthCall.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/StringLengthCall.java
deleted file mode 100644
index 212a6d8..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/StringLengthCall.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: StringLengthCall.java,v 1.2.4.1 2005/09/05 09:08:46 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import java.util.Vector;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-final class StringLengthCall extends FunctionCall {
- public StringLengthCall(QName fname, Vector arguments) {
- super(fname, arguments);
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- if (argumentCount() > 0) {
- argument().translate(classGen, methodGen);
- }
- else {
- il.append(methodGen.loadContextNode());
- Type.Node.translateTo(classGen, methodGen, Type.String);
- }
- il.append(new INVOKESTATIC(cpg.addMethodref(BASIS_LIBRARY_CLASS,
- "getStringLength",
- "(Ljava/lang/String;)I")));
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Stylesheet.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Stylesheet.java
deleted file mode 100644
index 09061ea..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Stylesheet.java
+++ /dev/null
@@ -1,1447 +0,0 @@
-/*
- * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Stylesheet.java,v 1.5 2005/09/28 13:48:16 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.ANEWARRAY;
-import com.sun.org.apache.bcel.internal.generic.BasicType;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.FieldGen;
-import com.sun.org.apache.bcel.internal.generic.GETFIELD;
-import com.sun.org.apache.bcel.internal.generic.GETSTATIC;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
-import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
-import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
-import com.sun.org.apache.bcel.internal.generic.ISTORE;
-import com.sun.org.apache.bcel.internal.generic.InstructionHandle;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
-import com.sun.org.apache.bcel.internal.generic.NEW;
-import com.sun.org.apache.bcel.internal.generic.NEWARRAY;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.bcel.internal.generic.PUTFIELD;
-import com.sun.org.apache.bcel.internal.generic.PUTSTATIC;
-import com.sun.org.apache.bcel.internal.generic.TargetLostException;
-import com.sun.org.apache.bcel.internal.util.InstructionFinder;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet;
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.utils.SystemIDResolver;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.StringTokenizer;
-import java.util.Vector;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- */
-public final class Stylesheet extends SyntaxTreeNode {
-
- /**
- * XSLT version defined in the stylesheet.
- */
- private String _version;
-
- /**
- * Internal name of this stylesheet used as a key into the symbol table.
- */
- private QName _name;
-
- /**
- * A URI that represents the system ID for this stylesheet.
- */
- private String _systemId;
-
- /**
- * A reference to the parent stylesheet or null if topmost.
- */
- private Stylesheet _parentStylesheet;
-
- /**
- * Contains global variables and parameters defined in the stylesheet.
- */
- private Vector _globals = new Vector();
-
- /**
- * Used to cache the result returned by <code>hasLocalParams()</code>.
- */
- private Boolean _hasLocalParams = null;
-
- /**
- * The name of the class being generated.
- */
- private String _className;
-
- /**
- * Contains all templates defined in this stylesheet
- */
- private final Vector _templates = new Vector();
-
- /**
- * Used to cache result of <code>getAllValidTemplates()</code>. Only
- * set in top-level stylesheets that include/import other stylesheets.
- */
- private Vector _allValidTemplates = null;
-
- /**
- * Counter to generate unique mode suffixes.
- */
- private int _nextModeSerial = 1;
-
- /**
- * Mapping between mode names and Mode instances.
- */
- private final Map<String, Mode> _modes = new HashMap<>();
-
- /**
- * A reference to the default Mode object.
- */
- private Mode _defaultMode;
-
- /**
- * Mapping between extension URIs and their prefixes.
- */
- private final Map<String, String> _extensions = new HashMap<>();
-
- /**
- * Reference to the stylesheet from which this stylesheet was
- * imported (if any).
- */
- public Stylesheet _importedFrom = null;
-
- /**
- * Reference to the stylesheet from which this stylesheet was
- * included (if any).
- */
- public Stylesheet _includedFrom = null;
-
- /**
- * Array of all the stylesheets imported or included from this one.
- */
- private Vector _includedStylesheets = null;
-
- /**
- * Import precendence for this stylesheet.
- */
- private int _importPrecedence = 1;
-
- /**
- * Minimum precendence of any descendant stylesheet by inclusion or
- * importation.
- */
- private int _minimumDescendantPrecedence = -1;
-
- /**
- * Mapping between key names and Key objects (needed by Key/IdPattern).
- */
- private Map<String, Key> _keys = new HashMap<>();
-
- /**
- * A reference to the SourceLoader set by the user (a URIResolver
- * if the JAXP API is being used).
- */
- private SourceLoader _loader = null;
-
- /**
- * Flag indicating if format-number() is called.
- */
- private boolean _numberFormattingUsed = false;
-
- /**
- * Flag indicating if this is a simplified stylesheets. A template
- * matching on "/" must be added in this case.
- */
- private boolean _simplified = false;
-
- /**
- * Flag indicating if multi-document support is needed.
- */
- private boolean _multiDocument = false;
-
- /**
- * Flag indicating if nodset() is called.
- */
- private boolean _callsNodeset = false;
-
- /**
- * Flag indicating if id() is called.
- */
- private boolean _hasIdCall = false;
-
- /**
- * Set to true to enable template inlining optimization.
- * @see XSLTC#_templateInlining
- */
- private boolean _templateInlining = false;
-
- /**
- * A reference to the last xsl:output object found in the styleshet.
- */
- private Output _lastOutputElement = null;
-
- /**
- * Output properties for this stylesheet.
- */
- private Properties _outputProperties = null;
-
- /**
- * Output method for this stylesheet (must be set to one of
- * the constants defined below).
- */
- private int _outputMethod = UNKNOWN_OUTPUT;
-
- // Output method constants
- public static final int UNKNOWN_OUTPUT = 0;
- public static final int XML_OUTPUT = 1;
- public static final int HTML_OUTPUT = 2;
- public static final int TEXT_OUTPUT = 3;
-
- /**
- * Return the output method
- */
- public int getOutputMethod() {
- return _outputMethod;
- }
-
- /**
- * Check and set the output method
- */
- private void checkOutputMethod() {
- if (_lastOutputElement != null) {
- String method = _lastOutputElement.getOutputMethod();
- if (method != null) {
- if (method.equals("xml"))
- _outputMethod = XML_OUTPUT;
- else if (method.equals("html"))
- _outputMethod = HTML_OUTPUT;
- else if (method.equals("text"))
- _outputMethod = TEXT_OUTPUT;
- }
- }
- }
-
- public boolean getTemplateInlining() {
- return _templateInlining;
- }
-
- public void setTemplateInlining(boolean flag) {
- _templateInlining = flag;
- }
-
- public boolean isSimplified() {
- return(_simplified);
- }
-
- public void setSimplified() {
- _simplified = true;
- }
-
- public void setHasIdCall(boolean flag) {
- _hasIdCall = flag;
- }
-
- public void setOutputProperty(String key, String value) {
- if (_outputProperties == null) {
- _outputProperties = new Properties();
- }
- _outputProperties.setProperty(key, value);
- }
-
- public void setOutputProperties(Properties props) {
- _outputProperties = props;
- }
-
- public Properties getOutputProperties() {
- return _outputProperties;
- }
-
- public Output getLastOutputElement() {
- return _lastOutputElement;
- }
-
- public void setMultiDocument(boolean flag) {
- _multiDocument = flag;
- }
-
- public boolean isMultiDocument() {
- return _multiDocument;
- }
-
- public void setCallsNodeset(boolean flag) {
- if (flag) setMultiDocument(flag);
- _callsNodeset = flag;
- }
-
- public boolean callsNodeset() {
- return _callsNodeset;
- }
-
- public void numberFormattingUsed() {
- _numberFormattingUsed = true;
- /*
- * Fix for bug 23046, if the stylesheet is included, set the
- * numberFormattingUsed flag to the parent stylesheet too.
- * AbstractTranslet.addDecimalFormat() will be inlined once for the
- * outer most stylesheet.
- */
- Stylesheet parent = getParentStylesheet();
- if (null != parent) parent.numberFormattingUsed();
- }
-
- public void setImportPrecedence(final int precedence) {
- // Set import precedence for this stylesheet
- _importPrecedence = precedence;
-
- // Set import precedence for all included stylesheets
- final Iterator<SyntaxTreeNode> elements = elements();
- while (elements.hasNext()) {
- SyntaxTreeNode child = elements.next();
- if (child instanceof Include) {
- Stylesheet included = ((Include)child).getIncludedStylesheet();
- if (included != null && included._includedFrom == this) {
- included.setImportPrecedence(precedence);
- }
- }
- }
-
- // Set import precedence for the stylesheet that imported this one
- if (_importedFrom != null) {
- if (_importedFrom.getImportPrecedence() < precedence) {
- final Parser parser = getParser();
- final int nextPrecedence = parser.getNextImportPrecedence();
- _importedFrom.setImportPrecedence(nextPrecedence);
- }
- }
- // Set import precedence for the stylesheet that included this one
- else if (_includedFrom != null) {
- if (_includedFrom.getImportPrecedence() != precedence)
- _includedFrom.setImportPrecedence(precedence);
- }
- }
-
- public int getImportPrecedence() {
- return _importPrecedence;
- }
-
- /**
- * Get the minimum of the precedence of this stylesheet, any stylesheet
- * imported by this stylesheet and any include/import descendant of this
- * stylesheet.
- */
- public int getMinimumDescendantPrecedence() {
- if (_minimumDescendantPrecedence == -1) {
- // Start with precedence of current stylesheet as a basis.
- int min = getImportPrecedence();
-
- // Recursively examine all imported/included stylesheets.
- final int inclImpCount = (_includedStylesheets != null)
- ? _includedStylesheets.size()
- : 0;
-
- for (int i = 0; i < inclImpCount; i++) {
- int prec = ((Stylesheet)_includedStylesheets.elementAt(i))
- .getMinimumDescendantPrecedence();
-
- if (prec < min) {
- min = prec;
- }
- }
-
- _minimumDescendantPrecedence = min;
- }
- return _minimumDescendantPrecedence;
- }
-
- public boolean checkForLoop(String systemId) {
- // Return true if this stylesheet includes/imports itself
- if (_systemId != null && _systemId.equals(systemId)) {
- return true;
- }
- // Then check with any stylesheets that included/imported this one
- if (_parentStylesheet != null)
- return _parentStylesheet.checkForLoop(systemId);
- // Otherwise OK
- return false;
- }
-
- public void setParser(Parser parser) {
- super.setParser(parser);
- _name = makeStylesheetName("__stylesheet_");
- }
-
- public void setParentStylesheet(Stylesheet parent) {
- _parentStylesheet = parent;
- }
-
- public Stylesheet getParentStylesheet() {
- return _parentStylesheet;
- }
-
- public void setImportingStylesheet(Stylesheet parent) {
- _importedFrom = parent;
- parent.addIncludedStylesheet(this);
- }
-
- public void setIncludingStylesheet(Stylesheet parent) {
- _includedFrom = parent;
- parent.addIncludedStylesheet(this);
- }
-
- public void addIncludedStylesheet(Stylesheet child) {
- if (_includedStylesheets == null) {
- _includedStylesheets = new Vector();
- }
- _includedStylesheets.addElement(child);
- }
-
- public void setSystemId(String systemId) {
- if (systemId != null) {
- _systemId = SystemIDResolver.getAbsoluteURI(systemId);
- }
- }
-
- public String getSystemId() {
- return _systemId;
- }
-
- public void setSourceLoader(SourceLoader loader) {
- _loader = loader;
- }
-
- public SourceLoader getSourceLoader() {
- return _loader;
- }
-
- private QName makeStylesheetName(String prefix) {
- return getParser().getQName(prefix+getXSLTC().nextStylesheetSerial());
- }
-
- /**
- * Returns true if this stylesheet has global vars or params.
- */
- public boolean hasGlobals() {
- return _globals.size() > 0;
- }
-
- /**
- * Returns true if at least one template in the stylesheet has params
- * defined. Uses the variable <code>_hasLocalParams</code> to cache the
- * result.
- */
- public boolean hasLocalParams() {
- if (_hasLocalParams == null) {
- Vector templates = getAllValidTemplates();
- final int n = templates.size();
- for (int i = 0; i < n; i++) {
- final Template template = (Template)templates.elementAt(i);
- if (template.hasParams()) {
- _hasLocalParams = Boolean.TRUE;
- return true;
- }
- }
- _hasLocalParams = Boolean.FALSE;
- return false;
- }
- else {
- return _hasLocalParams.booleanValue();
- }
- }
-
- /**
- * Adds a single prefix mapping to this syntax tree node.
- * @param prefix Namespace prefix.
- * @param uri Namespace URI.
- */
- protected void addPrefixMapping(String prefix, String uri) {
- if (prefix.equals(EMPTYSTRING) && uri.equals(XHTML_URI)) return;
- super.addPrefixMapping(prefix, uri);
- }
-
- /**
- * Store extension URIs
- */
- private void extensionURI(String prefixes, SymbolTable stable) {
- if (prefixes != null) {
- StringTokenizer tokens = new StringTokenizer(prefixes);
- while (tokens.hasMoreTokens()) {
- final String prefix = tokens.nextToken();
- final String uri = lookupNamespace(prefix);
- if (uri != null) {
- _extensions.put(uri, prefix);
- }
- }
- }
- }
-
- public boolean isExtension(String uri) {
- return (_extensions.get(uri) != null);
- }
-
- public void declareExtensionPrefixes(Parser parser) {
- final SymbolTable stable = parser.getSymbolTable();
- final String extensionPrefixes = getAttribute("extension-element-prefixes");
- extensionURI(extensionPrefixes, stable);
- }
-
- /**
- * Parse the version and uri fields of the stylesheet and add an
- * entry to the symbol table mapping the name <tt>__stylesheet_</tt>
- * to an instance of this class.
- */
- public void parseContents(Parser parser) {
- final SymbolTable stable = parser.getSymbolTable();
-
- /*
- // Make sure the XSL version set in this stylesheet
- if ((_version == null) || (_version.equals(EMPTYSTRING))) {
- reportError(this, parser, ErrorMsg.REQUIRED_ATTR_ERR,"version");
- }
- // Verify that the version is 1.0 and nothing else
- else if (!_version.equals("1.0")) {
- reportError(this, parser, ErrorMsg.XSL_VERSION_ERR, _version);
- }
- */
-
- // Add the implicit mapping of 'xml' to the XML namespace URI
- addPrefixMapping("xml", "http://www.w3.org/XML/1998/namespace");
-
- // Report and error if more than one stylesheet defined
- final Stylesheet sheet = stable.addStylesheet(_name, this);
- if (sheet != null) {
- // Error: more that one stylesheet defined
- ErrorMsg err = new ErrorMsg(ErrorMsg.MULTIPLE_STYLESHEET_ERR,this);
- parser.reportError(Constants.ERROR, err);
- }
-
- // If this is a simplified stylesheet we must create a template that
- // grabs the root node of the input doc ( <xsl:template match="/"/> ).
- // This template needs the current element (the one passed to this
- // method) as its only child, so the Template class has a special
- // method that handles this (parseSimplified()).
- if (_simplified) {
- stable.excludeURI(XSLT_URI);
- Template template = new Template();
- template.parseSimplified(this, parser);
- }
- // Parse the children of this node
- else {
- parseOwnChildren(parser);
- }
- }
-
- /**
- * Parse all direct children of the <xsl:stylesheet/> element.
- */
- public final void parseOwnChildren(Parser parser) {
- final SymbolTable stable = parser.getSymbolTable();
- final String excludePrefixes = getAttribute("exclude-result-prefixes");
- final String extensionPrefixes = getAttribute("extension-element-prefixes");
-
- // Exclude XSLT uri
- stable.pushExcludedNamespacesContext();
- stable.excludeURI(Constants.XSLT_URI);
- stable.excludeNamespaces(excludePrefixes);
- stable.excludeNamespaces(extensionPrefixes);
-
- final List<SyntaxTreeNode> contents = getContents();
- final int count = contents.size();
-
- // We have to scan the stylesheet element's top-level elements for
- // variables and/or parameters before we parse the other elements
- for (int i = 0; i < count; i++) {
- SyntaxTreeNode child = contents.get(i);
- if ((child instanceof VariableBase) ||
- (child instanceof NamespaceAlias)) {
- parser.getSymbolTable().setCurrentNode(child);
- child.parseContents(parser);
- }
- }
-
- // Now go through all the other top-level elements...
- for (int i = 0; i < count; i++) {
- SyntaxTreeNode child = contents.get(i);
- if (!(child instanceof VariableBase) &&
- !(child instanceof NamespaceAlias)) {
- parser.getSymbolTable().setCurrentNode(child);
- child.parseContents(parser);
- }
-
- // All template code should be compiled as methods if the
- // <xsl:apply-imports/> element was ever used in this stylesheet
- if (!_templateInlining && (child instanceof Template)) {
- Template template = (Template)child;
- String name = "template$dot$" + template.getPosition();
- template.setName(parser.getQName(name));
- }
- }
-
- stable.popExcludedNamespacesContext();
- }
-
- public void processModes() {
- if (_defaultMode == null)
- _defaultMode = new Mode(null, this, Constants.EMPTYSTRING);
- _defaultMode.processPatterns(_keys);
- for (Mode mode : _modes.values()) {
- mode.processPatterns(_keys);
- }
- }
-
- private void compileModes(ClassGenerator classGen) {
- _defaultMode.compileApplyTemplates(classGen);
- for (Mode mode : _modes.values()) {
- mode.compileApplyTemplates(classGen);
- }
- }
-
- public Mode getMode(QName modeName) {
- if (modeName == null) {
- if (_defaultMode == null) {
- _defaultMode = new Mode(null, this, Constants.EMPTYSTRING);
- }
- return _defaultMode;
- }
- else {
- Mode mode = _modes.get(modeName.getStringRep());
- if (mode == null) {
- final String suffix = Integer.toString(_nextModeSerial++);
- _modes.put(modeName.getStringRep(), mode = new Mode(modeName, this, suffix));
- }
- return mode;
- }
- }
-
- /**
- * Type check all the children of this node.
- */
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- final int count = _globals.size();
- for (int i = 0; i < count; i++) {
- final VariableBase var = (VariableBase)_globals.elementAt(i);
- var.typeCheck(stable);
- }
- return typeCheckContents(stable);
- }
-
- /**
- * Translate the stylesheet into JVM bytecodes.
- */
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- translate();
- }
-
- private void addDOMField(ClassGenerator classGen) {
- final FieldGen fgen = new FieldGen(ACC_PUBLIC,
- Util.getJCRefType(DOM_INTF_SIG),
- DOM_FIELD,
- classGen.getConstantPool());
- classGen.addField(fgen.getField());
- }
-
- /**
- * Add a static field
- */
- private void addStaticField(ClassGenerator classGen, String type,
- String name)
- {
- final FieldGen fgen = new FieldGen(ACC_PROTECTED|ACC_STATIC,
- Util.getJCRefType(type),
- name,
- classGen.getConstantPool());
- classGen.addField(fgen.getField());
-
- }
-
- /**
- * Translate the stylesheet into JVM bytecodes.
- */
- public void translate() {
- _className = getXSLTC().getClassName();
-
- // Define a new class by extending TRANSLET_CLASS
- final ClassGenerator classGen =
- new ClassGenerator(_className,
- TRANSLET_CLASS,
- Constants.EMPTYSTRING,
- ACC_PUBLIC | ACC_SUPER,
- null, this);
-
- addDOMField(classGen);
-
- // Compile transform() to initialize parameters, globals & output
- // and run the transformation
- compileTransform(classGen);
-
- // Translate all non-template elements and filter out all templates
- final Iterator<SyntaxTreeNode> elements = elements();
- while (elements.hasNext()) {
- SyntaxTreeNode element = elements.next();
- // xsl:template
- if (element instanceof Template) {
- // Separate templates by modes
- final Template template = (Template)element;
- //_templates.addElement(template);
- getMode(template.getModeName()).addTemplate(template);
- }
- // xsl:attribute-set
- else if (element instanceof AttributeSet) {
- ((AttributeSet)element).translate(classGen, null);
- }
- else if (element instanceof Output) {
- // save the element for later to pass to compileConstructor
- Output output = (Output)element;
- if (output.enabled()) _lastOutputElement = output;
- }
- else {
- // Global variables and parameters are handled elsewhere.
- // Other top-level non-template elements are ignored. Literal
- // elements outside of templates will never be output.
- }
- }
-
- checkOutputMethod();
- processModes();
- compileModes(classGen);
- compileStaticInitializer(classGen);
- compileConstructor(classGen, _lastOutputElement);
-
- if (!getParser().errorsFound()) {
- getXSLTC().dumpClass(classGen.getJavaClass());
- }
- }
-
- /**
- * Compile the namesArray, urisArray and typesArray into
- * the static initializer. They are read-only from the
- * translet. All translet instances can share a single
- * copy of this informtion.
- */
- private void compileStaticInitializer(ClassGenerator classGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = new InstructionList();
-
- final MethodGenerator staticConst =
- new MethodGenerator(ACC_PUBLIC|ACC_STATIC,
- com.sun.org.apache.bcel.internal.generic.Type.VOID,
- null, null, "<clinit>",
- _className, il, cpg);
-
- addStaticField(classGen, "[" + STRING_SIG, STATIC_NAMES_ARRAY_FIELD);
- addStaticField(classGen, "[" + STRING_SIG, STATIC_URIS_ARRAY_FIELD);
- addStaticField(classGen, "[I", STATIC_TYPES_ARRAY_FIELD);
- addStaticField(classGen, "[" + STRING_SIG, STATIC_NAMESPACE_ARRAY_FIELD);
- // Create fields of type char[] that will contain literal text from
- // the stylesheet.
- final int charDataFieldCount = getXSLTC().getCharacterDataCount();
- for (int i = 0; i < charDataFieldCount; i++) {
- addStaticField(classGen, STATIC_CHAR_DATA_FIELD_SIG,
- STATIC_CHAR_DATA_FIELD+i);
- }
-
- // Put the names array into the translet - used for dom/translet mapping
- final Vector namesIndex = getXSLTC().getNamesIndex();
- int size = namesIndex.size();
- String[] namesArray = new String[size];
- String[] urisArray = new String[size];
- int[] typesArray = new int[size];
-
- int index;
- for (int i = 0; i < size; i++) {
- String encodedName = (String)namesIndex.elementAt(i);
- if ((index = encodedName.lastIndexOf(':')) > -1) {
- urisArray[i] = encodedName.substring(0, index);
- }
-
- index = index + 1;
- if (encodedName.charAt(index) == '@') {
- typesArray[i] = DTM.ATTRIBUTE_NODE;
- index++;
- } else if (encodedName.charAt(index) == '?') {
- typesArray[i] = DTM.NAMESPACE_NODE;
- index++;
- } else {
- typesArray[i] = DTM.ELEMENT_NODE;
- }
-
- if (index == 0) {
- namesArray[i] = encodedName;
- }
- else {
- namesArray[i] = encodedName.substring(index);
- }
- }
-
- staticConst.markChunkStart();
- il.append(new PUSH(cpg, size));
- il.append(new ANEWARRAY(cpg.addClass(STRING)));
- int namesArrayRef = cpg.addFieldref(_className,
- STATIC_NAMES_ARRAY_FIELD,
- NAMES_INDEX_SIG);
- il.append(new PUTSTATIC(namesArrayRef));
- staticConst.markChunkEnd();
-
- for (int i = 0; i < size; i++) {
- final String name = namesArray[i];
- staticConst.markChunkStart();
- il.append(new GETSTATIC(namesArrayRef));
- il.append(new PUSH(cpg, i));
- il.append(new PUSH(cpg, name));
- il.append(AASTORE);
- staticConst.markChunkEnd();
- }
-
- staticConst.markChunkStart();
- il.append(new PUSH(cpg, size));
- il.append(new ANEWARRAY(cpg.addClass(STRING)));
- int urisArrayRef = cpg.addFieldref(_className,
- STATIC_URIS_ARRAY_FIELD,
- URIS_INDEX_SIG);
- il.append(new PUTSTATIC(urisArrayRef));
- staticConst.markChunkEnd();
-
- for (int i = 0; i < size; i++) {
- final String uri = urisArray[i];
- staticConst.markChunkStart();
- il.append(new GETSTATIC(urisArrayRef));
- il.append(new PUSH(cpg, i));
- il.append(new PUSH(cpg, uri));
- il.append(AASTORE);
- staticConst.markChunkEnd();
- }
-
- staticConst.markChunkStart();
- il.append(new PUSH(cpg, size));
- il.append(new NEWARRAY(BasicType.INT));
- int typesArrayRef = cpg.addFieldref(_className,
- STATIC_TYPES_ARRAY_FIELD,
- TYPES_INDEX_SIG);
- il.append(new PUTSTATIC(typesArrayRef));
- staticConst.markChunkEnd();
-
- for (int i = 0; i < size; i++) {
- final int nodeType = typesArray[i];
- staticConst.markChunkStart();
- il.append(new GETSTATIC(typesArrayRef));
- il.append(new PUSH(cpg, i));
- il.append(new PUSH(cpg, nodeType));
- il.append(IASTORE);
- }
-
- // Put the namespace names array into the translet
- final Vector namespaces = getXSLTC().getNamespaceIndex();
- staticConst.markChunkStart();
- il.append(new PUSH(cpg, namespaces.size()));
- il.append(new ANEWARRAY(cpg.addClass(STRING)));
- int namespaceArrayRef = cpg.addFieldref(_className,
- STATIC_NAMESPACE_ARRAY_FIELD,
- NAMESPACE_INDEX_SIG);
- il.append(new PUTSTATIC(namespaceArrayRef));
- staticConst.markChunkEnd();
-
- for (int i = 0; i < namespaces.size(); i++) {
- final String ns = (String)namespaces.elementAt(i);
- staticConst.markChunkStart();
- il.append(new GETSTATIC(namespaceArrayRef));
- il.append(new PUSH(cpg, i));
- il.append(new PUSH(cpg, ns));
- il.append(AASTORE);
- staticConst.markChunkEnd();
- }
-
- // Grab all the literal text in the stylesheet and put it in a char[]
- final int charDataCount = getXSLTC().getCharacterDataCount();
- final int toCharArray = cpg.addMethodref(STRING, "toCharArray", "()[C");
- for (int i = 0; i < charDataCount; i++) {
- staticConst.markChunkStart();
- il.append(new PUSH(cpg, getXSLTC().getCharacterData(i)));
- il.append(new INVOKEVIRTUAL(toCharArray));
- il.append(new PUTSTATIC(cpg.addFieldref(_className,
- STATIC_CHAR_DATA_FIELD+i,
- STATIC_CHAR_DATA_FIELD_SIG)));
- staticConst.markChunkEnd();
- }
-
- il.append(RETURN);
-
- classGen.addMethod(staticConst);
-
- }
-
- /**
- * Compile the translet's constructor
- */
- private void compileConstructor(ClassGenerator classGen, Output output) {
-
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = new InstructionList();
-
- final MethodGenerator constructor =
- new MethodGenerator(ACC_PUBLIC,
- com.sun.org.apache.bcel.internal.generic.Type.VOID,
- null, null, "<init>",
- _className, il, cpg);
-
- // Call the constructor in the AbstractTranslet superclass
- il.append(classGen.loadTranslet());
- il.append(new INVOKESPECIAL(cpg.addMethodref(TRANSLET_CLASS,
- "<init>", "()V")));
-
- constructor.markChunkStart();
- il.append(classGen.loadTranslet());
- il.append(new GETSTATIC(cpg.addFieldref(_className,
- STATIC_NAMES_ARRAY_FIELD,
- NAMES_INDEX_SIG)));
- il.append(new PUTFIELD(cpg.addFieldref(TRANSLET_CLASS,
- NAMES_INDEX,
- NAMES_INDEX_SIG)));
-
- il.append(classGen.loadTranslet());
- il.append(new GETSTATIC(cpg.addFieldref(_className,
- STATIC_URIS_ARRAY_FIELD,
- URIS_INDEX_SIG)));
- il.append(new PUTFIELD(cpg.addFieldref(TRANSLET_CLASS,
- URIS_INDEX,
- URIS_INDEX_SIG)));
- constructor.markChunkEnd();
-
- constructor.markChunkStart();
- il.append(classGen.loadTranslet());
- il.append(new GETSTATIC(cpg.addFieldref(_className,
- STATIC_TYPES_ARRAY_FIELD,
- TYPES_INDEX_SIG)));
- il.append(new PUTFIELD(cpg.addFieldref(TRANSLET_CLASS,
- TYPES_INDEX,
- TYPES_INDEX_SIG)));
- constructor.markChunkEnd();
-
- constructor.markChunkStart();
- il.append(classGen.loadTranslet());
- il.append(new GETSTATIC(cpg.addFieldref(_className,
- STATIC_NAMESPACE_ARRAY_FIELD,
- NAMESPACE_INDEX_SIG)));
- il.append(new PUTFIELD(cpg.addFieldref(TRANSLET_CLASS,
- NAMESPACE_INDEX,
- NAMESPACE_INDEX_SIG)));
- constructor.markChunkEnd();
-
- constructor.markChunkStart();
- il.append(classGen.loadTranslet());
- il.append(new PUSH(cpg, AbstractTranslet.CURRENT_TRANSLET_VERSION));
- il.append(new PUTFIELD(cpg.addFieldref(TRANSLET_CLASS,
- TRANSLET_VERSION_INDEX,
- TRANSLET_VERSION_INDEX_SIG)));
- constructor.markChunkEnd();
-
- if (_hasIdCall) {
- constructor.markChunkStart();
- il.append(classGen.loadTranslet());
- il.append(new PUSH(cpg, Boolean.TRUE));
- il.append(new PUTFIELD(cpg.addFieldref(TRANSLET_CLASS,
- HASIDCALL_INDEX,
- HASIDCALL_INDEX_SIG)));
- constructor.markChunkEnd();
- }
-
- // Compile in code to set the output configuration from <xsl:output>
- if (output != null) {
- // Set all the output settings files in the translet
- constructor.markChunkStart();
- output.translate(classGen, constructor);
- constructor.markChunkEnd();
- }
-
- // Compile default decimal formatting symbols.
- // This is an implicit, nameless xsl:decimal-format top-level element.
- if (_numberFormattingUsed) {
- constructor.markChunkStart();
- DecimalFormatting.translateDefaultDFS(classGen, constructor);
- constructor.markChunkEnd();
- }
-
- il.append(RETURN);
-
- classGen.addMethod(constructor);
- }
-
- /**
- * Compile a topLevel() method into the output class. This method is
- * called from transform() to handle all non-template top-level elements.
- * Returns the signature of the topLevel() method.
- *
- * Global variables/params and keys are first sorted to resolve
- * dependencies between them. The XSLT 1.0 spec does not allow a key
- * to depend on a variable. However, for compatibility with Xalan
- * interpretive, that type of dependency is allowed. Note also that
- * the buildKeys() method is still generated as it is used by the
- * LoadDocument class, but it no longer called from transform().
- */
- private String compileTopLevel(ClassGenerator classGen) {
-
- final ConstantPoolGen cpg = classGen.getConstantPool();
-
- final com.sun.org.apache.bcel.internal.generic.Type[] argTypes = {
- Util.getJCRefType(DOM_INTF_SIG),
- Util.getJCRefType(NODE_ITERATOR_SIG),
- Util.getJCRefType(TRANSLET_OUTPUT_SIG)
- };
-
- final String[] argNames = {
- DOCUMENT_PNAME, ITERATOR_PNAME, TRANSLET_OUTPUT_PNAME
- };
-
- final InstructionList il = new InstructionList();
-
- final MethodGenerator toplevel =
- new MethodGenerator(ACC_PUBLIC,
- com.sun.org.apache.bcel.internal.generic.Type.VOID,
- argTypes, argNames,
- "topLevel", _className, il,
- classGen.getConstantPool());
-
- toplevel.addException("com.sun.org.apache.xalan.internal.xsltc.TransletException");
-
- // Define and initialize 'current' variable with the root node
- final LocalVariableGen current =
- toplevel.addLocalVariable("current",
- com.sun.org.apache.bcel.internal.generic.Type.INT,
- null, null);
-
- final int setFilter = cpg.addInterfaceMethodref(DOM_INTF,
- "setFilter",
- "(Lcom/sun/org/apache/xalan/internal/xsltc/StripFilter;)V");
-
- final int gitr = cpg.addInterfaceMethodref(DOM_INTF,
- "getIterator",
- "()"+NODE_ITERATOR_SIG);
- il.append(toplevel.loadDOM());
- il.append(new INVOKEINTERFACE(gitr, 1));
- il.append(toplevel.nextNode());
- current.setStart(il.append(new ISTORE(current.getIndex())));
-
- // Create a new list containing variables/params + keys
- Vector varDepElements = new Vector(_globals);
- Iterator<SyntaxTreeNode> elements = elements();
- while (elements.hasNext()) {
- SyntaxTreeNode element = elements.next();
- if (element instanceof Key) {
- varDepElements.add(element);
- }
- }
-
- // Determine a partial order for the variables/params and keys
- varDepElements = resolveDependencies(varDepElements);
-
- // Translate vars/params and keys in the right order
- final int count = varDepElements.size();
- for (int i = 0; i < count; i++) {
- final TopLevelElement tle = (TopLevelElement) varDepElements.elementAt(i);
- tle.translate(classGen, toplevel);
- if (tle instanceof Key) {
- final Key key = (Key) tle;
- _keys.put(key.getName(), key);
- }
- }
-
- // Compile code for other top-level elements
- Vector whitespaceRules = new Vector();
- elements = elements();
- while (elements.hasNext()) {
- SyntaxTreeNode element = elements.next();
- // xsl:decimal-format
- if (element instanceof DecimalFormatting) {
- ((DecimalFormatting)element).translate(classGen,toplevel);
- }
- // xsl:strip/preserve-space
- else if (element instanceof Whitespace) {
- whitespaceRules.addAll(((Whitespace)element).getRules());
- }
- }
-
- // Translate all whitespace strip/preserve rules
- if (whitespaceRules.size() > 0) {
- Whitespace.translateRules(whitespaceRules,classGen);
- }
-
- if (classGen.containsMethod(STRIP_SPACE, STRIP_SPACE_PARAMS) != null) {
- il.append(toplevel.loadDOM());
- il.append(classGen.loadTranslet());
- il.append(new INVOKEINTERFACE(setFilter, 2));
- }
-
- il.append(RETURN);
-
- // Compute max locals + stack and add method to class
- classGen.addMethod(toplevel);
-
- return("("+DOM_INTF_SIG+NODE_ITERATOR_SIG+TRANSLET_OUTPUT_SIG+")V");
- }
-
- /**
- * This method returns a vector with variables/params and keys in the
- * order in which they are to be compiled for initialization. The order
- * is determined by analyzing the dependencies between them. The XSLT 1.0
- * spec does not allow a key to depend on a variable. However, for
- * compatibility with Xalan interpretive, that type of dependency is
- * allowed and, therefore, consider to determine the partial order.
- */
- private Vector resolveDependencies(Vector input) {
- /* DEBUG CODE - INGORE
- for (int i = 0; i < input.size(); i++) {
- final TopLevelElement e = (TopLevelElement) input.elementAt(i);
- System.out.println("e = " + e + " depends on:");
- Vector dep = e.getDependencies();
- for (int j = 0; j < (dep != null ? dep.size() : 0); j++) {
- System.out.println("\t" + dep.elementAt(j));
- }
- }
- System.out.println("=================================");
- */
-
- Vector result = new Vector();
- while (input.size() > 0) {
- boolean changed = false;
- for (int i = 0; i < input.size(); ) {
- final TopLevelElement vde = (TopLevelElement) input.elementAt(i);
- final Vector dep = vde.getDependencies();
- if (dep == null || result.containsAll(dep)) {
- result.addElement(vde);
- input.remove(i);
- changed = true;
- }
- else {
- i++;
- }
- }
-
- // If nothing was changed in this pass then we have a circular ref
- if (!changed) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.CIRCULAR_VARIABLE_ERR,
- input.toString(), this);
- getParser().reportError(Constants.ERROR, err);
- return(result);
- }
- }
-
- /* DEBUG CODE - INGORE
- System.out.println("=================================");
- for (int i = 0; i < result.size(); i++) {
- final TopLevelElement e = (TopLevelElement) result.elementAt(i);
- System.out.println("e = " + e);
- }
- */
-
- return result;
- }
-
- /**
- * Compile a buildKeys() method into the output class. Note that keys
- * for the input document are created in topLevel(), not in this method.
- * However, we still need this method to create keys for documents loaded
- * via the XPath document() function.
- */
- private String compileBuildKeys(ClassGenerator classGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
-
- final com.sun.org.apache.bcel.internal.generic.Type[] argTypes = {
- Util.getJCRefType(DOM_INTF_SIG),
- Util.getJCRefType(NODE_ITERATOR_SIG),
- Util.getJCRefType(TRANSLET_OUTPUT_SIG),
- com.sun.org.apache.bcel.internal.generic.Type.INT
- };
-
- final String[] argNames = {
- DOCUMENT_PNAME, ITERATOR_PNAME, TRANSLET_OUTPUT_PNAME, "current"
- };
-
- final InstructionList il = new InstructionList();
-
- final MethodGenerator buildKeys =
- new MethodGenerator(ACC_PUBLIC,
- com.sun.org.apache.bcel.internal.generic.Type.VOID,
- argTypes, argNames,
- "buildKeys", _className, il,
- classGen.getConstantPool());
-
- buildKeys.addException("com.sun.org.apache.xalan.internal.xsltc.TransletException");
-
- final Iterator<SyntaxTreeNode> elements = elements();
- while (elements.hasNext()) {
- // xsl:key
- final SyntaxTreeNode element = elements.next();
- if (element instanceof Key) {
- final Key key = (Key)element;
- key.translate(classGen, buildKeys);
- _keys.put(key.getName(),key);
- }
- }
-
- il.append(RETURN);
-
- // Compute max locals + stack and add method to class
- buildKeys.stripAttributes(true);
- buildKeys.setMaxLocals();
- buildKeys.setMaxStack();
- buildKeys.removeNOPs();
-
- classGen.addMethod(buildKeys.getMethod());
-
- return("("+DOM_INTF_SIG+NODE_ITERATOR_SIG+TRANSLET_OUTPUT_SIG+"I)V");
- }
-
- /**
- * Compile transform() into the output class. This method is used to
- * initialize global variables and global parameters. The current node
- * is set to be the document's root node.
- */
- private void compileTransform(ClassGenerator classGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
-
- /*
- * Define the the method transform with the following signature:
- * void transform(DOM, NodeIterator, HandlerBase)
- */
- final com.sun.org.apache.bcel.internal.generic.Type[] argTypes =
- new com.sun.org.apache.bcel.internal.generic.Type[3];
- argTypes[0] = Util.getJCRefType(DOM_INTF_SIG);
- argTypes[1] = Util.getJCRefType(NODE_ITERATOR_SIG);
- argTypes[2] = Util.getJCRefType(TRANSLET_OUTPUT_SIG);
-
- final String[] argNames = new String[3];
- argNames[0] = DOCUMENT_PNAME;
- argNames[1] = ITERATOR_PNAME;
- argNames[2] = TRANSLET_OUTPUT_PNAME;
-
- final InstructionList il = new InstructionList();
- final MethodGenerator transf =
- new MethodGenerator(ACC_PUBLIC,
- com.sun.org.apache.bcel.internal.generic.Type.VOID,
- argTypes, argNames,
- "transform",
- _className,
- il,
- classGen.getConstantPool());
- transf.addException("com.sun.org.apache.xalan.internal.xsltc.TransletException");
-
- // call resetPrefixIndex at the beginning of transform
- final int check = cpg.addMethodref(BASIS_LIBRARY_CLASS, "resetPrefixIndex", "()V");
- il.append(new INVOKESTATIC(check));
-
- // Define and initialize current with the root node
- final LocalVariableGen current =
- transf.addLocalVariable("current",
- com.sun.org.apache.bcel.internal.generic.Type.INT,
- null, null);
- final String applyTemplatesSig = classGen.getApplyTemplatesSig();
- final int applyTemplates = cpg.addMethodref(getClassName(),
- "applyTemplates",
- applyTemplatesSig);
- final int domField = cpg.addFieldref(getClassName(),
- DOM_FIELD,
- DOM_INTF_SIG);
-
- // push translet for PUTFIELD
- il.append(classGen.loadTranslet());
- // prepare appropriate DOM implementation
-
- if (isMultiDocument()) {
- il.append(new NEW(cpg.addClass(MULTI_DOM_CLASS)));
- il.append(DUP);
- }
-
- il.append(classGen.loadTranslet());
- il.append(transf.loadDOM());
- il.append(new INVOKEVIRTUAL(cpg.addMethodref(TRANSLET_CLASS,
- "makeDOMAdapter",
- "("+DOM_INTF_SIG+")"+
- DOM_ADAPTER_SIG)));
- // DOMAdapter is on the stack
-
- if (isMultiDocument()) {
- final int init = cpg.addMethodref(MULTI_DOM_CLASS,
- "<init>",
- "("+DOM_INTF_SIG+")V");
- il.append(new INVOKESPECIAL(init));
- // MultiDOM is on the stack
- }
-
- //store to _dom variable
- il.append(new PUTFIELD(domField));
-
- // continue with globals initialization
- final int gitr = cpg.addInterfaceMethodref(DOM_INTF,
- "getIterator",
- "()"+NODE_ITERATOR_SIG);
- il.append(transf.loadDOM());
- il.append(new INVOKEINTERFACE(gitr, 1));
- il.append(transf.nextNode());
- current.setStart(il.append(new ISTORE(current.getIndex())));
-
- // Transfer the output settings to the output post-processor
- il.append(classGen.loadTranslet());
- il.append(transf.loadHandler());
- final int index = cpg.addMethodref(TRANSLET_CLASS,
- "transferOutputSettings",
- "("+OUTPUT_HANDLER_SIG+")V");
- il.append(new INVOKEVIRTUAL(index));
-
- /*
- * Compile buildKeys() method. Note that this method is not
- * invoked here as keys for the input document are now created
- * in topLevel(). However, this method is still needed by the
- * LoadDocument class.
- */
- final String keySig = compileBuildKeys(classGen);
- final int keyIdx = cpg.addMethodref(getClassName(),
- "buildKeys", keySig);
-
- // Look for top-level elements that need handling
- final Iterator<SyntaxTreeNode> toplevel = elements();
- if (_globals.size() > 0 || toplevel.hasNext()) {
- // Compile method for handling top-level elements
- final String topLevelSig = compileTopLevel(classGen);
- // Get a reference to that method
- final int topLevelIdx = cpg.addMethodref(getClassName(),
- "topLevel",
- topLevelSig);
- // Push all parameters on the stack and call topLevel()
- il.append(classGen.loadTranslet()); // The 'this' pointer
- il.append(classGen.loadTranslet());
- il.append(new GETFIELD(domField)); // The DOM reference
- il.append(transf.loadIterator());
- il.append(transf.loadHandler()); // The output handler
- il.append(new INVOKEVIRTUAL(topLevelIdx));
- }
-
- // start document
- il.append(transf.loadHandler());
- il.append(transf.startDocument());
-
- // push first arg for applyTemplates
- il.append(classGen.loadTranslet());
- // push translet for GETFIELD to get DOM arg
- il.append(classGen.loadTranslet());
- il.append(new GETFIELD(domField));
- // push remaining 2 args
- il.append(transf.loadIterator());
- il.append(transf.loadHandler());
- il.append(new INVOKEVIRTUAL(applyTemplates));
- // endDocument
- il.append(transf.loadHandler());
- il.append(transf.endDocument());
-
- il.append(RETURN);
-
- // Compute max locals + stack and add method to class
- classGen.addMethod(transf);
-
- }
-
- /**
- * Peephole optimization: Remove sequences of [ALOAD, POP].
- */
- private void peepHoleOptimization(MethodGenerator methodGen) {
- final String pattern = "`aload'`pop'`instruction'";
- final InstructionList il = methodGen.getInstructionList();
- final InstructionFinder find = new InstructionFinder(il);
- for(Iterator iter=find.search(pattern); iter.hasNext(); ) {
- InstructionHandle[] match = (InstructionHandle[])iter.next();
- try {
- il.delete(match[0], match[1]);
- }
- catch (TargetLostException e) {
- // TODO: move target down into the list
- }
- }
- }
-
- public int addParam(Param param) {
- _globals.addElement(param);
- return _globals.size() - 1;
- }
-
- public int addVariable(Variable global) {
- _globals.addElement(global);
- return _globals.size() - 1;
- }
-
- public void display(int indent) {
- indent(indent);
- Util.println("Stylesheet");
- displayContents(indent + IndentIncrement);
- }
-
- // do we need this wrapper ?????
- public String getNamespace(String prefix) {
- return lookupNamespace(prefix);
- }
-
- public String getClassName() {
- return _className;
- }
-
- public Vector getTemplates() {
- return _templates;
- }
-
- public Vector getAllValidTemplates() {
- // Return templates if no imported/included stylesheets
- if (_includedStylesheets == null) {
- return _templates;
- }
-
- // Is returned value cached?
- if (_allValidTemplates == null) {
- Vector templates = new Vector();
- templates.addAll(_templates);
- int size = _includedStylesheets.size();
- for (int i = 0; i < size; i++) {
- Stylesheet included =(Stylesheet)_includedStylesheets.elementAt(i);
- templates.addAll(included.getAllValidTemplates());
- }
- //templates.addAll(_templates);
-
- // Cache results in top-level stylesheet only
- if (_parentStylesheet != null) {
- return templates;
- }
- _allValidTemplates = templates;
- }
-
- return _allValidTemplates;
- }
-
- protected void addTemplate(Template template) {
- _templates.addElement(template);
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/SymbolTable.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/SymbolTable.java
deleted file mode 100644
index dfb95b7..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/SymbolTable.java
+++ /dev/null
@@ -1,295 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: SymbolTable.java,v 1.5 2005/09/28 13:48:16 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodType;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Stack;
-import java.util.StringTokenizer;
-import java.util.Vector;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- */
-final class SymbolTable {
-
- // These maps are used for all stylesheets
- private final Map<String, Stylesheet> _stylesheets = new HashMap<>();
- private final Map<String, Vector> _primops = new HashMap<>();
-
- // These maps are used for some stylesheets
- private Map<String, VariableBase> _variables = null;
- private Map<String, Template> _templates = null;
- private Map<String, AttributeSet> _attributeSets = null;
- private Map<String, String> _aliases = null;
- private Map<String, Integer> _excludedURI = null;
- private Stack<Map<String, Integer>> _excludedURIStack = null;
- private Map<String, DecimalFormatting> _decimalFormats = null;
- private Map<String, Key> _keys = null;
-
- public DecimalFormatting getDecimalFormatting(QName name) {
- if (_decimalFormats == null) return null;
- return(_decimalFormats.get(name.getStringRep()));
- }
-
- public void addDecimalFormatting(QName name, DecimalFormatting symbols) {
- if (_decimalFormats == null) _decimalFormats = new HashMap<>();
- _decimalFormats.put(name.getStringRep(), symbols);
- }
-
- public Key getKey(QName name) {
- if (_keys == null) return null;
- return _keys.get(name.getStringRep());
- }
-
- public void addKey(QName name, Key key) {
- if (_keys == null) _keys = new HashMap<>();
- _keys.put(name.getStringRep(), key);
- }
-
- public Stylesheet addStylesheet(QName name, Stylesheet node) {
- return _stylesheets.put(name.getStringRep(), node);
- }
-
- public Stylesheet lookupStylesheet(QName name) {
- return _stylesheets.get(name.getStringRep());
- }
-
- public Template addTemplate(Template template) {
- final QName name = template.getName();
- if (_templates == null) _templates = new HashMap<>();
- return _templates.put(name.getStringRep(), template);
- }
-
- public Template lookupTemplate(QName name) {
- if (_templates == null) return null;
- return _templates.get(name.getStringRep());
- }
-
- public Variable addVariable(Variable variable) {
- if (_variables == null) _variables = new HashMap<>();
- final String name = variable.getName().getStringRep();
- return (Variable)_variables.put(name, variable);
- }
-
- public Param addParam(Param parameter) {
- if (_variables == null) _variables = new HashMap<>();
- final String name = parameter.getName().getStringRep();
- return (Param)_variables.put(name, parameter);
- }
-
- public Variable lookupVariable(QName qname) {
- if (_variables == null) return null;
- final String name = qname.getStringRep();
- final VariableBase obj = _variables.get(name);
- return obj instanceof Variable ? (Variable)obj : null;
- }
-
- public Param lookupParam(QName qname) {
- if (_variables == null) return null;
- final String name = qname.getStringRep();
- final VariableBase obj = _variables.get(name);
- return obj instanceof Param ? (Param)obj : null;
- }
-
- public SyntaxTreeNode lookupName(QName qname) {
- if (_variables == null) return null;
- final String name = qname.getStringRep();
- return (SyntaxTreeNode)_variables.get(name);
- }
-
- public AttributeSet addAttributeSet(AttributeSet atts) {
- if (_attributeSets == null) _attributeSets = new HashMap<>();
- return _attributeSets.put(atts.getName().getStringRep(), atts);
- }
-
- public AttributeSet lookupAttributeSet(QName name) {
- if (_attributeSets == null) return null;
- return _attributeSets.get(name.getStringRep());
- }
-
- /**
- * Add a primitive operator or function to the symbol table. To avoid
- * name clashes with user-defined names, the prefix <tt>PrimopPrefix</tt>
- * is prepended.
- */
- public void addPrimop(String name, MethodType mtype) {
- Vector methods = _primops.get(name);
- if (methods == null) {
- _primops.put(name, methods = new Vector());
- }
- methods.addElement(mtype);
- }
-
- /**
- * Lookup a primitive operator or function in the symbol table by
- * prepending the prefix <tt>PrimopPrefix</tt>.
- */
- public Vector lookupPrimop(String name) {
- return _primops.get(name);
- }
-
- /**
- * This is used for xsl:attribute elements that have a "namespace"
- * attribute that is currently not defined using xmlns:
- */
- private int _nsCounter = 0;
-
- public String generateNamespacePrefix() {
- return("ns"+(_nsCounter++));
- }
-
- /**
- * Use a namespace prefix to lookup a namespace URI
- */
- private SyntaxTreeNode _current = null;
-
- public void setCurrentNode(SyntaxTreeNode node) {
- _current = node;
- }
-
- public String lookupNamespace(String prefix) {
- if (_current == null) return(Constants.EMPTYSTRING);
- return(_current.lookupNamespace(prefix));
- }
-
- /**
- * Adds an alias for a namespace prefix
- */
- public void addPrefixAlias(String prefix, String alias) {
- if (_aliases == null) _aliases = new HashMap<>();
- _aliases.put(prefix,alias);
- }
-
- /**
- * Retrieves any alias for a given namespace prefix
- */
- public String lookupPrefixAlias(String prefix) {
- if (_aliases == null) return null;
- return _aliases.get(prefix);
- }
-
- /**
- * Register a namespace URI so that it will not be declared in the output
- * unless it is actually referenced in the output.
- */
- public void excludeURI(String uri) {
- // The null-namespace cannot be excluded
- if (uri == null) return;
-
- // Create a new map of exlcuded URIs if none exists
- if (_excludedURI == null) _excludedURI = new HashMap<>();
-
- // Register the namespace URI
- Integer refcnt = _excludedURI.get(uri);
- if (refcnt == null)
- refcnt = 1;
- else
- refcnt = refcnt + 1;
- _excludedURI.put(uri,refcnt);
- }
-
- /**
- * Exclude a series of namespaces given by a list of whitespace
- * separated namespace prefixes.
- */
- public void excludeNamespaces(String prefixes) {
- if (prefixes != null) {
- StringTokenizer tokens = new StringTokenizer(prefixes);
- while (tokens.hasMoreTokens()) {
- final String prefix = tokens.nextToken();
- final String uri;
- if (prefix.equals("#default"))
- uri = lookupNamespace(Constants.EMPTYSTRING);
- else
- uri = lookupNamespace(prefix);
- if (uri != null) excludeURI(uri);
- }
- }
- }
-
- /**
- * Check if a namespace should not be declared in the output (unless used)
- */
- public boolean isExcludedNamespace(String uri) {
- if (uri != null && _excludedURI != null) {
- final Integer refcnt = _excludedURI.get(uri);
- return (refcnt != null && refcnt > 0);
- }
- return false;
- }
-
- /**
- * Turn of namespace declaration exclusion
- */
- public void unExcludeNamespaces(String prefixes) {
- if (_excludedURI == null) return;
- if (prefixes != null) {
- StringTokenizer tokens = new StringTokenizer(prefixes);
- while (tokens.hasMoreTokens()) {
- final String prefix = tokens.nextToken();
- final String uri;
- if (prefix.equals("#default"))
- uri = lookupNamespace(Constants.EMPTYSTRING);
- else
- uri = lookupNamespace(prefix);
- Integer refcnt = _excludedURI.get(uri);
- if (refcnt != null)
- _excludedURI.put(uri, refcnt - 1);
- }
- }
- }
- /**
- * Exclusion of namespaces by a stylesheet does not extend to any stylesheet
- * imported or included by the stylesheet. Upon entering the context of a
- * new stylesheet, a call to this method is needed to clear the current set
- * of excluded namespaces temporarily. Every call to this method requires
- * a corresponding call to {@link #popExcludedNamespacesContext()}.
- */
- public void pushExcludedNamespacesContext() {
- if (_excludedURIStack == null) {
- _excludedURIStack = new Stack();
- }
- _excludedURIStack.push(_excludedURI);
- _excludedURI = null;
- }
-
- /**
- * Exclusion of namespaces by a stylesheet does not extend to any stylesheet
- * imported or included by the stylesheet. Upon exiting the context of a
- * stylesheet, a call to this method is needed to restore the set of
- * excluded namespaces that was in effect prior to entering the context of
- * the current stylesheet.
- */
- public void popExcludedNamespacesContext() {
- _excludedURI = _excludedURIStack.pop();
- if (_excludedURIStack.isEmpty()) {
- _excludedURIStack = null;
- }
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/SyntaxTreeNode.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/SyntaxTreeNode.java
deleted file mode 100644
index 01ef38b..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/SyntaxTreeNode.java
+++ /dev/null
@@ -1,902 +0,0 @@
-/*
- * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.ANEWARRAY;
-import com.sun.org.apache.bcel.internal.generic.BasicType;
-import com.sun.org.apache.bcel.internal.generic.CHECKCAST;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.DUP_X1;
-import com.sun.org.apache.bcel.internal.generic.GETFIELD;
-import com.sun.org.apache.bcel.internal.generic.ICONST;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
-import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.NEW;
-import com.sun.org.apache.bcel.internal.generic.NEWARRAY;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.xalan.internal.xsltc.DOM;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import org.xml.sax.Attributes;
-import org.xml.sax.helpers.AttributesImpl;
-
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author G. Todd Miller
- * @author Morten Jorensen
- * @author Erwin Bolwidt <ejb@klomp.org>
- * @author John Howard <JohnH@schemasoft.com>
- */
-public abstract class SyntaxTreeNode implements Constants {
-
- // Reference to the AST parser
- private Parser _parser;
-
- // AST navigation pointers
- protected SyntaxTreeNode _parent; // Parent node
- private Stylesheet _stylesheet; // Stylesheet ancestor node
- private Template _template; // Template ancestor node
- private final List<SyntaxTreeNode> _contents = new ArrayList<>(2); // Child nodes
-
- // Element description data
- protected QName _qname; // The element QName
- private int _line; // Source file line number
- protected AttributesImpl _attributes = null; // Attributes of this element
- private Map<String, String> _prefixMapping = null; // Namespace declarations
-
- // Sentinel - used to denote unrecognised syntaxt tree nodes.
- protected static final SyntaxTreeNode Dummy = new AbsolutePathPattern(null);
-
- // These two are used for indenting nodes in the AST (debug output)
- protected static final int IndentIncrement = 4;
- private static final char[] _spaces =
- " ".toCharArray();
-
- /**
- * Creates a new SyntaxTreeNode with a 'null' QName and no source file
- * line number reference.
- */
- public SyntaxTreeNode() {
- _line = 0;
- _qname = null;
- }
-
- /**
- * Creates a new SyntaxTreeNode with a 'null' QName.
- * @param line Source file line number reference
- */
- public SyntaxTreeNode(int line) {
- _line = line;
- _qname = null;
- }
-
- /**
- * Creates a new SyntaxTreeNode with no source file line number reference.
- * @param uri The element's namespace URI
- * @param prefix The element's namespace prefix
- * @param local The element's local name
- */
- public SyntaxTreeNode(String uri, String prefix, String local) {
- _line = 0;
- setQName(uri, prefix, local);
- }
-
- /**
- * Set the source file line number for this element
- * @param line The source file line number.
- */
- protected final void setLineNumber(int line) {
- _line = line;
- }
-
- /**
- * Get the source file line number for this element. If unavailable, lookup
- * in ancestors.
- *
- * @return The source file line number.
- */
- public final int getLineNumber() {
- if (_line > 0) return _line;
- SyntaxTreeNode parent = getParent();
- return (parent != null) ? parent.getLineNumber() : 0;
- }
-
- /**
- * Set the QName for the syntax tree node.
- * @param qname The QName for the syntax tree node
- */
- protected void setQName(QName qname) {
- _qname = qname;
- }
-
- /**
- * Set the QName for the SyntaxTreeNode
- * @param uri The element's namespace URI
- * @param prefix The element's namespace prefix
- * @param local The element's local name
- */
- protected void setQName(String uri, String prefix, String localname) {
- _qname = new QName(uri, prefix, localname);
- }
-
- /**
- * Set the QName for the SyntaxTreeNode
- * @param qname The QName for the syntax tree node
- */
- protected QName getQName() {
- return(_qname);
- }
-
- /**
- * Set the attributes for this SyntaxTreeNode.
- * @param attributes Attributes for the element. Must be passed in as an
- * implementation of org.xml.sax.Attributes.
- */
- protected void setAttributes(AttributesImpl attributes) {
- _attributes = attributes;
- }
-
- /**
- * Returns a value for an attribute from the source element.
- * @param qname The QName of the attribute to return.
- * @return The value of the attribute of name 'qname'.
- */
- protected String getAttribute(String qname) {
- if (_attributes == null) {
- return EMPTYSTRING;
- }
- final String value = _attributes.getValue(qname);
- return (value == null || value.equals(EMPTYSTRING)) ?
- EMPTYSTRING : value;
- }
-
- protected String getAttribute(String prefix, String localName) {
- return getAttribute(prefix + ':' + localName);
- }
-
- protected boolean hasAttribute(String qname) {
- return (_attributes != null && _attributes.getValue(qname) != null);
- }
-
- protected void addAttribute(String qname, String value) {
- int index = _attributes.getIndex(qname);
- if (index != -1) {
- _attributes.setAttribute(index, "", Util.getLocalName(qname),
- qname, "CDATA", value);
- }
- else {
- _attributes.addAttribute("", Util.getLocalName(qname), qname,
- "CDATA", value);
- }
- }
-
- /**
- * Returns a list of all attributes declared for the element represented by
- * this syntax tree node.
- * @return Attributes for this syntax tree node
- */
- protected Attributes getAttributes() {
- return(_attributes);
- }
-
- /**
- * Sets the prefix mapping for the namespaces that were declared in this
- * element. This does not include all prefix mappings in scope, so one
- * may have to check ancestor elements to get all mappings that are in
- * in scope. The prefixes must be passed in as a Map that maps
- * namespace prefixes (String objects) to namespace URIs (also String).
- * @param mapping The Map containing the mappings.
- */
- protected void setPrefixMapping(Map<String, String> mapping) {
- _prefixMapping = mapping;
- }
-
- /**
- * Returns a Map containing the prefix mappings that were declared
- * for this element. This does not include all prefix mappings in scope,
- * so one may have to check ancestor elements to get all mappings that are
- * in in scope.
- * @return Prefix mappings (for this element only).
- */
- protected Map<String, String> getPrefixMapping() {
- return _prefixMapping;
- }
-
- /**
- * Adds a single prefix mapping to this syntax tree node.
- * @param prefix Namespace prefix.
- * @param uri Namespace URI.
- */
- protected void addPrefixMapping(String prefix, String uri) {
- if (_prefixMapping == null)
- _prefixMapping = new HashMap<>();
- _prefixMapping.put(prefix, uri);
- }
-
- /**
- * Returns any namespace URI that is in scope for a given prefix. This
- * method checks namespace mappings for this element, and if necessary
- * for ancestor elements as well (ie. if the prefix maps to an URI in this
- * scope then you'll definately get the URI from this method).
- * @param prefix Namespace prefix.
- * @return Namespace URI.
- */
- protected String lookupNamespace(String prefix) {
- // Initialise the output (default is 'null' for undefined)
- String uri = null;
-
- // First look up the prefix/uri mapping in our own map...
- if (_prefixMapping != null)
- uri = _prefixMapping.get(prefix);
- // ... but if we can't find it there we ask our parent for the mapping
- if ((uri == null) && (_parent != null)) {
- uri = _parent.lookupNamespace(prefix);
- if ((prefix == Constants.EMPTYSTRING) && (uri == null))
- uri = Constants.EMPTYSTRING;
- }
- // ... and then we return whatever URI we've got.
- return(uri);
- }
-
- /**
- * Returns any namespace prefix that is mapped to a prefix in the current
- * scope. This method checks namespace mappings for this element, and if
- * necessary for ancestor elements as well (ie. if the URI is declared
- * within the current scope then you'll definately get the prefix from
- * this method). Note that this is a very slow method and consequentially
- * it should only be used strictly when needed.
- * @param uri Namespace URI.
- * @return Namespace prefix.
- */
- protected String lookupPrefix(String uri) {
- // Initialise the output (default is 'null' for undefined)
- String prefix = null;
-
- // First look up the prefix/uri mapping in our own map...
- if ((_prefixMapping != null) &&
- (_prefixMapping.containsValue(uri))) {
- for (Map.Entry<String, String> entry : _prefixMapping.entrySet()) {
- prefix = entry.getKey();
- String mapsTo = entry.getValue();
- if (mapsTo.equals(uri)) return(prefix);
- }
- }
- // ... but if we can't find it there we ask our parent for the mapping
- else if (_parent != null) {
- prefix = _parent.lookupPrefix(uri);
- if ((uri == Constants.EMPTYSTRING) && (prefix == null))
- prefix = Constants.EMPTYSTRING;
- }
- return(prefix);
- }
-
- /**
- * Set this node's parser. The parser (the XSLT parser) gives this
- * syntax tree node access to the symbol table and XPath parser.
- * @param parser The XSLT parser.
- */
- protected void setParser(Parser parser) {
- _parser = parser;
- }
-
- /**
- * Returns this node's XSLT parser.
- * @return The XSLT parser.
- */
- public final Parser getParser() {
- return _parser;
- }
-
- /**
- * Set this syntax tree node's parent node, if unset. For
- * re-parenting just use <code>node._parent = newparent</code>.
- *
- * @param parent The parent node.
- */
- protected void setParent(SyntaxTreeNode parent) {
- if (_parent == null) _parent = parent;
- }
-
- /**
- * Returns this syntax tree node's parent node.
- * @return The parent syntax tree node.
- */
- protected final SyntaxTreeNode getParent() {
- return _parent;
- }
-
- /**
- * Returns 'true' if this syntax tree node is the Sentinal node.
- * @return 'true' if this syntax tree node is the Sentinal node.
- */
- protected final boolean isDummy() {
- return this == Dummy;
- }
-
- /**
- * Get the import precedence of this element. The import precedence equals
- * the import precedence of the stylesheet in which this element occured.
- * @return The import precedence of this syntax tree node.
- */
- protected int getImportPrecedence() {
- Stylesheet stylesheet = getStylesheet();
- if (stylesheet == null) return Integer.MIN_VALUE;
- return stylesheet.getImportPrecedence();
- }
-
- /**
- * Get the Stylesheet node that represents the <xsl:stylesheet/> element
- * that this node occured under.
- * @return The Stylesheet ancestor node of this node.
- */
- public Stylesheet getStylesheet() {
- if (_stylesheet == null) {
- SyntaxTreeNode parent = this;
- while (parent != null) {
- if (parent instanceof Stylesheet)
- return((Stylesheet)parent);
- parent = parent.getParent();
- }
- _stylesheet = (Stylesheet)parent;
- }
- return(_stylesheet);
- }
-
- /**
- * Get the Template node that represents the <xsl:template/> element
- * that this node occured under. Note that this method will return 'null'
- * for nodes that represent top-level elements.
- * @return The Template ancestor node of this node or 'null'.
- */
- protected Template getTemplate() {
- if (_template == null) {
- SyntaxTreeNode parent = this;
- while ((parent != null) && (!(parent instanceof Template)))
- parent = parent.getParent();
- _template = (Template)parent;
- }
- return(_template);
- }
-
- /**
- * Returns a reference to the XSLTC (XSLT compiler) in use.
- * @return XSLTC - XSLT compiler.
- */
- protected final XSLTC getXSLTC() {
- return _parser.getXSLTC();
- }
-
- /**
- * Returns the XSLT parser's symbol table.
- * @return Symbol table.
- */
- protected final SymbolTable getSymbolTable() {
- return (_parser == null) ? null : _parser.getSymbolTable();
- }
-
- /**
- * Parse the contents of this syntax tree nodes (child nodes, XPath
- * expressions, patterns and functions). The default behaviour is to parser
- * the syntax tree node's children (since there are no common expressions,
- * patterns, etc. that can be handled in this base class.
- * @param parser reference to the XSLT parser
- */
- public void parseContents(Parser parser) {
- parseChildren(parser);
- }
-
- /**
- * Parse all children of this syntax tree node. This method is normally
- * called by the parseContents() method.
- * @param parser reference to the XSLT parser
- */
- protected final void parseChildren(Parser parser) {
-
- List<QName> locals = null; // only create when needed
-
- for (SyntaxTreeNode child : _contents) {
- parser.getSymbolTable().setCurrentNode(child);
- child.parseContents(parser);
- // if variable or parameter, add it to scope
- final QName varOrParamName = updateScope(parser, child);
- if (varOrParamName != null) {
- if (locals == null) {
- locals = new ArrayList<>(2);
- }
- locals.add(varOrParamName);
- }
- }
-
- parser.getSymbolTable().setCurrentNode(this);
-
- // after the last element, remove any locals from scope
- if (locals != null) {
- for (QName varOrParamName : locals) {
- parser.removeVariable(varOrParamName);
- }
- }
- }
-
- /**
- * Add a node to the current scope and return name of a variable or
- * parameter if the node represents a variable or a parameter.
- */
- protected QName updateScope(Parser parser, SyntaxTreeNode node) {
- if (node instanceof Variable) {
- final Variable var = (Variable)node;
- parser.addVariable(var);
- return var.getName();
- }
- else if (node instanceof Param) {
- final Param param = (Param)node;
- parser.addParameter(param);
- return param.getName();
- }
- else {
- return null;
- }
- }
-
- /**
- * Type check the children of this node. The type check phase may add
- * coercions (CastExpr) to the AST.
- * @param stable The compiler/parser's symbol table
- */
- public abstract Type typeCheck(SymbolTable stable) throws TypeCheckError;
-
- /**
- * Call typeCheck() on all child syntax tree nodes.
- * @param stable The compiler/parser's symbol table
- */
- protected Type typeCheckContents(SymbolTable stable) throws TypeCheckError {
- for (SyntaxTreeNode item : _contents) {
- item.typeCheck(stable);
- }
- return Type.Void;
- }
-
- /**
- * Translate this abstract syntax tree node into JVM bytecodes.
- * @param classGen BCEL Java class generator
- * @param methodGen BCEL Java method generator
- */
- public abstract void translate(ClassGenerator classGen,
- MethodGenerator methodGen);
-
- /**
- * Call translate() on all child syntax tree nodes.
- * @param classGen BCEL Java class generator
- * @param methodGen BCEL Java method generator
- */
- protected void translateContents(ClassGenerator classGen,
- MethodGenerator methodGen) {
- // Call translate() on all child nodes
- final int n = elementCount();
-
- for (SyntaxTreeNode item : _contents) {
- methodGen.markChunkStart();
- item.translate(classGen, methodGen);
- methodGen.markChunkEnd();
- }
-
- // After translation, unmap any registers for any variables/parameters
- // that were declared in this scope. Performing this unmapping in the
- // same AST scope as the declaration deals with the problems of
- // references falling out-of-scope inside the for-each element.
- // (the cause of which being 'lazy' register allocation for references)
- for (int i = 0; i < n; i++) {
- if ( _contents.get(i) instanceof VariableBase) {
- final VariableBase var = (VariableBase)_contents.get(i);
- var.unmapRegister(classGen, methodGen);
- }
- }
- }
-
- /**
- * Return true if the node represents a simple RTF.
- *
- * A node is a simple RTF if all children only produce Text value.
- *
- * @param node A node
- * @return true if the node content can be considered as a simple RTF.
- */
- private boolean isSimpleRTF(SyntaxTreeNode node) {
-
- List<SyntaxTreeNode> contents = node.getContents();
- for (SyntaxTreeNode item : contents) {
- if (!isTextElement(item, false))
- return false;
- }
-
- return true;
- }
-
- /**
- * Return true if the node represents an adaptive RTF.
- *
- * A node is an adaptive RTF if each children is a Text element
- * or it is <xsl:call-template> or <xsl:apply-templates>.
- *
- * @param node A node
- * @return true if the node content can be considered as an adaptive RTF.
- */
- private boolean isAdaptiveRTF(SyntaxTreeNode node) {
-
- List<SyntaxTreeNode> contents = node.getContents();
- for (SyntaxTreeNode item : contents) {
- if (!isTextElement(item, true))
- return false;
- }
-
- return true;
- }
-
- /**
- * Return true if the node only produces Text content.
- *
- * A node is a Text element if it is Text, xsl:value-of, xsl:number,
- * or a combination of these nested in a control instruction (xsl:if or
- * xsl:choose).
- *
- * If the doExtendedCheck flag is true, xsl:call-template and xsl:apply-templates
- * are also considered as Text elements.
- *
- * @param node A node
- * @param doExtendedCheck If this flag is true, <xsl:call-template> and
- * <xsl:apply-templates> are also considered as Text elements.
- *
- * @return true if the node of Text type
- */
- private boolean isTextElement(SyntaxTreeNode node, boolean doExtendedCheck) {
- if (node instanceof ValueOf || node instanceof Number
- || node instanceof Text)
- {
- return true;
- }
- else if (node instanceof If) {
- return doExtendedCheck ? isAdaptiveRTF(node) : isSimpleRTF(node);
- }
- else if (node instanceof Choose) {
- List<SyntaxTreeNode> contents = node.getContents();
- for (SyntaxTreeNode item : contents) {
- if (item instanceof Text ||
- ((item instanceof When || item instanceof Otherwise)
- && ((doExtendedCheck && isAdaptiveRTF(item))
- || (!doExtendedCheck && isSimpleRTF(item)))))
- continue;
- else
- return false;
- }
- return true;
- }
- else if (doExtendedCheck &&
- (node instanceof CallTemplate
- || node instanceof ApplyTemplates))
- return true;
- else
- return false;
- }
-
- /**
- * Utility method used by parameters and variables to store result trees
- * @param classGen BCEL Java class generator
- * @param methodGen BCEL Java method generator
- */
- protected void compileResultTree(ClassGenerator classGen,
- MethodGenerator methodGen)
- {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- final Stylesheet stylesheet = classGen.getStylesheet();
-
- boolean isSimple = isSimpleRTF(this);
- boolean isAdaptive = false;
- if (!isSimple) {
- isAdaptive = isAdaptiveRTF(this);
- }
-
- int rtfType = isSimple ? DOM.SIMPLE_RTF
- : (isAdaptive ? DOM.ADAPTIVE_RTF : DOM.TREE_RTF);
-
- // Save the current handler base on the stack
- il.append(methodGen.loadHandler());
-
- final String DOM_CLASS = classGen.getDOMClass();
-
- // Create new instance of DOM class (with RTF_INITIAL_SIZE nodes)
- //int index = cpg.addMethodref(DOM_IMPL, "<init>", "(I)V");
- //il.append(new NEW(cpg.addClass(DOM_IMPL)));
-
- il.append(methodGen.loadDOM());
- int index = cpg.addInterfaceMethodref(DOM_INTF,
- "getResultTreeFrag",
- "(IIZ)" + DOM_INTF_SIG);
- il.append(new PUSH(cpg, RTF_INITIAL_SIZE));
- il.append(new PUSH(cpg, rtfType));
- il.append(new PUSH(cpg, stylesheet.callsNodeset()));
- il.append(new INVOKEINTERFACE(index,4));
-
- il.append(DUP);
-
- // Overwrite old handler with DOM handler
- index = cpg.addInterfaceMethodref(DOM_INTF,
- "getOutputDomBuilder",
- "()" + TRANSLET_OUTPUT_SIG);
-
- il.append(new INVOKEINTERFACE(index,1));
- il.append(DUP);
- il.append(methodGen.storeHandler());
-
- // Call startDocument on the new handler
- il.append(methodGen.startDocument());
-
- // Instantiate result tree fragment
- translateContents(classGen, methodGen);
-
- // Call endDocument on the new handler
- il.append(methodGen.loadHandler());
- il.append(methodGen.endDocument());
-
- // Check if we need to wrap the DOMImpl object in a DOMAdapter object.
- // DOMAdapter is not needed if the RTF is a simple RTF and the nodeset()
- // function is not used.
- if (stylesheet.callsNodeset()
- && !DOM_CLASS.equals(DOM_IMPL_CLASS)) {
- // new com.sun.org.apache.xalan.internal.xsltc.dom.DOMAdapter(DOMImpl,String[]);
- index = cpg.addMethodref(DOM_ADAPTER_CLASS,
- "<init>",
- "("+DOM_INTF_SIG+
- "["+STRING_SIG+
- "["+STRING_SIG+
- "[I"+
- "["+STRING_SIG+")V");
- il.append(new NEW(cpg.addClass(DOM_ADAPTER_CLASS)));
- il.append(new DUP_X1());
- il.append(SWAP);
-
- /*
- * Give the DOM adapter an empty type mapping if the nodeset
- * extension function is never called.
- */
- if (!stylesheet.callsNodeset()) {
- il.append(new ICONST(0));
- il.append(new ANEWARRAY(cpg.addClass(STRING)));
- il.append(DUP);
- il.append(DUP);
- il.append(new ICONST(0));
- il.append(new NEWARRAY(BasicType.INT));
- il.append(SWAP);
- il.append(new INVOKESPECIAL(index));
- }
- else {
- // Push name arrays on the stack
- il.append(ALOAD_0);
- il.append(new GETFIELD(cpg.addFieldref(TRANSLET_CLASS,
- NAMES_INDEX,
- NAMES_INDEX_SIG)));
- il.append(ALOAD_0);
- il.append(new GETFIELD(cpg.addFieldref(TRANSLET_CLASS,
- URIS_INDEX,
- URIS_INDEX_SIG)));
- il.append(ALOAD_0);
- il.append(new GETFIELD(cpg.addFieldref(TRANSLET_CLASS,
- TYPES_INDEX,
- TYPES_INDEX_SIG)));
- il.append(ALOAD_0);
- il.append(new GETFIELD(cpg.addFieldref(TRANSLET_CLASS,
- NAMESPACE_INDEX,
- NAMESPACE_INDEX_SIG)));
-
- // Initialized DOM adapter
- il.append(new INVOKESPECIAL(index));
-
- // Add DOM adapter to MultiDOM class by calling addDOMAdapter()
- il.append(DUP);
- il.append(methodGen.loadDOM());
- il.append(new CHECKCAST(cpg.addClass(classGen.getDOMClass())));
- il.append(SWAP);
- index = cpg.addMethodref(MULTI_DOM_CLASS,
- "addDOMAdapter",
- "(" + DOM_ADAPTER_SIG + ")I");
- il.append(new INVOKEVIRTUAL(index));
- il.append(POP); // ignore mask returned by addDOMAdapter
- }
- }
-
- // Restore old handler base from stack
- il.append(SWAP);
- il.append(methodGen.storeHandler());
- }
-
- /**
- * Returns true if this expression/instruction depends on the context. By
- * default, every expression/instruction depends on the context unless it
- * overrides this method. Currently used to determine if result trees are
- * compiled using procedures or little DOMs (result tree fragments).
- * @return 'true' if this node depends on the context.
- */
- protected boolean contextDependent() {
- return true;
- }
-
- /**
- * Return true if any of the expressions/instructions in the contents of
- * this node is context dependent.
- * @return 'true' if the contents of this node is context dependent.
- */
- protected boolean dependentContents() {
- for (SyntaxTreeNode item : _contents) {
- if (item.contextDependent()) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Adds a child node to this syntax tree node.
- * @param element is the new child node.
- */
- protected final void addElement(SyntaxTreeNode element) {
- _contents.add(element);
- element.setParent(this);
- }
-
- /**
- * Inserts the first child node of this syntax tree node. The existing
- * children are shifted back one position.
- * @param element is the new child node.
- */
- protected final void setFirstElement(SyntaxTreeNode element) {
- _contents.add(0, element);
- element.setParent(this);
- }
-
- /**
- * Removed a child node of this syntax tree node.
- * @param element is the child node to remove.
- */
- protected final void removeElement(SyntaxTreeNode element) {
- _contents.remove(element);
- element.setParent(null);
- }
-
- /**
- * Returns a List containing all the child nodes of this node.
- * @return A List containing all the child nodes of this node.
- */
- protected final List<SyntaxTreeNode> getContents() {
- return _contents;
- }
-
- /**
- * Tells you if this node has any child nodes.
- * @return 'true' if this node has any children.
- */
- protected final boolean hasContents() {
- return elementCount() > 0;
- }
-
- /**
- * Returns the number of children this node has.
- * @return Number of child nodes.
- */
- protected final int elementCount() {
- return _contents.size();
- }
-
- /**
- * Returns an Iterator of all child nodes of this node.
- * @return An Iterator of all child nodes of this node.
- */
- protected final Iterator<SyntaxTreeNode> elements() {
- return _contents.iterator();
- }
-
- /**
- * Returns a child node at a given position.
- * @param pos The child node's position.
- * @return The child node.
- */
- protected final SyntaxTreeNode elementAt(int pos) {
- return _contents.get(pos);
- }
-
- /**
- * Returns this element's last child
- * @return The child node.
- */
- protected final SyntaxTreeNode lastChild() {
- if (_contents.isEmpty()) return null;
- return _contents.get(_contents.size() - 1);
- }
-
- /**
- * Displays the contents of this syntax tree node (to stdout).
- * This method is intended for debugging _only_, and should be overridden
- * by all syntax tree node implementations.
- * @param indent Indentation level for syntax tree levels.
- */
- public void display(int indent) {
- displayContents(indent);
- }
-
- /**
- * Displays the contents of this syntax tree node (to stdout).
- * This method is intended for debugging _only_ !!!
- * @param indent Indentation level for syntax tree levels.
- */
- protected void displayContents(int indent) {
- for (SyntaxTreeNode item : _contents) {
- item.display(indent);
- }
- }
-
- /**
- * Set the indentation level for debug output.
- * @param indent Indentation level for syntax tree levels.
- */
- protected final void indent(int indent) {
- System.out.print(new String(_spaces, 0, indent));
- }
-
- /**
- * Report an error to the parser.
- * @param element The element in which the error occured (normally 'this'
- * but it could also be an expression/pattern/etc.)
- * @param parser The XSLT parser to report the error to.
- * @param error The error code (from util/ErrorMsg).
- * @param message Any additional error message.
- */
- protected void reportError(SyntaxTreeNode element, Parser parser,
- String errorCode, String message) {
- final ErrorMsg error = new ErrorMsg(errorCode, message, element);
- parser.reportError(Constants.ERROR, error);
- }
-
- /**
- * Report a recoverable error to the parser.
- * @param element The element in which the error occured (normally 'this'
- * but it could also be an expression/pattern/etc.)
- * @param parser The XSLT parser to report the error to.
- * @param error The error code (from util/ErrorMsg).
- * @param message Any additional error message.
- */
- protected void reportWarning(SyntaxTreeNode element, Parser parser,
- String errorCode, String message) {
- final ErrorMsg error = new ErrorMsg(errorCode, message, element);
- parser.reportError(Constants.WARNING, error);
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Template.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Template.java
deleted file mode 100644
index c683744..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Template.java
+++ /dev/null
@@ -1,339 +0,0 @@
-/*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NamedMethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-import com.sun.org.apache.xml.internal.utils.XML11Char;
-import java.util.List;
-import java.util.Vector;
-
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- * @author Erwin Bolwidt <ejb@klomp.org>
- */
-public final class Template extends TopLevelElement {
-
- private QName _name; // The name of the template (if any)
- private QName _mode; // Mode in which this template is instantiated.
- private Pattern _pattern; // Matching pattern defined for this template.
- private double _priority; // Matching priority of this template.
- private int _position; // Position within stylesheet (prio. resolution)
- private boolean _disabled = false;
- private boolean _compiled = false;//make sure it is compiled only once
- private boolean _simplified = false;
-
- // True if this is a simple named template. A simple named
- // template is a template which only has a name but no match pattern.
- private boolean _isSimpleNamedTemplate = false;
-
- // The list of parameters in this template. This is only used
- // for simple named templates.
- private Vector<Param> _parameters = new Vector<>();
-
- public boolean hasParams() {
- return _parameters.size() > 0;
- }
-
- public boolean isSimplified() {
- return(_simplified);
- }
-
- public void setSimplified() {
- _simplified = true;
- }
-
- public boolean isSimpleNamedTemplate() {
- return _isSimpleNamedTemplate;
- }
-
- public void addParameter(Param param) {
- _parameters.addElement(param);
- }
-
- public Vector<Param> getParameters() {
- return _parameters;
- }
-
- public void disable() {
- _disabled = true;
- }
-
- public boolean disabled() {
- return(_disabled);
- }
-
- public double getPriority() {
- return _priority;
- }
-
- public int getPosition() {
- return(_position);
- }
-
- public boolean isNamed() {
- return _name != null;
- }
-
- public Pattern getPattern() {
- return _pattern;
- }
-
- public QName getName() {
- return _name;
- }
-
- public void setName(QName qname) {
- if (_name == null) _name = qname;
- }
-
- public QName getModeName() {
- return _mode;
- }
-
- /**
- * Compare this template to another. First checks priority, then position.
- */
- public int compareTo(Object template) {
- Template other = (Template)template;
- if (_priority > other._priority)
- return 1;
- else if (_priority < other._priority)
- return -1;
- else if (_position > other._position)
- return 1;
- else if (_position < other._position)
- return -1;
- else
- return 0;
- }
-
- public void display(int indent) {
- Util.println('\n');
- indent(indent);
- if (_name != null) {
- indent(indent);
- Util.println("name = " + _name);
- }
- else if (_pattern != null) {
- indent(indent);
- Util.println("match = " + _pattern.toString());
- }
- if (_mode != null) {
- indent(indent);
- Util.println("mode = " + _mode);
- }
- displayContents(indent + IndentIncrement);
- }
-
- private boolean resolveNamedTemplates(Template other, Parser parser) {
-
- if (other == null) return true;
-
- SymbolTable stable = parser.getSymbolTable();
-
- final int us = this.getImportPrecedence();
- final int them = other.getImportPrecedence();
-
- if (us > them) {
- other.disable();
- return true;
- }
- else if (us < them) {
- stable.addTemplate(other);
- this.disable();
- return true;
- }
- else {
- return false;
- }
- }
-
- private Stylesheet _stylesheet = null;
-
- public Stylesheet getStylesheet() {
- return _stylesheet;
- }
-
- public void parseContents(Parser parser) {
-
- final String name = getAttribute("name");
- final String mode = getAttribute("mode");
- final String match = getAttribute("match");
- final String priority = getAttribute("priority");
-
- _stylesheet = super.getStylesheet();
-
- if (name.length() > 0) {
- if (!XML11Char.isXML11ValidQName(name)) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_QNAME_ERR, name, this);
- parser.reportError(Constants.ERROR, err);
- }
- _name = parser.getQNameIgnoreDefaultNs(name);
- }
-
- if (mode.length() > 0) {
- if (!XML11Char.isXML11ValidQName(mode)) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_QNAME_ERR, mode, this);
- parser.reportError(Constants.ERROR, err);
- }
- _mode = parser.getQNameIgnoreDefaultNs(mode);
- }
-
- if (match.length() > 0) {
- _pattern = parser.parsePattern(this, "match", null);
- }
-
- if (priority.length() > 0) {
- _priority = Double.parseDouble(priority);
- }
- else {
- if (_pattern != null)
- _priority = _pattern.getPriority();
- else
- _priority = Double.NaN;
- }
-
- _position = parser.getTemplateIndex();
-
- // Add the (named) template to the symbol table
- if (_name != null) {
- Template other = parser.getSymbolTable().addTemplate(this);
- if (!resolveNamedTemplates(other, parser)) {
- ErrorMsg err =
- new ErrorMsg(ErrorMsg.TEMPLATE_REDEF_ERR, _name, this);
- parser.reportError(Constants.ERROR, err);
- }
- // Is this a simple named template?
- if (_pattern == null && _mode == null) {
- _isSimpleNamedTemplate = true;
- }
- }
-
- if (_parent instanceof Stylesheet) {
- ((Stylesheet)_parent).addTemplate(this);
- }
-
- parser.setTemplate(this); // set current template
- parseChildren(parser);
- parser.setTemplate(null); // clear template
- }
-
- /**
- * When the parser realises that it is dealign with a simplified stylesheet
- * it will create an empty Stylesheet object with the root element of the
- * stylesheet (a LiteralElement object) as its only child. The Stylesheet
- * object will then create this Template object and invoke this method to
- * force some specific behaviour. What we need to do is:
- * o) create a pattern matching on the root node
- * o) add the LRE root node (the only child of the Stylesheet) as our
- * only child node
- * o) set the empty Stylesheet as our parent
- * o) set this template as the Stylesheet's only child
- */
- public void parseSimplified(Stylesheet stylesheet, Parser parser) {
-
- _stylesheet = stylesheet;
- setParent(stylesheet);
-
- _name = null;
- _mode = null;
- _priority = Double.NaN;
- _pattern = parser.parsePattern(this, "/");
-
- final List<SyntaxTreeNode> contents = _stylesheet.getContents();
- final SyntaxTreeNode root = contents.get(0);
-
- if (root instanceof LiteralElement) {
- addElement(root);
- root.setParent(this);
- contents.set(0, this);
- parser.setTemplate(this);
- root.parseContents(parser);
- parser.setTemplate(null);
- }
- }
-
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- if (_pattern != null) {
- _pattern.typeCheck(stable);
- }
-
- return typeCheckContents(stable);
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- if (_disabled) return;
- // bug fix #4433133, add a call to named template from applyTemplates
- String className = classGen.getClassName();
-
- if (_compiled && isNamed()){
- String methodName = Util.escape(_name.toString());
- il.append(classGen.loadTranslet());
- il.append(methodGen.loadDOM());
- il.append(methodGen.loadIterator());
- il.append(methodGen.loadHandler());
- il.append(methodGen.loadCurrentNode());
- il.append(new INVOKEVIRTUAL(cpg.addMethodref(className,
- methodName,
- "("
- + DOM_INTF_SIG
- + NODE_ITERATOR_SIG
- + TRANSLET_OUTPUT_SIG
- + "I)V")));
- return;
- }
-
- if (_compiled) return;
- _compiled = true;
-
- // %OPT% Special handling for simple named templates.
- if (_isSimpleNamedTemplate && methodGen instanceof NamedMethodGenerator) {
- int numParams = _parameters.size();
- NamedMethodGenerator namedMethodGen = (NamedMethodGenerator)methodGen;
-
- // Update load/store instructions to access Params from the stack
- for (int i = 0; i < numParams; i++) {
- Param param = (Param)_parameters.elementAt(i);
- param.setLoadInstruction(namedMethodGen.loadParameter(i));
- param.setStoreInstruction(namedMethodGen.storeParameter(i));
- }
- }
-
- translateContents(classGen, methodGen);
- il.setPositions(true);
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/TestSeq.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/TestSeq.java
deleted file mode 100644
index d8ca7e8..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/TestSeq.java
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: TestSeq.java,v 1.2.4.1 2005/09/12 11:31:38 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.GOTO_W;
-import com.sun.org.apache.bcel.internal.generic.InstructionHandle;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import java.util.Map;
-import java.util.Vector;
-
-/**
- * A test sequence is a sequence of patterns that
- *
- * (1) occured in templates in the same mode
- * (2) share the same kernel node type (e.g. A/B and C/C/B)
- * (3) may also contain patterns matching "*" and "node()"
- * (element sequence only) or matching "@*" (attribute
- * sequence only).
- *
- * A test sequence may have a default template, which will be
- * instantiated if none of the other patterns match.
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Erwin Bolwidt <ejb@klomp.org>
- * @author Morten Jorgensen <morten.jorgensen@sun.com>
- */
-final class TestSeq {
-
- /**
- * Integer code for the kernel type of this test sequence
- */
- private int _kernelType;
-
- /**
- * Vector of all patterns in the test sequence. May include
- * patterns with "*", "@*" or "node()" kernel.
- */
- private Vector _patterns = null;
-
- /**
- * A reference to the Mode object.
- */
- private Mode _mode = null;
-
- /**
- * Default template for this test sequence
- */
- private Template _default = null;
-
- /**
- * Instruction list representing this test sequence.
- */
- private InstructionList _instructionList;
-
- /**
- * Cached handle to avoid compiling more than once.
- */
- private InstructionHandle _start = null;
-
- /**
- * Creates a new test sequence given a set of patterns and a mode.
- */
- public TestSeq(Vector patterns, Mode mode) {
- this(patterns, -2, mode);
- }
-
- public TestSeq(Vector patterns, int kernelType, Mode mode) {
- _patterns = patterns;
- _kernelType = kernelType;
- _mode = mode;
- }
-
- /**
- * Returns a string representation of this test sequence. Notice
- * that test sequences are mutable, so the value returned by this
- * method is different before and after calling reduce().
- */
- public String toString() {
- final int count = _patterns.size();
- final StringBuffer result = new StringBuffer();
-
- for (int i = 0; i < count; i++) {
- final LocationPathPattern pattern =
- (LocationPathPattern) _patterns.elementAt(i);
-
- if (i == 0) {
- result.append("Testseq for kernel ").append(_kernelType)
- .append('\n');
- }
- result.append(" pattern ").append(i).append(": ")
- .append(pattern.toString())
- .append('\n');
- }
- return result.toString();
- }
-
- /**
- * Returns the instruction list for this test sequence
- */
- public InstructionList getInstructionList() {
- return _instructionList;
- }
-
- /**
- * Return the highest priority for a pattern in this test
- * sequence. This is either the priority of the first or
- * of the default pattern.
- */
- public double getPriority() {
- final Template template = (_patterns.size() == 0) ? _default
- : ((Pattern) _patterns.elementAt(0)).getTemplate();
- return template.getPriority();
- }
-
- /**
- * Returns the position of the highest priority pattern in
- * this test sequence.
- */
- public int getPosition() {
- final Template template = (_patterns.size() == 0) ? _default
- : ((Pattern) _patterns.elementAt(0)).getTemplate();
- return template.getPosition();
- }
-
- /**
- * Reduce the patterns in this test sequence. Creates a new
- * vector of patterns and sets the default pattern if it
- * finds a patterns that is fully reduced.
- */
- public void reduce() {
- final Vector newPatterns = new Vector();
-
- final int count = _patterns.size();
- for (int i = 0; i < count; i++) {
- final LocationPathPattern pattern =
- (LocationPathPattern)_patterns.elementAt(i);
-
- // Reduce this pattern
- pattern.reduceKernelPattern();
-
- // Is this pattern fully reduced?
- if (pattern.isWildcard()) {
- _default = pattern.getTemplate();
- break; // Ignore following patterns
- }
- else {
- newPatterns.addElement(pattern);
- }
- }
- _patterns = newPatterns;
- }
-
- /**
- * Returns, by reference, the templates that are included in
- * this test sequence. Note that a single template can occur
- * in several test sequences if its pattern is a union.
- */
- public void findTemplates(Map<Template, Object> templates) {
- if (_default != null) {
- templates.put(_default, this);
- }
- for (int i = 0; i < _patterns.size(); i++) {
- final LocationPathPattern pattern =
- (LocationPathPattern)_patterns.elementAt(i);
- templates.put(pattern.getTemplate(), this);
- }
- }
-
- /**
- * Get the instruction handle to a template's code. This is
- * used when a single template occurs in several test
- * sequences; that is, if its pattern is a union of patterns
- * (e.g. match="A/B | A/C").
- */
- private InstructionHandle getTemplateHandle(Template template) {
- return (InstructionHandle)_mode.getTemplateInstructionHandle(template);
- }
-
- /**
- * Returns pattern n in this test sequence
- */
- private LocationPathPattern getPattern(int n) {
- return (LocationPathPattern)_patterns.elementAt(n);
- }
-
- /**
- * Compile the code for this test sequence. Compile patterns
- * from highest to lowest priority. Note that since patterns
- * can be share by multiple test sequences, instruction lists
- * must be copied before backpatching.
- */
- public InstructionHandle compile(ClassGenerator classGen,
- MethodGenerator methodGen,
- InstructionHandle continuation)
- {
- // Returned cached value if already compiled
- if (_start != null) {
- return _start;
- }
-
- // If not patterns, then return handle for default template
- final int count = _patterns.size();
- if (count == 0) {
- return (_start = getTemplateHandle(_default));
- }
-
- // Init handle to jump when all patterns failed
- InstructionHandle fail = (_default == null) ? continuation
- : getTemplateHandle(_default);
-
- // Compile all patterns in reverse order
- for (int n = count - 1; n >= 0; n--) {
- final LocationPathPattern pattern = getPattern(n);
- final Template template = pattern.getTemplate();
- final InstructionList il = new InstructionList();
-
- // Patterns expect current node on top of stack
- il.append(methodGen.loadCurrentNode());
-
- // Apply the test-code compiled for the pattern
- InstructionList ilist = methodGen.getInstructionList(pattern);
- if (ilist == null) {
- ilist = pattern.compile(classGen, methodGen);
- methodGen.addInstructionList(pattern, ilist);
- }
-
- // Make a copy of the instruction list for backpatching
- InstructionList copyOfilist = ilist.copy();
-
- FlowList trueList = pattern.getTrueList();
- if (trueList != null) {
- trueList = trueList.copyAndRedirect(ilist, copyOfilist);
- }
- FlowList falseList = pattern.getFalseList();
- if (falseList != null) {
- falseList = falseList.copyAndRedirect(ilist, copyOfilist);
- }
-
- il.append(copyOfilist);
-
- // On success branch to the template code
- final InstructionHandle gtmpl = getTemplateHandle(template);
- final InstructionHandle success = il.append(new GOTO_W(gtmpl));
-
- if (trueList != null) {
- trueList.backPatch(success);
- }
- if (falseList != null) {
- falseList.backPatch(fail);
- }
-
- // Next pattern's 'fail' target is this pattern's first instruction
- fail = il.getStart();
-
- // Append existing instruction list to the end of this one
- if (_instructionList != null) {
- il.append(_instructionList);
- }
-
- // Set current instruction list to be this one
- _instructionList = il;
- }
- return (_start = fail);
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Text.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Text.java
deleted file mode 100644
index 3c62f2b..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Text.java
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Text.java,v 1.2.4.1 2005/09/12 11:33:09 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.GETSTATIC;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- */
-final class Text extends Instruction {
-
- private String _text;
- private boolean _escaping = true;
- private boolean _ignore = false;
- private boolean _textElement = false;
-
- /**
- * Create a blank Text syntax tree node.
- */
- public Text() {
- _textElement = true;
- }
-
- /**
- * Create text syntax tree node.
- * @param text is the text to put in the node.
- */
- public Text(String text) {
- _text = text;
- }
-
- /**
- * Returns the text wrapped inside this node
- * @return The text wrapped inside this node
- */
- protected String getText() {
- return _text;
- }
-
- /**
- * Set the text for this node. Appends the given text to any already
- * existing text (using string concatenation, so use only when needed).
- * @param text is the text to wrap inside this node.
- */
- protected void setText(String text) {
- if (_text == null)
- _text = text;
- else
- _text = _text + text;
- }
-
- public void display(int indent) {
- indent(indent);
- Util.println("Text");
- indent(indent + IndentIncrement);
- Util.println(_text);
- }
-
- public void parseContents(Parser parser) {
- final String str = getAttribute("disable-output-escaping");
- if ((str != null) && (str.equals("yes"))) _escaping = false;
-
- parseChildren(parser);
-
- if (_text == null) {
- if (_textElement) {
- _text = EMPTYSTRING;
- }
- else {
- _ignore = true;
- }
- }
- else if (_textElement) {
- if (_text.length() == 0) _ignore = true;
- }
- else if (getParent() instanceof LiteralElement) {
- LiteralElement element = (LiteralElement)getParent();
- String space = element.getAttribute("xml:space");
- if ((space == null) || (!space.equals("preserve")))
- {
- int i;
- final int textLength = _text.length();
- for (i = 0; i < textLength; i++) {
- char c = _text.charAt(i);
- if (!isWhitespace(c))
- break;
- }
- if (i == textLength)
- _ignore = true;
- }
- }
- else {
- int i;
- final int textLength = _text.length();
- for (i = 0; i < textLength; i++)
- {
- char c = _text.charAt(i);
- if (!isWhitespace(c))
- break;
- }
- if (i == textLength)
- _ignore = true;
- }
- }
-
- public void ignore() {
- _ignore = true;
- }
-
- public boolean isIgnore() {
- return _ignore;
- }
-
- public boolean isTextElement() {
- return _textElement;
- }
-
- protected boolean contextDependent() {
- return false;
- }
-
- private static boolean isWhitespace(char c)
- {
- return (c == 0x20 || c == 0x09 || c == 0x0A || c == 0x0D);
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- if (!_ignore) {
- // Turn off character escaping if so is wanted.
- final int esc = cpg.addInterfaceMethodref(OUTPUT_HANDLER,
- "setEscaping", "(Z)Z");
- if (!_escaping) {
- il.append(methodGen.loadHandler());
- il.append(new PUSH(cpg, false));
- il.append(new INVOKEINTERFACE(esc, 2));
- }
-
- il.append(methodGen.loadHandler());
-
- // Call characters(String) or characters(char[],int,int), as
- // appropriate.
- if (!canLoadAsArrayOffsetLength()) {
- final int characters = cpg.addInterfaceMethodref(OUTPUT_HANDLER,
- "characters",
- "("+STRING_SIG+")V");
- il.append(new PUSH(cpg, _text));
- il.append(new INVOKEINTERFACE(characters, 2));
- } else {
- final int characters = cpg.addInterfaceMethodref(OUTPUT_HANDLER,
- "characters",
- "([CII)V");
- loadAsArrayOffsetLength(classGen, methodGen);
- il.append(new INVOKEINTERFACE(characters, 4));
- }
-
- // Restore character escaping setting to whatever it was.
- // Note: setEscaping(bool) returns the original (old) value
- if (!_escaping) {
- il.append(methodGen.loadHandler());
- il.append(SWAP);
- il.append(new INVOKEINTERFACE(esc, 2));
- il.append(POP);
- }
- }
- translateContents(classGen, methodGen);
- }
-
- /**
- * Check whether this Text node can be stored in a char[] in the translet.
- * Calling this is precondition to calling loadAsArrayOffsetLength.
- * @see #loadAsArrayOffsetLength(ClassGenerator,MethodGenerator)
- * @return true if this Text node can be
- */
- public boolean canLoadAsArrayOffsetLength() {
- // Magic number! 21845*3 == 65535. BCEL uses a DataOutputStream to
- // serialize class files. The Java run-time places a limit on the size
- // of String data written using a DataOutputStream - it cannot require
- // more than 64KB when represented as UTF-8. The number of bytes
- // required to represent a Java string as UTF-8 cannot be greater
- // than three times the number of char's in the string, hence the
- // check for 21845.
-
- return (_text.length() <= 21845);
- }
-
- /**
- * Generates code that loads the array that will contain the character
- * data represented by this Text node, followed by the offset of the
- * data from the start of the array, and then the length of the data.
- *
- * The pre-condition to calling this method is that
- * canLoadAsArrayOffsetLength() returns true.
- * @see #canLoadArrayOffsetLength()
- */
- public void loadAsArrayOffsetLength(ClassGenerator classGen,
- MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- final XSLTC xsltc = classGen.getParser().getXSLTC();
-
- // The XSLTC object keeps track of character data
- // that is to be stored in char arrays.
- final int offset = xsltc.addCharacterData(_text);
- final int length = _text.length();
- String charDataFieldName =
- STATIC_CHAR_DATA_FIELD + (xsltc.getCharacterDataCount()-1);
-
- il.append(new GETSTATIC(cpg.addFieldref(xsltc.getClassName(),
- charDataFieldName,
- STATIC_CHAR_DATA_FIELD_SIG)));
- il.append(new PUSH(cpg, offset));
- il.append(new PUSH(cpg, _text.length()));
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/TopLevelElement.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/TopLevelElement.java
deleted file mode 100644
index d167684..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/TopLevelElement.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: TopLevelElement.java,v 1.5 2005/09/28 13:48:17 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import java.util.Vector;
-
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-
-class TopLevelElement extends SyntaxTreeNode {
-
- /*
- * List of dependencies with other variables, parameters or
- * keys defined at the top level.
- */
- protected Vector _dependencies = null;
-
- /**
- * Type check all the children of this node.
- */
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- return typeCheckContents(stable);
- }
-
- /**
- * Translate this node into JVM bytecodes.
- */
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- ErrorMsg msg = new ErrorMsg(ErrorMsg.NOT_IMPLEMENTED_ERR,
- getClass(), this);
- getParser().reportError(FATAL, msg);
- }
-
- /**
- * Translate this node into a fresh instruction list.
- * The original instruction list is saved and restored.
- */
- public InstructionList compile(ClassGenerator classGen,
- MethodGenerator methodGen) {
- final InstructionList result, save = methodGen.getInstructionList();
- methodGen.setInstructionList(result = new InstructionList());
- translate(classGen, methodGen);
- methodGen.setInstructionList(save);
- return result;
- }
-
- public void display(int indent) {
- indent(indent);
- Util.println("TopLevelElement");
- displayContents(indent + IndentIncrement);
- }
-
- /**
- * Add a dependency with other top-level elements like
- * variables, parameters or keys.
- */
- public void addDependency(TopLevelElement other) {
- if (_dependencies == null) {
- _dependencies = new Vector();
- }
- if (!_dependencies.contains(other)) {
- _dependencies.addElement(other);
- }
- }
-
- /**
- * Get the list of dependencies with other top-level elements
- * like variables, parameteres or keys.
- */
- public Vector getDependencies() {
- return _dependencies;
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/TransletOutput.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/TransletOutput.java
deleted file mode 100644
index 99911f9..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/TransletOutput.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: TransletOutput.java,v 1.2.4.1 2005/09/05 09:19:44 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
-import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.StringType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-
-/**
- * @author Morten Jorgensen
- */
-final class TransletOutput extends Instruction {
-
- private Expression _filename;
- private boolean _append;
-
- /**
- * Displays the contents of this <xsltc:output> element.
- */
- public void display(int indent) {
- indent(indent);
- Util.println("TransletOutput: " + _filename);
- }
-
- /**
- * Parse the contents of this <xsltc:output> element. The only attribute
- * we recognise is the 'file' attribute that contains teh output filename.
- */
- public void parseContents(Parser parser) {
- // Get the output filename from the 'file' attribute
- String filename = getAttribute("file");
-
- // If the 'append' attribute is set to "yes" or "true",
- // the output is appended to the file.
- String append = getAttribute("append");
-
- // Verify that the filename is in fact set
- if ((filename == null) || (filename.equals(EMPTYSTRING))) {
- reportError(this, parser, ErrorMsg.REQUIRED_ATTR_ERR, "file");
- }
-
- // Save filename as an attribute value template
- _filename = AttributeValue.create(this, filename, parser);
-
- if (append != null && (append.toLowerCase().equals("yes") ||
- append.toLowerCase().equals("true"))) {
- _append = true;
- }
- else
- _append = false;
-
- parseChildren(parser);
- }
-
- /**
- * Type checks the 'file' attribute (must be able to convert it to a str).
- */
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- final Type type = _filename.typeCheck(stable);
- if (type instanceof StringType == false) {
- _filename = new CastExpr(_filename, Type.String);
- }
- typeCheckContents(stable);
- return Type.Void;
- }
-
- /**
- * Compile code that opens the give file for output, dumps the contents of
- * the element to the file, then closes the file.
- */
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- final boolean isSecureProcessing = classGen.getParser().getXSLTC()
- .isSecureProcessing();
-
- if (isSecureProcessing) {
- int index = cpg.addMethodref(BASIS_LIBRARY_CLASS,
- "unallowed_extension_elementF",
- "(Ljava/lang/String;)V");
- il.append(new PUSH(cpg, "redirect"));
- il.append(new INVOKESTATIC(index));
- return;
- }
-
- // Save the current output handler on the stack
- il.append(methodGen.loadHandler());
-
- final int open = cpg.addMethodref(TRANSLET_CLASS,
- "openOutputHandler",
- "(" + STRING_SIG + "Z)" +
- TRANSLET_OUTPUT_SIG);
-
- final int close = cpg.addMethodref(TRANSLET_CLASS,
- "closeOutputHandler",
- "("+TRANSLET_OUTPUT_SIG+")V");
-
- // Create the new output handler (leave it on stack)
- il.append(classGen.loadTranslet());
- _filename.translate(classGen, methodGen);
- il.append(new PUSH(cpg, _append));
- il.append(new INVOKEVIRTUAL(open));
-
- // Overwrite current handler
- il.append(methodGen.storeHandler());
-
- // Translate contents with substituted handler
- translateContents(classGen, methodGen);
-
- // Close the output handler (close file)
- il.append(classGen.loadTranslet());
- il.append(methodGen.loadHandler());
- il.append(new INVOKEVIRTUAL(close));
-
- // Restore old output handler from stack
- il.append(methodGen.storeHandler());
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/UnaryOpExpr.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/UnaryOpExpr.java
deleted file mode 100644
index 367b13b..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/UnaryOpExpr.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: UnaryOpExpr.java,v 1.2.4.1 2005/09/05 09:21:00 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-final class UnaryOpExpr extends Expression {
- private Expression _left;
-
- public UnaryOpExpr(Expression left) {
- (_left = left).setParent(this);
- }
-
- /**
- * Returns true if this expressions contains a call to position(). This is
- * needed for context changes in node steps containing multiple predicates.
- */
- public boolean hasPositionCall() {
- return(_left.hasPositionCall());
- }
-
- /**
- * Returns true if this expressions contains a call to last()
- */
- public boolean hasLastCall() {
- return(_left.hasLastCall());
- }
-
- public void setParser(Parser parser) {
- super.setParser(parser);
- _left.setParser(parser);
- }
-
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- final Type tleft = _left.typeCheck(stable);
- final MethodType ptype = lookupPrimop(stable, "u-",
- new MethodType(Type.Void,
- tleft));
-
- if (ptype != null) {
- final Type arg1 = (Type) ptype.argsType().elementAt(0);
- if (!arg1.identicalTo(tleft)) {
- _left = new CastExpr(_left, arg1);
- }
- return _type = ptype.resultType();
- }
-
- throw new TypeCheckError(this);
- }
-
- public String toString() {
- return "u-" + '(' + _left + ')';
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- InstructionList il = methodGen.getInstructionList();
- _left.translate(classGen, methodGen);
- il.append(_type.NEG());
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/UnionPathExpr.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/UnionPathExpr.java
deleted file mode 100644
index 5cb06be..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/UnionPathExpr.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: UnionPathExpr.java,v 1.2.4.1 2005/09/12 11:34:14 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import java.util.Vector;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
-import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.NEW;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xml.internal.dtm.Axis;
-import com.sun.org.apache.xml.internal.dtm.DTM;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-final class UnionPathExpr extends Expression {
-
- private final Expression _pathExpr;
- private final Expression _rest;
- private boolean _reverse = false;
-
- // linearization for top level UnionPathExprs
- private Expression[] _components;
-
- public UnionPathExpr(Expression pathExpr, Expression rest) {
- _pathExpr = pathExpr;
- _rest = rest;
- }
-
- public void setParser(Parser parser) {
- super.setParser(parser);
- // find all expressions in this Union
- final Vector components = new Vector();
- flatten(components);
- final int size = components.size();
- _components = (Expression[])components.toArray(new Expression[size]);
- for (int i = 0; i < size; i++) {
- _components[i].setParser(parser);
- _components[i].setParent(this);
- if (_components[i] instanceof Step) {
- final Step step = (Step)_components[i];
- final int axis = step.getAxis();
- final int type = step.getNodeType();
- // Put attribute iterators first
- if ((axis == Axis.ATTRIBUTE) || (type == DTM.ATTRIBUTE_NODE)) {
- _components[i] = _components[0];
- _components[0] = step;
- }
- // Check if the union contains a reverse iterator
- if (Axis.isReverse(axis)) _reverse = true;
- }
- }
- // No need to reverse anything if another expression lies on top of this
- if (getParent() instanceof Expression) _reverse = false;
- }
-
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- final int length = _components.length;
- for (int i = 0; i < length; i++) {
- if (_components[i].typeCheck(stable) != Type.NodeSet) {
- _components[i] = new CastExpr(_components[i], Type.NodeSet);
- }
- }
- return _type = Type.NodeSet;
- }
-
- public String toString() {
- return "union(" + _pathExpr + ", " + _rest + ')';
- }
-
- private void flatten(Vector components) {
- components.addElement(_pathExpr);
- if (_rest != null) {
- if (_rest instanceof UnionPathExpr) {
- ((UnionPathExpr)_rest).flatten(components);
- }
- else {
- components.addElement(_rest);
- }
- }
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- final int init = cpg.addMethodref(UNION_ITERATOR_CLASS,
- "<init>",
- "("+DOM_INTF_SIG+")V");
- final int iter = cpg.addMethodref(UNION_ITERATOR_CLASS,
- ADD_ITERATOR,
- ADD_ITERATOR_SIG);
-
- // Create the UnionIterator and leave it on the stack
- il.append(new NEW(cpg.addClass(UNION_ITERATOR_CLASS)));
- il.append(DUP);
- il.append(methodGen.loadDOM());
- il.append(new INVOKESPECIAL(init));
-
- // Add the various iterators to the UnionIterator
- final int length = _components.length;
- for (int i = 0; i < length; i++) {
- _components[i].translate(classGen, methodGen);
- il.append(new INVOKEVIRTUAL(iter));
- }
-
- // Order the iterator only if strictly needed
- if (_reverse) {
- final int order = cpg.addInterfaceMethodref(DOM_INTF,
- ORDER_ITERATOR,
- ORDER_ITERATOR_SIG);
- il.append(methodGen.loadDOM());
- il.append(SWAP);
- il.append(methodGen.loadContextNode());
- il.append(new INVOKEINTERFACE(order, 3));
-
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/UnparsedEntityUriCall.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/UnparsedEntityUriCall.java
deleted file mode 100644
index b55edcf..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/UnparsedEntityUriCall.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: UnparsedEntityUriCall.java,v 1.2.4.1 2005/09/05 09:22:36 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import java.util.Vector;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.StringType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- */
-final class UnparsedEntityUriCall extends FunctionCall {
- private Expression _entity;
-
- public UnparsedEntityUriCall(QName fname, Vector arguments) {
- super(fname, arguments);
- _entity = argument();
- }
-
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- final Type entity = _entity.typeCheck(stable);
- if (entity instanceof StringType == false) {
- _entity = new CastExpr(_entity, Type.String);
- }
- return _type = Type.String;
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- // Feck the this pointer on the stack...
- il.append(methodGen.loadDOM());
- // ...then the entity name...
- _entity.translate(classGen, methodGen);
- // ...to get the URI from the DOM object.
- il.append(new INVOKEINTERFACE(
- cpg.addInterfaceMethodref(DOM_INTF,
- GET_UNPARSED_ENTITY_URI,
- GET_UNPARSED_ENTITY_URI_SIG),
- 2));
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/UnresolvedRef.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/UnresolvedRef.java
deleted file mode 100644
index 963e3c8..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/UnresolvedRef.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: UnresolvedRef.java,v 1.5 2005/09/28 13:48:17 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-
-/**
- * @author Morten Jorgensen
- */
-final class UnresolvedRef extends VariableRefBase {
-
- private QName _variableName = null;
- private VariableRefBase _ref = null;
-
- public UnresolvedRef(QName name) {
- super();
- _variableName = name;
- }
-
- public QName getName() {
- return(_variableName);
- }
-
- private ErrorMsg reportError() {
- ErrorMsg err = new ErrorMsg(ErrorMsg.VARIABLE_UNDEF_ERR,
- _variableName, this);
- getParser().reportError(Constants.ERROR, err);
- return(err);
- }
-
- private VariableRefBase resolve(Parser parser, SymbolTable stable) {
- // At this point the AST is already built and we should be able to
- // find any declared global variable or parameter
- VariableBase ref = parser.lookupVariable(_variableName);
- if (ref == null) {
- ref = (VariableBase)stable.lookupName(_variableName);
- }
- if (ref == null) {
- reportError();
- return null;
- }
-
- // If in a top-level element, create dependency to the referenced var
- _variable = ref;
- addParentDependency();
-
- if (ref instanceof Variable) {
- return new VariableRef((Variable) ref);
- }
- else if (ref instanceof Param) {
- return new ParameterRef((Param)ref);
- }
- return null;
- }
-
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- if (_ref != null) {
- final String name = _variableName.toString();
- ErrorMsg err = new ErrorMsg(ErrorMsg.CIRCULAR_VARIABLE_ERR,
- name, this);
- }
- if ((_ref = resolve(getParser(), stable)) != null) {
- return (_type = _ref.typeCheck(stable));
- }
- throw new TypeCheckError(reportError());
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- if (_ref != null)
- _ref.translate(classGen, methodGen);
- else
- reportError();
- }
-
- public String toString() {
- return "unresolved-ref()";
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/UnsupportedElement.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/UnsupportedElement.java
deleted file mode 100644
index e4c8e21..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/UnsupportedElement.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: UnsupportedElement.java,v 1.2.4.1 2005/09/05 09:26:51 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-import java.util.List;
-import java.util.Vector;
-
-/**
- * @author Morten Jorgensen
- */
-final class UnsupportedElement extends SyntaxTreeNode {
-
- private Vector _fallbacks = null;
- private ErrorMsg _message = null;
- private boolean _isExtension = false;
-
- /**
- * Basic consutrcor - stores element uri/prefix/localname
- */
- public UnsupportedElement(String uri, String prefix, String local, boolean isExtension) {
- super(uri, prefix, local);
- _isExtension = isExtension;
- }
-
- /**
- * There are different categories of unsupported elements (believe it
- * or not): there are elements within the XSLT namespace (these would
- * be elements that are not yet implemented), there are extensions of
- * other XSLT processors and there are unrecognised extension elements
- * of this XSLT processor. The error message passed to this method
- * should describe the unsupported element itself and what category
- * the element belongs in.
- */
- public void setErrorMessage(ErrorMsg message) {
- _message = message;
- }
-
- /**
- * Displays the contents of this element
- */
- public void display(int indent) {
- indent(indent);
- Util.println("Unsupported element = " + _qname.getNamespace() +
- ":" + _qname.getLocalPart());
- displayContents(indent + IndentIncrement);
- }
-
-
- /**
- * Scan and process all fallback children of the unsupported element.
- */
- private void processFallbacks(Parser parser) {
-
- List<SyntaxTreeNode> children = getContents();
- if (children != null) {
- final int count = children.size();
- for (int i = 0; i < count; i++) {
- SyntaxTreeNode child = children.get(i);
- if (child instanceof Fallback) {
- Fallback fallback = (Fallback)child;
- fallback.activate();
- fallback.parseContents(parser);
- if (_fallbacks == null) {
- _fallbacks = new Vector();
- }
- _fallbacks.addElement(child);
- }
- }
- }
- }
-
- /**
- * Find any fallback in the descendant nodes; then activate & parse it
- */
- public void parseContents(Parser parser) {
- processFallbacks(parser);
- }
-
- /**
- * Run type check on the fallback element (if any).
- */
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- if (_fallbacks != null) {
- int count = _fallbacks.size();
- for (int i = 0; i < count; i++) {
- Fallback fallback = (Fallback)_fallbacks.elementAt(i);
- fallback.typeCheck(stable);
- }
- }
- return Type.Void;
- }
-
- /**
- * Translate the fallback element (if any).
- */
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- if (_fallbacks != null) {
- int count = _fallbacks.size();
- for (int i = 0; i < count; i++) {
- Fallback fallback = (Fallback)_fallbacks.elementAt(i);
- fallback.translate(classGen, methodGen);
- }
- }
- // We only go into the else block in forward-compatibility mode, when
- // the unsupported element has no fallback.
- else {
- // If the unsupported element does not have any fallback child, then
- // at runtime, a runtime error should be raised when the unsupported
- // element is instantiated. Otherwise, no error is thrown.
- ConstantPoolGen cpg = classGen.getConstantPool();
- InstructionList il = methodGen.getInstructionList();
-
- final int unsupportedElem = cpg.addMethodref(BASIS_LIBRARY_CLASS, "unsupported_ElementF",
- "(" + STRING_SIG + "Z)V");
- il.append(new PUSH(cpg, getQName().toString()));
- il.append(new PUSH(cpg, _isExtension));
- il.append(new INVOKESTATIC(unsupportedElem));
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/UseAttributeSets.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/UseAttributeSets.java
deleted file mode 100644
index 3751ae3..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/UseAttributeSets.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: UseAttributeSets.java,v 1.5 2005/09/28 13:48:17 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import java.util.StringTokenizer;
-import java.util.Vector;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- */
-final class UseAttributeSets extends Instruction {
-
- // Only error that can occur:
- private final static String ATTR_SET_NOT_FOUND =
- "";
-
- // Contains the names of all references attribute sets
- private final Vector _sets = new Vector(2);
-
- /**
- * Constructur - define initial attribute sets to use
- */
- public UseAttributeSets(String setNames, Parser parser) {
- setParser(parser);
- addAttributeSets(setNames);
- }
-
- /**
- * This method is made public to enable an AttributeSet object to merge
- * itself with another AttributeSet (including any other AttributeSets
- * the two may inherit from).
- */
- public void addAttributeSets(String setNames) {
- if ((setNames != null) && (!setNames.equals(Constants.EMPTYSTRING))) {
- final StringTokenizer tokens = new StringTokenizer(setNames);
- while (tokens.hasMoreTokens()) {
- final QName qname =
- getParser().getQNameIgnoreDefaultNs(tokens.nextToken());
- _sets.add(qname);
- }
- }
- }
-
- /**
- * Do nada.
- */
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- return Type.Void;
- }
-
- /**
- * Generate a call to the method compiled for this attribute set
- */
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
-
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- final SymbolTable symbolTable = getParser().getSymbolTable();
-
- // Go through each attribute set and generate a method call
- for (int i=0; i<_sets.size(); i++) {
- // Get the attribute set name
- final QName name = (QName)_sets.elementAt(i);
- // Get the AttributeSet reference from the symbol table
- final AttributeSet attrs = symbolTable.lookupAttributeSet(name);
- // Compile the call to the set's method if the set exists
- if (attrs != null) {
- final String methodName = attrs.getMethodName();
- il.append(classGen.loadTranslet());
- il.append(methodGen.loadDOM());
- il.append(methodGen.loadIterator());
- il.append(methodGen.loadHandler());
- il.append(methodGen.loadCurrentNode());
- final int method = cpg.addMethodref(classGen.getClassName(),
- methodName, ATTR_SET_SIG);
- il.append(new INVOKESPECIAL(method));
- }
- // Generate an error if the attribute set does not exist
- else {
- final Parser parser = getParser();
- final String atrs = name.toString();
- reportError(this, parser, ErrorMsg.ATTRIBSET_UNDEF_ERR, atrs);
- }
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ValueOf.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ValueOf.java
deleted file mode 100644
index 9873edd..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ValueOf.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ValueOf.java,v 1.2.4.1 2005/09/05 09:30:04 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- */
-final class ValueOf extends Instruction {
- private Expression _select;
- private boolean _escaping = true;
- private boolean _isString = false;
-
- public void display(int indent) {
- indent(indent);
- Util.println("ValueOf");
- indent(indent + IndentIncrement);
- Util.println("select " + _select.toString());
- }
-
- public void parseContents(Parser parser) {
- _select = parser.parseExpression(this, "select", null);
-
- // make sure required attribute(s) have been set
- if (_select.isDummy()) {
- reportError(this, parser, ErrorMsg.REQUIRED_ATTR_ERR, "select");
- return;
- }
- final String str = getAttribute("disable-output-escaping");
- if ((str != null) && (str.equals("yes"))) _escaping = false;
- }
-
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- Type type = _select.typeCheck(stable);
-
- // Prefer to handle the value as a node; fall back to String, otherwise
- if (type != null && !type.identicalTo(Type.Node)) {
- /***
- *** %HZ% Would like to treat result-tree fragments in the same
- *** %HZ% way as node sets for value-of, but that's running into
- *** %HZ% some snags. Instead, they'll be converted to String
- if (type.identicalTo(Type.ResultTree)) {
- _select = new CastExpr(new CastExpr(_select, Type.NodeSet),
- Type.Node);
- } else
- ***/
- if (type.identicalTo(Type.NodeSet)) {
- _select = new CastExpr(_select, Type.Node);
- } else {
- _isString = true;
- if (!type.identicalTo(Type.String)) {
- _select = new CastExpr(_select, Type.String);
- }
- _isString = true;
- }
- }
- return Type.Void;
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- final int setEscaping = cpg.addInterfaceMethodref(OUTPUT_HANDLER,
- "setEscaping","(Z)Z");
-
- // Turn off character escaping if so is wanted.
- if (!_escaping) {
- il.append(methodGen.loadHandler());
- il.append(new PUSH(cpg,false));
- il.append(new INVOKEINTERFACE(setEscaping,2));
- }
-
- // Translate the contents. If the value is a string, use the
- // translet.characters(String, TranslatOutputHandler) method.
- // Otherwise, the value is a node, and the
- // dom.characters(int node, TransletOutputHandler) method can dispatch
- // the string value of the node to the output handler more efficiently.
- if (_isString) {
- final int characters = cpg.addMethodref(TRANSLET_CLASS,
- CHARACTERSW,
- CHARACTERSW_SIG);
-
- il.append(classGen.loadTranslet());
- _select.translate(classGen, methodGen);
- il.append(methodGen.loadHandler());
- il.append(new INVOKEVIRTUAL(characters));
- } else {
- final int characters = cpg.addInterfaceMethodref(DOM_INTF,
- CHARACTERS,
- CHARACTERS_SIG);
-
- il.append(methodGen.loadDOM());
- _select.translate(classGen, methodGen);
- il.append(methodGen.loadHandler());
- il.append(new INVOKEINTERFACE(characters, 3));
- }
-
- // Restore character escaping setting to whatever it was.
- if (!_escaping) {
- il.append(methodGen.loadHandler());
- il.append(SWAP);
- il.append(new INVOKEINTERFACE(setEscaping,2));
- il.append(POP);
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Variable.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Variable.java
deleted file mode 100644
index 3226a36..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Variable.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Variable.java,v 1.2.4.1 2005/09/12 11:36:46 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.classfile.Field;
-import com.sun.org.apache.bcel.internal.generic.ACONST_NULL;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.DCONST;
-import com.sun.org.apache.bcel.internal.generic.ICONST;
-import com.sun.org.apache.bcel.internal.generic.InstructionHandle;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.PUTFIELD;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.BooleanType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.IntType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.RealType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-
-final class Variable extends VariableBase {
-
- public int getIndex() {
- return (_local != null) ? _local.getIndex() : -1;
- }
-
- /**
- * Parse the contents of the variable
- */
- public void parseContents(Parser parser) {
- // Parse 'name' and 'select' attributes plus parameter contents
- super.parseContents(parser);
-
- // Add a ref to this var to its enclosing construct
- SyntaxTreeNode parent = getParent();
- if (parent instanceof Stylesheet) {
- // Mark this as a global variable
- _isLocal = false;
- // Check if a global variable with this name already exists...
- Variable var = parser.getSymbolTable().lookupVariable(_name);
- // ...and if it does we need to check import precedence
- if (var != null) {
- final int us = this.getImportPrecedence();
- final int them = var.getImportPrecedence();
- // It is an error if the two have the same import precedence
- if (us == them) {
- final String name = _name.toString();
- reportError(this, parser, ErrorMsg.VARIABLE_REDEF_ERR,name);
- }
- // Ignore this if previous definition has higher precedence
- else if (them > us) {
- _ignore = true;
- copyReferences(var);
- return;
- }
- else {
- var.copyReferences(this);
- var.disable();
- }
- // Add this variable if we have higher precedence
- }
- ((Stylesheet)parent).addVariable(this);
- parser.getSymbolTable().addVariable(this);
- }
- else {
- _isLocal = true;
- }
- }
-
- /**
- * Runs a type check on either the variable element body or the
- * expression in the 'select' attribute
- */
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
-
- // Type check the 'select' expression if present
- if (_select != null) {
- _type = _select.typeCheck(stable);
- }
- // Type check the element contents otherwise
- else if (hasContents()) {
- typeCheckContents(stable);
- _type = Type.ResultTree;
- }
- else {
- _type = Type.Reference;
- }
- // The return type is void as the variable element does not leave
- // anything on the JVM's stack. The '_type' global will be returned
- // by the references to this variable, and not by the variable itself.
- return Type.Void;
- }
-
- /**
- * This method is part of a little trick that is needed to use local
- * variables inside nested for-each loops. See the initializeVariables()
- * method in the ForEach class for an explanation
- */
- public void initialize(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- // This is only done for local variables that are actually used
- if (isLocal() && !_refs.isEmpty()) {
- // Create a variable slot if none is allocated
- if (_local == null) {
- _local = methodGen.addLocalVariable2(getEscapedName(),
- _type.toJCType(),
- null);
- }
- // Push the default value on the JVM's stack
- if ((_type instanceof IntType) ||
- (_type instanceof NodeType) ||
- (_type instanceof BooleanType))
- il.append(new ICONST(0)); // 0 for node-id, integer and boolean
- else if (_type instanceof RealType)
- il.append(new DCONST(0)); // 0.0 for floating point numbers
- else
- il.append(new ACONST_NULL()); // and 'null' for anything else
-
- // Mark the store as the start of the live range of the variable
- _local.setStart(il.append(_type.STORE(_local.getIndex())));
-
- }
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- // Don't generate code for unreferenced variables
- if (_refs.isEmpty()) {
- _ignore = true;
- }
-
- // Make sure that a variable instance is only compiled once
- if (_ignore) return;
- _ignore = true;
-
- final String name = getEscapedName();
-
- if (isLocal()) {
- // Compile variable value computation
- translateValue(classGen, methodGen);
-
- // Add a new local variable and store value
- boolean createLocal = _local == null;
- if (createLocal) {
- mapRegister(methodGen);
- }
- InstructionHandle storeInst =
- il.append(_type.STORE(_local.getIndex()));
-
- // If the local is just being created, mark the store as the start
- // of its live range. Note that it might have been created by
- // initializeVariables already, which would have set the start of
- // the live range already.
- if (createLocal) {
- _local.setStart(storeInst);
- }
- }
- else {
- String signature = _type.toSignature();
-
- // Global variables are store in class fields
- if (classGen.containsField(name) == null) {
- classGen.addField(new Field(ACC_PUBLIC,
- cpg.addUtf8(name),
- cpg.addUtf8(signature),
- null, cpg.getConstantPool()));
-
- // Push a reference to "this" for putfield
- il.append(classGen.loadTranslet());
- // Compile variable value computation
- translateValue(classGen, methodGen);
- // Store the variable in the allocated field
- il.append(new PUTFIELD(cpg.addFieldref(classGen.getClassName(),
- name, signature)));
- }
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/VariableBase.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/VariableBase.java
deleted file mode 100644
index 02e1a5f..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/VariableBase.java
+++ /dev/null
@@ -1,299 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import java.util.Vector;
-
-import com.sun.org.apache.bcel.internal.generic.CHECKCAST;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.Instruction;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
-import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
-import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
-import com.sun.org.apache.bcel.internal.generic.NEW;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeSetType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ResultTreeType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-import com.sun.org.apache.xml.internal.utils.XML11Char;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- * @author Erwin Bolwidt <ejb@klomp.org>
- * @author John Howard <JohnH@schemasoft.com>
- */
-class VariableBase extends TopLevelElement {
-
- protected QName _name; // The name of the variable.
- protected String _escapedName; // The escaped qname of the variable.
- protected Type _type; // The type of this variable.
- protected boolean _isLocal; // True if the variable is local.
- protected LocalVariableGen _local; // Reference to JVM variable
- protected Instruction _loadInstruction; // Instruction to load JVM variable
- protected Instruction _storeInstruction; // Instruction to load JVM variable
- protected Expression _select; // Reference to variable expression
- protected String select; // Textual repr. of variable expr.
-
- // References to this variable (when local)
- protected Vector<VariableRefBase> _refs = new Vector<>(2);
-
- // Used to make sure parameter field is not added twice
- protected boolean _ignore = false;
-
- /**
- * Disable this variable/parameter
- */
- public void disable() {
- _ignore = true;
- }
-
- /**
- * Add a reference to this variable. Called by VariableRef when an
- * expression contains a reference to this variable.
- */
- public void addReference(VariableRefBase vref) {
- _refs.addElement(vref);
- }
-
- /**
- * When a variable is overriden by another, e.g. via xsl:import,
- * its references need to be copied or otherwise it may be
- * compiled away as dead code. This method can be used for that
- * purpose.
- */
- public void copyReferences(VariableBase var) {
- final int size = _refs.size();
- for (int i = 0; i < size; i++) {
- var.addReference(_refs.get(i));
- }
- }
-
- /**
- * Map this variable to a register
- */
- public void mapRegister(MethodGenerator methodGen) {
- if (_local == null) {
- final InstructionList il = methodGen.getInstructionList();
- final String name = getEscapedName(); // TODO: namespace ?
- final com.sun.org.apache.bcel.internal.generic.Type varType = _type.toJCType();
- _local = methodGen.addLocalVariable2(name, varType, il.getEnd());
- }
- }
-
- /**
- * Remove the mapping of this variable to a register.
- * Called when we leave the AST scope of the variable's declaration
- */
- public void unmapRegister(ClassGenerator classGen, MethodGenerator methodGen) {
- if (_local != null) {
- if (_type instanceof ResultTreeType) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- if (classGen.getStylesheet().callsNodeset() && classGen.getDOMClass().equals(MULTI_DOM_CLASS)) {
- final int removeDA = cpg.addMethodref(MULTI_DOM_CLASS, "removeDOMAdapter", "(" + DOM_ADAPTER_SIG + ")V");
- il.append(methodGen.loadDOM());
- il.append(new CHECKCAST(cpg.addClass(MULTI_DOM_CLASS)));
- il.append(loadInstruction());
- il.append(new CHECKCAST(cpg.addClass(DOM_ADAPTER_CLASS)));
- il.append(new INVOKEVIRTUAL(removeDA));
- }
- final int release = cpg.addInterfaceMethodref(DOM_IMPL_CLASS, "release", "()V");
- il.append(loadInstruction());
- il.append(new INVOKEINTERFACE(release, 1));
- }
-
- _local.setEnd(methodGen.getInstructionList().getEnd());
- methodGen.removeLocalVariable(_local);
- _refs = null;
- _local = null;
- }
- }
-
- /**
- * Returns an instruction for loading the value of this variable onto
- * the JVM stack.
- */
- public Instruction loadInstruction() {
- if (_loadInstruction == null) {
- _loadInstruction = _type.LOAD(_local.getIndex());
- }
- return _loadInstruction;
- }
-
- /**
- * Returns an instruction for storing a value from the JVM stack
- * into this variable.
- */
- public Instruction storeInstruction() {
- if (_storeInstruction == null) {
- _storeInstruction = _type.STORE(_local.getIndex());
- }
- return _storeInstruction;
- }
-
- /**
- * Returns the expression from this variable's select attribute (if any)
- */
- public Expression getExpression() {
- return(_select);
- }
-
- /**
- * Display variable as single string
- */
- public String toString() {
- return("variable("+_name+")");
- }
-
- /**
- * Display variable in a full AST dump
- */
- public void display(int indent) {
- indent(indent);
- System.out.println("Variable " + _name);
- if (_select != null) {
- indent(indent + IndentIncrement);
- System.out.println("select " + _select.toString());
- }
- displayContents(indent + IndentIncrement);
- }
-
- /**
- * Returns the type of the variable
- */
- public Type getType() {
- return _type;
- }
-
- /**
- * Returns the name of the variable or parameter as it will occur in the
- * compiled translet.
- */
- public QName getName() {
- return _name;
- }
-
- /**
- * Returns the escaped qname of the variable or parameter
- */
- public String getEscapedName() {
- return _escapedName;
- }
-
- /**
- * Set the name of the variable or paremeter. Escape all special chars.
- */
- public void setName(QName name) {
- _name = name;
- _escapedName = Util.escape(name.getStringRep());
- }
-
- /**
- * Returns the true if the variable is local
- */
- public boolean isLocal() {
- return _isLocal;
- }
-
- /**
- * Parse the contents of the <xsl:decimal-format> element.
- */
- public void parseContents(Parser parser) {
- // Get the 'name attribute
- String name = getAttribute("name");
-
- if (name.length() > 0) {
- if (!XML11Char.isXML11ValidQName(name)) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_QNAME_ERR, name, this);
- parser.reportError(Constants.ERROR, err);
- }
- setName(parser.getQNameIgnoreDefaultNs(name));
- }
- else
- reportError(this, parser, ErrorMsg.REQUIRED_ATTR_ERR, "name");
-
- // Check whether variable/param of the same name is already in scope
- VariableBase other = parser.lookupVariable(_name);
- if ((other != null) && (other.getParent() == getParent())) {
- reportError(this, parser, ErrorMsg.VARIABLE_REDEF_ERR, name);
- }
-
- select = getAttribute("select");
- if (select.length() > 0) {
- _select = getParser().parseExpression(this, "select", null);
- if (_select.isDummy()) {
- reportError(this, parser, ErrorMsg.REQUIRED_ATTR_ERR, "select");
- return;
- }
- }
-
- // Children must be parsed first -> static scoping
- parseChildren(parser);
- }
-
- /**
- * Compile the value of the variable, which is either in an expression in
- * a 'select' attribute, or in the variable elements body
- */
- public void translateValue(ClassGenerator classGen,
- MethodGenerator methodGen) {
- // Compile expression is 'select' attribute if present
- if (_select != null) {
- _select.translate(classGen, methodGen);
- // Create a CachedNodeListIterator for select expressions
- // in a variable or parameter.
- if (_select.getType() instanceof NodeSetType) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- final int initCNI = cpg.addMethodref(CACHED_NODE_LIST_ITERATOR_CLASS,
- "<init>",
- "("
- +NODE_ITERATOR_SIG
- +")V");
- il.append(new NEW(cpg.addClass(CACHED_NODE_LIST_ITERATOR_CLASS)));
- il.append(DUP_X1);
- il.append(SWAP);
-
- il.append(new INVOKESPECIAL(initCNI));
- }
- _select.startIterator(classGen, methodGen);
- }
- // If not, compile result tree from parameter body if present.
- else if (hasContents()) {
- compileResultTree(classGen, methodGen);
- }
- // If neither are present then store empty string in variable
- else {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- il.append(new PUSH(cpg, Constants.EMPTYSTRING));
- }
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/VariableRef.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/VariableRef.java
deleted file mode 100644
index fe918b0..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/VariableRef.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: VariableRef.java,v 1.2.4.1 2005/09/05 09:33:50 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.CHECKCAST;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.GETFIELD;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeSetType;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- * @author Erwin Bolwidt <ejb@klomp.org>
- */
-final class VariableRef extends VariableRefBase {
-
- public VariableRef(Variable variable) {
- super(variable);
- }
-
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- // Fall-through for variables that are implemented as methods
- if (_type.implementedAsMethod()) return;
-
- final String name = _variable.getEscapedName();
- final String signature = _type.toSignature();
-
- if (_variable.isLocal()) {
- if (classGen.isExternal()) {
- Closure variableClosure = _closure;
- while (variableClosure != null) {
- if (variableClosure.inInnerClass()) break;
- variableClosure = variableClosure.getParentClosure();
- }
-
- if (variableClosure != null) {
- il.append(ALOAD_0);
- il.append(new GETFIELD(
- cpg.addFieldref(variableClosure.getInnerClassName(),
- name, signature)));
- }
- else {
- il.append(_variable.loadInstruction());
- }
- }
- else {
- il.append(_variable.loadInstruction());
- }
- }
- else {
- final String className = classGen.getClassName();
- il.append(classGen.loadTranslet());
- if (classGen.isExternal()) {
- il.append(new CHECKCAST(cpg.addClass(className)));
- }
- il.append(new GETFIELD(cpg.addFieldref(className,name,signature)));
- }
-
- if (_variable.getType() instanceof NodeSetType) {
- // The method cloneIterator() also does resetting
- final int clone = cpg.addInterfaceMethodref(NODE_ITERATOR,
- "cloneIterator",
- "()" +
- NODE_ITERATOR_SIG);
- il.append(new INVOKEINTERFACE(clone, 1));
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/VariableRefBase.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/VariableRefBase.java
deleted file mode 100644
index 76cee04..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/VariableRefBase.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: VariableRefBase.java,v 1.5 2005/09/28 13:48:18 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import java.util.Objects;
-
-/**
- * @author Morten Jorgensen
- * @author Santiago Pericas-Geertsen
- */
-class VariableRefBase extends Expression {
-
- /**
- * A reference to the associated variable.
- */
- protected VariableBase _variable;
-
- /**
- * A reference to the enclosing expression/instruction for which a
- * closure is needed (Predicate, Number or Sort).
- */
- protected Closure _closure = null;
-
- public VariableRefBase(VariableBase variable) {
- _variable = variable;
- variable.addReference(this);
- }
-
- public VariableRefBase() {
- _variable = null;
- }
-
- /**
- * Returns a reference to the associated variable
- */
- public VariableBase getVariable() {
- return _variable;
- }
-
- /**
- * If this variable reference is in a top-level element like
- * another variable, param or key, add a dependency between
- * that top-level element and the referenced variable. For
- * example,
- *
- * <xsl:variable name="x" .../>
- * <xsl:variable name="y" select="$x + 1"/>
- *
- * and assuming this class represents "$x", add a reference
- * between variable y and variable x.
- */
- public void addParentDependency() {
- SyntaxTreeNode node = this;
- while (node != null && node instanceof TopLevelElement == false) {
- node = node.getParent();
- }
-
- TopLevelElement parent = (TopLevelElement) node;
- if (parent != null) {
- VariableBase var = _variable;
- if (_variable._ignore) {
- if (_variable instanceof Variable) {
- var = parent.getSymbolTable()
- .lookupVariable(_variable._name);
- } else if (_variable instanceof Param) {
- var = parent.getSymbolTable().lookupParam(_variable._name);
- }
- }
-
- parent.addDependency(var);
- }
- }
-
- /**
- * Two variable references are deemed equal if they refer to the
- * same variable.
- */
- @Override
- public boolean equals(Object obj) {
- return obj == this || (obj instanceof VariableRefBase)
- && (_variable == ((VariableRefBase) obj)._variable);
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(this._variable);
- }
-
- /**
- * Returns a string representation of this variable reference on the
- * format 'variable-ref(<var-name>)'.
- * @return Variable reference description
- */
- @Override
- public String toString() {
- return "variable-ref("+_variable.getName()+'/'+_variable.getType()+')';
- }
-
- @Override
- public Type typeCheck(SymbolTable stable)
- throws TypeCheckError
- {
- // Returned cached type if available
- if (_type != null) return _type;
-
- // Find nearest closure to add a variable reference
- if (_variable.isLocal()) {
- SyntaxTreeNode node = getParent();
- do {
- if (node instanceof Closure) {
- _closure = (Closure) node;
- break;
- }
- if (node instanceof TopLevelElement) {
- break; // way up in the tree
- }
- node = node.getParent();
- } while (node != null);
-
- if (_closure != null) {
- _closure.addVariable(this);
- }
- }
-
- // Attempt to get the cached variable type
- _type = _variable.getType();
-
- // If that does not work we must force a type-check (this is normally
- // only needed for globals in included/imported stylesheets
- if (_type == null) {
- _variable.typeCheck(stable);
- _type = _variable.getType();
- }
-
- // If in a top-level element, create dependency to the referenced var
- addParentDependency();
-
- // Return the type of the referenced variable
- return _type;
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/When.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/When.java
deleted file mode 100644
index 9efe142..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/When.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: When.java,v 1.2.4.1 2005/09/05 09:36:58 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.BooleanType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- */
-final class When extends Instruction {
-
- private Expression _test;
- private boolean _ignore = false;
-
- public void display(int indent) {
- indent(indent);
- Util.println("When");
- indent(indent + IndentIncrement);
- System.out.print("test ");
- Util.println(_test.toString());
- displayContents(indent + IndentIncrement);
- }
-
- public Expression getTest() {
- return _test;
- }
-
- public boolean ignore() {
- return(_ignore);
- }
-
- public void parseContents(Parser parser) {
- _test = parser.parseExpression(this, "test", null);
-
- // Ignore xsl:if when test is false (function-available() and
- // element-available())
- Object result = _test.evaluateAtCompileTime();
- if (result != null && result instanceof Boolean) {
- _ignore = !((Boolean) result).booleanValue();
- }
-
- parseChildren(parser);
-
- // Make sure required attribute(s) have been set
- if (_test.isDummy()) {
- reportError(this, parser, ErrorMsg.REQUIRED_ATTR_ERR, "test");
- }
- }
-
- /**
- * Type-check this when element. The test should always be type checked,
- * while we do not bother with the contents if we know the test fails.
- * This is important in cases where the "test" expression tests for
- * the support of a non-available element, and the <xsl:when> body contains
- * this non-available element.
- */
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- // Type-check the test expression
- if (_test.typeCheck(stable) instanceof BooleanType == false) {
- _test = new CastExpr(_test, Type.Boolean);
- }
- // Type-check the contents (if necessary)
- if (!_ignore) {
- typeCheckContents(stable);
- }
-
- return Type.Void;
- }
-
- /**
- * This method should never be called. An Otherwise object will explicitly
- * translate the "test" expression and and contents of this element.
- */
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final ErrorMsg msg = new ErrorMsg(ErrorMsg.STRAY_WHEN_ERR, this);
- getParser().reportError(Constants.ERROR, msg);
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Whitespace.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Whitespace.java
deleted file mode 100644
index edfa5a8..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Whitespace.java
+++ /dev/null
@@ -1,532 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Whitespace.java,v 1.5 2005/09/28 13:48:18 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import java.util.StringTokenizer;
-import java.util.Vector;
-
-import com.sun.org.apache.bcel.internal.generic.ALOAD;
-import com.sun.org.apache.bcel.internal.generic.BranchHandle;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.IF_ICMPEQ;
-import com.sun.org.apache.bcel.internal.generic.ILOAD;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
-import com.sun.org.apache.bcel.internal.generic.InstructionHandle;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-
-/**
- * @author Morten Jorgensen
- */
-final class Whitespace extends TopLevelElement {
- // Three possible actions for the translet:
- public static final int USE_PREDICATE = 0;
- public static final int STRIP_SPACE = 1;
- public static final int PRESERVE_SPACE = 2;
-
- // The 3 different categories of strip/preserve rules (order important)
- public static final int RULE_NONE = 0;
- public static final int RULE_ELEMENT = 1; // priority 0
- public static final int RULE_NAMESPACE = 2; // priority -1/4
- public static final int RULE_ALL = 3; // priority -1/2
-
- private String _elementList;
- private int _action;
- private int _importPrecedence;
-
- /**
- * Auxillary class for encapsulating a single strip/preserve rule
- */
- private final static class WhitespaceRule {
- private final int _action;
- private String _namespace; // Should be replaced by NS type (int)
- private String _element; // Should be replaced by node type (int)
- private int _type;
- private int _priority;
-
- /**
- * Strip/preserve rule constructor
- */
- public WhitespaceRule(int action, String element, int precedence) {
- // Determine the action (strip or preserve) for this rule
- _action = action;
-
- // Get the namespace and element name for this rule
- final int colon = element.lastIndexOf(':');
- if (colon >= 0) {
- _namespace = element.substring(0,colon);
- _element = element.substring(colon+1,element.length());
- }
- else {
- _namespace = Constants.EMPTYSTRING;
- _element = element;
- }
-
- // Determine the initial priority for this rule
- _priority = precedence << 2;
-
- // Get the strip/preserve type; either "NS:EL", "NS:*" or "*"
- if (_element.equals("*")) {
- if (_namespace == Constants.EMPTYSTRING) {
- _type = RULE_ALL; // Strip/preserve _all_ elements
- _priority += 2; // Lowest priority
- }
- else {
- _type = RULE_NAMESPACE; // Strip/reserve elements within NS
- _priority += 1; // Medium priority
- }
- }
- else {
- _type = RULE_ELEMENT; // Strip/preserve single element
- }
- }
-
- /**
- * For sorting rules depending on priority
- */
- public int compareTo(WhitespaceRule other) {
- return _priority < other._priority
- ? -1
- : _priority > other._priority ? 1 : 0;
- }
-
- public int getAction() { return _action; }
- public int getStrength() { return _type; }
- public int getPriority() { return _priority; }
- public String getElement() { return _element; }
- public String getNamespace() { return _namespace; }
- }
-
- /**
- * Parse the attributes of the xsl:strip/preserve-space element.
- * The element should have not contents (ignored if any).
- */
- public void parseContents(Parser parser) {
- // Determine if this is an xsl:strip- or preserve-space element
- _action = _qname.getLocalPart().endsWith("strip-space")
- ? STRIP_SPACE : PRESERVE_SPACE;
-
- // Determine the import precedence
- _importPrecedence = parser.getCurrentImportPrecedence();
-
- // Get the list of elements to strip/preserve
- _elementList = getAttribute("elements");
- if (_elementList == null || _elementList.length() == 0) {
- reportError(this, parser, ErrorMsg.REQUIRED_ATTR_ERR, "elements");
- return;
- }
-
- final SymbolTable stable = parser.getSymbolTable();
- StringTokenizer list = new StringTokenizer(_elementList);
- StringBuffer elements = new StringBuffer(Constants.EMPTYSTRING);
-
- while (list.hasMoreElements()) {
- String token = list.nextToken();
- String prefix;
- String namespace;
- int col = token.indexOf(':');
-
- if (col != -1) {
- namespace = lookupNamespace(token.substring(0,col));
- if (namespace != null) {
- elements.append(namespace).append(':').append(token.substring(col + 1));
- } else {
- elements.append(token);
- }
- } else {
- elements.append(token);
- }
-
- if (list.hasMoreElements())
- elements.append(" ");
- }
- _elementList = elements.toString();
- }
-
-
- /**
- * De-tokenize the elements listed in the 'elements' attribute and
- * instanciate a set of strip/preserve rules.
- */
- public Vector getRules() {
- final Vector rules = new Vector();
- // Go through each element and instanciate strip/preserve-object
- final StringTokenizer list = new StringTokenizer(_elementList);
- while (list.hasMoreElements()) {
- rules.add(new WhitespaceRule(_action,
- list.nextToken(),
- _importPrecedence));
- }
- return rules;
- }
-
-
- /**
- * Scans through the rules vector and looks for a rule of higher
- * priority that contradicts the current rule.
- */
- private static WhitespaceRule findContradictingRule(Vector rules,
- WhitespaceRule rule) {
- for (int i = 0; i < rules.size(); i++) {
- // Get the next rule in the prioritized list
- WhitespaceRule currentRule = (WhitespaceRule)rules.elementAt(i);
- // We only consider rules with higher priority
- if (currentRule == rule) {
- return null;
- }
-
- /*
- * See if there is a contradicting rule with higher priority.
- * If the rules has the same action then this rule is redundant,
- * if they have different action then this rule will never win.
- */
- switch (currentRule.getStrength()) {
- case RULE_ALL:
- return currentRule;
-
- case RULE_ELEMENT:
- if (!rule.getElement().equals(currentRule.getElement())) {
- break;
- }
- // intentional fall-through
- case RULE_NAMESPACE:
- if (rule.getNamespace().equals(currentRule.getNamespace())) {
- return currentRule;
- }
- break;
- }
- }
- return null;
- }
-
-
- /**
- * Orders a set or rules by priority, removes redundant rules and rules
- * that are shadowed by stronger, contradicting rules.
- */
- private static int prioritizeRules(Vector rules) {
- WhitespaceRule currentRule;
- int defaultAction = PRESERVE_SPACE;
-
- // Sort all rules with regard to priority
- quicksort(rules, 0, rules.size()-1);
-
- // Check if there are any "xsl:strip-space" elements at all.
- // If there are no xsl:strip elements we can ignore all xsl:preserve
- // elements and signal that all whitespaces should be preserved
- boolean strip = false;
- for (int i = 0; i < rules.size(); i++) {
- currentRule = (WhitespaceRule)rules.elementAt(i);
- if (currentRule.getAction() == STRIP_SPACE) {
- strip = true;
- }
- }
- // Return with default action: PRESERVE_SPACE
- if (!strip) {
- rules.removeAllElements();
- return PRESERVE_SPACE;
- }
-
- // Remove all rules that are contradicted by rules with higher priority
- for (int idx = 0; idx < rules.size(); ) {
- currentRule = (WhitespaceRule)rules.elementAt(idx);
-
- // Remove this single rule if it has no purpose
- if (findContradictingRule(rules,currentRule) != null) {
- rules.remove(idx);
- }
- else {
- // Remove all following rules if this one overrides all
- if (currentRule.getStrength() == RULE_ALL) {
- defaultAction = currentRule.getAction();
- for (int i = idx; i < rules.size(); i++) {
- rules.removeElementAt(i);
- }
- }
- // Skip to next rule (there might not be any)...
- idx++;
- }
- }
-
- // The rules vector could be empty if first rule has strength RULE_ALL
- if (rules.size() == 0) {
- return defaultAction;
- }
-
- // Now work backwards and strip away all rules that have the same
- // action as the default rule (no reason the check them at the end).
- do {
- currentRule = (WhitespaceRule)rules.lastElement();
- if (currentRule.getAction() == defaultAction) {
- rules.removeElementAt(rules.size() - 1);
- }
- else {
- break;
- }
- } while (rules.size() > 0);
-
- // Signal that whitespace detection predicate must be used.
- return defaultAction;
- }
-
- public static void compileStripSpace(BranchHandle strip[],
- int sCount,
- InstructionList il) {
- final InstructionHandle target = il.append(ICONST_1);
- il.append(IRETURN);
- for (int i = 0; i < sCount; i++) {
- strip[i].setTarget(target);
- }
- }
-
- public static void compilePreserveSpace(BranchHandle preserve[],
- int pCount,
- InstructionList il) {
- final InstructionHandle target = il.append(ICONST_0);
- il.append(IRETURN);
- for (int i = 0; i < pCount; i++) {
- preserve[i].setTarget(target);
- }
- }
-
- /*
- private static void compileDebug(ClassGenerator classGen,
- InstructionList il) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final int prt = cpg.addMethodref("java/lang/System/out",
- "println",
- "(Ljava/lang/String;)V");
- il.append(DUP);
- il.append(new INVOKESTATIC(prt));
- }
- */
-
- /**
- * Compiles the predicate method
- */
- private static void compilePredicate(Vector rules,
- int defaultAction,
- ClassGenerator classGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = new InstructionList();
- final XSLTC xsltc = classGen.getParser().getXSLTC();
-
- // private boolean Translet.stripSpace(int type) - cannot be static
- final MethodGenerator stripSpace =
- new MethodGenerator(ACC_PUBLIC | ACC_FINAL ,
- com.sun.org.apache.bcel.internal.generic.Type.BOOLEAN,
- new com.sun.org.apache.bcel.internal.generic.Type[] {
- Util.getJCRefType(DOM_INTF_SIG),
- com.sun.org.apache.bcel.internal.generic.Type.INT,
- com.sun.org.apache.bcel.internal.generic.Type.INT
- },
- new String[] { "dom","node","type" },
- "stripSpace",classGen.getClassName(),il,cpg);
-
- classGen.addInterface("com/sun/org/apache/xalan/internal/xsltc/StripFilter");
-
- final int paramDom = stripSpace.getLocalIndex("dom");
- final int paramCurrent = stripSpace.getLocalIndex("node");
- final int paramType = stripSpace.getLocalIndex("type");
-
- BranchHandle strip[] = new BranchHandle[rules.size()];
- BranchHandle preserve[] = new BranchHandle[rules.size()];
- int sCount = 0;
- int pCount = 0;
-
- // Traverse all strip/preserve rules
- for (int i = 0; i<rules.size(); i++) {
- // Get the next rule in the prioritised list
- WhitespaceRule rule = (WhitespaceRule)rules.elementAt(i);
-
- // Returns the namespace for a node in the DOM
- final int gns = cpg.addInterfaceMethodref(DOM_INTF,
- "getNamespaceName",
- "(I)Ljava/lang/String;");
-
- final int strcmp = cpg.addMethodref("java/lang/String",
- "compareTo",
- "(Ljava/lang/String;)I");
-
- // Handle elements="ns:*" type rule
- if (rule.getStrength() == RULE_NAMESPACE) {
- il.append(new ALOAD(paramDom));
- il.append(new ILOAD(paramCurrent));
- il.append(new INVOKEINTERFACE(gns,2));
- il.append(new PUSH(cpg, rule.getNamespace()));
- il.append(new INVOKEVIRTUAL(strcmp));
- il.append(ICONST_0);
-
- if (rule.getAction() == STRIP_SPACE) {
- strip[sCount++] = il.append(new IF_ICMPEQ(null));
- }
- else {
- preserve[pCount++] = il.append(new IF_ICMPEQ(null));
- }
- }
- // Handle elements="ns:el" type rule
- else if (rule.getStrength() == RULE_ELEMENT) {
- // Create the QName for the element
- final Parser parser = classGen.getParser();
- QName qname;
- if (rule.getNamespace() != Constants.EMPTYSTRING )
- qname = parser.getQName(rule.getNamespace(), null,
- rule.getElement());
- else
- qname = parser.getQName(rule.getElement());
-
- // Register the element.
- final int elementType = xsltc.registerElement(qname);
- il.append(new ILOAD(paramType));
- il.append(new PUSH(cpg, elementType));
-
- // Compare current node type with wanted element type
- if (rule.getAction() == STRIP_SPACE)
- strip[sCount++] = il.append(new IF_ICMPEQ(null));
- else
- preserve[pCount++] = il.append(new IF_ICMPEQ(null));
- }
- }
-
- if (defaultAction == STRIP_SPACE) {
- compileStripSpace(strip, sCount, il);
- compilePreserveSpace(preserve, pCount, il);
- }
- else {
- compilePreserveSpace(preserve, pCount, il);
- compileStripSpace(strip, sCount, il);
- }
-
- classGen.addMethod(stripSpace);
- }
-
- /**
- * Compiles the predicate method
- */
- private static void compileDefault(int defaultAction,
- ClassGenerator classGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = new InstructionList();
- final XSLTC xsltc = classGen.getParser().getXSLTC();
-
- // private boolean Translet.stripSpace(int type) - cannot be static
- final MethodGenerator stripSpace =
- new MethodGenerator(ACC_PUBLIC | ACC_FINAL ,
- com.sun.org.apache.bcel.internal.generic.Type.BOOLEAN,
- new com.sun.org.apache.bcel.internal.generic.Type[] {
- Util.getJCRefType(DOM_INTF_SIG),
- com.sun.org.apache.bcel.internal.generic.Type.INT,
- com.sun.org.apache.bcel.internal.generic.Type.INT
- },
- new String[] { "dom","node","type" },
- "stripSpace",classGen.getClassName(),il,cpg);
-
- classGen.addInterface("com/sun/org/apache/xalan/internal/xsltc/StripFilter");
-
- if (defaultAction == STRIP_SPACE)
- il.append(ICONST_1);
- else
- il.append(ICONST_0);
- il.append(IRETURN);
-
- classGen.addMethod(stripSpace);
- }
-
-
- /**
- * Takes a vector of WhitespaceRule objects and generates a predicate
- * method. This method returns the translets default action for handling
- * whitespace text-nodes:
- * - USE_PREDICATE (run the method generated by this method)
- * - STRIP_SPACE (always strip whitespace text-nodes)
- * - PRESERVE_SPACE (always preserve whitespace text-nodes)
- */
- public static int translateRules(Vector rules,
- ClassGenerator classGen) {
- // Get the core rules in prioritized order
- final int defaultAction = prioritizeRules(rules);
- // The rules vector may be empty after prioritising
- if (rules.size() == 0) {
- compileDefault(defaultAction,classGen);
- return defaultAction;
- }
- // Now - create a predicate method and sequence through rules...
- compilePredicate(rules, defaultAction, classGen);
- // Return with the translets required action (
- return USE_PREDICATE;
- }
-
- /**
- * Sorts a range of rules with regard to PRIORITY only
- */
- private static void quicksort(Vector rules, int p, int r) {
- while (p < r) {
- final int q = partition(rules, p, r);
- quicksort(rules, p, q);
- p = q + 1;
- }
- }
-
- /**
- * Used with quicksort method above
- */
- private static int partition(Vector rules, int p, int r) {
- final WhitespaceRule x = (WhitespaceRule)rules.elementAt((p+r) >>> 1);
- int i = p - 1, j = r + 1;
- while (true) {
- while (x.compareTo((WhitespaceRule)rules.elementAt(--j)) < 0) {
- }
- while (x.compareTo((WhitespaceRule)rules.elementAt(++i)) > 0) {
- }
- if (i < j) {
- final WhitespaceRule tmp = (WhitespaceRule)rules.elementAt(i);
- rules.setElementAt(rules.elementAt(j), i);
- rules.setElementAt(tmp, j);
- }
- else {
- return j;
- }
- }
- }
-
- /**
- * Type-check contents/attributes - nothing to do...
- */
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- return Type.Void; // We don't return anything.
- }
-
- /**
- * This method should not produce any code
- */
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/WithParam.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/WithParam.java
deleted file mode 100644
index 37d4cf9..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/WithParam.java
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.ALOAD;
-import com.sun.org.apache.bcel.internal.generic.ASTORE;
-import com.sun.org.apache.bcel.internal.generic.CHECKCAST;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ReferenceType;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-import com.sun.org.apache.xml.internal.utils.XML11Char;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- * @author John Howard <JohnH@schemasoft.com>
- */
-final class WithParam extends Instruction {
-
- /**
- * Parameter's name.
- */
- private QName _name;
-
- /**
- * The escaped qname of the with-param.
- */
- protected String _escapedName;
-
- /**
- * Parameter's default value.
- */
- private Expression _select;
-
- /**
- * Reference to JVM variable holding temporary result tree.
- */
- private LocalVariableGen _domAdapter;
-
- /**
- * %OPT% This is set to true when the WithParam is used in a CallTemplate
- * for a simple named template. If this is true, the parameters are
- * passed to the named template through method arguments rather than
- * using the expensive Translet.addParameter() call.
- */
- private boolean _doParameterOptimization = false;
-
- /**
- * Displays the contents of this element
- */
- public void display(int indent) {
- indent(indent);
- Util.println("with-param " + _name);
- if (_select != null) {
- indent(indent + IndentIncrement);
- Util.println("select " + _select.toString());
- }
- displayContents(indent + IndentIncrement);
- }
-
- /**
- * Returns the escaped qname of the parameter
- */
- public String getEscapedName() {
- return _escapedName;
- }
-
- /**
- * Return the name of this WithParam.
- */
- public QName getName() {
- return _name;
- }
-
- /**
- * Set the name of the variable or paremeter. Escape all special chars.
- */
- public void setName(QName name) {
- _name = name;
- _escapedName = Util.escape(name.getStringRep());
- }
-
- /**
- * Set the do parameter optimization flag
- */
- public void setDoParameterOptimization(boolean flag) {
- _doParameterOptimization = flag;
- }
-
- /**
- * The contents of a <xsl:with-param> elements are either in the element's
- * 'select' attribute (this has precedence) or in the element body.
- */
- public void parseContents(Parser parser) {
- final String name = getAttribute("name");
- if (name.length() > 0) {
- if (!XML11Char.isXML11ValidQName(name)) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_QNAME_ERR, name,
- this);
- parser.reportError(Constants.ERROR, err);
- }
- setName(parser.getQNameIgnoreDefaultNs(name));
- } else {
- reportError(this, parser, ErrorMsg.REQUIRED_ATTR_ERR, "name");
- }
-
- final String select = getAttribute("select");
- if (select.length() > 0) {
- _select = parser.parseExpression(this, "select", null);
- }
-
- parseChildren(parser);
- }
-
- /**
- * Type-check either the select attribute or the element body, depending
- * on which is in use.
- */
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- if (_select != null) {
- final Type tselect = _select.typeCheck(stable);
- if (tselect instanceof ReferenceType == false) {
- _select = new CastExpr(_select, Type.Reference);
- }
- } else {
- typeCheckContents(stable);
- }
- return Type.Void;
- }
-
- /**
- * Compile the value of the parameter, which is either in an expression in
- * a 'select' attribute, or in the with-param element's body
- */
- public void translateValue(ClassGenerator classGen,
- MethodGenerator methodGen)
- {
- // Compile expression is 'select' attribute if present
- if (_select != null) {
- _select.translate(classGen, methodGen);
- _select.startIterator(classGen, methodGen);
- // If not, compile result tree from parameter body if present.
- // Store result tree into local variable for releasing it later
- } else if (hasContents()) {
- final InstructionList il = methodGen.getInstructionList();
- compileResultTree(classGen, methodGen);
- _domAdapter = methodGen.addLocalVariable2("@" + _escapedName,
- Type.ResultTree.toJCType(),
- il.getEnd());
- il.append(DUP);
- il.append(new ASTORE(_domAdapter.getIndex()));
- // If neither are present then store empty string in parameter slot
- } else {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- il.append(new PUSH(cpg, Constants.EMPTYSTRING));
- }
- }
-
- /**
- * This code generates a sequence of bytecodes that call the
- * addParameter() method in AbstractTranslet. The method call will add
- * (or update) the parameter frame with the new parameter value.
- */
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- // Translate the value and put it on the stack
- if (_doParameterOptimization) {
- translateValue(classGen, methodGen);
- return;
- }
-
- // Make name acceptable for use as field name in class
- String name = Util.escape(getEscapedName());
-
- // Load reference to the translet (method is in AbstractTranslet)
- il.append(classGen.loadTranslet());
-
- // Load the name of the parameter
- il.append(new PUSH(cpg, name)); // TODO: namespace ?
- // Generete the value of the parameter (use value in 'select' by def.)
- translateValue(classGen, methodGen);
- // Mark this parameter value is not being the default value
- il.append(new PUSH(cpg, false));
- // Pass the parameter to the template
- il.append(new INVOKEVIRTUAL(cpg.addMethodref(TRANSLET_CLASS,
- ADD_PARAMETER,
- ADD_PARAMETER_SIG)));
- il.append(POP); // cleanup stack
- }
-
- /**
- * Release the compiled result tree.
- */
- public void releaseResultTree(ClassGenerator classGen,
- MethodGenerator methodGen)
- {
- if (_domAdapter != null) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- if (classGen.getStylesheet().callsNodeset() &&
- classGen.getDOMClass().equals(MULTI_DOM_CLASS))
- {
- final int removeDA =
- cpg.addMethodref(MULTI_DOM_CLASS, "removeDOMAdapter",
- "(" + DOM_ADAPTER_SIG + ")V");
- il.append(methodGen.loadDOM());
- il.append(new CHECKCAST(cpg.addClass(MULTI_DOM_CLASS)));
- il.append(new ALOAD(_domAdapter.getIndex()));
- il.append(new CHECKCAST(cpg.addClass(DOM_ADAPTER_CLASS)));
- il.append(new INVOKEVIRTUAL(removeDA));
- }
- final int release =
- cpg.addInterfaceMethodref(DOM_IMPL_CLASS, "release", "()V");
- il.append(new ALOAD(_domAdapter.getIndex()));
- il.append(new INVOKEINTERFACE(release, 1));
- _domAdapter.setEnd(il.getEnd());
- methodGen.removeLocalVariable(_domAdapter);
- _domAdapter = null;
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XPathLexer.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XPathLexer.java
deleted file mode 100644
index ecdd00f..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XPathLexer.java
+++ /dev/null
@@ -1,1619 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: xpath.lex,v 1.12 2005/08/02 02:59:03 mcnamara Exp $
- */
-/*
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-import com.sun.java_cup.internal.runtime.Symbol;
-
-
-class XPathLexer implements com.sun.java_cup.internal.runtime.Scanner {
- private final int YY_BUFFER_SIZE = 512;
- private final int YY_F = -1;
- private final int YY_NO_STATE = -1;
- private final int YY_NOT_ACCEPT = 0;
- private final int YY_START = 1;
- private final int YY_END = 2;
- private final int YY_NO_ANCHOR = 4;
- private final int YY_BOL = 65536;
- private final int YY_EOF = 65537;
- public final int YYEOF = -1;
-
- int last, beforeLast;
- void initialize() {
- last = beforeLast = -1;
- }
- static boolean isWhitespace(int c) {
- return (c == ' ' || c == '\t' || c == '\r' || c == '\n' || c == '\f');
- }
- /**
- * If symbol is not followed by '::' or '(', then treat it as a
- * name instead of an axis or function (Jira-1912).
- */
- Symbol disambiguateAxisOrFunction(int ss) throws Exception {
- // Peek in the input buffer without changing the internal state
- int index = yy_buffer_index;
- // Skip whitespace
- while (index < yy_buffer_read && isWhitespace(yy_buffer[index])) {
- index++;
- }
- // If end of buffer, can't disambiguate :(
- if (index >= yy_buffer_read) {
- // Can't disambiguate, so return as symbol
- return new Symbol(ss);
- }
- // Return symbol if next token is '::' or '('
- return (yy_buffer[index] == ':' && yy_buffer[index+1] == ':' ||
- yy_buffer[index] == '(') ?
- newSymbol(ss) : newSymbol(sym.QNAME, yytext());
- }
- /**
- * If symbol is first token or if it follows any of the operators
- * listed in http://www.w3.org/TR/xpath#exprlex then treat as a
- * name instead of a keyword (Jira-1912). Look two tokens behind
- * to desambiguate expressions like "* and *" or "and * and".
- */
- Symbol disambiguateOperator(int ss) throws Exception {
- switch (last) {
- case sym.STAR:
- if (beforeLast != sym.QNAME) break;
- case -1: // first token
- case sym.ATSIGN:
- case sym.DCOLON:
- case sym.LPAREN:
- case sym.LBRACK:
- case sym.COMMA:
- case sym.AND:
- case sym.OR:
- case sym.MOD:
- case sym.DIV:
- case sym.SLASH:
- case sym.DSLASH:
- case sym.VBAR:
- case sym.PLUS:
- case sym.MINUS:
- case sym.EQ:
- case sym.NE:
- case sym.LT:
- case sym.LE:
- case sym.GT:
- case sym.GE:
- return newSymbol(sym.QNAME, yytext());
- }
- return newSymbol(ss);
- }
- Symbol newSymbol(int ss) {
- beforeLast = last;
- last = ss;
- return new Symbol(ss);
- }
- Symbol newSymbol(int ss, String value) {
- beforeLast = last;
- last = ss;
- return new Symbol(ss, value);
- }
- Symbol newSymbol(int ss, Long value) {
- beforeLast = last;
- last = ss;
- return new Symbol(ss, value);
- }
- Symbol newSymbol(int ss, Double value) {
- beforeLast = last;
- last = ss;
- return new Symbol(ss, value);
- }
- private java.io.BufferedReader yy_reader;
- private int yy_buffer_index;
- private int yy_buffer_read;
- private int yy_buffer_start;
- private int yy_buffer_end;
- private char yy_buffer[];
- private boolean yy_at_bol;
- private int yy_lexical_state;
-
- XPathLexer (java.io.Reader reader) {
- this ();
- if (null == reader) {
- throw (new Error("Error: Bad input stream initializer."));
- }
- yy_reader = new java.io.BufferedReader(reader);
- }
-
- XPathLexer (java.io.InputStream instream) {
- this ();
- if (null == instream) {
- throw (new Error("Error: Bad input stream initializer."));
- }
- yy_reader = new java.io.BufferedReader(new java.io.InputStreamReader(instream));
- }
-
- private XPathLexer () {
- yy_buffer = new char[YY_BUFFER_SIZE];
- yy_buffer_read = 0;
- yy_buffer_index = 0;
- yy_buffer_start = 0;
- yy_buffer_end = 0;
- yy_at_bol = true;
- yy_lexical_state = YYINITIAL;
- }
-
- private boolean yy_eof_done = false;
- private final int YYINITIAL = 0;
- private final int yy_state_dtrans[] = {
- 0
- };
- private void yybegin (int state) {
- yy_lexical_state = state;
- }
- private int yy_advance ()
- throws java.io.IOException {
- int next_read;
- int i;
- int j;
-
- if (yy_buffer_index < yy_buffer_read) {
- return yy_buffer[yy_buffer_index++];
- }
-
- if (0 != yy_buffer_start) {
- i = yy_buffer_start;
- j = 0;
- while (i < yy_buffer_read) {
- yy_buffer[j] = yy_buffer[i];
- ++i;
- ++j;
- }
- yy_buffer_end = yy_buffer_end - yy_buffer_start;
- yy_buffer_start = 0;
- yy_buffer_read = j;
- yy_buffer_index = j;
- next_read = yy_reader.read(yy_buffer,
- yy_buffer_read,
- yy_buffer.length - yy_buffer_read);
- if (-1 == next_read) {
- return YY_EOF;
- }
- yy_buffer_read = yy_buffer_read + next_read;
- }
-
- while (yy_buffer_index >= yy_buffer_read) {
- if (yy_buffer_index >= yy_buffer.length) {
- yy_buffer = yy_double(yy_buffer);
- }
- next_read = yy_reader.read(yy_buffer,
- yy_buffer_read,
- yy_buffer.length - yy_buffer_read);
- if (-1 == next_read) {
- return YY_EOF;
- }
- yy_buffer_read = yy_buffer_read + next_read;
- }
- return yy_buffer[yy_buffer_index++];
- }
- private void yy_move_end () {
- if (yy_buffer_end > yy_buffer_start &&
- '\n' == yy_buffer[yy_buffer_end-1])
- yy_buffer_end--;
- if (yy_buffer_end > yy_buffer_start &&
- '\r' == yy_buffer[yy_buffer_end-1])
- yy_buffer_end--;
- }
- private boolean yy_last_was_cr=false;
- private void yy_mark_start () {
- yy_buffer_start = yy_buffer_index;
- }
- private void yy_mark_end () {
- yy_buffer_end = yy_buffer_index;
- }
- private void yy_to_mark () {
- yy_buffer_index = yy_buffer_end;
- yy_at_bol = (yy_buffer_end > yy_buffer_start) &&
- ('\r' == yy_buffer[yy_buffer_end-1] ||
- '\n' == yy_buffer[yy_buffer_end-1] ||
- 2028/*LS*/ == yy_buffer[yy_buffer_end-1] ||
- 2029/*PS*/ == yy_buffer[yy_buffer_end-1]);
- }
- private java.lang.String yytext () {
- return (new java.lang.String(yy_buffer,
- yy_buffer_start,
- yy_buffer_end - yy_buffer_start));
- }
- private int yylength () {
- return yy_buffer_end - yy_buffer_start;
- }
- private char[] yy_double (char buf[]) {
- int i;
- char newbuf[];
- newbuf = new char[2*buf.length];
- for (i = 0; i < buf.length; ++i) {
- newbuf[i] = buf[i];
- }
- return newbuf;
- }
- private final int YY_E_INTERNAL = 0;
- private final int YY_E_MATCH = 1;
- private java.lang.String yy_error_string[] = {
- "Error: Internal error.\n",
- "Error: Unmatched input.\n"
- };
- private void yy_error (int code,boolean fatal) {
- java.lang.System.out.print(yy_error_string[code]);
- java.lang.System.out.flush();
- if (fatal) {
- throw new Error("Fatal Error.\n");
- }
- }
- static private int[][] unpackFromString(int size1, int size2, String st) {
- int colonIndex = -1;
- String lengthString;
- int sequenceLength = 0;
- int sequenceInteger = 0;
-
- int commaIndex;
- String workString;
-
- int res[][] = new int[size1][size2];
- for (int i= 0; i < size1; i++) {
- for (int j= 0; j < size2; j++) {
- if (sequenceLength != 0) {
- res[i][j] = sequenceInteger;
- sequenceLength--;
- continue;
- }
- commaIndex = st.indexOf(',');
- workString = (commaIndex==-1) ? st :
- st.substring(0, commaIndex);
- st = st.substring(commaIndex+1);
- colonIndex = workString.indexOf(':');
- if (colonIndex == -1) {
- res[i][j]=Integer.parseInt(workString);
- continue;
- }
- lengthString =
- workString.substring(colonIndex+1);
- sequenceLength=Integer.parseInt(lengthString);
- workString=workString.substring(0,colonIndex);
- sequenceInteger=Integer.parseInt(workString);
- res[i][j] = sequenceInteger;
- sequenceLength--;
- }
- }
- return res;
- }
- private int yy_acpt[] = {
- /* 0 */ YY_NOT_ACCEPT,
- /* 1 */ YY_NO_ANCHOR,
- /* 2 */ YY_NO_ANCHOR,
- /* 3 */ YY_NO_ANCHOR,
- /* 4 */ YY_NO_ANCHOR,
- /* 5 */ YY_NO_ANCHOR,
- /* 6 */ YY_NO_ANCHOR,
- /* 7 */ YY_NO_ANCHOR,
- /* 8 */ YY_NO_ANCHOR,
- /* 9 */ YY_NO_ANCHOR,
- /* 10 */ YY_NO_ANCHOR,
- /* 11 */ YY_NO_ANCHOR,
- /* 12 */ YY_NO_ANCHOR,
- /* 13 */ YY_NO_ANCHOR,
- /* 14 */ YY_NO_ANCHOR,
- /* 15 */ YY_NO_ANCHOR,
- /* 16 */ YY_NO_ANCHOR,
- /* 17 */ YY_NO_ANCHOR,
- /* 18 */ YY_NO_ANCHOR,
- /* 19 */ YY_NO_ANCHOR,
- /* 20 */ YY_NO_ANCHOR,
- /* 21 */ YY_NO_ANCHOR,
- /* 22 */ YY_NO_ANCHOR,
- /* 23 */ YY_NO_ANCHOR,
- /* 24 */ YY_NO_ANCHOR,
- /* 25 */ YY_NO_ANCHOR,
- /* 26 */ YY_NO_ANCHOR,
- /* 27 */ YY_NO_ANCHOR,
- /* 28 */ YY_NO_ANCHOR,
- /* 29 */ YY_NO_ANCHOR,
- /* 30 */ YY_NO_ANCHOR,
- /* 31 */ YY_NO_ANCHOR,
- /* 32 */ YY_NO_ANCHOR,
- /* 33 */ YY_NO_ANCHOR,
- /* 34 */ YY_NO_ANCHOR,
- /* 35 */ YY_NO_ANCHOR,
- /* 36 */ YY_NO_ANCHOR,
- /* 37 */ YY_NO_ANCHOR,
- /* 38 */ YY_NO_ANCHOR,
- /* 39 */ YY_NO_ANCHOR,
- /* 40 */ YY_NO_ANCHOR,
- /* 41 */ YY_NO_ANCHOR,
- /* 42 */ YY_NO_ANCHOR,
- /* 43 */ YY_NO_ANCHOR,
- /* 44 */ YY_NO_ANCHOR,
- /* 45 */ YY_NO_ANCHOR,
- /* 46 */ YY_NO_ANCHOR,
- /* 47 */ YY_NO_ANCHOR,
- /* 48 */ YY_NO_ANCHOR,
- /* 49 */ YY_NO_ANCHOR,
- /* 50 */ YY_NO_ANCHOR,
- /* 51 */ YY_NO_ANCHOR,
- /* 52 */ YY_NO_ANCHOR,
- /* 53 */ YY_NO_ANCHOR,
- /* 54 */ YY_NO_ANCHOR,
- /* 55 */ YY_NO_ANCHOR,
- /* 56 */ YY_NO_ANCHOR,
- /* 57 */ YY_NO_ANCHOR,
- /* 58 */ YY_NO_ANCHOR,
- /* 59 */ YY_NO_ANCHOR,
- /* 60 */ YY_NO_ANCHOR,
- /* 61 */ YY_NO_ANCHOR,
- /* 62 */ YY_NO_ANCHOR,
- /* 63 */ YY_NO_ANCHOR,
- /* 64 */ YY_NOT_ACCEPT,
- /* 65 */ YY_NO_ANCHOR,
- /* 66 */ YY_NO_ANCHOR,
- /* 67 */ YY_NO_ANCHOR,
- /* 68 */ YY_NO_ANCHOR,
- /* 69 */ YY_NOT_ACCEPT,
- /* 70 */ YY_NO_ANCHOR,
- /* 71 */ YY_NO_ANCHOR,
- /* 72 */ YY_NOT_ACCEPT,
- /* 73 */ YY_NO_ANCHOR,
- /* 74 */ YY_NO_ANCHOR,
- /* 75 */ YY_NOT_ACCEPT,
- /* 76 */ YY_NO_ANCHOR,
- /* 77 */ YY_NO_ANCHOR,
- /* 78 */ YY_NOT_ACCEPT,
- /* 79 */ YY_NO_ANCHOR,
- /* 80 */ YY_NOT_ACCEPT,
- /* 81 */ YY_NO_ANCHOR,
- /* 82 */ YY_NOT_ACCEPT,
- /* 83 */ YY_NO_ANCHOR,
- /* 84 */ YY_NOT_ACCEPT,
- /* 85 */ YY_NO_ANCHOR,
- /* 86 */ YY_NOT_ACCEPT,
- /* 87 */ YY_NO_ANCHOR,
- /* 88 */ YY_NOT_ACCEPT,
- /* 89 */ YY_NO_ANCHOR,
- /* 90 */ YY_NOT_ACCEPT,
- /* 91 */ YY_NO_ANCHOR,
- /* 92 */ YY_NOT_ACCEPT,
- /* 93 */ YY_NO_ANCHOR,
- /* 94 */ YY_NOT_ACCEPT,
- /* 95 */ YY_NO_ANCHOR,
- /* 96 */ YY_NOT_ACCEPT,
- /* 97 */ YY_NO_ANCHOR,
- /* 98 */ YY_NOT_ACCEPT,
- /* 99 */ YY_NO_ANCHOR,
- /* 100 */ YY_NOT_ACCEPT,
- /* 101 */ YY_NO_ANCHOR,
- /* 102 */ YY_NOT_ACCEPT,
- /* 103 */ YY_NO_ANCHOR,
- /* 104 */ YY_NOT_ACCEPT,
- /* 105 */ YY_NO_ANCHOR,
- /* 106 */ YY_NOT_ACCEPT,
- /* 107 */ YY_NO_ANCHOR,
- /* 108 */ YY_NOT_ACCEPT,
- /* 109 */ YY_NO_ANCHOR,
- /* 110 */ YY_NOT_ACCEPT,
- /* 111 */ YY_NO_ANCHOR,
- /* 112 */ YY_NOT_ACCEPT,
- /* 113 */ YY_NO_ANCHOR,
- /* 114 */ YY_NOT_ACCEPT,
- /* 115 */ YY_NO_ANCHOR,
- /* 116 */ YY_NOT_ACCEPT,
- /* 117 */ YY_NO_ANCHOR,
- /* 118 */ YY_NOT_ACCEPT,
- /* 119 */ YY_NO_ANCHOR,
- /* 120 */ YY_NOT_ACCEPT,
- /* 121 */ YY_NO_ANCHOR,
- /* 122 */ YY_NOT_ACCEPT,
- /* 123 */ YY_NO_ANCHOR,
- /* 124 */ YY_NOT_ACCEPT,
- /* 125 */ YY_NO_ANCHOR,
- /* 126 */ YY_NOT_ACCEPT,
- /* 127 */ YY_NO_ANCHOR,
- /* 128 */ YY_NO_ANCHOR,
- /* 129 */ YY_NO_ANCHOR,
- /* 130 */ YY_NO_ANCHOR,
- /* 131 */ YY_NO_ANCHOR,
- /* 132 */ YY_NO_ANCHOR,
- /* 133 */ YY_NO_ANCHOR,
- /* 134 */ YY_NO_ANCHOR,
- /* 135 */ YY_NO_ANCHOR,
- /* 136 */ YY_NO_ANCHOR,
- /* 137 */ YY_NO_ANCHOR,
- /* 138 */ YY_NO_ANCHOR,
- /* 139 */ YY_NO_ANCHOR,
- /* 140 */ YY_NO_ANCHOR,
- /* 141 */ YY_NO_ANCHOR,
- /* 142 */ YY_NO_ANCHOR,
- /* 143 */ YY_NO_ANCHOR,
- /* 144 */ YY_NO_ANCHOR,
- /* 145 */ YY_NO_ANCHOR,
- /* 146 */ YY_NO_ANCHOR,
- /* 147 */ YY_NO_ANCHOR,
- /* 148 */ YY_NO_ANCHOR,
- /* 149 */ YY_NO_ANCHOR,
- /* 150 */ YY_NO_ANCHOR,
- /* 151 */ YY_NO_ANCHOR,
- /* 152 */ YY_NO_ANCHOR,
- /* 153 */ YY_NO_ANCHOR,
- /* 154 */ YY_NO_ANCHOR,
- /* 155 */ YY_NO_ANCHOR,
- /* 156 */ YY_NO_ANCHOR,
- /* 157 */ YY_NO_ANCHOR,
- /* 158 */ YY_NO_ANCHOR,
- /* 159 */ YY_NO_ANCHOR,
- /* 160 */ YY_NO_ANCHOR,
- /* 161 */ YY_NO_ANCHOR,
- /* 162 */ YY_NO_ANCHOR,
- /* 163 */ YY_NO_ANCHOR,
- /* 164 */ YY_NO_ANCHOR,
- /* 165 */ YY_NO_ANCHOR,
- /* 166 */ YY_NO_ANCHOR,
- /* 167 */ YY_NO_ANCHOR,
- /* 168 */ YY_NO_ANCHOR,
- /* 169 */ YY_NO_ANCHOR,
- /* 170 */ YY_NO_ANCHOR,
- /* 171 */ YY_NO_ANCHOR,
- /* 172 */ YY_NO_ANCHOR,
- /* 173 */ YY_NO_ANCHOR,
- /* 174 */ YY_NO_ANCHOR,
- /* 175 */ YY_NO_ANCHOR,
- /* 176 */ YY_NO_ANCHOR,
- /* 177 */ YY_NO_ANCHOR,
- /* 178 */ YY_NO_ANCHOR,
- /* 179 */ YY_NO_ANCHOR,
- /* 180 */ YY_NO_ANCHOR,
- /* 181 */ YY_NO_ANCHOR,
- /* 182 */ YY_NO_ANCHOR,
- /* 183 */ YY_NO_ANCHOR,
- /* 184 */ YY_NO_ANCHOR,
- /* 185 */ YY_NOT_ACCEPT,
- /* 186 */ YY_NOT_ACCEPT,
- /* 187 */ YY_NO_ANCHOR,
- /* 188 */ YY_NOT_ACCEPT,
- /* 189 */ YY_NO_ANCHOR,
- /* 190 */ YY_NOT_ACCEPT,
- /* 191 */ YY_NO_ANCHOR,
- /* 192 */ YY_NO_ANCHOR,
- /* 193 */ YY_NO_ANCHOR,
- /* 194 */ YY_NO_ANCHOR,
- /* 195 */ YY_NO_ANCHOR,
- /* 196 */ YY_NO_ANCHOR,
- /* 197 */ YY_NO_ANCHOR,
- /* 198 */ YY_NO_ANCHOR,
- /* 199 */ YY_NO_ANCHOR,
- /* 200 */ YY_NO_ANCHOR,
- /* 201 */ YY_NO_ANCHOR,
- /* 202 */ YY_NO_ANCHOR,
- /* 203 */ YY_NO_ANCHOR,
- /* 204 */ YY_NO_ANCHOR,
- /* 205 */ YY_NO_ANCHOR,
- /* 206 */ YY_NO_ANCHOR,
- /* 207 */ YY_NO_ANCHOR,
- /* 208 */ YY_NO_ANCHOR,
- /* 209 */ YY_NO_ANCHOR,
- /* 210 */ YY_NO_ANCHOR,
- /* 211 */ YY_NO_ANCHOR,
- /* 212 */ YY_NO_ANCHOR,
- /* 213 */ YY_NO_ANCHOR,
- /* 214 */ YY_NO_ANCHOR,
- /* 215 */ YY_NO_ANCHOR,
- /* 216 */ YY_NO_ANCHOR,
- /* 217 */ YY_NO_ANCHOR,
- /* 218 */ YY_NO_ANCHOR,
- /* 219 */ YY_NO_ANCHOR,
- /* 220 */ YY_NO_ANCHOR,
- /* 221 */ YY_NO_ANCHOR,
- /* 222 */ YY_NO_ANCHOR,
- /* 223 */ YY_NO_ANCHOR,
- /* 224 */ YY_NO_ANCHOR,
- /* 225 */ YY_NO_ANCHOR,
- /* 226 */ YY_NO_ANCHOR,
- /* 227 */ YY_NO_ANCHOR,
- /* 228 */ YY_NO_ANCHOR,
- /* 229 */ YY_NO_ANCHOR,
- /* 230 */ YY_NO_ANCHOR,
- /* 231 */ YY_NO_ANCHOR,
- /* 232 */ YY_NO_ANCHOR,
- /* 233 */ YY_NO_ANCHOR
- };
- static private int yy_cmap[] = unpackFromString(1,65538,
-"54:9,27:2,54,27:2,54:18,27,17,53,54,15,54:2,55,25,26,1,3,11,4,13,2,56:10,10" +
-",54,18,16,19,54,12,44,57:3,46,57:3,51,57:4,48,52,43,57,47,50,45,57:3,49,57:" +
-"2,41,54,42,54,58,54,35,38,29,5,21,39,33,36,6,57,20,37,8,28,9,30,57,31,32,23" +
-",34,7,40,24,22,57,54,14,54:58,60,54:8,57:23,54,57:31,54,57:58,58:2,57:11,58" +
-":2,57:8,58,57:53,58,57:68,58:9,57:36,58:3,57:2,58:4,57:30,58:56,57:89,58:18" +
-",57:7,58:62,60:70,54:26,60:2,54:14,58:14,54,58:7,57,58,57:3,58,57,58,57:20," +
-"58,57:44,58,57:7,58:3,57,58,57,58,57,58,57,58,57:18,58:13,57:12,58,57:66,58" +
-",57:12,58,57:36,58:14,57:53,58:2,57:2,58:2,57:2,58:3,57:28,58:2,57:8,58:2,5" +
-"7:2,58:55,57:38,58:2,57,58:7,57:38,58:73,57:27,58:5,57:3,58:46,57:26,58:6,5" +
-"7:10,58:21,59:10,58:7,57:71,58:2,57:5,58,57:15,58,57:4,58,57,58:15,57:2,58:" +
-"9,59:10,58:523,57:53,58:3,57,58:26,57:10,58:4,59:10,58:21,57:8,58:2,57:2,58" +
-":2,57:22,58,57:7,58,57,58:3,57:4,58:34,57:2,58,57:3,58:4,59:10,57:2,58:19,5" +
-"7:6,58:4,57:2,58:2,57:22,58,57:7,58,57:2,58,57:2,58,57:2,58:31,57:4,58,57,5" +
-"8:7,59:10,58:2,57:3,58:16,57:7,58,57,58,57:3,58,57:22,58,57:7,58,57:2,58,57" +
-":5,58:3,57,58:34,57,58:5,59:10,58:21,57:8,58:2,57:2,58:2,57:22,58,57:7,58,5" +
-"7:2,58:2,57:4,58:3,57,58:30,57:2,58,57:3,58:4,59:10,58:21,57:6,58:3,57:3,58" +
-",57:4,58:3,57:2,58,57,58,57:2,58:3,57:2,58:3,57:3,58:3,57:8,58,57:3,58:45,5" +
-"9:9,58:21,57:8,58,57:3,58,57:23,58,57:10,58,57:5,58:38,57:2,58:4,59:10,58:2" +
-"1,57:8,58,57:3,58,57:23,58,57:10,58,57:5,58:36,57,58,57:2,58:4,59:10,58:21," +
-"57:8,58,57:3,58,57:23,58,57:16,58:38,57:2,58:4,59:10,58:145,57:46,58,57,58," +
-"57:2,58:12,57:6,58:10,59:10,58:39,57:2,58,57,58:2,57:2,58,57,58:2,57,58:6,5" +
-"7:4,58,57:7,58,57:3,58,57,58,57,58:2,57:2,58,57:2,58,57,58,57:2,58:9,57,58:" +
-"2,57:5,58:11,59:10,58:70,59:10,58:22,57:8,58,57:33,58:310,57:38,58:10,57:39" +
-",58:9,57,58,57:2,58,57:3,58,57,58,57:2,58,57:5,58:41,57,58,57,58,57,58:11,5" +
-"7,58,57,58,57,58:3,57:2,58:3,57,58:5,57:3,58,57,58,57,58,57,58,57,58:3,57:2" +
-",58:3,57:2,58,57,58:40,57,58:9,57,58:2,57,58:2,57:2,58:7,57:2,58,57,58,57:7" +
-",58:40,57,58:4,57,58:8,57,58:3078,57:156,58:4,57:90,58:6,57:22,58:2,57:6,58" +
-":2,57:38,58:2,57:6,58:2,57:8,58,57,58,57,58,57,58,57:31,58:2,57:53,58,57:7," +
-"58,57,58:3,57:3,58,57:7,58:3,57:4,58:2,57:6,58:4,57:13,58:5,57:3,58,57:7,58" +
-":3,54:12,58:2,54:98,58:182,57,58:3,57:2,58:2,57,58:81,57:3,58:13,54:2672,58" +
-":1008,54:17,58:64,57:84,58:12,57:90,58:10,57:40,58:31443,57:11172,58:92,54:" +
-"8448,58:1232,54:32,58:526,54:2,0:2")[0];
-
- static private int yy_rmap[] = unpackFromString(1,234,
-"0,1:2,2,1:2,3,4,1,5,6,1:3,7,8,1:5,9,1,10:2,1:3,11,1:5,12,10,1,10:5,1:2,10,1" +
-":2,13,1,10,1,14,10,15,16,1:2,10:4,17,1:2,18,19,20,21,22,23,24,25,26,27,1,25" +
-",10,28:2,29,5,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,5" +
-"0,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,7" +
-"5,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,1" +
-"00,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118," +
-"119,120,121,122,123,124,125,126,127,128,129,130,131,132,10,133,134,135,136," +
-"137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155" +
-",156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,17" +
-"4,175,176,177,178,179,180,181")[0];
-
- static private int yy_nxt[][] = unpackFromString(182,61,
-"1,2,3,4,5,6,65,184,204,70,7,8,9,10,11,12,13,66,14,15,211,184:2,215,184,16,1" +
-"7,18,218,220,221,184,222,184:2,223,184:3,224,184,19,20,184:10,71,74,77,21,1" +
-"84:2,67,74,-1:63,22,-1:62,184:2,73,184:3,64,-1:2,76,-1:6,184,79,184:3,-1:3," +
-"184:13,-1:2,184:10,-1:3,76,184,76:3,-1:10,25,-1:51,26,-1:72,27,-1:42,28,-1:" +
-"2,28,-1:17,30,-1:26,69,-1:2,72,-1:30,31,-1:57,34,-1:42,21,-1:2,21,-1:5,184:" +
-"6,64,-1:2,76,-1:6,184:5,-1:3,184:13,-1:2,184:10,-1:3,76,184,76:3,-1:56,28,-" +
-"1:2,28,-1:57,34,-1:2,34,-1:5,155,184:5,64,-1:2,76,-1:6,184:5,-1:3,184:13,-1" +
-":2,184:10,-1:3,76,184,76:3,-1:4,209,184:5,64,-1:2,76,-1:6,184:5,-1:3,184:13" +
-",-1:2,184:10,-1:3,76,184,76:3,-1:4,233,184:5,64,-1:2,76,-1:6,184:5,-1:3,184" +
-":13,-1:2,184:10,-1:3,76,184,76:3,-1:4,158,184:5,64,-1:2,76,-1:6,184:5,-1:3," +
-"184:13,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:6,64,-1:2,76,-1:6,184:5,122,-1" +
-",124,183,184:12,-1:2,184:10,-1:3,76,184,76:3,-1,36,-1:3,103:5,-1:2,80,-1:7," +
-"103:5,-1:3,103:13,-1:2,103:10,-1:4,103:3,-1:5,184,23,184:4,64,-1:2,76,-1:6," +
-"184:5,-1:3,184:13,-1:2,184:10,-1:3,76,184,76:3,-1:16,29,-1:48,184:6,64,-1:2" +
-",68,-1:6,184:5,-1:3,184:13,-1:2,184:10,-1:3,67,184,76,67,76,-1:4,184:6,64,-" +
-"1:2,76,-1:6,184:5,-1:3,184:13,-1:2,184:10,-1:3,68,184,76,68,76,-1:44,82,-1:" +
-"20,184:6,64,-1:2,76,-1:6,184:5,-1:3,184:3,24,184:9,-1:2,184:10,-1:3,76,184," +
-"76:3,-1,75:52,32,75:7,-1:49,84,-1:15,184:3,35,184:2,64,-1:2,76,-1:6,184:5,-" +
-"1:3,184:13,-1:2,184:10,-1:3,76,184,76:3,-1,78:54,33,78:5,-1:4,184:6,64,-1:2" +
-",76,-1:6,184:5,-1:3,184:4,105,184:8,-1:2,184:10,-1:3,76,184,76:3,-1:4,184,3" +
-"7,184:4,64,-1:2,76,-1:6,184:5,-1:3,184:13,-1:2,184:10,-1:3,76,184,76:3,-1:4" +
-"5,185,-1:19,184:6,64,-1:2,76,-1:6,184:2,38,184:2,-1:3,184:13,-1:2,184:10,-1" +
-":3,76,184,76:3,-1:43,86,-1:21,184:6,64,-1:2,76,-1:6,184:4,191,-1:3,184:13,-" +
-"1:2,184:10,-1:3,76,184,76:3,-1:47,186,-1:17,184,107,184:4,64,-1:2,76,-1:6,1" +
-"84:5,-1:3,184:13,-1:2,184:10,-1:3,76,184,76:3,-1:46,96,-1:18,184:4,193,184," +
-"64,-1:2,76,-1:6,184:5,-1:3,184:13,-1:2,184:10,-1:3,76,184,76:3,-1:26,42,-1:" +
-"38,184:2,205,184:3,64,-1:2,76,-1:6,184:5,-1:3,184:13,-1:2,184:10,-1:3,76,18" +
-"4,76:3,-1:25,100,-1,92,-1:37,184:5,192,64,-1:2,76,-1:6,184,228,184:3,-1:3,1" +
-"84:13,-1:2,184:10,-1:3,76,184,76:3,-1:26,43,-1:38,184:6,64,-1:2,76,-1:6,184" +
-":5,-1:3,184:3,206,184:9,-1:2,184:10,-1:3,76,184,76:3,-1:47,104,-1:17,184:6," +
-"64,-1:2,76,-1:6,184:5,-1:3,184:9,111,184:3,-1:2,184:10,-1:3,76,184,76:3,-1:" +
-"50,190,-1:14,184:6,64,-1:2,76,-1:6,184:3,113,184,-1:3,184:13,-1:2,184:10,-1" +
-":3,76,184,76:3,-1:26,45,-1:38,184,39,184:4,64,-1:2,76,-1:6,184:5,-1:3,184,2" +
-"12,184:11,-1:2,184:10,-1:3,76,184,76:3,-1:26,46,-1:38,103:6,-1:3,103,-1:6,1" +
-"03:5,-1:3,103:13,-1:2,103:10,-1:3,103:5,-1:48,106,-1:16,184:6,64,-1:2,76,-1" +
-":6,184:5,-1:3,184,216,184:11,-1:2,184:10,-1:3,76,184,76:3,-1:19,48,-1:45,18" +
-"4:6,64,-1:2,76,-1:6,184,119,184:3,-1:3,184:13,-1:2,184:10,-1:3,76,184,76:3," +
-"-1:51,114,-1:13,184:4,123,184,64,-1:2,76,-1:6,184:5,-1:3,184:13,-1:2,184:10" +
-",-1:3,76,184,76:3,-1:26,50,-1:38,184:6,64,-1:2,76,-1:6,184:5,-1:3,184:11,40" +
-",184,-1:2,184:10,-1:3,76,184,76:3,-1:25,116,-1,112,-1:37,184:6,64,-1:2,76,-" +
-"1:6,184:5,-1:3,184:3,128,184:9,-1:2,184:10,-1:3,76,184,76:3,-1:52,118,-1:12" +
-",184:6,64,-1:2,76,-1:6,184:5,-1:3,184:9,129,184:3,-1:2,184:10,-1:3,76,184,7" +
-"6:3,-1:26,55,-1:38,184:6,64,-1:2,76,-1:6,184:3,130,184,90,-1,92,184:13,-1:2" +
-",184:10,-1:3,76,184,76:3,-1:48,120,-1:16,184:6,64,-1:2,76,-1:6,184,131,184:" +
-"3,94,-1,188,184:13,-1:2,184:10,-1:3,76,184,76:3,-1:19,56,-1:45,184:6,64,-1:" +
-"2,76,-1:6,184:5,-1:3,184:4,132,184:8,-1:2,184:10,-1:3,76,184,76:3,-1:26,62," +
-"-1:38,184:6,64,-1:2,76,-1:6,184,208,184:3,-1:3,184:13,-1:2,184:10,-1:3,76,1" +
-"84,76:3,-1:25,126,-1,124,-1:37,184,41,184:4,64,-1:2,76,-1:6,184:5,-1:3,184:" +
-"13,-1:2,184:10,-1:3,76,184,76:3,-1:26,63,-1:38,184:6,64,-1:2,76,-1:6,184:5," +
-"-1:3,135,184:12,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:2,136,184:3,64,-1:2,7" +
-"6,-1:6,184:5,-1:3,184:13,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:5,138,64,-1:" +
-"2,76,-1:6,184:5,-1:3,184:13,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:6,64,-1:2" +
-",76,-1:6,184:3,130,184,-1:2,92,184:13,-1:2,184:10,-1:3,76,184,76:3,-1:4,184" +
-":6,64,-1:2,76,-1:6,184,131,184:3,-1:2,188,184:13,-1:2,184:10,-1:3,76,184,76" +
-":3,-1:4,184:6,64,-1:2,76,-1:6,184:5,-1:3,184:2,139,184:10,-1:2,184:10,-1:3," +
-"76,184,76:3,-1:4,184:6,64,-1:2,76,-1:6,184:5,-1:3,184:4,197,184:8,-1:2,184:" +
-"10,-1:3,76,184,76:3,-1:4,184,140,184:4,64,-1:2,76,-1:6,184:5,-1:3,184:13,-1" +
-":2,184:10,-1:3,76,184,76:3,-1:4,184:6,64,-1:2,76,-1:6,184:3,44,184,-1:3,184" +
-":13,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:6,64,-1:2,76,-1:6,184:5,-1:3,184:" +
-"10,141,184:2,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:6,64,-1:2,76,-1:6,184:3," +
-"142,184,-1:3,184:13,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:6,64,-1:2,76,-1:6" +
-",184:5,-1:3,184:12,225,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:6,64,-1:2,76,-" +
-"1:6,184:5,-1:3,184:7,143,184:5,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:2,145," +
-"184:3,64,-1:2,76,-1:6,184:5,-1:3,184:13,-1:2,184:10,-1:3,76,184,76:3,-1:4,1" +
-"84:6,64,-1:2,76,-1:6,184:5,-1:3,184:6,146,184:6,-1:2,184:10,-1:3,76,184,76:" +
-"3,-1:4,184:5,147,64,-1:2,76,-1:6,184:5,-1:3,184:13,-1:2,184:10,-1:3,76,184," +
-"76:3,-1:4,184:6,64,-1:2,76,-1:6,184:5,-1:3,184,148,184:11,-1:2,184:10,-1:3," +
-"76,184,76:3,-1:4,184:6,64,-1:2,76,-1:6,184:3,149,184,110,-1,112,184:13,-1:2" +
-",184:10,-1:3,76,184,76:3,-1:4,184:6,64,-1:2,76,-1:6,184:5,-1:3,150,184:12,-" +
-"1:2,184:10,-1:3,76,184,76:3,-1:4,184:6,64,-1:2,76,-1:6,184:3,151,184,-1:3,1" +
-"84:13,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:6,64,-1:2,76,-1:6,184:5,-1:3,18" +
-"4:3,47,184:9,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:6,64,-1:2,76,-1:6,184,49" +
-",184:3,-1:3,184:13,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:6,64,-1:2,76,-1:6," +
-"184:3,149,184,-1:2,112,184:13,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:6,64,-1" +
-":2,76,-1:6,184:5,-1:3,184:5,51,184:7,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:" +
-"6,64,-1:2,76,-1:6,184,52,184:3,-1:3,184:13,-1:2,184:10,-1:3,76,184,76:3,-1:" +
-"4,184:6,64,-1:2,76,-1:6,184:5,-1:3,184:5,53,184:7,-1:2,184:10,-1:3,76,184,7" +
-"6:3,-1:4,184:6,64,-1:2,76,-1:6,184:3,54,184,-1:3,184:13,-1:2,184:10,-1:3,76" +
-",184,76:3,-1:4,184:6,64,-1:2,76,-1:6,184:5,-1:3,184:5,156,184:7,-1:2,184:10" +
-",-1:3,76,184,76:3,-1:4,184:5,157,64,-1:2,76,-1:6,184:5,-1:3,184:13,-1:2,184" +
-":10,-1:3,76,184,76:3,-1:4,159,184:5,64,-1:2,76,-1:6,184:5,-1:3,184:13,-1:2," +
-"184:10,-1:3,76,184,76:3,-1:4,184:6,64,-1:2,76,-1:6,184:5,-1:3,184:3,160,184" +
-":9,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:5,161,64,-1:2,76,-1:6,184:5,-1:3,1" +
-"84:13,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:2,162,184:3,64,-1:2,76,-1:6,184" +
-":5,-1:3,184:13,-1:2,184:10,-1:3,76,184,76:3,-1:4,213,184:5,64,-1:2,76,-1:6," +
-"184:5,-1:3,184:13,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:6,64,-1:2,76,-1:6,1" +
-"84:5,-1:3,184:3,226,184:9,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:6,64,-1:2,7" +
-"6,-1:6,184:5,-1:3,217,184:12,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:6,64,-1:" +
-"2,76,-1:6,184:5,-1:3,184:10,164,184:2,-1:2,184:10,-1:3,76,184,76:3,-1:4,184" +
-":6,64,-1:2,76,-1:6,184:5,-1:3,184:9,167,184:3,-1:2,184:10,-1:3,76,184,76:3," +
-"-1:4,184:6,64,-1:2,76,-1:6,184,168,184:3,-1:3,184:13,-1:2,184:10,-1:3,76,18" +
-"4,76:3,-1:4,184:6,64,-1:2,76,-1:6,184:3,170,184,-1:3,184:13,-1:2,184:10,-1:" +
-"3,76,184,76:3,-1:4,184:2,171,184:3,64,-1:2,76,-1:6,184:5,-1:3,184:13,-1:2,1" +
-"84:10,-1:3,76,184,76:3,-1:4,184:6,64,-1:2,76,-1:6,184:5,-1:3,184:9,172,184:" +
-"3,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:6,64,-1:2,76,-1:6,184,173,184:3,-1:" +
-"3,184:13,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:6,64,-1:2,76,-1:6,184:5,-1:3" +
-",184:3,174,184:9,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:6,64,-1:2,76,-1:6,18" +
-"4:5,-1:3,175,184:12,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:6,64,-1:2,76,-1:6" +
-",184:5,-1:3,184:11,57,184,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:6,64,-1:2,7" +
-"6,-1:6,184:5,-1:3,184:9,177,184:3,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:6,6" +
-"4,-1:2,76,-1:6,184:5,-1:3,184:6,178,184:6,-1:2,184:10,-1:3,76,184,76:3,-1:4" +
-",184:6,64,-1:2,76,-1:6,184:5,-1:3,184:5,58,184:7,-1:2,184:10,-1:3,76,184,76" +
-":3,-1:4,184:6,64,-1:2,76,-1:6,184:5,-1:3,184:5,59,184:7,-1:2,184:10,-1:3,76" +
-",184,76:3,-1:4,184:6,64,-1:2,76,-1:6,184:5,-1:3,184:11,60,184,-1:2,184:10,-" +
-"1:3,76,184,76:3,-1:4,184:6,64,-1:2,76,-1:6,184:5,-1:3,184,179,184:11,-1:2,1" +
-"84:10,-1:3,76,184,76:3,-1:4,184:6,64,-1:2,76,-1:6,184:3,180,184,-1:3,184:13" +
-",-1:2,184:10,-1:3,76,184,76:3,-1:4,184:2,181,184:3,64,-1:2,76,-1:6,184:5,-1" +
-":3,184:13,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:5,182,64,-1:2,76,-1:6,184:5" +
-",-1:3,184:13,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:6,64,-1:2,76,-1:6,184:5," +
-"-1:3,61,184:12,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:6,64,-1:2,76,-1:6,184:" +
-"5,-1:2,124,183,184:12,-1:2,184:10,-1:3,76,184,76:3,-1:45,88,-1:61,98,-1:18," +
-"184:4,109,184,64,-1:2,76,-1:6,184:5,-1:3,184:13,-1:2,184:10,-1:3,76,184,76:" +
-"3,-1:25,102,-1,188,-1:37,184:6,64,-1:2,76,-1:6,184:5,-1:3,184:9,115,184:3,-" +
-"1:2,184:10,-1:3,76,184,76:3,-1:50,108,-1:14,184:6,64,-1:2,76,-1:6,184:3,117" +
-",184,-1:3,184:13,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:6,64,-1:2,76,-1:6,18" +
-"4:5,-1:3,184,195,184:11,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:6,64,-1:2,76," +
-"-1:6,184,121,184:3,-1:3,184:13,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:6,64,-" +
-"1:2,76,-1:6,184:5,-1:3,184:4,137,184:8,-1:2,184:10,-1:3,76,184,76:3,-1:4,18" +
-"4:6,64,-1:2,76,-1:6,184,133,184:3,-1:3,184:13,-1:2,184:10,-1:3,76,184,76:3," +
-"-1:4,184:6,64,-1:2,76,-1:6,184:5,-1:3,198,184:12,-1:2,184:10,-1:3,76,184,76" +
-":3,-1:4,184:6,64,-1:2,76,-1:6,184:5,-1:3,184:4,229,184:8,-1:2,184:10,-1:3,7" +
-"6,184,76:3,-1:4,184,200,184:4,64,-1:2,76,-1:6,184:5,-1:3,184:13,-1:2,184:10" +
-",-1:3,76,184,76:3,-1:4,184:6,64,-1:2,76,-1:6,184:3,144,184,-1:3,184:13,-1:2" +
-",184:10,-1:3,76,184,76:3,-1:4,184:6,64,-1:2,76,-1:6,184:5,-1:3,184:7,210,18" +
-"4:5,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:6,64,-1:2,76,-1:6,184:5,-1:3,152," +
-"184:12,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:2,163,184:3,64,-1:2,76,-1:6,18" +
-"4:5,-1:3,184:13,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:6,64,-1:2,76,-1:6,184" +
-":5,-1:3,176,184:12,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:5,81,64,-1:2,76,-1" +
-":6,184:5,-1:3,184:13,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:6,64,-1:2,76,-1:" +
-"6,184:5,-1:3,184:9,125,184:3,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:6,64,-1:" +
-"2,76,-1:6,184,127,184:3,-1:3,184:13,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:6" +
-",64,-1:2,76,-1:6,184,134,184:3,-1:3,184:13,-1:2,184:10,-1:3,76,184,76:3,-1:" +
-"4,184:6,64,-1:2,76,-1:6,184:5,-1:3,199,184:12,-1:2,184:10,-1:3,76,184,76:3," +
-"-1:4,184:6,64,-1:2,76,-1:6,184:5,-1:3,184:4,202,184:8,-1:2,184:10,-1:3,76,1" +
-"84,76:3,-1:4,184:6,64,-1:2,76,-1:6,184:5,-1:3,153,184:12,-1:2,184:10,-1:3,7" +
-"6,184,76:3,-1:4,184:6,64,-1:2,76,-1:6,184,83,184:3,-1:3,184:13,-1:2,184:10," +
-"-1:3,76,184,76:3,-1:4,184:6,64,-1:2,76,-1:6,184,194,184:3,-1:3,184:13,-1:2," +
-"184:10,-1:3,76,184,76:3,-1:4,184:6,64,-1:2,76,-1:6,184:5,-1:3,184:4,165,184" +
-":8,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:6,64,-1:2,76,-1:6,184:5,-1:3,154,1" +
-"84:12,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:6,64,-1:2,76,-1:6,184,85,184:3," +
-"-1:3,184:13,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:6,64,-1:2,76,-1:6,184,196" +
-",184:3,-1:3,184:13,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:6,64,-1:2,76,-1:6," +
-"184:5,-1:3,184:4,166,184:8,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:5,87,64,-1" +
-":2,76,-1:6,184:5,-1:3,184:7,89,184:5,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:" +
-"6,64,-1:2,76,-1:6,184:5,-1:3,184:4,169,184:8,-1:2,184:10,-1:3,76,184,76:3,-" +
-"1:4,184:5,187,64,-1:2,76,-1:6,184:5,-1:3,184:8,91,184:4,-1:2,184:10,-1:3,76" +
-",184,76:3,-1:4,184:6,64,-1:2,76,-1:6,184:5,-1:3,184:3,93,184:3,95,184:5,-1:" +
-"2,184:10,-1:3,76,184,76:3,-1:4,184:6,64,-1:2,76,-1:6,184,97,184:3,-1:3,184:" +
-"13,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:6,64,-1:2,76,-1:6,184:3,99,184,-1:" +
-"3,101,184:12,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:5,189,64,-1:2,76,-1:6,18" +
-"4:5,-1:3,184:13,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:2,201,184:3,64,-1:2,7" +
-"6,-1:6,184:5,-1:3,184:13,-1:2,184:10,-1:3,76,184,76:3,-1:4,219,184:5,64,-1:" +
-"2,76,-1:6,184:5,-1:3,184:13,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:2,203,184" +
-":3,64,-1:2,76,-1:6,184:5,-1:3,184:13,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:" +
-"6,64,-1:2,76,-1:6,184:5,-1:3,184,207,184:11,-1:2,184:10,-1:3,76,184,76:3,-1" +
-":4,184:2,214,184:3,64,-1:2,76,-1:6,184:5,-1:3,184:13,-1:2,184:10,-1:3,76,18" +
-"4,76:3,-1:4,184:6,64,-1:2,76,-1:6,184:5,-1:3,184:9,227,184:3,-1:2,184:10,-1" +
-":3,76,184,76:3,-1:4,184:6,64,-1:2,76,-1:6,184:5,-1:3,184:10,230,184:2,-1:2," +
-"184:10,-1:3,76,184,76:3,-1:4,184:2,231,184:3,64,-1:2,76,-1:6,184:5,-1:3,184" +
-":13,-1:2,184:10,-1:3,76,184,76:3,-1:4,184:6,64,-1:2,76,-1:6,184:5,-1:3,184:" +
-"4,232,184:8,-1:2,184:10,-1:3,76,184,76:3");
-
- public com.sun.java_cup.internal.runtime.Symbol next_token ()
- throws java.io.IOException,
-Exception
-
- {
- int yy_lookahead;
- int yy_anchor = YY_NO_ANCHOR;
- int yy_state = yy_state_dtrans[yy_lexical_state];
- int yy_next_state = YY_NO_STATE;
- int yy_last_accept_state = YY_NO_STATE;
- boolean yy_initial = true;
- int yy_this_accept;
-
- yy_mark_start();
- yy_this_accept = yy_acpt[yy_state];
- if (YY_NOT_ACCEPT != yy_this_accept) {
- yy_last_accept_state = yy_state;
- yy_mark_end();
- }
- while (true) {
- if (yy_initial && yy_at_bol) yy_lookahead = YY_BOL;
- else yy_lookahead = yy_advance();
- yy_next_state = YY_F;
- yy_next_state = yy_nxt[yy_rmap[yy_state]][yy_cmap[yy_lookahead]];
- if (YY_EOF == yy_lookahead && true == yy_initial) {
-
-return newSymbol(sym.EOF);
- }
- if (YY_F != yy_next_state) {
- yy_state = yy_next_state;
- yy_initial = false;
- yy_this_accept = yy_acpt[yy_state];
- if (YY_NOT_ACCEPT != yy_this_accept) {
- yy_last_accept_state = yy_state;
- yy_mark_end();
- }
- }
- else {
- if (YY_NO_STATE == yy_last_accept_state) {
- throw (new Error("Lexical Error: Unmatched Input."));
- }
- else {
- yy_anchor = yy_acpt[yy_last_accept_state];
- if (0 != (YY_END & yy_anchor)) {
- yy_move_end();
- }
- yy_to_mark();
- switch (yy_last_accept_state) {
- case 1:
-
- case -2:
- break;
- case 2:
- { return newSymbol(sym.STAR); }
- case -3:
- break;
- case 3:
- { return newSymbol(sym.SLASH); }
- case -4:
- break;
- case 4:
- { return newSymbol(sym.PLUS); }
- case -5:
- break;
- case 5:
- { return newSymbol(sym.MINUS); }
- case -6:
- break;
- case 6:
- { return newSymbol(sym.QNAME, yytext()); }
- case -7:
- break;
- case 7:
- { throw new Exception(yytext()); }
- case -8:
- break;
- case 8:
- { return newSymbol(sym.COMMA); }
- case -9:
- break;
- case 9:
- { return newSymbol(sym.ATSIGN); }
- case -10:
- break;
- case 10:
- { return newSymbol(sym.DOT); }
- case -11:
- break;
- case 11:
- { return newSymbol(sym.VBAR); }
- case -12:
- break;
- case 12:
- { return newSymbol(sym.DOLLAR); }
- case -13:
- break;
- case 13:
- { return newSymbol(sym.EQ); }
- case -14:
- break;
- case 14:
- { return newSymbol(sym.LT); }
- case -15:
- break;
- case 15:
- { return newSymbol(sym.GT); }
- case -16:
- break;
- case 16:
- { return newSymbol(sym.LPAREN); }
- case -17:
- break;
- case 17:
- { return newSymbol(sym.RPAREN); }
- case -18:
- break;
- case 18:
- { /* ignore white space. */ }
- case -19:
- break;
- case 19:
- { return newSymbol(sym.LBRACK); }
- case -20:
- break;
- case 20:
- { return newSymbol(sym.RBRACK); }
- case -21:
- break;
- case 21:
- { return newSymbol(sym.INT, new Long(yytext())); }
- case -22:
- break;
- case 22:
- { return newSymbol(sym.DSLASH); }
- case -23:
- break;
- case 23:
- { return disambiguateAxisOrFunction(sym.ID); }
- case -24:
- break;
- case 24:
- { return disambiguateOperator(sym.OR); }
- case -25:
- break;
- case 25:
- { return newSymbol(sym.DCOLON); }
- case -26:
- break;
- case 26:
- { return newSymbol(sym.QNAME, yytext()); }
- case -27:
- break;
- case 27:
- { return newSymbol(sym.DDOT); }
- case -28:
- break;
- case 28:
- { return newSymbol(sym.REAL, new Double(yytext())); }
- case -29:
- break;
- case 29:
- { return newSymbol(sym.NE); }
- case -30:
- break;
- case 30:
- { return newSymbol(sym.LE); }
- case -31:
- break;
- case 31:
- { return newSymbol(sym.GE); }
- case -32:
- break;
- case 32:
- { return newSymbol(sym.Literal,
- yytext().substring(1, yytext().length() - 1)); }
- case -33:
- break;
- case 33:
- { return newSymbol(sym.Literal,
- yytext().substring(1, yytext().length() - 1)); }
- case -34:
- break;
- case 34:
- { return newSymbol(sym.REAL, new Double(yytext())); }
- case -35:
- break;
- case 35:
- { return disambiguateOperator(sym.DIV); }
- case -36:
- break;
- case 36:
- { return newSymbol(sym.QNAME, yytext()); }
- case -37:
- break;
- case 37:
- { return disambiguateOperator(sym.MOD); }
- case -38:
- break;
- case 38:
- { return disambiguateAxisOrFunction(sym.KEY); }
- case -39:
- break;
- case 39:
- { return disambiguateOperator(sym.AND); }
- case -40:
- break;
- case 40:
- { return disambiguateAxisOrFunction(sym.SELF); }
- case -41:
- break;
- case 41:
- { return disambiguateAxisOrFunction(sym.CHILD); }
- case -42:
- break;
- case 42:
- { return newSymbol(sym.TEXT); }
- case -43:
- break;
- case 43:
- { return newSymbol(sym.NODE); }
- case -44:
- break;
- case 44:
- { return disambiguateAxisOrFunction(sym.PARENT); }
- case -45:
- break;
- case 45:
- { return newSymbol(sym.TEXT); }
- case -46:
- break;
- case 46:
- { return newSymbol(sym.NODE); }
- case -47:
- break;
- case 47:
- { return disambiguateAxisOrFunction(sym.ANCESTOR); }
- case -48:
- break;
- case 48:
- { initialize(); return new Symbol(sym.PATTERN); }
- case -49:
- break;
- case 49:
- { return disambiguateAxisOrFunction(sym.NAMESPACE); }
- case -50:
- break;
- case 50:
- { return newSymbol(sym.COMMENT); }
- case -51:
- break;
- case 51:
- { return disambiguateAxisOrFunction(sym.PRECEDING); }
- case -52:
- break;
- case 52:
- { return disambiguateAxisOrFunction(sym.ATTRIBUTE); }
- case -53:
- break;
- case 53:
- { return disambiguateAxisOrFunction(sym.FOLLOWING); }
- case -54:
- break;
- case 54:
- { return disambiguateAxisOrFunction(sym.DESCENDANT); }
- case -55:
- break;
- case 55:
- { return newSymbol(sym.COMMENT); }
- case -56:
- break;
- case 56:
- { initialize(); return new Symbol(sym.EXPRESSION); }
- case -57:
- break;
- case 57:
- { return disambiguateAxisOrFunction(sym.ANCESTORORSELF); }
- case -58:
- break;
- case 58:
- { return disambiguateAxisOrFunction(sym.PRECEDINGSIBLING); }
- case -59:
- break;
- case 59:
- { return disambiguateAxisOrFunction(sym.FOLLOWINGSIBLING); }
- case -60:
- break;
- case 60:
- { return disambiguateAxisOrFunction(sym.DESCENDANTORSELF); }
- case -61:
- break;
- case 61:
- { return disambiguateAxisOrFunction(sym.PIPARAM); }
- case -62:
- break;
- case 62:
- { return newSymbol(sym.PI); }
- case -63:
- break;
- case 63:
- { return newSymbol(sym.PI); }
- case -64:
- break;
- case 65:
- { return newSymbol(sym.QNAME, yytext()); }
- case -65:
- break;
- case 66:
- { throw new Exception(yytext()); }
- case -66:
- break;
- case 67:
- { return newSymbol(sym.INT, new Long(yytext())); }
- case -67:
- break;
- case 68:
- { return newSymbol(sym.REAL, new Double(yytext())); }
- case -68:
- break;
- case 70:
- { return newSymbol(sym.QNAME, yytext()); }
- case -69:
- break;
- case 71:
- { throw new Exception(yytext()); }
- case -70:
- break;
- case 73:
- { return newSymbol(sym.QNAME, yytext()); }
- case -71:
- break;
- case 74:
- { throw new Exception(yytext()); }
- case -72:
- break;
- case 76:
- { return newSymbol(sym.QNAME, yytext()); }
- case -73:
- break;
- case 77:
- { throw new Exception(yytext()); }
- case -74:
- break;
- case 79:
- { return newSymbol(sym.QNAME, yytext()); }
- case -75:
- break;
- case 81:
- { return newSymbol(sym.QNAME, yytext()); }
- case -76:
- break;
- case 83:
- { return newSymbol(sym.QNAME, yytext()); }
- case -77:
- break;
- case 85:
- { return newSymbol(sym.QNAME, yytext()); }
- case -78:
- break;
- case 87:
- { return newSymbol(sym.QNAME, yytext()); }
- case -79:
- break;
- case 89:
- { return newSymbol(sym.QNAME, yytext()); }
- case -80:
- break;
- case 91:
- { return newSymbol(sym.QNAME, yytext()); }
- case -81:
- break;
- case 93:
- { return newSymbol(sym.QNAME, yytext()); }
- case -82:
- break;
- case 95:
- { return newSymbol(sym.QNAME, yytext()); }
- case -83:
- break;
- case 97:
- { return newSymbol(sym.QNAME, yytext()); }
- case -84:
- break;
- case 99:
- { return newSymbol(sym.QNAME, yytext()); }
- case -85:
- break;
- case 101:
- { return newSymbol(sym.QNAME, yytext()); }
- case -86:
- break;
- case 103:
- { return newSymbol(sym.QNAME, yytext()); }
- case -87:
- break;
- case 105:
- { return newSymbol(sym.QNAME, yytext()); }
- case -88:
- break;
- case 107:
- { return newSymbol(sym.QNAME, yytext()); }
- case -89:
- break;
- case 109:
- { return newSymbol(sym.QNAME, yytext()); }
- case -90:
- break;
- case 111:
- { return newSymbol(sym.QNAME, yytext()); }
- case -91:
- break;
- case 113:
- { return newSymbol(sym.QNAME, yytext()); }
- case -92:
- break;
- case 115:
- { return newSymbol(sym.QNAME, yytext()); }
- case -93:
- break;
- case 117:
- { return newSymbol(sym.QNAME, yytext()); }
- case -94:
- break;
- case 119:
- { return newSymbol(sym.QNAME, yytext()); }
- case -95:
- break;
- case 121:
- { return newSymbol(sym.QNAME, yytext()); }
- case -96:
- break;
- case 123:
- { return newSymbol(sym.QNAME, yytext()); }
- case -97:
- break;
- case 125:
- { return newSymbol(sym.QNAME, yytext()); }
- case -98:
- break;
- case 127:
- { return newSymbol(sym.QNAME, yytext()); }
- case -99:
- break;
- case 128:
- { return newSymbol(sym.QNAME, yytext()); }
- case -100:
- break;
- case 129:
- { return newSymbol(sym.QNAME, yytext()); }
- case -101:
- break;
- case 130:
- { return newSymbol(sym.QNAME, yytext()); }
- case -102:
- break;
- case 131:
- { return newSymbol(sym.QNAME, yytext()); }
- case -103:
- break;
- case 132:
- { return newSymbol(sym.QNAME, yytext()); }
- case -104:
- break;
- case 133:
- { return newSymbol(sym.QNAME, yytext()); }
- case -105:
- break;
- case 134:
- { return newSymbol(sym.QNAME, yytext()); }
- case -106:
- break;
- case 135:
- { return newSymbol(sym.QNAME, yytext()); }
- case -107:
- break;
- case 136:
- { return newSymbol(sym.QNAME, yytext()); }
- case -108:
- break;
- case 137:
- { return newSymbol(sym.QNAME, yytext()); }
- case -109:
- break;
- case 138:
- { return newSymbol(sym.QNAME, yytext()); }
- case -110:
- break;
- case 139:
- { return newSymbol(sym.QNAME, yytext()); }
- case -111:
- break;
- case 140:
- { return newSymbol(sym.QNAME, yytext()); }
- case -112:
- break;
- case 141:
- { return newSymbol(sym.QNAME, yytext()); }
- case -113:
- break;
- case 142:
- { return newSymbol(sym.QNAME, yytext()); }
- case -114:
- break;
- case 143:
- { return newSymbol(sym.QNAME, yytext()); }
- case -115:
- break;
- case 144:
- { return newSymbol(sym.QNAME, yytext()); }
- case -116:
- break;
- case 145:
- { return newSymbol(sym.QNAME, yytext()); }
- case -117:
- break;
- case 146:
- { return newSymbol(sym.QNAME, yytext()); }
- case -118:
- break;
- case 147:
- { return newSymbol(sym.QNAME, yytext()); }
- case -119:
- break;
- case 148:
- { return newSymbol(sym.QNAME, yytext()); }
- case -120:
- break;
- case 149:
- { return newSymbol(sym.QNAME, yytext()); }
- case -121:
- break;
- case 150:
- { return newSymbol(sym.QNAME, yytext()); }
- case -122:
- break;
- case 151:
- { return newSymbol(sym.QNAME, yytext()); }
- case -123:
- break;
- case 152:
- { return newSymbol(sym.QNAME, yytext()); }
- case -124:
- break;
- case 153:
- { return newSymbol(sym.QNAME, yytext()); }
- case -125:
- break;
- case 154:
- { return newSymbol(sym.QNAME, yytext()); }
- case -126:
- break;
- case 155:
- { return newSymbol(sym.QNAME, yytext()); }
- case -127:
- break;
- case 156:
- { return newSymbol(sym.QNAME, yytext()); }
- case -128:
- break;
- case 157:
- { return newSymbol(sym.QNAME, yytext()); }
- case -129:
- break;
- case 158:
- { return newSymbol(sym.QNAME, yytext()); }
- case -130:
- break;
- case 159:
- { return newSymbol(sym.QNAME, yytext()); }
- case -131:
- break;
- case 160:
- { return newSymbol(sym.QNAME, yytext()); }
- case -132:
- break;
- case 161:
- { return newSymbol(sym.QNAME, yytext()); }
- case -133:
- break;
- case 162:
- { return newSymbol(sym.QNAME, yytext()); }
- case -134:
- break;
- case 163:
- { return newSymbol(sym.QNAME, yytext()); }
- case -135:
- break;
- case 164:
- { return newSymbol(sym.QNAME, yytext()); }
- case -136:
- break;
- case 165:
- { return newSymbol(sym.QNAME, yytext()); }
- case -137:
- break;
- case 166:
- { return newSymbol(sym.QNAME, yytext()); }
- case -138:
- break;
- case 167:
- { return newSymbol(sym.QNAME, yytext()); }
- case -139:
- break;
- case 168:
- { return newSymbol(sym.QNAME, yytext()); }
- case -140:
- break;
- case 169:
- { return newSymbol(sym.QNAME, yytext()); }
- case -141:
- break;
- case 170:
- { return newSymbol(sym.QNAME, yytext()); }
- case -142:
- break;
- case 171:
- { return newSymbol(sym.QNAME, yytext()); }
- case -143:
- break;
- case 172:
- { return newSymbol(sym.QNAME, yytext()); }
- case -144:
- break;
- case 173:
- { return newSymbol(sym.QNAME, yytext()); }
- case -145:
- break;
- case 174:
- { return newSymbol(sym.QNAME, yytext()); }
- case -146:
- break;
- case 175:
- { return newSymbol(sym.QNAME, yytext()); }
- case -147:
- break;
- case 176:
- { return newSymbol(sym.QNAME, yytext()); }
- case -148:
- break;
- case 177:
- { return newSymbol(sym.QNAME, yytext()); }
- case -149:
- break;
- case 178:
- { return newSymbol(sym.QNAME, yytext()); }
- case -150:
- break;
- case 179:
- { return newSymbol(sym.QNAME, yytext()); }
- case -151:
- break;
- case 180:
- { return newSymbol(sym.QNAME, yytext()); }
- case -152:
- break;
- case 181:
- { return newSymbol(sym.QNAME, yytext()); }
- case -153:
- break;
- case 182:
- { return newSymbol(sym.QNAME, yytext()); }
- case -154:
- break;
- case 183:
- { return newSymbol(sym.QNAME, yytext()); }
- case -155:
- break;
- case 184:
- { return newSymbol(sym.QNAME, yytext()); }
- case -156:
- break;
- case 187:
- { return newSymbol(sym.QNAME, yytext()); }
- case -157:
- break;
- case 189:
- { return newSymbol(sym.QNAME, yytext()); }
- case -158:
- break;
- case 191:
- { return newSymbol(sym.QNAME, yytext()); }
- case -159:
- break;
- case 192:
- { return newSymbol(sym.QNAME, yytext()); }
- case -160:
- break;
- case 193:
- { return newSymbol(sym.QNAME, yytext()); }
- case -161:
- break;
- case 194:
- { return newSymbol(sym.QNAME, yytext()); }
- case -162:
- break;
- case 195:
- { return newSymbol(sym.QNAME, yytext()); }
- case -163:
- break;
- case 196:
- { return newSymbol(sym.QNAME, yytext()); }
- case -164:
- break;
- case 197:
- { return newSymbol(sym.QNAME, yytext()); }
- case -165:
- break;
- case 198:
- { return newSymbol(sym.QNAME, yytext()); }
- case -166:
- break;
- case 199:
- { return newSymbol(sym.QNAME, yytext()); }
- case -167:
- break;
- case 200:
- { return newSymbol(sym.QNAME, yytext()); }
- case -168:
- break;
- case 201:
- { return newSymbol(sym.QNAME, yytext()); }
- case -169:
- break;
- case 202:
- { return newSymbol(sym.QNAME, yytext()); }
- case -170:
- break;
- case 203:
- { return newSymbol(sym.QNAME, yytext()); }
- case -171:
- break;
- case 204:
- { return newSymbol(sym.QNAME, yytext()); }
- case -172:
- break;
- case 205:
- { return newSymbol(sym.QNAME, yytext()); }
- case -173:
- break;
- case 206:
- { return newSymbol(sym.QNAME, yytext()); }
- case -174:
- break;
- case 207:
- { return newSymbol(sym.QNAME, yytext()); }
- case -175:
- break;
- case 208:
- { return newSymbol(sym.QNAME, yytext()); }
- case -176:
- break;
- case 209:
- { return newSymbol(sym.QNAME, yytext()); }
- case -177:
- break;
- case 210:
- { return newSymbol(sym.QNAME, yytext()); }
- case -178:
- break;
- case 211:
- { return newSymbol(sym.QNAME, yytext()); }
- case -179:
- break;
- case 212:
- { return newSymbol(sym.QNAME, yytext()); }
- case -180:
- break;
- case 213:
- { return newSymbol(sym.QNAME, yytext()); }
- case -181:
- break;
- case 214:
- { return newSymbol(sym.QNAME, yytext()); }
- case -182:
- break;
- case 215:
- { return newSymbol(sym.QNAME, yytext()); }
- case -183:
- break;
- case 216:
- { return newSymbol(sym.QNAME, yytext()); }
- case -184:
- break;
- case 217:
- { return newSymbol(sym.QNAME, yytext()); }
- case -185:
- break;
- case 218:
- { return newSymbol(sym.QNAME, yytext()); }
- case -186:
- break;
- case 219:
- { return newSymbol(sym.QNAME, yytext()); }
- case -187:
- break;
- case 220:
- { return newSymbol(sym.QNAME, yytext()); }
- case -188:
- break;
- case 221:
- { return newSymbol(sym.QNAME, yytext()); }
- case -189:
- break;
- case 222:
- { return newSymbol(sym.QNAME, yytext()); }
- case -190:
- break;
- case 223:
- { return newSymbol(sym.QNAME, yytext()); }
- case -191:
- break;
- case 224:
- { return newSymbol(sym.QNAME, yytext()); }
- case -192:
- break;
- case 225:
- { return newSymbol(sym.QNAME, yytext()); }
- case -193:
- break;
- case 226:
- { return newSymbol(sym.QNAME, yytext()); }
- case -194:
- break;
- case 227:
- { return newSymbol(sym.QNAME, yytext()); }
- case -195:
- break;
- case 228:
- { return newSymbol(sym.QNAME, yytext()); }
- case -196:
- break;
- case 229:
- { return newSymbol(sym.QNAME, yytext()); }
- case -197:
- break;
- case 230:
- { return newSymbol(sym.QNAME, yytext()); }
- case -198:
- break;
- case 231:
- { return newSymbol(sym.QNAME, yytext()); }
- case -199:
- break;
- case 232:
- { return newSymbol(sym.QNAME, yytext()); }
- case -200:
- break;
- case 233:
- { return newSymbol(sym.QNAME, yytext()); }
- case -201:
- break;
- default:
- yy_error(YY_E_INTERNAL,false);
- case -1:
- }
- yy_initial = true;
- yy_state = yy_state_dtrans[yy_lexical_state];
- yy_next_state = YY_NO_STATE;
- yy_last_accept_state = YY_NO_STATE;
- yy_mark_start();
- yy_this_accept = yy_acpt[yy_state];
- if (YY_NOT_ACCEPT != yy_this_accept) {
- yy_last_accept_state = yy_state;
- yy_mark_end();
- }
- }
- }
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XPathParser.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XPathParser.java
deleted file mode 100644
index f33b34b..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XPathParser.java
+++ /dev/null
@@ -1,3146 +0,0 @@
-
-//----------------------------------------------------
-// The following code was generated by CUP v0.10j
-// Thu Oct 06 10:09:26 PDT 2005
-//----------------------------------------------------
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import java.util.Stack;
-import java.util.Vector;
-import java.io.StringReader;
-import com.sun.java_cup.internal.runtime.*;
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xalan.internal.xsltc.DOM;
-import com.sun.org.apache.xml.internal.dtm.Axis;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.Operators;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-
-/** CUP v0.10j generated parser.
- */
-public class XPathParser extends com.sun.java_cup.internal.runtime.lr_parser {
-
- /** Default constructor. */
- public XPathParser() {super();}
-
- /** Constructor which sets the default scanner. */
- public XPathParser(com.sun.java_cup.internal.runtime.Scanner s) {super(s);}
-
- /** Production table. */
- protected static final short _production_table[][] =
- unpackFromStrings(new String[] {
- "\000\215\000\002\002\004\000\002\003\004\000\002\003" +
- "\004\000\002\036\003\000\002\036\005\000\002\037\003" +
- "\000\002\037\004\000\002\037\003\000\002\037\005\000" +
- "\002\037\005\000\002\037\004\000\002\037\003\000\002" +
- "\035\006\000\002\035\010\000\002\040\006\000\002\041" +
- "\003\000\002\041\005\000\002\041\005\000\002\042\003" +
- "\000\002\042\004\000\002\042\003\000\002\042\004\000" +
- "\002\042\004\000\002\042\005\000\002\042\004\000\002" +
- "\042\005\000\002\043\003\000\002\043\003\000\002\043" +
- "\003\000\002\043\003\000\002\043\003\000\002\044\003" +
- "\000\002\044\003\000\002\054\003\000\002\054\004\000" +
- "\002\054\004\000\002\045\003\000\002\045\004\000\002" +
- "\007\005\000\002\004\003\000\002\012\003\000\002\012" +
- "\005\000\002\013\003\000\002\013\005\000\002\014\003" +
- "\000\002\014\005\000\002\014\005\000\002\015\003\000" +
- "\002\015\005\000\002\015\005\000\002\015\005\000\002" +
- "\015\005\000\002\016\003\000\002\016\005\000\002\016" +
- "\005\000\002\017\003\000\002\017\005\000\002\017\005" +
- "\000\002\017\005\000\002\020\003\000\002\020\004\000" +
- "\002\024\003\000\002\024\005\000\002\025\003\000\002" +
- "\025\003\000\002\025\005\000\002\025\005\000\002\006" +
- "\003\000\002\006\003\000\002\027\003\000\002\027\005" +
- "\000\002\027\003\000\002\031\003\000\002\031\004\000" +
- "\002\031\003\000\002\030\005\000\002\032\004\000\002" +
- "\011\003\000\002\011\004\000\002\011\005\000\002\011" +
- "\004\000\002\011\003\000\002\053\004\000\002\053\003" +
- "\000\002\052\003\000\002\052\003\000\002\052\003\000" +
- "\002\052\003\000\002\052\003\000\002\052\003\000\002" +
- "\052\003\000\002\052\003\000\002\052\003\000\002\052" +
- "\003\000\002\052\003\000\002\052\003\000\002\052\003" +
- "\000\002\026\003\000\002\026\003\000\002\010\003\000" +
- "\002\010\004\000\002\023\003\000\002\023\005\000\002" +
- "\023\003\000\002\023\003\000\002\023\003\000\002\023" +
- "\003\000\002\021\004\000\002\022\005\000\002\022\006" +
- "\000\002\046\003\000\002\046\005\000\002\050\003\000" +
- "\002\051\003\000\002\005\003\000\002\033\003\000\002" +
- "\033\003\000\002\033\003\000\002\033\003\000\002\033" +
- "\006\000\002\033\003\000\002\034\003\000\002\034\003" +
- "\000\002\047\003\000\002\047\003\000\002\047\003\000" +
- "\002\047\003\000\002\047\003\000\002\047\003\000\002" +
- "\047\003\000\002\047\003\000\002\047\003\000\002\047" +
- "\003\000\002\047\003\000\002\047\003\000\002\047\003" +
- "\000\002\047\003\000\002\047\003\000\002\047\003\000" +
- "\002\047\003\000\002\047\003" });
-
- /** Access to production table. */
- public short[][] production_table() {return _production_table;}
-
- /** Parse-action table. */
- protected static final short[][] _action_table =
- unpackFromStrings(new String[] {
- "\000\307\000\006\066\006\067\005\001\002\000\004\002" +
- "\311\001\002\000\110\004\061\005\111\011\071\013\103" +
- "\015\134\016\066\017\106\021\070\031\075\032\031\033" +
- "\040\034\057\035\034\036\113\037\141\040\142\041\145" +
- "\044\063\045\062\046\065\047\115\050\123\051\136\052" +
- "\077\053\143\054\131\055\125\056\116\057\104\060\140" +
- "\061\067\062\060\063\127\064\132\065\072\001\002\000" +
- "\070\004\013\013\027\016\020\021\023\032\031\033\040" +
- "\035\034\036\033\037\046\040\047\041\051\044\015\045" +
- "\014\046\016\047\036\050\037\051\044\052\025\053\050" +
- "\054\043\055\041\056\035\057\030\060\045\061\021\062" +
- "\012\063\042\001\002\000\006\002\ufffe\010\306\001\002" +
- "\000\004\002\000\001\002\000\014\002\uffe7\004\uffe7\006" +
- "\uffe7\010\uffe7\021\uffe7\001\002\000\054\002\uff7a\004\uff7a" +
- "\006\uff7a\007\uff7a\010\uff7a\012\uff7a\013\uff7a\014\uff7a\021" +
- "\uff7a\022\uff7a\023\uff7a\024\uff7a\025\uff7a\026\uff7a\027\uff7a" +
- "\030\uff7a\031\uff7a\032\uff7a\033\uff7a\042\uff7a\043\uff7a\001" +
- "\002\000\070\002\ufffc\010\ufffc\013\027\016\020\032\031" +
- "\033\040\035\034\036\113\037\141\040\047\041\051\044" +
- "\015\045\014\046\016\047\036\050\037\051\044\052\025" +
- "\053\050\054\043\055\041\056\035\057\030\060\045\061" +
- "\021\062\012\063\042\001\002\000\014\002\uffe3\004\uffe3" +
- "\006\uffe3\010\uffe3\021\uffe3\001\002\000\014\002\uffe4\004" +
- "\uffe4\006\uffe4\010\uffe4\021\uffe4\001\002\000\004\011\302" +
- "\001\002\000\012\002\ufffa\004\277\010\ufffa\021\276\001" +
- "\002\000\062\013\uffe0\032\uffe0\033\uffe0\035\uffe0\036\uffe0" +
- "\037\uffe0\040\uffe0\041\uffe0\044\uffe0\045\uffe0\046\uffe0\047" +
- "\uffe0\050\uffe0\051\uffe0\052\uffe0\053\uffe0\054\uffe0\055\uffe0" +
- "\056\uffe0\057\uffe0\060\uffe0\061\uffe0\062\uffe0\063\uffe0\001" +
- "\002\000\054\002\uff7b\004\uff7b\006\uff7b\007\uff7b\010\uff7b" +
- "\012\uff7b\013\uff7b\014\uff7b\021\uff7b\022\uff7b\023\uff7b\024" +
- "\uff7b\025\uff7b\026\uff7b\027\uff7b\030\uff7b\031\uff7b\032\uff7b" +
- "\033\uff7b\042\uff7b\043\uff7b\001\002\000\062\013\027\032" +
- "\031\033\040\035\034\036\113\037\141\040\047\041\051" +
- "\044\015\045\014\046\016\047\036\050\037\051\044\052" +
- "\170\053\166\054\043\055\041\056\035\057\030\060\045" +
- "\061\021\062\012\063\042\001\002\000\064\013\027\016" +
- "\020\032\031\033\040\035\034\036\113\037\141\040\047" +
- "\041\051\044\015\045\014\046\016\047\036\050\037\051" +
- "\044\052\025\053\050\054\043\055\041\056\035\057\030" +
- "\060\045\061\021\062\012\063\042\001\002\000\012\002" +
- "\ufff2\004\266\010\ufff2\021\265\001\002\000\016\002\uff7f" +
- "\004\uff7f\006\uff7f\010\uff7f\020\264\021\uff7f\001\002\000" +
- "\006\002\ufff6\010\ufff6\001\002\000\014\002\uffe2\004\uffe2" +
- "\006\uffe2\010\uffe2\021\uffe2\001\002\000\054\002\uff7d\004" +
- "\uff7d\006\uff7d\007\uff7d\010\uff7d\012\uff7d\013\uff7d\014\uff7d" +
- "\021\uff7d\022\uff7d\023\uff7d\024\uff7d\025\uff7d\026\uff7d\027" +
- "\uff7d\030\uff7d\031\uff7d\032\uff7d\033\uff7d\042\uff7d\043\uff7d" +
- "\001\002\000\056\002\uff85\004\uff85\006\uff85\007\uff85\010" +
- "\uff85\011\uff85\012\uff85\013\uff85\014\uff85\021\uff85\022\uff85" +
- "\023\uff85\024\uff85\025\uff85\026\uff85\027\uff85\030\uff85\031" +
- "\uff85\032\uff85\033\uff85\042\uff85\043\uff85\001\002\000\014" +
- "\002\uffed\004\uffed\006\055\010\uffed\021\uffed\001\002\000" +
- "\016\002\uff75\004\uff75\006\uff75\010\uff75\011\260\021\uff75" +
- "\001\002\000\056\002\uff86\004\uff86\006\uff86\007\uff86\010" +
- "\uff86\011\uff86\012\uff86\013\uff86\014\uff86\021\uff86\022\uff86" +
- "\023\uff86\024\uff86\025\uff86\026\uff86\027\uff86\030\uff86\031" +
- "\uff86\032\uff86\033\uff86\042\uff86\043\uff86\001\002\000\054" +
- "\002\uff7e\004\uff7e\006\uff7e\007\uff7e\010\uff7e\012\uff7e\013" +
- "\uff7e\014\uff7e\021\uff7e\022\uff7e\023\uff7e\024\uff7e\025\uff7e" +
- "\026\uff7e\027\uff7e\030\uff7e\031\uff7e\032\uff7e\033\uff7e\042" +
- "\uff7e\043\uff7e\001\002\000\054\002\uff77\004\uff77\006\uff77" +
- "\007\uff77\010\uff77\012\uff77\013\uff77\014\uff77\021\uff77\022" +
- "\uff77\023\uff77\024\uff77\025\uff77\026\uff77\027\uff77\030\uff77" +
- "\031\uff77\032\uff77\033\uff77\042\uff77\043\uff77\001\002\000" +
- "\054\002\uff76\004\uff76\006\uff76\007\uff76\010\uff76\012\uff76" +
- "\013\uff76\014\uff76\021\uff76\022\uff76\023\uff76\024\uff76\025" +
- "\uff76\026\uff76\027\uff76\030\uff76\031\uff76\032\uff76\033\uff76" +
- "\042\uff76\043\uff76\001\002\000\056\002\uff84\004\uff84\006" +
- "\uff84\007\uff84\010\uff84\011\uff84\012\uff84\013\uff84\014\uff84" +
- "\021\uff84\022\uff84\023\uff84\024\uff84\025\uff84\026\uff84\027" +
- "\uff84\030\uff84\031\uff84\032\uff84\033\uff84\042\uff84\043\uff84" +
- "\001\002\000\054\002\uff81\004\uff81\006\uff81\007\uff81\010" +
- "\uff81\012\uff81\013\uff81\014\uff81\021\uff81\022\uff81\023\uff81" +
- "\024\uff81\025\uff81\026\uff81\027\uff81\030\uff81\031\uff81\032" +
- "\uff81\033\uff81\042\uff81\043\uff81\001\002\000\054\002\uff78" +
- "\004\uff78\006\uff78\007\uff78\010\uff78\012\uff78\013\uff78\014" +
- "\uff78\021\uff78\022\uff78\023\uff78\024\uff78\025\uff78\026\uff78" +
- "\027\uff78\030\uff78\031\uff78\032\uff78\033\uff78\042\uff78\043" +
- "\uff78\001\002\000\054\002\uff82\004\uff82\006\uff82\007\uff82" +
- "\010\uff82\012\uff82\013\uff82\014\uff82\021\uff82\022\uff82\023" +
- "\uff82\024\uff82\025\uff82\026\uff82\027\uff82\030\uff82\031\uff82" +
- "\032\uff82\033\uff82\042\uff82\043\uff82\001\002\000\054\002" +
- "\uff79\004\uff79\006\uff79\007\uff79\010\uff79\012\uff79\013\uff79" +
- "\014\uff79\021\uff79\022\uff79\023\uff79\024\uff79\025\uff79\026" +
- "\uff79\027\uff79\030\uff79\031\uff79\032\uff79\033\uff79\042\uff79" +
- "\043\uff79\001\002\000\054\002\uff7c\004\uff7c\006\uff7c\007" +
- "\uff7c\010\uff7c\012\uff7c\013\uff7c\014\uff7c\021\uff7c\022\uff7c" +
- "\023\uff7c\024\uff7c\025\uff7c\026\uff7c\027\uff7c\030\uff7c\031" +
- "\uff7c\032\uff7c\033\uff7c\042\uff7c\043\uff7c\001\002\000\016" +
- "\002\uff83\004\uff83\006\uff83\010\uff83\011\253\021\uff83\001" +
- "\002\000\014\002\uffe5\004\uffe5\006\uffe5\010\uffe5\021\uffe5" +
- "\001\002\000\016\002\uff80\004\uff80\006\uff80\010\uff80\020" +
- "\252\021\uff80\001\002\000\014\002\uffe6\004\uffe6\006\uffe6" +
- "\010\uffe6\021\uffe6\001\002\000\014\002\uffe1\004\uffe1\006" +
- "\uffe1\010\uffe1\021\uffe1\001\002\000\014\002\uffef\004\uffef" +
- "\006\055\010\uffef\021\uffef\001\002\000\054\002\uffdd\004" +
- "\uffdd\006\055\007\uffdd\010\uffdd\012\uffdd\013\uffdd\014\uffdd" +
- "\021\uffdd\022\uffdd\023\uffdd\024\uffdd\025\uffdd\026\uffdd\027" +
- "\uffdd\030\uffdd\031\uffdd\032\uffdd\033\uffdd\042\uffdd\043\uffdd" +
- "\001\002\000\110\004\061\005\111\011\071\013\103\015" +
- "\134\016\066\017\106\021\070\031\075\032\031\033\040" +
- "\034\057\035\034\036\113\037\141\040\142\041\145\044" +
- "\063\045\062\046\065\047\115\050\123\051\136\052\077" +
- "\053\143\054\131\055\125\056\116\057\104\060\140\061" +
- "\067\062\060\063\127\064\132\065\072\001\002\000\012" +
- "\002\uffee\004\uffee\010\uffee\021\uffee\001\002\000\054\002" +
- "\uff9a\004\uff9a\006\uff9a\007\uff9a\010\uff9a\012\uff9a\013\uff9a" +
- "\014\uff9a\021\uff9a\022\uff9a\023\uff9a\024\uff9a\025\uff9a\026" +
- "\uff9a\027\uff9a\030\uff9a\031\uff9a\032\uff9a\033\uff9a\042\uff9a" +
- "\043\uff9a\001\002\000\060\002\uff7a\004\uff7a\006\uff7a\007" +
- "\uff7a\010\uff7a\011\uff7a\012\uff7a\013\uff7a\014\uff7a\020\uffa5" +
- "\021\uff7a\022\uff7a\023\uff7a\024\uff7a\025\uff7a\026\uff7a\027" +
- "\uff7a\030\uff7a\031\uff7a\032\uff7a\033\uff7a\042\uff7a\043\uff7a" +
- "\001\002\000\126\002\uffb9\005\111\007\uffb9\010\uffb9\012" +
- "\uffb9\013\103\014\uffb9\016\066\017\106\022\uffb9\023\uffb9" +
- "\024\uffb9\025\uffb9\026\uffb9\027\uffb9\030\uffb9\031\uffb9\032" +
- "\031\033\040\035\034\036\113\037\141\040\142\041\145" +
- "\042\uffb9\043\uffb9\044\063\045\062\046\065\047\115\050" +
- "\123\051\136\052\077\053\143\054\131\055\125\056\116" +
- "\057\104\060\140\061\067\062\060\063\127\001\002\000" +
- "\054\002\uff89\004\uff89\006\uff89\007\uff89\010\uff89\012\uff89" +
- "\013\uff89\014\uff89\021\uff89\022\uff89\023\uff89\024\uff89\025" +
- "\uff89\026\uff89\027\uff89\030\uff89\031\uff89\032\uff89\033\uff89" +
- "\042\uff89\043\uff89\001\002\000\054\002\uff8b\004\uff8b\006" +
- "\uff8b\007\uff8b\010\uff8b\012\uff8b\013\uff8b\014\uff8b\021\uff8b" +
- "\022\uff8b\023\uff8b\024\uff8b\025\uff8b\026\uff8b\027\uff8b\030" +
- "\uff8b\031\uff8b\032\uff8b\033\uff8b\042\uff8b\043\uff8b\001\002" +
- "\000\032\002\uffd5\007\uffd5\012\uffd5\014\uffd5\022\uffd5\023" +
- "\uffd5\024\221\025\222\026\223\027\224\042\uffd5\043\uffd5" +
- "\001\002\000\004\011\245\001\002\000\062\013\uffae\032" +
- "\uffae\033\uffae\035\uffae\036\uffae\037\uffae\040\uffae\041\uffae" +
- "\044\uffae\045\uffae\046\uffae\047\uffae\050\uffae\051\uffae\052" +
- "\uffae\053\uffae\054\uffae\055\uffae\056\uffae\057\uffae\060\uffae" +
- "\061\uffae\062\uffae\063\uffae\001\002\000\060\002\uff7b\004" +
- "\uff7b\006\uff7b\007\uff7b\010\uff7b\011\uff7b\012\uff7b\013\uff7b" +
- "\014\uff7b\020\uffa6\021\uff7b\022\uff7b\023\uff7b\024\uff7b\025" +
- "\uff7b\026\uff7b\027\uff7b\030\uff7b\031\uff7b\032\uff7b\033\uff7b" +
- "\042\uff7b\043\uff7b\001\002\000\070\005\111\013\103\016" +
- "\066\017\106\032\031\033\040\035\034\036\113\037\141" +
- "\040\142\041\145\044\063\045\062\046\065\047\115\050" +
- "\123\051\136\052\077\053\143\054\131\055\125\056\116" +
- "\057\104\060\140\061\067\062\060\063\127\001\002\000" +
- "\110\004\061\005\111\011\071\013\103\015\134\016\066" +
- "\017\106\021\070\031\075\032\031\033\040\034\057\035" +
- "\034\036\113\037\141\040\142\041\145\044\063\045\062" +
- "\046\065\047\115\050\123\051\136\052\077\053\143\054" +
- "\131\055\125\056\116\057\104\060\140\061\067\062\060" +
- "\063\127\064\132\065\072\001\002\000\054\002\uff99\004" +
- "\uff99\006\uff99\007\uff99\010\uff99\012\uff99\013\uff99\014\uff99" +
- "\021\uff99\022\uff99\023\uff99\024\uff99\025\uff99\026\uff99\027" +
- "\uff99\030\uff99\031\uff99\032\uff99\033\uff99\042\uff99\043\uff99" +
- "\001\002\000\046\002\uffb7\007\uffb7\010\uffb7\012\uffb7\013" +
- "\uffb7\014\uffb7\022\uffb7\023\uffb7\024\uffb7\025\uffb7\026\uffb7" +
- "\027\uffb7\030\uffb7\031\uffb7\032\uffb7\033\uffb7\042\uffb7\043" +
- "\uffb7\001\002\000\054\002\uff97\004\uff97\006\uff97\007\uff97" +
- "\010\uff97\012\uff97\013\uff97\014\uff97\021\uff97\022\uff97\023" +
- "\uff97\024\uff97\025\uff97\026\uff97\027\uff97\030\uff97\031\uff97" +
- "\032\uff97\033\uff97\042\uff97\043\uff97\001\002\000\110\004" +
- "\061\005\111\011\071\013\103\015\134\016\066\017\106" +
- "\021\070\031\075\032\031\033\040\034\057\035\034\036" +
- "\113\037\141\040\142\041\145\044\063\045\062\046\065" +
- "\047\115\050\123\051\136\052\077\053\143\054\131\055" +
- "\125\056\116\057\104\060\140\061\067\062\060\063\127" +
- "\064\132\065\072\001\002\000\016\002\uffd9\007\uffd9\012" +
- "\uffd9\014\uffd9\042\uffd9\043\234\001\002\000\060\002\uff7f" +
- "\004\uff7f\006\uff7f\007\uff7f\010\uff7f\011\uff7f\012\uff7f\013" +
- "\uff7f\014\uff7f\020\uffaa\021\uff7f\022\uff7f\023\uff7f\024\uff7f" +
- "\025\uff7f\026\uff7f\027\uff7f\030\uff7f\031\uff7f\032\uff7f\033" +
- "\uff7f\042\uff7f\043\uff7f\001\002\000\062\013\103\032\031" +
- "\033\040\035\034\036\113\037\141\040\142\041\145\044" +
- "\063\045\062\046\065\047\036\050\037\051\044\052\170" +
- "\053\166\054\043\055\041\056\035\057\030\060\045\061" +
- "\021\062\012\063\042\001\002\000\004\020\236\001\002" +
- "\000\014\002\uffda\007\uffda\012\uffda\014\uffda\042\232\001" +
- "\002\000\054\002\uff88\004\uff88\006\uff88\007\uff88\010\uff88" +
- "\012\uff88\013\uff88\014\uff88\021\uff88\022\uff88\023\uff88\024" +
- "\uff88\025\uff88\026\uff88\027\uff88\030\uff88\031\uff88\032\uff88" +
- "\033\uff88\042\uff88\043\uff88\001\002\000\060\002\uff7d\004" +
- "\uff7d\006\uff7d\007\uff7d\010\uff7d\011\uff7d\012\uff7d\013\uff7d" +
- "\014\uff7d\020\uffa8\021\uff7d\022\uff7d\023\uff7d\024\uff7d\025" +
- "\uff7d\026\uff7d\027\uff7d\030\uff7d\031\uff7d\032\uff7d\033\uff7d" +
- "\042\uff7d\043\uff7d\001\002\000\022\002\uffd7\007\uffd7\012" +
- "\uffd7\014\uffd7\022\216\023\217\042\uffd7\043\uffd7\001\002" +
- "\000\052\002\uff9f\004\uff9f\007\uff9f\010\uff9f\012\uff9f\013" +
- "\uff9f\014\uff9f\021\uff9f\022\uff9f\023\uff9f\024\uff9f\025\uff9f" +
- "\026\uff9f\027\uff9f\030\uff9f\031\uff9f\032\uff9f\033\uff9f\042" +
- "\uff9f\043\uff9f\001\002\000\054\002\uffb4\004\uffb4\006\055" +
- "\007\uffb4\010\uffb4\012\uffb4\013\uffb4\014\uffb4\021\uffb4\022" +
- "\uffb4\023\uffb4\024\uffb4\025\uffb4\026\uffb4\027\uffb4\030\uffb4" +
- "\031\uffb4\032\uffb4\033\uffb4\042\uffb4\043\uffb4\001\002\000" +
- "\046\002\uffbd\007\uffbd\010\uffbd\012\uffbd\013\uffbd\014\uffbd" +
- "\022\uffbd\023\uffbd\024\uffbd\025\uffbd\026\uffbd\027\uffbd\030" +
- "\uffbd\031\uffbd\032\uffbd\033\uffbd\042\uffbd\043\uffbd\001\002" +
- "\000\052\002\uffa0\004\uffa0\007\uffa0\010\uffa0\012\uffa0\013" +
- "\uffa0\014\uffa0\021\uffa0\022\uffa0\023\uffa0\024\uffa0\025\uffa0" +
- "\026\uffa0\027\uffa0\030\uffa0\031\uffa0\032\uffa0\033\uffa0\042" +
- "\uffa0\043\uffa0\001\002\000\036\002\uffd2\007\uffd2\012\uffd2" +
- "\014\uffd2\022\uffd2\023\uffd2\024\uffd2\025\uffd2\026\uffd2\027" +
- "\uffd2\030\211\031\212\042\uffd2\043\uffd2\001\002\000\056" +
- "\002\uff75\004\uff75\006\uff75\007\uff75\010\uff75\011\uff75\012" +
- "\uff75\013\uff75\014\uff75\021\uff75\022\uff75\023\uff75\024\uff75" +
- "\025\uff75\026\uff75\027\uff75\030\uff75\031\uff75\032\uff75\033" +
- "\uff75\042\uff75\043\uff75\001\002\000\044\002\uffca\007\uffca" +
- "\012\uffca\013\uffca\014\uffca\022\uffca\023\uffca\024\uffca\025" +
- "\uffca\026\uffca\027\uffca\030\uffca\031\uffca\032\uffca\033\uffca" +
- "\042\uffca\043\uffca\001\002\000\060\002\uff77\004\uff77\006" +
- "\uff77\007\uff77\010\uff77\011\uff77\012\uff77\013\uff77\014\uff77" +
- "\020\uffa2\021\uff77\022\uff77\023\uff77\024\uff77\025\uff77\026" +
- "\uff77\027\uff77\030\uff77\031\uff77\032\uff77\033\uff77\042\uff77" +
- "\043\uff77\001\002\000\060\002\uff7e\004\uff7e\006\uff7e\007" +
- "\uff7e\010\uff7e\011\uff7e\012\uff7e\013\uff7e\014\uff7e\020\uffa9" +
- "\021\uff7e\022\uff7e\023\uff7e\024\uff7e\025\uff7e\026\uff7e\027" +
- "\uff7e\030\uff7e\031\uff7e\032\uff7e\033\uff7e\042\uff7e\043\uff7e" +
- "\001\002\000\004\011\201\001\002\000\052\002\uffbc\004" +
- "\uffbc\007\uffbc\010\uffbc\012\uffbc\013\uffbc\014\uffbc\021\uffbc" +
- "\022\uffbc\023\uffbc\024\uffbc\025\uffbc\026\uffbc\027\uffbc\030" +
- "\uffbc\031\uffbc\032\uffbc\033\uffbc\042\uffbc\043\uffbc\001\002" +
- "\000\046\002\uffc2\007\uffc2\010\uffc2\012\uffc2\013\uffc2\014" +
- "\uffc2\022\uffc2\023\uffc2\024\uffc2\025\uffc2\026\uffc2\027\uffc2" +
- "\030\uffc2\031\uffc2\032\uffc2\033\uffc2\042\uffc2\043\uffc2\001" +
- "\002\000\054\002\uff9e\004\uff9e\006\055\007\uff9e\010\uff9e" +
- "\012\uff9e\013\uff9e\014\uff9e\021\uff9e\022\uff9e\023\uff9e\024" +
- "\uff9e\025\uff9e\026\uff9e\027\uff9e\030\uff9e\031\uff9e\032\uff9e" +
- "\033\uff9e\042\uff9e\043\uff9e\001\002\000\060\002\uff76\004" +
- "\uff76\006\uff76\007\uff76\010\uff76\011\uff76\012\uff76\013\uff76" +
- "\014\uff76\020\uffa1\021\uff76\022\uff76\023\uff76\024\uff76\025" +
- "\uff76\026\uff76\027\uff76\030\uff76\031\uff76\032\uff76\033\uff76" +
- "\042\uff76\043\uff76\001\002\000\046\002\uffc4\007\uffc4\010" +
- "\176\012\uffc4\013\uffc4\014\uffc4\022\uffc4\023\uffc4\024\uffc4" +
- "\025\uffc4\026\uffc4\027\uffc4\030\uffc4\031\uffc4\032\uffc4\033" +
- "\uffc4\042\uffc4\043\uffc4\001\002\000\060\002\uff81\004\uff81" +
- "\006\uff81\007\uff81\010\uff81\011\uff81\012\uff81\013\uff81\014" +
- "\uff81\020\uffac\021\uff81\022\uff81\023\uff81\024\uff81\025\uff81" +
- "\026\uff81\027\uff81\030\uff81\031\uff81\032\uff81\033\uff81\042" +
- "\uff81\043\uff81\001\002\000\054\002\uff9c\004\uff9c\006\uff9c" +
- "\007\uff9c\010\uff9c\012\uff9c\013\uff9c\014\uff9c\021\uff9c\022" +
- "\uff9c\023\uff9c\024\uff9c\025\uff9c\026\uff9c\027\uff9c\030\uff9c" +
- "\031\uff9c\032\uff9c\033\uff9c\042\uff9c\043\uff9c\001\002\000" +
- "\060\002\uff78\004\uff78\006\uff78\007\uff78\010\uff78\011\uff78" +
- "\012\uff78\013\uff78\014\uff78\020\uffa3\021\uff78\022\uff78\023" +
- "\uff78\024\uff78\025\uff78\026\uff78\027\uff78\030\uff78\031\uff78" +
- "\032\uff78\033\uff78\042\uff78\043\uff78\001\002\000\052\002" +
- "\uffc1\004\173\007\uffc1\010\uffc1\012\uffc1\013\uffc1\014\uffc1" +
- "\021\172\022\uffc1\023\uffc1\024\uffc1\025\uffc1\026\uffc1\027" +
- "\uffc1\030\uffc1\031\uffc1\032\uffc1\033\uffc1\042\uffc1\043\uffc1" +
- "\001\002\000\060\002\uff82\004\uff82\006\uff82\007\uff82\010" +
- "\uff82\011\uff82\012\uff82\013\uff82\014\uff82\020\uffad\021\uff82" +
- "\022\uff82\023\uff82\024\uff82\025\uff82\026\uff82\027\uff82\030" +
- "\uff82\031\uff82\032\uff82\033\uff82\042\uff82\043\uff82\001\002" +
- "\000\054\002\uff98\004\uff98\006\uff98\007\uff98\010\uff98\012" +
- "\uff98\013\uff98\014\uff98\021\uff98\022\uff98\023\uff98\024\uff98" +
- "\025\uff98\026\uff98\027\uff98\030\uff98\031\uff98\032\uff98\033" +
- "\uff98\042\uff98\043\uff98\001\002\000\004\007\171\001\002" +
- "\000\046\032\031\033\040\035\034\036\113\037\141\047" +
- "\036\050\037\051\044\052\170\053\166\054\043\055\041" +
- "\056\035\057\030\060\045\061\021\062\012\063\042\001" +
- "\002\000\052\002\uffba\004\uffba\007\uffba\010\uffba\012\uffba" +
- "\013\uffba\014\uffba\021\uffba\022\uffba\023\uffba\024\uffba\025" +
- "\uffba\026\uffba\027\uffba\030\uffba\031\uffba\032\uffba\033\uffba" +
- "\042\uffba\043\uffba\001\002\000\060\002\uff79\004\uff79\006" +
- "\uff79\007\uff79\010\uff79\011\uff79\012\uff79\013\uff79\014\uff79" +
- "\020\uffa4\021\uff79\022\uff79\023\uff79\024\uff79\025\uff79\026" +
- "\uff79\027\uff79\030\uff79\031\uff79\032\uff79\033\uff79\042\uff79" +
- "\043\uff79\001\002\000\052\002\uffb0\004\uffb0\007\uffb0\010" +
- "\uffb0\012\uffb0\013\uffb0\014\uffb0\021\uffb0\022\uffb0\023\uffb0" +
- "\024\uffb0\025\uffb0\026\uffb0\027\uffb0\030\uffb0\031\uffb0\032" +
- "\uffb0\033\uffb0\042\uffb0\043\uffb0\001\002\000\060\002\uff7c" +
- "\004\uff7c\006\uff7c\007\uff7c\010\uff7c\011\uff7c\012\uff7c\013" +
- "\uff7c\014\uff7c\020\uffa7\021\uff7c\022\uff7c\023\uff7c\024\uff7c" +
- "\025\uff7c\026\uff7c\027\uff7c\030\uff7c\031\uff7c\032\uff7c\033" +
- "\uff7c\042\uff7c\043\uff7c\001\002\000\056\002\uff83\004\uff83" +
- "\006\uff83\007\uff83\010\uff83\011\uff83\012\uff83\013\uff83\014" +
- "\uff83\021\uff83\022\uff83\023\uff83\024\uff83\025\uff83\026\uff83" +
- "\027\uff83\030\uff83\031\uff83\032\uff83\033\uff83\042\uff83\043" +
- "\uff83\001\002\000\054\002\uff8c\004\uff8c\006\uff8c\007\uff8c" +
- "\010\uff8c\012\uff8c\013\uff8c\014\uff8c\021\uff8c\022\uff8c\023" +
- "\uff8c\024\uff8c\025\uff8c\026\uff8c\027\uff8c\030\uff8c\031\uff8c" +
- "\032\uff8c\033\uff8c\042\uff8c\043\uff8c\001\002\000\060\002" +
- "\uff80\004\uff80\006\uff80\007\uff80\010\uff80\011\uff80\012\uff80" +
- "\013\uff80\014\uff80\020\uffab\021\uff80\022\uff80\023\uff80\024" +
- "\uff80\025\uff80\026\uff80\027\uff80\030\uff80\031\uff80\032\uff80" +
- "\033\uff80\042\uff80\043\uff80\001\002\000\044\002\uffc6\007" +
- "\uffc6\012\uffc6\013\uffc6\014\uffc6\022\uffc6\023\uffc6\024\uffc6" +
- "\025\uffc6\026\uffc6\027\uffc6\030\uffc6\031\uffc6\032\uffc6\033" +
- "\uffc6\042\uffc6\043\uffc6\001\002\000\054\002\uff8d\004\uff8d" +
- "\006\uff8d\007\uff8d\010\uff8d\012\uff8d\013\uff8d\014\uff8d\021" +
- "\uff8d\022\uff8d\023\uff8d\024\uff8d\025\uff8d\026\uff8d\027\uff8d" +
- "\030\uff8d\031\uff8d\032\uff8d\033\uff8d\042\uff8d\043\uff8d\001" +
- "\002\000\044\002\uffcd\007\uffcd\012\uffcd\013\160\014\uffcd" +
- "\022\uffcd\023\uffcd\024\uffcd\025\uffcd\026\uffcd\027\uffcd\030" +
- "\uffcd\031\uffcd\032\161\033\157\042\uffcd\043\uffcd\001\002" +
- "\000\052\002\uffbe\004\153\007\uffbe\010\uffbe\012\uffbe\013" +
- "\uffbe\014\uffbe\021\152\022\uffbe\023\uffbe\024\uffbe\025\uffbe" +
- "\026\uffbe\027\uffbe\030\uffbe\031\uffbe\032\uffbe\033\uffbe\042" +
- "\uffbe\043\uffbe\001\002\000\054\002\uff8e\004\uff8e\006\uff8e" +
- "\007\uff8e\010\uff8e\012\uff8e\013\uff8e\014\uff8e\021\uff8e\022" +
- "\uff8e\023\uff8e\024\uff8e\025\uff8e\026\uff8e\027\uff8e\030\uff8e" +
- "\031\uff8e\032\uff8e\033\uff8e\042\uff8e\043\uff8e\001\002\000" +
- "\056\002\uff87\004\uff87\006\uff87\007\uff87\010\uff87\011\uff91" +
- "\012\uff87\013\uff87\014\uff87\021\uff87\022\uff87\023\uff87\024" +
- "\uff87\025\uff87\026\uff87\027\uff87\030\uff87\031\uff87\032\uff87" +
- "\033\uff87\042\uff87\043\uff87\001\002\000\070\005\111\013" +
- "\103\016\066\017\106\032\031\033\040\035\034\036\113" +
- "\037\141\040\142\041\145\044\063\045\062\046\065\047" +
- "\115\050\123\051\136\052\077\053\143\054\131\055\125" +
- "\056\116\057\104\060\140\061\067\062\060\063\127\001" +
- "\002\000\070\005\111\013\103\016\066\017\106\032\031" +
- "\033\040\035\034\036\113\037\141\040\142\041\145\044" +
- "\063\045\062\046\065\047\115\050\123\051\136\052\077" +
- "\053\143\054\131\055\125\056\116\057\104\060\140\061" +
- "\067\062\060\063\127\001\002\000\054\002\uff87\004\uff87" +
- "\006\uff87\007\uff87\010\uff87\012\uff87\013\uff87\014\uff87\021" +
- "\uff87\022\uff87\023\uff87\024\uff87\025\uff87\026\uff87\027\uff87" +
- "\030\uff87\031\uff87\032\uff87\033\uff87\042\uff87\043\uff87\001" +
- "\002\000\052\002\uffbb\004\uffbb\007\uffbb\010\uffbb\012\uffbb" +
- "\013\uffbb\014\uffbb\021\uffbb\022\uffbb\023\uffbb\024\uffbb\025" +
- "\uffbb\026\uffbb\027\uffbb\030\uffbb\031\uffbb\032\uffbb\033\uffbb" +
- "\042\uffbb\043\uffbb\001\002\000\052\002\uffb6\004\uffb6\007" +
- "\uffb6\010\uffb6\012\uffb6\013\uffb6\014\uffb6\021\uffb6\022\uffb6" +
- "\023\uffb6\024\uffb6\025\uffb6\026\uffb6\027\uffb6\030\uffb6\031" +
- "\uffb6\032\uffb6\033\uffb6\042\uffb6\043\uffb6\001\002\000\110" +
- "\004\061\005\111\011\071\013\103\015\134\016\066\017" +
- "\106\021\070\031\075\032\031\033\040\034\057\035\034" +
- "\036\113\037\141\040\142\041\145\044\063\045\062\046" +
- "\065\047\115\050\123\051\136\052\077\053\143\054\131" +
- "\055\125\056\116\057\104\060\140\061\067\062\060\063" +
- "\127\064\132\065\072\001\002\000\110\004\061\005\111" +
- "\011\071\013\103\015\134\016\066\017\106\021\070\031" +
- "\075\032\031\033\040\034\057\035\034\036\113\037\141" +
- "\040\142\041\145\044\063\045\062\046\065\047\115\050" +
- "\123\051\136\052\077\053\143\054\131\055\125\056\116" +
- "\057\104\060\140\061\067\062\060\063\127\064\132\065" +
- "\072\001\002\000\110\004\061\005\111\011\071\013\103" +
- "\015\134\016\066\017\106\021\070\031\075\032\031\033" +
- "\040\034\057\035\034\036\113\037\141\040\142\041\145" +
- "\044\063\045\062\046\065\047\115\050\123\051\136\052" +
- "\077\053\143\054\131\055\125\056\116\057\104\060\140" +
- "\061\067\062\060\063\127\064\132\065\072\001\002\000" +
- "\044\002\uffc8\007\uffc8\012\uffc8\013\uffc8\014\uffc8\022\uffc8" +
- "\023\uffc8\024\uffc8\025\uffc8\026\uffc8\027\uffc8\030\uffc8\031" +
- "\uffc8\032\uffc8\033\uffc8\042\uffc8\043\uffc8\001\002\000\044" +
- "\002\uffc9\007\uffc9\012\uffc9\013\uffc9\014\uffc9\022\uffc9\023" +
- "\uffc9\024\uffc9\025\uffc9\026\uffc9\027\uffc9\030\uffc9\031\uffc9" +
- "\032\uffc9\033\uffc9\042\uffc9\043\uffc9\001\002\000\044\002" +
- "\uffc7\007\uffc7\012\uffc7\013\uffc7\014\uffc7\022\uffc7\023\uffc7" +
- "\024\uffc7\025\uffc7\026\uffc7\027\uffc7\030\uffc7\031\uffc7\032" +
- "\uffc7\033\uffc7\042\uffc7\043\uffc7\001\002\000\054\002\uff90" +
- "\004\uff90\006\uff90\007\uff90\010\uff90\012\uff90\013\uff90\014" +
- "\uff90\021\uff90\022\uff90\023\uff90\024\uff90\025\uff90\026\uff90" +
- "\027\uff90\030\uff90\031\uff90\032\uff90\033\uff90\042\uff90\043" +
- "\uff90\001\002\000\054\002\uff80\004\uff80\006\uff80\007\uff80" +
- "\010\uff80\012\uff80\013\uff80\014\uff80\021\uff80\022\uff80\023" +
- "\uff80\024\uff80\025\uff80\026\uff80\027\uff80\030\uff80\031\uff80" +
- "\032\uff80\033\uff80\042\uff80\043\uff80\001\002\000\054\002" +
- "\uff96\004\uff96\006\uff96\007\uff96\010\uff96\012\uff96\013\uff96" +
- "\014\uff96\021\uff96\022\uff96\023\uff96\024\uff96\025\uff96\026" +
- "\uff96\027\uff96\030\uff96\031\uff96\032\uff96\033\uff96\042\uff96" +
- "\043\uff96\001\002\000\054\002\uff7f\004\uff7f\006\uff7f\007" +
- "\uff7f\010\uff7f\012\uff7f\013\uff7f\014\uff7f\021\uff7f\022\uff7f" +
- "\023\uff7f\024\uff7f\025\uff7f\026\uff7f\027\uff7f\030\uff7f\031" +
- "\uff7f\032\uff7f\033\uff7f\042\uff7f\043\uff7f\001\002\000\054" +
- "\002\uffdb\004\uffdb\006\uffdb\007\uffdb\010\uffdb\012\uffdb\013" +
- "\uffdb\014\uffdb\021\uffdb\022\uffdb\023\uffdb\024\uffdb\025\uffdb" +
- "\026\uffdb\027\uffdb\030\uffdb\031\uffdb\032\uffdb\033\uffdb\042" +
- "\uffdb\043\uffdb\001\002\000\070\005\111\013\103\016\066" +
- "\017\106\032\031\033\040\035\034\036\113\037\141\040" +
- "\142\041\145\044\063\045\062\046\065\047\115\050\123" +
- "\051\136\052\077\053\143\054\131\055\125\056\116\057" +
- "\104\060\140\061\067\062\060\063\127\001\002\000\070" +
- "\005\111\013\103\016\066\017\106\032\031\033\040\035" +
- "\034\036\113\037\141\040\142\041\145\044\063\045\062" +
- "\046\065\047\115\050\123\051\136\052\077\053\143\054" +
- "\131\055\125\056\116\057\104\060\140\061\067\062\060" +
- "\063\127\001\002\000\052\002\uffc0\004\153\007\uffc0\010" +
- "\uffc0\012\uffc0\013\uffc0\014\uffc0\021\152\022\uffc0\023\uffc0" +
- "\024\uffc0\025\uffc0\026\uffc0\027\uffc0\030\uffc0\031\uffc0\032" +
- "\uffc0\033\uffc0\042\uffc0\043\uffc0\001\002\000\052\002\uffbf" +
- "\004\153\007\uffbf\010\uffbf\012\uffbf\013\uffbf\014\uffbf\021" +
- "\152\022\uffbf\023\uffbf\024\uffbf\025\uffbf\026\uffbf\027\uffbf" +
- "\030\uffbf\031\uffbf\032\uffbf\033\uffbf\042\uffbf\043\uffbf\001" +
- "\002\000\106\004\061\005\111\011\071\013\103\015\134" +
- "\016\066\017\106\021\070\032\031\033\040\034\057\035" +
- "\034\036\113\037\141\040\142\041\145\044\063\045\062" +
- "\046\065\047\115\050\123\051\136\052\077\053\143\054" +
- "\131\055\125\056\116\057\104\060\140\061\067\062\060" +
- "\063\127\064\132\065\072\001\002\000\044\002\uffc3\007" +
- "\uffc3\012\uffc3\013\uffc3\014\uffc3\022\uffc3\023\uffc3\024\uffc3" +
- "\025\uffc3\026\uffc3\027\uffc3\030\uffc3\031\uffc3\032\uffc3\033" +
- "\uffc3\042\uffc3\043\uffc3\001\002\000\052\002\uff9d\004\uff9d" +
- "\007\uff9d\010\uff9d\012\uff9d\013\uff9d\014\uff9d\021\uff9d\022" +
- "\uff9d\023\uff9d\024\uff9d\025\uff9d\026\uff9d\027\uff9d\030\uff9d" +
- "\031\uff9d\032\uff9d\033\uff9d\042\uff9d\043\uff9d\001\002\000" +
- "\112\004\061\005\111\011\071\012\202\013\103\015\134" +
- "\016\066\017\106\021\070\031\075\032\031\033\040\034" +
- "\057\035\034\036\113\037\141\040\142\041\145\044\063" +
- "\045\062\046\065\047\115\050\123\051\136\052\077\053" +
- "\143\054\131\055\125\056\116\057\104\060\140\061\067" +
- "\062\060\063\127\064\132\065\072\001\002\000\054\002" +
- "\uff95\004\uff95\006\uff95\007\uff95\010\uff95\012\uff95\013\uff95" +
- "\014\uff95\021\uff95\022\uff95\023\uff95\024\uff95\025\uff95\026" +
- "\uff95\027\uff95\030\uff95\031\uff95\032\uff95\033\uff95\042\uff95" +
- "\043\uff95\001\002\000\006\012\uff93\014\207\001\002\000" +
- "\006\012\uff8f\014\uff8f\001\002\000\004\012\206\001\002" +
- "\000\054\002\uff94\004\uff94\006\uff94\007\uff94\010\uff94\012" +
- "\uff94\013\uff94\014\uff94\021\uff94\022\uff94\023\uff94\024\uff94" +
- "\025\uff94\026\uff94\027\uff94\030\uff94\031\uff94\032\uff94\033" +
- "\uff94\042\uff94\043\uff94\001\002\000\110\004\061\005\111" +
- "\011\071\013\103\015\134\016\066\017\106\021\070\031" +
- "\075\032\031\033\040\034\057\035\034\036\113\037\141" +
- "\040\142\041\145\044\063\045\062\046\065\047\115\050" +
- "\123\051\136\052\077\053\143\054\131\055\125\056\116" +
- "\057\104\060\140\061\067\062\060\063\127\064\132\065" +
- "\072\001\002\000\004\012\uff92\001\002\000\110\004\061" +
- "\005\111\011\071\013\103\015\134\016\066\017\106\021" +
- "\070\031\075\032\031\033\040\034\057\035\034\036\113" +
- "\037\141\040\142\041\145\044\063\045\062\046\065\047" +
- "\115\050\123\051\136\052\077\053\143\054\131\055\125" +
- "\056\116\057\104\060\140\061\067\062\060\063\127\064" +
- "\132\065\072\001\002\000\110\004\061\005\111\011\071" +
- "\013\103\015\134\016\066\017\106\021\070\031\075\032" +
- "\031\033\040\034\057\035\034\036\113\037\141\040\142" +
- "\041\145\044\063\045\062\046\065\047\115\050\123\051" +
- "\136\052\077\053\143\054\131\055\125\056\116\057\104" +
- "\060\140\061\067\062\060\063\127\064\132\065\072\001" +
- "\002\000\044\002\uffcb\007\uffcb\012\uffcb\013\160\014\uffcb" +
- "\022\uffcb\023\uffcb\024\uffcb\025\uffcb\026\uffcb\027\uffcb\030" +
- "\uffcb\031\uffcb\032\161\033\157\042\uffcb\043\uffcb\001\002" +
- "\000\044\002\uffcc\007\uffcc\012\uffcc\013\160\014\uffcc\022" +
- "\uffcc\023\uffcc\024\uffcc\025\uffcc\026\uffcc\027\uffcc\030\uffcc" +
- "\031\uffcc\032\161\033\157\042\uffcc\043\uffcc\001\002\000" +
- "\052\002\uffb3\004\uffb3\007\uffb3\010\uffb3\012\uffb3\013\uffb3" +
- "\014\uffb3\021\uffb3\022\uffb3\023\uffb3\024\uffb3\025\uffb3\026" +
- "\uffb3\027\uffb3\030\uffb3\031\uffb3\032\uffb3\033\uffb3\042\uffb3" +
- "\043\uffb3\001\002\000\110\004\061\005\111\011\071\013" +
- "\103\015\134\016\066\017\106\021\070\031\075\032\031" +
- "\033\040\034\057\035\034\036\113\037\141\040\142\041" +
- "\145\044\063\045\062\046\065\047\115\050\123\051\136" +
- "\052\077\053\143\054\131\055\125\056\116\057\104\060" +
- "\140\061\067\062\060\063\127\064\132\065\072\001\002" +
- "\000\110\004\061\005\111\011\071\013\103\015\134\016" +
- "\066\017\106\021\070\031\075\032\031\033\040\034\057" +
- "\035\034\036\113\037\141\040\142\041\145\044\063\045" +
- "\062\046\065\047\115\050\123\051\136\052\077\053\143" +
- "\054\131\055\125\056\116\057\104\060\140\061\067\062" +
- "\060\063\127\064\132\065\072\001\002\000\032\002\uffd3" +
- "\007\uffd3\012\uffd3\014\uffd3\022\uffd3\023\uffd3\024\221\025" +
- "\222\026\223\027\224\042\uffd3\043\uffd3\001\002\000\110" +
- "\004\061\005\111\011\071\013\103\015\134\016\066\017" +
- "\106\021\070\031\075\032\031\033\040\034\057\035\034" +
- "\036\113\037\141\040\142\041\145\044\063\045\062\046" +
- "\065\047\115\050\123\051\136\052\077\053\143\054\131" +
- "\055\125\056\116\057\104\060\140\061\067\062\060\063" +
- "\127\064\132\065\072\001\002\000\110\004\061\005\111" +
- "\011\071\013\103\015\134\016\066\017\106\021\070\031" +
- "\075\032\031\033\040\034\057\035\034\036\113\037\141" +
- "\040\142\041\145\044\063\045\062\046\065\047\115\050" +
- "\123\051\136\052\077\053\143\054\131\055\125\056\116" +
- "\057\104\060\140\061\067\062\060\063\127\064\132\065" +
- "\072\001\002\000\110\004\061\005\111\011\071\013\103" +
- "\015\134\016\066\017\106\021\070\031\075\032\031\033" +
- "\040\034\057\035\034\036\113\037\141\040\142\041\145" +
- "\044\063\045\062\046\065\047\115\050\123\051\136\052" +
- "\077\053\143\054\131\055\125\056\116\057\104\060\140" +
- "\061\067\062\060\063\127\064\132\065\072\001\002\000" +
- "\110\004\061\005\111\011\071\013\103\015\134\016\066" +
- "\017\106\021\070\031\075\032\031\033\040\034\057\035" +
- "\034\036\113\037\141\040\142\041\145\044\063\045\062" +
- "\046\065\047\115\050\123\051\136\052\077\053\143\054" +
- "\131\055\125\056\116\057\104\060\140\061\067\062\060" +
- "\063\127\064\132\065\072\001\002\000\036\002\uffce\007" +
- "\uffce\012\uffce\014\uffce\022\uffce\023\uffce\024\uffce\025\uffce" +
- "\026\uffce\027\uffce\030\211\031\212\042\uffce\043\uffce\001" +
- "\002\000\036\002\uffcf\007\uffcf\012\uffcf\014\uffcf\022\uffcf" +
- "\023\uffcf\024\uffcf\025\uffcf\026\uffcf\027\uffcf\030\211\031" +
- "\212\042\uffcf\043\uffcf\001\002\000\036\002\uffd0\007\uffd0" +
- "\012\uffd0\014\uffd0\022\uffd0\023\uffd0\024\uffd0\025\uffd0\026" +
- "\uffd0\027\uffd0\030\211\031\212\042\uffd0\043\uffd0\001\002" +
- "\000\036\002\uffd1\007\uffd1\012\uffd1\014\uffd1\022\uffd1\023" +
- "\uffd1\024\uffd1\025\uffd1\026\uffd1\027\uffd1\030\211\031\212" +
- "\042\uffd1\043\uffd1\001\002\000\032\002\uffd4\007\uffd4\012" +
- "\uffd4\014\uffd4\022\uffd4\023\uffd4\024\221\025\222\026\223" +
- "\027\224\042\uffd4\043\uffd4\001\002\000\110\004\061\005" +
- "\111\011\071\013\103\015\134\016\066\017\106\021\070" +
- "\031\075\032\031\033\040\034\057\035\034\036\113\037" +
- "\141\040\142\041\145\044\063\045\062\046\065\047\115" +
- "\050\123\051\136\052\077\053\143\054\131\055\125\056" +
- "\116\057\104\060\140\061\067\062\060\063\127\064\132" +
- "\065\072\001\002\000\016\002\uffd8\007\uffd8\012\uffd8\014" +
- "\uffd8\042\uffd8\043\234\001\002\000\110\004\061\005\111" +
- "\011\071\013\103\015\134\016\066\017\106\021\070\031" +
- "\075\032\031\033\040\034\057\035\034\036\113\037\141" +
- "\040\142\041\145\044\063\045\062\046\065\047\115\050" +
- "\123\051\136\052\077\053\143\054\131\055\125\056\116" +
- "\057\104\060\140\061\067\062\060\063\127\064\132\065" +
- "\072\001\002\000\022\002\uffd6\007\uffd6\012\uffd6\014\uffd6" +
- "\022\216\023\217\042\uffd6\043\uffd6\001\002\000\062\013" +
- "\uffaf\032\uffaf\033\uffaf\035\uffaf\036\uffaf\037\uffaf\040\uffaf" +
- "\041\uffaf\044\uffaf\045\uffaf\046\uffaf\047\uffaf\050\uffaf\051" +
- "\uffaf\052\uffaf\053\uffaf\054\uffaf\055\uffaf\056\uffaf\057\uffaf" +
- "\060\uffaf\061\uffaf\062\uffaf\063\uffaf\001\002\000\054\002" +
- "\uffb1\004\uffb1\006\055\007\uffb1\010\uffb1\012\uffb1\013\uffb1" +
- "\014\uffb1\021\uffb1\022\uffb1\023\uffb1\024\uffb1\025\uffb1\026" +
- "\uffb1\027\uffb1\030\uffb1\031\uffb1\032\uffb1\033\uffb1\042\uffb1" +
- "\043\uffb1\001\002\000\052\002\uffb2\004\uffb2\007\uffb2\010" +
- "\uffb2\012\uffb2\013\uffb2\014\uffb2\021\uffb2\022\uffb2\023\uffb2" +
- "\024\uffb2\025\uffb2\026\uffb2\027\uffb2\030\uffb2\031\uffb2\032" +
- "\uffb2\033\uffb2\042\uffb2\043\uffb2\001\002\000\044\002\uffc5" +
- "\007\uffc5\012\uffc5\013\uffc5\014\uffc5\022\uffc5\023\uffc5\024" +
- "\uffc5\025\uffc5\026\uffc5\027\uffc5\030\uffc5\031\uffc5\032\uffc5" +
- "\033\uffc5\042\uffc5\043\uffc5\001\002\000\004\012\243\001" +
- "\002\000\054\002\uff9b\004\uff9b\006\uff9b\007\uff9b\010\uff9b" +
- "\012\uff9b\013\uff9b\014\uff9b\021\uff9b\022\uff9b\023\uff9b\024" +
- "\uff9b\025\uff9b\026\uff9b\027\uff9b\030\uff9b\031\uff9b\032\uff9b" +
- "\033\uff9b\042\uff9b\043\uff9b\001\002\000\052\002\uffb5\004" +
- "\153\007\uffb5\010\uffb5\012\uffb5\013\uffb5\014\uffb5\021\152" +
- "\022\uffb5\023\uffb5\024\uffb5\025\uffb5\026\uffb5\027\uffb5\030" +
- "\uffb5\031\uffb5\032\uffb5\033\uffb5\042\uffb5\043\uffb5\001\002" +
- "\000\004\034\246\001\002\000\004\012\247\001\002\000" +
- "\054\002\uff8a\004\uff8a\006\uff8a\007\uff8a\010\uff8a\012\uff8a" +
- "\013\uff8a\014\uff8a\021\uff8a\022\uff8a\023\uff8a\024\uff8a\025" +
- "\uff8a\026\uff8a\027\uff8a\030\uff8a\031\uff8a\032\uff8a\033\uff8a" +
- "\042\uff8a\043\uff8a\001\002\000\052\002\uffb8\004\153\007" +
- "\uffb8\010\uffb8\012\uffb8\013\uffb8\014\uffb8\021\152\022\uffb8" +
- "\023\uffb8\024\uffb8\025\uffb8\026\uffb8\027\uffb8\030\uffb8\031" +
- "\uffb8\032\uffb8\033\uffb8\042\uffb8\043\uffb8\001\002\000\052" +
- "\002\uffdc\004\uffdc\007\uffdc\010\uffdc\012\uffdc\013\uffdc\014" +
- "\uffdc\021\uffdc\022\uffdc\023\uffdc\024\uffdc\025\uffdc\026\uffdc" +
- "\027\uffdc\030\uffdc\031\uffdc\032\uffdc\033\uffdc\042\uffdc\043" +
- "\uffdc\001\002\000\062\013\uffde\032\uffde\033\uffde\035\uffde" +
- "\036\uffde\037\uffde\040\uffde\041\uffde\044\uffde\045\uffde\046" +
- "\uffde\047\uffde\050\uffde\051\uffde\052\uffde\053\uffde\054\uffde" +
- "\055\uffde\056\uffde\057\uffde\060\uffde\061\uffde\062\uffde\063" +
- "\uffde\001\002\000\004\034\254\001\002\000\004\014\255" +
- "\001\002\000\004\034\256\001\002\000\004\012\257\001" +
- "\002\000\012\002\ufff4\004\ufff4\010\ufff4\021\ufff4\001\002" +
- "\000\004\034\261\001\002\000\004\012\262\001\002\000" +
- "\012\002\ufff5\004\ufff5\010\ufff5\021\ufff5\001\002\000\012" +
- "\002\uffec\004\uffec\010\uffec\021\uffec\001\002\000\062\013" +
- "\uffdf\032\uffdf\033\uffdf\035\uffdf\036\uffdf\037\uffdf\040\uffdf" +
- "\041\uffdf\044\uffdf\045\uffdf\046\uffdf\047\uffdf\050\uffdf\051" +
- "\uffdf\052\uffdf\053\uffdf\054\uffdf\055\uffdf\056\uffdf\057\uffdf" +
- "\060\uffdf\061\uffdf\062\uffdf\063\uffdf\001\002\000\064\013" +
- "\027\016\020\032\031\033\040\035\034\036\113\037\141" +
- "\040\047\041\051\044\015\045\014\046\016\047\036\050" +
- "\037\051\044\052\025\053\050\054\043\055\041\056\035" +
- "\057\030\060\045\061\021\062\012\063\042\001\002\000" +
- "\064\013\027\016\020\032\031\033\040\035\034\036\113" +
- "\037\141\040\047\041\051\044\015\045\014\046\016\047" +
- "\036\050\037\051\044\052\025\053\050\054\043\055\041" +
- "\056\035\057\030\060\045\061\021\062\012\063\042\001" +
- "\002\000\006\002\ufff1\010\ufff1\001\002\000\006\002\ufff0" +
- "\010\ufff0\001\002\000\006\002\ufff7\010\ufff7\001\002\000" +
- "\014\002\uffe9\004\uffe9\006\055\010\uffe9\021\uffe9\001\002" +
- "\000\014\002\uffeb\004\uffeb\006\055\010\uffeb\021\uffeb\001" +
- "\002\000\012\002\uffea\004\uffea\010\uffea\021\uffea\001\002" +
- "\000\012\002\uffe8\004\uffe8\010\uffe8\021\uffe8\001\002\000" +
- "\064\013\027\016\020\032\031\033\040\035\034\036\113" +
- "\037\141\040\047\041\051\044\015\045\014\046\016\047" +
- "\036\050\037\051\044\052\025\053\050\054\043\055\041" +
- "\056\035\057\030\060\045\061\021\062\012\063\042\001" +
- "\002\000\064\013\027\016\020\032\031\033\040\035\034" +
- "\036\113\037\141\040\047\041\051\044\015\045\014\046" +
- "\016\047\036\050\037\051\044\052\025\053\050\054\043" +
- "\055\041\056\035\057\030\060\045\061\021\062\012\063" +
- "\042\001\002\000\006\002\ufff9\010\ufff9\001\002\000\006" +
- "\002\ufff8\010\ufff8\001\002\000\004\034\303\001\002\000" +
- "\004\012\304\001\002\000\014\002\ufff3\004\ufff3\006\ufff3" +
- "\010\ufff3\021\ufff3\001\002\000\006\002\ufffb\010\ufffb\001" +
- "\002\000\070\004\013\013\027\016\020\021\023\032\031" +
- "\033\040\035\034\036\033\037\046\040\047\041\051\044" +
- "\015\045\014\046\016\047\036\050\037\051\044\052\025" +
- "\053\050\054\043\055\041\056\035\057\030\060\045\061" +
- "\021\062\012\063\042\001\002\000\004\002\ufffd\001\002" +
- "\000\004\002\uffff\001\002\000\004\002\001\001\002" });
-
- /** Access to parse-action table. */
- public short[][] action_table() {return _action_table;}
-
- /** <code>reduce_goto</code> table. */
- protected static final short[][] _reduce_table =
- unpackFromStrings(new String[] {
- "\000\307\000\004\003\003\001\001\000\002\001\001\000" +
- "\070\004\307\006\120\010\127\011\117\012\101\013\075" +
- "\014\104\015\063\016\111\017\145\020\113\021\125\022" +
- "\073\023\121\024\143\025\123\026\136\027\146\030\134" +
- "\031\107\032\072\033\106\034\147\047\150\050\116\052" +
- "\100\053\077\001\001\000\026\035\016\036\007\037\006" +
- "\040\031\041\025\042\023\043\052\044\010\047\051\054" +
- "\021\001\001\000\002\001\001\000\002\001\001\000\002" +
- "\001\001\000\002\001\001\000\020\040\031\041\304\042" +
- "\023\043\052\044\010\047\051\054\021\001\001\000\002" +
- "\001\001\000\002\001\001\000\002\001\001\000\002\001" +
- "\001\000\002\001\001\000\002\001\001\000\012\040\271" +
- "\043\272\044\010\047\051\001\001\000\020\040\031\041" +
- "\270\042\023\043\052\044\010\047\051\054\021\001\001" +
- "\000\002\001\001\000\002\001\001\000\002\001\001\000" +
- "\002\001\001\000\002\001\001\000\002\001\001\000\006" +
- "\007\053\045\262\001\001\000\002\001\001\000\002\001" +
- "\001\000\002\001\001\000\002\001\001\000\002\001\001" +
- "\000\002\001\001\000\002\001\001\000\002\001\001\000" +
- "\002\001\001\000\002\001\001\000\002\001\001\000\002" +
- "\001\001\000\002\001\001\000\002\001\001\000\002\001" +
- "\001\000\002\001\001\000\006\007\053\045\055\001\001" +
- "\000\006\007\053\045\250\001\001\000\070\004\132\006" +
- "\120\010\127\011\117\012\101\013\075\014\104\015\063" +
- "\016\111\017\145\020\113\021\125\022\073\023\121\024" +
- "\143\025\123\026\136\027\146\030\134\031\107\032\072" +
- "\033\106\034\147\047\150\050\116\052\100\053\077\001" +
- "\001\000\002\001\001\000\002\001\001\000\002\001\001" +
- "\000\024\011\117\026\136\027\247\030\134\033\106\034" +
- "\147\047\153\052\100\053\077\001\001\000\002\001\001" +
- "\000\002\001\001\000\002\001\001\000\002\001\001\000" +
- "\002\001\001\000\002\001\001\000\024\011\117\026\136" +
- "\027\243\030\134\033\106\034\147\047\153\052\100\053" +
- "\077\001\001\000\070\004\241\006\120\010\127\011\117" +
- "\012\101\013\075\014\104\015\063\016\111\017\145\020" +
- "\113\021\125\022\073\023\121\024\143\025\123\026\136" +
- "\027\146\030\134\031\107\032\072\033\106\034\147\047" +
- "\150\050\116\052\100\053\077\001\001\000\002\001\001" +
- "\000\002\001\001\000\002\001\001\000\052\006\120\010" +
- "\127\011\117\020\240\021\125\022\073\023\121\024\143" +
- "\025\123\026\136\027\146\030\134\031\107\032\072\033" +
- "\106\034\147\047\150\050\116\052\100\053\077\001\001" +
- "\000\002\001\001\000\002\001\001\000\010\033\236\034" +
- "\147\047\153\001\001\000\002\001\001\000\002\001\001" +
- "\000\002\001\001\000\002\001\001\000\002\001\001\000" +
- "\002\001\001\000\006\007\053\045\214\001\001\000\002" +
- "\001\001\000\002\001\001\000\002\001\001\000\002\001" +
- "\001\000\002\001\001\000\002\001\001\000\002\001\001" +
- "\000\002\001\001\000\002\001\001\000\002\001\001\000" +
- "\006\007\053\045\177\001\001\000\002\001\001\000\002" +
- "\001\001\000\002\001\001\000\002\001\001\000\002\001" +
- "\001\000\002\001\001\000\002\001\001\000\002\001\001" +
- "\000\002\001\001\000\006\047\164\051\166\001\001\000" +
- "\002\001\001\000\002\001\001\000\002\001\001\000\002" +
- "\001\001\000\002\001\001\000\002\001\001\000\002\001" +
- "\001\000\002\001\001\000\002\001\001\000\002\001\001" +
- "\000\002\001\001\000\002\001\001\000\002\001\001\000" +
- "\020\011\155\026\136\033\106\034\147\047\153\052\100" +
- "\053\077\001\001\000\020\011\154\026\136\033\106\034" +
- "\147\047\153\052\100\053\077\001\001\000\002\001\001" +
- "\000\002\001\001\000\002\001\001\000\052\006\120\010" +
- "\127\011\117\020\163\021\125\022\073\023\121\024\143" +
- "\025\123\026\136\027\146\030\134\031\107\032\072\033" +
- "\106\034\147\047\150\050\116\052\100\053\077\001\001" +
- "\000\052\006\120\010\127\011\117\020\162\021\125\022" +
- "\073\023\121\024\143\025\123\026\136\027\146\030\134" +
- "\031\107\032\072\033\106\034\147\047\150\050\116\052" +
- "\100\053\077\001\001\000\052\006\120\010\127\011\117" +
- "\020\161\021\125\022\073\023\121\024\143\025\123\026" +
- "\136\027\146\030\134\031\107\032\072\033\106\034\147" +
- "\047\150\050\116\052\100\053\077\001\001\000\002\001" +
- "\001\000\002\001\001\000\002\001\001\000\002\001\001" +
- "\000\002\001\001\000\002\001\001\000\002\001\001\000" +
- "\002\001\001\000\024\011\117\026\136\027\174\030\134" +
- "\033\106\034\147\047\153\052\100\053\077\001\001\000" +
- "\024\011\117\026\136\027\173\030\134\033\106\034\147" +
- "\047\153\052\100\053\077\001\001\000\002\001\001\000" +
- "\002\001\001\000\050\006\120\010\127\011\117\021\125" +
- "\022\073\023\121\024\176\025\123\026\136\027\146\030" +
- "\134\031\107\032\072\033\106\034\147\047\150\050\116" +
- "\052\100\053\077\001\001\000\002\001\001\000\002\001" +
- "\001\000\074\004\203\005\202\006\120\010\127\011\117" +
- "\012\101\013\075\014\104\015\063\016\111\017\145\020" +
- "\113\021\125\022\073\023\121\024\143\025\123\026\136" +
- "\027\146\030\134\031\107\032\072\033\106\034\147\046" +
- "\204\047\150\050\116\052\100\053\077\001\001\000\002" +
- "\001\001\000\002\001\001\000\002\001\001\000\002\001" +
- "\001\000\002\001\001\000\074\004\203\005\202\006\120" +
- "\010\127\011\117\012\101\013\075\014\104\015\063\016" +
- "\111\017\145\020\113\021\125\022\073\023\121\024\143" +
- "\025\123\026\136\027\146\030\134\031\107\032\072\033" +
- "\106\034\147\046\207\047\150\050\116\052\100\053\077" +
- "\001\001\000\002\001\001\000\054\006\120\010\127\011" +
- "\117\017\213\020\113\021\125\022\073\023\121\024\143" +
- "\025\123\026\136\027\146\030\134\031\107\032\072\033" +
- "\106\034\147\047\150\050\116\052\100\053\077\001\001" +
- "\000\054\006\120\010\127\011\117\017\212\020\113\021" +
- "\125\022\073\023\121\024\143\025\123\026\136\027\146" +
- "\030\134\031\107\032\072\033\106\034\147\047\150\050" +
- "\116\052\100\053\077\001\001\000\002\001\001\000\002" +
- "\001\001\000\002\001\001\000\060\006\120\010\127\011" +
- "\117\015\230\016\111\017\145\020\113\021\125\022\073" +
- "\023\121\024\143\025\123\026\136\027\146\030\134\031" +
- "\107\032\072\033\106\034\147\047\150\050\116\052\100" +
- "\053\077\001\001\000\060\006\120\010\127\011\117\015" +
- "\217\016\111\017\145\020\113\021\125\022\073\023\121" +
- "\024\143\025\123\026\136\027\146\030\134\031\107\032" +
- "\072\033\106\034\147\047\150\050\116\052\100\053\077" +
- "\001\001\000\002\001\001\000\056\006\120\010\127\011" +
- "\117\016\227\017\145\020\113\021\125\022\073\023\121" +
- "\024\143\025\123\026\136\027\146\030\134\031\107\032" +
- "\072\033\106\034\147\047\150\050\116\052\100\053\077" +
- "\001\001\000\056\006\120\010\127\011\117\016\226\017" +
- "\145\020\113\021\125\022\073\023\121\024\143\025\123" +
- "\026\136\027\146\030\134\031\107\032\072\033\106\034" +
- "\147\047\150\050\116\052\100\053\077\001\001\000\056" +
- "\006\120\010\127\011\117\016\225\017\145\020\113\021" +
- "\125\022\073\023\121\024\143\025\123\026\136\027\146" +
- "\030\134\031\107\032\072\033\106\034\147\047\150\050" +
- "\116\052\100\053\077\001\001\000\056\006\120\010\127" +
- "\011\117\016\224\017\145\020\113\021\125\022\073\023" +
- "\121\024\143\025\123\026\136\027\146\030\134\031\107" +
- "\032\072\033\106\034\147\047\150\050\116\052\100\053" +
- "\077\001\001\000\002\001\001\000\002\001\001\000\002" +
- "\001\001\000\002\001\001\000\002\001\001\000\064\006" +
- "\120\010\127\011\117\013\232\014\104\015\063\016\111" +
- "\017\145\020\113\021\125\022\073\023\121\024\143\025" +
- "\123\026\136\027\146\030\134\031\107\032\072\033\106" +
- "\034\147\047\150\050\116\052\100\053\077\001\001\000" +
- "\002\001\001\000\062\006\120\010\127\011\117\014\234" +
- "\015\063\016\111\017\145\020\113\021\125\022\073\023" +
- "\121\024\143\025\123\026\136\027\146\030\134\031\107" +
- "\032\072\033\106\034\147\047\150\050\116\052\100\053" +
- "\077\001\001\000\002\001\001\000\002\001\001\000\006" +
- "\007\053\045\237\001\001\000\002\001\001\000\002\001" +
- "\001\000\002\001\001\000\002\001\001\000\002\001\001" +
- "\000\002\001\001\000\002\001\001\000\002\001\001\000" +
- "\002\001\001\000\002\001\001\000\002\001\001\000\002" +
- "\001\001\000\002\001\001\000\002\001\001\000\002\001" +
- "\001\000\002\001\001\000\002\001\001\000\002\001\001" +
- "\000\002\001\001\000\002\001\001\000\002\001\001\000" +
- "\020\040\031\041\267\042\023\043\052\044\010\047\051" +
- "\054\021\001\001\000\020\040\031\041\266\042\023\043" +
- "\052\044\010\047\051\054\021\001\001\000\002\001\001" +
- "\000\002\001\001\000\002\001\001\000\006\007\053\045" +
- "\274\001\001\000\006\007\053\045\273\001\001\000\002" +
- "\001\001\000\002\001\001\000\020\040\031\041\300\042" +
- "\023\043\052\044\010\047\051\054\021\001\001\000\020" +
- "\040\031\041\277\042\023\043\052\044\010\047\051\054" +
- "\021\001\001\000\002\001\001\000\002\001\001\000\002" +
- "\001\001\000\002\001\001\000\002\001\001\000\002\001" +
- "\001\000\026\035\016\036\306\037\006\040\031\041\025" +
- "\042\023\043\052\044\010\047\051\054\021\001\001\000" +
- "\002\001\001\000\002\001\001\000\002\001\001" });
-
- /** Access to <code>reduce_goto</code> table. */
- public short[][] reduce_table() {return _reduce_table;}
-
- /** Instance of action encapsulation class. */
- protected CUP$XPathParser$actions action_obj;
-
- /** Action encapsulation object initializer. */
- protected void init_actions()
- {
- action_obj = new CUP$XPathParser$actions(this);
- }
-
- /** Invoke a user supplied parse action. */
- public com.sun.java_cup.internal.runtime.Symbol do_action(
- int act_num,
- com.sun.java_cup.internal.runtime.lr_parser parser,
- java.util.Stack stack,
- int top)
- throws java.lang.Exception
- {
- /* call code in generated class */
- return action_obj.CUP$XPathParser$do_action(act_num, parser, stack, top);
- }
-
- /** Indicates start state. */
- public int start_state() {return 0;}
- /** Indicates start production. */
- public int start_production() {return 0;}
-
- /** <code>EOF</code> Symbol index. */
- public int EOF_sym() {return 0;}
-
- /** <code>error</code> Symbol index. */
- public int error_sym() {return 1;}
-
-
-
- /**
- * Used by function calls with no args.
- */
- static public final Vector EmptyArgs = new Vector(0);
-
- /**
- * Reference to non-existing variable.
- */
- static public final VariableRef DummyVarRef = null;
-
- /**
- * Reference to the Parser class.
- */
- private Parser _parser;
- private XSLTC _xsltc;
-
- /**
- * String representation of the expression being parsed.
- */
- private String _expression;
-
- /**
- * Line number where this expression/pattern was declared.
- */
- private int _lineNumber = 0;
-
- /**
- * Reference to the symbol table.
- */
- public SymbolTable _symbolTable;
-
- public XPathParser(Parser parser) {
- _parser = parser;
- _xsltc = parser.getXSLTC();
- _symbolTable = parser.getSymbolTable();
- }
-
- public int getLineNumber() {
- return _lineNumber;
- }
-
- public QName getQNameIgnoreDefaultNs(String name) {
- return _parser.getQNameIgnoreDefaultNs(name);
- }
-
- public QName getQName(String namespace, String prefix, String localname) {
- return _parser.getQName(namespace, prefix, localname);
- }
-
- public void setMultiDocument(boolean flag) {
- _xsltc.setMultiDocument(flag);
- }
-
- public void setCallsNodeset(boolean flag) {
- _xsltc.setCallsNodeset(flag);
- }
-
- public void setHasIdCall(boolean flag) {
- _xsltc.setHasIdCall(flag);
- }
-
-
- /**
- * This method is similar to findNodeType(int, Object) except that it
- * creates a StepPattern instead of just returning a node type. It also
- * differs in the way it handles "{uri}:*" and "{uri}:@*". The last two
- * patterns are expanded as "*[namespace-uri() = 'uri']" and
- * "@*[namespace-uri() = 'uri']", respectively. This expansion considerably
- * simplifies the grouping of patterns in the Mode class. For this
- * expansion to be correct, the priority of the pattern/template must be
- * set to -0.25 (when no other predicates are present).
- */
- public StepPattern createStepPattern(int axis, Object test, Vector predicates) {
- int nodeType;
-
- if (test == null) { // "*"
- nodeType = (axis == Axis.ATTRIBUTE) ? NodeTest.ATTRIBUTE :
- (axis == Axis.NAMESPACE) ? -1 : NodeTest.ELEMENT;
-
- return new StepPattern(axis, nodeType, predicates);
- }
- else if (test instanceof Integer) {
- nodeType = ((Integer) test).intValue();
-
- return new StepPattern(axis, nodeType, predicates);
- }
- else {
- QName name = (QName)test;
- boolean setPriority = false;
-
- if (axis == Axis.NAMESPACE) {
- nodeType = (name.toString().equals("*")) ? -1
- : _xsltc.registerNamespacePrefix(name);;
- }
- else {
- final String uri = name.getNamespace();
- final String local = name.getLocalPart();
- final QName namespace_uri =
- _parser.getQNameIgnoreDefaultNs("namespace-uri");
-
- // Expand {uri}:* to *[namespace-uri() = 'uri'] - same for @*
- if (uri != null && (local.equals("*") || local.equals("@*"))) {
- if (predicates == null) {
- predicates = new Vector(2);
- }
-
- // Priority is set by hand if no other predicates exist
- setPriority = (predicates.size() == 0);
-
- predicates.add(
- new Predicate(
- new EqualityExpr(Operators.EQ,
- new NamespaceUriCall(namespace_uri),
- new LiteralExpr(uri))));
- }
-
- if (local.equals("*")) {
- nodeType = (axis == Axis.ATTRIBUTE) ? NodeTest.ATTRIBUTE
- : NodeTest.ELEMENT;
- }
- else if (local.equals("@*")) {
- nodeType = NodeTest.ATTRIBUTE;
- }
- else {
- nodeType = (axis == Axis.ATTRIBUTE) ? _xsltc.registerAttribute(name)
- : _xsltc.registerElement(name);
- }
- }
-
- final StepPattern result = new StepPattern(axis, nodeType, predicates);
-
- // Set priority for case prefix:* and prefix:@* (no predicates)
- if (setPriority) {
- result.setPriority(-0.25);
- }
-
- return result;
- }
- }
-
- public int findNodeType(int axis, Object test) {
- if (test == null) { // *
- return (axis == Axis.ATTRIBUTE) ?
- NodeTest.ATTRIBUTE :
- (axis == Axis.NAMESPACE) ? -1 : NodeTest.ELEMENT;
- }
- else if (test instanceof Integer) {
- return ((Integer)test).intValue();
- }
- else {
- QName name = (QName)test;
-
- if (axis == Axis.NAMESPACE) {
- return (name.toString().equals("*")) ? -1
- : _xsltc.registerNamespacePrefix(name);
- }
-
- if (name.getNamespace() == null) {
- final String local = name.getLocalPart();
-
- if (local.equals("*")) {
- return (axis == Axis.ATTRIBUTE) ? NodeTest.ATTRIBUTE
- : NodeTest.ELEMENT;
- }
- else if (local.equals("@*")) {
- return NodeTest.ATTRIBUTE;
- }
- }
-
- return (axis == Axis.ATTRIBUTE) ? _xsltc.registerAttribute(name)
- : _xsltc.registerElement(name);
- }
- }
-
- /**
- * Parse the expression passed to the current scanner. If this
- * expression contains references to local variables and it will be
- * compiled in an external module (not in the main class) request
- * the current template to create a new variable stack frame.
- *
- * @param lineNumber Line where the current expression is defined.
- * @param external Set to <tt>true</tt> if this expression is
- * compiled in a separate module.
- *
- */
- public Symbol parse(String expression, int lineNumber) throws Exception {
- try {
- _expression = expression;
- _lineNumber = lineNumber;
- return super.parse();
- }
- catch (IllegalCharException e) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.ILLEGAL_CHAR_ERR,
- lineNumber, e.getMessage());
- _parser.reportError(Constants.FATAL, err);
- }
- return null;
- }
-
- /**
- * Lookup a variable or parameter in the symbol table given its name.
- *
- * @param name Name of the symbol being looked up.
- */
- final SyntaxTreeNode lookupName(QName name) {
- // Is it a local var or param ?
- final SyntaxTreeNode result = _parser.lookupVariable(name);
- if (result != null)
- return(result);
- else
- return(_symbolTable.lookupName(name));
- }
-
- public final void addError(ErrorMsg error) {
- _parser.reportError(Constants.ERROR, error);
- }
-
- public void report_error(String message, Object info) {
- final ErrorMsg err = new ErrorMsg(ErrorMsg.SYNTAX_ERR, _lineNumber,
- _expression);
- _parser.reportError(Constants.FATAL, err);
- }
-
- public void report_fatal_error(String message, Object info) {
- // empty
- }
-
- public RelativeLocationPath insertStep(Step step, RelativeLocationPath rlp) {
- if (rlp instanceof Step) {
- return new ParentLocationPath(step, (Step) rlp);
- }
- else if (rlp instanceof ParentLocationPath) {
- final ParentLocationPath plp = (ParentLocationPath) rlp;
- final RelativeLocationPath newrlp = insertStep(step, plp.getPath());
- return new ParentLocationPath(newrlp, plp.getStep());
- }
- else {
- addError(new ErrorMsg(ErrorMsg.INTERNAL_ERR, "XPathParser.insertStep"));
- return rlp;
- }
- }
-
- /**
- * Returns true if the axis applies to elements only. The axes
- * child, attribute, namespace, descendant result in non-empty
- * nodesets only if the context node is of type element.
- */
- public boolean isElementAxis(int axis) {
- return (axis == Axis.CHILD || axis == Axis.ATTRIBUTE ||
- axis == Axis.NAMESPACE || axis == Axis.DESCENDANT);
- }
-
-}
-
-/** Cup generated class to encapsulate user supplied action code.*/
-class CUP$XPathParser$actions {
- private final XPathParser parser;
-
- /** Constructor */
- CUP$XPathParser$actions(XPathParser parser) {
- this.parser = parser;
- }
-
- /** Method with the actual generated action code. */
- public final com.sun.java_cup.internal.runtime.Symbol CUP$XPathParser$do_action(
- int CUP$XPathParser$act_num,
- com.sun.java_cup.internal.runtime.lr_parser CUP$XPathParser$parser,
- java.util.Stack CUP$XPathParser$stack,
- int CUP$XPathParser$top)
- throws java.lang.Exception
- {
- /* Symbol object for return from actions */
- com.sun.java_cup.internal.runtime.Symbol CUP$XPathParser$result;
-
- /* select the action based on the action number */
- switch (CUP$XPathParser$act_num)
- {
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 140: // QName ::= ID
- {
- QName RESULT = null;
- RESULT = parser.getQNameIgnoreDefaultNs("id");
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(37/*QName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 139: // QName ::= SELF
- {
- QName RESULT = null;
- RESULT = parser.getQNameIgnoreDefaultNs("self");
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(37/*QName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 138: // QName ::= PRECEDINGSIBLING
- {
- QName RESULT = null;
- RESULT = parser.getQNameIgnoreDefaultNs("preceding-sibling");
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(37/*QName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 137: // QName ::= PRECEDING
- {
- QName RESULT = null;
- RESULT = parser.getQNameIgnoreDefaultNs("preceding");
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(37/*QName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 136: // QName ::= PARENT
- {
- QName RESULT = null;
- RESULT = parser.getQNameIgnoreDefaultNs("parent");
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(37/*QName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 135: // QName ::= NAMESPACE
- {
- QName RESULT = null;
- RESULT = parser.getQNameIgnoreDefaultNs("namespace");
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(37/*QName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 134: // QName ::= FOLLOWINGSIBLING
- {
- QName RESULT = null;
- RESULT = parser.getQNameIgnoreDefaultNs("following-sibling");
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(37/*QName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 133: // QName ::= FOLLOWING
- {
- QName RESULT = null;
- RESULT = parser.getQNameIgnoreDefaultNs("following");
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(37/*QName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 132: // QName ::= DESCENDANTORSELF
- {
- QName RESULT = null;
- RESULT = parser.getQNameIgnoreDefaultNs("decendant-or-self");
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(37/*QName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 131: // QName ::= DESCENDANT
- {
- QName RESULT = null;
- RESULT = parser.getQNameIgnoreDefaultNs("decendant");
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(37/*QName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 130: // QName ::= CHILD
- {
- QName RESULT = null;
- RESULT = parser.getQNameIgnoreDefaultNs("child");
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(37/*QName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 129: // QName ::= ATTRIBUTE
- {
- QName RESULT = null;
- RESULT = parser.getQNameIgnoreDefaultNs("attribute");
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(37/*QName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 128: // QName ::= ANCESTORORSELF
- {
- QName RESULT = null;
- RESULT = parser.getQNameIgnoreDefaultNs("ancestor-or-self");
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(37/*QName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 127: // QName ::= ANCESTOR
- {
- QName RESULT = null;
- RESULT = parser.getQNameIgnoreDefaultNs("child");
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(37/*QName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 126: // QName ::= KEY
- {
- QName RESULT = null;
- RESULT = parser.getQNameIgnoreDefaultNs("key");
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(37/*QName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 125: // QName ::= MOD
- {
- QName RESULT = null;
- RESULT = parser.getQNameIgnoreDefaultNs("mod");
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(37/*QName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 124: // QName ::= DIV
- {
- QName RESULT = null;
- RESULT = parser.getQNameIgnoreDefaultNs("div");
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(37/*QName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 123: // QName ::= QNAME
- {
- QName RESULT = null;
- int qnameleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int qnameright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- String qname = (String)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = parser.getQNameIgnoreDefaultNs(qname);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(37/*QName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 122: // NameTest ::= QName
- {
- Object RESULT = null;
- int qnleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int qnright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- QName qn = (QName)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = qn;
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(26/*NameTest*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 121: // NameTest ::= STAR
- {
- Object RESULT = null;
- RESULT = null;
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(26/*NameTest*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 120: // NodeTest ::= PI
- {
- Object RESULT = null;
- RESULT = new Integer(NodeTest.PI);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(25/*NodeTest*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 119: // NodeTest ::= PIPARAM LPAREN Literal RPAREN
- {
- Object RESULT = null;
- int lleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left;
- int lright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).right;
- String l = (String)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).value;
-
- QName name = parser.getQNameIgnoreDefaultNs("name");
- Expression exp = new EqualityExpr(Operators.EQ,
- new NameCall(name),
- new LiteralExpr(l));
- Vector predicates = new Vector();
- predicates.addElement(new Predicate(exp));
- RESULT = new Step(Axis.CHILD, NodeTest.PI, predicates);
-
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(25/*NodeTest*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-3)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 118: // NodeTest ::= COMMENT
- {
- Object RESULT = null;
- RESULT = new Integer(NodeTest.COMMENT);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(25/*NodeTest*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 117: // NodeTest ::= TEXT
- {
- Object RESULT = null;
- RESULT = new Integer(NodeTest.TEXT);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(25/*NodeTest*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 116: // NodeTest ::= NODE
- {
- Object RESULT = null;
- RESULT = new Integer(NodeTest.ANODE);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(25/*NodeTest*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 115: // NodeTest ::= NameTest
- {
- Object RESULT = null;
- int ntleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int ntright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Object nt = (Object)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = nt;
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(25/*NodeTest*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 114: // Argument ::= Expr
- {
- Expression RESULT = null;
- int exleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int exright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Expression ex = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = ex;
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(3/*Argument*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 113: // VariableName ::= QName
- {
- QName RESULT = null;
- int vnameleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int vnameright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- QName vname = (QName)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
-
- RESULT = vname;
-
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(39/*VariableName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 112: // FunctionName ::= QName
- {
- QName RESULT = null;
- int fnameleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int fnameright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- QName fname = (QName)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
-
- RESULT = fname;
-
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(38/*FunctionName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 111: // NonemptyArgumentList ::= Argument COMMA NonemptyArgumentList
- {
- Vector RESULT = null;
- int argleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
- int argright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
- Expression arg = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
- int arglleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int arglright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Vector argl = (Vector)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- argl.insertElementAt(arg, 0); RESULT = argl;
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(36/*NonemptyArgumentList*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 110: // NonemptyArgumentList ::= Argument
- {
- Vector RESULT = null;
- int argleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int argright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Expression arg = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
-
- Vector temp = new Vector();
- temp.addElement(arg);
- RESULT = temp;
-
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(36/*NonemptyArgumentList*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 109: // FunctionCall ::= FunctionName LPAREN NonemptyArgumentList RPAREN
- {
- Expression RESULT = null;
- int fnameleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-3)).left;
- int fnameright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-3)).right;
- QName fname = (QName)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-3)).value;
- int arglleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left;
- int arglright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).right;
- Vector argl = (Vector)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).value;
-
- if (fname == parser.getQNameIgnoreDefaultNs("concat")) {
- RESULT = new ConcatCall(fname, argl);
- }
- else if (fname == parser.getQNameIgnoreDefaultNs("number")) {
- RESULT = new NumberCall(fname, argl);
- }
- else if (fname == parser.getQNameIgnoreDefaultNs("document")) {
- parser.setMultiDocument(true);
- RESULT = new DocumentCall(fname, argl);
- }
- else if (fname == parser.getQNameIgnoreDefaultNs("string")) {
- RESULT = new StringCall(fname, argl);
- }
- else if (fname == parser.getQNameIgnoreDefaultNs("boolean")) {
- RESULT = new BooleanCall(fname, argl);
- }
- else if (fname == parser.getQNameIgnoreDefaultNs("name")) {
- RESULT = new NameCall(fname, argl);
- }
- else if (fname == parser.getQNameIgnoreDefaultNs("generate-id")) {
- RESULT = new GenerateIdCall(fname, argl);
- }
- else if (fname == parser.getQNameIgnoreDefaultNs("not")) {
- RESULT = new NotCall(fname, argl);
- }
- else if (fname == parser.getQNameIgnoreDefaultNs("format-number")) {
- RESULT = new FormatNumberCall(fname, argl);
- }
- else if (fname == parser.getQNameIgnoreDefaultNs("unparsed-entity-uri")) {
- RESULT = new UnparsedEntityUriCall(fname, argl);
- }
- else if (fname == parser.getQNameIgnoreDefaultNs("key")) {
- RESULT = new KeyCall(fname, argl);
- }
- else if (fname == parser.getQNameIgnoreDefaultNs("id")) {
- RESULT = new KeyCall(fname, argl);
- parser.setHasIdCall(true);
- }
- else if (fname == parser.getQNameIgnoreDefaultNs("ceiling")) {
- RESULT = new CeilingCall(fname, argl);
- }
- else if (fname == parser.getQNameIgnoreDefaultNs("round")) {
- RESULT = new RoundCall(fname, argl);
- }
- else if (fname == parser.getQNameIgnoreDefaultNs("floor")) {
- RESULT = new FloorCall(fname, argl);
- }
- else if (fname == parser.getQNameIgnoreDefaultNs("contains")) {
- RESULT = new ContainsCall(fname, argl);
- }
- else if (fname == parser.getQNameIgnoreDefaultNs("string-length")) {
- RESULT = new StringLengthCall(fname, argl);
- }
- else if (fname == parser.getQNameIgnoreDefaultNs("starts-with")) {
- RESULT = new StartsWithCall(fname, argl);
- }
- else if (fname == parser.getQNameIgnoreDefaultNs("function-available")) {
- RESULT = new FunctionAvailableCall(fname, argl);
- }
- else if (fname == parser.getQNameIgnoreDefaultNs("element-available")) {
- RESULT = new ElementAvailableCall(fname, argl);
- }
- else if (fname == parser.getQNameIgnoreDefaultNs("local-name")) {
- RESULT = new LocalNameCall(fname, argl);
- }
- else if (fname == parser.getQNameIgnoreDefaultNs("lang")) {
- RESULT = new LangCall(fname, argl);
- }
- else if (fname == parser.getQNameIgnoreDefaultNs("namespace-uri")) {
- RESULT = new NamespaceUriCall(fname, argl);
- }
- else if (fname == parser.getQName(Constants.TRANSLET_URI, "xsltc", "cast")) {
- RESULT = new CastCall(fname, argl);
- }
- // Special case for extension function nodeset()
- else if (fname.getLocalPart().equals("nodeset") || fname.getLocalPart().equals("node-set")) {
- parser.setCallsNodeset(true); // implies MultiDOM
- RESULT = new FunctionCall(fname, argl);
- }
- else {
- RESULT = new FunctionCall(fname, argl);
- }
-
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(16/*FunctionCall*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-3)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 108: // FunctionCall ::= FunctionName LPAREN RPAREN
- {
- Expression RESULT = null;
- int fnameleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
- int fnameright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
- QName fname = (QName)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
-
-
- if (fname == parser.getQNameIgnoreDefaultNs("current")) {
- RESULT = new CurrentCall(fname);
- }
- else if (fname == parser.getQNameIgnoreDefaultNs("number")) {
- RESULT = new NumberCall(fname, parser.EmptyArgs);
- }
- else if (fname == parser.getQNameIgnoreDefaultNs("string")) {
- RESULT = new StringCall(fname, parser.EmptyArgs);
- }
- else if (fname == parser.getQNameIgnoreDefaultNs("concat")) {
- RESULT = new ConcatCall(fname, parser.EmptyArgs);
- }
- else if (fname == parser.getQNameIgnoreDefaultNs("true")) {
- RESULT = new BooleanExpr(true);
- }
- else if (fname == parser.getQNameIgnoreDefaultNs("false")) {
- RESULT = new BooleanExpr(false);
- }
- else if (fname == parser.getQNameIgnoreDefaultNs("name")) {
- RESULT = new NameCall(fname);
- }
- else if (fname == parser.getQNameIgnoreDefaultNs("generate-id")) {
- RESULT = new GenerateIdCall(fname, parser.EmptyArgs);
- }
- else if (fname == parser.getQNameIgnoreDefaultNs("string-length")) {
- RESULT = new StringLengthCall(fname, parser.EmptyArgs);
- }
- else if (fname == parser.getQNameIgnoreDefaultNs("position")) {
- RESULT = new PositionCall(fname);
- }
- else if (fname == parser.getQNameIgnoreDefaultNs("last")) {
- RESULT = new LastCall(fname);
- }
- else if (fname == parser.getQNameIgnoreDefaultNs("local-name")) {
- RESULT = new LocalNameCall(fname);
- }
- else if (fname == parser.getQNameIgnoreDefaultNs("namespace-uri")) {
- RESULT = new NamespaceUriCall(fname);
- }
- else {
- RESULT = new FunctionCall(fname, parser.EmptyArgs);
- }
-
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(16/*FunctionCall*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 107: // VariableReference ::= DOLLAR VariableName
- {
- Expression RESULT = null;
- int varNameleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int varNameright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- QName varName = (QName)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
-
- // An empty qname prefix for a variable or parameter reference
- // should map to the null namespace and not the default URI.
- SyntaxTreeNode node = parser.lookupName(varName);
-
- if (node != null) {
- if (node instanceof Variable) {
- RESULT = new VariableRef((Variable)node);
- }
- else if (node instanceof Param) {
- RESULT = new ParameterRef((Param)node);
- }
- else {
- RESULT = new UnresolvedRef(varName);
- }
- }
-
- if (node == null) {
- RESULT = new UnresolvedRef(varName);
- }
-
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(15/*VariableReference*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 106: // PrimaryExpr ::= FunctionCall
- {
- Expression RESULT = null;
- int fcleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int fcright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Expression fc = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = fc;
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(17/*PrimaryExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 105: // PrimaryExpr ::= REAL
- {
- Expression RESULT = null;
- int numleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int numright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Double num = (Double)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = new RealExpr(num.doubleValue());
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(17/*PrimaryExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 104: // PrimaryExpr ::= INT
- {
- Expression RESULT = null;
- int numleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int numright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Long num = (Long)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
-
- long value = num.longValue();
- if (value < Integer.MIN_VALUE || value > Integer.MAX_VALUE) {
- RESULT = new RealExpr(value);
- }
- else {
- if (num.doubleValue() == -0)
- RESULT = new RealExpr(num.doubleValue());
- else if (num.intValue() == 0)
- RESULT = new IntExpr(num.intValue());
- else if (num.doubleValue() == 0.0)
- RESULT = new RealExpr(num.doubleValue());
- else
- RESULT = new IntExpr(num.intValue());
- }
-
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(17/*PrimaryExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 103: // PrimaryExpr ::= Literal
- {
- Expression RESULT = null;
- int stringleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int stringright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- String string = (String)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
-
- /*
- * If the string appears to have the syntax of a QName, store
- * namespace info in the literal expression. This is used for
- * element-available and function-available functions, among
- * others. Also, the default namespace must be ignored.
- */
- String namespace = null;
- final int index = string.lastIndexOf(':');
-
- if (index > 0) {
- final String prefix = string.substring(0, index);
- namespace = parser._symbolTable.lookupNamespace(prefix);
- }
- RESULT = (namespace == null) ? new LiteralExpr(string)
- : new LiteralExpr(string, namespace);
-
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(17/*PrimaryExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 102: // PrimaryExpr ::= LPAREN Expr RPAREN
- {
- Expression RESULT = null;
- int exleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left;
- int exright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).right;
- Expression ex = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).value;
- RESULT = ex;
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(17/*PrimaryExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 101: // PrimaryExpr ::= VariableReference
- {
- Expression RESULT = null;
- int vrleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int vrright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Expression vr = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = vr;
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(17/*PrimaryExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 100: // FilterExpr ::= PrimaryExpr Predicates
- {
- Expression RESULT = null;
- int primaryleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left;
- int primaryright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).right;
- Expression primary = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).value;
- int ppleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int ppright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Vector pp = (Vector)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = new FilterExpr(primary, pp);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(6/*FilterExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 99: // FilterExpr ::= PrimaryExpr
- {
- Expression RESULT = null;
- int primaryleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int primaryright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Expression primary = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = primary;
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(6/*FilterExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 98: // AbbreviatedStep ::= DDOT
- {
- Expression RESULT = null;
- RESULT = new Step(Axis.PARENT, NodeTest.ANODE, null);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(20/*AbbreviatedStep*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 97: // AbbreviatedStep ::= DOT
- {
- Expression RESULT = null;
- RESULT = new Step(Axis.SELF, NodeTest.ANODE, null);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(20/*AbbreviatedStep*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 96: // AxisName ::= SELF
- {
- Integer RESULT = null;
- RESULT = new Integer(Axis.SELF);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 95: // AxisName ::= PRECEDINGSIBLING
- {
- Integer RESULT = null;
- RESULT = new Integer(Axis.PRECEDINGSIBLING);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 94: // AxisName ::= PRECEDING
- {
- Integer RESULT = null;
- RESULT = new Integer(Axis.PRECEDING);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 93: // AxisName ::= PARENT
- {
- Integer RESULT = null;
- RESULT = new Integer(Axis.PARENT);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 92: // AxisName ::= NAMESPACE
- {
- Integer RESULT = null;
- RESULT = new Integer(Axis.NAMESPACE);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 91: // AxisName ::= FOLLOWINGSIBLING
- {
- Integer RESULT = null;
- RESULT = new Integer(Axis.FOLLOWINGSIBLING);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 90: // AxisName ::= FOLLOWING
- {
- Integer RESULT = null;
- RESULT = new Integer(Axis.FOLLOWING);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 89: // AxisName ::= DESCENDANTORSELF
- {
- Integer RESULT = null;
- RESULT = new Integer(Axis.DESCENDANTORSELF);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 88: // AxisName ::= DESCENDANT
- {
- Integer RESULT = null;
- RESULT = new Integer(Axis.DESCENDANT);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 87: // AxisName ::= CHILD
- {
- Integer RESULT = null;
- RESULT = new Integer(Axis.CHILD);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 86: // AxisName ::= ATTRIBUTE
- {
- Integer RESULT = null;
- RESULT = new Integer(Axis.ATTRIBUTE);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 85: // AxisName ::= ANCESTORORSELF
- {
- Integer RESULT = null;
- RESULT = new Integer(Axis.ANCESTORORSELF);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 84: // AxisName ::= ANCESTOR
- {
- Integer RESULT = null;
- RESULT = new Integer(Axis.ANCESTOR);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 83: // AxisSpecifier ::= ATSIGN
- {
- Integer RESULT = null;
- RESULT = new Integer(Axis.ATTRIBUTE);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(41/*AxisSpecifier*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 82: // AxisSpecifier ::= AxisName DCOLON
- {
- Integer RESULT = null;
- int anleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left;
- int anright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).right;
- Integer an = (Integer)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).value;
- RESULT = an;
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(41/*AxisSpecifier*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 81: // Step ::= AbbreviatedStep
- {
- Expression RESULT = null;
- int abbrevleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int abbrevright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Expression abbrev = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = abbrev;
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(7/*Step*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 80: // Step ::= AxisSpecifier NodeTest
- {
- Expression RESULT = null;
- int axisleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left;
- int axisright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).right;
- Integer axis = (Integer)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).value;
- int ntestleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int ntestright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Object ntest = (Object)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = new Step(axis.intValue(),
- parser.findNodeType(axis.intValue(), ntest),
- null);
-
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(7/*Step*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 79: // Step ::= AxisSpecifier NodeTest Predicates
- {
- Expression RESULT = null;
- int axisleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
- int axisright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
- Integer axis = (Integer)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
- int ntestleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left;
- int ntestright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).right;
- Object ntest = (Object)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).value;
- int ppleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int ppright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Vector pp = (Vector)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = new Step(axis.intValue(),
- parser.findNodeType(axis.intValue(), ntest),
- pp);
-
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(7/*Step*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 78: // Step ::= NodeTest Predicates
- {
- Expression RESULT = null;
- int ntestleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left;
- int ntestright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).right;
- Object ntest = (Object)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).value;
- int ppleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int ppright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Vector pp = (Vector)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
-
- if (ntest instanceof Step) {
- Step step = (Step)ntest;
- step.addPredicates(pp);
- RESULT = (Step)ntest;
- }
- else {
- RESULT = new Step(Axis.CHILD,
- parser.findNodeType(Axis.CHILD, ntest), pp);
- }
-
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(7/*Step*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 77: // Step ::= NodeTest
- {
- Expression RESULT = null;
- int ntestleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int ntestright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Object ntest = (Object)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
-
- if (ntest instanceof Step) {
- RESULT = (Step)ntest;
- }
- else {
- RESULT = new Step(Axis.CHILD,
- parser.findNodeType(Axis.CHILD, ntest),
- null);
- }
-
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(7/*Step*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 76: // AbbreviatedAbsoluteLocationPath ::= DSLASH RelativeLocationPath
- {
- Expression RESULT = null;
- int rlpleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int rlpright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Expression rlp = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
-
- //
- // Expand '//' into '/descendant-or-self::node()/' or
- // into /descendant-or-self::*/
- //
- int nodeType = DOM.NO_TYPE;
- if (rlp instanceof Step &&
- parser.isElementAxis(((Step) rlp).getAxis()))
- {
- nodeType = DTM.ELEMENT_NODE;
- }
- final Step step = new Step(Axis.DESCENDANTORSELF, nodeType, null);
- RESULT = new AbsoluteLocationPath(parser.insertStep(step,
- (RelativeLocationPath) rlp));
-
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(24/*AbbreviatedAbsoluteLocationPath*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 75: // AbbreviatedRelativeLocationPath ::= RelativeLocationPath DSLASH Step
- {
- Expression RESULT = null;
- int rlpleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
- int rlpright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
- Expression rlp = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
- int stepleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int stepright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Expression step = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
-
- final Step right = (Step)step;
- final int axis = right.getAxis();
- final int type = right.getNodeType();
- final Vector predicates = right.getPredicates();
-
- if ((axis == Axis.CHILD) && (type != NodeTest.ATTRIBUTE)) {
- // Compress './/child:E' into 'descendant::E' - if possible
- if (predicates == null) {
- right.setAxis(Axis.DESCENDANT);
- if (rlp instanceof Step && ((Step)rlp).isAbbreviatedDot()) {
- RESULT = right;
- }
- else {
- // Expand 'rlp//child::E' into 'rlp/descendant::E'
- RelativeLocationPath left = (RelativeLocationPath)rlp;
- RESULT = new ParentLocationPath(left, right);
- }
- }
- else {
- // Expand './/step' -> 'descendant-or-self::*/step'
- if (rlp instanceof Step && ((Step)rlp).isAbbreviatedDot()) {
- Step left = new Step(Axis.DESCENDANTORSELF,
- DTM.ELEMENT_NODE, null);
- RESULT = new ParentLocationPath(left, right);
- }
- else {
- // Expand 'rlp//step' -> 'rlp/descendant-or-self::*/step'
- RelativeLocationPath left = (RelativeLocationPath)rlp;
- Step mid = new Step(Axis.DESCENDANTORSELF,
- DTM.ELEMENT_NODE, null);
- ParentLocationPath ppl = new ParentLocationPath(mid, right);
- RESULT = new ParentLocationPath(left, ppl);
- }
- }
- }
- else if ((axis == Axis.ATTRIBUTE) || (type == NodeTest.ATTRIBUTE)) {
- // Expand 'rlp//step' -> 'rlp/descendant-or-self::*/step'
- RelativeLocationPath left = (RelativeLocationPath)rlp;
- Step middle = new Step(Axis.DESCENDANTORSELF,
- DTM.ELEMENT_NODE, null);
- ParentLocationPath ppl = new ParentLocationPath(middle, right);
- RESULT = new ParentLocationPath(left, ppl);
- }
- else {
- // Expand 'rlp//step' -> 'rlp/descendant-or-self::node()/step'
- RelativeLocationPath left = (RelativeLocationPath)rlp;
- Step middle = new Step(Axis.DESCENDANTORSELF,
- DOM.NO_TYPE, null);
- ParentLocationPath ppl = new ParentLocationPath(middle, right);
- RESULT = new ParentLocationPath(left, ppl);
- }
-
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(22/*AbbreviatedRelativeLocationPath*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 74: // AbsoluteLocationPath ::= AbbreviatedAbsoluteLocationPath
- {
- Expression RESULT = null;
- int aalpleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int aalpright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Expression aalp = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = aalp;
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(23/*AbsoluteLocationPath*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 73: // AbsoluteLocationPath ::= SLASH RelativeLocationPath
- {
- Expression RESULT = null;
- int rlpleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int rlpright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Expression rlp = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = new AbsoluteLocationPath(rlp);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(23/*AbsoluteLocationPath*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 72: // AbsoluteLocationPath ::= SLASH
- {
- Expression RESULT = null;
- RESULT = new AbsoluteLocationPath();
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(23/*AbsoluteLocationPath*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 71: // RelativeLocationPath ::= AbbreviatedRelativeLocationPath
- {
- Expression RESULT = null;
- int arlpleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int arlpright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Expression arlp = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = arlp;
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(21/*RelativeLocationPath*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 70: // RelativeLocationPath ::= RelativeLocationPath SLASH Step
- {
- Expression RESULT = null;
- int rlpleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
- int rlpright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
- Expression rlp = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
- int stepleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int stepright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Expression step = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
-
- if (rlp instanceof Step && ((Step) rlp).isAbbreviatedDot()) {
- RESULT = step; // Remove './' from the middle
- }
- else if (((Step) step).isAbbreviatedDot()) {
- RESULT = rlp; // Remove '/.' from the end
- }
- else {
- RESULT =
- new ParentLocationPath((RelativeLocationPath) rlp, step);
- }
-
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(21/*RelativeLocationPath*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 69: // RelativeLocationPath ::= Step
- {
- Expression RESULT = null;
- int stepleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int stepright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Expression step = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = step;
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(21/*RelativeLocationPath*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 68: // LocationPath ::= AbsoluteLocationPath
- {
- Expression RESULT = null;
- int alpleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int alpright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Expression alp = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = alp;
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(4/*LocationPath*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 67: // LocationPath ::= RelativeLocationPath
- {
- Expression RESULT = null;
- int rlpleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int rlpright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Expression rlp = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = rlp;
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(4/*LocationPath*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 66: // PathExpr ::= FilterExpr DSLASH RelativeLocationPath
- {
- Expression RESULT = null;
- int fexpleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
- int fexpright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
- Expression fexp = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
- int rlpleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int rlpright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Expression rlp = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
-
- //
- // Expand '//' into '/descendant-or-self::node()/' or
- // into /descendant-or-self::*/
- //
- int nodeType = DOM.NO_TYPE;
- if (rlp instanceof Step &&
- parser.isElementAxis(((Step) rlp).getAxis()))
- {
- nodeType = DTM.ELEMENT_NODE;
- }
- final Step step = new Step(Axis.DESCENDANTORSELF, nodeType, null);
- FilterParentPath fpp = new FilterParentPath(fexp, step);
- fpp = new FilterParentPath(fpp, rlp);
- if (fexp instanceof KeyCall == false) {
- fpp.setDescendantAxis();
- }
- RESULT = fpp;
-
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(19/*PathExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 65: // PathExpr ::= FilterExpr SLASH RelativeLocationPath
- {
- Expression RESULT = null;
- int fexpleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
- int fexpright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
- Expression fexp = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
- int rlpleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int rlpright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Expression rlp = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = new FilterParentPath(fexp, rlp);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(19/*PathExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 64: // PathExpr ::= FilterExpr
- {
- Expression RESULT = null;
- int fexpleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int fexpright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Expression fexp = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = fexp;
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(19/*PathExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 63: // PathExpr ::= LocationPath
- {
- Expression RESULT = null;
- int lpleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int lpright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Expression lp = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = lp;
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(19/*PathExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 62: // UnionExpr ::= PathExpr VBAR UnionExpr
- {
- Expression RESULT = null;
- int peleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
- int peright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
- Expression pe = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
- int restleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int restright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Expression rest = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = new UnionPathExpr(pe, rest);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(18/*UnionExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 61: // UnionExpr ::= PathExpr
- {
- Expression RESULT = null;
- int peleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int peright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Expression pe = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = pe;
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(18/*UnionExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 60: // UnaryExpr ::= MINUS UnaryExpr
- {
- Expression RESULT = null;
- int ueleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int ueright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Expression ue = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = new UnaryOpExpr(ue);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(14/*UnaryExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 59: // UnaryExpr ::= UnionExpr
- {
- Expression RESULT = null;
- int ueleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int ueright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Expression ue = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = ue;
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(14/*UnaryExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 58: // MultiplicativeExpr ::= MultiplicativeExpr MOD UnaryExpr
- {
- Expression RESULT = null;
- int meleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
- int meright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
- Expression me = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
- int ueleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int ueright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Expression ue = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = new BinOpExpr(BinOpExpr.MOD, me, ue);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(13/*MultiplicativeExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 57: // MultiplicativeExpr ::= MultiplicativeExpr DIV UnaryExpr
- {
- Expression RESULT = null;
- int meleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
- int meright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
- Expression me = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
- int ueleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int ueright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Expression ue = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = new BinOpExpr(BinOpExpr.DIV, me, ue);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(13/*MultiplicativeExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 56: // MultiplicativeExpr ::= MultiplicativeExpr STAR UnaryExpr
- {
- Expression RESULT = null;
- int meleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
- int meright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
- Expression me = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
- int ueleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int ueright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Expression ue = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = new BinOpExpr(BinOpExpr.TIMES, me, ue);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(13/*MultiplicativeExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 55: // MultiplicativeExpr ::= UnaryExpr
- {
- Expression RESULT = null;
- int ueleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int ueright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Expression ue = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = ue;
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(13/*MultiplicativeExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 54: // AdditiveExpr ::= AdditiveExpr MINUS MultiplicativeExpr
- {
- Expression RESULT = null;
- int aeleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
- int aeright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
- Expression ae = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
- int meleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int meright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Expression me = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = new BinOpExpr(BinOpExpr.MINUS, ae, me);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(12/*AdditiveExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 53: // AdditiveExpr ::= AdditiveExpr PLUS MultiplicativeExpr
- {
- Expression RESULT = null;
- int aeleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
- int aeright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
- Expression ae = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
- int meleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int meright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Expression me = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = new BinOpExpr(BinOpExpr.PLUS, ae, me);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(12/*AdditiveExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 52: // AdditiveExpr ::= MultiplicativeExpr
- {
- Expression RESULT = null;
- int meleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int meright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Expression me = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = me;
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(12/*AdditiveExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 51: // RelationalExpr ::= RelationalExpr GE AdditiveExpr
- {
- Expression RESULT = null;
- int releft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
- int reright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
- Expression re = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
- int aeleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int aeright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Expression ae = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = new RelationalExpr(Operators.GE, re, ae);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(11/*RelationalExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 50: // RelationalExpr ::= RelationalExpr LE AdditiveExpr
- {
- Expression RESULT = null;
- int releft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
- int reright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
- Expression re = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
- int aeleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int aeright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Expression ae = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = new RelationalExpr(Operators.LE, re, ae);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(11/*RelationalExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 49: // RelationalExpr ::= RelationalExpr GT AdditiveExpr
- {
- Expression RESULT = null;
- int releft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
- int reright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
- Expression re = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
- int aeleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int aeright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Expression ae = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = new RelationalExpr(Operators.GT, re, ae);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(11/*RelationalExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 48: // RelationalExpr ::= RelationalExpr LT AdditiveExpr
- {
- Expression RESULT = null;
- int releft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
- int reright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
- Expression re = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
- int aeleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int aeright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Expression ae = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = new RelationalExpr(Operators.LT, re, ae);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(11/*RelationalExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 47: // RelationalExpr ::= AdditiveExpr
- {
- Expression RESULT = null;
- int aeleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int aeright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Expression ae = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = ae;
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(11/*RelationalExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 46: // EqualityExpr ::= EqualityExpr NE RelationalExpr
- {
- Expression RESULT = null;
- int eeleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
- int eeright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
- Expression ee = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
- int releft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int reright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Expression re = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = new EqualityExpr(Operators.NE, ee, re);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(10/*EqualityExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 45: // EqualityExpr ::= EqualityExpr EQ RelationalExpr
- {
- Expression RESULT = null;
- int eeleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
- int eeright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
- Expression ee = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
- int releft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int reright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Expression re = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = new EqualityExpr(Operators.EQ, ee, re);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(10/*EqualityExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 44: // EqualityExpr ::= RelationalExpr
- {
- Expression RESULT = null;
- int releft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int reright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Expression re = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = re;
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(10/*EqualityExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 43: // AndExpr ::= AndExpr AND EqualityExpr
- {
- Expression RESULT = null;
- int aeleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
- int aeright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
- Expression ae = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
- int eeleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int eeright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Expression ee = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = new LogicalExpr(LogicalExpr.AND, ae, ee);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(9/*AndExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 42: // AndExpr ::= EqualityExpr
- {
- Expression RESULT = null;
- int eleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int eright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Expression e = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = e;
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(9/*AndExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 41: // OrExpr ::= OrExpr OR AndExpr
- {
- Expression RESULT = null;
- int oeleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
- int oeright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
- Expression oe = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
- int aeleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int aeright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Expression ae = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = new LogicalExpr(LogicalExpr.OR, oe, ae);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(8/*OrExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 40: // OrExpr ::= AndExpr
- {
- Expression RESULT = null;
- int aeleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int aeright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Expression ae = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = ae;
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(8/*OrExpr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 39: // Expr ::= OrExpr
- {
- Expression RESULT = null;
- int exleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int exright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Expression ex = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = ex;
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(2/*Expr*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 38: // Predicate ::= LBRACK Expr RBRACK
- {
- Expression RESULT = null;
- int eleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left;
- int eright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).right;
- Expression e = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).value;
-
- RESULT = new Predicate(e);
-
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(5/*Predicate*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 37: // Predicates ::= Predicate Predicates
- {
- Vector RESULT = null;
- int pleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left;
- int pright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).right;
- Expression p = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).value;
- int ppleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int ppright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Vector pp = (Vector)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- pp.insertElementAt(p, 0); RESULT = pp;
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(35/*Predicates*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 36: // Predicates ::= Predicate
- {
- Vector RESULT = null;
- int pleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int pright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Expression p = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
-
- Vector temp = new Vector();
- temp.addElement(p);
- RESULT = temp;
-
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(35/*Predicates*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 35: // ChildOrAttributeAxisSpecifier ::= ATTRIBUTE DCOLON
- {
- Integer RESULT = null;
- RESULT = new Integer(Axis.ATTRIBUTE);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(42/*ChildOrAttributeAxisSpecifier*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 34: // ChildOrAttributeAxisSpecifier ::= CHILD DCOLON
- {
- Integer RESULT = null;
- RESULT = new Integer(Axis.CHILD);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(42/*ChildOrAttributeAxisSpecifier*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 33: // ChildOrAttributeAxisSpecifier ::= ATSIGN
- {
- Integer RESULT = null;
- RESULT = new Integer(Axis.ATTRIBUTE);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(42/*ChildOrAttributeAxisSpecifier*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 32: // NameTestPattern ::= QName
- {
- Object RESULT = null;
- int qnleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int qnright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- QName qn = (QName)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = qn;
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(34/*NameTestPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 31: // NameTestPattern ::= STAR
- {
- Object RESULT = null;
- RESULT = null;
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(34/*NameTestPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 30: // NodeTestPattern ::= PI
- {
- Object RESULT = null;
- RESULT = new Integer(NodeTest.PI);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(33/*NodeTestPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 29: // NodeTestPattern ::= COMMENT
- {
- Object RESULT = null;
- RESULT = new Integer(NodeTest.COMMENT);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(33/*NodeTestPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 28: // NodeTestPattern ::= TEXT
- {
- Object RESULT = null;
- RESULT = new Integer(NodeTest.TEXT);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(33/*NodeTestPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 27: // NodeTestPattern ::= NODE
- {
- Object RESULT = null;
- RESULT = new Integer(NodeTest.ANODE);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(33/*NodeTestPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 26: // NodeTestPattern ::= NameTestPattern
- {
- Object RESULT = null;
- int ntleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int ntright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Object nt = (Object)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = nt;
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(33/*NodeTestPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 25: // StepPattern ::= ChildOrAttributeAxisSpecifier ProcessingInstructionPattern Predicates
- {
- StepPattern RESULT = null;
- int axisleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
- int axisright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
- Integer axis = (Integer)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
- int pipleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left;
- int pipright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).right;
- StepPattern pip = (StepPattern)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).value;
- int ppleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int ppright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Vector pp = (Vector)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
-
- // TODO: report error if axis is attribute
- RESULT = (ProcessingInstructionPattern)pip.setPredicates(pp);
-
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(32/*StepPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 24: // StepPattern ::= ChildOrAttributeAxisSpecifier ProcessingInstructionPattern
- {
- StepPattern RESULT = null;
- int axisleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left;
- int axisright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).right;
- Integer axis = (Integer)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).value;
- int pipleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int pipright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- StepPattern pip = (StepPattern)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
-
- RESULT = pip; // TODO: report error if axis is attribute
-
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(32/*StepPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 23: // StepPattern ::= ChildOrAttributeAxisSpecifier NodeTestPattern Predicates
- {
- StepPattern RESULT = null;
- int axisleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
- int axisright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
- Integer axis = (Integer)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
- int ntleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left;
- int ntright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).right;
- Object nt = (Object)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).value;
- int ppleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int ppright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Vector pp = (Vector)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
-
- RESULT = parser.createStepPattern(axis.intValue(), nt, pp);
-
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(32/*StepPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 22: // StepPattern ::= ChildOrAttributeAxisSpecifier NodeTestPattern
- {
- StepPattern RESULT = null;
- int axisleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left;
- int axisright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).right;
- Integer axis = (Integer)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).value;
- int ntleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int ntright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Object nt = (Object)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
-
- RESULT = parser.createStepPattern(axis.intValue(), nt, null);
-
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(32/*StepPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 21: // StepPattern ::= ProcessingInstructionPattern Predicates
- {
- StepPattern RESULT = null;
- int pipleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left;
- int pipright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).right;
- StepPattern pip = (StepPattern)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).value;
- int ppleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int ppright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Vector pp = (Vector)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = (ProcessingInstructionPattern)pip.setPredicates(pp);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(32/*StepPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 20: // StepPattern ::= ProcessingInstructionPattern
- {
- StepPattern RESULT = null;
- int pipleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int pipright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- StepPattern pip = (StepPattern)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = pip;
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(32/*StepPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 19: // StepPattern ::= NodeTestPattern Predicates
- {
- StepPattern RESULT = null;
- int ntleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left;
- int ntright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).right;
- Object nt = (Object)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).value;
- int ppleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int ppright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Vector pp = (Vector)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
-
- RESULT = parser.createStepPattern(Axis.CHILD, nt, pp);
-
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(32/*StepPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 18: // StepPattern ::= NodeTestPattern
- {
- StepPattern RESULT = null;
- int ntleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int ntright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Object nt = (Object)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
-
- RESULT = parser.createStepPattern(Axis.CHILD, nt, null);
-
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(32/*StepPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 17: // RelativePathPattern ::= StepPattern DSLASH RelativePathPattern
- {
- RelativePathPattern RESULT = null;
- int spleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
- int spright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
- StepPattern sp = (StepPattern)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
- int rppleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int rppright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- RelativePathPattern rpp = (RelativePathPattern)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = new AncestorPattern(sp, rpp);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(31/*RelativePathPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 16: // RelativePathPattern ::= StepPattern SLASH RelativePathPattern
- {
- RelativePathPattern RESULT = null;
- int spleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
- int spright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
- StepPattern sp = (StepPattern)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
- int rppleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int rppright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- RelativePathPattern rpp = (RelativePathPattern)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = new ParentPattern(sp, rpp);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(31/*RelativePathPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 15: // RelativePathPattern ::= StepPattern
- {
- RelativePathPattern RESULT = null;
- int spleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int spright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- StepPattern sp = (StepPattern)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = sp;
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(31/*RelativePathPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 14: // ProcessingInstructionPattern ::= PIPARAM LPAREN Literal RPAREN
- {
- StepPattern RESULT = null;
- int lleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left;
- int lright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).right;
- String l = (String)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).value;
- RESULT = new ProcessingInstructionPattern(l);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(30/*ProcessingInstructionPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-3)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 13: // IdKeyPattern ::= KEY LPAREN Literal COMMA Literal RPAREN
- {
- IdKeyPattern RESULT = null;
- int l1left = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-3)).left;
- int l1right = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-3)).right;
- String l1 = (String)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-3)).value;
- int l2left = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left;
- int l2right = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).right;
- String l2 = (String)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).value;
- RESULT = new KeyPattern(l1, l2);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(27/*IdKeyPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-5)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 12: // IdKeyPattern ::= ID LPAREN Literal RPAREN
- {
- IdKeyPattern RESULT = null;
- int lleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left;
- int lright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).right;
- String l = (String)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).value;
- RESULT = new IdPattern(l);
- parser.setHasIdCall(true);
-
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(27/*IdKeyPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-3)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 11: // LocationPathPattern ::= RelativePathPattern
- {
- Pattern RESULT = null;
- int rppleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int rppright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- RelativePathPattern rpp = (RelativePathPattern)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = rpp;
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(29/*LocationPathPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 10: // LocationPathPattern ::= DSLASH RelativePathPattern
- {
- Pattern RESULT = null;
- int rppleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int rppright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- RelativePathPattern rpp = (RelativePathPattern)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = new AncestorPattern(rpp);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(29/*LocationPathPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 9: // LocationPathPattern ::= IdKeyPattern DSLASH RelativePathPattern
- {
- Pattern RESULT = null;
- int ikpleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
- int ikpright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
- IdKeyPattern ikp = (IdKeyPattern)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
- int rppleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int rppright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- RelativePathPattern rpp = (RelativePathPattern)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = new AncestorPattern(ikp, rpp);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(29/*LocationPathPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 8: // LocationPathPattern ::= IdKeyPattern SLASH RelativePathPattern
- {
- Pattern RESULT = null;
- int ikpleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
- int ikpright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
- IdKeyPattern ikp = (IdKeyPattern)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
- int rppleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int rppright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- RelativePathPattern rpp = (RelativePathPattern)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = new ParentPattern(ikp, rpp);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(29/*LocationPathPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 7: // LocationPathPattern ::= IdKeyPattern
- {
- Pattern RESULT = null;
- int ikpleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int ikpright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- IdKeyPattern ikp = (IdKeyPattern)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = ikp;
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(29/*LocationPathPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 6: // LocationPathPattern ::= SLASH RelativePathPattern
- {
- Pattern RESULT = null;
- int rppleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int rppright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- RelativePathPattern rpp = (RelativePathPattern)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = new AbsolutePathPattern(rpp);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(29/*LocationPathPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 5: // LocationPathPattern ::= SLASH
- {
- Pattern RESULT = null;
- RESULT = new AbsolutePathPattern(null);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(29/*LocationPathPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 4: // Pattern ::= LocationPathPattern VBAR Pattern
- {
- Pattern RESULT = null;
- int lppleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left;
- int lppright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).right;
- Pattern lpp = (Pattern)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).value;
- int pleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int pright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Pattern p = (Pattern)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = new AlternativePattern(lpp, p);
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(28/*Pattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 3: // Pattern ::= LocationPathPattern
- {
- Pattern RESULT = null;
- int lppleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int lppright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Pattern lpp = (Pattern)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = lpp;
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(28/*Pattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 2: // TopLevel ::= EXPRESSION Expr
- {
- SyntaxTreeNode RESULT = null;
- int exprleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int exprright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Expression expr = (Expression)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = expr;
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(1/*TopLevel*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 1: // TopLevel ::= PATTERN Pattern
- {
- SyntaxTreeNode RESULT = null;
- int patternleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left;
- int patternright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right;
- Pattern pattern = (Pattern)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value;
- RESULT = pattern;
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(1/*TopLevel*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- return CUP$XPathParser$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 0: // $START ::= TopLevel EOF
- {
- Object RESULT = null;
- int start_valleft = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left;
- int start_valright = ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).right;
- SyntaxTreeNode start_val = (SyntaxTreeNode)((com.sun.java_cup.internal.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).value;
- RESULT = start_val;
- CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(0/*$START*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
- }
- /* ACCEPT */
- CUP$XPathParser$parser.done_parsing();
- return CUP$XPathParser$result;
-
- /* . . . . . .*/
- default:
- throw new Exception(
- "Invalid action number found in internal parse table");
-
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XSLTC.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XSLTC.java
deleted file mode 100644
index 631edbd..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XSLTC.java
+++ /dev/null
@@ -1,1032 +0,0 @@
-/*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.classfile.JavaClass;
-import com.sun.org.apache.xalan.internal.XalanConstants;
-import com.sun.org.apache.xalan.internal.utils.FeatureManager;
-import com.sun.org.apache.xalan.internal.utils.FeatureManager.Feature;
-import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
-import com.sun.org.apache.xalan.internal.utils.XMLSecurityManager;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import java.io.BufferedOutputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Date;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Vector;
-import java.util.jar.JarEntry;
-import java.util.jar.JarOutputStream;
-import java.util.jar.Manifest;
-import javax.xml.XMLConstants;
-import org.xml.sax.InputSource;
-import org.xml.sax.XMLReader;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author G. Todd Miller
- * @author Morten Jorgensen
- * @author John Howard (johnh@schemasoft.com)
- */
-public final class XSLTC {
-
- // A reference to the main stylesheet parser object.
- private Parser _parser;
-
- // A reference to an external XMLReader (SAX parser) passed to us
- private XMLReader _reader = null;
-
- // A reference to an external SourceLoader (for use with include/import)
- private SourceLoader _loader = null;
-
- // A reference to the stylesheet being compiled.
- private Stylesheet _stylesheet;
-
- // Counters used by various classes to generate unique names.
- // private int _variableSerial = 1;
- private int _modeSerial = 1;
- private int _stylesheetSerial = 1;
- private int _stepPatternSerial = 1;
- private int _helperClassSerial = 0;
- private int _attributeSetSerial = 0;
-
- private int[] _numberFieldIndexes;
-
- // Name index tables
- private int _nextGType; // Next available element type
- private Vector _namesIndex; // Index of all registered QNames
- private Map<String, Integer> _elements; // Map of all registered elements
- private Map<String, Integer> _attributes; // Map of all registered attributes
-
- // Namespace index tables
- private int _nextNSType; // Next available namespace type
- private Vector _namespaceIndex; // Index of all registered namespaces
- private Map<String, Integer> _namespaces; // Map of all registered namespaces
- private Map<String, Integer> _namespacePrefixes;// Map of all registered namespace prefixes
-
-
- // All literal text in the stylesheet
- private Vector m_characterData;
-
- // These define the various methods for outputting the translet
- public static final int FILE_OUTPUT = 0;
- public static final int JAR_OUTPUT = 1;
- public static final int BYTEARRAY_OUTPUT = 2;
- public static final int CLASSLOADER_OUTPUT = 3;
- public static final int BYTEARRAY_AND_FILE_OUTPUT = 4;
- public static final int BYTEARRAY_AND_JAR_OUTPUT = 5;
-
-
- // Compiler options (passed from command line or XSLTC client)
- private boolean _debug = false; // -x
- private String _jarFileName = null; // -j <jar-file-name>
- private String _className = null; // -o <class-name>
- private String _packageName = null; // -p <package-name>
- private File _destDir = null; // -d <directory-name>
- private int _outputType = FILE_OUTPUT; // by default
-
- private Vector _classes;
- private Vector _bcelClasses;
- private boolean _callsNodeset = false;
- private boolean _multiDocument = false;
- private boolean _hasIdCall = false;
-
- /**
- * Set to true if template inlining is requested. Template
- * inlining used to be the default, but we have found that
- * Hotspots does a better job with shorter methods, so the
- * default is *not* to inline now.
- */
- private boolean _templateInlining = false;
-
- /**
- * State of the secure processing feature.
- */
- private boolean _isSecureProcessing = false;
-
- private boolean _useServicesMechanism = true;
-
- /**
- * protocols allowed for external references set by the stylesheet processing instruction, Import and Include element.
- */
- private String _accessExternalStylesheet = XalanConstants.EXTERNAL_ACCESS_DEFAULT;
- /**
- * protocols allowed for external DTD references in source file and/or stylesheet.
- */
- private String _accessExternalDTD = XalanConstants.EXTERNAL_ACCESS_DEFAULT;
-
- private XMLSecurityManager _xmlSecurityManager;
-
- private final FeatureManager _featureManager;
-
- /**
- * Extension function class loader variables
- */
-
- /* Class loader reference that will be used for external extension functions loading */
- private ClassLoader _extensionClassLoader;
-
- /**
- * HashMap with the loaded classes
- */
- private final Map<String, Class> _externalExtensionFunctions;
-
- /**
- * XSLTC compiler constructor
- */
- public XSLTC(boolean useServicesMechanism, FeatureManager featureManager) {
- _parser = new Parser(this, useServicesMechanism);
- _featureManager = featureManager;
- _extensionClassLoader = null;
- _externalExtensionFunctions = new HashMap<>();
- }
-
- /**
- * Set the state of the secure processing feature.
- */
- public void setSecureProcessing(boolean flag) {
- _isSecureProcessing = flag;
- }
-
- /**
- * Return the state of the secure processing feature.
- */
- public boolean isSecureProcessing() {
- return _isSecureProcessing;
- }
- /**
- * Return the state of the services mechanism feature.
- */
- public boolean useServicesMechnism() {
- return _useServicesMechanism;
- }
-
- /**
- * Set the state of the services mechanism feature.
- */
- public void setServicesMechnism(boolean flag) {
- _useServicesMechanism = flag;
- }
-
- /**
- * Return the value of the specified feature
- * @param name name of the feature
- * @return true if the feature is enabled, false otherwise
- */
- public boolean getFeature(Feature name) {
- return _featureManager.isFeatureEnabled(name);
- }
-
- /**
- * Return allowed protocols for accessing external stylesheet.
- */
- public Object getProperty(String name) {
- if (name.equals(XMLConstants.ACCESS_EXTERNAL_STYLESHEET)) {
- return _accessExternalStylesheet;
- }
- else if (name.equals(XMLConstants.ACCESS_EXTERNAL_DTD)) {
- return _accessExternalDTD;
- } else if (name.equals(XalanConstants.SECURITY_MANAGER)) {
- return _xmlSecurityManager;
- } else if (name.equals(XalanConstants.JDK_EXTENSION_CLASSLOADER)) {
- return _extensionClassLoader;
- }
- return null;
- }
-
- /**
- * Set allowed protocols for accessing external stylesheet.
- */
- public void setProperty(String name, Object value) {
- if (name.equals(XMLConstants.ACCESS_EXTERNAL_STYLESHEET)) {
- _accessExternalStylesheet = (String)value;
- }
- else if (name.equals(XMLConstants.ACCESS_EXTERNAL_DTD)) {
- _accessExternalDTD = (String)value;
- } else if (name.equals(XalanConstants.SECURITY_MANAGER)) {
- _xmlSecurityManager = (XMLSecurityManager)value;
- } else if (name.equals(XalanConstants.JDK_EXTENSION_CLASSLOADER)) {
- _extensionClassLoader = (ClassLoader) value;
- /* Clear the external extension functions HashMap if extension class
- loader was changed */
- _externalExtensionFunctions.clear();
- }
- }
-
- /**
- * Only for user by the internal TrAX implementation.
- */
- public Parser getParser() {
- return _parser;
- }
-
- /**
- * Only for user by the internal TrAX implementation.
- */
- public void setOutputType(int type) {
- _outputType = type;
- }
-
- /**
- * Only for user by the internal TrAX implementation.
- */
- public Properties getOutputProperties() {
- return _parser.getOutputProperties();
- }
-
- /**
- * Initializes the compiler to compile a new stylesheet
- */
- public void init() {
- reset();
- _reader = null;
- _classes = new Vector();
- _bcelClasses = new Vector();
- }
-
- private void setExternalExtensionFunctions(String name, Class clazz) {
- if (_isSecureProcessing && clazz != null && !_externalExtensionFunctions.containsKey(name)) {
- _externalExtensionFunctions.put(name, clazz);
- }
- }
-
- /*
- * Function loads an external extension function.
- * The filtering of function types (external,internal) takes place in FunctionCall class
- *
- */
- Class loadExternalFunction(String name) throws ClassNotFoundException {
- Class loaded = null;
- //Check if the function is not loaded already
- if (_externalExtensionFunctions.containsKey(name)) {
- loaded = _externalExtensionFunctions.get(name);
- } else if (_extensionClassLoader != null) {
- loaded = Class.forName(name, true, _extensionClassLoader);
- setExternalExtensionFunctions(name, loaded);
- }
- if (loaded == null) {
- throw new ClassNotFoundException(name);
- }
- //Return loaded class
- return (Class) loaded;
- }
-
- /*
- * Returns unmodifiable view of HashMap with loaded external extension
- * functions - will be needed for the TransformerImpl
- */
- public Map<String, Class> getExternalExtensionFunctions() {
- return Collections.unmodifiableMap(_externalExtensionFunctions);
- }
-
- /**
- * Initializes the compiler to produce a new translet
- */
- private void reset() {
- _nextGType = DTM.NTYPES;
- _elements = new HashMap<>();
- _attributes = new HashMap<>();
- _namespaces = new HashMap<>();
- _namespaces.put("",new Integer(_nextNSType));
- _namesIndex = new Vector(128);
- _namespaceIndex = new Vector(32);
- _namespacePrefixes = new HashMap<>();
- _stylesheet = null;
- _parser.init();
- //_variableSerial = 1;
- _modeSerial = 1;
- _stylesheetSerial = 1;
- _stepPatternSerial = 1;
- _helperClassSerial = 0;
- _attributeSetSerial = 0;
- _multiDocument = false;
- _hasIdCall = false;
- _numberFieldIndexes = new int[] {
- -1, // LEVEL_SINGLE
- -1, // LEVEL_MULTIPLE
- -1 // LEVEL_ANY
- };
- _externalExtensionFunctions.clear();
- }
-
- /**
- * Defines an external SourceLoader to provide the compiler with documents
- * referenced in xsl:include/import
- * @param loader The SourceLoader to use for include/import
- */
- public void setSourceLoader(SourceLoader loader) {
- _loader = loader;
- }
-
- /**
- * Set a flag indicating if templates are to be inlined or not. The
- * default is to do inlining, but this causes problems when the
- * stylesheets have a large number of templates (e.g. branch targets
- * exceeding 64K or a length of a method exceeding 64K).
- */
- public void setTemplateInlining(boolean templateInlining) {
- _templateInlining = templateInlining;
- }
- /**
- * Return the state of the template inlining feature.
- */
- public boolean getTemplateInlining() {
- return _templateInlining;
- }
-
- /**
- * Set the parameters to use to locate the correct <?xml-stylesheet ...?>
- * processing instruction in the case where the input document to the
- * compiler (and parser) is an XML document.
- * @param media The media attribute to be matched. May be null, in which
- * case the prefered templates will be used (i.e. alternate = no).
- * @param title The value of the title attribute to match. May be null.
- * @param charset The value of the charset attribute to match. May be null.
- */
- public void setPIParameters(String media, String title, String charset) {
- _parser.setPIParameters(media, title, charset);
- }
-
- /**
- * Compiles an XSL stylesheet pointed to by a URL
- * @param url An URL containing the input XSL stylesheet
- */
- public boolean compile(URL url) {
- try {
- // Open input stream from URL and wrap inside InputSource
- final InputStream stream = url.openStream();
- final InputSource input = new InputSource(stream);
- input.setSystemId(url.toString());
- return compile(input, _className);
- }
- catch (IOException e) {
- _parser.reportError(Constants.FATAL, new ErrorMsg(ErrorMsg.JAXP_COMPILE_ERR, e));
- return false;
- }
- }
-
- /**
- * Compiles an XSL stylesheet pointed to by a URL
- * @param url An URL containing the input XSL stylesheet
- * @param name The name to assign to the translet class
- */
- public boolean compile(URL url, String name) {
- try {
- // Open input stream from URL and wrap inside InputSource
- final InputStream stream = url.openStream();
- final InputSource input = new InputSource(stream);
- input.setSystemId(url.toString());
- return compile(input, name);
- }
- catch (IOException e) {
- _parser.reportError(Constants.FATAL, new ErrorMsg(ErrorMsg.JAXP_COMPILE_ERR, e));
- return false;
- }
- }
-
- /**
- * Compiles an XSL stylesheet passed in through an InputStream
- * @param stream An InputStream that will pass in the stylesheet contents
- * @param name The name of the translet class to generate
- * @return 'true' if the compilation was successful
- */
- public boolean compile(InputStream stream, String name) {
- final InputSource input = new InputSource(stream);
- input.setSystemId(name); // We have nothing else!!!
- return compile(input, name);
- }
-
- /**
- * Compiles an XSL stylesheet passed in through an InputStream
- * @param input An InputSource that will pass in the stylesheet contents
- * @param name The name of the translet class to generate - can be null
- * @return 'true' if the compilation was successful
- */
- public boolean compile(InputSource input, String name) {
- try {
- // Reset globals in case we're called by compile(Vector v);
- reset();
-
- // The systemId may not be set, so we'll have to check the URL
- String systemId = null;
- if (input != null) {
- systemId = input.getSystemId();
- }
-
- // Set the translet class name if not already set
- if (_className == null) {
- if (name != null) {
- setClassName(name);
- }
- else if (systemId != null && !systemId.equals("")) {
- setClassName(Util.baseName(systemId));
- }
-
- // Ensure we have a non-empty class name at this point
- if (_className == null || _className.length() == 0) {
- setClassName("GregorSamsa"); // default translet name
- }
- }
-
- // Get the root node of the abstract syntax tree
- SyntaxTreeNode element = null;
- if (_reader == null) {
- element = _parser.parse(input);
- }
- else {
- element = _parser.parse(_reader, input);
- }
-
- // Compile the translet - this is where the work is done!
- if ((!_parser.errorsFound()) && (element != null)) {
- // Create a Stylesheet element from the root node
- _stylesheet = _parser.makeStylesheet(element);
- _stylesheet.setSourceLoader(_loader);
- _stylesheet.setSystemId(systemId);
- _stylesheet.setParentStylesheet(null);
- _stylesheet.setTemplateInlining(_templateInlining);
- _parser.setCurrentStylesheet(_stylesheet);
-
- // Create AST under the Stylesheet element (parse & type-check)
- _parser.createAST(_stylesheet);
- }
- // Generate the bytecodes and output the translet class(es)
- if ((!_parser.errorsFound()) && (_stylesheet != null)) {
- _stylesheet.setCallsNodeset(_callsNodeset);
- _stylesheet.setMultiDocument(_multiDocument);
- _stylesheet.setHasIdCall(_hasIdCall);
-
- // Class synchronization is needed for BCEL
- synchronized (getClass()) {
- _stylesheet.translate();
- }
- }
- }
- catch (Exception e) {
- /*if (_debug)*/ e.printStackTrace();
- _parser.reportError(Constants.FATAL, new ErrorMsg(ErrorMsg.JAXP_COMPILE_ERR, e));
- }
- catch (Error e) {
- if (_debug) e.printStackTrace();
- _parser.reportError(Constants.FATAL, new ErrorMsg(ErrorMsg.JAXP_COMPILE_ERR, e));
- }
- finally {
- _reader = null; // reset this here to be sure it is not re-used
- }
- return !_parser.errorsFound();
- }
-
- /**
- * Compiles a set of stylesheets pointed to by a Vector of URLs
- * @param stylesheets A Vector containing URLs pointing to the stylesheets
- * @return 'true' if the compilation was successful
- */
- public boolean compile(Vector stylesheets) {
- // Get the number of stylesheets (ie. URLs) in the vector
- final int count = stylesheets.size();
-
- // Return straight away if the vector is empty
- if (count == 0) return true;
-
- // Special handling needed if the URL count is one, becuase the
- // _className global must not be reset if it was set explicitly
- if (count == 1) {
- final Object url = stylesheets.firstElement();
- if (url instanceof URL)
- return compile((URL)url);
- else
- return false;
- }
- else {
- // Traverse all elements in the vector and compile
- final Enumeration urls = stylesheets.elements();
- while (urls.hasMoreElements()) {
- _className = null; // reset, so that new name will be computed
- final Object url = urls.nextElement();
- if (url instanceof URL) {
- if (!compile((URL)url)) return false;
- }
- }
- }
- return true;
- }
-
- /**
- * Returns an array of bytecode arrays generated by a compilation.
- * @return JVM bytecodes that represent translet class definition
- */
- public byte[][] getBytecodes() {
- final int count = _classes.size();
- final byte[][] result = new byte[count][1];
- for (int i = 0; i < count; i++)
- result[i] = (byte[])_classes.elementAt(i);
- return result;
- }
-
- /**
- * Compiles a stylesheet pointed to by a URL. The result is put in a
- * set of byte arrays. One byte array for each generated class.
- * @param name The name of the translet class to generate
- * @param input An InputSource that will pass in the stylesheet contents
- * @param outputType The output type
- * @return JVM bytecodes that represent translet class definition
- */
- public byte[][] compile(String name, InputSource input, int outputType) {
- _outputType = outputType;
- if (compile(input, name))
- return getBytecodes();
- else
- return null;
- }
-
- /**
- * Compiles a stylesheet pointed to by a URL. The result is put in a
- * set of byte arrays. One byte array for each generated class.
- * @param name The name of the translet class to generate
- * @param input An InputSource that will pass in the stylesheet contents
- * @return JVM bytecodes that represent translet class definition
- */
- public byte[][] compile(String name, InputSource input) {
- return compile(name, input, BYTEARRAY_OUTPUT);
- }
-
- /**
- * Set the XMLReader to use for parsing the next input stylesheet
- * @param reader XMLReader (SAX2 parser) to use
- */
- public void setXMLReader(XMLReader reader) {
- _reader = reader;
- }
-
- /**
- * Get the XMLReader to use for parsing the next input stylesheet
- */
- public XMLReader getXMLReader() {
- return _reader ;
- }
-
- /**
- * Get a list of all compile error messages
- * @return A List containing all compile error messages
- */
- public ArrayList<ErrorMsg> getErrors() {
- return _parser.getErrors();
- }
-
- /**
- * Get a list of all compile warning messages
- * @return A List containing all compile error messages
- */
- public ArrayList<ErrorMsg> getWarnings() {
- return _parser.getWarnings();
- }
-
- /**
- * Print all compile error messages to standard output
- */
- public void printErrors() {
- _parser.printErrors();
- }
-
- /**
- * Print all compile warning messages to standard output
- */
- public void printWarnings() {
- _parser.printWarnings();
- }
-
- /**
- * This method is called by the XPathParser when it encounters a call
- * to the document() function. Affects the DOM used by the translet.
- */
- protected void setMultiDocument(boolean flag) {
- _multiDocument = flag;
- }
-
- public boolean isMultiDocument() {
- return _multiDocument;
- }
-
- /**
- * This method is called by the XPathParser when it encounters a call
- * to the nodeset() extension function. Implies multi document.
- */
- protected void setCallsNodeset(boolean flag) {
- if (flag) setMultiDocument(flag);
- _callsNodeset = flag;
- }
-
- public boolean callsNodeset() {
- return _callsNodeset;
- }
-
- protected void setHasIdCall(boolean flag) {
- _hasIdCall = flag;
- }
-
- public boolean hasIdCall() {
- return _hasIdCall;
- }
-
- /**
- * Set the class name for the generated translet. This class name is
- * overridden if multiple stylesheets are compiled in one go using the
- * compile(Vector urls) method.
- * @param className The name to assign to the translet class
- */
- public void setClassName(String className) {
- final String base = Util.baseName(className);
- final String noext = Util.noExtName(base);
- String name = Util.toJavaName(noext);
-
- if (_packageName == null)
- _className = name;
- else
- _className = _packageName + '.' + name;
- }
-
- /**
- * Get the class name for the generated translet.
- */
- public String getClassName() {
- return _className;
- }
-
- /**
- * Convert for Java class name of local system file name.
- * (Replace '.' with '/' on UNIX and replace '.' by '\' on Windows/DOS.)
- */
- private String classFileName(final String className) {
- return className.replace('.', File.separatorChar) + ".class";
- }
-
- /**
- * Generate an output File object to send the translet to
- */
- private File getOutputFile(String className) {
- if (_destDir != null)
- return new File(_destDir, classFileName(className));
- else
- return new File(classFileName(className));
- }
-
- /**
- * Set the destination directory for the translet.
- * The current working directory will be used by default.
- */
- public boolean setDestDirectory(String dstDirName) {
- final File dir = new File(dstDirName);
- if (SecuritySupport.getFileExists(dir) || dir.mkdirs()) {
- _destDir = dir;
- return true;
- }
- else {
- _destDir = null;
- return false;
- }
- }
-
- /**
- * Set an optional package name for the translet and auxiliary classes
- */
- public void setPackageName(String packageName) {
- _packageName = packageName;
- if (_className != null) setClassName(_className);
- }
-
- /**
- * Set the name of an optional JAR-file to dump the translet and
- * auxiliary classes to
- */
- public void setJarFileName(String jarFileName) {
- final String JAR_EXT = ".jar";
- if (jarFileName.endsWith(JAR_EXT))
- _jarFileName = jarFileName;
- else
- _jarFileName = jarFileName + JAR_EXT;
- _outputType = JAR_OUTPUT;
- }
-
- public String getJarFileName() {
- return _jarFileName;
- }
-
- /**
- * Set the top-level stylesheet
- */
- public void setStylesheet(Stylesheet stylesheet) {
- if (_stylesheet == null) _stylesheet = stylesheet;
- }
-
- /**
- * Returns the top-level stylesheet
- */
- public Stylesheet getStylesheet() {
- return _stylesheet;
- }
-
- /**
- * Registers an attribute and gives it a type so that it can be mapped to
- * DOM attribute types at run-time.
- */
- public int registerAttribute(QName name) {
- Integer code = _attributes.get(name.toString());
- if (code == null) {
- code = _nextGType++;
- _attributes.put(name.toString(), code);
- final String uri = name.getNamespace();
- final String local = "@"+name.getLocalPart();
- if ((uri != null) && (!uri.equals("")))
- _namesIndex.addElement(uri+":"+local);
- else
- _namesIndex.addElement(local);
- if (name.getLocalPart().equals("*")) {
- registerNamespace(name.getNamespace());
- }
- }
- return code.intValue();
- }
-
- /**
- * Registers an element and gives it a type so that it can be mapped to
- * DOM element types at run-time.
- */
- public int registerElement(QName name) {
- // Register element (full QName)
- Integer code = _elements.get(name.toString());
- if (code == null) {
- _elements.put(name.toString(), code = _nextGType++);
- _namesIndex.addElement(name.toString());
- }
- if (name.getLocalPart().equals("*")) {
- registerNamespace(name.getNamespace());
- }
- return code.intValue();
- }
-
- /**
- * Registers a namespace prefix and gives it a type so that it can be mapped to
- * DOM namespace types at run-time.
- */
-
- public int registerNamespacePrefix(QName name) {
-
- Integer code = _namespacePrefixes.get(name.toString());
- if (code == null) {
- code = _nextGType++;
- _namespacePrefixes.put(name.toString(), code);
- final String uri = name.getNamespace();
- if ((uri != null) && (!uri.equals(""))){
- // namespace::ext2:ped2 will be made empty in TypedNamespaceIterator
- _namesIndex.addElement("?");
- } else{
- _namesIndex.addElement("?"+name.getLocalPart());
- }
- }
- return code.intValue();
- }
-
- /**
- * Registers a namespace and gives it a type so that it can be mapped to
- * DOM namespace types at run-time.
- */
- public int registerNamespace(String namespaceURI) {
- Integer code = _namespaces.get(namespaceURI);
- if (code == null) {
- code = _nextNSType++;
- _namespaces.put(namespaceURI,code);
- _namespaceIndex.addElement(namespaceURI);
- }
- return code.intValue();
- }
-
- public int nextModeSerial() {
- return _modeSerial++;
- }
-
- public int nextStylesheetSerial() {
- return _stylesheetSerial++;
- }
-
- public int nextStepPatternSerial() {
- return _stepPatternSerial++;
- }
-
- public int[] getNumberFieldIndexes() {
- return _numberFieldIndexes;
- }
-
- public int nextHelperClassSerial() {
- return _helperClassSerial++;
- }
-
- public int nextAttributeSetSerial() {
- return _attributeSetSerial++;
- }
-
- public Vector getNamesIndex() {
- return _namesIndex;
- }
-
- public Vector getNamespaceIndex() {
- return _namespaceIndex;
- }
-
- /**
- * Returns a unique name for every helper class needed to
- * execute a translet.
- */
- public String getHelperClassName() {
- return getClassName() + '$' + _helperClassSerial++;
- }
-
- public void dumpClass(JavaClass clazz) {
-
- if (_outputType == FILE_OUTPUT ||
- _outputType == BYTEARRAY_AND_FILE_OUTPUT)
- {
- File outFile = getOutputFile(clazz.getClassName());
- String parentDir = outFile.getParent();
- if (parentDir != null) {
- File parentFile = new File(parentDir);
- if (!SecuritySupport.getFileExists(parentFile))
- parentFile.mkdirs();
- }
- }
-
- try {
- switch (_outputType) {
- case FILE_OUTPUT:
- clazz.dump(
- new BufferedOutputStream(
- new FileOutputStream(
- getOutputFile(clazz.getClassName()))));
- break;
- case JAR_OUTPUT:
- _bcelClasses.addElement(clazz);
- break;
- case BYTEARRAY_OUTPUT:
- case BYTEARRAY_AND_FILE_OUTPUT:
- case BYTEARRAY_AND_JAR_OUTPUT:
- case CLASSLOADER_OUTPUT:
- ByteArrayOutputStream out = new ByteArrayOutputStream(2048);
- clazz.dump(out);
- _classes.addElement(out.toByteArray());
-
- if (_outputType == BYTEARRAY_AND_FILE_OUTPUT)
- clazz.dump(new BufferedOutputStream(
- new FileOutputStream(getOutputFile(clazz.getClassName()))));
- else if (_outputType == BYTEARRAY_AND_JAR_OUTPUT)
- _bcelClasses.addElement(clazz);
-
- break;
- }
- }
- catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- /**
- * File separators are converted to forward slashes for ZIP files.
- */
- private String entryName(File f) throws IOException {
- return f.getName().replace(File.separatorChar, '/');
- }
-
- /**
- * Generate output JAR-file and packages
- */
- public void outputToJar() throws IOException {
- // create the manifest
- final Manifest manifest = new Manifest();
- final java.util.jar.Attributes atrs = manifest.getMainAttributes();
- atrs.put(java.util.jar.Attributes.Name.MANIFEST_VERSION,"1.2");
-
- final Map map = manifest.getEntries();
- // create manifest
- Enumeration classes = _bcelClasses.elements();
- final String now = (new Date()).toString();
- final java.util.jar.Attributes.Name dateAttr =
- new java.util.jar.Attributes.Name("Date");
- while (classes.hasMoreElements()) {
- final JavaClass clazz = (JavaClass)classes.nextElement();
- final String className = clazz.getClassName().replace('.','/');
- final java.util.jar.Attributes attr = new java.util.jar.Attributes();
- attr.put(dateAttr, now);
- map.put(className+".class", attr);
- }
-
- final File jarFile = new File(_destDir, _jarFileName);
- final JarOutputStream jos =
- new JarOutputStream(new FileOutputStream(jarFile), manifest);
- classes = _bcelClasses.elements();
- while (classes.hasMoreElements()) {
- final JavaClass clazz = (JavaClass)classes.nextElement();
- final String className = clazz.getClassName().replace('.','/');
- jos.putNextEntry(new JarEntry(className+".class"));
- final ByteArrayOutputStream out = new ByteArrayOutputStream(2048);
- clazz.dump(out); // dump() closes it's output stream
- out.writeTo(jos);
- }
- jos.close();
- }
-
- /**
- * Turn debugging messages on/off
- */
- public void setDebug(boolean debug) {
- _debug = debug;
- }
-
- /**
- * Get current debugging message setting
- */
- public boolean debug() {
- return _debug;
- }
-
-
- /**
- * Retrieve a string representation of the character data to be stored
- * in the translet as a <code>char[]</code>. There may be more than
- * one such array required.
- * @param index The index of the <code>char[]</code>. Zero-based.
- * @return String The character data to be stored in the corresponding
- * <code>char[]</code>.
- */
- public String getCharacterData(int index) {
- return ((StringBuffer) m_characterData.elementAt(index)).toString();
- }
-
- /**
- * Get the number of char[] arrays, thus far, that will be created to
- * store literal text in the stylesheet.
- */
- public int getCharacterDataCount() {
- return (m_characterData != null) ? m_characterData.size() : 0;
- }
-
- /**
- * Add literal text to char arrays that will be used to store character
- * data in the stylesheet.
- * @param newData String data to be added to char arrays.
- * Pre-condition: <code>newData.length() &le; 21845</code>
- * @return int offset at which character data will be stored
- */
- public int addCharacterData(String newData) {
- StringBuffer currData;
- if (m_characterData == null) {
- m_characterData = new Vector();
- currData = new StringBuffer();
- m_characterData.addElement(currData);
- } else {
- currData = (StringBuffer) m_characterData
- .elementAt(m_characterData.size()-1);
- }
-
- // Character data could take up to three-times as much space when
- // written to the class file as UTF-8. The maximum size for a
- // constant is 65535/3. If we exceed that,
- // (We really should use some "bin packing".)
- if (newData.length() + currData.length() > 21845) {
- currData = new StringBuffer();
- m_characterData.addElement(currData);
- }
-
- int newDataOffset = currData.length();
- currData.append(newData);
-
- return newDataOffset;
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XslAttribute.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XslAttribute.java
deleted file mode 100644
index c99129a..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XslAttribute.java
+++ /dev/null
@@ -1,293 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XslAttribute.java,v 1.2.4.1 2005/09/12 11:39:32 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.ALOAD;
-import com.sun.org.apache.bcel.internal.generic.ASTORE;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.GETFIELD;
-import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
-import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-import com.sun.org.apache.xml.internal.serializer.ElemDesc;
-import com.sun.org.apache.xml.internal.serializer.SerializationHandler;
-import com.sun.org.apache.xml.internal.utils.XML11Char;
-import java.util.List;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- * @author Erwin Bolwidt <ejb@klomp.org>
- * @author Gunnlaugur Briem <gthb@dimon.is>
- */
-final class XslAttribute extends Instruction {
-
- private String _prefix;
- private AttributeValue _name; // name treated as AVT (7.1.3)
- private AttributeValueTemplate _namespace = null;
- private boolean _ignore = false;
- private boolean _isLiteral = false; // specified name is not AVT
-
- /**
- * Returns the name of the attribute
- */
- public AttributeValue getName() {
- return _name;
- }
-
- /**
- * Displays the contents of the attribute
- */
- public void display(int indent) {
- indent(indent);
- Util.println("Attribute " + _name);
- displayContents(indent + IndentIncrement);
- }
-
- /**
- * Parses the attribute's contents. Special care taken for namespaces.
- */
- public void parseContents(Parser parser) {
- boolean generated = false;
- final SymbolTable stable = parser.getSymbolTable();
-
- String name = getAttribute("name");
- String namespace = getAttribute("namespace");
- QName qname = parser.getQName(name, false);
- final String prefix = qname.getPrefix();
-
- if (((prefix != null) && (prefix.equals(XMLNS_PREFIX)))||(name.equals(XMLNS_PREFIX))) {
- reportError(this, parser, ErrorMsg.ILLEGAL_ATTR_NAME_ERR, name);
- return;
- }
-
- _isLiteral = Util.isLiteral(name);
- if (_isLiteral) {
- if (!XML11Char.isXML11ValidQName(name)) {
- reportError(this, parser, ErrorMsg.ILLEGAL_ATTR_NAME_ERR, name);
- return;
- }
- }
-
- // Ignore attribute if preceeded by some other type of element
- final SyntaxTreeNode parent = getParent();
- final List<SyntaxTreeNode> siblings = parent.getContents();
- for (int i = 0; i < parent.elementCount(); i++) {
- SyntaxTreeNode item = siblings.get(i);
- if (item == this) break;
-
- // These three objects result in one or more attribute output
- if (item instanceof XslAttribute) continue;
- if (item instanceof UseAttributeSets) continue;
- if (item instanceof LiteralAttribute) continue;
- if (item instanceof Text) continue;
-
- // These objects _can_ result in one or more attribute
- // The output handler will generate an error if not (at runtime)
- if (item instanceof If) continue;
- if (item instanceof Choose) continue;
- if (item instanceof CopyOf) continue;
- if (item instanceof VariableBase) continue;
-
- // Report warning but do not ignore attribute
- reportWarning(this, parser, ErrorMsg.STRAY_ATTRIBUTE_ERR, name);
- }
-
- // Get namespace from namespace attribute?
- if (namespace != null && namespace != Constants.EMPTYSTRING) {
- _prefix = lookupPrefix(namespace);
- _namespace = new AttributeValueTemplate(namespace, parser, this);
- }
- // Get namespace from prefix in name attribute?
- else if (prefix != null && prefix != Constants.EMPTYSTRING) {
- _prefix = prefix;
- namespace = lookupNamespace(prefix);
- if (namespace != null) {
- _namespace = new AttributeValueTemplate(namespace, parser, this);
- }
- }
-
- // Common handling for namespaces:
- if (_namespace != null) {
- // Generate prefix if we have none
- if (_prefix == null || _prefix == Constants.EMPTYSTRING) {
- if (prefix != null) {
- _prefix = prefix;
- }
- else {
- _prefix = stable.generateNamespacePrefix();
- generated = true;
- }
- }
- else if (prefix != null && !prefix.equals(_prefix)) {
- _prefix = prefix;
- }
-
- name = _prefix + ":" + qname.getLocalPart();
-
- /*
- * TODO: The namespace URI must be passed to the parent
- * element but we don't yet know what the actual URI is
- * (as we only know it as an attribute value template).
- */
- if ((parent instanceof LiteralElement) && (!generated)) {
- ((LiteralElement)parent).registerNamespace(_prefix,
- namespace,
- stable, false);
- }
- }
-
- if (parent instanceof LiteralElement) {
- ((LiteralElement)parent).addAttribute(this);
- }
-
- _name = AttributeValue.create(this, name, parser);
- parseChildren(parser);
- }
-
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- if (!_ignore) {
- _name.typeCheck(stable);
- if (_namespace != null) {
- _namespace.typeCheck(stable);
- }
- typeCheckContents(stable);
- }
- return Type.Void;
- }
-
- /**
- *
- */
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- if (_ignore) return;
- _ignore = true;
-
- // Compile code that emits any needed namespace declaration
- if (_namespace != null) {
- // public void attribute(final String name, final String value)
- il.append(methodGen.loadHandler());
- il.append(new PUSH(cpg,_prefix));
- _namespace.translate(classGen,methodGen);
- il.append(methodGen.namespace());
- }
-
- if (!_isLiteral) {
- // if the qname is an AVT, then the qname has to be checked at runtime if it is a valid qname
- LocalVariableGen nameValue =
- methodGen.addLocalVariable2("nameValue",
- Util.getJCRefType(STRING_SIG),
- null);
-
- // store the name into a variable first so _name.translate only needs to be called once
- _name.translate(classGen, methodGen);
- nameValue.setStart(il.append(new ASTORE(nameValue.getIndex())));
- il.append(new ALOAD(nameValue.getIndex()));
-
- // call checkQName if the name is an AVT
- final int check = cpg.addMethodref(BASIS_LIBRARY_CLASS, "checkAttribQName",
- "("
- +STRING_SIG
- +")V");
- il.append(new INVOKESTATIC(check));
-
- // Save the current handler base on the stack
- il.append(methodGen.loadHandler());
- il.append(DUP); // first arg to "attributes" call
-
- // load name value again
- nameValue.setEnd(il.append(new ALOAD(nameValue.getIndex())));
- } else {
- // Save the current handler base on the stack
- il.append(methodGen.loadHandler());
- il.append(DUP); // first arg to "attributes" call
-
- // Push attribute name
- _name.translate(classGen, methodGen);// 2nd arg
-
- }
-
- // Push attribute value - shortcut for literal strings
- if ((elementCount() == 1) && (elementAt(0) instanceof Text)) {
- il.append(new PUSH(cpg, ((Text)elementAt(0)).getText()));
- }
- else {
- il.append(classGen.loadTranslet());
- il.append(new GETFIELD(cpg.addFieldref(TRANSLET_CLASS,
- "stringValueHandler",
- STRING_VALUE_HANDLER_SIG)));
- il.append(DUP);
- il.append(methodGen.storeHandler());
- // translate contents with substituted handler
- translateContents(classGen, methodGen);
- // get String out of the handler
- il.append(new INVOKEVIRTUAL(cpg.addMethodref(STRING_VALUE_HANDLER,
- "getValue",
- "()" + STRING_SIG)));
- }
-
- SyntaxTreeNode parent = getParent();
- if (parent instanceof LiteralElement
- && ((LiteralElement)parent).allAttributesUnique()) {
- int flags = 0;
- ElemDesc elemDesc = ((LiteralElement)parent).getElemDesc();
-
- // Set the HTML flags
- if (elemDesc != null && _name instanceof SimpleAttributeValue) {
- String attrName = ((SimpleAttributeValue)_name).toString();
- if (elemDesc.isAttrFlagSet(attrName, ElemDesc.ATTREMPTY)) {
- flags = flags | SerializationHandler.HTML_ATTREMPTY;
- }
- else if (elemDesc.isAttrFlagSet(attrName, ElemDesc.ATTRURL)) {
- flags = flags | SerializationHandler.HTML_ATTRURL;
- }
- }
- il.append(new PUSH(cpg, flags));
- il.append(methodGen.uniqueAttribute());
- }
- else {
- // call "attribute"
- il.append(methodGen.attribute());
- }
-
- // Restore old handler base from stack
- il.append(methodGen.storeHandler());
-
-
-
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XslElement.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XslElement.java
deleted file mode 100644
index e94ebb1..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XslElement.java
+++ /dev/null
@@ -1,281 +0,0 @@
-/*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.org.apache.bcel.internal.generic.ALOAD;
-import com.sun.org.apache.bcel.internal.generic.ASTORE;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-import com.sun.org.apache.xml.internal.utils.XML11Char;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- */
-final class XslElement extends Instruction {
-
- private String _prefix;
- private boolean _ignore = false;
- private boolean _isLiteralName = true;
- private AttributeValueTemplate _name;
- private AttributeValueTemplate _namespace;
-
- /**
- * Displays the contents of the element
- */
- public void display(int indent) {
- indent(indent);
- Util.println("Element " + _name);
- displayContents(indent + IndentIncrement);
- }
-
- public void parseContents(Parser parser) {
- final SymbolTable stable = parser.getSymbolTable();
-
- // Handle the 'name' attribute
- String name = getAttribute("name");
- if (name == EMPTYSTRING) {
- ErrorMsg msg = new ErrorMsg(ErrorMsg.ILLEGAL_ELEM_NAME_ERR,
- name, this);
- parser.reportError(WARNING, msg);
- parseChildren(parser);
- _ignore = true; // Ignore the element if the QName is invalid
- return;
- }
-
- // Get namespace attribute
- String namespace = getAttribute("namespace");
-
- // Optimize compilation when name is known at compile time
- _isLiteralName = Util.isLiteral(name);
- if (_isLiteralName) {
- if (!XML11Char.isXML11ValidQName(name)) {
- ErrorMsg msg = new ErrorMsg(ErrorMsg.ILLEGAL_ELEM_NAME_ERR,
- name, this);
- parser.reportError(WARNING, msg);
- parseChildren(parser);
- _ignore = true; // Ignore the element if the QName is invalid
- return;
- }
-
- final QName qname = parser.getQNameSafe(name);
- String prefix = qname.getPrefix();
- String local = qname.getLocalPart();
-
- if (prefix == null) {
- prefix = EMPTYSTRING;
- }
-
- if (!hasAttribute("namespace")) {
- namespace = lookupNamespace(prefix);
- if (namespace == null) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.NAMESPACE_UNDEF_ERR,
- prefix, this);
- parser.reportError(WARNING, err);
- parseChildren(parser);
- _ignore = true; // Ignore the element if prefix is undeclared
- return;
- }
- _prefix = prefix;
- _namespace = new AttributeValueTemplate(namespace, parser, this);
- }
- else {
- if (prefix == EMPTYSTRING) {
- if (Util.isLiteral(namespace)) {
- prefix = lookupPrefix(namespace);
- if (prefix == null) {
- prefix = stable.generateNamespacePrefix();
- }
- }
-
- // Prepend prefix to local name
- final StringBuffer newName = new StringBuffer(prefix);
- if (prefix != EMPTYSTRING) {
- newName.append(':');
- }
- name = newName.append(local).toString();
- }
- _prefix = prefix;
- _namespace = new AttributeValueTemplate(namespace, parser, this);
- }
- }
- else {
- _namespace = (namespace == EMPTYSTRING) ? null :
- new AttributeValueTemplate(namespace, parser, this);
- }
-
- _name = new AttributeValueTemplate(name, parser, this);
-
- final String useSets = getAttribute("use-attribute-sets");
- if (useSets.length() > 0) {
- if (!Util.isValidQNames(useSets)) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_QNAME_ERR, useSets, this);
- parser.reportError(Constants.ERROR, err);
- }
- setFirstElement(new UseAttributeSets(useSets, parser));
- }
-
- parseChildren(parser);
- }
-
- /**
- * Run type check on element name & contents
- */
- public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- if (!_ignore) {
- _name.typeCheck(stable);
- if (_namespace != null) {
- _namespace.typeCheck(stable);
- }
- }
- typeCheckContents(stable);
- return Type.Void;
- }
-
- /**
- * This method is called when the name of the element is known at compile time.
- * In this case, there is no need to inspect the element name at runtime to
- * determine if a prefix exists, needs to be generated, etc.
- */
- public void translateLiteral(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- if (!_ignore) {
- il.append(methodGen.loadHandler());
- _name.translate(classGen, methodGen);
- il.append(DUP2);
- il.append(methodGen.startElement());
-
- if (_namespace != null) {
- il.append(methodGen.loadHandler());
- il.append(new PUSH(cpg, _prefix));
- _namespace.translate(classGen,methodGen);
- il.append(methodGen.namespace());
- }
- }
-
- translateContents(classGen, methodGen);
-
- if (!_ignore) {
- il.append(methodGen.endElement());
- }
- }
-
- /**
- * At runtime the compilation of xsl:element results in code that: (i)
- * evaluates the avt for the name, (ii) checks for a prefix in the name
- * (iii) generates a new prefix and create a new qname when necessary
- * (iv) calls startElement() on the handler (v) looks up a uri in the XML
- * when the prefix is not known at compile time (vi) calls namespace()
- * on the handler (vii) evaluates the contents (viii) calls endElement().
- */
- public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- // Optimize translation if element name is a literal
- if (_isLiteralName) {
- translateLiteral(classGen, methodGen);
- return;
- }
-
- if (!_ignore) {
-
- // if the qname is an AVT, then the qname has to be checked at runtime if it is a valid qname
- LocalVariableGen nameValue =
- methodGen.addLocalVariable2("nameValue",
- Util.getJCRefType(STRING_SIG),
- null);
-
- // store the name into a variable first so _name.translate only needs to be called once
- _name.translate(classGen, methodGen);
- nameValue.setStart(il.append(new ASTORE(nameValue.getIndex())));
- il.append(new ALOAD(nameValue.getIndex()));
-
- // call checkQName if the name is an AVT
- final int check = cpg.addMethodref(BASIS_LIBRARY_CLASS, "checkQName",
- "("
- +STRING_SIG
- +")V");
- il.append(new INVOKESTATIC(check));
-
- // Push handler for call to endElement()
- il.append(methodGen.loadHandler());
-
- // load name value again
- nameValue.setEnd(il.append(new ALOAD(nameValue.getIndex())));
-
- if (_namespace != null) {
- _namespace.translate(classGen, methodGen);
- }
- else {
- il.append(ACONST_NULL);
- }
-
- // Push additional arguments
- il.append(methodGen.loadHandler());
- il.append(methodGen.loadDOM());
- il.append(methodGen.loadCurrentNode());
-
- // Invoke BasisLibrary.startXslElemCheckQName()
- il.append(new INVOKESTATIC(
- cpg.addMethodref(BASIS_LIBRARY_CLASS, "startXslElement",
- "(" + STRING_SIG
- + STRING_SIG
- + TRANSLET_OUTPUT_SIG
- + DOM_INTF_SIG + "I)" + STRING_SIG)));
-
-
- }
-
- translateContents(classGen, methodGen);
-
- if (!_ignore) {
- il.append(methodGen.endElement());
- }
- }
-
- /**
- * Override this method to make sure that xsl:attributes are not
- * copied to output if this xsl:element is to be ignored
- */
- public void translateContents(ClassGenerator classGen,
- MethodGenerator methodGen) {
- final int n = elementCount();
- for (int i = 0; i < n; i++) {
- final SyntaxTreeNode item = getContents().get(i);
- if (_ignore && item instanceof XslAttribute) continue;
- item.translate(classGen, methodGen);
- }
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/sym.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/sym.java
deleted file mode 100644
index d64dc3f..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/sym.java
+++ /dev/null
@@ -1,66 +0,0 @@
-
-//----------------------------------------------------
-// The following code was generated by CUP v0.10j
-// Fri Feb 27 13:01:50 PST 2004
-//----------------------------------------------------
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-/** CUP generated class containing symbol constants. */
-public class sym {
- /* terminals */
- public static final int Literal = 26;
- public static final int GE = 21;
- public static final int NAMESPACE = 48;
- public static final int SLASH = 2;
- public static final int PI = 35;
- public static final int COMMENT = 34;
- public static final int PIPARAM = 36;
- public static final int FOLLOWINGSIBLING = 47;
- public static final int ATSIGN = 12;
- public static final int DSLASH = 15;
- public static final int LPAREN = 7;
- public static final int EXPRESSION = 53;
- public static final int INT = 51;
- public static final int CHILD = 40;
- public static final int MINUS = 23;
- public static final int STAR = 9;
- public static final int DESCENDANTORSELF = 45;
- public static final int RPAREN = 8;
- public static final int AND = 33;
- public static final int LT = 18;
- public static final int OR = 32;
- public static final int COMMA = 10;
- public static final int DDOT = 13;
- public static final int DIV = 24;
- public static final int PLUS = 22;
- public static final int DOT = 3;
- public static final int ID = 28;
- public static final int LE = 20;
- public static final int QNAME = 27;
- public static final int DESCENDANT = 44;
- public static final int PRECEDINGSIBLING = 37;
- public static final int EOF = 0;
- public static final int error = 1;
- public static final int SELF = 38;
- public static final int VBAR = 6;
- public static final int MOD = 25;
- public static final int ANCESTORORSELF = 43;
- public static final int PRECEDING = 49;
- public static final int EQ = 16;
- public static final int PATTERN = 52;
- public static final int LBRACK = 4;
- public static final int REAL = 50;
- public static final int ANCESTOR = 42;
- public static final int RBRACK = 5;
- public static final int DCOLON = 14;
- public static final int DOLLAR = 11;
- public static final int NE = 17;
- public static final int PARENT = 39;
- public static final int FOLLOWING = 46;
- public static final int KEY = 29;
- public static final int TEXT = 30;
- public static final int ATTRIBUTE = 41;
- public static final int GT = 19;
- public static final int NODE = 31;
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/AttributeSetMethodGenerator.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/AttributeSetMethodGenerator.java
deleted file mode 100644
index 82af0b8..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/AttributeSetMethodGenerator.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: AttributeSetMethodGenerator.java,v 1.5 2005/09/28 13:48:24 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-
-import com.sun.org.apache.bcel.internal.generic.ALOAD;
-import com.sun.org.apache.bcel.internal.generic.ASTORE;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.Instruction;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.Type;
-
-/**
- * @author Santiago Pericas-Geertsen
- */
-public final class AttributeSetMethodGenerator extends MethodGenerator {
-
- protected static final int CURRENT_INDEX = 4;
- private static final int PARAM_START_INDEX = 5;
-
- private static final String[] argNames = new String[4];
- private static final com.sun.org.apache.bcel.internal.generic.Type[] argTypes =
- new com.sun.org.apache.bcel.internal.generic.Type[4];
-
- static {
- argTypes[0] = Util.getJCRefType(DOM_INTF_SIG);
- argTypes[1] = Util.getJCRefType(NODE_ITERATOR_SIG);
- argTypes[2] = Util.getJCRefType(TRANSLET_OUTPUT_SIG);
- argTypes[3] = com.sun.org.apache.bcel.internal.generic.Type.INT;
- argNames[0] = DOCUMENT_PNAME;
- argNames[1] = ITERATOR_PNAME;
- argNames[2] = TRANSLET_OUTPUT_PNAME;
- argNames[3] = NODE_PNAME;
- }
-
- public AttributeSetMethodGenerator(String methodName, ClassGenerator classGen) {
- super(com.sun.org.apache.bcel.internal.Constants.ACC_PRIVATE,
- com.sun.org.apache.bcel.internal.generic.Type.VOID,
- argTypes, argNames, methodName,
- classGen.getClassName(),
- new InstructionList(),
- classGen.getConstantPool());
- }
-
- public int getLocalIndex(String name) {
- if (name.equals("current")) {
- return CURRENT_INDEX;
- }
- return super.getLocalIndex(name);
- }
-
- public Instruction loadParameter(int index) {
- return new ALOAD(index + PARAM_START_INDEX);
- }
-
- public Instruction storeParameter(int index) {
- return new ASTORE(index + PARAM_START_INDEX);
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/BooleanType.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/BooleanType.java
deleted file mode 100644
index 1feca89..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/BooleanType.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: BooleanType.java,v 1.2.4.1 2005/09/05 11:03:37 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-
-import com.sun.org.apache.bcel.internal.generic.BranchHandle;
-import com.sun.org.apache.bcel.internal.generic.BranchInstruction;
-import com.sun.org.apache.bcel.internal.generic.CHECKCAST;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.GOTO;
-import com.sun.org.apache.bcel.internal.generic.IFEQ;
-import com.sun.org.apache.bcel.internal.generic.IFGE;
-import com.sun.org.apache.bcel.internal.generic.IFGT;
-import com.sun.org.apache.bcel.internal.generic.IFLE;
-import com.sun.org.apache.bcel.internal.generic.IFLT;
-import com.sun.org.apache.bcel.internal.generic.IF_ICMPGE;
-import com.sun.org.apache.bcel.internal.generic.IF_ICMPGT;
-import com.sun.org.apache.bcel.internal.generic.IF_ICMPLE;
-import com.sun.org.apache.bcel.internal.generic.IF_ICMPLT;
-import com.sun.org.apache.bcel.internal.generic.ILOAD;
-import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
-import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
-import com.sun.org.apache.bcel.internal.generic.ISTORE;
-import com.sun.org.apache.bcel.internal.generic.Instruction;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.NEW;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.Constants;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-public final class BooleanType extends Type {
- protected BooleanType() {}
-
- public String toString() {
- return "boolean";
- }
-
- public boolean identicalTo(Type other) {
- return this == other;
- }
-
- public String toSignature() {
- return "Z";
- }
-
- public boolean isSimple() {
- return true;
- }
-
- public com.sun.org.apache.bcel.internal.generic.Type toJCType() {
- return com.sun.org.apache.bcel.internal.generic.Type.BOOLEAN;
- }
-
- /**
- * Translates a real into an object of internal type <code>type</code>. The
- * translation to int is undefined since booleans are always converted to
- * reals in arithmetic expressions.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- Type type) {
- if (type == Type.String) {
- translateTo(classGen, methodGen, (StringType) type);
- }
- else if (type == Type.Real) {
- translateTo(classGen, methodGen, (RealType) type);
- }
- else if (type == Type.Reference) {
- translateTo(classGen, methodGen, (ReferenceType) type);
- }
- else {
- ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
- toString(), type.toString());
- classGen.getParser().reportError(Constants.FATAL, err);
- }
- }
-
- /**
- * Expects a boolean on the stack and pushes a string. If the value on the
- * stack is zero, then the string 'false' is pushed. Otherwise, the string
- * 'true' is pushed.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- StringType type) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- final BranchHandle falsec = il.append(new IFEQ(null));
- il.append(new PUSH(cpg, "true"));
- final BranchHandle truec = il.append(new GOTO(null));
- falsec.setTarget(il.append(new PUSH(cpg, "false")));
- truec.setTarget(il.append(NOP));
- }
-
- /**
- * Expects a boolean on the stack and pushes a real. The value "true" is
- * converted to 1.0 and the value "false" to 0.0.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- RealType type) {
- methodGen.getInstructionList().append(I2D);
- }
-
- /**
- * Expects a boolean on the stack and pushes a boxed boolean.
- * Boxed booleans are represented by an instance of
- * <code>java.lang.Boolean</code>.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- ReferenceType type) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- il.append(new NEW(cpg.addClass(BOOLEAN_CLASS)));
- il.append(DUP_X1);
- il.append(SWAP);
- il.append(new INVOKESPECIAL(cpg.addMethodref(BOOLEAN_CLASS,
- "<init>",
- "(Z)V")));
- }
-
- /**
- * Translates an internal boolean into an external (Java) boolean.
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- Class clazz) {
- if (clazz == java.lang.Boolean.TYPE) {
- methodGen.getInstructionList().append(NOP);
- }
- // Is Boolean <: clazz? I.e. clazz in { Boolean, Object }
- else if (clazz.isAssignableFrom(java.lang.Boolean.class)) {
- translateTo(classGen, methodGen, Type.Reference);
- }
- else {
- ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
- toString(), clazz.getName());
- classGen.getParser().reportError(Constants.FATAL, err);
- }
- }
-
- /**
- * Translates an external (Java) boolean into internal boolean.
- */
- public void translateFrom(ClassGenerator classGen, MethodGenerator methodGen,
- Class clazz) {
- translateTo(classGen, methodGen, clazz);
- }
-
- /**
- * Translates an object of this type to its boxed representation.
- */
- public void translateBox(ClassGenerator classGen,
- MethodGenerator methodGen) {
- translateTo(classGen, methodGen, Type.Reference);
- }
-
- /**
- * Translates an object of this type to its unboxed representation.
- */
- public void translateUnBox(ClassGenerator classGen,
- MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- il.append(new CHECKCAST(cpg.addClass(BOOLEAN_CLASS)));
- il.append(new INVOKEVIRTUAL(cpg.addMethodref(BOOLEAN_CLASS,
- BOOLEAN_VALUE,
- BOOLEAN_VALUE_SIG)));
- }
-
- public Instruction LOAD(int slot) {
- return new ILOAD(slot);
- }
-
- public Instruction STORE(int slot) {
- return new ISTORE(slot);
- }
-
- public BranchInstruction GT(boolean tozero) {
- return tozero ? (BranchInstruction) new IFGT(null) :
- (BranchInstruction) new IF_ICMPGT(null);
- }
-
- public BranchInstruction GE(boolean tozero) {
- return tozero ? (BranchInstruction) new IFGE(null) :
- (BranchInstruction) new IF_ICMPGE(null);
- }
-
- public BranchInstruction LT(boolean tozero) {
- return tozero ? (BranchInstruction) new IFLT(null) :
- (BranchInstruction) new IF_ICMPLT(null);
- }
-
- public BranchInstruction LE(boolean tozero) {
- return tozero ? (BranchInstruction) new IFLE(null) :
- (BranchInstruction) new IF_ICMPLE(null);
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ClassGenerator.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ClassGenerator.java
deleted file mode 100644
index d747075..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ClassGenerator.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ClassGenerator.java,v 1.2.4.1 2005/09/05 11:07:09 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-
-import com.sun.org.apache.bcel.internal.classfile.Method;
-import com.sun.org.apache.bcel.internal.generic.ALOAD;
-import com.sun.org.apache.bcel.internal.generic.ClassGen;
-import com.sun.org.apache.bcel.internal.generic.Instruction;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.Constants;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.Parser;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.Stylesheet;
-
-/**
- * The class that implements any class that inherits from
- * <tt>AbstractTranslet</tt>, i.e. any translet. Methods in this
- * class may be of the following kinds:
- *
- * 1. Main method: applyTemplates, implemented by intances of
- * <tt>MethodGenerator</tt>.
- *
- * 2. Named methods: for named templates, implemented by instances
- * of <tt>NamedMethodGenerator</tt>.
- *
- * 3. Rt methods: for result tree fragments, implemented by
- * instances of <tt>RtMethodGenerator</tt>.
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-public class ClassGenerator extends ClassGen {
- protected final static int TRANSLET_INDEX = 0;
- protected static int INVALID_INDEX = -1;
-
- private Stylesheet _stylesheet;
- private final Parser _parser; // --> can be moved to XSLT
- // a single instance cached here
- private final Instruction _aloadTranslet;
- private final String _domClass;
- private final String _domClassSig;
- private final String _applyTemplatesSig;
- private final String _applyTemplatesSigForImport;
-
- public ClassGenerator(String class_name, String super_class_name,
- String file_name,
- int access_flags, String[] interfaces,
- Stylesheet stylesheet) {
- super(class_name, super_class_name, file_name,
- access_flags, interfaces);
- _stylesheet = stylesheet;
- _parser = stylesheet.getParser();
- _aloadTranslet = new ALOAD(TRANSLET_INDEX);
-
- if (stylesheet.isMultiDocument()) {
- _domClass = "com.sun.org.apache.xalan.internal.xsltc.dom.MultiDOM";
- _domClassSig = "Lcom/sun/org/apache/xalan/internal/xsltc/dom/MultiDOM;";
- }
- else {
- _domClass = "com.sun.org.apache.xalan.internal.xsltc.dom.DOMAdapter";
- _domClassSig = "Lcom/sun/org/apache/xalan/internal/xsltc/dom/DOMAdapter;";
- }
- _applyTemplatesSig = "("
- + Constants.DOM_INTF_SIG
- + Constants.NODE_ITERATOR_SIG
- + Constants.TRANSLET_OUTPUT_SIG
- + ")V";
-
- _applyTemplatesSigForImport = "("
- + Constants.DOM_INTF_SIG
- + Constants.NODE_ITERATOR_SIG
- + Constants.TRANSLET_OUTPUT_SIG
- + Constants.NODE_FIELD_SIG
- + ")V";
- }
-
- public final Parser getParser() {
- return _parser;
- }
-
- public final Stylesheet getStylesheet() {
- return _stylesheet;
- }
-
- /**
- * Pretend this is the stylesheet class. Useful when compiling
- * references to global variables inside a predicate.
- */
- public final String getClassName() {
- return _stylesheet.getClassName();
- }
-
- public Instruction loadTranslet() {
- return _aloadTranslet;
- }
-
- public final String getDOMClass() {
- return _domClass;
- }
-
- public final String getDOMClassSig() {
- return _domClassSig;
- }
-
- public final String getApplyTemplatesSig() {
- return _applyTemplatesSig;
- }
-
- public final String getApplyTemplatesSigForImport() {
- return _applyTemplatesSigForImport;
- }
-
- /**
- * Returns <tt>true</tt> or <tt>false</tt> depending on whether
- * this class inherits from <tt>AbstractTranslet</tt> or not.
- */
- public boolean isExternal() {
- return false;
- }
- public void addMethod(MethodGenerator methodGen) {
- Method[] methodsToAdd = methodGen.getGeneratedMethods(this);
- for (int i = 0; i < methodsToAdd.length; i++) {
- addMethod(methodsToAdd[i]);
-}
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/CompareGenerator.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/CompareGenerator.java
deleted file mode 100644
index bb40dc1..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/CompareGenerator.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: CompareGenerator.java,v 1.2.4.1 2005/09/05 11:08:02 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-
-import com.sun.org.apache.bcel.internal.generic.ACONST_NULL;
-import com.sun.org.apache.bcel.internal.generic.ALOAD;
-import com.sun.org.apache.bcel.internal.generic.ASTORE;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.ILOAD;
-import com.sun.org.apache.bcel.internal.generic.ISTORE;
-import com.sun.org.apache.bcel.internal.generic.Instruction;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
-import com.sun.org.apache.bcel.internal.generic.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.Constants;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-public final class CompareGenerator extends MethodGenerator {
-
- private static int DOM_INDEX = 1;
- private static int CURRENT_INDEX = 2;
- private static int LEVEL_INDEX = 3;
- private static int TRANSLET_INDEX = 4;
- private static int LAST_INDEX = 5;
- private int ITERATOR_INDEX = 6;
-
- private final Instruction _iloadCurrent;
- private final Instruction _istoreCurrent;
- private final Instruction _aloadDom;
- private final Instruction _iloadLast;
- private final Instruction _aloadIterator;
- private final Instruction _astoreIterator;
-
- public CompareGenerator(int access_flags, Type return_type,
- Type[] arg_types, String[] arg_names,
- String method_name, String class_name,
- InstructionList il, ConstantPoolGen cp) {
- super(access_flags, return_type, arg_types, arg_names, method_name,
- class_name, il, cp);
-
- _iloadCurrent = new ILOAD(CURRENT_INDEX);
- _istoreCurrent = new ISTORE(CURRENT_INDEX);
- _aloadDom = new ALOAD(DOM_INDEX);
- _iloadLast = new ILOAD(LAST_INDEX);
-
- LocalVariableGen iterator =
- addLocalVariable("iterator",
- Util.getJCRefType(Constants.NODE_ITERATOR_SIG),
- null, null);
- ITERATOR_INDEX = iterator.getIndex();
- _aloadIterator = new ALOAD(ITERATOR_INDEX);
- _astoreIterator = new ASTORE(ITERATOR_INDEX);
- il.append(new ACONST_NULL());
- il.append(storeIterator());
- }
-
- public Instruction loadLastNode() {
- return _iloadLast;
- }
-
- public Instruction loadCurrentNode() {
- return _iloadCurrent;
- }
-
- public Instruction storeCurrentNode() {
- return _istoreCurrent;
- }
-
- public Instruction loadDOM() {
- return _aloadDom;
- }
-
- public int getHandlerIndex() {
- return INVALID_INDEX; // not available
- }
-
- public int getIteratorIndex() {
- return INVALID_INDEX;
- }
-
- public Instruction storeIterator() {
- return _astoreIterator;
- }
-
- public Instruction loadIterator() {
- return _aloadIterator;
- }
-
- //??? may not be used anymore
- public int getLocalIndex(String name) {
- if (name.equals("current")) {
- return CURRENT_INDEX;
- }
- return super.getLocalIndex(name);
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages.java
deleted file mode 100644
index 52f9441..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages.java
+++ /dev/null
@@ -1,1022 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-
-import java.util.ListResourceBundle;
-
-/**
- * @author Morten Jorgensen
- */
-public class ErrorMessages extends ListResourceBundle {
-
-/*
- * XSLTC compile-time error messages.
- *
- * General notes to translators and definitions:
- *
- * 1) XSLTC is the name of the product. It is an acronym for "XSLT Compiler".
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An axis is a particular "dimension" in a tree representation of an XML
- * document; the nodes in the tree are divided along different axes.
- * Traversing the "child" axis, for instance, means that the program
- * would visit each child of a particular node; traversing the "descendant"
- * axis means that the program would visit the child nodes of a particular
- * node, their children, and so on until the leaf nodes of the tree are
- * reached.
- *
- * 5) An iterator is an object that traverses nodes in a tree along a
- * particular axis, one at a time.
- *
- * 6) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 7) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 8) DOM is an acronym for Document Object Model. It is a tree
- * representation of an XML document.
- *
- * SAX is an acronym for the Simple API for XML processing. It is an API
- * used inform an XML processor (in this case XSLTC) of the structure and
- * content of an XML document.
- *
- * Input to the stylesheet processor can come from an XML parser in the
- * form of a DOM tree or through the SAX API.
- *
- * 9) DTD is a document type declaration. It is a way of specifying the
- * grammar for an XML file, the names and types of elements, attributes,
- * etc.
- *
- * 10) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- * 11) Translet is an invented term that refers to the class file that contains
- * the compiled form of a stylesheet.
- */
-
- // These message should be read from a locale-specific resource bundle
- /** Get the lookup table for error messages.
- *
- * @return The message lookup table.
- */
- public Object[][] getContents()
- {
- return new Object[][] {
- {ErrorMsg.MULTIPLE_STYLESHEET_ERR,
- "More than one stylesheet defined in the same file."},
-
- /*
- * Note to translators: The substitution text is the name of a
- * template. The same name was used on two different templates in the
- * same stylesheet.
- */
- {ErrorMsg.TEMPLATE_REDEF_ERR,
- "Template ''{0}'' already defined in this stylesheet."},
-
-
- /*
- * Note to translators: The substitution text is the name of a
- * template. A reference to the template name was encountered, but the
- * template is undefined.
- */
- {ErrorMsg.TEMPLATE_UNDEF_ERR,
- "Template ''{0}'' not defined in this stylesheet."},
-
- /*
- * Note to translators: The substitution text is the name of a variable
- * that was defined more than once.
- */
- {ErrorMsg.VARIABLE_REDEF_ERR,
- "Variable ''{0}'' is multiply defined in the same scope."},
-
- /*
- * Note to translators: The substitution text is the name of a variable
- * or parameter. A reference to the variable or parameter was found,
- * but it was never defined.
- */
- {ErrorMsg.VARIABLE_UNDEF_ERR,
- "Variable or parameter ''{0}'' is undefined."},
-
- /*
- * Note to translators: The word "class" here refers to a Java class.
- * Processing the stylesheet required a class to be loaded, but it could
- * not be found. The substitution text is the name of the class.
- */
- {ErrorMsg.CLASS_NOT_FOUND_ERR,
- "Cannot find class ''{0}''."},
-
- /*
- * Note to translators: The word "method" here refers to a Java method.
- * Processing the stylesheet required a reference to the method named by
- * the substitution text, but it could not be found. "public" is the
- * Java keyword.
- */
- {ErrorMsg.METHOD_NOT_FOUND_ERR,
- "Cannot find external method ''{0}'' (must be public)."},
-
- /*
- * Note to translators: The word "method" here refers to a Java method.
- * Processing the stylesheet required a reference to the method named by
- * the substitution text, but no method with the required types of
- * arguments or return type could be found.
- */
- {ErrorMsg.ARGUMENT_CONVERSION_ERR,
- "Cannot convert argument/return type in call to method ''{0}''"},
-
- /*
- * Note to translators: The file or URI named in the substitution text
- * is missing.
- */
- {ErrorMsg.FILE_NOT_FOUND_ERR,
- "File or URI ''{0}'' not found."},
-
- /*
- * Note to translators: This message is displayed when the URI
- * mentioned in the substitution text is not well-formed syntactically.
- */
- {ErrorMsg.INVALID_URI_ERR,
- "Invalid URI ''{0}''."},
-
- /*
- * Note to translators: The file or URI named in the substitution text
- * exists but could not be opened.
- */
- {ErrorMsg.FILE_ACCESS_ERR,
- "Cannot open file or URI ''{0}''."},
-
- /*
- * Note to translators: <xsl:stylesheet> and <xsl:transform> are
- * keywords that should not be translated.
- */
- {ErrorMsg.MISSING_ROOT_ERR,
- "<xsl:stylesheet> or <xsl:transform> element expected."},
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- {ErrorMsg.NAMESPACE_UNDEF_ERR,
- "Namespace prefix ''{0}'' is undeclared."},
-
- /*
- * Note to translators: The Java function named in the stylesheet could
- * not be found.
- */
- {ErrorMsg.FUNCTION_RESOLVE_ERR,
- "Unable to resolve call to function ''{0}''."},
-
- /*
- * Note to translators: The substitution text is the name of a
- * function. A literal string here means a constant string value.
- */
- {ErrorMsg.NEED_LITERAL_ERR,
- "Argument to ''{0}'' must be a literal string."},
-
- /*
- * Note to translators: This message indicates there was a syntactic
- * error in the form of an XPath expression. The substitution text is
- * the expression.
- */
- {ErrorMsg.XPATH_PARSER_ERR,
- "Error parsing XPath expression ''{0}''."},
-
- /*
- * Note to translators: An element in the stylesheet requires a
- * particular attribute named by the substitution text, but that
- * attribute was not specified in the stylesheet.
- */
- {ErrorMsg.REQUIRED_ATTR_ERR,
- "Required attribute ''{0}'' is missing."},
-
- /*
- * Note to translators: This message indicates that a character not
- * permitted in an XPath expression was encountered. The substitution
- * text is the offending character.
- */
- {ErrorMsg.ILLEGAL_CHAR_ERR,
- "Illegal character ''{0}'' in XPath expression."},
-
- /*
- * Note to translators: A processing instruction is a mark-up item in
- * an XML document that request some behaviour of an XML processor. The
- * form of the name of was invalid in this case, and the substitution
- * text is the name.
- */
- {ErrorMsg.ILLEGAL_PI_ERR,
- "Illegal name ''{0}'' for processing instruction."},
-
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- {ErrorMsg.STRAY_ATTRIBUTE_ERR,
- "Attribute ''{0}'' outside of element."},
-
- /*
- * Note to translators: An attribute that wasn't recognized was
- * specified on an element in the stylesheet. The attribute is named
- * by the substitution
- * text.
- */
- {ErrorMsg.ILLEGAL_ATTRIBUTE_ERR,
- "Illegal attribute ''{0}''."},
-
- /*
- * Note to translators: "import" and "include" are keywords that should
- * not be translated. This messages indicates that the stylesheet
- * named in the substitution text imported or included itself either
- * directly or indirectly.
- */
- {ErrorMsg.CIRCULAR_INCLUDE_ERR,
- "Circular import/include. Stylesheet ''{0}'' already loaded."},
-
- /*
- * Note to translators: A result-tree fragment is a portion of a
- * resulting XML document represented as a tree. "<xsl:sort>" is a
- * keyword and should not be translated.
- */
- {ErrorMsg.RESULT_TREE_SORT_ERR,
- "Result-tree fragments cannot be sorted (<xsl:sort> elements are " +
- "ignored). You must sort the nodes when creating the result tree."},
-
- /*
- * Note to translators: A name can be given to a particular style to be
- * used to format decimal values. The substitution text gives the name
- * of such a style for which more than one declaration was encountered.
- */
- {ErrorMsg.SYMBOLS_REDEF_ERR,
- "Decimal formatting ''{0}'' is already defined."},
-
- /*
- * Note to translators: The stylesheet version named in the
- * substitution text is not supported.
- */
- {ErrorMsg.XSL_VERSION_ERR,
- "XSL version ''{0}'' is not supported by XSLTC."},
-
- /*
- * Note to translators: The definitions of one or more variables or
- * parameters depend on one another.
- */
- {ErrorMsg.CIRCULAR_VARIABLE_ERR,
- "Circular variable/parameter reference in ''{0}''."},
-
- /*
- * Note to translators: The operator in an expresion with two operands was
- * not recognized.
- */
- {ErrorMsg.ILLEGAL_BINARY_OP_ERR,
- "Unknown operator for binary expression."},
-
- /*
- * Note to translators: This message is produced if a reference to a
- * function has too many or too few arguments.
- */
- {ErrorMsg.ILLEGAL_ARG_ERR,
- "Illegal argument(s) for function call."},
-
- /*
- * Note to translators: "document()" is the name of function and must
- * not be translated. A node-set is a set of the nodes in the tree
- * representation of an XML document.
- */
- {ErrorMsg.DOCUMENT_ARG_ERR,
- "Second argument to document() function must be a node-set."},
-
- /*
- * Note to translators: "<xsl:when>" and "<xsl:choose>" are keywords
- * and should not be translated. This message describes a syntax error
- * in the stylesheet.
- */
- {ErrorMsg.MISSING_WHEN_ERR,
- "At least one <xsl:when> element required in <xsl:choose>."},
-
- /*
- * Note to translators: "<xsl:otherwise>" and "<xsl:choose>" are
- * keywords and should not be translated. This message describes a
- * syntax error in the stylesheet.
- */
- {ErrorMsg.MULTIPLE_OTHERWISE_ERR,
- "Only one <xsl:otherwise> element allowed in <xsl:choose>."},
-
- /*
- * Note to translators: "<xsl:otherwise>" and "<xsl:choose>" are
- * keywords and should not be translated. This message describes a
- * syntax error in the stylesheet.
- */
- {ErrorMsg.STRAY_OTHERWISE_ERR,
- "<xsl:otherwise> can only be used within <xsl:choose>."},
-
- /*
- * Note to translators: "<xsl:when>" and "<xsl:choose>" are keywords
- * and should not be translated. This message describes a syntax error
- * in the stylesheet.
- */
- {ErrorMsg.STRAY_WHEN_ERR,
- "<xsl:when> can only be used within <xsl:choose>."},
-
- /*
- * Note to translators: "<xsl:when>", "<xsl:otherwise>" and
- * "<xsl:choose>" are keywords and should not be translated. This
- * message describes a syntax error in the stylesheet.
- */
- {ErrorMsg.WHEN_ELEMENT_ERR,
- "Only <xsl:when> and <xsl:otherwise> elements allowed in <xsl:choose>."},
-
- /*
- * Note to translators: "<xsl:attribute-set>" and "name" are keywords
- * that should not be translated.
- */
- {ErrorMsg.UNNAMED_ATTRIBSET_ERR,
- "<xsl:attribute-set> is missing the 'name' attribute."},
-
- /*
- * Note to translators: An element in the stylesheet contained an
- * element of a type that it was not permitted to contain.
- */
- {ErrorMsg.ILLEGAL_CHILD_ERR,
- "Illegal child element."},
-
- /*
- * Note to translators: The stylesheet tried to create an element with
- * a name that was not a valid XML name. The substitution text contains
- * the name.
- */
- {ErrorMsg.ILLEGAL_ELEM_NAME_ERR,
- "You cannot call an element ''{0}''"},
-
- /*
- * Note to translators: The stylesheet tried to create an attribute
- * with a name that was not a valid XML name. The substitution text
- * contains the name.
- */
- {ErrorMsg.ILLEGAL_ATTR_NAME_ERR,
- "You cannot call an attribute ''{0}''"},
-
- /*
- * Note to translators: The children of the outermost element of a
- * stylesheet are referred to as top-level elements. No text should
- * occur within that outermost element unless it is within a top-level
- * element. This message indicates that that constraint was violated.
- * "<xsl:stylesheet>" is a keyword that should not be translated.
- */
- {ErrorMsg.ILLEGAL_TEXT_NODE_ERR,
- "Text data outside of top-level <xsl:stylesheet> element."},
-
- /*
- * Note to translators: JAXP is an acronym for the Java API for XML
- * Processing. This message indicates that the XML parser provided to
- * XSLTC to process the XML input document had a configuration problem.
- */
- {ErrorMsg.SAX_PARSER_CONFIG_ERR,
- "JAXP parser not configured correctly"},
-
- /*
- * Note to translators: The substitution text names the internal error
- * encountered.
- */
- {ErrorMsg.INTERNAL_ERR,
- "Unrecoverable XSLTC-internal error: ''{0}''"},
-
- /*
- * Note to translators: The stylesheet contained an element that was
- * not recognized as part of the XSL syntax. The substitution text
- * gives the element name.
- */
- {ErrorMsg.UNSUPPORTED_XSL_ERR,
- "Unsupported XSL element ''{0}''."},
-
- /*
- * Note to translators: The stylesheet referred to an extension to the
- * XSL syntax and indicated that it was defined by XSLTC, but XSTLC does
- * not recognized the particular extension named. The substitution text
- * gives the extension name.
- */
- {ErrorMsg.UNSUPPORTED_EXT_ERR,
- "Unrecognised XSLTC extension ''{0}''."},
-
- /*
- * Note to translators: The XML document given to XSLTC as a stylesheet
- * was not, in fact, a stylesheet. XSLTC is able to detect that in this
- * case because the outermost element in the stylesheet has to be
- * declared with respect to the XSL namespace URI, but no declaration
- * for that namespace was seen.
- */
- {ErrorMsg.MISSING_XSLT_URI_ERR,
- "The input document is not a stylesheet (the XSL namespace is not "+
- "declared in the root element)."},
-
- /*
- * Note to translators: XSLTC could not find the stylesheet document
- * with the name specified by the substitution text.
- */
- {ErrorMsg.MISSING_XSLT_TARGET_ERR,
- "Could not find stylesheet target ''{0}''."},
-
- /*
- * Note to translators: access to the stylesheet target is denied
- */
- {ErrorMsg.ACCESSING_XSLT_TARGET_ERR,
- "Could not read stylesheet target ''{0}'', because ''{1}'' access is not allowed due to restriction set by the accessExternalStylesheet property."},
-
- /*
- * Note to translators: This message represents an internal error in
- * condition in XSLTC. The substitution text is the class name in XSLTC
- * that is missing some functionality.
- */
- {ErrorMsg.NOT_IMPLEMENTED_ERR,
- "Not implemented: ''{0}''."},
-
- /*
- * Note to translators: The XML document given to XSLTC as a stylesheet
- * was not, in fact, a stylesheet.
- */
- {ErrorMsg.NOT_STYLESHEET_ERR,
- "The input document does not contain an XSL stylesheet."},
-
- /*
- * Note to translators: The element named in the substitution text was
- * encountered in the stylesheet but is not recognized.
- */
- {ErrorMsg.ELEMENT_PARSE_ERR,
- "Could not parse element ''{0}''"},
-
- /*
- * Note to translators: "use", "<key>", "node", "node-set", "string"
- * and "number" are keywords in this context and should not be
- * translated. This message indicates that the value of the "use"
- * attribute was not one of the permitted values.
- */
- {ErrorMsg.KEY_USE_ATTR_ERR,
- "The use attribute of <key> must be node, node-set, string or number."},
-
- /*
- * Note to translators: An XML document can specify the version of the
- * XML specification to which it adheres. This message indicates that
- * the version specified for the output document was not valid.
- */
- {ErrorMsg.OUTPUT_VERSION_ERR,
- "Output XML document version should be 1.0"},
-
- /*
- * Note to translators: The operator in a comparison operation was
- * not recognized.
- */
- {ErrorMsg.ILLEGAL_RELAT_OP_ERR,
- "Unknown operator for relational expression"},
-
- /*
- * Note to translators: An attribute set defines as a set of XML
- * attributes that can be added to an element in the output XML document
- * as a group. This message is reported if the name specified was not
- * used to declare an attribute set. The substitution text is the name
- * that is in error.
- */
- {ErrorMsg.ATTRIBSET_UNDEF_ERR,
- "Attempting to use non-existing attribute set ''{0}''."},
-
- /*
- * Note to translators: The term "attribute value template" is a term
- * defined by XSLT which describes the value of an attribute that is
- * determined by an XPath expression. The message indicates that the
- * expression was syntactically incorrect; the substitution text
- * contains the expression that was in error.
- */
- {ErrorMsg.ATTR_VAL_TEMPLATE_ERR,
- "Cannot parse attribute value template ''{0}''."},
-
- /*
- * Note to translators: ???
- */
- {ErrorMsg.UNKNOWN_SIG_TYPE_ERR,
- "Unknown data-type in signature for class ''{0}''."},
-
- /*
- * Note to translators: The substitution text refers to data types.
- * The message is displayed if a value in a particular context needs to
- * be converted to type {1}, but that's not possible for a value of
- * type {0}.
- */
- {ErrorMsg.DATA_CONVERSION_ERR,
- "Cannot convert data-type ''{0}'' to ''{1}''."},
-
- /*
- * Note to translators: "Templates" is a Java class name that should
- * not be translated.
- */
- {ErrorMsg.NO_TRANSLET_CLASS_ERR,
- "This Templates does not contain a valid translet class definition."},
-
- /*
- * Note to translators: "Templates" is a Java class name that should
- * not be translated.
- */
- {ErrorMsg.NO_MAIN_TRANSLET_ERR,
- "This Templates does not contain a class with the name ''{0}''."},
-
- /*
- * Note to translators: The substitution text is the name of a class.
- */
- {ErrorMsg.TRANSLET_CLASS_ERR,
- "Could not load the translet class ''{0}''."},
-
- {ErrorMsg.TRANSLET_OBJECT_ERR,
- "Translet class loaded, but unable to create translet instance."},
-
- /*
- * Note to translators: "ErrorListener" is a Java interface name that
- * should not be translated. The message indicates that the user tried
- * to set an ErrorListener object on object of the class named in the
- * substitution text with "null" Java value.
- */
- {ErrorMsg.ERROR_LISTENER_NULL_ERR,
- "Attempting to set ErrorListener for ''{0}'' to null"},
-
- /*
- * Note to translators: StreamSource, SAXSource and DOMSource are Java
- * interface names that should not be translated.
- */
- {ErrorMsg.JAXP_UNKNOWN_SOURCE_ERR,
- "Only StreamSource, SAXSource and DOMSource are supported by XSLTC"},
-
- /*
- * Note to translators: "Source" is a Java class name that should not
- * be translated. The substitution text is the name of Java method.
- */
- {ErrorMsg.JAXP_NO_SOURCE_ERR,
- "Source object passed to ''{0}'' has no contents."},
-
- /*
- * Note to translators: The message indicates that XSLTC failed to
- * compile the stylesheet into a translet (class file).
- */
- {ErrorMsg.JAXP_COMPILE_ERR,
- "Could not compile stylesheet"},
-
- /*
- * Note to translators: "TransformerFactory" is a class name. In this
- * context, an attribute is a property or setting of the
- * TransformerFactory object. The substitution text is the name of the
- * unrecognised attribute. The method used to retrieve the attribute is
- * "getAttribute", so it's not clear whether it would be best to
- * translate the term "attribute".
- */
- {ErrorMsg.JAXP_INVALID_ATTR_ERR,
- "TransformerFactory does not recognise attribute ''{0}''."},
-
- {ErrorMsg.JAXP_INVALID_ATTR_VALUE_ERR,
- "Incorrect value specified for ''{0}'' attribute."},
-
- /*
- * Note to translators: "setResult()" and "startDocument()" are Java
- * method names that should not be translated.
- */
- {ErrorMsg.JAXP_SET_RESULT_ERR,
- "setResult() must be called prior to startDocument()."},
-
- /*
- * Note to translators: "Transformer" is a Java interface name that
- * should not be translated. A Transformer object should contained a
- * reference to a translet object in order to be used for
- * transformations; this message is produced if that requirement is not
- * met.
- */
- {ErrorMsg.JAXP_NO_TRANSLET_ERR,
- "The Transformer has no encapsulated translet object."},
-
- /*
- * Note to translators: The XML document that results from a
- * transformation needs to be sent to an output handler object; this
- * message is produced if that requirement is not met.
- */
- {ErrorMsg.JAXP_NO_HANDLER_ERR,
- "No defined output handler for transformation result."},
-
- /*
- * Note to translators: "Result" is a Java interface name in this
- * context. The substitution text is a method name.
- */
- {ErrorMsg.JAXP_NO_RESULT_ERR,
- "Result object passed to ''{0}'' is invalid."},
-
- /*
- * Note to translators: "Transformer" is a Java interface name. The
- * user's program attempted to access an unrecognized property with the
- * name specified in the substitution text. The method used to retrieve
- * the property is "getOutputProperty", so it's not clear whether it
- * would be best to translate the term "property".
- */
- {ErrorMsg.JAXP_UNKNOWN_PROP_ERR,
- "Attempting to access invalid Transformer property ''{0}''."},
-
- /*
- * Note to translators: SAX2DOM is the name of a Java class that should
- * not be translated. This is an adapter in the sense that it takes a
- * DOM object and converts it to something that uses the SAX API.
- */
- {ErrorMsg.SAX2DOM_ADAPTER_ERR,
- "Could not create SAX2DOM adapter: ''{0}''."},
-
- /*
- * Note to translators: "XSLTCSource.build()" is a Java method name.
- * "systemId" is an XML term that is short for "system identification".
- */
- {ErrorMsg.XSLTC_SOURCE_ERR,
- "XSLTCSource.build() called without systemId being set."},
-
- { ErrorMsg.ER_RESULT_NULL,
- "Result should not be null"},
-
- /*
- * Note to translators: This message indicates that the value argument
- * of setParameter must be a valid Java Object.
- */
- {ErrorMsg.JAXP_INVALID_SET_PARAM_VALUE,
- "The value of param {0} must be a valid Java Object"},
-
-
- {ErrorMsg.COMPILE_STDIN_ERR,
- "The -i option must be used with the -o option."},
-
-
- /*
- * Note to translators: This message contains usage information for a
- * means of invoking XSLTC from the command-line. The message is
- * formatted for presentation in English. The strings <output>,
- * <directory>, etc. indicate user-specified argument values, and can
- * be translated - the argument <package> refers to a Java package, so
- * it should be handled in the same way the term is handled for JDK
- * documentation.
- */
- {ErrorMsg.COMPILE_USAGE_STR,
- "SYNOPSIS\n"+
- " java com.sun.org.apache.xalan.internal.xsltc.cmdline.Compile [-o <output>]\n"+
- " [-d <directory>] [-j <jarfile>] [-p <package>]\n"+
- " [-n] [-x] [-u] [-v] [-h] { <stylesheet> | -i }\n\n"+
- "OPTIONS\n"+
- " -o <output> assigns the name <output> to the generated\n"+
- " translet. By default the translet name is\n"+
- " derived from the <stylesheet> name. This option\n"+
- " is ignored if compiling multiple stylesheets.\n"+
- " -d <directory> specifies a destination directory for translet\n"+
- " -j <jarfile> packages translet classes into a jar file of the\n"+
- " name specified as <jarfile>\n"+
- " -p <package> specifies a package name prefix for all generated\n"+
- " translet classes.\n"+
- " -n enables template inlining (default behavior better\n"+
- " on average).\n"+
- " -x turns on additional debugging message output\n"+
- " -u interprets <stylesheet> arguments as URLs\n"+
- " -i forces compiler to read stylesheet from stdin\n"+
- " -v prints the version of the compiler\n"+
- " -h prints this usage statement\n"},
-
- /*
- * Note to translators: This message contains usage information for a
- * means of invoking XSLTC from the command-line. The message is
- * formatted for presentation in English. The strings <jarfile>,
- * <document>, etc. indicate user-specified argument values, and can
- * be translated - the argument <class> refers to a Java class, so it
- * should be handled in the same way the term is handled for JDK
- * documentation.
- */
- {ErrorMsg.TRANSFORM_USAGE_STR,
- "SYNOPSIS \n"+
- " java com.sun.org.apache.xalan.internal.xsltc.cmdline.Transform [-j <jarfile>]\n"+
- " [-x] [-n <iterations>] {-u <document_url> | <document>}\n"+
- " <class> [<param1>=<value1> ...]\n\n"+
- " uses the translet <class> to transform an XML document \n"+
- " specified as <document>. The translet <class> is either in\n"+
- " the user's CLASSPATH or in the optionally specified <jarfile>.\n"+
- "OPTIONS\n"+
- " -j <jarfile> specifies a jarfile from which to load translet\n"+
- " -x turns on additional debugging message output\n"+
- " -n <iterations> runs the transformation <iterations> times and\n"+
- " displays profiling information\n"+
- " -u <document_url> specifies XML input document as a URL\n"},
-
-
-
- /*
- * Note to translators: "<xsl:sort>", "<xsl:for-each>" and
- * "<xsl:apply-templates>" are keywords that should not be translated.
- * The message indicates that an xsl:sort element must be a child of
- * one of the other kinds of elements mentioned.
- */
- {ErrorMsg.STRAY_SORT_ERR,
- "<xsl:sort> can only be used within <xsl:for-each> or <xsl:apply-templates>."},
-
- /*
- * Note to translators: The message indicates that the encoding
- * requested for the output document was on that requires support that
- * is not available from the Java Virtual Machine being used to execute
- * the program.
- */
- {ErrorMsg.UNSUPPORTED_ENCODING,
- "Output encoding ''{0}'' is not supported on this JVM."},
-
- /*
- * Note to translators: The message indicates that the XPath expression
- * named in the substitution text was not well formed syntactically.
- */
- {ErrorMsg.SYNTAX_ERR,
- "Syntax error in ''{0}''."},
-
- /*
- * Note to translators: The substitution text is the name of a Java
- * class. The term "constructor" here is the Java term. The message is
- * displayed if XSLTC could not find a constructor for the specified
- * class.
- */
- {ErrorMsg.CONSTRUCTOR_NOT_FOUND,
- "Cannot find external constructor ''{0}''."},
-
- /*
- * Note to translators: "static" is the Java keyword. The substitution
- * text is the name of a function. The first argument of that function
- * is not of the required type.
- */
- {ErrorMsg.NO_JAVA_FUNCT_THIS_REF,
- "The first argument to the non-static Java function ''{0}'' is not a "+
- "valid object reference."},
-
- /*
- * Note to translators: An XPath expression was not of the type
- * required in a particular context. The substitution text is the
- * expression that was in error.
- */
- {ErrorMsg.TYPE_CHECK_ERR,
- "Error checking type of the expression ''{0}''."},
-
- /*
- * Note to translators: An XPath expression was not of the type
- * required in a particular context. However, the location of the
- * problematic expression is unknown.
- */
- {ErrorMsg.TYPE_CHECK_UNK_LOC_ERR,
- "Error checking type of an expression at an unknown location."},
-
- /*
- * Note to translators: The substitution text is the name of a command-
- * line option that was not recognized.
- */
- {ErrorMsg.ILLEGAL_CMDLINE_OPTION_ERR,
- "The command-line option ''{0}'' is not valid."},
-
- /*
- * Note to translators: The substitution text is the name of a command-
- * line option.
- */
- {ErrorMsg.CMDLINE_OPT_MISSING_ARG_ERR,
- "The command-line option ''{0}'' is missing a required argument."},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text contains two error
- * messages. The spacing before the second substitution text indents
- * it the same amount as the first in English.
- */
- {ErrorMsg.WARNING_PLUS_WRAPPED_MSG,
- "WARNING: ''{0}''\n :{1}"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text is an error message.
- */
- {ErrorMsg.WARNING_MSG,
- "WARNING: ''{0}''"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text contains two error
- * messages. The spacing before the second substitution text indents
- * it the same amount as the first in English.
- */
- {ErrorMsg.FATAL_ERR_PLUS_WRAPPED_MSG,
- "FATAL ERROR: ''{0}''\n :{1}"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text is an error message.
- */
- {ErrorMsg.FATAL_ERR_MSG,
- "FATAL ERROR: ''{0}''"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text contains two error
- * messages. The spacing before the second substitution text indents
- * it the same amount as the first in English.
- */
- {ErrorMsg.ERROR_PLUS_WRAPPED_MSG,
- "ERROR: ''{0}''\n :{1}"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text is an error message.
- */
- {ErrorMsg.ERROR_MSG,
- "ERROR: ''{0}''"},
-
- /*
- * Note to translators: The substitution text is the name of a class.
- */
- {ErrorMsg.TRANSFORM_WITH_TRANSLET_STR,
- "Transform using translet ''{0}'' "},
-
- /*
- * Note to translators: The first substitution is the name of a class,
- * while the second substitution is the name of a jar file.
- */
- {ErrorMsg.TRANSFORM_WITH_JAR_STR,
- "Transform using translet ''{0}'' from jar file ''{1}''"},
-
- /*
- * Note to translators: "TransformerFactory" is the name of a Java
- * interface and must not be translated. The substitution text is
- * the name of the class that could not be instantiated.
- */
- {ErrorMsg.COULD_NOT_CREATE_TRANS_FACT,
- "Could not create an instance of the TransformerFactory class ''{0}''."},
-
- /*
- * Note to translators: This message is produced when the user
- * specified a name for the translet class that contains characters
- * that are not permitted in a Java class name. The substitution
- * text "{0}" specifies the name the user requested, while "{1}"
- * specifies the name the processor used instead.
- */
- {ErrorMsg.TRANSLET_NAME_JAVA_CONFLICT,
- "The name ''{0}'' could not be used as the name of the translet "+
- "class because it contains characters that are not permitted in the "+
- "name of Java class. The name ''{1}'' was used instead."},
-
- /*
- * Note to translators: The following message is used as a header.
- * All the error messages are collected together and displayed beneath
- * this message.
- */
- {ErrorMsg.COMPILER_ERROR_KEY,
- "Compiler errors:"},
-
- /*
- * Note to translators: The following message is used as a header.
- * All the warning messages are collected together and displayed
- * beneath this message.
- */
- {ErrorMsg.COMPILER_WARNING_KEY,
- "Compiler warnings:"},
-
- /*
- * Note to translators: The following message is used as a header.
- * All the error messages that are produced when the stylesheet is
- * applied to an input document are collected together and displayed
- * beneath this message. A 'translet' is the compiled form of a
- * stylesheet (see above).
- */
- {ErrorMsg.RUNTIME_ERROR_KEY,
- "Translet errors:"},
-
- /*
- * Note to translators: An attribute whose value is constrained to
- * be a "QName" or a list of "QNames" had a value that was incorrect.
- * 'QName' is an XML syntactic term that must not be translated. The
- * substitution text contains the actual value of the attribute.
- */
- {ErrorMsg.INVALID_QNAME_ERR,
- "An attribute whose value must be a QName or whitespace-separated list of QNames had the value ''{0}''"},
-
- /*
- * Note to translators: An attribute whose value is required to
- * be an "NCName".
- * 'NCName' is an XML syntactic term that must not be translated. The
- * substitution text contains the actual value of the attribute.
- */
- {ErrorMsg.INVALID_NCNAME_ERR,
- "An attribute whose value must be an NCName had the value ''{0}''"},
-
- /*
- * Note to translators: An attribute with an incorrect value was
- * encountered. The permitted value is one of the literal values
- * "xml", "html" or "text"; it is also permitted to have the form of
- * a QName that is not also an NCName. The terms "method",
- * "xsl:output", "xml", "html" and "text" are keywords that must not
- * be translated. The term "qname-but-not-ncname" is an XML syntactic
- * term. The substitution text contains the actual value of the
- * attribute.
- */
- {ErrorMsg.INVALID_METHOD_IN_OUTPUT,
- "The method attribute of an <xsl:output> element had the value ''{0}''. The value must be one of ''xml'', ''html'', ''text'', or qname-but-not-ncname"},
-
- {ErrorMsg.JAXP_GET_FEATURE_NULL_NAME,
- "The feature name cannot be null in TransformerFactory.getFeature(String name)."},
-
- {ErrorMsg.JAXP_SET_FEATURE_NULL_NAME,
- "The feature name cannot be null in TransformerFactory.setFeature(String name, boolean value)."},
-
- {ErrorMsg.JAXP_UNSUPPORTED_FEATURE,
- "Cannot set the feature ''{0}'' on this TransformerFactory."},
-
- {ErrorMsg.JAXP_SECUREPROCESSING_FEATURE,
- "FEATURE_SECURE_PROCESSING: Cannot set the feature to false when security manager is present."},
-
- /*
- * Note to translators: This message describes an internal error in the
- * processor. The term "byte code" is a Java technical term for the
- * executable code in a Java method, and "try-catch-finally block"
- * refers to the Java keywords with those names. "Outlined" is a
- * technical term internal to XSLTC and should not be translated.
- */
- {ErrorMsg.OUTLINE_ERR_TRY_CATCH,
- "Internal XSLTC error: the generated byte code contains a " +
- "try-catch-finally block and cannot be outlined."},
-
- /*
- * Note to translators: This message describes an internal error in the
- * processor. The terms "OutlineableChunkStart" and
- * "OutlineableChunkEnd" are the names of classes internal to XSLTC and
- * should not be translated. The message indicates that for every
- * "start" there must be a corresponding "end", and vice versa, and
- * that if one of a pair of "start" and "end" appears between another
- * pair of corresponding "start" and "end", then the other half of the
- * pair must also be between that same enclosing pair.
- */
- {ErrorMsg.OUTLINE_ERR_UNBALANCED_MARKERS,
- "Internal XSLTC error: OutlineableChunkStart and " +
- "OutlineableChunkEnd markers must be balanced and properly nested."},
-
- /*
- * Note to translators: This message describes an internal error in the
- * processor. The term "byte code" is a Java technical term for the
- * executable code in a Java method. The "method" that is being
- * referred to is a Java method in a translet that XSLTC is generating
- * in processing a stylesheet. The "instruction" that is being
- * referred to is one of the instrutions in the Java byte code in that
- * method. "Outlined" is a technical term internal to XSLTC and
- * should not be translated.
- */
- {ErrorMsg.OUTLINE_ERR_DELETED_TARGET,
- "Internal XSLTC error: an instruction that was part of a block of " +
- "byte code that was outlined is still referred to in the original " +
- "method."
- },
-
-
- /*
- * Note to translators: This message describes an internal error in the
- * processor. The "method" that is being referred to is a Java method
- * in a translet that XSLTC is generating.
- *
- */
- {ErrorMsg.OUTLINE_ERR_METHOD_TOO_BIG,
- "Internal XSLTC error: a method in the translet exceeds the Java " +
- "Virtual Machine limitation on the length of a method of 64 " +
- "kilobytes. This is usually caused by templates in a stylesheet " +
- "that are very large. Try restructuring your stylesheet to use " +
- "smaller templates."
- },
-
- {ErrorMsg.DESERIALIZE_TRANSLET_ERR, "When Java security is enabled, " +
- "support for deserializing TemplatesImpl is disabled." +
- "This can be overridden by setting the jdk.xml.enableTemplatesImplDeserialization" +
- " system property to true."}
-
- };
-
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ca.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ca.java
deleted file mode 100644
index 708f744..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ca.java
+++ /dev/null
@@ -1,863 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ErrorMessages_ca.java,v 1.1.6.1 2005/09/05 11:52:59 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-
-import java.util.ListResourceBundle;
-
-/**
- * @author Morten Jorgensen
- */
-public class ErrorMessages_ca extends ListResourceBundle {
-
-/*
- * XSLTC compile-time error messages.
- *
- * General notes to translators and definitions:
- *
- * 1) XSLTC is the name of the product. It is an acronym for "XSLT Compiler".
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An axis is a particular "dimension" in a tree representation of an XML
- * document; the nodes in the tree are divided along different axes.
- * Traversing the "child" axis, for instance, means that the program
- * would visit each child of a particular node; traversing the "descendant"
- * axis means that the program would visit the child nodes of a particular
- * node, their children, and so on until the leaf nodes of the tree are
- * reached.
- *
- * 5) An iterator is an object that traverses nodes in a tree along a
- * particular axis, one at a time.
- *
- * 6) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 7) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 8) DOM is an acronym for Document Object Model. It is a tree
- * representation of an XML document.
- *
- * SAX is an acronym for the Simple API for XML processing. It is an API
- * used inform an XML processor (in this case XSLTC) of the structure and
- * content of an XML document.
- *
- * Input to the stylesheet processor can come from an XML parser in the
- * form of a DOM tree or through the SAX API.
- *
- * 9) DTD is a document type declaration. It is a way of specifying the
- * grammar for an XML file, the names and types of elements, attributes,
- * etc.
- *
- * 10) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- * 11) Translet is an invented term that refers to the class file that contains
- * the compiled form of a stylesheet.
- */
-
- // These message should be read from a locale-specific resource bundle
- /** Get the lookup table for error messages.
- *
- * @return The message lookup table.
- */
- public Object[][] getContents()
- {
- return new Object[][] {
- {ErrorMsg.MULTIPLE_STYLESHEET_ERR,
- "S'ha definit m\u00e9s d'un full d'estils en el mateix fitxer."},
-
- /*
- * Note to translators: The substitution text is the name of a
- * template. The same name was used on two different templates in the
- * same stylesheet.
- */
- {ErrorMsg.TEMPLATE_REDEF_ERR,
- "La plantilla ''{0}'' ja est\u00e0 definida en aquest full d''estils."},
-
-
- /*
- * Note to translators: The substitution text is the name of a
- * template. A reference to the template name was encountered, but the
- * template is undefined.
- */
- {ErrorMsg.TEMPLATE_UNDEF_ERR,
- "La plantilla ''{0}'' no est\u00e0 definida en aquest full d''estils."},
-
- /*
- * Note to translators: The substitution text is the name of a variable
- * that was defined more than once.
- */
- {ErrorMsg.VARIABLE_REDEF_ERR,
- "La variable ''{0}'' s''ha definit m\u00e9s d''una vegada en el mateix \u00e0mbit."},
-
- /*
- * Note to translators: The substitution text is the name of a variable
- * or parameter. A reference to the variable or parameter was found,
- * but it was never defined.
- */
- {ErrorMsg.VARIABLE_UNDEF_ERR,
- "La variable o el par\u00e0metre ''{0}'' no s''ha definit."},
-
- /*
- * Note to translators: The word "class" here refers to a Java class.
- * Processing the stylesheet required a class to be loaded, but it could
- * not be found. The substitution text is the name of the class.
- */
- {ErrorMsg.CLASS_NOT_FOUND_ERR,
- "No s''ha trobat la classe ''{0}''."},
-
- /*
- * Note to translators: The word "method" here refers to a Java method.
- * Processing the stylesheet required a reference to the method named by
- * the substitution text, but it could not be found. "public" is the
- * Java keyword.
- */
- {ErrorMsg.METHOD_NOT_FOUND_ERR,
- "No s''ha trobat el m\u00e8tode extern ''{0}'' (ha de ser public)."},
-
- /*
- * Note to translators: The word "method" here refers to a Java method.
- * Processing the stylesheet required a reference to the method named by
- * the substitution text, but no method with the required types of
- * arguments or return type could be found.
- */
- {ErrorMsg.ARGUMENT_CONVERSION_ERR,
- "No s''ha pogut convertir l''argument o tipus de retorn a la crida del m\u00e8tode ''{0}''"},
-
- /*
- * Note to translators: The file or URI named in the substitution text
- * is missing.
- */
- {ErrorMsg.FILE_NOT_FOUND_ERR,
- "No s''ha trobat el fitxer o URI ''{0}''."},
-
- /*
- * Note to translators: This message is displayed when the URI
- * mentioned in the substitution text is not well-formed syntactically.
- */
- {ErrorMsg.INVALID_URI_ERR,
- "L''URI ''{0}'' no \u00e9s v\u00e0lid."},
-
- /*
- * Note to translators: The file or URI named in the substitution text
- * exists but could not be opened.
- */
- {ErrorMsg.FILE_ACCESS_ERR,
- "No es pot obrir el fitxer o l''URI ''{0}''."},
-
- /*
- * Note to translators: <xsl:stylesheet> and <xsl:transform> are
- * keywords that should not be translated.
- */
- {ErrorMsg.MISSING_ROOT_ERR,
- "S''esperava l''element <xsl:stylesheet> o <xsl:transform>."},
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- {ErrorMsg.NAMESPACE_UNDEF_ERR,
- "El prefix d''espai de noms ''{0}'' no s''ha declarat."},
-
- /*
- * Note to translators: The Java function named in the stylesheet could
- * not be found.
- */
- {ErrorMsg.FUNCTION_RESOLVE_ERR,
- "No s''ha pogut resoldre la crida de la funci\u00f3 ''{0}''."},
-
- /*
- * Note to translators: The substitution text is the name of a
- * function. A literal string here means a constant string value.
- */
- {ErrorMsg.NEED_LITERAL_ERR,
- "L''argument de ''{0}'' ha de ser una cadena de literals."},
-
- /*
- * Note to translators: This message indicates there was a syntactic
- * error in the form of an XPath expression. The substitution text is
- * the expression.
- */
- {ErrorMsg.XPATH_PARSER_ERR,
- "S''ha produ\u00eft un error en analitzar l''expressi\u00f3 XPath ''{0}''."},
-
- /*
- * Note to translators: An element in the stylesheet requires a
- * particular attribute named by the substitution text, but that
- * attribute was not specified in the stylesheet.
- */
- {ErrorMsg.REQUIRED_ATTR_ERR,
- "No s''ha especificat l''atribut obligatori ''{0}''."},
-
- /*
- * Note to translators: This message indicates that a character not
- * permitted in an XPath expression was encountered. The substitution
- * text is the offending character.
- */
- {ErrorMsg.ILLEGAL_CHAR_ERR,
- "L''expressi\u00f3 XPath cont\u00e9 el car\u00e0cter no perm\u00e8s ''{0}''."},
-
- /*
- * Note to translators: A processing instruction is a mark-up item in
- * an XML document that request some behaviour of an XML processor. The
- * form of the name of was invalid in this case, and the substitution
- * text is the name.
- */
- {ErrorMsg.ILLEGAL_PI_ERR,
- "La instrucci\u00f3 de processament t\u00e9 el nom no perm\u00e8s ''{0}''."},
-
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- {ErrorMsg.STRAY_ATTRIBUTE_ERR,
- "L''atribut ''{0}'' es troba fora de l''element."},
-
- /*
- * Note to translators: An attribute that wasn't recognized was
- * specified on an element in the stylesheet. The attribute is named
- * by the substitution
- * text.
- */
- {ErrorMsg.ILLEGAL_ATTRIBUTE_ERR,
- "No es permet l''atribut ''{0}''."},
-
- /*
- * Note to translators: "import" and "include" are keywords that should
- * not be translated. This messages indicates that the stylesheet
- * named in the substitution text imported or included itself either
- * directly or indirectly.
- */
- {ErrorMsg.CIRCULAR_INCLUDE_ERR,
- "Import/include circular. El full d''estils ''{0}'' ja s''ha carregat."},
-
- /*
- * Note to translators: A result-tree fragment is a portion of a
- * resulting XML document represented as a tree. "<xsl:sort>" is a
- * keyword and should not be translated.
- */
- {ErrorMsg.RESULT_TREE_SORT_ERR,
- "Els fragments de l'arbre de resultats no es poden classificar (es passen per alt els elements <xsl:sort>). Heu de classificar els nodes quan creeu l'arbre de resultats. "},
-
- /*
- * Note to translators: A name can be given to a particular style to be
- * used to format decimal values. The substitution text gives the name
- * of such a style for which more than one declaration was encountered.
- */
- {ErrorMsg.SYMBOLS_REDEF_ERR,
- "El formatatge decimal ''{0}'' ja est\u00e0 definit."},
-
- /*
- * Note to translators: The stylesheet version named in the
- * substitution text is not supported.
- */
- {ErrorMsg.XSL_VERSION_ERR,
- "XSLTC no d\u00f3na suport a la versi\u00f3 XSL ''{0}''."},
-
- /*
- * Note to translators: The definitions of one or more variables or
- * parameters depend on one another.
- */
- {ErrorMsg.CIRCULAR_VARIABLE_ERR,
- "Hi ha una refer\u00e8ncia de variable/par\u00e0metre circular a ''{0}''."},
-
- /*
- * Note to translators: The operator in an expresion with two operands was
- * not recognized.
- */
- {ErrorMsg.ILLEGAL_BINARY_OP_ERR,
- "L'operador de l'expressi\u00f3 bin\u00e0ria \u00e9s desconegut."},
-
- /*
- * Note to translators: This message is produced if a reference to a
- * function has too many or too few arguments.
- */
- {ErrorMsg.ILLEGAL_ARG_ERR,
- "La crida de funci\u00f3 t\u00e9 arguments no permesos."},
-
- /*
- * Note to translators: "document()" is the name of function and must
- * not be translated. A node-set is a set of the nodes in the tree
- * representation of an XML document.
- */
- {ErrorMsg.DOCUMENT_ARG_ERR,
- "El segon argument de la funci\u00f3 document() ha de ser un conjunt de nodes."},
-
- /*
- * Note to translators: "<xsl:when>" and "<xsl:choose>" are keywords
- * and should not be translated. This message describes a syntax error
- * in the stylesheet.
- */
- {ErrorMsg.MISSING_WHEN_ERR,
- "Es necessita com a m\u00ednim un element <xsl:when> a <xsl:choose>."},
-
- /*
- * Note to translators: "<xsl:otherwise>" and "<xsl:choose>" are
- * keywords and should not be translated. This message describes a
- * syntax error in the stylesheet.
- */
- {ErrorMsg.MULTIPLE_OTHERWISE_ERR,
- "Nom\u00e9s es permet un element <xsl:otherwise> a <xsl:choose>."},
-
- /*
- * Note to translators: "<xsl:otherwise>" and "<xsl:choose>" are
- * keywords and should not be translated. This message describes a
- * syntax error in the stylesheet.
- */
- {ErrorMsg.STRAY_OTHERWISE_ERR,
- "<xsl:otherwise> nom\u00e9s es pot utilitzar dins de <xsl:choose>."},
-
- /*
- * Note to translators: "<xsl:when>" and "<xsl:choose>" are keywords
- * and should not be translated. This message describes a syntax error
- * in the stylesheet.
- */
- {ErrorMsg.STRAY_WHEN_ERR,
- "<xsl:when> nom\u00e9s es pot utilitzar dins de <xsl:choose>."},
-
- /*
- * Note to translators: "<xsl:when>", "<xsl:otherwise>" and
- * "<xsl:choose>" are keywords and should not be translated. This
- * message describes a syntax error in the stylesheet.
- */
- {ErrorMsg.WHEN_ELEMENT_ERR,
- "A <xsl:choose> nom\u00e9s es permeten els elements <xsl:when> i <xsl:otherwise>."},
-
- /*
- * Note to translators: "<xsl:attribute-set>" and "name" are keywords
- * that should not be translated.
- */
- {ErrorMsg.UNNAMED_ATTRIBSET_ERR,
- "L'atribut 'name' falta a <xsl:attribute-set>."},
-
- /*
- * Note to translators: An element in the stylesheet contained an
- * element of a type that it was not permitted to contain.
- */
- {ErrorMsg.ILLEGAL_CHILD_ERR,
- "L'element subordinat no \u00e9s perm\u00e8s."},
-
- /*
- * Note to translators: The stylesheet tried to create an element with
- * a name that was not a valid XML name. The substitution text contains
- * the name.
- */
- {ErrorMsg.ILLEGAL_ELEM_NAME_ERR,
- "No podeu cridar un element ''{0}''"},
-
- /*
- * Note to translators: The stylesheet tried to create an attribute
- * with a name that was not a valid XML name. The substitution text
- * contains the name.
- */
- {ErrorMsg.ILLEGAL_ATTR_NAME_ERR,
- "No podeu cridar un atribut ''{0}''"},
-
- /*
- * Note to translators: The children of the outermost element of a
- * stylesheet are referred to as top-level elements. No text should
- * occur within that outermost element unless it is within a top-level
- * element. This message indicates that that constraint was violated.
- * "<xsl:stylesheet>" is a keyword that should not be translated.
- */
- {ErrorMsg.ILLEGAL_TEXT_NODE_ERR,
- "Hi ha dades fora de l'element de nivell superior <xsl:stylesheet>."},
-
- /*
- * Note to translators: JAXP is an acronym for the Java API for XML
- * Processing. This message indicates that the XML parser provided to
- * XSLTC to process the XML input document had a configuration problem.
- */
- {ErrorMsg.SAX_PARSER_CONFIG_ERR,
- "L'analitzador JAXP no s'ha configurat correctament"},
-
- /*
- * Note to translators: The substitution text names the internal error
- * encountered.
- */
- {ErrorMsg.INTERNAL_ERR,
- "S''ha produ\u00eft un error intern d''XSLTC irrecuperable: ''{0}''"},
-
- /*
- * Note to translators: The stylesheet contained an element that was
- * not recognized as part of the XSL syntax. The substitution text
- * gives the element name.
- */
- {ErrorMsg.UNSUPPORTED_XSL_ERR,
- "L''element d''XSL ''{0}'' no t\u00e9 suport."},
-
- /*
- * Note to translators: The stylesheet referred to an extension to the
- * XSL syntax and indicated that it was defined by XSLTC, but XSTLC does
- * not recognized the particular extension named. The substitution text
- * gives the extension name.
- */
- {ErrorMsg.UNSUPPORTED_EXT_ERR,
- "No es reconeix l''extensi\u00f3 d''XSLTC ''{0}''."},
-
- /*
- * Note to translators: The XML document given to XSLTC as a stylesheet
- * was not, in fact, a stylesheet. XSLTC is able to detect that in this
- * case because the outermost element in the stylesheet has to be
- * declared with respect to the XSL namespace URI, but no declaration
- * for that namespace was seen.
- */
- {ErrorMsg.MISSING_XSLT_URI_ERR,
- "El document d'entrada no \u00e9s un full d'estils (l'espai de noms XSL no s'ha declarat en l'element arrel)."},
-
- /*
- * Note to translators: XSLTC could not find the stylesheet document
- * with the name specified by the substitution text.
- */
- {ErrorMsg.MISSING_XSLT_TARGET_ERR,
- "No s''ha trobat la destinaci\u00f3 ''{0}'' del full d''estils."},
-
- /*
- * Note to translators: access to the stylesheet target is denied
- */
- {ErrorMsg.ACCESSING_XSLT_TARGET_ERR,
- "Could not read stylesheet target ''{0}'', because ''{1}'' access is not allowed."},
-
- /*
- * Note to translators: This message represents an internal error in
- * condition in XSLTC. The substitution text is the class name in XSLTC
- * that is missing some functionality.
- */
- {ErrorMsg.NOT_IMPLEMENTED_ERR,
- "No s''ha implementat ''{0}''."},
-
- /*
- * Note to translators: The XML document given to XSLTC as a stylesheet
- * was not, in fact, a stylesheet.
- */
- {ErrorMsg.NOT_STYLESHEET_ERR,
- "El document d'entrada no cont\u00e9 cap full d'estils XSL."},
-
- /*
- * Note to translators: The element named in the substitution text was
- * encountered in the stylesheet but is not recognized.
- */
- {ErrorMsg.ELEMENT_PARSE_ERR,
- "No s''ha pogut analitzar l''element ''{0}''"},
-
- /*
- * Note to translators: "use", "<key>", "node", "node-set", "string"
- * and "number" are keywords in this context and should not be
- * translated. This message indicates that the value of the "use"
- * attribute was not one of the permitted values.
- */
- {ErrorMsg.KEY_USE_ATTR_ERR,
- "L'atribut use de <key> ha de ser node, node-set, string o number."},
-
- /*
- * Note to translators: An XML document can specify the version of the
- * XML specification to which it adheres. This message indicates that
- * the version specified for the output document was not valid.
- */
- {ErrorMsg.OUTPUT_VERSION_ERR,
- "La versi\u00f3 del document XML de sortida ha de ser 1.0"},
-
- /*
- * Note to translators: The operator in a comparison operation was
- * not recognized.
- */
- {ErrorMsg.ILLEGAL_RELAT_OP_ERR,
- "L'operador de l'expressi\u00f3 relacional \u00e9s desconegut."},
-
- /*
- * Note to translators: An attribute set defines as a set of XML
- * attributes that can be added to an element in the output XML document
- * as a group. This message is reported if the name specified was not
- * used to declare an attribute set. The substitution text is the name
- * that is in error.
- */
- {ErrorMsg.ATTRIBSET_UNDEF_ERR,
- "S''ha intentat utilitzar el conjunt d''atributs ''{0}'' que no existeix."},
-
- /*
- * Note to translators: The term "attribute value template" is a term
- * defined by XSLT which describes the value of an attribute that is
- * determined by an XPath expression. The message indicates that the
- * expression was syntactically incorrect; the substitution text
- * contains the expression that was in error.
- */
- {ErrorMsg.ATTR_VAL_TEMPLATE_ERR,
- "No es pot analitzar la plantilla de valors d''atributs ''{0}''."},
-
- /*
- * Note to translators: ???
- */
- {ErrorMsg.UNKNOWN_SIG_TYPE_ERR,
- "El tipus de dades de la signatura de la classe ''{0}'' \u00e9s desconegut."},
-
- /*
- * Note to translators: The substitution text refers to data types.
- * The message is displayed if a value in a particular context needs to
- * be converted to type {1}, but that's not possible for a value of
- * type {0}.
- */
- {ErrorMsg.DATA_CONVERSION_ERR,
- "No es pot convertir el tipus de dades ''{0}'' en ''{1}''."},
-
- /*
- * Note to translators: "Templates" is a Java class name that should
- * not be translated.
- */
- {ErrorMsg.NO_TRANSLET_CLASS_ERR,
- "Templates no cont\u00e9 cap definici\u00f3 de classe translet."},
-
- /*
- * Note to translators: "Templates" is a Java class name that should
- * not be translated.
- */
- {ErrorMsg.NO_MAIN_TRANSLET_ERR,
- "Templates no cont\u00e9 cap classe amb el nom ''{0}''."},
-
- /*
- * Note to translators: The substitution text is the name of a class.
- */
- {ErrorMsg.TRANSLET_CLASS_ERR,
- "No s''ha pogut carregar la classe translet ''{0}''."},
-
- {ErrorMsg.TRANSLET_OBJECT_ERR,
- "La classe translet s''ha carregat, per\u00f2 no es pot crear la inst\u00e0ncia translet."},
-
- /*
- * Note to translators: "ErrorListener" is a Java interface name that
- * should not be translated. The message indicates that the user tried
- * to set an ErrorListener object on object of the class named in the
- * substitution text with "null" Java value.
- */
- {ErrorMsg.ERROR_LISTENER_NULL_ERR,
- "S''ha intentat establir ErrorListener de ''{0}'' en un valor nul."},
-
- /*
- * Note to translators: StreamSource, SAXSource and DOMSource are Java
- * interface names that should not be translated.
- */
- {ErrorMsg.JAXP_UNKNOWN_SOURCE_ERR,
- "XSLTC nom\u00e9s d\u00f3na suport a StreamSource, SAXSource i DOMSource."},
-
- /*
- * Note to translators: "Source" is a Java class name that should not
- * be translated. The substitution text is the name of Java method.
- */
- {ErrorMsg.JAXP_NO_SOURCE_ERR,
- "L''objecte source donat a ''{0}'' no t\u00e9 contingut."},
-
- /*
- * Note to translators: The message indicates that XSLTC failed to
- * compile the stylesheet into a translet (class file).
- */
- {ErrorMsg.JAXP_COMPILE_ERR,
- "No s'ha pogut compilar el full d'estils."},
-
- /*
- * Note to translators: "TransformerFactory" is a class name. In this
- * context, an attribute is a property or setting of the
- * TransformerFactory object. The substitution text is the name of the
- * unrecognised attribute. The method used to retrieve the attribute is
- * "getAttribute", so it's not clear whether it would be best to
- * translate the term "attribute".
- */
- {ErrorMsg.JAXP_INVALID_ATTR_ERR,
- "TransformerFactory no reconeix l''atribut ''{0}''."},
-
- /*
- * Note to translators: "setResult()" and "startDocument()" are Java
- * method names that should not be translated.
- */
- {ErrorMsg.JAXP_SET_RESULT_ERR,
- "setResult() s'ha de cridar abans de startDocument()."},
-
- /*
- * Note to translators: "Transformer" is a Java interface name that
- * should not be translated. A Transformer object should contained a
- * reference to a translet object in order to be used for
- * transformations; this message is produced if that requirement is not
- * met.
- */
- {ErrorMsg.JAXP_NO_TRANSLET_ERR,
- "Transformer no cont\u00e9 cap objecte translet."},
-
- /*
- * Note to translators: The XML document that results from a
- * transformation needs to be sent to an output handler object; this
- * message is produced if that requirement is not met.
- */
- {ErrorMsg.JAXP_NO_HANDLER_ERR,
- "No s'ha definit cap manejador de sortida per al resultat de transformaci\u00f3."},
-
- /*
- * Note to translators: "Result" is a Java interface name in this
- * context. The substitution text is a method name.
- */
- {ErrorMsg.JAXP_NO_RESULT_ERR,
- "L''objecte result donat a ''{0}'' no \u00e9s v\u00e0lid."},
-
- /*
- * Note to translators: "Transformer" is a Java interface name. The
- * user's program attempted to access an unrecognized property with the
- * name specified in the substitution text. The method used to retrieve
- * the property is "getOutputProperty", so it's not clear whether it
- * would be best to translate the term "property".
- */
- {ErrorMsg.JAXP_UNKNOWN_PROP_ERR,
- "S''ha intentat accedir a una propietat Transformer ''{0}'' no v\u00e0lida."},
-
- /*
- * Note to translators: SAX2DOM is the name of a Java class that should
- * not be translated. This is an adapter in the sense that it takes a
- * DOM object and converts it to something that uses the SAX API.
- */
- {ErrorMsg.SAX2DOM_ADAPTER_ERR,
- "No s''ha pogut crear l''adaptador SAX2DOM ''{0}''."},
-
- /*
- * Note to translators: "XSLTCSource.build()" is a Java method name.
- * "systemId" is an XML term that is short for "system identification".
- */
- {ErrorMsg.XSLTC_SOURCE_ERR,
- "S'ha cridat XSLTCSource.build() sense que s'hagu\u00e9s establert la identificaci\u00f3 del sistema."},
-
-
- {ErrorMsg.COMPILE_STDIN_ERR,
- "L'opci\u00f3 -i s'ha d'utilitzar amb l'opci\u00f3 -o."},
-
-
- /*
- * Note to translators: This message contains usage information for a
- * means of invoking XSLTC from the command-line. The message is
- * formatted for presentation in English. The strings <output>,
- * <directory>, etc. indicate user-specified argument values, and can
- * be translated - the argument <package> refers to a Java package, so
- * it should be handled in the same way the term is handled for JDK
- * documentation.
- */
- {ErrorMsg.COMPILE_USAGE_STR,
- "RESUM\n java com.sun.org.apache.xalan.internal.xsltc.cmdline.Compile [-o <sortida>]\n [-d <directori>] [-j <fitxer_jar>] [-p <paquet>]\n [-n] [-x] [-s] [-u] [-v] [-h] { <full_estils> | -i }\n\nOPCIONS\n -o <sortida> assigna el nom <sortida> al translet\n generat. Per defecte, el nom de translet\n s'obt\u00e9 del nom de <full_estils>. Aquesta opci\u00f3\n no es t\u00e9 en compte si es compilen diversos fulls d'estils.\n -d <directori> especifica un directori de destinaci\u00f3 per al translet\n -j <fitxer_jar> empaqueta les classes translet en un fitxer jar del nom\n especificat com a <fitxer_jar>\n -p <paquet> especifica un prefix de nom de paquet per a totes les classes\n translet generades.\n -n habilita l'inlining (com a mitjana, el funcionament per defecte\n \u00e9s millor).\n -x habilita la sortida de missatges de depuraci\u00f3 addicionals\n -s inhabilita la crida de System.exit\n -u interpreta els arguments <full_estils> com URL\n -i obliga el compilador a llegir el full d'estils des de l'entrada est\u00e0ndard\n -v imprimeix la versi\u00f3 del compilador\n -h imprimeix aquesta sent\u00e8ncia d'\u00fas.\n"},
-
- /*
- * Note to translators: This message contains usage information for a
- * means of invoking XSLTC from the command-line. The message is
- * formatted for presentation in English. The strings <jarfile>,
- * <document>, etc. indicate user-specified argument values, and can
- * be translated - the argument <class> refers to a Java class, so it
- * should be handled in the same way the term is handled for JDK
- * documentation.
- */
- {ErrorMsg.TRANSFORM_USAGE_STR,
- "RESUM \n java com.sun.org.apache.xalan.internal.xsltc.cmdline.Transform [-j <fitxer_jar>]\n [-x] [-s] [-n <iteracions>] {-u <url_document> | <document>}\n <classe> [<par\u00e0m1>=<valor1> ...]\n\n utilitza la <classe> translet per transformar un document XML\n especificat com a <document>. La <classe> translet es troba\n o b\u00e9 a la CLASSPATH de l'usuari o b\u00e9 al <fitxer_jar> que es pot especificar opcionalment.\nOPCIONS\n -j <fitxer_jar> especifica un fitxer jar des del qual es pot carregar el translet\n -x habilita la sortida de missatges de depuraci\u00f3 addicionals\n -s inhabilita la crida de System.exit\n -n <iteracions> executa la transformaci\u00f3 el nombre de vegades <iteracions> i\n mostra informaci\u00f3 de perfil\n -u <url_document> especifica el document d'entrada XML com una URL\n"},
-
-
-
- /*
- * Note to translators: "<xsl:sort>", "<xsl:for-each>" and
- * "<xsl:apply-templates>" are keywords that should not be translated.
- * The message indicates that an xsl:sort element must be a child of
- * one of the other kinds of elements mentioned.
- */
- {ErrorMsg.STRAY_SORT_ERR,
- "<xsl:sort> nom\u00e9s es pot utilitzar amb <xsl:for-each> o <xsl:apply-templates>."},
-
- /*
- * Note to translators: The message indicates that the encoding
- * requested for the output document was on that requires support that
- * is not available from the Java Virtual Machine being used to execute
- * the program.
- */
- {ErrorMsg.UNSUPPORTED_ENCODING,
- "Aquesta JVM no d\u00f3na suport a la codificaci\u00f3 de sortida ''{0}''."},
-
- /*
- * Note to translators: The message indicates that the XPath expression
- * named in the substitution text was not well formed syntactically.
- */
- {ErrorMsg.SYNTAX_ERR,
- "S''ha produ\u00eft un error de sintaxi a ''{0}''."},
-
- /*
- * Note to translators: The substitution text is the name of a Java
- * class. The term "constructor" here is the Java term. The message is
- * displayed if XSLTC could not find a constructor for the specified
- * class.
- */
- {ErrorMsg.CONSTRUCTOR_NOT_FOUND,
- "No s''ha trobat el constructor extern ''{0}''."},
-
- /*
- * Note to translators: "static" is the Java keyword. The substitution
- * text is the name of a function. The first argument of that function
- * is not of the required type.
- */
- {ErrorMsg.NO_JAVA_FUNCT_THIS_REF,
- "El primer argument de la funci\u00f3 Java no static ''{0}'' no \u00e9s una refer\u00e8ncia d''objecte v\u00e0lida."},
-
- /*
- * Note to translators: An XPath expression was not of the type
- * required in a particular context. The substitution text is the
- * expression that was in error.
- */
- {ErrorMsg.TYPE_CHECK_ERR,
- "S''ha produ\u00eft un error en comprovar el tipus de l''expressi\u00f3 ''{0}''."},
-
- /*
- * Note to translators: An XPath expression was not of the type
- * required in a particular context. However, the location of the
- * problematic expression is unknown.
- */
- {ErrorMsg.TYPE_CHECK_UNK_LOC_ERR,
- "S'ha produ\u00eft un error en comprovar el tipus d'expressi\u00f3 en una ubicaci\u00f3 desconeguda."},
-
- /*
- * Note to translators: The substitution text is the name of a command-
- * line option that was not recognized.
- */
- {ErrorMsg.ILLEGAL_CMDLINE_OPTION_ERR,
- "L''opci\u00f3 de l\u00ednia d''ordres ''{0}'' no \u00e9s v\u00e0lida."},
-
- /*
- * Note to translators: The substitution text is the name of a command-
- * line option.
- */
- {ErrorMsg.CMDLINE_OPT_MISSING_ARG_ERR,
- "A l''opci\u00f3 de l\u00ednia d''ordres ''{0}'' li falta un argument obligatori."},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text contains two error
- * messages. The spacing before the second substitution text indents
- * it the same amount as the first in English.
- */
- {ErrorMsg.WARNING_PLUS_WRAPPED_MSG,
- "AV\u00cdS: ''{0}''\n :{1}"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text is an error message.
- */
- {ErrorMsg.WARNING_MSG,
- "AV\u00cdS: ''{0}''"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text contains two error
- * messages. The spacing before the second substitution text indents
- * it the same amount as the first in English.
- */
- {ErrorMsg.FATAL_ERR_PLUS_WRAPPED_MSG,
- "ERROR MOLT GREU: ''{0}''\n :{1}"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text is an error message.
- */
- {ErrorMsg.FATAL_ERR_MSG,
- "ERROR MOLT GREU: ''{0}''"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text contains two error
- * messages. The spacing before the second substitution text indents
- * it the same amount as the first in English.
- */
- {ErrorMsg.ERROR_PLUS_WRAPPED_MSG,
- "ERROR: ''{0}''\n :{1}"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text is an error message.
- */
- {ErrorMsg.ERROR_MSG,
- "ERROR: ''{0}''"},
-
- /*
- * Note to translators: The substitution text is the name of a class.
- */
- {ErrorMsg.TRANSFORM_WITH_TRANSLET_STR,
- "Transformaci\u00f3 mitjan\u00e7ant translet ''{0}'' "},
-
- /*
- * Note to translators: The first substitution is the name of a class,
- * while the second substitution is the name of a jar file.
- */
- {ErrorMsg.TRANSFORM_WITH_JAR_STR,
- "Transformaci\u00f3 mitjan\u00e7ant translet ''{0}'' des del fitxer jar ''{1}''"},
-
- /*
- * Note to translators: "TransformerFactory" is the name of a Java
- * interface and must not be translated. The substitution text is
- * the name of the class that could not be instantiated.
- */
- {ErrorMsg.COULD_NOT_CREATE_TRANS_FACT,
- "No s''ha pogut crear una inst\u00e0ncia de la classe TransformerFactory ''{0}''."},
-
- /*
- * Note to translators: The following message is used as a header.
- * All the error messages are collected together and displayed beneath
- * this message.
- */
- {ErrorMsg.COMPILER_ERROR_KEY,
- "Errors del compilador:"},
-
- /*
- * Note to translators: The following message is used as a header.
- * All the warning messages are collected together and displayed
- * beneath this message.
- */
- {ErrorMsg.COMPILER_WARNING_KEY,
- "Avisos del compilador:"},
-
- /*
- * Note to translators: The following message is used as a header.
- * All the error messages that are produced when the stylesheet is
- * applied to an input document are collected together and displayed
- * beneath this message. A 'translet' is the compiled form of a
- * stylesheet (see above).
- */
- {ErrorMsg.RUNTIME_ERROR_KEY,
- "Errors de translet:"},
-
- {ErrorMsg.JAXP_SECUREPROCESSING_FEATURE,
- "FEATURE_SECURE_PROCESSING: Cannot set the feature to false when security manager is present."}
- };
-
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_cs.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_cs.java
deleted file mode 100644
index f172643..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_cs.java
+++ /dev/null
@@ -1,863 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ErrorMessages_cs.java,v 1.1.6.1 2005/09/05 11:52:59 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-
-import java.util.ListResourceBundle;
-
-/**
- * @author Morten Jorgensen
- */
-public class ErrorMessages_cs extends ListResourceBundle {
-
-/*
- * XSLTC compile-time error messages.
- *
- * General notes to translators and definitions:
- *
- * 1) XSLTC is the name of the product. It is an acronym for "XSLT Compiler".
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An axis is a particular "dimension" in a tree representation of an XML
- * document; the nodes in the tree are divided along different axes.
- * Traversing the "child" axis, for instance, means that the program
- * would visit each child of a particular node; traversing the "descendant"
- * axis means that the program would visit the child nodes of a particular
- * node, their children, and so on until the leaf nodes of the tree are
- * reached.
- *
- * 5) An iterator is an object that traverses nodes in a tree along a
- * particular axis, one at a time.
- *
- * 6) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 7) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 8) DOM is an acronym for Document Object Model. It is a tree
- * representation of an XML document.
- *
- * SAX is an acronym for the Simple API for XML processing. It is an API
- * used inform an XML processor (in this case XSLTC) of the structure and
- * content of an XML document.
- *
- * Input to the stylesheet processor can come from an XML parser in the
- * form of a DOM tree or through the SAX API.
- *
- * 9) DTD is a document type declaration. It is a way of specifying the
- * grammar for an XML file, the names and types of elements, attributes,
- * etc.
- *
- * 10) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- * 11) Translet is an invented term that refers to the class file that contains
- * the compiled form of a stylesheet.
- */
-
- // These message should be read from a locale-specific resource bundle
- /** Get the lookup table for error messages.
- *
- * @return The message lookup table.
- */
- public Object[][] getContents()
- {
- return new Object[][] {
- {ErrorMsg.MULTIPLE_STYLESHEET_ERR,
- "V\u00edce ne\u017e jedna p\u0159edloha stylu je definov\u00e1na ve stejn\u00e9m souboru."},
-
- /*
- * Note to translators: The substitution text is the name of a
- * template. The same name was used on two different templates in the
- * same stylesheet.
- */
- {ErrorMsg.TEMPLATE_REDEF_ERR,
- "\u0160ablona ''{0}'' je ji\u017e v t\u00e9to p\u0159edloze stylu definov\u00e1na."},
-
-
- /*
- * Note to translators: The substitution text is the name of a
- * template. A reference to the template name was encountered, but the
- * template is undefined.
- */
- {ErrorMsg.TEMPLATE_UNDEF_ERR,
- "\u0160ablona ''{0}'' nen\u00ed v t\u00e9to p\u0159edloze stylu definov\u00e1na."},
-
- /*
- * Note to translators: The substitution text is the name of a variable
- * that was defined more than once.
- */
- {ErrorMsg.VARIABLE_REDEF_ERR,
- "Prom\u011bnn\u00e1 ''{0}'' je n\u011bkolikan\u00e1sobn\u011b definov\u00e1na ve stejn\u00e9m oboru."},
-
- /*
- * Note to translators: The substitution text is the name of a variable
- * or parameter. A reference to the variable or parameter was found,
- * but it was never defined.
- */
- {ErrorMsg.VARIABLE_UNDEF_ERR,
- "Prom\u011bnn\u00e1 nebo parametr ''{0}'' nejsou definov\u00e1ny."},
-
- /*
- * Note to translators: The word "class" here refers to a Java class.
- * Processing the stylesheet required a class to be loaded, but it could
- * not be found. The substitution text is the name of the class.
- */
- {ErrorMsg.CLASS_NOT_FOUND_ERR,
- "Nelze naj\u00edt t\u0159\u00eddu ''{0}''."},
-
- /*
- * Note to translators: The word "method" here refers to a Java method.
- * Processing the stylesheet required a reference to the method named by
- * the substitution text, but it could not be found. "public" is the
- * Java keyword.
- */
- {ErrorMsg.METHOD_NOT_FOUND_ERR,
- "Nelze naj\u00edt extern\u00ed metodu ''{0}'' (mus\u00ed b\u00fdt ve\u0159ejn\u00e1)."},
-
- /*
- * Note to translators: The word "method" here refers to a Java method.
- * Processing the stylesheet required a reference to the method named by
- * the substitution text, but no method with the required types of
- * arguments or return type could be found.
- */
- {ErrorMsg.ARGUMENT_CONVERSION_ERR,
- "Nelze p\u0159ev\u00e9st argument/n\u00e1vratov\u00fd typ ve vol\u00e1n\u00ed metody ''{0}''"},
-
- /*
- * Note to translators: The file or URI named in the substitution text
- * is missing.
- */
- {ErrorMsg.FILE_NOT_FOUND_ERR,
- "Soubor nebo URI ''{0}'' nebyl nalezen."},
-
- /*
- * Note to translators: This message is displayed when the URI
- * mentioned in the substitution text is not well-formed syntactically.
- */
- {ErrorMsg.INVALID_URI_ERR,
- "Neplatn\u00e9 URI ''{0}''."},
-
- /*
- * Note to translators: The file or URI named in the substitution text
- * exists but could not be opened.
- */
- {ErrorMsg.FILE_ACCESS_ERR,
- "Nelze otev\u0159\u00edt soubor nebo URI ''{0}''."},
-
- /*
- * Note to translators: <xsl:stylesheet> and <xsl:transform> are
- * keywords that should not be translated.
- */
- {ErrorMsg.MISSING_ROOT_ERR,
- "Byl o\u010dek\u00e1v\u00e1n prvek <xsl:stylesheet> nebo <xsl:transform>."},
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- {ErrorMsg.NAMESPACE_UNDEF_ERR,
- "P\u0159edpona oboru n\u00e1zv\u016f ''{0}'' nen\u00ed deklarov\u00e1na."},
-
- /*
- * Note to translators: The Java function named in the stylesheet could
- * not be found.
- */
- {ErrorMsg.FUNCTION_RESOLVE_ERR,
- "Nelze vy\u0159e\u0161it vol\u00e1n\u00ed funkce ''{0}''."},
-
- /*
- * Note to translators: The substitution text is the name of a
- * function. A literal string here means a constant string value.
- */
- {ErrorMsg.NEED_LITERAL_ERR,
- "Argument pro ''{0}'' mus\u00ed b\u00fdt \u0159et\u011bzcem liter\u00e1lu."},
-
- /*
- * Note to translators: This message indicates there was a syntactic
- * error in the form of an XPath expression. The substitution text is
- * the expression.
- */
- {ErrorMsg.XPATH_PARSER_ERR,
- "Chyba p\u0159i anal\u00fdze v\u00fdrazu XPath ''{0}''."},
-
- /*
- * Note to translators: An element in the stylesheet requires a
- * particular attribute named by the substitution text, but that
- * attribute was not specified in the stylesheet.
- */
- {ErrorMsg.REQUIRED_ATTR_ERR,
- "Po\u017eadovan\u00fd atribut ''{0}'' chyb\u00ed."},
-
- /*
- * Note to translators: This message indicates that a character not
- * permitted in an XPath expression was encountered. The substitution
- * text is the offending character.
- */
- {ErrorMsg.ILLEGAL_CHAR_ERR,
- "Neplatn\u00fd znak ''{0}'' ve v\u00fdrazu XPath."},
-
- /*
- * Note to translators: A processing instruction is a mark-up item in
- * an XML document that request some behaviour of an XML processor. The
- * form of the name of was invalid in this case, and the substitution
- * text is the name.
- */
- {ErrorMsg.ILLEGAL_PI_ERR,
- "Neplatn\u00fd n\u00e1zev ''{0}'' pro zpracov\u00e1n\u00ed instrukce."},
-
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- {ErrorMsg.STRAY_ATTRIBUTE_ERR,
- "Atribut ''{0}'' je vn\u011b prvku."},
-
- /*
- * Note to translators: An attribute that wasn't recognized was
- * specified on an element in the stylesheet. The attribute is named
- * by the substitution
- * text.
- */
- {ErrorMsg.ILLEGAL_ATTRIBUTE_ERR,
- "Neplatn\u00fd atribut ''{0}''."},
-
- /*
- * Note to translators: "import" and "include" are keywords that should
- * not be translated. This messages indicates that the stylesheet
- * named in the substitution text imported or included itself either
- * directly or indirectly.
- */
- {ErrorMsg.CIRCULAR_INCLUDE_ERR,
- "Cyklick\u00fd import/zahrnut\u00ed. P\u0159edloha stylu ''{0}'' je ji\u017e zavedena."},
-
- /*
- * Note to translators: A result-tree fragment is a portion of a
- * resulting XML document represented as a tree. "<xsl:sort>" is a
- * keyword and should not be translated.
- */
- {ErrorMsg.RESULT_TREE_SORT_ERR,
- "Fragmenty stromu v\u00fdsledk\u016f nemohou b\u00fdt \u0159azeny (prvky <xsl:sort> se ignoruj\u00ed). P\u0159i vytv\u00e1\u0159en\u00ed stromu v\u00fdsledk\u016f mus\u00edte se\u0159adit uzly."},
-
- /*
- * Note to translators: A name can be given to a particular style to be
- * used to format decimal values. The substitution text gives the name
- * of such a style for which more than one declaration was encountered.
- */
- {ErrorMsg.SYMBOLS_REDEF_ERR,
- "Desetinn\u00e9 form\u00e1tov\u00e1n\u00ed ''{0}'' je ji\u017e definov\u00e1no."},
-
- /*
- * Note to translators: The stylesheet version named in the
- * substitution text is not supported.
- */
- {ErrorMsg.XSL_VERSION_ERR,
- "Verze XSL ''{0}'' nen\u00ed produktem XSLTC podporov\u00e1na."},
-
- /*
- * Note to translators: The definitions of one or more variables or
- * parameters depend on one another.
- */
- {ErrorMsg.CIRCULAR_VARIABLE_ERR,
- "Cyklick\u00fd odkaz na prom\u011bnnou/parametr v ''{0}''."},
-
- /*
- * Note to translators: The operator in an expresion with two operands was
- * not recognized.
- */
- {ErrorMsg.ILLEGAL_BINARY_OP_ERR,
- "Nezn\u00e1m\u00fd oper\u00e1tor pro bin\u00e1rn\u00ed v\u00fdraz."},
-
- /*
- * Note to translators: This message is produced if a reference to a
- * function has too many or too few arguments.
- */
- {ErrorMsg.ILLEGAL_ARG_ERR,
- "Neplatn\u00fd argument pro vol\u00e1n\u00ed funkce."},
-
- /*
- * Note to translators: "document()" is the name of function and must
- * not be translated. A node-set is a set of the nodes in the tree
- * representation of an XML document.
- */
- {ErrorMsg.DOCUMENT_ARG_ERR,
- "Druh\u00fd argument pro funkci document() mus\u00ed b\u00fdt node-set."},
-
- /*
- * Note to translators: "<xsl:when>" and "<xsl:choose>" are keywords
- * and should not be translated. This message describes a syntax error
- * in the stylesheet.
- */
- {ErrorMsg.MISSING_WHEN_ERR,
- "Alespo\u0148 jeden prvek <xsl:when> se vy\u017eaduje v <xsl:choose>."},
-
- /*
- * Note to translators: "<xsl:otherwise>" and "<xsl:choose>" are
- * keywords and should not be translated. This message describes a
- * syntax error in the stylesheet.
- */
- {ErrorMsg.MULTIPLE_OTHERWISE_ERR,
- "Jen jeden prvek <xsl:otherwise> je povolen v <xsl:choose>."},
-
- /*
- * Note to translators: "<xsl:otherwise>" and "<xsl:choose>" are
- * keywords and should not be translated. This message describes a
- * syntax error in the stylesheet.
- */
- {ErrorMsg.STRAY_OTHERWISE_ERR,
- "Prvek <xsl:otherwise> m\u016f\u017ee b\u00fdt pou\u017eit jen v <xsl:choose>."},
-
- /*
- * Note to translators: "<xsl:when>" and "<xsl:choose>" are keywords
- * and should not be translated. This message describes a syntax error
- * in the stylesheet.
- */
- {ErrorMsg.STRAY_WHEN_ERR,
- "Prvek <xsl:when> m\u016f\u017ee b\u00fdt pou\u017eit jen v <xsl:choose>."},
-
- /*
- * Note to translators: "<xsl:when>", "<xsl:otherwise>" and
- * "<xsl:choose>" are keywords and should not be translated. This
- * message describes a syntax error in the stylesheet.
- */
- {ErrorMsg.WHEN_ELEMENT_ERR,
- "Pouze prvky <xsl:when> a <xsl:otherwise> jsou povoleny v <xsl:choose>."},
-
- /*
- * Note to translators: "<xsl:attribute-set>" and "name" are keywords
- * that should not be translated.
- */
- {ErrorMsg.UNNAMED_ATTRIBSET_ERR,
- "V prvku <xsl:attribute-set> chyb\u00ed atribut 'name'."},
-
- /*
- * Note to translators: An element in the stylesheet contained an
- * element of a type that it was not permitted to contain.
- */
- {ErrorMsg.ILLEGAL_CHILD_ERR,
- "Neplatn\u00fd prvek potomka."},
-
- /*
- * Note to translators: The stylesheet tried to create an element with
- * a name that was not a valid XML name. The substitution text contains
- * the name.
- */
- {ErrorMsg.ILLEGAL_ELEM_NAME_ERR,
- "Nelze volat prvek ''{0}''"},
-
- /*
- * Note to translators: The stylesheet tried to create an attribute
- * with a name that was not a valid XML name. The substitution text
- * contains the name.
- */
- {ErrorMsg.ILLEGAL_ATTR_NAME_ERR,
- "Nelze volat atribut ''{0}''"},
-
- /*
- * Note to translators: The children of the outermost element of a
- * stylesheet are referred to as top-level elements. No text should
- * occur within that outermost element unless it is within a top-level
- * element. This message indicates that that constraint was violated.
- * "<xsl:stylesheet>" is a keyword that should not be translated.
- */
- {ErrorMsg.ILLEGAL_TEXT_NODE_ERR,
- "Textov\u00e1 data jsou vn\u011b prvku nejvy\u0161\u0161\u00ed \u00farovn\u011b <xsl:stylesheet>."},
-
- /*
- * Note to translators: JAXP is an acronym for the Java API for XML
- * Processing. This message indicates that the XML parser provided to
- * XSLTC to process the XML input document had a configuration problem.
- */
- {ErrorMsg.SAX_PARSER_CONFIG_ERR,
- "Analyz\u00e1tor JAXP je nespr\u00e1vn\u011b konfigurov\u00e1n."},
-
- /*
- * Note to translators: The substitution text names the internal error
- * encountered.
- */
- {ErrorMsg.INTERNAL_ERR,
- "Neopraviteln\u00e1 chyba XSLTC-internal: ''{0}''"},
-
- /*
- * Note to translators: The stylesheet contained an element that was
- * not recognized as part of the XSL syntax. The substitution text
- * gives the element name.
- */
- {ErrorMsg.UNSUPPORTED_XSL_ERR,
- "Nepodporovan\u00fd prvek XSL ''{0}''."},
-
- /*
- * Note to translators: The stylesheet referred to an extension to the
- * XSL syntax and indicated that it was defined by XSLTC, but XSTLC does
- * not recognized the particular extension named. The substitution text
- * gives the extension name.
- */
- {ErrorMsg.UNSUPPORTED_EXT_ERR,
- "Nerozpoznan\u00e1 p\u0159\u00edpona XSLTC ''{0}''."},
-
- /*
- * Note to translators: The XML document given to XSLTC as a stylesheet
- * was not, in fact, a stylesheet. XSLTC is able to detect that in this
- * case because the outermost element in the stylesheet has to be
- * declared with respect to the XSL namespace URI, but no declaration
- * for that namespace was seen.
- */
- {ErrorMsg.MISSING_XSLT_URI_ERR,
- "Vstupn\u00ed dokument nen\u00ed p\u0159edloha stylu (obor n\u00e1zv\u016f XSL nen\u00ed deklarov\u00e1n v ko\u0159enov\u00e9m elementu)."},
-
- /*
- * Note to translators: XSLTC could not find the stylesheet document
- * with the name specified by the substitution text.
- */
- {ErrorMsg.MISSING_XSLT_TARGET_ERR,
- "Nelze naj\u00edt c\u00edlovou p\u0159edlohu se stylem ''{0}''."},
-
- /*
- * Note to translators: access to the stylesheet target is denied
- */
- {ErrorMsg.ACCESSING_XSLT_TARGET_ERR,
- "Could not read stylesheet target ''{0}'', because ''{1}'' access is not allowed."},
-
- /*
- * Note to translators: This message represents an internal error in
- * condition in XSLTC. The substitution text is the class name in XSLTC
- * that is missing some functionality.
- */
- {ErrorMsg.NOT_IMPLEMENTED_ERR,
- "Neimplementov\u00e1no: ''{0}''."},
-
- /*
- * Note to translators: The XML document given to XSLTC as a stylesheet
- * was not, in fact, a stylesheet.
- */
- {ErrorMsg.NOT_STYLESHEET_ERR,
- "Vstupn\u00ed dokument neobsahuje p\u0159edlohu stylu XSL."},
-
- /*
- * Note to translators: The element named in the substitution text was
- * encountered in the stylesheet but is not recognized.
- */
- {ErrorMsg.ELEMENT_PARSE_ERR,
- "Nelze analyzovat prvek ''{0}''"},
-
- /*
- * Note to translators: "use", "<key>", "node", "node-set", "string"
- * and "number" are keywords in this context and should not be
- * translated. This message indicates that the value of the "use"
- * attribute was not one of the permitted values.
- */
- {ErrorMsg.KEY_USE_ATTR_ERR,
- "Atribut use prom\u011bnn\u00e9 <key> mus\u00ed b\u00fdt typu node, node-set, string nebo number."},
-
- /*
- * Note to translators: An XML document can specify the version of the
- * XML specification to which it adheres. This message indicates that
- * the version specified for the output document was not valid.
- */
- {ErrorMsg.OUTPUT_VERSION_ERR,
- "V\u00fdstupn\u00ed verze dokumentu XML by m\u011bla b\u00fdt 1.0"},
-
- /*
- * Note to translators: The operator in a comparison operation was
- * not recognized.
- */
- {ErrorMsg.ILLEGAL_RELAT_OP_ERR,
- "Nezn\u00e1m\u00fd oper\u00e1tor pro rela\u010dn\u00ed v\u00fdraz"},
-
- /*
- * Note to translators: An attribute set defines as a set of XML
- * attributes that can be added to an element in the output XML document
- * as a group. This message is reported if the name specified was not
- * used to declare an attribute set. The substitution text is the name
- * that is in error.
- */
- {ErrorMsg.ATTRIBSET_UNDEF_ERR,
- "Pokus pou\u017e\u00edt neexistuj\u00edc\u00ed sadu atribut\u016f ''{0}''."},
-
- /*
- * Note to translators: The term "attribute value template" is a term
- * defined by XSLT which describes the value of an attribute that is
- * determined by an XPath expression. The message indicates that the
- * expression was syntactically incorrect; the substitution text
- * contains the expression that was in error.
- */
- {ErrorMsg.ATTR_VAL_TEMPLATE_ERR,
- "Nelze analyzovat \u0161ablonu hodnoty atributu ''{0}''."},
-
- /*
- * Note to translators: ???
- */
- {ErrorMsg.UNKNOWN_SIG_TYPE_ERR,
- "Nezn\u00e1m\u00fd datov\u00fd typ prom\u011bnn\u00e9 signature pro t\u0159\u00eddu ''{0}''."},
-
- /*
- * Note to translators: The substitution text refers to data types.
- * The message is displayed if a value in a particular context needs to
- * be converted to type {1}, but that's not possible for a value of
- * type {0}.
- */
- {ErrorMsg.DATA_CONVERSION_ERR,
- "Nelze p\u0159ev\u00e9st datov\u00fd typ ''{0}'' na ''{1}''."},
-
- /*
- * Note to translators: "Templates" is a Java class name that should
- * not be translated.
- */
- {ErrorMsg.NO_TRANSLET_CLASS_ERR,
- "Tato \u0161ablona neobsahuje platnou definici t\u0159\u00eddy translet."},
-
- /*
- * Note to translators: "Templates" is a Java class name that should
- * not be translated.
- */
- {ErrorMsg.NO_MAIN_TRANSLET_ERR,
- "Tato \u0161ablona neobsahuje t\u0159\u00eddu se jm\u00e9nem ''{0}''."},
-
- /*
- * Note to translators: The substitution text is the name of a class.
- */
- {ErrorMsg.TRANSLET_CLASS_ERR,
- "Nelze zav\u00e9st t\u0159\u00eddu translet ''{0}''."},
-
- {ErrorMsg.TRANSLET_OBJECT_ERR,
- "T\u0159\u00edda translet byla zavedena, av\u0161ak nelze vytvo\u0159it instanci translet."},
-
- /*
- * Note to translators: "ErrorListener" is a Java interface name that
- * should not be translated. The message indicates that the user tried
- * to set an ErrorListener object on object of the class named in the
- * substitution text with "null" Java value.
- */
- {ErrorMsg.ERROR_LISTENER_NULL_ERR,
- "Pokus nastavit objekt ErrorListener pro ''{0}'' na hodnotu null"},
-
- /*
- * Note to translators: StreamSource, SAXSource and DOMSource are Java
- * interface names that should not be translated.
- */
- {ErrorMsg.JAXP_UNKNOWN_SOURCE_ERR,
- "Pouze prom\u011bnn\u00e9 StreamSource, SAXSource a DOMSource jsou podporov\u00e1ny produktem XSLTC"},
-
- /*
- * Note to translators: "Source" is a Java class name that should not
- * be translated. The substitution text is the name of Java method.
- */
- {ErrorMsg.JAXP_NO_SOURCE_ERR,
- "Zdrojov\u00fd objekt p\u0159edan\u00fd ''{0}'' nem\u00e1 \u017e\u00e1dn\u00fd obsah."},
-
- /*
- * Note to translators: The message indicates that XSLTC failed to
- * compile the stylesheet into a translet (class file).
- */
- {ErrorMsg.JAXP_COMPILE_ERR,
- "Nelze kompilovat p\u0159edlohu se stylem"},
-
- /*
- * Note to translators: "TransformerFactory" is a class name. In this
- * context, an attribute is a property or setting of the
- * TransformerFactory object. The substitution text is the name of the
- * unrecognised attribute. The method used to retrieve the attribute is
- * "getAttribute", so it's not clear whether it would be best to
- * translate the term "attribute".
- */
- {ErrorMsg.JAXP_INVALID_ATTR_ERR,
- "T\u0159\u00edda TransformerFactory nerozpoznala atribut ''{0}''."},
-
- /*
- * Note to translators: "setResult()" and "startDocument()" are Java
- * method names that should not be translated.
- */
- {ErrorMsg.JAXP_SET_RESULT_ERR,
- "Metoda setResult() mus\u00ed b\u00fdt vol\u00e1na p\u0159ed metodou startDocument()."},
-
- /*
- * Note to translators: "Transformer" is a Java interface name that
- * should not be translated. A Transformer object should contained a
- * reference to a translet object in order to be used for
- * transformations; this message is produced if that requirement is not
- * met.
- */
- {ErrorMsg.JAXP_NO_TRANSLET_ERR,
- "Objekt Transformer nem\u00e1 \u017e\u00e1dn\u00fd zapouzd\u0159en\u00fd objekt translet."},
-
- /*
- * Note to translators: The XML document that results from a
- * transformation needs to be sent to an output handler object; this
- * message is produced if that requirement is not met.
- */
- {ErrorMsg.JAXP_NO_HANDLER_ERR,
- "Neexistuje \u017e\u00e1dn\u00fd definovan\u00fd v\u00fdstupn\u00ed obslu\u017en\u00fd program pro v\u00fdsledek transformace."},
-
- /*
- * Note to translators: "Result" is a Java interface name in this
- * context. The substitution text is a method name.
- */
- {ErrorMsg.JAXP_NO_RESULT_ERR,
- "V\u00fdsledn\u00fd objekt p\u0159edan\u00fd ''{0}'' je neplatn\u00fd."},
-
- /*
- * Note to translators: "Transformer" is a Java interface name. The
- * user's program attempted to access an unrecognized property with the
- * name specified in the substitution text. The method used to retrieve
- * the property is "getOutputProperty", so it's not clear whether it
- * would be best to translate the term "property".
- */
- {ErrorMsg.JAXP_UNKNOWN_PROP_ERR,
- "Pokus o p\u0159\u00edstup k neplatn\u00e9 vlastnosti objektu Transformer: ''{0}''."},
-
- /*
- * Note to translators: SAX2DOM is the name of a Java class that should
- * not be translated. This is an adapter in the sense that it takes a
- * DOM object and converts it to something that uses the SAX API.
- */
- {ErrorMsg.SAX2DOM_ADAPTER_ERR,
- "Nelze vytvo\u0159it adapt\u00e9r SAX2DOM: ''{0}''."},
-
- /*
- * Note to translators: "XSLTCSource.build()" is a Java method name.
- * "systemId" is an XML term that is short for "system identification".
- */
- {ErrorMsg.XSLTC_SOURCE_ERR,
- "Byla vol\u00e1na metoda XSLTCSource.build(), ani\u017e by byla nastavena hodnota systemId."},
-
-
- {ErrorMsg.COMPILE_STDIN_ERR,
- "Volba -i mus\u00ed b\u00fdt pou\u017eita s volbou -o."},
-
-
- /*
- * Note to translators: This message contains usage information for a
- * means of invoking XSLTC from the command-line. The message is
- * formatted for presentation in English. The strings <output>,
- * <directory>, etc. indicate user-specified argument values, and can
- * be translated - the argument <package> refers to a Java package, so
- * it should be handled in the same way the term is handled for JDK
- * documentation.
- */
- {ErrorMsg.COMPILE_USAGE_STR,
- "SYNOPSIS\n java com.sun.org.apache.xalan.internal.xsltc.cmdline.Compile [-o <output>]\n [-d <directory>] [-j <jarfile>] [-p <package>]\n [-n] [-x] [-s] [-u] [-v] [-h] { <stylesheet> | -i }\n\nVOLBY\n -o <output> p\u0159i\u0159azuje n\u00e1zev <output> generovan\u00e9mu\n transletu. Standardn\u011b je n\u00e1zev transletu\n p\u0159evzat z n\u00e1zvu <stylesheet>. Tato volba\n se ignoruje, pokud se kompiluj\u00ed n\u00e1sobn\u00e9 p\u0159edlohy styl\u016f.\n -d <directory> ur\u010duje v\u00fdchoz\u00ed adres\u00e1\u0159 pro translet\n -j <jarfile> zabal\u00ed t\u0159\u00eddu transletu do souboru jar\n pojmenovan\u00e9ho jako <jarfile>\n -p <package> ur\u010duje p\u0159edponu n\u00e1zvu bal\u00ed\u010dku pro v\u0161echny generovan\u00e9 \n t\u0159\u00eddy transletu.\n -n povoluje zarovn\u00e1n\u00ed \u0161ablony (v\u00fdchoz\u00ed chov\u00e1n\u00ed je v pr\u016fm\u011bru lep\u0161\u00ed\n .\n -x zapne dal\u0161\u00ed v\u00fdstup zpr\u00e1vy lad\u011bn\u00ed\n -s zak\u00e1\u017ee vol\u00e1n\u00ed System.exit\n -u interpretuje <stylesheet> argumenty jako URL\n -i vynut\u00ed kompil\u00e1tor \u010d\u00edst p\u0159edlohu styl\u016f ze stdin\n -v tiskne verzi kompil\u00e1toru \n -h tiskne v\u00fdpis tohoto pou\u017eit\u00ed \n"},
-
- /*
- * Note to translators: This message contains usage information for a
- * means of invoking XSLTC from the command-line. The message is
- * formatted for presentation in English. The strings <jarfile>,
- * <document>, etc. indicate user-specified argument values, and can
- * be translated - the argument <class> refers to a Java class, so it
- * should be handled in the same way the term is handled for JDK
- * documentation.
- */
- {ErrorMsg.TRANSFORM_USAGE_STR,
- "SYNOPSIS \n java com.sun.org.apache.xalan.internal.xsltc.cmdline.Transform [-j <jarfile>]\n [-x] [-s] [-n <iterations>] {-u <document_url> | <document>}\n <class> [<param1>=<value1> ...]\n\n pou\u017eije translet <class> k transformaci dokumentu XML \n ur\u010den\u00e9ho jako <document>. Translet <class> je bu\u010f v\n v u\u017eivatelsk\u00e9 cest\u011b CLASSPATH nebo ve voliteln\u011b ur\u010den\u00e9m souboru <jarfile>.\nVOLBY\n -j <jarfile> ur\u010duje soubor jarfile, ze kter\u00e9ho se zavede translet\n -x p\u0159evede dal\u0161\u00ed v\u00fdstup zpr\u00e1vy lad\u011bn\u00ed\n -s vypne vol\u00e1n\u00ed System.exit\n -n <iterations> spust\u00ed transformaci <iterations> kr\u00e1t a\n zobraz\u00ed informaci o profilu\n -u <document_url> ur\u010d\u00ed vstupn\u00ed dokument XML jako URL\n"},
-
-
-
- /*
- * Note to translators: "<xsl:sort>", "<xsl:for-each>" and
- * "<xsl:apply-templates>" are keywords that should not be translated.
- * The message indicates that an xsl:sort element must be a child of
- * one of the other kinds of elements mentioned.
- */
- {ErrorMsg.STRAY_SORT_ERR,
- "Prvek <xsl:sort> m\u016f\u017ee b\u00fdt pou\u017eit jen v <xsl:for-each> nebo <xsl:apply-templates>."},
-
- /*
- * Note to translators: The message indicates that the encoding
- * requested for the output document was on that requires support that
- * is not available from the Java Virtual Machine being used to execute
- * the program.
- */
- {ErrorMsg.UNSUPPORTED_ENCODING,
- "V\u00fdstupn\u00ed k\u00f3dov\u00e1n\u00ed ''{0}'' nen\u00ed v tomto prost\u0159ed\u00ed JVM podporov\u00e1no."},
-
- /*
- * Note to translators: The message indicates that the XPath expression
- * named in the substitution text was not well formed syntactically.
- */
- {ErrorMsg.SYNTAX_ERR,
- "Chyba syntaxe v ''{0}''."},
-
- /*
- * Note to translators: The substitution text is the name of a Java
- * class. The term "constructor" here is the Java term. The message is
- * displayed if XSLTC could not find a constructor for the specified
- * class.
- */
- {ErrorMsg.CONSTRUCTOR_NOT_FOUND,
- "Nelze naj\u00edt vn\u011bj\u0161\u00ed konstruktor ''{0}''."},
-
- /*
- * Note to translators: "static" is the Java keyword. The substitution
- * text is the name of a function. The first argument of that function
- * is not of the required type.
- */
- {ErrorMsg.NO_JAVA_FUNCT_THIS_REF,
- "Prvn\u00ed argument nestatick\u00e9 funkce Java ''{0}'' nen\u00ed platn\u00fdm odkazem na objekt."},
-
- /*
- * Note to translators: An XPath expression was not of the type
- * required in a particular context. The substitution text is the
- * expression that was in error.
- */
- {ErrorMsg.TYPE_CHECK_ERR,
- "Chyba p\u0159i kontrole typu v\u00fdrazu ''{0}''."},
-
- /*
- * Note to translators: An XPath expression was not of the type
- * required in a particular context. However, the location of the
- * problematic expression is unknown.
- */
- {ErrorMsg.TYPE_CHECK_UNK_LOC_ERR,
- "Chyba p\u0159i kontrole typu v\u00fdrazu na nezn\u00e1m\u00e9m m\u00edst\u011b."},
-
- /*
- * Note to translators: The substitution text is the name of a command-
- * line option that was not recognized.
- */
- {ErrorMsg.ILLEGAL_CMDLINE_OPTION_ERR,
- "Volba p\u0159\u00edkazov\u00e9ho \u0159\u00e1dku ''{0}'' nen\u00ed platn\u00e1."},
-
- /*
- * Note to translators: The substitution text is the name of a command-
- * line option.
- */
- {ErrorMsg.CMDLINE_OPT_MISSING_ARG_ERR,
- "Volb\u011b p\u0159\u00edkazov\u00e9ho \u0159\u00e1dku ''{0}'' chyb\u00ed po\u017eadovan\u00fd argument."},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text contains two error
- * messages. The spacing before the second substitution text indents
- * it the same amount as the first in English.
- */
- {ErrorMsg.WARNING_PLUS_WRAPPED_MSG,
- "VAROV\u00c1N\u00cd: ''{0}''\n :{1}"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text is an error message.
- */
- {ErrorMsg.WARNING_MSG,
- "VAROV\u00c1N\u00cd: ''{0}''"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text contains two error
- * messages. The spacing before the second substitution text indents
- * it the same amount as the first in English.
- */
- {ErrorMsg.FATAL_ERR_PLUS_WRAPPED_MSG,
- "Z\u00c1VA\u017dN\u00c1 CHYBA: ''{0}''\n :{1}"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text is an error message.
- */
- {ErrorMsg.FATAL_ERR_MSG,
- "Z\u00c1VA\u017dN\u00c1 CHYBA: ''{0}''"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text contains two error
- * messages. The spacing before the second substitution text indents
- * it the same amount as the first in English.
- */
- {ErrorMsg.ERROR_PLUS_WRAPPED_MSG,
- "CHYBA: ''{0}''\n :{1}"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text is an error message.
- */
- {ErrorMsg.ERROR_MSG,
- "CHYBA: ''{0}''"},
-
- /*
- * Note to translators: The substitution text is the name of a class.
- */
- {ErrorMsg.TRANSFORM_WITH_TRANSLET_STR,
- "Transformace pou\u017eit\u00edm transletu ''{0}'' "},
-
- /*
- * Note to translators: The first substitution is the name of a class,
- * while the second substitution is the name of a jar file.
- */
- {ErrorMsg.TRANSFORM_WITH_JAR_STR,
- "Transformace pou\u017eit\u00edm transletu ''{0}'' ze souboru jar ''{1}''"},
-
- /*
- * Note to translators: "TransformerFactory" is the name of a Java
- * interface and must not be translated. The substitution text is
- * the name of the class that could not be instantiated.
- */
- {ErrorMsg.COULD_NOT_CREATE_TRANS_FACT,
- "Nelze vytvo\u0159it instanci t\u0159\u00eddy TransformerFactory ''{0}''."},
-
- /*
- * Note to translators: The following message is used as a header.
- * All the error messages are collected together and displayed beneath
- * this message.
- */
- {ErrorMsg.COMPILER_ERROR_KEY,
- "Chyby kompil\u00e1toru:"},
-
- /*
- * Note to translators: The following message is used as a header.
- * All the warning messages are collected together and displayed
- * beneath this message.
- */
- {ErrorMsg.COMPILER_WARNING_KEY,
- "Varov\u00e1n\u00ed kompil\u00e1toru:"},
-
- /*
- * Note to translators: The following message is used as a header.
- * All the error messages that are produced when the stylesheet is
- * applied to an input document are collected together and displayed
- * beneath this message. A 'translet' is the compiled form of a
- * stylesheet (see above).
- */
- {ErrorMsg.RUNTIME_ERROR_KEY,
- "Chyby transletu:"},
-
- {ErrorMsg.JAXP_SECUREPROCESSING_FEATURE,
- "FEATURE_SECURE_PROCESSING: Cannot set the feature to false when security manager is present."}
- };
-
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_de.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_de.java
deleted file mode 100644
index 9da7059..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_de.java
+++ /dev/null
@@ -1,974 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-
-import java.util.ListResourceBundle;
-
-/**
- * @author Morten Jorgensen
- */
-public class ErrorMessages_de extends ListResourceBundle {
-
-/*
- * XSLTC compile-time error messages.
- *
- * General notes to translators and definitions:
- *
- * 1) XSLTC is the name of the product. It is an acronym for "XSLT Compiler".
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An axis is a particular "dimension" in a tree representation of an XML
- * document; the nodes in the tree are divided along different axes.
- * Traversing the "child" axis, for instance, means that the program
- * would visit each child of a particular node; traversing the "descendant"
- * axis means that the program would visit the child nodes of a particular
- * node, their children, and so on until the leaf nodes of the tree are
- * reached.
- *
- * 5) An iterator is an object that traverses nodes in a tree along a
- * particular axis, one at a time.
- *
- * 6) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 7) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 8) DOM is an acronym for Document Object Model. It is a tree
- * representation of an XML document.
- *
- * SAX is an acronym for the Simple API for XML processing. It is an API
- * used inform an XML processor (in this case XSLTC) of the structure and
- * content of an XML document.
- *
- * Input to the stylesheet processor can come from an XML parser in the
- * form of a DOM tree or through the SAX API.
- *
- * 9) DTD is a document type declaration. It is a way of specifying the
- * grammar for an XML file, the names and types of elements, attributes,
- * etc.
- *
- * 10) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- * 11) Translet is an invented term that refers to the class file that contains
- * the compiled form of a stylesheet.
- */
-
- // These message should be read from a locale-specific resource bundle
- /** Get the lookup table for error messages.
- *
- * @return The message lookup table.
- */
- public Object[][] getContents()
- {
- return new Object[][] {
- {ErrorMsg.MULTIPLE_STYLESHEET_ERR,
- "Mehrere Stylesheets in derselben Datei definiert."},
-
- /*
- * Note to translators: The substitution text is the name of a
- * template. The same name was used on two different templates in the
- * same stylesheet.
- */
- {ErrorMsg.TEMPLATE_REDEF_ERR,
- "Vorlage \"{0}\" bereits in diesem Stylesheet definiert."},
-
-
- /*
- * Note to translators: The substitution text is the name of a
- * template. A reference to the template name was encountered, but the
- * template is undefined.
- */
- {ErrorMsg.TEMPLATE_UNDEF_ERR,
- "Vorlage \"{0}\" nicht in diesem Stylesheet definiert."},
-
- /*
- * Note to translators: The substitution text is the name of a variable
- * that was defined more than once.
- */
- {ErrorMsg.VARIABLE_REDEF_ERR,
- "Variable \"{0}\" ist mehrmals in demselben G\u00FCltigkeitsbereich definiert."},
-
- /*
- * Note to translators: The substitution text is the name of a variable
- * or parameter. A reference to the variable or parameter was found,
- * but it was never defined.
- */
- {ErrorMsg.VARIABLE_UNDEF_ERR,
- "Variable oder Parameter \"{0}\" ist nicht definiert."},
-
- /*
- * Note to translators: The word "class" here refers to a Java class.
- * Processing the stylesheet required a class to be loaded, but it could
- * not be found. The substitution text is the name of the class.
- */
- {ErrorMsg.CLASS_NOT_FOUND_ERR,
- "Klasse \"{0}\" kann nicht gefunden werden."},
-
- /*
- * Note to translators: The word "method" here refers to a Java method.
- * Processing the stylesheet required a reference to the method named by
- * the substitution text, but it could not be found. "public" is the
- * Java keyword.
- */
- {ErrorMsg.METHOD_NOT_FOUND_ERR,
- "Externe Methode \"{0}\" kann nicht gefunden werden (muss \"public\" sein)."},
-
- /*
- * Note to translators: The word "method" here refers to a Java method.
- * Processing the stylesheet required a reference to the method named by
- * the substitution text, but no method with the required types of
- * arguments or return type could be found.
- */
- {ErrorMsg.ARGUMENT_CONVERSION_ERR,
- "Konvertierung von Argument-/R\u00FCckgabetyp in Aufruf von Methode \"{0}\" nicht m\u00F6glich"},
-
- /*
- * Note to translators: The file or URI named in the substitution text
- * is missing.
- */
- {ErrorMsg.FILE_NOT_FOUND_ERR,
- "Datei oder URI \"{0}\" nicht gefunden."},
-
- /*
- * Note to translators: This message is displayed when the URI
- * mentioned in the substitution text is not well-formed syntactically.
- */
- {ErrorMsg.INVALID_URI_ERR,
- "Ung\u00FCltiger URI \"{0}\"."},
-
- /*
- * Note to translators: The file or URI named in the substitution text
- * exists but could not be opened.
- */
- {ErrorMsg.FILE_ACCESS_ERR,
- "Datei oder URI \"{0}\" kann nicht ge\u00F6ffnet werden."},
-
- /*
- * Note to translators: <xsl:stylesheet> and <xsl:transform> are
- * keywords that should not be translated.
- */
- {ErrorMsg.MISSING_ROOT_ERR,
- "<xsl:stylesheet>- oder <xsl:transform>-Element erwartet."},
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- {ErrorMsg.NAMESPACE_UNDEF_ERR,
- "Namespace-Pr\u00E4fix \"{0}\" ist nicht deklariert."},
-
- /*
- * Note to translators: The Java function named in the stylesheet could
- * not be found.
- */
- {ErrorMsg.FUNCTION_RESOLVE_ERR,
- "Aufruf kann nicht in Funktion \"{0}\" aufgel\u00F6st werden."},
-
- /*
- * Note to translators: The substitution text is the name of a
- * function. A literal string here means a constant string value.
- */
- {ErrorMsg.NEED_LITERAL_ERR,
- "Argument f\u00FCr \"{0}\" muss eine literale Zeichenfolge sein."},
-
- /*
- * Note to translators: This message indicates there was a syntactic
- * error in the form of an XPath expression. The substitution text is
- * the expression.
- */
- {ErrorMsg.XPATH_PARSER_ERR,
- "Fehler beim Parsen von XPath-Ausdruck \"{0}\"."},
-
- /*
- * Note to translators: An element in the stylesheet requires a
- * particular attribute named by the substitution text, but that
- * attribute was not specified in the stylesheet.
- */
- {ErrorMsg.REQUIRED_ATTR_ERR,
- "Erforderliches Attribut \"{0}\" fehlt."},
-
- /*
- * Note to translators: This message indicates that a character not
- * permitted in an XPath expression was encountered. The substitution
- * text is the offending character.
- */
- {ErrorMsg.ILLEGAL_CHAR_ERR,
- "Ung\u00FCltiges Zeichen \"{0}\" in XPath-Ausdruck."},
-
- /*
- * Note to translators: A processing instruction is a mark-up item in
- * an XML document that request some behaviour of an XML processor. The
- * form of the name of was invalid in this case, and the substitution
- * text is the name.
- */
- {ErrorMsg.ILLEGAL_PI_ERR,
- "Ung\u00FCltiger Name \"{0}\" f\u00FCr Verarbeitungsanweisung."},
-
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- {ErrorMsg.STRAY_ATTRIBUTE_ERR,
- "Attribut \"{0}\" au\u00DFerhalb des Elements."},
-
- /*
- * Note to translators: An attribute that wasn't recognized was
- * specified on an element in the stylesheet. The attribute is named
- * by the substitution
- * text.
- */
- {ErrorMsg.ILLEGAL_ATTRIBUTE_ERR,
- "Ung\u00FCltiges Attribut \"{0}\"."},
-
- /*
- * Note to translators: "import" and "include" are keywords that should
- * not be translated. This messages indicates that the stylesheet
- * named in the substitution text imported or included itself either
- * directly or indirectly.
- */
- {ErrorMsg.CIRCULAR_INCLUDE_ERR,
- "Zyklisches import/include. Stylesheet \"{0}\" bereits geladen."},
-
- /*
- * Note to translators: A result-tree fragment is a portion of a
- * resulting XML document represented as a tree. "<xsl:sort>" is a
- * keyword and should not be translated.
- */
- {ErrorMsg.RESULT_TREE_SORT_ERR,
- "Ergebnisbaumfragmente k\u00F6nnen nicht sortiert werden (<xsl:sort>-Elemente werden ignoriert). Sie m\u00FCssen die Knoten sortieren, wenn Sie den Ergebnisbaum erstellen."},
-
- /*
- * Note to translators: A name can be given to a particular style to be
- * used to format decimal values. The substitution text gives the name
- * of such a style for which more than one declaration was encountered.
- */
- {ErrorMsg.SYMBOLS_REDEF_ERR,
- "Dezimalformatierung \"{0}\" ist bereits definiert."},
-
- /*
- * Note to translators: The stylesheet version named in the
- * substitution text is not supported.
- */
- {ErrorMsg.XSL_VERSION_ERR,
- "XSL-Version \"{0}\" wird nicht von XSLTC unterst\u00FCtzt."},
-
- /*
- * Note to translators: The definitions of one or more variables or
- * parameters depend on one another.
- */
- {ErrorMsg.CIRCULAR_VARIABLE_ERR,
- "Zyklische Variablen-/Parameterreferenz in \"{0}\"."},
-
- /*
- * Note to translators: The operator in an expresion with two operands was
- * not recognized.
- */
- {ErrorMsg.ILLEGAL_BINARY_OP_ERR,
- "Unbekannter Operator f\u00FCr Bin\u00E4rausdruck."},
-
- /*
- * Note to translators: This message is produced if a reference to a
- * function has too many or too few arguments.
- */
- {ErrorMsg.ILLEGAL_ARG_ERR,
- "Ung\u00FCltige Argumente f\u00FCr Funktionsaufruf."},
-
- /*
- * Note to translators: "document()" is the name of function and must
- * not be translated. A node-set is a set of the nodes in the tree
- * representation of an XML document.
- */
- {ErrorMsg.DOCUMENT_ARG_ERR,
- "Zweites Argument f\u00FCr document()-Funktion muss ein NodeSet sein."},
-
- /*
- * Note to translators: "<xsl:when>" and "<xsl:choose>" are keywords
- * and should not be translated. This message describes a syntax error
- * in the stylesheet.
- */
- {ErrorMsg.MISSING_WHEN_ERR,
- "Mindestens ein <xsl:when>-Element in <xsl:choose> erforderlich."},
-
- /*
- * Note to translators: "<xsl:otherwise>" and "<xsl:choose>" are
- * keywords and should not be translated. This message describes a
- * syntax error in the stylesheet.
- */
- {ErrorMsg.MULTIPLE_OTHERWISE_ERR,
- "Nur ein <xsl:otherwise>-Element in <xsl:choose> zul\u00E4ssig."},
-
- /*
- * Note to translators: "<xsl:otherwise>" and "<xsl:choose>" are
- * keywords and should not be translated. This message describes a
- * syntax error in the stylesheet.
- */
- {ErrorMsg.STRAY_OTHERWISE_ERR,
- "<xsl:otherwise> kann nur in <xsl:choose> verwendet werden."},
-
- /*
- * Note to translators: "<xsl:when>" and "<xsl:choose>" are keywords
- * and should not be translated. This message describes a syntax error
- * in the stylesheet.
- */
- {ErrorMsg.STRAY_WHEN_ERR,
- "<xsl:when> kann nur in <xsl:choose> verwendet werden."},
-
- /*
- * Note to translators: "<xsl:when>", "<xsl:otherwise>" and
- * "<xsl:choose>" are keywords and should not be translated. This
- * message describes a syntax error in the stylesheet.
- */
- {ErrorMsg.WHEN_ELEMENT_ERR,
- "Nur <xsl:when>- und <xsl:otherwise>-Elemente in <xsl:choose> zul\u00E4ssig."},
-
- /*
- * Note to translators: "<xsl:attribute-set>" and "name" are keywords
- * that should not be translated.
- */
- {ErrorMsg.UNNAMED_ATTRIBSET_ERR,
- "Bei <xsl:attribute-set> fehlt das \"name\"-Attribut."},
-
- /*
- * Note to translators: An element in the stylesheet contained an
- * element of a type that it was not permitted to contain.
- */
- {ErrorMsg.ILLEGAL_CHILD_ERR,
- "Ung\u00FCltiges untergeordnetes Element."},
-
- /*
- * Note to translators: The stylesheet tried to create an element with
- * a name that was not a valid XML name. The substitution text contains
- * the name.
- */
- {ErrorMsg.ILLEGAL_ELEM_NAME_ERR,
- "Elemente d\u00FCrfen nicht den Namen \"{0}\" haben"},
-
- /*
- * Note to translators: The stylesheet tried to create an attribute
- * with a name that was not a valid XML name. The substitution text
- * contains the name.
- */
- {ErrorMsg.ILLEGAL_ATTR_NAME_ERR,
- "Attribute d\u00FCrfen nicht den Namen \"{0}\" haben"},
-
- /*
- * Note to translators: The children of the outermost element of a
- * stylesheet are referred to as top-level elements. No text should
- * occur within that outermost element unless it is within a top-level
- * element. This message indicates that that constraint was violated.
- * "<xsl:stylesheet>" is a keyword that should not be translated.
- */
- {ErrorMsg.ILLEGAL_TEXT_NODE_ERR,
- "Textdaten au\u00DFerhalb des <xsl:stylesheet>-Elements der obersten Ebene."},
-
- /*
- * Note to translators: JAXP is an acronym for the Java API for XML
- * Processing. This message indicates that the XML parser provided to
- * XSLTC to process the XML input document had a configuration problem.
- */
- {ErrorMsg.SAX_PARSER_CONFIG_ERR,
- "JAXP-Parser nicht korrekt konfiguriert"},
-
- /*
- * Note to translators: The substitution text names the internal error
- * encountered.
- */
- {ErrorMsg.INTERNAL_ERR,
- "Nicht behebbarer interner XSLTC-Fehler: \"{0}\""},
-
- /*
- * Note to translators: The stylesheet contained an element that was
- * not recognized as part of the XSL syntax. The substitution text
- * gives the element name.
- */
- {ErrorMsg.UNSUPPORTED_XSL_ERR,
- "Nicht unterst\u00FCtztes XSL-Element \"{0}\"."},
-
- /*
- * Note to translators: The stylesheet referred to an extension to the
- * XSL syntax and indicated that it was defined by XSLTC, but XSTLC does
- * not recognized the particular extension named. The substitution text
- * gives the extension name.
- */
- {ErrorMsg.UNSUPPORTED_EXT_ERR,
- "Unbekannte XSLTC-Erweiterung \"{0}\"."},
-
- /*
- * Note to translators: The XML document given to XSLTC as a stylesheet
- * was not, in fact, a stylesheet. XSLTC is able to detect that in this
- * case because the outermost element in the stylesheet has to be
- * declared with respect to the XSL namespace URI, but no declaration
- * for that namespace was seen.
- */
- {ErrorMsg.MISSING_XSLT_URI_ERR,
- "Das Eingabedokument ist kein Stylesheet (der XSL-Namespace ist nicht im Root-Element deklariert)."},
-
- /*
- * Note to translators: XSLTC could not find the stylesheet document
- * with the name specified by the substitution text.
- */
- {ErrorMsg.MISSING_XSLT_TARGET_ERR,
- "Stylesheet-Ziel \"{0}\" konnte nicht gefunden werden."},
-
- /*
- * Note to translators: access to the stylesheet target is denied
- */
- {ErrorMsg.ACCESSING_XSLT_TARGET_ERR,
- "Stylesheet-Ziel \"{0}\" konnte nicht gelesen werden, weil der \"{1}\"-Zugriff wegen einer von der Eigenschaft accessExternalStylesheet festgelegten Einschr\u00E4nkung nicht zul\u00E4ssig ist."},
-
- /*
- * Note to translators: This message represents an internal error in
- * condition in XSLTC. The substitution text is the class name in XSLTC
- * that is missing some functionality.
- */
- {ErrorMsg.NOT_IMPLEMENTED_ERR,
- "Nicht implementiert: \"{0}\"."},
-
- /*
- * Note to translators: The XML document given to XSLTC as a stylesheet
- * was not, in fact, a stylesheet.
- */
- {ErrorMsg.NOT_STYLESHEET_ERR,
- "Das Eingabedokument enth\u00E4lt kein XSL-Stylesheet."},
-
- /*
- * Note to translators: The element named in the substitution text was
- * encountered in the stylesheet but is not recognized.
- */
- {ErrorMsg.ELEMENT_PARSE_ERR,
- "Element \"{0}\" konnte nicht geparst werden"},
-
- /*
- * Note to translators: "use", "<key>", "node", "node-set", "string"
- * and "number" are keywords in this context and should not be
- * translated. This message indicates that the value of the "use"
- * attribute was not one of the permitted values.
- */
- {ErrorMsg.KEY_USE_ATTR_ERR,
- "Das \"use\"-Attribut von <key> muss \"node\", \"node-set\", \"string\" oder \"number\" sein."},
-
- /*
- * Note to translators: An XML document can specify the version of the
- * XML specification to which it adheres. This message indicates that
- * the version specified for the output document was not valid.
- */
- {ErrorMsg.OUTPUT_VERSION_ERR,
- "Ausgabe-XML-Dokumentversion muss 1.0 sein"},
-
- /*
- * Note to translators: The operator in a comparison operation was
- * not recognized.
- */
- {ErrorMsg.ILLEGAL_RELAT_OP_ERR,
- "Unbekannter Operator f\u00FCr Vergleichsausdruck"},
-
- /*
- * Note to translators: An attribute set defines as a set of XML
- * attributes that can be added to an element in the output XML document
- * as a group. This message is reported if the name specified was not
- * used to declare an attribute set. The substitution text is the name
- * that is in error.
- */
- {ErrorMsg.ATTRIBSET_UNDEF_ERR,
- "Versuch, nicht vorhandene Attributgruppe \"{0}\" zu verwenden."},
-
- /*
- * Note to translators: The term "attribute value template" is a term
- * defined by XSLT which describes the value of an attribute that is
- * determined by an XPath expression. The message indicates that the
- * expression was syntactically incorrect; the substitution text
- * contains the expression that was in error.
- */
- {ErrorMsg.ATTR_VAL_TEMPLATE_ERR,
- "Attributwertvorlage \"{0}\" kann nicht geparst werden."},
-
- /*
- * Note to translators: ???
- */
- {ErrorMsg.UNKNOWN_SIG_TYPE_ERR,
- "Unbekannter Datentyp in Signatur f\u00FCr Klasse \"{0}\"."},
-
- /*
- * Note to translators: The substitution text refers to data types.
- * The message is displayed if a value in a particular context needs to
- * be converted to type {1}, but that's not possible for a value of
- * type {0}.
- */
- {ErrorMsg.DATA_CONVERSION_ERR,
- "Datentyp \"{0}\" kann nicht in \"{1}\" konvertiert werden."},
-
- /*
- * Note to translators: "Templates" is a Java class name that should
- * not be translated.
- */
- {ErrorMsg.NO_TRANSLET_CLASS_ERR,
- "Dieses \"Templates\" enth\u00E4lt keine g\u00FCltige Translet-Klassendefinition."},
-
- /*
- * Note to translators: "Templates" is a Java class name that should
- * not be translated.
- */
- {ErrorMsg.NO_MAIN_TRANSLET_ERR,
- "Dieses \"Templates\" enth\u00E4lt keine Klasse mit dem Namen \"{0}\"."},
-
- /*
- * Note to translators: The substitution text is the name of a class.
- */
- {ErrorMsg.TRANSLET_CLASS_ERR,
- "Translet-Klasse \"{0}\" konnte nicht geladen werden."},
-
- {ErrorMsg.TRANSLET_OBJECT_ERR,
- "Translet-Klasse geladen, Translet-Instanz kann aber nicht erstellt werden."},
-
- /*
- * Note to translators: "ErrorListener" is a Java interface name that
- * should not be translated. The message indicates that the user tried
- * to set an ErrorListener object on object of the class named in the
- * substitution text with "null" Java value.
- */
- {ErrorMsg.ERROR_LISTENER_NULL_ERR,
- "Versuch, ErrorListener f\u00FCr \"{0}\" auf null zu setzen"},
-
- /*
- * Note to translators: StreamSource, SAXSource and DOMSource are Java
- * interface names that should not be translated.
- */
- {ErrorMsg.JAXP_UNKNOWN_SOURCE_ERR,
- "Nur StreamSource, SAXSource und DOMSource werden von XSLTC unterst\u00FCtzt"},
-
- /*
- * Note to translators: "Source" is a Java class name that should not
- * be translated. The substitution text is the name of Java method.
- */
- {ErrorMsg.JAXP_NO_SOURCE_ERR,
- "An \"{0}\" \u00FCbergebenes Source-Objekt hat keinen Inhalt."},
-
- /*
- * Note to translators: The message indicates that XSLTC failed to
- * compile the stylesheet into a translet (class file).
- */
- {ErrorMsg.JAXP_COMPILE_ERR,
- "Stylesheet konnte nicht kompiliert werden"},
-
- /*
- * Note to translators: "TransformerFactory" is a class name. In this
- * context, an attribute is a property or setting of the
- * TransformerFactory object. The substitution text is the name of the
- * unrecognised attribute. The method used to retrieve the attribute is
- * "getAttribute", so it's not clear whether it would be best to
- * translate the term "attribute".
- */
- {ErrorMsg.JAXP_INVALID_ATTR_ERR,
- "TransformerFactory erkennt Attribut \"{0}\" nicht."},
-
- {ErrorMsg.JAXP_INVALID_ATTR_VALUE_ERR,
- "Falscher Wert f\u00FCr Attribut \"{0}\" angegeben."},
-
- /*
- * Note to translators: "setResult()" and "startDocument()" are Java
- * method names that should not be translated.
- */
- {ErrorMsg.JAXP_SET_RESULT_ERR,
- "setResult() muss vor startDocument() aufgerufen werden."},
-
- /*
- * Note to translators: "Transformer" is a Java interface name that
- * should not be translated. A Transformer object should contained a
- * reference to a translet object in order to be used for
- * transformations; this message is produced if that requirement is not
- * met.
- */
- {ErrorMsg.JAXP_NO_TRANSLET_ERR,
- "Der Transformer hat kein gekapseltes Translet-Objekt."},
-
- /*
- * Note to translators: The XML document that results from a
- * transformation needs to be sent to an output handler object; this
- * message is produced if that requirement is not met.
- */
- {ErrorMsg.JAXP_NO_HANDLER_ERR,
- "Kein definierter Ausgabe-Handler f\u00FCr Transformationsergebnis."},
-
- /*
- * Note to translators: "Result" is a Java interface name in this
- * context. The substitution text is a method name.
- */
- {ErrorMsg.JAXP_NO_RESULT_ERR,
- "An \"{0}\" \u00FCbergebenes Result-Objekt ist ung\u00FCltig."},
-
- /*
- * Note to translators: "Transformer" is a Java interface name. The
- * user's program attempted to access an unrecognized property with the
- * name specified in the substitution text. The method used to retrieve
- * the property is "getOutputProperty", so it's not clear whether it
- * would be best to translate the term "property".
- */
- {ErrorMsg.JAXP_UNKNOWN_PROP_ERR,
- "Versuch, auf ung\u00FCltige Transformer-Eigenschaft \"{0}\" zuzugreifen."},
-
- /*
- * Note to translators: SAX2DOM is the name of a Java class that should
- * not be translated. This is an adapter in the sense that it takes a
- * DOM object and converts it to something that uses the SAX API.
- */
- {ErrorMsg.SAX2DOM_ADAPTER_ERR,
- "SAX2DOM-Adapter \"{0}\" konnte nicht erstellt werden."},
-
- /*
- * Note to translators: "XSLTCSource.build()" is a Java method name.
- * "systemId" is an XML term that is short for "system identification".
- */
- {ErrorMsg.XSLTC_SOURCE_ERR,
- "XSLTCSource.build() ohne festgelegte systemID aufgerufen."},
-
- { ErrorMsg.ER_RESULT_NULL,
- "Ergebnis darf nicht null sein"},
-
- /*
- * Note to translators: This message indicates that the value argument
- * of setParameter must be a valid Java Object.
- */
- {ErrorMsg.JAXP_INVALID_SET_PARAM_VALUE,
- "Wert von Parameter {0} muss ein g\u00FCltiges Java-Objekt sein"},
-
-
- {ErrorMsg.COMPILE_STDIN_ERR,
- "Die Option \"-i\" muss mit der Option \"-o\" verwendet werden."},
-
-
- /*
- * Note to translators: This message contains usage information for a
- * means of invoking XSLTC from the command-line. The message is
- * formatted for presentation in English. The strings <output>,
- * <directory>, etc. indicate user-specified argument values, and can
- * be translated - the argument <package> refers to a Java package, so
- * it should be handled in the same way the term is handled for JDK
- * documentation.
- */
- {ErrorMsg.COMPILE_USAGE_STR,
- "SYNOPSIS\n java com.sun.org.apache.xalan.internal.xsltc.cmdline.Compile [-o <Ausgabe>]\n [-d <Verzeichnis>] [-j <JAR-Datei>] [-p <Package>]\n [-n] [-x] [-u] [-v] [-h] { <Stylesheet> | -i }\n\nOPTIONS\n -o <Ausgabe> weist den Namen <Ausgabe> dem generierten\n Translet zu. Standardm\u00E4\u00DFig wird der Translet-Name\n vom <Stylesheet>-Namen abgeleitet. Diese Option\n wird ignoriert, wenn mehrere Stylesheets kompiliert werden.\n -d <Verzeichnis> gibt ein Zielverzeichnis f\u00FCr das Translet an\n -j <JAR-Datei> verpackt Translet-Klassen in einer JAR-Datei mit dem\n als <jarfile> angegebenen Namen\n -p <package> gibt ein Packagenamenspr\u00E4fix f\u00FCr alle generierten\n Translet-Klassen an.\n -n aktiviert das Vorlagen-Inlining (Standardverhalten durchschnittlich\n besser).\n -x schaltet die zus\u00E4tzliche Debugging-Meldungsausgabe ein\n -u interpretiert <Stylesheet>-Argumente als URLs\n -i erzwingt, dass der Compiler das Stylesheet aus stdin liest\n -v druckt die Version des Compilers\n -h druckt diese Verwendungsanweisung\n"},
-
- /*
- * Note to translators: This message contains usage information for a
- * means of invoking XSLTC from the command-line. The message is
- * formatted for presentation in English. The strings <jarfile>,
- * <document>, etc. indicate user-specified argument values, and can
- * be translated - the argument <class> refers to a Java class, so it
- * should be handled in the same way the term is handled for JDK
- * documentation.
- */
- {ErrorMsg.TRANSFORM_USAGE_STR,
- "SYNOPSIS \n java com.sun.org.apache.xalan.internal.xsltc.cmdline.Transform [-j <JAR-Datei>]\n [-x] [-n <Iterationen>] {-u <document_url> | <Dokument>}\n <Klasse> [<param1>=<value1> ...]\n\n verwendet die Translet-<Klasse> zur Transformation eines XML-Dokuments, \n das als <Dokument> angegeben wird. Die Translet-<Klasse> befindet sich entweder im\n CLASSPATH des Benutzers oder in der optional angegebenen <JAR-Datei>.\nOPTIONS\n -j <JAR-Datei> gibt eine JAR-Datei an, aus der das Translet geladen werden soll\n -x schaltet die zus\u00E4tzliche Debugging-Meldungsausgabe ein\n -n <Iterationen> f\u00FChrt die Transformation so oft aus, wie in <Iterationen> angegeben und\n zeigt Profilinformationen an\n -u <document_url> gibt das XML-Eingabedokument als URL an\n"},
-
-
-
- /*
- * Note to translators: "<xsl:sort>", "<xsl:for-each>" and
- * "<xsl:apply-templates>" are keywords that should not be translated.
- * The message indicates that an xsl:sort element must be a child of
- * one of the other kinds of elements mentioned.
- */
- {ErrorMsg.STRAY_SORT_ERR,
- "<xsl:sort> kann nur in <xsl:for-each> oder <xsl:apply-templates> verwendet werden."},
-
- /*
- * Note to translators: The message indicates that the encoding
- * requested for the output document was on that requires support that
- * is not available from the Java Virtual Machine being used to execute
- * the program.
- */
- {ErrorMsg.UNSUPPORTED_ENCODING,
- "Ausgabecodierung \"{0}\" wird auf dieser JVM nicht unterst\u00FCtzt."},
-
- /*
- * Note to translators: The message indicates that the XPath expression
- * named in the substitution text was not well formed syntactically.
- */
- {ErrorMsg.SYNTAX_ERR,
- "Syntaxfehler in \"{0}\"."},
-
- /*
- * Note to translators: The substitution text is the name of a Java
- * class. The term "constructor" here is the Java term. The message is
- * displayed if XSLTC could not find a constructor for the specified
- * class.
- */
- {ErrorMsg.CONSTRUCTOR_NOT_FOUND,
- "Externer Constructor \"{0}\" kann nicht gefunden werden."},
-
- /*
- * Note to translators: "static" is the Java keyword. The substitution
- * text is the name of a function. The first argument of that function
- * is not of the required type.
- */
- {ErrorMsg.NO_JAVA_FUNCT_THIS_REF,
- "Das erste Argument f\u00FCr die nicht-\"static\"-Java-Funktion \"{0}\" ist keine g\u00FCltige Objektreferenz."},
-
- /*
- * Note to translators: An XPath expression was not of the type
- * required in a particular context. The substitution text is the
- * expression that was in error.
- */
- {ErrorMsg.TYPE_CHECK_ERR,
- "Fehler beim Pr\u00FCfen des Typs des Ausdrucks \"{0}\"."},
-
- /*
- * Note to translators: An XPath expression was not of the type
- * required in a particular context. However, the location of the
- * problematic expression is unknown.
- */
- {ErrorMsg.TYPE_CHECK_UNK_LOC_ERR,
- "Fehler beim Pr\u00FCfen des Typs eines Ausdrucks an einer unbekannten Stelle."},
-
- /*
- * Note to translators: The substitution text is the name of a command-
- * line option that was not recognized.
- */
- {ErrorMsg.ILLEGAL_CMDLINE_OPTION_ERR,
- "Die Befehlszeilenoption \"{0}\" ist nicht g\u00FCltig."},
-
- /*
- * Note to translators: The substitution text is the name of a command-
- * line option.
- */
- {ErrorMsg.CMDLINE_OPT_MISSING_ARG_ERR,
- "Bei der Befehlszeilenoption \"{0}\" fehlt ein erforderliches Argument."},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text contains two error
- * messages. The spacing before the second substitution text indents
- * it the same amount as the first in English.
- */
- {ErrorMsg.WARNING_PLUS_WRAPPED_MSG,
- "WARNING: ''{0}''\n :{1}"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text is an error message.
- */
- {ErrorMsg.WARNING_MSG,
- "WARNING: ''{0}''"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text contains two error
- * messages. The spacing before the second substitution text indents
- * it the same amount as the first in English.
- */
- {ErrorMsg.FATAL_ERR_PLUS_WRAPPED_MSG,
- "FATAL ERROR: ''{0}''\n :{1}"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text is an error message.
- */
- {ErrorMsg.FATAL_ERR_MSG,
- "FATAL ERROR: ''{0}''"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text contains two error
- * messages. The spacing before the second substitution text indents
- * it the same amount as the first in English.
- */
- {ErrorMsg.ERROR_PLUS_WRAPPED_MSG,
- "ERROR: ''{0}''\n :{1}"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text is an error message.
- */
- {ErrorMsg.ERROR_MSG,
- "ERROR: ''{0}''"},
-
- /*
- * Note to translators: The substitution text is the name of a class.
- */
- {ErrorMsg.TRANSFORM_WITH_TRANSLET_STR,
- "Transformation mit Translet \"{0}\" "},
-
- /*
- * Note to translators: The first substitution is the name of a class,
- * while the second substitution is the name of a jar file.
- */
- {ErrorMsg.TRANSFORM_WITH_JAR_STR,
- "Transformation mit Translet \"{0}\" aus JAR-Datei \"{1}\""},
-
- /*
- * Note to translators: "TransformerFactory" is the name of a Java
- * interface and must not be translated. The substitution text is
- * the name of the class that could not be instantiated.
- */
- {ErrorMsg.COULD_NOT_CREATE_TRANS_FACT,
- "Es konnte keine Instanz der TransformerFactory-Klasse \"{0}\" erstellt werden."},
-
- /*
- * Note to translators: This message is produced when the user
- * specified a name for the translet class that contains characters
- * that are not permitted in a Java class name. The substitution
- * text "{0}" specifies the name the user requested, while "{1}"
- * specifies the name the processor used instead.
- */
- {ErrorMsg.TRANSLET_NAME_JAVA_CONFLICT,
- "Der Name \"{0}\" konnte nicht als Name der Translet-Klasse verwendet werden, da er Zeichen enth\u00E4lt, die nicht im Namen einer Java-Klasse zul\u00E4ssig sind. Der Name \"{1}\" wurde stattdessen verwendet."},
-
- /*
- * Note to translators: The following message is used as a header.
- * All the error messages are collected together and displayed beneath
- * this message.
- */
- {ErrorMsg.COMPILER_ERROR_KEY,
- "Compiler-Fehler:"},
-
- /*
- * Note to translators: The following message is used as a header.
- * All the warning messages are collected together and displayed
- * beneath this message.
- */
- {ErrorMsg.COMPILER_WARNING_KEY,
- "Compiler-Warnungen:"},
-
- /*
- * Note to translators: The following message is used as a header.
- * All the error messages that are produced when the stylesheet is
- * applied to an input document are collected together and displayed
- * beneath this message. A 'translet' is the compiled form of a
- * stylesheet (see above).
- */
- {ErrorMsg.RUNTIME_ERROR_KEY,
- "Translet-Fehler:"},
-
- /*
- * Note to translators: An attribute whose value is constrained to
- * be a "QName" or a list of "QNames" had a value that was incorrect.
- * 'QName' is an XML syntactic term that must not be translated. The
- * substitution text contains the actual value of the attribute.
- */
- {ErrorMsg.INVALID_QNAME_ERR,
- "Ein Attribut, dessen Wert ein QName oder eine durch Leerstellen getrennte Liste mit QNames sein muss, hatte den Wert \"{0}\""},
-
- /*
- * Note to translators: An attribute whose value is required to
- * be an "NCName".
- * 'NCName' is an XML syntactic term that must not be translated. The
- * substitution text contains the actual value of the attribute.
- */
- {ErrorMsg.INVALID_NCNAME_ERR,
- "Ein Attribut, dessen Wert ein NCName sein muss, hatte den Wert \"{0}\""},
-
- /*
- * Note to translators: An attribute with an incorrect value was
- * encountered. The permitted value is one of the literal values
- * "xml", "html" or "text"; it is also permitted to have the form of
- * a QName that is not also an NCName. The terms "method",
- * "xsl:output", "xml", "html" and "text" are keywords that must not
- * be translated. The term "qname-but-not-ncname" is an XML syntactic
- * term. The substitution text contains the actual value of the
- * attribute.
- */
- {ErrorMsg.INVALID_METHOD_IN_OUTPUT,
- "Das \"method\"-Attribut eines <xsl:output>-Elements hatte den Wert \"{0}\". Der Wert muss \"xml\", \"html\", \"text\" oder qname-but-not-ncname sein"},
-
- {ErrorMsg.JAXP_GET_FEATURE_NULL_NAME,
- "Der Featurename darf nicht null in TransformerFactory.getFeature(Zeichenfolgenname) sein."},
-
- {ErrorMsg.JAXP_SET_FEATURE_NULL_NAME,
- "Der Featurename darf nicht null in TransformerFactory.setFeature(Zeichenfolgenname, boolescher Wert) sein."},
-
- {ErrorMsg.JAXP_UNSUPPORTED_FEATURE,
- "Das Feature \"{0}\" kann nicht f\u00FCr diese TransformerFactory festgelegt werden."},
-
- {ErrorMsg.JAXP_SECUREPROCESSING_FEATURE,
- "FEATURE_SECURE_PROCESSING: Feature kann nicht auf \"false\" gesetzt werden, wenn Security Manager vorhanden ist."},
-
- /*
- * Note to translators: This message describes an internal error in the
- * processor. The term "byte code" is a Java technical term for the
- * executable code in a Java method, and "try-catch-finally block"
- * refers to the Java keywords with those names. "Outlined" is a
- * technical term internal to XSLTC and should not be translated.
- */
- {ErrorMsg.OUTLINE_ERR_TRY_CATCH,
- "Interner XSLTC-Fehler: Der generierte Bytecode enth\u00E4lt einen Try-Catch-Finally-Block. Outline nicht m\u00F6glich."},
-
- /*
- * Note to translators: This message describes an internal error in the
- * processor. The terms "OutlineableChunkStart" and
- * "OutlineableChunkEnd" are the names of classes internal to XSLTC and
- * should not be translated. The message indicates that for every
- * "start" there must be a corresponding "end", and vice versa, and
- * that if one of a pair of "start" and "end" appears between another
- * pair of corresponding "start" and "end", then the other half of the
- * pair must also be between that same enclosing pair.
- */
- {ErrorMsg.OUTLINE_ERR_UNBALANCED_MARKERS,
- "Interner XSLTC-Fehler: Die Marker OutlineableChunkStart und OutlineableChunkEnd m\u00FCssen ausgeglichen und ordnungsgem\u00E4\u00DF platziert sein."},
-
- /*
- * Note to translators: This message describes an internal error in the
- * processor. The term "byte code" is a Java technical term for the
- * executable code in a Java method. The "method" that is being
- * referred to is a Java method in a translet that XSLTC is generating
- * in processing a stylesheet. The "instruction" that is being
- * referred to is one of the instrutions in the Java byte code in that
- * method. "Outlined" is a technical term internal to XSLTC and
- * should not be translated.
- */
- {ErrorMsg.OUTLINE_ERR_DELETED_TARGET,
- "Interner XSLTC-Fehler: Eine Anweisung, die Teil eines Bytecodeblocks war, f\u00FCr den ein Outline erstellt wurde, wird nach wie vor in der Originalmethode referenziert."
- },
-
-
- /*
- * Note to translators: This message describes an internal error in the
- * processor. The "method" that is being referred to is a Java method
- * in a translet that XSLTC is generating.
- *
- */
- {ErrorMsg.OUTLINE_ERR_METHOD_TOO_BIG,
- "Interner XSLTC-Fehler: Eine Methode im Translet \u00FCberschreitet die Java Virtual Machine-L\u00E4ngeneinschr\u00E4nkung einer Methode von 64 KB. Ursache hierf\u00FCr sind in der Regel sehr gro\u00DFe Vorlagen in einem Stylesheet. Versuchen Sie, das Stylesheet mit kleineren Vorlagen umzustrukturieren."
- },
-
- {ErrorMsg.DESERIALIZE_TRANSLET_ERR, "Wenn die Java-Sicherheit aktiviert ist, ist die Unterst\u00FCtzung f\u00FCr das Deserialisieren von TemplatesImpl deaktiviert. Dies kann durch Setzen der Systemeigenschaft jdk.xml.enableTemplatesImplDeserialization auf \"True\" au\u00DFer Kraft gesetzt werden."}
-
- };
-
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_es.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_es.java
deleted file mode 100644
index 7b6d1b4..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_es.java
+++ /dev/null
@@ -1,974 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-
-import java.util.ListResourceBundle;
-
-/**
- * @author Morten Jorgensen
- */
-public class ErrorMessages_es extends ListResourceBundle {
-
-/*
- * XSLTC compile-time error messages.
- *
- * General notes to translators and definitions:
- *
- * 1) XSLTC is the name of the product. It is an acronym for "XSLT Compiler".
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An axis is a particular "dimension" in a tree representation of an XML
- * document; the nodes in the tree are divided along different axes.
- * Traversing the "child" axis, for instance, means that the program
- * would visit each child of a particular node; traversing the "descendant"
- * axis means that the program would visit the child nodes of a particular
- * node, their children, and so on until the leaf nodes of the tree are
- * reached.
- *
- * 5) An iterator is an object that traverses nodes in a tree along a
- * particular axis, one at a time.
- *
- * 6) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 7) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 8) DOM is an acronym for Document Object Model. It is a tree
- * representation of an XML document.
- *
- * SAX is an acronym for the Simple API for XML processing. It is an API
- * used inform an XML processor (in this case XSLTC) of the structure and
- * content of an XML document.
- *
- * Input to the stylesheet processor can come from an XML parser in the
- * form of a DOM tree or through the SAX API.
- *
- * 9) DTD is a document type declaration. It is a way of specifying the
- * grammar for an XML file, the names and types of elements, attributes,
- * etc.
- *
- * 10) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- * 11) Translet is an invented term that refers to the class file that contains
- * the compiled form of a stylesheet.
- */
-
- // These message should be read from a locale-specific resource bundle
- /** Get the lookup table for error messages.
- *
- * @return The message lookup table.
- */
- public Object[][] getContents()
- {
- return new Object[][] {
- {ErrorMsg.MULTIPLE_STYLESHEET_ERR,
- "Se ha definido m\u00E1s de una hoja de estilo en el mismo archivo."},
-
- /*
- * Note to translators: The substitution text is the name of a
- * template. The same name was used on two different templates in the
- * same stylesheet.
- */
- {ErrorMsg.TEMPLATE_REDEF_ERR,
- "La plantilla ''{0}'' ya se ha definido en esta hoja de estilo."},
-
-
- /*
- * Note to translators: The substitution text is the name of a
- * template. A reference to the template name was encountered, but the
- * template is undefined.
- */
- {ErrorMsg.TEMPLATE_UNDEF_ERR,
- "La plantilla ''{0}'' no se ha definido en esta hoja de estilo."},
-
- /*
- * Note to translators: The substitution text is the name of a variable
- * that was defined more than once.
- */
- {ErrorMsg.VARIABLE_REDEF_ERR,
- "Se ha definido varias veces la variable ''{0}'' en el mismo \u00E1mbito."},
-
- /*
- * Note to translators: The substitution text is the name of a variable
- * or parameter. A reference to the variable or parameter was found,
- * but it was never defined.
- */
- {ErrorMsg.VARIABLE_UNDEF_ERR,
- "No se ha definido la variable o el par\u00E1metro ''{0}''."},
-
- /*
- * Note to translators: The word "class" here refers to a Java class.
- * Processing the stylesheet required a class to be loaded, but it could
- * not be found. The substitution text is the name of the class.
- */
- {ErrorMsg.CLASS_NOT_FOUND_ERR,
- "No se ha encontrado la clase ''{0}''."},
-
- /*
- * Note to translators: The word "method" here refers to a Java method.
- * Processing the stylesheet required a reference to the method named by
- * the substitution text, but it could not be found. "public" is the
- * Java keyword.
- */
- {ErrorMsg.METHOD_NOT_FOUND_ERR,
- "No se ha encontrado el m\u00E9todo externo ''{0}'' (debe ser p\u00FAblico)."},
-
- /*
- * Note to translators: The word "method" here refers to a Java method.
- * Processing the stylesheet required a reference to the method named by
- * the substitution text, but no method with the required types of
- * arguments or return type could be found.
- */
- {ErrorMsg.ARGUMENT_CONVERSION_ERR,
- "No se puede convertir el tipo de argumento/retorno en la llamada al m\u00E9todo ''{0}''"},
-
- /*
- * Note to translators: The file or URI named in the substitution text
- * is missing.
- */
- {ErrorMsg.FILE_NOT_FOUND_ERR,
- "No se ha encontrado el archivo o URI ''{0}''."},
-
- /*
- * Note to translators: This message is displayed when the URI
- * mentioned in the substitution text is not well-formed syntactically.
- */
- {ErrorMsg.INVALID_URI_ERR,
- "URI ''{0}'' no v\u00E1lido."},
-
- /*
- * Note to translators: The file or URI named in the substitution text
- * exists but could not be opened.
- */
- {ErrorMsg.FILE_ACCESS_ERR,
- "No se puede abrir el archivo o URI ''{0}''."},
-
- /*
- * Note to translators: <xsl:stylesheet> and <xsl:transform> are
- * keywords that should not be translated.
- */
- {ErrorMsg.MISSING_ROOT_ERR,
- "Se esperaba el elemento <xsl:stylesheet> o <xsl:transform>."},
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- {ErrorMsg.NAMESPACE_UNDEF_ERR,
- "No se ha declarado el prefijo de espacio de nombres ''{0}''."},
-
- /*
- * Note to translators: The Java function named in the stylesheet could
- * not be found.
- */
- {ErrorMsg.FUNCTION_RESOLVE_ERR,
- "No se ha podido resolver la llamada a la funci\u00F3n ''{0}''."},
-
- /*
- * Note to translators: The substitution text is the name of a
- * function. A literal string here means a constant string value.
- */
- {ErrorMsg.NEED_LITERAL_ERR,
- "El argumento en ''{0}'' debe ser una cadena literal."},
-
- /*
- * Note to translators: This message indicates there was a syntactic
- * error in the form of an XPath expression. The substitution text is
- * the expression.
- */
- {ErrorMsg.XPATH_PARSER_ERR,
- "Error al analizar la expresi\u00F3n XPath ''{0}''."},
-
- /*
- * Note to translators: An element in the stylesheet requires a
- * particular attribute named by the substitution text, but that
- * attribute was not specified in the stylesheet.
- */
- {ErrorMsg.REQUIRED_ATTR_ERR,
- "Falta el atributo ''{0}'' necesario."},
-
- /*
- * Note to translators: This message indicates that a character not
- * permitted in an XPath expression was encountered. The substitution
- * text is the offending character.
- */
- {ErrorMsg.ILLEGAL_CHAR_ERR,
- "Car\u00E1cter ''{0}'' no permitido en la expresi\u00F3n XPath."},
-
- /*
- * Note to translators: A processing instruction is a mark-up item in
- * an XML document that request some behaviour of an XML processor. The
- * form of the name of was invalid in this case, and the substitution
- * text is the name.
- */
- {ErrorMsg.ILLEGAL_PI_ERR,
- "Nombre ''{0}'' no permitido para la instrucci\u00F3n de procesamiento."},
-
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- {ErrorMsg.STRAY_ATTRIBUTE_ERR,
- "El atributo ''{0}'' est\u00E1 fuera del elemento."},
-
- /*
- * Note to translators: An attribute that wasn't recognized was
- * specified on an element in the stylesheet. The attribute is named
- * by the substitution
- * text.
- */
- {ErrorMsg.ILLEGAL_ATTRIBUTE_ERR,
- "Atributo ''{0}'' no permitido."},
-
- /*
- * Note to translators: "import" and "include" are keywords that should
- * not be translated. This messages indicates that the stylesheet
- * named in the substitution text imported or included itself either
- * directly or indirectly.
- */
- {ErrorMsg.CIRCULAR_INCLUDE_ERR,
- "Import/include circular. La hoja de estilo ''{0}'' ya se ha cargado."},
-
- /*
- * Note to translators: A result-tree fragment is a portion of a
- * resulting XML document represented as a tree. "<xsl:sort>" is a
- * keyword and should not be translated.
- */
- {ErrorMsg.RESULT_TREE_SORT_ERR,
- "Los fragmentos del \u00E1rbol de resultados no se pueden ordenar (los elementos <xsl:sort> se ignoran). Debe ordenar los nodos al crear el \u00E1rbol de resultados."},
-
- /*
- * Note to translators: A name can be given to a particular style to be
- * used to format decimal values. The substitution text gives the name
- * of such a style for which more than one declaration was encountered.
- */
- {ErrorMsg.SYMBOLS_REDEF_ERR,
- "Ya se ha definido el formato decimal ''{0}''."},
-
- /*
- * Note to translators: The stylesheet version named in the
- * substitution text is not supported.
- */
- {ErrorMsg.XSL_VERSION_ERR,
- "La versi\u00F3n XSL ''{0}'' no est\u00E1 soportada por XSLTC."},
-
- /*
- * Note to translators: The definitions of one or more variables or
- * parameters depend on one another.
- */
- {ErrorMsg.CIRCULAR_VARIABLE_ERR,
- "La referencia de variable/par\u00E1metro circular en ''{0}''."},
-
- /*
- * Note to translators: The operator in an expresion with two operands was
- * not recognized.
- */
- {ErrorMsg.ILLEGAL_BINARY_OP_ERR,
- "Operador desconocido para la expresi\u00F3n binaria."},
-
- /*
- * Note to translators: This message is produced if a reference to a
- * function has too many or too few arguments.
- */
- {ErrorMsg.ILLEGAL_ARG_ERR,
- "Argumentos no permitidos para la llamada de funci\u00F3n."},
-
- /*
- * Note to translators: "document()" is the name of function and must
- * not be translated. A node-set is a set of the nodes in the tree
- * representation of an XML document.
- */
- {ErrorMsg.DOCUMENT_ARG_ERR,
- "El segundo argumento en la funci\u00F3n document() debe ser un juego de nodos."},
-
- /*
- * Note to translators: "<xsl:when>" and "<xsl:choose>" are keywords
- * and should not be translated. This message describes a syntax error
- * in the stylesheet.
- */
- {ErrorMsg.MISSING_WHEN_ERR,
- "Se necesita al menos un elemento <xsl:when> en <xsl:choose>."},
-
- /*
- * Note to translators: "<xsl:otherwise>" and "<xsl:choose>" are
- * keywords and should not be translated. This message describes a
- * syntax error in the stylesheet.
- */
- {ErrorMsg.MULTIPLE_OTHERWISE_ERR,
- "S\u00F3lo se permite un elemento <xsl:otherwise> en <xsl:choose>."},
-
- /*
- * Note to translators: "<xsl:otherwise>" and "<xsl:choose>" are
- * keywords and should not be translated. This message describes a
- * syntax error in the stylesheet.
- */
- {ErrorMsg.STRAY_OTHERWISE_ERR,
- "<xsl:otherwise> s\u00F3lo se puede utilizar en <xsl:choose>."},
-
- /*
- * Note to translators: "<xsl:when>" and "<xsl:choose>" are keywords
- * and should not be translated. This message describes a syntax error
- * in the stylesheet.
- */
- {ErrorMsg.STRAY_WHEN_ERR,
- "<xsl:when> s\u00F3lo se puede utilizar en <xsl:choose>."},
-
- /*
- * Note to translators: "<xsl:when>", "<xsl:otherwise>" and
- * "<xsl:choose>" are keywords and should not be translated. This
- * message describes a syntax error in the stylesheet.
- */
- {ErrorMsg.WHEN_ELEMENT_ERR,
- "S\u00F3lo se permiten los elementos <xsl:when> y <xsl:otherwise> en <xsl:choose>."},
-
- /*
- * Note to translators: "<xsl:attribute-set>" and "name" are keywords
- * that should not be translated.
- */
- {ErrorMsg.UNNAMED_ATTRIBSET_ERR,
- "Falta el atributo 'name' en <xsl:attribute-set>"},
-
- /*
- * Note to translators: An element in the stylesheet contained an
- * element of a type that it was not permitted to contain.
- */
- {ErrorMsg.ILLEGAL_CHILD_ERR,
- "Elemento secundario no permitido."},
-
- /*
- * Note to translators: The stylesheet tried to create an element with
- * a name that was not a valid XML name. The substitution text contains
- * the name.
- */
- {ErrorMsg.ILLEGAL_ELEM_NAME_ERR,
- "No se puede llamar ''{0}'' a un elemento"},
-
- /*
- * Note to translators: The stylesheet tried to create an attribute
- * with a name that was not a valid XML name. The substitution text
- * contains the name.
- */
- {ErrorMsg.ILLEGAL_ATTR_NAME_ERR,
- "No se puede llamar ''{0}'' a un atributo"},
-
- /*
- * Note to translators: The children of the outermost element of a
- * stylesheet are referred to as top-level elements. No text should
- * occur within that outermost element unless it is within a top-level
- * element. This message indicates that that constraint was violated.
- * "<xsl:stylesheet>" is a keyword that should not be translated.
- */
- {ErrorMsg.ILLEGAL_TEXT_NODE_ERR,
- "Datos de texto fuera del elemento <xsl:stylesheet> de nivel superior."},
-
- /*
- * Note to translators: JAXP is an acronym for the Java API for XML
- * Processing. This message indicates that the XML parser provided to
- * XSLTC to process the XML input document had a configuration problem.
- */
- {ErrorMsg.SAX_PARSER_CONFIG_ERR,
- "El analizador JAXP no se ha configurado correctamente"},
-
- /*
- * Note to translators: The substitution text names the internal error
- * encountered.
- */
- {ErrorMsg.INTERNAL_ERR,
- "Error interno de XSLTC irrecuperable: ''{0}''"},
-
- /*
- * Note to translators: The stylesheet contained an element that was
- * not recognized as part of the XSL syntax. The substitution text
- * gives the element name.
- */
- {ErrorMsg.UNSUPPORTED_XSL_ERR,
- "Elemento ''{0}'' de XSL no soportado."},
-
- /*
- * Note to translators: The stylesheet referred to an extension to the
- * XSL syntax and indicated that it was defined by XSLTC, but XSTLC does
- * not recognized the particular extension named. The substitution text
- * gives the extension name.
- */
- {ErrorMsg.UNSUPPORTED_EXT_ERR,
- "Extensi\u00F3n ''{0}'' de XSLTC no reconocida."},
-
- /*
- * Note to translators: The XML document given to XSLTC as a stylesheet
- * was not, in fact, a stylesheet. XSLTC is able to detect that in this
- * case because the outermost element in the stylesheet has to be
- * declared with respect to the XSL namespace URI, but no declaration
- * for that namespace was seen.
- */
- {ErrorMsg.MISSING_XSLT_URI_ERR,
- "El documento de entrada no es una hoja de estilo (el espacio de nombres XSL no se ha declarado en el elemento ra\u00EDz)."},
-
- /*
- * Note to translators: XSLTC could not find the stylesheet document
- * with the name specified by the substitution text.
- */
- {ErrorMsg.MISSING_XSLT_TARGET_ERR,
- "No se ha encontrado el destino de hoja de estilo ''{0}''."},
-
- /*
- * Note to translators: access to the stylesheet target is denied
- */
- {ErrorMsg.ACCESSING_XSLT_TARGET_ERR,
- "No se ha podido leer el destino de hoja de estilos ''{0}'', porque no se permite el acceso ''{1}'' debido a una restricci\u00F3n definida por la propiedad accessExternalStylesheet."},
-
- /*
- * Note to translators: This message represents an internal error in
- * condition in XSLTC. The substitution text is the class name in XSLTC
- * that is missing some functionality.
- */
- {ErrorMsg.NOT_IMPLEMENTED_ERR,
- "No implantado: ''{0}''."},
-
- /*
- * Note to translators: The XML document given to XSLTC as a stylesheet
- * was not, in fact, a stylesheet.
- */
- {ErrorMsg.NOT_STYLESHEET_ERR,
- "El documento de entrada no contiene una hoja de estilo XSL."},
-
- /*
- * Note to translators: The element named in the substitution text was
- * encountered in the stylesheet but is not recognized.
- */
- {ErrorMsg.ELEMENT_PARSE_ERR,
- "No se ha podido analizar el elemento ''{0}''"},
-
- /*
- * Note to translators: "use", "<key>", "node", "node-set", "string"
- * and "number" are keywords in this context and should not be
- * translated. This message indicates that the value of the "use"
- * attribute was not one of the permitted values.
- */
- {ErrorMsg.KEY_USE_ATTR_ERR,
- "El atributo use de <key> debe ser node, node-set, string o number."},
-
- /*
- * Note to translators: An XML document can specify the version of the
- * XML specification to which it adheres. This message indicates that
- * the version specified for the output document was not valid.
- */
- {ErrorMsg.OUTPUT_VERSION_ERR,
- "La versi\u00F3n del documento XML de salida debe ser 1.0"},
-
- /*
- * Note to translators: The operator in a comparison operation was
- * not recognized.
- */
- {ErrorMsg.ILLEGAL_RELAT_OP_ERR,
- "Operador desconocido para la expresi\u00F3n relacional"},
-
- /*
- * Note to translators: An attribute set defines as a set of XML
- * attributes that can be added to an element in the output XML document
- * as a group. This message is reported if the name specified was not
- * used to declare an attribute set. The substitution text is the name
- * that is in error.
- */
- {ErrorMsg.ATTRIBSET_UNDEF_ERR,
- "Se est\u00E1 intentando utilizar el juego de atributos ''{0}'' no existente."},
-
- /*
- * Note to translators: The term "attribute value template" is a term
- * defined by XSLT which describes the value of an attribute that is
- * determined by an XPath expression. The message indicates that the
- * expression was syntactically incorrect; the substitution text
- * contains the expression that was in error.
- */
- {ErrorMsg.ATTR_VAL_TEMPLATE_ERR,
- "No se puede analizar la plantilla del valor de atributo ''{0}''."},
-
- /*
- * Note to translators: ???
- */
- {ErrorMsg.UNKNOWN_SIG_TYPE_ERR,
- "Tipo de datos desconocido en la firma para la clase ''{0}''."},
-
- /*
- * Note to translators: The substitution text refers to data types.
- * The message is displayed if a value in a particular context needs to
- * be converted to type {1}, but that's not possible for a value of
- * type {0}.
- */
- {ErrorMsg.DATA_CONVERSION_ERR,
- "No se puede convertir el tipo de datos ''{0}'' en ''{1}''."},
-
- /*
- * Note to translators: "Templates" is a Java class name that should
- * not be translated.
- */
- {ErrorMsg.NO_TRANSLET_CLASS_ERR,
- "Templates no contiene una definici\u00F3n de clase translet."},
-
- /*
- * Note to translators: "Templates" is a Java class name that should
- * not be translated.
- */
- {ErrorMsg.NO_MAIN_TRANSLET_ERR,
- "Templates no contiene una clase con el nombre ''{0}''."},
-
- /*
- * Note to translators: The substitution text is the name of a class.
- */
- {ErrorMsg.TRANSLET_CLASS_ERR,
- "No se ha podido cargar la clase de translet ''{0}''."},
-
- {ErrorMsg.TRANSLET_OBJECT_ERR,
- "La clase de translet se ha cargado, pero no se puede crear una instancia de translet."},
-
- /*
- * Note to translators: "ErrorListener" is a Java interface name that
- * should not be translated. The message indicates that the user tried
- * to set an ErrorListener object on object of the class named in the
- * substitution text with "null" Java value.
- */
- {ErrorMsg.ERROR_LISTENER_NULL_ERR,
- "Intentando definir ErrorListener para ''{0}'' como nulo"},
-
- /*
- * Note to translators: StreamSource, SAXSource and DOMSource are Java
- * interface names that should not be translated.
- */
- {ErrorMsg.JAXP_UNKNOWN_SOURCE_ERR,
- "S\u00F3lo StreamSource, SAXSource y DOMSource est\u00E1n soportados por XSLTC"},
-
- /*
- * Note to translators: "Source" is a Java class name that should not
- * be translated. The substitution text is the name of Java method.
- */
- {ErrorMsg.JAXP_NO_SOURCE_ERR,
- "El objeto Source que se ha transferido a ''{0}'' no tiene contenido."},
-
- /*
- * Note to translators: The message indicates that XSLTC failed to
- * compile the stylesheet into a translet (class file).
- */
- {ErrorMsg.JAXP_COMPILE_ERR,
- "No se ha podido compilar la hoja de estilo"},
-
- /*
- * Note to translators: "TransformerFactory" is a class name. In this
- * context, an attribute is a property or setting of the
- * TransformerFactory object. The substitution text is the name of the
- * unrecognised attribute. The method used to retrieve the attribute is
- * "getAttribute", so it's not clear whether it would be best to
- * translate the term "attribute".
- */
- {ErrorMsg.JAXP_INVALID_ATTR_ERR,
- "TransformerFactory no reconoce el atributo ''{0}''."},
-
- {ErrorMsg.JAXP_INVALID_ATTR_VALUE_ERR,
- "Valor no v\u00E1lido especificado para el atributo ''{0}''."},
-
- /*
- * Note to translators: "setResult()" and "startDocument()" are Java
- * method names that should not be translated.
- */
- {ErrorMsg.JAXP_SET_RESULT_ERR,
- "setResult() debe llamarse antes de startDocument()."},
-
- /*
- * Note to translators: "Transformer" is a Java interface name that
- * should not be translated. A Transformer object should contained a
- * reference to a translet object in order to be used for
- * transformations; this message is produced if that requirement is not
- * met.
- */
- {ErrorMsg.JAXP_NO_TRANSLET_ERR,
- "Transformer no tiene un objeto translet encapsulado."},
-
- /*
- * Note to translators: The XML document that results from a
- * transformation needs to be sent to an output handler object; this
- * message is produced if that requirement is not met.
- */
- {ErrorMsg.JAXP_NO_HANDLER_ERR,
- "No se ha definido el manejador de salida para el resultado de la transformaci\u00F3n."},
-
- /*
- * Note to translators: "Result" is a Java interface name in this
- * context. The substitution text is a method name.
- */
- {ErrorMsg.JAXP_NO_RESULT_ERR,
- "El objeto Result que se ha pasado a ''{0}'' no es v\u00E1lido."},
-
- /*
- * Note to translators: "Transformer" is a Java interface name. The
- * user's program attempted to access an unrecognized property with the
- * name specified in the substitution text. The method used to retrieve
- * the property is "getOutputProperty", so it's not clear whether it
- * would be best to translate the term "property".
- */
- {ErrorMsg.JAXP_UNKNOWN_PROP_ERR,
- "Se est\u00E1 intentando acceder a la propiedad ''{0}'' de Transformer no v\u00E1lida."},
-
- /*
- * Note to translators: SAX2DOM is the name of a Java class that should
- * not be translated. This is an adapter in the sense that it takes a
- * DOM object and converts it to something that uses the SAX API.
- */
- {ErrorMsg.SAX2DOM_ADAPTER_ERR,
- "No se ha podido crear el adaptador SAX2DOM: ''{0}''."},
-
- /*
- * Note to translators: "XSLTCSource.build()" is a Java method name.
- * "systemId" is an XML term that is short for "system identification".
- */
- {ErrorMsg.XSLTC_SOURCE_ERR,
- "Se ha llamado a XSLTCSource.build() sin haber definido la identificaci\u00F3n del sistema."},
-
- { ErrorMsg.ER_RESULT_NULL,
- "El resultado no debe ser nulo"},
-
- /*
- * Note to translators: This message indicates that the value argument
- * of setParameter must be a valid Java Object.
- */
- {ErrorMsg.JAXP_INVALID_SET_PARAM_VALUE,
- "El valor del par\u00E1metro {0} debe ser un objeto Java v\u00E1lido"},
-
-
- {ErrorMsg.COMPILE_STDIN_ERR,
- "La opci\u00F3n -i debe utilizarse con la opci\u00F3n -o."},
-
-
- /*
- * Note to translators: This message contains usage information for a
- * means of invoking XSLTC from the command-line. The message is
- * formatted for presentation in English. The strings <output>,
- * <directory>, etc. indicate user-specified argument values, and can
- * be translated - the argument <package> refers to a Java package, so
- * it should be handled in the same way the term is handled for JDK
- * documentation.
- */
- {ErrorMsg.COMPILE_USAGE_STR,
- "SINOPSIS\n java com.sun.org.apache.xalan.internal.xsltc.cmdline.Compile [-o <salida>]\n [-d <directorio>] [-j <archivo jar>] [-p <paquete>]\n [-n] [-x] [-u] [-v] [-h] { <hoja de estilo> | -i }\n\nOPCIONES\n -o <salida> asigna el nombre de <salida> al translet\n generado. Por defecto, el nombre del translet se\n deriva del nombre de <hoja de estilo>. Esta opci\u00F3n\n se ignora si se compilan varias hojas de estilo.\n -d <directorio> especifica un directorio de destino para el translet\n -j <archivo jar> empaqueta las clases de translet en un archivo jar del\n nombre especificado como <archivo jar>\n -p <paquete> especifica un prefijo de nombre de paquete para todas las clases de translet n\n generadas.\n -n permite poner en l\u00EDnea la plantilla (comportamiento por defecto mejor\n sobre la media).\n -x activa la salida del mensaje de depuraci\u00F3n\n -u interpreta los argumentos <hoja de estilo> como URL\n -i obliga al compilador a leer la hoja de estilo de stdin\n -v imprime la versi\u00F3n del compilador\n -h imprime esta sentencia de uso\n"},
-
- /*
- * Note to translators: This message contains usage information for a
- * means of invoking XSLTC from the command-line. The message is
- * formatted for presentation in English. The strings <jarfile>,
- * <document>, etc. indicate user-specified argument values, and can
- * be translated - the argument <class> refers to a Java class, so it
- * should be handled in the same way the term is handled for JDK
- * documentation.
- */
- {ErrorMsg.TRANSFORM_USAGE_STR,
- "SYNOPSIS \n java com.sun.org.apache.xalan.internal.xsltc.cmdline.Transform [-j <archivo jar>]\n [-x] [-n <iteraciones>] {-u <url_documento> | <documento>}\n <clase> [<par\u00E1metro1>=<valor1> ...]\n\n utiliza el translet <clase> para transformar un documento XML \n especificado como <documento>. El translet <clase> se encuentra en\n la CLASSPATH del usuario o en el <archivo jar> especificado opcionalmente.\nOPCIONES\n -j <archivo jar> especifica un archivo jar desde el que cargar el translet\n -x activa la salida del mensaje de depuraci\u00F3n adicional\n -n <iteraciones> ejecuta el n\u00FAmero de <iteraciones> de una transformaci\u00F3n y\n muestra la informaci\u00F3n de la creaci\u00F3n de perfil\n -u <url_documento> especifica el documento de entrada XML como una URL\n"},
-
-
-
- /*
- * Note to translators: "<xsl:sort>", "<xsl:for-each>" and
- * "<xsl:apply-templates>" are keywords that should not be translated.
- * The message indicates that an xsl:sort element must be a child of
- * one of the other kinds of elements mentioned.
- */
- {ErrorMsg.STRAY_SORT_ERR,
- "<xsl:sort> s\u00F3lo se puede utilizar en <xsl:for-each> o <xsl:apply-templates>."},
-
- /*
- * Note to translators: The message indicates that the encoding
- * requested for the output document was on that requires support that
- * is not available from the Java Virtual Machine being used to execute
- * the program.
- */
- {ErrorMsg.UNSUPPORTED_ENCODING,
- "La codificaci\u00F3n de salida ''{0}'' no est\u00E1 soportada en esta JVM."},
-
- /*
- * Note to translators: The message indicates that the XPath expression
- * named in the substitution text was not well formed syntactically.
- */
- {ErrorMsg.SYNTAX_ERR,
- "Error de sintaxis en ''{0}''."},
-
- /*
- * Note to translators: The substitution text is the name of a Java
- * class. The term "constructor" here is the Java term. The message is
- * displayed if XSLTC could not find a constructor for the specified
- * class.
- */
- {ErrorMsg.CONSTRUCTOR_NOT_FOUND,
- "No se ha encontrado el constructor externo ''{0}''."},
-
- /*
- * Note to translators: "static" is the Java keyword. The substitution
- * text is the name of a function. The first argument of that function
- * is not of the required type.
- */
- {ErrorMsg.NO_JAVA_FUNCT_THIS_REF,
- "El primer argumento de la funci\u00F3n Java no est\u00E1tica ''{0}'' no es una referencia de objeto v\u00E1lida."},
-
- /*
- * Note to translators: An XPath expression was not of the type
- * required in a particular context. The substitution text is the
- * expression that was in error.
- */
- {ErrorMsg.TYPE_CHECK_ERR,
- "Error al comprobar el tipo de la expresi\u00F3n ''{0}''."},
-
- /*
- * Note to translators: An XPath expression was not of the type
- * required in a particular context. However, the location of the
- * problematic expression is unknown.
- */
- {ErrorMsg.TYPE_CHECK_UNK_LOC_ERR,
- "Error al comprobar el tipo de una expresi\u00F3n en una ubicaci\u00F3n desconocida."},
-
- /*
- * Note to translators: The substitution text is the name of a command-
- * line option that was not recognized.
- */
- {ErrorMsg.ILLEGAL_CMDLINE_OPTION_ERR,
- "La opci\u00F3n de l\u00EDnea de comandos ''{0}'' no es v\u00E1lida."},
-
- /*
- * Note to translators: The substitution text is the name of a command-
- * line option.
- */
- {ErrorMsg.CMDLINE_OPT_MISSING_ARG_ERR,
- "Falta un argumento necesario en la opci\u00F3n de l\u00EDnea de comandos ''{0}''."},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text contains two error
- * messages. The spacing before the second substitution text indents
- * it the same amount as the first in English.
- */
- {ErrorMsg.WARNING_PLUS_WRAPPED_MSG,
- "WARNING: ''{0}''\n :{1}"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text is an error message.
- */
- {ErrorMsg.WARNING_MSG,
- "WARNING: ''{0}''"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text contains two error
- * messages. The spacing before the second substitution text indents
- * it the same amount as the first in English.
- */
- {ErrorMsg.FATAL_ERR_PLUS_WRAPPED_MSG,
- "FATAL ERROR: ''{0}''\n :{1}"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text is an error message.
- */
- {ErrorMsg.FATAL_ERR_MSG,
- "FATAL ERROR: ''{0}''"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text contains two error
- * messages. The spacing before the second substitution text indents
- * it the same amount as the first in English.
- */
- {ErrorMsg.ERROR_PLUS_WRAPPED_MSG,
- "ERROR: ''{0}''\n :{1}"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text is an error message.
- */
- {ErrorMsg.ERROR_MSG,
- "ERROR: ''{0}''"},
-
- /*
- * Note to translators: The substitution text is the name of a class.
- */
- {ErrorMsg.TRANSFORM_WITH_TRANSLET_STR,
- "Transformaci\u00F3n que utiliza el translet ''{0}'' "},
-
- /*
- * Note to translators: The first substitution is the name of a class,
- * while the second substitution is the name of a jar file.
- */
- {ErrorMsg.TRANSFORM_WITH_JAR_STR,
- "Transformaci\u00F3n que utiliza el translet ''{0}'' del archivo jar ''{1}''"},
-
- /*
- * Note to translators: "TransformerFactory" is the name of a Java
- * interface and must not be translated. The substitution text is
- * the name of the class that could not be instantiated.
- */
- {ErrorMsg.COULD_NOT_CREATE_TRANS_FACT,
- "No se ha podido crear una instancia de la clase TransformerFactory ''{0}''."},
-
- /*
- * Note to translators: This message is produced when the user
- * specified a name for the translet class that contains characters
- * that are not permitted in a Java class name. The substitution
- * text "{0}" specifies the name the user requested, while "{1}"
- * specifies the name the processor used instead.
- */
- {ErrorMsg.TRANSLET_NAME_JAVA_CONFLICT,
- "El nombre ''{0}'' no se ha podido utilizar como el nombre de la clase de translet porque contiene caracteres que no est\u00E1n permitidos en el nombre de la clase Java. Se ha utilizado el nombre ''{1}'' en su lugar."},
-
- /*
- * Note to translators: The following message is used as a header.
- * All the error messages are collected together and displayed beneath
- * this message.
- */
- {ErrorMsg.COMPILER_ERROR_KEY,
- "Errores del compilador:"},
-
- /*
- * Note to translators: The following message is used as a header.
- * All the warning messages are collected together and displayed
- * beneath this message.
- */
- {ErrorMsg.COMPILER_WARNING_KEY,
- "Advertencias del compilador:"},
-
- /*
- * Note to translators: The following message is used as a header.
- * All the error messages that are produced when the stylesheet is
- * applied to an input document are collected together and displayed
- * beneath this message. A 'translet' is the compiled form of a
- * stylesheet (see above).
- */
- {ErrorMsg.RUNTIME_ERROR_KEY,
- "Errores del translet:"},
-
- /*
- * Note to translators: An attribute whose value is constrained to
- * be a "QName" or a list of "QNames" had a value that was incorrect.
- * 'QName' is an XML syntactic term that must not be translated. The
- * substitution text contains the actual value of the attribute.
- */
- {ErrorMsg.INVALID_QNAME_ERR,
- "Un atributo cuyo valor debe ser un QName o lista de QNames separados por espacios en blanco ten\u00EDa el valor ''{0}''"},
-
- /*
- * Note to translators: An attribute whose value is required to
- * be an "NCName".
- * 'NCName' is an XML syntactic term that must not be translated. The
- * substitution text contains the actual value of the attribute.
- */
- {ErrorMsg.INVALID_NCNAME_ERR,
- "Un atributo cuyo valor debe ser un NCName ten\u00EDa el valor ''{0}''"},
-
- /*
- * Note to translators: An attribute with an incorrect value was
- * encountered. The permitted value is one of the literal values
- * "xml", "html" or "text"; it is also permitted to have the form of
- * a QName that is not also an NCName. The terms "method",
- * "xsl:output", "xml", "html" and "text" are keywords that must not
- * be translated. The term "qname-but-not-ncname" is an XML syntactic
- * term. The substitution text contains the actual value of the
- * attribute.
- */
- {ErrorMsg.INVALID_METHOD_IN_OUTPUT,
- "El atributo method de un elemento <xsl:output> ten\u00EDa el valor ''{0}''. El valor debe ser ''xml'', ''html'', ''text'' o qname-but-not-ncname"},
-
- {ErrorMsg.JAXP_GET_FEATURE_NULL_NAME,
- "El nombre de funci\u00F3n no puede ser nulo en TransformerFactory.getFeature (nombre de cadena)."},
-
- {ErrorMsg.JAXP_SET_FEATURE_NULL_NAME,
- "El nombre de funci\u00F3n no puede ser nulo en TransformerFactory.setFeature (nombre de cadena, valor booleano)."},
-
- {ErrorMsg.JAXP_UNSUPPORTED_FEATURE,
- "No se puede definir la funci\u00F3n ''{0}''en esta f\u00E1brica del transformador."},
-
- {ErrorMsg.JAXP_SECUREPROCESSING_FEATURE,
- "FEATURE_SECURE_PROCESSING: no se puede definir la funci\u00F3n en false cuando est\u00E1 presente el gestor de seguridad."},
-
- /*
- * Note to translators: This message describes an internal error in the
- * processor. The term "byte code" is a Java technical term for the
- * executable code in a Java method, and "try-catch-finally block"
- * refers to the Java keywords with those names. "Outlined" is a
- * technical term internal to XSLTC and should not be translated.
- */
- {ErrorMsg.OUTLINE_ERR_TRY_CATCH,
- "Error interno de XSLTC: el c\u00F3digo de bytes generado contiene un bloque try-catch-finally y no se puede delimitar."},
-
- /*
- * Note to translators: This message describes an internal error in the
- * processor. The terms "OutlineableChunkStart" and
- * "OutlineableChunkEnd" are the names of classes internal to XSLTC and
- * should not be translated. The message indicates that for every
- * "start" there must be a corresponding "end", and vice versa, and
- * that if one of a pair of "start" and "end" appears between another
- * pair of corresponding "start" and "end", then the other half of the
- * pair must also be between that same enclosing pair.
- */
- {ErrorMsg.OUTLINE_ERR_UNBALANCED_MARKERS,
- "Error interno de XSLTC: los marcadores OutlineableChunkStart y OutlineableChunkEnd deben estar equilibrados y correctamente anidados."},
-
- /*
- * Note to translators: This message describes an internal error in the
- * processor. The term "byte code" is a Java technical term for the
- * executable code in a Java method. The "method" that is being
- * referred to is a Java method in a translet that XSLTC is generating
- * in processing a stylesheet. The "instruction" that is being
- * referred to is one of the instrutions in the Java byte code in that
- * method. "Outlined" is a technical term internal to XSLTC and
- * should not be translated.
- */
- {ErrorMsg.OUTLINE_ERR_DELETED_TARGET,
- "Error interno de XSLTC: todav\u00EDa se hace referencia a una instrucci\u00F3n que formaba parte de un bloque de c\u00F3digo de bytes delimitado en el m\u00E9todo original."
- },
-
-
- /*
- * Note to translators: This message describes an internal error in the
- * processor. The "method" that is being referred to is a Java method
- * in a translet that XSLTC is generating.
- *
- */
- {ErrorMsg.OUTLINE_ERR_METHOD_TOO_BIG,
- "Error interno de XSLTC: un m\u00E9todo en el translet excede la limitaci\u00F3n de Java Virtual Machine de longitud de un m\u00E9todo de 64 kilobytes. Normalmente, esto lo causan plantillas en una hoja de estilos demasiado grandes. Pruebe a reestructurar la hoja de estilos para utilizar plantillas m\u00E1s peque\u00F1as."
- },
-
- {ErrorMsg.DESERIALIZE_TRANSLET_ERR, "Cuando la seguridad de Java est\u00E1 activada, el soporte para anular la serializaci\u00F3n de TemplatesImpl est\u00E1 desactivado. Esto se puede sustituir definiendo la propiedad del sistema jdk.xml.enableTemplatesImplDeserialization en true."}
-
- };
-
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_fr.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_fr.java
deleted file mode 100644
index dd3149a..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_fr.java
+++ /dev/null
@@ -1,974 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-
-import java.util.ListResourceBundle;
-
-/**
- * @author Morten Jorgensen
- */
-public class ErrorMessages_fr extends ListResourceBundle {
-
-/*
- * XSLTC compile-time error messages.
- *
- * General notes to translators and definitions:
- *
- * 1) XSLTC is the name of the product. It is an acronym for "XSLT Compiler".
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An axis is a particular "dimension" in a tree representation of an XML
- * document; the nodes in the tree are divided along different axes.
- * Traversing the "child" axis, for instance, means that the program
- * would visit each child of a particular node; traversing the "descendant"
- * axis means that the program would visit the child nodes of a particular
- * node, their children, and so on until the leaf nodes of the tree are
- * reached.
- *
- * 5) An iterator is an object that traverses nodes in a tree along a
- * particular axis, one at a time.
- *
- * 6) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 7) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 8) DOM is an acronym for Document Object Model. It is a tree
- * representation of an XML document.
- *
- * SAX is an acronym for the Simple API for XML processing. It is an API
- * used inform an XML processor (in this case XSLTC) of the structure and
- * content of an XML document.
- *
- * Input to the stylesheet processor can come from an XML parser in the
- * form of a DOM tree or through the SAX API.
- *
- * 9) DTD is a document type declaration. It is a way of specifying the
- * grammar for an XML file, the names and types of elements, attributes,
- * etc.
- *
- * 10) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- * 11) Translet is an invented term that refers to the class file that contains
- * the compiled form of a stylesheet.
- */
-
- // These message should be read from a locale-specific resource bundle
- /** Get the lookup table for error messages.
- *
- * @return The message lookup table.
- */
- public Object[][] getContents()
- {
- return new Object[][] {
- {ErrorMsg.MULTIPLE_STYLESHEET_ERR,
- "Plusieurs feuilles de style d\u00E9finies dans le m\u00EAme fichier."},
-
- /*
- * Note to translators: The substitution text is the name of a
- * template. The same name was used on two different templates in the
- * same stylesheet.
- */
- {ErrorMsg.TEMPLATE_REDEF_ERR,
- "Mod\u00E8le ''{0}'' d\u00E9j\u00E0 d\u00E9fini dans cette feuille de style."},
-
-
- /*
- * Note to translators: The substitution text is the name of a
- * template. A reference to the template name was encountered, but the
- * template is undefined.
- */
- {ErrorMsg.TEMPLATE_UNDEF_ERR,
- "Mod\u00E8le ''{0}'' non d\u00E9fini dans cette feuille de style."},
-
- /*
- * Note to translators: The substitution text is the name of a variable
- * that was defined more than once.
- */
- {ErrorMsg.VARIABLE_REDEF_ERR,
- "Plusieurs variables ''{0}'' d\u00E9finies dans la m\u00EAme port\u00E9e."},
-
- /*
- * Note to translators: The substitution text is the name of a variable
- * or parameter. A reference to the variable or parameter was found,
- * but it was never defined.
- */
- {ErrorMsg.VARIABLE_UNDEF_ERR,
- "La variable ou le param\u00E8tre ''{0}'' n''est pas d\u00E9fini."},
-
- /*
- * Note to translators: The word "class" here refers to a Java class.
- * Processing the stylesheet required a class to be loaded, but it could
- * not be found. The substitution text is the name of the class.
- */
- {ErrorMsg.CLASS_NOT_FOUND_ERR,
- "Impossible de trouver la classe ''{0}''."},
-
- /*
- * Note to translators: The word "method" here refers to a Java method.
- * Processing the stylesheet required a reference to the method named by
- * the substitution text, but it could not be found. "public" is the
- * Java keyword.
- */
- {ErrorMsg.METHOD_NOT_FOUND_ERR,
- "M\u00E9thode externe ''{0}'' introuvable (elle doit \u00EAtre \"public\")."},
-
- /*
- * Note to translators: The word "method" here refers to a Java method.
- * Processing the stylesheet required a reference to the method named by
- * the substitution text, but no method with the required types of
- * arguments or return type could be found.
- */
- {ErrorMsg.ARGUMENT_CONVERSION_ERR,
- "Impossible de convertir le type de retour/d''argument dans l''appel de la m\u00E9thode ''{0}''"},
-
- /*
- * Note to translators: The file or URI named in the substitution text
- * is missing.
- */
- {ErrorMsg.FILE_NOT_FOUND_ERR,
- "Fichier ou URI ''{0}'' introuvable."},
-
- /*
- * Note to translators: This message is displayed when the URI
- * mentioned in the substitution text is not well-formed syntactically.
- */
- {ErrorMsg.INVALID_URI_ERR,
- "URI ''{0}'' non valide."},
-
- /*
- * Note to translators: The file or URI named in the substitution text
- * exists but could not be opened.
- */
- {ErrorMsg.FILE_ACCESS_ERR,
- "Impossible d''ouvrir le fichier ou l''URI ''{0}''."},
-
- /*
- * Note to translators: <xsl:stylesheet> and <xsl:transform> are
- * keywords that should not be translated.
- */
- {ErrorMsg.MISSING_ROOT_ERR,
- "El\u00E9ment <xsl:stylesheet> ou <xsl:transform> attendu."},
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- {ErrorMsg.NAMESPACE_UNDEF_ERR,
- "Le pr\u00E9fixe de l''espace de noms ''{0}'' n''a pas \u00E9t\u00E9 d\u00E9clar\u00E9."},
-
- /*
- * Note to translators: The Java function named in the stylesheet could
- * not be found.
- */
- {ErrorMsg.FUNCTION_RESOLVE_ERR,
- "Impossible de r\u00E9soudre l''appel de la fonction ''{0}''."},
-
- /*
- * Note to translators: The substitution text is the name of a
- * function. A literal string here means a constant string value.
- */
- {ErrorMsg.NEED_LITERAL_ERR,
- "L''argument pour ''{0}'' doit \u00EAtre une cha\u00EEne litt\u00E9rale."},
-
- /*
- * Note to translators: This message indicates there was a syntactic
- * error in the form of an XPath expression. The substitution text is
- * the expression.
- */
- {ErrorMsg.XPATH_PARSER_ERR,
- "Erreur lors de l''analyse de l''expression XPath ''{0}''."},
-
- /*
- * Note to translators: An element in the stylesheet requires a
- * particular attribute named by the substitution text, but that
- * attribute was not specified in the stylesheet.
- */
- {ErrorMsg.REQUIRED_ATTR_ERR,
- "Attribut ''{0}'' obligatoire manquant."},
-
- /*
- * Note to translators: This message indicates that a character not
- * permitted in an XPath expression was encountered. The substitution
- * text is the offending character.
- */
- {ErrorMsg.ILLEGAL_CHAR_ERR,
- "Caract\u00E8re ''{0}'' non admis dans l''expression XPath."},
-
- /*
- * Note to translators: A processing instruction is a mark-up item in
- * an XML document that request some behaviour of an XML processor. The
- * form of the name of was invalid in this case, and the substitution
- * text is the name.
- */
- {ErrorMsg.ILLEGAL_PI_ERR,
- "Nom ''{0}'' non admis pour l''instruction de traitement."},
-
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- {ErrorMsg.STRAY_ATTRIBUTE_ERR,
- "Attribut ''{0}'' \u00E0 l''ext\u00E9rieur de l''\u00E9l\u00E9ment."},
-
- /*
- * Note to translators: An attribute that wasn't recognized was
- * specified on an element in the stylesheet. The attribute is named
- * by the substitution
- * text.
- */
- {ErrorMsg.ILLEGAL_ATTRIBUTE_ERR,
- "Attribut ''{0}'' non admis."},
-
- /*
- * Note to translators: "import" and "include" are keywords that should
- * not be translated. This messages indicates that the stylesheet
- * named in the substitution text imported or included itself either
- * directly or indirectly.
- */
- {ErrorMsg.CIRCULAR_INCLUDE_ERR,
- "Op\u00E9ration import/include circulaire. La feuille de style ''{0}'' est d\u00E9j\u00E0 charg\u00E9e."},
-
- /*
- * Note to translators: A result-tree fragment is a portion of a
- * resulting XML document represented as a tree. "<xsl:sort>" is a
- * keyword and should not be translated.
- */
- {ErrorMsg.RESULT_TREE_SORT_ERR,
- "Les fragments de l'arborescence de r\u00E9sultats ne peuvent pas \u00EAtre tri\u00E9s (les \u00E9l\u00E9ments <xsl:sort> ne sont pas pris en compte). Vous devez trier les noeuds lorsque vous cr\u00E9ez l'arborescence de r\u00E9sultats."},
-
- /*
- * Note to translators: A name can be given to a particular style to be
- * used to format decimal values. The substitution text gives the name
- * of such a style for which more than one declaration was encountered.
- */
- {ErrorMsg.SYMBOLS_REDEF_ERR,
- "Le formatage d\u00E9cimal ''{0}'' est d\u00E9j\u00E0 d\u00E9fini."},
-
- /*
- * Note to translators: The stylesheet version named in the
- * substitution text is not supported.
- */
- {ErrorMsg.XSL_VERSION_ERR,
- "La version XSL ''{0}'' n''est pas prise en charge par XSLTC."},
-
- /*
- * Note to translators: The definitions of one or more variables or
- * parameters depend on one another.
- */
- {ErrorMsg.CIRCULAR_VARIABLE_ERR,
- "R\u00E9f\u00E9rence de param\u00E8tre/variable circulaire dans ''{0}''."},
-
- /*
- * Note to translators: The operator in an expresion with two operands was
- * not recognized.
- */
- {ErrorMsg.ILLEGAL_BINARY_OP_ERR,
- "Op\u00E9rateur inconnu pour l'expression binaire."},
-
- /*
- * Note to translators: This message is produced if a reference to a
- * function has too many or too few arguments.
- */
- {ErrorMsg.ILLEGAL_ARG_ERR,
- "Arguments non admis pour l'appel de la fonction."},
-
- /*
- * Note to translators: "document()" is the name of function and must
- * not be translated. A node-set is a set of the nodes in the tree
- * representation of an XML document.
- */
- {ErrorMsg.DOCUMENT_ARG_ERR,
- "Le deuxi\u00E8me argument de la fonction document() doit \u00EAtre un jeu de noeuds."},
-
- /*
- * Note to translators: "<xsl:when>" and "<xsl:choose>" are keywords
- * and should not be translated. This message describes a syntax error
- * in the stylesheet.
- */
- {ErrorMsg.MISSING_WHEN_ERR,
- "Au moins un \u00E9l\u00E9ment <xsl:when> est obligatoire dans <xsl:choose>."},
-
- /*
- * Note to translators: "<xsl:otherwise>" and "<xsl:choose>" are
- * keywords and should not be translated. This message describes a
- * syntax error in the stylesheet.
- */
- {ErrorMsg.MULTIPLE_OTHERWISE_ERR,
- "Un seul \u00E9l\u00E9ment <xsl:otherwise> est autoris\u00E9 dans <xsl:choose>."},
-
- /*
- * Note to translators: "<xsl:otherwise>" and "<xsl:choose>" are
- * keywords and should not be translated. This message describes a
- * syntax error in the stylesheet.
- */
- {ErrorMsg.STRAY_OTHERWISE_ERR,
- "<xsl:otherwise> ne peut \u00EAtre utilis\u00E9 que dans <xsl:choose>."},
-
- /*
- * Note to translators: "<xsl:when>" and "<xsl:choose>" are keywords
- * and should not be translated. This message describes a syntax error
- * in the stylesheet.
- */
- {ErrorMsg.STRAY_WHEN_ERR,
- "<xsl:when> ne peut \u00EAtre utilis\u00E9 que dans <xsl:choose>."},
-
- /*
- * Note to translators: "<xsl:when>", "<xsl:otherwise>" and
- * "<xsl:choose>" are keywords and should not be translated. This
- * message describes a syntax error in the stylesheet.
- */
- {ErrorMsg.WHEN_ELEMENT_ERR,
- "Seuls les \u00E9l\u00E9ments <xsl:when> et <xsl:otherwise> sont autoris\u00E9s dans <xsl:choose>."},
-
- /*
- * Note to translators: "<xsl:attribute-set>" and "name" are keywords
- * that should not be translated.
- */
- {ErrorMsg.UNNAMED_ATTRIBSET_ERR,
- "Attribut \"name\" manquant dans <xsl:attribute-set>."},
-
- /*
- * Note to translators: An element in the stylesheet contained an
- * element of a type that it was not permitted to contain.
- */
- {ErrorMsg.ILLEGAL_CHILD_ERR,
- "El\u00E9ment enfant non admis."},
-
- /*
- * Note to translators: The stylesheet tried to create an element with
- * a name that was not a valid XML name. The substitution text contains
- * the name.
- */
- {ErrorMsg.ILLEGAL_ELEM_NAME_ERR,
- "Vous ne pouvez pas appeler un \u00E9l\u00E9ment ''{0}''"},
-
- /*
- * Note to translators: The stylesheet tried to create an attribute
- * with a name that was not a valid XML name. The substitution text
- * contains the name.
- */
- {ErrorMsg.ILLEGAL_ATTR_NAME_ERR,
- "Vous ne pouvez pas appeler un attribut ''{0}''"},
-
- /*
- * Note to translators: The children of the outermost element of a
- * stylesheet are referred to as top-level elements. No text should
- * occur within that outermost element unless it is within a top-level
- * element. This message indicates that that constraint was violated.
- * "<xsl:stylesheet>" is a keyword that should not be translated.
- */
- {ErrorMsg.ILLEGAL_TEXT_NODE_ERR,
- "Donn\u00E9es texte en dehors de l'\u00E9l\u00E9ment <xsl:stylesheet> de niveau sup\u00E9rieur."},
-
- /*
- * Note to translators: JAXP is an acronym for the Java API for XML
- * Processing. This message indicates that the XML parser provided to
- * XSLTC to process the XML input document had a configuration problem.
- */
- {ErrorMsg.SAX_PARSER_CONFIG_ERR,
- "L'analyseur JAXP n'est pas configur\u00E9 correctement"},
-
- /*
- * Note to translators: The substitution text names the internal error
- * encountered.
- */
- {ErrorMsg.INTERNAL_ERR,
- "Erreur interne XSLTC irr\u00E9cup\u00E9rable : ''{0}''"},
-
- /*
- * Note to translators: The stylesheet contained an element that was
- * not recognized as part of the XSL syntax. The substitution text
- * gives the element name.
- */
- {ErrorMsg.UNSUPPORTED_XSL_ERR,
- "El\u00E9ment ''{0}'' XSL non pris en charge."},
-
- /*
- * Note to translators: The stylesheet referred to an extension to the
- * XSL syntax and indicated that it was defined by XSLTC, but XSTLC does
- * not recognized the particular extension named. The substitution text
- * gives the extension name.
- */
- {ErrorMsg.UNSUPPORTED_EXT_ERR,
- "Extension ''{0}'' XSLTC non reconnue."},
-
- /*
- * Note to translators: The XML document given to XSLTC as a stylesheet
- * was not, in fact, a stylesheet. XSLTC is able to detect that in this
- * case because the outermost element in the stylesheet has to be
- * declared with respect to the XSL namespace URI, but no declaration
- * for that namespace was seen.
- */
- {ErrorMsg.MISSING_XSLT_URI_ERR,
- "Le document d'entr\u00E9e n'est pas une feuille de style (l'espace de noms XSL n'est pas d\u00E9clar\u00E9 dans l'\u00E9l\u00E9ment racine)."},
-
- /*
- * Note to translators: XSLTC could not find the stylesheet document
- * with the name specified by the substitution text.
- */
- {ErrorMsg.MISSING_XSLT_TARGET_ERR,
- "Cible de feuille de style ''{0}'' introuvable."},
-
- /*
- * Note to translators: access to the stylesheet target is denied
- */
- {ErrorMsg.ACCESSING_XSLT_TARGET_ERR,
- "Impossible de lire la cible de feuille de style ''{0}'' car l''acc\u00E8s \u00E0 ''{1}'' n''est pas autoris\u00E9 en raison d''une restriction d\u00E9finie par la propri\u00E9t\u00E9 accessExternalStylesheet."},
-
- /*
- * Note to translators: This message represents an internal error in
- * condition in XSLTC. The substitution text is the class name in XSLTC
- * that is missing some functionality.
- */
- {ErrorMsg.NOT_IMPLEMENTED_ERR,
- "Non impl\u00E9ment\u00E9 : ''{0}''."},
-
- /*
- * Note to translators: The XML document given to XSLTC as a stylesheet
- * was not, in fact, a stylesheet.
- */
- {ErrorMsg.NOT_STYLESHEET_ERR,
- "Le document d'entr\u00E9e ne contient pas de feuille de style XSL."},
-
- /*
- * Note to translators: The element named in the substitution text was
- * encountered in the stylesheet but is not recognized.
- */
- {ErrorMsg.ELEMENT_PARSE_ERR,
- "Impossible d''analyser l''\u00E9l\u00E9ment ''{0}''"},
-
- /*
- * Note to translators: "use", "<key>", "node", "node-set", "string"
- * and "number" are keywords in this context and should not be
- * translated. This message indicates that the value of the "use"
- * attribute was not one of the permitted values.
- */
- {ErrorMsg.KEY_USE_ATTR_ERR,
- "L'attribut \"use\" de <key> doit \u00EAtre node, node-set, string ou number."},
-
- /*
- * Note to translators: An XML document can specify the version of the
- * XML specification to which it adheres. This message indicates that
- * the version specified for the output document was not valid.
- */
- {ErrorMsg.OUTPUT_VERSION_ERR,
- "La version du document XML de sortie doit \u00EAtre 1.0"},
-
- /*
- * Note to translators: The operator in a comparison operation was
- * not recognized.
- */
- {ErrorMsg.ILLEGAL_RELAT_OP_ERR,
- "Op\u00E9rateur inconnu pour l'expression relationnelle"},
-
- /*
- * Note to translators: An attribute set defines as a set of XML
- * attributes that can be added to an element in the output XML document
- * as a group. This message is reported if the name specified was not
- * used to declare an attribute set. The substitution text is the name
- * that is in error.
- */
- {ErrorMsg.ATTRIBSET_UNDEF_ERR,
- "Tentative d''utilisation de l''ensemble d''attributs non existant ''{0}''."},
-
- /*
- * Note to translators: The term "attribute value template" is a term
- * defined by XSLT which describes the value of an attribute that is
- * determined by an XPath expression. The message indicates that the
- * expression was syntactically incorrect; the substitution text
- * contains the expression that was in error.
- */
- {ErrorMsg.ATTR_VAL_TEMPLATE_ERR,
- "Impossible d''analyser le mod\u00E8le de valeur d''attribut ''{0}''."},
-
- /*
- * Note to translators: ???
- */
- {ErrorMsg.UNKNOWN_SIG_TYPE_ERR,
- "Type de donn\u00E9es inconnu dans la signature pour la classe ''{0}''."},
-
- /*
- * Note to translators: The substitution text refers to data types.
- * The message is displayed if a value in a particular context needs to
- * be converted to type {1}, but that's not possible for a value of
- * type {0}.
- */
- {ErrorMsg.DATA_CONVERSION_ERR,
- "Impossible de convertir le type de donn\u00E9es ''{0}'' en ''{1}''."},
-
- /*
- * Note to translators: "Templates" is a Java class name that should
- * not be translated.
- */
- {ErrorMsg.NO_TRANSLET_CLASS_ERR,
- "Cette classe Templates ne contient pas de d\u00E9finition de classe de translet valide."},
-
- /*
- * Note to translators: "Templates" is a Java class name that should
- * not be translated.
- */
- {ErrorMsg.NO_MAIN_TRANSLET_ERR,
- "Cette classe Termplates ne contient pas de classe portant le nom ''{0}''."},
-
- /*
- * Note to translators: The substitution text is the name of a class.
- */
- {ErrorMsg.TRANSLET_CLASS_ERR,
- "Impossible de charger la classe de translet ''{0}''."},
-
- {ErrorMsg.TRANSLET_OBJECT_ERR,
- "Classe de translet charg\u00E9e, mais impossible de cr\u00E9er une instance de translet."},
-
- /*
- * Note to translators: "ErrorListener" is a Java interface name that
- * should not be translated. The message indicates that the user tried
- * to set an ErrorListener object on object of the class named in the
- * substitution text with "null" Java value.
- */
- {ErrorMsg.ERROR_LISTENER_NULL_ERR,
- "Tentative de d\u00E9finition d''ErrorListener sur NULL pour ''{0}''"},
-
- /*
- * Note to translators: StreamSource, SAXSource and DOMSource are Java
- * interface names that should not be translated.
- */
- {ErrorMsg.JAXP_UNKNOWN_SOURCE_ERR,
- "Seuls StreamSource, SAXSource et DOMSource sont pris en charge par XSLTC"},
-
- /*
- * Note to translators: "Source" is a Java class name that should not
- * be translated. The substitution text is the name of Java method.
- */
- {ErrorMsg.JAXP_NO_SOURCE_ERR,
- "L''objet Source transmis \u00E0 ''{0}'' n''a pas de contenu."},
-
- /*
- * Note to translators: The message indicates that XSLTC failed to
- * compile the stylesheet into a translet (class file).
- */
- {ErrorMsg.JAXP_COMPILE_ERR,
- "Impossible de compiler la feuille de style"},
-
- /*
- * Note to translators: "TransformerFactory" is a class name. In this
- * context, an attribute is a property or setting of the
- * TransformerFactory object. The substitution text is the name of the
- * unrecognised attribute. The method used to retrieve the attribute is
- * "getAttribute", so it's not clear whether it would be best to
- * translate the term "attribute".
- */
- {ErrorMsg.JAXP_INVALID_ATTR_ERR,
- "TransformerFactory ne reconna\u00EEt pas l''attribut ''{0}''."},
-
- {ErrorMsg.JAXP_INVALID_ATTR_VALUE_ERR,
- "La valeur indiqu\u00E9e pour l''attribut ''{0}'' est incorrecte."},
-
- /*
- * Note to translators: "setResult()" and "startDocument()" are Java
- * method names that should not be translated.
- */
- {ErrorMsg.JAXP_SET_RESULT_ERR,
- "setResult() doit \u00EAtre appel\u00E9 avant startDocument()."},
-
- /*
- * Note to translators: "Transformer" is a Java interface name that
- * should not be translated. A Transformer object should contained a
- * reference to a translet object in order to be used for
- * transformations; this message is produced if that requirement is not
- * met.
- */
- {ErrorMsg.JAXP_NO_TRANSLET_ERR,
- "La classe Transformer ne contient pas d'objet translet encapsul\u00E9."},
-
- /*
- * Note to translators: The XML document that results from a
- * transformation needs to be sent to an output handler object; this
- * message is produced if that requirement is not met.
- */
- {ErrorMsg.JAXP_NO_HANDLER_ERR,
- "Aucun gestionnaire de sortie d\u00E9fini pour le r\u00E9sultat de la transformation."},
-
- /*
- * Note to translators: "Result" is a Java interface name in this
- * context. The substitution text is a method name.
- */
- {ErrorMsg.JAXP_NO_RESULT_ERR,
- "L''objet de r\u00E9sultat transmis \u00E0 ''{0}'' n''est pas valide."},
-
- /*
- * Note to translators: "Transformer" is a Java interface name. The
- * user's program attempted to access an unrecognized property with the
- * name specified in the substitution text. The method used to retrieve
- * the property is "getOutputProperty", so it's not clear whether it
- * would be best to translate the term "property".
- */
- {ErrorMsg.JAXP_UNKNOWN_PROP_ERR,
- "Tentative d''acc\u00E8s \u00E0 la propri\u00E9t\u00E9 Transformer non valide ''{0}''."},
-
- /*
- * Note to translators: SAX2DOM is the name of a Java class that should
- * not be translated. This is an adapter in the sense that it takes a
- * DOM object and converts it to something that uses the SAX API.
- */
- {ErrorMsg.SAX2DOM_ADAPTER_ERR,
- "Impossible de cr\u00E9er l''adaptateur SAX2DOM : ''{0}''."},
-
- /*
- * Note to translators: "XSLTCSource.build()" is a Java method name.
- * "systemId" is an XML term that is short for "system identification".
- */
- {ErrorMsg.XSLTC_SOURCE_ERR,
- "XSLTCSource.build() appel\u00E9 sans que l'ID syst\u00E8me soit d\u00E9fini."},
-
- { ErrorMsg.ER_RESULT_NULL,
- "Le r\u00E9sultat ne doit pas \u00EAtre NULL"},
-
- /*
- * Note to translators: This message indicates that the value argument
- * of setParameter must be a valid Java Object.
- */
- {ErrorMsg.JAXP_INVALID_SET_PARAM_VALUE,
- "La valeur du param\u00E8tre {0} doit \u00EAtre un objet Java valide"},
-
-
- {ErrorMsg.COMPILE_STDIN_ERR,
- "L'option -i doit \u00EAtre utilis\u00E9e avec l'option -o."},
-
-
- /*
- * Note to translators: This message contains usage information for a
- * means of invoking XSLTC from the command-line. The message is
- * formatted for presentation in English. The strings <output>,
- * <directory>, etc. indicate user-specified argument values, and can
- * be translated - the argument <package> refers to a Java package, so
- * it should be handled in the same way the term is handled for JDK
- * documentation.
- */
- {ErrorMsg.COMPILE_USAGE_STR,
- "SYNTAXE\n java com.sun.org.apache.xalan.internal.xsltc.cmdline.Compile [-o <output>]\n [-d <directory>] [-j <jarfile>] [-p <package>]\n [-n] [-x] [-u] [-v] [-h] { <stylesheet> | -i }\n\nOPTIONS\n -o <output> attribue le nom <output> au\n translet g\u00E9n\u00E9r\u00E9. Par d\u00E9faut, le nom du translet est\n d\u00E9riv\u00E9 du nom <stylesheet>. Cette option\n n'est pas prise en compte lors de la compilation de plusieurs feuilles de style.\n -d <directory> indique un r\u00E9pertoire de destination pour le translet\n -j <jarfile> package les classes de translet dans un fichier JAR portant le\n nom sp\u00E9cifi\u00E9 comme <jarfile>\n -p <package> indique un pr\u00E9fixe de nom de package pour toutes les\n classes de translet g\u00E9n\u00E9r\u00E9es.\n -n active le mode INLINE du mod\u00E8le (comportement par d\u00E9faut am\u00E9lior\u00E9\n en moyenne).\n -x active la sortie de messages de d\u00E9bogage suppl\u00E9mentaires\n -u interpr\u00E8te les arguments <stylesheet> comme des URL\n -i force le compilateur \u00E0 lire la feuille de style \u00E0 partir de STDIN\n -v affiche la version du compilateur\n -h affiche cette instruction de syntaxe\n"},
-
- /*
- * Note to translators: This message contains usage information for a
- * means of invoking XSLTC from the command-line. The message is
- * formatted for presentation in English. The strings <jarfile>,
- * <document>, etc. indicate user-specified argument values, and can
- * be translated - the argument <class> refers to a Java class, so it
- * should be handled in the same way the term is handled for JDK
- * documentation.
- */
- {ErrorMsg.TRANSFORM_USAGE_STR,
- "SYNTAXE \n java com.sun.org.apache.xalan.internal.xsltc.cmdline.Transform [-j <jarfile>]\n [-x] [-n <iterations>] {-u <document_url> | <document>}\n <class> [<param1>=<value1> ...]\n\n utilise le translet <class> pour transformer un document XML\n sp\u00E9cifi\u00E9 comme <document>. Le translet <class> est soit dans\n la variable d'environnement CLASSPATH de l'utilisateur, soit dans un fichier <jarfile> indiqu\u00E9 en option.\nOPTIONS\n -j <jarfile> indique un fichier JAR \u00E0 partir duquel charger le translet\n -x active la sortie de messages de d\u00E9bogage suppl\u00E9mentaires\n -n <iterations> ex\u00E9cute la transformation <iterations> fois et\n affiche les informations de profilage\n -u <document_url> sp\u00E9cifie le document d'entr\u00E9e XML comme URL\n"},
-
-
-
- /*
- * Note to translators: "<xsl:sort>", "<xsl:for-each>" and
- * "<xsl:apply-templates>" are keywords that should not be translated.
- * The message indicates that an xsl:sort element must be a child of
- * one of the other kinds of elements mentioned.
- */
- {ErrorMsg.STRAY_SORT_ERR,
- "<xsl:sort> peut uniquement \u00EAtre utilis\u00E9 dans <xsl:for-each> ou <xsl:apply-templates>."},
-
- /*
- * Note to translators: The message indicates that the encoding
- * requested for the output document was on that requires support that
- * is not available from the Java Virtual Machine being used to execute
- * the program.
- */
- {ErrorMsg.UNSUPPORTED_ENCODING,
- "L''encodage de sortie ''{0}'' n''est pas pris en charge sur cette Java Virtual Machine (JVM)."},
-
- /*
- * Note to translators: The message indicates that the XPath expression
- * named in the substitution text was not well formed syntactically.
- */
- {ErrorMsg.SYNTAX_ERR,
- "Erreur de syntaxe dans ''{0}''."},
-
- /*
- * Note to translators: The substitution text is the name of a Java
- * class. The term "constructor" here is the Java term. The message is
- * displayed if XSLTC could not find a constructor for the specified
- * class.
- */
- {ErrorMsg.CONSTRUCTOR_NOT_FOUND,
- "Constructeur ''{0}'' externe introuvable."},
-
- /*
- * Note to translators: "static" is the Java keyword. The substitution
- * text is the name of a function. The first argument of that function
- * is not of the required type.
- */
- {ErrorMsg.NO_JAVA_FUNCT_THIS_REF,
- "Le premier argument pour la fonction Java ''{0}'' non static n''est pas une r\u00E9f\u00E9rence d''objet valide."},
-
- /*
- * Note to translators: An XPath expression was not of the type
- * required in a particular context. The substitution text is the
- * expression that was in error.
- */
- {ErrorMsg.TYPE_CHECK_ERR,
- "Erreur lors de la v\u00E9rification du type de l''expression ''{0}''."},
-
- /*
- * Note to translators: An XPath expression was not of the type
- * required in a particular context. However, the location of the
- * problematic expression is unknown.
- */
- {ErrorMsg.TYPE_CHECK_UNK_LOC_ERR,
- "Erreur lors de la v\u00E9rification du type d'expression \u00E0 un emplacement inconnu."},
-
- /*
- * Note to translators: The substitution text is the name of a command-
- * line option that was not recognized.
- */
- {ErrorMsg.ILLEGAL_CMDLINE_OPTION_ERR,
- "L''option de ligne de commande ''{0}'' n''est pas valide."},
-
- /*
- * Note to translators: The substitution text is the name of a command-
- * line option.
- */
- {ErrorMsg.CMDLINE_OPT_MISSING_ARG_ERR,
- "Argument obligatoire manquant dans l''option de ligne de commande ''{0}''."},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text contains two error
- * messages. The spacing before the second substitution text indents
- * it the same amount as the first in English.
- */
- {ErrorMsg.WARNING_PLUS_WRAPPED_MSG,
- "WARNING: ''{0}''\n :{1}"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text is an error message.
- */
- {ErrorMsg.WARNING_MSG,
- "WARNING: ''{0}''"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text contains two error
- * messages. The spacing before the second substitution text indents
- * it the same amount as the first in English.
- */
- {ErrorMsg.FATAL_ERR_PLUS_WRAPPED_MSG,
- "FATAL ERROR: ''{0}''\n :{1}"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text is an error message.
- */
- {ErrorMsg.FATAL_ERR_MSG,
- "FATAL ERROR: ''{0}''"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text contains two error
- * messages. The spacing before the second substitution text indents
- * it the same amount as the first in English.
- */
- {ErrorMsg.ERROR_PLUS_WRAPPED_MSG,
- "ERROR: ''{0}''\n :{1}"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text is an error message.
- */
- {ErrorMsg.ERROR_MSG,
- "ERROR: ''{0}''"},
-
- /*
- * Note to translators: The substitution text is the name of a class.
- */
- {ErrorMsg.TRANSFORM_WITH_TRANSLET_STR,
- "Transformation \u00E0 l''aide du translet ''{0}'' "},
-
- /*
- * Note to translators: The first substitution is the name of a class,
- * while the second substitution is the name of a jar file.
- */
- {ErrorMsg.TRANSFORM_WITH_JAR_STR,
- "Transformation \u00E0 l''aide du translet ''{0}'' dans le fichier JAR ''{1}''"},
-
- /*
- * Note to translators: "TransformerFactory" is the name of a Java
- * interface and must not be translated. The substitution text is
- * the name of the class that could not be instantiated.
- */
- {ErrorMsg.COULD_NOT_CREATE_TRANS_FACT,
- "Impossible de cr\u00E9er une instance de la classe TransformerFactory ''{0}''."},
-
- /*
- * Note to translators: This message is produced when the user
- * specified a name for the translet class that contains characters
- * that are not permitted in a Java class name. The substitution
- * text "{0}" specifies the name the user requested, while "{1}"
- * specifies the name the processor used instead.
- */
- {ErrorMsg.TRANSLET_NAME_JAVA_CONFLICT,
- "Impossible d''utiliser le nom ''{0}'' comme nom de classe de translet car il contient des caract\u00E8res non autoris\u00E9s dans le nom de la classe Java. Le nom ''{1}'' a \u00E9t\u00E9 utilis\u00E9 \u00E0 la place."},
-
- /*
- * Note to translators: The following message is used as a header.
- * All the error messages are collected together and displayed beneath
- * this message.
- */
- {ErrorMsg.COMPILER_ERROR_KEY,
- "Erreurs de compilateur :"},
-
- /*
- * Note to translators: The following message is used as a header.
- * All the warning messages are collected together and displayed
- * beneath this message.
- */
- {ErrorMsg.COMPILER_WARNING_KEY,
- "Avertissements de compilateur :"},
-
- /*
- * Note to translators: The following message is used as a header.
- * All the error messages that are produced when the stylesheet is
- * applied to an input document are collected together and displayed
- * beneath this message. A 'translet' is the compiled form of a
- * stylesheet (see above).
- */
- {ErrorMsg.RUNTIME_ERROR_KEY,
- "Erreurs de translet :"},
-
- /*
- * Note to translators: An attribute whose value is constrained to
- * be a "QName" or a list of "QNames" had a value that was incorrect.
- * 'QName' is an XML syntactic term that must not be translated. The
- * substitution text contains the actual value of the attribute.
- */
- {ErrorMsg.INVALID_QNAME_ERR,
- "Un attribut dont la valeur doit \u00EAtre un QName ou une liste de QNames s\u00E9par\u00E9s par des espaces avait la valeur ''{0}''"},
-
- /*
- * Note to translators: An attribute whose value is required to
- * be an "NCName".
- * 'NCName' is an XML syntactic term that must not be translated. The
- * substitution text contains the actual value of the attribute.
- */
- {ErrorMsg.INVALID_NCNAME_ERR,
- "Un attribut dont la valeur doit \u00EAtre un NCName avait la valeur ''{0}''"},
-
- /*
- * Note to translators: An attribute with an incorrect value was
- * encountered. The permitted value is one of the literal values
- * "xml", "html" or "text"; it is also permitted to have the form of
- * a QName that is not also an NCName. The terms "method",
- * "xsl:output", "xml", "html" and "text" are keywords that must not
- * be translated. The term "qname-but-not-ncname" is an XML syntactic
- * term. The substitution text contains the actual value of the
- * attribute.
- */
- {ErrorMsg.INVALID_METHOD_IN_OUTPUT,
- "L''attribut \"method\" d''un \u00E9l\u00E9ment <xsl:output> avait la valeur ''{0}''. La valeur doit \u00EAtre l''une des suivantes : ''xml'', ''html'', ''text'' ou qname-but-not-ncname"},
-
- {ErrorMsg.JAXP_GET_FEATURE_NULL_NAME,
- "Le nom de la fonctionnalit\u00E9 ne peut pas \u00EAtre NULL dans TransformerFactory.getFeature (cha\u00EEne pour le nom)."},
-
- {ErrorMsg.JAXP_SET_FEATURE_NULL_NAME,
- "Le nom de la fonctionnalit\u00E9 ne peut pas \u00EAtre NULL dans TransformerFactory.setFeature (cha\u00EEne pour le nom, valeur bool\u00E9enne)."},
-
- {ErrorMsg.JAXP_UNSUPPORTED_FEATURE,
- "Impossible de d\u00E9finir la fonctionnalit\u00E9 ''{0}'' sur cette propri\u00E9t\u00E9 TransformerFactory."},
-
- {ErrorMsg.JAXP_SECUREPROCESSING_FEATURE,
- "FEATURE_SECURE_PROCESSING : impossible de d\u00E9finir la fonctionnalit\u00E9 sur False en pr\u00E9sence du gestionnaire de s\u00E9curit\u00E9."},
-
- /*
- * Note to translators: This message describes an internal error in the
- * processor. The term "byte code" is a Java technical term for the
- * executable code in a Java method, and "try-catch-finally block"
- * refers to the Java keywords with those names. "Outlined" is a
- * technical term internal to XSLTC and should not be translated.
- */
- {ErrorMsg.OUTLINE_ERR_TRY_CATCH,
- "Erreur XSLTC interne : le code ex\u00E9cutable g\u00E9n\u00E9r\u00E9 contient un bloc try-catch-finally et ne peut pas \u00EAtre d\u00E9limit\u00E9."},
-
- /*
- * Note to translators: This message describes an internal error in the
- * processor. The terms "OutlineableChunkStart" and
- * "OutlineableChunkEnd" are the names of classes internal to XSLTC and
- * should not be translated. The message indicates that for every
- * "start" there must be a corresponding "end", and vice versa, and
- * that if one of a pair of "start" and "end" appears between another
- * pair of corresponding "start" and "end", then the other half of the
- * pair must also be between that same enclosing pair.
- */
- {ErrorMsg.OUTLINE_ERR_UNBALANCED_MARKERS,
- "Erreur XSLTC interne : les marqueurs OutlineableChunkStart et OutlineableChunkEnd doivent \u00EAtre \u00E9quilibr\u00E9s et correctement imbriqu\u00E9s."},
-
- /*
- * Note to translators: This message describes an internal error in the
- * processor. The term "byte code" is a Java technical term for the
- * executable code in a Java method. The "method" that is being
- * referred to is a Java method in a translet that XSLTC is generating
- * in processing a stylesheet. The "instruction" that is being
- * referred to is one of the instrutions in the Java byte code in that
- * method. "Outlined" is a technical term internal to XSLTC and
- * should not be translated.
- */
- {ErrorMsg.OUTLINE_ERR_DELETED_TARGET,
- "Erreur XSLTC interne : une instruction ayant fait partie d'un bloc de code ex\u00E9cutable d\u00E9limit\u00E9 est toujours r\u00E9f\u00E9renc\u00E9e dans la m\u00E9thode d'origine."
- },
-
-
- /*
- * Note to translators: This message describes an internal error in the
- * processor. The "method" that is being referred to is a Java method
- * in a translet that XSLTC is generating.
- *
- */
- {ErrorMsg.OUTLINE_ERR_METHOD_TOO_BIG,
- "Erreur XSLTC interne : une m\u00E9thode dans le translet d\u00E9passe la limite de la JVM concernant la longueur d'une m\u00E9thode de 64 kilo-octets. En g\u00E9n\u00E9ral, ceci est d\u00FB \u00E0 de tr\u00E8s grands mod\u00E8les dans une feuille de style. Essayez de restructurer la feuille de style pour utiliser des mod\u00E8les plus petits."
- },
-
- {ErrorMsg.DESERIALIZE_TRANSLET_ERR, "Lorsque la s\u00E9curit\u00E9 Java est activ\u00E9e, la prise en charge de la d\u00E9s\u00E9rialisation de TemplatesImpl est d\u00E9sactiv\u00E9e. La d\u00E9finition de la propri\u00E9t\u00E9 syst\u00E8me jdk.xml.enableTemplatesImplDeserialization sur True permet de remplacer ce param\u00E8tre."}
-
- };
-
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_it.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_it.java
deleted file mode 100644
index e610ff5..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_it.java
+++ /dev/null
@@ -1,974 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-
-import java.util.ListResourceBundle;
-
-/**
- * @author Morten Jorgensen
- */
-public class ErrorMessages_it extends ListResourceBundle {
-
-/*
- * XSLTC compile-time error messages.
- *
- * General notes to translators and definitions:
- *
- * 1) XSLTC is the name of the product. It is an acronym for "XSLT Compiler".
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An axis is a particular "dimension" in a tree representation of an XML
- * document; the nodes in the tree are divided along different axes.
- * Traversing the "child" axis, for instance, means that the program
- * would visit each child of a particular node; traversing the "descendant"
- * axis means that the program would visit the child nodes of a particular
- * node, their children, and so on until the leaf nodes of the tree are
- * reached.
- *
- * 5) An iterator is an object that traverses nodes in a tree along a
- * particular axis, one at a time.
- *
- * 6) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 7) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 8) DOM is an acronym for Document Object Model. It is a tree
- * representation of an XML document.
- *
- * SAX is an acronym for the Simple API for XML processing. It is an API
- * used inform an XML processor (in this case XSLTC) of the structure and
- * content of an XML document.
- *
- * Input to the stylesheet processor can come from an XML parser in the
- * form of a DOM tree or through the SAX API.
- *
- * 9) DTD is a document type declaration. It is a way of specifying the
- * grammar for an XML file, the names and types of elements, attributes,
- * etc.
- *
- * 10) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- * 11) Translet is an invented term that refers to the class file that contains
- * the compiled form of a stylesheet.
- */
-
- // These message should be read from a locale-specific resource bundle
- /** Get the lookup table for error messages.
- *
- * @return The message lookup table.
- */
- public Object[][] getContents()
- {
- return new Object[][] {
- {ErrorMsg.MULTIPLE_STYLESHEET_ERR,
- "Sono stati definiti pi\u00F9 fogli di stile nello stesso file."},
-
- /*
- * Note to translators: The substitution text is the name of a
- * template. The same name was used on two different templates in the
- * same stylesheet.
- */
- {ErrorMsg.TEMPLATE_REDEF_ERR,
- "Il modello ''{0}'' \u00E8 gi\u00E0 stato definito in questo foglio di stile."},
-
-
- /*
- * Note to translators: The substitution text is the name of a
- * template. A reference to the template name was encountered, but the
- * template is undefined.
- */
- {ErrorMsg.TEMPLATE_UNDEF_ERR,
- "Il modello ''{0}'' non \u00E8 stato definito in questo foglio di stile."},
-
- /*
- * Note to translators: The substitution text is the name of a variable
- * that was defined more than once.
- */
- {ErrorMsg.VARIABLE_REDEF_ERR,
- "La variabile ''{0}'' \u00E8 stata definita pi\u00F9 volte nello stesso ambito."},
-
- /*
- * Note to translators: The substitution text is the name of a variable
- * or parameter. A reference to the variable or parameter was found,
- * but it was never defined.
- */
- {ErrorMsg.VARIABLE_UNDEF_ERR,
- "Variabile o parametro ''{0}'' non definito."},
-
- /*
- * Note to translators: The word "class" here refers to a Java class.
- * Processing the stylesheet required a class to be loaded, but it could
- * not be found. The substitution text is the name of the class.
- */
- {ErrorMsg.CLASS_NOT_FOUND_ERR,
- "Impossibile trovare la classe \"{0}\"."},
-
- /*
- * Note to translators: The word "method" here refers to a Java method.
- * Processing the stylesheet required a reference to the method named by
- * the substitution text, but it could not be found. "public" is the
- * Java keyword.
- */
- {ErrorMsg.METHOD_NOT_FOUND_ERR,
- "Impossibile trovare il metodo esterno ''{0}'' (deve essere pubblico)."},
-
- /*
- * Note to translators: The word "method" here refers to a Java method.
- * Processing the stylesheet required a reference to the method named by
- * the substitution text, but no method with the required types of
- * arguments or return type could be found.
- */
- {ErrorMsg.ARGUMENT_CONVERSION_ERR,
- "Impossibile convertire l''argomento o il tipo restituito in una chiamata per il metodo ''{0}''"},
-
- /*
- * Note to translators: The file or URI named in the substitution text
- * is missing.
- */
- {ErrorMsg.FILE_NOT_FOUND_ERR,
- "File o URI ''{0}'' non trovato."},
-
- /*
- * Note to translators: This message is displayed when the URI
- * mentioned in the substitution text is not well-formed syntactically.
- */
- {ErrorMsg.INVALID_URI_ERR,
- "URI ''{0}'' non valido."},
-
- /*
- * Note to translators: The file or URI named in the substitution text
- * exists but could not be opened.
- */
- {ErrorMsg.FILE_ACCESS_ERR,
- "Impossibile aprire il file o l''URI ''{0}''."},
-
- /*
- * Note to translators: <xsl:stylesheet> and <xsl:transform> are
- * keywords that should not be translated.
- */
- {ErrorMsg.MISSING_ROOT_ERR,
- "\u00C8 previsto un elemento <xsl:stylesheet> o <xsl:transform>."},
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- {ErrorMsg.NAMESPACE_UNDEF_ERR,
- "Prefisso spazio di nomi ''{0}'' non dichiarato."},
-
- /*
- * Note to translators: The Java function named in the stylesheet could
- * not be found.
- */
- {ErrorMsg.FUNCTION_RESOLVE_ERR,
- "Impossibile risolvere la chiamata per la funzione ''{0}''."},
-
- /*
- * Note to translators: The substitution text is the name of a
- * function. A literal string here means a constant string value.
- */
- {ErrorMsg.NEED_LITERAL_ERR,
- "L''argomento per ''{0}'' deve essere una stringa di valori."},
-
- /*
- * Note to translators: This message indicates there was a syntactic
- * error in the form of an XPath expression. The substitution text is
- * the expression.
- */
- {ErrorMsg.XPATH_PARSER_ERR,
- "Errore durante l''analisi dell''espressione XPath ''{0}''."},
-
- /*
- * Note to translators: An element in the stylesheet requires a
- * particular attribute named by the substitution text, but that
- * attribute was not specified in the stylesheet.
- */
- {ErrorMsg.REQUIRED_ATTR_ERR,
- "Attributo obbligatorio ''{0}'' mancante."},
-
- /*
- * Note to translators: This message indicates that a character not
- * permitted in an XPath expression was encountered. The substitution
- * text is the offending character.
- */
- {ErrorMsg.ILLEGAL_CHAR_ERR,
- "Carattere ''{0}'' non valido nell''espressione XPath."},
-
- /*
- * Note to translators: A processing instruction is a mark-up item in
- * an XML document that request some behaviour of an XML processor. The
- * form of the name of was invalid in this case, and the substitution
- * text is the name.
- */
- {ErrorMsg.ILLEGAL_PI_ERR,
- "Nome ''{0}'' non valido per l''istruzione di elaborazione."},
-
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- {ErrorMsg.STRAY_ATTRIBUTE_ERR,
- "Attributo ''{0}'' al di fuori dell''elemento."},
-
- /*
- * Note to translators: An attribute that wasn't recognized was
- * specified on an element in the stylesheet. The attribute is named
- * by the substitution
- * text.
- */
- {ErrorMsg.ILLEGAL_ATTRIBUTE_ERR,
- "Attributo ''{0}'' non valido."},
-
- /*
- * Note to translators: "import" and "include" are keywords that should
- * not be translated. This messages indicates that the stylesheet
- * named in the substitution text imported or included itself either
- * directly or indirectly.
- */
- {ErrorMsg.CIRCULAR_INCLUDE_ERR,
- "Importazione/inclusione circolare. Il foglio di stile ''{0}'' \u00E8 gi\u00E0 stato caricato."},
-
- /*
- * Note to translators: A result-tree fragment is a portion of a
- * resulting XML document represented as a tree. "<xsl:sort>" is a
- * keyword and should not be translated.
- */
- {ErrorMsg.RESULT_TREE_SORT_ERR,
- "Impossibile ordinare i frammenti della struttura di risultati (gli elementi <xsl:sort> verranno ignorati). \u00C8 necessario ordinare i nodi quando si crea la struttura di risultati."},
-
- /*
- * Note to translators: A name can be given to a particular style to be
- * used to format decimal values. The substitution text gives the name
- * of such a style for which more than one declaration was encountered.
- */
- {ErrorMsg.SYMBOLS_REDEF_ERR,
- "Formattazione decimale ''{0}'' gi\u00E0 definita."},
-
- /*
- * Note to translators: The stylesheet version named in the
- * substitution text is not supported.
- */
- {ErrorMsg.XSL_VERSION_ERR,
- "La versione XSL ''{0}'' non \u00E8 supportata da XSLTC."},
-
- /*
- * Note to translators: The definitions of one or more variables or
- * parameters depend on one another.
- */
- {ErrorMsg.CIRCULAR_VARIABLE_ERR,
- "Riferimento di variabile/parametro circolare in ''{0}''."},
-
- /*
- * Note to translators: The operator in an expresion with two operands was
- * not recognized.
- */
- {ErrorMsg.ILLEGAL_BINARY_OP_ERR,
- "Operatore sconosciuto per l'espressione binaria."},
-
- /*
- * Note to translators: This message is produced if a reference to a
- * function has too many or too few arguments.
- */
- {ErrorMsg.ILLEGAL_ARG_ERR,
- "Uno o pi\u00F9 argomenti non validi per la chiamata della funzione."},
-
- /*
- * Note to translators: "document()" is the name of function and must
- * not be translated. A node-set is a set of the nodes in the tree
- * representation of an XML document.
- */
- {ErrorMsg.DOCUMENT_ARG_ERR,
- "Il secondo argomento per la funzione document() deve essere un set di nodi."},
-
- /*
- * Note to translators: "<xsl:when>" and "<xsl:choose>" are keywords
- * and should not be translated. This message describes a syntax error
- * in the stylesheet.
- */
- {ErrorMsg.MISSING_WHEN_ERR,
- "\u00C8 richiesto almeno un elemento <xsl:when> in <xsl:choose>."},
-
- /*
- * Note to translators: "<xsl:otherwise>" and "<xsl:choose>" are
- * keywords and should not be translated. This message describes a
- * syntax error in the stylesheet.
- */
- {ErrorMsg.MULTIPLE_OTHERWISE_ERR,
- "\u00C8 consentito un solo elemento <xsl:otherwise> in <xsl:choose>."},
-
- /*
- * Note to translators: "<xsl:otherwise>" and "<xsl:choose>" are
- * keywords and should not be translated. This message describes a
- * syntax error in the stylesheet.
- */
- {ErrorMsg.STRAY_OTHERWISE_ERR,
- "<xsl:otherwise> pu\u00F2 essere utilizzato sono in <xsl:choose>."},
-
- /*
- * Note to translators: "<xsl:when>" and "<xsl:choose>" are keywords
- * and should not be translated. This message describes a syntax error
- * in the stylesheet.
- */
- {ErrorMsg.STRAY_WHEN_ERR,
- "<xsl:when> pu\u00F2 essere utilizzato sono in <xsl:choose>."},
-
- /*
- * Note to translators: "<xsl:when>", "<xsl:otherwise>" and
- * "<xsl:choose>" are keywords and should not be translated. This
- * message describes a syntax error in the stylesheet.
- */
- {ErrorMsg.WHEN_ELEMENT_ERR,
- "Sono consentiti solo elementi <xsl:when> e <xsl:otherwise> in <xsl:choose>."},
-
- /*
- * Note to translators: "<xsl:attribute-set>" and "name" are keywords
- * that should not be translated.
- */
- {ErrorMsg.UNNAMED_ATTRIBSET_ERR,
- "<xsl:attribute-set> mancante nell'attributo 'name'."},
-
- /*
- * Note to translators: An element in the stylesheet contained an
- * element of a type that it was not permitted to contain.
- */
- {ErrorMsg.ILLEGAL_CHILD_ERR,
- "Elemento figlio non valido."},
-
- /*
- * Note to translators: The stylesheet tried to create an element with
- * a name that was not a valid XML name. The substitution text contains
- * the name.
- */
- {ErrorMsg.ILLEGAL_ELEM_NAME_ERR,
- "Impossibile richiamare un elemento ''{0}''"},
-
- /*
- * Note to translators: The stylesheet tried to create an attribute
- * with a name that was not a valid XML name. The substitution text
- * contains the name.
- */
- {ErrorMsg.ILLEGAL_ATTR_NAME_ERR,
- "Impossibile richiamare un attributo ''{0}''"},
-
- /*
- * Note to translators: The children of the outermost element of a
- * stylesheet are referred to as top-level elements. No text should
- * occur within that outermost element unless it is within a top-level
- * element. This message indicates that that constraint was violated.
- * "<xsl:stylesheet>" is a keyword that should not be translated.
- */
- {ErrorMsg.ILLEGAL_TEXT_NODE_ERR,
- "I dati di testo non rientrano nell'elemento <xsl:stylesheet> di livello superiore."},
-
- /*
- * Note to translators: JAXP is an acronym for the Java API for XML
- * Processing. This message indicates that the XML parser provided to
- * XSLTC to process the XML input document had a configuration problem.
- */
- {ErrorMsg.SAX_PARSER_CONFIG_ERR,
- "Parser JAXP non configurato correttamente"},
-
- /*
- * Note to translators: The substitution text names the internal error
- * encountered.
- */
- {ErrorMsg.INTERNAL_ERR,
- "Errore interno XSLTC irreversibile: ''{0}''"},
-
- /*
- * Note to translators: The stylesheet contained an element that was
- * not recognized as part of the XSL syntax. The substitution text
- * gives the element name.
- */
- {ErrorMsg.UNSUPPORTED_XSL_ERR,
- "Elemento XSL \"{0}\" non supportato."},
-
- /*
- * Note to translators: The stylesheet referred to an extension to the
- * XSL syntax and indicated that it was defined by XSLTC, but XSTLC does
- * not recognized the particular extension named. The substitution text
- * gives the extension name.
- */
- {ErrorMsg.UNSUPPORTED_EXT_ERR,
- "Estensione XSLTC ''{0}'' non riconosciuta."},
-
- /*
- * Note to translators: The XML document given to XSLTC as a stylesheet
- * was not, in fact, a stylesheet. XSLTC is able to detect that in this
- * case because the outermost element in the stylesheet has to be
- * declared with respect to the XSL namespace URI, but no declaration
- * for that namespace was seen.
- */
- {ErrorMsg.MISSING_XSLT_URI_ERR,
- "Il documento di input non \u00E8 un foglio di stile (spazio di nomi XSL non dichiarato nell'elemento radice)."},
-
- /*
- * Note to translators: XSLTC could not find the stylesheet document
- * with the name specified by the substitution text.
- */
- {ErrorMsg.MISSING_XSLT_TARGET_ERR,
- "Impossibile trovare la destinazione ''{0}'' del foglio di stile."},
-
- /*
- * Note to translators: access to the stylesheet target is denied
- */
- {ErrorMsg.ACCESSING_XSLT_TARGET_ERR,
- "Impossibile leggere la destinazione del foglio di stile ''{0}''. Accesso ''{1}'' non consentito a causa della limitazione definita dalla propriet\u00E0 accessExternalStylesheet."},
-
- /*
- * Note to translators: This message represents an internal error in
- * condition in XSLTC. The substitution text is the class name in XSLTC
- * that is missing some functionality.
- */
- {ErrorMsg.NOT_IMPLEMENTED_ERR,
- "Non implementato: ''{0}''."},
-
- /*
- * Note to translators: The XML document given to XSLTC as a stylesheet
- * was not, in fact, a stylesheet.
- */
- {ErrorMsg.NOT_STYLESHEET_ERR,
- "Il documento di input non contiene un foglio di stile XSL."},
-
- /*
- * Note to translators: The element named in the substitution text was
- * encountered in the stylesheet but is not recognized.
- */
- {ErrorMsg.ELEMENT_PARSE_ERR,
- "Impossibile analizzare l''elemento ''{0}''"},
-
- /*
- * Note to translators: "use", "<key>", "node", "node-set", "string"
- * and "number" are keywords in this context and should not be
- * translated. This message indicates that the value of the "use"
- * attribute was not one of the permitted values.
- */
- {ErrorMsg.KEY_USE_ATTR_ERR,
- "L'attributo di uso <key> deve essere un nodo, un set di nodi, una stringa o un numero."},
-
- /*
- * Note to translators: An XML document can specify the version of the
- * XML specification to which it adheres. This message indicates that
- * the version specified for the output document was not valid.
- */
- {ErrorMsg.OUTPUT_VERSION_ERR,
- "La versione del documento XML di output deve essere 1.0"},
-
- /*
- * Note to translators: The operator in a comparison operation was
- * not recognized.
- */
- {ErrorMsg.ILLEGAL_RELAT_OP_ERR,
- "Operatore sconosciuto per l'espressione relazionale"},
-
- /*
- * Note to translators: An attribute set defines as a set of XML
- * attributes that can be added to an element in the output XML document
- * as a group. This message is reported if the name specified was not
- * used to declare an attribute set. The substitution text is the name
- * that is in error.
- */
- {ErrorMsg.ATTRIBSET_UNDEF_ERR,
- "Tentativo di utilizzare un set di attributi ''{0}'' inesistente."},
-
- /*
- * Note to translators: The term "attribute value template" is a term
- * defined by XSLT which describes the value of an attribute that is
- * determined by an XPath expression. The message indicates that the
- * expression was syntactically incorrect; the substitution text
- * contains the expression that was in error.
- */
- {ErrorMsg.ATTR_VAL_TEMPLATE_ERR,
- "Impossibile analizzare il modello di valore di attributo ''{0}''."},
-
- /*
- * Note to translators: ???
- */
- {ErrorMsg.UNKNOWN_SIG_TYPE_ERR,
- "Tipo di dati sconosciuto nella firma per la classe ''{0}''."},
-
- /*
- * Note to translators: The substitution text refers to data types.
- * The message is displayed if a value in a particular context needs to
- * be converted to type {1}, but that's not possible for a value of
- * type {0}.
- */
- {ErrorMsg.DATA_CONVERSION_ERR,
- "Impossibile convertire il tipo di dati ''{0}'' in ''{1}''."},
-
- /*
- * Note to translators: "Templates" is a Java class name that should
- * not be translated.
- */
- {ErrorMsg.NO_TRANSLET_CLASS_ERR,
- "Il modello non contiene una definizione di classe di translet valida."},
-
- /*
- * Note to translators: "Templates" is a Java class name that should
- * not be translated.
- */
- {ErrorMsg.NO_MAIN_TRANSLET_ERR,
- "Il modello non contiene una classe denominata ''{0}''."},
-
- /*
- * Note to translators: The substitution text is the name of a class.
- */
- {ErrorMsg.TRANSLET_CLASS_ERR,
- "Impossibile caricare la classe di translet ''{0}''."},
-
- {ErrorMsg.TRANSLET_OBJECT_ERR,
- "La classe di translet \u00E8 stata caricata, ma non \u00E8 possibile creare l'istanza del translet."},
-
- /*
- * Note to translators: "ErrorListener" is a Java interface name that
- * should not be translated. The message indicates that the user tried
- * to set an ErrorListener object on object of the class named in the
- * substitution text with "null" Java value.
- */
- {ErrorMsg.ERROR_LISTENER_NULL_ERR,
- "Tentativo di impostare ErrorListener per ''{0}'' su null"},
-
- /*
- * Note to translators: StreamSource, SAXSource and DOMSource are Java
- * interface names that should not be translated.
- */
- {ErrorMsg.JAXP_UNKNOWN_SOURCE_ERR,
- "XSLTC supporta solo StreamSource, SAXSource e DOMSource."},
-
- /*
- * Note to translators: "Source" is a Java class name that should not
- * be translated. The substitution text is the name of Java method.
- */
- {ErrorMsg.JAXP_NO_SOURCE_ERR,
- "L''oggetto di origine passato a ''{0}'' non ha contenuti."},
-
- /*
- * Note to translators: The message indicates that XSLTC failed to
- * compile the stylesheet into a translet (class file).
- */
- {ErrorMsg.JAXP_COMPILE_ERR,
- "Impossibile compilare il foglio di stile"},
-
- /*
- * Note to translators: "TransformerFactory" is a class name. In this
- * context, an attribute is a property or setting of the
- * TransformerFactory object. The substitution text is the name of the
- * unrecognised attribute. The method used to retrieve the attribute is
- * "getAttribute", so it's not clear whether it would be best to
- * translate the term "attribute".
- */
- {ErrorMsg.JAXP_INVALID_ATTR_ERR,
- "TransformerFactory non riconosce l''attributo ''{0}''."},
-
- {ErrorMsg.JAXP_INVALID_ATTR_VALUE_ERR,
- "Valore errato specificato per l''attributo ''{0}''."},
-
- /*
- * Note to translators: "setResult()" and "startDocument()" are Java
- * method names that should not be translated.
- */
- {ErrorMsg.JAXP_SET_RESULT_ERR,
- "setResult() deve essere richiamato prima di startDocument()."},
-
- /*
- * Note to translators: "Transformer" is a Java interface name that
- * should not be translated. A Transformer object should contained a
- * reference to a translet object in order to be used for
- * transformations; this message is produced if that requirement is not
- * met.
- */
- {ErrorMsg.JAXP_NO_TRANSLET_ERR,
- "Il trasformatore non contiene alcun oggetto incapsulato."},
-
- /*
- * Note to translators: The XML document that results from a
- * transformation needs to be sent to an output handler object; this
- * message is produced if that requirement is not met.
- */
- {ErrorMsg.JAXP_NO_HANDLER_ERR,
- "Nessun handler di output definito per il risultato della trasformazione."},
-
- /*
- * Note to translators: "Result" is a Java interface name in this
- * context. The substitution text is a method name.
- */
- {ErrorMsg.JAXP_NO_RESULT_ERR,
- "L''oggetto di risultato passato a ''{0}'' non \u00E8 valido."},
-
- /*
- * Note to translators: "Transformer" is a Java interface name. The
- * user's program attempted to access an unrecognized property with the
- * name specified in the substitution text. The method used to retrieve
- * the property is "getOutputProperty", so it's not clear whether it
- * would be best to translate the term "property".
- */
- {ErrorMsg.JAXP_UNKNOWN_PROP_ERR,
- "Tentativo di accedere a una propriet\u00E0 ''{0}'' del trasformatore non valida."},
-
- /*
- * Note to translators: SAX2DOM is the name of a Java class that should
- * not be translated. This is an adapter in the sense that it takes a
- * DOM object and converts it to something that uses the SAX API.
- */
- {ErrorMsg.SAX2DOM_ADAPTER_ERR,
- "Impossibile creare l''adattatore SAX2DOM ''{0}''."},
-
- /*
- * Note to translators: "XSLTCSource.build()" is a Java method name.
- * "systemId" is an XML term that is short for "system identification".
- */
- {ErrorMsg.XSLTC_SOURCE_ERR,
- "XSLTCSource.build() richiamato senza che sia stato impostato systemId."},
-
- { ErrorMsg.ER_RESULT_NULL,
- "Il risultato non deve essere nullo"},
-
- /*
- * Note to translators: This message indicates that the value argument
- * of setParameter must be a valid Java Object.
- */
- {ErrorMsg.JAXP_INVALID_SET_PARAM_VALUE,
- "Il valore del parametro {0} deve essere un oggetto Java valido"},
-
-
- {ErrorMsg.COMPILE_STDIN_ERR,
- "L'opzione -i deve essere utilizzata con l'opzione -o."},
-
-
- /*
- * Note to translators: This message contains usage information for a
- * means of invoking XSLTC from the command-line. The message is
- * formatted for presentation in English. The strings <output>,
- * <directory>, etc. indicate user-specified argument values, and can
- * be translated - the argument <package> refers to a Java package, so
- * it should be handled in the same way the term is handled for JDK
- * documentation.
- */
- {ErrorMsg.COMPILE_USAGE_STR,
- "RIEPILOGO\n java com.sun.org.apache.xalan.internal.xsltc.cmdline.Compile [-o <output>]\n [-d <directory>] [-j <file jar>] [-p <package>]\n [-n] [-x] [-u] [-v] [-h] { <foglio di stile> | -i }\n\nOPZIONI\n -o <output> assegna l'<output> del nome al translet\n generato. Per impostazione predefinita, il nome translet\n \u00E8 derivato dal nome <foglio di stile>. Questa opzione\n viene ignorata se si compilano pi\u00F9 fogli di stile.\n -d <directory> specifica una directory di destinazione per il translet\n -j <file jar> crea un package di classi di translet inserendolo in un file JAR con il\n nome specificato come <jarfile>\n -p <package> specifica un prefisso di nome package per tutte le\n classi di translet generate.\n -n abilita l'inserimento in linea dei modelli (in media, l'impostazione predefinita \u00E8\n la migliore).\n -x attiva l'output di altri messaggi di debug\n -u interpreta gli argomenti <stylesheet> come URL\n -i obbliga il compilatore a leggere il foglio di stile da stdin\n -v visualizza la versione del compilatore\n -h visualizza questa istruzione di uso\n"},
-
- /*
- * Note to translators: This message contains usage information for a
- * means of invoking XSLTC from the command-line. The message is
- * formatted for presentation in English. The strings <jarfile>,
- * <document>, etc. indicate user-specified argument values, and can
- * be translated - the argument <class> refers to a Java class, so it
- * should be handled in the same way the term is handled for JDK
- * documentation.
- */
- {ErrorMsg.TRANSFORM_USAGE_STR,
- "RIPEILOGO\n java com.sun.org.apache.xalan.internal.xsltc.cmdline.Transform [-j <file jar>]\n [-x] [-n <iterazioni>] {-u <url_documento> | <documento>}\n <classe> [<param1>=<valore1> ...]\n\n utilizza la <classe> translet per trasformare un documento XML\n specificato come <documento>. La <classe> di translet si trova nel\n CLASSPATH dell'utente o nel <file jar> specificato facoltativamente.\\OPZIONI\n -j <file jar> specifica un file JAR dal quale caricare il translet\n -x attiva l'output di altri messaggi di debug\n -n <iterazioni> esegue le <iterazioni> di trasformazione e\n visualizza le informazioni sui profili\n -u <url_documento> specifica il documento di input XML come URL\n"},
-
-
-
- /*
- * Note to translators: "<xsl:sort>", "<xsl:for-each>" and
- * "<xsl:apply-templates>" are keywords that should not be translated.
- * The message indicates that an xsl:sort element must be a child of
- * one of the other kinds of elements mentioned.
- */
- {ErrorMsg.STRAY_SORT_ERR,
- "<xsl:sort> pu\u00F2 essere utilizzato sono in <xsl:for-each> o <xsl:apply-templates>."},
-
- /*
- * Note to translators: The message indicates that the encoding
- * requested for the output document was on that requires support that
- * is not available from the Java Virtual Machine being used to execute
- * the program.
- */
- {ErrorMsg.UNSUPPORTED_ENCODING,
- "La codifica di output ''{0}'' non \u00E8 supportata in questa JVM."},
-
- /*
- * Note to translators: The message indicates that the XPath expression
- * named in the substitution text was not well formed syntactically.
- */
- {ErrorMsg.SYNTAX_ERR,
- "Errore di sintassi in ''{0}''."},
-
- /*
- * Note to translators: The substitution text is the name of a Java
- * class. The term "constructor" here is the Java term. The message is
- * displayed if XSLTC could not find a constructor for the specified
- * class.
- */
- {ErrorMsg.CONSTRUCTOR_NOT_FOUND,
- "Impossibile trovare il costruttore esterno ''{0}''."},
-
- /*
- * Note to translators: "static" is the Java keyword. The substitution
- * text is the name of a function. The first argument of that function
- * is not of the required type.
- */
- {ErrorMsg.NO_JAVA_FUNCT_THIS_REF,
- "Il primo argomento per la funzione Java non statica ''{0}'' non \u00E8 un riferimento di oggetto valido."},
-
- /*
- * Note to translators: An XPath expression was not of the type
- * required in a particular context. The substitution text is the
- * expression that was in error.
- */
- {ErrorMsg.TYPE_CHECK_ERR,
- "Errore durante il controllo del tipo dell''espressione ''{0}''."},
-
- /*
- * Note to translators: An XPath expression was not of the type
- * required in a particular context. However, the location of the
- * problematic expression is unknown.
- */
- {ErrorMsg.TYPE_CHECK_UNK_LOC_ERR,
- "Errore durante il controllo del tipo di un''espressione in una posizione sconosciuta."},
-
- /*
- * Note to translators: The substitution text is the name of a command-
- * line option that was not recognized.
- */
- {ErrorMsg.ILLEGAL_CMDLINE_OPTION_ERR,
- "L''opzione di riga di comando ''{0}'' non \u00E8 valida."},
-
- /*
- * Note to translators: The substitution text is the name of a command-
- * line option.
- */
- {ErrorMsg.CMDLINE_OPT_MISSING_ARG_ERR,
- "Nell''opzione di riga di comando ''{0}'' manca un argomento obbligatorio."},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text contains two error
- * messages. The spacing before the second substitution text indents
- * it the same amount as the first in English.
- */
- {ErrorMsg.WARNING_PLUS_WRAPPED_MSG,
- "WARNING: ''{0}''\n :{1}"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text is an error message.
- */
- {ErrorMsg.WARNING_MSG,
- "WARNING: ''{0}''"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text contains two error
- * messages. The spacing before the second substitution text indents
- * it the same amount as the first in English.
- */
- {ErrorMsg.FATAL_ERR_PLUS_WRAPPED_MSG,
- "FATAL ERROR: ''{0}''\n :{1}"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text is an error message.
- */
- {ErrorMsg.FATAL_ERR_MSG,
- "FATAL ERROR: ''{0}''"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text contains two error
- * messages. The spacing before the second substitution text indents
- * it the same amount as the first in English.
- */
- {ErrorMsg.ERROR_PLUS_WRAPPED_MSG,
- "ERROR: ''{0}''\n :{1}"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text is an error message.
- */
- {ErrorMsg.ERROR_MSG,
- "ERROR: ''{0}''"},
-
- /*
- * Note to translators: The substitution text is the name of a class.
- */
- {ErrorMsg.TRANSFORM_WITH_TRANSLET_STR,
- "Trasformazione mediante il translet ''{0}'' "},
-
- /*
- * Note to translators: The first substitution is the name of a class,
- * while the second substitution is the name of a jar file.
- */
- {ErrorMsg.TRANSFORM_WITH_JAR_STR,
- "Trasformazione mediante il translet ''{0}'' del file jar ''{1}''"},
-
- /*
- * Note to translators: "TransformerFactory" is the name of a Java
- * interface and must not be translated. The substitution text is
- * the name of the class that could not be instantiated.
- */
- {ErrorMsg.COULD_NOT_CREATE_TRANS_FACT,
- "Impossibile creare un''istanza della classe TransformerFactory ''{0}''."},
-
- /*
- * Note to translators: This message is produced when the user
- * specified a name for the translet class that contains characters
- * that are not permitted in a Java class name. The substitution
- * text "{0}" specifies the name the user requested, while "{1}"
- * specifies the name the processor used instead.
- */
- {ErrorMsg.TRANSLET_NAME_JAVA_CONFLICT,
- "Impossibile utilizzare il nome ''{0}'' per la classe di translet poich\u00E9 contiene caratteri non consentiti nel nome della classe Java. Verr\u00E0 utilizzato il nome ''{1}''."},
-
- /*
- * Note to translators: The following message is used as a header.
- * All the error messages are collected together and displayed beneath
- * this message.
- */
- {ErrorMsg.COMPILER_ERROR_KEY,
- "Errori del compilatore:"},
-
- /*
- * Note to translators: The following message is used as a header.
- * All the warning messages are collected together and displayed
- * beneath this message.
- */
- {ErrorMsg.COMPILER_WARNING_KEY,
- "Avvertenze del compilatore:"},
-
- /*
- * Note to translators: The following message is used as a header.
- * All the error messages that are produced when the stylesheet is
- * applied to an input document are collected together and displayed
- * beneath this message. A 'translet' is the compiled form of a
- * stylesheet (see above).
- */
- {ErrorMsg.RUNTIME_ERROR_KEY,
- "Errori del translet:"},
-
- /*
- * Note to translators: An attribute whose value is constrained to
- * be a "QName" or a list of "QNames" had a value that was incorrect.
- * 'QName' is an XML syntactic term that must not be translated. The
- * substitution text contains the actual value of the attribute.
- */
- {ErrorMsg.INVALID_QNAME_ERR,
- "Un attributo il cui valore deve essere un QName o una lista separata da spazi di QName contiene il valore ''{0}''"},
-
- /*
- * Note to translators: An attribute whose value is required to
- * be an "NCName".
- * 'NCName' is an XML syntactic term that must not be translated. The
- * substitution text contains the actual value of the attribute.
- */
- {ErrorMsg.INVALID_NCNAME_ERR,
- "Un attributo il cui valore deve essere un NCName contiene il valore ''{0}''"},
-
- /*
- * Note to translators: An attribute with an incorrect value was
- * encountered. The permitted value is one of the literal values
- * "xml", "html" or "text"; it is also permitted to have the form of
- * a QName that is not also an NCName. The terms "method",
- * "xsl:output", "xml", "html" and "text" are keywords that must not
- * be translated. The term "qname-but-not-ncname" is an XML syntactic
- * term. The substitution text contains the actual value of the
- * attribute.
- */
- {ErrorMsg.INVALID_METHOD_IN_OUTPUT,
- "L''attributo di metodo per un elemento <xsl:output> ha il valore ''{0}'', ma deve essere uno tra ''xml'', ''html'', ''text'' o qname-but-not-ncname"},
-
- {ErrorMsg.JAXP_GET_FEATURE_NULL_NAME,
- "Il nome funzione non pu\u00F2 essere nullo in TransformerFactory.getFeature (nome stringa)."},
-
- {ErrorMsg.JAXP_SET_FEATURE_NULL_NAME,
- "Il nome funzione non pu\u00F2 essere nullo in TransformerFactory.setFeature (nome stringa, valore booleano)."},
-
- {ErrorMsg.JAXP_UNSUPPORTED_FEATURE,
- "Impossibile impostare la funzione ''{0}'' in questo TransformerFactory."},
-
- {ErrorMsg.JAXP_SECUREPROCESSING_FEATURE,
- "FEATURE_SECURE_PROCESSING: impossibile impostare la funzione su false se \u00E8 presente Security Manager."},
-
- /*
- * Note to translators: This message describes an internal error in the
- * processor. The term "byte code" is a Java technical term for the
- * executable code in a Java method, and "try-catch-finally block"
- * refers to the Java keywords with those names. "Outlined" is a
- * technical term internal to XSLTC and should not be translated.
- */
- {ErrorMsg.OUTLINE_ERR_TRY_CATCH,
- "Errore XSLTC interno: il bytecode generato contiene un blocco try-catch-finally e non pu\u00F2 essere di tipo outlined."},
-
- /*
- * Note to translators: This message describes an internal error in the
- * processor. The terms "OutlineableChunkStart" and
- * "OutlineableChunkEnd" are the names of classes internal to XSLTC and
- * should not be translated. The message indicates that for every
- * "start" there must be a corresponding "end", and vice versa, and
- * that if one of a pair of "start" and "end" appears between another
- * pair of corresponding "start" and "end", then the other half of the
- * pair must also be between that same enclosing pair.
- */
- {ErrorMsg.OUTLINE_ERR_UNBALANCED_MARKERS,
- "Errore XSLTC interno: gli indicatori OutlineableChunkStart e OutlineableChunkEnd devono essere bilanciati e nidificati correttamente."},
-
- /*
- * Note to translators: This message describes an internal error in the
- * processor. The term "byte code" is a Java technical term for the
- * executable code in a Java method. The "method" that is being
- * referred to is a Java method in a translet that XSLTC is generating
- * in processing a stylesheet. The "instruction" that is being
- * referred to is one of the instrutions in the Java byte code in that
- * method. "Outlined" is a technical term internal to XSLTC and
- * should not be translated.
- */
- {ErrorMsg.OUTLINE_ERR_DELETED_TARGET,
- "Errore XSLTC interno: a un'istruzione che faceva parte di un blocco di bytecode di tipo outlined viene ancora fatto riferimento nel metodo originale."
- },
-
-
- /*
- * Note to translators: This message describes an internal error in the
- * processor. The "method" that is being referred to is a Java method
- * in a translet that XSLTC is generating.
- *
- */
- {ErrorMsg.OUTLINE_ERR_METHOD_TOO_BIG,
- "Errore XSLTC interno: un metodo nel translet supera la limitazione Java Virtual Machine relativa alla lunghezza per un metodo di 64 kilobyte. Ci\u00F2 \u00E8 generalmente causato dalle grandi dimensioni dei modelli in un foglio di stile. Provare a ristrutturare il foglio di stile per utilizzare modelli di dimensioni inferiori."
- },
-
- {ErrorMsg.DESERIALIZE_TRANSLET_ERR, "Quando la sicurezza Java \u00E8 abilitata, il supporto per la deserializzazione TemplatesImpl \u00E8 disabilitato. \u00C8 possibile ignorare questa condizione impostando su true la propriet\u00E0 di sistema jdk.xml.enableTemplatesImplDeserialization."}
-
- };
-
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ja.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ja.java
deleted file mode 100644
index f27353c..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ja.java
+++ /dev/null
@@ -1,974 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-
-import java.util.ListResourceBundle;
-
-/**
- * @author Morten Jorgensen
- */
-public class ErrorMessages_ja extends ListResourceBundle {
-
-/*
- * XSLTC compile-time error messages.
- *
- * General notes to translators and definitions:
- *
- * 1) XSLTC is the name of the product. It is an acronym for "XSLT Compiler".
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An axis is a particular "dimension" in a tree representation of an XML
- * document; the nodes in the tree are divided along different axes.
- * Traversing the "child" axis, for instance, means that the program
- * would visit each child of a particular node; traversing the "descendant"
- * axis means that the program would visit the child nodes of a particular
- * node, their children, and so on until the leaf nodes of the tree are
- * reached.
- *
- * 5) An iterator is an object that traverses nodes in a tree along a
- * particular axis, one at a time.
- *
- * 6) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 7) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 8) DOM is an acronym for Document Object Model. It is a tree
- * representation of an XML document.
- *
- * SAX is an acronym for the Simple API for XML processing. It is an API
- * used inform an XML processor (in this case XSLTC) of the structure and
- * content of an XML document.
- *
- * Input to the stylesheet processor can come from an XML parser in the
- * form of a DOM tree or through the SAX API.
- *
- * 9) DTD is a document type declaration. It is a way of specifying the
- * grammar for an XML file, the names and types of elements, attributes,
- * etc.
- *
- * 10) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- * 11) Translet is an invented term that refers to the class file that contains
- * the compiled form of a stylesheet.
- */
-
- // These message should be read from a locale-specific resource bundle
- /** Get the lookup table for error messages.
- *
- * @return The message lookup table.
- */
- public Object[][] getContents()
- {
- return new Object[][] {
- {ErrorMsg.MULTIPLE_STYLESHEET_ERR,
- "\u540C\u3058\u30D5\u30A1\u30A4\u30EB\u306B\u8907\u6570\u306E\u30B9\u30BF\u30A4\u30EB\u30B7\u30FC\u30C8\u304C\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u3059\u3002"},
-
- /*
- * Note to translators: The substitution text is the name of a
- * template. The same name was used on two different templates in the
- * same stylesheet.
- */
- {ErrorMsg.TEMPLATE_REDEF_ERR,
- "\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8''{0}''\u306F\u3053\u306E\u30B9\u30BF\u30A4\u30EB\u30B7\u30FC\u30C8\u5185\u3067\u3059\u3067\u306B\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u3059\u3002"},
-
-
- /*
- * Note to translators: The substitution text is the name of a
- * template. A reference to the template name was encountered, but the
- * template is undefined.
- */
- {ErrorMsg.TEMPLATE_UNDEF_ERR,
- "\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8''{0}''\u306F\u3053\u306E\u30B9\u30BF\u30A4\u30EB\u30B7\u30FC\u30C8\u5185\u3067\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"},
-
- /*
- * Note to translators: The substitution text is the name of a variable
- * that was defined more than once.
- */
- {ErrorMsg.VARIABLE_REDEF_ERR,
- "\u5909\u6570''{0}''\u306F\u540C\u3058\u30B9\u30B3\u30FC\u30D7\u5185\u3067\u8907\u6570\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u3059\u3002"},
-
- /*
- * Note to translators: The substitution text is the name of a variable
- * or parameter. A reference to the variable or parameter was found,
- * but it was never defined.
- */
- {ErrorMsg.VARIABLE_UNDEF_ERR,
- "\u5909\u6570\u307E\u305F\u306F\u30D1\u30E9\u30E1\u30FC\u30BF''{0}''\u304C\u672A\u5B9A\u7FA9\u3067\u3059\u3002"},
-
- /*
- * Note to translators: The word "class" here refers to a Java class.
- * Processing the stylesheet required a class to be loaded, but it could
- * not be found. The substitution text is the name of the class.
- */
- {ErrorMsg.CLASS_NOT_FOUND_ERR,
- "\u30AF\u30E9\u30B9''{0}''\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002"},
-
- /*
- * Note to translators: The word "method" here refers to a Java method.
- * Processing the stylesheet required a reference to the method named by
- * the substitution text, but it could not be found. "public" is the
- * Java keyword.
- */
- {ErrorMsg.METHOD_NOT_FOUND_ERR,
- "\u5916\u90E8\u30E1\u30BD\u30C3\u30C9''{0}''\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093(public\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059)\u3002"},
-
- /*
- * Note to translators: The word "method" here refers to a Java method.
- * Processing the stylesheet required a reference to the method named by
- * the substitution text, but no method with the required types of
- * arguments or return type could be found.
- */
- {ErrorMsg.ARGUMENT_CONVERSION_ERR,
- "\u30E1\u30BD\u30C3\u30C9''{0}''\u306E\u547C\u51FA\u3057\u306E\u5F15\u6570\u30BF\u30A4\u30D7\u307E\u305F\u306F\u623B\u308A\u578B\u3092\u5909\u63DB\u3067\u304D\u307E\u305B\u3093"},
-
- /*
- * Note to translators: The file or URI named in the substitution text
- * is missing.
- */
- {ErrorMsg.FILE_NOT_FOUND_ERR,
- "\u30D5\u30A1\u30A4\u30EB\u307E\u305F\u306FURI ''{0}''\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002"},
-
- /*
- * Note to translators: This message is displayed when the URI
- * mentioned in the substitution text is not well-formed syntactically.
- */
- {ErrorMsg.INVALID_URI_ERR,
- "URI ''{0}''\u304C\u7121\u52B9\u3067\u3059\u3002"},
-
- /*
- * Note to translators: The file or URI named in the substitution text
- * exists but could not be opened.
- */
- {ErrorMsg.FILE_ACCESS_ERR,
- "\u30D5\u30A1\u30A4\u30EB\u307E\u305F\u306FURI ''{0}''\u3092\u958B\u304F\u3053\u3068\u304C\u3067\u304D\u307E\u305B\u3093\u3002"},
-
- /*
- * Note to translators: <xsl:stylesheet> and <xsl:transform> are
- * keywords that should not be translated.
- */
- {ErrorMsg.MISSING_ROOT_ERR,
- "<xsl:stylesheet>\u307E\u305F\u306F<xsl:transform>\u306E\u8981\u7D20\u304C\u3042\u308A\u307E\u305B\u3093\u3002"},
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- {ErrorMsg.NAMESPACE_UNDEF_ERR,
- "\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u306E\u63A5\u982D\u8F9E''{0}''\u306F\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"},
-
- /*
- * Note to translators: The Java function named in the stylesheet could
- * not be found.
- */
- {ErrorMsg.FUNCTION_RESOLVE_ERR,
- "\u95A2\u6570''{0}''\u306E\u547C\u51FA\u3057\u3092\u89E3\u6C7A\u3067\u304D\u307E\u305B\u3093\u3002"},
-
- /*
- * Note to translators: The substitution text is the name of a
- * function. A literal string here means a constant string value.
- */
- {ErrorMsg.NEED_LITERAL_ERR,
- "''{0}''\u3078\u306E\u5F15\u6570\u306F\u30EA\u30C6\u30E9\u30EB\u6587\u5B57\u5217\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002"},
-
- /*
- * Note to translators: This message indicates there was a syntactic
- * error in the form of an XPath expression. The substitution text is
- * the expression.
- */
- {ErrorMsg.XPATH_PARSER_ERR,
- "XPath\u5F0F''{0}''\u306E\u89E3\u6790\u4E2D\u306B\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002"},
-
- /*
- * Note to translators: An element in the stylesheet requires a
- * particular attribute named by the substitution text, but that
- * attribute was not specified in the stylesheet.
- */
- {ErrorMsg.REQUIRED_ATTR_ERR,
- "\u5FC5\u9808\u5C5E\u6027''{0}''\u304C\u3042\u308A\u307E\u305B\u3093\u3002"},
-
- /*
- * Note to translators: This message indicates that a character not
- * permitted in an XPath expression was encountered. The substitution
- * text is the offending character.
- */
- {ErrorMsg.ILLEGAL_CHAR_ERR,
- "XPath\u5F0F\u306E\u6587\u5B57''{0}''\u306F\u7121\u52B9\u3067\u3059\u3002"},
-
- /*
- * Note to translators: A processing instruction is a mark-up item in
- * an XML document that request some behaviour of an XML processor. The
- * form of the name of was invalid in this case, and the substitution
- * text is the name.
- */
- {ErrorMsg.ILLEGAL_PI_ERR,
- "\u51E6\u7406\u547D\u4EE4\u306E\u540D\u524D''{0}''\u306F\u7121\u52B9\u3067\u3059\u3002"},
-
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- {ErrorMsg.STRAY_ATTRIBUTE_ERR,
- "\u5C5E\u6027''{0}''\u304C\u8981\u7D20\u306E\u5916\u5074\u306B\u3042\u308A\u307E\u3059\u3002"},
-
- /*
- * Note to translators: An attribute that wasn't recognized was
- * specified on an element in the stylesheet. The attribute is named
- * by the substitution
- * text.
- */
- {ErrorMsg.ILLEGAL_ATTRIBUTE_ERR,
- "\u4E0D\u6B63\u306A\u5C5E\u6027''{0}''\u3067\u3059\u3002"},
-
- /*
- * Note to translators: "import" and "include" are keywords that should
- * not be translated. This messages indicates that the stylesheet
- * named in the substitution text imported or included itself either
- * directly or indirectly.
- */
- {ErrorMsg.CIRCULAR_INCLUDE_ERR,
- "\u30A4\u30F3\u30DD\u30FC\u30C8\u307E\u305F\u306F\u30A4\u30F3\u30AF\u30EB\u30FC\u30C9\u304C\u5FAA\u74B0\u3057\u3066\u3044\u307E\u3059\u3002\u30B9\u30BF\u30A4\u30EB\u30B7\u30FC\u30C8''{0}''\u306F\u3059\u3067\u306B\u30ED\u30FC\u30C9\u3055\u308C\u3066\u3044\u307E\u3059\u3002"},
-
- /*
- * Note to translators: A result-tree fragment is a portion of a
- * resulting XML document represented as a tree. "<xsl:sort>" is a
- * keyword and should not be translated.
- */
- {ErrorMsg.RESULT_TREE_SORT_ERR,
- "\u7D50\u679C\u30C4\u30EA\u30FC\u30FB\u30D5\u30E9\u30B0\u30E1\u30F3\u30C8\u306F\u30BD\u30FC\u30C8\u3067\u304D\u307E\u305B\u3093(<xsl:sort>\u8981\u7D20\u306F\u7121\u8996\u3055\u308C\u307E\u3059)\u3002\u7D50\u679C\u30C4\u30EA\u30FC\u3092\u4F5C\u6210\u3059\u308B\u3068\u304D\u306B\u30CE\u30FC\u30C9\u3092\u30BD\u30FC\u30C8\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002"},
-
- /*
- * Note to translators: A name can be given to a particular style to be
- * used to format decimal values. The substitution text gives the name
- * of such a style for which more than one declaration was encountered.
- */
- {ErrorMsg.SYMBOLS_REDEF_ERR,
- "10\u9032\u6570\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8''{0}''\u306F\u3059\u3067\u306B\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u3059\u3002"},
-
- /*
- * Note to translators: The stylesheet version named in the
- * substitution text is not supported.
- */
- {ErrorMsg.XSL_VERSION_ERR,
- "XSL\u30D0\u30FC\u30B8\u30E7\u30F3''{0}''\u306FXSLTC\u306B\u3088\u3063\u3066\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"},
-
- /*
- * Note to translators: The definitions of one or more variables or
- * parameters depend on one another.
- */
- {ErrorMsg.CIRCULAR_VARIABLE_ERR,
- "''{0}''\u5185\u306E\u5909\u6570\u53C2\u7167\u307E\u305F\u306F\u30D1\u30E9\u30E1\u30FC\u30BF\u53C2\u7167\u304C\u5FAA\u74B0\u3057\u3066\u3044\u307E\u3059\u3002"},
-
- /*
- * Note to translators: The operator in an expresion with two operands was
- * not recognized.
- */
- {ErrorMsg.ILLEGAL_BINARY_OP_ERR,
- "2\u9032\u6570\u306E\u5F0F\u306B\u5BFE\u3059\u308B\u4E0D\u660E\u306A\u6F14\u7B97\u5B50\u3067\u3059\u3002"},
-
- /*
- * Note to translators: This message is produced if a reference to a
- * function has too many or too few arguments.
- */
- {ErrorMsg.ILLEGAL_ARG_ERR,
- "\u95A2\u6570\u547C\u51FA\u3057\u306E\u5F15\u6570\u304C\u4E0D\u6B63\u3067\u3059\u3002"},
-
- /*
- * Note to translators: "document()" is the name of function and must
- * not be translated. A node-set is a set of the nodes in the tree
- * representation of an XML document.
- */
- {ErrorMsg.DOCUMENT_ARG_ERR,
- "document()\u95A2\u6570\u306E2\u756A\u76EE\u306E\u5F15\u6570\u306F\u30CE\u30FC\u30C9\u30BB\u30C3\u30C8\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002"},
-
- /*
- * Note to translators: "<xsl:when>" and "<xsl:choose>" are keywords
- * and should not be translated. This message describes a syntax error
- * in the stylesheet.
- */
- {ErrorMsg.MISSING_WHEN_ERR,
- "<xsl:choose>\u5185\u306B\u306F\u5C11\u306A\u304F\u3068\u30821\u3064\u306E<xsl:when>\u8981\u7D20\u304C\u5FC5\u8981\u3067\u3059\u3002"},
-
- /*
- * Note to translators: "<xsl:otherwise>" and "<xsl:choose>" are
- * keywords and should not be translated. This message describes a
- * syntax error in the stylesheet.
- */
- {ErrorMsg.MULTIPLE_OTHERWISE_ERR,
- "<xsl:choose>\u5185\u3067\u306F1\u3064\u306E<xsl:otherwise>\u8981\u7D20\u306E\u307F\u304C\u8A31\u53EF\u3055\u308C\u3066\u3044\u307E\u3059\u3002"},
-
- /*
- * Note to translators: "<xsl:otherwise>" and "<xsl:choose>" are
- * keywords and should not be translated. This message describes a
- * syntax error in the stylesheet.
- */
- {ErrorMsg.STRAY_OTHERWISE_ERR,
- "<xsl:otherwise>\u306F<xsl:choose>\u5185\u3067\u306E\u307F\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002"},
-
- /*
- * Note to translators: "<xsl:when>" and "<xsl:choose>" are keywords
- * and should not be translated. This message describes a syntax error
- * in the stylesheet.
- */
- {ErrorMsg.STRAY_WHEN_ERR,
- "<xsl:when>\u306F<xsl:choose>\u5185\u3067\u306E\u307F\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002"},
-
- /*
- * Note to translators: "<xsl:when>", "<xsl:otherwise>" and
- * "<xsl:choose>" are keywords and should not be translated. This
- * message describes a syntax error in the stylesheet.
- */
- {ErrorMsg.WHEN_ELEMENT_ERR,
- "<xsl:choose>\u5185\u3067\u306F<xsl:when>\u3068<xsl:otherwise>\u306E\u8981\u7D20\u306E\u307F\u304C\u8A31\u53EF\u3055\u308C\u307E\u3059\u3002"},
-
- /*
- * Note to translators: "<xsl:attribute-set>" and "name" are keywords
- * that should not be translated.
- */
- {ErrorMsg.UNNAMED_ATTRIBSET_ERR,
- "<xsl:attribute-set>\u306B'name'\u5C5E\u6027\u304C\u3042\u308A\u307E\u305B\u3093\u3002"},
-
- /*
- * Note to translators: An element in the stylesheet contained an
- * element of a type that it was not permitted to contain.
- */
- {ErrorMsg.ILLEGAL_CHILD_ERR,
- "\u5B50\u8981\u7D20\u304C\u4E0D\u6B63\u3067\u3059\u3002"},
-
- /*
- * Note to translators: The stylesheet tried to create an element with
- * a name that was not a valid XML name. The substitution text contains
- * the name.
- */
- {ErrorMsg.ILLEGAL_ELEM_NAME_ERR,
- "\u8981\u7D20''{0}''\u3092\u547C\u3073\u51FA\u3059\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093"},
-
- /*
- * Note to translators: The stylesheet tried to create an attribute
- * with a name that was not a valid XML name. The substitution text
- * contains the name.
- */
- {ErrorMsg.ILLEGAL_ATTR_NAME_ERR,
- "\u5C5E\u6027''{0}''\u3092\u547C\u3073\u51FA\u3059\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093"},
-
- /*
- * Note to translators: The children of the outermost element of a
- * stylesheet are referred to as top-level elements. No text should
- * occur within that outermost element unless it is within a top-level
- * element. This message indicates that that constraint was violated.
- * "<xsl:stylesheet>" is a keyword that should not be translated.
- */
- {ErrorMsg.ILLEGAL_TEXT_NODE_ERR,
- "\u30C6\u30AD\u30B9\u30C8\u30FB\u30C7\u30FC\u30BF\u306F\u30C8\u30C3\u30D7\u30EC\u30D9\u30EB\u306E<xsl:stylesheet>\u8981\u7D20\u306E\u5916\u5074\u306B\u3042\u308A\u307E\u3059\u3002"},
-
- /*
- * Note to translators: JAXP is an acronym for the Java API for XML
- * Processing. This message indicates that the XML parser provided to
- * XSLTC to process the XML input document had a configuration problem.
- */
- {ErrorMsg.SAX_PARSER_CONFIG_ERR,
- "JAXP\u30D1\u30FC\u30B5\u30FC\u304C\u6B63\u3057\u304F\u69CB\u6210\u3055\u308C\u3066\u3044\u307E\u305B\u3093"},
-
- /*
- * Note to translators: The substitution text names the internal error
- * encountered.
- */
- {ErrorMsg.INTERNAL_ERR,
- "\u30EA\u30AB\u30D0\u30EA\u4E0D\u80FD\u306AXSLTC\u5185\u90E8\u30A8\u30E9\u30FC: ''{0}''"},
-
- /*
- * Note to translators: The stylesheet contained an element that was
- * not recognized as part of the XSL syntax. The substitution text
- * gives the element name.
- */
- {ErrorMsg.UNSUPPORTED_XSL_ERR,
- "XSL\u8981\u7D20''{0}''\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"},
-
- /*
- * Note to translators: The stylesheet referred to an extension to the
- * XSL syntax and indicated that it was defined by XSLTC, but XSTLC does
- * not recognized the particular extension named. The substitution text
- * gives the extension name.
- */
- {ErrorMsg.UNSUPPORTED_EXT_ERR,
- "XSLTC\u62E1\u5F35''{0}''\u306F\u8A8D\u8B58\u3055\u308C\u307E\u305B\u3093\u3002"},
-
- /*
- * Note to translators: The XML document given to XSLTC as a stylesheet
- * was not, in fact, a stylesheet. XSLTC is able to detect that in this
- * case because the outermost element in the stylesheet has to be
- * declared with respect to the XSL namespace URI, but no declaration
- * for that namespace was seen.
- */
- {ErrorMsg.MISSING_XSLT_URI_ERR,
- "\u5165\u529B\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306F\u30B9\u30BF\u30A4\u30EB\u30B7\u30FC\u30C8\u3067\u306F\u3042\u308A\u307E\u305B\u3093(XSL\u306E\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u306F\u30EB\u30FC\u30C8\u8981\u7D20\u5185\u3067\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u305B\u3093)\u3002"},
-
- /*
- * Note to translators: XSLTC could not find the stylesheet document
- * with the name specified by the substitution text.
- */
- {ErrorMsg.MISSING_XSLT_TARGET_ERR,
- "\u30B9\u30BF\u30A4\u30EB\u30B7\u30FC\u30C8\u30FB\u30BF\u30FC\u30B2\u30C3\u30C8''{0}''\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002"},
-
- /*
- * Note to translators: access to the stylesheet target is denied
- */
- {ErrorMsg.ACCESSING_XSLT_TARGET_ERR,
- "accessExternalStylesheet\u30D7\u30ED\u30D1\u30C6\u30A3\u3067\u8A2D\u5B9A\u3055\u308C\u305F\u5236\u9650\u306B\u3088\u308A''{1}''\u30A2\u30AF\u30BB\u30B9\u304C\u8A31\u53EF\u3055\u308C\u3066\u3044\u306A\u3044\u305F\u3081\u3001\u30B9\u30BF\u30A4\u30EB\u30B7\u30FC\u30C8\u30FB\u30BF\u30FC\u30B2\u30C3\u30C8''{0}''\u3092\u8AAD\u307F\u53D6\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002"},
-
- /*
- * Note to translators: This message represents an internal error in
- * condition in XSLTC. The substitution text is the class name in XSLTC
- * that is missing some functionality.
- */
- {ErrorMsg.NOT_IMPLEMENTED_ERR,
- "''{0}''\u304C\u5B9F\u88C5\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"},
-
- /*
- * Note to translators: The XML document given to XSLTC as a stylesheet
- * was not, in fact, a stylesheet.
- */
- {ErrorMsg.NOT_STYLESHEET_ERR,
- "\u5165\u529B\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306BXSL\u30B9\u30BF\u30A4\u30EB\u30B7\u30FC\u30C8\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u305B\u3093\u3002"},
-
- /*
- * Note to translators: The element named in the substitution text was
- * encountered in the stylesheet but is not recognized.
- */
- {ErrorMsg.ELEMENT_PARSE_ERR,
- "\u8981\u7D20''{0}''\u3092\u89E3\u6790\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F"},
-
- /*
- * Note to translators: "use", "<key>", "node", "node-set", "string"
- * and "number" are keywords in this context and should not be
- * translated. This message indicates that the value of the "use"
- * attribute was not one of the permitted values.
- */
- {ErrorMsg.KEY_USE_ATTR_ERR,
- "<key>\u306Euse\u5C5E\u6027\u306F\u3001\u30CE\u30FC\u30C9\u3001\u30CE\u30FC\u30C9\u30BB\u30C3\u30C8\u3001\u6587\u5B57\u5217\u307E\u305F\u306F\u6570\u5024\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002"},
-
- /*
- * Note to translators: An XML document can specify the version of the
- * XML specification to which it adheres. This message indicates that
- * the version specified for the output document was not valid.
- */
- {ErrorMsg.OUTPUT_VERSION_ERR,
- "\u51FA\u529BXML\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u306F1.0\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
-
- /*
- * Note to translators: The operator in a comparison operation was
- * not recognized.
- */
- {ErrorMsg.ILLEGAL_RELAT_OP_ERR,
- "\u95A2\u4FC2\u5F0F\u306E\u4E0D\u660E\u306A\u6F14\u7B97\u5B50\u3067\u3059"},
-
- /*
- * Note to translators: An attribute set defines as a set of XML
- * attributes that can be added to an element in the output XML document
- * as a group. This message is reported if the name specified was not
- * used to declare an attribute set. The substitution text is the name
- * that is in error.
- */
- {ErrorMsg.ATTRIBSET_UNDEF_ERR,
- "\u5B58\u5728\u3057\u306A\u3044\u5C5E\u6027\u30BB\u30C3\u30C8''{0}''\u3092\u4F7F\u7528\u3057\u3088\u3046\u3068\u3057\u307E\u3057\u305F\u3002"},
-
- /*
- * Note to translators: The term "attribute value template" is a term
- * defined by XSLT which describes the value of an attribute that is
- * determined by an XPath expression. The message indicates that the
- * expression was syntactically incorrect; the substitution text
- * contains the expression that was in error.
- */
- {ErrorMsg.ATTR_VAL_TEMPLATE_ERR,
- "\u5C5E\u6027\u5024\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8''{0}''\u3092\u89E3\u6790\u3067\u304D\u307E\u305B\u3093\u3002"},
-
- /*
- * Note to translators: ???
- */
- {ErrorMsg.UNKNOWN_SIG_TYPE_ERR,
- "\u30AF\u30E9\u30B9''{0}''\u306E\u7F72\u540D\u306B\u4E0D\u660E\u306A\u30C7\u30FC\u30BF\u578B\u304C\u3042\u308A\u307E\u3059\u3002"},
-
- /*
- * Note to translators: The substitution text refers to data types.
- * The message is displayed if a value in a particular context needs to
- * be converted to type {1}, but that's not possible for a value of
- * type {0}.
- */
- {ErrorMsg.DATA_CONVERSION_ERR,
- "\u30C7\u30FC\u30BF\u578B''{0}''\u3092''{1}''\u306B\u5909\u63DB\u3067\u304D\u307E\u305B\u3093\u3002"},
-
- /*
- * Note to translators: "Templates" is a Java class name that should
- * not be translated.
- */
- {ErrorMsg.NO_TRANSLET_CLASS_ERR,
- "\u3053\u306E\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u306B\u306F\u6709\u52B9\u306Atranslet\u30AF\u30E9\u30B9\u5B9A\u7FA9\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u305B\u3093\u3002"},
-
- /*
- * Note to translators: "Templates" is a Java class name that should
- * not be translated.
- */
- {ErrorMsg.NO_MAIN_TRANSLET_ERR,
- "\u3053\u306E\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u306B\u306F\u540D\u524D''{0}''\u3092\u6301\u3064\u30AF\u30E9\u30B9\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u305B\u3093\u3002"},
-
- /*
- * Note to translators: The substitution text is the name of a class.
- */
- {ErrorMsg.TRANSLET_CLASS_ERR,
- "translet\u30AF\u30E9\u30B9''{0}''\u3092\u30ED\u30FC\u30C9\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002"},
-
- {ErrorMsg.TRANSLET_OBJECT_ERR,
- "Translet\u30AF\u30E9\u30B9\u304C\u30ED\u30FC\u30C9\u3055\u308C\u307E\u3057\u305F\u304C\u3001translet\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093\u3002"},
-
- /*
- * Note to translators: "ErrorListener" is a Java interface name that
- * should not be translated. The message indicates that the user tried
- * to set an ErrorListener object on object of the class named in the
- * substitution text with "null" Java value.
- */
- {ErrorMsg.ERROR_LISTENER_NULL_ERR,
- "''{0}''\u306EErrorListener\u3092null\u306B\u8A2D\u5B9A\u3057\u3088\u3046\u3068\u3057\u307E\u3057\u305F"},
-
- /*
- * Note to translators: StreamSource, SAXSource and DOMSource are Java
- * interface names that should not be translated.
- */
- {ErrorMsg.JAXP_UNKNOWN_SOURCE_ERR,
- "StreamSource\u3001SAXSource\u304A\u3088\u3073DOMSource\u306E\u307F\u304CXSLTC\u306B\u3088\u3063\u3066\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u3059"},
-
- /*
- * Note to translators: "Source" is a Java class name that should not
- * be translated. The substitution text is the name of Java method.
- */
- {ErrorMsg.JAXP_NO_SOURCE_ERR,
- "''{0}''\u306B\u6E21\u3055\u308C\u305F\u30BD\u30FC\u30B9\u30FB\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306B\u30B3\u30F3\u30C6\u30F3\u30C4\u304C\u3042\u308A\u307E\u305B\u3093\u3002"},
-
- /*
- * Note to translators: The message indicates that XSLTC failed to
- * compile the stylesheet into a translet (class file).
- */
- {ErrorMsg.JAXP_COMPILE_ERR,
- "\u30B9\u30BF\u30A4\u30EB\u30B7\u30FC\u30C8\u3092\u30B3\u30F3\u30D1\u30A4\u30EB\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F"},
-
- /*
- * Note to translators: "TransformerFactory" is a class name. In this
- * context, an attribute is a property or setting of the
- * TransformerFactory object. The substitution text is the name of the
- * unrecognised attribute. The method used to retrieve the attribute is
- * "getAttribute", so it's not clear whether it would be best to
- * translate the term "attribute".
- */
- {ErrorMsg.JAXP_INVALID_ATTR_ERR,
- "TransformerFactory\u306F\u5C5E\u6027''{0}''\u3092\u8A8D\u8B58\u3057\u307E\u305B\u3093\u3002"},
-
- {ErrorMsg.JAXP_INVALID_ATTR_VALUE_ERR,
- "''{0}''\u5C5E\u6027\u306B\u6307\u5B9A\u3055\u308C\u305F\u5024\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093\u3002"},
-
- /*
- * Note to translators: "setResult()" and "startDocument()" are Java
- * method names that should not be translated.
- */
- {ErrorMsg.JAXP_SET_RESULT_ERR,
- "setResult()\u306FstartDocument()\u3088\u308A\u3082\u524D\u306B\u547C\u3073\u51FA\u3059\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002"},
-
- /*
- * Note to translators: "Transformer" is a Java interface name that
- * should not be translated. A Transformer object should contained a
- * reference to a translet object in order to be used for
- * transformations; this message is produced if that requirement is not
- * met.
- */
- {ErrorMsg.JAXP_NO_TRANSLET_ERR,
- "\u30C8\u30E9\u30F3\u30B9\u30D5\u30A9\u30FC\u30DE\u306B\u306F\u30AB\u30D7\u30BB\u30EB\u5316\u3055\u308C\u305Ftranslet\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u304C\u3042\u308A\u307E\u305B\u3093\u3002"},
-
- /*
- * Note to translators: The XML document that results from a
- * transformation needs to be sent to an output handler object; this
- * message is produced if that requirement is not met.
- */
- {ErrorMsg.JAXP_NO_HANDLER_ERR,
- "\u5909\u63DB\u7D50\u679C\u306B\u5BFE\u3057\u3066\u5B9A\u7FA9\u6E08\u306E\u51FA\u529B\u30CF\u30F3\u30C9\u30E9\u304C\u3042\u308A\u307E\u305B\u3093\u3002"},
-
- /*
- * Note to translators: "Result" is a Java interface name in this
- * context. The substitution text is a method name.
- */
- {ErrorMsg.JAXP_NO_RESULT_ERR,
- "''{0}''\u306B\u6E21\u3055\u308C\u305F\u7D50\u679C\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306F\u7121\u52B9\u3067\u3059\u3002"},
-
- /*
- * Note to translators: "Transformer" is a Java interface name. The
- * user's program attempted to access an unrecognized property with the
- * name specified in the substitution text. The method used to retrieve
- * the property is "getOutputProperty", so it's not clear whether it
- * would be best to translate the term "property".
- */
- {ErrorMsg.JAXP_UNKNOWN_PROP_ERR,
- "\u7121\u52B9\u306A\u30C8\u30E9\u30F3\u30B9\u30D5\u30A9\u30FC\u30DE\u30FB\u30D7\u30ED\u30D1\u30C6\u30A3''{0}''\u306B\u30A2\u30AF\u30BB\u30B9\u3057\u3088\u3046\u3068\u3057\u307E\u3057\u305F\u3002"},
-
- /*
- * Note to translators: SAX2DOM is the name of a Java class that should
- * not be translated. This is an adapter in the sense that it takes a
- * DOM object and converts it to something that uses the SAX API.
- */
- {ErrorMsg.SAX2DOM_ADAPTER_ERR,
- "SAX2DOM\u30A2\u30C0\u30D7\u30BF''{0}''\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002"},
-
- /*
- * Note to translators: "XSLTCSource.build()" is a Java method name.
- * "systemId" is an XML term that is short for "system identification".
- */
- {ErrorMsg.XSLTC_SOURCE_ERR,
- "systemId\u3092\u8A2D\u5B9A\u305B\u305A\u306BXSLTCSource.build()\u304C\u547C\u3073\u51FA\u3055\u308C\u307E\u3057\u305F\u3002"},
-
- { ErrorMsg.ER_RESULT_NULL,
- "\u7D50\u679C\u306Fnull\u306B\u3067\u304D\u307E\u305B\u3093"},
-
- /*
- * Note to translators: This message indicates that the value argument
- * of setParameter must be a valid Java Object.
- */
- {ErrorMsg.JAXP_INVALID_SET_PARAM_VALUE,
- "\u30D1\u30E9\u30E1\u30FC\u30BF{0}\u306F\u6709\u52B9\u306AJava\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
-
-
- {ErrorMsg.COMPILE_STDIN_ERR,
- "-i\u30AA\u30D7\u30B7\u30E7\u30F3\u306F-o\u30AA\u30D7\u30B7\u30E7\u30F3\u3068\u3068\u3082\u306B\u4F7F\u7528\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002"},
-
-
- /*
- * Note to translators: This message contains usage information for a
- * means of invoking XSLTC from the command-line. The message is
- * formatted for presentation in English. The strings <output>,
- * <directory>, etc. indicate user-specified argument values, and can
- * be translated - the argument <package> refers to a Java package, so
- * it should be handled in the same way the term is handled for JDK
- * documentation.
- */
- {ErrorMsg.COMPILE_USAGE_STR,
- "\u5F62\u5F0F\n java com.sun.org.apache.xalan.internal.xsltc.cmdline.Compile [-o <output>]\n [-d <directory>] [-j <jarfile>] [-p <package>]\n [-n] [-x] [-u] [-v] [-h] { <stylesheet> | -i }\n\nOPTIONS\n -o <output> \u540D\u524D<output>\u3092\u751F\u6210\u6E08translet\u306B\n \u5272\u308A\u5F53\u3066\u308B\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u3067\u306F\u3001translet\u540D\u306F\n <stylesheet>\u540D\u306B\u7531\u6765\u3057\u307E\u3059\u3002\u3053\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\n \u8907\u6570\u306E\u30B9\u30BF\u30A4\u30EB\u30B7\u30FC\u30C8\u3092\u30B3\u30F3\u30D1\u30A4\u30EB\u3059\u308B\u5834\u5408\u306F\u7121\u8996\u3055\u308C\u307E\u3059\u3002\n -d <directory> translet\u306E\u5B9B\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u6307\u5B9A\u3059\u308B\n -j <jarfile> <jarfile>\u3067\u6307\u5B9A\u3055\u308C\u308B\u540D\u524D\u306Ejar\u30D5\u30A1\u30A4\u30EB\u306Btranslet\u30AF\u30E9\u30B9\u3092\n \u30D1\u30C3\u30B1\u30FC\u30B8\u3059\u308B\n -p <package> \u751F\u6210\u3055\u308C\u308B\u3059\u3079\u3066\u306Etranslet\u30AF\u30E9\u30B9\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u540D\n \u63A5\u982D\u8F9E\u3092\u6307\u5B9A\u3059\u308B\u3002\n -n \u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u306E\u30A4\u30F3\u30E9\u30A4\u30F3\u5316\u3092\u6709\u52B9\u306B\u3059\u308B(\u5E73\u5747\u3057\u3066\u30C7\u30D5\u30A9\u30EB\u30C8\u52D5\u4F5C\u306E\u65B9\u304C\n \u512A\u308C\u3066\u3044\u307E\u3059)\u3002\n -x \u8FFD\u52A0\u306E\u30C7\u30D0\u30C3\u30B0\u30FB\u30E1\u30C3\u30BB\u30FC\u30B8\u51FA\u529B\u3092\u30AA\u30F3\u306B\u3059\u308B\n -u <stylesheet>\u5F15\u6570\u3092URL\u3068\u3057\u3066\u89E3\u91C8\u3059\u308B\n -i \u30B9\u30BF\u30A4\u30EB\u30B7\u30FC\u30C8\u3092stdin\u304B\u3089\u8AAD\u307F\u8FBC\u3080\u3053\u3068\u3092\u30B3\u30F3\u30D1\u30A4\u30E9\u306B\u5F37\u5236\u3059\u308B\n -v \u30B3\u30F3\u30D1\u30A4\u30E9\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u51FA\u529B\u3059\u308B\n -h \u3053\u306E\u4F7F\u7528\u65B9\u6CD5\u306E\u6587\u3092\u51FA\u529B\u3059\u308B\n"},
-
- /*
- * Note to translators: This message contains usage information for a
- * means of invoking XSLTC from the command-line. The message is
- * formatted for presentation in English. The strings <jarfile>,
- * <document>, etc. indicate user-specified argument values, and can
- * be translated - the argument <class> refers to a Java class, so it
- * should be handled in the same way the term is handled for JDK
- * documentation.
- */
- {ErrorMsg.TRANSFORM_USAGE_STR,
- "\u5F62\u5F0F \n java com.sun.org.apache.xalan.internal.xsltc.cmdline.Transform [-j <jarfile>]\n [-x] [-n <iterations>] {-u <document_url> | <document>}\n <class> [<param1>=<value1> ...]\n\n translet <class>\u3092\u4F7F\u7528\u3057\u3066\u3001<document>\u3067\u6307\u5B9A\u3055\u308C\u308B\n XML\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3092\u5909\u63DB\u3059\u308B\u3002translet <class>\u306F\n \u30E6\u30FC\u30B6\u30FC\u306ECLASSPATH\u5185\u304B\u3001\u30AA\u30D7\u30B7\u30E7\u30F3\u3067\u6307\u5B9A\u3055\u308C\u305F<jarfile>\u5185\u306B\u3042\u308A\u307E\u3059\u3002\nOPTIONS\n -j <jarfile> translet\u3092\u30ED\u30FC\u30C9\u3059\u308Bjarfile\u3092\u6307\u5B9A\u3059\u308B\n -x \u8FFD\u52A0\u306E\u30C7\u30D0\u30C3\u30B0\u30FB\u30E1\u30C3\u30BB\u30FC\u30B8\u51FA\u529B\u3092\u30AA\u30F3\u306B\u3059\u308B\n -n <iterations> \u5909\u63DB\u3092<iterations>\u56DE\u5B9F\u884C\u3057\u3001\n \u30D7\u30ED\u30D5\u30A1\u30A4\u30EA\u30F3\u30B0\u60C5\u5831\u3092\u8868\u793A\u3059\u308B\n -u <document_url> XML\u5165\u529B\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3092URL\u3068\u3057\u3066\u6307\u5B9A\u3059\u308B\n"},
-
-
-
- /*
- * Note to translators: "<xsl:sort>", "<xsl:for-each>" and
- * "<xsl:apply-templates>" are keywords that should not be translated.
- * The message indicates that an xsl:sort element must be a child of
- * one of the other kinds of elements mentioned.
- */
- {ErrorMsg.STRAY_SORT_ERR,
- "<xsl:sort>\u306F<xsl:for-each>\u307E\u305F\u306F<xsl:apply-templates>\u306E\u5185\u90E8\u3067\u306E\u307F\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002"},
-
- /*
- * Note to translators: The message indicates that the encoding
- * requested for the output document was on that requires support that
- * is not available from the Java Virtual Machine being used to execute
- * the program.
- */
- {ErrorMsg.UNSUPPORTED_ENCODING,
- "\u51FA\u529B\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0''{0}''\u306F\u3053\u306EJVM\u3067\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"},
-
- /*
- * Note to translators: The message indicates that the XPath expression
- * named in the substitution text was not well formed syntactically.
- */
- {ErrorMsg.SYNTAX_ERR,
- "''{0}''\u306B\u69CB\u6587\u30A8\u30E9\u30FC\u304C\u3042\u308A\u307E\u3059\u3002"},
-
- /*
- * Note to translators: The substitution text is the name of a Java
- * class. The term "constructor" here is the Java term. The message is
- * displayed if XSLTC could not find a constructor for the specified
- * class.
- */
- {ErrorMsg.CONSTRUCTOR_NOT_FOUND,
- "\u5916\u90E8\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF''{0}''\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002"},
-
- /*
- * Note to translators: "static" is the Java keyword. The substitution
- * text is the name of a function. The first argument of that function
- * is not of the required type.
- */
- {ErrorMsg.NO_JAVA_FUNCT_THIS_REF,
- "static\u3067\u306A\u3044Java\u95A2\u6570''{0}''\u306E\u6700\u521D\u306E\u5F15\u6570\u306F\u7121\u52B9\u306A\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u53C2\u7167\u3067\u3059\u3002"},
-
- /*
- * Note to translators: An XPath expression was not of the type
- * required in a particular context. The substitution text is the
- * expression that was in error.
- */
- {ErrorMsg.TYPE_CHECK_ERR,
- "\u5F0F''{0}''\u306E\u30BF\u30A4\u30D7\u306E\u78BA\u8A8D\u4E2D\u306B\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002"},
-
- /*
- * Note to translators: An XPath expression was not of the type
- * required in a particular context. However, the location of the
- * problematic expression is unknown.
- */
- {ErrorMsg.TYPE_CHECK_UNK_LOC_ERR,
- "\u4E0D\u660E\u306A\u5834\u6240\u3067\u306E\u5F0F\u306E\u30BF\u30A4\u30D7\u306E\u78BA\u8A8D\u4E2D\u306B\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002"},
-
- /*
- * Note to translators: The substitution text is the name of a command-
- * line option that was not recognized.
- */
- {ErrorMsg.ILLEGAL_CMDLINE_OPTION_ERR,
- "\u30B3\u30DE\u30F3\u30C9\u884C\u30AA\u30D7\u30B7\u30E7\u30F3''{0}''\u306F\u7121\u52B9\u3067\u3059\u3002"},
-
- /*
- * Note to translators: The substitution text is the name of a command-
- * line option.
- */
- {ErrorMsg.CMDLINE_OPT_MISSING_ARG_ERR,
- "\u30B3\u30DE\u30F3\u30C9\u884C\u30AA\u30D7\u30B7\u30E7\u30F3''{0}''\u306B\u5FC5\u9808\u306E\u5F15\u6570\u304C\u3042\u308A\u307E\u305B\u3093\u3002"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text contains two error
- * messages. The spacing before the second substitution text indents
- * it the same amount as the first in English.
- */
- {ErrorMsg.WARNING_PLUS_WRAPPED_MSG,
- "WARNING: ''{0}''\n :{1}"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text is an error message.
- */
- {ErrorMsg.WARNING_MSG,
- "WARNING: ''{0}''"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text contains two error
- * messages. The spacing before the second substitution text indents
- * it the same amount as the first in English.
- */
- {ErrorMsg.FATAL_ERR_PLUS_WRAPPED_MSG,
- "FATAL ERROR: ''{0}''\n :{1}"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text is an error message.
- */
- {ErrorMsg.FATAL_ERR_MSG,
- "FATAL ERROR: ''{0}''"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text contains two error
- * messages. The spacing before the second substitution text indents
- * it the same amount as the first in English.
- */
- {ErrorMsg.ERROR_PLUS_WRAPPED_MSG,
- "ERROR: ''{0}''\n :{1}"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text is an error message.
- */
- {ErrorMsg.ERROR_MSG,
- "ERROR: ''{0}''"},
-
- /*
- * Note to translators: The substitution text is the name of a class.
- */
- {ErrorMsg.TRANSFORM_WITH_TRANSLET_STR,
- "translet ''{0}''\u3092\u4F7F\u7528\u3057\u3066\u5909\u63DB\u3057\u307E\u3059 "},
-
- /*
- * Note to translators: The first substitution is the name of a class,
- * while the second substitution is the name of a jar file.
- */
- {ErrorMsg.TRANSFORM_WITH_JAR_STR,
- "translet ''{0}''\u3092\u4F7F\u7528\u3057\u3066jar\u30D5\u30A1\u30A4\u30EB''{1}''\u304B\u3089\u5909\u63DB\u3057\u307E\u3059"},
-
- /*
- * Note to translators: "TransformerFactory" is the name of a Java
- * interface and must not be translated. The substitution text is
- * the name of the class that could not be instantiated.
- */
- {ErrorMsg.COULD_NOT_CREATE_TRANS_FACT,
- "TransformerFactory\u30AF\u30E9\u30B9''{0}''\u306E\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002"},
-
- /*
- * Note to translators: This message is produced when the user
- * specified a name for the translet class that contains characters
- * that are not permitted in a Java class name. The substitution
- * text "{0}" specifies the name the user requested, while "{1}"
- * specifies the name the processor used instead.
- */
- {ErrorMsg.TRANSLET_NAME_JAVA_CONFLICT,
- "\u540D\u524D''{0}''\u306B\u306FJava\u30AF\u30E9\u30B9\u306E\u540D\u524D\u306B\u8A31\u53EF\u3055\u308C\u3066\u3044\u306A\u3044\u6587\u5B57\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u305F\u3081\u3001translet\u30AF\u30E9\u30B9\u306E\u540D\u524D\u3068\u3057\u3066\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u540D\u524D''{1}''\u304C\u304B\u308F\u308A\u306B\u4F7F\u7528\u3055\u308C\u307E\u3059\u3002"},
-
- /*
- * Note to translators: The following message is used as a header.
- * All the error messages are collected together and displayed beneath
- * this message.
- */
- {ErrorMsg.COMPILER_ERROR_KEY,
- "\u30B3\u30F3\u30D1\u30A4\u30E9\u30FB\u30A8\u30E9\u30FC:"},
-
- /*
- * Note to translators: The following message is used as a header.
- * All the warning messages are collected together and displayed
- * beneath this message.
- */
- {ErrorMsg.COMPILER_WARNING_KEY,
- "\u30B3\u30F3\u30D1\u30A4\u30E9\u306E\u8B66\u544A:"},
-
- /*
- * Note to translators: The following message is used as a header.
- * All the error messages that are produced when the stylesheet is
- * applied to an input document are collected together and displayed
- * beneath this message. A 'translet' is the compiled form of a
- * stylesheet (see above).
- */
- {ErrorMsg.RUNTIME_ERROR_KEY,
- "Translet\u30A8\u30E9\u30FC:"},
-
- /*
- * Note to translators: An attribute whose value is constrained to
- * be a "QName" or a list of "QNames" had a value that was incorrect.
- * 'QName' is an XML syntactic term that must not be translated. The
- * substitution text contains the actual value of the attribute.
- */
- {ErrorMsg.INVALID_QNAME_ERR,
- "\u5024\u304C1\u3064\u306EQName\u307E\u305F\u306FQName\u306E\u7A7A\u767D\u6587\u5B57\u533A\u5207\u308A\u30EA\u30B9\u30C8\u3067\u3042\u308B\u3053\u3068\u304C\u5FC5\u8981\u306A\u5C5E\u6027\u306E\u5024\u304C''{0}''\u3067\u3057\u305F"},
-
- /*
- * Note to translators: An attribute whose value is required to
- * be an "NCName".
- * 'NCName' is an XML syntactic term that must not be translated. The
- * substitution text contains the actual value of the attribute.
- */
- {ErrorMsg.INVALID_NCNAME_ERR,
- "\u5024\u304CNCName\u3067\u3042\u308B\u3053\u3068\u304C\u5FC5\u8981\u306A\u5C5E\u6027\u306E\u5024\u304C''{0}''\u3067\u3057\u305F"},
-
- /*
- * Note to translators: An attribute with an incorrect value was
- * encountered. The permitted value is one of the literal values
- * "xml", "html" or "text"; it is also permitted to have the form of
- * a QName that is not also an NCName. The terms "method",
- * "xsl:output", "xml", "html" and "text" are keywords that must not
- * be translated. The term "qname-but-not-ncname" is an XML syntactic
- * term. The substitution text contains the actual value of the
- * attribute.
- */
- {ErrorMsg.INVALID_METHOD_IN_OUTPUT,
- "<xsl:output>\u8981\u7D20\u306E\u30E1\u30BD\u30C3\u30C9\u5C5E\u6027\u306E\u5024\u304C''{0}''\u3067\u3057\u305F\u3002\u5024\u306F''xml''\u3001''html''\u3001''text''\u307E\u305F\u306Fqname-but-not-ncname\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
-
- {ErrorMsg.JAXP_GET_FEATURE_NULL_NAME,
- "\u6A5F\u80FD\u540D\u306FTransformerFactory.getFeature(String name)\u5185\u3067null\u306B\u3067\u304D\u307E\u305B\u3093\u3002"},
-
- {ErrorMsg.JAXP_SET_FEATURE_NULL_NAME,
- "\u6A5F\u80FD\u540D\u306FTransformerFactory.setFeature(String name, boolean value)\u5185\u3067null\u306B\u3067\u304D\u307E\u305B\u3093\u3002"},
-
- {ErrorMsg.JAXP_UNSUPPORTED_FEATURE,
- "\u6A5F\u80FD''{0}''\u3092\u3053\u306ETransformerFactory\u306B\u8A2D\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002"},
-
- {ErrorMsg.JAXP_SECUREPROCESSING_FEATURE,
- "FEATURE_SECURE_PROCESSING: \u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u30FB\u30DE\u30CD\u30FC\u30B8\u30E3\u304C\u5B58\u5728\u3059\u308B\u3068\u304D\u3001\u6A5F\u80FD\u3092false\u306B\u8A2D\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002"},
-
- /*
- * Note to translators: This message describes an internal error in the
- * processor. The term "byte code" is a Java technical term for the
- * executable code in a Java method, and "try-catch-finally block"
- * refers to the Java keywords with those names. "Outlined" is a
- * technical term internal to XSLTC and should not be translated.
- */
- {ErrorMsg.OUTLINE_ERR_TRY_CATCH,
- "\u5185\u90E8XSLTC\u30A8\u30E9\u30FC: \u751F\u6210\u3055\u308C\u305F\u30D0\u30A4\u30C8\u30FB\u30B3\u30FC\u30C9\u306F\u3001try-catch-finally\u30D6\u30ED\u30C3\u30AF\u3092\u542B\u3093\u3067\u3044\u308B\u305F\u3081\u3001\u30A2\u30A6\u30C8\u30E9\u30A4\u30F3\u5316\u3067\u304D\u307E\u305B\u3093\u3002"},
-
- /*
- * Note to translators: This message describes an internal error in the
- * processor. The terms "OutlineableChunkStart" and
- * "OutlineableChunkEnd" are the names of classes internal to XSLTC and
- * should not be translated. The message indicates that for every
- * "start" there must be a corresponding "end", and vice versa, and
- * that if one of a pair of "start" and "end" appears between another
- * pair of corresponding "start" and "end", then the other half of the
- * pair must also be between that same enclosing pair.
- */
- {ErrorMsg.OUTLINE_ERR_UNBALANCED_MARKERS,
- "\u5185\u90E8XSLTC\u30A8\u30E9\u30FC: OutlineableChunkStart\u30DE\u30FC\u30AB\u30FC\u3068OutlineableChunkEnd\u30DE\u30FC\u30AB\u30FC\u306F\u3001\u5BFE\u306B\u306A\u3063\u3066\u304A\u308A\u3001\u304B\u3064\u6B63\u3057\u304F\u30CD\u30B9\u30C8\u3055\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002"},
-
- /*
- * Note to translators: This message describes an internal error in the
- * processor. The term "byte code" is a Java technical term for the
- * executable code in a Java method. The "method" that is being
- * referred to is a Java method in a translet that XSLTC is generating
- * in processing a stylesheet. The "instruction" that is being
- * referred to is one of the instrutions in the Java byte code in that
- * method. "Outlined" is a technical term internal to XSLTC and
- * should not be translated.
- */
- {ErrorMsg.OUTLINE_ERR_DELETED_TARGET,
- "\u5185\u90E8XSLTC\u30A8\u30E9\u30FC: \u30A2\u30A6\u30C8\u30E9\u30A4\u30F3\u5316\u3055\u308C\u305F\u30D0\u30A4\u30C8\u30FB\u30B3\u30FC\u30C9\u306E\u30D6\u30ED\u30C3\u30AF\u306E\u4E00\u90E8\u3067\u3042\u3063\u305F\u547D\u4EE4\u306F\u3001\u5143\u306E\u30E1\u30BD\u30C3\u30C9\u306E\u4E2D\u3067\u307E\u3060\u53C2\u7167\u3055\u308C\u3066\u3044\u307E\u3059\u3002"
- },
-
-
- /*
- * Note to translators: This message describes an internal error in the
- * processor. The "method" that is being referred to is a Java method
- * in a translet that XSLTC is generating.
- *
- */
- {ErrorMsg.OUTLINE_ERR_METHOD_TOO_BIG,
- "\u5185\u90E8XSLTC\u30A8\u30E9\u30FC: \u30C8\u30E9\u30F3\u30B9\u30EC\u30C3\u30C8\u5185\u306E\u30E1\u30BD\u30C3\u30C9\u304C\u3001Java\u4EEE\u60F3\u30DE\u30B7\u30F3\u306E\u5236\u9650(1\u30E1\u30BD\u30C3\u30C9\u306E\u9577\u3055\u306F\u6700\u592764\u30AD\u30ED\u30D0\u30A4\u30C8)\u3092\u8D85\u3048\u3066\u3044\u307E\u3059\u3002\u4E00\u822C\u7684\u306B\u3001\u30B9\u30BF\u30A4\u30EB\u30B7\u30FC\u30C8\u5185\u306E\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u306E\u30B5\u30A4\u30BA\u304C\u5927\u304D\u904E\u304E\u308B\u3053\u3068\u304C\u539F\u56E0\u3068\u3057\u3066\u8003\u3048\u3089\u308C\u307E\u3059\u3002\u5C0F\u3055\u3044\u30B5\u30A4\u30BA\u306E\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u3092\u4F7F\u7528\u3057\u3066\u3001\u30B9\u30BF\u30A4\u30EB\u30B7\u30FC\u30C8\u3092\u518D\u69CB\u6210\u3057\u3066\u304F\u3060\u3055\u3044\u3002"
- },
-
- {ErrorMsg.DESERIALIZE_TRANSLET_ERR, "Java\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u304C\u6709\u52B9\u5316\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u3001TemplatesImpl\u306E\u30C7\u30B7\u30EA\u30A2\u30E9\u30A4\u30BA\u306E\u30B5\u30DD\u30FC\u30C8\u306F\u7121\u52B9\u5316\u3055\u308C\u307E\u3059\u3002\u3053\u308C\u306F\u3001jdk.xml.enableTemplatesImplDeserialization\u30B7\u30B9\u30C6\u30E0\u30FB\u30D7\u30ED\u30D1\u30C6\u30A3\u3092true\u306B\u8A2D\u5B9A\u3057\u3066\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3067\u304D\u307E\u3059\u3002"}
-
- };
-
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ko.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ko.java
deleted file mode 100644
index e0f0ef6..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ko.java
+++ /dev/null
@@ -1,974 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-
-import java.util.ListResourceBundle;
-
-/**
- * @author Morten Jorgensen
- */
-public class ErrorMessages_ko extends ListResourceBundle {
-
-/*
- * XSLTC compile-time error messages.
- *
- * General notes to translators and definitions:
- *
- * 1) XSLTC is the name of the product. It is an acronym for "XSLT Compiler".
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An axis is a particular "dimension" in a tree representation of an XML
- * document; the nodes in the tree are divided along different axes.
- * Traversing the "child" axis, for instance, means that the program
- * would visit each child of a particular node; traversing the "descendant"
- * axis means that the program would visit the child nodes of a particular
- * node, their children, and so on until the leaf nodes of the tree are
- * reached.
- *
- * 5) An iterator is an object that traverses nodes in a tree along a
- * particular axis, one at a time.
- *
- * 6) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 7) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 8) DOM is an acronym for Document Object Model. It is a tree
- * representation of an XML document.
- *
- * SAX is an acronym for the Simple API for XML processing. It is an API
- * used inform an XML processor (in this case XSLTC) of the structure and
- * content of an XML document.
- *
- * Input to the stylesheet processor can come from an XML parser in the
- * form of a DOM tree or through the SAX API.
- *
- * 9) DTD is a document type declaration. It is a way of specifying the
- * grammar for an XML file, the names and types of elements, attributes,
- * etc.
- *
- * 10) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- * 11) Translet is an invented term that refers to the class file that contains
- * the compiled form of a stylesheet.
- */
-
- // These message should be read from a locale-specific resource bundle
- /** Get the lookup table for error messages.
- *
- * @return The message lookup table.
- */
- public Object[][] getContents()
- {
- return new Object[][] {
- {ErrorMsg.MULTIPLE_STYLESHEET_ERR,
- "\uB3D9\uC77C\uD55C \uD30C\uC77C\uC5D0 \uC2A4\uD0C0\uC77C\uC2DC\uD2B8\uAC00 \uB450 \uAC1C \uC774\uC0C1 \uC815\uC758\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: The substitution text is the name of a
- * template. The same name was used on two different templates in the
- * same stylesheet.
- */
- {ErrorMsg.TEMPLATE_REDEF_ERR,
- "\uC774 \uC2A4\uD0C0\uC77C\uC2DC\uD2B8\uC5D0\uB294 ''{0}'' \uD15C\uD50C\uB9AC\uD2B8\uAC00 \uC774\uBBF8 \uC815\uC758\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
-
-
- /*
- * Note to translators: The substitution text is the name of a
- * template. A reference to the template name was encountered, but the
- * template is undefined.
- */
- {ErrorMsg.TEMPLATE_UNDEF_ERR,
- "\uC774 \uC2A4\uD0C0\uC77C\uC2DC\uD2B8\uC5D0\uB294 ''{0}'' \uD15C\uD50C\uB9AC\uD2B8\uAC00 \uC815\uC758\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: The substitution text is the name of a variable
- * that was defined more than once.
- */
- {ErrorMsg.VARIABLE_REDEF_ERR,
- "\uB3D9\uC77C\uD55C \uBC94\uC704\uC5D0\uC11C ''{0}'' \uBCC0\uC218\uAC00 \uC5EC\uB7EC \uAC1C \uC815\uC758\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: The substitution text is the name of a variable
- * or parameter. A reference to the variable or parameter was found,
- * but it was never defined.
- */
- {ErrorMsg.VARIABLE_UNDEF_ERR,
- "\uBCC0\uC218 \uB610\uB294 \uB9E4\uAC1C\uBCC0\uC218 ''{0}''\uC774(\uAC00) \uC815\uC758\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: The word "class" here refers to a Java class.
- * Processing the stylesheet required a class to be loaded, but it could
- * not be found. The substitution text is the name of the class.
- */
- {ErrorMsg.CLASS_NOT_FOUND_ERR,
- "''{0}'' \uD074\uB798\uC2A4\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: The word "method" here refers to a Java method.
- * Processing the stylesheet required a reference to the method named by
- * the substitution text, but it could not be found. "public" is the
- * Java keyword.
- */
- {ErrorMsg.METHOD_NOT_FOUND_ERR,
- "\uC678\uBD80 \uBA54\uC18C\uB4DC ''{0}''\uC744(\uB97C) \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uC774 \uBA54\uC18C\uB4DC\uB294 public\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4."},
-
- /*
- * Note to translators: The word "method" here refers to a Java method.
- * Processing the stylesheet required a reference to the method named by
- * the substitution text, but no method with the required types of
- * arguments or return type could be found.
- */
- {ErrorMsg.ARGUMENT_CONVERSION_ERR,
- "''{0}'' \uBA54\uC18C\uB4DC\uC5D0 \uB300\uD55C \uD638\uCD9C\uC5D0\uC11C \uC778\uC218/\uBC18\uD658 \uC720\uD615\uC744 \uBCC0\uD658\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: The file or URI named in the substitution text
- * is missing.
- */
- {ErrorMsg.FILE_NOT_FOUND_ERR,
- "\uD30C\uC77C \uB610\uB294 URI ''{0}''\uC744(\uB97C) \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: This message is displayed when the URI
- * mentioned in the substitution text is not well-formed syntactically.
- */
- {ErrorMsg.INVALID_URI_ERR,
- "URI ''{0}''\uC774(\uAC00) \uBD80\uC801\uD569\uD569\uB2C8\uB2E4."},
-
- /*
- * Note to translators: The file or URI named in the substitution text
- * exists but could not be opened.
- */
- {ErrorMsg.FILE_ACCESS_ERR,
- "\uD30C\uC77C \uB610\uB294 URI ''{0}''\uC744(\uB97C) \uC5F4 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: <xsl:stylesheet> and <xsl:transform> are
- * keywords that should not be translated.
- */
- {ErrorMsg.MISSING_ROOT_ERR,
- "<xsl:stylesheet> \uB610\uB294 <xsl:transform> \uC694\uC18C\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4."},
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- {ErrorMsg.NAMESPACE_UNDEF_ERR,
- "\uB124\uC784\uC2A4\uD398\uC774\uC2A4 \uC811\uB450\uC5B4 ''{0}''\uC774(\uAC00) \uC120\uC5B8\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: The Java function named in the stylesheet could
- * not be found.
- */
- {ErrorMsg.FUNCTION_RESOLVE_ERR,
- "''{0}'' \uD568\uC218\uC5D0 \uB300\uD55C \uD638\uCD9C\uC744 \uBD84\uC11D\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: The substitution text is the name of a
- * function. A literal string here means a constant string value.
- */
- {ErrorMsg.NEED_LITERAL_ERR,
- "''{0}''\uC5D0 \uB300\uD55C \uC778\uC218\uB294 \uB9AC\uD130\uB7F4 \uBB38\uC790\uC5F4\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4."},
-
- /*
- * Note to translators: This message indicates there was a syntactic
- * error in the form of an XPath expression. The substitution text is
- * the expression.
- */
- {ErrorMsg.XPATH_PARSER_ERR,
- "XPath \uD45C\uD604\uC2DD ''{0}''\uC758 \uAD6C\uBB38\uC744 \uBD84\uC11D\uD558\uB294 \uC911 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: An element in the stylesheet requires a
- * particular attribute named by the substitution text, but that
- * attribute was not specified in the stylesheet.
- */
- {ErrorMsg.REQUIRED_ATTR_ERR,
- "\uD544\uC218 \uC18D\uC131 ''{0}''\uC774(\uAC00) \uB204\uB77D\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: This message indicates that a character not
- * permitted in an XPath expression was encountered. The substitution
- * text is the offending character.
- */
- {ErrorMsg.ILLEGAL_CHAR_ERR,
- "XPath \uD45C\uD604\uC2DD\uC5D0 \uC798\uBABB\uB41C \uBB38\uC790 ''{0}''\uC774(\uAC00) \uC788\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: A processing instruction is a mark-up item in
- * an XML document that request some behaviour of an XML processor. The
- * form of the name of was invalid in this case, and the substitution
- * text is the name.
- */
- {ErrorMsg.ILLEGAL_PI_ERR,
- "''{0}''\uC740(\uB294) \uBA85\uB839 \uCC98\uB9AC\uC5D0 \uC798\uBABB\uB41C \uC774\uB984\uC785\uB2C8\uB2E4."},
-
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- {ErrorMsg.STRAY_ATTRIBUTE_ERR,
- "''{0}'' \uC18D\uC131\uC774 \uC694\uC18C\uC5D0 \uD3EC\uD568\uB418\uC5B4 \uC788\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: An attribute that wasn't recognized was
- * specified on an element in the stylesheet. The attribute is named
- * by the substitution
- * text.
- */
- {ErrorMsg.ILLEGAL_ATTRIBUTE_ERR,
- "''{0}''\uC740(\uB294) \uC798\uBABB\uB41C \uC18D\uC131\uC785\uB2C8\uB2E4."},
-
- /*
- * Note to translators: "import" and "include" are keywords that should
- * not be translated. This messages indicates that the stylesheet
- * named in the substitution text imported or included itself either
- * directly or indirectly.
- */
- {ErrorMsg.CIRCULAR_INCLUDE_ERR,
- "\uC21C\uD658 import/include\uC785\uB2C8\uB2E4. ''{0}'' \uC2A4\uD0C0\uC77C\uC2DC\uD2B8\uAC00 \uC774\uBBF8 \uB85C\uB4DC\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: A result-tree fragment is a portion of a
- * resulting XML document represented as a tree. "<xsl:sort>" is a
- * keyword and should not be translated.
- */
- {ErrorMsg.RESULT_TREE_SORT_ERR,
- "Result-tree \uBD80\uBD84\uC744 \uC815\uB82C\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4(<xsl:sort> \uC694\uC18C\uAC00 \uBB34\uC2DC\uB428). \uACB0\uACFC \uD2B8\uB9AC\uB97C \uC0DD\uC131\uD560 \uB54C\uB294 \uB178\uB4DC\uB97C \uC815\uB82C\uD574\uC57C \uD569\uB2C8\uB2E4."},
-
- /*
- * Note to translators: A name can be given to a particular style to be
- * used to format decimal values. The substitution text gives the name
- * of such a style for which more than one declaration was encountered.
- */
- {ErrorMsg.SYMBOLS_REDEF_ERR,
- "\uC2ED\uC9C4\uC218 \uD615\uC2DD ''{0}''\uC774(\uAC00) \uC774\uBBF8 \uC815\uC758\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: The stylesheet version named in the
- * substitution text is not supported.
- */
- {ErrorMsg.XSL_VERSION_ERR,
- "XSLTC\uB294 XSL \uBC84\uC804 ''{0}''\uC744(\uB97C) \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: The definitions of one or more variables or
- * parameters depend on one another.
- */
- {ErrorMsg.CIRCULAR_VARIABLE_ERR,
- "''{0}''\uC5D0 \uC21C\uD658 \uBCC0\uC218/\uB9E4\uAC1C\uBCC0\uC218 \uCC38\uC870\uAC00 \uC788\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: The operator in an expresion with two operands was
- * not recognized.
- */
- {ErrorMsg.ILLEGAL_BINARY_OP_ERR,
- "\uBC14\uC774\uB108\uB9AC \uD45C\uD604\uC2DD\uC5D0 \uB300\uD574 \uC54C \uC218 \uC5C6\uB294 \uC5F0\uC0B0\uC790\uC785\uB2C8\uB2E4."},
-
- /*
- * Note to translators: This message is produced if a reference to a
- * function has too many or too few arguments.
- */
- {ErrorMsg.ILLEGAL_ARG_ERR,
- "\uD568\uC218 \uD638\uCD9C\uC5D0 \uB300\uD55C \uC778\uC218\uAC00 \uC798\uBABB\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: "document()" is the name of function and must
- * not be translated. A node-set is a set of the nodes in the tree
- * representation of an XML document.
- */
- {ErrorMsg.DOCUMENT_ARG_ERR,
- "document() \uD568\uC218\uC5D0 \uB300\uD55C \uB450\uBC88\uC9F8 \uC778\uC218\uB294 node-set\uC5EC\uC57C \uD569\uB2C8\uB2E4."},
-
- /*
- * Note to translators: "<xsl:when>" and "<xsl:choose>" are keywords
- * and should not be translated. This message describes a syntax error
- * in the stylesheet.
- */
- {ErrorMsg.MISSING_WHEN_ERR,
- "<xsl:choose>\uC5D0\uB294 <xsl:when> \uC694\uC18C\uAC00 \uD558\uB098 \uC774\uC0C1 \uD544\uC694\uD569\uB2C8\uB2E4."},
-
- /*
- * Note to translators: "<xsl:otherwise>" and "<xsl:choose>" are
- * keywords and should not be translated. This message describes a
- * syntax error in the stylesheet.
- */
- {ErrorMsg.MULTIPLE_OTHERWISE_ERR,
- "<xsl:choose>\uC5D0\uC11C\uB294 <xsl:otherwise> \uC694\uC18C\uAC00 \uD558\uB098\uB9CC \uD5C8\uC6A9\uB429\uB2C8\uB2E4."},
-
- /*
- * Note to translators: "<xsl:otherwise>" and "<xsl:choose>" are
- * keywords and should not be translated. This message describes a
- * syntax error in the stylesheet.
- */
- {ErrorMsg.STRAY_OTHERWISE_ERR,
- "<xsl:otherwise>\uB294 <xsl:choose>\uC5D0\uC11C\uB9CC \uC0AC\uC6A9\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: "<xsl:when>" and "<xsl:choose>" are keywords
- * and should not be translated. This message describes a syntax error
- * in the stylesheet.
- */
- {ErrorMsg.STRAY_WHEN_ERR,
- "<xsl:when>\uC740 <xsl:choose>\uC5D0\uC11C\uB9CC \uC0AC\uC6A9\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: "<xsl:when>", "<xsl:otherwise>" and
- * "<xsl:choose>" are keywords and should not be translated. This
- * message describes a syntax error in the stylesheet.
- */
- {ErrorMsg.WHEN_ELEMENT_ERR,
- "<xsl:choose>\uC5D0\uC11C\uB294 <xsl:when> \uBC0F <xsl:otherwise> \uC694\uC18C\uB9CC \uD5C8\uC6A9\uB429\uB2C8\uB2E4."},
-
- /*
- * Note to translators: "<xsl:attribute-set>" and "name" are keywords
- * that should not be translated.
- */
- {ErrorMsg.UNNAMED_ATTRIBSET_ERR,
- "<xsl:attribute-set>\uC5D0 'name' \uC18D\uC131\uC774 \uB204\uB77D\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: An element in the stylesheet contained an
- * element of a type that it was not permitted to contain.
- */
- {ErrorMsg.ILLEGAL_CHILD_ERR,
- "\uD558\uC704 \uC694\uC18C\uAC00 \uC798\uBABB\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: The stylesheet tried to create an element with
- * a name that was not a valid XML name. The substitution text contains
- * the name.
- */
- {ErrorMsg.ILLEGAL_ELEM_NAME_ERR,
- "''{0}'' \uC694\uC18C\uB97C \uD638\uCD9C\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: The stylesheet tried to create an attribute
- * with a name that was not a valid XML name. The substitution text
- * contains the name.
- */
- {ErrorMsg.ILLEGAL_ATTR_NAME_ERR,
- "''{0}'' \uC18D\uC131\uC744 \uD638\uCD9C\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: The children of the outermost element of a
- * stylesheet are referred to as top-level elements. No text should
- * occur within that outermost element unless it is within a top-level
- * element. This message indicates that that constraint was violated.
- * "<xsl:stylesheet>" is a keyword that should not be translated.
- */
- {ErrorMsg.ILLEGAL_TEXT_NODE_ERR,
- "\uD14D\uC2A4\uD2B8 \uB370\uC774\uD130\uAC00 \uCD5C\uC0C1\uC704 \uB808\uBCA8 <xsl:stylesheet> \uC694\uC18C\uC5D0 \uD3EC\uD568\uB418\uC5B4 \uC788\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: JAXP is an acronym for the Java API for XML
- * Processing. This message indicates that the XML parser provided to
- * XSLTC to process the XML input document had a configuration problem.
- */
- {ErrorMsg.SAX_PARSER_CONFIG_ERR,
- "JAXP \uAD6C\uBB38 \uBD84\uC11D\uAE30\uAC00 \uC81C\uB300\uB85C \uAD6C\uC131\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: The substitution text names the internal error
- * encountered.
- */
- {ErrorMsg.INTERNAL_ERR,
- "\uBCF5\uAD6C\uD560 \uC218 \uC5C6\uB294 XSLTC \uB0B4\uBD80 \uC624\uB958: ''{0}''"},
-
- /*
- * Note to translators: The stylesheet contained an element that was
- * not recognized as part of the XSL syntax. The substitution text
- * gives the element name.
- */
- {ErrorMsg.UNSUPPORTED_XSL_ERR,
- "''{0}''\uC740(\uB294) \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uB294 XSL \uC694\uC18C\uC785\uB2C8\uB2E4."},
-
- /*
- * Note to translators: The stylesheet referred to an extension to the
- * XSL syntax and indicated that it was defined by XSLTC, but XSTLC does
- * not recognized the particular extension named. The substitution text
- * gives the extension name.
- */
- {ErrorMsg.UNSUPPORTED_EXT_ERR,
- "''{0}''\uC740(\uB294) \uC54C \uC218 \uC5C6\uB294 XSLTC \uD655\uC7A5\uC785\uB2C8\uB2E4."},
-
- /*
- * Note to translators: The XML document given to XSLTC as a stylesheet
- * was not, in fact, a stylesheet. XSLTC is able to detect that in this
- * case because the outermost element in the stylesheet has to be
- * declared with respect to the XSL namespace URI, but no declaration
- * for that namespace was seen.
- */
- {ErrorMsg.MISSING_XSLT_URI_ERR,
- "\uC785\uB825 \uBB38\uC11C\uB294 \uC2A4\uD0C0\uC77C\uC2DC\uD2B8\uAC00 \uC544\uB2D9\uB2C8\uB2E4. XSL \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uAC00 \uB8E8\uD2B8 \uC694\uC18C\uC5D0 \uC120\uC5B8\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: XSLTC could not find the stylesheet document
- * with the name specified by the substitution text.
- */
- {ErrorMsg.MISSING_XSLT_TARGET_ERR,
- "\uC2A4\uD0C0\uC77C\uC2DC\uD2B8 \uB300\uC0C1 ''{0}''\uC744(\uB97C) \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: access to the stylesheet target is denied
- */
- {ErrorMsg.ACCESSING_XSLT_TARGET_ERR,
- "accessExternalStylesheet \uC18D\uC131\uC73C\uB85C \uC124\uC815\uB41C \uC81C\uD55C\uC73C\uB85C \uC778\uD574 ''{1}'' \uC561\uC138\uC2A4\uAC00 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC73C\uBBC0\uB85C \uC2A4\uD0C0\uC77C\uC2DC\uD2B8 \uB300\uC0C1 ''{0}''\uC744(\uB97C) \uC77D\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: This message represents an internal error in
- * condition in XSLTC. The substitution text is the class name in XSLTC
- * that is missing some functionality.
- */
- {ErrorMsg.NOT_IMPLEMENTED_ERR,
- "\uAD6C\uD604\uB418\uC9C0 \uC54A\uC74C: ''{0}''."},
-
- /*
- * Note to translators: The XML document given to XSLTC as a stylesheet
- * was not, in fact, a stylesheet.
- */
- {ErrorMsg.NOT_STYLESHEET_ERR,
- "\uC785\uB825 \uBB38\uC11C\uC5D0 XSL \uC2A4\uD0C0\uC77C\uC2DC\uD2B8\uAC00 \uD3EC\uD568\uB418\uC5B4 \uC788\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: The element named in the substitution text was
- * encountered in the stylesheet but is not recognized.
- */
- {ErrorMsg.ELEMENT_PARSE_ERR,
- "''{0}'' \uC694\uC18C\uC758 \uAD6C\uBB38\uC744 \uBD84\uC11D\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: "use", "<key>", "node", "node-set", "string"
- * and "number" are keywords in this context and should not be
- * translated. This message indicates that the value of the "use"
- * attribute was not one of the permitted values.
- */
- {ErrorMsg.KEY_USE_ATTR_ERR,
- "<key>\uC758 use \uC18D\uC131\uC740 node, node-set, string \uB610\uB294 number\uC5EC\uC57C \uD569\uB2C8\uB2E4."},
-
- /*
- * Note to translators: An XML document can specify the version of the
- * XML specification to which it adheres. This message indicates that
- * the version specified for the output document was not valid.
- */
- {ErrorMsg.OUTPUT_VERSION_ERR,
- "\uCD9C\uB825 XML \uBB38\uC11C \uBC84\uC804\uC740 1.0\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4."},
-
- /*
- * Note to translators: The operator in a comparison operation was
- * not recognized.
- */
- {ErrorMsg.ILLEGAL_RELAT_OP_ERR,
- "\uAD00\uACC4 \uD45C\uD604\uC2DD\uC5D0 \uB300\uD574 \uC54C \uC218 \uC5C6\uB294 \uC5F0\uC0B0\uC790\uC785\uB2C8\uB2E4."},
-
- /*
- * Note to translators: An attribute set defines as a set of XML
- * attributes that can be added to an element in the output XML document
- * as a group. This message is reported if the name specified was not
- * used to declare an attribute set. The substitution text is the name
- * that is in error.
- */
- {ErrorMsg.ATTRIBSET_UNDEF_ERR,
- "\uC874\uC7AC\uD558\uC9C0 \uC54A\uB294 \uC18D\uC131 \uC9D1\uD569 ''{0}''\uC744(\uB97C) \uC0AC\uC6A9\uD558\uB824\uACE0 \uC2DC\uB3C4\uD558\uB294 \uC911\uC785\uB2C8\uB2E4."},
-
- /*
- * Note to translators: The term "attribute value template" is a term
- * defined by XSLT which describes the value of an attribute that is
- * determined by an XPath expression. The message indicates that the
- * expression was syntactically incorrect; the substitution text
- * contains the expression that was in error.
- */
- {ErrorMsg.ATTR_VAL_TEMPLATE_ERR,
- "\uC18D\uC131\uAC12 \uD15C\uD50C\uB9AC\uD2B8 ''{0}''\uC758 \uAD6C\uBB38\uC744 \uBD84\uC11D\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: ???
- */
- {ErrorMsg.UNKNOWN_SIG_TYPE_ERR,
- "''{0}'' \uD074\uB798\uC2A4\uC5D0 \uB300\uD55C \uC11C\uBA85\uC5D0 \uC54C \uC218 \uC5C6\uB294 \uB370\uC774\uD130 \uC720\uD615\uC774 \uC788\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: The substitution text refers to data types.
- * The message is displayed if a value in a particular context needs to
- * be converted to type {1}, but that's not possible for a value of
- * type {0}.
- */
- {ErrorMsg.DATA_CONVERSION_ERR,
- "\uB370\uC774\uD130 \uC720\uD615 ''{0}''\uC744(\uB97C) ''{1}''(\uC73C)\uB85C \uBCC0\uD658\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: "Templates" is a Java class name that should
- * not be translated.
- */
- {ErrorMsg.NO_TRANSLET_CLASS_ERR,
- "\uC774 Templates\uC5D0\uB294 \uC801\uD569\uD55C translet \uD074\uB798\uC2A4 \uC815\uC758\uAC00 \uD3EC\uD568\uB418\uC5B4 \uC788\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: "Templates" is a Java class name that should
- * not be translated.
- */
- {ErrorMsg.NO_MAIN_TRANSLET_ERR,
- "\uC774 Templates\uC5D0\uB294 \uC774\uB984\uC774 ''{0}''\uC778 \uD074\uB798\uC2A4\uAC00 \uD3EC\uD568\uB418\uC5B4 \uC788\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: The substitution text is the name of a class.
- */
- {ErrorMsg.TRANSLET_CLASS_ERR,
- "Translet \uD074\uB798\uC2A4 ''{0}''\uC744(\uB97C) \uB85C\uB4DC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- {ErrorMsg.TRANSLET_OBJECT_ERR,
- "Translet \uD074\uB798\uC2A4\uAC00 \uB85C\uB4DC\uB418\uC5C8\uC9C0\uB9CC translet \uC778\uC2A4\uD134\uC2A4\uB97C \uC0DD\uC131\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: "ErrorListener" is a Java interface name that
- * should not be translated. The message indicates that the user tried
- * to set an ErrorListener object on object of the class named in the
- * substitution text with "null" Java value.
- */
- {ErrorMsg.ERROR_LISTENER_NULL_ERR,
- "''{0}''\uC5D0 \uB300\uD55C ErrorListener\uB97C null\uB85C \uC124\uC815\uD558\uB824\uACE0 \uC2DC\uB3C4\uD558\uB294 \uC911"},
-
- /*
- * Note to translators: StreamSource, SAXSource and DOMSource are Java
- * interface names that should not be translated.
- */
- {ErrorMsg.JAXP_UNKNOWN_SOURCE_ERR,
- "XSLTC\uB294 StreamSource, SAXSource \uBC0F DOMSource\uB9CC \uC9C0\uC6D0\uD569\uB2C8\uB2E4."},
-
- /*
- * Note to translators: "Source" is a Java class name that should not
- * be translated. The substitution text is the name of Java method.
- */
- {ErrorMsg.JAXP_NO_SOURCE_ERR,
- "''{0}''(\uC73C)\uB85C \uC804\uB2EC\uB41C Source \uAC1D\uCCB4\uC5D0 \uCF58\uD150\uCE20\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: The message indicates that XSLTC failed to
- * compile the stylesheet into a translet (class file).
- */
- {ErrorMsg.JAXP_COMPILE_ERR,
- "\uC2A4\uD0C0\uC77C\uC2DC\uD2B8\uB97C \uCEF4\uD30C\uC77C\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: "TransformerFactory" is a class name. In this
- * context, an attribute is a property or setting of the
- * TransformerFactory object. The substitution text is the name of the
- * unrecognised attribute. The method used to retrieve the attribute is
- * "getAttribute", so it's not clear whether it would be best to
- * translate the term "attribute".
- */
- {ErrorMsg.JAXP_INVALID_ATTR_ERR,
- "TransformerFactory\uC5D0\uC11C ''{0}'' \uC18D\uC131\uC744 \uC778\uC2DD\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."},
-
- {ErrorMsg.JAXP_INVALID_ATTR_VALUE_ERR,
- "''{0}'' \uC18D\uC131\uC5D0 \uB300\uD574 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC740 \uAC12\uC774 \uC9C0\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: "setResult()" and "startDocument()" are Java
- * method names that should not be translated.
- */
- {ErrorMsg.JAXP_SET_RESULT_ERR,
- "setResult()\uB294 startDocument() \uC55E\uC5D0 \uD638\uCD9C\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4."},
-
- /*
- * Note to translators: "Transformer" is a Java interface name that
- * should not be translated. A Transformer object should contained a
- * reference to a translet object in order to be used for
- * transformations; this message is produced if that requirement is not
- * met.
- */
- {ErrorMsg.JAXP_NO_TRANSLET_ERR,
- "Transformer\uC5D0 \uCEA1\uC290\uD654\uB41C translet \uAC1D\uCCB4\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: The XML document that results from a
- * transformation needs to be sent to an output handler object; this
- * message is produced if that requirement is not met.
- */
- {ErrorMsg.JAXP_NO_HANDLER_ERR,
- "\uBCC0\uD658 \uACB0\uACFC\uC5D0 \uB300\uD574 \uC815\uC758\uB41C \uCD9C\uB825 \uCC98\uB9AC\uAE30\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: "Result" is a Java interface name in this
- * context. The substitution text is a method name.
- */
- {ErrorMsg.JAXP_NO_RESULT_ERR,
- "''{0}''(\uC73C)\uB85C \uC804\uB2EC\uB41C Result \uAC1D\uCCB4\uAC00 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4."},
-
- /*
- * Note to translators: "Transformer" is a Java interface name. The
- * user's program attempted to access an unrecognized property with the
- * name specified in the substitution text. The method used to retrieve
- * the property is "getOutputProperty", so it's not clear whether it
- * would be best to translate the term "property".
- */
- {ErrorMsg.JAXP_UNKNOWN_PROP_ERR,
- "\uBD80\uC801\uD569\uD55C Transformer \uC18D\uC131 ''{0}''\uC5D0 \uC561\uC138\uC2A4\uD558\uB824\uACE0 \uC2DC\uB3C4\uD558\uB294 \uC911\uC785\uB2C8\uB2E4."},
-
- /*
- * Note to translators: SAX2DOM is the name of a Java class that should
- * not be translated. This is an adapter in the sense that it takes a
- * DOM object and converts it to something that uses the SAX API.
- */
- {ErrorMsg.SAX2DOM_ADAPTER_ERR,
- "SAX2DOM \uC5B4\uB311\uD130\uB97C \uC0DD\uC131\uD560 \uC218 \uC5C6\uC74C: ''{0}''."},
-
- /*
- * Note to translators: "XSLTCSource.build()" is a Java method name.
- * "systemId" is an XML term that is short for "system identification".
- */
- {ErrorMsg.XSLTC_SOURCE_ERR,
- "systemId\uB97C \uC124\uC815\uD558\uC9C0 \uC54A\uC740 \uC0C1\uD0DC\uB85C XSLTCSource.build()\uAC00 \uD638\uCD9C\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
-
- { ErrorMsg.ER_RESULT_NULL,
- "\uACB0\uACFC\uB294 \uB110\uC774 \uC544\uB2C8\uC5B4\uC57C \uD569\uB2C8\uB2E4."},
-
- /*
- * Note to translators: This message indicates that the value argument
- * of setParameter must be a valid Java Object.
- */
- {ErrorMsg.JAXP_INVALID_SET_PARAM_VALUE,
- "{0} \uB9E4\uAC1C\uBCC0\uC218\uC758 \uAC12\uC740 \uC801\uD569\uD55C Java \uAC1D\uCCB4\uC5EC\uC57C \uD569\uB2C8\uB2E4."},
-
-
- {ErrorMsg.COMPILE_STDIN_ERR,
- "-i \uC635\uC158\uC740 -o \uC635\uC158\uACFC \uD568\uAED8 \uC0AC\uC6A9\uD574\uC57C \uD569\uB2C8\uB2E4."},
-
-
- /*
- * Note to translators: This message contains usage information for a
- * means of invoking XSLTC from the command-line. The message is
- * formatted for presentation in English. The strings <output>,
- * <directory>, etc. indicate user-specified argument values, and can
- * be translated - the argument <package> refers to a Java package, so
- * it should be handled in the same way the term is handled for JDK
- * documentation.
- */
- {ErrorMsg.COMPILE_USAGE_STR,
- "\uC0AC\uC6A9\uBC95\n java com.sun.org.apache.xalan.internal.xsltc.cmdline.Compile [-o <output>]\n [-d <directory>] [-j <jarfile>] [-p <package>]\n [-n] [-x] [-u] [-v] [-h] { <stylesheet> | -i }\n\n\uC635\uC158\n -o <output> \uC0DD\uC131\uB41C translet\uC5D0 <output> \uC774\uB984\uC744\n \uC9C0\uC815\uD569\uB2C8\uB2E4. \uAE30\uBCF8\uC801\uC73C\uB85C translet \uC774\uB984\uC740\n <stylesheet> \uC774\uB984\uC5D0\uC11C \uD30C\uC0DD\uB429\uB2C8\uB2E4. \uC5EC\uB7EC \uC2A4\uD0C0\uC77C\uC2DC\uD2B8\uB97C\n \uCEF4\uD30C\uC77C\uD558\uB294 \uACBD\uC6B0 \uC774 \uC635\uC158\uC740 \uBB34\uC2DC\uB429\uB2C8\uB2E4.\n -d <directory> translet\uC5D0 \uB300\uD55C \uB300\uC0C1 \uB514\uB809\uD1A0\uB9AC\uB97C \uC9C0\uC815\uD569\uB2C8\uB2E4.\n -j <jarfile> translet \uD074\uB798\uC2A4\uB97C <jarfile>\uC774\uB77C\uB294 \uC774\uB984\uC774 \uC9C0\uC815\uB41C jar \uD30C\uC77C\uC5D0\n \uD328\uD0A4\uC9C0\uD654\uD569\uB2C8\uB2E4.\n -p <package> \uC0DD\uC131\uB41C \uBAA8\uB4E0 translet \uD074\uB798\uC2A4\uC5D0 \uB300\uD574 \uD328\uD0A4\uC9C0 \uC774\uB984 \uC811\uB450\uC5B4\uB97C\n \uC9C0\uC815\uD569\uB2C8\uB2E4.\n -n \uD15C\uD50C\uB9AC\uD2B8 \uC778\uB77C\uC778\uC744 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4. \uC77C\uBC18\uC801\uC73C\uB85C \uAE30\uBCF8 \uB3D9\uC791\uC744\n \uC0AC\uC6A9\uD558\uB294 \uAC83\uC774 \uC88B\uC2B5\uB2C8\uB2E4.\n -x \uCD94\uAC00 \uB514\uBC84\uAE45 \uBA54\uC2DC\uC9C0 \uCD9C\uB825\uC744 \uC124\uC815\uD569\uB2C8\uB2E4.\n -u <stylesheet> \uC778\uC218\uB97C URL\uB85C \uD574\uC11D\uD569\uB2C8\uB2E4.\n -i \uCEF4\uD30C\uC77C\uB7EC\uAC00 stdin\uC5D0\uC11C \uC2A4\uD0C0\uC77C\uC2DC\uD2B8\uB97C \uAC15\uC81C\uB85C \uC77D\uB3C4\uB85D \uD569\uB2C8\uB2E4.\n -v \uCEF4\uD30C\uC77C\uB7EC\uC758 \uBC84\uC804\uC744 \uC778\uC1C4\uD569\uB2C8\uB2E4.\n -h \uC774 \uC0AC\uC6A9\uBC95 \uC9C0\uCE68\uC744 \uC778\uC1C4\uD569\uB2C8\uB2E4.\n"},
-
- /*
- * Note to translators: This message contains usage information for a
- * means of invoking XSLTC from the command-line. The message is
- * formatted for presentation in English. The strings <jarfile>,
- * <document>, etc. indicate user-specified argument values, and can
- * be translated - the argument <class> refers to a Java class, so it
- * should be handled in the same way the term is handled for JDK
- * documentation.
- */
- {ErrorMsg.TRANSFORM_USAGE_STR,
- "\uC0AC\uC6A9\uBC95 \n java com.sun.org.apache.xalan.internal.xsltc.cmdline.Transform [-j <jarfile>]\n [-x] [-n <iterations>] {-u <document_url> | <document>}\n <class> [<param1>=<value1> ...]\n\n translet <class>\uB97C \uC0AC\uC6A9\uD558\uC5EC <document>\uB85C \uC9C0\uC815\uB41C XML \uBB38\uC11C\uB97C \n \uBCC0\uD658\uD569\uB2C8\uB2E4. translet <class>\uB294 \n \uC0AC\uC6A9\uC790\uC758 CLASSPATH \uB610\uB294 \uC120\uD0DD\uC801\uC73C\uB85C \uC9C0\uC815\uB41C <jarfile>\uC5D0 \uC788\uC2B5\uB2C8\uB2E4.\n\uC635\uC158\n -j <jarfile> translet\uC744 \uB85C\uB4DC\uD574 \uC62C jarfile\uC744 \uC9C0\uC815\uD569\uB2C8\uB2E4.\n -x \uCD94\uAC00 \uB514\uBC84\uAE45 \uBA54\uC2DC\uC9C0 \uCD9C\uB825\uC744 \uC124\uC815\uD569\uB2C8\uB2E4.\n -n <iterations> \uBCC0\uD658\uC744 <iterations>\uD68C \uC2E4\uD589\uD558\uACE0\n \uD504\uB85C\uD30C\uC77C \uC791\uC131 \uC815\uBCF4\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n -u <document_url> XML \uC785\uB825 \uBB38\uC11C\uB97C URL\uB85C \uC9C0\uC815\uD569\uB2C8\uB2E4.\n"},
-
-
-
- /*
- * Note to translators: "<xsl:sort>", "<xsl:for-each>" and
- * "<xsl:apply-templates>" are keywords that should not be translated.
- * The message indicates that an xsl:sort element must be a child of
- * one of the other kinds of elements mentioned.
- */
- {ErrorMsg.STRAY_SORT_ERR,
- "<xsl:sort>\uB294 <xsl:for-each> \uB610\uB294 <xsl:apply-templates>\uC5D0\uC11C\uB9CC \uC0AC\uC6A9\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: The message indicates that the encoding
- * requested for the output document was on that requires support that
- * is not available from the Java Virtual Machine being used to execute
- * the program.
- */
- {ErrorMsg.UNSUPPORTED_ENCODING,
- "\uC774 JVM\uC5D0\uC11C\uB294 \uCD9C\uB825 \uC778\uCF54\uB529 ''{0}''\uC774(\uAC00) \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: The message indicates that the XPath expression
- * named in the substitution text was not well formed syntactically.
- */
- {ErrorMsg.SYNTAX_ERR,
- "''{0}''\uC5D0 \uAD6C\uBB38 \uC624\uB958\uAC00 \uC788\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: The substitution text is the name of a Java
- * class. The term "constructor" here is the Java term. The message is
- * displayed if XSLTC could not find a constructor for the specified
- * class.
- */
- {ErrorMsg.CONSTRUCTOR_NOT_FOUND,
- "\uC678\uBD80 constructor ''{0}''\uC744(\uB97C) \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: "static" is the Java keyword. The substitution
- * text is the name of a function. The first argument of that function
- * is not of the required type.
- */
- {ErrorMsg.NO_JAVA_FUNCT_THIS_REF,
- "\uBE44static Java \uD568\uC218 ''{0}''\uC5D0 \uB300\uD55C \uCCAB\uBC88\uC9F8 \uC778\uC218\uB294 \uC801\uD569\uD55C \uAC1D\uCCB4 \uCC38\uC870\uAC00 \uC544\uB2D9\uB2C8\uB2E4."},
-
- /*
- * Note to translators: An XPath expression was not of the type
- * required in a particular context. The substitution text is the
- * expression that was in error.
- */
- {ErrorMsg.TYPE_CHECK_ERR,
- "''{0}'' \uD45C\uD604\uC2DD\uC758 \uC720\uD615\uC744 \uD655\uC778\uD558\uB294 \uC911 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: An XPath expression was not of the type
- * required in a particular context. However, the location of the
- * problematic expression is unknown.
- */
- {ErrorMsg.TYPE_CHECK_UNK_LOC_ERR,
- "\uC54C \uC218 \uC5C6\uB294 \uC704\uCE58\uC5D0\uC11C \uD45C\uD604\uC2DD\uC758 \uC720\uD615\uC744 \uD655\uC778\uD558\uB294 \uC911 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: The substitution text is the name of a command-
- * line option that was not recognized.
- */
- {ErrorMsg.ILLEGAL_CMDLINE_OPTION_ERR,
- "\uBA85\uB839\uD589 \uC635\uC158 ''{0}''\uC774(\uAC00) \uBD80\uC801\uD569\uD569\uB2C8\uB2E4."},
-
- /*
- * Note to translators: The substitution text is the name of a command-
- * line option.
- */
- {ErrorMsg.CMDLINE_OPT_MISSING_ARG_ERR,
- "\uBA85\uB839\uD589 \uC635\uC158 ''{0}''\uC5D0 \uD544\uC218 \uC778\uC218\uAC00 \uB204\uB77D\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text contains two error
- * messages. The spacing before the second substitution text indents
- * it the same amount as the first in English.
- */
- {ErrorMsg.WARNING_PLUS_WRAPPED_MSG,
- "WARNING: ''{0}''\n :{1}"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text is an error message.
- */
- {ErrorMsg.WARNING_MSG,
- "WARNING: ''{0}''"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text contains two error
- * messages. The spacing before the second substitution text indents
- * it the same amount as the first in English.
- */
- {ErrorMsg.FATAL_ERR_PLUS_WRAPPED_MSG,
- "FATAL ERROR: ''{0}''\n :{1}"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text is an error message.
- */
- {ErrorMsg.FATAL_ERR_MSG,
- "FATAL ERROR: ''{0}''"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text contains two error
- * messages. The spacing before the second substitution text indents
- * it the same amount as the first in English.
- */
- {ErrorMsg.ERROR_PLUS_WRAPPED_MSG,
- "ERROR: ''{0}''\n :{1}"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text is an error message.
- */
- {ErrorMsg.ERROR_MSG,
- "ERROR: ''{0}''"},
-
- /*
- * Note to translators: The substitution text is the name of a class.
- */
- {ErrorMsg.TRANSFORM_WITH_TRANSLET_STR,
- "translet ''{0}''\uC744(\uB97C) \uC0AC\uC6A9\uD558\uC5EC \uBCC0\uD658\uD558\uC2ED\uC2DC\uC624. "},
-
- /*
- * Note to translators: The first substitution is the name of a class,
- * while the second substitution is the name of a jar file.
- */
- {ErrorMsg.TRANSFORM_WITH_JAR_STR,
- "jar \uD30C\uC77C ''{1}''\uC758 translet ''{0}''\uC744(\uB97C) \uC0AC\uC6A9\uD558\uC5EC \uBCC0\uD658\uD558\uC2ED\uC2DC\uC624."},
-
- /*
- * Note to translators: "TransformerFactory" is the name of a Java
- * interface and must not be translated. The substitution text is
- * the name of the class that could not be instantiated.
- */
- {ErrorMsg.COULD_NOT_CREATE_TRANS_FACT,
- "TransformerFactory \uD074\uB798\uC2A4 ''{0}''\uC758 \uC778\uC2A4\uD134\uC2A4\uB97C \uC0DD\uC131\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: This message is produced when the user
- * specified a name for the translet class that contains characters
- * that are not permitted in a Java class name. The substitution
- * text "{0}" specifies the name the user requested, while "{1}"
- * specifies the name the processor used instead.
- */
- {ErrorMsg.TRANSLET_NAME_JAVA_CONFLICT,
- "''{0}'' \uC774\uB984\uC5D0\uB294 Java \uD074\uB798\uC2A4 \uC774\uB984\uC5D0 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uB294 \uBB38\uC790\uAC00 \uD3EC\uD568\uB418\uC5B4 \uC788\uC5B4 \uC774 \uC774\uB984\uC744 translet \uD074\uB798\uC2A4\uC758 \uC774\uB984\uC73C\uB85C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uB300\uC2E0 ''{1}'' \uC774\uB984\uC774 \uC0AC\uC6A9\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: The following message is used as a header.
- * All the error messages are collected together and displayed beneath
- * this message.
- */
- {ErrorMsg.COMPILER_ERROR_KEY,
- "\uCEF4\uD30C\uC77C\uB7EC \uC624\uB958:"},
-
- /*
- * Note to translators: The following message is used as a header.
- * All the warning messages are collected together and displayed
- * beneath this message.
- */
- {ErrorMsg.COMPILER_WARNING_KEY,
- "\uCEF4\uD30C\uC77C\uB7EC \uACBD\uACE0:"},
-
- /*
- * Note to translators: The following message is used as a header.
- * All the error messages that are produced when the stylesheet is
- * applied to an input document are collected together and displayed
- * beneath this message. A 'translet' is the compiled form of a
- * stylesheet (see above).
- */
- {ErrorMsg.RUNTIME_ERROR_KEY,
- "Translet \uC624\uB958:"},
-
- /*
- * Note to translators: An attribute whose value is constrained to
- * be a "QName" or a list of "QNames" had a value that was incorrect.
- * 'QName' is an XML syntactic term that must not be translated. The
- * substitution text contains the actual value of the attribute.
- */
- {ErrorMsg.INVALID_QNAME_ERR,
- "\uAC12\uC774 QName \uB610\uB294 \uACF5\uBC31\uC73C\uB85C \uAD6C\uBD84\uB41C QName \uBAA9\uB85D\uC774\uC5B4\uC57C \uD558\uB294 \uC18D\uC131\uC758 \uAC12\uC774 ''{0}''\uC785\uB2C8\uB2E4."},
-
- /*
- * Note to translators: An attribute whose value is required to
- * be an "NCName".
- * 'NCName' is an XML syntactic term that must not be translated. The
- * substitution text contains the actual value of the attribute.
- */
- {ErrorMsg.INVALID_NCNAME_ERR,
- "\uAC12\uC774 NCName\uC774\uC5B4\uC57C \uD558\uB294 \uC18D\uC131\uC758 \uAC12\uC774 ''{0}''\uC785\uB2C8\uB2E4."},
-
- /*
- * Note to translators: An attribute with an incorrect value was
- * encountered. The permitted value is one of the literal values
- * "xml", "html" or "text"; it is also permitted to have the form of
- * a QName that is not also an NCName. The terms "method",
- * "xsl:output", "xml", "html" and "text" are keywords that must not
- * be translated. The term "qname-but-not-ncname" is an XML syntactic
- * term. The substitution text contains the actual value of the
- * attribute.
- */
- {ErrorMsg.INVALID_METHOD_IN_OUTPUT,
- "<xsl:output> \uC694\uC18C\uC5D0 \uB300\uD55C method \uC18D\uC131\uC758 \uAC12\uC774 ''{0}''\uC785\uB2C8\uB2E4. \uAC12\uC740 ''xml'', ''html'', ''text'' \uB610\uB294 qname-but-not-ncname \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4."},
-
- {ErrorMsg.JAXP_GET_FEATURE_NULL_NAME,
- "\uAE30\uB2A5 \uC774\uB984\uC740 TransformerFactory.getFeature(\uBB38\uC790\uC5F4 \uC774\uB984)\uC5D0\uC11C \uB110\uC77C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- {ErrorMsg.JAXP_SET_FEATURE_NULL_NAME,
- "\uAE30\uB2A5 \uC774\uB984\uC740 TransformerFactory.setFeature(\uBB38\uC790\uC5F4 \uC774\uB984, \uBD80\uC6B8 \uAC12)\uC5D0\uC11C \uB110\uC77C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- {ErrorMsg.JAXP_UNSUPPORTED_FEATURE,
- "\uC774 TransformerFactory\uC5D0\uC11C ''{0}'' \uAE30\uB2A5\uC744 \uC124\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- {ErrorMsg.JAXP_SECUREPROCESSING_FEATURE,
- "FEATURE_SECURE_PROCESSING: \uBCF4\uC548 \uAD00\uB9AC\uC790\uAC00 \uC788\uC744 \uACBD\uC6B0 \uAE30\uB2A5\uC744 false\uB85C \uC124\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: This message describes an internal error in the
- * processor. The term "byte code" is a Java technical term for the
- * executable code in a Java method, and "try-catch-finally block"
- * refers to the Java keywords with those names. "Outlined" is a
- * technical term internal to XSLTC and should not be translated.
- */
- {ErrorMsg.OUTLINE_ERR_TRY_CATCH,
- "\uB0B4\uBD80 XSLTC \uC624\uB958: \uC0DD\uC131\uB41C \uBC14\uC774\uD2B8 \uCF54\uB4DC\uAC00 try-catch-finally \uBE14\uB85D\uC744 \uD3EC\uD568\uD558\uBBC0\uB85C outlined \uCC98\uB9AC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: This message describes an internal error in the
- * processor. The terms "OutlineableChunkStart" and
- * "OutlineableChunkEnd" are the names of classes internal to XSLTC and
- * should not be translated. The message indicates that for every
- * "start" there must be a corresponding "end", and vice versa, and
- * that if one of a pair of "start" and "end" appears between another
- * pair of corresponding "start" and "end", then the other half of the
- * pair must also be between that same enclosing pair.
- */
- {ErrorMsg.OUTLINE_ERR_UNBALANCED_MARKERS,
- "\uB0B4\uBD80 XSLTC \uC624\uB958: OutlineableChunkStart \uBC0F OutlineableChunkEnd \uD45C\uC2DC\uC790\uC758 \uC9DD\uC774 \uB9DE\uC544\uC57C \uD558\uACE0 \uC62C\uBC14\uB974\uAC8C \uC911\uCCA9\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4."},
-
- /*
- * Note to translators: This message describes an internal error in the
- * processor. The term "byte code" is a Java technical term for the
- * executable code in a Java method. The "method" that is being
- * referred to is a Java method in a translet that XSLTC is generating
- * in processing a stylesheet. The "instruction" that is being
- * referred to is one of the instrutions in the Java byte code in that
- * method. "Outlined" is a technical term internal to XSLTC and
- * should not be translated.
- */
- {ErrorMsg.OUTLINE_ERR_DELETED_TARGET,
- "\uB0B4\uBD80 XSLTC \uC624\uB958: outlined \uCC98\uB9AC\uB41C \uBC14\uC774\uD2B8 \uCF54\uB4DC \uBE14\uB85D\uC5D0 \uC18D\uD55C \uBA85\uB839\uC774 \uC5EC\uC804\uD788 \uC6D0\uB798 \uBA54\uC18C\uB4DC\uC5D0\uC11C \uCC38\uC870\uB429\uB2C8\uB2E4."
- },
-
-
- /*
- * Note to translators: This message describes an internal error in the
- * processor. The "method" that is being referred to is a Java method
- * in a translet that XSLTC is generating.
- *
- */
- {ErrorMsg.OUTLINE_ERR_METHOD_TOO_BIG,
- "\uB0B4\uBD80 XSLTC \uC624\uB958: translet\uC758 \uBA54\uC18C\uB4DC\uAC00 Java Virtual Machine\uC758 \uBA54\uC18C\uB4DC \uAE38\uC774 \uC81C\uD55C\uC778 64KB\uB97C \uCD08\uACFC\uD569\uB2C8\uB2E4. \uB300\uAC1C \uC2A4\uD0C0\uC77C\uC2DC\uD2B8\uC758 \uD15C\uD50C\uB9AC\uD2B8\uAC00 \uB9E4\uC6B0 \uD06C\uAE30 \uB54C\uBB38\uC5D0 \uBC1C\uC0DD\uD569\uB2C8\uB2E4. \uB354 \uC791\uC740 \uD15C\uD50C\uB9AC\uD2B8\uB97C \uC0AC\uC6A9\uD558\uB3C4\uB85D \uC2A4\uD0C0\uC77C\uC2DC\uD2B8\uB97C \uC7AC\uAD6C\uC131\uD574 \uBCF4\uC2ED\uC2DC\uC624."
- },
-
- {ErrorMsg.DESERIALIZE_TRANSLET_ERR, "Java \uBCF4\uC548\uC774 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uB41C \uACBD\uC6B0 TemplatesImpl \uC9C1\uB82C\uD654 \uD574\uC81C\uC5D0 \uB300\uD55C \uC9C0\uC6D0\uC774 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uB429\uB2C8\uB2E4. jdk.xml.enableTemplatesImplDeserialization \uC2DC\uC2A4\uD15C \uC18D\uC131\uC744 true\uB85C \uC124\uC815\uD558\uBA74 \uC774\uB97C \uBB34\uD6A8\uD654\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4."}
-
- };
-
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_pt_BR.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_pt_BR.java
deleted file mode 100644
index d6e3530..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_pt_BR.java
+++ /dev/null
@@ -1,974 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-
-import java.util.ListResourceBundle;
-
-/**
- * @author Morten Jorgensen
- */
-public class ErrorMessages_pt_BR extends ListResourceBundle {
-
-/*
- * XSLTC compile-time error messages.
- *
- * General notes to translators and definitions:
- *
- * 1) XSLTC is the name of the product. It is an acronym for "XSLT Compiler".
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An axis is a particular "dimension" in a tree representation of an XML
- * document; the nodes in the tree are divided along different axes.
- * Traversing the "child" axis, for instance, means that the program
- * would visit each child of a particular node; traversing the "descendant"
- * axis means that the program would visit the child nodes of a particular
- * node, their children, and so on until the leaf nodes of the tree are
- * reached.
- *
- * 5) An iterator is an object that traverses nodes in a tree along a
- * particular axis, one at a time.
- *
- * 6) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 7) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 8) DOM is an acronym for Document Object Model. It is a tree
- * representation of an XML document.
- *
- * SAX is an acronym for the Simple API for XML processing. It is an API
- * used inform an XML processor (in this case XSLTC) of the structure and
- * content of an XML document.
- *
- * Input to the stylesheet processor can come from an XML parser in the
- * form of a DOM tree or through the SAX API.
- *
- * 9) DTD is a document type declaration. It is a way of specifying the
- * grammar for an XML file, the names and types of elements, attributes,
- * etc.
- *
- * 10) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- * 11) Translet is an invented term that refers to the class file that contains
- * the compiled form of a stylesheet.
- */
-
- // These message should be read from a locale-specific resource bundle
- /** Get the lookup table for error messages.
- *
- * @return The message lookup table.
- */
- public Object[][] getContents()
- {
- return new Object[][] {
- {ErrorMsg.MULTIPLE_STYLESHEET_ERR,
- "Mais de uma folha de estilos definida no mesmo arquivo."},
-
- /*
- * Note to translators: The substitution text is the name of a
- * template. The same name was used on two different templates in the
- * same stylesheet.
- */
- {ErrorMsg.TEMPLATE_REDEF_ERR,
- "O modelo ''{0}'' j\u00E1 foi definido nesta folha de estilos."},
-
-
- /*
- * Note to translators: The substitution text is the name of a
- * template. A reference to the template name was encountered, but the
- * template is undefined.
- */
- {ErrorMsg.TEMPLATE_UNDEF_ERR,
- "O modelo ''{0}'' n\u00E3o foi definido nesta folha de estilos."},
-
- /*
- * Note to translators: The substitution text is the name of a variable
- * that was defined more than once.
- */
- {ErrorMsg.VARIABLE_REDEF_ERR,
- "A vari\u00E1vel ''{0}'' est\u00E1 definida v\u00E1rias vezes no mesmo escopo."},
-
- /*
- * Note to translators: The substitution text is the name of a variable
- * or parameter. A reference to the variable or parameter was found,
- * but it was never defined.
- */
- {ErrorMsg.VARIABLE_UNDEF_ERR,
- "Vari\u00E1vel ou par\u00E2metro ''{0}'' indefinido."},
-
- /*
- * Note to translators: The word "class" here refers to a Java class.
- * Processing the stylesheet required a class to be loaded, but it could
- * not be found. The substitution text is the name of the class.
- */
- {ErrorMsg.CLASS_NOT_FOUND_ERR,
- "N\u00E3o \u00E9 poss\u00EDvel localizar a classe ''{0}''."},
-
- /*
- * Note to translators: The word "method" here refers to a Java method.
- * Processing the stylesheet required a reference to the method named by
- * the substitution text, but it could not be found. "public" is the
- * Java keyword.
- */
- {ErrorMsg.METHOD_NOT_FOUND_ERR,
- "N\u00E3o \u00E9 poss\u00EDvel localizar o m\u00E9todo externo ''{0}'' (deve ser p\u00FAblico)."},
-
- /*
- * Note to translators: The word "method" here refers to a Java method.
- * Processing the stylesheet required a reference to the method named by
- * the substitution text, but no method with the required types of
- * arguments or return type could be found.
- */
- {ErrorMsg.ARGUMENT_CONVERSION_ERR,
- "N\u00E3o \u00E9 poss\u00EDvel converter o argumento/tipo de retorno na chamada para o m\u00E9todo ''{0}''"},
-
- /*
- * Note to translators: The file or URI named in the substitution text
- * is missing.
- */
- {ErrorMsg.FILE_NOT_FOUND_ERR,
- "Arquivo ou URI ''{0}'' n\u00E3o encontrado."},
-
- /*
- * Note to translators: This message is displayed when the URI
- * mentioned in the substitution text is not well-formed syntactically.
- */
- {ErrorMsg.INVALID_URI_ERR,
- "URI inv\u00E1lido ''{0}''."},
-
- /*
- * Note to translators: The file or URI named in the substitution text
- * exists but could not be opened.
- */
- {ErrorMsg.FILE_ACCESS_ERR,
- "N\u00E3o \u00E9 poss\u00EDvel abrir o arquivo ou o URI ''{0}''."},
-
- /*
- * Note to translators: <xsl:stylesheet> and <xsl:transform> are
- * keywords that should not be translated.
- */
- {ErrorMsg.MISSING_ROOT_ERR,
- "elemento <xsl:stylesheet> ou <xsl:transform> esperado."},
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- {ErrorMsg.NAMESPACE_UNDEF_ERR,
- "O prefixo do namespace ''{0}'' n\u00E3o foi declarado."},
-
- /*
- * Note to translators: The Java function named in the stylesheet could
- * not be found.
- */
- {ErrorMsg.FUNCTION_RESOLVE_ERR,
- "N\u00E3o \u00E9 poss\u00EDvel resolver a chamada para a fun\u00E7\u00E3o ''{0}''."},
-
- /*
- * Note to translators: The substitution text is the name of a
- * function. A literal string here means a constant string value.
- */
- {ErrorMsg.NEED_LITERAL_ERR,
- "O argumento para \"{0}'' deve ser uma string literal."},
-
- /*
- * Note to translators: This message indicates there was a syntactic
- * error in the form of an XPath expression. The substitution text is
- * the expression.
- */
- {ErrorMsg.XPATH_PARSER_ERR,
- "Erro durante o parsing da express\u00E3o XPath ''{0}''."},
-
- /*
- * Note to translators: An element in the stylesheet requires a
- * particular attribute named by the substitution text, but that
- * attribute was not specified in the stylesheet.
- */
- {ErrorMsg.REQUIRED_ATTR_ERR,
- "O atributo obrigat\u00F3rio ''{0}'' n\u00E3o foi encontrado."},
-
- /*
- * Note to translators: This message indicates that a character not
- * permitted in an XPath expression was encountered. The substitution
- * text is the offending character.
- */
- {ErrorMsg.ILLEGAL_CHAR_ERR,
- "Caractere inv\u00E1lido ''{0}'' na express\u00E3o XPath."},
-
- /*
- * Note to translators: A processing instruction is a mark-up item in
- * an XML document that request some behaviour of an XML processor. The
- * form of the name of was invalid in this case, and the substitution
- * text is the name.
- */
- {ErrorMsg.ILLEGAL_PI_ERR,
- "Nome inv\u00E1lido ''{0}'' para instru\u00E7\u00E3o de processamento."},
-
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- {ErrorMsg.STRAY_ATTRIBUTE_ERR,
- "Atributo ''{0}'' fora do elemento."},
-
- /*
- * Note to translators: An attribute that wasn't recognized was
- * specified on an element in the stylesheet. The attribute is named
- * by the substitution
- * text.
- */
- {ErrorMsg.ILLEGAL_ATTRIBUTE_ERR,
- "Atributo ''{0}'' inv\u00E1lido."},
-
- /*
- * Note to translators: "import" and "include" are keywords that should
- * not be translated. This messages indicates that the stylesheet
- * named in the substitution text imported or included itself either
- * directly or indirectly.
- */
- {ErrorMsg.CIRCULAR_INCLUDE_ERR,
- "Import/Include circular. Folha de estilos ''{0}'' j\u00E1 carregada."},
-
- /*
- * Note to translators: A result-tree fragment is a portion of a
- * resulting XML document represented as a tree. "<xsl:sort>" is a
- * keyword and should not be translated.
- */
- {ErrorMsg.RESULT_TREE_SORT_ERR,
- "Os fragmentos da \u00E1rvore n\u00E3o podem ser classificados (os elementos <xsl:sort> foram ignorados). Voc\u00EA deve classificar os n\u00F3s ao criar a \u00E1rvore de resultados."},
-
- /*
- * Note to translators: A name can be given to a particular style to be
- * used to format decimal values. The substitution text gives the name
- * of such a style for which more than one declaration was encountered.
- */
- {ErrorMsg.SYMBOLS_REDEF_ERR,
- "A formata\u00E7\u00E3o decimal ''{0}'' j\u00E1 foi definida."},
-
- /*
- * Note to translators: The stylesheet version named in the
- * substitution text is not supported.
- */
- {ErrorMsg.XSL_VERSION_ERR,
- "A vers\u00E3o XSL \"{0}'' n\u00E3o \u00E9 suportada por XSLTC."},
-
- /*
- * Note to translators: The definitions of one or more variables or
- * parameters depend on one another.
- */
- {ErrorMsg.CIRCULAR_VARIABLE_ERR,
- "Refer\u00EAncia de vari\u00E1vel/par\u00E2metro circulares ''{0}''."},
-
- /*
- * Note to translators: The operator in an expresion with two operands was
- * not recognized.
- */
- {ErrorMsg.ILLEGAL_BINARY_OP_ERR,
- "Operador desconhecido para a express\u00E3o bin\u00E1ria."},
-
- /*
- * Note to translators: This message is produced if a reference to a
- * function has too many or too few arguments.
- */
- {ErrorMsg.ILLEGAL_ARG_ERR,
- "Argumento(s) inv\u00E1lido(s) para a chamada da fun\u00E7\u00E3o."},
-
- /*
- * Note to translators: "document()" is the name of function and must
- * not be translated. A node-set is a set of the nodes in the tree
- * representation of an XML document.
- */
- {ErrorMsg.DOCUMENT_ARG_ERR,
- "O segundo argumento para a fun\u00E7\u00E3o document() deve ser um conjunto de n\u00F3s."},
-
- /*
- * Note to translators: "<xsl:when>" and "<xsl:choose>" are keywords
- * and should not be translated. This message describes a syntax error
- * in the stylesheet.
- */
- {ErrorMsg.MISSING_WHEN_ERR,
- "\u00C9 necess\u00E1rio, pelo menos, um elemento <xsl:when> em <xsl:choose>."},
-
- /*
- * Note to translators: "<xsl:otherwise>" and "<xsl:choose>" are
- * keywords and should not be translated. This message describes a
- * syntax error in the stylesheet.
- */
- {ErrorMsg.MULTIPLE_OTHERWISE_ERR,
- "\u00C9 permitido somente um elemento <xsl:otherwise> em <xsl:choose>."},
-
- /*
- * Note to translators: "<xsl:otherwise>" and "<xsl:choose>" are
- * keywords and should not be translated. This message describes a
- * syntax error in the stylesheet.
- */
- {ErrorMsg.STRAY_OTHERWISE_ERR,
- "<xsl:otherwise> s\u00F3 pode ser usado em <xsl:choose>."},
-
- /*
- * Note to translators: "<xsl:when>" and "<xsl:choose>" are keywords
- * and should not be translated. This message describes a syntax error
- * in the stylesheet.
- */
- {ErrorMsg.STRAY_WHEN_ERR,
- "<xsl:when> s\u00F3 pode ser usado em <xsl:choose>."},
-
- /*
- * Note to translators: "<xsl:when>", "<xsl:otherwise>" and
- * "<xsl:choose>" are keywords and should not be translated. This
- * message describes a syntax error in the stylesheet.
- */
- {ErrorMsg.WHEN_ELEMENT_ERR,
- "Somente os elementos <xsl:when> e <xsl:otherwise> s\u00E3o permitidos em <xsl:choose>."},
-
- /*
- * Note to translators: "<xsl:attribute-set>" and "name" are keywords
- * that should not be translated.
- */
- {ErrorMsg.UNNAMED_ATTRIBSET_ERR,
- "<xsl:attribute-set> n\u00E3o encontrado no atributo 'name'."},
-
- /*
- * Note to translators: An element in the stylesheet contained an
- * element of a type that it was not permitted to contain.
- */
- {ErrorMsg.ILLEGAL_CHILD_ERR,
- "Elemento filho inv\u00E1lido."},
-
- /*
- * Note to translators: The stylesheet tried to create an element with
- * a name that was not a valid XML name. The substitution text contains
- * the name.
- */
- {ErrorMsg.ILLEGAL_ELEM_NAME_ERR,
- "Voc\u00EA n\u00E3o pode chamar um elemento ''{0}''"},
-
- /*
- * Note to translators: The stylesheet tried to create an attribute
- * with a name that was not a valid XML name. The substitution text
- * contains the name.
- */
- {ErrorMsg.ILLEGAL_ATTR_NAME_ERR,
- "Voc\u00EA n\u00E3o pode chamar um atributo ''{0}''"},
-
- /*
- * Note to translators: The children of the outermost element of a
- * stylesheet are referred to as top-level elements. No text should
- * occur within that outermost element unless it is within a top-level
- * element. This message indicates that that constraint was violated.
- * "<xsl:stylesheet>" is a keyword that should not be translated.
- */
- {ErrorMsg.ILLEGAL_TEXT_NODE_ERR,
- "Dados de texto fora do elemento <xsl:stylesheet> de n\u00EDvel superior."},
-
- /*
- * Note to translators: JAXP is an acronym for the Java API for XML
- * Processing. This message indicates that the XML parser provided to
- * XSLTC to process the XML input document had a configuration problem.
- */
- {ErrorMsg.SAX_PARSER_CONFIG_ERR,
- "Parser de JAXP n\u00E3o configurado corretamente"},
-
- /*
- * Note to translators: The substitution text names the internal error
- * encountered.
- */
- {ErrorMsg.INTERNAL_ERR,
- "Erro interno-XSLTC irrecuper\u00E1vel: ''{0}''"},
-
- /*
- * Note to translators: The stylesheet contained an element that was
- * not recognized as part of the XSL syntax. The substitution text
- * gives the element name.
- */
- {ErrorMsg.UNSUPPORTED_XSL_ERR,
- "Elemento XSL n\u00E3o suportado ''{0}''."},
-
- /*
- * Note to translators: The stylesheet referred to an extension to the
- * XSL syntax and indicated that it was defined by XSLTC, but XSTLC does
- * not recognized the particular extension named. The substitution text
- * gives the extension name.
- */
- {ErrorMsg.UNSUPPORTED_EXT_ERR,
- "Extens\u00E3o de XSLTC n\u00E3o reconhecida ''{0}''."},
-
- /*
- * Note to translators: The XML document given to XSLTC as a stylesheet
- * was not, in fact, a stylesheet. XSLTC is able to detect that in this
- * case because the outermost element in the stylesheet has to be
- * declared with respect to the XSL namespace URI, but no declaration
- * for that namespace was seen.
- */
- {ErrorMsg.MISSING_XSLT_URI_ERR,
- "O documento de entrada n\u00E3o \u00E9 uma folha de estilos (o namespace XSL n\u00E3o foi declarado no elemento-raiz)."},
-
- /*
- * Note to translators: XSLTC could not find the stylesheet document
- * with the name specified by the substitution text.
- */
- {ErrorMsg.MISSING_XSLT_TARGET_ERR,
- "N\u00E3o foi poss\u00EDvel localizar o alvo da folha de estilos ''{0}''."},
-
- /*
- * Note to translators: access to the stylesheet target is denied
- */
- {ErrorMsg.ACCESSING_XSLT_TARGET_ERR,
- "N\u00E3o foi poss\u00EDvel ler o alvo ''{0}'' da folha de estilos, porque o acesso a ''{1}'' n\u00E3o \u00E9 permitido em virtude da restri\u00E7\u00E3o definida pela propriedade accessExternalStylesheet."},
-
- /*
- * Note to translators: This message represents an internal error in
- * condition in XSLTC. The substitution text is the class name in XSLTC
- * that is missing some functionality.
- */
- {ErrorMsg.NOT_IMPLEMENTED_ERR,
- "N\u00E3o implementado: ''{0}''."},
-
- /*
- * Note to translators: The XML document given to XSLTC as a stylesheet
- * was not, in fact, a stylesheet.
- */
- {ErrorMsg.NOT_STYLESHEET_ERR,
- "O documento de entrada n\u00E3o cont\u00E9m uma folha de estilos XSL."},
-
- /*
- * Note to translators: The element named in the substitution text was
- * encountered in the stylesheet but is not recognized.
- */
- {ErrorMsg.ELEMENT_PARSE_ERR,
- "N\u00E3o foi poss\u00EDvel fazer parsing do elemento ''{0}''"},
-
- /*
- * Note to translators: "use", "<key>", "node", "node-set", "string"
- * and "number" are keywords in this context and should not be
- * translated. This message indicates that the value of the "use"
- * attribute was not one of the permitted values.
- */
- {ErrorMsg.KEY_USE_ATTR_ERR,
- "O atributo use de <key> deve ser node, node-set, string ou number."},
-
- /*
- * Note to translators: An XML document can specify the version of the
- * XML specification to which it adheres. This message indicates that
- * the version specified for the output document was not valid.
- */
- {ErrorMsg.OUTPUT_VERSION_ERR,
- "A vers\u00E3o do documento XML de sa\u00EDda deve ser 1.0"},
-
- /*
- * Note to translators: The operator in a comparison operation was
- * not recognized.
- */
- {ErrorMsg.ILLEGAL_RELAT_OP_ERR,
- "Opera\u00E7\u00E3o desconhecida para a express\u00E3o relacional"},
-
- /*
- * Note to translators: An attribute set defines as a set of XML
- * attributes that can be added to an element in the output XML document
- * as a group. This message is reported if the name specified was not
- * used to declare an attribute set. The substitution text is the name
- * that is in error.
- */
- {ErrorMsg.ATTRIBSET_UNDEF_ERR,
- "Tentativa de usar um conjunto de atributos ''{0}'' n\u00E3o existente."},
-
- /*
- * Note to translators: The term "attribute value template" is a term
- * defined by XSLT which describes the value of an attribute that is
- * determined by an XPath expression. The message indicates that the
- * expression was syntactically incorrect; the substitution text
- * contains the expression that was in error.
- */
- {ErrorMsg.ATTR_VAL_TEMPLATE_ERR,
- "N\u00E3o \u00E9 poss\u00EDvel fazer parsing do modelo do valor do atributo ''{0}''."},
-
- /*
- * Note to translators: ???
- */
- {ErrorMsg.UNKNOWN_SIG_TYPE_ERR,
- "Tipo de dados desconhecido na assinatura da classe ''{0}''."},
-
- /*
- * Note to translators: The substitution text refers to data types.
- * The message is displayed if a value in a particular context needs to
- * be converted to type {1}, but that's not possible for a value of
- * type {0}.
- */
- {ErrorMsg.DATA_CONVERSION_ERR,
- "N\u00E3o \u00E9 poss\u00EDvel converter o tipo de dados ''{0}'' em ''{1}''."},
-
- /*
- * Note to translators: "Templates" is a Java class name that should
- * not be translated.
- */
- {ErrorMsg.NO_TRANSLET_CLASS_ERR,
- "Este Templates n\u00E3o cont\u00E9m uma defini\u00E7\u00E3o de classe translet v\u00E1lida."},
-
- /*
- * Note to translators: "Templates" is a Java class name that should
- * not be translated.
- */
- {ErrorMsg.NO_MAIN_TRANSLET_ERR,
- "Este Templates n\u00E3o cont\u00E9m uma classe com o nome ''{0}''."},
-
- /*
- * Note to translators: The substitution text is the name of a class.
- */
- {ErrorMsg.TRANSLET_CLASS_ERR,
- "N\u00E3o foi poss\u00EDvel carregar a classe translet ''{0}''."},
-
- {ErrorMsg.TRANSLET_OBJECT_ERR,
- "Classe translet carregada, mas n\u00E3o \u00E9 poss\u00EDvel criar uma inst\u00E2ncia translet."},
-
- /*
- * Note to translators: "ErrorListener" is a Java interface name that
- * should not be translated. The message indicates that the user tried
- * to set an ErrorListener object on object of the class named in the
- * substitution text with "null" Java value.
- */
- {ErrorMsg.ERROR_LISTENER_NULL_ERR,
- "Tentativa de definir ErrorListener para ''{0}'' como nulo"},
-
- /*
- * Note to translators: StreamSource, SAXSource and DOMSource are Java
- * interface names that should not be translated.
- */
- {ErrorMsg.JAXP_UNKNOWN_SOURCE_ERR,
- "Somente StreamSource, SAXSource e DOMSource s\u00E3o suportados por XSLTC"},
-
- /*
- * Note to translators: "Source" is a Java class name that should not
- * be translated. The substitution text is the name of Java method.
- */
- {ErrorMsg.JAXP_NO_SOURCE_ERR,
- "O objeto source especificado para ''{0}'' n\u00E3o tem conte\u00FAdo."},
-
- /*
- * Note to translators: The message indicates that XSLTC failed to
- * compile the stylesheet into a translet (class file).
- */
- {ErrorMsg.JAXP_COMPILE_ERR,
- "N\u00E3o foi poss\u00EDvel compilar a folha de estilos"},
-
- /*
- * Note to translators: "TransformerFactory" is a class name. In this
- * context, an attribute is a property or setting of the
- * TransformerFactory object. The substitution text is the name of the
- * unrecognised attribute. The method used to retrieve the attribute is
- * "getAttribute", so it's not clear whether it would be best to
- * translate the term "attribute".
- */
- {ErrorMsg.JAXP_INVALID_ATTR_ERR,
- "TransformerFactory n\u00E3o reconhece o atributo ''{0}''."},
-
- {ErrorMsg.JAXP_INVALID_ATTR_VALUE_ERR,
- "Valor incorreto especificado para o atributo ''{0}''."},
-
- /*
- * Note to translators: "setResult()" and "startDocument()" are Java
- * method names that should not be translated.
- */
- {ErrorMsg.JAXP_SET_RESULT_ERR,
- "setResult() deve ser chamado antes de startDocument()."},
-
- /*
- * Note to translators: "Transformer" is a Java interface name that
- * should not be translated. A Transformer object should contained a
- * reference to a translet object in order to be used for
- * transformations; this message is produced if that requirement is not
- * met.
- */
- {ErrorMsg.JAXP_NO_TRANSLET_ERR,
- "O Transformer n\u00E3o tem um objeto translet encapsulado."},
-
- /*
- * Note to translators: The XML document that results from a
- * transformation needs to be sent to an output handler object; this
- * message is produced if that requirement is not met.
- */
- {ErrorMsg.JAXP_NO_HANDLER_ERR,
- "Nenhum handler de sa\u00EDda definido para o resultado da transforma\u00E7\u00E3o."},
-
- /*
- * Note to translators: "Result" is a Java interface name in this
- * context. The substitution text is a method name.
- */
- {ErrorMsg.JAXP_NO_RESULT_ERR,
- "O objeto result especificado para ''{0}'' \u00E9 inv\u00E1lido."},
-
- /*
- * Note to translators: "Transformer" is a Java interface name. The
- * user's program attempted to access an unrecognized property with the
- * name specified in the substitution text. The method used to retrieve
- * the property is "getOutputProperty", so it's not clear whether it
- * would be best to translate the term "property".
- */
- {ErrorMsg.JAXP_UNKNOWN_PROP_ERR,
- "Tentativa de acessar a propriedade ''{0}'' do Transformer inv\u00E1lida."},
-
- /*
- * Note to translators: SAX2DOM is the name of a Java class that should
- * not be translated. This is an adapter in the sense that it takes a
- * DOM object and converts it to something that uses the SAX API.
- */
- {ErrorMsg.SAX2DOM_ADAPTER_ERR,
- "N\u00E3o foi poss\u00EDvel criar o adaptador SAX2DOM: ''{0}''."},
-
- /*
- * Note to translators: "XSLTCSource.build()" is a Java method name.
- * "systemId" is an XML term that is short for "system identification".
- */
- {ErrorMsg.XSLTC_SOURCE_ERR,
- "XSLTCSource.build() chamado sem o systemId ser definido."},
-
- { ErrorMsg.ER_RESULT_NULL,
- "O resultado n\u00E3o deve ser nulo"},
-
- /*
- * Note to translators: This message indicates that the value argument
- * of setParameter must be a valid Java Object.
- */
- {ErrorMsg.JAXP_INVALID_SET_PARAM_VALUE,
- "O valor do par\u00E2metro {0} deve ser um Objeto Java v\u00E1lido"},
-
-
- {ErrorMsg.COMPILE_STDIN_ERR,
- "A op\u00E7\u00E3o -i deve ser usada com a op\u00E7\u00E3o -o."},
-
-
- /*
- * Note to translators: This message contains usage information for a
- * means of invoking XSLTC from the command-line. The message is
- * formatted for presentation in English. The strings <output>,
- * <directory>, etc. indicate user-specified argument values, and can
- * be translated - the argument <package> refers to a Java package, so
- * it should be handled in the same way the term is handled for JDK
- * documentation.
- */
- {ErrorMsg.COMPILE_USAGE_STR,
- "SINOPSE\n java com.sun.org.apache.xalan.internal.xsltc.cmdline.Compile [-o <sa\u00EDda>]\n [-d <diret\u00F3rio>] [-j <jarfile>] [-p <pacote>]\n [-n] [-x] [-u] [-v] [-h] { <folha de estilos> | -i }\n\nOP\u00C7\u00D5ES\n -o <sa\u00EDda> atribui o nome <sa\u00EDda> ao translet\n gerado. Por padr\u00E3o, o nome translet\n origina-se do nome <folha de estilos>. Esta op\u00E7\u00E3o\n \u00E9 ignorada caso sejam compiladas v\u00E1rias folhas de estilos.\n -d <diret\u00F3rio> especifica um diret\u00F3rio de destino para translet\n -j <arquivo jar> empacota as classes translet em um arquivo jar do\n nome especificado como <arquivo jar>\n -p <pacote> especifica um prefixo de nome do pacote para todas as classes\n translet geradas.\n -n permite a inclus\u00E3o do modelo na linha (comportamento padr\u00E3o melhor\n em m\u00E9dia).\n -x ativa a sa\u00EDda de mensagens de depura\u00E7\u00E3o adicionais\n -u interpreta os argumentos <folha de estilos> como URLs\n -i obriga o compilador a ler a folha de estilos de stdin\n -v imprime a vers\u00E3o do compilador\n -h imprime esta instru\u00E7\u00E3o de uso\n"},
-
- /*
- * Note to translators: This message contains usage information for a
- * means of invoking XSLTC from the command-line. The message is
- * formatted for presentation in English. The strings <jarfile>,
- * <document>, etc. indicate user-specified argument values, and can
- * be translated - the argument <class> refers to a Java class, so it
- * should be handled in the same way the term is handled for JDK
- * documentation.
- */
- {ErrorMsg.TRANSFORM_USAGE_STR,
- "SINOPSE \n java com.sun.org.apache.xalan.internal.xsltc.cmdline.Transforme [-j <arquivo jar>]\n [-x] [-n <itera\u00E7\u00F5es>] {-u <url_documento> | <documento>}\n <classe> [<par\u00E2m1>=<valor1> ...]\n\n usa a <classe> translet para transformar um documento XML \n especificado como <documento>. O translet <classe> est\u00E1 no\n CLASSPATH do usu\u00E1rio ou no <arquivo jar> opcionalmente especificado.\nOP\u00C7\u00D5ES\n -j <arquivo jar> especifica um arquivo jar com base no qual ser\u00E1 carregado o translet\n -x ativa a sa\u00EDda de mensagens de depura\u00E7\u00E3o adicionais\n -n <itera\u00E7\u00F5es> executa a transforma\u00E7\u00E3o <itera\u00E7\u00F5es> vezes e\n exibe as informa\u00E7\u00F5es de perfis\n -u <url_documento> especifica o documento XML de entrada na forma de URL\n"},
-
-
-
- /*
- * Note to translators: "<xsl:sort>", "<xsl:for-each>" and
- * "<xsl:apply-templates>" are keywords that should not be translated.
- * The message indicates that an xsl:sort element must be a child of
- * one of the other kinds of elements mentioned.
- */
- {ErrorMsg.STRAY_SORT_ERR,
- "<xsl:sort> s\u00F3 pode ser usado dentro de <xsl:for-each> ou <xsl:apply-templates>."},
-
- /*
- * Note to translators: The message indicates that the encoding
- * requested for the output document was on that requires support that
- * is not available from the Java Virtual Machine being used to execute
- * the program.
- */
- {ErrorMsg.UNSUPPORTED_ENCODING,
- "A codifica\u00E7\u00E3o de sa\u00EDda ''{0}'' n\u00E3o \u00E9 suportada nesta JVM."},
-
- /*
- * Note to translators: The message indicates that the XPath expression
- * named in the substitution text was not well formed syntactically.
- */
- {ErrorMsg.SYNTAX_ERR,
- "Erro de sintaxe em ''{0}''."},
-
- /*
- * Note to translators: The substitution text is the name of a Java
- * class. The term "constructor" here is the Java term. The message is
- * displayed if XSLTC could not find a constructor for the specified
- * class.
- */
- {ErrorMsg.CONSTRUCTOR_NOT_FOUND,
- "N\u00E3o \u00E9 poss\u00EDvel localizar o construtor externo ''{0}''."},
-
- /*
- * Note to translators: "static" is the Java keyword. The substitution
- * text is the name of a function. The first argument of that function
- * is not of the required type.
- */
- {ErrorMsg.NO_JAVA_FUNCT_THIS_REF,
- "O primeiro argumento para a fun\u00E7\u00E3o Java n\u00E3o static ''{0}'' n\u00E3o \u00E9 uma refer\u00EAncia de objeto v\u00E1lida."},
-
- /*
- * Note to translators: An XPath expression was not of the type
- * required in a particular context. The substitution text is the
- * expression that was in error.
- */
- {ErrorMsg.TYPE_CHECK_ERR,
- "Erro ao verificar o tipo de express\u00E3o ''{0}''."},
-
- /*
- * Note to translators: An XPath expression was not of the type
- * required in a particular context. However, the location of the
- * problematic expression is unknown.
- */
- {ErrorMsg.TYPE_CHECK_UNK_LOC_ERR,
- "Erro ao verificar o tipo de uma express\u00E3o em uma localiza\u00E7\u00E3o desconhecida."},
-
- /*
- * Note to translators: The substitution text is the name of a command-
- * line option that was not recognized.
- */
- {ErrorMsg.ILLEGAL_CMDLINE_OPTION_ERR,
- "A op\u00E7\u00E3o da linha de comandos ''{0}'' n\u00E3o \u00E9 v\u00E1lida."},
-
- /*
- * Note to translators: The substitution text is the name of a command-
- * line option.
- */
- {ErrorMsg.CMDLINE_OPT_MISSING_ARG_ERR,
- "A op\u00E7\u00E3o da linha de comandos ''{0}'' n\u00E3o encontrou um argumento obrigat\u00F3rio."},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text contains two error
- * messages. The spacing before the second substitution text indents
- * it the same amount as the first in English.
- */
- {ErrorMsg.WARNING_PLUS_WRAPPED_MSG,
- "WARNING: ''{0}''\n :{1}"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text is an error message.
- */
- {ErrorMsg.WARNING_MSG,
- "WARNING: ''{0}''"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text contains two error
- * messages. The spacing before the second substitution text indents
- * it the same amount as the first in English.
- */
- {ErrorMsg.FATAL_ERR_PLUS_WRAPPED_MSG,
- "FATAL ERROR: ''{0}''\n :{1}"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text is an error message.
- */
- {ErrorMsg.FATAL_ERR_MSG,
- "FATAL ERROR: ''{0}''"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text contains two error
- * messages. The spacing before the second substitution text indents
- * it the same amount as the first in English.
- */
- {ErrorMsg.ERROR_PLUS_WRAPPED_MSG,
- "ERROR: ''{0}''\n :{1}"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text is an error message.
- */
- {ErrorMsg.ERROR_MSG,
- "ERROR: ''{0}''"},
-
- /*
- * Note to translators: The substitution text is the name of a class.
- */
- {ErrorMsg.TRANSFORM_WITH_TRANSLET_STR,
- "Transformar usando translet ''{0}'' "},
-
- /*
- * Note to translators: The first substitution is the name of a class,
- * while the second substitution is the name of a jar file.
- */
- {ErrorMsg.TRANSFORM_WITH_JAR_STR,
- "Transformar usando translet ''{0}'' do arquivo jar ''{1}''"},
-
- /*
- * Note to translators: "TransformerFactory" is the name of a Java
- * interface and must not be translated. The substitution text is
- * the name of the class that could not be instantiated.
- */
- {ErrorMsg.COULD_NOT_CREATE_TRANS_FACT,
- "N\u00E3o foi poss\u00EDvel criar uma inst\u00E2ncia da classe TransformerFactory ''{0}''."},
-
- /*
- * Note to translators: This message is produced when the user
- * specified a name for the translet class that contains characters
- * that are not permitted in a Java class name. The substitution
- * text "{0}" specifies the name the user requested, while "{1}"
- * specifies the name the processor used instead.
- */
- {ErrorMsg.TRANSLET_NAME_JAVA_CONFLICT,
- "N\u00E3o foi poss\u00EDvel usar o nome ''{0}'' como o nome da classe translet, pois ele cont\u00E9m caracteres que n\u00E3o s\u00E3o permitidos no nome da classe Java. O nome ''{1}'' foi usado."},
-
- /*
- * Note to translators: The following message is used as a header.
- * All the error messages are collected together and displayed beneath
- * this message.
- */
- {ErrorMsg.COMPILER_ERROR_KEY,
- "Erros do compilador:"},
-
- /*
- * Note to translators: The following message is used as a header.
- * All the warning messages are collected together and displayed
- * beneath this message.
- */
- {ErrorMsg.COMPILER_WARNING_KEY,
- "Advert\u00EAncias do compilador:"},
-
- /*
- * Note to translators: The following message is used as a header.
- * All the error messages that are produced when the stylesheet is
- * applied to an input document are collected together and displayed
- * beneath this message. A 'translet' is the compiled form of a
- * stylesheet (see above).
- */
- {ErrorMsg.RUNTIME_ERROR_KEY,
- "Erros de translet:"},
-
- /*
- * Note to translators: An attribute whose value is constrained to
- * be a "QName" or a list of "QNames" had a value that was incorrect.
- * 'QName' is an XML syntactic term that must not be translated. The
- * substitution text contains the actual value of the attribute.
- */
- {ErrorMsg.INVALID_QNAME_ERR,
- "Um atributo cujo valor deve ser um QName ou uma lista de QNames separada por espa\u00E7os em branco tinha o valor ''{0}''"},
-
- /*
- * Note to translators: An attribute whose value is required to
- * be an "NCName".
- * 'NCName' is an XML syntactic term that must not be translated. The
- * substitution text contains the actual value of the attribute.
- */
- {ErrorMsg.INVALID_NCNAME_ERR,
- "Um atributo cujo valor deve ser um NCName tinha o valor ''{0}''"},
-
- /*
- * Note to translators: An attribute with an incorrect value was
- * encountered. The permitted value is one of the literal values
- * "xml", "html" or "text"; it is also permitted to have the form of
- * a QName that is not also an NCName. The terms "method",
- * "xsl:output", "xml", "html" and "text" are keywords that must not
- * be translated. The term "qname-but-not-ncname" is an XML syntactic
- * term. The substitution text contains the actual value of the
- * attribute.
- */
- {ErrorMsg.INVALID_METHOD_IN_OUTPUT,
- "O atributo method de um elemento <xsl:output> tinha o valor ''{0}''. O valor deve ser um dos seguintes: ''xml'', ''html'', ''text'', ou qname, mas n\u00E3o ncname"},
-
- {ErrorMsg.JAXP_GET_FEATURE_NULL_NAME,
- "O nome do recurso n\u00E3o pode ser nulo em TransformerFactory.getFeature(Nome da string)."},
-
- {ErrorMsg.JAXP_SET_FEATURE_NULL_NAME,
- "O nome do recurso n\u00E3o pode ser nulo em TransformerFactory.setFeature(Nome da string, valor booliano)."},
-
- {ErrorMsg.JAXP_UNSUPPORTED_FEATURE,
- "N\u00E3o \u00E9 poss\u00EDvel definir o recurso ''{0}'' nesta TransformerFactory."},
-
- {ErrorMsg.JAXP_SECUREPROCESSING_FEATURE,
- "FEATURE_SECURE_PROCESSING: N\u00E3o \u00E9 poss\u00EDvel definir o recurso como falso quando o gerenciador de seguran\u00E7a est\u00E1 presente."},
-
- /*
- * Note to translators: This message describes an internal error in the
- * processor. The term "byte code" is a Java technical term for the
- * executable code in a Java method, and "try-catch-finally block"
- * refers to the Java keywords with those names. "Outlined" is a
- * technical term internal to XSLTC and should not be translated.
- */
- {ErrorMsg.OUTLINE_ERR_TRY_CATCH,
- "Erro interno de XSLTC: o byte code gerado cont\u00E9m um bloco try-catch-finally e n\u00E3o pode ser outlined."},
-
- /*
- * Note to translators: This message describes an internal error in the
- * processor. The terms "OutlineableChunkStart" and
- * "OutlineableChunkEnd" are the names of classes internal to XSLTC and
- * should not be translated. The message indicates that for every
- * "start" there must be a corresponding "end", and vice versa, and
- * that if one of a pair of "start" and "end" appears between another
- * pair of corresponding "start" and "end", then the other half of the
- * pair must also be between that same enclosing pair.
- */
- {ErrorMsg.OUTLINE_ERR_UNBALANCED_MARKERS,
- "Erro interno de XSLTC: os marcadores OutlineableChunkStart e OutlineableChunkEnd devem ser balanceados e aninhados corretamente."},
-
- /*
- * Note to translators: This message describes an internal error in the
- * processor. The term "byte code" is a Java technical term for the
- * executable code in a Java method. The "method" that is being
- * referred to is a Java method in a translet that XSLTC is generating
- * in processing a stylesheet. The "instruction" that is being
- * referred to is one of the instrutions in the Java byte code in that
- * method. "Outlined" is a technical term internal to XSLTC and
- * should not be translated.
- */
- {ErrorMsg.OUTLINE_ERR_DELETED_TARGET,
- "Erro interno de XSLTC: ainda h\u00E1 refer\u00EAncia no m\u00E9todo original a uma instru\u00E7\u00E3o que fazia parte de um bloco de byte code que foi outlined."
- },
-
-
- /*
- * Note to translators: This message describes an internal error in the
- * processor. The "method" that is being referred to is a Java method
- * in a translet that XSLTC is generating.
- *
- */
- {ErrorMsg.OUTLINE_ERR_METHOD_TOO_BIG,
- "Erro interno de XSLTC: um m\u00E9todo no translet excede a limita\u00E7\u00E3o da M\u00E1quina Virtual Java quanto ao tamanho de um m\u00E9todo de de 64 kilobytes. Em geral, essa situa\u00E7\u00E3o \u00E9 causada por modelos de uma folha de estilos que s\u00E3o muito grandes. Tente reestruturar sua folha de estilos de forma a usar modelos menores."
- },
-
- {ErrorMsg.DESERIALIZE_TRANSLET_ERR, "Quando a seguran\u00E7a do Java est\u00E1 ativada, o suporte para desserializar TemplatesImpl fica desativado. Essa situa\u00E7\u00E3o pode ser corrigida definindo a propriedade do sistema jdk.xml.enableTemplatesImplDeserialization como true."}
-
- };
-
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_sk.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_sk.java
deleted file mode 100644
index 17646e9..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_sk.java
+++ /dev/null
@@ -1,863 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ErrorMessages_sk.java,v 1.1.6.1 2005/09/05 11:53:00 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-
-import java.util.ListResourceBundle;
-
-/**
- * @author Morten Jorgensen
- */
-public class ErrorMessages_sk extends ListResourceBundle {
-
-/*
- * XSLTC compile-time error messages.
- *
- * General notes to translators and definitions:
- *
- * 1) XSLTC is the name of the product. It is an acronym for "XSLT Compiler".
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An axis is a particular "dimension" in a tree representation of an XML
- * document; the nodes in the tree are divided along different axes.
- * Traversing the "child" axis, for instance, means that the program
- * would visit each child of a particular node; traversing the "descendant"
- * axis means that the program would visit the child nodes of a particular
- * node, their children, and so on until the leaf nodes of the tree are
- * reached.
- *
- * 5) An iterator is an object that traverses nodes in a tree along a
- * particular axis, one at a time.
- *
- * 6) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 7) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 8) DOM is an acronym for Document Object Model. It is a tree
- * representation of an XML document.
- *
- * SAX is an acronym for the Simple API for XML processing. It is an API
- * used inform an XML processor (in this case XSLTC) of the structure and
- * content of an XML document.
- *
- * Input to the stylesheet processor can come from an XML parser in the
- * form of a DOM tree or through the SAX API.
- *
- * 9) DTD is a document type declaration. It is a way of specifying the
- * grammar for an XML file, the names and types of elements, attributes,
- * etc.
- *
- * 10) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- * 11) Translet is an invented term that refers to the class file that contains
- * the compiled form of a stylesheet.
- */
-
- // These message should be read from a locale-specific resource bundle
- /** Get the lookup table for error messages.
- *
- * @return The message lookup table.
- */
- public Object[][] getContents()
- {
- return new Object[][] {
- {ErrorMsg.MULTIPLE_STYLESHEET_ERR,
- "Viac ne\u017e jeden \u0161t\u00fdl dokumentu bol definovan\u00fd v rovnakom s\u00fabore."},
-
- /*
- * Note to translators: The substitution text is the name of a
- * template. The same name was used on two different templates in the
- * same stylesheet.
- */
- {ErrorMsg.TEMPLATE_REDEF_ERR,
- "Vzor ''{0}'' je u\u017e v tomto \u0161t\u00fdle dokumentu definovan\u00fd."},
-
-
- /*
- * Note to translators: The substitution text is the name of a
- * template. A reference to the template name was encountered, but the
- * template is undefined.
- */
- {ErrorMsg.TEMPLATE_UNDEF_ERR,
- "Vzor ''{0}'' nie je v tomto \u0161t\u00fdle dokumentu definovan\u00fd."},
-
- /*
- * Note to translators: The substitution text is the name of a variable
- * that was defined more than once.
- */
- {ErrorMsg.VARIABLE_REDEF_ERR,
- "Premenn\u00e1 ''{0}'' je viackr\u00e1t definovan\u00e1 v tom istom rozsahu."},
-
- /*
- * Note to translators: The substitution text is the name of a variable
- * or parameter. A reference to the variable or parameter was found,
- * but it was never defined.
- */
- {ErrorMsg.VARIABLE_UNDEF_ERR,
- "Premenn\u00e1 alebo parameter ''{0}'' nie je definovan\u00e1."},
-
- /*
- * Note to translators: The word "class" here refers to a Java class.
- * Processing the stylesheet required a class to be loaded, but it could
- * not be found. The substitution text is the name of the class.
- */
- {ErrorMsg.CLASS_NOT_FOUND_ERR,
- "Nie je mo\u017en\u00e9 n\u00e1js\u0165 triedu ''{0}''."},
-
- /*
- * Note to translators: The word "method" here refers to a Java method.
- * Processing the stylesheet required a reference to the method named by
- * the substitution text, but it could not be found. "public" is the
- * Java keyword.
- */
- {ErrorMsg.METHOD_NOT_FOUND_ERR,
- "Nie je mo\u017en\u00e9 n\u00e1js\u0165 extern\u00fa met\u00f3du ''{0}'' (mus\u00ed by\u0165 verejn\u00e1)."},
-
- /*
- * Note to translators: The word "method" here refers to a Java method.
- * Processing the stylesheet required a reference to the method named by
- * the substitution text, but no method with the required types of
- * arguments or return type could be found.
- */
- {ErrorMsg.ARGUMENT_CONVERSION_ERR,
- "Nie je mo\u017en\u00e9 konvertova\u0165 typ argumentu/n\u00e1vratu vo volan\u00ed met\u00f3dy ''{0}''"},
-
- /*
- * Note to translators: The file or URI named in the substitution text
- * is missing.
- */
- {ErrorMsg.FILE_NOT_FOUND_ERR,
- "S\u00fabor alebo URI ''{0}'' sa nena\u0161li."},
-
- /*
- * Note to translators: This message is displayed when the URI
- * mentioned in the substitution text is not well-formed syntactically.
- */
- {ErrorMsg.INVALID_URI_ERR,
- "Neplatn\u00fd URI ''{0}''."},
-
- /*
- * Note to translators: The file or URI named in the substitution text
- * exists but could not be opened.
- */
- {ErrorMsg.FILE_ACCESS_ERR,
- "Nie je mo\u017en\u00e9 otvori\u0165 s\u00fabor alebo URI ''{0}''."},
-
- /*
- * Note to translators: <xsl:stylesheet> and <xsl:transform> are
- * keywords that should not be translated.
- */
- {ErrorMsg.MISSING_ROOT_ERR,
- "O\u010dak\u00e1va sa element <xsl:stylesheet> alebo <xsl:transform>."},
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- {ErrorMsg.NAMESPACE_UNDEF_ERR,
- "Predpona n\u00e1zvov\u00e9ho priestoru ''{0}'' nie je deklarovan\u00e1."},
-
- /*
- * Note to translators: The Java function named in the stylesheet could
- * not be found.
- */
- {ErrorMsg.FUNCTION_RESOLVE_ERR,
- "Nie je mo\u017en\u00e9 rozl\u00ed\u0161i\u0165 volanie funkcie ''{0}''."},
-
- /*
- * Note to translators: The substitution text is the name of a
- * function. A literal string here means a constant string value.
- */
- {ErrorMsg.NEED_LITERAL_ERR,
- "Argument pre ''{0}'' mus\u00ed by\u0165 re\u0165azcom liter\u00e1lu."},
-
- /*
- * Note to translators: This message indicates there was a syntactic
- * error in the form of an XPath expression. The substitution text is
- * the expression.
- */
- {ErrorMsg.XPATH_PARSER_ERR,
- "Chyba pri anal\u00fdze v\u00fdrazu XPath ''{0}''."},
-
- /*
- * Note to translators: An element in the stylesheet requires a
- * particular attribute named by the substitution text, but that
- * attribute was not specified in the stylesheet.
- */
- {ErrorMsg.REQUIRED_ATTR_ERR,
- "Ch\u00fdba po\u017eadovan\u00fd atrib\u00fat ''{0}''."},
-
- /*
- * Note to translators: This message indicates that a character not
- * permitted in an XPath expression was encountered. The substitution
- * text is the offending character.
- */
- {ErrorMsg.ILLEGAL_CHAR_ERR,
- "Neplatn\u00fd znak ''{0}'' vo v\u00fdraze XPath."},
-
- /*
- * Note to translators: A processing instruction is a mark-up item in
- * an XML document that request some behaviour of an XML processor. The
- * form of the name of was invalid in this case, and the substitution
- * text is the name.
- */
- {ErrorMsg.ILLEGAL_PI_ERR,
- "Neplatn\u00fd n\u00e1zov ''{0}'' pre in\u0161trukciu spracovania."},
-
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- {ErrorMsg.STRAY_ATTRIBUTE_ERR,
- "Atrib\u00fat ''{0}'' mimo elementu."},
-
- /*
- * Note to translators: An attribute that wasn't recognized was
- * specified on an element in the stylesheet. The attribute is named
- * by the substitution
- * text.
- */
- {ErrorMsg.ILLEGAL_ATTRIBUTE_ERR,
- "Neleg\u00e1lny atrib\u00fat ''{0}''."},
-
- /*
- * Note to translators: "import" and "include" are keywords that should
- * not be translated. This messages indicates that the stylesheet
- * named in the substitution text imported or included itself either
- * directly or indirectly.
- */
- {ErrorMsg.CIRCULAR_INCLUDE_ERR,
- "Cirkul\u00e1rny import/zahrnutie. \u0160t\u00fdl dokumentu ''{0}'' je u\u017e zaveden\u00fd."},
-
- /*
- * Note to translators: A result-tree fragment is a portion of a
- * resulting XML document represented as a tree. "<xsl:sort>" is a
- * keyword and should not be translated.
- */
- {ErrorMsg.RESULT_TREE_SORT_ERR,
- "Fragmenty stromu v\u00fdsledkov nemo\u017eno triedi\u0165 (elementy <xsl:sort> s\u00fa ignorovan\u00e9). Ke\u010f vytv\u00e1rate v\u00fdsledkov\u00fd strom, mus\u00edte triedi\u0165 uzly."},
-
- /*
- * Note to translators: A name can be given to a particular style to be
- * used to format decimal values. The substitution text gives the name
- * of such a style for which more than one declaration was encountered.
- */
- {ErrorMsg.SYMBOLS_REDEF_ERR,
- "Desiatkov\u00e9 form\u00e1tovanie ''{0}'' je u\u017e definovan\u00e9."},
-
- /*
- * Note to translators: The stylesheet version named in the
- * substitution text is not supported.
- */
- {ErrorMsg.XSL_VERSION_ERR,
- "Verzia XSL ''{0}'' nie je podporovan\u00e1 XSLTC."},
-
- /*
- * Note to translators: The definitions of one or more variables or
- * parameters depend on one another.
- */
- {ErrorMsg.CIRCULAR_VARIABLE_ERR,
- "Cirkul\u00e1rna referencia premennej/parametra v ''{0}''."},
-
- /*
- * Note to translators: The operator in an expresion with two operands was
- * not recognized.
- */
- {ErrorMsg.ILLEGAL_BINARY_OP_ERR,
- "Nezn\u00e1my oper\u00e1tor pre bin\u00e1rny v\u00fdraz."},
-
- /*
- * Note to translators: This message is produced if a reference to a
- * function has too many or too few arguments.
- */
- {ErrorMsg.ILLEGAL_ARG_ERR,
- "Neplatn\u00fd argument(y) pre volanie funkcie."},
-
- /*
- * Note to translators: "document()" is the name of function and must
- * not be translated. A node-set is a set of the nodes in the tree
- * representation of an XML document.
- */
- {ErrorMsg.DOCUMENT_ARG_ERR,
- "Druh\u00fd argument pre funkciu dokumentu() mus\u00ed by\u0165 sada uzlov."},
-
- /*
- * Note to translators: "<xsl:when>" and "<xsl:choose>" are keywords
- * and should not be translated. This message describes a syntax error
- * in the stylesheet.
- */
- {ErrorMsg.MISSING_WHEN_ERR,
- "V <xsl:choose> sa vy\u017eaduje najmenej jeden element <xsl:when>."},
-
- /*
- * Note to translators: "<xsl:otherwise>" and "<xsl:choose>" are
- * keywords and should not be translated. This message describes a
- * syntax error in the stylesheet.
- */
- {ErrorMsg.MULTIPLE_OTHERWISE_ERR,
- "V <xsl:choose> je povolen\u00fd len jeden element <xsl:otherwise>."},
-
- /*
- * Note to translators: "<xsl:otherwise>" and "<xsl:choose>" are
- * keywords and should not be translated. This message describes a
- * syntax error in the stylesheet.
- */
- {ErrorMsg.STRAY_OTHERWISE_ERR,
- "<xsl:otherwise> mo\u017eno pou\u017ei\u0165 len v <xsl:choose>."},
-
- /*
- * Note to translators: "<xsl:when>" and "<xsl:choose>" are keywords
- * and should not be translated. This message describes a syntax error
- * in the stylesheet.
- */
- {ErrorMsg.STRAY_WHEN_ERR,
- "<xsl:when> mo\u017eno pou\u017ei\u0165 len v <xsl:choose>."},
-
- /*
- * Note to translators: "<xsl:when>", "<xsl:otherwise>" and
- * "<xsl:choose>" are keywords and should not be translated. This
- * message describes a syntax error in the stylesheet.
- */
- {ErrorMsg.WHEN_ELEMENT_ERR,
- "V <xsl:choose> s\u00fa povolen\u00e9 len elementy <xsl:when> a <xsl:otherwise>."},
-
- /*
- * Note to translators: "<xsl:attribute-set>" and "name" are keywords
- * that should not be translated.
- */
- {ErrorMsg.UNNAMED_ATTRIBSET_ERR,
- "<xsl:attribute-set> ch\u00fdba atrib\u00fat 'name'."},
-
- /*
- * Note to translators: An element in the stylesheet contained an
- * element of a type that it was not permitted to contain.
- */
- {ErrorMsg.ILLEGAL_CHILD_ERR,
- "Neplatn\u00fd element potomka."},
-
- /*
- * Note to translators: The stylesheet tried to create an element with
- * a name that was not a valid XML name. The substitution text contains
- * the name.
- */
- {ErrorMsg.ILLEGAL_ELEM_NAME_ERR,
- "Nem\u00f4\u017eete vola\u0165 element ''{0}''"},
-
- /*
- * Note to translators: The stylesheet tried to create an attribute
- * with a name that was not a valid XML name. The substitution text
- * contains the name.
- */
- {ErrorMsg.ILLEGAL_ATTR_NAME_ERR,
- "Nem\u00f4\u017eete vola\u0165 atrib\u00fat ''{0}''"},
-
- /*
- * Note to translators: The children of the outermost element of a
- * stylesheet are referred to as top-level elements. No text should
- * occur within that outermost element unless it is within a top-level
- * element. This message indicates that that constraint was violated.
- * "<xsl:stylesheet>" is a keyword that should not be translated.
- */
- {ErrorMsg.ILLEGAL_TEXT_NODE_ERR,
- "Textov\u00e9 \u00fadaje s\u00fa mimo elementu vrchnej \u00farovne <xsl:stylesheet>."},
-
- /*
- * Note to translators: JAXP is an acronym for the Java API for XML
- * Processing. This message indicates that the XML parser provided to
- * XSLTC to process the XML input document had a configuration problem.
- */
- {ErrorMsg.SAX_PARSER_CONFIG_ERR,
- "Analyz\u00e1tor JAXP nie je spr\u00e1vne nakonfigurovan\u00fd"},
-
- /*
- * Note to translators: The substitution text names the internal error
- * encountered.
- */
- {ErrorMsg.INTERNAL_ERR,
- "Neodstr\u00e1nite\u013en\u00e1 intern\u00e1 chyba XSLTC: ''{0}''"},
-
- /*
- * Note to translators: The stylesheet contained an element that was
- * not recognized as part of the XSL syntax. The substitution text
- * gives the element name.
- */
- {ErrorMsg.UNSUPPORTED_XSL_ERR,
- "Nepodporovan\u00fd element XSL ''{0}''."},
-
- /*
- * Note to translators: The stylesheet referred to an extension to the
- * XSL syntax and indicated that it was defined by XSLTC, but XSTLC does
- * not recognized the particular extension named. The substitution text
- * gives the extension name.
- */
- {ErrorMsg.UNSUPPORTED_EXT_ERR,
- "Nerozl\u00ed\u0161en\u00e9 roz\u0161\u00edrenie XSLTC ''{0}''."},
-
- /*
- * Note to translators: The XML document given to XSLTC as a stylesheet
- * was not, in fact, a stylesheet. XSLTC is able to detect that in this
- * case because the outermost element in the stylesheet has to be
- * declared with respect to the XSL namespace URI, but no declaration
- * for that namespace was seen.
- */
- {ErrorMsg.MISSING_XSLT_URI_ERR,
- "Vstupn\u00fd dokument nie je \u0161t\u00fdlom dokumentu (n\u00e1zvov\u00fd priestor XSL nie je deklarovan\u00fd v kore\u0148ovom elemente)."},
-
- /*
- * Note to translators: XSLTC could not find the stylesheet document
- * with the name specified by the substitution text.
- */
- {ErrorMsg.MISSING_XSLT_TARGET_ERR,
- "Nebolo mo\u017en\u00e9 n\u00e1js\u0165 cie\u013e \u0161t\u00fdlu dokumentu ''{0}''."},
-
- /*
- * Note to translators: access to the stylesheet target is denied
- */
- {ErrorMsg.ACCESSING_XSLT_TARGET_ERR,
- "Could not read stylesheet target ''{0}'', because ''{1}'' access is not allowed."},
-
- /*
- * Note to translators: This message represents an internal error in
- * condition in XSLTC. The substitution text is the class name in XSLTC
- * that is missing some functionality.
- */
- {ErrorMsg.NOT_IMPLEMENTED_ERR,
- "Nie je implementovan\u00e9: ''{0}''."},
-
- /*
- * Note to translators: The XML document given to XSLTC as a stylesheet
- * was not, in fact, a stylesheet.
- */
- {ErrorMsg.NOT_STYLESHEET_ERR,
- "Vstupn\u00fd dokument neobsahuje \u0161t\u00fdl dokumentu XSL."},
-
- /*
- * Note to translators: The element named in the substitution text was
- * encountered in the stylesheet but is not recognized.
- */
- {ErrorMsg.ELEMENT_PARSE_ERR,
- "Nebolo mo\u017en\u00e9 analyzova\u0165 element ''{0}''"},
-
- /*
- * Note to translators: "use", "<key>", "node", "node-set", "string"
- * and "number" are keywords in this context and should not be
- * translated. This message indicates that the value of the "use"
- * attribute was not one of the permitted values.
- */
- {ErrorMsg.KEY_USE_ATTR_ERR,
- "Atrib\u00fat pou\u017eitia <key> mus\u00ed by\u0165 uzol, sada uzlov, re\u0165azec alebo \u010d\u00edslo."},
-
- /*
- * Note to translators: An XML document can specify the version of the
- * XML specification to which it adheres. This message indicates that
- * the version specified for the output document was not valid.
- */
- {ErrorMsg.OUTPUT_VERSION_ERR,
- "Verzia v\u00fdstupn\u00e9ho dokumentu XML by mala by\u0165 1.0"},
-
- /*
- * Note to translators: The operator in a comparison operation was
- * not recognized.
- */
- {ErrorMsg.ILLEGAL_RELAT_OP_ERR,
- "Nezn\u00e1my oper\u00e1tor pre rela\u010dn\u00fd v\u00fdraz"},
-
- /*
- * Note to translators: An attribute set defines as a set of XML
- * attributes that can be added to an element in the output XML document
- * as a group. This message is reported if the name specified was not
- * used to declare an attribute set. The substitution text is the name
- * that is in error.
- */
- {ErrorMsg.ATTRIBSET_UNDEF_ERR,
- "Pokus o pou\u017eitie neexistuj\u00facej sady atrib\u00fatov ''{0}''."},
-
- /*
- * Note to translators: The term "attribute value template" is a term
- * defined by XSLT which describes the value of an attribute that is
- * determined by an XPath expression. The message indicates that the
- * expression was syntactically incorrect; the substitution text
- * contains the expression that was in error.
- */
- {ErrorMsg.ATTR_VAL_TEMPLATE_ERR,
- "Nie je mo\u017en\u00e9 analyzova\u0165 vzor hodnoty atrib\u00fatu ''{0}''."},
-
- /*
- * Note to translators: ???
- */
- {ErrorMsg.UNKNOWN_SIG_TYPE_ERR,
- "Nezn\u00e1my typ \u00fadajov v podpise pre triedu ''{0}''."},
-
- /*
- * Note to translators: The substitution text refers to data types.
- * The message is displayed if a value in a particular context needs to
- * be converted to type {1}, but that's not possible for a value of
- * type {0}.
- */
- {ErrorMsg.DATA_CONVERSION_ERR,
- "Nie je mo\u017en\u00e9 konvertova\u0165 typ \u00fadajov ''{0}'' na ''{1}''."},
-
- /*
- * Note to translators: "Templates" is a Java class name that should
- * not be translated.
- */
- {ErrorMsg.NO_TRANSLET_CLASS_ERR,
- "Tento vzor neobsahuje platn\u00fa defin\u00edciu triedy transletu."},
-
- /*
- * Note to translators: "Templates" is a Java class name that should
- * not be translated.
- */
- {ErrorMsg.NO_MAIN_TRANSLET_ERR,
- "Tento vzor neobsahuje triedu s n\u00e1zvom ''{0}''."},
-
- /*
- * Note to translators: The substitution text is the name of a class.
- */
- {ErrorMsg.TRANSLET_CLASS_ERR,
- "Nebolo mo\u017en\u00e9 zavies\u0165 triedu transletu ''{0}''."},
-
- {ErrorMsg.TRANSLET_OBJECT_ERR,
- "Trieda transletu zaveden\u00e1, ale nie je mo\u017en\u00e9 vytvori\u0165 in\u0161tanciu transletu."},
-
- /*
- * Note to translators: "ErrorListener" is a Java interface name that
- * should not be translated. The message indicates that the user tried
- * to set an ErrorListener object on object of the class named in the
- * substitution text with "null" Java value.
- */
- {ErrorMsg.ERROR_LISTENER_NULL_ERR,
- "Pokus o nastavenie ErrorListener pre ''{0}'' na null"},
-
- /*
- * Note to translators: StreamSource, SAXSource and DOMSource are Java
- * interface names that should not be translated.
- */
- {ErrorMsg.JAXP_UNKNOWN_SOURCE_ERR,
- "XSLTC podporuje len StreamSource, SAXSource a DOMSource"},
-
- /*
- * Note to translators: "Source" is a Java class name that should not
- * be translated. The substitution text is the name of Java method.
- */
- {ErrorMsg.JAXP_NO_SOURCE_ERR,
- "Objekt zdroja odovzdan\u00fd ''{0}'' nem\u00e1 \u017eiadny obsah."},
-
- /*
- * Note to translators: The message indicates that XSLTC failed to
- * compile the stylesheet into a translet (class file).
- */
- {ErrorMsg.JAXP_COMPILE_ERR,
- "Nebolo mo\u017en\u00e9 skompilova\u0165 \u0161t\u00fdl dokumentu"},
-
- /*
- * Note to translators: "TransformerFactory" is a class name. In this
- * context, an attribute is a property or setting of the
- * TransformerFactory object. The substitution text is the name of the
- * unrecognised attribute. The method used to retrieve the attribute is
- * "getAttribute", so it's not clear whether it would be best to
- * translate the term "attribute".
- */
- {ErrorMsg.JAXP_INVALID_ATTR_ERR,
- "TransformerFactory nerozozn\u00e1va atrib\u00fat ''{0}''."},
-
- /*
- * Note to translators: "setResult()" and "startDocument()" are Java
- * method names that should not be translated.
- */
- {ErrorMsg.JAXP_SET_RESULT_ERR,
- "setResult() sa mus\u00ed vola\u0165 pred startDocument()."},
-
- /*
- * Note to translators: "Transformer" is a Java interface name that
- * should not be translated. A Transformer object should contained a
- * reference to a translet object in order to be used for
- * transformations; this message is produced if that requirement is not
- * met.
- */
- {ErrorMsg.JAXP_NO_TRANSLET_ERR,
- "Transform\u00e1tor nem\u00e1 \u017eiadny zapuzdren\u00fd objekt transletu."},
-
- /*
- * Note to translators: The XML document that results from a
- * transformation needs to be sent to an output handler object; this
- * message is produced if that requirement is not met.
- */
- {ErrorMsg.JAXP_NO_HANDLER_ERR,
- "Pre v\u00fdsledok transform\u00e1cie nebol definovan\u00fd \u017eiadny v\u00fdstupn\u00fd handler."},
-
- /*
- * Note to translators: "Result" is a Java interface name in this
- * context. The substitution text is a method name.
- */
- {ErrorMsg.JAXP_NO_RESULT_ERR,
- "Objekt v\u00fdsledku odovzdan\u00fd ''{0}'' je neplatn\u00fd."},
-
- /*
- * Note to translators: "Transformer" is a Java interface name. The
- * user's program attempted to access an unrecognized property with the
- * name specified in the substitution text. The method used to retrieve
- * the property is "getOutputProperty", so it's not clear whether it
- * would be best to translate the term "property".
- */
- {ErrorMsg.JAXP_UNKNOWN_PROP_ERR,
- "Pokus o pr\u00edstup k neplatn\u00e9mu majetku transform\u00e1tora ''{0}''."},
-
- /*
- * Note to translators: SAX2DOM is the name of a Java class that should
- * not be translated. This is an adapter in the sense that it takes a
- * DOM object and converts it to something that uses the SAX API.
- */
- {ErrorMsg.SAX2DOM_ADAPTER_ERR,
- "Nebolo mo\u017en\u00e9 vytvori\u0165 adapt\u00e9r SAX2DOM: ''{0}''."},
-
- /*
- * Note to translators: "XSLTCSource.build()" is a Java method name.
- * "systemId" is an XML term that is short for "system identification".
- */
- {ErrorMsg.XSLTC_SOURCE_ERR,
- "XSLTCSource.build() bol zavolan\u00fd bez nastaven\u00e9ho systemId."},
-
-
- {ErrorMsg.COMPILE_STDIN_ERR,
- "Vo\u013eba -i sa mus\u00ed pou\u017e\u00edva\u0165 s vo\u013ebou -o."},
-
-
- /*
- * Note to translators: This message contains usage information for a
- * means of invoking XSLTC from the command-line. The message is
- * formatted for presentation in English. The strings <output>,
- * <directory>, etc. indicate user-specified argument values, and can
- * be translated - the argument <package> refers to a Java package, so
- * it should be handled in the same way the term is handled for JDK
- * documentation.
- */
- {ErrorMsg.COMPILE_USAGE_STR,
- "SYNOPSIS\n java com.sun.org.apache.xalan.internal.xsltc.cmdline.Compile [-o <output>]\n [-d <directory>] [-j <jarfile>] [-p <package>]\n [-n] [-x] [-s] [-u] [-v] [-h] { <stylesheet> | -i }\n\nOPTIONS\n -o <output> prira\u010fuje n\u00e1zov <output> generovan\u00e9mu transletu \n. \u0160tandardne sa n\u00e1zov transletu \n berie z n\u00e1zvu <stylesheet>. T\u00e1to vo\u013eba sa ignoruje pri kompilovan\u00ed viacer\u00fdch \u0161t\u00fdlov dokumentov\n\n. -d <directory> uv\u00e1dza cie\u013eov\u00fd adres\u00e1r pre translet\n -j <jarfile> pakuje triedy transletov do s\u00faboru jar n\u00e1zvu \n uveden\u00e9ho ako <jarfile>\n -p <package> uv\u00e1dza predponu n\u00e1zvu bal\u00edku pre v\u0161etky generovan\u00e9 triedy transletu.\n\n -n povo\u013euje zoradenie vzorov v riadku (\u0161tandardn\u00e9 chovanie v priemere lep\u0161ie). \n\n -x zap\u00edna v\u00fdstupy spr\u00e1v ladenia \n -s zakazuje volanie System.exit\n -u interpretuje<stylesheet> argumenty ako URL\n -i n\u00fati kompil\u00e1tor \u010d\u00edta\u0165 \u0161t\u00fdl dokumentu z stdin\n -v tla\u010d\u00ed verziu kompil\u00e1tora\n -h tla\u010d\u00ed pr\u00edkaz tohto pou\u017eitia\n"},
-
- /*
- * Note to translators: This message contains usage information for a
- * means of invoking XSLTC from the command-line. The message is
- * formatted for presentation in English. The strings <jarfile>,
- * <document>, etc. indicate user-specified argument values, and can
- * be translated - the argument <class> refers to a Java class, so it
- * should be handled in the same way the term is handled for JDK
- * documentation.
- */
- {ErrorMsg.TRANSFORM_USAGE_STR,
- "SYNOPSIS \n java com.sun.org.apache.xalan.internal.xsltc.cmdline.Transform [-j <jarfile>]\n [-x] [-s] [-n <iterations>] {-u <document_url> | <document>}\n <class> [<param1>=<value1> ...]\n\n pou\u017e\u00edva translet <class> na transform\u00e1ciu dokumentu XML \n uveden\u00e9ho ako <document>. <class> transletu je bu\u010f v \n u\u017e\u00edvate\u013eovej CLASSPATH alebo vo volite\u013ene uvedenom <jarfile>.\nVO\u013dBY\n -j <jarfile> uv\u00e1dza s\u00fabor jar, z ktor\u00e9ho sa m\u00e1 zavies\u0165 translet\n -x zap\u00edna \u010fal\u0161\u00ed v\u00fdstup spr\u00e1v ladenia\n -s zakazuje volanie System.exit\n -n <iterations> sp\u00fa\u0161\u0165a transform\u00e1ciu <iterations> r\u00e1z a \n zobrazuje inform\u00e1cie profilovania\n -u <document_url> uv\u00e1dza vstupn\u00fd dokument XML ako URL\n"},
-
-
-
- /*
- * Note to translators: "<xsl:sort>", "<xsl:for-each>" and
- * "<xsl:apply-templates>" are keywords that should not be translated.
- * The message indicates that an xsl:sort element must be a child of
- * one of the other kinds of elements mentioned.
- */
- {ErrorMsg.STRAY_SORT_ERR,
- "<xsl:sort> mo\u017eno pou\u017ei\u0165 len v <xsl:for-each> alebo <xsl:apply-templates>."},
-
- /*
- * Note to translators: The message indicates that the encoding
- * requested for the output document was on that requires support that
- * is not available from the Java Virtual Machine being used to execute
- * the program.
- */
- {ErrorMsg.UNSUPPORTED_ENCODING,
- "V\u00fdstupn\u00e9 k\u00f3dovanie ''{0}'' nie je v tomto JVM podporovan\u00e9."},
-
- /*
- * Note to translators: The message indicates that the XPath expression
- * named in the substitution text was not well formed syntactically.
- */
- {ErrorMsg.SYNTAX_ERR,
- "Chyba syntaxe v ''{0}''."},
-
- /*
- * Note to translators: The substitution text is the name of a Java
- * class. The term "constructor" here is the Java term. The message is
- * displayed if XSLTC could not find a constructor for the specified
- * class.
- */
- {ErrorMsg.CONSTRUCTOR_NOT_FOUND,
- "Nie je mo\u017en\u00e9 n\u00e1js\u0165 extern\u00fd kon\u0161truktor ''{0}''."},
-
- /*
- * Note to translators: "static" is the Java keyword. The substitution
- * text is the name of a function. The first argument of that function
- * is not of the required type.
- */
- {ErrorMsg.NO_JAVA_FUNCT_THIS_REF,
- "Prv\u00fd argument pre nestatick\u00fa funkciu Java ''{0}'' nie je platnou referenciou objektu."},
-
- /*
- * Note to translators: An XPath expression was not of the type
- * required in a particular context. The substitution text is the
- * expression that was in error.
- */
- {ErrorMsg.TYPE_CHECK_ERR,
- "Chyba pri kontrole typu v\u00fdrazu ''{0}''."},
-
- /*
- * Note to translators: An XPath expression was not of the type
- * required in a particular context. However, the location of the
- * problematic expression is unknown.
- */
- {ErrorMsg.TYPE_CHECK_UNK_LOC_ERR,
- "Chyba pri kontrole typu v\u00fdrazu na nezn\u00e1mom mieste."},
-
- /*
- * Note to translators: The substitution text is the name of a command-
- * line option that was not recognized.
- */
- {ErrorMsg.ILLEGAL_CMDLINE_OPTION_ERR,
- "Vo\u013eba pr\u00edkazov\u00e9ho riadka ''{0}'' je neplatn\u00e1."},
-
- /*
- * Note to translators: The substitution text is the name of a command-
- * line option.
- */
- {ErrorMsg.CMDLINE_OPT_MISSING_ARG_ERR,
- "Vo\u013ebe pr\u00edkazov\u00e9ho riadka ''{0}'' ch\u00fdba po\u017eadovan\u00fd argument."},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text contains two error
- * messages. The spacing before the second substitution text indents
- * it the same amount as the first in English.
- */
- {ErrorMsg.WARNING_PLUS_WRAPPED_MSG,
- "UPOZORNENIE: ''{0}''\n :{1}"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text is an error message.
- */
- {ErrorMsg.WARNING_MSG,
- "UPOZORNENIE: ''{0}''"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text contains two error
- * messages. The spacing before the second substitution text indents
- * it the same amount as the first in English.
- */
- {ErrorMsg.FATAL_ERR_PLUS_WRAPPED_MSG,
- "KRITICK\u00c1 CHYBA: ''{0}''\n :{1}"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text is an error message.
- */
- {ErrorMsg.FATAL_ERR_MSG,
- "KRITICK\u00c1 CHYBA: ''{0}''"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text contains two error
- * messages. The spacing before the second substitution text indents
- * it the same amount as the first in English.
- */
- {ErrorMsg.ERROR_PLUS_WRAPPED_MSG,
- "CHYBA: ''{0}''\n :{1}"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text is an error message.
- */
- {ErrorMsg.ERROR_MSG,
- "CHYBA: ''{0}''"},
-
- /*
- * Note to translators: The substitution text is the name of a class.
- */
- {ErrorMsg.TRANSFORM_WITH_TRANSLET_STR,
- "Transform\u00e1cia pomocou transletu ''{0}'' "},
-
- /*
- * Note to translators: The first substitution is the name of a class,
- * while the second substitution is the name of a jar file.
- */
- {ErrorMsg.TRANSFORM_WITH_JAR_STR,
- "Transform\u00e1cia pomocou transletu ''{0}'' zo s\u00faboru jar ''{1}''"},
-
- /*
- * Note to translators: "TransformerFactory" is the name of a Java
- * interface and must not be translated. The substitution text is
- * the name of the class that could not be instantiated.
- */
- {ErrorMsg.COULD_NOT_CREATE_TRANS_FACT,
- "Nebolo mo\u017en\u00e9 vytvori\u0165 in\u0161tanciu triedy TransformerFactory ''{0}''."},
-
- /*
- * Note to translators: The following message is used as a header.
- * All the error messages are collected together and displayed beneath
- * this message.
- */
- {ErrorMsg.COMPILER_ERROR_KEY,
- "Chyby preklada\u010da:"},
-
- /*
- * Note to translators: The following message is used as a header.
- * All the warning messages are collected together and displayed
- * beneath this message.
- */
- {ErrorMsg.COMPILER_WARNING_KEY,
- "Upozornenia preklada\u010da:"},
-
- /*
- * Note to translators: The following message is used as a header.
- * All the error messages that are produced when the stylesheet is
- * applied to an input document are collected together and displayed
- * beneath this message. A 'translet' is the compiled form of a
- * stylesheet (see above).
- */
- {ErrorMsg.RUNTIME_ERROR_KEY,
- "Chyby transletu:"},
-
- {ErrorMsg.JAXP_SECUREPROCESSING_FEATURE,
- "FEATURE_SECURE_PROCESSING: Cannot set the feature to false when security manager is present."}
- };
-
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_sv.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_sv.java
deleted file mode 100644
index 0920f44..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_sv.java
+++ /dev/null
@@ -1,974 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-
-import java.util.ListResourceBundle;
-
-/**
- * @author Morten Jorgensen
- */
-public class ErrorMessages_sv extends ListResourceBundle {
-
-/*
- * XSLTC compile-time error messages.
- *
- * General notes to translators and definitions:
- *
- * 1) XSLTC is the name of the product. It is an acronym for "XSLT Compiler".
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An axis is a particular "dimension" in a tree representation of an XML
- * document; the nodes in the tree are divided along different axes.
- * Traversing the "child" axis, for instance, means that the program
- * would visit each child of a particular node; traversing the "descendant"
- * axis means that the program would visit the child nodes of a particular
- * node, their children, and so on until the leaf nodes of the tree are
- * reached.
- *
- * 5) An iterator is an object that traverses nodes in a tree along a
- * particular axis, one at a time.
- *
- * 6) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 7) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 8) DOM is an acronym for Document Object Model. It is a tree
- * representation of an XML document.
- *
- * SAX is an acronym for the Simple API for XML processing. It is an API
- * used inform an XML processor (in this case XSLTC) of the structure and
- * content of an XML document.
- *
- * Input to the stylesheet processor can come from an XML parser in the
- * form of a DOM tree or through the SAX API.
- *
- * 9) DTD is a document type declaration. It is a way of specifying the
- * grammar for an XML file, the names and types of elements, attributes,
- * etc.
- *
- * 10) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- * 11) Translet is an invented term that refers to the class file that contains
- * the compiled form of a stylesheet.
- */
-
- // These message should be read from a locale-specific resource bundle
- /** Get the lookup table for error messages.
- *
- * @return The message lookup table.
- */
- public Object[][] getContents()
- {
- return new Object[][] {
- {ErrorMsg.MULTIPLE_STYLESHEET_ERR,
- "Fler \u00E4n en formatmall har definierats i samma fil."},
-
- /*
- * Note to translators: The substitution text is the name of a
- * template. The same name was used on two different templates in the
- * same stylesheet.
- */
- {ErrorMsg.TEMPLATE_REDEF_ERR,
- "Mallen ''{0}'' har redan definierats i denna formatmall."},
-
-
- /*
- * Note to translators: The substitution text is the name of a
- * template. A reference to the template name was encountered, but the
- * template is undefined.
- */
- {ErrorMsg.TEMPLATE_UNDEF_ERR,
- "Mallen ''{0}'' har inte definierats i denna formatmall."},
-
- /*
- * Note to translators: The substitution text is the name of a variable
- * that was defined more than once.
- */
- {ErrorMsg.VARIABLE_REDEF_ERR,
- "Variabeln ''{0}'' har definierats flera g\u00E5nger i samma omfattning."},
-
- /*
- * Note to translators: The substitution text is the name of a variable
- * or parameter. A reference to the variable or parameter was found,
- * but it was never defined.
- */
- {ErrorMsg.VARIABLE_UNDEF_ERR,
- "Variabeln eller parametern ''{0}'' har inte definierats."},
-
- /*
- * Note to translators: The word "class" here refers to a Java class.
- * Processing the stylesheet required a class to be loaded, but it could
- * not be found. The substitution text is the name of the class.
- */
- {ErrorMsg.CLASS_NOT_FOUND_ERR,
- "Hittar inte klassen ''{0}''."},
-
- /*
- * Note to translators: The word "method" here refers to a Java method.
- * Processing the stylesheet required a reference to the method named by
- * the substitution text, but it could not be found. "public" is the
- * Java keyword.
- */
- {ErrorMsg.METHOD_NOT_FOUND_ERR,
- "Hittar inte den externa metoden ''{0}'' (m\u00E5ste vara allm\u00E4n)."},
-
- /*
- * Note to translators: The word "method" here refers to a Java method.
- * Processing the stylesheet required a reference to the method named by
- * the substitution text, but no method with the required types of
- * arguments or return type could be found.
- */
- {ErrorMsg.ARGUMENT_CONVERSION_ERR,
- "Kan inte konvertera argument/returtyp vid anrop till metoden ''{0}''"},
-
- /*
- * Note to translators: The file or URI named in the substitution text
- * is missing.
- */
- {ErrorMsg.FILE_NOT_FOUND_ERR,
- "Fil eller URI ''{0}'' hittades inte."},
-
- /*
- * Note to translators: This message is displayed when the URI
- * mentioned in the substitution text is not well-formed syntactically.
- */
- {ErrorMsg.INVALID_URI_ERR,
- "Ogiltig URI ''{0}''."},
-
- /*
- * Note to translators: The file or URI named in the substitution text
- * exists but could not be opened.
- */
- {ErrorMsg.FILE_ACCESS_ERR,
- "Kan inte \u00F6ppna filen eller URI ''{0}''."},
-
- /*
- * Note to translators: <xsl:stylesheet> and <xsl:transform> are
- * keywords that should not be translated.
- */
- {ErrorMsg.MISSING_ROOT_ERR,
- "F\u00F6rv\u00E4ntade <xsl:stylesheet>- eller <xsl:transform>-element."},
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- {ErrorMsg.NAMESPACE_UNDEF_ERR,
- "Namnrymdsprefixet ''{0}'' har inte deklarerats."},
-
- /*
- * Note to translators: The Java function named in the stylesheet could
- * not be found.
- */
- {ErrorMsg.FUNCTION_RESOLVE_ERR,
- "Kan inte matcha anrop till funktionen ''{0}''."},
-
- /*
- * Note to translators: The substitution text is the name of a
- * function. A literal string here means a constant string value.
- */
- {ErrorMsg.NEED_LITERAL_ERR,
- "Argument till ''{0}'' m\u00E5ste vara en litteral str\u00E4ng."},
-
- /*
- * Note to translators: This message indicates there was a syntactic
- * error in the form of an XPath expression. The substitution text is
- * the expression.
- */
- {ErrorMsg.XPATH_PARSER_ERR,
- "Fel vid tolkning av XPath-uttrycket ''{0}''."},
-
- /*
- * Note to translators: An element in the stylesheet requires a
- * particular attribute named by the substitution text, but that
- * attribute was not specified in the stylesheet.
- */
- {ErrorMsg.REQUIRED_ATTR_ERR,
- "Det obligatoriska attributet ''{0}'' saknas."},
-
- /*
- * Note to translators: This message indicates that a character not
- * permitted in an XPath expression was encountered. The substitution
- * text is the offending character.
- */
- {ErrorMsg.ILLEGAL_CHAR_ERR,
- "Otill\u00E5tet tecken ''{0}'' i XPath-uttrycket."},
-
- /*
- * Note to translators: A processing instruction is a mark-up item in
- * an XML document that request some behaviour of an XML processor. The
- * form of the name of was invalid in this case, and the substitution
- * text is the name.
- */
- {ErrorMsg.ILLEGAL_PI_ERR,
- "''{0}'' \u00E4r ett otill\u00E5tet namn i bearbetningsinstruktion."},
-
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- {ErrorMsg.STRAY_ATTRIBUTE_ERR,
- "Attributet ''{0}'' finns utanf\u00F6r elementet."},
-
- /*
- * Note to translators: An attribute that wasn't recognized was
- * specified on an element in the stylesheet. The attribute is named
- * by the substitution
- * text.
- */
- {ErrorMsg.ILLEGAL_ATTRIBUTE_ERR,
- "''{0}'' \u00E4r ett otill\u00E5tet attribut."},
-
- /*
- * Note to translators: "import" and "include" are keywords that should
- * not be translated. This messages indicates that the stylesheet
- * named in the substitution text imported or included itself either
- * directly or indirectly.
- */
- {ErrorMsg.CIRCULAR_INCLUDE_ERR,
- "Cirkul\u00E4r import/include. Formatmallen ''{0}'' har redan laddats."},
-
- /*
- * Note to translators: A result-tree fragment is a portion of a
- * resulting XML document represented as a tree. "<xsl:sort>" is a
- * keyword and should not be translated.
- */
- {ErrorMsg.RESULT_TREE_SORT_ERR,
- "Resultattr\u00E4dfragment kan inte sorteras (<xsl:sort>-element ignoreras). Du m\u00E5ste sortera noderna n\u00E4r resultattr\u00E4det skapas."},
-
- /*
- * Note to translators: A name can be given to a particular style to be
- * used to format decimal values. The substitution text gives the name
- * of such a style for which more than one declaration was encountered.
- */
- {ErrorMsg.SYMBOLS_REDEF_ERR,
- "Decimalformateringen ''{0}'' har redan definierats."},
-
- /*
- * Note to translators: The stylesheet version named in the
- * substitution text is not supported.
- */
- {ErrorMsg.XSL_VERSION_ERR,
- "XSL-versionen ''{0}'' underst\u00F6ds inte i XSLTC."},
-
- /*
- * Note to translators: The definitions of one or more variables or
- * parameters depend on one another.
- */
- {ErrorMsg.CIRCULAR_VARIABLE_ERR,
- "Cirkul\u00E4r variabel-/parameterreferens i ''{0}''."},
-
- /*
- * Note to translators: The operator in an expresion with two operands was
- * not recognized.
- */
- {ErrorMsg.ILLEGAL_BINARY_OP_ERR,
- "Ok\u00E4nd operator f\u00F6r bin\u00E4rt uttryck."},
-
- /*
- * Note to translators: This message is produced if a reference to a
- * function has too many or too few arguments.
- */
- {ErrorMsg.ILLEGAL_ARG_ERR,
- "Otill\u00E5tna argument f\u00F6r funktionsanrop."},
-
- /*
- * Note to translators: "document()" is the name of function and must
- * not be translated. A node-set is a set of the nodes in the tree
- * representation of an XML document.
- */
- {ErrorMsg.DOCUMENT_ARG_ERR,
- "Andra argumentet f\u00F6r document()-funktion m\u00E5ste vara en nodupps\u00E4ttning."},
-
- /*
- * Note to translators: "<xsl:when>" and "<xsl:choose>" are keywords
- * and should not be translated. This message describes a syntax error
- * in the stylesheet.
- */
- {ErrorMsg.MISSING_WHEN_ERR,
- "Minst ett <xsl:when>-element kr\u00E4vs i <xsl:choose>."},
-
- /*
- * Note to translators: "<xsl:otherwise>" and "<xsl:choose>" are
- * keywords and should not be translated. This message describes a
- * syntax error in the stylesheet.
- */
- {ErrorMsg.MULTIPLE_OTHERWISE_ERR,
- "Endast ett <xsl:otherwise>-element \u00E4r till\u00E5tet i <xsl:choose>."},
-
- /*
- * Note to translators: "<xsl:otherwise>" and "<xsl:choose>" are
- * keywords and should not be translated. This message describes a
- * syntax error in the stylesheet.
- */
- {ErrorMsg.STRAY_OTHERWISE_ERR,
- "<xsl:otherwise> anv\u00E4nds endast inom <xsl:choose>."},
-
- /*
- * Note to translators: "<xsl:when>" and "<xsl:choose>" are keywords
- * and should not be translated. This message describes a syntax error
- * in the stylesheet.
- */
- {ErrorMsg.STRAY_WHEN_ERR,
- "<xsl:when> anv\u00E4nds endast inom <xsl:choose>."},
-
- /*
- * Note to translators: "<xsl:when>", "<xsl:otherwise>" and
- * "<xsl:choose>" are keywords and should not be translated. This
- * message describes a syntax error in the stylesheet.
- */
- {ErrorMsg.WHEN_ELEMENT_ERR,
- "Endast <xsl:when>- och <xsl:otherwise>-element \u00E4r till\u00E5tna i <xsl:choose>."},
-
- /*
- * Note to translators: "<xsl:attribute-set>" and "name" are keywords
- * that should not be translated.
- */
- {ErrorMsg.UNNAMED_ATTRIBSET_ERR,
- "<xsl:attribute-set> saknar 'name'-attribut."},
-
- /*
- * Note to translators: An element in the stylesheet contained an
- * element of a type that it was not permitted to contain.
- */
- {ErrorMsg.ILLEGAL_CHILD_ERR,
- "Otill\u00E5tet underordnat element."},
-
- /*
- * Note to translators: The stylesheet tried to create an element with
- * a name that was not a valid XML name. The substitution text contains
- * the name.
- */
- {ErrorMsg.ILLEGAL_ELEM_NAME_ERR,
- "Du kan inte anropa elementet ''{0}''"},
-
- /*
- * Note to translators: The stylesheet tried to create an attribute
- * with a name that was not a valid XML name. The substitution text
- * contains the name.
- */
- {ErrorMsg.ILLEGAL_ATTR_NAME_ERR,
- "Du kan inte anropa attributet ''{0}''"},
-
- /*
- * Note to translators: The children of the outermost element of a
- * stylesheet are referred to as top-level elements. No text should
- * occur within that outermost element unless it is within a top-level
- * element. This message indicates that that constraint was violated.
- * "<xsl:stylesheet>" is a keyword that should not be translated.
- */
- {ErrorMsg.ILLEGAL_TEXT_NODE_ERR,
- "Textdata utanf\u00F6r det \u00F6versta elementet <xsl:stylesheet>."},
-
- /*
- * Note to translators: JAXP is an acronym for the Java API for XML
- * Processing. This message indicates that the XML parser provided to
- * XSLTC to process the XML input document had a configuration problem.
- */
- {ErrorMsg.SAX_PARSER_CONFIG_ERR,
- "JAXP-parser har inte konfigurerats korrekt"},
-
- /*
- * Note to translators: The substitution text names the internal error
- * encountered.
- */
- {ErrorMsg.INTERNAL_ERR,
- "O\u00E5terkalleligt internt XSLTC-fel: ''{0}''"},
-
- /*
- * Note to translators: The stylesheet contained an element that was
- * not recognized as part of the XSL syntax. The substitution text
- * gives the element name.
- */
- {ErrorMsg.UNSUPPORTED_XSL_ERR,
- "XSL-elementet ''{0}'' st\u00F6ds inte."},
-
- /*
- * Note to translators: The stylesheet referred to an extension to the
- * XSL syntax and indicated that it was defined by XSLTC, but XSTLC does
- * not recognized the particular extension named. The substitution text
- * gives the extension name.
- */
- {ErrorMsg.UNSUPPORTED_EXT_ERR,
- "XSLTC-till\u00E4gget ''{0}'' \u00E4r ok\u00E4nt."},
-
- /*
- * Note to translators: The XML document given to XSLTC as a stylesheet
- * was not, in fact, a stylesheet. XSLTC is able to detect that in this
- * case because the outermost element in the stylesheet has to be
- * declared with respect to the XSL namespace URI, but no declaration
- * for that namespace was seen.
- */
- {ErrorMsg.MISSING_XSLT_URI_ERR,
- "Indatadokumentet \u00E4r ingen formatmall (XSL-namnrymden har inte deklarerats i rotelementet)."},
-
- /*
- * Note to translators: XSLTC could not find the stylesheet document
- * with the name specified by the substitution text.
- */
- {ErrorMsg.MISSING_XSLT_TARGET_ERR,
- "Hittade inte formatmallen ''{0}''."},
-
- /*
- * Note to translators: access to the stylesheet target is denied
- */
- {ErrorMsg.ACCESSING_XSLT_TARGET_ERR,
- "Kunde inte l\u00E4sa formatmallen ''{0}'', eftersom ''{1}''-\u00E5tkomst inte till\u00E5ts p\u00E5 grund av begr\u00E4nsning som anges av egenskapen accessExternalStylesheet."},
-
- /*
- * Note to translators: This message represents an internal error in
- * condition in XSLTC. The substitution text is the class name in XSLTC
- * that is missing some functionality.
- */
- {ErrorMsg.NOT_IMPLEMENTED_ERR,
- "Inte implementerad: ''{0}''."},
-
- /*
- * Note to translators: The XML document given to XSLTC as a stylesheet
- * was not, in fact, a stylesheet.
- */
- {ErrorMsg.NOT_STYLESHEET_ERR,
- "Indatadokumentet inneh\u00E5ller ingen XSL-formatmall."},
-
- /*
- * Note to translators: The element named in the substitution text was
- * encountered in the stylesheet but is not recognized.
- */
- {ErrorMsg.ELEMENT_PARSE_ERR,
- "Kunde inte tolka elementet ''{0}''"},
-
- /*
- * Note to translators: "use", "<key>", "node", "node-set", "string"
- * and "number" are keywords in this context and should not be
- * translated. This message indicates that the value of the "use"
- * attribute was not one of the permitted values.
- */
- {ErrorMsg.KEY_USE_ATTR_ERR,
- "use-attribut f\u00F6r <key> m\u00E5ste vara node, node-set, string eller number."},
-
- /*
- * Note to translators: An XML document can specify the version of the
- * XML specification to which it adheres. This message indicates that
- * the version specified for the output document was not valid.
- */
- {ErrorMsg.OUTPUT_VERSION_ERR,
- "XML-dokumentets utdataversion m\u00E5ste vara 1.0"},
-
- /*
- * Note to translators: The operator in a comparison operation was
- * not recognized.
- */
- {ErrorMsg.ILLEGAL_RELAT_OP_ERR,
- "Ok\u00E4nd operator f\u00F6r relationsuttryck"},
-
- /*
- * Note to translators: An attribute set defines as a set of XML
- * attributes that can be added to an element in the output XML document
- * as a group. This message is reported if the name specified was not
- * used to declare an attribute set. The substitution text is the name
- * that is in error.
- */
- {ErrorMsg.ATTRIBSET_UNDEF_ERR,
- "F\u00F6rs\u00F6ker anv\u00E4nda en icke-befintlig attributupps\u00E4ttning ''{0}''."},
-
- /*
- * Note to translators: The term "attribute value template" is a term
- * defined by XSLT which describes the value of an attribute that is
- * determined by an XPath expression. The message indicates that the
- * expression was syntactically incorrect; the substitution text
- * contains the expression that was in error.
- */
- {ErrorMsg.ATTR_VAL_TEMPLATE_ERR,
- "Kan inte tolka attributv\u00E4rdemallen ''{0}''."},
-
- /*
- * Note to translators: ???
- */
- {ErrorMsg.UNKNOWN_SIG_TYPE_ERR,
- "Ok\u00E4nd datatyp i signaturen f\u00F6r klassen ''{0}''."},
-
- /*
- * Note to translators: The substitution text refers to data types.
- * The message is displayed if a value in a particular context needs to
- * be converted to type {1}, but that's not possible for a value of
- * type {0}.
- */
- {ErrorMsg.DATA_CONVERSION_ERR,
- "Kan inte konvertera datatyp ''{0}'' till ''{1}''."},
-
- /*
- * Note to translators: "Templates" is a Java class name that should
- * not be translated.
- */
- {ErrorMsg.NO_TRANSLET_CLASS_ERR,
- "Templates inneh\u00E5ller inte n\u00E5gon giltig klassdefinition f\u00F6r translet."},
-
- /*
- * Note to translators: "Templates" is a Java class name that should
- * not be translated.
- */
- {ErrorMsg.NO_MAIN_TRANSLET_ERR,
- "Templates inneh\u00E5ller inte n\u00E5gon klass med namnet ''{0}''."},
-
- /*
- * Note to translators: The substitution text is the name of a class.
- */
- {ErrorMsg.TRANSLET_CLASS_ERR,
- "Kunde inte ladda translet-klassen ''{0}''."},
-
- {ErrorMsg.TRANSLET_OBJECT_ERR,
- "Translet-klassen har laddats, men kan inte skapa instans av translet."},
-
- /*
- * Note to translators: "ErrorListener" is a Java interface name that
- * should not be translated. The message indicates that the user tried
- * to set an ErrorListener object on object of the class named in the
- * substitution text with "null" Java value.
- */
- {ErrorMsg.ERROR_LISTENER_NULL_ERR,
- "F\u00F6rs\u00F6ker st\u00E4lla in ErrorListener f\u00F6r ''{0}'' p\u00E5 null"},
-
- /*
- * Note to translators: StreamSource, SAXSource and DOMSource are Java
- * interface names that should not be translated.
- */
- {ErrorMsg.JAXP_UNKNOWN_SOURCE_ERR,
- "Endast StreamSource, SAXSource och DOMSource st\u00F6ds av XSLTC"},
-
- /*
- * Note to translators: "Source" is a Java class name that should not
- * be translated. The substitution text is the name of Java method.
- */
- {ErrorMsg.JAXP_NO_SOURCE_ERR,
- "Source-objektet som \u00F6verf\u00F6rdes till ''{0}'' saknar inneh\u00E5ll."},
-
- /*
- * Note to translators: The message indicates that XSLTC failed to
- * compile the stylesheet into a translet (class file).
- */
- {ErrorMsg.JAXP_COMPILE_ERR,
- "Kunde inte kompilera formatmall"},
-
- /*
- * Note to translators: "TransformerFactory" is a class name. In this
- * context, an attribute is a property or setting of the
- * TransformerFactory object. The substitution text is the name of the
- * unrecognised attribute. The method used to retrieve the attribute is
- * "getAttribute", so it's not clear whether it would be best to
- * translate the term "attribute".
- */
- {ErrorMsg.JAXP_INVALID_ATTR_ERR,
- "TransformerFactory k\u00E4nner inte igen attributet ''{0}''."},
-
- {ErrorMsg.JAXP_INVALID_ATTR_VALUE_ERR,
- "Fel v\u00E4rde har angetts f\u00F6r attributet ''{0}''."},
-
- /*
- * Note to translators: "setResult()" and "startDocument()" are Java
- * method names that should not be translated.
- */
- {ErrorMsg.JAXP_SET_RESULT_ERR,
- "setResult() m\u00E5ste anropas f\u00F6re startDocument()."},
-
- /*
- * Note to translators: "Transformer" is a Java interface name that
- * should not be translated. A Transformer object should contained a
- * reference to a translet object in order to be used for
- * transformations; this message is produced if that requirement is not
- * met.
- */
- {ErrorMsg.JAXP_NO_TRANSLET_ERR,
- "Transformer saknar inkapslat objekt f\u00F6r translet."},
-
- /*
- * Note to translators: The XML document that results from a
- * transformation needs to be sent to an output handler object; this
- * message is produced if that requirement is not met.
- */
- {ErrorMsg.JAXP_NO_HANDLER_ERR,
- "Det finns ingen definierad utdatahanterare f\u00F6r transformeringsresultat."},
-
- /*
- * Note to translators: "Result" is a Java interface name in this
- * context. The substitution text is a method name.
- */
- {ErrorMsg.JAXP_NO_RESULT_ERR,
- "Result-objekt som \u00F6verf\u00F6rdes till ''{0}'' \u00E4r ogiltigt."},
-
- /*
- * Note to translators: "Transformer" is a Java interface name. The
- * user's program attempted to access an unrecognized property with the
- * name specified in the substitution text. The method used to retrieve
- * the property is "getOutputProperty", so it's not clear whether it
- * would be best to translate the term "property".
- */
- {ErrorMsg.JAXP_UNKNOWN_PROP_ERR,
- "F\u00F6rs\u00F6ker f\u00E5 \u00E5tkomst till ogiltig Transformer-egenskap, ''{0}''."},
-
- /*
- * Note to translators: SAX2DOM is the name of a Java class that should
- * not be translated. This is an adapter in the sense that it takes a
- * DOM object and converts it to something that uses the SAX API.
- */
- {ErrorMsg.SAX2DOM_ADAPTER_ERR,
- "Kunde inte skapa SAX2DOM-adapter: ''{0}''."},
-
- /*
- * Note to translators: "XSLTCSource.build()" is a Java method name.
- * "systemId" is an XML term that is short for "system identification".
- */
- {ErrorMsg.XSLTC_SOURCE_ERR,
- "XSLTCSource.build() anropades utan angivet systemId."},
-
- { ErrorMsg.ER_RESULT_NULL,
- "Result borde inte vara null"},
-
- /*
- * Note to translators: This message indicates that the value argument
- * of setParameter must be a valid Java Object.
- */
- {ErrorMsg.JAXP_INVALID_SET_PARAM_VALUE,
- "Parameterv\u00E4rdet f\u00F6r {0} m\u00E5ste vara giltigt Java-objekt"},
-
-
- {ErrorMsg.COMPILE_STDIN_ERR,
- "Alternativet -i m\u00E5ste anv\u00E4ndas med alternativet -o."},
-
-
- /*
- * Note to translators: This message contains usage information for a
- * means of invoking XSLTC from the command-line. The message is
- * formatted for presentation in English. The strings <output>,
- * <directory>, etc. indicate user-specified argument values, and can
- * be translated - the argument <package> refers to a Java package, so
- * it should be handled in the same way the term is handled for JDK
- * documentation.
- */
- {ErrorMsg.COMPILE_USAGE_STR,
- "SYNOPSIS\n java com.sun.org.apache.xalan.internal.xsltc.cmdline.Compile [-o <utdata>]\n [-d <katalog>] [-j <jarfile>] [-p <paket>]\n [-n] [-x] [-u] [-v] [-h] { <formatmall> | -i }\n\nALTERNATIV\n -o <utdata> tilldelar namnet <utdata> till genererad\n translet. Som standard tas namnet p\u00E5 translet\n fr\u00E5n namnet p\u00E5 <formatmallen>. Alternativet\n ignoreras vid kompilering av flera formatmallar.\n -d <katalog> anger en destinationskatalog f\u00F6r translet\n -j <jarfile> paketerar transletklasserna i en jar-fil med\n namnet <jarfile>\n -p <paket> anger ett paketnamnprefix f\u00F6r alla genererade\n transletklasser.\n -n aktiverar mallinfogning (ger ett b\u00E4ttre genomsnittligt\n standardbeteende).\n -x ger ytterligare fels\u00F6kningsmeddelanden\n -u tolkar argument i <formatmall> som URL:er\n -i tvingar kompilatorn att l\u00E4sa formatmallen fr\u00E5n stdin\n -v skriver ut kompilatorns versionsnummer\n -h skriver ut denna syntaxsats\n"},
-
- /*
- * Note to translators: This message contains usage information for a
- * means of invoking XSLTC from the command-line. The message is
- * formatted for presentation in English. The strings <jarfile>,
- * <document>, etc. indicate user-specified argument values, and can
- * be translated - the argument <class> refers to a Java class, so it
- * should be handled in the same way the term is handled for JDK
- * documentation.
- */
- {ErrorMsg.TRANSFORM_USAGE_STR,
- "SYNOPSIS \n java com.sun.org.apache.xalan.internal.xsltc.cmdline.Transform [-j <jarfile>]\n [-x] [-n <iterationer>] {-u <dokument_url> | <dokument>}\n <klass> [<param1>=<v\u00E4rde1> ...]\n\n anv\u00E4nder translet <klass> vid transformering av XML-dokument \n angivna som <dokument>. Translet-<klass> finns antingen i\n anv\u00E4ndarens CLASSPATH eller i valfritt angiven <jarfile>.\nALTERNATIV\n -j <jarfile> anger en jar-fil varifr\u00E5n translet laddas\n -x ger ytterligare fels\u00F6kningsmeddelanden\n -n <iterationer> k\u00F6r <iterations>-tider vid transformering och\n visar profileringsinformation\n -u <dokument_url> anger XML-indatadokument som URL\n"},
-
-
-
- /*
- * Note to translators: "<xsl:sort>", "<xsl:for-each>" and
- * "<xsl:apply-templates>" are keywords that should not be translated.
- * The message indicates that an xsl:sort element must be a child of
- * one of the other kinds of elements mentioned.
- */
- {ErrorMsg.STRAY_SORT_ERR,
- "<xsl:sort> kan anv\u00E4ndas endast i <xsl:for-each> eller <xsl:apply-templates>."},
-
- /*
- * Note to translators: The message indicates that the encoding
- * requested for the output document was on that requires support that
- * is not available from the Java Virtual Machine being used to execute
- * the program.
- */
- {ErrorMsg.UNSUPPORTED_ENCODING,
- "Utdatakodning ''{0}'' underst\u00F6ds inte i JVM."},
-
- /*
- * Note to translators: The message indicates that the XPath expression
- * named in the substitution text was not well formed syntactically.
- */
- {ErrorMsg.SYNTAX_ERR,
- "Syntaxfel i ''{0}''."},
-
- /*
- * Note to translators: The substitution text is the name of a Java
- * class. The term "constructor" here is the Java term. The message is
- * displayed if XSLTC could not find a constructor for the specified
- * class.
- */
- {ErrorMsg.CONSTRUCTOR_NOT_FOUND,
- "Hittar inte den externa konstruktorn ''{0}''."},
-
- /*
- * Note to translators: "static" is the Java keyword. The substitution
- * text is the name of a function. The first argument of that function
- * is not of the required type.
- */
- {ErrorMsg.NO_JAVA_FUNCT_THIS_REF,
- "Det f\u00F6rsta argumentet f\u00F6r den icke-statiska Java-funktionen ''{0}'' \u00E4r inte n\u00E5gon giltig objektreferens."},
-
- /*
- * Note to translators: An XPath expression was not of the type
- * required in a particular context. The substitution text is the
- * expression that was in error.
- */
- {ErrorMsg.TYPE_CHECK_ERR,
- "Fel vid kontroll av typ av uttrycket ''{0}''."},
-
- /*
- * Note to translators: An XPath expression was not of the type
- * required in a particular context. However, the location of the
- * problematic expression is unknown.
- */
- {ErrorMsg.TYPE_CHECK_UNK_LOC_ERR,
- "Fel vid kontroll av typ av ett uttryck p\u00E5 ok\u00E4nd plats."},
-
- /*
- * Note to translators: The substitution text is the name of a command-
- * line option that was not recognized.
- */
- {ErrorMsg.ILLEGAL_CMDLINE_OPTION_ERR,
- "Ogiltigt kommandoradsalternativ: ''{0}''."},
-
- /*
- * Note to translators: The substitution text is the name of a command-
- * line option.
- */
- {ErrorMsg.CMDLINE_OPT_MISSING_ARG_ERR,
- "Kommandoradsalternativet ''{0}'' saknar obligatoriskt argument."},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text contains two error
- * messages. The spacing before the second substitution text indents
- * it the same amount as the first in English.
- */
- {ErrorMsg.WARNING_PLUS_WRAPPED_MSG,
- "WARNING: ''{0}''\n :{1}"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text is an error message.
- */
- {ErrorMsg.WARNING_MSG,
- "WARNING: ''{0}''"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text contains two error
- * messages. The spacing before the second substitution text indents
- * it the same amount as the first in English.
- */
- {ErrorMsg.FATAL_ERR_PLUS_WRAPPED_MSG,
- "FATAL ERROR: ''{0}''\n :{1}"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text is an error message.
- */
- {ErrorMsg.FATAL_ERR_MSG,
- "FATAL ERROR: ''{0}''"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text contains two error
- * messages. The spacing before the second substitution text indents
- * it the same amount as the first in English.
- */
- {ErrorMsg.ERROR_PLUS_WRAPPED_MSG,
- "ERROR: ''{0}''\n :{1}"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text is an error message.
- */
- {ErrorMsg.ERROR_MSG,
- "ERROR: ''{0}''"},
-
- /*
- * Note to translators: The substitution text is the name of a class.
- */
- {ErrorMsg.TRANSFORM_WITH_TRANSLET_STR,
- "Transformering via translet ''{0}'' "},
-
- /*
- * Note to translators: The first substitution is the name of a class,
- * while the second substitution is the name of a jar file.
- */
- {ErrorMsg.TRANSFORM_WITH_JAR_STR,
- "Transformering via translet ''{0}'' fr\u00E5n jar-filen ''{1}''"},
-
- /*
- * Note to translators: "TransformerFactory" is the name of a Java
- * interface and must not be translated. The substitution text is
- * the name of the class that could not be instantiated.
- */
- {ErrorMsg.COULD_NOT_CREATE_TRANS_FACT,
- "Kunde inte skapa en instans av TransformerFactory-klassen ''{0}''."},
-
- /*
- * Note to translators: This message is produced when the user
- * specified a name for the translet class that contains characters
- * that are not permitted in a Java class name. The substitution
- * text "{0}" specifies the name the user requested, while "{1}"
- * specifies the name the processor used instead.
- */
- {ErrorMsg.TRANSLET_NAME_JAVA_CONFLICT,
- "''{0}'' kunde inte anv\u00E4ndas som namn p\u00E5 transletklassen eftersom det inneh\u00E5ller otill\u00E5tna tecken f\u00F6r Java-klassnamn. Namnet ''{1}'' anv\u00E4ndes ist\u00E4llet."},
-
- /*
- * Note to translators: The following message is used as a header.
- * All the error messages are collected together and displayed beneath
- * this message.
- */
- {ErrorMsg.COMPILER_ERROR_KEY,
- "Kompileringsfel:"},
-
- /*
- * Note to translators: The following message is used as a header.
- * All the warning messages are collected together and displayed
- * beneath this message.
- */
- {ErrorMsg.COMPILER_WARNING_KEY,
- "Kompileringsvarningar:"},
-
- /*
- * Note to translators: The following message is used as a header.
- * All the error messages that are produced when the stylesheet is
- * applied to an input document are collected together and displayed
- * beneath this message. A 'translet' is the compiled form of a
- * stylesheet (see above).
- */
- {ErrorMsg.RUNTIME_ERROR_KEY,
- "Transletfel:"},
-
- /*
- * Note to translators: An attribute whose value is constrained to
- * be a "QName" or a list of "QNames" had a value that was incorrect.
- * 'QName' is an XML syntactic term that must not be translated. The
- * substitution text contains the actual value of the attribute.
- */
- {ErrorMsg.INVALID_QNAME_ERR,
- "Ett attribut vars v\u00E4rde m\u00E5ste vara ett QName eller en blankteckenavgr\u00E4nsad lista med QNames hade v\u00E4rdet ''{0}''"},
-
- /*
- * Note to translators: An attribute whose value is required to
- * be an "NCName".
- * 'NCName' is an XML syntactic term that must not be translated. The
- * substitution text contains the actual value of the attribute.
- */
- {ErrorMsg.INVALID_NCNAME_ERR,
- "Ett attribut vars v\u00E4rde m\u00E5ste vara ett NCName hade v\u00E4rdet ''{0}''"},
-
- /*
- * Note to translators: An attribute with an incorrect value was
- * encountered. The permitted value is one of the literal values
- * "xml", "html" or "text"; it is also permitted to have the form of
- * a QName that is not also an NCName. The terms "method",
- * "xsl:output", "xml", "html" and "text" are keywords that must not
- * be translated. The term "qname-but-not-ncname" is an XML syntactic
- * term. The substitution text contains the actual value of the
- * attribute.
- */
- {ErrorMsg.INVALID_METHOD_IN_OUTPUT,
- "Metodattributet f\u00F6r ett <xsl:output>-element hade v\u00E4rdet ''{0}''. Endast n\u00E5got av f\u00F6ljande v\u00E4rden kan anv\u00E4ndas: ''xml'', ''html'', ''text'' eller qname-but-not-ncname i XML"},
-
- {ErrorMsg.JAXP_GET_FEATURE_NULL_NAME,
- "Funktionsnamnet kan inte vara null i TransformerFactory.getFeature(namn p\u00E5 str\u00E4ng)."},
-
- {ErrorMsg.JAXP_SET_FEATURE_NULL_NAME,
- "Funktionsnamnet kan inte vara null i TransformerFactory.setFeature(namn p\u00E5 str\u00E4ng, booleskt v\u00E4rde)."},
-
- {ErrorMsg.JAXP_UNSUPPORTED_FEATURE,
- "Kan inte st\u00E4lla in funktionen ''{0}'' i denna TransformerFactory."},
-
- {ErrorMsg.JAXP_SECUREPROCESSING_FEATURE,
- "FEATURE_SECURE_PROCESSING: Funktionen kan inte anges till false om s\u00E4kerhetshanteraren anv\u00E4nds."},
-
- /*
- * Note to translators: This message describes an internal error in the
- * processor. The term "byte code" is a Java technical term for the
- * executable code in a Java method, and "try-catch-finally block"
- * refers to the Java keywords with those names. "Outlined" is a
- * technical term internal to XSLTC and should not be translated.
- */
- {ErrorMsg.OUTLINE_ERR_TRY_CATCH,
- "Internt XSLTC-fel: den genererade bytekoden inneh\u00E5ller ett try-catch-finally-block och kan inte g\u00F6ras till en disposition."},
-
- /*
- * Note to translators: This message describes an internal error in the
- * processor. The terms "OutlineableChunkStart" and
- * "OutlineableChunkEnd" are the names of classes internal to XSLTC and
- * should not be translated. The message indicates that for every
- * "start" there must be a corresponding "end", and vice versa, and
- * that if one of a pair of "start" and "end" appears between another
- * pair of corresponding "start" and "end", then the other half of the
- * pair must also be between that same enclosing pair.
- */
- {ErrorMsg.OUTLINE_ERR_UNBALANCED_MARKERS,
- "Internt XSLTC-fel: mark\u00F6rerna OutlineableChunkStart och OutlineableChunkEnd m\u00E5ste vara balanserade och korrekt kapslade."},
-
- /*
- * Note to translators: This message describes an internal error in the
- * processor. The term "byte code" is a Java technical term for the
- * executable code in a Java method. The "method" that is being
- * referred to is a Java method in a translet that XSLTC is generating
- * in processing a stylesheet. The "instruction" that is being
- * referred to is one of the instrutions in the Java byte code in that
- * method. "Outlined" is a technical term internal to XSLTC and
- * should not be translated.
- */
- {ErrorMsg.OUTLINE_ERR_DELETED_TARGET,
- "Internt XSLTC-fel: originalmetoden refererar fortfarande till en instruktion som var en del av ett bytekodsblock som gjordes till en disposition."
- },
-
-
- /*
- * Note to translators: This message describes an internal error in the
- * processor. The "method" that is being referred to is a Java method
- * in a translet that XSLTC is generating.
- *
- */
- {ErrorMsg.OUTLINE_ERR_METHOD_TOO_BIG,
- "Internt XSLTC-fel: en metod i transleten \u00F6verstiger Java Virtual Machines l\u00E4ngdbegr\u00E4nsning f\u00F6r en metod p\u00E5 64 kilobytes. Det h\u00E4r orsakas vanligen av mycket stora mallar i en formatmall. F\u00F6rs\u00F6k att omstrukturera formatmallen att anv\u00E4nda mindre mallar."
- },
-
- {ErrorMsg.DESERIALIZE_TRANSLET_ERR, "N\u00E4r Java-s\u00E4kerheten \u00E4r aktiverad \u00E4r st\u00F6det f\u00F6r avserialisering av TemplatesImpl avaktiverat. Du kan \u00E5sidos\u00E4tta det h\u00E4r genom att st\u00E4lla in systemegenskapen jdk.xml.enableTemplatesImplDeserialization till sant."}
-
- };
-
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_zh_CN.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_zh_CN.java
deleted file mode 100644
index cc758e9..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_zh_CN.java
+++ /dev/null
@@ -1,974 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-
-import java.util.ListResourceBundle;
-
-/**
- * @author Morten Jorgensen
- */
-public class ErrorMessages_zh_CN extends ListResourceBundle {
-
-/*
- * XSLTC compile-time error messages.
- *
- * General notes to translators and definitions:
- *
- * 1) XSLTC is the name of the product. It is an acronym for "XSLT Compiler".
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An axis is a particular "dimension" in a tree representation of an XML
- * document; the nodes in the tree are divided along different axes.
- * Traversing the "child" axis, for instance, means that the program
- * would visit each child of a particular node; traversing the "descendant"
- * axis means that the program would visit the child nodes of a particular
- * node, their children, and so on until the leaf nodes of the tree are
- * reached.
- *
- * 5) An iterator is an object that traverses nodes in a tree along a
- * particular axis, one at a time.
- *
- * 6) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 7) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 8) DOM is an acronym for Document Object Model. It is a tree
- * representation of an XML document.
- *
- * SAX is an acronym for the Simple API for XML processing. It is an API
- * used inform an XML processor (in this case XSLTC) of the structure and
- * content of an XML document.
- *
- * Input to the stylesheet processor can come from an XML parser in the
- * form of a DOM tree or through the SAX API.
- *
- * 9) DTD is a document type declaration. It is a way of specifying the
- * grammar for an XML file, the names and types of elements, attributes,
- * etc.
- *
- * 10) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- * 11) Translet is an invented term that refers to the class file that contains
- * the compiled form of a stylesheet.
- */
-
- // These message should be read from a locale-specific resource bundle
- /** Get the lookup table for error messages.
- *
- * @return The message lookup table.
- */
- public Object[][] getContents()
- {
- return new Object[][] {
- {ErrorMsg.MULTIPLE_STYLESHEET_ERR,
- "\u540C\u4E00\u6587\u4EF6\u4E2D\u5B9A\u4E49\u4E86\u591A\u4E2A\u6837\u5F0F\u8868\u3002"},
-
- /*
- * Note to translators: The substitution text is the name of a
- * template. The same name was used on two different templates in the
- * same stylesheet.
- */
- {ErrorMsg.TEMPLATE_REDEF_ERR,
- "\u5DF2\u5728\u6B64\u6837\u5F0F\u8868\u4E2D\u5B9A\u4E49\u6A21\u677F ''{0}''\u3002"},
-
-
- /*
- * Note to translators: The substitution text is the name of a
- * template. A reference to the template name was encountered, but the
- * template is undefined.
- */
- {ErrorMsg.TEMPLATE_UNDEF_ERR,
- "\u672A\u5728\u6B64\u6837\u5F0F\u8868\u4E2D\u5B9A\u4E49\u6A21\u677F ''{0}''\u3002"},
-
- /*
- * Note to translators: The substitution text is the name of a variable
- * that was defined more than once.
- */
- {ErrorMsg.VARIABLE_REDEF_ERR,
- "\u540C\u4E00\u4F5C\u7528\u57DF\u4E2D\u591A\u6B21\u5B9A\u4E49\u4E86\u53D8\u91CF ''{0}''\u3002"},
-
- /*
- * Note to translators: The substitution text is the name of a variable
- * or parameter. A reference to the variable or parameter was found,
- * but it was never defined.
- */
- {ErrorMsg.VARIABLE_UNDEF_ERR,
- "\u672A\u5B9A\u4E49\u53D8\u91CF\u6216\u53C2\u6570 ''{0}''\u3002"},
-
- /*
- * Note to translators: The word "class" here refers to a Java class.
- * Processing the stylesheet required a class to be loaded, but it could
- * not be found. The substitution text is the name of the class.
- */
- {ErrorMsg.CLASS_NOT_FOUND_ERR,
- "\u627E\u4E0D\u5230\u7C7B ''{0}''\u3002"},
-
- /*
- * Note to translators: The word "method" here refers to a Java method.
- * Processing the stylesheet required a reference to the method named by
- * the substitution text, but it could not be found. "public" is the
- * Java keyword.
- */
- {ErrorMsg.METHOD_NOT_FOUND_ERR,
- "\u627E\u4E0D\u5230\u5916\u90E8\u65B9\u6CD5 ''{0}'' (\u5FC5\u987B\u4E3A public)\u3002"},
-
- /*
- * Note to translators: The word "method" here refers to a Java method.
- * Processing the stylesheet required a reference to the method named by
- * the substitution text, but no method with the required types of
- * arguments or return type could be found.
- */
- {ErrorMsg.ARGUMENT_CONVERSION_ERR,
- "\u65E0\u6CD5\u5728\u8C03\u7528\u65B9\u6CD5 ''{0}'' \u65F6\u8F6C\u6362\u53C2\u6570/\u8FD4\u56DE\u7C7B\u578B"},
-
- /*
- * Note to translators: The file or URI named in the substitution text
- * is missing.
- */
- {ErrorMsg.FILE_NOT_FOUND_ERR,
- "\u627E\u4E0D\u5230\u6587\u4EF6\u6216 URI ''{0}''\u3002"},
-
- /*
- * Note to translators: This message is displayed when the URI
- * mentioned in the substitution text is not well-formed syntactically.
- */
- {ErrorMsg.INVALID_URI_ERR,
- "URI ''{0}'' \u65E0\u6548\u3002"},
-
- /*
- * Note to translators: The file or URI named in the substitution text
- * exists but could not be opened.
- */
- {ErrorMsg.FILE_ACCESS_ERR,
- "\u65E0\u6CD5\u6253\u5F00\u6587\u4EF6\u6216 URI ''{0}''\u3002"},
-
- /*
- * Note to translators: <xsl:stylesheet> and <xsl:transform> are
- * keywords that should not be translated.
- */
- {ErrorMsg.MISSING_ROOT_ERR,
- "\u9700\u8981 <xsl:stylesheet> \u6216 <xsl:transform> \u5143\u7D20\u3002"},
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- {ErrorMsg.NAMESPACE_UNDEF_ERR,
- "\u672A\u58F0\u660E\u540D\u79F0\u7A7A\u95F4\u524D\u7F00 ''{0}''\u3002"},
-
- /*
- * Note to translators: The Java function named in the stylesheet could
- * not be found.
- */
- {ErrorMsg.FUNCTION_RESOLVE_ERR,
- "\u65E0\u6CD5\u89E3\u6790\u5BF9\u51FD\u6570 ''{0}'' \u7684\u8C03\u7528\u3002"},
-
- /*
- * Note to translators: The substitution text is the name of a
- * function. A literal string here means a constant string value.
- */
- {ErrorMsg.NEED_LITERAL_ERR,
- "''{0}'' \u7684\u53C2\u6570\u5FC5\u987B\u662F\u6587\u5B57\u5B57\u7B26\u4E32\u3002"},
-
- /*
- * Note to translators: This message indicates there was a syntactic
- * error in the form of an XPath expression. The substitution text is
- * the expression.
- */
- {ErrorMsg.XPATH_PARSER_ERR,
- "\u89E3\u6790 XPath \u8868\u8FBE\u5F0F ''{0}'' \u65F6\u51FA\u9519\u3002"},
-
- /*
- * Note to translators: An element in the stylesheet requires a
- * particular attribute named by the substitution text, but that
- * attribute was not specified in the stylesheet.
- */
- {ErrorMsg.REQUIRED_ATTR_ERR,
- "\u7F3A\u5C11\u6240\u9700\u5C5E\u6027 ''{0}''\u3002"},
-
- /*
- * Note to translators: This message indicates that a character not
- * permitted in an XPath expression was encountered. The substitution
- * text is the offending character.
- */
- {ErrorMsg.ILLEGAL_CHAR_ERR,
- "XPath \u8868\u8FBE\u5F0F\u4E2D\u7684\u5B57\u7B26 ''{0}'' \u975E\u6CD5\u3002"},
-
- /*
- * Note to translators: A processing instruction is a mark-up item in
- * an XML document that request some behaviour of an XML processor. The
- * form of the name of was invalid in this case, and the substitution
- * text is the name.
- */
- {ErrorMsg.ILLEGAL_PI_ERR,
- "processing instruction \u7684\u540D\u79F0 ''{0}'' \u975E\u6CD5\u3002"},
-
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- {ErrorMsg.STRAY_ATTRIBUTE_ERR,
- "\u5C5E\u6027 ''{0}'' \u5728\u5143\u7D20\u5916\u90E8\u3002"},
-
- /*
- * Note to translators: An attribute that wasn't recognized was
- * specified on an element in the stylesheet. The attribute is named
- * by the substitution
- * text.
- */
- {ErrorMsg.ILLEGAL_ATTRIBUTE_ERR,
- "\u5C5E\u6027 ''{0}'' \u975E\u6CD5\u3002"},
-
- /*
- * Note to translators: "import" and "include" are keywords that should
- * not be translated. This messages indicates that the stylesheet
- * named in the substitution text imported or included itself either
- * directly or indirectly.
- */
- {ErrorMsg.CIRCULAR_INCLUDE_ERR,
- "\u5FAA\u73AF import/include\u3002\u5DF2\u52A0\u8F7D\u6837\u5F0F\u8868 ''{0}''\u3002"},
-
- /*
- * Note to translators: A result-tree fragment is a portion of a
- * resulting XML document represented as a tree. "<xsl:sort>" is a
- * keyword and should not be translated.
- */
- {ErrorMsg.RESULT_TREE_SORT_ERR,
- "\u65E0\u6CD5\u5BF9\u7ED3\u679C\u6811\u7247\u6BB5\u6392\u5E8F (\u5FFD\u7565 <xsl:sort> \u5143\u7D20)\u3002\u5FC5\u987B\u5728\u521B\u5EFA\u7ED3\u679C\u6811\u65F6\u5BF9\u8282\u70B9\u8FDB\u884C\u6392\u5E8F\u3002"},
-
- /*
- * Note to translators: A name can be given to a particular style to be
- * used to format decimal values. The substitution text gives the name
- * of such a style for which more than one declaration was encountered.
- */
- {ErrorMsg.SYMBOLS_REDEF_ERR,
- "\u5DF2\u5B9A\u4E49\u5341\u8FDB\u5236\u683C\u5F0F ''{0}''\u3002"},
-
- /*
- * Note to translators: The stylesheet version named in the
- * substitution text is not supported.
- */
- {ErrorMsg.XSL_VERSION_ERR,
- "XSLTC \u4E0D\u652F\u6301 XSL \u7248\u672C ''{0}''\u3002"},
-
- /*
- * Note to translators: The definitions of one or more variables or
- * parameters depend on one another.
- */
- {ErrorMsg.CIRCULAR_VARIABLE_ERR,
- "''{0}'' \u4E2D\u5B58\u5728\u5FAA\u73AF\u53D8\u91CF/\u53C2\u6570\u5F15\u7528\u3002"},
-
- /*
- * Note to translators: The operator in an expresion with two operands was
- * not recognized.
- */
- {ErrorMsg.ILLEGAL_BINARY_OP_ERR,
- "\u4E8C\u8FDB\u5236\u8868\u8FBE\u5F0F\u7684\u8FD0\u7B97\u7B26\u672A\u77E5\u3002"},
-
- /*
- * Note to translators: This message is produced if a reference to a
- * function has too many or too few arguments.
- */
- {ErrorMsg.ILLEGAL_ARG_ERR,
- "\u51FD\u6570\u8C03\u7528\u7684\u53C2\u6570\u975E\u6CD5\u3002"},
-
- /*
- * Note to translators: "document()" is the name of function and must
- * not be translated. A node-set is a set of the nodes in the tree
- * representation of an XML document.
- */
- {ErrorMsg.DOCUMENT_ARG_ERR,
- "document() \u51FD\u6570\u7684\u7B2C\u4E8C\u4E2A\u53C2\u6570\u5FC5\u987B\u662F\u8282\u70B9\u96C6\u3002"},
-
- /*
- * Note to translators: "<xsl:when>" and "<xsl:choose>" are keywords
- * and should not be translated. This message describes a syntax error
- * in the stylesheet.
- */
- {ErrorMsg.MISSING_WHEN_ERR,
- "<xsl:choose> \u4E2D\u81F3\u5C11\u9700\u8981\u4E00\u4E2A <xsl:when> \u5143\u7D20\u3002"},
-
- /*
- * Note to translators: "<xsl:otherwise>" and "<xsl:choose>" are
- * keywords and should not be translated. This message describes a
- * syntax error in the stylesheet.
- */
- {ErrorMsg.MULTIPLE_OTHERWISE_ERR,
- "<xsl:choose> \u4E2D\u4EC5\u5141\u8BB8\u4F7F\u7528\u4E00\u4E2A <xsl:otherwise> \u5143\u7D20\u3002"},
-
- /*
- * Note to translators: "<xsl:otherwise>" and "<xsl:choose>" are
- * keywords and should not be translated. This message describes a
- * syntax error in the stylesheet.
- */
- {ErrorMsg.STRAY_OTHERWISE_ERR,
- "<xsl:otherwise> \u53EA\u80FD\u5728 <xsl:choose> \u4E2D\u4F7F\u7528\u3002"},
-
- /*
- * Note to translators: "<xsl:when>" and "<xsl:choose>" are keywords
- * and should not be translated. This message describes a syntax error
- * in the stylesheet.
- */
- {ErrorMsg.STRAY_WHEN_ERR,
- "<xsl:when> \u53EA\u80FD\u5728 <xsl:choose> \u4E2D\u4F7F\u7528\u3002"},
-
- /*
- * Note to translators: "<xsl:when>", "<xsl:otherwise>" and
- * "<xsl:choose>" are keywords and should not be translated. This
- * message describes a syntax error in the stylesheet.
- */
- {ErrorMsg.WHEN_ELEMENT_ERR,
- "<xsl:choose> \u4E2D\u4EC5\u5141\u8BB8\u4F7F\u7528 <xsl:when> \u548C <xsl:otherwise> \u5143\u7D20\u3002"},
-
- /*
- * Note to translators: "<xsl:attribute-set>" and "name" are keywords
- * that should not be translated.
- */
- {ErrorMsg.UNNAMED_ATTRIBSET_ERR,
- "<xsl:attribute-set> \u7F3A\u5C11 'name' \u5C5E\u6027\u3002"},
-
- /*
- * Note to translators: An element in the stylesheet contained an
- * element of a type that it was not permitted to contain.
- */
- {ErrorMsg.ILLEGAL_CHILD_ERR,
- "\u5B50\u5143\u7D20\u975E\u6CD5\u3002"},
-
- /*
- * Note to translators: The stylesheet tried to create an element with
- * a name that was not a valid XML name. The substitution text contains
- * the name.
- */
- {ErrorMsg.ILLEGAL_ELEM_NAME_ERR,
- "\u65E0\u6CD5\u8C03\u7528\u5143\u7D20 ''{0}''"},
-
- /*
- * Note to translators: The stylesheet tried to create an attribute
- * with a name that was not a valid XML name. The substitution text
- * contains the name.
- */
- {ErrorMsg.ILLEGAL_ATTR_NAME_ERR,
- "\u65E0\u6CD5\u8C03\u7528\u5C5E\u6027 ''{0}''"},
-
- /*
- * Note to translators: The children of the outermost element of a
- * stylesheet are referred to as top-level elements. No text should
- * occur within that outermost element unless it is within a top-level
- * element. This message indicates that that constraint was violated.
- * "<xsl:stylesheet>" is a keyword that should not be translated.
- */
- {ErrorMsg.ILLEGAL_TEXT_NODE_ERR,
- "\u6587\u672C\u6570\u636E\u4F4D\u4E8E\u9876\u7EA7 <xsl:stylesheet> \u5143\u7D20\u5916\u90E8\u3002"},
-
- /*
- * Note to translators: JAXP is an acronym for the Java API for XML
- * Processing. This message indicates that the XML parser provided to
- * XSLTC to process the XML input document had a configuration problem.
- */
- {ErrorMsg.SAX_PARSER_CONFIG_ERR,
- "JAXP \u89E3\u6790\u5668\u672A\u6B63\u786E\u914D\u7F6E"},
-
- /*
- * Note to translators: The substitution text names the internal error
- * encountered.
- */
- {ErrorMsg.INTERNAL_ERR,
- "\u4E0D\u53EF\u6062\u590D\u7684 XSLTC \u5185\u90E8\u9519\u8BEF: ''{0}''"},
-
- /*
- * Note to translators: The stylesheet contained an element that was
- * not recognized as part of the XSL syntax. The substitution text
- * gives the element name.
- */
- {ErrorMsg.UNSUPPORTED_XSL_ERR,
- "XSL \u5143\u7D20 ''{0}'' \u4E0D\u53D7\u652F\u6301\u3002"},
-
- /*
- * Note to translators: The stylesheet referred to an extension to the
- * XSL syntax and indicated that it was defined by XSLTC, but XSTLC does
- * not recognized the particular extension named. The substitution text
- * gives the extension name.
- */
- {ErrorMsg.UNSUPPORTED_EXT_ERR,
- "XSLTC \u6269\u5C55 ''{0}'' \u65E0\u6CD5\u8BC6\u522B\u3002"},
-
- /*
- * Note to translators: The XML document given to XSLTC as a stylesheet
- * was not, in fact, a stylesheet. XSLTC is able to detect that in this
- * case because the outermost element in the stylesheet has to be
- * declared with respect to the XSL namespace URI, but no declaration
- * for that namespace was seen.
- */
- {ErrorMsg.MISSING_XSLT_URI_ERR,
- "\u8F93\u5165\u6587\u6863\u4E0D\u662F\u6837\u5F0F\u8868 (\u672A\u5728\u6839\u5143\u7D20\u4E2D\u58F0\u660E XSL \u540D\u79F0\u7A7A\u95F4)\u3002"},
-
- /*
- * Note to translators: XSLTC could not find the stylesheet document
- * with the name specified by the substitution text.
- */
- {ErrorMsg.MISSING_XSLT_TARGET_ERR,
- "\u627E\u4E0D\u5230\u6837\u5F0F\u8868\u76EE\u6807 ''{0}''\u3002"},
-
- /*
- * Note to translators: access to the stylesheet target is denied
- */
- {ErrorMsg.ACCESSING_XSLT_TARGET_ERR,
- "\u7531\u4E8E accessExternalStylesheet \u5C5E\u6027\u8BBE\u7F6E\u7684\u9650\u5236\u800C\u4E0D\u5141\u8BB8 ''{1}'' \u8BBF\u95EE, \u56E0\u6B64\u65E0\u6CD5\u8BFB\u53D6\u6837\u5F0F\u8868\u76EE\u6807 ''{0}''\u3002"},
-
- /*
- * Note to translators: This message represents an internal error in
- * condition in XSLTC. The substitution text is the class name in XSLTC
- * that is missing some functionality.
- */
- {ErrorMsg.NOT_IMPLEMENTED_ERR,
- "\u672A\u5B9E\u73B0: ''{0}''\u3002"},
-
- /*
- * Note to translators: The XML document given to XSLTC as a stylesheet
- * was not, in fact, a stylesheet.
- */
- {ErrorMsg.NOT_STYLESHEET_ERR,
- "\u8F93\u5165\u6587\u6863\u4E0D\u5305\u542B XSL \u6837\u5F0F\u8868\u3002"},
-
- /*
- * Note to translators: The element named in the substitution text was
- * encountered in the stylesheet but is not recognized.
- */
- {ErrorMsg.ELEMENT_PARSE_ERR,
- "\u65E0\u6CD5\u89E3\u6790\u5143\u7D20 ''{0}''"},
-
- /*
- * Note to translators: "use", "<key>", "node", "node-set", "string"
- * and "number" are keywords in this context and should not be
- * translated. This message indicates that the value of the "use"
- * attribute was not one of the permitted values.
- */
- {ErrorMsg.KEY_USE_ATTR_ERR,
- "<key> \u7684 use \u5C5E\u6027\u5FC5\u987B\u662F node, node-set, string \u6216 number\u3002"},
-
- /*
- * Note to translators: An XML document can specify the version of the
- * XML specification to which it adheres. This message indicates that
- * the version specified for the output document was not valid.
- */
- {ErrorMsg.OUTPUT_VERSION_ERR,
- "\u8F93\u51FA XML \u6587\u6863\u7248\u672C\u5E94\u4E3A 1.0"},
-
- /*
- * Note to translators: The operator in a comparison operation was
- * not recognized.
- */
- {ErrorMsg.ILLEGAL_RELAT_OP_ERR,
- "\u5173\u7CFB\u8868\u8FBE\u5F0F\u7684\u8FD0\u7B97\u7B26\u672A\u77E5"},
-
- /*
- * Note to translators: An attribute set defines as a set of XML
- * attributes that can be added to an element in the output XML document
- * as a group. This message is reported if the name specified was not
- * used to declare an attribute set. The substitution text is the name
- * that is in error.
- */
- {ErrorMsg.ATTRIBSET_UNDEF_ERR,
- "\u5C1D\u8BD5\u4F7F\u7528\u4E0D\u5B58\u5728\u7684\u5C5E\u6027\u96C6 ''{0}''\u3002"},
-
- /*
- * Note to translators: The term "attribute value template" is a term
- * defined by XSLT which describes the value of an attribute that is
- * determined by an XPath expression. The message indicates that the
- * expression was syntactically incorrect; the substitution text
- * contains the expression that was in error.
- */
- {ErrorMsg.ATTR_VAL_TEMPLATE_ERR,
- "\u65E0\u6CD5\u89E3\u6790\u5C5E\u6027\u503C\u6A21\u677F ''{0}''\u3002"},
-
- /*
- * Note to translators: ???
- */
- {ErrorMsg.UNKNOWN_SIG_TYPE_ERR,
- "\u7C7B ''{0}'' \u7684\u7B7E\u540D\u4E2D\u7684\u6570\u636E\u7C7B\u578B\u672A\u77E5\u3002"},
-
- /*
- * Note to translators: The substitution text refers to data types.
- * The message is displayed if a value in a particular context needs to
- * be converted to type {1}, but that's not possible for a value of
- * type {0}.
- */
- {ErrorMsg.DATA_CONVERSION_ERR,
- "\u65E0\u6CD5\u5C06\u6570\u636E\u7C7B\u578B ''{0}'' \u8F6C\u6362\u4E3A ''{1}''\u3002"},
-
- /*
- * Note to translators: "Templates" is a Java class name that should
- * not be translated.
- */
- {ErrorMsg.NO_TRANSLET_CLASS_ERR,
- "\u6B64 Templates \u4E0D\u5305\u542B\u6709\u6548\u7684 translet \u7C7B\u5B9A\u4E49\u3002"},
-
- /*
- * Note to translators: "Templates" is a Java class name that should
- * not be translated.
- */
- {ErrorMsg.NO_MAIN_TRANSLET_ERR,
- "\u6B64 Templates \u4E0D\u5305\u542B\u540D\u4E3A ''{0}'' \u7684\u7C7B\u3002"},
-
- /*
- * Note to translators: The substitution text is the name of a class.
- */
- {ErrorMsg.TRANSLET_CLASS_ERR,
- "\u65E0\u6CD5\u52A0\u8F7D translet \u7C7B ''{0}''\u3002"},
-
- {ErrorMsg.TRANSLET_OBJECT_ERR,
- "\u5DF2\u52A0\u8F7D Translet \u7C7B, \u4F46\u65E0\u6CD5\u521B\u5EFA translet \u5B9E\u4F8B\u3002"},
-
- /*
- * Note to translators: "ErrorListener" is a Java interface name that
- * should not be translated. The message indicates that the user tried
- * to set an ErrorListener object on object of the class named in the
- * substitution text with "null" Java value.
- */
- {ErrorMsg.ERROR_LISTENER_NULL_ERR,
- "\u5C1D\u8BD5\u5C06 ''{0}'' \u7684 ErrorListener \u8BBE\u7F6E\u4E3A\u7A7A\u503C"},
-
- /*
- * Note to translators: StreamSource, SAXSource and DOMSource are Java
- * interface names that should not be translated.
- */
- {ErrorMsg.JAXP_UNKNOWN_SOURCE_ERR,
- "XSLTC \u4EC5\u652F\u6301 StreamSource, SAXSource \u548C DOMSource"},
-
- /*
- * Note to translators: "Source" is a Java class name that should not
- * be translated. The substitution text is the name of Java method.
- */
- {ErrorMsg.JAXP_NO_SOURCE_ERR,
- "\u4F20\u9012\u5230 ''{0}'' \u7684 Source \u5BF9\u8C61\u4E0D\u5305\u542B\u4EFB\u4F55\u5185\u5BB9\u3002"},
-
- /*
- * Note to translators: The message indicates that XSLTC failed to
- * compile the stylesheet into a translet (class file).
- */
- {ErrorMsg.JAXP_COMPILE_ERR,
- "\u65E0\u6CD5\u7F16\u8BD1\u6837\u5F0F\u8868"},
-
- /*
- * Note to translators: "TransformerFactory" is a class name. In this
- * context, an attribute is a property or setting of the
- * TransformerFactory object. The substitution text is the name of the
- * unrecognised attribute. The method used to retrieve the attribute is
- * "getAttribute", so it's not clear whether it would be best to
- * translate the term "attribute".
- */
- {ErrorMsg.JAXP_INVALID_ATTR_ERR,
- "TransformerFactory \u65E0\u6CD5\u8BC6\u522B\u5C5E\u6027 ''{0}''\u3002"},
-
- {ErrorMsg.JAXP_INVALID_ATTR_VALUE_ERR,
- "\u4E3A ''{0}'' \u5C5E\u6027\u6307\u5B9A\u7684\u503C\u4E0D\u6B63\u786E\u3002"},
-
- /*
- * Note to translators: "setResult()" and "startDocument()" are Java
- * method names that should not be translated.
- */
- {ErrorMsg.JAXP_SET_RESULT_ERR,
- "\u5FC5\u987B\u5148\u8C03\u7528 setResult(), \u518D\u8C03\u7528 startDocument()\u3002"},
-
- /*
- * Note to translators: "Transformer" is a Java interface name that
- * should not be translated. A Transformer object should contained a
- * reference to a translet object in order to be used for
- * transformations; this message is produced if that requirement is not
- * met.
- */
- {ErrorMsg.JAXP_NO_TRANSLET_ERR,
- "Transformer \u6CA1\u6709\u5185\u5D4C\u7684 translet \u5BF9\u8C61\u3002"},
-
- /*
- * Note to translators: The XML document that results from a
- * transformation needs to be sent to an output handler object; this
- * message is produced if that requirement is not met.
- */
- {ErrorMsg.JAXP_NO_HANDLER_ERR,
- "\u8F6C\u6362\u7ED3\u679C\u6CA1\u6709\u5B9A\u4E49\u7684\u8F93\u51FA\u5904\u7406\u7A0B\u5E8F\u3002"},
-
- /*
- * Note to translators: "Result" is a Java interface name in this
- * context. The substitution text is a method name.
- */
- {ErrorMsg.JAXP_NO_RESULT_ERR,
- "\u4F20\u9012\u5230 ''{0}'' \u7684 Result \u5BF9\u8C61\u65E0\u6548\u3002"},
-
- /*
- * Note to translators: "Transformer" is a Java interface name. The
- * user's program attempted to access an unrecognized property with the
- * name specified in the substitution text. The method used to retrieve
- * the property is "getOutputProperty", so it's not clear whether it
- * would be best to translate the term "property".
- */
- {ErrorMsg.JAXP_UNKNOWN_PROP_ERR,
- "\u5C1D\u8BD5\u8BBF\u95EE\u65E0\u6548\u7684 Transformer \u5C5E\u6027 ''{0}''\u3002"},
-
- /*
- * Note to translators: SAX2DOM is the name of a Java class that should
- * not be translated. This is an adapter in the sense that it takes a
- * DOM object and converts it to something that uses the SAX API.
- */
- {ErrorMsg.SAX2DOM_ADAPTER_ERR,
- "\u65E0\u6CD5\u521B\u5EFA SAX2DOM \u9002\u914D\u5668: ''{0}''\u3002"},
-
- /*
- * Note to translators: "XSLTCSource.build()" is a Java method name.
- * "systemId" is an XML term that is short for "system identification".
- */
- {ErrorMsg.XSLTC_SOURCE_ERR,
- "\u8C03\u7528 XSLTCSource.build() \u65F6\u672A\u8BBE\u7F6E systemId\u3002"},
-
- { ErrorMsg.ER_RESULT_NULL,
- "Result \u4E0D\u80FD\u4E3A\u7A7A\u503C"},
-
- /*
- * Note to translators: This message indicates that the value argument
- * of setParameter must be a valid Java Object.
- */
- {ErrorMsg.JAXP_INVALID_SET_PARAM_VALUE,
- "\u53C2\u6570 {0} \u7684\u503C\u5FC5\u987B\u662F\u6709\u6548 Java \u5BF9\u8C61"},
-
-
- {ErrorMsg.COMPILE_STDIN_ERR,
- "-i \u9009\u9879\u5FC5\u987B\u4E0E -o \u9009\u9879\u4E00\u8D77\u4F7F\u7528\u3002"},
-
-
- /*
- * Note to translators: This message contains usage information for a
- * means of invoking XSLTC from the command-line. The message is
- * formatted for presentation in English. The strings <output>,
- * <directory>, etc. indicate user-specified argument values, and can
- * be translated - the argument <package> refers to a Java package, so
- * it should be handled in the same way the term is handled for JDK
- * documentation.
- */
- {ErrorMsg.COMPILE_USAGE_STR,
- "\u63D0\u8981\n java com.sun.org.apache.xalan.internal.xsltc.cmdline.Compile [-o <\u8F93\u51FA>]\n [-d <\u76EE\u5F55>] [-j <jarfile>] [-p <\u7A0B\u5E8F\u5305>]\n [-n] [-x] [-u] [-v] [-h] { <\u6837\u5F0F\u8868> | -i }\n\n\u9009\u9879\n -o <\u8F93\u51FA> \u4E3A\u751F\u6210\u7684 translet \u5206\u914D\n \u540D\u79F0 <\u8F93\u51FA>\u3002\u9ED8\u8BA4\u60C5\u51B5\u4E0B, translet \u540D\u79F0\n \u6D3E\u751F\u81EA <\u6837\u5F0F\u8868> \u540D\u79F0\u3002\u5982\u679C\u8981\u7F16\u8BD1\u591A\u4E2A\u6837\u5F0F\u8868, \n \u5219\u5FFD\u7565\u6B64\u9009\u9879\u3002\n -d <\u76EE\u5F55> \u6307\u5B9A translet \u7684\u76EE\u6807\u76EE\u5F55\n -j <jarfile> \u5C06 translet \u7C7B\u6253\u5305\u5230\u5177\u6709 <jarfile>\n \u6307\u5B9A\u7684\u540D\u79F0\u7684 jar \u6587\u4EF6\u4E2D\n -p <\u7A0B\u5E8F\u5305> \u4E3A\u751F\u6210\u7684\u6240\u6709 translet \u7C7B\n \u6307\u5B9A\u7A0B\u5E8F\u5305\u540D\u79F0\u524D\u7F00\u3002\n -n \u542F\u7528\u6A21\u677F\u5185\u5D4C (\u9ED8\u8BA4\u884C\u4E3A\n \u901A\u5E38\u53EF\u63D0\u4F9B\u8F83\u597D\u7684\u6027\u80FD)\u3002\n -x \u542F\u7528\u5176\u4ED6\u8C03\u8BD5\u6D88\u606F\u8F93\u51FA\n -u \u5C06 <\u6837\u5F0F\u8868> \u53C2\u6570\u89E3\u91CA\u4E3A URL\n -i \u5F3A\u5236\u7F16\u8BD1\u5668\u4ECE stdin \u8BFB\u53D6\u6837\u5F0F\u8868\n -v \u8F93\u51FA\u7F16\u8BD1\u5668\u7684\u7248\u672C\n -h \u8F93\u51FA\u6B64\u7528\u6CD5\u8BED\u53E5\n"},
-
- /*
- * Note to translators: This message contains usage information for a
- * means of invoking XSLTC from the command-line. The message is
- * formatted for presentation in English. The strings <jarfile>,
- * <document>, etc. indicate user-specified argument values, and can
- * be translated - the argument <class> refers to a Java class, so it
- * should be handled in the same way the term is handled for JDK
- * documentation.
- */
- {ErrorMsg.TRANSFORM_USAGE_STR,
- "\u63D0\u8981\n java com.sun.org.apache.xalan.internal.xsltc.cmdline.Transform [-j <jarfile>]\n [-x] [-n <\u8FED\u4EE3\u6570>] {-u <document_url> | <\u6587\u6863>}\n <\u7C7B> [<param1>=<value1> ...]\n\n \u4F7F\u7528 translet <\u7C7B> \u8F6C\u6362\n <\u6587\u6863> \u6307\u5B9A\u7684 XML \u6587\u6863\u3002translet <\u7C7B> \u4F4D\u4E8E\n \u7528\u6237\u7684 CLASSPATH \u6216\u9009\u62E9\u6027\u6307\u5B9A\u7684 <jarfile> \u4E2D\u3002\n\u9009\u9879\n -j <jarfile> \u6307\u5B9A\u8981\u4ECE\u4E2D\u52A0\u8F7D translet \u7684 jarfile\n -x \u542F\u7528\u5176\u4ED6\u8C03\u8BD5\u6D88\u606F\u8F93\u51FA\n -n <\u8FED\u4EE3\u6570> \u8FD0\u884C <\u8FED\u4EE3\u6570> \u6B21\u8F6C\u6362\u5E76\n \u663E\u793A\u914D\u7F6E\u6587\u4EF6\u4FE1\u606F\n -u <document_url> \u4EE5 URL \u5F62\u5F0F\u6307\u5B9A XML \u8F93\u5165\u6587\u6863\n"},
-
-
-
- /*
- * Note to translators: "<xsl:sort>", "<xsl:for-each>" and
- * "<xsl:apply-templates>" are keywords that should not be translated.
- * The message indicates that an xsl:sort element must be a child of
- * one of the other kinds of elements mentioned.
- */
- {ErrorMsg.STRAY_SORT_ERR,
- "<xsl:sort> \u53EA\u80FD\u5728 <xsl:for-each> \u6216 <xsl:apply-templates> \u4E2D\u4F7F\u7528\u3002"},
-
- /*
- * Note to translators: The message indicates that the encoding
- * requested for the output document was on that requires support that
- * is not available from the Java Virtual Machine being used to execute
- * the program.
- */
- {ErrorMsg.UNSUPPORTED_ENCODING,
- "\u6B64 JVM \u4E2D\u4E0D\u652F\u6301\u8F93\u51FA\u7F16\u7801 ''{0}''\u3002"},
-
- /*
- * Note to translators: The message indicates that the XPath expression
- * named in the substitution text was not well formed syntactically.
- */
- {ErrorMsg.SYNTAX_ERR,
- "''{0}'' \u4E2D\u7684\u8BED\u6CD5\u9519\u8BEF\u3002"},
-
- /*
- * Note to translators: The substitution text is the name of a Java
- * class. The term "constructor" here is the Java term. The message is
- * displayed if XSLTC could not find a constructor for the specified
- * class.
- */
- {ErrorMsg.CONSTRUCTOR_NOT_FOUND,
- "\u627E\u4E0D\u5230\u5916\u90E8\u6784\u9020\u5668 ''{0}''\u3002"},
-
- /*
- * Note to translators: "static" is the Java keyword. The substitution
- * text is the name of a function. The first argument of that function
- * is not of the required type.
- */
- {ErrorMsg.NO_JAVA_FUNCT_THIS_REF,
- "\u975E static Java \u51FD\u6570 ''{0}'' \u7684\u7B2C\u4E00\u4E2A\u53C2\u6570\u4E0D\u662F\u6709\u6548\u7684\u5BF9\u8C61\u5F15\u7528\u3002"},
-
- /*
- * Note to translators: An XPath expression was not of the type
- * required in a particular context. The substitution text is the
- * expression that was in error.
- */
- {ErrorMsg.TYPE_CHECK_ERR,
- "\u68C0\u67E5\u8868\u8FBE\u5F0F ''{0}'' \u7684\u7C7B\u578B\u65F6\u51FA\u9519\u3002"},
-
- /*
- * Note to translators: An XPath expression was not of the type
- * required in a particular context. However, the location of the
- * problematic expression is unknown.
- */
- {ErrorMsg.TYPE_CHECK_UNK_LOC_ERR,
- "\u68C0\u67E5\u672A\u77E5\u4F4D\u7F6E\u7684\u8868\u8FBE\u5F0F\u7C7B\u578B\u65F6\u51FA\u9519\u3002"},
-
- /*
- * Note to translators: The substitution text is the name of a command-
- * line option that was not recognized.
- */
- {ErrorMsg.ILLEGAL_CMDLINE_OPTION_ERR,
- "\u547D\u4EE4\u884C\u9009\u9879 ''{0}'' \u65E0\u6548\u3002"},
-
- /*
- * Note to translators: The substitution text is the name of a command-
- * line option.
- */
- {ErrorMsg.CMDLINE_OPT_MISSING_ARG_ERR,
- "\u547D\u4EE4\u884C\u9009\u9879 ''{0}'' \u7F3A\u5C11\u6240\u9700\u53C2\u6570\u3002"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text contains two error
- * messages. The spacing before the second substitution text indents
- * it the same amount as the first in English.
- */
- {ErrorMsg.WARNING_PLUS_WRAPPED_MSG,
- "WARNING: ''{0}''\n :{1}"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text is an error message.
- */
- {ErrorMsg.WARNING_MSG,
- "WARNING: ''{0}''"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text contains two error
- * messages. The spacing before the second substitution text indents
- * it the same amount as the first in English.
- */
- {ErrorMsg.FATAL_ERR_PLUS_WRAPPED_MSG,
- "FATAL ERROR: ''{0}''\n :{1}"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text is an error message.
- */
- {ErrorMsg.FATAL_ERR_MSG,
- "FATAL ERROR: ''{0}''"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text contains two error
- * messages. The spacing before the second substitution text indents
- * it the same amount as the first in English.
- */
- {ErrorMsg.ERROR_PLUS_WRAPPED_MSG,
- "ERROR: ''{0}''\n :{1}"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text is an error message.
- */
- {ErrorMsg.ERROR_MSG,
- "ERROR: ''{0}''"},
-
- /*
- * Note to translators: The substitution text is the name of a class.
- */
- {ErrorMsg.TRANSFORM_WITH_TRANSLET_STR,
- "\u4F7F\u7528 translet ''{0}'' \u8FDB\u884C\u8F6C\u6362 "},
-
- /*
- * Note to translators: The first substitution is the name of a class,
- * while the second substitution is the name of a jar file.
- */
- {ErrorMsg.TRANSFORM_WITH_JAR_STR,
- "\u4F7F\u7528 translet ''{0}'' \u4ECE jar \u6587\u4EF6 ''{1}'' \u8FDB\u884C\u8F6C\u6362"},
-
- /*
- * Note to translators: "TransformerFactory" is the name of a Java
- * interface and must not be translated. The substitution text is
- * the name of the class that could not be instantiated.
- */
- {ErrorMsg.COULD_NOT_CREATE_TRANS_FACT,
- "\u65E0\u6CD5\u521B\u5EFA TransformerFactory \u7C7B ''{0}'' \u7684\u5B9E\u4F8B\u3002"},
-
- /*
- * Note to translators: This message is produced when the user
- * specified a name for the translet class that contains characters
- * that are not permitted in a Java class name. The substitution
- * text "{0}" specifies the name the user requested, while "{1}"
- * specifies the name the processor used instead.
- */
- {ErrorMsg.TRANSLET_NAME_JAVA_CONFLICT,
- "\u540D\u79F0 ''{0}'' \u5305\u542B\u4E0D\u5141\u8BB8\u5728 Java \u7C7B\u540D\u4E2D\u4F7F\u7528\u7684\u5B57\u7B26, \u56E0\u6B64\u65E0\u6CD5\u5C06\u6B64\u540D\u79F0\u7528\u4F5C translet \u7C7B\u7684\u540D\u79F0\u3002\u5DF2\u6539\u7528\u540D\u79F0 ''{1}''\u3002"},
-
- /*
- * Note to translators: The following message is used as a header.
- * All the error messages are collected together and displayed beneath
- * this message.
- */
- {ErrorMsg.COMPILER_ERROR_KEY,
- "\u7F16\u8BD1\u5668\u9519\u8BEF:"},
-
- /*
- * Note to translators: The following message is used as a header.
- * All the warning messages are collected together and displayed
- * beneath this message.
- */
- {ErrorMsg.COMPILER_WARNING_KEY,
- "\u7F16\u8BD1\u5668\u8B66\u544A:"},
-
- /*
- * Note to translators: The following message is used as a header.
- * All the error messages that are produced when the stylesheet is
- * applied to an input document are collected together and displayed
- * beneath this message. A 'translet' is the compiled form of a
- * stylesheet (see above).
- */
- {ErrorMsg.RUNTIME_ERROR_KEY,
- "Translet \u9519\u8BEF:"},
-
- /*
- * Note to translators: An attribute whose value is constrained to
- * be a "QName" or a list of "QNames" had a value that was incorrect.
- * 'QName' is an XML syntactic term that must not be translated. The
- * substitution text contains the actual value of the attribute.
- */
- {ErrorMsg.INVALID_QNAME_ERR,
- "\u5176\u503C\u5FC5\u987B\u4E3A QName \u6216\u7531\u7A7A\u683C\u5206\u9694\u7684 QName \u5217\u8868\u7684\u5C5E\u6027\u5177\u6709\u503C ''{0}''"},
-
- /*
- * Note to translators: An attribute whose value is required to
- * be an "NCName".
- * 'NCName' is an XML syntactic term that must not be translated. The
- * substitution text contains the actual value of the attribute.
- */
- {ErrorMsg.INVALID_NCNAME_ERR,
- "\u5176\u503C\u5FC5\u987B\u4E3A NCName \u7684\u5C5E\u6027\u5177\u6709\u503C ''{0}''"},
-
- /*
- * Note to translators: An attribute with an incorrect value was
- * encountered. The permitted value is one of the literal values
- * "xml", "html" or "text"; it is also permitted to have the form of
- * a QName that is not also an NCName. The terms "method",
- * "xsl:output", "xml", "html" and "text" are keywords that must not
- * be translated. The term "qname-but-not-ncname" is an XML syntactic
- * term. The substitution text contains the actual value of the
- * attribute.
- */
- {ErrorMsg.INVALID_METHOD_IN_OUTPUT,
- "<xsl:output> \u5143\u7D20\u7684 method \u5C5E\u6027\u5177\u6709\u503C ''{0}''\u3002\u8BE5\u503C\u5FC5\u987B\u662F ''xml'', ''html'', ''text'' \u6216 qname-but-not-ncname \u4E4B\u4E00"},
-
- {ErrorMsg.JAXP_GET_FEATURE_NULL_NAME,
- "TransformerFactory.getFeature(String name) \u4E2D\u7684\u529F\u80FD\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A\u503C\u3002"},
-
- {ErrorMsg.JAXP_SET_FEATURE_NULL_NAME,
- "TransformerFactory.setFeature(String name, boolean value) \u4E2D\u7684\u529F\u80FD\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A\u503C\u3002"},
-
- {ErrorMsg.JAXP_UNSUPPORTED_FEATURE,
- "\u65E0\u6CD5\u5BF9\u6B64 TransformerFactory \u8BBE\u7F6E\u529F\u80FD ''{0}''\u3002"},
-
- {ErrorMsg.JAXP_SECUREPROCESSING_FEATURE,
- "FEATURE_SECURE_PROCESSING: \u5B58\u5728 Security Manager \u65F6, \u65E0\u6CD5\u5C06\u6B64\u529F\u80FD\u8BBE\u7F6E\u4E3A\u201C\u5047\u201D\u3002"},
-
- /*
- * Note to translators: This message describes an internal error in the
- * processor. The term "byte code" is a Java technical term for the
- * executable code in a Java method, and "try-catch-finally block"
- * refers to the Java keywords with those names. "Outlined" is a
- * technical term internal to XSLTC and should not be translated.
- */
- {ErrorMsg.OUTLINE_ERR_TRY_CATCH,
- "\u5185\u90E8 XSLTC \u9519\u8BEF: \u751F\u6210\u7684\u5B57\u8282\u4EE3\u7801\u5305\u542B try-catch-finally \u5757, \u65E0\u6CD5\u8FDB\u884C Outlined\u3002"},
-
- /*
- * Note to translators: This message describes an internal error in the
- * processor. The terms "OutlineableChunkStart" and
- * "OutlineableChunkEnd" are the names of classes internal to XSLTC and
- * should not be translated. The message indicates that for every
- * "start" there must be a corresponding "end", and vice versa, and
- * that if one of a pair of "start" and "end" appears between another
- * pair of corresponding "start" and "end", then the other half of the
- * pair must also be between that same enclosing pair.
- */
- {ErrorMsg.OUTLINE_ERR_UNBALANCED_MARKERS,
- "\u5185\u90E8 XSLTC \u9519\u8BEF: OutlineableChunkStart \u548C OutlineableChunkEnd \u6807\u8BB0\u5FC5\u987B\u914D\u5BF9\u5E76\u4E14\u6B63\u786E\u5D4C\u5957\u3002"},
-
- /*
- * Note to translators: This message describes an internal error in the
- * processor. The term "byte code" is a Java technical term for the
- * executable code in a Java method. The "method" that is being
- * referred to is a Java method in a translet that XSLTC is generating
- * in processing a stylesheet. The "instruction" that is being
- * referred to is one of the instrutions in the Java byte code in that
- * method. "Outlined" is a technical term internal to XSLTC and
- * should not be translated.
- */
- {ErrorMsg.OUTLINE_ERR_DELETED_TARGET,
- "\u5185\u90E8 XSLTC \u9519\u8BEF: \u5C5E\u4E8E\u5DF2\u8FDB\u884C Outlined \u7684\u5B57\u8282\u4EE3\u7801\u5757\u7684\u6307\u4EE4\u5728\u539F\u59CB\u65B9\u6CD5\u4E2D\u4ECD\u88AB\u5F15\u7528\u3002"
- },
-
-
- /*
- * Note to translators: This message describes an internal error in the
- * processor. The "method" that is being referred to is a Java method
- * in a translet that XSLTC is generating.
- *
- */
- {ErrorMsg.OUTLINE_ERR_METHOD_TOO_BIG,
- "\u5185\u90E8 XSLTC \u9519\u8BEF: translet \u4E2D\u7684\u65B9\u6CD5\u8D85\u8FC7\u4E86 Java \u865A\u62DF\u673A\u7684\u65B9\u6CD5\u957F\u5EA6\u9650\u5236 64 KB\u3002\u8FD9\u901A\u5E38\u662F\u7531\u4E8E\u6837\u5F0F\u8868\u4E2D\u7684\u6A21\u677F\u975E\u5E38\u5927\u9020\u6210\u7684\u3002\u8BF7\u5C1D\u8BD5\u4F7F\u7528\u8F83\u5C0F\u7684\u6A21\u677F\u91CD\u65B0\u6784\u5EFA\u6837\u5F0F\u8868\u3002"
- },
-
- {ErrorMsg.DESERIALIZE_TRANSLET_ERR, "\u542F\u7528\u4E86 Java \u5B89\u5168\u65F6, \u5C06\u7981\u7528\u5BF9\u53CD\u5E8F\u5217\u5316 TemplatesImpl \u7684\u652F\u6301\u3002\u53EF\u4EE5\u901A\u8FC7\u5C06 jdk.xml.enableTemplatesImplDeserialization \u7CFB\u7EDF\u5C5E\u6027\u8BBE\u7F6E\u4E3A\u201C\u771F\u201D\u6765\u8986\u76D6\u6B64\u8BBE\u7F6E\u3002"}
-
- };
-
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_zh_TW.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_zh_TW.java
deleted file mode 100644
index 7cae67a..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_zh_TW.java
+++ /dev/null
@@ -1,974 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-
-import java.util.ListResourceBundle;
-
-/**
- * @author Morten Jorgensen
- */
-public class ErrorMessages_zh_TW extends ListResourceBundle {
-
-/*
- * XSLTC compile-time error messages.
- *
- * General notes to translators and definitions:
- *
- * 1) XSLTC is the name of the product. It is an acronym for "XSLT Compiler".
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An axis is a particular "dimension" in a tree representation of an XML
- * document; the nodes in the tree are divided along different axes.
- * Traversing the "child" axis, for instance, means that the program
- * would visit each child of a particular node; traversing the "descendant"
- * axis means that the program would visit the child nodes of a particular
- * node, their children, and so on until the leaf nodes of the tree are
- * reached.
- *
- * 5) An iterator is an object that traverses nodes in a tree along a
- * particular axis, one at a time.
- *
- * 6) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 7) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 8) DOM is an acronym for Document Object Model. It is a tree
- * representation of an XML document.
- *
- * SAX is an acronym for the Simple API for XML processing. It is an API
- * used inform an XML processor (in this case XSLTC) of the structure and
- * content of an XML document.
- *
- * Input to the stylesheet processor can come from an XML parser in the
- * form of a DOM tree or through the SAX API.
- *
- * 9) DTD is a document type declaration. It is a way of specifying the
- * grammar for an XML file, the names and types of elements, attributes,
- * etc.
- *
- * 10) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- * 11) Translet is an invented term that refers to the class file that contains
- * the compiled form of a stylesheet.
- */
-
- // These message should be read from a locale-specific resource bundle
- /** Get the lookup table for error messages.
- *
- * @return The message lookup table.
- */
- public Object[][] getContents()
- {
- return new Object[][] {
- {ErrorMsg.MULTIPLE_STYLESHEET_ERR,
- "\u76F8\u540C\u6A94\u6848\u4E2D\u5B9A\u7FA9\u4E86\u8D85\u904E\u4E00\u500B\u6A23\u5F0F\u8868\u3002"},
-
- /*
- * Note to translators: The substitution text is the name of a
- * template. The same name was used on two different templates in the
- * same stylesheet.
- */
- {ErrorMsg.TEMPLATE_REDEF_ERR,
- "\u6A23\u677F ''{0}'' \u5DF2\u7D93\u5B9A\u7FA9\u5728\u6B64\u6A23\u5F0F\u8868\u4E2D\u3002"},
-
-
- /*
- * Note to translators: The substitution text is the name of a
- * template. A reference to the template name was encountered, but the
- * template is undefined.
- */
- {ErrorMsg.TEMPLATE_UNDEF_ERR,
- "\u6A23\u677F ''{0}'' \u672A\u5B9A\u7FA9\u5728\u6B64\u6A23\u5F0F\u8868\u4E2D\u3002"},
-
- /*
- * Note to translators: The substitution text is the name of a variable
- * that was defined more than once.
- */
- {ErrorMsg.VARIABLE_REDEF_ERR,
- "\u8B8A\u6578 ''{0}'' \u5728\u76F8\u540C\u7BC4\u570D\u4E2D\u5B9A\u7FA9\u591A\u6B21\u3002"},
-
- /*
- * Note to translators: The substitution text is the name of a variable
- * or parameter. A reference to the variable or parameter was found,
- * but it was never defined.
- */
- {ErrorMsg.VARIABLE_UNDEF_ERR,
- "\u8B8A\u6578\u6216\u53C3\u6578 ''{0}'' \u672A\u5B9A\u7FA9\u3002"},
-
- /*
- * Note to translators: The word "class" here refers to a Java class.
- * Processing the stylesheet required a class to be loaded, but it could
- * not be found. The substitution text is the name of the class.
- */
- {ErrorMsg.CLASS_NOT_FOUND_ERR,
- "\u627E\u4E0D\u5230\u985E\u5225 ''{0}''\u3002"},
-
- /*
- * Note to translators: The word "method" here refers to a Java method.
- * Processing the stylesheet required a reference to the method named by
- * the substitution text, but it could not be found. "public" is the
- * Java keyword.
- */
- {ErrorMsg.METHOD_NOT_FOUND_ERR,
- "\u627E\u4E0D\u5230\u5916\u90E8\u65B9\u6CD5 ''{0}'' (\u5FC5\u9808\u70BA\u516C\u7528)\u3002"},
-
- /*
- * Note to translators: The word "method" here refers to a Java method.
- * Processing the stylesheet required a reference to the method named by
- * the substitution text, but no method with the required types of
- * arguments or return type could be found.
- */
- {ErrorMsg.ARGUMENT_CONVERSION_ERR,
- "\u7121\u6CD5\u8F49\u63DB\u547C\u53EB\u65B9\u6CD5 ''{0}'' \u4E2D\u7684\u5F15\u6578/\u50B3\u56DE\u985E\u578B"},
-
- /*
- * Note to translators: The file or URI named in the substitution text
- * is missing.
- */
- {ErrorMsg.FILE_NOT_FOUND_ERR,
- "\u627E\u4E0D\u5230\u6A94\u6848\u6216 URI ''{0}''\u3002"},
-
- /*
- * Note to translators: This message is displayed when the URI
- * mentioned in the substitution text is not well-formed syntactically.
- */
- {ErrorMsg.INVALID_URI_ERR,
- "\u7121\u6548\u7684 URI ''{0}''\u3002"},
-
- /*
- * Note to translators: The file or URI named in the substitution text
- * exists but could not be opened.
- */
- {ErrorMsg.FILE_ACCESS_ERR,
- "\u7121\u6CD5\u958B\u555F\u6A94\u6848\u6216 URI ''{0}''\u3002"},
-
- /*
- * Note to translators: <xsl:stylesheet> and <xsl:transform> are
- * keywords that should not be translated.
- */
- {ErrorMsg.MISSING_ROOT_ERR,
- "\u9810\u671F <xsl:stylesheet> \u6216 <xsl:transform> \u5143\u7D20\u3002"},
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- {ErrorMsg.NAMESPACE_UNDEF_ERR,
- "\u672A\u5BA3\u544A\u547D\u540D\u7A7A\u9593\u524D\u7F6E\u78BC ''{0}''\u3002"},
-
- /*
- * Note to translators: The Java function named in the stylesheet could
- * not be found.
- */
- {ErrorMsg.FUNCTION_RESOLVE_ERR,
- "\u7121\u6CD5\u89E3\u6790\u51FD\u6578 ''{0}'' \u7684\u547C\u53EB\u3002"},
-
- /*
- * Note to translators: The substitution text is the name of a
- * function. A literal string here means a constant string value.
- */
- {ErrorMsg.NEED_LITERAL_ERR,
- "''{0}'' \u7684\u5F15\u6578\u5FC5\u9808\u662F\u6587\u5B57\u5B57\u4E32\u3002"},
-
- /*
- * Note to translators: This message indicates there was a syntactic
- * error in the form of an XPath expression. The substitution text is
- * the expression.
- */
- {ErrorMsg.XPATH_PARSER_ERR,
- "\u5256\u6790 XPath \u8868\u793A\u5F0F ''{0}'' \u6642\u767C\u751F\u932F\u8AA4\u3002"},
-
- /*
- * Note to translators: An element in the stylesheet requires a
- * particular attribute named by the substitution text, but that
- * attribute was not specified in the stylesheet.
- */
- {ErrorMsg.REQUIRED_ATTR_ERR,
- "\u907A\u6F0F\u5FC5\u8981\u7684\u5C6C\u6027 ''{0}''\u3002"},
-
- /*
- * Note to translators: This message indicates that a character not
- * permitted in an XPath expression was encountered. The substitution
- * text is the offending character.
- */
- {ErrorMsg.ILLEGAL_CHAR_ERR,
- "XPath \u8868\u793A\u5F0F\u4E2D\u7121\u6548\u7684\u5B57\u5143 ''{0}''\u3002"},
-
- /*
- * Note to translators: A processing instruction is a mark-up item in
- * an XML document that request some behaviour of an XML processor. The
- * form of the name of was invalid in this case, and the substitution
- * text is the name.
- */
- {ErrorMsg.ILLEGAL_PI_ERR,
- "\u8655\u7406\u6307\u793A\u7684\u7121\u6548\u540D\u7A31 ''{0}''\u3002"},
-
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- {ErrorMsg.STRAY_ATTRIBUTE_ERR,
- "\u5C6C\u6027 ''{0}'' \u5728\u5143\u7D20\u4E4B\u5916\u3002"},
-
- /*
- * Note to translators: An attribute that wasn't recognized was
- * specified on an element in the stylesheet. The attribute is named
- * by the substitution
- * text.
- */
- {ErrorMsg.ILLEGAL_ATTRIBUTE_ERR,
- "\u7121\u6548\u7684\u5C6C\u6027 ''{0}''\u3002"},
-
- /*
- * Note to translators: "import" and "include" are keywords that should
- * not be translated. This messages indicates that the stylesheet
- * named in the substitution text imported or included itself either
- * directly or indirectly.
- */
- {ErrorMsg.CIRCULAR_INCLUDE_ERR,
- "\u5FAA\u74B0\u532F\u5165/\u5305\u542B\u3002\u5DF2\u7D93\u8F09\u5165\u6A23\u5F0F\u8868 ''{0}''\u3002"},
-
- /*
- * Note to translators: A result-tree fragment is a portion of a
- * resulting XML document represented as a tree. "<xsl:sort>" is a
- * keyword and should not be translated.
- */
- {ErrorMsg.RESULT_TREE_SORT_ERR,
- "\u7121\u6CD5\u6392\u5E8F Result-tree \u7247\u6BB5 (\u5FFD\u7565 <xsl:sort> \u5143\u7D20)\u3002\u5EFA\u7ACB\u7D50\u679C\u6A39\u72C0\u7D50\u69CB\u6642\uFF0C\u5FC5\u9808\u6392\u5E8F\u7BC0\u9EDE\u3002"},
-
- /*
- * Note to translators: A name can be given to a particular style to be
- * used to format decimal values. The substitution text gives the name
- * of such a style for which more than one declaration was encountered.
- */
- {ErrorMsg.SYMBOLS_REDEF_ERR,
- "\u5DF2\u7D93\u5B9A\u7FA9\u5341\u9032\u4F4D\u683C\u5F0F ''{0}''\u3002"},
-
- /*
- * Note to translators: The stylesheet version named in the
- * substitution text is not supported.
- */
- {ErrorMsg.XSL_VERSION_ERR,
- "XSLTC \u4E0D\u652F\u63F4 XSL \u7248\u672C ''{0}''\u3002"},
-
- /*
- * Note to translators: The definitions of one or more variables or
- * parameters depend on one another.
- */
- {ErrorMsg.CIRCULAR_VARIABLE_ERR,
- "\u5728 ''{0}'' \u4E2D\u6709\u5FAA\u74B0\u8B8A\u6578/\u53C3\u6578\u53C3\u7167\u3002"},
-
- /*
- * Note to translators: The operator in an expresion with two operands was
- * not recognized.
- */
- {ErrorMsg.ILLEGAL_BINARY_OP_ERR,
- "\u4E8C\u9032\u4F4D\u8868\u793A\u5F0F\u4E0D\u660E\u7684\u904B\u7B97\u5B50\u3002"},
-
- /*
- * Note to translators: This message is produced if a reference to a
- * function has too many or too few arguments.
- */
- {ErrorMsg.ILLEGAL_ARG_ERR,
- "\u51FD\u6578\u547C\u53EB\u7121\u6548\u7684\u5F15\u6578\u3002"},
-
- /*
- * Note to translators: "document()" is the name of function and must
- * not be translated. A node-set is a set of the nodes in the tree
- * representation of an XML document.
- */
- {ErrorMsg.DOCUMENT_ARG_ERR,
- "document() \u51FD\u6578\u7684\u7B2C\u4E8C\u500B\u5F15\u6578\u5FC5\u9808\u662F node-set\u3002"},
-
- /*
- * Note to translators: "<xsl:when>" and "<xsl:choose>" are keywords
- * and should not be translated. This message describes a syntax error
- * in the stylesheet.
- */
- {ErrorMsg.MISSING_WHEN_ERR,
- "\u5728 <xsl:choose> \u4E2D\u81F3\u5C11\u9700\u8981\u4E00\u500B <xsl:when> \u5143\u7D20\u3002"},
-
- /*
- * Note to translators: "<xsl:otherwise>" and "<xsl:choose>" are
- * keywords and should not be translated. This message describes a
- * syntax error in the stylesheet.
- */
- {ErrorMsg.MULTIPLE_OTHERWISE_ERR,
- "\u5728 <xsl:choose> \u4E2D\u53EA\u5141\u8A31\u4E00\u500B <xsl:otherwise> \u5143\u7D20\u3002"},
-
- /*
- * Note to translators: "<xsl:otherwise>" and "<xsl:choose>" are
- * keywords and should not be translated. This message describes a
- * syntax error in the stylesheet.
- */
- {ErrorMsg.STRAY_OTHERWISE_ERR,
- "<xsl:otherwise> \u53EA\u80FD\u5728 <xsl:choose> \u5167\u4F7F\u7528\u3002"},
-
- /*
- * Note to translators: "<xsl:when>" and "<xsl:choose>" are keywords
- * and should not be translated. This message describes a syntax error
- * in the stylesheet.
- */
- {ErrorMsg.STRAY_WHEN_ERR,
- "<xsl:when> \u53EA\u80FD\u5728 <xsl:choose> \u5167\u4F7F\u7528\u3002"},
-
- /*
- * Note to translators: "<xsl:when>", "<xsl:otherwise>" and
- * "<xsl:choose>" are keywords and should not be translated. This
- * message describes a syntax error in the stylesheet.
- */
- {ErrorMsg.WHEN_ELEMENT_ERR,
- "\u5728 <xsl:choose> \u4E2D\u53EA\u5141\u8A31 <xsl:when> \u8207 <xsl:otherwise> \u5143\u7D20\u3002"},
-
- /*
- * Note to translators: "<xsl:attribute-set>" and "name" are keywords
- * that should not be translated.
- */
- {ErrorMsg.UNNAMED_ATTRIBSET_ERR,
- "<xsl:attribute-set> \u907A\u6F0F 'name' \u5C6C\u6027\u3002"},
-
- /*
- * Note to translators: An element in the stylesheet contained an
- * element of a type that it was not permitted to contain.
- */
- {ErrorMsg.ILLEGAL_CHILD_ERR,
- "\u7121\u6548\u7684\u5B50\u9805\u5143\u7D20\u3002"},
-
- /*
- * Note to translators: The stylesheet tried to create an element with
- * a name that was not a valid XML name. The substitution text contains
- * the name.
- */
- {ErrorMsg.ILLEGAL_ELEM_NAME_ERR,
- "\u60A8\u7121\u6CD5\u547C\u53EB\u5143\u7D20 ''{0}''"},
-
- /*
- * Note to translators: The stylesheet tried to create an attribute
- * with a name that was not a valid XML name. The substitution text
- * contains the name.
- */
- {ErrorMsg.ILLEGAL_ATTR_NAME_ERR,
- "\u60A8\u7121\u6CD5\u547C\u53EB\u5C6C\u6027 ''{0}''"},
-
- /*
- * Note to translators: The children of the outermost element of a
- * stylesheet are referred to as top-level elements. No text should
- * occur within that outermost element unless it is within a top-level
- * element. This message indicates that that constraint was violated.
- * "<xsl:stylesheet>" is a keyword that should not be translated.
- */
- {ErrorMsg.ILLEGAL_TEXT_NODE_ERR,
- "\u6700\u4E0A\u5C64 <xsl:stylesheet> \u5143\u7D20\u4E4B\u5916\u7684\u6587\u5B57\u8CC7\u6599\u3002"},
-
- /*
- * Note to translators: JAXP is an acronym for the Java API for XML
- * Processing. This message indicates that the XML parser provided to
- * XSLTC to process the XML input document had a configuration problem.
- */
- {ErrorMsg.SAX_PARSER_CONFIG_ERR,
- "\u672A\u6B63\u78BA\u8A2D\u5B9A JAXP \u5256\u6790\u5668"},
-
- /*
- * Note to translators: The substitution text names the internal error
- * encountered.
- */
- {ErrorMsg.INTERNAL_ERR,
- "\u7121\u6CD5\u5FA9\u539F\u7684 XSLTC-internal \u932F\u8AA4: ''{0}''"},
-
- /*
- * Note to translators: The stylesheet contained an element that was
- * not recognized as part of the XSL syntax. The substitution text
- * gives the element name.
- */
- {ErrorMsg.UNSUPPORTED_XSL_ERR,
- "\u4E0D\u652F\u63F4\u7684 XSL \u5143\u7D20 ''{0}''\u3002"},
-
- /*
- * Note to translators: The stylesheet referred to an extension to the
- * XSL syntax and indicated that it was defined by XSLTC, but XSTLC does
- * not recognized the particular extension named. The substitution text
- * gives the extension name.
- */
- {ErrorMsg.UNSUPPORTED_EXT_ERR,
- "\u7121\u6CD5\u8FA8\u8B58\u7684 XSLTC \u64F4\u5145\u5957\u4EF6 ''{0}''\u3002"},
-
- /*
- * Note to translators: The XML document given to XSLTC as a stylesheet
- * was not, in fact, a stylesheet. XSLTC is able to detect that in this
- * case because the outermost element in the stylesheet has to be
- * declared with respect to the XSL namespace URI, but no declaration
- * for that namespace was seen.
- */
- {ErrorMsg.MISSING_XSLT_URI_ERR,
- "\u8F38\u5165\u6587\u4EF6\u4E0D\u662F\u6A23\u5F0F\u8868 (\u6839\u5143\u7D20\u4E2D\u672A\u5BA3\u544A XSL \u547D\u540D\u7A7A\u9593)\u3002"},
-
- /*
- * Note to translators: XSLTC could not find the stylesheet document
- * with the name specified by the substitution text.
- */
- {ErrorMsg.MISSING_XSLT_TARGET_ERR,
- "\u627E\u4E0D\u5230\u6A23\u5F0F\u8868\u76EE\u6A19 ''{0}''\u3002"},
-
- /*
- * Note to translators: access to the stylesheet target is denied
- */
- {ErrorMsg.ACCESSING_XSLT_TARGET_ERR,
- "\u7121\u6CD5\u8B80\u53D6\u6A23\u5F0F\u8868\u76EE\u6A19 ''{0}''\uFF0C\u56E0\u70BA accessExternalStylesheet \u5C6C\u6027\u8A2D\u5B9A\u7684\u9650\u5236\uFF0C\u6240\u4EE5\u4E0D\u5141\u8A31 ''{1}'' \u5B58\u53D6\u3002"},
-
- /*
- * Note to translators: This message represents an internal error in
- * condition in XSLTC. The substitution text is the class name in XSLTC
- * that is missing some functionality.
- */
- {ErrorMsg.NOT_IMPLEMENTED_ERR,
- "\u672A\u5BE6\u884C: ''{0}''\u3002"},
-
- /*
- * Note to translators: The XML document given to XSLTC as a stylesheet
- * was not, in fact, a stylesheet.
- */
- {ErrorMsg.NOT_STYLESHEET_ERR,
- "\u8F38\u5165\u6587\u4EF6\u672A\u5305\u542B XSL \u6A23\u5F0F\u8868\u3002"},
-
- /*
- * Note to translators: The element named in the substitution text was
- * encountered in the stylesheet but is not recognized.
- */
- {ErrorMsg.ELEMENT_PARSE_ERR,
- "\u7121\u6CD5\u5256\u6790\u5143\u7D20 ''{0}''"},
-
- /*
- * Note to translators: "use", "<key>", "node", "node-set", "string"
- * and "number" are keywords in this context and should not be
- * translated. This message indicates that the value of the "use"
- * attribute was not one of the permitted values.
- */
- {ErrorMsg.KEY_USE_ATTR_ERR,
- "<key> \u7684\u4F7F\u7528\u5C6C\u6027\u5FC5\u9808\u662F\u7BC0\u9EDE\u3001node-set\u3001\u5B57\u4E32\u6216\u6578\u5B57\u3002"},
-
- /*
- * Note to translators: An XML document can specify the version of the
- * XML specification to which it adheres. This message indicates that
- * the version specified for the output document was not valid.
- */
- {ErrorMsg.OUTPUT_VERSION_ERR,
- "\u8F38\u51FA XML \u6587\u4EF6\u7248\u672C\u61C9\u70BA 1.0"},
-
- /*
- * Note to translators: The operator in a comparison operation was
- * not recognized.
- */
- {ErrorMsg.ILLEGAL_RELAT_OP_ERR,
- "\u95DC\u806F\u8868\u793A\u5F0F\u7684\u904B\u7B97\u5B50\u4E0D\u660E"},
-
- /*
- * Note to translators: An attribute set defines as a set of XML
- * attributes that can be added to an element in the output XML document
- * as a group. This message is reported if the name specified was not
- * used to declare an attribute set. The substitution text is the name
- * that is in error.
- */
- {ErrorMsg.ATTRIBSET_UNDEF_ERR,
- "\u5617\u8A66\u4F7F\u7528\u4E0D\u5B58\u5728\u7684\u5C6C\u6027\u96C6 ''{0}''\u3002"},
-
- /*
- * Note to translators: The term "attribute value template" is a term
- * defined by XSLT which describes the value of an attribute that is
- * determined by an XPath expression. The message indicates that the
- * expression was syntactically incorrect; the substitution text
- * contains the expression that was in error.
- */
- {ErrorMsg.ATTR_VAL_TEMPLATE_ERR,
- "\u7121\u6CD5\u5256\u6790\u5C6C\u6027\u503C\u6A23\u677F ''{0}''\u3002"},
-
- /*
- * Note to translators: ???
- */
- {ErrorMsg.UNKNOWN_SIG_TYPE_ERR,
- "\u985E\u5225 ''{0}'' \u7C3D\u7AE0\u6709\u4E0D\u660E\u7684 data-type\u3002"},
-
- /*
- * Note to translators: The substitution text refers to data types.
- * The message is displayed if a value in a particular context needs to
- * be converted to type {1}, but that's not possible for a value of
- * type {0}.
- */
- {ErrorMsg.DATA_CONVERSION_ERR,
- "\u7121\u6CD5\u8F49\u63DB data-type ''{0}'' \u70BA ''{1}''\u3002"},
-
- /*
- * Note to translators: "Templates" is a Java class name that should
- * not be translated.
- */
- {ErrorMsg.NO_TRANSLET_CLASS_ERR,
- "\u6B64\u6A23\u677F\u672A\u5305\u542B\u6709\u6548\u7684 translet \u985E\u5225\u5B9A\u7FA9\u3002"},
-
- /*
- * Note to translators: "Templates" is a Java class name that should
- * not be translated.
- */
- {ErrorMsg.NO_MAIN_TRANSLET_ERR,
- "\u6B64\u6A23\u677F\u672A\u5305\u542B\u540D\u7A31\u70BA ''{0}'' \u7684\u985E\u5225\u3002"},
-
- /*
- * Note to translators: The substitution text is the name of a class.
- */
- {ErrorMsg.TRANSLET_CLASS_ERR,
- "\u7121\u6CD5\u8F09\u5165 translet \u985E\u5225 ''{0}''\u3002"},
-
- {ErrorMsg.TRANSLET_OBJECT_ERR,
- "\u5DF2\u8F09\u5165 translet \u985E\u5225\uFF0C\u4F46\u7121\u6CD5\u5EFA\u7ACB translet \u57F7\u884C\u8655\u7406\u3002"},
-
- /*
- * Note to translators: "ErrorListener" is a Java interface name that
- * should not be translated. The message indicates that the user tried
- * to set an ErrorListener object on object of the class named in the
- * substitution text with "null" Java value.
- */
- {ErrorMsg.ERROR_LISTENER_NULL_ERR,
- "\u5617\u8A66\u5C07 ''{0}'' \u7684 ErrorListener \u8A2D\u5B9A\u70BA\u7A7A\u503C"},
-
- /*
- * Note to translators: StreamSource, SAXSource and DOMSource are Java
- * interface names that should not be translated.
- */
- {ErrorMsg.JAXP_UNKNOWN_SOURCE_ERR,
- "XSLTC \u50C5\u652F\u63F4 StreamSource\u3001SAXSource \u8207 DOMSource"},
-
- /*
- * Note to translators: "Source" is a Java class name that should not
- * be translated. The substitution text is the name of Java method.
- */
- {ErrorMsg.JAXP_NO_SOURCE_ERR,
- "\u50B3\u9001\u81F3 ''{0}'' \u7684\u4F86\u6E90\u7269\u4EF6\u6C92\u6709\u5167\u5BB9\u3002"},
-
- /*
- * Note to translators: The message indicates that XSLTC failed to
- * compile the stylesheet into a translet (class file).
- */
- {ErrorMsg.JAXP_COMPILE_ERR,
- "\u7121\u6CD5\u7DE8\u8B6F\u6A23\u5F0F\u8868"},
-
- /*
- * Note to translators: "TransformerFactory" is a class name. In this
- * context, an attribute is a property or setting of the
- * TransformerFactory object. The substitution text is the name of the
- * unrecognised attribute. The method used to retrieve the attribute is
- * "getAttribute", so it's not clear whether it would be best to
- * translate the term "attribute".
- */
- {ErrorMsg.JAXP_INVALID_ATTR_ERR,
- "TransformerFactory \u7121\u6CD5\u8FA8\u8B58\u5C6C\u6027 ''{0}''\u3002"},
-
- {ErrorMsg.JAXP_INVALID_ATTR_VALUE_ERR,
- "\u70BA ''{0}'' \u5C6C\u6027\u6307\u5B9A\u7684\u503C\u4E0D\u6B63\u78BA\u3002"},
-
- /*
- * Note to translators: "setResult()" and "startDocument()" are Java
- * method names that should not be translated.
- */
- {ErrorMsg.JAXP_SET_RESULT_ERR,
- "\u547C\u53EB startDocument() \u4E4B\u524D\uFF0C\u5FC5\u9808\u5148\u547C\u53EB setResult()\u3002"},
-
- /*
- * Note to translators: "Transformer" is a Java interface name that
- * should not be translated. A Transformer object should contained a
- * reference to a translet object in order to be used for
- * transformations; this message is produced if that requirement is not
- * met.
- */
- {ErrorMsg.JAXP_NO_TRANSLET_ERR,
- "\u8F49\u63DB\u5668\u6C92\u6709\u5C01\u88DD\u7684 translet \u7269\u4EF6\u3002"},
-
- /*
- * Note to translators: The XML document that results from a
- * transformation needs to be sent to an output handler object; this
- * message is produced if that requirement is not met.
- */
- {ErrorMsg.JAXP_NO_HANDLER_ERR,
- "\u8F49\u63DB\u7D50\u679C\u6C92\u6709\u5B9A\u7FA9\u7684\u8F38\u51FA\u8655\u7406\u7A0B\u5F0F\u3002"},
-
- /*
- * Note to translators: "Result" is a Java interface name in this
- * context. The substitution text is a method name.
- */
- {ErrorMsg.JAXP_NO_RESULT_ERR,
- "\u50B3\u9001\u81F3 ''{0}'' \u7684\u7D50\u679C\u7269\u4EF6\u7121\u6548\u3002"},
-
- /*
- * Note to translators: "Transformer" is a Java interface name. The
- * user's program attempted to access an unrecognized property with the
- * name specified in the substitution text. The method used to retrieve
- * the property is "getOutputProperty", so it's not clear whether it
- * would be best to translate the term "property".
- */
- {ErrorMsg.JAXP_UNKNOWN_PROP_ERR,
- "\u5617\u8A66\u5B58\u53D6\u7121\u6548\u7684\u8F49\u63DB\u5668\u5C6C\u6027 ''{0}''\u3002"},
-
- /*
- * Note to translators: SAX2DOM is the name of a Java class that should
- * not be translated. This is an adapter in the sense that it takes a
- * DOM object and converts it to something that uses the SAX API.
- */
- {ErrorMsg.SAX2DOM_ADAPTER_ERR,
- "\u7121\u6CD5\u5EFA\u7ACB SAX2DOM \u8F49\u63A5\u5668: ''{0}''\u3002"},
-
- /*
- * Note to translators: "XSLTCSource.build()" is a Java method name.
- * "systemId" is an XML term that is short for "system identification".
- */
- {ErrorMsg.XSLTC_SOURCE_ERR,
- "\u672A\u8A2D\u5B9A systemId \u800C\u547C\u53EB XSLTCSource.build()\u3002"},
-
- { ErrorMsg.ER_RESULT_NULL,
- "\u7D50\u679C\u4E0D\u61C9\u70BA\u7A7A\u503C"},
-
- /*
- * Note to translators: This message indicates that the value argument
- * of setParameter must be a valid Java Object.
- */
- {ErrorMsg.JAXP_INVALID_SET_PARAM_VALUE,
- "\u53C3\u6578 {0} \u7684\u503C\u5FC5\u9808\u662F\u6709\u6548\u7684 Java \u7269\u4EF6"},
-
-
- {ErrorMsg.COMPILE_STDIN_ERR,
- "-i \u9078\u9805\u5FC5\u9808\u8207 -o \u9078\u9805\u4E00\u8D77\u4F7F\u7528\u3002"},
-
-
- /*
- * Note to translators: This message contains usage information for a
- * means of invoking XSLTC from the command-line. The message is
- * formatted for presentation in English. The strings <output>,
- * <directory>, etc. indicate user-specified argument values, and can
- * be translated - the argument <package> refers to a Java package, so
- * it should be handled in the same way the term is handled for JDK
- * documentation.
- */
- {ErrorMsg.COMPILE_USAGE_STR,
- "\u6982\u8981\n java com.sun.org.apache.xalan.internal.xsltc.cmdline.Compile [-o <output>]\n [-d <directory>] [-j <jarfile>] [-p <package>]\n [-n] [-x] [-u] [-v] [-h] { <stylesheet> | -i }\n\n\u9078\u9805\n -o <output> \u6307\u6D3E\u540D\u7A31 <output> \u81F3\u7522\u751F\u7684\n translet\u3002\u6839\u64DA\u9810\u8A2D\uFF0Ctranslet \u540D\u7A31\n \u884D\u751F\u81EA <stylesheet> \u540D\u7A31\u3002\u82E5\u7DE8\u8B6F\n \u591A\u500B\u6A23\u5F0F\u8868\uFF0C\u5C07\u5FFD\u7565\u6B64\u9078\u9805\u3002\n -d <directory> \u6307\u5B9A translet \u7684\u76EE\u7684\u5730\u76EE\u9304\n -j <jarfile> \u5C01\u88DD translet \u985E\u5225\u6210\u70BA jar \u6A94\u6848\uFF0C\n \u540D\u7A31\u6307\u5B9A\u70BA <jarfile>\n -p <package> \u6307\u5B9A\u6240\u6709\u7522\u751F\u7684 translet \u985E\u5225\u7684\u5957\u88DD\u7A0B\u5F0F\n \u540D\u7A31\u524D\u7F6E\u78BC\u3002\n -n \u555F\u7528\u6A23\u677F\u5167\u5D4C (\u9810\u8A2D\u884C\u70BA\u4E00\u822C\u800C\u8A00\n \u8F03\u4F73)\u3002\n -x \u958B\u555F\u984D\u5916\u7684\u9664\u932F\u8A0A\u606F\u8F38\u51FA\n -u \u89E3\u8B6F <stylesheet> \u5F15\u6578\u70BA URL\n -i \u5F37\u5236\u7DE8\u8B6F\u5668\u5F9E stdin \u8B80\u53D6\u6A23\u5F0F\u8868\n -v \u5217\u5370\u7DE8\u8B6F\u5668\u7248\u672C\n -h \u5217\u5370\u6B64\u7528\u6CD5\u6558\u8FF0\n"},
-
- /*
- * Note to translators: This message contains usage information for a
- * means of invoking XSLTC from the command-line. The message is
- * formatted for presentation in English. The strings <jarfile>,
- * <document>, etc. indicate user-specified argument values, and can
- * be translated - the argument <class> refers to a Java class, so it
- * should be handled in the same way the term is handled for JDK
- * documentation.
- */
- {ErrorMsg.TRANSFORM_USAGE_STR,
- "\u6982\u8981 \n java com.sun.org.apache.xalan.internal.xsltc.cmdline.Transform [-j <jarfile>]\n [-x] [-n <iterations>] {-u <document_url> | <document>}\n <class> [<param1>=<value1> ...]\n\n \u4F7F\u7528 translet <class> \u8F49\u63DB\u6307\u5B9A\u70BA <document> \n \u7684 XML \u6587\u4EF6\u3002translet <class> \u4F4D\u65BC\n \u4F7F\u7528\u8005\u7684\u985E\u5225\u8DEF\u5F91\uFF0C\u6216\u662F\u5728\u9078\u64C7\u6027\u6307\u5B9A\u7684 <jarfile> \u4E2D\u3002\n\u9078\u9805\n -j <jarfile> \u6307\u5B9A\u8F09\u5165 translet \u7684\u4F86\u6E90 jarfile\n -x \u958B\u555F\u984D\u5916\u7684\u9664\u932F\u8A0A\u606F\u8F38\u51FA\n -n <iterations> \u57F7\u884C\u8F49\u63DB <iterations> \u6B21\u6578\u8207\n \u986F\u793A\u5206\u6790\u8CC7\u8A0A\n -u <document_url> \u6307\u5B9A XML \u8F38\u5165\u6587\u4EF6\u70BA URL\n"},
-
-
-
- /*
- * Note to translators: "<xsl:sort>", "<xsl:for-each>" and
- * "<xsl:apply-templates>" are keywords that should not be translated.
- * The message indicates that an xsl:sort element must be a child of
- * one of the other kinds of elements mentioned.
- */
- {ErrorMsg.STRAY_SORT_ERR,
- "<xsl:sort> \u53EA\u80FD\u5728 <xsl:for-each> \u6216 <xsl:apply-templates> \u4E2D\u4F7F\u7528\u3002"},
-
- /*
- * Note to translators: The message indicates that the encoding
- * requested for the output document was on that requires support that
- * is not available from the Java Virtual Machine being used to execute
- * the program.
- */
- {ErrorMsg.UNSUPPORTED_ENCODING,
- "\u6B64 JVM \u4E0D\u652F\u63F4\u8F38\u51FA\u7DE8\u78BC ''{0}''\u3002"},
-
- /*
- * Note to translators: The message indicates that the XPath expression
- * named in the substitution text was not well formed syntactically.
- */
- {ErrorMsg.SYNTAX_ERR,
- "''{0}'' \u4E2D\u7684\u8A9E\u6CD5\u932F\u8AA4\u3002"},
-
- /*
- * Note to translators: The substitution text is the name of a Java
- * class. The term "constructor" here is the Java term. The message is
- * displayed if XSLTC could not find a constructor for the specified
- * class.
- */
- {ErrorMsg.CONSTRUCTOR_NOT_FOUND,
- "\u627E\u4E0D\u5230\u5916\u90E8\u5EFA\u69CB\u5B50 ''{0}''\u3002"},
-
- /*
- * Note to translators: "static" is the Java keyword. The substitution
- * text is the name of a function. The first argument of that function
- * is not of the required type.
- */
- {ErrorMsg.NO_JAVA_FUNCT_THIS_REF,
- "\u975E\u975C\u614B Java \u51FD\u6578 ''{0}'' \u7684\u7B2C\u4E00\u500B\u5F15\u6578\u4E0D\u662F\u6709\u6548\u7684\u7269\u4EF6\u53C3\u7167\u3002"},
-
- /*
- * Note to translators: An XPath expression was not of the type
- * required in a particular context. The substitution text is the
- * expression that was in error.
- */
- {ErrorMsg.TYPE_CHECK_ERR,
- "\u6AA2\u67E5\u8868\u793A\u5F0F ''{0}'' \u7684\u985E\u578B\u6642\u767C\u751F\u932F\u8AA4\u3002"},
-
- /*
- * Note to translators: An XPath expression was not of the type
- * required in a particular context. However, the location of the
- * problematic expression is unknown.
- */
- {ErrorMsg.TYPE_CHECK_UNK_LOC_ERR,
- "\u6AA2\u67E5\u4F4D\u65BC\u4E0D\u660E\u4F4D\u7F6E\u8868\u793A\u5F0F\u7684\u985E\u578B\u6642\u767C\u751F\u932F\u8AA4\u3002"},
-
- /*
- * Note to translators: The substitution text is the name of a command-
- * line option that was not recognized.
- */
- {ErrorMsg.ILLEGAL_CMDLINE_OPTION_ERR,
- "\u547D\u4EE4\u884C\u9078\u9805 ''{0}'' \u7121\u6548\u3002"},
-
- /*
- * Note to translators: The substitution text is the name of a command-
- * line option.
- */
- {ErrorMsg.CMDLINE_OPT_MISSING_ARG_ERR,
- "\u547D\u4EE4\u884C\u9078\u9805 ''{0}'' \u907A\u6F0F\u5FC5\u8981\u7684\u5F15\u6578\u3002"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text contains two error
- * messages. The spacing before the second substitution text indents
- * it the same amount as the first in English.
- */
- {ErrorMsg.WARNING_PLUS_WRAPPED_MSG,
- "WARNING: ''{0}''\n :{1}"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text is an error message.
- */
- {ErrorMsg.WARNING_MSG,
- "WARNING: ''{0}''"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text contains two error
- * messages. The spacing before the second substitution text indents
- * it the same amount as the first in English.
- */
- {ErrorMsg.FATAL_ERR_PLUS_WRAPPED_MSG,
- "FATAL ERROR: ''{0}''\n :{1}"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text is an error message.
- */
- {ErrorMsg.FATAL_ERR_MSG,
- "FATAL ERROR: ''{0}''"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text contains two error
- * messages. The spacing before the second substitution text indents
- * it the same amount as the first in English.
- */
- {ErrorMsg.ERROR_PLUS_WRAPPED_MSG,
- "ERROR: ''{0}''\n :{1}"},
-
- /*
- * Note to translators: This message is used to indicate the severity
- * of another message. The substitution text is an error message.
- */
- {ErrorMsg.ERROR_MSG,
- "ERROR: ''{0}''"},
-
- /*
- * Note to translators: The substitution text is the name of a class.
- */
- {ErrorMsg.TRANSFORM_WITH_TRANSLET_STR,
- "\u4F7F\u7528 translet ''{0}'' \u8F49\u63DB"},
-
- /*
- * Note to translators: The first substitution is the name of a class,
- * while the second substitution is the name of a jar file.
- */
- {ErrorMsg.TRANSFORM_WITH_JAR_STR,
- "\u4F7F\u7528\u4F86\u81EA jar \u6A94\u6848 ''{1}'' \u7684 translet ''{0}'' \u8F49\u63DB"},
-
- /*
- * Note to translators: "TransformerFactory" is the name of a Java
- * interface and must not be translated. The substitution text is
- * the name of the class that could not be instantiated.
- */
- {ErrorMsg.COULD_NOT_CREATE_TRANS_FACT,
- "\u7121\u6CD5\u5EFA\u7ACB TransformerFactory \u985E\u5225 ''{0}'' \u7684\u57F7\u884C\u8655\u7406\u3002"},
-
- /*
- * Note to translators: This message is produced when the user
- * specified a name for the translet class that contains characters
- * that are not permitted in a Java class name. The substitution
- * text "{0}" specifies the name the user requested, while "{1}"
- * specifies the name the processor used instead.
- */
- {ErrorMsg.TRANSLET_NAME_JAVA_CONFLICT,
- "\u540D\u7A31 ''{0}'' \u7121\u6CD5\u4F5C\u70BA translet \u985E\u5225\u7684\u540D\u7A31\uFF0C\u56E0\u70BA\u5B83\u5305\u542B Java \u985E\u5225\u540D\u7A31\u4E0D\u5141\u8A31\u7684\u5B57\u5143\u3002\u8ACB\u6539\u7528\u540D\u7A31 ''{1}''\u3002"},
-
- /*
- * Note to translators: The following message is used as a header.
- * All the error messages are collected together and displayed beneath
- * this message.
- */
- {ErrorMsg.COMPILER_ERROR_KEY,
- "\u7DE8\u8B6F\u5668\u932F\u8AA4:"},
-
- /*
- * Note to translators: The following message is used as a header.
- * All the warning messages are collected together and displayed
- * beneath this message.
- */
- {ErrorMsg.COMPILER_WARNING_KEY,
- "\u7DE8\u8B6F\u5668\u8B66\u544A:"},
-
- /*
- * Note to translators: The following message is used as a header.
- * All the error messages that are produced when the stylesheet is
- * applied to an input document are collected together and displayed
- * beneath this message. A 'translet' is the compiled form of a
- * stylesheet (see above).
- */
- {ErrorMsg.RUNTIME_ERROR_KEY,
- "Translet \u932F\u8AA4:"},
-
- /*
- * Note to translators: An attribute whose value is constrained to
- * be a "QName" or a list of "QNames" had a value that was incorrect.
- * 'QName' is an XML syntactic term that must not be translated. The
- * substitution text contains the actual value of the attribute.
- */
- {ErrorMsg.INVALID_QNAME_ERR,
- "\u503C\u5FC5\u9808\u70BA QName \u6216\u4F7F\u7528\u7A7A\u683C\u52A0\u4EE5\u5340\u9694\u7684 QNames \u6E05\u55AE\u7684\u5C6C\u6027\uFF0C\u5177\u6709\u503C ''{0}''"},
-
- /*
- * Note to translators: An attribute whose value is required to
- * be an "NCName".
- * 'NCName' is an XML syntactic term that must not be translated. The
- * substitution text contains the actual value of the attribute.
- */
- {ErrorMsg.INVALID_NCNAME_ERR,
- "\u503C\u5FC5\u9808\u70BA NCName \u7684\u5C6C\u6027\uFF0C\u5177\u6709\u503C ''{0}''"},
-
- /*
- * Note to translators: An attribute with an incorrect value was
- * encountered. The permitted value is one of the literal values
- * "xml", "html" or "text"; it is also permitted to have the form of
- * a QName that is not also an NCName. The terms "method",
- * "xsl:output", "xml", "html" and "text" are keywords that must not
- * be translated. The term "qname-but-not-ncname" is an XML syntactic
- * term. The substitution text contains the actual value of the
- * attribute.
- */
- {ErrorMsg.INVALID_METHOD_IN_OUTPUT,
- "<xsl:output> \u5143\u7D20\u7684\u65B9\u6CD5\u5C6C\u6027\u5177\u6709\u503C ''{0}''\u3002\u6B64\u503C\u5FC5\u9808\u662F ''xml''\u3001''html''\u3001''text'' \u6216 qname-but-not-ncname \u5176\u4E2D\u4E4B\u4E00"},
-
- {ErrorMsg.JAXP_GET_FEATURE_NULL_NAME,
- "TransformerFactory.getFeature(\u5B57\u4E32\u540D\u7A31) \u4E2D\u7684\u529F\u80FD\u540D\u7A31\u4E0D\u53EF\u70BA\u7A7A\u503C\u3002"},
-
- {ErrorMsg.JAXP_SET_FEATURE_NULL_NAME,
- "TransformerFactory.setFeature(\u5B57\u4E32\u540D\u7A31, \u5E03\u6797\u503C) \u4E2D\u7684\u529F\u80FD\u540D\u7A31\u4E0D\u53EF\u70BA\u7A7A\u503C\u3002"},
-
- {ErrorMsg.JAXP_UNSUPPORTED_FEATURE,
- "\u7121\u6CD5\u5728\u6B64 TransformerFactory \u4E0A\u8A2D\u5B9A\u529F\u80FD ''{0}''\u3002"},
-
- {ErrorMsg.JAXP_SECUREPROCESSING_FEATURE,
- "FEATURE_SECURE_PROCESSING: \u5B89\u5168\u7BA1\u7406\u7A0B\u5F0F\u5B58\u5728\u6642\uFF0C\u7121\u6CD5\u5C07\u529F\u80FD\u8A2D\u70BA\u507D\u3002"},
-
- /*
- * Note to translators: This message describes an internal error in the
- * processor. The term "byte code" is a Java technical term for the
- * executable code in a Java method, and "try-catch-finally block"
- * refers to the Java keywords with those names. "Outlined" is a
- * technical term internal to XSLTC and should not be translated.
- */
- {ErrorMsg.OUTLINE_ERR_TRY_CATCH,
- "\u5167\u90E8 XSLTC \u932F\u8AA4: \u7522\u751F\u7684\u4F4D\u5143\u7D44\u78BC\u5305\u542B try-catch-finally \u5340\u584A\uFF0C\u7121\u6CD5\u52A0\u4EE5 outlined."},
-
- /*
- * Note to translators: This message describes an internal error in the
- * processor. The terms "OutlineableChunkStart" and
- * "OutlineableChunkEnd" are the names of classes internal to XSLTC and
- * should not be translated. The message indicates that for every
- * "start" there must be a corresponding "end", and vice versa, and
- * that if one of a pair of "start" and "end" appears between another
- * pair of corresponding "start" and "end", then the other half of the
- * pair must also be between that same enclosing pair.
- */
- {ErrorMsg.OUTLINE_ERR_UNBALANCED_MARKERS,
- "\u5167\u90E8 XSLTC \u932F\u8AA4: OutlineableChunkStart \u548C OutlineableChunkEnd \u6A19\u8A18\u5FC5\u9808\u6210\u5C0D\u51FA\u73FE\uFF0C\u4E26\u4F7F\u7528\u6B63\u78BA\u7684\u5DE2\u72C0\u7D50\u69CB\u3002"},
-
- /*
- * Note to translators: This message describes an internal error in the
- * processor. The term "byte code" is a Java technical term for the
- * executable code in a Java method. The "method" that is being
- * referred to is a Java method in a translet that XSLTC is generating
- * in processing a stylesheet. The "instruction" that is being
- * referred to is one of the instrutions in the Java byte code in that
- * method. "Outlined" is a technical term internal to XSLTC and
- * should not be translated.
- */
- {ErrorMsg.OUTLINE_ERR_DELETED_TARGET,
- "\u5167\u90E8 XSLTC \u932F\u8AA4: \u539F\u59CB\u65B9\u6CD5\u4E2D\u4ECD\u7136\u53C3\u7167\u5C6C\u65BC outlined \u4F4D\u5143\u7D44\u78BC\u5340\u584A\u4E00\u90E8\u5206\u7684\u6307\u793A\u3002"
- },
-
-
- /*
- * Note to translators: This message describes an internal error in the
- * processor. The "method" that is being referred to is a Java method
- * in a translet that XSLTC is generating.
- *
- */
- {ErrorMsg.OUTLINE_ERR_METHOD_TOO_BIG,
- "\u5167\u90E8 XSLTC \u932F\u8AA4: translet \u4E2D\u7684\u65B9\u6CD5\u8D85\u904E Java \u865B\u64EC\u6A5F\u5668\u5C0D\u65BC\u65B9\u6CD5\u9577\u5EA6 64 KB \u7684\u9650\u5236\u3002\u9019\u901A\u5E38\u662F\u56E0\u70BA\u6A23\u5F0F\u8868\u4E2D\u6709\u975E\u5E38\u5927\u7684\u6A23\u677F\u3002\u8ACB\u5617\u8A66\u91CD\u65B0\u7D44\u7E54\u60A8\u7684\u6A23\u5F0F\u8868\u4EE5\u4F7F\u7528\u8F03\u5C0F\u7684\u6A23\u677F\u3002"
- },
-
- {ErrorMsg.DESERIALIZE_TRANSLET_ERR, "\u555F\u7528 Java \u5B89\u5168\u6642\uFF0C\u6703\u505C\u7528\u9084\u539F\u5E8F\u5217\u5316 TemplatesImpl \u7684\u652F\u63F4\u3002\u5C07 jdk.xml.enableTemplatesImplDeserialization \u7CFB\u7D71\u5C6C\u6027\u8A2D\u70BA\u771F\u5373\u53EF\u8986\u5BEB\u6B64\u8A2D\u5B9A\u3002"}
-
- };
-
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMsg.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMsg.java
deleted file mode 100644
index 4192cf2..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMsg.java
+++ /dev/null
@@ -1,326 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ErrorMsg.java,v 1.2.4.1 2005/09/15 10:18:01 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-
-import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
-import java.text.MessageFormat;
-import java.util.Locale;
-import java.util.ResourceBundle;
-
-import com.sun.org.apache.xalan.internal.xsltc.compiler.Stylesheet;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.SyntaxTreeNode;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author G. Todd Miller
- * @author Erwin Bolwidt <ejb@klomp.org>
- * @author Morten Jorgensen
- */
-public final class ErrorMsg {
-
- private String _code;
- private int _line;
- private String _message = null;
- private String _url = null;
- Object[] _params = null;
- private boolean _isWarningError;
-
- Throwable _cause;
-
- // Compiler error messages
- public static final String MULTIPLE_STYLESHEET_ERR = "MULTIPLE_STYLESHEET_ERR";
- public static final String TEMPLATE_REDEF_ERR = "TEMPLATE_REDEF_ERR";
- public static final String TEMPLATE_UNDEF_ERR = "TEMPLATE_UNDEF_ERR";
- public static final String VARIABLE_REDEF_ERR = "VARIABLE_REDEF_ERR";
- public static final String VARIABLE_UNDEF_ERR = "VARIABLE_UNDEF_ERR";
- public static final String CLASS_NOT_FOUND_ERR = "CLASS_NOT_FOUND_ERR";
- public static final String METHOD_NOT_FOUND_ERR = "METHOD_NOT_FOUND_ERR";
- public static final String ARGUMENT_CONVERSION_ERR = "ARGUMENT_CONVERSION_ERR";
- public static final String FILE_NOT_FOUND_ERR = "FILE_NOT_FOUND_ERR";
- public static final String INVALID_URI_ERR = "INVALID_URI_ERR";
- public static final String FILE_ACCESS_ERR = "FILE_ACCESS_ERR";
- public static final String MISSING_ROOT_ERR = "MISSING_ROOT_ERR";
- public static final String NAMESPACE_UNDEF_ERR = "NAMESPACE_UNDEF_ERR";
- public static final String FUNCTION_RESOLVE_ERR = "FUNCTION_RESOLVE_ERR";
- public static final String NEED_LITERAL_ERR = "NEED_LITERAL_ERR";
- public static final String XPATH_PARSER_ERR = "XPATH_PARSER_ERR";
- public static final String REQUIRED_ATTR_ERR = "REQUIRED_ATTR_ERR";
- public static final String ILLEGAL_CHAR_ERR = "ILLEGAL_CHAR_ERR";
- public static final String ILLEGAL_PI_ERR = "ILLEGAL_PI_ERR";
- public static final String STRAY_ATTRIBUTE_ERR = "STRAY_ATTRIBUTE_ERR";
- public static final String ILLEGAL_ATTRIBUTE_ERR = "ILLEGAL_ATTRIBUTE_ERR";
- public static final String CIRCULAR_INCLUDE_ERR = "CIRCULAR_INCLUDE_ERR";
- public static final String RESULT_TREE_SORT_ERR = "RESULT_TREE_SORT_ERR";
- public static final String SYMBOLS_REDEF_ERR = "SYMBOLS_REDEF_ERR";
- public static final String XSL_VERSION_ERR = "XSL_VERSION_ERR";
- public static final String CIRCULAR_VARIABLE_ERR = "CIRCULAR_VARIABLE_ERR";
- public static final String ILLEGAL_BINARY_OP_ERR = "ILLEGAL_BINARY_OP_ERR";
- public static final String ILLEGAL_ARG_ERR = "ILLEGAL_ARG_ERR";
- public static final String DOCUMENT_ARG_ERR = "DOCUMENT_ARG_ERR";
- public static final String MISSING_WHEN_ERR = "MISSING_WHEN_ERR";
- public static final String MULTIPLE_OTHERWISE_ERR = "MULTIPLE_OTHERWISE_ERR";
- public static final String STRAY_OTHERWISE_ERR = "STRAY_OTHERWISE_ERR";
- public static final String STRAY_WHEN_ERR = "STRAY_WHEN_ERR";
- public static final String WHEN_ELEMENT_ERR = "WHEN_ELEMENT_ERR";
- public static final String UNNAMED_ATTRIBSET_ERR = "UNNAMED_ATTRIBSET_ERR";
- public static final String ILLEGAL_CHILD_ERR = "ILLEGAL_CHILD_ERR";
- public static final String ILLEGAL_ELEM_NAME_ERR = "ILLEGAL_ELEM_NAME_ERR";
- public static final String ILLEGAL_ATTR_NAME_ERR = "ILLEGAL_ATTR_NAME_ERR";
- public static final String ILLEGAL_TEXT_NODE_ERR = "ILLEGAL_TEXT_NODE_ERR";
- public static final String SAX_PARSER_CONFIG_ERR = "SAX_PARSER_CONFIG_ERR";
- public static final String INTERNAL_ERR = "INTERNAL_ERR";
- public static final String UNSUPPORTED_XSL_ERR = "UNSUPPORTED_XSL_ERR";
- public static final String UNSUPPORTED_EXT_ERR = "UNSUPPORTED_EXT_ERR";
- public static final String MISSING_XSLT_URI_ERR = "MISSING_XSLT_URI_ERR";
- public static final String MISSING_XSLT_TARGET_ERR = "MISSING_XSLT_TARGET_ERR";
- public static final String ACCESSING_XSLT_TARGET_ERR = "ACCESSING_XSLT_TARGET_ERR";
- public static final String NOT_IMPLEMENTED_ERR = "NOT_IMPLEMENTED_ERR";
- public static final String NOT_STYLESHEET_ERR = "NOT_STYLESHEET_ERR";
- public static final String ELEMENT_PARSE_ERR = "ELEMENT_PARSE_ERR";
- public static final String KEY_USE_ATTR_ERR = "KEY_USE_ATTR_ERR";
- public static final String OUTPUT_VERSION_ERR = "OUTPUT_VERSION_ERR";
- public static final String ILLEGAL_RELAT_OP_ERR = "ILLEGAL_RELAT_OP_ERR";
- public static final String ATTRIBSET_UNDEF_ERR = "ATTRIBSET_UNDEF_ERR";
- public static final String ATTR_VAL_TEMPLATE_ERR = "ATTR_VAL_TEMPLATE_ERR";
- public static final String UNKNOWN_SIG_TYPE_ERR = "UNKNOWN_SIG_TYPE_ERR";
- public static final String DATA_CONVERSION_ERR = "DATA_CONVERSION_ERR";
-
- // JAXP/TrAX error messages
- public static final String NO_TRANSLET_CLASS_ERR = "NO_TRANSLET_CLASS_ERR";
- public static final String NO_MAIN_TRANSLET_ERR = "NO_MAIN_TRANSLET_ERR";
- public static final String TRANSLET_CLASS_ERR = "TRANSLET_CLASS_ERR";
- public static final String TRANSLET_OBJECT_ERR = "TRANSLET_OBJECT_ERR";
- public static final String ERROR_LISTENER_NULL_ERR = "ERROR_LISTENER_NULL_ERR";
- public static final String JAXP_UNKNOWN_SOURCE_ERR = "JAXP_UNKNOWN_SOURCE_ERR";
- public static final String JAXP_NO_SOURCE_ERR = "JAXP_NO_SOURCE_ERR";
- public static final String JAXP_COMPILE_ERR = "JAXP_COMPILE_ERR";
- public static final String JAXP_INVALID_ATTR_ERR = "JAXP_INVALID_ATTR_ERR";
- public static final String JAXP_INVALID_ATTR_VALUE_ERR = "JAXP_INVALID_ATTR_VALUE_ERR";
- public static final String JAXP_SET_RESULT_ERR = "JAXP_SET_RESULT_ERR";
- public static final String JAXP_NO_TRANSLET_ERR = "JAXP_NO_TRANSLET_ERR";
- public static final String JAXP_NO_HANDLER_ERR = "JAXP_NO_HANDLER_ERR";
- public static final String JAXP_NO_RESULT_ERR = "JAXP_NO_RESULT_ERR";
- public static final String JAXP_UNKNOWN_PROP_ERR = "JAXP_UNKNOWN_PROP_ERR";
- public static final String SAX2DOM_ADAPTER_ERR = "SAX2DOM_ADAPTER_ERR";
- public static final String XSLTC_SOURCE_ERR = "XSLTC_SOURCE_ERR";
- public static final String ER_RESULT_NULL = "ER_RESULT_NULL";
- public static final String JAXP_INVALID_SET_PARAM_VALUE = "JAXP_INVALID_SET_PARAM_VALUE";
- public static final String JAXP_SET_FEATURE_NULL_NAME = "JAXP_SET_FEATURE_NULL_NAME";
- public static final String JAXP_GET_FEATURE_NULL_NAME = "JAXP_GET_FEATURE_NULL_NAME";
- public static final String JAXP_UNSUPPORTED_FEATURE = "JAXP_UNSUPPORTED_FEATURE";
- public static final String JAXP_SECUREPROCESSING_FEATURE = "JAXP_SECUREPROCESSING_FEATURE";
-
- // Command-line error messages
- public static final String COMPILE_STDIN_ERR = "COMPILE_STDIN_ERR";
- public static final String COMPILE_USAGE_STR = "COMPILE_USAGE_STR";
- public static final String TRANSFORM_USAGE_STR = "TRANSFORM_USAGE_STR";
-
- // Recently added error messages
- public static final String STRAY_SORT_ERR = "STRAY_SORT_ERR";
- public static final String UNSUPPORTED_ENCODING = "UNSUPPORTED_ENCODING";
- public static final String SYNTAX_ERR = "SYNTAX_ERR";
- public static final String CONSTRUCTOR_NOT_FOUND = "CONSTRUCTOR_NOT_FOUND";
- public static final String NO_JAVA_FUNCT_THIS_REF = "NO_JAVA_FUNCT_THIS_REF";
- public static final String TYPE_CHECK_ERR = "TYPE_CHECK_ERR";
- public static final String TYPE_CHECK_UNK_LOC_ERR = "TYPE_CHECK_UNK_LOC_ERR";
- public static final String ILLEGAL_CMDLINE_OPTION_ERR = "ILLEGAL_CMDLINE_OPTION_ERR";
- public static final String CMDLINE_OPT_MISSING_ARG_ERR = "CMDLINE_OPT_MISSING_ARG_ERR";
- public static final String WARNING_PLUS_WRAPPED_MSG = "WARNING_PLUS_WRAPPED_MSG";
- public static final String WARNING_MSG = "WARNING_MSG";
- public static final String FATAL_ERR_PLUS_WRAPPED_MSG = "FATAL_ERR_PLUS_WRAPPED_MSG";
- public static final String FATAL_ERR_MSG = "FATAL_ERR_MSG";
- public static final String ERROR_PLUS_WRAPPED_MSG = "ERROR_PLUS_WRAPPED_MSG";
- public static final String ERROR_MSG = "ERROR_MSG";
- public static final String TRANSFORM_WITH_TRANSLET_STR = "TRANSFORM_WITH_TRANSLET_STR";
- public static final String TRANSFORM_WITH_JAR_STR = "TRANSFORM_WITH_JAR_STR";
- public static final String COULD_NOT_CREATE_TRANS_FACT = "COULD_NOT_CREATE_TRANS_FACT";
- public static final String TRANSLET_NAME_JAVA_CONFLICT =
- "TRANSLET_NAME_JAVA_CONFLICT";
- public static final String INVALID_QNAME_ERR = "INVALID_QNAME_ERR";
- public static final String INVALID_NCNAME_ERR = "INVALID_NCNAME_ERR";
- public static final String INVALID_METHOD_IN_OUTPUT = "INVALID_METHOD_IN_OUTPUT";
-
- public static final String OUTLINE_ERR_TRY_CATCH = "OUTLINE_ERR_TRY_CATCH";
- public static final String OUTLINE_ERR_UNBALANCED_MARKERS =
- "OUTLINE_ERR_UNBALANCED_MARKERS";
- public static final String OUTLINE_ERR_DELETED_TARGET =
- "OUTLINE_ERR_DELETED_TARGET";
- public static final String OUTLINE_ERR_METHOD_TOO_BIG =
- "OUTLINE_ERR_METHOD_TOO_BIG";
-
- public static final String DESERIALIZE_TRANSLET_ERR = "DESERIALIZE_TEMPLATES_ERR";
-
- // All error messages are localized and are stored in resource bundles.
- // This array and the following 4 strings are read from that bundle.
- private static ResourceBundle _bundle;
-
- public final static String ERROR_MESSAGES_KEY = "ERROR_MESSAGES_KEY";
- public final static String COMPILER_ERROR_KEY = "COMPILER_ERROR_KEY";
- public final static String COMPILER_WARNING_KEY = "COMPILER_WARNING_KEY";
- public final static String RUNTIME_ERROR_KEY = "RUNTIME_ERROR_KEY";
-
- static {
- _bundle = SecuritySupport.getResourceBundle(
- "com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMessages",
- Locale.getDefault());
- }
-
- public ErrorMsg(String code) {
- _code = code;
- _line = 0;
- }
-
- public ErrorMsg(String code, Throwable e) {
- _code = code;
- _message = e.getMessage();
- _line = 0;
- _cause = e;
- }
-
- public ErrorMsg(String message, int line) {
- _code = null;
- _message = message;
- _line = line;
- }
-
- public ErrorMsg(String code, int line, Object param) {
- _code = code;
- _line = line;
- _params = new Object[] { param };
- }
-
- public ErrorMsg(String code, Object param) {
- this(code);
- _params = new Object[1];
- _params[0] = param;
- }
-
- public ErrorMsg(String code, Object param1, Object param2) {
- this(code);
- _params = new Object[2];
- _params[0] = param1;
- _params[1] = param2;
- }
-
- public ErrorMsg(String code, SyntaxTreeNode node) {
- _code = code;
- _url = getFileName(node);
- _line = node.getLineNumber();
- }
-
- public ErrorMsg(String code, Object param1, SyntaxTreeNode node) {
- _code = code;
- _url = getFileName(node);
- _line = node.getLineNumber();
- _params = new Object[1];
- _params[0] = param1;
- }
-
- public ErrorMsg(String code, Object param1, Object param2,
- SyntaxTreeNode node) {
- _code = code;
- _url = getFileName(node);
- _line = node.getLineNumber();
- _params = new Object[2];
- _params[0] = param1;
- _params[1] = param2;
- }
-
- public Throwable getCause() {
- return _cause;
- }
-
- private String getFileName(SyntaxTreeNode node) {
- Stylesheet stylesheet = node.getStylesheet();
- if (stylesheet != null)
- return stylesheet.getSystemId();
- else
- return null;
- }
-
- private String formatLine() {
- StringBuffer result = new StringBuffer();
- if (_url != null) {
- result.append(_url);
- result.append(": ");
- }
- if (_line > 0) {
- result.append("line ");
- result.append(Integer.toString(_line));
- result.append(": ");
- }
- return result.toString();
- }
-
- /**
- * This version of toString() uses the _params instance variable
- * to format the message. If the <code>_code</code> is negative
- * the use _message as the error string.
- */
- public String toString() {
- String suffix = (_params == null) ?
- (null != _code ? getErrorMessage() : _message)
- : MessageFormat.format(getErrorMessage(), _params);
- return formatLine() + suffix;
- }
-
- public String toString(Object obj) {
- Object params[] = new Object[1];
- params[0] = obj.toString();
- String suffix = MessageFormat.format(getErrorMessage(), params);
- return formatLine() + suffix;
- }
-
- public String toString(Object obj0, Object obj1) {
- Object params[] = new Object[2];
- params[0] = obj0.toString();
- params[1] = obj1.toString();
- String suffix = MessageFormat.format(getErrorMessage(), params);
- return formatLine() + suffix;
- }
-
- /**
- * Return an ErrorMessages string corresponding to the _code
- * This function is temporary until the three special-cased keys
- * below are moved into ErrorMessages
- *
- * @return ErrorMessages string
- */
- private String getErrorMessage() {
- return _bundle.getString(_code);
- }
-
- // If the _isWarningError flag is true, the error is treated as
- // a warning by the compiler, but should be reported as an error
- // to the ErrorListener. This is a workaround for the TCK failure
- // ErrorListener.errorTests.error001.
- public void setWarningError(boolean flag) {
- _isWarningError = flag;
-}
-
- public boolean isWarningError() {
- return _isWarningError;
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/FilterGenerator.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/FilterGenerator.java
deleted file mode 100644
index 96f680f..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/FilterGenerator.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FilterGenerator.java,v 1.2.4.1 2005/09/05 11:13:52 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-
-import com.sun.org.apache.bcel.internal.generic.ALOAD;
-import com.sun.org.apache.bcel.internal.generic.Instruction;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.Stylesheet;
-
-/**
- * This class implements auxliary classes needed to compile
- * filters (predicates). These classes defined a single method
- * of type <tt>TestGenerator</tt>.
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-public final class FilterGenerator extends ClassGenerator {
- private static int TRANSLET_INDEX = 5; // translet
- private final Instruction _aloadTranslet;
-
- public FilterGenerator(String className, String superClassName,
- String fileName,
- int accessFlags, String[] interfaces,
- Stylesheet stylesheet) {
- super(className, superClassName, fileName,
- accessFlags, interfaces, stylesheet);
-
- _aloadTranslet = new ALOAD(TRANSLET_INDEX);
- }
-
- /**
- * The index of the translet pointer within the execution of
- * the test method.
- */
- public final Instruction loadTranslet() {
- return _aloadTranslet;
- }
-
- /**
- * Returns <tt>true</tt> since this class is external to the
- * translet.
- */
- public boolean isExternal() {
- return true;
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/IntType.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/IntType.java
deleted file mode 100644
index 247e6e2..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/IntType.java
+++ /dev/null
@@ -1,302 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: IntType.java,v 1.2.4.1 2005/09/05 11:14:44 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-
-import com.sun.org.apache.bcel.internal.generic.BranchHandle;
-import com.sun.org.apache.bcel.internal.generic.BranchInstruction;
-import com.sun.org.apache.bcel.internal.generic.CHECKCAST;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.GOTO;
-import com.sun.org.apache.bcel.internal.generic.IFEQ;
-import com.sun.org.apache.bcel.internal.generic.IFGE;
-import com.sun.org.apache.bcel.internal.generic.IFGT;
-import com.sun.org.apache.bcel.internal.generic.IFLE;
-import com.sun.org.apache.bcel.internal.generic.IFLT;
-import com.sun.org.apache.bcel.internal.generic.IF_ICMPGE;
-import com.sun.org.apache.bcel.internal.generic.IF_ICMPGT;
-import com.sun.org.apache.bcel.internal.generic.IF_ICMPLE;
-import com.sun.org.apache.bcel.internal.generic.IF_ICMPLT;
-import com.sun.org.apache.bcel.internal.generic.ILOAD;
-import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
-import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
-import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
-import com.sun.org.apache.bcel.internal.generic.ISTORE;
-import com.sun.org.apache.bcel.internal.generic.Instruction;
-import com.sun.org.apache.bcel.internal.generic.InstructionConstants;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.NEW;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.Constants;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.FlowList;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-public final class IntType extends NumberType {
- protected IntType() {}
-
- public String toString() {
- return "int";
- }
-
- public boolean identicalTo(Type other) {
- return this == other;
- }
-
- public String toSignature() {
- return "I";
- }
-
- public com.sun.org.apache.bcel.internal.generic.Type toJCType() {
- return com.sun.org.apache.bcel.internal.generic.Type.INT;
- }
-
- /**
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#distanceTo
- */
- public int distanceTo(Type type) {
- if (type == this) {
- return 0;
- }
- else if (type == Type.Real) {
- return 1;
- }
- else
- return Integer.MAX_VALUE;
- }
-
- /**
- * Translates an integer into an object of internal type <code>type</code>.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- final Type type) {
- if (type == Type.Real) {
- translateTo(classGen, methodGen, (RealType) type);
- }
- else if (type == Type.String) {
- translateTo(classGen, methodGen, (StringType) type);
- }
- else if (type == Type.Boolean) {
- translateTo(classGen, methodGen, (BooleanType) type);
- }
- else if (type == Type.Reference) {
- translateTo(classGen, methodGen, (ReferenceType) type);
- }
- else {
- ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
- toString(), type.toString());
- classGen.getParser().reportError(Constants.FATAL, err);
- }
- }
-
- /**
- * Expects an integer on the stack and pushes a real.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- RealType type) {
- methodGen.getInstructionList().append(I2D);
- }
-
- /**
- * Expects an integer on the stack and pushes its string value by calling
- * <code>Integer.toString(int i)</code>.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- StringType type) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- il.append(new INVOKESTATIC(cpg.addMethodref(INTEGER_CLASS,
- "toString",
- "(I)" + STRING_SIG)));
- }
-
- /**
- * Expects an integer on the stack and pushes a 0 if its value is 0 and
- * a 1 otherwise.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- BooleanType type) {
- final InstructionList il = methodGen.getInstructionList();
- final BranchHandle falsec = il.append(new IFEQ(null));
- il.append(ICONST_1);
- final BranchHandle truec = il.append(new GOTO(null));
- falsec.setTarget(il.append(ICONST_0));
- truec.setTarget(il.append(NOP));
- }
-
- /**
- * Expects an integer on the stack and translates it to a non-synthesized
- * boolean. It does not push a 0 or a 1 but instead returns branchhandle
- * list to be appended to the false list.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateToDesynthesized
- */
- public FlowList translateToDesynthesized(ClassGenerator classGen,
- MethodGenerator methodGen,
- BooleanType type) {
- final InstructionList il = methodGen.getInstructionList();
- return new FlowList(il.append(new IFEQ(null)));
- }
-
- /**
- * Expects an integer on the stack and pushes a boxed integer.
- * Boxed integers are represented by an instance of
- * <code>java.lang.Integer</code>.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- ReferenceType type) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- il.append(new NEW(cpg.addClass(INTEGER_CLASS)));
- il.append(DUP_X1);
- il.append(SWAP);
- il.append(new INVOKESPECIAL(cpg.addMethodref(INTEGER_CLASS,
- "<init>", "(I)V")));
- }
-
- /**
- * Translates an integer into the Java type denoted by <code>clazz</code>.
- * Expects an integer on the stack and pushes a number of the appropriate
- * type after coercion.
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- Class clazz) {
- final InstructionList il = methodGen.getInstructionList();
- if (clazz == Character.TYPE) {
- il.append(I2C);
- }
- else if (clazz == Byte.TYPE) {
- il.append(I2B);
- }
- else if (clazz == Short.TYPE) {
- il.append(I2S);
- }
- else if (clazz == Integer.TYPE) {
- il.append(NOP);
- }
- else if (clazz == Long.TYPE) {
- il.append(I2L);
- }
- else if (clazz == Float.TYPE) {
- il.append(I2F);
- }
- else if (clazz == Double.TYPE) {
- il.append(I2D);
- }
- // Is Double <: clazz? I.e. clazz in { Double, Number, Object }
- else if (clazz.isAssignableFrom(java.lang.Double.class)) {
- il.append(I2D);
- Type.Real.translateTo(classGen, methodGen, Type.Reference);
- }
- else {
- ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
- toString(), clazz.getName());
- classGen.getParser().reportError(Constants.FATAL, err);
- }
- }
-
- /**
- * Translates an object of this type to its boxed representation.
- */
- public void translateBox(ClassGenerator classGen,
- MethodGenerator methodGen) {
- translateTo(classGen, methodGen, Type.Reference);
- }
-
- /**
- * Translates an object of this type to its unboxed representation.
- */
- public void translateUnBox(ClassGenerator classGen,
- MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- il.append(new CHECKCAST(cpg.addClass(INTEGER_CLASS)));
- final int index = cpg.addMethodref(INTEGER_CLASS,
- INT_VALUE,
- INT_VALUE_SIG);
- il.append(new INVOKEVIRTUAL(index));
- }
-
- public Instruction ADD() {
- return InstructionConstants.IADD;
- }
-
- public Instruction SUB() {
- return InstructionConstants.ISUB;
- }
-
- public Instruction MUL() {
- return InstructionConstants.IMUL;
- }
-
- public Instruction DIV() {
- return InstructionConstants.IDIV;
- }
-
- public Instruction REM() {
- return InstructionConstants.IREM;
- }
-
- public Instruction NEG() {
- return InstructionConstants.INEG;
- }
-
- public Instruction LOAD(int slot) {
- return new ILOAD(slot);
- }
-
- public Instruction STORE(int slot) {
- return new ISTORE(slot);
- }
-
- public BranchInstruction GT(boolean tozero) {
- return tozero ? (BranchInstruction) new IFGT(null) :
- (BranchInstruction) new IF_ICMPGT(null);
- }
-
- public BranchInstruction GE(boolean tozero) {
- return tozero ? (BranchInstruction) new IFGE(null) :
- (BranchInstruction) new IF_ICMPGE(null);
- }
-
- public BranchInstruction LT(boolean tozero) {
- return tozero ? (BranchInstruction) new IFLT(null) :
- (BranchInstruction) new IF_ICMPLT(null);
- }
-
- public BranchInstruction LE(boolean tozero) {
- return tozero ? (BranchInstruction) new IFLE(null) :
- (BranchInstruction) new IF_ICMPLE(null);
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/InternalError.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/InternalError.java
deleted file mode 100644
index 2bb0c3d..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/InternalError.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- * $Id: InternalError.java,v 1.0 2011-08-18 04:34:19 joehw Exp $
- */
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-/**
- * Marks a class of errors in which XSLTC has reached some incorrect internal
- * state from which it cannot recover.
- */
-public class InternalError extends Error {
- /**
- * Construct an <code>InternalError</code> with the specified error message.
- * @param msg the error message
- */
- public InternalError(String msg) {
- super(msg);
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MarkerInstruction.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MarkerInstruction.java
deleted file mode 100644
index e76a3fe..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MarkerInstruction.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- * $Id: MethodGenerator.java,v 1.10 2010-11-01 04:34:19 joehw Exp $
- */
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import com.sun.org.apache.bcel.internal.Constants;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.Instruction;
-import com.sun.org.apache.bcel.internal.generic.Visitor;
-
-/**
- * A special abstract dummy subclass of
- * {@link org.apache.bcel.generic.Instruction} used to mark locations of
- * interest in an {@link com.sun.org.apache.bcel.internal.generic.InstructionList}. It and
- * its subclasses are only used as placeholders, and do not contribute to the
- * actual byte code instruction stream.
- */
-abstract class MarkerInstruction extends Instruction {
- /**
- * Zero-argument constructor. Sets the opcode to an invalid value and
- * sets the length to zero, as it will not be written as part of the
- * generated byte code.
- */
- public MarkerInstruction() {
- super(Constants.UNDEFINED, (short) 0);
- }
-
- /**
- * {@link com.sun.org.apache.bcel.internal.generic.Visitor}s will know nothing about this
- * kind of {@link org.apche.bcel.generic.Instruction}, so this method does
- * nothing.
- */
- public void accept(Visitor v) {
- }
-
- /**
- * The number of JVM stack entries consumed by the instruction.
- * This instruction is just a place holder, so it does not consume any
- * stack entries.
- * @param cpg The {@link com.sun.org.apache.bcel.internal.generic.ConstantPoolGen} for the
- * current {@link com.sun.org.apache.bcel.internal.generic.ClassGen}
- * @return <code>0</code> always
- */
- final public int consumeStack(ConstantPoolGen cpg) {
- return 0;
- }
- /**
- * The number of JVM stack entries produced by the instruction.
- * This instruction is just a place holder, so it does not produce any
- * stack entries.
- * @param cpg The {@link com.sun.org.apache.bcel.internal.generic.ConstantPoolGen} for the
- * current {@link com.sun.org.apache.bcel.internal.generic.ClassGen}
- * @return <code>0</code> always
- */
- final public int produceStack(ConstantPoolGen cpg) {
- return 0;
- }
-
- /**
- * Produce a copy of the instruction. By default a
- * {@link MarkerInstruction} has no parameters, so the base implementation
- * of {@link #copy()} returns the instruction itself.
- * @return The instruction itself.
- */
- public Instruction copy() {
- return this;
- }
- /**
- * Dump instruction as byte code to stream out. A {@link MarkerInstruction}
- * has no effect on the generated byte code so it is never emitted to the
- * output stream.
- * @param out Output stream
- */
- final public void dump(DataOutputStream out) throws IOException {
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MatchGenerator.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MatchGenerator.java
deleted file mode 100644
index 5972beb..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MatchGenerator.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: MatchGenerator.java,v 1.2.4.1 2005/09/05 11:15:21 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-
-import com.sun.org.apache.bcel.internal.generic.ALOAD;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.ILOAD;
-import com.sun.org.apache.bcel.internal.generic.ISTORE;
-import com.sun.org.apache.bcel.internal.generic.Instruction;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.Type;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-public final class MatchGenerator extends MethodGenerator {
- private static int CURRENT_INDEX = 1;
-
- private int _iteratorIndex = INVALID_INDEX;
-
- private final Instruction _iloadCurrent;
- private final Instruction _istoreCurrent;
- private Instruction _aloadDom;
-
- public MatchGenerator(int access_flags, Type return_type,
- Type[] arg_types, String[] arg_names,
- String method_name, String class_name,
- InstructionList il, ConstantPoolGen cp) {
- super(access_flags, return_type, arg_types, arg_names, method_name,
- class_name, il, cp);
-
- _iloadCurrent = new ILOAD(CURRENT_INDEX);
- _istoreCurrent = new ISTORE(CURRENT_INDEX);
- }
-
- public Instruction loadCurrentNode() {
- return _iloadCurrent;
- }
-
- public Instruction storeCurrentNode() {
- return _istoreCurrent;
- }
-
- public int getHandlerIndex() {
- return INVALID_INDEX; // not available
- }
-
- /**
- * Get index of the register where the DOM is stored.
- */
- public Instruction loadDOM() {
- return _aloadDom;
- }
-
- /**
- * Set index where the reference to the DOM is stored.
- */
- public void setDomIndex(int domIndex) {
- _aloadDom = new ALOAD(domIndex);
- }
-
- /**
- * Get index of the register where the current iterator is stored.
- */
- public int getIteratorIndex() {
- return _iteratorIndex;
- }
-
- /**
- * Set index of the register where the current iterator is stored.
- */
- public void setIteratorIndex(int iteratorIndex) {
- _iteratorIndex = iteratorIndex;
- }
-
- public int getLocalIndex(String name) {
- if (name.equals("current")) {
- return CURRENT_INDEX;
- }
- return super.getLocalIndex(name);
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MethodGenerator.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MethodGenerator.java
deleted file mode 100644
index 4a3e753..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MethodGenerator.java
+++ /dev/null
@@ -1,2145 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: MethodGenerator.java,v 1.2.4.1 2005/09/05 11:16:47 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-
-import com.sun.org.apache.bcel.internal.Constants;
-import com.sun.org.apache.bcel.internal.classfile.Field;
-import com.sun.org.apache.bcel.internal.classfile.Method;
-import com.sun.org.apache.bcel.internal.generic.ALOAD;
-import com.sun.org.apache.bcel.internal.generic.ASTORE;
-import com.sun.org.apache.bcel.internal.generic.BranchHandle;
-import com.sun.org.apache.bcel.internal.generic.BranchInstruction;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.DLOAD;
-import com.sun.org.apache.bcel.internal.generic.DSTORE;
-import com.sun.org.apache.bcel.internal.generic.FLOAD;
-import com.sun.org.apache.bcel.internal.generic.FSTORE;
-import com.sun.org.apache.bcel.internal.generic.GETFIELD;
-import com.sun.org.apache.bcel.internal.generic.GOTO;
-import com.sun.org.apache.bcel.internal.generic.ICONST;
-import com.sun.org.apache.bcel.internal.generic.ILOAD;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
-import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
-import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
-import com.sun.org.apache.bcel.internal.generic.ISTORE;
-import com.sun.org.apache.bcel.internal.generic.IfInstruction;
-import com.sun.org.apache.bcel.internal.generic.IndexedInstruction;
-import com.sun.org.apache.bcel.internal.generic.Instruction;
-import com.sun.org.apache.bcel.internal.generic.InstructionConstants;
-import com.sun.org.apache.bcel.internal.generic.InstructionHandle;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.InstructionTargeter;
-import com.sun.org.apache.bcel.internal.generic.LLOAD;
-import com.sun.org.apache.bcel.internal.generic.LSTORE;
-import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
-import com.sun.org.apache.bcel.internal.generic.LocalVariableInstruction;
-import com.sun.org.apache.bcel.internal.generic.MethodGen;
-import com.sun.org.apache.bcel.internal.generic.NEW;
-import com.sun.org.apache.bcel.internal.generic.PUTFIELD;
-import com.sun.org.apache.bcel.internal.generic.RET;
-import com.sun.org.apache.bcel.internal.generic.Select;
-import com.sun.org.apache.bcel.internal.generic.TargetLostException;
-import com.sun.org.apache.bcel.internal.generic.Type;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.Pattern;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Stack;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-public class MethodGenerator extends MethodGen
- implements com.sun.org.apache.xalan.internal.xsltc.compiler.Constants {
- protected static final int INVALID_INDEX = -1;
-
- private static final String START_ELEMENT_SIG
- = "(" + STRING_SIG + ")V";
- private static final String END_ELEMENT_SIG
- = START_ELEMENT_SIG;
-
- private InstructionList _mapTypeSub;
-
- private static final int DOM_INDEX = 1;
- private static final int ITERATOR_INDEX = 2;
- private static final int HANDLER_INDEX = 3;
-
- private static final int MAX_METHOD_SIZE = 65535;
- private static final int MAX_BRANCH_TARGET_OFFSET = 32767;
- private static final int MIN_BRANCH_TARGET_OFFSET = -32768;
-
- private static final int TARGET_METHOD_SIZE = 60000;
- private static final int MINIMUM_OUTLINEABLE_CHUNK_SIZE = 1000;
-
- private Instruction _iloadCurrent;
- private Instruction _istoreCurrent;
- private final Instruction _astoreHandler;
- private final Instruction _aloadHandler;
- private final Instruction _astoreIterator;
- private final Instruction _aloadIterator;
- private final Instruction _aloadDom;
- private final Instruction _astoreDom;
-
- private final Instruction _startElement;
- private final Instruction _endElement;
- private final Instruction _startDocument;
- private final Instruction _endDocument;
- private final Instruction _attribute;
- private final Instruction _uniqueAttribute;
- private final Instruction _namespace;
-
- private final Instruction _setStartNode;
- private final Instruction _reset;
- private final Instruction _nextNode;
-
- private SlotAllocator _slotAllocator;
- private boolean _allocatorInit = false;
- private LocalVariableRegistry _localVariableRegistry;
- /**
- * A mapping between patterns and instruction lists used by
- * test sequences to avoid compiling the same pattern multiple
- * times. Note that patterns whose kernels are "*", "node()"
- * and "@*" can between shared by test sequences.
- */
- private Map<Pattern, InstructionList> _preCompiled = new HashMap<>();
-
-
- public MethodGenerator(int access_flags, Type return_type,
- Type[] arg_types, String[] arg_names,
- String method_name, String class_name,
- InstructionList il, ConstantPoolGen cpg) {
- super(access_flags, return_type, arg_types, arg_names, method_name,
- class_name, il, cpg);
-
- _astoreHandler = new ASTORE(HANDLER_INDEX);
- _aloadHandler = new ALOAD(HANDLER_INDEX);
- _astoreIterator = new ASTORE(ITERATOR_INDEX);
- _aloadIterator = new ALOAD(ITERATOR_INDEX);
- _aloadDom = new ALOAD(DOM_INDEX);
- _astoreDom = new ASTORE(DOM_INDEX);
-
- final int startElement =
- cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
- "startElement",
- START_ELEMENT_SIG);
- _startElement = new INVOKEINTERFACE(startElement, 2);
-
- final int endElement =
- cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
- "endElement",
- END_ELEMENT_SIG);
- _endElement = new INVOKEINTERFACE(endElement, 2);
-
- final int attribute =
- cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
- "addAttribute",
- "("
- + STRING_SIG
- + STRING_SIG
- + ")V");
- _attribute = new INVOKEINTERFACE(attribute, 3);
-
- final int uniqueAttribute =
- cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
- "addUniqueAttribute",
- "("
- + STRING_SIG
- + STRING_SIG
- + "I)V");
- _uniqueAttribute = new INVOKEINTERFACE(uniqueAttribute, 4);
-
- final int namespace =
- cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
- "namespaceAfterStartElement",
- "("
- + STRING_SIG
- + STRING_SIG
- + ")V");
- _namespace = new INVOKEINTERFACE(namespace, 3);
-
- int index = cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
- "startDocument",
- "()V");
- _startDocument = new INVOKEINTERFACE(index, 1);
-
- index = cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
- "endDocument",
- "()V");
- _endDocument = new INVOKEINTERFACE(index, 1);
-
-
- index = cpg.addInterfaceMethodref(NODE_ITERATOR,
- SET_START_NODE,
- SET_START_NODE_SIG);
- _setStartNode = new INVOKEINTERFACE(index, 2);
-
- index = cpg.addInterfaceMethodref(NODE_ITERATOR,
- "reset", "()"+NODE_ITERATOR_SIG);
- _reset = new INVOKEINTERFACE(index, 1);
-
- index = cpg.addInterfaceMethodref(NODE_ITERATOR, NEXT, NEXT_SIG);
- _nextNode = new INVOKEINTERFACE(index, 1);
-
- _slotAllocator = new SlotAllocator();
- _slotAllocator.initialize(getLocalVariableRegistry().getLocals(false));
- _allocatorInit = true;
- }
-
- /**
- * Allocates a local variable. If the slot allocator has already been
- * initialized, then call addLocalVariable2() so that the new variable
- * is known to the allocator. Failing to do this may cause the allocator
- * to return a slot that is already in use.
- */
- public LocalVariableGen addLocalVariable(String name, Type type,
- InstructionHandle start,
- InstructionHandle end)
- {
- LocalVariableGen lvg;
-
- if (_allocatorInit) {
- lvg = addLocalVariable2(name, type, start);
- } else {
- lvg = super.addLocalVariable(name, type, start, end);
- getLocalVariableRegistry().registerLocalVariable(lvg);
- }
- return lvg;
- }
-
- public LocalVariableGen addLocalVariable2(String name, Type type,
- InstructionHandle start)
- {
- LocalVariableGen lvg = super.addLocalVariable(name, type,
- _slotAllocator.allocateSlot(type),
- start, null);
- getLocalVariableRegistry().registerLocalVariable(lvg);
- return lvg;
- }
- private LocalVariableRegistry getLocalVariableRegistry() {
- if (_localVariableRegistry == null) {
- _localVariableRegistry = new LocalVariableRegistry();
- }
-
- return _localVariableRegistry;
- }
-
- /**
- * Keeps track of all local variables used in the method.
- * <p>The
- * {@link MethodGen#addLocalVariable(String,Type,InstructionHandle,InstructionHandle)}</code>
- * and
- * {@link MethodGen#addLocalVariable(String,Type,int,InstructionHandle,InstructionHandle)}</code>
- * methods of {@link MethodGen} will only keep track of
- * {@link LocalVariableGen} object until it'ss removed by a call to
- * {@link MethodGen#removeLocalVariable(LocalVariableGen)}.</p>
- * <p>In order to support efficient copying of local variables to outlined
- * methods by
- * {@link #outline(InstructionHandle,InstructionHandle,String,ClassGenerator)},
- * this class keeps track of all local variables defined by the method.</p>
- */
- protected class LocalVariableRegistry {
- /**
- * <p>A <code>java.lang.ArrayList</code> of all
- * {@link LocalVariableGen}s created for this method, indexed by the
- * slot number of the local variable. The JVM stack frame of local
- * variables is divided into "slots". A single slot can be used to
- * store more than one variable in a method, without regard to type, so
- * long as the byte code keeps the ranges of the two disjoint.</p>
- * <p>If only one registration of use of a particular slot occurs, the
- * corresponding entry of <code>_variables</code> contains the
- * <code>LocalVariableGen</code>; if more than one occurs, the
- * corresponding entry contains all such <code>LocalVariableGen</code>s
- * registered for the same slot; and if none occurs, the entry will be
- * <code>null</code>.
- */
- protected ArrayList _variables = new ArrayList();
-
- /**
- * Maps a name to a {@link LocalVariableGen}
- */
- protected HashMap _nameToLVGMap = new HashMap();
-
- /**
- * Registers a {@link org.apache.bcel.generic.LocalVariableGen}
- * for this method.
- * <p><b>Preconditions:</b>
- * <ul>
- * <li>The range of instructions for <code>lvg</code> does not
- * overlap with the range of instructions for any
- * <code>LocalVariableGen</code> with the same slot index previously
- * registered for this method. <b><em>(Unchecked.)</em></b></li>
- * </ul></p>
- * @param lvg The variable to be registered
- */
- protected void registerLocalVariable(LocalVariableGen lvg) {
- int slot = lvg.getIndex();
-
- int registrySize = _variables.size();
-
- // If the LocalVariableGen uses a slot index beyond any previously
- // encountered, expand the _variables, padding with intervening null
- // entries as required.
- if (slot >= registrySize) {
- for (int i = registrySize; i < slot; i++) {
- _variables.add(null);
- }
- _variables.add(lvg);
- } else {
- // If the LocalVariableGen reuses a slot, make sure the entry
- // in _variables contains an ArrayList and add the newly
- // registered LocalVariableGen to the list. If the entry in
- // _variables just contains null padding, store the
- // LocalVariableGen directly.
- Object localsInSlot = _variables.get(slot);
- if (localsInSlot != null) {
- if (localsInSlot instanceof LocalVariableGen) {
- ArrayList listOfLocalsInSlot = new ArrayList();
- listOfLocalsInSlot.add(localsInSlot);
- listOfLocalsInSlot.add(lvg);
- _variables.set(slot, listOfLocalsInSlot);
- } else {
- ((ArrayList) localsInSlot).add(lvg);
- }
- } else {
- _variables.set(slot, lvg);
- }
- }
-
- registerByName(lvg);
- }
-
- /**
- * <p>Find which {@link LocalVariableGen}, if any, is registered for a
- * particular JVM local stack frame slot at a particular position in the
- * byte code for the method.</p>
- * <p><b>Preconditions:</b>
- * <ul>
- * <li>The {@link InstructionList#setPositions()} has been called for
- * the {@link InstructionList} associated with this
- * {@link MethodGenerator}.</li>
- * </ul></p>
- * @param slot the JVM local stack frame slot number
- * @param offset the position in the byte code
- * @return the <code>LocalVariableGen</code> for the local variable
- * stored in the relevant slot at the relevant offset; <code>null</code>
- * if there is none.
- */
- protected LocalVariableGen lookupRegisteredLocalVariable(int slot,
- int offset) {
- Object localsInSlot = (_variables != null) ? _variables.get(slot)
- : null;
-
- // If this slot index was never used, _variables.get will return
- // null; if it was used once, it will return the LocalVariableGen;
- // more than once it will return an ArrayList of all the
- // LocalVariableGens for variables stored in that slot. For each
- // LocalVariableGen, check whether its range includes the
- // specified offset, and return the first such encountered.
- if (localsInSlot != null) {
- if (localsInSlot instanceof LocalVariableGen) {
- LocalVariableGen lvg = (LocalVariableGen)localsInSlot;
- if (offsetInLocalVariableGenRange(lvg, offset)) {
- return lvg;
- }
- } else {
- ArrayList listOfLocalsInSlot = (ArrayList) localsInSlot;
- int size = listOfLocalsInSlot.size();
-
- for (int i = 0; i < size; i++) {
- LocalVariableGen lvg =
- (LocalVariableGen)listOfLocalsInSlot.get(i);
- if (offsetInLocalVariableGenRange(lvg, offset)) {
- return lvg;
- }
- }
- }
- }
-
- // No local variable stored in the specified slot at the specified
- return null;
- }
-
- /**
- * <p>Set up a mapping of the name of the specified
- * {@link LocalVariableGen} object to the <code>LocalVariableGen</code>
- * itself.</p>
- * <p>This is a bit of a hack. XSLTC is relying on the fact that the
- * name that is being looked up won't be duplicated, which isn't
- * guaranteed. It replaces code which used to call
- * {@link MethodGen#getLocalVariables()} and looped through the
- * <code>LocalVariableGen</code> objects it contained to find the one
- * with the specified name. However, <code>getLocalVariables()</code>
- * has the side effect of setting the start and end for any
- * <code>LocalVariableGen</code> which did not already have them
- * set, which causes problems for outlining..</p>
- * <p>See also {@link #lookUpByName(String)} and
- * {@link #removeByNameTracking(LocalVariableGen)}</P
- * @param lvg a <code>LocalVariableGen</code>
- */
- protected void registerByName(LocalVariableGen lvg) {
- Object duplicateNameEntry = _nameToLVGMap.get(lvg.getName());
-
- if (duplicateNameEntry == null) {
- _nameToLVGMap.put(lvg.getName(), lvg);
- } else {
- ArrayList sameNameList;
-
- if (duplicateNameEntry instanceof ArrayList) {
- sameNameList = (ArrayList) duplicateNameEntry;
- sameNameList.add(lvg);
- } else {
- sameNameList = new ArrayList();
- sameNameList.add(duplicateNameEntry);
- sameNameList.add(lvg);
- }
-
- _nameToLVGMap.put(lvg.getName(), sameNameList);
- }
- }
-
- /**
- * Remove the mapping from the name of the specified
- * {@link LocalVariableGen} to itself.
- * See also {@link #registerByName(LocalVariableGen)} and
- * {@link #lookUpByName(String)}
- * @param lvg a <code>LocalVariableGen</code>
- */
- protected void removeByNameTracking(LocalVariableGen lvg) {
- Object duplicateNameEntry = _nameToLVGMap.get(lvg.getName());
-
- if (duplicateNameEntry instanceof ArrayList) {
- ArrayList sameNameList = (ArrayList) duplicateNameEntry;
- for (int i = 0; i < sameNameList.size(); i++) {
- if (sameNameList.get(i) == lvg) {
- sameNameList.remove(i);
- break;
- }
- }
- } else {
- _nameToLVGMap.remove(lvg);
- }
- }
-
- /**
- * <p>Given the name of a variable, finds a {@link LocalVariableGen}
- * corresponding to it.</p>
- * <p>See also {@link #registerByName(LocalVariableGen)} and
- * {@link #removeByNameTracking(LocalVariableGen)}</p>
- * @param name
- * @return
- */
- protected LocalVariableGen lookUpByName(String name) {
- LocalVariableGen lvg = null;
- Object duplicateNameEntry = _nameToLVGMap.get(name);
-
- if (duplicateNameEntry instanceof ArrayList) {
- ArrayList sameNameList = (ArrayList) duplicateNameEntry;
-
- for (int i = 0; i < sameNameList.size(); i++) {
- lvg = (LocalVariableGen)sameNameList.get(i);
- if (lvg.getName() == name) {
- break;
- }
- }
- } else {
- lvg = (LocalVariableGen) duplicateNameEntry;
- }
-
- return lvg;
- }
-
- /**
- * <p>Gets all {@link LocalVariableGen} objects for this method.</p>
- * <p>When the <code>includeRemoved</code> argument has the value
- * <code>false</code>, this method replaces uses of
- * {@link MethodGen#getLocalVariables()} which has
- * a side-effect of setting the start and end range for any
- * <code>LocalVariableGen</code> if either was <code>null</code>. That
- * side-effect causes problems for outlining of code in XSLTC.
- * @param includeRemoved Specifies whether all local variables ever
- * declared should be returned (<code>true</code>) or only those not
- * removed (<code>false</code>)
- * @return an array of <code>LocalVariableGen</code> containing all the
- * local variables
- */
- protected LocalVariableGen[] getLocals(boolean includeRemoved) {
- LocalVariableGen[] locals = null;
- ArrayList allVarsEverDeclared = new ArrayList();
-
- if (includeRemoved) {
- int slotCount = allVarsEverDeclared.size();
-
- for (int i = 0; i < slotCount; i++) {
- Object slotEntries = _variables.get(i);
- if (slotEntries != null) {
- if (slotEntries instanceof ArrayList) {
- ArrayList slotList = (ArrayList) slotEntries;
-
- for (int j = 0; j < slotList.size(); j++) {
- allVarsEverDeclared.add(slotList.get(i));
- }
- } else {
- allVarsEverDeclared.add(slotEntries);
- }
- }
- }
- } else {
- Iterator nameVarsPairsIter = _nameToLVGMap.entrySet().iterator();
-
- while (nameVarsPairsIter.hasNext()) {
- Map.Entry nameVarsPair =
- (Map.Entry) nameVarsPairsIter.next();
- Object vars = nameVarsPair.getValue();
- if (vars != null) {
- if (vars instanceof ArrayList) {
- ArrayList varsList = (ArrayList) vars;
- for (int i = 0; i < varsList.size(); i++) {
- allVarsEverDeclared.add(varsList.get(i));
- }
- } else {
- allVarsEverDeclared.add(vars);
- }
- }
- }
- }
-
- locals = new LocalVariableGen[allVarsEverDeclared.size()];
- allVarsEverDeclared.toArray(locals);
-
- return locals;
- }
- }
-
- /**
- * Determines whether a particular variable is in use at a particular offset
- * in the byte code for this method.
- * <p><b>Preconditions:</b>
- * <ul>
- * <li>The {@link InstructionList#setPositions()} has been called for the
- * {@link InstructionList} associated with this {@link MethodGenerator}.
- * </li></ul></p>
- * @param lvg the {@link LocalVariableGen} for the variable
- * @param offset the position in the byte code
- * @return <code>true</code> if and only if the specified variable is in
- * use at the particular byte code offset.
- */
- boolean offsetInLocalVariableGenRange(LocalVariableGen lvg, int offset) {
- InstructionHandle lvgStart = lvg.getStart();
- InstructionHandle lvgEnd = lvg.getEnd();
-
- // If no start handle is recorded for the LocalVariableGen, it is
- // assumed to be in use from the beginning of the method.
- if (lvgStart == null) {
- lvgStart = getInstructionList().getStart();
- }
-
- // If no end handle is recorded for the LocalVariableGen, it is assumed
- // to be in use to the end of the method.
- if (lvgEnd == null) {
- lvgEnd = getInstructionList().getEnd();
- }
-
- // Does the range of the instruction include the specified offset?
- // Note that the InstructionHandle.getPosition method returns the
- // offset of the beginning of an instruction. A LocalVariableGen's
- // range includes the end instruction itself, so that instruction's
- // length must be taken into consideration in computing whether the
- // varible is in range at a particular offset.
- return ((lvgStart.getPosition() <= offset)
- && (lvgEnd.getPosition()
- + lvgEnd.getInstruction().getLength() >= offset));
- }
-
- public void removeLocalVariable(LocalVariableGen lvg) {
- _slotAllocator.releaseSlot(lvg);
- getLocalVariableRegistry().removeByNameTracking(lvg);
- super.removeLocalVariable(lvg);
- }
-
- public Instruction loadDOM() {
- return _aloadDom;
- }
-
- public Instruction storeDOM() {
- return _astoreDom;
- }
-
- public Instruction storeHandler() {
- return _astoreHandler;
- }
-
- public Instruction loadHandler() {
- return _aloadHandler;
- }
-
- public Instruction storeIterator() {
- return _astoreIterator;
- }
-
- public Instruction loadIterator() {
- return _aloadIterator;
- }
-
- public final Instruction setStartNode() {
- return _setStartNode;
- }
-
- public final Instruction reset() {
- return _reset;
- }
-
- public final Instruction nextNode() {
- return _nextNode;
- }
-
- public final Instruction startElement() {
- return _startElement;
- }
-
- public final Instruction endElement() {
- return _endElement;
- }
-
- public final Instruction startDocument() {
- return _startDocument;
- }
-
- public final Instruction endDocument() {
- return _endDocument;
- }
-
- public final Instruction attribute() {
- return _attribute;
- }
-
- public final Instruction uniqueAttribute() {
- return _uniqueAttribute;
- }
-
- public final Instruction namespace() {
- return _namespace;
- }
-
- public Instruction loadCurrentNode() {
- if (_iloadCurrent == null) {
- int idx = getLocalIndex("current");
- if (idx > 0)
- _iloadCurrent = new ILOAD(idx);
- else
- _iloadCurrent = new ICONST(0);
- }
- return _iloadCurrent;
- }
-
- public Instruction storeCurrentNode() {
- return _istoreCurrent != null
- ? _istoreCurrent
- : (_istoreCurrent = new ISTORE(getLocalIndex("current")));
- }
-
- /** by default context node is the same as current node. MK437 */
- public Instruction loadContextNode() {
- return loadCurrentNode();
- }
-
- public Instruction storeContextNode() {
- return storeCurrentNode();
- }
-
- public int getLocalIndex(String name) {
- return getLocalVariable(name).getIndex();
- }
-
- public LocalVariableGen getLocalVariable(String name) {
- return getLocalVariableRegistry().lookUpByName(name);
- }
-
- public void setMaxLocals() {
-
- // Get the current number of local variable slots
- int maxLocals = super.getMaxLocals();
- int prevLocals = maxLocals;
-
- // Get numer of actual variables
- final LocalVariableGen[] localVars = super.getLocalVariables();
- if (localVars != null) {
- if (localVars.length > maxLocals)
- maxLocals = localVars.length;
- }
-
- // We want at least 5 local variable slots (for parameters)
- if (maxLocals < 5) maxLocals = 5;
-
- super.setMaxLocals(maxLocals);
- }
-
- /**
- * Add a pre-compiled pattern to this mode.
- */
- public void addInstructionList(Pattern pattern, InstructionList ilist) {
- _preCompiled.put(pattern, ilist);
- }
-
- /**
- * Get the instruction list for a pre-compiled pattern. Used by
- * test sequences to avoid compiling patterns more than once.
- */
- public InstructionList getInstructionList(Pattern pattern) {
- return _preCompiled.get(pattern);
- }
-
- /**
- * Used to keep track of an outlineable chunk of instructions in the
- * current method. See {@link OutlineableChunkStart} and
- * {@link OutlineableChunkEnd} for more information.
- */
- private class Chunk implements Comparable {
- /**
- * {@link InstructionHandle} of the first instruction in the outlineable
- * chunk.
- */
- private InstructionHandle m_start;
-
- /**
- * {@link org.apache.bcel.generic.InstructionHandle} of the first
- * instruction in the outlineable chunk.
- */
- private InstructionHandle m_end;
-
- /**
- * Number of bytes in the instructions contained in this outlineable
- * chunk.
- */
- private int m_size;
-
- /**
- * <p>Constructor for an outlineable {@link MethodGenerator.Chunk}.</p>
- * <p><b>Preconditions:</b>
- * <ul>
- * <li>The {@link InstructionList#setPositions()} has been called for
- * the {@link InstructionList} associated with this
- * {@link MethodGenerator}.</li>
- * </ul></p>
- * @param start The {@link InstructionHandle} of the first
- * instruction in the outlineable chunk.
- * @param end The {@link InstructionHandle} of the last
- * instruction in the outlineable chunk.
- */
- Chunk(InstructionHandle start, InstructionHandle end) {
- m_start = start;
- m_end = end;
- m_size = end.getPosition() - start.getPosition();
- }
-
- /**
- * Determines whether this outlineable {@link MethodGenerator.Chunk} is
- * followed immediately by the argument
- * <code>MethodGenerator.Chunk</code>, with no other intervening
- * instructions, including {@link OutlineableChunkStart} or
- * {@link OutlineableChunkEnd} instructions.
- * @param neighbour an outlineable {@link MethodGenerator.Chunk}
- * @return <code>true</code> if and only if the argument chunk
- * immediately follows <code>this</code> chunk
- */
- boolean isAdjacentTo(Chunk neighbour) {
- return getChunkEnd().getNext() == neighbour.getChunkStart();
- }
-
- /**
- * Getter method for the start of this {@linke MethodGenerator.Chunk}
- * @return the {@link org.apache.bcel.generic.InstructionHandle} of the
- * start of this chunk
- */
- InstructionHandle getChunkStart() {
- return m_start;
- }
-
- /**
- * Getter method for the end of this {@link MethodGenerator.Chunk}
- * @return the {@link InstructionHandle} of the start of this chunk
- */
- InstructionHandle getChunkEnd() {
- return m_end;
- }
-
- /**
- * The size of this {@link MethodGenerator.Chunk}
- * @return the number of bytes in the byte code represented by this
- * chunk.
- */
- int getChunkSize() {
- return m_size;
- }
-
- /**
- * Implements the <code>java.util.Comparable.compareTo(Object)</code>
- * method.
- * @return
- * <ul>
- * <li>A positive <code>int</code> if the length of <code>this</code>
- * chunk in bytes is greater than that of <code>comparand</code></li>
- * <li>A negative <code>int</code> if the length of <code>this</code>
- * chunk in bytes is less than that of <code>comparand</code></li>
- * <li>Zero, otherwise.</li>
- * </ul>
- */
- public int compareTo(Object comparand) {
- return getChunkSize() - ((Chunk)comparand).getChunkSize();
- }
- }
-
- /**
- * Find the outlineable chunks in this method that would be the best choices
- * to outline, based on size and position in the method.
- * @param classGen The {@link ClassGen} with which the generated methods
- * will be associated
- * @param totalMethodSize the size of the bytecode in the original method
- * @return a <code>java.util.ArrayList</code> containing the
- * {@link MethodGenerator.Chunk}s that may be outlined from this method
- */
- private ArrayList getCandidateChunks(ClassGenerator classGen,
- int totalMethodSize) {
- Iterator instructions = getInstructionList().iterator();
- ArrayList candidateChunks = new ArrayList();
- ArrayList currLevelChunks = new ArrayList();
- Stack subChunkStack = new Stack();
- boolean openChunkAtCurrLevel = false;
- boolean firstInstruction = true;
-
- InstructionHandle currentHandle;
-
- if (m_openChunks != 0) {
- String msg =
- (new ErrorMsg(ErrorMsg.OUTLINE_ERR_UNBALANCED_MARKERS))
- .toString();
- throw new InternalError(msg);
- }
-
- // Scan instructions in the method, keeping track of the nesting level
- // of outlineable chunks.
- //
- // currLevelChunks
- // keeps track of the child chunks of a chunk. For each chunk,
- // there will be a pair of entries: the InstructionHandles for the
- // start and for the end of the chunk
- // subChunkStack
- // a stack containing the partially accumulated currLevelChunks for
- // each chunk that's still open at the current position in the
- // InstructionList.
- // candidateChunks
- // the list of chunks which have been accepted as candidates chunks
- // for outlining
- do {
- // Get the next instruction. The loop will perform one extra
- // iteration after it reaches the end of the InstructionList, with
- // currentHandle set to null.
- currentHandle = instructions.hasNext()
- ? (InstructionHandle) instructions.next()
- : null;
- Instruction inst =
- (currentHandle != null) ? currentHandle.getInstruction()
- : null;
-
- // At the first iteration, create a chunk representing all the
- // code in the method. This is done just to simplify the logic -
- // this chunk can never be outlined because it will be too big.
- if (firstInstruction) {
- openChunkAtCurrLevel = true;
- currLevelChunks.add(currentHandle);
- firstInstruction = false;
- }
-
- // Found a new chunk
- if (inst instanceof OutlineableChunkStart) {
- // If last MarkerInstruction encountered was an
- // OutlineableChunkStart, this represents the first chunk
- // nested within that previous chunk - push the list of chunks
- // from the outer level onto the stack
- if (openChunkAtCurrLevel) {
- subChunkStack.push(currLevelChunks);
- currLevelChunks = new ArrayList();
- }
-
- openChunkAtCurrLevel = true;
- currLevelChunks.add(currentHandle);
- // Close off an open chunk
- } else if (currentHandle == null
- || inst instanceof OutlineableChunkEnd) {
- ArrayList nestedSubChunks = null;
-
- // If the last MarkerInstruction encountered was an
- // OutlineableChunkEnd, it means that the current instruction
- // marks the end of a chunk that contained child chunks.
- // Those children might need to be examined below in case they
- // are better candidates for outlining than the current chunk.
- if (!openChunkAtCurrLevel) {
- nestedSubChunks = currLevelChunks;
- currLevelChunks = (ArrayList)subChunkStack.pop();
- }
-
- // Get the handle for the start of this chunk (the last entry
- // in currLevelChunks)
- InstructionHandle chunkStart =
- (InstructionHandle) currLevelChunks.get(
- currLevelChunks.size()-1);
-
- int chunkEndPosition =
- (currentHandle != null) ? currentHandle.getPosition()
- : totalMethodSize;
- int chunkSize = chunkEndPosition - chunkStart.getPosition();
-
- // Two ranges of chunk size to consider:
- //
- // 1. [0,TARGET_METHOD_SIZE]
- // Keep this chunk in consideration as a candidate,
- // and ignore its subchunks, if any - there's nothing to be
- // gained by outlining both the current chunk and its
- // children!
- //
- // 2. (TARGET_METHOD_SIZE,+infinity)
- // Ignore this chunk - it's too big. Add its subchunks
- // as candidates, after merging adjacent chunks to produce
- // chunks that are as large as possible
- if (chunkSize <= TARGET_METHOD_SIZE) {
- currLevelChunks.add(currentHandle);
- } else {
- if (!openChunkAtCurrLevel) {
- int childChunkCount = nestedSubChunks.size() / 2;
- if (childChunkCount > 0) {
- Chunk[] childChunks = new Chunk[childChunkCount];
-
- // Gather all the child chunks of the current chunk
- for (int i = 0; i < childChunkCount; i++) {
- InstructionHandle start =
- (InstructionHandle) nestedSubChunks
- .get(i*2);
- InstructionHandle end =
- (InstructionHandle) nestedSubChunks
- .get(i*2+1);
-
- childChunks[i] = new Chunk(start, end);
- }
-
- // Merge adjacent siblings
- ArrayList mergedChildChunks =
- mergeAdjacentChunks(childChunks);
-
- // Add chunks that mean minimum size requirements
- // to the list of candidate chunks for outlining
- for (int i = 0; i < mergedChildChunks.size(); i++) {
- Chunk mergedChunk =
- (Chunk)mergedChildChunks.get(i);
- int mergedSize = mergedChunk.getChunkSize();
-
- if (mergedSize >= MINIMUM_OUTLINEABLE_CHUNK_SIZE
- && mergedSize <= TARGET_METHOD_SIZE) {
- candidateChunks.add(mergedChunk);
- }
- }
- }
- }
-
- // Drop the chunk which was too big
- currLevelChunks.remove(currLevelChunks.size() - 1);
- }
-
- // currLevelChunks contains pairs of InstructionHandles. If
- // its size is an odd number, the loop has encountered the
- // start of a chunk at this level, but not its end.
- openChunkAtCurrLevel = ((currLevelChunks.size() & 0x1) == 1);
- }
-
- } while (currentHandle != null);
-
- return candidateChunks;
- }
-
- /**
- * Merge adjacent sibling chunks to produce larger candidate chunks for
- * outlining
- * @param chunks array of sibling {@link MethodGenerator.Chunk}s that are
- * under consideration for outlining. Chunks must be in
- * the order encountered in the {@link InstructionList}
- * @return a <code>java.util.ArrayList</code> of
- * <code>MethodGenerator.Chunk</code>s maximally merged
- */
- private ArrayList mergeAdjacentChunks(Chunk[] chunks) {
- int[] adjacencyRunStart = new int[chunks.length];
- int[] adjacencyRunLength = new int[chunks.length];
- boolean[] chunkWasMerged = new boolean[chunks.length];
-
- int maximumRunOfChunks = 0;
- int startOfCurrentRun;
- int numAdjacentRuns = 0;
-
- ArrayList mergedChunks = new ArrayList();
-
- startOfCurrentRun = 0;
-
- // Loop through chunks, and record in adjacencyRunStart where each
- // run of adjacent chunks begins and how many are in that run. For
- // example, given chunks A B C D E F, if A is adjacent to B, but not
- // to C, and C, D, E and F are all adjacent,
- // adjacencyRunStart[0] == 0; adjacencyRunLength[0] == 2
- // adjacencyRunStart[1] == 2; adjacencyRunLength[1] == 4
- for (int i = 1; i < chunks.length; i++) {
- if (!chunks[i-1].isAdjacentTo(chunks[i])) {
- int lengthOfRun = i - startOfCurrentRun;
-
- // Track the longest run of chunks found
- if (maximumRunOfChunks < lengthOfRun) {
- maximumRunOfChunks = lengthOfRun;
- }
-
- if (lengthOfRun > 1 ) {
- adjacencyRunLength[numAdjacentRuns] = lengthOfRun;
- adjacencyRunStart[numAdjacentRuns] = startOfCurrentRun;
- numAdjacentRuns++;
- }
-
- startOfCurrentRun = i;
- }
- }
-
- if (chunks.length - startOfCurrentRun > 1) {
- int lengthOfRun = chunks.length - startOfCurrentRun;
-
- // Track the longest run of chunks found
- if (maximumRunOfChunks < lengthOfRun) {
- maximumRunOfChunks = lengthOfRun;
- }
-
- adjacencyRunLength[numAdjacentRuns] =
- chunks.length - startOfCurrentRun;
- adjacencyRunStart[numAdjacentRuns] = startOfCurrentRun;
- numAdjacentRuns++;
- }
-
- // Try merging adjacent chunks to come up with better sized chunks for
- // outlining. This algorithm is not optimal, but it should be
- // reasonably fast. Consider an example like this, where four chunks
- // of the sizes specified in brackets are adjacent. The best way of
- // combining these chunks would be to merge the first pair and merge
- // the last three to form two chunks, but the algorithm will merge the
- // three in the middle instead, leaving three chunks in all.
- // [25000] [25000] [20000] [1000] [20000]
-
- // Start by trying to merge the maximum number of adjacent chunks, and
- // work down from there.
- for (int numToMerge = maximumRunOfChunks; numToMerge>1; numToMerge--) {
- // Look at each run of adjacent chunks
- for (int run = 0; run < numAdjacentRuns; run++) {
- int runStart = adjacencyRunStart[run];
- int runEnd = runStart + adjacencyRunLength[run] - 1;
-
- boolean foundChunksToMerge = false;
-
- // Within the current run of adjacent chunks, look at all
- // "subruns" of length numToMerge, until we run out or find
- // a subrun that can be merged.
- for (int mergeStart = runStart;
- mergeStart+numToMerge-1 <= runEnd && !foundChunksToMerge;
- mergeStart++) {
- int mergeEnd = mergeStart + numToMerge - 1;
- int mergeSize = 0;
-
- // Find out how big the subrun is
- for (int j = mergeStart; j <= mergeEnd; j++) {
- mergeSize = mergeSize + chunks[j].getChunkSize();
- }
-
- // If the current subrun is small enough to outline,
- // merge it, and split the remaining chunks in the run
- if (mergeSize <= TARGET_METHOD_SIZE) {
- foundChunksToMerge = true;
-
- for (int j = mergeStart; j <= mergeEnd; j++) {
- chunkWasMerged[j] = true;
- }
-
- mergedChunks.add(
- new Chunk(chunks[mergeStart].getChunkStart(),
- chunks[mergeEnd].getChunkEnd()));
-
- // Adjust the length of the current run of adjacent
- // chunks to end at the newly merged chunk...
- adjacencyRunLength[run] =
- adjacencyRunStart[run] - mergeStart;
-
- int trailingRunLength = runEnd - mergeEnd;
-
- // and any chunks that follow the newly merged chunk
- // in the current run of adjacent chunks form another
- // new run of adjacent chunks
- if (trailingRunLength >= 2) {
- adjacencyRunStart[numAdjacentRuns] = mergeEnd + 1;
- adjacencyRunLength[numAdjacentRuns] =
- trailingRunLength;
- numAdjacentRuns++;
- }
- }
- }
- }
- }
-
- // Make a final pass for any chunk that wasn't merged with a sibling
- // and include it in the list of chunks after merging.
- for (int i = 0; i < chunks.length; i++) {
- if (!chunkWasMerged[i]) {
- mergedChunks.add(chunks[i]);
- }
- }
-
- return mergedChunks;
- }
-
- /**
- * Breaks up the IL for this {@link MethodGenerator} into separate
- * outlined methods so that no method exceeds the 64KB limit on the length
- * of the byte code associated with a method.
- * @param classGen The {@link ClassGen} with which the generated methods
- * will be associated
- * @param originalMethodSize The number of bytes of bytecode represented by
- * the {@link InstructionList} of this method
- * @return an array of the outlined <code>Method</code>s and the original
- * method itself
- */
- public Method[] outlineChunks(ClassGenerator classGen,
- int originalMethodSize) {
- ArrayList methodsOutlined = new ArrayList();
- int currentMethodSize = originalMethodSize;
-
- int outlinedCount = 0;
- boolean moreMethodsOutlined;
- String originalMethodName = getName();
-
- // Special handling for initialization methods. No other methods can
- // include the less than and greater than characters in their names,
- // so we munge the names here.
- if (originalMethodName.equals("<init>")) {
- originalMethodName = "$lt$init$gt$";
- } else if (originalMethodName.equals("<clinit>")) {
- originalMethodName = "$lt$clinit$gt$";
- }
-
- // Loop until the original method comes in under the JVM limit or
- // the loop was unable to outline any more methods
- do {
- // Get all the best candidates for outlining, and sort them in
- // ascending order of size
- ArrayList candidateChunks = getCandidateChunks(classGen,
- currentMethodSize);
- Collections.sort(candidateChunks);
-
- moreMethodsOutlined = false;
-
- // Loop over the candidates for outlining, from the largest to the
- // smallest and outline them one at a time, until the loop has
- // outlined all or the original method comes in under the JVM
- // limit on the size of a method.
- for (int i = candidateChunks.size()-1;
- i >= 0 && currentMethodSize > TARGET_METHOD_SIZE;
- i--) {
- Chunk chunkToOutline = (Chunk)candidateChunks.get(i);
-
- methodsOutlined.add(outline(chunkToOutline.getChunkStart(),
- chunkToOutline.getChunkEnd(),
- originalMethodName + "$outline$"
- + outlinedCount,
- classGen));
- outlinedCount++;
- moreMethodsOutlined = true;
-
- InstructionList il = getInstructionList();
- InstructionHandle lastInst = il.getEnd();
- il.setPositions();
-
- // Check the size of the method now
- currentMethodSize =
- lastInst.getPosition()
- + lastInst.getInstruction().getLength();
- }
- } while (moreMethodsOutlined && currentMethodSize > TARGET_METHOD_SIZE);
-
- // Outlining failed to reduce the size of the current method
- // sufficiently. Throw an internal error.
- if (currentMethodSize > MAX_METHOD_SIZE) {
- String msg = (new ErrorMsg(ErrorMsg.OUTLINE_ERR_METHOD_TOO_BIG))
- .toString();
- throw new InternalError(msg);
- }
-
- Method[] methodsArr = new Method[methodsOutlined.size() + 1];
- methodsOutlined.toArray(methodsArr);
-
- methodsArr[methodsOutlined.size()] = getThisMethod();
-
- return methodsArr;
- }
-
- /**
- * Given an outlineable chunk of code in the current {@link MethodGenerator}
- * move ("outline") the chunk to a new method, and replace the chunk in the
- * old method with a reference to that new method. No
- * {@link OutlineableChunkStart} or {@link OutlineableChunkEnd} instructions
- * are copied.
- * @param first The {@link InstructionHandle} of the first instruction in
- * the chunk to outline
- * @param last The <code>InstructionHandle</code> of the last instruction in
- * the chunk to outline
- * @param outlinedMethodName The name of the new method
- * @param classGen The {@link ClassGenerator} of which the original
- * and new methods will be members
- * @return The new {@link Method} containing the outlined code.
- */
- private Method outline(InstructionHandle first, InstructionHandle last,
- String outlinedMethodName, ClassGenerator classGen) {
- // We're not equipped to deal with exception handlers yet. Bail out!
- if (getExceptionHandlers().length != 0) {
- String msg = (new ErrorMsg(ErrorMsg.OUTLINE_ERR_TRY_CATCH))
- .toString();
- throw new InternalError(msg);
- }
-
- int outlineChunkStartOffset = first.getPosition();
- int outlineChunkEndOffset = last.getPosition()
- + last.getInstruction().getLength();
-
- ConstantPoolGen cpg = getConstantPool();
-
- // Create new outlined method with signature:
- //
- // private final outlinedMethodName(CopyLocals copyLocals);
- //
- // CopyLocals is an object that is used to copy-in/copy-out local
- // variables that are used by the outlined method. Only locals whose
- // value is potentially set or referenced outside the range of the
- // chunk that is being outlined will be represented in CopyLocals. The
- // type of the variable for copying local variables is actually
- // generated to be unique - it is not named CopyLocals.
- //
- // The outlined method never needs to be referenced outside of this
- // class, and will never be overridden, so we mark it private final.
- final InstructionList newIL = new InstructionList();
-
- final XSLTC xsltc = classGen.getParser().getXSLTC();
- final String argTypeName = xsltc.getHelperClassName();
- final Type[] argTypes =
- new Type[] {(new ObjectType(argTypeName)).toJCType()};
- final String argName = "copyLocals";
- final String[] argNames = new String[] {argName};
-
- int methodAttributes = ACC_PRIVATE | ACC_FINAL;
- final boolean isStaticMethod = (getAccessFlags() & ACC_STATIC) != 0;
-
- if (isStaticMethod) {
- methodAttributes = methodAttributes | ACC_STATIC;
- }
-
- final MethodGenerator outlinedMethodGen =
- new MethodGenerator(methodAttributes,
- com.sun.org.apache.bcel.internal.generic.Type.VOID,
- argTypes, argNames, outlinedMethodName,
- getClassName(), newIL, cpg);
-
- // Create class for copying local variables to the outlined method.
- // The fields the class will need to contain will be determined as the
- // code in the outlineable chunk is examined.
- ClassGenerator copyAreaCG
- = new ClassGenerator(argTypeName, OBJECT_CLASS, argTypeName+".java",
- ACC_FINAL | ACC_PUBLIC | ACC_SUPER, null,
- classGen.getStylesheet()) {
- public boolean isExternal() {
- return true;
- }
- };
- ConstantPoolGen copyAreaCPG = copyAreaCG.getConstantPool();
- copyAreaCG.addEmptyConstructor(ACC_PUBLIC);
-
- // Number of fields in the copy class
- int copyAreaFieldCount = 0;
-
- // The handle for the instruction after the last one to be outlined.
- // Note that this should never end up being null. An outlineable chunk
- // won't contain a RETURN instruction or other branch out of the chunk,
- // and the JVM specification prohibits code in a method from just
- // "falling off the end" so this should always point to a valid handle.
- InstructionHandle limit = last.getNext();
-
- // InstructionLists for copying values into and out of an instance of
- // CopyLocals:
- // oldMethCoypInIL - from locals in old method into an instance
- // of the CopyLocals class (oldMethCopyInIL)
- // oldMethCopyOutIL - from CopyLocals back into locals in the old
- // method
- // newMethCopyInIL - from CopyLocals into locals in the new
- // method
- // newMethCopyOutIL - from locals in new method into the instance
- // of the CopyLocals class
- InstructionList oldMethCopyInIL = new InstructionList();
- InstructionList oldMethCopyOutIL = new InstructionList();
- InstructionList newMethCopyInIL = new InstructionList();
- InstructionList newMethCopyOutIL = new InstructionList();
-
- // Allocate instance of class in which we'll copy in or copy out locals
- // and make two copies: last copy is used to invoke constructor;
- // other two are used for references to fields in the CopyLocals object
- InstructionHandle outlinedMethodCallSetup =
- oldMethCopyInIL.append(new NEW(cpg.addClass(argTypeName)));
- oldMethCopyInIL.append(InstructionConstants.DUP);
- oldMethCopyInIL.append(InstructionConstants.DUP);
- oldMethCopyInIL.append(
- new INVOKESPECIAL(cpg.addMethodref(argTypeName, "<init>", "()V")));
-
- // Generate code to invoke the new outlined method, and place the code
- // on oldMethCopyOutIL
- InstructionHandle outlinedMethodRef;
-
- if (isStaticMethod) {
- outlinedMethodRef =
- oldMethCopyOutIL.append(
- new INVOKESTATIC(cpg.addMethodref(
- classGen.getClassName(),
- outlinedMethodName,
- outlinedMethodGen.getSignature())));
- } else {
- oldMethCopyOutIL.append(InstructionConstants.THIS);
- oldMethCopyOutIL.append(InstructionConstants.SWAP);
- outlinedMethodRef =
- oldMethCopyOutIL.append(
- new INVOKEVIRTUAL(cpg.addMethodref(
- classGen.getClassName(),
- outlinedMethodName,
- outlinedMethodGen.getSignature())));
- }
-
- // Used to keep track of the first in a sequence of
- // OutlineableChunkStart instructions
- boolean chunkStartTargetMappingsPending = false;
- InstructionHandle pendingTargetMappingHandle = null;
-
- // Used to keep track of the last instruction that was copied
- InstructionHandle lastCopyHandle = null;
-
- // Keeps track of the mapping from instruction handles in the old
- // method to instruction handles in the outlined method. Only need
- // to track instructions that are targeted by something else in the
- // generated BCEL
- HashMap targetMap = new HashMap();
-
- // Keeps track of the mapping from local variables in the old method
- // to local variables in the outlined method.
- HashMap localVarMap = new HashMap();
-
- HashMap revisedLocalVarStart = new HashMap();
- HashMap revisedLocalVarEnd = new HashMap();
-
- // Pass 1: Make copies of all instructions, append them to the new list
- // and associate old instruction references with the new ones, i.e.,
- // a 1:1 mapping. The special marker instructions are not copied.
- // Also, identify local variables whose values need to be copied into or
- // out of the new outlined method, and builds up targetMap and
- // localVarMap as described above. The code identifies those local
- // variables first so that they can have fixed slots in the stack
- // frame for the outlined method assigned them ahead of all those
- // variables that don't need to exist for the entirety of the outlined
- // method invocation.
- for (InstructionHandle ih = first; ih != limit; ih = ih.getNext()) {
- Instruction inst = ih.getInstruction();
-
- // MarkerInstructions are not copied, so if something else targets
- // one, the targetMap will point to the nearest copied sibling
- // InstructionHandle: for an OutlineableChunkEnd, the nearest
- // preceding sibling; for an OutlineableChunkStart, the nearest
- // following sibling.
- if (inst instanceof MarkerInstruction) {
- if (ih.hasTargeters()) {
- if (inst instanceof OutlineableChunkEnd) {
- targetMap.put(ih, lastCopyHandle);
- } else {
- if (!chunkStartTargetMappingsPending) {
- chunkStartTargetMappingsPending = true;
- pendingTargetMappingHandle = ih;
- }
- }
- }
- } else {
- // Copy the instruction and append it to the outlined method's
- // InstructionList.
- Instruction c = inst.copy(); // Use clone for shallow copy
-
- if (c instanceof BranchInstruction) {
- lastCopyHandle = newIL.append((BranchInstruction)c);
- } else {
- lastCopyHandle = newIL.append(c);
- }
-
- if (c instanceof LocalVariableInstruction
- || c instanceof RET) {
- // For any instruction that touches a local variable,
- // check whether the local variable's value needs to be
- // copied into or out of the outlined method. If so,
- // generate the code to perform the necessary copying, and
- // use localVarMap to map the variable in the original
- // method to the variable in the new method.
- IndexedInstruction lvi = (IndexedInstruction)c;
- int oldLocalVarIndex = lvi.getIndex();
- LocalVariableGen oldLVG =
- getLocalVariableRegistry()
- .lookupRegisteredLocalVariable(oldLocalVarIndex,
- ih.getPosition());
- LocalVariableGen newLVG =
- (LocalVariableGen)localVarMap.get(oldLVG);
-
- // Has the code already mapped this local variable to a
- // local in the new method?
- if (localVarMap.get(oldLVG) == null) {
- // Determine whether the local variable needs to be
- // copied into or out of the outlined by checking
- // whether the range of instructions in which the
- // variable is accessible is outside the range of
- // instructions in the outlineable chunk.
- // Special case a chunk start offset of zero: a local
- // variable live at that position must be a method
- // parameter, so the code doesn't need to check whether
- // the variable is live before that point; being live
- // at offset zero is sufficient to know that the value
- // must be copied in to the outlined method.
- boolean copyInLocalValue =
- offsetInLocalVariableGenRange(oldLVG,
- (outlineChunkStartOffset != 0)
- ? outlineChunkStartOffset-1
- : 0);
- boolean copyOutLocalValue =
- offsetInLocalVariableGenRange(oldLVG,
- outlineChunkEndOffset+1);
-
- // For any variable that needs to be copied into or out
- // of the outlined method, create a field in the
- // CopyLocals class, and generate the necessary code for
- // copying the value.
- if (copyInLocalValue || copyOutLocalValue) {
- String varName = oldLVG.getName();
- Type varType = oldLVG.getType();
- newLVG = outlinedMethodGen.addLocalVariable(varName,
- varType,
- null,
- null);
- int newLocalVarIndex = newLVG.getIndex();
- String varSignature = varType.getSignature();
-
- // Record the mapping from the old local to the new
- localVarMap.put(oldLVG, newLVG);
-
- copyAreaFieldCount++;
- String copyAreaFieldName =
- "field" + copyAreaFieldCount;
- copyAreaCG.addField(
- new Field(ACC_PUBLIC,
- copyAreaCPG.addUtf8(copyAreaFieldName),
- copyAreaCPG.addUtf8(varSignature),
- null, copyAreaCPG.getConstantPool()));
-
- int fieldRef = cpg.addFieldref(argTypeName,
- copyAreaFieldName,
- varSignature);
-
- if (copyInLocalValue) {
- // Generate code for the old method to store the
- // value of the local into the correct field in
- // CopyLocals prior to invocation of the
- // outlined method.
- oldMethCopyInIL.append(
- InstructionConstants.DUP);
- InstructionHandle copyInLoad =
- oldMethCopyInIL.append(
- loadLocal(oldLocalVarIndex, varType));
- oldMethCopyInIL.append(new PUTFIELD(fieldRef));
-
- // If the end of the live range of the old
- // variable was in the middle of the outlined
- // chunk. Make the load of its value the new
- // end of its range.
- if (!copyOutLocalValue) {
- revisedLocalVarEnd.put(oldLVG, copyInLoad);
- }
-
- // Generate code for start of the outlined
- // method to copy the value from a field in
- // CopyLocals to the new local in the outlined
- // method
- newMethCopyInIL.append(
- InstructionConstants.ALOAD_1);
- newMethCopyInIL.append(new GETFIELD(fieldRef));
- newMethCopyInIL.append(
- storeLocal(newLocalVarIndex, varType));
- }
-
- if (copyOutLocalValue) {
- // Generate code for the end of the outlined
- // method to copy the value from the new local
- // variable into a field in CopyLocals
- // method
- newMethCopyOutIL.append(
- InstructionConstants.ALOAD_1);
- newMethCopyOutIL.append(
- loadLocal(newLocalVarIndex, varType));
- newMethCopyOutIL.append(new PUTFIELD(fieldRef));
-
- // Generate code to copy the value from a field
- // in CopyLocals into a local in the original
- // method following invocation of the outlined
- // method.
- oldMethCopyOutIL.append(
- InstructionConstants.DUP);
- oldMethCopyOutIL.append(new GETFIELD(fieldRef));
- InstructionHandle copyOutStore =
- oldMethCopyOutIL.append(
- storeLocal(oldLocalVarIndex, varType));
-
- // If the start of the live range of the old
- // variable was in the middle of the outlined
- // chunk. Make this store into it the new start
- // of its range.
- if (!copyInLocalValue) {
- revisedLocalVarStart.put(oldLVG,
- copyOutStore);
- }
- }
- }
- }
- }
-
- if (ih.hasTargeters()) {
- targetMap.put(ih, lastCopyHandle);
- }
-
- // If this is the first instruction copied following a sequence
- // of OutlineableChunkStart instructions, indicate that the
- // sequence of old instruction all map to this newly created
- // instruction
- if (chunkStartTargetMappingsPending) {
- do {
- targetMap.put(pendingTargetMappingHandle,
- lastCopyHandle);
- pendingTargetMappingHandle =
- pendingTargetMappingHandle.getNext();
- } while(pendingTargetMappingHandle != ih);
-
- chunkStartTargetMappingsPending = false;
- }
- }
- }
-
- // Pass 2: Walk old and new instruction lists, updating branch targets
- // and local variable references in the new list
- InstructionHandle ih = first;
- InstructionHandle ch = newIL.getStart();
-
- while (ch != null) {
- // i == old instruction; c == copied instruction
- Instruction i = ih.getInstruction();
- Instruction c = ch.getInstruction();
-
- if (i instanceof BranchInstruction) {
- BranchInstruction bc = (BranchInstruction)c;
- BranchInstruction bi = (BranchInstruction)i;
- InstructionHandle itarget = bi.getTarget(); // old target
-
- // New target must be in targetMap
- InstructionHandle newTarget =
- (InstructionHandle)targetMap.get(itarget);
-
- bc.setTarget(newTarget);
-
- // Handle LOOKUPSWITCH or TABLESWITCH which may have many
- // target instructions
- if (bi instanceof Select) {
- InstructionHandle[] itargets = ((Select)bi).getTargets();
- InstructionHandle[] ctargets = ((Select)bc).getTargets();
-
- // Update all targets
- for (int j=0; j < itargets.length; j++) {
- ctargets[j] =
- (InstructionHandle)targetMap.get(itargets[j]);
- }
- }
- } else if (i instanceof LocalVariableInstruction
- || i instanceof RET) {
- // For any instruction that touches a local variable,
- // map the location of the variable in the original
- // method to its location in the new method.
- IndexedInstruction lvi = (IndexedInstruction)c;
- int oldLocalVarIndex = lvi.getIndex();
- LocalVariableGen oldLVG =
- getLocalVariableRegistry()
- .lookupRegisteredLocalVariable(oldLocalVarIndex,
- ih.getPosition());
- LocalVariableGen newLVG =
- (LocalVariableGen)localVarMap.get(oldLVG);
- int newLocalVarIndex;
-
- if (newLVG == null) {
- // Create new variable based on old variable - use same
- // name and type, but we will let the variable be active
- // for the entire outlined method.
- // LocalVariableGen oldLocal = oldLocals[oldLocalVarIndex];
- String varName = oldLVG.getName();
- Type varType = oldLVG.getType();
- newLVG = outlinedMethodGen.addLocalVariable(varName,
- varType,
- null,
- null);
- newLocalVarIndex = newLVG.getIndex();
- localVarMap.put(oldLVG, newLVG);
-
- // The old variable's live range was wholly contained in
- // the outlined chunk. There should no longer be stores
- // of values into it or loads of its value, so we can just
- // mark its live range as the reference to the outlined
- // method.
- revisedLocalVarStart.put(oldLVG, outlinedMethodRef);
- revisedLocalVarEnd.put(oldLVG, outlinedMethodRef);
- } else {
- newLocalVarIndex = newLVG.getIndex();
- }
- lvi.setIndex(newLocalVarIndex);
- }
-
- // If the old instruction marks the end of the range of a local
- // variable, make sure that any slots on the stack reserved for
- // local variables are made available for reuse by calling
- // MethodGenerator.removeLocalVariable
- if (ih.hasTargeters()) {
- InstructionTargeter[] targeters = ih.getTargeters();
-
- for (int idx = 0; idx < targeters.length; idx++) {
- InstructionTargeter targeter = targeters[idx];
-
- if (targeter instanceof LocalVariableGen
- && ((LocalVariableGen)targeter).getEnd()==ih) {
- Object newLVG = localVarMap.get(targeter);
- if (newLVG != null) {
- outlinedMethodGen.removeLocalVariable(
- (LocalVariableGen)newLVG);
- }
- }
- }
- }
-
- // If the current instruction in the original list was a marker,
- // it wasn't copied, so don't advance through the list of copied
- // instructions yet.
- if (!(i instanceof MarkerInstruction)) {
- ch = ch.getNext();
- }
- ih = ih.getNext();
-
- }
-
- // POP the reference to the CopyLocals object from the stack
- oldMethCopyOutIL.append(InstructionConstants.POP);
-
- // Now that the generation of the outlined code is complete, update
- // the old local variables with new start and end ranges, as required.
- Iterator revisedLocalVarStartPairIter = revisedLocalVarStart.entrySet()
- .iterator();
- while (revisedLocalVarStartPairIter.hasNext()) {
- Map.Entry lvgRangeStartPair =
- (Map.Entry)revisedLocalVarStartPairIter.next();
- LocalVariableGen lvg = (LocalVariableGen)lvgRangeStartPair.getKey();
- InstructionHandle startInst =
- (InstructionHandle)lvgRangeStartPair.getValue();
-
- lvg.setStart(startInst);
-
- }
-
- Iterator revisedLocalVarEndPairIter = revisedLocalVarEnd.entrySet()
- .iterator();
- while (revisedLocalVarEndPairIter.hasNext()) {
- Map.Entry lvgRangeEndPair =
- (Map.Entry)revisedLocalVarEndPairIter.next();
- LocalVariableGen lvg = (LocalVariableGen)lvgRangeEndPair.getKey();
- InstructionHandle endInst =
- (InstructionHandle)lvgRangeEndPair.getValue();
-
- lvg.setEnd(endInst);
- }
-
- xsltc.dumpClass(copyAreaCG.getJavaClass());
-
- // Assemble the instruction lists so that the old method invokes the
- // new outlined method
- InstructionList oldMethodIL = getInstructionList();
-
- oldMethodIL.insert(first, oldMethCopyInIL);
- oldMethodIL.insert(first, oldMethCopyOutIL);
-
- // Insert the copying code into the outlined method
- newIL.insert(newMethCopyInIL);
- newIL.append(newMethCopyOutIL);
- newIL.append(InstructionConstants.RETURN);
-
- // Discard instructions in outlineable chunk from old method
- try {
- oldMethodIL.delete(first, last);
- } catch (TargetLostException e) {
- InstructionHandle[] targets = e.getTargets();
- // If there were still references to old instructions lingering,
- // clean those up. The only instructions targetting the deleted
- // instructions should have been part of the chunk that was just
- // deleted, except that instructions might branch to the start of
- // the outlined chunk; similarly, all the live ranges of local
- // variables should have been adjusted, except for unreferenced
- // variables.
- for (int i = 0; i < targets.length; i++) {
- InstructionHandle lostTarget = targets[i];
- InstructionTargeter[] targeters = lostTarget.getTargeters();
- for (int j = 0; j < targeters.length; j++) {
- if (targeters[j] instanceof LocalVariableGen) {
- LocalVariableGen lvgTargeter =
- (LocalVariableGen) targeters[j];
- // In the case of any lingering variable references,
- // just make the live range point to the outlined
- // function reference. Such variables should be unused
- // anyway.
- if (lvgTargeter.getStart() == lostTarget) {
- lvgTargeter.setStart(outlinedMethodRef);
- }
- if (lvgTargeter.getEnd() == lostTarget) {
- lvgTargeter.setEnd(outlinedMethodRef);
- }
- } else {
- targeters[j].updateTarget(lostTarget,
- outlinedMethodCallSetup);
- }
- }
- }
- }
-
- // Make a copy for the new method of all exceptions that might be thrown
- String[] exceptions = getExceptions();
- for (int i = 0; i < exceptions.length; i++) {
- outlinedMethodGen.addException(exceptions[i]);
- }
-
- return outlinedMethodGen.getThisMethod();
- }
-
- /**
- * Helper method to generate an instance of a subclass of
- * {@link LoadInstruction} based on the specified {@link Type} that will
- * load the specified local variable
- * @param index the JVM stack frame index of the variable that is to be
- * loaded
- * @param type the {@link Type} of the variable
- * @return the generated {@link LoadInstruction}
- */
- private static Instruction loadLocal(int index, Type type) {
- if (type == Type.BOOLEAN) {
- return new ILOAD(index);
- } else if (type == Type.INT) {
- return new ILOAD(index);
- } else if (type == Type.SHORT) {
- return new ILOAD(index);
- } else if (type == Type.LONG) {
- return new LLOAD(index);
- } else if (type == Type.BYTE) {
- return new ILOAD(index);
- } else if (type == Type.CHAR) {
- return new ILOAD(index);
- } else if (type == Type.FLOAT) {
- return new FLOAD(index);
- } else if (type == Type.DOUBLE) {
- return new DLOAD(index);
- } else {
- return new ALOAD(index);
- }
- }
-
- /**
- * Helper method to generate an instance of a subclass of
- * {@link StoreInstruction} based on the specified {@link Type} that will
- * store a value in the specified local variable
- * @param index the JVM stack frame index of the variable that is to be
- * stored
- * @param type the {@link Type} of the variable
- * @return the generated {@link StoredInstruction}
- */
- private static Instruction storeLocal(int index, Type type) {
- if (type == Type.BOOLEAN) {
- return new ISTORE(index);
- } else if (type == Type.INT) {
- return new ISTORE(index);
- } else if (type == Type.SHORT) {
- return new ISTORE(index);
- } else if (type == Type.LONG) {
- return new LSTORE(index);
- } else if (type == Type.BYTE) {
- return new ISTORE(index);
- } else if (type == Type.CHAR) {
- return new ISTORE(index);
- } else if (type == Type.FLOAT) {
- return new FSTORE(index);
- } else if (type == Type.DOUBLE) {
- return new DSTORE(index);
- } else {
- return new ASTORE(index);
- }
- }
-
- /**
- * Track the number of outlineable chunks seen.
- */
- private int m_totalChunks = 0;
-
- /**
- * Track the number of outlineable chunks started but not yet ended. Used
- * to detect imbalances in byte code generation.
- */
- private int m_openChunks = 0;
-
- /**
- * Mark the end of the method's
- * {@link InstructionList} as the start of an outlineable chunk of code.
- * The outlineable chunk begins after the {@link InstructionHandle} that is
- * at the end of the method's {@link InstructionList}, or at the start of
- * the method if the <code>InstructionList</code> is empty.
- * See {@link OutlineableChunkStart} for more information.
- */
- public void markChunkStart() {
- // m_chunkTree.markChunkStart();
- getInstructionList()
- .append(OutlineableChunkStart.OUTLINEABLECHUNKSTART);
- m_totalChunks++;
- m_openChunks++;
- }
-
- /**
- * Mark the end of an outlineable chunk of code. See
- * {@link OutlineableChunkStart} for more information.
- */
- public void markChunkEnd() {
- // m_chunkTree.markChunkEnd();
- getInstructionList()
- .append(OutlineableChunkEnd.OUTLINEABLECHUNKEND);
- m_openChunks--;
- if (m_openChunks < 0) {
- String msg = (new ErrorMsg(ErrorMsg.OUTLINE_ERR_UNBALANCED_MARKERS))
- .toString();
- throw new InternalError(msg);
- }
- }
-
- /**
- * <p>Get all {@link Method}s generated by this {@link MethodGenerator}.
- * The {@link MethodGen#getMethod()} only returns a single
- * <code>Method</code> object. This method takes into account the Java
- * Virtual Machine Specification limit of 64KB on the size of a method, and
- * may return more than one <code>Method</code>.</p>
- * <p>If the code associated with the <code>MethodGenerator</code> would
- * exceed the 64KB limit, this method will attempt to split the code in
- * the {@link InstructionList} associated with this
- * <code>MethodGenerator</code> into several methods.</p>
- * @param classGen the {@link ClassGenerator} of which these methods are
- * members
- * @return an array of all the <code>Method</code>s generated
- */
- Method[] getGeneratedMethods(ClassGenerator classGen) {
- Method[] generatedMethods;
- InstructionList il = getInstructionList();
- InstructionHandle last = il.getEnd();
-
- il.setPositions();
-
- int instructionListSize =
- last.getPosition() + last.getInstruction().getLength();
-
- // Need to look for any branch target offsets that exceed the range
- // [-32768,32767]
- if (instructionListSize > MAX_BRANCH_TARGET_OFFSET) {
- boolean ilChanged = widenConditionalBranchTargetOffsets();
-
- // If any branch instructions needed widening, recompute the size
- // of the byte code for the method
- if (ilChanged) {
- il.setPositions();
- last = il.getEnd();
- instructionListSize =
- last.getPosition() + last.getInstruction().getLength();
- }
- }
-
- if (instructionListSize > MAX_METHOD_SIZE) {
- generatedMethods = outlineChunks(classGen, instructionListSize);
- } else {
- generatedMethods = new Method[] {getThisMethod()};
- }
- return generatedMethods;
- }
-
- protected Method getThisMethod() {
- stripAttributes(true);
- setMaxLocals();
- setMaxStack();
- removeNOPs();
-
- return getMethod();
- }
- /**
- * <p>Rewrites branches to avoid the JVM limits of relative branch
- * offsets. There is no need to invoke this method if the bytecode for the
- * {@link MethodGenerator} does not exceed 32KB.</p>
- * <p>The Java Virtual Machine Specification permits the code portion of a
- * method to be up to 64KB in length. However, some control transfer
- * instructions specify relative offsets as a signed 16-bit quantity,
- * limiting the range to a subset of the instructions that might be in a
- * method.</p>
- * <p>The <code>TABLESWITCH</code> and <code>LOOKUPSWITCH</code>
- * instructions always use 32-bit signed relative offsets, so they are
- * immune to this problem.</p>
- * <p>The <code>GOTO</code> and <code>JSR</code>
- * instructions come in two forms, one of which uses 16-bit relative
- * offsets, and the other of which uses 32-bit relative offsets. The BCEL
- * library decides whether to use the wide form of <code>GOTO</code> or
- * <code>JSR</code>instructions based on the relative offset of the target
- * of the instruction without any intervention by the user of the
- * library.</p>
- * <p>This leaves the various conditional branch instructions,
- * <code>IFEQ</code>, <code>IFNULL</code>, <code>IF_ICMPEQ</code>,
- * <em>et al.</em>, all of which use 16-bit signed relative offsets, with no
- * 32-bit wide form available.</p>
- * <p>This method scans the {@link InstructionList} associated with this
- * {@link MethodGenerator} and finds all conditional branch instructions
- * that might exceed the 16-bit limitation for relative branch offsets.
- * The logic of each such instruction is inverted, and made to target the
- * instruction which follows it. An unconditional branch to the original
- * target of the instruction is then inserted between the conditional
- * branch and the instruction which previously followed it. The
- * unconditional branch is permitted to have a 16-bit or a 32-bit relative
- * offset, as described above. For example,
- * <code>
- * 1234: NOP
- * ...
- * 55278: IFEQ -54044
- * 55280: NOP
- * </code>
- * is rewritten as
- * <code>
- * 1234: NOP
- * ...
- * 55278: IFNE 7
- * 55280: GOTO_W -54046
- * 55285: NOP
- * </code></p>
- * <p><b>Preconditions:</b>
- * <ul><li>The {@link InstructionList#setPositions()} has been called for
- * the <code>InstructionList</code> associated with this
- * <code>MethodGenerator</code>.
- * </li></ul></p>
- * <p><b>Postconditions:</b>
- * <ul><li>Any further changes to the <code>InstructionList</code> for this
- * <code>MethodGenerator</code> will invalidate the changes made by this
- * method.</li></ul>
- * </p>
- * @return <code>true</code> if the <code>InstructionList</code> was
- * modified; <code>false</code> otherwise
- * @see The Java Virtual Machine Specification, Second Edition
- */
- boolean widenConditionalBranchTargetOffsets() {
- boolean ilChanged = false;
- int maxOffsetChange = 0;
- InstructionList il = getInstructionList();
-
- // Loop through all the instructions, finding those that would be
- // affected by inserting new instructions in the InstructionList, and
- // calculating the maximum amount by which the relative offset between
- // two instructions could possibly change.
- // In part this loop duplicates code in
- // org.apache.bcel.generic.InstructionList.setPosition(), which does
- // this to determine whether to use 16-bit or 32-bit offsets for GOTO
- // and JSR instructions. Ideally, that method would do the same for
- // conditional branch instructions, but it doesn't, so we duplicate the
- // processing here.
- for (InstructionHandle ih = il.getStart();
- ih != null;
- ih = ih.getNext()) {
- Instruction inst = ih.getInstruction();
-
- switch (inst.getOpcode()) {
- // Instructions that may have 16-bit or 32-bit branch targets.
- // The size of the branch offset might increase by two bytes.
- case Constants.GOTO:
- case Constants.JSR:
- maxOffsetChange = maxOffsetChange + 2;
- break;
- // Instructions that contain padding for alignment purposes
- // Up to three bytes of padding might be needed. For greater
- // accuracy, we should be able to discount any padding already
- // added to these instructions by InstructionList.setPosition(),
- // their APIs do not expose that information.
- case Constants.TABLESWITCH:
- case Constants.LOOKUPSWITCH:
- maxOffsetChange = maxOffsetChange + 3;
- break;
- // Instructions that might be rewritten by this method as a
- // conditional branch followed by an unconditional branch.
- // The unconditional branch would require five bytes.
- case Constants.IF_ACMPEQ:
- case Constants.IF_ACMPNE:
- case Constants.IF_ICMPEQ:
- case Constants.IF_ICMPGE:
- case Constants.IF_ICMPGT:
- case Constants.IF_ICMPLE:
- case Constants.IF_ICMPLT:
- case Constants.IF_ICMPNE:
- case Constants.IFEQ:
- case Constants.IFGE:
- case Constants.IFGT:
- case Constants.IFLE:
- case Constants.IFLT:
- case Constants.IFNE:
- case Constants.IFNONNULL:
- case Constants.IFNULL:
- maxOffsetChange = maxOffsetChange + 5;
- break;
- }
- }
-
- // Now that the maximum number of bytes by which the method might grow
- // has been determined, look for conditional branches to see which
- // might possibly exceed the 16-bit relative offset.
- for (InstructionHandle ih = il.getStart();
- ih != null;
- ih = ih.getNext()) {
- Instruction inst = ih.getInstruction();
-
- if (inst instanceof IfInstruction) {
- IfInstruction oldIfInst = (IfInstruction)inst;
- BranchHandle oldIfHandle = (BranchHandle)ih;
- InstructionHandle target = oldIfInst.getTarget();
- int relativeTargetOffset = target.getPosition()
- - oldIfHandle.getPosition();
-
- // Consider the worst case scenario in which the conditional
- // branch and its target are separated by all the instructions
- // in the method that might increase in size. If that results
- // in a relative offset that cannot be represented as a 32-bit
- // signed quantity, rewrite the instruction as described above.
- if ((relativeTargetOffset - maxOffsetChange
- < MIN_BRANCH_TARGET_OFFSET)
- || (relativeTargetOffset + maxOffsetChange
- > MAX_BRANCH_TARGET_OFFSET)) {
- // Invert the logic of the IF instruction, and append
- // that to the InstructionList following the original IF
- // instruction
- InstructionHandle nextHandle = oldIfHandle.getNext();
- IfInstruction invertedIfInst = oldIfInst.negate();
- BranchHandle invertedIfHandle = il.append(oldIfHandle,
- invertedIfInst);
-
- // Append an unconditional branch to the target of the
- // original IF instruction after the new IF instruction
- BranchHandle gotoHandle = il.append(invertedIfHandle,
- new GOTO(target));
-
- // If the original IF was the last instruction in
- // InstructionList, add a new no-op to act as the target
- // of the new IF
- if (nextHandle == null) {
- nextHandle = il.append(gotoHandle, NOP);
- }
-
- // Make the new IF instruction branch around the GOTO
- invertedIfHandle.updateTarget(target, nextHandle);
-
- // If anything still "points" to the old IF instruction,
- // make adjustments to refer to either the new IF or GOTO
- // instruction
- if (oldIfHandle.hasTargeters()) {
- InstructionTargeter[] targeters =
- oldIfHandle.getTargeters();
-
- for (int i = 0; i < targeters.length; i++) {
- InstructionTargeter targeter = targeters[i];
- // Ideally, one should simply be able to use
- // InstructionTargeter.updateTarget to change
- // references to the old IF instruction to the new
- // IF instruction. However, if a LocalVariableGen
- // indicated the old IF marked the end of the range
- // in which the IF variable is in use, the live
- // range of the variable must extend to include the
- // newly created GOTO instruction. The need for
- // this sort of specific knowledge of an
- // implementor of the InstructionTargeter interface
- // makes the code more fragile. Future implementors
- // of the interface might have similar requirements
- // which wouldn't be accommodated seemlessly.
- if (targeter instanceof LocalVariableGen) {
- LocalVariableGen lvg =
- (LocalVariableGen) targeter;
- if (lvg.getStart() == oldIfHandle) {
- lvg.setStart(invertedIfHandle);
- } else if (lvg.getEnd() == oldIfHandle) {
- lvg.setEnd(gotoHandle);
- }
- } else {
- targeter.updateTarget(oldIfHandle,
- invertedIfHandle);
- }
- }
- }
-
- try {
- il.delete(oldIfHandle);
- } catch (TargetLostException tle) {
- // This can never happen - we updated the list of
- // instructions that target the deleted instruction
- // prior to deleting it.
- String msg =
- new ErrorMsg(ErrorMsg.OUTLINE_ERR_DELETED_TARGET,
- tle.getMessage()).toString();
- throw new InternalError(msg);
- }
-
- // Adjust the pointer in the InstructionList to point after
- // the newly inserted IF instruction
- ih = gotoHandle;
-
- // Indicate that this method rewrote at least one IF
- ilChanged = true;
- }
- }
- }
-
- // Did this method rewrite any IF instructions?
- return ilChanged;
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MethodType.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MethodType.java
deleted file mode 100644
index 8cd0308..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MethodType.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: MethodType.java,v 1.2.4.1 2005/09/05 11:18:05 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-
-import java.util.Vector;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-public final class MethodType extends Type {
- private final Type _resultType;
- private final Vector _argsType;
-
- public MethodType(Type resultType) {
- _argsType = null;
- _resultType = resultType;
- }
-
- public MethodType(Type resultType, Type arg1) {
- if (arg1 != Type.Void) {
- _argsType = new Vector();
- _argsType.addElement(arg1);
- }
- else {
- _argsType = null;
- }
- _resultType = resultType;
- }
-
- public MethodType(Type resultType, Type arg1, Type arg2) {
- _argsType = new Vector(2);
- _argsType.addElement(arg1);
- _argsType.addElement(arg2);
- _resultType = resultType;
- }
-
- public MethodType(Type resultType, Type arg1, Type arg2, Type arg3) {
- _argsType = new Vector(3);
- _argsType.addElement(arg1);
- _argsType.addElement(arg2);
- _argsType.addElement(arg3);
- _resultType = resultType;
- }
-
- public MethodType(Type resultType, Vector argsType) {
- _resultType = resultType;
- _argsType = argsType.size() > 0 ? argsType : null;
- }
-
- public String toString() {
- StringBuffer result = new StringBuffer("method{");
- if (_argsType != null) {
- final int count = _argsType.size();
- for (int i=0; i<count; i++) {
- result.append(_argsType.elementAt(i));
- if (i != (count-1)) result.append(',');
- }
- }
- else {
- result.append("void");
- }
- result.append('}');
- return result.toString();
- }
-
- public String toSignature() {
- return toSignature("");
- }
-
- /**
- * Returns the signature of this method that results by adding
- * <code>lastArgSig</code> to the end of the argument list.
- */
- public String toSignature(String lastArgSig) {
- final StringBuffer buffer = new StringBuffer();
- buffer.append('(');
- if (_argsType != null) {
- final int n = _argsType.size();
- for (int i = 0; i < n; i++) {
- buffer.append(((Type)_argsType.elementAt(i)).toSignature());
- }
- }
- return buffer
- .append(lastArgSig)
- .append(')')
- .append(_resultType.toSignature())
- .toString();
- }
-
- public com.sun.org.apache.bcel.internal.generic.Type toJCType() {
- return null; // should never be called
- }
-
- public boolean identicalTo(Type other) {
- boolean result = false;
- if (other instanceof MethodType) {
- final MethodType temp = (MethodType) other;
- if (_resultType.identicalTo(temp._resultType)) {
- final int len = argsCount();
- result = len == temp.argsCount();
- for (int i = 0; i < len && result; i++) {
- final Type arg1 = (Type)_argsType.elementAt(i);
- final Type arg2 = (Type)temp._argsType.elementAt(i);
- result = arg1.identicalTo(arg2);
- }
- }
- }
- return result;
- }
-
- public int distanceTo(Type other) {
- int result = Integer.MAX_VALUE;
- if (other instanceof MethodType) {
- final MethodType mtype = (MethodType) other;
- if (_argsType != null) {
- final int len = _argsType.size();
- if (len == mtype._argsType.size()) {
- result = 0;
- for (int i = 0; i < len; i++) {
- Type arg1 = (Type) _argsType.elementAt(i);
- Type arg2 = (Type) mtype._argsType.elementAt(i);
- final int temp = arg1.distanceTo(arg2);
- if (temp == Integer.MAX_VALUE) {
- result = temp; // return MAX_VALUE
- break;
- }
- else {
- result += arg1.distanceTo(arg2);
- }
- }
- }
- }
- else if (mtype._argsType == null) {
- result = 0; // both methods have no args
- }
- }
- return result;
- }
-
- public Type resultType() {
- return _resultType;
- }
-
- public Vector argsType() {
- return _argsType;
- }
-
- public int argsCount() {
- return _argsType == null ? 0 : _argsType.size();
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MultiHashtable.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MultiHashtable.java
deleted file mode 100644
index 9ef16a0..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MultiHashtable.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: MultiHashtable.java,v 1.2.4.1 2005/09/05 11:18:51 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @param <K>
- * @param <V>
- */
-public final class MultiHashtable<K,V> {
- static final long serialVersionUID = -6151608290510033572L;
-
- private final Map<K, Set<V>> map = new HashMap<>();
- private boolean modifiable = true;
-
- /**
- * Associates the specified key with a set of values. If the map previously
- * contained a mapping for the key, the value is added to the set.
- * @param key key with which the specified value is to be associated
- * @param value value to be added to a set that is associated with the specified key
- * @return the set that is associated with the specified key.
- * @throw UnsupportedOperationException is the MultiHashtable is not modifiable.
- */
- public Set<V> put(K key, V value) {
- if (modifiable) {
- Set<V> set = map.get(key);
- if (set == null) {
- set = new HashSet<>();
- map.put(key, set);
- }
- set.add(value);
- return set;
- }
- throw new UnsupportedOperationException("The MultiHashtable instance is not modifiable.");
- }
-
- /**
- * Maps a key to a value in a set that is associated with the specified key.
- * The mapping is performed by evaluating whether an item in the set equals
- * the specified value.
- *
- * @param key key with which the specified value is to be associated
- * @param value value in a set that is associated with the specified key
- * @return the item in the set if a match is found.
- */
- public V maps(K key, V value) {
- if (key == null) return null;
- final Set<V> set = map.get(key);
- if (set != null) {
- for (V v : set) {
- if (v.equals(value)) {
- return v;
- }
- }
- }
- return null;
- }
-
- /**
- * Makes the MultiHashtable unmodifiable. This method allows modules to set the table
- * as "read-only" so that only query operation, that is maps, is allowed. Any attempts
- * to modify the returned map result in an UnsupportedOperationException.
- */
- public void makeUnmodifiable() {
- modifiable = false;
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NamedMethodGenerator.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NamedMethodGenerator.java
deleted file mode 100644
index 0913a7b..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NamedMethodGenerator.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: NamedMethodGenerator.java,v 1.2.4.1 2005/09/05 11:19:56 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-
-import com.sun.org.apache.bcel.internal.generic.ALOAD;
-import com.sun.org.apache.bcel.internal.generic.ASTORE;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.Instruction;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.Type;
-
-/**
- * This class is used for named templates. Named template methods have access
- * to the DOM, the current iterator, the handler and the current node.
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-public final class NamedMethodGenerator extends MethodGenerator {
- protected static final int CURRENT_INDEX = 4;
-
- // The index of the first parameter (after dom/iterator/handler/current)
- private static final int PARAM_START_INDEX = 5;
-
- public NamedMethodGenerator(int access_flags, Type return_type,
- Type[] arg_types, String[] arg_names,
- String method_name, String class_name,
- InstructionList il, ConstantPoolGen cp) {
- super(access_flags, return_type, arg_types, arg_names, method_name,
- class_name, il, cp);
- }
-
- public int getLocalIndex(String name) {
- if (name.equals("current")) {
- return CURRENT_INDEX;
- }
- return super.getLocalIndex(name);
- }
-
- public Instruction loadParameter(int index) {
- return new ALOAD(index + PARAM_START_INDEX);
- }
-
- public Instruction storeParameter(int index) {
- return new ASTORE(index + PARAM_START_INDEX);
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NodeCounterGenerator.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NodeCounterGenerator.java
deleted file mode 100644
index 68ddc89..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NodeCounterGenerator.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: NodeCounterGenerator.java,v 1.2.4.1 2005/09/05 11:20:48 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-
-import com.sun.org.apache.bcel.internal.generic.ALOAD;
-import com.sun.org.apache.bcel.internal.generic.Instruction;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.Stylesheet;
-
-/**
- * This class implements auxiliary classes needed to compile
- * patterns in <tt>xsl:number</tt>. These classes inherit from
- * {Any,Single,Multiple}NodeCounter and override the
- * <tt>matchFrom</tt> and <tt>matchCount</tt> methods.
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-public final class NodeCounterGenerator extends ClassGenerator {
- private Instruction _aloadTranslet;
-
- public NodeCounterGenerator(String className,
- String superClassName,
- String fileName,
- int accessFlags,
- String[] interfaces,
- Stylesheet stylesheet) {
- super(className, superClassName, fileName,
- accessFlags, interfaces, stylesheet);
- }
-
- /**
- * Set the index of the register where "this" (the pointer to
- * the translet) is stored.
- */
- public void setTransletIndex(int index) {
- _aloadTranslet = new ALOAD(index);
- }
-
- /**
- * The index of the translet pointer within the execution of
- * matchFrom or matchCount.
- * Overridden from ClassGenerator.
- */
- public Instruction loadTranslet() {
- return _aloadTranslet;
- }
-
- /**
- * Returns <tt>true</tt> since this class is external to the
- * translet.
- */
- public boolean isExternal() {
- return true;
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NodeSetType.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NodeSetType.java
deleted file mode 100644
index 616fd70..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NodeSetType.java
+++ /dev/null
@@ -1,331 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: NodeSetType.java,v 1.2.4.1 2005/09/05 11:21:45 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-
-import com.sun.org.apache.bcel.internal.generic.ALOAD;
-import com.sun.org.apache.bcel.internal.generic.ASTORE;
-import com.sun.org.apache.bcel.internal.generic.BranchHandle;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.GOTO;
-import com.sun.org.apache.bcel.internal.generic.IFLT;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
-import com.sun.org.apache.bcel.internal.generic.Instruction;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.Constants;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.FlowList;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-public final class NodeSetType extends Type {
- protected NodeSetType() {}
-
- public String toString() {
- return "node-set";
- }
-
- public boolean identicalTo(Type other) {
- return this == other;
- }
-
- public String toSignature() {
- return NODE_ITERATOR_SIG;
- }
-
- public com.sun.org.apache.bcel.internal.generic.Type toJCType() {
- return new com.sun.org.apache.bcel.internal.generic.ObjectType(NODE_ITERATOR);
- }
-
- /**
- * Translates a node-set into an object of internal type
- * <code>type</code>. The translation to int is undefined
- * since node-sets are always converted to
- * reals in arithmetic expressions.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- Type type) {
- if (type == Type.String) {
- translateTo(classGen, methodGen, (StringType) type);
- }
- else if (type == Type.Boolean) {
- translateTo(classGen, methodGen, (BooleanType) type);
- }
- else if (type == Type.Real) {
- translateTo(classGen, methodGen, (RealType) type);
- }
- else if (type == Type.Node) {
- translateTo(classGen, methodGen, (NodeType) type);
- }
- else if (type == Type.Reference) {
- translateTo(classGen, methodGen, (ReferenceType) type);
- }
- else if (type == Type.Object) {
- translateTo(classGen, methodGen, (ObjectType) type);
- }
- else {
- ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
- toString(), type.toString());
- classGen.getParser().reportError(Constants.FATAL, err);
- }
- }
-
- /**
- * Translates an external Java Class into an internal type.
- * Expects the Java object on the stack, pushes the internal type
- */
- public void translateFrom(ClassGenerator classGen,
- MethodGenerator methodGen, Class clazz)
- {
-
- InstructionList il = methodGen.getInstructionList();
- ConstantPoolGen cpg = classGen.getConstantPool();
- if (clazz.getName().equals("org.w3c.dom.NodeList")) {
- // w3c NodeList is on the stack from the external Java function call.
- // call BasisFunction to consume NodeList and leave Iterator on
- // the stack.
- il.append(classGen.loadTranslet()); // push translet onto stack
- il.append(methodGen.loadDOM()); // push DOM onto stack
- final int convert = cpg.addMethodref(BASIS_LIBRARY_CLASS,
- "nodeList2Iterator",
- "("
- + "Lorg/w3c/dom/NodeList;"
- + TRANSLET_INTF_SIG
- + DOM_INTF_SIG
- + ")" + NODE_ITERATOR_SIG );
- il.append(new INVOKESTATIC(convert));
- }
- else if (clazz.getName().equals("org.w3c.dom.Node")) {
- // w3c Node is on the stack from the external Java function call.
- // call BasisLibrary.node2Iterator() to consume Node and leave
- // Iterator on the stack.
- il.append(classGen.loadTranslet()); // push translet onto stack
- il.append(methodGen.loadDOM()); // push DOM onto stack
- final int convert = cpg.addMethodref(BASIS_LIBRARY_CLASS,
- "node2Iterator",
- "("
- + "Lorg/w3c/dom/Node;"
- + TRANSLET_INTF_SIG
- + DOM_INTF_SIG
- + ")" + NODE_ITERATOR_SIG );
- il.append(new INVOKESTATIC(convert));
- }
- else {
- ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
- toString(), clazz.getName());
- classGen.getParser().reportError(Constants.FATAL, err);
- }
- }
-
-
- /**
- * Translates a node-set into a synthesized boolean.
- * The boolean value of a node-set is "true" if non-empty
- * and "false" otherwise. Notice that the
- * function getFirstNode() is called in translateToDesynthesized().
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- BooleanType type) {
- final InstructionList il = methodGen.getInstructionList();
- FlowList falsel = translateToDesynthesized(classGen, methodGen, type);
- il.append(ICONST_1);
- final BranchHandle truec = il.append(new GOTO(null));
- falsel.backPatch(il.append(ICONST_0));
- truec.setTarget(il.append(NOP));
- }
-
- /**
- * Translates a node-set into a string. The string value of a node-set is
- * value of its first element.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- StringType type) {
- final InstructionList il = methodGen.getInstructionList();
- getFirstNode(classGen, methodGen);
- il.append(DUP);
- final BranchHandle falsec = il.append(new IFLT(null));
- Type.Node.translateTo(classGen, methodGen, type);
- final BranchHandle truec = il.append(new GOTO(null));
- falsec.setTarget(il.append(POP));
- il.append(new PUSH(classGen.getConstantPool(), ""));
- truec.setTarget(il.append(NOP));
- }
-
- /**
- * Expects a node-set on the stack and pushes a real.
- * First the node-set is converted to string, and from string to real.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- RealType type) {
- translateTo(classGen, methodGen, Type.String);
- Type.String.translateTo(classGen, methodGen, Type.Real);
- }
-
- /**
- * Expects a node-set on the stack and pushes a node.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- NodeType type) {
- getFirstNode(classGen, methodGen);
- }
-
- /**
- * Subsume node-set into ObjectType.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- ObjectType type) {
- methodGen.getInstructionList().append(NOP);
- }
-
- /**
- * Translates a node-set into a non-synthesized boolean. It does not
- * push a 0 or a 1 but instead returns branchhandle list to be appended
- * to the false list.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateToDesynthesized
- */
- public FlowList translateToDesynthesized(ClassGenerator classGen,
- MethodGenerator methodGen,
- BooleanType type) {
- final InstructionList il = methodGen.getInstructionList();
- getFirstNode(classGen, methodGen);
- return new FlowList(il.append(new IFLT(null)));
- }
-
- /**
- * Expects a node-set on the stack and pushes a boxed node-set.
- * Node sets are already boxed so the translation is just a NOP.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- ReferenceType type) {
- methodGen.getInstructionList().append(NOP);
- }
-
- /**
- * Translates a node-set into the Java type denoted by <code>clazz</code>.
- * Expects a node-set on the stack and pushes an object of the appropriate
- * type after coercion.
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- Class clazz) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- final String className = clazz.getName();
-
- il.append(methodGen.loadDOM());
- il.append(SWAP);
-
- if (className.equals("org.w3c.dom.Node")) {
- int index = cpg.addInterfaceMethodref(DOM_INTF,
- MAKE_NODE,
- MAKE_NODE_SIG2);
- il.append(new INVOKEINTERFACE(index, 2));
- }
- else if (className.equals("org.w3c.dom.NodeList") ||
- className.equals("java.lang.Object")) {
- int index = cpg.addInterfaceMethodref(DOM_INTF,
- MAKE_NODE_LIST,
- MAKE_NODE_LIST_SIG2);
- il.append(new INVOKEINTERFACE(index, 2));
- }
- else if (className.equals("java.lang.String")) {
- int next = cpg.addInterfaceMethodref(NODE_ITERATOR,
- "next", "()I");
- int index = cpg.addInterfaceMethodref(DOM_INTF,
- GET_NODE_VALUE,
- "(I)"+STRING_SIG);
-
- // Get next node from the iterator
- il.append(new INVOKEINTERFACE(next, 1));
- // Get the node's string value (from the DOM)
- il.append(new INVOKEINTERFACE(index, 2));
-
- }
- else {
- ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
- toString(), className);
- classGen.getParser().reportError(Constants.FATAL, err);
- }
- }
-
- /**
- * Some type conversions require gettting the first node from the node-set.
- * This function is defined to avoid code repetition.
- */
- private void getFirstNode(ClassGenerator classGen, MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- il.append(new INVOKEINTERFACE(cpg.addInterfaceMethodref(NODE_ITERATOR,
- NEXT,
- NEXT_SIG), 1));
- }
-
- /**
- * Translates an object of this type to its boxed representation.
- */
- public void translateBox(ClassGenerator classGen,
- MethodGenerator methodGen) {
- translateTo(classGen, methodGen, Type.Reference);
- }
-
- /**
- * Translates an object of this type to its unboxed representation.
- */
- public void translateUnBox(ClassGenerator classGen,
- MethodGenerator methodGen) {
- methodGen.getInstructionList().append(NOP);
- }
-
- /**
- * Returns the class name of an internal type's external representation.
- */
- public String getClassName() {
- return(NODE_ITERATOR);
- }
-
-
- public Instruction LOAD(int slot) {
- return new ALOAD(slot);
- }
-
- public Instruction STORE(int slot) {
- return new ASTORE(slot);
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NodeSortRecordFactGenerator.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NodeSortRecordFactGenerator.java
deleted file mode 100644
index bacccac..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NodeSortRecordFactGenerator.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: NodeSortRecordFactGenerator.java,v 1.2.4.1 2005/09/05 11:23:07 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-
-import com.sun.org.apache.xalan.internal.xsltc.compiler.Stylesheet;
-
-/**
- * Generator for subclasses of NodeSortRecordFactory.
- * @author Santiago Pericas-Geertsen
- */
-public final class NodeSortRecordFactGenerator extends ClassGenerator {
-
- public NodeSortRecordFactGenerator(String className, String superClassName,
- String fileName,
- int accessFlags, String[] interfaces,
- Stylesheet stylesheet) {
- super(className, superClassName, fileName,
- accessFlags, interfaces, stylesheet);
- }
-
- /**
- * Returns <tt>true</tt> since this class is external to the
- * translet.
- */
- public boolean isExternal() {
- return true;
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NodeSortRecordGenerator.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NodeSortRecordGenerator.java
deleted file mode 100644
index 0e53338..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NodeSortRecordGenerator.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: NodeSortRecordGenerator.java,v 1.2.4.1 2005/09/05 11:23:42 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-
-import com.sun.org.apache.bcel.internal.generic.ALOAD;
-import com.sun.org.apache.bcel.internal.generic.Instruction;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.Stylesheet;
-
-/**
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- */
-public final class NodeSortRecordGenerator extends ClassGenerator {
- private static final int TRANSLET_INDEX = 4; // translet
- private final Instruction _aloadTranslet;
-
- public NodeSortRecordGenerator(String className, String superClassName,
- String fileName,
- int accessFlags, String[] interfaces,
- Stylesheet stylesheet) {
- super(className, superClassName, fileName,
- accessFlags, interfaces, stylesheet);
- _aloadTranslet = new ALOAD(TRANSLET_INDEX);
- }
-
- /**
- * The index of the translet pointer within the execution of
- * the test method.
- */
- public Instruction loadTranslet() {
- return _aloadTranslet;
- }
-
- /**
- * Returns <tt>true</tt> since this class is external to the
- * translet.
- */
- public boolean isExternal() {
- return true;
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NodeType.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NodeType.java
deleted file mode 100644
index e48a092..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NodeType.java
+++ /dev/null
@@ -1,324 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: NodeType.java,v 1.2.4.1 2005/09/05 11:24:25 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-
-import com.sun.org.apache.bcel.internal.generic.BranchHandle;
-import com.sun.org.apache.bcel.internal.generic.CHECKCAST;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.GETFIELD;
-import com.sun.org.apache.bcel.internal.generic.GOTO;
-import com.sun.org.apache.bcel.internal.generic.IFEQ;
-import com.sun.org.apache.bcel.internal.generic.ILOAD;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
-import com.sun.org.apache.bcel.internal.generic.ISTORE;
-import com.sun.org.apache.bcel.internal.generic.Instruction;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.NEW;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.Constants;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.FlowList;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.NodeTest;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-public final class NodeType extends Type {
- private final int _type;
-
- protected NodeType() {
- this(NodeTest.ANODE);
- }
-
- protected NodeType(int type) {
- _type = type;
- }
-
- public int getType() {
- return _type;
- }
-
- public String toString() {
- return "node-type";
- }
-
- public boolean identicalTo(Type other) {
- return other instanceof NodeType;
- }
-
- public int hashCode() {
- return _type;
- }
-
- public String toSignature() {
- return "I";
- }
-
- public com.sun.org.apache.bcel.internal.generic.Type toJCType() {
- return com.sun.org.apache.bcel.internal.generic.Type.INT;
- }
-
- /**
- * Translates a node into an object of internal type <code>type</code>.
- * The translation to int is undefined since nodes are always converted
- * to reals in arithmetic expressions.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- Type type) {
- if (type == Type.String) {
- translateTo(classGen, methodGen, (StringType) type);
- }
- else if (type == Type.Boolean) {
- translateTo(classGen, methodGen, (BooleanType) type);
- }
- else if (type == Type.Real) {
- translateTo(classGen, methodGen, (RealType) type);
- }
- else if (type == Type.NodeSet) {
- translateTo(classGen, methodGen, (NodeSetType) type);
- }
- else if (type == Type.Reference) {
- translateTo(classGen, methodGen, (ReferenceType) type);
- }
- else if (type == Type.Object) {
- translateTo(classGen, methodGen, (ObjectType) type);
- }
- else {
- ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
- toString(), type.toString());
- classGen.getParser().reportError(Constants.FATAL, err);
- }
- }
-
- /**
- * Expects a node on the stack and pushes its string value.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- StringType type) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- switch (_type) {
- case NodeTest.ROOT:
- case NodeTest.ELEMENT:
- il.append(methodGen.loadDOM());
- il.append(SWAP); // dom ref must be below node index
- int index = cpg.addInterfaceMethodref(DOM_INTF,
- GET_ELEMENT_VALUE,
- GET_ELEMENT_VALUE_SIG);
- il.append(new INVOKEINTERFACE(index, 2));
- break;
-
- case NodeTest.ANODE:
- case NodeTest.COMMENT:
- case NodeTest.ATTRIBUTE:
- case NodeTest.PI:
- il.append(methodGen.loadDOM());
- il.append(SWAP); // dom ref must be below node index
- index = cpg.addInterfaceMethodref(DOM_INTF,
- GET_NODE_VALUE,
- GET_NODE_VALUE_SIG);
- il.append(new INVOKEINTERFACE(index, 2));
- break;
-
- default:
- ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
- toString(), type.toString());
- classGen.getParser().reportError(Constants.FATAL, err);
- break;
- }
- }
-
- /**
- * Translates a node into a synthesized boolean.
- * If the expression is "@attr",
- * then "true" is pushed iff "attr" is an attribute of the current node.
- * If the expression is ".", the result is always "true".
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- BooleanType type) {
- final InstructionList il = methodGen.getInstructionList();
- FlowList falsel = translateToDesynthesized(classGen, methodGen, type);
- il.append(ICONST_1);
- final BranchHandle truec = il.append(new GOTO(null));
- falsel.backPatch(il.append(ICONST_0));
- truec.setTarget(il.append(NOP));
- }
-
- /**
- * Expects a node on the stack and pushes a real.
- * First the node is converted to string, and from string to real.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- RealType type) {
- translateTo(classGen, methodGen, Type.String);
- Type.String.translateTo(classGen, methodGen, Type.Real);
- }
-
- /**
- * Expects a node on the stack and pushes a singleton node-set. Singleton
- * iterators are already started after construction.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- NodeSetType type) {
- ConstantPoolGen cpg = classGen.getConstantPool();
- InstructionList il = methodGen.getInstructionList();
-
- // Create a new instance of SingletonIterator
- il.append(new NEW(cpg.addClass(SINGLETON_ITERATOR)));
- il.append(DUP_X1);
- il.append(SWAP);
- final int init = cpg.addMethodref(SINGLETON_ITERATOR, "<init>",
- "(" + NODE_SIG +")V");
- il.append(new INVOKESPECIAL(init));
- }
-
- /**
- * Subsume Node into ObjectType.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- ObjectType type) {
- methodGen.getInstructionList().append(NOP);
- }
-
- /**
- * Translates a node into a non-synthesized boolean. It does not push a
- * 0 or a 1 but instead returns branchhandle list to be appended to the
- * false list.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateToDesynthesized
- */
- public FlowList translateToDesynthesized(ClassGenerator classGen,
- MethodGenerator methodGen,
- BooleanType type) {
- final InstructionList il = methodGen.getInstructionList();
- return new FlowList(il.append(new IFEQ(null)));
- }
-
- /**
- * Expects a node on the stack and pushes a boxed node. Boxed nodes
- * are represented by an instance of <code>com.sun.org.apache.xalan.internal.xsltc.dom.Node</code>.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- ReferenceType type) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- il.append(new NEW(cpg.addClass(RUNTIME_NODE_CLASS)));
- il.append(DUP_X1);
- il.append(SWAP);
- il.append(new PUSH(cpg, _type));
- il.append(new INVOKESPECIAL(cpg.addMethodref(RUNTIME_NODE_CLASS,
- "<init>", "(II)V")));
- }
-
- /**
- * Translates a node into the Java type denoted by <code>clazz</code>.
- * Expects a node on the stack and pushes an object of the appropriate
- * type after coercion.
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- Class clazz) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- String className = clazz.getName();
- if (className.equals("java.lang.String")) {
- translateTo(classGen, methodGen, Type.String);
- return;
- }
-
- il.append(methodGen.loadDOM());
- il.append(SWAP); // dom ref must be below node index
-
- if (className.equals("org.w3c.dom.Node") ||
- className.equals("java.lang.Object")) {
- int index = cpg.addInterfaceMethodref(DOM_INTF,
- MAKE_NODE,
- MAKE_NODE_SIG);
- il.append(new INVOKEINTERFACE(index, 2));
- }
- else if (className.equals("org.w3c.dom.NodeList")) {
- int index = cpg.addInterfaceMethodref(DOM_INTF,
- MAKE_NODE_LIST,
- MAKE_NODE_LIST_SIG);
- il.append(new INVOKEINTERFACE(index, 2));
- }
- else {
- ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
- toString(), className);
- classGen.getParser().reportError(Constants.FATAL, err);
- }
- }
-
- /**
- * Translates an object of this type to its boxed representation.
- */
- public void translateBox(ClassGenerator classGen,
- MethodGenerator methodGen) {
- translateTo(classGen, methodGen, Type.Reference);
- }
-
- /**
- * Translates an object of this type to its unboxed representation.
- */
- public void translateUnBox(ClassGenerator classGen,
- MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- il.append(new CHECKCAST(cpg.addClass(RUNTIME_NODE_CLASS)));
- il.append(new GETFIELD(cpg.addFieldref(RUNTIME_NODE_CLASS,
- NODE_FIELD,
- NODE_FIELD_SIG)));
- }
-
- /**
- * Returns the class name of an internal type's external representation.
- */
- public String getClassName() {
- return(RUNTIME_NODE_CLASS);
- }
-
- public Instruction LOAD(int slot) {
- return new ILOAD(slot);
- }
-
- public Instruction STORE(int slot) {
- return new ISTORE(slot);
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NumberType.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NumberType.java
deleted file mode 100644
index c50e153..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NumberType.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: NumberType.java,v 1.2.4.1 2005/09/05 11:25:11 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-public abstract class NumberType extends Type {
- public boolean isNumber() {
- return true;
- }
-
- public boolean isSimple() {
- return true;
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ObjectType.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ObjectType.java
deleted file mode 100644
index 206b59e..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ObjectType.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ObjectType.java,v 1.2.4.1 2005/09/12 11:45:54 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-
-import com.sun.org.apache.bcel.internal.generic.ALOAD;
-import com.sun.org.apache.bcel.internal.generic.ASTORE;
-import com.sun.org.apache.bcel.internal.generic.BranchHandle;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.GOTO;
-import com.sun.org.apache.bcel.internal.generic.IFNULL;
-import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
-import com.sun.org.apache.bcel.internal.generic.Instruction;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.Constants;
-import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
-
-/**
- * @author Todd Miller
- * @author Santiago Pericas-Geertsen
- */
-public final class ObjectType extends Type {
-
- private String _javaClassName = "java.lang.Object";
- private Class _clazz = java.lang.Object.class;
-
- /**
- * Used to represent a Java Class type such is required to support
- * non-static java functions.
- * @param javaClassName name of the class such as 'com.foo.Processor'
- */
- protected ObjectType(String javaClassName) {
- _javaClassName = javaClassName;
-
- try {
- _clazz = ObjectFactory.findProviderClass(javaClassName, true);
- }
- catch (ClassNotFoundException e) {
- _clazz = null;
- }
- }
-
- protected ObjectType(Class clazz) {
- _clazz = clazz;
- _javaClassName = clazz.getName();
- }
-
- /**
- * Must return the same value for all ObjectType instances. This is
- * needed in CastExpr to ensure the mapping table is used correctly.
- */
- public int hashCode() {
- return java.lang.Object.class.hashCode();
- }
-
- public boolean equals(Object obj) {
- return (obj instanceof ObjectType);
- }
-
- public String getJavaClassName() {
- return _javaClassName;
- }
-
- public Class getJavaClass() {
- return _clazz;
- }
-
- public String toString() {
- return _javaClassName;
- }
-
- public boolean identicalTo(Type other) {
- return this == other;
- }
-
- public String toSignature() {
- final StringBuffer result = new StringBuffer("L");
- result.append(_javaClassName.replace('.', '/')).append(';');
- return result.toString();
- }
-
- public com.sun.org.apache.bcel.internal.generic.Type toJCType() {
- return Util.getJCRefType(toSignature());
- }
-
- /**
- * Translates a void into an object of internal type <code>type</code>.
- * This translation is needed when calling external functions
- * that return void.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- Type type) {
- if (type == Type.String) {
- translateTo(classGen, methodGen, (StringType) type);
- }
- else {
- ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
- toString(), type.toString());
- classGen.getParser().reportError(Constants.FATAL, err);
- }
- }
-
- /**
- * Expects an integer on the stack and pushes its string value by calling
- * <code>Integer.toString(int i)</code>.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- StringType type) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- il.append(DUP);
- final BranchHandle ifNull = il.append(new IFNULL(null));
- il.append(new INVOKEVIRTUAL(cpg.addMethodref(_javaClassName,
- "toString",
- "()" + STRING_SIG)));
- final BranchHandle gotobh = il.append(new GOTO(null));
- ifNull.setTarget(il.append(POP));
- il.append(new PUSH(cpg, ""));
- gotobh.setTarget(il.append(NOP));
- }
-
- /**
- * Translates an object of this type to the external (Java) type denoted
- * by <code>clazz</code>. This method is used to translate parameters
- * when external functions are called.
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- Class clazz) {
- if (clazz.isAssignableFrom(_clazz))
- methodGen.getInstructionList().append(NOP);
- else {
- ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
- toString(), clazz.getClass().toString());
- classGen.getParser().reportError(Constants.FATAL, err);
- }
- }
-
- /**
- * Translates an external Java type into an Object type
- */
- public void translateFrom(ClassGenerator classGen,
- MethodGenerator methodGen, Class clazz) {
- methodGen.getInstructionList().append(NOP);
- }
-
- public Instruction LOAD(int slot) {
- return new ALOAD(slot);
- }
-
- public Instruction STORE(int slot) {
- return new ASTORE(slot);
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/OutlineableChunkEnd.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/OutlineableChunkEnd.java
deleted file mode 100644
index b2daff3..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/OutlineableChunkEnd.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- * $Id: OutlineableChunkEnd.java,v 1.10 2010-11-01 04:34:19 joehw Exp $
- */
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-import com.sun.org.apache.bcel.internal.generic.Instruction;
-/**
- * <p>Marks the end of a region of byte code that can be copied into a new
- * method. See the {@link OutlineableChunkStart} pseudo-instruction for
- * details.</p>
- */
-class OutlineableChunkEnd extends MarkerInstruction {
- /**
- * A constant instance of {@link OutlineableChunkEnd}. As it has no fields,
- * there should be no need to create an instance of this class.
- */
- public static final Instruction OUTLINEABLECHUNKEND =
- new OutlineableChunkEnd();
-
- /**
- * Private default constructor. As it has no fields,
- * there should be no need to create an instance of this class. See
- * {@link OutlineableChunkEnd#OUTLINEABLECHUNKEND}.
- */
- private OutlineableChunkEnd() {
- }
-
- /**
- * Get the name of this instruction. Used for debugging.
- * @return the instruction name
- */
- public String getName() {
- return OutlineableChunkEnd.class.getName();
- }
-
- /**
- * Get the name of this instruction. Used for debugging.
- * @return the instruction name
- */
- public String toString() {
- return getName();
- }
-
- /**
- * Get the name of this instruction. Used for debugging.
- * @return the instruction name
- */
- public String toString(boolean verbose) {
- return getName();
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/OutlineableChunkStart.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/OutlineableChunkStart.java
deleted file mode 100644
index 9b54cac..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/OutlineableChunkStart.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- * $Id: MethodGenerator.java,v 1.10 2010-11-01 04:34:19 joehw Exp $
- */
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-import com.sun.org.apache.bcel.internal.generic.Instruction;
-
-/**
- * <p>This pseudo-instruction marks the beginning of a region of byte code that
- * can be copied into a new method, termed an "outlineable" chunk. The size of
- * the Java stack must be the same at the start of the region as it is at the
- * end of the region, any value on the stack at the start of the region must not
- * be consumed by an instruction in the region of code, the region must not
- * contain a return instruction, no branch instruction in the region is
- * permitted to have a target that is outside the region, and no branch
- * instruction outside the region is permitted to have a target that is inside
- * the region.</p>
- * <p>The end of the region is marked by an {@link OutlineableChunkEnd}
- * pseudo-instruction.</p>
- * <p>Such a region of code may contain other outlineable regions.</p>
- */
-class OutlineableChunkStart extends MarkerInstruction {
- /**
- * A constant instance of {@link OutlineableChunkStart}. As it has no fields,
- * there should be no need to create an instance of this class.
- */
- public static final Instruction OUTLINEABLECHUNKSTART =
- new OutlineableChunkStart();
-
- /**
- * Private default constructor. As it has no fields,
- * there should be no need to create an instance of this class. See
- * {@link OutlineableChunkStart#OUTLINEABLECHUNKSTART}.
- */
- private OutlineableChunkStart() {
- }
-
- /**
- * Get the name of this instruction. Used for debugging.
- * @return the instruction name
- */
- public String getName() {
- return OutlineableChunkStart.class.getName();
- }
-
- /**
- * Get the name of this instruction. Used for debugging.
- * @return the instruction name
- */
- public String toString() {
- return getName();
- }
-
- /**
- * Get the name of this instruction. Used for debugging.
- * @return the instruction name
- */
- public String toString(boolean verbose) {
- return getName();
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/RealType.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/RealType.java
deleted file mode 100644
index f70a210..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/RealType.java
+++ /dev/null
@@ -1,343 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: RealType.java,v 1.2.4.1 2005/09/05 11:28:45 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-
-import com.sun.org.apache.bcel.internal.generic.BranchHandle;
-import com.sun.org.apache.bcel.internal.generic.CHECKCAST;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.DLOAD;
-import com.sun.org.apache.bcel.internal.generic.DSTORE;
-import com.sun.org.apache.bcel.internal.generic.GOTO;
-import com.sun.org.apache.bcel.internal.generic.IFEQ;
-import com.sun.org.apache.bcel.internal.generic.IFNE;
-import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
-import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
-import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
-import com.sun.org.apache.bcel.internal.generic.Instruction;
-import com.sun.org.apache.bcel.internal.generic.InstructionConstants;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
-import com.sun.org.apache.bcel.internal.generic.NEW;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.Constants;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.FlowList;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-public final class RealType extends NumberType {
- protected RealType() {}
-
- public String toString() {
- return "real";
- }
-
- public boolean identicalTo(Type other) {
- return this == other;
- }
-
- public String toSignature() {
- return "D";
- }
-
- public com.sun.org.apache.bcel.internal.generic.Type toJCType() {
- return com.sun.org.apache.bcel.internal.generic.Type.DOUBLE;
- }
-
- /**
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#distanceTo
- */
- public int distanceTo(Type type) {
- if (type == this) {
- return 0;
- }
- else if (type == Type.Int) {
- return 1;
- }
- else {
- return Integer.MAX_VALUE;
- }
- }
-
- /**
- * Translates a real into an object of internal type <code>type</code>. The
- * translation to int is undefined since reals are never converted to ints.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- Type type) {
- if (type == Type.String) {
- translateTo(classGen, methodGen, (StringType) type);
- }
- else if (type == Type.Boolean) {
- translateTo(classGen, methodGen, (BooleanType) type);
- }
- else if (type == Type.Reference) {
- translateTo(classGen, methodGen, (ReferenceType) type);
- }
- else if (type == Type.Int) {
- translateTo(classGen, methodGen, (IntType) type);
- }
- else {
- ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
- toString(), type.toString());
- classGen.getParser().reportError(Constants.FATAL, err);
- }
- }
-
- /**
- * Expects a real on the stack and pushes its string value by calling
- * <code>Double.toString(double d)</code>.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- StringType type) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- il.append(new INVOKESTATIC(cpg.addMethodref(BASIS_LIBRARY_CLASS,
- "realToString",
- "(D)" + STRING_SIG)));
- }
-
- /**
- * Expects a real on the stack and pushes a 0 if that number is 0.0 and
- * a 1 otherwise.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- BooleanType type) {
- final InstructionList il = methodGen.getInstructionList();
- FlowList falsel = translateToDesynthesized(classGen, methodGen, type);
- il.append(ICONST_1);
- final BranchHandle truec = il.append(new GOTO(null));
- falsel.backPatch(il.append(ICONST_0));
- truec.setTarget(il.append(NOP));
- }
-
- /**
- * Expects a real on the stack and pushes a truncated integer value
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- IntType type) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- il.append(new INVOKESTATIC(cpg.addMethodref(BASIS_LIBRARY_CLASS,
- "realToInt","(D)I")));
- }
-
- /**
- * Translates a real into a non-synthesized boolean. It does not push a
- * 0 or a 1 but instead returns branchhandle list to be appended to the
- * false list. A NaN must be converted to "false".
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateToDesynthesized
- */
- public FlowList translateToDesynthesized(ClassGenerator classGen,
- MethodGenerator methodGen,
- BooleanType type) {
- LocalVariableGen local;
- final FlowList flowlist = new FlowList();
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- // Store real into a local variable
- il.append(DUP2);
- local = methodGen.addLocalVariable("real_to_boolean_tmp",
- com.sun.org.apache.bcel.internal.generic.Type.DOUBLE,
- null, null);
- local.setStart(il.append(new DSTORE(local.getIndex())));
-
- // Compare it to 0.0
- il.append(DCONST_0);
- il.append(DCMPG);
- flowlist.add(il.append(new IFEQ(null)));
-
- //!!! call isNaN
- // Compare it to itself to see if NaN
- il.append(new DLOAD(local.getIndex()));
- local.setEnd(il.append(new DLOAD(local.getIndex())));
- il.append(DCMPG);
- flowlist.add(il.append(new IFNE(null))); // NaN != NaN
- return flowlist;
- }
-
- /**
- * Expects a double on the stack and pushes a boxed double. Boxed
- * double are represented by an instance of <code>java.lang.Double</code>.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- ReferenceType type) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- il.append(new NEW(cpg.addClass(DOUBLE_CLASS)));
- il.append(DUP_X2);
- il.append(DUP_X2);
- il.append(POP);
- il.append(new INVOKESPECIAL(cpg.addMethodref(DOUBLE_CLASS,
- "<init>", "(D)V")));
- }
-
- /**
- * Translates a real into the Java type denoted by <code>clazz</code>.
- * Expects a real on the stack and pushes a number of the appropriate
- * type after coercion.
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- final Class clazz) {
- final InstructionList il = methodGen.getInstructionList();
- if (clazz == Character.TYPE) {
- il.append(D2I);
- il.append(I2C);
- }
- else if (clazz == Byte.TYPE) {
- il.append(D2I);
- il.append(I2B);
- }
- else if (clazz == Short.TYPE) {
- il.append(D2I);
- il.append(I2S);
- }
- else if (clazz == Integer.TYPE) {
- il.append(D2I);
- }
- else if (clazz == Long.TYPE) {
- il.append(D2L);
- }
- else if (clazz == Float.TYPE) {
- il.append(D2F);
- }
- else if (clazz == Double.TYPE) {
- il.append(NOP);
- }
- // Is Double <: clazz? I.e. clazz in { Double, Number, Object }
- else if (clazz.isAssignableFrom(java.lang.Double.class)) {
- translateTo(classGen, methodGen, Type.Reference);
- }
- else {
- ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
- toString(), clazz.getName());
- classGen.getParser().reportError(Constants.FATAL, err);
- }
- }
-
- /**
- * Translates an external (primitive) Java type into a real. Expects a java
- * object on the stack and pushes a real (i.e., a double).
- */
- public void translateFrom(ClassGenerator classGen, MethodGenerator methodGen,
- Class clazz) {
- InstructionList il = methodGen.getInstructionList();
-
- if (clazz == Character.TYPE || clazz == Byte.TYPE ||
- clazz == Short.TYPE || clazz == Integer.TYPE) {
- il.append(I2D);
- }
- else if (clazz == Long.TYPE) {
- il.append(L2D);
- }
- else if (clazz == Float.TYPE) {
- il.append(F2D);
- }
- else if (clazz == Double.TYPE) {
- il.append(NOP);
- }
- else {
- ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
- toString(), clazz.getName());
- classGen.getParser().reportError(Constants.FATAL, err);
- }
- }
-
- /**
- * Translates an object of this type to its boxed representation.
- */
- public void translateBox(ClassGenerator classGen,
- MethodGenerator methodGen) {
- translateTo(classGen, methodGen, Type.Reference);
- }
-
- /**
- * Translates an object of this type to its unboxed representation.
- */
- public void translateUnBox(ClassGenerator classGen,
- MethodGenerator methodGen) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- il.append(new CHECKCAST(cpg.addClass(DOUBLE_CLASS)));
- il.append(new INVOKEVIRTUAL(cpg.addMethodref(DOUBLE_CLASS,
- DOUBLE_VALUE,
- DOUBLE_VALUE_SIG)));
- }
-
- public Instruction ADD() {
- return InstructionConstants.DADD;
- }
-
- public Instruction SUB() {
- return InstructionConstants.DSUB;
- }
-
- public Instruction MUL() {
- return InstructionConstants.DMUL;
- }
-
- public Instruction DIV() {
- return InstructionConstants.DDIV;
- }
-
- public Instruction REM() {
- return InstructionConstants.DREM;
- }
-
- public Instruction NEG() {
- return InstructionConstants.DNEG;
- }
-
- public Instruction LOAD(int slot) {
- return new DLOAD(slot);
- }
-
- public Instruction STORE(int slot) {
- return new DSTORE(slot);
- }
-
- public Instruction POP() {
- return POP2;
- }
-
- public Instruction CMP(boolean less) {
- return less ? InstructionConstants.DCMPG : InstructionConstants.DCMPL;
- }
-
- public Instruction DUP() {
- return DUP2;
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ReferenceType.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ReferenceType.java
deleted file mode 100644
index 1ceccf2..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ReferenceType.java
+++ /dev/null
@@ -1,379 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ReferenceType.java,v 1.2.4.1 2005/09/05 11:29:12 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.bcel.internal.generic.ALOAD;
-import com.sun.org.apache.bcel.internal.generic.ASTORE;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.IFEQ;
-import com.sun.org.apache.bcel.internal.generic.ILOAD;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
-import com.sun.org.apache.bcel.internal.generic.Instruction;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-
-import com.sun.org.apache.xalan.internal.xsltc.compiler.Constants;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.FlowList;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Erwin Bolwidt <ejb@klomp.org>
- */
-public final class ReferenceType extends Type {
- protected ReferenceType() {}
-
- public String toString() {
- return "reference";
- }
-
- public boolean identicalTo(Type other) {
- return this == other;
- }
-
- public String toSignature() {
- return "Ljava/lang/Object;";
- }
-
- public com.sun.org.apache.bcel.internal.generic.Type toJCType() {
- return com.sun.org.apache.bcel.internal.generic.Type.OBJECT;
- }
-
- /**
- * Translates a reference to an object of internal type <code>type</code>.
- * The translation to int is undefined since references
- * are always converted to reals in arithmetic expressions.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- Type type) {
- if (type == Type.String) {
- translateTo(classGen, methodGen, (StringType) type);
- }
- else if (type == Type.Real) {
- translateTo(classGen, methodGen, (RealType) type);
- }
- else if (type == Type.Boolean) {
- translateTo(classGen, methodGen, (BooleanType) type);
- }
- else if (type == Type.NodeSet) {
- translateTo(classGen, methodGen, (NodeSetType) type);
- }
- else if (type == Type.Node) {
- translateTo(classGen, methodGen, (NodeType) type);
- }
- else if (type == Type.ResultTree) {
- translateTo(classGen, methodGen, (ResultTreeType) type);
- }
- else if (type == Type.Object) {
- translateTo(classGen, methodGen, (ObjectType) type);
- }
- else if (type == Type.Reference ) {
- }
- else {
- ErrorMsg err = new ErrorMsg(ErrorMsg.INTERNAL_ERR, type.toString());
- classGen.getParser().reportError(Constants.FATAL, err);
- }
- }
-
- /**
- * Translates reference into object of internal type <code>type</code>.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- StringType type) {
- final int current = methodGen.getLocalIndex("current");
- ConstantPoolGen cpg = classGen.getConstantPool();
- InstructionList il = methodGen.getInstructionList();
-
- // If no current, conversion is a top-level
- if (current < 0) {
- il.append(new PUSH(cpg, DTM.ROOT_NODE)); // push root node
- }
- else {
- il.append(new ILOAD(current));
- }
- il.append(methodGen.loadDOM());
- final int stringF = cpg.addMethodref(BASIS_LIBRARY_CLASS,
- "stringF",
- "("
- + OBJECT_SIG
- + NODE_SIG
- + DOM_INTF_SIG
- + ")" + STRING_SIG);
- il.append(new INVOKESTATIC(stringF));
- }
-
- /**
- * Translates a reference into an object of internal type <code>type</code>.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- RealType type) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- il.append(methodGen.loadDOM());
- int index = cpg.addMethodref(BASIS_LIBRARY_CLASS, "numberF",
- "("
- + OBJECT_SIG
- + DOM_INTF_SIG
- + ")D");
- il.append(new INVOKESTATIC(index));
- }
-
- /**
- * Translates a reference to an object of internal type <code>type</code>.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- BooleanType type) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- int index = cpg.addMethodref(BASIS_LIBRARY_CLASS, "booleanF",
- "("
- + OBJECT_SIG
- + ")Z");
- il.append(new INVOKESTATIC(index));
- }
-
- /**
- * Casts a reference into a NodeIterator.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- NodeSetType type) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- int index = cpg.addMethodref(BASIS_LIBRARY_CLASS, "referenceToNodeSet",
- "("
- + OBJECT_SIG
- + ")"
- + NODE_ITERATOR_SIG);
- il.append(new INVOKESTATIC(index));
-
- // Reset this iterator
- index = cpg.addInterfaceMethodref(NODE_ITERATOR, RESET, RESET_SIG);
- il.append(new INVOKEINTERFACE(index, 1));
- }
-
- /**
- * Casts a reference into a Node.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- NodeType type) {
- translateTo(classGen, methodGen, Type.NodeSet);
- Type.NodeSet.translateTo(classGen, methodGen, type);
- }
-
- /**
- * Casts a reference into a ResultTree.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- ResultTreeType type) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- int index = cpg.addMethodref(BASIS_LIBRARY_CLASS, "referenceToResultTree",
- "(" + OBJECT_SIG + ")" + DOM_INTF_SIG);
- il.append(new INVOKESTATIC(index));
- }
-
- /**
- * Subsume reference into ObjectType.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- ObjectType type) {
- methodGen.getInstructionList().append(NOP);
- }
-
- /**
- * Translates a reference into the Java type denoted by <code>clazz</code>.
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- Class clazz) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- int referenceToLong = cpg.addMethodref(BASIS_LIBRARY_CLASS,
- "referenceToLong",
- "(" + OBJECT_SIG + ")J");
- int referenceToDouble = cpg.addMethodref(BASIS_LIBRARY_CLASS,
- "referenceToDouble",
- "(" + OBJECT_SIG + ")D");
- int referenceToBoolean = cpg.addMethodref(BASIS_LIBRARY_CLASS,
- "referenceToBoolean",
- "(" + OBJECT_SIG + ")Z");
-
- if (clazz.getName().equals("java.lang.Object")) {
- il.append(NOP);
- }
- else if (clazz == Double.TYPE) {
- il.append(new INVOKESTATIC(referenceToDouble));
- }
- else if (clazz.getName().equals("java.lang.Double")) {
- il.append(new INVOKESTATIC(referenceToDouble));
- Type.Real.translateTo(classGen, methodGen, Type.Reference);
- }
- else if (clazz == Float.TYPE) {
- il.append(new INVOKESTATIC(referenceToDouble));
- il.append(D2F);
- }
- else if (clazz.getName().equals("java.lang.String")) {
- int index = cpg.addMethodref(BASIS_LIBRARY_CLASS, "referenceToString",
- "("
- + OBJECT_SIG
- + DOM_INTF_SIG
- + ")"
- + "Ljava/lang/String;");
- il.append(methodGen.loadDOM());
- il.append(new INVOKESTATIC(index));
- }
- else if (clazz.getName().equals("org.w3c.dom.Node")) {
- int index = cpg.addMethodref(BASIS_LIBRARY_CLASS, "referenceToNode",
- "("
- + OBJECT_SIG
- + DOM_INTF_SIG
- + ")"
- + "Lorg/w3c/dom/Node;");
- il.append(methodGen.loadDOM());
- il.append(new INVOKESTATIC(index));
- }
- else if (clazz.getName().equals("org.w3c.dom.NodeList")) {
- int index = cpg.addMethodref(BASIS_LIBRARY_CLASS, "referenceToNodeList",
- "("
- + OBJECT_SIG
- + DOM_INTF_SIG
- + ")"
- + "Lorg/w3c/dom/NodeList;");
- il.append(methodGen.loadDOM());
- il.append(new INVOKESTATIC(index));
- }
- else if (clazz.getName().equals("com.sun.org.apache.xalan.internal.xsltc.DOM")) {
- translateTo(classGen, methodGen, Type.ResultTree);
- }
- else if (clazz == Long.TYPE) {
- il.append(new INVOKESTATIC(referenceToLong));
- }
- else if (clazz == Integer.TYPE) {
- il.append(new INVOKESTATIC(referenceToLong));
- il.append(L2I);
- }
- else if (clazz == Short.TYPE) {
- il.append(new INVOKESTATIC(referenceToLong));
- il.append(L2I);
- il.append(I2S);
- }
- else if (clazz == Byte.TYPE) {
- il.append(new INVOKESTATIC(referenceToLong));
- il.append(L2I);
- il.append(I2B);
- }
- else if (clazz == Character.TYPE) {
- il.append(new INVOKESTATIC(referenceToLong));
- il.append(L2I);
- il.append(I2C);
- }
- else if (clazz == java.lang.Boolean.TYPE) {
- il.append(new INVOKESTATIC(referenceToBoolean));
- }
- else if (clazz.getName().equals("java.lang.Boolean")) {
- il.append(new INVOKESTATIC(referenceToBoolean));
- Type.Boolean.translateTo(classGen, methodGen, Type.Reference);
- }
- else {
- ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
- toString(), clazz.getName());
- classGen.getParser().reportError(Constants.FATAL, err);
- }
- }
-
- /**
- * Translates an external Java type into a reference. Only conversion
- * allowed is from java.lang.Object.
- */
- public void translateFrom(ClassGenerator classGen, MethodGenerator methodGen,
- Class clazz) {
- if (clazz.getName().equals("java.lang.Object")) {
- methodGen.getInstructionList().append(NOP);
- }
- else {
- ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
- toString(), clazz.getName());
- classGen.getParser().reportError(Constants.FATAL, err);
- }
- }
-
- /**
- * Expects a reference on the stack and translates it to a non-synthesized
- * boolean. It does not push a 0 or a 1 but instead returns branchhandle
- * list to be appended to the false list.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateToDesynthesized
- */
- public FlowList translateToDesynthesized(ClassGenerator classGen,
- MethodGenerator methodGen,
- BooleanType type) {
- InstructionList il = methodGen.getInstructionList();
- translateTo(classGen, methodGen, type);
- return new FlowList(il.append(new IFEQ(null)));
- }
-
- /**
- * Translates an object of this type to its boxed representation.
- */
- public void translateBox(ClassGenerator classGen,
- MethodGenerator methodGen) {
- }
-
- /**
- * Translates an object of this type to its unboxed representation.
- */
- public void translateUnBox(ClassGenerator classGen,
- MethodGenerator methodGen) {
- }
-
-
- public Instruction LOAD(int slot) {
- return new ALOAD(slot);
- }
-
- public Instruction STORE(int slot) {
- return new ASTORE(slot);
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ResultTreeType.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ResultTreeType.java
deleted file mode 100644
index e61f7cb..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ResultTreeType.java
+++ /dev/null
@@ -1,465 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ResultTreeType.java,v 1.2.4.1 2005/09/05 11:30:01 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-
-import com.sun.org.apache.bcel.internal.generic.ALOAD;
-import com.sun.org.apache.bcel.internal.generic.ASTORE;
-import com.sun.org.apache.bcel.internal.generic.CHECKCAST;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.GETFIELD;
-import com.sun.org.apache.bcel.internal.generic.IFEQ;
-import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
-import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
-import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
-import com.sun.org.apache.bcel.internal.generic.Instruction;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
-import com.sun.org.apache.bcel.internal.generic.NEW;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.Constants;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.FlowList;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- */
-public final class ResultTreeType extends Type {
- private final String _methodName;
-
- protected ResultTreeType() {
- _methodName = null;
- }
-
- public ResultTreeType(String methodName) {
- _methodName = methodName;
- }
-
- public String toString() {
- return "result-tree";
- }
-
- public boolean identicalTo(Type other) {
- return (other instanceof ResultTreeType);
- }
-
- public String toSignature() {
- return DOM_INTF_SIG;
- }
-
- public com.sun.org.apache.bcel.internal.generic.Type toJCType() {
- return Util.getJCRefType(toSignature());
- }
-
- public String getMethodName() {
- return _methodName;
- }
-
- public boolean implementedAsMethod() {
- return _methodName != null;
- }
-
- /**
- * Translates a result tree to object of internal type <code>type</code>.
- * The translation to int is undefined since result trees
- * are always converted to reals in arithmetic expressions.
- *
- * @param classGen A BCEL class generator
- * @param methodGen A BCEL method generator
- * @param type An instance of the type to translate the result tree to
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- Type type) {
- if (type == Type.String) {
- translateTo(classGen, methodGen, (StringType)type);
- }
- else if (type == Type.Boolean) {
- translateTo(classGen, methodGen, (BooleanType)type);
- }
- else if (type == Type.Real) {
- translateTo(classGen, methodGen, (RealType)type);
- }
- else if (type == Type.NodeSet) {
- translateTo(classGen, methodGen, (NodeSetType)type);
- }
- else if (type == Type.Reference) {
- translateTo(classGen, methodGen, (ReferenceType)type);
- }
- else if (type == Type.Object) {
- translateTo(classGen, methodGen, (ObjectType) type);
- }
- else {
- ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
- toString(), type.toString());
- classGen.getParser().reportError(Constants.FATAL, err);
- }
- }
-
- /**
- * Expects an result tree on the stack and pushes a boolean.
- * Translates a result tree to a boolean by first converting it to string.
- *
- * @param classGen A BCEL class generator
- * @param methodGen A BCEL method generator
- * @param type An instance of BooleanType (any)
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- BooleanType type) {
- // A result tree is always 'true' when converted to a boolean value,
- // since the tree always has at least one node (the root).
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- il.append(POP); // don't need the DOM reference
- il.append(ICONST_1); // push 'true' on the stack
- }
-
- /**
- * Expects an result tree on the stack and pushes a string.
- *
- * @param classGen A BCEL class generator
- * @param methodGen A BCEL method generator
- * @param type An instance of StringType (any)
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- StringType type) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- if (_methodName == null) {
- int index = cpg.addInterfaceMethodref(DOM_INTF,
- "getStringValue",
- "()"+STRING_SIG);
- il.append(new INVOKEINTERFACE(index, 1));
- }
- else {
- final String className = classGen.getClassName();
- final int current = methodGen.getLocalIndex("current");
-
- // Push required parameters
- il.append(classGen.loadTranslet());
- if (classGen.isExternal()) {
- il.append(new CHECKCAST(cpg.addClass(className)));
- }
- il.append(DUP);
- il.append(new GETFIELD(cpg.addFieldref(className, "_dom",
- DOM_INTF_SIG)));
-
- // Create a new instance of a StringValueHandler
- int index = cpg.addMethodref(STRING_VALUE_HANDLER, "<init>", "()V");
- il.append(new NEW(cpg.addClass(STRING_VALUE_HANDLER)));
- il.append(DUP);
- il.append(DUP);
- il.append(new INVOKESPECIAL(index));
-
- // Store new Handler into a local variable
- final LocalVariableGen handler =
- methodGen.addLocalVariable("rt_to_string_handler",
- Util.getJCRefType(STRING_VALUE_HANDLER_SIG),
- null, null);
- handler.setStart(il.append(new ASTORE(handler.getIndex())));
-
- // Call the method that implements this result tree
- index = cpg.addMethodref(className, _methodName,
- "("+DOM_INTF_SIG+TRANSLET_OUTPUT_SIG+")V");
- il.append(new INVOKEVIRTUAL(index));
-
- // Restore new handler and call getValue()
- handler.setEnd(il.append(new ALOAD(handler.getIndex())));
- index = cpg.addMethodref(STRING_VALUE_HANDLER,
- "getValue",
- "()" + STRING_SIG);
- il.append(new INVOKEVIRTUAL(index));
- }
- }
-
- /**
- * Expects an result tree on the stack and pushes a real.
- * Translates a result tree into a real by first converting it to string.
- *
- * @param classGen A BCEL class generator
- * @param methodGen A BCEL method generator
- * @param type An instance of RealType (any)
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- RealType type) {
- translateTo(classGen, methodGen, Type.String);
- Type.String.translateTo(classGen, methodGen, Type.Real);
- }
-
- /**
- * Expects a result tree on the stack and pushes a boxed result tree.
- * Result trees are already boxed so the translation is just a NOP.
- *
- * @param classGen A BCEL class generator
- * @param methodGen A BCEL method generator
- * @param type An instance of ReferenceType (any)
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- ReferenceType type) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- if (_methodName == null) {
- il.append(NOP);
- }
- else {
- LocalVariableGen domBuilder, newDom;
- final String className = classGen.getClassName();
- final int current = methodGen.getLocalIndex("current");
-
- // Push required parameters
- il.append(classGen.loadTranslet());
- if (classGen.isExternal()) {
- il.append(new CHECKCAST(cpg.addClass(className)));
- }
- il.append(methodGen.loadDOM());
-
- // Create new instance of DOM class (with RTF_INITIAL_SIZE nodes)
- il.append(methodGen.loadDOM());
- int index = cpg.addInterfaceMethodref(DOM_INTF,
- "getResultTreeFrag",
- "(IZ)" + DOM_INTF_SIG);
- il.append(new PUSH(cpg, RTF_INITIAL_SIZE));
- il.append(new PUSH(cpg, false));
- il.append(new INVOKEINTERFACE(index,3));
- il.append(DUP);
-
- // Store new DOM into a local variable
- newDom = methodGen.addLocalVariable("rt_to_reference_dom",
- Util.getJCRefType(DOM_INTF_SIG),
- null, null);
- il.append(new CHECKCAST(cpg.addClass(DOM_INTF_SIG)));
- newDom.setStart(il.append(new ASTORE(newDom.getIndex())));
-
- // Overwrite old handler with DOM handler
- index = cpg.addInterfaceMethodref(DOM_INTF,
- "getOutputDomBuilder",
- "()" + TRANSLET_OUTPUT_SIG);
-
- il.append(new INVOKEINTERFACE(index,1));
- //index = cpg.addMethodref(DOM_IMPL,
- // "getOutputDomBuilder",
- // "()" + TRANSLET_OUTPUT_SIG);
- //il.append(new INVOKEVIRTUAL(index));
- il.append(DUP);
- il.append(DUP);
-
- // Store DOM handler in a local in order to call endDocument()
- domBuilder =
- methodGen.addLocalVariable("rt_to_reference_handler",
- Util.getJCRefType(TRANSLET_OUTPUT_SIG),
- null, null);
- domBuilder.setStart(il.append(new ASTORE(domBuilder.getIndex())));
-
- // Call startDocument on the new handler
- index = cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
- "startDocument", "()V");
- il.append(new INVOKEINTERFACE(index, 1));
-
- // Call the method that implements this result tree
- index = cpg.addMethodref(className,
- _methodName,
- "("
- + DOM_INTF_SIG
- + TRANSLET_OUTPUT_SIG
- +")V");
- il.append(new INVOKEVIRTUAL(index));
-
- // Call endDocument on the DOM handler
- domBuilder.setEnd(il.append(new ALOAD(domBuilder.getIndex())));
- index = cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
- "endDocument", "()V");
- il.append(new INVOKEINTERFACE(index, 1));
-
- // Push the new DOM on the stack
- newDom.setEnd(il.append(new ALOAD(newDom.getIndex())));
- }
- }
-
- /**
- * Expects a result tree on the stack and pushes a node-set (iterator).
- * Note that the produced iterator is an iterator for the DOM that
- * contains the result tree, and not the DOM that is currently in use.
- * This conversion here will therefore not directly work with elements
- * such as <xsl:apply-templates> and <xsl:for-each> without the DOM
- * parameter/variable being updates as well.
- *
- * @param classGen A BCEL class generator
- * @param methodGen A BCEL method generator
- * @param type An instance of NodeSetType (any)
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- NodeSetType type) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- // Put an extra copy of the result tree (DOM) on the stack
- il.append(DUP);
-
- // DOM adapters containing a result tree are not initialised with
- // translet-type to DOM-type mapping. This must be done now for
- // XPath expressions and patterns to work for the iterator we create.
- il.append(classGen.loadTranslet()); // get names array
- il.append(new GETFIELD(cpg.addFieldref(TRANSLET_CLASS,
- NAMES_INDEX,
- NAMES_INDEX_SIG)));
- il.append(classGen.loadTranslet()); // get uris array
- il.append(new GETFIELD(cpg.addFieldref(TRANSLET_CLASS,
- URIS_INDEX,
- URIS_INDEX_SIG)));
- il.append(classGen.loadTranslet()); // get types array
- il.append(new GETFIELD(cpg.addFieldref(TRANSLET_CLASS,
- TYPES_INDEX,
- TYPES_INDEX_SIG)));
- il.append(classGen.loadTranslet()); // get namespaces array
- il.append(new GETFIELD(cpg.addFieldref(TRANSLET_CLASS,
- NAMESPACE_INDEX,
- NAMESPACE_INDEX_SIG)));
- // Pass the type mappings to the DOM adapter
- final int mapping = cpg.addInterfaceMethodref(DOM_INTF,
- "setupMapping",
- "(["+STRING_SIG+
- "["+STRING_SIG+
- "[I" +
- "["+STRING_SIG+")V");
- il.append(new INVOKEINTERFACE(mapping, 5));
- il.append(DUP);
-
- // Create an iterator for the root node of the DOM adapter
- final int iter = cpg.addInterfaceMethodref(DOM_INTF,
- "getIterator",
- "()"+NODE_ITERATOR_SIG);
- il.append(new INVOKEINTERFACE(iter, 1));
- }
-
- /**
- * Subsume result tree into ObjectType.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- ObjectType type) {
- methodGen.getInstructionList().append(NOP);
- }
-
- /**
- * Translates a result tree into a non-synthesized boolean.
- * It does not push a 0 or a 1 but instead returns branchhandle list
- * to be appended to the false list.
- *
- * @param classGen A BCEL class generator
- * @param methodGen A BCEL method generator
- * @param type An instance of BooleanType (any)
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateToDesynthesized
- */
- public FlowList translateToDesynthesized(ClassGenerator classGen,
- MethodGenerator methodGen,
- BooleanType type) {
- final InstructionList il = methodGen.getInstructionList();
- translateTo(classGen, methodGen, Type.Boolean);
- return new FlowList(il.append(new IFEQ(null)));
- }
-
- /**
- * Translates a result tree to a Java type denoted by <code>clazz</code>.
- * Expects a result tree on the stack and pushes an object
- * of the appropriate type after coercion. Result trees are translated
- * to W3C Node or W3C NodeList and the translation is done
- * via node-set type.
- *
- * @param classGen A BCEL class generator
- * @param methodGen A BCEL method generator
- * @param clazz An reference to the Class to translate to
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- Class clazz) {
- final String className = clazz.getName();
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- if (className.equals("org.w3c.dom.Node")) {
- translateTo(classGen, methodGen, Type.NodeSet);
- int index = cpg.addInterfaceMethodref(DOM_INTF,
- MAKE_NODE,
- MAKE_NODE_SIG2);
- il.append(new INVOKEINTERFACE(index, 2));
- }
- else if (className.equals("org.w3c.dom.NodeList")) {
- translateTo(classGen, methodGen, Type.NodeSet);
- int index = cpg.addInterfaceMethodref(DOM_INTF,
- MAKE_NODE_LIST,
- MAKE_NODE_LIST_SIG2);
- il.append(new INVOKEINTERFACE(index, 2));
- }
- else if (className.equals("java.lang.Object")) {
- il.append(NOP);
- }
- else if (className.equals("java.lang.String")) {
- translateTo(classGen, methodGen, Type.String);
- }
- else {
- ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
- toString(), className);
- classGen.getParser().reportError(Constants.FATAL, err);
- }
- }
-
- /**
- * Translates an object of this type to its boxed representation.
- */
- public void translateBox(ClassGenerator classGen,
- MethodGenerator methodGen) {
- translateTo(classGen, methodGen, Type.Reference);
- }
-
- /**
- * Translates an object of this type to its unboxed representation.
- */
- public void translateUnBox(ClassGenerator classGen,
- MethodGenerator methodGen) {
- methodGen.getInstructionList().append(NOP);
- }
-
- /**
- * Returns the class name of an internal type's external representation.
- */
- public String getClassName() {
- return(DOM_INTF);
- }
-
- public Instruction LOAD(int slot) {
- return new ALOAD(slot);
- }
-
- public Instruction STORE(int slot) {
- return new ASTORE(slot);
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/RtMethodGenerator.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/RtMethodGenerator.java
deleted file mode 100644
index a31dec6..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/RtMethodGenerator.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: RtMethodGenerator.java,v 1.2.4.1 2005/09/05 11:30:49 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-
-import com.sun.org.apache.bcel.internal.generic.ALOAD;
-import com.sun.org.apache.bcel.internal.generic.ASTORE;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.Instruction;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.Type;
-
-/**
- * This class is used for result trees implemented as methods. These
- * methods take a reference to the DOM and to the handler only.
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-public final class RtMethodGenerator extends MethodGenerator {
- private static final int HANDLER_INDEX = 2;
- private final Instruction _astoreHandler;
- private final Instruction _aloadHandler;
-
- public RtMethodGenerator(int access_flags, Type return_type,
- Type[] arg_types, String[] arg_names,
- String method_name, String class_name,
- InstructionList il, ConstantPoolGen cp) {
- super(access_flags, return_type, arg_types, arg_names, method_name,
- class_name, il, cp);
-
- _astoreHandler = new ASTORE(HANDLER_INDEX);
- _aloadHandler = new ALOAD(HANDLER_INDEX);
- }
-
- public int getIteratorIndex() {
- return INVALID_INDEX; // not available
- }
-
- public final Instruction storeHandler() {
- return _astoreHandler;
- }
-
- public final Instruction loadHandler() {
- return _aloadHandler;
- }
-
- public int getLocalIndex(String name) {
- return INVALID_INDEX; // not available
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/SlotAllocator.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/SlotAllocator.java
deleted file mode 100644
index 0bd7387..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/SlotAllocator.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: SlotAllocator.java,v 1.2.4.1 2005/09/05 11:32:51 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-
-import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
-import com.sun.org.apache.bcel.internal.generic.Type;
-
-/**
- * @author Jacek Ambroziak
- */
-final class SlotAllocator {
-
- private int _firstAvailableSlot;
- private int _size = 8;
- private int _free = 0;
- private int[] _slotsTaken = new int[_size];
-
- public void initialize(LocalVariableGen[] vars) {
- final int length = vars.length;
- int slot = 0, size, index;
-
- for (int i = 0; i < length; i++) {
- size = vars[i].getType().getSize();
- index = vars[i].getIndex();
- slot = Math.max(slot, index + size);
- }
- _firstAvailableSlot = slot;
- }
-
- public int allocateSlot(Type type) {
- final int size = type.getSize();
- final int limit = _free;
- int slot = _firstAvailableSlot, where = 0;
-
- if (_free + size > _size) {
- final int[] array = new int[_size *= 2];
- for (int j = 0; j < limit; j++)
- array[j] = _slotsTaken[j];
- _slotsTaken = array;
- }
-
- while (where < limit) {
- if (slot + size <= _slotsTaken[where]) {
- // insert
- for (int j = limit - 1; j >= where; j--)
- _slotsTaken[j + size] = _slotsTaken[j];
- break;
- }
- else {
- slot = _slotsTaken[where++] + 1;
- }
- }
-
- for (int j = 0; j < size; j++)
- _slotsTaken[where + j] = slot + j;
-
- _free += size;
- return slot;
- }
-
- public void releaseSlot(LocalVariableGen lvg) {
- final int size = lvg.getType().getSize();
- final int slot = lvg.getIndex();
- final int limit = _free;
-
- for (int i = 0; i < limit; i++) {
- if (_slotsTaken[i] == slot) {
- int j = i + size;
- while (j < limit) {
- _slotsTaken[i++] = _slotsTaken[j++];
- }
- _free -= size;
- return;
- }
- }
- String state = "Variable slot allocation error"+
- "(size="+size+", slot="+slot+", limit="+limit+")";
- ErrorMsg err = new ErrorMsg(ErrorMsg.INTERNAL_ERR, state);
- throw new Error(err.toString());
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/StringStack.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/StringStack.java
deleted file mode 100644
index 4cd2b57..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/StringStack.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: StringStack.java,v 1.2.4.1 2005/09/05 11:33:32 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-
-import java.util.Stack;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-public final class StringStack extends Stack {
- static final long serialVersionUID = -1506910875640317898L;
- public String peekString() {
- return (String) super.peek();
- }
-
- public String popString() {
- return (String) super.pop();
- }
-
- public String pushString(String val) {
- return (String) super.push(val);
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/StringType.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/StringType.java
deleted file mode 100644
index 784482b..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/StringType.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: StringType.java,v 1.2.4.1 2005/09/05 11:35:57 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-
-import com.sun.org.apache.bcel.internal.generic.ALOAD;
-import com.sun.org.apache.bcel.internal.generic.ASTORE;
-import com.sun.org.apache.bcel.internal.generic.BranchHandle;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.GOTO;
-import com.sun.org.apache.bcel.internal.generic.IFEQ;
-import com.sun.org.apache.bcel.internal.generic.IFNONNULL;
-import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
-import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
-import com.sun.org.apache.bcel.internal.generic.Instruction;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.Constants;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.FlowList;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-public class StringType extends Type {
- protected StringType() {}
-
- public String toString() {
- return "string";
- }
-
- public boolean identicalTo(Type other) {
- return this == other;
- }
-
- public String toSignature() {
- return "Ljava/lang/String;";
- }
-
- public boolean isSimple() {
- return true;
- }
-
- public com.sun.org.apache.bcel.internal.generic.Type toJCType() {
- return com.sun.org.apache.bcel.internal.generic.Type.STRING;
- }
-
- /**
- * Translates a string into an object of internal type <code>type</code>.
- * The translation to int is undefined since strings are always converted
- * to reals in arithmetic expressions.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- Type type) {
- if (type == Type.Boolean) {
- translateTo(classGen, methodGen, (BooleanType) type);
- }
- else if (type == Type.Real) {
- translateTo(classGen, methodGen, (RealType) type);
- }
- else if (type == Type.Reference) {
- translateTo(classGen, methodGen, (ReferenceType) type);
- }
- else if (type == Type.ObjectString) {
- // NOP -> same representation
- }
- else {
- ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
- toString(), type.toString());
- classGen.getParser().reportError(Constants.FATAL, err);
- }
- }
-
- /**
- * Translates a string into a synthesized boolean.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- BooleanType type) {
- final InstructionList il = methodGen.getInstructionList();
- FlowList falsel = translateToDesynthesized(classGen, methodGen, type);
- il.append(ICONST_1);
- final BranchHandle truec = il.append(new GOTO(null));
- falsel.backPatch(il.append(ICONST_0));
- truec.setTarget(il.append(NOP));
- }
-
- /**
- * Translates a string into a real by calling stringToReal() from the
- * basis library.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- RealType type) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
- il.append(new INVOKESTATIC(cpg.addMethodref(BASIS_LIBRARY_CLASS,
- STRING_TO_REAL,
- STRING_TO_REAL_SIG)));
- }
-
- /**
- * Translates a string into a non-synthesized boolean. It does not push a
- * 0 or a 1 but instead returns branchhandle list to be appended to the
- * false list.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateToDesynthesized
- */
- public FlowList translateToDesynthesized(ClassGenerator classGen,
- MethodGenerator methodGen,
- BooleanType type) {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- il.append(new INVOKEVIRTUAL(cpg.addMethodref(STRING_CLASS,
- "length", "()I")));
- return new FlowList(il.append(new IFEQ(null)));
- }
-
- /**
- * Expects a string on the stack and pushes a boxed string.
- * Strings are already boxed so the translation is just a NOP.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- ReferenceType type) {
- methodGen.getInstructionList().append(NOP);
- }
-
- /**
- * Translates a internal string into an external (Java) string.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateFrom
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- Class clazz)
- {
- // Is String <: clazz? I.e. clazz in { String, Object }
- if (clazz.isAssignableFrom(java.lang.String.class)) {
- methodGen.getInstructionList().append(NOP);
- }
- else {
- ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
- toString(), clazz.getName());
- classGen.getParser().reportError(Constants.FATAL, err);
- }
- }
-
- /**
- * Translates an external (primitive) Java type into a string.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateFrom
- */
- public void translateFrom(ClassGenerator classGen,
- MethodGenerator methodGen, Class clazz)
- {
- final ConstantPoolGen cpg = classGen.getConstantPool();
- final InstructionList il = methodGen.getInstructionList();
-
- if (clazz.getName().equals("java.lang.String")) {
- // same internal representation, convert null to ""
- il.append(DUP);
- final BranchHandle ifNonNull = il.append(new IFNONNULL(null));
- il.append(POP);
- il.append(new PUSH(cpg, ""));
- ifNonNull.setTarget(il.append(NOP));
- }
- else {
- ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
- toString(), clazz.getName());
- classGen.getParser().reportError(Constants.FATAL, err);
- }
- }
-
- /**
- * Translates an object of this type to its boxed representation.
- */
- public void translateBox(ClassGenerator classGen,
- MethodGenerator methodGen) {
- translateTo(classGen, methodGen, Type.Reference);
- }
-
- /**
- * Translates an object of this type to its unboxed representation.
- */
- public void translateUnBox(ClassGenerator classGen,
- MethodGenerator methodGen) {
- methodGen.getInstructionList().append(NOP);
- }
-
- /**
- * Returns the class name of an internal type's external representation.
- */
- public String getClassName() {
- return(STRING_CLASS);
- }
-
-
- public Instruction LOAD(int slot) {
- return new ALOAD(slot);
- }
-
- public Instruction STORE(int slot) {
- return new ASTORE(slot);
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/TestGenerator.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/TestGenerator.java
deleted file mode 100644
index f6a62c0..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/TestGenerator.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: TestGenerator.java,v 1.2.4.1 2005/09/05 11:36:49 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-
-import com.sun.org.apache.bcel.internal.generic.ALOAD;
-import com.sun.org.apache.bcel.internal.generic.ASTORE;
-import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.ILOAD;
-import com.sun.org.apache.bcel.internal.generic.ISTORE;
-import com.sun.org.apache.bcel.internal.generic.Instruction;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.Type;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- */
-public final class TestGenerator extends MethodGenerator {
- private static int CONTEXT_NODE_INDEX = 1;
- private static int CURRENT_NODE_INDEX = 4;
- private static int ITERATOR_INDEX = 6;
-
- private Instruction _aloadDom;
- private final Instruction _iloadCurrent;
- private final Instruction _iloadContext;
- private final Instruction _istoreCurrent;
- private final Instruction _istoreContext;
- private final Instruction _astoreIterator;
- private final Instruction _aloadIterator;
-
- public TestGenerator(int access_flags, Type return_type,
- Type[] arg_types, String[] arg_names,
- String method_name, String class_name,
- InstructionList il, ConstantPoolGen cp) {
- super(access_flags, return_type, arg_types, arg_names, method_name,
- class_name, il, cp);
-
- _iloadCurrent = new ILOAD(CURRENT_NODE_INDEX);
- _istoreCurrent = new ISTORE(CURRENT_NODE_INDEX);
- _iloadContext = new ILOAD(CONTEXT_NODE_INDEX);
- _istoreContext = new ILOAD(CONTEXT_NODE_INDEX);
- _astoreIterator = new ASTORE(ITERATOR_INDEX);
- _aloadIterator = new ALOAD(ITERATOR_INDEX);
- }
-
- public int getHandlerIndex() {
- return INVALID_INDEX; // not available
- }
-
- public int getIteratorIndex() {
- return ITERATOR_INDEX; // not available
- }
-
- public void setDomIndex(int domIndex) {
- _aloadDom = new ALOAD(domIndex);
- }
-
- public Instruction loadDOM() {
- return _aloadDom;
- }
-
- public Instruction loadCurrentNode() {
- return _iloadCurrent;
- }
-
- /** by default context node is the same as current node. MK437 */
- public Instruction loadContextNode() {
- return _iloadContext;
- }
-
- public Instruction storeContextNode() {
- return _istoreContext;
- }
-
- public Instruction storeCurrentNode() {
- return _istoreCurrent;
- }
-
- public Instruction storeIterator() {
- return _astoreIterator;
- }
-
- public Instruction loadIterator() {
- return _aloadIterator;
- }
-
- public int getLocalIndex(String name) {
- if (name.equals("current")) {
- return CURRENT_NODE_INDEX;
- }
- else {
- return super.getLocalIndex(name);
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/Type.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/Type.java
deleted file mode 100644
index b0829dc..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/Type.java
+++ /dev/null
@@ -1,298 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Type.java,v 1.8 2007/03/28 16:51:19 joehw Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-
-import com.sun.org.apache.bcel.internal.generic.BranchInstruction;
-import com.sun.org.apache.bcel.internal.generic.Instruction;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.Constants;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.FlowList;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.NodeTest;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- */
-public abstract class Type implements Constants {
- public static final Type Int = new IntType();
- public static final Type Real = new RealType();
- public static final Type Boolean = new BooleanType();
- public static final Type NodeSet = new NodeSetType();
- public static final Type String = new StringType();
- public static final Type ResultTree = new ResultTreeType();
- public static final Type Reference = new ReferenceType();
- public static final Type Void = new VoidType();
-
- public static final Type Object = new ObjectType(java.lang.Object.class);
- public static final Type ObjectString = new ObjectType(java.lang.String.class);
-
- public static final Type Node = new NodeType(NodeTest.ANODE);
- public static final Type Root = new NodeType(NodeTest.ROOT);
- public static final Type Element = new NodeType(NodeTest.ELEMENT);
- public static final Type Attribute = new NodeType(NodeTest.ATTRIBUTE);
- public static final Type Text = new NodeType(NodeTest.TEXT);
- public static final Type Comment = new NodeType(NodeTest.COMMENT);
- public static final Type Processing_Instruction = new NodeType(NodeTest.PI);
-
- /**
- * Factory method to instantiate object types. Returns a pre-defined
- * instance for "java.lang.Object" and "java.lang.String".
- */
- public static Type newObjectType(String javaClassName) {
- if (javaClassName == "java.lang.Object") {
- return Type.Object;
- }
- else if (javaClassName == "java.lang.String") {
- return Type.ObjectString;
- }
- else {
- //
- java.security.AccessControlContext acc = java.security.AccessController.getContext();
- acc.checkPermission(new RuntimePermission("getContextClassLoader"));
- return new ObjectType(javaClassName);
- }
- }
-
- /**
- * Factory method to instantiate object types. Returns a pre-defined
- * instance for java.lang.Object.class and java.lang.String.class.
- */
- public static Type newObjectType(Class clazz) {
- if (clazz == java.lang.Object.class) {
- return Type.Object;
- }
- else if (clazz == java.lang.String.class) {
- return Type.ObjectString;
- }
- else {
- return new ObjectType(clazz);
- }
- }
-
- /**
- * Returns a string representation of this type.
- */
- public abstract String toString();
-
- /**
- * Returns true if this and other are identical types.
- */
- public abstract boolean identicalTo(Type other);
-
- /**
- * Returns true if this type is a numeric type. Redefined in NumberType.
- */
- public boolean isNumber() {
- return false;
- }
-
- /**
- * Returns true if this type has no object representaion. Redefined in
- * ResultTreeType.
- */
- public boolean implementedAsMethod() {
- return false;
- }
-
- /**
- * Returns true if this type is a simple type. Redefined in NumberType,
- * BooleanType and StringType.
- */
- public boolean isSimple() {
- return false;
- }
-
- public abstract com.sun.org.apache.bcel.internal.generic.Type toJCType();
-
- /**
- * Returns the distance between two types. This measure is used to select
- * overloaded functions/operators. This method is typically redefined by
- * the subclasses.
- */
- public int distanceTo(Type type) {
- return type == this ? 0 : Integer.MAX_VALUE;
- }
-
- /**
- * Returns the signature of an internal type's external representation.
- */
- public abstract String toSignature();
-
- /**
- * Translates an object of this type to an object of type
- * <code>type</code>.
- * Expects an object of the former type and pushes an object of the latter.
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- Type type) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
- toString(), type.toString());
- classGen.getParser().reportError(Constants.FATAL, err);
- }
-
- /**
- * Translates object of this type to an object of type <code>type</code>.
- * Expects an object of the former type and pushes an object of the latter
- * if not boolean. If type <code>type</code> is boolean then a branchhandle
- * list (to be appended to the false list) is returned.
- */
- public FlowList translateToDesynthesized(ClassGenerator classGen,
- MethodGenerator methodGen,
- Type type) {
- FlowList fl = null;
- if (type == Type.Boolean) {
- fl = translateToDesynthesized(classGen, methodGen,
- (BooleanType)type);
- }
- else {
- translateTo(classGen, methodGen, type);
- }
- return fl;
- }
-
- /**
- * Translates an object of this type to an non-synthesized boolean. It
- * does not push a 0 or a 1 but instead returns branchhandle list to be
- * appended to the false list.
- */
- public FlowList translateToDesynthesized(ClassGenerator classGen,
- MethodGenerator methodGen,
- BooleanType type) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
- toString(), type.toString());
- classGen.getParser().reportError(Constants.FATAL, err);
- return null;
- }
-
- /**
- * Translates an object of this type to the external (Java) type denoted
- * by <code>clazz</code>. This method is used to translate parameters
- * when external functions are called.
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- Class clazz) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
- toString(), clazz.getClass().toString());
- classGen.getParser().reportError(Constants.FATAL, err);
- }
-
- /**
- * Translates an external (Java) type denoted by <code>clazz</code> to
- * an object of this type. This method is used to translate return values
- * when external functions are called.
- */
- public void translateFrom(ClassGenerator classGen, MethodGenerator methodGen,
- Class clazz) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
- clazz.getClass().toString(), toString());
- classGen.getParser().reportError(Constants.FATAL, err);
- }
-
- /**
- * Translates an object of this type to its boxed representation.
- */
- public void translateBox(ClassGenerator classGen,
- MethodGenerator methodGen) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
- toString(), "["+toString()+"]");
- classGen.getParser().reportError(Constants.FATAL, err);
- }
-
- /**
- * Translates an object of this type to its unboxed representation.
- */
- public void translateUnBox(ClassGenerator classGen,
- MethodGenerator methodGen) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
- "["+toString()+"]", toString());
- classGen.getParser().reportError(Constants.FATAL, err);
- }
-
- /**
- * Returns the class name of an internal type's external representation.
- */
- public String getClassName() {
- return(EMPTYSTRING);
- }
-
- public Instruction ADD() {
- return null; // should never be called
- }
-
- public Instruction SUB() {
- return null; // should never be called
- }
-
- public Instruction MUL() {
- return null; // should never be called
- }
-
- public Instruction DIV() {
- return null; // should never be called
- }
-
- public Instruction REM() {
- return null; // should never be called
- }
-
- public Instruction NEG() {
- return null; // should never be called
- }
-
- public Instruction LOAD(int slot) {
- return null; // should never be called
- }
-
- public Instruction STORE(int slot) {
- return null; // should never be called
- }
-
- public Instruction POP() {
- return POP;
- }
-
- public BranchInstruction GT(boolean tozero) {
- return null; // should never be called
- }
-
- public BranchInstruction GE(boolean tozero) {
- return null; // should never be called
- }
-
- public BranchInstruction LT(boolean tozero) {
- return null; // should never be called
- }
-
- public BranchInstruction LE(boolean tozero) {
- return null; // should never be called
- }
-
- public Instruction CMP(boolean less) {
- return null; // should never be called
- }
-
- public Instruction DUP() {
- return DUP; // default
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/TypeCheckError.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/TypeCheckError.java
deleted file mode 100644
index 74aed64..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/TypeCheckError.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: TypeCheckError.java,v 1.2.4.1 2005/09/05 11:42:57 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-
-import com.sun.org.apache.xalan.internal.xsltc.compiler.SyntaxTreeNode;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-public class TypeCheckError extends Exception {
- static final long serialVersionUID = 3246224233917854640L;
- ErrorMsg _error = null;
- SyntaxTreeNode _node = null;
-
- public TypeCheckError(SyntaxTreeNode node) {
- super();
- _node = node;
- }
-
- public TypeCheckError(ErrorMsg error) {
- super();
- _error = error;
- }
-
- public TypeCheckError(String code, Object param) {
- super();
- _error = new ErrorMsg(code, param);
- }
-
- public TypeCheckError(String code, Object param1, Object param2) {
- super();
- _error = new ErrorMsg(code, param1, param2);
- }
-
- public ErrorMsg getErrorMsg() {
- return _error;
- }
-
- public String getMessage() {
- return toString();
- }
-
- public String toString() {
- String result;
-
- if (_error == null) {
- if (_node != null) {
- _error = new ErrorMsg(ErrorMsg.TYPE_CHECK_ERR,
- _node.toString());
- } else {
- _error = new ErrorMsg(ErrorMsg.TYPE_CHECK_UNK_LOC_ERR);
- }
- }
-
- return _error.toString();
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/Util.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/Util.java
deleted file mode 100644
index f1f9222..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/Util.java
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Util.java,v 1.2.4.1 2005/09/12 11:47:15 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-
-import java.util.StringTokenizer;
-
-import com.sun.org.apache.bcel.internal.generic.Type;
-import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.Constants;
-import com.sun.org.apache.xml.internal.utils.XML11Char;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-public final class Util {
- private static char filesep;
-
- static {
- String temp = SecuritySupport.getSystemProperty("file.separator", "/");
- filesep = temp.charAt(0);
- }
-
- public static String noExtName(String name) {
- final int index = name.lastIndexOf('.');
- return name.substring(0, index >= 0 ? index : name.length());
- }
-
- /**
- * Search for both slashes in order to support URLs and
- * files.
- */
- public static String baseName(String name) {
- int index = name.lastIndexOf('\\');
- if (index < 0) {
- index = name.lastIndexOf('/');
- }
-
- if (index >= 0)
- return name.substring(index + 1);
- else {
- int lastColonIndex = name.lastIndexOf(':');
- if (lastColonIndex > 0)
- return name.substring(lastColonIndex + 1);
- else
- return name;
- }
- }
-
- /**
- * Search for both slashes in order to support URLs and
- * files.
- */
- public static String pathName(String name) {
- int index = name.lastIndexOf('/');
- if (index < 0) {
- index = name.lastIndexOf('\\');
- }
- return name.substring(0, index + 1);
- }
-
- /**
- * Replace all illegal Java chars by '_'.
- */
- public static String toJavaName(String name) {
- if (name.length() > 0) {
- final StringBuffer result = new StringBuffer();
-
- char ch = name.charAt(0);
- result.append(Character.isJavaIdentifierStart(ch) ? ch : '_');
-
- final int n = name.length();
- for (int i = 1; i < n; i++) {
- ch = name.charAt(i);
- result.append(Character.isJavaIdentifierPart(ch) ? ch : '_');
- }
- return result.toString();
- }
- return name;
- }
-
- public static Type getJCRefType(String signature) {
- return Type.getType(signature);
- }
-
- public static String internalName(String cname) {
- return cname.replace('.', filesep);
- }
-
- public static void println(String s) {
- System.out.println(s);
- }
-
- public static void println(char ch) {
- System.out.println(ch);
- }
-
- public static void TRACE1() {
- System.out.println("TRACE1");
- }
-
- public static void TRACE2() {
- System.out.println("TRACE2");
- }
-
- public static void TRACE3() {
- System.out.println("TRACE3");
- }
-
- /**
- * Replace a certain character in a string with a new substring.
- */
- public static String replace(String base, char ch, String str) {
- return (base.indexOf(ch) < 0) ? base :
- replace(base, String.valueOf(ch), new String[] { str });
- }
-
- public static String replace(String base, String delim, String[] str) {
- final int len = base.length();
- final StringBuffer result = new StringBuffer();
-
- for (int i = 0; i < len; i++) {
- final char ch = base.charAt(i);
- final int k = delim.indexOf(ch);
-
- if (k >= 0) {
- result.append(str[k]);
- }
- else {
- result.append(ch);
- }
- }
- return result.toString();
- }
-
- /**
- * Replace occurances of '.', '-', '/' and ':'
- */
- public static String escape(String input) {
- return replace(input, ".-/:",
- new String[] { "$dot$", "$dash$", "$slash$", "$colon$" });
- }
-
- public static String getLocalName(String qname) {
- final int index = qname.lastIndexOf(":");
- return (index > 0) ? qname.substring(index + 1) : qname;
- }
-
- public static String getPrefix(String qname) {
- final int index = qname.lastIndexOf(":");
- return (index > 0) ? qname.substring(0, index) :
- Constants.EMPTYSTRING;
- }
-
- /**
- * Checks if the string is a literal (i.e. not an AVT) or not.
- */
- public static boolean isLiteral(String str) {
- final int length = str.length();
- for (int i = 0; i < length - 1; i++) {
- if (str.charAt(i) == '{' && str.charAt(i + 1) != '{') {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Checks if the string is valid list of qnames
- */
- public static boolean isValidQNames(String str) {
- if ((str != null) && (!str.equals(Constants.EMPTYSTRING))) {
- final StringTokenizer tokens = new StringTokenizer(str);
- while (tokens.hasMoreTokens()) {
- if (!XML11Char.isXML11ValidQName(tokens.nextToken())) {
- return false;
- }
- }
- }
- return true;
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/VoidType.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/VoidType.java
deleted file mode 100644
index cb904f1..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/VoidType.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: VoidType.java,v 1.2.4.1 2005/09/05 11:45:26 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-
-import com.sun.org.apache.bcel.internal.generic.Instruction;
-import com.sun.org.apache.bcel.internal.generic.InstructionList;
-import com.sun.org.apache.bcel.internal.generic.PUSH;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.Constants;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-public final class VoidType extends Type {
- protected VoidType() {}
-
- public String toString() {
- return "void";
- }
-
- public boolean identicalTo(Type other) {
- return this == other;
- }
-
- public String toSignature() {
- return "V";
- }
-
- public com.sun.org.apache.bcel.internal.generic.Type toJCType() {
- return null; // should never be called
- }
-
- public Instruction POP() {
- return NOP;
- }
-
- /**
- * Translates a void into an object of internal type <code>type</code>.
- * This translation is needed when calling external functions
- * that return void.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- Type type) {
- if (type == Type.String) {
- translateTo(classGen, methodGen, (StringType) type);
- }
- else {
- ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
- toString(), type.toString());
- classGen.getParser().reportError(Constants.FATAL, err);
- }
- }
-
- /**
- * Translates a void into a string by pushing the empty string ''.
- *
- * @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
- */
- public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
- StringType type) {
- final InstructionList il = methodGen.getInstructionList();
- il.append(new PUSH(classGen.getConstantPool(), ""));
- }
-
- /**
- * Translates an external (primitive) Java type into a void.
- * Only an external "void" can be converted to this class.
- */
- public void translateFrom(ClassGenerator classGen, MethodGenerator methodGen,
- Class clazz) {
- if (!clazz.getName().equals("void")) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
- toString(), clazz.getName());
- classGen.getParser().reportError(Constants.FATAL, err);
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/xpath.cup b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/xpath.cup
deleted file mode 100644
index 12bfa2a..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/xpath.cup
+++ /dev/null
@@ -1,1116 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- * $Id: xpath.cup,v 1.51 2004/12/15 17:35:39 jycli Exp $
- */
-
-/*
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- * @author G. Todd Miller
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import java.util.Stack;
-import java.util.Vector;
-import java.io.StringReader;
-import com.sun.java_cup.internal.runtime.*;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xalan.internal.xsltc.DOM;
-import com.sun.org.apache.xml.internal.dtm.Axis;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.Operators;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-
-parser code {:
- /**
- * Used by function calls with no args.
- */
- static public final Vector EmptyArgs = new Vector(0);
-
- /**
- * Reference to non-existing variable.
- */
- static public final VariableRef DummyVarRef = null;
-
- /**
- * Reference to the Parser class.
- */
- private Parser _parser;
- private XSLTC _xsltc;
-
- /**
- * String representation of the expression being parsed.
- */
- private String _expression;
-
- /**
- * Line number where this expression/pattern was declared.
- */
- private int _lineNumber = 0;
-
- /**
- * Reference to the symbol table.
- */
- public SymbolTable _symbolTable;
-
- public XPathParser(Parser parser) {
- _parser = parser;
- _xsltc = parser.getXSLTC();
- _symbolTable = parser.getSymbolTable();
- }
-
- public int getLineNumber() {
- return _lineNumber;
- }
-
- public QName getQNameIgnoreDefaultNs(String name) {
- return _parser.getQNameIgnoreDefaultNs(name);
- }
-
- public QName getQName(String namespace, String prefix, String localname) {
- return _parser.getQName(namespace, prefix, localname);
- }
-
- public void setMultiDocument(boolean flag) {
- _xsltc.setMultiDocument(flag);
- }
-
- public void setCallsNodeset(boolean flag) {
- _xsltc.setCallsNodeset(flag);
- }
-
- public void setHasIdCall(boolean flag) {
- _xsltc.setHasIdCall(flag);
- }
-
-
- /**
- * This method is similar to findNodeType(int, Object) except that it
- * creates a StepPattern instead of just returning a node type. It also
- * differs in the way it handles "{uri}:*" and "{uri}:@*". The last two
- * patterns are expanded as "*[namespace-uri() = 'uri']" and
- * "@*[namespace-uri() = 'uri']", respectively. This expansion considerably
- * simplifies the grouping of patterns in the Mode class. For this
- * expansion to be correct, the priority of the pattern/template must be
- * set to -0.25 (when no other predicates are present).
- */
- public StepPattern createStepPattern(int axis, Object test, Vector predicates) {
- int nodeType;
-
- if (test == null) { // "*"
- nodeType = (axis == Axis.ATTRIBUTE) ? NodeTest.ATTRIBUTE :
- (axis == Axis.NAMESPACE) ? -1 : NodeTest.ELEMENT;
-
- return new StepPattern(axis, nodeType, predicates);
- }
- else if (test instanceof Integer) {
- nodeType = ((Integer) test).intValue();
-
- return new StepPattern(axis, nodeType, predicates);
- }
- else {
- QName name = (QName)test;
- boolean setPriority = false;
-
- if (axis == Axis.NAMESPACE) {
- nodeType = (name.toString().equals("*")) ? -1
- : _xsltc.registerNamespacePrefix(name);;
- }
- else {
- final String uri = name.getNamespace();
- final String local = name.getLocalPart();
- final QName namespace_uri =
- _parser.getQNameIgnoreDefaultNs("namespace-uri");
-
- // Expand {uri}:* to *[namespace-uri() = 'uri'] - same for @*
- if (uri != null && (local.equals("*") || local.equals("@*"))) {
- if (predicates == null) {
- predicates = new Vector(2);
- }
-
- // Priority is set by hand if no other predicates exist
- setPriority = (predicates.size() == 0);
-
- predicates.add(
- new Predicate(
- new EqualityExpr(Operators.EQ,
- new NamespaceUriCall(namespace_uri),
- new LiteralExpr(uri))));
- }
-
- if (local.equals("*")) {
- nodeType = (axis == Axis.ATTRIBUTE) ? NodeTest.ATTRIBUTE
- : NodeTest.ELEMENT;
- }
- else if (local.equals("@*")) {
- nodeType = NodeTest.ATTRIBUTE;
- }
- else {
- nodeType = (axis == Axis.ATTRIBUTE) ? _xsltc.registerAttribute(name)
- : _xsltc.registerElement(name);
- }
- }
-
- final StepPattern result = new StepPattern(axis, nodeType, predicates);
-
- // Set priority for case prefix:* and prefix:@* (no predicates)
- if (setPriority) {
- result.setPriority(-0.25);
- }
-
- return result;
- }
- }
-
- public int findNodeType(int axis, Object test) {
- if (test == null) { // *
- return (axis == Axis.ATTRIBUTE) ?
- NodeTest.ATTRIBUTE :
- (axis == Axis.NAMESPACE) ? -1 : NodeTest.ELEMENT;
- }
- else if (test instanceof Integer) {
- return ((Integer)test).intValue();
- }
- else {
- QName name = (QName)test;
-
- if (axis == Axis.NAMESPACE) {
- return (name.toString().equals("*")) ? -1
- : _xsltc.registerNamespacePrefix(name);
- }
-
- if (name.getNamespace() == null) {
- final String local = name.getLocalPart();
-
- if (local.equals("*")) {
- return (axis == Axis.ATTRIBUTE) ? NodeTest.ATTRIBUTE
- : NodeTest.ELEMENT;
- }
- else if (local.equals("@*")) {
- return NodeTest.ATTRIBUTE;
- }
- }
-
- return (axis == Axis.ATTRIBUTE) ? _xsltc.registerAttribute(name)
- : _xsltc.registerElement(name);
- }
- }
-
- /**
- * Parse the expression passed to the current scanner. If this
- * expression contains references to local variables and it will be
- * compiled in an external module (not in the main class) request
- * the current template to create a new variable stack frame.
- *
- * @param lineNumber Line where the current expression is defined.
- * @param external Set to <tt>true</tt> if this expression is
- * compiled in a separate module.
- *
- */
- public Symbol parse(String expression, int lineNumber) throws Exception {
- try {
- _expression = expression;
- _lineNumber = lineNumber;
- return super.parse();
- }
- catch (IllegalCharException e) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.ILLEGAL_CHAR_ERR,
- lineNumber, e.getMessage());
- _parser.reportError(Constants.FATAL, err);
- }
- return null;
- }
-
- /**
- * Lookup a variable or parameter in the symbol table given its name.
- *
- * @param name Name of the symbol being looked up.
- */
- final SyntaxTreeNode lookupName(QName name) {
- // Is it a local var or param ?
- final SyntaxTreeNode result = _parser.lookupVariable(name);
- if (result != null)
- return(result);
- else
- return(_symbolTable.lookupName(name));
- }
-
- public final void addError(ErrorMsg error) {
- _parser.reportError(Constants.ERROR, error);
- }
-
- public void report_error(String message, Object info) {
- final ErrorMsg err = new ErrorMsg(ErrorMsg.SYNTAX_ERR, _lineNumber,
- _expression);
- _parser.reportError(Constants.FATAL, err);
- }
-
- public void report_fatal_error(String message, Object info) {
- // empty
- }
-
- public RelativeLocationPath insertStep(Step step, RelativeLocationPath rlp) {
- if (rlp instanceof Step) {
- return new ParentLocationPath(step, (Step) rlp);
- }
- else if (rlp instanceof ParentLocationPath) {
- final ParentLocationPath plp = (ParentLocationPath) rlp;
- final RelativeLocationPath newrlp = insertStep(step, plp.getPath());
- return new ParentLocationPath(newrlp, plp.getStep());
- }
- else {
- addError(new ErrorMsg(ErrorMsg.INTERNAL_ERR, "XPathParser.insertStep"));
- return rlp;
- }
- }
-
- /**
- * Returns true if the axis applies to elements only. The axes
- * child, attribute, namespace, descendant result in non-empty
- * nodesets only if the context node is of type element.
- */
- public boolean isElementAxis(int axis) {
- return (axis == Axis.CHILD || axis == Axis.ATTRIBUTE ||
- axis == Axis.NAMESPACE || axis == Axis.DESCENDANT);
- }
-:}
-
-terminal SLASH, DOT, LBRACK, RBRACK, VBAR, LPAREN, RPAREN, STAR, COMMA;
-terminal DOLLAR, ATSIGN;
-terminal DDOT, DCOLON, DSLASH;
-terminal EQ, NE;
-terminal LT, GT, LE, GE;
-terminal PLUS, MINUS, DIV, MOD, MULT;
-terminal String Literal;
-terminal String QNAME;
-terminal ID, KEY, TEXT, NODE, OR, AND, COMMENT, PI, PIPARAM, PRECEDINGSIBLING;
-terminal SELF, PARENT, CHILD, ATTRIBUTE, ANCESTOR, ANCESTORORSELF, DESCENDANT;
-terminal DESCENDANTORSELF, FOLLOWING, FOLLOWINGSIBLING, NAMESPACE, PRECEDING;
-terminal Double REAL;
-terminal Long INT;
-terminal PATTERN, EXPRESSION;
-
-non terminal SyntaxTreeNode TopLevel;
-
-non terminal Expression Expr, Argument, LocationPath;
-non terminal Expression Predicate, FilterExpr, Step;
-non terminal Expression OrExpr, AndExpr, EqualityExpr;
-non terminal Expression RelationalExpr, AdditiveExpr;
-non terminal Expression MultiplicativeExpr, UnaryExpr;
-non terminal Expression VariableReference, FunctionCall;
-non terminal Expression PrimaryExpr, UnionExpr, PathExpr, AbbreviatedStep;
-non terminal Expression RelativeLocationPath, AbbreviatedRelativeLocationPath;
-non terminal Expression AbsoluteLocationPath, AbbreviatedAbsoluteLocationPath;
-
-non terminal Object NodeTest, NameTest;
-
-non terminal IdKeyPattern IdKeyPattern;
-non terminal Pattern Pattern;
-non terminal Pattern LocationPathPattern;
-non terminal StepPattern ProcessingInstructionPattern;
-non terminal RelativePathPattern RelativePathPattern;
-non terminal StepPattern StepPattern;
-non terminal Object NodeTestPattern, NameTestPattern;
-
-non terminal Vector Predicates, NonemptyArgumentList;
-non terminal QName QName, FunctionName, VariableName;
-non terminal Integer AxisName, AxisSpecifier;
-non terminal Integer ChildOrAttributeAxisSpecifier;
-
-precedence left VBAR;
-precedence left OR;
-precedence left AND;
-precedence nonassoc EQ, NE;
-precedence left LT, GT, LE, GE;
-
-precedence left PLUS, MINUS;
-precedence left DIV, MOD, MULT;
-precedence left DOLLAR;
-precedence left ATSIGN;
-precedence right DCOLON;
-
-start with TopLevel;
-
-TopLevel ::= PATTERN Pattern:pattern
- {: RESULT = pattern; :}
-
- | EXPRESSION Expr:expr
- {: RESULT = expr; :};
-
-/* --------------------------- Patterns ----------------------------------- */
-
-Pattern ::= LocationPathPattern:lpp
- {: RESULT = lpp; :}
-
- | LocationPathPattern:lpp VBAR Pattern:p
- {: RESULT = new AlternativePattern(lpp, p); :};
-
-LocationPathPattern ::= SLASH
- {: RESULT = new AbsolutePathPattern(null); :}
-
- | SLASH RelativePathPattern:rpp
- {: RESULT = new AbsolutePathPattern(rpp); :}
-
- | IdKeyPattern:ikp
- {: RESULT = ikp; :}
-
- | IdKeyPattern:ikp SLASH RelativePathPattern:rpp
- {: RESULT = new ParentPattern(ikp, rpp); :}
-
- | IdKeyPattern:ikp DSLASH RelativePathPattern:rpp
- {: RESULT = new AncestorPattern(ikp, rpp); :}
-
- | DSLASH RelativePathPattern:rpp
- {: RESULT = new AncestorPattern(rpp); :}
-
- | RelativePathPattern:rpp
- {: RESULT = rpp; :};
-
-IdKeyPattern ::= ID LPAREN Literal:l RPAREN
- {: RESULT = new IdPattern(l);
- parser.setHasIdCall(true);
- :}
-
- | KEY LPAREN Literal:l1 COMMA Literal:l2 RPAREN
- {: RESULT = new KeyPattern(l1, l2); :};
-
-ProcessingInstructionPattern ::= PIPARAM LPAREN Literal:l RPAREN
- {: RESULT = new ProcessingInstructionPattern(l); :};
-
-RelativePathPattern ::= StepPattern:sp
- {: RESULT = sp; :}
-
- | StepPattern:sp SLASH RelativePathPattern:rpp
- {: RESULT = new ParentPattern(sp, rpp); :}
-
- | StepPattern:sp DSLASH RelativePathPattern:rpp
- {: RESULT = new AncestorPattern(sp, rpp); :};
-
-StepPattern ::= NodeTestPattern:nt
- {:
- RESULT = parser.createStepPattern(Axis.CHILD, nt, null);
- :}
-
- | NodeTestPattern:nt Predicates:pp
- {:
- RESULT = parser.createStepPattern(Axis.CHILD, nt, pp);
- :}
-
- | ProcessingInstructionPattern:pip
- {: RESULT = pip; :}
-
- | ProcessingInstructionPattern:pip Predicates:pp
- {: RESULT = (ProcessingInstructionPattern)pip.setPredicates(pp); :}
-
- | ChildOrAttributeAxisSpecifier:axis NodeTestPattern:nt
- {:
- RESULT = parser.createStepPattern(axis.intValue(), nt, null);
- :}
-
- | ChildOrAttributeAxisSpecifier:axis
- NodeTestPattern:nt Predicates:pp
- {:
- RESULT = parser.createStepPattern(axis.intValue(), nt, pp);
- :}
-
- | ChildOrAttributeAxisSpecifier:axis ProcessingInstructionPattern:pip
- {:
- RESULT = pip; // TODO: report error if axis is attribute
- :}
-
- | ChildOrAttributeAxisSpecifier:axis ProcessingInstructionPattern:pip
- Predicates:pp
- {:
- // TODO: report error if axis is attribute
- RESULT = (ProcessingInstructionPattern)pip.setPredicates(pp);
- :};
-
-NodeTestPattern ::= NameTestPattern:nt
- {: RESULT = nt; :}
-
- | NODE
- {: RESULT = new Integer(NodeTest.ANODE); :}
-
- | TEXT
- {: RESULT = new Integer(NodeTest.TEXT); :}
-
- | COMMENT
- {: RESULT = new Integer(NodeTest.COMMENT); :}
-
- | PI
- {: RESULT = new Integer(NodeTest.PI); :};
-
-NameTestPattern ::= STAR
- {: RESULT = null; :}
-
- | QName:qn
- {: RESULT = qn; :};
-
-ChildOrAttributeAxisSpecifier ::= ATSIGN
- {: RESULT = new Integer(Axis.ATTRIBUTE); :}
-
- | CHILD DCOLON
- {: RESULT = new Integer(Axis.CHILD); :}
-
- | ATTRIBUTE DCOLON
- {: RESULT = new Integer(Axis.ATTRIBUTE); :};
-
-Predicates ::= Predicate:p
- {:
- Vector temp = new Vector();
- temp.addElement(p);
- RESULT = temp;
- :}
-
- | Predicate:p Predicates:pp
- {: pp.insertElementAt(p, 0); RESULT = pp; :};
-
-Predicate ::= LBRACK Expr:e RBRACK
- {:
- RESULT = new Predicate(e);
- :};
-
-/* --------------------------- Expressions --------------------------------- */
-
-Expr ::= OrExpr:ex
- {: RESULT = ex; :};
-
-OrExpr ::= AndExpr:ae
- {: RESULT = ae; :}
-
- | OrExpr:oe OR AndExpr:ae
- {: RESULT = new LogicalExpr(LogicalExpr.OR, oe, ae); :};
-
-AndExpr ::= EqualityExpr:e
- {: RESULT = e; :}
-
- | AndExpr:ae AND EqualityExpr:ee
- {: RESULT = new LogicalExpr(LogicalExpr.AND, ae, ee); :};
-
-EqualityExpr ::= RelationalExpr:re
- {: RESULT = re; :}
-
- | EqualityExpr:ee EQ RelationalExpr:re
- {: RESULT = new EqualityExpr(Operators.EQ, ee, re); :}
-
- | EqualityExpr:ee NE RelationalExpr:re
- {: RESULT = new EqualityExpr(Operators.NE, ee, re); :};
-
-RelationalExpr ::= AdditiveExpr:ae
- {: RESULT = ae; :}
-
- | RelationalExpr:re LT AdditiveExpr:ae
- {: RESULT = new RelationalExpr(Operators.LT, re, ae); :}
-
- | RelationalExpr:re GT AdditiveExpr:ae
- {: RESULT = new RelationalExpr(Operators.GT, re, ae); :}
-
- | RelationalExpr:re LE AdditiveExpr:ae
- {: RESULT = new RelationalExpr(Operators.LE, re, ae); :}
-
- | RelationalExpr:re GE AdditiveExpr:ae
- {: RESULT = new RelationalExpr(Operators.GE, re, ae); :};
-
-AdditiveExpr ::= MultiplicativeExpr:me
- {: RESULT = me; :}
-
- | AdditiveExpr:ae PLUS MultiplicativeExpr:me
- {: RESULT = new BinOpExpr(BinOpExpr.PLUS, ae, me); :}
-
- | AdditiveExpr:ae MINUS MultiplicativeExpr:me
- {: RESULT = new BinOpExpr(BinOpExpr.MINUS, ae, me); :};
-
-MultiplicativeExpr ::= UnaryExpr:ue
- {: RESULT = ue; :}
-
- | MultiplicativeExpr:me MULT UnaryExpr:ue
- {: RESULT = new BinOpExpr(BinOpExpr.TIMES, me, ue); :}
-
- | MultiplicativeExpr:me DIV UnaryExpr:ue
- {: RESULT = new BinOpExpr(BinOpExpr.DIV, me, ue); :}
-
- | MultiplicativeExpr:me MOD UnaryExpr:ue
- {: RESULT = new BinOpExpr(BinOpExpr.MOD, me, ue); :};
-
-UnaryExpr ::= UnionExpr:ue
- {: RESULT = ue; :}
-
- | MINUS UnaryExpr:ue
- {: RESULT = new UnaryOpExpr(ue); :};
-
-UnionExpr ::= PathExpr:pe
- {: RESULT = pe; :}
-
- | PathExpr:pe VBAR UnionExpr:rest
- {: RESULT = new UnionPathExpr(pe, rest); :};
-
-PathExpr ::= LocationPath:lp
- {: RESULT = lp; :}
-
- | FilterExpr:fexp
- {: RESULT = fexp; :}
-
- | FilterExpr:fexp SLASH RelativeLocationPath:rlp
- {: RESULT = new FilterParentPath(fexp, rlp); :}
-
- | FilterExpr:fexp DSLASH RelativeLocationPath:rlp
- {:
- //
- // Expand '//' into '/descendant-or-self::node()/' or
- // into /descendant-or-self::*/
- //
- int nodeType = DOM.NO_TYPE;
- if (rlp instanceof Step &&
- parser.isElementAxis(((Step) rlp).getAxis()))
- {
- nodeType = DTM.ELEMENT_NODE;
- }
- final Step step = new Step(Axis.DESCENDANTORSELF, nodeType, null);
- FilterParentPath fpp = new FilterParentPath(fexp, step);
- fpp = new FilterParentPath(fpp, rlp);
- if (fexp instanceof KeyCall == false) {
- fpp.setDescendantAxis();
- }
- RESULT = fpp;
- :};
-
-LocationPath ::= RelativeLocationPath:rlp
- {: RESULT = rlp; :}
-
- | AbsoluteLocationPath:alp
- {: RESULT = alp; :};
-
-RelativeLocationPath ::= Step:step
- {: RESULT = step; :}
-
- | RelativeLocationPath:rlp SLASH Step:step
- {:
- if (rlp instanceof Step && ((Step) rlp).isAbbreviatedDot()) {
- RESULT = step; // Remove './' from the middle
- }
- else if (((Step) step).isAbbreviatedDot()) {
- RESULT = rlp; // Remove '/.' from the end
- }
- else {
- RESULT =
- new ParentLocationPath((RelativeLocationPath) rlp, step);
- }
- :}
-
- | AbbreviatedRelativeLocationPath:arlp
- {: RESULT = arlp; :};
-
-AbsoluteLocationPath ::= SLASH
- {: RESULT = new AbsoluteLocationPath(); :}
-
- | SLASH RelativeLocationPath:rlp
- {: RESULT = new AbsoluteLocationPath(rlp); :}
-
- | AbbreviatedAbsoluteLocationPath:aalp
- {: RESULT = aalp; :};
-
-AbbreviatedRelativeLocationPath ::= RelativeLocationPath:rlp DSLASH Step:step
- {:
- final Step right = (Step)step;
- final int axis = right.getAxis();
- final int type = right.getNodeType();
- final Vector predicates = right.getPredicates();
-
- if ((axis == Axis.CHILD) && (type != NodeTest.ATTRIBUTE)) {
- // Compress './/child:E' into 'descendant::E' - if possible
- if (predicates == null) {
- right.setAxis(Axis.DESCENDANT);
- if (rlp instanceof Step && ((Step)rlp).isAbbreviatedDot()) {
- RESULT = right;
- }
- else {
- // Expand 'rlp//child::E' into 'rlp/descendant::E'
- RelativeLocationPath left = (RelativeLocationPath)rlp;
- RESULT = new ParentLocationPath(left, right);
- }
- }
- else {
- // Expand './/step' -> 'descendant-or-self::*/step'
- if (rlp instanceof Step && ((Step)rlp).isAbbreviatedDot()) {
- Step left = new Step(Axis.DESCENDANTORSELF,
- DTM.ELEMENT_NODE, null);
- RESULT = new ParentLocationPath(left, right);
- }
- else {
- // Expand 'rlp//step' -> 'rlp/descendant-or-self::*/step'
- RelativeLocationPath left = (RelativeLocationPath)rlp;
- Step mid = new Step(Axis.DESCENDANTORSELF,
- DTM.ELEMENT_NODE, null);
- ParentLocationPath ppl = new ParentLocationPath(mid, right);
- RESULT = new ParentLocationPath(left, ppl);
- }
- }
- }
- else if ((axis == Axis.ATTRIBUTE) || (type == NodeTest.ATTRIBUTE)) {
- // Expand 'rlp//step' -> 'rlp/descendant-or-self::*/step'
- RelativeLocationPath left = (RelativeLocationPath)rlp;
- Step middle = new Step(Axis.DESCENDANTORSELF,
- DTM.ELEMENT_NODE, null);
- ParentLocationPath ppl = new ParentLocationPath(middle, right);
- RESULT = new ParentLocationPath(left, ppl);
- }
- else {
- // Expand 'rlp//step' -> 'rlp/descendant-or-self::node()/step'
- RelativeLocationPath left = (RelativeLocationPath)rlp;
- Step middle = new Step(Axis.DESCENDANTORSELF,
- DOM.NO_TYPE, null);
- ParentLocationPath ppl = new ParentLocationPath(middle, right);
- RESULT = new ParentLocationPath(left, ppl);
- }
- :};
-
-
-AbbreviatedAbsoluteLocationPath ::= DSLASH RelativeLocationPath:rlp
- {:
- //
- // Expand '//' into '/descendant-or-self::node()/' or
- // into /descendant-or-self::*/
- //
- int nodeType = DOM.NO_TYPE;
- if (rlp instanceof Step &&
- parser.isElementAxis(((Step) rlp).getAxis()))
- {
- nodeType = DTM.ELEMENT_NODE;
- }
- final Step step = new Step(Axis.DESCENDANTORSELF, nodeType, null);
- RESULT = new AbsoluteLocationPath(parser.insertStep(step,
- (RelativeLocationPath) rlp));
- :};
-
-Step ::= NodeTest:ntest
- {:
- if (ntest instanceof Step) {
- RESULT = (Step)ntest;
- }
- else {
- RESULT = new Step(Axis.CHILD,
- parser.findNodeType(Axis.CHILD, ntest),
- null);
- }
- :}
-
- | NodeTest:ntest Predicates:pp
- {:
- if (ntest instanceof Step) {
- Step step = (Step)ntest;
- step.addPredicates(pp);
- RESULT = (Step)ntest;
- }
- else {
- RESULT = new Step(Axis.CHILD,
- parser.findNodeType(Axis.CHILD, ntest), pp);
- }
- :}
-
- | AxisSpecifier:axis NodeTest:ntest Predicates:pp
- {: RESULT = new Step(axis.intValue(),
- parser.findNodeType(axis.intValue(), ntest),
- pp);
- :}
-
- | AxisSpecifier:axis NodeTest:ntest
- {: RESULT = new Step(axis.intValue(),
- parser.findNodeType(axis.intValue(), ntest),
- null);
- :}
-
- | AbbreviatedStep:abbrev
- {: RESULT = abbrev; :};
-
-AxisSpecifier ::= AxisName:an DCOLON
- {: RESULT = an; :}
-
- | ATSIGN
- {: RESULT = new Integer(Axis.ATTRIBUTE); :};
-
-AxisName ::= ANCESTOR
- {: RESULT = new Integer(Axis.ANCESTOR); :}
-
- | ANCESTORORSELF
- {: RESULT = new Integer(Axis.ANCESTORORSELF); :}
-
- | ATTRIBUTE
- {: RESULT = new Integer(Axis.ATTRIBUTE); :}
-
- | CHILD
- {: RESULT = new Integer(Axis.CHILD); :}
-
- | DESCENDANT
- {: RESULT = new Integer(Axis.DESCENDANT); :}
-
- | DESCENDANTORSELF
- {: RESULT = new Integer(Axis.DESCENDANTORSELF); :}
-
- | FOLLOWING
- {: RESULT = new Integer(Axis.FOLLOWING); :}
-
- | FOLLOWINGSIBLING
- {: RESULT = new Integer(Axis.FOLLOWINGSIBLING); :}
-
- | NAMESPACE
- {: RESULT = new Integer(Axis.NAMESPACE); :}
-
- | PARENT
- {: RESULT = new Integer(Axis.PARENT); :}
-
- | PRECEDING
- {: RESULT = new Integer(Axis.PRECEDING); :}
-
- | PRECEDINGSIBLING
- {: RESULT = new Integer(Axis.PRECEDINGSIBLING); :}
-
- | SELF
- {: RESULT = new Integer(Axis.SELF); :};
-
-AbbreviatedStep ::= DOT
- {: RESULT = new Step(Axis.SELF, NodeTest.ANODE, null); :}
-
- | DDOT
- {: RESULT = new Step(Axis.PARENT, NodeTest.ANODE, null); :};
-
-FilterExpr ::= PrimaryExpr:primary
- {: RESULT = primary; :}
-
- | PrimaryExpr:primary Predicates:pp
- {: RESULT = new FilterExpr(primary, pp); :};
-
-PrimaryExpr ::= VariableReference:vr
- {: RESULT = vr; :}
-
- | LPAREN Expr:ex RPAREN
- {: RESULT = ex; :}
-
- | Literal:string
- {:
- /*
- * If the string appears to have the syntax of a QName, store
- * namespace info in the literal expression. This is used for
- * element-available and function-available functions, among
- * others. Also, the default namespace must be ignored.
- */
- String namespace = null;
- final int index = string.lastIndexOf(':');
-
- if (index > 0) {
- final String prefix = string.substring(0, index);
- namespace = parser._symbolTable.lookupNamespace(prefix);
- }
- RESULT = (namespace == null) ? new LiteralExpr(string)
- : new LiteralExpr(string, namespace);
- :}
-
- | INT:num
- {:
- long value = num.longValue();
- if (value < Integer.MIN_VALUE || value > Integer.MAX_VALUE) {
- RESULT = new RealExpr(value);
- }
- else {
- if (num.doubleValue() == -0)
- RESULT = new RealExpr(num.doubleValue());
- else if (num.intValue() == 0)
- RESULT = new IntExpr(num.intValue());
- else if (num.doubleValue() == 0.0)
- RESULT = new RealExpr(num.doubleValue());
- else
- RESULT = new IntExpr(num.intValue());
- }
- :}
-
- | REAL:num
- {: RESULT = new RealExpr(num.doubleValue()); :}
-
- | FunctionCall:fc
- {: RESULT = fc; :};
-
-VariableReference ::= DOLLAR VariableName:varName
- {:
- // An empty qname prefix for a variable or parameter reference
- // should map to the null namespace and not the default URI.
- SyntaxTreeNode node = parser.lookupName(varName);
-
- if (node != null) {
- if (node instanceof Variable) {
- RESULT = new VariableRef((Variable)node);
- }
- else if (node instanceof Param) {
- RESULT = new ParameterRef((Param)node);
- }
- else {
- RESULT = new UnresolvedRef(varName);
- }
- }
-
- if (node == null) {
- RESULT = new UnresolvedRef(varName);
- }
- :};
-
-FunctionCall ::= FunctionName:fname LPAREN RPAREN
- {:
-
- if (parser.getQNameIgnoreDefaultNs("current").equals(fname)) {
- RESULT = new CurrentCall(fname);
- }
- else if (parser.getQNameIgnoreDefaultNs("number").equals(fname)) {
- RESULT = new NumberCall(fname, parser.EmptyArgs);
- }
- else if (parser.getQNameIgnoreDefaultNs("string").equals(fname)) {
- RESULT = new StringCall(fname, parser.EmptyArgs);
- }
- else if (parser.getQNameIgnoreDefaultNs("concat").equals(fname)) {
- RESULT = new ConcatCall(fname, parser.EmptyArgs);
- }
- else if (parser.getQNameIgnoreDefaultNs("true").equals(fname)) {
- RESULT = new BooleanExpr(true);
- }
- else if (parser.getQNameIgnoreDefaultNs("false").equals(fname)) {
- RESULT = new BooleanExpr(false);
- }
- else if (parser.getQNameIgnoreDefaultNs("name").equals(fname)) {
- RESULT = new NameCall(fname);
- }
- else if (parser.getQNameIgnoreDefaultNs("generate-id").equals(fname)) {
- RESULT = new GenerateIdCall(fname, parser.EmptyArgs);
- }
- else if (parser.getQNameIgnoreDefaultNs("string-length").equals(fname)) {
- RESULT = new StringLengthCall(fname, parser.EmptyArgs);
- }
- else if (parser.getQNameIgnoreDefaultNs("position").equals(fname)) {
- RESULT = new PositionCall(fname);
- }
- else if (parser.getQNameIgnoreDefaultNs("last").equals(fname)) {
- RESULT = new LastCall(fname);
- }
- else if (parser.getQNameIgnoreDefaultNs("local-name").equals(fname)) {
- RESULT = new LocalNameCall(fname);
- }
- else if (parser.getQNameIgnoreDefaultNs("namespace-uri").equals(fname)) {
- RESULT = new NamespaceUriCall(fname);
- }
- else {
- RESULT = new FunctionCall(fname, parser.EmptyArgs);
- }
- :}
-
- | FunctionName:fname LPAREN NonemptyArgumentList:argl RPAREN
- {:
- if (parser.getQNameIgnoreDefaultNs("concat").equals(fname)) {
- RESULT = new ConcatCall(fname, argl);
- }
- else if (parser.getQNameIgnoreDefaultNs("number").equals(fname)) {
- RESULT = new NumberCall(fname, argl);
- }
- else if (parser.getQNameIgnoreDefaultNs("document").equals(fname)) {
- parser.setMultiDocument(true);
- RESULT = new DocumentCall(fname, argl);
- }
- else if (parser.getQNameIgnoreDefaultNs("string").equals(fname)) {
- RESULT = new StringCall(fname, argl);
- }
- else if (parser.getQNameIgnoreDefaultNs("boolean").equals(fname)) {
- RESULT = new BooleanCall(fname, argl);
- }
- else if (parser.getQNameIgnoreDefaultNs("name").equals(fname)) {
- RESULT = new NameCall(fname, argl);
- }
- else if (parser.getQNameIgnoreDefaultNs("generate-id").equals(fname)) {
- RESULT = new GenerateIdCall(fname, argl);
- }
- else if (parser.getQNameIgnoreDefaultNs("not").equals(fname)) {
- RESULT = new NotCall(fname, argl);
- }
- else if (parser.getQNameIgnoreDefaultNs("format-number").equals(fname)) {
- RESULT = new FormatNumberCall(fname, argl);
- }
- else if (parser.getQNameIgnoreDefaultNs("unparsed-entity-uri").equals(fname)) {
- RESULT = new UnparsedEntityUriCall(fname, argl);
- }
- else if (parser.getQNameIgnoreDefaultNs("key").equals(fname)) {
- RESULT = new KeyCall(fname, argl);
- }
- else if (parser.getQNameIgnoreDefaultNs("id").equals(fname)) {
- RESULT = new KeyCall(fname, argl);
- parser.setHasIdCall(true);
- }
- else if (parser.getQNameIgnoreDefaultNs("ceiling").equals(fname)) {
- RESULT = new CeilingCall(fname, argl);
- }
- else if (parser.getQNameIgnoreDefaultNs("round").equals(fname)) {
- RESULT = new RoundCall(fname, argl);
- }
- else if (parser.getQNameIgnoreDefaultNs("floor").equals(fname)) {
- RESULT = new FloorCall(fname, argl);
- }
- else if (parser.getQNameIgnoreDefaultNs("contains").equals(fname)) {
- RESULT = new ContainsCall(fname, argl);
- }
- else if (parser.getQNameIgnoreDefaultNs("string-length").equals(fname)) {
- RESULT = new StringLengthCall(fname, argl);
- }
- else if (parser.getQNameIgnoreDefaultNs("starts-with").equals(fname)) {
- RESULT = new StartsWithCall(fname, argl);
- }
- else if (parser.getQNameIgnoreDefaultNs("function-available").equals(fname)) {
- RESULT = new FunctionAvailableCall(fname, argl);
- }
- else if (parser.getQNameIgnoreDefaultNs("element-available").equals(fname)) {
- RESULT = new ElementAvailableCall(fname, argl);
- }
- else if (parser.getQNameIgnoreDefaultNs("local-name").equals(fname)) {
- RESULT = new LocalNameCall(fname, argl);
- }
- else if (parser.getQNameIgnoreDefaultNs("lang").equals(fname)) {
- RESULT = new LangCall(fname, argl);
- }
- else if (parser.getQNameIgnoreDefaultNs("namespace-uri").equals(fname)) {
- RESULT = new NamespaceUriCall(fname, argl);
- }
- else if (parser.getQName(Constants.TRANSLET_URI, "xsltc", "cast").equals(fname)) {
- RESULT = new CastCall(fname, argl);
- }
- // Special case for extension function nodeset()
- else if (fname.getLocalPart().equals("nodeset") || fname.getLocalPart().equals("node-set")) {
- parser.setCallsNodeset(true); // implies MultiDOM
- RESULT = new FunctionCall(fname, argl);
- }
- else {
- RESULT = new FunctionCall(fname, argl);
- }
- :};
-
-NonemptyArgumentList ::= Argument:arg
- {:
- Vector temp = new Vector();
- temp.addElement(arg);
- RESULT = temp;
- :}
-
- | Argument:arg COMMA NonemptyArgumentList:argl
- {: argl.insertElementAt(arg, 0); RESULT = argl; :};
-
-FunctionName ::= QName:fname
- {:
- RESULT = fname;
- :};
-
-VariableName ::= QName:vname
- {:
- RESULT = vname;
- :};
-
-Argument ::= Expr:ex
- {: RESULT = ex; :};
-
-NodeTest ::= NameTest:nt
- {: RESULT = nt; :}
-
- | NODE
- {: RESULT = new Integer(NodeTest.ANODE); :}
-
- | TEXT
- {: RESULT = new Integer(NodeTest.TEXT); :}
-
- | COMMENT
- {: RESULT = new Integer(NodeTest.COMMENT); :}
-
- | PIPARAM LPAREN Literal:l RPAREN
- {:
- QName name = parser.getQNameIgnoreDefaultNs("name");
- Expression exp = new EqualityExpr(Operators.EQ,
- new NameCall(name),
- new LiteralExpr(l));
- Vector predicates = new Vector();
- predicates.addElement(new Predicate(exp));
- RESULT = new Step(Axis.CHILD, NodeTest.PI, predicates);
- :}
-
- | PI
- {: RESULT = new Integer(NodeTest.PI); :};
-
-NameTest ::= STAR
- {: RESULT = null; :}
-
- | QName:qn
- {: RESULT = qn; :};
-
-QName ::= QNAME:qname
- {: RESULT = parser.getQNameIgnoreDefaultNs(qname); :}
-
- | DIV
- {: RESULT = parser.getQNameIgnoreDefaultNs("div"); :}
-
- | MOD
- {: RESULT = parser.getQNameIgnoreDefaultNs("mod"); :}
-
- | KEY
- {: RESULT = parser.getQNameIgnoreDefaultNs("key"); :}
-
- | ANCESTOR
- {: RESULT = parser.getQNameIgnoreDefaultNs("child"); :}
-
- | ANCESTORORSELF
- {: RESULT = parser.getQNameIgnoreDefaultNs("ancestor-or-self"); :}
-
- | ATTRIBUTE
- {: RESULT = parser.getQNameIgnoreDefaultNs("attribute"); :}
-
- | CHILD
- {: RESULT = parser.getQNameIgnoreDefaultNs("child"); :}
-
- | DESCENDANT
- {: RESULT = parser.getQNameIgnoreDefaultNs("decendant"); :}
-
- | DESCENDANTORSELF
- {: RESULT = parser.getQNameIgnoreDefaultNs("decendant-or-self"); :}
-
- | FOLLOWING
- {: RESULT = parser.getQNameIgnoreDefaultNs("following"); :}
-
- | FOLLOWINGSIBLING
- {: RESULT = parser.getQNameIgnoreDefaultNs("following-sibling"); :}
-
- | NAMESPACE
- {: RESULT = parser.getQNameIgnoreDefaultNs("namespace"); :}
-
- | PARENT
- {: RESULT = parser.getQNameIgnoreDefaultNs("parent"); :}
-
- | PRECEDING
- {: RESULT = parser.getQNameIgnoreDefaultNs("preceding"); :}
-
- | PRECEDINGSIBLING
- {: RESULT = parser.getQNameIgnoreDefaultNs("preceding-sibling"); :}
-
- | SELF
- {: RESULT = parser.getQNameIgnoreDefaultNs("self"); :}
-
- | ID
- {: RESULT = parser.getQNameIgnoreDefaultNs("id"); :};
-
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/xpath.lex b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/xpath.lex
deleted file mode 100644
index f1013f3..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/xpath.lex
+++ /dev/null
@@ -1,260 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: xpath.lex,v 1.12 2005/08/02 02:59:03 mcnamara Exp $
- */
-
-/*
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- *
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.compiler;
-
-import com.sun.java_cup.internal.runtime.Symbol;
-%%
-%cup
-%unicode
-%class XPathLexer
-%yyeof
-
-%{
- int last;
-
- void initialize() {
- last = -1;
- }
-
- static boolean isWhitespace(int c) {
- return (c == ' ' || c == '\t' || c == '\r' || c == '\n' || c == '\f');
- }
-
- /**
- * If symbol is not followed by '::' or '(', then treat it as a
- * name instead of an axis or function (Jira-1912).
- */
- Symbol disambiguateAxisOrFunction(int ss) throws Exception {
- // Peek in the input buffer without changing the internal state
- int index = yy_buffer_index;
-
- // Skip whitespace
- while (index < yy_buffer_read && isWhitespace(yy_buffer[index])) {
- index++;
- }
-
- // If end of buffer, can't disambiguate :(
- if (index >= yy_buffer_read) {
- // Can't disambiguate, so return as symbol
- return new Symbol(ss);
- }
-
- // Return symbol if next token is '::' or '('
- return (yy_buffer[index] == ':' && yy_buffer[index+1] == ':' ||
- yy_buffer[index] == '(') ?
- newSymbol(ss) : newSymbol(sym.QNAME, yytext());
- }
-
- /**
- * If symbol is first token or if it follows any of the operators
- * listed in http://www.w3.org/TR/xpath#exprlex then treat as a
- * name instead of a keyword (Jira-1912).
- */
- Symbol disambiguateOperator(int ss) throws Exception {
- switch (last) {
- case -1: // first token
- case sym.ATSIGN:
- case sym.DCOLON:
- case sym.LPAREN:
- case sym.LBRACK:
- case sym.COMMA:
- case sym.AND:
- case sym.OR:
- case sym.MOD:
- case sym.DIV:
- case sym.MULT:
- case sym.SLASH:
- case sym.DSLASH:
- case sym.VBAR:
- case sym.PLUS:
- case sym.MINUS:
- case sym.EQ:
- case sym.NE:
- case sym.LT:
- case sym.LE:
- case sym.GT:
- case sym.GE:
- return newSymbol(sym.QNAME, yytext());
- }
- return newSymbol(ss);
- }
-
- /**
- * If symbol is first token or if it follows any of the operators
- * listed in http://www.w3.org/TR/xpath#exprlex then treat as a
- * wildcard instead of a multiplication operator
- */
- Symbol disambiguateStar() throws Exception {
- switch (last) {
- case -1: // first token
- case sym.ATSIGN:
- case sym.DCOLON:
- case sym.LPAREN:
- case sym.LBRACK:
- case sym.COMMA:
- case sym.AND:
- case sym.OR:
- case sym.MOD:
- case sym.DIV:
- case sym.MULT:
- case sym.SLASH:
- case sym.DSLASH:
- case sym.VBAR:
- case sym.PLUS:
- case sym.MINUS:
- case sym.EQ:
- case sym.NE:
- case sym.LT:
- case sym.LE:
- case sym.GT:
- case sym.GE:
- return newSymbol(sym.STAR);
- }
- return newSymbol(sym.MULT);
- }
-
- Symbol newSymbol(int ss) {
- last = ss;
- return new Symbol(ss);
- }
-
- Symbol newSymbol(int ss, String value) {
- last = ss;
- return new Symbol(ss, value);
- }
-
- Symbol newSymbol(int ss, Long value) {
- last = ss;
- return new Symbol(ss, value);
- }
-
- Symbol newSymbol(int ss, Double value) {
- last = ss;
- return new Symbol(ss, value);
- }
-%}
-
-%eofval{
-return newSymbol(sym.EOF);
-%eofval}
-
-%yylexthrow{
-Exception
-%yylexthrow}
-
-Letter={BaseChar}|{Ideographic}
-
-BaseChar=[\u0041-\u005A\u0061-\u007A\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\u0131\u0134-\u013E\u0141-\u0148\u014A-\u017E\u0180-\u01C3\u01CD-\u01F0\u01F4-\u01F5\u01FA-\u0217\u0250-\u02A8\u02BB-\u02C1\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03CE\u03D0-\u03D6\u03DA\u03DC\u03DE\u03E0\u03E2-\u03F3\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E-\u0481\u0490-\u04C4\u04C7-\u04C8\u04CB-\u04CC\u04D0-\u04EB\u04EE-\u04F5\u04F8-\u04F9\u0531-\u0556\u0559\u0561-\u0586\u05D0-\u05EA\u05F0-\u05F2\u0621-\u063A\u0641-\u064A\u0671-\u06B7\u06BA-\u06BE\u06C0-\u06CE\u06D0-\u06D3\u06D5\u06E5-\u06E6\u0905-\u0939\u093D\u0958-\u0961\u0985-\u098C\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09DC-\u09DD\u09DF-\u09E1\u09F0-\u09F1\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33\u0A35-\u0A36\u0A38-\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8B\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABD\u0AE0\u0B05-\u0B0C\u0B0F-\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B36-\u0B39\u0B3D\u0B5C-\u0B5D\u0B5F-\u0B61\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB5\u0BB7-\u0BB9\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C60-\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CDE\u0CE0-\u0CE1\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D28\u0D2A-\u0D39\u0D60-\u0D61\u0E01-\u0E2E\u0E30\u0E32-\u0E33\u0E40-\u0E45\u0E81-\u0E82\u0E84\u0E87-\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA-\u0EAB\u0EAD-\u0EAE\u0EB0\u0EB2-\u0EB3\u0EBD\u0EC0-\u0EC4\u0F40-\u0F47\u0F49-\u0F69\u10A0-\u10C5\u10D0-\u10F6\u1100\u1102-\u1103\u1105-\u1107\u1109\u110B-\u110C\u110E-\u1112\u113C\u113E\u1140\u114C\u114E\u1150\u1154-\u1155\u1159\u115F-\u1161\u1163\u1165\u1167\u1169\u116D-\u116E\u1172-\u1173\u1175\u119E\u11A8\u11AB\u11AE-\u11AF\u11B7-\u11B8\u11BA\u11BC-\u11C2\u11EB\u11F0\u11F9\u1E00-\u1E9B\u1EA0-\u1EF9\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2126\u212A-\u212B\u212E\u2180-\u2182\u3041-\u3094\u30A1-\u30FA\u3105-\u312C\uAC00-\uD7A3]
-
-Ideographic=[\u4E00-\u9FA5\u3007\u3021-\u3029]
-
-CombiningChar=[\u0300-\u0345\u0360-\u0361\u0483-\u0486\u0591-\u05A1\u05A3-\u05B9\u05BB-\u05BD\u05BF\u05C1-\u05C2\u05C4\u064B-\u0652\u0670\u06D6-\u06DC\u06DD-\u06DF\u06E0-\u06E4\u06E7-\u06E8\u06EA-\u06ED\u0901-\u0903\u093C\u093E-\u094C\u094D\u0951-\u0954\u0962-\u0963\u0981-\u0983\u09BC\u09BE\u09BF\u09C0-\u09C4\u09C7-\u09C8\u09CB-\u09CD\u09D7\u09E2-\u09E3\u0A02\u0A3C\u0A3E\u0A3F\u0A40-\u0A42\u0A47-\u0A48\u0A4B-\u0A4D\u0A70-\u0A71\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0B01-\u0B03\u0B3C\u0B3E-\u0B43\u0B47-\u0B48\u0B4B-\u0B4D\u0B56-\u0B57\u0B82-\u0B83\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C01-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55-\u0C56\u0C82-\u0C83\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5-\u0CD6\u0D02-\u0D03\u0D3E-\u0D43\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB-\u0EBC\u0EC8-\u0ECD\u0F18-\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86-\u0F8B\u0F90-\u0F95\u0F97\u0F99-\u0FAD\u0FB1-\u0FB7\u0FB9\u20D0-\u20DC\u20E1\u302A-\u302F\u3099\u309A]
-
-Digit=[\u0030-\u0039\u0660-\u0669\u06F0-\u06F9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE7-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29]
-
-Extender=[\u00B7\u02D0\u02D1\u0387\u0640\u0E46\u0EC6\u3005\u3031-\u3035\u309D-\u309E\u30FC-\u30FE]
-
-NCName=({Letter}|"_"|{NCNameStartChar})({NCNameChar})*
-
-NCNameChar={Letter}|{Digit}|"."|"-"|"_"|{CombiningChar}|{Extender}|{NCNameStartChar}| \u00B7 | [\u0300-\u036F] | [\u203F-\u2040] | [\u0130-\u0136]
-
-NCNameStartChar=[\u0041-\u005A\u0061-\u007A\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD] | \u005F |({HighSurrogate}{LowSurrogate})
-
-HighSurrogate=[\uD800-\uDBFF]
-
-LowSurrogate=[\uDC00-\uDFFF]
-
-%%
-
-"*" { return disambiguateStar(); }
-"/" { return newSymbol(sym.SLASH); }
-"+" { return newSymbol(sym.PLUS); }
-"-" { return newSymbol(sym.MINUS); }
-"div" { return disambiguateOperator(sym.DIV); }
-"mod" { return disambiguateOperator(sym.MOD); }
-"::" { return newSymbol(sym.DCOLON); }
-"," { return newSymbol(sym.COMMA); }
-"@" { return newSymbol(sym.ATSIGN); }
-".." { return newSymbol(sym.DDOT); }
-"|" { return newSymbol(sym.VBAR); }
-"$" { return newSymbol(sym.DOLLAR); }
-"//" { return newSymbol(sym.DSLASH); }
-"=" { return newSymbol(sym.EQ); }
-"!=" { return newSymbol(sym.NE); }
-"<" { return newSymbol(sym.LT); }
-">" { return newSymbol(sym.GT); }
-"<=" { return newSymbol(sym.LE); }
-">=" { return newSymbol(sym.GE); }
-"id" { return disambiguateAxisOrFunction(sym.ID); }
-"key" { return disambiguateAxisOrFunction(sym.KEY); }
-"text()" { return newSymbol(sym.TEXT); }
-"text"+[ \t\r\n\f]+"()" { return newSymbol(sym.TEXT); }
-"node()" { return newSymbol(sym.NODE); }
-"node"+[ \t\r\n\f]+"()" { return newSymbol(sym.NODE); }
-"comment()" { return newSymbol(sym.COMMENT); }
-"comment"+[ \t\r\n\f]+"()" { return newSymbol(sym.COMMENT); }
-"processing-instruction" { return disambiguateAxisOrFunction(sym.PIPARAM); }
-"processing-instruction()" { return newSymbol(sym.PI); }
-"processing-instruction"+[ \t\r\n\f]+"()" { return newSymbol(sym.PI); }
-"or" { return disambiguateOperator(sym.OR); }
-"and" { return disambiguateOperator(sym.AND); }
-"child" { return disambiguateAxisOrFunction(sym.CHILD); }
-"attribute" { return disambiguateAxisOrFunction(sym.ATTRIBUTE); }
-"ancestor" { return disambiguateAxisOrFunction(sym.ANCESTOR); }
-"ancestor-or-self" { return disambiguateAxisOrFunction(sym.ANCESTORORSELF); }
-"descendant" { return disambiguateAxisOrFunction(sym.DESCENDANT); }
-"descendant-or-self" { return disambiguateAxisOrFunction(sym.DESCENDANTORSELF); }
-"following" { return disambiguateAxisOrFunction(sym.FOLLOWING); }
-"following-sibling" { return disambiguateAxisOrFunction(sym.FOLLOWINGSIBLING); }
-"namespace" { return disambiguateAxisOrFunction(sym.NAMESPACE); }
-"parent" { return disambiguateAxisOrFunction(sym.PARENT); }
-"preceding" { return disambiguateAxisOrFunction(sym.PRECEDING); }
-"preceding-sibling" { return disambiguateAxisOrFunction(sym.PRECEDINGSIBLING); }
-"self" { return disambiguateAxisOrFunction(sym.SELF); }
-"[" { return newSymbol(sym.LBRACK); }
-"]" { return newSymbol(sym.RBRACK); }
-"(" { return newSymbol(sym.LPAREN); }
-")" { return newSymbol(sym.RPAREN); }
-"<PATTERN>" { initialize(); return new Symbol(sym.PATTERN); }
-"<EXPRESSION>" { initialize(); return new Symbol(sym.EXPRESSION); }
-\"[^\"]*\" { return newSymbol(sym.Literal,
- yytext().substring(1, yytext().length() - 1)); }
-\'[^\']*\' { return newSymbol(sym.Literal,
- yytext().substring(1, yytext().length() - 1)); }
-{Digit}+ { return newSymbol(sym.INT, new Long(yytext())); }
-{Digit}+("."{Digit}*)? { return newSymbol(sym.REAL, new Double(yytext())); }
-"."{Digit}+ { return newSymbol(sym.REAL, new Double(yytext())); }
-"." { return newSymbol(sym.DOT); }
-({NCName}":")?{NCName} { return newSymbol(sym.QNAME, yytext()); }
-({NCName}":")?"*" { return newSymbol(sym.QNAME, yytext()); }
-({NCName}":")?"@*" { return newSymbol(sym.QNAME, yytext()); }
-[ \t\r\n\f] { /* ignore white space. */ }
-. { throw new Exception(yytext()); }
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/AbsoluteIterator.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/AbsoluteIterator.java
deleted file mode 100644
index c7962e7..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/AbsoluteIterator.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: AbsoluteIterator.java,v 1.2.4.1 2005/09/06 05:46:46 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.dom;
-
-import com.sun.org.apache.xalan.internal.xsltc.runtime.BasisLibrary;
-import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
-import com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase;
-import com.sun.org.apache.xml.internal.dtm.ref.DTMDefaultBase;
-
-/**
- * Absolute iterators ignore the node that is passed to setStartNode().
- * Instead, they always start from the root node. The node passed to
- * setStartNode() is not totally useless, though. It is needed to obtain the
- * DOM mask, i.e. the index into the MultiDOM table that corresponds to the
- * DOM "owning" the node.
- *
- * The DOM mask is cached, so successive calls to setStartNode() passing
- * nodes from other DOMs will have no effect (i.e. this iterator cannot
- * migrate between DOMs).
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-public final class AbsoluteIterator extends DTMAxisIteratorBase {
-
- /**
- * Source for this iterator.
- */
- private DTMAxisIterator _source;
-
- public AbsoluteIterator(DTMAxisIterator source) {
- _source = source;
-// System.out.println("AI source = " + source + " this = " + this);
- }
-
- public void setRestartable(boolean isRestartable) {
- _isRestartable = isRestartable;
- _source.setRestartable(isRestartable);
- }
-
- public DTMAxisIterator setStartNode(int node) {
- _startNode = DTMDefaultBase.ROOTNODE;
- if (_isRestartable) {
- _source.setStartNode(_startNode);
- resetPosition();
- }
- return this;
- }
-
- public int next() {
- return returnNode(_source.next());
- }
-
- public DTMAxisIterator cloneIterator() {
- try {
- final AbsoluteIterator clone = (AbsoluteIterator) super.clone();
- clone._source = _source.cloneIterator(); // resets source
- clone.resetPosition();
- clone._isRestartable = false;
- return clone;
- }
- catch (CloneNotSupportedException e) {
- BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR,
- e.toString());
- return null;
- }
- }
-
- public DTMAxisIterator reset() {
- _source.reset();
- return resetPosition();
- }
-
- public void setMark() {
- _source.setMark();
- }
-
- public void gotoMark() {
- _source.gotoMark();
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/AdaptiveResultTreeImpl.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/AdaptiveResultTreeImpl.java
deleted file mode 100644
index cb50cf5..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/AdaptiveResultTreeImpl.java
+++ /dev/null
@@ -1,1346 +0,0 @@
-/*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.dom;
-
-import com.sun.org.apache.xalan.internal.xsltc.DOM;
-import com.sun.org.apache.xalan.internal.xsltc.StripFilter;
-import com.sun.org.apache.xalan.internal.xsltc.TransletException;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.BasisLibrary;
-import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
-import com.sun.org.apache.xml.internal.dtm.DTMAxisTraverser;
-import com.sun.org.apache.xml.internal.dtm.DTMWSFilter;
-import com.sun.org.apache.xml.internal.serializer.SerializationHandler;
-import com.sun.org.apache.xml.internal.utils.XMLString;
-import java.util.Map;
-import javax.xml.transform.SourceLocator;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.AttributesImpl;
-
-/**
- * AdaptiveResultTreeImpl is a adaptive DOM model for result tree fragments (RTF). It is
- * used in the case where the RTF is likely to be pure text yet it can still be a DOM tree.
- * It is designed for RTFs which have &lt;xsl:call-template&gt; or &lt;xsl:apply-templates&gt; in
- * the contents. Example:
- * <pre>
- * &lt;xsl:variable name = "x"&gt;
- * &lt;xsl:call-template name = "test"&gt;
- * &lt;xsl:with-param name="a" select="."/&gt;
- * &lt;/xsl:call-template&gt;
- * &lt;/xsl:variable>
- * </pre>
- * <p>In this example the result produced by <xsl:call-template> is likely to be a single
- * Text node. But it can also be a DOM tree. This kind of RTF cannot be modelled by
- * SimpleResultTreeImpl.
- * <p>
- * AdaptiveResultTreeImpl can be considered as a smart switcher between SimpleResultTreeImpl
- * and SAXImpl. It treats the RTF as simple Text and uses the SimpleResultTreeImpl model
- * at the beginning. However, if it receives a call which indicates that this is a DOM tree
- * (e.g. startElement), it will automatically transform itself into a wrapper around a
- * SAXImpl. In this way we can have a light-weight model when the result only contains
- * simple text, while at the same time it still works when the RTF is a DOM tree.
- * <p>
- * All methods in this class are overridden to delegate the action to the wrapped SAXImpl object
- * if it is non-null, or delegate the action to the SimpleResultTreeImpl if there is no
- * wrapped SAXImpl.
- * <p>
- * %REVISIT% Can we combine this class with SimpleResultTreeImpl? I think it is possible, but
- * it will make SimpleResultTreeImpl more expensive. I will use two separate classes at
- * this time.
- */
-public class AdaptiveResultTreeImpl extends SimpleResultTreeImpl
-{
-
- // Document URI index, which increases by 1 at each getDocumentURI() call.
- private static int _documentURIIndex = 0;
-
- private static final String EMPTY_STRING = "".intern();
-
- // The SAXImpl object wrapped by this class, if the RTF is a tree.
- private SAXImpl _dom;
-
- /** The following fields are only used for the nested SAXImpl **/
-
- // The whitespace filter
- private DTMWSFilter _wsfilter;
-
- // The size of the RTF
- private int _initSize;
-
- // True if we want to build the ID index table
- private boolean _buildIdIndex;
-
- // The AttributeList
- private final AttributesImpl _attributes = new AttributesImpl();
-
- // The element name
- private String _openElementName;
-
-
- // Create a AdaptiveResultTreeImpl
- public AdaptiveResultTreeImpl(XSLTCDTMManager dtmManager, int documentID,
- DTMWSFilter wsfilter, int initSize,
- boolean buildIdIndex)
- {
- super(dtmManager, documentID);
-
- _wsfilter = wsfilter;
- _initSize = initSize;
- _buildIdIndex = buildIdIndex;
- }
-
- // Return the DOM object wrapped in this object.
- public DOM getNestedDOM()
- {
- return _dom;
- }
-
- // Return the document ID
- public int getDocument()
- {
- if (_dom != null) {
- return _dom.getDocument();
- }
- else {
- return super.getDocument();
- }
- }
-
- // Return the String value of the RTF
- public String getStringValue()
- {
- if (_dom != null) {
- return _dom.getStringValue();
- }
- else {
- return super.getStringValue();
- }
- }
-
- public DTMAxisIterator getIterator()
- {
- if (_dom != null) {
- return _dom.getIterator();
- }
- else {
- return super.getIterator();
- }
- }
-
- public DTMAxisIterator getChildren(final int node)
- {
- if (_dom != null) {
- return _dom.getChildren(node);
- }
- else {
- return super.getChildren(node);
- }
- }
-
- public DTMAxisIterator getTypedChildren(final int type)
- {
- if (_dom != null) {
- return _dom.getTypedChildren(type);
- }
- else {
- return super.getTypedChildren(type);
- }
- }
-
- public DTMAxisIterator getAxisIterator(final int axis)
- {
- if (_dom != null) {
- return _dom.getAxisIterator(axis);
- }
- else {
- return super.getAxisIterator(axis);
- }
- }
-
- public DTMAxisIterator getTypedAxisIterator(final int axis, final int type)
- {
- if (_dom != null) {
- return _dom.getTypedAxisIterator(axis, type);
- }
- else {
- return super.getTypedAxisIterator(axis, type);
- }
- }
-
- public DTMAxisIterator getNthDescendant(int node, int n, boolean includeself)
- {
- if (_dom != null) {
- return _dom.getNthDescendant(node, n, includeself);
- }
- else {
- return super.getNthDescendant(node, n, includeself);
- }
- }
-
- public DTMAxisIterator getNamespaceAxisIterator(final int axis, final int ns)
- {
- if (_dom != null) {
- return _dom.getNamespaceAxisIterator(axis, ns);
- }
- else {
- return super.getNamespaceAxisIterator(axis, ns);
- }
- }
-
- public DTMAxisIterator getNodeValueIterator(DTMAxisIterator iter, int returnType,
- String value, boolean op)
- {
- if (_dom != null) {
- return _dom.getNodeValueIterator(iter, returnType, value, op);
- }
- else {
- return super.getNodeValueIterator(iter, returnType, value, op);
- }
- }
-
- public DTMAxisIterator orderNodes(DTMAxisIterator source, int node)
- {
- if (_dom != null) {
- return _dom.orderNodes(source, node);
- }
- else {
- return super.orderNodes(source, node);
- }
- }
-
- public String getNodeName(final int node)
- {
- if (_dom != null) {
- return _dom.getNodeName(node);
- }
- else {
- return super.getNodeName(node);
- }
- }
-
- public String getNodeNameX(final int node)
- {
- if (_dom != null) {
- return _dom.getNodeNameX(node);
- }
- else {
- return super.getNodeNameX(node);
- }
- }
-
- public String getNamespaceName(final int node)
- {
- if (_dom != null) {
- return _dom.getNamespaceName(node);
- }
- else {
- return super.getNamespaceName(node);
- }
- }
-
- // Return the expanded type id of a given node
- public int getExpandedTypeID(final int nodeHandle)
- {
- if (_dom != null) {
- return _dom.getExpandedTypeID(nodeHandle);
- }
- else {
- return super.getExpandedTypeID(nodeHandle);
- }
- }
-
- public int getNamespaceType(final int node)
- {
- if (_dom != null) {
- return _dom.getNamespaceType(node);
- }
- else {
- return super.getNamespaceType(node);
- }
- }
-
- public int getParent(final int nodeHandle)
- {
- if (_dom != null) {
- return _dom.getParent(nodeHandle);
- }
- else {
- return super.getParent(nodeHandle);
- }
- }
-
- public int getAttributeNode(final int gType, final int element)
- {
- if (_dom != null) {
- return _dom.getAttributeNode(gType, element);
- }
- else {
- return super.getAttributeNode(gType, element);
- }
- }
-
- public String getStringValueX(final int nodeHandle)
- {
- if (_dom != null) {
- return _dom.getStringValueX(nodeHandle);
- }
- else {
- return super.getStringValueX(nodeHandle);
- }
- }
-
- public void copy(final int node, SerializationHandler handler)
- throws TransletException
- {
- if (_dom != null) {
- _dom.copy(node, handler);
- }
- else {
- super.copy(node, handler);
- }
- }
-
- public void copy(DTMAxisIterator nodes, SerializationHandler handler)
- throws TransletException
- {
- if (_dom != null) {
- _dom.copy(nodes, handler);
- }
- else {
- super.copy(nodes, handler);
- }
- }
-
- public String shallowCopy(final int node, SerializationHandler handler)
- throws TransletException
- {
- if (_dom != null) {
- return _dom.shallowCopy(node, handler);
- }
- else {
- return super.shallowCopy(node, handler);
- }
- }
-
- public boolean lessThan(final int node1, final int node2)
- {
- if (_dom != null) {
- return _dom.lessThan(node1, node2);
- }
- else {
- return super.lessThan(node1, node2);
- }
- }
-
- /**
- * Dispatch the character content of a node to an output handler.
- *
- * The escape setting should be taken care of when outputting to
- * a handler.
- */
- public void characters(final int node, SerializationHandler handler)
- throws TransletException
- {
- if (_dom != null) {
- _dom.characters(node, handler);
- }
- else {
- super.characters(node, handler);
- }
- }
-
- public Node makeNode(int index)
- {
- if (_dom != null) {
- return _dom.makeNode(index);
- }
- else {
- return super.makeNode(index);
- }
- }
-
- public Node makeNode(DTMAxisIterator iter)
- {
- if (_dom != null) {
- return _dom.makeNode(iter);
- }
- else {
- return super.makeNode(iter);
- }
- }
-
- public NodeList makeNodeList(int index)
- {
- if (_dom != null) {
- return _dom.makeNodeList(index);
- }
- else {
- return super.makeNodeList(index);
- }
- }
-
- public NodeList makeNodeList(DTMAxisIterator iter)
- {
- if (_dom != null) {
- return _dom.makeNodeList(iter);
- }
- else {
- return super.makeNodeList(iter);
- }
- }
-
- public String getLanguage(int node)
- {
- if (_dom != null) {
- return _dom.getLanguage(node);
- }
- else {
- return super.getLanguage(node);
- }
- }
-
- public int getSize()
- {
- if (_dom != null) {
- return _dom.getSize();
- }
- else {
- return super.getSize();
- }
- }
-
- public String getDocumentURI(int node)
- {
- if (_dom != null) {
- return _dom.getDocumentURI(node);
- }
- else {
- return "adaptive_rtf" + _documentURIIndex++;
- }
- }
-
- public void setFilter(StripFilter filter)
- {
- if (_dom != null) {
- _dom.setFilter(filter);
- }
- else {
- super.setFilter(filter);
- }
- }
-
- public void setupMapping(String[] names, String[] uris, int[] types, String[] namespaces)
- {
- if (_dom != null) {
- _dom.setupMapping(names, uris, types, namespaces);
- }
- else {
- super.setupMapping(names, uris, types, namespaces);
- }
- }
-
- public boolean isElement(final int node)
- {
- if (_dom != null) {
- return _dom.isElement(node);
- }
- else {
- return super.isElement(node);
- }
- }
-
- public boolean isAttribute(final int node)
- {
- if (_dom != null) {
- return _dom.isAttribute(node);
- }
- else {
- return super.isAttribute(node);
- }
- }
-
- public String lookupNamespace(int node, String prefix)
- throws TransletException
- {
- if (_dom != null) {
- return _dom.lookupNamespace(node, prefix);
- }
- else {
- return super.lookupNamespace(node, prefix);
- }
- }
-
- /**
- * Return the node identity from a node handle.
- */
- public final int getNodeIdent(final int nodehandle)
- {
- if (_dom != null) {
- return _dom.getNodeIdent(nodehandle);
- }
- else {
- return super.getNodeIdent(nodehandle);
- }
- }
-
- /**
- * Return the node handle from a node identity.
- */
- public final int getNodeHandle(final int nodeId)
- {
- if (_dom != null) {
- return _dom.getNodeHandle(nodeId);
- }
- else {
- return super.getNodeHandle(nodeId);
- }
- }
-
- public DOM getResultTreeFrag(int initialSize, int rtfType)
- {
- if (_dom != null) {
- return _dom.getResultTreeFrag(initialSize, rtfType);
- }
- else {
- return super.getResultTreeFrag(initialSize, rtfType);
- }
- }
-
- public SerializationHandler getOutputDomBuilder()
- {
- return this;
- }
-
- public int getNSType(int node)
- {
- if (_dom != null) {
- return _dom.getNSType(node);
- }
- else {
- return super.getNSType(node);
- }
- }
-
- public String getUnparsedEntityURI(String name)
- {
- if (_dom != null) {
- return _dom.getUnparsedEntityURI(name);
- }
- else {
- return super.getUnparsedEntityURI(name);
- }
- }
-
- public Map<String, Integer> getElementsWithIDs()
- {
- if (_dom != null) {
- return _dom.getElementsWithIDs();
- }
- else {
- return super.getElementsWithIDs();
- }
- }
-
- /** Implementation of the SerializationHandler interfaces **/
-
- /** The code in some of the following interfaces are copied from SAXAdapter. **/
-
- private void maybeEmitStartElement() throws SAXException
- {
- if (_openElementName != null) {
-
- int index;
- if ((index =_openElementName.indexOf(":")) < 0)
- _dom.startElement(null, _openElementName, _openElementName, _attributes);
- else {
- String uri =_dom.getNamespaceURI(_openElementName.substring(0,index));
- _dom.startElement(uri, _openElementName.substring(index+1), _openElementName, _attributes);
- }
-
-
- _openElementName = null;
- }
-
- }
-
- // Create and initialize the wrapped SAXImpl object
- private void prepareNewDOM() throws SAXException
- {
- _dom = (SAXImpl)_dtmManager.getDTM(null, true, _wsfilter,
- true, false, false,
- _initSize, _buildIdIndex);
- _dom.startDocument();
- // Flush pending Text nodes to SAXImpl
- for (int i = 0; i < _size; i++) {
- String str = _textArray[i];
- _dom.characters(str.toCharArray(), 0, str.length());
- }
- _size = 0;
- }
-
- public void startDocument() throws SAXException
- {
- }
-
- public void endDocument() throws SAXException
- {
- if (_dom != null) {
- _dom.endDocument();
- }
- else {
- super.endDocument();
- }
- }
-
- public void characters(String str) throws SAXException
- {
- if (_dom != null) {
- characters(str.toCharArray(), 0, str.length());
- }
- else {
- super.characters(str);
- }
- }
-
- public void characters(char[] ch, int offset, int length)
- throws SAXException
- {
- if (_dom != null) {
- maybeEmitStartElement();
- _dom.characters(ch, offset, length);
- }
- else {
- super.characters(ch, offset, length);
- }
- }
-
- public boolean setEscaping(boolean escape) throws SAXException
- {
- if (_dom != null) {
- return _dom.setEscaping(escape);
- }
- else {
- return super.setEscaping(escape);
- }
- }
-
- public void startElement(String elementName) throws SAXException
- {
- if (_dom == null) {
- prepareNewDOM();
- }
-
- maybeEmitStartElement();
- _openElementName = elementName;
- _attributes.clear();
- }
-
- public void startElement(String uri, String localName, String qName)
- throws SAXException
- {
- startElement(qName);
- }
-
- public void startElement(String uri, String localName, String qName, Attributes attributes)
- throws SAXException
- {
- startElement(qName);
- }
-
- public void endElement(String elementName) throws SAXException
- {
- maybeEmitStartElement();
- _dom.endElement(null, null, elementName);
- }
-
- public void endElement(String uri, String localName, String qName)
- throws SAXException
- {
- endElement(qName);
- }
-
- public void addAttribute(String qName, String value)
- {
- // "prefix:localpart" or "localpart"
- int colonpos = qName.indexOf(":");
- String uri = EMPTY_STRING;
- String localName = qName;
- if (colonpos >0)
- {
- String prefix = qName.substring(0, colonpos);
- localName = qName.substring(colonpos+1);
- uri = _dom.getNamespaceURI(prefix);
- }
-
- addAttribute(uri, localName, qName, "CDATA", value);
- }
-
- public void addUniqueAttribute(String qName, String value, int flags)
- throws SAXException
- {
- addAttribute(qName, value);
- }
-
- public void addAttribute(String uri, String localName, String qname,
- String type, String value)
- {
- if (_openElementName != null) {
- _attributes.addAttribute(uri, localName, qname, type, value);
- }
- else {
- BasisLibrary.runTimeError(BasisLibrary.STRAY_ATTRIBUTE_ERR, qname);
- }
- }
-
- public void namespaceAfterStartElement(String prefix, String uri)
- throws SAXException
- {
- if (_dom == null) {
- prepareNewDOM();
- }
-
- _dom.startPrefixMapping(prefix, uri);
- }
-
- public void comment(String comment) throws SAXException
- {
- if (_dom == null) {
- prepareNewDOM();
- }
-
- maybeEmitStartElement();
- char[] chars = comment.toCharArray();
- _dom.comment(chars, 0, chars.length);
- }
-
- public void comment(char[] chars, int offset, int length)
- throws SAXException
- {
- if (_dom == null) {
- prepareNewDOM();
- }
-
- maybeEmitStartElement();
- _dom.comment(chars, offset, length);
- }
-
- public void processingInstruction(String target, String data)
- throws SAXException
- {
- if (_dom == null) {
- prepareNewDOM();
- }
-
- maybeEmitStartElement();
- _dom.processingInstruction(target, data);
- }
-
- /** Implementation of the DTM interfaces **/
-
- public void setFeature(String featureId, boolean state)
- {
- if (_dom != null) {
- _dom.setFeature(featureId, state);
- }
- }
-
- public void setProperty(String property, Object value)
- {
- if (_dom != null) {
- _dom.setProperty(property, value);
- }
- }
-
- public DTMAxisTraverser getAxisTraverser(final int axis)
- {
- if (_dom != null) {
- return _dom.getAxisTraverser(axis);
- }
- else {
- return super.getAxisTraverser(axis);
- }
- }
-
- public boolean hasChildNodes(int nodeHandle)
- {
- if (_dom != null) {
- return _dom.hasChildNodes(nodeHandle);
- }
- else {
- return super.hasChildNodes(nodeHandle);
- }
- }
-
- public int getFirstChild(int nodeHandle)
- {
- if (_dom != null) {
- return _dom.getFirstChild(nodeHandle);
- }
- else {
- return super.getFirstChild(nodeHandle);
- }
- }
-
- public int getLastChild(int nodeHandle)
- {
- if (_dom != null) {
- return _dom.getLastChild(nodeHandle);
- }
- else {
- return super.getLastChild(nodeHandle);
- }
- }
-
- public int getAttributeNode(int elementHandle, String namespaceURI, String name)
- {
- if (_dom != null) {
- return _dom.getAttributeNode(elementHandle, namespaceURI, name);
- }
- else {
- return super.getAttributeNode(elementHandle, namespaceURI, name);
- }
- }
-
- public int getFirstAttribute(int nodeHandle)
- {
- if (_dom != null) {
- return _dom.getFirstAttribute(nodeHandle);
- }
- else {
- return super.getFirstAttribute(nodeHandle);
- }
- }
-
- public int getFirstNamespaceNode(int nodeHandle, boolean inScope)
- {
- if (_dom != null) {
- return _dom.getFirstNamespaceNode(nodeHandle, inScope);
- }
- else {
- return super.getFirstNamespaceNode(nodeHandle, inScope);
- }
- }
-
- public int getNextSibling(int nodeHandle)
- {
- if (_dom != null) {
- return _dom.getNextSibling(nodeHandle);
- }
- else {
- return super.getNextSibling(nodeHandle);
- }
- }
-
- public int getPreviousSibling(int nodeHandle)
- {
- if (_dom != null) {
- return _dom.getPreviousSibling(nodeHandle);
- }
- else {
- return super.getPreviousSibling(nodeHandle);
- }
- }
-
- public int getNextAttribute(int nodeHandle)
- {
- if (_dom != null) {
- return _dom.getNextAttribute(nodeHandle);
- }
- else {
- return super.getNextAttribute(nodeHandle);
- }
- }
-
- public int getNextNamespaceNode(int baseHandle, int namespaceHandle,
- boolean inScope)
- {
- if (_dom != null) {
- return _dom.getNextNamespaceNode(baseHandle, namespaceHandle, inScope);
- }
- else {
- return super.getNextNamespaceNode(baseHandle, namespaceHandle, inScope);
- }
- }
-
- public int getOwnerDocument(int nodeHandle)
- {
- if (_dom != null) {
- return _dom.getOwnerDocument(nodeHandle);
- }
- else {
- return super.getOwnerDocument(nodeHandle);
- }
- }
-
- public int getDocumentRoot(int nodeHandle)
- {
- if (_dom != null) {
- return _dom.getDocumentRoot(nodeHandle);
- }
- else {
- return super.getDocumentRoot(nodeHandle);
- }
- }
-
- public XMLString getStringValue(int nodeHandle)
- {
- if (_dom != null) {
- return _dom.getStringValue(nodeHandle);
- }
- else {
- return super.getStringValue(nodeHandle);
- }
- }
-
- public int getStringValueChunkCount(int nodeHandle)
- {
- if (_dom != null) {
- return _dom.getStringValueChunkCount(nodeHandle);
- }
- else {
- return super.getStringValueChunkCount(nodeHandle);
- }
- }
-
- public char[] getStringValueChunk(int nodeHandle, int chunkIndex,
- int[] startAndLen)
- {
- if (_dom != null) {
- return _dom.getStringValueChunk(nodeHandle, chunkIndex, startAndLen);
- }
- else {
- return super.getStringValueChunk(nodeHandle, chunkIndex, startAndLen);
- }
- }
-
- public int getExpandedTypeID(String namespace, String localName, int type)
- {
- if (_dom != null) {
- return _dom.getExpandedTypeID(namespace, localName, type);
- }
- else {
- return super.getExpandedTypeID(namespace, localName, type);
- }
- }
-
- public String getLocalNameFromExpandedNameID(int ExpandedNameID)
- {
- if (_dom != null) {
- return _dom.getLocalNameFromExpandedNameID(ExpandedNameID);
- }
- else {
- return super.getLocalNameFromExpandedNameID(ExpandedNameID);
- }
- }
-
- public String getNamespaceFromExpandedNameID(int ExpandedNameID)
- {
- if (_dom != null) {
- return _dom.getNamespaceFromExpandedNameID(ExpandedNameID);
- }
- else {
- return super.getNamespaceFromExpandedNameID(ExpandedNameID);
- }
- }
-
- public String getLocalName(int nodeHandle)
- {
- if (_dom != null) {
- return _dom.getLocalName(nodeHandle);
- }
- else {
- return super.getLocalName(nodeHandle);
- }
- }
-
- public String getPrefix(int nodeHandle)
- {
- if (_dom != null) {
- return _dom.getPrefix(nodeHandle);
- }
- else {
- return super.getPrefix(nodeHandle);
- }
- }
-
- public String getNamespaceURI(int nodeHandle)
- {
- if (_dom != null) {
- return _dom.getNamespaceURI(nodeHandle);
- }
- else {
- return super.getNamespaceURI(nodeHandle);
- }
- }
-
- public String getNodeValue(int nodeHandle)
- {
- if (_dom != null) {
- return _dom.getNodeValue(nodeHandle);
- }
- else {
- return super.getNodeValue(nodeHandle);
- }
- }
-
- public short getNodeType(int nodeHandle)
- {
- if (_dom != null) {
- return _dom.getNodeType(nodeHandle);
- }
- else {
- return super.getNodeType(nodeHandle);
- }
- }
-
- public short getLevel(int nodeHandle)
- {
- if (_dom != null) {
- return _dom.getLevel(nodeHandle);
- }
- else {
- return super.getLevel(nodeHandle);
- }
- }
-
- public boolean isSupported(String feature, String version)
- {
- if (_dom != null) {
- return _dom.isSupported(feature, version);
- }
- else {
- return super.isSupported(feature, version);
- }
- }
-
- public String getDocumentBaseURI()
- {
- if (_dom != null) {
- return _dom.getDocumentBaseURI();
- }
- else {
- return super.getDocumentBaseURI();
- }
- }
-
- public void setDocumentBaseURI(String baseURI)
- {
- if (_dom != null) {
- _dom.setDocumentBaseURI(baseURI);
- }
- else {
- super.setDocumentBaseURI(baseURI);
- }
- }
-
- public String getDocumentSystemIdentifier(int nodeHandle)
- {
- if (_dom != null) {
- return _dom.getDocumentSystemIdentifier(nodeHandle);
- }
- else {
- return super.getDocumentSystemIdentifier(nodeHandle);
- }
- }
-
- public String getDocumentEncoding(int nodeHandle)
- {
- if (_dom != null) {
- return _dom.getDocumentEncoding(nodeHandle);
- }
- else {
- return super.getDocumentEncoding(nodeHandle);
- }
- }
-
- public String getDocumentStandalone(int nodeHandle)
- {
- if (_dom != null) {
- return _dom.getDocumentStandalone(nodeHandle);
- }
- else {
- return super.getDocumentStandalone(nodeHandle);
- }
- }
-
- public String getDocumentVersion(int documentHandle)
- {
- if (_dom != null) {
- return _dom.getDocumentVersion(documentHandle);
- }
- else {
- return super.getDocumentVersion(documentHandle);
- }
- }
-
- public boolean getDocumentAllDeclarationsProcessed()
- {
- if (_dom != null) {
- return _dom.getDocumentAllDeclarationsProcessed();
- }
- else {
- return super.getDocumentAllDeclarationsProcessed();
- }
- }
-
- public String getDocumentTypeDeclarationSystemIdentifier()
- {
- if (_dom != null) {
- return _dom.getDocumentTypeDeclarationSystemIdentifier();
- }
- else {
- return super.getDocumentTypeDeclarationSystemIdentifier();
- }
- }
-
- public String getDocumentTypeDeclarationPublicIdentifier()
- {
- if (_dom != null) {
- return _dom.getDocumentTypeDeclarationPublicIdentifier();
- }
- else {
- return super.getDocumentTypeDeclarationPublicIdentifier();
- }
- }
-
- public int getElementById(String elementId)
- {
- if (_dom != null) {
- return _dom.getElementById(elementId);
- }
- else {
- return super.getElementById(elementId);
- }
- }
-
- public boolean supportsPreStripping()
- {
- if (_dom != null) {
- return _dom.supportsPreStripping();
- }
- else {
- return super.supportsPreStripping();
- }
- }
-
- public boolean isNodeAfter(int firstNodeHandle, int secondNodeHandle)
- {
- if (_dom != null) {
- return _dom.isNodeAfter(firstNodeHandle, secondNodeHandle);
- }
- else {
- return super.isNodeAfter(firstNodeHandle, secondNodeHandle);
- }
- }
-
- public boolean isCharacterElementContentWhitespace(int nodeHandle)
- {
- if (_dom != null) {
- return _dom.isCharacterElementContentWhitespace(nodeHandle);
- }
- else {
- return super.isCharacterElementContentWhitespace(nodeHandle);
- }
- }
-
- public boolean isDocumentAllDeclarationsProcessed(int documentHandle)
- {
- if (_dom != null) {
- return _dom.isDocumentAllDeclarationsProcessed(documentHandle);
- }
- else {
- return super.isDocumentAllDeclarationsProcessed(documentHandle);
- }
- }
-
- public boolean isAttributeSpecified(int attributeHandle)
- {
- if (_dom != null) {
- return _dom.isAttributeSpecified(attributeHandle);
- }
- else {
- return super.isAttributeSpecified(attributeHandle);
- }
- }
-
- public void dispatchCharactersEvents(int nodeHandle, org.xml.sax.ContentHandler ch,
- boolean normalize)
- throws org.xml.sax.SAXException
- {
- if (_dom != null) {
- _dom.dispatchCharactersEvents(nodeHandle, ch, normalize);
- }
- else {
- super.dispatchCharactersEvents(nodeHandle, ch, normalize);
- }
- }
-
- public void dispatchToEvents(int nodeHandle, org.xml.sax.ContentHandler ch)
- throws org.xml.sax.SAXException
- {
- if (_dom != null) {
- _dom.dispatchToEvents(nodeHandle, ch);
- }
- else {
- super.dispatchToEvents(nodeHandle, ch);
- }
- }
-
- public org.w3c.dom.Node getNode(int nodeHandle)
- {
- if (_dom != null) {
- return _dom.getNode(nodeHandle);
- }
- else {
- return super.getNode(nodeHandle);
- }
- }
-
- public boolean needsTwoThreads()
- {
- if (_dom != null) {
- return _dom.needsTwoThreads();
- }
- else {
- return super.needsTwoThreads();
- }
- }
-
- public org.xml.sax.ContentHandler getContentHandler()
- {
- if (_dom != null) {
- return _dom.getContentHandler();
- }
- else {
- return super.getContentHandler();
- }
- }
-
- public org.xml.sax.ext.LexicalHandler getLexicalHandler()
- {
- if (_dom != null) {
- return _dom.getLexicalHandler();
- }
- else {
- return super.getLexicalHandler();
- }
- }
-
- public org.xml.sax.EntityResolver getEntityResolver()
- {
- if (_dom != null) {
- return _dom.getEntityResolver();
- }
- else {
- return super.getEntityResolver();
- }
- }
-
- public org.xml.sax.DTDHandler getDTDHandler()
- {
- if (_dom != null) {
- return _dom.getDTDHandler();
- }
- else {
- return super.getDTDHandler();
- }
- }
-
- public org.xml.sax.ErrorHandler getErrorHandler()
- {
- if (_dom != null) {
- return _dom.getErrorHandler();
- }
- else {
- return super.getErrorHandler();
- }
- }
-
- public org.xml.sax.ext.DeclHandler getDeclHandler()
- {
- if (_dom != null) {
- return _dom.getDeclHandler();
- }
- else {
- return super.getDeclHandler();
- }
- }
-
- public void appendChild(int newChild, boolean clone, boolean cloneDepth)
- {
- if (_dom != null) {
- _dom.appendChild(newChild, clone, cloneDepth);
- }
- else {
- super.appendChild(newChild, clone, cloneDepth);
- }
- }
-
- public void appendTextChild(String str)
- {
- if (_dom != null) {
- _dom.appendTextChild(str);
- }
- else {
- super.appendTextChild(str);
- }
- }
-
- public SourceLocator getSourceLocatorFor(int node)
- {
- if (_dom != null) {
- return _dom.getSourceLocatorFor(node);
- }
- else {
- return super.getSourceLocatorFor(node);
- }
- }
-
- public void documentRegistration()
- {
- if (_dom != null) {
- _dom.documentRegistration();
- }
- else {
- super.documentRegistration();
- }
- }
-
- public void documentRelease()
- {
- if (_dom != null) {
- _dom.documentRelease();
- }
- else {
- super.documentRelease();
- }
- }
-
- public void release() {
- if (_dom != null) {
- _dom.release();
- _dom = null;
- }
- super.release();
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/AnyNodeCounter.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/AnyNodeCounter.java
deleted file mode 100644
index ebae63d..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/AnyNodeCounter.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: AnyNodeCounter.java,v 1.2.4.1 2005/09/06 05:54:53 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.dom;
-
-import com.sun.org.apache.xalan.internal.xsltc.DOM;
-import com.sun.org.apache.xalan.internal.xsltc.Translet;
-import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-public abstract class AnyNodeCounter extends NodeCounter {
- public AnyNodeCounter(Translet translet,
- DOM document, DTMAxisIterator iterator) {
- super(translet, document, iterator);
- }
-
- public AnyNodeCounter(Translet translet,
- DOM document,
- DTMAxisIterator iterator,
- boolean hasFrom) {
- super(translet, document, iterator, hasFrom);
- }
-
- public NodeCounter setStartNode(int node) {
- _node = node;
- _nodeType = _document.getExpandedTypeID(node);
- return this;
- }
-
- public String getCounter() {
- int result;
- if (_value != Integer.MIN_VALUE) {
- //See Errata E24
- if (_value == 0) return "0";
- else if (Double.isNaN(_value)) return "NaN";
- else if (_value < 0 && Double.isInfinite(_value)) return "-Infinity";
- else if (Double.isInfinite(_value)) return "Infinity";
- else return formatNumbers((int)_value);
- }
- else {
- int next = _node;
- final int root = _document.getDocument();
- result = 0;
- while (next >= root && !matchesFrom(next)) {
- if (matchesCount(next)) {
- ++result;
- }
- next--;
-//%HZ%: Is this the best way of finding the root? Is it better to check
-//%HZ%: parent(next)?
- /*
- if (next == root) {
- break;
- }
- else {
- --next;
- }
- */
- }
- }
- return formatNumbers(result);
- }
-
- public static NodeCounter getDefaultNodeCounter(Translet translet,
- DOM document,
- DTMAxisIterator iterator) {
- return new DefaultAnyNodeCounter(translet, document, iterator);
- }
-
- static class DefaultAnyNodeCounter extends AnyNodeCounter {
- public DefaultAnyNodeCounter(Translet translet,
- DOM document, DTMAxisIterator iterator) {
- super(translet, document, iterator);
- }
-
- public String getCounter() {
- int result;
- if (_value != Integer.MIN_VALUE) {
- //See Errata E24
- if (_value == 0) return "0";
- else if (Double.isNaN(_value)) return "NaN";
- else if (_value < 0 && Double.isInfinite(_value)) return "-Infinity";
- else if (Double.isInfinite(_value)) return "Infinity";
- else result = (int) _value;
- }
- else {
- int next = _node;
- result = 0;
- final int ntype = _document.getExpandedTypeID(_node);
- final int root = _document.getDocument();
- while (next >= 0) {
- if (ntype == _document.getExpandedTypeID(next)) {
- result++;
- }
-//%HZ%: Is this the best way of finding the root? Is it better to check
-//%HZ%: parent(next)?
- if (next == root) {
- break;
- }
- else {
- --next;
- }
- }
- }
- return formatNumbers(result);
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/ArrayNodeListIterator.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/ArrayNodeListIterator.java
deleted file mode 100644
index d7cf3a5..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/ArrayNodeListIterator.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- * $Id: ArrayNodeListIterator.java,v 1.0 2009-11-25 04:34:24 joehw Exp $
- */
-package com.sun.org.apache.xalan.internal.xsltc.dom;
-
-import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
-
-public class ArrayNodeListIterator implements DTMAxisIterator {
-
- private int _pos = 0;
-
- private int _mark = 0;
-
- private int _nodes[];
-
- private static final int[] EMPTY = { };
-
- public ArrayNodeListIterator(int[] nodes) {
- _nodes = nodes;
- }
-
- public int next() {
- return _pos < _nodes.length ? _nodes[_pos++] : END;
- }
-
- public DTMAxisIterator reset() {
- _pos = 0;
- return this;
- }
-
- public int getLast() {
- return _nodes.length;
- }
-
- public int getPosition() {
- return _pos;
- }
-
- public void setMark() {
- _mark = _pos;
- }
-
- public void gotoMark() {
- _pos = _mark;
- }
-
- public DTMAxisIterator setStartNode(int node) {
- if (node == END) _nodes = EMPTY;
- return this;
- }
-
- public int getStartNode() {
- return END;
- }
-
- public boolean isReverse() {
- return false;
- }
-
- public DTMAxisIterator cloneIterator() {
- return new ArrayNodeListIterator(_nodes);
- }
-
- public void setRestartable(boolean isRestartable) {
- }
-
- public int getNodeByPosition(int position) {
- return _nodes[position - 1];
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/BitArray.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/BitArray.java
deleted file mode 100644
index aadfb54..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/BitArray.java
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: BitArray.java,v 1.2.4.1 2005/09/06 05:56:52 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.dom;
-
-import java.io.Externalizable;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-
-import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
-
-
-/**
- * @author Morten Jorgensen
- */
-public class BitArray implements Externalizable {
- static final long serialVersionUID = -4876019880708377663L;
-
- private int[] _bits;
- private int _bitSize;
- private int _intSize;
- private int _mask;
-
- // This table is used to prevent expensive shift operations
- // (These operations are inexpensive on CPUs but very expensive on JVMs.)
- private final static int[] _masks = {
- 0x80000000, 0x40000000, 0x20000000, 0x10000000,
- 0x08000000, 0x04000000, 0x02000000, 0x01000000,
- 0x00800000, 0x00400000, 0x00200000, 0x00100000,
- 0x00080000, 0x00040000, 0x00020000, 0x00010000,
- 0x00008000, 0x00004000, 0x00002000, 0x00001000,
- 0x00000800, 0x00000400, 0x00000200, 0x00000100,
- 0x00000080, 0x00000040, 0x00000020, 0x00000010,
- 0x00000008, 0x00000004, 0x00000002, 0x00000001 };
-
- private final static boolean DEBUG_ASSERTIONS = false;
-
- /**
- * Constructor. Defines the initial size of the bit array (in bits).
- */
- public BitArray() {
- this(32);
- }
-
- public BitArray(int size) {
- if (size < 32) size = 32;
- _bitSize = size;
- _intSize = (_bitSize >>> 5) + 1;
- _bits = new int[_intSize + 1];
- }
-
- public BitArray(int size, int[] bits) {
- if (size < 32) size = 32;
- _bitSize = size;
- _intSize = (_bitSize >>> 5) + 1;
- _bits = bits;
- }
-
- /**
- * Set the mask for this bit array. The upper 8 bits of this mask
- * indicate the DOM in which the nodes in this array belong.
- */
- public void setMask(int mask) {
- _mask = mask;
- }
-
- /**
- * See setMask()
- */
- public int getMask() {
- return(_mask);
- }
-
- /**
- * Returns the size of this bit array (in bits).
- */
- public final int size() {
- return(_bitSize);
- }
-
- /**
- * Returns true if the given bit is set
- */
- public final boolean getBit(int bit) {
- if (DEBUG_ASSERTIONS) {
- if (bit >= _bitSize) {
- throw new Error(
- "Programmer's assertion in BitArray.getBit");
- }
- }
-
- return((_bits[bit>>>5] & _masks[bit%32]) != 0);
- }
-
- /**
- * Returns the next set bit from a given position
- */
- public final int getNextBit(int startBit) {
- for (int i = (startBit >>> 5) ; i<=_intSize; i++) {
- int bits = _bits[i];
- if (bits != 0) {
- for (int b = (startBit % 32); b<32; b++) {
- if ((bits & _masks[b]) != 0) {
- return((i << 5) + b);
- }
- }
- }
- startBit = 0;
- }
- return(DTMAxisIterator.END);
- }
-
- /**
- * This method returns the Nth bit that is set in the bit array. The
- * current position is cached in the following 4 variables and will
- * help speed up a sequence of next() call in an index iterator. This
- * method is a mess, but it is fast and it works, so don't fuck with it.
- */
- private int _pos = Integer.MAX_VALUE;
- private int _node = 0;
- private int _int = 0;
- private int _bit = 0;
-
- public final int getBitNumber(int pos) {
-
- // Return last node if position we're looking for is the same
- if (pos == _pos) return(_node);
-
- // Start from beginning of position we're looking for is before
- // the point where we left off the last time.
- if (pos < _pos) {
- _int = _bit = _pos = 0;
- }
-
- // Scan through the bit array - skip integers that have no bits set
- for ( ; _int <= _intSize; _int++) {
- int bits = _bits[_int];
- if (bits != 0) { // Any bits set?
- for ( ; _bit < 32; _bit++) {
- if ((bits & _masks[_bit]) != 0) {
- if (++_pos == pos) {
- _node = ((_int << 5) + _bit) - 1;
- return (_node);
- }
- }
- }
- _bit = 0;
- }
- }
- return(0);
- }
-
- /**
- * Returns the integer array in which the bit array is contained
- */
- public final int[] data() {
- return(_bits);
- }
-
- int _first = Integer.MAX_VALUE; // The index where first set bit is
- int _last = Integer.MIN_VALUE; // The _INTEGER INDEX_ where last set bit is
-
- /**
- * Sets a given bit
- */
- public final void setBit(int bit) {
- if (DEBUG_ASSERTIONS) {
- if (bit >= _bitSize) {
- throw new Error(
- "Programmer's assertion in BitArray.getBit");
- }
- }
-
- if (bit >= _bitSize) return;
- final int i = (bit >>> 5);
- if (i < _first) _first = i;
- if (i > _last) _last = i;
- _bits[i] |= _masks[bit % 32];
- }
-
- /**
- * Merge two bit arrays. This currently only works for nodes from
- * a single DOM (because there is only one _mask per array).
- */
- public final BitArray merge(BitArray other) {
- // Take other array's bits if we have node set
- if (_last == -1) {
- _bits = other._bits;
- }
- // Only merge if other array has any bits set
- else if (other._last != -1) {
- int start = (_first < other._first) ? _first : other._first;
- int stop = (_last > other._last) ? _last : other._last;
-
- // Merge these bits into other array if other array is larger
- if (other._intSize > _intSize) {
- if (stop > _intSize) stop = _intSize;
- for (int i=start; i<=stop; i++)
- other._bits[i] |= _bits[i];
- _bits = other._bits;
- }
- // Merge other bits into this array if this arrai is large/equal.
- else {
- if (stop > other._intSize) stop = other._intSize;
- for (int i=start; i<=stop; i++)
- _bits[i] |= other._bits[i];
- }
- }
- return(this);
- }
-
- /**
- * Resizes the bit array - try to avoid using this method!!!
- */
- public final void resize(int newSize) {
- if (newSize > _bitSize) {
- _intSize = (newSize >>> 5) + 1;
- final int[] newBits = new int[_intSize + 1];
- System.arraycopy(_bits, 0, newBits, 0, (_bitSize>>>5) + 1);
- _bits = newBits;
- _bitSize = newSize;
- }
- }
-
- public BitArray cloneArray() {
- return(new BitArray(_intSize, _bits));
- }
-
- public void writeExternal(ObjectOutput out) throws IOException {
- out.writeInt(_bitSize);
- out.writeInt(_mask);
- out.writeObject(_bits);
- out.flush();
- }
-
- /**
- * Read the whole tree from a file (serialized)
- */
- public void readExternal(ObjectInput in)
- throws IOException, ClassNotFoundException {
- _bitSize = in.readInt();
- _intSize = (_bitSize >>> 5) + 1;
- _mask = in.readInt();
- _bits = (int[])in.readObject();
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/CachedNodeListIterator.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/CachedNodeListIterator.java
deleted file mode 100644
index 3a3ed93..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/CachedNodeListIterator.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: CachedNodeListIterator.java,v 1.2.4.1 2005/09/06 05:57:47 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.dom;
-
-import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
-import com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase;
-import com.sun.org.apache.xalan.internal.xsltc.util.IntegerArray;
-
-/**
- * CachedNodeListIterator is used for select expressions in a
- * variable or parameter. This iterator caches all nodes in an
- * IntegerArray. Its cloneIterator() method is overridden to
- * return an object of ClonedNodeListIterator.
- */
-public final class CachedNodeListIterator extends DTMAxisIteratorBase {
-
- /**
- * Source for this iterator.
- */
- private DTMAxisIterator _source;
- private IntegerArray _nodes = new IntegerArray();
- private int _numCachedNodes = 0;
- private int _index = 0;
- private boolean _isEnded = false;
-
- public CachedNodeListIterator(DTMAxisIterator source) {
- _source = source;
- }
-
- public void setRestartable(boolean isRestartable) {
- //_isRestartable = isRestartable;
- //_source.setRestartable(isRestartable);
- }
-
- public DTMAxisIterator setStartNode(int node) {
- if (_isRestartable) {
- _startNode = node;
- _source.setStartNode(node);
- resetPosition();
-
- _isRestartable = false;
- }
- return this;
- }
-
- public int next() {
- return getNode(_index++);
- }
-
- public int getPosition() {
- return _index == 0 ? 1 : _index;
- }
-
- public int getNodeByPosition(int pos) {
- return getNode(pos);
- }
-
- public int getNode(int index) {
- if (index < _numCachedNodes) {
- return _nodes.at(index);
- }
- else if (!_isEnded){
- int node = _source.next();
- if (node != END) {
- _nodes.add(node);
- _numCachedNodes++;
- }
- else {
- _isEnded = true;
- }
- return node;
- }
- else
- return END;
- }
-
- public DTMAxisIterator cloneIterator() {
- ClonedNodeListIterator clone = new ClonedNodeListIterator(this);
- return clone;
- }
-
- public DTMAxisIterator reset() {
- _index = 0;
- return this;
- }
-
- public void setMark() {
- _source.setMark();
- }
-
- public void gotoMark() {
- _source.gotoMark();
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/ClonedNodeListIterator.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/ClonedNodeListIterator.java
deleted file mode 100644
index 71d5949..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/ClonedNodeListIterator.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ClonedNodeListIterator.java,v 1.2.4.1 2005/09/06 06:02:12 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.dom;
-
-import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
-import com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase;
-
-/**
- * A ClonedNodeListIterator is returned by the cloneIterator() method
- * of a CachedNodeListIterator. Its next() method retrieves the nodes from
- * the cache of the CachedNodeListIterator.
- */
-public final class ClonedNodeListIterator extends DTMAxisIteratorBase {
-
- /**
- * Source for this iterator.
- */
- private CachedNodeListIterator _source;
- private int _index = 0;
-
- public ClonedNodeListIterator(CachedNodeListIterator source) {
- _source = source;
- }
-
- public void setRestartable(boolean isRestartable) {
- //_isRestartable = isRestartable;
- //_source.setRestartable(isRestartable);
- }
-
- public DTMAxisIterator setStartNode(int node) {
- return this;
- }
-
- public int next() {
- return _source.getNode(_index++);
- }
-
- public int getPosition() {
- return _index == 0 ? 1 : _index;
- }
-
- public int getNodeByPosition(int pos) {
- return _source.getNode(pos);
- }
-
- public DTMAxisIterator cloneIterator() {
- return _source.cloneIterator();
- }
-
- public DTMAxisIterator reset() {
- _index = 0;
- return this;
- }
-
- public void setMark() {
- _source.setMark();
- }
-
- public void gotoMark() {
- _source.gotoMark();
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/CollatorFactoryBase.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/CollatorFactoryBase.java
deleted file mode 100644
index 83d394e..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/CollatorFactoryBase.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: CollatorFactoryBase.java,v 1.2.4.1 2005/09/06 06:03:08 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.dom;
-
-import java.text.Collator;
-import java.util.Locale;
-
-import com.sun.org.apache.xalan.internal.xsltc.CollatorFactory;
-
-/**
- * @author W. Eliot Kimber (eliot@isogen.com)
- */
-public class CollatorFactoryBase implements CollatorFactory {
-
- public static final Locale DEFAULT_LOCALE = Locale.getDefault();
- public static final Collator DEFAULT_COLLATOR = Collator.getInstance();
-
- public CollatorFactoryBase() {
- }
-
- public Collator getCollator(String lang, String country) {
- return Collator.getInstance(new Locale(lang, country));
- }
-
- public Collator getCollator(Locale locale) {
- if (locale == DEFAULT_LOCALE)
- return DEFAULT_COLLATOR;
- else
- return Collator.getInstance(locale);
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/CurrentNodeListFilter.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/CurrentNodeListFilter.java
deleted file mode 100644
index 5457be5..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/CurrentNodeListFilter.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: CurrentNodeListFilter.java,v 1.2.4.1 2005/09/06 06:04:06 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.dom;
-
-import com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet;
-import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- */
-public interface CurrentNodeListFilter {
- public abstract boolean test(int node, int position, int last, int current,
- AbstractTranslet translet, DTMAxisIterator iter);
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/CurrentNodeListIterator.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/CurrentNodeListIterator.java
deleted file mode 100644
index 512e1e9..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/CurrentNodeListIterator.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: CurrentNodeListIterator.java,v 1.2.4.1 2005/09/06 06:04:45 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.dom;
-
-import com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.BasisLibrary;
-import com.sun.org.apache.xalan.internal.xsltc.util.IntegerArray;
-import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
-import com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase;
-
-/**
- * Iterators of this kind use a CurrentNodeListFilter to filter a subset of
- * nodes from a source iterator. For each node from the source, the boolean
- * method CurrentNodeListFilter.test() is called.
- *
- * All nodes from the source are read into an array upon calling setStartNode()
- * (this is needed to determine the value of last, a parameter to
- * CurrentNodeListFilter.test()). The method getLast() returns the last element
- * after applying the filter.
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- */
-
-public final class CurrentNodeListIterator extends DTMAxisIteratorBase {
- /**
- * A flag indicating if nodes are returned in document order.
- */
- private boolean _docOrder;
-
- /**
- * The source for this iterator.
- */
- private DTMAxisIterator _source;
-
- /**
- * A reference to a filter object.
- */
- private final CurrentNodeListFilter _filter;
-
- /**
- * An integer array to store nodes from source iterator.
- */
- private IntegerArray _nodes = new IntegerArray();
-
- /**
- * Index in _nodes of the next node to filter.
- */
- private int _currentIndex;
-
- /**
- * The current node in the stylesheet at the time of evaluation.
- */
- private final int _currentNode;
-
- /**
- * A reference to the translet.
- */
- private AbstractTranslet _translet;
-
- public CurrentNodeListIterator(DTMAxisIterator source,
- CurrentNodeListFilter filter,
- int currentNode,
- AbstractTranslet translet)
- {
- this(source, !source.isReverse(), filter, currentNode, translet);
- }
-
- public CurrentNodeListIterator(DTMAxisIterator source, boolean docOrder,
- CurrentNodeListFilter filter,
- int currentNode,
- AbstractTranslet translet)
- {
- _source = source;
- _filter = filter;
- _translet = translet;
- _docOrder = docOrder;
- _currentNode = currentNode;
- }
-
- public DTMAxisIterator forceNaturalOrder() {
- _docOrder = true;
- return this;
- }
-
- public void setRestartable(boolean isRestartable) {
- _isRestartable = isRestartable;
- _source.setRestartable(isRestartable);
- }
-
- public boolean isReverse() {
- return !_docOrder;
- }
-
- public DTMAxisIterator cloneIterator() {
- try {
- final CurrentNodeListIterator clone =
- (CurrentNodeListIterator) super.clone();
- clone._nodes = (IntegerArray) _nodes.clone();
- clone._source = _source.cloneIterator();
- clone._isRestartable = false;
- return clone.reset();
- }
- catch (CloneNotSupportedException e) {
- BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR,
- e.toString());
- return null;
- }
- }
-
- public DTMAxisIterator reset() {
- _currentIndex = 0;
- return resetPosition();
- }
-
- public int next() {
- final int last = _nodes.cardinality();
- final int currentNode = _currentNode;
- final AbstractTranslet translet = _translet;
-
- for (int index = _currentIndex; index < last; ) {
- final int position = _docOrder ? index + 1 : last - index;
- final int node = _nodes.at(index++); // note increment
-
- if (_filter.test(node, position, last, currentNode, translet,
- this)) {
- _currentIndex = index;
- return returnNode(node);
- }
- }
- return END;
- }
-
- public DTMAxisIterator setStartNode(int node) {
- if (_isRestartable) {
- _source.setStartNode(_startNode = node);
-
- _nodes.clear();
- while ((node = _source.next()) != END) {
- _nodes.add(node);
- }
- _currentIndex = 0;
- resetPosition();
- }
- return this;
- }
-
- public int getLast() {
- if (_last == -1) {
- _last = computePositionOfLast();
- }
- return _last;
- }
-
- public void setMark() {
- _markedNode = _currentIndex;
- }
-
- public void gotoMark() {
- _currentIndex = _markedNode;
- }
-
- private int computePositionOfLast() {
- final int last = _nodes.cardinality();
- final int currNode = _currentNode;
- final AbstractTranslet translet = _translet;
-
- int lastPosition = _position;
- for (int index = _currentIndex; index < last; ) {
- final int position = _docOrder ? index + 1 : last - index;
- int nodeIndex = _nodes.at(index++); // note increment
-
- if (_filter.test(nodeIndex, position, last, currNode, translet,
- this)) {
- lastPosition++;
- }
- }
- return lastPosition;
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/DOMAdapter.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/DOMAdapter.java
deleted file mode 100644
index 4f44ae1..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/DOMAdapter.java
+++ /dev/null
@@ -1,464 +0,0 @@
-/*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.dom;
-
-import com.sun.org.apache.xalan.internal.xsltc.DOM;
-import com.sun.org.apache.xalan.internal.xsltc.DOMEnhancedForDTM;
-import com.sun.org.apache.xalan.internal.xsltc.StripFilter;
-import com.sun.org.apache.xalan.internal.xsltc.TransletException;
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
-import com.sun.org.apache.xml.internal.serializer.SerializationHandler;
-import java.util.Map;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * @author Jacek Ambroziak
- * @author Morten Jorgensen
- */
-public final class DOMAdapter implements DOM {
-
- // Mutually exclusive casting of DOM interface to known implementations
- private DOMEnhancedForDTM _enhancedDOM;
-
- private DOM _dom;
-
- private String[] _namesArray;
- private String[] _urisArray;
- private int[] _typesArray;
- private String[] _namespaceArray;
-
- // Cached mappings
- private short[] _mapping = null;
- private int[] _reverse = null;
- private short[] _NSmapping = null;
- private short[] _NSreverse = null;
-
- private int _multiDOMMask;
-
- public DOMAdapter(DOM dom,
- String[] namesArray,
- String[] urisArray,
- int[] typesArray,
- String[] namespaceArray) {
- if (dom instanceof DOMEnhancedForDTM){
- _enhancedDOM = (DOMEnhancedForDTM) dom;
- }
-
- _dom = dom;
- _namesArray = namesArray;
- _urisArray = urisArray;
- _typesArray = typesArray;
- _namespaceArray = namespaceArray;
- }
-
- public void setupMapping(String[] names, String[] urisArray,
- int[] typesArray, String[] namespaces) {
- _namesArray = names;
- _urisArray = urisArray;
- _typesArray = typesArray;
- _namespaceArray = namespaces;
- }
-
- public String[] getNamesArray() {
- return _namesArray;
- }
-
- public String[] getUrisArray() {
- return _urisArray;
- }
-
- public int[] getTypesArray() {
- return _typesArray;
- }
-
- public String[] getNamespaceArray() {
- return _namespaceArray;
- }
-
- public DOM getDOMImpl() {
- return _dom;
- }
-
- private short[] getMapping() {
- if (_mapping == null) {
- if (_enhancedDOM != null) {
- _mapping = _enhancedDOM.getMapping(_namesArray, _urisArray,
- _typesArray);
- }
- }
- return _mapping;
- }
-
- private int[] getReverse() {
- if (_reverse == null) {
- if (_enhancedDOM != null) {
- _reverse = _enhancedDOM.getReverseMapping(_namesArray,
- _urisArray,
- _typesArray);
- }
- }
- return _reverse;
- }
-
- private short[] getNSMapping() {
- if (_NSmapping == null) {
- if (_enhancedDOM != null) {
- _NSmapping = _enhancedDOM.getNamespaceMapping(_namespaceArray);
- }
- }
- return _NSmapping;
- }
-
- private short[] getNSReverse() {
- if (_NSreverse == null) {
- if (_enhancedDOM != null) {
- _NSreverse = _enhancedDOM
- .getReverseNamespaceMapping(_namespaceArray);
- }
- }
- return _NSreverse;
- }
-
- /**
- * Returns singleton iterator containg the document root
- */
- public DTMAxisIterator getIterator() {
- return _dom.getIterator();
- }
-
- public String getStringValue() {
- return _dom.getStringValue();
- }
-
- public DTMAxisIterator getChildren(final int node) {
- if (_enhancedDOM != null) {
- return _enhancedDOM.getChildren(node);
- }
- else {
- DTMAxisIterator iterator = _dom.getChildren(node);
- return iterator.setStartNode(node);
- }
- }
-
- public void setFilter(StripFilter filter) {}
-
- public DTMAxisIterator getTypedChildren(final int type) {
- final int[] reverse = getReverse();
-
- if (_enhancedDOM != null) {
- return _enhancedDOM.getTypedChildren(reverse[type]);
- }
- else {
- return _dom.getTypedChildren(type);
- }
- }
-
- public DTMAxisIterator getNamespaceAxisIterator(final int axis,
- final int ns) {
- return _dom.getNamespaceAxisIterator(axis, getNSReverse()[ns]);
- }
-
- public DTMAxisIterator getAxisIterator(final int axis) {
- if (_enhancedDOM != null) {
- return _enhancedDOM.getAxisIterator(axis);
- }
- else {
- return _dom.getAxisIterator(axis);
- }
- }
-
- public DTMAxisIterator getTypedAxisIterator(final int axis,
- final int type) {
- final int[] reverse = getReverse();
- if (_enhancedDOM != null) {
- return _enhancedDOM.getTypedAxisIterator(axis, reverse[type]);
- } else {
- return _dom.getTypedAxisIterator(axis, type);
- }
- }
-
- public int getMultiDOMMask() {
- return _multiDOMMask;
- }
-
- public void setMultiDOMMask(int mask) {
- _multiDOMMask = mask;
- }
-
- public DTMAxisIterator getNthDescendant(int type, int n,
- boolean includeself) {
- return _dom.getNthDescendant(getReverse()[type], n, includeself);
- }
-
- public DTMAxisIterator getNodeValueIterator(DTMAxisIterator iterator,
- int type, String value,
- boolean op) {
- return _dom.getNodeValueIterator(iterator, type, value, op);
- }
-
- public DTMAxisIterator orderNodes(DTMAxisIterator source, int node) {
- return _dom.orderNodes(source, node);
- }
-
- public int getExpandedTypeID(final int node) {
- final short[] mapping = getMapping();
- final int type;
- if (_enhancedDOM != null) {
- type = mapping[_enhancedDOM.getExpandedTypeID2(node)];
- }
- else {
- if(null != mapping)
- {
- type = mapping[_dom.getExpandedTypeID(node)];
- }
- else
- {
- type = _dom.getExpandedTypeID(node);
- }
- }
- return type;
- }
-
- public int getNamespaceType(final int node) {
- return getNSMapping()[_dom.getNSType(node)];
- }
-
- public int getNSType(int node) {
- return _dom.getNSType(node);
- }
-
- public int getParent(final int node) {
- return _dom.getParent(node);
- }
-
- public int getAttributeNode(final int type, final int element) {
- return _dom.getAttributeNode(getReverse()[type], element);
- }
-
- public String getNodeName(final int node) {
- if (node == DTM.NULL) {
- return "";
- }
- return _dom.getNodeName(node);
- }
-
- public String getNodeNameX(final int node)
- {
- if (node == DTM.NULL) {
- return "";
- }
- return _dom.getNodeNameX(node);
- }
-
- public String getNamespaceName(final int node)
- {
- if (node == DTM.NULL) {
- return "";
- }
- return _dom.getNamespaceName(node);
- }
-
- public String getStringValueX(final int node)
- {
- if (_enhancedDOM != null) {
- return _enhancedDOM.getStringValueX(node);
- }
- else {
- if (node == DTM.NULL) {
- return "";
- }
- return _dom.getStringValueX(node);
- }
- }
-
- public void copy(final int node, SerializationHandler handler)
- throws TransletException
- {
- _dom.copy(node, handler);
- }
-
- public void copy(DTMAxisIterator nodes,SerializationHandler handler)
- throws TransletException
- {
- _dom.copy(nodes, handler);
- }
-
- public String shallowCopy(final int node, SerializationHandler handler)
- throws TransletException
- {
- if (_enhancedDOM != null) {
- return _enhancedDOM.shallowCopy(node, handler);
- }
- else {
- return _dom.shallowCopy(node, handler);
- }
- }
-
- public boolean lessThan(final int node1, final int node2)
- {
- return _dom.lessThan(node1, node2);
- }
-
- public void characters(final int textNode, SerializationHandler handler)
- throws TransletException
- {
- if (_enhancedDOM != null) {
- _enhancedDOM.characters(textNode, handler);
- }
- else {
- _dom.characters(textNode, handler);
- }
- }
-
- public Node makeNode(int index)
- {
- return _dom.makeNode(index);
- }
-
- public Node makeNode(DTMAxisIterator iter)
- {
- return _dom.makeNode(iter);
- }
-
- public NodeList makeNodeList(int index)
- {
- return _dom.makeNodeList(index);
- }
-
- public NodeList makeNodeList(DTMAxisIterator iter)
- {
- return _dom.makeNodeList(iter);
- }
-
- public String getLanguage(int node)
- {
- return _dom.getLanguage(node);
- }
-
- public int getSize()
- {
- return _dom.getSize();
- }
-
- public void setDocumentURI(String uri)
- {
- if (_enhancedDOM != null) {
- _enhancedDOM.setDocumentURI(uri);
- }
- }
-
- public String getDocumentURI()
- {
- if (_enhancedDOM != null) {
- return _enhancedDOM.getDocumentURI();
- }
- else {
- return "";
- }
- }
-
- public String getDocumentURI(int node)
- {
- return _dom.getDocumentURI(node);
- }
-
- public int getDocument()
- {
- return _dom.getDocument();
- }
-
- public boolean isElement(final int node)
- {
- return(_dom.isElement(node));
- }
-
- public boolean isAttribute(final int node)
- {
- return(_dom.isAttribute(node));
- }
-
- public int getNodeIdent(int nodeHandle)
- {
- return _dom.getNodeIdent(nodeHandle);
- }
-
- public int getNodeHandle(int nodeId)
- {
- return _dom.getNodeHandle(nodeId);
- }
-
- /**
- * Return a instance of a DOM class to be used as an RTF
- */
- public DOM getResultTreeFrag(int initSize, int rtfType)
- {
- if (_enhancedDOM != null) {
- return _enhancedDOM.getResultTreeFrag(initSize, rtfType);
- }
- else {
- return _dom.getResultTreeFrag(initSize, rtfType);
- }
- }
-
- /**
- * Return a instance of a DOM class to be used as an RTF
- */
- public DOM getResultTreeFrag(int initSize, int rtfType,
- boolean addToManager)
- {
- if (_enhancedDOM != null) {
- return _enhancedDOM.getResultTreeFrag(initSize, rtfType,
- addToManager);
- }
- else {
- return _dom.getResultTreeFrag(initSize, rtfType, addToManager);
- }
- }
-
-
- /**
- * Returns a SerializationHandler class wrapped in a SAX adapter.
- */
- public SerializationHandler getOutputDomBuilder()
- {
- return _dom.getOutputDomBuilder();
- }
-
- public String lookupNamespace(int node, String prefix)
- throws TransletException
- {
- return _dom.lookupNamespace(node, prefix);
- }
-
- public String getUnparsedEntityURI(String entity) {
- return _dom.getUnparsedEntityURI(entity);
- }
-
- public Map<String, Integer> getElementsWithIDs() {
- return _dom.getElementsWithIDs();
- }
-
- public void release() {
- _dom.release();
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/DOMBuilder.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/DOMBuilder.java
deleted file mode 100644
index 4f16366..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/DOMBuilder.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DOMBuilder.java,v 1.2.4.1 2005/09/06 06:08:23 pvedula Exp $
- */
-package com.sun.org.apache.xalan.internal.xsltc.dom;
-
-
-/**
- * @author Morten Jorgensen
- */
-public interface DOMBuilder extends ExtendedSAX { }
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/DOMWSFilter.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/DOMWSFilter.java
deleted file mode 100644
index 54fe841..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/DOMWSFilter.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DOMWSFilter.java,v 1.2.4.1 2005/09/06 06:14:31 pvedula Exp $
- */
-package com.sun.org.apache.xalan.internal.xsltc.dom;
-
-import com.sun.org.apache.xalan.internal.xsltc.DOM;
-import com.sun.org.apache.xalan.internal.xsltc.DOMEnhancedForDTM;
-import com.sun.org.apache.xalan.internal.xsltc.StripFilter;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet;
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMWSFilter;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * A wrapper class that adapts the
- * {@link com.sun.org.apache.xml.internal.dtm.DTMWSFilter DTMWSFilter} interface to the XSLTC
- * DOM {@link com.sun.org.apache.xalan.internal.xsltc.StripFilter StripFilter} interface.
- */
-public class DOMWSFilter implements DTMWSFilter {
-
- private AbstractTranslet m_translet;
- private StripFilter m_filter;
-
- // The Map for DTM to mapping array
- private Map<DTM, short[]> m_mappings;
-
- // Cache the DTM and mapping that are used last time
- private DTM m_currentDTM;
- private short[] m_currentMapping;
-
- /**
- * Construct an adapter connecting the <code>DTMWSFilter</code> interface
- * to the <code>StripFilter</code> interface.
- *
- * @param translet A translet that also implements the StripFilter
- * interface.
- *
- * @see com.sun.org.apache.xml.internal.dtm.DTMWSFilter
- * @see com.sun.org.apache.xalan.internal.xsltc.StripFilter
- */
- public DOMWSFilter(AbstractTranslet translet) {
- m_translet = translet;
- m_mappings = new HashMap<>();
-
- if (translet instanceof StripFilter) {
- m_filter = (StripFilter) translet;
- }
- }
-
- /**
- * Test whether whitespace-only text nodes are visible in the logical
- * view of <code>DTM</code>. Normally, this function
- * will be called by the implementation of <code>DTM</code>;
- * it is not normally called directly from
- * user code.
- *
- * @param node int handle of the node.
- * @param dtm the DTM that owns this node
- * @return one of <code>NOTSTRIP</code>, <code>STRIP</code> or
- * <code>INHERIT</code>.
- */
- public short getShouldStripSpace(int node, DTM dtm) {
- if (m_filter != null && dtm instanceof DOM) {
- DOM dom = (DOM)dtm;
- int type = 0;
-
- if (dtm instanceof DOMEnhancedForDTM) {
- DOMEnhancedForDTM mappableDOM = (DOMEnhancedForDTM)dtm;
-
- short[] mapping;
- if (dtm == m_currentDTM) {
- mapping = m_currentMapping;
- }
- else {
- mapping = m_mappings.get(dtm);
- if (mapping == null) {
- mapping = mappableDOM.getMapping(
- m_translet.getNamesArray(),
- m_translet.getUrisArray(),
- m_translet.getTypesArray());
- m_mappings.put(dtm, mapping);
- m_currentDTM = dtm;
- m_currentMapping = mapping;
- }
- }
-
- int expType = mappableDOM.getExpandedTypeID(node);
-
- // %OPT% The mapping array does not have information about all the
- // exptypes. However it does contain enough information about all names
- // in the translet's namesArray. If the expType does not fall into the
- // range of the mapping array, it means that the expType is not for one
- // of the recognized names. In this case we can just set the type to -1.
- if (expType >= 0 && expType < mapping.length)
- type = mapping[expType];
- else
- type = -1;
-
- }
- else {
- return INHERIT;
- }
-
- if (m_filter.stripSpace(dom, node, type)) {
- return STRIP;
- } else {
- return NOTSTRIP;
- }
- } else {
- return NOTSTRIP;
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/DocumentCache.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/DocumentCache.java
deleted file mode 100644
index cb9124b..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/DocumentCache.java
+++ /dev/null
@@ -1,338 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DocumentCache.java,v 1.2.4.1 2005/09/06 06:15:22 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.dom;
-
-import com.sun.org.apache.xalan.internal.xsltc.DOM;
-import com.sun.org.apache.xalan.internal.xsltc.DOMCache;
-import com.sun.org.apache.xalan.internal.xsltc.DOMEnhancedForDTM;
-import com.sun.org.apache.xalan.internal.xsltc.Translet;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.BasisLibrary;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.Constants;
-import com.sun.org.apache.xml.internal.utils.SystemIDResolver;
-import java.io.File;
-import java.io.PrintWriter;
-import java.net.URL;
-import java.net.URLConnection;
-import java.net.URLDecoder;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.sax.SAXSource;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
-
-/**
- * @author Morten Jorgensen
- */
-public final class DocumentCache implements DOMCache {
-
- private int _size;
- private Map<String, CachedDocument> _references;
- private String[] _URIs;
- private int _count;
- private int _current;
- private SAXParser _parser;
- private XMLReader _reader;
- private XSLTCDTMManager _dtmManager;
-
- private static final int REFRESH_INTERVAL = 1000;
-
- /*
- * Inner class containing a DOMImpl object and DTD handler
- */
- public final class CachedDocument {
-
- // Statistics data
- private long _firstReferenced;
- private long _lastReferenced;
- private long _accessCount;
- private long _lastModified;
- private long _lastChecked;
- private long _buildTime;
-
- // DOM and DTD handler references
- private DOMEnhancedForDTM _dom = null;
-
- /**
- * Constructor - load document and initialise statistics
- */
- public CachedDocument(String uri) {
- // Initialise statistics variables
- final long stamp = System.currentTimeMillis();
- _firstReferenced = stamp;
- _lastReferenced = stamp;
- _accessCount = 0;
- loadDocument(uri);
-
- _buildTime = System.currentTimeMillis() - stamp;
- }
-
- /**
- * Loads the document and updates build-time (latency) statistics
- */
- public void loadDocument(String uri) {
-
- try {
- final long stamp = System.currentTimeMillis();
- _dom = (DOMEnhancedForDTM)_dtmManager.getDTM(
- new SAXSource(_reader, new InputSource(uri)),
- false, null, true, false);
- _dom.setDocumentURI(uri);
-
- // The build time can be used for statistics for a better
- // priority algorithm (currently round robin).
- final long thisTime = System.currentTimeMillis() - stamp;
- if (_buildTime > 0)
- _buildTime = (_buildTime + thisTime) >>> 1;
- else
- _buildTime = thisTime;
- }
- catch (Exception e) {
- _dom = null;
- }
- }
-
- public DOM getDocument() { return(_dom); }
-
- public long getFirstReferenced() { return(_firstReferenced); }
-
- public long getLastReferenced() { return(_lastReferenced); }
-
- public long getAccessCount() { return(_accessCount); }
-
- public void incAccessCount() { _accessCount++; }
-
- public long getLastModified() { return(_lastModified); }
-
- public void setLastModified(long t){ _lastModified = t; }
-
- public long getLatency() { return(_buildTime); }
-
- public long getLastChecked() { return(_lastChecked); }
-
- public void setLastChecked(long t) { _lastChecked = t; }
-
- public long getEstimatedSize() {
- if (_dom != null)
- return(_dom.getSize() << 5); // ???
- else
- return(0);
- }
-
- }
-
- /**
- * DocumentCache constructor
- */
- public DocumentCache(int size) throws SAXException {
- this(size, null);
- try {
- _dtmManager = XSLTCDTMManager.createNewDTMManagerInstance();
- } catch (Exception e) {
- throw new SAXException(e);
- }
- }
-
- /**
- * DocumentCache constructor
- */
- public DocumentCache(int size, XSLTCDTMManager dtmManager) throws SAXException {
- _dtmManager = dtmManager;
- _count = 0;
- _current = 0;
- _size = size;
- _references = new HashMap<>(_size+2);
- _URIs = new String[_size];
-
- try {
- // Create a SAX parser and get the XMLReader object it uses
- final SAXParserFactory factory = SAXParserFactory.newInstance();
- try {
- factory.setFeature(Constants.NAMESPACE_FEATURE,true);
- }
- catch (Exception e) {
- factory.setNamespaceAware(true);
- }
- _parser = factory.newSAXParser();
- _reader = _parser.getXMLReader();
- }
- catch (ParserConfigurationException e) {
- BasisLibrary.runTimeError(BasisLibrary.NAMESPACES_SUPPORT_ERR);
- }
- }
-
- /**
- * Returns the time-stamp for a document's last update
- */
- private final long getLastModified(String uri) {
- try {
- URL url = new URL(uri);
- URLConnection connection = url.openConnection();
- long timestamp = connection.getLastModified();
- // Check for a "file:" URI (courtesy of Brian Ewins)
- if (timestamp == 0){ // get 0 for local URI
- if ("file".equals(url.getProtocol())){
- File localfile = new File(URLDecoder.decode(url.getFile()));
- timestamp = localfile.lastModified();
- }
- }
- return(timestamp);
- }
- // Brutal handling of all exceptions
- catch (Exception e) {
- return(System.currentTimeMillis());
- }
- }
-
- /**
- *
- */
- private CachedDocument lookupDocument(String uri) {
- return(_references.get(uri));
- }
-
- /**
- *
- */
- private synchronized void insertDocument(String uri, CachedDocument doc) {
- if (_count < _size) {
- // Insert out URI in circular buffer
- _URIs[_count++] = uri;
- _current = 0;
- }
- else {
- // Remove oldest URI from reference map
- _references.remove(_URIs[_current]);
- // Insert our URI in circular buffer
- _URIs[_current] = uri;
- if (++_current >= _size) _current = 0;
- }
- _references.put(uri, doc);
- }
-
- /**
- *
- */
- private synchronized void replaceDocument(String uri, CachedDocument doc) {
- if (doc == null)
- insertDocument(uri, doc);
- else
- _references.put(uri, doc);
- }
-
- /**
- * Returns a document either by finding it in the cache or
- * downloading it and putting it in the cache.
- */
- @Override
- public DOM retrieveDocument(String baseURI, String href, Translet trs) {
- CachedDocument doc;
-
- String uri = href;
- if (baseURI != null && !baseURI.equals("")) {
- try {
- uri = SystemIDResolver.getAbsoluteURI(uri, baseURI);
- } catch (TransformerException te) {
- // ignore
- }
- }
-
- // Try to get the document from the cache first
- if ((doc = lookupDocument(uri)) == null) {
- doc = new CachedDocument(uri);
- if (doc == null) return null; // better error handling needed!!!
- doc.setLastModified(getLastModified(uri));
- insertDocument(uri, doc);
- }
- // If the document is in the cache we must check if it is still valid
- else {
- long now = System.currentTimeMillis();
- long chk = doc.getLastChecked();
- doc.setLastChecked(now);
- // Has the modification time for this file been checked lately?
- if (now > (chk + REFRESH_INTERVAL)) {
- doc.setLastChecked(now);
- long last = getLastModified(uri);
- // Reload document if it has been modified since last download
- if (last > doc.getLastModified()) {
- doc = new CachedDocument(uri);
- if (doc == null) return null;
- doc.setLastModified(getLastModified(uri));
- replaceDocument(uri, doc);
- }
- }
-
- }
-
- // Get the references to the actual DOM and DTD handler
- final DOM dom = doc.getDocument();
-
- // The dom reference may be null if the URL pointed to a
- // non-existing document
- if (dom == null) return null;
-
- doc.incAccessCount(); // For statistics
-
- final AbstractTranslet translet = (AbstractTranslet)trs;
-
- // Give the translet an early opportunity to extract any
- // information from the DOM object that it would like.
- translet.prepassDocument(dom);
-
- return(doc.getDocument());
- }
-
- /**
- * Outputs the cache statistics
- */
- public void getStatistics(PrintWriter out) {
- out.println("<h2>DOM cache statistics</h2><center><table border=\"2\">"+
- "<tr><td><b>Document URI</b></td>"+
- "<td><center><b>Build time</b></center></td>"+
- "<td><center><b>Access count</b></center></td>"+
- "<td><center><b>Last accessed</b></center></td>"+
- "<td><center><b>Last modified</b></center></td></tr>");
-
- for (int i=0; i<_count; i++) {
- CachedDocument doc = _references.get(_URIs[i]);
- out.print("<tr><td><a href=\""+_URIs[i]+"\">"+
- "<font size=-1>"+_URIs[i]+"</font></a></td>");
- out.print("<td><center>"+doc.getLatency()+"ms</center></td>");
- out.print("<td><center>"+doc.getAccessCount()+"</center></td>");
- out.print("<td><center>"+(new Date(doc.getLastReferenced()))+
- "</center></td>");
- out.print("<td><center>"+(new Date(doc.getLastModified()))+
- "</center></td>");
- out.println("</tr>");
- }
-
- out.println("</table></center>");
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/DupFilterIterator.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/DupFilterIterator.java
deleted file mode 100644
index 8ba00f4..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/DupFilterIterator.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DupFilterIterator.java,v 1.2.4.1 2005/09/06 06:16:11 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.dom;
-
-import com.sun.org.apache.xalan.internal.xsltc.runtime.BasisLibrary;
-import com.sun.org.apache.xalan.internal.xsltc.util.IntegerArray;
-import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
-import com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase;
-import com.sun.org.apache.xml.internal.dtm.ref.DTMDefaultBase;
-
-/**
- * Removes duplicates and sorts a source iterator. The nodes from the
- * source are collected in an array upon calling setStartNode(). This
- * array is later sorted and duplicates are ignored in next().
- * @author G. Todd Miller
- */
-public final class DupFilterIterator extends DTMAxisIteratorBase {
-
- /**
- * Reference to source iterator.
- */
- private DTMAxisIterator _source;
-
- /**
- * Array to cache all nodes from source.
- */
- private IntegerArray _nodes = new IntegerArray();
-
- /**
- * Index in _nodes array to current node.
- */
- private int _current = 0;
-
- /**
- * Cardinality of _nodes array.
- */
- private int _nodesSize = 0;
-
- /**
- * Last value returned by next().
- */
- private int _lastNext = END;
-
- /**
- * Temporary variable to store _lastNext.
- */
- private int _markedLastNext = END;
-
- public DupFilterIterator(DTMAxisIterator source) {
- _source = source;
-// System.out.println("DFI source = " + source + " this = " + this);
-
- // Cache contents of id() or key() index right away. Necessary for
- // union expressions containing multiple calls to the same index, and
- // correct as well since start-node is irrelevant for id()/key() exrp.
- if (source instanceof KeyIndex) {
- setStartNode(DTMDefaultBase.ROOTNODE);
- }
- }
-
- /**
- * Set the start node for this iterator
- * @param node The start node
- * @return A reference to this node iterator
- */
- public DTMAxisIterator setStartNode(int node) {
- if (_isRestartable) {
- // KeyIndex iterators are always relative to the root node, so there
- // is never any point in re-reading the iterator (and we SHOULD NOT).
- boolean sourceIsKeyIndex = _source instanceof KeyIndex;
-
- if (sourceIsKeyIndex
- && _startNode == DTMDefaultBase.ROOTNODE) {
- return this;
- }
-
- if (node != _startNode) {
- _source.setStartNode(_startNode = node);
-
- _nodes.clear();
- while ((node = _source.next()) != END) {
- _nodes.add(node);
- }
-
- // Nodes produced by KeyIndex are known to be in document order.
- // Take advantage of it.
- if (!sourceIsKeyIndex) {
- _nodes.sort();
- }
- _nodesSize = _nodes.cardinality();
- _current = 0;
- _lastNext = END;
- resetPosition();
- }
- }
- return this;
- }
-
- public int next() {
- while (_current < _nodesSize) {
- final int next = _nodes.at(_current++);
- if (next != _lastNext) {
- return returnNode(_lastNext = next);
- }
- }
- return END;
- }
-
- public DTMAxisIterator cloneIterator() {
- try {
- final DupFilterIterator clone =
- (DupFilterIterator) super.clone();
- clone._nodes = (IntegerArray) _nodes.clone();
- clone._source = _source.cloneIterator();
- clone._isRestartable = false;
- return clone.reset();
- }
- catch (CloneNotSupportedException e) {
- BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR,
- e.toString());
- return null;
- }
- }
-
- public void setRestartable(boolean isRestartable) {
- _isRestartable = isRestartable;
- _source.setRestartable(isRestartable);
- }
-
- public void setMark() {
- _markedNode = _current;
- _markedLastNext = _lastNext; // Bugzilla 25924
- }
-
- public void gotoMark() {
- _current = _markedNode;
- _lastNext = _markedLastNext; // Bugzilla 25924
- }
-
- public DTMAxisIterator reset() {
- _current = 0;
- _lastNext = END;
- return resetPosition();
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/EmptyFilter.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/EmptyFilter.java
deleted file mode 100644
index 57420ff..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/EmptyFilter.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: EmptyFilter.java,v 1.2.4.1 2005/09/06 06:17:05 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.dom;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-public final class EmptyFilter implements Filter {
- public boolean test(int node) {
- return true;
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/ExtendedSAX.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/ExtendedSAX.java
deleted file mode 100644
index 2eb927d..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/ExtendedSAX.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ExtendedSAX.java,v 1.2.4.1 2005/09/06 06:17:46 pvedula Exp $
- */
-package com.sun.org.apache.xalan.internal.xsltc.dom;
-
-import org.xml.sax.ContentHandler;
-import org.xml.sax.DTDHandler;
-import org.xml.sax.ext.DeclHandler;
-import org.xml.sax.ext.LexicalHandler;
-
-/**
- * @author Morten Jorgensen
- */
-public interface ExtendedSAX extends ContentHandler, LexicalHandler, DTDHandler,
- DeclHandler
-{
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/Filter.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/Filter.java
deleted file mode 100644
index 245ebff..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/Filter.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Filter.java,v 1.2.4.1 2005/09/06 06:18:58 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.dom;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-public interface Filter {
- public boolean test(int node);
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/FilterIterator.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/FilterIterator.java
deleted file mode 100644
index d27c759..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/FilterIterator.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FilterIterator.java,v 1.2.4.1 2005/09/06 06:21:10 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.dom;
-
-import com.sun.org.apache.xalan.internal.xsltc.runtime.BasisLibrary;
-import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
-import com.sun.org.apache.xml.internal.dtm.DTMFilter;
-import com.sun.org.apache.xml.internal.dtm.DTMIterator;
-import com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase;
-
-/**
- * Similar to a CurrentNodeListIterator except that the filter has a
- * simpler interface (only needs the node, no position, last, etc.)
- * It takes a source iterator and a Filter object and returns nodes
- * from the source after filtering them by calling filter.test(node).
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-public final class FilterIterator extends DTMAxisIteratorBase {
-
- /**
- * Reference to source iterator.
- */
- private DTMAxisIterator _source;
-
- /**
- * Reference to a filter object that to be applied to each node.
- */
- private final DTMFilter _filter;
-
- /**
- * A flag indicating if position is reversed.
- */
- private final boolean _isReverse;
-
- public FilterIterator(DTMAxisIterator source, DTMFilter filter) {
- _source = source;
-// System.out.println("FI souce = " + source + " this = " + this);
- _filter = filter;
- _isReverse = source.isReverse();
- }
-
- public boolean isReverse() {
- return _isReverse;
- }
-
-
- public void setRestartable(boolean isRestartable) {
- _isRestartable = isRestartable;
- _source.setRestartable(isRestartable);
- }
-
- public DTMAxisIterator cloneIterator() {
-
- try {
- final FilterIterator clone = (FilterIterator) super.clone();
- clone._source = _source.cloneIterator();
- clone._isRestartable = false;
- return clone.reset();
- }
- catch (CloneNotSupportedException e) {
- BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR,
- e.toString());
- return null;
- }
- }
-
- public DTMAxisIterator reset() {
- _source.reset();
- return resetPosition();
- }
-
- public int next() {
- int node;
- while ((node = _source.next()) != END) {
- if (_filter.acceptNode(node, DTMFilter.SHOW_ALL) == DTMIterator.FILTER_ACCEPT) {
- return returnNode(node);
- }
- }
- return END;
- }
-
- public DTMAxisIterator setStartNode(int node) {
- if (_isRestartable) {
- _source.setStartNode(_startNode = node);
- return resetPosition();
- }
- return this;
- }
-
- public void setMark() {
- _source.setMark();
- }
-
- public void gotoMark() {
- _source.gotoMark();
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/FilteredStepIterator.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/FilteredStepIterator.java
deleted file mode 100644
index 704ebb4..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/FilteredStepIterator.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FilteredStepIterator.java,v 1.2.4.1 2005/09/06 06:20:13 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.dom;
-
-import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
-
-/**
- * Extends a StepIterator by adding the ability to filter nodes. It
- * uses filters similar to those of a FilterIterator.
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- */
-public final class FilteredStepIterator extends StepIterator {
-
- private Filter _filter;
-
- public FilteredStepIterator(DTMAxisIterator source,
- DTMAxisIterator iterator,
- Filter filter) {
- super(source, iterator);
- _filter = filter;
- }
-
- public int next() {
- int node;
- while ((node = super.next()) != END) {
- if (_filter.test(node)) {
- return returnNode(node);
- }
- }
- return node;
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/ForwardPositionIterator.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/ForwardPositionIterator.java
deleted file mode 100644
index f902df9..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/ForwardPositionIterator.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ForwardPositionIterator.java,v 1.2.4.1 2005/09/06 06:22:05 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.dom;
-
-import com.sun.org.apache.xalan.internal.xsltc.runtime.BasisLibrary;
-import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
-import com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase;
-
-/**
- * This iterator is a wrapper that always returns the position of
- * a node in document order. It is needed for the case where
- * a call to position() occurs in the context of an XSLT element
- * such as xsl:for-each, xsl:apply-templates, etc.
- *
- * The getPosition() methods in DTMAxisIterators defined
- * in DTMDefaultBaseIterators always return the position
- * in document order, which is backwards for XPath in the
- * case of the ancestor, ancestor-or-self, previous and
- * previous-sibling.
- *
- * XSLTC implements position() with the
- * BasisLibrary.positionF() method, and uses the
- * DTMAxisIterator.isReverse() method to determine
- * whether the result of getPosition() should be
- * interpreted as being equal to position().
- * But when the expression appears in apply-templates of
- * for-each, the position() function operates in document
- * order.
- *
- * The only effect of the ForwardPositionIterator is to force
- * the result of isReverse() to false, so that
- * BasisLibrary.positionF() calculates position() in a way
- * that's consistent with the context in which the
- * iterator is being used."
- *
- * (Apparently the correction of isReverse() occurs
- * implicitly, by inheritance. This class also appears
- * to maintain its own position counter, which seems
- * redundant.)
- *
- * @deprecated This class exists only for backwards compatibility with old
- * translets. New code should not reference it.
- */
-public final class ForwardPositionIterator extends DTMAxisIteratorBase {
-
- private DTMAxisIterator _source;
-
- public ForwardPositionIterator(DTMAxisIterator source) {
- _source = source;
- }
-
- public DTMAxisIterator cloneIterator() {
- try {
- final ForwardPositionIterator clone =
- (ForwardPositionIterator) super.clone();
- clone._source = _source.cloneIterator();
- clone._isRestartable = false;
- return clone.reset();
- }
- catch (CloneNotSupportedException e) {
- BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR,
- e.toString());
- return null;
- }
- }
-
- public int next() {
- return returnNode(_source.next());
- }
-
- public DTMAxisIterator setStartNode(int node) {
- _source.setStartNode(node);
- return this;
- }
-
- public DTMAxisIterator reset() {
- _source.reset();
- return resetPosition();
- }
-
- public void setMark() {
- _source.setMark();
- }
-
- public void gotoMark() {
- _source.gotoMark();
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/KeyIndex.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/KeyIndex.java
deleted file mode 100644
index 5eb17d7..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/KeyIndex.java
+++ /dev/null
@@ -1,900 +0,0 @@
-/*
- * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: KeyIndex.java,v 1.6 2006/06/19 19:49:02 spericas Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.dom;
-
-import com.sun.org.apache.xalan.internal.xsltc.DOM;
-import com.sun.org.apache.xalan.internal.xsltc.DOMEnhancedForDTM;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.BasisLibrary;
-import com.sun.org.apache.xalan.internal.xsltc.util.IntegerArray;
-import com.sun.org.apache.xml.internal.dtm.Axis;
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
-import com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.StringTokenizer;
-
-/**
- * Stores mappings of key values or IDs to DTM nodes.
- * <em>Use of an instance of this class as a {@link DTMAxisIterator} is
- * <b>deprecated.</b></em>
- * @author Morten Jorgensen
- * @author Santiago Pericas-Geertsen
- */
-public class KeyIndex extends DTMAxisIteratorBase {
-
- /**
- * A mapping between values and nodesets for the current document. Used
- * only while building keys.
- */
- private Map<String, IntegerArray> _index;
-
- /**
- * The document node currently being processed. Used only while building
- * keys.
- */
- private int _currentDocumentNode = DTM.NULL;
-
- /**
- * A mapping from a document node to the mapping between values and nodesets
- */
- private Map<Integer, Map> _rootToIndexMap = new HashMap<>();
-
- /**
- * The node set associated to the current value passed
- * to lookupKey();
- */
- private IntegerArray _nodes = null;
-
- /**
- * The XSLTC DOM object if this KeyIndex is being used to implement the
- * id() function.
- */
- private DOM _dom;
-
- private DOMEnhancedForDTM _enhancedDOM;
-
- /**
- * Store position after call to setMark()
- */
- private int _markedPosition = 0;
-
- public KeyIndex(int dummy) {
- }
-
- public void setRestartable(boolean flag) {
- }
-
- /**
- * Adds a node to the node list for a given value. Nodes will
- * always be added in document order.
- */
- public void add(String value, int node, int rootNode) {
- if (_currentDocumentNode != rootNode) {
- _currentDocumentNode = rootNode;
- _index = new HashMap<>();
- _rootToIndexMap.put(rootNode, _index);
- }
-
- IntegerArray nodes = _index.get(value);
-
- if (nodes == null) {
- nodes = new IntegerArray();
- _index.put(value, nodes);
- nodes.add(node);
-
- // Because nodes are added in document order,
- // duplicates can be eliminated easily at this stage.
- } else if (node != nodes.at(nodes.cardinality() - 1)) {
- nodes.add(node);
- }
- }
-
- /**
- * Merge the current value's nodeset set by lookupKey() with _nodes.
- * @deprecated
- */
- public void merge(KeyIndex other) {
- if (other == null) return;
-
- if (other._nodes != null) {
- if (_nodes == null) {
- _nodes = (IntegerArray)other._nodes.clone();
- }
- else {
- _nodes.merge(other._nodes);
- }
- }
- }
-
- /**
- * This method must be called by the code generated by the id() function
- * prior to returning the node iterator. The lookup code for key() and
- * id() differ in the way the lookup value can be whitespace separated
- * list of tokens for the id() function, but a single string for the
- * key() function.
- * @deprecated
- */
- public void lookupId(Object value) {
- // Clear _nodes array
- _nodes = null;
-
- final StringTokenizer values = new StringTokenizer((String) value,
- " \n\t");
- while (values.hasMoreElements()) {
- final String token = (String) values.nextElement();
- IntegerArray nodes = _index.get(token);
-
- if (nodes == null && _enhancedDOM != null
- && _enhancedDOM.hasDOMSource()) {
- nodes = getDOMNodeById(token);
- }
-
- if (nodes == null) continue;
-
- if (_nodes == null) {
- nodes = (IntegerArray)nodes.clone();
- _nodes = nodes;
- }
- else {
- _nodes.merge(nodes);
- }
- }
- }
-
- /**
- * Return an IntegerArray for the DOM Node which has the given id.
- *
- * @param id The id
- * @return A IntegerArray representing the Node whose id is the given value.
- */
- public IntegerArray getDOMNodeById(String id) {
- IntegerArray nodes = null;
-
- if (_enhancedDOM != null) {
- int ident = _enhancedDOM.getElementById(id);
-
- if (ident != DTM.NULL) {
- Integer root = new Integer(_enhancedDOM.getDocument());
- Map<String, IntegerArray> index = _rootToIndexMap.get(root);
-
- if (index == null) {
- index = new HashMap<>();
- _rootToIndexMap.put(root, index);
- } else {
- nodes = index.get(id);
- }
-
- if (nodes == null) {
- nodes = new IntegerArray();
- index.put(id, nodes);
- }
-
- nodes.add(_enhancedDOM.getNodeHandle(ident));
- }
- }
-
- return nodes;
- }
-
- /**
- * <p>This method must be called by the code generated by the key() function
- * prior to returning the node iterator.</p>
- * <p><em>Use of an instance of this class as a {@link DTMAxisIterator} is
- * <b>deprecated.</b></em></p>
- * @deprecated
- */
- public void lookupKey(Object value) {
- IntegerArray nodes = _index.get(value);
- _nodes = (nodes != null) ? (IntegerArray) nodes.clone() : null;
- _position = 0;
- }
-
- /**
- * <p>Callers should not call next() after it returns END.</p>
- * <p><em>Use of an instance of this class as a {@link DTMAxisIterator} is
- * <b>deprecated.</b></em></p>
- * @deprecated
- */
- public int next() {
- if (_nodes == null) return DTMAxisIterator.END;
-
- return (_position < _nodes.cardinality()) ?
- _dom.getNodeHandle(_nodes.at(_position++)) : DTMAxisIterator.END;
- }
-
- /**
- * Given a context node and the argument to the XPath <code>id</code>
- * function, checks whether the context node is in the set of nodes that
- * results from that reference to the <code>id</code> function. This is
- * used in the implementation of <code>id</code> patterns.
- *
- * @param node The context node
- * @param value The argument to the <code>id</code> function
- * @return <code>1</code> if the context node is in the set of nodes
- * returned by the reference to the <code>id</code> function;
- * <code>0</code>, otherwise
- */
- public int containsID(int node, Object value) {
- final String string = (String)value;
- int rootHandle = _dom.getAxisIterator(Axis.ROOT)
- .setStartNode(node).next();
-
- // Get the mapping table for the document containing the context node
- Map<String, IntegerArray> index =
- _rootToIndexMap.get(rootHandle);
-
- // Split argument to id function into XML whitespace separated tokens
- final StringTokenizer values = new StringTokenizer(string, " \n\t");
-
- while (values.hasMoreElements()) {
- final String token = (String) values.nextElement();
- IntegerArray nodes = null;
-
- if (index != null) {
- nodes = index.get(token);
- }
-
- // If input was from W3C DOM, use DOM's getElementById to do
- // the look-up.
- if (nodes == null && _enhancedDOM != null
- && _enhancedDOM.hasDOMSource()) {
- nodes = getDOMNodeById(token);
- }
-
- // Did we find the context node in the set of nodes?
- if (nodes != null && nodes.indexOf(node) >= 0) {
- return 1;
- }
- }
-
- // Didn't find the context node in the set of nodes returned by id
- return 0;
- }
-
- /**
- * <p>Given a context node and the second argument to the XSLT
- * <code>key</code> function, checks whether the context node is in the
- * set of nodes that results from that reference to the <code>key</code>
- * function. This is used in the implementation of key patterns.</p>
- * <p>This particular {@link KeyIndex} object is the result evaluating the
- * first argument to the <code>key</code> function, so it's not taken into
- * any further account.</p>
- *
- * @param node The context node
- * @param value The second argument to the <code>key</code> function
- * @return <code>1</code> if and only if the context node is in the set of
- * nodes returned by the reference to the <code>key</code> function;
- * <code>0</code>, otherwise
- */
- public int containsKey(int node, Object value) {
- int rootHandle = _dom.getAxisIterator(Axis.ROOT)
- .setStartNode(node).next();
-
- // Get the mapping table for the document containing the context node
- Map<String,IntegerArray> index =
- _rootToIndexMap.get(new Integer(rootHandle));
-
- // Check whether the context node is present in the set of nodes
- // returned by the key function
- if (index != null) {
- final IntegerArray nodes = index.get(value);
- return (nodes != null && nodes.indexOf(node) >= 0) ? 1 : 0;
- }
-
- // The particular key name identifies no nodes in this document
- return 0;
- }
-
- /**
- * <p>Resets the iterator to the last start node.</p>
- * <p><em>Use of an instance of this class as a {@link DTMAxisIterator} is
- * <b>deprecated.</b></em></p>
- * @deprecated
- */
- public DTMAxisIterator reset() {
- _position = 0;
- return this;
- }
-
- /**
- * <p>Returns the number of elements in this iterator.</p>
- * <p><em>Use of an instance of this class as a {@link DTMAxisIterator} is
- * <b>deprecated.</b></em></p>
- * @deprecated
- */
- public int getLast() {
- return (_nodes == null) ? 0 : _nodes.cardinality();
- }
-
- /**
- * <p>Returns the position of the current node in the set.</p>
- * <p><em>Use of an instance of this class as a {@link DTMAxisIterator} is
- * <b>deprecated.</b></em></p>
- * @deprecated
- */
- public int getPosition() {
- return _position;
- }
-
- /**
- * <p>Remembers the current node for the next call to gotoMark().</p>
- * <p><em>Use of an instance of this class as a {@link DTMAxisIterator} is
- * <b>deprecated.</b></em></p>
- * @deprecated
- */
- public void setMark() {
- _markedPosition = _position;
- }
-
- /**
- * <p>Restores the current node remembered by setMark().</p>
- * <p><em>Use of an instance of this class as a {@link DTMAxisIterator} is
- * <b>deprecated.</b></em></p>
- * @deprecated
- */
- public void gotoMark() {
- _position = _markedPosition;
- }
-
- /**
- * <p>Set start to END should 'close' the iterator,
- * i.e. subsequent call to next() should return END.</p>
- * <p><em>Use of an instance of this class as a {@link DTMAxisIterator} is
- * <b>deprecated.</b></em></p>
- * @deprecated
- */
- public DTMAxisIterator setStartNode(int start) {
- if (start == DTMAxisIterator.END) {
- _nodes = null;
- }
- else if (_nodes != null) {
- _position = 0;
- }
- return (DTMAxisIterator) this;
- }
-
- /**
- * <p>Get start to END should 'close' the iterator,
- * i.e. subsequent call to next() should return END.</p>
- * <p><em>Use of an instance of this class as a {@link DTMAxisIterator} is
- * <b>deprecated.</b></em></p>
- * @deprecated
- */
- public int getStartNode() {
- return 0;
- }
-
- /**
- * <p>True if this iterator has a reversed axis.</p>
- * <p><em>Use of an instance of this class as a {@link DTMAxisIterator} is
- * <b>deprecated.</b></em></p>
- * @deprecated
- */
- public boolean isReverse() {
- return(false);
- }
-
- /**
- * <p>Returns a deep copy of this iterator.</p>
- * <p><em>Use of an instance of this class as a {@link DTMAxisIterator} is
- * <b>deprecated.</b></em></p>
- * @deprecated
- */
- public DTMAxisIterator cloneIterator() {
- KeyIndex other = new KeyIndex(0);
- other._index = _index;
- other._rootToIndexMap = _rootToIndexMap;
- other._nodes = _nodes;
- other._position = _position;
- return (DTMAxisIterator) other;
- }
-
- public void setDom(DOM dom, int node) {
- _dom = dom;
-
- // If a MultiDOM, ensure _enhancedDOM is correctly set
- // so that getElementById() works in lookupNodes below
- if (dom instanceof MultiDOM) {
- dom = ((MultiDOM) dom).getDTM(node);
- }
-
- if (dom instanceof DOMEnhancedForDTM) {
- _enhancedDOM = (DOMEnhancedForDTM)dom;
- }
- else if (dom instanceof DOMAdapter) {
- DOM idom = ((DOMAdapter)dom).getDOMImpl();
- if (idom instanceof DOMEnhancedForDTM) {
- _enhancedDOM = (DOMEnhancedForDTM)idom;
- }
- }
- }
-
- /**
- * Create a {@link KeyIndexIterator} that iterates over the nodes that
- * result from a reference to the XSLT <code>key</code> function or
- * XPath <code>id</code> function.
- *
- * @param keyValue A string or iterator representing the key values or id
- * references
- * @param isKeyCall A <code>boolean</code> indicating whether the iterator
- * is being created for a reference <code>key</code> or
- * <code>id</code>
- */
- public KeyIndexIterator getKeyIndexIterator(Object keyValue,
- boolean isKeyCall) {
- if (keyValue instanceof DTMAxisIterator) {
- return getKeyIndexIterator((DTMAxisIterator) keyValue, isKeyCall);
- } else {
- return getKeyIndexIterator(BasisLibrary.stringF(keyValue, _dom),
- isKeyCall);
- }
- }
-
- /**
- * Create a {@link KeyIndexIterator} that iterates over the nodes that
- * result from a reference to the XSLT <code>key</code> function or
- * XPath <code>id</code> function.
- *
- * @param keyValue A string representing the key values or id
- * references
- * @param isKeyCall A <code>boolean</code> indicating whether the iterator
- * is being created for a reference <code>key</code> or
- * <code>id</code>
- */
- public KeyIndexIterator getKeyIndexIterator(String keyValue,
- boolean isKeyCall) {
- return new KeyIndexIterator(keyValue, isKeyCall);
- }
-
- /**
- * Create a {@link KeyIndexIterator} that iterates over the nodes that
- * result from a reference to the XSLT <code>key</code> function or
- * XPath <code>id</code> function.
- *
- * @param keyValue An iterator representing the key values or id
- * references
- * @param isKeyCall A <code>boolean</code> indicating whether the iterator
- * is being created for a reference <code>key</code> or
- * <code>id</code>
- */
- public KeyIndexIterator getKeyIndexIterator(DTMAxisIterator keyValue,
- boolean isKeyCall) {
- return new KeyIndexIterator(keyValue, isKeyCall);
- }
-
- /**
- * Used to represent an empty node set.
- */
- final private static IntegerArray EMPTY_NODES = new IntegerArray(0);
-
-
- /**
- * An iterator representing the result of a reference to either the
- * XSLT <code>key</code> function or the XPath <code>id</code> function.
- */
- public class KeyIndexIterator extends MultiValuedNodeHeapIterator {
-
- /**
- * <p>A reference to the <code>key</code> function that only has one
- * key value or to the <code>id</code> function that has only one string
- * argument can be optimized to ignore the multi-valued heap. This
- * field will be <code>null</code> otherwise.
- */
- private IntegerArray _nodes;
-
- /**
- * <p>This field contains the iterator representing a node set key value
- * argument to the <code>key</code> function or a node set argument
- * to the <code>id</code> function.</p>
- *
- * <p>Exactly one of this field and {@link #_keyValue} must be
- * <code>null</code>.</p>
- */
- private DTMAxisIterator _keyValueIterator;
-
- /**
- * <p>This field contains the iterator representing a non-node-set key
- * value argument to the <code>key</code> function or a non-node-set
- * argument to the <code>id</code> function.</p>
- *
- * <p>Exactly one of this field and {@link #_keyValueIterator} must be
- * <code>null</code>.</p>
- */
- private String _keyValue;
-
- /**
- * Indicates whether this object represents the result of a reference
- * to the <code>key</code> function (<code>true</code>) or the
- * <code>id</code> function (<code>false</code>).
- */
- private boolean _isKeyIterator;
-
- /**
- * Represents the DTM nodes retrieved for one key value or one string
- * argument to <code>id</code> for use as one heap node in a
- * {@link MultiValuedNodeHeapIterator}.
- */
- protected class KeyIndexHeapNode
- extends MultiValuedNodeHeapIterator.HeapNode
- {
- /**
- * {@link IntegerArray} of DTM nodes retrieved for one key value.
- * Must contain no duplicates and be stored in document order.
- */
- private IntegerArray _nodes;
-
- /**
- * Position in {@link #_nodes} array of next node to return from
- * this heap node.
- */
- private int _position = 0;
-
- /**
- * Marked position. Used by {@link #setMark()} and
- * {@link #gotoMark()}
- */
- private int _markPosition = -1;
-
- /**
- * Create a heap node representing DTM nodes retrieved for one
- * key value in a reference to the <code>key</code> function
- * or string argument to the <code>id</code> function.
- */
- KeyIndexHeapNode(IntegerArray nodes) {
- _nodes = nodes;
- }
-
- /**
- * Advance to the next node represented by this {@link HeapNode}
- *
- * @return the next DTM node.
- */
- public int step() {
- if (_position < _nodes.cardinality()) {
- _node = _nodes.at(_position);
- _position++;
- } else {
- _node = DTMAxisIterator.END;
- }
-
- return _node;
- }
-
- /**
- * Creates a deep copy of this {@link HeapNode}. The clone is not
- * reset from the current position of the original.
- *
- * @return the cloned heap node
- */
- public HeapNode cloneHeapNode() {
- KeyIndexHeapNode clone =
- (KeyIndexHeapNode) super.cloneHeapNode();
-
- clone._nodes = _nodes;
- clone._position = _position;
- clone._markPosition = _markPosition;
-
- return clone;
- }
-
- /**
- * Remembers the current node for the next call to
- * {@link #gotoMark()}.
- */
- public void setMark() {
- _markPosition = _position;
- }
-
- /**
- * Restores the current node remembered by {@link #setMark()}.
- */
- public void gotoMark() {
- _position = _markPosition;
- }
-
- /**
- * Performs a comparison of the two heap nodes
- *
- * @param heapNode the heap node against which to compare
- * @return <code>true</code> if and only if the current node for
- * this heap node is before the current node of the
- * argument heap node in document order.
- */
- public boolean isLessThan(HeapNode heapNode) {
- return _node < heapNode._node;
- }
-
- /**
- * <p>Sets context with respect to which this heap node is
- * evaluated.</p>
- * <p>This has no real effect on this kind of heap node. Instead,
- * the {@link KeyIndexIterator#setStartNode(int)} method should
- * create new instances of this class to represent the effect of
- * changing the context.</p>
- */
- public HeapNode setStartNode(int node) {
- return this;
- }
-
- /**
- * Reset the heap node back to its beginning.
- */
- public HeapNode reset() {
- _position = 0;
- return this;
- }
- }
-
- /**
- * Constructor used when the argument to <code>key</code> or
- * <code>id</code> is not a node set.
- *
- * @param keyValue the argument to <code>key</code> or <code>id</code>
- * cast to a <code>String</code>
- * @param isKeyIterator indicates whether the constructed iterator
- * represents a reference to <code>key</code> or
- * <code>id</code>.
- */
- KeyIndexIterator(String keyValue, boolean isKeyIterator) {
- _isKeyIterator = isKeyIterator;
- _keyValue = keyValue;
- }
-
- /**
- * Constructor used when the argument to <code>key</code> or
- * <code>id</code> is a node set.
- *
- * @param keyValues the argument to <code>key</code> or <code>id</code>
- * @param isKeyIterator indicates whether the constructed iterator
- * represents a reference to <code>key</code> or
- * <code>id</code>.
- */
- KeyIndexIterator(DTMAxisIterator keyValues, boolean isKeyIterator) {
- _keyValueIterator = keyValues;
- _isKeyIterator = isKeyIterator;
- }
-
- /**
- * Retrieve nodes for a particular key value or a particular id
- * argument value.
- *
- * @param root The root node of the document containing the context node
- * @param keyValue The key value of id string argument value
- * @return an {@link IntegerArray} of the resulting nodes
- */
- protected IntegerArray lookupNodes(int root, String keyValue) {
- IntegerArray result = null;
-
- // Get mapping from key values/IDs to DTM nodes for this document
- Map<String, IntegerArray> index = _rootToIndexMap.get(root);
-
- if (!_isKeyIterator) {
- // For id function, tokenize argument as whitespace separated
- // list of values and look up nodes identified by each ID.
- final StringTokenizer values =
- new StringTokenizer(keyValue, " \n\t");
-
- while (values.hasMoreElements()) {
- final String token = (String) values.nextElement();
- IntegerArray nodes = null;
-
- // Does the ID map to any node in the document?
- if (index != null) {
- nodes = index.get(token);
- }
-
- // If input was from W3C DOM, use DOM's getElementById to do
- // the look-up.
- if (nodes == null && _enhancedDOM != null
- && _enhancedDOM.hasDOMSource()) {
- nodes = getDOMNodeById(token);
- }
-
- // If we found any nodes, merge them into the cumulative
- // result
- if (nodes != null) {
- if (result == null) {
- result = (IntegerArray)nodes.clone();
- } else {
- result.merge(nodes);
- }
- }
- }
- } else if (index != null) {
- // For key function, map key value to nodes
- result = index.get(keyValue);
- }
-
- return result;
- }
-
- /**
- * Set context node for the iterator. This will cause the iterator
- * to reset itself, reevaluate arguments to the function, look up
- * nodes in the input and reinitialize its internal heap.
- *
- * @param node the context node
- * @return A {@link DTMAxisIterator} set to the start of the iteration.
- */
- public DTMAxisIterator setStartNode(int node) {
- _startNode = node;
-
- // If the arugment to the function is a node set, set the
- // context node on it.
- if (_keyValueIterator != null) {
- _keyValueIterator = _keyValueIterator.setStartNode(node);
- }
-
- init();
-
- return super.setStartNode(node);
- }
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next() {
- int nodeHandle;
-
- // If at most one key value or at most one string argument to id
- // resulted in nodes being returned, use the IntegerArray
- // stored at _nodes directly. This relies on the fact that the
- // IntegerArray never includes duplicate nodes and is always stored
- // in document order.
- if (_nodes != null) {
- if (_position < _nodes.cardinality()) {
- nodeHandle = returnNode(_nodes.at(_position));
- } else {
- nodeHandle = DTMAxisIterator.END;
- }
- } else {
- nodeHandle = super.next();
- }
-
- return nodeHandle;
- }
-
- /**
- * Resets the iterator to the last start node.
- *
- * @return A DTMAxisIterator, which may or may not be the same as this
- * iterator.
- */
- public DTMAxisIterator reset() {
- if (_nodes == null) {
- init();
- } else {
- super.reset();
- }
-
- return resetPosition();
- }
-
- /**
- * Evaluate the reference to the <code>key</code> or <code>id</code>
- * function with the context specified by {@link #setStartNode(int)}
- * and set up this iterator to iterate over the DTM nodes that are
- * to be returned.
- */
- protected void init() {
- super.init();
- _position = 0;
-
- // All nodes retrieved are in the same document
- int rootHandle = _dom.getAxisIterator(Axis.ROOT)
- .setStartNode(_startNode).next();
-
- // Is the argument not a node set?
- if (_keyValueIterator == null) {
- // Look up nodes returned for the single string argument
- _nodes = lookupNodes(rootHandle, _keyValue);
-
- if (_nodes == null) {
- _nodes = EMPTY_NODES;
- }
- } else {
- DTMAxisIterator keyValues = _keyValueIterator.reset();
- int retrievedKeyValueIdx = 0;
- boolean foundNodes = false;
-
- _nodes = null;
-
- // For each node in the node set argument, get the string value
- // and look up the nodes returned by key or id for that string
- // value. If at most one string value has nodes associated,
- // the nodes will be stored in _nodes; otherwise, the nodes
- // will be placed in a heap.
- for (int keyValueNode = keyValues.next();
- keyValueNode != DTMAxisIterator.END;
- keyValueNode = keyValues.next()) {
-
- String keyValue = BasisLibrary.stringF(keyValueNode, _dom);
-
- IntegerArray nodes = lookupNodes(rootHandle, keyValue);
-
- if (nodes != null) {
- if (!foundNodes) {
- _nodes = nodes;
- foundNodes = true;
- } else {
- if (_nodes != null) {
- addHeapNode(new KeyIndexHeapNode(_nodes));
- _nodes = null;
- }
- addHeapNode(new KeyIndexHeapNode(nodes));
- }
- }
- }
-
- if (!foundNodes) {
- _nodes = EMPTY_NODES;
- }
- }
- }
-
- /**
- * Returns the number of nodes in this iterator.
- *
- * @return the number of nodes
- */
- public int getLast() {
- // If nodes are stored in _nodes, take advantage of the fact that
- // there are no duplicates. Otherwise, fall back to the base heap
- // implementaiton and hope it does a good job with this.
- return (_nodes != null) ? _nodes.cardinality() : super.getLast();
- }
-
- /**
- * Return the node at the given position.
- *
- * @param position The position
- * @return The node at the given position.
- */
- public int getNodeByPosition(int position) {
- int node = DTMAxisIterator.END;
-
- // If nodes are stored in _nodes, take advantage of the fact that
- // there are no duplicates and they are stored in document order.
- // Otherwise, fall back to the base heap implementation to do a
- // good job with this.
- if (_nodes != null) {
- if (position > 0) {
- if (position <= _nodes.cardinality()) {
- _position = position;
- node = _nodes.at(position-1);
- } else {
- _position = _nodes.cardinality();
- }
- }
- } else {
- node = super.getNodeByPosition(position);
- }
-
- return node;
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/LoadDocument.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/LoadDocument.java
deleted file mode 100644
index f3e2879..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/LoadDocument.java
+++ /dev/null
@@ -1,305 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: LoadDocument.java,v 1.2.4.1 2005/09/06 07:14:12 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.dom;
-
-import com.sun.org.apache.xalan.internal.XalanConstants;
-import java.io.FileNotFoundException;
-
-import javax.xml.transform.stream.StreamSource;
-
-import com.sun.org.apache.xalan.internal.xsltc.DOM;
-import com.sun.org.apache.xalan.internal.xsltc.DOMCache;
-import com.sun.org.apache.xalan.internal.xsltc.DOMEnhancedForDTM;
-import com.sun.org.apache.xalan.internal.xsltc.TransletException;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet;
-import com.sun.org.apache.xalan.internal.xsltc.trax.TemplatesImpl;
-import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
-import com.sun.org.apache.xml.internal.dtm.DTMManager;
-import com.sun.org.apache.xml.internal.dtm.ref.DTMDefaultBase;
-import com.sun.org.apache.xml.internal.dtm.ref.EmptyIterator;
-import com.sun.org.apache.xml.internal.utils.SystemIDResolver;
-
-import org.xml.sax.InputSource;
-import org.xml.sax.XMLReader;
-
-/**
- * @author Morten Jorgensen
- */
-public final class LoadDocument {
-
- private static final String NAMESPACE_FEATURE =
- "http://xml.org/sax/features/namespaces";
-
- /**
- * Interprets the arguments passed from the document() function (see
- * com/sun/org/apache/xalan/internal/xsltc/compiler/DocumentCall.java) and returns an
- * iterator containing the requested nodes. Builds a union-iterator if
- * several documents are requested.
- * 2 arguments arg1 and arg2. document(Obj, node-set) call
- */
- public static DTMAxisIterator documentF(Object arg1, DTMAxisIterator arg2,
- String xslURI, AbstractTranslet translet, DOM dom)
- throws TransletException {
- String baseURI = null;
- final int arg2FirstNode = arg2.next();
- if (arg2FirstNode == DTMAxisIterator.END) {
- // the second argument node-set is empty
- return EmptyIterator.getInstance();
- } else {
- //System.err.println("arg2FirstNode name: "
- // + dom.getNodeName(arg2FirstNode )+"["
- // +Integer.toHexString(arg2FirstNode )+"]");
- baseURI = dom.getDocumentURI(arg2FirstNode);
- if (!SystemIDResolver.isAbsoluteURI(baseURI))
- baseURI = SystemIDResolver.getAbsoluteURIFromRelative(baseURI);
- }
-
- try {
- if (arg1 instanceof String) {
- if (((String)arg1).length() == 0) {
- return document(xslURI, "", translet, dom);
- } else {
- return document((String)arg1, baseURI, translet, dom);
- }
- } else if (arg1 instanceof DTMAxisIterator) {
- return document((DTMAxisIterator)arg1, baseURI, translet, dom);
- } else {
- final String err = "document("+arg1.toString()+")";
- throw new IllegalArgumentException(err);
- }
- } catch (Exception e) {
- throw new TransletException(e);
- }
- }
- /**
- * Interprets the arguments passed from the document() function (see
- * com/sun/org/apache/xalan/internal/xsltc/compiler/DocumentCall.java) and returns an
- * iterator containing the requested nodes. Builds a union-iterator if
- * several documents are requested.
- * 1 arguments arg. document(Obj) call
- */
- public static DTMAxisIterator documentF(Object arg, String xslURI,
- AbstractTranslet translet, DOM dom)
- throws TransletException {
- try {
- if (arg instanceof String) {
- if (xslURI == null )
- xslURI = "";
-
- String baseURI = xslURI;
- if (!SystemIDResolver.isAbsoluteURI(xslURI))
- baseURI = SystemIDResolver.getAbsoluteURIFromRelative(xslURI);
-
- String href = (String)arg;
- if (href.length() == 0) {
- href = "";
- // %OPT% Optimization to cache the stylesheet DOM.
- // The stylesheet DOM is built once and cached
- // in the Templates object.
- TemplatesImpl templates = (TemplatesImpl)translet.getTemplates();
- DOM sdom = null;
- if (templates != null) {
- sdom = templates.getStylesheetDOM();
- }
-
- // If the cached dom exists, we need to migrate it
- // to the new DTMManager and create a DTMAxisIterator
- // for the document.
- if (sdom != null) {
- return document(sdom, translet, dom);
- }
- else {
- return document(href, baseURI, translet, dom, true);
- }
- }
- else {
- return document(href, baseURI, translet, dom);
- }
- } else if (arg instanceof DTMAxisIterator) {
- return document((DTMAxisIterator)arg, null, translet, dom);
- } else {
- final String err = "document("+arg.toString()+")";
- throw new IllegalArgumentException(err);
- }
- } catch (Exception e) {
- throw new TransletException(e);
- }
- }
-
- private static DTMAxisIterator document(String uri, String base,
- AbstractTranslet translet, DOM dom)
- throws Exception
- {
- return document(uri, base, translet, dom, false);
- }
-
- private static DTMAxisIterator document(String uri, String base,
- AbstractTranslet translet, DOM dom,
- boolean cacheDOM)
- throws Exception
- {
- try {
- final String originalUri = uri;
- MultiDOM multiplexer = (MultiDOM)dom;
-
- // Prepend URI base to URI (from context)
- if (base != null && !base.equals("")) {
- uri = SystemIDResolver.getAbsoluteURI(uri, base);
- }
-
- // Return an empty iterator if the URI is clearly invalid
- // (to prevent some unncessary MalformedURL exceptions).
- if (uri == null || uri.equals("")) {
- return(EmptyIterator.getInstance());
- }
-
- // Check if this DOM has already been added to the multiplexer
- int mask = multiplexer.getDocumentMask(uri);
- if (mask != -1) {
- DOM newDom = ((DOMAdapter)multiplexer.getDOMAdapter(uri))
- .getDOMImpl();
- if (newDom instanceof DOMEnhancedForDTM) {
- return new SingletonIterator(((DOMEnhancedForDTM)newDom)
- .getDocument(),
- true);
- }
- }
-
- // Check if we can get the DOM from a DOMCache
- DOMCache cache = translet.getDOMCache();
- DOM newdom;
-
- mask = multiplexer.nextMask(); // peek
-
- if (cache != null) {
- newdom = cache.retrieveDocument(base, originalUri, translet);
- if (newdom == null) {
- final Exception e = new FileNotFoundException(originalUri);
- throw new TransletException(e);
- }
- } else {
- String accessError = SecuritySupport.checkAccess(uri, translet.getAllowedProtocols(), XalanConstants.ACCESS_EXTERNAL_ALL);
- if (accessError != null) {
- ErrorMsg msg = new ErrorMsg(ErrorMsg.ACCESSING_XSLT_TARGET_ERR,
- SecuritySupport.sanitizePath(uri), accessError);
- throw new Exception(msg.toString());
- }
-
- // Parse the input document and construct DOM object
- // Trust the DTMManager to pick the right parser and
- // set up the DOM correctly.
- XSLTCDTMManager dtmManager = (XSLTCDTMManager)multiplexer
- .getDTMManager();
- DOMEnhancedForDTM enhancedDOM =
- (DOMEnhancedForDTM) dtmManager.getDTM(new StreamSource(uri),
- false, null, true, false,
- translet.hasIdCall(), cacheDOM);
- newdom = enhancedDOM;
-
- // Cache the stylesheet DOM in the Templates object
- if (cacheDOM) {
- TemplatesImpl templates = (TemplatesImpl)translet.getTemplates();
- if (templates != null) {
- templates.setStylesheetDOM(enhancedDOM);
- }
- }
-
- translet.prepassDocument(enhancedDOM);
- enhancedDOM.setDocumentURI(uri);
- }
-
- // Wrap the DOM object in a DOM adapter and add to multiplexer
- final DOMAdapter domAdapter = translet.makeDOMAdapter(newdom);
- multiplexer.addDOMAdapter(domAdapter);
-
- // Create index for any key elements
- translet.buildKeys(domAdapter, null, null, newdom.getDocument());
-
- // Return a singleton iterator containing the root node
- return new SingletonIterator(newdom.getDocument(), true);
- } catch (Exception e) {
- throw e;
- }
- }
-
-
- private static DTMAxisIterator document(DTMAxisIterator arg1,
- String baseURI,
- AbstractTranslet translet, DOM dom)
- throws Exception
- {
- UnionIterator union = new UnionIterator(dom);
- int node = DTM.NULL;
-
- while ((node = arg1.next()) != DTM.NULL) {
- String uri = dom.getStringValueX(node);
- //document(node-set) if true; document(node-set,node-set) if false
- if (baseURI == null) {
- baseURI = dom.getDocumentURI(node);
- if (!SystemIDResolver.isAbsoluteURI(baseURI))
- baseURI = SystemIDResolver.getAbsoluteURIFromRelative(baseURI);
- }
- union.addIterator(document(uri, baseURI, translet, dom));
- }
- return(union);
- }
-
- /**
- * Create a DTMAxisIterator for the newdom. This is currently only
- * used to create an iterator for the cached stylesheet DOM.
- *
- * @param newdom the cached stylesheet DOM
- * @param translet the translet
- * @param the main dom (should be a MultiDOM)
- * @return a DTMAxisIterator from the document root
- */
- private static DTMAxisIterator document(DOM newdom,
- AbstractTranslet translet,
- DOM dom)
- throws Exception
- {
- DTMManager dtmManager = ((MultiDOM)dom).getDTMManager();
- // Need to migrate the cached DTM to the new DTMManager
- if (dtmManager != null && newdom instanceof DTM) {
- ((DTM)newdom).migrateTo(dtmManager);
- }
-
- translet.prepassDocument(newdom);
-
- // Wrap the DOM object in a DOM adapter and add to multiplexer
- final DOMAdapter domAdapter = translet.makeDOMAdapter(newdom);
- ((MultiDOM)dom).addDOMAdapter(domAdapter);
-
- // Create index for any key elements
- translet.buildKeys(domAdapter, null, null,
- newdom.getDocument());
-
- // Return a singleton iterator containing the root node
- return new SingletonIterator(newdom.getDocument(), true);
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/MatchingIterator.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/MatchingIterator.java
deleted file mode 100644
index d0bc39c..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/MatchingIterator.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: MatchingIterator.java,v 1.2.4.1 2005/09/06 09:22:07 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.dom;
-
-import com.sun.org.apache.xalan.internal.xsltc.runtime.BasisLibrary;
-import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
-import com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase;
-
-/**
- * This is a special kind of iterator that takes a source iterator and a
- * node N. If initialized with a node M (the parent of N) it computes the
- * position of N amongst the children of M. This position can be obtained
- * by calling getPosition().
- * It is an iterator even though next() will never be called. It is used to
- * match patterns with a single predicate like:
- *
- * BOOK[position() = last()]
- *
- * In this example, the source iterator will return elements of type BOOK,
- * a call to position() will return the position of N. Notice that because
- * of the way the pattern matching is implemented, N will always be a node
- * in the source since (i) it is a BOOK or the test sequence would not be
- * considered and (ii) the source iterator is initialized with M which is
- * the parent of N. Also, and still in this example, a call to last() will
- * return the number of elements in the source (i.e. the number of BOOKs).
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-public final class MatchingIterator extends DTMAxisIteratorBase {
-
- /**
- * A reference to a source iterator.
- */
- private DTMAxisIterator _source;
-
- /**
- * The node to match.
- */
- private final int _match;
-
- public MatchingIterator(int match, DTMAxisIterator source) {
- _source = source;
- _match = match;
- }
-
-
- public void setRestartable(boolean isRestartable) {
- _isRestartable = isRestartable;
- _source.setRestartable(isRestartable);
- }
-
- public DTMAxisIterator cloneIterator() {
-
- try {
- final MatchingIterator clone = (MatchingIterator) super.clone();
- clone._source = _source.cloneIterator();
- clone._isRestartable = false;
- return clone.reset();
- }
- catch (CloneNotSupportedException e) {
- BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR,
- e.toString());
- return null;
- }
- }
-
- public DTMAxisIterator setStartNode(int node) {
- if (_isRestartable) {
- // iterator is not a clone
- _source.setStartNode(node);
-
- // Calculate the position of the node in the set
- _position = 1;
- while ((node = _source.next()) != END && node != _match) {
- _position++;
- }
- }
- return this;
- }
-
- public DTMAxisIterator reset() {
- _source.reset();
- return resetPosition();
- }
-
- public int next() {
- return _source.next();
- }
-
- public int getLast() {
- if (_last == -1) {
- _last = _source.getLast();
- }
- return _last;
- }
-
- public int getPosition() {
- return _position;
- }
-
- public void setMark() {
- _source.setMark();
- }
-
- public void gotoMark() {
- _source.gotoMark();
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/MultiDOM.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/MultiDOM.java
deleted file mode 100644
index 92eca91..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/MultiDOM.java
+++ /dev/null
@@ -1,720 +0,0 @@
-/*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.dom;
-
-import com.sun.org.apache.xalan.internal.xsltc.DOM;
-import com.sun.org.apache.xalan.internal.xsltc.StripFilter;
-import com.sun.org.apache.xalan.internal.xsltc.TransletException;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.BasisLibrary;
-import com.sun.org.apache.xml.internal.dtm.Axis;
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
-import com.sun.org.apache.xml.internal.dtm.DTMManager;
-import com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase;
-import com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIterNodeList;
-import com.sun.org.apache.xml.internal.dtm.ref.DTMDefaultBase;
-import com.sun.org.apache.xml.internal.serializer.SerializationHandler;
-import com.sun.org.apache.xml.internal.utils.SuballocatedIntVector;
-import java.util.HashMap;
-import java.util.Map;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * @author Jacek Ambroziak
- * @author Morten Jorgensen
- * @author Erwin Bolwidt <ejb@klomp.org>
- */
-public final class MultiDOM implements DOM {
-
- private static final int NO_TYPE = DOM.FIRST_TYPE - 2;
- private static final int INITIAL_SIZE = 4;
-
- private DOM[] _adapters;
- private DOMAdapter _main;
- private DTMManager _dtmManager;
- private int _free;
- private int _size;
-
- private Map<String, Integer> _documents = new HashMap<>();
-
- private final class AxisIterator extends DTMAxisIteratorBase {
- // constitutive data
- private final int _axis;
- private final int _type;
- // implementation mechanism
- private DTMAxisIterator _source;
- private int _dtmId = -1;
-
- public AxisIterator(final int axis, final int type) {
- _axis = axis;
- _type = type;
- }
-
- public int next() {
- if (_source == null) {
- return(END);
- }
- return _source.next();
- }
-
-
- public void setRestartable(boolean flag) {
- if (_source != null) {
- _source.setRestartable(flag);
- }
- }
-
- public DTMAxisIterator setStartNode(final int node) {
- if (node == DTM.NULL) {
- return this;
- }
-
- int dom = node >>> DTMManager.IDENT_DTM_NODE_BITS;
-
- // Get a new source first time and when mask changes
- if (_source == null || _dtmId != dom) {
- if (_type == NO_TYPE) {
- _source = _adapters[dom].getAxisIterator(_axis);
- } else if (_axis == Axis.CHILD) {
- _source = _adapters[dom].getTypedChildren(_type);
- } else {
- _source = _adapters[dom].getTypedAxisIterator(_axis, _type);
- }
- }
-
- _dtmId = dom;
- _source.setStartNode(node);
- return this;
- }
-
- public DTMAxisIterator reset() {
- if (_source != null) {
- _source.reset();
- }
- return this;
- }
-
- public int getLast() {
- if (_source != null) {
- return _source.getLast();
- }
- else {
- return END;
- }
- }
-
- public int getPosition() {
- if (_source != null) {
- return _source.getPosition();
- }
- else {
- return END;
- }
- }
-
- public boolean isReverse() {
- return Axis.isReverse(_axis);
- }
-
- public void setMark() {
- if (_source != null) {
- _source.setMark();
- }
- }
-
- public void gotoMark() {
- if (_source != null) {
- _source.gotoMark();
- }
- }
-
- public DTMAxisIterator cloneIterator() {
- final AxisIterator clone = new AxisIterator(_axis, _type);
- if (_source != null) {
- clone._source = _source.cloneIterator();
- }
- clone._dtmId = _dtmId;
- return clone;
- }
- } // end of AxisIterator
-
-
- /**************************************************************
- * This is a specialised iterator for predicates comparing node or
- * attribute values to variable or parameter values.
- */
- private final class NodeValueIterator extends DTMAxisIteratorBase {
-
- private DTMAxisIterator _source;
- private String _value;
- private boolean _op;
- private final boolean _isReverse;
- private int _returnType = RETURN_PARENT;
-
- public NodeValueIterator(DTMAxisIterator source, int returnType,
- String value, boolean op) {
- _source = source;
- _returnType = returnType;
- _value = value;
- _op = op;
- _isReverse = source.isReverse();
- }
-
- public boolean isReverse() {
- return _isReverse;
- }
-
- public DTMAxisIterator cloneIterator() {
- try {
- NodeValueIterator clone = (NodeValueIterator)super.clone();
- clone._source = _source.cloneIterator();
- clone.setRestartable(false);
- return clone.reset();
- }
- catch (CloneNotSupportedException e) {
- BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR,
- e.toString());
- return null;
- }
- }
-
-
- public void setRestartable(boolean isRestartable) {
- _isRestartable = isRestartable;
- _source.setRestartable(isRestartable);
- }
-
- public DTMAxisIterator reset() {
- _source.reset();
- return resetPosition();
- }
-
- public int next() {
-
- int node;
- while ((node = _source.next()) != END) {
- String val = getStringValueX(node);
- if (_value.equals(val) == _op) {
- if (_returnType == RETURN_CURRENT)
- return returnNode(node);
- else
- return returnNode(getParent(node));
- }
- }
- return END;
- }
-
- public DTMAxisIterator setStartNode(int node) {
- if (_isRestartable) {
- _source.setStartNode(_startNode = node);
- return resetPosition();
- }
- return this;
- }
-
- public void setMark() {
- _source.setMark();
- }
-
- public void gotoMark() {
- _source.gotoMark();
- }
- }
-
- public MultiDOM(DOM main) {
- _size = INITIAL_SIZE;
- _free = 1;
- _adapters = new DOM[INITIAL_SIZE];
- DOMAdapter adapter = (DOMAdapter)main;
- _adapters[0] = adapter;
- _main = adapter;
- DOM dom = adapter.getDOMImpl();
- if (dom instanceof DTMDefaultBase) {
- _dtmManager = ((DTMDefaultBase)dom).getManager();
- }
-
- // %HZ% %REVISIT% Is this the right thing to do here? In the old
- // %HZ% %REVISIT% version, the main document did not get added through
- // %HZ% %REVISIT% a call to addDOMAdapter, which meant it couldn't be
- // %HZ% %REVISIT% found by a call to getDocumentMask. The problem is
- // %HZ% %REVISIT% TransformerHandler is typically constructed with a
- // %HZ% %REVISIT% system ID equal to the stylesheet's URI; with SAX
- // %HZ% %REVISIT% input, it ends up giving that URI to the document.
- // %HZ% %REVISIT% Then, any references to document('') are resolved
- // %HZ% %REVISIT% using the stylesheet's URI.
- // %HZ% %REVISIT% MultiDOM.getDocumentMask is called to verify that
- // %HZ% %REVISIT% a document associated with that URI has not been
- // %HZ% %REVISIT% encountered, and that method ends up returning the
- // %HZ% %REVISIT% mask of the main document, when what we really what
- // %HZ% %REVISIT% is to read the stylesheet itself!
- addDOMAdapter(adapter, false);
- }
-
- public int nextMask() {
- return _free;
- }
-
- public void setupMapping(String[] names, String[] uris, int[] types, String[] namespaces) {
- // This method only has a function in DOM adapters
- }
-
- public int addDOMAdapter(DOMAdapter adapter) {
- return addDOMAdapter(adapter, true);
- }
-
- private int addDOMAdapter(DOMAdapter adapter, boolean indexByURI) {
- // Add the DOM adapter to the array of DOMs
- DOM dom = adapter.getDOMImpl();
-
- int domNo = 1;
- int dtmSize = 1;
- SuballocatedIntVector dtmIds = null;
- if (dom instanceof DTMDefaultBase) {
- DTMDefaultBase dtmdb = (DTMDefaultBase)dom;
- dtmIds = dtmdb.getDTMIDs();
- dtmSize = dtmIds.size();
- domNo = dtmIds.elementAt(dtmSize-1) >>> DTMManager.IDENT_DTM_NODE_BITS;
- }
- else if (dom instanceof SimpleResultTreeImpl) {
- SimpleResultTreeImpl simpleRTF = (SimpleResultTreeImpl)dom;
- domNo = simpleRTF.getDocument() >>> DTMManager.IDENT_DTM_NODE_BITS;
- }
-
- if (domNo >= _size) {
- int oldSize = _size;
- do {
- _size *= 2;
- } while (_size <= domNo);
-
- final DOMAdapter[] newArray = new DOMAdapter[_size];
- System.arraycopy(_adapters, 0, newArray, 0, oldSize);
- _adapters = newArray;
- }
-
- _free = domNo + 1;
-
- if (dtmSize == 1) {
- _adapters[domNo] = adapter;
- }
- else if (dtmIds != null) {
- int domPos = 0;
- for (int i = dtmSize - 1; i >= 0; i--) {
- domPos = dtmIds.elementAt(i) >>> DTMManager.IDENT_DTM_NODE_BITS;
- _adapters[domPos] = adapter;
- }
- domNo = domPos;
- }
-
- // Store reference to document (URI) in the Map
- if (indexByURI) {
- String uri = adapter.getDocumentURI(0);
- _documents.put(uri, domNo);
- }
-
- // If the dom is an AdaptiveResultTreeImpl, we need to create a
- // DOMAdapter around its nested dom object (if it is non-null) and
- // add the DOMAdapter to the list.
- if (dom instanceof AdaptiveResultTreeImpl) {
- AdaptiveResultTreeImpl adaptiveRTF = (AdaptiveResultTreeImpl)dom;
- DOM nestedDom = adaptiveRTF.getNestedDOM();
- if (nestedDom != null) {
- DOMAdapter newAdapter = new DOMAdapter(nestedDom,
- adapter.getNamesArray(),
- adapter.getUrisArray(),
- adapter.getTypesArray(),
- adapter.getNamespaceArray());
- addDOMAdapter(newAdapter);
- }
- }
-
- return domNo;
- }
-
- public int getDocumentMask(String uri) {
- Integer domIdx = _documents.get(uri);
- if (domIdx == null) {
- return(-1);
- } else {
- return domIdx.intValue();
- }
- }
-
- public DOM getDOMAdapter(String uri) {
- Integer domIdx = _documents.get(uri);
- if (domIdx == null) {
- return(null);
- } else {
- return(_adapters[domIdx.intValue()]);
- }
- }
-
- public int getDocument()
- {
- return _main.getDocument();
- }
-
- public DTMManager getDTMManager() {
- return _dtmManager;
- }
-
- /**
- * Returns singleton iterator containing the document root
- */
- public DTMAxisIterator getIterator() {
- // main source document @ 0
- return _main.getIterator();
- }
-
- public String getStringValue() {
- return _main.getStringValue();
- }
-
- public DTMAxisIterator getChildren(final int node) {
- return _adapters[getDTMId(node)].getChildren(node);
- }
-
- public DTMAxisIterator getTypedChildren(final int type) {
- return new AxisIterator(Axis.CHILD, type);
- }
-
- public DTMAxisIterator getAxisIterator(final int axis) {
- return new AxisIterator(axis, NO_TYPE);
- }
-
- public DTMAxisIterator getTypedAxisIterator(final int axis, final int type)
- {
- return new AxisIterator(axis, type);
- }
-
- public DTMAxisIterator getNthDescendant(int node, int n,
- boolean includeself)
- {
- return _adapters[getDTMId(node)].getNthDescendant(node, n, includeself);
- }
-
- public DTMAxisIterator getNodeValueIterator(DTMAxisIterator iterator,
- int type, String value,
- boolean op)
- {
- return(new NodeValueIterator(iterator, type, value, op));
- }
-
- public DTMAxisIterator getNamespaceAxisIterator(final int axis,
- final int ns)
- {
- DTMAxisIterator iterator = _main.getNamespaceAxisIterator(axis, ns);
- return(iterator);
- }
-
- public DTMAxisIterator orderNodes(DTMAxisIterator source, int node) {
- return _adapters[getDTMId(node)].orderNodes(source, node);
- }
-
- public int getExpandedTypeID(final int node) {
- if (node != DTM.NULL) {
- return _adapters[node >>> DTMManager.IDENT_DTM_NODE_BITS].getExpandedTypeID(node);
- }
- else {
- return DTM.NULL;
- }
- }
-
- public int getNamespaceType(final int node) {
- return _adapters[getDTMId(node)].getNamespaceType(node);
- }
-
- public int getNSType(int node)
- {
- return _adapters[getDTMId(node)].getNSType(node);
- }
-
- public int getParent(final int node) {
- if (node == DTM.NULL) {
- return DTM.NULL;
- }
- return _adapters[node >>> DTMManager.IDENT_DTM_NODE_BITS].getParent(node);
- }
-
- public int getAttributeNode(final int type, final int el) {
- if (el == DTM.NULL) {
- return DTM.NULL;
- }
- return _adapters[el >>> DTMManager.IDENT_DTM_NODE_BITS].getAttributeNode(type, el);
- }
-
- public String getNodeName(final int node) {
- if (node == DTM.NULL) {
- return "";
- }
- return _adapters[node >>> DTMManager.IDENT_DTM_NODE_BITS].getNodeName(node);
- }
-
- public String getNodeNameX(final int node) {
- if (node == DTM.NULL) {
- return "";
- }
- return _adapters[node >>> DTMManager.IDENT_DTM_NODE_BITS].getNodeNameX(node);
- }
-
- public String getNamespaceName(final int node) {
- if (node == DTM.NULL) {
- return "";
- }
- return _adapters[node >>> DTMManager.IDENT_DTM_NODE_BITS].getNamespaceName(node);
- }
-
- public String getStringValueX(final int node) {
- if (node == DTM.NULL) {
- return "";
- }
- return _adapters[node >>> DTMManager.IDENT_DTM_NODE_BITS].getStringValueX(node);
- }
-
- public void copy(final int node, SerializationHandler handler)
- throws TransletException
- {
- if (node != DTM.NULL) {
- _adapters[node >>> DTMManager.IDENT_DTM_NODE_BITS].copy(node, handler);
- }
- }
-
- public void copy(DTMAxisIterator nodes, SerializationHandler handler)
- throws TransletException
- {
- int node;
- while ((node = nodes.next()) != DTM.NULL) {
- _adapters[node >>> DTMManager.IDENT_DTM_NODE_BITS].copy(node, handler);
- }
- }
-
-
- public String shallowCopy(final int node, SerializationHandler handler)
- throws TransletException
- {
- if (node == DTM.NULL) {
- return "";
- }
- return _adapters[node >>> DTMManager.IDENT_DTM_NODE_BITS].shallowCopy(node, handler);
- }
-
- public boolean lessThan(final int node1, final int node2) {
- if (node1 == DTM.NULL) {
- return true;
- }
- if (node2 == DTM.NULL) {
- return false;
- }
- final int dom1 = getDTMId(node1);
- final int dom2 = getDTMId(node2);
- return dom1 == dom2 ? _adapters[dom1].lessThan(node1, node2)
- : dom1 < dom2;
- }
-
- public void characters(final int textNode, SerializationHandler handler)
- throws TransletException
- {
- if (textNode != DTM.NULL) {
- _adapters[textNode >>> DTMManager.IDENT_DTM_NODE_BITS].characters(textNode, handler);
- }
- }
-
- public void setFilter(StripFilter filter) {
- for (int dom=0; dom<_free; dom++) {
- if (_adapters[dom] != null) {
- _adapters[dom].setFilter(filter);
- }
- }
- }
-
- public Node makeNode(int index) {
- if (index == DTM.NULL) {
- return null;
- }
- return _adapters[getDTMId(index)].makeNode(index);
- }
-
- public Node makeNode(DTMAxisIterator iter) {
- // TODO: gather nodes from all DOMs ?
- return _main.makeNode(iter);
- }
-
- public NodeList makeNodeList(int index) {
- if (index == DTM.NULL) {
- return null;
- }
- return _adapters[getDTMId(index)].makeNodeList(index);
- }
-
- public NodeList makeNodeList(DTMAxisIterator iter) {
- int index = iter.next();
- if (index == DTM.NULL) {
- return new DTMAxisIterNodeList(null, null);
- }
- iter.reset();
- return _adapters[getDTMId(index)].makeNodeList(iter);
- }
-
- public String getLanguage(int node) {
- return _adapters[getDTMId(node)].getLanguage(node);
- }
-
- public int getSize() {
- int size = 0;
- for (int i=0; i<_size; i++) {
- size += _adapters[i].getSize();
- }
- return(size);
- }
-
- public String getDocumentURI(int node) {
- if (node == DTM.NULL) {
- node = DOM.NULL;
- }
- return _adapters[node >>> DTMManager.IDENT_DTM_NODE_BITS].getDocumentURI(0);
- }
-
- public boolean isElement(final int node) {
- if (node == DTM.NULL) {
- return false;
- }
- return(_adapters[node >>> DTMManager.IDENT_DTM_NODE_BITS].isElement(node));
- }
-
- public boolean isAttribute(final int node) {
- if (node == DTM.NULL) {
- return false;
- }
- return(_adapters[node >>> DTMManager.IDENT_DTM_NODE_BITS].isAttribute(node));
- }
-
- public int getDTMId(int nodeHandle)
- {
- if (nodeHandle == DTM.NULL)
- return 0;
-
- int id = nodeHandle >>> DTMManager.IDENT_DTM_NODE_BITS;
- while (id >= 2 && _adapters[id] == _adapters[id-1]) {
- id--;
- }
- return id;
- }
-
- public DOM getDTM(int nodeHandle) {
- return _adapters[getDTMId(nodeHandle)];
- }
-
- public int getNodeIdent(int nodeHandle)
- {
- return _adapters[nodeHandle >>> DTMManager.IDENT_DTM_NODE_BITS].getNodeIdent(nodeHandle);
- }
-
- public int getNodeHandle(int nodeId)
- {
- return _main.getNodeHandle(nodeId);
- }
-
- public DOM getResultTreeFrag(int initSize, int rtfType)
- {
- return _main.getResultTreeFrag(initSize, rtfType);
- }
-
- public DOM getResultTreeFrag(int initSize, int rtfType, boolean addToManager)
- {
- return _main.getResultTreeFrag(initSize, rtfType, addToManager);
- }
-
- public DOM getMain()
- {
- return _main;
- }
-
- /**
- * Returns a DOMBuilder class wrapped in a SAX adapter.
- */
- public SerializationHandler getOutputDomBuilder()
- {
- return _main.getOutputDomBuilder();
- }
-
- public String lookupNamespace(int node, String prefix)
- throws TransletException
- {
- return _main.lookupNamespace(node, prefix);
- }
-
- // %HZ% Does this method make any sense here???
- public String getUnparsedEntityURI(String entity) {
- return _main.getUnparsedEntityURI(entity);
- }
-
- // %HZ% Does this method make any sense here???
- public Map<String, Integer> getElementsWithIDs() {
- return _main.getElementsWithIDs();
- }
-
- public void release() {
- _main.release();
- }
-
- private boolean isMatchingAdapterEntry(DOM entry, DOMAdapter adapter) {
- DOM dom = adapter.getDOMImpl();
-
- return (entry == adapter) || (
- /*
- * Method addDOMAdapter overwrites for AdaptiveResultTreeImpl
- * objects the usual entry with an adapter to the nested
- * DOM, so we must check this here. See last 'if' statement
- * of addDOMAdapter.
- */
- (dom instanceof AdaptiveResultTreeImpl) &&
- (entry instanceof DOMAdapter) &&
- (((AdaptiveResultTreeImpl)dom).getNestedDOM() == ((DOMAdapter)entry).getDOMImpl())
- );
- }
-
- public void removeDOMAdapter(DOMAdapter adapter) {
- _documents.remove(adapter.getDocumentURI(0));
- DOM dom = adapter.getDOMImpl();
-
- if (dom instanceof DTMDefaultBase) {
- SuballocatedIntVector ids = ((DTMDefaultBase) dom).getDTMIDs();
- int idsSize = ids.size();
- for (int i = 0; i < idsSize; i++) {
- _adapters[ids.elementAt(i) >>> DTMManager.IDENT_DTM_NODE_BITS] = null;
- }
- } else {
- int id = dom.getDocument() >>> DTMManager.IDENT_DTM_NODE_BITS;
- if ((id > 0) && (id < _adapters.length) && isMatchingAdapterEntry(_adapters[id], adapter)) {
- _adapters[id] = null;
- } else {
- boolean found = false;
- for (int i = 0; i < _adapters.length; i++) {
- if (isMatchingAdapterEntry(_adapters[id], adapter)) {
- _adapters[i] = null;
- found = true;
- break;
- }
- }
- }
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/MultiValuedNodeHeapIterator.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/MultiValuedNodeHeapIterator.java
deleted file mode 100644
index efc2251..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/MultiValuedNodeHeapIterator.java
+++ /dev/null
@@ -1,296 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: UnionIterator.java 337874 2004-02-16 23:06:53Z minchau $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.dom;
-
-import com.sun.org.apache.xalan.internal.xsltc.DOM;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.BasisLibrary;
-import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
-import com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase;
-
-/**
- * <p><code>MultiValuedNodeHeapIterator</code> takes a set of multi-valued
- * heap nodes and produces a merged NodeSet in document order with duplicates
- * removed.</p>
- * <p>Each multi-valued heap node (which might be a
- * {@link org.apache.xml.dtm.DTMAxisIterator}, but that's not necessary)
- * generates DTM node handles in document order. The class
- * maintains the multi-valued heap nodes in a heap, not surprisingly, sorted by
- * the next DTM node handle available form the heap node.</p>
- * <p>After a DTM node is pulled from the heap node that's at the top of the
- * heap, the heap node is advanced to the next DTM node handle it makes
- * available, and the heap nature of the heap is restored to ensure the next
- * DTM node handle pulled is next in document order overall.
- *
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-public abstract class MultiValuedNodeHeapIterator extends DTMAxisIteratorBase {
- /** wrapper for NodeIterators to support iterator
- comparison on the value of their next() method
- */
-
- /**
- * An abstract representation of a set of nodes that will be retrieved in
- * document order.
- */
- public abstract class HeapNode implements Cloneable {
- protected int _node, _markedNode;
- protected boolean _isStartSet = false;
-
- /**
- * Advance to the next node represented by this {@link HeapNode}
- *
- * @return the next DTM node.
- */
- public abstract int step();
-
-
- /**
- * Creates a deep copy of this {@link HeapNode}. The clone is not
- * reset from the current position of the original.
- *
- * @return the cloned heap node
- */
- public HeapNode cloneHeapNode() {
- HeapNode clone;
-
- try {
- clone = (HeapNode) super.clone();
- } catch (CloneNotSupportedException e) {
- BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR,
- e.toString());
- return null;
- }
-
- clone._node = _node;
- clone._markedNode = _node;
-
- return clone;
- }
-
- /**
- * Remembers the current node for the next call to {@link #gotoMark()}.
- */
- public void setMark() {
- _markedNode = _node;
- }
-
- /**
- * Restores the current node remembered by {@link #setMark()}.
- */
- public void gotoMark() {
- _node = _markedNode;
- }
-
- /**
- * Performs a comparison of the two heap nodes
- *
- * @param heapNode the heap node against which to compare
- * @return <code>true</code> if and only if the current node for this
- * heap node is before the current node of the argument heap
- * node in document order.
- */
- public abstract boolean isLessThan(HeapNode heapNode);
-
- /**
- * Sets context with respect to which this heap node is evaluated.
- *
- * @param node The new context node
- * @return a {@link HeapNode} which may or may not be the same as
- * this <code>HeapNode</code>.
- */
- public abstract HeapNode setStartNode(int node);
-
- /**
- * Reset the heap node back to its beginning.
- *
- * @return a {@link HeapNode} which may or may not be the same as
- * this <code>HeapNode</code>.
- */
- public abstract HeapNode reset();
- } // end of HeapNode
-
- private static final int InitSize = 8;
-
- private int _heapSize = 0;
- private int _size = InitSize;
- private HeapNode[] _heap = new HeapNode[InitSize];
- private int _free = 0;
-
- // Last node returned by this MultiValuedNodeHeapIterator to the caller of
- // next; used to prune duplicates
- private int _returnedLast;
-
- // cached returned last for use in gotoMark
- private int _cachedReturnedLast = END;
-
- // cached heap size for use in gotoMark
- private int _cachedHeapSize;
-
-
- public DTMAxisIterator cloneIterator() {
- _isRestartable = false;
- final HeapNode[] heapCopy = new HeapNode[_heap.length];
- try {
- MultiValuedNodeHeapIterator clone =
- (MultiValuedNodeHeapIterator)super.clone();
-
- for (int i = 0; i < _free; i++) {
- heapCopy[i] = _heap[i].cloneHeapNode();
- }
- clone.setRestartable(false);
- clone._heap = heapCopy;
- return clone.reset();
- }
- catch (CloneNotSupportedException e) {
- BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR,
- e.toString());
- return null;
- }
- }
-
- protected void addHeapNode(HeapNode node) {
- if (_free == _size) {
- HeapNode[] newArray = new HeapNode[_size *= 2];
- System.arraycopy(_heap, 0, newArray, 0, _free);
- _heap = newArray;
- }
- _heapSize++;
- _heap[_free++] = node;
- }
-
- public int next() {
- while (_heapSize > 0) {
- final int smallest = _heap[0]._node;
- if (smallest == END) { // iterator _heap[0] is done
- if (_heapSize > 1) {
- // Swap first and last (iterator must be restartable)
- final HeapNode temp = _heap[0];
- _heap[0] = _heap[--_heapSize];
- _heap[_heapSize] = temp;
- }
- else {
- return END;
- }
- }
- else if (smallest == _returnedLast) { // duplicate
- _heap[0].step(); // value consumed
- }
- else {
- _heap[0].step(); // value consumed
- heapify(0);
- return returnNode(_returnedLast = smallest);
- }
- // fallthrough if not returned above
- heapify(0);
- }
- return END;
- }
-
- public DTMAxisIterator setStartNode(int node) {
- if (_isRestartable) {
- _startNode = node;
- for (int i = 0; i < _free; i++) {
- if(!_heap[i]._isStartSet){
- _heap[i].setStartNode(node);
- _heap[i].step(); // to get the first node
- _heap[i]._isStartSet = true;
- }
- }
- // build heap
- for (int i = (_heapSize = _free)/2; i >= 0; i--) {
- heapify(i);
- }
- _returnedLast = END;
- return resetPosition();
- }
- return this;
- }
-
- protected void init() {
- for (int i =0; i < _free; i++) {
- _heap[i] = null;
- }
-
- _heapSize = 0;
- _free = 0;
- }
-
- /* Build a heap in document order. put the smallest node on the top.
- * "smallest node" means the node before other nodes in document order
- */
- private void heapify(int i) {
- for (int r, l, smallest;;) {
- r = (i + 1) << 1; l = r - 1;
- smallest = l < _heapSize
- && _heap[l].isLessThan(_heap[i]) ? l : i;
- if (r < _heapSize && _heap[r].isLessThan(_heap[smallest])) {
- smallest = r;
- }
- if (smallest != i) {
- final HeapNode temp = _heap[smallest];
- _heap[smallest] = _heap[i];
- _heap[i] = temp;
- i = smallest;
- } else {
- break;
- }
- }
- }
-
- public void setMark() {
- for (int i = 0; i < _free; i++) {
- _heap[i].setMark();
- }
- _cachedReturnedLast = _returnedLast;
- _cachedHeapSize = _heapSize;
- }
-
- public void gotoMark() {
- for (int i = 0; i < _free; i++) {
- _heap[i].gotoMark();
- }
- // rebuild heap after call last() function. fix for bug 20913
- for (int i = (_heapSize = _cachedHeapSize)/2; i >= 0; i--) {
- heapify(i);
- }
- _returnedLast = _cachedReturnedLast;
- }
-
- public DTMAxisIterator reset() {
- for (int i = 0; i < _free; i++) {
- _heap[i].reset();
- _heap[i].step();
- }
-
- // build heap
- for (int i = (_heapSize = _free)/2; i >= 0; i--) {
- heapify(i);
- }
-
- _returnedLast = END;
- return resetPosition();
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/MultipleNodeCounter.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/MultipleNodeCounter.java
deleted file mode 100644
index 44ff62c..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/MultipleNodeCounter.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: MultipleNodeCounter.java,v 1.2.4.1 2005/09/12 11:49:56 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.dom;
-
-import com.sun.org.apache.xalan.internal.xsltc.DOM;
-import com.sun.org.apache.xalan.internal.xsltc.Translet;
-import com.sun.org.apache.xalan.internal.xsltc.util.IntegerArray;
-import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
-import com.sun.org.apache.xml.internal.dtm.Axis;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-public abstract class MultipleNodeCounter extends NodeCounter {
- private DTMAxisIterator _precSiblings = null;
-
- public MultipleNodeCounter(Translet translet,
- DOM document, DTMAxisIterator iterator) {
- super(translet, document, iterator);
- }
-
- public MultipleNodeCounter(Translet translet,
- DOM document,
- DTMAxisIterator iterator,
- boolean hasFrom) {
- super(translet, document, iterator, hasFrom);
- }
-
- public NodeCounter setStartNode(int node) {
- _node = node;
- _nodeType = _document.getExpandedTypeID(node);
- _precSiblings = _document.getAxisIterator(Axis.PRECEDINGSIBLING);
- return this;
- }
-
- public String getCounter() {
- if (_value != Integer.MIN_VALUE) {
- //See Errata E24
- if (_value == 0) return "0";
- else if (Double.isNaN(_value)) return "NaN";
- else if (_value < 0 && Double.isInfinite(_value)) return "-Infinity";
- else if (Double.isInfinite(_value)) return "Infinity";
- else return formatNumbers((int)_value);
- }
-
- IntegerArray ancestors = new IntegerArray();
-
- // Gather all ancestors that do not match from pattern
- int next = _node;
- ancestors.add(next); // include self
- while ((next = _document.getParent(next)) > END &&
- !matchesFrom(next)) {
- ancestors.add(next);
- }
-
- // Create an array of counters
- final int nAncestors = ancestors.cardinality();
- final int[] counters = new int[nAncestors];
- for (int i = 0; i < nAncestors; i++) {
- counters[i] = Integer.MIN_VALUE;
- }
-
- // Increment array of counters according to semantics
- for (int j = 0, i = nAncestors - 1; i >= 0 ; i--, j++) {
- final int counter = counters[j];
- final int ancestor = ancestors.at(i);
-
- if (matchesCount(ancestor)) {
- _precSiblings.setStartNode(ancestor);
- while ((next = _precSiblings.next()) != END) {
- if (matchesCount(next)) {
- counters[j] = (counters[j] == Integer.MIN_VALUE) ? 1
- : counters[j] + 1;
- }
- }
- // Count the node itself
- counters[j] = counters[j] == Integer.MIN_VALUE
- ? 1
- : counters[j] + 1;
- }
- }
- return formatNumbers(counters);
- }
-
- public static NodeCounter getDefaultNodeCounter(Translet translet,
- DOM document,
- DTMAxisIterator iterator) {
- return new DefaultMultipleNodeCounter(translet, document, iterator);
- }
-
- static class DefaultMultipleNodeCounter extends MultipleNodeCounter {
- public DefaultMultipleNodeCounter(Translet translet,
- DOM document,
- DTMAxisIterator iterator) {
- super(translet, document, iterator);
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/NodeCounter.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/NodeCounter.java
deleted file mode 100644
index cad02f5..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/NodeCounter.java
+++ /dev/null
@@ -1,416 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: NodeCounter.java,v 1.2.4.1 2005/09/12 11:52:36 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.dom;
-
-import java.util.Vector;
-
-import com.sun.org.apache.xalan.internal.xsltc.DOM;
-import com.sun.org.apache.xalan.internal.xsltc.Translet;
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- */
-public abstract class NodeCounter {
- public static final int END = DTM.NULL;
-
- protected int _node = END;
- protected int _nodeType = DOM.FIRST_TYPE - 1;
- protected double _value = Integer.MIN_VALUE;
-
- public final DOM _document;
- public final DTMAxisIterator _iterator;
- public final Translet _translet;
-
- protected String _format;
- protected String _lang;
- protected String _letterValue;
- protected String _groupSep;
- protected int _groupSize;
-
- private boolean _separFirst = true;
- private boolean _separLast = false;
- private Vector _separToks = new Vector();
- private Vector _formatToks = new Vector();
- private int _nSepars = 0;
- private int _nFormats = 0;
-
- private final static String[] Thousands =
- {"", "m", "mm", "mmm" };
- private final static String[] Hundreds =
- {"", "c", "cc", "ccc", "cd", "d", "dc", "dcc", "dccc", "cm"};
- private final static String[] Tens =
- {"", "x", "xx", "xxx", "xl", "l", "lx", "lxx", "lxxx", "xc"};
- private final static String[] Ones =
- {"", "i", "ii", "iii", "iv", "v", "vi", "vii", "viii", "ix"};
-
- private StringBuilder _tempBuffer = new StringBuilder();
-
- /**
- * Indicates if this instance of xsl:number has a from pattern.
- */
- protected boolean _hasFrom;
-
- protected NodeCounter(Translet translet,
- DOM document, DTMAxisIterator iterator) {
- _translet = translet;
- _document = document;
- _iterator = iterator;
- }
-
- protected NodeCounter(Translet translet,
- DOM document, DTMAxisIterator iterator, boolean hasFrom) {
- _translet = translet;
- _document = document;
- _iterator = iterator;
- _hasFrom = hasFrom;
- }
-
- /**
- * Set the start node for this counter. The same <tt>NodeCounter</tt>
- * object can be used multiple times by resetting the starting node.
- */
- abstract public NodeCounter setStartNode(int node);
-
- /**
- * If the user specified a value attribute, use this instead of
- * counting nodes.
- */
- public NodeCounter setValue(double value) {
- _value = value;
- return this;
- }
-
- /**
- * Sets formatting fields before calling formatNumbers().
- */
- protected void setFormatting(String format, String lang, String letterValue,
- String groupSep, String groupSize) {
- _lang = lang;
- _groupSep = groupSep;
- _letterValue = letterValue;
- _groupSize = parseStringToAnInt(groupSize);
- setTokens(format);
-
- }
-
- /**
- * Effectively does the same thing as Integer.parseInt(String s) except
- * instead of throwing a NumberFormatException, it returns 0. This method
- * is used instead of Integer.parseInt() since it does not incur the
- * overhead of throwing an Exception which is expensive.
- *
- * @param s A String to be parsed into an int.
- * @return Either an int represented by the incoming String s, or 0 if
- * the parsing is not successful.
- */
- private int parseStringToAnInt(String s) {
- if (s == null)
- return 0;
-
- int result = 0;
- boolean negative = false;
- int radix = 10, i = 0, max = s.length();
- int limit, multmin, digit;
-
- if (max > 0) {
- if (s.charAt(0) == '-') {
- negative = true;
- limit = Integer.MIN_VALUE;
- i++;
- } else {
- limit = -Integer.MAX_VALUE;
- }
- multmin = limit / radix;
- if (i < max) {
- digit = Character.digit(s.charAt(i++), radix);
- if (digit < 0)
- return 0;
- else
- result = -digit;
- }
- while (i < max) {
- // Accumulating negatively avoids surprises near MAX_VALUE
- digit = Character.digit(s.charAt(i++), radix);
- if (digit < 0)
- return 0;
- if (result < multmin)
- return 0;
- result *= radix;
- if (result < limit + digit)
- return 0;
- result -= digit;
- }
- } else {
- return 0;
- }
- if (negative) {
- if (i > 1)
- return result;
- else /* Only got "-" */
- return 0;
- } else {
- return -result;
- }
- }
-
- // format == null assumed here
- private final void setTokens(final String format){
- if( (_format!=null) &&(format.equals(_format)) ){// has already been set
- return;
- }
- _format = format;
- // reset
- final int length = _format.length();
- boolean isFirst = true;
- _separFirst = true;
- _separLast = false;
- _nSepars = 0;
- _nFormats = 0;
- _separToks.clear() ;
- _formatToks.clear();
-
- /*
- * Tokenize the format string into alphanumeric and non-alphanumeric
- * tokens as described in M. Kay page 241.
- */
- for (int j = 0, i = 0; i < length;) {
- char c = format.charAt(i);
- for (j = i; Character.isLetterOrDigit(c);) {
- if (++i == length) break;
- c = format.charAt(i);
- }
- if (i > j) {
- if (isFirst) {
- _separToks.addElement(".");
- isFirst = _separFirst = false;
- }
- _formatToks.addElement(format.substring(j, i));
- }
-
- if (i == length) break;
-
- c = format.charAt(i);
- for (j = i; !Character.isLetterOrDigit(c);) {
- if (++i == length) break;
- c = format.charAt(i);
- isFirst = false;
- }
- if (i > j) {
- _separToks.addElement(format.substring(j, i));
- }
- }
-
- _nSepars = _separToks.size();
- _nFormats = _formatToks.size();
- if (_nSepars > _nFormats) _separLast = true;
-
- if (_separFirst) _nSepars--;
- if (_separLast) _nSepars--;
- if (_nSepars == 0) {
- _separToks.insertElementAt(".", 1);
- _nSepars++;
- }
- if (_separFirst) _nSepars ++;
-
- }
- /**
- * Sets formatting fields to their default values.
- */
- public NodeCounter setDefaultFormatting() {
- setFormatting("1", "en", "alphabetic", null, null);
- return this;
- }
-
- /**
- * Returns the position of <tt>node</tt> according to the level and
- * the from and count patterns.
- */
- abstract public String getCounter();
-
- /**
- * Returns the position of <tt>node</tt> according to the level and
- * the from and count patterns. This position is converted into a
- * string based on the arguments passed.
- */
- public String getCounter(String format, String lang, String letterValue,
- String groupSep, String groupSize) {
- setFormatting(format, lang, letterValue, groupSep, groupSize);
- return getCounter();
- }
-
- /**
- * Returns true if <tt>node</tt> matches the count pattern. By
- * default a node matches the count patterns if it is of the
- * same type as the starting node.
- */
- public boolean matchesCount(int node) {
- return _nodeType == _document.getExpandedTypeID(node);
- }
-
- /**
- * Returns true if <tt>node</tt> matches the from pattern. By default,
- * no node matches the from pattern.
- */
- public boolean matchesFrom(int node) {
- return false;
- }
-
- /**
- * Format a single value according to the format parameters.
- */
- protected String formatNumbers(int value) {
- return formatNumbers(new int[] { value });
- }
-
- /**
- * Format a sequence of values according to the format paramaters
- * set by calling setFormatting().
- */
- protected String formatNumbers(int[] values) {
- final int nValues = values.length;
-
- boolean isEmpty = true;
- for (int i = 0; i < nValues; i++)
- if (values[i] != Integer.MIN_VALUE)
- isEmpty = false;
- if (isEmpty) return("");
-
- // Format the output string using the values array and the fmt. tokens
- boolean isFirst = true;
- int t = 0, n = 0, s = 1;
- _tempBuffer.setLength(0);
- final StringBuilder buffer = _tempBuffer;
-
- // Append separation token before first digit/letter/numeral
- if (_separFirst) buffer.append((String)_separToks.elementAt(0));
-
- // Append next digit/letter/numeral and separation token
- while (n < nValues) {
- final int value = values[n];
- if (value != Integer.MIN_VALUE) {
- if (!isFirst) buffer.append((String) _separToks.elementAt(s++));
- formatValue(value, (String)_formatToks.elementAt(t++), buffer);
- if (t == _nFormats) t--;
- if (s >= _nSepars) s--;
- isFirst = false;
- }
- n++;
- }
-
- // Append separation token after last digit/letter/numeral
- if (_separLast) buffer.append((String)_separToks.lastElement());
- return buffer.toString();
- }
-
- /**
- * Format a single value based on the appropriate formatting token.
- * This method is based on saxon (Michael Kay) and only implements
- * lang="en".
- */
- private void formatValue(int value, String format, StringBuilder buffer) {
- char c = format.charAt(0);
-
- if (Character.isDigit(c)) {
- char zero = (char)(c - Character.getNumericValue(c));
-
- StringBuilder temp = buffer;
- if (_groupSize > 0) {
- temp = new StringBuilder();
- }
- String s = "";
- int n = value;
- while (n > 0) {
- s = (char) ((int) zero + (n % 10)) + s;
- n = n / 10;
- }
-
- for (int i = 0; i < format.length() - s.length(); i++) {
- temp.append(zero);
- }
- temp.append(s);
-
- if (_groupSize > 0) {
- for (int i = 0; i < temp.length(); i++) {
- if (i != 0 && ((temp.length() - i) % _groupSize) == 0) {
- buffer.append(_groupSep);
- }
- buffer.append(temp.charAt(i));
- }
- }
- }
- else if (c == 'i' && !_letterValue.equals("alphabetic")) {
- buffer.append(romanValue(value));
- }
- else if (c == 'I' && !_letterValue.equals("alphabetic")) {
- buffer.append(romanValue(value).toUpperCase());
- }
- else {
- int min = (int) c;
- int max = (int) c;
-
- // Special case for Greek alphabet
- if (c >= 0x3b1 && c <= 0x3c9) {
- max = 0x3c9; // omega
- }
- else {
- // General case: search for end of group
- while (Character.isLetterOrDigit((char) (max + 1))) {
- max++;
- }
- }
- buffer.append(alphaValue(value, min, max));
- }
- }
-
- private String alphaValue(int value, int min, int max) {
- if (value <= 0) {
- return "" + value;
- }
-
- int range = max - min + 1;
- char last = (char)(((value-1) % range) + min);
- if (value > range) {
- return alphaValue((value-1) / range, min, max) + last;
- }
- else {
- return "" + last;
- }
- }
-
- private String romanValue(int n) {
- if (n <= 0 || n > 4000) {
- return "" + n;
- }
- return
- Thousands[n / 1000] +
- Hundreds[(n / 100) % 10] +
- Tens[(n/10) % 10] +
- Ones[n % 10];
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/NodeIteratorBase.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/NodeIteratorBase.java
deleted file mode 100644
index d51354a..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/NodeIteratorBase.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: NodeIteratorBase.java,v 1.2.4.1 2005/09/06 09:37:02 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.dom;
-
-import com.sun.org.apache.xalan.internal.xsltc.NodeIterator;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.BasisLibrary;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- */
-public abstract class NodeIteratorBase implements NodeIterator {
-
- /**
- * Cached computed value of last().
- */
- protected int _last = -1;
-
- /**
- * Value of position() in this iterator. Incremented in
- * returnNode().
- */
- protected int _position = 0;
-
- /**
- * Store node in call to setMark().
- */
- protected int _markedNode;
-
- /**
- * Store node in call to setStartNode().
- */
- protected int _startNode = NodeIterator.END;
-
- /**
- * Flag indicating if "self" should be returned.
- */
- protected boolean _includeSelf = false;
-
- /**
- * Flag indicating if iterator can be restarted.
- */
- protected boolean _isRestartable = true;
-
- /**
- * Setter for _isRestartable flag.
- */
- public void setRestartable(boolean isRestartable) {
- _isRestartable = isRestartable;
- }
-
- /**
- * Initialize iterator using a node. If iterator is not
- * restartable, then do nothing. If node is equal to END then
- * subsequent calls to next() must return END.
- */
- abstract public NodeIterator setStartNode(int node);
-
- /**
- * Reset this iterator using state from last call to
- * setStartNode().
- */
- public NodeIterator reset() {
- final boolean temp = _isRestartable;
- _isRestartable = true;
- // Must adjust _startNode if self is included
- setStartNode(_includeSelf ? _startNode + 1 : _startNode);
- _isRestartable = temp;
- return this;
- }
-
- /**
- * Setter for _includeSelf flag.
- */
- public NodeIterator includeSelf() {
- _includeSelf = true;
- return this;
- }
-
- /**
- * Default implementation of getLast(). Stores current position
- * and current node, resets the iterator, counts all nodes and
- * restores iterator to original state.
- */
- public int getLast() {
- if (_last == -1) {
- final int temp = _position;
- setMark();
- reset();
- do {
- _last++;
- } while (next() != END);
- gotoMark();
- _position = temp;
- }
- return _last;
- }
-
- /**
- * Returns the position() in this iterator.
- */
- public int getPosition() {
- return _position == 0 ? 1 : _position;
- }
-
- /**
- * Indicates if position in this iterator is computed in reverse
- * document order. Note that nodes are always returned in document
- * order.
- */
- public boolean isReverse() {
- return false;
- }
-
- /**
- * Clones and resets this iterator. Note that the cloned iterator is
- * not restartable. This is because cloning is needed for variable
- * references, and the context node of the original variable
- * declaration must be preserved.
- */
- public NodeIterator cloneIterator() {
- try {
- final NodeIteratorBase clone = (NodeIteratorBase)super.clone();
- clone._isRestartable = false;
- return clone.reset();
- }
- catch (CloneNotSupportedException e) {
- BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR,
- e.toString());
- return null;
- }
- }
-
- /**
- * Utility method that increments position and returns its
- * argument.
- */
- protected final int returnNode(final int node) {
- _position++;
- return node;
- }
-
- /**
- * Reset the position in this iterator.
- */
- protected final NodeIterator resetPosition() {
- _position = 0;
- return this;
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecord.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecord.java
deleted file mode 100644
index aaf997a..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecord.java
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: NodeSortRecord.java,v 1.5 2005/09/28 13:48:36 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.dom;
-
-import java.text.CollationKey;
-import java.text.Collator;
-import java.util.Locale;
-
-import com.sun.org.apache.xalan.internal.xsltc.CollatorFactory;
-import com.sun.org.apache.xalan.internal.xsltc.DOM;
-import com.sun.org.apache.xalan.internal.xsltc.TransletException;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet;
-import com.sun.org.apache.xml.internal.utils.StringComparable;
-import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
-import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
-
-/**
- * Base class for sort records containing application specific sort keys
- */
-public abstract class NodeSortRecord {
- public static final int COMPARE_STRING = 0;
- public static final int COMPARE_NUMERIC = 1;
-
- public static final int COMPARE_ASCENDING = 0;
- public static final int COMPARE_DESCENDING = 1;
-
- /**
- * A reference to a collator. May be updated by subclass if the stylesheet
- * specifies a different language (will be updated iff _locale is updated).
- * @deprecated This field continues to exist for binary compatibility.
- * New code should not refer to it.
- */
- private static final Collator DEFAULT_COLLATOR = Collator.getInstance();
-
- /**
- * A reference to the first Collator
- * @deprecated This field continues to exist for binary compatibility.
- * New code should not refer to it.
- */
- protected Collator _collator = DEFAULT_COLLATOR;
- protected Collator[] _collators;
-
- /**
- * A locale field that might be set by an instance of a subclass.
- * @deprecated This field continues to exist for binary compatibility.
- * New code should not refer to it.
- */
- protected Locale _locale;
-
- protected CollatorFactory _collatorFactory;
-
- protected SortSettings _settings;
-
- private DOM _dom = null;
- private int _node; // The position in the current iterator
- private int _last = 0; // Number of nodes in the current iterator
- private int _scanned = 0; // Number of key levels extracted from DOM
-
- private Object[] _values; // Contains Comparable objects
-
- /**
- * This constructor is run by a call to ClassLoader in the
- * makeNodeSortRecord method in the NodeSortRecordFactory class. Since we
- * cannot pass any parameters to the constructor in that case we just set
- * the default values here and wait for new values through initialize().
- */
- public NodeSortRecord(int node) {
- _node = node;
- }
-
- public NodeSortRecord() {
- this(0);
- }
-
- /**
- * This method allows the caller to set the values that could not be passed
- * to the default constructor.
- */
- public final void initialize(int node, int last, DOM dom,
- SortSettings settings)
- throws TransletException
- {
- _dom = dom;
- _node = node;
- _last = last;
- _settings = settings;
-
- int levels = settings.getSortOrders().length;
- _values = new Object[levels];
-
- String colFactClassname = null;
- try {
- // -- W. Eliot Kimber (eliot@isogen.com)
- colFactClassname =
- SecuritySupport.getSystemProperty("com.sun.org.apache.xalan.internal.xsltc.COLLATOR_FACTORY");
- }
- catch (SecurityException e) {
- // If we can't read the propery, just use default collator
- }
-
- if (colFactClassname != null) {
- try {
- Object candObj = ObjectFactory.findProviderClass(colFactClassname, true);
- _collatorFactory = (CollatorFactory)candObj;
- } catch (ClassNotFoundException e) {
- throw new TransletException(e);
- }
- Locale[] locales = settings.getLocales();
- _collators = new Collator[levels];
- for (int i = 0; i < levels; i++){
- _collators[i] = _collatorFactory.getCollator(locales[i]);
- }
- _collator = _collators[0];
- } else {
- _collators = settings.getCollators();
- _collator = _collators[0];
- }
- }
-
- /**
- * Returns the node for this sort object
- */
- public final int getNode() {
- return _node;
- }
-
- /**
- *
- */
- public final int compareDocOrder(NodeSortRecord other) {
- return _node - other._node;
- }
-
- /**
- * Get the string or numeric value of a specific level key for this sort
- * element. The value is extracted from the DOM if it is not already in
- * our sort key vector.
- */
- private final Comparable stringValue(int level) {
- // Get value from our array if possible
- if (_scanned <= level) {
- AbstractTranslet translet = _settings.getTranslet();
- Locale[] locales = _settings.getLocales();
- String[] caseOrder = _settings.getCaseOrders();
-
- // Get value from DOM if accessed for the first time
- final String str = extractValueFromDOM(_dom, _node, level,
- translet, _last);
- final Comparable key =
- StringComparable.getComparator(str, locales[level],
- _collators[level],
- caseOrder[level]);
- _values[_scanned++] = key;
- return(key);
- }
- return((Comparable)_values[level]);
- }
-
- private final Double numericValue(int level) {
- // Get value from our vector if possible
- if (_scanned <= level) {
- AbstractTranslet translet = _settings.getTranslet();
-
- // Get value from DOM if accessed for the first time
- final String str = extractValueFromDOM(_dom, _node, level,
- translet, _last);
- Double num;
- try {
- num = new Double(str);
- }
- // Treat number as NaN if it cannot be parsed as a double
- catch (NumberFormatException e) {
- num = new Double(Double.NEGATIVE_INFINITY);
- }
- _values[_scanned++] = num;
- return(num);
- }
- return((Double)_values[level]);
- }
-
- /**
- * Compare this sort element to another. The first level is checked first,
- * and we proceed to the next level only if the first level keys are
- * identical (and so the key values may not even be extracted from the DOM)
- *
- * !!!!MUST OPTIMISE - THIS IS REALLY, REALLY SLOW!!!!
- */
- public int compareTo(NodeSortRecord other) {
- int cmp, level;
- int[] sortOrder = _settings.getSortOrders();
- int levels = _settings.getSortOrders().length;
- int[] compareTypes = _settings.getTypes();
-
- for (level = 0; level < levels; level++) {
- // Compare the two nodes either as numeric or text values
- if (compareTypes[level] == COMPARE_NUMERIC) {
- final Double our = numericValue(level);
- final Double their = other.numericValue(level);
- cmp = our.compareTo(their);
- }
- else {
- final Comparable our = stringValue(level);
- final Comparable their = other.stringValue(level);
- cmp = our.compareTo(their);
- }
-
- // Return inverse compare value if inverse sort order
- if (cmp != 0) {
- return sortOrder[level] == COMPARE_DESCENDING ? 0 - cmp : cmp;
- }
- }
- // Compare based on document order if all sort keys are equal
- return(_node - other._node);
- }
-
- /**
- * Returns the array of Collators used for text comparisons in this object.
- * May be overridden by inheriting classes
- */
- public Collator[] getCollator() {
- return _collators;
- }
-
- /**
- * Extract the sort value for a level of this key.
- */
- public abstract String extractValueFromDOM(DOM dom, int current, int level,
- AbstractTranslet translet,
- int last);
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecordFactory.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecordFactory.java
deleted file mode 100644
index 1cc464c..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecordFactory.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: NodeSortRecordFactory.java,v 1.2.4.1 2005/09/06 09:53:40 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.dom;
-
-import com.sun.org.apache.xalan.internal.xsltc.DOM;
-import com.sun.org.apache.xalan.internal.xsltc.Translet;
-import com.sun.org.apache.xalan.internal.xsltc.TransletException;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet;
-import com.sun.org.apache.xml.internal.utils.LocaleUtility;
-import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
-import java.util.Locale;
-import java.text.Collator;
-
-public class NodeSortRecordFactory {
-
- private static int DESCENDING = "descending".length();
- private static int NUMBER = "number".length();
-
- private final DOM _dom;
- private final String _className;
- private Class _class;
- private SortSettings _sortSettings;
-
- /**
- *
- */
- protected Collator _collator;
-
- /**
- * Creates a NodeSortRecord producing object. The DOM specifies which tree
- * to get the nodes to sort from, the class name specifies what auxillary
- * class to use to sort the nodes (this class is generated by the Sort
- * class), and the translet parameter is needed for methods called by
- * this object.
- *
- * @deprecated This constructor is no longer used in generated code. It
- * exists only for backwards compatibility.
- */
- public NodeSortRecordFactory(DOM dom, String className, Translet translet,
- String order[], String type[])
- throws TransletException
- {
- this(dom, className, translet, order, type, null, null);
- }
-
- /**
- * Creates a NodeSortRecord producing object. The DOM specifies which tree
- * to get the nodes to sort from, the class name specifies what auxillary
- * class to use to sort the nodes (this class is generated by the Sort
- * class), and the translet parameter is needed for methods called by
- * this object.
- */
- public NodeSortRecordFactory(DOM dom, String className, Translet translet,
- String order[], String type[], String lang[],
- String caseOrder[])
- throws TransletException
- {
- try {
- _dom = dom;
- _className = className;
- // This should return a Class definition if using TrAX
- _class = translet.getAuxiliaryClass(className);
- // This code is only run when the native API is used
- if (_class == null) {
- _class = ObjectFactory.findProviderClass(className, true);
- }
-
- int levels = order.length;
- int[] iOrder = new int[levels];
- int[] iType = new int[levels];
- for (int i = 0; i < levels; i++) {
- if (order[i].length() == DESCENDING) {
- iOrder[i] = NodeSortRecord.COMPARE_DESCENDING;
- }
- if (type[i].length() == NUMBER) {
- iType[i] = NodeSortRecord.COMPARE_NUMERIC;
- }
- }
-
- // Old NodeSortRecordFactory constructor had no lang or case_order
- // arguments. Provide default values in that case for binary
- // compatibility.
- String[] emptyStringArray = null;
- if (lang == null || caseOrder == null) {
- int numSortKeys = order.length;
- emptyStringArray = new String[numSortKeys];
-
- // Set up array of zero-length strings as default values
- // of lang and case_order
- for (int i = 0; i < numSortKeys; i++) {
- emptyStringArray[i] = "";
- }
- }
-
- if (lang == null) {
- lang = emptyStringArray;
- }
- if (caseOrder == null) {
- caseOrder = emptyStringArray;
- }
-
- final int length = lang.length;
- Locale[] locales = new Locale[length];
- Collator[] collators = new Collator[length];
- for (int i = 0; i< length; i++){
- locales[i] = LocaleUtility.langToLocale(lang[i]);
- collators[i] = Collator.getInstance(locales[i]);
- }
-
- _sortSettings = new SortSettings((AbstractTranslet) translet,
- iOrder, iType, locales, collators,
- caseOrder);
- } catch (ClassNotFoundException e) {
- throw new TransletException(e);
- }
- }
-
-
-
- /**
- * Create an instance of a sub-class of NodeSortRecord. The name of this
- * sub-class is passed to us in the constructor.
- */
- public NodeSortRecord makeNodeSortRecord(int node, int last)
- throws ExceptionInInitializerError,
- LinkageError,
- IllegalAccessException,
- InstantiationException,
- SecurityException,
- TransletException {
-
- final NodeSortRecord sortRecord =
- (NodeSortRecord)_class.newInstance();
- sortRecord.initialize(node, last, _dom, _sortSettings);
- return sortRecord;
- }
-
- public String getClassName() {
- return _className;
- }
-
- private final void setLang(final String lang[]){
-
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/NthIterator.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/NthIterator.java
deleted file mode 100644
index 612188f..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/NthIterator.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: NthIterator.java,v 1.2.4.1 2005/09/06 09:57:04 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.dom;
-
-import com.sun.org.apache.xalan.internal.xsltc.runtime.BasisLibrary;
-import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
-import com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase;
-
-/**
- * @author Jacek Ambroziak
- * @author Morten Jorgensen
- */
-public final class NthIterator extends DTMAxisIteratorBase {
- // ...[N]
- private DTMAxisIterator _source;
- private final int _position;
- private boolean _ready;
-
- public NthIterator(DTMAxisIterator source, int n) {
- _source = source;
- _position = n;
- }
-
- public void setRestartable(boolean isRestartable) {
- _isRestartable = isRestartable;
- _source.setRestartable(isRestartable);
- }
-
- public DTMAxisIterator cloneIterator() {
- try {
- final NthIterator clone = (NthIterator) super.clone();
- clone._source = _source.cloneIterator(); // resets source
- clone._isRestartable = false;
- return clone;
- }
- catch (CloneNotSupportedException e) {
- BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR,
- e.toString());
- return null;
- }
- }
-
- public int next() {
- if (_ready) {
- _ready = false;
- return _source.getNodeByPosition(_position);
- }
- return DTMAxisIterator.END;
- /*
- if (_ready && _position > 0) {
- final int pos = _source.isReverse()
- ? _source.getLast() - _position + 1
- : _position;
-
- _ready = false;
- int node;
- while ((node = _source.next()) != DTMAxisIterator.END) {
- if (pos == _source.getPosition()) {
- return node;
- }
- }
- }
- return DTMAxisIterator.END;
- */
- }
-
- public DTMAxisIterator setStartNode(final int node) {
- if (_isRestartable) {
- _source.setStartNode(node);
- _ready = true;
- }
- return this;
- }
-
- public DTMAxisIterator reset() {
- _source.reset();
- _ready = true;
- return this;
- }
-
- public int getLast() {
- return 1;
- }
-
- public int getPosition() {
- return 1;
- }
-
- public void setMark() {
- _source.setMark();
- }
-
- public void gotoMark() {
- _source.gotoMark();
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/SAXImpl.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/SAXImpl.java
deleted file mode 100644
index 2919b9b..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/SAXImpl.java
+++ /dev/null
@@ -1,1882 +0,0 @@
-/*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.dom;
-
-import com.sun.org.apache.xalan.internal.xsltc.DOM;
-import com.sun.org.apache.xalan.internal.xsltc.DOMEnhancedForDTM;
-import com.sun.org.apache.xalan.internal.xsltc.StripFilter;
-import com.sun.org.apache.xalan.internal.xsltc.TransletException;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.BasisLibrary;
-import com.sun.org.apache.xml.internal.dtm.Axis;
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
-import com.sun.org.apache.xml.internal.dtm.DTMManager;
-import com.sun.org.apache.xml.internal.dtm.DTMWSFilter;
-import com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIterNodeList;
-import com.sun.org.apache.xml.internal.dtm.ref.DTMDefaultBase;
-import com.sun.org.apache.xml.internal.dtm.ref.DTMNodeProxy;
-import com.sun.org.apache.xml.internal.dtm.ref.EmptyIterator;
-import com.sun.org.apache.xml.internal.dtm.ref.sax2dtm.SAX2DTM2;
-import com.sun.org.apache.xml.internal.serializer.SerializationHandler;
-import com.sun.org.apache.xml.internal.serializer.ToXMLSAXHandler;
-import com.sun.org.apache.xml.internal.utils.SystemIDResolver;
-import com.sun.org.apache.xml.internal.utils.XMLStringFactory;
-import java.util.HashMap;
-import java.util.Map;
-import javax.xml.transform.Source;
-import javax.xml.transform.dom.DOMSource;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Entity;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-
-
-/**
- * SAXImpl is the core model for SAX input source. SAXImpl objects are
- * usually created from an XSLTCDTMManager.
- *
- * <p>DOMSource inputs are handled using DOM2SAX + SAXImpl. SAXImpl has a
- * few specific fields (e.g. _node2Ids, _document) to keep DOM-related
- * information. They are used when the processing behavior between DOM and
- * SAX has to be different. Examples of these include id function and
- * unparsed entity.
- *
- * <p>SAXImpl extends SAX2DTM2 instead of SAX2DTM for better performance.
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- * @author Douglas Sellers <douglasjsellers@hotmail.com>
- */
-public final class SAXImpl extends SAX2DTM2
- implements DOMEnhancedForDTM, DOMBuilder
-{
-
- /* ------------------------------------------------------------------- */
- /* DOMBuilder fields BEGIN */
- /* ------------------------------------------------------------------- */
-
- // Namespace prefix-to-uri mapping stuff
- private int _uriCount = 0;
- // private int _prefixCount = 0;
-
- // Stack used to keep track of what whitespace text nodes are protected
- // by xml:space="preserve" attributes and which nodes that are not.
- private int[] _xmlSpaceStack;
- private int _idx = 1;
- private boolean _preserve = false;
-
- // private static final String XML_STRING = "xml:";
- private static final String XML_PREFIX = "xml";
- private static final String XMLSPACE_STRING = "xml:space";
- private static final String PRESERVE_STRING = "preserve";
- // private static final String XMLNS_PREFIX = "xmlns";
- private static final String XML_URI = "http://www.w3.org/XML/1998/namespace";
-
- private boolean _escaping = true;
- private boolean _disableEscaping = false;
- private int _textNodeToProcess = DTM.NULL;
-
- /* ------------------------------------------------------------------- */
- /* DOMBuilder fields END */
- /* ------------------------------------------------------------------- */
-
- // empty String for null attribute values
- private final static String EMPTYSTRING = "";
-
- // empty iterator to be returned when there are no children
- private final static DTMAxisIterator EMPTYITERATOR = EmptyIterator.getInstance();
- // The number of expanded names
- private int _namesSize = -1;
-
- // Namespace related stuff
- private Map<Integer, Integer> _nsIndex = new HashMap<>();
-
- // The initial size of the text buffer
- private int _size = 0;
-
- // Tracks which textnodes are not escaped
- private BitArray _dontEscape = null;
-
- // The URI to this document
- // private String _documentURI = null;
- static private int _documentURIIndex = 0;
-
- // The owner Document when the input source is DOMSource.
- private Document _document;
-
- // The Map for org.w3c.dom.Node to node id mapping.
- // This is only used when the input is a DOMSource and the
- // buildIdIndex flag is true.
- private Map<Node, Integer> _node2Ids = null;
-
- // True if the input source is a DOMSource.
- private boolean _hasDOMSource = false;
-
- // The DTMManager
- private XSLTCDTMManager _dtmManager;
-
- // Support for access/navigation through org.w3c.dom API
- private Node[] _nodes;
- private NodeList[] _nodeLists;
- // private final static String XML_LANG_ATTRIBUTE = "http://www.w3.org/XML/1998/namespace:@lang";
-
- /**
- * Define the origin of the document from which the tree was built
- */
- public void setDocumentURI(String uri) {
- if (uri != null) {
- setDocumentBaseURI(SystemIDResolver.getAbsoluteURI(uri));
- }
- }
-
- /**
- * Returns the origin of the document from which the tree was built
- */
- public String getDocumentURI() {
- String baseURI = getDocumentBaseURI();
- return (baseURI != null) ? baseURI : "rtf" + _documentURIIndex++;
- }
-
- public String getDocumentURI(int node) {
- return getDocumentURI();
- }
-
- public void setupMapping(String[] names, String[] urisArray,
- int[] typesArray, String[] namespaces) {
- // This method only has a function in DOM adapters
- }
-
- /**
- * Lookup a namespace URI from a prefix starting at node. This method
- * is used in the execution of xsl:element when the prefix is not known
- * at compile time.
- */
- public String lookupNamespace(int node, String prefix)
- throws TransletException
- {
- int anode, nsnode;
- final AncestorIterator ancestors = new AncestorIterator();
-
- if (isElement(node)) {
- ancestors.includeSelf();
- }
-
- ancestors.setStartNode(node);
- while ((anode = ancestors.next()) != DTM.NULL) {
- final NamespaceIterator namespaces = new NamespaceIterator();
-
- namespaces.setStartNode(anode);
- while ((nsnode = namespaces.next()) != DTM.NULL) {
- if (getLocalName(nsnode).equals(prefix)) {
- return getNodeValue(nsnode);
- }
- }
- }
-
- BasisLibrary.runTimeError(BasisLibrary.NAMESPACE_PREFIX_ERR, prefix);
- return null;
- }
-
- /**
- * Returns 'true' if a specific node is an element (of any type)
- */
- public boolean isElement(final int node) {
- return getNodeType(node) == DTM.ELEMENT_NODE;
- }
-
- /**
- * Returns 'true' if a specific node is an attribute (of any type)
- */
- public boolean isAttribute(final int node) {
- return getNodeType(node) == DTM.ATTRIBUTE_NODE;
- }
-
- /**
- * Returns the number of nodes in the tree (used for indexing)
- */
- public int getSize() {
- return getNumberOfNodes();
- }
-
- /**
- * Part of the DOM interface - no function here.
- */
- public void setFilter(StripFilter filter) {
- }
-
-
- /**
- * Returns true if node1 comes before node2 in document order
- */
- public boolean lessThan(int node1, int node2) {
- if (node1 == DTM.NULL) {
- return false;
- }
-
- if (node2 == DTM.NULL) {
- return true;
- }
-
- return (node1 < node2);
- }
-
- /**
- * Create an org.w3c.dom.Node from a node in the tree
- */
- public Node makeNode(int index) {
- if (_nodes == null) {
- _nodes = new Node[_namesSize];
- }
-
- int nodeID = makeNodeIdentity(index);
- if (nodeID < 0) {
- return null;
- }
- else if (nodeID < _nodes.length) {
- return (_nodes[nodeID] != null) ? _nodes[nodeID]
- : (_nodes[nodeID] = new DTMNodeProxy((DTM)this, index));
- }
- else {
- return new DTMNodeProxy((DTM)this, index);
- }
- }
-
- /**
- * Create an org.w3c.dom.Node from a node in an iterator
- * The iterator most be started before this method is called
- */
- public Node makeNode(DTMAxisIterator iter) {
- return makeNode(iter.next());
- }
-
- /**
- * Create an org.w3c.dom.NodeList from a node in the tree
- */
- public NodeList makeNodeList(int index) {
- if (_nodeLists == null) {
- _nodeLists = new NodeList[_namesSize];
- }
-
- int nodeID = makeNodeIdentity(index);
- if (nodeID < 0) {
- return null;
- }
- else if (nodeID < _nodeLists.length) {
- return (_nodeLists[nodeID] != null) ? _nodeLists[nodeID]
- : (_nodeLists[nodeID] = new DTMAxisIterNodeList(this,
- new SingletonIterator(index)));
- }
- else {
- return new DTMAxisIterNodeList(this, new SingletonIterator(index));
- }
- }
-
- /**
- * Create an org.w3c.dom.NodeList from a node iterator
- * The iterator most be started before this method is called
- */
- public NodeList makeNodeList(DTMAxisIterator iter) {
- return new DTMAxisIterNodeList(this, iter);
- }
-
- /**
- * Iterator that returns the namespace nodes as defined by the XPath data
- * model for a given node, filtered by extended type ID.
- */
- public class TypedNamespaceIterator extends NamespaceIterator {
-
- private String _nsPrefix;
-
- /**
- * Constructor TypedChildrenIterator
- *
- *
- * @param nodeType The extended type ID being requested.
- */
- public TypedNamespaceIterator(int nodeType) {
- super();
- if(m_expandedNameTable != null){
- _nsPrefix = m_expandedNameTable.getLocalName(nodeType);
- }
- }
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next() {
- if ((_nsPrefix == null) ||(_nsPrefix.length() == 0) ){
- return (END);
- }
- int node = END;
- for (node = super.next(); node != END; node = super.next()) {
- if (_nsPrefix.compareTo(getLocalName(node))== 0) {
- return returnNode(node);
- }
- }
- return (END);
- }
- } // end of TypedNamespaceIterator
-
-
-
- /**************************************************************
- * This is a specialised iterator for predicates comparing node or
- * attribute values to variable or parameter values.
- */
- private final class NodeValueIterator extends InternalAxisIteratorBase
- {
-
- private DTMAxisIterator _source;
- private String _value;
- private boolean _op;
- private final boolean _isReverse;
- private int _returnType = RETURN_PARENT;
-
- public NodeValueIterator(DTMAxisIterator source, int returnType,
- String value, boolean op)
- {
- _source = source;
- _returnType = returnType;
- _value = value;
- _op = op;
- _isReverse = source.isReverse();
- }
-
- public boolean isReverse()
- {
- return _isReverse;
- }
-
- public DTMAxisIterator cloneIterator()
- {
- try {
- NodeValueIterator clone = (NodeValueIterator)super.clone();
- clone._isRestartable = false;
- clone._source = _source.cloneIterator();
- clone._value = _value;
- clone._op = _op;
- return clone.reset();
- }
- catch (CloneNotSupportedException e) {
- BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR,
- e.toString());
- return null;
- }
- }
-
- public void setRestartable(boolean isRestartable)
- {
- _isRestartable = isRestartable;
- _source.setRestartable(isRestartable);
- }
-
- public DTMAxisIterator reset()
- {
- _source.reset();
- return resetPosition();
- }
-
- public int next()
- {
- int node;
- while ((node = _source.next()) != END) {
- String val = getStringValueX(node);
- if (_value.equals(val) == _op) {
- if (_returnType == RETURN_CURRENT) {
- return returnNode(node);
- }
- else {
- return returnNode(getParent(node));
- }
- }
- }
- return END;
- }
-
- public DTMAxisIterator setStartNode(int node)
- {
- if (_isRestartable) {
- _source.setStartNode(_startNode = node);
- return resetPosition();
- }
- return this;
- }
-
- public void setMark()
- {
- _source.setMark();
- }
-
- public void gotoMark()
- {
- _source.gotoMark();
- }
- } // end NodeValueIterator
-
- public DTMAxisIterator getNodeValueIterator(DTMAxisIterator iterator, int type,
- String value, boolean op)
- {
- return(DTMAxisIterator)(new NodeValueIterator(iterator, type, value, op));
- }
-
- /**
- * Encapsulates an iterator in an OrderedIterator to ensure node order
- */
- public DTMAxisIterator orderNodes(DTMAxisIterator source, int node)
- {
- return new DupFilterIterator(source);
- }
-
- /**
- * Returns singleton iterator containg the document root
- * Works for them main document (mark == 0). It cannot be made
- * to point to any other node through setStartNode().
- */
- public DTMAxisIterator getIterator()
- {
- return new SingletonIterator(getDocument(), true);
- }
-
- /**
- * Get mapping from DOM namespace types to external namespace types
- */
- public int getNSType(int node)
- {
- String s = getNamespaceURI(node);
- if (s == null) {
- return 0;
- }
- int eType = getIdForNamespace(s);
- return _nsIndex.get(new Integer(eType));
- }
-
-
-
- /**
- * Returns the namespace type of a specific node
- */
- public int getNamespaceType(final int node)
- {
- return super.getNamespaceType(node);
- }
-
- /**
- * Sets up a translet-to-dom type mapping table
- */
- /*
- private int[] setupMapping(String[] names, String[] uris, int[] types, int nNames) {
- // Padding with number of names, because they
- // may need to be added, i.e for RTFs. See copy03
- final int[] result = new int[m_expandedNameTable.getSize()];
- for (int i = 0; i < nNames; i++) {
- //int type = getGeneralizedType(namesArray[i]);
- int type = m_expandedNameTable.getExpandedTypeID(uris[i], names[i], types[i], false);
- result[type] = type;
- }
- return result;
- }
- */
-
- /**
- * Returns the internal type associated with an expanded QName
- */
- public int getGeneralizedType(final String name) {
- return getGeneralizedType(name, true);
- }
-
- /**
- * Returns the internal type associated with an expanded QName
- */
- public int getGeneralizedType(final String name, boolean searchOnly) {
- String lName, ns = null;
- int index = -1;
- int code;
-
- // Is there a prefix?
- if ((index = name.lastIndexOf(":"))> -1) {
- ns = name.substring(0, index);
- }
-
- // Local part of name is after colon. lastIndexOf returns -1 if
- // there is no colon, so lNameStartIdx will be zero in that case.
- int lNameStartIdx = index+1;
-
- // Distinguish attribute and element names. Attribute has @ before
- // local part of name.
- if (name.charAt(lNameStartIdx) == '@') {
- code = DTM.ATTRIBUTE_NODE;
- lNameStartIdx++;
- }
- else {
- code = DTM.ELEMENT_NODE;
- }
-
- // Extract local name
- lName = (lNameStartIdx == 0) ? name : name.substring(lNameStartIdx);
-
- return m_expandedNameTable.getExpandedTypeID(ns, lName, code, searchOnly);
- }
-
- /**
- * Get mapping from DOM element/attribute types to external types
- */
- public short[] getMapping(String[] names, String[] uris, int[] types)
- {
- // Delegate the work to getMapping2 if the document is not fully built.
- // Some of the processing has to be different in this case.
- if (_namesSize < 0) {
- return getMapping2(names, uris, types);
- }
-
- int i;
- final int namesLength = names.length;
- final int exLength = m_expandedNameTable.getSize();
-
- final short[] result = new short[exLength];
-
- // primitive types map to themselves
- for (i = 0; i < DTM.NTYPES; i++) {
- result[i] = (short)i;
- }
-
- for (i = NTYPES; i < exLength; i++) {
- result[i] = m_expandedNameTable.getType(i);
- }
-
- // actual mapping of caller requested names
- for (i = 0; i < namesLength; i++) {
- int genType = m_expandedNameTable.getExpandedTypeID(uris[i],
- names[i],
- types[i],
- true);
- if (genType >= 0 && genType < exLength) {
- result[genType] = (short)(i + DTM.NTYPES);
- }
- }
-
- return result;
- }
-
- /**
- * Get mapping from external element/attribute types to DOM types
- */
- public int[] getReverseMapping(String[] names, String[] uris, int[] types)
- {
- int i;
- final int[] result = new int[names.length + DTM.NTYPES];
-
- // primitive types map to themselves
- for (i = 0; i < DTM.NTYPES; i++) {
- result[i] = i;
- }
-
- // caller's types map into appropriate dom types
- for (i = 0; i < names.length; i++) {
- int type = m_expandedNameTable.getExpandedTypeID(uris[i], names[i], types[i], true);
- result[i+DTM.NTYPES] = type;
- }
- return(result);
- }
-
- /**
- * Get mapping from DOM element/attribute types to external types.
- * This method is used when the document is not fully built.
- */
- private short[] getMapping2(String[] names, String[] uris, int[] types)
- {
- int i;
- final int namesLength = names.length;
- final int exLength = m_expandedNameTable.getSize();
- int[] generalizedTypes = null;
- if (namesLength > 0) {
- generalizedTypes = new int[namesLength];
- }
-
- int resultLength = exLength;
-
- for (i = 0; i < namesLength; i++) {
- // When the document is not fully built, the searchOnly
- // flag should be set to false. That means we should add
- // the type if it is not already in the expanded name table.
- //generalizedTypes[i] = getGeneralizedType(names[i], false);
- generalizedTypes[i] =
- m_expandedNameTable.getExpandedTypeID(uris[i],
- names[i],
- types[i],
- false);
- if (_namesSize < 0 && generalizedTypes[i] >= resultLength) {
- resultLength = generalizedTypes[i] + 1;
- }
- }
-
- final short[] result = new short[resultLength];
-
- // primitive types map to themselves
- for (i = 0; i < DTM.NTYPES; i++) {
- result[i] = (short)i;
- }
-
- for (i = NTYPES; i < exLength; i++) {
- result[i] = m_expandedNameTable.getType(i);
- }
-
- // actual mapping of caller requested names
- for (i = 0; i < namesLength; i++) {
- int genType = generalizedTypes[i];
- if (genType >= 0 && genType < resultLength) {
- result[genType] = (short)(i + DTM.NTYPES);
- }
- }
-
- return(result);
- }
- /**
- * Get mapping from DOM namespace types to external namespace types
- */
- public short[] getNamespaceMapping(String[] namespaces)
- {
- int i;
- final int nsLength = namespaces.length;
- final int mappingLength = _uriCount;
-
- final short[] result = new short[mappingLength];
-
- // Initialize all entries to -1
- for (i=0; i<mappingLength; i++) {
- result[i] = (short)(-1);
- }
-
- for (i=0; i<nsLength; i++) {
- int eType = getIdForNamespace(namespaces[i]);
- Integer type = _nsIndex.get(eType);
- if (type != null) {
- result[type] = (short)i;
- }
- }
-
- return(result);
- }
-
- /**
- * Get mapping from external namespace types to DOM namespace types
- */
- public short[] getReverseNamespaceMapping(String[] namespaces)
- {
- int i;
- final int length = namespaces.length;
- final short[] result = new short[length];
-
- for (i = 0; i < length; i++) {
- int eType = getIdForNamespace(namespaces[i]);
- Integer type = _nsIndex.get(eType);
- result[i] = (type == null) ? -1 : type.shortValue();
- }
-
- return result;
- }
-
- /**
- * Construct a SAXImpl object using the default block size.
- */
- public SAXImpl(XSLTCDTMManager mgr, Source source,
- int dtmIdentity, DTMWSFilter whiteSpaceFilter,
- XMLStringFactory xstringfactory,
- boolean doIndexing, boolean buildIdIndex)
- {
- this(mgr, source, dtmIdentity, whiteSpaceFilter, xstringfactory,
- doIndexing, DEFAULT_BLOCKSIZE, buildIdIndex, false);
- }
-
- /**
- * Construct a SAXImpl object using the given block size.
- */
- public SAXImpl(XSLTCDTMManager mgr, Source source,
- int dtmIdentity, DTMWSFilter whiteSpaceFilter,
- XMLStringFactory xstringfactory,
- boolean doIndexing, int blocksize,
- boolean buildIdIndex,
- boolean newNameTable)
- {
- super(mgr, source, dtmIdentity, whiteSpaceFilter, xstringfactory,
- doIndexing, blocksize, false, buildIdIndex, newNameTable);
-
- _dtmManager = mgr;
- _size = blocksize;
-
- // Use a smaller size for the space stack if the blocksize is small
- _xmlSpaceStack = new int[blocksize <= 64 ? 4 : 64];
-
- /* From DOMBuilder */
- _xmlSpaceStack[0] = DTMDefaultBase.ROOTNODE;
-
- // If the input source is DOMSource, set the _document field and
- // create the node2Ids table.
- if (source instanceof DOMSource) {
- _hasDOMSource = true;
- DOMSource domsrc = (DOMSource)source;
- Node node = domsrc.getNode();
- if (node instanceof Document) {
- _document = (Document)node;
- }
- else {
- _document = node.getOwnerDocument();
- }
- _node2Ids = new HashMap<>();
- }
- }
-
- /**
- * Migrate a DTM built with an old DTMManager to a new DTMManager.
- * After the migration, the new DTMManager will treat the DTM as
- * one that is built by itself.
- * This is used to support DTM sharing between multiple transformations.
- * @param manager the DTMManager
- */
- public void migrateTo(DTMManager manager) {
- super.migrateTo(manager);
- if (manager instanceof XSLTCDTMManager) {
- _dtmManager = (XSLTCDTMManager)manager;
- }
- }
-
- /**
- * Return the node identity for a given id String
- *
- * @param idString The id String
- * @return The identity of the node whose id is the given String.
- */
- public int getElementById(String idString)
- {
- Node node = _document.getElementById(idString);
- if (node != null) {
- Integer id = _node2Ids.get(node);
- return (id != null) ? id : DTM.NULL;
- }
- else {
- return DTM.NULL;
- }
- }
-
- /**
- * Return true if the input source is DOMSource.
- */
- public boolean hasDOMSource()
- {
- return _hasDOMSource;
- }
-
- /*---------------------------------------------------------------------------*/
- /* DOMBuilder methods begin */
- /*---------------------------------------------------------------------------*/
-
- /**
- * Call this when an xml:space attribute is encountered to
- * define the whitespace strip/preserve settings.
- */
- private void xmlSpaceDefine(String val, final int node)
- {
- final boolean setting = val.equals(PRESERVE_STRING);
- if (setting != _preserve) {
- _xmlSpaceStack[_idx++] = node;
- _preserve = setting;
- }
- }
-
- /**
- * Call this from endElement() to revert strip/preserve setting
- * to whatever it was before the corresponding startElement().
- */
- private void xmlSpaceRevert(final int node)
- {
- if (node == _xmlSpaceStack[_idx - 1]) {
- _idx--;
- _preserve = !_preserve;
- }
- }
-
- /**
- * Find out whether or not to strip whitespace nodes.
- *
- *
- * @return whether or not to strip whitespace nodes.
- */
- protected boolean getShouldStripWhitespace()
- {
- return _preserve ? false : super.getShouldStripWhitespace();
- }
-
- /**
- * Creates a text-node and checks if it is a whitespace node.
- */
- private void handleTextEscaping() {
- if (_disableEscaping && _textNodeToProcess != DTM.NULL
- && _type(_textNodeToProcess) == DTM.TEXT_NODE) {
- if (_dontEscape == null) {
- _dontEscape = new BitArray(_size);
- }
-
- // Resize the _dontEscape BitArray if necessary.
- if (_textNodeToProcess >= _dontEscape.size()) {
- _dontEscape.resize(_dontEscape.size() * 2);
- }
-
- _dontEscape.setBit(_textNodeToProcess);
- _disableEscaping = false;
- }
- _textNodeToProcess = DTM.NULL;
- }
-
-
- /****************************************************************/
- /* SAX Interface Starts Here */
- /****************************************************************/
-
- /**
- * SAX2: Receive notification of character data.
- */
- public void characters(char[] ch, int start, int length) throws SAXException
- {
- super.characters(ch, start, length);
-
- _disableEscaping = !_escaping;
- _textNodeToProcess = getNumberOfNodes();
- }
-
- /**
- * SAX2: Receive notification of the beginning of a document.
- */
- public void startDocument() throws SAXException
- {
- super.startDocument();
-
- _nsIndex.put(0, _uriCount++);
- definePrefixAndUri(XML_PREFIX, XML_URI);
- }
-
- /**
- * SAX2: Receive notification of the end of a document.
- */
- public void endDocument() throws SAXException
- {
- super.endDocument();
-
- handleTextEscaping();
- _namesSize = m_expandedNameTable.getSize();
- }
-
- /**
- * Specialized interface used by DOM2SAX. This one has an extra Node
- * parameter to build the Node -> id map.
- */
- public void startElement(String uri, String localName,
- String qname, Attributes attributes,
- Node node)
- throws SAXException
- {
- this.startElement(uri, localName, qname, attributes);
-
- if (m_buildIdIndex) {
- _node2Ids.put(node, new Integer(m_parents.peek()));
- }
- }
-
- /**
- * SAX2: Receive notification of the beginning of an element.
- */
- public void startElement(String uri, String localName,
- String qname, Attributes attributes)
- throws SAXException
- {
- super.startElement(uri, localName, qname, attributes);
-
- handleTextEscaping();
-
- if (m_wsfilter != null) {
- // Look for any xml:space attributes
- // Depending on the implementation of attributes, this
- // might be faster than looping through all attributes. ILENE
- final int index = attributes.getIndex(XMLSPACE_STRING);
- if (index >= 0) {
- xmlSpaceDefine(attributes.getValue(index), m_parents.peek());
- }
- }
- }
-
- /**
- * SAX2: Receive notification of the end of an element.
- */
- public void endElement(String namespaceURI, String localName, String qname)
- throws SAXException
- {
- super.endElement(namespaceURI, localName, qname);
-
- handleTextEscaping();
-
- // Revert to strip/preserve-space setting from before this element
- if (m_wsfilter != null) {
- xmlSpaceRevert(m_previous);
- }
- }
-
- /**
- * SAX2: Receive notification of a processing instruction.
- */
- public void processingInstruction(String target, String data)
- throws SAXException
- {
- super.processingInstruction(target, data);
- handleTextEscaping();
- }
-
- /**
- * SAX2: Receive notification of ignorable whitespace in element
- * content. Similar to characters(char[], int, int).
- */
- public void ignorableWhitespace(char[] ch, int start, int length)
- throws SAXException
- {
- super.ignorableWhitespace(ch, start, length);
- _textNodeToProcess = getNumberOfNodes();
- }
-
- /**
- * SAX2: Begin the scope of a prefix-URI Namespace mapping.
- */
- public void startPrefixMapping(String prefix, String uri)
- throws SAXException
- {
- super.startPrefixMapping(prefix, uri);
- handleTextEscaping();
-
- definePrefixAndUri(prefix, uri);
- }
-
- private void definePrefixAndUri(String prefix, String uri)
- throws SAXException
- {
- // Check if the URI already exists before pushing on stack
- Integer eType = new Integer(getIdForNamespace(uri));
- if (_nsIndex.get(eType) == null) {
- _nsIndex.put(eType, _uriCount++);
- }
- }
-
- /**
- * SAX2: Report an XML comment anywhere in the document.
- */
- public void comment(char[] ch, int start, int length)
- throws SAXException
- {
- super.comment(ch, start, length);
- handleTextEscaping();
- }
-
- public boolean setEscaping(boolean value) {
- final boolean temp = _escaping;
- _escaping = value;
- return temp;
- }
-
- /*---------------------------------------------------------------------------*/
- /* DOMBuilder methods end */
- /*---------------------------------------------------------------------------*/
-
- /**
- * Prints the whole tree to standard output
- */
- public void print(int node, int level)
- {
- switch(getNodeType(node))
- {
- case DTM.ROOT_NODE:
- case DTM.DOCUMENT_NODE:
- print(getFirstChild(node), level);
- break;
- case DTM.TEXT_NODE:
- case DTM.COMMENT_NODE:
- case DTM.PROCESSING_INSTRUCTION_NODE:
- System.out.print(getStringValueX(node));
- break;
- default:
- final String name = getNodeName(node);
- System.out.print("<" + name);
- for (int a = getFirstAttribute(node); a != DTM.NULL; a = getNextAttribute(a))
- {
- System.out.print("\n" + getNodeName(a) + "=\"" + getStringValueX(a) + "\"");
- }
- System.out.print('>');
- for (int child = getFirstChild(node); child != DTM.NULL;
- child = getNextSibling(child)) {
- print(child, level + 1);
- }
- System.out.println("</" + name + '>');
- break;
- }
- }
-
- /**
- * Returns the name of a node (attribute or element).
- */
- public String getNodeName(final int node)
- {
- // Get the node type and make sure that it is within limits
- int nodeh = node;
- final short type = getNodeType(nodeh);
- switch(type)
- {
- case DTM.ROOT_NODE:
- case DTM.DOCUMENT_NODE:
- case DTM.TEXT_NODE:
- case DTM.COMMENT_NODE:
- return EMPTYSTRING;
- case DTM.NAMESPACE_NODE:
- return this.getLocalName(nodeh);
- default:
- return super.getNodeName(nodeh);
- }
- }
-
- /**
- * Returns the namespace URI to which a node belongs
- */
- public String getNamespaceName(final int node)
- {
- if (node == DTM.NULL) {
- return "";
- }
-
- String s;
- return (s = getNamespaceURI(node)) == null ? EMPTYSTRING : s;
- }
-
-
- /**
- * Returns the attribute node of a given type (if any) for an element
- */
- public int getAttributeNode(final int type, final int element)
- {
- for (int attr = getFirstAttribute(element);
- attr != DTM.NULL;
- attr = getNextAttribute(attr))
- {
- if (getExpandedTypeID(attr) == type) return attr;
- }
- return DTM.NULL;
- }
-
- /**
- * Returns the value of a given attribute type of a given element
- */
- public String getAttributeValue(final int type, final int element)
- {
- final int attr = getAttributeNode(type, element);
- return (attr != DTM.NULL) ? getStringValueX(attr) : EMPTYSTRING;
- }
-
- /**
- * This method is for testing/debugging only
- */
- public String getAttributeValue(final String name, final int element)
- {
- return getAttributeValue(getGeneralizedType(name), element);
- }
-
- /**
- * Returns an iterator with all the children of a given node
- */
- public DTMAxisIterator getChildren(final int node)
- {
- return (new ChildrenIterator()).setStartNode(node);
- }
-
- /**
- * Returns an iterator with all children of a specific type
- * for a given node (element)
- */
- public DTMAxisIterator getTypedChildren(final int type)
- {
- return(new TypedChildrenIterator(type));
- }
-
- /**
- * This is a shortcut to the iterators that implement the
- * supported XPath axes (only namespace::) is not supported.
- * Returns a bare-bones iterator that must be initialized
- * with a start node (using iterator.setStartNode()).
- */
- public DTMAxisIterator getAxisIterator(final int axis)
- {
- switch (axis)
- {
- case Axis.SELF:
- return new SingletonIterator();
- case Axis.CHILD:
- return new ChildrenIterator();
- case Axis.PARENT:
- return new ParentIterator();
- case Axis.ANCESTOR:
- return new AncestorIterator();
- case Axis.ANCESTORORSELF:
- return (new AncestorIterator()).includeSelf();
- case Axis.ATTRIBUTE:
- return new AttributeIterator();
- case Axis.DESCENDANT:
- return new DescendantIterator();
- case Axis.DESCENDANTORSELF:
- return (new DescendantIterator()).includeSelf();
- case Axis.FOLLOWING:
- return new FollowingIterator();
- case Axis.PRECEDING:
- return new PrecedingIterator();
- case Axis.FOLLOWINGSIBLING:
- return new FollowingSiblingIterator();
- case Axis.PRECEDINGSIBLING:
- return new PrecedingSiblingIterator();
- case Axis.NAMESPACE:
- return new NamespaceIterator();
- case Axis.ROOT:
- return new RootIterator();
- default:
- BasisLibrary.runTimeError(BasisLibrary.AXIS_SUPPORT_ERR,
- Axis.getNames(axis));
- }
- return null;
- }
-
- /**
- * Similar to getAxisIterator, but this one returns an iterator
- * containing nodes of a typed axis (ex.: child::foo)
- */
- public DTMAxisIterator getTypedAxisIterator(int axis, int type)
- {
- // Most common case handled first
- if (axis == Axis.CHILD) {
- return new TypedChildrenIterator(type);
- }
-
- if (type == NO_TYPE) {
- return(EMPTYITERATOR);
- }
-
- switch (axis)
- {
- case Axis.SELF:
- return new TypedSingletonIterator(type);
- case Axis.CHILD:
- return new TypedChildrenIterator(type);
- case Axis.PARENT:
- return new ParentIterator().setNodeType(type);
- case Axis.ANCESTOR:
- return new TypedAncestorIterator(type);
- case Axis.ANCESTORORSELF:
- return (new TypedAncestorIterator(type)).includeSelf();
- case Axis.ATTRIBUTE:
- return new TypedAttributeIterator(type);
- case Axis.DESCENDANT:
- return new TypedDescendantIterator(type);
- case Axis.DESCENDANTORSELF:
- return (new TypedDescendantIterator(type)).includeSelf();
- case Axis.FOLLOWING:
- return new TypedFollowingIterator(type);
- case Axis.PRECEDING:
- return new TypedPrecedingIterator(type);
- case Axis.FOLLOWINGSIBLING:
- return new TypedFollowingSiblingIterator(type);
- case Axis.PRECEDINGSIBLING:
- return new TypedPrecedingSiblingIterator(type);
- case Axis.NAMESPACE:
- return new TypedNamespaceIterator(type);
- case Axis.ROOT:
- return new TypedRootIterator(type);
- default:
- BasisLibrary.runTimeError(BasisLibrary.TYPED_AXIS_SUPPORT_ERR,
- Axis.getNames(axis));
- }
- return null;
- }
-
- /**
- * Do not think that this returns an iterator for the namespace axis.
- * It returns an iterator with nodes that belong in a certain namespace,
- * such as with <xsl:apply-templates select="blob/foo:*"/>
- * The 'axis' specifies the axis for the base iterator from which the
- * nodes are taken, while 'ns' specifies the namespace URI type.
- */
- public DTMAxisIterator getNamespaceAxisIterator(int axis, int ns)
- {
- if (ns == NO_TYPE) {
- return EMPTYITERATOR;
- }
- else {
- switch (axis) {
- case Axis.CHILD:
- return new NamespaceChildrenIterator(ns);
- case Axis.ATTRIBUTE:
- return new NamespaceAttributeIterator(ns);
- default:
- return new NamespaceWildcardIterator(axis, ns);
- }
- }
- }
-
- /**
- * Iterator that handles node tests that test for a namespace, but have
- * a wild card for the local name of the node, i.e., node tests of the
- * form <axis>::<prefix>:*
- */
- public final class NamespaceWildcardIterator
- extends InternalAxisIteratorBase
- {
- /**
- * The namespace type index.
- */
- protected int m_nsType;
-
- /**
- * A nested typed axis iterator that retrieves nodes of the principal
- * node kind for that axis.
- */
- protected DTMAxisIterator m_baseIterator;
-
- /**
- * Constructor NamespaceWildcard
- *
- * @param axis The axis that this iterator will traverse
- * @param nsType The namespace type index
- */
- public NamespaceWildcardIterator(int axis, int nsType) {
- m_nsType = nsType;
-
- // Create a nested iterator that will select nodes of
- // the principal node kind for the selected axis.
- switch (axis) {
- case Axis.ATTRIBUTE: {
- // For "attribute::p:*", the principal node kind is
- // attribute
- m_baseIterator = getAxisIterator(axis);
- }
- case Axis.NAMESPACE: {
- // This covers "namespace::p:*". It is syntactically
- // correct, though it doesn't make much sense.
- m_baseIterator = getAxisIterator(axis);
- }
- default: {
- // In all other cases, the principal node kind is
- // element
- m_baseIterator = getTypedAxisIterator(axis,
- DTM.ELEMENT_NODE);
- }
- }
- }
-
- /**
- * Set start to END should 'close' the iterator,
- * i.e. subsequent call to next() should return END.
- *
- * @param node Sets the root of the iteration.
- *
- * @return A DTMAxisIterator set to the start of the iteration.
- */
- public DTMAxisIterator setStartNode(int node) {
- if (_isRestartable) {
- _startNode = node;
- m_baseIterator.setStartNode(node);
- resetPosition();
- }
- return this;
- }
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next() {
- int node;
-
- while ((node = m_baseIterator.next()) != END) {
- // Return only nodes that are in the selected namespace
- if (getNSType(node) == m_nsType) {
- return returnNode(node);
- }
- }
-
- return END;
- }
-
- /**
- * Returns a deep copy of this iterator. The cloned iterator is not
- * reset.
- *
- * @return a deep copy of this iterator.
- */
- public DTMAxisIterator cloneIterator() {
- try {
- DTMAxisIterator nestedClone = m_baseIterator.cloneIterator();
- NamespaceWildcardIterator clone =
- (NamespaceWildcardIterator) super.clone();
-
- clone.m_baseIterator = nestedClone;
- clone.m_nsType = m_nsType;
- clone._isRestartable = false;
-
- return clone;
- } catch (CloneNotSupportedException e) {
- BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR,
- e.toString());
- return null;
- }
- }
-
- /**
- * True if this iterator has a reversed axis.
- *
- * @return <code>true</code> if this iterator is a reversed axis.
- */
- public boolean isReverse() {
- return m_baseIterator.isReverse();
- }
-
- public void setMark() {
- m_baseIterator.setMark();
- }
-
- public void gotoMark() {
- m_baseIterator.gotoMark();
- }
- }
-
- /**
- * Iterator that returns children within a given namespace for a
- * given node. The functionality chould be achieved by putting a
- * filter on top of a basic child iterator, but a specialised
- * iterator is used for efficiency (both speed and size of translet).
- */
- public final class NamespaceChildrenIterator
- extends InternalAxisIteratorBase
- {
-
- /** The extended type ID being requested. */
- private final int _nsType;
-
- /**
- * Constructor NamespaceChildrenIterator
- *
- *
- * @param type The extended type ID being requested.
- */
- public NamespaceChildrenIterator(final int type) {
- _nsType = type;
- }
-
- /**
- * Set start to END should 'close' the iterator,
- * i.e. subsequent call to next() should return END.
- *
- * @param node Sets the root of the iteration.
- *
- * @return A DTMAxisIterator set to the start of the iteration.
- */
- public DTMAxisIterator setStartNode(int node) {
- //%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
- if (node == DTMDefaultBase.ROOTNODE) {
- node = getDocument();
- }
-
- if (_isRestartable) {
- _startNode = node;
- _currentNode = (node == DTM.NULL) ? DTM.NULL : NOTPROCESSED;
-
- return resetPosition();
- }
-
- return this;
- }
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next() {
- if (_currentNode != DTM.NULL) {
- for (int node = (NOTPROCESSED == _currentNode)
- ? _firstch(makeNodeIdentity(_startNode))
- : _nextsib(_currentNode);
- node != END;
- node = _nextsib(node)) {
- int nodeHandle = makeNodeHandle(node);
-
- if (getNSType(nodeHandle) == _nsType) {
- _currentNode = node;
-
- return returnNode(nodeHandle);
- }
- }
- }
-
- return END;
- }
- } // end of NamespaceChildrenIterator
-
- /**
- * Iterator that returns attributes within a given namespace for a node.
- */
- public final class NamespaceAttributeIterator
- extends InternalAxisIteratorBase
- {
-
- /** The extended type ID being requested. */
- private final int _nsType;
-
- /**
- * Constructor NamespaceAttributeIterator
- *
- *
- * @param nsType The extended type ID being requested.
- */
- public NamespaceAttributeIterator(int nsType) {
- super();
-
- _nsType = nsType;
- }
-
- /**
- * Set start to END should 'close' the iterator,
- * i.e. subsequent call to next() should return END.
- *
- * @param node Sets the root of the iteration.
- *
- * @return A DTMAxisIterator set to the start of the iteration.
- */
- public DTMAxisIterator setStartNode(int node) {
- //%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
- if (node == DTMDefaultBase.ROOTNODE) {
- node = getDocument();
- }
-
- if (_isRestartable) {
- int nsType = _nsType;
-
- _startNode = node;
-
- for (node = getFirstAttribute(node);
- node != END;
- node = getNextAttribute(node)) {
- if (getNSType(node) == nsType) {
- break;
- }
- }
-
- _currentNode = node;
- return resetPosition();
- }
-
- return this;
- }
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next() {
- int node = _currentNode;
- int nsType = _nsType;
- int nextNode;
-
- if (node == END) {
- return END;
- }
-
- for (nextNode = getNextAttribute(node);
- nextNode != END;
- nextNode = getNextAttribute(nextNode)) {
- if (getNSType(nextNode) == nsType) {
- break;
- }
- }
-
- _currentNode = nextNode;
-
- return returnNode(node);
- }
- } // end of NamespaceAttributeIterator
-
- /**
- * Returns an iterator with all descendants of a node that are of
- * a given type.
- */
- public DTMAxisIterator getTypedDescendantIterator(int type)
- {
- return new TypedDescendantIterator(type);
- }
-
- /**
- * Returns the nth descendant of a node
- */
- public DTMAxisIterator getNthDescendant(int type, int n, boolean includeself)
- {
- return new NthDescendantIterator(n);
- }
-
- /**
- * Copy the string value of a node directly to an output handler
- */
- public void characters(final int node, SerializationHandler handler)
- throws TransletException
- {
- if (node != DTM.NULL) {
- try {
- dispatchCharactersEvents(node, handler, false);
- } catch (SAXException e) {
- throw new TransletException(e);
- }
- }
- }
-
- /**
- * Copy a node-set to an output handler
- */
- public void copy(DTMAxisIterator nodes, SerializationHandler handler)
- throws TransletException
- {
- int node;
- while ((node = nodes.next()) != DTM.NULL) {
- copy(node, handler);
- }
- }
-
- /**
- * Copy the whole tree to an output handler
- */
- public void copy(SerializationHandler handler) throws TransletException
- {
- copy(getDocument(), handler);
- }
-
- /**
- * Performs a deep copy (ref. XSLs copy-of())
- *
- * TODO: Copy namespace declarations. Can't be done until we
- * add namespace nodes and keep track of NS prefixes
- * TODO: Copy comment nodes
- */
- public void copy(final int node, SerializationHandler handler)
- throws TransletException
- {
- copy(node, handler, false );
- }
-
-
- private final void copy(final int node, SerializationHandler handler, boolean isChild)
- throws TransletException
- {
- int nodeID = makeNodeIdentity(node);
- int eType = _exptype2(nodeID);
- int type = _exptype2Type(eType);
-
- try {
- switch(type)
- {
- case DTM.ROOT_NODE:
- case DTM.DOCUMENT_NODE:
- for(int c = _firstch2(nodeID); c != DTM.NULL; c = _nextsib2(c)) {
- copy(makeNodeHandle(c), handler, true);
- }
- break;
- case DTM.PROCESSING_INSTRUCTION_NODE:
- copyPI(node, handler);
- break;
- case DTM.COMMENT_NODE:
- handler.comment(getStringValueX(node));
- break;
- case DTM.TEXT_NODE:
- boolean oldEscapeSetting = false;
- boolean escapeBit = false;
-
- if (_dontEscape != null) {
- escapeBit = _dontEscape.getBit(getNodeIdent(node));
- if (escapeBit) {
- oldEscapeSetting = handler.setEscaping(false);
- }
- }
-
- copyTextNode(nodeID, handler);
-
- if (escapeBit) {
- handler.setEscaping(oldEscapeSetting);
- }
- break;
- case DTM.ATTRIBUTE_NODE:
- copyAttribute(nodeID, eType, handler);
- break;
- case DTM.NAMESPACE_NODE:
- handler.namespaceAfterStartElement(getNodeNameX(node), getNodeValue(node));
- break;
- default:
- if (type == DTM.ELEMENT_NODE)
- {
- // Start element definition
- final String name = copyElement(nodeID, eType, handler);
- //if(isChild) => not to copy any namespaces from parents
- // else copy all namespaces in scope
- copyNS(nodeID, handler,!isChild);
- copyAttributes(nodeID, handler);
- // Copy element children
- for (int c = _firstch2(nodeID); c != DTM.NULL; c = _nextsib2(c)) {
- copy(makeNodeHandle(c), handler, true);
- }
-
- // Close element definition
- handler.endElement(name);
- }
- // Shallow copy of attribute to output handler
- else {
- final String uri = getNamespaceName(node);
- if (uri.length() != 0) {
- final String prefix = getPrefix(node);
- handler.namespaceAfterStartElement(prefix, uri);
- }
- handler.addAttribute(getNodeName(node), getNodeValue(node));
- }
- break;
- }
- }
- catch (Exception e) {
- throw new TransletException(e);
- }
-
- }
- /**
- * Copies a processing instruction node to an output handler
- */
- private void copyPI(final int node, SerializationHandler handler)
- throws TransletException
- {
- final String target = getNodeName(node);
- final String value = getStringValueX(node);
-
- try {
- handler.processingInstruction(target, value);
- } catch (Exception e) {
- throw new TransletException(e);
- }
- }
-
- /**
- * Performs a shallow copy (ref. XSLs copy())
- */
- public String shallowCopy(final int node, SerializationHandler handler)
- throws TransletException
- {
- int nodeID = makeNodeIdentity(node);
- int exptype = _exptype2(nodeID);
- int type = _exptype2Type(exptype);
-
- try {
- switch(type)
- {
- case DTM.ELEMENT_NODE:
- final String name = copyElement(nodeID, exptype, handler);
- copyNS(nodeID, handler, true);
- return name;
- case DTM.ROOT_NODE:
- case DTM.DOCUMENT_NODE:
- return EMPTYSTRING;
- case DTM.TEXT_NODE:
- copyTextNode(nodeID, handler);
- return null;
- case DTM.PROCESSING_INSTRUCTION_NODE:
- copyPI(node, handler);
- return null;
- case DTM.COMMENT_NODE:
- handler.comment(getStringValueX(node));
- return null;
- case DTM.NAMESPACE_NODE:
- handler.namespaceAfterStartElement(getNodeNameX(node), getNodeValue(node));
- return null;
- case DTM.ATTRIBUTE_NODE:
- copyAttribute(nodeID, exptype, handler);
- return null;
- default:
- final String uri1 = getNamespaceName(node);
- if (uri1.length() != 0) {
- final String prefix = getPrefix(node);
- handler.namespaceAfterStartElement(prefix, uri1);
- }
- handler.addAttribute(getNodeName(node), getNodeValue(node));
- return null;
- }
- } catch (Exception e) {
- throw new TransletException(e);
- }
- }
-
- /**
- * Returns a node' defined language for a node (if any)
- */
- public String getLanguage(int node)
- {
- int parent = node;
- while (DTM.NULL != parent) {
- if (DTM.ELEMENT_NODE == getNodeType(parent)) {
- int langAttr = getAttributeNode(parent, "http://www.w3.org/XML/1998/namespace", "lang");
-
- if (DTM.NULL != langAttr) {
- return getNodeValue(langAttr);
- }
- }
-
- parent = getParent(parent);
- }
- return(null);
- }
-
- /**
- * Returns an instance of the DOMBuilder inner class
- * This class will consume the input document through a SAX2
- * interface and populate the tree.
- */
- public DOMBuilder getBuilder()
- {
- return this;
- }
-
- /**
- * Return a SerializationHandler for output handling.
- * This method is used by Result Tree Fragments.
- */
- public SerializationHandler getOutputDomBuilder()
- {
- return new ToXMLSAXHandler(this, "UTF-8");
- }
-
- /**
- * Return a instance of a DOM class to be used as an RTF
- */
- public DOM getResultTreeFrag(int initSize, int rtfType)
- {
- return getResultTreeFrag(initSize, rtfType, true);
- }
-
- /**
- * Return a instance of a DOM class to be used as an RTF
- *
- * @param initSize The initial size of the DOM.
- * @param rtfType The type of the RTF
- * @param addToManager true if the RTF should be registered with the DTMManager.
- * @return The DOM object which represents the RTF.
- */
- public DOM getResultTreeFrag(int initSize, int rtfType, boolean addToManager)
- {
- if (rtfType == DOM.SIMPLE_RTF) {
- if (addToManager) {
- int dtmPos = _dtmManager.getFirstFreeDTMID();
- SimpleResultTreeImpl rtf = new SimpleResultTreeImpl(_dtmManager,
- dtmPos << DTMManager.IDENT_DTM_NODE_BITS);
- _dtmManager.addDTM(rtf, dtmPos, 0);
- return rtf;
- }
- else {
- return new SimpleResultTreeImpl(_dtmManager, 0);
- }
- }
- else if (rtfType == DOM.ADAPTIVE_RTF) {
- if (addToManager) {
- int dtmPos = _dtmManager.getFirstFreeDTMID();
- AdaptiveResultTreeImpl rtf = new AdaptiveResultTreeImpl(_dtmManager,
- dtmPos << DTMManager.IDENT_DTM_NODE_BITS,
- m_wsfilter, initSize, m_buildIdIndex);
- _dtmManager.addDTM(rtf, dtmPos, 0);
- return rtf;
-
- }
- else {
- return new AdaptiveResultTreeImpl(_dtmManager, 0,
- m_wsfilter, initSize, m_buildIdIndex);
- }
- }
- else {
- return (DOM) _dtmManager.getDTM(null, true, m_wsfilter,
- true, false, false,
- initSize, m_buildIdIndex);
- }
- }
-
- /**
- * Return the attributes map.
- * @return the attributes map.
- */
- public Map<String, Integer> getElementsWithIDs() {
- return m_idAttributes;
- }
-
- /**
- * The getUnparsedEntityURI function returns the URI of the unparsed
- * entity with the specified name in the same document as the context
- * node (see [3.3 Unparsed Entities]). It returns the empty string if
- * there is no such entity.
- */
- public String getUnparsedEntityURI(String name)
- {
- // Special handling for DOM input
- if (_document != null) {
- String uri = "";
- DocumentType doctype = _document.getDoctype();
- if (doctype != null) {
- NamedNodeMap entities = doctype.getEntities();
-
- if (entities == null) {
- return uri;
- }
-
- Entity entity = (Entity) entities.getNamedItem(name);
-
- if (entity == null) {
- return uri;
- }
-
- String notationName = entity.getNotationName();
- if (notationName != null) {
- uri = entity.getSystemId();
- if (uri == null) {
- uri = entity.getPublicId();
- }
- }
- }
- return uri;
- }
- else {
- return super.getUnparsedEntityURI(name);
- }
- }
-
- public void release() {
- _dtmManager.release(this, true);
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/SimpleResultTreeImpl.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/SimpleResultTreeImpl.java
deleted file mode 100644
index 3d71c6d..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/SimpleResultTreeImpl.java
+++ /dev/null
@@ -1,1024 +0,0 @@
-/*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: SimpleResultTreeImpl.java,v 1.2.4.1 2005/09/06 10:09:25 pvedula Exp $
- */
-package com.sun.org.apache.xalan.internal.xsltc.dom;
-
-import com.sun.org.apache.xalan.internal.xsltc.DOM;
-import com.sun.org.apache.xalan.internal.xsltc.StripFilter;
-import com.sun.org.apache.xalan.internal.xsltc.TransletException;
-import com.sun.org.apache.xml.internal.dtm.Axis;
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
-import com.sun.org.apache.xml.internal.dtm.DTMAxisTraverser;
-import com.sun.org.apache.xml.internal.dtm.DTMManager;
-import com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase;
-import com.sun.org.apache.xml.internal.dtm.ref.DTMManagerDefault;
-import com.sun.org.apache.xml.internal.serializer.EmptySerializer;
-import com.sun.org.apache.xml.internal.serializer.SerializationHandler;
-import com.sun.org.apache.xml.internal.utils.XMLString;
-import com.sun.org.apache.xml.internal.utils.XMLStringDefault;
-import java.util.Map;
-import javax.xml.transform.SourceLocator;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.SAXException;
-
-/**
- * This class represents a light-weight DOM model for simple result tree fragment(RTF).
- * A simple RTF is an RTF that has only one Text node. The Text node can be produced by a
- * combination of Text, xsl:value-of and xsl:number instructions. It can also be produced
- * by a control structure (xsl:if or xsl:choose) whose body is pure Text.
- * <p>
- * A SimpleResultTreeImpl has only two nodes, i.e. the ROOT node and its Text child. All DOM
- * interfaces are overridden with this in mind. For example, the getStringValue() interface
- * returns the value of the Text node. This class receives the character data from the
- * characters() interface.
- * <p>
- * This class implements DOM and SerializationHandler. It also implements the DTM interface
- * for support in MultiDOM. The nested iterators (SimpleIterator and SingletonIterator) are
- * used to support the nodeset() extension function.
- */
-public class SimpleResultTreeImpl extends EmptySerializer implements DOM, DTM
-{
-
- /**
- * The SimpleIterator is designed to support the nodeset() extension function. It has
- * a traversal direction parameter. The DOWN direction is used for child and descendant
- * axes, while the UP direction is used for parent and ancestor axes.
- *
- * This iterator only handles two nodes (RTF_ROOT and RTF_TEXT). If the type is set,
- * it will also match the node type with the given type.
- */
- public final class SimpleIterator extends DTMAxisIteratorBase
- {
- static final int DIRECTION_UP = 0;
- static final int DIRECTION_DOWN = 1;
- static final int NO_TYPE = -1;
-
- // The direction of traversal (default to DOWN).
- // DOWN is for child and descendant. UP is for parent and ancestor.
- int _direction = DIRECTION_DOWN;
-
- int _type = NO_TYPE;
- int _currentNode;
-
- public SimpleIterator()
- {
- }
-
- public SimpleIterator(int direction)
- {
- _direction = direction;
- }
-
- public SimpleIterator(int direction, int type)
- {
- _direction = direction;
- _type = type;
- }
-
- public int next()
- {
- // Increase the node ID for down traversal. Also match the node type
- // if the type is given.
- if (_direction == DIRECTION_DOWN) {
- while (_currentNode < NUMBER_OF_NODES) {
- if (_type != NO_TYPE) {
- if ((_currentNode == RTF_ROOT && _type == DTM.ROOT_NODE)
- || (_currentNode == RTF_TEXT && _type == DTM.TEXT_NODE))
- return returnNode(getNodeHandle(_currentNode++));
- else
- _currentNode++;
- }
- else
- return returnNode(getNodeHandle(_currentNode++));
- }
-
- return END;
- }
- // Decrease the node ID for up traversal.
- else {
- while (_currentNode >= 0) {
- if (_type != NO_TYPE) {
- if ((_currentNode == RTF_ROOT && _type == DTM.ROOT_NODE)
- || (_currentNode == RTF_TEXT && _type == DTM.TEXT_NODE))
- return returnNode(getNodeHandle(_currentNode--));
- else
- _currentNode--;
- }
- else
- return returnNode(getNodeHandle(_currentNode--));
- }
-
- return END;
- }
- }
-
- public DTMAxisIterator setStartNode(int nodeHandle)
- {
- int nodeID = getNodeIdent(nodeHandle);
- _startNode = nodeID;
-
- // Increase the node ID by 1 if self is not included.
- if (!_includeSelf && nodeID != DTM.NULL) {
- if (_direction == DIRECTION_DOWN)
- nodeID++;
- else if (_direction == DIRECTION_UP)
- nodeID--;
- }
-
- _currentNode = nodeID;
- return this;
- }
-
- public void setMark()
- {
- _markedNode = _currentNode;
- }
-
- public void gotoMark()
- {
- _currentNode = _markedNode;
- }
-
- } // END of SimpleIterator
-
- /**
- * The SingletonIterator is used for the self axis.
- */
- public final class SingletonIterator extends DTMAxisIteratorBase
- {
- static final int NO_TYPE = -1;
- int _type = NO_TYPE;
- int _currentNode;
-
- public SingletonIterator()
- {
- }
-
- public SingletonIterator(int type)
- {
- _type = type;
- }
-
- public void setMark()
- {
- _markedNode = _currentNode;
- }
-
- public void gotoMark()
- {
- _currentNode = _markedNode;
- }
-
- public DTMAxisIterator setStartNode(int nodeHandle)
- {
- _currentNode = _startNode = getNodeIdent(nodeHandle);
- return this;
- }
-
- public int next()
- {
- if (_currentNode == END)
- return END;
-
- _currentNode = END;
-
- if (_type != NO_TYPE) {
- if ((_currentNode == RTF_ROOT && _type == DTM.ROOT_NODE)
- || (_currentNode == RTF_TEXT && _type == DTM.TEXT_NODE))
- return getNodeHandle(_currentNode);
- }
- else
- return getNodeHandle(_currentNode);
-
- return END;
- }
-
- } // END of SingletonIterator
-
- // empty iterator to be returned when there are no children
- private final static DTMAxisIterator EMPTY_ITERATOR =
- new DTMAxisIteratorBase() {
- public DTMAxisIterator reset() { return this; }
- public DTMAxisIterator setStartNode(int node) { return this; }
- public int next() { return DTM.NULL; }
- public void setMark() {}
- public void gotoMark() {}
- public int getLast() { return 0; }
- public int getPosition() { return 0; }
- public DTMAxisIterator cloneIterator() { return this; }
- public void setRestartable(boolean isRestartable) { }
- };
-
-
- // The root node id of the simple RTF
- public static final int RTF_ROOT = 0;
-
- // The Text node id of the simple RTF (simple RTF has only one Text node).
- public static final int RTF_TEXT = 1;
-
- // The number of nodes.
- public static final int NUMBER_OF_NODES = 2;
-
- // Document URI index, which increases by 1 at each getDocumentURI() call.
- private static int _documentURIIndex = 0;
-
- // Constant for empty String
- private static final String EMPTY_STR = "";
-
- // The String value of the Text node.
- // This is set at the endDocument() call.
- private String _text;
-
- // The array of Text items, which is built by the characters() call.
- // The characters() interface can be called multiple times. Each character item
- // can have different escape settings.
- protected String[] _textArray;
-
- // The DTMManager
- protected XSLTCDTMManager _dtmManager;
-
- // Number of character items
- protected int _size = 0;
-
- // The document ID
- private int _documentID;
-
- // A BitArray, each bit holding the escape setting for a character item.
- private BitArray _dontEscape = null;
-
- // The current escape setting
- private boolean _escaping = true;
-
- // Create a SimpleResultTreeImpl from a DTMManager and a document ID.
- public SimpleResultTreeImpl(XSLTCDTMManager dtmManager, int documentID)
- {
- _dtmManager = dtmManager;
- _documentID = documentID;
- _textArray = new String[4];
- }
-
- public DTMManagerDefault getDTMManager()
- {
- return _dtmManager;
- }
-
- // Return the document ID
- public int getDocument()
- {
- return _documentID;
- }
-
- // Return the String value of the RTF
- public String getStringValue()
- {
- return _text;
- }
-
- public DTMAxisIterator getIterator()
- {
- return new SingletonIterator(getDocument());
- }
-
- public DTMAxisIterator getChildren(final int node)
- {
- return new SimpleIterator().setStartNode(node);
- }
-
- public DTMAxisIterator getTypedChildren(final int type)
- {
- return new SimpleIterator(SimpleIterator.DIRECTION_DOWN, type);
- }
-
- // Return the axis iterator for a given axis.
- // The SimpleIterator is used for the child, descendant, parent and ancestor axes.
- public DTMAxisIterator getAxisIterator(final int axis)
- {
- switch (axis)
- {
- case Axis.CHILD:
- case Axis.DESCENDANT:
- return new SimpleIterator(SimpleIterator.DIRECTION_DOWN);
- case Axis.PARENT:
- case Axis.ANCESTOR:
- return new SimpleIterator(SimpleIterator.DIRECTION_UP);
- case Axis.ANCESTORORSELF:
- return (new SimpleIterator(SimpleIterator.DIRECTION_UP)).includeSelf();
- case Axis.DESCENDANTORSELF:
- return (new SimpleIterator(SimpleIterator.DIRECTION_DOWN)).includeSelf();
- case Axis.SELF:
- return new SingletonIterator();
- default:
- return EMPTY_ITERATOR;
- }
- }
-
- public DTMAxisIterator getTypedAxisIterator(final int axis, final int type)
- {
- switch (axis)
- {
- case Axis.CHILD:
- case Axis.DESCENDANT:
- return new SimpleIterator(SimpleIterator.DIRECTION_DOWN, type);
- case Axis.PARENT:
- case Axis.ANCESTOR:
- return new SimpleIterator(SimpleIterator.DIRECTION_UP, type);
- case Axis.ANCESTORORSELF:
- return (new SimpleIterator(SimpleIterator.DIRECTION_UP, type)).includeSelf();
- case Axis.DESCENDANTORSELF:
- return (new SimpleIterator(SimpleIterator.DIRECTION_DOWN, type)).includeSelf();
- case Axis.SELF:
- return new SingletonIterator(type);
- default:
- return EMPTY_ITERATOR;
- }
- }
-
- // %REVISIT% Can this one ever get used?
- public DTMAxisIterator getNthDescendant(int node, int n, boolean includeself)
- {
- return null;
- }
-
- public DTMAxisIterator getNamespaceAxisIterator(final int axis, final int ns)
- {
- return null;
- }
-
- // %REVISIT% Can this one ever get used?
- public DTMAxisIterator getNodeValueIterator(DTMAxisIterator iter, int returnType,
- String value, boolean op)
- {
- return null;
- }
-
- public DTMAxisIterator orderNodes(DTMAxisIterator source, int node)
- {
- return source;
- }
-
- public String getNodeName(final int node)
- {
- if (getNodeIdent(node) == RTF_TEXT)
- return "#text";
- else
- return EMPTY_STR;
- }
-
- public String getNodeNameX(final int node)
- {
- return EMPTY_STR;
- }
-
- public String getNamespaceName(final int node)
- {
- return EMPTY_STR;
- }
-
- // Return the expanded type id of a given node
- public int getExpandedTypeID(final int nodeHandle)
- {
- int nodeID = getNodeIdent(nodeHandle);
- if (nodeID == RTF_TEXT)
- return DTM.TEXT_NODE;
- else if (nodeID == RTF_ROOT)
- return DTM.ROOT_NODE;
- else
- return DTM.NULL;
- }
-
- public int getNamespaceType(final int node)
- {
- return 0;
- }
-
- public int getParent(final int nodeHandle)
- {
- int nodeID = getNodeIdent(nodeHandle);
- return (nodeID == RTF_TEXT) ? getNodeHandle(RTF_ROOT) : DTM.NULL;
- }
-
- public int getAttributeNode(final int gType, final int element)
- {
- return DTM.NULL;
- }
-
- public String getStringValueX(final int nodeHandle)
- {
- int nodeID = getNodeIdent(nodeHandle);
- if (nodeID == RTF_ROOT || nodeID == RTF_TEXT)
- return _text;
- else
- return EMPTY_STR;
- }
-
- public void copy(final int node, SerializationHandler handler)
- throws TransletException
- {
- characters(node, handler);
- }
-
- public void copy(DTMAxisIterator nodes, SerializationHandler handler)
- throws TransletException
- {
- int node;
- while ((node = nodes.next()) != DTM.NULL)
- {
- copy(node, handler);
- }
- }
-
- public String shallowCopy(final int node, SerializationHandler handler)
- throws TransletException
- {
- characters(node, handler);
- return null;
- }
-
- public boolean lessThan(final int node1, final int node2)
- {
- if (node1 == DTM.NULL) {
- return false;
- }
- else if (node2 == DTM.NULL) {
- return true;
- }
- else
- return (node1 < node2);
- }
-
- /**
- * Dispatch the character content of a node to an output handler.
- *
- * The escape setting should be taken care of when outputting to
- * a handler.
- */
- public void characters(final int node, SerializationHandler handler)
- throws TransletException
- {
- int nodeID = getNodeIdent(node);
- if (nodeID == RTF_ROOT || nodeID == RTF_TEXT) {
- boolean escapeBit = false;
- boolean oldEscapeSetting = false;
-
- try {
- for (int i = 0; i < _size; i++) {
-
- if (_dontEscape != null) {
- escapeBit = _dontEscape.getBit(i);
- if (escapeBit) {
- oldEscapeSetting = handler.setEscaping(false);
- }
- }
-
- handler.characters(_textArray[i]);
-
- if (escapeBit) {
- handler.setEscaping(oldEscapeSetting);
- }
- }
- } catch (SAXException e) {
- throw new TransletException(e);
- }
- }
- }
-
- // %REVISIT% Can the makeNode() and makeNodeList() interfaces ever get used?
- public Node makeNode(int index)
- {
- return null;
- }
-
- public Node makeNode(DTMAxisIterator iter)
- {
- return null;
- }
-
- public NodeList makeNodeList(int index)
- {
- return null;
- }
-
- public NodeList makeNodeList(DTMAxisIterator iter)
- {
- return null;
- }
-
- public String getLanguage(int node)
- {
- return null;
- }
-
- public int getSize()
- {
- return 2;
- }
-
- public String getDocumentURI(int node)
- {
- return "simple_rtf" + _documentURIIndex++;
- }
-
- public void setFilter(StripFilter filter)
- {
- }
-
- public void setupMapping(String[] names, String[] uris, int[] types, String[] namespaces)
- {
- }
-
- public boolean isElement(final int node)
- {
- return false;
- }
-
- public boolean isAttribute(final int node)
- {
- return false;
- }
-
- public String lookupNamespace(int node, String prefix)
- throws TransletException
- {
- return null;
- }
-
- /**
- * Return the node identity from a node handle.
- */
- public int getNodeIdent(final int nodehandle)
- {
- return (nodehandle != DTM.NULL) ? (nodehandle - _documentID) : DTM.NULL;
- }
-
- /**
- * Return the node handle from a node identity.
- */
- public int getNodeHandle(final int nodeId)
- {
- return (nodeId != DTM.NULL) ? (nodeId + _documentID) : DTM.NULL;
- }
-
- public DOM getResultTreeFrag(int initialSize, int rtfType)
- {
- return null;
- }
-
- public DOM getResultTreeFrag(int initialSize, int rtfType, boolean addToManager)
- {
- return null;
- }
-
- public SerializationHandler getOutputDomBuilder()
- {
- return this;
- }
-
- public int getNSType(int node)
- {
- return 0;
- }
-
- public String getUnparsedEntityURI(String name)
- {
- return null;
- }
-
- public Map<String, Integer> getElementsWithIDs()
- {
- return null;
- }
-
- /** Implementation of the SerializationHandler interfaces **/
-
- /**
- * We only need to override the endDocument, characters, and
- * setEscaping interfaces. A simple RTF does not have element
- * nodes. We do not need to touch startElement and endElement.
- */
-
- public void startDocument() throws SAXException
- {
-
- }
-
- public void endDocument() throws SAXException
- {
- // Set the String value when the document is built.
- if (_size == 1)
- _text = _textArray[0];
- else {
- StringBuffer buffer = new StringBuffer();
- for (int i = 0; i < _size; i++) {
- buffer.append(_textArray[i]);
- }
- _text = buffer.toString();
- }
- }
-
- public void characters(String str) throws SAXException
- {
- // Resize the text array if necessary
- if (_size >= _textArray.length) {
- String[] newTextArray = new String[_textArray.length * 2];
- System.arraycopy(_textArray, 0, newTextArray, 0, _textArray.length);
- _textArray = newTextArray;
- }
-
- // If the escape setting is false, set the corresponding bit in
- // the _dontEscape BitArray.
- if (!_escaping) {
- // The _dontEscape array is only created when needed.
- if (_dontEscape == null) {
- _dontEscape = new BitArray(8);
- }
-
- // Resize the _dontEscape array if necessary
- if (_size >= _dontEscape.size())
- _dontEscape.resize(_dontEscape.size() * 2);
-
- _dontEscape.setBit(_size);
- }
-
- _textArray[_size++] = str;
- }
-
- public void characters(char[] ch, int offset, int length)
- throws SAXException
- {
- if (_size >= _textArray.length) {
- String[] newTextArray = new String[_textArray.length * 2];
- System.arraycopy(_textArray, 0, newTextArray, 0, _textArray.length);
- _textArray = newTextArray;
- }
-
- if (!_escaping) {
- if (_dontEscape == null) {
- _dontEscape = new BitArray(8);
- }
-
- if (_size >= _dontEscape.size())
- _dontEscape.resize(_dontEscape.size() * 2);
-
- _dontEscape.setBit(_size);
- }
-
- _textArray[_size++] = new String(ch, offset, length);
-
- }
-
- public boolean setEscaping(boolean escape) throws SAXException
- {
- final boolean temp = _escaping;
- _escaping = escape;
- return temp;
- }
-
- /** Implementation of the DTM interfaces **/
-
- /**
- * The DTM interfaces are not used in this class. Implementing the DTM
- * interface is a requirement from MultiDOM. If we have a better way
- * of handling multiple documents, we can get rid of the DTM dependency.
- *
- * The following interfaces are just placeholders. The implementation
- * does not have an impact because they will not be used.
- */
-
- public void setFeature(String featureId, boolean state)
- {
- }
-
- public void setProperty(String property, Object value)
- {
- }
-
- public DTMAxisTraverser getAxisTraverser(final int axis)
- {
- return null;
- }
-
- public boolean hasChildNodes(int nodeHandle)
- {
- return (getNodeIdent(nodeHandle) == RTF_ROOT);
- }
-
- public int getFirstChild(int nodeHandle)
- {
- int nodeID = getNodeIdent(nodeHandle);
- if (nodeID == RTF_ROOT)
- return getNodeHandle(RTF_TEXT);
- else
- return DTM.NULL;
- }
-
- public int getLastChild(int nodeHandle)
- {
- return getFirstChild(nodeHandle);
- }
-
- public int getAttributeNode(int elementHandle, String namespaceURI, String name)
- {
- return DTM.NULL;
- }
-
- public int getFirstAttribute(int nodeHandle)
- {
- return DTM.NULL;
- }
-
- public int getFirstNamespaceNode(int nodeHandle, boolean inScope)
- {
- return DTM.NULL;
- }
-
- public int getNextSibling(int nodeHandle)
- {
- return DTM.NULL;
- }
-
- public int getPreviousSibling(int nodeHandle)
- {
- return DTM.NULL;
- }
-
- public int getNextAttribute(int nodeHandle)
- {
- return DTM.NULL;
- }
-
- public int getNextNamespaceNode(int baseHandle, int namespaceHandle,
- boolean inScope)
- {
- return DTM.NULL;
- }
-
- public int getOwnerDocument(int nodeHandle)
- {
- return getDocument();
- }
-
- public int getDocumentRoot(int nodeHandle)
- {
- return getDocument();
- }
-
- public XMLString getStringValue(int nodeHandle)
- {
- return new XMLStringDefault(getStringValueX(nodeHandle));
- }
-
- public int getStringValueChunkCount(int nodeHandle)
- {
- return 0;
- }
-
- public char[] getStringValueChunk(int nodeHandle, int chunkIndex,
- int[] startAndLen)
- {
- return null;
- }
-
- public int getExpandedTypeID(String namespace, String localName, int type)
- {
- return DTM.NULL;
- }
-
- public String getLocalNameFromExpandedNameID(int ExpandedNameID)
- {
- return EMPTY_STR;
- }
-
- public String getNamespaceFromExpandedNameID(int ExpandedNameID)
- {
- return EMPTY_STR;
- }
-
- public String getLocalName(int nodeHandle)
- {
- return EMPTY_STR;
- }
-
- public String getPrefix(int nodeHandle)
- {
- return null;
- }
-
- public String getNamespaceURI(int nodeHandle)
- {
- return EMPTY_STR;
- }
-
- public String getNodeValue(int nodeHandle)
- {
- return (getNodeIdent(nodeHandle) == RTF_TEXT) ? _text : null;
- }
-
- public short getNodeType(int nodeHandle)
- {
- int nodeID = getNodeIdent(nodeHandle);
- if (nodeID == RTF_TEXT)
- return DTM.TEXT_NODE;
- else if (nodeID == RTF_ROOT)
- return DTM.ROOT_NODE;
- else
- return DTM.NULL;
-
- }
-
- public short getLevel(int nodeHandle)
- {
- int nodeID = getNodeIdent(nodeHandle);
- if (nodeID == RTF_TEXT)
- return 2;
- else if (nodeID == RTF_ROOT)
- return 1;
- else
- return DTM.NULL;
- }
-
- public boolean isSupported(String feature, String version)
- {
- return false;
- }
-
- public String getDocumentBaseURI()
- {
- return EMPTY_STR;
- }
-
- public void setDocumentBaseURI(String baseURI)
- {
- }
-
- public String getDocumentSystemIdentifier(int nodeHandle)
- {
- return null;
- }
-
- public String getDocumentEncoding(int nodeHandle)
- {
- return null;
- }
-
- public String getDocumentStandalone(int nodeHandle)
- {
- return null;
- }
-
- public String getDocumentVersion(int documentHandle)
- {
- return null;
- }
-
- public boolean getDocumentAllDeclarationsProcessed()
- {
- return false;
- }
-
- public String getDocumentTypeDeclarationSystemIdentifier()
- {
- return null;
- }
-
- public String getDocumentTypeDeclarationPublicIdentifier()
- {
- return null;
- }
-
- public int getElementById(String elementId)
- {
- return DTM.NULL;
- }
-
- public boolean supportsPreStripping()
- {
- return false;
- }
-
- public boolean isNodeAfter(int firstNodeHandle, int secondNodeHandle)
- {
- return lessThan(firstNodeHandle, secondNodeHandle);
- }
-
- public boolean isCharacterElementContentWhitespace(int nodeHandle)
- {
- return false;
- }
-
- public boolean isDocumentAllDeclarationsProcessed(int documentHandle)
- {
- return false;
- }
-
- public boolean isAttributeSpecified(int attributeHandle)
- {
- return false;
- }
-
- public void dispatchCharactersEvents(
- int nodeHandle,
- org.xml.sax.ContentHandler ch,
- boolean normalize)
- throws org.xml.sax.SAXException
- {
- }
-
- public void dispatchToEvents(int nodeHandle, org.xml.sax.ContentHandler ch)
- throws org.xml.sax.SAXException
- {
- }
-
- public org.w3c.dom.Node getNode(int nodeHandle)
- {
- return makeNode(nodeHandle);
- }
-
- public boolean needsTwoThreads()
- {
- return false;
- }
-
- public org.xml.sax.ContentHandler getContentHandler()
- {
- return null;
- }
-
- public org.xml.sax.ext.LexicalHandler getLexicalHandler()
- {
- return null;
- }
-
- public org.xml.sax.EntityResolver getEntityResolver()
- {
- return null;
- }
-
- public org.xml.sax.DTDHandler getDTDHandler()
- {
- return null;
- }
-
- public org.xml.sax.ErrorHandler getErrorHandler()
- {
- return null;
- }
-
- public org.xml.sax.ext.DeclHandler getDeclHandler()
- {
- return null;
- }
-
- public void appendChild(int newChild, boolean clone, boolean cloneDepth)
- {
- }
-
- public void appendTextChild(String str)
- {
- }
-
- public SourceLocator getSourceLocatorFor(int node)
- {
- return null;
- }
-
- public void documentRegistration()
- {
- }
-
- public void documentRelease()
- {
- }
-
- public void migrateTo(DTMManager manager)
- {
- }
-
- public void release()
- {
- if (_documentID != 0) {
- _dtmManager.release(this, true);
- _documentID = 0;
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/SingleNodeCounter.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/SingleNodeCounter.java
deleted file mode 100644
index 2042e4a..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/SingleNodeCounter.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: SingleNodeCounter.java,v 1.2.4.1 2005/09/12 11:58:23 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.dom;
-
-import com.sun.org.apache.xalan.internal.xsltc.DOM;
-import com.sun.org.apache.xalan.internal.xsltc.Translet;
-import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
-import com.sun.org.apache.xml.internal.dtm.Axis;
-
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-public abstract class SingleNodeCounter extends NodeCounter {
- static private final int[] EmptyArray = new int[] { };
- DTMAxisIterator _countSiblings = null;
-
- public SingleNodeCounter(Translet translet,
- DOM document,
- DTMAxisIterator iterator) {
- super(translet, document, iterator);
- }
-
- public SingleNodeCounter(Translet translet,
- DOM document,
- DTMAxisIterator iterator,
- boolean hasFrom) {
- super(translet, document, iterator, hasFrom);
- }
-
- public NodeCounter setStartNode(int node) {
- _node = node;
- _nodeType = _document.getExpandedTypeID(node);
- _countSiblings = _document.getAxisIterator(Axis.PRECEDINGSIBLING);
- return this;
- }
-
- public String getCounter() {
- int result;
- if (_value != Integer.MIN_VALUE) {
- //See Errata E24
- if (_value == 0) return "0";
- else if (Double.isNaN(_value)) return "NaN";
- else if (_value < 0 && Double.isInfinite(_value)) return "-Infinity";
- else if (Double.isInfinite(_value)) return "Infinity";
- else result = (int) _value;
- }
- else {
- int next = _node;
- result = 0;
- boolean matchesCount = matchesCount(next);
-
- if (!matchesCount) {
- while ((next = _document.getParent(next)) > END) {
- if (matchesCount(next)) {
- break; // found target
- }
- if (matchesFrom(next)) {
- next = END;
- break; // no target found
- }
- }
- }
-
- if (next != END) {
- int from = next;
-
- if (!matchesCount && _hasFrom) {
- // Target found, but need to check if ancestor matches from
- while ((from = _document.getParent(from)) > END) {
- if (matchesFrom(from)) {
- break; // found from
- }
- }
- }
-
- // Have we found ancestor matching from?
- if (from != END) {
- _countSiblings.setStartNode(next);
- do {
- if (matchesCount(next)) result++;
- } while ((next = _countSiblings.next()) != END);
-
- return formatNumbers(result);
- }
- }
-
- // If no target found then pass the empty list
- return formatNumbers(EmptyArray);
- }
- return formatNumbers(result);
- }
-
- public static NodeCounter getDefaultNodeCounter(Translet translet,
- DOM document,
- DTMAxisIterator iterator) {
- return new DefaultSingleNodeCounter(translet, document, iterator);
- }
-
- static class DefaultSingleNodeCounter extends SingleNodeCounter {
- public DefaultSingleNodeCounter(Translet translet,
- DOM document, DTMAxisIterator iterator) {
- super(translet, document, iterator);
- }
-
- public NodeCounter setStartNode(int node) {
- _node = node;
- _nodeType = _document.getExpandedTypeID(node);
- _countSiblings =
- _document.getTypedAxisIterator(Axis.PRECEDINGSIBLING,
- _document.getExpandedTypeID(node));
- return this;
- }
-
- public String getCounter() {
- int result;
- if (_value != Integer.MIN_VALUE) {
- //See Errata E24
- if (_value == 0) return "0";
- else if (Double.isNaN(_value)) return "NaN";
- else if (_value < 0 && Double.isInfinite(_value)) return "-Infinity";
- else if (Double.isInfinite(_value)) return "Infinity";
- else result = (int) _value;
- }
- else {
- int next;
- result = 1;
- _countSiblings.setStartNode(_node);
- while ((next = _countSiblings.next()) != END) {
- result++;
- }
- }
- return formatNumbers(result);
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/SingletonIterator.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/SingletonIterator.java
deleted file mode 100644
index 0e8daca..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/SingletonIterator.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: SingletonIterator.java,v 1.2.4.1 2005/09/06 10:15:18 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.dom;
-
-import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
-import com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-public class SingletonIterator extends DTMAxisIteratorBase {
- private int _node;
- private final boolean _isConstant;
-
- public SingletonIterator() {
- this(Integer.MIN_VALUE, false);
- }
-
- public SingletonIterator(int node) {
- this(node, false);
- }
-
- public SingletonIterator(int node, boolean constant) {
- _node = _startNode = node;
- _isConstant = constant;
- }
-
- /**
- * Override the value of <tt>_node</tt> only when this
- * object was constructed using the empty constructor.
- */
- public DTMAxisIterator setStartNode(int node) {
- if (_isConstant) {
- _node = _startNode;
- return resetPosition();
- }
- else if (_isRestartable) {
- if (_node <= 0)
- _node = _startNode = node;
- return resetPosition();
- }
- return this;
- }
-
- public DTMAxisIterator reset() {
- if (_isConstant) {
- _node = _startNode;
- return resetPosition();
- }
- else {
- final boolean temp = _isRestartable;
- _isRestartable = true;
- setStartNode(_startNode);
- _isRestartable = temp;
- }
- return this;
- }
-
- public int next() {
- final int result = _node;
- _node = DTMAxisIterator.END;
- return returnNode(result);
- }
-
- public void setMark() {
- _markedNode = _node;
- }
-
- public void gotoMark() {
- _node = _markedNode;
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/SortSettings.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/SortSettings.java
deleted file mode 100644
index 631c5e7..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/SortSettings.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: SortSettings.java,v 1.2.4.1 2005/09/06 10:19:22 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.dom;
-
-import java.text.Collator;
-import java.util.Locale;
-
-import com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet;
-
-/**
- * Class for carrying settings that are to be used for a particular set
- * of <code>xsl:sort</code> elements.
- */
-final class SortSettings {
- /**
- * A reference to the translet object for the transformation.
- */
- private AbstractTranslet _translet;
-
- /**
- * The sort order (ascending or descending) for each level of
- * <code>xsl:sort</code>
- */
- private int[] _sortOrders;
-
- /**
- * The type of comparison (text or number) for each level of
- * <code>xsl:sort</code>
- */
- private int[] _types;
-
- /**
- * The Locale for each level of <code>xsl:sort</code>, based on any lang
- * attribute or the default Locale.
- */
- private Locale[] _locales;
-
- /**
- * The Collator object in effect for each level of <code>xsl:sort</code>
- */
- private Collator[] _collators;
-
- /**
- * Case ordering for each level of <code>xsl:sort</code>.
- */
- private String[] _caseOrders;
-
- /**
- * Create an instance of <code>SortSettings</code>.
- * @param translet {@link com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet}
- * object for the transformation
- * @param sortOrders an array specifying the sort order for each sort level
- * @param types an array specifying the type of comparison for each sort
- * level (text or number)
- * @param locales an array specifying the Locale for each sort level
- * @param collators an array specifying the Collation in effect for each
- * sort level
- * @param caseOrders an array specifying whether upper-case, lower-case
- * or neither is to take precedence for each sort level.
- * The value of each element is equal to one of
- * <code>"upper-first", "lower-first", or ""</code>.
- */
- SortSettings(AbstractTranslet translet, int[] sortOrders, int[] types,
- Locale[] locales, Collator[] collators, String[] caseOrders) {
- _translet = translet;
- _sortOrders = sortOrders;
- _types = types;
- _locales = locales;
- _collators = collators;
- _caseOrders = caseOrders;
- }
-
- /**
- * @return A reference to the translet object for the transformation.
- */
- AbstractTranslet getTranslet() {
- return _translet;
- }
-
- /**
- * @return An array containing the sort order (ascending or descending)
- * for each level of <code>xsl:sort</code>
- */
- int[] getSortOrders() {
- return _sortOrders;
- }
-
- /**
- * @return An array containing the type of comparison (text or number)
- * to perform for each level of <code>xsl:sort</code>
- */
- int[] getTypes() {
- return _types;
- }
-
- /**
- * @return An array containing the Locale object in effect for each level
- * of <code>xsl:sort</code>
- */
- Locale[] getLocales() {
- return _locales;
- }
-
- /**
- * @return An array containing the Collator object in effect for each level
- * of <code>xsl:sort</code>
- */
- Collator[] getCollators() {
- return _collators;
- }
-
- /**
- * @return An array specifying the case ordering for each level of
- * <code>xsl:sort</code>.
- */
- String[] getCaseOrders() {
- return _caseOrders;
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/SortingIterator.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/SortingIterator.java
deleted file mode 100644
index eff263a..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/SortingIterator.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: SortingIterator.java,v 1.2.4.1 2005/09/06 10:23:32 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.dom;
-
-import com.sun.org.apache.xalan.internal.xsltc.runtime.BasisLibrary;
-import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
-import com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- */
-public final class SortingIterator extends DTMAxisIteratorBase {
- private final static int INIT_DATA_SIZE = 16;
-
- private DTMAxisIterator _source;
- private NodeSortRecordFactory _factory;
-
- private NodeSortRecord[] _data;
- private int _free = 0;
- private int _current; // index in _nodes of the next node to try
-
- public SortingIterator(DTMAxisIterator source,
- NodeSortRecordFactory factory) {
- _source = source;
- _factory = factory;
- }
-
- public int next() {
- return _current < _free ? _data[_current++].getNode() : END;
- }
-
- public DTMAxisIterator setStartNode(int node) {
- try {
- _source.setStartNode(_startNode = node);
- _data = new NodeSortRecord[INIT_DATA_SIZE];
- _free = 0;
-
- // gather all nodes from the source iterator
- while ((node = _source.next()) != END) {
- addRecord(_factory.makeNodeSortRecord(node,_free));
- }
- // now sort the records
- quicksort(0, _free - 1);
-
- _current = 0;
- return this;
- }
- catch (Exception e) {
- return this;
- }
- }
-
- public int getPosition() {
- return _current == 0 ? 1 : _current;
- }
-
- public int getLast() {
- return _free;
- }
-
- public void setMark() {
- _source.setMark();
- _markedNode = _current;
- }
-
- public void gotoMark() {
- _source.gotoMark();
- _current = _markedNode;
- }
-
- /**
- * Clone a <code>SortingIterator</code> by cloning its source
- * iterator and then sharing the factory and the array of
- * <code>NodeSortRecords</code>.
- */
- public DTMAxisIterator cloneIterator() {
- try {
- final SortingIterator clone = (SortingIterator) super.clone();
- clone._source = _source.cloneIterator();
- clone._factory = _factory; // shared between clones
- clone._data = _data; // shared between clones
- clone._free = _free;
- clone._current = _current;
- clone.setRestartable(false);
- return clone.reset();
- }
- catch (CloneNotSupportedException e) {
- BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR,
- e.toString());
- return null;
- }
- }
-
- private void addRecord(NodeSortRecord record) {
- if (_free == _data.length) {
- NodeSortRecord[] newArray = new NodeSortRecord[_data.length * 2];
- System.arraycopy(_data, 0, newArray, 0, _free);
- _data = newArray;
- }
- _data[_free++] = record;
- }
-
- private void quicksort(int p, int r) {
- while (p < r) {
- final int q = partition(p, r);
- quicksort(p, q);
- p = q + 1;
- }
- }
-
- private int partition(int p, int r) {
- final NodeSortRecord x = _data[(p + r) >>> 1];
- int i = p - 1;
- int j = r + 1;
- while (true) {
- while (x.compareTo(_data[--j]) < 0);
- while (x.compareTo(_data[++i]) > 0);
- if (i < j) {
- final NodeSortRecord t = _data[i];
- _data[i] = _data[j];
- _data[j] = t;
- }
- else {
- return(j);
- }
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/StepIterator.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/StepIterator.java
deleted file mode 100644
index 3acec74..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/StepIterator.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: StepIterator.java,v 1.2.4.1 2005/09/06 10:26:47 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.dom;
-
-import com.sun.org.apache.xalan.internal.xsltc.runtime.BasisLibrary;
-import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
-import com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase;
-
-/**
- * A step iterator is used to evaluate expressions like "BOOK/TITLE".
- * A better name for this iterator would have been ParentIterator since
- * both "BOOK" and "TITLE" are steps in XPath lingo. Step iterators are
- * constructed from two other iterators which we are going to refer to
- * as "outer" and "inner". Every node from the outer iterator (the one
- * for BOOK in our example) is used to initialize the inner iterator.
- * After this initialization, every node from the inner iterator is
- * returned (in essence, implementing a "nested loop").
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Erwin Bolwidt <ejb@klomp.org>
- * @author Morten Jorgensen
- */
-public class StepIterator extends DTMAxisIteratorBase {
-
- /**
- * A reference to the "outer" iterator.
- */
- protected DTMAxisIterator _source;
-
- /**
- * A reference to the "inner" iterator.
- */
- protected DTMAxisIterator _iterator;
-
- /**
- * Temp variable to store a marked position.
- */
- private int _pos = -1;
-
- public StepIterator(DTMAxisIterator source, DTMAxisIterator iterator) {
- _source = source;
- _iterator = iterator;
-// System.out.println("SI source = " + source + " this = " + this);
-// System.out.println("SI iterator = " + iterator + " this = " + this);
- }
-
-
- public void setRestartable(boolean isRestartable) {
- _isRestartable = isRestartable;
- _source.setRestartable(isRestartable);
- _iterator.setRestartable(true); // must be restartable
- }
-
- public DTMAxisIterator cloneIterator() {
- _isRestartable = false;
- try {
- final StepIterator clone = (StepIterator) super.clone();
- clone._source = _source.cloneIterator();
- clone._iterator = _iterator.cloneIterator();
- clone._iterator.setRestartable(true); // must be restartable
- clone._isRestartable = false;
- return clone.reset();
- }
- catch (CloneNotSupportedException e) {
- BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR,
- e.toString());
- return null;
- }
- }
-
- public DTMAxisIterator setStartNode(int node) {
- if (_isRestartable) {
- // Set start node for left-hand iterator...
- _source.setStartNode(_startNode = node);
-
- // ... and get start node for right-hand iterator from left-hand,
- // with special case for //* path - see ParentLocationPath
- _iterator.setStartNode(_includeSelf ? _startNode : _source.next());
- return resetPosition();
- }
- return this;
- }
-
- public DTMAxisIterator reset() {
- _source.reset();
- // Special case for //* path - see ParentLocationPath
- _iterator.setStartNode(_includeSelf ? _startNode : _source.next());
- return resetPosition();
- }
-
- public int next() {
- for (int node;;) {
- // Try to get another node from the right-hand iterator
- if ((node = _iterator.next()) != END) {
- return returnNode(node);
- }
- // If not, get the next starting point from left-hand iterator...
- else if ((node = _source.next()) == END) {
- return END;
- }
- // ...and pass it on to the right-hand iterator
- else {
- _iterator.setStartNode(node);
- }
- }
- }
-
- public void setMark() {
- _source.setMark();
- _iterator.setMark();
- //_pos = _position;
- }
-
- public void gotoMark() {
- _source.gotoMark();
- _iterator.gotoMark();
- //_position = _pos;
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/StripWhitespaceFilter.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/StripWhitespaceFilter.java
deleted file mode 100644
index 8218009..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/StripWhitespaceFilter.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: StripWhitespaceFilter.java,v 1.2.4.1 2005/09/06 10:32:05 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.dom;
-
-import com.sun.org.apache.xalan.internal.xsltc.DOM;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-public interface StripWhitespaceFilter {
- public boolean stripSpace(DOM dom, int node, int type);
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/UnionIterator.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/UnionIterator.java
deleted file mode 100644
index d054c7e..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/UnionIterator.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: UnionIterator.java,v 1.5 2005/09/28 13:48:38 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.dom;
-
-import com.sun.org.apache.xalan.internal.xsltc.DOM;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.BasisLibrary;
-import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
-import com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase;
-
-/**
- * UnionIterator takes a set of NodeIterators and produces
- * a merged NodeSet in document order with duplicates removed
- * The individual iterators are supposed to generate nodes
- * in document order
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-public final class UnionIterator extends MultiValuedNodeHeapIterator {
- /** wrapper for NodeIterators to support iterator
- comparison on the value of their next() method
- */
- final private DOM _dom;
-
- private final class LookAheadIterator
- extends MultiValuedNodeHeapIterator.HeapNode
- {
- public DTMAxisIterator iterator;
-
- public LookAheadIterator(DTMAxisIterator iterator) {
- super();
- this.iterator = iterator;
- }
-
- public int step() {
- _node = iterator.next();
- return _node;
- }
-
- public HeapNode cloneHeapNode() {
- LookAheadIterator clone = (LookAheadIterator) super.cloneHeapNode();
- clone.iterator = iterator.cloneIterator();
- return clone;
- }
-
- public void setMark() {
- super.setMark();
- iterator.setMark();
- }
-
- public void gotoMark() {
- super.gotoMark();
- iterator.gotoMark();
- }
-
- public boolean isLessThan(HeapNode heapNode) {
- LookAheadIterator comparand = (LookAheadIterator) heapNode;
- return _dom.lessThan(_node, heapNode._node);
- }
-
- public HeapNode setStartNode(int node) {
- iterator.setStartNode(node);
- return this;
- }
-
- public HeapNode reset() {
- iterator.reset();
- return this;
- }
- } // end of LookAheadIterator
-
- public UnionIterator(DOM dom) {
- _dom = dom;
- }
-
- public UnionIterator addIterator(DTMAxisIterator iterator) {
- addHeapNode(new LookAheadIterator(iterator));
- return this;
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/XSLTCDTMManager.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/XSLTCDTMManager.java
deleted file mode 100644
index 0cc6d07..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/XSLTCDTMManager.java
+++ /dev/null
@@ -1,448 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XSLTCDTMManager.java,v 1.2 2005/08/16 22:32:54 jeffsuttor Exp $
- */
-package com.sun.org.apache.xalan.internal.xsltc.dom;
-
-import javax.xml.stream.XMLEventReader;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.transform.Source;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.transform.stax.StAXSource;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.ref.DTMDefaultBase;
-import com.sun.org.apache.xml.internal.dtm.DTMException;
-import com.sun.org.apache.xml.internal.dtm.DTMWSFilter;
-import com.sun.org.apache.xml.internal.dtm.ref.DTMManagerDefault;
-import com.sun.org.apache.xml.internal.res.XMLErrorResources;
-import com.sun.org.apache.xml.internal.res.XMLMessages;
-import com.sun.org.apache.xml.internal.utils.SystemIDResolver;
-import com.sun.org.apache.xalan.internal.xsltc.trax.DOM2SAX;
-import com.sun.org.apache.xalan.internal.xsltc.trax.StAXEvent2SAX;
-import com.sun.org.apache.xalan.internal.xsltc.trax.StAXStream2SAX;
-
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
-import org.xml.sax.XMLReader;
-
-/**
- * The default implementation for the DTMManager.
- */
-public class XSLTCDTMManager extends DTMManagerDefault
-{
-
- /** Set this to true if you want a dump of the DTM after creation */
- private static final boolean DUMPTREE = false;
-
- /** Set this to true if you want basic diagnostics */
- private static final boolean DEBUG = false;
-
- /**
- * Constructor DTMManagerDefault
- *
- */
- public XSLTCDTMManager()
- {
- super();
- }
-
- /**
- * Obtain a new instance of a <code>DTMManager</code>.
- * This static method creates a new factory instance.
- * The current implementation just returns a new XSLTCDTMManager instance.
- */
- public static XSLTCDTMManager newInstance()
- {
- return new XSLTCDTMManager();
- }
-
- /**
- * Creates a new instance of the XSLTC DTM Manager service.
- * Creates a new instance of the default class
- * <code>com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager</code>.
- */
- public static XSLTCDTMManager createNewDTMManagerInstance() {
- return newInstance();
- }
-
- /**
- * Get an instance of a DTM, loaded with the content from the
- * specified source. If the unique flag is true, a new instance will
- * always be returned. Otherwise it is up to the DTMManager to return a
- * new instance or an instance that it already created and may be being used
- * by someone else.
- * (I think more parameters will need to be added for error handling, and
- * entity resolution).
- *
- * @param source the specification of the source object.
- * @param unique true if the returned DTM must be unique, probably because it
- * is going to be mutated.
- * @param whiteSpaceFilter Enables filtering of whitespace nodes, and may
- * be null.
- * @param incremental true if the DTM should be built incrementally, if
- * possible.
- * @param doIndexing true if the caller considers it worth it to use
- * indexing schemes.
- *
- * @return a non-null DTM reference.
- */
- @Override
- public DTM getDTM(Source source, boolean unique,
- DTMWSFilter whiteSpaceFilter, boolean incremental,
- boolean doIndexing)
- {
- return getDTM(source, unique, whiteSpaceFilter, incremental,
- doIndexing, false, 0, true, false);
- }
-
- /**
- * Get an instance of a DTM, loaded with the content from the
- * specified source. If the unique flag is true, a new instance will
- * always be returned. Otherwise it is up to the DTMManager to return a
- * new instance or an instance that it already created and may be being used
- * by someone else.
- * (I think more parameters will need to be added for error handling, and
- * entity resolution).
- *
- * @param source the specification of the source object.
- * @param unique true if the returned DTM must be unique, probably because it
- * is going to be mutated.
- * @param whiteSpaceFilter Enables filtering of whitespace nodes, and may
- * be null.
- * @param incremental true if the DTM should be built incrementally, if
- * possible.
- * @param doIndexing true if the caller considers it worth it to use
- * indexing schemes.
- * @param buildIdIndex true if the id index table should be built.
- *
- * @return a non-null DTM reference.
- */
- public DTM getDTM(Source source, boolean unique,
- DTMWSFilter whiteSpaceFilter, boolean incremental,
- boolean doIndexing, boolean buildIdIndex)
- {
- return getDTM(source, unique, whiteSpaceFilter, incremental,
- doIndexing, false, 0, buildIdIndex, false);
- }
-
- /**
- * Get an instance of a DTM, loaded with the content from the
- * specified source. If the unique flag is true, a new instance will
- * always be returned. Otherwise it is up to the DTMManager to return a
- * new instance or an instance that it already created and may be being used
- * by someone else.
- * (I think more parameters will need to be added for error handling, and
- * entity resolution).
- *
- * @param source the specification of the source object.
- * @param unique true if the returned DTM must be unique, probably because it
- * is going to be mutated.
- * @param whiteSpaceFilter Enables filtering of whitespace nodes, and may
- * be null.
- * @param incremental true if the DTM should be built incrementally, if
- * possible.
- * @param doIndexing true if the caller considers it worth it to use
- * indexing schemes.
- * @param buildIdIndex true if the id index table should be built.
- * @param newNameTable true if we want to use a separate ExpandedNameTable
- * for this DTM.
- *
- * @return a non-null DTM reference.
- */
- public DTM getDTM(Source source, boolean unique,
- DTMWSFilter whiteSpaceFilter, boolean incremental,
- boolean doIndexing, boolean buildIdIndex,
- boolean newNameTable)
- {
- return getDTM(source, unique, whiteSpaceFilter, incremental,
- doIndexing, false, 0, buildIdIndex, newNameTable);
- }
-
- /**
- * Get an instance of a DTM, loaded with the content from the
- * specified source. If the unique flag is true, a new instance will
- * always be returned. Otherwise it is up to the DTMManager to return a
- * new instance or an instance that it already created and may be being used
- * by someone else.
- * (I think more parameters will need to be added for error handling, and
- * entity resolution).
- *
- * @param source the specification of the source object.
- * @param unique true if the returned DTM must be unique, probably because it
- * is going to be mutated.
- * @param whiteSpaceFilter Enables filtering of whitespace nodes, and may
- * be null.
- * @param incremental true if the DTM should be built incrementally, if
- * possible.
- * @param doIndexing true if the caller considers it worth it to use
- * indexing schemes.
- * @param hasUserReader true if <code>source</code> is a
- * <code>SAXSource</code> object that has an
- * <code>XMLReader</code>, that was specified by the
- * user.
- * @param size Specifies initial size of tables that represent the DTM
- * @param buildIdIndex true if the id index table should be built.
- *
- * @return a non-null DTM reference.
- */
- public DTM getDTM(Source source, boolean unique,
- DTMWSFilter whiteSpaceFilter, boolean incremental,
- boolean doIndexing, boolean hasUserReader, int size,
- boolean buildIdIndex)
- {
- return getDTM(source, unique, whiteSpaceFilter, incremental,
- doIndexing, hasUserReader, size,
- buildIdIndex, false);
- }
-
- /**
- * Get an instance of a DTM, loaded with the content from the
- * specified source. If the unique flag is true, a new instance will
- * always be returned. Otherwise it is up to the DTMManager to return a
- * new instance or an instance that it already created and may be being used
- * by someone else.
- * (I think more parameters will need to be added for error handling, and
- * entity resolution).
- *
- * @param source the specification of the source object.
- * @param unique true if the returned DTM must be unique, probably because it
- * is going to be mutated.
- * @param whiteSpaceFilter Enables filtering of whitespace nodes, and may
- * be null.
- * @param incremental true if the DTM should be built incrementally, if
- * possible.
- * @param doIndexing true if the caller considers it worth it to use
- * indexing schemes.
- * @param hasUserReader true if <code>source</code> is a
- * <code>SAXSource</code> object that has an
- * <code>XMLReader</code>, that was specified by the
- * user.
- * @param size Specifies initial size of tables that represent the DTM
- * @param buildIdIndex true if the id index table should be built.
- * @param newNameTable true if we want to use a separate ExpandedNameTable
- * for this DTM.
- *
- * @return a non-null DTM reference.
- */
- public DTM getDTM(Source source, boolean unique,
- DTMWSFilter whiteSpaceFilter, boolean incremental,
- boolean doIndexing, boolean hasUserReader, int size,
- boolean buildIdIndex, boolean newNameTable)
- {
- if(DEBUG && null != source) {
- System.out.println("Starting "+
- (unique ? "UNIQUE" : "shared")+
- " source: "+source.getSystemId());
- }
-
- int dtmPos = getFirstFreeDTMID();
- int documentID = dtmPos << IDENT_DTM_NODE_BITS;
-
- if ((null != source) && source instanceof StAXSource) {
- final StAXSource staxSource = (StAXSource)source;
- StAXEvent2SAX staxevent2sax = null;
- StAXStream2SAX staxStream2SAX = null;
- if (staxSource.getXMLEventReader() != null) {
- final XMLEventReader xmlEventReader = staxSource.getXMLEventReader();
- staxevent2sax = new StAXEvent2SAX(xmlEventReader);
- } else if (staxSource.getXMLStreamReader() != null) {
- final XMLStreamReader xmlStreamReader = staxSource.getXMLStreamReader();
- staxStream2SAX = new StAXStream2SAX(xmlStreamReader);
- }
-
- SAXImpl dtm;
-
- if (size <= 0) {
- dtm = new SAXImpl(this, source, documentID,
- whiteSpaceFilter, null, doIndexing,
- DTMDefaultBase.DEFAULT_BLOCKSIZE,
- buildIdIndex, newNameTable);
- } else {
- dtm = new SAXImpl(this, source, documentID,
- whiteSpaceFilter, null, doIndexing,
- size, buildIdIndex, newNameTable);
- }
-
- dtm.setDocumentURI(source.getSystemId());
-
- addDTM(dtm, dtmPos, 0);
-
- try {
- if (staxevent2sax != null) {
- staxevent2sax.setContentHandler(dtm);
- staxevent2sax.parse();
- }
- else if (staxStream2SAX != null) {
- staxStream2SAX.setContentHandler(dtm);
- staxStream2SAX.parse();
- }
-
- }
- catch (RuntimeException re) {
- throw re;
- }
- catch (Exception e) {
- throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(e);
- }
-
- return dtm;
- }else if ((null != source) && source instanceof DOMSource) {
- final DOMSource domsrc = (DOMSource) source;
- final org.w3c.dom.Node node = domsrc.getNode();
- final DOM2SAX dom2sax = new DOM2SAX(node);
-
- SAXImpl dtm;
-
- if (size <= 0) {
- dtm = new SAXImpl(this, source, documentID,
- whiteSpaceFilter, null, doIndexing,
- DTMDefaultBase.DEFAULT_BLOCKSIZE,
- buildIdIndex, newNameTable);
- } else {
- dtm = new SAXImpl(this, source, documentID,
- whiteSpaceFilter, null, doIndexing,
- size, buildIdIndex, newNameTable);
- }
-
- dtm.setDocumentURI(source.getSystemId());
-
- addDTM(dtm, dtmPos, 0);
-
- dom2sax.setContentHandler(dtm);
-
- try {
- dom2sax.parse();
- }
- catch (RuntimeException re) {
- throw re;
- }
- catch (Exception e) {
- throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(e);
- }
-
- return dtm;
- }
- else
- {
- boolean isSAXSource = (null != source)
- ? (source instanceof SAXSource) : true;
- boolean isStreamSource = (null != source)
- ? (source instanceof StreamSource) : false;
-
- if (isSAXSource || isStreamSource) {
- XMLReader reader;
- InputSource xmlSource;
-
- if (null == source) {
- xmlSource = null;
- reader = null;
- hasUserReader = false; // Make sure the user didn't lie
- }
- else {
- reader = getXMLReader(source);
- xmlSource = SAXSource.sourceToInputSource(source);
-
- String urlOfSource = xmlSource.getSystemId();
-
- if (null != urlOfSource) {
- try {
- urlOfSource = SystemIDResolver.getAbsoluteURI(urlOfSource);
- }
- catch (Exception e) {
- // %REVIEW% Is there a better way to send a warning?
- System.err.println("Can not absolutize URL: " + urlOfSource);
- }
-
- xmlSource.setSystemId(urlOfSource);
- }
- }
-
- // Create the basic SAX2DTM.
- SAXImpl dtm;
- if (size <= 0) {
- dtm = new SAXImpl(this, source, documentID, whiteSpaceFilter,
- null, doIndexing,
- DTMDefaultBase.DEFAULT_BLOCKSIZE,
- buildIdIndex, newNameTable);
- } else {
- dtm = new SAXImpl(this, source, documentID, whiteSpaceFilter,
- null, doIndexing, size, buildIdIndex, newNameTable);
- }
-
- // Go ahead and add the DTM to the lookup table. This needs to be
- // done before any parsing occurs. Note offset 0, since we've just
- // created a new DTM.
- addDTM(dtm, dtmPos, 0);
-
- if (null == reader) {
- // Then the user will construct it themselves.
- return dtm;
- }
-
- reader.setContentHandler(dtm.getBuilder());
-
- if (!hasUserReader || null == reader.getDTDHandler()) {
- reader.setDTDHandler(dtm);
- }
-
- if(!hasUserReader || null == reader.getErrorHandler()) {
- reader.setErrorHandler(dtm);
- }
-
- try {
- reader.setProperty("http://xml.org/sax/properties/lexical-handler", dtm);
- }
- catch (SAXNotRecognizedException e){}
- catch (SAXNotSupportedException e){}
-
- try {
- reader.parse(xmlSource);
- }
- catch (RuntimeException re) {
- throw re;
- }
- catch (Exception e) {
- throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(e);
- } finally {
- if (!hasUserReader) {
- releaseXMLReader(reader);
- }
- }
-
- if (DUMPTREE) {
- System.out.println("Dumping SAX2DOM");
- dtm.dumpDTM(System.err);
- }
-
- return dtm;
- }
- else {
- // It should have been handled by a derived class or the caller
- // made a mistake.
- throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_NOT_SUPPORTED, new Object[]{source}));
- }
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/javax.xml.transform.TransformerFactory b/src/com/sun/org/apache/xalan/internal/xsltc/javax.xml.transform.TransformerFactory
deleted file mode 100644
index a607891..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/javax.xml.transform.TransformerFactory
+++ /dev/null
@@ -1 +0,0 @@
-com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/AbstractTranslet.java b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/AbstractTranslet.java
deleted file mode 100644
index fd8e521..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/AbstractTranslet.java
+++ /dev/null
@@ -1,798 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
-/*
- * $Id: AbstractTranslet.java,v 1.6 2006/06/19 19:49:03 spericas Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.runtime;
-
-import com.sun.org.apache.xalan.internal.XalanConstants;
-import com.sun.org.apache.xalan.internal.utils.FactoryImpl;
-import com.sun.org.apache.xalan.internal.xsltc.DOM;
-import com.sun.org.apache.xalan.internal.xsltc.DOMCache;
-import com.sun.org.apache.xalan.internal.xsltc.DOMEnhancedForDTM;
-import com.sun.org.apache.xalan.internal.xsltc.Translet;
-import com.sun.org.apache.xalan.internal.xsltc.TransletException;
-import com.sun.org.apache.xalan.internal.xsltc.dom.DOMAdapter;
-import com.sun.org.apache.xalan.internal.xsltc.dom.KeyIndex;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.output.TransletOutputHandlerFactory;
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
-import com.sun.org.apache.xml.internal.serializer.SerializationHandler;
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.text.DecimalFormat;
-import java.text.DecimalFormatSymbols;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Vector;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.Templates;
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.Document;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- * @author G. Todd Miller
- * @author John Howard, JohnH@schemasoft.com
- */
-public abstract class AbstractTranslet implements Translet {
-
- // These attributes are extracted from the xsl:output element. They also
- // appear as fields (with the same type, only public) in Output.java
- public String _version = "1.0";
- public String _method = null;
- public String _encoding = "UTF-8";
- public boolean _omitHeader = false;
- public String _standalone = null;
- //see OutputPropertiesFactory.ORACLE_IS_STANDALONE
- public boolean _isStandalone = false;
- public String _doctypePublic = null;
- public String _doctypeSystem = null;
- public boolean _indent = false;
- public String _mediaType = null;
- public Vector _cdata = null;
- public int _indentamount = -1;
-
- public static final int FIRST_TRANSLET_VERSION = 100;
- public static final int VER_SPLIT_NAMES_ARRAY = 101;
- public static final int CURRENT_TRANSLET_VERSION = VER_SPLIT_NAMES_ARRAY;
-
- // Initialize Translet version field to base value. A class that extends
- // AbstractTranslet may override this value to a more recent translet
- // version; if it doesn't override the value (because it was compiled
- // before the notion of a translet version was introduced, it will get
- // this default value).
- protected int transletVersion = FIRST_TRANSLET_VERSION;
-
- // DOM/translet handshaking - the arrays are set by the compiled translet
- protected String[] namesArray;
- protected String[] urisArray;
- protected int[] typesArray;
- protected String[] namespaceArray;
-
- // The Templates object that is used to create this Translet instance
- protected Templates _templates = null;
-
- // Boolean flag to indicate whether this translet has id functions.
- protected boolean _hasIdCall = false;
-
- // TODO - these should only be instanciated when needed
- protected StringValueHandler stringValueHandler = new StringValueHandler();
-
- // Use one empty string instead of constantly instanciating String("");
- private final static String EMPTYSTRING = "";
-
- // This is the name of the index used for ID attributes
- private final static String ID_INDEX_NAME = "##id";
-
- private boolean _useServicesMechanism;
-
- /**
- * protocols allowed for external references set by the stylesheet processing instruction, Document() function, Import and Include element.
- */
- private String _accessExternalStylesheet = XalanConstants.EXTERNAL_ACCESS_DEFAULT;
-
- /************************************************************************
- * Debugging
- ************************************************************************/
- public void printInternalState() {
- System.out.println("-------------------------------------");
- System.out.println("AbstractTranslet this = " + this);
- System.out.println("pbase = " + pbase);
- System.out.println("vframe = " + pframe);
- System.out.println("paramsStack.size() = " + paramsStack.size());
- System.out.println("namesArray.size = " + namesArray.length);
- System.out.println("namespaceArray.size = " + namespaceArray.length);
- System.out.println("");
- System.out.println("Total memory = " + Runtime.getRuntime().totalMemory());
- }
-
- /**
- * Wrap the initial input DOM in a dom adapter. This adapter is wrapped in
- * a DOM multiplexer if the document() function is used (handled by compiled
- * code in the translet - see compiler/Stylesheet.compileTransform()).
- */
- public final DOMAdapter makeDOMAdapter(DOM dom)
- throws TransletException {
- setRootForKeys(dom.getDocument());
- return new DOMAdapter(dom, namesArray, urisArray, typesArray, namespaceArray);
- }
-
- /************************************************************************
- * Parameter handling
- ************************************************************************/
-
- // Parameter's stack: <tt>pbase</tt> and <tt>pframe</tt> are used
- // to denote the current parameter frame.
- protected int pbase = 0, pframe = 0;
- protected ArrayList paramsStack = new ArrayList();
-
- /**
- * Push a new parameter frame.
- */
- public final void pushParamFrame() {
- paramsStack.add(pframe, new Integer(pbase));
- pbase = ++pframe;
- }
-
- /**
- * Pop the topmost parameter frame.
- */
- public final void popParamFrame() {
- if (pbase > 0) {
- final int oldpbase = ((Integer)paramsStack.get(--pbase)).intValue();
- for (int i = pframe - 1; i >= pbase; i--) {
- paramsStack.remove(i);
- }
- pframe = pbase; pbase = oldpbase;
- }
- }
-
- /**
- * Add a new global parameter if not already in the current frame.
- * To setParameters of the form {http://foo.bar}xyz
- * This needs to get mapped to an instance variable in the class
- * The mapping created so that
- * the global variables in the generated class become
- * http$colon$$flash$$flash$foo$dot$bar$colon$xyz
- */
- public final Object addParameter(String name, Object value) {
- name = BasisLibrary.mapQNameToJavaName (name);
- return addParameter(name, value, false);
- }
-
- /**
- * Add a new global or local parameter if not already in the current frame.
- * The 'isDefault' parameter is set to true if the value passed is the
- * default value from the <xsl:parameter> element's select attribute or
- * element body.
- */
- public final Object addParameter(String name, Object value,
- boolean isDefault)
- {
- // Local parameters need to be re-evaluated for each iteration
- for (int i = pframe - 1; i >= pbase; i--) {
- final Parameter param = (Parameter) paramsStack.get(i);
-
- if (param._name.equals(name)) {
- // Only overwrite if current value is the default value and
- // the new value is _NOT_ the default value.
- if (param._isDefault || !isDefault) {
- param._value = value;
- param._isDefault = isDefault;
- return value;
- }
- return param._value;
- }
- }
-
- // Add new parameter to parameter stack
- paramsStack.add(pframe++, new Parameter(name, value, isDefault));
- return value;
- }
-
- /**
- * Clears the parameter stack.
- */
- public void clearParameters() {
- pbase = pframe = 0;
- paramsStack.clear();
- }
-
- /**
- * Get the value of a parameter from the current frame or
- * <tt>null</tt> if undefined.
- */
- public final Object getParameter(String name) {
-
- name = BasisLibrary.mapQNameToJavaName (name);
-
- for (int i = pframe - 1; i >= pbase; i--) {
- final Parameter param = (Parameter)paramsStack.get(i);
- if (param._name.equals(name)) return param._value;
- }
- return null;
- }
-
- /************************************************************************
- * Message handling - implementation of <xsl:message>
- ************************************************************************/
-
- // Holds the translet's message handler - used for <xsl:message>.
- // The deault message handler dumps a string stdout, but anything can be
- // used, such as a dialog box for applets, etc.
- private MessageHandler _msgHandler = null;
-
- /**
- * Set the translet's message handler - must implement MessageHandler
- */
- public final void setMessageHandler(MessageHandler handler) {
- _msgHandler = handler;
- }
-
- /**
- * Pass a message to the message handler - used by Message class.
- */
- public final void displayMessage(String msg) {
- if (_msgHandler == null) {
- System.err.println(msg);
- }
- else {
- _msgHandler.displayMessage(msg);
- }
- }
-
- /************************************************************************
- * Decimal number format symbol handling
- ************************************************************************/
-
- // Contains decimal number formatting symbols used by FormatNumberCall
- public Map<String, DecimalFormat> _formatSymbols = null;
-
- /**
- * Adds a DecimalFormat object to the _formatSymbols map.
- * The entry is created with the input DecimalFormatSymbols.
- */
- public void addDecimalFormat(String name, DecimalFormatSymbols symbols) {
- // Instanciate map for formatting symbols if needed
- if (_formatSymbols == null) _formatSymbols = new HashMap<>();
-
- // The name cannot be null - use empty string instead
- if (name == null) name = EMPTYSTRING;
-
- // Construct a DecimalFormat object containing the symbols we got
- final DecimalFormat df = new DecimalFormat();
- if (symbols != null) {
- df.setDecimalFormatSymbols(symbols);
- }
- _formatSymbols.put(name, df);
- }
-
- /**
- * Retrieves a named DecimalFormat object from the _formatSymbols map.
- */
- public final DecimalFormat getDecimalFormat(String name) {
-
- if (_formatSymbols != null) {
- // The name cannot be null - use empty string instead
- if (name == null) name = EMPTYSTRING;
-
- DecimalFormat df = _formatSymbols.get(name);
- if (df == null) df = _formatSymbols.get(EMPTYSTRING);
- return df;
- }
- return(null);
- }
-
- /**
- * Give the translet an opportunity to perform a prepass on the document
- * to extract any information that it can store in an optimized form.
- *
- * Currently, it only extracts information about attributes of type ID.
- */
- public final void prepassDocument(DOM document) {
- setIndexSize(document.getSize());
- buildIDIndex(document);
- }
-
- /**
- * Leverages the Key Class to implement the XSLT id() function.
- * buildIdIndex creates the index (##id) that Key Class uses.
- * The index contains the element node index (int) and Id value (String).
- */
- private final void buildIDIndex(DOM document) {
- setRootForKeys(document.getDocument());
-
- if (document instanceof DOMEnhancedForDTM) {
- DOMEnhancedForDTM enhancedDOM = (DOMEnhancedForDTM)document;
-
- // If the input source is DOMSource, the KeyIndex table is not
- // built at this time. It will be built later by the lookupId()
- // and containsId() methods of the KeyIndex class.
- if (enhancedDOM.hasDOMSource()) {
- buildKeyIndex(ID_INDEX_NAME, document);
- return;
- }
- else {
- final Map<String, Integer> elementsByID = enhancedDOM.getElementsWithIDs();
-
- if (elementsByID == null) {
- return;
- }
-
- // Given a Map of DTM nodes indexed by ID attribute values,
- // loop through the table copying information to a KeyIndex
- // for the mapping from ID attribute value to DTM node
- boolean hasIDValues = false;
- for (Map.Entry<String, Integer> entry : elementsByID.entrySet()) {
- final int element = document.getNodeHandle(entry.getValue());
- buildKeyIndex(ID_INDEX_NAME, element, entry.getKey());
- hasIDValues = true;
- }
-
- if (hasIDValues) {
- setKeyIndexDom(ID_INDEX_NAME, document);
- }
- }
- }
- }
-
- /**
- * After constructing the translet object, this method must be called to
- * perform any version-specific post-initialization that's required.
- */
- public final void postInitialization() {
- // If the version of the translet had just one namesArray, split
- // it into multiple fields.
- if (transletVersion < VER_SPLIT_NAMES_ARRAY) {
- int arraySize = namesArray.length;
- String[] newURIsArray = new String[arraySize];
- String[] newNamesArray = new String[arraySize];
- int[] newTypesArray = new int[arraySize];
-
- for (int i = 0; i < arraySize; i++) {
- String name = namesArray[i];
- int colonIndex = name.lastIndexOf(':');
- int lNameStartIdx = colonIndex+1;
-
- if (colonIndex > -1) {
- newURIsArray[i] = name.substring(0, colonIndex);
- }
-
- // Distinguish attribute and element names. Attribute has
- // @ before local part of name.
- if (name.charAt(lNameStartIdx) == '@') {
- lNameStartIdx++;
- newTypesArray[i] = DTM.ATTRIBUTE_NODE;
- } else if (name.charAt(lNameStartIdx) == '?') {
- lNameStartIdx++;
- newTypesArray[i] = DTM.NAMESPACE_NODE;
- } else {
- newTypesArray[i] = DTM.ELEMENT_NODE;
- }
- newNamesArray[i] =
- (lNameStartIdx == 0) ? name
- : name.substring(lNameStartIdx);
- }
-
- namesArray = newNamesArray;
- urisArray = newURIsArray;
- typesArray = newTypesArray;
- }
-
- // Was translet compiled using a more recent version of the XSLTC
- // compiler than is known by the AbstractTranslet class? If, so
- // and we've made it this far (which is doubtful), we should give up.
- if (transletVersion > CURRENT_TRANSLET_VERSION) {
- BasisLibrary.runTimeError(BasisLibrary.UNKNOWN_TRANSLET_VERSION_ERR,
- this.getClass().getName());
- }
- }
-
- /************************************************************************
- * Index(es) for <xsl:key> / key() / id()
- ************************************************************************/
-
- // Container for all indexes for xsl:key elements
- private Map<String, KeyIndex> _keyIndexes = null;
- private KeyIndex _emptyKeyIndex = null;
- private int _indexSize = 0;
- private int _currentRootForKeys = 0;
-
- /**
- * This method is used to pass the largest DOM size to the translet.
- * Needed to make sure that the translet can index the whole DOM.
- */
- public void setIndexSize(int size) {
- if (size > _indexSize) _indexSize = size;
- }
-
- /**
- * Creates a KeyIndex object of the desired size - don't want to resize!!!
- */
- public KeyIndex createKeyIndex() {
- return(new KeyIndex(_indexSize));
- }
-
- /**
- * Adds a value to a key/id index
- * @param name is the name of the index (the key or ##id)
- * @param node is the node handle of the node to insert
- * @param value is the value that will look up the node in the given index
- */
- public void buildKeyIndex(String name, int node, String value) {
- KeyIndex index = buildKeyIndexHelper(name);
- index.add(value, node, _currentRootForKeys);
- }
-
- /**
- * Create an empty KeyIndex in the DOM case
- * @param name is the name of the index (the key or ##id)
- * @param dom is the DOM
- */
- public void buildKeyIndex(String name, DOM dom) {
- KeyIndex index = buildKeyIndexHelper(name);
- index.setDom(dom, dom.getDocument());
- }
-
- /**
- * Return KeyIndex for the buildKeyIndex methods. Note the difference from the
- * public getKeyIndex method, this method creates a new Map if keyIndexes does
- * not exist.
- *
- * @param name the name of the index (the key or ##id)
- * @return a KeyIndex.
- */
- private KeyIndex buildKeyIndexHelper(String name) {
- if (_keyIndexes == null) _keyIndexes = new HashMap<>();
-
- KeyIndex index = _keyIndexes.get(name);
- if (index == null) {
- _keyIndexes.put(name, index = new KeyIndex(_indexSize));
- }
- return index;
- }
-
- /**
- * Returns the index for a given key (or id).
- * The index implements our internal iterator interface
- * @param name the name of the index (the key or ##id)
- * @return a KeyIndex.
- */
- public KeyIndex getKeyIndex(String name) {
- // Return an empty key index iterator if none are defined
- if (_keyIndexes == null) {
- return (_emptyKeyIndex != null)
- ? _emptyKeyIndex
- : (_emptyKeyIndex = new KeyIndex(1));
- }
-
- // Look up the requested key index
- final KeyIndex index = _keyIndexes.get(name);
-
- // Return an empty key index iterator if the requested index not found
- if (index == null) {
- return (_emptyKeyIndex != null)
- ? _emptyKeyIndex
- : (_emptyKeyIndex = new KeyIndex(1));
- }
-
- return(index);
- }
-
- private void setRootForKeys(int root) {
- _currentRootForKeys = root;
- }
-
- /**
- * This method builds key indexes - it is overridden in the compiled
- * translet in cases where the <xsl:key> element is used
- */
- public void buildKeys(DOM document, DTMAxisIterator iterator,
- SerializationHandler handler,
- int root) throws TransletException {
-
- }
-
- /**
- * This method builds key indexes - it is overridden in the compiled
- * translet in cases where the <xsl:key> element is used
- */
- public void setKeyIndexDom(String name, DOM document) {
- getKeyIndex(name).setDom(document, document.getDocument());
- }
-
- /************************************************************************
- * DOM cache handling
- ************************************************************************/
-
- // Hold the DOM cache (if any) used with this translet
- private DOMCache _domCache = null;
-
- /**
- * Sets the DOM cache used for additional documents loaded using the
- * document() function.
- */
- public void setDOMCache(DOMCache cache) {
- _domCache = cache;
- }
-
- /**
- * Returns the DOM cache used for this translet. Used by the LoadDocument
- * class (if present) when the document() function is used.
- */
- public DOMCache getDOMCache() {
- return(_domCache);
- }
-
- /************************************************************************
- * Multiple output document extension.
- * See compiler/TransletOutput for actual implementation.
- ************************************************************************/
-
- public SerializationHandler openOutputHandler(String filename, boolean append)
- throws TransletException
- {
- try {
- final TransletOutputHandlerFactory factory
- = TransletOutputHandlerFactory.newInstance();
-
- String dirStr = new File(filename).getParent();
- if ((null != dirStr) && (dirStr.length() > 0)) {
- File dir = new File(dirStr);
- dir.mkdirs();
- }
-
- factory.setEncoding(_encoding);
- factory.setOutputMethod(_method);
- factory.setOutputStream(new BufferedOutputStream(new FileOutputStream(filename, append)));
- factory.setOutputType(TransletOutputHandlerFactory.STREAM);
-
- final SerializationHandler handler
- = factory.getSerializationHandler();
-
- transferOutputSettings(handler);
- handler.startDocument();
- return handler;
- }
- catch (Exception e) {
- throw new TransletException(e);
- }
- }
-
- public SerializationHandler openOutputHandler(String filename)
- throws TransletException
- {
- return openOutputHandler(filename, false);
- }
-
- public void closeOutputHandler(SerializationHandler handler) {
- try {
- handler.endDocument();
- handler.close();
- }
- catch (Exception e) {
- // what can you do?
- }
- }
-
- /************************************************************************
- * Native API transformation methods - _NOT_ JAXP/TrAX
- ************************************************************************/
-
- /**
- * Main transform() method - this is overridden by the compiled translet
- */
- public abstract void transform(DOM document, DTMAxisIterator iterator,
- SerializationHandler handler)
- throws TransletException;
-
- /**
- * Calls transform() with a given output handler
- */
- public final void transform(DOM document, SerializationHandler handler)
- throws TransletException {
- try {
- transform(document, document.getIterator(), handler);
- } finally {
- _keyIndexes = null;
- }
- }
-
- /**
- * Used by some compiled code as a shortcut for passing strings to the
- * output handler
- */
- public final void characters(final String string,
- SerializationHandler handler)
- throws TransletException {
- if (string != null) {
- //final int length = string.length();
- try {
- handler.characters(string);
- } catch (Exception e) {
- throw new TransletException(e);
- }
- }
- }
-
- /**
- * Add's a name of an element whose text contents should be output as CDATA
- */
- public void addCdataElement(String name) {
- if (_cdata == null) {
- _cdata = new Vector();
- }
-
- int lastColon = name.lastIndexOf(':');
-
- if (lastColon > 0) {
- String uri = name.substring(0, lastColon);
- String localName = name.substring(lastColon+1);
- _cdata.addElement(uri);
- _cdata.addElement(localName);
- } else {
- _cdata.addElement(null);
- _cdata.addElement(name);
- }
- }
-
- /**
- * Transfer the output settings to the output post-processor
- */
- protected void transferOutputSettings(SerializationHandler handler) {
- if (_method != null) {
- if (_method.equals("xml")) {
- if (_standalone != null) {
- handler.setStandalone(_standalone);
- }
- if (_omitHeader) {
- handler.setOmitXMLDeclaration(true);
- }
- handler.setCdataSectionElements(_cdata);
- if (_version != null) {
- handler.setVersion(_version);
- }
- handler.setIndent(_indent);
- handler.setIndentAmount(_indentamount);
- if (_doctypeSystem != null) {
- handler.setDoctype(_doctypeSystem, _doctypePublic);
- }
- handler.setIsStandalone(_isStandalone);
- }
- else if (_method.equals("html")) {
- handler.setIndent(_indent);
- handler.setDoctype(_doctypeSystem, _doctypePublic);
- if (_mediaType != null) {
- handler.setMediaType(_mediaType);
- }
- }
- }
- else {
- handler.setCdataSectionElements(_cdata);
- if (_version != null) {
- handler.setVersion(_version);
- }
- if (_standalone != null) {
- handler.setStandalone(_standalone);
- }
- if (_omitHeader) {
- handler.setOmitXMLDeclaration(true);
- }
- handler.setIndent(_indent);
- handler.setDoctype(_doctypeSystem, _doctypePublic);
- handler.setIsStandalone(_isStandalone);
- }
- }
-
- private Map<String, Class<?>> _auxClasses = null;
-
- public void addAuxiliaryClass(Class auxClass) {
- if (_auxClasses == null) _auxClasses = new HashMap<>();
- _auxClasses.put(auxClass.getName(), auxClass);
- }
-
- public void setAuxiliaryClasses(Map<String, Class<?>> auxClasses) {
- _auxClasses = auxClasses;
- }
-
- public Class getAuxiliaryClass(String className) {
- if (_auxClasses == null) return null;
- return((Class)_auxClasses.get(className));
- }
-
- // GTM added (see pg 110)
- public String[] getNamesArray() {
- return namesArray;
- }
-
- public String[] getUrisArray() {
- return urisArray;
- }
-
- public int[] getTypesArray() {
- return typesArray;
- }
-
- public String[] getNamespaceArray() {
- return namespaceArray;
- }
-
- public boolean hasIdCall() {
- return _hasIdCall;
- }
-
- public Templates getTemplates() {
- return _templates;
- }
-
- public void setTemplates(Templates templates) {
- _templates = templates;
- }
- /**
- * Return the state of the services mechanism feature.
- */
- public boolean useServicesMechnism() {
- return _useServicesMechanism;
- }
-
- /**
- * Set the state of the services mechanism feature.
- */
- public void setServicesMechnism(boolean flag) {
- _useServicesMechanism = flag;
- }
-
- /**
- * Return allowed protocols for accessing external stylesheet.
- */
- public String getAllowedProtocols() {
- return _accessExternalStylesheet;
- }
-
- /**
- * Set allowed protocols for accessing external stylesheet.
- */
- public void setAllowedProtocols(String protocols) {
- _accessExternalStylesheet = protocols;
- }
-
- /************************************************************************
- * DOMImplementation caching for basis library
- ************************************************************************/
- protected DOMImplementation _domImplementation = null;
-
- public Document newDocument(String uri, String qname)
- throws ParserConfigurationException
- {
- if (_domImplementation == null) {
- DocumentBuilderFactory dbf = FactoryImpl.getDOMFactory(_useServicesMechanism);
- _domImplementation = dbf.newDocumentBuilder().getDOMImplementation();
- }
- return _domImplementation.createDocument(uri, qname, null);
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/Attributes.java b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/Attributes.java
deleted file mode 100644
index 62e57a6..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/Attributes.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Attributes.java,v 1.2.4.1 2005/09/06 10:53:04 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.runtime;
-
-import com.sun.org.apache.xalan.internal.xsltc.DOM;
-import org.xml.sax.AttributeList;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-public final class Attributes implements AttributeList {
- private int _element;
- private DOM _document;
-
- public Attributes(DOM document, int element) {
- _element = element;
- _document = document;
- }
-
- public int getLength() {
- return 0;
- }
-
- public String getName(int i) {
- return null;
- }
-
- public String getType(int i) {
- return null;
- }
-
- public String getType(String name) {
- return null;
- }
-
- public String getValue(int i) {
- return null;
- }
-
- public String getValue(String name) {
- return null;
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/BasisLibrary.java b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/BasisLibrary.java
deleted file mode 100644
index 804b154..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/BasisLibrary.java
+++ /dev/null
@@ -1,1688 +0,0 @@
-/*
- * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: BasisLibrary.java,v 1.6 2006/06/20 21:51:58 spericas Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.runtime;
-
-import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
-import com.sun.org.apache.xalan.internal.xsltc.DOM;
-import com.sun.org.apache.xalan.internal.xsltc.Translet;
-import com.sun.org.apache.xalan.internal.xsltc.dom.AbsoluteIterator;
-import com.sun.org.apache.xalan.internal.xsltc.dom.ArrayNodeListIterator;
-import com.sun.org.apache.xalan.internal.xsltc.dom.DOMAdapter;
-import com.sun.org.apache.xalan.internal.xsltc.dom.MultiDOM;
-import com.sun.org.apache.xalan.internal.xsltc.dom.SingletonIterator;
-import com.sun.org.apache.xalan.internal.xsltc.dom.StepIterator;
-import com.sun.org.apache.xml.internal.dtm.Axis;
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
-import com.sun.org.apache.xml.internal.dtm.DTMManager;
-import com.sun.org.apache.xml.internal.dtm.ref.DTMDefaultBase;
-import com.sun.org.apache.xml.internal.dtm.ref.DTMNodeProxy;
-import com.sun.org.apache.xml.internal.serializer.NamespaceMappings;
-import com.sun.org.apache.xml.internal.serializer.SerializationHandler;
-import com.sun.org.apache.xml.internal.utils.XML11Char;
-import java.text.DecimalFormat;
-import java.text.DecimalFormatSymbols;
-import java.text.FieldPosition;
-import java.text.MessageFormat;
-import java.text.NumberFormat;
-import java.util.Locale;
-import java.util.ResourceBundle;
-import java.util.concurrent.atomic.AtomicInteger;
-import javax.xml.transform.dom.DOMSource;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-import org.xml.sax.SAXException;
-
-/**
- * Standard XSLT functions. All standard functions expect the current node
- * and the DOM as their last two arguments.
- */
-public final class BasisLibrary {
-
- private final static String EMPTYSTRING = "";
-
- /**
- * Re-use a single instance of StringBuffer (per thread) in the basis library.
- * StringBuilder is better, however, DecimalFormat only accept StringBuffer
- */
- private static final ThreadLocal<StringBuilder> threadLocalStringBuilder =
- new ThreadLocal<StringBuilder> () {
- @Override protected StringBuilder initialValue() {
- return new StringBuilder();
- }
- };
-
- /**
- * ThreadLocal for StringBuffer used
- */
- private static final ThreadLocal<StringBuffer> threadLocalStringBuffer =
- new ThreadLocal<StringBuffer> () {
- @Override protected StringBuffer initialValue() {
- return new StringBuffer();
- }
- };
-
- /**
- * Standard function count(node-set)
- */
- public static int countF(DTMAxisIterator iterator) {
- return(iterator.getLast());
- }
-
- /**
- * Standard function position()
- * @deprecated This method exists only for backwards compatibility with old
- * translets. New code should not reference it.
- */
- public static int positionF(DTMAxisIterator iterator) {
- return iterator.isReverse()
- ? iterator.getLast() - iterator.getPosition() + 1
- : iterator.getPosition();
- }
-
- /**
- * XSLT Standard function sum(node-set).
- * stringToDouble is inlined
- */
- public static double sumF(DTMAxisIterator iterator, DOM dom) {
- try {
- double result = 0.0;
- int node;
- while ((node = iterator.next()) != DTMAxisIterator.END) {
- result += Double.parseDouble(dom.getStringValueX(node));
- }
- return result;
- }
- catch (NumberFormatException e) {
- return Double.NaN;
- }
- }
-
- /**
- * XSLT Standard function string()
- */
- public static String stringF(int node, DOM dom) {
- return dom.getStringValueX(node);
- }
-
- /**
- * XSLT Standard function string(value)
- */
- public static String stringF(Object obj, DOM dom) {
- if (obj instanceof DTMAxisIterator) {
- return dom.getStringValueX(((DTMAxisIterator)obj).reset().next());
- }
- else if (obj instanceof Node) {
- return dom.getStringValueX(((Node)obj).node);
- }
- else if (obj instanceof DOM) {
- return ((DOM)obj).getStringValue();
- }
- else {
- return obj.toString();
- }
- }
-
- /**
- * XSLT Standard function string(value)
- */
- public static String stringF(Object obj, int node, DOM dom) {
- if (obj instanceof DTMAxisIterator) {
- return dom.getStringValueX(((DTMAxisIterator)obj).reset().next());
- }
- else if (obj instanceof Node) {
- return dom.getStringValueX(((Node)obj).node);
- }
- else if (obj instanceof DOM) {
- // When the first argument is a DOM we want the whole
- // DOM and not just a single node - that would not make sense.
- //return ((DOM)obj).getStringValueX(node);
- return ((DOM)obj).getStringValue();
- }
- else if (obj instanceof Double) {
- Double d = (Double)obj;
- final String result = d.toString();
- final int length = result.length();
- if ((result.charAt(length-2)=='.') &&
- (result.charAt(length-1) == '0'))
- return result.substring(0, length-2);
- else
- return result;
- }
- else {
- return obj != null ? obj.toString() : "";
- }
- }
-
- /**
- * XSLT Standard function number()
- */
- public static double numberF(int node, DOM dom) {
- return stringToReal(dom.getStringValueX(node));
- }
-
- /**
- * XSLT Standard function number(value)
- */
- public static double numberF(Object obj, DOM dom) {
- if (obj instanceof Double) {
- return ((Double) obj).doubleValue();
- }
- else if (obj instanceof Integer) {
- return ((Integer) obj).doubleValue();
- }
- else if (obj instanceof Boolean) {
- return ((Boolean) obj).booleanValue() ? 1.0 : 0.0;
- }
- else if (obj instanceof String) {
- return stringToReal((String) obj);
- }
- else if (obj instanceof DTMAxisIterator) {
- DTMAxisIterator iter = (DTMAxisIterator) obj;
- return stringToReal(dom.getStringValueX(iter.reset().next()));
- }
- else if (obj instanceof Node) {
- return stringToReal(dom.getStringValueX(((Node) obj).node));
- }
- else if (obj instanceof DOM) {
- return stringToReal(((DOM) obj).getStringValue());
- }
- else {
- final String className = obj.getClass().getName();
- runTimeError(INVALID_ARGUMENT_ERR, className, "number()");
- return 0.0;
- }
- }
-
- /**
- * XSLT Standard function round()
- */
- public static double roundF(double d) {
- return (d<-0.5 || d>0.0)?Math.floor(d+0.5):((d==0.0)?
- d:(Double.isNaN(d)?Double.NaN:-0.0));
- }
-
- /**
- * XSLT Standard function boolean()
- */
- public static boolean booleanF(Object obj) {
- if (obj instanceof Double) {
- final double temp = ((Double) obj).doubleValue();
- return temp != 0.0 && !Double.isNaN(temp);
- }
- else if (obj instanceof Integer) {
- return ((Integer) obj).doubleValue() != 0;
- }
- else if (obj instanceof Boolean) {
- return ((Boolean) obj).booleanValue();
- }
- else if (obj instanceof String) {
- return !((String) obj).equals(EMPTYSTRING);
- }
- else if (obj instanceof DTMAxisIterator) {
- DTMAxisIterator iter = (DTMAxisIterator) obj;
- return iter.reset().next() != DTMAxisIterator.END;
- }
- else if (obj instanceof Node) {
- return true;
- }
- else if (obj instanceof DOM) {
- String temp = ((DOM) obj).getStringValue();
- return !temp.equals(EMPTYSTRING);
- }
- else {
- final String className = obj.getClass().getName();
- runTimeError(INVALID_ARGUMENT_ERR, className, "boolean()");
- }
- return false;
- }
-
- /**
- * XSLT Standard function substring(). Must take a double because of
- * conversions resulting into NaNs and rounding.
- */
- public static String substringF(String value, double start) {
- if (Double.isNaN(start))
- return(EMPTYSTRING);
-
- final int strlen = getStringLength(value);
- int istart = (int)Math.round(start) - 1;
-
- if (istart > strlen)
- return(EMPTYSTRING);
- if (istart < 1)
- istart = 0;
- try {
- istart = value.offsetByCodePoints(0, istart);
- return value.substring(istart);
- } catch (IndexOutOfBoundsException e) {
- runTimeError(RUN_TIME_INTERNAL_ERR, "substring()");
- return null;
- }
- }
-
- /**
- * XSLT Standard function substring(). Must take a double because of
- * conversions resulting into NaNs and rounding.
- */
- public static String substringF(String value, double start, double length) {
- if (Double.isInfinite(start) ||
- Double.isNaN(start) ||
- Double.isNaN(length) ||
- length < 0)
- return(EMPTYSTRING);
-
- int istart = (int)Math.round(start) - 1;
- int ilength = (int)Math.round(length);
- final int isum;
- if (Double.isInfinite(length))
- isum = Integer.MAX_VALUE;
- else
- isum = istart + ilength;
-
- final int strlen = getStringLength(value);
- if (isum < 0 || istart > strlen)
- return(EMPTYSTRING);
-
- if (istart < 0) {
- ilength += istart;
- istart = 0;
- }
-
- try {
- istart = value.offsetByCodePoints(0, istart);
- if (isum > strlen) {
- return value.substring(istart);
- } else {
- int offset = value.offsetByCodePoints(istart, ilength);
- return value.substring(istart, offset);
- }
- } catch (IndexOutOfBoundsException e) {
- runTimeError(RUN_TIME_INTERNAL_ERR, "substring()");
- return null;
- }
- }
-
- /**
- * XSLT Standard function substring-after().
- */
- public static String substring_afterF(String value, String substring) {
- final int index = value.indexOf(substring);
- if (index >= 0)
- return value.substring(index + substring.length());
- else
- return EMPTYSTRING;
- }
-
- /**
- * XSLT Standard function substring-before().
- */
- public static String substring_beforeF(String value, String substring) {
- final int index = value.indexOf(substring);
- if (index >= 0)
- return value.substring(0, index);
- else
- return EMPTYSTRING;
- }
-
- /**
- * XSLT Standard function translate().
- */
- public static String translateF(String value, String from, String to) {
- final int tol = to.length();
- final int froml = from.length();
- final int valuel = value.length();
-
- final StringBuilder result = threadLocalStringBuilder.get();
- result.setLength(0);
- for (int j, i = 0; i < valuel; i++) {
- final char ch = value.charAt(i);
- for (j = 0; j < froml; j++) {
- if (ch == from.charAt(j)) {
- if (j < tol)
- result.append(to.charAt(j));
- break;
- }
- }
- if (j == froml)
- result.append(ch);
- }
- return result.toString();
- }
-
- /**
- * XSLT Standard function normalize-space().
- */
- public static String normalize_spaceF(int node, DOM dom) {
- return normalize_spaceF(dom.getStringValueX(node));
- }
-
- /**
- * XSLT Standard function normalize-space(string).
- */
- public static String normalize_spaceF(String value) {
- int i = 0, n = value.length();
- StringBuilder result = threadLocalStringBuilder.get();
- result.setLength(0);
-
- while (i < n && isWhiteSpace(value.charAt(i)))
- i++;
-
- while (true) {
- while (i < n && !isWhiteSpace(value.charAt(i))) {
- result.append(value.charAt(i++));
- }
- if (i == n)
- break;
- while (i < n && isWhiteSpace(value.charAt(i))) {
- i++;
- }
- if (i < n)
- result.append(' ');
- }
- return result.toString();
- }
-
- /**
- * XSLT Standard function generate-id().
- */
- public static String generate_idF(int node) {
- if (node > 0)
- // Only generate ID if node exists
- return "N" + node;
- else
- // Otherwise return an empty string
- return EMPTYSTRING;
- }
-
- /**
- * utility function for calls to local-name().
- */
- public static String getLocalName(String value) {
- int idx = value.lastIndexOf(':');
- if (idx >= 0) value = value.substring(idx + 1);
- idx = value.lastIndexOf('@');
- if (idx >= 0) value = value.substring(idx + 1);
- return(value);
- }
-
- /**
- * External functions that cannot be resolved are replaced with a call
- * to this method. This method will generate a runtime errors. A good
- * stylesheet checks whether the function exists using conditional
- * constructs, and never really tries to call it if it doesn't exist.
- * But simple stylesheets may result in a call to this method.
- * The compiler should generate a warning if it encounters a call to
- * an unresolved external function.
- */
- public static void unresolved_externalF(String name) {
- runTimeError(EXTERNAL_FUNC_ERR, name);
- }
-
- /**
- * Utility function to throw a runtime error on the use of an extension
- * function when the secure processing feature is set to true.
- */
- public static void unallowed_extension_functionF(String name) {
- runTimeError(UNALLOWED_EXTENSION_FUNCTION_ERR, name);
- }
-
- /**
- * Utility function to throw a runtime error on the use of an extension
- * element when the secure processing feature is set to true.
- */
- public static void unallowed_extension_elementF(String name) {
- runTimeError(UNALLOWED_EXTENSION_ELEMENT_ERR, name);
- }
-
- /**
- * Utility function to throw a runtime error for an unsupported element.
- *
- * This is only used in forward-compatibility mode, when the control flow
- * cannot be determined. In 1.0 mode, the error message is emitted at
- * compile time.
- */
- public static void unsupported_ElementF(String qname, boolean isExtension) {
- if (isExtension)
- runTimeError(UNSUPPORTED_EXT_ERR, qname);
- else
- runTimeError(UNSUPPORTED_XSL_ERR, qname);
- }
-
- /**
- * XSLT Standard function namespace-uri(node-set).
- */
- public static String namespace_uriF(DTMAxisIterator iter, DOM dom) {
- return namespace_uriF(iter.next(), dom);
- }
-
- /**
- * XSLT Standard function system-property(name)
- */
- public static String system_propertyF(String name) {
- if (name.equals("xsl:version"))
- return("1.0");
- if (name.equals("xsl:vendor"))
- return("Apache Software Foundation (Xalan XSLTC)");
- if (name.equals("xsl:vendor-url"))
- return("http://xml.apache.org/xalan-j");
-
- runTimeError(INVALID_ARGUMENT_ERR, name, "system-property()");
- return(EMPTYSTRING);
- }
-
- /**
- * XSLT Standard function namespace-uri().
- */
- public static String namespace_uriF(int node, DOM dom) {
- final String value = dom.getNodeName(node);
- final int colon = value.lastIndexOf(':');
- if (colon >= 0)
- return value.substring(0, colon);
- else
- return EMPTYSTRING;
- }
-
- /**
- * Implements the object-type() extension function.
- *
- * @see <a href="http://www.exslt.org/">EXSLT</a>
- */
- public static String objectTypeF(Object obj)
- {
- if (obj instanceof String)
- return "string";
- else if (obj instanceof Boolean)
- return "boolean";
- else if (obj instanceof Number)
- return "number";
- else if (obj instanceof DOM)
- return "RTF";
- else if (obj instanceof DTMAxisIterator)
- return "node-set";
- else
- return "unknown";
- }
-
- /**
- * Implements the nodeset() extension function.
- */
- public static DTMAxisIterator nodesetF(Object obj) {
- if (obj instanceof DOM) {
- //final DOMAdapter adapter = (DOMAdapter) obj;
- final DOM dom = (DOM)obj;
- return new SingletonIterator(dom.getDocument(), true);
- }
- else if (obj instanceof DTMAxisIterator) {
- return (DTMAxisIterator) obj;
- }
- else {
- final String className = obj.getClass().getName();
- runTimeError(DATA_CONVERSION_ERR, "node-set", className);
- return null;
- }
- }
-
- //-- Begin utility functions
-
- private static boolean isWhiteSpace(char ch) {
- return ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r';
- }
-
- private static boolean compareStrings(String lstring, String rstring,
- int op, DOM dom) {
- switch (op) {
- case Operators.EQ:
- return lstring.equals(rstring);
-
- case Operators.NE:
- return !lstring.equals(rstring);
-
- case Operators.GT:
- return numberF(lstring, dom) > numberF(rstring, dom);
-
- case Operators.LT:
- return numberF(lstring, dom) < numberF(rstring, dom);
-
- case Operators.GE:
- return numberF(lstring, dom) >= numberF(rstring, dom);
-
- case Operators.LE:
- return numberF(lstring, dom) <= numberF(rstring, dom);
-
- default:
- runTimeError(RUN_TIME_INTERNAL_ERR, "compare()");
- return false;
- }
- }
-
- /**
- * Utility function: node-set/node-set compare.
- */
- public static boolean compare(DTMAxisIterator left, DTMAxisIterator right,
- int op, DOM dom) {
- int lnode;
- left.reset();
-
- while ((lnode = left.next()) != DTMAxisIterator.END) {
- final String lvalue = dom.getStringValueX(lnode);
-
- int rnode;
- right.reset();
- while ((rnode = right.next()) != DTMAxisIterator.END) {
- // String value must be the same if both nodes are the same
- if (lnode == rnode) {
- if (op == Operators.EQ) {
- return true;
- } else if (op == Operators.NE) {
- continue;
- }
- }
- if (compareStrings(lvalue, dom.getStringValueX(rnode), op,
- dom)) {
- return true;
- }
- }
- }
- return false;
- }
-
- public static boolean compare(int node, DTMAxisIterator iterator,
- int op, DOM dom) {
- //iterator.reset();
-
- int rnode;
- String value;
-
- switch(op) {
- case Operators.EQ:
- rnode = iterator.next();
- if (rnode != DTMAxisIterator.END) {
- value = dom.getStringValueX(node);
- do {
- if (node == rnode
- || value.equals(dom.getStringValueX(rnode))) {
- return true;
- }
- } while ((rnode = iterator.next()) != DTMAxisIterator.END);
- }
- break;
- case Operators.NE:
- rnode = iterator.next();
- if (rnode != DTMAxisIterator.END) {
- value = dom.getStringValueX(node);
- do {
- if (node != rnode
- && !value.equals(dom.getStringValueX(rnode))) {
- return true;
- }
- } while ((rnode = iterator.next()) != DTMAxisIterator.END);
- }
- break;
- case Operators.LT:
- // Assume we're comparing document order here
- while ((rnode = iterator.next()) != DTMAxisIterator.END) {
- if (rnode > node) return true;
- }
- break;
- case Operators.GT:
- // Assume we're comparing document order here
- while ((rnode = iterator.next()) != DTMAxisIterator.END) {
- if (rnode < node) return true;
- }
- break;
- }
- return(false);
- }
-
- /**
- * Utility function: node-set/number compare.
- */
- public static boolean compare(DTMAxisIterator left, final double rnumber,
- final int op, DOM dom) {
- int node;
- //left.reset();
-
- switch (op) {
- case Operators.EQ:
- while ((node = left.next()) != DTMAxisIterator.END) {
- if (numberF(dom.getStringValueX(node), dom) == rnumber)
- return true;
- }
- break;
-
- case Operators.NE:
- while ((node = left.next()) != DTMAxisIterator.END) {
- if (numberF(dom.getStringValueX(node), dom) != rnumber)
- return true;
- }
- break;
-
- case Operators.GT:
- while ((node = left.next()) != DTMAxisIterator.END) {
- if (numberF(dom.getStringValueX(node), dom) > rnumber)
- return true;
- }
- break;
-
- case Operators.LT:
- while ((node = left.next()) != DTMAxisIterator.END) {
- if (numberF(dom.getStringValueX(node), dom) < rnumber)
- return true;
- }
- break;
-
- case Operators.GE:
- while ((node = left.next()) != DTMAxisIterator.END) {
- if (numberF(dom.getStringValueX(node), dom) >= rnumber)
- return true;
- }
- break;
-
- case Operators.LE:
- while ((node = left.next()) != DTMAxisIterator.END) {
- if (numberF(dom.getStringValueX(node), dom) <= rnumber)
- return true;
- }
- break;
-
- default:
- runTimeError(RUN_TIME_INTERNAL_ERR, "compare()");
- }
-
- return false;
- }
-
- /**
- * Utility function: node-set/string comparison.
- */
- public static boolean compare(DTMAxisIterator left, final String rstring,
- int op, DOM dom) {
- int node;
- //left.reset();
- while ((node = left.next()) != DTMAxisIterator.END) {
- if (compareStrings(dom.getStringValueX(node), rstring, op, dom)) {
- return true;
- }
- }
- return false;
- }
-
-
- public static boolean compare(Object left, Object right,
- int op, DOM dom)
- {
- boolean result = false;
- boolean hasSimpleArgs = hasSimpleType(left) && hasSimpleType(right);
-
- if (op != Operators.EQ && op != Operators.NE) {
- // If node-boolean comparison -> convert node to boolean
- if (left instanceof Node || right instanceof Node) {
- if (left instanceof Boolean) {
- right = new Boolean(booleanF(right));
- hasSimpleArgs = true;
- }
- if (right instanceof Boolean) {
- left = new Boolean(booleanF(left));
- hasSimpleArgs = true;
- }
- }
-
- if (hasSimpleArgs) {
- switch (op) {
- case Operators.GT:
- return numberF(left, dom) > numberF(right, dom);
-
- case Operators.LT:
- return numberF(left, dom) < numberF(right, dom);
-
- case Operators.GE:
- return numberF(left, dom) >= numberF(right, dom);
-
- case Operators.LE:
- return numberF(left, dom) <= numberF(right, dom);
-
- default:
- runTimeError(RUN_TIME_INTERNAL_ERR, "compare()");
- }
- }
- // falls through
- }
-
- if (hasSimpleArgs) {
- if (left instanceof Boolean || right instanceof Boolean) {
- result = booleanF(left) == booleanF(right);
- }
- else if (left instanceof Double || right instanceof Double ||
- left instanceof Integer || right instanceof Integer) {
- result = numberF(left, dom) == numberF(right, dom);
- }
- else { // compare them as strings
- result = stringF(left, dom).equals(stringF(right, dom));
- }
-
- if (op == Operators.NE) {
- result = !result;
- }
- }
- else {
- if (left instanceof Node) {
- left = new SingletonIterator(((Node)left).node);
- }
- if (right instanceof Node) {
- right = new SingletonIterator(((Node)right).node);
- }
-
- if (hasSimpleType(left) ||
- left instanceof DOM && right instanceof DTMAxisIterator) {
- // swap operands and operator
- final Object temp = right; right = left; left = temp;
- op = Operators.swapOp(op);
- }
-
- if (left instanceof DOM) {
- if (right instanceof Boolean) {
- result = ((Boolean)right).booleanValue();
- return result == (op == Operators.EQ);
- }
-
- final String sleft = ((DOM)left).getStringValue();
-
- if (right instanceof Number) {
- result = ((Number)right).doubleValue() ==
- stringToReal(sleft);
- }
- else if (right instanceof String) {
- result = sleft.equals((String)right);
- }
- else if (right instanceof DOM) {
- result = sleft.equals(((DOM)right).getStringValue());
- }
-
- if (op == Operators.NE) {
- result = !result;
- }
- return result;
- }
-
- // Next, node-set/t for t in {real, string, node-set, result-tree}
-
- DTMAxisIterator iter = ((DTMAxisIterator)left).reset();
-
- if (right instanceof DTMAxisIterator) {
- result = compare(iter, (DTMAxisIterator)right, op, dom);
- }
- else if (right instanceof String) {
- result = compare(iter, (String)right, op, dom);
- }
- else if (right instanceof Number) {
- final double temp = ((Number)right).doubleValue();
- result = compare(iter, temp, op, dom);
- }
- else if (right instanceof Boolean) {
- boolean temp = ((Boolean)right).booleanValue();
- result = (iter.reset().next() != DTMAxisIterator.END) == temp;
- }
- else if (right instanceof DOM) {
- result = compare(iter, ((DOM)right).getStringValue(),
- op, dom);
- }
- else if (right == null) {
- return(false);
- }
- else {
- final String className = right.getClass().getName();
- runTimeError(INVALID_ARGUMENT_ERR, className, "compare()");
- }
- }
- return result;
- }
-
- /**
- * Utility function: used to test context node's language
- */
- public static boolean testLanguage(String testLang, DOM dom, int node) {
- // language for context node (if any)
- String nodeLang = dom.getLanguage(node);
- if (nodeLang == null)
- return(false);
- else
- nodeLang = nodeLang.toLowerCase();
-
- // compare context node's language agains test language
- testLang = testLang.toLowerCase();
- if (testLang.length() == 2) {
- return(nodeLang.startsWith(testLang));
- }
- else {
- return(nodeLang.equals(testLang));
- }
- }
-
- private static boolean hasSimpleType(Object obj) {
- return obj instanceof Boolean || obj instanceof Double ||
- obj instanceof Integer || obj instanceof String ||
- obj instanceof Node || obj instanceof DOM;
- }
-
- /**
- * Utility function: used in StringType to convert a string to a real.
- */
- public static double stringToReal(String s) {
- try {
- return Double.valueOf(s).doubleValue();
- }
- catch (NumberFormatException e) {
- return Double.NaN;
- }
- }
-
- /**
- * Utility function: used in StringType to convert a string to an int.
- */
- public static int stringToInt(String s) {
- try {
- return Integer.parseInt(s);
- }
- catch (NumberFormatException e) {
- return(-1); // ???
- }
- }
-
- private static final int DOUBLE_FRACTION_DIGITS = 340;
- private static final double lowerBounds = 0.001;
- private static final double upperBounds = 10000000;
- private static DecimalFormat defaultFormatter, xpathFormatter;
- private static String defaultPattern = "";
-
- static {
- NumberFormat f = NumberFormat.getInstance(Locale.getDefault());
- defaultFormatter = (f instanceof DecimalFormat) ?
- (DecimalFormat) f : new DecimalFormat();
- // Set max fraction digits so that truncation does not occur. Setting
- // the max to Integer.MAX_VALUE may cause problems with some JDK's.
- defaultFormatter.setMaximumFractionDigits(DOUBLE_FRACTION_DIGITS);
- defaultFormatter.setMinimumFractionDigits(0);
- defaultFormatter.setMinimumIntegerDigits(1);
- defaultFormatter.setGroupingUsed(false);
-
- // This formatter is used to convert numbers according to the XPath
- // 1.0 syntax which ignores locales (http://www.w3.org/TR/xpath#NT-Number)
- xpathFormatter = new DecimalFormat("",
- new DecimalFormatSymbols(Locale.US));
- xpathFormatter.setMaximumFractionDigits(DOUBLE_FRACTION_DIGITS);
- xpathFormatter.setMinimumFractionDigits(0);
- xpathFormatter.setMinimumIntegerDigits(1);
- xpathFormatter.setGroupingUsed(false);
- }
-
- /**
- * Utility function: used in RealType to convert a real to a string.
- * Removes the decimal if null. Uses a specialized formatter object
- * for very large and very small numbers that ignores locales, thus
- * using always using "." as a decimal separator.
- */
- public static String realToString(double d) {
- final double m = Math.abs(d);
- if ((m >= lowerBounds) && (m < upperBounds)) {
- final String result = Double.toString(d);
- final int length = result.length();
- // Remove leading zeros.
- if ((result.charAt(length-2) == '.') &&
- (result.charAt(length-1) == '0'))
- return result.substring(0, length-2);
- else
- return result;
- }
- else {
- if (Double.isNaN(d) || Double.isInfinite(d))
- return(Double.toString(d));
-
- //Convert -0.0 to +0.0 other values remains the same
- d = d + 0.0;
-
- // Use the XPath formatter to ignore locales
- StringBuffer result = threadLocalStringBuffer.get();
- result.setLength(0);
- xpathFormatter.format(d, result, _fieldPosition);
- return result.toString();
- }
- }
-
- /**
- * Utility function: used in RealType to convert a real to an integer
- */
- public static int realToInt(double d) {
- return (int)d;
- }
-
- /**
- * Utility function: used to format/adjust a double to a string. The
- * DecimalFormat object comes from the 'formatSymbols' map in
- * AbstractTranslet.
- */
- private static FieldPosition _fieldPosition = new FieldPosition(0);
-
- public static String formatNumber(double number, String pattern,
- DecimalFormat formatter) {
- // bugzilla fix 12813
- if (formatter == null) {
- formatter = defaultFormatter;
- }
- try {
- StringBuffer result = threadLocalStringBuffer.get();
- result.setLength(0);
- if (pattern != defaultPattern) {
- formatter.applyLocalizedPattern(pattern);
- }
- formatter.format(number, result, _fieldPosition);
- return result.toString();
- }
- catch (IllegalArgumentException e) {
- runTimeError(FORMAT_NUMBER_ERR, Double.toString(number), pattern);
- return(EMPTYSTRING);
- }
- }
-
- /**
- * Utility function: used to convert references to node-sets. If the
- * obj is an instanceof Node then create a singleton iterator.
- */
- public static DTMAxisIterator referenceToNodeSet(Object obj) {
- // Convert var/param -> node
- if (obj instanceof Node) {
- return(new SingletonIterator(((Node)obj).node));
- }
- // Convert var/param -> node-set
- else if (obj instanceof DTMAxisIterator) {
- return(((DTMAxisIterator)obj).cloneIterator().reset());
- }
- else {
- final String className = obj.getClass().getName();
- runTimeError(DATA_CONVERSION_ERR, className, "node-set");
- return null;
- }
- }
-
- /**
- * Utility function: used to convert reference to org.w3c.dom.NodeList.
- */
- public static NodeList referenceToNodeList(Object obj, DOM dom) {
- if (obj instanceof Node || obj instanceof DTMAxisIterator) {
- DTMAxisIterator iter = referenceToNodeSet(obj);
- return dom.makeNodeList(iter);
- }
- else if (obj instanceof DOM) {
- dom = (DOM)obj;
- return dom.makeNodeList(DTMDefaultBase.ROOTNODE);
- }
- else {
- final String className = obj.getClass().getName();
- runTimeError(DATA_CONVERSION_ERR, className,
- "org.w3c.dom.NodeList");
- return null;
- }
- }
-
- /**
- * Utility function: used to convert reference to org.w3c.dom.Node.
- */
- public static org.w3c.dom.Node referenceToNode(Object obj, DOM dom) {
- if (obj instanceof Node || obj instanceof DTMAxisIterator) {
- DTMAxisIterator iter = referenceToNodeSet(obj);
- return dom.makeNode(iter);
- }
- else if (obj instanceof DOM) {
- dom = (DOM)obj;
- DTMAxisIterator iter = dom.getChildren(DTMDefaultBase.ROOTNODE);
- return dom.makeNode(iter);
- }
- else {
- final String className = obj.getClass().getName();
- runTimeError(DATA_CONVERSION_ERR, className, "org.w3c.dom.Node");
- return null;
- }
- }
-
- /**
- * Utility function: used to convert reference to long.
- */
- public static long referenceToLong(Object obj) {
- if (obj instanceof Number) {
- return ((Number) obj).longValue(); // handles Integer and Double
- }
- else {
- final String className = obj.getClass().getName();
- runTimeError(DATA_CONVERSION_ERR, className, Long.TYPE);
- return 0;
- }
- }
-
- /**
- * Utility function: used to convert reference to double.
- */
- public static double referenceToDouble(Object obj) {
- if (obj instanceof Number) {
- return ((Number) obj).doubleValue(); // handles Integer and Double
- }
- else {
- final String className = obj.getClass().getName();
- runTimeError(DATA_CONVERSION_ERR, className, Double.TYPE);
- return 0;
- }
- }
-
- /**
- * Utility function: used to convert reference to boolean.
- */
- public static boolean referenceToBoolean(Object obj) {
- if (obj instanceof Boolean) {
- return ((Boolean) obj).booleanValue();
- }
- else {
- final String className = obj.getClass().getName();
- runTimeError(DATA_CONVERSION_ERR, className, Boolean.TYPE);
- return false;
- }
- }
-
- /**
- * Utility function: used to convert reference to String.
- */
- public static String referenceToString(Object obj, DOM dom) {
- if (obj instanceof String) {
- return (String) obj;
- }
- else if (obj instanceof DTMAxisIterator) {
- return dom.getStringValueX(((DTMAxisIterator)obj).reset().next());
- }
- else if (obj instanceof Node) {
- return dom.getStringValueX(((Node)obj).node);
- }
- else if (obj instanceof DOM) {
- return ((DOM) obj).getStringValue();
- }
- else {
- final String className = obj.getClass().getName();
- runTimeError(DATA_CONVERSION_ERR, className, String.class);
- return null;
- }
- }
-
- /**
- * Utility function used to convert a w3c Node into an internal DOM iterator.
- */
- public static DTMAxisIterator node2Iterator(org.w3c.dom.Node node,
- Translet translet, DOM dom)
- {
- final org.w3c.dom.Node inNode = node;
- // Create a dummy NodeList which only contains the given node to make
- // use of the nodeList2Iterator() interface.
- org.w3c.dom.NodeList nodelist = new org.w3c.dom.NodeList() {
- public int getLength() {
- return 1;
- }
-
- public org.w3c.dom.Node item(int index) {
- if (index == 0)
- return inNode;
- else
- return null;
- }
- };
-
- return nodeList2Iterator(nodelist, translet, dom);
- }
-
- /**
- * In a perfect world, this would be the implementation for
- * nodeList2Iterator. In reality, though, this causes a
- * ClassCastException in getDTMHandleFromNode because SAXImpl is
- * not an instance of DOM2DTM. So we use the more lengthy
- * implementation below until this issue has been addressed.
- *
- * @see org.apache.xml.dtm.ref.DTMManagerDefault#getDTMHandleFromNode
- */
- private static DTMAxisIterator nodeList2IteratorUsingHandleFromNode(
- org.w3c.dom.NodeList nodeList,
- Translet translet, DOM dom)
- {
- final int n = nodeList.getLength();
- final int[] dtmHandles = new int[n];
- DTMManager dtmManager = null;
- if (dom instanceof MultiDOM)
- dtmManager = ((MultiDOM) dom).getDTMManager();
- for (int i = 0; i < n; ++i) {
- org.w3c.dom.Node node = nodeList.item(i);
- int handle;
- if (dtmManager != null) {
- handle = dtmManager.getDTMHandleFromNode(node);
- }
- else if (node instanceof DTMNodeProxy
- && ((DTMNodeProxy) node).getDTM() == dom) {
- handle = ((DTMNodeProxy) node).getDTMNodeNumber();
- }
- else {
- runTimeError(RUN_TIME_INTERNAL_ERR, "need MultiDOM");
- return null;
- }
- dtmHandles[i] = handle;
- System.out.println("Node " + i + " has handle 0x" +
- Integer.toString(handle, 16));
- }
- return new ArrayNodeListIterator(dtmHandles);
- }
-
- /**
- * Utility function used to convert a w3c NodeList into a internal
- * DOM iterator.
- */
- public static DTMAxisIterator nodeList2Iterator(
- org.w3c.dom.NodeList nodeList,
- Translet translet, DOM dom)
- {
- // First pass: build w3c DOM for all nodes not proxied from our DOM.
- //
- // Notice: this looses some (esp. parent) context for these nodes,
- // so some way to wrap the original nodes inside a DTMAxisIterator
- // might be preferable in the long run.
- int n = 0; // allow for change in list length, just in case.
- Document doc = null;
- DTMManager dtmManager = null;
- int[] proxyNodes = new int[nodeList.getLength()];
- if (dom instanceof MultiDOM)
- dtmManager = ((MultiDOM) dom).getDTMManager();
- for (int i = 0; i < nodeList.getLength(); ++i) {
- org.w3c.dom.Node node = nodeList.item(i);
- if (node instanceof DTMNodeProxy) {
- DTMNodeProxy proxy = (DTMNodeProxy)node;
- DTM nodeDTM = proxy.getDTM();
- int handle = proxy.getDTMNodeNumber();
- boolean isOurDOM = (nodeDTM == dom);
- if (!isOurDOM && dtmManager != null) {
- try {
- isOurDOM = (nodeDTM == dtmManager.getDTM(handle));
- }
- catch (ArrayIndexOutOfBoundsException e) {
- // invalid node handle, so definitely not our doc
- }
- }
- if (isOurDOM) {
- proxyNodes[i] = handle;
- ++n;
- continue;
- }
- }
- proxyNodes[i] = DTM.NULL;
- int nodeType = node.getNodeType();
- if (doc == null) {
- if (dom instanceof MultiDOM == false) {
- runTimeError(RUN_TIME_INTERNAL_ERR, "need MultiDOM");
- return null;
- }
- try {
- AbstractTranslet at = (AbstractTranslet) translet;
- doc = at.newDocument("", "__top__");
- }
- catch (javax.xml.parsers.ParserConfigurationException e) {
- runTimeError(RUN_TIME_INTERNAL_ERR, e.getMessage());
- return null;
- }
- }
- // Use one dummy element as container for each node of the
- // list. That way, it is easier to detect resp. avoid
- // funny things which change the number of nodes,
- // e.g. auto-concatenation of text nodes.
- Element mid;
- switch (nodeType) {
- case org.w3c.dom.Node.ELEMENT_NODE:
- case org.w3c.dom.Node.TEXT_NODE:
- case org.w3c.dom.Node.CDATA_SECTION_NODE:
- case org.w3c.dom.Node.COMMENT_NODE:
- case org.w3c.dom.Node.ENTITY_REFERENCE_NODE:
- case org.w3c.dom.Node.PROCESSING_INSTRUCTION_NODE:
- mid = doc.createElementNS(null, "__dummy__");
- mid.appendChild(doc.importNode(node, true));
- doc.getDocumentElement().appendChild(mid);
- ++n;
- break;
- case org.w3c.dom.Node.ATTRIBUTE_NODE:
- // The mid element also serves as a container for
- // attributes, avoiding problems with conflicting
- // attributes or node order.
- mid = doc.createElementNS(null, "__dummy__");
- mid.setAttributeNodeNS((Attr)doc.importNode(node, true));
- doc.getDocumentElement().appendChild(mid);
- ++n;
- break;
- default:
- // Better play it safe for all types we aren't sure we know
- // how to deal with.
- runTimeError(RUN_TIME_INTERNAL_ERR,
- "Don't know how to convert node type "
- + nodeType);
- }
- }
-
- // w3cDOM -> DTM -> DOMImpl
- DTMAxisIterator iter = null, childIter = null, attrIter = null;
- if (doc != null) {
- final MultiDOM multiDOM = (MultiDOM) dom;
- DOM idom = (DOM)dtmManager.getDTM(new DOMSource(doc), false,
- null, true, false);
- // Create DOMAdapter and register with MultiDOM
- DOMAdapter domAdapter = new DOMAdapter(idom,
- translet.getNamesArray(),
- translet.getUrisArray(),
- translet.getTypesArray(),
- translet.getNamespaceArray());
- multiDOM.addDOMAdapter(domAdapter);
-
- DTMAxisIterator iter1 = idom.getAxisIterator(Axis.CHILD);
- DTMAxisIterator iter2 = idom.getAxisIterator(Axis.CHILD);
- iter = new AbsoluteIterator(
- new StepIterator(iter1, iter2));
-
- iter.setStartNode(DTMDefaultBase.ROOTNODE);
-
- childIter = idom.getAxisIterator(Axis.CHILD);
- attrIter = idom.getAxisIterator(Axis.ATTRIBUTE);
- }
-
- // Second pass: find DTM handles for every node in the list.
- int[] dtmHandles = new int[n];
- n = 0;
- for (int i = 0; i < nodeList.getLength(); ++i) {
- if (proxyNodes[i] != DTM.NULL) {
- dtmHandles[n++] = proxyNodes[i];
- continue;
- }
- org.w3c.dom.Node node = nodeList.item(i);
- DTMAxisIterator iter3 = null;
- int nodeType = node.getNodeType();
- switch (nodeType) {
- case org.w3c.dom.Node.ELEMENT_NODE:
- case org.w3c.dom.Node.TEXT_NODE:
- case org.w3c.dom.Node.CDATA_SECTION_NODE:
- case org.w3c.dom.Node.COMMENT_NODE:
- case org.w3c.dom.Node.ENTITY_REFERENCE_NODE:
- case org.w3c.dom.Node.PROCESSING_INSTRUCTION_NODE:
- iter3 = childIter;
- break;
- case org.w3c.dom.Node.ATTRIBUTE_NODE:
- iter3 = attrIter;
- break;
- default:
- // Should not happen, as first run should have got all these
- throw new InternalRuntimeError("Mismatched cases");
- }
- if (iter3 != null) {
- iter3.setStartNode(iter.next());
- dtmHandles[n] = iter3.next();
- // For now, play it self and perform extra checks:
- if (dtmHandles[n] == DTMAxisIterator.END)
- throw new InternalRuntimeError("Expected element missing at " + i);
- if (iter3.next() != DTMAxisIterator.END)
- throw new InternalRuntimeError("Too many elements at " + i);
- ++n;
- }
- }
- if (n != dtmHandles.length)
- throw new InternalRuntimeError("Nodes lost in second pass");
-
- return new ArrayNodeListIterator(dtmHandles);
- }
-
- /**
- * Utility function used to convert references to DOMs.
- */
- public static DOM referenceToResultTree(Object obj) {
- try {
- return ((DOM) obj);
- }
- catch (IllegalArgumentException e) {
- final String className = obj.getClass().getName();
- runTimeError(DATA_CONVERSION_ERR, "reference", className);
- return null;
- }
- }
-
- /**
- * Utility function: used with nth position filters to convert a sequence
- * of nodes to just one single node (the one at position n).
- */
- public static DTMAxisIterator getSingleNode(DTMAxisIterator iterator) {
- int node = iterator.next();
- return(new SingletonIterator(node));
- }
-
- /**
- * Utility function: used in xsl:copy.
- */
- private static char[] _characterArray = new char[32];
-
- public static void copy(Object obj,
- SerializationHandler handler,
- int node,
- DOM dom) {
- try {
- if (obj instanceof DTMAxisIterator)
- {
- DTMAxisIterator iter = (DTMAxisIterator) obj;
- dom.copy(iter.reset(), handler);
- }
- else if (obj instanceof Node) {
- dom.copy(((Node) obj).node, handler);
- }
- else if (obj instanceof DOM) {
- //((DOM)obj).copy(((com.sun.org.apache.xml.internal.dtm.ref.DTMDefaultBase)((DOMAdapter)obj).getDOMImpl()).getDocument(), handler);
- DOM newDom = (DOM)obj;
- newDom.copy(newDom.getDocument(), handler);
- }
- else {
- String string = obj.toString(); // or call stringF()
- final int length = string.length();
- if (length > _characterArray.length)
- _characterArray = new char[length];
- string.getChars(0, length, _characterArray, 0);
- handler.characters(_characterArray, 0, length);
- }
- }
- catch (SAXException e) {
- runTimeError(RUN_TIME_COPY_ERR);
- }
- }
-
- /**
- * Utility function to check if xsl:attribute has a valid qname
- * This method should only be invoked if the name attribute is an AVT
- */
- public static void checkAttribQName(String name) {
- final int firstOccur = name.indexOf(":");
- final int lastOccur = name.lastIndexOf(":");
- final String localName = name.substring(lastOccur + 1);
-
- if (firstOccur > 0) {
- final String newPrefix = name.substring(0, firstOccur);
-
- if (firstOccur != lastOccur) {
- final String oriPrefix = name.substring(firstOccur+1, lastOccur);
- if (!XML11Char.isXML11ValidNCName(oriPrefix)) {
- // even though the orignal prefix is ignored, it should still get checked for valid NCName
- runTimeError(INVALID_QNAME_ERR,oriPrefix+":"+localName);
- }
- }
-
- // prefix must be a valid NCName
- if (!XML11Char.isXML11ValidNCName(newPrefix)) {
- runTimeError(INVALID_QNAME_ERR,newPrefix+":"+localName);
- }
- }
-
- // local name must be a valid NCName and must not be XMLNS
- if ((!XML11Char.isXML11ValidNCName(localName))||(localName.equals(Constants.XMLNS_PREFIX))) {
- runTimeError(INVALID_QNAME_ERR,localName);
- }
- }
-
- /**
- * Utility function to check if a name is a valid ncname
- * This method should only be invoked if the attribute value is an AVT
- */
- public static void checkNCName(String name) {
- if (!XML11Char.isXML11ValidNCName(name)) {
- runTimeError(INVALID_NCNAME_ERR,name);
- }
- }
-
- /**
- * Utility function to check if a name is a valid qname
- * This method should only be invoked if the attribute value is an AVT
- */
- public static void checkQName(String name) {
- if (!XML11Char.isXML11ValidQName(name)) {
- runTimeError(INVALID_QNAME_ERR,name);
- }
- }
-
- /**
- * Utility function for the implementation of xsl:element.
- */
- public static String startXslElement(String qname, String namespace,
- SerializationHandler handler, DOM dom, int node)
- {
- try {
- // Get prefix from qname
- String prefix;
- final int index = qname.indexOf(':');
-
- if (index > 0) {
- prefix = qname.substring(0, index);
-
- // Handle case when prefix is not known at compile time
- if (namespace == null || namespace.length() == 0) {
- try {
- // not sure if this line of code ever works
- namespace = dom.lookupNamespace(node, prefix);
- }
- catch(RuntimeException e) {
- handler.flushPending(); // need to flush or else can't get namespacemappings
- NamespaceMappings nm = handler.getNamespaceMappings();
- namespace = nm.lookupNamespace(prefix);
- if (namespace == null) {
- runTimeError(NAMESPACE_PREFIX_ERR,prefix);
- }
- }
- }
-
- handler.startElement(namespace, qname.substring(index+1),
- qname);
- handler.namespaceAfterStartElement(prefix, namespace);
- }
- else {
- // Need to generate a prefix?
- if (namespace != null && namespace.length() > 0) {
- prefix = generatePrefix();
- qname = prefix + ':' + qname;
- handler.startElement(namespace, qname, qname);
- handler.namespaceAfterStartElement(prefix, namespace);
- }
- else {
- handler.startElement(null, null, qname);
- }
- }
- }
- catch (SAXException e) {
- throw new RuntimeException(e.getMessage());
- }
-
- return qname;
- }
-
- /**
- * This function is used in the execution of xsl:element
- */
- public static String getPrefix(String qname) {
- final int index = qname.indexOf(':');
- return (index > 0) ? qname.substring(0, index) : null;
- }
-
- /**
- * These functions are used in the execution of xsl:element to generate
- * and reset namespace prefix index local to current transformation process
- */
- public static String generatePrefix() {
- return ("ns" + threadLocalPrefixIndex.get().getAndIncrement());
- }
-
- public static void resetPrefixIndex() {
- threadLocalPrefixIndex.get().set(0);
- }
-
- private static final ThreadLocal<AtomicInteger> threadLocalPrefixIndex =
- new ThreadLocal<AtomicInteger>() {
- @Override
- protected AtomicInteger initialValue() {
- return new AtomicInteger();
- }
- };
-
- public static final String RUN_TIME_INTERNAL_ERR =
- "RUN_TIME_INTERNAL_ERR";
- public static final String RUN_TIME_COPY_ERR =
- "RUN_TIME_COPY_ERR";
- public static final String DATA_CONVERSION_ERR =
- "DATA_CONVERSION_ERR";
- public static final String EXTERNAL_FUNC_ERR =
- "EXTERNAL_FUNC_ERR";
- public static final String EQUALITY_EXPR_ERR =
- "EQUALITY_EXPR_ERR";
- public static final String INVALID_ARGUMENT_ERR =
- "INVALID_ARGUMENT_ERR";
- public static final String FORMAT_NUMBER_ERR =
- "FORMAT_NUMBER_ERR";
- public static final String ITERATOR_CLONE_ERR =
- "ITERATOR_CLONE_ERR";
- public static final String AXIS_SUPPORT_ERR =
- "AXIS_SUPPORT_ERR";
- public static final String TYPED_AXIS_SUPPORT_ERR =
- "TYPED_AXIS_SUPPORT_ERR";
- public static final String STRAY_ATTRIBUTE_ERR =
- "STRAY_ATTRIBUTE_ERR";
- public static final String STRAY_NAMESPACE_ERR =
- "STRAY_NAMESPACE_ERR";
- public static final String NAMESPACE_PREFIX_ERR =
- "NAMESPACE_PREFIX_ERR";
- public static final String DOM_ADAPTER_INIT_ERR =
- "DOM_ADAPTER_INIT_ERR";
- public static final String PARSER_DTD_SUPPORT_ERR =
- "PARSER_DTD_SUPPORT_ERR";
- public static final String NAMESPACES_SUPPORT_ERR =
- "NAMESPACES_SUPPORT_ERR";
- public static final String CANT_RESOLVE_RELATIVE_URI_ERR =
- "CANT_RESOLVE_RELATIVE_URI_ERR";
- public static final String UNSUPPORTED_XSL_ERR =
- "UNSUPPORTED_XSL_ERR";
- public static final String UNSUPPORTED_EXT_ERR =
- "UNSUPPORTED_EXT_ERR";
- public static final String UNKNOWN_TRANSLET_VERSION_ERR =
- "UNKNOWN_TRANSLET_VERSION_ERR";
- public static final String INVALID_QNAME_ERR = "INVALID_QNAME_ERR";
- public static final String INVALID_NCNAME_ERR = "INVALID_NCNAME_ERR";
- public static final String UNALLOWED_EXTENSION_FUNCTION_ERR = "UNALLOWED_EXTENSION_FUNCTION_ERR";
- public static final String UNALLOWED_EXTENSION_ELEMENT_ERR = "UNALLOWED_EXTENSION_ELEMENT_ERR";
-
- // All error messages are localized and are stored in resource bundles.
- private static ResourceBundle m_bundle;
-
- public final static String ERROR_MESSAGES_KEY = "error-messages";
-
- static {
- String resource = "com.sun.org.apache.xalan.internal.xsltc.runtime.ErrorMessages";
- m_bundle = SecuritySupport.getResourceBundle(resource);
- }
-
- /**
- * Print a run-time error message.
- */
- public static void runTimeError(String code) {
- throw new RuntimeException(m_bundle.getString(code));
- }
-
- public static void runTimeError(String code, Object[] args) {
- final String message = MessageFormat.format(m_bundle.getString(code),
- args);
- throw new RuntimeException(message);
- }
-
- public static void runTimeError(String code, Object arg0) {
- runTimeError(code, new Object[]{ arg0 } );
- }
-
- public static void runTimeError(String code, Object arg0, Object arg1) {
- runTimeError(code, new Object[]{ arg0, arg1 } );
- }
-
- public static void consoleOutput(String msg) {
- System.out.println(msg);
- }
-
- /**
- * Replace a certain character in a string with a new substring.
- */
- public static String replace(String base, char ch, String str) {
- return (base.indexOf(ch) < 0) ? base :
- replace(base, String.valueOf(ch), new String[] { str });
- }
-
- public static String replace(String base, String delim, String[] str) {
- final int len = base.length();
- final StringBuilder result = threadLocalStringBuilder.get();
- result.setLength(0);
-
- for (int i = 0; i < len; i++) {
- final char ch = base.charAt(i);
- final int k = delim.indexOf(ch);
-
- if (k >= 0) {
- result.append(str[k]);
- }
- else {
- result.append(ch);
- }
- }
- return result.toString();
- }
-
-
- /**
- * Utility method to allow setting parameters of the form
- * {namespaceuri}localName
- * which get mapped to an instance variable in the class
- * Hence a parameter of the form "{http://foo.bar}xyz"
- * will be replaced with the corresponding values
- * by the BasisLibrary's utility method mapQNametoJavaName
- * and thus get mapped to legal java variable names
- */
- public static String mapQNameToJavaName (String base ) {
- return replace(base, ".-:/{}?#%*",
- new String[] { "$dot$", "$dash$" ,"$colon$", "$slash$",
- "","$colon$","$ques$","$hash$","$per$",
- "$aster$"});
-
- }
-
- /**
- * Utility method to calculate string-length as a number of code points,
- * to avoid possible errors with string that contains
- * complementary characters
- */
- public static int getStringLength(String str) {
- return str.codePointCount(0,str.length());
- }
-
- //-- End utility functions
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/Constants.java b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/Constants.java
deleted file mode 100644
index 74a87a7..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/Constants.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Constants.java,v 1.2.4.1 2005/09/06 11:01:29 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.runtime;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-
-/**
- * This class defines constants used by both the compiler and the
- * runtime system.
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-public interface Constants {
-
- final static int ANY = -1;
- final static int ATTRIBUTE = -2;
- final static int ROOT = DTM.ROOT_NODE;
- final static int TEXT = DTM.TEXT_NODE;
- final static int ELEMENT = DTM.ELEMENT_NODE;
- final static int COMMENT = DTM.COMMENT_NODE;
- final static int PROCESSING_INSTRUCTION = DTM.PROCESSING_INSTRUCTION_NODE;
-
- public static final String XSLT_URI = "http://www.w3.org/1999/XSL/Transform";
- public static final String NAMESPACE_FEATURE =
- "http://xml.org/sax/features/namespaces";
-
- public static final String EMPTYSTRING = "";
- public static final String XML_PREFIX = "xml";
- public static final String XMLNS_PREFIX = "xmlns";
- public static final String XMLNS_STRING = "xmlns:";
- public static final String XMLNS_URI = "http://www.w3.org/2000/xmlns/";
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages.java b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages.java
deleted file mode 100644
index fe98ae9..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.runtime;
-
-import java.util.ListResourceBundle;
-
-/**
- * @author Morten Jorgensen
- */
-public class ErrorMessages extends ListResourceBundle {
-
-/*
- * XSLTC run-time error messages.
- *
- * General notes to translators and definitions:
- *
- * 1) XSLTC is the name of the product. It is an acronym for XML Stylesheet:
- * Transformations Compiler
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant output XML document (or HTML document or text)
- *
- * 3) An axis is a particular "dimension" in a tree representation of an XML
- * document; the nodes in the tree are divided along different axes.
- * Traversing the "child" axis, for instance, means that the program
- * would visit each child of a particular node; traversing the "descendant"
- * axis means that the program would visit the child nodes of a particular
- * node, their children, and so on until the leaf nodes of the tree are
- * reached.
- *
- * 4) An iterator is an object that traverses nodes in a tree along a
- * particular axis, one at a time.
- *
- * 5) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 6) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 7) DOM is an acronym for Document Object Model. It is a tree
- * representation of an XML document.
- *
- * SAX is an acronym for the Simple API for XML processing. It is an API
- * used inform an XML processor (in this case XSLTC) of the structure and
- * content of an XML document.
- *
- * Input to the stylesheet processor can come from an XML parser in the
- * form of a DOM tree or through the SAX API.
- *
- * 8) DTD is a document type declaration. It is a way of specifying the
- * grammar for an XML file, the names and types of elements, attributes,
- * etc.
- *
- * 9) Translet is an invented term that refers to the class file that contains
- * the compiled form of a stylesheet.
- */
-
- // These message should be read from a locale-specific resource bundle
- /** Get the lookup table for error messages.
- *
- * @return The message lookup table.
- */
- public Object[][] getContents()
- {
- return new Object[][] {
-
- /*
- * Note to translators: the substitution text in the following message
- * is a class name. Used for internal errors in the processor.
- */
- {BasisLibrary.RUN_TIME_INTERNAL_ERR,
- "Run-time internal error in ''{0}''"},
-
- /*
- * Note to translators: <xsl:copy> is a keyword that should not be
- * translated.
- */
- {BasisLibrary.RUN_TIME_COPY_ERR,
- "Run-time error when executing <xsl:copy>."},
-
- /*
- * Note to translators: The substitution text refers to data types.
- * The message is displayed if a value in a particular context needs to
- * be converted to type {1}, but that's not possible for a value of type
- * {0}.
- */
- {BasisLibrary.DATA_CONVERSION_ERR,
- "Invalid conversion from ''{0}'' to ''{1}''."},
-
- /*
- * Note to translators: This message is displayed if the function named
- * by the substitution text is not a function that is supported. XSLTC
- * is the acronym naming the product.
- */
- {BasisLibrary.EXTERNAL_FUNC_ERR,
- "External function ''{0}'' not supported by XSLTC."},
-
- /*
- * Note to translators: This message is displayed if two values are
- * compared for equality, but the data type of one of the values is
- * unknown.
- */
- {BasisLibrary.EQUALITY_EXPR_ERR,
- "Unknown argument type in equality expression."},
-
- /*
- * Note to translators: The substitution text for {0} will be a data
- * type; the substitution text for {1} will be the name of a function.
- * This is displayed if an argument of the particular data type is not
- * permitted for a call to this function.
- */
- {BasisLibrary.INVALID_ARGUMENT_ERR,
- "Invalid argument type ''{0}'' in call to ''{1}''"},
-
- /*
- * Note to translators: There is way of specifying a format for a
- * number using a pattern; the processor was unable to format the
- * particular value using the specified pattern.
- */
- {BasisLibrary.FORMAT_NUMBER_ERR,
- "Attempting to format number ''{0}'' using pattern ''{1}''."},
-
- /*
- * Note to translators: The following represents an internal error
- * situation in XSLTC. The processor was unable to create a copy of an
- * iterator. (See definition of iterator above.)
- */
- {BasisLibrary.ITERATOR_CLONE_ERR,
- "Cannot clone iterator ''{0}''."},
-
- /*
- * Note to translators: The following represents an internal error
- * situation in XSLTC. The processor attempted to create an iterator
- * for a particular axis (see definition above) that it does not
- * support.
- */
- {BasisLibrary.AXIS_SUPPORT_ERR,
- "Iterator for axis ''{0}'' not supported."},
-
- /*
- * Note to translators: The following represents an internal error
- * situation in XSLTC. The processor attempted to create an iterator
- * for a particular axis (see definition above) that it does not
- * support.
- */
- {BasisLibrary.TYPED_AXIS_SUPPORT_ERR,
- "Iterator for typed axis ''{0}'' not supported."},
-
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- {BasisLibrary.STRAY_ATTRIBUTE_ERR,
- "Attribute ''{0}'' outside of element."},
-
- /*
- * Note to translators: As with the preceding message, a namespace
- * declaration has the form of an attribute and is only permitted to
- * appear on an element. The substitution text {0} is the namespace
- * prefix and {1} is the URI that was being used in the erroneous
- * namespace declaration.
- */
- {BasisLibrary.STRAY_NAMESPACE_ERR,
- "Namespace declaration ''{0}''=''{1}'' outside of element."},
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- {BasisLibrary.NAMESPACE_PREFIX_ERR,
- "Namespace for prefix ''{0}'' has not been declared."},
-
- /*
- * Note to translators: The following represents an internal error.
- * DOMAdapter is a Java class in XSLTC.
- */
- {BasisLibrary.DOM_ADAPTER_INIT_ERR,
- "DOMAdapter created using wrong type of source DOM."},
-
- /*
- * Note to translators: The following message indicates that the XML
- * parser that is providing input to XSLTC cannot be used because it
- * does not describe to XSLTC the structure of the input XML document's
- * DTD.
- */
- {BasisLibrary.PARSER_DTD_SUPPORT_ERR,
- "The SAX parser you are using does not handle DTD declaration events."},
-
- /*
- * Note to translators: The following message indicates that the XML
- * parser that is providing input to XSLTC cannot be used because it
- * does not distinguish between ordinary XML attributes and namespace
- * declarations.
- */
- {BasisLibrary.NAMESPACES_SUPPORT_ERR,
- "The SAX parser you are using does not have support for XML Namespaces."},
-
- /*
- * Note to translators: The substitution text is the URI that was in
- * error.
- */
- {BasisLibrary.CANT_RESOLVE_RELATIVE_URI_ERR,
- "Could not resolve the URI reference ''{0}''."},
-
- /*
- * Note to translators: The stylesheet contained an element that was
- * not recognized as part of the XSL syntax. The substitution text
- * gives the element name.
- */
- {BasisLibrary.UNSUPPORTED_XSL_ERR,
- "Unsupported XSL element ''{0}''"},
-
- /*
- * Note to translators: The stylesheet referred to an extension to the
- * XSL syntax and indicated that it was defined by XSLTC, but XSLTC does
- * not recognize the particular extension named. The substitution text
- * gives the extension name.
- */
- {BasisLibrary.UNSUPPORTED_EXT_ERR,
- "Unrecognized XSLTC extension ''{0}''"},
-
-
- /*
- * Note to translators: This error message is produced if the translet
- * class was compiled using a newer version of XSLTC and deployed for
- * execution with an older version of XSLTC. The substitution text is
- * the name of the translet class.
- */
- {BasisLibrary.UNKNOWN_TRANSLET_VERSION_ERR,
- "The specified translet, ''{0}'', was created using a version of XSLTC more recent than the version of the XSLTC run-time that is in use. You must recompile the stylesheet or use a more recent version of XSLTC to run this translet."},
-
- /*
- * Note to translators: An attribute whose effective value is required
- * to be a "QName" had a value that was incorrect.
- * 'QName' is an XML syntactic term that must not be translated. The
- * substitution text contains the actual value of the attribute.
- */
- {BasisLibrary.INVALID_QNAME_ERR,
- "An attribute whose value must be a QName had the value ''{0}''"},
-
-
- /*
- * Note to translators: An attribute whose effective value is required
- * to be a "NCName" had a value that was incorrect.
- * 'NCName' is an XML syntactic term that must not be translated. The
- * substitution text contains the actual value of the attribute.
- */
- {BasisLibrary.INVALID_NCNAME_ERR,
- "An attribute whose value must be an NCName had the value ''{0}''"},
-
- {BasisLibrary.UNALLOWED_EXTENSION_FUNCTION_ERR,
- "Use of the extension function ''{0}'' is not allowed when the secure processing feature is set to true."},
-
- {BasisLibrary.UNALLOWED_EXTENSION_ELEMENT_ERR,
- "Use of the extension element ''{0}'' is not allowed when the secure processing feature is set to true."},
- };
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ca.java b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ca.java
deleted file mode 100644
index a2b2ba1..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ca.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ErrorMessages_ca.java,v 1.1.6.1 2005/09/06 10:45:37 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.runtime;
-
-import java.util.ListResourceBundle;
-
-/**
- * @author Morten Jorgensen
- */
-public class ErrorMessages_ca extends ListResourceBundle {
-
-/*
- * XSLTC run-time error messages.
- *
- * General notes to translators and definitions:
- *
- * 1) XSLTC is the name of the product. It is an acronym for XML Stylesheet:
- * Transformations Compiler
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant output XML document (or HTML document or text)
- *
- * 3) An axis is a particular "dimension" in a tree representation of an XML
- * document; the nodes in the tree are divided along different axes.
- * Traversing the "child" axis, for instance, means that the program
- * would visit each child of a particular node; traversing the "descendant"
- * axis means that the program would visit the child nodes of a particular
- * node, their children, and so on until the leaf nodes of the tree are
- * reached.
- *
- * 4) An iterator is an object that traverses nodes in a tree along a
- * particular axis, one at a time.
- *
- * 5) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 6) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 7) DOM is an acronym for Document Object Model. It is a tree
- * representation of an XML document.
- *
- * SAX is an acronym for the Simple API for XML processing. It is an API
- * used inform an XML processor (in this case XSLTC) of the structure and
- * content of an XML document.
- *
- * Input to the stylesheet processor can come from an XML parser in the
- * form of a DOM tree or through the SAX API.
- *
- * 8) DTD is a document type declaration. It is a way of specifying the
- * grammar for an XML file, the names and types of elements, attributes,
- * etc.
- *
- */
-
- // These message should be read from a locale-specific resource bundle
- /** Get the lookup table for error messages.
- *
- * @return The message lookup table.
- */
- public Object[][] getContents()
- {
- return new Object[][] {
-
- /*
- * Note to translators: the substitution text in the following message
- * is a class name. Used for internal errors in the processor.
- */
- {BasisLibrary.RUN_TIME_INTERNAL_ERR,
- "S''ha produ\u00eft un error intern de temps d''execuci\u00f3 a ''{0}''"},
-
- /*
- * Note to translators: <xsl:copy> is a keyword that should not be
- * translated.
- */
- {BasisLibrary.RUN_TIME_COPY_ERR,
- "Es produeix un error de temps d'execuci\u00f3 en executar <xsl:copy>."},
-
- /*
- * Note to translators: The substitution text refers to data types.
- * The message is displayed if a value in a particular context needs to
- * be converted to type {1}, but that's not possible for a value of type
- * {0}.
- */
- {BasisLibrary.DATA_CONVERSION_ERR,
- "La conversi\u00f3 de ''{0}'' a ''{1}'' no \u00e9s v\u00e0lida."},
-
- /*
- * Note to translators: This message is displayed if the function named
- * by the substitution text is not a function that is supported. XSLTC
- * is the acronym naming the product.
- */
- {BasisLibrary.EXTERNAL_FUNC_ERR,
- "XSLTC no d\u00f3na suport a la funci\u00f3 externa ''{0}''."},
-
- /*
- * Note to translators: This message is displayed if two values are
- * compared for equality, but the data type of one of the values is
- * unknown.
- */
- {BasisLibrary.EQUALITY_EXPR_ERR,
- "L'expressi\u00f3 d'igualtat cont\u00e9 un tipus d'argument desconegut."},
-
- /*
- * Note to translators: The substitution text for {0} will be a data
- * type; the substitution text for {1} will be the name of a function.
- * This is displayed if an argument of the particular data type is not
- * permitted for a call to this function.
- */
- {BasisLibrary.INVALID_ARGUMENT_ERR,
- "La crida a ''{1}'' cont\u00e9 un tipus d''argument ''{0}'' no v\u00e0lid."},
-
- /*
- * Note to translators: There is way of specifying a format for a
- * number using a pattern; the processor was unable to format the
- * particular value using the specified pattern.
- */
- {BasisLibrary.FORMAT_NUMBER_ERR,
- "S''ha intentat donar format al n\u00famero ''{0}'' mitjan\u00e7ant el patr\u00f3 ''{1}''."},
-
- /*
- * Note to translators: The following represents an internal error
- * situation in XSLTC. The processor was unable to create a copy of an
- * iterator. (See definition of iterator above.)
- */
- {BasisLibrary.ITERATOR_CLONE_ERR,
- "No es pot clonar l''iterador ''{0}''."},
-
- /*
- * Note to translators: The following represents an internal error
- * situation in XSLTC. The processor attempted to create an iterator
- * for a particular axis (see definition above) that it does not
- * support.
- */
- {BasisLibrary.AXIS_SUPPORT_ERR,
- "L''iterador de l''eix ''{0}'' no t\u00e9 suport."},
-
- /*
- * Note to translators: The following represents an internal error
- * situation in XSLTC. The processor attempted to create an iterator
- * for a particular axis (see definition above) that it does not
- * support.
- */
- {BasisLibrary.TYPED_AXIS_SUPPORT_ERR,
- "L''iterador de l''eix escrit ''{0}'' no t\u00e9 suport."},
-
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- {BasisLibrary.STRAY_ATTRIBUTE_ERR,
- "L''atribut ''{0}'' es troba fora de l''element."},
-
- /*
- * Note to translators: As with the preceding message, a namespace
- * declaration has the form of an attribute and is only permitted to
- * appear on an element. The substitution text {0} is the namespace
- * prefix and {1} is the URI that was being used in the erroneous
- * namespace declaration.
- */
- {BasisLibrary.STRAY_NAMESPACE_ERR,
- "La declaraci\u00f3 d''espai de noms ''{0}''=''{1}'' es troba fora de l''element."},
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- {BasisLibrary.NAMESPACE_PREFIX_ERR,
- "L''espai de noms del prefix ''{0}'' no s''ha declarat."},
-
- /*
- * Note to translators: The following represents an internal error.
- * DOMAdapter is a Java class in XSLTC.
- */
- {BasisLibrary.DOM_ADAPTER_INIT_ERR,
- "DOMAdapter s'ha creat mitjan\u00e7ant un tipus incorrecte de DOM d'origen."},
-
- /*
- * Note to translators: The following message indicates that the XML
- * parser that is providing input to XSLTC cannot be used because it
- * does not describe to XSLTC the structure of the input XML document's
- * DTD.
- */
- {BasisLibrary.PARSER_DTD_SUPPORT_ERR,
- "L'analitzador SAX que feu servir no gestiona esdeveniments de declaraci\u00f3 de DTD."},
-
- /*
- * Note to translators: The following message indicates that the XML
- * parser that is providing input to XSLTC cannot be used because it
- * does not distinguish between ordinary XML attributes and namespace
- * declarations.
- */
- {BasisLibrary.NAMESPACES_SUPPORT_ERR,
- "L'analitzador SAX que feu servir no d\u00f3na suport a espais de noms XML."},
-
- /*
- * Note to translators: The substitution text is the URI that was in
- * error.
- */
- {BasisLibrary.CANT_RESOLVE_RELATIVE_URI_ERR,
- "No s''ha pogut resoldre la refer\u00e8ncia d''URI ''{0}''."}
- };
-
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_cs.java b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_cs.java
deleted file mode 100644
index 88409e1..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_cs.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ErrorMessages_cs.java,v 1.1.6.1 2005/09/06 10:45:37 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.runtime;
-
-import java.util.ListResourceBundle;
-
-/**
- * @author Morten Jorgensen
- */
-public class ErrorMessages_cs extends ListResourceBundle {
-
-/*
- * XSLTC run-time error messages.
- *
- * General notes to translators and definitions:
- *
- * 1) XSLTC is the name of the product. It is an acronym for XML Stylesheet:
- * Transformations Compiler
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant output XML document (or HTML document or text)
- *
- * 3) An axis is a particular "dimension" in a tree representation of an XML
- * document; the nodes in the tree are divided along different axes.
- * Traversing the "child" axis, for instance, means that the program
- * would visit each child of a particular node; traversing the "descendant"
- * axis means that the program would visit the child nodes of a particular
- * node, their children, and so on until the leaf nodes of the tree are
- * reached.
- *
- * 4) An iterator is an object that traverses nodes in a tree along a
- * particular axis, one at a time.
- *
- * 5) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 6) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 7) DOM is an acronym for Document Object Model. It is a tree
- * representation of an XML document.
- *
- * SAX is an acronym for the Simple API for XML processing. It is an API
- * used inform an XML processor (in this case XSLTC) of the structure and
- * content of an XML document.
- *
- * Input to the stylesheet processor can come from an XML parser in the
- * form of a DOM tree or through the SAX API.
- *
- * 8) DTD is a document type declaration. It is a way of specifying the
- * grammar for an XML file, the names and types of elements, attributes,
- * etc.
- *
- */
-
- // These message should be read from a locale-specific resource bundle
- /** Get the lookup table for error messages.
- *
- * @return The message lookup table.
- */
- public Object[][] getContents()
- {
- return new Object[][] {
-
- /*
- * Note to translators: the substitution text in the following message
- * is a class name. Used for internal errors in the processor.
- */
- {BasisLibrary.RUN_TIME_INTERNAL_ERR,
- "Vnit\u0159n\u00ed b\u011bhov\u00e1 chyba v ''{0}''"},
-
- /*
- * Note to translators: <xsl:copy> is a keyword that should not be
- * translated.
- */
- {BasisLibrary.RUN_TIME_COPY_ERR,
- "Vnit\u0159n\u00ed b\u011bhov\u00e1 chyba p\u0159i prov\u00e1d\u011bn\u00ed funkce <xsl:copy>."},
-
- /*
- * Note to translators: The substitution text refers to data types.
- * The message is displayed if a value in a particular context needs to
- * be converted to type {1}, but that's not possible for a value of type
- * {0}.
- */
- {BasisLibrary.DATA_CONVERSION_ERR,
- "Neplatn\u00e1 konverze z ''{0}'' do ''{1}''."},
-
- /*
- * Note to translators: This message is displayed if the function named
- * by the substitution text is not a function that is supported. XSLTC
- * is the acronym naming the product.
- */
- {BasisLibrary.EXTERNAL_FUNC_ERR,
- "Extern\u00ed funkce ''{0}'' nen\u00ed podporov\u00e1na produktem SLTC."},
-
- /*
- * Note to translators: This message is displayed if two values are
- * compared for equality, but the data type of one of the values is
- * unknown.
- */
- {BasisLibrary.EQUALITY_EXPR_ERR,
- "Nezn\u00e1m\u00fd typ argumentu ve v\u00fdrazu rovnosti."},
-
- /*
- * Note to translators: The substitution text for {0} will be a data
- * type; the substitution text for {1} will be the name of a function.
- * This is displayed if an argument of the particular data type is not
- * permitted for a call to this function.
- */
- {BasisLibrary.INVALID_ARGUMENT_ERR,
- "Neplatn\u00fd typ argumentu ''{0}'' p\u0159i vol\u00e1n\u00ed ''{1}''"},
-
- /*
- * Note to translators: There is way of specifying a format for a
- * number using a pattern; the processor was unable to format the
- * particular value using the specified pattern.
- */
- {BasisLibrary.FORMAT_NUMBER_ERR,
- "Pokus form\u00e1tovat \u010d\u00edslo ''{0}'' pou\u017eit\u00edm vzorku ''{1}''."},
-
- /*
- * Note to translators: The following represents an internal error
- * situation in XSLTC. The processor was unable to create a copy of an
- * iterator. (See definition of iterator above.)
- */
- {BasisLibrary.ITERATOR_CLONE_ERR,
- "Nelze klonovat iter\u00e1tor ''{0}''."},
-
- /*
- * Note to translators: The following represents an internal error
- * situation in XSLTC. The processor attempted to create an iterator
- * for a particular axis (see definition above) that it does not
- * support.
- */
- {BasisLibrary.AXIS_SUPPORT_ERR,
- "Iter\u00e1tor pro osu ''{0}'' nen\u00ed podporov\u00e1n."},
-
- /*
- * Note to translators: The following represents an internal error
- * situation in XSLTC. The processor attempted to create an iterator
- * for a particular axis (see definition above) that it does not
- * support.
- */
- {BasisLibrary.TYPED_AXIS_SUPPORT_ERR,
- "Iter\u00e1tor pro typizovanou osu ''{0}'' nen\u00ed podporov\u00e1n."},
-
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- {BasisLibrary.STRAY_ATTRIBUTE_ERR,
- "Atribut ''{0}'' je vn\u011b prvku."},
-
- /*
- * Note to translators: As with the preceding message, a namespace
- * declaration has the form of an attribute and is only permitted to
- * appear on an element. The substitution text {0} is the namespace
- * prefix and {1} is the URI that was being used in the erroneous
- * namespace declaration.
- */
- {BasisLibrary.STRAY_NAMESPACE_ERR,
- "Deklarace oboru n\u00e1zv\u016f ''{0}''=''{1}'' je vn\u011b prvku."},
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- {BasisLibrary.NAMESPACE_PREFIX_ERR,
- "Obor n\u00e1zv\u016f pro p\u0159edponu ''{0}'' nebyl deklarov\u00e1n."},
-
- /*
- * Note to translators: The following represents an internal error.
- * DOMAdapter is a Java class in XSLTC.
- */
- {BasisLibrary.DOM_ADAPTER_INIT_ERR,
- "DOMAdapter byl vytvo\u0159en s pou\u017eit\u00edm chybn\u00e9ho typu zdroje DOM."},
-
- /*
- * Note to translators: The following message indicates that the XML
- * parser that is providing input to XSLTC cannot be used because it
- * does not describe to XSLTC the structure of the input XML document's
- * DTD.
- */
- {BasisLibrary.PARSER_DTD_SUPPORT_ERR,
- "Pou\u017eit\u00fd analyz\u00e1tor SAX nem\u016f\u017ee manipulovat s deklara\u010dn\u00edmi ud\u00e1lostmi DTD."},
-
- /*
- * Note to translators: The following message indicates that the XML
- * parser that is providing input to XSLTC cannot be used because it
- * does not distinguish between ordinary XML attributes and namespace
- * declarations.
- */
- {BasisLibrary.NAMESPACES_SUPPORT_ERR,
- "Pou\u017eit\u00fd analyz\u00e1tor SAX nem\u016f\u017ee podporovat obory n\u00e1zv\u016f pro XML."},
-
- /*
- * Note to translators: The substitution text is the URI that was in
- * error.
- */
- {BasisLibrary.CANT_RESOLVE_RELATIVE_URI_ERR,
- "Nelze p\u0159elo\u017eit odkazy URI ''{0}''."}
- };
-
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_de.java b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_de.java
deleted file mode 100644
index b86e7de..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_de.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.runtime;
-
-import java.util.ListResourceBundle;
-
-/**
- * @author Morten Jorgensen
- */
-public class ErrorMessages_de extends ListResourceBundle {
-
-/*
- * XSLTC run-time error messages.
- *
- * General notes to translators and definitions:
- *
- * 1) XSLTC is the name of the product. It is an acronym for XML Stylesheet:
- * Transformations Compiler
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant output XML document (or HTML document or text)
- *
- * 3) An axis is a particular "dimension" in a tree representation of an XML
- * document; the nodes in the tree are divided along different axes.
- * Traversing the "child" axis, for instance, means that the program
- * would visit each child of a particular node; traversing the "descendant"
- * axis means that the program would visit the child nodes of a particular
- * node, their children, and so on until the leaf nodes of the tree are
- * reached.
- *
- * 4) An iterator is an object that traverses nodes in a tree along a
- * particular axis, one at a time.
- *
- * 5) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 6) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 7) DOM is an acronym for Document Object Model. It is a tree
- * representation of an XML document.
- *
- * SAX is an acronym for the Simple API for XML processing. It is an API
- * used inform an XML processor (in this case XSLTC) of the structure and
- * content of an XML document.
- *
- * Input to the stylesheet processor can come from an XML parser in the
- * form of a DOM tree or through the SAX API.
- *
- * 8) DTD is a document type declaration. It is a way of specifying the
- * grammar for an XML file, the names and types of elements, attributes,
- * etc.
- *
- * 9) Translet is an invented term that refers to the class file that contains
- * the compiled form of a stylesheet.
- */
-
- // These message should be read from a locale-specific resource bundle
- /** Get the lookup table for error messages.
- *
- * @return The message lookup table.
- */
- public Object[][] getContents()
- {
- return new Object[][] {
-
- /*
- * Note to translators: the substitution text in the following message
- * is a class name. Used for internal errors in the processor.
- */
- {BasisLibrary.RUN_TIME_INTERNAL_ERR,
- "Interner Laufzeitfehler in \"{0}\""},
-
- /*
- * Note to translators: <xsl:copy> is a keyword that should not be
- * translated.
- */
- {BasisLibrary.RUN_TIME_COPY_ERR,
- "Laufzeitfehler beim Ausf\u00FChren von <xsl:copy>."},
-
- /*
- * Note to translators: The substitution text refers to data types.
- * The message is displayed if a value in a particular context needs to
- * be converted to type {1}, but that's not possible for a value of type
- * {0}.
- */
- {BasisLibrary.DATA_CONVERSION_ERR,
- "Ung\u00FCltige Konvertierung von \"{0}\" in \"{1}\"."},
-
- /*
- * Note to translators: This message is displayed if the function named
- * by the substitution text is not a function that is supported. XSLTC
- * is the acronym naming the product.
- */
- {BasisLibrary.EXTERNAL_FUNC_ERR,
- "Externe Funktion \"{0}\" nicht unterst\u00FCtzt von XSLTC."},
-
- /*
- * Note to translators: This message is displayed if two values are
- * compared for equality, but the data type of one of the values is
- * unknown.
- */
- {BasisLibrary.EQUALITY_EXPR_ERR,
- "Unbekannter Argumenttyp in Gleichheitsausdruck."},
-
- /*
- * Note to translators: The substitution text for {0} will be a data
- * type; the substitution text for {1} will be the name of a function.
- * This is displayed if an argument of the particular data type is not
- * permitted for a call to this function.
- */
- {BasisLibrary.INVALID_ARGUMENT_ERR,
- "Ung\u00FCltiger Argumenttyp \"{0}\" in Aufruf von \"{1}\""},
-
- /*
- * Note to translators: There is way of specifying a format for a
- * number using a pattern; the processor was unable to format the
- * particular value using the specified pattern.
- */
- {BasisLibrary.FORMAT_NUMBER_ERR,
- "Versuch, Zahl \"{0}\" mit Muster \"{1}\" zu formatieren."},
-
- /*
- * Note to translators: The following represents an internal error
- * situation in XSLTC. The processor was unable to create a copy of an
- * iterator. (See definition of iterator above.)
- */
- {BasisLibrary.ITERATOR_CLONE_ERR,
- "Iterator \"{0}\" kann nicht geclont werden."},
-
- /*
- * Note to translators: The following represents an internal error
- * situation in XSLTC. The processor attempted to create an iterator
- * for a particular axis (see definition above) that it does not
- * support.
- */
- {BasisLibrary.AXIS_SUPPORT_ERR,
- "Iterator f\u00FCr Achse \"{0}\" nicht unterst\u00FCtzt."},
-
- /*
- * Note to translators: The following represents an internal error
- * situation in XSLTC. The processor attempted to create an iterator
- * for a particular axis (see definition above) that it does not
- * support.
- */
- {BasisLibrary.TYPED_AXIS_SUPPORT_ERR,
- "Iterator f\u00FCr typisierte Achse \"{0}\" nicht unterst\u00FCtzt."},
-
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- {BasisLibrary.STRAY_ATTRIBUTE_ERR,
- "Attribut \"{0}\" au\u00DFerhalb des Elements."},
-
- /*
- * Note to translators: As with the preceding message, a namespace
- * declaration has the form of an attribute and is only permitted to
- * appear on an element. The substitution text {0} is the namespace
- * prefix and {1} is the URI that was being used in the erroneous
- * namespace declaration.
- */
- {BasisLibrary.STRAY_NAMESPACE_ERR,
- "Namespace-Deklaration {0}={1} au\u00DFerhalb des Elements."},
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- {BasisLibrary.NAMESPACE_PREFIX_ERR,
- "Namespace f\u00FCr Pr\u00E4fix \"{0}\" wurde nicht deklariert."},
-
- /*
- * Note to translators: The following represents an internal error.
- * DOMAdapter is a Java class in XSLTC.
- */
- {BasisLibrary.DOM_ADAPTER_INIT_ERR,
- "DOMAdapter mit falschem Typ von Quell-DOM erstellt."},
-
- /*
- * Note to translators: The following message indicates that the XML
- * parser that is providing input to XSLTC cannot be used because it
- * does not describe to XSLTC the structure of the input XML document's
- * DTD.
- */
- {BasisLibrary.PARSER_DTD_SUPPORT_ERR,
- "Der verwendete SAX-Parser verarbeitet keine DTD-Deklarationsereignisse."},
-
- /*
- * Note to translators: The following message indicates that the XML
- * parser that is providing input to XSLTC cannot be used because it
- * does not distinguish between ordinary XML attributes and namespace
- * declarations.
- */
- {BasisLibrary.NAMESPACES_SUPPORT_ERR,
- "Der verwendete SAX-Parser unterst\u00FCtzt keine XML-Namespaces."},
-
- /*
- * Note to translators: The substitution text is the URI that was in
- * error.
- */
- {BasisLibrary.CANT_RESOLVE_RELATIVE_URI_ERR,
- "URI-Referenz \"{0}\" konnte nicht aufgel\u00F6st werden."},
-
- /*
- * Note to translators: The stylesheet contained an element that was
- * not recognized as part of the XSL syntax. The substitution text
- * gives the element name.
- */
- {BasisLibrary.UNSUPPORTED_XSL_ERR,
- "Nicht unterst\u00FCtztes XSL-Element \"{0}\""},
-
- /*
- * Note to translators: The stylesheet referred to an extension to the
- * XSL syntax and indicated that it was defined by XSLTC, but XSLTC does
- * not recognize the particular extension named. The substitution text
- * gives the extension name.
- */
- {BasisLibrary.UNSUPPORTED_EXT_ERR,
- "Unbekannte XSLTC-Erweiterung \"{0}\""},
-
-
- /*
- * Note to translators: This error message is produced if the translet
- * class was compiled using a newer version of XSLTC and deployed for
- * execution with an older version of XSLTC. The substitution text is
- * the name of the translet class.
- */
- {BasisLibrary.UNKNOWN_TRANSLET_VERSION_ERR,
- "Das angegebene Translet \"{0}\" wurde mit einer neueren Version von XSLTC als die verwendete Version der XSLTC-Laufzeit erstellt. Sie m\u00FCssen das Stylesheet neu kompilieren oder eine aktuellere Version von XSLTC verwenden, um dieses Translet auszuf\u00FChren."},
-
- /*
- * Note to translators: An attribute whose effective value is required
- * to be a "QName" had a value that was incorrect.
- * 'QName' is an XML syntactic term that must not be translated. The
- * substitution text contains the actual value of the attribute.
- */
- {BasisLibrary.INVALID_QNAME_ERR,
- "Ein Attribut, dessen Wert ein QName sein muss, hatte den Wert \"{0}\""},
-
-
- /*
- * Note to translators: An attribute whose effective value is required
- * to be a "NCName" had a value that was incorrect.
- * 'NCName' is an XML syntactic term that must not be translated. The
- * substitution text contains the actual value of the attribute.
- */
- {BasisLibrary.INVALID_NCNAME_ERR,
- "Ein Attribut, dessen Wert ein NCName sein muss, hatte den Wert \"{0}\""},
-
- {BasisLibrary.UNALLOWED_EXTENSION_FUNCTION_ERR,
- "Verwendung der Erweiterungsfunktion \"{0}\" ist nicht zul\u00E4ssig, wenn das Feature f\u00FCr die sichere Verarbeitung auf \"true\" gesetzt ist."},
-
- {BasisLibrary.UNALLOWED_EXTENSION_ELEMENT_ERR,
- "Verwendung des Erweiterungselements \"{0}\" ist nicht zul\u00E4ssig, wenn das Feature f\u00FCr die sichere Verarbeitung auf \"true\" gesetzt ist."},
- };
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_es.java b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_es.java
deleted file mode 100644
index 350d75f..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_es.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.runtime;
-
-import java.util.ListResourceBundle;
-
-/**
- * @author Morten Jorgensen
- */
-public class ErrorMessages_es extends ListResourceBundle {
-
-/*
- * XSLTC run-time error messages.
- *
- * General notes to translators and definitions:
- *
- * 1) XSLTC is the name of the product. It is an acronym for XML Stylesheet:
- * Transformations Compiler
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant output XML document (or HTML document or text)
- *
- * 3) An axis is a particular "dimension" in a tree representation of an XML
- * document; the nodes in the tree are divided along different axes.
- * Traversing the "child" axis, for instance, means that the program
- * would visit each child of a particular node; traversing the "descendant"
- * axis means that the program would visit the child nodes of a particular
- * node, their children, and so on until the leaf nodes of the tree are
- * reached.
- *
- * 4) An iterator is an object that traverses nodes in a tree along a
- * particular axis, one at a time.
- *
- * 5) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 6) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 7) DOM is an acronym for Document Object Model. It is a tree
- * representation of an XML document.
- *
- * SAX is an acronym for the Simple API for XML processing. It is an API
- * used inform an XML processor (in this case XSLTC) of the structure and
- * content of an XML document.
- *
- * Input to the stylesheet processor can come from an XML parser in the
- * form of a DOM tree or through the SAX API.
- *
- * 8) DTD is a document type declaration. It is a way of specifying the
- * grammar for an XML file, the names and types of elements, attributes,
- * etc.
- *
- * 9) Translet is an invented term that refers to the class file that contains
- * the compiled form of a stylesheet.
- */
-
- // These message should be read from a locale-specific resource bundle
- /** Get the lookup table for error messages.
- *
- * @return The message lookup table.
- */
- public Object[][] getContents()
- {
- return new Object[][] {
-
- /*
- * Note to translators: the substitution text in the following message
- * is a class name. Used for internal errors in the processor.
- */
- {BasisLibrary.RUN_TIME_INTERNAL_ERR,
- "Error interno de tiempo de ejecuci\u00F3n en ''{0}''"},
-
- /*
- * Note to translators: <xsl:copy> is a keyword that should not be
- * translated.
- */
- {BasisLibrary.RUN_TIME_COPY_ERR,
- "Error de tiempo de ejecuci\u00F3n al ejecutar <xsl:copy>."},
-
- /*
- * Note to translators: The substitution text refers to data types.
- * The message is displayed if a value in a particular context needs to
- * be converted to type {1}, but that's not possible for a value of type
- * {0}.
- */
- {BasisLibrary.DATA_CONVERSION_ERR,
- "Conversi\u00F3n no v\u00E1lida de ''{0}'' a ''{1}''."},
-
- /*
- * Note to translators: This message is displayed if the function named
- * by the substitution text is not a function that is supported. XSLTC
- * is the acronym naming the product.
- */
- {BasisLibrary.EXTERNAL_FUNC_ERR,
- "Funci\u00F3n externa ''{0}'' no soportada por XSLTC."},
-
- /*
- * Note to translators: This message is displayed if two values are
- * compared for equality, but the data type of one of the values is
- * unknown.
- */
- {BasisLibrary.EQUALITY_EXPR_ERR,
- "Tipo de argumento desconocido en la expresi\u00F3n de igualdad."},
-
- /*
- * Note to translators: The substitution text for {0} will be a data
- * type; the substitution text for {1} will be the name of a function.
- * This is displayed if an argument of the particular data type is not
- * permitted for a call to this function.
- */
- {BasisLibrary.INVALID_ARGUMENT_ERR,
- "Tipo de argumento ''{0}'' no v\u00E1lido en la llamada a ''{1}''"},
-
- /*
- * Note to translators: There is way of specifying a format for a
- * number using a pattern; the processor was unable to format the
- * particular value using the specified pattern.
- */
- {BasisLibrary.FORMAT_NUMBER_ERR,
- "Intentando formatear n\u00FAmero ''{0}'' mediante el patr\u00F3n ''{1}''."},
-
- /*
- * Note to translators: The following represents an internal error
- * situation in XSLTC. The processor was unable to create a copy of an
- * iterator. (See definition of iterator above.)
- */
- {BasisLibrary.ITERATOR_CLONE_ERR,
- "No se puede clonar el iterador ''{0}''."},
-
- /*
- * Note to translators: The following represents an internal error
- * situation in XSLTC. The processor attempted to create an iterator
- * for a particular axis (see definition above) that it does not
- * support.
- */
- {BasisLibrary.AXIS_SUPPORT_ERR,
- "El iterador para el eje ''{0}'' no est\u00E1 soportado."},
-
- /*
- * Note to translators: The following represents an internal error
- * situation in XSLTC. The processor attempted to create an iterator
- * for a particular axis (see definition above) that it does not
- * support.
- */
- {BasisLibrary.TYPED_AXIS_SUPPORT_ERR,
- "El iterador para el eje introducido ''{0}'' no est\u00E1 soportado."},
-
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- {BasisLibrary.STRAY_ATTRIBUTE_ERR,
- "El atributo ''{0}'' est\u00E1 fuera del elemento."},
-
- /*
- * Note to translators: As with the preceding message, a namespace
- * declaration has the form of an attribute and is only permitted to
- * appear on an element. The substitution text {0} is the namespace
- * prefix and {1} is the URI that was being used in the erroneous
- * namespace declaration.
- */
- {BasisLibrary.STRAY_NAMESPACE_ERR,
- "Declaraci\u00F3n del espacio de nombres ''{0}''=''{1}'' fuera del elemento."},
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- {BasisLibrary.NAMESPACE_PREFIX_ERR,
- "No se ha declarado el espacio de nombres para el prefijo ''{0}''."},
-
- /*
- * Note to translators: The following represents an internal error.
- * DOMAdapter is a Java class in XSLTC.
- */
- {BasisLibrary.DOM_ADAPTER_INIT_ERR,
- "Se ha creado DOMAdapter mediante un tipo incorrecto de DOM de origen."},
-
- /*
- * Note to translators: The following message indicates that the XML
- * parser that is providing input to XSLTC cannot be used because it
- * does not describe to XSLTC the structure of the input XML document's
- * DTD.
- */
- {BasisLibrary.PARSER_DTD_SUPPORT_ERR,
- "El analizador SAX que est\u00E1 utilizando no maneja los eventos de declaraci\u00F3n DTD."},
-
- /*
- * Note to translators: The following message indicates that the XML
- * parser that is providing input to XSLTC cannot be used because it
- * does not distinguish between ordinary XML attributes and namespace
- * declarations.
- */
- {BasisLibrary.NAMESPACES_SUPPORT_ERR,
- "El analizador SAX que est\u00E1 utilizando no soporta los espacios de nombres XML."},
-
- /*
- * Note to translators: The substitution text is the URI that was in
- * error.
- */
- {BasisLibrary.CANT_RESOLVE_RELATIVE_URI_ERR,
- "No se ha podido resolver la referencia al URI ''{0}''."},
-
- /*
- * Note to translators: The stylesheet contained an element that was
- * not recognized as part of the XSL syntax. The substitution text
- * gives the element name.
- */
- {BasisLibrary.UNSUPPORTED_XSL_ERR,
- "Elemento ''{0}'' de XSL no soportado"},
-
- /*
- * Note to translators: The stylesheet referred to an extension to the
- * XSL syntax and indicated that it was defined by XSLTC, but XSLTC does
- * not recognize the particular extension named. The substitution text
- * gives the extension name.
- */
- {BasisLibrary.UNSUPPORTED_EXT_ERR,
- "Extensi\u00F3n ''{0}'' de XSLTC no reconocida"},
-
-
- /*
- * Note to translators: This error message is produced if the translet
- * class was compiled using a newer version of XSLTC and deployed for
- * execution with an older version of XSLTC. The substitution text is
- * the name of the translet class.
- */
- {BasisLibrary.UNKNOWN_TRANSLET_VERSION_ERR,
- "El translet especificado, ''{0}'' se ha creado con una versi\u00F3n de XSLTC m\u00E1s reciente que la versi\u00F3n del tiempo de ejecuci\u00F3n de XSLTC que se est\u00E1 utilizando. Debe volver a compilar la hoja de estilo o utilizar una versi\u00F3n m\u00E1s reciente de XSLTC para ejecutar este translet."},
-
- /*
- * Note to translators: An attribute whose effective value is required
- * to be a "QName" had a value that was incorrect.
- * 'QName' is an XML syntactic term that must not be translated. The
- * substitution text contains the actual value of the attribute.
- */
- {BasisLibrary.INVALID_QNAME_ERR,
- "Un atributo cuyo valor debe ser un QName ten\u00EDa el valor ''{0}''"},
-
-
- /*
- * Note to translators: An attribute whose effective value is required
- * to be a "NCName" had a value that was incorrect.
- * 'NCName' is an XML syntactic term that must not be translated. The
- * substitution text contains the actual value of the attribute.
- */
- {BasisLibrary.INVALID_NCNAME_ERR,
- "Un atributo cuyo valor debe ser un NCName ten\u00EDa el valor ''{0}''"},
-
- {BasisLibrary.UNALLOWED_EXTENSION_FUNCTION_ERR,
- "El uso de la funci\u00F3n de extensi\u00F3n ''{0}'' no est\u00E1 permitido cuando la funci\u00F3n de procesamiento seguro se ha definido en true."},
-
- {BasisLibrary.UNALLOWED_EXTENSION_ELEMENT_ERR,
- "El uso del elemento de extensi\u00F3n ''{0}'' no est\u00E1 permitido cuando la funci\u00F3n de procesamiento seguro se ha definido en true."},
- };
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_fr.java b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_fr.java
deleted file mode 100644
index f60f2a5..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_fr.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.runtime;
-
-import java.util.ListResourceBundle;
-
-/**
- * @author Morten Jorgensen
- */
-public class ErrorMessages_fr extends ListResourceBundle {
-
-/*
- * XSLTC run-time error messages.
- *
- * General notes to translators and definitions:
- *
- * 1) XSLTC is the name of the product. It is an acronym for XML Stylesheet:
- * Transformations Compiler
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant output XML document (or HTML document or text)
- *
- * 3) An axis is a particular "dimension" in a tree representation of an XML
- * document; the nodes in the tree are divided along different axes.
- * Traversing the "child" axis, for instance, means that the program
- * would visit each child of a particular node; traversing the "descendant"
- * axis means that the program would visit the child nodes of a particular
- * node, their children, and so on until the leaf nodes of the tree are
- * reached.
- *
- * 4) An iterator is an object that traverses nodes in a tree along a
- * particular axis, one at a time.
- *
- * 5) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 6) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 7) DOM is an acronym for Document Object Model. It is a tree
- * representation of an XML document.
- *
- * SAX is an acronym for the Simple API for XML processing. It is an API
- * used inform an XML processor (in this case XSLTC) of the structure and
- * content of an XML document.
- *
- * Input to the stylesheet processor can come from an XML parser in the
- * form of a DOM tree or through the SAX API.
- *
- * 8) DTD is a document type declaration. It is a way of specifying the
- * grammar for an XML file, the names and types of elements, attributes,
- * etc.
- *
- * 9) Translet is an invented term that refers to the class file that contains
- * the compiled form of a stylesheet.
- */
-
- // These message should be read from a locale-specific resource bundle
- /** Get the lookup table for error messages.
- *
- * @return The message lookup table.
- */
- public Object[][] getContents()
- {
- return new Object[][] {
-
- /*
- * Note to translators: the substitution text in the following message
- * is a class name. Used for internal errors in the processor.
- */
- {BasisLibrary.RUN_TIME_INTERNAL_ERR,
- "Erreur interne d''ex\u00E9cution dans ''{0}''"},
-
- /*
- * Note to translators: <xsl:copy> is a keyword that should not be
- * translated.
- */
- {BasisLibrary.RUN_TIME_COPY_ERR,
- "Erreur d'ex\u00E9cution de <xsl:copy>."},
-
- /*
- * Note to translators: The substitution text refers to data types.
- * The message is displayed if a value in a particular context needs to
- * be converted to type {1}, but that's not possible for a value of type
- * {0}.
- */
- {BasisLibrary.DATA_CONVERSION_ERR,
- "Conversion de ''{0}'' \u00E0 ''{1}'' non valide."},
-
- /*
- * Note to translators: This message is displayed if the function named
- * by the substitution text is not a function that is supported. XSLTC
- * is the acronym naming the product.
- */
- {BasisLibrary.EXTERNAL_FUNC_ERR,
- "Fonction externe ''{0}'' non prise en charge par XSLTC."},
-
- /*
- * Note to translators: This message is displayed if two values are
- * compared for equality, but the data type of one of the values is
- * unknown.
- */
- {BasisLibrary.EQUALITY_EXPR_ERR,
- "Type d'argument inconnu dans l'expression d'\u00E9galit\u00E9."},
-
- /*
- * Note to translators: The substitution text for {0} will be a data
- * type; the substitution text for {1} will be the name of a function.
- * This is displayed if an argument of the particular data type is not
- * permitted for a call to this function.
- */
- {BasisLibrary.INVALID_ARGUMENT_ERR,
- "Type d''argument ''{0}'' non valide dans l''appel de ''{1}''"},
-
- /*
- * Note to translators: There is way of specifying a format for a
- * number using a pattern; the processor was unable to format the
- * particular value using the specified pattern.
- */
- {BasisLibrary.FORMAT_NUMBER_ERR,
- "Tentative de formatage du nombre ''{0}'' \u00E0 l''aide du mod\u00E8le ''{1}''."},
-
- /*
- * Note to translators: The following represents an internal error
- * situation in XSLTC. The processor was unable to create a copy of an
- * iterator. (See definition of iterator above.)
- */
- {BasisLibrary.ITERATOR_CLONE_ERR,
- "Impossible de cloner l''it\u00E9rateur ''{0}''."},
-
- /*
- * Note to translators: The following represents an internal error
- * situation in XSLTC. The processor attempted to create an iterator
- * for a particular axis (see definition above) that it does not
- * support.
- */
- {BasisLibrary.AXIS_SUPPORT_ERR,
- "It\u00E9rateur de l''axe ''{0}'' non pris en charge."},
-
- /*
- * Note to translators: The following represents an internal error
- * situation in XSLTC. The processor attempted to create an iterator
- * for a particular axis (see definition above) that it does not
- * support.
- */
- {BasisLibrary.TYPED_AXIS_SUPPORT_ERR,
- "It\u00E9rateur de l''axe saisi ''{0}'' non pris en charge."},
-
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- {BasisLibrary.STRAY_ATTRIBUTE_ERR,
- "Attribut ''{0}'' en dehors de l''\u00E9l\u00E9ment."},
-
- /*
- * Note to translators: As with the preceding message, a namespace
- * declaration has the form of an attribute and is only permitted to
- * appear on an element. The substitution text {0} is the namespace
- * prefix and {1} is the URI that was being used in the erroneous
- * namespace declaration.
- */
- {BasisLibrary.STRAY_NAMESPACE_ERR,
- "La d\u00E9claration d''espace de noms ''{0}''=''{1}'' est \u00E0 l''ext\u00E9rieur de l''\u00E9l\u00E9ment."},
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- {BasisLibrary.NAMESPACE_PREFIX_ERR,
- "L''espace de noms du pr\u00E9fixe ''{0}'' n''a pas \u00E9t\u00E9 d\u00E9clar\u00E9."},
-
- /*
- * Note to translators: The following represents an internal error.
- * DOMAdapter is a Java class in XSLTC.
- */
- {BasisLibrary.DOM_ADAPTER_INIT_ERR,
- "DOMAdapter cr\u00E9\u00E9 avec le mauvais type de DOM source."},
-
- /*
- * Note to translators: The following message indicates that the XML
- * parser that is providing input to XSLTC cannot be used because it
- * does not describe to XSLTC the structure of the input XML document's
- * DTD.
- */
- {BasisLibrary.PARSER_DTD_SUPPORT_ERR,
- "L'analyseur SAX que vous utilisez ne g\u00E8re pas les \u00E9v\u00E9nements de d\u00E9claration DTD."},
-
- /*
- * Note to translators: The following message indicates that the XML
- * parser that is providing input to XSLTC cannot be used because it
- * does not distinguish between ordinary XML attributes and namespace
- * declarations.
- */
- {BasisLibrary.NAMESPACES_SUPPORT_ERR,
- "L'analyseur SAX que vous utilisez ne prend pas en charge les espaces de noms XML."},
-
- /*
- * Note to translators: The substitution text is the URI that was in
- * error.
- */
- {BasisLibrary.CANT_RESOLVE_RELATIVE_URI_ERR,
- "Impossible de r\u00E9soudre la r\u00E9f\u00E9rence d''URI ''{0}''."},
-
- /*
- * Note to translators: The stylesheet contained an element that was
- * not recognized as part of the XSL syntax. The substitution text
- * gives the element name.
- */
- {BasisLibrary.UNSUPPORTED_XSL_ERR,
- "El\u00E9ment XSL ''{0}'' non pris en charge"},
-
- /*
- * Note to translators: The stylesheet referred to an extension to the
- * XSL syntax and indicated that it was defined by XSLTC, but XSLTC does
- * not recognize the particular extension named. The substitution text
- * gives the extension name.
- */
- {BasisLibrary.UNSUPPORTED_EXT_ERR,
- "Extension XSLTC ''{0}'' non reconnue"},
-
-
- /*
- * Note to translators: This error message is produced if the translet
- * class was compiled using a newer version of XSLTC and deployed for
- * execution with an older version of XSLTC. The substitution text is
- * the name of the translet class.
- */
- {BasisLibrary.UNKNOWN_TRANSLET_VERSION_ERR,
- "Le translet sp\u00E9cifi\u00E9, ''{0}'', a \u00E9t\u00E9 cr\u00E9\u00E9 \u00E0 l''aide d''une version de XSLTC plus r\u00E9cente que la version de l''ex\u00E9cution XSLTC utilis\u00E9e. Vous devez recompiler la feuille de style ou utiliser une version plus r\u00E9cente de XSLTC pour ex\u00E9cuter ce translet."},
-
- /*
- * Note to translators: An attribute whose effective value is required
- * to be a "QName" had a value that was incorrect.
- * 'QName' is an XML syntactic term that must not be translated. The
- * substitution text contains the actual value of the attribute.
- */
- {BasisLibrary.INVALID_QNAME_ERR,
- "Un attribut dont la valeur doit \u00EAtre un QName avait la valeur ''{0}''"},
-
-
- /*
- * Note to translators: An attribute whose effective value is required
- * to be a "NCName" had a value that was incorrect.
- * 'NCName' is an XML syntactic term that must not be translated. The
- * substitution text contains the actual value of the attribute.
- */
- {BasisLibrary.INVALID_NCNAME_ERR,
- "Un attribut dont la valeur doit \u00EAtre un NCName avait la valeur ''{0}''"},
-
- {BasisLibrary.UNALLOWED_EXTENSION_FUNCTION_ERR,
- "L''utilisation de la fonction d''extension ''{0}'' n''est pas autoris\u00E9e lorsque la fonctionnalit\u00E9 de traitement s\u00E9curis\u00E9 est d\u00E9finie sur True."},
-
- {BasisLibrary.UNALLOWED_EXTENSION_ELEMENT_ERR,
- "L''utilisation de l''\u00E9l\u00E9ment d''extension ''{0}'' n''est pas autoris\u00E9e lorsque la fonctionnalit\u00E9 de traitement s\u00E9curis\u00E9 est d\u00E9finie sur True."},
- };
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_it.java b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_it.java
deleted file mode 100644
index e4a7b2d..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_it.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.runtime;
-
-import java.util.ListResourceBundle;
-
-/**
- * @author Morten Jorgensen
- */
-public class ErrorMessages_it extends ListResourceBundle {
-
-/*
- * XSLTC run-time error messages.
- *
- * General notes to translators and definitions:
- *
- * 1) XSLTC is the name of the product. It is an acronym for XML Stylesheet:
- * Transformations Compiler
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant output XML document (or HTML document or text)
- *
- * 3) An axis is a particular "dimension" in a tree representation of an XML
- * document; the nodes in the tree are divided along different axes.
- * Traversing the "child" axis, for instance, means that the program
- * would visit each child of a particular node; traversing the "descendant"
- * axis means that the program would visit the child nodes of a particular
- * node, their children, and so on until the leaf nodes of the tree are
- * reached.
- *
- * 4) An iterator is an object that traverses nodes in a tree along a
- * particular axis, one at a time.
- *
- * 5) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 6) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 7) DOM is an acronym for Document Object Model. It is a tree
- * representation of an XML document.
- *
- * SAX is an acronym for the Simple API for XML processing. It is an API
- * used inform an XML processor (in this case XSLTC) of the structure and
- * content of an XML document.
- *
- * Input to the stylesheet processor can come from an XML parser in the
- * form of a DOM tree or through the SAX API.
- *
- * 8) DTD is a document type declaration. It is a way of specifying the
- * grammar for an XML file, the names and types of elements, attributes,
- * etc.
- *
- * 9) Translet is an invented term that refers to the class file that contains
- * the compiled form of a stylesheet.
- */
-
- // These message should be read from a locale-specific resource bundle
- /** Get the lookup table for error messages.
- *
- * @return The message lookup table.
- */
- public Object[][] getContents()
- {
- return new Object[][] {
-
- /*
- * Note to translators: the substitution text in the following message
- * is a class name. Used for internal errors in the processor.
- */
- {BasisLibrary.RUN_TIME_INTERNAL_ERR,
- "Errore interno in fase di esecuzione in ''{0}''"},
-
- /*
- * Note to translators: <xsl:copy> is a keyword that should not be
- * translated.
- */
- {BasisLibrary.RUN_TIME_COPY_ERR,
- "Errore in fase di esecuzione durante l'esecuzione di <xsl:copy>."},
-
- /*
- * Note to translators: The substitution text refers to data types.
- * The message is displayed if a value in a particular context needs to
- * be converted to type {1}, but that's not possible for a value of type
- * {0}.
- */
- {BasisLibrary.DATA_CONVERSION_ERR,
- "Conversione non valida da ''{0}'' a ''{1}''."},
-
- /*
- * Note to translators: This message is displayed if the function named
- * by the substitution text is not a function that is supported. XSLTC
- * is the acronym naming the product.
- */
- {BasisLibrary.EXTERNAL_FUNC_ERR,
- "Funzione esterna ''{0}'' non supportata da XSLTC."},
-
- /*
- * Note to translators: This message is displayed if two values are
- * compared for equality, but the data type of one of the values is
- * unknown.
- */
- {BasisLibrary.EQUALITY_EXPR_ERR,
- "Tipo di argomento sconosciuto nell'espressione di uguaglianza."},
-
- /*
- * Note to translators: The substitution text for {0} will be a data
- * type; the substitution text for {1} will be the name of a function.
- * This is displayed if an argument of the particular data type is not
- * permitted for a call to this function.
- */
- {BasisLibrary.INVALID_ARGUMENT_ERR,
- "Tipo di argomento ''{0}'' non valido nella chiamata a ''{1}''"},
-
- /*
- * Note to translators: There is way of specifying a format for a
- * number using a pattern; the processor was unable to format the
- * particular value using the specified pattern.
- */
- {BasisLibrary.FORMAT_NUMBER_ERR,
- "Tentativo di formattare il numero ''{0}'' mediante il pattern ''{1}''."},
-
- /*
- * Note to translators: The following represents an internal error
- * situation in XSLTC. The processor was unable to create a copy of an
- * iterator. (See definition of iterator above.)
- */
- {BasisLibrary.ITERATOR_CLONE_ERR,
- "Impossibile duplicare l''iteratore ''{0}''."},
-
- /*
- * Note to translators: The following represents an internal error
- * situation in XSLTC. The processor attempted to create an iterator
- * for a particular axis (see definition above) that it does not
- * support.
- */
- {BasisLibrary.AXIS_SUPPORT_ERR,
- "Iteratore per l''asse ''{0}'' non supportato."},
-
- /*
- * Note to translators: The following represents an internal error
- * situation in XSLTC. The processor attempted to create an iterator
- * for a particular axis (see definition above) that it does not
- * support.
- */
- {BasisLibrary.TYPED_AXIS_SUPPORT_ERR,
- "Iteratore per l''asse immesso ''{0}'' non supportato."},
-
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- {BasisLibrary.STRAY_ATTRIBUTE_ERR,
- "Attributo ''{0}'' al di fuori dell''elemento."},
-
- /*
- * Note to translators: As with the preceding message, a namespace
- * declaration has the form of an attribute and is only permitted to
- * appear on an element. The substitution text {0} is the namespace
- * prefix and {1} is the URI that was being used in the erroneous
- * namespace declaration.
- */
- {BasisLibrary.STRAY_NAMESPACE_ERR,
- "Dichiarazione dello spazio di nomi ''{0}''=''{1}'' al di fuori dell''elemento."},
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- {BasisLibrary.NAMESPACE_PREFIX_ERR,
- "Lo spazio di nomi per il prefisso ''{0}'' non \u00E8 stato dichiarato."},
-
- /*
- * Note to translators: The following represents an internal error.
- * DOMAdapter is a Java class in XSLTC.
- */
- {BasisLibrary.DOM_ADAPTER_INIT_ERR,
- "DOMAdapter creato utilizzando il tipo errato di DOM di origine."},
-
- /*
- * Note to translators: The following message indicates that the XML
- * parser that is providing input to XSLTC cannot be used because it
- * does not describe to XSLTC the structure of the input XML document's
- * DTD.
- */
- {BasisLibrary.PARSER_DTD_SUPPORT_ERR,
- "Il parser SAX in uso non gestisce gli eventi di dichiarazione DTD."},
-
- /*
- * Note to translators: The following message indicates that the XML
- * parser that is providing input to XSLTC cannot be used because it
- * does not distinguish between ordinary XML attributes and namespace
- * declarations.
- */
- {BasisLibrary.NAMESPACES_SUPPORT_ERR,
- "Il parser SAX in uso non supporta gli spazi di nomi XML."},
-
- /*
- * Note to translators: The substitution text is the URI that was in
- * error.
- */
- {BasisLibrary.CANT_RESOLVE_RELATIVE_URI_ERR,
- "Impossibile risolvere il riferimento URI ''{0}''."},
-
- /*
- * Note to translators: The stylesheet contained an element that was
- * not recognized as part of the XSL syntax. The substitution text
- * gives the element name.
- */
- {BasisLibrary.UNSUPPORTED_XSL_ERR,
- "Elemento XSL \"{0}\" non supportato"},
-
- /*
- * Note to translators: The stylesheet referred to an extension to the
- * XSL syntax and indicated that it was defined by XSLTC, but XSLTC does
- * not recognize the particular extension named. The substitution text
- * gives the extension name.
- */
- {BasisLibrary.UNSUPPORTED_EXT_ERR,
- "Estensione XSLTC ''{0}'' non riconosciuta"},
-
-
- /*
- * Note to translators: This error message is produced if the translet
- * class was compiled using a newer version of XSLTC and deployed for
- * execution with an older version of XSLTC. The substitution text is
- * the name of the translet class.
- */
- {BasisLibrary.UNKNOWN_TRANSLET_VERSION_ERR,
- "Il translet specificato ''{0}'' \u00E8 stato creato utilizzando una versione di XSLTC pi\u00F9 recente di quella della fase di esecuzione XSLTC in uso. Ricompilare il foglio di stile o utilizzare una versione pi\u00F9 recente di XSLTC per eseguire questo translet."},
-
- /*
- * Note to translators: An attribute whose effective value is required
- * to be a "QName" had a value that was incorrect.
- * 'QName' is an XML syntactic term that must not be translated. The
- * substitution text contains the actual value of the attribute.
- */
- {BasisLibrary.INVALID_QNAME_ERR,
- "Un attributo il cui valore deve essere un QName contiene il valore ''{0}''"},
-
-
- /*
- * Note to translators: An attribute whose effective value is required
- * to be a "NCName" had a value that was incorrect.
- * 'NCName' is an XML syntactic term that must not be translated. The
- * substitution text contains the actual value of the attribute.
- */
- {BasisLibrary.INVALID_NCNAME_ERR,
- "Un attributo il cui valore deve essere un NCName contiene il valore ''{0}''"},
-
- {BasisLibrary.UNALLOWED_EXTENSION_FUNCTION_ERR,
- "Non \u00E8 consentito utilizzare la funzione di estensione ''{0}'' se la funzione di elaborazione sicura \u00E8 impostata su true."},
-
- {BasisLibrary.UNALLOWED_EXTENSION_ELEMENT_ERR,
- "Non \u00E8 consentito utilizzare l''elemento di estensione ''{0}'' se la funzione di elaborazione sicura \u00E8 impostata su true."},
- };
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ja.java b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ja.java
deleted file mode 100644
index 3cd3712..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ja.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.runtime;
-
-import java.util.ListResourceBundle;
-
-/**
- * @author Morten Jorgensen
- */
-public class ErrorMessages_ja extends ListResourceBundle {
-
-/*
- * XSLTC run-time error messages.
- *
- * General notes to translators and definitions:
- *
- * 1) XSLTC is the name of the product. It is an acronym for XML Stylesheet:
- * Transformations Compiler
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant output XML document (or HTML document or text)
- *
- * 3) An axis is a particular "dimension" in a tree representation of an XML
- * document; the nodes in the tree are divided along different axes.
- * Traversing the "child" axis, for instance, means that the program
- * would visit each child of a particular node; traversing the "descendant"
- * axis means that the program would visit the child nodes of a particular
- * node, their children, and so on until the leaf nodes of the tree are
- * reached.
- *
- * 4) An iterator is an object that traverses nodes in a tree along a
- * particular axis, one at a time.
- *
- * 5) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 6) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 7) DOM is an acronym for Document Object Model. It is a tree
- * representation of an XML document.
- *
- * SAX is an acronym for the Simple API for XML processing. It is an API
- * used inform an XML processor (in this case XSLTC) of the structure and
- * content of an XML document.
- *
- * Input to the stylesheet processor can come from an XML parser in the
- * form of a DOM tree or through the SAX API.
- *
- * 8) DTD is a document type declaration. It is a way of specifying the
- * grammar for an XML file, the names and types of elements, attributes,
- * etc.
- *
- * 9) Translet is an invented term that refers to the class file that contains
- * the compiled form of a stylesheet.
- */
-
- // These message should be read from a locale-specific resource bundle
- /** Get the lookup table for error messages.
- *
- * @return The message lookup table.
- */
- public Object[][] getContents()
- {
- return new Object[][] {
-
- /*
- * Note to translators: the substitution text in the following message
- * is a class name. Used for internal errors in the processor.
- */
- {BasisLibrary.RUN_TIME_INTERNAL_ERR,
- "''{0}''\u5185\u306E\u30E9\u30F3\u30BF\u30A4\u30E0\u5185\u90E8\u30A8\u30E9\u30FC\u3067\u3059"},
-
- /*
- * Note to translators: <xsl:copy> is a keyword that should not be
- * translated.
- */
- {BasisLibrary.RUN_TIME_COPY_ERR,
- "<xsl:copy>\u306E\u5B9F\u884C\u4E2D\u306E\u30E9\u30F3\u30BF\u30A4\u30E0\u30FB\u30A8\u30E9\u30FC\u3067\u3059\u3002"},
-
- /*
- * Note to translators: The substitution text refers to data types.
- * The message is displayed if a value in a particular context needs to
- * be converted to type {1}, but that's not possible for a value of type
- * {0}.
- */
- {BasisLibrary.DATA_CONVERSION_ERR,
- "''{0}''\u304B\u3089''{1}''\u3078\u306E\u5909\u63DB\u304C\u7121\u52B9\u3067\u3059\u3002"},
-
- /*
- * Note to translators: This message is displayed if the function named
- * by the substitution text is not a function that is supported. XSLTC
- * is the acronym naming the product.
- */
- {BasisLibrary.EXTERNAL_FUNC_ERR,
- "\u5916\u90E8\u95A2\u6570''{0}''\u306FXSLTC\u306B\u3088\u3063\u3066\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"},
-
- /*
- * Note to translators: This message is displayed if two values are
- * compared for equality, but the data type of one of the values is
- * unknown.
- */
- {BasisLibrary.EQUALITY_EXPR_ERR,
- "\u7B49\u4FA1\u5F0F\u306B\u4E0D\u660E\u306A\u5F15\u6570\u30BF\u30A4\u30D7\u304C\u3042\u308A\u307E\u3059\u3002"},
-
- /*
- * Note to translators: The substitution text for {0} will be a data
- * type; the substitution text for {1} will be the name of a function.
- * This is displayed if an argument of the particular data type is not
- * permitted for a call to this function.
- */
- {BasisLibrary.INVALID_ARGUMENT_ERR,
- "''{1}''\u306E\u547C\u51FA\u3057\u306E\u5F15\u6570\u30BF\u30A4\u30D7''{0}''\u304C\u7121\u52B9\u3067\u3059"},
-
- /*
- * Note to translators: There is way of specifying a format for a
- * number using a pattern; the processor was unable to format the
- * particular value using the specified pattern.
- */
- {BasisLibrary.FORMAT_NUMBER_ERR,
- "\u30D1\u30BF\u30FC\u30F3''{1}''\u3092\u4F7F\u7528\u3057\u3066\u6570\u5024''{0}''\u3092\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u3057\u3088\u3046\u3068\u3057\u307E\u3057\u305F\u3002"},
-
- /*
- * Note to translators: The following represents an internal error
- * situation in XSLTC. The processor was unable to create a copy of an
- * iterator. (See definition of iterator above.)
- */
- {BasisLibrary.ITERATOR_CLONE_ERR,
- "\u30A4\u30C6\u30EC\u30FC\u30BF''{0}''\u306E\u30AF\u30ED\u30FC\u30F3\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093\u3002"},
-
- /*
- * Note to translators: The following represents an internal error
- * situation in XSLTC. The processor attempted to create an iterator
- * for a particular axis (see definition above) that it does not
- * support.
- */
- {BasisLibrary.AXIS_SUPPORT_ERR,
- "\u8EF8''{0}''\u306E\u30A4\u30C6\u30EC\u30FC\u30BF\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"},
-
- /*
- * Note to translators: The following represents an internal error
- * situation in XSLTC. The processor attempted to create an iterator
- * for a particular axis (see definition above) that it does not
- * support.
- */
- {BasisLibrary.TYPED_AXIS_SUPPORT_ERR,
- "\u578B\u6307\u5B9A\u3055\u308C\u305F\u8EF8''{0}''\u306E\u30A4\u30C6\u30EC\u30FC\u30BF\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"},
-
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- {BasisLibrary.STRAY_ATTRIBUTE_ERR,
- "\u5C5E\u6027''{0}''\u304C\u8981\u7D20\u306E\u5916\u5074\u306B\u3042\u308A\u307E\u3059\u3002"},
-
- /*
- * Note to translators: As with the preceding message, a namespace
- * declaration has the form of an attribute and is only permitted to
- * appear on an element. The substitution text {0} is the namespace
- * prefix and {1} is the URI that was being used in the erroneous
- * namespace declaration.
- */
- {BasisLibrary.STRAY_NAMESPACE_ERR,
- "\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u5BA3\u8A00''{0}''=''{1}''\u304C\u8981\u7D20\u306E\u5916\u5074\u306B\u3042\u308A\u307E\u3059\u3002"},
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- {BasisLibrary.NAMESPACE_PREFIX_ERR,
- "\u63A5\u982D\u8F9E''{0}''\u306E\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u304C\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"},
-
- /*
- * Note to translators: The following represents an internal error.
- * DOMAdapter is a Java class in XSLTC.
- */
- {BasisLibrary.DOM_ADAPTER_INIT_ERR,
- "DOMAdapter\u304C\u9593\u9055\u3063\u305F\u30BF\u30A4\u30D7\u306E\u30BD\u30FC\u30B9DOM\u3092\u4F7F\u7528\u3057\u3066\u4F5C\u6210\u3055\u308C\u307E\u3057\u305F\u3002"},
-
- /*
- * Note to translators: The following message indicates that the XML
- * parser that is providing input to XSLTC cannot be used because it
- * does not describe to XSLTC the structure of the input XML document's
- * DTD.
- */
- {BasisLibrary.PARSER_DTD_SUPPORT_ERR,
- "\u4F7F\u7528\u4E2D\u306ESAX\u30D1\u30FC\u30B5\u30FC\u306FDTD\u5BA3\u8A00\u30A4\u30D9\u30F3\u30C8\u3092\u51E6\u7406\u3057\u307E\u305B\u3093\u3002"},
-
- /*
- * Note to translators: The following message indicates that the XML
- * parser that is providing input to XSLTC cannot be used because it
- * does not distinguish between ordinary XML attributes and namespace
- * declarations.
- */
- {BasisLibrary.NAMESPACES_SUPPORT_ERR,
- "\u4F7F\u7528\u4E2D\u306ESAX\u30D1\u30FC\u30B5\u30FC\u306B\u306FXML\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u306E\u30B5\u30DD\u30FC\u30C8\u304C\u3042\u308A\u307E\u305B\u3093\u3002"},
-
- /*
- * Note to translators: The substitution text is the URI that was in
- * error.
- */
- {BasisLibrary.CANT_RESOLVE_RELATIVE_URI_ERR,
- "URI\u53C2\u7167''{0}''\u3092\u89E3\u6C7A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002"},
-
- /*
- * Note to translators: The stylesheet contained an element that was
- * not recognized as part of the XSL syntax. The substitution text
- * gives the element name.
- */
- {BasisLibrary.UNSUPPORTED_XSL_ERR,
- "\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u306A\u3044XSL\u8981\u7D20''{0}''"},
-
- /*
- * Note to translators: The stylesheet referred to an extension to the
- * XSL syntax and indicated that it was defined by XSLTC, but XSLTC does
- * not recognize the particular extension named. The substitution text
- * gives the extension name.
- */
- {BasisLibrary.UNSUPPORTED_EXT_ERR,
- "\u8A8D\u8B58\u3055\u308C\u306A\u3044XSLTC\u62E1\u5F35''{0}''"},
-
-
- /*
- * Note to translators: This error message is produced if the translet
- * class was compiled using a newer version of XSLTC and deployed for
- * execution with an older version of XSLTC. The substitution text is
- * the name of the translet class.
- */
- {BasisLibrary.UNKNOWN_TRANSLET_VERSION_ERR,
- "\u6307\u5B9A\u3055\u308C\u305Ftranslet\u306E''{0}''\u306F\u3001\u4F7F\u7528\u4E2D\u306EXSLTC\u30E9\u30F3\u30BF\u30A4\u30E0\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u3088\u308A\u3082\u65B0\u3057\u3044XSLTC\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u4F7F\u7528\u3057\u3066\u4F5C\u6210\u3055\u308C\u305F\u3082\u306E\u3067\u3059\u3002\u3053\u306Etranslet\u3092\u5B9F\u884C\u3059\u308B\u306B\u306F\u3001\u30B9\u30BF\u30A4\u30EB\u30B7\u30FC\u30C8\u3092\u518D\u30B3\u30F3\u30D1\u30A4\u30EB\u3059\u308B\u304B\u3001\u3088\u308A\u65B0\u3057\u3044\u30D0\u30FC\u30B8\u30E7\u30F3\u306EXSLTC\u3092\u4F7F\u7528\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002"},
-
- /*
- * Note to translators: An attribute whose effective value is required
- * to be a "QName" had a value that was incorrect.
- * 'QName' is an XML syntactic term that must not be translated. The
- * substitution text contains the actual value of the attribute.
- */
- {BasisLibrary.INVALID_QNAME_ERR,
- "\u5024\u304CQName\u3067\u3042\u308B\u3053\u3068\u304C\u5FC5\u8981\u306A\u5C5E\u6027\u306E\u5024\u304C''{0}''\u3067\u3057\u305F"},
-
-
- /*
- * Note to translators: An attribute whose effective value is required
- * to be a "NCName" had a value that was incorrect.
- * 'NCName' is an XML syntactic term that must not be translated. The
- * substitution text contains the actual value of the attribute.
- */
- {BasisLibrary.INVALID_NCNAME_ERR,
- "\u5024\u304CNCName\u3067\u3042\u308B\u3053\u3068\u304C\u5FC5\u8981\u306A\u5C5E\u6027\u306E\u5024\u304C''{0}''\u3067\u3057\u305F"},
-
- {BasisLibrary.UNALLOWED_EXTENSION_FUNCTION_ERR,
- "\u30BB\u30AD\u30E5\u30A2\u51E6\u7406\u6A5F\u80FD\u304Ctrue\u306B\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u308B\u3068\u304D\u3001\u62E1\u5F35\u95A2\u6570''{0}''\u306E\u4F7F\u7528\u306F\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093\u3002"},
-
- {BasisLibrary.UNALLOWED_EXTENSION_ELEMENT_ERR,
- "\u30BB\u30AD\u30E5\u30A2\u51E6\u7406\u6A5F\u80FD\u304Ctrue\u306B\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u308B\u3068\u304D\u3001\u62E1\u5F35\u8981\u7D20''{0}''\u306E\u4F7F\u7528\u306F\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093\u3002"},
- };
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ko.java b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ko.java
deleted file mode 100644
index e24a7c1..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ko.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.runtime;
-
-import java.util.ListResourceBundle;
-
-/**
- * @author Morten Jorgensen
- */
-public class ErrorMessages_ko extends ListResourceBundle {
-
-/*
- * XSLTC run-time error messages.
- *
- * General notes to translators and definitions:
- *
- * 1) XSLTC is the name of the product. It is an acronym for XML Stylesheet:
- * Transformations Compiler
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant output XML document (or HTML document or text)
- *
- * 3) An axis is a particular "dimension" in a tree representation of an XML
- * document; the nodes in the tree are divided along different axes.
- * Traversing the "child" axis, for instance, means that the program
- * would visit each child of a particular node; traversing the "descendant"
- * axis means that the program would visit the child nodes of a particular
- * node, their children, and so on until the leaf nodes of the tree are
- * reached.
- *
- * 4) An iterator is an object that traverses nodes in a tree along a
- * particular axis, one at a time.
- *
- * 5) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 6) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 7) DOM is an acronym for Document Object Model. It is a tree
- * representation of an XML document.
- *
- * SAX is an acronym for the Simple API for XML processing. It is an API
- * used inform an XML processor (in this case XSLTC) of the structure and
- * content of an XML document.
- *
- * Input to the stylesheet processor can come from an XML parser in the
- * form of a DOM tree or through the SAX API.
- *
- * 8) DTD is a document type declaration. It is a way of specifying the
- * grammar for an XML file, the names and types of elements, attributes,
- * etc.
- *
- * 9) Translet is an invented term that refers to the class file that contains
- * the compiled form of a stylesheet.
- */
-
- // These message should be read from a locale-specific resource bundle
- /** Get the lookup table for error messages.
- *
- * @return The message lookup table.
- */
- public Object[][] getContents()
- {
- return new Object[][] {
-
- /*
- * Note to translators: the substitution text in the following message
- * is a class name. Used for internal errors in the processor.
- */
- {BasisLibrary.RUN_TIME_INTERNAL_ERR,
- "''{0}''\uC5D0 \uB7F0\uD0C0\uC784 \uB0B4\uBD80 \uC624\uB958\uAC00 \uC788\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: <xsl:copy> is a keyword that should not be
- * translated.
- */
- {BasisLibrary.RUN_TIME_COPY_ERR,
- "<xsl:copy>\uB97C \uC2E4\uD589\uD558\uB294 \uC911 \uB7F0\uD0C0\uC784 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: The substitution text refers to data types.
- * The message is displayed if a value in a particular context needs to
- * be converted to type {1}, but that's not possible for a value of type
- * {0}.
- */
- {BasisLibrary.DATA_CONVERSION_ERR,
- "''{0}''\uC5D0\uC11C ''{1}''(\uC73C)\uB85C\uC758 \uBCC0\uD658\uC774 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4."},
-
- /*
- * Note to translators: This message is displayed if the function named
- * by the substitution text is not a function that is supported. XSLTC
- * is the acronym naming the product.
- */
- {BasisLibrary.EXTERNAL_FUNC_ERR,
- "XSLTC\uB294 \uC678\uBD80 \uD568\uC218 ''{0}''\uC744(\uB97C) \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: This message is displayed if two values are
- * compared for equality, but the data type of one of the values is
- * unknown.
- */
- {BasisLibrary.EQUALITY_EXPR_ERR,
- "\uB3D9\uB4F1\uC131 \uD45C\uD604\uC2DD\uC5D0 \uC54C \uC218 \uC5C6\uB294 \uC778\uC218 \uC720\uD615\uC774 \uC788\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: The substitution text for {0} will be a data
- * type; the substitution text for {1} will be the name of a function.
- * This is displayed if an argument of the particular data type is not
- * permitted for a call to this function.
- */
- {BasisLibrary.INVALID_ARGUMENT_ERR,
- "''{1}''\uC5D0 \uB300\uD55C \uD638\uCD9C\uC5D0 \uBD80\uC801\uD569\uD55C \uC778\uC218 \uC720\uD615 ''{0}''\uC774(\uAC00) \uC788\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: There is way of specifying a format for a
- * number using a pattern; the processor was unable to format the
- * particular value using the specified pattern.
- */
- {BasisLibrary.FORMAT_NUMBER_ERR,
- "''{1}'' \uD328\uD134\uC744 \uC0AC\uC6A9\uD558\uC5EC ''{0}'' \uC22B\uC790\uC758 \uD615\uC2DD\uC744 \uC9C0\uC815\uD558\uB824\uACE0 \uC2DC\uB3C4\uD558\uB294 \uC911\uC785\uB2C8\uB2E4."},
-
- /*
- * Note to translators: The following represents an internal error
- * situation in XSLTC. The processor was unable to create a copy of an
- * iterator. (See definition of iterator above.)
- */
- {BasisLibrary.ITERATOR_CLONE_ERR,
- "''{0}'' \uC774\uD130\uB808\uC774\uD130\uB97C \uBCF5\uC81C\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: The following represents an internal error
- * situation in XSLTC. The processor attempted to create an iterator
- * for a particular axis (see definition above) that it does not
- * support.
- */
- {BasisLibrary.AXIS_SUPPORT_ERR,
- "''{0}'' \uCD95\uC5D0 \uB300\uD55C \uC774\uD130\uB808\uC774\uD130\uB294 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: The following represents an internal error
- * situation in XSLTC. The processor attempted to create an iterator
- * for a particular axis (see definition above) that it does not
- * support.
- */
- {BasisLibrary.TYPED_AXIS_SUPPORT_ERR,
- "\uC785\uB825\uB41C \uCD95 ''{0}''\uC5D0 \uB300\uD55C \uC774\uD130\uB808\uC774\uD130\uB294 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- {BasisLibrary.STRAY_ATTRIBUTE_ERR,
- "''{0}'' \uC18D\uC131\uC774 \uC694\uC18C\uC5D0 \uD3EC\uD568\uB418\uC5B4 \uC788\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: As with the preceding message, a namespace
- * declaration has the form of an attribute and is only permitted to
- * appear on an element. The substitution text {0} is the namespace
- * prefix and {1} is the URI that was being used in the erroneous
- * namespace declaration.
- */
- {BasisLibrary.STRAY_NAMESPACE_ERR,
- "\uB124\uC784\uC2A4\uD398\uC774\uC2A4 \uC120\uC5B8 ''{0}''=''{1}''\uC774(\uAC00) \uC694\uC18C\uC5D0 \uD3EC\uD568\uB418\uC5B4 \uC788\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- {BasisLibrary.NAMESPACE_PREFIX_ERR,
- "''{0}'' \uC811\uB450\uC5B4\uC5D0 \uB300\uD55C \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uAC00 \uC120\uC5B8\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: The following represents an internal error.
- * DOMAdapter is a Java class in XSLTC.
- */
- {BasisLibrary.DOM_ADAPTER_INIT_ERR,
- "\uC18C\uC2A4 DOM\uC758 \uC798\uBABB\uB41C \uC720\uD615\uC744 \uC0AC\uC6A9\uD558\uC5EC DOMAdapter\uAC00 \uC0DD\uC131\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: The following message indicates that the XML
- * parser that is providing input to XSLTC cannot be used because it
- * does not describe to XSLTC the structure of the input XML document's
- * DTD.
- */
- {BasisLibrary.PARSER_DTD_SUPPORT_ERR,
- "\uC0AC\uC6A9 \uC911\uC778 SAX \uAD6C\uBB38 \uBD84\uC11D\uAE30\uAC00 DTD \uC120\uC5B8 \uC774\uBCA4\uD2B8\uB97C \uCC98\uB9AC\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: The following message indicates that the XML
- * parser that is providing input to XSLTC cannot be used because it
- * does not distinguish between ordinary XML attributes and namespace
- * declarations.
- */
- {BasisLibrary.NAMESPACES_SUPPORT_ERR,
- "\uC0AC\uC6A9 \uC911\uC778 SAX \uAD6C\uBB38 \uBD84\uC11D\uAE30\uAC00 XML \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uB97C \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: The substitution text is the URI that was in
- * error.
- */
- {BasisLibrary.CANT_RESOLVE_RELATIVE_URI_ERR,
- "URI \uCC38\uC870 ''{0}''\uC744(\uB97C) \uBD84\uC11D\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- /*
- * Note to translators: The stylesheet contained an element that was
- * not recognized as part of the XSL syntax. The substitution text
- * gives the element name.
- */
- {BasisLibrary.UNSUPPORTED_XSL_ERR,
- "''{0}''\uC740(\uB294) \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uB294 XSL \uC694\uC18C\uC785\uB2C8\uB2E4."},
-
- /*
- * Note to translators: The stylesheet referred to an extension to the
- * XSL syntax and indicated that it was defined by XSLTC, but XSLTC does
- * not recognize the particular extension named. The substitution text
- * gives the extension name.
- */
- {BasisLibrary.UNSUPPORTED_EXT_ERR,
- "''{0}''\uC740(\uB294) \uC54C \uC218 \uC5C6\uB294 XSLTC \uD655\uC7A5\uC785\uB2C8\uB2E4."},
-
-
- /*
- * Note to translators: This error message is produced if the translet
- * class was compiled using a newer version of XSLTC and deployed for
- * execution with an older version of XSLTC. The substitution text is
- * the name of the translet class.
- */
- {BasisLibrary.UNKNOWN_TRANSLET_VERSION_ERR,
- "\uC9C0\uC815\uB41C translet ''{0}''\uC774(\uAC00) \uC0AC\uC6A9 \uC911\uC778 XSLTC \uB7F0\uD0C0\uC784 \uBC84\uC804\uBCF4\uB2E4 \uCD5C\uC2E0\uC758 XSLTC \uBC84\uC804\uC744 \uC0AC\uC6A9\uD558\uC5EC \uC0DD\uC131\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uC774 translet\uC744 \uC2E4\uD589\uD558\uB824\uBA74 \uC2A4\uD0C0\uC77C\uC2DC\uD2B8\uB97C \uC7AC\uCEF4\uD30C\uC77C\uD558\uAC70\uB098 \uCD5C\uC2E0 XSLTC \uBC84\uC804\uC744 \uC0AC\uC6A9\uD574\uC57C \uD569\uB2C8\uB2E4."},
-
- /*
- * Note to translators: An attribute whose effective value is required
- * to be a "QName" had a value that was incorrect.
- * 'QName' is an XML syntactic term that must not be translated. The
- * substitution text contains the actual value of the attribute.
- */
- {BasisLibrary.INVALID_QNAME_ERR,
- "\uAC12\uC774 QName\uC774\uC5B4\uC57C \uD558\uB294 \uC18D\uC131\uC758 \uAC12\uC774 ''{0}''\uC785\uB2C8\uB2E4."},
-
-
- /*
- * Note to translators: An attribute whose effective value is required
- * to be a "NCName" had a value that was incorrect.
- * 'NCName' is an XML syntactic term that must not be translated. The
- * substitution text contains the actual value of the attribute.
- */
- {BasisLibrary.INVALID_NCNAME_ERR,
- "\uAC12\uC774 NCName\uC774\uC5B4\uC57C \uD558\uB294 \uC18D\uC131\uC758 \uAC12\uC774 ''{0}''\uC785\uB2C8\uB2E4."},
-
- {BasisLibrary.UNALLOWED_EXTENSION_FUNCTION_ERR,
- "\uBCF4\uC548 \uCC98\uB9AC \uAE30\uB2A5\uC774 true\uB85C \uC124\uC815\uB41C \uACBD\uC6B0 \uD655\uC7A5 \uD568\uC218 ''{0}''\uC744(\uB97C) \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- {BasisLibrary.UNALLOWED_EXTENSION_ELEMENT_ERR,
- "\uBCF4\uC548 \uCC98\uB9AC \uAE30\uB2A5\uC774 true\uB85C \uC124\uC815\uB41C \uACBD\uC6B0 \uD655\uC7A5 \uC694\uC18C ''{0}''\uC744(\uB97C) \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
- };
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_pt_BR.java b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_pt_BR.java
deleted file mode 100644
index 45e2654..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_pt_BR.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.runtime;
-
-import java.util.ListResourceBundle;
-
-/**
- * @author Morten Jorgensen
- */
-public class ErrorMessages_pt_BR extends ListResourceBundle {
-
-/*
- * XSLTC run-time error messages.
- *
- * General notes to translators and definitions:
- *
- * 1) XSLTC is the name of the product. It is an acronym for XML Stylesheet:
- * Transformations Compiler
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant output XML document (or HTML document or text)
- *
- * 3) An axis is a particular "dimension" in a tree representation of an XML
- * document; the nodes in the tree are divided along different axes.
- * Traversing the "child" axis, for instance, means that the program
- * would visit each child of a particular node; traversing the "descendant"
- * axis means that the program would visit the child nodes of a particular
- * node, their children, and so on until the leaf nodes of the tree are
- * reached.
- *
- * 4) An iterator is an object that traverses nodes in a tree along a
- * particular axis, one at a time.
- *
- * 5) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 6) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 7) DOM is an acronym for Document Object Model. It is a tree
- * representation of an XML document.
- *
- * SAX is an acronym for the Simple API for XML processing. It is an API
- * used inform an XML processor (in this case XSLTC) of the structure and
- * content of an XML document.
- *
- * Input to the stylesheet processor can come from an XML parser in the
- * form of a DOM tree or through the SAX API.
- *
- * 8) DTD is a document type declaration. It is a way of specifying the
- * grammar for an XML file, the names and types of elements, attributes,
- * etc.
- *
- * 9) Translet is an invented term that refers to the class file that contains
- * the compiled form of a stylesheet.
- */
-
- // These message should be read from a locale-specific resource bundle
- /** Get the lookup table for error messages.
- *
- * @return The message lookup table.
- */
- public Object[][] getContents()
- {
- return new Object[][] {
-
- /*
- * Note to translators: the substitution text in the following message
- * is a class name. Used for internal errors in the processor.
- */
- {BasisLibrary.RUN_TIME_INTERNAL_ERR,
- "Erro interno de runtime em ''{0}''"},
-
- /*
- * Note to translators: <xsl:copy> is a keyword that should not be
- * translated.
- */
- {BasisLibrary.RUN_TIME_COPY_ERR,
- "Erro de runtime ao executar <xsl:copy>."},
-
- /*
- * Note to translators: The substitution text refers to data types.
- * The message is displayed if a value in a particular context needs to
- * be converted to type {1}, but that's not possible for a value of type
- * {0}.
- */
- {BasisLibrary.DATA_CONVERSION_ERR,
- "Convers\u00E3o inv\u00E1lida de ''{0}'' para ''{1}''."},
-
- /*
- * Note to translators: This message is displayed if the function named
- * by the substitution text is not a function that is supported. XSLTC
- * is the acronym naming the product.
- */
- {BasisLibrary.EXTERNAL_FUNC_ERR,
- "Fun\u00E7\u00E3o externa ''{0}'' n\u00E3o suportada por XSLTC."},
-
- /*
- * Note to translators: This message is displayed if two values are
- * compared for equality, but the data type of one of the values is
- * unknown.
- */
- {BasisLibrary.EQUALITY_EXPR_ERR,
- "Tipo de argumento desconhecido na express\u00E3o de igualdade."},
-
- /*
- * Note to translators: The substitution text for {0} will be a data
- * type; the substitution text for {1} will be the name of a function.
- * This is displayed if an argument of the particular data type is not
- * permitted for a call to this function.
- */
- {BasisLibrary.INVALID_ARGUMENT_ERR,
- "Tipo de argumento inv\u00E1lido ''{0}'' na chamada para ''{1}''"},
-
- /*
- * Note to translators: There is way of specifying a format for a
- * number using a pattern; the processor was unable to format the
- * particular value using the specified pattern.
- */
- {BasisLibrary.FORMAT_NUMBER_ERR,
- "Tentativa de formatar o n\u00FAmero ''{0}'' usando o padr\u00E3o ''{1}''."},
-
- /*
- * Note to translators: The following represents an internal error
- * situation in XSLTC. The processor was unable to create a copy of an
- * iterator. (See definition of iterator above.)
- */
- {BasisLibrary.ITERATOR_CLONE_ERR,
- "N\u00E3o \u00E9 poss\u00EDvel clonar o iterador ''{0}''."},
-
- /*
- * Note to translators: The following represents an internal error
- * situation in XSLTC. The processor attempted to create an iterator
- * for a particular axis (see definition above) that it does not
- * support.
- */
- {BasisLibrary.AXIS_SUPPORT_ERR,
- "Iterador do eixo ''{0}'' n\u00E3o suportado."},
-
- /*
- * Note to translators: The following represents an internal error
- * situation in XSLTC. The processor attempted to create an iterator
- * for a particular axis (see definition above) that it does not
- * support.
- */
- {BasisLibrary.TYPED_AXIS_SUPPORT_ERR,
- "Iterador do eixo digitado ''{0}'' n\u00E3o suportado."},
-
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- {BasisLibrary.STRAY_ATTRIBUTE_ERR,
- "Atributo ''{0}'' fora do elemento."},
-
- /*
- * Note to translators: As with the preceding message, a namespace
- * declaration has the form of an attribute and is only permitted to
- * appear on an element. The substitution text {0} is the namespace
- * prefix and {1} is the URI that was being used in the erroneous
- * namespace declaration.
- */
- {BasisLibrary.STRAY_NAMESPACE_ERR,
- "Declara\u00E7\u00E3o de namespace ''{0}''=''{1}'' fora do elemento."},
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- {BasisLibrary.NAMESPACE_PREFIX_ERR,
- "O namespace do prefixo ''{0}'' n\u00E3o foi declarado."},
-
- /*
- * Note to translators: The following represents an internal error.
- * DOMAdapter is a Java class in XSLTC.
- */
- {BasisLibrary.DOM_ADAPTER_INIT_ERR,
- "DOMAdapter criado usando o tipo incorreto de DOM de origem."},
-
- /*
- * Note to translators: The following message indicates that the XML
- * parser that is providing input to XSLTC cannot be used because it
- * does not describe to XSLTC the structure of the input XML document's
- * DTD.
- */
- {BasisLibrary.PARSER_DTD_SUPPORT_ERR,
- "O parser SAX que voc\u00EA est\u00E1 usando n\u00E3o trata eventos de declara\u00E7\u00E3o de DTD."},
-
- /*
- * Note to translators: The following message indicates that the XML
- * parser that is providing input to XSLTC cannot be used because it
- * does not distinguish between ordinary XML attributes and namespace
- * declarations.
- */
- {BasisLibrary.NAMESPACES_SUPPORT_ERR,
- "O parser SAX que voc\u00EA est\u00E1 usando n\u00E3o tem suporte para os Namespaces de XML."},
-
- /*
- * Note to translators: The substitution text is the URI that was in
- * error.
- */
- {BasisLibrary.CANT_RESOLVE_RELATIVE_URI_ERR,
- "N\u00E3o foi poss\u00EDvel resolver a refer\u00EAncia do URI ''{0}''."},
-
- /*
- * Note to translators: The stylesheet contained an element that was
- * not recognized as part of the XSL syntax. The substitution text
- * gives the element name.
- */
- {BasisLibrary.UNSUPPORTED_XSL_ERR,
- "Elemento XSL ''{0}'' n\u00E3o suportado"},
-
- /*
- * Note to translators: The stylesheet referred to an extension to the
- * XSL syntax and indicated that it was defined by XSLTC, but XSLTC does
- * not recognize the particular extension named. The substitution text
- * gives the extension name.
- */
- {BasisLibrary.UNSUPPORTED_EXT_ERR,
- "Extens\u00E3o ''{0}'' de XSLTC n\u00E3o reconhecida"},
-
-
- /*
- * Note to translators: This error message is produced if the translet
- * class was compiled using a newer version of XSLTC and deployed for
- * execution with an older version of XSLTC. The substitution text is
- * the name of the translet class.
- */
- {BasisLibrary.UNKNOWN_TRANSLET_VERSION_ERR,
- "O translet especificado, ''{0}'', foi criado usando uma vers\u00E3o do XSLTC mais recente que a vers\u00E3o de runtime de XSLTC em uso. Recompile a folha de estilos ou use uma vers\u00E3o mais recente de XSLTC para executar este translet."},
-
- /*
- * Note to translators: An attribute whose effective value is required
- * to be a "QName" had a value that was incorrect.
- * 'QName' is an XML syntactic term that must not be translated. The
- * substitution text contains the actual value of the attribute.
- */
- {BasisLibrary.INVALID_QNAME_ERR,
- "Um atributo cujo valor deve ser um QName tinha o valor ''{0}''"},
-
-
- /*
- * Note to translators: An attribute whose effective value is required
- * to be a "NCName" had a value that was incorrect.
- * 'NCName' is an XML syntactic term that must not be translated. The
- * substitution text contains the actual value of the attribute.
- */
- {BasisLibrary.INVALID_NCNAME_ERR,
- "Um atributo cujo valor deve ser um NCName tinha o valor ''{0}''"},
-
- {BasisLibrary.UNALLOWED_EXTENSION_FUNCTION_ERR,
- "O uso da fun\u00E7\u00E3o da extens\u00E3o ''{0}'' n\u00E3o ser\u00E1 permitido quando o recurso de processamento seguro for definido como verdadeiro."},
-
- {BasisLibrary.UNALLOWED_EXTENSION_ELEMENT_ERR,
- "O uso do elemento da extens\u00E3o ''{0}'' n\u00E3o ser\u00E1 permitido quando o recurso de processamento seguro for definido como verdadeiro."},
- };
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_sk.java b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_sk.java
deleted file mode 100644
index 6ee58b7..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_sk.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ErrorMessages_sk.java,v 1.1.6.1 2005/09/06 10:45:39 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.runtime;
-
-import java.util.ListResourceBundle;
-
-/**
- * @author Morten Jorgensen
- */
-public class ErrorMessages_sk extends ListResourceBundle {
-
-/*
- * XSLTC run-time error messages.
- *
- * General notes to translators and definitions:
- *
- * 1) XSLTC is the name of the product. It is an acronym for XML Stylesheet:
- * Transformations Compiler
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant output XML document (or HTML document or text)
- *
- * 3) An axis is a particular "dimension" in a tree representation of an XML
- * document; the nodes in the tree are divided along different axes.
- * Traversing the "child" axis, for instance, means that the program
- * would visit each child of a particular node; traversing the "descendant"
- * axis means that the program would visit the child nodes of a particular
- * node, their children, and so on until the leaf nodes of the tree are
- * reached.
- *
- * 4) An iterator is an object that traverses nodes in a tree along a
- * particular axis, one at a time.
- *
- * 5) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 6) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 7) DOM is an acronym for Document Object Model. It is a tree
- * representation of an XML document.
- *
- * SAX is an acronym for the Simple API for XML processing. It is an API
- * used inform an XML processor (in this case XSLTC) of the structure and
- * content of an XML document.
- *
- * Input to the stylesheet processor can come from an XML parser in the
- * form of a DOM tree or through the SAX API.
- *
- * 8) DTD is a document type declaration. It is a way of specifying the
- * grammar for an XML file, the names and types of elements, attributes,
- * etc.
- *
- */
-
- // These message should be read from a locale-specific resource bundle
- /** Get the lookup table for error messages.
- *
- * @return The message lookup table.
- */
- public Object[][] getContents()
- {
- return new Object[][] {
-
- /*
- * Note to translators: the substitution text in the following message
- * is a class name. Used for internal errors in the processor.
- */
- {BasisLibrary.RUN_TIME_INTERNAL_ERR,
- "Intern\u00e1 chyba \u010dasu spustenia v ''{0}''"},
-
- /*
- * Note to translators: <xsl:copy> is a keyword that should not be
- * translated.
- */
- {BasisLibrary.RUN_TIME_COPY_ERR,
- "Chyba \u010dasu spustenia pri sp\u00fa\u0161\u0165an\u00ed <xsl:copy>."},
-
- /*
- * Note to translators: The substitution text refers to data types.
- * The message is displayed if a value in a particular context needs to
- * be converted to type {1}, but that's not possible for a value of type
- * {0}.
- */
- {BasisLibrary.DATA_CONVERSION_ERR,
- "Neplatn\u00e1 konverzia z ''{0}'' na ''{1}''."},
-
- /*
- * Note to translators: This message is displayed if the function named
- * by the substitution text is not a function that is supported. XSLTC
- * is the acronym naming the product.
- */
- {BasisLibrary.EXTERNAL_FUNC_ERR,
- "XSLTC nepodporuje extern\u00fa funkciu ''{0}''."},
-
- /*
- * Note to translators: This message is displayed if two values are
- * compared for equality, but the data type of one of the values is
- * unknown.
- */
- {BasisLibrary.EQUALITY_EXPR_ERR,
- "Nezn\u00e1my typ argumentu je v\u00fdrazom rovnosti."},
-
- /*
- * Note to translators: The substitution text for {0} will be a data
- * type; the substitution text for {1} will be the name of a function.
- * This is displayed if an argument of the particular data type is not
- * permitted for a call to this function.
- */
- {BasisLibrary.INVALID_ARGUMENT_ERR,
- "Neplatn\u00fd typ argumentu ''{0}'' vo volan\u00ed do ''{1}''"},
-
- /*
- * Note to translators: There is way of specifying a format for a
- * number using a pattern; the processor was unable to format the
- * particular value using the specified pattern.
- */
- {BasisLibrary.FORMAT_NUMBER_ERR,
- "Pokus o form\u00e1tovanie \u010d\u00edsla ''{0}'' pomocou vzoru ''{1}''."},
-
- /*
- * Note to translators: The following represents an internal error
- * situation in XSLTC. The processor was unable to create a copy of an
- * iterator. (See definition of iterator above.)
- */
- {BasisLibrary.ITERATOR_CLONE_ERR,
- "Nie je mo\u017en\u00e9 klonova\u0165 iter\u00e1tor ''{0}''."},
-
- /*
- * Note to translators: The following represents an internal error
- * situation in XSLTC. The processor attempted to create an iterator
- * for a particular axis (see definition above) that it does not
- * support.
- */
- {BasisLibrary.AXIS_SUPPORT_ERR,
- "Iter\u00e1tor pre os ''{0}'' nie je podporovan\u00fd."},
-
- /*
- * Note to translators: The following represents an internal error
- * situation in XSLTC. The processor attempted to create an iterator
- * for a particular axis (see definition above) that it does not
- * support.
- */
- {BasisLibrary.TYPED_AXIS_SUPPORT_ERR,
- "Iter\u00e1tor pre nap\u00edsan\u00fa os ''{0}'' nie je podporovan\u00fd."},
-
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- {BasisLibrary.STRAY_ATTRIBUTE_ERR,
- "Atrib\u00fat ''{0}'' je mimo elementu."},
-
- /*
- * Note to translators: As with the preceding message, a namespace
- * declaration has the form of an attribute and is only permitted to
- * appear on an element. The substitution text {0} is the namespace
- * prefix and {1} is the URI that was being used in the erroneous
- * namespace declaration.
- */
- {BasisLibrary.STRAY_NAMESPACE_ERR,
- "Deklar\u00e1cia n\u00e1zvov\u00e9ho priestoru ''{0}''=''{1}'' je mimo elementu."},
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- {BasisLibrary.NAMESPACE_PREFIX_ERR,
- "N\u00e1zvov\u00fd priestor pre predponu ''{0}'' nebol deklarovan\u00fd."},
-
- /*
- * Note to translators: The following represents an internal error.
- * DOMAdapter is a Java class in XSLTC.
- */
- {BasisLibrary.DOM_ADAPTER_INIT_ERR,
- "DOMAdapter bol vytvoren\u00fd pomocou nespr\u00e1vneho typu zdrojov\u00e9ho DOM."},
-
- /*
- * Note to translators: The following message indicates that the XML
- * parser that is providing input to XSLTC cannot be used because it
- * does not describe to XSLTC the structure of the input XML document's
- * DTD.
- */
- {BasisLibrary.PARSER_DTD_SUPPORT_ERR,
- "Analyz\u00e1tor SAX, ktor\u00fd pou\u017e\u00edvate, nesprac\u00fava udalosti deklar\u00e1cie DTD."},
-
- /*
- * Note to translators: The following message indicates that the XML
- * parser that is providing input to XSLTC cannot be used because it
- * does not distinguish between ordinary XML attributes and namespace
- * declarations.
- */
- {BasisLibrary.NAMESPACES_SUPPORT_ERR,
- "Analyz\u00e1tor SAX, ktor\u00fd pou\u017e\u00edvate, nem\u00e1 podporu pre n\u00e1zvov\u00e9 priestory XML."},
-
- /*
- * Note to translators: The substitution text is the URI that was in
- * error.
- */
- {BasisLibrary.CANT_RESOLVE_RELATIVE_URI_ERR,
- "Nebolo mo\u017en\u00e9 rozl\u00ed\u0161i\u0165 referenciu URI ''{0}''."}
- };
-
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_sv.java b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_sv.java
deleted file mode 100644
index 2c2b40e..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_sv.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.runtime;
-
-import java.util.ListResourceBundle;
-
-/**
- * @author Morten Jorgensen
- */
-public class ErrorMessages_sv extends ListResourceBundle {
-
-/*
- * XSLTC run-time error messages.
- *
- * General notes to translators and definitions:
- *
- * 1) XSLTC is the name of the product. It is an acronym for XML Stylesheet:
- * Transformations Compiler
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant output XML document (or HTML document or text)
- *
- * 3) An axis is a particular "dimension" in a tree representation of an XML
- * document; the nodes in the tree are divided along different axes.
- * Traversing the "child" axis, for instance, means that the program
- * would visit each child of a particular node; traversing the "descendant"
- * axis means that the program would visit the child nodes of a particular
- * node, their children, and so on until the leaf nodes of the tree are
- * reached.
- *
- * 4) An iterator is an object that traverses nodes in a tree along a
- * particular axis, one at a time.
- *
- * 5) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 6) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 7) DOM is an acronym for Document Object Model. It is a tree
- * representation of an XML document.
- *
- * SAX is an acronym for the Simple API for XML processing. It is an API
- * used inform an XML processor (in this case XSLTC) of the structure and
- * content of an XML document.
- *
- * Input to the stylesheet processor can come from an XML parser in the
- * form of a DOM tree or through the SAX API.
- *
- * 8) DTD is a document type declaration. It is a way of specifying the
- * grammar for an XML file, the names and types of elements, attributes,
- * etc.
- *
- * 9) Translet is an invented term that refers to the class file that contains
- * the compiled form of a stylesheet.
- */
-
- // These message should be read from a locale-specific resource bundle
- /** Get the lookup table for error messages.
- *
- * @return The message lookup table.
- */
- public Object[][] getContents()
- {
- return new Object[][] {
-
- /*
- * Note to translators: the substitution text in the following message
- * is a class name. Used for internal errors in the processor.
- */
- {BasisLibrary.RUN_TIME_INTERNAL_ERR,
- "Internt exekveringsfel i ''{0}''"},
-
- /*
- * Note to translators: <xsl:copy> is a keyword that should not be
- * translated.
- */
- {BasisLibrary.RUN_TIME_COPY_ERR,
- "Exekveringsexekveringsfel av <xsl:copy>."},
-
- /*
- * Note to translators: The substitution text refers to data types.
- * The message is displayed if a value in a particular context needs to
- * be converted to type {1}, but that's not possible for a value of type
- * {0}.
- */
- {BasisLibrary.DATA_CONVERSION_ERR,
- "Ogiltig konvertering fr\u00E5n ''{0}'' till ''{1}''."},
-
- /*
- * Note to translators: This message is displayed if the function named
- * by the substitution text is not a function that is supported. XSLTC
- * is the acronym naming the product.
- */
- {BasisLibrary.EXTERNAL_FUNC_ERR,
- "Den externa funktionen ''{0}'' underst\u00F6ds inte i XSLTC."},
-
- /*
- * Note to translators: This message is displayed if two values are
- * compared for equality, but the data type of one of the values is
- * unknown.
- */
- {BasisLibrary.EQUALITY_EXPR_ERR,
- "Ok\u00E4nd argumenttyp i likhetsuttryck."},
-
- /*
- * Note to translators: The substitution text for {0} will be a data
- * type; the substitution text for {1} will be the name of a function.
- * This is displayed if an argument of the particular data type is not
- * permitted for a call to this function.
- */
- {BasisLibrary.INVALID_ARGUMENT_ERR,
- "Argumenttyp ''{0}'' i anrop till ''{1}'' \u00E4r inte giltig"},
-
- /*
- * Note to translators: There is way of specifying a format for a
- * number using a pattern; the processor was unable to format the
- * particular value using the specified pattern.
- */
- {BasisLibrary.FORMAT_NUMBER_ERR,
- "F\u00F6rs\u00F6ker formatera talet ''{0}'' med m\u00F6nstret ''{1}''."},
-
- /*
- * Note to translators: The following represents an internal error
- * situation in XSLTC. The processor was unable to create a copy of an
- * iterator. (See definition of iterator above.)
- */
- {BasisLibrary.ITERATOR_CLONE_ERR,
- "Kan inte klona iteratorn ''{0}''."},
-
- /*
- * Note to translators: The following represents an internal error
- * situation in XSLTC. The processor attempted to create an iterator
- * for a particular axis (see definition above) that it does not
- * support.
- */
- {BasisLibrary.AXIS_SUPPORT_ERR,
- "Iteratorn f\u00F6r axeln ''{0}'' underst\u00F6ds inte."},
-
- /*
- * Note to translators: The following represents an internal error
- * situation in XSLTC. The processor attempted to create an iterator
- * for a particular axis (see definition above) that it does not
- * support.
- */
- {BasisLibrary.TYPED_AXIS_SUPPORT_ERR,
- "Iteratorn f\u00F6r den typade axeln ''{0}'' underst\u00F6ds inte."},
-
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- {BasisLibrary.STRAY_ATTRIBUTE_ERR,
- "Attributet ''{0}'' finns utanf\u00F6r elementet."},
-
- /*
- * Note to translators: As with the preceding message, a namespace
- * declaration has the form of an attribute and is only permitted to
- * appear on an element. The substitution text {0} is the namespace
- * prefix and {1} is the URI that was being used in the erroneous
- * namespace declaration.
- */
- {BasisLibrary.STRAY_NAMESPACE_ERR,
- "Namnrymdsdeklarationen ''{0}''=''{1}'' finns utanf\u00F6r element."},
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- {BasisLibrary.NAMESPACE_PREFIX_ERR,
- "Namnrymd f\u00F6r prefix ''{0}'' har inte deklarerats."},
-
- /*
- * Note to translators: The following represents an internal error.
- * DOMAdapter is a Java class in XSLTC.
- */
- {BasisLibrary.DOM_ADAPTER_INIT_ERR,
- "DOMAdapter har skapats med fel typ av DOM-k\u00E4lla."},
-
- /*
- * Note to translators: The following message indicates that the XML
- * parser that is providing input to XSLTC cannot be used because it
- * does not describe to XSLTC the structure of the input XML document's
- * DTD.
- */
- {BasisLibrary.PARSER_DTD_SUPPORT_ERR,
- "Den SAX-parser som du anv\u00E4nder hanterar inga DTD-deklarationsh\u00E4ndelser."},
-
- /*
- * Note to translators: The following message indicates that the XML
- * parser that is providing input to XSLTC cannot be used because it
- * does not distinguish between ordinary XML attributes and namespace
- * declarations.
- */
- {BasisLibrary.NAMESPACES_SUPPORT_ERR,
- "Den SAX-parser som du anv\u00E4nder saknar st\u00F6d f\u00F6r XML-namnrymder."},
-
- /*
- * Note to translators: The substitution text is the URI that was in
- * error.
- */
- {BasisLibrary.CANT_RESOLVE_RELATIVE_URI_ERR,
- "Kunde inte matcha URI-referensen ''{0}''."},
-
- /*
- * Note to translators: The stylesheet contained an element that was
- * not recognized as part of the XSL syntax. The substitution text
- * gives the element name.
- */
- {BasisLibrary.UNSUPPORTED_XSL_ERR,
- "XSL-elementet ''{0}'' st\u00F6ds inte"},
-
- /*
- * Note to translators: The stylesheet referred to an extension to the
- * XSL syntax and indicated that it was defined by XSLTC, but XSLTC does
- * not recognize the particular extension named. The substitution text
- * gives the extension name.
- */
- {BasisLibrary.UNSUPPORTED_EXT_ERR,
- "XSLTC-till\u00E4gget ''{0}'' \u00E4r ok\u00E4nt"},
-
-
- /*
- * Note to translators: This error message is produced if the translet
- * class was compiled using a newer version of XSLTC and deployed for
- * execution with an older version of XSLTC. The substitution text is
- * the name of the translet class.
- */
- {BasisLibrary.UNKNOWN_TRANSLET_VERSION_ERR,
- "Angiven translet, ''{0}'', har skapats med en XSLTC-version som \u00E4r senare \u00E4n den XSLTC-k\u00F6rning i bruk. F\u00F6r att kunna k\u00F6ra denna translet m\u00E5ste du omkompilera formatmallen eller anv\u00E4nda en senare version av XSLTC."},
-
- /*
- * Note to translators: An attribute whose effective value is required
- * to be a "QName" had a value that was incorrect.
- * 'QName' is an XML syntactic term that must not be translated. The
- * substitution text contains the actual value of the attribute.
- */
- {BasisLibrary.INVALID_QNAME_ERR,
- "Ett attribut vars v\u00E4rde m\u00E5ste vara ett QName hade v\u00E4rdet ''{0}''"},
-
-
- /*
- * Note to translators: An attribute whose effective value is required
- * to be a "NCName" had a value that was incorrect.
- * 'NCName' is an XML syntactic term that must not be translated. The
- * substitution text contains the actual value of the attribute.
- */
- {BasisLibrary.INVALID_NCNAME_ERR,
- "Ett attribut vars v\u00E4rde m\u00E5ste vara ett NCName hade v\u00E4rdet ''{0}''"},
-
- {BasisLibrary.UNALLOWED_EXTENSION_FUNCTION_ERR,
- "Anv\u00E4ndning av till\u00E4ggsfunktionen ''{0}'' \u00E4r inte till\u00E5tet n\u00E4r s\u00E4ker bearbetning till\u00E4mpas."},
-
- {BasisLibrary.UNALLOWED_EXTENSION_ELEMENT_ERR,
- "Anv\u00E4ndning av till\u00E4ggselementet ''{0}'' \u00E4r inte till\u00E5tet n\u00E4r s\u00E4ker bearbetning till\u00E4mpas."},
- };
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_zh_CN.java b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_zh_CN.java
deleted file mode 100644
index a34d42c..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_zh_CN.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.runtime;
-
-import java.util.ListResourceBundle;
-
-/**
- * @author Morten Jorgensen
- */
-public class ErrorMessages_zh_CN extends ListResourceBundle {
-
-/*
- * XSLTC run-time error messages.
- *
- * General notes to translators and definitions:
- *
- * 1) XSLTC is the name of the product. It is an acronym for XML Stylesheet:
- * Transformations Compiler
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant output XML document (or HTML document or text)
- *
- * 3) An axis is a particular "dimension" in a tree representation of an XML
- * document; the nodes in the tree are divided along different axes.
- * Traversing the "child" axis, for instance, means that the program
- * would visit each child of a particular node; traversing the "descendant"
- * axis means that the program would visit the child nodes of a particular
- * node, their children, and so on until the leaf nodes of the tree are
- * reached.
- *
- * 4) An iterator is an object that traverses nodes in a tree along a
- * particular axis, one at a time.
- *
- * 5) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 6) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 7) DOM is an acronym for Document Object Model. It is a tree
- * representation of an XML document.
- *
- * SAX is an acronym for the Simple API for XML processing. It is an API
- * used inform an XML processor (in this case XSLTC) of the structure and
- * content of an XML document.
- *
- * Input to the stylesheet processor can come from an XML parser in the
- * form of a DOM tree or through the SAX API.
- *
- * 8) DTD is a document type declaration. It is a way of specifying the
- * grammar for an XML file, the names and types of elements, attributes,
- * etc.
- *
- * 9) Translet is an invented term that refers to the class file that contains
- * the compiled form of a stylesheet.
- */
-
- // These message should be read from a locale-specific resource bundle
- /** Get the lookup table for error messages.
- *
- * @return The message lookup table.
- */
- public Object[][] getContents()
- {
- return new Object[][] {
-
- /*
- * Note to translators: the substitution text in the following message
- * is a class name. Used for internal errors in the processor.
- */
- {BasisLibrary.RUN_TIME_INTERNAL_ERR,
- "''{0}'' \u4E2D\u7684\u8FD0\u884C\u65F6\u5185\u90E8\u9519\u8BEF"},
-
- /*
- * Note to translators: <xsl:copy> is a keyword that should not be
- * translated.
- */
- {BasisLibrary.RUN_TIME_COPY_ERR,
- "\u6267\u884C <xsl:copy> \u65F6\u51FA\u73B0\u8FD0\u884C\u65F6\u9519\u8BEF\u3002"},
-
- /*
- * Note to translators: The substitution text refers to data types.
- * The message is displayed if a value in a particular context needs to
- * be converted to type {1}, but that's not possible for a value of type
- * {0}.
- */
- {BasisLibrary.DATA_CONVERSION_ERR,
- "\u4ECE ''{0}'' \u5230 ''{1}'' \u7684\u8F6C\u6362\u65E0\u6548\u3002"},
-
- /*
- * Note to translators: This message is displayed if the function named
- * by the substitution text is not a function that is supported. XSLTC
- * is the acronym naming the product.
- */
- {BasisLibrary.EXTERNAL_FUNC_ERR,
- "XSLTC \u4E0D\u652F\u6301\u5916\u90E8\u51FD\u6570 ''{0}''\u3002"},
-
- /*
- * Note to translators: This message is displayed if two values are
- * compared for equality, but the data type of one of the values is
- * unknown.
- */
- {BasisLibrary.EQUALITY_EXPR_ERR,
- "\u7B49\u5F0F\u8868\u8FBE\u5F0F\u4E2D\u7684\u53C2\u6570\u7C7B\u578B\u672A\u77E5\u3002"},
-
- /*
- * Note to translators: The substitution text for {0} will be a data
- * type; the substitution text for {1} will be the name of a function.
- * This is displayed if an argument of the particular data type is not
- * permitted for a call to this function.
- */
- {BasisLibrary.INVALID_ARGUMENT_ERR,
- "\u8C03\u7528 ''{1}'' \u65F6\u7684\u53C2\u6570\u7C7B\u578B ''{0}'' \u65E0\u6548"},
-
- /*
- * Note to translators: There is way of specifying a format for a
- * number using a pattern; the processor was unable to format the
- * particular value using the specified pattern.
- */
- {BasisLibrary.FORMAT_NUMBER_ERR,
- "\u5C1D\u8BD5\u4F7F\u7528\u6A21\u5F0F ''{1}'' \u8BBE\u7F6E\u6570\u5B57 ''{0}'' \u7684\u683C\u5F0F\u3002"},
-
- /*
- * Note to translators: The following represents an internal error
- * situation in XSLTC. The processor was unable to create a copy of an
- * iterator. (See definition of iterator above.)
- */
- {BasisLibrary.ITERATOR_CLONE_ERR,
- "\u65E0\u6CD5\u514B\u9686\u8FED\u4EE3\u5668 ''{0}''\u3002"},
-
- /*
- * Note to translators: The following represents an internal error
- * situation in XSLTC. The processor attempted to create an iterator
- * for a particular axis (see definition above) that it does not
- * support.
- */
- {BasisLibrary.AXIS_SUPPORT_ERR,
- "\u4E0D\u652F\u6301\u8F74 ''{0}'' \u7684\u8FED\u4EE3\u5668\u3002"},
-
- /*
- * Note to translators: The following represents an internal error
- * situation in XSLTC. The processor attempted to create an iterator
- * for a particular axis (see definition above) that it does not
- * support.
- */
- {BasisLibrary.TYPED_AXIS_SUPPORT_ERR,
- "\u4E0D\u652F\u6301\u7C7B\u578B\u5316\u8F74 ''{0}'' \u7684\u8FED\u4EE3\u5668\u3002"},
-
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- {BasisLibrary.STRAY_ATTRIBUTE_ERR,
- "\u5C5E\u6027 ''{0}'' \u5728\u5143\u7D20\u5916\u90E8\u3002"},
-
- /*
- * Note to translators: As with the preceding message, a namespace
- * declaration has the form of an attribute and is only permitted to
- * appear on an element. The substitution text {0} is the namespace
- * prefix and {1} is the URI that was being used in the erroneous
- * namespace declaration.
- */
- {BasisLibrary.STRAY_NAMESPACE_ERR,
- "\u540D\u79F0\u7A7A\u95F4\u58F0\u660E ''{0}''=''{1}'' \u5728\u5143\u7D20\u5916\u90E8\u3002"},
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- {BasisLibrary.NAMESPACE_PREFIX_ERR,
- "\u6CA1\u6709\u8BF4\u660E\u540D\u79F0\u7A7A\u95F4\u524D\u7F00 ''{0}''\u3002"},
-
- /*
- * Note to translators: The following represents an internal error.
- * DOMAdapter is a Java class in XSLTC.
- */
- {BasisLibrary.DOM_ADAPTER_INIT_ERR,
- "\u4F7F\u7528\u9519\u8BEF\u7C7B\u578B\u7684\u6E90 DOM \u521B\u5EFA\u4E86 DOMAdapter\u3002"},
-
- /*
- * Note to translators: The following message indicates that the XML
- * parser that is providing input to XSLTC cannot be used because it
- * does not describe to XSLTC the structure of the input XML document's
- * DTD.
- */
- {BasisLibrary.PARSER_DTD_SUPPORT_ERR,
- "\u4F7F\u7528\u7684 SAX \u89E3\u6790\u5668\u4E0D\u4F1A\u5904\u7406 DTD \u58F0\u660E\u4E8B\u4EF6\u3002"},
-
- /*
- * Note to translators: The following message indicates that the XML
- * parser that is providing input to XSLTC cannot be used because it
- * does not distinguish between ordinary XML attributes and namespace
- * declarations.
- */
- {BasisLibrary.NAMESPACES_SUPPORT_ERR,
- "\u4F7F\u7528\u7684 SAX \u89E3\u6790\u5668\u4E0D\u652F\u6301 XML \u540D\u79F0\u7A7A\u95F4\u3002"},
-
- /*
- * Note to translators: The substitution text is the URI that was in
- * error.
- */
- {BasisLibrary.CANT_RESOLVE_RELATIVE_URI_ERR,
- "\u65E0\u6CD5\u89E3\u6790 URI \u5F15\u7528 ''{0}''\u3002"},
-
- /*
- * Note to translators: The stylesheet contained an element that was
- * not recognized as part of the XSL syntax. The substitution text
- * gives the element name.
- */
- {BasisLibrary.UNSUPPORTED_XSL_ERR,
- "XSL \u5143\u7D20 ''{0}'' \u4E0D\u53D7\u652F\u6301"},
-
- /*
- * Note to translators: The stylesheet referred to an extension to the
- * XSL syntax and indicated that it was defined by XSLTC, but XSLTC does
- * not recognize the particular extension named. The substitution text
- * gives the extension name.
- */
- {BasisLibrary.UNSUPPORTED_EXT_ERR,
- "XSLTC \u6269\u5C55 ''{0}'' \u65E0\u6CD5\u8BC6\u522B"},
-
-
- /*
- * Note to translators: This error message is produced if the translet
- * class was compiled using a newer version of XSLTC and deployed for
- * execution with an older version of XSLTC. The substitution text is
- * the name of the translet class.
- */
- {BasisLibrary.UNKNOWN_TRANSLET_VERSION_ERR,
- "\u521B\u5EFA\u6307\u5B9A translet ''{0}'' \u65F6\u4F7F\u7528\u7684 XSLTC \u7684\u7248\u672C\u9AD8\u4E8E\u6B63\u5728\u4F7F\u7528\u7684 XSLTC \u8FD0\u884C\u65F6\u7684\u7248\u672C\u3002\u5FC5\u987B\u91CD\u65B0\u7F16\u8BD1\u6837\u5F0F\u8868\u6216\u4F7F\u7528\u8F83\u65B0\u7684 XSLTC \u7248\u672C\u8FD0\u884C\u6B64 translet\u3002"},
-
- /*
- * Note to translators: An attribute whose effective value is required
- * to be a "QName" had a value that was incorrect.
- * 'QName' is an XML syntactic term that must not be translated. The
- * substitution text contains the actual value of the attribute.
- */
- {BasisLibrary.INVALID_QNAME_ERR,
- "\u5176\u503C\u5FC5\u987B\u4E3A QName \u7684\u5C5E\u6027\u5177\u6709\u503C ''{0}''"},
-
-
- /*
- * Note to translators: An attribute whose effective value is required
- * to be a "NCName" had a value that was incorrect.
- * 'NCName' is an XML syntactic term that must not be translated. The
- * substitution text contains the actual value of the attribute.
- */
- {BasisLibrary.INVALID_NCNAME_ERR,
- "\u5176\u503C\u5FC5\u987B\u4E3A NCName \u7684\u5C5E\u6027\u5177\u6709\u503C ''{0}''"},
-
- {BasisLibrary.UNALLOWED_EXTENSION_FUNCTION_ERR,
- "\u5F53\u5B89\u5168\u5904\u7406\u529F\u80FD\u8BBE\u7F6E\u4E3A\u201C\u771F\u201D\u65F6, \u4E0D\u5141\u8BB8\u4F7F\u7528\u6269\u5C55\u51FD\u6570 ''{0}''\u3002"},
-
- {BasisLibrary.UNALLOWED_EXTENSION_ELEMENT_ERR,
- "\u5F53\u5B89\u5168\u5904\u7406\u529F\u80FD\u8BBE\u7F6E\u4E3A\u201C\u771F\u201D\u65F6, \u4E0D\u5141\u8BB8\u4F7F\u7528\u6269\u5C55\u5143\u7D20 ''{0}''\u3002"},
- };
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_zh_TW.java b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_zh_TW.java
deleted file mode 100644
index 67e3831..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_zh_TW.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.runtime;
-
-import java.util.ListResourceBundle;
-
-/**
- * @author Morten Jorgensen
- */
-public class ErrorMessages_zh_TW extends ListResourceBundle {
-
-/*
- * XSLTC run-time error messages.
- *
- * General notes to translators and definitions:
- *
- * 1) XSLTC is the name of the product. It is an acronym for XML Stylesheet:
- * Transformations Compiler
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant output XML document (or HTML document or text)
- *
- * 3) An axis is a particular "dimension" in a tree representation of an XML
- * document; the nodes in the tree are divided along different axes.
- * Traversing the "child" axis, for instance, means that the program
- * would visit each child of a particular node; traversing the "descendant"
- * axis means that the program would visit the child nodes of a particular
- * node, their children, and so on until the leaf nodes of the tree are
- * reached.
- *
- * 4) An iterator is an object that traverses nodes in a tree along a
- * particular axis, one at a time.
- *
- * 5) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 6) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 7) DOM is an acronym for Document Object Model. It is a tree
- * representation of an XML document.
- *
- * SAX is an acronym for the Simple API for XML processing. It is an API
- * used inform an XML processor (in this case XSLTC) of the structure and
- * content of an XML document.
- *
- * Input to the stylesheet processor can come from an XML parser in the
- * form of a DOM tree or through the SAX API.
- *
- * 8) DTD is a document type declaration. It is a way of specifying the
- * grammar for an XML file, the names and types of elements, attributes,
- * etc.
- *
- * 9) Translet is an invented term that refers to the class file that contains
- * the compiled form of a stylesheet.
- */
-
- // These message should be read from a locale-specific resource bundle
- /** Get the lookup table for error messages.
- *
- * @return The message lookup table.
- */
- public Object[][] getContents()
- {
- return new Object[][] {
-
- /*
- * Note to translators: the substitution text in the following message
- * is a class name. Used for internal errors in the processor.
- */
- {BasisLibrary.RUN_TIME_INTERNAL_ERR,
- "''{0}'' \u4E2D\u7684\u57F7\u884C\u968E\u6BB5\u5167\u90E8\u932F\u8AA4"},
-
- /*
- * Note to translators: <xsl:copy> is a keyword that should not be
- * translated.
- */
- {BasisLibrary.RUN_TIME_COPY_ERR,
- "\u57F7\u884C <xsl:copy> \u6642\u767C\u751F\u57F7\u884C\u968E\u6BB5\u932F\u8AA4"},
-
- /*
- * Note to translators: The substitution text refers to data types.
- * The message is displayed if a value in a particular context needs to
- * be converted to type {1}, but that's not possible for a value of type
- * {0}.
- */
- {BasisLibrary.DATA_CONVERSION_ERR,
- "\u5F9E ''{0}'' \u81F3 ''{1}'' \u7684\u8F49\u63DB\u7121\u6548\u3002"},
-
- /*
- * Note to translators: This message is displayed if the function named
- * by the substitution text is not a function that is supported. XSLTC
- * is the acronym naming the product.
- */
- {BasisLibrary.EXTERNAL_FUNC_ERR,
- "XSLTC \u4E0D\u652F\u63F4\u5916\u90E8\u51FD\u6578 ''{0}''\u3002"},
-
- /*
- * Note to translators: This message is displayed if two values are
- * compared for equality, but the data type of one of the values is
- * unknown.
- */
- {BasisLibrary.EQUALITY_EXPR_ERR,
- "\u76F8\u7B49\u6027\u8868\u793A\u5F0F\u4E2D\u7684\u5F15\u6578\u985E\u578B\u4E0D\u660E\u3002"},
-
- /*
- * Note to translators: The substitution text for {0} will be a data
- * type; the substitution text for {1} will be the name of a function.
- * This is displayed if an argument of the particular data type is not
- * permitted for a call to this function.
- */
- {BasisLibrary.INVALID_ARGUMENT_ERR,
- "\u547C\u53EB ''{1}'' \u4E2D\u7684\u5F15\u6578\u985E\u578B ''{0}'' \u7121\u6548"},
-
- /*
- * Note to translators: There is way of specifying a format for a
- * number using a pattern; the processor was unable to format the
- * particular value using the specified pattern.
- */
- {BasisLibrary.FORMAT_NUMBER_ERR,
- "\u5617\u8A66\u4F7F\u7528\u6A23\u5F0F ''{1}'' \u683C\u5F0F\u5316\u6578\u5B57 ''{0}''\u3002"},
-
- /*
- * Note to translators: The following represents an internal error
- * situation in XSLTC. The processor was unable to create a copy of an
- * iterator. (See definition of iterator above.)
- */
- {BasisLibrary.ITERATOR_CLONE_ERR,
- "\u7121\u6CD5\u8907\u88FD\u91CD\u8907\u7A0B\u5F0F ''{0}''\u3002"},
-
- /*
- * Note to translators: The following represents an internal error
- * situation in XSLTC. The processor attempted to create an iterator
- * for a particular axis (see definition above) that it does not
- * support.
- */
- {BasisLibrary.AXIS_SUPPORT_ERR,
- "\u4E0D\u652F\u63F4\u8EF8 ''{0}'' \u7684\u91CD\u8907\u7A0B\u5F0F\u3002"},
-
- /*
- * Note to translators: The following represents an internal error
- * situation in XSLTC. The processor attempted to create an iterator
- * for a particular axis (see definition above) that it does not
- * support.
- */
- {BasisLibrary.TYPED_AXIS_SUPPORT_ERR,
- "\u4E0D\u652F\u63F4\u985E\u578B\u8EF8 ''{0}'' \u7684\u91CD\u8907\u7A0B\u5F0F\u3002"},
-
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- {BasisLibrary.STRAY_ATTRIBUTE_ERR,
- "\u5C6C\u6027 ''{0}'' \u5728\u5143\u7D20\u4E4B\u5916\u3002"},
-
- /*
- * Note to translators: As with the preceding message, a namespace
- * declaration has the form of an attribute and is only permitted to
- * appear on an element. The substitution text {0} is the namespace
- * prefix and {1} is the URI that was being used in the erroneous
- * namespace declaration.
- */
- {BasisLibrary.STRAY_NAMESPACE_ERR,
- "\u547D\u540D\u7A7A\u9593\u5BA3\u544A ''{0}''=''{1}'' \u8D85\u51FA\u5143\u7D20\u5916\u3002"},
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- {BasisLibrary.NAMESPACE_PREFIX_ERR,
- "\u5B57\u9996 ''{0}'' \u7684\u547D\u540D\u7A7A\u9593\u5C1A\u672A\u5BA3\u544A\u3002"},
-
- /*
- * Note to translators: The following represents an internal error.
- * DOMAdapter is a Java class in XSLTC.
- */
- {BasisLibrary.DOM_ADAPTER_INIT_ERR,
- "\u4F7F\u7528\u932F\u8AA4\u7684\u4F86\u6E90 DOM \u985E\u578B\u5EFA\u7ACB DOMAdapter\u3002"},
-
- /*
- * Note to translators: The following message indicates that the XML
- * parser that is providing input to XSLTC cannot be used because it
- * does not describe to XSLTC the structure of the input XML document's
- * DTD.
- */
- {BasisLibrary.PARSER_DTD_SUPPORT_ERR,
- "\u60A8\u6B63\u5728\u4F7F\u7528\u7684 SAX \u5256\u6790\u5668\u4E0D\u6703\u8655\u7406 DTD \u5BA3\u544A\u4E8B\u4EF6\u3002"},
-
- /*
- * Note to translators: The following message indicates that the XML
- * parser that is providing input to XSLTC cannot be used because it
- * does not distinguish between ordinary XML attributes and namespace
- * declarations.
- */
- {BasisLibrary.NAMESPACES_SUPPORT_ERR,
- "\u60A8\u6B63\u5728\u4F7F\u7528\u7684 SAX \u5256\u6790\u5668\u4E0D\u652F\u63F4 XML \u547D\u540D\u7A7A\u9593\u3002"},
-
- /*
- * Note to translators: The substitution text is the URI that was in
- * error.
- */
- {BasisLibrary.CANT_RESOLVE_RELATIVE_URI_ERR,
- "\u7121\u6CD5\u89E3\u6790 URI \u53C3\u7167 ''{0}''\u3002"},
-
- /*
- * Note to translators: The stylesheet contained an element that was
- * not recognized as part of the XSL syntax. The substitution text
- * gives the element name.
- */
- {BasisLibrary.UNSUPPORTED_XSL_ERR,
- "\u4E0D\u652F\u63F4\u7684 XSL \u5143\u7D20 ''{0}''"},
-
- /*
- * Note to translators: The stylesheet referred to an extension to the
- * XSL syntax and indicated that it was defined by XSLTC, but XSLTC does
- * not recognize the particular extension named. The substitution text
- * gives the extension name.
- */
- {BasisLibrary.UNSUPPORTED_EXT_ERR,
- "\u7121\u6CD5\u8FA8\u8B58\u7684 XSLTC \u64F4\u5145\u5957\u4EF6 ''{0}''"},
-
-
- /*
- * Note to translators: This error message is produced if the translet
- * class was compiled using a newer version of XSLTC and deployed for
- * execution with an older version of XSLTC. The substitution text is
- * the name of the translet class.
- */
- {BasisLibrary.UNKNOWN_TRANSLET_VERSION_ERR,
- "\u5EFA\u7ACB\u6307\u5B9A translet ''{0}'' \u7684 XSLTC \u7248\u672C\u6BD4\u4F7F\u7528\u4E2D XSLTC \u57F7\u884C\u968E\u6BB5\u7684\u7248\u672C\u8F03\u65B0\u3002\u60A8\u5FC5\u9808\u91CD\u65B0\u7DE8\u8B6F\u6A23\u5F0F\u8868\uFF0C\u6216\u4F7F\u7528\u8F03\u65B0\u7684 XSLTC \u7248\u672C\u4F86\u57F7\u884C\u6B64 translet\u3002"},
-
- /*
- * Note to translators: An attribute whose effective value is required
- * to be a "QName" had a value that was incorrect.
- * 'QName' is an XML syntactic term that must not be translated. The
- * substitution text contains the actual value of the attribute.
- */
- {BasisLibrary.INVALID_QNAME_ERR,
- "\u503C\u5FC5\u9808\u70BA QName \u7684\u5C6C\u6027\uFF0C\u5177\u6709\u503C ''{0}''"},
-
-
- /*
- * Note to translators: An attribute whose effective value is required
- * to be a "NCName" had a value that was incorrect.
- * 'NCName' is an XML syntactic term that must not be translated. The
- * substitution text contains the actual value of the attribute.
- */
- {BasisLibrary.INVALID_NCNAME_ERR,
- "\u503C\u5FC5\u9808\u70BA NCName \u7684\u5C6C\u6027\uFF0C\u5177\u6709\u503C ''{0}''"},
-
- {BasisLibrary.UNALLOWED_EXTENSION_FUNCTION_ERR,
- "\u7576\u5B89\u5168\u8655\u7406\u529F\u80FD\u8A2D\u70BA\u771F\u6642\uFF0C\u4E0D\u5141\u8A31\u4F7F\u7528\u64F4\u5145\u5957\u4EF6\u51FD\u6578 ''{0}''\u3002"},
-
- {BasisLibrary.UNALLOWED_EXTENSION_ELEMENT_ERR,
- "\u7576\u5B89\u5168\u8655\u7406\u529F\u80FD\u8A2D\u70BA\u771F\u6642\uFF0C\u4E0D\u5141\u8A31\u4F7F\u7528\u64F4\u5145\u5957\u4EF6\u5143\u7D20 ''{0}''\u3002"},
- };
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/InternalRuntimeError.java b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/InternalRuntimeError.java
deleted file mode 100644
index 1f11788..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/InternalRuntimeError.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- * $Id: InternalRuntimeError.java,v 1.0 2009-11-25 04:34:28 joehw Exp $
- */
-package com.sun.org.apache.xalan.internal.xsltc.runtime;
-
-/**
- * Class to express failed assertions and similar for the xsltc runtime.
- * As java.lang.AssertionError was introduced in JDK 1.4 we can't use that yet.
- */
-public class InternalRuntimeError extends Error {
-
- public InternalRuntimeError(String message) {
- super(message);
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/MessageHandler.java b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/MessageHandler.java
deleted file mode 100644
index da227f5..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/MessageHandler.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: MessageHandler.java,v 1.2.4.1 2005/09/06 11:06:49 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.runtime;
-
-/**
- * @author Morten Jorgensen
- */
-public class MessageHandler {
- public void displayMessage(String msg) {
- System.err.println(msg);
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/Node.java b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/Node.java
deleted file mode 100644
index add4114..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/Node.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Node.java,v 1.2.4.1 2005/09/06 11:10:29 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.runtime;
-
-/**
- * This class is used as "wrapper" for dom nodes. Wrappers are needed when
- * a node is passed as a parameter to a template.
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-public class Node {
- public int node;
- public int type;
-
- public Node(int n, int t) {
- node = n;
- type = t;
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/Operators.java b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/Operators.java
deleted file mode 100644
index da71f8c..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/Operators.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Operators.java,v 1.2.4.1 2005/09/12 12:02:15 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.runtime;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- */
-public final class Operators {
- public static final int EQ = 0;
- public static final int NE = 1;
- public static final int GT = 2;
- public static final int LT = 3;
- public static final int GE = 4;
- public static final int LE = 5;
-
- private static final String[] names = {
- "=", "!=", ">", "<", ">=", "<="
- };
-
- public static final String getOpNames(int operator) {
- return names[operator];
- }
-
-// Swap operator array
- private static final int[] swapOpArray = {
- EQ, // EQ
- NE, // NE
- LT, // GT
- GT, // LT
- LE, // GE
- GE // LE
- };
-
- public static final int swapOp(int operator) {
- return swapOpArray[operator];
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/Parameter.java b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/Parameter.java
deleted file mode 100644
index e3b682d..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/Parameter.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Parameter.java,v 1.2.4.1 2005/09/06 11:21:58 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.runtime;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- */
-public class Parameter {
-
- public String _name;
- public Object _value;
- public boolean _isDefault;
-
- public Parameter(String name, Object value) {
- _name = name;
- _value = value;
- _isDefault = true;
- }
-
- public Parameter(String name, Object value, boolean isDefault) {
- _name = name;
- _value = value;
- _isDefault = isDefault;
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/StringValueHandler.java b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/StringValueHandler.java
deleted file mode 100644
index 8308352..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/StringValueHandler.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: StringValueHandler.java,v 1.2.4.1 2005/09/06 11:33:25 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.runtime;
-
-import org.xml.sax.SAXException;
-
-import com.sun.org.apache.xml.internal.serializer.EmptySerializer;
-
-/**
- * @author Jacek Ambroziak
- * @author Santiago Pericas-Geertsen
- * @author Morten Jorgensen
- */
-public final class StringValueHandler extends EmptySerializer {
-
- private StringBuilder _buffer = new StringBuilder();
- private String _str = null;
- private static final String EMPTY_STR = "";
- private boolean m_escaping = false;
- private int _nestedLevel = 0;
-
- public void characters(char[] ch, int off, int len)
- throws SAXException
- {
- if (_nestedLevel > 0)
- return;
-
- if (_str != null) {
- _buffer.append(_str);
- _str = null;
- }
- _buffer.append(ch, off, len);
- }
-
- public String getValue() {
- if (_buffer.length() != 0) {
- String result = _buffer.toString();
- _buffer.setLength(0);
- return result;
- }
- else {
- String result = _str;
- _str = null;
- return (result != null) ? result : EMPTY_STR;
- }
- }
-
- public void characters(String characters) throws SAXException {
- if (_nestedLevel > 0)
- return;
-
- if (_str == null && _buffer.length() == 0) {
- _str = characters;
- }
- else {
- if (_str != null) {
- _buffer.append(_str);
- _str = null;
- }
-
- _buffer.append(characters);
- }
- }
-
- public void startElement(String qname) throws SAXException {
- _nestedLevel++;
- }
-
- public void endElement(String qname) throws SAXException {
- _nestedLevel--;
- }
-
- // Override the setEscaping method just to indicate that this class is
- // aware that that method might be called.
- public boolean setEscaping(boolean bool) {
- boolean oldEscaping = m_escaping;
- m_escaping = bool;
-
- return bool;
- }
-
- /**
- * The value of a PI must not contain the substring "?>". Should
- * that substring be present, replace it by "? >".
- */
- public String getValueOfPI() {
- final String value = getValue();
-
- if (value.indexOf("?>") > 0) {
- final int n = value.length();
- final StringBuilder valueOfPI = new StringBuilder();
-
- for (int i = 0; i < n;) {
- final char ch = value.charAt(i++);
- if (ch == '?' && value.charAt(i) == '>') {
- valueOfPI.append("? >"); i++;
- }
- else {
- valueOfPI.append(ch);
- }
- }
- return valueOfPI.toString();
- }
- return value;
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/output/OutputBuffer.java b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/output/OutputBuffer.java
deleted file mode 100644
index 01f1ca9..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/output/OutputBuffer.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: OutputBuffer.java,v 1.2.4.1 2005/09/06 11:35:23 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.runtime.output;
-
-/**
- * @author Santiago Pericas-Geertsen
- */
-interface OutputBuffer {
-
- public String close();
- public OutputBuffer append(char ch);
- public OutputBuffer append(String s);
- public OutputBuffer append(char[] s, int from, int to);
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/output/StringOutputBuffer.java b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/output/StringOutputBuffer.java
deleted file mode 100644
index 2f9c43e..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/output/StringOutputBuffer.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: StringOutputBuffer.java,v 1.2.4.1 2005/09/06 11:36:16 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.runtime.output;
-
-
-/**
- * @author Santiago Pericas-Geertsen
- */
-class StringOutputBuffer implements OutputBuffer {
- private StringBuffer _buffer;
-
- public StringOutputBuffer() {
- _buffer = new StringBuffer();
- }
-
- public String close() {
- return _buffer.toString();
- }
-
- public OutputBuffer append(String s) {
- _buffer.append(s);
- return this;
- }
-
- public OutputBuffer append(char[] s, int from, int to) {
- _buffer.append(s, from, to);
- return this;
- }
-
- public OutputBuffer append(char ch) {
- _buffer.append(ch);
- return this;
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/output/TransletOutputHandlerFactory.java b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/output/TransletOutputHandlerFactory.java
deleted file mode 100644
index 8b76f3a..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/output/TransletOutputHandlerFactory.java
+++ /dev/null
@@ -1,272 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: TransletOutputHandlerFactory.java,v 1.2.4.2 2005/09/15 19:12:05 jeffsuttor Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.runtime.output;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.Writer;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.stream.XMLEventWriter;
-import javax.xml.stream.util.XMLEventConsumer;
-import javax.xml.stream.XMLStreamWriter;
-
-import com.sun.org.apache.xalan.internal.xsltc.trax.SAX2DOM;
-import com.sun.org.apache.xalan.internal.xsltc.trax.SAX2StAXEventWriter;
-import com.sun.org.apache.xalan.internal.xsltc.trax.SAX2StAXStreamWriter;
-
-import com.sun.org.apache.xml.internal.serializer.ToHTMLSAXHandler;
-import com.sun.org.apache.xml.internal.serializer.ToHTMLStream;
-import com.sun.org.apache.xml.internal.serializer.ToTextSAXHandler;
-import com.sun.org.apache.xml.internal.serializer.ToTextStream;
-import com.sun.org.apache.xml.internal.serializer.ToUnknownStream;
-import com.sun.org.apache.xml.internal.serializer.ToXMLSAXHandler;
-import com.sun.org.apache.xml.internal.serializer.ToXMLStream;
-import com.sun.org.apache.xml.internal.serializer.SerializationHandler;
-import org.w3c.dom.Node;
-
-import org.xml.sax.ContentHandler;
-import org.xml.sax.ext.LexicalHandler;
-
-/**
- * @author Santiago Pericas-Geertsen
- */
-public class TransletOutputHandlerFactory {
-
- public static final int STREAM = 0;
- public static final int SAX = 1;
- public static final int DOM = 2;
- public static final int STAX = 3;
-
- private String _encoding = "utf-8";
- private String _method = null;
- private int _outputType = STREAM;
- private OutputStream _ostream = System.out;
- private Writer _writer = null;
- private Node _node = null;
- private Node _nextSibling = null;
- private XMLEventWriter _xmlStAXEventWriter = null;
- private XMLStreamWriter _xmlStAXStreamWriter = null;
- private int _indentNumber = -1;
- private ContentHandler _handler = null;
- private LexicalHandler _lexHandler = null;
-
- private boolean _useServicesMechanism;
-
- static public TransletOutputHandlerFactory newInstance() {
- return new TransletOutputHandlerFactory(true);
- }
- static public TransletOutputHandlerFactory newInstance(boolean useServicesMechanism) {
- return new TransletOutputHandlerFactory(useServicesMechanism);
- }
-
- public TransletOutputHandlerFactory(boolean useServicesMechanism) {
- _useServicesMechanism = useServicesMechanism;
- }
- public void setOutputType(int outputType) {
- _outputType = outputType;
- }
-
- public void setEncoding(String encoding) {
- if (encoding != null) {
- _encoding = encoding;
- }
- }
-
- public void setOutputMethod(String method) {
- _method = method;
- }
-
- public void setOutputStream(OutputStream ostream) {
- _ostream = ostream;
- }
-
- public void setWriter(Writer writer) {
- _writer = writer;
- }
-
- public void setHandler(ContentHandler handler) {
- _handler = handler;
- }
-
- public void setLexicalHandler(LexicalHandler lex) {
- _lexHandler = lex;
- }
-
- public void setNode(Node node) {
- _node = node;
- }
-
- public Node getNode() {
- return (_handler instanceof SAX2DOM) ? ((SAX2DOM)_handler).getDOM()
- : null;
- }
-
- public void setNextSibling(Node nextSibling) {
- _nextSibling = nextSibling;
- }
-
- public XMLEventWriter getXMLEventWriter() {
- return (_handler instanceof SAX2StAXEventWriter) ? ((SAX2StAXEventWriter) _handler).getEventWriter() : null;
- }
-
- public void setXMLEventWriter(XMLEventWriter eventWriter) {
- _xmlStAXEventWriter = eventWriter;
- }
-
- public XMLStreamWriter getXMLStreamWriter() {
- return (_handler instanceof SAX2StAXStreamWriter) ? ((SAX2StAXStreamWriter) _handler).getStreamWriter() : null;
- }
-
- public void setXMLStreamWriter(XMLStreamWriter streamWriter) {
- _xmlStAXStreamWriter = streamWriter;
- }
-
- public void setIndentNumber(int value) {
- _indentNumber = value;
- }
-
- public SerializationHandler getSerializationHandler()
- throws IOException, ParserConfigurationException
- {
- SerializationHandler result = null;
- switch (_outputType)
- {
- case STREAM :
-
- if (_method == null)
- {
- result = new ToUnknownStream();
- }
- else if (_method.equalsIgnoreCase("xml"))
- {
-
- result = new ToXMLStream();
-
- }
- else if (_method.equalsIgnoreCase("html"))
- {
-
- result = new ToHTMLStream();
-
- }
- else if (_method.equalsIgnoreCase("text"))
- {
-
- result = new ToTextStream();
-
- }
-
- if (result != null && _indentNumber >= 0)
- {
- result.setIndentAmount(_indentNumber);
- }
-
- result.setEncoding(_encoding);
-
- if (_writer != null)
- {
- result.setWriter(_writer);
- }
- else
- {
- result.setOutputStream(_ostream);
- }
- return result;
-
- case DOM :
- _handler = (_node != null) ? new SAX2DOM(_node, _nextSibling, _useServicesMechanism) : new SAX2DOM(_useServicesMechanism);
- _lexHandler = (LexicalHandler) _handler;
- // falls through
- case STAX :
- if (_xmlStAXEventWriter != null) {
- _handler = new SAX2StAXEventWriter(_xmlStAXEventWriter);
- } else if (_xmlStAXStreamWriter != null) {
- _handler = new SAX2StAXStreamWriter(_xmlStAXStreamWriter);
- }
- _lexHandler = (LexicalHandler) _handler;
- // again falls through - Padmaja Vedula
- case SAX :
- if (_method == null)
- {
- _method = "xml"; // default case
- }
-
- if (_method.equalsIgnoreCase("xml"))
- {
-
- if (_lexHandler == null)
- {
- result = new ToXMLSAXHandler(_handler, _encoding);
- }
- else
- {
- result =
- new ToXMLSAXHandler(
- _handler,
- _lexHandler,
- _encoding);
- }
-
- }
- else if (_method.equalsIgnoreCase("html"))
- {
-
- if (_lexHandler == null)
- {
- result = new ToHTMLSAXHandler(_handler, _encoding);
- }
- else
- {
- result =
- new ToHTMLSAXHandler(
- _handler,
- _lexHandler,
- _encoding);
- }
-
- }
- else if (_method.equalsIgnoreCase("text"))
- {
-
- if (_lexHandler == null)
- {
- result = new ToTextSAXHandler(_handler, _encoding);
- }
- else
- {
- result =
- new ToTextSAXHandler(
- _handler,
- _lexHandler,
- _encoding);
- }
-
- }
- return result;
- }
- return null;
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/output/WriterOutputBuffer.java b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/output/WriterOutputBuffer.java
deleted file mode 100644
index 2b04e01..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/output/WriterOutputBuffer.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: WriterOutputBuffer.java,v 1.2.4.1 2005/09/06 11:43:01 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.runtime.output;
-
-import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
-import java.io.BufferedWriter;
-import java.io.IOException;
-import java.io.Writer;
-
-/**
- * @author Santiago Pericas-Geertsen
- */
-class WriterOutputBuffer implements OutputBuffer {
- private static final int KB = 1024;
- private static int BUFFER_SIZE = 4 * KB;
-
- static {
- // Set a larger buffer size for Solaris
- final String osName = SecuritySupport.getSystemProperty("os.name");
- if (osName.equalsIgnoreCase("solaris")) {
- BUFFER_SIZE = 32 * KB;
- }
- }
-
- private Writer _writer;
-
- /**
- * Initializes a WriterOutputBuffer by creating an instance of a
- * BufferedWriter. The size of the buffer in this writer may have
- * a significant impact on throughput. Solaris prefers a larger
- * buffer, while Linux works better with a smaller one.
- */
- public WriterOutputBuffer(Writer writer) {
- _writer = new BufferedWriter(writer, BUFFER_SIZE);
- }
-
- public String close() {
- try {
- _writer.flush();
- }
- catch (IOException e) {
- throw new RuntimeException(e.toString());
- }
- return "";
- }
-
- public OutputBuffer append(String s) {
- try {
- _writer.write(s);
- }
- catch (IOException e) {
- throw new RuntimeException(e.toString());
- }
- return this;
- }
-
- public OutputBuffer append(char[] s, int from, int to) {
- try {
- _writer.write(s, from, to);
- }
- catch (IOException e) {
- throw new RuntimeException(e.toString());
- }
- return this;
- }
-
- public OutputBuffer append(char ch) {
- try {
- _writer.write(ch);
- }
- catch (IOException e) {
- throw new RuntimeException(e.toString());
- }
- return this;
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/trax/DOM2SAX.java b/src/com/sun/org/apache/xalan/internal/xsltc/trax/DOM2SAX.java
deleted file mode 100644
index 0ed9800..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/trax/DOM2SAX.java
+++ /dev/null
@@ -1,484 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DOM2SAX.java,v 1.2.4.1 2005/09/06 11:52:46 pvedula Exp $
- */
-
-
-package com.sun.org.apache.xalan.internal.xsltc.trax;
-
-import com.sun.org.apache.xalan.internal.xsltc.dom.SAXImpl;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.BasisLibrary;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Stack;
-import java.util.Vector;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.DTDHandler;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.ext.LexicalHandler;
-import org.xml.sax.helpers.AttributesImpl;
-
-/**
- * @author G. Todd Miller
- */
-public class DOM2SAX implements XMLReader, Locator {
-
- private final static String EMPTYSTRING = "";
- private static final String XMLNS_PREFIX = "xmlns";
-
- private Node _dom = null;
- private ContentHandler _sax = null;
- private LexicalHandler _lex = null;
- private SAXImpl _saxImpl = null;
- private Map<String, Stack> _nsPrefixes = new HashMap<>();
-
- public DOM2SAX(Node root) {
- _dom = root;
- }
-
- public ContentHandler getContentHandler() {
- return _sax;
- }
-
- public void setContentHandler(ContentHandler handler) throws
- NullPointerException
- {
- _sax = handler;
- if (handler instanceof LexicalHandler) {
- _lex = (LexicalHandler) handler;
- }
-
- if (handler instanceof SAXImpl) {
- _saxImpl = (SAXImpl)handler;
- }
- }
-
- /**
- * Begin the scope of namespace prefix. Forward the event to the
- * SAX handler only if the prefix is unknown or it is mapped to a
- * different URI.
- */
- private boolean startPrefixMapping(String prefix, String uri)
- throws SAXException
- {
- boolean pushed = true;
- Stack uriStack = _nsPrefixes.get(prefix);
-
- if (uriStack != null) {
- if (uriStack.isEmpty()) {
- _sax.startPrefixMapping(prefix, uri);
- uriStack.push(uri);
- }
- else {
- final String lastUri = (String) uriStack.peek();
- if (!lastUri.equals(uri)) {
- _sax.startPrefixMapping(prefix, uri);
- uriStack.push(uri);
- }
- else {
- pushed = false;
- }
- }
- }
- else {
- _sax.startPrefixMapping(prefix, uri);
- _nsPrefixes.put(prefix, uriStack = new Stack());
- uriStack.push(uri);
- }
- return pushed;
- }
-
- /*
- * End the scope of a name prefix by popping it from the stack and
- * passing the event to the SAX Handler.
- */
- private void endPrefixMapping(String prefix)
- throws SAXException
- {
- final Stack uriStack = _nsPrefixes.get(prefix);
-
- if (uriStack != null) {
- _sax.endPrefixMapping(prefix);
- uriStack.pop();
- }
- }
-
- /**
- * If the DOM was created using a DOM 1.0 API, the local name may be
- * null. If so, get the local name from the qualified name before
- * generating the SAX event.
- */
- private static String getLocalName(Node node) {
- final String localName = node.getLocalName();
-
- if (localName == null) {
- final String qname = node.getNodeName();
- final int col = qname.lastIndexOf(':');
- return (col > 0) ? qname.substring(col + 1) : qname;
- }
- return localName;
- }
-
- public void parse(InputSource unused) throws IOException, SAXException {
- parse(_dom);
- }
-
- public void parse() throws IOException, SAXException {
- if (_dom != null) {
- boolean isIncomplete =
- (_dom.getNodeType() != org.w3c.dom.Node.DOCUMENT_NODE);
-
- if (isIncomplete) {
- _sax.startDocument();
- parse(_dom);
- _sax.endDocument();
- }
- else {
- parse(_dom);
- }
- }
- }
-
- /**
- * Traverse the DOM and generate SAX events for a handler. A
- * startElement() event passes all attributes, including namespace
- * declarations.
- */
- private void parse(Node node) throws IOException, SAXException {
- Node first = null;
- if (node == null) return;
-
- switch (node.getNodeType()) {
- case Node.ATTRIBUTE_NODE: // handled by ELEMENT_NODE
- case Node.DOCUMENT_FRAGMENT_NODE:
- case Node.DOCUMENT_TYPE_NODE :
- case Node.ENTITY_NODE :
- case Node.ENTITY_REFERENCE_NODE:
- case Node.NOTATION_NODE :
- // These node types are ignored!!!
- break;
- case Node.CDATA_SECTION_NODE:
- final String cdata = node.getNodeValue();
- if (_lex != null) {
- _lex.startCDATA();
- _sax.characters(cdata.toCharArray(), 0, cdata.length());
- _lex.endCDATA();
- }
- else {
- // in the case where there is no lex handler, we still
- // want the text of the cdate to make its way through.
- _sax.characters(cdata.toCharArray(), 0, cdata.length());
- }
- break;
-
- case Node.COMMENT_NODE: // should be handled!!!
- if (_lex != null) {
- final String value = node.getNodeValue();
- _lex.comment(value.toCharArray(), 0, value.length());
- }
- break;
- case Node.DOCUMENT_NODE:
- _sax.setDocumentLocator(this);
-
- _sax.startDocument();
- Node next = node.getFirstChild();
- while (next != null) {
- parse(next);
- next = next.getNextSibling();
- }
- _sax.endDocument();
- break;
-
- case Node.ELEMENT_NODE:
- String prefix;
- Vector pushedPrefixes = new Vector();
- final AttributesImpl attrs = new AttributesImpl();
- final NamedNodeMap map = node.getAttributes();
- final int length = map.getLength();
-
- // Process all namespace declarations
- for (int i = 0; i < length; i++) {
- final Node attr = map.item(i);
- final String qnameAttr = attr.getNodeName();
-
- // Ignore everything but NS declarations here
- if (qnameAttr.startsWith(XMLNS_PREFIX)) {
- final String uriAttr = attr.getNodeValue();
- final int colon = qnameAttr.lastIndexOf(':');
- prefix = (colon > 0) ? qnameAttr.substring(colon + 1) : EMPTYSTRING;
- if (startPrefixMapping(prefix, uriAttr)) {
- pushedPrefixes.addElement(prefix);
- }
- }
- }
-
- // Process all other attributes
- for (int i = 0; i < length; i++) {
- final Node attr = map.item(i);
- String qnameAttr = attr.getNodeName();
-
- // Ignore NS declarations here
- if (!qnameAttr.startsWith(XMLNS_PREFIX)) {
- final String uriAttr = attr.getNamespaceURI();
- final String localNameAttr = getLocalName(attr);
-
- // Uri may be implicitly declared
- if (uriAttr != null) {
- final int colon = qnameAttr.lastIndexOf(':');
- if (colon > 0) {
- prefix = qnameAttr.substring(0, colon);
- }
- else {
- // If no prefix for this attr, we need to create
- // one because we cannot use the default ns
- prefix = BasisLibrary.generatePrefix();
- qnameAttr = prefix + ':' + qnameAttr;
- }
- if (startPrefixMapping(prefix, uriAttr)) {
- pushedPrefixes.addElement(prefix);
- }
- }
-
- // Add attribute to list
- attrs.addAttribute(attr.getNamespaceURI(), getLocalName(attr),
- qnameAttr, "CDATA", attr.getNodeValue());
- }
- }
-
- // Now process the element itself
- final String qname = node.getNodeName();
- final String uri = node.getNamespaceURI();
- final String localName = getLocalName(node);
-
- // Uri may be implicitly declared
- if (uri != null) {
- final int colon = qname.lastIndexOf(':');
- prefix = (colon > 0) ? qname.substring(0, colon) : EMPTYSTRING;
- if (startPrefixMapping(prefix, uri)) {
- pushedPrefixes.addElement(prefix);
- }
- }
-
- // Generate SAX event to start element
- if (_saxImpl != null) {
- _saxImpl.startElement(uri, localName, qname, attrs, node);
- }
- else {
- _sax.startElement(uri, localName, qname, attrs);
- }
-
- // Traverse all child nodes of the element (if any)
- next = node.getFirstChild();
- while (next != null) {
- parse(next);
- next = next.getNextSibling();
- }
-
- // Generate SAX event to close element
- _sax.endElement(uri, localName, qname);
-
- // Generate endPrefixMapping() for all pushed prefixes
- final int nPushedPrefixes = pushedPrefixes.size();
- for (int i = 0; i < nPushedPrefixes; i++) {
- endPrefixMapping((String) pushedPrefixes.elementAt(i));
- }
- break;
-
- case Node.PROCESSING_INSTRUCTION_NODE:
- _sax.processingInstruction(node.getNodeName(),
- node.getNodeValue());
- break;
-
- case Node.TEXT_NODE:
- final String data = node.getNodeValue();
- _sax.characters(data.toCharArray(), 0, data.length());
- break;
- }
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public DTDHandler getDTDHandler() {
- return null;
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public ErrorHandler getErrorHandler() {
- return null;
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public boolean getFeature(String name) throws SAXNotRecognizedException,
- SAXNotSupportedException
- {
- return false;
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public void setFeature(String name, boolean value) throws
- SAXNotRecognizedException, SAXNotSupportedException
- {
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public void parse(String sysId) throws IOException, SAXException {
- throw new IOException("This method is not yet implemented.");
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public void setDTDHandler(DTDHandler handler) throws NullPointerException {
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public void setEntityResolver(EntityResolver resolver) throws
- NullPointerException
- {
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public EntityResolver getEntityResolver() {
- return null;
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public void setErrorHandler(ErrorHandler handler) throws
- NullPointerException
- {
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public void setProperty(String name, Object value) throws
- SAXNotRecognizedException, SAXNotSupportedException {
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public Object getProperty(String name) throws SAXNotRecognizedException,
- SAXNotSupportedException
- {
- return null;
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public int getColumnNumber() {
- return 0;
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public int getLineNumber() {
- return 0;
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public String getPublicId() {
- return null;
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public String getSystemId() {
- return null;
- }
-
- // Debugging
- private String getNodeTypeFromCode(short code) {
- String retval = null;
- switch (code) {
- case Node.ATTRIBUTE_NODE :
- retval = "ATTRIBUTE_NODE"; break;
- case Node.CDATA_SECTION_NODE :
- retval = "CDATA_SECTION_NODE"; break;
- case Node.COMMENT_NODE :
- retval = "COMMENT_NODE"; break;
- case Node.DOCUMENT_FRAGMENT_NODE :
- retval = "DOCUMENT_FRAGMENT_NODE"; break;
- case Node.DOCUMENT_NODE :
- retval = "DOCUMENT_NODE"; break;
- case Node.DOCUMENT_TYPE_NODE :
- retval = "DOCUMENT_TYPE_NODE"; break;
- case Node.ELEMENT_NODE :
- retval = "ELEMENT_NODE"; break;
- case Node.ENTITY_NODE :
- retval = "ENTITY_NODE"; break;
- case Node.ENTITY_REFERENCE_NODE :
- retval = "ENTITY_REFERENCE_NODE"; break;
- case Node.NOTATION_NODE :
- retval = "NOTATION_NODE"; break;
- case Node.PROCESSING_INSTRUCTION_NODE :
- retval = "PROCESSING_INSTRUCTION_NODE"; break;
- case Node.TEXT_NODE:
- retval = "TEXT_NODE"; break;
- }
- return retval;
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/trax/DOM2TO.java b/src/com/sun/org/apache/xalan/internal/xsltc/trax/DOM2TO.java
deleted file mode 100644
index 053773d..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/trax/DOM2TO.java
+++ /dev/null
@@ -1,436 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DOM2TO.java,v 1.5 2005/09/28 13:48:44 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.trax;
-
-import java.io.IOException;
-
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.Document;
-import com.sun.org.apache.xml.internal.serializer.SerializationHandler;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.DTDHandler;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.ext.Locator2;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
-import org.xml.sax.XMLReader;
-import com.sun.org.apache.xml.internal.serializer.NamespaceMappings;
-
-/**
- * @author Santiago Pericas-Geertsen
- * @author Sunitha Reddy
- */
-public class DOM2TO implements XMLReader, Locator2 {
-
- private final static String EMPTYSTRING = "";
- private static final String XMLNS_PREFIX = "xmlns";
-
- /**
- * A reference to the DOM to be traversed.
- */
- private Node _dom;
-
- /**
- * A reference to the output handler receiving the events.
- */
- private SerializationHandler _handler;
-
-
- private String xmlVersion = null;
-
- private String xmlEncoding = null;
-
-
- public DOM2TO(Node root, SerializationHandler handler) {
- _dom = root;
- _handler = handler;
- }
-
- public ContentHandler getContentHandler() {
- return null;
- }
-
- public void setContentHandler(ContentHandler handler) {
- // Empty
- }
-
- public void parse(InputSource unused) throws IOException, SAXException {
- parse(_dom);
- }
-
- public void parse() throws IOException, SAXException {
-
- if (_dom != null) {
- boolean isIncomplete =
- (_dom.getNodeType() != org.w3c.dom.Node.DOCUMENT_NODE);
-
- if (isIncomplete) {
- _handler.startDocument();
- parse(_dom);
- _handler.endDocument();
- }
- else {
- parse(_dom);
- }
- }
- }
-
- /**
- * Traverse the DOM and generate TO events for a handler. Notice that
- * we need to handle implicit namespace declarations too.
- */
- private void parse(Node node)
- throws IOException, SAXException
- {
- if (node == null) return;
-
- switch (node.getNodeType()) {
- case Node.ATTRIBUTE_NODE: // handled by ELEMENT_NODE
- case Node.DOCUMENT_TYPE_NODE :
- case Node.ENTITY_NODE :
- case Node.ENTITY_REFERENCE_NODE:
- case Node.NOTATION_NODE :
- // These node types are ignored!!!
- break;
- case Node.CDATA_SECTION_NODE:
- _handler.startCDATA();
- _handler.characters(node.getNodeValue());
- _handler.endCDATA();
- break;
-
- case Node.COMMENT_NODE: // should be handled!!!
- _handler.comment(node.getNodeValue());
- break;
-
- case Node.DOCUMENT_NODE:
- setDocumentInfo((Document)node);
- _handler.setDocumentLocator(this);
- _handler.startDocument();
- Node next = node.getFirstChild();
- while (next != null) {
- parse(next);
- next = next.getNextSibling();
- }
- _handler.endDocument();
- break;
-
- case Node.DOCUMENT_FRAGMENT_NODE:
- next = node.getFirstChild();
- while (next != null) {
- parse(next);
- next = next.getNextSibling();
- }
- break;
-
- case Node.ELEMENT_NODE:
- // Generate SAX event to start element
- final String qname = node.getNodeName();
- _handler.startElement(null, null, qname);
-
- int colon;
- String prefix;
- final NamedNodeMap map = node.getAttributes();
- final int length = map.getLength();
-
- // Process all namespace attributes first
- for (int i = 0; i < length; i++) {
- final Node attr = map.item(i);
- final String qnameAttr = attr.getNodeName();
-
- // Is this a namespace declaration?
- if (qnameAttr.startsWith(XMLNS_PREFIX)) {
- final String uriAttr = attr.getNodeValue();
- colon = qnameAttr.lastIndexOf(':');
- prefix = (colon > 0) ? qnameAttr.substring(colon + 1)
- : EMPTYSTRING;
- _handler.namespaceAfterStartElement(prefix, uriAttr);
- }
- }
-
- // Process all non-namespace attributes next
- NamespaceMappings nm = new NamespaceMappings();
- for (int i = 0; i < length; i++) {
- final Node attr = map.item(i);
- final String qnameAttr = attr.getNodeName();
-
- // Is this a regular attribute?
- if (!qnameAttr.startsWith(XMLNS_PREFIX)) {
- final String uriAttr = attr.getNamespaceURI();
- // Uri may be implicitly declared
- if (uriAttr != null && !uriAttr.equals(EMPTYSTRING) ) {
- colon = qnameAttr.lastIndexOf(':');
-
- // Fix for bug 26319
- // For attributes not given an prefix explictly
- // but having a namespace uri we need
- // to explicitly generate the prefix
- String newPrefix = nm.lookupPrefix(uriAttr);
- if (newPrefix == null)
- newPrefix = nm.generateNextPrefix();
- prefix = (colon > 0) ? qnameAttr.substring(0, colon)
- : newPrefix;
- _handler.namespaceAfterStartElement(prefix, uriAttr);
- _handler.addAttribute((prefix + ":" + qnameAttr),
- attr.getNodeValue());
- } else {
- _handler.addAttribute(qnameAttr, attr.getNodeValue());
- }
- }
- }
-
- // Now element namespace and children
- final String uri = node.getNamespaceURI();
- final String localName = node.getLocalName();
-
- // Uri may be implicitly declared
- if (uri != null) {
- colon = qname.lastIndexOf(':');
- prefix = (colon > 0) ? qname.substring(0, colon) : EMPTYSTRING;
- _handler.namespaceAfterStartElement(prefix, uri);
- }else {
- // Fix for bug 26319
- // If an element foo is created using
- // createElementNS(null,locName)
- // then the element should be serialized
- // <foo xmlns=" "/>
- if (uri == null && localName != null) {
- prefix = EMPTYSTRING;
- _handler.namespaceAfterStartElement(prefix, EMPTYSTRING);
- }
- }
-
- // Traverse all child nodes of the element (if any)
- next = node.getFirstChild();
- while (next != null) {
- parse(next);
- next = next.getNextSibling();
- }
-
- // Generate SAX event to close element
- _handler.endElement(qname);
- break;
-
- case Node.PROCESSING_INSTRUCTION_NODE:
- _handler.processingInstruction(node.getNodeName(),
- node.getNodeValue());
- break;
-
- case Node.TEXT_NODE:
- _handler.characters(node.getNodeValue());
- break;
- }
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public DTDHandler getDTDHandler() {
- return null;
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public ErrorHandler getErrorHandler() {
- return null;
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public boolean getFeature(String name) throws SAXNotRecognizedException,
- SAXNotSupportedException
- {
- return false;
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public void setFeature(String name, boolean value) throws
- SAXNotRecognizedException, SAXNotSupportedException
- {
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public void parse(String sysId) throws IOException, SAXException {
- throw new IOException("This method is not yet implemented.");
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public void setDTDHandler(DTDHandler handler) throws NullPointerException {
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public void setEntityResolver(EntityResolver resolver) throws
- NullPointerException
- {
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public EntityResolver getEntityResolver() {
- return null;
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public void setErrorHandler(ErrorHandler handler) throws
- NullPointerException
- {
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public void setProperty(String name, Object value) throws
- SAXNotRecognizedException, SAXNotSupportedException {
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public Object getProperty(String name) throws SAXNotRecognizedException,
- SAXNotSupportedException
- {
- return null;
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public int getColumnNumber() {
- return 0;
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public int getLineNumber() {
- return 0;
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public String getPublicId() {
- return null;
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public String getSystemId() {
- return null;
- }
-
-
- private void setDocumentInfo(Document document) {
- if (!document.getXmlStandalone())
- _handler.setStandalone(Boolean.toString(document.getXmlStandalone()));
- setXMLVersion(document.getXmlVersion());
- setEncoding(document.getXmlEncoding());
- }
-
- public String getXMLVersion() {
- return xmlVersion;
- }
-
- private void setXMLVersion(String version) {
- if (version != null) {
- xmlVersion = version;
- _handler.setVersion(xmlVersion);
- }
- }
-
- public String getEncoding() {
- return xmlEncoding;
- }
-
- private void setEncoding(String encoding) {
- if (encoding != null) {
- xmlEncoding = encoding;
- _handler.setEncoding(encoding);
- }
- }
-
- // Debugging
- private String getNodeTypeFromCode(short code) {
- String retval = null;
- switch (code) {
- case Node.ATTRIBUTE_NODE :
- retval = "ATTRIBUTE_NODE"; break;
- case Node.CDATA_SECTION_NODE :
- retval = "CDATA_SECTION_NODE"; break;
- case Node.COMMENT_NODE :
- retval = "COMMENT_NODE"; break;
- case Node.DOCUMENT_FRAGMENT_NODE :
- retval = "DOCUMENT_FRAGMENT_NODE"; break;
- case Node.DOCUMENT_NODE :
- retval = "DOCUMENT_NODE"; break;
- case Node.DOCUMENT_TYPE_NODE :
- retval = "DOCUMENT_TYPE_NODE"; break;
- case Node.ELEMENT_NODE :
- retval = "ELEMENT_NODE"; break;
- case Node.ENTITY_NODE :
- retval = "ENTITY_NODE"; break;
- case Node.ENTITY_REFERENCE_NODE :
- retval = "ENTITY_REFERENCE_NODE"; break;
- case Node.NOTATION_NODE :
- retval = "NOTATION_NODE"; break;
- case Node.PROCESSING_INSTRUCTION_NODE :
- retval = "PROCESSING_INSTRUCTION_NODE"; break;
- case Node.TEXT_NODE:
- retval = "TEXT_NODE"; break;
- }
- return retval;
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/trax/OutputSettings.java b/src/com/sun/org/apache/xalan/internal/xsltc/trax/OutputSettings.java
deleted file mode 100644
index cd30df3..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/trax/OutputSettings.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: OutputSettings.java,v 1.2.4.1 2005/09/06 11:59:11 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.trax;
-
-import java.util.Properties;
-
-/**
- * @author Morten Jorgensen
- */
-public final class OutputSettings {
-
- private String _cdata_section_elements = null;
- private String _doctype_public = null;
- private String _encoding = null;
- private String _indent = null;
- private String _media_type = null;
- private String _method = null;
- private String _omit_xml_declaration = null;
- private String _standalone = null;
- private String _version = null;
-
- public Properties getProperties() {
- Properties properties = new Properties();
- return(properties);
- }
-
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2DOM.java b/src/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2DOM.java
deleted file mode 100644
index 8cf62c0..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2DOM.java
+++ /dev/null
@@ -1,337 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: SAX2DOM.java,v 1.8.2.1 2006/12/04 18:45:41 spericas Exp $
- */
-
-
-package com.sun.org.apache.xalan.internal.xsltc.trax;
-
-import java.util.Stack;
-import java.util.Vector;
-import javax.xml.parsers.DocumentBuilder;
-
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import com.sun.org.apache.xalan.internal.xsltc.runtime.Constants;
-
-import org.w3c.dom.Comment;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-import org.w3c.dom.ProcessingInstruction;
-import org.xml.sax.Attributes;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-import org.xml.sax.ext.LexicalHandler;
-import org.xml.sax.ext.Locator2;
-
-/**
- * @author G. Todd Miller
- * @author Sunitha Reddy
- * @author Huizhe Wang
- */
-public class SAX2DOM implements ContentHandler, LexicalHandler, Constants {
-
- private Node _root = null;
- private Document _document = null;
- private Node _nextSibling = null;
- private Stack _nodeStk = new Stack();
- private Vector _namespaceDecls = null;
- private Node _lastSibling = null;
- private Locator locator = null;
- private boolean needToSetDocumentInfo = true;
-
- //Replace StringBuffer with StringBuilder now that we no long support jdk1.4
- private StringBuilder _textBuffer = new StringBuilder();
- private Node _nextSiblingCache = null;
- /**
- * JAXP document builder factory. Create a single instance and use
- * synchronization because the Javadoc is not explicit about
- * thread safety.
- */
- private DocumentBuilderFactory _factory =
- DocumentBuilderFactory.newInstance();
- private boolean _internal = true;
-
- public SAX2DOM(boolean useServicesMechanism) throws ParserConfigurationException {
- _document = createDocument(useServicesMechanism);
- _root = _document;
- }
-
- public SAX2DOM(Node root, Node nextSibling, boolean useServicesMechanism) throws ParserConfigurationException {
- _root = root;
- if (root instanceof Document) {
- _document = (Document)root;
- }
- else if (root != null) {
- _document = root.getOwnerDocument();
- }
- else {
- _document = createDocument(useServicesMechanism);
- _root = _document;
- }
-
- _nextSibling = nextSibling;
- }
-
- public SAX2DOM(Node root, boolean useServicesMechanism) throws ParserConfigurationException {
- this(root, null, useServicesMechanism);
- }
-
- public Node getDOM() {
- return _root;
- }
-
- public void characters(char[] ch, int start, int length) {
- // Ignore text nodes of length 0
- if (length == 0) {
- return;
- }
-
- final Node last = (Node)_nodeStk.peek();
-
- // No text nodes can be children of root (DOM006 exception)
- if (last != _document) {
- _nextSiblingCache = _nextSibling;
- _textBuffer.append(ch, start, length);
- }
- }
- private void appendTextNode() {
- if (_textBuffer.length() > 0) {
- final Node last = (Node)_nodeStk.peek();
- if (last == _root && _nextSiblingCache != null) {
- _lastSibling = last.insertBefore(_document.createTextNode(_textBuffer.toString()), _nextSiblingCache);
- }
- else {
- _lastSibling = last.appendChild(_document.createTextNode(_textBuffer.toString()));
- }
- _textBuffer.setLength(0);
- }
- }
- public void startDocument() {
- _nodeStk.push(_root);
- }
-
- public void endDocument() {
- _nodeStk.pop();
- }
-
- private void setDocumentInfo() {
- //try to set document version
- if (locator == null) return;
- try{
- _document.setXmlVersion(((Locator2)locator).getXMLVersion());
- }catch(ClassCastException e){}
-
- }
-
- public void startElement(String namespace, String localName, String qName,
- Attributes attrs)
- {
- appendTextNode();
- if (needToSetDocumentInfo) {
- setDocumentInfo();
- needToSetDocumentInfo = false;
- }
-
- final Element tmp = (Element)_document.createElementNS(namespace, qName);
-
- // Add namespace declarations first
- if (_namespaceDecls != null) {
- final int nDecls = _namespaceDecls.size();
- for (int i = 0; i < nDecls; i++) {
- final String prefix = (String) _namespaceDecls.elementAt(i++);
-
- if (prefix == null || prefix.equals(EMPTYSTRING)) {
- tmp.setAttributeNS(XMLNS_URI, XMLNS_PREFIX,
- (String) _namespaceDecls.elementAt(i));
- }
- else {
- tmp.setAttributeNS(XMLNS_URI, XMLNS_STRING + prefix,
- (String) _namespaceDecls.elementAt(i));
- }
- }
- _namespaceDecls.clear();
- }
-
- // Add attributes to element
-/* final int nattrs = attrs.getLength();
- for (int i = 0; i < nattrs; i++) {
- if (attrs.getLocalName(i) == null) {
- tmp.setAttribute(attrs.getQName(i), attrs.getValue(i));
- }
- else {
- tmp.setAttributeNS(attrs.getURI(i), attrs.getQName(i),
- attrs.getValue(i));
- }
- } */
-
-
- // Add attributes to element
- final int nattrs = attrs.getLength();
- for (int i = 0; i < nattrs; i++) {
- // checking if Namespace processing is being done
- String attQName = attrs.getQName(i);
- String attURI = attrs.getURI(i);
- if (attrs.getLocalName(i).equals("")) {
- tmp.setAttribute(attQName, attrs.getValue(i));
- if (attrs.getType(i).equals("ID")) {
- tmp.setIdAttribute(attQName, true);
- }
- } else {
- tmp.setAttributeNS(attURI, attQName, attrs.getValue(i));
- if (attrs.getType(i).equals("ID")) {
- tmp.setIdAttributeNS(attURI, attrs.getLocalName(i), true);
- }
- }
- }
-
-
- // Append this new node onto current stack node
- Node last = (Node)_nodeStk.peek();
-
- // If the SAX2DOM is created with a non-null next sibling node,
- // insert the result nodes before the next sibling under the root.
- if (last == _root && _nextSibling != null)
- last.insertBefore(tmp, _nextSibling);
- else
- last.appendChild(tmp);
-
- // Push this node onto stack
- _nodeStk.push(tmp);
- _lastSibling = null;
- }
-
- public void endElement(String namespace, String localName, String qName) {
- appendTextNode();
- _nodeStk.pop();
- _lastSibling = null;
- }
-
- public void startPrefixMapping(String prefix, String uri) {
- if (_namespaceDecls == null) {
- _namespaceDecls = new Vector(2);
- }
- _namespaceDecls.addElement(prefix);
- _namespaceDecls.addElement(uri);
- }
-
- public void endPrefixMapping(String prefix) {
- // do nothing
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public void ignorableWhitespace(char[] ch, int start, int length) {
- }
-
- /**
- * adds processing instruction node to DOM.
- */
- public void processingInstruction(String target, String data) {
- appendTextNode();
- final Node last = (Node)_nodeStk.peek();
- ProcessingInstruction pi = _document.createProcessingInstruction(
- target, data);
- if (pi != null){
- if (last == _root && _nextSibling != null)
- last.insertBefore(pi, _nextSibling);
- else
- last.appendChild(pi);
-
- _lastSibling = pi;
- }
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public void setDocumentLocator(Locator locator) {
- this.locator = locator;
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public void skippedEntity(String name) {
- }
-
-
- /**
- * Lexical Handler method to create comment node in DOM tree.
- */
- public void comment(char[] ch, int start, int length) {
- appendTextNode();
- final Node last = (Node)_nodeStk.peek();
- Comment comment = _document.createComment(new String(ch,start,length));
- if (comment != null){
- if (last == _root && _nextSibling != null)
- last.insertBefore(comment, _nextSibling);
- else
- last.appendChild(comment);
-
- _lastSibling = comment;
- }
- }
-
- // Lexical Handler methods- not implemented
- public void startCDATA() { }
- public void endCDATA() { }
- public void startEntity(java.lang.String name) { }
- public void endDTD() { }
- public void endEntity(String name) { }
- public void startDTD(String name, String publicId, String systemId)
- throws SAXException {}
-
- private Document createDocument(boolean useServicesMechanism) throws ParserConfigurationException {
- if (_factory == null) {
- if (useServicesMechanism) {
- _factory = DocumentBuilderFactory.newInstance();
- if (!(_factory instanceof com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl)) {
- _internal = false;
- }
- } else {
- _factory = DocumentBuilderFactory.newInstance(
- "com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl",
- SAX2DOM.class.getClassLoader()
- );
- }
- }
- Document doc;
- if (_internal) {
- //default implementation is thread safe
- doc = _factory.newDocumentBuilder().newDocument();
- } else {
- synchronized(SAX2DOM.class) {
- doc = _factory.newDocumentBuilder().newDocument();
- }
- }
- return doc;
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2StAXBaseWriter.java b/src/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2StAXBaseWriter.java
deleted file mode 100644
index 2fcf4dc..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2StAXBaseWriter.java
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.trax;
-
-import java.util.Vector;
-
-import javax.xml.stream.Location;
-import javax.xml.stream.XMLReporter;
-import javax.xml.stream.XMLStreamException;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.ext.LexicalHandler;
-import org.xml.sax.helpers.DefaultHandler;
-
-
-public abstract class SAX2StAXBaseWriter extends DefaultHandler
- implements
- LexicalHandler {
-
-
- protected boolean isCDATA;
-
- protected StringBuffer CDATABuffer;
-
- protected Vector namespaces;
-
- protected Locator docLocator;
-
- protected XMLReporter reporter;
-
- public SAX2StAXBaseWriter() {
- }
-
- public SAX2StAXBaseWriter(XMLReporter reporter) {
- this.reporter = reporter;
- }
-
- public void setXMLReporter(XMLReporter reporter) {
- this.reporter = reporter;
- }
-
- public void setDocumentLocator(Locator locator) {
- this.docLocator = locator;
- }
-
-
- public Location getCurrentLocation() {
- if (docLocator != null) {
- return new SAXLocation(docLocator);
- } else {
- return null;
- }
-
- }
-
- public void error(SAXParseException e) throws SAXException {
- reportException("ERROR", e);
- }
-
- public void fatalError(SAXParseException e) throws SAXException {
- reportException("FATAL", e);
- }
-
- public void warning(SAXParseException e) throws SAXException {
- reportException("WARNING", e);
- }
-
- public void startDocument() throws SAXException {
- namespaces = new Vector(2);
- }
-
- public void endDocument() throws SAXException {
- namespaces = null;
- }
-
- public void startElement(String uri, String localName, String qName,
- Attributes attributes) throws SAXException {
- namespaces = null;
- }
-
- public void endElement(String uri, String localName, String qName)
- throws SAXException {
- namespaces = null;
- }
-
- public void startPrefixMapping(String prefix, String uri)
- throws SAXException {
-
- if (prefix == null) {
- prefix = "";
- } else if (prefix.equals("xml")) {
- return;
- }
-
- if (namespaces == null) {
- namespaces = new Vector(2);
- }
- namespaces.addElement(prefix);
- namespaces.addElement(uri);
- }
-
-
- public void endPrefixMapping(String prefix) throws SAXException {
- }
-
- public void startCDATA() throws SAXException {
- isCDATA = true;
- if (CDATABuffer == null) {
- CDATABuffer = new StringBuffer();
- } else {
- CDATABuffer.setLength(0);
- }
- }
-
- public void characters(char[] ch, int start, int length)
- throws SAXException {
- if (isCDATA) {
- CDATABuffer.append(ch, start, length);
- }
- }
-
- public void endCDATA() throws SAXException {
- isCDATA = false;
- CDATABuffer.setLength(0);
- }
-
- public void comment(char[] ch, int start, int length) throws SAXException {
- }
-
- public void endDTD() throws SAXException {
- }
-
- public void endEntity(String name) throws SAXException {
- }
-
- public void startDTD(String name, String publicId, String systemId)
- throws SAXException {
- }
-
- public void startEntity(String name) throws SAXException {
- }
-
- /**
- * Used to report a {@link SAXException}to the {@link XMLReporter}
- * registered with this handler.
- */
- protected void reportException(String type, SAXException e)
- throws SAXException {
-
- if (reporter != null) {
- try {
- reporter.report(e.getMessage(), type, e, getCurrentLocation());
- } catch (XMLStreamException e1) {
- throw new SAXException(e1);
- }
- }
- }
-
- /**
- * Parses an XML qualified name, and places the resulting prefix and local
- * name in the provided String array.
- *
- * @param qName The qualified name to parse.
- * @param results An array where parse results will be placed. The prefix
- * will be placed at <code>results[0]</code>, and the local
- * part at <code>results[1]</code>
- */
- public static final void parseQName(String qName, String[] results) {
-
- String prefix, local;
- int idx = qName.indexOf(':');
- if (idx >= 0) {
- prefix = qName.substring(0, idx);
- local = qName.substring(idx + 1);
- } else {
- prefix = "";
- local = qName;
- }
- results[0] = prefix;
- results[1] = local;
- }
-
- /**
- * {@Link Location}implementation used to expose details from a SAX
- * {@link Locator}.
- *
- * @author christian
- */
- private static final class SAXLocation implements Location {
-
- private int lineNumber;
- private int columnNumber;
- private String publicId;
- private String systemId;
- private SAXLocation(Locator locator) {
- lineNumber = locator.getLineNumber();
- columnNumber = locator.getColumnNumber();
- publicId = locator.getPublicId();
- systemId = locator.getSystemId();
- }
-
- public int getLineNumber() {
- return lineNumber;
- }
-
- public int getColumnNumber() {
- return columnNumber;
- }
-
- public int getCharacterOffset() {
- return -1;
- }
-
- public String getPublicId() {
- return publicId;
- }
-
- public String getSystemId() {
- return systemId;
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2StAXEventWriter.java b/src/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2StAXEventWriter.java
deleted file mode 100644
index c77ea83..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2StAXEventWriter.java
+++ /dev/null
@@ -1,420 +0,0 @@
-/*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.trax;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.stream.XMLEventFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.events.*;
-import javax.xml.stream.XMLEventWriter;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.ext.Locator2;
-
-/**
- * @author Sunitha Reddy
- */
-public class SAX2StAXEventWriter extends SAX2StAXBaseWriter {
-
-
- private XMLEventWriter writer;
-
-
- private XMLEventFactory eventFactory;
-
-
- private List namespaceStack = new ArrayList();
-
-
- private boolean needToCallStartDocument = false;
-
-
- public SAX2StAXEventWriter() {
-
- eventFactory = XMLEventFactory.newInstance();
-
- }
-
-
- public SAX2StAXEventWriter(XMLEventWriter writer) {
-
- this.writer = writer;
- eventFactory = XMLEventFactory.newInstance();
-
- }
-
- public SAX2StAXEventWriter(XMLEventWriter writer,
- XMLEventFactory factory) {
-
- this.writer = writer;
- if (factory != null) {
-
- this.eventFactory = factory;
-
- } else {
-
- eventFactory = XMLEventFactory.newInstance();
-
- }
-
- }
-
- public XMLEventWriter getEventWriter() {
-
- return writer;
-
- }
-
-
- public void setEventWriter(XMLEventWriter writer) {
-
- this.writer = writer;
-
- }
-
-
- public XMLEventFactory getEventFactory() {
-
- return eventFactory;
-
- }
-
-
- public void setEventFactory(XMLEventFactory factory) {
-
- this.eventFactory = factory;
-
- }
-
- public void startDocument() throws SAXException {
-
- super.startDocument();
-
- namespaceStack.clear();
-
- eventFactory.setLocation(getCurrentLocation());
-
- // Encoding and version info will be available only after startElement
- // is called for first time. So, defer START_DOCUMENT event of StAX till
- // that point of time.
- needToCallStartDocument = true;
- }
-
- private void writeStartDocument() throws SAXException {
- try {
- if (docLocator == null)
- writer.add(eventFactory.createStartDocument());
- else {
- try{
- writer.add(eventFactory.createStartDocument(((Locator2)docLocator).getEncoding(),((Locator2)docLocator).getXMLVersion()));
- } catch(ClassCastException e){
- writer.add(eventFactory.createStartDocument());
- }
- }
- } catch (XMLStreamException e) {
- throw new SAXException(e);
- }
- needToCallStartDocument = false;
- }
-
- public void endDocument() throws SAXException {
-
- eventFactory.setLocation(getCurrentLocation());
-
- try {
-
- writer.add(eventFactory.createEndDocument());
-
- } catch (XMLStreamException e) {
-
- throw new SAXException(e);
-
- }
-
- super.endDocument();
-
- // clear the namespaces
- namespaceStack.clear();
-
- }
-
- public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
-
- if (needToCallStartDocument) {
- writeStartDocument();
- }
-
- // set document location
- eventFactory.setLocation(getCurrentLocation());
-
- // create attribute and namespace events
- Collection[] events = {null, null};
- createStartEvents(attributes, events);
-
- namespaceStack.add(events[0]);
-
- try {
-
- String[] qname = {null, null};
- parseQName(qName, qname);
-
- writer.add(eventFactory.createStartElement(qname[0], uri,
- qname[1], events[1].iterator(), events[0].iterator()));
-
- } catch (XMLStreamException e) {
-
- throw new SAXException(e);
-
- } finally {
-
- super.startElement(uri, localName, qName, attributes);
-
- }
-
- }
-
- public void endElement(String uri, String localName, String qName)
- throws SAXException {
-
- super.endElement(uri, localName, qName);
-
- eventFactory.setLocation(getCurrentLocation());
-
- // parse name
- String[] qname = {null, null};
- parseQName(qName, qname);
-
- // get namespaces
- Collection nsList = (Collection) namespaceStack.remove(namespaceStack.size() - 1);
- Iterator nsIter = nsList.iterator();
-
- try {
-
- writer.add(eventFactory.createEndElement(qname[0], uri, qname[1],
- nsIter));
-
- } catch (XMLStreamException e) {
-
- throw new SAXException(e);
-
- }
-
- }
-
- public void comment(char[] ch, int start, int length) throws SAXException {
- if (needToCallStartDocument) {
- // Drat. We were trying to postpone this until the first element so that we could get
- // the locator, but we can't output a comment before the start document, so we're just
- // going to have to do without the locator if it hasn't been set yet.
- writeStartDocument();
- }
-
- super.comment(ch, start, length);
-
- eventFactory.setLocation(getCurrentLocation());
- try {
-
- writer.add(eventFactory.createComment(new String(ch, start,
- length)));
-
- } catch (XMLStreamException e) {
-
- throw new SAXException(e);
-
- }
-
- }
-
- public void characters(char[] ch, int start, int length)
- throws SAXException {
-
- super.characters(ch, start, length);
-
- try {
-
- if (!isCDATA) {
-
- eventFactory.setLocation(getCurrentLocation());
- writer.add(eventFactory.createCharacters(new String(ch,
- start, length)));
-
- }
-
- } catch (XMLStreamException e) {
-
- throw new SAXException(e);
-
- }
-
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length)
- throws SAXException {
-
- super.ignorableWhitespace(ch, start, length);
- characters(ch, start, length);
-
- }
-
- public void processingInstruction(String target, String data)
- throws SAXException {
-
- if (needToCallStartDocument) {
- // Drat. We were trying to postpone this until the first element so that we could get
- // the locator, but we can't output a PI before the start document, so we're just
- // going to have to do without the locator if it hasn't been set yet.
- writeStartDocument();
- }
-
- super.processingInstruction(target, data);
- try {
-
- writer.add(eventFactory.createProcessingInstruction(target, data));
-
- } catch (XMLStreamException e) {
-
- throw new SAXException(e);
-
- }
-
- }
-
- public void endCDATA() throws SAXException {
-
- eventFactory.setLocation(getCurrentLocation());
- try {
-
- writer.add(eventFactory.createCData(CDATABuffer.toString()));
-
- } catch (XMLStreamException e) {
-
- throw new SAXException(e);
-
- }
-
- super.endCDATA();
-
- }
-
-
- protected void createStartEvents(Attributes attributes, Collection[] events) {
-
- Map nsMap = null;
- List attrs = null;
-
- // create namespaces
- if (namespaces != null) {
- final int nDecls = namespaces.size();
- for (int i = 0; i < nDecls; i++) {
- final String prefix = (String) namespaces.elementAt(i++);
- String uri = (String) namespaces.elementAt(i);
- Namespace ns = createNamespace(prefix, uri);
- if (nsMap == null) {
- nsMap = new HashMap();
- }
- nsMap.put(prefix, ns);
- }
- }
-
- // create attributes
- String[] qname = {null, null};
- for (int i = 0, s = attributes.getLength(); i < s; i++) {
-
- parseQName(attributes.getQName(i), qname);
-
- String attrPrefix = qname[0];
- String attrLocal = qname[1];
-
- String attrQName = attributes.getQName(i);
- String attrValue = attributes.getValue(i);
- String attrURI = attributes.getURI(i);
-
- if ("xmlns".equals(attrQName) || "xmlns".equals(attrPrefix)) {
- // namespace declaration disguised as an attribute. If the
- // namespace has already been declared, skip it, otherwise
- // write it as an namespace
- if (nsMap == null) {
- nsMap = new HashMap();
- }
-
- if (!nsMap.containsKey(attrLocal)) {
- Namespace ns = createNamespace(attrLocal, attrValue);
- nsMap.put(attrLocal, ns);
- }
-
- } else {
-
- Attribute attribute;
- if (attrPrefix.length() > 0) {
-
- attribute = eventFactory.createAttribute(attrPrefix,
- attrURI, attrLocal, attrValue);
-
- } else {
-
- attribute = eventFactory.createAttribute(attrLocal,
- attrValue);
-
- }
-
- if (attrs == null) {
-
- attrs = new ArrayList();
-
- }
- attrs.add(attribute);
-
- }
- }
-
- events[0] = (nsMap == null ? Collections.EMPTY_LIST : nsMap.values());
- events[1] = (attrs == null ? Collections.EMPTY_LIST : attrs);
-
- }
-
- protected Namespace createNamespace(String prefix, String uri) {
-
- if (prefix == null || prefix.length() == 0) {
-
- return eventFactory.createNamespace(uri);
-
- } else {
-
- return eventFactory.createNamespace(prefix, uri);
-
- }
-
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2StAXStreamWriter.java b/src/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2StAXStreamWriter.java
deleted file mode 100644
index d04d357..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2StAXStreamWriter.java
+++ /dev/null
@@ -1,302 +0,0 @@
-/*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.trax;
-
-import java.util.Iterator;
-
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamWriter;
-import javax.xml.stream.XMLEventWriter;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.ext.Locator2;
-
-/**
- * @author Sunitha Reddy
- */
-
-public class SAX2StAXStreamWriter extends SAX2StAXBaseWriter {
-
-
- private XMLStreamWriter writer;
-
- private boolean needToCallStartDocument = false;
-
- public SAX2StAXStreamWriter() {
-
- }
-
- public SAX2StAXStreamWriter(XMLStreamWriter writer) {
-
- this.writer = writer;
-
- }
-
-
- public XMLStreamWriter getStreamWriter() {
-
- return writer;
-
- }
-
-
- public void setStreamWriter(XMLStreamWriter writer) {
-
- this.writer = writer;
-
- }
-
- public void startDocument() throws SAXException {
-
- super.startDocument();
- // Encoding and version info will be available only after startElement
- // is called for first time. So, defer START_DOCUMENT event of StAX till
- // that point of time.
- needToCallStartDocument = true;
- }
-
- public void endDocument() throws SAXException {
-
- try {
-
- writer.writeEndDocument();
-
- } catch (XMLStreamException e) {
-
- throw new SAXException(e);
-
- }
-
- super.endDocument();
-
- }
-
- public void startElement(String uri, String localName, String qName,
- Attributes attributes) throws SAXException {
-
- if (needToCallStartDocument) {
- try {
- if (docLocator == null)
- writer.writeStartDocument();
- else {
- try{
- writer.writeStartDocument(((Locator2)docLocator).getXMLVersion());
- }catch(ClassCastException e){
- writer.writeStartDocument();
- }
- }
-
- } catch (XMLStreamException e) {
-
- throw new SAXException(e);
-
- }
- needToCallStartDocument = false;
- }
-
- try {
-
- String[] qname = {null, null};
- parseQName(qName, qname);
- //Do not call writeStartElement with prefix and namespaceURI, as it writes out
- //namespace declaration.
- //writer.writeStartElement(qname[0], qname[1], uri);
- writer.writeStartElement(qName);
-
-
- // No need to write namespaces, as they are written as part of attributes.
- /*if (namespaces != null) {
-
- final int nDecls = namespaces.size();
- for (int i = 0; i < nDecls; i++) {
- final String prefix = (String) namespaces.elementAt(i);
- if (prefix.length() == 0) {
- writer.setDefaultNamespace((String)namespaces.elementAt(++i));
- } else {
- writer.setPrefix(prefix, (String) namespaces.elementAt(++i));
- }
-
- writer.writeNamespace(prefix, (String)namespaces.elementAt(i));
- }
-
-
- }*/
-
- // write attributes
- for (int i = 0, s = attributes.getLength(); i < s; i++) {
-
- parseQName(attributes.getQName(i), qname);
-
- String attrPrefix = qname[0];
- String attrLocal = qname[1];
-
- String attrQName = attributes.getQName(i);
- String attrValue = attributes.getValue(i);
- String attrURI = attributes.getURI(i);
-
- if ("xmlns".equals(attrPrefix) || "xmlns".equals(attrQName)) {
-
- // namespace declaration disguised as an attribute.
- // write it as an namespace
-
- if (attrLocal.length() == 0) {
-
- writer.setDefaultNamespace(attrValue);
-
- } else {
-
- writer.setPrefix(attrLocal, attrValue);
-
- }
-
- writer.writeNamespace(attrLocal, attrValue);
-
- } else if (attrPrefix.length() > 0) {
-
- writer.writeAttribute(attrPrefix, attrURI, attrLocal,
- attrValue);
-
- } else {
- writer.writeAttribute(attrQName, attrValue);
- }
-
- }
-
- } catch (XMLStreamException e) {
- throw new SAXException(e);
-
- } finally {
-
- super.startElement(uri, localName, qName, attributes);
-
- }
-
- }
-
- public void endElement(String uri, String localName, String qName)
- throws SAXException {
-
- try {
-
- writer.writeEndElement();
-
- } catch (XMLStreamException e) {
-
- throw new SAXException(e);
-
- } finally {
-
- super.endElement(uri, localName, qName);
-
- }
-
- }
-
- public void comment(char[] ch, int start, int length) throws SAXException {
-
- super.comment(ch, start, length);
- try {
-
- writer.writeComment(new String(ch, start, length));
-
- } catch (XMLStreamException e) {
-
- throw new SAXException(e);
-
- }
-
- }
-
- public void characters(char[] ch, int start, int length)
- throws SAXException {
-
- super.characters(ch, start, length);
- try {
-
- if (!isCDATA) {
-
- writer.writeCharacters(ch, start, length);
-
- }
-
- } catch (XMLStreamException e) {
-
- throw new SAXException(e);
-
- }
-
- }
-
- public void endCDATA() throws SAXException {
-
- try {
-
- writer.writeCData(CDATABuffer.toString());
-
- } catch (XMLStreamException e) {
-
- throw new SAXException(e);
-
- }
-
- super.endCDATA();
-
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length)
- throws SAXException {
-
- super.ignorableWhitespace(ch, start, length);
- try {
-
- writer.writeCharacters(ch, start, length);
-
- } catch (XMLStreamException e) {
-
- throw new SAXException(e);
-
- }
-
- }
-
- public void processingInstruction(String target, String data)
- throws SAXException {
-
- super.processingInstruction(target, data);
- try {
-
- writer.writeProcessingInstruction(target, data);
-
- } catch (XMLStreamException e) {
-
- throw new SAXException(e);
-
- }
-
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/trax/SmartTransformerFactoryImpl.java b/src/com/sun/org/apache/xalan/internal/xsltc/trax/SmartTransformerFactoryImpl.java
deleted file mode 100644
index 4637dce..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/trax/SmartTransformerFactoryImpl.java
+++ /dev/null
@@ -1,455 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: SmartTransformerFactoryImpl.java,v 1.2.4.1 2005/09/14 09:57:13 pvedula Exp $
- */
-
-
-package com.sun.org.apache.xalan.internal.xsltc.trax;
-
-import javax.xml.XMLConstants;
-import javax.xml.transform.ErrorListener;
-import javax.xml.transform.Source;
-import javax.xml.transform.Templates;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.URIResolver;
-import javax.xml.transform.dom.DOMResult;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.sax.SAXResult;
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.transform.sax.SAXTransformerFactory;
-import javax.xml.transform.sax.TemplatesHandler;
-import javax.xml.transform.sax.TransformerHandler;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.stream.StreamSource;
-
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
-import org.xml.sax.XMLFilter;
-
-/**
- * Implementation of a transformer factory that uses an XSLTC
- * transformer factory for the creation of Templates objects
- * and uses the Xalan processor transformer factory for the
- * creation of Transformer objects.
- * @author G. Todd Miller
- */
-public class SmartTransformerFactoryImpl extends SAXTransformerFactory
-{
- /**
- * <p>Name of class as a constant to use for debugging.</p>
- */
- private static final String CLASS_NAME = "SmartTransformerFactoryImpl";
-
- private SAXTransformerFactory _xsltcFactory = null;
- private SAXTransformerFactory _xalanFactory = null;
- private SAXTransformerFactory _currFactory = null;
- private ErrorListener _errorlistener = null;
- private URIResolver _uriresolver = null;
-
- /**
- * <p>State of secure processing feature.</p>
- */
- private boolean featureSecureProcessing = false;
-
- /**
- * implementation of the SmartTransformerFactory. This factory
- * uses com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactory
- * to return Templates objects; and uses
- * com.sun.org.apache.xalan.internal.processor.TransformerFactory
- * to return Transformer objects.
- */
- public SmartTransformerFactoryImpl() { }
-
- private void createXSLTCTransformerFactory() {
- _xsltcFactory = new TransformerFactoryImpl();
- _currFactory = _xsltcFactory;
- }
-
- private void createXalanTransformerFactory() {
- final String xalanMessage =
- "com.sun.org.apache.xalan.internal.xsltc.trax.SmartTransformerFactoryImpl "+
- "could not create an "+
- "com.sun.org.apache.xalan.internal.processor.TransformerFactoryImpl.";
- // try to create instance of Xalan factory...
- try {
- Class xalanFactClass = ObjectFactory.findProviderClass(
- "com.sun.org.apache.xalan.internal.processor.TransformerFactoryImpl",
- true);
- _xalanFactory = (SAXTransformerFactory)
- xalanFactClass.newInstance();
- }
- catch (ClassNotFoundException e) {
- System.err.println(xalanMessage);
- }
- catch (InstantiationException e) {
- System.err.println(xalanMessage);
- }
- catch (IllegalAccessException e) {
- System.err.println(xalanMessage);
- }
- _currFactory = _xalanFactory;
- }
-
- public void setErrorListener(ErrorListener listener)
- throws IllegalArgumentException
- {
- _errorlistener = listener;
- }
-
- public ErrorListener getErrorListener() {
- return _errorlistener;
- }
-
- public Object getAttribute(String name)
- throws IllegalArgumentException
- {
- // GTM: NB: 'debug' should change to something more unique...
- if ((name.equals("translet-name")) || (name.equals("debug"))) {
- if (_xsltcFactory == null) {
- createXSLTCTransformerFactory();
- }
- return _xsltcFactory.getAttribute(name);
- }
- else {
- if (_xalanFactory == null) {
- createXalanTransformerFactory();
- }
- return _xalanFactory.getAttribute(name);
- }
- }
-
- public void setAttribute(String name, Object value)
- throws IllegalArgumentException {
- // GTM: NB: 'debug' should change to something more unique...
- if ((name.equals("translet-name")) || (name.equals("debug"))) {
- if (_xsltcFactory == null) {
- createXSLTCTransformerFactory();
- }
- _xsltcFactory.setAttribute(name, value);
- }
- else {
- if (_xalanFactory == null) {
- createXalanTransformerFactory();
- }
- _xalanFactory.setAttribute(name, value);
- }
- }
-
- /**
- * <p>Set a feature for this <code>SmartTransformerFactory</code> and <code>Transformer</code>s
- * or <code>Template</code>s created by this factory.</p>
- *
- * <p>
- * Feature names are fully qualified {@link java.net.URI}s.
- * Implementations may define their own features.
- * An {@link TransformerConfigurationException} is thrown if this <code>TransformerFactory</code> or the
- * <code>Transformer</code>s or <code>Template</code>s it creates cannot support the feature.
- * It is possible for an <code>TransformerFactory</code> to expose a feature value but be unable to change its state.
- * </p>
- *
- * <p>See {@link javax.xml.transform.TransformerFactory} for full documentation of specific features.</p>
- *
- * @param name Feature name.
- * @param value Is feature state <code>true</code> or <code>false</code>.
- *
- * @throws TransformerConfigurationException if this <code>TransformerFactory</code>
- * or the <code>Transformer</code>s or <code>Template</code>s it creates cannot support this feature.
- * @throws NullPointerException If the <code>name</code> parameter is null.
- */
- public void setFeature(String name, boolean value)
- throws TransformerConfigurationException {
-
- // feature name cannot be null
- if (name == null) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_SET_FEATURE_NULL_NAME);
- throw new NullPointerException(err.toString());
- }
- // secure processing?
- else if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
- featureSecureProcessing = value;
- // all done processing feature
- return;
- }
- else {
- // unknown feature
- ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNSUPPORTED_FEATURE, name);
- throw new TransformerConfigurationException(err.toString());
- }
- }
-
- /**
- * javax.xml.transform.sax.TransformerFactory implementation.
- * Look up the value of a feature (to see if it is supported).
- * This method must be updated as the various methods and features of this
- * class are implemented.
- *
- * @param name The feature name
- * @return 'true' if feature is supported, 'false' if not
- */
- public boolean getFeature(String name) {
- // All supported features should be listed here
- String[] features = {
- DOMSource.FEATURE,
- DOMResult.FEATURE,
- SAXSource.FEATURE,
- SAXResult.FEATURE,
- StreamSource.FEATURE,
- StreamResult.FEATURE
- };
-
- // feature name cannot be null
- if (name == null) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_GET_FEATURE_NULL_NAME);
- throw new NullPointerException(err.toString());
- }
-
- // Inefficient, but it really does not matter in a function like this
- for (int i = 0; i < features.length; i++) {
- if (name.equals(features[i]))
- return true;
- }
-
- // secure processing?
- if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
- return featureSecureProcessing;
- }
-
- // unknown feature
- return false;
- }
-
- public URIResolver getURIResolver() {
- return _uriresolver;
- }
-
- public void setURIResolver(URIResolver resolver) {
- _uriresolver = resolver;
- }
-
- public Source getAssociatedStylesheet(Source source, String media,
- String title, String charset)
- throws TransformerConfigurationException
- {
- if (_currFactory == null) {
- createXSLTCTransformerFactory();
- }
- return _currFactory.getAssociatedStylesheet(source, media,
- title, charset);
- }
-
- /**
- * Create a Transformer object that copies the input document to the
- * result. Uses the com.sun.org.apache.xalan.internal.processor.TransformerFactory.
- * @return A Transformer object.
- */
- public Transformer newTransformer()
- throws TransformerConfigurationException
- {
- if (_xalanFactory == null) {
- createXalanTransformerFactory();
- }
- if (_errorlistener != null) {
- _xalanFactory.setErrorListener(_errorlistener);
- }
- if (_uriresolver != null) {
- _xalanFactory.setURIResolver(_uriresolver);
- }
- _currFactory = _xalanFactory;
- return _currFactory.newTransformer();
- }
-
- /**
- * Create a Transformer object that from the input stylesheet
- * Uses the com.sun.org.apache.xalan.internal.processor.TransformerFactory.
- * @param source the stylesheet.
- * @return A Transformer object.
- */
- public Transformer newTransformer(Source source) throws
- TransformerConfigurationException
- {
- if (_xalanFactory == null) {
- createXalanTransformerFactory();
- }
- if (_errorlistener != null) {
- _xalanFactory.setErrorListener(_errorlistener);
- }
- if (_uriresolver != null) {
- _xalanFactory.setURIResolver(_uriresolver);
- }
- _currFactory = _xalanFactory;
- return _currFactory.newTransformer(source);
- }
-
- /**
- * Create a Templates object that from the input stylesheet
- * Uses the com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactory.
- * @param source the stylesheet.
- * @return A Templates object.
- */
- public Templates newTemplates(Source source)
- throws TransformerConfigurationException
- {
- if (_xsltcFactory == null) {
- createXSLTCTransformerFactory();
- }
- if (_errorlistener != null) {
- _xsltcFactory.setErrorListener(_errorlistener);
- }
- if (_uriresolver != null) {
- _xsltcFactory.setURIResolver(_uriresolver);
- }
- _currFactory = _xsltcFactory;
- return _currFactory.newTemplates(source);
- }
-
- /**
- * Get a TemplatesHandler object that can process SAX ContentHandler
- * events into a Templates object. Uses the
- * com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactory.
- */
- public TemplatesHandler newTemplatesHandler()
- throws TransformerConfigurationException
- {
- if (_xsltcFactory == null) {
- createXSLTCTransformerFactory();
- }
- if (_errorlistener != null) {
- _xsltcFactory.setErrorListener(_errorlistener);
- }
- if (_uriresolver != null) {
- _xsltcFactory.setURIResolver(_uriresolver);
- }
- return _xsltcFactory.newTemplatesHandler();
- }
-
- /**
- * Get a TransformerHandler object that can process SAX ContentHandler
- * events based on a copy transformer.
- * Uses com.sun.org.apache.xalan.internal.processor.TransformerFactory.
- */
- public TransformerHandler newTransformerHandler()
- throws TransformerConfigurationException
- {
- if (_xalanFactory == null) {
- createXalanTransformerFactory();
- }
- if (_errorlistener != null) {
- _xalanFactory.setErrorListener(_errorlistener);
- }
- if (_uriresolver != null) {
- _xalanFactory.setURIResolver(_uriresolver);
- }
- return _xalanFactory.newTransformerHandler();
- }
-
- /**
- * Get a TransformerHandler object that can process SAX ContentHandler
- * events based on a transformer specified by the stylesheet Source.
- * Uses com.sun.org.apache.xalan.internal.processor.TransformerFactory.
- */
- public TransformerHandler newTransformerHandler(Source src)
- throws TransformerConfigurationException
- {
- if (_xalanFactory == null) {
- createXalanTransformerFactory();
- }
- if (_errorlistener != null) {
- _xalanFactory.setErrorListener(_errorlistener);
- }
- if (_uriresolver != null) {
- _xalanFactory.setURIResolver(_uriresolver);
- }
- return _xalanFactory.newTransformerHandler(src);
- }
-
-
- /**
- * Get a TransformerHandler object that can process SAX ContentHandler
- * events based on a transformer specified by the stylesheet Source.
- * Uses com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactory.
- */
- public TransformerHandler newTransformerHandler(Templates templates)
- throws TransformerConfigurationException
- {
- if (_xsltcFactory == null) {
- createXSLTCTransformerFactory();
- }
- if (_errorlistener != null) {
- _xsltcFactory.setErrorListener(_errorlistener);
- }
- if (_uriresolver != null) {
- _xsltcFactory.setURIResolver(_uriresolver);
- }
- return _xsltcFactory.newTransformerHandler(templates);
- }
-
-
- /**
- * Create an XMLFilter that uses the given source as the
- * transformation instructions. Uses
- * com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactory.
- */
- public XMLFilter newXMLFilter(Source src)
- throws TransformerConfigurationException {
- if (_xsltcFactory == null) {
- createXSLTCTransformerFactory();
- }
- if (_errorlistener != null) {
- _xsltcFactory.setErrorListener(_errorlistener);
- }
- if (_uriresolver != null) {
- _xsltcFactory.setURIResolver(_uriresolver);
- }
- Templates templates = _xsltcFactory.newTemplates(src);
- if (templates == null ) return null;
- return newXMLFilter(templates);
- }
-
- /*
- * Create an XMLFilter that uses the given source as the
- * transformation instructions. Uses
- * com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactory.
- */
- public XMLFilter newXMLFilter(Templates templates)
- throws TransformerConfigurationException {
- try {
- return new com.sun.org.apache.xalan.internal.xsltc.trax.TrAXFilter(templates);
- }
- catch(TransformerConfigurationException e1) {
- if (_xsltcFactory == null) {
- createXSLTCTransformerFactory();
- }
- ErrorListener errorListener = _xsltcFactory.getErrorListener();
- if(errorListener != null) {
- try {
- errorListener.fatalError(e1);
- return null;
- }
- catch( TransformerException e2) {
- new TransformerConfigurationException(e2);
- }
- }
- throw e1;
- }
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/trax/StAXEvent2SAX.java b/src/com/sun/org/apache/xalan/internal/xsltc/trax/StAXEvent2SAX.java
deleted file mode 100644
index 62bb90f..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/trax/StAXEvent2SAX.java
+++ /dev/null
@@ -1,600 +0,0 @@
-/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.trax;
-
-import java.io.IOException;
-import java.util.Iterator;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.DTDHandler;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.ext.LexicalHandler;
-import org.xml.sax.helpers.AttributesImpl;
-import org.xml.sax.ext.Locator2;
-import com.sun.org.apache.xalan.internal.xsltc.dom.SAXImpl;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLEventReader;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.events.Attribute;
-import javax.xml.stream.events.Characters;
-import javax.xml.stream.events.EndElement;
-import javax.xml.stream.events.Namespace;
-import javax.xml.stream.events.ProcessingInstruction;
-import javax.xml.stream.events.StartElement;
-import javax.xml.stream.events.XMLEvent;
-import javax.xml.stream.events.StartDocument;
-
-
-/**
- * @author Suresh Kumar
- * @author Sunitha Reddy
- * @since 1.6
- */
-public class StAXEvent2SAX implements XMLReader, Locator {
-
- //private final static String EMPTYSTRING = "";
- //private static final String XMLNS_PREFIX = "xmlns";
-
- // StAX event source
- private final XMLEventReader staxEventReader;
-
- //private Node _dom = null;
- private ContentHandler _sax = null;
- private LexicalHandler _lex = null;
- private SAXImpl _saxImpl = null;
- private String version = null;
- private String encoding = null;
-
-
- public StAXEvent2SAX(XMLEventReader staxCore) {
- staxEventReader = staxCore;
- }
-
- public ContentHandler getContentHandler() {
- return _sax;
- }
-
- public void setContentHandler(ContentHandler handler) throws
- NullPointerException
- {
- _sax = handler;
- if (handler instanceof LexicalHandler) {
- _lex = (LexicalHandler) handler;
- }
-
- if (handler instanceof SAXImpl) {
- _saxImpl = (SAXImpl)handler;
- }
- }
-
-
- public void parse(InputSource unused) throws IOException, SAXException {
- try {
- bridge();
- } catch (XMLStreamException e) {
- throw new SAXException(e);
- }
- }
-
-
- //Main Work Starts Here.
- public void parse() throws IOException, SAXException, XMLStreamException {
- bridge();
- }
-
-
- /* public void parse() throws IOException, SAXException {
- if (_dom != null) {
- boolean isIncomplete =
- (_dom.getNodeType() != org.w3c.dom.Node.DOCUMENT_NODE);
-
- if (isIncomplete) {
- _sax.startDocument();
- parse(_dom);
- _sax.endDocument();
- }
- else {
- parse(_dom);
- }
- }
- }
- */
-
- /*
- * @see StAXReaderToContentHandler#bridge()
- */
- private void bridge() throws XMLStreamException {
-
- try {
- // remembers the nest level of elements to know when we are done.
- int depth=0;
- boolean startedAtDocument = false;
-
- XMLEvent event = staxEventReader.peek();
-
- if (!event.isStartDocument() && !event.isStartElement()) {
- throw new IllegalStateException();
- }
-
- if (event.getEventType() == XMLStreamConstants.START_DOCUMENT){
- startedAtDocument = true;
- version = ((StartDocument)event).getVersion();
- if (((StartDocument)event).encodingSet())
- encoding = ((StartDocument)event).getCharacterEncodingScheme();
- event=staxEventReader.nextEvent(); // that gets the one we peeked at
- event=staxEventReader.nextEvent(); // that really gets the next one
- }
-
- handleStartDocument(event);
-
- // Handle the prolog: http://www.w3.org/TR/REC-xml/#NT-prolog
- while (event.getEventType() != XMLStreamConstants.START_ELEMENT) {
- switch (event.getEventType()) {
- case XMLStreamConstants.CHARACTERS :
- handleCharacters(event.asCharacters());
- break;
- case XMLStreamConstants.PROCESSING_INSTRUCTION :
- handlePI((ProcessingInstruction)event);
- break;
- case XMLStreamConstants.COMMENT :
- handleComment();
- break;
- case XMLStreamConstants.DTD :
- handleDTD();
- break;
- case XMLStreamConstants.SPACE :
- handleSpace();
- break;
- default :
- throw new InternalError("processing prolog event: " + event);
- }
- event=staxEventReader.nextEvent();
- }
-
- // Process the (document) element
- do {
- // These are all of the events listed in the javadoc for
- // XMLEvent.
- // The spec only really describes 11 of them.
- switch (event.getEventType()) {
- case XMLStreamConstants.START_ELEMENT :
- depth++;
- handleStartElement(event.asStartElement());
- break;
- case XMLStreamConstants.END_ELEMENT :
- handleEndElement(event.asEndElement());
- depth--;
- break;
- case XMLStreamConstants.CHARACTERS :
- handleCharacters(event.asCharacters());
- break;
- case XMLStreamConstants.ENTITY_REFERENCE :
- handleEntityReference();
- break;
- case XMLStreamConstants.PROCESSING_INSTRUCTION :
- handlePI((ProcessingInstruction)event);
- break;
- case XMLStreamConstants.COMMENT :
- handleComment();
- break;
- case XMLStreamConstants.DTD :
- handleDTD();
- break;
- case XMLStreamConstants.ATTRIBUTE :
- handleAttribute();
- break;
- case XMLStreamConstants.NAMESPACE :
- handleNamespace();
- break;
- case XMLStreamConstants.CDATA :
- handleCDATA();
- break;
- case XMLStreamConstants.ENTITY_DECLARATION :
- handleEntityDecl();
- break;
- case XMLStreamConstants.NOTATION_DECLARATION :
- handleNotationDecl();
- break;
- case XMLStreamConstants.SPACE :
- handleSpace();
- break;
- default :
- throw new InternalError("processing event: " + event);
- }
-
- event=staxEventReader.nextEvent();
- } while (depth!=0);
-
- if (startedAtDocument) {
- // Handle the Misc (http://www.w3.org/TR/REC-xml/#NT-Misc) that can follow the document element
- while (event.getEventType() != XMLStreamConstants.END_DOCUMENT) {
- switch (event.getEventType()) {
- case XMLStreamConstants.CHARACTERS :
- handleCharacters(event.asCharacters());
- break;
- case XMLStreamConstants.PROCESSING_INSTRUCTION :
- handlePI((ProcessingInstruction)event);
- break;
- case XMLStreamConstants.COMMENT :
- handleComment();
- break;
- case XMLStreamConstants.SPACE :
- handleSpace();
- break;
- default :
- throw new InternalError("processing misc event after document element: " + event);
- }
- event=staxEventReader.nextEvent();
- }
- }
-
- handleEndDocument();
- } catch (SAXException e) {
- throw new XMLStreamException(e);
- }
- }
-
-
- private void handleEndDocument() throws SAXException {
- _sax.endDocument();
- }
-
- private void handleStartDocument(final XMLEvent event) throws SAXException {
- _sax.setDocumentLocator(new Locator2() {
- public int getColumnNumber() {
- return event.getLocation().getColumnNumber();
- }
- public int getLineNumber() {
- return event.getLocation().getLineNumber();
- }
- public String getPublicId() {
- return event.getLocation().getPublicId();
- }
- public String getSystemId() {
- return event.getLocation().getSystemId();
- }
- public String getXMLVersion(){
- return version;
- }
- public String getEncoding(){
- return encoding;
- }
-
- });
- _sax.startDocument();
- }
-
- private void handlePI(ProcessingInstruction event)
- throws XMLStreamException {
- try {
- _sax.processingInstruction(
- event.getTarget(),
- event.getData());
- } catch (SAXException e) {
- throw new XMLStreamException(e);
- }
- }
-
- private void handleCharacters(Characters event) throws XMLStreamException {
- try {
- _sax.characters(
- event.getData().toCharArray(),
- 0,
- event.getData().length());
- } catch (SAXException e) {
- throw new XMLStreamException(e);
- }
- }
-
- private void handleEndElement(EndElement event) throws XMLStreamException {
- QName qName = event.getName();
-
- //construct prefix:localName from qName
- String qname = "";
- if (qName.getPrefix() != null && qName.getPrefix().trim().length() != 0){
- qname = qName.getPrefix() + ":";
- }
- qname += qName.getLocalPart();
-
- try {
- // fire endElement
- _sax.endElement(
- qName.getNamespaceURI(),
- qName.getLocalPart(),
- qname);
-
- // end namespace bindings
- for( Iterator i = event.getNamespaces(); i.hasNext();) {
- String prefix = (String)i.next();
- if( prefix == null ) { // true for default namespace
- prefix = "";
- }
- _sax.endPrefixMapping(prefix);
- }
- } catch (SAXException e) {
- throw new XMLStreamException(e);
- }
- }
-
- private void handleStartElement(StartElement event)
- throws XMLStreamException {
- try {
- // start namespace bindings
- for (Iterator i = event.getNamespaces(); i.hasNext();) {
- String prefix = ((Namespace)i.next()).getPrefix();
- if (prefix == null) { // true for default namespace
- prefix = "";
- }
- _sax.startPrefixMapping(
- prefix,
- event.getNamespaceURI(prefix));
- }
-
- // fire startElement
- QName qName = event.getName();
- String prefix = qName.getPrefix();
- String rawname;
- if (prefix == null || prefix.length() == 0) {
- rawname = qName.getLocalPart();
- } else {
- rawname = prefix + ':' + qName.getLocalPart();
- }
-
- Attributes saxAttrs = getAttributes(event);
- _sax.startElement(
- qName.getNamespaceURI(),
- qName.getLocalPart(),
- rawname,
- saxAttrs);
- } catch (SAXException e) {
- throw new XMLStreamException(e);
- }
- }
-
- /**
- * Get the attributes associated with the given START_ELEMENT StAXevent.
- *
- * @return the StAX attributes converted to an org.xml.sax.Attributes
- */
- private Attributes getAttributes(StartElement event) {
- AttributesImpl attrs = new AttributesImpl();
-
- if ( !event.isStartElement() ) {
- throw new InternalError(
- "getAttributes() attempting to process: " + event);
- }
-
- // in SAX, namespace declarations are not part of attributes by default.
- // (there's a property to control that, but as far as we are concerned
- // we don't use it.) So don't add xmlns:* to attributes.
-
- // gather non-namespace attrs
- for (Iterator i = event.getAttributes(); i.hasNext();) {
- Attribute staxAttr = (javax.xml.stream.events.Attribute)i.next();
-
- String uri = staxAttr.getName().getNamespaceURI();
- if (uri == null) {
- uri = "";
- }
- String localName = staxAttr.getName().getLocalPart();
- String prefix = staxAttr.getName().getPrefix();
- String qName;
- if (prefix == null || prefix.length() == 0) {
- qName = localName;
- } else {
- qName = prefix + ':' + localName;
- }
- String type = staxAttr.getDTDType();
- String value = staxAttr.getValue();
-
- attrs.addAttribute(uri, localName, qName, type, value);
- }
-
- return attrs;
- }
-
- private void handleNamespace() {
- // no-op ???
- // namespace events don't normally occur outside of a startElement
- // or endElement
- }
-
- private void handleAttribute() {
- // no-op ???
- // attribute events don't normally occur outside of a startElement
- // or endElement
- }
-
- private void handleDTD() {
- // no-op ???
- // it seems like we need to pass this info along, but how?
- }
-
- private void handleComment() {
- // no-op ???
- }
-
- private void handleEntityReference() {
- // no-op ???
- }
-
- private void handleSpace() {
- // no-op ???
- // this event is listed in the javadoc, but not in the spec.
- }
-
- private void handleNotationDecl() {
- // no-op ???
- // this event is listed in the javadoc, but not in the spec.
- }
-
- private void handleEntityDecl() {
- // no-op ???
- // this event is listed in the javadoc, but not in the spec.
- }
-
- private void handleCDATA() {
- // no-op ???
- // this event is listed in the javadoc, but not in the spec.
- }
-
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public DTDHandler getDTDHandler() {
- return null;
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public ErrorHandler getErrorHandler() {
- return null;
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public boolean getFeature(String name) throws SAXNotRecognizedException,
- SAXNotSupportedException
- {
- return false;
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public void setFeature(String name, boolean value) throws
- SAXNotRecognizedException, SAXNotSupportedException
- {
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public void parse(String sysId) throws IOException, SAXException {
- throw new IOException("This method is not yet implemented.");
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public void setDTDHandler(DTDHandler handler) throws NullPointerException {
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public void setEntityResolver(EntityResolver resolver) throws
- NullPointerException
- {
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public EntityResolver getEntityResolver() {
- return null;
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public void setErrorHandler(ErrorHandler handler) throws
- NullPointerException
- {
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public void setProperty(String name, Object value) throws
- SAXNotRecognizedException, SAXNotSupportedException {
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public Object getProperty(String name) throws SAXNotRecognizedException,
- SAXNotSupportedException
- {
- return null;
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public int getColumnNumber() {
- return 0;
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public int getLineNumber() {
- return 0;
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public String getPublicId() {
- return null;
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public String getSystemId() {
- return null;
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/trax/StAXStream2SAX.java b/src/com/sun/org/apache/xalan/internal/xsltc/trax/StAXStream2SAX.java
deleted file mode 100644
index 318b4d9..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/trax/StAXStream2SAX.java
+++ /dev/null
@@ -1,533 +0,0 @@
-/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.trax;
-
-import com.sun.org.apache.xalan.internal.xsltc.dom.SAXImpl;
-import java.io.IOException;
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import org.xml.sax.Attributes;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.DTDHandler;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.ext.LexicalHandler;
-import org.xml.sax.ext.Locator2;
-import org.xml.sax.helpers.AttributesImpl;
-
-
-
-/**
- * @author Padmaja Vedula
- * @author Sunitha Reddy
- */
-public class StAXStream2SAX implements XMLReader, Locator {
-
- //private final static String EMPTYSTRING = "";
- //private static final String XMLNS_PREFIX = "xmlns";
-
- // StAX Stream source
- private final XMLStreamReader staxStreamReader;
-
- //private Node _dom = null;
- private ContentHandler _sax = null;
- private LexicalHandler _lex = null;
- private SAXImpl _saxImpl = null;
-
- public StAXStream2SAX(XMLStreamReader staxSrc) {
- staxStreamReader = staxSrc;
- }
-
- public ContentHandler getContentHandler() {
- return _sax;
- }
-
- public void setContentHandler(ContentHandler handler) throws
- NullPointerException
- {
- _sax = handler;
- if (handler instanceof LexicalHandler) {
- _lex = (LexicalHandler) handler;
- }
-
- if (handler instanceof SAXImpl) {
- _saxImpl = (SAXImpl)handler;
- }
- }
-
-
- public void parse(InputSource unused) throws IOException, SAXException {
- try {
- bridge();
- } catch (XMLStreamException e) {
- throw new SAXException(e);
- }
- }
-
-
- //Main Work Starts Here.
- public void parse() throws IOException, SAXException, XMLStreamException {
- bridge();
- }
-
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public void parse(String sysId) throws IOException, SAXException {
- throw new IOException("This method is not yet implemented.");
- }
-
-
- public void bridge() throws XMLStreamException {
-
- try {
- // remembers the nest level of elements to know when we are done.
- int depth=0;
-
- // skip over START_DOCUMENT
- int event = staxStreamReader.getEventType();
- if (event == XMLStreamConstants.START_DOCUMENT) {
- event = staxStreamReader.next();
- }
-
- // If not a START_ELEMENT (e.g., a DTD), skip to next tag
- if (event != XMLStreamConstants.START_ELEMENT) {
- event = staxStreamReader.nextTag();
- // An error if a START_ELEMENT isn't found now
- if (event != XMLStreamConstants.START_ELEMENT) {
- throw new IllegalStateException("The current event is " +
- "not START_ELEMENT\n but" + event);
- }
- }
-
- handleStartDocument();
-
- do {
- // These are all of the events listed in the javadoc for
- // XMLEvent.
- // The spec only really describes 11 of them.
- switch (event) {
- case XMLStreamConstants.START_ELEMENT :
- depth++;
- handleStartElement();
- break;
- case XMLStreamConstants.END_ELEMENT :
- handleEndElement();
- depth--;
- break;
- case XMLStreamConstants.CHARACTERS :
- handleCharacters();
- break;
- case XMLStreamConstants.ENTITY_REFERENCE :
- handleEntityReference();
- break;
- case XMLStreamConstants.PROCESSING_INSTRUCTION :
- handlePI();
- break;
- case XMLStreamConstants.COMMENT :
- handleComment();
- break;
- case XMLStreamConstants.DTD :
- handleDTD();
- break;
- case XMLStreamConstants.ATTRIBUTE :
- handleAttribute();
- break;
- case XMLStreamConstants.NAMESPACE :
- handleNamespace();
- break;
- case XMLStreamConstants.CDATA :
- handleCDATA();
- break;
- case XMLStreamConstants.ENTITY_DECLARATION :
- handleEntityDecl();
- break;
- case XMLStreamConstants.NOTATION_DECLARATION :
- handleNotationDecl();
- break;
- case XMLStreamConstants.SPACE :
- handleSpace();
- break;
- default :
- throw new InternalError("processing event: " + event);
- }
-
- event=staxStreamReader.next();
- } while (depth!=0);
-
- handleEndDocument();
- } catch (SAXException e) {
- throw new XMLStreamException(e);
- }
- }
-
- private void handleEndDocument() throws SAXException {
- _sax.endDocument();
- }
-
- private void handleStartDocument() throws SAXException {
- _sax.setDocumentLocator(new Locator2() {
- public int getColumnNumber() {
- return staxStreamReader.getLocation().getColumnNumber();
- }
- public int getLineNumber() {
- return staxStreamReader.getLocation().getLineNumber();
- }
- public String getPublicId() {
- return staxStreamReader.getLocation().getPublicId();
- }
- public String getSystemId() {
- return staxStreamReader.getLocation().getSystemId();
- }
- public String getXMLVersion() {
- return staxStreamReader.getVersion();
- }
- public String getEncoding() {
- return staxStreamReader.getEncoding();
- }
- });
- _sax.startDocument();
- }
-
- private void handlePI() throws XMLStreamException {
- try {
- _sax.processingInstruction(
- staxStreamReader.getPITarget(),
- staxStreamReader.getPIData());
- } catch (SAXException e) {
- throw new XMLStreamException(e);
- }
- }
-
- private void handleCharacters() throws XMLStreamException {
-
- // workaround for bugid 5046319 - switch over to commented section
- // below when it is fixed.
- int textLength = staxStreamReader.getTextLength();
- char[] chars = new char[textLength];
-
- staxStreamReader.getTextCharacters(0, chars, 0, textLength);
-
- try {
- _sax.characters(chars, 0, chars.length);
- } catch (SAXException e) {
- throw new XMLStreamException(e);
- }
-
-
-// int start = 0;
-// int len;
-// do {
-// len = staxStreamReader.getTextCharacters(start, buf, 0, buf.length);
-// start += len;
-// try {
-// _sax.characters(buf, 0, len);
-// } catch (SAXException e) {
-// throw new XMLStreamException(e);
-// }
-// } while (len == buf.length);
- }
-
- private void handleEndElement() throws XMLStreamException {
- QName qName = staxStreamReader.getName();
-
- try {
- //construct prefix:localName from qName
- String qname = "";
- if (qName.getPrefix() != null && qName.getPrefix().trim().length() != 0){
- qname = qName.getPrefix() + ":";
- }
- qname += qName.getLocalPart();
-
- // fire endElement
- _sax.endElement(
- qName.getNamespaceURI(),
- qName.getLocalPart(),
- qname);
-
- // end namespace bindings
- int nsCount = staxStreamReader.getNamespaceCount();
- for (int i = nsCount - 1; i >= 0; i--) {
- String prefix = staxStreamReader.getNamespacePrefix(i);
- if (prefix == null) { // true for default namespace
- prefix = "";
- }
- _sax.endPrefixMapping(prefix);
- }
- } catch (SAXException e) {
- throw new XMLStreamException(e);
- }
- }
-
- private void handleStartElement() throws XMLStreamException {
-
- try {
- // start namespace bindings
- int nsCount = staxStreamReader.getNamespaceCount();
- for (int i = 0; i < nsCount; i++) {
- String prefix = staxStreamReader.getNamespacePrefix(i);
- if (prefix == null) { // true for default namespace
- prefix = "";
- }
- _sax.startPrefixMapping(
- prefix,
- staxStreamReader.getNamespaceURI(i));
- }
-
- // fire startElement
- QName qName = staxStreamReader.getName();
- String prefix = qName.getPrefix();
- String rawname;
- if(prefix==null || prefix.length()==0)
- rawname = qName.getLocalPart();
- else
- rawname = prefix + ':' + qName.getLocalPart();
- Attributes attrs = getAttributes();
- _sax.startElement(
- qName.getNamespaceURI(),
- qName.getLocalPart(),
- rawname,
- attrs);
- } catch (SAXException e) {
- throw new XMLStreamException(e);
- }
- }
-
- /**
- * Get the attributes associated with the given START_ELEMENT or ATTRIBUTE
- * StAXevent.
- *
- * @return the StAX attributes converted to an org.xml.sax.Attributes
- */
- private Attributes getAttributes() {
- AttributesImpl attrs = new AttributesImpl();
-
- int eventType = staxStreamReader.getEventType();
- if (eventType != XMLStreamConstants.ATTRIBUTE
- && eventType != XMLStreamConstants.START_ELEMENT) {
- throw new InternalError(
- "getAttributes() attempting to process: " + eventType);
- }
-
- // in SAX, namespace declarations are not part of attributes by default.
- // (there's a property to control that, but as far as we are concerned
- // we don't use it.) So don't add xmlns:* to attributes.
-
- // gather non-namespace attrs
- for (int i = 0; i < staxStreamReader.getAttributeCount(); i++) {
- String uri = staxStreamReader.getAttributeNamespace(i);
- if(uri==null) uri="";
- String localName = staxStreamReader.getAttributeLocalName(i);
- String prefix = staxStreamReader.getAttributePrefix(i);
- String qName;
- if(prefix==null || prefix.length()==0)
- qName = localName;
- else
- qName = prefix + ':' + localName;
- String type = staxStreamReader.getAttributeType(i);
- String value = staxStreamReader.getAttributeValue(i);
-
- attrs.addAttribute(uri, localName, qName, type, value);
- }
-
- return attrs;
- }
-
- private void handleNamespace() {
- // no-op ???
- // namespace events don't normally occur outside of a startElement
- // or endElement
- }
-
- private void handleAttribute() {
- // no-op ???
- // attribute events don't normally occur outside of a startElement
- // or endElement
- }
-
- private void handleDTD() {
- // no-op ???
- // it seems like we need to pass this info along, but how?
- }
-
- private void handleComment() {
- // no-op ???
- }
-
- private void handleEntityReference() {
- // no-op ???
- }
-
- private void handleSpace() {
- // no-op ???
- // this event is listed in the javadoc, but not in the spec.
- }
-
- private void handleNotationDecl() {
- // no-op ???
- // this event is listed in the javadoc, but not in the spec.
- }
-
- private void handleEntityDecl() {
- // no-op ???
- // this event is listed in the javadoc, but not in the spec.
- }
-
- private void handleCDATA() {
- // no-op ???
- // this event is listed in the javadoc, but not in the spec.
- }
-
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public DTDHandler getDTDHandler() {
- return null;
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public ErrorHandler getErrorHandler() {
- return null;
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public boolean getFeature(String name) throws SAXNotRecognizedException,
- SAXNotSupportedException
- {
- return false;
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public void setFeature(String name, boolean value) throws
- SAXNotRecognizedException, SAXNotSupportedException
- {
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public void setDTDHandler(DTDHandler handler) throws NullPointerException {
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public void setEntityResolver(EntityResolver resolver) throws
- NullPointerException
- {
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public EntityResolver getEntityResolver() {
- return null;
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public void setErrorHandler(ErrorHandler handler) throws
- NullPointerException
- {
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public void setProperty(String name, Object value) throws
- SAXNotRecognizedException, SAXNotSupportedException {
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public Object getProperty(String name) throws SAXNotRecognizedException,
- SAXNotSupportedException
- {
- return null;
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public int getColumnNumber() {
- return 0;
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public int getLineNumber() {
- return 0;
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public String getPublicId() {
- return null;
- }
-
- /**
- * This class is only used internally so this method should never
- * be called.
- */
- public String getSystemId() {
- return null;
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesHandlerImpl.java b/src/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesHandlerImpl.java
deleted file mode 100644
index bce2c3a..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesHandlerImpl.java
+++ /dev/null
@@ -1,347 +0,0 @@
-/*
- * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.trax;
-
-import com.sun.org.apache.xalan.internal.XalanConstants;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.CompilerException;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.Parser;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.SourceLoader;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.Stylesheet;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.SyntaxTreeNode;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import java.util.ArrayList;
-import javax.xml.XMLConstants;
-import javax.xml.transform.Source;
-import javax.xml.transform.Templates;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.URIResolver;
-import javax.xml.transform.sax.TemplatesHandler;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-import org.xml.sax.Attributes;
-
-/**
- * Implementation of a JAXP1.1 TemplatesHandler
- * @author Morten Jorgensen
- * @author Santiago Pericas-Geertsen
- */
-public class TemplatesHandlerImpl
- implements ContentHandler, TemplatesHandler, SourceLoader
-{
- /**
- * System ID for this stylesheet.
- */
- private String _systemId;
-
- /**
- * Number of spaces to add for output indentation.
- */
- private int _indentNumber;
-
- /**
- * This URIResolver is passed to all Transformers.
- */
- private URIResolver _uriResolver = null;
-
- /**
- * A reference to the transformer factory that this templates
- * object belongs to.
- */
- private TransformerFactoryImpl _tfactory = null;
-
- /**
- * A reference to XSLTC's parser object.
- */
- private Parser _parser = null;
-
- /**
- * The created Templates object.
- */
- private TemplatesImpl _templates = null;
-
- /**
- * Default constructor
- */
- protected TemplatesHandlerImpl(int indentNumber,
- TransformerFactoryImpl tfactory)
- {
- _indentNumber = indentNumber;
- _tfactory = tfactory;
-
- // Instantiate XSLTC and get reference to parser object
- XSLTC xsltc = new XSLTC(tfactory.useServicesMechnism(), tfactory.getFeatureManager());
- if (tfactory.getFeature(XMLConstants.FEATURE_SECURE_PROCESSING))
- xsltc.setSecureProcessing(true);
-
- xsltc.setProperty(XMLConstants.ACCESS_EXTERNAL_STYLESHEET,
- (String)tfactory.getAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET));
- xsltc.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD,
- (String)tfactory.getAttribute(XMLConstants.ACCESS_EXTERNAL_DTD));
- xsltc.setProperty(XalanConstants.SECURITY_MANAGER,
- tfactory.getAttribute(XalanConstants.SECURITY_MANAGER));
-
-
- if ("true".equals(tfactory.getAttribute(TransformerFactoryImpl.ENABLE_INLINING)))
- xsltc.setTemplateInlining(true);
- else
- xsltc.setTemplateInlining(false);
-
- _parser = xsltc.getParser();
- }
-
- /**
- * Implements javax.xml.transform.sax.TemplatesHandler.getSystemId()
- * Get the base ID (URI or system ID) from where relative URLs will be
- * resolved.
- * @return The systemID that was set with setSystemId(String id)
- */
- public String getSystemId() {
- return _systemId;
- }
-
- /**
- * Implements javax.xml.transform.sax.TemplatesHandler.setSystemId()
- * Get the base ID (URI or system ID) from where relative URLs will be
- * resolved.
- * @param id Base URI for this stylesheet
- */
- public void setSystemId(String id) {
- _systemId = id;
- }
-
- /**
- * Store URIResolver needed for Transformers.
- */
- public void setURIResolver(URIResolver resolver) {
- _uriResolver = resolver;
- }
-
- /**
- * Implements javax.xml.transform.sax.TemplatesHandler.getTemplates()
- * When a TemplatesHandler object is used as a ContentHandler or
- * DocumentHandler for the parsing of transformation instructions, it
- * creates a Templates object, which the caller can get once the SAX
- * events have been completed.
- * @return The Templates object that was created during the SAX event
- * process, or null if no Templates object has been created.
- */
- public Templates getTemplates() {
- return _templates;
- }
-
- /**
- * This method implements XSLTC's SourceLoader interface. It is used to
- * glue a TrAX URIResolver to the XSLTC compiler's Input and Import classes.
- *
- * @param href The URI of the document to load
- * @param context The URI of the currently loaded document
- * @param xsltc The compiler that resuests the document
- * @return An InputSource with the loaded document
- */
- public InputSource loadSource(String href, String context, XSLTC xsltc) {
- try {
- // A _uriResolver must be set if this method is called
- final Source source = _uriResolver.resolve(href, context);
- if (source != null) {
- return Util.getInputSource(xsltc, source);
- }
- }
- catch (TransformerException e) {
- // Falls through
- }
- return null;
- }
-
- // -- ContentHandler --------------------------------------------------
-
- /**
- * Re-initialize parser and forward SAX2 event.
- */
- public void startDocument() {
- XSLTC xsltc = _parser.getXSLTC();
- xsltc.init(); // calls _parser.init()
- xsltc.setOutputType(XSLTC.BYTEARRAY_OUTPUT);
- _parser.startDocument();
- }
-
- /**
- * Just forward SAX2 event to parser object.
- */
- public void endDocument() throws SAXException {
- _parser.endDocument();
-
- // create the templates
- try {
- XSLTC xsltc = _parser.getXSLTC();
-
- // Set the translet class name if not already set
- String transletName;
- if (_systemId != null) {
- transletName = Util.baseName(_systemId);
- }
- else {
- transletName = (String)_tfactory.getAttribute("translet-name");
- }
- xsltc.setClassName(transletName);
-
- // Get java-legal class name from XSLTC module
- transletName = xsltc.getClassName();
-
- Stylesheet stylesheet = null;
- SyntaxTreeNode root = _parser.getDocumentRoot();
-
- // Compile the translet - this is where the work is done!
- if (!_parser.errorsFound() && root != null) {
- // Create a Stylesheet element from the root node
- stylesheet = _parser.makeStylesheet(root);
- stylesheet.setSystemId(_systemId);
- stylesheet.setParentStylesheet(null);
-
- if (xsltc.getTemplateInlining())
- stylesheet.setTemplateInlining(true);
- else
- stylesheet.setTemplateInlining(false);
-
- // Set a document loader (for xsl:include/import) if defined
- if (_uriResolver != null) {
- stylesheet.setSourceLoader(this);
- }
-
- _parser.setCurrentStylesheet(stylesheet);
-
- // Set it as top-level in the XSLTC object
- xsltc.setStylesheet(stylesheet);
-
- // Create AST under the Stylesheet element
- _parser.createAST(stylesheet);
- }
-
- // Generate the bytecodes and output the translet class(es)
- if (!_parser.errorsFound() && stylesheet != null) {
- stylesheet.setMultiDocument(xsltc.isMultiDocument());
- stylesheet.setHasIdCall(xsltc.hasIdCall());
-
- // Class synchronization is needed for BCEL
- synchronized (xsltc.getClass()) {
- stylesheet.translate();
- }
- }
-
- if (!_parser.errorsFound()) {
- // Check that the transformation went well before returning
- final byte[][] bytecodes = xsltc.getBytecodes();
- if (bytecodes != null) {
- _templates =
- new TemplatesImpl(xsltc.getBytecodes(), transletName,
- _parser.getOutputProperties(), _indentNumber, _tfactory);
-
- // Set URIResolver on templates object
- if (_uriResolver != null) {
- _templates.setURIResolver(_uriResolver);
- }
- }
- }
- else {
- StringBuilder errorMessage = new StringBuilder();
- ArrayList<ErrorMsg> errors = _parser.getErrors();
- final int count = errors.size();
- for (int i = 0; i < count; i++) {
- if (errorMessage.length() > 0)
- errorMessage.append('\n');
- errorMessage.append(errors.get(i).toString());
- }
- throw new SAXException(ErrorMsg.JAXP_COMPILE_ERR, new TransformerException(errorMessage.toString()));
- }
- }
- catch (CompilerException e) {
- throw new SAXException(ErrorMsg.JAXP_COMPILE_ERR, e);
- }
- }
-
- /**
- * Just forward SAX2 event to parser object.
- */
- public void startPrefixMapping(String prefix, String uri) {
- _parser.startPrefixMapping(prefix, uri);
- }
-
- /**
- * Just forward SAX2 event to parser object.
- */
- public void endPrefixMapping(String prefix) {
- _parser.endPrefixMapping(prefix);
- }
-
- /**
- * Just forward SAX2 event to parser object.
- */
- public void startElement(String uri, String localname, String qname,
- Attributes attributes) throws SAXException
- {
- _parser.startElement(uri, localname, qname, attributes);
- }
-
- /**
- * Just forward SAX2 event to parser object.
- */
- public void endElement(String uri, String localname, String qname) {
- _parser.endElement(uri, localname, qname);
- }
-
- /**
- * Just forward SAX2 event to parser object.
- */
- public void characters(char[] ch, int start, int length) {
- _parser.characters(ch, start, length);
- }
-
- /**
- * Just forward SAX2 event to parser object.
- */
- public void processingInstruction(String name, String value) {
- _parser.processingInstruction(name, value);
- }
-
- /**
- * Just forward SAX2 event to parser object.
- */
- public void ignorableWhitespace(char[] ch, int start, int length) {
- _parser.ignorableWhitespace(ch, start, length);
- }
-
- /**
- * Just forward SAX2 event to parser object.
- */
- public void skippedEntity(String name) {
- _parser.skippedEntity(name);
- }
-
- /**
- * Set internal system Id and forward SAX2 event to parser object.
- */
- public void setDocumentLocator(Locator locator) {
- setSystemId(locator.getSystemId());
- _parser.setDocumentLocator(locator);
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesImpl.java b/src/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesImpl.java
deleted file mode 100644
index e0ee6fb..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesImpl.java
+++ /dev/null
@@ -1,527 +0,0 @@
-/*
- * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: TemplatesImpl.java,v 1.8 2007/03/26 20:12:27 spericas Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.trax;
-
-import com.sun.org.apache.xalan.internal.XalanConstants;
-import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
-import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
-import com.sun.org.apache.xalan.internal.xsltc.DOM;
-import com.sun.org.apache.xalan.internal.xsltc.Translet;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet;
-import java.io.IOException;
-import java.io.NotSerializableException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.ObjectStreamField;
-import java.io.Serializable;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-import javax.xml.XMLConstants;
-import javax.xml.transform.Templates;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.URIResolver;
-
-/**
- * @author Morten Jorgensen
- * @author G. Todd Millerj
- * @author Jochen Cordes <Jochen.Cordes@t-online.de>
- * @author Santiago Pericas-Geertsen
- */
-public final class TemplatesImpl implements Templates, Serializable {
- static final long serialVersionUID = 673094361519270707L;
- public final static String DESERIALIZE_TRANSLET = "jdk.xml.enableTemplatesImplDeserialization";
-
- /**
- * Name of the superclass of all translets. This is needed to
- * determine which, among all classes comprising a translet,
- * is the main one.
- */
- private static String ABSTRACT_TRANSLET
- = "com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet";
-
- /**
- * Name of the main class or default name if unknown.
- */
- private String _name = null;
-
- /**
- * Contains the actual class definition for the translet class and
- * any auxiliary classes.
- */
- private byte[][] _bytecodes = null;
-
- /**
- * Contains the translet class definition(s). These are created when
- * this Templates is created or when it is read back from disk.
- */
- private Class[] _class = null;
-
- /**
- * The index of the main translet class in the arrays _class[] and
- * _bytecodes.
- */
- private int _transletIndex = -1;
-
- /**
- * Contains the list of auxiliary class definitions.
- */
- private transient Map<String, Class<?>> _auxClasses = null;
-
- /**
- * Output properties of this translet.
- */
- private Properties _outputProperties;
-
- /**
- * Number of spaces to add for output indentation.
- */
- private int _indentNumber;
-
- /**
- * This URIResolver is passed to all Transformers.
- * Declaring it transient to fix bug 22438
- */
- private transient URIResolver _uriResolver = null;
-
- /**
- * Cache the DTM for the stylesheet in a thread local variable,
- * which is used by the document('') function.
- * Use ThreadLocal because a DTM cannot be shared between
- * multiple threads.
- * Declaring it transient to fix bug 22438
- */
- private transient ThreadLocal _sdom = new ThreadLocal();
-
- /**
- * A reference to the transformer factory that this templates
- * object belongs to.
- */
- private transient TransformerFactoryImpl _tfactory = null;
-
- /**
- * A flag to determine whether the Service Mechanism is used
- */
- private transient boolean _useServicesMechanism;
-
- /**
- * protocols allowed for external references set by the stylesheet processing instruction, Import and Include element.
- */
- private transient String _accessExternalStylesheet = XalanConstants.EXTERNAL_ACCESS_DEFAULT;
-
- /**
- * @serialField _name String The Name of the main class
- * @serialField _bytecodes byte[][] Class definition
- * @serialField _class Class[] The translet class definition(s).
- * @serialField _transletIndex int The index of the main translet class
- * @serialField _outputProperties Properties Output properties of this translet.
- * @serialField _indentNumber int Number of spaces to add for output indentation.
- */
- private static final ObjectStreamField[] serialPersistentFields =
- new ObjectStreamField[] {
- new ObjectStreamField("_name", String.class),
- new ObjectStreamField("_bytecodes", byte[][].class),
- new ObjectStreamField("_class", Class[].class),
- new ObjectStreamField("_transletIndex", int.class),
- new ObjectStreamField("_outputProperties", Properties.class),
- new ObjectStreamField("_indentNumber", int.class),
- };
-
- static final class TransletClassLoader extends ClassLoader {
- private final Map<String,Class> _loadedExternalExtensionFunctions;
-
- TransletClassLoader(ClassLoader parent) {
- super(parent);
- _loadedExternalExtensionFunctions = null;
- }
-
- TransletClassLoader(ClassLoader parent,Map<String, Class> mapEF) {
- super(parent);
- _loadedExternalExtensionFunctions = mapEF;
- }
-
- public Class<?> loadClass(String name) throws ClassNotFoundException {
- Class<?> ret = null;
- // The _loadedExternalExtensionFunctions will be empty when the
- // SecurityManager is not set and the FSP is turned off
- if (_loadedExternalExtensionFunctions != null) {
- ret = _loadedExternalExtensionFunctions.get(name);
- }
- if (ret == null) {
- ret = super.loadClass(name);
- }
- return ret;
- }
-
- /**
- * Access to final protected superclass member from outer class.
- */
- Class defineClass(final byte[] b) {
- return defineClass(null, b, 0, b.length);
- }
- }
-
-
- /**
- * Create an XSLTC template object from the bytecodes.
- * The bytecodes for the translet and auxiliary classes, plus the name of
- * the main translet class, must be supplied.
- */
- protected TemplatesImpl(byte[][] bytecodes, String transletName,
- Properties outputProperties, int indentNumber,
- TransformerFactoryImpl tfactory)
- {
- _bytecodes = bytecodes;
- init(transletName, outputProperties, indentNumber, tfactory);
- }
-
- /**
- * Create an XSLTC template object from the translet class definition(s).
- */
- protected TemplatesImpl(Class[] transletClasses, String transletName,
- Properties outputProperties, int indentNumber,
- TransformerFactoryImpl tfactory)
- {
- _class = transletClasses;
- _transletIndex = 0;
- init(transletName, outputProperties, indentNumber, tfactory);
- }
-
- private void init(String transletName,
- Properties outputProperties, int indentNumber,
- TransformerFactoryImpl tfactory) {
- _name = transletName;
- _outputProperties = outputProperties;
- _indentNumber = indentNumber;
- _tfactory = tfactory;
- _useServicesMechanism = tfactory.useServicesMechnism();
- _accessExternalStylesheet = (String) tfactory.getAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET);
- }
- /**
- * Need for de-serialization, see readObject().
- */
- public TemplatesImpl() { }
-
- /**
- * Overrides the default readObject implementation since we decided
- * it would be cleaner not to serialize the entire tranformer
- * factory. [ ref bugzilla 12317 ]
- * We need to check if the user defined class for URIResolver also
- * implemented Serializable
- * if yes then we need to deserialize the URIResolver
- * Fix for bugzilla bug 22438
- */
- @SuppressWarnings("unchecked")
- private void readObject(ObjectInputStream is)
- throws IOException, ClassNotFoundException
- {
- SecurityManager security = System.getSecurityManager();
- if (security != null){
- String temp = SecuritySupport.getSystemProperty(DESERIALIZE_TRANSLET);
- if (temp == null || !(temp.length()==0 || temp.equalsIgnoreCase("true"))) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.DESERIALIZE_TRANSLET_ERR);
- throw new UnsupportedOperationException(err.toString());
- }
- }
-
- // We have to read serialized fields first.
- ObjectInputStream.GetField gf = is.readFields();
- _name = (String)gf.get("_name", null);
- _bytecodes = (byte[][])gf.get("_bytecodes", null);
- _class = (Class[])gf.get("_class", null);
- _transletIndex = gf.get("_transletIndex", -1);
-
- _outputProperties = (Properties)gf.get("_outputProperties", null);
- _indentNumber = gf.get("_indentNumber", 0);
-
- if (is.readBoolean()) {
- _uriResolver = (URIResolver) is.readObject();
- }
-
- _tfactory = new TransformerFactoryImpl();
- }
-
-
- /**
- * This is to fix bugzilla bug 22438
- * If the user defined class implements URIResolver and Serializable
- * then we want it to get serialized
- */
- private void writeObject(ObjectOutputStream os)
- throws IOException, ClassNotFoundException {
- if (_auxClasses != null) {
- //throw with the same message as when Hashtable was used for compatibility.
- throw new NotSerializableException(
- "com.sun.org.apache.xalan.internal.xsltc.runtime.Hashtable");
- }
-
- // Write serialized fields
- ObjectOutputStream.PutField pf = os.putFields();
- pf.put("_name", _name);
- pf.put("_bytecodes", _bytecodes);
- pf.put("_class", _class);
- pf.put("_transletIndex", _transletIndex);
- pf.put("_outputProperties", _outputProperties);
- pf.put("_indentNumber", _indentNumber);
- os.writeFields();
-
- if (_uriResolver instanceof Serializable) {
- os.writeBoolean(true);
- os.writeObject((Serializable) _uriResolver);
- }
- else {
- os.writeBoolean(false);
- }
- }
-
- /**
- * Return the state of the services mechanism feature.
- */
- public boolean useServicesMechnism() {
- return _useServicesMechanism;
- }
-
- /**
- * Store URIResolver needed for Transformers.
- */
- public synchronized void setURIResolver(URIResolver resolver) {
- _uriResolver = resolver;
- }
-
- /**
- * The TransformerFactory must pass us the translet bytecodes using this
- * method before we can create any translet instances
- *
- * Note: This method is private for security reasons. See
- * CR 6537898. When merging with Apache, we must ensure
- * that the privateness of this method is maintained (that
- * is why it wasn't removed).
- */
- private synchronized void setTransletBytecodes(byte[][] bytecodes) {
- _bytecodes = bytecodes;
- }
-
- /**
- * Returns the translet bytecodes stored in this template
- *
- * Note: This method is private for security reasons. See
- * CR 6537898. When merging with Apache, we must ensure
- * that the privateness of this method is maintained (that
- * is why it wasn't removed).
- */
- private synchronized byte[][] getTransletBytecodes() {
- return _bytecodes;
- }
-
- /**
- * Returns the translet bytecodes stored in this template
- *
- * Note: This method is private for security reasons. See
- * CR 6537898. When merging with Apache, we must ensure
- * that the privateness of this method is maintained (that
- * is why it wasn't removed).
- */
- private synchronized Class[] getTransletClasses() {
- try {
- if (_class == null) defineTransletClasses();
- }
- catch (TransformerConfigurationException e) {
- // Falls through
- }
- return _class;
- }
-
- /**
- * Returns the index of the main class in array of bytecodes
- */
- public synchronized int getTransletIndex() {
- try {
- if (_class == null) defineTransletClasses();
- }
- catch (TransformerConfigurationException e) {
- // Falls through
- }
- return _transletIndex;
- }
-
- /**
- * The TransformerFactory should call this method to set the translet name
- */
- protected synchronized void setTransletName(String name) {
- _name = name;
- }
-
- /**
- * Returns the name of the main translet class stored in this template
- */
- protected synchronized String getTransletName() {
- return _name;
- }
-
- /**
- * Defines the translet class and auxiliary classes.
- * Returns a reference to the Class object that defines the main class
- */
- private void defineTransletClasses()
- throws TransformerConfigurationException {
-
- if (_bytecodes == null) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.NO_TRANSLET_CLASS_ERR);
- throw new TransformerConfigurationException(err.toString());
- }
-
- TransletClassLoader loader = (TransletClassLoader)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return new TransletClassLoader(ObjectFactory.findClassLoader(),_tfactory.getExternalExtensionsMap());
- }
- });
-
- try {
- final int classCount = _bytecodes.length;
- _class = new Class[classCount];
-
- if (classCount > 1) {
- _auxClasses = new HashMap<>();
- }
-
- for (int i = 0; i < classCount; i++) {
- _class[i] = loader.defineClass(_bytecodes[i]);
- final Class superClass = _class[i].getSuperclass();
-
- // Check if this is the main class
- if (superClass.getName().equals(ABSTRACT_TRANSLET)) {
- _transletIndex = i;
- }
- else {
- _auxClasses.put(_class[i].getName(), _class[i]);
- }
- }
-
- if (_transletIndex < 0) {
- ErrorMsg err= new ErrorMsg(ErrorMsg.NO_MAIN_TRANSLET_ERR, _name);
- throw new TransformerConfigurationException(err.toString());
- }
- }
- catch (ClassFormatError e) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_CLASS_ERR, _name);
- throw new TransformerConfigurationException(err.toString());
- }
- catch (LinkageError e) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name);
- throw new TransformerConfigurationException(err.toString());
- }
- }
-
- /**
- * This method generates an instance of the translet class that is
- * wrapped inside this Template. The translet instance will later
- * be wrapped inside a Transformer object.
- */
- private Translet getTransletInstance()
- throws TransformerConfigurationException {
- try {
- if (_name == null) return null;
-
- if (_class == null) defineTransletClasses();
-
- // The translet needs to keep a reference to all its auxiliary
- // class to prevent the GC from collecting them
- AbstractTranslet translet = (AbstractTranslet) _class[_transletIndex].newInstance();
- translet.postInitialization();
- translet.setTemplates(this);
- translet.setServicesMechnism(_useServicesMechanism);
- translet.setAllowedProtocols(_accessExternalStylesheet);
- if (_auxClasses != null) {
- translet.setAuxiliaryClasses(_auxClasses);
- }
-
- return translet;
- }
- catch (InstantiationException e) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name);
- throw new TransformerConfigurationException(err.toString());
- }
- catch (IllegalAccessException e) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name);
- throw new TransformerConfigurationException(err.toString());
- }
- }
-
- /**
- * Implements JAXP's Templates.newTransformer()
- *
- * @throws TransformerConfigurationException
- */
- public synchronized Transformer newTransformer()
- throws TransformerConfigurationException
- {
- TransformerImpl transformer;
-
- transformer = new TransformerImpl(getTransletInstance(), _outputProperties,
- _indentNumber, _tfactory);
-
- if (_uriResolver != null) {
- transformer.setURIResolver(_uriResolver);
- }
-
- if (_tfactory.getFeature(XMLConstants.FEATURE_SECURE_PROCESSING)) {
- transformer.setSecureProcessing(true);
- }
- return transformer;
- }
-
- /**
- * Implements JAXP's Templates.getOutputProperties(). We need to
- * instanciate a translet to get the output settings, so
- * we might as well just instanciate a Transformer and use its
- * implementation of this method.
- */
- public synchronized Properties getOutputProperties() {
- try {
- return newTransformer().getOutputProperties();
- }
- catch (TransformerConfigurationException e) {
- return null;
- }
- }
-
- /**
- * Return the thread local copy of the stylesheet DOM.
- */
- public DOM getStylesheetDOM() {
- return (DOM)_sdom.get();
- }
-
- /**
- * Set the thread local copy of the stylesheet DOM.
- */
- public void setStylesheetDOM(DOM sdom) {
- _sdom.set(sdom);
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/trax/TrAXFilter.java b/src/com/sun/org/apache/xalan/internal/xsltc/trax/TrAXFilter.java
deleted file mode 100644
index 172907e..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/trax/TrAXFilter.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: TrAXFilter.java,v 1.2.4.1 2005/09/06 12:23:19 pvedula Exp $
- */
-
-
-package com.sun.org.apache.xalan.internal.xsltc.trax;
-
-import java.io.IOException;
-
-import javax.xml.XMLConstants;
-import javax.xml.parsers.FactoryConfigurationError;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-import javax.xml.transform.ErrorListener;
-import javax.xml.transform.Templates;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.sax.SAXResult;
-
-import com.sun.org.apache.xml.internal.utils.XMLReaderManager;
-
-import org.xml.sax.ContentHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.helpers.XMLFilterImpl;
-import org.xml.sax.helpers.XMLReaderFactory;
-
-/**
- * skeleton extension of XMLFilterImpl for now.
- * @author Santiago Pericas-Geertsen
- * @author G. Todd Miller
- */
-public class TrAXFilter extends XMLFilterImpl {
- private Templates _templates;
- private TransformerImpl _transformer;
- private TransformerHandlerImpl _transformerHandler;
- private boolean _useServicesMechanism = true;
-
- public TrAXFilter(Templates templates) throws
- TransformerConfigurationException
- {
- _templates = templates;
- _transformer = (TransformerImpl) templates.newTransformer();
- _transformerHandler = new TransformerHandlerImpl(_transformer);
- _useServicesMechanism = _transformer.useServicesMechnism();
- }
-
- public Transformer getTransformer() {
- return _transformer;
- }
-
- private void createParent() throws SAXException {
- XMLReader parent = null;
- try {
- SAXParserFactory pfactory = SAXParserFactory.newInstance();
- pfactory.setNamespaceAware(true);
-
- if (_transformer.isSecureProcessing()) {
- try {
- pfactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
- }
- catch (SAXException e) {}
- }
-
- SAXParser saxparser = pfactory.newSAXParser();
- parent = saxparser.getXMLReader();
- }
- catch (ParserConfigurationException e) {
- throw new SAXException(e);
- }
- catch (FactoryConfigurationError e) {
- throw new SAXException(e.toString());
- }
-
- if (parent == null) {
- parent = XMLReaderFactory.createXMLReader();
- }
-
- // make this XMLReader the parent of this filter
- setParent(parent);
- }
-
- public void parse (InputSource input) throws SAXException, IOException
- {
- XMLReader managedReader = null;
-
- try {
- if (getParent() == null) {
- try {
- managedReader = XMLReaderManager.getInstance(_useServicesMechanism)
- .getXMLReader();
- setParent(managedReader);
- } catch (SAXException e) {
- throw new SAXException(e.toString());
- }
- }
-
- // call parse on the parent
- getParent().parse(input);
- } finally {
- if (managedReader != null) {
- XMLReaderManager.getInstance(_useServicesMechanism).releaseXMLReader(managedReader);
- }
- }
- }
-
- public void parse (String systemId) throws SAXException, IOException
- {
- parse(new InputSource(systemId));
- }
-
- public void setContentHandler (ContentHandler handler)
- {
- _transformerHandler.setResult(new SAXResult(handler));
- if (getParent() == null) {
- try {
- createParent();
- }
- catch (SAXException e) {
- return;
- }
- }
- getParent().setContentHandler(_transformerHandler);
- }
-
- public void setErrorListener (ErrorListener handler) { }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java b/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java
deleted file mode 100644
index e30fffd..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java
+++ /dev/null
@@ -1,1613 +0,0 @@
-/*
- * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.trax;
-
-import com.sun.org.apache.xalan.internal.XalanConstants;
-import com.sun.org.apache.xalan.internal.utils.FactoryImpl;
-import com.sun.org.apache.xalan.internal.utils.FeatureManager;
-import com.sun.org.apache.xalan.internal.utils.FeaturePropertyBase;
-import com.sun.org.apache.xalan.internal.utils.FeaturePropertyBase.State;
-import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
-import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
-import com.sun.org.apache.xalan.internal.utils.XMLSecurityManager;
-import com.sun.org.apache.xalan.internal.utils.XMLSecurityPropertyManager;
-import com.sun.org.apache.xalan.internal.utils.XMLSecurityPropertyManager.Property;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.Constants;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.SourceLoader;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager;
-import com.sun.org.apache.xml.internal.utils.StopParseException;
-import com.sun.org.apache.xml.internal.utils.StylesheetPIHandler;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FilenameFilter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Vector;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-import javax.xml.XMLConstants;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-import javax.xml.transform.ErrorListener;
-import javax.xml.transform.Source;
-import javax.xml.transform.Templates;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.URIResolver;
-import javax.xml.transform.dom.DOMResult;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.sax.SAXResult;
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.transform.sax.SAXTransformerFactory;
-import javax.xml.transform.sax.TemplatesHandler;
-import javax.xml.transform.sax.TransformerHandler;
-import javax.xml.transform.stax.StAXResult;
-import javax.xml.transform.stax.StAXSource;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.stream.StreamSource;
-import org.xml.sax.InputSource;
-import org.xml.sax.XMLFilter;
-import org.xml.sax.XMLReader;
-import org.xml.sax.helpers.XMLReaderFactory;
-
-/**
- * Implementation of a JAXP1.1 TransformerFactory for Translets.
- * @author G. Todd Miller
- * @author Morten Jorgensen
- * @author Santiago Pericas-Geertsen
- */
-public class TransformerFactoryImpl
- extends SAXTransformerFactory implements SourceLoader, ErrorListener
-{
- // Public constants for attributes supported by the XSLTC TransformerFactory.
- public final static String TRANSLET_NAME = "translet-name";
- public final static String DESTINATION_DIRECTORY = "destination-directory";
- public final static String PACKAGE_NAME = "package-name";
- public final static String JAR_NAME = "jar-name";
- public final static String GENERATE_TRANSLET = "generate-translet";
- public final static String AUTO_TRANSLET = "auto-translet";
- public final static String USE_CLASSPATH = "use-classpath";
- public final static String DEBUG = "debug";
- public final static String ENABLE_INLINING = "enable-inlining";
- public final static String INDENT_NUMBER = "indent-number";
-
- /**
- * This error listener is used only for this factory and is not passed to
- * the Templates or Transformer objects that we create.
- */
- private ErrorListener _errorListener = this;
-
- /**
- * This URIResolver is passed to all created Templates and Transformers
- */
- private URIResolver _uriResolver = null;
-
- /**
- * As Gregor Samsa awoke one morning from uneasy dreams he found himself
- * transformed in his bed into a gigantic insect. He was lying on his hard,
- * as it were armour plated, back, and if he lifted his head a little he
- * could see his big, brown belly divided into stiff, arched segments, on
- * top of which the bed quilt could hardly keep in position and was about
- * to slide off completely. His numerous legs, which were pitifully thin
- * compared to the rest of his bulk, waved helplessly before his eyes.
- * "What has happened to me?", he thought. It was no dream....
- */
- protected final static String DEFAULT_TRANSLET_NAME = "GregorSamsa";
-
- /**
- * The class name of the translet
- */
- private String _transletName = DEFAULT_TRANSLET_NAME;
-
- /**
- * The destination directory for the translet
- */
- private String _destinationDirectory = null;
-
- /**
- * The package name prefix for all generated translet classes
- */
- private String _packageName = null;
-
- /**
- * The jar file name which the translet classes are packaged into
- */
- private String _jarFileName = null;
-
- /**
- * This Map is used to store parameters for locating
- * <?xml-stylesheet ...?> processing instructions in XML docs.
- */
- private Map<Source, PIParamWrapper> _piParams = null;
-
- /**
- * The above Map stores objects of this class.
- */
- private static class PIParamWrapper {
- public String _media = null;
- public String _title = null;
- public String _charset = null;
-
- public PIParamWrapper(String media, String title, String charset) {
- _media = media;
- _title = title;
- _charset = charset;
- }
- }
-
- /**
- * Set to <code>true</code> when debugging is enabled.
- */
- private boolean _debug = false;
-
- /**
- * Set to <code>true</code> when templates are inlined.
- */
- private boolean _enableInlining = false;
-
- /**
- * Set to <code>true</code> when we want to generate
- * translet classes from the stylesheet.
- */
- private boolean _generateTranslet = false;
-
- /**
- * If this is set to <code>true</code>, we attempt to use translet classes
- * for transformation if possible without compiling the stylesheet. The
- * translet class is only used if its timestamp is newer than the timestamp
- * of the stylesheet.
- */
- private boolean _autoTranslet = false;
-
- /**
- * If this is set to <code>true</code>, we attempt to load the translet
- * from the CLASSPATH.
- */
- private boolean _useClasspath = false;
-
- /**
- * Number of indent spaces when indentation is turned on.
- */
- private int _indentNumber = -1;
-
- /**
- * <p>State of secure processing feature.</p>
- */
- private boolean _isNotSecureProcessing = true;
- /**
- * <p>State of secure mode.</p>
- */
- private boolean _isSecureMode = false;
-
- /**
- * Indicates whether implementation parts should use
- * service loader (or similar).
- * Note the default value (false) is the safe option..
- */
- private boolean _useServicesMechanism;
-
- /**
- * protocols allowed for external references set by the stylesheet processing instruction, Import and Include element.
- */
- private String _accessExternalStylesheet = XalanConstants.EXTERNAL_ACCESS_DEFAULT;
- /**
- * protocols allowed for external DTD references in source file and/or stylesheet.
- */
- private String _accessExternalDTD = XalanConstants.EXTERNAL_ACCESS_DEFAULT;
-
- private XMLSecurityPropertyManager _xmlSecurityPropertyMgr;
- private XMLSecurityManager _xmlSecurityManager;
-
- private final FeatureManager _featureManager;
-
- private ClassLoader _extensionClassLoader = null;
-
- // Unmodifiable view of external extension function from xslt compiler
- // It will be populated by user-specified extension functions during the
- // type checking
- private Map<String, Class> _xsltcExtensionFunctions;
-
- /**
- * javax.xml.transform.sax.TransformerFactory implementation.
- */
- public TransformerFactoryImpl() {
- this(true);
- }
-
- public static TransformerFactory newTransformerFactoryNoServiceLoader() {
- return new TransformerFactoryImpl(false);
- }
-
- private TransformerFactoryImpl(boolean useServicesMechanism) {
- this._useServicesMechanism = useServicesMechanism;
- _featureManager = new FeatureManager();
-
- if (System.getSecurityManager() != null) {
- _isSecureMode = true;
- _isNotSecureProcessing = false;
- _featureManager.setValue(FeatureManager.Feature.ORACLE_ENABLE_EXTENSION_FUNCTION,
- FeaturePropertyBase.State.FSP, XalanConstants.FEATURE_FALSE);
- }
-
- _xmlSecurityPropertyMgr = new XMLSecurityPropertyManager();
- _accessExternalDTD = _xmlSecurityPropertyMgr.getValue(
- Property.ACCESS_EXTERNAL_DTD);
- _accessExternalStylesheet = _xmlSecurityPropertyMgr.getValue(
- Property.ACCESS_EXTERNAL_STYLESHEET);
-
- //Parser's security manager
- _xmlSecurityManager = new XMLSecurityManager(true);
- //Unmodifiable hash map with loaded external extension functions
- _xsltcExtensionFunctions = null;
- }
-
- public Map<String,Class> getExternalExtensionsMap() {
- return _xsltcExtensionFunctions;
- }
-
- /**
- * javax.xml.transform.sax.TransformerFactory implementation.
- * Set the error event listener for the TransformerFactory, which is used
- * for the processing of transformation instructions, and not for the
- * transformation itself.
- *
- * @param listener The error listener to use with the TransformerFactory
- * @throws IllegalArgumentException
- */
- @Override
- public void setErrorListener(ErrorListener listener)
- throws IllegalArgumentException
- {
- if (listener == null) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.ERROR_LISTENER_NULL_ERR,
- "TransformerFactory");
- throw new IllegalArgumentException(err.toString());
- }
- _errorListener = listener;
- }
-
- /**
- * javax.xml.transform.sax.TransformerFactory implementation.
- * Get the error event handler for the TransformerFactory.
- *
- * @return The error listener used with the TransformerFactory
- */
- @Override
- public ErrorListener getErrorListener() {
- return _errorListener;
- }
-
- /**
- * javax.xml.transform.sax.TransformerFactory implementation.
- * Returns the value set for a TransformerFactory attribute
- *
- * @param name The attribute name
- * @return An object representing the attribute value
- * @throws IllegalArgumentException
- */
- @Override
- public Object getAttribute(String name)
- throws IllegalArgumentException
- {
- // Return value for attribute 'translet-name'
- if (name.equals(TRANSLET_NAME)) {
- return _transletName;
- }
- else if (name.equals(GENERATE_TRANSLET)) {
- return new Boolean(_generateTranslet);
- }
- else if (name.equals(AUTO_TRANSLET)) {
- return new Boolean(_autoTranslet);
- }
- else if (name.equals(ENABLE_INLINING)) {
- if (_enableInlining)
- return Boolean.TRUE;
- else
- return Boolean.FALSE;
- } else if (name.equals(XalanConstants.SECURITY_MANAGER)) {
- return _xmlSecurityManager;
- } else if (name.equals(XalanConstants.JDK_EXTENSION_CLASSLOADER)) {
- return _extensionClassLoader;
- }
-
- /** Check to see if the property is managed by the security manager **/
- String propertyValue = (_xmlSecurityManager != null) ?
- _xmlSecurityManager.getLimitAsString(name) : null;
- if (propertyValue != null) {
- return propertyValue;
- } else {
- propertyValue = (_xmlSecurityPropertyMgr != null) ?
- _xmlSecurityPropertyMgr.getValue(name) : null;
- if (propertyValue != null) {
- return propertyValue;
- }
- }
-
- // Throw an exception for all other attributes
- ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_INVALID_ATTR_ERR, name);
- throw new IllegalArgumentException(err.toString());
- }
-
- /**
- * javax.xml.transform.sax.TransformerFactory implementation.
- * Sets the value for a TransformerFactory attribute.
- *
- * @param name The attribute name
- * @param value An object representing the attribute value
- * @throws IllegalArgumentException
- */
- @Override
- public void setAttribute(String name, Object value)
- throws IllegalArgumentException
- {
- // Set the default translet name (ie. class name), which will be used
- // for translets that cannot be given a name from their system-id.
- if (name.equals(TRANSLET_NAME) && value instanceof String) {
- _transletName = (String) value;
- return;
- }
- else if (name.equals(DESTINATION_DIRECTORY) && value instanceof String) {
- _destinationDirectory = (String) value;
- return;
- }
- else if (name.equals(PACKAGE_NAME) && value instanceof String) {
- _packageName = (String) value;
- return;
- }
- else if (name.equals(JAR_NAME) && value instanceof String) {
- _jarFileName = (String) value;
- return;
- }
- else if (name.equals(GENERATE_TRANSLET)) {
- if (value instanceof Boolean) {
- _generateTranslet = ((Boolean) value).booleanValue();
- return;
- }
- else if (value instanceof String) {
- _generateTranslet = ((String) value).equalsIgnoreCase("true");
- return;
- }
- }
- else if (name.equals(AUTO_TRANSLET)) {
- if (value instanceof Boolean) {
- _autoTranslet = ((Boolean) value).booleanValue();
- return;
- }
- else if (value instanceof String) {
- _autoTranslet = ((String) value).equalsIgnoreCase("true");
- return;
- }
- }
- else if (name.equals(USE_CLASSPATH)) {
- if (value instanceof Boolean) {
- _useClasspath = ((Boolean) value).booleanValue();
- return;
- }
- else if (value instanceof String) {
- _useClasspath = ((String) value).equalsIgnoreCase("true");
- return;
- }
- }
- else if (name.equals(DEBUG)) {
- if (value instanceof Boolean) {
- _debug = ((Boolean) value).booleanValue();
- return;
- }
- else if (value instanceof String) {
- _debug = ((String) value).equalsIgnoreCase("true");
- return;
- }
- }
- else if (name.equals(ENABLE_INLINING)) {
- if (value instanceof Boolean) {
- _enableInlining = ((Boolean) value).booleanValue();
- return;
- }
- else if (value instanceof String) {
- _enableInlining = ((String) value).equalsIgnoreCase("true");
- return;
- }
- }
- else if (name.equals(INDENT_NUMBER)) {
- if (value instanceof String) {
- try {
- _indentNumber = Integer.parseInt((String) value);
- return;
- }
- catch (NumberFormatException e) {
- // Falls through
- }
- }
- else if (value instanceof Integer) {
- _indentNumber = ((Integer) value).intValue();
- return;
- }
- }
- else if ( name.equals(XalanConstants.JDK_EXTENSION_CLASSLOADER)) {
- if (value instanceof ClassLoader) {
- _extensionClassLoader = (ClassLoader) value;
- return;
- } else {
- final ErrorMsg err
- = new ErrorMsg(ErrorMsg.JAXP_INVALID_ATTR_VALUE_ERR, "Extension Functions ClassLoader");
- throw new IllegalArgumentException(err.toString());
- }
- }
-
- if (_xmlSecurityManager != null &&
- _xmlSecurityManager.setLimit(name, XMLSecurityManager.State.APIPROPERTY, value)) {
- return;
- }
-
- if (_xmlSecurityPropertyMgr != null &&
- _xmlSecurityPropertyMgr.setValue(name, XMLSecurityPropertyManager.State.APIPROPERTY, value)) {
- _accessExternalDTD = _xmlSecurityPropertyMgr.getValue(
- Property.ACCESS_EXTERNAL_DTD);
- _accessExternalStylesheet = _xmlSecurityPropertyMgr.getValue(
- Property.ACCESS_EXTERNAL_STYLESHEET);
- return;
- }
-
- // Throw an exception for all other attributes
- final ErrorMsg err
- = new ErrorMsg(ErrorMsg.JAXP_INVALID_ATTR_ERR, name);
- throw new IllegalArgumentException(err.toString());
- }
-
- /**
- * <p>Set a feature for this <code>TransformerFactory</code> and <code>Transformer</code>s
- * or <code>Template</code>s created by this factory.</p>
- *
- * <p>
- * Feature names are fully qualified {@link java.net.URI}s.
- * Implementations may define their own features.
- * An {@link TransformerConfigurationException} is thrown if this <code>TransformerFactory</code> or the
- * <code>Transformer</code>s or <code>Template</code>s it creates cannot support the feature.
- * It is possible for an <code>TransformerFactory</code> to expose a feature value but be unable to change its state.
- * </p>
- *
- * <p>See {@link javax.xml.transform.TransformerFactory} for full documentation of specific features.</p>
- *
- * @param name Feature name.
- * @param value Is feature state <code>true</code> or <code>false</code>.
- *
- * @throws TransformerConfigurationException if this <code>TransformerFactory</code>
- * or the <code>Transformer</code>s or <code>Template</code>s it creates cannot support this feature.
- * @throws NullPointerException If the <code>name</code> parameter is null.
- */
- @Override
- public void setFeature(String name, boolean value)
- throws TransformerConfigurationException {
-
- // feature name cannot be null
- if (name == null) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_SET_FEATURE_NULL_NAME);
- throw new NullPointerException(err.toString());
- }
- // secure processing?
- else if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
- if ((_isSecureMode) && (!value)) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_SECUREPROCESSING_FEATURE);
- throw new TransformerConfigurationException(err.toString());
- }
- _isNotSecureProcessing = !value;
- _xmlSecurityManager.setSecureProcessing(value);
-
- // set external access restriction when FSP is explicitly set
- if (value && XalanConstants.IS_JDK8_OR_ABOVE) {
- _xmlSecurityPropertyMgr.setValue(Property.ACCESS_EXTERNAL_DTD,
- State.FSP, XalanConstants.EXTERNAL_ACCESS_DEFAULT_FSP);
- _xmlSecurityPropertyMgr.setValue(Property.ACCESS_EXTERNAL_STYLESHEET,
- State.FSP, XalanConstants.EXTERNAL_ACCESS_DEFAULT_FSP);
- _accessExternalDTD = _xmlSecurityPropertyMgr.getValue(
- Property.ACCESS_EXTERNAL_DTD);
- _accessExternalStylesheet = _xmlSecurityPropertyMgr.getValue(
- Property.ACCESS_EXTERNAL_STYLESHEET);
- }
-
- if (value && _featureManager != null) {
- _featureManager.setValue(FeatureManager.Feature.ORACLE_ENABLE_EXTENSION_FUNCTION,
- FeaturePropertyBase.State.FSP, XalanConstants.FEATURE_FALSE);
- }
- return;
- }
- else if (name.equals(XalanConstants.ORACLE_FEATURE_SERVICE_MECHANISM)) {
- //in secure mode, let _useServicesMechanism be determined by the constructor
- if (!_isSecureMode)
- _useServicesMechanism = value;
- }
- else {
- if (_featureManager != null &&
- _featureManager.setValue(name, State.APIPROPERTY, value)) {
- return;
- }
-
- // unknown feature
- ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNSUPPORTED_FEATURE, name);
- throw new TransformerConfigurationException(err.toString());
- }
- }
-
- /**
- * javax.xml.transform.sax.TransformerFactory implementation.
- * Look up the value of a feature (to see if it is supported).
- * This method must be updated as the various methods and features of this
- * class are implemented.
- *
- * @param name The feature name
- * @return 'true' if feature is supported, 'false' if not
- */
- @Override
- public boolean getFeature(String name) {
- // All supported features should be listed here
- String[] features = {
- DOMSource.FEATURE,
- DOMResult.FEATURE,
- SAXSource.FEATURE,
- SAXResult.FEATURE,
- StAXSource.FEATURE,
- StAXResult.FEATURE,
- StreamSource.FEATURE,
- StreamResult.FEATURE,
- SAXTransformerFactory.FEATURE,
- SAXTransformerFactory.FEATURE_XMLFILTER,
- XalanConstants.ORACLE_FEATURE_SERVICE_MECHANISM
- };
-
- // feature name cannot be null
- if (name == null) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_GET_FEATURE_NULL_NAME);
- throw new NullPointerException(err.toString());
- }
-
- // Inefficient, but array is small
- for (int i = 0; i < features.length; i++) {
- if (name.equals(features[i])) {
- return true;
- }
- }
- // secure processing?
- if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
- return !_isNotSecureProcessing;
- }
-
- /** Check to see if the property is managed by the security manager **/
- String propertyValue = (_featureManager != null) ?
- _featureManager.getValueAsString(name) : null;
- if (propertyValue != null) {
- return Boolean.parseBoolean(propertyValue);
- }
-
- // Feature not supported
- return false;
- }
- /**
- * Return the state of the services mechanism feature.
- */
- public boolean useServicesMechnism() {
- return _useServicesMechanism;
- }
-
- /**
- * @return the feature manager
- */
- public FeatureManager getFeatureManager() {
- return _featureManager;
- }
-
- /**
- * javax.xml.transform.sax.TransformerFactory implementation.
- * Get the object that is used by default during the transformation to
- * resolve URIs used in document(), xsl:import, or xsl:include.
- *
- * @return The URLResolver used for this TransformerFactory and all
- * Templates and Transformer objects created using this factory
- */
- @Override
- public URIResolver getURIResolver() {
- return _uriResolver;
- }
-
- /**
- * javax.xml.transform.sax.TransformerFactory implementation.
- * Set the object that is used by default during the transformation to
- * resolve URIs used in document(), xsl:import, or xsl:include. Note that
- * this does not affect Templates and Transformers that are already
- * created with this factory.
- *
- * @param resolver The URLResolver used for this TransformerFactory and all
- * Templates and Transformer objects created using this factory
- */
- @Override
- public void setURIResolver(URIResolver resolver) {
- _uriResolver = resolver;
- }
-
- /**
- * javax.xml.transform.sax.TransformerFactory implementation.
- * Get the stylesheet specification(s) associated via the xml-stylesheet
- * processing instruction (see http://www.w3.org/TR/xml-stylesheet/) with
- * the document document specified in the source parameter, and that match
- * the given criteria.
- *
- * @param source The XML source document.
- * @param media The media attribute to be matched. May be null, in which
- * case the prefered templates will be used (i.e. alternate = no).
- * @param title The value of the title attribute to match. May be null.
- * @param charset The value of the charset attribute to match. May be null.
- * @return A Source object suitable for passing to the TransformerFactory.
- * @throws TransformerConfigurationException
- */
- @Override
- public Source getAssociatedStylesheet(Source source, String media,
- String title, String charset)
- throws TransformerConfigurationException {
-
- String baseId;
- XMLReader reader;
- InputSource isource;
-
-
- /**
- * Fix for bugzilla bug 24187
- */
- StylesheetPIHandler _stylesheetPIHandler = new StylesheetPIHandler(null,media,title,charset);
-
- try {
-
- if (source instanceof DOMSource ) {
- final DOMSource domsrc = (DOMSource) source;
- baseId = domsrc.getSystemId();
- final org.w3c.dom.Node node = domsrc.getNode();
- final DOM2SAX dom2sax = new DOM2SAX(node);
-
- _stylesheetPIHandler.setBaseId(baseId);
-
- dom2sax.setContentHandler( _stylesheetPIHandler);
- dom2sax.parse();
- } else {
- isource = SAXSource.sourceToInputSource(source);
- baseId = isource.getSystemId();
-
- SAXParserFactory factory = FactoryImpl.getSAXFactory(_useServicesMechanism);
- factory.setNamespaceAware(true);
-
- if (!_isNotSecureProcessing) {
- try {
- factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
- }
- catch (org.xml.sax.SAXException e) {}
- }
-
- SAXParser jaxpParser = factory.newSAXParser();
-
- reader = jaxpParser.getXMLReader();
- if (reader == null) {
- reader = XMLReaderFactory.createXMLReader();
- }
-
- _stylesheetPIHandler.setBaseId(baseId);
- reader.setContentHandler(_stylesheetPIHandler);
- reader.parse(isource);
-
- }
-
- if (_uriResolver != null ) {
- _stylesheetPIHandler.setURIResolver(_uriResolver);
- }
-
- } catch (StopParseException e ) {
- // startElement encountered so do not parse further
-
- } catch (javax.xml.parsers.ParserConfigurationException e) {
-
- throw new TransformerConfigurationException(
- "getAssociatedStylesheets failed", e);
-
- } catch (org.xml.sax.SAXException se) {
-
- throw new TransformerConfigurationException(
- "getAssociatedStylesheets failed", se);
-
-
- } catch (IOException ioe ) {
- throw new TransformerConfigurationException(
- "getAssociatedStylesheets failed", ioe);
-
- }
-
- return _stylesheetPIHandler.getAssociatedStylesheet();
-
- }
-
- /**
- * javax.xml.transform.sax.TransformerFactory implementation.
- * Create a Transformer object that copies the input document to the result.
- *
- * @return A Transformer object that simply copies the source to the result.
- * @throws TransformerConfigurationException
- */
- @Override
- public Transformer newTransformer()
- throws TransformerConfigurationException
- {
- TransformerImpl result = new TransformerImpl(new Properties(),
- _indentNumber, this);
- if (_uriResolver != null) {
- result.setURIResolver(_uriResolver);
- }
-
- if (!_isNotSecureProcessing) {
- result.setSecureProcessing(true);
- }
- return result;
- }
-
- /**
- * javax.xml.transform.sax.TransformerFactory implementation.
- * Process the Source into a Templates object, which is a a compiled
- * representation of the source. Note that this method should not be
- * used with XSLTC, as the time-consuming compilation is done for each
- * and every transformation.
- *
- * @return A Templates object that can be used to create Transformers.
- * @throws TransformerConfigurationException
- */
- @Override
- public Transformer newTransformer(Source source) throws
- TransformerConfigurationException
- {
- final Templates templates = newTemplates(source);
- final Transformer transformer = templates.newTransformer();
- if (_uriResolver != null) {
- transformer.setURIResolver(_uriResolver);
- }
- return(transformer);
- }
-
- /**
- * Pass warning messages from the compiler to the error listener
- */
- private void passWarningsToListener(ArrayList<ErrorMsg> messages)
- throws TransformerException
- {
- if (_errorListener == null || messages == null) {
- return;
- }
- // Pass messages to listener, one by one
- final int count = messages.size();
- for (int pos = 0; pos < count; pos++) {
- ErrorMsg msg = messages.get(pos);
- // Workaround for the TCK failure ErrorListener.errorTests.error001.
- if (msg.isWarningError())
- _errorListener.error(
- new TransformerConfigurationException(msg.toString()));
- else
- _errorListener.warning(
- new TransformerConfigurationException(msg.toString()));
- }
- }
-
- /**
- * Pass error messages from the compiler to the error listener
- */
- private void passErrorsToListener(ArrayList<ErrorMsg> messages) {
- try {
- if (_errorListener == null || messages == null) {
- return;
- }
- // Pass messages to listener, one by one
- final int count = messages.size();
- for (int pos = 0; pos < count; pos++) {
- String message = messages.get(pos).toString();
- _errorListener.error(new TransformerException(message));
- }
- }
- catch (TransformerException e) {
- // nada
- }
- }
-
- /**
- * javax.xml.transform.sax.TransformerFactory implementation.
- * Process the Source into a Templates object, which is a a compiled
- * representation of the source.
- *
- * @param source The input stylesheet - DOMSource not supported!!!
- * @return A Templates object that can be used to create Transformers.
- * @throws TransformerConfigurationException
- */
- @Override
- public Templates newTemplates(Source source)
- throws TransformerConfigurationException
- {
- // If the _useClasspath attribute is true, try to load the translet from
- // the CLASSPATH and create a template object using the loaded
- // translet.
- if (_useClasspath) {
- String transletName = getTransletBaseName(source);
-
- if (_packageName != null)
- transletName = _packageName + "." + transletName;
-
- try {
- final Class clazz = ObjectFactory.findProviderClass(transletName, true);
- resetTransientAttributes();
-
- return new TemplatesImpl(new Class[]{clazz}, transletName, null, _indentNumber, this);
- }
- catch (ClassNotFoundException cnfe) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, transletName);
- throw new TransformerConfigurationException(err.toString());
- }
- catch (Exception e) {
- ErrorMsg err = new ErrorMsg(
- new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)
- + e.getMessage());
- throw new TransformerConfigurationException(err.toString());
- }
- }
-
- // If _autoTranslet is true, we will try to load the bytecodes
- // from the translet classes without compiling the stylesheet.
- if (_autoTranslet) {
- byte[][] bytecodes;
- String transletClassName = getTransletBaseName(source);
-
- if (_packageName != null)
- transletClassName = _packageName + "." + transletClassName;
-
- if (_jarFileName != null)
- bytecodes = getBytecodesFromJar(source, transletClassName);
- else
- bytecodes = getBytecodesFromClasses(source, transletClassName);
-
- if (bytecodes != null) {
- if (_debug) {
- if (_jarFileName != null)
- System.err.println(new ErrorMsg(
- ErrorMsg.TRANSFORM_WITH_JAR_STR, transletClassName, _jarFileName));
- else
- System.err.println(new ErrorMsg(
- ErrorMsg.TRANSFORM_WITH_TRANSLET_STR, transletClassName));
- }
-
- // Reset the per-session attributes to their default values
- // after each newTemplates() call.
- resetTransientAttributes();
- return new TemplatesImpl(bytecodes, transletClassName, null, _indentNumber, this);
- }
- }
-
- // Create and initialize a stylesheet compiler
- final XSLTC xsltc = new XSLTC(_useServicesMechanism, _featureManager);
- if (_debug) xsltc.setDebug(true);
- if (_enableInlining)
- xsltc.setTemplateInlining(true);
- else
- xsltc.setTemplateInlining(false);
-
- if (!_isNotSecureProcessing) xsltc.setSecureProcessing(true);
- xsltc.setProperty(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, _accessExternalStylesheet);
- xsltc.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, _accessExternalDTD);
- xsltc.setProperty(XalanConstants.SECURITY_MANAGER, _xmlSecurityManager);
- xsltc.setProperty(XalanConstants.JDK_EXTENSION_CLASSLOADER, _extensionClassLoader);
- xsltc.init();
- if (!_isNotSecureProcessing)
- _xsltcExtensionFunctions = xsltc.getExternalExtensionFunctions();
- // Set a document loader (for xsl:include/import) if defined
- if (_uriResolver != null) {
- xsltc.setSourceLoader(this);
- }
-
- // Pass parameters to the Parser to make sure it locates the correct
- // <?xml-stylesheet ...?> PI in an XML input document
- if ((_piParams != null) && (_piParams.get(source) != null)) {
- // Get the parameters for this Source object
- PIParamWrapper p = _piParams.get(source);
- // Pass them on to the compiler (which will pass then to the parser)
- if (p != null) {
- xsltc.setPIParameters(p._media, p._title, p._charset);
- }
- }
-
- // Set the attributes for translet generation
- int outputType = XSLTC.BYTEARRAY_OUTPUT;
- if (_generateTranslet || _autoTranslet) {
- // Set the translet name
- xsltc.setClassName(getTransletBaseName(source));
-
- if (_destinationDirectory != null)
- xsltc.setDestDirectory(_destinationDirectory);
- else {
- String xslName = getStylesheetFileName(source);
- if (xslName != null) {
- File xslFile = new File(xslName);
- String xslDir = xslFile.getParent();
-
- if (xslDir != null)
- xsltc.setDestDirectory(xslDir);
- }
- }
-
- if (_packageName != null)
- xsltc.setPackageName(_packageName);
-
- if (_jarFileName != null) {
- xsltc.setJarFileName(_jarFileName);
- outputType = XSLTC.BYTEARRAY_AND_JAR_OUTPUT;
- }
- else
- outputType = XSLTC.BYTEARRAY_AND_FILE_OUTPUT;
- }
-
- // Compile the stylesheet
- final InputSource input = Util.getInputSource(xsltc, source);
- byte[][] bytecodes = xsltc.compile(null, input, outputType);
- final String transletName = xsltc.getClassName();
-
- // Output to the jar file if the jar file name is set.
- if ((_generateTranslet || _autoTranslet)
- && bytecodes != null && _jarFileName != null) {
- try {
- xsltc.outputToJar();
- }
- catch (java.io.IOException e) { }
- }
-
- // Reset the per-session attributes to their default values
- // after each newTemplates() call.
- resetTransientAttributes();
-
- // Pass compiler warnings to the error listener
- if (_errorListener != this) {
- try {
- passWarningsToListener(xsltc.getWarnings());
- }
- catch (TransformerException e) {
- throw new TransformerConfigurationException(e);
- }
- }
- else {
- xsltc.printWarnings();
- }
-
- // Check that the transformation went well before returning
- if (bytecodes == null) {
- ArrayList<ErrorMsg> errs = xsltc.getErrors();
- ErrorMsg err;
- if (errs != null) {
- err = errs.get(errs.size() - 1);
- } else {
- err = new ErrorMsg(ErrorMsg.JAXP_COMPILE_ERR);
- }
- Throwable cause = err.getCause();
- TransformerConfigurationException exc;
- if (cause != null) {
- exc = new TransformerConfigurationException(cause.getMessage(), cause);
- } else {
- exc = new TransformerConfigurationException(err.toString());
- }
-
- // Pass compiler errors to the error listener
- if (_errorListener != null) {
- passErrorsToListener(xsltc.getErrors());
-
- // As required by TCK 1.2, send a fatalError to the
- // error listener because compilation of the stylesheet
- // failed and no further processing will be possible.
- try {
- _errorListener.fatalError(exc);
- } catch (TransformerException te) {
- // well, we tried.
- }
- } else {
- xsltc.printErrors();
- }
- throw exc;
- }
-
- return new TemplatesImpl(bytecodes, transletName,
- xsltc.getOutputProperties(), _indentNumber, this);
- }
-
- /**
- * javax.xml.transform.sax.SAXTransformerFactory implementation.
- * Get a TemplatesHandler object that can process SAX ContentHandler
- * events into a Templates object.
- *
- * @return A TemplatesHandler object that can handle SAX events
- * @throws TransformerConfigurationException
- */
- @Override
- public TemplatesHandler newTemplatesHandler()
- throws TransformerConfigurationException
- {
- final TemplatesHandlerImpl handler =
- new TemplatesHandlerImpl(_indentNumber, this);
- if (_uriResolver != null) {
- handler.setURIResolver(_uriResolver);
- }
- return handler;
- }
-
- /**
- * javax.xml.transform.sax.SAXTransformerFactory implementation.
- * Get a TransformerHandler object that can process SAX ContentHandler
- * events into a Result. This method will return a pure copy transformer.
- *
- * @return A TransformerHandler object that can handle SAX events
- * @throws TransformerConfigurationException
- */
- @Override
- public TransformerHandler newTransformerHandler()
- throws TransformerConfigurationException
- {
- final Transformer transformer = newTransformer();
- if (_uriResolver != null) {
- transformer.setURIResolver(_uriResolver);
- }
- return new TransformerHandlerImpl((TransformerImpl) transformer);
- }
-
- /**
- * javax.xml.transform.sax.SAXTransformerFactory implementation.
- * Get a TransformerHandler object that can process SAX ContentHandler
- * events into a Result, based on the transformation instructions
- * specified by the argument.
- *
- * @param src The source of the transformation instructions.
- * @return A TransformerHandler object that can handle SAX events
- * @throws TransformerConfigurationException
- */
- @Override
- public TransformerHandler newTransformerHandler(Source src)
- throws TransformerConfigurationException
- {
- final Transformer transformer = newTransformer(src);
- if (_uriResolver != null) {
- transformer.setURIResolver(_uriResolver);
- }
- return new TransformerHandlerImpl((TransformerImpl) transformer);
- }
-
- /**
- * javax.xml.transform.sax.SAXTransformerFactory implementation.
- * Get a TransformerHandler object that can process SAX ContentHandler
- * events into a Result, based on the transformation instructions
- * specified by the argument.
- *
- * @param templates Represents a pre-processed stylesheet
- * @return A TransformerHandler object that can handle SAX events
- * @throws TransformerConfigurationException
- */
- @Override
- public TransformerHandler newTransformerHandler(Templates templates)
- throws TransformerConfigurationException
- {
- final Transformer transformer = templates.newTransformer();
- final TransformerImpl internal = (TransformerImpl)transformer;
- return new TransformerHandlerImpl(internal);
- }
-
- /**
- * javax.xml.transform.sax.SAXTransformerFactory implementation.
- * Create an XMLFilter that uses the given source as the
- * transformation instructions.
- *
- * @param src The source of the transformation instructions.
- * @return An XMLFilter object, or null if this feature is not supported.
- * @throws TransformerConfigurationException
- */
- @Override
- public XMLFilter newXMLFilter(Source src)
- throws TransformerConfigurationException
- {
- Templates templates = newTemplates(src);
- if (templates == null) return null;
- return newXMLFilter(templates);
- }
-
- /**
- * javax.xml.transform.sax.SAXTransformerFactory implementation.
- * Create an XMLFilter that uses the given source as the
- * transformation instructions.
- *
- * @param templates The source of the transformation instructions.
- * @return An XMLFilter object, or null if this feature is not supported.
- * @throws TransformerConfigurationException
- */
- @Override
- public XMLFilter newXMLFilter(Templates templates)
- throws TransformerConfigurationException
- {
- try {
- return new com.sun.org.apache.xalan.internal.xsltc.trax.TrAXFilter(templates);
- }
- catch (TransformerConfigurationException e1) {
- if (_errorListener != null) {
- try {
- _errorListener.fatalError(e1);
- return null;
- }
- catch (TransformerException e2) {
- new TransformerConfigurationException(e2);
- }
- }
- throw e1;
- }
- }
-
- /**
- * Receive notification of a recoverable error.
- * The transformer must continue to provide normal parsing events after
- * invoking this method. It should still be possible for the application
- * to process the document through to the end.
- *
- * @param e The warning information encapsulated in a transformer
- * exception.
- * @throws TransformerException if the application chooses to discontinue
- * the transformation (always does in our case).
- */
- @Override
- public void error(TransformerException e)
- throws TransformerException
- {
- Throwable wrapped = e.getException();
- if (wrapped != null) {
- System.err.println(new ErrorMsg(ErrorMsg.ERROR_PLUS_WRAPPED_MSG,
- e.getMessageAndLocation(),
- wrapped.getMessage()));
- } else {
- System.err.println(new ErrorMsg(ErrorMsg.ERROR_MSG,
- e.getMessageAndLocation()));
- }
- throw e;
- }
-
- /**
- * Receive notification of a non-recoverable error.
- * The application must assume that the transformation cannot continue
- * after the Transformer has invoked this method, and should continue
- * (if at all) only to collect addition error messages. In fact,
- * Transformers are free to stop reporting events once this method has
- * been invoked.
- *
- * @param e warning information encapsulated in a transformer
- * exception.
- * @throws TransformerException if the application chooses to discontinue
- * the transformation (always does in our case).
- */
- @Override
- public void fatalError(TransformerException e)
- throws TransformerException
- {
- Throwable wrapped = e.getException();
- if (wrapped != null) {
- System.err.println(new ErrorMsg(ErrorMsg.FATAL_ERR_PLUS_WRAPPED_MSG,
- e.getMessageAndLocation(),
- wrapped.getMessage()));
- } else {
- System.err.println(new ErrorMsg(ErrorMsg.FATAL_ERR_MSG,
- e.getMessageAndLocation()));
- }
- throw e;
- }
-
- /**
- * Receive notification of a warning.
- * Transformers can use this method to report conditions that are not
- * errors or fatal errors. The default behaviour is to take no action.
- * After invoking this method, the Transformer must continue with the
- * transformation. It should still be possible for the application to
- * process the document through to the end.
- *
- * @param e The warning information encapsulated in a transformer
- * exception.
- * @throws TransformerException if the application chooses to discontinue
- * the transformation (never does in our case).
- */
- @Override
- public void warning(TransformerException e)
- throws TransformerException
- {
- Throwable wrapped = e.getException();
- if (wrapped != null) {
- System.err.println(new ErrorMsg(ErrorMsg.WARNING_PLUS_WRAPPED_MSG,
- e.getMessageAndLocation(),
- wrapped.getMessage()));
- } else {
- System.err.println(new ErrorMsg(ErrorMsg.WARNING_MSG,
- e.getMessageAndLocation()));
- }
- }
-
- /**
- * This method implements XSLTC's SourceLoader interface. It is used to
- * glue a TrAX URIResolver to the XSLTC compiler's Input and Import classes.
- *
- * @param href The URI of the document to load
- * @param context The URI of the currently loaded document
- * @param xsltc The compiler that resuests the document
- * @return An InputSource with the loaded document
- */
- @Override
- public InputSource loadSource(String href, String context, XSLTC xsltc) {
- try {
- if (_uriResolver != null) {
- final Source source = _uriResolver.resolve(href, context);
- if (source != null) {
- return Util.getInputSource(xsltc, source);
- }
- }
- }
- catch (TransformerException e) {
- // should catch it when the resolver explicitly throws the exception
- final ErrorMsg msg = new ErrorMsg(ErrorMsg.INVALID_URI_ERR, href + "\n" + e.getMessage(), this);
- xsltc.getParser().reportError(Constants.FATAL, msg);
- }
-
- return null;
- }
-
- /**
- * Reset the per-session attributes to their default values
- */
- private void resetTransientAttributes() {
- _transletName = DEFAULT_TRANSLET_NAME;
- _destinationDirectory = null;
- _packageName = null;
- _jarFileName = null;
- }
-
- /**
- * Load the translet classes from local .class files and return
- * the bytecode array.
- *
- * @param source The xsl source
- * @param fullClassName The full name of the translet
- * @return The bytecode array
- */
- private byte[][] getBytecodesFromClasses(Source source, String fullClassName)
- {
- if (fullClassName == null)
- return null;
-
- String xslFileName = getStylesheetFileName(source);
- File xslFile = null;
- if (xslFileName != null)
- xslFile = new File(xslFileName);
-
- // Find the base name of the translet
- final String transletName;
- int lastDotIndex = fullClassName.lastIndexOf('.');
- if (lastDotIndex > 0)
- transletName = fullClassName.substring(lastDotIndex+1);
- else
- transletName = fullClassName;
-
- // Construct the path name for the translet class file
- String transletPath = fullClassName.replace('.', '/');
- if (_destinationDirectory != null) {
- transletPath = _destinationDirectory + "/" + transletPath + ".class";
- }
- else {
- if (xslFile != null && xslFile.getParent() != null)
- transletPath = xslFile.getParent() + "/" + transletPath + ".class";
- else
- transletPath = transletPath + ".class";
- }
-
- // Return null if the translet class file does not exist.
- File transletFile = new File(transletPath);
- if (!transletFile.exists())
- return null;
-
- // Compare the timestamps of the translet and the xsl file.
- // If the translet is older than the xsl file, return null
- // so that the xsl file is used for the transformation and
- // the translet is regenerated.
- if (xslFile != null && xslFile.exists()) {
- long xslTimestamp = xslFile.lastModified();
- long transletTimestamp = transletFile.lastModified();
- if (transletTimestamp < xslTimestamp)
- return null;
- }
-
- // Load the translet into a bytecode array.
- Vector bytecodes = new Vector();
- int fileLength = (int)transletFile.length();
- if (fileLength > 0) {
- FileInputStream input;
- try {
- input = new FileInputStream(transletFile);
- }
- catch (FileNotFoundException e) {
- return null;
- }
-
- byte[] bytes = new byte[fileLength];
- try {
- readFromInputStream(bytes, input, fileLength);
- input.close();
- }
- catch (IOException e) {
- return null;
- }
-
- bytecodes.addElement(bytes);
- }
- else
- return null;
-
- // Find the parent directory of the translet.
- String transletParentDir = transletFile.getParent();
- if (transletParentDir == null)
- transletParentDir = SecuritySupport.getSystemProperty("user.dir");
-
- File transletParentFile = new File(transletParentDir);
-
- // Find all the auxiliary files which have a name pattern of "transletClass$nnn.class".
- final String transletAuxPrefix = transletName + "$";
- File[] auxfiles = transletParentFile.listFiles(new FilenameFilter() {
- @Override
- public boolean accept(File dir, String name)
- {
- return (name.endsWith(".class") && name.startsWith(transletAuxPrefix));
- }
- });
-
- // Load the auxiliary class files and add them to the bytecode array.
- for (int i = 0; i < auxfiles.length; i++)
- {
- File auxfile = auxfiles[i];
- int auxlength = (int)auxfile.length();
- if (auxlength > 0) {
- FileInputStream auxinput = null;
- try {
- auxinput = new FileInputStream(auxfile);
- }
- catch (FileNotFoundException e) {
- continue;
- }
-
- byte[] bytes = new byte[auxlength];
-
- try {
- readFromInputStream(bytes, auxinput, auxlength);
- auxinput.close();
- }
- catch (IOException e) {
- continue;
- }
-
- bytecodes.addElement(bytes);
- }
- }
-
- // Convert the Vector of byte[] to byte[][].
- final int count = bytecodes.size();
- if ( count > 0) {
- final byte[][] result = new byte[count][1];
- for (int i = 0; i < count; i++) {
- result[i] = (byte[])bytecodes.elementAt(i);
- }
-
- return result;
- }
- else
- return null;
- }
-
- /**
- * Load the translet classes from the jar file and return the bytecode.
- *
- * @param source The xsl source
- * @param fullClassName The full name of the translet
- * @return The bytecode array
- */
- private byte[][] getBytecodesFromJar(Source source, String fullClassName)
- {
- String xslFileName = getStylesheetFileName(source);
- File xslFile = null;
- if (xslFileName != null)
- xslFile = new File(xslFileName);
-
- // Construct the path for the jar file
- String jarPath;
- if (_destinationDirectory != null)
- jarPath = _destinationDirectory + "/" + _jarFileName;
- else {
- if (xslFile != null && xslFile.getParent() != null)
- jarPath = xslFile.getParent() + "/" + _jarFileName;
- else
- jarPath = _jarFileName;
- }
-
- // Return null if the jar file does not exist.
- File file = new File(jarPath);
- if (!file.exists())
- return null;
-
- // Compare the timestamps of the jar file and the xsl file. Return null
- // if the xsl file is newer than the jar file.
- if (xslFile != null && xslFile.exists()) {
- long xslTimestamp = xslFile.lastModified();
- long transletTimestamp = file.lastModified();
- if (transletTimestamp < xslTimestamp)
- return null;
- }
-
- // Create a ZipFile object for the jar file
- ZipFile jarFile;
- try {
- jarFile = new ZipFile(file);
- }
- catch (IOException e) {
- return null;
- }
-
- String transletPath = fullClassName.replace('.', '/');
- String transletAuxPrefix = transletPath + "$";
- String transletFullName = transletPath + ".class";
-
- Vector bytecodes = new Vector();
-
- // Iterate through all entries in the jar file to find the
- // translet and auxiliary classes.
- Enumeration entries = jarFile.entries();
- while (entries.hasMoreElements())
- {
- ZipEntry entry = (ZipEntry)entries.nextElement();
- String entryName = entry.getName();
- if (entry.getSize() > 0 &&
- (entryName.equals(transletFullName) ||
- (entryName.endsWith(".class") &&
- entryName.startsWith(transletAuxPrefix))))
- {
- try {
- InputStream input = jarFile.getInputStream(entry);
- int size = (int)entry.getSize();
- byte[] bytes = new byte[size];
- readFromInputStream(bytes, input, size);
- input.close();
- bytecodes.addElement(bytes);
- }
- catch (IOException e) {
- return null;
- }
- }
- }
-
- // Convert the Vector of byte[] to byte[][].
- final int count = bytecodes.size();
- if (count > 0) {
- final byte[][] result = new byte[count][1];
- for (int i = 0; i < count; i++) {
- result[i] = (byte[])bytecodes.elementAt(i);
- }
-
- return result;
- }
- else
- return null;
- }
-
- /**
- * Read a given number of bytes from the InputStream into a byte array.
- *
- * @param bytes The byte array to store the input content.
- * @param input The input stream.
- * @param size The number of bytes to read.
- */
- private void readFromInputStream(byte[] bytes, InputStream input, int size)
- throws IOException
- {
- int n = 0;
- int offset = 0;
- int length = size;
- while (length > 0 && (n = input.read(bytes, offset, length)) > 0) {
- offset = offset + n;
- length = length - n;
- }
- }
-
- /**
- * Return the base class name of the translet.
- * The translet name is resolved using the following rules:
- * 1. if the _transletName attribute is set and its value is not "GregorSamsa",
- * then _transletName is returned.
- * 2. otherwise get the translet name from the base name of the system ID
- * 3. return "GregorSamsa" if the result from step 2 is null.
- *
- * @param source The input Source
- * @return The name of the translet class
- */
- private String getTransletBaseName(Source source)
- {
- String transletBaseName = null;
- if (!_transletName.equals(DEFAULT_TRANSLET_NAME))
- return _transletName;
- else {
- String systemId = source.getSystemId();
- if (systemId != null) {
- String baseName = Util.baseName(systemId);
- if (baseName != null) {
- baseName = Util.noExtName(baseName);
- transletBaseName = Util.toJavaName(baseName);
- }
- }
- }
-
- return (transletBaseName != null) ? transletBaseName : DEFAULT_TRANSLET_NAME;
- }
-
- /**
- * Return the local file name from the systemId of the Source object
- *
- * @param source The Source
- * @return The file name in the local filesystem, or null if the
- * systemId does not represent a local file.
- */
- private String getStylesheetFileName(Source source)
- {
- String systemId = source.getSystemId();
- if (systemId != null) {
- File file = new File(systemId);
- if (file.exists())
- return systemId;
- else {
- URL url;
- try {
- url = new URL(systemId);
- }
- catch (MalformedURLException e) {
- return null;
- }
-
- if ("file".equals(url.getProtocol()))
- return url.getFile();
- else
- return null;
- }
- }
- else
- return null;
- }
-
- /**
- * Returns a new instance of the XSLTC DTM Manager service.
- */
- protected final XSLTCDTMManager createNewDTMManagerInstance() {
- return XSLTCDTMManager.createNewDTMManagerInstance();
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerHandlerImpl.java b/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerHandlerImpl.java
deleted file mode 100644
index cd4b4be..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerHandlerImpl.java
+++ /dev/null
@@ -1,513 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: TransformerHandlerImpl.java,v 1.2.4.1 2005/09/15 06:25:12 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.trax;
-
-import javax.xml.transform.Result;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.sax.TransformerHandler;
-import javax.xml.transform.dom.DOMResult;
-
-import com.sun.org.apache.xalan.internal.xsltc.StripFilter;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.dom.DOMWSFilter;
-import com.sun.org.apache.xalan.internal.xsltc.dom.SAXImpl;
-import com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet;
-import com.sun.org.apache.xml.internal.dtm.DTMWSFilter;
-import com.sun.org.apache.xml.internal.serializer.SerializationHandler;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.DTDHandler;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-import org.xml.sax.ext.DeclHandler;
-import org.xml.sax.ext.LexicalHandler;
-import org.xml.sax.helpers.DefaultHandler;
-
-/**
- * Implementation of a JAXP1.1 TransformerHandler
- * @author Morten Jorgensen
- */
-public class TransformerHandlerImpl implements TransformerHandler, DeclHandler {
-
- private TransformerImpl _transformer;
- private AbstractTranslet _translet = null;
- private String _systemId;
- private SAXImpl _dom = null;
- private ContentHandler _handler = null;
- private LexicalHandler _lexHandler = null;
- private DTDHandler _dtdHandler = null;
- private DeclHandler _declHandler = null;
- private Result _result = null;
- private Locator _locator = null;
-
- private boolean _done = false; // Set in endDocument()
-
- /**
- * A flag indicating whether this transformer handler implements the
- * identity transform.
- */
- private boolean _isIdentity = false;
-
- /**
- * Cosntructor - pass in reference to a TransformerImpl object
- */
- public TransformerHandlerImpl(TransformerImpl transformer) {
- // Save the reference to the transformer
- _transformer = transformer;
-
- if (transformer.isIdentity()) {
- // Set initial handler to the empty handler
- _handler = new DefaultHandler();
- _isIdentity = true;
- }
- else {
- // Get a reference to the translet wrapped inside the transformer
- _translet = _transformer.getTranslet();
- }
- }
-
- /**
- * Implements javax.xml.transform.sax.TransformerHandler.getSystemId()
- * Get the base ID (URI or system ID) from where relative URLs will be
- * resolved.
- * @return The systemID that was set with setSystemId(String id)
- */
- @Override
- public String getSystemId() {
- return _systemId;
- }
-
- /**
- * Implements javax.xml.transform.sax.TransformerHandler.setSystemId()
- * Get the base ID (URI or system ID) from where relative URLs will be
- * resolved.
- * @param id Base URI for this stylesheet
- */
- @Override
- public void setSystemId(String id) {
- _systemId = id;
- }
-
- /**
- * Implements javax.xml.transform.sax.TransformerHandler.getTransformer()
- * Get the Transformer associated with this handler, which is needed in
- * order to set parameters and output properties.
- * @return The Transformer object
- */
- @Override
- public Transformer getTransformer() {
- return _transformer;
- }
-
- /**
- * Implements javax.xml.transform.sax.TransformerHandler.setResult()
- * Enables the user of the TransformerHandler to set the to set the Result
- * for the transformation.
- * @param result A Result instance, should not be null
- * @throws IllegalArgumentException if result is invalid for some reason
- */
- @Override
- public void setResult(Result result) throws IllegalArgumentException {
- _result = result;
-
- if (null == result) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.ER_RESULT_NULL);
- throw new IllegalArgumentException(err.toString()); //"result should not be null");
- }
-
- if (_isIdentity) {
- try {
- // Connect this object with output system directly
- SerializationHandler outputHandler =
- _transformer.getOutputHandler(result);
- _transformer.transferOutputProperties(outputHandler);
-
- _handler = outputHandler;
- _lexHandler = outputHandler;
- }
- catch (TransformerException e) {
- _result = null;
- }
- }
- else if (_done) {
- // Run the transformation now, if not already done
- try {
- _transformer.setDOM(_dom);
- _transformer.transform(null, _result);
- }
- catch (TransformerException e) {
- // What the hell are we supposed to do with this???
- throw new IllegalArgumentException(e.getMessage());
- }
- }
- }
-
- /**
- * Implements org.xml.sax.ContentHandler.characters()
- * Receive notification of character data.
- */
- @Override
- public void characters(char[] ch, int start, int length)
- throws SAXException
- {
- _handler.characters(ch, start, length);
- }
-
- /**
- * Implements org.xml.sax.ContentHandler.startDocument()
- * Receive notification of the beginning of a document.
- */
- @Override
- public void startDocument() throws SAXException {
- // Make sure setResult() was called before the first SAX event
- if (_result == null) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_SET_RESULT_ERR);
- throw new SAXException(err.toString());
- }
-
- if (!_isIdentity) {
- boolean hasIdCall = (_translet != null) ? _translet.hasIdCall() : false;
- XSLTCDTMManager dtmManager = null;
-
- // Create an internal DOM (not W3C) and get SAX2 input handler
- try {
- dtmManager = _transformer.getTransformerFactory()
- .createNewDTMManagerInstance();
- } catch (Exception e) {
- throw new SAXException(e);
- }
-
- DTMWSFilter wsFilter;
- if (_translet != null && _translet instanceof StripFilter) {
- wsFilter = new DOMWSFilter(_translet);
- } else {
- wsFilter = null;
- }
-
- // Construct the DTM using the SAX events that come through
- _dom = (SAXImpl)dtmManager.getDTM(null, false, wsFilter, true,
- false, hasIdCall);
-
- _handler = _dom.getBuilder();
- _lexHandler = (LexicalHandler) _handler;
- _dtdHandler = (DTDHandler) _handler;
- _declHandler = (DeclHandler) _handler;
-
-
- // Set document URI
- _dom.setDocumentURI(_systemId);
-
- if (_locator != null) {
- _handler.setDocumentLocator(_locator);
- }
- }
-
- // Proxy call
- _handler.startDocument();
- }
-
- /**
- * Implements org.xml.sax.ContentHandler.endDocument()
- * Receive notification of the end of a document.
- */
- @Override
- public void endDocument() throws SAXException {
- // Signal to the DOMBuilder that the document is complete
- _handler.endDocument();
-
- if (!_isIdentity) {
- // Run the transformation now if we have a reference to a Result object
- if (_result != null) {
- try {
- _transformer.setDOM(_dom);
- _transformer.transform(null, _result);
- }
- catch (TransformerException e) {
- throw new SAXException(e);
- }
- }
- // Signal that the internal DOM is built (see 'setResult()').
- _done = true;
-
- // Set this DOM as the transformer's DOM
- _transformer.setDOM(_dom);
- }
- if (_isIdentity && _result instanceof DOMResult) {
- ((DOMResult)_result).setNode(_transformer.getTransletOutputHandlerFactory().getNode());
- }
- }
-
- /**
- * Implements org.xml.sax.ContentHandler.startElement()
- * Receive notification of the beginning of an element.
- */
- @Override
- public void startElement(String uri, String localName,
- String qname, Attributes attributes)
- throws SAXException
- {
- _handler.startElement(uri, localName, qname, attributes);
- }
-
- /**
- * Implements org.xml.sax.ContentHandler.endElement()
- * Receive notification of the end of an element.
- */
- @Override
- public void endElement(String namespaceURI, String localName, String qname)
- throws SAXException
- {
- _handler.endElement(namespaceURI, localName, qname);
- }
-
- /**
- * Implements org.xml.sax.ContentHandler.processingInstruction()
- * Receive notification of a processing instruction.
- */
- @Override
- public void processingInstruction(String target, String data)
- throws SAXException
- {
- _handler.processingInstruction(target, data);
- }
-
- /**
- * Implements org.xml.sax.ext.LexicalHandler.startCDATA()
- */
- @Override
- public void startCDATA() throws SAXException {
- if (_lexHandler != null) {
- _lexHandler.startCDATA();
- }
- }
-
- /**
- * Implements org.xml.sax.ext.LexicalHandler.endCDATA()
- */
- @Override
- public void endCDATA() throws SAXException {
- if (_lexHandler != null) {
- _lexHandler.endCDATA();
- }
- }
-
- /**
- * Implements org.xml.sax.ext.LexicalHandler.comment()
- * Receieve notification of a comment
- */
- @Override
- public void comment(char[] ch, int start, int length)
- throws SAXException
- {
- if (_lexHandler != null) {
- _lexHandler.comment(ch, start, length);
- }
- }
-
- /**
- * Implements org.xml.sax.ContentHandler.ignorableWhitespace()
- * Receive notification of ignorable whitespace in element
- * content. Similar to characters(char[], int, int).
- */
- @Override
- public void ignorableWhitespace(char[] ch, int start, int length)
- throws SAXException
- {
- _handler.ignorableWhitespace(ch, start, length);
- }
-
- /**
- * Implements org.xml.sax.ContentHandler.setDocumentLocator()
- * Receive an object for locating the origin of SAX document events.
- */
- @Override
- public void setDocumentLocator(Locator locator) {
- _locator = locator;
-
- if (_handler != null) {
- _handler.setDocumentLocator(locator);
- }
- }
-
- /**
- * Implements org.xml.sax.ContentHandler.skippedEntity()
- * Receive notification of a skipped entity.
- */
- @Override
- public void skippedEntity(String name) throws SAXException {
- _handler.skippedEntity(name);
- }
-
- /**
- * Implements org.xml.sax.ContentHandler.startPrefixMapping()
- * Begin the scope of a prefix-URI Namespace mapping.
- */
- @Override
- public void startPrefixMapping(String prefix, String uri)
- throws SAXException {
- _handler.startPrefixMapping(prefix, uri);
- }
-
- /**
- * Implements org.xml.sax.ContentHandler.endPrefixMapping()
- * End the scope of a prefix-URI Namespace mapping.
- */
- @Override
- public void endPrefixMapping(String prefix) throws SAXException {
- _handler.endPrefixMapping(prefix);
- }
-
- /**
- * Implements org.xml.sax.ext.LexicalHandler.startDTD()
- */
- @Override
- public void startDTD(String name, String publicId, String systemId)
- throws SAXException
- {
- if (_lexHandler != null) {
- _lexHandler.startDTD(name, publicId, systemId);
- }
- }
-
- /**
- * Implements org.xml.sax.ext.LexicalHandler.endDTD()
- */
- @Override
- public void endDTD() throws SAXException {
- if (_lexHandler != null) {
- _lexHandler.endDTD();
- }
- }
-
- /**
- * Implements org.xml.sax.ext.LexicalHandler.startEntity()
- */
- @Override
- public void startEntity(String name) throws SAXException {
- if (_lexHandler != null) {
- _lexHandler.startEntity(name);
- }
- }
-
- /**
- * Implements org.xml.sax.ext.LexicalHandler.endEntity()
- */
- @Override
- public void endEntity(String name) throws SAXException {
- if (_lexHandler != null) {
- _lexHandler.endEntity(name);
- }
- }
-
- /**
- * Implements org.xml.sax.DTDHandler.unparsedEntityDecl()
- */
- @Override
- public void unparsedEntityDecl(String name, String publicId,
- String systemId, String notationName) throws SAXException
- {
- if (_dtdHandler != null) {
- _dtdHandler.unparsedEntityDecl(name, publicId, systemId,
- notationName);
- }
- }
-
- /**
- * Implements org.xml.sax.DTDHandler.notationDecl()
- */
- @Override
- public void notationDecl(String name, String publicId, String systemId)
- throws SAXException
- {
- if (_dtdHandler != null) {
- _dtdHandler.notationDecl(name, publicId, systemId);
- }
- }
-
- /**
- * Implements org.xml.sax.ext.DeclHandler.attributeDecl()
- */
- @Override
- public void attributeDecl(String eName, String aName, String type,
- String valueDefault, String value) throws SAXException
- {
- if (_declHandler != null) {
- _declHandler.attributeDecl(eName, aName, type, valueDefault, value);
- }
- }
-
- /**
- * Implements org.xml.sax.ext.DeclHandler.elementDecl()
- */
- @Override
- public void elementDecl(String name, String model)
- throws SAXException
- {
- if (_declHandler != null) {
- _declHandler.elementDecl(name, model);
- }
- }
-
- /**
- * Implements org.xml.sax.ext.DeclHandler.externalEntityDecl()
- */
- @Override
- public void externalEntityDecl(String name, String publicId, String systemId)
- throws SAXException
- {
- if (_declHandler != null) {
- _declHandler.externalEntityDecl(name, publicId, systemId);
- }
- }
-
- /**
- * Implements org.xml.sax.ext.DeclHandler.externalEntityDecl()
- */
- @Override
- public void internalEntityDecl(String name, String value)
- throws SAXException
- {
- if (_declHandler != null) {
- _declHandler.internalEntityDecl(name, value);
- }
- }
-
-
- /** Implementation of the reset() method
- *
- */
- public void reset() {
- _systemId = null;
- _dom = null;
- _handler = null;
- _lexHandler = null;
- _dtdHandler = null;
- _declHandler = null;
- _result = null;
- _locator = null;
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java b/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java
deleted file mode 100644
index 2dddac5..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java
+++ /dev/null
@@ -1,1412 +0,0 @@
-/*
- * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: TransformerImpl.java,v 1.10 2007/06/13 01:57:09 joehw Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.trax;
-
-import com.sun.org.apache.xalan.internal.XalanConstants;
-import com.sun.org.apache.xalan.internal.utils.FactoryImpl;
-import com.sun.org.apache.xalan.internal.utils.XMLSecurityManager;
-import com.sun.org.apache.xalan.internal.xsltc.DOM;
-import com.sun.org.apache.xalan.internal.xsltc.DOMCache;
-import com.sun.org.apache.xalan.internal.xsltc.StripFilter;
-import com.sun.org.apache.xalan.internal.xsltc.Translet;
-import com.sun.org.apache.xalan.internal.xsltc.TransletException;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.dom.DOMWSFilter;
-import com.sun.org.apache.xalan.internal.xsltc.dom.SAXImpl;
-import com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.output.TransletOutputHandlerFactory;
-import com.sun.org.apache.xml.internal.dtm.DTMWSFilter;
-import com.sun.org.apache.xml.internal.serializer.OutputPropertiesFactory;
-import com.sun.org.apache.xml.internal.serializer.SerializationHandler;
-import com.sun.org.apache.xml.internal.utils.SystemIDResolver;
-import com.sun.org.apache.xml.internal.utils.XMLReaderManager;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.Reader;
-import java.io.Writer;
-import java.net.URI;
-import java.net.URL;
-import java.net.URLConnection;
-import java.net.UnknownServiceException;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-import java.util.StringTokenizer;
-import java.util.Vector;
-import javax.xml.XMLConstants;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.stream.XMLEventReader;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.transform.ErrorListener;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.URIResolver;
-import javax.xml.transform.dom.DOMResult;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.sax.SAXResult;
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.transform.stax.StAXResult;
-import javax.xml.transform.stax.StAXSource;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.stream.StreamSource;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.ext.LexicalHandler;
-
-/**
- * @author Morten Jorgensen
- * @author G. Todd Miller
- * @author Santiago Pericas-Geertsen
- */
-public final class TransformerImpl extends Transformer
- implements DOMCache, ErrorListener
-{
-
- private final static String LEXICAL_HANDLER_PROPERTY =
- "http://xml.org/sax/properties/lexical-handler";
- private static final String NAMESPACE_FEATURE =
- "http://xml.org/sax/features/namespaces";
-
- /**
- * Namespace prefixes feature for {@link XMLReader}.
- */
- private static final String NAMESPACE_PREFIXES_FEATURE =
- "http://xml.org/sax/features/namespace-prefixes";
-
- /**
- * A reference to the translet or null if the identity transform.
- */
- private AbstractTranslet _translet = null;
-
- /**
- * The output method of this transformation.
- */
- private String _method = null;
-
- /**
- * The output encoding of this transformation.
- */
- private String _encoding = null;
-
- /**
- * The systemId set in input source.
- */
- private String _sourceSystemId = null;
-
- /**
- * An error listener for runtime errors.
- */
- private ErrorListener _errorListener = this;
-
- /**
- * A reference to a URI resolver for calls to document().
- */
- private URIResolver _uriResolver = null;
-
- /**
- * Output properties of this transformer instance.
- */
- private Properties _properties, _propertiesClone;
-
- /**
- * A reference to an output handler factory.
- */
- private TransletOutputHandlerFactory _tohFactory = null;
-
- /**
- * A reference to a internal DOM representation of the input.
- */
- private DOM _dom = null;
-
- /**
- * Number of indent spaces to add when indentation is on.
- */
- private int _indentNumber;
-
- /**
- * A reference to the transformer factory that this templates
- * object belongs to.
- */
- private TransformerFactoryImpl _tfactory = null;
-
- /**
- * A reference to the output stream, if we create one in our code.
- */
- private OutputStream _ostream = null;
-
- /**
- * A reference to the XSLTCDTMManager which is used to build the DOM/DTM
- * for this transformer.
- */
- private XSLTCDTMManager _dtmManager = null;
-
- /**
- * A reference to an object that creates and caches XMLReader objects.
- */
- private XMLReaderManager _readerManager;
-
- /**
- * A flag indicating whether we use incremental building of the DTM.
- */
- //private boolean _isIncremental = false;
-
- /**
- * A flag indicating whether this transformer implements the identity
- * transform.
- */
- private boolean _isIdentity = false;
-
- /**
- * State of the secure processing feature.
- */
- private boolean _isSecureProcessing = false;
-
- /**
- * Indicates whether implementation parts should use
- * service loader (or similar).
- * Note the default value (false) is the safe option..
- */
- private boolean _useServicesMechanism;
- /**
- * protocols allowed for external references set by the stylesheet processing instruction, Import and Include element.
- */
- private String _accessExternalStylesheet = XalanConstants.EXTERNAL_ACCESS_DEFAULT;
- /**
- * protocols allowed for external DTD references in source file and/or stylesheet.
- */
- private String _accessExternalDTD = XalanConstants.EXTERNAL_ACCESS_DEFAULT;
-
- private XMLSecurityManager _securityManager;
- /**
- * A map to store parameters for the identity transform. These
- * are not needed during the transformation, but we must keep track of
- * them to be fully complaint with the JAXP API.
- */
- private Map<String, Object> _parameters = null;
-
- /**
- * This class wraps an ErrorListener into a MessageHandler in order to
- * capture messages reported via xsl:message.
- */
- static class MessageHandler
- extends com.sun.org.apache.xalan.internal.xsltc.runtime.MessageHandler
- {
- private ErrorListener _errorListener;
-
- public MessageHandler(ErrorListener errorListener) {
- _errorListener = errorListener;
- }
-
- @Override
- public void displayMessage(String msg) {
- if(_errorListener == null) {
- System.err.println(msg);
- }
- else {
- try {
- _errorListener.warning(new TransformerException(msg));
- }
- catch (TransformerException e) {
- // ignored
- }
- }
- }
- }
-
- protected TransformerImpl(Properties outputProperties, int indentNumber,
- TransformerFactoryImpl tfactory)
- {
- this(null, outputProperties, indentNumber, tfactory);
- _isIdentity = true;
- // _properties.put(OutputKeys.METHOD, "xml");
- }
-
- protected TransformerImpl(Translet translet, Properties outputProperties,
- int indentNumber, TransformerFactoryImpl tfactory)
- {
- _translet = (AbstractTranslet) translet;
- _properties = createOutputProperties(outputProperties);
- _propertiesClone = (Properties) _properties.clone();
- _indentNumber = indentNumber;
- _tfactory = tfactory;
- _useServicesMechanism = _tfactory.useServicesMechnism();
- _accessExternalStylesheet = (String)_tfactory.getAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET);
- _accessExternalDTD = (String)_tfactory.getAttribute(XMLConstants.ACCESS_EXTERNAL_DTD);
- _securityManager = (XMLSecurityManager)_tfactory.getAttribute(XalanConstants.SECURITY_MANAGER);
- _readerManager = XMLReaderManager.getInstance(_useServicesMechanism);
- _readerManager.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, _accessExternalDTD);
- _readerManager.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, _isSecureProcessing);
- _readerManager.setProperty(XalanConstants.SECURITY_MANAGER, _securityManager);
- //_isIncremental = tfactory._incremental;
- }
-
- /**
- * Return the state of the secure processing feature.
- */
- public boolean isSecureProcessing() {
- return _isSecureProcessing;
- }
-
- /**
- * Set the state of the secure processing feature.
- */
- public void setSecureProcessing(boolean flag) {
- _isSecureProcessing = flag;
- _readerManager.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, _isSecureProcessing);
- }
- /**
- * Return the state of the services mechanism feature.
- */
- public boolean useServicesMechnism() {
- return _useServicesMechanism;
- }
-
- /**
- * Set the state of the services mechanism feature.
- */
- public void setServicesMechnism(boolean flag) {
- _useServicesMechanism = flag;
- }
-
- /**
- * Returns the translet wrapped inside this Transformer or
- * null if this is the identity transform.
- */
- protected AbstractTranslet getTranslet() {
- return _translet;
- }
-
- public boolean isIdentity() {
- return _isIdentity;
- }
-
- /**
- * Implements JAXP's Transformer.transform()
- *
- * @param source Contains the input XML document
- * @param result Will contain the output from the transformation
- * @throws TransformerException
- */
- @Override
- public void transform(Source source, Result result)
- throws TransformerException
- {
- if (!_isIdentity) {
- if (_translet == null) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_TRANSLET_ERR);
- throw new TransformerException(err.toString());
- }
- // Pass output properties to the translet
- transferOutputProperties(_translet);
- }
-
- final SerializationHandler toHandler = getOutputHandler(result);
- if (toHandler == null) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_HANDLER_ERR);
- throw new TransformerException(err.toString());
- }
-
- if (_uriResolver != null && !_isIdentity) {
- _translet.setDOMCache(this);
- }
-
- // Pass output properties to handler if identity
- if (_isIdentity) {
- transferOutputProperties(toHandler);
- }
-
- transform(source, toHandler, _encoding);
- try{
- if (result instanceof DOMResult) {
- ((DOMResult)result).setNode(_tohFactory.getNode());
- } else if (result instanceof StAXResult) {
- if (((StAXResult) result).getXMLEventWriter() != null)
- {
- (_tohFactory.getXMLEventWriter()).flush();
- }
- else if (((StAXResult) result).getXMLStreamWriter() != null) {
- (_tohFactory.getXMLStreamWriter()).flush();
- //result = new StAXResult(_tohFactory.getXMLStreamWriter());
- }
- }
- } catch (Exception e) {
- System.out.println("Result writing error");
- }
- }
-
- /**
- * Create an output handler for the transformation output based on
- * the type and contents of the TrAX Result object passed to the
- * transform() method.
- */
- public SerializationHandler getOutputHandler(Result result)
- throws TransformerException
- {
- // Get output method using get() to ignore defaults
- _method = (String) _properties.get(OutputKeys.METHOD);
-
- // Get encoding using getProperty() to use defaults
- _encoding = (String) _properties.getProperty(OutputKeys.ENCODING);
-
- _tohFactory = TransletOutputHandlerFactory.newInstance(_useServicesMechanism);
- _tohFactory.setEncoding(_encoding);
- if (_method != null) {
- _tohFactory.setOutputMethod(_method);
- }
-
- // Set indentation number in the factory
- if (_indentNumber >= 0) {
- _tohFactory.setIndentNumber(_indentNumber);
- }
-
- // Return the content handler for this Result object
- try {
- // Result object could be SAXResult, DOMResult, or StreamResult
- if (result instanceof SAXResult) {
- final SAXResult target = (SAXResult)result;
- final ContentHandler handler = target.getHandler();
-
- _tohFactory.setHandler(handler);
-
- /**
- * Fix for bug 24414
- * If the lexicalHandler is set then we need to get that
- * for obtaining the lexical information
- */
- LexicalHandler lexicalHandler = target.getLexicalHandler();
-
- if (lexicalHandler != null ) {
- _tohFactory.setLexicalHandler(lexicalHandler);
- }
-
- _tohFactory.setOutputType(TransletOutputHandlerFactory.SAX);
- return _tohFactory.getSerializationHandler();
- }
- else if (result instanceof StAXResult) {
- if (((StAXResult) result).getXMLEventWriter() != null)
- _tohFactory.setXMLEventWriter(((StAXResult) result).getXMLEventWriter());
- else if (((StAXResult) result).getXMLStreamWriter() != null)
- _tohFactory.setXMLStreamWriter(((StAXResult) result).getXMLStreamWriter());
- _tohFactory.setOutputType(TransletOutputHandlerFactory.STAX);
- return _tohFactory.getSerializationHandler();
- }
- else if (result instanceof DOMResult) {
- _tohFactory.setNode(((DOMResult) result).getNode());
- _tohFactory.setNextSibling(((DOMResult) result).getNextSibling());
- _tohFactory.setOutputType(TransletOutputHandlerFactory.DOM);
- return _tohFactory.getSerializationHandler();
- }
- else if (result instanceof StreamResult) {
- // Get StreamResult
- final StreamResult target = (StreamResult) result;
-
- // StreamResult may have been created with a java.io.File,
- // java.io.Writer, java.io.OutputStream or just a String
- // systemId.
-
- _tohFactory.setOutputType(TransletOutputHandlerFactory.STREAM);
-
- // try to get a Writer from Result object
- final Writer writer = target.getWriter();
- if (writer != null) {
- _tohFactory.setWriter(writer);
- return _tohFactory.getSerializationHandler();
- }
-
- // or try to get an OutputStream from Result object
- final OutputStream ostream = target.getOutputStream();
- if (ostream != null) {
- _tohFactory.setOutputStream(ostream);
- return _tohFactory.getSerializationHandler();
- }
-
- // or try to get just a systemId string from Result object
- String systemId = result.getSystemId();
- if (systemId == null) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_RESULT_ERR);
- throw new TransformerException(err.toString());
- }
-
- // System Id may be in one of several forms, (1) a uri
- // that starts with 'file:', (2) uri that starts with 'http:'
- // or (3) just a filename on the local system.
- URL url;
- if (systemId.startsWith("file:")) {
- // if StreamResult(File) or setSystemID(File) was used,
- // the systemId will be URI encoded as a result of File.toURI(),
- // it must be decoded for use by URL
- try{
- URI uri = new URI(systemId) ;
- systemId = "file:";
-
- String host = uri.getHost(); // decoded String
- String path = uri.getPath(); //decoded String
- if (path == null) {
- path = "";
- }
-
- // if host (URI authority) then file:// + host + path
- // else just path (may be absolute or relative)
- if (host != null) {
- systemId += "//" + host + path;
- } else {
- systemId += "//" + path;
- }
- }
- catch (Exception exception) {
- // URI exception which means nothing can be done so OK to ignore
- }
-
- url = new URL(systemId);
- _ostream = new FileOutputStream(url.getFile());
- _tohFactory.setOutputStream(_ostream);
- return _tohFactory.getSerializationHandler();
- }
- else if (systemId.startsWith("http:")) {
- url = new URL(systemId);
- final URLConnection connection = url.openConnection();
- _tohFactory.setOutputStream(_ostream = connection.getOutputStream());
- return _tohFactory.getSerializationHandler();
- }
- else {
- // system id is just a filename
- _tohFactory.setOutputStream(
- _ostream = new FileOutputStream(new File(systemId)));
- return _tohFactory.getSerializationHandler();
- }
- }
- }
- // If we cannot write to the location specified by the SystemId
- catch (UnknownServiceException e) {
- throw new TransformerException(e);
- }
- catch (ParserConfigurationException e) {
- throw new TransformerException(e);
- }
- // If we cannot create the file specified by the SystemId
- catch (IOException e) {
- throw new TransformerException(e);
- }
- return null;
- }
-
- /**
- * Set the internal DOM that will be used for the next transformation
- */
- protected void setDOM(DOM dom) {
- _dom = dom;
- }
-
- /**
- * Builds an internal DOM from a TrAX Source object
- */
- private DOM getDOM(Source source) throws TransformerException {
- try {
- DOM dom;
-
- if (source != null) {
- DTMWSFilter wsfilter;
- if (_translet != null && _translet instanceof StripFilter) {
- wsfilter = new DOMWSFilter(_translet);
- } else {
- wsfilter = null;
- }
-
- boolean hasIdCall = (_translet != null) ? _translet.hasIdCall()
- : false;
-
- if (_dtmManager == null) {
- _dtmManager =
- _tfactory.createNewDTMManagerInstance();
- _dtmManager.setServicesMechnism(_useServicesMechanism);
- }
- dom = (DOM)_dtmManager.getDTM(source, false, wsfilter, true,
- false, false, 0, hasIdCall);
- } else if (_dom != null) {
- dom = _dom;
- _dom = null; // use only once, so reset to 'null'
- } else {
- return null;
- }
-
- if (!_isIdentity) {
- // Give the translet the opportunity to make a prepass of
- // the document, in case it can extract useful information early
- _translet.prepassDocument(dom);
- }
-
- return dom;
-
- }
- catch (Exception e) {
- if (_errorListener != null) {
- postErrorToListener(e.getMessage());
- }
- throw new TransformerException(e);
- }
- }
-
- /**
- * Returns the {@link com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl}
- * object that create this <code>Transformer</code>.
- */
- protected TransformerFactoryImpl getTransformerFactory() {
- return _tfactory;
- }
-
- /**
- * Returns the {@link com.sun.org.apache.xalan.internal.xsltc.runtime.output.TransletOutputHandlerFactory}
- * object that create the <code>TransletOutputHandler</code>.
- */
- protected TransletOutputHandlerFactory getTransletOutputHandlerFactory() {
- return _tohFactory;
- }
-
- private void transformIdentity(Source source, SerializationHandler handler)
- throws Exception
- {
- // Get systemId from source
- if (source != null) {
- _sourceSystemId = source.getSystemId();
- }
-
- if (source instanceof StreamSource) {
- final StreamSource stream = (StreamSource) source;
- final InputStream streamInput = stream.getInputStream();
- final Reader streamReader = stream.getReader();
- final XMLReader reader = _readerManager.getXMLReader();
-
- try {
- // Hook up reader and output handler
- try {
- reader.setProperty(LEXICAL_HANDLER_PROPERTY, handler);
- reader.setFeature(NAMESPACE_PREFIXES_FEATURE, true);
- } catch (SAXException e) {
- // Falls through
- }
- reader.setContentHandler(handler);
-
- // Create input source from source
- InputSource input;
- if (streamInput != null) {
- input = new InputSource(streamInput);
- input.setSystemId(_sourceSystemId);
- }
- else if (streamReader != null) {
- input = new InputSource(streamReader);
- input.setSystemId(_sourceSystemId);
- }
- else if (_sourceSystemId != null) {
- input = new InputSource(_sourceSystemId);
- }
- else {
- ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_SOURCE_ERR);
- throw new TransformerException(err.toString());
- }
-
- // Start pushing SAX events
- reader.parse(input);
- } finally {
- _readerManager.releaseXMLReader(reader);
- }
- } else if (source instanceof SAXSource) {
- final SAXSource sax = (SAXSource) source;
- XMLReader reader = sax.getXMLReader();
- final InputSource input = sax.getInputSource();
- boolean userReader = true;
-
- try {
- // Create a reader if not set by user
- if (reader == null) {
- reader = _readerManager.getXMLReader();
- userReader = false;
- }
-
- // Hook up reader and output handler
- try {
- reader.setProperty(LEXICAL_HANDLER_PROPERTY, handler);
- reader.setFeature(NAMESPACE_PREFIXES_FEATURE, true);
- } catch (SAXException e) {
- // Falls through
- }
- reader.setContentHandler(handler);
-
- // Start pushing SAX events
- reader.parse(input);
- } finally {
- if (!userReader) {
- _readerManager.releaseXMLReader(reader);
- }
- }
- } else if (source instanceof StAXSource) {
- final StAXSource staxSource = (StAXSource)source;
- StAXEvent2SAX staxevent2sax;
- StAXStream2SAX staxStream2SAX;
- if (staxSource.getXMLEventReader() != null) {
- final XMLEventReader xmlEventReader = staxSource.getXMLEventReader();
- staxevent2sax = new StAXEvent2SAX(xmlEventReader);
- staxevent2sax.setContentHandler(handler);
- staxevent2sax.parse();
- handler.flushPending();
- } else if (staxSource.getXMLStreamReader() != null) {
- final XMLStreamReader xmlStreamReader = staxSource.getXMLStreamReader();
- staxStream2SAX = new StAXStream2SAX(xmlStreamReader);
- staxStream2SAX.setContentHandler(handler);
- staxStream2SAX.parse();
- handler.flushPending();
- }
- } else if (source instanceof DOMSource) {
- final DOMSource domsrc = (DOMSource) source;
- new DOM2TO(domsrc.getNode(), handler).parse();
- } else if (source instanceof XSLTCSource) {
- final DOM dom = ((XSLTCSource) source).getDOM(null, _translet);
- ((SAXImpl)dom).copy(handler);
- } else {
- ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_SOURCE_ERR);
- throw new TransformerException(err.toString());
- }
- }
-
- /**
- * Internal transformation method - uses the internal APIs of XSLTC
- */
- private void transform(Source source, SerializationHandler handler,
- String encoding) throws TransformerException
- {
- try {
- /*
- * According to JAXP1.2, new SAXSource()/StreamSource()
- * should create an empty input tree, with a default root node.
- * new DOMSource()creates an empty document using DocumentBuilder.
- * newDocument(); Use DocumentBuilder.newDocument() for all 3
- * situations, since there is no clear spec. how to create
- * an empty tree when both SAXSource() and StreamSource() are used.
- */
- if ((source instanceof StreamSource && source.getSystemId()==null
- && ((StreamSource)source).getInputStream()==null &&
- ((StreamSource)source).getReader()==null)||
- (source instanceof SAXSource &&
- ((SAXSource)source).getInputSource()==null &&
- ((SAXSource)source).getXMLReader()==null )||
- (source instanceof DOMSource &&
- ((DOMSource)source).getNode()==null)){
- DocumentBuilderFactory builderF = FactoryImpl.getDOMFactory(_useServicesMechanism);
- DocumentBuilder builder = builderF.newDocumentBuilder();
- String systemID = source.getSystemId();
- source = new DOMSource(builder.newDocument());
-
- // Copy system ID from original, empty Source to new
- if (systemID != null) {
- source.setSystemId(systemID);
- }
- }
- if (_isIdentity) {
- transformIdentity(source, handler);
- } else {
- _translet.transform(getDOM(source), handler);
- }
- } catch (TransletException e) {
- if (_errorListener != null) postErrorToListener(e.getMessage());
- throw new TransformerException(e);
- } catch (RuntimeException e) {
- if (_errorListener != null) postErrorToListener(e.getMessage());
- throw new TransformerException(e);
- } catch (Exception e) {
- if (_errorListener != null) postErrorToListener(e.getMessage());
- throw new TransformerException(e);
- } finally {
- _dtmManager = null;
- }
-
- // If we create an output stream for the Result, we need to close it after the transformation.
- if (_ostream != null) {
- try {
- _ostream.close();
- }
- catch (IOException e) {}
- _ostream = null;
- }
- }
-
- /**
- * Implements JAXP's Transformer.getErrorListener()
- * Get the error event handler in effect for the transformation.
- *
- * @return The error event handler currently in effect
- */
- @Override
- public ErrorListener getErrorListener() {
- return _errorListener;
- }
-
- /**
- * Implements JAXP's Transformer.setErrorListener()
- * Set the error event listener in effect for the transformation.
- * Register a message handler in the translet in order to forward
- * xsl:messages to error listener.
- *
- * @param listener The error event listener to use
- * @throws IllegalArgumentException
- */
- @Override
- public void setErrorListener(ErrorListener listener)
- throws IllegalArgumentException {
- if (listener == null) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.ERROR_LISTENER_NULL_ERR,
- "Transformer");
- throw new IllegalArgumentException(err.toString());
- }
- _errorListener = listener;
-
- // Register a message handler to report xsl:messages
- if (_translet != null)
- _translet.setMessageHandler(new MessageHandler(_errorListener));
- }
-
- /**
- * Inform TrAX error listener of an error
- */
- private void postErrorToListener(String message) {
- try {
- _errorListener.error(new TransformerException(message));
- }
- catch (TransformerException e) {
- // ignored - transformation cannot be continued
- }
- }
-
- /**
- * Inform TrAX error listener of a warning
- */
- private void postWarningToListener(String message) {
- try {
- _errorListener.warning(new TransformerException(message));
- }
- catch (TransformerException e) {
- // ignored - transformation cannot be continued
- }
- }
-
- /**
- * Implements JAXP's Transformer.getOutputProperties().
- * Returns a copy of the output properties for the transformation. This is
- * a set of layered properties. The first layer contains properties set by
- * calls to setOutputProperty() and setOutputProperties() on this class,
- * and the output settings defined in the stylesheet's <xsl:output>
- * element makes up the second level, while the default XSLT output
- * settings are returned on the third level.
- *
- * @return Properties in effect for this Transformer
- */
- @Override
- public Properties getOutputProperties() {
- return (Properties) _properties.clone();
- }
-
- /**
- * Implements JAXP's Transformer.getOutputProperty().
- * Get an output property that is in effect for the transformation. The
- * property specified may be a property that was set with setOutputProperty,
- * or it may be a property specified in the stylesheet.
- *
- * @param name A non-null string that contains the name of the property
- * @throws IllegalArgumentException if the property name is not known
- */
- @Override
- public String getOutputProperty(String name)
- throws IllegalArgumentException
- {
- if (!validOutputProperty(name)) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNKNOWN_PROP_ERR, name);
- throw new IllegalArgumentException(err.toString());
- }
- return _properties.getProperty(name);
- }
-
- /**
- * Implements JAXP's Transformer.setOutputProperties().
- * Set the output properties for the transformation. These properties
- * will override properties set in the Templates with xsl:output.
- * Unrecognised properties will be quitely ignored.
- *
- * @param properties The properties to use for the Transformer
- * @throws IllegalArgumentException Never, errors are ignored
- */
- @Override
- public void setOutputProperties(Properties properties)
- throws IllegalArgumentException
- {
- if (properties != null) {
- final Enumeration names = properties.propertyNames();
-
- while (names.hasMoreElements()) {
- final String name = (String) names.nextElement();
-
- // Ignore lower layer properties
- if (isDefaultProperty(name, properties)) continue;
-
- if (validOutputProperty(name)) {
- _properties.setProperty(name, properties.getProperty(name));
- }
- else {
- ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNKNOWN_PROP_ERR, name);
- throw new IllegalArgumentException(err.toString());
- }
- }
- }
- else {
- _properties = _propertiesClone;
- }
- }
-
- /**
- * Implements JAXP's Transformer.setOutputProperty().
- * Get an output property that is in effect for the transformation. The
- * property specified may be a property that was set with
- * setOutputProperty(), or it may be a property specified in the stylesheet.
- *
- * @param name The name of the property to set
- * @param value The value to assign to the property
- * @throws IllegalArgumentException Never, errors are ignored
- */
- @Override
- public void setOutputProperty(String name, String value)
- throws IllegalArgumentException
- {
- if (!validOutputProperty(name)) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNKNOWN_PROP_ERR, name);
- throw new IllegalArgumentException(err.toString());
- }
- _properties.setProperty(name, value);
- }
-
- /**
- * Internal method to pass any properties to the translet prior to
- * initiating the transformation
- */
- private void transferOutputProperties(AbstractTranslet translet)
- {
- // Return right now if no properties are set
- if (_properties == null) return;
-
- // Get a list of all the defined properties
- Enumeration names = _properties.propertyNames();
- while (names.hasMoreElements()) {
- // Note the use of get() instead of getProperty()
- String name = (String) names.nextElement();
- String value = (String) _properties.get(name);
-
- // Ignore default properties
- if (value == null) continue;
-
- // Pass property value to translet - override previous setting
- if (name.equals(OutputKeys.ENCODING)) {
- translet._encoding = value;
- }
- else if (name.equals(OutputKeys.METHOD)) {
- translet._method = value;
- }
- else if (name.equals(OutputKeys.DOCTYPE_PUBLIC)) {
- translet._doctypePublic = value;
- }
- else if (name.equals(OutputKeys.DOCTYPE_SYSTEM)) {
- translet._doctypeSystem = value;
- }
- else if (name.equals(OutputKeys.MEDIA_TYPE)) {
- translet._mediaType = value;
- }
- else if (name.equals(OutputKeys.STANDALONE)) {
- translet._standalone = value;
- }
- else if (name.equals(OutputKeys.VERSION)) {
- translet._version = value;
- }
- else if (name.equals(OutputKeys.OMIT_XML_DECLARATION)) {
- translet._omitHeader =
- (value != null && value.toLowerCase().equals("yes"));
- }
- else if (name.equals(OutputKeys.INDENT)) {
- translet._indent =
- (value != null && value.toLowerCase().equals("yes"));
- }
- else if (name.equals(OutputPropertiesFactory.S_BUILTIN_OLD_EXTENSIONS_UNIVERSAL +"indent-amount")) {
- if (value != null) {
- translet._indentamount = Integer.parseInt(value);
- }
- }
- else if (name.equals(OutputPropertiesFactory.S_BUILTIN_EXTENSIONS_UNIVERSAL +"indent-amount")) {
- if (value != null) {
- translet._indentamount = Integer.parseInt(value);
- }
- }
- else if (name.equals(OutputKeys.CDATA_SECTION_ELEMENTS)) {
- if (value != null) {
- translet._cdata = null; // clear previous setting
- StringTokenizer e = new StringTokenizer(value);
- while (e.hasMoreTokens()) {
- translet.addCdataElement(e.nextToken());
- }
- }
- }
- else if (name.equals(OutputPropertiesFactory.ORACLE_IS_STANDALONE)) {
- if (value != null && value.equals("yes")) {
- translet._isStandalone = true;
- }
- }
- }
- }
-
- /**
- * This method is used to pass any properties to the output handler
- * when running the identity transform.
- */
- public void transferOutputProperties(SerializationHandler handler)
- {
- // Return right now if no properties are set
- if (_properties == null) return;
-
- String doctypePublic = null;
- String doctypeSystem = null;
-
- // Get a list of all the defined properties
- Enumeration names = _properties.propertyNames();
- while (names.hasMoreElements()) {
- // Note the use of get() instead of getProperty()
- String name = (String) names.nextElement();
- String value = (String) _properties.get(name);
-
- // Ignore default properties
- if (value == null) continue;
-
- // Pass property value to translet - override previous setting
- if (name.equals(OutputKeys.DOCTYPE_PUBLIC)) {
- doctypePublic = value;
- }
- else if (name.equals(OutputKeys.DOCTYPE_SYSTEM)) {
- doctypeSystem = value;
- }
- else if (name.equals(OutputKeys.MEDIA_TYPE)) {
- handler.setMediaType(value);
- }
- else if (name.equals(OutputKeys.STANDALONE)) {
- handler.setStandalone(value);
- }
- else if (name.equals(OutputKeys.VERSION)) {
- handler.setVersion(value);
- }
- else if (name.equals(OutputKeys.OMIT_XML_DECLARATION)) {
- handler.setOmitXMLDeclaration(
- value != null && value.toLowerCase().equals("yes"));
- }
- else if (name.equals(OutputKeys.INDENT)) {
- handler.setIndent(
- value != null && value.toLowerCase().equals("yes"));
- }
- else if (name.equals(OutputPropertiesFactory.S_BUILTIN_OLD_EXTENSIONS_UNIVERSAL +"indent-amount")) {
- if (value != null) {
- handler.setIndentAmount(Integer.parseInt(value));
- }
- }
- else if (name.equals(OutputPropertiesFactory.S_BUILTIN_EXTENSIONS_UNIVERSAL +"indent-amount")) {
- if (value != null) {
- handler.setIndentAmount(Integer.parseInt(value));
- }
- }
- else if (name.equals(OutputPropertiesFactory.ORACLE_IS_STANDALONE)) {
- if (value != null && value.equals("yes")) {
- handler.setIsStandalone(true);
- }
- }
- else if (name.equals(OutputKeys.CDATA_SECTION_ELEMENTS)) {
- if (value != null) {
- StringTokenizer e = new StringTokenizer(value);
- Vector uriAndLocalNames = null;
- while (e.hasMoreTokens()) {
- final String token = e.nextToken();
-
- // look for the last colon, as the String may be
- // something like "http://abc.com:local"
- int lastcolon = token.lastIndexOf(':');
- String uri;
- String localName;
- if (lastcolon > 0) {
- uri = token.substring(0, lastcolon);
- localName = token.substring(lastcolon+1);
- } else {
- // no colon at all, lets hope this is the
- // local name itself then
- uri = null;
- localName = token;
- }
-
- if (uriAndLocalNames == null) {
- uriAndLocalNames = new Vector();
- }
- // add the uri/localName as a pair, in that order
- uriAndLocalNames.addElement(uri);
- uriAndLocalNames.addElement(localName);
- }
- handler.setCdataSectionElements(uriAndLocalNames);
- }
- }
- }
-
- // Call setDoctype() if needed
- if (doctypePublic != null || doctypeSystem != null) {
- handler.setDoctype(doctypeSystem, doctypePublic);
- }
- }
-
- /**
- * Internal method to create the initial set of properties. There
- * are two layers of properties: the default layer and the base layer.
- * The latter contains properties defined in the stylesheet or by
- * the user using this API.
- */
- private Properties createOutputProperties(Properties outputProperties) {
- final Properties defaults = new Properties();
- setDefaults(defaults, "xml");
-
- // Copy propeties set in stylesheet to base
- final Properties base = new Properties(defaults);
- if (outputProperties != null) {
- final Enumeration names = outputProperties.propertyNames();
- while (names.hasMoreElements()) {
- final String name = (String) names.nextElement();
- base.setProperty(name, outputProperties.getProperty(name));
- }
- }
- else {
- base.setProperty(OutputKeys.ENCODING, _translet._encoding);
- if (_translet._method != null)
- base.setProperty(OutputKeys.METHOD, _translet._method);
- }
-
- // Update defaults based on output method
- final String method = base.getProperty(OutputKeys.METHOD);
- if (method != null) {
- if (method.equals("html")) {
- setDefaults(defaults,"html");
- }
- else if (method.equals("text")) {
- setDefaults(defaults,"text");
- }
- }
-
- return base;
- }
-
- /**
- * Internal method to get the default properties from the
- * serializer factory and set them on the property object.
- * @param props a java.util.Property object on which the properties are set.
- * @param method The output method type, one of "xml", "text", "html" ...
- */
- private void setDefaults(Properties props, String method)
- {
- final Properties method_props =
- OutputPropertiesFactory.getDefaultMethodProperties(method);
- {
- final Enumeration names = method_props.propertyNames();
- while (names.hasMoreElements())
- {
- final String name = (String)names.nextElement();
- props.setProperty(name, method_props.getProperty(name));
- }
- }
- }
- /**
- * Verifies if a given output property name is a property defined in
- * the JAXP 1.1 / TrAX spec
- */
- private boolean validOutputProperty(String name) {
- return (name.equals(OutputKeys.ENCODING) ||
- name.equals(OutputKeys.METHOD) ||
- name.equals(OutputKeys.INDENT) ||
- name.equals(OutputKeys.DOCTYPE_PUBLIC) ||
- name.equals(OutputKeys.DOCTYPE_SYSTEM) ||
- name.equals(OutputKeys.CDATA_SECTION_ELEMENTS) ||
- name.equals(OutputKeys.MEDIA_TYPE) ||
- name.equals(OutputKeys.OMIT_XML_DECLARATION) ||
- name.equals(OutputKeys.STANDALONE) ||
- name.equals(OutputKeys.VERSION) ||
- name.equals(OutputPropertiesFactory.ORACLE_IS_STANDALONE) ||
- name.charAt(0) == '{');
- }
-
- /**
- * Checks if a given output property is default (2nd layer only)
- */
- private boolean isDefaultProperty(String name, Properties properties) {
- return (properties.get(name) == null);
- }
-
- /**
- * Implements JAXP's Transformer.setParameter()
- * Add a parameter for the transformation. The parameter is simply passed
- * on to the translet - no validation is performed - so any unused
- * parameters are quitely ignored by the translet.
- *
- * @param name The name of the parameter
- * @param value The value to assign to the parameter
- */
- @Override
- public void setParameter(String name, Object value) {
-
- if (value == null) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_INVALID_SET_PARAM_VALUE, name);
- throw new IllegalArgumentException(err.toString());
- }
-
- if (_isIdentity) {
- if (_parameters == null) {
- _parameters = new HashMap<>();
- }
- _parameters.put(name, value);
- }
- else {
- _translet.addParameter(name, value);
- }
- }
-
- /**
- * Implements JAXP's Transformer.clearParameters()
- * Clear all parameters set with setParameter. Clears the translet's
- * parameter stack.
- */
- @Override
- public void clearParameters() {
- if (_isIdentity && _parameters != null) {
- _parameters.clear();
- }
- else {
- _translet.clearParameters();
- }
- }
-
- /**
- * Implements JAXP's Transformer.getParameter()
- * Returns the value of a given parameter. Note that the translet will not
- * keep values for parameters that were not defined in the stylesheet.
- *
- * @param name The name of the parameter
- * @return An object that contains the value assigned to the parameter
- */
- @Override
- public final Object getParameter(String name) {
- if (_isIdentity) {
- return (_parameters != null) ? _parameters.get(name) : null;
- }
- else {
- return _translet.getParameter(name);
- }
- }
-
- /**
- * Implements JAXP's Transformer.getURIResolver()
- * Set the object currently used to resolve URIs used in document().
- *
- * @return The URLResolver object currently in use
- */
- @Override
- public URIResolver getURIResolver() {
- return _uriResolver;
- }
-
- /**
- * Implements JAXP's Transformer.setURIResolver()
- * Set an object that will be used to resolve URIs used in document().
- *
- * @param resolver The URIResolver to use in document()
- */
- @Override
- public void setURIResolver(URIResolver resolver) {
- _uriResolver = resolver;
- }
-
- /**
- * This class should only be used as a DOMCache for the translet if the
- * URIResolver has been set.
- *
- * The method implements XSLTC's DOMCache interface, which is used to
- * plug in an external document loader into a translet. This method acts
- * as an adapter between TrAX's URIResolver interface and XSLTC's
- * DOMCache interface. This approach is simple, but removes the
- * possibility of using external document caches with XSLTC.
- *
- * @param baseURI The base URI used by the document call.
- * @param href The href argument passed to the document function.
- * @param translet A reference to the translet requesting the document
- */
- @Override
- public DOM retrieveDocument(String baseURI, String href, Translet translet) {
- try {
- // Argument to document function was: document('');
- if (href.length() == 0) {
- href = baseURI;
- }
-
- /*
- * Fix for bug 24188
- * Incase the _uriResolver.resolve(href,base) is null
- * try to still retrieve the document before returning null
- * and throwing the FileNotFoundException in
- * com.sun.org.apache.xalan.internal.xsltc.dom.LoadDocument
- *
- */
- Source resolvedSource = _uriResolver.resolve(href, baseURI);
- if (resolvedSource == null) {
- StreamSource streamSource = new StreamSource(
- SystemIDResolver.getAbsoluteURI(href, baseURI));
- return getDOM(streamSource) ;
- }
-
- return getDOM(resolvedSource);
- }
- catch (TransformerException e) {
- if (_errorListener != null)
- postErrorToListener("File not found: " + e.getMessage());
- return(null);
- }
- }
-
- /**
- * Receive notification of a recoverable error.
- * The transformer must continue to provide normal parsing events after
- * invoking this method. It should still be possible for the application
- * to process the document through to the end.
- *
- * @param e The warning information encapsulated in a transformer
- * exception.
- * @throws TransformerException if the application chooses to discontinue
- * the transformation (always does in our case).
- */
- @Override
- public void error(TransformerException e)
- throws TransformerException
- {
- Throwable wrapped = e.getException();
- if (wrapped != null) {
- System.err.println(new ErrorMsg(ErrorMsg.ERROR_PLUS_WRAPPED_MSG,
- e.getMessageAndLocation(),
- wrapped.getMessage()));
- } else {
- System.err.println(new ErrorMsg(ErrorMsg.ERROR_MSG,
- e.getMessageAndLocation()));
- }
- throw e;
- }
-
- /**
- * Receive notification of a non-recoverable error.
- * The application must assume that the transformation cannot continue
- * after the Transformer has invoked this method, and should continue
- * (if at all) only to collect addition error messages. In fact,
- * Transformers are free to stop reporting events once this method has
- * been invoked.
- *
- * @param e The warning information encapsulated in a transformer
- * exception.
- * @throws TransformerException if the application chooses to discontinue
- * the transformation (always does in our case).
- */
- @Override
- public void fatalError(TransformerException e)
- throws TransformerException
- {
- Throwable wrapped = e.getException();
- if (wrapped != null) {
- System.err.println(new ErrorMsg(ErrorMsg.FATAL_ERR_PLUS_WRAPPED_MSG,
- e.getMessageAndLocation(),
- wrapped.getMessage()));
- } else {
- System.err.println(new ErrorMsg(ErrorMsg.FATAL_ERR_MSG,
- e.getMessageAndLocation()));
- }
- throw e;
- }
-
- /**
- * Receive notification of a warning.
- * Transformers can use this method to report conditions that are not
- * errors or fatal errors. The default behaviour is to take no action.
- * After invoking this method, the Transformer must continue with the
- * transformation. It should still be possible for the application to
- * process the document through to the end.
- *
- * @param e The warning information encapsulated in a transformer
- * exception.
- * @throws TransformerException if the application chooses to discontinue
- * the transformation (never does in our case).
- */
- @Override
- public void warning(TransformerException e)
- throws TransformerException
- {
- Throwable wrapped = e.getException();
- if (wrapped != null) {
- System.err.println(new ErrorMsg(ErrorMsg.WARNING_PLUS_WRAPPED_MSG,
- e.getMessageAndLocation(),
- wrapped.getMessage()));
- } else {
- System.err.println(new ErrorMsg(ErrorMsg.WARNING_MSG,
- e.getMessageAndLocation()));
- }
- }
-
- /**
- * This method resets the Transformer to its original configuration
- * Transformer code is reset to the same state it was when it was
- * created
- * @since 1.5
- */
- @Override
- public void reset() {
-
- _method = null;
- _encoding = null;
- _sourceSystemId = null;
- _errorListener = this;
- _uriResolver = null;
- _dom = null;
- _parameters = null;
- _indentNumber = 0;
- setOutputProperties (null);
- _tohFactory = null;
- _ostream = null;
-
- }
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/trax/Util.java b/src/com/sun/org/apache/xalan/internal/xsltc/trax/Util.java
deleted file mode 100644
index bd3284d..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/trax/Util.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Util.java,v 1.2.4.1 2005/09/14 09:37:34 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.trax;
-
-import com.sun.org.apache.xalan.internal.XalanConstants;
-import java.io.InputStream;
-import java.io.Reader;
-
-import javax.xml.XMLConstants;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParserFactory;
-
-import javax.xml.stream.XMLEventReader;
-import javax.xml.stream.XMLStreamReader;
-
-import javax.xml.transform.Source;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.transform.stax.StAXSource;
-import javax.xml.transform.stream.StreamSource;
-
-import com.sun.org.apache.xalan.internal.utils.FactoryImpl;
-import com.sun.org.apache.xalan.internal.utils.XMLSecurityManager;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-
-import org.w3c.dom.Document;
-
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.helpers.XMLReaderFactory;
-
-/**
- * @author Santiago Pericas-Geertsen
- */
-public final class Util {
-
- public static String baseName(String name) {
- return com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util.baseName(name);
- }
-
- public static String noExtName(String name) {
- return com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util.noExtName(name);
- }
-
- public static String toJavaName(String name) {
- return com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util.toJavaName(name);
- }
-
-
-
-
- /**
- * Creates a SAX2 InputSource object from a TrAX Source object
- */
- public static InputSource getInputSource(XSLTC xsltc, Source source)
- throws TransformerConfigurationException
- {
- InputSource input = null;
-
- String systemId = source.getSystemId();
-
- try {
- // Try to get InputSource from SAXSource input
- if (source instanceof SAXSource) {
- final SAXSource sax = (SAXSource)source;
- input = sax.getInputSource();
- // Pass the SAX parser to the compiler
- try {
- XMLReader reader = sax.getXMLReader();
-
- /*
- * Fix for bug 24695
- * According to JAXP 1.2 specification if a SAXSource
- * is created using a SAX InputSource the Transformer or
- * TransformerFactory creates a reader via the
- * XMLReaderFactory if setXMLReader is not used
- */
-
- if (reader == null) {
- try {
- reader= XMLReaderFactory.createXMLReader();
- try {
- reader.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING,
- xsltc.isSecureProcessing());
- } catch (SAXNotRecognizedException e) {
- XMLSecurityManager.printWarning(reader.getClass().getName(),
- XMLConstants.FEATURE_SECURE_PROCESSING, e);
- }
- } catch (Exception e ) {
- try {
-
- //Incase there is an exception thrown
- // resort to JAXP
- SAXParserFactory parserFactory = FactoryImpl.getSAXFactory(xsltc.useServicesMechnism());
- parserFactory.setNamespaceAware(true);
-
- if (xsltc.isSecureProcessing()) {
- try {
- parserFactory.setFeature(
- XMLConstants.FEATURE_SECURE_PROCESSING, true);
- }
- catch (org.xml.sax.SAXException se) {}
- }
-
- reader = parserFactory.newSAXParser()
- .getXMLReader();
-
-
- } catch (ParserConfigurationException pce ) {
- throw new TransformerConfigurationException
- ("ParserConfigurationException" ,pce);
- }
- }
- }
- reader.setFeature
- ("http://xml.org/sax/features/namespaces",true);
- reader.setFeature
- ("http://xml.org/sax/features/namespace-prefixes",false);
-
- try {
- reader.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD,
- xsltc.getProperty(XMLConstants.ACCESS_EXTERNAL_DTD));
- } catch (SAXNotRecognizedException e) {
- XMLSecurityManager.printWarning(reader.getClass().getName(),
- XMLConstants.ACCESS_EXTERNAL_DTD, e);
- }
-
- String lastProperty = "";
- try {
- XMLSecurityManager securityManager =
- (XMLSecurityManager)xsltc.getProperty(XalanConstants.SECURITY_MANAGER);
- if (securityManager != null) {
- for (XMLSecurityManager.Limit limit : XMLSecurityManager.Limit.values()) {
- lastProperty = limit.apiProperty();
- reader.setProperty(lastProperty,
- securityManager.getLimitValueAsString(limit));
- }
- if (securityManager.printEntityCountInfo()) {
- lastProperty = XalanConstants.JDK_ENTITY_COUNT_INFO;
- reader.setProperty(XalanConstants.JDK_ENTITY_COUNT_INFO, XalanConstants.JDK_YES);
- }
- }
- } catch (SAXException se) {
- XMLSecurityManager.printWarning(reader.getClass().getName(), lastProperty, se);
- }
- xsltc.setXMLReader(reader);
- }catch (SAXNotRecognizedException snre ) {
- throw new TransformerConfigurationException
- ("SAXNotRecognizedException ",snre);
- }catch (SAXNotSupportedException snse ) {
- throw new TransformerConfigurationException
- ("SAXNotSupportedException ",snse);
- }catch (SAXException se ) {
- throw new TransformerConfigurationException
- ("SAXException ",se);
- }
-
- }
- // handle DOMSource
- else if (source instanceof DOMSource) {
- final DOMSource domsrc = (DOMSource)source;
- final Document dom = (Document)domsrc.getNode();
- final DOM2SAX dom2sax = new DOM2SAX(dom);
- xsltc.setXMLReader(dom2sax);
-
- // Try to get SAX InputSource from DOM Source.
- input = SAXSource.sourceToInputSource(source);
- if (input == null){
- input = new InputSource(domsrc.getSystemId());
- }
- }
-
- // handle StAXSource
- else if (source instanceof StAXSource) {
- final StAXSource staxSource = (StAXSource)source;
- StAXEvent2SAX staxevent2sax = null;
- StAXStream2SAX staxStream2SAX = null;
- if (staxSource.getXMLEventReader() != null) {
- final XMLEventReader xmlEventReader = staxSource.getXMLEventReader();
- staxevent2sax = new StAXEvent2SAX(xmlEventReader);
- xsltc.setXMLReader(staxevent2sax);
- } else if (staxSource.getXMLStreamReader() != null) {
- final XMLStreamReader xmlStreamReader = staxSource.getXMLStreamReader();
- staxStream2SAX = new StAXStream2SAX(xmlStreamReader);
- xsltc.setXMLReader(staxStream2SAX);
- }
-
- // get sax InputSource from StAXSource
- input = SAXSource.sourceToInputSource(source);
- if (input == null){
- input = new InputSource(staxSource.getSystemId());
- }
- }
-
- // Try to get InputStream or Reader from StreamSource
- else if (source instanceof StreamSource) {
- final StreamSource stream = (StreamSource)source;
- final InputStream istream = stream.getInputStream();
- final Reader reader = stream.getReader();
- xsltc.setXMLReader(null); // Clear old XML reader
-
- // Create InputSource from Reader or InputStream in Source
- if (istream != null) {
- input = new InputSource(istream);
- }
- else if (reader != null) {
- input = new InputSource(reader);
- }
- else {
- input = new InputSource(systemId);
- }
- }
- else {
- ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNKNOWN_SOURCE_ERR);
- throw new TransformerConfigurationException(err.toString());
- }
- input.setSystemId(systemId);
- }
- catch (NullPointerException e) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_SOURCE_ERR,
- "TransformerFactory.newTemplates()");
- throw new TransformerConfigurationException(err.toString());
- }
- catch (SecurityException e) {
- ErrorMsg err = new ErrorMsg(ErrorMsg.FILE_ACCESS_ERR, systemId);
- throw new TransformerConfigurationException(err.toString());
- }
- return input;
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/trax/XSLTCSource.java b/src/com/sun/org/apache/xalan/internal/xsltc/trax/XSLTCSource.java
deleted file mode 100644
index 4d96b59..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/trax/XSLTCSource.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XSLTCSource.java,v 1.2.4.1 2005/09/06 12:43:28 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.trax;
-
-import javax.xml.transform.Source;
-import javax.xml.transform.stream.StreamSource;
-
-import com.sun.org.apache.xalan.internal.xsltc.DOM;
-import com.sun.org.apache.xalan.internal.xsltc.StripFilter;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.dom.DOMWSFilter;
-import com.sun.org.apache.xalan.internal.xsltc.dom.SAXImpl;
-import com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet;
-
-import org.xml.sax.SAXException;
-
-/**
- * @author Morten Jorgensen
- */
-public final class XSLTCSource implements Source {
-
- private String _systemId = null;
- private Source _source = null;
- private ThreadLocal _dom = new ThreadLocal();
-
- /**
- * Create a new XSLTC-specific source from a system ID
- */
- public XSLTCSource(String systemId)
- {
- _systemId = systemId;
- }
-
- /**
- * Create a new XSLTC-specific source from a JAXP Source
- */
- public XSLTCSource(Source source)
- {
- _source = source;
- }
-
- /**
- * Implements javax.xml.transform.Source.setSystemId()
- * Set the system identifier for this Source.
- * This Source can get its input either directly from a file (in this case
- * it will instanciate and use a JAXP parser) or it can receive it through
- * ContentHandler/LexicalHandler interfaces.
- * @param systemId The system Id for this Source
- */
- public void setSystemId(String systemId) {
- _systemId = systemId;
- if (_source != null) {
- _source.setSystemId(systemId);
- }
- }
-
- /**
- * Implements javax.xml.transform.Source.getSystemId()
- * Get the system identifier that was set with setSystemId.
- * @return The system identifier that was set with setSystemId,
- * or null if setSystemId was not called.
- */
- public String getSystemId() {
- if (_source != null) {
- return _source.getSystemId();
- }
- else {
- return(_systemId);
- }
- }
-
- /**
- * Internal interface which returns a DOM for a given DTMManager and translet.
- */
- protected DOM getDOM(XSLTCDTMManager dtmManager, AbstractTranslet translet)
- throws SAXException
- {
- SAXImpl idom = (SAXImpl)_dom.get();
-
- if (idom != null) {
- if (dtmManager != null) {
- idom.migrateTo(dtmManager);
- }
- }
- else {
- Source source = _source;
- if (source == null) {
- if (_systemId != null && _systemId.length() > 0) {
- source = new StreamSource(_systemId);
- }
- else {
- ErrorMsg err = new ErrorMsg(ErrorMsg.XSLTC_SOURCE_ERR);
- throw new SAXException(err.toString());
- }
- }
-
- DOMWSFilter wsfilter = null;
- if (translet != null && translet instanceof StripFilter) {
- wsfilter = new DOMWSFilter(translet);
- }
-
- boolean hasIdCall = (translet != null) ? translet.hasIdCall() : false;
-
- if (dtmManager == null) {
- dtmManager = XSLTCDTMManager.newInstance();
- }
-
- idom = (SAXImpl)dtmManager.getDTM(source, true, wsfilter, false, false, hasIdCall);
-
- String systemId = getSystemId();
- if (systemId != null) {
- idom.setDocumentURI(systemId);
- }
- _dom.set(idom);
- }
- return idom;
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/util/IntegerArray.java b/src/com/sun/org/apache/xalan/internal/xsltc/util/IntegerArray.java
deleted file mode 100644
index 4b9d341..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/util/IntegerArray.java
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: IntegerArray.java,v 1.2.4.1 2005/09/06 11:44:56 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.util;
-
-/**
- * @author Jacek Ambroziak
- */
-public final class IntegerArray {
- private static final int InitialSize = 32;
-
- private int[] _array;
- private int _size;
- private int _free = 0;
-
- public IntegerArray() {
- this(InitialSize);
- }
-
- public IntegerArray(int size) {
- _array = new int[_size = size];
- }
-
- public IntegerArray(int[] array) {
- this(array.length);
- System.arraycopy(array, 0, _array, 0, _free = _size);
- }
-
- public void clear() {
- _free = 0;
- }
-
- public Object clone() {
- final IntegerArray clone = new IntegerArray(_free > 0 ? _free : 1);
- System.arraycopy(_array, 0, clone._array, 0, _free);
- clone._free = _free;
- return clone;
- }
-
- public int[] toIntArray() {
- final int[] result = new int[cardinality()];
- System.arraycopy(_array, 0, result, 0, cardinality());
- return result;
- }
-
- public final int at(int index) {
- return _array[index];
- }
-
- public final void set(int index, int value) {
- _array[index] = value;
- }
-
- public int indexOf(int n) {
- for (int i = 0; i < _free; i++) {
- if (n == _array[i]) return i;
- }
- return -1;
- }
-
- public final void add(int value) {
- if (_free == _size) {
- growArray(_size * 2);
- }
- _array[_free++] = value;
- }
-
- /**
- * Adds new int at the end if not already present.
- */
- public void addNew(int value) {
- for (int i = 0; i < _free; i++) {
- if (_array[i] == value) return; // already in array
- }
- add(value);
- }
-
- public void reverse() {
- int left = 0;
- int right = _free - 1;
-
- while (left < right) {
- int temp = _array[left];
- _array[left++] = _array[right];
- _array[right--] = temp;
- }
- }
-
- /**
- * Merge two sorted arrays and eliminate duplicates.
- * Elements of the other IntegerArray must not be changed.
- */
- public void merge(final IntegerArray other) {
- final int newSize = _free + other._free;
-// System.out.println("IntegerArray.merge() begin newSize = " + newSize);
- int[] newArray = new int[newSize];
-
- // Merge the two arrays
- int i = 0, j = 0, k;
- for (k = 0; i < _free && j < other._free; k++) {
- int x = _array[i];
- int y = other._array[j];
-
- if (x < y) {
- newArray[k] = x;
- i++;
- }
- else if (x > y) {
- newArray[k] = y;
- j++;
- }
- else {
- newArray[k] = x;
- i++; j++;
- }
- }
-
- // Copy the rest if of different lengths
- if (i >= _free) {
- while (j < other._free) {
- newArray[k++] = other._array[j++];
- }
- }
- else {
- while (i < _free) {
- newArray[k++] = _array[i++];
- }
- }
-
- // Update reference to this array
- _array = newArray;
- _free = _size = newSize;
-// System.out.println("IntegerArray.merge() end");
- }
-
- public void sort() {
- quicksort(_array, 0, _free - 1);
- }
-
- private static void quicksort(int[] array, int p, int r) {
- if (p < r) {
- final int q = partition(array, p, r);
- quicksort(array, p, q);
- quicksort(array, q + 1, r);
- }
- }
-
- private static int partition(int[] array, int p, int r) {
- final int x = array[(p + r) >>> 1];
- int i = p - 1; int j = r + 1;
-
- while (true) {
- while (x < array[--j]);
- while (x > array[++i]);
- if (i < j) {
- int temp = array[i];
- array[i] = array[j];
- array[j] = temp;
- }
- else {
- return j;
- }
- }
- }
-
- private void growArray(int size) {
- final int[] newArray = new int[_size = size];
- System.arraycopy(_array, 0, newArray, 0, _free);
- _array = newArray;
- }
-
- public int popLast() {
- return _array[--_free];
- }
-
- public int last() {
- return _array[_free - 1];
- }
-
- public void setLast(int n) {
- _array[_free - 1] = n;
- }
-
- public void pop() {
- _free--;
- }
-
- public void pop(int n) {
- _free -= n;
- }
-
- public final int cardinality() {
- return _free;
- }
-
- public void print(java.io.PrintStream out) {
- if (_free > 0) {
- for (int i = 0; i < _free - 1; i++) {
- out.print(_array[i]);
- out.print(' ');
- }
- out.println(_array[_free - 1]);
- }
- else {
- out.println("IntegerArray: empty");
- }
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/dom/AbortException.java b/src/com/sun/org/apache/xerces/internal/dom/AbortException.java
deleted file mode 100644
index 3e178dd..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/AbortException.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-public class AbortException extends RuntimeException {
-
- private static final long serialVersionUID = 2608302175475740417L;
-
- /**
- * Constructor AbortException
- */
- public AbortException() { super(null, null, false, false); }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/dom/AttrImpl.java b/src/com/sun/org/apache/xerces/internal/dom/AttrImpl.java
deleted file mode 100644
index 352fba6..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/AttrImpl.java
+++ /dev/null
@@ -1,1239 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-
-import org.w3c.dom.TypeInfo;
-import org.w3c.dom.Attr;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-
-/**
- * Attribute represents an XML-style attribute of an
- * Element. Typically, the allowable values are controlled by its
- * declaration in the Document Type Definition (DTD) governing this
- * kind of document.
- * <P>
- * If the attribute has not been explicitly assigned a value, but has
- * been declared in the DTD, it will exist and have that default. Only
- * if neither the document nor the DTD specifies a value will the
- * Attribute really be considered absent and have no value; in that
- * case, querying the attribute will return null.
- * <P>
- * Attributes may have multiple children that contain their data. (XML
- * allows attributes to contain entity references, and tokenized
- * attribute types such as NMTOKENS may have a child for each token.)
- * For convenience, the Attribute object's getValue() method returns
- * the string version of the attribute's value.
- * <P>
- * Attributes are not children of the Elements they belong to, in the
- * usual sense, and have no valid Parent reference. However, the spec
- * says they _do_ belong to a specific Element, and an INUSE exception
- * is to be thrown if the user attempts to explicitly share them
- * between elements.
- * <P>
- * Note that Elements do not permit attributes to appear to be shared
- * (see the INUSE exception), so this object's mutability is
- * officially not an issue.
- * <p>
- * Note: The ownerNode attribute is used to store the Element the Attr
- * node is associated with. Attr nodes do not have parent nodes.
- * Besides, the getOwnerElement() method can be used to get the element node
- * this attribute is associated with.
- * <P>
- * AttrImpl does not support Namespaces. AttrNSImpl, which inherits from
- * it, does.
- *
- * <p>AttrImpl used to inherit from ParentNode. It now directly inherits from
- * NodeImpl and provide its own implementation of the ParentNode's behavior.
- * The reason is that we now try and avoid to always create a Text node to
- * hold the value of an attribute. The DOM spec requires it, so we still have
- * to do it in case getFirstChild() is called for instance. The reason
- * attribute values are stored as a list of nodes is so that they can carry
- * more than a simple string. They can also contain EntityReference nodes.
- * However, most of the times people only have a single string that they only
- * set and get through Element.set/getAttribute or Attr.set/getValue. In this
- * new version, the Attr node has a value pointer which can either be the
- * String directly or a pointer to the first ChildNode. A flag tells which one
- * it currently is. Note that while we try to stick with the direct String as
- * much as possible once we've switched to a node there is no going back. This
- * is because we have no way to know whether the application keeps referring to
- * the node we once returned.
- * <p> The gain in memory varies on the density of attributes in the document.
- * But in the tests I've run I've seen up to 12% of memory gain. And the good
- * thing is that it also leads to a slight gain in speed because we allocate
- * fewer objects! I mean, that's until we have to actually create the node...
- * <p>
- * To avoid too much duplicated code, I got rid of ParentNode and renamed
- * ChildAndParentNode, which I never really liked, to ParentNode for
- * simplicity, this doesn't make much of a difference in memory usage because
- * there are only very few objects that are only a Parent. This is only true
- * now because AttrImpl now inherits directly from NodeImpl and has its own
- * implementation of the ParentNode's node behavior. So there is still some
- * duplicated code there.
- * <p>
- * This class doesn't directly support mutation events, however, it notifies
- * the document when mutations are performed so that the document class do so.
- *
- * <p><b>WARNING</b>: Some of the code here is partially duplicated in
- * ParentNode, be careful to keep these two classes in sync!
- *
- * @xerces.internal
- *
- * @see AttrNSImpl
- *
- * @author Arnaud Le Hors, IBM
- * @author Joe Kesselman, IBM
- * @author Andy Clark, IBM
- * @version $Id: AttrImpl.java,v 1.5 2008/06/10 00:59:32 joehw Exp $
- * @since PR-DOM-Level-1-19980818.
- *
- */
-public class AttrImpl
- extends NodeImpl
- implements Attr, TypeInfo{
-
- //
- // Constants
- //
-
- /** Serialization version. */
- static final long serialVersionUID = 7277707688218972102L;
-
- /** DTD namespace. **/
- static final String DTD_URI = "http://www.w3.org/TR/REC-xml";
-
- //
- // Data
- //
-
- /** This can either be a String or the first child node. */
- protected Object value = null;
-
- /** Attribute name. */
- protected String name;
-
- /** Type information */
- // REVISIT: we are losing the type information in DOM during serialization
- transient Object type;
-
- protected TextImpl textNode = null;
-
- //
- // Constructors
- //
-
- /**
- * Attribute has no public constructor. Please use the factory
- * method in the Document class.
- */
- protected AttrImpl(CoreDocumentImpl ownerDocument, String name) {
- super(ownerDocument);
- this.name = name;
- /** False for default attributes. */
- isSpecified(true);
- hasStringValue(true);
- }
-
- // for AttrNSImpl
- protected AttrImpl() {}
-
- // Support for DOM Level 3 renameNode method.
- // Note: This only deals with part of the pb. It is expected to be
- // called after the Attr has been detached for one thing.
- // CoreDocumentImpl does all the work.
- void rename(String name) {
- if (needsSyncData()) {
- synchronizeData();
- }
- this.name = name;
- }
-
- // create a real text node as child if we don't have one yet
- protected void makeChildNode() {
- if (hasStringValue()) {
- if (value != null) {
- TextImpl text =
- (TextImpl) ownerDocument().createTextNode((String) value);
- value = text;
- text.isFirstChild(true);
- text.previousSibling = text;
- text.ownerNode = this;
- text.isOwned(true);
- }
- hasStringValue(false);
- }
- }
-
- /**
- * NON-DOM
- * set the ownerDocument of this node and its children
- */
- void setOwnerDocument(CoreDocumentImpl doc) {
- if (needsSyncChildren()) {
- synchronizeChildren();
- }
- super.setOwnerDocument(doc);
- if (!hasStringValue()) {
- for (ChildNode child = (ChildNode) value;
- child != null; child = child.nextSibling) {
- child.setOwnerDocument(doc);
- }
- }
- }
-
- /**
- * NON-DOM: set the type of this attribute to be ID type.
- *
- * @param id
- */
- public void setIdAttribute(boolean id){
- if (needsSyncData()) {
- synchronizeData();
- }
- isIdAttribute(id);
- }
- /** DOM Level 3: isId*/
- public boolean isId(){
- // REVISIT: should an attribute that is not in the tree return
- // isID true?
- return isIdAttribute();
- }
-
-
- //
- // Node methods
- //
-
- public Node cloneNode(boolean deep) {
-
- if (needsSyncChildren()) {
- synchronizeChildren();
- }
- AttrImpl clone = (AttrImpl) super.cloneNode(deep);
-
- // take care of case where there are kids
- if (!clone.hasStringValue()) {
-
- // Need to break the association w/ original kids
- clone.value = null;
-
- // Cloning an Attribute always clones its children,
- // since they represent its value, no matter whether this
- // is a deep clone or not
- for (Node child = (Node) value; child != null;
- child = child.getNextSibling()) {
- clone.appendChild(child.cloneNode(true));
- }
- }
- clone.isSpecified(true);
- return clone;
- }
-
- /**
- * A short integer indicating what type of node this is. The named
- * constants for this value are defined in the org.w3c.dom.Node interface.
- */
- public short getNodeType() {
- return Node.ATTRIBUTE_NODE;
- }
-
- /**
- * Returns the attribute name
- */
- public String getNodeName() {
- if (needsSyncData()) {
- synchronizeData();
- }
- return name;
- }
-
- /**
- * Implicit in the rerouting of getNodeValue to getValue is the
- * need to redefine setNodeValue, for symmetry's sake. Note that
- * since we're explicitly providing a value, Specified should be set
- * true.... even if that value equals the default.
- */
- public void setNodeValue(String value) throws DOMException {
- setValue(value);
- }
-
- /**
- * @see org.w3c.dom.TypeInfo#getTypeName()
- */
- public String getTypeName() {
- return (String)type;
- }
-
- /**
- * @see org.w3c.dom.TypeInfo#getTypeNamespace()
- */
- public String getTypeNamespace() {
- if (type != null) {
- return DTD_URI;
- }
- return null;
- }
-
- /**
- * Method getSchemaTypeInfo.
- * @return TypeInfo
- */
- public TypeInfo getSchemaTypeInfo(){
- return this;
- }
-
- /**
- * In Attribute objects, NodeValue is considered a synonym for
- * Value.
- *
- * @see #getValue()
- */
- public String getNodeValue() {
- return getValue();
- }
-
- //
- // Attr methods
- //
-
- /**
- * In Attributes, NodeName is considered a synonym for the
- * attribute's Name
- */
- public String getName() {
-
- if (needsSyncData()) {
- synchronizeData();
- }
- return name;
-
- } // getName():String
-
- /**
- * The DOM doesn't clearly define what setValue(null) means. I've taken it
- * as "remove all children", which from outside should appear
- * similar to setting it to the empty string.
- */
- public void setValue(String newvalue) {
-
- CoreDocumentImpl ownerDocument = ownerDocument();
-
- if (ownerDocument.errorChecking && isReadOnly()) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null);
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg);
- }
-
- Element ownerElement = getOwnerElement();
- String oldvalue = "";
- if (needsSyncData()) {
- synchronizeData();
- }
- if (needsSyncChildren()) {
- synchronizeChildren();
- }
- if (value != null) {
- if (ownerDocument.getMutationEvents()) {
- // Can no longer just discard the kids; they may have
- // event listeners waiting for them to disconnect.
- if (hasStringValue()) {
- oldvalue = (String) value;
- // create an actual text node as our child so
- // that we can use it in the event
- if (textNode == null) {
- textNode = (TextImpl)
- ownerDocument.createTextNode((String) value);
- }
- else {
- textNode.data = (String) value;
- }
- value = textNode;
- textNode.isFirstChild(true);
- textNode.previousSibling = textNode;
- textNode.ownerNode = this;
- textNode.isOwned(true);
- hasStringValue(false);
- internalRemoveChild(textNode, true);
- }
- else {
- oldvalue = getValue();
- while (value != null) {
- internalRemoveChild((Node) value, true);
- }
- }
- }
- else {
- if (hasStringValue()) {
- oldvalue = (String) value;
- }
- else {
- // simply discard children if any
- oldvalue = getValue();
- // remove ref from first child to last child
- ChildNode firstChild = (ChildNode) value;
- firstChild.previousSibling = null;
- firstChild.isFirstChild(false);
- firstChild.ownerNode = ownerDocument;
- }
- // then remove ref to current value
- value = null;
- needsSyncChildren(false);
- }
- if (isIdAttribute() && ownerElement != null) {
- ownerDocument.removeIdentifier(oldvalue);
- }
- }
-
- // Create and add the new one, generating only non-aggregate events
- // (There are no listeners on the new Text, but there may be
- // capture/bubble listeners on the Attr.
- // Note that aggregate events are NOT dispatched here,
- // since we need to combine the remove and insert.
- isSpecified(true);
- if (ownerDocument.getMutationEvents()) {
- // if there are any event handlers create a real node
- internalInsertBefore(ownerDocument.createTextNode(newvalue),
- null, true);
- hasStringValue(false);
- // notify document
- ownerDocument.modifiedAttrValue(this, oldvalue);
- } else {
- // directly store the string
- value = newvalue;
- hasStringValue(true);
- changed();
- }
- if (isIdAttribute() && ownerElement != null) {
- ownerDocument.putIdentifier(newvalue, ownerElement);
- }
-
- } // setValue(String)
-
- /**
- * The "string value" of an Attribute is its text representation,
- * which in turn is a concatenation of the string values of its children.
- */
- public String getValue() {
-
- if (needsSyncData()) {
- synchronizeData();
- }
- if (needsSyncChildren()) {
- synchronizeChildren();
- }
- if (value == null) {
- return "";
- }
- if (hasStringValue()) {
- return (String) value;
- }
-
- ChildNode firstChild = ((ChildNode) value);
-
- String data = null;
- if (firstChild.getNodeType() == Node.ENTITY_REFERENCE_NODE){
- data = ((EntityReferenceImpl)firstChild).getEntityRefValue();
- }
- else {
- data = firstChild.getNodeValue();
- }
-
- ChildNode node = firstChild.nextSibling;
-
- if (node == null || data == null) return (data == null)?"":data;
-
- StringBuffer value = new StringBuffer(data);
- while (node != null) {
- if (node.getNodeType() == Node.ENTITY_REFERENCE_NODE){
- data = ((EntityReferenceImpl)node).getEntityRefValue();
- if (data == null) return "";
- value.append(data);
- }
- else {
- value.append(node.getNodeValue());
- }
- node = node.nextSibling;
- }
- return value.toString();
-
- } // getValue():String
-
-
- /**
- * The "specified" flag is true if and only if this attribute's
- * value was explicitly specified in the original document. Note that
- * the implementation, not the user, is in charge of this
- * property. If the user asserts an Attribute value (even if it ends
- * up having the same value as the default), it is considered a
- * specified attribute. If you really want to revert to the default,
- * delete the attribute from the Element, and the Implementation will
- * re-assert the default (if any) in its place, with the appropriate
- * specified=false setting.
- */
- public boolean getSpecified() {
-
- if (needsSyncData()) {
- synchronizeData();
- }
- return isSpecified();
-
- } // getSpecified():boolean
-
- //
- // Attr2 methods
- //
-
- /**
- * Returns the element node that this attribute is associated with,
- * or null if the attribute has not been added to an element.
- *
- * @see #getOwnerElement
- *
- * @deprecated Previous working draft of DOM Level 2. New method
- * is <tt>getOwnerElement()</tt>.
- */
- public Element getElement() {
- // if we have an owner, ownerNode is our ownerElement, otherwise it's
- // our ownerDocument and we don't have an ownerElement
- return (Element) (isOwned() ? ownerNode : null);
- }
-
- /**
- * Returns the element node that this attribute is associated with,
- * or null if the attribute has not been added to an element.
- *
- * @since WD-DOM-Level-2-19990719
- */
- public Element getOwnerElement() {
- // if we have an owner, ownerNode is our ownerElement, otherwise it's
- // our ownerDocument and we don't have an ownerElement
- return (Element) (isOwned() ? ownerNode : null);
- }
-
- public void normalize() {
-
- // No need to normalize if already normalized or
- // if value is kept as a String.
- if (isNormalized() || hasStringValue())
- return;
-
- Node kid, next;
- ChildNode firstChild = (ChildNode)value;
- for (kid = firstChild; kid != null; kid = next) {
- next = kid.getNextSibling();
-
- // If kid is a text node, we need to check for one of two
- // conditions:
- // 1) There is an adjacent text node
- // 2) There is no adjacent text node, but kid is
- // an empty text node.
- if ( kid.getNodeType() == Node.TEXT_NODE )
- {
- // If an adjacent text node, merge it with kid
- if ( next!=null && next.getNodeType() == Node.TEXT_NODE )
- {
- ((Text)kid).appendData(next.getNodeValue());
- removeChild( next );
- next = kid; // Don't advance; there might be another.
- }
- else
- {
- // If kid is empty, remove it
- if ( kid.getNodeValue() == null || kid.getNodeValue().length() == 0 ) {
- removeChild( kid );
- }
- }
- }
- }
-
- isNormalized(true);
- } // normalize()
-
- //
- // Public methods
- //
-
- /** NON-DOM, for use by parser */
- public void setSpecified(boolean arg) {
-
- if (needsSyncData()) {
- synchronizeData();
- }
- isSpecified(arg);
-
- } // setSpecified(boolean)
-
- /**
- * NON-DOM: used by the parser
- * @param type
- */
- public void setType (Object type){
- this.type = type;
- }
-
- //
- // Object methods
- //
-
- /** NON-DOM method for debugging convenience */
- public String toString() {
- return getName() + "=" + "\"" + getValue() + "\"";
- }
-
- /**
- * Test whether this node has any children. Convenience shorthand
- * for (Node.getFirstChild()!=null)
- */
- public boolean hasChildNodes() {
- if (needsSyncChildren()) {
- synchronizeChildren();
- }
- return value != null;
- }
-
- /**
- * Obtain a NodeList enumerating all children of this node. If there
- * are none, an (initially) empty NodeList is returned.
- * <p>
- * NodeLists are "live"; as children are added/removed the NodeList
- * will immediately reflect those changes. Also, the NodeList refers
- * to the actual nodes, so changes to those nodes made via the DOM tree
- * will be reflected in the NodeList and vice versa.
- * <p>
- * In this implementation, Nodes implement the NodeList interface and
- * provide their own getChildNodes() support. Other DOMs may solve this
- * differently.
- */
- public NodeList getChildNodes() {
- // JKESS: KNOWN ISSUE HERE
-
- if (needsSyncChildren()) {
- synchronizeChildren();
- }
- return this;
-
- } // getChildNodes():NodeList
-
- /** The first child of this Node, or null if none. */
- public Node getFirstChild() {
-
- if (needsSyncChildren()) {
- synchronizeChildren();
- }
- makeChildNode();
- return (Node) value;
-
- } // getFirstChild():Node
-
- /** The last child of this Node, or null if none. */
- public Node getLastChild() {
-
- if (needsSyncChildren()) {
- synchronizeChildren();
- }
- return lastChild();
-
- } // getLastChild():Node
-
- final ChildNode lastChild() {
- // last child is stored as the previous sibling of first child
- makeChildNode();
- return value != null ? ((ChildNode) value).previousSibling : null;
- }
-
- final void lastChild(ChildNode node) {
- // store lastChild as previous sibling of first child
- if (value != null) {
- ((ChildNode) value).previousSibling = node;
- }
- }
-
- /**
- * Move one or more node(s) to our list of children. Note that this
- * implicitly removes them from their previous parent.
- *
- * @param newChild The Node to be moved to our subtree. As a
- * convenience feature, inserting a DocumentNode will instead insert
- * all its children.
- *
- * @param refChild Current child which newChild should be placed
- * immediately before. If refChild is null, the insertion occurs
- * after all existing Nodes, like appendChild().
- *
- * @return newChild, in its new state (relocated, or emptied in the case of
- * DocumentNode.)
- *
- * @throws DOMException(HIERARCHY_REQUEST_ERR) if newChild is of a
- * type that shouldn't be a child of this node, or if newChild is an
- * ancestor of this node.
- *
- * @throws DOMException(WRONG_DOCUMENT_ERR) if newChild has a
- * different owner document than we do.
- *
- * @throws DOMException(NOT_FOUND_ERR) if refChild is not a child of
- * this node.
- *
- * @throws DOMException(NO_MODIFICATION_ALLOWED_ERR) if this node is
- * read-only.
- */
- public Node insertBefore(Node newChild, Node refChild)
- throws DOMException {
- // Tail-call; optimizer should be able to do good things with.
- return internalInsertBefore(newChild, refChild, false);
- } // insertBefore(Node,Node):Node
-
- /** NON-DOM INTERNAL: Within DOM actions,we sometimes need to be able
- * to control which mutation events are spawned. This version of the
- * insertBefore operation allows us to do so. It is not intended
- * for use by application programs.
- */
- Node internalInsertBefore(Node newChild, Node refChild, boolean replace)
- throws DOMException {
-
- CoreDocumentImpl ownerDocument = ownerDocument();
- boolean errorChecking = ownerDocument.errorChecking;
-
- if (newChild.getNodeType() == Node.DOCUMENT_FRAGMENT_NODE) {
- // SLOW BUT SAFE: We could insert the whole subtree without
- // juggling so many next/previous pointers. (Wipe out the
- // parent's child-list, patch the parent pointers, set the
- // ends of the list.) But we know some subclasses have special-
- // case behavior they add to insertBefore(), so we don't risk it.
- // This approch also takes fewer bytecodes.
-
- // NOTE: If one of the children is not a legal child of this
- // node, throw HIERARCHY_REQUEST_ERR before _any_ of the children
- // have been transferred. (Alternative behaviors would be to
- // reparent up to the first failure point or reparent all those
- // which are acceptable to the target node, neither of which is
- // as robust. PR-DOM-0818 isn't entirely clear on which it
- // recommends?????
-
- // No need to check kids for right-document; if they weren't,
- // they wouldn't be kids of that DocFrag.
- if (errorChecking) {
- for (Node kid = newChild.getFirstChild(); // Prescan
- kid != null; kid = kid.getNextSibling()) {
-
- if (!ownerDocument.isKidOK(this, kid)) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "HIERARCHY_REQUEST_ERR", null);
- throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, msg);
- }
- }
- }
-
- while (newChild.hasChildNodes()) {
- insertBefore(newChild.getFirstChild(), refChild);
- }
- return newChild;
- }
-
- if (newChild == refChild) {
- // stupid case that must be handled as a no-op triggering events...
- refChild = refChild.getNextSibling();
- removeChild(newChild);
- insertBefore(newChild, refChild);
- return newChild;
- }
-
- if (needsSyncChildren()) {
- synchronizeChildren();
- }
-
- if (errorChecking) {
- if (isReadOnly()) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null);
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg);
- }
- if (newChild.getOwnerDocument() != ownerDocument) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null);
- throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, msg);
- }
- if (!ownerDocument.isKidOK(this, newChild)) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "HIERARCHY_REQUEST_ERR", null);
- throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, msg);
- }
- // refChild must be a child of this node (or null)
- if (refChild != null && refChild.getParentNode() != this) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_FOUND_ERR", null);
- throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
- }
-
- // Prevent cycles in the tree
- // newChild cannot be ancestor of this Node,
- // and actually cannot be this
- boolean treeSafe = true;
- for (NodeImpl a = this; treeSafe && a != null; a = a.parentNode())
- {
- treeSafe = newChild != a;
- }
- if (!treeSafe) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "HIERARCHY_REQUEST_ERR", null);
- throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, msg);
- }
- }
-
- makeChildNode(); // make sure we have a node and not a string
-
- // notify document
- ownerDocument.insertingNode(this, replace);
-
- // Convert to internal type, to avoid repeated casting
- ChildNode newInternal = (ChildNode)newChild;
-
- Node oldparent = newInternal.parentNode();
- if (oldparent != null) {
- oldparent.removeChild(newInternal);
- }
-
- // Convert to internal type, to avoid repeated casting
- ChildNode refInternal = (ChildNode) refChild;
-
- // Attach up
- newInternal.ownerNode = this;
- newInternal.isOwned(true);
-
- // Attach before and after
- // Note: firstChild.previousSibling == lastChild!!
- ChildNode firstChild = (ChildNode) value;
- if (firstChild == null) {
- // this our first and only child
- value = newInternal; // firstchild = newInternal;
- newInternal.isFirstChild(true);
- newInternal.previousSibling = newInternal;
- }
- else {
- if (refInternal == null) {
- // this is an append
- ChildNode lastChild = firstChild.previousSibling;
- lastChild.nextSibling = newInternal;
- newInternal.previousSibling = lastChild;
- firstChild.previousSibling = newInternal;
- }
- else {
- // this is an insert
- if (refChild == firstChild) {
- // at the head of the list
- firstChild.isFirstChild(false);
- newInternal.nextSibling = firstChild;
- newInternal.previousSibling = firstChild.previousSibling;
- firstChild.previousSibling = newInternal;
- value = newInternal; // firstChild = newInternal;
- newInternal.isFirstChild(true);
- }
- else {
- // somewhere in the middle
- ChildNode prev = refInternal.previousSibling;
- newInternal.nextSibling = refInternal;
- prev.nextSibling = newInternal;
- refInternal.previousSibling = newInternal;
- newInternal.previousSibling = prev;
- }
- }
- }
-
- changed();
-
- // notify document
- ownerDocument.insertedNode(this, newInternal, replace);
-
- checkNormalizationAfterInsert(newInternal);
-
- return newChild;
-
- } // internalInsertBefore(Node,Node,int):Node
-
- /**
- * Remove a child from this Node. The removed child's subtree
- * remains intact so it may be re-inserted elsewhere.
- *
- * @return oldChild, in its new state (removed).
- *
- * @throws DOMException(NOT_FOUND_ERR) if oldChild is not a child of
- * this node.
- *
- * @throws DOMException(NO_MODIFICATION_ALLOWED_ERR) if this node is
- * read-only.
- */
- public Node removeChild(Node oldChild)
- throws DOMException {
- // Tail-call, should be optimizable
- if (hasStringValue()) {
- // we don't have any child per say so it can't be one of them!
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_FOUND_ERR", null);
- throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
- }
- return internalRemoveChild(oldChild, false);
- } // removeChild(Node) :Node
-
- /** NON-DOM INTERNAL: Within DOM actions,we sometimes need to be able
- * to control which mutation events are spawned. This version of the
- * removeChild operation allows us to do so. It is not intended
- * for use by application programs.
- */
- Node internalRemoveChild(Node oldChild, boolean replace)
- throws DOMException {
-
- CoreDocumentImpl ownerDocument = ownerDocument();
- if (ownerDocument.errorChecking) {
- if (isReadOnly()) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null);
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg);
- }
- if (oldChild != null && oldChild.getParentNode() != this) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_FOUND_ERR", null);
- throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
- }
- }
-
- ChildNode oldInternal = (ChildNode) oldChild;
-
- // notify document
- ownerDocument.removingNode(this, oldInternal, replace);
-
- // Patch linked list around oldChild
- // Note: lastChild == firstChild.previousSibling
- if (oldInternal == value) { // oldInternal == firstChild
- // removing first child
- oldInternal.isFirstChild(false);
- // next line is: firstChild = oldInternal.nextSibling
- value = oldInternal.nextSibling;
- ChildNode firstChild = (ChildNode) value;
- if (firstChild != null) {
- firstChild.isFirstChild(true);
- firstChild.previousSibling = oldInternal.previousSibling;
- }
- } else {
- ChildNode prev = oldInternal.previousSibling;
- ChildNode next = oldInternal.nextSibling;
- prev.nextSibling = next;
- if (next == null) {
- // removing last child
- ChildNode firstChild = (ChildNode) value;
- firstChild.previousSibling = prev;
- } else {
- // removing some other child in the middle
- next.previousSibling = prev;
- }
- }
-
- // Save previous sibling for normalization checking.
- ChildNode oldPreviousSibling = oldInternal.previousSibling();
-
- // Remove oldInternal's references to tree
- oldInternal.ownerNode = ownerDocument;
- oldInternal.isOwned(false);
- oldInternal.nextSibling = null;
- oldInternal.previousSibling = null;
-
- changed();
-
- // notify document
- ownerDocument.removedNode(this, replace);
-
- checkNormalizationAfterRemove(oldPreviousSibling);
-
- return oldInternal;
-
- } // internalRemoveChild(Node,int):Node
-
- /**
- * Make newChild occupy the location that oldChild used to
- * have. Note that newChild will first be removed from its previous
- * parent, if any. Equivalent to inserting newChild before oldChild,
- * then removing oldChild.
- *
- * @return oldChild, in its new state (removed).
- *
- * @throws DOMException(HIERARCHY_REQUEST_ERR) if newChild is of a
- * type that shouldn't be a child of this node, or if newChild is
- * one of our ancestors.
- *
- * @throws DOMException(WRONG_DOCUMENT_ERR) if newChild has a
- * different owner document than we do.
- *
- * @throws DOMException(NOT_FOUND_ERR) if oldChild is not a child of
- * this node.
- *
- * @throws DOMException(NO_MODIFICATION_ALLOWED_ERR) if this node is
- * read-only.
- */
- public Node replaceChild(Node newChild, Node oldChild)
- throws DOMException {
-
- makeChildNode();
-
- // If Mutation Events are being generated, this operation might
- // throw aggregate events twice when modifying an Attr -- once
- // on insertion and once on removal. DOM Level 2 does not specify
- // this as either desirable or undesirable, but hints that
- // aggregations should be issued only once per user request.
-
- // notify document
- CoreDocumentImpl ownerDocument = ownerDocument();
- ownerDocument.replacingNode(this);
-
- internalInsertBefore(newChild, oldChild, true);
- if (newChild != oldChild) {
- internalRemoveChild(oldChild, true);
- }
-
- // notify document
- ownerDocument.replacedNode(this);
-
- return oldChild;
- }
-
- //
- // NodeList methods
- //
-
- /**
- * NodeList method: Count the immediate children of this node
- * @return int
- */
- public int getLength() {
-
- if (hasStringValue()) {
- return 1;
- }
- ChildNode node = (ChildNode) value;
- int length = 0;
- for (; node != null; node = node.nextSibling) {
- length++;
- }
- return length;
-
- } // getLength():int
-
- /**
- * NodeList method: Return the Nth immediate child of this node, or
- * null if the index is out of bounds.
- * @return org.w3c.dom.Node
- * @param Index int
- */
- public Node item(int index) {
-
- if (hasStringValue()) {
- if (index != 0 || value == null) {
- return null;
- }
- else {
- makeChildNode();
- return (Node) value;
- }
- }
- if (index < 0) {
- return null;
- }
- ChildNode node = (ChildNode) value;
- for (int i = 0; i < index && node != null; i++) {
- node = node.nextSibling;
- }
- return node;
-
- } // item(int):Node
-
- //
- // DOM3
- //
-
- /**
- * DOM Level 3 WD- Experimental.
- * Override inherited behavior from ParentNode to support deep equal.
- * isEqualNode is always deep on Attr nodes.
- */
- public boolean isEqualNode(Node arg) {
- return super.isEqualNode(arg);
- }
-
- /**
- * Introduced in DOM Level 3. <p>
- * Checks if a type is derived from another by restriction. See:
- * http://www.w3.org/TR/DOM-Level-3-Core/core.html#TypeInfo-isDerivedFrom
- *
- * @param ancestorNS
- * The namspace of the ancestor type declaration
- * @param ancestorName
- * The name of the ancestor type declaration
- * @param type
- * The reference type definition
- *
- * @return boolean True if the type is derived by restriciton for the
- * reference type
- */
- public boolean isDerivedFrom(String typeNamespaceArg,
- String typeNameArg,
- int derivationMethod) {
-
- return false;
- }
-
-
- //
- // Public methods
- //
-
- /**
- * Override default behavior so that if deep is true, children are also
- * toggled.
- * @see Node
- * <P>
- * Note: this will not change the state of an EntityReference or its
- * children, which are always read-only.
- */
- public void setReadOnly(boolean readOnly, boolean deep) {
-
- super.setReadOnly(readOnly, deep);
-
- if (deep) {
-
- if (needsSyncChildren()) {
- synchronizeChildren();
- }
-
- if (hasStringValue()) {
- return;
- }
- // Recursively set kids
- for (ChildNode mykid = (ChildNode) value;
- mykid != null;
- mykid = mykid.nextSibling) {
- if (mykid.getNodeType() != Node.ENTITY_REFERENCE_NODE) {
- mykid.setReadOnly(readOnly,true);
- }
- }
- }
- } // setReadOnly(boolean,boolean)
-
- //
- // Protected methods
- //
-
- /**
- * Override this method in subclass to hook in efficient
- * internal data structure.
- */
- protected void synchronizeChildren() {
- // By default just change the flag to avoid calling this method again
- needsSyncChildren(false);
- }
-
- /**
- * Checks the normalized state of this node after inserting a child.
- * If the inserted child causes this node to be unnormalized, then this
- * node is flagged accordingly.
- * The conditions for changing the normalized state are:
- * <ul>
- * <li>The inserted child is a text node and one of its adjacent siblings
- * is also a text node.
- * <li>The inserted child is is itself unnormalized.
- * </ul>
- *
- * @param insertedChild the child node that was inserted into this node
- *
- * @throws NullPointerException if the inserted child is <code>null</code>
- */
- void checkNormalizationAfterInsert(ChildNode insertedChild) {
- // See if insertion caused this node to be unnormalized.
- if (insertedChild.getNodeType() == Node.TEXT_NODE) {
- ChildNode prev = insertedChild.previousSibling();
- ChildNode next = insertedChild.nextSibling;
- // If an adjacent sibling of the new child is a text node,
- // flag this node as unnormalized.
- if ((prev != null && prev.getNodeType() == Node.TEXT_NODE) ||
- (next != null && next.getNodeType() == Node.TEXT_NODE)) {
- isNormalized(false);
- }
- }
- else {
- // If the new child is not normalized,
- // then this node is inherently not normalized.
- if (!insertedChild.isNormalized()) {
- isNormalized(false);
- }
- }
- } // checkNormalizationAfterInsert(ChildNode)
-
- /**
- * Checks the normalized of this node after removing a child.
- * If the removed child causes this node to be unnormalized, then this
- * node is flagged accordingly.
- * The conditions for changing the normalized state are:
- * <ul>
- * <li>The removed child had two adjacent siblings that were text nodes.
- * </ul>
- *
- * @param previousSibling the previous sibling of the removed child, or
- * <code>null</code>
- */
- void checkNormalizationAfterRemove(ChildNode previousSibling) {
- // See if removal caused this node to be unnormalized.
- // If the adjacent siblings of the removed child were both text nodes,
- // flag this node as unnormalized.
- if (previousSibling != null &&
- previousSibling.getNodeType() == Node.TEXT_NODE) {
-
- ChildNode next = previousSibling.nextSibling;
- if (next != null && next.getNodeType() == Node.TEXT_NODE) {
- isNormalized(false);
- }
- }
- } // checkNormalizationAfterRemove(ChildNode)
-
- //
- // Serialization methods
- //
-
- /** Serialize object. */
- private void writeObject(ObjectOutputStream out) throws IOException {
-
- // synchronize chilren
- if (needsSyncChildren()) {
- synchronizeChildren();
- }
- // write object
- out.defaultWriteObject();
-
- } // writeObject(ObjectOutputStream)
-
- /** Deserialize object. */
- private void readObject(ObjectInputStream ois)
- throws ClassNotFoundException, IOException {
-
- // perform default deseralization
- ois.defaultReadObject();
-
- // hardset synchildren - so we don't try to sync -
- // it does not make any sense to try to synchildren when we just
- // deserialize object.
- needsSyncChildren(false);
-
- } // readObject(ObjectInputStream)
-
-
-} // class AttrImpl
diff --git a/src/com/sun/org/apache/xerces/internal/dom/AttrNSImpl.java b/src/com/sun/org/apache/xerces/internal/dom/AttrNSImpl.java
deleted file mode 100644
index 7defc55..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/AttrNSImpl.java
+++ /dev/null
@@ -1,352 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-import com.sun.org.apache.xerces.internal.impl.dv.xs.XSSimpleTypeDecl;
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-import com.sun.org.apache.xerces.internal.xs.XSSimpleTypeDefinition;
-import org.w3c.dom.DOMException;
-
-/**
- * AttrNSImpl inherits from AttrImpl and adds namespace support.
- * <P>
- * The qualified name is the node name, and we store localName which is also
- * used in all queries. On the other hand we recompute the prefix when
- * necessary.
- *
- * @xerces.internal
- *
- * @author Arnaud Le Hors, IBM
- * @author Andy Clark, IBM
- * @author Ralf Pfeiffer, IBM
- * @version $Id: AttrNSImpl.java,v 1.7 2010-11-01 04:39:37 joehw Exp $
- */
-public class AttrNSImpl
- extends AttrImpl {
-
- //
- // Constants
- //
-
- /** Serialization version. */
- static final long serialVersionUID = -781906615369795414L;
-
- static final String xmlnsURI = "http://www.w3.org/2000/xmlns/";
- static final String xmlURI = "http://www.w3.org/XML/1998/namespace";
-
- //
- // Data
- //
-
- /** DOM2: Namespace URI. */
- protected String namespaceURI;
-
- /** DOM2: localName. */
- protected String localName;
-
- /*
- * Default constructor
- */
- public AttrNSImpl(){}
-
- /**
- * DOM2: Constructor for Namespace implementation.
- */
- protected AttrNSImpl(CoreDocumentImpl ownerDocument,
- String namespaceURI,
- String qualifiedName) {
-
- super(ownerDocument, qualifiedName);
- setName(namespaceURI, qualifiedName);
- }
-
- private void setName(String namespaceURI, String qname){
- CoreDocumentImpl ownerDocument = ownerDocument();
- String prefix;
- // DOM Level 3: namespace URI is never empty string.
- this.namespaceURI = namespaceURI;
- if (namespaceURI !=null) {
- this.namespaceURI = (namespaceURI.length() == 0)? null
- : namespaceURI;
-
- }
- int colon1 = qname.indexOf(':');
- int colon2 = qname.lastIndexOf(':');
- ownerDocument.checkNamespaceWF(qname, colon1, colon2);
- if (colon1 < 0) {
- // there is no prefix
- localName = qname;
- if (ownerDocument.errorChecking) {
- ownerDocument.checkQName(null, localName);
-
- if (qname.equals("xmlns") && (namespaceURI == null
- || !namespaceURI.equals(NamespaceContext.XMLNS_URI))
- || (namespaceURI!=null && namespaceURI.equals(NamespaceContext.XMLNS_URI)
- && !qname.equals("xmlns"))) {
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "NAMESPACE_ERR",
- null);
- throw new DOMException(DOMException.NAMESPACE_ERR, msg);
- }
- }
- }
- else {
- prefix = qname.substring(0, colon1);
- localName = qname.substring(colon2+1);
- ownerDocument.checkQName(prefix, localName);
- ownerDocument.checkDOMNSErr(prefix, namespaceURI);
- }
- }
-
- // when local name is known
- public AttrNSImpl(CoreDocumentImpl ownerDocument,
- String namespaceURI,
- String qualifiedName,
- String localName) {
- super(ownerDocument, qualifiedName);
-
- this.localName = localName;
- this.namespaceURI = namespaceURI;
- }
-
- // for DeferredAttrImpl
- protected AttrNSImpl(CoreDocumentImpl ownerDocument,
- String value) {
- super(ownerDocument, value);
- }
-
- // Support for DOM Level 3 renameNode method.
- // Note: This only deals with part of the pb. It is expected to be
- // called after the Attr has been detached for one thing.
- // CoreDocumentImpl does all the work.
- void rename(String namespaceURI, String qualifiedName) {
- if (needsSyncData()) {
- synchronizeData();
- }
- this.name = qualifiedName;
- setName(namespaceURI, qualifiedName);
- }
-
- /**
- * NON-DOM: resets this node and sets specified values for the node
- *
- * @param ownerDocument
- * @param namespaceURI
- * @param qualifiedName
- * @param localName
- */
- public void setValues (CoreDocumentImpl ownerDocument,
- String namespaceURI,
- String qualifiedName,
- String localName){
-
- super.textNode = null;
- super.flags = 0;
- isSpecified(true);
- hasStringValue(true);
- super.setOwnerDocument(ownerDocument);
- this.localName = localName;
- this.namespaceURI = namespaceURI;
- super.name = qualifiedName;
- super.value = null;
- }
-
- //
- // DOM2: Namespace methods
- //
-
- /**
- * Introduced in DOM Level 2. <p>
- *
- * The namespace URI of this node, or null if it is unspecified.<p>
- *
- * This is not a computed value that is the result of a namespace lookup
- * based on an examination of the namespace declarations in scope. It is
- * merely the namespace URI given at creation time.<p>
- *
- * For nodes created with a DOM Level 1 method, such as createElement
- * from the Document interface, this is null.
- * @since WD-DOM-Level-2-19990923
- */
- public String getNamespaceURI()
- {
- if (needsSyncData()) {
- synchronizeData();
- }
- // REVIST: This code could/should be done at a lower-level, such that
- // the namespaceURI is set properly upon creation. However, there still
- // seems to be some DOM spec interpretation grey-area.
- return namespaceURI;
- }
-
- /**
- * Introduced in DOM Level 2. <p>
- *
- * The namespace prefix of this node, or null if it is unspecified. <p>
- *
- * For nodes created with a DOM Level 1 method, such as createElement
- * from the Document interface, this is null. <p>
- *
- * @since WD-DOM-Level-2-19990923
- */
- public String getPrefix()
- {
- if (needsSyncData()) {
- synchronizeData();
- }
- int index = name.indexOf(':');
- return index < 0 ? null : name.substring(0, index);
- }
-
- /**
- * Introduced in DOM Level 2. <p>
- *
- * Note that setting this attribute changes the nodeName attribute, which
- * holds the qualified name, as well as the tagName and name attributes of
- * the Element and Attr interfaces, when applicable.<p>
- *
- * @param prefix The namespace prefix of this node, or null(empty string) if it is unspecified.
- *
- * @exception INVALID_CHARACTER_ERR
- * Raised if the specified
- * prefix contains an invalid character.
- * @exception DOMException
- * @since WD-DOM-Level-2-19990923
- */
- public void setPrefix(String prefix)
- throws DOMException
- {
- if (needsSyncData()) {
- synchronizeData();
- }
- if (ownerDocument().errorChecking) {
- if (isReadOnly()) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null);
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg);
- }
- if (prefix != null && prefix.length() != 0) {
-
- if (!CoreDocumentImpl.isXMLName(prefix,ownerDocument().isXML11Version())) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_CHARACTER_ERR", null);
- throw new DOMException(DOMException.INVALID_CHARACTER_ERR, msg);
- }
- if (namespaceURI == null || prefix.indexOf(':') >=0) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NAMESPACE_ERR", null);
- throw new DOMException(DOMException.NAMESPACE_ERR, msg);
-
- }
- if (prefix.equals("xmlns")) {
- if (!namespaceURI.equals(xmlnsURI)){
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NAMESPACE_ERR", null);
- throw new DOMException(DOMException.NAMESPACE_ERR, msg);
- }
- } else if (prefix.equals("xml")) {
- if (!namespaceURI.equals(xmlURI)) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NAMESPACE_ERR", null);
- throw new DOMException(DOMException.NAMESPACE_ERR, msg);
- }
- }else if (name.equals("xmlns")) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NAMESPACE_ERR", null);
- throw new DOMException(DOMException.NAMESPACE_ERR, msg);
- }
- }
- }
-
- // update node name with new qualifiedName
- if (prefix !=null && prefix.length() != 0) {
- name = prefix + ":" + localName;
- }
- else {
- name = localName;
- }
- }
-
- /**
- * Introduced in DOM Level 2. <p>
- *
- * Returns the local part of the qualified name of this node.
- * @since WD-DOM-Level-2-19990923
- */
- public String getLocalName()
- {
- if (needsSyncData()) {
- synchronizeData();
- }
- return localName;
- }
-
-
- /**
- * @see org.w3c.dom.TypeInfo#getTypeName()
- */
- public String getTypeName() {
- if (type !=null){
- if (type instanceof XSSimpleTypeDecl){
- return ((XSSimpleTypeDecl)type).getName();
- }
- return (String)type;
- }
- return null;
- }
-
- /**
- * Introduced in DOM Level 3. <p>
- * Checks if a type is derived from another by restriction. See:
- * http://www.w3.org/TR/DOM-Level-3-Core/core.html#TypeInfo-isDerivedFrom
- *
- * @param ancestorNS
- * The namspace of the ancestor type declaration
- * @param ancestorName
- * The name of the ancestor type declaration
- * @param type
- * The reference type definition
- *
- * @return boolean True if the type is derived by restriciton for the
- * reference type
- */
- public boolean isDerivedFrom(String typeNamespaceArg,
- String typeNameArg,
- int derivationMethod) {
- if (type != null) {
- if (type instanceof XSSimpleTypeDecl) {
- return ((XSSimpleTypeDecl) type).isDOMDerivedFrom(
- typeNamespaceArg, typeNameArg, derivationMethod);
- }
- }
- return false;
- }
-
- /**
- * @see org.w3c.dom.TypeInfo#getTypeNamespace()
- */
- public String getTypeNamespace() {
- if (type !=null) {
- if (type instanceof XSSimpleTypeDecl){
- return ((XSSimpleTypeDecl)type).getNamespace();
- }
- return DTD_URI;
- }
- return null;
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/dom/AttributeMap.java b/src/com/sun/org/apache/xerces/internal/dom/AttributeMap.java
deleted file mode 100644
index 8d2d054..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/AttributeMap.java
+++ /dev/null
@@ -1,606 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2000-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Node;
-
-/**
- * AttributeMap inherits from NamedNodeMapImpl and extends it to deal with the
- * specifics of storing attributes. These are:
- * <ul>
- * <li>managing ownership of attribute nodes
- * <li>managing default attributes
- * <li>firing mutation events
- * </ul>
- * <p>
- * This class doesn't directly support mutation events, however, it notifies
- * the document when mutations are performed so that the document class do so.
- *
- * @xerces.internal
- *
- * @version $Id: AttributeMap.java,v 1.7 2010-11-01 04:39:37 joehw Exp $
- */
-public class AttributeMap extends NamedNodeMapImpl {
-
- /** Serialization version. */
- static final long serialVersionUID = 8872606282138665383L;
-
- //
- // Constructors
- //
-
- /** Constructs a named node map. */
- protected AttributeMap(ElementImpl ownerNode, NamedNodeMapImpl defaults) {
- super(ownerNode);
- if (defaults != null) {
- // initialize map with the defaults
- cloneContent(defaults);
- if (nodes != null) {
- hasDefaults(true);
- }
- }
- }
-
- /**
- * Adds an attribute using its nodeName attribute.
- * @see org.w3c.dom.NamedNodeMap#setNamedItem
- * @return If the new Node replaces an existing node the replaced Node is
- * returned, otherwise null is returned.
- * @param arg
- * An Attr node to store in this map.
- * @exception org.w3c.dom.DOMException The exception description.
- */
- public Node setNamedItem(Node arg)
- throws DOMException {
-
- boolean errCheck = ownerNode.ownerDocument().errorChecking;
- if (errCheck) {
- if (isReadOnly()) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null);
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg);
- }
- if (arg.getOwnerDocument() != ownerNode.ownerDocument()) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null);
- throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, msg);
- }
- if (arg.getNodeType() != Node.ATTRIBUTE_NODE) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "HIERARCHY_REQUEST_ERR", null);
- throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, msg);
- }
- }
- AttrImpl argn = (AttrImpl)arg;
-
- if (argn.isOwned()){
- if (errCheck && argn.getOwnerElement() != ownerNode) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INUSE_ATTRIBUTE_ERR", null);
- throw new DOMException(DOMException.INUSE_ATTRIBUTE_ERR, msg);
- }
- // replacing an Attribute with itself does nothing
- return arg;
- }
-
-
- // set owner
- argn.ownerNode = ownerNode;
- argn.isOwned(true);
-
- int i = findNamePoint(argn.getNodeName(),0);
- AttrImpl previous = null;
- if (i >= 0) {
- previous = (AttrImpl) nodes.get(i);
- nodes.set(i, arg);
- previous.ownerNode = ownerNode.ownerDocument();
- previous.isOwned(false);
- // make sure it won't be mistaken with defaults in case it's reused
- previous.isSpecified(true);
- } else {
- i = -1 - i; // Insert point (may be end of list)
- if (null == nodes) {
- nodes = new ArrayList(5);
- }
- nodes.add(i, arg);
- }
-
- // notify document
- ownerNode.ownerDocument().setAttrNode(argn, previous);
-
- // If the new attribute is not normalized,
- // the owning element is inherently not normalized.
- if (!argn.isNormalized()) {
- ownerNode.isNormalized(false);
- }
- return previous;
-
- } // setNamedItem(Node):Node
-
- /**
- * Adds an attribute using its namespaceURI and localName.
- * @see org.w3c.dom.NamedNodeMap#setNamedItem
- * @return If the new Node replaces an existing node the replaced Node is
- * returned, otherwise null is returned.
- * @param arg A node to store in a named node map.
- */
- public Node setNamedItemNS(Node arg)
- throws DOMException {
-
- boolean errCheck = ownerNode.ownerDocument().errorChecking;
- if (errCheck) {
- if (isReadOnly()) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null);
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg);
- }
- if(arg.getOwnerDocument() != ownerNode.ownerDocument()) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null);
- throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, msg);
- }
- if (arg.getNodeType() != Node.ATTRIBUTE_NODE) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "HIERARCHY_REQUEST_ERR", null);
- throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, msg);
- }
- }
- AttrImpl argn = (AttrImpl)arg;
-
- if (argn.isOwned()){
- if (errCheck && argn.getOwnerElement() != ownerNode) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INUSE_ATTRIBUTE_ERR", null);
- throw new DOMException(DOMException.INUSE_ATTRIBUTE_ERR, msg);
- }
- // replacing an Attribute with itself does nothing
- return arg;
- }
-
- // set owner
- argn.ownerNode = ownerNode;
- argn.isOwned(true);
-
- int i = findNamePoint(argn.getNamespaceURI(), argn.getLocalName());
- AttrImpl previous = null;
- if (i >= 0) {
- previous = (AttrImpl) nodes.get(i);
- nodes.set(i, arg);
- previous.ownerNode = ownerNode.ownerDocument();
- previous.isOwned(false);
- // make sure it won't be mistaken with defaults in case it's reused
- previous.isSpecified(true);
- } else {
- // If we can't find by namespaceURI, localName, then we find by
- // nodeName so we know where to insert.
- i = findNamePoint(arg.getNodeName(),0);
- if (i >=0) {
- previous = (AttrImpl) nodes.get(i);
- nodes.add(i, arg);
- } else {
- i = -1 - i; // Insert point (may be end of list)
- if (null == nodes) {
- nodes = new ArrayList(5);
- }
- nodes.add(i, arg);
- }
- }
- // changed(true);
-
- // notify document
- ownerNode.ownerDocument().setAttrNode(argn, previous);
-
- // If the new attribute is not normalized,
- // the owning element is inherently not normalized.
- if (!argn.isNormalized()) {
- ownerNode.isNormalized(false);
- }
- return previous;
-
- } // setNamedItemNS(Node):Node
-
- /**
- * Removes an attribute specified by name.
- * @param name
- * The name of a node to remove. If the
- * removed attribute is known to have a default value, an
- * attribute immediately appears containing the default value
- * as well as the corresponding namespace URI, local name,
- * and prefix when applicable.
- * @return The node removed from the map if a node with such a name exists.
- * @throws NOT_FOUND_ERR: Raised if there is no node named
- * name in the map.
- */
- /***/
- public Node removeNamedItem(String name)
- throws DOMException {
- return internalRemoveNamedItem(name, true);
- }
-
- /**
- * Same as removeNamedItem except that it simply returns null if the
- * specified name is not found.
- */
- Node safeRemoveNamedItem(String name) {
- return internalRemoveNamedItem(name, false);
- }
-
-
- /**
- * NON-DOM: Remove the node object
- *
- * NOTE: Specifically removes THIS NODE -- not the node with this
- * name, nor the node with these contents. If node does not belong to
- * this named node map, we throw a DOMException.
- *
- * @param item The node to remove
- * @param addDefault true -- magically add default attribute
- * @return Removed node
- * @exception DOMException
- */
- protected Node removeItem(Node item, boolean addDefault)
- throws DOMException {
-
- int index = -1;
- if (nodes != null) {
- final int size = nodes.size();
- for (int i = 0; i < size; ++i) {
- if (nodes.get(i) == item) {
- index = i;
- break;
- }
- }
- }
- if (index < 0) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_FOUND_ERR", null);
- throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
- }
-
- return remove((AttrImpl)item, index, addDefault);
- }
-
- /**
- * Internal removeNamedItem method allowing to specify whether an exception
- * must be thrown if the specified name is not found.
- */
- final protected Node internalRemoveNamedItem(String name, boolean raiseEx){
- if (isReadOnly()) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null);
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg);
- }
- int i = findNamePoint(name,0);
- if (i < 0) {
- if (raiseEx) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_FOUND_ERR", null);
- throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
- } else {
- return null;
- }
- }
-
- return remove((AttrImpl)nodes.get(i), i, true);
-
- } // internalRemoveNamedItem(String,boolean):Node
-
- private final Node remove(AttrImpl attr, int index,
- boolean addDefault) {
-
- CoreDocumentImpl ownerDocument = ownerNode.ownerDocument();
- String name = attr.getNodeName();
- if (attr.isIdAttribute()) {
- ownerDocument.removeIdentifier(attr.getValue());
- }
-
- if (hasDefaults() && addDefault) {
- // If there's a default, add it instead
- NamedNodeMapImpl defaults =
- ((ElementImpl) ownerNode).getDefaultAttributes();
-
- Node d;
- if (defaults != null &&
- (d = defaults.getNamedItem(name)) != null &&
- findNamePoint(name, index+1) < 0) {
- NodeImpl clone = (NodeImpl)d.cloneNode(true);
- if (d.getLocalName() !=null){
- // we must rely on the name to find a default attribute
- // ("test:attr"), but while copying it from the DOCTYPE
- // we should not loose namespace URI that was assigned
- // to the attribute in the instance document.
- ((AttrNSImpl)clone).namespaceURI = attr.getNamespaceURI();
- }
- clone.ownerNode = ownerNode;
- clone.isOwned(true);
- clone.isSpecified(false);
-
- nodes.set(index, clone);
- if (attr.isIdAttribute()) {
- ownerDocument.putIdentifier(clone.getNodeValue(),
- (ElementImpl)ownerNode);
- }
- } else {
- nodes.remove(index);
- }
- } else {
- nodes.remove(index);
- }
-
- // changed(true);
-
- // remove reference to owner
- attr.ownerNode = ownerDocument;
- attr.isOwned(false);
-
- // make sure it won't be mistaken with defaults in case it's
- // reused
- attr.isSpecified(true);
- attr.isIdAttribute(false);
-
- // notify document
- ownerDocument.removedAttrNode(attr, ownerNode, name);
-
- return attr;
- }
-
- /**
- * Introduced in DOM Level 2. <p>
- * Removes an attribute specified by local name and namespace URI.
- * @param namespaceURI
- * The namespace URI of the node to remove.
- * When it is null or an empty string, this
- * method behaves like removeNamedItem.
- * @param name The local name of the node to remove. If the
- * removed attribute is known to have a default
- * value, an attribute immediately appears
- * containing the default value.
- * @return Node The node removed from the map if a node with such
- * a local name and namespace URI exists.
- * @throws NOT_FOUND_ERR: Raised if there is no node named
- * name in the map.
- */
- public Node removeNamedItemNS(String namespaceURI, String name)
- throws DOMException {
- return internalRemoveNamedItemNS(namespaceURI, name, true);
- }
-
- /**
- * Same as removeNamedItem except that it simply returns null if the
- * specified local name and namespace URI is not found.
- */
- Node safeRemoveNamedItemNS(String namespaceURI, String name) {
- return internalRemoveNamedItemNS(namespaceURI, name, false);
- }
-
- /**
- * Internal removeNamedItemNS method allowing to specify whether an
- * exception must be thrown if the specified local name and namespace URI
- * is not found.
- */
- final protected Node internalRemoveNamedItemNS(String namespaceURI,
- String name,
- boolean raiseEx) {
-
- CoreDocumentImpl ownerDocument = ownerNode.ownerDocument();
- if (ownerDocument.errorChecking && isReadOnly()) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null);
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg);
- }
- int i = findNamePoint(namespaceURI, name);
- if (i < 0) {
- if (raiseEx) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_FOUND_ERR", null);
- throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
- } else {
- return null;
- }
- }
-
- AttrImpl n = (AttrImpl)nodes.get(i);
-
- if (n.isIdAttribute()) {
- ownerDocument.removeIdentifier(n.getValue());
- }
- // If there's a default, add it instead
- String nodeName = n.getNodeName();
- if (hasDefaults()) {
- NamedNodeMapImpl defaults = ((ElementImpl) ownerNode).getDefaultAttributes();
- Node d;
- if (defaults != null
- && (d = defaults.getNamedItem(nodeName)) != null)
- {
- int j = findNamePoint(nodeName,0);
- if (j>=0 && findNamePoint(nodeName, j+1) < 0) {
- NodeImpl clone = (NodeImpl)d.cloneNode(true);
- clone.ownerNode = ownerNode;
- if (d.getLocalName() != null) {
- // we must rely on the name to find a default attribute
- // ("test:attr"), but while copying it from the DOCTYPE
- // we should not loose namespace URI that was assigned
- // to the attribute in the instance document.
- ((AttrNSImpl)clone).namespaceURI = namespaceURI;
- }
- clone.isOwned(true);
- clone.isSpecified(false);
- nodes.set(i, clone);
- if (clone.isIdAttribute()) {
- ownerDocument.putIdentifier(clone.getNodeValue(),
- (ElementImpl)ownerNode);
- }
- } else {
- nodes.remove(i);
- }
- } else {
- nodes.remove(i);
- }
- } else {
- nodes.remove(i);
- }
-
- // changed(true);
-
- // remove reference to owner
- n.ownerNode = ownerDocument;
- n.isOwned(false);
- // make sure it won't be mistaken with defaults in case it's
- // reused
- n.isSpecified(true);
- // update id table if needed
- n.isIdAttribute(false);
-
- // notify document
- ownerDocument.removedAttrNode(n, ownerNode, name);
-
- return n;
-
- } // internalRemoveNamedItemNS(String,String,boolean):Node
-
- //
- // Public methods
- //
-
- /**
- * Cloning a NamedNodeMap is a DEEP OPERATION; it always clones
- * all the nodes contained in the map.
- */
-
- public NamedNodeMapImpl cloneMap(NodeImpl ownerNode) {
- AttributeMap newmap =
- new AttributeMap((ElementImpl) ownerNode, null);
- newmap.hasDefaults(hasDefaults());
- newmap.cloneContent(this);
- return newmap;
- } // cloneMap():AttributeMap
-
- /**
- * Override parent's method to set the ownerNode correctly
- */
- protected void cloneContent(NamedNodeMapImpl srcmap) {
- List srcnodes = srcmap.nodes;
- if (srcnodes != null) {
- int size = srcnodes.size();
- if (size != 0) {
- if (nodes == null) {
- nodes = new ArrayList(size);
- }
- else {
- nodes.clear();
- }
- for (int i = 0; i < size; ++i) {
- NodeImpl n = (NodeImpl) srcnodes.get(i);
- NodeImpl clone = (NodeImpl) n.cloneNode(true);
- clone.isSpecified(n.isSpecified());
- nodes.add(clone);
- clone.ownerNode = ownerNode;
- clone.isOwned(true);
- }
- }
- }
- } // cloneContent():AttributeMap
-
-
- /**
- * Move specified attributes from the given map to this one
- */
- void moveSpecifiedAttributes(AttributeMap srcmap) {
- int nsize = (srcmap.nodes != null) ? srcmap.nodes.size() : 0;
- for (int i = nsize - 1; i >= 0; i--) {
- AttrImpl attr = (AttrImpl) srcmap.nodes.get(i);
- if (attr.isSpecified()) {
- srcmap.remove(attr, i, false);
- if (attr.getLocalName() != null) {
- setNamedItem(attr);
- }
- else {
- setNamedItemNS(attr);
- }
- }
- }
- } // moveSpecifiedAttributes(AttributeMap):void
-
-
- /**
- * Get this AttributeMap in sync with the given "defaults" map.
- * @param defaults The default attributes map to sync with.
- */
- protected void reconcileDefaults(NamedNodeMapImpl defaults) {
-
- // remove any existing default
- int nsize = (nodes != null) ? nodes.size() : 0;
- for (int i = nsize - 1; i >= 0; --i) {
- AttrImpl attr = (AttrImpl) nodes.get(i);
- if (!attr.isSpecified()) {
- remove(attr, i, false);
- }
- }
- // add the new defaults
- if (defaults == null) {
- return;
- }
- if (nodes == null || nodes.size() == 0) {
- cloneContent(defaults);
- }
- else {
- int dsize = defaults.nodes.size();
- for (int n = 0; n < dsize; ++n) {
- AttrImpl d = (AttrImpl) defaults.nodes.get(n);
- int i = findNamePoint(d.getNodeName(), 0);
- if (i < 0) {
- i = -1 - i;
- NodeImpl clone = (NodeImpl) d.cloneNode(true);
- clone.ownerNode = ownerNode;
- clone.isOwned(true);
- clone.isSpecified(false);
- nodes.add(i, clone);
- }
- }
- }
-
- } // reconcileDefaults()
-
- protected final int addItem (Node arg) {
-
- final AttrImpl argn = (AttrImpl) arg;
-
- // set owner
- argn.ownerNode = ownerNode;
- argn.isOwned(true);
-
- int i = findNamePoint(argn.getNamespaceURI(), argn.getLocalName());
- if (i >= 0) {
- nodes.set(i, arg);
- }
- else {
- // If we can't find by namespaceURI, localName, then we find by
- // nodeName so we know where to insert.
- i = findNamePoint(argn.getNodeName(),0);
- if (i >= 0) {
- nodes.add(i, arg);
- }
- else {
- i = -1 - i; // Insert point (may be end of list)
- if (null == nodes) {
- nodes = new ArrayList(5);
- }
- nodes.add(i, arg);
- }
- }
-
- // notify document
- ownerNode.ownerDocument().setAttrNode(argn, null);
- return i;
- }
-
-} // class AttributeMap
diff --git a/src/com/sun/org/apache/xerces/internal/dom/CDATASectionImpl.java b/src/com/sun/org/apache/xerces/internal/dom/CDATASectionImpl.java
deleted file mode 100644
index 0a49560..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/CDATASectionImpl.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-import org.w3c.dom.CDATASection;
-import org.w3c.dom.Node;
-
-/**
- * XML provides the CDATA markup to allow a region of text in which
- * most of the XML delimiter recognition does not take place. This is
- * intended to ease the task of quoting XML fragments and other
- * programmatic information in a document's text without needing to
- * escape these special characters. It's primarily a convenience feature
- * for those who are hand-editing XML.
- * <P>
- * CDATASection is an Extended DOM feature, and is not used in HTML
- * contexts.
- * <P>
- * Within the DOM, CDATASections are treated essentially as Text
- * blocks. Their distinct type is retained in order to allow us to
- * properly recreate the XML syntax when we write them out.
- * <P>
- * Reminder: CDATA IS NOT A COMPLETELY GENERAL SOLUTION; it can't
- * quote its own end-of-block marking. If you need to write out a
- * CDATA that contains the ]]> sequence, it's your responsibility to
- * split that string over two successive CDATAs at that time.
- * <P>
- * CDATA does not participate in Element.normalize() processing.
- *
- * @xerces.internal
- *
- * @since PR-DOM-Level-1-19980818.
- */
-public class CDATASectionImpl
- extends TextImpl
- implements CDATASection {
-
- //
- // Constants
- //
-
- /** Serialization version. */
- static final long serialVersionUID = 2372071297878177780L;
-
- //
- // Constructors
- //
-
- /** Factory constructor for creating a CDATA section. */
- public CDATASectionImpl(CoreDocumentImpl ownerDoc, String data) {
- super(ownerDoc, data);
- }
-
- //
- // Node methods
- //
-
- /**
- * A short integer indicating what type of node this is. The named
- * constants for this value are defined in the org.w3c.dom.Node interface.
- */
- public short getNodeType() {
- return Node.CDATA_SECTION_NODE;
- }
-
- /** Returns the node name. */
- public String getNodeName() {
- return "#cdata-section";
- }
-
-} // class CDATASectionImpl
diff --git a/src/com/sun/org/apache/xerces/internal/dom/CharacterDataImpl.java b/src/com/sun/org/apache/xerces/internal/dom/CharacterDataImpl.java
deleted file mode 100644
index 6f3e5a3..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/CharacterDataImpl.java
+++ /dev/null
@@ -1,425 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * CharacterData is an abstract Node that can carry character data as its
- * Value. It provides shared behavior for Text, CData, and
- * possibly other node types. All offsets are 0-based.
- * <p>
- * Since ProcessingInstructionImpl inherits from this class to reuse the
- * setNodeValue method, this class isn't declared as implementing the interface
- * CharacterData. This is done by relevant subclasses (TexImpl, CommentImpl).
- * <p>
- * This class doesn't directly support mutation events, however, it notifies
- * the document when mutations are performed so that the document class do so.
- *
- * @xerces.internal
- *
- * @since PR-DOM-Level-1-19980818.
- */
-public abstract class CharacterDataImpl
- extends ChildNode {
-
- //
- // Constants
- //
-
- /** Serialization version. */
- static final long serialVersionUID = 7931170150428474230L;
-
- //
- // Data
- //
-
- protected String data;
-
- /** Empty child nodes. */
- private static transient NodeList singletonNodeList = new NodeList() {
- public Node item(int index) { return null; }
- public int getLength() { return 0; }
- };
-
- //
- // Constructors
- //
-
- public CharacterDataImpl(){}
-
- /** Factory constructor. */
- protected CharacterDataImpl(CoreDocumentImpl ownerDocument, String data) {
- super(ownerDocument);
- this.data = data;
- }
-
- //
- // Node methods
- //
-
- /** Returns an empty node list. */
- public NodeList getChildNodes() {
- return singletonNodeList;
- }
-
- /*
- * returns the content of this node
- */
- public String getNodeValue() {
- if (needsSyncData()) {
- synchronizeData();
- }
- return data;
- }
-
- /** Convenience wrapper for calling setNodeValueInternal when
- * we are not performing a replacement operation
- */
- protected void setNodeValueInternal (String value) {
- setNodeValueInternal(value, false);
- }
-
- /** This function added so that we can distinguish whether
- * setNodeValue has been called from some other DOM functions.
- * or by the client.<p>
- * This is important, because we do one type of Range fix-up,
- * from the high-level functions in CharacterData, and another
- * type if the client simply calls setNodeValue(value).
- */
- protected void setNodeValueInternal(String value, boolean replace) {
-
- CoreDocumentImpl ownerDocument = ownerDocument();
-
- if (ownerDocument.errorChecking && isReadOnly()) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null);
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg);
- }
-
- // revisit: may want to set the value in ownerDocument.
- // Default behavior, overridden in some subclasses
- if (needsSyncData()) {
- synchronizeData();
- }
-
- // keep old value for document notification
- String oldvalue = this.data;
-
- // notify document
- ownerDocument.modifyingCharacterData(this, replace);
-
- this.data = value;
-
- // notify document
- ownerDocument.modifiedCharacterData(this, oldvalue, value, replace);
- }
-
- /**
- * Sets the content, possibly firing related events,
- * and updating ranges (via notification to the document)
- */
- public void setNodeValue(String value) {
-
- setNodeValueInternal(value);
-
- // notify document
- ownerDocument().replacedText(this);
- }
-
- //
- // CharacterData methods
- //
-
- /**
- * Retrieve character data currently stored in this node.
- *
- * @throws DOMExcpetion(DOMSTRING_SIZE_ERR) In some implementations,
- * the stored data may exceed the permitted length of strings. If so,
- * getData() will throw this DOMException advising the user to
- * instead retrieve the data in chunks via the substring() operation.
- */
- public String getData() {
- if (needsSyncData()) {
- synchronizeData();
- }
- return data;
- }
-
- /**
- * Report number of characters currently stored in this node's
- * data. It may be 0, meaning that the value is an empty string.
- */
- public int getLength() {
- if (needsSyncData()) {
- synchronizeData();
- }
- return data.length();
- }
-
- /**
- * Concatenate additional characters onto the end of the data
- * stored in this node. Note that this, and insert(), are the paths
- * by which a DOM could wind up accumulating more data than the
- * language's strings can easily handle. (See above discussion.)
- *
- * @throws DOMException(NO_MODIFICATION_ALLOWED_ERR) if node is readonly.
- */
- public void appendData(String data) {
-
- if (isReadOnly()) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null);
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg);
- }
- if (data == null) {
- return;
- }
- if (needsSyncData()) {
- synchronizeData();
- }
-
- setNodeValue(this.data + data);
-
- } // appendData(String)
-
- /**
- * Remove a range of characters from the node's value. Throws a
- * DOMException if the offset is beyond the end of the
- * string. However, a deletion _count_ that exceeds the available
- * data is accepted as a delete-to-end request.
- *
- * @throws DOMException(INDEX_SIZE_ERR) if offset is negative or
- * greater than length, or if count is negative.
- *
- * @throws DOMException(NO_MODIFICATION_ALLOWED_ERR) if node is
- * readonly.
- */
- public void deleteData(int offset, int count)
- throws DOMException {
-
- internalDeleteData(offset, count, false);
- } // deleteData(int,int)
-
-
- /** NON-DOM INTERNAL: Within DOM actions, we sometimes need to be able
- * to control which mutation events are spawned. This version of the
- * deleteData operation allows us to do so. It is not intended
- * for use by application programs.
- */
- void internalDeleteData (int offset, int count, boolean replace)
- throws DOMException {
-
- CoreDocumentImpl ownerDocument = ownerDocument();
- if (ownerDocument.errorChecking) {
- if (isReadOnly()) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null);
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg);
- }
-
- if (count < 0) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INDEX_SIZE_ERR", null);
- throw new DOMException(DOMException.INDEX_SIZE_ERR, msg);
- }
- }
-
- if (needsSyncData()) {
- synchronizeData();
- }
- int tailLength = Math.max(data.length() - count - offset, 0);
- try {
- String value = data.substring(0, offset) +
- (tailLength > 0 ? data.substring(offset + count, offset + count + tailLength) : "");
-
- setNodeValueInternal(value, replace);
-
- // notify document
- ownerDocument.deletedText(this, offset, count);
- }
- catch (StringIndexOutOfBoundsException e) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INDEX_SIZE_ERR", null);
- throw new DOMException(DOMException.INDEX_SIZE_ERR, msg);
- }
-
- } // internalDeleteData(int,int,boolean)
-
- /**
- * Insert additional characters into the data stored in this node,
- * at the offset specified.
- *
- * @throws DOMException(INDEX_SIZE_ERR) if offset is negative or
- * greater than length.
- *
- * @throws DOMException(NO_MODIFICATION_ALLOWED_ERR) if node is readonly.
- */
- public void insertData(int offset, String data)
- throws DOMException {
-
- internalInsertData(offset, data, false);
-
- } // insertData(int,int)
-
-
-
- /** NON-DOM INTERNAL: Within DOM actions, we sometimes need to be able
- * to control which mutation events are spawned. This version of the
- * insertData operation allows us to do so. It is not intended
- * for use by application programs.
- */
- void internalInsertData (int offset, String data, boolean replace)
- throws DOMException {
-
- CoreDocumentImpl ownerDocument = ownerDocument();
-
- if (ownerDocument.errorChecking && isReadOnly()) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null);
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg);
- }
-
- if (needsSyncData()) {
- synchronizeData();
- }
- try {
- String value =
- new StringBuffer(this.data).insert(offset, data).toString();
-
-
- setNodeValueInternal(value, replace);
-
- // notify document
- ownerDocument.insertedText(this, offset, data.length());
- }
- catch (StringIndexOutOfBoundsException e) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INDEX_SIZE_ERR", null);
- throw new DOMException(DOMException.INDEX_SIZE_ERR, msg);
- }
-
- } // internalInsertData(int,String,boolean)
-
-
-
- /**
- * Replace a series of characters at the specified (zero-based)
- * offset with a new string, NOT necessarily of the same
- * length. Convenience method, equivalent to a delete followed by an
- * insert. Throws a DOMException if the specified offset is beyond
- * the end of the existing data.
- *
- * @param offset The offset at which to begin replacing.
- *
- * @param count The number of characters to remove,
- * interpreted as in the delete() method.
- *
- * @param data The new string to be inserted at offset in place of
- * the removed data. Note that the entire string will
- * be inserted -- the count parameter does not affect
- * insertion, and the new data may be longer or shorter
- * than the substring it replaces.
- *
- * @throws DOMException(INDEX_SIZE_ERR) if offset is negative or
- * greater than length, or if count is negative.
- *
- * @throws DOMException(NO_MODIFICATION_ALLOWED_ERR) if node is
- * readonly.
- */
- public void replaceData(int offset, int count, String data)
- throws DOMException {
-
- CoreDocumentImpl ownerDocument = ownerDocument();
-
- // The read-only check is done by deleteData()
- // ***** This could be more efficient w/r/t Mutation Events,
- // specifically by aggregating DOMAttrModified and
- // DOMSubtreeModified. But mutation events are
- // underspecified; I don't feel compelled
- // to deal with it right now.
- if (ownerDocument.errorChecking && isReadOnly()) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null);
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg);
- }
-
- if (needsSyncData()) {
- synchronizeData();
- }
-
- //notify document
- ownerDocument.replacingData(this);
-
- // keep old value for document notification
- String oldvalue = this.data;
-
- internalDeleteData(offset, count, true);
- internalInsertData(offset, data, true);
-
- ownerDocument.replacedCharacterData(this, oldvalue, this.data);
-
- } // replaceData(int,int,String)
-
- /**
- * Store character data into this node.
- *
- * @throws DOMException(NO_MODIFICATION_ALLOWED_ERR) if node is readonly.
- */
- public void setData(String value)
- throws DOMException {
- setNodeValue(value);
- }
-
- /**
- * Substring is more than a convenience function. In some
- * implementations of the DOM, where the stored data may exceed the
- * length that can be returned in a single string, the only way to
- * read it all is to extract it in chunks via this method.
- *
- * @param offset Zero-based offset of first character to retrieve.
- * @param count Number of characters to retrieve.
- *
- * If the sum of offset and count exceeds the length, all characters
- * to end of data are returned.
- *
- * @throws DOMException(INDEX_SIZE_ERR) if offset is negative or
- * greater than length, or if count is negative.
- *
- * @throws DOMException(WSTRING_SIZE_ERR) In some implementations,
- * count may exceed the permitted length of strings. If so,
- * substring() will throw this DOMException advising the user to
- * instead retrieve the data in smaller chunks.
- */
- public String substringData(int offset, int count)
- throws DOMException {
-
- if (needsSyncData()) {
- synchronizeData();
- }
-
- int length = data.length();
- if (count < 0 || offset < 0 || offset > length - 1) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INDEX_SIZE_ERR", null);
- throw new DOMException(DOMException.INDEX_SIZE_ERR, msg);
- }
-
- int tailIndex = Math.min(offset + count, length);
-
- return data.substring(offset, tailIndex);
-
- } // substringData(int,int):String
-
-} // class CharacterDataImpl
diff --git a/src/com/sun/org/apache/xerces/internal/dom/ChildNode.java b/src/com/sun/org/apache/xerces/internal/dom/ChildNode.java
deleted file mode 100644
index 3dab9c9..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/ChildNode.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2000-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-import org.w3c.dom.Node;
-
-/**
- * ChildNode inherits from NodeImpl and adds the capability of being a child by
- * having references to its previous and next siblings.
- *
- * @xerces.internal
- *
- */
-public abstract class ChildNode
- extends NodeImpl {
-
- //
- // Constants
- //
-
- /** Serialization version. */
- static final long serialVersionUID = -6112455738802414002L;
-
- transient StringBuffer fBufferStr = null;
-
- //
- // Data
- //
-
- /** Previous sibling. */
- protected ChildNode previousSibling;
-
- /** Next sibling. */
- protected ChildNode nextSibling;
-
- //
- // Constructors
- //
-
- /**
- * No public constructor; only subclasses of Node should be
- * instantiated, and those normally via a Document's factory methods
- * <p>
- * Every Node knows what Document it belongs to.
- */
- protected ChildNode(CoreDocumentImpl ownerDocument) {
- super(ownerDocument);
- } // <init>(CoreDocumentImpl)
-
- /** Constructor for serialization. */
- public ChildNode() {}
-
- //
- // Node methods
- //
-
- /**
- * Returns a duplicate of a given node. You can consider this a
- * generic "copy constructor" for nodes. The newly returned object should
- * be completely independent of the source object's subtree, so changes
- * in one after the clone has been made will not affect the other.
- * <P>
- * Note: since we never have any children deep is meaningless here,
- * ParentNode overrides this behavior.
- * @see ParentNode
- *
- * <p>
- * Example: Cloning a Text node will copy both the node and the text it
- * contains.
- * <p>
- * Example: Cloning something that has children -- Element or Attr, for
- * example -- will _not_ clone those children unless a "deep clone"
- * has been requested. A shallow clone of an Attr node will yield an
- * empty Attr of the same name.
- * <p>
- * NOTE: Clones will always be read/write, even if the node being cloned
- * is read-only, to permit applications using only the DOM API to obtain
- * editable copies of locked portions of the tree.
- */
- public Node cloneNode(boolean deep) {
-
- ChildNode newnode = (ChildNode) super.cloneNode(deep);
-
- // Need to break the association w/ original kids
- newnode.previousSibling = null;
- newnode.nextSibling = null;
- newnode.isFirstChild(false);
-
- return newnode;
-
- } // cloneNode(boolean):Node
-
- /**
- * Returns the parent node of this node
- */
- public Node getParentNode() {
- // if we have an owner, ownerNode is our parent, otherwise it's
- // our ownerDocument and we don't have a parent
- return isOwned() ? ownerNode : null;
- }
-
- /*
- * same as above but returns internal type
- */
- final NodeImpl parentNode() {
- // if we have an owner, ownerNode is our parent, otherwise it's
- // our ownerDocument and we don't have a parent
- return isOwned() ? ownerNode : null;
- }
-
- /** The next child of this node's parent, or null if none */
- public Node getNextSibling() {
- return nextSibling;
- }
-
- /** The previous child of this node's parent, or null if none */
- public Node getPreviousSibling() {
- // if we are the firstChild, previousSibling actually refers to our
- // parent's lastChild, but we hide that
- return isFirstChild() ? null : previousSibling;
- }
-
- /*
- * same as above but returns internal type
- */
- final ChildNode previousSibling() {
- // if we are the firstChild, previousSibling actually refers to our
- // parent's lastChild, but we hide that
- return isFirstChild() ? null : previousSibling;
- }
-
-} // class ChildNode
diff --git a/src/com/sun/org/apache/xerces/internal/dom/CommentImpl.java b/src/com/sun/org/apache/xerces/internal/dom/CommentImpl.java
deleted file mode 100644
index 418e2cc..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/CommentImpl.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-import org.w3c.dom.CharacterData;
-import org.w3c.dom.Comment;
-import org.w3c.dom.Node;
-
-/**
- * Represents an XML (or HTML) comment.
- *
- * @xerces.internal
- *
- * @since PR-DOM-Level-1-19980818.
- */
-public class CommentImpl
- extends CharacterDataImpl
- implements CharacterData, Comment {
-
- //
- // Constants
- //
-
- /** Serialization version. */
- static final long serialVersionUID = -2685736833408134044L;
-
- //
- // Constructors
- //
-
- /** Factory constructor. */
- public CommentImpl(CoreDocumentImpl ownerDoc, String data) {
- super(ownerDoc, data);
- }
-
- //
- // Node methods
- //
-
- /**
- * A short integer indicating what type of node this is. The named
- * constants for this value are defined in the org.w3c.dom.Node interface.
- */
- public short getNodeType() {
- return Node.COMMENT_NODE;
- }
-
- /** Returns the node name. */
- public String getNodeName() {
- return "#comment";
- }
-
-} // class CommentImpl
diff --git a/src/com/sun/org/apache/xerces/internal/dom/CoreDOMImplementationImpl.java b/src/com/sun/org/apache/xerces/internal/dom/CoreDOMImplementationImpl.java
deleted file mode 100644
index f20775e..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/CoreDOMImplementationImpl.java
+++ /dev/null
@@ -1,488 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xerces.internal.dom;
-
-import com.sun.org.apache.xerces.internal.impl.RevalidationHandler;
-import com.sun.org.apache.xerces.internal.parsers.DOMParserImpl;
-import com.sun.org.apache.xerces.internal.parsers.DTDConfiguration;
-import com.sun.org.apache.xerces.internal.parsers.XIncludeAwareParserConfiguration;
-import com.sun.org.apache.xerces.internal.util.XMLChar;
-import com.sun.org.apache.xerces.internal.utils.ObjectFactory;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription;
-import com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.ls.LSParser;
-import org.w3c.dom.ls.DOMImplementationLS;
-import org.w3c.dom.ls.LSInput;
-import org.w3c.dom.ls.LSOutput;
-import org.w3c.dom.ls.LSSerializer;
-/**
- * The DOMImplementation class is description of a particular
- * implementation of the Document Object Model. As such its data is
- * static, shared by all instances of this implementation.
- * <P>
- * The DOM API requires that it be a real object rather than static
- * methods. However, there's nothing that says it can't be a singleton,
- * so that's how I've implemented it.
- * <P>
- * This particular class, along with CoreDocumentImpl, supports the DOM
- * Core and Load/Save (Experimental). Optional modules are supported by
- * the more complete DOMImplementation class along with DocumentImpl.
- *
- * @xerces.internal
- *
- * @version $Id: CoreDOMImplementationImpl.java,v 1.6 2010-11-01 04:39:37 joehw Exp $
- * @since PR-DOM-Level-1-19980818.
- */
-public class CoreDOMImplementationImpl
- implements DOMImplementation, DOMImplementationLS {
- //
- // Data
- //
-
- // validators pool
- private static final int SIZE = 2;
- private RevalidationHandler validators[] = new RevalidationHandler[SIZE];
-
- private RevalidationHandler dtdValidators[] = new RevalidationHandler[SIZE];
- private int freeValidatorIndex = -1;
- private int freeDTDValidatorIndex = -1;
- private int currentSize = SIZE;
-
- // Document and doctype counter. Used to assign order to documents and
- // doctypes without owners, on an demand basis. Used for
- // compareDocumentPosition
- private int docAndDoctypeCounter = 0;
-
- // static
- /** Dom implementation singleton. */
- static CoreDOMImplementationImpl singleton =
- new CoreDOMImplementationImpl();
- //
- // Public methods
- //
- /** NON-DOM: Obtain and return the single shared object */
- public static DOMImplementation getDOMImplementation() {
- return singleton;
- }
- //
- // DOMImplementation methods
- //
- /**
- * Test if the DOM implementation supports a specific "feature" --
- * currently meaning language and level thereof.
- *
- * @param feature The package name of the feature to test.
- * In Level 1, supported values are "HTML" and "XML" (case-insensitive).
- * At this writing, com.sun.org.apache.xerces.internal.dom supports only XML.
- *
- * @param version The version number of the feature being tested.
- * This is interpreted as "Version of the DOM API supported for the
- * specified Feature", and in Level 1 should be "1.0"
- *
- * @return true iff this implementation is compatable with the specified
- * feature and version.
- */
- public boolean hasFeature(String feature, String version) {
-
- boolean anyVersion = version == null || version.length() == 0;
-
- // check if Xalan implementation is around and if yes report true for supporting
- // XPath API
- // if a plus sign "+" is prepended to any feature name, implementations
- // are considered in which the specified feature may not be directly
- // castable DOMImplementation.getFeature(feature, version). Without a
- // plus, only features whose interfaces are directly castable are considered.
- if ((feature.equalsIgnoreCase("+XPath"))
- && (anyVersion || version.equals("3.0"))) {
- try {
- Class xpathClass = ObjectFactory.findProviderClass(
- "com.sun.org.apache.xpath.internal.domapi.XPathEvaluatorImpl", true);
-
- // Check if the DOM XPath implementation implements
- // the interface org.w3c.dom.XPathEvaluator
- Class interfaces[] = xpathClass.getInterfaces();
- for (int i = 0; i < interfaces.length; i++) {
- if (interfaces[i].getName().equals(
- "org.w3c.dom.xpath.XPathEvaluator")) {
- return true;
- }
- }
- } catch (Exception e) {
- return false;
- }
- return true;
- }
- if (feature.startsWith("+")) {
- feature = feature.substring(1);
- }
- return (
- feature.equalsIgnoreCase("Core")
- && (anyVersion
- || version.equals("1.0")
- || version.equals("2.0")
- || version.equals("3.0")))
- || (feature.equalsIgnoreCase("XML")
- && (anyVersion
- || version.equals("1.0")
- || version.equals("2.0")
- || version.equals("3.0")))
- || (feature.equalsIgnoreCase("LS")
- && (anyVersion || version.equals("3.0")));
- } // hasFeature(String,String):boolean
-
-
- /**
- * Introduced in DOM Level 2. <p>
- *
- * Creates an empty DocumentType node.
- *
- * @param qualifiedName The qualified name of the document type to be created.
- * @param publicID The document type public identifier.
- * @param systemID The document type system identifier.
- * @since WD-DOM-Level-2-19990923
- */
- public DocumentType createDocumentType( String qualifiedName,
- String publicID, String systemID) {
- // REVISIT: this might allow creation of invalid name for DOCTYPE
- // xmlns prefix.
- // also there is no way for a user to turn off error checking.
- checkQName(qualifiedName);
- return new DocumentTypeImpl(null, qualifiedName, publicID, systemID);
- }
-
- final void checkQName(String qname){
- int index = qname.indexOf(':');
- int lastIndex = qname.lastIndexOf(':');
- int length = qname.length();
-
- // it is an error for NCName to have more than one ':'
- // check if it is valid QName [Namespace in XML production 6]
- if (index == 0 || index == length - 1 || lastIndex != index) {
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "NAMESPACE_ERR",
- null);
- throw new DOMException(DOMException.NAMESPACE_ERR, msg);
- }
- int start = 0;
- // Namespace in XML production [6]
- if (index > 0) {
- // check that prefix is NCName
- if (!XMLChar.isNCNameStart(qname.charAt(start))) {
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "INVALID_CHARACTER_ERR",
- null);
- throw new DOMException(DOMException.INVALID_CHARACTER_ERR, msg);
- }
- for (int i = 1; i < index; i++) {
- if (!XMLChar.isNCName(qname.charAt(i))) {
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "INVALID_CHARACTER_ERR",
- null);
- throw new DOMException(
- DOMException.INVALID_CHARACTER_ERR,
- msg);
- }
- }
- start = index + 1;
- }
-
- // check local part
- if (!XMLChar.isNCNameStart(qname.charAt(start))) {
- // REVISIT: add qname parameter to the message
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "INVALID_CHARACTER_ERR",
- null);
- throw new DOMException(DOMException.INVALID_CHARACTER_ERR, msg);
- }
- for (int i = start + 1; i < length; i++) {
- if (!XMLChar.isNCName(qname.charAt(i))) {
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "INVALID_CHARACTER_ERR",
- null);
- throw new DOMException(DOMException.INVALID_CHARACTER_ERR, msg);
- }
- }
- }
-
-
- /**
- * Introduced in DOM Level 2. <p>
- *
- * Creates an XML Document object of the specified type with its document
- * element.
- *
- * @param namespaceURI The namespace URI of the document
- * element to create, or null.
- * @param qualifiedName The qualified name of the document
- * element to create.
- * @param doctype The type of document to be created or null.<p>
- *
- * When doctype is not null, its
- * Node.ownerDocument attribute is set to
- * the document being created.
- * @return Document A new Document object.
- * @throws DOMException WRONG_DOCUMENT_ERR: Raised if doctype has
- * already been used with a different document.
- * @since WD-DOM-Level-2-19990923
- */
- public Document createDocument(
- String namespaceURI,
- String qualifiedName,
- DocumentType doctype)
- throws DOMException {
- if (doctype != null && doctype.getOwnerDocument() != null) {
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "WRONG_DOCUMENT_ERR",
- null);
- throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, msg);
- }
- CoreDocumentImpl doc = new CoreDocumentImpl(doctype);
- Element e = doc.createElementNS(namespaceURI, qualifiedName);
- doc.appendChild(e);
- return doc;
- }
-
- /**
- * DOM Level 3 WD - Experimental.
- */
- public Object getFeature(String feature, String version) {
- if (singleton.hasFeature(feature, version)) {
- if ((feature.equalsIgnoreCase("+XPath"))) {
- try {
- Class xpathClass = ObjectFactory.findProviderClass(
- "com.sun.org.apache.xpath.internal.domapi.XPathEvaluatorImpl", true);
- // Check if the DOM XPath implementation implements
- // the interface org.w3c.dom.XPathEvaluator
- Class interfaces[] = xpathClass.getInterfaces();
- for (int i = 0; i < interfaces.length; i++) {
- if (interfaces[i].getName().equals(
- "org.w3c.dom.xpath.XPathEvaluator")) {
- return xpathClass.newInstance();
- }
- }
- } catch (Exception e) {
- return null;
- }
- } else {
- return singleton;
- }
- }
- return null;
- }
-
- // DOM L3 LS
-
- /**
- * DOM Level 3 LS CR - Experimental.
- * Create a new <code>LSParser</code>. The newly constructed parser may
- * then be configured by means of its <code>DOMConfiguration</code>
- * object, and used to parse documents by means of its <code>parse</code>
- * method.
- * @param mode The <code>mode</code> argument is either
- * <code>MODE_SYNCHRONOUS</code> or <code>MODE_ASYNCHRONOUS</code>, if
- * <code>mode</code> is <code>MODE_SYNCHRONOUS</code> then the
- * <code>LSParser</code> that is created will operate in synchronous
- * mode, if it's <code>MODE_ASYNCHRONOUS</code> then the
- * <code>LSParser</code> that is created will operate in asynchronous
- * mode.
- * @param schemaType An absolute URI representing the type of the schema
- * language used during the load of a <code>Document</code> using the
- * newly created <code>LSParser</code>. Note that no lexical checking
- * is done on the absolute URI. In order to create a
- * <code>LSParser</code> for any kind of schema types (i.e. the
- * LSParser will be free to use any schema found), use the value
- * <code>null</code>.
- * <p ><b>Note:</b> For W3C XML Schema [<a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/'>XML Schema Part 1</a>]
- * , applications must use the value
- * <code>"http://www.w3.org/2001/XMLSchema"</code>. For XML DTD [<a href='http://www.w3.org/TR/2000/REC-xml-20001006'>XML 1.0</a>],
- * applications must use the value
- * <code>"http://www.w3.org/TR/REC-xml"</code>. Other Schema languages
- * are outside the scope of the W3C and therefore should recommend an
- * absolute URI in order to use this method.
- * @return The newly created <code>LSParser</code> object. This
- * <code>LSParser</code> is either synchronous or asynchronous
- * depending on the value of the <code>mode</code> argument.
- * <p ><b>Note:</b> By default, the newly created <code>LSParser</code>
- * does not contain a <code>DOMErrorHandler</code>, i.e. the value of
- * the "<a href='http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030609/core.html#parameter-error-handler'>
- * error-handler</a>" configuration parameter is <code>null</code>. However, implementations
- * may provide a default error handler at creation time. In that case,
- * the initial value of the <code>"error-handler"</code> configuration
- * parameter on the new created <code>LSParser</code> contains a
- * reference to the default error handler.
- * @exception DOMException
- * NOT_SUPPORTED_ERR: Raised if the requested mode or schema type is
- * not supported.
- */
- public LSParser createLSParser(short mode, String schemaType)
- throws DOMException {
- if (mode != DOMImplementationLS.MODE_SYNCHRONOUS || (schemaType !=null &&
- !"http://www.w3.org/2001/XMLSchema".equals(schemaType) &&
- !"http://www.w3.org/TR/REC-xml".equals(schemaType))) {
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "NOT_SUPPORTED_ERR",
- null);
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
- }
- if (schemaType != null
- && schemaType.equals("http://www.w3.org/TR/REC-xml")) {
- return new DOMParserImpl(new DTDConfiguration(),
- schemaType);
- }
- else {
- // create default parser configuration validating against XMLSchemas
- return new DOMParserImpl(new XIncludeAwareParserConfiguration(),
- schemaType);
- }
- }
-
- /**
- * DOM Level 3 LS CR - Experimental.
- * Create a new <code>LSSerializer</code> object.
- * @return The newly created <code>LSSerializer</code> object.
- * <p ><b>Note:</b> By default, the newly created
- * <code>LSSerializer</code> has no <code>DOMErrorHandler</code>,
- * i.e. the value of the <code>"error-handler"</code> configuration
- * parameter is <code>null</code>. However, implementations may
- * provide a default error handler at creation time. In that case, the
- * initial value of the <code>"error-handler"</code> configuration
- * parameter on the new created <code>LSSerializer</code> contains a
- * reference to the default error handler.
- */
- public LSSerializer createLSSerializer() {
- return new DOMSerializerImpl();
- }
- /**
- * DOM Level 3 LS CR - Experimental.
- * Create a new empty input source.
- * @return The newly created input object.
- */
- public LSInput createLSInput() {
- return new DOMInputImpl();
- }
-
- //
- // Protected methods
- //
- /** NON-DOM: retrieve validator. */
- synchronized RevalidationHandler getValidator(String schemaType) {
- // REVISIT: implement retrieving DTD validator
- if (schemaType == XMLGrammarDescription.XML_SCHEMA) {
- // create new validator - we should not attempt
- // to restrict the number of validation handlers being
- // requested
- if(freeValidatorIndex < 0) {
- return (RevalidationHandler) (ObjectFactory
- .newInstance(
- "com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator",
- ObjectFactory.findClassLoader(),
- true));
- }
- // return first available validator
- RevalidationHandler val = validators[freeValidatorIndex];
- validators[freeValidatorIndex--] = null;
- return val;
- }
- else if(schemaType == XMLGrammarDescription.XML_DTD) {
- if(freeDTDValidatorIndex < 0) {
- return (RevalidationHandler) (ObjectFactory
- .newInstance(
- "com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator",
- ObjectFactory.findClassLoader(),
- true));
- }
- // return first available validator
- RevalidationHandler val = dtdValidators[freeDTDValidatorIndex];
- dtdValidators[freeDTDValidatorIndex--] = null;
- return val;
- }
- return null;
- }
-
- /** NON-DOM: release validator */
- synchronized void releaseValidator(String schemaType,
- RevalidationHandler validator) {
- // REVISIT: implement support for DTD validators as well
- if(schemaType == XMLGrammarDescription.XML_SCHEMA) {
- ++freeValidatorIndex;
- if (validators.length == freeValidatorIndex ){
- // resize size of the validators
- currentSize+=SIZE;
- RevalidationHandler newarray[] = new RevalidationHandler[currentSize];
- System.arraycopy(validators, 0, newarray, 0, validators.length);
- validators = newarray;
- }
- validators[freeValidatorIndex]=validator;
- }
- else if(schemaType == XMLGrammarDescription.XML_DTD) {
- ++freeDTDValidatorIndex;
- if (dtdValidators.length == freeDTDValidatorIndex ){
- // resize size of the validators
- currentSize+=SIZE;
- RevalidationHandler newarray[] = new RevalidationHandler[currentSize];
- System.arraycopy(dtdValidators, 0, newarray, 0, dtdValidators.length);
- dtdValidators = newarray;
- }
- dtdValidators[freeDTDValidatorIndex]=validator;
- }
- }
-
- /** NON-DOM: increment document/doctype counter */
- protected synchronized int assignDocumentNumber() {
- return ++docAndDoctypeCounter;
- }
- /** NON-DOM: increment document/doctype counter */
- protected synchronized int assignDocTypeNumber() {
- return ++docAndDoctypeCounter;
- }
-
- /* DOM Level 3 LS CR - Experimental.
- *
- * Create a new empty output destination object where
- * <code>LSOutput.characterStream</code>,
- * <code>LSOutput.byteStream</code>, <code>LSOutput.systemId</code>,
- * <code>LSOutput.encoding</code> are null.
-
- * @return The newly created output object.
- */
- public LSOutput createLSOutput() {
- return new DOMOutputImpl();
- }
-
-} // class DOMImplementationImpl
diff --git a/src/com/sun/org/apache/xerces/internal/dom/CoreDocumentImpl.java b/src/com/sun/org/apache/xerces/internal/dom/CoreDocumentImpl.java
deleted file mode 100644
index 64094b2..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/CoreDocumentImpl.java
+++ /dev/null
@@ -1,2870 +0,0 @@
-/*
- * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xerces.internal.dom;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.util.URI;
-import com.sun.org.apache.xerces.internal.util.XML11Char;
-import com.sun.org.apache.xerces.internal.util.XMLChar;
-import com.sun.org.apache.xerces.internal.utils.ObjectFactory;
-import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.ObjectStreamField;
-import java.lang.reflect.Constructor;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Map;
-import org.w3c.dom.Attr;
-import org.w3c.dom.CDATASection;
-import org.w3c.dom.Comment;
-import org.w3c.dom.DOMConfiguration;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.Entity;
-import org.w3c.dom.EntityReference;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Notation;
-import org.w3c.dom.ProcessingInstruction;
-import org.w3c.dom.Text;
-import org.w3c.dom.UserDataHandler;
-import org.w3c.dom.events.Event;
-import org.w3c.dom.events.EventListener;
-import org.w3c.dom.ls.DOMImplementationLS;
-import org.w3c.dom.ls.LSSerializer;
-
-/**
- * The Document interface represents the entire HTML or XML document.
- * Conceptually, it is the root of the document tree, and provides the
- * primary access to the document's data.
- * <P>
- * Since elements, text nodes, comments, processing instructions,
- * etc. cannot exist outside the context of a Document, the Document
- * interface also contains the factory methods needed to create these
- * objects. The Node objects created have a ownerDocument attribute
- * which associates them with the Document within whose context they
- * were created.
- * <p>
- * The CoreDocumentImpl class only implements the DOM Core. Additional modules
- * are supported by the more complete DocumentImpl subclass.
- * <p>
- * <b>Note:</b> When any node in the document is serialized, the
- * entire document is serialized along with it.
- *
- * @xerces.internal
- *
- * @author Arnaud Le Hors, IBM
- * @author Joe Kesselman, IBM
- * @author Andy Clark, IBM
- * @author Ralf Pfeiffer, IBM
- * @version $Id: CoreDocumentImpl.java,v 1.9 2010-11-01 04:39:37 joehw Exp $
- * @since PR-DOM-Level-1-19980818.
- */
-public class CoreDocumentImpl
- extends ParentNode implements Document {
-
- /**
- * TODO:: 1. Change XML11Char method names similar to XMLChar. That will
- * prevent lot of dirty version checking code.
- *
- * 2. IMO during cloneNode qname/isXMLName check should not be made.
- */
- //
- // Constants
- //
-
- /** Serialization version. */
- static final long serialVersionUID = 0;
-
- //
- // Data
- //
-
- // document information
-
- /** Document type. */
- protected DocumentTypeImpl docType;
-
- /** Document element. */
- protected ElementImpl docElement;
-
- /** NodeListCache free list */
- transient NodeListCache fFreeNLCache;
-
- /**Experimental DOM Level 3 feature: Document encoding */
- protected String encoding;
-
- /**Experimental DOM Level 3 feature: Document actualEncoding */
- protected String actualEncoding;
-
- /**Experimental DOM Level 3 feature: Document version */
- protected String version;
-
- /**Experimental DOM Level 3 feature: Document standalone */
- protected boolean standalone;
-
- /**Experimental DOM Level 3 feature: documentURI */
- protected String fDocumentURI;
-
- //Revisit :: change to a better data structure.
- /** Table for user data attached to this document nodes. */
- private Map<Node, Map<String, UserDataRecord>> nodeUserData;
-
- /** Identifiers. */
- protected Map<String, Node> identifiers;
-
- // DOM Level 3: normalizeDocument
- transient DOMNormalizer domNormalizer = null;
- transient DOMConfigurationImpl fConfiguration = null;
-
- // support of XPath API
- transient Object fXPathEvaluator = null;
-
- /** Table for quick check of child insertion. */
- private final static int[] kidOK;
-
- /**
- * Number of alterations made to this document since its creation.
- * Serves as a "dirty bit" so that live objects such as NodeList can
- * recognize when an alteration has been made and discard its cached
- * state information.
- * <p>
- * Any method that alters the tree structure MUST cause or be
- * accompanied by a call to changed(), to inform it that any outstanding
- * NodeLists may have to be updated.
- * <p>
- * (Required because NodeList is simultaneously "live" and integer-
- * indexed -- a bad decision in the DOM's design.)
- * <p>
- * Note that changes which do not affect the tree's structure -- changing
- * the node's name, for example -- do _not_ have to call changed().
- * <p>
- * Alternative implementation would be to use a cryptographic
- * Digest value rather than a count. This would have the advantage that
- * "harmless" changes (those producing equal() trees) would not force
- * NodeList to resynchronize. Disadvantage is that it's slightly more prone
- * to "false negatives", though that's the difference between "wildly
- * unlikely" and "absurdly unlikely". IF we start maintaining digests,
- * we should consider taking advantage of them.
- *
- * Note: This used to be done a node basis, so that we knew what
- * subtree changed. But since only DeepNodeList really use this today,
- * the gain appears to be really small compared to the cost of having
- * an int on every (parent) node plus having to walk up the tree all the
- * way to the root to mark the branch as changed everytime a node is
- * changed.
- * So we now have a single counter global to the document. It means that
- * some objects may flush their cache more often than necessary, but this
- * makes nodes smaller and only the document needs to be marked as changed.
- */
- protected int changes = 0;
-
- // experimental
-
- /** Allow grammar access. */
- protected boolean allowGrammarAccess;
-
- /** Bypass error checking. */
- protected boolean errorChecking = true;
- /** Ancestor checking */
- protected boolean ancestorChecking = true;
-
- //Did version change at any point when the document was created ?
- //this field helps us to optimize when normalizingDocument.
- protected boolean xmlVersionChanged = false ;
-
- /** The following are required for compareDocumentPosition
- */
- // Document number. Documents are ordered across the implementation using
- // positive integer values. Documents are assigned numbers on demand.
- private int documentNumber=0;
- // Node counter and table. Used to assign numbers to nodes for this
- // document. Node number values are negative integers. Nodes are
- // assigned numbers on demand.
- private int nodeCounter = 0;
- private Map<Node, Integer> nodeTable;
- private boolean xml11Version = false; //by default 1.0
- //
- // Static initialization
- //
-
- static {
-
- kidOK = new int[13];
-
- kidOK[DOCUMENT_NODE] =
- 1 << ELEMENT_NODE | 1 << PROCESSING_INSTRUCTION_NODE |
- 1 << COMMENT_NODE | 1 << DOCUMENT_TYPE_NODE;
-
- kidOK[DOCUMENT_FRAGMENT_NODE] =
- kidOK[ENTITY_NODE] =
- kidOK[ENTITY_REFERENCE_NODE] =
- kidOK[ELEMENT_NODE] =
- 1 << ELEMENT_NODE | 1 << PROCESSING_INSTRUCTION_NODE |
- 1 << COMMENT_NODE | 1 << TEXT_NODE |
- 1 << CDATA_SECTION_NODE | 1 << ENTITY_REFERENCE_NODE ;
-
-
- kidOK[ATTRIBUTE_NODE] =
- 1 << TEXT_NODE | 1 << ENTITY_REFERENCE_NODE;
-
- kidOK[DOCUMENT_TYPE_NODE] =
- kidOK[PROCESSING_INSTRUCTION_NODE] =
- kidOK[COMMENT_NODE] =
- kidOK[TEXT_NODE] =
- kidOK[CDATA_SECTION_NODE] =
- kidOK[NOTATION_NODE] =
- 0;
-
- } // static
-
- /**
- * @serialField docType DocumentTypeImpl document type
- * @serialField docElement ElementImpl document element
- * @serialField fFreeNLCache NodeListCache NodeListCache free list
- * @serialField encoding String Document encoding
- * @serialField actualEncoding String Document actualEncoding
- * @serialField version String Document version
- * @serialField standalone boolean Document standalone
- * @serialField fDocumentURI String Document URI
- * @serialField userData Hashtable user data attached to the nodes. Note that
- * it was original called "userData". It has been changed to nodeUserData to
- * avoid confusion with those that are actually values of the map.
- * @serialField identifiers Hashtable identifiers
- * @serialField changes int flag indicates whether the node has changed
- * @serialField allowGrammarAccess boolean Allow grammar access
- * @serialField errorChecking boolean Bypass error checking
- * @serialField ancestorChecking boolean Ancestor checking
- * @serialField xmlVersionChanged boolean Indicate whether the version has changed
- * @serialField documentNumber int Document number
- * @serialField nodeCounter int Node counter
- * @serialField nodeTable Hashtable Node table
- * @serialField xml11Version boolean XML version
- */
- private static final ObjectStreamField[] serialPersistentFields =
- new ObjectStreamField[] {
- new ObjectStreamField("docType", DocumentTypeImpl.class),
- new ObjectStreamField("docElement", ElementImpl.class),
- new ObjectStreamField("fFreeNLCache", NodeListCache.class),
- new ObjectStreamField("encoding", String.class),
- new ObjectStreamField("actualEncoding", String.class),
- new ObjectStreamField("version", String.class),
- new ObjectStreamField("standalone", boolean.class),
- new ObjectStreamField("fDocumentURI", String.class),
- new ObjectStreamField("userData", Hashtable.class),
- new ObjectStreamField("identifiers", Hashtable.class),
- new ObjectStreamField("changes", int.class),
- new ObjectStreamField("allowGrammarAccess", boolean.class),
- new ObjectStreamField("errorChecking", boolean.class),
- new ObjectStreamField("ancestorChecking", boolean.class),
- new ObjectStreamField("xmlVersionChanged", boolean.class),
- new ObjectStreamField("documentNumber", int.class),
- new ObjectStreamField("nodeCounter", int.class),
- new ObjectStreamField("nodeTable", Hashtable.class),
- new ObjectStreamField("xml11Version", boolean.class),
- };
-
- //
- // Constructors
- //
-
- /**
- * NON-DOM: Actually creating a Document is outside the DOM's spec,
- * since it has to operate in terms of a particular implementation.
- */
- public CoreDocumentImpl() {
- this(false);
- }
-
- /** Constructor. */
- public CoreDocumentImpl(boolean grammarAccess) {
- super(null);
- ownerDocument = this;
- allowGrammarAccess = grammarAccess;
- String systemProp = SecuritySupport.getSystemProperty(Constants.SUN_DOM_PROPERTY_PREFIX+Constants.SUN_DOM_ANCESTOR_CHECCK);
- if (systemProp != null) {
- if (systemProp.equalsIgnoreCase("false")) {
- ancestorChecking = false;
- }
- }
- }
-
- /**
- * For DOM2 support.
- * The createDocument factory method is in DOMImplementation.
- */
- public CoreDocumentImpl(DocumentType doctype) {
- this(doctype, false);
- }
-
- /** For DOM2 support. */
- public CoreDocumentImpl(DocumentType doctype, boolean grammarAccess) {
- this(grammarAccess);
- if (doctype != null) {
- DocumentTypeImpl doctypeImpl;
- try {
- doctypeImpl = (DocumentTypeImpl) doctype;
- } catch (ClassCastException e) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null);
- throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, msg);
- }
- doctypeImpl.ownerDocument = this;
- appendChild(doctype);
- }
- }
-
- //
- // Node methods
- //
-
- // even though ownerDocument refers to this in this implementation
- // the DOM Level 2 spec says it must be null, so make it appear so
- final public Document getOwnerDocument() {
- return null;
- }
-
- /** Returns the node type. */
- public short getNodeType() {
- return Node.DOCUMENT_NODE;
- }
-
- /** Returns the node name. */
- public String getNodeName() {
- return "#document";
- }
-
- /**
- * Deep-clone a document, including fixing ownerDoc for the cloned
- * children. Note that this requires bypassing the WRONG_DOCUMENT_ERR
- * protection. I've chosen to implement it by calling importNode
- * which is DOM Level 2.
- *
- * @return org.w3c.dom.Node
- * @param deep boolean, iff true replicate children
- */
- public Node cloneNode(boolean deep) {
-
- CoreDocumentImpl newdoc = new CoreDocumentImpl();
- callUserDataHandlers(this, newdoc, UserDataHandler.NODE_CLONED);
- cloneNode(newdoc, deep);
-
- return newdoc;
-
- } // cloneNode(boolean):Node
-
-
- /**
- * internal method to share code with subclass
- **/
- protected void cloneNode(CoreDocumentImpl newdoc, boolean deep) {
-
- // clone the children by importing them
- if (needsSyncChildren()) {
- synchronizeChildren();
- }
-
- if (deep) {
- Map<Node, String> reversedIdentifiers = null;
-
- if (identifiers != null) {
- // Build a reverse mapping from element to identifier.
- reversedIdentifiers = new HashMap<>(identifiers.size());
- for (String elementId : identifiers.keySet()) {
- reversedIdentifiers.put(identifiers.get(elementId), elementId);
- }
- }
-
- // Copy children into new document.
- for (ChildNode kid = firstChild; kid != null;
- kid = kid.nextSibling) {
- newdoc.appendChild(newdoc.importNode(kid, true, true,
- reversedIdentifiers));
- }
- }
-
- // experimental
- newdoc.allowGrammarAccess = allowGrammarAccess;
- newdoc.errorChecking = errorChecking;
-
- } // cloneNode(CoreDocumentImpl,boolean):void
-
- /**
- * Since a Document may contain at most one top-level Element child,
- * and at most one DocumentType declaraction, we need to subclass our
- * add-children methods to implement this constraint.
- * Since appendChild() is implemented as insertBefore(,null),
- * altering the latter fixes both.
- * <p>
- * While I'm doing so, I've taken advantage of the opportunity to
- * cache documentElement and docType so we don't have to
- * search for them.
- *
- * REVISIT: According to the spec it is not allowed to alter neither the
- * document element nor the document type in any way
- */
- public Node insertBefore(Node newChild, Node refChild)
- throws DOMException {
-
- // Only one such child permitted
- int type = newChild.getNodeType();
- if (errorChecking) {
- if((type == Node.ELEMENT_NODE && docElement != null) ||
- (type == Node.DOCUMENT_TYPE_NODE && docType != null)) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "HIERARCHY_REQUEST_ERR", null);
- throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, msg);
- }
- }
- // Adopt orphan doctypes
- if (newChild.getOwnerDocument() == null &&
- newChild instanceof DocumentTypeImpl) {
- ((DocumentTypeImpl) newChild).ownerDocument = this;
- }
- super.insertBefore(newChild,refChild);
-
- // If insert succeeded, cache the kid appropriately
- if (type == Node.ELEMENT_NODE) {
- docElement = (ElementImpl)newChild;
- }
- else if (type == Node.DOCUMENT_TYPE_NODE) {
- docType = (DocumentTypeImpl)newChild;
- }
-
- return newChild;
-
- } // insertBefore(Node,Node):Node
-
- /**
- * Since insertBefore caches the docElement (and, currently, docType),
- * removeChild has to know how to undo the cache
- *
- * REVISIT: According to the spec it is not allowed to alter neither the
- * document element nor the document type in any way
- */
- public Node removeChild(Node oldChild) throws DOMException {
-
- super.removeChild(oldChild);
-
- // If remove succeeded, un-cache the kid appropriately
- int type = oldChild.getNodeType();
- if(type == Node.ELEMENT_NODE) {
- docElement = null;
- }
- else if (type == Node.DOCUMENT_TYPE_NODE) {
- docType = null;
- }
-
- return oldChild;
-
- } // removeChild(Node):Node
-
- /**
- * Since we cache the docElement (and, currently, docType),
- * replaceChild has to update the cache
- *
- * REVISIT: According to the spec it is not allowed to alter neither the
- * document element nor the document type in any way
- */
- public Node replaceChild(Node newChild, Node oldChild)
- throws DOMException {
-
- // Adopt orphan doctypes
- if (newChild.getOwnerDocument() == null &&
- newChild instanceof DocumentTypeImpl) {
- ((DocumentTypeImpl) newChild).ownerDocument = this;
- }
-
- if (errorChecking &&((docType != null &&
- oldChild.getNodeType() != Node.DOCUMENT_TYPE_NODE &&
- newChild.getNodeType() == Node.DOCUMENT_TYPE_NODE)
- || (docElement != null &&
- oldChild.getNodeType() != Node.ELEMENT_NODE &&
- newChild.getNodeType() == Node.ELEMENT_NODE))) {
-
- throw new DOMException(
- DOMException.HIERARCHY_REQUEST_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "HIERARCHY_REQUEST_ERR", null));
- }
- super.replaceChild(newChild, oldChild);
-
- int type = oldChild.getNodeType();
- if(type == Node.ELEMENT_NODE) {
- docElement = (ElementImpl)newChild;
- }
- else if (type == Node.DOCUMENT_TYPE_NODE) {
- docType = (DocumentTypeImpl)newChild;
- }
- return oldChild;
- } // replaceChild(Node,Node):Node
-
- /*
- * Get Node text content
- * @since DOM Level 3
- */
- public String getTextContent() throws DOMException {
- return null;
- }
-
- /*
- * Set Node text content
- * @since DOM Level 3
- */
- public void setTextContent(String textContent)
- throws DOMException {
- // no-op
- }
-
- /**
- * @since DOM Level 3
- */
- public Object getFeature(String feature, String version) {
-
- boolean anyVersion = version == null || version.length() == 0;
-
- // if a plus sign "+" is prepended to any feature name, implementations
- // are considered in which the specified feature may not be directly
- // castable DOMImplementation.getFeature(feature, version). Without a
- // plus, only features whose interfaces are directly castable are
- // considered.
- if ((feature.equalsIgnoreCase("+XPath"))
- && (anyVersion || version.equals("3.0"))) {
-
- // If an XPathEvaluator was created previously
- // return it otherwise create a new one.
- if (fXPathEvaluator != null) {
- return fXPathEvaluator;
- }
-
- try {
- Class xpathClass = ObjectFactory.findProviderClass (
- "com.sun.org.apache.xpath.internal.domapi.XPathEvaluatorImpl", true);
- Constructor xpathClassConstr =
- xpathClass.getConstructor(new Class[] { Document.class });
-
- // Check if the DOM XPath implementation implements
- // the interface org.w3c.dom.XPathEvaluator
- Class interfaces[] = xpathClass.getInterfaces();
- for (int i = 0; i < interfaces.length; i++) {
- if (interfaces[i].getName().equals(
- "org.w3c.dom.xpath.XPathEvaluator")) {
- fXPathEvaluator = xpathClassConstr.newInstance(new Object[] { this });
- return fXPathEvaluator;
- }
- }
- return null;
- } catch (Exception e) {
- return null;
- }
- }
- return super.getFeature(feature, version);
- }
-
- //
- // Document methods
- //
-
- // factory methods
-
- /**
- * Factory method; creates an Attribute having this Document as its
- * OwnerDoc.
- *
- * @param name The name of the attribute. Note that the attribute's value is
- * _not_ established at the factory; remember to set it!
- *
- * @throws DOMException(INVALID_NAME_ERR)
- * if the attribute name is not acceptable.
- */
- public Attr createAttribute(String name)
- throws DOMException {
-
- if (errorChecking && !isXMLName(name,xml11Version)) {
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "INVALID_CHARACTER_ERR",
- null);
- throw new DOMException(DOMException.INVALID_CHARACTER_ERR, msg);
- }
- return new AttrImpl(this, name);
-
- } // createAttribute(String):Attr
-
- /**
- * Factory method; creates a CDATASection having this Document as
- * its OwnerDoc.
- *
- * @param data The initial contents of the CDATA
- *
- * @throws DOMException(NOT_SUPPORTED_ERR) for HTML documents. (HTML
- * not yet implemented.)
- */
- public CDATASection createCDATASection(String data)
- throws DOMException {
- return new CDATASectionImpl(this, data);
- }
-
- /**
- * Factory method; creates a Comment having this Document as its
- * OwnerDoc.
- *
- * @param data The initial contents of the Comment. */
- public Comment createComment(String data) {
- return new CommentImpl(this, data);
- }
-
- /**
- * Factory method; creates a DocumentFragment having this Document
- * as its OwnerDoc.
- */
- public DocumentFragment createDocumentFragment() {
- return new DocumentFragmentImpl(this);
- }
-
- /**
- * Factory method; creates an Element having this Document
- * as its OwnerDoc.
- *
- * @param tagName The name of the element type to instantiate. For
- * XML, this is case-sensitive. For HTML, the tagName parameter may
- * be provided in any case, but it must be mapped to the canonical
- * uppercase form by the DOM implementation.
- *
- * @throws DOMException(INVALID_NAME_ERR) if the tag name is not
- * acceptable.
- */
- public Element createElement(String tagName)
- throws DOMException {
-
- if (errorChecking && !isXMLName(tagName,xml11Version)) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_CHARACTER_ERR", null);
- throw new DOMException(DOMException.INVALID_CHARACTER_ERR, msg);
- }
- return new ElementImpl(this, tagName);
-
- } // createElement(String):Element
-
- /**
- * Factory method; creates an EntityReference having this Document
- * as its OwnerDoc.
- *
- * @param name The name of the Entity we wish to refer to
- *
- * @throws DOMException(NOT_SUPPORTED_ERR) for HTML documents, where
- * nonstandard entities are not permitted. (HTML not yet
- * implemented.)
- */
- public EntityReference createEntityReference(String name)
- throws DOMException {
-
- if (errorChecking && !isXMLName(name,xml11Version)) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_CHARACTER_ERR", null);
- throw new DOMException(DOMException.INVALID_CHARACTER_ERR, msg);
- }
- return new EntityReferenceImpl(this, name);
-
- } // createEntityReference(String):EntityReference
-
- /**
- * Factory method; creates a ProcessingInstruction having this Document
- * as its OwnerDoc.
- *
- * @param target The target "processor channel"
- * @param data Parameter string to be passed to the target.
- *
- * @throws DOMException(INVALID_NAME_ERR) if the target name is not
- * acceptable.
- *
- * @throws DOMException(NOT_SUPPORTED_ERR) for HTML documents. (HTML
- * not yet implemented.)
- */
- public ProcessingInstruction createProcessingInstruction(String target,
- String data)
- throws DOMException {
-
- if (errorChecking && !isXMLName(target,xml11Version)) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_CHARACTER_ERR", null);
- throw new DOMException(DOMException.INVALID_CHARACTER_ERR, msg);
- }
- return new ProcessingInstructionImpl(this, target, data);
-
- } // createProcessingInstruction(String,String):ProcessingInstruction
-
- /**
- * Factory method; creates a Text node having this Document as its
- * OwnerDoc.
- *
- * @param data The initial contents of the Text.
- */
- public Text createTextNode(String data) {
- return new TextImpl(this, data);
- }
-
- // other document methods
-
- /**
- * For XML, this provides access to the Document Type Definition.
- * For HTML documents, and XML documents which don't specify a DTD,
- * it will be null.
- */
- public DocumentType getDoctype() {
- if (needsSyncChildren()) {
- synchronizeChildren();
- }
- return docType;
- }
-
- /**
- * Convenience method, allowing direct access to the child node
- * which is considered the root of the actual document content. For
- * HTML, where it is legal to have more than one Element at the top
- * level of the document, we pick the one with the tagName
- * "HTML". For XML there should be only one top-level
- *
- * (HTML not yet supported.)
- */
- public Element getDocumentElement() {
- if (needsSyncChildren()) {
- synchronizeChildren();
- }
- return docElement;
- }
-
- /**
- * Return a <em>live</em> collection of all descendent Elements (not just
- * immediate children) having the specified tag name.
- *
- * @param tagname The type of Element we want to gather. "*" will be
- * taken as a wildcard, meaning "all elements in the document."
- *
- * @see DeepNodeListImpl
- */
- public NodeList getElementsByTagName(String tagname) {
- return new DeepNodeListImpl(this,tagname);
- }
-
- /**
- * Retrieve information describing the abilities of this particular
- * DOM implementation. Intended to support applications that may be
- * using DOMs retrieved from several different sources, potentially
- * with different underlying representations.
- */
- public DOMImplementation getImplementation() {
- // Currently implemented as a singleton, since it's hardcoded
- // information anyway.
- return CoreDOMImplementationImpl.getDOMImplementation();
- }
-
- //
- // Public methods
- //
-
- // properties
-
- /**
- * Sets whether the DOM implementation performs error checking
- * upon operations. Turning off error checking only affects
- * the following DOM checks:
- * <ul>
- * <li>Checking strings to make sure that all characters are
- * legal XML characters
- * <li>Hierarchy checking such as allowed children, checks for
- * cycles, etc.
- * </ul>
- * <p>
- * Turning off error checking does <em>not</em> turn off the
- * following checks:
- * <ul>
- * <li>Read only checks
- * <li>Checks related to DOM events
- * </ul>
- */
-
- public void setErrorChecking(boolean check) {
- errorChecking = check;
- }
-
- /*
- * DOM Level 3 WD - Experimental.
- */
- public void setStrictErrorChecking(boolean check) {
- errorChecking = check;
- }
-
- /**
- * Returns true if the DOM implementation performs error checking.
- */
- public boolean getErrorChecking() {
- return errorChecking;
- }
-
- /*
- * DOM Level 3 WD - Experimental.
- */
- public boolean getStrictErrorChecking() {
- return errorChecking;
- }
-
- /**
- * DOM Level 3 CR - Experimental. (Was getActualEncoding)
- *
- * An attribute specifying the encoding used for this document
- * at the time of the parsing. This is <code>null</code> when
- * it is not known, such as when the <code>Document</code> was
- * created in memory.
- * @since DOM Level 3
- */
- public String getInputEncoding() {
- return actualEncoding;
- }
-
- /**
- * DOM Internal
- * (Was a DOM L3 Core WD public interface method setActualEncoding )
- *
- * An attribute specifying the actual encoding of this document. This is
- * <code>null</code> otherwise.
- * <br> This attribute represents the property [character encoding scheme]
- * defined in .
- */
- public void setInputEncoding(String value) {
- actualEncoding = value;
- }
-
- /**
- * DOM Internal
- * (Was a DOM L3 Core WD public interface method setXMLEncoding )
- *
- * An attribute specifying, as part of the XML declaration,
- * the encoding of this document. This is null when unspecified.
- */
- public void setXmlEncoding(String value) {
- encoding = value;
- }
-
- /**
- * @deprecated This method is internal and only exists for
- * compatibility with older applications. New applications
- * should never call this method.
- */
- public void setEncoding(String value) {
- setXmlEncoding(value);
- }
-
- /**
- * DOM Level 3 WD - Experimental.
- * The encoding of this document (part of XML Declaration)
- */
- public String getXmlEncoding() {
- return encoding;
- }
-
- /**
- * @deprecated This method is internal and only exists for
- * compatibility with older applications. New applications
- * should never call this method.
- */
- public String getEncoding() {
- return getXmlEncoding();
- }
-
- /**
- * DOM Level 3 CR - Experimental.
- * version - An attribute specifying, as part of the XML declaration,
- * the version number of this document.
- */
- public void setXmlVersion(String value) {
- if(value.equals("1.0") || value.equals("1.1")){
- //we need to change the flag value only --
- // when the version set is different than already set.
- if(!getXmlVersion().equals(value)){
- xmlVersionChanged = true ;
- //change the normalization value back to false
- isNormalized(false);
- version = value;
- }
- }
- else{
- //NOT_SUPPORTED_ERR: Raised if the vesion is set to a value that is not supported by
- //this document
- //we dont support any other XML version
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
-
- }
- if((getXmlVersion()).equals("1.1")){
- xml11Version = true;
- }
- else{
- xml11Version = false;
- }
- }
-
- /**
- * @deprecated This method is internal and only exists for
- * compatibility with older applications. New applications
- * should never call this method.
- */
- public void setVersion(String value) {
- setXmlVersion(value);
- }
-
- /**
- * DOM Level 3 WD - Experimental.
- * The version of this document (part of XML Declaration)
- */
-
- public String getXmlVersion() {
- return (version == null)?"1.0":version;
- }
-
- /**
- * @deprecated This method is internal and only exists for
- * compatibility with older applications. New applications
- * should never call this method.
- */
- public String getVersion() {
- return getXmlVersion();
- }
-
- /**
- * DOM Level 3 CR - Experimental.
- *
- * Xmlstandalone - An attribute specifying, as part of the XML declaration,
- * whether this document is standalone
- * @exception DOMException
- * NOT_SUPPORTED_ERR: Raised if this document does not support the
- * "XML" feature.
- * @since DOM Level 3
- */
- public void setXmlStandalone(boolean value)
- throws DOMException {
- standalone = value;
- }
-
- /**
- * @deprecated This method is internal and only exists for
- * compatibility with older applications. New applications
- * should never call this method.
- */
- public void setStandalone(boolean value) {
- setXmlStandalone(value);
- }
-
- /**
- * DOM Level 3 WD - Experimental.
- * standalone that specifies whether this document is standalone
- * (part of XML Declaration)
- */
- public boolean getXmlStandalone() {
- return standalone;
- }
-
- /**
- * @deprecated This method is internal and only exists for
- * compatibility with older applications. New applications
- * should never call this method.
- */
- public boolean getStandalone() {
- return getXmlStandalone();
- }
-
- /**
- * DOM Level 3 WD - Experimental.
- * The location of the document or <code>null</code> if undefined.
- * <br>Beware that when the <code>Document</code> supports the feature
- * "HTML" , the href attribute of the HTML BASE element takes precedence
- * over this attribute.
- * @since DOM Level 3
- */
- public String getDocumentURI(){
- return fDocumentURI;
- }
-
-
- /**
- * DOM Level 3 WD - Experimental.
- * Renaming node
- */
- public Node renameNode(Node n,String namespaceURI,String name)
- throws DOMException{
-
- if (errorChecking && n.getOwnerDocument() != this && n != this) {
- String msg = DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null);
- throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, msg);
- }
- switch (n.getNodeType()) {
- case ELEMENT_NODE: {
- ElementImpl el = (ElementImpl) n;
- if (el instanceof ElementNSImpl) {
- ((ElementNSImpl) el).rename(namespaceURI, name);
-
- // fire user data NODE_RENAMED event
- callUserDataHandlers(el, null, UserDataHandler.NODE_RENAMED);
- }
- else {
- if (namespaceURI == null) {
- if (errorChecking) {
- int colon1 = name.indexOf(':');
- if(colon1 != -1){
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "NAMESPACE_ERR",
- null);
- throw new DOMException(DOMException.NAMESPACE_ERR, msg);
- }
- if (!isXMLName(name,xml11Version)) {
- String msg = DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "INVALID_CHARACTER_ERR", null);
- throw new DOMException(DOMException.INVALID_CHARACTER_ERR,
- msg);
- }
- }
- el.rename(name);
-
- // fire user data NODE_RENAMED event
- callUserDataHandlers(el, null,
- UserDataHandler.NODE_RENAMED);
- }
- else {
- // we need to create a new object
- ElementNSImpl nel =
- new ElementNSImpl(this, namespaceURI, name);
-
- // register event listeners on new node
- copyEventListeners(el, nel);
-
- // remove user data from old node
- Map<String, UserDataRecord> data = removeUserDataTable(el);
-
- // remove old node from parent if any
- Node parent = el.getParentNode();
- Node nextSib = el.getNextSibling();
- if (parent != null) {
- parent.removeChild(el);
- }
- // move children to new node
- Node child = el.getFirstChild();
- while (child != null) {
- el.removeChild(child);
- nel.appendChild(child);
- child = el.getFirstChild();
- }
- // move specified attributes to new node
- nel.moveSpecifiedAttributes(el);
-
- // attach user data to new node
- setUserDataTable(nel, data);
-
- // and fire user data NODE_RENAMED event
- callUserDataHandlers(el, nel,
- UserDataHandler.NODE_RENAMED);
-
- // insert new node where old one was
- if (parent != null) {
- parent.insertBefore(nel, nextSib);
- }
- el = nel;
- }
- }
- // fire ElementNameChanged event
- renamedElement((Element) n, el);
- return el;
- }
- case ATTRIBUTE_NODE: {
- AttrImpl at = (AttrImpl) n;
-
- // dettach attr from element
- Element el = at.getOwnerElement();
- if (el != null) {
- el.removeAttributeNode(at);
- }
- if (n instanceof AttrNSImpl) {
- ((AttrNSImpl) at).rename(namespaceURI, name);
- // reattach attr to element
- if (el != null) {
- el.setAttributeNodeNS(at);
- }
-
- // fire user data NODE_RENAMED event
- callUserDataHandlers(at, null, UserDataHandler.NODE_RENAMED);
- }
- else {
- if (namespaceURI == null) {
- at.rename(name);
- // reattach attr to element
- if (el != null) {
- el.setAttributeNode(at);
- }
-
- // fire user data NODE_RENAMED event
- callUserDataHandlers(at, null, UserDataHandler.NODE_RENAMED);
- }
- else {
- // we need to create a new object
- AttrNSImpl nat = new AttrNSImpl(this, namespaceURI, name);
-
- // register event listeners on new node
- copyEventListeners(at, nat);
-
- // remove user data from old node
- Map<String, UserDataRecord> data = removeUserDataTable(at);
-
- // move children to new node
- Node child = at.getFirstChild();
- while (child != null) {
- at.removeChild(child);
- nat.appendChild(child);
- child = at.getFirstChild();
- }
-
- // attach user data to new node
- setUserDataTable(nat, data);
-
- // and fire user data NODE_RENAMED event
- callUserDataHandlers(at, nat, UserDataHandler.NODE_RENAMED);
-
- // reattach attr to element
- if (el != null) {
- el.setAttributeNode(nat);
- }
- at = nat;
- }
- }
- // fire AttributeNameChanged event
- renamedAttrNode((Attr) n, at);
-
- return at;
- }
- default: {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
- }
- }
-
- }
-
-
- /**
- * DOM Level 3 WD - Experimental
- * Normalize document.
- */
- public void normalizeDocument(){
- // No need to normalize if already normalized.
- if (isNormalized() && !isNormalizeDocRequired()) {
- return;
- }
- if (needsSyncChildren()) {
- synchronizeChildren();
- }
-
- if (domNormalizer == null) {
- domNormalizer = new DOMNormalizer();
- }
-
- if (fConfiguration == null) {
- fConfiguration = new DOMConfigurationImpl();
- }
- else {
- fConfiguration.reset();
- }
-
- domNormalizer.normalizeDocument(this, fConfiguration);
- isNormalized(true);
- //set the XMLversion changed value to false -- once we have finished
- //doing normalization
- xmlVersionChanged = false ;
- }
-
-
- /**
- * DOM Level 3 CR - Experimental
- *
- * The configuration used when <code>Document.normalizeDocument</code> is
- * invoked.
- * @since DOM Level 3
- */
- public DOMConfiguration getDomConfig(){
- if (fConfiguration == null) {
- fConfiguration = new DOMConfigurationImpl();
- }
- return fConfiguration;
- }
-
-
- /**
- * Returns the absolute base URI of this node or null if the implementation
- * wasn't able to obtain an absolute URI. Note: If the URI is malformed, a
- * null is returned.
- *
- * @return The absolute base URI of this node or null.
- * @since DOM Level 3
- */
- public String getBaseURI() {
- if (fDocumentURI != null && fDocumentURI.length() != 0 ) {// attribute value is always empty string
- try {
- return new URI(fDocumentURI).toString();
- }
- catch (com.sun.org.apache.xerces.internal.util.URI.MalformedURIException e){
- // REVISIT: what should happen in this case?
- return null;
- }
- }
- return fDocumentURI;
- }
-
- /**
- * DOM Level 3 WD - Experimental.
- */
- public void setDocumentURI(String documentURI){
- fDocumentURI = documentURI;
- }
-
-
- //
- // DOM L3 LS
- //
- /**
- * DOM Level 3 WD - Experimental.
- * Indicates whether the method load should be synchronous or
- * asynchronous. When the async attribute is set to <code>true</code>
- * the load method returns control to the caller before the document has
- * completed loading. The default value of this property is
- * <code>false</code>.
- * <br>Setting the value of this attribute might throw NOT_SUPPORTED_ERR
- * if the implementation doesn't support the mode the attribute is being
- * set to. Should the DOM spec define the default value of this
- * property? What if implementing both async and sync IO is impractical
- * in some systems? 2001-09-14. default is <code>false</code> but we
- * need to check with Mozilla and IE.
- */
- public boolean getAsync() {
- return false;
- }
-
- /**
- * DOM Level 3 WD - Experimental.
- * Indicates whether the method load should be synchronous or
- * asynchronous. When the async attribute is set to <code>true</code>
- * the load method returns control to the caller before the document has
- * completed loading. The default value of this property is
- * <code>false</code>.
- * <br>Setting the value of this attribute might throw NOT_SUPPORTED_ERR
- * if the implementation doesn't support the mode the attribute is being
- * set to. Should the DOM spec define the default value of this
- * property? What if implementing both async and sync IO is impractical
- * in some systems? 2001-09-14. default is <code>false</code> but we
- * need to check with Mozilla and IE.
- */
- public void setAsync(boolean async) {
- if (async) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
- }
- }
- /**
- * DOM Level 3 WD - Experimental.
- * If the document is currently being loaded as a result of the method
- * <code>load</code> being invoked the loading and parsing is
- * immediately aborted. The possibly partial result of parsing the
- * document is discarded and the document is cleared.
- */
- public void abort() {
- }
-
- /**
- * DOM Level 3 WD - Experimental.
- *
- * Replaces the content of the document with the result of parsing the
- * given URI. Invoking this method will either block the caller or
- * return to the caller immediately depending on the value of the async
- * attribute. Once the document is fully loaded a "load" event (as
- * defined in [<a href='http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331'>DOM Level 3 Events</a>]
- * , except that the <code>Event.targetNode</code> will be the document,
- * not an element) will be dispatched on the document. If an error
- * occurs, an implementation dependent "error" event will be dispatched
- * on the document. If this method is called on a document that is
- * currently loading, the current load is interrupted and the new URI
- * load is initiated.
- * <br> When invoking this method the parameters used in the
- * <code>DOMParser</code> interface are assumed to have their default
- * values with the exception that the parameters <code>"entities"</code>
- * , <code>"normalize-characters"</code>,
- * <code>"check-character-normalization"</code> are set to
- * <code>"false"</code>.
- * <br> The result of a call to this method is the same the result of a
- * call to <code>DOMParser.parseWithContext</code> with an input stream
- * referencing the URI that was passed to this call, the document as the
- * context node, and the action <code>ACTION_REPLACE_CHILDREN</code>.
- * @param uri The URI reference for the XML file to be loaded. If this is
- * a relative URI, the base URI used by the implementation is
- * implementation dependent.
- * @return If async is set to <code>true</code> <code>load</code> returns
- * <code>true</code> if the document load was successfully initiated.
- * If an error occurred when initiating the document load,
- * <code>load</code> returns <code>false</code>.If async is set to
- * <code>false</code> <code>load</code> returns <code>true</code> if
- * the document was successfully loaded and parsed. If an error
- * occurred when either loading or parsing the URI, <code>load</code>
- * returns <code>false</code>.
- */
- public boolean load(String uri) {
- return false;
- }
-
- /**
- * DOM Level 3 WD - Experimental.
- * Replace the content of the document with the result of parsing the
- * input string, this method is always synchronous.
- * @param source A string containing an XML document.
- * @return <code>true</code> if parsing the input string succeeded
- * without errors, otherwise <code>false</code>.
- */
- public boolean loadXML(String source) {
- return false;
- }
-
- /**
- * DOM Level 3 WD - Experimental.
- * Save the document or the given node and all its descendants to a string
- * (i.e. serialize the document or node).
- * <br>The parameters used in the <code>LSSerializer</code> interface are
- * assumed to have their default values when invoking this method.
- * <br> The result of a call to this method is the same the result of a
- * call to <code>LSSerializer.writeToString</code> with the document as
- * the node to write.
- * @param node Specifies what to serialize, if this parameter is
- * <code>null</code> the whole document is serialized, if it's
- * non-null the given node is serialized.
- * @return The serialized document or <code>null</code> in case an error
- * occurred.
- * @exception DOMException
- * WRONG_DOCUMENT_ERR: Raised if the node passed in as the node
- * parameter is from an other document.
- */
- public String saveXML(Node node)
- throws DOMException {
- if (errorChecking && node != null
- && this != node.getOwnerDocument()) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null);
- throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, msg);
- }
- DOMImplementationLS domImplLS = (DOMImplementationLS) DOMImplementationImpl.getDOMImplementation();
- LSSerializer xmlWriter = domImplLS.createLSSerializer();
- if (node == null) {
- node = this;
- }
- return xmlWriter.writeToString(node);
- }
-
- /**
- * Sets whether the DOM implementation generates mutation events upon
- * operations.
- */
- void setMutationEvents(boolean set) {
- // does nothing by default - overidden in subclass
- }
-
- /**
- * Returns true if the DOM implementation generates mutation events.
- */
- boolean getMutationEvents() {
- // does nothing by default - overriden in subclass
- return false;
- }
-
- // non-DOM factory methods
- /**
- * NON-DOM Factory method; creates a DocumentType having this Document as
- * its OwnerDoc. (REC-DOM-Level-1-19981001 left the process of building DTD
- * information unspecified.)
- *
- * @param name The name of the Entity we wish to provide a value for.
- *
- * @throws DOMException(NOT_SUPPORTED_ERR) for HTML documents, where DTDs
- * are not permitted. (HTML not yet implemented.)
- */
- public DocumentType createDocumentType(String qualifiedName,
- String publicID,
- String systemID)
- throws DOMException {
-
- return new DocumentTypeImpl(this, qualifiedName, publicID, systemID);
-
- } // createDocumentType(String):DocumentType
-
- /**
- * NON-DOM Factory method; creates an Entity having this Document as its
- * OwnerDoc. (REC-DOM-Level-1-19981001 left the process of building DTD
- * information unspecified.)
- *
- * @param name The name of the Entity we wish to provide a value for.
- *
- * @throws DOMException(NOT_SUPPORTED_ERR) for HTML documents, where
- * nonstandard entities are not permitted. (HTML not yet implemented.)
- */
- public Entity createEntity(String name)
- throws DOMException {
-
- if (errorChecking && !isXMLName(name, xml11Version)) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_CHARACTER_ERR", null);
- throw new DOMException(DOMException.INVALID_CHARACTER_ERR, msg);
- }
- return new EntityImpl(this, name);
-
- } // createEntity(String):Entity
-
- /**
- * NON-DOM Factory method; creates a Notation having this Document as its
- * OwnerDoc. (REC-DOM-Level-1-19981001 left the process of building DTD
- * information unspecified.)
- *
- * @param name The name of the Notation we wish to describe
- *
- * @throws DOMException(NOT_SUPPORTED_ERR) for HTML documents, where
- * notations are not permitted. (HTML not yet implemented.)
- */
- public Notation createNotation(String name)
- throws DOMException {
-
- if (errorChecking && !isXMLName(name, xml11Version)) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_CHARACTER_ERR", null);
- throw new DOMException(DOMException.INVALID_CHARACTER_ERR, msg);
- }
- return new NotationImpl(this, name);
-
- } // createNotation(String):Notation
-
- /**
- * NON-DOM Factory method: creates an element definition. Element
- * definitions hold default attribute values.
- */
- public ElementDefinitionImpl createElementDefinition(String name)
- throws DOMException {
-
- if (errorChecking && !isXMLName(name, xml11Version)) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_CHARACTER_ERR", null);
- throw new DOMException(DOMException.INVALID_CHARACTER_ERR, msg);
- }
- return new ElementDefinitionImpl(this, name);
-
- } // createElementDefinition(String):ElementDefinitionImpl
-
- // other non-DOM methods
- /**
- * NON-DOM: Get the number associated with this document. Used to order
- * documents in the implementation.
- */
- protected int getNodeNumber() {
- if (documentNumber == 0) {
-
- CoreDOMImplementationImpl cd = (CoreDOMImplementationImpl) CoreDOMImplementationImpl.getDOMImplementation();
- documentNumber = cd.assignDocumentNumber();
- }
- return documentNumber;
- }
-
- /**
- * NON-DOM: Get a number associated with a node created with respect to this
- * document. Needed for compareDocumentPosition when nodes are disconnected.
- * This is only used on demand.
- */
- protected int getNodeNumber(Node node) {
-
- // Check if the node is already in the hash
- // If so, retrieve the node number
- // If not, assign a number to the node
- // Node numbers are negative, from -1 to -n
- int num;
- if (nodeTable == null) {
- nodeTable = new HashMap<>();
- num = --nodeCounter;
- nodeTable.put(node, new Integer(num));
- } else {
- Integer n = nodeTable.get(node);
- if (n == null) {
- num = --nodeCounter;
- nodeTable.put(node, num);
- } else {
- num = n.intValue();
- }
- }
- return num;
- }
-
- /**
- * Copies a node from another document to this document. The new nodes are
- * created using this document's factory methods and are populated with the
- * data from the source's accessor methods defined by the DOM interfaces.
- * Its behavior is otherwise similar to that of cloneNode.
- * <p>
- * According to the DOM specifications, document nodes cannot be imported
- * and a NOT_SUPPORTED_ERR exception is thrown if attempted.
- */
- public Node importNode(Node source, boolean deep)
- throws DOMException {
- return importNode(source, deep, false, null);
- } // importNode(Node,boolean):Node
-
- /**
- * Overloaded implementation of DOM's importNode method. This method
- * provides the core functionality for the public importNode and cloneNode
- * methods.
- *
- * The reversedIdentifiers parameter is provided for cloneNode to preserve
- * the document's identifiers. The Map has Elements as the keys and
- * their identifiers as the values. When an element is being imported, a
- * check is done for an associated identifier. If one exists, the identifier
- * is registered with the new, imported element. If reversedIdentifiers is
- * null, the parameter is not applied.
- */
- private Node importNode(Node source, boolean deep, boolean cloningDoc,
- Map<Node, String> reversedIdentifiers)
- throws DOMException {
- Node newnode = null;
- Map<String, UserDataRecord> userData = null;
-
- // Sigh. This doesn't work; too many nodes have private data that
- // would have to be manually tweaked. May be able to add local
- // shortcuts to each nodetype. Consider ?????
- // if(source instanceof NodeImpl &&
- // !(source instanceof DocumentImpl))
- // {
- // // Can't clone DocumentImpl since it invokes us...
- // newnode=(NodeImpl)source.cloneNode(false);
- // newnode.ownerDocument=this;
- // }
- // else
- if (source instanceof NodeImpl) {
- userData = ((NodeImpl) source).getUserDataRecord();
- }
- int type = source.getNodeType();
- switch (type) {
- case ELEMENT_NODE: {
- Element newElement;
- boolean domLevel20 = source.getOwnerDocument().getImplementation().hasFeature("XML", "2.0");
- // Create element according to namespace support/qualification.
- if(domLevel20 == false || source.getLocalName() == null)
- newElement = createElement(source.getNodeName());
- else
- newElement = createElementNS(source.getNamespaceURI(),
- source.getNodeName());
-
- // Copy element's attributes, if any.
- NamedNodeMap sourceAttrs = source.getAttributes();
- if (sourceAttrs != null) {
- int length = sourceAttrs.getLength();
- for (int index = 0; index < length; index++) {
- Attr attr = (Attr)sourceAttrs.item(index);
-
- // NOTE: this methods is used for both importingNode
- // and cloning the document node. In case of the
- // clonning default attributes should be copied.
- // But for importNode defaults should be ignored.
- if (attr.getSpecified() || cloningDoc) {
- Attr newAttr = (Attr)importNode(attr, true, cloningDoc,
- reversedIdentifiers);
-
- // Attach attribute according to namespace
- // support/qualification.
- if (domLevel20 == false ||
- attr.getLocalName() == null)
- newElement.setAttributeNode(newAttr);
- else
- newElement.setAttributeNodeNS(newAttr);
- }
- }
- }
-
- // Register element identifier.
- if (reversedIdentifiers != null) {
- // Does element have an associated identifier?
- String elementId = reversedIdentifiers.get(source);
- if (elementId != null) {
- if (identifiers == null) {
- identifiers = new HashMap<>();
- }
-
- identifiers.put(elementId, newElement);
- }
- }
-
- newnode = newElement;
- break;
- }
-
- case ATTRIBUTE_NODE: {
-
- if( source.getOwnerDocument().getImplementation().hasFeature("XML", "2.0") ){
- if (source.getLocalName() == null) {
- newnode = createAttribute(source.getNodeName());
- } else {
- newnode = createAttributeNS(source.getNamespaceURI(),
- source.getNodeName());
- }
- }
- else {
- newnode = createAttribute(source.getNodeName());
- }
- // if source is an AttrImpl from this very same implementation
- // avoid creating the child nodes if possible
- if (source instanceof AttrImpl) {
- AttrImpl attr = (AttrImpl) source;
- if (attr.hasStringValue()) {
- AttrImpl newattr = (AttrImpl) newnode;
- newattr.setValue(attr.getValue());
- deep = false;
- }
- else {
- deep = true;
- }
- }
- else {
- // According to the DOM spec the kids carry the value.
- // However, there are non compliant implementations out
- // there that fail to do so. To avoid ending up with no
- // value at all, in this case we simply copy the text value
- // directly.
- if (source.getFirstChild() == null) {
- newnode.setNodeValue(source.getNodeValue());
- deep = false;
- } else {
- deep = true;
- }
- }
- break;
- }
-
- case TEXT_NODE: {
- newnode = createTextNode(source.getNodeValue());
- break;
- }
-
- case CDATA_SECTION_NODE: {
- newnode = createCDATASection(source.getNodeValue());
- break;
- }
-
- case ENTITY_REFERENCE_NODE: {
- newnode = createEntityReference(source.getNodeName());
- // the subtree is created according to this doc by the method
- // above, so avoid carrying over original subtree
- deep = false;
- break;
- }
-
- case ENTITY_NODE: {
- Entity srcentity = (Entity)source;
- EntityImpl newentity =
- (EntityImpl)createEntity(source.getNodeName());
- newentity.setPublicId(srcentity.getPublicId());
- newentity.setSystemId(srcentity.getSystemId());
- newentity.setNotationName(srcentity.getNotationName());
- // Kids carry additional value,
- // allow deep import temporarily
- newentity.isReadOnly(false);
- newnode = newentity;
- break;
- }
-
- case PROCESSING_INSTRUCTION_NODE: {
- newnode = createProcessingInstruction(source.getNodeName(),
- source.getNodeValue());
- break;
- }
-
- case COMMENT_NODE: {
- newnode = createComment(source.getNodeValue());
- break;
- }
-
- case DOCUMENT_TYPE_NODE: {
- // unless this is used as part of cloning a Document
- // forbid it for the sake of being compliant to the DOM spec
- if (!cloningDoc) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
- }
- DocumentType srcdoctype = (DocumentType)source;
- DocumentTypeImpl newdoctype = (DocumentTypeImpl)
- createDocumentType(srcdoctype.getNodeName(),
- srcdoctype.getPublicId(),
- srcdoctype.getSystemId());
- // Values are on NamedNodeMaps
- NamedNodeMap smap = srcdoctype.getEntities();
- NamedNodeMap tmap = newdoctype.getEntities();
- if(smap != null) {
- for(int i = 0; i < smap.getLength(); i++) {
- tmap.setNamedItem(importNode(smap.item(i), true, true,
- reversedIdentifiers));
- }
- }
- smap = srcdoctype.getNotations();
- tmap = newdoctype.getNotations();
- if (smap != null) {
- for(int i = 0; i < smap.getLength(); i++) {
- tmap.setNamedItem(importNode(smap.item(i), true, true,
- reversedIdentifiers));
- }
- }
-
- // NOTE: At this time, the DOM definition of DocumentType
- // doesn't cover Elements and their Attributes. domimpl's
- // extentions in that area will not be preserved, even if
- // copying from domimpl to domimpl. We could special-case
- // that here. Arguably we should. Consider. ?????
- newnode = newdoctype;
- break;
- }
-
- case DOCUMENT_FRAGMENT_NODE: {
- newnode = createDocumentFragment();
- // No name, kids carry value
- break;
- }
-
- case NOTATION_NODE: {
- Notation srcnotation = (Notation)source;
- NotationImpl newnotation =
- (NotationImpl)createNotation(source.getNodeName());
- newnotation.setPublicId(srcnotation.getPublicId());
- newnotation.setSystemId(srcnotation.getSystemId());
- // Kids carry additional value
- newnode = newnotation;
- // No name, no value
- break;
- }
- case DOCUMENT_NODE : // Can't import document nodes
- default: { // Unknown node type
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
- }
- }
-
- if(userData != null)
- callUserDataHandlers(source, newnode, UserDataHandler.NODE_IMPORTED,userData);
-
- // If deep, replicate and attach the kids.
- if (deep) {
- for (Node srckid = source.getFirstChild();
- srckid != null;
- srckid = srckid.getNextSibling()) {
- newnode.appendChild(importNode(srckid, true, cloningDoc,
- reversedIdentifiers));
- }
- }
- if (newnode.getNodeType() == Node.ENTITY_NODE) {
- ((NodeImpl)newnode).setReadOnly(true, true);
- }
- return newnode;
-
- } // importNode(Node,boolean,boolean,Map):Node
-
- /**
- * DOM Level 3 WD - Experimental
- * Change the node's ownerDocument, and its subtree, to this Document
- *
- * @param source The node to adopt.
- * @see #importNode
- **/
- public Node adoptNode(Node source) {
- NodeImpl node;
- Map<String, UserDataRecord> userData;
- try {
- node = (NodeImpl) source;
- } catch (ClassCastException e) {
- // source node comes from a different DOMImplementation
- return null;
- }
-
- // Return null if the source is null
-
- if (source == null ) {
- return null;
- } else if (source.getOwnerDocument() != null) {
-
- DOMImplementation thisImpl = this.getImplementation();
- DOMImplementation otherImpl = source.getOwnerDocument().getImplementation();
-
- // when the source node comes from a different implementation.
- if (thisImpl != otherImpl) {
-
- // Adopting from a DefferedDOM to DOM
- if (thisImpl instanceof com.sun.org.apache.xerces.internal.dom.DOMImplementationImpl &&
- otherImpl instanceof com.sun.org.apache.xerces.internal.dom.DeferredDOMImplementationImpl) {
- // traverse the DOM and expand deffered nodes and then allow adoption
- undeferChildren (node);
- } else if ( thisImpl instanceof com.sun.org.apache.xerces.internal.dom.DeferredDOMImplementationImpl
- && otherImpl instanceof com.sun.org.apache.xerces.internal.dom.DOMImplementationImpl) {
- // Adopting from a DOM into a DefferedDOM, this should be okay
- } else {
- // Adopting between two dissimilar DOM's is not allowed
- return null;
- }
- }
- }
-
- switch (node.getNodeType()) {
- case ATTRIBUTE_NODE: {
- AttrImpl attr = (AttrImpl) node;
- // remove node from wherever it is
- if( attr.getOwnerElement() != null){
- //1. owner element attribute is set to null
- attr.getOwnerElement().removeAttributeNode(attr);
- }
- //2. specified flag is set to true
- attr.isSpecified(true);
- userData = node.getUserDataRecord();
-
- //3. change ownership
- attr.setOwnerDocument(this);
- if (userData != null) {
- setUserDataTable(node, userData);
- }
- break;
- }
- //entity, notation nodes are read only nodes.. so they can't be adopted.
- //runtime will fall through to NOTATION_NODE
- case ENTITY_NODE:
- case NOTATION_NODE:{
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null);
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg);
-
- }
- //document, documentype nodes can't be adopted.
- //runtime will fall through to DocumentTypeNode
- case DOCUMENT_NODE:
- case DOCUMENT_TYPE_NODE: {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
- }
- case ENTITY_REFERENCE_NODE: {
- userData = node.getUserDataRecord();
- // remove node from wherever it is
- Node parent = node.getParentNode();
- if (parent != null) {
- parent.removeChild(source);
- }
- // discard its replacement value
- Node child;
- while ((child = node.getFirstChild()) != null) {
- node.removeChild(child);
- }
- // change ownership
- node.setOwnerDocument(this);
- if (userData != null) {
- setUserDataTable(node, userData);
- }
- // set its new replacement value if any
- if (docType == null) {
- break;
- }
- NamedNodeMap entities = docType.getEntities();
- Node entityNode = entities.getNamedItem(node.getNodeName());
- if (entityNode == null) {
- break;
- }
- for (child = entityNode.getFirstChild();
- child != null; child = child.getNextSibling()) {
- Node childClone = child.cloneNode(true);
- node.appendChild(childClone);
- }
- break;
- }
- case ELEMENT_NODE: {
- userData = node.getUserDataRecord();
- // remove node from wherever it is
- Node parent = node.getParentNode();
- if (parent != null) {
- parent.removeChild(source);
- }
- // change ownership
- node.setOwnerDocument(this);
- if (userData != null) {
- setUserDataTable(node, userData);
- }
- // reconcile default attributes
- ((ElementImpl)node).reconcileDefaultAttributes();
- break;
- }
- default: {
- userData = node.getUserDataRecord();
- // remove node from wherever it is
- Node parent = node.getParentNode();
- if (parent != null) {
- parent.removeChild(source);
- }
- // change ownership
- node.setOwnerDocument(this);
- if (userData != null) {
- setUserDataTable(node, userData);
- }
- }
- }
-
- //DOM L3 Core CR
- //http://www.w3.org/TR/2003/CR-DOM-Level-3-Core-20031107/core.html#UserDataHandler-ADOPTED
- if (userData != null) {
- callUserDataHandlers(source, null, UserDataHandler.NODE_ADOPTED, userData);
- }
-
- return node;
- }
-
- /**
- * Traverses the DOM Tree and expands deferred nodes and their
- * children.
- *
- */
- protected void undeferChildren(Node node) {
-
- Node top = node;
-
- while (null != node) {
-
- if (((NodeImpl)node).needsSyncData()) {
- ((NodeImpl)node).synchronizeData();
- }
-
- NamedNodeMap attributes = node.getAttributes();
- if (attributes != null) {
- int length = attributes.getLength();
- for (int i = 0; i < length; ++i) {
- undeferChildren(attributes.item(i));
- }
- }
-
- Node nextNode = null;
- nextNode = node.getFirstChild();
-
- while (null == nextNode) {
-
- if (top.equals(node))
- break;
-
- nextNode = node.getNextSibling();
-
- if (null == nextNode) {
- node = node.getParentNode();
-
- if ((null == node) || (top.equals(node))) {
- nextNode = null;
- break;
- }
- }
- }
-
- node = nextNode;
- }
- }
-
- // identifier maintenence
- /**
- * Introduced in DOM Level 2
- * Returns the Element whose ID is given by elementId. If no such element
- * exists, returns null. Behavior is not defined if more than one element
- * has this ID.
- * <p>
- * Note: The DOM implementation must have information that says which
- * attributes are of type ID. Attributes with the name "ID" are not of type
- * ID unless so defined. Implementations that do not know whether
- * attributes are of type ID or not are expected to return null.
- * @see #getIdentifier
- */
- public Element getElementById(String elementId) {
- return getIdentifier(elementId);
- }
-
- /**
- * Remove all identifiers from the ID table
- */
- protected final void clearIdentifiers(){
- if (identifiers != null){
- identifiers.clear();
- }
- }
-
- /**
- * Registers an identifier name with a specified element node.
- * If the identifier is already registered, the new element
- * node replaces the previous node. If the specified element
- * node is null, removeIdentifier() is called.
- *
- * @see #getIdentifier
- * @see #removeIdentifier
- */
- public void putIdentifier(String idName, Element element) {
-
- if (element == null) {
- removeIdentifier(idName);
- return;
- }
-
- if (needsSyncData()) {
- synchronizeData();
- }
-
- if (identifiers == null) {
- identifiers = new HashMap<>();
- }
-
- identifiers.put(idName, element);
-
- } // putIdentifier(String,Element)
-
- /**
- * Returns a previously registered element with the specified
- * identifier name, or null if no element is registered.
- *
- * @see #putIdentifier
- * @see #removeIdentifier
- */
- public Element getIdentifier(String idName) {
-
- if (needsSyncData()) {
- synchronizeData();
- }
-
- if (identifiers == null) {
- return null;
- }
- Element elem = (Element) identifiers.get(idName);
- if (elem != null) {
- // check that the element is in the tree
- Node parent = elem.getParentNode();
- while (parent != null) {
- if (parent == this) {
- return elem;
- }
- parent = parent.getParentNode();
- }
- }
- return null;
- } // getIdentifier(String):Element
-
- /**
- * Removes a previously registered element with the specified
- * identifier name.
- *
- * @see #putIdentifier
- * @see #getIdentifier
- */
- public void removeIdentifier(String idName) {
-
- if (needsSyncData()) {
- synchronizeData();
- }
-
- if (identifiers == null) {
- return;
- }
-
- identifiers.remove(idName);
-
- } // removeIdentifier(String)
-
- //
- // DOM2: Namespace methods
- //
- /**
- * Introduced in DOM Level 2. <p>
- * Creates an element of the given qualified name and namespace URI.
- * If the given namespaceURI is null or an empty string and the
- * qualifiedName has a prefix that is "xml", the created element
- * is bound to the predefined namespace
- * "http://www.w3.org/XML/1998/namespace" [Namespaces].
- * @param namespaceURI The namespace URI of the element to
- * create.
- * @param qualifiedName The qualified name of the element type to
- * instantiate.
- * @return Element A new Element object with the following attributes:
- * @throws DOMException INVALID_CHARACTER_ERR: Raised if the specified
- * name contains an invalid character.
- * @throws DOMException NAMESPACE_ERR: Raised if the qualifiedName has a
- * prefix that is "xml" and the namespaceURI is
- * neither null nor an empty string nor
- * "http://www.w3.org/XML/1998/namespace", or
- * if the qualifiedName has a prefix different
- * from "xml" and the namespaceURI is null or an
- * empty string.
- * @since WD-DOM-Level-2-19990923
- */
- public Element createElementNS(String namespaceURI, String qualifiedName)
- throws DOMException {
- return new ElementNSImpl(this, namespaceURI, qualifiedName);
- }
-
- /**
- * NON-DOM: a factory method used by the Xerces DOM parser
- * to create an element.
- *
- * @param namespaceURI The namespace URI of the element to
- * create.
- * @param qualifiedName The qualified name of the element type to
- * instantiate.
- * @param localpart The local name of the attribute to instantiate.
- *
- * @return Element A new Element object with the following attributes:
- * @exception DOMException INVALID_CHARACTER_ERR: Raised if the specified
- * name contains an invalid character.
- */
- public Element createElementNS(String namespaceURI, String qualifiedName,
- String localpart)
- throws DOMException {
- return new ElementNSImpl(this, namespaceURI, qualifiedName, localpart);
- }
-
- /**
- * Introduced in DOM Level 2. <p>
- * Creates an attribute of the given qualified name and namespace URI.
- * If the given namespaceURI is null or an empty string and the
- * qualifiedName has a prefix that is "xml", the created element
- * is bound to the predefined namespace
- * "http://www.w3.org/XML/1998/namespace" [Namespaces].
- *
- * @param namespaceURI The namespace URI of the attribute to
- * create. When it is null or an empty string,
- * this method behaves like createAttribute.
- * @param qualifiedName The qualified name of the attribute to
- * instantiate.
- * @return Attr A new Attr object.
- * @throws DOMException INVALID_CHARACTER_ERR: Raised if the specified
- * name contains an invalid character.
- * @since WD-DOM-Level-2-19990923
- */
- public Attr createAttributeNS(String namespaceURI, String qualifiedName)
- throws DOMException {
- return new AttrNSImpl(this, namespaceURI, qualifiedName);
- }
-
- /**
- * NON-DOM: a factory method used by the Xerces DOM parser
- * to create an element.
- *
- * @param namespaceURI The namespace URI of the attribute to
- * create. When it is null or an empty string,
- * this method behaves like createAttribute.
- * @param qualifiedName The qualified name of the attribute to
- * instantiate.
- * @param localpart The local name of the attribute to instantiate.
- *
- * @return Attr A new Attr object.
- * @throws DOMException INVALID_CHARACTER_ERR: Raised if the specified
- * name contains an invalid character.
- */
- public Attr createAttributeNS(String namespaceURI, String qualifiedName,
- String localpart)
- throws DOMException {
- return new AttrNSImpl(this, namespaceURI, qualifiedName, localpart);
- }
-
- /**
- * Introduced in DOM Level 2. <p>
- * Returns a NodeList of all the Elements with a given local name and
- * namespace URI in the order in which they would be encountered in a
- * preorder traversal of the Document tree.
- * @param namespaceURI The namespace URI of the elements to match
- * on. The special value "*" matches all
- * namespaces. When it is null or an empty
- * string, this method behaves like
- * getElementsByTagName.
- * @param localName The local name of the elements to match on.
- * The special value "*" matches all local names.
- * @return NodeList A new NodeList object containing all the matched
- * Elements.
- * @since WD-DOM-Level-2-19990923
- */
- public NodeList getElementsByTagNameNS(String namespaceURI,
- String localName) {
- return new DeepNodeListImpl(this, namespaceURI, localName);
- }
-
- //
- // Object methods
- //
-
- /** Clone. */
- public Object clone() throws CloneNotSupportedException {
- CoreDocumentImpl newdoc = (CoreDocumentImpl) super.clone();
- newdoc.docType = null;
- newdoc.docElement = null;
- return newdoc;
- }
-
- //
- // Public static methods
- //
-
- /**
- * Check the string against XML's definition of acceptable names for
- * elements and attributes and so on using the XMLCharacterProperties
- * utility class
- */
-
- public static final boolean isXMLName(String s, boolean xml11Version) {
-
- if (s == null) {
- return false;
- }
- if(!xml11Version)
- return XMLChar.isValidName(s);
- else
- return XML11Char.isXML11ValidName(s);
-
- } // isXMLName(String):boolean
-
- /**
- * Checks if the given qualified name is legal with respect
- * to the version of XML to which this document must conform.
- *
- * @param prefix prefix of qualified name
- * @param local local part of qualified name
- */
- public static final boolean isValidQName(String prefix, String local, boolean xml11Version) {
-
- // check that both prefix and local part match NCName
- if (local == null) return false;
- boolean validNCName = false;
-
- if (!xml11Version) {
- validNCName = (prefix == null || XMLChar.isValidNCName(prefix))
- && XMLChar.isValidNCName(local);
- }
- else {
- validNCName = (prefix == null || XML11Char.isXML11ValidNCName(prefix))
- && XML11Char.isXML11ValidNCName(local);
- }
-
- return validNCName;
- }
- //
- // Protected methods
- //
-
- /**
- * Uses the kidOK lookup table to check whether the proposed
- * tree structure is legal.
- */
- protected boolean isKidOK(Node parent, Node child) {
- if (allowGrammarAccess &&
- parent.getNodeType() == Node.DOCUMENT_TYPE_NODE) {
- return child.getNodeType() == Node.ELEMENT_NODE;
- }
- return 0 != (kidOK[parent.getNodeType()] & 1 << child.getNodeType());
- }
-
- /**
- * Denotes that this node has changed.
- */
- protected void changed() {
- changes++;
- }
-
- /**
- * Returns the number of changes to this node.
- */
- protected int changes() {
- return changes;
- }
-
- // NodeListCache pool
-
- /**
- * Returns a NodeListCache for the given node.
- */
- NodeListCache getNodeListCache(ParentNode owner) {
- if (fFreeNLCache == null) {
- return new NodeListCache(owner);
- }
- NodeListCache c = fFreeNLCache;
- fFreeNLCache = fFreeNLCache.next;
- c.fChild = null;
- c.fChildIndex = -1;
- c.fLength = -1;
- // revoke previous ownership
- if (c.fOwner != null) {
- c.fOwner.fNodeListCache = null;
- }
- c.fOwner = owner;
- // c.next = null; not necessary, except for confused people...
- return c;
- }
-
- /**
- * Puts the given NodeListCache in the free list.
- * Note: The owner node can keep using it until we reuse it
- */
- void freeNodeListCache(NodeListCache c) {
- c.next = fFreeNLCache;
- fFreeNLCache = c;
- }
-
-
-
- /**
- * Associate an object to a key on this node. The object can later be
- * retrieved from this node by calling <code>getUserData</code> with the
- * same key.
- * @param n The node to associate the object to.
- * @param key The key to associate the object to.
- * @param data The object to associate to the given key, or
- * <code>null</code> to remove any existing association to that key.
- * @param handler The handler to associate to that key, or
- * <code>null</code>.
- * @return Returns the <code>DOMObject</code> previously associated to
- * the given key on this node, or <code>null</code> if there was none.
- * @since DOM Level 3
- *
- * REVISIT: we could use a free list of UserDataRecord here
- */
- public Object setUserData(Node n, String key,
- Object data, UserDataHandler handler) {
- if (data == null) {
- if (nodeUserData != null) {
- Map<String, UserDataRecord> t = nodeUserData.get(n);
- if (t != null) {
- UserDataRecord r = t.remove(key);
- if (r != null) {
- return r.fData;
- }
- }
- }
- return null;
- } else {
- Map<String, UserDataRecord> t;
- if (nodeUserData == null) {
- nodeUserData = new HashMap<>();
- t = new HashMap<>();
- nodeUserData.put(n, t);
- } else {
- t = nodeUserData.get(n);
- if (t == null) {
- t = new HashMap<>();
- nodeUserData.put(n, t);
- }
- }
- UserDataRecord r = t.put(key, new UserDataRecord(data, handler));
- if (r != null) {
- return r.fData;
- }
- return null;
- }
- }
-
-
- /**
- * Retrieves the object associated to a key on a this node. The object
- * must first have been set to this node by calling
- * <code>setUserData</code> with the same key.
- * @param n The node the object is associated to.
- * @param key The key the object is associated to.
- * @return Returns the <code>DOMObject</code> associated to the given key
- * on this node, or <code>null</code> if there was none.
- * @since DOM Level 3
- */
- public Object getUserData(Node n, String key) {
- if (nodeUserData == null) {
- return null;
- }
- Map<String, UserDataRecord> t = nodeUserData.get(n);
- if (t == null) {
- return null;
- }
- UserDataRecord r = t.get(key);
- if (r != null) {
- return r.fData;
- }
- return null;
- }
-
- protected Map<String, UserDataRecord> getUserDataRecord(Node n) {
- if (nodeUserData == null) {
- return null;
- }
- Map<String, UserDataRecord> t = nodeUserData.get(n);
- if (t == null) {
- return null;
- }
- return t;
- }
-
- /**
- * Remove user data table for the given node.
- * @param n The node this operation applies to.
- * @return The removed table.
- */
- Map<String, UserDataRecord> removeUserDataTable(Node n) {
- if (nodeUserData == null) {
- return null;
- }
- return nodeUserData.get(n);
- }
-
- /**
- * Set user data table for the given node.
- * @param n The node this operation applies to.
- * @param data The user data table.
- */
- void setUserDataTable(Node n, Map<String, UserDataRecord> data) {
- if (nodeUserData == null) {
- nodeUserData = new HashMap<>();
- }
-
- if (data != null) {
- nodeUserData.put(n, data);
- }
- }
-
- /**
- * Call user data handlers when a node is deleted (finalized)
- * @param n The node this operation applies to.
- * @param c The copy node or null.
- * @param operation The operation - import, clone, or delete.
- */
- void callUserDataHandlers(Node n, Node c, short operation) {
- if (nodeUserData == null) {
- return;
- }
-
- if (n instanceof NodeImpl) {
- Map<String, UserDataRecord> t = ((NodeImpl) n).getUserDataRecord();
- if (t == null || t.isEmpty()) {
- return;
- }
- callUserDataHandlers(n, c, operation, t);
- }
- }
-
- /**
- * Call user data handlers when a node is deleted (finalized)
- * @param n The node this operation applies to.
- * @param c The copy node or null.
- * @param operation The operation - import, clone, or delete.
- * @param handlers Data associated with n.
- */
- void callUserDataHandlers(Node n, Node c, short operation, Map<String, UserDataRecord> userData) {
- if (userData == null || userData.isEmpty()) {
- return;
- }
- for (String key : userData.keySet()) {
- UserDataRecord r = userData.get(key);
- if (r.fHandler != null) {
- r.fHandler.handle(operation, key, r.fData, n, c);
- }
- }
- }
-
- /**
- * Call user data handlers to let them know the nodes they are related to
- * are being deleted. The alternative would be to do that on Node but
- * because the nodes are used as the keys we have a reference to them that
- * prevents them from being gc'ed until the document is. At the same time,
- * doing it here has the advantage of avoiding a finalize() method on Node,
- * which would affect all nodes and not just the ones that have a user
- * data.
- */
- // Temporarily comment out this method, because
- // 1. It seems that finalizers are not guaranteed to be called, so the
- // functionality is not implemented.
- // 2. It affects the performance greatly in multi-thread environment.
- // -SG
- /*public void finalize() {
- if (userData == null) {
- return;
- }
- Enumeration nodes = userData.keys();
- while (nodes.hasMoreElements()) {
- Object node = nodes.nextElement();
- Hashtable t = (Hashtable) userData.get(node);
- if (t != null && !t.isEmpty()) {
- Enumeration keys = t.keys();
- while (keys.hasMoreElements()) {
- String key = (String) keys.nextElement();
- UserDataRecord r = (UserDataRecord) t.get(key);
- if (r.fHandler != null) {
- r.fHandler.handle(UserDataHandler.NODE_DELETED,
- key, r.fData, null, null);
- }
- }
- }
- }
- }*/
-
- protected final void checkNamespaceWF( String qname, int colon1,
- int colon2) {
-
- if (!errorChecking) {
- return;
- }
- // it is an error for NCName to have more than one ':'
- // check if it is valid QName [Namespace in XML production 6]
- // :camera , nikon:camera:minolta, camera:
- if (colon1 == 0 || colon1 == qname.length() - 1 || colon2 != colon1) {
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "NAMESPACE_ERR",
- null);
- throw new DOMException(DOMException.NAMESPACE_ERR, msg);
- }
- }
- protected final void checkDOMNSErr(String prefix,
- String namespace) {
- if (errorChecking) {
- if (namespace == null) {
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "NAMESPACE_ERR",
- null);
- throw new DOMException(DOMException.NAMESPACE_ERR, msg);
- }
- else if (prefix.equals("xml")
- && !namespace.equals(NamespaceContext.XML_URI)) {
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "NAMESPACE_ERR",
- null);
- throw new DOMException(DOMException.NAMESPACE_ERR, msg);
- }
- else if (
- prefix.equals("xmlns")
- && !namespace.equals(NamespaceContext.XMLNS_URI)
- || (!prefix.equals("xmlns")
- && namespace.equals(NamespaceContext.XMLNS_URI))) {
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "NAMESPACE_ERR",
- null);
- throw new DOMException(DOMException.NAMESPACE_ERR, msg);
- }
- }
- }
-
- /**
- * Checks if the given qualified name is legal with respect
- * to the version of XML to which this document must conform.
- *
- * @param prefix prefix of qualified name
- * @param local local part of qualified name
- */
- protected final void checkQName(String prefix, String local) {
- if (!errorChecking) {
- return;
- }
-
- // check that both prefix and local part match NCName
- boolean validNCName = false;
- if (!xml11Version) {
- validNCName = (prefix == null || XMLChar.isValidNCName(prefix))
- && XMLChar.isValidNCName(local);
- }
- else {
- validNCName = (prefix == null || XML11Char.isXML11ValidNCName(prefix))
- && XML11Char.isXML11ValidNCName(local);
- }
-
- if (!validNCName) {
- // REVISIT: add qname parameter to the message
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "INVALID_CHARACTER_ERR",
- null);
- throw new DOMException(DOMException.INVALID_CHARACTER_ERR, msg);
- }
- }
-
- /**
- * We could have more xml versions in future , but for now we could
- * do with this to handle XML 1.0 and 1.1
- */
- boolean isXML11Version(){
- return xml11Version;
- }
-
- boolean isNormalizeDocRequired(){
- // REVISIT: Implement to optimize when normalization
- // is required
- return true;
- }
-
- //we should be checking the (elements, attribute, entity etc.) names only when
- //version of the document is changed.
- boolean isXMLVersionChanged(){
- return xmlVersionChanged ;
- }
- /**
- * NON-DOM: kept for backward compatibility
- * Store user data related to a given node
- * This is a place where we could use weak references! Indeed, the node
- * here won't be GC'ed as long as some user data is attached to it, since
- * the userData table will have a reference to the node.
- */
- protected void setUserData(NodeImpl n, Object data) {
- setUserData(n, "XERCES1DOMUSERDATA", data, null);
- }
-
- /**
- * NON-DOM: kept for backward compatibility
- * Retreive user data related to a given node
- */
- protected Object getUserData(NodeImpl n) {
- return getUserData(n, "XERCES1DOMUSERDATA");
- }
-
-
- // Event related methods overidden in subclass
-
- protected void addEventListener(NodeImpl node, String type,
- EventListener listener,
- boolean useCapture) {
- // does nothing by default - overidden in subclass
- }
-
- protected void removeEventListener(NodeImpl node, String type,
- EventListener listener,
- boolean useCapture) {
- // does nothing by default - overidden in subclass
- }
-
- protected void copyEventListeners(NodeImpl src, NodeImpl tgt) {
- // does nothing by default - overidden in subclass
- }
-
- protected boolean dispatchEvent(NodeImpl node, Event event) {
- // does nothing by default - overidden in subclass
- return false;
- }
-
- // Notification methods overidden in subclasses
-
- /**
- * A method to be called when some text was changed in a text node,
- * so that live objects can be notified.
- */
- void replacedText(NodeImpl node) {
- }
-
- /**
- * A method to be called when some text was deleted from a text node,
- * so that live objects can be notified.
- */
- void deletedText(NodeImpl node, int offset, int count) {
- }
-
- /**
- * A method to be called when some text was inserted into a text node,
- * so that live objects can be notified.
- */
- void insertedText(NodeImpl node, int offset, int count) {
- }
-
- /**
- * A method to be called when a character data node is about to be modified
- */
- void modifyingCharacterData(NodeImpl node, boolean replace) {
- }
-
- /**
- * A method to be called when a character data node has been modified
- */
- void modifiedCharacterData(NodeImpl node, String oldvalue, String value, boolean replace) {
- }
-
- /**
- * A method to be called when a node is about to be inserted in the tree.
- */
- void insertingNode(NodeImpl node, boolean replace) {
- }
-
- /**
- * A method to be called when a node has been inserted in the tree.
- */
- void insertedNode(NodeImpl node, NodeImpl newInternal, boolean replace) {
- }
-
- /**
- * A method to be called when a node is about to be removed from the tree.
- */
- void removingNode(NodeImpl node, NodeImpl oldChild, boolean replace) {
- }
-
- /**
- * A method to be called when a node has been removed from the tree.
- */
- void removedNode(NodeImpl node, boolean replace) {
- }
-
- /**
- * A method to be called when a node is about to be replaced in the tree.
- */
- void replacingNode(NodeImpl node) {
- }
-
- /**
- * A method to be called when a node has been replaced in the tree.
- */
- void replacedNode(NodeImpl node) {
- }
-
- /**
- * A method to be called when a character data node is about to be replaced
- */
- void replacingData(NodeImpl node) {
- }
-
- /**
- * method to be called when a character data node has been replaced.
- */
- void replacedCharacterData(NodeImpl node, String oldvalue, String value) {
- }
-
-
- /**
- * A method to be called when an attribute value has been modified
- */
- void modifiedAttrValue(AttrImpl attr, String oldvalue) {
- }
-
- /**
- * A method to be called when an attribute node has been set
- */
- void setAttrNode(AttrImpl attr, AttrImpl previous) {
- }
-
- /**
- * A method to be called when an attribute node has been removed
- */
- void removedAttrNode(AttrImpl attr, NodeImpl oldOwner, String name) {
- }
-
- /**
- * A method to be called when an attribute node has been renamed
- */
- void renamedAttrNode(Attr oldAt, Attr newAt) {
- }
-
- /**
- * A method to be called when an element has been renamed
- */
- void renamedElement(Element oldEl, Element newEl) {
- }
-
- /**
- * @serialData Serialized fields. Convert Maps to Hashtables for backward
- * compatibility.
- */
- private void writeObject(ObjectOutputStream out) throws IOException {
- // Convert Maps to Hashtables
- Hashtable<Node, Hashtable<String, UserDataRecord>> nud = null;
- if (nodeUserData != null) {
- nud = new Hashtable<>();
- for (Map.Entry<Node, Map<String, UserDataRecord>> e : nodeUserData.entrySet()) {
- //e.getValue() will not be null since an entry is always put with a non-null value
- nud.put(e.getKey(), new Hashtable<>(e.getValue()));
- }
- }
-
- Hashtable<String, Node> ids = (identifiers == null)? null : new Hashtable<>(identifiers);
- Hashtable<Node, Integer> nt = (nodeTable == null)? null : new Hashtable<>(nodeTable);
-
- // Write serialized fields
- ObjectOutputStream.PutField pf = out.putFields();
- pf.put("docType", docType);
- pf.put("docElement", docElement);
- pf.put("fFreeNLCache", fFreeNLCache);
- pf.put("encoding", encoding);
- pf.put("actualEncoding", actualEncoding);
- pf.put("version", version);
- pf.put("standalone", standalone);
- pf.put("fDocumentURI", fDocumentURI);
-
- //userData is the original name. It has been changed to nodeUserData, refer to the corrsponding @serialField
- pf.put("userData", nud);
- pf.put("identifiers", ids);
- pf.put("changes", changes);
- pf.put("allowGrammarAccess", allowGrammarAccess);
- pf.put("errorChecking", errorChecking);
- pf.put("ancestorChecking", ancestorChecking);
- pf.put("xmlVersionChanged", xmlVersionChanged);
- pf.put("documentNumber", documentNumber);
- pf.put("nodeCounter", nodeCounter);
- pf.put("nodeTable", nt);
- pf.put("xml11Version", xml11Version);
- out.writeFields();
- }
-
- @SuppressWarnings("unchecked")
- private void readObject(ObjectInputStream in)
- throws IOException, ClassNotFoundException {
- // We have to read serialized fields first.
- ObjectInputStream.GetField gf = in.readFields();
- docType = (DocumentTypeImpl)gf.get("docType", null);
- docElement = (ElementImpl)gf.get("docElement", null);
- fFreeNLCache = (NodeListCache)gf.get("fFreeNLCache", null);
- encoding = (String)gf.get("encoding", null);
- actualEncoding = (String)gf.get("actualEncoding", null);
- version = (String)gf.get("version", null);
- standalone = gf.get("standalone", false);
- fDocumentURI = (String)gf.get("fDocumentURI", null);
-
- //userData is the original name. It has been changed to nodeUserData, refer to the corrsponding @serialField
- Hashtable<Node, Hashtable<String, UserDataRecord>> nud =
- (Hashtable<Node, Hashtable<String, UserDataRecord>>)gf.get("userData", null);
-
- Hashtable<String, Node> ids = (Hashtable<String, Node>)gf.get("identifiers", null);
-
- changes = gf.get("changes", 0);
- allowGrammarAccess = gf.get("allowGrammarAccess", false);
- errorChecking = gf.get("errorChecking", true);
- ancestorChecking = gf.get("ancestorChecking", true);
- xmlVersionChanged = gf.get("xmlVersionChanged", false);
- documentNumber = gf.get("documentNumber", 0);
- nodeCounter = gf.get("nodeCounter", 0);
-
- Hashtable<Node, Integer> nt = (Hashtable<Node, Integer>)gf.get("nodeTable", null);
-
- xml11Version = gf.get("xml11Version", false);
-
- //convert Hashtables back to HashMaps
- if (nud != null) {
- nodeUserData = new HashMap<>();
- for (Map.Entry<Node, Hashtable<String, UserDataRecord>> e : nud.entrySet()) {
- nodeUserData.put(e.getKey(), new HashMap<>(e.getValue()));
- }
- }
-
- if (ids != null) identifiers = new HashMap<>(ids);
- if (nt != null) nodeTable = new HashMap<>(nt);
- }
-} // class CoreDocumentImpl
diff --git a/src/com/sun/org/apache/xerces/internal/dom/DOMConfigurationImpl.java b/src/com/sun/org/apache/xerces/internal/dom/DOMConfigurationImpl.java
deleted file mode 100644
index 1e8dcd9..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/DOMConfigurationImpl.java
+++ /dev/null
@@ -1,1103 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.XMLEntityManager;
-import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
-import com.sun.org.apache.xerces.internal.impl.dv.DTDDVFactory;
-import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter;
-import com.sun.org.apache.xerces.internal.impl.validation.ValidationManager;
-import com.sun.org.apache.xerces.internal.util.DOMEntityResolverWrapper;
-import com.sun.org.apache.xerces.internal.util.DOMErrorHandlerWrapper;
-import com.sun.org.apache.xerces.internal.util.MessageFormatter;
-import com.sun.org.apache.xerces.internal.util.ParserConfigurationSettings;
-import com.sun.org.apache.xerces.internal.util.PropertyState;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.utils.ObjectFactory;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager;
-import com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLDTDHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponent;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLEntityResolver;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.Vector;
-import javax.xml.XMLConstants;
-import org.w3c.dom.DOMConfiguration;
-import org.w3c.dom.DOMErrorHandler;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.DOMStringList;
-import org.w3c.dom.ls.LSResourceResolver;
-
-
-
-/**
- * Xerces implementation of DOMConfiguration that maintains a table of recognized parameters.
- *
- * @xerces.internal
- *
- * @author Elena Litani, IBM
- * @author Neeraj Bajaj, Sun Microsystems.
- * @version $Id: DOMConfigurationImpl.java,v 1.9 2010-11-01 04:39:37 joehw Exp $
- */
-public class DOMConfigurationImpl extends ParserConfigurationSettings
- implements XMLParserConfiguration, DOMConfiguration {
-
- //
- // Constants
- //
-
- // feature identifiers
-
- /** Feature identifier: validation. */
- protected static final String XERCES_VALIDATION =
- Constants.SAX_FEATURE_PREFIX + Constants.VALIDATION_FEATURE;
-
- /** Feature identifier: namespaces. */
- protected static final String XERCES_NAMESPACES =
- Constants.SAX_FEATURE_PREFIX + Constants.NAMESPACES_FEATURE;
-
- protected static final String SCHEMA =
- Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_VALIDATION_FEATURE;
-
- protected static final String SCHEMA_FULL_CHECKING =
- Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_FULL_CHECKING;
-
- protected static final String DYNAMIC_VALIDATION =
- Constants.XERCES_FEATURE_PREFIX + Constants.DYNAMIC_VALIDATION_FEATURE;
-
- protected static final String NORMALIZE_DATA =
- Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_NORMALIZED_VALUE;
-
- /** sending psvi in the pipeline */
- protected static final String SEND_PSVI =
- Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_AUGMENT_PSVI;
-
- protected final static String DTD_VALIDATOR_FACTORY_PROPERTY =
- Constants.XERCES_PROPERTY_PREFIX + Constants.DATATYPE_VALIDATOR_FACTORY_PROPERTY;
-
- /** Feature identifier: namespace growth */
- protected static final String NAMESPACE_GROWTH =
- Constants.XERCES_FEATURE_PREFIX + Constants.NAMESPACE_GROWTH_FEATURE;
-
- protected static final String TOLERATE_DUPLICATES =
- Constants.XERCES_FEATURE_PREFIX + Constants.TOLERATE_DUPLICATES_FEATURE;
-
- // property identifiers
-
- /** Property identifier: entity manager. */
- protected static final String ENTITY_MANAGER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_MANAGER_PROPERTY;
-
- /** Property identifier: error reporter. */
- protected static final String ERROR_REPORTER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY;
-
- /** Property identifier: xml string. */
- protected static final String XML_STRING =
- Constants.SAX_PROPERTY_PREFIX + Constants.XML_STRING_PROPERTY;
-
- /** Property identifier: symbol table. */
- protected static final String SYMBOL_TABLE =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY;
-
- /** Property id: Grammar pool*/
- protected static final String GRAMMAR_POOL =
- Constants.XERCES_PROPERTY_PREFIX + Constants.XMLGRAMMAR_POOL_PROPERTY;
-
- /** Property identifier: error handler. */
- protected static final String ERROR_HANDLER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_HANDLER_PROPERTY;
-
- /** Property identifier: entity resolver. */
- protected static final String ENTITY_RESOLVER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_RESOLVER_PROPERTY;
-
- /** Property identifier: JAXP schema language / DOM schema-type. */
- protected static final String JAXP_SCHEMA_LANGUAGE =
- Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_LANGUAGE;
-
- /** Property identifier: JAXP schema source/ DOM schema-location. */
- protected static final String JAXP_SCHEMA_SOURCE =
- Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_SOURCE;
-
- protected static final String VALIDATION_MANAGER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.VALIDATION_MANAGER_PROPERTY;
-
- /** Property identifier: Schema DV Factory */
- protected static final String SCHEMA_DV_FACTORY =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SCHEMA_DV_FACTORY_PROPERTY;
-
- /** Property identifier: Security manager. */
- private static final String SECURITY_MANAGER = Constants.SECURITY_MANAGER;
-
- /** Property identifier: Security property manager. */
- private static final String XML_SECURITY_PROPERTY_MANAGER =
- Constants.XML_SECURITY_PROPERTY_MANAGER;
-
- //
- // Data
- //
- XMLDocumentHandler fDocumentHandler;
-
- /** Normalization features*/
- protected short features = 0;
-
- protected final static short NAMESPACES = 0x1<<0;
- protected final static short DTNORMALIZATION = 0x1<<1;
- protected final static short ENTITIES = 0x1<<2;
- protected final static short CDATA = 0x1<<3;
- protected final static short SPLITCDATA = 0x1<<4;
- protected final static short COMMENTS = 0x1<<5;
- protected final static short VALIDATE = 0x1<<6;
- protected final static short PSVI = 0x1<<7;
- protected final static short WELLFORMED = 0x1<<8;
- protected final static short NSDECL = 0x1<<9;
-
- protected final static short INFOSET_TRUE_PARAMS = NAMESPACES | COMMENTS | WELLFORMED | NSDECL;
- protected final static short INFOSET_FALSE_PARAMS = ENTITIES | DTNORMALIZATION | CDATA;
- protected final static short INFOSET_MASK = INFOSET_TRUE_PARAMS | INFOSET_FALSE_PARAMS;
-
- // components
-
- /** Symbol table. */
- protected SymbolTable fSymbolTable;
-
- /** Components. */
- protected ArrayList fComponents;
-
- protected ValidationManager fValidationManager;
-
- /** Locale. */
- protected Locale fLocale;
-
- /** Error reporter */
- protected XMLErrorReporter fErrorReporter;
-
- protected final DOMErrorHandlerWrapper fErrorHandlerWrapper =
- new DOMErrorHandlerWrapper();
-
- // private data
-
- private DOMStringList fRecognizedParameters;
-
-
- //
- // Constructors
- //
-
- /** Default Constructor. */
- protected DOMConfigurationImpl() {
- this(null, null);
- } // <init>()
-
- /**
- * Constructs a parser configuration using the specified symbol table.
- *
- * @param symbolTable The symbol table to use.
- */
- protected DOMConfigurationImpl(SymbolTable symbolTable) {
- this(symbolTable, null);
- } // <init>(SymbolTable)
-
- /**
- * Constructs a parser configuration using the specified symbol table
- * and parent settings.
- *
- * @param symbolTable The symbol table to use.
- * @param parentSettings The parent settings.
- */
- protected DOMConfigurationImpl(SymbolTable symbolTable,
- XMLComponentManager parentSettings) {
- super(parentSettings);
-
-
- // create table for features and properties
- fFeatures = new HashMap();
- fProperties = new HashMap();
-
- // add default recognized features
- final String[] recognizedFeatures = {
- XERCES_VALIDATION,
- XERCES_NAMESPACES,
- SCHEMA,
- SCHEMA_FULL_CHECKING,
- DYNAMIC_VALIDATION,
- NORMALIZE_DATA,
- SEND_PSVI,
- NAMESPACE_GROWTH,
- TOLERATE_DUPLICATES
- };
- addRecognizedFeatures(recognizedFeatures);
-
- // set state for default features
- setFeature(XERCES_VALIDATION, false);
- setFeature(SCHEMA, false);
- setFeature(SCHEMA_FULL_CHECKING, false);
- setFeature(DYNAMIC_VALIDATION, false);
- setFeature(NORMALIZE_DATA, false);
- setFeature(XERCES_NAMESPACES, true);
- setFeature(SEND_PSVI, true);
- setFeature(NAMESPACE_GROWTH, false);
-
- // add default recognized properties
- final String[] recognizedProperties = {
- XML_STRING,
- SYMBOL_TABLE,
- ERROR_HANDLER,
- ENTITY_RESOLVER,
- ERROR_REPORTER,
- ENTITY_MANAGER,
- VALIDATION_MANAGER,
- GRAMMAR_POOL,
- JAXP_SCHEMA_SOURCE,
- JAXP_SCHEMA_LANGUAGE,
- DTD_VALIDATOR_FACTORY_PROPERTY,
- SCHEMA_DV_FACTORY,
- SECURITY_MANAGER,
- XML_SECURITY_PROPERTY_MANAGER
- };
- addRecognizedProperties(recognizedProperties);
-
- // set default values for normalization features
- features |= NAMESPACES;
- features |= ENTITIES;
- features |= COMMENTS;
- features |= CDATA;
- features |= SPLITCDATA;
- features |= WELLFORMED;
- features |= NSDECL;
-
- if (symbolTable == null) {
- symbolTable = new SymbolTable();
- }
- fSymbolTable = symbolTable;
-
- fComponents = new ArrayList();
-
- setProperty(SYMBOL_TABLE, fSymbolTable);
- fErrorReporter = new XMLErrorReporter();
- setProperty(ERROR_REPORTER, fErrorReporter);
- addComponent(fErrorReporter);
-
- setProperty(DTD_VALIDATOR_FACTORY_PROPERTY, DTDDVFactory.getInstance());
-
- XMLEntityManager manager = new XMLEntityManager();
- setProperty(ENTITY_MANAGER, manager);
- addComponent(manager);
-
- fValidationManager = createValidationManager();
- setProperty(VALIDATION_MANAGER, fValidationManager);
-
- setProperty(SECURITY_MANAGER, new XMLSecurityManager(true));
-
- setProperty(Constants.XML_SECURITY_PROPERTY_MANAGER,
- new XMLSecurityPropertyManager());
-
- // add message formatters
- if (fErrorReporter.getMessageFormatter(XMLMessageFormatter.XML_DOMAIN) == null) {
- XMLMessageFormatter xmft = new XMLMessageFormatter();
- fErrorReporter.putMessageFormatter(XMLMessageFormatter.XML_DOMAIN, xmft);
- fErrorReporter.putMessageFormatter(XMLMessageFormatter.XMLNS_DOMAIN, xmft);
- }
-
- // REVISIT: try to include XML Schema formatter.
- // This is a hack to allow DTD configuration to be build.
- //
- if (fErrorReporter.getMessageFormatter("http://www.w3.org/TR/xml-schema-1") == null) {
- MessageFormatter xmft = null;
- try {
- xmft = (MessageFormatter)(
- ObjectFactory.newInstance("com.sun.org.apache.xerces.internal.impl.xs.XSMessageFormatter", true));
- } catch (Exception exception){
- }
-
- if (xmft != null) {
- fErrorReporter.putMessageFormatter("http://www.w3.org/TR/xml-schema-1", xmft);
- }
- }
-
-
- // set locale
- try {
- setLocale(Locale.getDefault());
- }
- catch (XNIException e) {
- // do nothing
- // REVISIT: What is the right thing to do? -Ac
- }
-
-
- } // <init>(SymbolTable)
-
-
- //
- // XMLParserConfiguration methods
- //
-
- /**
- * Parse an XML document.
- * <p>
- * The parser can use this method to instruct this configuration
- * to begin parsing an XML document from any valid input source
- * (a character stream, a byte stream, or a URI).
- * <p>
- * Parsers may not invoke this method while a parse is in progress.
- * Once a parse is complete, the parser may then parse another XML
- * document.
- * <p>
- * This method is synchronous: it will not return until parsing
- * has ended. If a client application wants to terminate
- * parsing early, it should throw an exception.
- *
- * @param source The input source for the top-level of the
- * XML document.
- *
- * @exception XNIException Any XNI exception, possibly wrapping
- * another exception.
- * @exception IOException An IO exception from the parser, possibly
- * from a byte stream or character stream
- * supplied by the parser.
- */
- public void parse(XMLInputSource inputSource)
- throws XNIException, IOException{
- // no-op
- }
-
- /**
- * Sets the document handler on the last component in the pipeline
- * to receive information about the document.
- *
- * @param documentHandler The document handler.
- */
- public void setDocumentHandler(XMLDocumentHandler documentHandler) {
- fDocumentHandler = documentHandler;
- } // setDocumentHandler(XMLDocumentHandler)
-
- /** Returns the registered document handler. */
- public XMLDocumentHandler getDocumentHandler() {
- return fDocumentHandler;
- } // getDocumentHandler():XMLDocumentHandler
-
- /**
- * Sets the DTD handler.
- *
- * @param dtdHandler The DTD handler.
- */
- public void setDTDHandler(XMLDTDHandler dtdHandler) {
- //no-op
- } // setDTDHandler(XMLDTDHandler)
-
- /** Returns the registered DTD handler. */
- public XMLDTDHandler getDTDHandler() {
- return null;
- } // getDTDHandler():XMLDTDHandler
-
- /**
- * Sets the DTD content model handler.
- *
- * @param handler The DTD content model handler.
- */
- public void setDTDContentModelHandler(XMLDTDContentModelHandler handler) {
- //no-op
-
- } // setDTDContentModelHandler(XMLDTDContentModelHandler)
-
- /** Returns the registered DTD content model handler. */
- public XMLDTDContentModelHandler getDTDContentModelHandler() {
- return null;
- } // getDTDContentModelHandler():XMLDTDContentModelHandler
-
- /**
- * Sets the resolver used to resolve external entities. The EntityResolver
- * interface supports resolution of public and system identifiers.
- *
- * @param resolver The new entity resolver. Passing a null value will
- * uninstall the currently installed resolver.
- */
- public void setEntityResolver(XMLEntityResolver resolver) {
- if (resolver !=null) {
- fProperties.put(ENTITY_RESOLVER, resolver);
- }
- } // setEntityResolver(XMLEntityResolver)
-
- /**
- * Return the current entity resolver.
- *
- * @return The current entity resolver, or null if none
- * has been registered.
- * @see #setEntityResolver
- */
- public XMLEntityResolver getEntityResolver() {
- return (XMLEntityResolver)fProperties.get(ENTITY_RESOLVER);
- } // getEntityResolver():XMLEntityResolver
-
- /**
- * Allow an application to register an error event handler.
- *
- * <p>If the application does not register an error handler, all
- * error events reported by the SAX parser will be silently
- * ignored; however, normal processing may not continue. It is
- * highly recommended that all SAX applications implement an
- * error handler to avoid unexpected bugs.</p>
- *
- * <p>Applications may register a new or different handler in the
- * middle of a parse, and the SAX parser must begin using the new
- * handler immediately.</p>
- *
- * @param errorHandler The error handler.
- * @exception java.lang.NullPointerException If the handler
- * argument is null.
- * @see #getErrorHandler
- */
- public void setErrorHandler(XMLErrorHandler errorHandler) {
- if (errorHandler != null) {
- fProperties.put(ERROR_HANDLER, errorHandler);
- }
- } // setErrorHandler(XMLErrorHandler)
-
- /**
- * Return the current error handler.
- *
- * @return The current error handler, or null if none
- * has been registered.
- * @see #setErrorHandler
- */
- public XMLErrorHandler getErrorHandler() {
- return (XMLErrorHandler)fProperties.get(ERROR_HANDLER);
- } // getErrorHandler():XMLErrorHandler
-
- /**
- * Set the state of a feature.
- *
- * Set the state of any feature in a SAX2 parser. The parser
- * might not recognize the feature, and if it does recognize
- * it, it might not be able to fulfill the request.
- *
- * @param featureId The unique identifier (URI) of the feature.
- * @param state The requested state of the feature (true or false).
- *
- * @exception com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException If the
- * requested feature is not known.
- */
- public void setFeature(String featureId, boolean state)
- throws XMLConfigurationException {
-
- // save state if noone "objects"
- super.setFeature(featureId, state);
-
- } // setFeature(String,boolean)
-
- /**
- * setProperty
- *
- * @param propertyId
- * @param value
- */
- public void setProperty(String propertyId, Object value)
- throws XMLConfigurationException {
-
- // store value if noone "objects"
- super.setProperty(propertyId, value);
-
- } // setProperty(String,Object)
-
- /**
- * Set the locale to use for messages.
- *
- * @param locale The locale object to use for localization of messages.
- *
- * @exception XNIException Thrown if the parser does not support the
- * specified locale.
- */
- public void setLocale(Locale locale) throws XNIException {
- fLocale = locale;
- fErrorReporter.setLocale(locale);
-
- } // setLocale(Locale)
-
- /** Returns the locale. */
- public Locale getLocale() {
- return fLocale;
- } // getLocale():Locale
-
- /**
- * DOM Level 3 WD - Experimental.
- * setParameter
- */
- public void setParameter(String name, Object value) throws DOMException {
- boolean found = true;
-
- // REVISIT: Recognizes DOM L3 default features only.
- // Does not yet recognize Xerces features.
- if(value instanceof Boolean){
- boolean state = ((Boolean)value).booleanValue();
-
- if (name.equalsIgnoreCase(Constants.DOM_COMMENTS)) {
- features = (short) (state ? features | COMMENTS : features & ~COMMENTS);
- }
- else if (name.equalsIgnoreCase(Constants.DOM_DATATYPE_NORMALIZATION)) {
- setFeature(NORMALIZE_DATA, state);
- features =
- (short) (state ? features | DTNORMALIZATION : features & ~DTNORMALIZATION);
- if (state) {
- features = (short) (features | VALIDATE);
- }
- }
- else if (name.equalsIgnoreCase(Constants.DOM_NAMESPACES)) {
- features = (short) (state ? features | NAMESPACES : features & ~NAMESPACES);
- }
- else if (name.equalsIgnoreCase(Constants.DOM_CDATA_SECTIONS)) {
- features = (short) (state ? features | CDATA : features & ~CDATA);
- }
- else if (name.equalsIgnoreCase(Constants.DOM_ENTITIES)) {
- features = (short) (state ? features | ENTITIES : features & ~ENTITIES);
- }
- else if (name.equalsIgnoreCase(Constants.DOM_SPLIT_CDATA)) {
- features = (short) (state ? features | SPLITCDATA : features & ~SPLITCDATA);
- }
- else if (name.equalsIgnoreCase(Constants.DOM_VALIDATE)) {
- features = (short) (state ? features | VALIDATE : features & ~VALIDATE);
- }
- else if (name.equalsIgnoreCase(Constants.DOM_WELLFORMED)) {
- features = (short) (state ? features | WELLFORMED : features & ~WELLFORMED );
- }
- else if (name.equalsIgnoreCase(Constants.DOM_NAMESPACE_DECLARATIONS)) {
- features = (short) (state ? features | NSDECL : features & ~NSDECL);
- }
- else if (name.equalsIgnoreCase(Constants.DOM_INFOSET)) {
- // Setting to false has no effect.
- if (state) {
- features = (short) (features | INFOSET_TRUE_PARAMS);
- features = (short) (features & ~INFOSET_FALSE_PARAMS);
- setFeature(NORMALIZE_DATA, false);
- }
- }
- else if (name.equalsIgnoreCase(Constants.DOM_NORMALIZE_CHARACTERS)
- || name.equalsIgnoreCase(Constants.DOM_CANONICAL_FORM)
- || name.equalsIgnoreCase(Constants.DOM_VALIDATE_IF_SCHEMA)
- || name.equalsIgnoreCase(Constants.DOM_CHECK_CHAR_NORMALIZATION)
- ) {
- if (state) { // true is not supported
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "FEATURE_NOT_SUPPORTED",
- new Object[] { name });
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
- }
- }
- else if ( name.equalsIgnoreCase(Constants.DOM_ELEMENT_CONTENT_WHITESPACE)) {
- if (!state) { // false is not supported
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "FEATURE_NOT_SUPPORTED",
- new Object[] { name });
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
- }
- }
- else if (name.equalsIgnoreCase(SEND_PSVI) ){
- // REVISIT: turning augmentation of PSVI is not support,
- // because in this case we won't be able to retrieve element
- // default value.
- if (!state) { // false is not supported
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "FEATURE_NOT_SUPPORTED",
- new Object[] { name });
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
- }
- }
- else if (name.equalsIgnoreCase(Constants.DOM_PSVI)){
- features = (short) (state ? features | PSVI : features & ~PSVI);
- }
- else {
- found = false;
- /*
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "FEATURE_NOT_FOUND",
- new Object[] { name });
- throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
- */
- }
-
- }
-
- if (!found || !(value instanceof Boolean)) { // set properties
- found = true;
-
- if (name.equalsIgnoreCase(Constants.DOM_ERROR_HANDLER)) {
- if (value instanceof DOMErrorHandler || value == null) {
- fErrorHandlerWrapper.setErrorHandler((DOMErrorHandler)value);
- setErrorHandler(fErrorHandlerWrapper);
- }
-
- else {
- // REVISIT: type mismatch
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "TYPE_MISMATCH_ERR",
- new Object[] { name });
- throw new DOMException(DOMException.TYPE_MISMATCH_ERR, msg);
- }
- }
- else if (name.equalsIgnoreCase(Constants.DOM_RESOURCE_RESOLVER)) {
- if (value instanceof LSResourceResolver || value == null) {
- try {
- setEntityResolver(new DOMEntityResolverWrapper((LSResourceResolver) value));
- }
- catch (XMLConfigurationException e) {}
- }
- else {
- // REVISIT: type mismatch
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "TYPE_MISMATCH_ERR",
- new Object[] { name });
- throw new DOMException(DOMException.TYPE_MISMATCH_ERR, msg);
- }
-
- }
- else if (name.equalsIgnoreCase(Constants.DOM_SCHEMA_LOCATION)) {
- if (value instanceof String || value == null) {
- try {
- // map DOM schema-location to JAXP schemaSource property
- setProperty(
- Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_SOURCE,
- value);
- }
- catch (XMLConfigurationException e) {}
- }
- else {
- // REVISIT: type mismatch
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "TYPE_MISMATCH_ERR",
- new Object[] { name });
- throw new DOMException(DOMException.TYPE_MISMATCH_ERR, msg);
- }
-
- }
- else if (name.equalsIgnoreCase(Constants.DOM_SCHEMA_TYPE)) {
- if (value instanceof String || value == null) {
- try {
- if (value == null) {
- setProperty(
- Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_LANGUAGE,
- null);
- }
- else if (value.equals(Constants.NS_XMLSCHEMA)) {
- // REVISIT: when add support to DTD validation
- setProperty(
- Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_LANGUAGE,
- Constants.NS_XMLSCHEMA);
- }
- else if (value.equals(Constants.NS_DTD)) {
- // Added support for revalidation against DTDs
- setProperty(Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_LANGUAGE,
- Constants.NS_DTD);
- }
- }
- catch (XMLConfigurationException e) {}
- }
- else {
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "TYPE_MISMATCH_ERR",
- new Object[] { name });
- throw new DOMException(DOMException.TYPE_MISMATCH_ERR, msg);
- }
-
- }
- else if (name.equalsIgnoreCase(SYMBOL_TABLE)){
- // Xerces Symbol Table
- if (value instanceof SymbolTable){
- setProperty(SYMBOL_TABLE, value);
- }
- else {
- // REVISIT: type mismatch
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "TYPE_MISMATCH_ERR",
- new Object[] { name });
- throw new DOMException(DOMException.TYPE_MISMATCH_ERR, msg);
- }
- }
- else if (name.equalsIgnoreCase (GRAMMAR_POOL)){
- if (value instanceof XMLGrammarPool){
- setProperty(GRAMMAR_POOL, value);
- }
- else {
- // REVISIT: type mismatch
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "TYPE_MISMATCH_ERR",
- new Object[] { name });
- throw new DOMException(DOMException.TYPE_MISMATCH_ERR, msg);
- }
-
- }
- else {
- // REVISIT: check if this is a boolean parameter -- type mismatch should be thrown.
- //parameter is not recognized
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "FEATURE_NOT_FOUND",
- new Object[] { name });
- throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
- }
- }
-
- }
-
-
- /**
- * DOM Level 3 WD - Experimental.
- * getParameter
- */
- public Object getParameter(String name) throws DOMException {
-
- // REVISIT: Recognizes DOM L3 default features only.
- // Does not yet recognize Xerces features.
-
- if (name.equalsIgnoreCase(Constants.DOM_COMMENTS)) {
- return ((features & COMMENTS) != 0) ? Boolean.TRUE : Boolean.FALSE;
- }
- else if (name.equalsIgnoreCase(Constants.DOM_NAMESPACES)) {
- return (features & NAMESPACES) != 0 ? Boolean.TRUE : Boolean.FALSE;
- }
- else if (name.equalsIgnoreCase(Constants.DOM_DATATYPE_NORMALIZATION)) {
- // REVISIT: datatype-normalization only takes effect if validation is on
- return (features & DTNORMALIZATION) != 0 ? Boolean.TRUE : Boolean.FALSE;
- }
- else if (name.equalsIgnoreCase(Constants.DOM_CDATA_SECTIONS)) {
- return (features & CDATA) != 0 ? Boolean.TRUE : Boolean.FALSE;
- }
- else if (name.equalsIgnoreCase(Constants.DOM_ENTITIES)) {
- return (features & ENTITIES) != 0 ? Boolean.TRUE : Boolean.FALSE;
- }
- else if (name.equalsIgnoreCase(Constants.DOM_SPLIT_CDATA)) {
- return (features & SPLITCDATA) != 0 ? Boolean.TRUE : Boolean.FALSE;
- }
- else if (name.equalsIgnoreCase(Constants.DOM_VALIDATE)) {
- return (features & VALIDATE) != 0 ? Boolean.TRUE : Boolean.FALSE;
- }
- else if (name.equalsIgnoreCase(Constants.DOM_WELLFORMED)) {
- return (features & WELLFORMED) != 0 ? Boolean.TRUE : Boolean.FALSE;
- }
- else if (name.equalsIgnoreCase(Constants.DOM_NAMESPACE_DECLARATIONS)) {
- return (features & NSDECL) != 0 ? Boolean.TRUE : Boolean.FALSE;
- }
- else if (name.equalsIgnoreCase(Constants.DOM_INFOSET)) {
- return (features & INFOSET_MASK) == INFOSET_TRUE_PARAMS ? Boolean.TRUE : Boolean.FALSE;
- }
- else if (name.equalsIgnoreCase(Constants.DOM_NORMALIZE_CHARACTERS)
- || name.equalsIgnoreCase(Constants.DOM_CANONICAL_FORM)
- || name.equalsIgnoreCase(Constants.DOM_VALIDATE_IF_SCHEMA)
- || name.equalsIgnoreCase(Constants.DOM_CHECK_CHAR_NORMALIZATION)
- ) {
- return Boolean.FALSE;
- }
- else if (name.equalsIgnoreCase(SEND_PSVI)) {
- return Boolean.TRUE;
- }
- else if (name.equalsIgnoreCase(Constants.DOM_PSVI)) {
- return (features & PSVI) != 0 ? Boolean.TRUE : Boolean.FALSE;
- }
- else if (name.equalsIgnoreCase(Constants.DOM_ELEMENT_CONTENT_WHITESPACE)) {
- return Boolean.TRUE;
- }
- else if (name.equalsIgnoreCase(Constants.DOM_ERROR_HANDLER)) {
- return fErrorHandlerWrapper.getErrorHandler();
- }
- else if (name.equalsIgnoreCase(Constants.DOM_RESOURCE_RESOLVER)) {
- XMLEntityResolver entityResolver = getEntityResolver();
- if (entityResolver != null && entityResolver instanceof DOMEntityResolverWrapper) {
- return ((DOMEntityResolverWrapper) entityResolver).getEntityResolver();
- }
- return null;
- }
- else if (name.equalsIgnoreCase(Constants.DOM_SCHEMA_TYPE)) {
- return getProperty(Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_LANGUAGE);
- }
- else if (name.equalsIgnoreCase(Constants.DOM_SCHEMA_LOCATION)) {
- return getProperty(Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_SOURCE);
- }
- else if (name.equalsIgnoreCase(SYMBOL_TABLE)){
- return getProperty(SYMBOL_TABLE);
- }
- else if (name.equalsIgnoreCase(GRAMMAR_POOL)){
- return getProperty(GRAMMAR_POOL);
- }
- else {
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "FEATURE_NOT_FOUND",
- new Object[] { name });
- throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
- }
-
- }
-
- /**
- * DOM Level 3 WD - Experimental.
- * Check if setting a parameter to a specific value is supported.
- *
- * @param name The name of the parameter to check.
- *
- * @param value An object. if null, the returned value is true.
- *
- * @return true if the parameter could be successfully set to the
- * specified value, or false if the parameter is not recognized or
- * the requested value is not supported. This does not change the
- * current value of the parameter itself.
- */
- public boolean canSetParameter(String name, Object value) {
-
- if (value == null){
- //if null, the returned value is true.
- //REVISIT: I dont like this --- even for unrecognized parameter it would
- //return 'true'. I think it should return false in that case.
- // Application will be surprised to find that setParameter throws not
- //recognized exception when canSetParameter returns 'true' Then what is the use
- //of having canSetParameter ??? - nb.
- return true ;
- }
- if( value instanceof Boolean ){
- //features whose parameter value can be set either 'true' or 'false'
- // or they accept any boolean value -- so we just need to check that
- // its a boolean value..
- if (name.equalsIgnoreCase(Constants.DOM_COMMENTS)
- || name.equalsIgnoreCase(Constants.DOM_DATATYPE_NORMALIZATION)
- || name.equalsIgnoreCase(Constants.DOM_CDATA_SECTIONS)
- || name.equalsIgnoreCase(Constants.DOM_ENTITIES)
- || name.equalsIgnoreCase(Constants.DOM_SPLIT_CDATA)
- || name.equalsIgnoreCase(Constants.DOM_NAMESPACES)
- || name.equalsIgnoreCase(Constants.DOM_VALIDATE)
- || name.equalsIgnoreCase(Constants.DOM_WELLFORMED)
- || name.equalsIgnoreCase(Constants.DOM_INFOSET)
- || name.equalsIgnoreCase(Constants.DOM_NAMESPACE_DECLARATIONS)
- ) {
- return true;
- }//features whose parameter value can not be set to 'true'
- else if (
- name.equalsIgnoreCase(Constants.DOM_NORMALIZE_CHARACTERS)
- || name.equalsIgnoreCase(Constants.DOM_CANONICAL_FORM)
- || name.equalsIgnoreCase(Constants.DOM_VALIDATE_IF_SCHEMA)
- || name.equalsIgnoreCase(Constants.DOM_CHECK_CHAR_NORMALIZATION)
- ) {
- return (value.equals(Boolean.TRUE)) ? false : true;
- }//features whose parameter value can not be set to 'false'
- else if( name.equalsIgnoreCase(Constants.DOM_ELEMENT_CONTENT_WHITESPACE)
- || name.equalsIgnoreCase(SEND_PSVI)
- ) {
- return (value.equals(Boolean.TRUE)) ? true : false;
- }// if name is not among the above listed above -- its not recognized. return false
- else {
- return false ;
- }
- }
- else if (name.equalsIgnoreCase(Constants.DOM_ERROR_HANDLER)) {
- return (value instanceof DOMErrorHandler) ? true : false ;
- }
- else if (name.equalsIgnoreCase(Constants.DOM_RESOURCE_RESOLVER)) {
- return (value instanceof LSResourceResolver) ? true : false ;
- }
- else if (name.equalsIgnoreCase(Constants.DOM_SCHEMA_LOCATION)) {
- return (value instanceof String) ? true : false ;
- }
- else if (name.equalsIgnoreCase(Constants.DOM_SCHEMA_TYPE)) {
- // REVISIT: should null value be supported?
- //as of now we are only supporting W3C XML Schema
- return ( (value instanceof String) && value.equals(Constants.NS_XMLSCHEMA) ) ? true : false ;
- }
- else if (name.equalsIgnoreCase(SYMBOL_TABLE)){
- // Xerces Symbol Table
- return (value instanceof SymbolTable) ? true : false ;
- }
- else if (name.equalsIgnoreCase (GRAMMAR_POOL)){
- return (value instanceof XMLGrammarPool) ? true : false ;
- }
- else {
- //false if the parameter is not recognized or the requested value is not supported.
- return false ;
- }
-
- } //canSetParameter
-
- /**
- * DOM Level 3 CR - Experimental.
- *
- * The list of the parameters supported by this
- * <code>DOMConfiguration</code> object and for which at least one value
- * can be set by the application. Note that this list can also contain
- * parameter names defined outside this specification.
- */
- public DOMStringList getParameterNames() {
- if (fRecognizedParameters == null){
- Vector parameters = new Vector();
-
- //Add DOM recognized parameters
- //REVISIT: Would have been nice to have a list of
- //recognized paramters.
- parameters.add(Constants.DOM_COMMENTS);
- parameters.add(Constants.DOM_DATATYPE_NORMALIZATION);
- parameters.add(Constants.DOM_CDATA_SECTIONS);
- parameters.add(Constants.DOM_ENTITIES);
- parameters.add(Constants.DOM_SPLIT_CDATA);
- parameters.add(Constants.DOM_NAMESPACES);
- parameters.add(Constants.DOM_VALIDATE);
-
- parameters.add(Constants.DOM_INFOSET);
- parameters.add(Constants.DOM_NORMALIZE_CHARACTERS);
- parameters.add(Constants.DOM_CANONICAL_FORM);
- parameters.add(Constants.DOM_VALIDATE_IF_SCHEMA);
- parameters.add(Constants.DOM_CHECK_CHAR_NORMALIZATION);
- parameters.add(Constants.DOM_WELLFORMED);
-
- parameters.add(Constants.DOM_NAMESPACE_DECLARATIONS);
- parameters.add(Constants.DOM_ELEMENT_CONTENT_WHITESPACE);
-
- parameters.add(Constants.DOM_ERROR_HANDLER);
- parameters.add(Constants.DOM_SCHEMA_TYPE);
- parameters.add(Constants.DOM_SCHEMA_LOCATION);
- parameters.add(Constants.DOM_RESOURCE_RESOLVER);
-
- //Add recognized xerces features and properties
- parameters.add(GRAMMAR_POOL);
- parameters.add(SYMBOL_TABLE);
- parameters.add(SEND_PSVI);
-
- fRecognizedParameters = new DOMStringListImpl(parameters);
-
- }
-
- return fRecognizedParameters;
- }//getParameterNames
-
- //
- // Protected methods
- //
-
- /**
- * reset all components before parsing
- */
- protected void reset() throws XNIException {
-
- if (fValidationManager != null)
- fValidationManager.reset();
-
- int count = fComponents.size();
- for (int i = 0; i < count; i++) {
- XMLComponent c = (XMLComponent) fComponents.get(i);
- c.reset(this);
- }
-
- } // reset()
-
- /**
- * Check a property. If the property is known and supported, this method
- * simply returns. Otherwise, the appropriate exception is thrown.
- *
- * @param propertyId The unique identifier (URI) of the property
- * being set.
- * @exception com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException If the
- * requested feature is not known or supported.
- */
- protected PropertyState checkProperty(String propertyId)
- throws XMLConfigurationException {
-
- // special cases
- if (propertyId.startsWith(Constants.SAX_PROPERTY_PREFIX)) {
- final int suffixLength = propertyId.length() - Constants.SAX_PROPERTY_PREFIX.length();
-
- //
- // http://xml.org/sax/properties/xml-string
- // Value type: String
- // Access: read-only
- // Get the literal string of characters associated with the
- // current event. If the parser recognises and supports this
- // property but is not currently parsing text, it should return
- // null (this is a good way to check for availability before the
- // parse begins).
- //
- if (suffixLength == Constants.XML_STRING_PROPERTY.length() &&
- propertyId.endsWith(Constants.XML_STRING_PROPERTY)) {
- // REVISIT - we should probably ask xml-dev for a precise
- // definition of what this is actually supposed to return, and
- // in exactly which circumstances.
- return PropertyState.NOT_SUPPORTED;
- }
- }
-
- // check property
- return super.checkProperty(propertyId);
-
- } // checkProperty(String)
-
-
- protected void addComponent(XMLComponent component) {
-
- // don't add a component more than once
- if (fComponents.contains(component)) {
- return;
- }
- fComponents.add(component);
-
- // register component's recognized features
- String[] recognizedFeatures = component.getRecognizedFeatures();
- addRecognizedFeatures(recognizedFeatures);
-
- // register component's recognized properties
- String[] recognizedProperties = component.getRecognizedProperties();
- addRecognizedProperties(recognizedProperties);
-
- } // addComponent(XMLComponent)
-
- protected ValidationManager createValidationManager(){
- return new ValidationManager();
- }
-
-} // class XMLParser
diff --git a/src/com/sun/org/apache/xerces/internal/dom/DOMErrorImpl.java b/src/com/sun/org/apache/xerces/internal/dom/DOMErrorImpl.java
deleted file mode 100644
index 90dec38..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/DOMErrorImpl.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-import org.w3c.dom.DOMError;
-import org.w3c.dom.DOMLocator;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLParseException;
-
-
-/**
- * <code>DOMErrorImpl</code> is an implementation that describes an error.
- * <strong>Note:</strong> The error object that describes the error
- * might be reused by Xerces implementation, across multiple calls to the
- * handleEvent method on DOMErrorHandler interface.
- *
- *
- * <p>See also the <a href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010913'>Document Object Model (DOM) Level 3 Core Specification</a>.
- *
- * @xerces.internal
- *
- * @author Gopal Sharma, SUN Microsystems Inc.
- * @author Elena Litani, IBM
- *
- */
-
-// REVISIT: the implementation of ErrorReporter.
-// we probably should not pass XMLParseException
-//
-
-public class DOMErrorImpl implements DOMError {
-
- //
- // Data
- //
-
- public short fSeverity = DOMError.SEVERITY_WARNING;
- public String fMessage = null;
- public DOMLocatorImpl fLocator = new DOMLocatorImpl();
- public Exception fException = null;
- public String fType;
- public Object fRelatedData;
-
-
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- public DOMErrorImpl () {
- }
-
- /** Exctracts information from XMLParserException) */
- public DOMErrorImpl (short severity, XMLParseException exception) {
- fSeverity = severity;
- fException = exception;
- fLocator = createDOMLocator (exception);
- }
-
- /**
- * The severity of the error, either <code>SEVERITY_WARNING</code>,
- * <code>SEVERITY_ERROR</code>, or <code>SEVERITY_FATAL_ERROR</code>.
- */
-
- public short getSeverity() {
- return fSeverity;
- }
-
- /**
- * An implementation specific string describing the error that occured.
- */
-
- public String getMessage() {
- return fMessage;
- }
-
- /**
- * The location of the error.
- */
-
- public DOMLocator getLocation() {
- return fLocator;
- }
-
- // method to get the DOMLocator Object
- private DOMLocatorImpl createDOMLocator(XMLParseException exception) {
- // assuming DOMLocator wants the *expanded*, not the literal, URI of the doc... - neilg
- return new DOMLocatorImpl(exception.getLineNumber(),
- exception.getColumnNumber(),
- exception.getCharacterOffset(),
- exception.getExpandedSystemId());
- } // createDOMLocator()
-
-
- /**
- * The related platform dependent exception if any.exception is a reserved
- * word, we need to rename it.Change to "relatedException". (F2F 26 Sep
- * 2001)
- */
- public Object getRelatedException(){
- return fException;
- }
-
- public void reset(){
- fSeverity = DOMError.SEVERITY_WARNING;
- fException = null;
- }
-
- public String getType(){
- return fType;
- }
-
- public Object getRelatedData(){
- return fRelatedData;
- }
-
-
-}// class DOMErrorImpl
diff --git a/src/com/sun/org/apache/xerces/internal/dom/DOMImplementationImpl.java b/src/com/sun/org/apache/xerces/internal/dom/DOMImplementationImpl.java
deleted file mode 100644
index e6a68f0..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/DOMImplementationImpl.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-import org.w3c.dom.DOMException;
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-
-
-
-/**
- * The DOMImplementation class is description of a particular
- * implementation of the Document Object Model. As such its data is
- * static, shared by all instances of this implementation.
- * <P>
- * The DOM API requires that it be a real object rather than static
- * methods. However, there's nothing that says it can't be a singleton,
- * so that's how I've implemented it.
- *
- * @xerces.internal
- *
- * @since PR-DOM-Level-1-19980818.
- */
-public class DOMImplementationImpl extends CoreDOMImplementationImpl
- implements DOMImplementation {
-
- //
- // Data
- //
-
- // static
-
- /** Dom implementation singleton. */
- static DOMImplementationImpl singleton = new DOMImplementationImpl();
-
-
- //
- // Public methods
- //
-
- /** NON-DOM: Obtain and return the single shared object */
- public static DOMImplementation getDOMImplementation() {
- return singleton;
- }
-
- //
- // DOMImplementation methods
- //
-
- /**
- * Test if the DOM implementation supports a specific "feature" --
- * currently meaning language and level thereof.
- *
- * @param feature The package name of the feature to test.
- * In Level 1, supported values are "HTML" and "XML" (case-insensitive).
- * At this writing, com.sun.org.apache.xerces.internal.dom supports only XML.
- *
- * @param version The version number of the feature being tested.
- * This is interpreted as "Version of the DOM API supported for the
- * specified Feature", and in Level 1 should be "1.0"
- *
- * @return true iff this implementation is compatable with the
- * specified feature and version.
- */
- public boolean hasFeature(String feature, String version) {
-
- boolean result = super.hasFeature(feature, version);
- if (!result) {
- boolean anyVersion = version == null || version.length() == 0;
- if (feature.startsWith("+")) {
- feature = feature.substring(1);
- }
- return (
- (feature.equalsIgnoreCase("Events")
- && (anyVersion || version.equals("2.0")))
- || (feature.equalsIgnoreCase("MutationEvents")
- && (anyVersion || version.equals("2.0")))
- || (feature.equalsIgnoreCase("Traversal")
- && (anyVersion || version.equals("2.0")))
- || (feature.equalsIgnoreCase("Range")
- && (anyVersion || version.equals("2.0")))
- || (feature.equalsIgnoreCase("MutationEvents")
- && (anyVersion || version.equals("2.0"))));
- }
- return result;
- } // hasFeature(String,String):boolean
-
-
-
- /**
- * Introduced in DOM Level 2. <p>
- *
- * Creates an XML Document object of the specified type with its document
- * element.
- *
- * @param namespaceURI The namespace URI of the document
- * element to create, or null.
- * @param qualifiedName The qualified name of the document
- * element to create.
- * @param doctype The type of document to be created or null.<p>
- *
- * When doctype is not null, its
- * Node.ownerDocument attribute is set to
- * the document being created.
- * @return Document A new Document object.
- * @throws DOMException WRONG_DOCUMENT_ERR: Raised if doctype has
- * already been used with a different document.
- * @since WD-DOM-Level-2-19990923
- */
- public Document createDocument(String namespaceURI,
- String qualifiedName,
- DocumentType doctype)
- throws DOMException
- {
- if(namespaceURI == null && qualifiedName == null && doctype == null){
- //if namespaceURI, qualifiedName and doctype are null, returned document is empty with
- //no document element
- return new DocumentImpl();
- }
- else if (doctype != null && doctype.getOwnerDocument() != null) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null);
- throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, msg);
- }
- DocumentImpl doc = new DocumentImpl(doctype);
- Element e = doc.createElementNS( namespaceURI, qualifiedName);
- doc.appendChild(e);
- return doc;
- }
-
-
-} // class DOMImplementationImpl
diff --git a/src/com/sun/org/apache/xerces/internal/dom/DOMImplementationListImpl.java b/src/com/sun/org/apache/xerces/internal/dom/DOMImplementationListImpl.java
deleted file mode 100644
index 15791a3..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/DOMImplementationListImpl.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-import java.util.Vector;
-import org.w3c.dom.DOMImplementationList;
-import org.w3c.dom.DOMImplementation;
-
-/**
- * <p>This class implements the DOM Level 3 Core interface DOMImplementationList.</p>
- *
- * @xerces.internal
- *
- * @author Neil Delima, IBM
- * @since DOM Level 3 Core
- */
-public class DOMImplementationListImpl implements DOMImplementationList {
-
- //A collection of DOMImplementations
- private Vector fImplementations;
-
- /**
- * Construct an empty list of DOMImplementations
- */
- public DOMImplementationListImpl() {
- fImplementations = new Vector();
- }
-
- /**
- * Construct an empty list of DOMImplementations
- */
- public DOMImplementationListImpl(Vector params) {
- fImplementations = params;
- }
-
- /**
- * Returns the indexth item in the collection.
- *
- * @param index The index of the DOMImplemetation from the list to return.
- */
- public DOMImplementation item(int index) {
- try {
- return (DOMImplementation) fImplementations.elementAt(index);
- } catch (ArrayIndexOutOfBoundsException e) {
- return null;
- }
- }
-
- /**
- * Returns the number of DOMImplementations in the list.
- *
- * @return An integer indicating the number of DOMImplementations.
- */
- public int getLength() {
- return fImplementations.size();
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/dom/DOMImplementationSourceImpl.java b/src/com/sun/org/apache/xerces/internal/dom/DOMImplementationSourceImpl.java
deleted file mode 100644
index 6c2a9b7..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/DOMImplementationSourceImpl.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-import java.util.StringTokenizer;
-import java.util.Vector;
-import org.w3c.dom.DOMImplementationList;
-import org.w3c.dom.DOMImplementationSource;
-import org.w3c.dom.DOMImplementation;
-import com.sun.org.apache.xerces.internal.dom.DOMImplementationListImpl;
-
-/**
- * Supply one the right implementation, based upon requested features. Each
- * implemented <code>DOMImplementationSource</code> object is listed in the
- * binding-specific list of available sources so that its
- * <code>DOMImplementation</code> objects are made available.
- *
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#DOMImplementationSource'>Document Object Model (DOM) Level 3 Core Specification</a>.
- *
- * @xerces.internal
- *
- */
-public class DOMImplementationSourceImpl
- implements DOMImplementationSource {
-
- /**
- * A method to request a DOM implementation.
- * @param features A string that specifies which features are required.
- * This is a space separated list in which each feature is specified
- * by its name optionally followed by a space and a version number.
- * This is something like: "XML 1.0 Traversal Events 2.0"
- * @return An implementation that has the desired features, or
- * <code>null</code> if this source has none.
- */
- public DOMImplementation getDOMImplementation(String features) {
- // first check whether the CoreDOMImplementation would do
- DOMImplementation impl =
- CoreDOMImplementationImpl.getDOMImplementation();
- if (testImpl(impl, features)) {
- return impl;
- }
- // if not try the DOMImplementation
- impl = DOMImplementationImpl.getDOMImplementation();
- if (testImpl(impl, features)) {
- return impl;
- }
-
- return null;
- }
-
- /**
- * A method to request a list of DOM implementations that support the
- * specified features and versions, as specified in .
- * @param features A string that specifies which features and versions
- * are required. This is a space separated list in which each feature
- * is specified by its name optionally followed by a space and a
- * version number. This is something like: "XML 3.0 Traversal +Events
- * 2.0"
- * @return A list of DOM implementations that support the desired
- * features.
- */
- public DOMImplementationList getDOMImplementationList(String features) {
- // first check whether the CoreDOMImplementation would do
- DOMImplementation impl = CoreDOMImplementationImpl.getDOMImplementation();
- final Vector implementations = new Vector();
- if (testImpl(impl, features)) {
- implementations.addElement(impl);
- }
- impl = DOMImplementationImpl.getDOMImplementation();
- if (testImpl(impl, features)) {
- implementations.addElement(impl);
- }
-
- return new DOMImplementationListImpl(implementations);
- }
-
- boolean testImpl(DOMImplementation impl, String features) {
-
- StringTokenizer st = new StringTokenizer(features);
- String feature = null;
- String version = null;
-
- if (st.hasMoreTokens()) {
- feature = st.nextToken();
- }
- while (feature != null) {
- boolean isVersion = false;
- if (st.hasMoreTokens()) {
- char c;
- version = st.nextToken();
- c = version.charAt(0);
- switch (c) {
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- isVersion = true;
- }
- } else {
- version = null;
- }
- if (isVersion) {
- if (!impl.hasFeature(feature, version)) {
- return false;
- }
- if (st.hasMoreTokens()) {
- feature = st.nextToken();
- } else {
- feature = null;
- }
- } else {
- if (!impl.hasFeature(feature, null)) {
- return false;
- }
- feature = version;
- }
- }
- return true;
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/dom/DOMInputImpl.java b/src/com/sun/org/apache/xerces/internal/dom/DOMInputImpl.java
deleted file mode 100644
index bb6abf9..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/DOMInputImpl.java
+++ /dev/null
@@ -1,391 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-import org.w3c.dom.ls.LSInput;
-
-import java.io.Reader;
-import java.io.InputStream;
-
-/**
- * This Class <code>DOMInputImpl</code> represents a single input source for an XML entity.
- * <p> This Class allows an application to encapsulate information about
- * an input source in a single object, which may include a public
- * identifier, a system identifier, a byte stream (possibly with a specified
- * encoding), and/or a character stream.
- * <p> The exact definitions of a byte stream and a character stream are
- * binding dependent.
- * <p> There are two places that the application will deliver this input
- * source to the parser: as the argument to the <code>parse</code> method,
- * or as the return value of the <code>DOMResourceResolver.resolveEntity</code>
- * method.
- * <p> The <code>DOMParser</code> will use the <code>LSInput</code>
- * object to determine how to read XML input. If there is a character stream
- * available, the parser will read that stream directly; if not, the parser
- * will use a byte stream, if available; if neither a character stream nor a
- * byte stream is available, the parser will attempt to open a URI
- * connection to the resource identified by the system identifier.
- * <p> An <code>LSInput</code> object belongs to the application: the
- * parser shall never modify it in any way (it may modify a copy if
- * necessary). Eventhough all attributes in this interface are writable the
- * DOM implementation is expected to never mutate a LSInput.
- * <p>See also the <a href='http://www.w3.org/TR/2001/WD-DOM-Level-3-ASLS-20011025'>Document Object Model (DOM) Level 3 Abstract Schemas and Load
-and Save Specification</a>.
- *
- * @xerces.internal
- *
- * @author Gopal Sharma, SUN Microsystems Inc.
- */
-
-// REVISIT:
-// 1. it should be possible to do the following
-// DOMInputImpl extends XMLInputSource implements LSInput
-// 2. we probably need only the default constructor. -- el
-
-public class DOMInputImpl implements LSInput {
-
- //
- // Data
- //
-
- protected String fPublicId = null;
- protected String fSystemId = null;
- protected String fBaseSystemId = null;
-
- protected InputStream fByteStream = null;
- protected Reader fCharStream = null;
- protected String fData = null;
-
- protected String fEncoding = null;
-
- protected boolean fCertifiedText = false;
-
- /**
- * Default Constructor, constructs an input source
- *
- *
- */
- public DOMInputImpl() {}
-
- /**
- * Constructs an input source from just the public and system
- * identifiers, leaving resolution of the entity and opening of
- * the input stream up to the caller.
- *
- * @param publicId The public identifier, if known.
- * @param systemId The system identifier. This value should
- * always be set, if possible, and can be
- * relative or absolute. If the system identifier
- * is relative, then the base system identifier
- * should be set.
- * @param baseSystemId The base system identifier. This value should
- * always be set to the fully expanded URI of the
- * base system identifier, if possible.
- */
-
- public DOMInputImpl(String publicId, String systemId,
- String baseSystemId) {
-
- fPublicId = publicId;
- fSystemId = systemId;
- fBaseSystemId = baseSystemId;
-
- } // DOMInputImpl(String,String,String)
-
- /**
- * Constructs an input source from a byte stream.
- *
- * @param publicId The public identifier, if known.
- * @param systemId The system identifier. This value should
- * always be set, if possible, and can be
- * relative or absolute. If the system identifier
- * is relative, then the base system identifier
- * should be set.
- * @param baseSystemId The base system identifier. This value should
- * always be set to the fully expanded URI of the
- * base system identifier, if possible.
- * @param byteStream The byte stream.
- * @param encoding The encoding of the byte stream, if known.
- */
-
- public DOMInputImpl(String publicId, String systemId,
- String baseSystemId, InputStream byteStream,
- String encoding) {
-
- fPublicId = publicId;
- fSystemId = systemId;
- fBaseSystemId = baseSystemId;
- fByteStream = byteStream;
- fEncoding = encoding;
-
- } // DOMInputImpl(String,String,String,InputStream,String)
-
- /**
- * Constructs an input source from a character stream.
- *
- * @param publicId The public identifier, if known.
- * @param systemId The system identifier. This value should
- * always be set, if possible, and can be
- * relative or absolute. If the system identifier
- * is relative, then the base system identifier
- * should be set.
- * @param baseSystemId The base system identifier. This value should
- * always be set to the fully expanded URI of the
- * base system identifier, if possible.
- * @param charStream The character stream.
- * @param encoding The original encoding of the byte stream
- * used by the reader, if known.
- */
-
- public DOMInputImpl(String publicId, String systemId,
- String baseSystemId, Reader charStream,
- String encoding) {
-
- fPublicId = publicId;
- fSystemId = systemId;
- fBaseSystemId = baseSystemId;
- fCharStream = charStream;
- fEncoding = encoding;
-
- } // DOMInputImpl(String,String,String,Reader,String)
-
- /**
- * Constructs an input source from a String.
- *
- * @param publicId The public identifier, if known.
- * @param systemId The system identifier. This value should
- * always be set, if possible, and can be
- * relative or absolute. If the system identifier
- * is relative, then the base system identifier
- * should be set.
- * @param baseSystemId The base system identifier. This value should
- * always be set to the fully expanded URI of the
- * base system identifier, if possible.
- * @param data The String Data.
- * @param encoding The original encoding of the byte stream
- * used by the reader, if known.
- */
-
- public DOMInputImpl(String publicId, String systemId,
- String baseSystemId, String data,
- String encoding) {
- fPublicId = publicId;
- fSystemId = systemId;
- fBaseSystemId = baseSystemId;
- fData = data;
- fEncoding = encoding;
- } // DOMInputImpl(String,String,String,String,String)
-
- /**
- * An attribute of a language-binding dependent type that represents a
- * stream of bytes.
- * <br>The parser will ignore this if there is also a character stream
- * specified, but it will use a byte stream in preference to opening a
- * URI connection itself.
- * <br>If the application knows the character encoding of the byte stream,
- * it should set the encoding property. Setting the encoding in this way
- * will override any encoding specified in the XML declaration itself.
- */
-
- public InputStream getByteStream(){
- return fByteStream;
- }
-
- /**
- * An attribute of a language-binding dependent type that represents a
- * stream of bytes.
- * <br>The parser will ignore this if there is also a character stream
- * specified, but it will use a byte stream in preference to opening a
- * URI connection itself.
- * <br>If the application knows the character encoding of the byte stream,
- * it should set the encoding property. Setting the encoding in this way
- * will override any encoding specified in the XML declaration itself.
- */
-
- public void setByteStream(InputStream byteStream){
- fByteStream = byteStream;
- }
-
- /**
- * An attribute of a language-binding dependent type that represents a
- * stream of 16-bit units. Application must encode the stream using
- * UTF-16 (defined in and Amendment 1 of ).
- * <br>If a character stream is specified, the parser will ignore any byte
- * stream and will not attempt to open a URI connection to the system
- * identifier.
- */
- public Reader getCharacterStream(){
- return fCharStream;
- }
- /**
- * An attribute of a language-binding dependent type that represents a
- * stream of 16-bit units. Application must encode the stream using
- * UTF-16 (defined in and Amendment 1 of ).
- * <br>If a character stream is specified, the parser will ignore any byte
- * stream and will not attempt to open a URI connection to the system
- * identifier.
- */
-
- public void setCharacterStream(Reader characterStream){
- fCharStream = characterStream;
- }
-
- /**
- * A string attribute that represents a sequence of 16 bit units (utf-16
- * encoded characters).
- * <br>If string data is available in the input source, the parser will
- * ignore the character stream and the byte stream and will not attempt
- * to open a URI connection to the system identifier.
- */
- public String getStringData(){
- return fData;
- }
-
- /**
- * A string attribute that represents a sequence of 16 bit units (utf-16
- * encoded characters).
- * <br>If string data is available in the input source, the parser will
- * ignore the character stream and the byte stream and will not attempt
- * to open a URI connection to the system identifier.
- */
-
- public void setStringData(String stringData){
- fData = stringData;
- }
-
- /**
- * The character encoding, if known. The encoding must be a string
- * acceptable for an XML encoding declaration ( section 4.3.3 "Character
- * Encoding in Entities").
- * <br>This attribute has no effect when the application provides a
- * character stream. For other sources of input, an encoding specified
- * by means of this attribute will override any encoding specified in
- * the XML claration or the Text Declaration, or an encoding obtained
- * from a higher level protocol, such as HTTP .
- */
-
- public String getEncoding(){
- return fEncoding;
- }
-
- /**
- * The character encoding, if known. The encoding must be a string
- * acceptable for an XML encoding declaration ( section 4.3.3 "Character
- * Encoding in Entities").
- * <br>This attribute has no effect when the application provides a
- * character stream. For other sources of input, an encoding specified
- * by means of this attribute will override any encoding specified in
- * the XML claration or the Text Declaration, or an encoding obtained
- * from a higher level protocol, such as HTTP .
- */
- public void setEncoding(String encoding){
- fEncoding = encoding;
- }
-
- /**
- * The public identifier for this input source. The public identifier is
- * always optional: if the application writer includes one, it will be
- * provided as part of the location information.
- */
- public String getPublicId(){
- return fPublicId;
- }
- /**
- * The public identifier for this input source. The public identifier is
- * always optional: if the application writer includes one, it will be
- * provided as part of the location information.
- */
- public void setPublicId(String publicId){
- fPublicId = publicId;
- }
-
- /**
- * The system identifier, a URI reference , for this input source. The
- * system identifier is optional if there is a byte stream or a
- * character stream, but it is still useful to provide one, since the
- * application can use it to resolve relative URIs and can include it in
- * error messages and warnings (the parser will attempt to fetch the
- * ressource identifier by the URI reference only if there is no byte
- * stream or character stream specified).
- * <br>If the application knows the character encoding of the object
- * pointed to by the system identifier, it can register the encoding by
- * setting the encoding attribute.
- * <br>If the system ID is a relative URI reference (see section 5 in ),
- * the behavior is implementation dependent.
- */
- public String getSystemId(){
- return fSystemId;
- }
- /**
- * The system identifier, a URI reference , for this input source. The
- * system identifier is optional if there is a byte stream or a
- * character stream, but it is still useful to provide one, since the
- * application can use it to resolve relative URIs and can include it in
- * error messages and warnings (the parser will attempt to fetch the
- * ressource identifier by the URI reference only if there is no byte
- * stream or character stream specified).
- * <br>If the application knows the character encoding of the object
- * pointed to by the system identifier, it can register the encoding by
- * setting the encoding attribute.
- * <br>If the system ID is a relative URI reference (see section 5 in ),
- * the behavior is implementation dependent.
- */
- public void setSystemId(String systemId){
- fSystemId = systemId;
- }
-
- /**
- * The base URI to be used (see section 5.1.4 in ) for resolving relative
- * URIs to absolute URIs. If the baseURI is itself a relative URI, the
- * behavior is implementation dependent.
- */
- public String getBaseURI(){
- return fBaseSystemId;
- }
- /**
- * The base URI to be used (see section 5.1.4 in ) for resolving relative
- * URIs to absolute URIs. If the baseURI is itself a relative URI, the
- * behavior is implementation dependent.
- */
- public void setBaseURI(String baseURI){
- fBaseSystemId = baseURI;
- }
-
- /**
- * If set to true, assume that the input is certified (see section 2.13
- * in [<a href='http://www.w3.org/TR/2002/CR-xml11-20021015/'>XML 1.1</a>]) when
- * parsing [<a href='http://www.w3.org/TR/2002/CR-xml11-20021015/'>XML 1.1</a>].
- */
- public boolean getCertifiedText(){
- return fCertifiedText;
- }
-
- /**
- * If set to true, assume that the input is certified (see section 2.13
- * in [<a href='http://www.w3.org/TR/2002/CR-xml11-20021015/'>XML 1.1</a>]) when
- * parsing [<a href='http://www.w3.org/TR/2002/CR-xml11-20021015/'>XML 1.1</a>].
- */
-
- public void setCertifiedText(boolean certifiedText){
- fCertifiedText = certifiedText;
- }
-
-}// class DOMInputImpl
diff --git a/src/com/sun/org/apache/xerces/internal/dom/DOMLocatorImpl.java b/src/com/sun/org/apache/xerces/internal/dom/DOMLocatorImpl.java
deleted file mode 100644
index 2a421b5..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/DOMLocatorImpl.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-import org.w3c.dom.DOMLocator;
-import org.w3c.dom.Node;
-
-
-/**
- * <code>DOMLocatorImpl</code> is an implementaion that describes a location (e.g.
- * where an error occured).
- * <p>See also the <a href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010913'>Document Object Model (DOM) Level 3 Core Specification</a>.
- *
- * @xerces.internal
- *
- * @author Gopal Sharma, SUN Microsystems Inc.
- */
-
-public class DOMLocatorImpl implements DOMLocator {
-
- //
- // Data
- //
-
- /**
- * The column number where the error occured,
- * or -1 if there is no column number available.
- */
- public int fColumnNumber = -1;
-
- /**
- * The line number where the error occured,
- * or -1 if there is no line number available.
- */
- public int fLineNumber = -1;
-
- /** related data node*/
- public Node fRelatedNode = null;
-
- /**
- * The URI where the error occured,
- * or null if there is no URI available.
- */
- public String fUri = null;
-
- /**
- * The byte offset into the input source this locator is pointing to or -1
- * if there is no byte offset available
- */
- public int fByteOffset = -1;
-
- /**
- * The UTF-16, as defined in [Unicode] and Amendment 1 of [ISO/IEC 10646],
- * offset into the input source this locator is pointing to or -1 if there
- * is no UTF-16 offset available.
- */
- public int fUtf16Offset = -1;
-
- //
- // Constructors
- //
-
- public DOMLocatorImpl(){
- }
-
- public DOMLocatorImpl (int lineNumber, int columnNumber, String uri ){
- fLineNumber = lineNumber ;
- fColumnNumber = columnNumber ;
- fUri = uri;
- } // DOMLocatorImpl (int lineNumber, int columnNumber, String uri )
-
- public DOMLocatorImpl (int lineNumber, int columnNumber, int utf16Offset, String uri ){
- fLineNumber = lineNumber ;
- fColumnNumber = columnNumber ;
- fUri = uri;
- fUtf16Offset = utf16Offset;
- } // DOMLocatorImpl (int lineNumber, int columnNumber, int utf16Offset, String uri )
-
- public DOMLocatorImpl (int lineNumber, int columnNumber, int byteoffset, Node relatedData, String uri ){
- fLineNumber = lineNumber ;
- fColumnNumber = columnNumber ;
- fByteOffset = byteoffset ;
- fRelatedNode = relatedData ;
- fUri = uri;
- } // DOMLocatorImpl (int lineNumber, int columnNumber, int offset, Node errorNode, String uri )
-
- public DOMLocatorImpl (int lineNumber, int columnNumber, int byteoffset, Node relatedData, String uri, int utf16Offset ){
- fLineNumber = lineNumber ;
- fColumnNumber = columnNumber ;
- fByteOffset = byteoffset ;
- fRelatedNode = relatedData ;
- fUri = uri;
- fUtf16Offset = utf16Offset;
- } // DOMLocatorImpl (int lineNumber, int columnNumber, int offset, Node errorNode, String uri )
-
-
- /**
- * The line number where the error occured, or -1 if there is no line
- * number available.
- */
- public int getLineNumber(){
- return fLineNumber;
- }
-
- /**
- * The column number where the error occured, or -1 if there is no column
- * number available.
- */
- public int getColumnNumber(){
- return fColumnNumber;
- }
-
-
- /**
- * The URI where the error occured, or null if there is no URI available.
- */
- public String getUri(){
- return fUri;
- }
-
-
- public Node getRelatedNode(){
- return fRelatedNode;
- }
-
-
- /**
- * The byte offset into the input source this locator is pointing to or -1
- * if there is no byte offset available
- */
- public int getByteOffset(){
- return fByteOffset;
- }
-
- /**
- * The UTF-16, as defined in [Unicode] and Amendment 1 of [ISO/IEC 10646],
- * offset into the input source this locator is pointing to or -1 if there
- * is no UTF-16 offset available.
- */
- public int getUtf16Offset(){
- return fUtf16Offset;
- }
-
-}// class DOMLocatorImpl
diff --git a/src/com/sun/org/apache/xerces/internal/dom/DOMMessageFormatter.java b/src/com/sun/org/apache/xerces/internal/dom/DOMMessageFormatter.java
deleted file mode 100644
index f7d131f..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/DOMMessageFormatter.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package com.sun.org.apache.xerces.internal.dom;
-import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * Used to format DOM error messages, using the system locale.
- *
- * @xerces.internal
- *
- * @author Sandy Gao, IBM
- * @version $Id: DOMMessageFormatter.java,v 1.6 2010-11-01 04:39:38 joehw Exp $
- */
-public class DOMMessageFormatter {
- public static final String DOM_DOMAIN = "http://www.w3.org/dom/DOMTR";
- public static final String XML_DOMAIN = "http://www.w3.org/TR/1998/REC-xml-19980210";
- public static final String SERIALIZER_DOMAIN = "http://apache.org/xml/serializer";
-
- private static ResourceBundle domResourceBundle = null;
- private static ResourceBundle xmlResourceBundle = null;
- private static ResourceBundle serResourceBundle = null;
- private static Locale locale = null;
-
-
- DOMMessageFormatter(){
- locale = Locale.getDefault();
- }
- /**
- * Formats a message with the specified arguments using the given
- * locale information.
- *
- * @param domain domain from which error string is to come.
- * @param key The message key.
- * @param arguments The message replacement text arguments. The order
- * of the arguments must match that of the placeholders
- * in the actual message.
- *
- * @return the formatted message.
- *
- * @throws MissingResourceException Thrown if the message with the
- * specified key cannot be found.
- */
- public static String formatMessage(String domain,
- String key, Object[] arguments)
- throws MissingResourceException {
- ResourceBundle resourceBundle = getResourceBundle(domain);
- if(resourceBundle == null){
- init();
- resourceBundle = getResourceBundle(domain);
- if(resourceBundle == null)
- throw new MissingResourceException("Unknown domain" + domain, null, key);
- }
- // format message
- String msg;
- try {
- msg = key + ": " + resourceBundle.getString(key);
- if (arguments != null) {
- try {
- msg = java.text.MessageFormat.format(msg, arguments);
- }
- catch (Exception e) {
- msg = resourceBundle.getString("FormatFailed");
- msg += " " + resourceBundle.getString(key);
- }
- }
- } // error
- catch (MissingResourceException e) {
- msg = resourceBundle.getString("BadMessageKey");
- throw new MissingResourceException(key, msg, key);
- }
-
- // no message
- if (msg == null) {
- msg = key;
- if (arguments.length > 0) {
- StringBuffer str = new StringBuffer(msg);
- str.append('?');
- for (int i = 0; i < arguments.length; i++) {
- if (i > 0) {
- str.append('&');
- }
- str.append(String.valueOf(arguments[i]));
- }
- }
- }
-
- return msg;
- }
-
- static ResourceBundle getResourceBundle(String domain){
- if(domain == DOM_DOMAIN || domain.equals(DOM_DOMAIN))
- return domResourceBundle;
- else if( domain == XML_DOMAIN || domain.equals(XML_DOMAIN))
- return xmlResourceBundle;
- else if(domain == SERIALIZER_DOMAIN || domain.equals(SERIALIZER_DOMAIN))
- return serResourceBundle;
- return null;
- }
- /**
- * Initialize Message Formatter.
- */
- public static void init(){
- if (locale != null) {
- domResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.DOMMessages", locale);
- serResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLSerializerMessages", locale);
- xmlResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages", locale);
- }else{
- domResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.DOMMessages");
- serResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLSerializerMessages");
- xmlResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages");
- }
- }
-
- /**
- * setLocale to be used by the formatter.
- * @param locale
- */
- public static void setLocale(Locale dlocale){
- locale = dlocale;
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/dom/DOMNormalizer.java b/src/com/sun/org/apache/xerces/internal/dom/DOMNormalizer.java
deleted file mode 100644
index c4268dc..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/DOMNormalizer.java
+++ /dev/null
@@ -1,2042 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004, 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.io.StringReader;
-import java.util.Vector;
-
-import com.sun.org.apache.xerces.internal.dom.AbortException;
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.RevalidationHandler;
-import com.sun.org.apache.xerces.internal.impl.dtd.DTDGrammar;
-import com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDDescription;
-import com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator;
-import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType;
-import com.sun.org.apache.xerces.internal.impl.xs.util.SimpleLocator;
-import com.sun.org.apache.xerces.internal.parsers.XMLGrammarPreparser;
-import com.sun.org.apache.xerces.internal.util.AugmentationsImpl;
-import com.sun.org.apache.xerces.internal.util.NamespaceSupport;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.util.XML11Char;
-import com.sun.org.apache.xerces.internal.util.XMLChar;
-import com.sun.org.apache.xerces.internal.util.XMLGrammarPoolImpl;
-import com.sun.org.apache.xerces.internal.util.XMLSymbols;
-import com.sun.org.apache.xerces.internal.xni.Augmentations;
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
-import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLLocator;
-import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
-import com.sun.org.apache.xerces.internal.xni.XMLString;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponent;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-import com.sun.org.apache.xerces.internal.xs.AttributePSVI;
-import com.sun.org.apache.xerces.internal.xs.ElementPSVI;
-import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Comment;
-import org.w3c.dom.DOMError;
-import org.w3c.dom.DOMErrorHandler;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.Entity;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.ProcessingInstruction;
-import org.w3c.dom.Text;
-/**
- * This class adds implementation for normalizeDocument method.
- * It acts as if the document was going through a save and load cycle, putting
- * the document in a "normal" form. The actual result depends on the features being set
- * and governing what operations actually take place. See setNormalizationFeature for details.
- * Noticeably this method normalizes Text nodes, makes the document "namespace wellformed",
- * according to the algorithm described below in pseudo code, by adding missing namespace
- * declaration attributes and adding or changing namespace prefixes, updates the replacement
- * tree of EntityReference nodes, normalizes attribute values, etc.
- * Mutation events, when supported, are generated to reflect the changes occuring on the
- * document.
- * See Namespace normalization for details on how namespace declaration attributes and prefixes
- * are normalized.
- *
- * NOTE: There is an initial support for DOM revalidation with XML Schema as a grammar.
- * The tree might not be validated correctly if entityReferences, CDATA sections are
- * present in the tree. The PSVI information is not exposed, normalized data (including element
- * default content is not available).
- *
- * @xerces.experimental
- *
- * @author Elena Litani, IBM
- * @author Neeraj Bajaj, Sun Microsystems, inc.
- * @version $Id: DOMNormalizer.java,v 1.9 2010-11-01 04:39:38 joehw Exp $
- */
-public class DOMNormalizer implements XMLDocumentHandler {
-
- //
- // constants
- //
- /** Debug normalize document*/
- protected final static boolean DEBUG_ND = false;
- /** Debug namespace fix up algorithm*/
- protected final static boolean DEBUG = false;
- /** Debug document handler events */
- protected final static boolean DEBUG_EVENTS = false;
-
- /** prefix added by namespace fixup algorithm should follow a pattern "NS" + index*/
- protected final static String PREFIX = "NS";
-
- //
- // Data
- //
- protected DOMConfigurationImpl fConfiguration = null;
- protected CoreDocumentImpl fDocument = null;
- protected final XMLAttributesProxy fAttrProxy = new XMLAttributesProxy();
- protected final QName fQName = new QName();
-
- /** Validation handler represents validator instance. */
- protected RevalidationHandler fValidationHandler;
-
- /** symbol table */
- protected SymbolTable fSymbolTable;
- /** error handler. may be null. */
- protected DOMErrorHandler fErrorHandler;
-
- /**
- * Cached {@link DOMError} impl.
- * The same object is re-used to report multiple errors.
- */
- private final DOMErrorImpl fError = new DOMErrorImpl();
-
- // Validation against namespace aware grammar
- protected boolean fNamespaceValidation = false;
-
- // Update PSVI information in the tree
- protected boolean fPSVI = false;
-
- /** The namespace context of this document: stores namespaces in scope */
- protected final NamespaceContext fNamespaceContext = new NamespaceSupport();
-
- /** Stores all namespace bindings on the current element */
- protected final NamespaceContext fLocalNSBinder = new NamespaceSupport();
-
- /** list of attributes */
- protected final ArrayList fAttributeList = new ArrayList(5);
-
- /** DOM Locator - for namespace fixup algorithm */
- protected final DOMLocatorImpl fLocator = new DOMLocatorImpl();
-
- /** for setting the PSVI */
- protected Node fCurrentNode = null;
- private QName fAttrQName = new QName();
-
- // attribute value normalization
- final XMLString fNormalizedValue = new XMLString(new char[16], 0, 0);
-
- //DTD validator
- private XMLDTDValidator fDTDValidator;
-
- //Check if element content is all "ignorable whitespace"
- private boolean allWhitespace = false;
-
- // Constructor
- //
-
- public DOMNormalizer(){}
-
-
-
- /**
- * Normalizes document.
- * Note: reset() must be called before this method.
- */
- protected void normalizeDocument(CoreDocumentImpl document, DOMConfigurationImpl config) {
-
- fDocument = document;
- fConfiguration = config;
-
- // intialize and reset DOMNormalizer component
- //
- fSymbolTable = (SymbolTable) fConfiguration.getProperty(DOMConfigurationImpl.SYMBOL_TABLE);
- // reset namespace context
- fNamespaceContext.reset();
- fNamespaceContext.declarePrefix(XMLSymbols.EMPTY_STRING, XMLSymbols.EMPTY_STRING);
-
- if ((fConfiguration.features & DOMConfigurationImpl.VALIDATE) != 0) {
- String schemaLang = (String)fConfiguration.getProperty(DOMConfigurationImpl.JAXP_SCHEMA_LANGUAGE);
-
- if(schemaLang != null && schemaLang.equals(Constants.NS_XMLSCHEMA)) {
- fValidationHandler =
- CoreDOMImplementationImpl.singleton.getValidator(XMLGrammarDescription.XML_SCHEMA);
- fConfiguration.setFeature(DOMConfigurationImpl.SCHEMA, true);
- fConfiguration.setFeature(DOMConfigurationImpl.SCHEMA_FULL_CHECKING, true);
- // report fatal error on DOM Level 1 nodes
- fNamespaceValidation = true;
-
- // check if we need to fill in PSVI
- fPSVI = ((fConfiguration.features & DOMConfigurationImpl.PSVI) !=0)?true:false;
- }
-
- fConfiguration.setFeature(DOMConfigurationImpl.XERCES_VALIDATION, true);
-
- // reset ID table
- fDocument.clearIdentifiers();
-
- if(fValidationHandler != null)
- // reset schema validator
- ((XMLComponent) fValidationHandler).reset(fConfiguration);
-
- }
-
- fErrorHandler = (DOMErrorHandler) fConfiguration.getParameter(Constants.DOM_ERROR_HANDLER);
- if (fValidationHandler != null) {
- fValidationHandler.setDocumentHandler(this);
- fValidationHandler.startDocument(
- new SimpleLocator(fDocument.fDocumentURI, fDocument.fDocumentURI,
- -1, -1 ), fDocument.encoding, fNamespaceContext, null);
-
- }
- try {
- Node kid, next;
- for (kid = fDocument.getFirstChild(); kid != null; kid = next) {
- next = kid.getNextSibling();
- kid = normalizeNode(kid);
- if (kid != null) { // don't advance
- next = kid;
- }
- }
-
- // release resources
- if (fValidationHandler != null) {
- fValidationHandler.endDocument(null);
- CoreDOMImplementationImpl.singleton.releaseValidator(
- XMLGrammarDescription.XML_SCHEMA, fValidationHandler);
- fValidationHandler = null;
- }
- } catch (AbortException e) {
- return;
- } catch (RuntimeException e) {
- throw e; // otherwise re-throw.
- }
-
- }
-
-
- /**
- *
- * This method acts as if the document was going through a save
- * and load cycle, putting the document in a "normal" form. The actual result
- * depends on the features being set and governing what operations actually
- * take place. See setNormalizationFeature for details. Noticeably this method
- * normalizes Text nodes, makes the document "namespace wellformed",
- * according to the algorithm described below in pseudo code, by adding missing
- * namespace declaration attributes and adding or changing namespace prefixes, updates
- * the replacement tree of EntityReference nodes,normalizes attribute values, etc.
- *
- * @param node Modified node or null. If node is returned, we need
- * to normalize again starting on the node returned.
- * @return the normalized Node
- */
- protected Node normalizeNode (Node node){
-
- int type = node.getNodeType();
- boolean wellformed;
- fLocator.fRelatedNode=node;
-
- switch (type) {
- case Node.DOCUMENT_TYPE_NODE: {
- if (DEBUG_ND) {
- System.out.println("==>normalizeNode:{doctype}");
- }
- DocumentTypeImpl docType = (DocumentTypeImpl)node;
- fDTDValidator = (XMLDTDValidator)CoreDOMImplementationImpl.singleton.getValidator(XMLGrammarDescription.XML_DTD);
- fDTDValidator.setDocumentHandler(this);
- fConfiguration.setProperty(Constants.XERCES_PROPERTY_PREFIX + Constants.XMLGRAMMAR_POOL_PROPERTY, createGrammarPool(docType));
- fDTDValidator.reset(fConfiguration);
- fDTDValidator.startDocument(
- new SimpleLocator(fDocument.fDocumentURI, fDocument.fDocumentURI,
- -1, -1 ), fDocument.encoding, fNamespaceContext, null);
- fDTDValidator.doctypeDecl(docType.getName(), docType.getPublicId(), docType.getSystemId(), null);
- //REVISIT: well-formness encoding info
- break;
- }
-
- case Node.ELEMENT_NODE: {
- if (DEBUG_ND) {
- System.out.println("==>normalizeNode:{element} "+node.getNodeName());
- }
-
- //do the name check only when version of the document was changed &
- //application has set the value of well-formed features to true
- if (fDocument.errorChecking) {
- if ( ((fConfiguration.features & DOMConfigurationImpl.WELLFORMED) != 0) &&
- fDocument.isXMLVersionChanged()){
- if (fNamespaceValidation){
- wellformed = CoreDocumentImpl.isValidQName(node.getPrefix() , node.getLocalName(), fDocument.isXML11Version()) ;
- }
- else {
- wellformed = CoreDocumentImpl.isXMLName(node.getNodeName() , fDocument.isXML11Version());
- }
- if (!wellformed){
- String msg = DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "wf-invalid-character-in-node-name",
- new Object[]{"Element", node.getNodeName()});
- reportDOMError(fErrorHandler, fError, fLocator, msg, DOMError.SEVERITY_ERROR,
- "wf-invalid-character-in-node-name");
- }
- }
- }
- // push namespace context
- fNamespaceContext.pushContext();
- fLocalNSBinder.reset();
-
- ElementImpl elem = (ElementImpl)node;
- if (elem.needsSyncChildren()) {
- elem.synchronizeChildren();
- }
- AttributeMap attributes = (elem.hasAttributes()) ? (AttributeMap) elem.getAttributes() : null;
-
- // fix namespaces and remove default attributes
- if ((fConfiguration.features & DOMConfigurationImpl.NAMESPACES) !=0) {
- // fix namespaces
- // normalize attribute values
- // remove default attributes
- namespaceFixUp(elem, attributes);
-
- if ((fConfiguration.features & DOMConfigurationImpl.NSDECL) == 0 && attributes != null ) {
- for (int i = 0; i < attributes.getLength(); ++i) {
- Attr att = (Attr)attributes.getItem(i);
- if (XMLSymbols.PREFIX_XMLNS.equals(att.getPrefix()) ||
- XMLSymbols.PREFIX_XMLNS.equals(att.getName())) {
- elem.removeAttributeNode(att);
- --i;
- }
- }
- }
-
- } else {
- if ( attributes!=null ) {
- for ( int i=0; i<attributes.getLength(); ++i ) {
- Attr attr = (Attr)attributes.item(i);
- //removeDefault(attr, attributes);
- attr.normalize();
- if (fDocument.errorChecking && ((fConfiguration.features & DOMConfigurationImpl.WELLFORMED) != 0)){
- isAttrValueWF(fErrorHandler, fError, fLocator, attributes, (AttrImpl)attr, attr.getValue(), fDocument.isXML11Version());
- if (fDocument.isXMLVersionChanged()){
- wellformed=CoreDocumentImpl.isXMLName(node.getNodeName() , fDocument.isXML11Version());
- if (!wellformed){
- String msg = DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "wf-invalid-character-in-node-name",
- new Object[]{"Attr",node.getNodeName()});
- reportDOMError(fErrorHandler, fError, fLocator, msg, DOMError.SEVERITY_ERROR,
- "wf-invalid-character-in-node-name");
- }
- }
- }
- }
- }
- }
-
-
- if (fValidationHandler != null) {
- // REVISIT: possible solutions to discard default content are:
- // either we pass some flag to XML Schema validator
- // or rely on the PSVI information.
- fAttrProxy.setAttributes(attributes, fDocument, elem);
- updateQName(elem, fQName); // updates global qname
- // set error node in the dom error wrapper
- // so if error occurs we can report an error node
- fConfiguration.fErrorHandlerWrapper.fCurrentNode = node;
- fCurrentNode = node;
- // call re-validation handler
- fValidationHandler.startElement(fQName, fAttrProxy, null);
- }
-
- if (fDTDValidator != null) {
- // REVISIT: possible solutions to discard default content are:
- // either we pass some flag to XML Schema validator
- // or rely on the PSVI information.
- fAttrProxy.setAttributes(attributes, fDocument, elem);
- updateQName(elem, fQName); // updates global qname
- // set error node in the dom error wrapper
- // so if error occurs we can report an error node
- fConfiguration.fErrorHandlerWrapper.fCurrentNode = node;
- fCurrentNode = node;
- // call re-validation handler
- fDTDValidator.startElement(fQName, fAttrProxy, null);
- }
-
- // normalize children
- Node kid, next;
- for (kid = elem.getFirstChild(); kid != null; kid = next) {
- next = kid.getNextSibling();
- kid = normalizeNode(kid);
- if (kid !=null) {
- next = kid; // don't advance
- }
- }
- if (DEBUG_ND) {
- // normalized subtree
- System.out.println("***The children of {"+node.getNodeName()+"} are normalized");
- for (kid = elem.getFirstChild(); kid != null; kid = next) {
- next = kid.getNextSibling();
- System.out.println(kid.getNodeName() +"["+kid.getNodeValue()+"]");
- }
-
- }
-
-
- if (fValidationHandler != null) {
- updateQName(elem, fQName); // updates global qname
- //
- // set error node in the dom error wrapper
- // so if error occurs we can report an error node
- fConfiguration.fErrorHandlerWrapper.fCurrentNode = node;
- fCurrentNode = node;
- fValidationHandler.endElement(fQName, null);
- }
-
- if (fDTDValidator != null) {
- updateQName(elem, fQName); // updates global qname
- //
- // set error node in the dom error wrapper
- // so if error occurs we can report an error node
- fConfiguration.fErrorHandlerWrapper.fCurrentNode = node;
- fCurrentNode = node;
- fDTDValidator.endElement(fQName, null);
- }
-
- // pop namespace context
- fNamespaceContext.popContext();
-
- break;
- }
-
- case Node.COMMENT_NODE: {
- if (DEBUG_ND) {
- System.out.println("==>normalizeNode:{comments}");
- }
-
- if ((fConfiguration.features & DOMConfigurationImpl.COMMENTS) == 0) {
- Node prevSibling = node.getPreviousSibling();
- Node parent = node.getParentNode();
- // remove the comment node
- parent.removeChild(node);
- if (prevSibling != null && prevSibling.getNodeType() == Node.TEXT_NODE) {
- Node nextSibling = prevSibling.getNextSibling();
- if (nextSibling != null && nextSibling.getNodeType() == Node.TEXT_NODE) {
- ((TextImpl)nextSibling).insertData(0, prevSibling.getNodeValue());
- parent.removeChild(prevSibling);
- return nextSibling;
- }
- }
- }//if comment node need not be removed
- else {
- if (fDocument.errorChecking && ((fConfiguration.features & DOMConfigurationImpl.WELLFORMED) != 0)){
- String commentdata = ((Comment)node).getData();
- // check comments for invalid xml chracter as per the version
- // of the document
- isCommentWF(fErrorHandler, fError, fLocator, commentdata, fDocument.isXML11Version());
- }
- }//end-else if comment node is not to be removed.
- break;
- }
- case Node.ENTITY_REFERENCE_NODE: {
- if (DEBUG_ND) {
- System.out.println("==>normalizeNode:{entityRef} "+node.getNodeName());
- }
-
- if ((fConfiguration.features & DOMConfigurationImpl.ENTITIES) == 0) {
- Node prevSibling = node.getPreviousSibling();
- Node parent = node.getParentNode();
- ((EntityReferenceImpl)node).setReadOnly(false, true);
- expandEntityRef (parent, node);
- parent.removeChild(node);
- Node next = (prevSibling != null)?prevSibling.getNextSibling():parent.getFirstChild();
- // The list of children #text -> &ent;
- // and entity has a first child as a text
- // we should not advance
- if (prevSibling != null && next != null && prevSibling.getNodeType() == Node.TEXT_NODE &&
- next.getNodeType() == Node.TEXT_NODE) {
- return prevSibling; // Don't advance
- }
- return next;
- } else {
- if (fDocument.errorChecking && ((fConfiguration.features & DOMConfigurationImpl.WELLFORMED) != 0) &&
- fDocument.isXMLVersionChanged()){
- CoreDocumentImpl.isXMLName(node.getNodeName() , fDocument.isXML11Version());
- }
- // REVISIT: traverse entity reference and send appropriate calls to the validator
- // (no normalization should be performed for the children).
- }
- break;
- }
-
- case Node.CDATA_SECTION_NODE: {
- if (DEBUG_ND) {
- System.out.println("==>normalizeNode:{cdata}");
- }
-
- if ((fConfiguration.features & DOMConfigurationImpl.CDATA) == 0) {
- // convert CDATA to TEXT nodes
- Node prevSibling = node.getPreviousSibling();
- if (prevSibling != null && prevSibling.getNodeType() == Node.TEXT_NODE){
- ((Text)prevSibling).appendData(node.getNodeValue());
- node.getParentNode().removeChild(node);
- return prevSibling; //don't advance
- }
- else {
- Text text = fDocument.createTextNode(node.getNodeValue());
- Node parent = node.getParentNode();
- node = parent.replaceChild(text, node);
- return text; //don't advance
-
- }
- }
-
- // send characters call for CDATA
- if (fValidationHandler != null) {
- // set error node in the dom error wrapper
- // so if error occurs we can report an error node
- fConfiguration.fErrorHandlerWrapper.fCurrentNode = node;
- fCurrentNode = node;
- fValidationHandler.startCDATA(null);
- fValidationHandler.characterData(node.getNodeValue(), null);
- fValidationHandler.endCDATA(null);
- }
-
- if (fDTDValidator != null) {
- // set error node in the dom error wrapper
- // so if error occurs we can report an error node
- fConfiguration.fErrorHandlerWrapper.fCurrentNode = node;
- fCurrentNode = node;
- fDTDValidator.startCDATA(null);
- fDTDValidator.characterData(node.getNodeValue(), null);
- fDTDValidator.endCDATA(null);
- }
- String value = node.getNodeValue();
-
- if ((fConfiguration.features & DOMConfigurationImpl.SPLITCDATA) != 0) {
- int index;
- Node parent = node.getParentNode();
- if (fDocument.errorChecking) {
- isXMLCharWF(fErrorHandler, fError, fLocator, node.getNodeValue(), fDocument.isXML11Version());
- }
- while ( (index=value.indexOf("]]>")) >= 0 ) {
- node.setNodeValue(value.substring(0, index+2));
- value = value.substring(index +2);
-
- Node firstSplitNode = node;
- Node newChild = fDocument.createCDATASection(value);
- parent.insertBefore(newChild, node.getNextSibling());
- node = newChild;
- // issue warning
- fLocator.fRelatedNode = firstSplitNode;
- String msg = DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "cdata-sections-splitted",
- null);
- reportDOMError(fErrorHandler, fError, fLocator, msg, DOMError.SEVERITY_WARNING,
- "cdata-sections-splitted");
- }
-
- }
- else if (fDocument.errorChecking) {
- // check well-formedness
- isCDataWF(fErrorHandler, fError, fLocator, value, fDocument.isXML11Version());
- }
- break;
- }
-
- case Node.TEXT_NODE: {
- if (DEBUG_ND) {
- System.out.println("==>normalizeNode(text):{"+node.getNodeValue()+"}");
- }
- // If node is a text node, we need to check for one of two
- // conditions:
- // 1) There is an adjacent text node
- // 2) There is no adjacent text node, but node is
- // an empty text node.
- Node next = node.getNextSibling();
- // If an adjacent text node, merge it with this node
- if ( next!=null && next.getNodeType() == Node.TEXT_NODE ) {
- ((Text)node).appendData(next.getNodeValue());
- node.getParentNode().removeChild( next );
- // We don't need to check well-formness here since we are not yet
- // done with this node.
-
- return node; // Don't advance;
- } else if (node.getNodeValue().length()==0) {
- // If kid is empty, remove it
- node.getParentNode().removeChild( node );
- } else {
- // validator.characters() call and well-formness
- // Don't send characters or check well-formness in the following cases:
- // 1. entities is false, next child is entity reference: expand tree first
- // 2. comments is false, and next child is comment
- // 3. cdata is false, and next child is cdata
-
- short nextType = (next != null)?next.getNodeType():-1;
- if (nextType == -1 || !(((fConfiguration.features & DOMConfigurationImpl.ENTITIES) == 0 &&
- nextType == Node.ENTITY_NODE) ||
- ((fConfiguration.features & DOMConfigurationImpl.COMMENTS) == 0 &&
- nextType == Node.COMMENT_NODE) ||
- ((fConfiguration.features & DOMConfigurationImpl.CDATA) == 0) &&
- nextType == Node.CDATA_SECTION_NODE)) {
- if (fDocument.errorChecking && ((fConfiguration.features & DOMConfigurationImpl.WELLFORMED) != 0) ){
- isXMLCharWF(fErrorHandler, fError, fLocator, node.getNodeValue(), fDocument.isXML11Version());
- }
- if (fValidationHandler != null) {
- fConfiguration.fErrorHandlerWrapper.fCurrentNode = node;
- fCurrentNode = node;
- fValidationHandler.characterData(node.getNodeValue(), null);
- if (DEBUG_ND) {
- System.out.println("=====>characterData(),"+nextType);
-
- }
- }
- if (fDTDValidator != null) {
- fConfiguration.fErrorHandlerWrapper.fCurrentNode = node;
- fCurrentNode = node;
- fDTDValidator.characterData(node.getNodeValue(), null);
- if (DEBUG_ND) {
- System.out.println("=====>characterData(),"+nextType);
-
- }
- if(allWhitespace) {
- allWhitespace = false;
- ((TextImpl)node).setIgnorableWhitespace(true);
- }
- }
- }
- else {
- if (DEBUG_ND) {
- System.out.println("=====>don't send characters(),"+nextType);
-
- }
- }
- }
- break;
- }
- case Node.PROCESSING_INSTRUCTION_NODE: {
-
- //do the well-formed valid PI target name , data check when application has set the value of well-formed feature to true
- if (fDocument.errorChecking && (fConfiguration.features & DOMConfigurationImpl.WELLFORMED) != 0 ) {
- ProcessingInstruction pinode = (ProcessingInstruction)node ;
-
- String target = pinode.getTarget();
- //1.check PI target name
- if(fDocument.isXML11Version()){
- wellformed = XML11Char.isXML11ValidName(target);
- }
- else{
- wellformed = XMLChar.isValidName(target);
- }
-
- if (!wellformed) {
- String msg = DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "wf-invalid-character-in-node-name",
- new Object[]{"Element", node.getNodeName()});
- reportDOMError(fErrorHandler, fError, fLocator, msg, DOMError.SEVERITY_ERROR,
- "wf-invalid-character-in-node-name");
- }
-
- //2. check PI data
- //processing isntruction data may have certain characters
- //which may not be valid XML character
- isXMLCharWF(fErrorHandler, fError, fLocator, pinode.getData(), fDocument.isXML11Version());
- }
- }//end case Node.PROCESSING_INSTRUCTION_NODE
-
- }//end of switch
- return null;
- }//normalizeNode
-
- private XMLGrammarPool createGrammarPool(DocumentTypeImpl docType) {
-
- XMLGrammarPoolImpl pool = new XMLGrammarPoolImpl();
-
- XMLGrammarPreparser preParser = new XMLGrammarPreparser(fSymbolTable);
- preParser.registerPreparser(XMLGrammarDescription.XML_DTD, null);
- preParser.setFeature(Constants.XERCES_FEATURE_PREFIX + Constants.NAMESPACES_FEATURE, true);
- preParser.setFeature(Constants.XERCES_FEATURE_PREFIX + Constants.VALIDATION_FEATURE, true);
- preParser.setProperty(Constants.XERCES_PROPERTY_PREFIX + Constants.XMLGRAMMAR_POOL_PROPERTY, pool);
-
- String internalSubset = docType.getInternalSubset();
- XMLInputSource is = new XMLInputSource(docType.getPublicId(), docType.getSystemId(), null);
-
- if(internalSubset != null)
- is.setCharacterStream(new StringReader(internalSubset));
- try {
- DTDGrammar g = (DTDGrammar)preParser.preparseGrammar(XMLGrammarDescription.XML_DTD, is);
- ((XMLDTDDescription)g.getGrammarDescription()).setRootName(docType.getName());
- is.setCharacterStream(null);
- g = (DTDGrammar)preParser.preparseGrammar(XMLGrammarDescription.XML_DTD, is);
- ((XMLDTDDescription)g.getGrammarDescription()).setRootName(docType.getName());
-
- } catch (XNIException e) {
- } catch (IOException e) {
- }
-
- return pool;
- }
-
-
-
- protected final void expandEntityRef (Node parent, Node reference){
- Node kid, next;
- for (kid = reference.getFirstChild(); kid != null; kid = next) {
- next = kid.getNextSibling();
- parent.insertBefore(kid, reference);
- }
- }
-
- // fix namespaces
- // normalize attribute values
- // remove default attributes
- // check attribute names if the version of the document changed.
-
- protected final void namespaceFixUp (ElementImpl element, AttributeMap attributes){
- if (DEBUG) {
- System.out.println("[ns-fixup] element:" +element.getNodeName()+
- " uri: "+element.getNamespaceURI());
- }
-
- // ------------------------------------
- // pick up local namespace declarations
- // <xsl:stylesheet xmlns:xsl="http://xslt">
- // <!-- add the following via DOM
- // body is bound to http://xslt
- // -->
- // <xsl:body xmlns:xsl="http://bound"/>
- //
- // ------------------------------------
-
- String value, name, uri, prefix;
- if (attributes != null) {
-
- // Record all valid local declarations
- for (int k = 0; k < attributes.getLength(); ++k) {
- Attr attr = (Attr)attributes.getItem(k);
-
- //do the name check only when version of the document was changed &
- //application has set the value of well-formed features to true
- if (fDocument.errorChecking && ((fConfiguration.features & DOMConfigurationImpl.WELLFORMED) != 0) &&
- fDocument.isXMLVersionChanged()) {
- //checkQName does checking based on the version of the document
- fDocument.checkQName(attr.getPrefix() , attr.getLocalName()) ;
- }
-
- uri = attr.getNamespaceURI();
- if (uri != null && uri.equals(NamespaceContext.XMLNS_URI)) {
- // namespace attribute
-
- // "namespace-declarations" == false; Discard all namespace declaration attributes
- if ((fConfiguration.features & DOMConfigurationImpl.NSDECL) == 0) {
- continue;
- }
-
- value = attr.getNodeValue();
- if (value == null) {
- value=XMLSymbols.EMPTY_STRING;
- }
-
- // Check for invalid namespace declaration:
- if (fDocument.errorChecking && value.equals(NamespaceContext.XMLNS_URI)) {
- //A null value for locale is passed to formatMessage,
- //which means that the default locale will be used
- fLocator.fRelatedNode = attr;
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.XML_DOMAIN,"CantBindXMLNS",null );
- reportDOMError(fErrorHandler, fError, fLocator, msg, DOMError.SEVERITY_ERROR, "CantBindXMLNS");
- } else {
- // XML 1.0 Attribute value normalization
- // value = normalizeAttributeValue(value, attr);
- prefix = attr.getPrefix();
- prefix = (prefix == null ||
- prefix.length() == 0) ? XMLSymbols.EMPTY_STRING :fSymbolTable.addSymbol(prefix);
- String localpart = fSymbolTable.addSymbol( attr.getLocalName());
- if (prefix == XMLSymbols.PREFIX_XMLNS) { //xmlns:prefix
-
- value = fSymbolTable.addSymbol(value);
- if (value.length() != 0) {
- fNamespaceContext.declarePrefix(localpart, value);
- } else {
- // REVISIT: issue error on invalid declarations
- // xmlns:foo = ""
-
- }
- //removeDefault (attr, attributes);
- continue;
- } else { // (localpart == fXmlnsSymbol && prefix == fEmptySymbol) -- xmlns
- // empty prefix is always bound ("" or some string)
- value = fSymbolTable.addSymbol(value);
- fNamespaceContext.declarePrefix(XMLSymbols.EMPTY_STRING, value);
- //removeDefault (attr, attributes);
- continue;
- }
- } // end-else: valid declaration
- } // end-if: namespace attribute
- }
- }
-
-
-
- // ---------------------------------------------------------
- // Fix up namespaces for element: per DOM L3
- // Need to consider the following cases:
- //
- // case 1: <xsl:stylesheet xmlns:xsl="http://xsl">
- // We create another element body bound to the "http://xsl" namespace
- // as well as namespace attribute rebounding xsl to another namespace.
- // <xsl:body xmlns:xsl="http://another">
- // Need to make sure that the new namespace decl value is changed to
- // "http://xsl"
- //
- // ---------------------------------------------------------
- // check if prefix/namespace is correct for current element
- // ---------------------------------------------------------
-
- uri = element.getNamespaceURI();
- prefix = element.getPrefix();
-
- // "namespace-declarations" == false? Discard all namespace declaration attributes
- if ((fConfiguration.features & DOMConfigurationImpl.NSDECL) == 0) {
- // no namespace declaration == no namespace URI, semantics are to keep prefix
- uri = null;
- } else if (uri != null) { // Element has a namespace
- uri = fSymbolTable.addSymbol(uri);
- prefix = (prefix == null ||
- prefix.length() == 0) ? XMLSymbols.EMPTY_STRING :fSymbolTable.addSymbol(prefix);
- if (fNamespaceContext.getURI(prefix) == uri) {
- // The xmlns:prefix=namespace or xmlns="default" was declared at parent.
- // The binder always stores mapping of empty prefix to "".
- } else {
- // the prefix is either undeclared
- // or
- // conflict: the prefix is bound to another URI
- addNamespaceDecl(prefix, uri, element);
- fLocalNSBinder.declarePrefix(prefix, uri);
- fNamespaceContext.declarePrefix(prefix, uri);
- }
- } else { // Element has no namespace
- if (element.getLocalName() == null) {
-
- // Error: DOM Level 1 node!
- if (fNamespaceValidation) {
- String msg = DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN, "NullLocalElementName",
- new Object[]{element.getNodeName()});
- reportDOMError(fErrorHandler, fError, fLocator, msg, DOMError.SEVERITY_FATAL_ERROR,
- "NullLocalElementName");
- } else {
- String msg = DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN, "NullLocalElementName",
- new Object[]{element.getNodeName()});
- reportDOMError(fErrorHandler, fError, fLocator, msg, DOMError.SEVERITY_ERROR,
- "NullLocalElementName");
- }
-
- } else { // uri=null and no colon (DOM L2 node)
- uri = fNamespaceContext.getURI(XMLSymbols.EMPTY_STRING);
- if (uri !=null && uri.length() > 0) {
- // undeclare default namespace declaration (before that element
- // bound to non-zero length uir), but adding xmlns="" decl
- addNamespaceDecl (XMLSymbols.EMPTY_STRING, XMLSymbols.EMPTY_STRING, element);
- fLocalNSBinder.declarePrefix(XMLSymbols.EMPTY_STRING, XMLSymbols.EMPTY_STRING);
- fNamespaceContext.declarePrefix(XMLSymbols.EMPTY_STRING, XMLSymbols.EMPTY_STRING);
- }
- }
- }
-
- // -----------------------------------------
- // Fix up namespaces for attributes: per DOM L3
- // check if prefix/namespace is correct the attributes
- // -----------------------------------------
- if (attributes != null) {
-
- // clone content of the attributes
- attributes.cloneMap(fAttributeList);
- for (int i = 0; i < fAttributeList.size(); i++) {
- Attr attr = (Attr) fAttributeList.get(i);
- fLocator.fRelatedNode = attr;
-
- if (DEBUG) {
- System.out.println("==>[ns-fixup] process attribute: "+attr.getNodeName());
- }
- // normalize attribute value
- attr.normalize();
- value = attr.getValue();
- name = attr.getNodeName();
- uri = attr.getNamespaceURI();
-
- // make sure that value is never null.
- if (value == null) {
- value=XMLSymbols.EMPTY_STRING;
- }
-
- if (uri != null) { // attribute has namespace !=null
- prefix = attr.getPrefix();
- prefix = (prefix == null ||
- prefix.length() == 0) ? XMLSymbols.EMPTY_STRING :fSymbolTable.addSymbol(prefix);
- /*String localpart =*/ fSymbolTable.addSymbol( attr.getLocalName());
-
- // ---------------------------------------
- // skip namespace declarations
- // ---------------------------------------
- // REVISIT: can we assume that "uri" is from some symbol
- // table, and compare by reference? -SG
- if (uri != null && uri.equals(NamespaceContext.XMLNS_URI)) {
- continue;
- }
- //---------------------------------------
- // check if value of the attribute is namespace well-formed
- //---------------------------------------
- if (fDocument.errorChecking && ((fConfiguration.features & DOMConfigurationImpl.WELLFORMED) != 0)) {
- isAttrValueWF(fErrorHandler, fError, fLocator, attributes, (AttrImpl)attr, attr.getValue(), fDocument.isXML11Version());
- if (fDocument.isXMLVersionChanged()){
- boolean wellformed=CoreDocumentImpl.isXMLName(attr.getNodeName() , fDocument.isXML11Version());
- if (!wellformed){
- String msg = DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "wf-invalid-character-in-node-name",
- new Object[]{"Attribute", attr.getNodeName()});
- reportDOMError(fErrorHandler, fError, fLocator, msg, DOMError.SEVERITY_ERROR,
- "wf-invalid-character-in-node-name");
- }
- }
- }
-
- // ---------------------------------------
- // remove default attributes
- // ---------------------------------------
- /*
- if (removeDefault(attr, attributes)) {
- continue;
- }
- */
- // XML 1.0 Attribute value normalization
- //value = normalizeAttributeValue(value, attr);
-
- // reset id-attributes
- ((AttrImpl)attr).setIdAttribute(false);
-
-
- uri = fSymbolTable.addSymbol(uri);
-
- // find if for this prefix a URI was already declared
- String declaredURI = fNamespaceContext.getURI(prefix);
-
- if (prefix == XMLSymbols.EMPTY_STRING || declaredURI != uri) {
- // attribute has no prefix (default namespace decl does not apply to attributes)
- // OR
- // attribute prefix is not declared
- // OR
- // conflict: attribute has a prefix that conficlicts with a binding
- // already active in scope
-
- name = attr.getNodeName();
- // Find if any prefix for attributes namespace URI is available
- // in the scope
- String declaredPrefix = fNamespaceContext.getPrefix(uri);
- if (declaredPrefix !=null && declaredPrefix !=XMLSymbols.EMPTY_STRING) {
-
- // use the prefix that was found (declared previously for this URI
- prefix = declaredPrefix;
- } else {
- if (prefix != XMLSymbols.EMPTY_STRING && fLocalNSBinder.getURI(prefix) == null) {
- // the current prefix is not null and it has no in scope declaration
-
- // use this prefix
- } else {
-
- // find a prefix following the pattern "NS" +index (starting at 1)
- // make sure this prefix is not declared in the current scope.
- int counter = 1;
- prefix = fSymbolTable.addSymbol(PREFIX +counter++);
- while (fLocalNSBinder.getURI(prefix)!=null) {
- prefix = fSymbolTable.addSymbol(PREFIX +counter++);
- }
-
- }
- // add declaration for the new prefix
- addNamespaceDecl(prefix, uri, element);
- value = fSymbolTable.addSymbol(value);
- fLocalNSBinder.declarePrefix(prefix, value);
- fNamespaceContext.declarePrefix(prefix, uri);
- }
-
- // change prefix for this attribute
- attr.setPrefix(prefix);
- }
- } else { // attribute uri == null
-
- // XML 1.0 Attribute value normalization
- //value = normalizeAttributeValue(value, attr);
-
- // reset id-attributes
- ((AttrImpl)attr).setIdAttribute(false);
-
- if (attr.getLocalName() == null) {
- // It is an error if document has DOM L1 nodes.
- if (fNamespaceValidation) {
- String msg = DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "NullLocalAttrName", new Object[]{attr.getNodeName()});
- reportDOMError(fErrorHandler, fError, fLocator, msg, DOMError.SEVERITY_FATAL_ERROR,
- "NullLocalAttrName");
- } else {
- String msg = DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "NullLocalAttrName", new Object[]{attr.getNodeName()});
- reportDOMError(fErrorHandler, fError, fLocator, msg, DOMError.SEVERITY_ERROR,
- "NullLocalAttrName");
- }
- } else {
- // uri=null and no colon
- // no fix up is needed: default namespace decl does not
-
- // ---------------------------------------
- // remove default attributes
- // ---------------------------------------
- // removeDefault(attr, attributes);
- }
- }
- }
- } // end loop for attributes
- }
-
- /**
- * Adds a namespace attribute or replaces the value of existing namespace
- * attribute with the given prefix and value for URI.
- * In case prefix is empty will add/update default namespace declaration.
- *
- * @param prefix
- * @param uri
- * @exception IOException
- */
-
- protected final void addNamespaceDecl(String prefix, String uri, ElementImpl element){
- if (DEBUG) {
- System.out.println("[ns-fixup] addNamespaceDecl ["+prefix+"]");
- }
- if (prefix == XMLSymbols.EMPTY_STRING) {
- if (DEBUG) {
- System.out.println("=>add xmlns=\""+uri+"\" declaration");
- }
- element.setAttributeNS(NamespaceContext.XMLNS_URI, XMLSymbols.PREFIX_XMLNS, uri);
- } else {
- if (DEBUG) {
- System.out.println("=>add xmlns:"+prefix+"=\""+uri+"\" declaration");
- }
- element.setAttributeNS(NamespaceContext.XMLNS_URI, "xmlns:"+prefix, uri);
- }
- }
-
-
- //
- // Methods for well-formness checking
- //
-
-
- /**
- * Check if CDATA section is well-formed
- * @param datavalue
- * @param isXML11Version = true if XML 1.1
- */
- public static final void isCDataWF(DOMErrorHandler errorHandler, DOMErrorImpl error, DOMLocatorImpl locator,
- String datavalue, boolean isXML11Version)
- {
- if (datavalue == null || (datavalue.length() == 0) ) {
- return;
- }
-
- char [] dataarray = datavalue.toCharArray();
- int datalength = dataarray.length;
-
- // version of the document is XML 1.1
- if (isXML11Version) {
- // we need to check all chracters as per production rules of XML11
- int i = 0;
- while(i < datalength){
- char c = dataarray[i++];
- if ( XML11Char.isXML11Invalid(c) ) {
- // check if this is a supplemental character
- if (XMLChar.isHighSurrogate(c) && i < datalength) {
- char c2 = dataarray[i++];
- if (XMLChar.isLowSurrogate(c2) &&
- XMLChar.isSupplemental(XMLChar.supplemental(c, c2))) {
- continue;
- }
- }
- String msg = DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.XML_DOMAIN,
- "InvalidCharInCDSect",
- new Object[] { Integer.toString(c, 16)});
- reportDOMError(
- errorHandler,
- error,
- locator,
- msg,
- DOMError.SEVERITY_ERROR,
- "wf-invalid-character");
- }
- else if (c == ']') {
- int count = i;
- if (count < datalength && dataarray[count] == ']') {
- while (++count < datalength && dataarray[count] == ']') {
- // do nothing
- }
- if (count < datalength && dataarray[count] == '>') {
- // CDEndInContent
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.XML_DOMAIN, "CDEndInContent", null);
- reportDOMError(errorHandler, error, locator,msg, DOMError.SEVERITY_ERROR, "wf-invalid-character");
- }
- }
-
- }
- }
- } // version of the document is XML 1.0
- else {
- // we need to check all chracters as per production rules of XML 1.0
- int i = 0;
- while (i < datalength) {
- char c = dataarray[i++];
- if( XMLChar.isInvalid(c) ) {
- // check if this is a supplemental character
- if (XMLChar.isHighSurrogate(c) && i < datalength) {
- char c2 = dataarray[i++];
- if (XMLChar.isLowSurrogate(c2) &&
- XMLChar.isSupplemental(XMLChar.supplemental(c, c2))) {
- continue;
- }
- }
- // Note: The key InvalidCharInCDSect from XMLMessages.properties
- // is being used to obtain the message and DOM error type
- // "wf-invalid-character" is used. Also per DOM it is error but
- // as per XML spec. it is fatal error
- String msg = DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.XML_DOMAIN,
- "InvalidCharInCDSect",
- new Object[]{Integer.toString(c, 16)});
- reportDOMError(errorHandler, error, locator, msg, DOMError.SEVERITY_ERROR, "wf-invalid-character");
- }
- else if (c==']') {
- int count = i;
- if ( count< datalength && dataarray[count]==']' ) {
- while (++count < datalength && dataarray[count]==']' ) {
- // do nothing
- }
- if ( count < datalength && dataarray[count]=='>' ) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.XML_DOMAIN, "CDEndInContent", null);
- reportDOMError(errorHandler, error, locator, msg, DOMError.SEVERITY_ERROR, "wf-invalid-character");
- }
- }
-
- }
- }
- } // end-else fDocument.isXMLVersion()
-
- } // isCDataWF
-
- /**
- * NON-DOM: check for valid XML characters as per the XML version
- * @param datavalue
- * @param isXML11Version = true if XML 1.1
- */
- public static final void isXMLCharWF(DOMErrorHandler errorHandler, DOMErrorImpl error, DOMLocatorImpl locator,
- String datavalue, boolean isXML11Version)
- {
- if ( datavalue == null || (datavalue.length() == 0) ) {
- return;
- }
-
- char [] dataarray = datavalue.toCharArray();
- int datalength = dataarray.length;
-
- // version of the document is XML 1.1
- if(isXML11Version){
- //we need to check all characters as per production rules of XML11
- int i = 0 ;
- while (i < datalength) {
- if(XML11Char.isXML11Invalid(dataarray[i++])){
- // check if this is a supplemental character
- char ch = dataarray[i-1];
- if (XMLChar.isHighSurrogate(ch) && i < datalength) {
- char ch2 = dataarray[i++];
- if (XMLChar.isLowSurrogate(ch2) &&
- XMLChar.isSupplemental(XMLChar.supplemental(ch, ch2))) {
- continue;
- }
- }
- String msg = DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN, "InvalidXMLCharInDOM",
- new Object[]{Integer.toString(dataarray[i-1], 16)});
- reportDOMError(errorHandler, error, locator, msg, DOMError.SEVERITY_ERROR,
- "wf-invalid-character");
- }
- }
- } // version of the document is XML 1.0
- else{
- // we need to check all characters as per production rules of XML 1.0
- int i = 0 ;
- while (i < datalength) {
- if( XMLChar.isInvalid(dataarray[i++]) ) {
- // check if this is a supplemental character
- char ch = dataarray[i-1];
- if (XMLChar.isHighSurrogate(ch) && i < datalength) {
- char ch2 = dataarray[i++];
- if (XMLChar.isLowSurrogate(ch2) &&
- XMLChar.isSupplemental(XMLChar.supplemental(ch, ch2))) {
- continue;
- }
- }
- String msg = DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN, "InvalidXMLCharInDOM",
- new Object[]{Integer.toString(dataarray[i-1], 16)});
- reportDOMError(errorHandler, error, locator, msg, DOMError.SEVERITY_ERROR,
- "wf-invalid-character");
- }
- }
- } // end-else fDocument.isXMLVersion()
-
- } // isXMLCharWF
-
- /**
- * NON-DOM: check if value of the comment is well-formed
- * @param datavalue
- * @param isXML11Version = true if XML 1.1
- */
- public static final void isCommentWF(DOMErrorHandler errorHandler, DOMErrorImpl error, DOMLocatorImpl locator,
- String datavalue, boolean isXML11Version)
- {
- if ( datavalue == null || (datavalue.length() == 0) ) {
- return;
- }
-
- char [] dataarray = datavalue.toCharArray();
- int datalength = dataarray.length ;
-
- // version of the document is XML 1.1
- if (isXML11Version) {
- // we need to check all chracters as per production rules of XML11
- int i = 0 ;
- while (i < datalength){
- char c = dataarray[i++];
- if ( XML11Char.isXML11Invalid(c) ) {
- // check if this is a supplemental character
- if (XMLChar.isHighSurrogate(c) && i < datalength) {
- char c2 = dataarray[i++];
- if (XMLChar.isLowSurrogate(c2) &&
- XMLChar.isSupplemental(XMLChar.supplemental(c, c2))) {
- continue;
- }
- }
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.XML_DOMAIN,
- "InvalidCharInComment",
- new Object [] {Integer.toString(dataarray[i-1], 16)});
- reportDOMError(errorHandler, error, locator, msg, DOMError.SEVERITY_ERROR, "wf-invalid-character");
- }
- else if (c == '-' && i < datalength && dataarray[i] == '-') {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.XML_DOMAIN,
- "DashDashInComment", null);
- // invalid: '--' in comment
- reportDOMError(errorHandler, error, locator, msg, DOMError.SEVERITY_ERROR, "wf-invalid-character");
- }
- }
- } // version of the document is XML 1.0
- else {
- // we need to check all chracters as per production rules of XML 1.0
- int i = 0;
- while (i < datalength){
- char c = dataarray[i++];
- if( XMLChar.isInvalid(c) ){
- // check if this is a supplemental character
- if (XMLChar.isHighSurrogate(c) && i < datalength) {
- char c2 = dataarray[i++];
- if (XMLChar.isLowSurrogate(c2) &&
- XMLChar.isSupplemental(XMLChar.supplemental(c, c2))) {
- continue;
- }
- }
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.XML_DOMAIN,
- "InvalidCharInComment", new Object [] {Integer.toString(dataarray[i-1], 16)});
- reportDOMError(errorHandler, error, locator, msg, DOMError.SEVERITY_ERROR, "wf-invalid-character");
- }
- else if (c == '-' && i<datalength && dataarray[i]=='-'){
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.XML_DOMAIN,
- "DashDashInComment", null);
- // invalid: '--' in comment
- reportDOMError(errorHandler, error, locator, msg, DOMError.SEVERITY_ERROR, "wf-invalid-character");
- }
- }
-
- } // end-else fDocument.isXMLVersion()
-
- } // isCommentWF
-
- /** NON-DOM: check if attribute value is well-formed
- * @param attributes
- * @param a
- * @param value
- */
- public static final void isAttrValueWF(DOMErrorHandler errorHandler, DOMErrorImpl error,
- DOMLocatorImpl locator, NamedNodeMap attributes, Attr a, String value, boolean xml11Version) {
- if (a instanceof AttrImpl && ((AttrImpl)a).hasStringValue()) {
- isXMLCharWF(errorHandler, error, locator, value, xml11Version);
- } else {
- NodeList children = a.getChildNodes();
- //check each child node of the attribute's value
- for (int j = 0; j < children.getLength(); j++) {
- Node child = children.item(j);
- //If the attribute's child is an entity refernce
- if (child.getNodeType() == Node.ENTITY_REFERENCE_NODE) {
- Document owner = a.getOwnerDocument();
- Entity ent = null;
- //search for the entity in the docType
- //of the attribute's ownerDocument
- if (owner != null) {
- DocumentType docType = owner.getDoctype();
- if (docType != null) {
- NamedNodeMap entities = docType.getEntities();
- ent = (Entity) entities.getNamedItemNS(
- "*",
- child.getNodeName());
- }
- }
- //If the entity was not found issue a fatal error
- if (ent == null) {
- String msg = DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN, "UndeclaredEntRefInAttrValue",
- new Object[]{a.getNodeName()});
- reportDOMError(errorHandler, error, locator, msg, DOMError.SEVERITY_ERROR,
- "UndeclaredEntRefInAttrValue");
- }
- }
- else {
- // Text node
- isXMLCharWF(errorHandler, error, locator, child.getNodeValue(), xml11Version);
- }
- }
- }
- }
-
-
-
- /**
- * Reports a DOM error to the user handler.
- *
- * If the error is fatal, the processing will be always aborted.
- */
- public static final void reportDOMError(DOMErrorHandler errorHandler, DOMErrorImpl error, DOMLocatorImpl locator,
- String message, short severity, String type ) {
- if( errorHandler!=null ) {
- error.reset();
- error.fMessage = message;
- error.fSeverity = severity;
- error.fLocator = locator;
- error.fType = type;
- error.fRelatedData = locator.fRelatedNode;
-
- if(!errorHandler.handleError(error))
- throw new AbortException();
- }
- if( severity==DOMError.SEVERITY_FATAL_ERROR )
- throw new AbortException();
- }
-
- protected final void updateQName (Node node, QName qname){
-
- String prefix = node.getPrefix();
- String namespace = node.getNamespaceURI();
- String localName = node.getLocalName();
- // REVISIT: the symbols are added too often: start/endElement
- // and in the namespaceFixup. Should reduce number of calls to symbol table.
- qname.prefix = (prefix!=null && prefix.length()!=0)?fSymbolTable.addSymbol(prefix):null;
- qname.localpart = (localName != null)?fSymbolTable.addSymbol(localName):null;
- qname.rawname = fSymbolTable.addSymbol(node.getNodeName());
- qname.uri = (namespace != null)?fSymbolTable.addSymbol(namespace):null;
- }
-
-
-
- /* REVISIT: remove this method if DOM does not change spec.
- * Performs partial XML 1.0 attribute value normalization and replaces
- * attribute value if the value is changed after the normalization.
- * DOM defines that normalizeDocument acts as if the document was going
- * through a save and load cycle, given that serializer will not escape
- * any '\n' or '\r' characters on load those will be normalized.
- * Thus during normalize document we need to do the following:
- * - perform "2.11 End-of-Line Handling"
- * - replace #xD, #xA, #x9 with #x20 (white space).
- * Note: This alg. won't attempt to resolve entity references or character entity
- * references, since '&' will be escaped during serialization and during loading
- * this won't be recognized as entity reference, i.e. attribute value "&foo;" will
- * be serialized as "&amp;foo;" and thus after loading will be "&foo;" again.
- * @param value current attribute value
- * @param attr current attribute
- * @return String the value (could be original if normalization did not change
- * the string)
- */
- final String normalizeAttributeValue(String value, Attr attr) {
- if (!attr.getSpecified()){
- // specified attributes should already have a normalized form
- // since those were added by validator
- return value;
- }
- int end = value.length();
- // ensure capacity
- if (fNormalizedValue.ch.length < end) {
- fNormalizedValue.ch = new char[end];
- }
- fNormalizedValue.length = 0;
- boolean normalized = false;
- for (int i = 0; i < end; i++) {
- char c = value.charAt(i);
- if (c==0x0009 || c==0x000A) {
- fNormalizedValue.ch[fNormalizedValue.length++] = ' ';
- normalized = true;
- }
- else if(c==0x000D){
- normalized = true;
- fNormalizedValue.ch[fNormalizedValue.length++] = ' ';
- int next = i+1;
- if (next < end && value.charAt(next)==0x000A) i=next; // skip following xA
- }
- else {
- fNormalizedValue.ch[fNormalizedValue.length++] = c;
- }
- }
- if (normalized){
- value = fNormalizedValue.toString();
- attr.setValue(value);
- }
- return value;
- }
-
- protected final class XMLAttributesProxy
- implements XMLAttributes {
- protected AttributeMap fAttributes;
- protected CoreDocumentImpl fDocument;
- protected ElementImpl fElement;
-
- protected final Vector fAugmentations = new Vector(5);
-
-
- public void setAttributes(AttributeMap attributes, CoreDocumentImpl doc, ElementImpl elem) {
- fDocument = doc;
- fAttributes = attributes;
- fElement = elem;
- if (attributes != null) {
- int length = attributes.getLength();
-
- fAugmentations.setSize(length);
- // REVISIT: this implementation does not store any value in augmentations
- // and basically not keeping augs in parallel to attributes map
- // untill all attributes are added (default attributes)
- for (int i = 0; i < length; i++) {
- fAugmentations.setElementAt(new AugmentationsImpl(), i);
- }
- } else {
- fAugmentations.setSize(0);
- }
- }
-
-
- /**
- * This method adds default declarations
- * @see com.sun.org.apache.xerces.internal.xni.XMLAttributes#addAttribute(QName, String, String)
- */
- public int addAttribute(QName qname, String attrType, String attrValue) {
- int index = fElement.getXercesAttribute(qname.uri, qname.localpart);
- // add defaults to the tree
- if (index < 0) {
- // the default attribute was removed by a user and needed to
- // be added back
- AttrImpl attr = (AttrImpl)
- ((CoreDocumentImpl) fElement.getOwnerDocument()).createAttributeNS(
- qname.uri,
- qname.rawname,
- qname.localpart);
- // REVISIT: the following should also update ID table
- attr.setNodeValue(attrValue);
- index = fElement.setXercesAttributeNode(attr);
- fAugmentations.insertElementAt(new AugmentationsImpl(), index);
- attr.setSpecified(false);
- }
- else {
- // default attribute is in the tree
- // we don't need to do anything since prefix was already fixed
- // at the namespace fixup time and value must be same value, otherwise
- // attribute will be treated as specified and we will never reach
- // this method.
-
- }
- return index;
- }
-
-
- public void removeAllAttributes(){
- // REVISIT: implement
- }
-
-
- public void removeAttributeAt(int attrIndex){
- // REVISIT: implement
- }
-
-
- public int getLength(){
- return(fAttributes != null)?fAttributes.getLength():0;
- }
-
-
- public int getIndex(String qName){
- // REVISIT: implement
- return -1;
- }
-
- public int getIndex(String uri, String localPart){
- // REVISIT: implement
- return -1;
- }
-
- public void setName(int attrIndex, QName attrName){
- // REVISIT: implement
- }
-
- public void getName(int attrIndex, QName attrName){
- if (fAttributes !=null) {
- updateQName((Node)fAttributes.getItem(attrIndex), attrName);
- }
- }
-
- public String getPrefix(int index){
- // REVISIT: implement
- return null;
- }
-
-
- public String getURI(int index){
- // REVISIT: implement
- return null;
- }
-
-
- public String getLocalName(int index){
- // REVISIT: implement
- return null;
- }
-
-
- public String getQName(int index){
- // REVISIT: implement
- return null;
- }
-
- public QName getQualifiedName(int index){
- //return fAttributes.item(index).ge);
- return null;
- }
-
- public void setType(int attrIndex, String attrType){
- // REVISIT: implement
- }
-
-
- public String getType(int index){
- return "CDATA";
- }
-
-
- public String getType(String qName){
- return "CDATA";
- }
-
-
- public String getType(String uri, String localName){
- return "CDATA";
- }
-
-
- public void setValue(int attrIndex, String attrValue){
- // REVISIT: is this desired behaviour?
- // The values are updated in the case datatype-normalization is turned on
- // in this case we need to make sure that specified attributes stay specified
-
- if (fAttributes != null){
- AttrImpl attr = (AttrImpl)fAttributes.getItem(attrIndex);
- boolean specified = attr.getSpecified();
- attr.setValue(attrValue);
- attr.setSpecified(specified);
-
- }
- }
-
- public void setValue(int attrIndex, String attrValue, XMLString value){
- setValue(attrIndex, value.toString());
- }
-
- public String getValue(int index){
- return (fAttributes !=null)?fAttributes.item(index).getNodeValue():"";
-
- }
-
-
- public String getValue(String qName){
- // REVISIT: implement
- return null;
- }
-
-
- public String getValue(String uri, String localName){
- if (fAttributes != null) {
- Node node = fAttributes.getNamedItemNS(uri, localName);
- return(node != null)? node.getNodeValue():null;
- }
- return null;
- }
-
-
- public void setNonNormalizedValue(int attrIndex, String attrValue){
- // REVISIT: implement
-
- }
-
-
- public String getNonNormalizedValue(int attrIndex){
- // REVISIT: implement
- return null;
- }
-
-
- public void setSpecified(int attrIndex, boolean specified){
- AttrImpl attr = (AttrImpl)fAttributes.getItem(attrIndex);
- attr.setSpecified(specified);
- }
-
- public boolean isSpecified(int attrIndex){
- return((Attr)fAttributes.getItem(attrIndex)).getSpecified();
- }
-
- public Augmentations getAugmentations (int attributeIndex){
- return(Augmentations)fAugmentations.elementAt(attributeIndex);
- }
-
- public Augmentations getAugmentations (String uri, String localPart){
- // REVISIT: implement
- return null;
- }
-
- public Augmentations getAugmentations(String qName){
- // REVISIT: implement
- return null;
- }
-
- /**
- * Sets the augmentations of the attribute at the specified index.
- *
- * @param attrIndex The attribute index.
- * @param augs The augmentations.
- */
- public void setAugmentations(int attrIndex, Augmentations augs) {
- fAugmentations.setElementAt(augs, attrIndex);
- }
- }
-
- //
- // XMLDocumentHandler methods
- //
-
- /**
- * The start of the document.
- *
- * @param locator The document locator, or null if the document
- * location cannot be reported during the parsing
- * of this document. However, it is <em>strongly</em>
- * recommended that a locator be supplied that can
- * at least report the system identifier of the
- * document.
- * @param encoding The auto-detected IANA encoding name of the entity
- * stream. This value will be null in those situations
- * where the entity encoding is not auto-detected (e.g.
- * internal entities or a document entity that is
- * parsed from a java.io.Reader).
- * @param namespaceContext
- * The namespace context in effect at the
- * start of this document.
- * This object represents the current context.
- * Implementors of this class are responsible
- * for copying the namespace bindings from the
- * the current context (and its parent contexts)
- * if that information is important.
- *
- * @param augs Additional information that may include infoset augmentations
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void startDocument(XMLLocator locator, String encoding,
- NamespaceContext namespaceContext,
- Augmentations augs)
- throws XNIException{
- }
-
- /**
- * Notifies of the presence of an XMLDecl line in the document. If
- * present, this method will be called immediately following the
- * startDocument call.
- *
- * @param version The XML version.
- * @param encoding The IANA encoding name of the document, or null if
- * not specified.
- * @param standalone The standalone value, or null if not specified.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void xmlDecl(String version, String encoding, String standalone, Augmentations augs)
- throws XNIException{
- }
-
- /**
- * Notifies of the presence of the DOCTYPE line in the document.
- *
- * @param rootElement
- * The name of the root element.
- * @param publicId The public identifier if an external DTD or null
- * if the external DTD is specified using SYSTEM.
- * @param systemId The system identifier if an external DTD, null
- * otherwise.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void doctypeDecl(String rootElement, String publicId, String systemId, Augmentations augs)
- throws XNIException{
- }
-
- /**
- * A comment.
- *
- * @param text The text in the comment.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by application to signal an error.
- */
- public void comment(XMLString text, Augmentations augs) throws XNIException{
- }
-
- /**
- * A processing instruction. Processing instructions consist of a
- * target name and, optionally, text data. The data is only meaningful
- * to the application.
- * <p>
- * Typically, a processing instruction's data will contain a series
- * of pseudo-attributes. These pseudo-attributes follow the form of
- * element attributes but are <strong>not</strong> parsed or presented
- * to the application as anything other than text. The application is
- * responsible for parsing the data.
- *
- * @param target The target.
- * @param data The data or null if none specified.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void processingInstruction(String target, XMLString data, Augmentations augs)
- throws XNIException{
- }
-
- /**
- * The start of an element.
- *
- * @param element The name of the element.
- * @param attributes The element attributes.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void startElement(QName element, XMLAttributes attributes, Augmentations augs)
- throws XNIException {
- Element currentElement = (Element) fCurrentNode;
- int attrCount = attributes.getLength();
- if (DEBUG_EVENTS) {
- System.out.println("==>startElement: " +element+
- " attrs.length="+attrCount);
- }
-
- for (int i = 0; i < attrCount; i++) {
- attributes.getName(i, fAttrQName);
- Attr attr = null;
-
- attr = currentElement.getAttributeNodeNS(fAttrQName.uri, fAttrQName.localpart);
- AttributePSVI attrPSVI =
- (AttributePSVI) attributes.getAugmentations(i).getItem(Constants.ATTRIBUTE_PSVI);
-
- if (attrPSVI != null) {
- //REVISIT: instead we should be using augmentations:
- // to set/retrieve Id attributes
- XSTypeDefinition decl = attrPSVI.getMemberTypeDefinition();
- boolean id = false;
- if (decl != null){
- id = ((XSSimpleType)decl).isIDType();
- } else{
- decl = attrPSVI.getTypeDefinition();
- if (decl !=null){
- id = ((XSSimpleType)decl).isIDType();
- }
- }
- if (id){
- ((ElementImpl)currentElement).setIdAttributeNode(attr, true);
- }
-
- if (fPSVI) {
- ((PSVIAttrNSImpl) attr).setPSVI(attrPSVI);
- }
- if ((fConfiguration.features & DOMConfigurationImpl.DTNORMALIZATION) != 0) {
- // datatype-normalization
- // NOTE: The specified value MUST be set after we set
- // the node value because that turns the "specified"
- // flag to "true" which may overwrite a "false"
- // value from the attribute list.
- boolean specified = attr.getSpecified();
- attr.setValue(attrPSVI.getSchemaNormalizedValue());
- if (!specified) {
- ((AttrImpl) attr).setSpecified(specified);
- }
- }
- }
- }
- }
-
-
- /**
- * An empty element.
- *
- * @param element The name of the element.
- * @param attributes The element attributes.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void emptyElement(QName element, XMLAttributes attributes, Augmentations augs)
- throws XNIException {
- if (DEBUG_EVENTS) {
- System.out.println("==>emptyElement: " +element);
- }
-
- startElement(element, attributes, augs);
- endElement(element, augs);
- }
-
- /**
- * This method notifies the start of a general entity.
- * <p>
- * <strong>Note:</strong> This method is not called for entity references
- * appearing as part of attribute values.
- *
- * @param name The name of the general entity.
- * @param identifier The resource identifier.
- * @param encoding The auto-detected IANA encoding name of the entity
- * stream. This value will be null in those situations
- * where the entity encoding is not auto-detected (e.g.
- * internal entities or a document entity that is
- * parsed from a java.io.Reader).
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException Thrown by handler to signal an error.
- */
- public void startGeneralEntity(String name,
- XMLResourceIdentifier identifier,
- String encoding,
- Augmentations augs) throws XNIException{
- }
-
- /**
- * Notifies of the presence of a TextDecl line in an entity. If present,
- * this method will be called immediately following the startEntity call.
- * <p>
- * <strong>Note:</strong> This method will never be called for the
- * document entity; it is only called for external general entities
- * referenced in document content.
- * <p>
- * <strong>Note:</strong> This method is not called for entity references
- * appearing as part of attribute values.
- *
- * @param version The XML version, or null if not specified.
- * @param encoding The IANA encoding name of the entity.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void textDecl(String version, String encoding, Augmentations augs) throws XNIException{
- }
-
- /**
- * This method notifies the end of a general entity.
- * <p>
- * <strong>Note:</strong> This method is not called for entity references
- * appearing as part of attribute values.
- *
- * @param name The name of the entity.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void endGeneralEntity(String name, Augmentations augs) throws XNIException{
- }
-
- /**
- * Character content.
- *
- * @param text The content.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void characters(XMLString text, Augmentations augs) throws XNIException{
- }
-
- /**
- * Ignorable whitespace. For this method to be called, the document
- * source must have some way of determining that the text containing
- * only whitespace characters should be considered ignorable. For
- * example, the validator can determine if a length of whitespace
- * characters in the document are ignorable based on the element
- * content model.
- *
- * @param text The ignorable whitespace.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void ignorableWhitespace(XMLString text, Augmentations augs) throws XNIException{
- allWhitespace = true;
- }
-
- /**
- * The end of an element.
- *
- * @param element The name of the element.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void endElement(QName element, Augmentations augs) throws XNIException {
- if (DEBUG_EVENTS) {
- System.out.println("==>endElement: " + element);
- }
-
- if(augs != null) {
- ElementPSVI elementPSVI = (ElementPSVI) augs.getItem(Constants.ELEMENT_PSVI);
- if (elementPSVI != null) {
- ElementImpl elementNode = (ElementImpl) fCurrentNode;
- if (fPSVI) {
- ((PSVIElementNSImpl) fCurrentNode).setPSVI(elementPSVI);
- }
- // include element default content (if one is available)
- String normalizedValue = elementPSVI.getSchemaNormalizedValue();
- if ((fConfiguration.features & DOMConfigurationImpl.DTNORMALIZATION) != 0) {
- if (normalizedValue !=null)
- elementNode.setTextContent(normalizedValue);
- }
- else {
- // NOTE: this is a hack: it is possible that DOM had an empty element
- // and validator sent default value using characters(), which we don't
- // implement. Thus, here we attempt to add the default value.
- String text = elementNode.getTextContent();
- if (text.length() == 0) {
- // default content could be provided
- if (normalizedValue !=null)
- elementNode.setTextContent(normalizedValue);
- }
- }
- }
- }
- }
-
-
- /**
- * The start of a CDATA section.
- *
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void startCDATA(Augmentations augs) throws XNIException{
- }
-
- /**
- * The end of a CDATA section.
- *
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void endCDATA(Augmentations augs) throws XNIException{
- }
-
- /**
- * The end of the document.
- *
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void endDocument(Augmentations augs) throws XNIException{
- }
-
-
- /** Sets the document source. */
- public void setDocumentSource(XMLDocumentSource source){
- }
-
-
- /** Returns the document source. */
- public XMLDocumentSource getDocumentSource(){
- return null;
- }
-
-} // DOMNormalizer class
diff --git a/src/com/sun/org/apache/xerces/internal/dom/DOMOutputImpl.java b/src/com/sun/org/apache/xerces/internal/dom/DOMOutputImpl.java
deleted file mode 100644
index c924916..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/DOMOutputImpl.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-import org.w3c.dom.ls.LSOutput;
-
-import java.io.Writer;
-import java.io.OutputStream;
-
-/**
- * This class represents an output destination for data.
- * This interface allows an application to encapsulate information about an
- * output destination in a single object, which may include a URI, a byte stream
- * (possibly with a specifiedencoding), a base URI, and/or a character stream.
- * The exact definitions of a byte stream and a character stream are binding
- * dependent.
- * The application is expected to provide objects that implement this interface
- * whenever such objects are needed. The application can either provide its
- * own objects that implement this interface, or it can use the generic factory
- * method DOMImplementationLS.createLSOutput() to create objects that
- * implement this interface.
- * The DOMSerializer will use the LSOutput object to determine where to
- * serialize the output to. The DOMSerializer will look at the different
- * outputs specified in the LSOutput in the following order to know which one
- * to output to, the first one that data can be output to will be used:
- * 1.LSOutput.characterStream
- * 2.LSOutput.byteStream
- * 3.LSOutput.systemId
- * LSOutput objects belong to the application. The DOM implementation will
- * never modify them (though it may make copies and modify the copies,
- * if necessary).
- *
- * @xerces.internal
- *
- * @author Arun Yadav, Sun Microsytems
- * @author Gopal Sharma, Sun Microsystems
- **/
-
-public class DOMOutputImpl implements LSOutput {
-
- protected Writer fCharStream = null;
- protected OutputStream fByteStream = null;
- protected String fSystemId = null;
- protected String fEncoding = null;
-
- /**
- * Default Constructor
- */
- public DOMOutputImpl() {}
-
- /**
- * An attribute of a language and binding dependent type that represents a
- * writable stream of bytes. If the application knows the character encoding
- * of the byte stream, it should set the encoding attribute. Setting the
- * encoding in this way will override any encoding specified in an XML
- * declaration in the data.
- */
-
- public Writer getCharacterStream(){
- return fCharStream;
- };
-
- /**
- * An attribute of a language and binding dependent type that represents a
- * writable stream of bytes. If the application knows the character encoding
- * of the byte stream, it should set the encoding attribute. Setting the
- * encoding in this way will override any encoding specified in an XML
- * declaration in the data.
- */
-
- public void setCharacterStream(Writer characterStream){
- fCharStream = characterStream;
- };
-
- /**
- * Depending on the language binding in use, this attribute may not be
- * available. An attribute of a language and binding dependent type that
- * represents a writable stream to which 16-bit units can be output. The
- * application must encode the stream using UTF-16 (defined in [Unicode] and
- * Amendment 1 of [ISO/IEC 10646]).
- */
-
- public OutputStream getByteStream(){
- return fByteStream;
- };
-
- /**
- * Depending on the language binding in use, this attribute may not be
- * available. An attribute of a language and binding dependent type that
- * represents a writable stream to which 16-bit units can be output. The
- * application must encode the stream using UTF-16 (defined in [Unicode] and
- * Amendment 1 of [ISO/IEC 10646]).
- */
-
- public void setByteStream(OutputStream byteStream){
- fByteStream = byteStream;
- };
-
- /**
- * The system identifier, a URI reference [IETF RFC 2396], for this output
- * destination. If the application knows the character encoding of the
- * object pointed to by the system identifier, it can set the encoding
- * using the encoding attribute. If the system ID is a relative URI
- * reference (see section 5 in [IETF RFC 2396]), the behavior is
- * implementation dependent.
- */
-
- public String getSystemId(){
- return fSystemId;
- };
-
- /**
- * The system identifier, a URI reference [IETF RFC 2396], for this output
- * destination. If the application knows the character encoding of the
- * object pointed to by the system identifier, it can set the encoding
- * using the encoding attribute. If the system ID is a relative URI
- * reference (see section 5 in [IETF RFC 2396]), the behavior is
- * implementation dependent.
- */
-
- public void setSystemId(String systemId){
- fSystemId = systemId;
- };
-
- /**
- * The character encoding, if known. The encoding must be a string
- * acceptable for an XML encoding declaration ([XML 1.0] section 4.3.3
- * "Character Encoding in Entities"). This attribute has no effect when the
- * application provides a character stream or string data. For other sources
- * of input, an encoding specified by means of this attribute will override
- * any encoding specified in the XML declaration or the Text declaration, or
- * an encoding obtained from a higher level protocol, such as HTTP
- * [IETF RFC 2616].
- */
-
- public String getEncoding(){
- return fEncoding;
- };
-
- /**
- * The character encoding, if known. The encoding must be a string
- * acceptable for an XML encoding declaration ([XML 1.0] section 4.3.3
- * "Character Encoding in Entities"). This attribute has no effect when the
- * application provides a character stream or string data. For other sources
- * of input, an encoding specified by means of this attribute will override
- * any encoding specified in the XML declaration or the Text declaration, or
- * an encoding obtained from a higher level protocol, such as HTTP
- * [IETF RFC 2616].
- */
-
- public void setEncoding(String encoding){
- fEncoding = encoding;
- };
-
-}//DOMOutputImpl
diff --git a/src/com/sun/org/apache/xerces/internal/dom/DOMStringListImpl.java b/src/com/sun/org/apache/xerces/internal/dom/DOMStringListImpl.java
deleted file mode 100644
index c5ce5ec..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/DOMStringListImpl.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-import java.util.Vector;
-
-import org.w3c.dom.DOMStringList;
-
-/**
- * DOM Level 3
- *
- * This class implements the DOM Level 3 Core interface DOMStringList.
- *
- * @xerces.internal
- *
- * @author Neil Delima, IBM
- */
-public class DOMStringListImpl implements DOMStringList {
-
- //A collection of DOMString values
- private Vector fStrings;
-
- /**
- * Construct an empty list of DOMStringListImpl
- */
- public DOMStringListImpl() {
- fStrings = new Vector();
- }
-
- /**
- * Construct an empty list of DOMStringListImpl
- */
- public DOMStringListImpl(Vector params) {
- fStrings = params;
- }
-
- /**
- * @see org.w3c.dom.DOMStringList#item(int)
- */
- public String item(int index) {
- try {
- return (String) fStrings.elementAt(index);
- } catch (ArrayIndexOutOfBoundsException e) {
- return null;
- }
- }
-
- /**
- * @see org.w3c.dom.DOMStringList#getLength()
- */
- public int getLength() {
- return fStrings.size();
- }
-
- /**
- * @see org.w3c.dom.DOMStringList#contains(String)
- */
- public boolean contains(String param) {
- return fStrings.contains(param) ;
- }
-
- /**
- * DOM Internal:
- * Add a <code>DOMString</code> to the list.
- *
- * @param domString A string to add to the list
- */
- public void add(String param) {
- fStrings.add(param);
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/dom/DOMXSImplementationSourceImpl.java b/src/com/sun/org/apache/xerces/internal/dom/DOMXSImplementationSourceImpl.java
deleted file mode 100644
index 34a311a..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/DOMXSImplementationSourceImpl.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-import com.sun.org.apache.xerces.internal.impl.xs.XSImplementationImpl;
-import org.w3c.dom.DOMImplementationList;
-import org.w3c.dom.DOMImplementation;
-import java.util.Vector;
-
-/**
- * Allows to retrieve <code>XSImplementation</code>, DOM Level 3 Core and LS implementations
- * and PSVI implementation.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#DOMImplementationSource'>Document Object Model (DOM) Level 3 Core Specification</a>.
- *
- * @xerces.internal
- *
- * @author Elena Litani, IBM
- */
-public class DOMXSImplementationSourceImpl
- extends DOMImplementationSourceImpl {
-
- /**
- * A method to request a DOM implementation.
- * @param features A string that specifies which features are required.
- * This is a space separated list in which each feature is specified
- * by its name optionally followed by a space and a version number.
- * This is something like: "XML 1.0 Traversal Events 2.0"
- * @return An implementation that has the desired features, or
- * <code>null</code> if this source has none.
- */
- public DOMImplementation getDOMImplementation(String features) {
- DOMImplementation impl = super.getDOMImplementation(features);
- if (impl != null){
- return impl;
- }
- // if not try the PSVIDOMImplementation
- impl = PSVIDOMImplementationImpl.getDOMImplementation();
- if (testImpl(impl, features)) {
- return impl;
- }
- // if not try the XSImplementation
- impl = XSImplementationImpl.getDOMImplementation();
- if (testImpl(impl, features)) {
- return impl;
- }
-
- return null;
- }
-
- /**
- * A method to request a list of DOM implementations that support the
- * specified features and versions, as specified in .
- * @param features A string that specifies which features and versions
- * are required. This is a space separated list in which each feature
- * is specified by its name optionally followed by a space and a
- * version number. This is something like: "XML 3.0 Traversal +Events
- * 2.0"
- * @return A list of DOM implementations that support the desired
- * features.
- */
- public DOMImplementationList getDOMImplementationList(String features) {
- final Vector implementations = new Vector();
-
- // first check whether the CoreDOMImplementation would do
- DOMImplementationList list = super.getDOMImplementationList(features);
- //Add core DOMImplementations
- for (int i=0; i < list.getLength(); i++ ) {
- implementations.addElement(list.item(i));
- }
-
- DOMImplementation impl = PSVIDOMImplementationImpl.getDOMImplementation();
- if (testImpl(impl, features)) {
- implementations.addElement(impl);
- }
-
- impl = XSImplementationImpl.getDOMImplementation();
- if (testImpl(impl, features)) {
- implementations.addElement(impl);
- }
- return new DOMImplementationListImpl(implementations);
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/dom/DeepNodeListImpl.java b/src/com/sun/org/apache/xerces/internal/dom/DeepNodeListImpl.java
deleted file mode 100644
index 1acf62e..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/DeepNodeListImpl.java
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import java.util.Vector;
-
-/**
- * This class implements the DOM's NodeList behavior for
- * Element.getElementsByTagName()
- * <P>
- * The DOM describes NodeList as follows:
- * <P>
- * 1) It may represent EITHER nodes scattered through a subtree (when
- * returned by Element.getElementsByTagName), or just the immediate
- * children (when returned by Node.getChildNodes). The latter is easy,
- * but the former (which this class addresses) is more challenging.
- * <P>
- * 2) Its behavior is "live" -- that is, it always reflects the
- * current state of the document tree. To put it another way, the
- * NodeLists obtained before and after a series of insertions and
- * deletions are effectively identical (as far as the user is
- * concerned, the former has been dynamically updated as the changes
- * have been made).
- * <P>
- * 3) Its API accesses individual nodes via an integer index, with the
- * listed nodes numbered sequentially in the order that they were
- * found during a preorder depth-first left-to-right search of the tree.
- * (Of course in the case of getChildNodes, depth is not involved.) As
- * nodes are inserted or deleted in the tree, and hence the NodeList,
- * the numbering of nodes that follow them in the NodeList will
- * change.
- * <P>
- * It is rather painful to support the latter two in the
- * getElementsByTagName case. The current solution is for Nodes to
- * maintain a change count (eventually that may be a Digest instead),
- * which the NodeList tracks and uses to invalidate itself.
- * <P>
- * Unfortunately, this does _not_ respond efficiently in the case that
- * the dynamic behavior was supposed to address: scanning a tree while
- * it is being extended. That requires knowing which subtrees have
- * changed, which can become an arbitrarily complex problem.
- * <P>
- * We save some work by filling the vector only as we access the
- * item()s... but I suspect the same users who demanded index-based
- * access will also start by doing a getLength() to control their loop,
- * blowing this optimization out of the water.
- * <P>
- * NOTE: Level 2 of the DOM will probably _not_ use NodeList for its
- * extended search mechanisms, partly for the reasons just discussed.
- *
- * @xerces.internal
- *
- * @since PR-DOM-Level-1-19980818.
- */
-public class DeepNodeListImpl
- implements NodeList {
-
- //
- // Data
- //
-
- protected NodeImpl rootNode; // Where the search started
- protected String tagName; // Or "*" to mean all-tags-acceptable
- protected int changes=0;
- protected Vector nodes;
-
- protected String nsName;
- protected boolean enableNS = false;
-
- //
- // Constructors
- //
-
- /** Constructor. */
- public DeepNodeListImpl(NodeImpl rootNode, String tagName) {
- this.rootNode = rootNode;
- this.tagName = tagName;
- nodes = new Vector();
- }
-
- /** Constructor for Namespace support. */
- public DeepNodeListImpl(NodeImpl rootNode,
- String nsName, String tagName) {
- this(rootNode, tagName);
- this.nsName = (nsName != null && !nsName.equals("")) ? nsName : null;
- enableNS = true;
- }
-
- //
- // NodeList methods
- //
-
- /** Returns the length of the node list. */
- public int getLength() {
- // Preload all matching elements. (Stops when we run out of subtree!)
- item(java.lang.Integer.MAX_VALUE);
- return nodes.size();
- }
-
- /** Returns the node at the specified index. */
- public Node item(int index) {
- Node thisNode;
-
- // Tree changed. Do it all from scratch!
- if(rootNode.changes() != changes) {
- nodes = new Vector();
- changes = rootNode.changes();
- }
-
- // In the cache
- if (index < nodes.size())
- return (Node)nodes.elementAt(index);
-
- // Not yet seen
- else {
-
- // Pick up where we left off (Which may be the beginning)
- if (nodes.size() == 0)
- thisNode = rootNode;
- else
- thisNode=(NodeImpl)(nodes.lastElement());
-
- // Add nodes up to the one we're looking for
- while(thisNode != null && index >= nodes.size()) {
- thisNode=nextMatchingElementAfter(thisNode);
- if (thisNode != null)
- nodes.addElement(thisNode);
- }
-
- // Either what we want, or null (not avail.)
- return thisNode;
- }
-
- } // item(int):Node
-
- //
- // Protected methods (might be overridden by an extending DOM)
- //
-
- /**
- * Iterative tree-walker. When you have a Parent link, there's often no
- * need to resort to recursion. NOTE THAT only Element nodes are matched
- * since we're specifically supporting getElementsByTagName().
- */
- protected Node nextMatchingElementAfter(Node current) {
-
- Node next;
- while (current != null) {
- // Look down to first child.
- if (current.hasChildNodes()) {
- current = (current.getFirstChild());
- }
-
- // Look right to sibling (but not from root!)
- else if (current != rootNode && null != (next = current.getNextSibling())) {
- current = next;
- }
-
- // Look up and right (but not past root!)
- else {
- next = null;
- for (; current != rootNode; // Stop when we return to starting point
- current = current.getParentNode()) {
-
- next = current.getNextSibling();
- if (next != null)
- break;
- }
- current = next;
- }
-
- // Have we found an Element with the right tagName?
- // ("*" matches anything.)
- if (current != rootNode
- && current != null
- && current.getNodeType() == Node.ELEMENT_NODE) {
- if (!enableNS) {
- if (tagName.equals("*") ||
- ((ElementImpl) current).getTagName().equals(tagName))
- {
- return current;
- }
- } else {
- // DOM2: Namespace logic.
- if (tagName.equals("*")) {
- if (nsName != null && nsName.equals("*")) {
- return current;
- } else {
- ElementImpl el = (ElementImpl) current;
- if ((nsName == null
- && el.getNamespaceURI() == null)
- || (nsName != null
- && nsName.equals(el.getNamespaceURI())))
- {
- return current;
- }
- }
- } else {
- ElementImpl el = (ElementImpl) current;
- if (el.getLocalName() != null
- && el.getLocalName().equals(tagName)) {
- if (nsName != null && nsName.equals("*")) {
- return current;
- } else {
- if ((nsName == null
- && el.getNamespaceURI() == null)
- || (nsName != null &&
- nsName.equals(el.getNamespaceURI())))
- {
- return current;
- }
- }
- }
- }
- }
- }
-
- // Otherwise continue walking the tree
- }
-
- // Fell out of tree-walk; no more instances found
- return null;
-
- } // nextMatchingElementAfter(int):Node
-
-} // class DeepNodeListImpl
diff --git a/src/com/sun/org/apache/xerces/internal/dom/DeferredAttrImpl.java b/src/com/sun/org/apache/xerces/internal/dom/DeferredAttrImpl.java
deleted file mode 100644
index c3e1342..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/DeferredAttrImpl.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- * WARNING: because java doesn't support multi-inheritance some code is
- * duplicated. If you're changing this file you probably want to change
- * DeferredAttrNSImpl.java at the same time.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-/**
- * Attribute represents an XML-style attribute of an
- * Element. Typically, the allowable values are controlled by its
- * declaration in the Document Type Definition (DTD) governing this
- * kind of document.
- * <P>
- * If the attribute has not been explicitly assigned a value, but has
- * been declared in the DTD, it will exist and have that default. Only
- * if neither the document nor the DTD specifies a value will the
- * Attribute really be considered absent and have no value; in that
- * case, querying the attribute will return null.
- * <P>
- * Attributes may have multiple children that contain their data. (XML
- * allows attributes to contain entity references, and tokenized
- * attribute types such as NMTOKENS may have a child for each token.)
- * For convenience, the Attribute object's getValue() method returns
- * the string version of the attribute's value.
- * <P>
- * Attributes are not children of the Elements they belong to, in the
- * usual sense, and have no valid Parent reference. However, the spec
- * says they _do_ belong to a specific Element, and an INUSE exception
- * is to be thrown if the user attempts to explicitly share them
- * between elements.
- * <P>
- * Note that Elements do not permit attributes to appear to be shared
- * (see the INUSE exception), so this object's mutability is
- * officially not an issue.
- * <P>
- * DeferredAttrImpl inherits from AttrImpl which does not support
- * Namespaces. DeferredAttrNSImpl, which inherits from AttrNSImpl, does.
- * @see DeferredAttrNSImpl
- *
- * @xerces.internal
- *
- * @author Andy Clark, IBM
- * @author Arnaud Le Hors, IBM
- * @since PR-DOM-Level-1-19980818.
- */
-public final class DeferredAttrImpl
- extends AttrImpl
- implements DeferredNode {
-
- //
- // Constants
- //
-
- /** Serialization version. */
- static final long serialVersionUID = 6903232312469148636L;
-
- //
- // Data
- //
-
- /** Node index. */
- protected transient int fNodeIndex;
-
- //
- // Constructors
- //
-
- /**
- * This is the deferred constructor. Only the fNodeIndex is given here.
- * All other data, can be requested from the ownerDocument via the index.
- */
- DeferredAttrImpl(DeferredDocumentImpl ownerDocument, int nodeIndex) {
- super(ownerDocument, null);
-
- fNodeIndex = nodeIndex;
- needsSyncData(true);
- needsSyncChildren(true);
-
- } // <init>(DeferredDocumentImpl,int)
-
- //
- // DeferredNode methods
- //
-
- /** Returns the node index. */
- public int getNodeIndex() {
- return fNodeIndex;
- }
-
- //
- // Protected methods
- //
-
- /** Synchronizes the data (name and value) for fast nodes. */
- protected void synchronizeData() {
-
- // no need to sync in the future
- needsSyncData(false);
-
- // fluff data
- DeferredDocumentImpl ownerDocument =
- (DeferredDocumentImpl) ownerDocument();
- name = ownerDocument.getNodeName(fNodeIndex);
- int extra = ownerDocument.getNodeExtra(fNodeIndex);
- isSpecified((extra & SPECIFIED) != 0);
- isIdAttribute((extra & ID) != 0);
-
- int extraNode = ownerDocument.getLastChild(fNodeIndex);
- type = ownerDocument.getTypeInfo(extraNode);
- } // synchronizeData()
-
- /**
- * Synchronizes the node's children with the internal structure.
- * Fluffing the children at once solves a lot of work to keep
- * the two structures in sync. The problem gets worse when
- * editing the tree -- this makes it a lot easier.
- */
- protected void synchronizeChildren() {
- DeferredDocumentImpl ownerDocument =
- (DeferredDocumentImpl) ownerDocument();
- ownerDocument.synchronizeChildren(this, fNodeIndex);
- } // synchronizeChildren()
-
-} // class DeferredAttrImpl
diff --git a/src/com/sun/org/apache/xerces/internal/dom/DeferredAttrNSImpl.java b/src/com/sun/org/apache/xerces/internal/dom/DeferredAttrNSImpl.java
deleted file mode 100644
index 3b40521..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/DeferredAttrNSImpl.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- * WARNING: because java doesn't support multi-inheritance some code is
- * duplicated. If you're changing this file you probably want to change
- * DeferredAttrImpl.java at the same time.
- */
-
-
-package com.sun.org.apache.xerces.internal.dom;
-
-/**
- * DeferredAttrNSImpl is to AttrNSImpl, what DeferredAttrImpl is to
- * AttrImpl.
- *
- * @xerces.internal
- *
- * @author Andy Clark, IBM
- * @author Arnaud Le Hors, IBM
- * @see DeferredAttrImpl
- */
-public final class DeferredAttrNSImpl
- extends AttrNSImpl
- implements DeferredNode {
-
- //
- // Constants
- //
-
- /** Serialization version. */
- static final long serialVersionUID = 6074924934945957154L;
-
- //
- // Data
- //
-
- /** Node index. */
- protected transient int fNodeIndex;
-
- //
- // Constructors
- //
-
- /**
- * This is the deferred constructor. Only the fNodeIndex is given here.
- * All other data, can be requested from the ownerDocument via the index.
- */
- DeferredAttrNSImpl(DeferredDocumentImpl ownerDocument, int nodeIndex) {
- super(ownerDocument, null);
-
- fNodeIndex = nodeIndex;
- needsSyncData(true);
- needsSyncChildren(true);
-
- } // <init>(DeferredDocumentImpl,int)
-
- //
- // DeferredNode methods
- //
-
- /** Returns the node index. */
- public int getNodeIndex() {
- return fNodeIndex;
- }
-
- //
- // Protected methods
- //
-
- /** Synchronizes the data (name and value) for fast nodes. */
- protected void synchronizeData() {
-
- // no need to sync in the future
- needsSyncData(false);
-
- // fluff data
- DeferredDocumentImpl ownerDocument =
- (DeferredDocumentImpl) ownerDocument();
- name = ownerDocument.getNodeName(fNodeIndex);
-
- // extract prefix and local part from QName
- int index = name.indexOf(':');
- if (index < 0) {
- localName = name;
- }
- else {
- localName = name.substring(index + 1);
- }
-
- int extra = ownerDocument.getNodeExtra(fNodeIndex);
- isSpecified((extra & SPECIFIED) != 0);
- isIdAttribute((extra & ID) != 0);
-
- namespaceURI = ownerDocument.getNodeURI(fNodeIndex);
-
- int extraNode = ownerDocument.getLastChild(fNodeIndex);
- type = ownerDocument.getTypeInfo(extraNode);
- } // synchronizeData()
-
- /**
- * Synchronizes the node's children with the internal structure.
- * Fluffing the children at once solves a lot of work to keep
- * the two structures in sync. The problem gets worse when
- * editing the tree -- this makes it a lot easier.
- */
- protected void synchronizeChildren() {
- DeferredDocumentImpl ownerDocument =
- (DeferredDocumentImpl) ownerDocument();
- ownerDocument.synchronizeChildren(this, fNodeIndex);
- } // synchronizeChildren()
-
-} // class DeferredAttrImpl
diff --git a/src/com/sun/org/apache/xerces/internal/dom/DeferredCDATASectionImpl.java b/src/com/sun/org/apache/xerces/internal/dom/DeferredCDATASectionImpl.java
deleted file mode 100644
index 52132f0..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/DeferredCDATASectionImpl.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-/**
- * XML provides the CDATA markup to allow a region of text in which
- * most of the XML delimiter recognition does not take place. This is
- * intended to ease the task of quoting XML fragments and other
- * programmatic information in a document's text without needing to
- * escape these special characters. It's primarily a convenience feature
- * for those who are hand-editing XML.
- * <P>
- * CDATASection is an Extended DOM feature, and is not used in HTML
- * contexts.
- * <P>
- * Within the DOM, CDATASections are treated essentially as Text
- * blocks. Their distinct type is retained in order to allow us to
- * properly recreate the XML syntax when we write them out.
- * <P>
- * Reminder: CDATA IS NOT A COMPLETELY GENERAL SOLUTION; it can't
- * quote its own end-of-block marking. If you need to write out a
- * CDATA that contains the ]]> sequence, it's your responsibility to
- * split that string over two successive CDATAs at that time.
- * <P>
- * CDATA does not participate in Element.normalize() processing.
- *
- * @xerces.internal
- *
- * @since PR-DOM-Level-1-19980818.
- */
-public class DeferredCDATASectionImpl
- extends CDATASectionImpl
- implements DeferredNode {
-
- //
- // Constants
- //
-
- /** Serialization version. */
- static final long serialVersionUID = 1983580632355645726L;
-
- //
- // Data
- //
-
- /** Node index. */
- protected transient int fNodeIndex;
-
- //
- // Constructors
- //
-
- /**
- * This is the deferred constructor. Only the fNodeIndex is given here. All other data,
- * can be requested from the ownerDocument via the index.
- */
- DeferredCDATASectionImpl(DeferredDocumentImpl ownerDocument, int nodeIndex) {
- super(ownerDocument, null);
-
- fNodeIndex = nodeIndex;
- needsSyncData(true);
-
- } // <init>(DeferredDocumentImpl,int)
-
- //
- // DeferredNode methods
- //
-
- /** Returns the node index. */
- public int getNodeIndex() {
- return fNodeIndex;
- }
-
- //
- // Protected methods
- //
-
- /** Synchronizes the data (name and value) for fast nodes. */
- protected void synchronizeData() {
-
- // no need to sync in the future
- needsSyncData(false);
-
- // fluff data
- DeferredDocumentImpl ownerDocument =
- (DeferredDocumentImpl) this.ownerDocument();
- data = ownerDocument.getNodeValueString(fNodeIndex);
-
- } // synchronizeData()
-
-} // class DeferredCDATASectionImpl
diff --git a/src/com/sun/org/apache/xerces/internal/dom/DeferredCommentImpl.java b/src/com/sun/org/apache/xerces/internal/dom/DeferredCommentImpl.java
deleted file mode 100644
index 3f80492..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/DeferredCommentImpl.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-/**
- * Represents an XML (or HTML) comment.
- *
- * @xerces.internal
- *
- * @since PR-DOM-Level-1-19980818.
- */
-public class DeferredCommentImpl
- extends CommentImpl
- implements DeferredNode {
-
- //
- // Constants
- //
-
- /** Serialization version. */
- static final long serialVersionUID = 6498796371083589338L;
-
- //
- // Data
- //
-
- /** Node index. */
- protected transient int fNodeIndex;
-
- //
- // Constructors
- //
-
- /**
- * This is the deferred constructor. Only the fNodeIndex is given here. All other data,
- * can be requested from the ownerDocument via the index.
- */
- DeferredCommentImpl(DeferredDocumentImpl ownerDocument, int nodeIndex) {
- super(ownerDocument, null);
-
- fNodeIndex = nodeIndex;
- needsSyncData(true);
-
- } // <init>(DeferredDocumentImpl,int)
-
- //
- // DeferredNode methods
- //
-
- /** Returns the node index. */
- public int getNodeIndex() {
- return fNodeIndex;
- }
-
- //
- // Protected methods
- //
-
- /** Synchronizes the data (name and value) for fast nodes. */
- protected void synchronizeData() {
-
- // no need to sync in the future
- needsSyncData(false);
-
- // fluff data
- DeferredDocumentImpl ownerDocument =
- (DeferredDocumentImpl) this.ownerDocument();
- data = ownerDocument.getNodeValueString(fNodeIndex);
-
- } // synchronizeData()
-
-} // class DeferredCommentImpl
diff --git a/src/com/sun/org/apache/xerces/internal/dom/DeferredDOMImplementationImpl.java b/src/com/sun/org/apache/xerces/internal/dom/DeferredDOMImplementationImpl.java
deleted file mode 100644
index 2ba1c9e..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/DeferredDOMImplementationImpl.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xerces.internal.dom;
-
-import org.w3c.dom.DOMImplementation;
-
-/**
- * <p>This DOMImplementation class is description of a particular
- * implementation of the Document Object Model. As such its data is
- * static, shared by all instances of this implementation.</p>
- *
- * <p>This implementation simply extends DOMImplementationImpl to differentiate
- * between the Deferred DOM Implementations and Non-Deferred DOM Implementations.</p>
- *
- * @xerces.internal
- *
- * @author Neil Delima, IBM
- *
- */
-public class DeferredDOMImplementationImpl
- extends DOMImplementationImpl {
-
- //
- // Data
- //
-
- // static
-
- /** Dom implementation singleton. */
- static DeferredDOMImplementationImpl singleton = new DeferredDOMImplementationImpl();
-
-
- //
- // Public methods
- //
-
- /** NON-DOM: Obtain and return the single shared object */
- public static DOMImplementation getDOMImplementation() {
- return singleton;
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/dom/DeferredDocumentImpl.java b/src/com/sun/org/apache/xerces/internal/dom/DeferredDocumentImpl.java
deleted file mode 100644
index 1486086..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/DeferredDocumentImpl.java
+++ /dev/null
@@ -1,2158 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * The Document interface represents the entire HTML or XML document.
- * Conceptually, it is the root of the document tree, and provides the
- * primary access to the document's data.
- * <P>
- * Since elements, text nodes, comments, processing instructions,
- * etc. cannot exist outside the context of a Document, the Document
- * interface also contains the factory methods needed to create these
- * objects. The Node objects created have a ownerDocument attribute
- * which associates them with the Document within whose context they
- * were created.
- *
- * @xerces.internal
- *
- * @version $Id: DeferredDocumentImpl.java,v 1.11 2010-11-01 04:39:38 joehw Exp $
- * @since PR-DOM-Level-1-19980818.
- */
-public class DeferredDocumentImpl
- extends DocumentImpl
- implements DeferredNode {
-
- //
- // Constants
- //
-
- /** Serialization version. */
- static final long serialVersionUID = 5186323580749626857L;
-
- // debugging
-
- /** To include code for printing the ref count tables. */
- private static final boolean DEBUG_PRINT_REF_COUNTS = false;
-
- /** To include code for printing the internal tables. */
- private static final boolean DEBUG_PRINT_TABLES = false;
-
- /** To debug identifiers set to true and recompile. */
- private static final boolean DEBUG_IDS = false;
-
- // protected
-
- /** Chunk shift. */
- protected static final int CHUNK_SHIFT = 8; // 2^8 = 256
-
- /** Chunk size. */
- protected static final int CHUNK_SIZE = (1 << CHUNK_SHIFT);
-
- /** Chunk mask. */
- protected static final int CHUNK_MASK = CHUNK_SIZE - 1;
-
- /** Initial chunk size. */
- protected static final int INITIAL_CHUNK_COUNT = (1 << (13 - CHUNK_SHIFT)); // 32
-
- //
- // Data
- //
-
- // lazy-eval information
- // To maximize memory consumption the actual semantic of these fields vary
- // depending on the node type.
-
- /** Node count. */
- protected transient int fNodeCount = 0;
-
- /** Node types. */
- protected transient int fNodeType[][];
-
- /** Node names. */
- protected transient Object fNodeName[][];
-
- /** Node values. */
- protected transient Object fNodeValue[][];
-
- /** Node parents. */
- protected transient int fNodeParent[][];
-
- /** Node first children. */
- protected transient int fNodeLastChild[][];
-
- /** Node prev siblings. */
- protected transient int fNodePrevSib[][];
-
- /** Node namespace URI. */
- protected transient Object fNodeURI[][];
-
- /** Extra data. */
- protected transient int fNodeExtra[][];
-
- /** Identifier count. */
- protected transient int fIdCount;
-
- /** Identifier name indexes. */
- protected transient String fIdName[];
-
- /** Identifier element indexes. */
- protected transient int fIdElement[];
-
- /** DOM2: For namespace support in the deferred case.
- */
- // Implementation Note: The deferred element and attribute must know how to
- // interpret the int representing the qname.
- protected boolean fNamespacesEnabled = false;
-
- //
- // private data
- //
- private transient final StringBuilder fBufferStr = new StringBuilder();
- private transient final ArrayList fStrChunks = new ArrayList();
-
- //
- // Constructors
- //
-
- /**
- * NON-DOM: Actually creating a Document is outside the DOM's spec,
- * since it has to operate in terms of a particular implementation.
- */
- public DeferredDocumentImpl() {
- this(false);
- } // <init>()
-
- /**
- * NON-DOM: Actually creating a Document is outside the DOM's spec,
- * since it has to operate in terms of a particular implementation.
- */
- public DeferredDocumentImpl(boolean namespacesEnabled) {
- this(namespacesEnabled, false);
- } // <init>(boolean)
-
- /** Experimental constructor. */
- public DeferredDocumentImpl(boolean namespaces, boolean grammarAccess) {
- super(grammarAccess);
-
- needsSyncData(true);
- needsSyncChildren(true);
-
- fNamespacesEnabled = namespaces;
-
- } // <init>(boolean,boolean)
-
- //
- // Public methods
- //
-
- /**
- * Retrieve information describing the abilities of this particular
- * DOM implementation. Intended to support applications that may be
- * using DOMs retrieved from several different sources, potentially
- * with different underlying representations.
- */
- public DOMImplementation getImplementation() {
- // Currently implemented as a singleton, since it's hardcoded
- // information anyway.
- return DeferredDOMImplementationImpl.getDOMImplementation();
- }
-
- /** Returns the cached parser.getNamespaces() value.*/
- boolean getNamespacesEnabled() {
- return fNamespacesEnabled;
- }
-
- void setNamespacesEnabled(boolean enable) {
- fNamespacesEnabled = enable;
- }
-
- // internal factory methods
-
- /** Creates a document node in the table. */
- public int createDeferredDocument() {
- int nodeIndex = createNode(Node.DOCUMENT_NODE);
- return nodeIndex;
- }
-
- /** Creates a doctype. */
- public int createDeferredDocumentType(String rootElementName,
- String publicId, String systemId) {
-
- // create node
- int nodeIndex = createNode(Node.DOCUMENT_TYPE_NODE);
- int chunk = nodeIndex >> CHUNK_SHIFT;
- int index = nodeIndex & CHUNK_MASK;
-
- // save name, public id, system id
- setChunkValue(fNodeName, rootElementName, chunk, index);
- setChunkValue(fNodeValue, publicId, chunk, index);
- setChunkValue(fNodeURI, systemId, chunk, index);
-
- // return node index
- return nodeIndex;
-
- } // createDeferredDocumentType(String,String,String):int
-
- public void setInternalSubset(int doctypeIndex, String subset) {
- int chunk = doctypeIndex >> CHUNK_SHIFT;
- int index = doctypeIndex & CHUNK_MASK;
-
- // create extra data node to store internal subset
- int extraDataIndex = createNode(Node.DOCUMENT_TYPE_NODE);
- int echunk = extraDataIndex >> CHUNK_SHIFT;
- int eindex = extraDataIndex & CHUNK_MASK;
- setChunkIndex(fNodeExtra, extraDataIndex, chunk, index);
- setChunkValue(fNodeValue, subset, echunk, eindex);
- }
-
- /** Creates a notation in the table. */
- public int createDeferredNotation(String notationName,
- String publicId, String systemId, String baseURI) {
-
- // create node
- int nodeIndex = createNode(Node.NOTATION_NODE);
- int chunk = nodeIndex >> CHUNK_SHIFT;
- int index = nodeIndex & CHUNK_MASK;
-
-
- // create extra data node
- int extraDataIndex = createNode(Node.NOTATION_NODE);
- int echunk = extraDataIndex >> CHUNK_SHIFT;
- int eindex = extraDataIndex & CHUNK_MASK;
-
- // save name, public id, system id, and notation name
- setChunkValue(fNodeName, notationName, chunk, index);
- setChunkValue(fNodeValue, publicId, chunk, index);
- setChunkValue(fNodeURI, systemId, chunk, index);
-
- // in extra data node set baseURI value
- setChunkIndex(fNodeExtra, extraDataIndex, chunk, index);
- setChunkValue(fNodeName, baseURI, echunk, eindex);
-
- // return node index
- return nodeIndex;
-
- } // createDeferredNotation(String,String,String):int
-
- /** Creates an entity in the table. */
- public int createDeferredEntity(String entityName, String publicId,
- String systemId, String notationName,
- String baseURI) {
- // create node
- int nodeIndex = createNode(Node.ENTITY_NODE);
- int chunk = nodeIndex >> CHUNK_SHIFT;
- int index = nodeIndex & CHUNK_MASK;
-
- // create extra data node
- int extraDataIndex = createNode(Node.ENTITY_NODE);
- int echunk = extraDataIndex >> CHUNK_SHIFT;
- int eindex = extraDataIndex & CHUNK_MASK;
-
- // save name, public id, system id, and notation name
- setChunkValue(fNodeName, entityName, chunk, index);
- setChunkValue(fNodeValue, publicId, chunk, index);
- setChunkValue(fNodeURI, systemId, chunk, index);
- setChunkIndex(fNodeExtra, extraDataIndex, chunk, index);
- // set other values in the extra chunk
- // notation
- setChunkValue(fNodeName, notationName, echunk, eindex);
- // version L3
- setChunkValue(fNodeValue, null, echunk, eindex);
- // encoding L3
- setChunkValue(fNodeURI, null, echunk, eindex);
-
-
- int extraDataIndex2 = createNode(Node.ENTITY_NODE);
- int echunk2 = extraDataIndex2 >> CHUNK_SHIFT;
- int eindex2 = extraDataIndex2 & CHUNK_MASK;
-
- setChunkIndex(fNodeExtra, extraDataIndex2, echunk, eindex);
-
- // baseURI
- setChunkValue(fNodeName, baseURI, echunk2, eindex2);
-
- // return node index
- return nodeIndex;
-
- } // createDeferredEntity(String,String,String,String):int
-
- public String getDeferredEntityBaseURI (int entityIndex){
- if (entityIndex != -1) {
- int extraDataIndex = getNodeExtra(entityIndex, false);
- extraDataIndex = getNodeExtra(extraDataIndex, false);
- return getNodeName (extraDataIndex, false);
- }
- return null;
- }
-
- // DOM Level 3: setting encoding and version
- public void setEntityInfo(int currentEntityDecl,
- String version, String encoding){
- int eNodeIndex = getNodeExtra(currentEntityDecl, false);
- if (eNodeIndex !=-1) {
- int echunk = eNodeIndex >> CHUNK_SHIFT;
- int eindex = eNodeIndex & CHUNK_MASK;
- setChunkValue(fNodeValue, version, echunk, eindex);
- setChunkValue(fNodeURI, encoding, echunk, eindex);
- }
- }
-
- // DOM Level 3: sets element TypeInfo
- public void setTypeInfo(int elementNodeIndex, Object type) {
- int elementChunk = elementNodeIndex >> CHUNK_SHIFT;
- int elementIndex = elementNodeIndex & CHUNK_MASK;
- setChunkValue(fNodeValue, type, elementChunk, elementIndex);
- }
-
- /**
- * DOM Internal
- *
- * An attribute specifying the actual encoding of this document. This is
- * <code>null</code> otherwise.
- * <br> This attribute represents the property [character encoding scheme]
- * defined in .
- */
- public void setInputEncoding(int currentEntityDecl, String value){
- // get first extra data chunk
- int nodeIndex = getNodeExtra(currentEntityDecl, false);
- // get second extra data chunk
- int extraDataIndex = getNodeExtra(nodeIndex, false);
-
- int echunk = extraDataIndex >> CHUNK_SHIFT;
- int eindex = extraDataIndex & CHUNK_MASK;
-
- setChunkValue(fNodeValue, value, echunk, eindex);
-
- }
-
- /** Creates an entity reference node in the table. */
- public int createDeferredEntityReference(String name, String baseURI) {
-
- // create node
- int nodeIndex = createNode(Node.ENTITY_REFERENCE_NODE);
- int chunk = nodeIndex >> CHUNK_SHIFT;
- int index = nodeIndex & CHUNK_MASK;
- setChunkValue(fNodeName, name, chunk, index);
- setChunkValue(fNodeValue, baseURI, chunk, index);
-
- // return node index
- return nodeIndex;
-
- } // createDeferredEntityReference(String):int
-
-
- /**
- * Creates an element node with a URI in the table and type information.
- * @deprecated
- */
- public int createDeferredElement(String elementURI, String elementName,
- Object type) {
-
- // create node
- int elementNodeIndex = createNode(Node.ELEMENT_NODE);
- int elementChunk = elementNodeIndex >> CHUNK_SHIFT;
- int elementIndex = elementNodeIndex & CHUNK_MASK;
- setChunkValue(fNodeName, elementName, elementChunk, elementIndex);
- setChunkValue(fNodeURI, elementURI, elementChunk, elementIndex);
- setChunkValue(fNodeValue, type, elementChunk, elementIndex);
-
- // return node index
- return elementNodeIndex;
-
- } // createDeferredElement(String,String,Object):int
-
- /**
- * Creates an element node in the table.
- * @deprecated
- */
- public int createDeferredElement(String elementName) {
- return createDeferredElement(null, elementName);
- }
-
- /**
- * Creates an element node with a URI in the table.
- */
- public int createDeferredElement(String elementURI, String elementName) {
-
- // create node
- int elementNodeIndex = createNode(Node.ELEMENT_NODE);
- int elementChunk = elementNodeIndex >> CHUNK_SHIFT;
- int elementIndex = elementNodeIndex & CHUNK_MASK;
- setChunkValue(fNodeName, elementName, elementChunk, elementIndex);
- setChunkValue(fNodeURI, elementURI, elementChunk, elementIndex);
-
- // return node index
- return elementNodeIndex;
-
- } // createDeferredElement(String,String):int
-
-
- /**
- * This method is used by the DOMParser to create attributes.
- * @param elementNodeIndex
- * @param attrName
- * @param attrURI
- * @param attrValue
- * @param specified
- * @param id
- * @param type
- * @return int
- */
- public int setDeferredAttribute(int elementNodeIndex,
- String attrName,
- String attrURI,
- String attrValue,
- boolean specified,
- boolean id,
- Object type) {
-
- // create attribute
- int attrNodeIndex = createDeferredAttribute(attrName, attrURI, attrValue, specified);
- int attrChunk = attrNodeIndex >> CHUNK_SHIFT;
- int attrIndex = attrNodeIndex & CHUNK_MASK;
- // set attribute's parent to element
- setChunkIndex(fNodeParent, elementNodeIndex, attrChunk, attrIndex);
-
- int elementChunk = elementNodeIndex >> CHUNK_SHIFT;
- int elementIndex = elementNodeIndex & CHUNK_MASK;
-
- // get element's last attribute
- int lastAttrNodeIndex = getChunkIndex(fNodeExtra, elementChunk, elementIndex);
- if (lastAttrNodeIndex != 0) {
- // add link from new attribute to last attribute
- setChunkIndex(fNodePrevSib, lastAttrNodeIndex, attrChunk, attrIndex);
- }
- // add link from element to new last attribute
- setChunkIndex(fNodeExtra, attrNodeIndex, elementChunk, elementIndex);
-
- int extra = getChunkIndex(fNodeExtra, attrChunk, attrIndex);
- if (id) {
- extra = extra | ID;
- setChunkIndex(fNodeExtra, extra, attrChunk, attrIndex);
- String value = getChunkValue(fNodeValue, attrChunk, attrIndex);
- putIdentifier(value, elementNodeIndex);
- }
- // store type information
- if (type != null) {
- int extraDataIndex = createNode(DeferredNode.TYPE_NODE);
- int echunk = extraDataIndex >> CHUNK_SHIFT;
- int eindex = extraDataIndex & CHUNK_MASK;
-
- setChunkIndex(fNodeLastChild, extraDataIndex, attrChunk, attrIndex);
- setChunkValue(fNodeValue, type, echunk, eindex);
- }
-
- // return node index
- return attrNodeIndex;
- }
-
- /**
- * Sets an attribute on an element node.
- * @deprecated
- */
- public int setDeferredAttribute(int elementNodeIndex,
- String attrName, String attrURI,
- String attrValue, boolean specified) {
- // create attribute
- int attrNodeIndex = createDeferredAttribute(attrName, attrURI,
- attrValue, specified);
- int attrChunk = attrNodeIndex >> CHUNK_SHIFT;
- int attrIndex = attrNodeIndex & CHUNK_MASK;
- // set attribute's parent to element
- setChunkIndex(fNodeParent, elementNodeIndex, attrChunk, attrIndex);
-
- int elementChunk = elementNodeIndex >> CHUNK_SHIFT;
- int elementIndex = elementNodeIndex & CHUNK_MASK;
-
- // get element's last attribute
- int lastAttrNodeIndex = getChunkIndex(fNodeExtra,
- elementChunk, elementIndex);
- if (lastAttrNodeIndex != 0) {
- // add link from new attribute to last attribute
- setChunkIndex(fNodePrevSib, lastAttrNodeIndex,
- attrChunk, attrIndex);
- }
- // add link from element to new last attribute
- setChunkIndex(fNodeExtra, attrNodeIndex,
- elementChunk, elementIndex);
-
- // return node index
- return attrNodeIndex;
-
- } // setDeferredAttribute(int,String,String,String,boolean):int
-
- /** Creates an attribute in the table. */
- public int createDeferredAttribute(String attrName, String attrValue,
- boolean specified) {
- return createDeferredAttribute(attrName, null, attrValue, specified);
- }
-
- /** Creates an attribute with a URI in the table. */
- public int createDeferredAttribute(String attrName, String attrURI,
- String attrValue, boolean specified) {
-
- // create node
- int nodeIndex = createNode(NodeImpl.ATTRIBUTE_NODE);
- int chunk = nodeIndex >> CHUNK_SHIFT;
- int index = nodeIndex & CHUNK_MASK;
- setChunkValue(fNodeName, attrName, chunk, index);
- setChunkValue(fNodeURI, attrURI, chunk, index);
- setChunkValue(fNodeValue, attrValue, chunk, index);
- int extra = specified ? SPECIFIED : 0;
- setChunkIndex(fNodeExtra, extra, chunk, index);
-
- // return node index
- return nodeIndex;
-
- } // createDeferredAttribute(String,String,String,boolean):int
-
- /** Creates an element definition in the table.*/
- public int createDeferredElementDefinition(String elementName) {
-
- // create node
- int nodeIndex = createNode(NodeImpl.ELEMENT_DEFINITION_NODE);
- int chunk = nodeIndex >> CHUNK_SHIFT;
- int index = nodeIndex & CHUNK_MASK;
- setChunkValue(fNodeName, elementName, chunk, index);
-
- // return node index
- return nodeIndex;
-
- } // createDeferredElementDefinition(String):int
-
- /** Creates a text node in the table. */
- public int createDeferredTextNode(String data,
- boolean ignorableWhitespace) {
-
- // create node
- int nodeIndex = createNode(Node.TEXT_NODE);
- int chunk = nodeIndex >> CHUNK_SHIFT;
- int index = nodeIndex & CHUNK_MASK;
- setChunkValue(fNodeValue, data, chunk, index);
- // use extra to store ignorableWhitespace info
- setChunkIndex(fNodeExtra, ignorableWhitespace ? 1 : 0, chunk, index);
-
- // return node index
- return nodeIndex;
-
- } // createDeferredTextNode(String,boolean):int
-
- /** Creates a CDATA section node in the table. */
- public int createDeferredCDATASection(String data) {
-
- // create node
- int nodeIndex = createNode(Node.CDATA_SECTION_NODE);
- int chunk = nodeIndex >> CHUNK_SHIFT;
- int index = nodeIndex & CHUNK_MASK;
- setChunkValue(fNodeValue, data, chunk, index);
-
- // return node index
- return nodeIndex;
-
- } // createDeferredCDATASection(String):int
-
- /** Creates a processing instruction node in the table. */
- public int createDeferredProcessingInstruction(String target,
- String data) {
- // create node
- int nodeIndex = createNode(Node.PROCESSING_INSTRUCTION_NODE);
- int chunk = nodeIndex >> CHUNK_SHIFT;
- int index = nodeIndex & CHUNK_MASK;
- setChunkValue(fNodeName, target, chunk, index);
- setChunkValue(fNodeValue, data, chunk, index);
- // return node index
- return nodeIndex;
-
- } // createDeferredProcessingInstruction(String,String):int
-
- /** Creates a comment node in the table. */
- public int createDeferredComment(String data) {
-
- // create node
- int nodeIndex = createNode(Node.COMMENT_NODE);
- int chunk = nodeIndex >> CHUNK_SHIFT;
- int index = nodeIndex & CHUNK_MASK;
- setChunkValue(fNodeValue, data, chunk, index);
-
- // return node index
- return nodeIndex;
-
- } // createDeferredComment(String):int
-
- /** Creates a clone of the specified node. */
- public int cloneNode(int nodeIndex, boolean deep) {
-
- // clone immediate node
-
- int nchunk = nodeIndex >> CHUNK_SHIFT;
- int nindex = nodeIndex & CHUNK_MASK;
- int nodeType = fNodeType[nchunk][nindex];
- int cloneIndex = createNode((short)nodeType);
- int cchunk = cloneIndex >> CHUNK_SHIFT;
- int cindex = cloneIndex & CHUNK_MASK;
- setChunkValue(fNodeName, fNodeName[nchunk][nindex], cchunk, cindex);
- setChunkValue(fNodeValue, fNodeValue[nchunk][nindex], cchunk, cindex);
- setChunkValue(fNodeURI, fNodeURI[nchunk][nindex], cchunk, cindex);
- int extraIndex = fNodeExtra[nchunk][nindex];
- if (extraIndex != -1) {
- if (nodeType != Node.ATTRIBUTE_NODE && nodeType != Node.TEXT_NODE) {
- extraIndex = cloneNode(extraIndex, false);
- }
- setChunkIndex(fNodeExtra, extraIndex, cchunk, cindex);
- }
-
- // clone and attach children
- if (deep) {
- int prevIndex = -1;
- int childIndex = getLastChild(nodeIndex, false);
- while (childIndex != -1) {
- int clonedChildIndex = cloneNode(childIndex, deep);
- insertBefore(cloneIndex, clonedChildIndex, prevIndex);
- prevIndex = clonedChildIndex;
- childIndex = getRealPrevSibling(childIndex, false);
- }
-
-
- }
-
- // return cloned node index
- return cloneIndex;
-
- } // cloneNode(int,boolean):int
-
- /** Appends a child to the specified parent in the table. */
- public void appendChild(int parentIndex, int childIndex) {
-
- // append parent index
- int pchunk = parentIndex >> CHUNK_SHIFT;
- int pindex = parentIndex & CHUNK_MASK;
- int cchunk = childIndex >> CHUNK_SHIFT;
- int cindex = childIndex & CHUNK_MASK;
- setChunkIndex(fNodeParent, parentIndex, cchunk, cindex);
-
- // set previous sibling of new child
- int olast = getChunkIndex(fNodeLastChild, pchunk, pindex);
- setChunkIndex(fNodePrevSib, olast, cchunk, cindex);
-
- // update parent's last child
- setChunkIndex(fNodeLastChild, childIndex, pchunk, pindex);
-
- } // appendChild(int,int)
-
- /** Adds an attribute node to the specified element. */
- public int setAttributeNode(int elemIndex, int attrIndex) {
-
- int echunk = elemIndex >> CHUNK_SHIFT;
- int eindex = elemIndex & CHUNK_MASK;
- int achunk = attrIndex >> CHUNK_SHIFT;
- int aindex = attrIndex & CHUNK_MASK;
-
- // see if this attribute is already here
- String attrName = getChunkValue(fNodeName, achunk, aindex);
- int oldAttrIndex = getChunkIndex(fNodeExtra, echunk, eindex);
- int nextIndex = -1;
- int oachunk = -1;
- int oaindex = -1;
- while (oldAttrIndex != -1) {
- oachunk = oldAttrIndex >> CHUNK_SHIFT;
- oaindex = oldAttrIndex & CHUNK_MASK;
- String oldAttrName = getChunkValue(fNodeName, oachunk, oaindex);
- if (oldAttrName.equals(attrName)) {
- break;
- }
- nextIndex = oldAttrIndex;
- oldAttrIndex = getChunkIndex(fNodePrevSib, oachunk, oaindex);
- }
-
- // remove old attribute
- if (oldAttrIndex != -1) {
-
- // patch links
- int prevIndex = getChunkIndex(fNodePrevSib, oachunk, oaindex);
- if (nextIndex == -1) {
- setChunkIndex(fNodeExtra, prevIndex, echunk, eindex);
- }
- else {
- int pchunk = nextIndex >> CHUNK_SHIFT;
- int pindex = nextIndex & CHUNK_MASK;
- setChunkIndex(fNodePrevSib, prevIndex, pchunk, pindex);
- }
-
- // remove connections to siblings
- clearChunkIndex(fNodeType, oachunk, oaindex);
- clearChunkValue(fNodeName, oachunk, oaindex);
- clearChunkValue(fNodeValue, oachunk, oaindex);
- clearChunkIndex(fNodeParent, oachunk, oaindex);
- clearChunkIndex(fNodePrevSib, oachunk, oaindex);
- int attrTextIndex =
- clearChunkIndex(fNodeLastChild, oachunk, oaindex);
- int atchunk = attrTextIndex >> CHUNK_SHIFT;
- int atindex = attrTextIndex & CHUNK_MASK;
- clearChunkIndex(fNodeType, atchunk, atindex);
- clearChunkValue(fNodeValue, atchunk, atindex);
- clearChunkIndex(fNodeParent, atchunk, atindex);
- clearChunkIndex(fNodeLastChild, atchunk, atindex);
- }
-
- // add new attribute
- int prevIndex = getChunkIndex(fNodeExtra, echunk, eindex);
- setChunkIndex(fNodeExtra, attrIndex, echunk, eindex);
- setChunkIndex(fNodePrevSib, prevIndex, achunk, aindex);
-
- // return
- return oldAttrIndex;
-
- } // setAttributeNode(int,int):int
-
-
- /** Adds an attribute node to the specified element. */
- public void setIdAttributeNode(int elemIndex, int attrIndex) {
-
- int chunk = attrIndex >> CHUNK_SHIFT;
- int index = attrIndex & CHUNK_MASK;
- int extra = getChunkIndex(fNodeExtra, chunk, index);
- extra = extra | ID;
- setChunkIndex(fNodeExtra, extra, chunk, index);
-
- String value = getChunkValue(fNodeValue, chunk, index);
- putIdentifier(value, elemIndex);
- }
-
-
- /** Sets type of attribute */
- public void setIdAttribute(int attrIndex) {
-
- int chunk = attrIndex >> CHUNK_SHIFT;
- int index = attrIndex & CHUNK_MASK;
- int extra = getChunkIndex(fNodeExtra, chunk, index);
- extra = extra | ID;
- setChunkIndex(fNodeExtra, extra, chunk, index);
- }
-
- /** Inserts a child before the specified node in the table. */
- public int insertBefore(int parentIndex, int newChildIndex, int refChildIndex) {
-
- if (refChildIndex == -1) {
- appendChild(parentIndex, newChildIndex);
- return newChildIndex;
- }
-
- int nchunk = newChildIndex >> CHUNK_SHIFT;
- int nindex = newChildIndex & CHUNK_MASK;
- int rchunk = refChildIndex >> CHUNK_SHIFT;
- int rindex = refChildIndex & CHUNK_MASK;
- int previousIndex = getChunkIndex(fNodePrevSib, rchunk, rindex);
- setChunkIndex(fNodePrevSib, newChildIndex, rchunk, rindex);
- setChunkIndex(fNodePrevSib, previousIndex, nchunk, nindex);
-
- return newChildIndex;
-
- } // insertBefore(int,int,int):int
-
- /** Sets the last child of the parentIndex to childIndex. */
- public void setAsLastChild(int parentIndex, int childIndex) {
- int pchunk = parentIndex >> CHUNK_SHIFT;
- int pindex = parentIndex & CHUNK_MASK;
- setChunkIndex(fNodeLastChild, childIndex, pchunk, pindex);
- } // setAsLastChild(int,int)
-
- /**
- * Returns the parent node of the given node.
- * <em>Calling this method does not free the parent index.</em>
- */
- public int getParentNode(int nodeIndex) {
- return getParentNode(nodeIndex, false);
- }
-
- /**
- * Returns the parent node of the given node.
- * @param free True to free parent node.
- */
- public int getParentNode(int nodeIndex, boolean free) {
-
- if (nodeIndex == -1) {
- return -1;
- }
-
- int chunk = nodeIndex >> CHUNK_SHIFT;
- int index = nodeIndex & CHUNK_MASK;
- return free ? clearChunkIndex(fNodeParent, chunk, index)
- : getChunkIndex(fNodeParent, chunk, index);
-
- } // getParentNode(int):int
-
- /** Returns the last child of the given node. */
- public int getLastChild(int nodeIndex) {
- return getLastChild(nodeIndex, true);
- }
-
- /**
- * Returns the last child of the given node.
- * @param free True to free child index.
- */
- public int getLastChild(int nodeIndex, boolean free) {
-
- if (nodeIndex == -1) {
- return -1;
- }
-
- int chunk = nodeIndex >> CHUNK_SHIFT;
- int index = nodeIndex & CHUNK_MASK;
- return free ? clearChunkIndex(fNodeLastChild, chunk, index)
- : getChunkIndex(fNodeLastChild, chunk, index);
-
- } // getLastChild(int,boolean):int
-
- /**
- * Returns the prev sibling of the given node.
- * This is post-normalization of Text Nodes.
- */
- public int getPrevSibling(int nodeIndex) {
- return getPrevSibling(nodeIndex, true);
- }
-
- /**
- * Returns the prev sibling of the given node.
- * @param free True to free sibling index.
- */
- public int getPrevSibling(int nodeIndex, boolean free) {
-
- if (nodeIndex == -1) {
- return -1;
- }
-
- int chunk = nodeIndex >> CHUNK_SHIFT;
- int index = nodeIndex & CHUNK_MASK;
- int type = getChunkIndex(fNodeType, chunk, index);
- if (type == Node.TEXT_NODE) {
- do {
- nodeIndex = getChunkIndex(fNodePrevSib, chunk, index);
- if (nodeIndex == -1) {
- break;
- }
- chunk = nodeIndex >> CHUNK_SHIFT;
- index = nodeIndex & CHUNK_MASK;
- type = getChunkIndex(fNodeType, chunk, index);
- } while (type == Node.TEXT_NODE);
- }
- else {
- nodeIndex = getChunkIndex(fNodePrevSib, chunk, index);
- }
-
- return nodeIndex;
-
- } // getPrevSibling(int,boolean):int
-
- /**
- * Returns the <i>real</i> prev sibling of the given node,
- * directly from the data structures. Used by TextImpl#getNodeValue()
- * to normalize values.
- */
- public int getRealPrevSibling(int nodeIndex) {
- return getRealPrevSibling(nodeIndex, true);
- }
-
- /**
- * Returns the <i>real</i> prev sibling of the given node.
- * @param free True to free sibling index.
- */
- public int getRealPrevSibling(int nodeIndex, boolean free) {
-
- if (nodeIndex == -1) {
- return -1;
- }
-
- int chunk = nodeIndex >> CHUNK_SHIFT;
- int index = nodeIndex & CHUNK_MASK;
- return free ? clearChunkIndex(fNodePrevSib, chunk, index)
- : getChunkIndex(fNodePrevSib, chunk, index);
-
- } // getReadPrevSibling(int,boolean):int
-
- /**
- * Returns the index of the element definition in the table
- * with the specified name index, or -1 if no such definition
- * exists.
- */
- public int lookupElementDefinition(String elementName) {
-
- if (fNodeCount > 1) {
-
- // find doctype
- int docTypeIndex = -1;
- int nchunk = 0;
- int nindex = 0;
- for (int index = getChunkIndex(fNodeLastChild, nchunk, nindex);
- index != -1;
- index = getChunkIndex(fNodePrevSib, nchunk, nindex)) {
-
- nchunk = index >> CHUNK_SHIFT;
- nindex = index & CHUNK_MASK;
- if (getChunkIndex(fNodeType, nchunk, nindex) == Node.DOCUMENT_TYPE_NODE) {
- docTypeIndex = index;
- break;
- }
- }
-
- // find element definition
- if (docTypeIndex == -1) {
- return -1;
- }
- nchunk = docTypeIndex >> CHUNK_SHIFT;
- nindex = docTypeIndex & CHUNK_MASK;
- for (int index = getChunkIndex(fNodeLastChild, nchunk, nindex);
- index != -1;
- index = getChunkIndex(fNodePrevSib, nchunk, nindex)) {
-
- nchunk = index >> CHUNK_SHIFT;
- nindex = index & CHUNK_MASK;
- if (getChunkIndex(fNodeType, nchunk, nindex) ==
- NodeImpl.ELEMENT_DEFINITION_NODE
- && getChunkValue(fNodeName, nchunk, nindex) == elementName) {
- return index;
- }
- }
- }
-
- return -1;
-
- } // lookupElementDefinition(String):int
-
- /** Instantiates the requested node object. */
- public DeferredNode getNodeObject(int nodeIndex) {
-
- // is there anything to do?
- if (nodeIndex == -1) {
- return null;
- }
-
- // get node type
- int chunk = nodeIndex >> CHUNK_SHIFT;
- int index = nodeIndex & CHUNK_MASK;
- int type = getChunkIndex(fNodeType, chunk, index);
- if (type != Node.TEXT_NODE && type != Node.CDATA_SECTION_NODE) {
- clearChunkIndex(fNodeType, chunk, index);
- }
-
- // create new node
- DeferredNode node = null;
- switch (type) {
-
- //
- // Standard DOM node types
- //
-
- case Node.ATTRIBUTE_NODE: {
- if (fNamespacesEnabled) {
- node = new DeferredAttrNSImpl(this, nodeIndex);
- } else {
- node = new DeferredAttrImpl(this, nodeIndex);
- }
- break;
- }
-
- case Node.CDATA_SECTION_NODE: {
- node = new DeferredCDATASectionImpl(this, nodeIndex);
- break;
- }
-
- case Node.COMMENT_NODE: {
- node = new DeferredCommentImpl(this, nodeIndex);
- break;
- }
-
- // NOTE: Document fragments can never be "fast".
- //
- // The parser will never ask to create a document
- // fragment during the parse. Document fragments
- // are used by the application *after* the parse.
- //
- // case Node.DOCUMENT_FRAGMENT_NODE: { break; }
- case Node.DOCUMENT_NODE: {
- // this node is never "fast"
- node = this;
- break;
- }
-
- case Node.DOCUMENT_TYPE_NODE: {
- node = new DeferredDocumentTypeImpl(this, nodeIndex);
- // save the doctype node
- docType = (DocumentTypeImpl)node;
- break;
- }
-
- case Node.ELEMENT_NODE: {
-
- if (DEBUG_IDS) {
- System.out.println("getNodeObject(ELEMENT_NODE): "+nodeIndex);
- }
-
- // create node
- if (fNamespacesEnabled) {
- node = new DeferredElementNSImpl(this, nodeIndex);
- } else {
- node = new DeferredElementImpl(this, nodeIndex);
- }
-
- // check to see if this element needs to be
- // registered for its ID attributes
- if (fIdElement != null) {
- int idIndex = binarySearch(fIdElement, 0,
- fIdCount-1, nodeIndex);
- while (idIndex != -1) {
-
- if (DEBUG_IDS) {
- System.out.println(" id index: "+idIndex);
- System.out.println(" fIdName["+idIndex+
- "]: "+fIdName[idIndex]);
- }
-
- // register ID
- String name = fIdName[idIndex];
- if (name != null) {
- if (DEBUG_IDS) {
- System.out.println(" name: "+name);
- System.out.print("getNodeObject()#");
- }
- putIdentifier0(name, (Element)node);
- fIdName[idIndex] = null;
- }
-
- // continue if there are more IDs for
- // this element
- if (idIndex + 1 < fIdCount &&
- fIdElement[idIndex + 1] == nodeIndex) {
- idIndex++;
- }
- else {
- idIndex = -1;
- }
- }
- }
- break;
- }
-
- case Node.ENTITY_NODE: {
- node = new DeferredEntityImpl(this, nodeIndex);
- break;
- }
-
- case Node.ENTITY_REFERENCE_NODE: {
- node = new DeferredEntityReferenceImpl(this, nodeIndex);
- break;
- }
-
- case Node.NOTATION_NODE: {
- node = new DeferredNotationImpl(this, nodeIndex);
- break;
- }
-
- case Node.PROCESSING_INSTRUCTION_NODE: {
- node = new DeferredProcessingInstructionImpl(this, nodeIndex);
- break;
- }
-
- case Node.TEXT_NODE: {
- node = new DeferredTextImpl(this, nodeIndex);
- break;
- }
-
- //
- // non-standard DOM node types
- //
-
- case NodeImpl.ELEMENT_DEFINITION_NODE: {
- node = new DeferredElementDefinitionImpl(this, nodeIndex);
- break;
- }
-
- default: {
- throw new IllegalArgumentException("type: "+type);
- }
-
- } // switch node type
-
- // store and return
- if (node != null) {
- return node;
- }
-
- // error
- throw new IllegalArgumentException();
-
- } // createNodeObject(int):Node
-
- /** Returns the name of the given node. */
- public String getNodeName(int nodeIndex) {
- return getNodeName(nodeIndex, true);
- } // getNodeNameString(int):String
-
- /**
- * Returns the name of the given node.
- * @param free True to free the string index.
- */
- public String getNodeName(int nodeIndex, boolean free) {
-
- if (nodeIndex == -1) {
- return null;
- }
-
- int chunk = nodeIndex >> CHUNK_SHIFT;
- int index = nodeIndex & CHUNK_MASK;
- return free ? clearChunkValue(fNodeName, chunk, index)
- : getChunkValue(fNodeName, chunk, index);
-
- } // getNodeName(int,boolean):String
-
- /** Returns the real value of the given node. */
- public String getNodeValueString(int nodeIndex) {
- return getNodeValueString(nodeIndex, true);
- } // getNodeValueString(int):String
-
- /**
- * Returns the real value of the given node.
- * @param free True to free the string index.
- */
- public String getNodeValueString(int nodeIndex, boolean free) {
-
- if (nodeIndex == -1) {
- return null;
- }
-
- int chunk = nodeIndex >> CHUNK_SHIFT;
- int index = nodeIndex & CHUNK_MASK;
- String value = free ? clearChunkValue(fNodeValue, chunk, index)
- : getChunkValue(fNodeValue, chunk, index);
- if (value == null) {
- return null;
- }
-
- int type = getChunkIndex(fNodeType, chunk, index);
- if (type == Node.TEXT_NODE) {
- int prevSib = getRealPrevSibling(nodeIndex);
- if (prevSib != -1 &&
- getNodeType(prevSib, false) == Node.TEXT_NODE) {
- // append data that is stored in fNodeValue
- // REVISIT: for text nodes it works differently than for CDATA
- // nodes.
- fStrChunks.add(value);
- do {
- // go in reverse order: find last child, then
- // its previous sibling, etc
- chunk = prevSib >> CHUNK_SHIFT;
- index = prevSib & CHUNK_MASK;
- value = getChunkValue(fNodeValue, chunk, index);
- fStrChunks.add(value);
- prevSib = getChunkIndex(fNodePrevSib, chunk, index);
- if (prevSib == -1) {
- break;
- }
- } while (getNodeType(prevSib, false) == Node.TEXT_NODE);
-
- int chunkCount = fStrChunks.size();
-
- // add to the buffer in the correct order.
- for (int i = chunkCount - 1; i >= 0; i--) {
- fBufferStr.append((String)fStrChunks.get(i));
- }
-
- value = fBufferStr.toString();
- fStrChunks.clear();
- fBufferStr.setLength(0);
- return value;
- }
- }
- else if (type == Node.CDATA_SECTION_NODE) {
- // find if any other data stored in children
- int child = getLastChild(nodeIndex, false);
- if (child !=-1) {
- // append data that is stored in fNodeValue
- fBufferStr.append(value);
- while (child !=-1) {
- // go in reverse order: find last child, then
- // its previous sibling, etc
- chunk = child >> CHUNK_SHIFT;
- index = child & CHUNK_MASK;
- value = getChunkValue(fNodeValue, chunk, index);
- fStrChunks.add(value);
- child = getChunkIndex(fNodePrevSib, chunk, index);
- }
- // add to the buffer in the correct order.
- for (int i=fStrChunks.size()-1; i>=0; i--) {
- fBufferStr.append((String)fStrChunks.get(i));
- }
-
- value = fBufferStr.toString();
- fStrChunks.clear();
- fBufferStr.setLength(0);
- return value;
- }
- }
-
- return value;
-
- } // getNodeValueString(int,boolean):String
-
- /**
- * Returns the value of the given node.
- */
- public String getNodeValue(int nodeIndex) {
- return getNodeValue(nodeIndex, true);
- }
-
- /**
- * Clears the type info that is stored in the fNodeValue array
- * @param nodeIndex
- * @return Object - type information for the attribute/element node
- */
- public Object getTypeInfo(int nodeIndex) {
- if (nodeIndex == -1) {
- return null;
- }
-
- int chunk = nodeIndex >> CHUNK_SHIFT;
- int index = nodeIndex & CHUNK_MASK;
-
-
- Object value = fNodeValue[chunk] != null ? fNodeValue[chunk][index] : null;
- if (value != null) {
- fNodeValue[chunk][index] = null;
- RefCount c = (RefCount) fNodeValue[chunk][CHUNK_SIZE];
- c.fCount--;
- if (c.fCount == 0) {
- fNodeValue[chunk] = null;
- }
- }
- return value;
- }
-
- /**
- * Returns the value of the given node.
- * @param free True to free the value index.
- */
- public String getNodeValue(int nodeIndex, boolean free) {
-
- if (nodeIndex == -1) {
- return null;
- }
-
- int chunk = nodeIndex >> CHUNK_SHIFT;
- int index = nodeIndex & CHUNK_MASK;
- return free ? clearChunkValue(fNodeValue, chunk, index)
- : getChunkValue(fNodeValue, chunk, index);
-
- } // getNodeValue(int,boolean):String
-
- /**
- * Returns the extra info of the given node.
- * Used by AttrImpl to store specified value (1 == true).
- */
- public int getNodeExtra(int nodeIndex) {
- return getNodeExtra(nodeIndex, true);
- }
-
- /**
- * Returns the extra info of the given node.
- * @param free True to free the value index.
- */
- public int getNodeExtra(int nodeIndex, boolean free) {
-
- if (nodeIndex == -1) {
- return -1;
- }
-
- int chunk = nodeIndex >> CHUNK_SHIFT;
- int index = nodeIndex & CHUNK_MASK;
- return free ? clearChunkIndex(fNodeExtra, chunk, index)
- : getChunkIndex(fNodeExtra, chunk, index);
-
- } // getNodeExtra(int,boolean):int
-
- /** Returns the type of the given node. */
- public short getNodeType(int nodeIndex) {
- return getNodeType(nodeIndex, true);
- }
-
- /**
- * Returns the type of the given node.
- * @param free True to free type index.
- */
- public short getNodeType(int nodeIndex, boolean free) {
-
- if (nodeIndex == -1) {
- return -1;
- }
-
- int chunk = nodeIndex >> CHUNK_SHIFT;
- int index = nodeIndex & CHUNK_MASK;
- return free ? (short)clearChunkIndex(fNodeType, chunk, index)
- : (short)getChunkIndex(fNodeType, chunk, index);
-
- } // getNodeType(int):int
-
- /** Returns the attribute value of the given name. */
- public String getAttribute(int elemIndex, String name) {
- if (elemIndex == -1 || name == null) {
- return null;
- }
- int echunk = elemIndex >> CHUNK_SHIFT;
- int eindex = elemIndex & CHUNK_MASK;
- int attrIndex = getChunkIndex(fNodeExtra, echunk, eindex);
- while (attrIndex != -1) {
- int achunk = attrIndex >> CHUNK_SHIFT;
- int aindex = attrIndex & CHUNK_MASK;
- if (getChunkValue(fNodeName, achunk, aindex) == name) {
- return getChunkValue(fNodeValue, achunk, aindex);
- }
- attrIndex = getChunkIndex(fNodePrevSib, achunk, aindex);
- }
- return null;
- }
-
- /** Returns the URI of the given node. */
- public String getNodeURI(int nodeIndex) {
- return getNodeURI(nodeIndex, true);
- }
-
- /**
- * Returns the URI of the given node.
- * @param free True to free URI index.
- */
- public String getNodeURI(int nodeIndex, boolean free) {
-
- if (nodeIndex == -1) {
- return null;
- }
-
- int chunk = nodeIndex >> CHUNK_SHIFT;
- int index = nodeIndex & CHUNK_MASK;
- return free ? clearChunkValue(fNodeURI, chunk, index)
- : getChunkValue(fNodeURI, chunk, index);
-
- } // getNodeURI(int,int):String
-
- // identifier maintenance
-
- /** Registers an identifier name with a specified element node. */
- public void putIdentifier(String name, int elementNodeIndex) {
-
- if (DEBUG_IDS) {
- System.out.println("putIdentifier(" + name + ", "
- + elementNodeIndex + ')' + " // " +
- getChunkValue(fNodeName,
- elementNodeIndex >> CHUNK_SHIFT,
- elementNodeIndex & CHUNK_MASK));
- }
-
- // initialize arrays
- if (fIdName == null) {
- fIdName = new String[64];
- fIdElement = new int[64];
- }
-
- // resize arrays
- if (fIdCount == fIdName.length) {
- String idName[] = new String[fIdCount * 2];
- System.arraycopy(fIdName, 0, idName, 0, fIdCount);
- fIdName = idName;
-
- int idElement[] = new int[idName.length];
- System.arraycopy(fIdElement, 0, idElement, 0, fIdCount);
- fIdElement = idElement;
- }
-
- // store identifier
- fIdName[fIdCount] = name;
- fIdElement[fIdCount] = elementNodeIndex;
- fIdCount++;
-
- } // putIdentifier(String,int)
-
- //
- // DEBUG
- //
-
- /** Prints out the tables. */
- public void print() {
-
- if (DEBUG_PRINT_REF_COUNTS) {
- System.out.print("num\t");
- System.out.print("type\t");
- System.out.print("name\t");
- System.out.print("val\t");
- System.out.print("par\t");
- System.out.print("lch\t");
- System.out.print("psib");
- System.out.println();
- for (int i = 0; i < fNodeType.length; i++) {
- if (fNodeType[i] != null) {
- // separator
- System.out.print("--------");
- System.out.print("--------");
- System.out.print("--------");
- System.out.print("--------");
- System.out.print("--------");
- System.out.print("--------");
- System.out.print("--------");
- System.out.println();
-
- // ref count
- System.out.print(i);
- System.out.print('\t');
- switch (fNodeType[i][CHUNK_SIZE]) {
- case DocumentImpl.ELEMENT_DEFINITION_NODE: { System.out.print("EDef"); break; }
- case Node.DOCUMENT_NODE: { System.out.print("Doc"); break; }
- case Node.DOCUMENT_TYPE_NODE: { System.out.print("DType"); break; }
- case Node.COMMENT_NODE: { System.out.print("Com"); break; }
- case Node.PROCESSING_INSTRUCTION_NODE: { System.out.print("PI"); break; }
- case Node.ELEMENT_NODE: { System.out.print("Elem"); break; }
- case Node.ENTITY_NODE: { System.out.print("Ent"); break; }
- case Node.ENTITY_REFERENCE_NODE: { System.out.print("ERef"); break; }
- case Node.TEXT_NODE: { System.out.print("Text"); break; }
- case Node.ATTRIBUTE_NODE: { System.out.print("Attr"); break; }
- case DeferredNode.TYPE_NODE: { System.out.print("TypeInfo"); break; }
- default: { System.out.print("?"+fNodeType[i][CHUNK_SIZE]); }
- }
- System.out.print('\t');
- System.out.print(fNodeName[i][CHUNK_SIZE]);
- System.out.print('\t');
- System.out.print(fNodeValue[i][CHUNK_SIZE]);
- System.out.print('\t');
- System.out.print(fNodeURI[i][CHUNK_SIZE]);
- System.out.print('\t');
- System.out.print(fNodeParent[i][CHUNK_SIZE]);
- System.out.print('\t');
- System.out.print(fNodeLastChild[i][CHUNK_SIZE]);
- System.out.print('\t');
- System.out.print(fNodePrevSib[i][CHUNK_SIZE]);
- System.out.print('\t');
- System.out.print(fNodeExtra[i][CHUNK_SIZE]);
- System.out.println();
- }
- }
- }
-
- if (DEBUG_PRINT_TABLES) {
- // This assumes that the document is small
- System.out.println("# start table");
- for (int i = 0; i < fNodeCount; i++) {
- int chunk = i >> CHUNK_SHIFT;
- int index = i & CHUNK_MASK;
- if (i % 10 == 0) {
- System.out.print("num\t");
- System.out.print("type\t");
- System.out.print("name\t");
- System.out.print("val\t");
- System.out.print("uri\t");
- System.out.print("par\t");
- System.out.print("lch\t");
- System.out.print("psib\t");
- System.out.print("xtra");
- System.out.println();
- }
- System.out.print(i);
- System.out.print('\t');
- switch (getChunkIndex(fNodeType, chunk, index)) {
- case DocumentImpl.ELEMENT_DEFINITION_NODE: { System.out.print("EDef"); break; }
- case Node.DOCUMENT_NODE: { System.out.print("Doc"); break; }
- case Node.DOCUMENT_TYPE_NODE: { System.out.print("DType"); break; }
- case Node.COMMENT_NODE: { System.out.print("Com"); break; }
- case Node.PROCESSING_INSTRUCTION_NODE: { System.out.print("PI"); break; }
- case Node.ELEMENT_NODE: { System.out.print("Elem"); break; }
- case Node.ENTITY_NODE: { System.out.print("Ent"); break; }
- case Node.ENTITY_REFERENCE_NODE: { System.out.print("ERef"); break; }
- case Node.TEXT_NODE: { System.out.print("Text"); break; }
- case Node.ATTRIBUTE_NODE: { System.out.print("Attr"); break; }
- case DeferredNode.TYPE_NODE: { System.out.print("TypeInfo"); break; }
- default: { System.out.print("?"+getChunkIndex(fNodeType, chunk, index)); }
- }
- System.out.print('\t');
- System.out.print(getChunkValue(fNodeName, chunk, index));
- System.out.print('\t');
- System.out.print(getNodeValue(chunk, index));
- System.out.print('\t');
- System.out.print(getChunkValue(fNodeURI, chunk, index));
- System.out.print('\t');
- System.out.print(getChunkIndex(fNodeParent, chunk, index));
- System.out.print('\t');
- System.out.print(getChunkIndex(fNodeLastChild, chunk, index));
- System.out.print('\t');
- System.out.print(getChunkIndex(fNodePrevSib, chunk, index));
- System.out.print('\t');
- System.out.print(getChunkIndex(fNodeExtra, chunk, index));
- System.out.println();
- }
- System.out.println("# end table");
- }
-
- } // print()
-
- //
- // DeferredNode methods
- //
-
- /** Returns the node index. */
- public int getNodeIndex() {
- return 0;
- }
-
- //
- // Protected methods
- //
-
- /** Synchronizes the node's data. */
- protected void synchronizeData() {
-
- // no need to sync in the future
- needsSyncData(false);
-
- // fluff up enough nodes to fill identifiers hash
- if (fIdElement != null) {
-
- // REVISIT: There has to be a more efficient way of
- // doing this. But keep in mind that the
- // tree can have been altered and re-ordered
- // before all of the element nodes with ID
- // attributes have been registered. For now
- // this is reasonable and safe. -Ac
-
- IntVector path = new IntVector();
- for (int i = 0; i < fIdCount; i++) {
-
- // ignore if it's already been registered
- int elementNodeIndex = fIdElement[i];
- String idName = fIdName[i];
- if (idName == null) {
- continue;
- }
-
- // find path from this element to the root
- path.removeAllElements();
- int index = elementNodeIndex;
- do {
- path.addElement(index);
- int pchunk = index >> CHUNK_SHIFT;
- int pindex = index & CHUNK_MASK;
- index = getChunkIndex(fNodeParent, pchunk, pindex);
- } while (index != -1);
-
- // Traverse path (backwards), fluffing the elements
- // along the way. When this loop finishes, "place"
- // will contain the reference to the element node
- // we're interested in. -Ac
- Node place = this;
- for (int j = path.size() - 2; j >= 0; j--) {
- index = path.elementAt(j);
- Node child = place.getLastChild();
- while (child != null) {
- if (child instanceof DeferredNode) {
- int nodeIndex =
- ((DeferredNode)child).getNodeIndex();
- if (nodeIndex == index) {
- place = child;
- break;
- }
- }
- child = child.getPreviousSibling();
- }
- }
-
- // register the element
- Element element = (Element)place;
- putIdentifier0(idName, element);
- fIdName[i] = null;
-
- // see if there are more IDs on this element
- while (i + 1 < fIdCount &&
- fIdElement[i + 1] == elementNodeIndex) {
- idName = fIdName[++i];
- if (idName == null) {
- continue;
- }
- putIdentifier0(idName, element);
- }
- }
-
- } // if identifiers
-
- } // synchronizeData()
-
- /**
- * Synchronizes the node's children with the internal structure.
- * Fluffing the children at once solves a lot of work to keep
- * the two structures in sync. The problem gets worse when
- * editing the tree -- this makes it a lot easier.
- */
- protected void synchronizeChildren() {
-
- if (needsSyncData()) {
- synchronizeData();
- /*
- * when we have elements with IDs this method is being recursively
- * called from synchronizeData, in which case we've already gone
- * through the following and we can now simply stop here.
- */
- if (!needsSyncChildren()) {
- return;
- }
- }
-
- // we don't want to generate any event for this so turn them off
- boolean orig = mutationEvents;
- mutationEvents = false;
-
- // no need to sync in the future
- needsSyncChildren(false);
-
- getNodeType(0);
-
- // create children and link them as siblings
- ChildNode first = null;
- ChildNode last = null;
- for (int index = getLastChild(0);
- index != -1;
- index = getPrevSibling(index)) {
-
- ChildNode node = (ChildNode)getNodeObject(index);
- if (last == null) {
- last = node;
- }
- else {
- first.previousSibling = node;
- }
- node.ownerNode = this;
- node.isOwned(true);
- node.nextSibling = first;
- first = node;
-
- // save doctype and document type
- int type = node.getNodeType();
- if (type == Node.ELEMENT_NODE) {
- docElement = (ElementImpl)node;
- }
- else if (type == Node.DOCUMENT_TYPE_NODE) {
- docType = (DocumentTypeImpl)node;
- }
- }
-
- if (first != null) {
- firstChild = first;
- first.isFirstChild(true);
- lastChild(last);
- }
-
- // set mutation events flag back to its original value
- mutationEvents = orig;
-
- } // synchronizeChildren()
-
- /**
- * Synchronizes the node's children with the internal structure.
- * Fluffing the children at once solves a lot of work to keep
- * the two structures in sync. The problem gets worse when
- * editing the tree -- this makes it a lot easier.
- * This is not directly used in this class but this method is
- * here so that it can be shared by all deferred subclasses of AttrImpl.
- */
- protected final void synchronizeChildren(AttrImpl a, int nodeIndex) {
-
- // we don't want to generate any event for this so turn them off
- boolean orig = getMutationEvents();
- setMutationEvents(false);
-
- // no need to sync in the future
- a.needsSyncChildren(false);
-
- // create children and link them as siblings or simply store the value
- // as a String if all we have is one piece of text
- int last = getLastChild(nodeIndex);
- int prev = getPrevSibling(last);
- if (prev == -1) {
- a.value = getNodeValueString(nodeIndex);
- a.hasStringValue(true);
- }
- else {
- ChildNode firstNode = null;
- ChildNode lastNode = null;
- for (int index = last; index != -1;
- index = getPrevSibling(index)) {
-
- ChildNode node = (ChildNode) getNodeObject(index);
- if (lastNode == null) {
- lastNode = node;
- }
- else {
- firstNode.previousSibling = node;
- }
- node.ownerNode = a;
- node.isOwned(true);
- node.nextSibling = firstNode;
- firstNode = node;
- }
- if (lastNode != null) {
- a.value = firstNode; // firstChild = firstNode
- firstNode.isFirstChild(true);
- a.lastChild(lastNode);
- }
- a.hasStringValue(false);
- }
-
- // set mutation events flag back to its original value
- setMutationEvents(orig);
-
- } // synchronizeChildren(AttrImpl,int):void
-
-
- /**
- * Synchronizes the node's children with the internal structure.
- * Fluffing the children at once solves a lot of work to keep
- * the two structures in sync. The problem gets worse when
- * editing the tree -- this makes it a lot easier.
- * This is not directly used in this class but this method is
- * here so that it can be shared by all deferred subclasses of ParentNode.
- */
- protected final void synchronizeChildren(ParentNode p, int nodeIndex) {
-
- // we don't want to generate any event for this so turn them off
- boolean orig = getMutationEvents();
- setMutationEvents(false);
-
- // no need to sync in the future
- p.needsSyncChildren(false);
-
- // create children and link them as siblings
- ChildNode firstNode = null;
- ChildNode lastNode = null;
- for (int index = getLastChild(nodeIndex);
- index != -1;
- index = getPrevSibling(index)) {
-
- ChildNode node = (ChildNode) getNodeObject(index);
- if (lastNode == null) {
- lastNode = node;
- }
- else {
- firstNode.previousSibling = node;
- }
- node.ownerNode = p;
- node.isOwned(true);
- node.nextSibling = firstNode;
- firstNode = node;
- }
- if (lastNode != null) {
- p.firstChild = firstNode;
- firstNode.isFirstChild(true);
- p.lastChild(lastNode);
- }
-
- // set mutation events flag back to its original value
- setMutationEvents(orig);
-
- } // synchronizeChildren(ParentNode,int):void
-
- // utility methods
-
- /** Ensures that the internal tables are large enough. */
- protected void ensureCapacity(int chunk) {
- if (fNodeType == null) {
- // create buffers
- fNodeType = new int[INITIAL_CHUNK_COUNT][];
- fNodeName = new Object[INITIAL_CHUNK_COUNT][];
- fNodeValue = new Object[INITIAL_CHUNK_COUNT][];
- fNodeParent = new int[INITIAL_CHUNK_COUNT][];
- fNodeLastChild = new int[INITIAL_CHUNK_COUNT][];
- fNodePrevSib = new int[INITIAL_CHUNK_COUNT][];
- fNodeURI = new Object[INITIAL_CHUNK_COUNT][];
- fNodeExtra = new int[INITIAL_CHUNK_COUNT][];
- }
- else if (fNodeType.length <= chunk) {
- // resize the tables
- int newsize = chunk * 2;
-
- int[][] newArray = new int[newsize][];
- System.arraycopy(fNodeType, 0, newArray, 0, chunk);
- fNodeType = newArray;
-
- Object[][] newStrArray = new Object[newsize][];
- System.arraycopy(fNodeName, 0, newStrArray, 0, chunk);
- fNodeName = newStrArray;
-
- newStrArray = new Object[newsize][];
- System.arraycopy(fNodeValue, 0, newStrArray, 0, chunk);
- fNodeValue = newStrArray;
-
- newArray = new int[newsize][];
- System.arraycopy(fNodeParent, 0, newArray, 0, chunk);
- fNodeParent = newArray;
-
- newArray = new int[newsize][];
- System.arraycopy(fNodeLastChild, 0, newArray, 0, chunk);
- fNodeLastChild = newArray;
-
- newArray = new int[newsize][];
- System.arraycopy(fNodePrevSib, 0, newArray, 0, chunk);
- fNodePrevSib = newArray;
-
- newStrArray = new Object[newsize][];
- System.arraycopy(fNodeURI, 0, newStrArray, 0, chunk);
- fNodeURI = newStrArray;
-
- newArray = new int[newsize][];
- System.arraycopy(fNodeExtra, 0, newArray, 0, chunk);
- fNodeExtra = newArray;
- }
- else if (fNodeType[chunk] != null) {
- // Done - there's sufficient capacity
- return;
- }
-
- // create new chunks
- createChunk(fNodeType, chunk);
- createChunk(fNodeName, chunk);
- createChunk(fNodeValue, chunk);
- createChunk(fNodeParent, chunk);
- createChunk(fNodeLastChild, chunk);
- createChunk(fNodePrevSib, chunk);
- createChunk(fNodeURI, chunk);
- createChunk(fNodeExtra, chunk);
-
- // Done
- return;
-
- } // ensureCapacity(int,int)
-
- /** Creates a node of the specified type. */
- protected int createNode(short nodeType) {
- // ensure tables are large enough
- int chunk = fNodeCount >> CHUNK_SHIFT;
- int index = fNodeCount & CHUNK_MASK;
- ensureCapacity(chunk);
-
- // initialize node
- setChunkIndex(fNodeType, nodeType, chunk, index);
-
- // return node index number
- return fNodeCount++;
-
- } // createNode(short):int
-
- /**
- * Performs a binary search for a target value in an array of
- * values. The array of values must be in ascending sorted order
- * before calling this method and all array values must be
- * non-negative.
- *
- * @param values The array of values to search.
- * @param start The starting offset of the search.
- * @param end The ending offset of the search.
- * @param target The target value.
- *
- * @return This function will return the <i>first</i> occurrence
- * of the target value, or -1 if the target value cannot
- * be found.
- */
- protected static int binarySearch(final int values[],
- int start, int end, int target) {
-
- if (DEBUG_IDS) {
- System.out.println("binarySearch(), target: "+target);
- }
-
- // look for target value
- while (start <= end) {
-
- // is this the one we're looking for?
- int middle = (start + end) >>> 1;
- int value = values[middle];
- if (DEBUG_IDS) {
- System.out.print(" value: "+value+", target: "+target+" // ");
- print(values, start, end, middle, target);
- }
- if (value == target) {
- while (middle > 0 && values[middle - 1] == target) {
- middle--;
- }
- if (DEBUG_IDS) {
- System.out.println("FOUND AT "+middle);
- }
- return middle;
- }
-
- // is this point higher or lower?
- if (value > target) {
- end = middle - 1;
- }
- else {
- start = middle + 1;
- }
-
- } // while
-
- // not found
- if (DEBUG_IDS) {
- System.out.println("NOT FOUND!");
- }
- return -1;
-
- } // binarySearch(int[],int,int,int):int
-
- //
- // Private methods
- //
- private static final int[] INIT_ARRAY = new int[CHUNK_SIZE + 1];
- static {
- for (int i = 0; i < CHUNK_SIZE; i++) {
- INIT_ARRAY[i] = -1;
- }
- }
- /** Creates the specified chunk in the given array of chunks. */
- private final void createChunk(int data[][], int chunk) {
- data[chunk] = new int[CHUNK_SIZE + 1];
- System.arraycopy(INIT_ARRAY, 0, data[chunk], 0, CHUNK_SIZE);
- }
-
- static final class RefCount {
- int fCount;
- }
-
- private final void createChunk(Object data[][], int chunk) {
- data[chunk] = new Object[CHUNK_SIZE + 1];
- data[chunk][CHUNK_SIZE] = new RefCount();
- }
-
- /**
- * Sets the specified value in the given of data at the chunk and index.
- *
- * @return Returns the old value.
- */
- private final int setChunkIndex(int data[][], int value,
- int chunk, int index) {
- if (value == -1) {
- return clearChunkIndex(data, chunk, index);
- }
- int [] dataChunk = data[chunk];
- // Re-create chunk if it was deleted.
- if (dataChunk == null) {
- createChunk(data, chunk);
- dataChunk = data[chunk];
- }
- int ovalue = dataChunk[index];
- if (ovalue == -1) {
- dataChunk[CHUNK_SIZE]++;
- }
- dataChunk[index] = value;
- return ovalue;
- }
- private final String setChunkValue(Object data[][], Object value,
- int chunk, int index) {
- if (value == null) {
- return clearChunkValue(data, chunk, index);
- }
- Object [] dataChunk = data[chunk];
- // Re-create chunk if it was deleted.
- if (dataChunk == null) {
- createChunk(data, chunk);
- dataChunk = data[chunk];
- }
- String ovalue = (String) dataChunk[index];
- if (ovalue == null) {
- RefCount c = (RefCount) dataChunk[CHUNK_SIZE];
- c.fCount++;
- }
- dataChunk[index] = value;
- return ovalue;
- }
-
- /**
- * Returns the specified value in the given data at the chunk and index.
- */
- private final int getChunkIndex(int data[][], int chunk, int index) {
- return data[chunk] != null ? data[chunk][index] : -1;
- }
- private final String getChunkValue(Object data[][], int chunk, int index) {
- return data[chunk] != null ? (String) data[chunk][index] : null;
- }
- private final String getNodeValue(int chunk, int index) {
- Object data = fNodeValue[chunk][index];
- if (data == null){
- return null;
- }
- else if (data instanceof String){
- return (String)data;
- }
- else {
- // type information
- return data.toString();
- }
- }
-
-
- /**
- * Clears the specified value in the given data at the chunk and index.
- * Note that this method will clear the given chunk if the reference
- * count becomes zero.
- *
- * @return Returns the old value.
- */
- private final int clearChunkIndex(int data[][], int chunk, int index) {
- int value = data[chunk] != null ? data[chunk][index] : -1;
- if (value != -1) {
- data[chunk][CHUNK_SIZE]--;
- data[chunk][index] = -1;
- if (data[chunk][CHUNK_SIZE] == 0) {
- data[chunk] = null;
- }
- }
- return value;
- }
- private final String clearChunkValue(Object data[][],
- int chunk, int index) {
- String value = data[chunk] != null ? (String)data[chunk][index] : null;
- if (value != null) {
- data[chunk][index] = null;
- RefCount c = (RefCount) data[chunk][CHUNK_SIZE];
- c.fCount--;
- if (c.fCount == 0) {
- data[chunk] = null;
- }
- }
- return value;
- }
-
- /**
- * This version of putIdentifier is needed to avoid fluffing
- * all of the paths to ID attributes when a node object is
- * created that contains an ID attribute.
- */
- private final void putIdentifier0(String idName, Element element) {
-
- if (DEBUG_IDS) {
- System.out.println("putIdentifier0("+
- idName+", "+
- element+')');
- }
-
- // create Map
- if (identifiers == null) {
- identifiers = new HashMap<>();
- }
-
- // save ID and its associated element
- identifiers.put(idName, element);
-
- } // putIdentifier0(String,Element)
-
- /** Prints the ID array. */
- private static void print(int values[], int start, int end,
- int middle, int target) {
-
- if (DEBUG_IDS) {
- System.out.print(start);
- System.out.print(" [");
- for (int i = start; i < end; i++) {
- if (middle == i) {
- System.out.print("!");
- }
- System.out.print(values[i]);
- if (values[i] == target) {
- System.out.print("*");
- }
- if (i < end - 1) {
- System.out.print(" ");
- }
- }
- System.out.println("] "+end);
- }
-
- } // print(int[],int,int,int,int)
-
- //
- // Classes
- //
-
- /**
- * A simple integer vector.
- */
- static final class IntVector {
-
- //
- // Data
- //
-
- /** Data. */
- private int data[];
-
- /** Size. */
- private int size;
-
- //
- // Public methods
- //
-
- /** Returns the length of this vector. */
- public int size() {
- return size;
- }
-
- /** Returns the element at the specified index. */
- public int elementAt(int index) {
- return data[index];
- }
-
- /** Appends an element to the end of the vector. */
- public void addElement(int element) {
- ensureCapacity(size + 1);
- data[size++] = element;
- }
-
- /** Clears the vector. */
- public void removeAllElements() {
- size = 0;
- }
-
- //
- // Private methods
- //
-
- /** Makes sure that there is enough storage. */
- private void ensureCapacity(int newsize) {
-
- if (data == null) {
- data = new int[newsize + 15];
- }
- else if (newsize > data.length) {
- int newdata[] = new int[newsize + 15];
- System.arraycopy(data, 0, newdata, 0, data.length);
- data = newdata;
- }
-
- } // ensureCapacity(int)
-
- } // class IntVector
-
-} // class DeferredDocumentImpl
diff --git a/src/com/sun/org/apache/xerces/internal/dom/DeferredDocumentTypeImpl.java b/src/com/sun/org/apache/xerces/internal/dom/DeferredDocumentTypeImpl.java
deleted file mode 100644
index b7d3038..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/DeferredDocumentTypeImpl.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-import org.w3c.dom.Node;
-
-/**
- * This class represents a Document Type <em>declaraction</em> in
- * the document itself, <em>not</em> a Document Type Definition (DTD).
- * An XML document may (or may not) have such a reference.
- * <P>
- * DocumentType is an Extended DOM feature, used in XML documents but
- * not in HTML.
- * <P>
- * Note that Entities and Notations are no longer children of the
- * DocumentType, but are parentless nodes hung only in their
- * appropriate NamedNodeMaps.
- * <P>
- * This area is UNDERSPECIFIED IN REC-DOM-Level-1-19981001
- * Most notably, absolutely no provision was made for storing
- * and using Element and Attribute information. Nor was the linkage
- * between Entities and Entity References nailed down solidly.
- *
- * @xerces.internal
- *
- * @since PR-DOM-Level-1-19980818.
- */
-public class DeferredDocumentTypeImpl
- extends DocumentTypeImpl
- implements DeferredNode {
-
- //
- // Constants
- //
-
- /** Serialization version. */
- static final long serialVersionUID = -2172579663227313509L;
-
- //
- // Data
- //
-
- /** Node index. */
- protected transient int fNodeIndex;
-
- //
- // Constructors
- //
-
- /**
- * This is the deferred constructor. Only the fNodeIndex is given here.
- * All other data, can be requested from the ownerDocument via the index.
- */
- DeferredDocumentTypeImpl(DeferredDocumentImpl ownerDocument, int nodeIndex) {
- super(ownerDocument, null);
-
- fNodeIndex = nodeIndex;
- needsSyncData(true);
- needsSyncChildren(true);
-
- } // <init>(DeferredDocumentImpl,int)
-
- //
- // DeferredNode methods
- //
-
- /** Returns the node index. */
- public int getNodeIndex() {
- return fNodeIndex;
- }
-
- //
- // Protected methods
- //
-
- /** Synchronizes the data (name and value) for fast nodes. */
- protected void synchronizeData() {
-
- // no need to sync in the future
- needsSyncData(false);
-
- // fluff data
- DeferredDocumentImpl ownerDocument =
- (DeferredDocumentImpl)this.ownerDocument;
- name = ownerDocument.getNodeName(fNodeIndex);
-
- // public and system ids
- publicID = ownerDocument.getNodeValue(fNodeIndex);
- systemID = ownerDocument.getNodeURI(fNodeIndex);
- int extraDataIndex = ownerDocument.getNodeExtra(fNodeIndex);
- internalSubset = ownerDocument.getNodeValue(extraDataIndex);
- } // synchronizeData()
-
- /** Synchronizes the entities, notations, and elements. */
- protected void synchronizeChildren() {
-
- // we don't want to generate any event for this so turn them off
- boolean orig = ownerDocument().getMutationEvents();
- ownerDocument().setMutationEvents(false);
-
- // no need to synchronize again
- needsSyncChildren(false);
-
- // create new node maps
- DeferredDocumentImpl ownerDocument =
- (DeferredDocumentImpl)this.ownerDocument;
-
- entities = new NamedNodeMapImpl(this);
- notations = new NamedNodeMapImpl(this);
- elements = new NamedNodeMapImpl(this);
-
- // fill node maps
- DeferredNode last = null;
- for (int index = ownerDocument.getLastChild(fNodeIndex);
- index != -1;
- index = ownerDocument.getPrevSibling(index)) {
-
- DeferredNode node = ownerDocument.getNodeObject(index);
- int type = node.getNodeType();
- switch (type) {
-
- // internal, external, and unparsed entities
- case Node.ENTITY_NODE: {
- entities.setNamedItem(node);
- break;
- }
-
- // notations
- case Node.NOTATION_NODE: {
- notations.setNamedItem(node);
- break;
- }
-
- // element definitions
- case NodeImpl.ELEMENT_DEFINITION_NODE: {
- elements.setNamedItem(node);
- break;
- }
-
- // elements
- case Node.ELEMENT_NODE: {
- if (((DocumentImpl)getOwnerDocument()).allowGrammarAccess){
- insertBefore(node, last);
- last = node;
- break;
- }
- }
-
- // NOTE: Should never get here! -Ac
- default: {
- System.out.println("DeferredDocumentTypeImpl" +
- "#synchronizeInfo: " +
- "node.getNodeType() = " +
- node.getNodeType() +
- ", class = " +
- node.getClass().getName());
- }
- }
- }
-
- // set mutation events flag back to its original value
- ownerDocument().setMutationEvents(orig);
-
- // set entities and notations read_only per DOM spec
- setReadOnly(true, false);
-
- } // synchronizeChildren()
-
-} // class DeferredDocumentTypeImpl
diff --git a/src/com/sun/org/apache/xerces/internal/dom/DeferredElementDefinitionImpl.java b/src/com/sun/org/apache/xerces/internal/dom/DeferredElementDefinitionImpl.java
deleted file mode 100644
index 09b03c0..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/DeferredElementDefinitionImpl.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-import org.w3c.dom.Node;
-
-/**
- * NON-DOM CLASS: Describe one of the Elements (and its associated
- * Attributes) defined in this Document Type.
- * <p>
- * I've included this in Level 1 purely as an anchor point for default
- * attributes. In Level 2 it should enable the ChildRule support.
- *
- * @xerces.internal
- *
- */
-public class DeferredElementDefinitionImpl
- extends ElementDefinitionImpl
- implements DeferredNode {
-
- //
- // Constants
- //
-
- /** Serialization version. */
- static final long serialVersionUID = 6703238199538041591L;
-
- //
- // Data
- //
-
- /** Node index. */
- protected transient int fNodeIndex;
-
- //
- // Constructors
- //
-
- /**
- * This is the deferred constructor. Only the fNodeIndex is given here.
- * All other data, can be requested from the ownerDocument via the index.
- */
- DeferredElementDefinitionImpl(DeferredDocumentImpl ownerDocument,
- int nodeIndex) {
- super(ownerDocument, null);
-
- fNodeIndex = nodeIndex;
- needsSyncData(true);
- needsSyncChildren(true);
-
- } // <init>(DeferredDocumentImpl,int)
-
- //
- // DeferredNode methods
- //
-
- /** Returns the node index. */
- public int getNodeIndex() {
- return fNodeIndex;
- }
-
- //
- // Protected methods
- //
-
- /** Synchronizes the data (name and value) for fast nodes. */
- protected void synchronizeData() {
-
- // no need to sync in the future
- needsSyncData(false);
-
- // fluff data
- DeferredDocumentImpl ownerDocument =
- (DeferredDocumentImpl)this.ownerDocument;
- name = ownerDocument.getNodeName(fNodeIndex);
-
- } // synchronizeData()
-
- /** Synchronizes the default attribute values. */
- protected void synchronizeChildren() {
-
- // we don't want to generate any event for this so turn them off
- boolean orig = ownerDocument.getMutationEvents();
- ownerDocument.setMutationEvents(false);
-
- // attributes are now synced
- needsSyncChildren(false);
-
- // create attributes node map
- DeferredDocumentImpl ownerDocument =
- (DeferredDocumentImpl)this.ownerDocument;
- attributes = new NamedNodeMapImpl(ownerDocument);
-
- // Default attributes dangle as children of the element
- // definition "node" in the internal fast table.
- for (int nodeIndex = ownerDocument.getLastChild(fNodeIndex);
- nodeIndex != -1;
- nodeIndex = ownerDocument.getPrevSibling(nodeIndex)) {
- Node attr = ownerDocument.getNodeObject(nodeIndex);
- attributes.setNamedItem(attr);
- }
-
- // set mutation events flag back to its original value
- ownerDocument.setMutationEvents(orig);
-
- } // synchronizeChildren()
-
-} // class DeferredElementDefinitionImpl
diff --git a/src/com/sun/org/apache/xerces/internal/dom/DeferredElementImpl.java b/src/com/sun/org/apache/xerces/internal/dom/DeferredElementImpl.java
deleted file mode 100644
index 657a635..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/DeferredElementImpl.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- * WARNING: because java doesn't support multi-inheritance some code is
- * duplicated. If you're changing this file you probably want to change
- * DeferredElementNSImpl.java at the same time.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-import org.w3c.dom.NamedNodeMap;
-
-/**
- * Elements represent most of the "markup" and structure of the
- * document. They contain both the data for the element itself
- * (element name and attributes), and any contained nodes, including
- * document text (as children).
- * <P>
- * Elements may have Attributes associated with them; the API for this is
- * defined in Node, but the function is implemented here. In general, XML
- * applications should retrive Attributes as Nodes, since they may contain
- * entity references and hence be a fairly complex sub-tree. HTML users will
- * be dealing with simple string values, and convenience methods are provided
- * to work in terms of Strings.
- * <P>
- * DeferredElementImpl inherits from ElementImpl which does not support
- * Namespaces. DeferredElementNSImpl, which inherits from ElementNSImpl, does.
- * @see DeferredElementNSImpl
- *
- * @xerces.internal
- *
- * @since PR-DOM-Level-1-19980818.
- */
-public class DeferredElementImpl
- extends ElementImpl
- implements DeferredNode {
-
- //
- // Constants
- //
-
- /** Serialization version. */
- static final long serialVersionUID = -7670981133940934842L;
-
- //
- // Data
- //
-
- /** Node index. */
- protected transient int fNodeIndex;
-
- //
- // Constructors
- //
-
- /**
- * This is the deferred constructor. Only the fNodeIndex is given here. All
- * other data, can be requested from the ownerDocument via the index.
- */
- DeferredElementImpl(DeferredDocumentImpl ownerDoc, int nodeIndex) {
- super(ownerDoc, null);
-
- fNodeIndex = nodeIndex;
- needsSyncChildren(true);
-
- } // <init>(DocumentImpl,int)
-
- //
- // DeferredNode methods
- //
-
- /** Returns the node index. */
- public final int getNodeIndex() {
- return fNodeIndex;
- }
-
- //
- // Protected methods
- //
-
- /** Synchronizes the data (name and value) for fast nodes. */
- protected final void synchronizeData() {
-
- // no need to sync in the future
- needsSyncData(false);
-
- // fluff data
- DeferredDocumentImpl ownerDocument =
- (DeferredDocumentImpl)this.ownerDocument;
-
- // we don't want to generate any event for this so turn them off
- boolean orig = ownerDocument.mutationEvents;
- ownerDocument.mutationEvents = false;
-
- name = ownerDocument.getNodeName(fNodeIndex);
-
- // attributes
- setupDefaultAttributes();
- int index = ownerDocument.getNodeExtra(fNodeIndex);
- if (index != -1) {
- NamedNodeMap attrs = getAttributes();
- do {
- NodeImpl attr = (NodeImpl)ownerDocument.getNodeObject(index);
- attrs.setNamedItem(attr);
- index = ownerDocument.getPrevSibling(index);
- } while (index != -1);
- }
-
- // set mutation events flag back to its original value
- ownerDocument.mutationEvents = orig;
-
- } // synchronizeData()
-
- protected final void synchronizeChildren() {
- DeferredDocumentImpl ownerDocument =
- (DeferredDocumentImpl) ownerDocument();
- ownerDocument.synchronizeChildren(this, fNodeIndex);
- } // synchronizeChildren()
-
-} // class DeferredElementImpl
diff --git a/src/com/sun/org/apache/xerces/internal/dom/DeferredElementNSImpl.java b/src/com/sun/org/apache/xerces/internal/dom/DeferredElementNSImpl.java
deleted file mode 100644
index fd54fe6..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/DeferredElementNSImpl.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-/*
- * WARNING: because java doesn't support multi-inheritance some code is
- * duplicated. If you're changing this file you probably want to change
- * DeferredElementImpl.java at the same time.
- *
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
-import org.w3c.dom.NamedNodeMap;
-
-
-/**
- * DeferredElementNSImpl is to ElementNSImpl, what DeferredElementImpl is to
- * ElementImpl.
- *
- * @xerces.internal
- *
- * @see DeferredElementImpl
- */
-public class DeferredElementNSImpl
- extends ElementNSImpl
- implements DeferredNode {
-
- //
- // Constants
- //
-
- /** Serialization version. */
- static final long serialVersionUID = -5001885145370927385L;
-
- //
- // Data
- //
-
- /** Node index. */
- protected transient int fNodeIndex;
-
- //
- // Constructors
- //
-
- /**
- * This is the deferred constructor. Only the fNodeIndex is given here. All
- * other data, can be requested from the ownerDocument via the index.
- */
- DeferredElementNSImpl(DeferredDocumentImpl ownerDoc, int nodeIndex) {
- super(ownerDoc, null);
-
- fNodeIndex = nodeIndex;
- needsSyncChildren(true);
-
- } // <init>(DocumentImpl,int)
-
- //
- // DeferredNode methods
- //
-
- /** Returns the node index. */
- public final int getNodeIndex() {
- return fNodeIndex;
- }
-
- //
- // Protected methods
- //
-
- /** Synchronizes the data (name and value) for fast nodes. */
- protected final void synchronizeData() {
-
- // no need to sync in the future
- needsSyncData(false);
-
- // fluff data
- DeferredDocumentImpl ownerDocument =
- (DeferredDocumentImpl) this.ownerDocument;
-
- // we don't want to generate any event for this so turn them off
- boolean orig = ownerDocument.mutationEvents;
- ownerDocument.mutationEvents = false;
-
- name = ownerDocument.getNodeName(fNodeIndex);
-
- // extract local part from QName
- int index = name.indexOf(':');
- if (index < 0) {
- localName = name;
- }
- else {
- localName = name.substring(index + 1);
- }
-
- namespaceURI = ownerDocument.getNodeURI(fNodeIndex);
- type = (XSTypeDefinition)ownerDocument.getTypeInfo(fNodeIndex);
-
- // attributes
- setupDefaultAttributes();
- int attrIndex = ownerDocument.getNodeExtra(fNodeIndex);
- if (attrIndex != -1) {
- NamedNodeMap attrs = getAttributes();
- boolean seenSchemaDefault = false;
- do {
- AttrImpl attr = (AttrImpl) ownerDocument.getNodeObject(attrIndex);
- // Take special care of schema defaulted attributes. Calling the
- // non-namespace aware setAttributeNode() method could overwrite
- // another attribute with the same local name.
- if (!attr.getSpecified() && (seenSchemaDefault ||
- (attr.getNamespaceURI() != null &&
- attr.getNamespaceURI() != NamespaceContext.XMLNS_URI &&
- attr.getName().indexOf(':') < 0))) {
- seenSchemaDefault = true;
- attrs.setNamedItemNS(attr);
- }
- else {
- attrs.setNamedItem(attr);
- }
- attrIndex = ownerDocument.getPrevSibling(attrIndex);
- } while (attrIndex != -1);
- }
-
- // set mutation events flag back to its original value
- ownerDocument.mutationEvents = orig;
-
- } // synchronizeData()
-
- /**
- * Synchronizes the node's children with the internal structure.
- * Fluffing the children at once solves a lot of work to keep
- * the two structures in sync. The problem gets worse when
- * editing the tree -- this makes it a lot easier.
- */
- protected final void synchronizeChildren() {
- DeferredDocumentImpl ownerDocument =
- (DeferredDocumentImpl) ownerDocument();
- ownerDocument.synchronizeChildren(this, fNodeIndex);
- } // synchronizeChildren()
-
-} // class DeferredElementImpl
diff --git a/src/com/sun/org/apache/xerces/internal/dom/DeferredEntityImpl.java b/src/com/sun/org/apache/xerces/internal/dom/DeferredEntityImpl.java
deleted file mode 100644
index 2b9e8cc..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/DeferredEntityImpl.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-
-/**
- * Entity nodes hold the reference data for an XML Entity -- either
- * parsed or unparsed. The nodeName (inherited from Node) will contain
- * the name (if any) of the Entity. Its data will be contained in the
- * Entity's children, in exactly the structure which an
- * EntityReference to this name will present within the document's
- * body.
- * <P>
- * Note that this object models the actual entity, _not_ the entity
- * declaration or the entity reference.
- * <P>
- * An XML processor may choose to completely expand entities before
- * the structure model is passed to the DOM; in this case, there will
- * be no EntityReferences in the DOM tree.
- * <P>
- * Quoting the 10/01 DOM Proposal,
- * <BLOCKQUOTE>
- * "The DOM Level 1 does not support editing Entity nodes; if a user
- * wants to make changes to the contents of an Entity, every related
- * EntityReference node has to be replaced in the structure model by
- * a clone of the Entity's contents, and then the desired changes
- * must be made to each of those clones instead. All the
- * descendants of an Entity node are readonly."
- * </BLOCKQUOTE>
- * I'm interpreting this as: It is the parser's responsibilty to call
- * the non-DOM operation setReadOnly(true,true) after it constructs
- * the Entity. Since the DOM explicitly decided not to deal with this,
- * _any_ answer will involve a non-DOM operation, and this is the
- * simplest solution.
- *
- * @xerces.internal
- *
- * @since PR-DOM-Level-1-19980818.
- */
-public class DeferredEntityImpl
- extends EntityImpl
- implements DeferredNode {
-
- //
- // Constants
- //
-
- /** Serialization version. */
- static final long serialVersionUID = 4760180431078941638L;
-
- //
- // Data
- //
-
- /** Node index. */
- protected transient int fNodeIndex;
-
- //
- // Constructors
- //
-
- /**
- * This is the deferred constructor. Only the fNodeIndex is given here.
- * All other data, can be requested from the ownerDocument via the index.
- */
- DeferredEntityImpl(DeferredDocumentImpl ownerDocument, int nodeIndex) {
- super(ownerDocument, null);
-
- fNodeIndex = nodeIndex;
- needsSyncData(true);
- needsSyncChildren(true);
-
- } // <init>(DeferredDocumentImpl,int)
-
- //
- // DeferredNode methods
- //
-
- /** Returns the node index. */
- public int getNodeIndex() {
- return fNodeIndex;
- }
-
- //
- // Protected methods
- //
-
- /**
- * Synchronize the entity data. This is special because of the way
- * that the "fast" version stores the information.
- */
- protected void synchronizeData() {
-
- // no need to sychronize again
- needsSyncData(false);
-
- // get the node data
- DeferredDocumentImpl ownerDocument =
- (DeferredDocumentImpl)this.ownerDocument;
- name = ownerDocument.getNodeName(fNodeIndex);
-
- // get the entity data
- publicId = ownerDocument.getNodeValue(fNodeIndex);
- systemId = ownerDocument.getNodeURI(fNodeIndex);
- int extraDataIndex = ownerDocument.getNodeExtra(fNodeIndex);
- ownerDocument.getNodeType(extraDataIndex);
-
- notationName = ownerDocument.getNodeName(extraDataIndex);
-
- // encoding and version DOM L3
- version = ownerDocument.getNodeValue(extraDataIndex);
- encoding = ownerDocument.getNodeURI(extraDataIndex);
-
- // baseURI, actualEncoding DOM L3
- int extraIndex2 = ownerDocument.getNodeExtra(extraDataIndex);
- baseURI = ownerDocument.getNodeName(extraIndex2);
- inputEncoding = ownerDocument.getNodeValue(extraIndex2);
-
- } // synchronizeData()
-
- /** Synchronize the children. */
- protected void synchronizeChildren() {
-
- // no need to synchronize again
- needsSyncChildren(false);
-
- isReadOnly(false);
- DeferredDocumentImpl ownerDocument =
- (DeferredDocumentImpl) ownerDocument();
- ownerDocument.synchronizeChildren(this, fNodeIndex);
- setReadOnly(true, true);
-
- } // synchronizeChildren()
-
-} // class DeferredEntityImpl
diff --git a/src/com/sun/org/apache/xerces/internal/dom/DeferredEntityReferenceImpl.java b/src/com/sun/org/apache/xerces/internal/dom/DeferredEntityReferenceImpl.java
deleted file mode 100644
index 7f3836a..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/DeferredEntityReferenceImpl.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-/**
- * EntityReference models the XML &entityname; syntax, when used for
- * entities defined by the DOM. Entities hardcoded into XML, such as
- * character entities, should instead have been translated into text
- * by the code which generated the DOM tree.
- * <P>
- * An XML processor has the alternative of fully expanding Entities
- * into the normal document tree. If it does so, no EntityReference nodes
- * will appear.
- * <P>
- * Similarly, non-validating XML processors are not required to read
- * or process entity declarations made in the external subset or
- * declared in external parameter entities. Hence, some applications
- * may not make the replacement value available for Parsed Entities
- * of these types.
- * <P>
- * EntityReference behaves as a read-only node, and the children of
- * the EntityReference (which reflect those of the Entity, and should
- * also be read-only) give its replacement value, if any. They are
- * supposed to automagically stay in synch if the DocumentType is
- * updated with new values for the Entity.
- * <P>
- * The defined behavior makes efficient storage difficult for the DOM
- * implementor. We can't just look aside to the Entity's definition
- * in the DocumentType since those nodes have the wrong parent (unless
- * we can come up with a clever "imaginary parent" mechanism). We
- * must at least appear to clone those children... which raises the
- * issue of keeping the reference synchronized with its parent.
- * This leads me back to the "cached image of centrally defined data"
- * solution, much as I dislike it.
- * <P>
- * For now I have decided, since REC-DOM-Level-1-19980818 doesn't
- * cover this in much detail, that synchronization doesn't have to be
- * considered while the user is deep in the tree. That is, if you're
- * looking within one of the EntityReferennce's children and the Entity
- * changes, you won't be informed; instead, you will continue to access
- * the same object -- which may or may not still be part of the tree.
- * This is the same behavior that obtains elsewhere in the DOM if the
- * subtree you're looking at is deleted from its parent, so it's
- * acceptable here. (If it really bothers folks, we could set things
- * up so deleted subtrees are walked and marked invalid, but that's
- * not part of the DOM's defined behavior.)
- * <P>
- * As a result, only the EntityReference itself has to be aware of
- * changes in the Entity. And it can take advantage of the same
- * structure-change-monitoring code I implemented to support
- * DeepNodeList.
- *
- * @xerces.internal
- *
- * @since PR-DOM-Level-1-19980818.
- */
-public class DeferredEntityReferenceImpl
- extends EntityReferenceImpl
- implements DeferredNode {
-
- //
- // Constants
- //
-
- /** Serialization version. */
- static final long serialVersionUID = 390319091370032223L;
-
- //
- // Data
- //
-
- /** Node index. */
- protected transient int fNodeIndex;
-
- //
- // Constructors
- //
-
- /**
- * This is the deferred constructor. Only the fNodeIndex is given here.
- * All other data, can be requested from the ownerDocument via the index.
- */
- DeferredEntityReferenceImpl(DeferredDocumentImpl ownerDocument,
- int nodeIndex) {
- super(ownerDocument, null);
-
- fNodeIndex = nodeIndex;
- needsSyncData(true);
-
- } // <init>(DeferredDocumentImpl,int)
-
- //
- // DeferredNode methods
- //
-
- /** Returns the node index. */
- public int getNodeIndex() {
- return fNodeIndex;
- }
-
- //
- // Protected methods
- //
-
- /**
- * Synchronize the entity data. This is special because of the way
- * that the "fast" version stores the information.
- */
- protected void synchronizeData() {
-
- // no need to sychronize again
- needsSyncData(false);
-
- // get the node data
- DeferredDocumentImpl ownerDocument =
- (DeferredDocumentImpl)this.ownerDocument;
- name = ownerDocument.getNodeName(fNodeIndex);
- baseURI = ownerDocument.getNodeValue(fNodeIndex);
-
- } // synchronizeData()
-
- /** Synchronize the children. */
- protected void synchronizeChildren() {
-
- // no need to synchronize again
- needsSyncChildren(false);
-
- // get children
- isReadOnly(false);
- DeferredDocumentImpl ownerDocument =
- (DeferredDocumentImpl) ownerDocument();
- ownerDocument.synchronizeChildren(this, fNodeIndex);
- setReadOnly(true, true);
-
- } // synchronizeChildren()
-
-} // class DeferredEntityReferenceImpl
diff --git a/src/com/sun/org/apache/xerces/internal/dom/DeferredNode.java b/src/com/sun/org/apache/xerces/internal/dom/DeferredNode.java
deleted file mode 100644
index 3dba91d..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/DeferredNode.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-import org.w3c.dom.Node;
-
-/**
- * An interface for deferred node object.
- *
- * @xerces.internal
- *
- */
-public interface DeferredNode extends Node {
-
-
- public static final short TYPE_NODE = 20;
-
- //
- // DeferredNode methods
- //
-
- /** Returns the node index. */
- public int getNodeIndex();
-
-} // interface DeferredNode
diff --git a/src/com/sun/org/apache/xerces/internal/dom/DeferredNotationImpl.java b/src/com/sun/org/apache/xerces/internal/dom/DeferredNotationImpl.java
deleted file mode 100644
index 46e06f7..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/DeferredNotationImpl.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-/**
- * Notations are how the Document Type Description (DTD) records hints
- * about the format of an XML "unparsed entity" -- in other words,
- * non-XML data bound to this document type, which some applications
- * may wish to consult when manipulating the document. A Notation
- * represents a name-value pair, with its nodeName being set to the
- * declared name of the notation.
- * <P>
- * Notations are also used to formally declare the "targets" of
- * Processing Instructions.
- * <P>
- * Note that the Notation's data is non-DOM information; the DOM only
- * records what and where it is.
- * <P>
- * See the XML 1.0 spec, sections 4.7 and 2.6, for more info.
- * <P>
- * Level 1 of the DOM does not support editing Notation contents.
- *
- * @xerces.internal
- *
- * @since PR-DOM-Level-1-19980818.
- */
-public class DeferredNotationImpl
- extends NotationImpl
- implements DeferredNode {
-
- //
- // Constants
- //
-
- /** Serialization version. */
- static final long serialVersionUID = 5705337172887990848L;
-
- //
- // Data
- //
-
- /** Node index. */
- protected transient int fNodeIndex;
-
- //
- // Constructors
- //
-
- /**
- * This is the deferred constructor. Only the fNodeIndex is given here.
- * All other data, can be requested from the ownerDocument via the index.
- */
- DeferredNotationImpl(DeferredDocumentImpl ownerDocument, int nodeIndex) {
- super(ownerDocument, null);
-
- fNodeIndex = nodeIndex;
- needsSyncData(true);
-
- } // <init>(DeferredDocumentImpl,int)
-
- //
- // DeferredNode methods
- //
-
- /** Returns the node index. */
- public int getNodeIndex() {
- return fNodeIndex;
- }
-
- //
- // Protected methods
- //
-
- /**
- * Synchronizes the data. This is special because of the way
- * that the "fast" notation stores its information internally.
- */
- protected void synchronizeData() {
-
- // no need to synchronize again
- needsSyncData(false);
-
- // name
- DeferredDocumentImpl ownerDocument =
- (DeferredDocumentImpl)this.ownerDocument();
- name = ownerDocument.getNodeName(fNodeIndex);
-
- ownerDocument.getNodeType(fNodeIndex);
- // public and system ids
- publicId = ownerDocument.getNodeValue(fNodeIndex);
- systemId = ownerDocument.getNodeURI(fNodeIndex);
- int extraDataIndex = ownerDocument.getNodeExtra(fNodeIndex);
- ownerDocument.getNodeType(extraDataIndex);
- baseURI = ownerDocument.getNodeName(extraDataIndex);
-
-
- } // synchronizeData()
-
-} // class DeferredNotationImpl
diff --git a/src/com/sun/org/apache/xerces/internal/dom/DeferredProcessingInstructionImpl.java b/src/com/sun/org/apache/xerces/internal/dom/DeferredProcessingInstructionImpl.java
deleted file mode 100644
index 178cd13..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/DeferredProcessingInstructionImpl.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-/**
- * Processing Instructions (PIs) permit documents to carry
- * processor-specific information alongside their actual content. PIs
- * are most common in XML, but they are supported in HTML as well.
- *
- * @xerces.internal
- *
- * @since PR-DOM-Level-1-19980818.
- */
-public class DeferredProcessingInstructionImpl
- extends ProcessingInstructionImpl
- implements DeferredNode {
-
- //
- // Constants
- //
-
- /** Serialization version. */
- static final long serialVersionUID = -4643577954293565388L;
-
- //
- // Data
- //
-
- /** Node index. */
- protected transient int fNodeIndex;
-
- //
- // Constructors
- //
-
- /**
- * This is the deferred constructor. Only the fNodeIndex is given here.
- * All other data, can be requested from the ownerDocument via the index.
- */
- DeferredProcessingInstructionImpl(DeferredDocumentImpl ownerDocument,
- int nodeIndex) {
- super(ownerDocument, null, null);
-
- fNodeIndex = nodeIndex;
- needsSyncData(true);
-
- } // <init>(DeferredDocumentImpl,int)
-
- //
- // DeferredNode methods
- //
-
- /** Returns the node index. */
- public int getNodeIndex() {
- return fNodeIndex;
- }
-
- //
- // Protected methods
- //
-
- /** Synchronizes the data. */
- protected void synchronizeData() {
-
- // no need to sync in the future
- needsSyncData(false);
-
- // fluff data
- DeferredDocumentImpl ownerDocument =
- (DeferredDocumentImpl) this.ownerDocument();
- target = ownerDocument.getNodeName(fNodeIndex);
- data = ownerDocument.getNodeValueString(fNodeIndex);
-
- } // synchronizeData()
-
-} // class DeferredProcessingInstructionImpl
diff --git a/src/com/sun/org/apache/xerces/internal/dom/DeferredTextImpl.java b/src/com/sun/org/apache/xerces/internal/dom/DeferredTextImpl.java
deleted file mode 100644
index 37d559a..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/DeferredTextImpl.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-/**
- * Text nodes hold the non-markup, non-Entity content of
- * an Element or Attribute.
- * <P>
- * When a document is first made available to the DOM, there is only
- * one Text object for each block of adjacent plain-text. Users (ie,
- * applications) may create multiple adjacent Texts during editing --
- * see {@link org.w3c.dom.Element#normalize} for discussion.
- * <P>
- * Note that CDATASection is a subclass of Text. This is conceptually
- * valid, since they're really just two different ways of quoting
- * characters when they're written out as part of an XML stream.
- *
- * @xerces.internal
- *
- * @since PR-DOM-Level-1-19980818.
- */
-public class DeferredTextImpl
- extends TextImpl
- implements DeferredNode {
-
- //
- // Constants
- //
-
- /** Serialization version. */
- static final long serialVersionUID = 2310613872100393425L;
-
- //
- // Data
- //
-
- /** Node index. */
- protected transient int fNodeIndex;
-
- //
- // Constructors
- //
-
- /**
- * This is the deferred constructor. Only the fNodeIndex is given here.
- * All other data, can be requested from the ownerDocument via the index.
- */
- DeferredTextImpl(DeferredDocumentImpl ownerDocument, int nodeIndex) {
- super(ownerDocument, null);
-
- fNodeIndex = nodeIndex;
- needsSyncData(true);
-
- } // <init>(DeferredDocumentImpl,int)
-
- //
- // DeferredNode methods
- //
-
- /** Returns the node index. */
- public int getNodeIndex() {
- return fNodeIndex;
- }
-
- //
- // Protected methods
- //
-
- /** Synchronizes the underlying data. */
- protected void synchronizeData() {
-
- // no need for future synchronizations
- needsSyncData(false);
-
- // get initial text value
- DeferredDocumentImpl ownerDocument =
- (DeferredDocumentImpl) this.ownerDocument();
- data = ownerDocument.getNodeValueString(fNodeIndex);
-
- // NOTE: We used to normalize adjacent text node values here.
- // This code has moved to the DeferredDocumentImpl
- // getNodeValueString() method. -Ac
-
- // ignorable whitespace
- isIgnorableWhitespace(ownerDocument.getNodeExtra(fNodeIndex) == 1);
-
- } // synchronizeData()
-
-} // class DeferredTextImpl
diff --git a/src/com/sun/org/apache/xerces/internal/dom/DocumentFragmentImpl.java b/src/com/sun/org/apache/xerces/internal/dom/DocumentFragmentImpl.java
deleted file mode 100644
index 64248e2..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/DocumentFragmentImpl.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-/**
- * DocumentFragment is a "lightweight" or "minimal" Document
- * object. It is very common to want to be able to extract a portion
- * of a document's tree or to create a new fragment of a
- * document. Imagine implementing a user command like cut or
- * rearranging a document by moving fragments around. It is desirable
- * to have an object which can hold such fragments and it is quite
- * natural to use a Node for this purpose. While it is true that a
- * Document object could fulfil this role, a Document object can
- * potentially be a heavyweight object, depending on the underlying
- * implementation... and in DOM Level 1, nodes aren't allowed to cross
- * Document boundaries anyway. What is really needed for this is a
- * very lightweight object. DocumentFragment is such an object.
- * <P>
- * Furthermore, various operations -- such as inserting nodes as
- * children of another Node -- may take DocumentFragment objects as
- * arguments; this results in all the child nodes of the
- * DocumentFragment being moved to the child list of this node.
- * <P>
- * The children of a DocumentFragment node are zero or more nodes
- * representing the tops of any sub-trees defining the structure of
- * the document. DocumentFragment do not need to be well-formed XML
- * documents (although they do need to follow the rules imposed upon
- * well-formed XML parsed entities, which can have multiple top
- * nodes). For example, a DocumentFragment might have only one child
- * and that child node could be a Text node. Such a structure model
- * represents neither an HTML document nor a well-formed XML document.
- * <P>
- * When a DocumentFragment is inserted into a Document (or indeed any
- * other Node that may take children) the children of the
- * DocumentFragment and not the DocumentFragment itself are inserted
- * into the Node. This makes the DocumentFragment very useful when the
- * user wishes to create nodes that are siblings; the DocumentFragment
- * acts as the parent of these nodes so that the user can use the
- * standard methods from the Node interface, such as insertBefore()
- * and appendChild().
- *
- * @xerces.internal
- *
- * @since PR-DOM-Level-1-19980818.
- */
-public class DocumentFragmentImpl
- extends ParentNode
- implements DocumentFragment {
-
- //
- // Constants
- //
-
- /** Serialization version. */
- static final long serialVersionUID = -7596449967279236746L;
-
- //
- // Constructors
- //
-
- /** Factory constructor. */
- public DocumentFragmentImpl(CoreDocumentImpl ownerDoc) {
- super(ownerDoc);
- }
-
- /** Constructor for serialization. */
- public DocumentFragmentImpl() {}
-
- //
- // Node methods
- //
-
- /**
- * A short integer indicating what type of node this is. The named
- * constants for this value are defined in the org.w3c.dom.Node interface.
- */
- public short getNodeType() {
- return Node.DOCUMENT_FRAGMENT_NODE;
- }
-
- /** Returns the node name. */
- public String getNodeName() {
- return "#document-fragment";
- }
-
- /**
- * Override default behavior to call normalize() on this Node's
- * children. It is up to implementors or Node to override normalize()
- * to take action.
- */
- public void normalize() {
- // No need to normalize if already normalized.
- if (isNormalized()) {
- return;
- }
- if (needsSyncChildren()) {
- synchronizeChildren();
- }
- ChildNode kid, next;
-
- for (kid = firstChild; kid != null; kid = next) {
- next = kid.nextSibling;
-
- // If kid is a text node, we need to check for one of two
- // conditions:
- // 1) There is an adjacent text node
- // 2) There is no adjacent text node, but kid is
- // an empty text node.
- if ( kid.getNodeType() == Node.TEXT_NODE )
- {
- // If an adjacent text node, merge it with kid
- if ( next!=null && next.getNodeType() == Node.TEXT_NODE )
- {
- ((Text)kid).appendData(next.getNodeValue());
- removeChild( next );
- next = kid; // Don't advance; there might be another.
- }
- else
- {
- // If kid is empty, remove it
- if ( kid.getNodeValue() == null || kid.getNodeValue().length() == 0 ) {
- removeChild( kid );
- }
- }
- }
-
- kid.normalize();
- }
-
- isNormalized(true);
- }
-
-} // class DocumentFragmentImpl
diff --git a/src/com/sun/org/apache/xerces/internal/dom/DocumentImpl.java b/src/com/sun/org/apache/xerces/internal/dom/DocumentImpl.java
deleted file mode 100644
index a5fe4b8..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/DocumentImpl.java
+++ /dev/null
@@ -1,1379 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-import com.sun.org.apache.xerces.internal.dom.events.EventImpl;
-import com.sun.org.apache.xerces.internal.dom.events.MutationEventImpl;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.ObjectStreamField;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Map;
-import java.util.Vector;
-import org.w3c.dom.Attr;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.UserDataHandler;
-import org.w3c.dom.events.DocumentEvent;
-import org.w3c.dom.events.Event;
-import org.w3c.dom.events.EventException;
-import org.w3c.dom.events.EventListener;
-import org.w3c.dom.events.MutationEvent;
-import org.w3c.dom.ranges.DocumentRange;
-import org.w3c.dom.ranges.Range;
-import org.w3c.dom.traversal.DocumentTraversal;
-import org.w3c.dom.traversal.NodeFilter;
-import org.w3c.dom.traversal.NodeIterator;
-import org.w3c.dom.traversal.TreeWalker;
-
-
-/**
- * The Document interface represents the entire HTML or XML document.
- * Conceptually, it is the root of the document tree, and provides the
- * primary access to the document's data.
- * <P>
- * Since elements, text nodes, comments, processing instructions,
- * etc. cannot exist outside the context of a Document, the Document
- * interface also contains the factory methods needed to create these
- * objects. The Node objects created have a ownerDocument attribute
- * which associates them with the Document within whose context they
- * were created.
- * <p>
- * The DocumentImpl class also implements the DOM Level 2 DocumentTraversal
- * interface. This interface is comprised of factory methods needed to
- * create NodeIterators and TreeWalkers. The process of creating NodeIterator
- * objects also adds these references to this document.
- * After finishing with an iterator it is important to remove the object
- * using the remove methods in this implementation. This allows the release of
- * the references from the iterator objects to the DOM Nodes.
- * <p>
- * <b>Note:</b> When any node in the document is serialized, the
- * entire document is serialized along with it.
- *
- * @xerces.internal
- *
- * @author Arnaud Le Hors, IBM
- * @author Joe Kesselman, IBM
- * @author Andy Clark, IBM
- * @author Ralf Pfeiffer, IBM
- * @version $Id: DocumentImpl.java,v 1.6 2010/07/20 20:25:24 joehw Exp $
- * @since PR-DOM-Level-1-19980818.
- */
-public class DocumentImpl
- extends CoreDocumentImpl
- implements DocumentTraversal, DocumentEvent, DocumentRange {
-
- //
- // Constants
- //
-
- /** Serialization version. */
- static final long serialVersionUID = 515687835542616694L;
-
- //
- // Data
- //
-
- /** Iterators */
- // REVISIT: Should this be transient? -Ac
- protected List<NodeIterator> iterators;
-
- /** Ranges */
- // REVISIT: Should this be transient? -Ac
- protected List<Range> ranges;
-
- /** Table for event listeners registered to this document nodes. */
- protected Map<NodeImpl, List<LEntry>> eventListeners;
-
- /** Bypass mutation events firing. */
- protected boolean mutationEvents = false;
-
-
- /**
- * @serialField iterators Vector Node iterators
- * @serialField ranges Vector ranges
- * @serialField eventListeners Hashtable Event listeners
- * @serialField mutationEvents boolean Bypass mutation events firing
- */
- private static final ObjectStreamField[] serialPersistentFields =
- new ObjectStreamField[] {
- new ObjectStreamField("iterators", Vector.class),
- new ObjectStreamField("ranges", Vector.class),
- new ObjectStreamField("eventListeners", Hashtable.class),
- new ObjectStreamField("mutationEvents", boolean.class),
- };
-
- //
- // Constructors
- //
-
- /**
- * NON-DOM: Actually creating a Document is outside the DOM's spec,
- * since it has to operate in terms of a particular implementation.
- */
- public DocumentImpl() {
- super();
- }
-
- /** Constructor. */
- public DocumentImpl(boolean grammarAccess) {
- super(grammarAccess);
- }
-
- /**
- * For DOM2 support.
- * The createDocument factory method is in DOMImplementation.
- */
- public DocumentImpl(DocumentType doctype)
- {
- super(doctype);
- }
-
- /** For DOM2 support. */
- public DocumentImpl(DocumentType doctype, boolean grammarAccess) {
- super(doctype, grammarAccess);
- }
-
- //
- // Node methods
- //
-
- /**
- * Deep-clone a document, including fixing ownerDoc for the cloned
- * children. Note that this requires bypassing the WRONG_DOCUMENT_ERR
- * protection. I've chosen to implement it by calling importNode
- * which is DOM Level 2.
- *
- * @return org.w3c.dom.Node
- * @param deep boolean, iff true replicate children
- */
- public Node cloneNode(boolean deep) {
-
- DocumentImpl newdoc = new DocumentImpl();
- callUserDataHandlers(this, newdoc, UserDataHandler.NODE_CLONED);
- cloneNode(newdoc, deep);
-
- // experimental
- newdoc.mutationEvents = mutationEvents;
-
- return newdoc;
-
- } // cloneNode(boolean):Node
-
- /**
- * Retrieve information describing the abilities of this particular
- * DOM implementation. Intended to support applications that may be
- * using DOMs retrieved from several different sources, potentially
- * with different underlying representations.
- */
- public DOMImplementation getImplementation() {
- // Currently implemented as a singleton, since it's hardcoded
- // information anyway.
- return DOMImplementationImpl.getDOMImplementation();
- }
-
- //
- // DocumentTraversal methods
- //
-
- /**
- * NON-DOM extension:
- * Create and return a NodeIterator. The NodeIterator is
- * added to a list of NodeIterators so that it can be
- * removed to free up the DOM Nodes it references.
- *
- * @param root The root of the iterator.
- * @param whatToShow The whatToShow mask.
- * @param filter The NodeFilter installed. Null means no filter.
- */
- public NodeIterator createNodeIterator(Node root,
- short whatToShow,
- NodeFilter filter)
- {
- return createNodeIterator(root, whatToShow, filter, true);
- }
-
- /**
- * Create and return a NodeIterator. The NodeIterator is
- * added to a list of NodeIterators so that it can be
- * removed to free up the DOM Nodes it references.
- *
- * @param root The root of the iterator.
- * @param whatToShow The whatToShow mask.
- * @param filter The NodeFilter installed. Null means no filter.
- * @param entityReferenceExpansion true to expand the contents of
- * EntityReference nodes
- * @since WD-DOM-Level-2-19990923
- */
- public NodeIterator createNodeIterator(Node root,
- int whatToShow,
- NodeFilter filter,
- boolean entityReferenceExpansion)
- {
-
- if (root == null) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
- }
-
- NodeIterator iterator = new NodeIteratorImpl(this,
- root,
- whatToShow,
- filter,
- entityReferenceExpansion);
- if (iterators == null) {
- iterators = new ArrayList<>();
- }
-
- iterators.add(iterator);
-
- return iterator;
- }
-
- /**
- * NON-DOM extension:
- * Create and return a TreeWalker.
- *
- * @param root The root of the iterator.
- * @param whatToShow The whatToShow mask.
- * @param filter The NodeFilter installed. Null means no filter.
- */
- public TreeWalker createTreeWalker(Node root,
- short whatToShow,
- NodeFilter filter)
- {
- return createTreeWalker(root, whatToShow, filter, true);
- }
- /**
- * Create and return a TreeWalker.
- *
- * @param root The root of the iterator.
- * @param whatToShow The whatToShow mask.
- * @param filter The NodeFilter installed. Null means no filter.
- * @param entityReferenceExpansion true to expand the contents of
- * EntityReference nodes
- * @since WD-DOM-Level-2-19990923
- */
- public TreeWalker createTreeWalker(Node root,
- int whatToShow,
- NodeFilter filter,
- boolean entityReferenceExpansion)
- {
- if (root == null) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
- }
- return new TreeWalkerImpl(root, whatToShow, filter,
- entityReferenceExpansion);
- }
-
- //
- // Not DOM Level 2. Support DocumentTraversal methods.
- //
-
- /** This is not called by the developer client. The
- * developer client uses the detach() function on the
- * NodeIterator itself. <p>
- *
- * This function is called from the NodeIterator#detach().
- */
- void removeNodeIterator(NodeIterator nodeIterator) {
-
- if (nodeIterator == null) return;
- if (iterators == null) return;
-
- iterators.remove(nodeIterator);
- }
-
- //
- // DocumentRange methods
- //
- /**
- */
- public Range createRange() {
-
- if (ranges == null) {
- ranges = new ArrayList<>();
- }
-
- Range range = new RangeImpl(this);
- ranges.add(range);
-
- return range;
-
- }
-
- /** Not a client function. Called by Range.detach(),
- * so a Range can remove itself from the list of
- * Ranges.
- */
- void removeRange(Range range) {
-
- if (range == null) return;
- if (ranges == null) return;
-
- ranges.remove(range);
- }
-
- /**
- * A method to be called when some text was changed in a text node,
- * so that live objects can be notified.
- */
- void replacedText(NodeImpl node) {
- // notify ranges
- if (ranges != null) {
- int size = ranges.size();
- for (int i = 0; i != size; i++) {
- ((RangeImpl)ranges.get(i)).receiveReplacedText(node);
- }
- }
- }
-
- /**
- * A method to be called when some text was deleted from a text node,
- * so that live objects can be notified.
- */
- void deletedText(NodeImpl node, int offset, int count) {
- // notify ranges
- if (ranges != null) {
- int size = ranges.size();
- for (int i = 0; i != size; i++) {
- ((RangeImpl)ranges.get(i)).receiveDeletedText(node,
- offset, count);
- }
- }
- }
-
- /**
- * A method to be called when some text was inserted into a text node,
- * so that live objects can be notified.
- */
- void insertedText(NodeImpl node, int offset, int count) {
- // notify ranges
- if (ranges != null) {
- int size = ranges.size();
- for (int i = 0; i != size; i++) {
- ((RangeImpl)ranges.get(i)).receiveInsertedText(node,
- offset, count);
- }
- }
- }
-
- /**
- * A method to be called when a text node has been split,
- * so that live objects can be notified.
- */
- void splitData(Node node, Node newNode, int offset) {
- // notify ranges
- if (ranges != null) {
- int size = ranges.size();
- for (int i = 0; i != size; i++) {
- ((RangeImpl)ranges.get(i)).receiveSplitData(node,
- newNode, offset);
- }
- }
- }
-
- //
- // DocumentEvent methods
- //
-
- /**
- * Introduced in DOM Level 2. Optional. <p>
- * Create and return Event objects.
- *
- * @param type The eventType parameter specifies the type of Event
- * interface to be created. If the Event interface specified is supported
- * by the implementation this method will return a new Event of the
- * interface type requested. If the Event is to be dispatched via the
- * dispatchEvent method the appropriate event init method must be called
- * after creation in order to initialize the Event's values. As an
- * example, a user wishing to synthesize some kind of Event would call
- * createEvent with the parameter "Events". The initEvent method could then
- * be called on the newly created Event to set the specific type of Event
- * to be dispatched and set its context information.
- * @return Newly created Event
- * @exception DOMException NOT_SUPPORTED_ERR: Raised if the implementation
- * does not support the type of Event interface requested
- * @since WD-DOM-Level-2-19990923
- */
- public Event createEvent(String type)
- throws DOMException {
- if (type.equalsIgnoreCase("Events") || "Event".equals(type))
- return new EventImpl();
- if (type.equalsIgnoreCase("MutationEvents") ||
- "MutationEvent".equals(type))
- return new MutationEventImpl();
- else {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
- }
- }
-
- /**
- * Sets whether the DOM implementation generates mutation events
- * upon operations.
- */
- void setMutationEvents(boolean set) {
- mutationEvents = set;
- }
-
- /**
- * Returns true if the DOM implementation generates mutation events.
- */
- boolean getMutationEvents() {
- return mutationEvents;
- }
-
- /**
- * Store event listener registered on a given node
- * This is another place where we could use weak references! Indeed, the
- * node here won't be GC'ed as long as some listener is registered on it,
- * since the eventsListeners table will have a reference to the node.
- */
- private void setEventListeners(NodeImpl n, List<LEntry> listeners) {
- if (eventListeners == null) {
- eventListeners = new HashMap<>();
- }
- if (listeners == null) {
- eventListeners.remove(n);
- if (eventListeners.isEmpty()) {
- // stop firing events when there isn't any listener
- mutationEvents = false;
- }
- } else {
- eventListeners.put(n, listeners);
- // turn mutation events on
- mutationEvents = true;
- }
- }
-
- /**
- * Retreive event listener registered on a given node
- */
- private List<LEntry> getEventListeners(NodeImpl n) {
- if (eventListeners == null) {
- return null;
- }
- return eventListeners.get(n);
- }
-
- //
- // EventTarget support (public and internal)
- //
-
- //
- // Constants
- //
-
- /*
- * NON-DOM INTERNAL: Class LEntry is just a struct used to represent
- * event listeners registered with this node. Copies of this object
- * are hung from the nodeListeners Vector.
- * <p>
- * I considered using two vectors -- one for capture,
- * one for bubble -- but decided that since the list of listeners
- * is probably short in most cases, it might not be worth spending
- * the space. ***** REVISIT WHEN WE HAVE MORE EXPERIENCE.
- */
- class LEntry implements Serializable {
-
- private static final long serialVersionUID = -8426757059492421631L;
- String type;
- EventListener listener;
- boolean useCapture;
-
- /** NON-DOM INTERNAL: Constructor for Listener list Entry
- * @param type Event name (NOT event group!) to listen for.
- * @param listener Who gets called when event is dispatched
- * @param useCaptue True iff listener is registered on
- * capturing phase rather than at-target or bubbling
- */
- LEntry(String type, EventListener listener, boolean useCapture)
- {
- this.type = type;
- this.listener = listener;
- this.useCapture = useCapture;
- }
-
- } // LEntry
-
- /**
- * Introduced in DOM Level 2. <p> Register an event listener with this
- * Node. A listener may be independently registered as both Capturing and
- * Bubbling, but may only be registered once per role; redundant
- * registrations are ignored.
- * @param node node to add listener to
- * @param type Event name (NOT event group!) to listen for.
- * @param listener Who gets called when event is dispatched
- * @param useCapture True iff listener is registered on
- * capturing phase rather than at-target or bubbling
- */
- @Override
- protected void addEventListener(NodeImpl node, String type,
- EventListener listener, boolean useCapture)
- {
- // We can't dispatch to blank type-name, and of course we need
- // a listener to dispatch to
- if (type == null || type.equals("") || listener == null)
- return;
-
- // Each listener may be registered only once per type per phase.
- // Simplest way to code that is to zap the previous entry, if any.
- removeEventListener(node, type, listener, useCapture);
-
- List<LEntry> nodeListeners = getEventListeners(node);
- if(nodeListeners == null) {
- nodeListeners = new ArrayList<>();
- setEventListeners(node, nodeListeners);
- }
- nodeListeners.add(new LEntry(type, listener, useCapture));
-
- // Record active listener
- LCount lc = LCount.lookup(type);
- if (useCapture) {
- ++lc.captures;
- ++lc.total;
- }
- else {
- ++lc.bubbles;
- ++lc.total;
- }
-
- } // addEventListener(NodeImpl,String,EventListener,boolean) :void
-
- /**
- * Introduced in DOM Level 2. <p> Deregister an event listener previously
- * registered with this Node. A listener must be independently removed
- * from the Capturing and Bubbling roles. Redundant removals (of listeners
- * not currently registered for this role) are ignored.
- * @param node node to remove listener from
- * @param type Event name (NOT event group!) to listen for.
- * @param listener Who gets called when event is dispatched
- * @param useCapture True iff listener is registered on
- * capturing phase rather than at-target or bubbling
- */
- @Override
- protected void removeEventListener(NodeImpl node, String type,
- EventListener listener,
- boolean useCapture)
- {
- // If this couldn't be a valid listener registration, ignore request
- if (type == null || type.equals("") || listener == null)
- return;
- List<LEntry> nodeListeners = getEventListeners(node);
- if (nodeListeners == null)
- return;
-
- // Note that addListener has previously ensured that
- // each listener may be registered only once per type per phase.
- // count-down is OK for deletions!
- for (int i = nodeListeners.size() - 1; i >= 0; --i) {
- LEntry le = nodeListeners.get(i);
- if (le.useCapture == useCapture && le.listener == listener &&
- le.type.equals(type)) {
- nodeListeners.remove(i);
- // Storage management: Discard empty listener lists
- if (nodeListeners.isEmpty())
- setEventListeners(node, null);
-
- // Remove active listener
- LCount lc = LCount.lookup(type);
- if (useCapture) {
- --lc.captures;
- --lc.total;
- }
- else {
- --lc.bubbles;
- --lc.total;
- }
-
- break; // Found it; no need to loop farther.
- }
- }
- } // removeEventListener(NodeImpl,String,EventListener,boolean) :void
-
- @Override
- protected void copyEventListeners(NodeImpl src, NodeImpl tgt) {
- List<LEntry> nodeListeners = getEventListeners(src);
- if (nodeListeners == null) {
- return;
- }
- setEventListeners(tgt, new ArrayList<>(nodeListeners));
- }
-
- /**
- * Introduced in DOM Level 2. <p>
- * Distribution engine for DOM Level 2 Events.
- * <p>
- * Event propagation runs as follows:
- * <ol>
- * <li>Event is dispatched to a particular target node, which invokes
- * this code. Note that the event's stopPropagation flag is
- * cleared when dispatch begins; thereafter, if it has
- * been set before processing of a node commences, we instead
- * immediately advance to the DEFAULT phase.
- * <li>The node's ancestors are established as destinations for events.
- * For capture and bubble purposes, node ancestry is determined at
- * the time dispatch starts. If an event handler alters the document
- * tree, that does not change which nodes will be informed of the event.
- * <li>CAPTURING_PHASE: Ancestors are scanned, root to target, for
- * Capturing listeners. If found, they are invoked (see below).
- * <li>AT_TARGET:
- * Event is dispatched to NON-CAPTURING listeners on the
- * target node. Note that capturing listeners on this node are _not_
- * invoked.
- * <li>BUBBLING_PHASE: Ancestors are scanned, target to root, for
- * non-capturing listeners.
- * <li>Default processing: Some DOMs have default behaviors bound to
- * specific nodes. If this DOM does, and if the event's preventDefault
- * flag has not been set, we now return to the target node and process
- * its default handler for this event, if any.
- * </ol>
- * <p>
- * Note that registration of handlers during processing of an event does
- * not take effect during this phase of this event; they will not be called
- * until the next time this node is visited by dispatchEvent. On the other
- * hand, removals take effect immediately.
- * <p>
- * If an event handler itself causes events to be dispatched, they are
- * processed synchronously, before processing resumes
- * on the event which triggered them. Please be aware that this may
- * result in events arriving at listeners "out of order" relative
- * to the actual sequence of requests.
- * <p>
- * Note that our implementation resets the event's stop/prevent flags
- * when dispatch begins.
- * I believe the DOM's intent is that event objects be redispatchable,
- * though it isn't stated in those terms.
- * @param node node to dispatch to
- * @param event the event object to be dispatched to
- * registered EventListeners
- * @return true if the event's <code>preventDefault()</code>
- * method was invoked by an EventListener; otherwise false.
- */
- @Override
- protected boolean dispatchEvent(NodeImpl node, Event event) {
- if (event == null) return false;
-
- // Can't use anyone else's implementation, since there's no public
- // API for setting the event's processing-state fields.
- EventImpl evt = (EventImpl)event;
-
- // VALIDATE -- must have been initialized at least once, must have
- // a non-null non-blank name.
- if(!evt.initialized || evt.type == null || evt.type.equals("")) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "UNSPECIFIED_EVENT_TYPE_ERR", null);
- throw new EventException(EventException.UNSPECIFIED_EVENT_TYPE_ERR, msg);
- }
-
- // If nobody is listening for this event, discard immediately
- LCount lc = LCount.lookup(evt.getType());
- if (lc.total == 0)
- return evt.preventDefault;
-
- // INITIALIZE THE EVENT'S DISPATCH STATUS
- // (Note that Event objects are reusable in our implementation;
- // that doesn't seem to be explicitly guaranteed in the DOM, but
- // I believe it is the intent.)
- evt.target = node;
- evt.stopPropagation = false;
- evt.preventDefault = false;
-
- // Capture pre-event parentage chain, not including target;
- // use pre-event-dispatch ancestors even if event handlers mutate
- // document and change the target's context.
- // Note that this is parents ONLY; events do not
- // cross the Attr/Element "blood/brain barrier".
- // DOMAttrModified. which looks like an exception,
- // is issued to the Element rather than the Attr
- // and causes a _second_ DOMSubtreeModified in the Element's
- // tree.
- List<Node> pv = new ArrayList<>(10);
- Node p = node;
- Node n = p.getParentNode();
- while (n != null) {
- pv.add(n);
- p = n;
- n = n.getParentNode();
- }
-
- // CAPTURING_PHASE:
- if (lc.captures > 0) {
- evt.eventPhase = Event.CAPTURING_PHASE;
- // Ancestors are scanned, root to target, for
- // Capturing listeners.
- for (int j = pv.size() - 1; j >= 0; --j) {
- if (evt.stopPropagation)
- break; // Someone set the flag. Phase ends.
-
- // Handle all capturing listeners on this node
- NodeImpl nn = (NodeImpl) pv.get(j);
- evt.currentTarget = nn;
- List<LEntry> nodeListeners = getEventListeners(nn);
- if (nodeListeners != null) {
- List<LEntry> nl = (List)((ArrayList)nodeListeners).clone();
- // call listeners in the order in which they got registered
- int nlsize = nl.size();
- for (int i = 0; i < nlsize; i++) {
- LEntry le = nl.get(i);
- if (le.useCapture && le.type.equals(evt.type) &&
- nodeListeners.contains(le)) {
- try {
- le.listener.handleEvent(evt);
- }
- catch (Exception e) {
- // All exceptions are ignored.
- }
- }
- }
- }
- }
- }
-
-
- // Both AT_TARGET and BUBBLE use non-capturing listeners.
- if (lc.bubbles > 0) {
- // AT_TARGET PHASE: Event is dispatched to NON-CAPTURING listeners
- // on the target node. Note that capturing listeners on the target
- // node are _not_ invoked, even during the capture phase.
- evt.eventPhase = Event.AT_TARGET;
- evt.currentTarget = node;
- List<LEntry> nodeListeners = getEventListeners(node);
- if (!evt.stopPropagation && nodeListeners != null) {
- List<LEntry> nl = (List)((ArrayList)nodeListeners).clone();
- // call listeners in the order in which they got registered
- int nlsize = nl.size();
- for (int i = 0; i < nlsize; i++) {
- LEntry le = (LEntry) nl.get(i);
- if (!le.useCapture && le.type.equals(evt.type) &&
- nodeListeners.contains(le)) {
- try {
- le.listener.handleEvent(evt);
- }
- catch (Exception e) {
- // All exceptions are ignored.
- }
- }
- }
- }
- // BUBBLING_PHASE: Ancestors are scanned, target to root, for
- // non-capturing listeners. If the event's preventBubbling flag
- // has been set before processing of a node commences, we
- // instead immediately advance to the default phase.
- // Note that not all events bubble.
- if (evt.bubbles) {
- evt.eventPhase = Event.BUBBLING_PHASE;
- int pvsize = pv.size();
- for (int j = 0; j < pvsize; j++) {
- if (evt.stopPropagation)
- break; // Someone set the flag. Phase ends.
-
- // Handle all bubbling listeners on this node
- NodeImpl nn = (NodeImpl) pv.get(j);
- evt.currentTarget = nn;
- nodeListeners = getEventListeners(nn);
- if (nodeListeners != null) {
- List<LEntry> nl = (List)((ArrayList)nodeListeners).clone();
- // call listeners in the order in which they got
- // registered
- int nlsize = nl.size();
- for (int i = 0; i < nlsize; i++) {
- LEntry le = nl.get(i);
- if (!le.useCapture && le.type.equals(evt.type) &&
- nodeListeners.contains(le)) {
- try {
- le.listener.handleEvent(evt);
- }
- catch (Exception e) {
- // All exceptions are ignored.
- }
- }
- }
- }
- }
- }
- }
-
- // DEFAULT PHASE: Some DOMs have default behaviors bound to specific
- // nodes. If this DOM does, and if the event's preventDefault flag has
- // not been set, we now return to the target node and process its
- // default handler for this event, if any.
- // No specific phase value defined, since this is DOM-internal
- if (lc.defaults > 0 && (!evt.cancelable || !evt.preventDefault)) {
- // evt.eventPhase = Event.DEFAULT_PHASE;
- // evt.currentTarget = node;
- // DO_DEFAULT_OPERATION
- }
-
- return evt.preventDefault;
- } // dispatchEvent(NodeImpl,Event) :boolean
-
- /**
- * NON-DOM INTERNAL: DOMNodeInsertedIntoDocument and ...RemovedFrom...
- * are dispatched to an entire subtree. This is the distribution code
- * therefor. They DO NOT bubble, thanks be, but may be captured.
- * <p>
- * Similar to code in dispatchingEventToSubtree however this method
- * is only used on the target node and does not start a dispatching chain
- * on the sibling of the target node as this is not part of the subtree
- * ***** At the moment I'm being sloppy and using the normal
- * capture dispatcher on every node. This could be optimized hugely
- * by writing a capture engine that tracks our position in the tree to
- * update the capture chain without repeated chases up to root.
- * @param n target node (that was directly inserted or removed)
- * @param e event to be sent to that node and its subtree
- */
- protected void dispatchEventToSubtree(Node n, Event e) {
-
- ((NodeImpl) n).dispatchEvent(e);
- if (n.getNodeType() == Node.ELEMENT_NODE) {
- NamedNodeMap a = n.getAttributes();
- for (int i = a.getLength() - 1; i >= 0; --i)
- dispatchingEventToSubtree(a.item(i), e);
- }
- dispatchingEventToSubtree(n.getFirstChild(), e);
-
- } // dispatchEventToSubtree(NodeImpl,Node,Event) :void
-
-
- /**
- * Dispatches event to the target node's descendents recursively
- *
- * @param n node to dispatch to
- * @param e event to be sent to that node and its subtree
- */
- protected void dispatchingEventToSubtree(Node n, Event e) {
- if (n==null)
- return;
-
- // ***** Recursive implementation. This is excessively expensive,
- // and should be replaced in conjunction with optimization
- // mentioned above.
- ((NodeImpl) n).dispatchEvent(e);
- if (n.getNodeType() == Node.ELEMENT_NODE) {
- NamedNodeMap a = n.getAttributes();
- for (int i = a.getLength() - 1; i >= 0; --i)
- dispatchingEventToSubtree(a.item(i), e);
- }
- dispatchingEventToSubtree(n.getFirstChild(), e);
- dispatchingEventToSubtree(n.getNextSibling(), e);
- }
-
- /**
- * NON-DOM INTERNAL: Return object for getEnclosingAttr. Carries
- * (two values, the Attr node affected (if any) and its previous
- * string value. Simple struct, no methods.
- */
- class EnclosingAttr implements Serializable {
- private static final long serialVersionUID = 5208387723391647216L;
- AttrImpl node;
- String oldvalue;
- }
-
- EnclosingAttr savedEnclosingAttr;
-
- /**
- * NON-DOM INTERNAL: Convenience wrapper for calling
- * dispatchAggregateEvents when the context was established
- * by <code>savedEnclosingAttr</code>.
- * @param node node to dispatch to
- * @param ea description of Attr affected by current operation
- */
- protected void dispatchAggregateEvents(NodeImpl node, EnclosingAttr ea) {
- if (ea != null)
- dispatchAggregateEvents(node, ea.node, ea.oldvalue,
- MutationEvent.MODIFICATION);
- else
- dispatchAggregateEvents(node, null, null, (short) 0);
-
- } // dispatchAggregateEvents(NodeImpl,EnclosingAttr) :void
-
- /**
- * NON-DOM INTERNAL: Generate the "aggregated" post-mutation events
- * DOMAttrModified and DOMSubtreeModified.
- * Both of these should be issued only once for each user-requested
- * mutation operation, even if that involves multiple changes to
- * the DOM.
- * For example, if a DOM operation makes multiple changes to a single
- * Attr before returning, it would be nice to generate only one
- * DOMAttrModified, and multiple changes over larger scope but within
- * a recognizable single subtree might want to generate only one
- * DOMSubtreeModified, sent to their lowest common ancestor.
- * <p>
- * To manage this, use the "internal" versions of insert and remove
- * with MUTATION_LOCAL, then make an explicit call to this routine
- * at the higher level. Some examples now exist in our code.
- *
- * @param node The node to dispatch to
- * @param enclosingAttr The Attr node (if any) whose value has been changed
- * as a result of the DOM operation. Null if none such.
- * @param oldValue The String value previously held by the
- * enclosingAttr. Ignored if none such.
- * @param change Type of modification to the attr. See
- * MutationEvent.attrChange
- */
- protected void dispatchAggregateEvents(NodeImpl node,
- AttrImpl enclosingAttr,
- String oldvalue, short change) {
- // We have to send DOMAttrModified.
- NodeImpl owner = null;
- if (enclosingAttr != null) {
- LCount lc = LCount.lookup(MutationEventImpl.DOM_ATTR_MODIFIED);
- owner = (NodeImpl) enclosingAttr.getOwnerElement();
- if (lc.total > 0) {
- if (owner != null) {
- MutationEventImpl me = new MutationEventImpl();
- me.initMutationEvent(MutationEventImpl.DOM_ATTR_MODIFIED,
- true, false, enclosingAttr,
- oldvalue,
- enclosingAttr.getNodeValue(),
- enclosingAttr.getNodeName(),
- change);
- owner.dispatchEvent(me);
- }
- }
- }
- // DOMSubtreeModified gets sent to the lowest common root of a
- // set of changes.
- // "This event is dispatched after all other events caused by the
- // mutation have been fired."
- LCount lc = LCount.lookup(MutationEventImpl.DOM_SUBTREE_MODIFIED);
- if (lc.total > 0) {
- MutationEvent me = new MutationEventImpl();
- me.initMutationEvent(MutationEventImpl.DOM_SUBTREE_MODIFIED,
- true, false, null, null,
- null, null, (short) 0);
-
- // If we're within an Attr, DStM gets sent to the Attr
- // and to its owningElement. Otherwise we dispatch it
- // locally.
- if (enclosingAttr != null) {
- dispatchEvent(enclosingAttr, me);
- if (owner != null)
- dispatchEvent(owner, me);
- }
- else
- dispatchEvent(node, me);
- }
- } // dispatchAggregateEvents(NodeImpl, AttrImpl,String) :void
-
- /**
- * NON-DOM INTERNAL: Pre-mutation context check, in
- * preparation for later generating DOMAttrModified events.
- * Determines whether this node is within an Attr
- * @param node node to get enclosing attribute for
- * @return either a description of that Attr, or null if none such.
- */
- protected void saveEnclosingAttr(NodeImpl node) {
- savedEnclosingAttr = null;
- // MUTATION PREPROCESSING AND PRE-EVENTS:
- // If we're within the scope of an Attr and DOMAttrModified
- // was requested, we need to preserve its previous value for
- // that event.
- LCount lc = LCount.lookup(MutationEventImpl.DOM_ATTR_MODIFIED);
- if (lc.total > 0) {
- NodeImpl eventAncestor = node;
- while (true) {
- if (eventAncestor == null)
- return;
- int type = eventAncestor.getNodeType();
- if (type == Node.ATTRIBUTE_NODE) {
- EnclosingAttr retval = new EnclosingAttr();
- retval.node = (AttrImpl) eventAncestor;
- retval.oldvalue = retval.node.getNodeValue();
- savedEnclosingAttr = retval;
- return;
- }
- else if (type == Node.ENTITY_REFERENCE_NODE)
- eventAncestor = eventAncestor.parentNode();
- else if (type == Node.TEXT_NODE)
- eventAncestor = eventAncestor.parentNode();
- else
- return;
- // Any other parent means we're not in an Attr
- }
- }
- } // saveEnclosingAttr(NodeImpl) :void
-
- /**
- * A method to be called when a character data node has been modified
- */
- void modifyingCharacterData(NodeImpl node, boolean replace) {
- if (mutationEvents) {
- if (!replace) {
- saveEnclosingAttr(node);
- }
- }
- }
-
- /**
- * A method to be called when a character data node has been modified
- */
- void modifiedCharacterData(NodeImpl node, String oldvalue, String value, boolean replace) {
- if (mutationEvents) {
- if (!replace) {
- // MUTATION POST-EVENTS:
- LCount lc =
- LCount.lookup(MutationEventImpl.DOM_CHARACTER_DATA_MODIFIED);
- if (lc.total > 0) {
- MutationEvent me = new MutationEventImpl();
- me.initMutationEvent(
- MutationEventImpl.DOM_CHARACTER_DATA_MODIFIED,
- true, false, null,
- oldvalue, value, null, (short) 0);
- dispatchEvent(node, me);
- }
-
- // Subroutine: Transmit DOMAttrModified and DOMSubtreeModified,
- // if required. (Common to most kinds of mutation)
- dispatchAggregateEvents(node, savedEnclosingAttr);
- } // End mutation postprocessing
- }
- }
-
- /**
- * A method to be called when a character data node has been replaced
- */
- void replacedCharacterData(NodeImpl node, String oldvalue, String value) {
- //now that we have finished replacing data, we need to perform the same actions
- //that are required after a character data node has been modified
- //send the value of false for replace parameter so that mutation
- //events if appropriate will be initiated
- modifiedCharacterData(node, oldvalue, value, false);
- }
-
-
-
- /**
- * A method to be called when a node is about to be inserted in the tree.
- */
- void insertingNode(NodeImpl node, boolean replace) {
- if (mutationEvents) {
- if (!replace) {
- saveEnclosingAttr(node);
- }
- }
- }
-
- /**
- * A method to be called when a node has been inserted in the tree.
- */
- void insertedNode(NodeImpl node, NodeImpl newInternal, boolean replace) {
- if (mutationEvents) {
- // MUTATION POST-EVENTS:
- // "Local" events (non-aggregated)
- // New child is told it was inserted, and where
- LCount lc = LCount.lookup(MutationEventImpl.DOM_NODE_INSERTED);
- if (lc.total > 0) {
- MutationEventImpl me = new MutationEventImpl();
- me.initMutationEvent(MutationEventImpl.DOM_NODE_INSERTED,
- true, false, node,
- null, null, null, (short) 0);
- dispatchEvent(newInternal, me);
- }
-
- // If within the Document, tell the subtree it's been added
- // to the Doc.
- lc = LCount.lookup(
- MutationEventImpl.DOM_NODE_INSERTED_INTO_DOCUMENT);
- if (lc.total > 0) {
- NodeImpl eventAncestor = node;
- if (savedEnclosingAttr != null)
- eventAncestor = (NodeImpl)
- savedEnclosingAttr.node.getOwnerElement();
- if (eventAncestor != null) { // Might have been orphan Attr
- NodeImpl p = eventAncestor;
- while (p != null) {
- eventAncestor = p; // Last non-null ancestor
- // In this context, ancestry includes
- // walking back from Attr to Element
- if (p.getNodeType() == ATTRIBUTE_NODE) {
- p = (NodeImpl) ((AttrImpl)p).getOwnerElement();
- }
- else {
- p = p.parentNode();
- }
- }
- if (eventAncestor.getNodeType() == Node.DOCUMENT_NODE){
- MutationEventImpl me = new MutationEventImpl();
- me.initMutationEvent(MutationEventImpl
- .DOM_NODE_INSERTED_INTO_DOCUMENT,
- false,false,null,null,
- null,null,(short)0);
- dispatchEventToSubtree(newInternal, me);
- }
- }
- }
- if (!replace) {
- // Subroutine: Transmit DOMAttrModified and DOMSubtreeModified
- // (Common to most kinds of mutation)
- dispatchAggregateEvents(node, savedEnclosingAttr);
- }
- }
-
- // notify the range of insertions
- if (ranges != null) {
- int size = ranges.size();
- for (int i = 0; i != size; i++) {
- ((RangeImpl)ranges.get(i)).insertedNodeFromDOM(newInternal);
- }
- }
- }
-
- /**
- * A method to be called when a node is about to be removed from the tree.
- */
- void removingNode(NodeImpl node, NodeImpl oldChild, boolean replace) {
-
- // notify iterators
- if (iterators != null) {
- int size = iterators.size();
- for (int i = 0; i != size; i++) {
- ((NodeIteratorImpl)iterators.get(i)).removeNode(oldChild);
- }
- }
-
- // notify ranges
- if (ranges != null) {
- int size = ranges.size();
- for (int i = 0; i != size; i++) {
- ((RangeImpl)ranges.get(i)).removeNode(oldChild);
- }
- }
-
- // mutation events
- if (mutationEvents) {
- // MUTATION PREPROCESSING AND PRE-EVENTS:
- // If we're within the scope of an Attr and DOMAttrModified
- // was requested, we need to preserve its previous value for
- // that event.
- if (!replace) {
- saveEnclosingAttr(node);
- }
- // Child is told that it is about to be removed
- LCount lc = LCount.lookup(MutationEventImpl.DOM_NODE_REMOVED);
- if (lc.total > 0) {
- MutationEventImpl me= new MutationEventImpl();
- me.initMutationEvent(MutationEventImpl.DOM_NODE_REMOVED,
- true, false, node, null,
- null, null, (short) 0);
- dispatchEvent(oldChild, me);
- }
-
- // If within Document, child's subtree is informed that it's
- // losing that status
- lc = LCount.lookup(
- MutationEventImpl.DOM_NODE_REMOVED_FROM_DOCUMENT);
- if (lc.total > 0) {
- NodeImpl eventAncestor = this;
- if(savedEnclosingAttr != null)
- eventAncestor = (NodeImpl)
- savedEnclosingAttr.node.getOwnerElement();
- if (eventAncestor != null) { // Might have been orphan Attr
- for (NodeImpl p = eventAncestor.parentNode();
- p != null; p = p.parentNode()) {
- eventAncestor = p; // Last non-null ancestor
- }
- if (eventAncestor.getNodeType() == Node.DOCUMENT_NODE){
- MutationEventImpl me = new MutationEventImpl();
- me.initMutationEvent(
- MutationEventImpl.DOM_NODE_REMOVED_FROM_DOCUMENT,
- false, false, null,
- null, null, null, (short) 0);
- dispatchEventToSubtree(oldChild, me);
- }
- }
- }
- } // End mutation preprocessing
- }
-
- /**
- * A method to be called when a node has been removed from the tree.
- */
- void removedNode(NodeImpl node, boolean replace) {
- if (mutationEvents) {
- // MUTATION POST-EVENTS:
- // Subroutine: Transmit DOMAttrModified and DOMSubtreeModified,
- // if required. (Common to most kinds of mutation)
- if (!replace) {
- dispatchAggregateEvents(node, savedEnclosingAttr);
- }
- } // End mutation postprocessing
- }
-
- /**
- * A method to be called when a node is about to be replaced in the tree.
- */
- void replacingNode(NodeImpl node) {
- if (mutationEvents) {
- saveEnclosingAttr(node);
- }
- }
-
- /**
- * A method to be called when character data is about to be replaced in the tree.
- */
- void replacingData (NodeImpl node) {
- if (mutationEvents) {
- saveEnclosingAttr(node);
- }
- }
-
- /**
- * A method to be called when a node has been replaced in the tree.
- */
- void replacedNode(NodeImpl node) {
- if (mutationEvents) {
- dispatchAggregateEvents(node, savedEnclosingAttr);
- }
- }
-
- /**
- * A method to be called when an attribute value has been modified
- */
- void modifiedAttrValue(AttrImpl attr, String oldvalue) {
- if (mutationEvents) {
- // MUTATION POST-EVENTS:
- dispatchAggregateEvents(attr, attr, oldvalue,
- MutationEvent.MODIFICATION);
- }
- }
-
- /**
- * A method to be called when an attribute node has been set
- */
- void setAttrNode(AttrImpl attr, AttrImpl previous) {
- if (mutationEvents) {
- // MUTATION POST-EVENTS:
- if (previous == null) {
- dispatchAggregateEvents(attr.ownerNode, attr, null,
- MutationEvent.ADDITION);
- }
- else {
- dispatchAggregateEvents(attr.ownerNode, attr,
- previous.getNodeValue(),
- MutationEvent.MODIFICATION);
- }
- }
- }
-
- /**
- * A method to be called when an attribute node has been removed
- */
- void removedAttrNode(AttrImpl attr, NodeImpl oldOwner, String name) {
- // We can't use the standard dispatchAggregate, since it assumes
- // that the Attr is still attached to an owner. This code is
- // similar but dispatches to the previous owner, "element".
- if (mutationEvents) {
- // If we have to send DOMAttrModified (determined earlier),
- // do so.
- LCount lc = LCount.lookup(MutationEventImpl.DOM_ATTR_MODIFIED);
- if (lc.total > 0) {
- MutationEventImpl me= new MutationEventImpl();
- me.initMutationEvent(MutationEventImpl.DOM_ATTR_MODIFIED,
- true, false, attr,
- attr.getNodeValue(), null, name,
- MutationEvent.REMOVAL);
- dispatchEvent(oldOwner, me);
- }
-
- // We can hand off to process DOMSubtreeModified, though.
- // Note that only the Element needs to be informed; the
- // Attr's subtree has not been changed by this operation.
- dispatchAggregateEvents(oldOwner, null, null, (short) 0);
- }
- }
-
-
- /**
- * A method to be called when an attribute node has been renamed
- */
- void renamedAttrNode(Attr oldAt, Attr newAt) {
- // REVISIT: To be implemented!!!
- }
-
- /**
- * A method to be called when an element has been renamed
- */
- void renamedElement(Element oldEl, Element newEl) {
- // REVISIT: To be implemented!!!
- }
-
-
- /**
- * @serialData Serialized fields. Convert Maps to Hashtables and Lists
- * to Vectors for backward compatibility.
- */
- private void writeObject(ObjectOutputStream out) throws IOException {
- // Convert Maps to Hashtables, Lists to Vectors
- Vector<NodeIterator> it = (iterators == null)? null : new Vector<>(iterators);
- Vector<Range> r = (ranges == null)? null : new Vector<>(ranges);
-
- Hashtable<NodeImpl, Vector<LEntry>> el = null;
- if (eventListeners != null) {
- el = new Hashtable<>();
- for (Map.Entry<NodeImpl, List<LEntry>> e : eventListeners.entrySet()) {
- el.put(e.getKey(), new Vector<>(e.getValue()));
- }
- }
-
- // Write serialized fields
- ObjectOutputStream.PutField pf = out.putFields();
- pf.put("iterators", it);
- pf.put("ranges", r);
- pf.put("eventListeners", el);
- pf.put("mutationEvents", mutationEvents);
- out.writeFields();
- }
-
- @SuppressWarnings("unchecked")
- private void readObject(ObjectInputStream in)
- throws IOException, ClassNotFoundException {
- // We have to read serialized fields first.
- ObjectInputStream.GetField gf = in.readFields();
- Vector<NodeIterator> it = (Vector<NodeIterator>)gf.get("iterators", null);
- Vector<Range> r = (Vector<Range>)gf.get("ranges", null);
- Hashtable<NodeImpl, Vector<LEntry>> el =
- (Hashtable<NodeImpl, Vector<LEntry>>)gf.get("eventListeners", null);
-
- mutationEvents = gf.get("mutationEvents", false);
-
- //convert Hashtables back to HashMaps and Vectors to Lists
- if (it != null) iterators = new ArrayList<>(it);
- if (r != null) ranges = new ArrayList<>(r);
- if (el != null) {
- eventListeners = new HashMap<>();
- for (Map.Entry<NodeImpl, Vector<LEntry>> e : el.entrySet()) {
- eventListeners.put(e.getKey(), new ArrayList<>(e.getValue()));
- }
- }
- }
-} // class DocumentImpl
diff --git a/src/com/sun/org/apache/xerces/internal/dom/DocumentTypeImpl.java b/src/com/sun/org/apache/xerces/internal/dom/DocumentTypeImpl.java
deleted file mode 100644
index 6bec51b..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/DocumentTypeImpl.java
+++ /dev/null
@@ -1,558 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.ObjectStreamField;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Map;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.UserDataHandler;
-
-/**
- * This class represents a Document Type <em>declaraction</em> in
- * the document itself, <em>not</em> a Document Type Definition (DTD).
- * An XML document may (or may not) have such a reference.
- * <P>
- * DocumentType is an Extended DOM feature, used in XML documents but
- * not in HTML.
- * <P>
- * Note that Entities and Notations are no longer children of the
- * DocumentType, but are parentless nodes hung only in their
- * appropriate NamedNodeMaps.
- * <P>
- * This area is UNDERSPECIFIED IN REC-DOM-Level-1-19981001
- * Most notably, absolutely no provision was made for storing
- * and using Element and Attribute information. Nor was the linkage
- * between Entities and Entity References nailed down solidly.
- *
- * @xerces.internal
- *
- * @author Arnaud Le Hors, IBM
- * @author Joe Kesselman, IBM
- * @author Andy Clark, IBM
- * @since PR-DOM-Level-1-19980818.
- */
-public class DocumentTypeImpl
- extends ParentNode
- implements DocumentType {
-
- //
- // Constants
- //
-
- /** Serialization version. */
- static final long serialVersionUID = 7751299192316526485L;
-
- //
- // Data
- //
-
- /** Document type name. */
- protected String name;
-
- /** Entities. */
- protected NamedNodeMapImpl entities;
-
- /** Notations. */
- protected NamedNodeMapImpl notations;
-
- // NON-DOM
-
- /** Elements. */
- protected NamedNodeMapImpl elements;
-
- // DOM2: support public ID.
- protected String publicID;
-
- // DOM2: support system ID.
- protected String systemID;
-
- // DOM2: support internal subset.
- protected String internalSubset;
-
- /** The following are required for compareDocumentPosition
- */
- // Doctype number. Doc types which have no owner may be assigned
- // a number, on demand, for ordering purposes for compareDocumentPosition
- private int doctypeNumber=0;
-
- private Map<String, UserDataRecord> userData = null;
-
-
- /**
- * @serialField name String document type name
- * @serialField entities NamedNodeMapImpl entities
- * @serialField notations NamedNodeMapImpl notations
- * @serialField elements NamedNodeMapImpl elements
- * @serialField publicID String support public ID
- * @serialField systemID String support system ID
- * @serialField internalSubset String support internal subset
- * @serialField doctypeNumber int Doctype number
- * @serialField userData Hashtable user data
- */
- private static final ObjectStreamField[] serialPersistentFields =
- new ObjectStreamField[] {
- new ObjectStreamField("name", String.class),
- new ObjectStreamField("entities", NamedNodeMapImpl.class),
- new ObjectStreamField("notations", NamedNodeMapImpl.class),
- new ObjectStreamField("elements", NamedNodeMapImpl.class),
- new ObjectStreamField("publicID", String.class),
- new ObjectStreamField("systemID", String.class),
- new ObjectStreamField("internalSubset", String.class),
- new ObjectStreamField("doctypeNumber", int.class),
- new ObjectStreamField("userData", Hashtable.class),
- };
-
- //
- // Constructors
- //
-
- /** Factory method for creating a document type node. */
- public DocumentTypeImpl(CoreDocumentImpl ownerDocument, String name) {
- super(ownerDocument);
-
- this.name = name;
- // DOM
- entities = new NamedNodeMapImpl(this);
- notations = new NamedNodeMapImpl(this);
-
- // NON-DOM
- elements = new NamedNodeMapImpl(this);
-
- } // <init>(CoreDocumentImpl,String)
-
- /** Factory method for creating a document type node. */
- public DocumentTypeImpl(CoreDocumentImpl ownerDocument,
- String qualifiedName,
- String publicID, String systemID) {
- this(ownerDocument, qualifiedName);
- this.publicID = publicID;
- this.systemID = systemID;
-
- } // <init>(CoreDocumentImpl,String)
-
- //
- // DOM2: methods.
- //
-
- /**
- * Introduced in DOM Level 2. <p>
- *
- * Return the public identifier of this Document type.
- * @since WD-DOM-Level-2-19990923
- */
- public String getPublicId() {
- if (needsSyncData()) {
- synchronizeData();
- }
- return publicID;
- }
- /**
- * Introduced in DOM Level 2. <p>
- *
- * Return the system identifier of this Document type.
- * @since WD-DOM-Level-2-19990923
- */
- public String getSystemId() {
- if (needsSyncData()) {
- synchronizeData();
- }
- return systemID;
- }
-
- /**
- * NON-DOM. <p>
- *
- * Set the internalSubset given as a string.
- */
- public void setInternalSubset(String internalSubset) {
- if (needsSyncData()) {
- synchronizeData();
- }
- this.internalSubset = internalSubset;
- }
-
- /**
- * Introduced in DOM Level 2. <p>
- *
- * Return the internalSubset given as a string.
- * @since WD-DOM-Level-2-19990923
- */
- public String getInternalSubset() {
- if (needsSyncData()) {
- synchronizeData();
- }
- return internalSubset;
- }
-
- //
- // Node methods
- //
-
- /**
- * A short integer indicating what type of node this is. The named
- * constants for this value are defined in the org.w3c.dom.Node interface.
- */
- public short getNodeType() {
- return Node.DOCUMENT_TYPE_NODE;
- }
-
- /**
- * Returns the document type name
- */
- public String getNodeName() {
- if (needsSyncData()) {
- synchronizeData();
- }
- return name;
- }
-
- /** Clones the node. */
- public Node cloneNode(boolean deep) {
-
- DocumentTypeImpl newnode = (DocumentTypeImpl)super.cloneNode(deep);
- // NamedNodeMaps must be cloned explicitly, to avoid sharing them.
- newnode.entities = entities.cloneMap(newnode);
- newnode.notations = notations.cloneMap(newnode);
- newnode.elements = elements.cloneMap(newnode);
-
- return newnode;
-
- } // cloneNode(boolean):Node
-
- /*
- * Get Node text content
- * @since DOM Level 3
- */
- public String getTextContent() throws DOMException {
- return null;
- }
-
- /*
- * Set Node text content
- * @since DOM Level 3
- */
- public void setTextContent(String textContent)
- throws DOMException {
- // no-op
- }
-
- /**
- * DOM Level 3 WD- Experimental.
- * Override inherited behavior from ParentNodeImpl to support deep equal.
- */
- public boolean isEqualNode(Node arg) {
-
- if (!super.isEqualNode(arg)) {
- return false;
- }
-
- if (needsSyncData()) {
- synchronizeData();
- }
- DocumentTypeImpl argDocType = (DocumentTypeImpl) arg;
-
- //test if the following string attributes are equal: publicId,
- //systemId, internalSubset.
- if ((getPublicId() == null && argDocType.getPublicId() != null)
- || (getPublicId() != null && argDocType.getPublicId() == null)
- || (getSystemId() == null && argDocType.getSystemId() != null)
- || (getSystemId() != null && argDocType.getSystemId() == null)
- || (getInternalSubset() == null
- && argDocType.getInternalSubset() != null)
- || (getInternalSubset() != null
- && argDocType.getInternalSubset() == null)) {
- return false;
- }
-
- if (getPublicId() != null) {
- if (!getPublicId().equals(argDocType.getPublicId())) {
- return false;
- }
- }
-
- if (getSystemId() != null) {
- if (!getSystemId().equals(argDocType.getSystemId())) {
- return false;
- }
- }
-
- if (getInternalSubset() != null) {
- if (!getInternalSubset().equals(argDocType.getInternalSubset())) {
- return false;
- }
- }
-
- //test if NamedNodeMaps entities and notations are equal
- NamedNodeMapImpl argEntities = argDocType.entities;
-
- if ((entities == null && argEntities != null)
- || (entities != null && argEntities == null))
- return false;
-
- if (entities != null && argEntities != null) {
- if (entities.getLength() != argEntities.getLength())
- return false;
-
- for (int index = 0; entities.item(index) != null; index++) {
- Node entNode1 = entities.item(index);
- Node entNode2 =
- argEntities.getNamedItem(entNode1.getNodeName());
-
- if (!((NodeImpl) entNode1).isEqualNode((NodeImpl) entNode2))
- return false;
- }
- }
-
- NamedNodeMapImpl argNotations = argDocType.notations;
-
- if ((notations == null && argNotations != null)
- || (notations != null && argNotations == null))
- return false;
-
- if (notations != null && argNotations != null) {
- if (notations.getLength() != argNotations.getLength())
- return false;
-
- for (int index = 0; notations.item(index) != null; index++) {
- Node noteNode1 = notations.item(index);
- Node noteNode2 =
- argNotations.getNamedItem(noteNode1.getNodeName());
-
- if (!((NodeImpl) noteNode1).isEqualNode((NodeImpl) noteNode2))
- return false;
- }
- }
-
- return true;
- } //end isEqualNode
-
-
- /**
- * NON-DOM
- * set the ownerDocument of this node and its children
- */
- void setOwnerDocument(CoreDocumentImpl doc) {
- super.setOwnerDocument(doc);
- entities.setOwnerDocument(doc);
- notations.setOwnerDocument(doc);
- elements.setOwnerDocument(doc);
- }
-
- /** NON-DOM
- Get the number associated with this doctype.
- */
- protected int getNodeNumber() {
- // If the doctype has a document owner, get the node number
- // relative to the owner doc
- if (getOwnerDocument()!=null)
- return super.getNodeNumber();
-
- // The doctype is disconnected and not associated with any document.
- // Assign the doctype a number relative to the implementation.
- if (doctypeNumber==0) {
-
- CoreDOMImplementationImpl cd = (CoreDOMImplementationImpl)CoreDOMImplementationImpl.getDOMImplementation();
- doctypeNumber = cd.assignDocTypeNumber();
- }
- return doctypeNumber;
- }
-
- //
- // DocumentType methods
- //
-
- /**
- * Name of this document type. If we loaded from a DTD, this should
- * be the name immediately following the DOCTYPE keyword.
- */
- public String getName() {
-
- if (needsSyncData()) {
- synchronizeData();
- }
- return name;
-
- } // getName():String
-
- /**
- * Access the collection of general Entities, both external and
- * internal, defined in the DTD. For example, in:
- * <p>
- * <pre>
- * &lt;!doctype example SYSTEM "ex.dtd" [
- * &lt;!ENTITY foo "foo"&gt;
- * &lt;!ENTITY bar "bar"&gt;
- * &lt;!ENTITY % baz "baz"&gt;
- * ]&gt;
- * </pre>
- * <p>
- * The Entities map includes foo and bar, but not baz. It is promised that
- * only Nodes which are Entities will exist in this NamedNodeMap.
- * <p>
- * For HTML, this will always be null.
- * <p>
- * Note that "built in" entities such as &amp; and &lt; should be
- * converted to their actual characters before being placed in the DOM's
- * contained text, and should be converted back when the DOM is rendered
- * as XML or HTML, and hence DO NOT appear here.
- */
- public NamedNodeMap getEntities() {
- if (needsSyncChildren()) {
- synchronizeChildren();
- }
- return entities;
- }
-
- /**
- * Access the collection of Notations defined in the DTD. A
- * notation declares, by name, the format of an XML unparsed entity
- * or is used to formally declare a Processing Instruction target.
- */
- public NamedNodeMap getNotations() {
- if (needsSyncChildren()) {
- synchronizeChildren();
- }
- return notations;
- }
-
- //
- // Public methods
- //
-
- /**
- * NON-DOM: Subclassed to flip the entities' and notations' readonly switch
- * as well.
- * @see NodeImpl#setReadOnly
- */
- public void setReadOnly(boolean readOnly, boolean deep) {
-
- if (needsSyncChildren()) {
- synchronizeChildren();
- }
- super.setReadOnly(readOnly, deep);
-
- // set read-only property
- elements.setReadOnly(readOnly, true);
- entities.setReadOnly(readOnly, true);
- notations.setReadOnly(readOnly, true);
-
- } // setReadOnly(boolean,boolean)
-
- /**
- * NON-DOM: Access the collection of ElementDefinitions.
- * @see ElementDefinitionImpl
- */
- public NamedNodeMap getElements() {
- if (needsSyncChildren()) {
- synchronizeChildren();
- }
- return elements;
- }
-
- public Object setUserData(String key,
- Object data, UserDataHandler handler) {
- if(userData == null)
- userData = new HashMap<>();
- if (data == null) {
- if (userData != null) {
- UserDataRecord udr = userData.remove(key);
- if (udr != null) {
- return udr.fData;
- }
- }
- return null;
- }
- else {
- UserDataRecord udr = userData.put(key, new UserDataRecord(data, handler));
- if (udr != null) {
- return udr.fData;
- }
- }
- return null;
- }
-
- public Object getUserData(String key) {
- if (userData == null) {
- return null;
- }
- UserDataRecord udr = userData.get(key);
- if (udr != null) {
- return udr.fData;
- }
- return null;
- }
-
- @Override
- protected Map<String, UserDataRecord> getUserDataRecord(){
- return userData;
- }
-
- /**
- * @serialData Serialized fields. Convert Map to Hashtable for backward
- * compatibility.
- */
- private void writeObject(ObjectOutputStream out) throws IOException {
- // Convert the HashMap to Hashtable
- Hashtable<String, UserDataRecord> ud = (userData == null)? null : new Hashtable<>(userData);
-
- // Write serialized fields
- ObjectOutputStream.PutField pf = out.putFields();
- pf.put("name", name);
- pf.put("entities", entities);
- pf.put("notations", notations);
- pf.put("elements", elements);
- pf.put("publicID", publicID);
- pf.put("systemID", systemID);
- pf.put("internalSubset", internalSubset);
- pf.put("doctypeNumber", doctypeNumber);
- pf.put("userData", ud);
- out.writeFields();
- }
-
- @SuppressWarnings("unchecked")
- private void readObject(ObjectInputStream in)
- throws IOException, ClassNotFoundException {
- // We have to read serialized fields first.
- ObjectInputStream.GetField gf = in.readFields();
- name = (String)gf.get("name", null);
- entities = (NamedNodeMapImpl)gf.get("entities", null);
- notations = (NamedNodeMapImpl)gf.get("notations", null);
- elements = (NamedNodeMapImpl)gf.get("elements", null);
- publicID = (String)gf.get("publicID", null);
- systemID = (String)gf.get("systemID", null);
- internalSubset = (String)gf.get("internalSubset", null);
- doctypeNumber = gf.get("doctypeNumber", 0);
-
- Hashtable<String, UserDataRecord> ud =
- (Hashtable<String, UserDataRecord>)gf.get("userData", null);
-
- //convert the Hashtable back to HashMap
- if (ud != null) userData = new HashMap<>(ud);
- }
-} // class DocumentTypeImpl
diff --git a/src/com/sun/org/apache/xerces/internal/dom/ElementDefinitionImpl.java b/src/com/sun/org/apache/xerces/internal/dom/ElementDefinitionImpl.java
deleted file mode 100644
index 6c56a69..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/ElementDefinitionImpl.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
- * NON-DOM CLASS: Describe one of the Elements (and its associated
- * Attributes) defined in this Document Type.
- * <p>
- * I've included this in Level 1 purely as an anchor point for default
- * attributes. In Level 2 it should enable the ChildRule support.
- *
- * @xerces.internal
- *
- */
-public class ElementDefinitionImpl
- extends ParentNode {
-
- //
- // Constants
- //
-
- /** Serialization version. */
- static final long serialVersionUID = -8373890672670022714L;
-
- //
- // Data
- //
-
- /** Element definition name. */
- protected String name;
-
- /** Default attributes. */
- protected NamedNodeMapImpl attributes;
-
- //
- // Constructors
- //
-
- /** Factory constructor. */
- public ElementDefinitionImpl(CoreDocumentImpl ownerDocument, String name) {
- super(ownerDocument);
- this.name = name;
- attributes = new NamedNodeMapImpl(ownerDocument);
- }
-
- //
- // Node methods
- //
-
- /**
- * A short integer indicating what type of node this is. The named
- * constants for this value are defined in the org.w3c.dom.Node interface.
- */
- public short getNodeType() {
- return NodeImpl.ELEMENT_DEFINITION_NODE;
- }
-
- /**
- * Returns the element definition name
- */
- public String getNodeName() {
- if (needsSyncData()) {
- synchronizeData();
- }
- return name;
- }
-
- /**
- * Replicate this object.
- */
- public Node cloneNode(boolean deep) {
-
- ElementDefinitionImpl newnode =
- (ElementDefinitionImpl) super.cloneNode(deep);
- // NamedNodeMap must be explicitly replicated to avoid sharing
- newnode.attributes = attributes.cloneMap(newnode);
- return newnode;
-
- } // cloneNode(boolean):Node
-
- /**
- * Query the attributes defined on this Element.
- * <p>
- * In the base implementation this Map simply contains Attribute objects
- * representing the defaults. In a more serious implementation, it would
- * contain AttributeDefinitionImpl objects for all declared Attributes,
- * indicating which are Default, DefaultFixed, Implicit and/or Required.
- *
- * @return org.w3c.dom.NamedNodeMap containing org.w3c.dom.Attribute
- */
- public NamedNodeMap getAttributes() {
-
- if (needsSyncChildren()) {
- synchronizeChildren();
- }
- return attributes;
-
- } // getAttributes():NamedNodeMap
-
-} // class ElementDefinitionImpl
diff --git a/src/com/sun/org/apache/xerces/internal/dom/ElementImpl.java b/src/com/sun/org/apache/xerces/internal/dom/ElementImpl.java
deleted file mode 100644
index e2c3de4..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/ElementImpl.java
+++ /dev/null
@@ -1,1178 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-
-import org.w3c.dom.TypeInfo;
-import com.sun.org.apache.xerces.internal.util.URI;
-
-/**
- * Elements represent most of the "markup" and structure of the
- * document. They contain both the data for the element itself
- * (element name and attributes), and any contained nodes, including
- * document text (as children).
- * <P>
- * Elements may have Attributes associated with them; the API for this is
- * defined in Node, but the function is implemented here. In general, XML
- * applications should retrive Attributes as Nodes, since they may contain
- * entity references and hence be a fairly complex sub-tree. HTML users will
- * be dealing with simple string values, and convenience methods are provided
- * to work in terms of Strings.
- * <P>
- * ElementImpl does not support Namespaces. ElementNSImpl, which inherits from
- * it, does.
- * @see ElementNSImpl
- *
- * @xerces.internal
- *
- * @author Arnaud Le Hors, IBM
- * @author Joe Kesselman, IBM
- * @author Andy Clark, IBM
- * @author Ralf Pfeiffer, IBM
- * @since PR-DOM-Level-1-19980818.
- */
-public class ElementImpl
- extends ParentNode
- implements Element, TypeInfo {
-
- //
- // Constants
- //
-
- /** Serialization version. */
- static final long serialVersionUID = 3717253516652722278L;
- //
- // Data
- //
-
- /** Element name. */
- protected String name;
-
- /** Attributes. */
- protected AttributeMap attributes;
-
- //
- // Constructors
- //
-
- /** Factory constructor. */
- public ElementImpl(CoreDocumentImpl ownerDoc, String name) {
- super(ownerDoc);
- this.name = name;
- needsSyncData(true); // synchronizeData will initialize attributes
- }
-
- // for ElementNSImpl
- protected ElementImpl() {}
-
- // Support for DOM Level 3 renameNode method.
- // Note: This only deals with part of the pb. CoreDocumentImpl
- // does all the work.
- void rename(String name) {
- if (needsSyncData()) {
- synchronizeData();
- }
- this.name = name;
- reconcileDefaultAttributes();
- }
-
- //
- // Node methods
- //
-
-
- /**
- * A short integer indicating what type of node this is. The named
- * constants for this value are defined in the org.w3c.dom.Node interface.
- */
- public short getNodeType() {
- return Node.ELEMENT_NODE;
- }
-
- /**
- * Returns the element name
- */
- public String getNodeName() {
- if (needsSyncData()) {
- synchronizeData();
- }
- return name;
- }
-
- /**
- * Retrieve all the Attributes as a set. Note that this API is inherited
- * from Node rather than specified on Element; in fact only Elements will
- * ever have Attributes, but they want to allow folks to "blindly" operate
- * on the tree as a set of Nodes.
- */
- public NamedNodeMap getAttributes() {
-
- if (needsSyncData()) {
- synchronizeData();
- }
- if (attributes == null) {
- attributes = new AttributeMap(this, null);
- }
- return attributes;
-
- } // getAttributes():NamedNodeMap
-
- /**
- * Return a duplicate copy of this Element. Note that its children
- * will not be copied unless the "deep" flag is true, but Attributes
- * are <i>always</i> replicated.
- *
- * @see org.w3c.dom.Node#cloneNode(boolean)
- */
- public Node cloneNode(boolean deep) {
-
- ElementImpl newnode = (ElementImpl) super.cloneNode(deep);
- // Replicate NamedNodeMap rather than sharing it.
- if (attributes != null) {
- newnode.attributes = (AttributeMap) attributes.cloneMap(newnode);
- }
- return newnode;
-
- } // cloneNode(boolean):Node
-
- /**
- * DOM Level 3 WD - Experimental.
- * Retrieve baseURI
- */
- public String getBaseURI() {
-
- if (needsSyncData()) {
- synchronizeData();
- }
- // Absolute base URI is computed according to
- // XML Base (http://www.w3.org/TR/xmlbase/#granularity)
- // 1. The base URI specified by an xml:base attribute on the element,
- // if one exists
- if (attributes != null) {
- Attr attrNode = (Attr)attributes.getNamedItem("xml:base");
- if (attrNode != null) {
- String uri = attrNode.getNodeValue();
- if (uri.length() != 0 ) {// attribute value is always empty string
- try {
- uri = new URI(uri).toString();
- }
- catch (com.sun.org.apache.xerces.internal.util.URI.MalformedURIException e) {
- // This may be a relative URI.
-
- // Make any parentURI into a URI object to use with the URI(URI, String) constructor
- String parentBaseURI = (this.ownerNode != null) ? this.ownerNode.getBaseURI() : null;
- if (parentBaseURI != null){
- try{
- uri = new URI(new URI(parentBaseURI), uri).toString();
- }
- catch (com.sun.org.apache.xerces.internal.util.URI.MalformedURIException ex){
- // This should never happen: parent should have checked the URI and returned null if invalid.
- return null;
- }
- return uri;
- }
- return null;
- }
- return uri;
- }
- }
- }
-
- // 2.the base URI of the element's parent element within the
- // document or external entity, if one exists
- // 3. the base URI of the document entity or external entity
- // containing the element
-
- // ownerNode serves as a parent or as document
- String baseURI = (this.ownerNode != null) ? this.ownerNode.getBaseURI() : null ;
- //base URI of parent element is not null
- if(baseURI != null){
- try {
- //return valid absolute base URI
- return new URI(baseURI).toString();
- }
- catch (com.sun.org.apache.xerces.internal.util.URI.MalformedURIException e){
- return null;
- }
- }
- return null;
- } //getBaseURI
-
-
-
- /**
- * NON-DOM
- * set the ownerDocument of this node, its children, and its attributes
- */
- void setOwnerDocument(CoreDocumentImpl doc) {
- super.setOwnerDocument(doc);
- if (attributes != null) {
- attributes.setOwnerDocument(doc);
- }
- }
-
- //
- // Element methods
- //
-
- /**
- * Look up a single Attribute by name. Returns the Attribute's
- * string value, or an empty string (NOT null!) to indicate that the
- * name did not map to a currently defined attribute.
- * <p>
- * Note: Attributes may contain complex node trees. This method
- * returns the "flattened" string obtained from Attribute.getValue().
- * If you need the structure information, see getAttributeNode().
- */
- public String getAttribute(String name) {
-
- if (needsSyncData()) {
- synchronizeData();
- }
- if (attributes == null) {
- return "";
- }
- Attr attr = (Attr)(attributes.getNamedItem(name));
- return (attr == null) ? "" : attr.getValue();
-
- } // getAttribute(String):String
-
-
- /**
- * Look up a single Attribute by name. Returns the Attribute Node,
- * so its complete child tree is available. This could be important in
- * XML, where the string rendering may not be sufficient information.
- * <p>
- * If no matching attribute is available, returns null.
- */
- public Attr getAttributeNode(String name) {
-
- if (needsSyncData()) {
- synchronizeData();
- }
- if (attributes == null) {
- return null;
- }
- return (Attr)attributes.getNamedItem(name);
-
- } // getAttributeNode(String):Attr
-
-
- /**
- * Returns a NodeList of all descendent nodes (children,
- * grandchildren, and so on) which are Elements and which have the
- * specified tag name.
- * <p>
- * Note: NodeList is a "live" view of the DOM. Its contents will
- * change as the DOM changes, and alterations made to the NodeList
- * will be reflected in the DOM.
- *
- * @param tagname The type of element to gather. To obtain a list of
- * all elements no matter what their names, use the wild-card tag
- * name "*".
- *
- * @see DeepNodeListImpl
- */
- public NodeList getElementsByTagName(String tagname) {
- return new DeepNodeListImpl(this,tagname);
- }
-
- /**
- * Returns the name of the Element. Note that Element.nodeName() is
- * defined to also return the tag name.
- * <p>
- * This is case-preserving in XML. HTML should uppercasify it on the
- * way in.
- */
- public String getTagName() {
- if (needsSyncData()) {
- synchronizeData();
- }
- return name;
- }
-
- /**
- * In "normal form" (as read from a source file), there will never be two
- * Text children in succession. But DOM users may create successive Text
- * nodes in the course of manipulating the document. Normalize walks the
- * sub-tree and merges adjacent Texts, as if the DOM had been written out
- * and read back in again. This simplifies implementation of higher-level
- * functions that may want to assume that the document is in standard form.
- * <p>
- * To normalize a Document, normalize its top-level Element child.
- * <p>
- * As of PR-DOM-Level-1-19980818, CDATA -- despite being a subclass of
- * Text -- is considered "markup" and will _not_ be merged either with
- * normal Text or with other CDATASections.
- */
- public void normalize() {
- // No need to normalize if already normalized.
- if (isNormalized()) {
- return;
- }
- if (needsSyncChildren()) {
- synchronizeChildren();
- }
- ChildNode kid, next;
- for (kid = firstChild; kid != null; kid = next) {
- next = kid.nextSibling;
-
- // If kid is a text node, we need to check for one of two
- // conditions:
- // 1) There is an adjacent text node
- // 2) There is no adjacent text node, but kid is
- // an empty text node.
- if ( kid.getNodeType() == Node.TEXT_NODE )
- {
- // If an adjacent text node, merge it with kid
- if ( next!=null && next.getNodeType() == Node.TEXT_NODE )
- {
- ((Text)kid).appendData(next.getNodeValue());
- removeChild( next );
- next = kid; // Don't advance; there might be another.
- }
- else
- {
- // If kid is empty, remove it
- if ( kid.getNodeValue() == null || kid.getNodeValue().length() == 0 ) {
- removeChild( kid );
- }
- }
- }
-
- // Otherwise it might be an Element, which is handled recursively
- else if (kid.getNodeType() == Node.ELEMENT_NODE) {
- kid.normalize();
- }
- }
-
- // We must also normalize all of the attributes
- if ( attributes!=null )
- {
- for( int i=0; i<attributes.getLength(); ++i )
- {
- Node attr = attributes.item(i);
- attr.normalize();
- }
- }
-
- // changed() will have occurred when the removeChild() was done,
- // so does not have to be reissued.
-
- isNormalized(true);
- } // normalize()
-
- /**
- * Remove the named attribute from this Element. If the removed
- * Attribute has a default value, it is immediately replaced thereby.
- * <P>
- * The default logic is actually implemented in NamedNodeMapImpl.
- * PR-DOM-Level-1-19980818 doesn't fully address the DTD, so some
- * of this behavior is likely to change in future versions. ?????
- * <P>
- * Note that this call "succeeds" even if no attribute by this name
- * existed -- unlike removeAttributeNode, which will throw a not-found
- * exception in that case.
- *
- * @throws DOMException(NO_MODIFICATION_ALLOWED_ERR) if the node is
- * readonly.
- */
- public void removeAttribute(String name) {
-
- if (ownerDocument.errorChecking && isReadOnly()) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null);
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg);
- }
-
- if (needsSyncData()) {
- synchronizeData();
- }
-
- if (attributes == null) {
- return;
- }
-
- attributes.safeRemoveNamedItem(name);
-
- } // removeAttribute(String)
-
-
- /**
- * Remove the specified attribute/value pair. If the removed
- * Attribute has a default value, it is immediately replaced.
- * <p>
- * NOTE: Specifically removes THIS NODE -- not the node with this
- * name, nor the node with these contents. If the specific Attribute
- * object passed in is not stored in this Element, we throw a
- * DOMException. If you really want to remove an attribute by name,
- * use removeAttribute().
- *
- * @return the Attribute object that was removed.
- * @throws DOMException(NOT_FOUND_ERR) if oldattr is not an attribute of
- * this Element.
- * @throws DOMException(NO_MODIFICATION_ALLOWED_ERR) if the node is
- * readonly.
- */
- public Attr removeAttributeNode(Attr oldAttr)
- throws DOMException {
-
- if (ownerDocument.errorChecking && isReadOnly()) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null);
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg);
- }
-
- if (needsSyncData()) {
- synchronizeData();
- }
-
- if (attributes == null) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_FOUND_ERR", null);
- throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
- }
- return (Attr) attributes.removeItem(oldAttr, true);
-
- } // removeAttributeNode(Attr):Attr
-
-
- /**
- * Add a new name/value pair, or replace the value of the existing
- * attribute having that name.
- *
- * Note: this method supports only the simplest kind of Attribute,
- * one whose value is a string contained in a single Text node.
- * If you want to assert a more complex value (which XML permits,
- * though HTML doesn't), see setAttributeNode().
- *
- * The attribute is created with specified=true, meaning it's an
- * explicit value rather than inherited from the DTD as a default.
- * Again, setAttributeNode can be used to achieve other results.
- *
- * @throws DOMException(INVALID_NAME_ERR) if the name is not acceptable.
- * (Attribute factory will do that test for us.)
- *
- * @throws DOMException(NO_MODIFICATION_ALLOWED_ERR) if the node is
- * readonly.
- */
- public void setAttribute(String name, String value) {
-
- if (ownerDocument.errorChecking && isReadOnly()) {
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "NO_MODIFICATION_ALLOWED_ERR",
- null);
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg);
- }
-
- if (needsSyncData()) {
- synchronizeData();
- }
-
- Attr newAttr = getAttributeNode(name);
- if (newAttr == null) {
- newAttr = getOwnerDocument().createAttribute(name);
-
- if (attributes == null) {
- attributes = new AttributeMap(this, null);
- }
-
- newAttr.setNodeValue(value);
- attributes.setNamedItem(newAttr);
- }
- else {
- newAttr.setNodeValue(value);
- }
-
- } // setAttribute(String,String)
-
- /**
- * Add a new attribute/value pair, or replace the value of the
- * existing attribute with that name.
- * <P>
- * This method allows you to add an Attribute that has already been
- * constructed, and hence avoids the limitations of the simple
- * setAttribute() call. It can handle attribute values that have
- * arbitrarily complex tree structure -- in particular, those which
- * had entity references mixed into their text.
- *
- * @throws DOMException(INUSE_ATTRIBUTE_ERR) if the Attribute object
- * has already been assigned to another Element.
- */
- public Attr setAttributeNode(Attr newAttr)
- throws DOMException
- {
-
- if (needsSyncData()) {
- synchronizeData();
- }
-
- if (ownerDocument.errorChecking) {
- if (isReadOnly()) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null);
- throw new DOMException(
- DOMException.NO_MODIFICATION_ALLOWED_ERR,
- msg);
- }
-
- if (newAttr.getOwnerDocument() != ownerDocument) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null);
- throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, msg);
- }
- }
-
- if (attributes == null) {
- attributes = new AttributeMap(this, null);
- }
- // This will throw INUSE if necessary
- return (Attr) attributes.setNamedItem(newAttr);
-
- } // setAttributeNode(Attr):Attr
-
- //
- // DOM2: Namespace methods
- //
-
- /**
- * Introduced in DOM Level 2. <p>
- *
- * Retrieves an attribute value by local name and namespace URI.
- *
- * @param namespaceURI
- * The namespace URI of the attribute to
- * retrieve.
- * @param localName The local name of the attribute to retrieve.
- * @return String The Attr value as a string, or empty string
- * if that attribute
- * does not have a specified or default value.
- * @since WD-DOM-Level-2-19990923
- */
- public String getAttributeNS(String namespaceURI, String localName) {
-
- if (needsSyncData()) {
- synchronizeData();
- }
-
- if (attributes == null) {
- return "";
- }
-
- Attr attr = (Attr)(attributes.getNamedItemNS(namespaceURI, localName));
- return (attr == null) ? "" : attr.getValue();
-
- } // getAttributeNS(String,String):String
-
- /**
- * Introduced in DOM Level 2. <p>
- *
- * Adds a new attribute.
- * If the given namespaceURI is null or an empty string and the
- * qualifiedName has a prefix that is "xml", the new attribute is bound to
- * the predefined namespace "http://www.w3.org/XML/1998/namespace"
- * [Namespaces]. If an attribute with the same local name and namespace
- * URI is already present on the element, its prefix is changed to be the
- * prefix part of the qualifiedName, and its value is changed to be the
- * value parameter. This value is a simple string, it is not parsed as it
- * is being set. So any markup (such as syntax to be recognized as an
- * entity reference) is treated as literal text, and needs to be
- * appropriately escaped by the implementation when it is written out. In
- * order to assign an attribute value that contains entity references, the
- * user must create an Attr node plus any Text and EntityReference nodes,
- * build the appropriate subtree, and use setAttributeNodeNS or
- * setAttributeNode to assign it as the value of an attribute.
- *
- * @param namespaceURI The namespace URI of the attribute to create
- * or alter.
- * @param qualifiedName The qualified name of the attribute to create or
- * alter.
- * @param value The value to set in string form.
- * @throws INVALID_CHARACTER_ERR: Raised if the specified
- * name contains an invalid character.
- *
- * @throws NO_MODIFICATION_ALLOWED_ERR: Raised if this
- * node is readonly.
- *
- * @throws NAMESPACE_ERR: Raised if the qualifiedName
- * has a prefix that is "xml" and the namespaceURI
- * is neither null nor an empty string nor
- * "http://www.w3.org/XML/1998/namespace", or if
- * the qualifiedName has a prefix that is "xmlns"
- * but the namespaceURI is neither null nor an
- * empty string, or if if the qualifiedName has a
- * prefix different from "xml" and "xmlns" and the
- * namespaceURI is null or an empty string.
- * @since WD-DOM-Level-2-19990923
- */
- public void setAttributeNS(String namespaceURI,String qualifiedName,
- String value) {
- if (ownerDocument.errorChecking && isReadOnly()) {
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "NO_MODIFICATION_ALLOWED_ERR",
- null);
- throw new DOMException(
- DOMException.NO_MODIFICATION_ALLOWED_ERR,
- msg);
- }
- if (needsSyncData()) {
- synchronizeData();
- }
- int index = qualifiedName.indexOf(':');
- String prefix, localName;
- if (index < 0) {
- prefix = null;
- localName = qualifiedName;
- }
- else {
- prefix = qualifiedName.substring(0, index);
- localName = qualifiedName.substring(index + 1);
- }
- Attr newAttr = getAttributeNodeNS(namespaceURI, localName);
- if (newAttr == null) {
- // REVISIT: this is not efficient, we are creating twice the same
- // strings for prefix and localName.
- newAttr = getOwnerDocument().createAttributeNS(
- namespaceURI,
- qualifiedName);
- if (attributes == null) {
- attributes = new AttributeMap(this, null);
- }
- newAttr.setNodeValue(value);
- attributes.setNamedItemNS(newAttr);
- }
- else {
- if (newAttr instanceof AttrNSImpl){
- String origNodeName = ((AttrNSImpl) newAttr).name;
- String newName = (prefix!=null) ? (prefix+":"+localName) : localName;
-
- ((AttrNSImpl) newAttr).name = newName;
-
- if (!newName.equals(origNodeName)) {
- // Note: we can't just change the name of the attribute. Names have to be in sorted
- // order in the attributes vector because a binary search is used to locate them.
- // If the new name has a different prefix, the list may become unsorted.
- // Maybe it would be better to resort the list, but the simplest
- // fix seems to be to remove the old attribute and re-insert it.
- // -- Norman.Walsh@Sun.COM, 2 Feb 2007
- newAttr = (Attr) attributes.removeItem(newAttr, false);
- attributes.addItem(newAttr);
- }
- }
- else {
- // This case may happen if user calls:
- // elem.setAttribute("name", "value");
- // elem.setAttributeNS(null, "name", "value");
- // This case is not defined by the DOM spec, we choose
- // to create a new attribute in this case and remove an old one from the tree
- // note this might cause events to be propagated or user data to be lost
- newAttr = new AttrNSImpl((CoreDocumentImpl)getOwnerDocument(), namespaceURI, qualifiedName, localName);
- attributes.setNamedItemNS(newAttr);
- }
-
- newAttr.setNodeValue(value);
- }
-
- } // setAttributeNS(String,String,String)
-
-
- /**
- * Introduced in DOM Level 2. <p>
- *
- * Removes an attribute by local name and namespace URI. If the removed
- * attribute has a default value it is immediately replaced.
- * The replacing attribute has the same namespace URI and local name,
- * as well as the original prefix.<p>
- *
- * @param namespaceURI The namespace URI of the attribute to remove.
- *
- * @param localName The local name of the attribute to remove.
- * @throws NO_MODIFICATION_ALLOWED_ERR: Raised if this
- * node is readonly.
- * @since WD-DOM-Level-2-19990923
- */
- public void removeAttributeNS(String namespaceURI, String localName) {
-
- if (ownerDocument.errorChecking && isReadOnly()) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null);
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg);
- }
-
- if (needsSyncData()) {
- synchronizeData();
- }
-
- if (attributes == null) {
- return;
- }
-
- attributes.safeRemoveNamedItemNS(namespaceURI, localName);
-
- } // removeAttributeNS(String,String)
-
- /**
- * Retrieves an Attr node by local name and namespace URI.
- *
- * @param namespaceURI The namespace URI of the attribute to
- * retrieve.
- * @param localName The local name of the attribute to retrieve.
- * @return Attr The Attr node with the specified attribute
- * local name and namespace
- * URI or null if there is no such attribute.
- * @since WD-DOM-Level-2-19990923
- */
- public Attr getAttributeNodeNS(String namespaceURI, String localName){
-
- if (needsSyncData()) {
- synchronizeData();
- }
- if (attributes == null) {
- return null;
- }
- return (Attr)attributes.getNamedItemNS(namespaceURI, localName);
-
- } // getAttributeNodeNS(String,String):Attr
-
- /**
- * Introduced in DOM Level 2. <p>
- *
- * Adds a new attribute. If an attribute with that local name and
- * namespace URI is already present in the element, it is replaced
- * by the new one.
- *
- * @param Attr The Attr node to add to the attribute list. When
- * the Node has no namespaceURI, this method behaves
- * like setAttributeNode.
- * @return Attr If the newAttr attribute replaces an existing attribute
- * with the same local name and namespace URI, the *
- * previously existing Attr node is returned, otherwise
- * null is returned.
- * @throws WRONG_DOCUMENT_ERR: Raised if newAttr
- * was created from a different document than the one that
- * created the element.
- *
- * @throws NO_MODIFICATION_ALLOWED_ERR: Raised if
- * this node is readonly.
- *
- * @throws INUSE_ATTRIBUTE_ERR: Raised if newAttr is
- * already an attribute of another Element object. The
- * DOM user must explicitly clone Attr nodes to re-use
- * them in other elements.
- * @since WD-DOM-Level-2-19990923
- */
- public Attr setAttributeNodeNS(Attr newAttr)
- throws DOMException
- {
-
- if (needsSyncData()) {
- synchronizeData();
- }
- if (ownerDocument.errorChecking) {
- if (isReadOnly()) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null);
- throw new DOMException(
- DOMException.NO_MODIFICATION_ALLOWED_ERR,
- msg);
- }
- if (newAttr.getOwnerDocument() != ownerDocument) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null);
- throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, msg);
- }
- }
-
- if (attributes == null) {
- attributes = new AttributeMap(this, null);
- }
- // This will throw INUSE if necessary
- return (Attr) attributes.setNamedItemNS(newAttr);
-
- } // setAttributeNodeNS(Attr):Attr
-
- /**
- * NON-DOM: sets attribute node for this element
- */
- protected int setXercesAttributeNode (Attr attr){
-
- if (needsSyncData()) {
- synchronizeData();
- }
-
- if (attributes == null) {
- attributes = new AttributeMap(this, null);
- }
- return attributes.addItem(attr);
-
- }
-
- /**
- * NON-DOM: get inded of an attribute
- */
- protected int getXercesAttribute(String namespaceURI, String localName){
-
- if (needsSyncData()) {
- synchronizeData();
- }
- if (attributes == null) {
- return -1;
- }
- return attributes.getNamedItemIndex(namespaceURI, localName);
-
- }
-
- /**
- * Introduced in DOM Level 2.
- */
- public boolean hasAttributes() {
- if (needsSyncData()) {
- synchronizeData();
- }
- return (attributes != null && attributes.getLength() != 0);
- }
-
- /**
- * Introduced in DOM Level 2.
- */
- public boolean hasAttribute(String name) {
- return getAttributeNode(name) != null;
- }
-
- /**
- * Introduced in DOM Level 2.
- */
- public boolean hasAttributeNS(String namespaceURI, String localName) {
- return getAttributeNodeNS(namespaceURI, localName) != null;
- }
-
- /**
- * Introduced in DOM Level 2. <p>
- *
- * Returns a NodeList of all the Elements with a given local name and
- * namespace URI in the order in which they would be encountered in a
- * preorder traversal of the Document tree, starting from this node.
- *
- * @param namespaceURI The namespace URI of the elements to match
- * on. The special value "*" matches all
- * namespaces. When it is null or an empty
- * string, this method behaves like
- * getElementsByTagName.
- * @param localName The local name of the elements to match on.
- * The special value "*" matches all local names.
- * @return NodeList A new NodeList object containing all the matched
- * Elements.
- * @since WD-DOM-Level-2-19990923
- */
- public NodeList getElementsByTagNameNS(String namespaceURI,
- String localName) {
- return new DeepNodeListImpl(this, namespaceURI, localName);
- }
-
- /**
- * DOM Level 3 WD- Experimental.
- * Override inherited behavior from NodeImpl and ParentNode to check on
- * attributes
- */
- public boolean isEqualNode(Node arg) {
- if (!super.isEqualNode(arg)) {
- return false;
- }
- boolean hasAttrs = hasAttributes();
- if (hasAttrs != ((Element) arg).hasAttributes()) {
- return false;
- }
- if (hasAttrs) {
- NamedNodeMap map1 = getAttributes();
- NamedNodeMap map2 = ((Element) arg).getAttributes();
- int len = map1.getLength();
- if (len != map2.getLength()) {
- return false;
- }
- for (int i = 0; i < len; i++) {
- Node n1 = map1.item(i);
- if (n1.getLocalName() == null) { // DOM Level 1 Node
- Node n2 = map2.getNamedItem(n1.getNodeName());
- if (n2 == null || !((NodeImpl) n1).isEqualNode(n2)) {
- return false;
- }
- }
- else {
- Node n2 = map2.getNamedItemNS(n1.getNamespaceURI(),
- n1.getLocalName());
- if (n2 == null || !((NodeImpl) n1).isEqualNode(n2)) {
- return false;
- }
- }
- }
- }
- return true;
- }
-
- /**
- * DOM Level 3: register the given attribute node as an ID attribute
- */
- public void setIdAttributeNode(Attr at, boolean makeId) {
- if (needsSyncData()) {
- synchronizeData();
- }
- if (ownerDocument.errorChecking) {
- if (isReadOnly()) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null);
- throw new DOMException(
- DOMException.NO_MODIFICATION_ALLOWED_ERR,
- msg);
- }
-
- if (at.getOwnerElement() != this) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_FOUND_ERR", null);
- throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
- }
- }
- ((AttrImpl) at).isIdAttribute(makeId);
- if (!makeId) {
- ownerDocument.removeIdentifier(at.getValue());
- }
- else {
- ownerDocument.putIdentifier(at.getValue(), this);
- }
- }
-
- /**
- * DOM Level 3: register the given attribute node as an ID attribute
- */
- public void setIdAttribute(String name, boolean makeId) {
- if (needsSyncData()) {
- synchronizeData();
- }
- Attr at = getAttributeNode(name);
-
- if( at == null){
- String msg = DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "NOT_FOUND_ERR", null);
- throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
- }
-
- if (ownerDocument.errorChecking) {
- if (isReadOnly()) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null);
- throw new DOMException(
- DOMException.NO_MODIFICATION_ALLOWED_ERR,
- msg);
- }
-
- if (at.getOwnerElement() != this) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_FOUND_ERR", null);
- throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
- }
- }
-
- ((AttrImpl) at).isIdAttribute(makeId);
- if (!makeId) {
- ownerDocument.removeIdentifier(at.getValue());
- }
- else {
- ownerDocument.putIdentifier(at.getValue(), this);
- }
- }
-
- /**
- * DOM Level 3: register the given attribute node as an ID attribute
- */
- public void setIdAttributeNS(String namespaceURI, String localName,
- boolean makeId) {
- if (needsSyncData()) {
- synchronizeData();
- }
- //if namespace uri is empty string, set it to 'null'
- if (namespaceURI != null) {
- namespaceURI = (namespaceURI.length() == 0)? null : namespaceURI;
- }
- Attr at = getAttributeNodeNS(namespaceURI, localName);
-
- if( at == null){
- String msg = DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "NOT_FOUND_ERR", null);
- throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
- }
-
- if (ownerDocument.errorChecking) {
- if (isReadOnly()) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null);
- throw new DOMException(
- DOMException.NO_MODIFICATION_ALLOWED_ERR,
- msg);
- }
-
- if (at.getOwnerElement() != this) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_FOUND_ERR", null);
- throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
- }
- }
- ((AttrImpl) at).isIdAttribute(makeId);
- if (!makeId) {
- ownerDocument.removeIdentifier(at.getValue());
- }
- else {
- ownerDocument.putIdentifier(at.getValue(), this);
- }
- }
-
- /**
- * @see org.w3c.dom.TypeInfo#getTypeName()
- */
- public String getTypeName() {
- return null;
- }
-
- /**
- * @see org.w3c.dom.TypeInfo#getTypeNamespace()
- */
- public String getTypeNamespace() {
- return null;
- }
-
- /**
- * Introduced in DOM Level 3. <p>
- * Checks if a type is derived from another by restriction. See:
- * http://www.w3.org/TR/DOM-Level-3-Core/core.html#TypeInfo-isDerivedFrom
- *
- * @param ancestorNS
- * The namspace of the ancestor type declaration
- * @param ancestorName
- * The name of the ancestor type declaration
- * @param type
- * The reference type definition
- *
- * @return boolean True if the type is derived by restriciton for the
- * reference type
- */
- public boolean isDerivedFrom(String typeNamespaceArg,
- String typeNameArg,
- int derivationMethod) {
-
- return false;
- }
-
- /**
- * Method getSchemaTypeInfo.
- * @return TypeInfo
- */
- public TypeInfo getSchemaTypeInfo(){
- if(needsSyncData()) {
- synchronizeData();
- }
- return this;
- }
-
- //
- // Public methods
- //
-
- /**
- * NON-DOM: Subclassed to flip the attributes' readonly switch as well.
- * @see NodeImpl#setReadOnly
- */
- public void setReadOnly(boolean readOnly, boolean deep) {
- super.setReadOnly(readOnly,deep);
- if (attributes != null) {
- attributes.setReadOnly(readOnly,true);
- }
- }
-
-
-
- //
- // Protected methods
- //
-
- /** Synchronizes the data (name and value) for fast nodes. */
- protected void synchronizeData() {
-
- // no need to sync in the future
- needsSyncData(false);
-
- // we don't want to generate any event for this so turn them off
- boolean orig = ownerDocument.getMutationEvents();
- ownerDocument.setMutationEvents(false);
-
- // attributes
- setupDefaultAttributes();
-
- // set mutation events flag back to its original value
- ownerDocument.setMutationEvents(orig);
-
- } // synchronizeData()
-
- // support for DOM Level 3 renameNode method
- // @param el The element from which to take the attributes
- void moveSpecifiedAttributes(ElementImpl el) {
- if (needsSyncData()) {
- synchronizeData();
- }
- if (el.hasAttributes()) {
- if (attributes == null) {
- attributes = new AttributeMap(this, null);
- }
- attributes.moveSpecifiedAttributes(el.attributes);
- }
- }
-
- /** Setup the default attributes. */
- protected void setupDefaultAttributes() {
- NamedNodeMapImpl defaults = getDefaultAttributes();
- if (defaults != null) {
- attributes = new AttributeMap(this, defaults);
- }
- }
-
- /** Reconcile default attributes. */
- protected void reconcileDefaultAttributes() {
- if (attributes != null) {
- NamedNodeMapImpl defaults = getDefaultAttributes();
- attributes.reconcileDefaults(defaults);
- }
- }
-
- /** Get the default attributes. */
- protected NamedNodeMapImpl getDefaultAttributes() {
-
- DocumentTypeImpl doctype =
- (DocumentTypeImpl) ownerDocument.getDoctype();
- if (doctype == null) {
- return null;
- }
- ElementDefinitionImpl eldef =
- (ElementDefinitionImpl)doctype.getElements()
- .getNamedItem(getNodeName());
- if (eldef == null) {
- return null;
- }
- return (NamedNodeMapImpl) eldef.getAttributes();
-
- } // getDefaultAttributes()
-
-} // class ElementImpl
diff --git a/src/com/sun/org/apache/xerces/internal/dom/ElementNSImpl.java b/src/com/sun/org/apache/xerces/internal/dom/ElementNSImpl.java
deleted file mode 100644
index 35757db..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/ElementNSImpl.java
+++ /dev/null
@@ -1,489 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-import com.sun.org.apache.xerces.internal.xs.XSSimpleTypeDefinition;
-import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
-import com.sun.org.apache.xerces.internal.impl.dv.xs.XSSimpleTypeDecl;
-import com.sun.org.apache.xerces.internal.impl.xs.XSComplexTypeDecl;
-import com.sun.org.apache.xerces.internal.util.URI;
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-import org.w3c.dom.Attr;
-import org.w3c.dom.DOMException;
-
-
-
-/**
- * ElementNSImpl inherits from ElementImpl and adds namespace support.
- * <P>
- * The qualified name is the node name, and we store localName which is also
- * used in all queries. On the other hand we recompute the prefix when
- * necessary.
- *
- * @xerces.internal
- *
- * @author Elena litani, IBM
- * @author Neeraj Bajaj, Sun Microsystems
- * @version $Id: ElementNSImpl.java,v 1.7 2010-11-01 04:39:39 joehw Exp $
- */
-public class ElementNSImpl
- extends ElementImpl {
-
- //
- // Constants
- //
-
- /** Serialization version. */
- static final long serialVersionUID = -9142310625494392642L;
- static final String xmlURI = "http://www.w3.org/XML/1998/namespace";
-
- //
- // Data
- //
-
- /** DOM2: Namespace URI. */
- protected String namespaceURI;
-
- /** DOM2: localName. */
- protected String localName;
-
- /** DOM3: type information */
- // REVISIT: we are losing the type information in DOM during serialization
- transient XSTypeDefinition type;
-
- protected ElementNSImpl() {
- super();
- }
- /**
- * DOM2: Constructor for Namespace implementation.
- */
- protected ElementNSImpl(CoreDocumentImpl ownerDocument,
- String namespaceURI,
- String qualifiedName)
- throws DOMException
- {
- super(ownerDocument, qualifiedName);
- setName(namespaceURI, qualifiedName);
- }
-
- private void setName(String namespaceURI, String qname) {
-
- String prefix;
- // DOM Level 3: namespace URI is never empty string.
- this.namespaceURI = namespaceURI;
- if (namespaceURI != null) {
- //convert the empty string to 'null'
- this.namespaceURI = (namespaceURI.length() == 0) ? null : namespaceURI;
- }
-
- int colon1, colon2 ;
-
- //NAMESPACE_ERR:
- //1. if the qualified name is 'null' it is malformed.
- //2. or if the qualifiedName is null and the namespaceURI is different from null,
- // We dont need to check for namespaceURI != null, if qualified name is null throw DOMException.
- if(qname == null){
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "NAMESPACE_ERR",
- null);
- throw new DOMException(DOMException.NAMESPACE_ERR, msg);
- }
- else{
- colon1 = qname.indexOf(':');
- colon2 = qname.lastIndexOf(':');
- }
-
- ownerDocument.checkNamespaceWF(qname, colon1, colon2);
- if (colon1 < 0) {
- // there is no prefix
- localName = qname;
- if (ownerDocument.errorChecking) {
- ownerDocument.checkQName(null, localName);
- if (qname.equals("xmlns")
- && (namespaceURI == null
- || !namespaceURI.equals(NamespaceContext.XMLNS_URI))
- || (namespaceURI!=null && namespaceURI.equals(NamespaceContext.XMLNS_URI)
- && !qname.equals("xmlns"))) {
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "NAMESPACE_ERR",
- null);
- throw new DOMException(DOMException.NAMESPACE_ERR, msg);
- }
- }
- }//there is a prefix
- else {
- prefix = qname.substring(0, colon1);
- localName = qname.substring(colon2 + 1);
-
- //NAMESPACE_ERR:
- //1. if the qualifiedName has a prefix and the namespaceURI is null,
-
- //2. or if the qualifiedName has a prefix that is "xml" and the namespaceURI
- //is different from " http://www.w3.org/XML/1998/namespace"
-
- if (ownerDocument.errorChecking) {
- if( namespaceURI == null || ( prefix.equals("xml") && !namespaceURI.equals(NamespaceContext.XML_URI) )){
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "NAMESPACE_ERR",
- null);
- throw new DOMException(DOMException.NAMESPACE_ERR, msg);
- }
-
- ownerDocument.checkQName(prefix, localName);
- ownerDocument.checkDOMNSErr(prefix, namespaceURI);
- }
- }
- }
-
- // when local name is known
- protected ElementNSImpl(CoreDocumentImpl ownerDocument,
- String namespaceURI, String qualifiedName,
- String localName)
- throws DOMException
- {
- super(ownerDocument, qualifiedName);
-
- this.localName = localName;
- this.namespaceURI = namespaceURI;
- }
-
- // for DeferredElementImpl
- protected ElementNSImpl(CoreDocumentImpl ownerDocument,
- String value) {
- super(ownerDocument, value);
- }
-
- // Support for DOM Level 3 renameNode method.
- // Note: This only deals with part of the pb. CoreDocumentImpl
- // does all the work.
- void rename(String namespaceURI, String qualifiedName)
- {
- if (needsSyncData()) {
- synchronizeData();
- }
- this.name = qualifiedName;
- setName(namespaceURI, qualifiedName);
- reconcileDefaultAttributes();
- }
-
- /**
- * NON-DOM: resets this node and sets specified values for the node
- *
- * @param ownerDocument
- * @param namespaceURI
- * @param qualifiedName
- * @param localName
- */
- protected void setValues (CoreDocumentImpl ownerDocument,
- String namespaceURI, String qualifiedName,
- String localName){
-
- // remove children first
- firstChild = null;
- previousSibling = null;
- nextSibling = null;
- fNodeListCache = null;
-
- // set owner document
- attributes = null;
- super.flags = 0;
- setOwnerDocument(ownerDocument);
-
- // synchronizeData will initialize attributes
- needsSyncData(true);
- super.name = qualifiedName;
- this.localName = localName;
- this.namespaceURI = namespaceURI;
-
- }
-
- //
- // Node methods
- //
-
-
-
- //
- //DOM2: Namespace methods.
- //
-
- /**
- * Introduced in DOM Level 2. <p>
- *
- * The namespace URI of this node, or null if it is unspecified.<p>
- *
- * This is not a computed value that is the result of a namespace lookup based on
- * an examination of the namespace declarations in scope. It is merely the
- * namespace URI given at creation time.<p>
- *
- * For nodes created with a DOM Level 1 method, such as createElement
- * from the Document interface, this is null.
- * @since WD-DOM-Level-2-19990923
- */
- public String getNamespaceURI()
- {
- if (needsSyncData()) {
- synchronizeData();
- }
- return namespaceURI;
- }
-
- /**
- * Introduced in DOM Level 2. <p>
- *
- * The namespace prefix of this node, or null if it is unspecified. <p>
- *
- * For nodes created with a DOM Level 1 method, such as createElement
- * from the Document interface, this is null. <p>
- *
- * @since WD-DOM-Level-2-19990923
- */
- public String getPrefix()
- {
-
- if (needsSyncData()) {
- synchronizeData();
- }
- int index = name.indexOf(':');
- return index < 0 ? null : name.substring(0, index);
- }
-
- /**
- * Introduced in DOM Level 2. <p>
- *
- * Note that setting this attribute changes the nodeName attribute, which holds the
- * qualified name, as well as the tagName and name attributes of the Element
- * and Attr interfaces, when applicable.<p>
- *
- * @param prefix The namespace prefix of this node, or null(empty string) if it is unspecified.
- *
- * @exception INVALID_CHARACTER_ERR
- * Raised if the specified
- * prefix contains an invalid character.
- * @exception DOMException
- * @since WD-DOM-Level-2-19990923
- */
- public void setPrefix(String prefix)
- throws DOMException
- {
- if (needsSyncData()) {
- synchronizeData();
- }
- if (ownerDocument.errorChecking) {
- if (isReadOnly()) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null);
- throw new DOMException(
- DOMException.NO_MODIFICATION_ALLOWED_ERR,
- msg);
- }
- if (prefix != null && prefix.length() != 0) {
- if (!CoreDocumentImpl.isXMLName(prefix,ownerDocument.isXML11Version())) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_CHARACTER_ERR", null);
- throw new DOMException(DOMException.INVALID_CHARACTER_ERR, msg);
- }
- if (namespaceURI == null || prefix.indexOf(':') >=0) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NAMESPACE_ERR", null);
- throw new DOMException(DOMException.NAMESPACE_ERR, msg);
- } else if (prefix.equals("xml")) {
- if (!namespaceURI.equals(xmlURI)) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NAMESPACE_ERR", null);
- throw new DOMException(DOMException.NAMESPACE_ERR, msg);
- }
- }
- }
-
- }
- // update node name with new qualifiedName
- if (prefix !=null && prefix.length() != 0) {
- name = prefix + ":" + localName;
- }
- else {
- name = localName;
- }
- }
-
- /**
- * Introduced in DOM Level 2. <p>
- *
- * Returns the local part of the qualified name of this node.
- * @since WD-DOM-Level-2-19990923
- */
- public String getLocalName()
- {
- if (needsSyncData()) {
- synchronizeData();
- }
- return localName;
- }
-
-
- /**
- * DOM Level 3 WD - Experimental.
- * Retrieve baseURI
- */
- public String getBaseURI() {
-
- if (needsSyncData()) {
- synchronizeData();
- }
- // Absolute base URI is computed according to XML Base (http://www.w3.org/TR/xmlbase/#granularity)
-
- // 1. the base URI specified by an xml:base attribute on the element, if one exists
-
- if (attributes != null) {
- Attr attrNode = (Attr)attributes.getNamedItemNS("http://www.w3.org/XML/1998/namespace", "base");
- if (attrNode != null) {
- String uri = attrNode.getNodeValue();
- if (uri.length() != 0 ) {// attribute value is always empty string
- try {
- uri = new URI(uri).toString();
- }
- catch (com.sun.org.apache.xerces.internal.util.URI.MalformedURIException e) {
- // This may be a relative URI.
-
- // Start from the base URI of the parent, or if this node has no parent, the owner node.
- NodeImpl parentOrOwner = (parentNode() != null) ? parentNode() : ownerNode;
-
- // Make any parentURI into a URI object to use with the URI(URI, String) constructor.
- String parentBaseURI = (parentOrOwner != null) ? parentOrOwner.getBaseURI() : null;
-
- if (parentBaseURI != null) {
- try {
- uri = new URI(new URI(parentBaseURI), uri).toString();
- }
- catch (com.sun.org.apache.xerces.internal.util.URI.MalformedURIException ex){
- // This should never happen: parent should have checked the URI and returned null if invalid.
- return null;
- }
- return uri;
- }
- // REVISIT: what should happen in this case?
- return null;
- }
- return uri;
- }
- }
- }
-
- //2.the base URI of the element's parent element within the document or external entity,
- //if one exists
- String parentElementBaseURI = (this.parentNode() != null) ? this.parentNode().getBaseURI() : null ;
- //base URI of parent element is not null
- if(parentElementBaseURI != null){
- try {
- //return valid absolute base URI
- return new URI(parentElementBaseURI).toString();
- }
- catch (com.sun.org.apache.xerces.internal.util.URI.MalformedURIException e){
- // REVISIT: what should happen in this case?
- return null;
- }
- }
- //3. the base URI of the document entity or external entity containing the element
-
- String baseURI = (this.ownerNode != null) ? this.ownerNode.getBaseURI() : null ;
-
- if(baseURI != null){
- try {
- //return valid absolute base URI
- return new URI(baseURI).toString();
- }
- catch (com.sun.org.apache.xerces.internal.util.URI.MalformedURIException e){
- // REVISIT: what should happen in this case?
- return null;
- }
- }
-
- return null;
-
- }
-
-
- /**
- * @see org.w3c.dom.TypeInfo#getTypeName()
- */
- public String getTypeName() {
- if (type !=null){
- if (type instanceof XSSimpleTypeDecl) {
- return ((XSSimpleTypeDecl) type).getTypeName();
- } else if (type instanceof XSComplexTypeDecl) {
- return ((XSComplexTypeDecl) type).getTypeName();
- }
- }
- return null;
- }
-
- /**
- * @see org.w3c.dom.TypeInfo#getTypeNamespace()
- */
- public String getTypeNamespace() {
- if (type !=null){
- return type.getNamespace();
- }
- return null;
- }
-
- /**
- * Introduced in DOM Level 2. <p>
- * Checks if a type is derived from another by restriction. See:
- * http://www.w3.org/TR/DOM-Level-3-Core/core.html#TypeInfo-isDerivedFrom
- *
- * @param ancestorNS
- * The namspace of the ancestor type declaration
- * @param ancestorName
- * The name of the ancestor type declaration
- * @param type
- * The reference type definition
- *
- * @return boolean True if the type is derived by restriciton for the
- * reference type
- */
- public boolean isDerivedFrom(String typeNamespaceArg, String typeNameArg,
- int derivationMethod) {
- if(needsSyncData()) {
- synchronizeData();
- }
- if (type != null) {
- if (type instanceof XSSimpleTypeDecl) {
- return ((XSSimpleTypeDecl) type).isDOMDerivedFrom(
- typeNamespaceArg, typeNameArg, derivationMethod);
- } else if (type instanceof XSComplexTypeDecl) {
- return ((XSComplexTypeDecl) type).isDOMDerivedFrom(
- typeNamespaceArg, typeNameArg, derivationMethod);
- }
- }
- return false;
- }
-
- /**
- * NON-DOM: setting type used by the DOM parser
- * @see NodeImpl#setReadOnly
- */
- public void setType(XSTypeDefinition type) {
- this.type = type;
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/dom/EntityImpl.java b/src/com/sun/org/apache/xerces/internal/dom/EntityImpl.java
deleted file mode 100644
index 51d76c4..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/EntityImpl.java
+++ /dev/null
@@ -1,367 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-import org.w3c.dom.Entity;
-import org.w3c.dom.Node;
-import org.w3c.dom.DOMException;
-
-/**
- * Entity nodes hold the reference data for an XML Entity -- either
- * parsed or unparsed. The nodeName (inherited from Node) will contain
- * the name (if any) of the Entity. Its data will be contained in the
- * Entity's children, in exactly the structure which an
- * EntityReference to this name will present within the document's
- * body.
- * <P>
- * Note that this object models the actual entity, _not_ the entity
- * declaration or the entity reference.
- * <P>
- * An XML processor may choose to completely expand entities before
- * the structure model is passed to the DOM; in this case, there will
- * be no EntityReferences in the DOM tree.
- * <P>
- * Quoting the 10/01 DOM Proposal,
- * <BLOCKQUOTE>
- * "The DOM Level 1 does not support editing Entity nodes; if a user
- * wants to make changes to the contents of an Entity, every related
- * EntityReference node has to be replaced in the structure model by
- * a clone of the Entity's contents, and then the desired changes
- * must be made to each of those clones instead. All the
- * descendants of an Entity node are readonly."
- * </BLOCKQUOTE>
- * I'm interpreting this as: It is the parser's responsibilty to call
- * the non-DOM operation setReadOnly(true,true) after it constructs
- * the Entity. Since the DOM explicitly decided not to deal with this,
- * _any_ answer will involve a non-DOM operation, and this is the
- * simplest solution.
- *
- * @xerces.internal
- *
- * @author Elena Litani, IBM
- * @since PR-DOM-Level-1-19980818.
- */
-public class EntityImpl
- extends ParentNode
- implements Entity {
-
- //
- // Constants
- //
-
- /** Serialization version. */
- static final long serialVersionUID = -3575760943444303423L;
-
- //
- // Data
- //
-
- /** Entity name. */
- protected String name;
-
- /** Public identifier. */
- protected String publicId;
-
- /** System identifier. */
- protected String systemId;
-
- /** Encoding */
- protected String encoding;
-
-
- /** Input Encoding */
- protected String inputEncoding;
-
- /** Version */
- protected String version;
-
-
- /** Notation name. */
- protected String notationName;
-
- /** base uri*/
- protected String baseURI;
-
- //
- // Constructors
- //
-
- /** Factory constructor. */
- public EntityImpl(CoreDocumentImpl ownerDoc, String name) {
- super(ownerDoc);
- this.name = name;
- isReadOnly(true);
- }
-
- //
- // Node methods
- //
-
- /**
- * A short integer indicating what type of node this is. The named
- * constants for this value are defined in the org.w3c.dom.Node interface.
- */
- public short getNodeType() {
- return Node.ENTITY_NODE;
- }
-
- /**
- * Returns the entity name
- */
- public String getNodeName() {
- if (needsSyncData()) {
- synchronizeData();
- }
- return name;
- }
- /**
- * Sets the node value.
- * @throws DOMException(NO_MODIFICATION_ALLOWED_ERR)
- */
- public void setNodeValue(String x)
- throws DOMException {
- if (ownerDocument.errorChecking && isReadOnly()) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null);
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg);
- }
- }
- /**
- * The namespace prefix of this node
- * @exception DOMException
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- */
- public void setPrefix(String prefix)
- throws DOMException
- {
- if (ownerDocument.errorChecking && isReadOnly()) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN,
- "NO_MODIFICATION_ALLOWED_ERR", null));
- }
- }
- /** Clone node. */
- public Node cloneNode(boolean deep) {
- EntityImpl newentity = (EntityImpl)super.cloneNode(deep);
- newentity.setReadOnly(true, deep);
- return newentity;
- }
-
- //
- // Entity methods
- //
-
- /**
- * The public identifier associated with the entity. If not specified,
- * this will be null.
- */
- public String getPublicId() {
-
- if (needsSyncData()) {
- synchronizeData();
- }
- return publicId;
-
- } // getPublicId():String
-
- /**
- * The system identifier associated with the entity. If not specified,
- * this will be null.
- */
- public String getSystemId() {
-
- if (needsSyncData()) {
- synchronizeData();
- }
- return systemId;
-
- } // getSystemId():String
-
- /**
- * DOM Level 3 WD - experimental
- * the version number of this entity, when it is an external parsed entity.
- */
- public String getXmlVersion() {
-
- if (needsSyncData()) {
- synchronizeData();
- }
- return version;
-
- } // getVersion():String
-
-
- /**
- * DOM Level 3 WD - experimental
- * the encoding of this entity, when it is an external parsed entity.
- */
- public String getXmlEncoding() {
-
- if (needsSyncData()) {
- synchronizeData();
- }
-
- return encoding;
-
- } // getVersion():String
-
-
-
-
-
- /**
- * Unparsed entities -- which contain non-XML data -- have a
- * "notation name" which tells applications how to deal with them.
- * Parsed entities, which <em>are</em> in XML format, don't need this and
- * set it to null.
- */
- public String getNotationName() {
-
- if (needsSyncData()) {
- synchronizeData();
- }
- return notationName;
-
- } // getNotationName():String
-
- //
- // Public methods
- //
-
- /**
- * DOM Level 2: The public identifier associated with the entity. If not specified,
- * this will be null. */
- public void setPublicId(String id) {
-
- if (needsSyncData()) {
- synchronizeData();
- }
- publicId = id;
-
- } // setPublicId(String)
-
- /**
- * NON-DOM
- * encoding - An attribute specifying, as part of the text declaration,
- * the encoding of this entity, when it is an external parsed entity.
- * This is null otherwise
- *
- */
- public void setXmlEncoding(String value) {
- if (needsSyncData()) {
- synchronizeData();
- }
- encoding = value;
- } // setEncoding (String)
-
-
- /**
- * An attribute specifying the encoding used for this entity at the tiome
- * of parsing, when it is an external parsed entity. This is
- * <code>null</code> if it an entity from the internal subset or if it
- * is not known..
- * @since DOM Level 3
- */
- public String getInputEncoding(){
- if (needsSyncData()) {
- synchronizeData();
- }
- return inputEncoding;
- }
-
- /**
- * NON-DOM, used to set the input encoding.
- */
- public void setInputEncoding(String inputEncoding){
- if (needsSyncData()) {
- synchronizeData();
- }
- this.inputEncoding = inputEncoding;
- }
-
- /**
- * NON-DOM
- * version - An attribute specifying, as part of the text declaration,
- * the version number of this entity, when it is an external parsed entity.
- * This is null otherwise
- */
- public void setXmlVersion(String value) {
- if (needsSyncData()) {
- synchronizeData();
- }
- version = value;
- } // setVersion (String)
-
-
- /**
- * DOM Level 2: The system identifier associated with the entity. If not
- * specified, this will be null.
- */
- public void setSystemId(String id) {
- if (needsSyncData()) {
- synchronizeData();
- }
- systemId = id;
-
- } // setSystemId(String)
-
- /**
- * DOM Level 2: Unparsed entities -- which contain non-XML data -- have a
- * "notation name" which tells applications how to deal with them.
- * Parsed entities, which <em>are</em> in XML format, don't need this and
- * set it to null.
- */
- public void setNotationName(String name) {
- if (needsSyncData()) {
- synchronizeData();
- }
- notationName = name;
-
- } // setNotationName(String)
-
-
-
- /**
- * Returns the absolute base URI of this node or null if the implementation
- * wasn't able to obtain an absolute URI. Note: If the URI is malformed, a
- * null is returned.
- *
- * @return The absolute base URI of this node or null.
- * @since DOM Level 3
- */
- public String getBaseURI() {
-
- if (needsSyncData()) {
- synchronizeData();
- }
- return (baseURI!=null)?baseURI:((CoreDocumentImpl)getOwnerDocument()).getBaseURI();
- }
-
- /** NON-DOM: set base uri*/
- public void setBaseURI(String uri){
- if (needsSyncData()) {
- synchronizeData();
- }
- baseURI = uri;
- }
-
-
-
-} // class EntityImpl
diff --git a/src/com/sun/org/apache/xerces/internal/dom/EntityReferenceImpl.java b/src/com/sun/org/apache/xerces/internal/dom/EntityReferenceImpl.java
deleted file mode 100644
index 305dc33..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/EntityReferenceImpl.java
+++ /dev/null
@@ -1,402 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-import com.sun.org.apache.xerces.internal.util.URI;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.EntityReference;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
- * EntityReference models the XML &entityname; syntax, when used for
- * entities defined by the DOM. Entities hardcoded into XML, such as
- * character entities, should instead have been translated into text
- * by the code which generated the DOM tree.
- * <P>
- * An XML processor has the alternative of fully expanding Entities
- * into the normal document tree. If it does so, no EntityReference nodes
- * will appear.
- * <P>
- * Similarly, non-validating XML processors are not required to read
- * or process entity declarations made in the external subset or
- * declared in external parameter entities. Hence, some applications
- * may not make the replacement value available for Parsed Entities
- * of these types.
- * <P>
- * EntityReference behaves as a read-only node, and the children of
- * the EntityReference (which reflect those of the Entity, and should
- * also be read-only) give its replacement value, if any. They are
- * supposed to automagically stay in synch if the DocumentType is
- * updated with new values for the Entity.
- * <P>
- * The defined behavior makes efficient storage difficult for the DOM
- * implementor. We can't just look aside to the Entity's definition
- * in the DocumentType since those nodes have the wrong parent (unless
- * we can come up with a clever "imaginary parent" mechanism). We
- * must at least appear to clone those children... which raises the
- * issue of keeping the reference synchronized with its parent.
- * This leads me back to the "cached image of centrally defined data"
- * solution, much as I dislike it.
- * <P>
- * For now I have decided, since REC-DOM-Level-1-19980818 doesn't
- * cover this in much detail, that synchronization doesn't have to be
- * considered while the user is deep in the tree. That is, if you're
- * looking within one of the EntityReferennce's children and the Entity
- * changes, you won't be informed; instead, you will continue to access
- * the same object -- which may or may not still be part of the tree.
- * This is the same behavior that obtains elsewhere in the DOM if the
- * subtree you're looking at is deleted from its parent, so it's
- * acceptable here. (If it really bothers folks, we could set things
- * up so deleted subtrees are walked and marked invalid, but that's
- * not part of the DOM's defined behavior.)
- * <P>
- * As a result, only the EntityReference itself has to be aware of
- * changes in the Entity. And it can take advantage of the same
- * structure-change-monitoring code I implemented to support
- * DeepNodeList.
- *
- * @xerces.internal
- *
- * @author Arnaud Le Hors, IBM
- * @author Joe Kesselman, IBM
- * @author Andy Clark, IBM
- * @author Ralf Pfeiffer, IBM
- * @since PR-DOM-Level-1-19980818.
- */
-public class EntityReferenceImpl
-extends ParentNode
-implements EntityReference {
-
- //
- // Constants
- //
-
- /** Serialization version. */
- static final long serialVersionUID = -7381452955687102062L;
-
- //
- // Data
- //
-
- /** Name of Entity referenced */
- protected String name;
- /** Base URI*/
- protected String baseURI;
-
-
- /** Entity changes. */
- //protected int entityChanges = -1;
-
- /** Enable synchronize. */
- //protected boolean fEnableSynchronize = false;
-
- //
- // Constructors
- //
-
- /** Factory constructor. */
- public EntityReferenceImpl(CoreDocumentImpl ownerDoc, String name) {
- super(ownerDoc);
- this.name = name;
- isReadOnly(true);
- needsSyncChildren(true);
- }
-
- //
- // Node methods
- //
-
- /**
- * A short integer indicating what type of node this is. The named
- * constants for this value are defined in the org.w3c.dom.Node interface.
- */
- public short getNodeType() {
- return Node.ENTITY_REFERENCE_NODE;
- }
-
- /**
- * Returns the name of the entity referenced
- */
- public String getNodeName() {
- if (needsSyncData()) {
- synchronizeData();
- }
- return name;
- }
-
- /** Clone node. */
- public Node cloneNode(boolean deep) {
- EntityReferenceImpl er = (EntityReferenceImpl)super.cloneNode(deep);
- er.setReadOnly(true, deep);
- return er;
- }
-
- /**
- * Returns the absolute base URI of this node or null if the implementation
- * wasn't able to obtain an absolute URI. Note: If the URI is malformed, a
- * null is returned.
- *
- * @return The absolute base URI of this node or null.
- * @since DOM Level 3
- */
- public String getBaseURI() {
- if (needsSyncData()) {
- synchronizeData();
- }
- if (baseURI == null) {
- DocumentType doctype;
- NamedNodeMap entities;
- EntityImpl entDef;
- if (null != (doctype = getOwnerDocument().getDoctype()) &&
- null != (entities = doctype.getEntities())) {
-
- entDef = (EntityImpl)entities.getNamedItem(getNodeName());
- if (entDef !=null) {
- return entDef.getBaseURI();
- }
- }
- } else if (baseURI != null && baseURI.length() != 0 ) {// attribute value is always empty string
- try {
- return new URI(baseURI).toString();
- }
- catch (com.sun.org.apache.xerces.internal.util.URI.MalformedURIException e){
- // REVISIT: what should happen in this case?
- return null;
- }
- }
- return baseURI;
- }
-
-
- /** NON-DOM: set base uri*/
- public void setBaseURI(String uri){
- if (needsSyncData()) {
- synchronizeData();
- }
- baseURI = uri;
- }
-
- /**
- * NON-DOM: compute string representation of the entity reference.
- * This method is used to retrieve a string value for an attribute node that has child nodes.
- * @return String representing a value of this entity ref. or
- * null if any node other than EntityReference, Text is encountered
- * during computation
- */
- protected String getEntityRefValue (){
- if (needsSyncChildren()){
- synchronizeChildren();
- }
-
- String value = "";
- if (firstChild != null){
- if (firstChild.getNodeType() == Node.ENTITY_REFERENCE_NODE){
- value = ((EntityReferenceImpl)firstChild).getEntityRefValue();
- }
- else if (firstChild.getNodeType() == Node.TEXT_NODE){
- value = firstChild.getNodeValue();
- }
- else {
- // invalid to have other types of nodes in attr value
- return null;
- }
-
- if (firstChild.nextSibling == null){
- return value;
- }
- else {
- StringBuffer buff = new StringBuffer(value);
- ChildNode next = firstChild.nextSibling;
- while (next != null){
-
- if (next.getNodeType() == Node.ENTITY_REFERENCE_NODE){
- value = ((EntityReferenceImpl)next).getEntityRefValue();
- }
- else if (next.getNodeType() == Node.TEXT_NODE){
- value = next.getNodeValue();
- }
- else {
- // invalid to have other types of nodes in attr value
- return null;
- }
- buff.append(value);
- next = next.nextSibling;
-
- }
- return buff.toString();
- }
- }
- return "";
- }
-
- /**
- * EntityReference's children are a reflection of those defined in the
- * named Entity. This method creates them if they haven't been created yet.
- * This doesn't support editing the Entity though, since this only called
- * once for all.
- */
- protected void synchronizeChildren() {
- // no need to synchronize again
- needsSyncChildren(false);
-
- DocumentType doctype;
- NamedNodeMap entities;
- EntityImpl entDef;
- if (null != (doctype = getOwnerDocument().getDoctype()) &&
- null != (entities = doctype.getEntities())) {
-
- entDef = (EntityImpl)entities.getNamedItem(getNodeName());
-
- // No Entity by this name, stop here.
- if (entDef == null)
- return;
-
- // If entity's definition exists, clone its kids
- isReadOnly(false);
- for (Node defkid = entDef.getFirstChild();
- defkid != null;
- defkid = defkid.getNextSibling()) {
- Node newkid = defkid.cloneNode(true);
- insertBefore(newkid, null);
- }
- setReadOnly(true, true);
- }
- }
-
-
- /**
- * NON-DOM: sets the node and its children value.
- * <P>
- * Note: make sure that entity reference and its kids could be set readonly.
- */
- public void setReadOnly(boolean readOnly, boolean deep) {
-
- if (needsSyncData()) {
- synchronizeData();
- }
- if (deep) {
-
- if (needsSyncChildren()) {
- synchronizeChildren();
- }
- // Recursively set kids
- for (ChildNode mykid = firstChild;
- mykid != null;
- mykid = mykid.nextSibling) {
-
- mykid.setReadOnly(readOnly,true);
-
- }
- }
- isReadOnly(readOnly);
- } // setReadOnly(boolean,boolean)
-
-
- /**
- * Enable the synchronize method which may do cloning. This method is enabled
- * when the parser is done with an EntityReference.
- /***
- // revisit: enable editing of Entity
- public void enableSynchronize(boolean enableSynchronize) {
- fEnableSynchronize= enableSynchronize;
- }
- /***/
-
- /**
- * EntityReference's children are a reflection of those defined in the
- * named Entity. This method updates them if the Entity is changed.
- * <P>
- * It is unclear what the least-cost resynch mechanism is.
- * If we expect the kids to be shallow, and/or expect changes
- * to the Entity contents to be rare, wiping them all out
- * and recloning is simplest.
- * <P>
- * If we expect them to be deep,
- * it might be better to first decide which kids (if any)
- * persist, and keep the ones (if any) that are unchanged
- * rather than doing all the work of cloning them again.
- * But that latter gets into having to convolve the two child lists,
- * insert new information in the right order (and possibly reorder
- * the existing kids), and a few other complexities that I really
- * don't want to deal with in this implementation.
- * <P>
- * Note that if we decide that we need to update the EntityReference's
- * contents, we have to turn off the readOnly flag temporarily to do so.
- * When we get around to adding multitasking support, this whole method
- * should probably be an atomic operation.
- *
- * @see DocumentTypeImpl
- * @see EntityImpl
- */
- // The Xerces parser invokes callbacks for startEnityReference
- // the parsed value of the entity EACH TIME, so it is actually
- // easier to create the nodes through the callbacks rather than
- // clone the Entity.
- /***
- // revisit: enable editing of Entity
- private void synchronize() {
- if (!fEnableSynchronize) {
- return;
- }
- DocumentType doctype;
- NamedNodeMap entities;
- EntityImpl entDef;
- if (null != (doctype = getOwnerDocument().getDoctype()) &&
- null != (entities = doctype.getEntities())) {
-
- entDef = (EntityImpl)entities.getNamedItem(getNodeName());
-
- // No Entity by this name. If we had a change count, reset it.
- if(null==entDef)
- entityChanges=-1;
-
- // If no kids availalble, wipe any pre-existing children.
- // (See discussion above.)
- // Note that we have to use the superclass to avoid recursion
- // through Synchronize.
- readOnly=false;
- if(null==entDef || !entDef.hasChildNodes())
- for(Node kid=super.getFirstChild();
- kid!=null;
- kid=super.getFirstChild())
- removeChild(kid);
-
- // If entity's definition changed, clone its kids
- // (See discussion above.)
- if(null!=entDef && entDef.changes!=entityChanges) {
- for(Node defkid=entDef.getFirstChild();
- defkid!=null;
- defkid=defkid.getNextSibling()) {
-
- NodeImpl newkid=(NodeImpl) defkid.cloneNode(true);
- newkid.setReadOnly(true,true);
- insertBefore(newkid,null);
- }
- entityChanges=entDef.changes;
- }
- readOnly=true;
- }
- }
- /***/
-
-
-} // class EntityReferenceImpl
diff --git a/src/com/sun/org/apache/xerces/internal/dom/LCount.java b/src/com/sun/org/apache/xerces/internal/dom/LCount.java
deleted file mode 100644
index 77545bd..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/LCount.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xerces.internal.dom;
-
-
-/** Internal class LCount is used to track the number of
- listeners registered for a given event name, as an entry
- in a global Map. This should allow us to avoid generating,
- or discarding, events for which no listeners are registered.
-
- ***** There should undoubtedly be methods here to manipulate
- this table. At the moment that code's residing in NodeImpl.
- Move it when we have a chance to do so. Sorry; we were
- rushed.
-*/
-/**
- * @xerces.internal
- *
- */
-
-class LCount
-{
- static final java.util.Map<String, LCount> lCounts=new java.util.concurrent.ConcurrentHashMap<>();
- public int captures=0,bubbles=0,defaults, total=0;
-
- static LCount lookup(String evtName)
- {
- LCount lc=(LCount)lCounts.get(evtName);
- if(lc==null)
- lCounts.put(evtName,(lc=new LCount()));
- return lc;
- }
-} // class LCount
diff --git a/src/com/sun/org/apache/xerces/internal/dom/NamedNodeMapImpl.java b/src/com/sun/org/apache/xerces/internal/dom/NamedNodeMapImpl.java
deleted file mode 100644
index fcf4047..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/NamedNodeMapImpl.java
+++ /dev/null
@@ -1,630 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Vector;
-
-import org.w3c.dom.DOMException;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
- * NamedNodeMaps represent collections of Nodes that can be accessed
- * by name. Entity and Notation nodes are stored in NamedNodeMaps
- * attached to the DocumentType. Attributes are placed in a NamedNodeMap
- * attached to the elem they're related too. However, because attributes
- * require more work, such as firing mutation events, they are stored in
- * a subclass of NamedNodeMapImpl.
- * <P>
- * Only one Node may be stored per name; attempting to
- * store another will replace the previous value.
- * <P>
- * NOTE: The "primary" storage key is taken from the NodeName attribute of the
- * node. The "secondary" storage key is the namespaceURI and localName, when
- * accessed by DOM level 2 nodes. All nodes, even DOM Level 2 nodes are stored
- * in a single Vector sorted by the primary "nodename" key.
- * <P>
- * NOTE: item()'s integer index does _not_ imply that the named nodes
- * must be stored in an array; that's only an access method. Note too
- * that these indices are "live"; if someone changes the map's
- * contents, the indices associated with nodes may change.
- * <P>
- *
- * @xerces.internal
- *
- * @version $Id: NamedNodeMapImpl.java,v 1.8 2010-11-01 04:39:39 joehw Exp $
- * @since PR-DOM-Level-1-19980818.
- */
-public class NamedNodeMapImpl
- implements NamedNodeMap, Serializable {
-
- //
- // Constants
- //
-
- /** Serialization version. */
- static final long serialVersionUID = -7039242451046758020L;
-
- //
- // Data
- //
-
- protected short flags;
-
- protected final static short READONLY = 0x1<<0;
- protected final static short CHANGED = 0x1<<1;
- protected final static short HASDEFAULTS = 0x1<<2;
-
- /** Nodes. */
- protected List nodes;
-
- protected NodeImpl ownerNode; // the node this map belongs to
-
- //
- // Constructors
- //
-
- /** Constructs a named node map. */
- protected NamedNodeMapImpl(NodeImpl ownerNode) {
- this.ownerNode = ownerNode;
- }
-
- //
- // NamedNodeMap methods
- //
-
- /**
- * Report how many nodes are currently stored in this NamedNodeMap.
- * Caveat: This is a count rather than an index, so the
- * highest-numbered node at any time can be accessed via
- * item(getLength()-1).
- */
- public int getLength() {
- return (nodes != null) ? nodes.size() : 0;
- }
-
- /**
- * Retrieve an item from the map by 0-based index.
- *
- * @param index Which item to retrieve. Note that indices are just an
- * enumeration of the current contents; they aren't guaranteed to be
- * stable, nor do they imply any promises about the order of the
- * NamedNodeMap's contents. In other words, DO NOT assume either that
- * index(i) will always refer to the same entry, or that there is any
- * stable ordering of entries... and be prepared for double-reporting
- * or skips as insertion and deletion occur.
- *
- * @return the node which currenly has the specified index, or null if index
- * is greater than or equal to getLength().
- */
- public Node item(int index) {
- return (nodes != null && index < nodes.size()) ?
- (Node)(nodes.get(index)) : null;
- }
-
- /**
- * Retrieve a node by name.
- *
- * @param name Name of a node to look up.
- * @return the Node (of unspecified sub-class) stored with that name, or
- * null if no value has been assigned to that name.
- */
- public Node getNamedItem(String name) {
-
- int i = findNamePoint(name,0);
- return (i < 0) ? null : (Node)(nodes.get(i));
-
- } // getNamedItem(String):Node
-
- /**
- * Introduced in DOM Level 2. <p>
- * Retrieves a node specified by local name and namespace URI.
- *
- * @param namespaceURI The namespace URI of the node to retrieve.
- * When it is null or an empty string, this
- * method behaves like getNamedItem.
- * @param localName The local name of the node to retrieve.
- * @return Node A Node (of any type) with the specified name, or null if the specified
- * name did not identify any node in the map.
- */
- public Node getNamedItemNS(String namespaceURI, String localName) {
-
- int i = findNamePoint(namespaceURI, localName);
- return (i < 0) ? null : (Node)(nodes.get(i));
-
- } // getNamedItemNS(String,String):Node
-
- /**
- * Adds a node using its nodeName attribute.
- * As the nodeName attribute is used to derive the name which the node must be
- * stored under, multiple nodes of certain types (those that have a "special" string
- * value) cannot be stored as the names would clash. This is seen as preferable to
- * allowing nodes to be aliased.
- * @see org.w3c.dom.NamedNodeMap#setNamedItem
- * @return If the new Node replaces an existing node the replaced Node is returned,
- * otherwise null is returned.
- * @param arg
- * A node to store in a named node map. The node will later be
- * accessible using the value of the namespaceURI and localName
- * attribute of the node. If a node with those namespace URI and
- * local name is already present in the map, it is replaced by the new
- * one.
- * @exception org.w3c.dom.DOMException The exception description.
- */
- public Node setNamedItem(Node arg)
- throws DOMException {
-
- CoreDocumentImpl ownerDocument = ownerNode.ownerDocument();
- if (ownerDocument.errorChecking) {
- if (isReadOnly()) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null);
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg);
- }
- if (arg.getOwnerDocument() != ownerDocument) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null);
- throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, msg);
- }
- }
-
- int i = findNamePoint(arg.getNodeName(),0);
- NodeImpl previous = null;
- if (i >= 0) {
- previous = (NodeImpl) nodes.get(i);
- nodes.set(i, arg);
- } else {
- i = -1 - i; // Insert point (may be end of list)
- if (null == nodes) {
- nodes = new ArrayList(5);
- }
- nodes.add(i, arg);
- }
- return previous;
-
- } // setNamedItem(Node):Node
-
- /**
- * Adds a node using its namespaceURI and localName.
- * @see org.w3c.dom.NamedNodeMap#setNamedItem
- * @return If the new Node replaces an existing node the replaced Node is returned,
- * otherwise null is returned.
- * @param arg A node to store in a named node map. The node will later be
- * accessible using the value of the namespaceURI and localName
- * attribute of the node. If a node with those namespace URI and
- * local name is already present in the map, it is replaced by the new
- * one.
- */
- public Node setNamedItemNS(Node arg)
- throws DOMException {
-
- CoreDocumentImpl ownerDocument = ownerNode.ownerDocument();
- if (ownerDocument.errorChecking) {
- if (isReadOnly()) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null);
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg);
- }
-
- if(arg.getOwnerDocument() != ownerDocument) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null);
- throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, msg);
- }
- }
-
- int i = findNamePoint(arg.getNamespaceURI(), arg.getLocalName());
- NodeImpl previous = null;
- if (i >= 0) {
- previous = (NodeImpl) nodes.get(i);
- nodes.set(i, arg);
- } else {
- // If we can't find by namespaceURI, localName, then we find by
- // nodeName so we know where to insert.
- i = findNamePoint(arg.getNodeName(),0);
- if (i >= 0) {
- previous = (NodeImpl) nodes.get(i);
- nodes.add(i, arg);
- } else {
- i = -1 - i; // Insert point (may be end of list)
- if (null == nodes) {
- nodes = new ArrayList(5);
- }
- nodes.add(i, arg);
- }
- }
- return previous;
-
- } // setNamedItemNS(Node):Node
-
- /**
- * Removes a node specified by name.
- * @param name The name of a node to remove.
- * @return The node removed from the map if a node with such a name exists.
- */
- /***/
- public Node removeNamedItem(String name)
- throws DOMException {
-
- if (isReadOnly()) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null);
- throw
- new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
- msg);
- }
- int i = findNamePoint(name,0);
- if (i < 0) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_FOUND_ERR", null);
- throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
- }
-
- NodeImpl n = (NodeImpl)nodes.get(i);
- nodes.remove(i);
-
- return n;
-
- } // removeNamedItem(String):Node
-
- /**
- * Introduced in DOM Level 2. <p>
- * Removes a node specified by local name and namespace URI.
- * @param namespaceURI
- * The namespace URI of the node to remove.
- * When it is null or an empty string, this
- * method behaves like removeNamedItem.
- * @param name The local name of the node to remove.
- * @return Node The node removed from the map if a node with such
- * a local name and namespace URI exists.
- * @throws NOT_FOUND_ERR: Raised if there is no node named
- * name in the map.
-
- */
- public Node removeNamedItemNS(String namespaceURI, String name)
- throws DOMException {
-
- if (isReadOnly()) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null);
- throw
- new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
- msg);
- }
- int i = findNamePoint(namespaceURI, name);
- if (i < 0) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_FOUND_ERR", null);
- throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
- }
-
- NodeImpl n = (NodeImpl)nodes.get(i);
- nodes.remove(i);
-
- return n;
-
- } // removeNamedItem(String):Node
-
- //
- // Public methods
- //
-
- /**
- * Cloning a NamedNodeMap is a DEEP OPERATION; it always clones
- * all the nodes contained in the map.
- */
-
- public NamedNodeMapImpl cloneMap(NodeImpl ownerNode) {
- NamedNodeMapImpl newmap = new NamedNodeMapImpl(ownerNode);
- newmap.cloneContent(this);
- return newmap;
- }
-
- protected void cloneContent(NamedNodeMapImpl srcmap) {
- List srcnodes = srcmap.nodes;
- if (srcnodes != null) {
- int size = srcnodes.size();
- if (size != 0) {
- if (nodes == null) {
- nodes = new ArrayList(size);
- }
- else {
- nodes.clear();
- }
- for (int i = 0; i < size; ++i) {
- NodeImpl n = (NodeImpl) srcmap.nodes.get(i);
- NodeImpl clone = (NodeImpl) n.cloneNode(true);
- clone.isSpecified(n.isSpecified());
- nodes.add(clone);
- }
- }
- }
- } // cloneMap():NamedNodeMapImpl
-
- //
- // Package methods
- //
-
- /**
- * Internal subroutine to allow read-only Nodes to make their contained
- * NamedNodeMaps readonly too. I expect that in fact the shallow
- * version of this operation will never be
- *
- * @param readOnly boolean true to make read-only, false to permit editing.
- * @param deep boolean true to pass this request along to the contained
- * nodes, false to only toggle the NamedNodeMap itself. I expect that
- * the shallow version of this operation will never be used, but I want
- * to design it in now, while I'm thinking about it.
- */
- void setReadOnly(boolean readOnly, boolean deep) {
- isReadOnly(readOnly);
- if (deep && nodes != null) {
- for (int i = nodes.size() - 1; i >= 0; i--) {
- ((NodeImpl) nodes.get(i)).setReadOnly(readOnly,deep);
- }
- }
- } // setReadOnly(boolean,boolean)
-
- /**
- * Internal subroutine returns this NodeNameMap's (shallow) readOnly value.
- *
- */
- boolean getReadOnly() {
- return isReadOnly();
- } // getReadOnly()
-
-
- //
- // Protected methods
- //
-
- /**
- * NON-DOM
- * set the ownerDocument of this node, and the attributes it contains
- */
- protected void setOwnerDocument(CoreDocumentImpl doc) {
- if (nodes != null) {
- final int size = nodes.size();
- for (int i = 0; i < size; ++i) {
- ((NodeImpl)item(i)).setOwnerDocument(doc);
- }
- }
- }
-
- final boolean isReadOnly() {
- return (flags & READONLY) != 0;
- }
-
- final void isReadOnly(boolean value) {
- flags = (short) (value ? flags | READONLY : flags & ~READONLY);
- }
-
- final boolean changed() {
- return (flags & CHANGED) != 0;
- }
-
- final void changed(boolean value) {
- flags = (short) (value ? flags | CHANGED : flags & ~CHANGED);
- }
-
- final boolean hasDefaults() {
- return (flags & HASDEFAULTS) != 0;
- }
-
- final void hasDefaults(boolean value) {
- flags = (short) (value ? flags | HASDEFAULTS : flags & ~HASDEFAULTS);
- }
-
- //
- // Private methods
- //
-
- /**
- * Subroutine: Locate the named item, or the point at which said item
- * should be added.
- *
- * @param name Name of a node to look up.
- *
- * @return If positive or zero, the index of the found item.
- * If negative, index of the appropriate point at which to insert
- * the item, encoded as -1-index and hence reconvertable by subtracting
- * it from -1. (Encoding because I don't want to recompare the strings
- * but don't want to burn bytes on a datatype to hold a flagged value.)
- */
- protected int findNamePoint(String name, int start) {
-
- // Binary search
- int i = 0;
- if (nodes != null) {
- int first = start;
- int last = nodes.size() - 1;
-
- while (first <= last) {
- i = (first + last) / 2;
- int test = name.compareTo(((Node)(nodes.get(i))).getNodeName());
- if (test == 0) {
- return i; // Name found
- }
- else if (test < 0) {
- last = i - 1;
- }
- else {
- first = i + 1;
- }
- }
-
- if (first > i) {
- i = first;
- }
- }
-
- return -1 - i; // not-found has to be encoded.
-
- } // findNamePoint(String):int
-
-
- /** This findNamePoint is for DOM Level 2 Namespaces.
- */
- protected int findNamePoint(String namespaceURI, String name) {
-
- if (nodes == null) return -1;
- if (name == null) return -1;
-
- // This is a linear search through the same nodes ArrayList.
- // The ArrayList is sorted on the DOM Level 1 nodename.
- // The DOM Level 2 NS keys are namespaceURI and Localname,
- // so we must linear search thru it.
- // In addition, to get this to work with nodes without any namespace
- // (namespaceURI and localNames are both null) we then use the nodeName
- // as a secondary key.
- final int size = nodes.size();
- for (int i = 0; i < size; ++i) {
- NodeImpl a = (NodeImpl)nodes.get(i);
- String aNamespaceURI = a.getNamespaceURI();
- String aLocalName = a.getLocalName();
- if (namespaceURI == null) {
- if (aNamespaceURI == null
- &&
- (name.equals(aLocalName)
- ||
- (aLocalName == null && name.equals(a.getNodeName()))))
- return i;
- } else {
- if (namespaceURI.equals(aNamespaceURI)
- &&
- name.equals(aLocalName))
- return i;
- }
- }
- return -1;
- }
-
- // compare 2 nodes in the map. If a precedes b, return true, otherwise
- // return false
- protected boolean precedes(Node a, Node b) {
-
- if (nodes != null) {
- final int size = nodes.size();
- for (int i = 0; i < size; ++i) {
- Node n = (Node)nodes.get(i);
- if (n==a) return true;
- if (n==b) return false;
- }
- }
- return false;
- }
-
-
- /**
- * NON-DOM: Remove attribute at specified index
- */
- protected void removeItem(int index) {
- if (nodes != null && index < nodes.size()){
- nodes.remove(index);
- }
- }
-
-
- protected Object getItem (int index){
- if (nodes != null) {
- return nodes.get(index);
- }
- return null;
- }
-
- protected int addItem (Node arg) {
- int i = findNamePoint(arg.getNamespaceURI(), arg.getLocalName());
- if (i >= 0) {
- nodes.set(i, arg);
- }
- else {
- // If we can't find by namespaceURI, localName, then we find by
- // nodeName so we know where to insert.
- i = findNamePoint(arg.getNodeName(),0);
- if (i >= 0) {
- nodes.add(i, arg);
- }
- else {
- i = -1 - i; // Insert point (may be end of list)
- if (null == nodes) {
- nodes = new ArrayList(5);
- }
- nodes.add(i, arg);
- }
- }
- return i;
- }
-
- /**
- * NON-DOM: copy content of this map into the specified ArrayList
- *
- * @param list ArrayList to copy information into.
- * @return A copy of this node named map
- */
- protected ArrayList cloneMap(ArrayList list) {
- if (list == null) {
- list = new ArrayList(5);
- }
- list.clear();
- if (nodes != null) {
- final int size = nodes.size();
- for (int i = 0; i < size; ++i) {
- list.add(nodes.get(i));
- }
- }
- return list;
- }
-
- protected int getNamedItemIndex(String namespaceURI, String localName) {
- return findNamePoint(namespaceURI, localName);
- }
-
- /**
- * NON-DOM remove all elements from this map
- */
- public void removeAll (){
- if (nodes != null) {
- nodes.clear();
- }
- }
-
- private void readObject(ObjectInputStream in)
- throws IOException, ClassNotFoundException {
- in.defaultReadObject();
- if (nodes != null) {
- nodes = new ArrayList(nodes);
- }
- }
-
- private void writeObject(ObjectOutputStream out) throws IOException {
- List oldNodes = this.nodes;
- try {
- if (oldNodes != null) {
- this.nodes = new Vector(oldNodes);
- }
- out.defaultWriteObject();
- }
- // If the write fails for some reason ensure
- // that we restore the original object.
- finally {
- this.nodes = oldNodes;
- }
- }
-
-} // class NamedNodeMapImpl
diff --git a/src/com/sun/org/apache/xerces/internal/dom/NodeImpl.java b/src/com/sun/org/apache/xerces/internal/dom/NodeImpl.java
deleted file mode 100644
index 529f533..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/NodeImpl.java
+++ /dev/null
@@ -1,2023 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
- /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-import java.io.IOException;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-import java.util.Map;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.UserDataHandler;
-import org.w3c.dom.events.Event;
-import org.w3c.dom.events.EventListener;
-import org.w3c.dom.events.EventTarget;
-
-/**
- * NodeImpl provides the basic structure of a DOM tree. It is never used
- * directly, but instead is subclassed to add type and data
- * information, and additional methods, appropriate to each node of
- * the tree. Only its subclasses should be instantiated -- and those,
- * with the exception of Document itself, only through a specific
- * Document's factory methods.
- * <P>
- * The Node interface provides shared behaviors such as siblings and
- * children, both for consistancy and so that the most common tree
- * operations may be performed without constantly having to downcast
- * to specific node types. When there is no obvious mapping for one of
- * these queries, it will respond with null.
- * Note that the default behavior is that children are forbidden. To
- * permit them, the subclass ParentNode overrides several methods.
- * <P>
- * NodeImpl also implements NodeList, so it can return itself in
- * response to the getChildNodes() query. This eliminiates the need
- * for a separate ChildNodeList object. Note that this is an
- * IMPLEMENTATION DETAIL; applications should _never_ assume that
- * this identity exists.
- * <P>
- * All nodes in a single document must originate
- * in that document. (Note that this is much tighter than "must be
- * same implementation") Nodes are all aware of their ownerDocument,
- * and attempts to mismatch will throw WRONG_DOCUMENT_ERR.
- * <P>
- * However, to save memory not all nodes always have a direct reference
- * to their ownerDocument. When a node is owned by another node it relies
- * on its owner to store its ownerDocument. Parent nodes always store it
- * though, so there is never more than one level of indirection.
- * And when a node doesn't have an owner, ownerNode refers to its
- * ownerDocument.
- * <p>
- * This class doesn't directly support mutation events, however, it still
- * implements the EventTarget interface and forward all related calls to the
- * document so that the document class do so.
- *
- * @xerces.internal
- *
- * @author Arnaud Le Hors, IBM
- * @author Joe Kesselman, IBM
- * @since PR-DOM-Level-1-19980818.
- */
-public abstract class NodeImpl
- implements Node, NodeList, EventTarget, Cloneable, Serializable{
-
- //
- // Constants
- //
-
-
- // TreePosition Constants.
- // Taken from DOM L3 Node interface.
- /**
- * The node precedes the reference node.
- */
- public static final short TREE_POSITION_PRECEDING = 0x01;
- /**
- * The node follows the reference node.
- */
- public static final short TREE_POSITION_FOLLOWING = 0x02;
- /**
- * The node is an ancestor of the reference node.
- */
- public static final short TREE_POSITION_ANCESTOR = 0x04;
- /**
- * The node is a descendant of the reference node.
- */
- public static final short TREE_POSITION_DESCENDANT = 0x08;
- /**
- * The two nodes have an equivalent position. This is the case of two
- * attributes that have the same <code>ownerElement</code>, and two
- * nodes that are the same.
- */
- public static final short TREE_POSITION_EQUIVALENT = 0x10;
- /**
- * The two nodes are the same. Two nodes that are the same have an
- * equivalent position, though the reverse may not be true.
- */
- public static final short TREE_POSITION_SAME_NODE = 0x20;
- /**
- * The two nodes are disconnected, they do not have any common ancestor.
- * This is the case of two nodes that are not in the same document.
- */
- public static final short TREE_POSITION_DISCONNECTED = 0x00;
-
-
- // DocumentPosition
- public static final short DOCUMENT_POSITION_DISCONNECTED = 0x01;
- public static final short DOCUMENT_POSITION_PRECEDING = 0x02;
- public static final short DOCUMENT_POSITION_FOLLOWING = 0x04;
- public static final short DOCUMENT_POSITION_CONTAINS = 0x08;
- public static final short DOCUMENT_POSITION_IS_CONTAINED = 0x10;
- public static final short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20;
-
- /** Serialization version. */
- static final long serialVersionUID = -6316591992167219696L;
-
- // public
-
- /** Element definition node type. */
- public static final short ELEMENT_DEFINITION_NODE = 21;
-
- //
- // Data
- //
-
- // links
-
- protected NodeImpl ownerNode; // typically the parent but not always!
-
- // data
-
- protected short flags;
-
- protected final static short READONLY = 0x1<<0;
- protected final static short SYNCDATA = 0x1<<1;
- protected final static short SYNCCHILDREN = 0x1<<2;
- protected final static short OWNED = 0x1<<3;
- protected final static short FIRSTCHILD = 0x1<<4;
- protected final static short SPECIFIED = 0x1<<5;
- protected final static short IGNORABLEWS = 0x1<<6;
- protected final static short HASSTRING = 0x1<<7;
- protected final static short NORMALIZED = 0x1<<8;
- protected final static short ID = 0x1<<9;
-
- //
- // Constructors
- //
-
- /**
- * No public constructor; only subclasses of Node should be
- * instantiated, and those normally via a Document's factory methods
- * <p>
- * Every Node knows what Document it belongs to.
- */
- protected NodeImpl(CoreDocumentImpl ownerDocument) {
- // as long as we do not have any owner, ownerNode is our ownerDocument
- ownerNode = ownerDocument;
- } // <init>(CoreDocumentImpl)
-
- /** Constructor for serialization. */
- public NodeImpl() {}
-
- //
- // Node methods
- //
-
- /**
- * A short integer indicating what type of node this is. The named
- * constants for this value are defined in the org.w3c.dom.Node interface.
- */
- public abstract short getNodeType();
-
- /**
- * the name of this node.
- */
- public abstract String getNodeName();
-
- /**
- * Returns the node value.
- * @throws DOMException(DOMSTRING_SIZE_ERR)
- */
- public String getNodeValue()
- throws DOMException {
- return null; // overridden in some subclasses
- }
-
- /**
- * Sets the node value.
- * @throws DOMException(NO_MODIFICATION_ALLOWED_ERR)
- */
- public void setNodeValue(String x)
- throws DOMException {
- // Default behavior is to do nothing, overridden in some subclasses
- }
-
- /**
- * Adds a child node to the end of the list of children for this node.
- * Convenience shorthand for insertBefore(newChild,null).
- * @see #insertBefore(Node, Node)
- * <P>
- * By default we do not accept any children, ParentNode overrides this.
- * @see ParentNode
- *
- * @return newChild, in its new state (relocated, or emptied in the case of
- * DocumentNode.)
- *
- * @throws DOMException(HIERARCHY_REQUEST_ERR) if newChild is of a
- * type that shouldn't be a child of this node.
- *
- * @throws DOMException(WRONG_DOCUMENT_ERR) if newChild has a
- * different owner document than we do.
- *
- * @throws DOMException(NO_MODIFICATION_ALLOWED_ERR) if this node is
- * read-only.
- */
- public Node appendChild(Node newChild) throws DOMException {
- return insertBefore(newChild, null);
- }
-
- /**
- * Returns a duplicate of a given node. You can consider this a
- * generic "copy constructor" for nodes. The newly returned object should
- * be completely independent of the source object's subtree, so changes
- * in one after the clone has been made will not affect the other.
- * <P>
- * Note: since we never have any children deep is meaningless here,
- * ParentNode overrides this behavior.
- * @see ParentNode
- *
- * <p>
- * Example: Cloning a Text node will copy both the node and the text it
- * contains.
- * <p>
- * Example: Cloning something that has children -- Element or Attr, for
- * example -- will _not_ clone those children unless a "deep clone"
- * has been requested. A shallow clone of an Attr node will yield an
- * empty Attr of the same name.
- * <p>
- * NOTE: Clones will always be read/write, even if the node being cloned
- * is read-only, to permit applications using only the DOM API to obtain
- * editable copies of locked portions of the tree.
- */
- public Node cloneNode(boolean deep) {
-
- if (needsSyncData()) {
- synchronizeData();
- }
-
- NodeImpl newnode;
- try {
- newnode = (NodeImpl)clone();
- }
- catch (CloneNotSupportedException e) {
- // if we get here we have an error in our program we may as well
- // be vocal about it, so that people can take appropriate action.
- throw new RuntimeException("**Internal Error**" + e);
- }
-
- // Need to break the association w/ original kids
- newnode.ownerNode = ownerDocument();
- newnode.isOwned(false);
-
- // By default we make all clones readwrite,
- // this is overriden in readonly subclasses
- newnode.isReadOnly(false);
-
- ownerDocument().callUserDataHandlers(this, newnode,
- UserDataHandler.NODE_CLONED);
-
- return newnode;
-
- } // cloneNode(boolean):Node
-
- /**
- * Find the Document that this Node belongs to (the document in
- * whose context the Node was created). The Node may or may not
- * currently be part of that Document's actual contents.
- */
- public Document getOwnerDocument() {
- // if we have an owner simply forward the request
- // otherwise ownerNode is our ownerDocument
- if (isOwned()) {
- return ownerNode.ownerDocument();
- } else {
- return (Document) ownerNode;
- }
- }
-
- /**
- * same as above but returns internal type and this one is not overridden
- * by CoreDocumentImpl to return null
- */
- CoreDocumentImpl ownerDocument() {
- // if we have an owner simply forward the request
- // otherwise ownerNode is our ownerDocument
- if (isOwned()) {
- return ownerNode.ownerDocument();
- } else {
- return (CoreDocumentImpl) ownerNode;
- }
- }
-
- /**
- * NON-DOM
- * set the ownerDocument of this node
- */
- void setOwnerDocument(CoreDocumentImpl doc) {
- if (needsSyncData()) {
- synchronizeData();
- }
- // if we have an owner we rely on it to have it right
- // otherwise ownerNode is our ownerDocument
- if (!isOwned()) {
- ownerNode = doc;
- }
- }
-
- /**
- * Returns the node number
- */
- protected int getNodeNumber() {
- int nodeNumber;
- CoreDocumentImpl cd = (CoreDocumentImpl)(this.getOwnerDocument());
- nodeNumber = cd.getNodeNumber(this);
- return nodeNumber;
- }
-
- /**
- * Obtain the DOM-tree parent of this node, or null if it is not
- * currently active in the DOM tree (perhaps because it has just been
- * created or removed). Note that Document, DocumentFragment, and
- * Attribute will never have parents.
- */
- public Node getParentNode() {
- return null; // overriden by ChildNode
- }
-
- /*
- * same as above but returns internal type
- */
- NodeImpl parentNode() {
- return null;
- }
-
- /** The next child of this node's parent, or null if none */
- public Node getNextSibling() {
- return null; // default behavior, overriden in ChildNode
- }
-
- /** The previous child of this node's parent, or null if none */
- public Node getPreviousSibling() {
- return null; // default behavior, overriden in ChildNode
- }
-
- ChildNode previousSibling() {
- return null; // default behavior, overriden in ChildNode
- }
-
- /**
- * Return the collection of attributes associated with this node,
- * or null if none. At this writing, Element is the only type of node
- * which will ever have attributes.
- *
- * @see ElementImpl
- */
- public NamedNodeMap getAttributes() {
- return null; // overridden in ElementImpl
- }
-
- /**
- * Returns whether this node (if it is an element) has any attributes.
- * @return <code>true</code> if this node has any attributes,
- * <code>false</code> otherwise.
- * @since DOM Level 2
- * @see ElementImpl
- */
- public boolean hasAttributes() {
- return false; // overridden in ElementImpl
- }
-
- /**
- * Test whether this node has any children. Convenience shorthand
- * for (Node.getFirstChild()!=null)
- * <P>
- * By default we do not have any children, ParentNode overrides this.
- * @see ParentNode
- */
- public boolean hasChildNodes() {
- return false;
- }
-
- /**
- * Obtain a NodeList enumerating all children of this node. If there
- * are none, an (initially) empty NodeList is returned.
- * <p>
- * NodeLists are "live"; as children are added/removed the NodeList
- * will immediately reflect those changes. Also, the NodeList refers
- * to the actual nodes, so changes to those nodes made via the DOM tree
- * will be reflected in the NodeList and vice versa.
- * <p>
- * In this implementation, Nodes implement the NodeList interface and
- * provide their own getChildNodes() support. Other DOMs may solve this
- * differently.
- */
- public NodeList getChildNodes() {
- return this;
- }
-
- /** The first child of this Node, or null if none.
- * <P>
- * By default we do not have any children, ParentNode overrides this.
- * @see ParentNode
- */
- public Node getFirstChild() {
- return null;
- }
-
- /** The first child of this Node, or null if none.
- * <P>
- * By default we do not have any children, ParentNode overrides this.
- * @see ParentNode
- */
- public Node getLastChild() {
- return null;
- }
-
- /**
- * Move one or more node(s) to our list of children. Note that this
- * implicitly removes them from their previous parent.
- * <P>
- * By default we do not accept any children, ParentNode overrides this.
- * @see ParentNode
- *
- * @param newChild The Node to be moved to our subtree. As a
- * convenience feature, inserting a DocumentNode will instead insert
- * all its children.
- *
- * @param refChild Current child which newChild should be placed
- * immediately before. If refChild is null, the insertion occurs
- * after all existing Nodes, like appendChild().
- *
- * @return newChild, in its new state (relocated, or emptied in the case of
- * DocumentNode.)
- *
- * @throws DOMException(HIERARCHY_REQUEST_ERR) if newChild is of a
- * type that shouldn't be a child of this node, or if newChild is an
- * ancestor of this node.
- *
- * @throws DOMException(WRONG_DOCUMENT_ERR) if newChild has a
- * different owner document than we do.
- *
- * @throws DOMException(NOT_FOUND_ERR) if refChild is not a child of
- * this node.
- *
- * @throws DOMException(NO_MODIFICATION_ALLOWED_ERR) if this node is
- * read-only.
- */
- public Node insertBefore(Node newChild, Node refChild)
- throws DOMException {
- throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN,
- "HIERARCHY_REQUEST_ERR", null));
- }
-
- /**
- * Remove a child from this Node. The removed child's subtree
- * remains intact so it may be re-inserted elsewhere.
- * <P>
- * By default we do not have any children, ParentNode overrides this.
- * @see ParentNode
- *
- * @return oldChild, in its new state (removed).
- *
- * @throws DOMException(NOT_FOUND_ERR) if oldChild is not a child of
- * this node.
- *
- * @throws DOMException(NO_MODIFICATION_ALLOWED_ERR) if this node is
- * read-only.
- */
- public Node removeChild(Node oldChild)
- throws DOMException {
- throw new DOMException(DOMException.NOT_FOUND_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN,
- "NOT_FOUND_ERR", null));
- }
-
- /**
- * Make newChild occupy the location that oldChild used to
- * have. Note that newChild will first be removed from its previous
- * parent, if any. Equivalent to inserting newChild before oldChild,
- * then removing oldChild.
- * <P>
- * By default we do not have any children, ParentNode overrides this.
- * @see ParentNode
- *
- * @return oldChild, in its new state (removed).
- *
- * @throws DOMException(HIERARCHY_REQUEST_ERR) if newChild is of a
- * type that shouldn't be a child of this node, or if newChild is
- * one of our ancestors.
- *
- * @throws DOMException(WRONG_DOCUMENT_ERR) if newChild has a
- * different owner document than we do.
- *
- * @throws DOMException(NOT_FOUND_ERR) if oldChild is not a child of
- * this node.
- *
- * @throws DOMException(NO_MODIFICATION_ALLOWED_ERR) if this node is
- * read-only.
- */
- public Node replaceChild(Node newChild, Node oldChild)
- throws DOMException {
- throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN,
- "HIERARCHY_REQUEST_ERR", null));
- }
-
- //
- // NodeList methods
- //
-
- /**
- * NodeList method: Count the immediate children of this node
- * <P>
- * By default we do not have any children, ParentNode overrides this.
- * @see ParentNode
- *
- * @return int
- */
- public int getLength() {
- return 0;
- }
-
- /**
- * NodeList method: Return the Nth immediate child of this node, or
- * null if the index is out of bounds.
- * <P>
- * By default we do not have any children, ParentNode overrides this.
- * @see ParentNode
- *
- * @return org.w3c.dom.Node
- * @param Index int
- */
- public Node item(int index) {
- return null;
- }
-
- //
- // DOM2: methods, getters, setters
- //
-
- /**
- * Puts all <code>Text</code> nodes in the full depth of the sub-tree
- * underneath this <code>Node</code>, including attribute nodes, into a
- * "normal" form where only markup (e.g., tags, comments, processing
- * instructions, CDATA sections, and entity references) separates
- * <code>Text</code> nodes, i.e., there are no adjacent <code>Text</code>
- * nodes. This can be used to ensure that the DOM view of a document is
- * the same as if it were saved and re-loaded, and is useful when
- * operations (such as XPointer lookups) that depend on a particular
- * document tree structure are to be used.In cases where the document
- * contains <code>CDATASections</code>, the normalize operation alone may
- * not be sufficient, since XPointers do not differentiate between
- * <code>Text</code> nodes and <code>CDATASection</code> nodes.
- * <p>
- * Note that this implementation simply calls normalize() on this Node's
- * children. It is up to implementors or Node to override normalize()
- * to take action.
- */
- public void normalize() {
- /* by default we do not have any children,
- ParentNode overrides this behavior */
- }
-
- /**
- * Introduced in DOM Level 2. <p>
- * Tests whether the DOM implementation implements a specific feature and
- * that feature is supported by this node.
- * @param feature The package name of the feature to test. This is the same
- * name as what can be passed to the method hasFeature on
- * DOMImplementation.
- * @param version This is the version number of the package name to
- * test. In Level 2, version 1, this is the string "2.0". If the version is
- * not specified, supporting any version of the feature will cause the
- * method to return true.
- * @return boolean Returns true if this node defines a subtree within which
- * the specified feature is supported, false otherwise.
- * @since WD-DOM-Level-2-19990923
- */
- public boolean isSupported(String feature, String version)
- {
- return ownerDocument().getImplementation().hasFeature(feature,
- version);
- }
-
- /**
- * Introduced in DOM Level 2. <p>
- *
- * The namespace URI of this node, or null if it is unspecified. When this
- * node is of any type other than ELEMENT_NODE and ATTRIBUTE_NODE, this is
- * always null and setting it has no effect. <p>
- *
- * This is not a computed value that is the result of a namespace lookup
- * based on an examination of the namespace declarations in scope. It is
- * merely the namespace URI given at creation time.<p>
- *
- * For nodes created with a DOM Level 1 method, such as createElement
- * from the Document interface, this is null.
- * @since WD-DOM-Level-2-19990923
- * @see AttrNSImpl
- * @see ElementNSImpl
- */
- public String getNamespaceURI()
- {
- return null;
- }
-
- /**
- * Introduced in DOM Level 2. <p>
- *
- * The namespace prefix of this node, or null if it is unspecified. When
- * this node is of any type other than ELEMENT_NODE and ATTRIBUTE_NODE this
- * is always null and setting it has no effect.<p>
- *
- * For nodes created with a DOM Level 1 method, such as createElement
- * from the Document interface, this is null. <p>
- *
- * @since WD-DOM-Level-2-19990923
- * @see AttrNSImpl
- * @see ElementNSImpl
- */
- public String getPrefix()
- {
- return null;
- }
-
- /**
- * Introduced in DOM Level 2. <p>
- *
- * The namespace prefix of this node, or null if it is unspecified. When
- * this node is of any type other than ELEMENT_NODE and ATTRIBUTE_NODE
- * this is always null and setting it has no effect.<p>
- *
- * For nodes created with a DOM Level 1 method, such as createElement from
- * the Document interface, this is null.<p>
- *
- * Note that setting this attribute changes the nodeName attribute, which
- * holds the qualified name, as well as the tagName and name attributes of
- * the Element and Attr interfaces, when applicable.<p>
- *
- * @throws INVALID_CHARACTER_ERR Raised if the specified
- * prefix contains an invalid character.
- *
- * @since WD-DOM-Level-2-19990923
- * @see AttrNSImpl
- * @see ElementNSImpl
- */
- public void setPrefix(String prefix)
- throws DOMException
- {
- throw new DOMException(DOMException.NAMESPACE_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN,
- "NAMESPACE_ERR", null));
- }
-
- /**
- * Introduced in DOM Level 2. <p>
- *
- * Returns the local part of the qualified name of this node.
- * For nodes created with a DOM Level 1 method, such as createElement
- * from the Document interface, and for nodes of any type other than
- * ELEMENT_NODE and ATTRIBUTE_NODE this is the same as the nodeName
- * attribute.
- * @since WD-DOM-Level-2-19990923
- * @see AttrNSImpl
- * @see ElementNSImpl
- */
- public String getLocalName()
- {
- return null;
- }
-
- //
- // EventTarget support
- //
-
- public void addEventListener(String type, EventListener listener,
- boolean useCapture) {
- // simply forward to Document
- ownerDocument().addEventListener(this, type, listener, useCapture);
- }
-
- public void removeEventListener(String type, EventListener listener,
- boolean useCapture) {
- // simply forward to Document
- ownerDocument().removeEventListener(this, type, listener, useCapture);
- }
-
- public boolean dispatchEvent(Event event) {
- // simply forward to Document
- return ownerDocument().dispatchEvent(this, event);
- }
-
- //
- // Public DOM Level 3 methods
- //
-
- /**
- * The absolute base URI of this node or <code>null</code> if undefined.
- * This value is computed according to . However, when the
- * <code>Document</code> supports the feature "HTML" , the base URI is
- * computed using first the value of the href attribute of the HTML BASE
- * element if any, and the value of the <code>documentURI</code>
- * attribute from the <code>Document</code> interface otherwise.
- * <br> When the node is an <code>Element</code>, a <code>Document</code>
- * or a a <code>ProcessingInstruction</code>, this attribute represents
- * the properties [base URI] defined in . When the node is a
- * <code>Notation</code>, an <code>Entity</code>, or an
- * <code>EntityReference</code>, this attribute represents the
- * properties [declaration base URI] in the . How will this be affected
- * by resolution of relative namespace URIs issue?It's not.Should this
- * only be on Document, Element, ProcessingInstruction, Entity, and
- * Notation nodes, according to the infoset? If not, what is it equal to
- * on other nodes? Null? An empty string? I think it should be the
- * parent's.No.Should this be read-only and computed or and actual
- * read-write attribute?Read-only and computed (F2F 19 Jun 2000 and
- * teleconference 30 May 2001).If the base HTML element is not yet
- * attached to a document, does the insert change the Document.baseURI?
- * Yes. (F2F 26 Sep 2001)
- * @since DOM Level 3
- */
- public String getBaseURI() {
- return null;
- }
-
- /**
- * Compares a node with this node with regard to their position in the
- * tree and according to the document order. This order can be extended
- * by module that define additional types of nodes.
- * @param other The node to compare against this node.
- * @return Returns how the given node is positioned relatively to this
- * node.
- * @since DOM Level 3
- * @deprecated
- */
- public short compareTreePosition(Node other) {
- // Questions of clarification for this method - to be answered by the
- // DOM WG. Current assumptions listed - LM
- //
- // 1. How do ENTITY nodes compare?
- // Current assumption: TREE_POSITION_DISCONNECTED, as ENTITY nodes
- // aren't really 'in the tree'
- //
- // 2. How do NOTATION nodes compare?
- // Current assumption: TREE_POSITION_DISCONNECTED, as NOTATION nodes
- // aren't really 'in the tree'
- //
- // 3. Are TREE_POSITION_ANCESTOR and TREE_POSITION_DESCENDANT
- // only relevant for nodes that are "part of the document tree"?
- // <outer>
- // <inner myattr="true"/>
- // </outer>
- // Is the element node "outer" considered an ancestor of "myattr"?
- // Current assumption: No.
- //
- // 4. How do children of ATTRIBUTE nodes compare (with eachother, or
- // with children of other attribute nodes with the same element)
- // Current assumption: Children of ATTRIBUTE nodes are treated as if
- // they they are the attribute node itself, unless the 2 nodes
- // are both children of the same attribute.
- //
- // 5. How does an ENTITY_REFERENCE node compare with it's children?
- // Given the DOM, it should precede its children as an ancestor.
- // Given "document order", does it represent the same position?
- // Current assumption: An ENTITY_REFERENCE node is an ancestor of its
- // children.
- //
- // 6. How do children of a DocumentFragment compare?
- // Current assumption: If both nodes are part of the same document
- // fragment, there are compared as if they were part of a document.
-
-
- // If the nodes are the same...
- if (this==other)
- return (TREE_POSITION_SAME_NODE | TREE_POSITION_EQUIVALENT);
-
- // If either node is of type ENTITY or NOTATION, compare as disconnected
- short thisType = this.getNodeType();
- short otherType = other.getNodeType();
-
- // If either node is of type ENTITY or NOTATION, compare as disconnected
- if (thisType == Node.ENTITY_NODE ||
- thisType == Node.NOTATION_NODE ||
- otherType == Node.ENTITY_NODE ||
- otherType == Node.NOTATION_NODE ) {
- return TREE_POSITION_DISCONNECTED;
- }
-
- // Find the ancestor of each node, and the distance each node is from
- // its ancestor.
- // During this traversal, look for ancestor/descendent relationships
- // between the 2 nodes in question.
- // We do this now, so that we get this info correct for attribute nodes
- // and their children.
-
- Node node;
- Node thisAncestor = this;
- Node otherAncestor = other;
- int thisDepth=0;
- int otherDepth=0;
- for (node=this; node != null; node = node.getParentNode()) {
- thisDepth +=1;
- if (node == other)
- // The other node is an ancestor of this one.
- return (TREE_POSITION_ANCESTOR | TREE_POSITION_PRECEDING);
- thisAncestor = node;
- }
-
- for (node=other; node!=null; node=node.getParentNode()) {
- otherDepth +=1;
- if (node == this)
- // The other node is a descendent of the reference node.
- return (TREE_POSITION_DESCENDANT | TREE_POSITION_FOLLOWING);
- otherAncestor = node;
- }
-
-
- Node thisNode = this;
- Node otherNode = other;
-
- int thisAncestorType = thisAncestor.getNodeType();
- int otherAncestorType = otherAncestor.getNodeType();
-
- // if the ancestor is an attribute, get owning element.
- // we are now interested in the owner to determine position.
-
- if (thisAncestorType == Node.ATTRIBUTE_NODE) {
- thisNode = ((AttrImpl)thisAncestor).getOwnerElement();
- }
- if (otherAncestorType == Node.ATTRIBUTE_NODE) {
- otherNode = ((AttrImpl)otherAncestor).getOwnerElement();
- }
-
- // Before proceeding, we should check if both ancestor nodes turned
- // out to be attributes for the same element
- if (thisAncestorType == Node.ATTRIBUTE_NODE &&
- otherAncestorType == Node.ATTRIBUTE_NODE &&
- thisNode==otherNode)
- return TREE_POSITION_EQUIVALENT;
-
- // Now, find the ancestor of the owning element, if the original
- // ancestor was an attribute
-
- // Note: the following 2 loops are quite close to the ones above.
- // May want to common them up. LM.
- if (thisAncestorType == Node.ATTRIBUTE_NODE) {
- thisDepth=0;
- for (node=thisNode; node != null; node=node.getParentNode()) {
- thisDepth +=1;
- if (node == otherNode)
- // The other node is an ancestor of the owning element
- {
- return TREE_POSITION_PRECEDING;
- }
- thisAncestor = node;
- }
- }
-
- // Now, find the ancestor of the owning element, if the original
- // ancestor was an attribute
- if (otherAncestorType == Node.ATTRIBUTE_NODE) {
- otherDepth=0;
- for (node=otherNode; node != null; node=node.getParentNode()) {
- otherDepth +=1;
- if (node == thisNode)
- // The other node is a descendent of the reference
- // node's element
- return TREE_POSITION_FOLLOWING;
- otherAncestor = node;
- }
- }
-
- // thisAncestor and otherAncestor must be the same at this point,
- // otherwise, we are not in the same tree or document fragment
- if (thisAncestor != otherAncestor)
- return TREE_POSITION_DISCONNECTED;
-
-
- // Go up the parent chain of the deeper node, until we find a node
- // with the same depth as the shallower node
-
- if (thisDepth > otherDepth) {
- for (int i=0; i<thisDepth - otherDepth; i++)
- thisNode = thisNode.getParentNode();
- // Check if the node we have reached is in fact "otherNode". This can
- // happen in the case of attributes. In this case, otherNode
- // "precedes" this.
- if (thisNode == otherNode)
- return TREE_POSITION_PRECEDING;
- }
-
- else {
- for (int i=0; i<otherDepth - thisDepth; i++)
- otherNode = otherNode.getParentNode();
- // Check if the node we have reached is in fact "thisNode". This can
- // happen in the case of attributes. In this case, otherNode
- // "follows" this.
- if (otherNode == thisNode)
- return TREE_POSITION_FOLLOWING;
- }
-
- // We now have nodes at the same depth in the tree. Find a common
- // ancestor.
- Node thisNodeP, otherNodeP;
- for (thisNodeP=thisNode.getParentNode(),
- otherNodeP=otherNode.getParentNode();
- thisNodeP!=otherNodeP;) {
- thisNode = thisNodeP;
- otherNode = otherNodeP;
- thisNodeP = thisNodeP.getParentNode();
- otherNodeP = otherNodeP.getParentNode();
- }
-
- // At this point, thisNode and otherNode are direct children of
- // the common ancestor.
- // See whether thisNode or otherNode is the leftmost
-
- for (Node current=thisNodeP.getFirstChild();
- current!=null;
- current=current.getNextSibling()) {
- if (current==otherNode) {
- return TREE_POSITION_PRECEDING;
- }
- else if (current==thisNode) {
- return TREE_POSITION_FOLLOWING;
- }
- }
- // REVISIT: shouldn't get here. Should probably throw an
- // exception
- return 0;
-
- }
- /**
- * Compares a node with this node with regard to their position in the
- * document.
- * @param other The node to compare against this node.
- * @return Returns how the given node is positioned relatively to this
- * node.
- * @since DOM Level 3
- */
- public short compareDocumentPosition(Node other) throws DOMException {
-
- // If the nodes are the same, no flags should be set
- if (this==other)
- return 0;
-
- // check if other is from a different implementation
- try {
- NodeImpl node = (NodeImpl) other;
- } catch (ClassCastException e) {
- // other comes from a different implementation
- String msg = DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
- }
-
- Document thisOwnerDoc, otherOwnerDoc;
- // get the respective Document owners.
- if (this.getNodeType() == Node.DOCUMENT_NODE)
- thisOwnerDoc = (Document)this;
- else
- thisOwnerDoc = this.getOwnerDocument();
- if (other.getNodeType() == Node.DOCUMENT_NODE)
- otherOwnerDoc = (Document)other;
- else
- otherOwnerDoc = other.getOwnerDocument();
-
- // If from different documents, we know they are disconnected.
- // and have an implementation dependent order
- if (thisOwnerDoc != otherOwnerDoc &&
- thisOwnerDoc !=null &&
- otherOwnerDoc !=null)
- {
- int otherDocNum = ((CoreDocumentImpl)otherOwnerDoc).getNodeNumber();
- int thisDocNum = ((CoreDocumentImpl)thisOwnerDoc).getNodeNumber();
- if (otherDocNum > thisDocNum)
- return DOCUMENT_POSITION_DISCONNECTED |
- DOCUMENT_POSITION_FOLLOWING |
- DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC;
- else
- return DOCUMENT_POSITION_DISCONNECTED |
- DOCUMENT_POSITION_PRECEDING |
- DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC;
-
- }
-
- // Find the ancestor of each node, and the distance each node is from
- // its ancestor.
- // During this traversal, look for ancestor/descendent relationships
- // between the 2 nodes in question.
- // We do this now, so that we get this info correct for attribute nodes
- // and their children.
-
- Node node;
- Node thisAncestor = this;
- Node otherAncestor = other;
-
- int thisDepth=0;
- int otherDepth=0;
- for (node=this; node != null; node = node.getParentNode()) {
- thisDepth +=1;
- if (node == other)
- // The other node is an ancestor of this one.
- return (DOCUMENT_POSITION_CONTAINS |
- DOCUMENT_POSITION_PRECEDING);
- thisAncestor = node;
- }
-
- for (node=other; node!=null; node=node.getParentNode()) {
- otherDepth +=1;
- if (node == this)
- // The other node is a descendent of the reference node.
- return (DOCUMENT_POSITION_IS_CONTAINED |
- DOCUMENT_POSITION_FOLLOWING);
- otherAncestor = node;
- }
-
-
-
- int thisAncestorType = thisAncestor.getNodeType();
- int otherAncestorType = otherAncestor.getNodeType();
- Node thisNode = this;
- Node otherNode = other;
-
- // Special casing for ENTITY, NOTATION, DOCTYPE and ATTRIBUTES
- // LM: should rewrite this.
- switch (thisAncestorType) {
- case Node.NOTATION_NODE:
- case Node.ENTITY_NODE: {
- DocumentType container = thisOwnerDoc.getDoctype();
- if (container == otherAncestor) return
- (DOCUMENT_POSITION_CONTAINS | DOCUMENT_POSITION_PRECEDING);
- switch (otherAncestorType) {
- case Node.NOTATION_NODE:
- case Node.ENTITY_NODE: {
- if (thisAncestorType != otherAncestorType)
- // the nodes are of different types
- return ((thisAncestorType>otherAncestorType) ?
- DOCUMENT_POSITION_PRECEDING:DOCUMENT_POSITION_FOLLOWING);
- else {
- // the nodes are of the same type. Find order.
- if (thisAncestorType == Node.NOTATION_NODE)
-
- if (((NamedNodeMapImpl)container.getNotations()).precedes(otherAncestor,thisAncestor))
- return (DOCUMENT_POSITION_PRECEDING |
- DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC);
- else
- return (DOCUMENT_POSITION_FOLLOWING |
- DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC);
- else
- if (((NamedNodeMapImpl)container.getEntities()).precedes(otherAncestor,thisAncestor))
- return (DOCUMENT_POSITION_PRECEDING |
- DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC);
- else
- return (DOCUMENT_POSITION_FOLLOWING |
- DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC);
- }
- }
- }
- thisNode = thisAncestor = thisOwnerDoc;
- break;
- }
- case Node.DOCUMENT_TYPE_NODE: {
- if (otherNode == thisOwnerDoc)
- return (DOCUMENT_POSITION_PRECEDING |
- DOCUMENT_POSITION_CONTAINS);
- else if (thisOwnerDoc!=null && thisOwnerDoc==otherOwnerDoc)
- return (DOCUMENT_POSITION_FOLLOWING);
- break;
- }
- case Node.ATTRIBUTE_NODE: {
- thisNode = ((AttrImpl)thisAncestor).getOwnerElement();
- if (otherAncestorType==Node.ATTRIBUTE_NODE) {
- otherNode = ((AttrImpl)otherAncestor).getOwnerElement();
- if (otherNode == thisNode) {
- if (((NamedNodeMapImpl)thisNode.getAttributes()).precedes(other,this))
- return (DOCUMENT_POSITION_PRECEDING |
- DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC);
- else
- return (DOCUMENT_POSITION_FOLLOWING |
- DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC);
- }
- }
-
- // Now, find the ancestor of the element
- thisDepth=0;
- for (node=thisNode; node != null; node=node.getParentNode()) {
- thisDepth +=1;
- if (node == otherNode)
- {
- // The other node is an ancestor of the owning element
- return (DOCUMENT_POSITION_CONTAINS |
- DOCUMENT_POSITION_PRECEDING);
- }
- thisAncestor = node;
- }
- }
- }
- switch (otherAncestorType) {
- case Node.NOTATION_NODE:
- case Node.ENTITY_NODE: {
- DocumentType container = thisOwnerDoc.getDoctype();
- if (container == this) return (DOCUMENT_POSITION_IS_CONTAINED |
- DOCUMENT_POSITION_FOLLOWING);
- otherNode = otherAncestor = thisOwnerDoc;
- break;
- }
- case Node.DOCUMENT_TYPE_NODE: {
- if (thisNode == otherOwnerDoc)
- return (DOCUMENT_POSITION_FOLLOWING |
- DOCUMENT_POSITION_IS_CONTAINED);
- else if (otherOwnerDoc!=null && thisOwnerDoc==otherOwnerDoc)
- return (DOCUMENT_POSITION_PRECEDING);
- break;
- }
- case Node.ATTRIBUTE_NODE: {
- otherDepth=0;
- otherNode = ((AttrImpl)otherAncestor).getOwnerElement();
- for (node=otherNode; node != null; node=node.getParentNode()) {
- otherDepth +=1;
- if (node == thisNode)
- // The other node is a descendent of the reference
- // node's element
- return DOCUMENT_POSITION_FOLLOWING |
- DOCUMENT_POSITION_IS_CONTAINED;
- otherAncestor = node;
- }
-
- }
- }
-
- // thisAncestor and otherAncestor must be the same at this point,
- // otherwise, the original nodes are disconnected
- if (thisAncestor != otherAncestor) {
- int thisAncestorNum, otherAncestorNum;
- thisAncestorNum = ((NodeImpl)thisAncestor).getNodeNumber();
- otherAncestorNum = ((NodeImpl)otherAncestor).getNodeNumber();
-
- if (thisAncestorNum > otherAncestorNum)
- return DOCUMENT_POSITION_DISCONNECTED |
- DOCUMENT_POSITION_FOLLOWING |
- DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC;
- else
- return DOCUMENT_POSITION_DISCONNECTED |
- DOCUMENT_POSITION_PRECEDING |
- DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC;
- }
-
-
- // Go up the parent chain of the deeper node, until we find a node
- // with the same depth as the shallower node
-
- if (thisDepth > otherDepth) {
- for (int i=0; i<thisDepth - otherDepth; i++)
- thisNode = thisNode.getParentNode();
- // Check if the node we have reached is in fact "otherNode". This can
- // happen in the case of attributes. In this case, otherNode
- // "precedes" this.
- if (thisNode == otherNode)
-{
- return DOCUMENT_POSITION_PRECEDING;
- }
- }
-
- else {
- for (int i=0; i<otherDepth - thisDepth; i++)
- otherNode = otherNode.getParentNode();
- // Check if the node we have reached is in fact "thisNode". This can
- // happen in the case of attributes. In this case, otherNode
- // "follows" this.
- if (otherNode == thisNode)
- return DOCUMENT_POSITION_FOLLOWING;
- }
-
- // We now have nodes at the same depth in the tree. Find a common
- // ancestor.
- Node thisNodeP, otherNodeP;
- for (thisNodeP=thisNode.getParentNode(),
- otherNodeP=otherNode.getParentNode();
- thisNodeP!=otherNodeP;) {
- thisNode = thisNodeP;
- otherNode = otherNodeP;
- thisNodeP = thisNodeP.getParentNode();
- otherNodeP = otherNodeP.getParentNode();
- }
-
- // At this point, thisNode and otherNode are direct children of
- // the common ancestor.
- // See whether thisNode or otherNode is the leftmost
-
- for (Node current=thisNodeP.getFirstChild();
- current!=null;
- current=current.getNextSibling()) {
- if (current==otherNode) {
- return DOCUMENT_POSITION_PRECEDING;
- }
- else if (current==thisNode) {
- return DOCUMENT_POSITION_FOLLOWING;
- }
- }
- // REVISIT: shouldn't get here. Should probably throw an
- // exception
- return 0;
-
- }
-
- /**
- * This attribute returns the text content of this node and its
- * descendants. When it is defined to be null, setting it has no effect.
- * When set, any possible children this node may have are removed and
- * replaced by a single <code>Text</code> node containing the string
- * this attribute is set to. On getting, no serialization is performed,
- * the returned string does not contain any markup. No whitespace
- * normalization is performed, the returned string does not contain the
- * element content whitespaces . Similarly, on setting, no parsing is
- * performed either, the input string is taken as pure textual content.
- * <br>The string returned is made of the text content of this node
- * depending on its type, as defined below:
- * <table border='1'>
- * <tr>
- * <th>Node type</th>
- * <th>Content</th>
- * </tr>
-
- /**
- * This attribute returns the text content of this node and its
- * descendants. When it is defined to be null, setting it has no effect.
- * When set, any possible children this node may have are removed and
- * replaced by a single <code>Text</code> node containing the string
- * this attribute is set to. On getting, no serialization is performed,
- * the returned string does not contain any markup. No whitespace
- * normalization is performed, the returned string does not contain the
- * element content whitespaces . Similarly, on setting, no parsing is
- * performed either, the input string is taken as pure textual content.
- * <br>The string returned is made of the text content of this node
- * depending on its type, as defined below:
- * <table border='1'>
- * <tr>
- * <th>Node type</th>
- * <th>Content</th>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>
- * ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE,
- * DOCUMENT_FRAGMENT_NODE</td>
- * <td valign='top' rowspan='1' colspan='1'>concatenation of the <code>textContent</code>
- * attribute value of every child node, excluding COMMENT_NODE and
- * PROCESSING_INSTRUCTION_NODE nodes</td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>ATTRIBUTE_NODE, TEXT_NODE,
- * CDATA_SECTION_NODE, COMMENT_NODE, PROCESSING_INSTRUCTION_NODE</td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <code>nodeValue</code></td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>DOCUMENT_NODE, DOCUMENT_TYPE_NODE, NOTATION_NODE</td>
- * <td valign='top' rowspan='1' colspan='1'>
- * null</td>
- * </tr>
- * </table>
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
- * @exception DOMException
- * DOMSTRING_SIZE_ERR: Raised when it would return more characters than
- * fit in a <code>DOMString</code> variable on the implementation
- * platform.
- * @since DOM Level 3
- */
- public String getTextContent() throws DOMException {
- return getNodeValue(); // overriden in some subclasses
- }
-
- // internal method taking a StringBuffer in parameter
- void getTextContent(StringBuffer buf) throws DOMException {
- String content = getNodeValue();
- if (content != null) {
- buf.append(content);
- }
- }
-
- /**
- * This attribute returns the text content of this node and its
- * descendants. When it is defined to be null, setting it has no effect.
- * When set, any possible children this node may have are removed and
- * replaced by a single <code>Text</code> node containing the string
- * this attribute is set to. On getting, no serialization is performed,
- * the returned string does not contain any markup. No whitespace
- * normalization is performed, the returned string does not contain the
- * element content whitespaces . Similarly, on setting, no parsing is
- * performed either, the input string is taken as pure textual content.
- * <br>The string returned is made of the text content of this node
- * depending on its type, as defined below:
- * <table border='1'>
- * <tr>
- * <th>Node type</th>
- * <th>Content</th>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>
- * ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE,
- * DOCUMENT_FRAGMENT_NODE</td>
- * <td valign='top' rowspan='1' colspan='1'>concatenation of the <code>textContent</code>
- * attribute value of every child node, excluding COMMENT_NODE and
- * PROCESSING_INSTRUCTION_NODE nodes</td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>ATTRIBUTE_NODE, TEXT_NODE,
- * CDATA_SECTION_NODE, COMMENT_NODE, PROCESSING_INSTRUCTION_NODE</td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <code>nodeValue</code></td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>DOCUMENT_NODE, DOCUMENT_TYPE_NODE, NOTATION_NODE</td>
- * <td valign='top' rowspan='1' colspan='1'>
- * null</td>
- * </tr>
- * </table>
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
- * @exception DOMException
- * DOMSTRING_SIZE_ERR: Raised when it would return more characters than
- * fit in a <code>DOMString</code> variable on the implementation
- * platform.
- * @since DOM Level 3
- */
- public void setTextContent(String textContent)
- throws DOMException {
- setNodeValue(textContent);
- }
-
- /**
- * Returns whether this node is the same node as the given one.
- * <br>This method provides a way to determine whether two
- * <code>Node</code> references returned by the implementation reference
- * the same object. When two <code>Node</code> references are references
- * to the same object, even if through a proxy, the references may be
- * used completely interchangably, such that all attributes have the
- * same values and calling the same DOM method on either reference
- * always has exactly the same effect.
- * @param other The node to test against.
- * @return Returns <code>true</code> if the nodes are the same,
- * <code>false</code> otherwise.
- * @since DOM Level 3
- */
- public boolean isSameNode(Node other) {
- // we do not use any wrapper so the answer is obvious
- return this == other;
- }
-
-
-
-
- /**
- * DOM Level 3: Experimental
- * This method checks if the specified <code>namespaceURI</code> is the
- * default namespace or not.
- * @param namespaceURI The namespace URI to look for.
- * @return <code>true</code> if the specified <code>namespaceURI</code>
- * is the default namespace, <code>false</code> otherwise.
- * @since DOM Level 3
- */
- public boolean isDefaultNamespace(String namespaceURI){
- // REVISIT: remove casts when DOM L3 becomes REC.
- short type = this.getNodeType();
- switch (type) {
- case Node.ELEMENT_NODE: {
- String namespace = this.getNamespaceURI();
- String prefix = this.getPrefix();
-
- // REVISIT: is it possible that prefix is empty string?
- if (prefix == null || prefix.length() == 0) {
- if (namespaceURI == null) {
- return (namespace == namespaceURI);
- }
- return namespaceURI.equals(namespace);
- }
- if (this.hasAttributes()) {
- ElementImpl elem = (ElementImpl)this;
- NodeImpl attr = (NodeImpl)elem.getAttributeNodeNS("http://www.w3.org/2000/xmlns/", "xmlns");
- if (attr != null) {
- String value = attr.getNodeValue();
- if (namespaceURI == null) {
- return (namespace == value);
- }
- return namespaceURI.equals(value);
- }
- }
-
- NodeImpl ancestor = (NodeImpl)getElementAncestor(this);
- if (ancestor != null) {
- return ancestor.isDefaultNamespace(namespaceURI);
- }
- return false;
- }
- case Node.DOCUMENT_NODE:{
- return((NodeImpl)((Document)this).getDocumentElement()).isDefaultNamespace(namespaceURI);
- }
-
- case Node.ENTITY_NODE :
- case Node.NOTATION_NODE:
- case Node.DOCUMENT_FRAGMENT_NODE:
- case Node.DOCUMENT_TYPE_NODE:
- // type is unknown
- return false;
- case Node.ATTRIBUTE_NODE:{
- if (this.ownerNode.getNodeType() == Node.ELEMENT_NODE) {
- return ownerNode.isDefaultNamespace(namespaceURI);
-
- }
- return false;
- }
- default:{
- NodeImpl ancestor = (NodeImpl)getElementAncestor(this);
- if (ancestor != null) {
- return ancestor.isDefaultNamespace(namespaceURI);
- }
- return false;
- }
-
- }
-
-
- }
-
-
- /**
- *
- * DOM Level 3 - Experimental:
- * Look up the prefix associated to the given namespace URI, starting from this node.
- *
- * @param namespaceURI
- * @return the prefix for the namespace
- */
- public String lookupPrefix(String namespaceURI){
-
- // REVISIT: When Namespaces 1.1 comes out this may not be true
- // Prefix can't be bound to null namespace
- if (namespaceURI == null) {
- return null;
- }
-
- short type = this.getNodeType();
-
- switch (type) {
- case Node.ELEMENT_NODE: {
-
- String namespace = this.getNamespaceURI(); // to flip out children
- return lookupNamespacePrefix(namespaceURI, (ElementImpl)this);
- }
- case Node.DOCUMENT_NODE:{
- return((NodeImpl)((Document)this).getDocumentElement()).lookupPrefix(namespaceURI);
- }
-
- case Node.ENTITY_NODE :
- case Node.NOTATION_NODE:
- case Node.DOCUMENT_FRAGMENT_NODE:
- case Node.DOCUMENT_TYPE_NODE:
- // type is unknown
- return null;
- case Node.ATTRIBUTE_NODE:{
- if (this.ownerNode.getNodeType() == Node.ELEMENT_NODE) {
- return ownerNode.lookupPrefix(namespaceURI);
-
- }
- return null;
- }
- default:{
- NodeImpl ancestor = (NodeImpl)getElementAncestor(this);
- if (ancestor != null) {
- return ancestor.lookupPrefix(namespaceURI);
- }
- return null;
- }
-
- }
- }
- /**
- * DOM Level 3 - Experimental:
- * Look up the namespace URI associated to the given prefix, starting from this node.
- * Use lookupNamespaceURI(null) to lookup the default namespace
- *
- * @param namespaceURI
- * @return th URI for the namespace
- * @since DOM Level 3
- */
- public String lookupNamespaceURI(String specifiedPrefix) {
- short type = this.getNodeType();
- switch (type) {
- case Node.ELEMENT_NODE : {
-
- String namespace = this.getNamespaceURI();
- String prefix = this.getPrefix();
- if (namespace !=null) {
- // REVISIT: is it possible that prefix is empty string?
- if (specifiedPrefix== null && prefix==specifiedPrefix) {
- // looking for default namespace
- return namespace;
- } else if (prefix != null && prefix.equals(specifiedPrefix)) {
- // non default namespace
- return namespace;
- }
- }
- if (this.hasAttributes()) {
- NamedNodeMap map = this.getAttributes();
- int length = map.getLength();
- for (int i=0;i<length;i++) {
- Node attr = map.item(i);
- String attrPrefix = attr.getPrefix();
- String value = attr.getNodeValue();
- namespace = attr.getNamespaceURI();
- if (namespace !=null && namespace.equals("http://www.w3.org/2000/xmlns/")) {
- // at this point we are dealing with DOM Level 2 nodes only
- if (specifiedPrefix == null &&
- attr.getNodeName().equals("xmlns")) {
- // default namespace
- return value;
- } else if (attrPrefix !=null &&
- attrPrefix.equals("xmlns") &&
- attr.getLocalName().equals(specifiedPrefix)) {
- // non default namespace
- return value;
- }
- }
- }
- }
- NodeImpl ancestor = (NodeImpl)getElementAncestor(this);
- if (ancestor != null) {
- return ancestor.lookupNamespaceURI(specifiedPrefix);
- }
-
- return null;
-
-
- }
- case Node.DOCUMENT_NODE : {
- return((NodeImpl)((Document)this).getDocumentElement()).lookupNamespaceURI(specifiedPrefix);
- }
- case Node.ENTITY_NODE :
- case Node.NOTATION_NODE:
- case Node.DOCUMENT_FRAGMENT_NODE:
- case Node.DOCUMENT_TYPE_NODE:
- // type is unknown
- return null;
- case Node.ATTRIBUTE_NODE:{
- if (this.ownerNode.getNodeType() == Node.ELEMENT_NODE) {
- return ownerNode.lookupNamespaceURI(specifiedPrefix);
-
- }
- return null;
- }
- default:{
- NodeImpl ancestor = (NodeImpl)getElementAncestor(this);
- if (ancestor != null) {
- return ancestor.lookupNamespaceURI(specifiedPrefix);
- }
- return null;
- }
-
- }
- }
-
-
- Node getElementAncestor (Node currentNode){
- Node parent = currentNode.getParentNode();
- if (parent != null) {
- short type = parent.getNodeType();
- if (type == Node.ELEMENT_NODE) {
- return parent;
- }
- return getElementAncestor(parent);
- }
- return null;
- }
-
- String lookupNamespacePrefix(String namespaceURI, ElementImpl el){
- String namespace = this.getNamespaceURI();
- // REVISIT: if no prefix is available is it null or empty string, or
- // could be both?
- String prefix = this.getPrefix();
-
- if (namespace!=null && namespace.equals(namespaceURI)) {
- if (prefix != null) {
- String foundNamespace = el.lookupNamespaceURI(prefix);
- if (foundNamespace !=null && foundNamespace.equals(namespaceURI)) {
- return prefix;
- }
-
- }
- }
- if (this.hasAttributes()) {
- NamedNodeMap map = this.getAttributes();
- int length = map.getLength();
- for (int i=0;i<length;i++) {
- Node attr = map.item(i);
- String attrPrefix = attr.getPrefix();
- String value = attr.getNodeValue();
- namespace = attr.getNamespaceURI();
- if (namespace !=null && namespace.equals("http://www.w3.org/2000/xmlns/")) {
- // DOM Level 2 nodes
- if (((attr.getNodeName().equals("xmlns")) ||
- (attrPrefix !=null && attrPrefix.equals("xmlns")) &&
- value.equals(namespaceURI))) {
-
- String localname= attr.getLocalName();
- String foundNamespace = el.lookupNamespaceURI(localname);
- if (foundNamespace !=null && foundNamespace.equals(namespaceURI)) {
- return localname;
- }
- }
-
-
- }
- }
- }
- NodeImpl ancestor = (NodeImpl)getElementAncestor(this);
-
- if (ancestor != null) {
- return ancestor.lookupNamespacePrefix(namespaceURI, el);
- }
- return null;
- }
-
- /**
- * Tests whether two nodes are equal.
- * <br>This method tests for equality of nodes, not sameness (i.e.,
- * whether the two nodes are references to the same object) which can be
- * tested with <code>Node.isSameNode</code>. All nodes that are the same
- * will also be equal, though the reverse may not be true.
- * <br>Two nodes are equal if and only if the following conditions are
- * satisfied: The two nodes are of the same type.The following string
- * attributes are equal: <code>nodeName</code>, <code>localName</code>,
- * <code>namespaceURI</code>, <code>prefix</code>, <code>nodeValue</code>
- * , <code>baseURI</code>. This is: they are both <code>null</code>, or
- * they have the same length and are character for character identical.
- * The <code>attributes</code> <code>NamedNodeMaps</code> are equal.
- * This is: they are both <code>null</code>, or they have the same
- * length and for each node that exists in one map there is a node that
- * exists in the other map and is equal, although not necessarily at the
- * same index.The <code>childNodes</code> <code>NodeLists</code> are
- * equal. This is: they are both <code>null</code>, or they have the
- * same length and contain equal nodes at the same index. This is true
- * for <code>Attr</code> nodes as for any other type of node. Note that
- * normalization can affect equality; to avoid this, nodes should be
- * normalized before being compared.
- * <br>For two <code>DocumentType</code> nodes to be equal, the following
- * conditions must also be satisfied: The following string attributes
- * are equal: <code>publicId</code>, <code>systemId</code>,
- * <code>internalSubset</code>.The <code>entities</code>
- * <code>NamedNodeMaps</code> are equal.The <code>notations</code>
- * <code>NamedNodeMaps</code> are equal.
- * <br>On the other hand, the following do not affect equality: the
- * <code>ownerDocument</code> attribute, the <code>specified</code>
- * attribute for <code>Attr</code> nodes, the
- * <code>isWhitespaceInElementContent</code> attribute for
- * <code>Text</code> nodes, as well as any user data or event listeners
- * registered on the nodes.
- * @param arg The node to compare equality with.
- * @param deep If <code>true</code>, recursively compare the subtrees; if
- * <code>false</code>, compare only the nodes themselves (and its
- * attributes, if it is an <code>Element</code>).
- * @return If the nodes, and possibly subtrees are equal,
- * <code>true</code> otherwise <code>false</code>.
- * @since DOM Level 3
- */
- public boolean isEqualNode(Node arg) {
- if (arg == this) {
- return true;
- }
- if (arg.getNodeType() != getNodeType()) {
- return false;
- }
- // in theory nodeName can't be null but better be careful
- // who knows what other implementations may be doing?...
- if (getNodeName() == null) {
- if (arg.getNodeName() != null) {
- return false;
- }
- }
- else if (!getNodeName().equals(arg.getNodeName())) {
- return false;
- }
-
- if (getLocalName() == null) {
- if (arg.getLocalName() != null) {
- return false;
- }
- }
- else if (!getLocalName().equals(arg.getLocalName())) {
- return false;
- }
-
- if (getNamespaceURI() == null) {
- if (arg.getNamespaceURI() != null) {
- return false;
- }
- }
- else if (!getNamespaceURI().equals(arg.getNamespaceURI())) {
- return false;
- }
-
- if (getPrefix() == null) {
- if (arg.getPrefix() != null) {
- return false;
- }
- }
- else if (!getPrefix().equals(arg.getPrefix())) {
- return false;
- }
-
- if (getNodeValue() == null) {
- if (arg.getNodeValue() != null) {
- return false;
- }
- }
- else if (!getNodeValue().equals(arg.getNodeValue())) {
- return false;
- }
-
-
- return true;
- }
-
- /**
- * @since DOM Level 3
- */
- public Object getFeature(String feature, String version) {
- // we don't have any alternate node, either this node does the job
- // or we don't have anything that does
- return isSupported(feature, version) ? this : null;
- }
-
- /**
- * Associate an object to a key on this node. The object can later be
- * retrieved from this node by calling <code>getUserData</code> with the
- * same key.
- * @param key The key to associate the object to.
- * @param data The object to associate to the given key, or
- * <code>null</code> to remove any existing association to that key.
- * @param handler The handler to associate to that key, or
- * <code>null</code>.
- * @return Returns the <code>DOMObject</code> previously associated to
- * the given key on this node, or <code>null</code> if there was none.
- * @since DOM Level 3
- */
- public Object setUserData(String key,
- Object data,
- UserDataHandler handler) {
- return ownerDocument().setUserData(this, key, data, handler);
- }
-
- /**
- * Retrieves the object associated to a key on a this node. The object
- * must first have been set to this node by calling
- * <code>setUserData</code> with the same key.
- * @param key The key the object is associated to.
- * @return Returns the <code>DOMObject</code> associated to the given key
- * on this node, or <code>null</code> if there was none.
- * @since DOM Level 3
- */
- public Object getUserData(String key) {
- return ownerDocument().getUserData(this, key);
- }
-
- protected Map<String, ParentNode.UserDataRecord> getUserDataRecord(){
- return ownerDocument().getUserDataRecord(this);
- }
-
- //
- // Public methods
- //
-
- /**
- * NON-DOM: PR-DOM-Level-1-19980818 mentions readonly nodes in conjunction
- * with Entities, but provides no API to support this.
- * <P>
- * Most DOM users should not touch this method. Its anticpated use
- * is during construction of EntityRefernces, where it will be used to
- * lock the contents replicated from Entity so they can't be casually
- * altered. It _could_ be published as a DOM extension, if desired.
- * <P>
- * Note: since we never have any children deep is meaningless here,
- * ParentNode overrides this behavior.
- * @see ParentNode
- *
- * @param readOnly True or false as desired.
- * @param deep If true, children are also toggled. Note that this will
- * not change the state of an EntityReference or its children,
- * which are always read-only.
- */
- public void setReadOnly(boolean readOnly, boolean deep) {
-
- if (needsSyncData()) {
- synchronizeData();
- }
- isReadOnly(readOnly);
-
- } // setReadOnly(boolean,boolean)
-
- /**
- * NON-DOM: Returns true if this node is read-only. This is a
- * shallow check.
- */
- public boolean getReadOnly() {
-
- if (needsSyncData()) {
- synchronizeData();
- }
- return isReadOnly();
-
- } // getReadOnly():boolean
-
- /**
- * NON-DOM: As an alternative to subclassing the DOM, this implementation
- * has been extended with the ability to attach an object to each node.
- * (If you need multiple objects, you can attach a collection such as a
- * List or Map, then attach your application information to that.)
- * <p><b>Important Note:</b> You are responsible for removing references
- * to your data on nodes that are no longer used. Failure to do so will
- * prevent the nodes, your data is attached to, to be garbage collected
- * until the whole document is.
- *
- * @param data the object to store or null to remove any existing reference
- */
- public void setUserData(Object data) {
- ownerDocument().setUserData(this, data);
- }
-
- /**
- * NON-DOM:
- * Returns the user data associated to this node.
- */
- public Object getUserData() {
- return ownerDocument().getUserData(this);
- }
-
- //
- // Protected methods
- //
-
- /**
- * Denotes that this node has changed.
- */
- protected void changed() {
- // we do not actually store this information on every node, we only
- // have a global indicator on the Document. Doing otherwise cost us too
- // much for little gain.
- ownerDocument().changed();
- }
-
- /**
- * Returns the number of changes to this node.
- */
- protected int changes() {
- // we do not actually store this information on every node, we only
- // have a global indicator on the Document. Doing otherwise cost us too
- // much for little gain.
- return ownerDocument().changes();
- }
-
- /**
- * Override this method in subclass to hook in efficient
- * internal data structure.
- */
- protected void synchronizeData() {
- // By default just change the flag to avoid calling this method again
- needsSyncData(false);
- }
-
- /**
- * For non-child nodes, the node which "points" to this node.
- * For example, the owning element for an attribute
- */
- protected Node getContainer() {
- return null;
- }
-
-
- /*
- * Flags setters and getters
- */
-
- final boolean isReadOnly() {
- return (flags & READONLY) != 0;
- }
-
- final void isReadOnly(boolean value) {
- flags = (short) (value ? flags | READONLY : flags & ~READONLY);
- }
-
- final boolean needsSyncData() {
- return (flags & SYNCDATA) != 0;
- }
-
- final void needsSyncData(boolean value) {
- flags = (short) (value ? flags | SYNCDATA : flags & ~SYNCDATA);
- }
-
- final boolean needsSyncChildren() {
- return (flags & SYNCCHILDREN) != 0;
- }
-
- public final void needsSyncChildren(boolean value) {
- flags = (short) (value ? flags | SYNCCHILDREN : flags & ~SYNCCHILDREN);
- }
-
- final boolean isOwned() {
- return (flags & OWNED) != 0;
- }
-
- final void isOwned(boolean value) {
- flags = (short) (value ? flags | OWNED : flags & ~OWNED);
- }
-
- final boolean isFirstChild() {
- return (flags & FIRSTCHILD) != 0;
- }
-
- final void isFirstChild(boolean value) {
- flags = (short) (value ? flags | FIRSTCHILD : flags & ~FIRSTCHILD);
- }
-
- final boolean isSpecified() {
- return (flags & SPECIFIED) != 0;
- }
-
- final void isSpecified(boolean value) {
- flags = (short) (value ? flags | SPECIFIED : flags & ~SPECIFIED);
- }
-
- // inconsistent name to avoid clash with public method on TextImpl
- final boolean internalIsIgnorableWhitespace() {
- return (flags & IGNORABLEWS) != 0;
- }
-
- final void isIgnorableWhitespace(boolean value) {
- flags = (short) (value ? flags | IGNORABLEWS : flags & ~IGNORABLEWS);
- }
-
- final boolean hasStringValue() {
- return (flags & HASSTRING) != 0;
- }
-
- final void hasStringValue(boolean value) {
- flags = (short) (value ? flags | HASSTRING : flags & ~HASSTRING);
- }
-
- final boolean isNormalized() {
- return (flags & NORMALIZED) != 0;
- }
-
- final void isNormalized(boolean value) {
- // See if flag should propagate to parent.
- if (!value && isNormalized() && ownerNode != null) {
- ownerNode.isNormalized(false);
- }
- flags = (short) (value ? flags | NORMALIZED : flags & ~NORMALIZED);
- }
-
- final boolean isIdAttribute() {
- return (flags & ID) != 0;
- }
-
- final void isIdAttribute(boolean value) {
- flags = (short) (value ? flags | ID : flags & ~ID);
- }
-
- //
- // Object methods
- //
-
- /** NON-DOM method for debugging convenience. */
- public String toString() {
- return "["+getNodeName()+": "+getNodeValue()+"]";
- }
-
- //
- // Serialization methods
- //
-
- /** Serialize object. */
- private void writeObject(ObjectOutputStream out) throws IOException {
-
- // synchronize data
- if (needsSyncData()) {
- synchronizeData();
- }
- // write object
- out.defaultWriteObject();
-
- } // writeObject(ObjectOutputStream)
-
-} // class NodeImpl
diff --git a/src/com/sun/org/apache/xerces/internal/dom/NodeIteratorImpl.java b/src/com/sun/org/apache/xerces/internal/dom/NodeIteratorImpl.java
deleted file mode 100644
index 1f17d47..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/NodeIteratorImpl.java
+++ /dev/null
@@ -1,374 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Node;
-import org.w3c.dom.traversal.NodeFilter;
-import org.w3c.dom.traversal.NodeIterator;
-
-
-/** DefaultNodeIterator implements a NodeIterator, which iterates a
- * DOM tree in the expected depth first way.
- *
- * <p>The whatToShow and filter functionality is implemented as expected.
- *
- * <p>This class also has method removeNode to enable iterator "fix-up"
- * on DOM remove. It is expected that the DOM implementation call removeNode
- * right before the actual DOM transformation. If not called by the DOM,
- * the client could call it before doing the removal.
- *
- * @xerces.internal
- *
- */
-public class NodeIteratorImpl implements NodeIterator {
-
- //
- // Data
- //
-
- /** The DocumentImpl which created this iterator, so it can be detached. */
- private DocumentImpl fDocument;
- /** The root. */
- private Node fRoot;
- /** The whatToShow mask. */
- private int fWhatToShow = NodeFilter.SHOW_ALL;
- /** The NodeFilter reference. */
- private NodeFilter fNodeFilter;
- /** If detach is called, the fDetach flag is true, otherwise flase. */
- private boolean fDetach = false;
-
- //
- // Iterator state - current node and direction.
- //
- // Note: The current node and direction are sufficient to implement
- // the desired behaviour of the current pointer being _between_
- // two nodes. The fCurrentNode is actually the last node returned,
- // and the
- // direction is whether the pointer is in front or behind this node.
- // (usually akin to whether the node was returned via nextNode())
- // (eg fForward = true) or previousNode() (eg fForward = false).
- // Note also, if removing a Node, the fCurrentNode
- // can be placed on a Node which would not pass filters.
-
- /** The last Node returned. */
- private Node fCurrentNode;
-
- /** The direction of the iterator on the fCurrentNode.
- * <pre>
- * nextNode() == fForward = true;
- * previousNode() == fForward = false;
- * </pre>
- */
- private boolean fForward = true;
-
- /** When TRUE, the children of entites references are returned in the iterator. */
- private boolean fEntityReferenceExpansion;
-
- //
- // Constructor
- //
-
- /** Public constructor */
- public NodeIteratorImpl( DocumentImpl document,
- Node root,
- int whatToShow,
- NodeFilter nodeFilter,
- boolean entityReferenceExpansion) {
- fDocument = document;
- fRoot = root;
- fCurrentNode = null;
- fWhatToShow = whatToShow;
- fNodeFilter = nodeFilter;
- fEntityReferenceExpansion = entityReferenceExpansion;
- }
-
- public Node getRoot() {
- return fRoot;
- }
-
- // Implementation Note: Note that the iterator looks at whatToShow
- // and filter values at each call, and therefore one _could_ add
- // setters for these values and alter them while iterating!
-
- /** Return the whatToShow value */
- public int getWhatToShow() {
- return fWhatToShow;
- }
-
- /** Return the filter */
- public NodeFilter getFilter() {
- return fNodeFilter;
- }
-
- /** Return whether children entity references are included in the iterator. */
- public boolean getExpandEntityReferences() {
- return fEntityReferenceExpansion;
- }
-
- /** Return the next Node in the Iterator. The node is the next node in
- * depth-first order which also passes the filter, and whatToShow.
- * If there is no next node which passes these criteria, then return null.
- */
- public Node nextNode() {
-
- if( fDetach) {
- throw new DOMException(
- DOMException.INVALID_STATE_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
- }
-
- // if root is null there is no next node.
- if (fRoot == null) return null;
-
- Node nextNode = fCurrentNode;
- boolean accepted = false; // the next node has not been accepted.
-
- accepted_loop:
- while (!accepted) {
-
- // if last direction is not forward, repeat node.
- if (!fForward && nextNode!=null) {
- //System.out.println("nextNode():!fForward:"+fCurrentNode.getNodeName());
- nextNode = fCurrentNode;
- } else {
- // else get the next node via depth-first
- if (!fEntityReferenceExpansion
- && nextNode != null
- && nextNode.getNodeType() == Node.ENTITY_REFERENCE_NODE) {
- nextNode = nextNode(nextNode, false);
- } else {
- nextNode = nextNode(nextNode, true);
- }
- }
-
- fForward = true; //REVIST: should direction be set forward before null check?
-
- // nothing in the list. return null.
- if (nextNode == null) return null;
-
- // does node pass the filters and whatToShow?
- accepted = acceptNode(nextNode);
- if (accepted) {
- // if so, then the node is the current node.
- fCurrentNode = nextNode;
- return fCurrentNode;
- } else
- continue accepted_loop;
-
- } // while (!accepted) {
-
- // no nodes, or no accepted nodes.
- return null;
-
- }
-
- /** Return the previous Node in the Iterator. The node is the next node in
- * _backwards_ depth-first order which also passes the filter, and whatToShow.
- */
- public Node previousNode() {
-
- if( fDetach) {
- throw new DOMException(
- DOMException.INVALID_STATE_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
- }
-
- // if the root is null, or the current node is null, return null.
- if (fRoot == null || fCurrentNode == null) return null;
-
- Node previousNode = fCurrentNode;
- boolean accepted = false;
-
- accepted_loop:
- while (!accepted) {
-
- if (fForward && previousNode != null) {
- //repeat last node.
- previousNode = fCurrentNode;
- } else {
- // get previous node in backwards depth first order.
- previousNode = previousNode(previousNode);
- }
-
- // we are going backwards
- fForward = false;
-
- // if the new previous node is null, we're at head or past the root,
- // so return null.
- if (previousNode == null) return null;
-
- // check if node passes filters and whatToShow.
- accepted = acceptNode(previousNode);
- if (accepted) {
- // if accepted, update the current node, and return it.
- fCurrentNode = previousNode;
- return fCurrentNode;
- } else
- continue accepted_loop;
- }
- // there are no nodes?
- return null;
- }
-
- /** The node is accepted if it passes the whatToShow and the filter. */
- boolean acceptNode(Node node) {
-
- if (fNodeFilter == null) {
- return ( fWhatToShow & (1 << node.getNodeType()-1)) != 0 ;
- } else {
- return ((fWhatToShow & (1 << node.getNodeType()-1)) != 0 )
- && fNodeFilter.acceptNode(node) == NodeFilter.FILTER_ACCEPT;
- }
- }
-
- /** Return node, if matches or any parent if matches. */
- Node matchNodeOrParent(Node node) {
- // Additions and removals in the underlying data structure may occur
- // before any iterations, and in this case the reference_node is null.
- if (fCurrentNode == null) return null;
-
- // check if the removed node is an _ancestor_ of the
- // reference node
- for (Node n = fCurrentNode; n != fRoot; n = n.getParentNode()) {
- if (node == n) return n;
- }
- return null;
- }
-
- /** The method nextNode(Node, boolean) returns the next node
- * from the actual DOM tree.
- *
- * The boolean visitChildren determines whether to visit the children.
- * The result is the nextNode.
- */
- Node nextNode(Node node, boolean visitChildren) {
-
- if (node == null) return fRoot;
-
- Node result;
- // only check children if we visit children.
- if (visitChildren) {
- //if hasChildren, return 1st child.
- if (node.hasChildNodes()) {
- result = node.getFirstChild();
- return result;
- }
- }
-
- if (node == fRoot) { //if Root has no kids
- return null;
- }
-
- // if hasSibling, return sibling
- result = node.getNextSibling();
- if (result != null) return result;
-
-
- // return parent's 1st sibling.
- Node parent = node.getParentNode();
- while (parent != null && parent != fRoot) {
- result = parent.getNextSibling();
- if (result != null) {
- return result;
- } else {
- parent = parent.getParentNode();
- }
-
- } // while (parent != null && parent != fRoot) {
-
- // end of list, return null
- return null;
- }
-
- /** The method previousNode(Node) returns the previous node
- * from the actual DOM tree.
- */
- Node previousNode(Node node) {
-
- Node result;
-
- // if we're at the root, return null.
- if (node == fRoot) return null;
-
- // get sibling
- result = node.getPreviousSibling();
- if (result == null) {
- //if 1st sibling, return parent
- result = node.getParentNode();
- return result;
- }
-
- // if sibling has children, keep getting last child of child.
- if (result.hasChildNodes()
- && !(!fEntityReferenceExpansion
- && result != null
- && result.getNodeType() == Node.ENTITY_REFERENCE_NODE))
-
- {
- while (result.hasChildNodes()) {
- result = result.getLastChild();
- }
- }
-
- return result;
- }
-
- /** Fix-up the iterator on a remove. Called by DOM or otherwise,
- * before an actual DOM remove.
- */
- public void removeNode(Node node) {
-
- // Implementation note: Fix-up means setting the current node properly
- // after a remove.
-
- if (node == null) return;
-
- Node deleted = matchNodeOrParent(node);
-
- if (deleted == null) return;
-
- if (fForward) {
- fCurrentNode = previousNode(deleted);
- } else
- // if (!fForward)
- {
- Node next = nextNode(deleted, false);
- if (next!=null) {
- // normal case: there _are_ nodes following this in the iterator.
- fCurrentNode = next;
- } else {
- // the last node in the iterator is to be removed,
- // so we set the current node to be the previous one.
- fCurrentNode = previousNode(deleted);
- fForward = true;
- }
-
- }
-
- }
-
- public void detach() {
- fDetach = true;
- fDocument.removeNodeIterator(this);
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/dom/NodeListCache.java b/src/com/sun/org/apache/xerces/internal/dom/NodeListCache.java
deleted file mode 100644
index e0923ce..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/NodeListCache.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001,2002,2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-import java.io.Serializable;
-
-/**
- * This class is used, via a pool managed on CoreDocumentImpl, in ParentNode to
- * improve performance of the NodeList accessors, getLength() and item(i).
- *
- * @xerces.internal
- *
- * @author Arnaud Le Hors, IBM
- *
- * @version $Id: NodeListCache.java,v 1.6 2010/07/20 20:25:25 joehw Exp $
- */
-class NodeListCache implements Serializable {
-
- /** Serialization version. */
- private static final long serialVersionUID = -7927529254918631002L;
-
- /** Cached node list length. */
- int fLength = -1;
-
- /** Last requested node index. */
- int fChildIndex = -1;
-
- /** Last requested node. */
- ChildNode fChild;
-
- /** Owner of this cache */
- ParentNode fOwner;
-
- /** Pointer to the next object on the list,
- only meaningful when actully stored in the free list. */
- NodeListCache next;
-
- NodeListCache(ParentNode owner) {
- fOwner = owner;
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/dom/NotationImpl.java b/src/com/sun/org/apache/xerces/internal/dom/NotationImpl.java
deleted file mode 100644
index a8827f4..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/NotationImpl.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-import com.sun.org.apache.xerces.internal.util.URI;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Node;
-import org.w3c.dom.Notation;
-
-/**
- * Notations are how the Document Type Description (DTD) records hints
- * about the format of an XML "unparsed entity" -- in other words,
- * non-XML data bound to this document type, which some applications
- * may wish to consult when manipulating the document. A Notation
- * represents a name-value pair, with its nodeName being set to the
- * declared name of the notation.
- * <P>
- * Notations are also used to formally declare the "targets" of
- * Processing Instructions.
- * <P>
- * Note that the Notation's data is non-DOM information; the DOM only
- * records what and where it is.
- * <P>
- * See the XML 1.0 spec, sections 4.7 and 2.6, for more info.
- * <P>
- * Level 1 of the DOM does not support editing Notation contents.
- *
- * @xerces.internal
- *
- * @since PR-DOM-Level-1-19980818.
- */
-public class NotationImpl
- extends NodeImpl
- implements Notation {
-
- //
- // Constants
- //
-
- /** Serialization version. */
- static final long serialVersionUID = -764632195890658402L;
-
- //
- // Data
- //
-
- /** Notation name. */
- protected String name;
-
- /** Public identifier. */
- protected String publicId;
-
- /** System identifier. */
- protected String systemId;
-
- /** Base URI*/
- protected String baseURI;
-
- //
- // Constructors
- //
-
- /** Factory constructor. */
- public NotationImpl(CoreDocumentImpl ownerDoc, String name) {
- super(ownerDoc);
- this.name = name;
- }
-
- //
- // Node methods
- //
-
- /**
- * A short integer indicating what type of node this is. The named
- * constants for this value are defined in the org.w3c.dom.Node interface.
- */
- public short getNodeType() {
- return Node.NOTATION_NODE;
- }
-
- /**
- * Returns the notation name
- */
- public String getNodeName() {
- if (needsSyncData()) {
- synchronizeData();
- }
- return name;
- }
-
- //
- // Notation methods
- //
-
- /**
- * The Public Identifier for this Notation. If no public identifier
- * was specified, this will be null.
- */
- public String getPublicId() {
-
- if (needsSyncData()) {
- synchronizeData();
- }
- return publicId;
-
- } // getPublicId():String
-
- /**
- * The System Identifier for this Notation. If no system identifier
- * was specified, this will be null.
- */
- public String getSystemId() {
-
- if (needsSyncData()) {
- synchronizeData();
- }
- return systemId;
-
- } // getSystemId():String
-
- //
- // Public methods
- //
-
- /**
- * NON-DOM: The Public Identifier for this Notation. If no public
- * identifier was specified, this will be null.
- */
- public void setPublicId(String id) {
-
- if (isReadOnly()) {
- throw new DOMException(
- DOMException.NO_MODIFICATION_ALLOWED_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null));
- }
- if (needsSyncData()) {
- synchronizeData();
- }
- publicId = id;
-
- } // setPublicId(String)
-
- /**
- * NON-DOM: The System Identifier for this Notation. If no system
- * identifier was specified, this will be null.
- */
- public void setSystemId(String id) {
-
- if(isReadOnly()) {
- throw new DOMException(
- DOMException.NO_MODIFICATION_ALLOWED_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null));
- }
- if (needsSyncData()) {
- synchronizeData();
- }
- systemId = id;
-
- } // setSystemId(String)
-
-
- /**
- * Returns the absolute base URI of this node or null if the implementation
- * wasn't able to obtain an absolute URI. Note: If the URI is malformed, a
- * null is returned.
- *
- * @return The absolute base URI of this node or null.
- * @since DOM Level 3
- */
- public String getBaseURI() {
- if (needsSyncData()) {
- synchronizeData();
- }
- if (baseURI != null && baseURI.length() != 0 ) {// attribute value is always empty string
- try {
- return new URI(baseURI).toString();
- }
- catch (com.sun.org.apache.xerces.internal.util.URI.MalformedURIException e){
- // REVISIT: what should happen in this case?
- return null;
- }
- }
- return baseURI;
- }
-
- /** NON-DOM: set base uri*/
- public void setBaseURI(String uri){
- if (needsSyncData()) {
- synchronizeData();
- }
- baseURI = uri;
- }
-
-} // class NotationImpl
diff --git a/src/com/sun/org/apache/xerces/internal/dom/PSVIAttrNSImpl.java b/src/com/sun/org/apache/xerces/internal/dom/PSVIAttrNSImpl.java
deleted file mode 100644
index cefe92d..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/PSVIAttrNSImpl.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2002-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-import java.io.IOException;
-import java.io.NotSerializableException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-
-import com.sun.org.apache.xerces.internal.xs.AttributePSVI;
-import com.sun.org.apache.xerces.internal.xs.*;
-
-/**
- * Attribute namespace implementation; stores PSVI attribute items.
- *
- * @xerces.internal
- *
- * @author Sandy Gao, IBM
- *
- */
-public class PSVIAttrNSImpl extends AttrNSImpl implements AttributePSVI {
-
- /** Serialization version. */
- static final long serialVersionUID = -3241738699421018889L;
-
- /**
- * Construct an attribute node.
- */
- public PSVIAttrNSImpl(CoreDocumentImpl ownerDocument, String namespaceURI,
- String qualifiedName, String localName) {
- super(ownerDocument, namespaceURI, qualifiedName, localName);
- }
-
- /**
- * Construct an attribute node.
- */
- public PSVIAttrNSImpl(CoreDocumentImpl ownerDocument, String namespaceURI,
- String qualifiedName) {
- super(ownerDocument, namespaceURI, qualifiedName);
- }
-
- /** attribute declaration */
- protected XSAttributeDeclaration fDeclaration = null;
-
- /** type of attribute, simpleType */
- protected XSTypeDefinition fTypeDecl = null;
-
- /** If this attribute was explicitly given a
- * value in the original document, this is true; otherwise, it is false */
- protected boolean fSpecified = true;
-
- /** schema normalized value property */
- protected String fNormalizedValue = null;
-
- /** schema actual value */
- protected Object fActualValue = null;
-
- /** schema actual value type */
- protected short fActualValueType = XSConstants.UNAVAILABLE_DT;
-
- /** actual value types if the value is a list */
- protected ShortList fItemValueTypes = null;
-
- /** member type definition against which attribute was validated */
- protected XSSimpleTypeDefinition fMemberType = null;
-
- /** validation attempted: none, partial, full */
- protected short fValidationAttempted = AttributePSVI.VALIDATION_NONE;
-
- /** validity: valid, invalid, unknown */
- protected short fValidity = AttributePSVI.VALIDITY_NOTKNOWN;
-
- /** error codes */
- protected StringList fErrorCodes = null;
-
- /** validation context: could be QName or XPath expression*/
- protected String fValidationContext = null;
-
- //
- // AttributePSVI methods
- //
-
- /**
- * [schema default]
- *
- * @return The canonical lexical representation of the declaration's {value constraint} value.
- * @see <a href="http://www.w3.org/TR/xmlschema-1/#e-schema_default>XML Schema Part 1: Structures [schema default]</a>
- */
- public String getSchemaDefault() {
- return fDeclaration == null ? null : fDeclaration.getConstraintValue();
- }
-
- /**
- * [schema normalized value]
- *
- *
- * @see <a href="http://www.w3.org/TR/xmlschema-1/#e-schema_normalized_value>XML Schema Part 1: Structures [schema normalized value]</a>
- * @return the normalized value of this item after validation
- */
- public String getSchemaNormalizedValue() {
- return fNormalizedValue;
- }
-
- /**
- * [schema specified]
- * @see <a href="http://www.w3.org/TR/xmlschema-1/#e-schema_specified">XML Schema Part 1: Structures [schema specified]</a>
- * @return false value was specified in schema, true value comes from the infoset
- */
- public boolean getIsSchemaSpecified() {
- return fSpecified;
- }
-
-
- /**
- * Determines the extent to which the document has been validated
- *
- * @return return the [validation attempted] property. The possible values are
- * NO_VALIDATION, PARTIAL_VALIDATION and FULL_VALIDATION
- */
- public short getValidationAttempted() {
- return fValidationAttempted;
- }
-
- /**
- * Determine the validity of the node with respect
- * to the validation being attempted
- *
- * @return return the [validity] property. Possible values are:
- * UNKNOWN_VALIDITY, INVALID_VALIDITY, VALID_VALIDITY
- */
- public short getValidity() {
- return fValidity;
- }
-
- /**
- * A list of error codes generated from validation attempts.
- * Need to find all the possible subclause reports that need reporting
- *
- * @return list of error codes
- */
- public StringList getErrorCodes() {
- return fErrorCodes;
- }
-
- // This is the only information we can provide in a pipeline.
- public String getValidationContext() {
- return fValidationContext;
- }
-
- /**
- * An item isomorphic to the type definition used to validate this element.
- *
- * @return a type declaration
- */
- public XSTypeDefinition getTypeDefinition() {
- return fTypeDecl;
- }
-
- /**
- * If and only if that type definition is a simple type definition
- * with {variety} union, or a complex type definition whose {content type}
- * is a simple thype definition with {variety} union, then an item isomorphic
- * to that member of the union's {member type definitions} which actually
- * validated the element item's normalized value.
- *
- * @return a simple type declaration
- */
- public XSSimpleTypeDefinition getMemberTypeDefinition() {
- return fMemberType;
- }
-
- /**
- * An item isomorphic to the attribute declaration used to validate
- * this attribute.
- *
- * @return an attribute declaration
- */
- public XSAttributeDeclaration getAttributeDeclaration() {
- return fDeclaration;
- }
-
- /**
- * Copy PSVI properties from another psvi item.
- *
- * @param attr the source of attribute PSVI items
- */
- public void setPSVI(AttributePSVI attr) {
- this.fDeclaration = attr.getAttributeDeclaration();
- this.fValidationContext = attr.getValidationContext();
- this.fValidity = attr.getValidity();
- this.fValidationAttempted = attr.getValidationAttempted();
- this.fErrorCodes = attr.getErrorCodes();
- this.fNormalizedValue = attr.getSchemaNormalizedValue();
- this.fActualValue = attr.getActualNormalizedValue();
- this.fActualValueType = attr.getActualNormalizedValueType();
- this.fItemValueTypes = attr.getItemValueTypes();
- this.fTypeDecl = attr.getTypeDefinition();
- this.fMemberType = attr.getMemberTypeDefinition();
- this.fSpecified = attr.getIsSchemaSpecified();
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xs.ItemPSVI#getActualNormalizedValue()
- */
- public Object getActualNormalizedValue() {
- return this.fActualValue;
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xs.ItemPSVI#getActualNormalizedValueType()
- */
- public short getActualNormalizedValueType() {
- return this.fActualValueType;
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xs.ItemPSVI#getItemValueTypes()
- */
- public ShortList getItemValueTypes() {
- return this.fItemValueTypes;
- }
-
- // REVISIT: Forbid serialization of PSVI DOM until
- // we support object serialization of grammars -- mrglavas
-
- private void writeObject(ObjectOutputStream out)
- throws IOException {
- throw new NotSerializableException(getClass().getName());
- }
-
- private void readObject(ObjectInputStream in)
- throws IOException, ClassNotFoundException {
- throw new NotSerializableException(getClass().getName());
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/dom/PSVIDOMImplementationImpl.java b/src/com/sun/org/apache/xerces/internal/dom/PSVIDOMImplementationImpl.java
deleted file mode 100644
index 07271f1..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/PSVIDOMImplementationImpl.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-import org.w3c.dom.DOMException;
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-
-/**
- * The DOMImplementation class is description of a particular
- * implementation of the Document Object Model. As such its data is
- * static, shared by all instances of this implementation.
- * <P>
- * The DOM API requires that it be a real object rather than static
- * methods. However, there's nothing that says it can't be a singleton,
- * so that's how I've implemented it.
- *
- * @xerces.internal
- *
- * @since PR-DOM-Level-1-19980818.
- */
-public class PSVIDOMImplementationImpl extends CoreDOMImplementationImpl {
-
- //
- // Data
- //
-
- // static
-
- /** Dom implementation singleton. */
- static PSVIDOMImplementationImpl singleton = new PSVIDOMImplementationImpl();
-
- //
- // Public methods
- //
-
- /** NON-DOM: Obtain and return the single shared object */
- public static DOMImplementation getDOMImplementation() {
- return singleton;
- }
-
- //
- // DOMImplementation methods
- //
-
- /**
- * Test if the DOM implementation supports a specific "feature" --
- * currently meaning language and level thereof.
- *
- * @param feature The package name of the feature to test.
- * In Level 1, supported values are "HTML" and "XML" (case-insensitive).
- * At this writing, com.sun.org.apache.xerces.internal.dom supports only XML.
- *
- * @param version The version number of the feature being tested.
- * This is interpreted as "Version of the DOM API supported for the
- * specified Feature", and in Level 1 should be "1.0"
- *
- * @return true iff this implementation is compatable with the specified
- * feature and version.
- */
- public boolean hasFeature(String feature, String version) {
- return super.hasFeature(feature, version) ||
- feature.equalsIgnoreCase("psvi");
- } // hasFeature(String,String):boolean
-
- /**
- * Introduced in DOM Level 2. <p>
- *
- * Creates an XML Document object of the specified type with its document
- * element.
- *
- * @param namespaceURI The namespace URI of the document
- * element to create, or null.
- * @param qualifiedName The qualified name of the document
- * element to create.
- * @param doctype The type of document to be created or null.<p>
- *
- * When doctype is not null, its
- * Node.ownerDocument attribute is set to
- * the document being created.
- * @return Document A new Document object.
- * @throws DOMException WRONG_DOCUMENT_ERR: Raised if doctype has
- * already been used with a different document.
- * @since WD-DOM-Level-2-19990923
- */
- public Document createDocument(String namespaceURI,
- String qualifiedName,
- DocumentType doctype)
- throws DOMException
- {
- if (doctype != null && doctype.getOwnerDocument() != null) {
- throw new DOMException(DOMException.WRONG_DOCUMENT_ERR,
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.XML_DOMAIN,
- "WRONG_DOCUMENT_ERR", null));
- }
- DocumentImpl doc = new PSVIDocumentImpl(doctype);
- Element e = doc.createElementNS( namespaceURI, qualifiedName);
- doc.appendChild(e);
- return doc;
- }
-
-
-} // class DOMImplementationImpl
diff --git a/src/com/sun/org/apache/xerces/internal/dom/PSVIDocumentImpl.java b/src/com/sun/org/apache/xerces/internal/dom/PSVIDocumentImpl.java
deleted file mode 100644
index 61d4bf9..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/PSVIDocumentImpl.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2002-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-import java.io.IOException;
-import java.io.NotSerializableException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import org.w3c.dom.DOMConfiguration;
-import org.w3c.dom.UserDataHandler;
-import org.w3c.dom.*;
-
-/**
- * Our own document implementation, which knows how to create an element
- * with PSVI information.
- *
- * @xerces.internal
- *
- * @author Sandy Gao, IBM
- *
- */
-public class PSVIDocumentImpl extends DocumentImpl {
-
- /** Serialization version. */
- static final long serialVersionUID = -8822220250676434522L;
-
- /**
- * Create a document.
- */
- public PSVIDocumentImpl() {
- super();
- }
-
- /**
- * For DOM2 support.
- * The createDocument factory method is in DOMImplementation.
- */
- public PSVIDocumentImpl(DocumentType doctype) {
- super(doctype);
- }
-
- /**
- * Deep-clone a document, including fixing ownerDoc for the cloned
- * children. Note that this requires bypassing the WRONG_DOCUMENT_ERR
- * protection. I've chosen to implement it by calling importNode
- * which is DOM Level 2.
- *
- * @return org.w3c.dom.Node
- * @param deep boolean, iff true replicate children
- */
- public Node cloneNode(boolean deep) {
-
- PSVIDocumentImpl newdoc = new PSVIDocumentImpl();
- callUserDataHandlers(this, newdoc, UserDataHandler.NODE_CLONED);
- cloneNode(newdoc, deep);
-
- // experimental
- newdoc.mutationEvents = mutationEvents;
-
- return newdoc;
-
- } // cloneNode(boolean):Node
-
- /**
- * Retrieve information describing the abilities of this particular
- * DOM implementation. Intended to support applications that may be
- * using DOMs retrieved from several different sources, potentially
- * with different underlying representations.
- */
- public DOMImplementation getImplementation() {
- // Currently implemented as a singleton, since it's hardcoded
- // information anyway.
- return PSVIDOMImplementationImpl.getDOMImplementation();
- }
-
- /**
- * Create an element with PSVI information
- */
- public Element createElementNS(String namespaceURI, String qualifiedName)
- throws DOMException {
- return new PSVIElementNSImpl(this, namespaceURI, qualifiedName);
- }
-
- /**
- * Create an element with PSVI information
- */
- public Element createElementNS(String namespaceURI, String qualifiedName,
- String localpart) throws DOMException {
- return new PSVIElementNSImpl(this, namespaceURI, qualifiedName, localpart);
- }
-
- /**
- * Create an attribute with PSVI information
- */
- public Attr createAttributeNS(String namespaceURI, String qualifiedName)
- throws DOMException {
- return new PSVIAttrNSImpl(this, namespaceURI, qualifiedName);
- }
-
- /**
- * Create an attribute with PSVI information
- */
- public Attr createAttributeNS(String namespaceURI, String qualifiedName,
- String localName) throws DOMException {
- return new PSVIAttrNSImpl(this, namespaceURI, qualifiedName, localName);
- }
-
- /**
- *
- * The configuration used when <code>Document.normalizeDocument</code> is
- * invoked.
- * @since DOM Level 3
- */
- public DOMConfiguration getDomConfig(){
- super.getDomConfig();
- return fConfiguration;
- }
-
- // REVISIT: Forbid serialization of PSVI DOM until
- // we support object serialization of grammars -- mrglavas
-
- private void writeObject(ObjectOutputStream out)
- throws IOException {
- throw new NotSerializableException(getClass().getName());
- }
-
- private void readObject(ObjectInputStream in)
- throws IOException, ClassNotFoundException {
- throw new NotSerializableException(getClass().getName());
- }
-
-} // class PSVIDocumentImpl
diff --git a/src/com/sun/org/apache/xerces/internal/dom/PSVIElementNSImpl.java b/src/com/sun/org/apache/xerces/internal/dom/PSVIElementNSImpl.java
deleted file mode 100644
index 7b26a9a..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/PSVIElementNSImpl.java
+++ /dev/null
@@ -1,296 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2002-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-import java.io.IOException;
-import java.io.NotSerializableException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-
-import com.sun.org.apache.xerces.internal.xs.ElementPSVI;
-import com.sun.org.apache.xerces.internal.xs.*;
-
-/**
- * Element namespace implementation; stores PSVI element items.
- *
- * @xerces.internal
- *
- * @author Sandy Gao, IBM
- *
- * @version $Id: PSVIElementNSImpl.java,v 1.6 2010/08/20 18:51:54 joehw Exp $
- */
-public class PSVIElementNSImpl extends ElementNSImpl implements ElementPSVI {
-
- /** Serialization version. */
- static final long serialVersionUID = 6815489624636016068L;
-
- /**
- * Construct an element node.
- */
- public PSVIElementNSImpl(CoreDocumentImpl ownerDocument, String namespaceURI,
- String qualifiedName, String localName) {
- super(ownerDocument, namespaceURI, qualifiedName, localName);
- }
-
- /**
- * Construct an element node.
- */
- public PSVIElementNSImpl(CoreDocumentImpl ownerDocument, String namespaceURI,
- String qualifiedName) {
- super(ownerDocument, namespaceURI, qualifiedName);
- }
-
- /** element declaration */
- protected XSElementDeclaration fDeclaration = null;
-
- /** type of element, could be xsi:type */
- protected XSTypeDefinition fTypeDecl = null;
-
- /** true if clause 3.2 of Element Locally Valid (Element) (3.3.4)
- * is satisfied, otherwise false
- */
- protected boolean fNil = false;
-
- /** false if the element value was provided by the schema; true otherwise.
- */
- protected boolean fSpecified = true;
-
- /** schema normalized value property */
- protected String fNormalizedValue = null;
-
- /** schema actual value */
- protected Object fActualValue = null;
-
- /** schema actual value type */
- protected short fActualValueType = XSConstants.UNAVAILABLE_DT;
-
- /** actual value types if the value is a list */
- protected ShortList fItemValueTypes = null;
-
- /** http://www.w3.org/TR/xmlschema-1/#e-notation*/
- protected XSNotationDeclaration fNotation = null;
-
- /** member type definition against which element was validated */
- protected XSSimpleTypeDefinition fMemberType = null;
-
- /** validation attempted: none, partial, full */
- protected short fValidationAttempted = ElementPSVI.VALIDATION_NONE;
-
- /** validity: valid, invalid, unknown */
- protected short fValidity = ElementPSVI.VALIDITY_NOTKNOWN;
-
- /** error codes */
- protected StringList fErrorCodes = null;
-
- /** validation context: could be QName or XPath expression*/
- protected String fValidationContext = null;
-
- /** the schema information property */
- protected XSModel fSchemaInformation = null;
-
- //
- // ElementPSVI methods
- //
-
- /**
- * [schema default]
- *
- * @return The canonical lexical representation of the declaration's {value constraint} value.
- * @see <a href="http://www.w3.org/TR/xmlschema-1/#e-schema_default>XML Schema Part 1: Structures [schema default]</a>
- */
- public String getSchemaDefault() {
- return fDeclaration == null ? null : fDeclaration.getConstraintValue();
- }
-
- /**
- * [schema normalized value]
- *
- *
- * @see <a href="http://www.w3.org/TR/xmlschema-1/#e-schema_normalized_value>XML Schema Part 1: Structures [schema normalized value]</a>
- * @return the normalized value of this item after validation
- */
- public String getSchemaNormalizedValue() {
- return fNormalizedValue;
- }
-
- /**
- * [schema specified]
- * @see <a href="http://www.w3.org/TR/xmlschema-1/#e-schema_specified">XML Schema Part 1: Structures [schema specified]</a>
- * @return false value was specified in schema, true value comes from the infoset
- */
- public boolean getIsSchemaSpecified() {
- return fSpecified;
- }
-
- /**
- * Determines the extent to which the document has been validated
- *
- * @return return the [validation attempted] property. The possible values are
- * NO_VALIDATION, PARTIAL_VALIDATION and FULL_VALIDATION
- */
- public short getValidationAttempted() {
- return fValidationAttempted;
- }
-
- /**
- * Determine the validity of the node with respect
- * to the validation being attempted
- *
- * @return return the [validity] property. Possible values are:
- * UNKNOWN_VALIDITY, INVALID_VALIDITY, VALID_VALIDITY
- */
- public short getValidity() {
- return fValidity;
- }
-
- /**
- * A list of error codes generated from validation attempts.
- * Need to find all the possible subclause reports that need reporting
- *
- * @return Array of error codes
- */
- public StringList getErrorCodes() {
- return fErrorCodes;
- }
-
-
- // This is the only information we can provide in a pipeline.
- public String getValidationContext() {
- return fValidationContext;
- }
-
- /**
- * [nil]
- * @see <a href="http://www.w3.org/TR/xmlschema-1/#e-nil>XML Schema Part 1: Structures [nil]</a>
- * @return true if clause 3.2 of Element Locally Valid (Element) (3.3.4) above is satisfied, otherwise false
- */
- public boolean getNil() {
- return fNil;
- }
-
- /**
- * [notation]
- * @see <a href="http://www.w3.org/TR/xmlschema-1/#e-notation>XML Schema Part 1: Structures [notation]</a>
- * @return The notation declaration.
- */
- public XSNotationDeclaration getNotation() {
- return fNotation;
- }
-
- /**
- * An item isomorphic to the type definition used to validate this element.
- *
- * @return a type declaration
- */
- public XSTypeDefinition getTypeDefinition() {
- return fTypeDecl;
- }
-
- /**
- * If and only if that type definition is a simple type definition
- * with {variety} union, or a complex type definition whose {content type}
- * is a simple thype definition with {variety} union, then an item isomorphic
- * to that member of the union's {member type definitions} which actually
- * validated the element item's normalized value.
- *
- * @return a simple type declaration
- */
- public XSSimpleTypeDefinition getMemberTypeDefinition() {
- return fMemberType;
- }
-
- /**
- * An item isomorphic to the element declaration used to validate
- * this element.
- *
- * @return an element declaration
- */
- public XSElementDeclaration getElementDeclaration() {
- return fDeclaration;
- }
-
- /**
- * [schema information]
- * @see <a href="http://www.w3.org/TR/xmlschema-1/#e-schema_information">XML Schema Part 1: Structures [schema information]</a>
- * @return The schema information property if it's the validation root,
- * null otherwise.
- */
- public XSModel getSchemaInformation() {
- return fSchemaInformation;
- }
-
- /**
- * Copy PSVI properties from another psvi item.
- *
- * @param attr the source of attribute PSVI items
- */
- public void setPSVI(ElementPSVI elem) {
- this.fDeclaration = elem.getElementDeclaration();
- this.fNotation = elem.getNotation();
- this.fValidationContext = elem.getValidationContext();
- this.fTypeDecl = elem.getTypeDefinition();
- this.fSchemaInformation = elem.getSchemaInformation();
- this.fValidity = elem.getValidity();
- this.fValidationAttempted = elem.getValidationAttempted();
- this.fErrorCodes = elem.getErrorCodes();
- this.fNormalizedValue = elem.getSchemaNormalizedValue();
- this.fActualValue = elem.getActualNormalizedValue();
- this.fActualValueType = elem.getActualNormalizedValueType();
- this.fItemValueTypes = elem.getItemValueTypes();
- this.fMemberType = elem.getMemberTypeDefinition();
- this.fSpecified = elem.getIsSchemaSpecified();
- this.fNil = elem.getNil();
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xs.ItemPSVI#getActualNormalizedValue()
- */
- public Object getActualNormalizedValue() {
- return this.fActualValue;
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xs.ItemPSVI#getActualNormalizedValueType()
- */
- public short getActualNormalizedValueType() {
- return this.fActualValueType;
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xs.ItemPSVI#getItemValueTypes()
- */
- public ShortList getItemValueTypes() {
- return this.fItemValueTypes;
- }
-
- // REVISIT: Forbid serialization of PSVI DOM until
- // we support object serialization of grammars -- mrglavas
-
- private void writeObject(ObjectOutputStream out)
- throws IOException {
- throw new NotSerializableException(getClass().getName());
- }
-
- private void readObject(ObjectInputStream in)
- throws IOException, ClassNotFoundException {
- throw new NotSerializableException(getClass().getName());
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/dom/ParentNode.java b/src/com/sun/org/apache/xerces/internal/dom/ParentNode.java
deleted file mode 100644
index 2e1997e..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/ParentNode.java
+++ /dev/null
@@ -1,1037 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.UserDataHandler;
-
-/**
- * ParentNode inherits from ChildNode and adds the capability of having child
- * nodes. Not every node in the DOM can have children, so only nodes that can
- * should inherit from this class and pay the price for it.
- * <P>
- * ParentNode, just like NodeImpl, also implements NodeList, so it can
- * return itself in response to the getChildNodes() query. This eliminiates
- * the need for a separate ChildNodeList object. Note that this is an
- * IMPLEMENTATION DETAIL; applications should _never_ assume that
- * this identity exists. On the other hand, subclasses may need to override
- * this, in case of conflicting names. This is the case for the classes
- * HTMLSelectElementImpl and HTMLFormElementImpl of the HTML DOM.
- * <P>
- * While we have a direct reference to the first child, the last child is
- * stored as the previous sibling of the first child. First child nodes are
- * marked as being so, and getNextSibling hides this fact.
- * <P>Note: Not all parent nodes actually need to also be a child. At some
- * point we used to have ParentNode inheriting from NodeImpl and another class
- * called ChildAndParentNode that inherited from ChildNode. But due to the lack
- * of multiple inheritance a lot of code had to be duplicated which led to a
- * maintenance nightmare. At the same time only a few nodes (Document,
- * DocumentFragment, Entity, and Attribute) cannot be a child so the gain in
- * memory wasn't really worth it. The only type for which this would be the
- * case is Attribute, but we deal with there in another special way, so this is
- * not applicable.
- * <p>
- * This class doesn't directly support mutation events, however, it notifies
- * the document when mutations are performed so that the document class do so.
- *
- * <p><b>WARNING</b>: Some of the code here is partially duplicated in
- * AttrImpl, be careful to keep these two classes in sync!
- *
- * @xerces.internal
- *
- * @author Arnaud Le Hors, IBM
- * @author Joe Kesselman, IBM
- * @author Andy Clark, IBM
- * @version $Id: ParentNode.java,v 1.6 2009/07/21 20:30:28 joehw Exp $
- */
-public abstract class ParentNode
- extends ChildNode {
-
- /** Serialization version. */
- static final long serialVersionUID = 2815829867152120872L;
-
- /** Owner document. */
- protected CoreDocumentImpl ownerDocument;
-
- /** First child. */
- protected ChildNode firstChild = null;
-
- // transients
-
- /** NodeList cache */
- protected transient NodeListCache fNodeListCache = null;
-
- //
- // Constructors
- //
-
- /**
- * No public constructor; only subclasses of ParentNode should be
- * instantiated, and those normally via a Document's factory methods
- */
- protected ParentNode(CoreDocumentImpl ownerDocument) {
- super(ownerDocument);
- this.ownerDocument = ownerDocument;
- }
-
- /** Constructor for serialization. */
- public ParentNode() {}
-
- //
- // NodeList methods
- //
-
- /**
- * Returns a duplicate of a given node. You can consider this a
- * generic "copy constructor" for nodes. The newly returned object should
- * be completely independent of the source object's subtree, so changes
- * in one after the clone has been made will not affect the other.
- * <p>
- * Example: Cloning a Text node will copy both the node and the text it
- * contains.
- * <p>
- * Example: Cloning something that has children -- Element or Attr, for
- * example -- will _not_ clone those children unless a "deep clone"
- * has been requested. A shallow clone of an Attr node will yield an
- * empty Attr of the same name.
- * <p>
- * NOTE: Clones will always be read/write, even if the node being cloned
- * is read-only, to permit applications using only the DOM API to obtain
- * editable copies of locked portions of the tree.
- */
- public Node cloneNode(boolean deep) {
-
- if (needsSyncChildren()) {
- synchronizeChildren();
- }
- ParentNode newnode = (ParentNode) super.cloneNode(deep);
-
- // set owner document
- newnode.ownerDocument = ownerDocument;
-
- // Need to break the association w/ original kids
- newnode.firstChild = null;
-
- // invalidate cache for children NodeList
- newnode.fNodeListCache = null;
-
- // Then, if deep, clone the kids too.
- if (deep) {
- for (ChildNode child = firstChild;
- child != null;
- child = child.nextSibling) {
- newnode.appendChild(child.cloneNode(true));
- }
- }
-
- return newnode;
-
- } // cloneNode(boolean):Node
-
- /**
- * Find the Document that this Node belongs to (the document in
- * whose context the Node was created). The Node may or may not
- * currently be part of that Document's actual contents.
- */
- public Document getOwnerDocument() {
- return ownerDocument;
- }
-
- /**
- * same as above but returns internal type and this one is not overridden
- * by CoreDocumentImpl to return null
- */
- CoreDocumentImpl ownerDocument() {
- return ownerDocument;
- }
-
- /**
- * NON-DOM
- * set the ownerDocument of this node and its children
- */
- void setOwnerDocument(CoreDocumentImpl doc) {
- if (needsSyncChildren()) {
- synchronizeChildren();
- }
- for (ChildNode child = firstChild;
- child != null; child = child.nextSibling) {
- child.setOwnerDocument(doc);
- }
- /* setting the owner document of self, after it's children makes the
- data of children available to the new document. */
- super.setOwnerDocument(doc);
- ownerDocument = doc;
- }
-
- /**
- * Test whether this node has any children. Convenience shorthand
- * for (Node.getFirstChild()!=null)
- */
- public boolean hasChildNodes() {
- if (needsSyncChildren()) {
- synchronizeChildren();
- }
- return firstChild != null;
- }
-
- /**
- * Obtain a NodeList enumerating all children of this node. If there
- * are none, an (initially) empty NodeList is returned.
- * <p>
- * NodeLists are "live"; as children are added/removed the NodeList
- * will immediately reflect those changes. Also, the NodeList refers
- * to the actual nodes, so changes to those nodes made via the DOM tree
- * will be reflected in the NodeList and vice versa.
- * <p>
- * In this implementation, Nodes implement the NodeList interface and
- * provide their own getChildNodes() support. Other DOMs may solve this
- * differently.
- */
- public NodeList getChildNodes() {
-
- if (needsSyncChildren()) {
- synchronizeChildren();
- }
- return this;
-
- } // getChildNodes():NodeList
-
- /** The first child of this Node, or null if none. */
- public Node getFirstChild() {
-
- if (needsSyncChildren()) {
- synchronizeChildren();
- }
- return firstChild;
-
- } // getFirstChild():Node
-
- /** The last child of this Node, or null if none. */
- public Node getLastChild() {
-
- if (needsSyncChildren()) {
- synchronizeChildren();
- }
- return lastChild();
-
- } // getLastChild():Node
-
- final ChildNode lastChild() {
- // last child is stored as the previous sibling of first child
- return firstChild != null ? firstChild.previousSibling : null;
- }
-
- final void lastChild(ChildNode node) {
- // store lastChild as previous sibling of first child
- if (firstChild != null) {
- firstChild.previousSibling = node;
- }
- }
-
- /**
- * Move one or more node(s) to our list of children. Note that this
- * implicitly removes them from their previous parent.
- *
- * @param newChild The Node to be moved to our subtree. As a
- * convenience feature, inserting a DocumentNode will instead insert
- * all its children.
- *
- * @param refChild Current child which newChild should be placed
- * immediately before. If refChild is null, the insertion occurs
- * after all existing Nodes, like appendChild().
- *
- * @return newChild, in its new state (relocated, or emptied in the case of
- * DocumentNode.)
- *
- * @throws DOMException(HIERARCHY_REQUEST_ERR) if newChild is of a
- * type that shouldn't be a child of this node, or if newChild is an
- * ancestor of this node.
- *
- * @throws DOMException(WRONG_DOCUMENT_ERR) if newChild has a
- * different owner document than we do.
- *
- * @throws DOMException(NOT_FOUND_ERR) if refChild is not a child of
- * this node.
- *
- * @throws DOMException(NO_MODIFICATION_ALLOWED_ERR) if this node is
- * read-only.
- */
- public Node insertBefore(Node newChild, Node refChild)
- throws DOMException {
- // Tail-call; optimizer should be able to do good things with.
- return internalInsertBefore(newChild, refChild, false);
- } // insertBefore(Node,Node):Node
-
- /** NON-DOM INTERNAL: Within DOM actions,we sometimes need to be able
- * to control which mutation events are spawned. This version of the
- * insertBefore operation allows us to do so. It is not intended
- * for use by application programs.
- */
- Node internalInsertBefore(Node newChild, Node refChild, boolean replace)
- throws DOMException {
-
- boolean errorChecking = ownerDocument.errorChecking;
-
- if (newChild.getNodeType() == Node.DOCUMENT_FRAGMENT_NODE) {
- // SLOW BUT SAFE: We could insert the whole subtree without
- // juggling so many next/previous pointers. (Wipe out the
- // parent's child-list, patch the parent pointers, set the
- // ends of the list.) But we know some subclasses have special-
- // case behavior they add to insertBefore(), so we don't risk it.
- // This approch also takes fewer bytecodes.
-
- // NOTE: If one of the children is not a legal child of this
- // node, throw HIERARCHY_REQUEST_ERR before _any_ of the children
- // have been transferred. (Alternative behaviors would be to
- // reparent up to the first failure point or reparent all those
- // which are acceptable to the target node, neither of which is
- // as robust. PR-DOM-0818 isn't entirely clear on which it
- // recommends?????
-
- // No need to check kids for right-document; if they weren't,
- // they wouldn't be kids of that DocFrag.
- if (errorChecking) {
- for (Node kid = newChild.getFirstChild(); // Prescan
- kid != null; kid = kid.getNextSibling()) {
-
- if (!ownerDocument.isKidOK(this, kid)) {
- throw new DOMException(
- DOMException.HIERARCHY_REQUEST_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "HIERARCHY_REQUEST_ERR", null));
- }
- }
- }
-
- while (newChild.hasChildNodes()) {
- insertBefore(newChild.getFirstChild(), refChild);
- }
- return newChild;
- }
-
- if (newChild == refChild) {
- // stupid case that must be handled as a no-op triggering events...
- refChild = refChild.getNextSibling();
- removeChild(newChild);
- insertBefore(newChild, refChild);
- return newChild;
- }
-
- if (needsSyncChildren()) {
- synchronizeChildren();
- }
-
- if (errorChecking) {
- if (isReadOnly()) {
- throw new DOMException(
- DOMException.NO_MODIFICATION_ALLOWED_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null));
- }
- if (newChild.getOwnerDocument() != ownerDocument && newChild != ownerDocument) {
- throw new DOMException(DOMException.WRONG_DOCUMENT_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null));
- }
- if (!ownerDocument.isKidOK(this, newChild)) {
- throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "HIERARCHY_REQUEST_ERR", null));
- }
- // refChild must be a child of this node (or null)
- if (refChild != null && refChild.getParentNode() != this) {
- throw new DOMException(DOMException.NOT_FOUND_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_FOUND_ERR", null));
- }
-
- // Prevent cycles in the tree
- // newChild cannot be ancestor of this Node,
- // and actually cannot be this
- if (ownerDocument.ancestorChecking) {
- boolean treeSafe = true;
- for (NodeImpl a = this; treeSafe && a != null; a = a.parentNode())
- {
- treeSafe = newChild != a;
- }
- if(!treeSafe) {
- throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "HIERARCHY_REQUEST_ERR", null));
- }
- }
- }
-
- // notify document
- ownerDocument.insertingNode(this, replace);
-
- // Convert to internal type, to avoid repeated casting
- ChildNode newInternal = (ChildNode)newChild;
-
- Node oldparent = newInternal.parentNode();
- if (oldparent != null) {
- oldparent.removeChild(newInternal);
- }
-
- // Convert to internal type, to avoid repeated casting
- ChildNode refInternal = (ChildNode)refChild;
-
- // Attach up
- newInternal.ownerNode = this;
- newInternal.isOwned(true);
-
- // Attach before and after
- // Note: firstChild.previousSibling == lastChild!!
- if (firstChild == null) {
- // this our first and only child
- firstChild = newInternal;
- newInternal.isFirstChild(true);
- newInternal.previousSibling = newInternal;
- }
- else {
- if (refInternal == null) {
- // this is an append
- ChildNode lastChild = firstChild.previousSibling;
- lastChild.nextSibling = newInternal;
- newInternal.previousSibling = lastChild;
- firstChild.previousSibling = newInternal;
- }
- else {
- // this is an insert
- if (refChild == firstChild) {
- // at the head of the list
- firstChild.isFirstChild(false);
- newInternal.nextSibling = firstChild;
- newInternal.previousSibling = firstChild.previousSibling;
- firstChild.previousSibling = newInternal;
- firstChild = newInternal;
- newInternal.isFirstChild(true);
- }
- else {
- // somewhere in the middle
- ChildNode prev = refInternal.previousSibling;
- newInternal.nextSibling = refInternal;
- prev.nextSibling = newInternal;
- refInternal.previousSibling = newInternal;
- newInternal.previousSibling = prev;
- }
- }
- }
-
- changed();
-
- // update cached length if we have any
- if (fNodeListCache != null) {
- if (fNodeListCache.fLength != -1) {
- fNodeListCache.fLength++;
- }
- if (fNodeListCache.fChildIndex != -1) {
- // if we happen to insert just before the cached node, update
- // the cache to the new node to match the cached index
- if (fNodeListCache.fChild == refInternal) {
- fNodeListCache.fChild = newInternal;
- } else {
- // otherwise just invalidate the cache
- fNodeListCache.fChildIndex = -1;
- }
- }
- }
-
- // notify document
- ownerDocument.insertedNode(this, newInternal, replace);
-
- checkNormalizationAfterInsert(newInternal);
-
- return newChild;
-
- } // internalInsertBefore(Node,Node,boolean):Node
-
- /**
- * Remove a child from this Node. The removed child's subtree
- * remains intact so it may be re-inserted elsewhere.
- *
- * @return oldChild, in its new state (removed).
- *
- * @throws DOMException(NOT_FOUND_ERR) if oldChild is not a child of
- * this node.
- *
- * @throws DOMException(NO_MODIFICATION_ALLOWED_ERR) if this node is
- * read-only.
- */
- public Node removeChild(Node oldChild)
- throws DOMException {
- // Tail-call, should be optimizable
- return internalRemoveChild(oldChild, false);
- } // removeChild(Node) :Node
-
- /** NON-DOM INTERNAL: Within DOM actions,we sometimes need to be able
- * to control which mutation events are spawned. This version of the
- * removeChild operation allows us to do so. It is not intended
- * for use by application programs.
- */
- Node internalRemoveChild(Node oldChild, boolean replace)
- throws DOMException {
-
- CoreDocumentImpl ownerDocument = ownerDocument();
- if (ownerDocument.errorChecking) {
- if (isReadOnly()) {
- throw new DOMException(
- DOMException.NO_MODIFICATION_ALLOWED_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null));
- }
- if (oldChild != null && oldChild.getParentNode() != this) {
- throw new DOMException(DOMException.NOT_FOUND_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_FOUND_ERR", null));
- }
- }
-
- ChildNode oldInternal = (ChildNode) oldChild;
-
- // notify document
- ownerDocument.removingNode(this, oldInternal, replace);
-
- // update cached length if we have any
- if (fNodeListCache != null) {
- if (fNodeListCache.fLength != -1) {
- fNodeListCache.fLength--;
- }
- if (fNodeListCache.fChildIndex != -1) {
- // if the removed node is the cached node
- // move the cache to its (soon former) previous sibling
- if (fNodeListCache.fChild == oldInternal) {
- fNodeListCache.fChildIndex--;
- fNodeListCache.fChild = oldInternal.previousSibling();
- } else {
- // otherwise just invalidate the cache
- fNodeListCache.fChildIndex = -1;
- }
- }
- }
-
- // Patch linked list around oldChild
- // Note: lastChild == firstChild.previousSibling
- if (oldInternal == firstChild) {
- // removing first child
- oldInternal.isFirstChild(false);
- firstChild = oldInternal.nextSibling;
- if (firstChild != null) {
- firstChild.isFirstChild(true);
- firstChild.previousSibling = oldInternal.previousSibling;
- }
- } else {
- ChildNode prev = oldInternal.previousSibling;
- ChildNode next = oldInternal.nextSibling;
- prev.nextSibling = next;
- if (next == null) {
- // removing last child
- firstChild.previousSibling = prev;
- } else {
- // removing some other child in the middle
- next.previousSibling = prev;
- }
- }
-
- // Save previous sibling for normalization checking.
- ChildNode oldPreviousSibling = oldInternal.previousSibling();
-
- // Remove oldInternal's references to tree
- oldInternal.ownerNode = ownerDocument;
- oldInternal.isOwned(false);
- oldInternal.nextSibling = null;
- oldInternal.previousSibling = null;
-
- changed();
-
- // notify document
- ownerDocument.removedNode(this, replace);
-
- checkNormalizationAfterRemove(oldPreviousSibling);
-
- return oldInternal;
-
- } // internalRemoveChild(Node,boolean):Node
-
- /**
- * Make newChild occupy the location that oldChild used to
- * have. Note that newChild will first be removed from its previous
- * parent, if any. Equivalent to inserting newChild before oldChild,
- * then removing oldChild.
- *
- * @return oldChild, in its new state (removed).
- *
- * @throws DOMException(HIERARCHY_REQUEST_ERR) if newChild is of a
- * type that shouldn't be a child of this node, or if newChild is
- * one of our ancestors.
- *
- * @throws DOMException(WRONG_DOCUMENT_ERR) if newChild has a
- * different owner document than we do.
- *
- * @throws DOMException(NOT_FOUND_ERR) if oldChild is not a child of
- * this node.
- *
- * @throws DOMException(NO_MODIFICATION_ALLOWED_ERR) if this node is
- * read-only.
- */
- public Node replaceChild(Node newChild, Node oldChild)
- throws DOMException {
- // If Mutation Events are being generated, this operation might
- // throw aggregate events twice when modifying an Attr -- once
- // on insertion and once on removal. DOM Level 2 does not specify
- // this as either desirable or undesirable, but hints that
- // aggregations should be issued only once per user request.
-
- // notify document
- ownerDocument.replacingNode(this);
-
- internalInsertBefore(newChild, oldChild, true);
- if (newChild != oldChild) {
- internalRemoveChild(oldChild, true);
- }
-
- // notify document
- ownerDocument.replacedNode(this);
-
- return oldChild;
- }
-
- /*
- * Get Node text content
- * @since DOM Level 3
- */
- public String getTextContent() throws DOMException {
- Node child = getFirstChild();
- if (child != null) {
- Node next = child.getNextSibling();
- if (next == null) {
- return hasTextContent(child) ? ((NodeImpl) child).getTextContent() : "";
- }
- if (fBufferStr == null){
- fBufferStr = new StringBuffer();
- }
- else {
- fBufferStr.setLength(0);
- }
- getTextContent(fBufferStr);
- return fBufferStr.toString();
- }
- return "";
- }
-
- // internal method taking a StringBuffer in parameter
- void getTextContent(StringBuffer buf) throws DOMException {
- Node child = getFirstChild();
- while (child != null) {
- if (hasTextContent(child)) {
- ((NodeImpl) child).getTextContent(buf);
- }
- child = child.getNextSibling();
- }
- }
-
- // internal method returning whether to take the given node's text content
- final boolean hasTextContent(Node child) {
- return child.getNodeType() != Node.COMMENT_NODE &&
- child.getNodeType() != Node.PROCESSING_INSTRUCTION_NODE &&
- (child.getNodeType() != Node.TEXT_NODE ||
- ((TextImpl) child).isIgnorableWhitespace() == false);
- }
-
- /*
- * Set Node text content
- * @since DOM Level 3
- */
- public void setTextContent(String textContent)
- throws DOMException {
- // get rid of any existing children
- Node child;
- while ((child = getFirstChild()) != null) {
- removeChild(child);
- }
- // create a Text node to hold the given content
- if (textContent != null && textContent.length() != 0){
- appendChild(ownerDocument().createTextNode(textContent));
- }
- }
-
- //
- // NodeList methods
- //
-
- /**
- * Count the immediate children of this node. Use to implement
- * NodeList.getLength().
- * @return int
- */
- private int nodeListGetLength() {
-
- if (fNodeListCache == null) {
- // get rid of trivial cases
- if (firstChild == null) {
- return 0;
- }
- if (firstChild == lastChild()) {
- return 1;
- }
- // otherwise request a cache object
- fNodeListCache = ownerDocument.getNodeListCache(this);
- }
- if (fNodeListCache.fLength == -1) { // is the cached length invalid ?
- int l;
- ChildNode n;
- // start from the cached node if we have one
- if (fNodeListCache.fChildIndex != -1 &&
- fNodeListCache.fChild != null) {
- l = fNodeListCache.fChildIndex;
- n = fNodeListCache.fChild;
- } else {
- n = firstChild;
- l = 0;
- }
- while (n != null) {
- l++;
- n = n.nextSibling;
- }
- fNodeListCache.fLength = l;
- }
-
- return fNodeListCache.fLength;
-
- } // nodeListGetLength():int
-
- /**
- * NodeList method: Count the immediate children of this node
- * @return int
- */
- public int getLength() {
- return nodeListGetLength();
- }
-
- /**
- * Return the Nth immediate child of this node, or null if the index is
- * out of bounds. Use to implement NodeList.item().
- * @param index int
- */
- private Node nodeListItem(int index) {
-
- if (fNodeListCache == null) {
- // get rid of trivial case
- if (firstChild == lastChild()) {
- return index == 0 ? firstChild : null;
- }
- // otherwise request a cache object
- fNodeListCache = ownerDocument.getNodeListCache(this);
- }
- int i = fNodeListCache.fChildIndex;
- ChildNode n = fNodeListCache.fChild;
- boolean firstAccess = true;
- // short way
- if (i != -1 && n != null) {
- firstAccess = false;
- if (i < index) {
- while (i < index && n != null) {
- i++;
- n = n.nextSibling;
- }
- }
- else if (i > index) {
- while (i > index && n != null) {
- i--;
- n = n.previousSibling();
- }
- }
- }
- else {
- // long way
- if (index < 0) {
- return null;
- }
- n = firstChild;
- for (i = 0; i < index && n != null; i++) {
- n = n.nextSibling;
- }
- }
-
- // release cache if reaching last child or first child
- if (!firstAccess && (n == firstChild || n == lastChild())) {
- fNodeListCache.fChildIndex = -1;
- fNodeListCache.fChild = null;
- ownerDocument.freeNodeListCache(fNodeListCache);
- // we can keep using the cache until it is actually reused
- // fNodeListCache will be nulled by the pool (document) if that
- // happens.
- // fNodeListCache = null;
- }
- else {
- // otherwise update it
- fNodeListCache.fChildIndex = i;
- fNodeListCache.fChild = n;
- }
- return n;
-
- } // nodeListItem(int):Node
-
- /**
- * NodeList method: Return the Nth immediate child of this node, or
- * null if the index is out of bounds.
- * @return org.w3c.dom.Node
- * @param index int
- */
- public Node item(int index) {
- return nodeListItem(index);
- } // item(int):Node
-
- /**
- * Create a NodeList to access children that is use by subclass elements
- * that have methods named getLength() or item(int). ChildAndParentNode
- * optimizes getChildNodes() by implementing NodeList itself. However if
- * a subclass Element implements methods with the same name as the NodeList
- * methods, they will override the actually methods in this class.
- * <p>
- * To use this method, the subclass should implement getChildNodes() and
- * have it call this method. The resulting NodeList instance maybe
- * shared and cached in a transient field, but the cached value must be
- * cleared if the node is cloned.
- */
- protected final NodeList getChildNodesUnoptimized() {
- if (needsSyncChildren()) {
- synchronizeChildren();
- }
- return new NodeList() {
- /**
- * @see NodeList.getLength()
- */
- public int getLength() {
- return nodeListGetLength();
- } // getLength():int
-
- /**
- * @see NodeList.item(int)
- */
- public Node item(int index) {
- return nodeListItem(index);
- } // item(int):Node
- };
- } // getChildNodesUnoptimized():NodeList
-
- //
- // DOM2: methods, getters, setters
- //
-
- /**
- * Override default behavior to call normalize() on this Node's
- * children. It is up to implementors or Node to override normalize()
- * to take action.
- */
- public void normalize() {
- // No need to normalize if already normalized.
- if (isNormalized()) {
- return;
- }
- if (needsSyncChildren()) {
- synchronizeChildren();
- }
- ChildNode kid;
- for (kid = firstChild; kid != null; kid = kid.nextSibling) {
- kid.normalize();
- }
- isNormalized(true);
- }
-
- /**
- * DOM Level 3 WD- Experimental.
- * Override inherited behavior from NodeImpl to support deep equal.
- */
- public boolean isEqualNode(Node arg) {
- if (!super.isEqualNode(arg)) {
- return false;
- }
- // there are many ways to do this test, and there isn't any way
- // better than another. Performance may vary greatly depending on
- // the implementations involved. This one should work fine for us.
- Node child1 = getFirstChild();
- Node child2 = arg.getFirstChild();
- while (child1 != null && child2 != null) {
- if (!((NodeImpl) child1).isEqualNode(child2)) {
- return false;
- }
- child1 = child1.getNextSibling();
- child2 = child2.getNextSibling();
- }
- if (child1 != child2) {
- return false;
- }
- return true;
- }
-
- //
- // Public methods
- //
-
- /**
- * Override default behavior so that if deep is true, children are also
- * toggled.
- * @see Node
- * <P>
- * Note: this will not change the state of an EntityReference or its
- * children, which are always read-only.
- */
- public void setReadOnly(boolean readOnly, boolean deep) {
-
- super.setReadOnly(readOnly, deep);
-
- if (deep) {
-
- if (needsSyncChildren()) {
- synchronizeChildren();
- }
-
- // Recursively set kids
- for (ChildNode mykid = firstChild;
- mykid != null;
- mykid = mykid.nextSibling) {
- if (mykid.getNodeType() != Node.ENTITY_REFERENCE_NODE) {
- mykid.setReadOnly(readOnly,true);
- }
- }
- }
- } // setReadOnly(boolean,boolean)
-
- //
- // Protected methods
- //
-
- /**
- * Override this method in subclass to hook in efficient
- * internal data structure.
- */
- protected void synchronizeChildren() {
- // By default just change the flag to avoid calling this method again
- needsSyncChildren(false);
- }
-
- /**
- * Checks the normalized state of this node after inserting a child.
- * If the inserted child causes this node to be unnormalized, then this
- * node is flagged accordingly.
- * The conditions for changing the normalized state are:
- * <ul>
- * <li>The inserted child is a text node and one of its adjacent siblings
- * is also a text node.
- * <li>The inserted child is is itself unnormalized.
- * </ul>
- *
- * @param insertedChild the child node that was inserted into this node
- *
- * @throws NullPointerException if the inserted child is <code>null</code>
- */
- void checkNormalizationAfterInsert(ChildNode insertedChild) {
- // See if insertion caused this node to be unnormalized.
- if (insertedChild.getNodeType() == Node.TEXT_NODE) {
- ChildNode prev = insertedChild.previousSibling();
- ChildNode next = insertedChild.nextSibling;
- // If an adjacent sibling of the new child is a text node,
- // flag this node as unnormalized.
- if ((prev != null && prev.getNodeType() == Node.TEXT_NODE) ||
- (next != null && next.getNodeType() == Node.TEXT_NODE)) {
- isNormalized(false);
- }
- }
- else {
- // If the new child is not normalized,
- // then this node is inherently not normalized.
- if (!insertedChild.isNormalized()) {
- isNormalized(false);
- }
- }
- } // checkNormalizationAfterInsert(ChildNode)
-
- /**
- * Checks the normalized of this node after removing a child.
- * If the removed child causes this node to be unnormalized, then this
- * node is flagged accordingly.
- * The conditions for changing the normalized state are:
- * <ul>
- * <li>The removed child had two adjacent siblings that were text nodes.
- * </ul>
- *
- * @param previousSibling the previous sibling of the removed child, or
- * <code>null</code>
- */
- void checkNormalizationAfterRemove(ChildNode previousSibling) {
- // See if removal caused this node to be unnormalized.
- // If the adjacent siblings of the removed child were both text nodes,
- // flag this node as unnormalized.
- if (previousSibling != null &&
- previousSibling.getNodeType() == Node.TEXT_NODE) {
-
- ChildNode next = previousSibling.nextSibling;
- if (next != null && next.getNodeType() == Node.TEXT_NODE) {
- isNormalized(false);
- }
- }
- } // checkNormalizationAfterRemove(Node)
-
- //
- // Serialization methods
- //
-
- /** Serialize object. */
- private void writeObject(ObjectOutputStream out) throws IOException {
-
- // synchronize chilren
- if (needsSyncChildren()) {
- synchronizeChildren();
- }
- // write object
- out.defaultWriteObject();
-
- } // writeObject(ObjectOutputStream)
-
- /** Deserialize object. */
- private void readObject(ObjectInputStream ois)
- throws ClassNotFoundException, IOException {
-
- // perform default deseralization
- ois.defaultReadObject();
-
- // hardset synchildren - so we don't try to sync - it does not make any
- // sense to try to synchildren when we just deserialize object.
- needsSyncChildren(false);
-
- } // readObject(ObjectInputStream)
-
- /*
- * a class to store some user data along with its handler
- */
- protected class UserDataRecord implements Serializable {
- /** Serialization version. */
- private static final long serialVersionUID = 3258126977134310455L;
-
- Object fData;
- UserDataHandler fHandler;
- UserDataRecord(Object data, UserDataHandler handler) {
- fData = data;
- fHandler = handler;
- }
- }
-} // class ParentNode
diff --git a/src/com/sun/org/apache/xerces/internal/dom/ProcessingInstructionImpl.java b/src/com/sun/org/apache/xerces/internal/dom/ProcessingInstructionImpl.java
deleted file mode 100644
index a236576..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/ProcessingInstructionImpl.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.ProcessingInstruction;
-
-/**
- * Processing Instructions (PIs) permit documents to carry
- * processor-specific information alongside their actual content. PIs
- * are most common in XML, but they are supported in HTML as well.
- *
- * This class inherits from CharacterDataImpl to reuse its setNodeValue method.
- *
- * @xerces.internal
- *
- * @since PR-DOM-Level-1-19980818.
- */
-public class ProcessingInstructionImpl
- extends CharacterDataImpl
- implements ProcessingInstruction {
-
- //
- // Constants
- //
-
- /** Serialization version. */
- static final long serialVersionUID = 7554435174099981510L;
-
- //
- // Data
- //
-
- protected String target;
-
- //
- // Constructors
- //
-
- /** Factory constructor. */
- public ProcessingInstructionImpl(CoreDocumentImpl ownerDoc,
- String target, String data) {
- super(ownerDoc, data);
- this.target = target;
- }
-
- //
- // Node methods
- //
-
- /**
- * A short integer indicating what type of node this is. The named
- * constants for this value are defined in the org.w3c.dom.Node interface.
- */
- public short getNodeType() {
- return Node.PROCESSING_INSTRUCTION_NODE;
- }
-
- /**
- * Returns the target
- */
- public String getNodeName() {
- if (needsSyncData()) {
- synchronizeData();
- }
- return target;
- }
-
- //
- // ProcessingInstruction methods
- //
-
- /**
- * A PI's "target" states what processor channel the PI's data
- * should be directed to. It is defined differently in HTML and XML.
- * <p>
- * In XML, a PI's "target" is the first (whitespace-delimited) token
- * following the "<?" token that begins the PI.
- * <p>
- * In HTML, target is always null.
- * <p>
- * Note that getNodeName is aliased to getTarget.
- */
- public String getTarget() {
- if (needsSyncData()) {
- synchronizeData();
- }
- return target;
-
- } // getTarget():String
-
- /**
- * A PI's data content tells the processor what we actually want it
- * to do. It is defined slightly differently in HTML and XML.
- * <p>
- * In XML, the data begins with the non-whitespace character
- * immediately after the target -- @see getTarget().
- * <p>
- * In HTML, the data begins with the character immediately after the
- * "&lt;?" token that begins the PI.
- * <p>
- * Note that getNodeValue is aliased to getData
- */
- public String getData() {
- if (needsSyncData()) {
- synchronizeData();
- }
- return data;
-
- } // getData():String
-
- /**
- * Change the data content of this PI.
- * Note that setData is aliased to setNodeValue.
- * @see #getData().
- * @throws DOMException(NO_MODIFICATION_ALLOWED_ERR) if node is read-only.
- */
- public void setData(String data) {
- // Hand off to setNodeValue for code-reuse reasons (mutation
- // events, readonly protection, synchronizing, etc.)
- setNodeValue(data);
- } // setData(String)
-
-
-
- /**
- * Returns the absolute base URI of this node or null if the implementation
- * wasn't able to obtain an absolute URI. Note: If the URI is malformed, a
- * null is returned.
- *
- * @return The absolute base URI of this node or null.
- * @since DOM Level 3
- */
- public String getBaseURI() {
-
- if (needsSyncData()) {
- synchronizeData();
- }
- return ownerNode.getBaseURI();
- }
-
-
-} // class ProcessingInstructionImpl
diff --git a/src/com/sun/org/apache/xerces/internal/dom/RangeExceptionImpl.java b/src/com/sun/org/apache/xerces/internal/dom/RangeExceptionImpl.java
deleted file mode 100644
index 9f391f2..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/RangeExceptionImpl.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xerces.internal.dom;
-
-import org.w3c.dom.ranges.RangeException;
-
-/**
- * @xerces.internal
- *
- */
-
-public class RangeExceptionImpl extends RangeException {
-
- /** Serialization version. */
- static final long serialVersionUID = -9058052627467240856L;
-
- public RangeExceptionImpl(short code, String message) {
- super(code,message);
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/dom/RangeImpl.java b/src/com/sun/org/apache/xerces/internal/dom/RangeImpl.java
deleted file mode 100644
index 31c631d..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/RangeImpl.java
+++ /dev/null
@@ -1,2085 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-import java.util.Vector;
-
-import org.w3c.dom.CharacterData;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.Node;
-import org.w3c.dom.ranges.Range;
-import org.w3c.dom.ranges.RangeException;
-
-
-/** The RangeImpl class implements the org.w3c.dom.range.Range interface.
- * <p> Please see the API documentation for the interface classes
- * and use the interfaces in your client programs.
- *
- * @xerces.internal
- *
- */
-public class RangeImpl implements Range {
-
- //
- // Constants
- //
-
-
- //
- // Data
- //
-
- DocumentImpl fDocument;
- Node fStartContainer;
- Node fEndContainer;
- int fStartOffset;
- int fEndOffset;
- boolean fIsCollapsed;
- boolean fDetach = false;
- Node fInsertNode = null;
- Node fDeleteNode = null;
- Node fSplitNode = null;
- // Was the Node inserted from the Range or the Document
- boolean fInsertedFromRange = false;
-
- /** The constructor. Clients must use DocumentRange.createRange(),
- * because it registers the Range with the document, so it can
- * be fixed-up.
- */
- public RangeImpl(DocumentImpl document) {
- fDocument = document;
- fStartContainer = document;
- fEndContainer = document;
- fStartOffset = 0;
- fEndOffset = 0;
- fDetach = false;
- }
-
- public Node getStartContainer() {
- if ( fDetach ) {
- throw new DOMException(
- DOMException.INVALID_STATE_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
- }
- return fStartContainer;
- }
-
- public int getStartOffset() {
- if ( fDetach ) {
- throw new DOMException(
- DOMException.INVALID_STATE_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
- }
- return fStartOffset;
- }
-
- public Node getEndContainer() {
- if ( fDetach ) {
- throw new DOMException(
- DOMException.INVALID_STATE_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
- }
- return fEndContainer;
- }
-
- public int getEndOffset() {
- if ( fDetach ) {
- throw new DOMException(
- DOMException.INVALID_STATE_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
- }
- return fEndOffset;
- }
-
- public boolean getCollapsed() {
- if ( fDetach ) {
- throw new DOMException(
- DOMException.INVALID_STATE_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
- }
- return (fStartContainer == fEndContainer
- && fStartOffset == fEndOffset);
- }
-
- public Node getCommonAncestorContainer() {
- if ( fDetach ) {
- throw new DOMException(
- DOMException.INVALID_STATE_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
- }
- Vector startV = new Vector();
- Node node;
- for (node=fStartContainer; node != null;
- node=node.getParentNode())
- {
- startV.addElement(node);
- }
- Vector endV = new Vector();
- for (node=fEndContainer; node != null;
- node=node.getParentNode())
- {
- endV.addElement(node);
- }
- int s = startV.size()-1;
- int e = endV.size()-1;
- Object result = null;
- while (s>=0 && e>=0) {
- if (startV.elementAt(s) == endV.elementAt(e)) {
- result = startV.elementAt(s);
- } else {
- break;
- }
- --s;
- --e;
- }
- return (Node)result;
- }
-
-
- public void setStart(Node refNode, int offset)
- throws RangeException, DOMException
- {
- if (fDocument.errorChecking) {
- if ( fDetach) {
- throw new DOMException(
- DOMException.INVALID_STATE_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
- }
- if ( !isLegalContainer(refNode)) {
- throw new RangeExceptionImpl(
- RangeException.INVALID_NODE_TYPE_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_NODE_TYPE_ERR", null));
- }
- if ( fDocument != refNode.getOwnerDocument() && fDocument != refNode) {
- throw new DOMException(
- DOMException.WRONG_DOCUMENT_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null));
- }
- }
-
- checkIndex(refNode, offset);
-
- fStartContainer = refNode;
- fStartOffset = offset;
-
- // If one boundary-point of a Range is set to have a root container
- // other
- // than the current one for the Range, the Range should be collapsed to
- // the new position.
- // The start position of a Range should never be after the end position.
- if (getCommonAncestorContainer() == null
- || (fStartContainer == fEndContainer && fEndOffset < fStartOffset)) {
- collapse(true);
- }
- }
-
- public void setEnd(Node refNode, int offset)
- throws RangeException, DOMException
- {
- if (fDocument.errorChecking) {
- if (fDetach) {
- throw new DOMException(
- DOMException.INVALID_STATE_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
- }
- if ( !isLegalContainer(refNode)) {
- throw new RangeExceptionImpl(
- RangeException.INVALID_NODE_TYPE_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_NODE_TYPE_ERR", null));
- }
- if ( fDocument != refNode.getOwnerDocument() && fDocument != refNode) {
- throw new DOMException(
- DOMException.WRONG_DOCUMENT_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null));
- }
- }
-
- checkIndex(refNode, offset);
-
- fEndContainer = refNode;
- fEndOffset = offset;
-
- // If one boundary-point of a Range is set to have a root container
- // other
- // than the current one for the Range, the Range should be collapsed to
- // the new position.
- // The start position of a Range should never be after the end position.
- if (getCommonAncestorContainer() == null
- || (fStartContainer == fEndContainer && fEndOffset < fStartOffset)) {
- collapse(false);
- }
- }
-
- public void setStartBefore(Node refNode)
- throws RangeException
- {
- if (fDocument.errorChecking) {
- if (fDetach) {
- throw new DOMException(
- DOMException.INVALID_STATE_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
- }
- if ( !hasLegalRootContainer(refNode) ||
- !isLegalContainedNode(refNode) )
- {
- throw new RangeExceptionImpl(
- RangeException.INVALID_NODE_TYPE_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_NODE_TYPE_ERR", null));
- }
- if ( fDocument != refNode.getOwnerDocument() && fDocument != refNode) {
- throw new DOMException(
- DOMException.WRONG_DOCUMENT_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null));
- }
- }
-
- fStartContainer = refNode.getParentNode();
- int i = 0;
- for (Node n = refNode; n!=null; n = n.getPreviousSibling()) {
- i++;
- }
- fStartOffset = i-1;
-
- // If one boundary-point of a Range is set to have a root container
- // other
- // than the current one for the Range, the Range should be collapsed to
- // the new position.
- // The start position of a Range should never be after the end position.
- if (getCommonAncestorContainer() == null
- || (fStartContainer == fEndContainer && fEndOffset < fStartOffset)) {
- collapse(true);
- }
- }
-
- public void setStartAfter(Node refNode)
- throws RangeException
- {
- if (fDocument.errorChecking) {
- if (fDetach) {
- throw new DOMException(
- DOMException.INVALID_STATE_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
- }
- if ( !hasLegalRootContainer(refNode) ||
- !isLegalContainedNode(refNode)) {
- throw new RangeExceptionImpl(
- RangeException.INVALID_NODE_TYPE_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_NODE_TYPE_ERR", null));
- }
- if ( fDocument != refNode.getOwnerDocument() && fDocument != refNode) {
- throw new DOMException(
- DOMException.WRONG_DOCUMENT_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null));
- }
- }
- fStartContainer = refNode.getParentNode();
- int i = 0;
- for (Node n = refNode; n!=null; n = n.getPreviousSibling()) {
- i++;
- }
- fStartOffset = i;
-
- // If one boundary-point of a Range is set to have a root container
- // other
- // than the current one for the Range, the Range should be collapsed to
- // the new position.
- // The start position of a Range should never be after the end position.
- if (getCommonAncestorContainer() == null
- || (fStartContainer == fEndContainer && fEndOffset < fStartOffset)) {
- collapse(true);
- }
- }
-
- public void setEndBefore(Node refNode)
- throws RangeException
- {
- if (fDocument.errorChecking) {
- if (fDetach) {
- throw new DOMException(
- DOMException.INVALID_STATE_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
- }
- if ( !hasLegalRootContainer(refNode) ||
- !isLegalContainedNode(refNode)) {
- throw new RangeExceptionImpl(
- RangeException.INVALID_NODE_TYPE_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_NODE_TYPE_ERR", null));
- }
- if ( fDocument != refNode.getOwnerDocument() && fDocument != refNode) {
- throw new DOMException(
- DOMException.WRONG_DOCUMENT_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null));
- }
- }
- fEndContainer = refNode.getParentNode();
- int i = 0;
- for (Node n = refNode; n!=null; n = n.getPreviousSibling()) {
- i++;
- }
- fEndOffset = i-1;
-
- // If one boundary-point of a Range is set to have a root container
- // other
- // than the current one for the Range, the Range should be collapsed to
- // the new position.
- // The start position of a Range should never be after the end position.
- if (getCommonAncestorContainer() == null
- || (fStartContainer == fEndContainer && fEndOffset < fStartOffset)) {
- collapse(false);
- }
- }
-
- public void setEndAfter(Node refNode)
- throws RangeException
- {
- if (fDocument.errorChecking) {
- if( fDetach) {
- throw new DOMException(
- DOMException.INVALID_STATE_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
- }
- if ( !hasLegalRootContainer(refNode) ||
- !isLegalContainedNode(refNode)) {
- throw new RangeExceptionImpl(
- RangeException.INVALID_NODE_TYPE_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_NODE_TYPE_ERR", null));
- }
- if ( fDocument != refNode.getOwnerDocument() && fDocument != refNode) {
- throw new DOMException(
- DOMException.WRONG_DOCUMENT_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null));
- }
- }
- fEndContainer = refNode.getParentNode();
- int i = 0;
- for (Node n = refNode; n!=null; n = n.getPreviousSibling()) {
- i++;
- }
- fEndOffset = i;
-
- // If one boundary-point of a Range is set to have a root container
- // other
- // than the current one for the Range, the Range should be collapsed to
- // the new position.
- // The start position of a Range should never be after the end position.
- if (getCommonAncestorContainer() == null
- || (fStartContainer == fEndContainer && fEndOffset < fStartOffset)) {
- collapse(false);
- }
- }
-
- public void collapse(boolean toStart) {
-
- if( fDetach) {
- throw new DOMException(
- DOMException.INVALID_STATE_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
- }
-
- if (toStart) {
- fEndContainer = fStartContainer;
- fEndOffset = fStartOffset;
- } else {
- fStartContainer = fEndContainer;
- fStartOffset = fEndOffset;
- }
- }
-
- public void selectNode(Node refNode)
- throws RangeException
- {
- if (fDocument.errorChecking) {
- if (fDetach) {
- throw new DOMException(
- DOMException.INVALID_STATE_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
- }
- if ( !isLegalContainer( refNode.getParentNode() ) ||
- !isLegalContainedNode( refNode ) ) {
- throw new RangeExceptionImpl(
- RangeException.INVALID_NODE_TYPE_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_NODE_TYPE_ERR", null));
- }
- if ( fDocument != refNode.getOwnerDocument() && fDocument != refNode) {
- throw new DOMException(
- DOMException.WRONG_DOCUMENT_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null));
- }
- }
- Node parent = refNode.getParentNode();
- if (parent != null ) // REVIST: what to do if it IS null?
- {
- fStartContainer = parent;
- fEndContainer = parent;
- int i = 0;
- for (Node n = refNode; n!=null; n = n.getPreviousSibling()) {
- i++;
- }
- fStartOffset = i-1;
- fEndOffset = fStartOffset+1;
- }
- }
-
- public void selectNodeContents(Node refNode)
- throws RangeException
- {
- if (fDocument.errorChecking) {
- if( fDetach) {
- throw new DOMException(
- DOMException.INVALID_STATE_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
- }
- if ( !isLegalContainer(refNode)) {
- throw new RangeExceptionImpl(
- RangeException.INVALID_NODE_TYPE_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_NODE_TYPE_ERR", null));
- }
- if ( fDocument != refNode.getOwnerDocument() && fDocument != refNode) {
- throw new DOMException(
- DOMException.WRONG_DOCUMENT_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null));
- }
- }
- fStartContainer = refNode;
- fEndContainer = refNode;
- Node first = refNode.getFirstChild();
- fStartOffset = 0;
- if (first == null) {
- fEndOffset = 0;
- } else {
- int i = 0;
- for (Node n = first; n!=null; n = n.getNextSibling()) {
- i++;
- }
- fEndOffset = i;
- }
-
- }
-
- public short compareBoundaryPoints(short how, Range sourceRange)
- throws DOMException
- {
- if (fDocument.errorChecking) {
- if( fDetach) {
- throw new DOMException(
- DOMException.INVALID_STATE_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
- }
- // WRONG_DOCUMENT_ERR: Raised if the two Ranges are not in the same Document or DocumentFragment.
- if ((fDocument != sourceRange.getStartContainer().getOwnerDocument()
- && fDocument != sourceRange.getStartContainer()
- && sourceRange.getStartContainer() != null)
- || (fDocument != sourceRange.getEndContainer().getOwnerDocument()
- && fDocument != sourceRange.getEndContainer()
- && sourceRange.getStartContainer() != null)) {
- throw new DOMException(DOMException.WRONG_DOCUMENT_ERR,
- DOMMessageFormatter.formatMessage( DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null));
- }
- }
-
- Node endPointA;
- Node endPointB;
- int offsetA;
- int offsetB;
-
- if (how == START_TO_START) {
- endPointA = sourceRange.getStartContainer();
- endPointB = fStartContainer;
- offsetA = sourceRange.getStartOffset();
- offsetB = fStartOffset;
- } else
- if (how == START_TO_END) {
- endPointA = sourceRange.getStartContainer();
- endPointB = fEndContainer;
- offsetA = sourceRange.getStartOffset();
- offsetB = fEndOffset;
- } else
- if (how == END_TO_START) {
- endPointA = sourceRange.getEndContainer();
- endPointB = fStartContainer;
- offsetA = sourceRange.getEndOffset();
- offsetB = fStartOffset;
- } else {
- endPointA = sourceRange.getEndContainer();
- endPointB = fEndContainer;
- offsetA = sourceRange.getEndOffset();
- offsetB = fEndOffset;
- }
-
- // The DOM Spec outlines four cases that need to be tested
- // to compare two range boundary points:
- // case 1: same container
- // case 2: Child C of container A is ancestor of B
- // case 3: Child C of container B is ancestor of A
- // case 4: preorder traversal of context tree.
-
- // case 1: same container
- if (endPointA == endPointB) {
- if (offsetA < offsetB) return 1;
- if (offsetA == offsetB) return 0;
- return -1;
- }
- // case 2: Child C of container A is ancestor of B
- // This can be quickly tested by walking the parent chain of B
- for ( Node c = endPointB, p = c.getParentNode();
- p != null;
- c = p, p = p.getParentNode())
- {
- if (p == endPointA) {
- int index = indexOf(c, endPointA);
- if (offsetA <= index) return 1;
- return -1;
- }
- }
-
- // case 3: Child C of container B is ancestor of A
- // This can be quickly tested by walking the parent chain of A
- for ( Node c = endPointA, p = c.getParentNode();
- p != null;
- c = p, p = p.getParentNode())
- {
- if (p == endPointB) {
- int index = indexOf(c, endPointB);
- if (index < offsetB) return 1;
- return -1;
- }
- }
-
- // case 4: preorder traversal of context tree.
- // Instead of literally walking the context tree in pre-order,
- // we use relative node depth walking which is usually faster
-
- int depthDiff = 0;
- for ( Node n = endPointA; n != null; n = n.getParentNode() )
- depthDiff++;
- for ( Node n = endPointB; n != null; n = n.getParentNode() )
- depthDiff--;
- while (depthDiff > 0) {
- endPointA = endPointA.getParentNode();
- depthDiff--;
- }
- while (depthDiff < 0) {
- endPointB = endPointB.getParentNode();
- depthDiff++;
- }
- for (Node pA = endPointA.getParentNode(),
- pB = endPointB.getParentNode();
- pA != pB;
- pA = pA.getParentNode(), pB = pB.getParentNode() )
- {
- endPointA = pA;
- endPointB = pB;
- }
- for ( Node n = endPointA.getNextSibling();
- n != null;
- n = n.getNextSibling() )
- {
- if (n == endPointB) {
- return 1;
- }
- }
- return -1;
- }
-
- public void deleteContents()
- throws DOMException
- {
- traverseContents(DELETE_CONTENTS);
- }
-
- public DocumentFragment extractContents()
- throws DOMException
- {
- return traverseContents(EXTRACT_CONTENTS);
- }
-
- public DocumentFragment cloneContents()
- throws DOMException
- {
- return traverseContents(CLONE_CONTENTS);
- }
-
- public void insertNode(Node newNode)
- throws DOMException, RangeException
- {
- if ( newNode == null ) return; //throw exception?
-
- int type = newNode.getNodeType();
-
- if (fDocument.errorChecking) {
- if (fDetach) {
- throw new DOMException(
- DOMException.INVALID_STATE_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
- }
- if ( fDocument != newNode.getOwnerDocument() ) {
- throw new DOMException(DOMException.WRONG_DOCUMENT_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null));
- }
-
- if (type == Node.ATTRIBUTE_NODE
- || type == Node.ENTITY_NODE
- || type == Node.NOTATION_NODE
- || type == Node.DOCUMENT_NODE)
- {
- throw new RangeExceptionImpl(
- RangeException.INVALID_NODE_TYPE_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_NODE_TYPE_ERR", null));
- }
- }
- Node cloneCurrent;
- Node current;
- int currentChildren = 0;
- fInsertedFromRange = true;
-
- //boolean MULTIPLE_MODE = false;
- if (fStartContainer.getNodeType() == Node.TEXT_NODE) {
-
- Node parent = fStartContainer.getParentNode();
- currentChildren = parent.getChildNodes().getLength(); //holds number of kids before insertion
- // split text node: results is 3 nodes..
- cloneCurrent = fStartContainer.cloneNode(false);
- ((TextImpl)cloneCurrent).setNodeValueInternal(
- (cloneCurrent.getNodeValue()).substring(fStartOffset));
- ((TextImpl)fStartContainer).setNodeValueInternal(
- (fStartContainer.getNodeValue()).substring(0,fStartOffset));
- Node next = fStartContainer.getNextSibling();
- if (next != null) {
- if (parent != null) {
- parent.insertBefore(newNode, next);
- parent.insertBefore(cloneCurrent, next);
- }
- } else {
- if (parent != null) {
- parent.appendChild(newNode);
- parent.appendChild(cloneCurrent);
- }
- }
- //update ranges after the insertion
- if ( fEndContainer == fStartContainer) {
- fEndContainer = cloneCurrent; //endContainer is the new Node created
- fEndOffset -= fStartOffset;
- }
- else if ( fEndContainer == parent ) { //endContainer was not a text Node.
- //endOffset + = number_of_children_added
- fEndOffset += (parent.getChildNodes().getLength() - currentChildren);
- }
-
- // signal other Ranges to update their start/end containers/offsets
- signalSplitData(fStartContainer, cloneCurrent, fStartOffset);
-
-
- } else { // ! TEXT_NODE
- if ( fEndContainer == fStartContainer ) //need to remember number of kids
- currentChildren= fEndContainer.getChildNodes().getLength();
-
- current = fStartContainer.getFirstChild();
- int i = 0;
- for(i = 0; i < fStartOffset && current != null; i++) {
- current=current.getNextSibling();
- }
- if (current != null) {
- fStartContainer.insertBefore(newNode, current);
- } else {
- fStartContainer.appendChild(newNode);
- }
- //update fEndOffset. ex:<body><p/></body>. Range(start;end): body,0; body,1
- // insert <h1>: <body></h1><p/></body>. Range(start;end): body,0; body,2
- if ( fEndContainer == fStartContainer && fEndOffset != 0 ) { //update fEndOffset if not 0
- fEndOffset += (fEndContainer.getChildNodes().getLength() - currentChildren);
- }
- }
- fInsertedFromRange = false;
- }
-
- public void surroundContents(Node newParent)
- throws DOMException, RangeException
- {
- if (newParent==null) return;
- int type = newParent.getNodeType();
-
- if (fDocument.errorChecking) {
- if (fDetach) {
- throw new DOMException(
- DOMException.INVALID_STATE_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
- }
- if (type == Node.ATTRIBUTE_NODE
- || type == Node.ENTITY_NODE
- || type == Node.NOTATION_NODE
- || type == Node.DOCUMENT_TYPE_NODE
- || type == Node.DOCUMENT_NODE
- || type == Node.DOCUMENT_FRAGMENT_NODE)
- {
- throw new RangeExceptionImpl(
- RangeException.INVALID_NODE_TYPE_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_NODE_TYPE_ERR", null));
- }
- }
-
- Node realStart = fStartContainer;
- Node realEnd = fEndContainer;
- if (fStartContainer.getNodeType() == Node.TEXT_NODE) {
- realStart = fStartContainer.getParentNode();
- }
- if (fEndContainer.getNodeType() == Node.TEXT_NODE) {
- realEnd = fEndContainer.getParentNode();
- }
-
- if (realStart != realEnd) {
- throw new RangeExceptionImpl(
- RangeException.BAD_BOUNDARYPOINTS_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "BAD_BOUNDARYPOINTS_ERR", null));
- }
-
- DocumentFragment frag = extractContents();
- insertNode(newParent);
- newParent.appendChild(frag);
- selectNode(newParent);
- }
-
- public Range cloneRange(){
- if( fDetach) {
- throw new DOMException(
- DOMException.INVALID_STATE_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
- }
-
- Range range = fDocument.createRange();
- range.setStart(fStartContainer, fStartOffset);
- range.setEnd(fEndContainer, fEndOffset);
- return range;
- }
-
- public String toString(){
- if( fDetach) {
- throw new DOMException(
- DOMException.INVALID_STATE_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
- }
-
- Node node = fStartContainer;
- Node stopNode = fEndContainer;
- StringBuffer sb = new StringBuffer();
- if (fStartContainer.getNodeType() == Node.TEXT_NODE
- || fStartContainer.getNodeType() == Node.CDATA_SECTION_NODE
- ) {
- if (fStartContainer == fEndContainer) {
- sb.append(fStartContainer.getNodeValue().substring(fStartOffset, fEndOffset));
- return sb.toString();
- }
- sb.append(fStartContainer.getNodeValue().substring(fStartOffset));
- node=nextNode (node,true); //fEndContainer!=fStartContainer
-
- }
- else { //fStartContainer is not a TextNode
- node=node.getFirstChild();
- if (fStartOffset>0) { //find a first node within a range, specified by fStartOffset
- int counter=0;
- while (counter<fStartOffset && node!=null) {
- node=node.getNextSibling();
- counter++;
- }
- }
- if (node == null) {
- node = nextNode(fStartContainer,false);
- }
- }
- if ( fEndContainer.getNodeType()!= Node.TEXT_NODE &&
- fEndContainer.getNodeType()!= Node.CDATA_SECTION_NODE ){
- int i=fEndOffset;
- stopNode = fEndContainer.getFirstChild();
- while( i>0 && stopNode!=null ){
- --i;
- stopNode = stopNode.getNextSibling();
- }
- if ( stopNode == null )
- stopNode = nextNode( fEndContainer, false );
- }
- while (node != stopNode) { //look into all kids of the Range
- if (node == null) break;
- if (node.getNodeType() == Node.TEXT_NODE
- || node.getNodeType() == Node.CDATA_SECTION_NODE) {
- sb.append(node.getNodeValue());
- }
-
- node = nextNode(node, true);
- }
-
- if (fEndContainer.getNodeType() == Node.TEXT_NODE
- || fEndContainer.getNodeType() == Node.CDATA_SECTION_NODE) {
- sb.append(fEndContainer.getNodeValue().substring(0,fEndOffset));
- }
- return sb.toString();
- }
-
- public void detach() {
- if( fDetach) {
- throw new DOMException(
- DOMException.INVALID_STATE_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
- }
- fDetach = true;
- fDocument.removeRange(this);
- }
-
- //
- // Mutation functions
- //
-
- /** Signal other Ranges to update their start/end
- * containers/offsets. The data has already been split
- * into the two Nodes.
- */
- void signalSplitData(Node node, Node newNode, int offset) {
- fSplitNode = node;
- // notify document
- fDocument.splitData(node, newNode, offset);
- fSplitNode = null;
- }
-
- /** Fix up this Range if another Range has split a Text Node
- * into 2 Nodes.
- */
- void receiveSplitData(Node node, Node newNode, int offset) {
- if (node == null || newNode == null) return;
- if (fSplitNode == node) return;
-
- if (node == fStartContainer
- && fStartContainer.getNodeType() == Node.TEXT_NODE) {
- if (fStartOffset > offset) {
- fStartOffset = fStartOffset - offset;
- fStartContainer = newNode;
- }
- }
- if (node == fEndContainer
- && fEndContainer.getNodeType() == Node.TEXT_NODE) {
- if (fEndOffset > offset) {
- fEndOffset = fEndOffset-offset;
- fEndContainer = newNode;
- }
- }
-
- }
-
- /** This function inserts text into a Node and invokes
- * a method to fix-up all other Ranges.
- */
- void deleteData(CharacterData node, int offset, int count) {
- fDeleteNode = node;
- node.deleteData( offset, count);
- fDeleteNode = null;
- }
-
-
- /** This function is called from DOM.
- * The text has already beeen inserted.
- * Fix-up any offsets.
- */
- void receiveDeletedText(Node node, int offset, int count) {
- if (node == null) return;
- if (fDeleteNode == node) return;
- if (node == fStartContainer
- && fStartContainer.getNodeType() == Node.TEXT_NODE) {
- if (fStartOffset > offset+count) {
- fStartOffset = offset+(fStartOffset-(offset+count));
- } else
- if (fStartOffset > offset) {
- fStartOffset = offset;
- }
- }
- if (node == fEndContainer
- && fEndContainer.getNodeType() == Node.TEXT_NODE) {
- if (fEndOffset > offset+count) {
- fEndOffset = offset+(fEndOffset-(offset+count));
- } else
- if (fEndOffset > offset) {
- fEndOffset = offset;
- }
- }
-
- }
-
- /** This function inserts text into a Node and invokes
- * a method to fix-up all other Ranges.
- */
- void insertData(CharacterData node, int index, String insert) {
- fInsertNode = node;
- node.insertData( index, insert);
- fInsertNode = null;
- }
-
-
- /** This function is called from DOM.
- * The text has already beeen inserted.
- * Fix-up any offsets.
- */
- void receiveInsertedText(Node node, int index, int len) {
- if (node == null) return;
- if (fInsertNode == node) return;
- if (node == fStartContainer
- && fStartContainer.getNodeType() == Node.TEXT_NODE) {
- if (index < fStartOffset) {
- fStartOffset = fStartOffset+len;
- }
- }
- if (node == fEndContainer
- && fEndContainer.getNodeType() == Node.TEXT_NODE) {
- if (index < fEndOffset) {
- fEndOffset = fEndOffset+len;
- }
- }
-
- }
-
- /** This function is called from DOM.
- * The text has already beeen replaced.
- * Fix-up any offsets.
- */
- void receiveReplacedText(Node node) {
- if (node == null) return;
- if (node == fStartContainer
- && fStartContainer.getNodeType() == Node.TEXT_NODE) {
- fStartOffset = 0;
- }
- if (node == fEndContainer
- && fEndContainer.getNodeType() == Node.TEXT_NODE) {
- fEndOffset = 0;
- }
-
- }
-
- /** This function is called from the DOM.
- * This node has already been inserted into the DOM.
- * Fix-up any offsets.
- */
- public void insertedNodeFromDOM(Node node) {
- if (node == null) return;
- if (fInsertNode == node) return;
- if (fInsertedFromRange) return; // Offsets are adjusted in Range.insertNode
-
- Node parent = node.getParentNode();
-
- if (parent == fStartContainer) {
- int index = indexOf(node, fStartContainer);
- if (index < fStartOffset) {
- fStartOffset++;
- }
- }
-
- if (parent == fEndContainer) {
- int index = indexOf(node, fEndContainer);
- if (index < fEndOffset) {
- fEndOffset++;
- }
- }
-
- }
-
- /** This function is called within Range
- * instead of Node.removeChild,
- * so that the range can remember that it is actively
- * removing this child.
- */
-
- Node fRemoveChild = null;
- Node removeChild(Node parent, Node child) {
- fRemoveChild = child;
- Node n = parent.removeChild(child);
- fRemoveChild = null;
- return n;
- }
-
- /** This function must be called by the DOM _BEFORE_
- * a node is deleted, because at that time it is
- * connected in the DOM tree, which we depend on.
- */
- void removeNode(Node node) {
- if (node == null) return;
- if (fRemoveChild == node) return;
-
- Node parent = node.getParentNode();
-
- if (parent == fStartContainer) {
- int index = indexOf(node, fStartContainer);
- if (index < fStartOffset) {
- fStartOffset--;
- }
- }
-
- if (parent == fEndContainer) {
- int index = indexOf(node, fEndContainer);
- if (index < fEndOffset) {
- fEndOffset--;
- }
- }
- //startContainer or endContainer or both is/are the ancestor(s) of the Node to be deleted
- if (parent != fStartContainer
- || parent != fEndContainer) {
- if (isAncestorOf(node, fStartContainer)) {
- fStartContainer = parent;
- fStartOffset = indexOf( node, parent);
- }
- if (isAncestorOf(node, fEndContainer)) {
- fEndContainer = parent;
- fEndOffset = indexOf( node, parent);
- }
- }
-
- }
-
- //
- // Utility functions.
- //
-
- // parameters for traverseContents(int)
- //REVIST: use boolean, since there are only 2 now...
- static final int EXTRACT_CONTENTS = 1;
- static final int CLONE_CONTENTS = 2;
- static final int DELETE_CONTENTS = 3;
-
- /**
- * This is the master routine invoked to visit the nodes
- * selected by this range. For each such node, different
- * actions are taken depending on the value of the
- * <code>how</code> argument.
- *
- * @param how Specifies what type of traversal is being
- * requested (extract, clone, or delete).
- * Legal values for this argument are:
- *
- * <ol>
- * <li><code>EXTRACT_CONTENTS</code> - will produce
- * a document fragment containing the range's content.
- * Partially selected nodes are copied, but fully
- * selected nodes are moved.
- *
- * <li><code>CLONE_CONTENTS</code> - will leave the
- * context tree of the range undisturbed, but sill
- * produced cloned content in a document fragment
- *
- * <li><code>DELETE_CONTENTS</code> - will delete from
- * the context tree of the range, all fully selected
- * nodes.
- * </ol>
- *
- * @return Returns a document fragment containing any
- * copied or extracted nodes. If the <code>how</code>
- * parameter was <code>DELETE_CONTENTS</code>, the
- * return value is null.
- */
- private DocumentFragment traverseContents( int how )
- throws DOMException
- {
- if (fStartContainer == null || fEndContainer == null) {
- return null; // REVIST: Throw exception?
- }
-
- //Check for a detached range.
- if( fDetach) {
- throw new DOMException(
- DOMException.INVALID_STATE_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
- }
-
- /*
- Traversal is accomplished by first determining the
- relationship between the endpoints of the range.
- For each of four significant relationships, we will
- delegate the traversal call to a method that
- can make appropriate assumptions.
- */
-
- // case 1: same container
- if ( fStartContainer == fEndContainer )
- return traverseSameContainer( how );
-
-
- // case 2: Child C of start container is ancestor of end container
- // This can be quickly tested by walking the parent chain of
- // end container
- int endContainerDepth = 0;
- for ( Node c = fEndContainer, p = c.getParentNode();
- p != null;
- c = p, p = p.getParentNode())
- {
- if (p == fStartContainer)
- return traverseCommonStartContainer( c, how );
- ++endContainerDepth;
- }
-
- // case 3: Child C of container B is ancestor of A
- // This can be quickly tested by walking the parent chain of A
- int startContainerDepth = 0;
- for ( Node c = fStartContainer, p = c.getParentNode();
- p != null;
- c = p, p = p.getParentNode())
- {
- if (p == fEndContainer)
- return traverseCommonEndContainer( c, how );
- ++startContainerDepth;
- }
-
- // case 4: There is a common ancestor container. Find the
- // ancestor siblings that are children of that container.
- int depthDiff = startContainerDepth - endContainerDepth;
-
- Node startNode = fStartContainer;
- while (depthDiff > 0) {
- startNode = startNode.getParentNode();
- depthDiff--;
- }
-
- Node endNode = fEndContainer;
- while (depthDiff < 0) {
- endNode = endNode.getParentNode();
- depthDiff++;
- }
-
- // ascend the ancestor hierarchy until we have a common parent.
- for( Node sp = startNode.getParentNode(), ep = endNode.getParentNode();
- sp!=ep;
- sp = sp.getParentNode(), ep = ep.getParentNode() )
- {
- startNode = sp;
- endNode = ep;
- }
- return traverseCommonAncestors( startNode, endNode, how );
- }
-
- /**
- * Visits the nodes selected by this range when we know
- * a-priori that the start and end containers are the same.
- * This method is invoked by the generic <code>traverse</code>
- * method.
- *
- * @param how Specifies what type of traversal is being
- * requested (extract, clone, or delete).
- * Legal values for this argument are:
- *
- * <ol>
- * <li><code>EXTRACT_CONTENTS</code> - will produce
- * a document fragment containing the range's content.
- * Partially selected nodes are copied, but fully
- * selected nodes are moved.
- *
- * <li><code>CLONE_CONTENTS</code> - will leave the
- * context tree of the range undisturbed, but sill
- * produced cloned content in a document fragment
- *
- * <li><code>DELETE_CONTENTS</code> - will delete from
- * the context tree of the range, all fully selected
- * nodes.
- * </ol>
- *
- * @return Returns a document fragment containing any
- * copied or extracted nodes. If the <code>how</code>
- * parameter was <code>DELETE_CONTENTS</code>, the
- * return value is null.
- */
- private DocumentFragment traverseSameContainer( int how )
- {
- DocumentFragment frag = null;
- if ( how!=DELETE_CONTENTS)
- frag = fDocument.createDocumentFragment();
-
- // If selection is empty, just return the fragment
- if ( fStartOffset==fEndOffset )
- return frag;
-
- // Text node needs special case handling
- if ( fStartContainer.getNodeType()==Node.TEXT_NODE )
- {
- // get the substring
- String s = fStartContainer.getNodeValue();
- String sub = s.substring( fStartOffset, fEndOffset );
-
- // set the original text node to its new value
- if ( how != CLONE_CONTENTS )
- {
- ((TextImpl)fStartContainer).deleteData(fStartOffset,
- fEndOffset-fStartOffset) ;
- // Nothing is partially selected, so collapse to start point
- collapse( true );
- }
- if ( how==DELETE_CONTENTS)
- return null;
- frag.appendChild( fDocument.createTextNode(sub) );
- return frag;
- }
-
- // Copy nodes between the start/end offsets.
- Node n = getSelectedNode( fStartContainer, fStartOffset );
- int cnt = fEndOffset - fStartOffset;
- while( cnt > 0 )
- {
- Node sibling = n.getNextSibling();
- Node xferNode = traverseFullySelected( n, how );
- if ( frag!=null )
- frag.appendChild( xferNode );
- --cnt;
- n = sibling;
- }
-
- // Nothing is partially selected, so collapse to start point
- if ( how != CLONE_CONTENTS )
- collapse( true );
- return frag;
- }
-
- /**
- * Visits the nodes selected by this range when we know
- * a-priori that the start and end containers are not the
- * same, but the start container is an ancestor of the
- * end container. This method is invoked by the generic
- * <code>traverse</code> method.
- *
- * @param endAncestor
- * The ancestor of the end container that is a direct child
- * of the start container.
- *
- * @param how Specifies what type of traversal is being
- * requested (extract, clone, or delete).
- * Legal values for this argument are:
- *
- * <ol>
- * <li><code>EXTRACT_CONTENTS</code> - will produce
- * a document fragment containing the range's content.
- * Partially selected nodes are copied, but fully
- * selected nodes are moved.
- *
- * <li><code>CLONE_CONTENTS</code> - will leave the
- * context tree of the range undisturbed, but sill
- * produced cloned content in a document fragment
- *
- * <li><code>DELETE_CONTENTS</code> - will delete from
- * the context tree of the range, all fully selected
- * nodes.
- * </ol>
- *
- * @return Returns a document fragment containing any
- * copied or extracted nodes. If the <code>how</code>
- * parameter was <code>DELETE_CONTENTS</code>, the
- * return value is null.
- */
- private DocumentFragment
- traverseCommonStartContainer( Node endAncestor, int how )
- {
- DocumentFragment frag = null;
- if ( how!=DELETE_CONTENTS)
- frag = fDocument.createDocumentFragment();
- Node n = traverseRightBoundary( endAncestor, how );
- if ( frag!=null )
- frag.appendChild( n );
-
- int endIdx = indexOf( endAncestor, fStartContainer );
- int cnt = endIdx - fStartOffset;
- if ( cnt <=0 )
- {
- // Collapse to just before the endAncestor, which
- // is partially selected.
- if ( how != CLONE_CONTENTS )
- {
- setEndBefore( endAncestor );
- collapse( false );
- }
- return frag;
- }
-
- n = endAncestor.getPreviousSibling();
- while( cnt > 0 )
- {
- Node sibling = n.getPreviousSibling();
- Node xferNode = traverseFullySelected( n, how );
- if ( frag!=null )
- frag.insertBefore( xferNode, frag.getFirstChild() );
- --cnt;
- n = sibling;
- }
- // Collapse to just before the endAncestor, which
- // is partially selected.
- if ( how != CLONE_CONTENTS )
- {
- setEndBefore( endAncestor );
- collapse( false );
- }
- return frag;
- }
-
- /**
- * Visits the nodes selected by this range when we know
- * a-priori that the start and end containers are not the
- * same, but the end container is an ancestor of the
- * start container. This method is invoked by the generic
- * <code>traverse</code> method.
- *
- * @param startAncestor
- * The ancestor of the start container that is a direct
- * child of the end container.
- *
- * @param how Specifies what type of traversal is being
- * requested (extract, clone, or delete).
- * Legal values for this argument are:
- *
- * <ol>
- * <li><code>EXTRACT_CONTENTS</code> - will produce
- * a document fragment containing the range's content.
- * Partially selected nodes are copied, but fully
- * selected nodes are moved.
- *
- * <li><code>CLONE_CONTENTS</code> - will leave the
- * context tree of the range undisturbed, but sill
- * produced cloned content in a document fragment
- *
- * <li><code>DELETE_CONTENTS</code> - will delete from
- * the context tree of the range, all fully selected
- * nodes.
- * </ol>
- *
- * @return Returns a document fragment containing any
- * copied or extracted nodes. If the <code>how</code>
- * parameter was <code>DELETE_CONTENTS</code>, the
- * return value is null.
- */
- private DocumentFragment
- traverseCommonEndContainer( Node startAncestor, int how )
- {
- DocumentFragment frag = null;
- if ( how!=DELETE_CONTENTS)
- frag = fDocument.createDocumentFragment();
- Node n = traverseLeftBoundary( startAncestor, how );
- if ( frag!=null )
- frag.appendChild( n );
- int startIdx = indexOf( startAncestor, fEndContainer );
- ++startIdx; // Because we already traversed it....
-
- int cnt = fEndOffset - startIdx;
- n = startAncestor.getNextSibling();
- while( cnt > 0 )
- {
- Node sibling = n.getNextSibling();
- Node xferNode = traverseFullySelected( n, how );
- if ( frag!=null )
- frag.appendChild( xferNode );
- --cnt;
- n = sibling;
- }
-
- if ( how != CLONE_CONTENTS )
- {
- setStartAfter( startAncestor );
- collapse( true );
- }
-
- return frag;
- }
-
- /**
- * Visits the nodes selected by this range when we know
- * a-priori that the start and end containers are not
- * the same, and we also know that neither the start
- * nor end container is an ancestor of the other.
- * This method is invoked by
- * the generic <code>traverse</code> method.
- *
- * @param startAncestor
- * Given a common ancestor of the start and end containers,
- * this parameter is the ancestor (or self) of the start
- * container that is a direct child of the common ancestor.
- *
- * @param endAncestor
- * Given a common ancestor of the start and end containers,
- * this parameter is the ancestor (or self) of the end
- * container that is a direct child of the common ancestor.
- *
- * @param how Specifies what type of traversal is being
- * requested (extract, clone, or delete).
- * Legal values for this argument are:
- *
- * <ol>
- * <li><code>EXTRACT_CONTENTS</code> - will produce
- * a document fragment containing the range's content.
- * Partially selected nodes are copied, but fully
- * selected nodes are moved.
- *
- * <li><code>CLONE_CONTENTS</code> - will leave the
- * context tree of the range undisturbed, but sill
- * produced cloned content in a document fragment
- *
- * <li><code>DELETE_CONTENTS</code> - will delete from
- * the context tree of the range, all fully selected
- * nodes.
- * </ol>
- *
- * @return Returns a document fragment containing any
- * copied or extracted nodes. If the <code>how</code>
- * parameter was <code>DELETE_CONTENTS</code>, the
- * return value is null.
- */
- private DocumentFragment
- traverseCommonAncestors( Node startAncestor, Node endAncestor, int how )
- {
- DocumentFragment frag = null;
- if ( how!=DELETE_CONTENTS)
- frag = fDocument.createDocumentFragment();
-
- Node n = traverseLeftBoundary( startAncestor, how );
- if ( frag!=null )
- frag.appendChild( n );
-
- Node commonParent = startAncestor.getParentNode();
- int startOffset = indexOf( startAncestor, commonParent );
- int endOffset = indexOf( endAncestor, commonParent );
- ++startOffset;
-
- int cnt = endOffset - startOffset;
- Node sibling = startAncestor.getNextSibling();
-
- while( cnt > 0 )
- {
- Node nextSibling = sibling.getNextSibling();
- n = traverseFullySelected( sibling, how );
- if ( frag!=null )
- frag.appendChild( n );
- sibling = nextSibling;
- --cnt;
- }
-
- n = traverseRightBoundary( endAncestor, how );
- if ( frag!=null )
- frag.appendChild( n );
-
- if ( how != CLONE_CONTENTS )
- {
- setStartAfter( startAncestor );
- collapse( true );
- }
- return frag;
- }
-
- /**
- * Traverses the "right boundary" of this range and
- * operates on each "boundary node" according to the
- * <code>how</code> parameter. It is a-priori assumed
- * by this method that the right boundary does
- * not contain the range's start container.
- * <p>
- * A "right boundary" is best visualized by thinking
- * of a sample tree:<pre>
- * A
- * /|\
- * / | \
- * / | \
- * B C D
- * /|\ /|\
- * E F G H I J
- * </pre>
- * Imagine first a range that begins between the
- * "E" and "F" nodes and ends between the
- * "I" and "J" nodes. The start container is
- * "B" and the end container is "D". Given this setup,
- * the following applies:
- * <p>
- * Partially Selected Nodes: B, D<br>
- * Fully Selected Nodes: F, G, C, H, I
- * <p>
- * The "right boundary" is the highest subtree node
- * that contains the ending container. The root of
- * this subtree is always partially selected.
- * <p>
- * In this example, the nodes that are traversed
- * as "right boundary" nodes are: H, I, and D.
- *
- * @param root The node that is the root of the "right boundary" subtree.
- *
- * @param how Specifies what type of traversal is being
- * requested (extract, clone, or delete).
- * Legal values for this argument are:
- *
- * <ol>
- * <li><code>EXTRACT_CONTENTS</code> - will produce
- * a node containing the boundaries content.
- * Partially selected nodes are copied, but fully
- * selected nodes are moved.
- *
- * <li><code>CLONE_CONTENTS</code> - will leave the
- * context tree of the range undisturbed, but will
- * produced cloned content.
- *
- * <li><code>DELETE_CONTENTS</code> - will delete from
- * the context tree of the range, all fully selected
- * nodes within the boundary.
- * </ol>
- *
- * @return Returns a node that is the result of visiting nodes.
- * If the traversal operation is
- * <code>DELETE_CONTENTS</code> the return value is null.
- */
- private Node traverseRightBoundary( Node root, int how )
- {
- Node next = getSelectedNode( fEndContainer, fEndOffset-1 );
- boolean isFullySelected = ( next!=fEndContainer );
-
- if ( next==root )
- return traverseNode( next, isFullySelected, false, how );
-
- Node parent = next.getParentNode();
- Node clonedParent = traverseNode( parent, false, false, how );
-
- while( parent!=null )
- {
- while( next!=null )
- {
- Node prevSibling = next.getPreviousSibling();
- Node clonedChild =
- traverseNode( next, isFullySelected, false, how );
- if ( how!=DELETE_CONTENTS )
- {
- clonedParent.insertBefore(
- clonedChild,
- clonedParent.getFirstChild()
- );
- }
- isFullySelected = true;
- next = prevSibling;
- }
- if ( parent==root )
- return clonedParent;
-
- next = parent.getPreviousSibling();
- parent = parent.getParentNode();
- Node clonedGrandParent = traverseNode( parent, false, false, how );
- if ( how!=DELETE_CONTENTS )
- clonedGrandParent.appendChild( clonedParent );
- clonedParent = clonedGrandParent;
-
- }
-
- // should never occur
- return null;
- }
-
- /**
- * Traverses the "left boundary" of this range and
- * operates on each "boundary node" according to the
- * <code>how</code> parameter. It is a-priori assumed
- * by this method that the left boundary does
- * not contain the range's end container.
- * <p>
- * A "left boundary" is best visualized by thinking
- * of a sample tree:<pre>
- *
- * A
- * /|\
- * / | \
- * / | \
- * B C D
- * /|\ /|\
- * E F G H I J
- * </pre>
- * Imagine first a range that begins between the
- * "E" and "F" nodes and ends between the
- * "I" and "J" nodes. The start container is
- * "B" and the end container is "D". Given this setup,
- * the following applies:
- * <p>
- * Partially Selected Nodes: B, D<br>
- * Fully Selected Nodes: F, G, C, H, I
- * <p>
- * The "left boundary" is the highest subtree node
- * that contains the starting container. The root of
- * this subtree is always partially selected.
- * <p>
- * In this example, the nodes that are traversed
- * as "left boundary" nodes are: F, G, and B.
- *
- * @param root The node that is the root of the "left boundary" subtree.
- *
- * @param how Specifies what type of traversal is being
- * requested (extract, clone, or delete).
- * Legal values for this argument are:
- *
- * <ol>
- * <li><code>EXTRACT_CONTENTS</code> - will produce
- * a node containing the boundaries content.
- * Partially selected nodes are copied, but fully
- * selected nodes are moved.
- *
- * <li><code>CLONE_CONTENTS</code> - will leave the
- * context tree of the range undisturbed, but will
- * produced cloned content.
- *
- * <li><code>DELETE_CONTENTS</code> - will delete from
- * the context tree of the range, all fully selected
- * nodes within the boundary.
- * </ol>
- *
- * @return Returns a node that is the result of visiting nodes.
- * If the traversal operation is
- * <code>DELETE_CONTENTS</code> the return value is null.
- */
- private Node traverseLeftBoundary( Node root, int how )
- {
- Node next = getSelectedNode( getStartContainer(), getStartOffset() );
- boolean isFullySelected = ( next!=getStartContainer() );
-
- if ( next==root )
- return traverseNode( next, isFullySelected, true, how );
-
- Node parent = next.getParentNode();
- Node clonedParent = traverseNode( parent, false, true, how );
-
- while( parent!=null )
- {
- while( next!=null )
- {
- Node nextSibling = next.getNextSibling();
- Node clonedChild =
- traverseNode( next, isFullySelected, true, how );
- if ( how!=DELETE_CONTENTS )
- clonedParent.appendChild(clonedChild);
- isFullySelected = true;
- next = nextSibling;
- }
- if ( parent==root )
- return clonedParent;
-
- next = parent.getNextSibling();
- parent = parent.getParentNode();
- Node clonedGrandParent = traverseNode( parent, false, true, how );
- if ( how!=DELETE_CONTENTS )
- clonedGrandParent.appendChild( clonedParent );
- clonedParent = clonedGrandParent;
-
- }
-
- // should never occur
- return null;
-
- }
-
- /**
- * Utility method for traversing a single node.
- * Does not properly handle a text node containing both the
- * start and end offsets. Such nodes should
- * have been previously detected and been routed to traverseTextNode.
- *
- * @param n The node to be traversed.
- *
- * @param isFullySelected
- * Set to true if the node is fully selected. Should be
- * false otherwise.
- * Note that although the DOM 2 specification says that a
- * text node that is boththe start and end container is not
- * selected, we treat it here as if it were partially
- * selected.
- *
- * @param isLeft Is true if we are traversing the node as part of navigating
- * the "left boundary" of the range. If this value is false,
- * it implies we are navigating the "right boundary" of the
- * range.
- *
- * @param how Specifies what type of traversal is being
- * requested (extract, clone, or delete).
- * Legal values for this argument are:
- *
- * <ol>
- * <li><code>EXTRACT_CONTENTS</code> - will simply
- * return the original node.
- *
- * <li><code>CLONE_CONTENTS</code> - will leave the
- * context tree of the range undisturbed, but will
- * return a cloned node.
- *
- * <li><code>DELETE_CONTENTS</code> - will delete the
- * node from it's parent, but will return null.
- * </ol>
- *
- * @return Returns a node that is the result of visiting the node.
- * If the traversal operation is
- * <code>DELETE_CONTENTS</code> the return value is null.
- */
- private Node traverseNode( Node n, boolean isFullySelected, boolean isLeft, int how )
- {
- if ( isFullySelected )
- return traverseFullySelected( n, how );
- if ( n.getNodeType()==Node.TEXT_NODE )
- return traverseTextNode( n, isLeft, how );
- return traversePartiallySelected( n, how );
- }
-
- /**
- * Utility method for traversing a single node when
- * we know a-priori that the node if fully
- * selected.
- *
- * @param n The node to be traversed.
- *
- * @param how Specifies what type of traversal is being
- * requested (extract, clone, or delete).
- * Legal values for this argument are:
- *
- * <ol>
- * <li><code>EXTRACT_CONTENTS</code> - will simply
- * return the original node.
- *
- * <li><code>CLONE_CONTENTS</code> - will leave the
- * context tree of the range undisturbed, but will
- * return a cloned node.
- *
- * <li><code>DELETE_CONTENTS</code> - will delete the
- * node from it's parent, but will return null.
- * </ol>
- *
- * @return Returns a node that is the result of visiting the node.
- * If the traversal operation is
- * <code>DELETE_CONTENTS</code> the return value is null.
- */
- private Node traverseFullySelected( Node n, int how )
- {
- switch( how )
- {
- case CLONE_CONTENTS:
- return n.cloneNode( true );
- case EXTRACT_CONTENTS:
- if ( n.getNodeType()==Node.DOCUMENT_TYPE_NODE )
- {
- // TBD: This should be a HIERARCHY_REQUEST_ERR
- throw new DOMException(
- DOMException.HIERARCHY_REQUEST_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "HIERARCHY_REQUEST_ERR", null));
- }
- return n;
- case DELETE_CONTENTS:
- n.getParentNode().removeChild(n);
- return null;
- }
- return null;
- }
-
- /**
- * Utility method for traversing a single node when
- * we know a-priori that the node if partially
- * selected and is not a text node.
- *
- * @param n The node to be traversed.
- *
- * @param how Specifies what type of traversal is being
- * requested (extract, clone, or delete).
- * Legal values for this argument are:
- *
- * <ol>
- * <li><code>EXTRACT_CONTENTS</code> - will simply
- * return the original node.
- *
- * <li><code>CLONE_CONTENTS</code> - will leave the
- * context tree of the range undisturbed, but will
- * return a cloned node.
- *
- * <li><code>DELETE_CONTENTS</code> - will delete the
- * node from it's parent, but will return null.
- * </ol>
- *
- * @return Returns a node that is the result of visiting the node.
- * If the traversal operation is
- * <code>DELETE_CONTENTS</code> the return value is null.
- */
- private Node traversePartiallySelected( Node n, int how )
- {
- switch( how )
- {
- case DELETE_CONTENTS:
- return null;
- case CLONE_CONTENTS:
- case EXTRACT_CONTENTS:
- return n.cloneNode( false );
- }
- return null;
- }
-
- /**
- * Utility method for traversing a text node that we know
- * a-priori to be on a left or right boundary of the range.
- * This method does not properly handle text nodes that contain
- * both the start and end points of the range.
- *
- * @param n The node to be traversed.
- *
- * @param isLeft Is true if we are traversing the node as part of navigating
- * the "left boundary" of the range. If this value is false,
- * it implies we are navigating the "right boundary" of the
- * range.
- *
- * @param how Specifies what type of traversal is being
- * requested (extract, clone, or delete).
- * Legal values for this argument are:
- *
- * <ol>
- * <li><code>EXTRACT_CONTENTS</code> - will simply
- * return the original node.
- *
- * <li><code>CLONE_CONTENTS</code> - will leave the
- * context tree of the range undisturbed, but will
- * return a cloned node.
- *
- * <li><code>DELETE_CONTENTS</code> - will delete the
- * node from it's parent, but will return null.
- * </ol>
- *
- * @return Returns a node that is the result of visiting the node.
- * If the traversal operation is
- * <code>DELETE_CONTENTS</code> the return value is null.
- */
- private Node traverseTextNode( Node n, boolean isLeft, int how )
- {
- String txtValue = n.getNodeValue();
- String newNodeValue;
- String oldNodeValue;
-
- if ( isLeft )
- {
- int offset = getStartOffset();
- newNodeValue = txtValue.substring( offset );
- oldNodeValue = txtValue.substring( 0, offset );
- }
- else
- {
- int offset = getEndOffset();
- newNodeValue = txtValue.substring( 0, offset );
- oldNodeValue = txtValue.substring( offset );
- }
-
- if ( how != CLONE_CONTENTS )
- n.setNodeValue( oldNodeValue );
- if ( how==DELETE_CONTENTS )
- return null;
- Node newNode = n.cloneNode( false );
- newNode.setNodeValue( newNodeValue );
- return newNode;
- }
-
- void checkIndex(Node refNode, int offset) throws DOMException
- {
- if (offset < 0) {
- throw new DOMException(
- DOMException.INDEX_SIZE_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INDEX_SIZE_ERR", null));
- }
-
- int type = refNode.getNodeType();
-
- // If the node contains text, ensure that the
- // offset of the range is <= to the length of the text
- if (type == Node.TEXT_NODE
- || type == Node.CDATA_SECTION_NODE
- || type == Node.COMMENT_NODE
- || type == Node.PROCESSING_INSTRUCTION_NODE) {
- if (offset > refNode.getNodeValue().length()) {
- throw new DOMException(DOMException.INDEX_SIZE_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INDEX_SIZE_ERR", null));
- }
- }
- else {
- // Since the node is not text, ensure that the offset
- // is valid with respect to the number of child nodes
- if (offset > refNode.getChildNodes().getLength()) {
- throw new DOMException(DOMException.INDEX_SIZE_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INDEX_SIZE_ERR", null));
- }
- }
- }
-
- /**
- * Given a node, calculate what the Range's root container
- * for that node would be.
- */
- private Node getRootContainer( Node node )
- {
- if ( node==null )
- return null;
-
- while( node.getParentNode()!=null )
- node = node.getParentNode();
- return node;
- }
-
- /**
- * Returns true IFF the given node can serve as a container
- * for a range's boundary points.
- */
- private boolean isLegalContainer( Node node )
- {
- if ( node==null )
- return false;
-
- while( node!=null )
- {
- switch( node.getNodeType() )
- {
- case Node.ENTITY_NODE:
- case Node.NOTATION_NODE:
- case Node.DOCUMENT_TYPE_NODE:
- return false;
- }
- node = node.getParentNode();
- }
-
- return true;
- }
-
-
- /**
- * Finds the root container for the given node and determines
- * if that root container is legal with respect to the
- * DOM 2 specification. At present, that means the root
- * container must be either an attribute, a document,
- * or a document fragment.
- */
- private boolean hasLegalRootContainer( Node node )
- {
- if ( node==null )
- return false;
-
- Node rootContainer = getRootContainer( node );
- switch( rootContainer.getNodeType() )
- {
- case Node.ATTRIBUTE_NODE:
- case Node.DOCUMENT_NODE:
- case Node.DOCUMENT_FRAGMENT_NODE:
- return true;
- }
- return false;
- }
-
- /**
- * Returns true IFF the given node can be contained by
- * a range.
- */
- private boolean isLegalContainedNode( Node node )
- {
- if ( node==null )
- return false;
- switch( node.getNodeType() )
- {
- case Node.DOCUMENT_NODE:
- case Node.DOCUMENT_FRAGMENT_NODE:
- case Node.ATTRIBUTE_NODE:
- case Node.ENTITY_NODE:
- case Node.NOTATION_NODE:
- return false;
- }
- return true;
- }
-
- Node nextNode(Node node, boolean visitChildren) {
-
- if (node == null) return null;
-
- Node result;
- if (visitChildren) {
- result = node.getFirstChild();
- if (result != null) {
- return result;
- }
- }
-
- // if hasSibling, return sibling
- result = node.getNextSibling();
- if (result != null) {
- return result;
- }
-
-
- // return parent's 1st sibling.
- Node parent = node.getParentNode();
- while (parent != null
- && parent != fDocument
- ) {
- result = parent.getNextSibling();
- if (result != null) {
- return result;
- } else {
- parent = parent.getParentNode();
- }
-
- } // while (parent != null && parent != fRoot) {
-
- // end of list, return null
- return null;
- }
-
- /** is a an ancestor of b ? */
- boolean isAncestorOf(Node a, Node b) {
- for (Node node=b; node != null; node=node.getParentNode()) {
- if (node == a) return true;
- }
- return false;
- }
-
- /** what is the index of the child in the parent */
- int indexOf(Node child, Node parent) {
- if (child.getParentNode() != parent) return -1;
- int i = 0;
- for(Node node = parent.getFirstChild(); node!= child; node=node.getNextSibling()) {
- i++;
- }
- return i;
- }
-
- /**
- * Utility method to retrieve a child node by index. This method
- * assumes the caller is trying to find out which node is
- * selected by the given index. Note that if the index is
- * greater than the number of children, this implies that the
- * first node selected is the parent node itself.
- *
- * @param container A container node
- *
- * @param offset An offset within the container for which a selected node should
- * be computed. If the offset is less than zero, or if the offset
- * is greater than the number of children, the container is returned.
- *
- * @return Returns either a child node of the container or the
- * container itself.
- */
- private Node getSelectedNode( Node container, int offset )
- {
- if ( container.getNodeType() == Node.TEXT_NODE )
- return container;
-
- // This case is an important convenience for
- // traverseRightBoundary()
- if ( offset<0 )
- return container;
-
- Node child = container.getFirstChild();
- while( child!=null && offset > 0 )
- {
- --offset;
- child = child.getNextSibling();
- }
- if ( child!=null )
- return child;
- return container;
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/dom/TextImpl.java b/src/com/sun/org/apache/xerces/internal/dom/TextImpl.java
deleted file mode 100644
index 367ae65..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/TextImpl.java
+++ /dev/null
@@ -1,665 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-import org.w3c.dom.CharacterData;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-/**
- * Text nodes hold the non-markup, non-Entity content of
- * an Element or Attribute.
- * <P>
- * When a document is first made available to the DOM, there is only
- * one Text object for each block of adjacent plain-text. Users (ie,
- * applications) may create multiple adjacent Texts during editing --
- * see {@link org.w3c.dom.Element#normalize} for discussion.
- * <P>
- * Note that CDATASection is a subclass of Text. This is conceptually
- * valid, since they're really just two different ways of quoting
- * characters when they're written out as part of an XML stream.
- *
- * @xerces.internal
- *
- * @since PR-DOM-Level-1-19980818.
- */
-public class TextImpl
- extends CharacterDataImpl
- implements CharacterData, Text {
-
- //
- // Private Data members
- //
-
-
- //
- // Constants
- //
-
- /** Serialization version. */
- static final long serialVersionUID = -5294980852957403469L;
-
- //
- // Constructors
- //
-
- /** Default constructor */
- public TextImpl(){}
-
- /** Factory constructor. */
- public TextImpl(CoreDocumentImpl ownerDoc, String data) {
- super(ownerDoc, data);
- }
-
- /**
- * NON-DOM: resets node and sets specified values for the current node
- *
- * @param ownerDoc
- * @param data
- */
- public void setValues(CoreDocumentImpl ownerDoc, String data){
-
- flags=0;
- nextSibling = null;
- previousSibling=null;
- setOwnerDocument(ownerDoc);
- super.data = data;
- }
- //
- // Node methods
- //
-
- /**
- * A short integer indicating what type of node this is. The named
- * constants for this value are defined in the org.w3c.dom.Node interface.
- */
- public short getNodeType() {
- return Node.TEXT_NODE;
- }
-
- /** Returns the node name. */
- public String getNodeName() {
- return "#text";
- }
-
- /**
- * NON-DOM: Set whether this Text is ignorable whitespace.
- */
- public void setIgnorableWhitespace(boolean ignore) {
-
- if (needsSyncData()) {
- synchronizeData();
- }
- isIgnorableWhitespace(ignore);
-
- } // setIgnorableWhitespace(boolean)
-
-
- /**
- * DOM L3 Core CR - Experimental
- *
- * Returns whether this text node contains
- * element content whitespace</a>, often abusively called "ignorable whitespace".
- * The text node is determined to contain whitespace in element content
- * during the load of the document or if validation occurs while using
- * <code>Document.normalizeDocument()</code>.
- * @since DOM Level 3
- */
- public boolean isElementContentWhitespace() {
- // REVISIT: is this implemenation correct?
- if (needsSyncData()) {
- synchronizeData();
- }
- return internalIsIgnorableWhitespace();
- }
-
-
- /**
- * DOM Level 3 WD - Experimental.
- * Returns all text of <code>Text</code> nodes logically-adjacent text
- * nodes to this node, concatenated in document order.
- * @since DOM Level 3
- */
- public String getWholeText(){
-
- if (needsSyncData()) {
- synchronizeData();
- }
-
- if (fBufferStr == null){
- fBufferStr = new StringBuffer();
- }
- else {
- fBufferStr.setLength(0);
- }
- if (data != null && data.length() != 0) {
- fBufferStr.append(data);
- }
-
- //concatenate text of logically adjacent text nodes to the left of this node in the tree
- getWholeTextBackward(this.getPreviousSibling(), fBufferStr, this.getParentNode());
- String temp = fBufferStr.toString();
-
- //clear buffer
- fBufferStr.setLength(0);
-
- //concatenate text of logically adjacent text nodes to the right of this node in the tree
- getWholeTextForward(this.getNextSibling(), fBufferStr, this.getParentNode());
-
- return temp + fBufferStr.toString();
-
- }
-
- /**
- * internal method taking a StringBuffer in parameter and inserts the
- * text content at the start of the buffer
- *
- * @param buf
- */
- protected void insertTextContent(StringBuffer buf) throws DOMException {
- String content = getNodeValue();
- if (content != null) {
- buf.insert(0, content);
- }
- }
-
- /**
- * Concatenates the text of all logically-adjacent text nodes to the
- * right of this node
- * @param node
- * @param buffer
- * @param parent
- * @return true - if execution was stopped because the type of node
- * other than EntityRef, Text, CDATA is encountered, otherwise
- * return false
- */
- private boolean getWholeTextForward(Node node, StringBuffer buffer, Node parent){
- // boolean to indicate whether node is a child of an entity reference
- boolean inEntRef = false;
-
- if (parent!=null) {
- inEntRef = parent.getNodeType()==Node.ENTITY_REFERENCE_NODE;
- }
-
- while (node != null) {
- short type = node.getNodeType();
- if (type == Node.ENTITY_REFERENCE_NODE) {
- if (getWholeTextForward(node.getFirstChild(), buffer, node)){
- return true;
- }
- }
- else if (type == Node.TEXT_NODE ||
- type == Node.CDATA_SECTION_NODE) {
- ((NodeImpl)node).getTextContent(buffer);
- }
- else {
- return true;
- }
-
- node = node.getNextSibling();
- }
-
- // if the parent node is an entity reference node, must
- // check nodes to the right of the parent entity reference node for logically adjacent
- // text nodes
- if (inEntRef) {
- getWholeTextForward(parent.getNextSibling(), buffer, parent.getParentNode());
- return true;
- }
-
- return false;
- }
-
- /**
- * Concatenates the text of all logically-adjacent text nodes to the left of
- * the node
- * @param node
- * @param buffer
- * @param parent
- * @return true - if execution was stopped because the type of node
- * other than EntityRef, Text, CDATA is encountered, otherwise
- * return false
- */
- private boolean getWholeTextBackward(Node node, StringBuffer buffer, Node parent){
-
- // boolean to indicate whether node is a child of an entity reference
- boolean inEntRef = false;
- if (parent!=null) {
- inEntRef = parent.getNodeType()==Node.ENTITY_REFERENCE_NODE;
- }
-
- while (node != null) {
- short type = node.getNodeType();
- if (type == Node.ENTITY_REFERENCE_NODE) {
- if (getWholeTextBackward(node.getLastChild(), buffer, node)){
- return true;
- }
- }
- else if (type == Node.TEXT_NODE ||
- type == Node.CDATA_SECTION_NODE) {
- ((TextImpl)node).insertTextContent(buffer);
- }
- else {
- return true;
- }
-
- node = node.getPreviousSibling();
- }
-
- // if the parent node is an entity reference node, must
- // check nodes to the left of the parent entity reference node for logically adjacent
- // text nodes
- if (inEntRef) {
- getWholeTextBackward(parent.getPreviousSibling(), buffer, parent.getParentNode());
- return true;
- }
-
- return false;
- }
-
- /**
- * Replaces the text of the current node and all logically-adjacent text
- * nodes with the specified text. All logically-adjacent text nodes are
- * removed including the current node unless it was the recipient of the
- * replacement text.
- *
- * @param content
- * The content of the replacing Text node.
- * @return text - The Text node created with the specified content.
- * @since DOM Level 3
- */
- public Text replaceWholeText(String content) throws DOMException {
-
- if (needsSyncData()) {
- synchronizeData();
- }
-
- //if the content is null
- Node parent = this.getParentNode();
- if (content == null || content.length() == 0) {
- // remove current node
- if (parent != null) { // check if node in the tree
- parent.removeChild(this);
- }
- return null;
- }
-
- // make sure we can make the replacement
- if (ownerDocument().errorChecking) {
- if (!canModifyPrev(this)) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "NO_MODIFICATION_ALLOWED_ERR", null));
- }
-
- // make sure we can make the replacement
- if (!canModifyNext(this)) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "NO_MODIFICATION_ALLOWED_ERR", null));
- }
- }
-
- //replace the text node
- Text currentNode = null;
- if (isReadOnly()) {
- Text newNode = this.ownerDocument().createTextNode(content);
- if (parent != null) { // check if node in the tree
- parent.insertBefore(newNode, this);
- parent.removeChild(this);
- currentNode = newNode;
- } else {
- return newNode;
- }
- } else {
- this.setData(content);
- currentNode = this;
- }
-
- //check logically-adjacent text nodes
- Node prev = currentNode.getPreviousSibling();
- while (prev != null) {
- //If the logically-adjacent next node can be removed
- //remove it. A logically adjacent node can be removed if
- //it is a Text or CDATASection node or an EntityReference with
- //Text and CDATA only children.
- if ((prev.getNodeType() == Node.TEXT_NODE)
- || (prev.getNodeType() == Node.CDATA_SECTION_NODE)
- || (prev.getNodeType() == Node.ENTITY_REFERENCE_NODE && hasTextOnlyChildren(prev))) {
- parent.removeChild(prev);
- prev = currentNode;
- } else {
- break;
- }
- prev = prev.getPreviousSibling();
- }
-
- //check logically-adjacent text nodes
- Node next = currentNode.getNextSibling();
- while (next != null) {
- //If the logically-adjacent next node can be removed
- //remove it. A logically adjacent node can be removed if
- //it is a Text or CDATASection node or an EntityReference with
- //Text and CDATA only children.
- if ((next.getNodeType() == Node.TEXT_NODE)
- || (next.getNodeType() == Node.CDATA_SECTION_NODE)
- || (next.getNodeType() == Node.ENTITY_REFERENCE_NODE && hasTextOnlyChildren(next))) {
- parent.removeChild(next);
- next = currentNode;
- } else {
- break;
- }
- next = next.getNextSibling();
- }
-
- return currentNode;
- }
-
- /**
- * If any EntityReference to be removed has descendants that are not
- * EntityReference, Text, or CDATASection nodes, the replaceWholeText method
- * must fail before performing any modification of the document, raising a
- * DOMException with the code NO_MODIFICATION_ALLOWED_ERR. Traverse previous
- * siblings of the node to be replaced. If a previous sibling is an
- * EntityReference node, get it's last child. If the last child was a Text
- * or CDATASection node and its previous siblings are neither a replaceable
- * EntityReference or Text or CDATASection nodes, return false. IF the last
- * child was neither Text nor CDATASection nor a replaceable EntityReference
- * Node, then return true. If the last child was a Text or CDATASection node
- * any its previous sibling was not or was an EntityReference that did not
- * contain only Text or CDATASection nodes, return false. Check this
- * recursively for EntityReference nodes.
- *
- * @param node
- * @return true - can replace text false - can't replace exception must be
- * raised
- */
- private boolean canModifyPrev(Node node) {
- boolean textLastChild = false;
-
- Node prev = node.getPreviousSibling();
-
- while (prev != null) {
-
- short type = prev.getNodeType();
-
- if (type == Node.ENTITY_REFERENCE_NODE) {
- //If the previous sibling was entityreference
- //check if its content is replaceable
- Node lastChild = prev.getLastChild();
-
- //if the entity reference has no children
- //return false
- if (lastChild == null) {
- return false;
- }
-
- //The replacement text of the entity reference should
- //be either only text,cadatsections or replaceable entity
- //reference nodes or the last child should be neither of these
- while (lastChild != null) {
- short lType = lastChild.getNodeType();
-
- if (lType == Node.TEXT_NODE
- || lType == Node.CDATA_SECTION_NODE) {
- textLastChild = true;
- } else if (lType == Node.ENTITY_REFERENCE_NODE) {
- if (!canModifyPrev(lastChild)) {
- return false;
- } else {
- //If the EntityReference child contains
- //only text, or non-text or ends with a
- //non-text node.
- textLastChild = true;
- }
- } else {
- //If the last child was replaceable and others are not
- //Text or CDataSection or replaceable EntityRef nodes
- //return false.
- if (textLastChild) {
- return false;
- } else {
- return true;
- }
- }
- lastChild = lastChild.getPreviousSibling();
- }
- } else if (type == Node.TEXT_NODE
- || type == Node.CDATA_SECTION_NODE) {
- //If the previous sibling was text or cdatasection move to next
- } else {
- //If the previous sibling was anything but text or
- //cdatasection or an entity reference, stop search and
- //return true
- return true;
- }
-
- prev = prev.getPreviousSibling();
- }
-
- return true;
- }
-
- /**
- * If any EntityReference to be removed has descendants that are not
- * EntityReference, Text, or CDATASection nodes, the replaceWholeText method
- * must fail before performing any modification of the document, raising a
- * DOMException with the code NO_MODIFICATION_ALLOWED_ERR. Traverse previous
- * siblings of the node to be replaced. If a previous sibling is an
- * EntityReference node, get it's last child. If the first child was a Text
- * or CDATASection node and its next siblings are neither a replaceable
- * EntityReference or Text or CDATASection nodes, return false. IF the first
- * child was neither Text nor CDATASection nor a replaceable EntityReference
- * Node, then return true. If the first child was a Text or CDATASection
- * node any its next sibling was not or was an EntityReference that did not
- * contain only Text or CDATASection nodes, return false. Check this
- * recursively for EntityReference nodes.
- *
- * @param node
- * @return true - can replace text false - can't replace exception must be
- * raised
- */
- private boolean canModifyNext(Node node) {
- boolean textFirstChild = false;
-
- Node next = node.getNextSibling();
- while (next != null) {
-
- short type = next.getNodeType();
-
- if (type == Node.ENTITY_REFERENCE_NODE) {
- //If the previous sibling was entityreference
- //check if its content is replaceable
- Node firstChild = next.getFirstChild();
-
- //if the entity reference has no children
- //return false
- if (firstChild == null) {
- return false;
- }
-
- //The replacement text of the entity reference should
- //be either only text,cadatsections or replaceable entity
- //reference nodes or the last child should be neither of these
- while (firstChild != null) {
- short lType = firstChild.getNodeType();
-
- if (lType == Node.TEXT_NODE
- || lType == Node.CDATA_SECTION_NODE) {
- textFirstChild = true;
- } else if (lType == Node.ENTITY_REFERENCE_NODE) {
- if (!canModifyNext(firstChild)) {
- return false;
- } else {
- //If the EntityReference child contains
- //only text, or non-text or ends with a
- //non-text node.
- textFirstChild = true;
- }
- } else {
- //If the first child was replaceable text and next
- //children are not, then return false
- if (textFirstChild) {
- return false;
- } else {
- return true;
- }
- }
- firstChild = firstChild.getNextSibling();
- }
- } else if (type == Node.TEXT_NODE
- || type == Node.CDATA_SECTION_NODE) {
- //If the previous sibling was text or cdatasection move to next
- } else {
- //If the next sibling was anything but text or
- //cdatasection or an entity reference, stop search and
- //return true
- return true;
- }
-
- next = next.getNextSibling();
- }
-
- return true;
- }
-
- /**
- * Check if an EntityReference node has Text Only child nodes
- *
- * @param node
- * @return true - Contains text only children
- */
- private boolean hasTextOnlyChildren(Node node) {
-
- Node child = node;
-
- if (child == null) {
- return false;
- }
-
- child = child.getFirstChild();
- while (child != null) {
- int type = child.getNodeType();
-
- if (type == Node.ENTITY_REFERENCE_NODE) {
- return hasTextOnlyChildren(child);
- }
- else if (type != Node.TEXT_NODE
- && type != Node.CDATA_SECTION_NODE
- && type != Node.ENTITY_REFERENCE_NODE) {
- return false;
- }
- child = child.getNextSibling();
- }
- return true;
- }
-
-
- /**
- * NON-DOM: Returns whether this Text is ignorable whitespace.
- */
- public boolean isIgnorableWhitespace() {
-
- if (needsSyncData()) {
- synchronizeData();
- }
- return internalIsIgnorableWhitespace();
-
- } // isIgnorableWhitespace():boolean
-
-
- //
- // Text methods
- //
-
- /**
- * Break a text node into two sibling nodes. (Note that if the current node
- * has no parent, they won't wind up as "siblings" -- they'll both be
- * orphans.)
- *
- * @param offset
- * The offset at which to split. If offset is at the end of the
- * available data, the second node will be empty.
- *
- * @return A reference to the new node (containing data after the offset
- * point). The original node will contain data up to that point.
- *
- * @throws DOMException(INDEX_SIZE_ERR)
- * if offset is <0 or >length.
- *
- * @throws DOMException(NO_MODIFICATION_ALLOWED_ERR)
- * if node is read-only.
- */
- public Text splitText(int offset)
- throws DOMException {
-
- if (isReadOnly()) {
- throw new DOMException(
- DOMException.NO_MODIFICATION_ALLOWED_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null));
- }
-
- if (needsSyncData()) {
- synchronizeData();
- }
- if (offset < 0 || offset > data.length() ) {
- throw new DOMException(DOMException.INDEX_SIZE_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INDEX_SIZE_ERR", null));
- }
-
- // split text into two separate nodes
- Text newText =
- getOwnerDocument().createTextNode(data.substring(offset));
- setNodeValue(data.substring(0, offset));
-
- // insert new text node
- Node parentNode = getParentNode();
- if (parentNode != null) {
- parentNode.insertBefore(newText, nextSibling);
- }
-
- return newText;
-
- } // splitText(int):Text
-
-
- /**
- * NON-DOM (used by DOMParser): Reset data for the node.
- */
- public void replaceData (String value){
- data = value;
- }
-
-
- /**
- * NON-DOM (used by DOMParser: Sets data to empty string.
- * Returns the value the data was set to.
- */
- public String removeData (){
- String olddata=data;
- data = "";
- return olddata;
- }
-
-} // class TextImpl
diff --git a/src/com/sun/org/apache/xerces/internal/dom/TreeWalkerImpl.java b/src/com/sun/org/apache/xerces/internal/dom/TreeWalkerImpl.java
deleted file mode 100644
index 20533dd..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/TreeWalkerImpl.java
+++ /dev/null
@@ -1,507 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom;
-
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Node;
-import org.w3c.dom.traversal.NodeFilter;
-import org.w3c.dom.traversal.TreeWalker;
-
-/** This class implements the TreeWalker interface.
- *
- * @xerces.internal
- *
- */
-
-public class TreeWalkerImpl implements TreeWalker {
-
- //
- // Data
- //
-
- /** When TRUE, the children of entites references are returned in the iterator. */
- private boolean fEntityReferenceExpansion = false;
- /** The whatToShow mask. */
- int fWhatToShow = NodeFilter.SHOW_ALL;
- /** The NodeFilter reference. */
- NodeFilter fNodeFilter;
- /** The current Node. */
- Node fCurrentNode;
- /** The root Node. */
- Node fRoot;
-
- //
- // Implementation Note: No state is kept except the data above
- // (fWhatToShow, fNodeFilter, fCurrentNode, fRoot) such that
- // setters could be created for these data values and the
- // implementation will still work.
-
-
- //
- // Constructor
- //
-
- /** Public constructor */
- public TreeWalkerImpl(Node root,
- int whatToShow,
- NodeFilter nodeFilter,
- boolean entityReferenceExpansion) {
- fCurrentNode = root;
- fRoot = root;
- fWhatToShow = whatToShow;
- fNodeFilter = nodeFilter;
- fEntityReferenceExpansion = entityReferenceExpansion;
- }
-
- public Node getRoot() {
- return fRoot;
- }
-
- /** Return the whatToShow value */
- public int getWhatToShow() {
- return fWhatToShow;
- }
-
- public void setWhatShow(int whatToShow){
- fWhatToShow = whatToShow;
- }
- /** Return the NodeFilter */
- public NodeFilter getFilter() {
- return fNodeFilter;
- }
-
- /** Return whether children entity references are included in the iterator. */
- public boolean getExpandEntityReferences() {
- return fEntityReferenceExpansion;
- }
-
- /** Return the current Node. */
- public Node getCurrentNode() {
- return fCurrentNode;
- }
- /** Return the current Node. */
- public void setCurrentNode(Node node) {
- if (node == null) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
- }
-
- fCurrentNode = node;
- }
-
- /** Return the parent Node from the current node,
- * after applying filter, whatToshow.
- * If result is not null, set the current Node.
- */
- public Node parentNode() {
-
- if (fCurrentNode == null) return null;
-
- Node node = getParentNode(fCurrentNode);
- if (node !=null) {
- fCurrentNode = node;
- }
- return node;
-
- }
-
- /** Return the first child Node from the current node,
- * after applying filter, whatToshow.
- * If result is not null, set the current Node.
- */
- public Node firstChild() {
-
- if (fCurrentNode == null) return null;
-
- Node node = getFirstChild(fCurrentNode);
- if (node !=null) {
- fCurrentNode = node;
- }
- return node;
- }
- /** Return the last child Node from the current node,
- * after applying filter, whatToshow.
- * If result is not null, set the current Node.
- */
- public Node lastChild() {
-
- if (fCurrentNode == null) return null;
-
- Node node = getLastChild(fCurrentNode);
- if (node !=null) {
- fCurrentNode = node;
- }
- return node;
- }
-
- /** Return the previous sibling Node from the current node,
- * after applying filter, whatToshow.
- * If result is not null, set the current Node.
- */
- public Node previousSibling() {
-
- if (fCurrentNode == null) return null;
-
- Node node = getPreviousSibling(fCurrentNode);
- if (node !=null) {
- fCurrentNode = node;
- }
- return node;
- }
-
- /** Return the next sibling Node from the current node,
- * after applying filter, whatToshow.
- * If result is not null, set the current Node.
- */
- public Node nextSibling(){
- if (fCurrentNode == null) return null;
-
- Node node = getNextSibling(fCurrentNode);
- if (node !=null) {
- fCurrentNode = node;
- }
- return node;
- }
-
- /** Return the previous Node from the current node,
- * after applying filter, whatToshow.
- * If result is not null, set the current Node.
- */
- public Node previousNode() {
- Node result;
-
- if (fCurrentNode == null) return null;
-
- // get sibling
- result = getPreviousSibling(fCurrentNode);
- if (result == null) {
- result = getParentNode(fCurrentNode);
- if (result != null) {
- fCurrentNode = result;
- return fCurrentNode;
- }
- return null;
- }
-
- // get the lastChild of result.
- Node lastChild = getLastChild(result);
-
- Node prev = lastChild ;
- while (lastChild != null) {
- prev = lastChild ;
- lastChild = getLastChild(prev) ;
- }
-
- lastChild = prev ;
-
- // if there is a lastChild which passes filters return it.
- if (lastChild != null) {
- fCurrentNode = lastChild;
- return fCurrentNode;
- }
-
- // otherwise return the previous sibling.
- if (result != null) {
- fCurrentNode = result;
- return fCurrentNode;
- }
-
- // otherwise return null.
- return null;
- }
-
- /** Return the next Node from the current node,
- * after applying filter, whatToshow.
- * If result is not null, set the current Node.
- */
- public Node nextNode() {
-
- if (fCurrentNode == null) return null;
-
- Node result = getFirstChild(fCurrentNode);
-
- if (result != null) {
- fCurrentNode = result;
- return result;
- }
-
- result = getNextSibling(fCurrentNode);
-
- if (result != null) {
- fCurrentNode = result;
- return result;
- }
-
- // return parent's 1st sibling.
- Node parent = getParentNode(fCurrentNode);
- while (parent != null) {
- result = getNextSibling(parent);
- if (result != null) {
- fCurrentNode = result;
- return result;
- } else {
- parent = getParentNode(parent);
- }
- }
-
- // end , return null
- return null;
- }
-
- /** Internal function.
- * Return the parent Node, from the input node
- * after applying filter, whatToshow.
- * The current node is not consulted or set.
- */
- Node getParentNode(Node node) {
-
- if (node == null || node == fRoot) return null;
-
- Node newNode = node.getParentNode();
- if (newNode == null) return null;
-
- int accept = acceptNode(newNode);
-
- if (accept == NodeFilter.FILTER_ACCEPT)
- return newNode;
- else
- //if (accept == NodeFilter.SKIP_NODE) // and REJECT too.
- {
- return getParentNode(newNode);
- }
-
-
- }
-
- /** Internal function.
- * Return the nextSibling Node, from the input node
- * after applying filter, whatToshow.
- * The current node is not consulted or set.
- */
- Node getNextSibling(Node node) {
- return getNextSibling(node, fRoot);
- }
-
- /** Internal function.
- * Return the nextSibling Node, from the input node
- * after applying filter, whatToshow.
- * NEVER TRAVERSES ABOVE THE SPECIFIED ROOT NODE.
- * The current node is not consulted or set.
- */
- Node getNextSibling(Node node, Node root) {
-
- if (node == null || node == root) return null;
-
- Node newNode = node.getNextSibling();
- if (newNode == null) {
-
- newNode = node.getParentNode();
-
- if (newNode == null || newNode == root) return null;
-
- int parentAccept = acceptNode(newNode);
-
- if (parentAccept==NodeFilter.FILTER_SKIP) {
- return getNextSibling(newNode, root);
- }
-
- return null;
- }
-
- int accept = acceptNode(newNode);
-
- if (accept == NodeFilter.FILTER_ACCEPT)
- return newNode;
- else
- if (accept == NodeFilter.FILTER_SKIP) {
- Node fChild = getFirstChild(newNode);
- if (fChild == null) {
- return getNextSibling(newNode, root);
- }
- return fChild;
- }
- else
- //if (accept == NodeFilter.REJECT_NODE)
- {
- return getNextSibling(newNode, root);
- }
-
- } // getNextSibling(Node node) {
-
- /** Internal function.
- * Return the previous sibling Node, from the input node
- * after applying filter, whatToshow.
- * The current node is not consulted or set.
- */
- Node getPreviousSibling(Node node) {
- return getPreviousSibling(node, fRoot);
- }
-
- /** Internal function.
- * Return the previousSibling Node, from the input node
- * after applying filter, whatToshow.
- * NEVER TRAVERSES ABOVE THE SPECIFIED ROOT NODE.
- * The current node is not consulted or set.
- */
- Node getPreviousSibling(Node node, Node root) {
-
- if (node == null || node == root) return null;
-
- Node newNode = node.getPreviousSibling();
- if (newNode == null) {
-
- newNode = node.getParentNode();
- if (newNode == null || newNode == root) return null;
-
- int parentAccept = acceptNode(newNode);
-
- if (parentAccept==NodeFilter.FILTER_SKIP) {
- return getPreviousSibling(newNode, root);
- }
-
- return null;
- }
-
- int accept = acceptNode(newNode);
-
- if (accept == NodeFilter.FILTER_ACCEPT)
- return newNode;
- else
- if (accept == NodeFilter.FILTER_SKIP) {
- Node fChild = getLastChild(newNode);
- if (fChild == null) {
- return getPreviousSibling(newNode, root);
- }
- return fChild;
- }
- else
- //if (accept == NodeFilter.REJECT_NODE)
- {
- return getPreviousSibling(newNode, root);
- }
-
- } // getPreviousSibling(Node node) {
-
- /** Internal function.
- * Return the first child Node, from the input node
- * after applying filter, whatToshow.
- * The current node is not consulted or set.
- */
- Node getFirstChild(Node node) {
- if (node == null) return null;
-
- if ( !fEntityReferenceExpansion
- && node.getNodeType() == Node.ENTITY_REFERENCE_NODE)
- return null;
- Node newNode = node.getFirstChild();
- if (newNode == null) return null;
- int accept = acceptNode(newNode);
-
- if (accept == NodeFilter.FILTER_ACCEPT)
- return newNode;
- else
- if (accept == NodeFilter.FILTER_SKIP
- && newNode.hasChildNodes())
- {
- Node fChild = getFirstChild(newNode);
-
- if (fChild == null) {
- return getNextSibling(newNode, node);
- }
- return fChild;
- }
- else
- //if (accept == NodeFilter.REJECT_NODE)
- {
- return getNextSibling(newNode, node);
- }
-
-
- }
-
- /** Internal function.
- * Return the last child Node, from the input node
- * after applying filter, whatToshow.
- * The current node is not consulted or set.
- */
- Node getLastChild(Node node) {
-
- if (node == null) return null;
-
- if ( !fEntityReferenceExpansion
- && node.getNodeType() == Node.ENTITY_REFERENCE_NODE)
- return null;
-
- Node newNode = node.getLastChild();
- if (newNode == null) return null;
-
- int accept = acceptNode(newNode);
-
- if (accept == NodeFilter.FILTER_ACCEPT)
- return newNode;
- else
- if (accept == NodeFilter.FILTER_SKIP
- && newNode.hasChildNodes())
- {
- Node lChild = getLastChild(newNode);
- if (lChild == null) {
- return getPreviousSibling(newNode, node);
- }
- return lChild;
- }
- else
- //if (accept == NodeFilter.REJECT_NODE)
- {
- return getPreviousSibling(newNode, node);
- }
-
-
- }
-
- /** Internal function.
- * The node whatToShow and the filter are combined into one result. */
- short acceptNode(Node node) {
- /***
- 7.1.2.4. Filters and whatToShow flags
-
- Iterator and TreeWalker apply whatToShow flags before applying Filters. If a node is rejected by the
- active whatToShow flags, a Filter will not be called to evaluate that node. When a node is rejected by
- the active whatToShow flags, children of that node will still be considered, and Filters may be called to
- evaluate them.
- ***/
-
- if (fNodeFilter == null) {
- if ( ( fWhatToShow & (1 << node.getNodeType()-1)) != 0) {
- return NodeFilter.FILTER_ACCEPT;
- } else {
- return NodeFilter.FILTER_SKIP;
- }
- } else {
- if ((fWhatToShow & (1 << node.getNodeType()-1)) != 0 ) {
- return fNodeFilter.acceptNode(node);
- } else {
- // What to show has failed. See above excerpt from spec.
- // Equivalent to FILTER_SKIP.
- return NodeFilter.FILTER_SKIP;
- }
- }
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/dom/events/EventImpl.java b/src/com/sun/org/apache/xerces/internal/dom/events/EventImpl.java
deleted file mode 100644
index 83a085e..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/events/EventImpl.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xerces.internal.dom.events;
-
-import org.w3c.dom.events.Event;
-import org.w3c.dom.events.EventTarget;
-
-/**
- * EventImpl is an implementation of the basic "generic" DOM Level 2 Event
- * object. It may be subclassed by more specialized event sets.
- * Note that in our implementation, events are re-dispatchable (dispatch
- * clears the stopPropagation and preventDefault flags before it starts);
- * I believe that is the DOM's intent but I don't see an explicit statement
- * to this effect.
- *
- * @xerces.internal
- *
- */
-public class EventImpl implements Event
-{
- public String type=null;
- public EventTarget target;
- public EventTarget currentTarget;
- public short eventPhase;
- public boolean initialized=false, bubbles=true, cancelable=false;
- public boolean stopPropagation=false, preventDefault=false;
-
- protected long timeStamp = System.currentTimeMillis();
-
- /** The DOM doesn't deal with constructors, so instead we have an
- initializer call to set most of the read-only fields. The
- others are set, and reset, by the event subsystem during dispatch.
- <p>
- Note that init() -- and the subclass-specific initWhatever() calls --
- may be reinvoked. At least one initialization is required; repeated
- initializations overwrite the event with new values of their
- parameters.
- */
- public void initEvent(String eventTypeArg, boolean canBubbleArg,
- boolean cancelableArg)
- {
- type=eventTypeArg;
- bubbles=canBubbleArg;
- cancelable=cancelableArg;
-
- initialized=true;
- }
-
- /** @return true iff this Event is of a class and type which supports
- bubbling. In the generic case, this is True.
- */
- public boolean getBubbles()
- {
- return bubbles;
- }
-
- /** @return true iff this Event is of a class and type which (a) has a
- Default Behavior in this DOM, and (b)allows cancellation (blocking)
- of that behavior. In the generic case, this is False.
- */
- public boolean getCancelable()
- {
- return cancelable;
- }
-
- /** @return the Node (EventTarget) whose EventListeners are currently
- being processed. During capture and bubble phases, this may not be
- the target node. */
- public EventTarget getCurrentTarget()
- {
- return currentTarget;
- }
-
- /** @return the current processing phase for this event --
- CAPTURING_PHASE, AT_TARGET, BUBBLING_PHASE. (There may be
- an internal DEFAULT_PHASE as well, but the users won't see it.) */
- public short getEventPhase()
- {
- return eventPhase;
- }
-
- /** @return the EventTarget (Node) to which the event was originally
- dispatched.
- */
- public EventTarget getTarget()
- {
- return target;
- }
-
- /** @return event name as a string
- */
- public String getType()
- {
- return type;
- }
-
- public long getTimeStamp() {
- return timeStamp;
- }
-
- /** Causes exit from in-progress event dispatch before the next
- currentTarget is selected. Replaces the preventBubble() and
- preventCapture() methods which were present in early drafts;
- they may be reintroduced in future levels of the DOM. */
- public void stopPropagation()
- {
- stopPropagation=true;
- }
-
- /** Prevents any default processing built into the target node from
- occurring.
- */
- public void preventDefault()
- {
- preventDefault=true;
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/dom/events/MutationEventImpl.java b/src/com/sun/org/apache/xerces/internal/dom/events/MutationEventImpl.java
deleted file mode 100644
index 3287034..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/events/MutationEventImpl.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.dom.events;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.events.MutationEvent;
-
-/**
- * @xerces.internal
- *
- */
-
-public class MutationEventImpl
-extends com.sun.org.apache.xerces.internal.dom.events.EventImpl
-implements MutationEvent
-{
- Node relatedNode=null;
- String prevValue=null,newValue=null,attrName=null;
- // REVISIT: The DOM Level 2 PR has a bug: the init method should let this
- // attribute be specified. Since it doesn't we have to give write access.
- public short attrChange;
-
- // NON-DOM CONSTANTS: Storage efficiency, avoid risk of typos.
- public static final String DOM_SUBTREE_MODIFIED = "DOMSubtreeModified";
- public static final String DOM_NODE_INSERTED = "DOMNodeInserted";
- public static final String DOM_NODE_REMOVED = "DOMNodeRemoved";
- public static final String DOM_NODE_REMOVED_FROM_DOCUMENT = "DOMNodeRemovedFromDocument";
- public static final String DOM_NODE_INSERTED_INTO_DOCUMENT = "DOMNodeInsertedIntoDocument";
- public static final String DOM_ATTR_MODIFIED = "DOMAttrModified";
- public static final String DOM_CHARACTER_DATA_MODIFIED = "DOMCharacterDataModified";
-
- /** @return the name of the Attr which
- changed, for DOMAttrModified events.
- Undefined for others.
- */
- public String getAttrName()
- {
- return attrName;
- }
-
- /**
- * <code>attrChange</code> indicates the type of change which triggered
- * the DOMAttrModified event. The values can be <code>MODIFICATION</code>
- * , <code>ADDITION</code>, or <code>REMOVAL</code>.
- */
- public short getAttrChange()
- {
- return attrChange;
- }
-
- /** @return the new string value of the Attr for DOMAttrModified events, or
- of the CharacterData node for DOMCharDataModifed events.
- Undefined for others.
- */
- public String getNewValue()
- {
- return newValue;
- }
-
- /** @return the previous string value of the Attr for DOMAttrModified events, or
- of the CharacterData node for DOMCharDataModifed events.
- Undefined for others.
- */
- public String getPrevValue()
- {
- return prevValue;
- }
-
- /** @return a Node related to this event, other than the target that the
- node was dispatched to. For DOMNodeRemoved, it is the node which
- was removed.
- No other uses are currently defined.
- */
- public Node getRelatedNode()
- {
- return relatedNode;
- }
-
- /** Initialize a mutation event, or overwrite the event's current
- settings with new values of the parameters.
- */
- public void initMutationEvent(String typeArg, boolean canBubbleArg,
- boolean cancelableArg, Node relatedNodeArg, String prevValueArg,
- String newValueArg, String attrNameArg, short attrChangeArg)
- {
- relatedNode=relatedNodeArg;
- prevValue=prevValueArg;
- newValue=newValueArg;
- attrName=attrNameArg;
- attrChange=attrChangeArg;
- super.initEvent(typeArg,canBubbleArg,cancelableArg);
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/dom/org.apache.xerces.dom.DOMImplementationSourceImpl b/src/com/sun/org/apache/xerces/internal/dom/org.apache.xerces.dom.DOMImplementationSourceImpl
deleted file mode 100644
index 79c33dd..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/org.apache.xerces.dom.DOMImplementationSourceImpl
+++ /dev/null
@@ -1 +0,0 @@
-com.sun.org.apache.xerces.internal.dom.DOMImplementationSourceImpl
diff --git a/src/com/sun/org/apache/xerces/internal/dom/org.w3c.dom.DOMImplementationSourceList b/src/com/sun/org/apache/xerces/internal/dom/org.w3c.dom.DOMImplementationSourceList
deleted file mode 100644
index 814f031..0000000
--- a/src/com/sun/org/apache/xerces/internal/dom/org.w3c.dom.DOMImplementationSourceList
+++ /dev/null
@@ -1 +0,0 @@
-com.sun.org.apache.xerces.internal.dom.DOMXSImplementationSourceImpl
diff --git a/src/com/sun/org/apache/xerces/internal/impl/Constants.java b/src/com/sun/org/apache/xerces/internal/impl/Constants.java
deleted file mode 100644
index c5355a0..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/Constants.java
+++ /dev/null
@@ -1,941 +0,0 @@
-/*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
- */
-
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl;
-
-import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
-import java.util.Enumeration;
-import java.util.NoSuchElementException;
-
-/**
- * Commonly used constants.
- *
- * @xerces.internal
- *
- * @author Andy Clark, IBM
- *
- * @version $Id: Constants.java,v 1.14 2010-11-01 04:39:40 joehw Exp $
- */
-public final class Constants {
-
- //
- // Constants
- //
- // Schema Types:
- public static final String NS_XMLSCHEMA = "http://www.w3.org/2001/XMLSchema".intern();
- public static final String NS_DTD = "http://www.w3.org/TR/REC-xml".intern();
-
- // Schema features
- public static final String SUN_SCHEMA_FEATURE_PREFIX = "http://java.sun.com/xml/schema/features/";
- public static final String SUN_REPORT_IGNORED_ELEMENT_CONTENT_WHITESPACE = "report-ignored-element-content-whitespace";
-
- //stax properties
-
- public static final String ZEPHYR_PROPERTY_PREFIX = "http://java.sun.com/xml/stream/properties/" ;
- public static final String STAX_PROPERTIES = "stax-properties" ;
- public static final String STAX_ENTITY_RESOLVER_PROPERTY = "internal/stax-entity-resolver";
- public static final String STAX_REPORT_CDATA_EVENT = "report-cdata-event";
- public static final String READER_IN_DEFINED_STATE = ZEPHYR_PROPERTY_PREFIX + "reader-in-defined-state" ;
- public static final String ADD_NAMESPACE_DECL_AS_ATTRIBUTE = "add-namespacedecl-as-attrbiute";
- public static final String ESCAPE_CHARACTERS = "escapeCharacters";
- public static final String REUSE_INSTANCE = "reuse-instance" ;
-
- //DOM properties
- public static final String SUN_DOM_PROPERTY_PREFIX = "http://java.sun.com/xml/dom/properties/" ;
- public static final String SUN_DOM_ANCESTOR_CHECCK = "ancestor-check";
-
- /**
- * If true, ignore DOCTYPE declaration as if it wasn't present at all.
- * Note that this is a violation of the XML recommendation.
- * The full property name is prefixed by {@link #ZEPHYR_PROPERTY_PREFIX}.
- */
- public static final String IGNORE_EXTERNAL_DTD = "ignore-external-dtd";
-
- // sax features
-
- /** SAX feature prefix ("http://xml.org/sax/features/"). */
- public static final String SAX_FEATURE_PREFIX = "http://xml.org/sax/features/";
-
- public static final String NAMESPACES_FEATURE = "namespaces";
-
- /** Namespace prefixes feature ("namespace-prefixes"). */
- public static final String NAMESPACE_PREFIXES_FEATURE = "namespace-prefixes";
-
- /** String interning feature ("string-interning"). */
- public static final String STRING_INTERNING_FEATURE = "string-interning";
-
- /** Validation feature ("validation"). */
- public static final String VALIDATION_FEATURE = "validation";
-
- /** External general entities feature ("external-general-entities "). */
- public static final String EXTERNAL_GENERAL_ENTITIES_FEATURE = "external-general-entities";
-
- /** External parameter entities feature ("external-parameter-entities "). */
- public static final String EXTERNAL_PARAMETER_ENTITIES_FEATURE = "external-parameter-entities";
-
- /** Lexical handler parameter entities feature ("lexical-handler/parameter-entities"). */
- public static final String LEXICAL_HANDLER_PARAMETER_ENTITIES_FEATURE = "lexical-handler/parameter-entities";
-
- /** Is standalone feature ("is-standalone"). */
- public static final String IS_STANDALONE_FEATURE = "is-standalone";
-
- /** Resolve DTD URIs feature ("resolve-dtd-uris"). */
- public static final String RESOLVE_DTD_URIS_FEATURE = "resolve-dtd-uris";
-
- /** Use Attributes2 feature ("use-attributes2"). */
- public static final String USE_ATTRIBUTES2_FEATURE = "use-attributes2";
-
- /** Use Locator2 feature ("use-locator2"). */
- public static final String USE_LOCATOR2_FEATURE = "use-locator2";
-
- /** Use EntityResolver2 feature ("use-entity-resolver2"). */
- public static final String USE_ENTITY_RESOLVER2_FEATURE = "use-entity-resolver2";
-
- /** Unicode normalization checking feature ("unicode-normalization-checking"). */
- public static final String UNICODE_NORMALIZATION_CHECKING_FEATURE = "unicode-normalization-checking";
-
- /** xmlns URIs feature ("xmlns-uris"). */
- public static final String XMLNS_URIS_FEATURE = "xmlns-uris";
-
- /** XML 1.1 feature ("xml-1.1"). */
- public static final String XML_11_FEATURE = "xml-1.1";
-
- /** Allow unparsed entity and notation declaration events to be sent after the end DTD event ("allow-dtd-events-after-endDTD") */
- public static final String ALLOW_DTD_EVENTS_AFTER_ENDDTD_FEATURE = "allow-dtd-events-after-endDTD";
-
- // sax properties
-
- /** SAX property prefix ("http://xml.org/sax/properties/"). */
- public static final String SAX_PROPERTY_PREFIX = "http://xml.org/sax/properties/";
-
- /** Declaration handler property ("declaration-handler"). */
- public static final String DECLARATION_HANDLER_PROPERTY = "declaration-handler";
-
- /** Lexical handler property ("lexical-handler"). */
- public static final String LEXICAL_HANDLER_PROPERTY = "lexical-handler";
-
- /** DOM node property ("dom-node"). */
- public static final String DOM_NODE_PROPERTY = "dom-node";
-
- /** XML string property ("xml-string"). */
- public static final String XML_STRING_PROPERTY = "xml-string";
-
- public static final String FEATURE_SECURE_PROCESSING = "http://javax.xml.XMLConstants/feature/secure-processing";
-
- // Oracle Feature:
- /**
- * <p>Use Service Mechanism</p>
- *
- * <ul>
- * <li>
- * {@code true} instruct an object to use service mechanism to
- * find a service implementation. This is the default behavior.
- * </li>
- * <li>
- * {@code false} instruct an object to skip service mechanism and
- * use the default implementation for that service.
- * </li>
- * </ul>
- */
- public static final String ORACLE_FEATURE_SERVICE_MECHANISM = "http://www.oracle.com/feature/use-service-mechanism";
-
- /** Document XML version property ("document-xml-version"). */
- public static final String DOCUMENT_XML_VERSION_PROPERTY = "document-xml-version";
-
-
- //
- // JAXP properties
- //
-
- /** JAXP property prefix ("http://java.sun.com/xml/jaxp/properties/"). */
- public static final String JAXP_PROPERTY_PREFIX =
- "http://java.sun.com/xml/jaxp/properties/";
-
- /** JAXP schemaSource property: when used internally may include DTD sources (DOM) */
- public static final String SCHEMA_SOURCE = "schemaSource";
-
- /** JAXP schemaSource language: when used internally may include DTD namespace (DOM) */
- public static final String SCHEMA_LANGUAGE = "schemaLanguage";
-
- /** JAXP Standard property prefix ("http://javax.xml.XMLConstants/property/"). */
- public static final String JAXPAPI_PROPERTY_PREFIX =
- "http://javax.xml.XMLConstants/property/";
-
- /** Oracle JAXP property prefix ("http://www.oracle.com/xml/jaxp/properties/"). */
- public static final String ORACLE_JAXP_PROPERTY_PREFIX =
- "http://www.oracle.com/xml/jaxp/properties/";
-
- public static final String XML_SECURITY_PROPERTY_MANAGER =
- ORACLE_JAXP_PROPERTY_PREFIX + "xmlSecurityPropertyManager";
-
- //System Properties corresponding to ACCESS_EXTERNAL_* properties
- public static final String SP_ACCESS_EXTERNAL_DTD = "javax.xml.accessExternalDTD";
- public static final String SP_ACCESS_EXTERNAL_SCHEMA = "javax.xml.accessExternalSchema";
- //all access keyword
- public static final String ACCESS_EXTERNAL_ALL = "all";
-
- /**
- * Default value when FEATURE_SECURE_PROCESSING (FSP) is set to true
- */
- public static final String EXTERNAL_ACCESS_DEFAULT_FSP = "";
-
- /**
- * FEATURE_SECURE_PROCESSING (FSP) is true by default
- */
- public static final String EXTERNAL_ACCESS_DEFAULT = ACCESS_EXTERNAL_ALL;
-
- /**
- * Check if we're in jdk8 or above
- */
- public static final boolean IS_JDK8_OR_ABOVE = isJavaVersionAtLeast(8);
-
- //
- // Implementation limits: corresponding System Properties of the above
- // API properties
- //
- /**
- * JDK entity expansion limit; Note that the existing system property
- * "entityExpansionLimit" with no prefix is still observed
- */
- public static final String JDK_ENTITY_EXPANSION_LIMIT =
- ORACLE_JAXP_PROPERTY_PREFIX + "entityExpansionLimit";
-
- /**
- * JDK element attribute limit; Note that the existing system property
- * "elementAttributeLimit" with no prefix is still observed
- */
- public static final String JDK_ELEMENT_ATTRIBUTE_LIMIT =
- ORACLE_JAXP_PROPERTY_PREFIX + "elementAttributeLimit";
-
- /**
- * JDK maxOccur limit; Note that the existing system property
- * "maxOccurLimit" with no prefix is still observed
- */
- public static final String JDK_MAX_OCCUR_LIMIT =
- ORACLE_JAXP_PROPERTY_PREFIX + "maxOccurLimit";
-
- /**
- * JDK total entity size limit
- */
- public static final String JDK_TOTAL_ENTITY_SIZE_LIMIT =
- ORACLE_JAXP_PROPERTY_PREFIX + "totalEntitySizeLimit";
-
- /**
- * JDK maximum general entity size limit
- */
- public static final String JDK_GENERAL_ENTITY_SIZE_LIMIT =
- ORACLE_JAXP_PROPERTY_PREFIX + "maxGeneralEntitySizeLimit";
-
- /**
- * JDK node count limit in entities that limits the total number of nodes
- * in all of entity references.
- */
- public static final String JDK_ENTITY_REPLACEMENT_LIMIT =
- ORACLE_JAXP_PROPERTY_PREFIX + "entityReplacementLimit";
-
- /**
- * JDK maximum parameter entity size limit
- */
- public static final String JDK_PARAMETER_ENTITY_SIZE_LIMIT =
- ORACLE_JAXP_PROPERTY_PREFIX + "maxParameterEntitySizeLimit";
- /**
- * JDK maximum XML name limit
- */
- public static final String JDK_XML_NAME_LIMIT =
- ORACLE_JAXP_PROPERTY_PREFIX + "maxXMLNameLimit";
-
- /**
- * JDK maxElementDepth limit
- */
- public static final String JDK_MAX_ELEMENT_DEPTH =
- ORACLE_JAXP_PROPERTY_PREFIX + "maxElementDepth";
-
- /**
- * JDK property to allow printing out information from the limit analyzer
- */
- public static final String JDK_ENTITY_COUNT_INFO =
- ORACLE_JAXP_PROPERTY_PREFIX + "getEntityCountInfo";
-
- //
- // Implementation limits: API properties
- //
- /**
- * JDK entity expansion limit; Note that the existing system property
- * "entityExpansionLimit" with no prefix is still observed
- */
- public static final String SP_ENTITY_EXPANSION_LIMIT = "jdk.xml.entityExpansionLimit";
-
- /**
- * JDK element attribute limit; Note that the existing system property
- * "elementAttributeLimit" with no prefix is still observed
- */
- public static final String SP_ELEMENT_ATTRIBUTE_LIMIT = "jdk.xml.elementAttributeLimit";
-
- /**
- * JDK maxOccur limit; Note that the existing system property
- * "maxOccurLimit" with no prefix is still observed
- */
- public static final String SP_MAX_OCCUR_LIMIT = "jdk.xml.maxOccurLimit";
-
- /**
- * JDK total entity size limit
- */
- public static final String SP_TOTAL_ENTITY_SIZE_LIMIT = "jdk.xml.totalEntitySizeLimit";
-
- /**
- * JDK maximum general entity size limit
- */
- public static final String SP_GENERAL_ENTITY_SIZE_LIMIT = "jdk.xml.maxGeneralEntitySizeLimit";
-
- /**
- * JDK node count limit in entities that limits the total number of nodes
- * in all of entity references.
- */
- public static final String SP_ENTITY_REPLACEMENT_LIMIT = "jdk.xml.entityReplacementLimit";
-
- /**
- * JDK maximum parameter entity size limit
- */
- public static final String SP_PARAMETER_ENTITY_SIZE_LIMIT = "jdk.xml.maxParameterEntitySizeLimit";
- /**
- * JDK maximum XML name limit
- */
- public static final String SP_XML_NAME_LIMIT = "jdk.xml.maxXMLNameLimit";
-
- /**
- * JDK maxElementDepth limit
- */
- public static final String SP_MAX_ELEMENT_DEPTH = "jdk.xml.maxElementDepth";
-
- //legacy System Properties
- public final static String ENTITY_EXPANSION_LIMIT = "entityExpansionLimit";
- public static final String ELEMENT_ATTRIBUTE_LIMIT = "elementAttributeLimit" ;
- public final static String MAX_OCCUR_LIMIT = "maxOccurLimit";
-
- /**
- * A string "yes" that can be used for properties such as getEntityCountInfo
- */
- public static final String JDK_YES = "yes";
-
- //
- // DOM features
- //
-
- /** Comments feature ("include-comments"). */
- public static final String INCLUDE_COMMENTS_FEATURE = "include-comments";
-
- /** Create cdata nodes feature ("create-cdata-nodes"). */
- public static final String CREATE_CDATA_NODES_FEATURE = "create-cdata-nodes";
-
- /** Feature id: load as infoset. */
- public static final String LOAD_AS_INFOSET = "load-as-infoset";
-
-
- //
- // Constants: DOM Level 3 feature ids
- //
-
- public static final String DOM_CANONICAL_FORM = "canonical-form";
- public static final String DOM_CDATA_SECTIONS ="cdata-sections";
-
- public static final String DOM_COMMENTS = "comments";
-
- // REVISIT: this feature seems to have no effect for Xerces
-
- public static final String DOM_CHARSET_OVERRIDES_XML_ENCODING =
- "charset-overrides-xml-encoding";
-
- public static final String DOM_DATATYPE_NORMALIZATION = "datatype-normalization";
-
- public static final String DOM_ENTITIES = "entities";
- public static final String DOM_INFOSET = "infoset";
- public static final String DOM_NAMESPACES = "namespaces";
- public static final String DOM_NAMESPACE_DECLARATIONS = "namespace-declarations";
- public static final String DOM_SUPPORTED_MEDIATYPES_ONLY =
- "supported-media-types-only";
-
- public static final String DOM_VALIDATE_IF_SCHEMA = "validate-if-schema";
- public static final String DOM_VALIDATE = "validate";
- public static final String DOM_ELEMENT_CONTENT_WHITESPACE =
- "element-content-whitespace";
-
- // DOM Level 3 features defined in Core:
- public static final String DOM_DISCARD_DEFAULT_CONTENT = "discard-default-content";
- public static final String DOM_NORMALIZE_CHARACTERS = "normalize-characters";
- public static final String DOM_CHECK_CHAR_NORMALIZATION = "check-character-normalization";
- public static final String DOM_WELLFORMED = "well-formed";
- public static final String DOM_SPLIT_CDATA = "split-cdata-sections";
-
- // Load and Save
- public static final String DOM_FORMAT_PRETTY_PRINT = "format-pretty-print";
- public static final String DOM_XMLDECL = "xml-declaration";
- public static final String DOM_UNKNOWNCHARS = "unknown-characters";
- public static final String DOM_CERTIFIED = "certified";
- public static final String DOM_DISALLOW_DOCTYPE = "disallow-doctype";
- public static final String DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS = "ignore-unknown-character-denormalizations";
-
- // DOM Properties
- public static final String DOM_RESOURCE_RESOLVER = "resource-resolver";
- public static final String DOM_ERROR_HANDLER = "error-handler";
- public static final String DOM_SCHEMA_TYPE = "schema-type";
- public static final String DOM_SCHEMA_LOCATION = "schema-location";
- public static final String DOM_ANCESTOR_CHECCK = "ancestor-check";
- // XSModel
- public static final String DOM_PSVI = "psvi";
-
-
- // xerces features
-
- /** Xerces features prefix ("http://apache.org/xml/features/"). */
- public static final String XERCES_FEATURE_PREFIX = "http://apache.org/xml/features/";
-
- /** Schema validation feature ("validation/schema"). */
- public static final String SCHEMA_VALIDATION_FEATURE = "validation/schema";
-
- /** Expose schema normalized values */
- public static final String SCHEMA_NORMALIZED_VALUE = "validation/schema/normalized-value";
-
- /** Send schema default value via characters() */
- public static final String SCHEMA_ELEMENT_DEFAULT = "validation/schema/element-default";
-
- /** Schema full constraint checking ("validation/schema-full-checking"). */
- public static final String SCHEMA_FULL_CHECKING = "validation/schema-full-checking";
-
- /** Augment Post-Schema-Validation-Infoset */
- public static final String SCHEMA_AUGMENT_PSVI = "validation/schema/augment-psvi";
-
- /** Dynamic validation feature ("validation/dynamic"). */
- public static final String DYNAMIC_VALIDATION_FEATURE = "validation/dynamic";
-
- /** Warn on duplicate attribute declaration feature ("validation/warn-on-duplicate-attdef"). */
- public static final String WARN_ON_DUPLICATE_ATTDEF_FEATURE = "validation/warn-on-duplicate-attdef";
-
- /** Warn on undeclared element feature ("validation/warn-on-undeclared-elemdef"). */
- public static final String WARN_ON_UNDECLARED_ELEMDEF_FEATURE = "validation/warn-on-undeclared-elemdef";
-
- /** Warn on duplicate entity declaration feature ("warn-on-duplicate-entitydef"). */
- public static final String WARN_ON_DUPLICATE_ENTITYDEF_FEATURE = "warn-on-duplicate-entitydef";
-
- /** Allow Java encoding names feature ("allow-java-encodings"). */
- public static final String ALLOW_JAVA_ENCODINGS_FEATURE = "allow-java-encodings";
-
- /** Disallow DOCTYPE declaration feature ("disallow-doctype-decl"). */
- public static final String DISALLOW_DOCTYPE_DECL_FEATURE = "disallow-doctype-decl";
-
- /** Continue after fatal error feature ("continue-after-fatal-error"). */
- public static final String CONTINUE_AFTER_FATAL_ERROR_FEATURE = "continue-after-fatal-error";
-
- /** Load dtd grammar when nonvalidating feature ("nonvalidating/load-dtd-grammar"). */
- public static final String LOAD_DTD_GRAMMAR_FEATURE = "nonvalidating/load-dtd-grammar";
-
- /** Load external dtd when nonvalidating feature ("nonvalidating/load-external-dtd"). */
- public static final String LOAD_EXTERNAL_DTD_FEATURE = "nonvalidating/load-external-dtd";
-
- /** Defer node expansion feature ("dom/defer-node-expansion"). */
- public static final String DEFER_NODE_EXPANSION_FEATURE = "dom/defer-node-expansion";
-
- /** Create entity reference nodes feature ("dom/create-entity-ref-nodes"). */
- public static final String CREATE_ENTITY_REF_NODES_FEATURE = "dom/create-entity-ref-nodes";
-
- /** Include ignorable whitespace feature ("dom/include-ignorable-whitespace"). */
- public static final String INCLUDE_IGNORABLE_WHITESPACE = "dom/include-ignorable-whitespace";
-
- /** Default attribute values feature ("validation/default-attribute-values"). */
- public static final String DEFAULT_ATTRIBUTE_VALUES_FEATURE = "validation/default-attribute-values";
-
- /** Validate content models feature ("validation/validate-content-models"). */
- public static final String VALIDATE_CONTENT_MODELS_FEATURE = "validation/validate-content-models";
-
- /** Validate datatypes feature ("validation/validate-datatypes"). */
- public static final String VALIDATE_DATATYPES_FEATURE = "validation/validate-datatypes";
-
- /** Balance syntax trees feature ("validation/balance-syntax-trees"). */
- public static final String BALANCE_SYNTAX_TREES = "validation/balance-syntax-trees";
-
- /** Notify character references feature (scanner/notify-char-refs"). */
- public static final String NOTIFY_CHAR_REFS_FEATURE = "scanner/notify-char-refs";
-
- /** Notify built-in (&amp;amp;, etc.) references feature (scanner/notify-builtin-refs"). */
- public static final String NOTIFY_BUILTIN_REFS_FEATURE = "scanner/notify-builtin-refs";
-
- /** Standard URI conformant feature ("standard-uri-conformant"). */
- public static final String STANDARD_URI_CONFORMANT_FEATURE = "standard-uri-conformant";
-
- /** Generate synthetic annotations feature ("generate-synthetic-annotations"). */
- public static final String GENERATE_SYNTHETIC_ANNOTATIONS_FEATURE = "generate-synthetic-annotations";
-
- /** Validate annotations feature ("validate-annotations"). */
- public static final String VALIDATE_ANNOTATIONS_FEATURE = "validate-annotations";
-
-
- /** Honour all schemaLocations feature ("honour-all-schemaLocations"). */
- public static final String HONOUR_ALL_SCHEMALOCATIONS_FEATURE = "honour-all-schemaLocations";
-
- /** Namespace growth feature ("namespace-growth"). */
- public static final String NAMESPACE_GROWTH_FEATURE = "namespace-growth";
-
- /** Tolerate duplicates feature ("internal/tolerate-duplicates"). */
- public static final String TOLERATE_DUPLICATES_FEATURE = "internal/tolerate-duplicates";
-
- /** XInclude processing feature ("xinclude"). */
- public static final String XINCLUDE_FEATURE = "xinclude";
-
- /** XInclude fixup base URIs feature ("xinclude/fixup-base-uris"). */
- public static final String XINCLUDE_FIXUP_BASE_URIS_FEATURE = "xinclude/fixup-base-uris";
-
- /** XInclude fixup language feature ("xinclude/fixup-language"). */
- public static final String XINCLUDE_FIXUP_LANGUAGE_FEATURE = "xinclude/fixup-language";
-
- /**
- * Internal feature. When set to true the schema validator will only use
- * schema components from the grammar pool provided.
- */
- public static final String USE_GRAMMAR_POOL_ONLY_FEATURE = "internal/validation/schema/use-grammar-pool-only";
-
- /** Internal performance related feature:
- * false - the parser settings (features/properties) have not changed between 2 parses
- * true - the parser settings have changed between 2 parses
- * NOTE: this feature should only be set by the parser configuration.
- */
- public static final String PARSER_SETTINGS = "internal/parser-settings";
-
-
- /** Feature to make XML Processor XInclude Aware */
- public static final String XINCLUDE_AWARE = "xinclude-aware";
-
- /** Ignore xsi:schemaLocation and xsi:noNamespaceSchemaLocation. */
- public static final String IGNORE_SCHEMA_LOCATION_HINTS = "validation/schema/ignore-schema-location-hints";
-
- /**
- * When true, the schema processor will change characters events
- * to ignorableWhitespaces events, when characters are expected to
- * only contain ignorable whitespaces.
- */
- public static final String CHANGE_IGNORABLE_CHARACTERS_INTO_IGNORABLE_WHITESPACES =
- "validation/change-ignorable-characters-into-ignorable-whitespaces";
-
- // xerces properties
-
- /** Xerces properties prefix ("http://apache.org/xml/properties/"). */
- public static final String XERCES_PROPERTY_PREFIX = "http://apache.org/xml/properties/";
-
- /** Current element node property ("dom/current-element-node"). */
- public static final String CURRENT_ELEMENT_NODE_PROPERTY = "dom/current-element-node";
-
- /** Document class name property ("dom/document-class-name"). */
- public static final String DOCUMENT_CLASS_NAME_PROPERTY = "dom/document-class-name";
-
- /** Symbol table property ("internal/symbol-table"). */
- public static final String SYMBOL_TABLE_PROPERTY = "internal/symbol-table";
-
- /** Error reporter property ("internal/error-reporter"). */
- public static final String ERROR_REPORTER_PROPERTY = "internal/error-reporter";
-
- /** Error handler property ("internal/error-handler"). */
- public static final String ERROR_HANDLER_PROPERTY = "internal/error-handler";
-
- /** XInclude handler property ("internal/xinclude-handler"). */
- public static final String XINCLUDE_HANDLER_PROPERTY = "internal/xinclude-handler";
-
- /** XPointer handler property ("internal/xpointer-handler"). */
- public static final String XPOINTER_HANDLER_PROPERTY = "internal/xpointer-handler";
-
- /** Entity manager property ("internal/entity-manager"). */
- public static final String ENTITY_MANAGER_PROPERTY = "internal/entity-manager";
- /** Input buffer size property ("input-buffer-size"). */
- public static final String BUFFER_SIZE_PROPERTY = "input-buffer-size";
-
- /** Security manager property ("security-manager"). */
- public static final String SECURITY_MANAGER_PROPERTY = "security-manager";
-
- /** Locale property ("locale"). */
- public static final String LOCALE_PROPERTY = "locale";
-
- /** property identifier: security manager. */
- public static final String SECURITY_MANAGER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SECURITY_MANAGER_PROPERTY;
-
-
- public static final String ENTITY_RESOLVER_PROPERTY = "internal/entity-resolver";
-
- /** Grammar pool property ("internal/grammar-pool"). */
- public static final String XMLGRAMMAR_POOL_PROPERTY = "internal/grammar-pool";
-
- /** Datatype validator factory ("internal/datatype-validator-factory"). */
- public static final String DATATYPE_VALIDATOR_FACTORY_PROPERTY = "internal/datatype-validator-factory";
-
- /** Document scanner property ("internal/document-scanner"). */
- public static final String DOCUMENT_SCANNER_PROPERTY = "internal/document-scanner";
-
- /** DTD scanner property ("internal/dtd-scanner"). */
- public static final String DTD_SCANNER_PROPERTY = "internal/dtd-scanner";
-
- /** DTD processor property ("internal/dtd-processor"). */
- public static final String DTD_PROCESSOR_PROPERTY = "internal/dtd-processor";
-
- /** Validator property ("internal/validator"). */
- public static final String VALIDATOR_PROPERTY = "internal/validator";
-
- /** Validator property ("internal/validator/dtd"). */
- public static final String DTD_VALIDATOR_PROPERTY = "internal/validator/dtd";
-
- /** Validator property ("internal/validator/schema"). */
- public static final String SCHEMA_VALIDATOR_PROPERTY = "internal/validator/schema";
-
- /** No namespace schema location property ("schema/external-schemaLocation"). */
- public static final String SCHEMA_LOCATION = "schema/external-schemaLocation";
-
- /** Schema location property ("schema/external-noNamespaceSchemaLocation"). */
- public static final String SCHEMA_NONS_LOCATION = "schema/external-noNamespaceSchemaLocation";
-
- /** Namespace binder property ("internal/namespace-binder"). */
- public static final String NAMESPACE_BINDER_PROPERTY = "internal/namespace-binder";
-
- /** Namespace context property ("internal/namespace-context"). */
- public static final String NAMESPACE_CONTEXT_PROPERTY = "internal/namespace-context";
-
- /** Validation manager property ("internal/validation-manager"). */
- public static final String VALIDATION_MANAGER_PROPERTY = "internal/validation-manager";
-
-
- /** XPointer Schema property ("xpointer-schema"). */
- public static final String XPOINTER_SCHEMA_PROPERTY = "xpointer-schema";
-
- /** Schema element declaration for the root element in a document ("internal/validation/schema/dv-factory"). */
- public static final String SCHEMA_DV_FACTORY_PROPERTY = "internal/validation/schema/dv-factory";
-
-
- // general constants
-
- /** Element PSVI is stored in augmentations using string "ELEMENT_PSVI" */
- public final static String ELEMENT_PSVI = "ELEMENT_PSVI";
-
- /** Attribute PSVI is stored in augmentations using string "ATTRIBUTE_PSVI" */
- public final static String ATTRIBUTE_PSVI = "ATTRIBUTE_PSVI";
-
- /**
- * Boolean indicating whether an attribute is declared in the DTD is stored
- * in augmentations using the string "ATTRIBUTE_DECLARED". The absence of this
- * augmentation indicates that the attribute was not declared in the DTD.
- */
- public final static String ATTRIBUTE_DECLARED = "ATTRIBUTE_DECLARED";
-
-
- /**
- * {@link org.w3c.dom.TypeInfo} associated with current element/attribute
- * is stored in augmentations using this string as the key.
- *
- * This will ultimately controls {@link com.sun.org.apache.xerces.internal.parsers.AbstractDOMParser}
- * regarding what object the DOM will return from
- * {@link org.w3c.dom.Attr#getSchemaTypeInfo()} and
- * {@link org.w3c.dom.Element#getSchemaTypeInfo()} and
- */
- public final static String TYPEINFO = "org.w3c.dom.TypeInfo";
-
- /**
- * Whether an attribute is an id or not is stored in augmentations
- * using this string as the key. The value is {@link Boolean#TRUE}
- * or {@link Boolean#FALSE}.
- *
- * This will ultimately controls {@link com.sun.org.apache.xerces.internal.parsers.AbstractDOMParser}
- * about whether it will mark an attribute as ID or not.
- */
- public final static String ID_ATTRIBUTE = "ID_ATTRIBUTE";
-
- // XML version constants
-
- /**
- * Boolean indicating whether an entity referenced in the document has
- * not been read is stored in augmentations using the string "ENTITY_SKIPPED".
- * The absence of this augmentation indicates that the entity had a
- * declaration and was expanded.
- */
- public final static String ENTITY_SKIPPED = "ENTITY_SKIPPED";
-
- /**
- * Boolean indicating whether a character is a probable white space
- * character (ch <= 0x20) that was the replacement text of a character
- * reference is stored in augmentations using the string "CHAR_REF_PROBABLE_WS".
- * The absence of this augmentation indicates that the character is not
- * probable white space and/or was not included from a character reference.
- */
- public final static String CHAR_REF_PROBABLE_WS = "CHAR_REF_PROBABLE_WS";
-
- /** Boolean indicating if this entity is the last opened entity.
- *
- *@see com.sun.org.apache.xerces.internal.impl.XMLEntityManager#endEntity()
- *@see com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl#endEntity()
- *@see com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl#endEntity()
- */
- public final static String LAST_ENTITY = "LAST_ENTITY";
-
- // XML version constants
- public final static short XML_VERSION_ERROR = -1;
- public final static short XML_VERSION_1_0 = 1;
- public final static short XML_VERSION_1_1 = 2;
-
-
-
- // DOM related constants
- public final static String ANONYMOUS_TYPE_NAMESPACE =
- "http://apache.org/xml/xmlschema/1.0/anonymousTypes";
-
-
-
- // Constant to enable Schema 1.1 support
- public final static boolean SCHEMA_1_1_SUPPORT = false;
- public final static short SCHEMA_VERSION_1_0 = 1;
- public final static short SCHEMA_VERSION_1_0_EXTENDED = 2;
-
- // private
-
- /** SAX features. */
- private static final String[] fgSAXFeatures = {
- NAMESPACES_FEATURE,
- NAMESPACE_PREFIXES_FEATURE,
- STRING_INTERNING_FEATURE,
- VALIDATION_FEATURE,
- EXTERNAL_GENERAL_ENTITIES_FEATURE,
- EXTERNAL_PARAMETER_ENTITIES_FEATURE,
- };
-
- /** SAX properties. */
- private static final String[] fgSAXProperties = {
- DECLARATION_HANDLER_PROPERTY,
- LEXICAL_HANDLER_PROPERTY,
- DOM_NODE_PROPERTY,
- XML_STRING_PROPERTY,
- };
-
- /** Xerces features. */
- private static final String[] fgXercesFeatures = {
-
- SCHEMA_VALIDATION_FEATURE,
- SCHEMA_FULL_CHECKING,
- DYNAMIC_VALIDATION_FEATURE,
- WARN_ON_DUPLICATE_ATTDEF_FEATURE,
- WARN_ON_UNDECLARED_ELEMDEF_FEATURE,
- ALLOW_JAVA_ENCODINGS_FEATURE,
- CONTINUE_AFTER_FATAL_ERROR_FEATURE,
- LOAD_DTD_GRAMMAR_FEATURE,
- LOAD_EXTERNAL_DTD_FEATURE,
- //DEFER_NODE_EXPANSION_FEATURE,
- CREATE_ENTITY_REF_NODES_FEATURE,
- XINCLUDE_AWARE,
- INCLUDE_IGNORABLE_WHITESPACE,
- //GRAMMAR_ACCESS_FEATURE,
- DEFAULT_ATTRIBUTE_VALUES_FEATURE,
- VALIDATE_CONTENT_MODELS_FEATURE,
- VALIDATE_DATATYPES_FEATURE,
- BALANCE_SYNTAX_TREES,
- NOTIFY_CHAR_REFS_FEATURE,
- NOTIFY_BUILTIN_REFS_FEATURE,
- DISALLOW_DOCTYPE_DECL_FEATURE,
- STANDARD_URI_CONFORMANT_FEATURE,
- GENERATE_SYNTHETIC_ANNOTATIONS_FEATURE,
- VALIDATE_ANNOTATIONS_FEATURE,
- HONOUR_ALL_SCHEMALOCATIONS_FEATURE,
- XINCLUDE_FEATURE,
- XINCLUDE_FIXUP_BASE_URIS_FEATURE,
- XINCLUDE_FIXUP_LANGUAGE_FEATURE,
- NAMESPACE_GROWTH_FEATURE,
- TOLERATE_DUPLICATES_FEATURE,
- };
-
- /** Xerces properties. */
- private static final String[] fgXercesProperties = {
- CURRENT_ELEMENT_NODE_PROPERTY,
- DOCUMENT_CLASS_NAME_PROPERTY,
- SYMBOL_TABLE_PROPERTY,
- ERROR_HANDLER_PROPERTY,
- ERROR_REPORTER_PROPERTY,
- ENTITY_MANAGER_PROPERTY,
- ENTITY_RESOLVER_PROPERTY,
- XMLGRAMMAR_POOL_PROPERTY,
- DATATYPE_VALIDATOR_FACTORY_PROPERTY,
- DOCUMENT_SCANNER_PROPERTY,
- DTD_SCANNER_PROPERTY,
- VALIDATOR_PROPERTY,
- SCHEMA_LOCATION,
- SCHEMA_NONS_LOCATION,
- VALIDATION_MANAGER_PROPERTY,
- BUFFER_SIZE_PROPERTY,
- SECURITY_MANAGER_PROPERTY,
- LOCALE_PROPERTY,
- SCHEMA_DV_FACTORY_PROPERTY,
- };
-
- /** Empty enumeration. */
- private static final Enumeration fgEmptyEnumeration = new ArrayEnumeration(new Object[] {});
-
- //
- // Constructors
- //
-
- /** This class cannot be instantiated. */
- private Constants() {}
-
- //
- // Public methods
- //
-
- // sax
-
- /** Returns an enumeration of the SAX features. */
- public static Enumeration getSAXFeatures() {
- return fgSAXFeatures.length > 0
- ? new ArrayEnumeration(fgSAXFeatures) : fgEmptyEnumeration;
- } // getSAXFeatures():Enumeration
-
- /** Returns an enumeration of the SAX properties. */
- public static Enumeration getSAXProperties() {
- return fgSAXProperties.length > 0
- ? new ArrayEnumeration(fgSAXProperties) : fgEmptyEnumeration;
- } // getSAXProperties():Enumeration
-
- // xerces
-
- /** Returns an enumeration of the Xerces features. */
- public static Enumeration getXercesFeatures() {
- return fgXercesFeatures.length > 0
- ? new ArrayEnumeration(fgXercesFeatures) : fgEmptyEnumeration;
- } // getXercesFeatures():Enumeration
-
- /** Returns an enumeration of the Xerces properties. */
- public static Enumeration getXercesProperties() {
- return fgXercesProperties.length > 0
- ? new ArrayEnumeration(fgXercesProperties) : fgEmptyEnumeration;
- } // getXercesProperties():Enumeration
-
- /*
- * Check the version of the current JDK against that specified in the
- * parameter
- *
- * There is a proposal to change the java version string to:
- * MAJOR.MINOR.FU.CPU.PSU-BUILDNUMBER_BUGIDNUMBER_OPTIONAL
- * This method would work with both the current format and that proposed
- *
- * @param compareTo a JDK version to be compared to
- * @return true if the current version is the same or above that represented
- * by the parameter
- */
- public static boolean isJavaVersionAtLeast(int compareTo) {
- String javaVersion = SecuritySupport.getSystemProperty("java.version");
- String versions[] = javaVersion.split("\\.", 3);
- if (Integer.parseInt(versions[0]) >= compareTo ||
- Integer.parseInt(versions[1]) >= compareTo) {
- return true;
- }
- return false;
- }
-
- //
- // Classes
- //
-
- /**
- * An array enumeration.
- *
- * @author Andy Clark, IBM
- */
- static class ArrayEnumeration
- implements Enumeration {
-
- //
- // Data
- //
-
- /** Array. */
- private Object[] array;
-
- /** Index. */
- private int index;
-
- //
- // Constructors
- //
-
- /** Constructs an array enumeration. */
- public ArrayEnumeration(Object[] array) {
- this.array = array;
- } // <init>(Object[])
-
- //
- // Enumeration methods
- //
-
- /**
- * Tests if this enumeration contains more elements.
- *
- * @return <code>true</code> if this enumeration contains more elements;
- * <code>false</code> otherwise.
- * @since JDK1.0
- */
- public boolean hasMoreElements() {
- return index < array.length;
- } // hasMoreElement():boolean
-
- /**
- * Returns the next element of this enumeration.
- *
- * @return the next element of this enumeration.
- * @exception NoSuchElementException if no more elements exist.
- * @since JDK1.0
- */
- public Object nextElement() {
- if (index < array.length) {
- return array[index++];
- }
- throw new NoSuchElementException();
- } // nextElement():Object
-
- } // class ArrayEnumeration
-
- //
- // MAIN
- //
-
- /** Prints all of the constants to standard output. */
- public static void main(String[] argv) {
-
- print("SAX features:", SAX_FEATURE_PREFIX, fgSAXFeatures);
- print("SAX properties:", SAX_PROPERTY_PREFIX, fgSAXProperties);
- print("Xerces features:", XERCES_FEATURE_PREFIX, fgXercesFeatures);
- print("Xerces properties:", XERCES_PROPERTY_PREFIX, fgXercesProperties);
-
- } // main(String[])
-
- /** Prints a list of features/properties. */
- private static void print(String header, String prefix, Object[] array) {
- System.out.print(header);
- if (array.length > 0) {
- System.out.println();
- for (int i = 0; i < array.length; i++) {
- System.out.print(" ");
- System.out.print(prefix);
- System.out.println(array[i]);
- }
- }
- else {
- System.out.println(" none.");
- }
- } // print(String,String,Object[])
-
-} // class Constants
diff --git a/src/com/sun/org/apache/xerces/internal/impl/ExternalSubsetResolver.java b/src/com/sun/org/apache/xerces/internal/impl/ExternalSubsetResolver.java
deleted file mode 100644
index e845a7c..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/ExternalSubsetResolver.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl;
-
-import java.io.IOException;
-
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLDTDDescription;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLEntityResolver;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-
-/**
- * <p>This interface extends <code>XMLEntityResolver</code> providing
- * a method to resolve external subsets for documents which do not
- * explicitly provide one. The application can register an object that
- * implements this interface with the parser configuration. If registered,
- * it will be queried to locate an external subset when none is provided,
- * even for documents that do not contain DOCTYPE declarations. If the
- * registered external subset resolver does not provide an external subset
- * for a given document, it should return <code>null</code>.</p>
- *
- * @xerces.internal
- *
- * @author Michael Glavassevich, IBM
- *
- */
-public interface ExternalSubsetResolver
- extends XMLEntityResolver {
-
- //
- // ExternalSubsetResolver methods
- //
-
- /**
- * <p>Locates an external subset for documents which do not explicitly
- * provide one. If no external subset is provided, this method should
- * return <code>null</code>.</p>
- *
- * @param grammarDescription a description of the DTD
- *
- * @throws XNIException Thrown on general error.
- * @throws IOException Thrown if resolved entity stream cannot be
- * opened or some other i/o error occurs.
- */
- public XMLInputSource getExternalSubset(XMLDTDDescription grammarDescription)
- throws XNIException, IOException;
-
-} // interface ExternalSubsetResolver
diff --git a/src/com/sun/org/apache/xerces/internal/impl/PropertyManager.java b/src/com/sun/org/apache/xerces/internal/impl/PropertyManager.java
deleted file mode 100644
index 500715b..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/PropertyManager.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.org.apache.xerces.internal.impl;
-
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager;
-import com.sun.xml.internal.stream.StaxEntityResolverWrapper;
-import java.util.HashMap;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLOutputFactory;
-import javax.xml.stream.XMLResolver;
-
-/**
- * This class manages different properties related to Stax specification and its implementation.
- * This class constructor also takes itself (PropertyManager object) as parameter and initializes the
- * object with the property taken from the object passed.
- *
- * @author Neeraj Bajaj, neeraj.bajaj@sun.com
- * @author K.Venugopal@sun.com
- * @author Sunitha Reddy, sunitha.reddy@sun.com
- */
-
-public class PropertyManager {
-
-
- public static final String STAX_NOTATIONS = "javax.xml.stream.notations";
- public static final String STAX_ENTITIES = "javax.xml.stream.entities";
-
- private static final String STRING_INTERNING = "http://xml.org/sax/features/string-interning";
-
- /** Property identifier: Security manager. */
- private static final String SECURITY_MANAGER = Constants.SECURITY_MANAGER;
-
- /** Property identifier: Security property manager. */
- private static final String XML_SECURITY_PROPERTY_MANAGER =
- Constants.XML_SECURITY_PROPERTY_MANAGER;
-
- HashMap supportedProps = new HashMap();
-
- private XMLSecurityManager fSecurityManager;
- private XMLSecurityPropertyManager fSecurityPropertyMgr;
-
- public static final int CONTEXT_READER = 1;
- public static final int CONTEXT_WRITER = 2;
-
- /** Creates a new instance of PropertyManager */
- public PropertyManager(int context) {
- switch(context){
- case CONTEXT_READER:{
- initConfigurableReaderProperties();
- break;
- }
- case CONTEXT_WRITER:{
- initWriterProps();
- break;
- }
- }
- }
-
- /**
- * Initialize this object with the properties taken from passed PropertyManager object.
- */
- public PropertyManager(PropertyManager propertyManager){
-
- HashMap properties = propertyManager.getProperties();
- supportedProps.putAll(properties);
- fSecurityManager = (XMLSecurityManager)getProperty(SECURITY_MANAGER);
- fSecurityPropertyMgr = (XMLSecurityPropertyManager)getProperty(XML_SECURITY_PROPERTY_MANAGER);
- }
-
- private HashMap getProperties(){
- return supportedProps ;
- }
-
-
- /**
- * Important point:
- * 1. We are not exposing Xerces namespace property. Application should configure namespace through
- * Stax specific property.
- *
- */
- private void initConfigurableReaderProperties(){
- //spec default values
- supportedProps.put(XMLInputFactory.IS_NAMESPACE_AWARE, Boolean.TRUE);
- supportedProps.put(XMLInputFactory.IS_VALIDATING, Boolean.FALSE);
- supportedProps.put(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, Boolean.TRUE);
- supportedProps.put(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, Boolean.TRUE);
- supportedProps.put(XMLInputFactory.IS_COALESCING, Boolean.FALSE);
- supportedProps.put(XMLInputFactory.SUPPORT_DTD, Boolean.TRUE);
- supportedProps.put(XMLInputFactory.REPORTER, null);
- supportedProps.put(XMLInputFactory.RESOLVER, null);
- supportedProps.put(XMLInputFactory.ALLOCATOR, null);
- supportedProps.put(STAX_NOTATIONS,null );
-
- //zephyr (implementation) specific properties which can be set by the application.
- //interning is always done
- supportedProps.put(Constants.SAX_FEATURE_PREFIX + Constants.STRING_INTERNING_FEATURE , new Boolean(true));
- //recognizing java encoding names by default
- supportedProps.put(Constants.XERCES_FEATURE_PREFIX + Constants.ALLOW_JAVA_ENCODINGS_FEATURE, new Boolean(true)) ;
- //in stax mode, namespace declarations are not added as attributes
- supportedProps.put(Constants.ADD_NAMESPACE_DECL_AS_ATTRIBUTE , Boolean.FALSE) ;
- supportedProps.put(Constants.READER_IN_DEFINED_STATE, new Boolean(true));
- supportedProps.put(Constants.REUSE_INSTANCE, new Boolean(true));
- supportedProps.put(Constants.ZEPHYR_PROPERTY_PREFIX + Constants.STAX_REPORT_CDATA_EVENT , new Boolean(false));
- supportedProps.put(Constants.ZEPHYR_PROPERTY_PREFIX + Constants.IGNORE_EXTERNAL_DTD, Boolean.FALSE);
- supportedProps.put(Constants.XERCES_FEATURE_PREFIX + Constants.WARN_ON_DUPLICATE_ATTDEF_FEATURE, new Boolean(false));
- supportedProps.put(Constants.XERCES_FEATURE_PREFIX + Constants.WARN_ON_DUPLICATE_ENTITYDEF_FEATURE, new Boolean(false));
- supportedProps.put(Constants.XERCES_FEATURE_PREFIX + Constants.WARN_ON_UNDECLARED_ELEMDEF_FEATURE, new Boolean(false));
-
- fSecurityManager = new XMLSecurityManager(true);
- supportedProps.put(SECURITY_MANAGER, fSecurityManager);
- fSecurityPropertyMgr = new XMLSecurityPropertyManager();
- supportedProps.put(XML_SECURITY_PROPERTY_MANAGER, fSecurityPropertyMgr);
- }
-
- private void initWriterProps(){
- supportedProps.put(XMLOutputFactory.IS_REPAIRING_NAMESPACES , Boolean.FALSE);
- //default value of escaping characters is 'true'
- supportedProps.put(Constants.ESCAPE_CHARACTERS , Boolean.TRUE);
- supportedProps.put(Constants.REUSE_INSTANCE, new Boolean(true));
- }
-
- /**
- * public void reset(){
- * supportedProps.clear() ;
- * }
- */
- public boolean containsProperty(String property){
- return supportedProps.containsKey(property) ||
- (fSecurityManager != null && fSecurityManager.getIndex(property) > -1) ||
- (fSecurityPropertyMgr!=null && fSecurityPropertyMgr.getIndex(property) > -1) ;
- }
-
- public Object getProperty(String property){
- return supportedProps.get(property);
- }
-
- public void setProperty(String property, Object value){
- String equivalentProperty = null ;
- if(property == XMLInputFactory.IS_NAMESPACE_AWARE || property.equals(XMLInputFactory.IS_NAMESPACE_AWARE)){
- equivalentProperty = Constants.XERCES_FEATURE_PREFIX + Constants.NAMESPACES_FEATURE ;
- }
- else if(property == XMLInputFactory.IS_VALIDATING || property.equals(XMLInputFactory.IS_VALIDATING)){
- if( (value instanceof Boolean) && ((Boolean)value).booleanValue()){
- throw new java.lang.IllegalArgumentException("true value of isValidating not supported") ;
- }
- }
- else if(property == STRING_INTERNING || property.equals(STRING_INTERNING)){
- if( (value instanceof Boolean) && !((Boolean)value).booleanValue()){
- throw new java.lang.IllegalArgumentException("false value of " + STRING_INTERNING + "feature is not supported") ;
- }
- }
- else if(property == XMLInputFactory.RESOLVER || property.equals(XMLInputFactory.RESOLVER)){
- //add internal stax property
- supportedProps.put( Constants.XERCES_PROPERTY_PREFIX + Constants.STAX_ENTITY_RESOLVER_PROPERTY , new StaxEntityResolverWrapper((XMLResolver)value)) ;
- }
-
- /**
- * It's possible for users to set a security manager through the interface.
- * If it's the old SecurityManager, convert it to the new XMLSecurityManager
- */
- if (property.equals(Constants.SECURITY_MANAGER)) {
- fSecurityManager = XMLSecurityManager.convert(value, fSecurityManager);
- supportedProps.put(Constants.SECURITY_MANAGER, fSecurityManager);
- return;
- }
- if (property.equals(Constants.XML_SECURITY_PROPERTY_MANAGER)) {
- if (value == null) {
- fSecurityPropertyMgr = new XMLSecurityPropertyManager();
- } else {
- fSecurityPropertyMgr = (XMLSecurityPropertyManager)value;
- }
- supportedProps.put(Constants.XML_SECURITY_PROPERTY_MANAGER, fSecurityPropertyMgr);
- return;
- }
-
- //check if the property is managed by security manager
- if (fSecurityManager == null ||
- !fSecurityManager.setLimit(property, XMLSecurityManager.State.APIPROPERTY, value)) {
- //check if the property is managed by security property manager
- if (fSecurityPropertyMgr == null ||
- !fSecurityPropertyMgr.setValue(property, XMLSecurityPropertyManager.State.APIPROPERTY, value)) {
- //fall back to the existing property manager
- supportedProps.put(property, value);
- }
- }
-
- if(equivalentProperty != null){
- supportedProps.put(equivalentProperty, value ) ;
- }
- }
-
- public String toString(){
- return supportedProps.toString();
- }
-
-}//PropertyManager
diff --git a/src/com/sun/org/apache/xerces/internal/impl/RevalidationHandler.java b/src/com/sun/org/apache/xerces/internal/impl/RevalidationHandler.java
deleted file mode 100644
index d537d02..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/RevalidationHandler.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001, 2002 The Apache Software Foundation.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2002, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package com.sun.org.apache.xerces.internal.impl;
-
-import com.sun.org.apache.xerces.internal.xni.Augmentations;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentFilter;
-/**
- * DOM Revalidation handler adds additional functionality to XMLDocumentHandler
- *
- * @xerces.internal
- * @author Elena Litani, IBM
- */
-public interface RevalidationHandler extends XMLDocumentFilter {
-
- /**
- * Character content.
- *
- * @param data The character data.
- * @param augs Augmentations
- * @return True if data is whitespace only
- */
- public boolean characterData(String data, Augmentations augs);
-
-
-} // interface DOMRevalidationHandler
diff --git a/src/com/sun/org/apache/xerces/internal/impl/Version.java b/src/com/sun/org/apache/xerces/internal/impl/Version.java
deleted file mode 100644
index ac62db7..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/Version.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999-2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package com.sun.org.apache.xerces.internal.impl;
-
-/**
- * This class defines the version number of the parser.
- *
- * @version $Id: Version.java,v 1.4 2010-11-01 04:39:40 joehw Exp $
- */
-public class Version {
-
- //
- // Data
- //
-
- /** Version string.
- * @deprecated getVersion() should be used instead. */
- public static final String fVersion = getVersion();
-
- private static final String fImmutableVersion = "Xerces-J 2.7.1";
-
- // public methods
-
- /* Print out the version information.
- * @return the version of the parser.
- */
- public static String getVersion() {
- return fImmutableVersion;
- } // getVersion(): String
-
- //
- // MAIN
- //
-
- /**
- * Prints out the version number to System.out. This is needed
- * for the build system.
- */
- public static void main(String argv[]) {
- System.out.println(fVersion);
- }
-
-} // class Version
diff --git a/src/com/sun/org/apache/xerces/internal/impl/XML11DTDScannerImpl.java b/src/com/sun/org/apache/xerces/internal/impl/XML11DTDScannerImpl.java
deleted file mode 100644
index a4361b2..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/XML11DTDScannerImpl.java
+++ /dev/null
@@ -1,256 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl;
-
-import java.io.IOException;
-
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.util.XML11Char;
-import com.sun.org.apache.xerces.internal.util.XMLChar;
-import com.sun.org.apache.xerces.internal.util.XMLStringBuffer;
-import com.sun.org.apache.xerces.internal.xni.XMLString;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-
-/**
- * This class is responsible for scanning the declarations found
- * in the internal and external subsets of a DTD in an XML document.
- * The scanner acts as the sources for the DTD information which is
- * communicated to the DTD handlers.
- * <p>
- * This component requires the following features and properties from the
- * component manager that uses it:
- * <ul>
- * <li>http://xml.org/sax/features/validation</li>
- * <li>http://apache.org/xml/features/scanner/notify-char-refs</li>
- * <li>http://apache.org/xml/properties/internal/symbol-table</li>
- * <li>http://apache.org/xml/properties/internal/error-reporter</li>
- * <li>http://apache.org/xml/properties/internal/entity-manager</li>
- * </ul>
- *
- * @xerces.internal
- *
- * @author Arnaud Le Hors, IBM
- * @author Andy Clark, IBM
- * @author Glenn Marcy, IBM
- * @author Eric Ye, IBM
- *
- */
-public class XML11DTDScannerImpl
- extends XMLDTDScannerImpl {
-
- /** String buffer. */
- private XMLStringBuffer fStringBuffer = new XMLStringBuffer();
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- public XML11DTDScannerImpl() {super();} // <init>()
-
- /** Constructor for he use of non-XMLComponentManagers. */
- public XML11DTDScannerImpl(SymbolTable symbolTable,
- XMLErrorReporter errorReporter, XMLEntityManager entityManager) {
- super(symbolTable, errorReporter, entityManager);
- }
-
- //
- // XMLDTDScanner methods
- //
-
- //
- // XMLScanner methods
- //
- // NOTE: this is a carbon copy of the code in XML11DocumentScannerImpl;
- // we need to override these methods in both places. Ah for
- // multiple inheritance...
- // This needs to be refactored!!! - NG
- /**
- * Scans public ID literal.
- *
- * [12] PubidLiteral ::= '"' PubidChar* '"' | "'" (PubidChar - "'")* "'"
- * [13] PubidChar::= #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]
- *
- * The returned string is normalized according to the following rule,
- * from http://www.w3.org/TR/REC-xml#dt-pubid:
- *
- * Before a match is attempted, all strings of white space in the public
- * identifier must be normalized to single space characters (#x20), and
- * leading and trailing white space must be removed.
- *
- * @param literal The string to fill in with the public ID literal.
- * @return True on success.
- *
- * <strong>Note:</strong> This method uses fStringBuffer, anything in it at
- * the time of calling is lost.
- */
- protected boolean scanPubidLiteral(XMLString literal)
- throws IOException, XNIException
- {
- int quote = fEntityScanner.scanChar(null);
- if (quote != '\'' && quote != '"') {
- reportFatalError("QuoteRequiredInPublicID", null);
- return false;
- }
-
- fStringBuffer.clear();
- // skip leading whitespace
- boolean skipSpace = true;
- boolean dataok = true;
- while (true) {
- int c = fEntityScanner.scanChar(null);
- // REVISIT: it could really only be \n or 0x20; all else is normalized, no? - neilg
- if (c == ' ' || c == '\n' || c == '\r' || c == 0x85 || c == 0x2028) {
- if (!skipSpace) {
- // take the first whitespace as a space and skip the others
- fStringBuffer.append(' ');
- skipSpace = true;
- }
- }
- else if (c == quote) {
- if (skipSpace) {
- // if we finished on a space let's trim it
- fStringBuffer.length--;
- }
- literal.setValues(fStringBuffer);
- break;
- }
- else if (XMLChar.isPubid(c)) {
- fStringBuffer.append((char)c);
- skipSpace = false;
- }
- else if (c == -1) {
- reportFatalError("PublicIDUnterminated", null);
- return false;
- }
- else {
- dataok = false;
- reportFatalError("InvalidCharInPublicID",
- new Object[]{Integer.toHexString(c)});
- }
- }
- return dataok;
- }
-
- /**
- * Normalize whitespace in an XMLString converting all whitespace
- * characters to space characters.
- */
- protected void normalizeWhitespace(XMLString value) {
- int end = value.offset + value.length;
- for (int i = value.offset; i < end; ++i) {
- int c = value.ch[i];
- if (XMLChar.isSpace(c)) {
- value.ch[i] = ' ';
- }
- }
- }
-
- /**
- * Normalize whitespace in an XMLString converting all whitespace
- * characters to space characters.
- */
- protected void normalizeWhitespace(XMLString value, int fromIndex) {
- int end = value.offset + value.length;
- for (int i = value.offset + fromIndex; i < end; ++i) {
- int c = value.ch[i];
- if (XMLChar.isSpace(c)) {
- value.ch[i] = ' ';
- }
- }
- }
-
- /**
- * Checks whether this string would be unchanged by normalization.
- *
- * @return -1 if the value would be unchanged by normalization,
- * otherwise the index of the first whitespace character which
- * would be transformed.
- */
- protected int isUnchangedByNormalization(XMLString value) {
- int end = value.offset + value.length;
- for (int i = value.offset; i < end; ++i) {
- int c = value.ch[i];
- if (XMLChar.isSpace(c)) {
- return i - value.offset;
- }
- }
- return -1;
- }
-
- // returns true if the given character is not
- // valid with respect to the version of
- // XML understood by this scanner.
- protected boolean isInvalid(int value) {
- return (!XML11Char.isXML11Valid(value));
- } // isInvalid(int): boolean
-
- // returns true if the given character is not
- // valid or may not be used outside a character reference
- // with respect to the version of XML understood by this scanner.
- protected boolean isInvalidLiteral(int value) {
- return (!XML11Char.isXML11ValidLiteral(value));
- } // isInvalidLiteral(int): boolean
-
- // returns true if the given character is
- // a valid nameChar with respect to the version of
- // XML understood by this scanner.
- protected boolean isValidNameChar(int value) {
- return (XML11Char.isXML11Name(value));
- } // isValidNameChar(int): boolean
-
- // returns true if the given character is
- // a valid nameStartChar with respect to the version of
- // XML understood by this scanner.
- protected boolean isValidNameStartChar(int value) {
- return (XML11Char.isXML11NameStart(value));
- } // isValidNameStartChar(int): boolean
-
- // returns true if the given character is
- // a valid NCName character with respect to the version of
- // XML understood by this scanner.
- protected boolean isValidNCName(int value) {
- return (XML11Char.isXML11NCName(value));
- } // isValidNCName(int): boolean
-
- // returns true if the given character is
- // a valid high surrogate for a nameStartChar
- // with respect to the version of XML understood
- // by this scanner.
- protected boolean isValidNameStartHighSurrogate(int value) {
- return XML11Char.isXML11NameHighSurrogate(value);
- } // isValidNameStartHighSurrogate(int): boolean
-
- // note that, according to 4.3.4 of the XML 1.1 spec, XML 1.1
- // documents may invoke 1.0 entities; thus either version decl (or none!)
- // is allowed to appear in this context
- protected boolean versionSupported(String version) {
- return version.equals("1.1") || version.equals ("1.0");
- } // versionSupported(String): boolean
-
- // returns the error message key for unsupported
- // versions of XML with respect to the version of
- // XML understood by this scanner.
- protected String getVersionNotSupportedKey () {
- return "VersionNotSupported11";
- } // getVersionNotSupportedKey: String
-
-} // class XML11DTDScannerImpl
diff --git a/src/com/sun/org/apache/xerces/internal/impl/XML11DocumentScannerImpl.java b/src/com/sun/org/apache/xerces/internal/impl/XML11DocumentScannerImpl.java
deleted file mode 100644
index cea629a..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/XML11DocumentScannerImpl.java
+++ /dev/null
@@ -1,510 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl;
-
-import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter;
-import com.sun.org.apache.xerces.internal.util.XML11Char;
-import com.sun.org.apache.xerces.internal.util.XMLChar;
-import com.sun.org.apache.xerces.internal.util.XMLStringBuffer;
-import com.sun.org.apache.xerces.internal.xni.XMLString;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import java.io.IOException;
-
-/**
- * This class is responsible for scanning XML document structure
- * and content. The scanner acts as the source for the document
- * information which is communicated to the document handler.
- * <p>
- * This component requires the following features and properties from the
- * component manager that uses it:
- * <ul>
- * <li>http://xml.org/sax/features/namespaces</li>
- * <li>http://xml.org/sax/features/validation</li>
- * <li>http://apache.org/xml/features/nonvalidating/load-external-dtd</li>
- * <li>http://apache.org/xml/features/scanner/notify-char-refs</li>
- * <li>http://apache.org/xml/features/scanner/notify-builtin-refs</li>
- * <li>http://apache.org/xml/properties/internal/symbol-table</li>
- * <li>http://apache.org/xml/properties/internal/error-reporter</li>
- * <li>http://apache.org/xml/properties/internal/entity-manager</li>
- * <li>http://apache.org/xml/properties/internal/dtd-scanner</li>
- * </ul>
- *
- * @xerces.internal
- *
- * @author Glenn Marcy, IBM
- * @author Andy Clark, IBM
- * @author Arnaud Le Hors, IBM
- * @author Eric Ye, IBM
- *
- * @version $Id: XML11DocumentScannerImpl.java,v 1.5 2010/08/04 20:59:09 joehw Exp $
- */
-public class XML11DocumentScannerImpl
- extends XMLDocumentScannerImpl {
-
-
- /** String buffer. */
- private final XMLStringBuffer fStringBuffer = new XMLStringBuffer();
- private final XMLStringBuffer fStringBuffer2 = new XMLStringBuffer();
- private final XMLStringBuffer fStringBuffer3 = new XMLStringBuffer();
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- public XML11DocumentScannerImpl() {super();} // <init>()
-
- //
- // overridden methods
- //
-
- // XMLDocumentFragmentImpl methods
-
- /**
- * Scans element content.
- *
- * @return Returns the next character on the stream.
- */
- protected int scanContent(XMLStringBuffer content) throws IOException, XNIException {
-
- fTempString.length = 0;
- int c = fEntityScanner.scanContent(fTempString);
- content.append(fTempString);
-
- if (c == '\r' || c == 0x85 || c == 0x2028) {
- // happens when there is the character reference &#13;
- // but scanContent doesn't do entity expansions...
- // is this *really* necessary??? - NG
- fEntityScanner.scanChar(null);
- content.append((char)c);
- c = -1;
- }
- /*if (fDocumentHandler != null && content.length > 0) {
- fDocumentHandler.characters(content, null);
- } */
-
- if (c == ']') {
- content.append((char)fEntityScanner.scanChar(null));
- // remember where we are in case we get an endEntity before we
- // could flush the buffer out - this happens when we're parsing an
- // entity which ends with a ]
- fInScanContent = true;
- //
- // We work on a single character basis to handle cases such as:
- // ']]]>' which we might otherwise miss.
- //
- if (fEntityScanner.skipChar(']', null)) {
- content.append(']');
- while (fEntityScanner.skipChar(']', null)) {
- content.append(']');
- }
- if (fEntityScanner.skipChar('>', null)) {
- reportFatalError("CDEndInContent", null);
- }
- }
- /*if (fDocumentHandler != null && fStringBuffer.length != 0) {
- fDocumentHandler.characters(fStringBuffer, null);
- }*/
- fInScanContent = false;
- c = -1;
- }
- return c;
-
- } // scanContent():int
-
- /**
- * Scans an attribute value and normalizes whitespace converting all
- * whitespace characters to space characters.
- *
- * [10] AttValue ::= '"' ([^<&"] | Reference)* '"' | "'" ([^<&'] | Reference)* "'"
- *
- * @param value The XMLString to fill in with the value.
- * @param nonNormalizedValue The XMLString to fill in with the
- * non-normalized value.
- * @param atName The name of the attribute being parsed (for error msgs).
- * @param checkEntities true if undeclared entities should be reported as VC violation,
- * false if undeclared entities should be reported as WFC violation.
- * @param eleName The name of element to which this attribute belongs.
- * @param isNSURI The flag indicating whether the content is a namespace URI
- *
- * @return true if the non-normalized and normalized value are the same
- *
- * <strong>Note:</strong> This method uses fStringBuffer2, anything in it
- * at the time of calling is lost.
- **/
- protected boolean scanAttributeValue(XMLString value,
- XMLString nonNormalizedValue,
- String atName,
- boolean checkEntities,String eleName, boolean isNSURI)
- throws IOException, XNIException
- {
- // quote
- int quote = fEntityScanner.peekChar();
- if (quote != '\'' && quote != '"') {
- reportFatalError("OpenQuoteExpected", new Object[]{eleName,atName});
- }
-
- fEntityScanner.scanChar(NameType.ATTRIBUTE);
- int entityDepth = fEntityDepth;
-
- int c = fEntityScanner.scanLiteral(quote, value, isNSURI);
- if (DEBUG_ATTR_NORMALIZATION) {
- System.out.println("** scanLiteral -> \""
- + value.toString() + "\"");
- }
-
- int fromIndex = 0;
- if (c == quote && (fromIndex = isUnchangedByNormalization(value)) == -1) {
- /** Both the non-normalized and normalized attribute values are equal. **/
- nonNormalizedValue.setValues(value);
- int cquote = fEntityScanner.scanChar(NameType.ATTRIBUTE);
- if (cquote != quote) {
- reportFatalError("CloseQuoteExpected", new Object[]{eleName,atName});
- }
- return true;
- }
- fStringBuffer2.clear();
- fStringBuffer2.append(value);
- normalizeWhitespace(value, fromIndex);
- if (DEBUG_ATTR_NORMALIZATION) {
- System.out.println("** normalizeWhitespace -> \""
- + value.toString() + "\"");
- }
- if (c != quote) {
- fScanningAttribute = true;
- fStringBuffer.clear();
- do {
- fStringBuffer.append(value);
- if (DEBUG_ATTR_NORMALIZATION) {
- System.out.println("** value2: \""
- + fStringBuffer.toString() + "\"");
- }
- if (c == '&') {
- fEntityScanner.skipChar('&', NameType.REFERENCE);
- if (entityDepth == fEntityDepth) {
- fStringBuffer2.append('&');
- }
- if (fEntityScanner.skipChar('#', NameType.REFERENCE)) {
- if (entityDepth == fEntityDepth) {
- fStringBuffer2.append('#');
- }
- int ch = scanCharReferenceValue(fStringBuffer, fStringBuffer2);
- if (ch != -1) {
- if (DEBUG_ATTR_NORMALIZATION) {
- System.out.println("** value3: \""
- + fStringBuffer.toString()
- + "\"");
- }
- }
- }
- else {
- String entityName = fEntityScanner.scanName(NameType.REFERENCE);
- if (entityName == null) {
- reportFatalError("NameRequiredInReference", null);
- }
- else if (entityDepth == fEntityDepth) {
- fStringBuffer2.append(entityName);
- }
- if (!fEntityScanner.skipChar(';', NameType.REFERENCE)) {
- reportFatalError("SemicolonRequiredInReference",
- new Object []{entityName});
- }
- else if (entityDepth == fEntityDepth) {
- fStringBuffer2.append(';');
- }
- if (resolveCharacter(entityName, fStringBuffer)) {
- checkEntityLimit(false, fEntityScanner.fCurrentEntity.name, 1);
- }
- else {
- if (fEntityManager.isExternalEntity(entityName)) {
- reportFatalError("ReferenceToExternalEntity",
- new Object[] { entityName });
- }
- else {
- if (!fEntityManager.isDeclaredEntity(entityName)) {
- //WFC & VC: Entity Declared
- if (checkEntities) {
- if (fValidation) {
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "EntityNotDeclared",
- new Object[]{entityName},
- XMLErrorReporter.SEVERITY_ERROR);
- }
- }
- else {
- reportFatalError("EntityNotDeclared",
- new Object[]{entityName});
- }
- }
- fEntityManager.startEntity(true, entityName, true);
- }
- }
- }
- }
- else if (c == '<') {
- reportFatalError("LessthanInAttValue",
- new Object[] { eleName, atName });
- fEntityScanner.scanChar(null);
- if (entityDepth == fEntityDepth) {
- fStringBuffer2.append((char)c);
- }
- }
- else if (c == '%' || c == ']') {
- fEntityScanner.scanChar(null);
- fStringBuffer.append((char)c);
- if (entityDepth == fEntityDepth) {
- fStringBuffer2.append((char)c);
- }
- if (DEBUG_ATTR_NORMALIZATION) {
- System.out.println("** valueF: \""
- + fStringBuffer.toString() + "\"");
- }
- }
- // note that none of these characters should ever get through
- // XML11EntityScanner. Not sure why
- // this check was originally necessary. - NG
- else if (c == '\n' || c == '\r' || c == 0x85 || c == 0x2028) {
- fEntityScanner.scanChar(null);
- fStringBuffer.append(' ');
- if (entityDepth == fEntityDepth) {
- fStringBuffer2.append('\n');
- }
- }
- else if (c != -1 && XMLChar.isHighSurrogate(c)) {
- fStringBuffer3.clear();
- if (scanSurrogates(fStringBuffer3)) {
- fStringBuffer.append(fStringBuffer3);
- if (entityDepth == fEntityDepth) {
- fStringBuffer2.append(fStringBuffer3);
- }
- if (DEBUG_ATTR_NORMALIZATION) {
- System.out.println("** valueI: \""
- + fStringBuffer.toString()
- + "\"");
- }
- }
- }
- else if (c != -1 && isInvalidLiteral(c)) {
- reportFatalError("InvalidCharInAttValue",
- new Object[] {eleName, atName, Integer.toString(c, 16)});
- fEntityScanner.scanChar(null);
- if (entityDepth == fEntityDepth) {
- fStringBuffer2.append((char)c);
- }
- }
- c = fEntityScanner.scanLiteral(quote, value, isNSURI);
- if (entityDepth == fEntityDepth) {
- fStringBuffer2.append(value);
- }
- normalizeWhitespace(value);
- } while (c != quote || entityDepth != fEntityDepth);
- fStringBuffer.append(value);
- if (DEBUG_ATTR_NORMALIZATION) {
- System.out.println("** valueN: \""
- + fStringBuffer.toString() + "\"");
- }
- value.setValues(fStringBuffer);
- fScanningAttribute = false;
- }
- nonNormalizedValue.setValues(fStringBuffer2);
-
- // quote
- int cquote = fEntityScanner.scanChar(null);
- if (cquote != quote) {
- reportFatalError("CloseQuoteExpected", new Object[]{eleName,atName});
- }
- return nonNormalizedValue.equals(value.ch, value.offset, value.length);
- } // scanAttributeValue()
-
- //
- // XMLScanner methods
- //
- // NOTE: this is a carbon copy of the code in XML11DTDScannerImpl;
- // we need to override these methods in both places.
- // this needs to be refactored!!! - NG
- /**
- * Scans public ID literal.
- *
- * [12] PubidLiteral ::= '"' PubidChar* '"' | "'" (PubidChar - "'")* "'"
- * [13] PubidChar::= #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]
- *
- * The returned string is normalized according to the following rule,
- * from http://www.w3.org/TR/REC-xml#dt-pubid:
- *
- * Before a match is attempted, all strings of white space in the public
- * identifier must be normalized to single space characters (#x20), and
- * leading and trailing white space must be removed.
- *
- * @param literal The string to fill in with the public ID literal.
- * @return True on success.
- *
- * <strong>Note:</strong> This method uses fStringBuffer, anything in it at
- * the time of calling is lost.
- */
- protected boolean scanPubidLiteral(XMLString literal)
- throws IOException, XNIException
- {
- int quote = fEntityScanner.scanChar(null);
- if (quote != '\'' && quote != '"') {
- reportFatalError("QuoteRequiredInPublicID", null);
- return false;
- }
-
- fStringBuffer.clear();
- // skip leading whitespace
- boolean skipSpace = true;
- boolean dataok = true;
- while (true) {
- int c = fEntityScanner.scanChar(null);
- // REVISIT: none of these except \n and 0x20 should make it past the entity scanner
- if (c == ' ' || c == '\n' || c == '\r' || c == 0x85 || c == 0x2028) {
- if (!skipSpace) {
- // take the first whitespace as a space and skip the others
- fStringBuffer.append(' ');
- skipSpace = true;
- }
- }
- else if (c == quote) {
- if (skipSpace) {
- // if we finished on a space let's trim it
- fStringBuffer.length--;
- }
- literal.setValues(fStringBuffer);
- break;
- }
- else if (XMLChar.isPubid(c)) {
- fStringBuffer.append((char)c);
- skipSpace = false;
- }
- else if (c == -1) {
- reportFatalError("PublicIDUnterminated", null);
- return false;
- }
- else {
- dataok = false;
- reportFatalError("InvalidCharInPublicID",
- new Object[]{Integer.toHexString(c)});
- }
- }
- return dataok;
- }
-
- /**
- * Normalize whitespace in an XMLString converting all whitespace
- * characters to space characters.
- */
- protected void normalizeWhitespace(XMLString value) {
- int end = value.offset + value.length;
- for (int i = value.offset; i < end; ++i) {
- int c = value.ch[i];
- if (XMLChar.isSpace(c)) {
- value.ch[i] = ' ';
- }
- }
- }
-
- /**
- * Normalize whitespace in an XMLString converting all whitespace
- * characters to space characters.
- */
- protected void normalizeWhitespace(XMLString value, int fromIndex) {
- int end = value.offset + value.length;
- for (int i = value.offset + fromIndex; i < end; ++i) {
- int c = value.ch[i];
- if (XMLChar.isSpace(c)) {
- value.ch[i] = ' ';
- }
- }
- }
-
- /**
- * Checks whether this string would be unchanged by normalization.
- *
- * @return -1 if the value would be unchanged by normalization,
- * otherwise the index of the first whitespace character which
- * would be transformed.
- */
- protected int isUnchangedByNormalization(XMLString value) {
- int end = value.offset + value.length;
- for (int i = value.offset; i < end; ++i) {
- int c = value.ch[i];
- if (XMLChar.isSpace(c)) {
- return i - value.offset;
- }
- }
- return -1;
- }
-
- // returns true if the given character is not
- // valid with respect to the version of
- // XML understood by this scanner.
- protected boolean isInvalid(int value) {
- return (XML11Char.isXML11Invalid(value));
- } // isInvalid(int): boolean
-
- // returns true if the given character is not
- // valid or may not be used outside a character reference
- // with respect to the version of XML understood by this scanner.
- protected boolean isInvalidLiteral(int value) {
- return (!XML11Char.isXML11ValidLiteral(value));
- } // isInvalidLiteral(int): boolean
-
- // returns true if the given character is
- // a valid nameChar with respect to the version of
- // XML understood by this scanner.
- protected boolean isValidNameChar(int value) {
- return (XML11Char.isXML11Name(value));
- } // isValidNameChar(int): boolean
-
- // returns true if the given character is
- // a valid nameStartChar with respect to the version of
- // XML understood by this scanner.
- protected boolean isValidNameStartChar(int value) {
- return (XML11Char.isXML11NameStart(value));
- } // isValidNameStartChar(int): boolean
-
- // returns true if the given character is
- // a valid NCName character with respect to the version of
- // XML understood by this scanner.
- protected boolean isValidNCName(int value) {
- return (XML11Char.isXML11NCName(value));
- } // isValidNCName(int): boolean
-
- // returns true if the given character is
- // a valid high surrogate for a nameStartChar
- // with respect to the version of XML understood
- // by this scanner.
- protected boolean isValidNameStartHighSurrogate(int value) {
- return XML11Char.isXML11NameHighSurrogate(value);
- } // isValidNameStartHighSurrogate(int): boolean
-
- protected boolean versionSupported(String version) {
- return (version.equals("1.1") || version.equals("1.0"));
- } // versionSupported(String): boolean
-
- // returns the error message key for unsupported
- // versions of XML with respect to the version of
- // XML understood by this scanner.
- protected String getVersionNotSupportedKey () {
- return "VersionNotSupported11";
- } // getVersionNotSupportedKey: String
-
-} // class XML11DocumentScannerImpl
diff --git a/src/com/sun/org/apache/xerces/internal/impl/XML11EntityScanner.java b/src/com/sun/org/apache/xerces/internal/impl/XML11EntityScanner.java
deleted file mode 100644
index e29d296..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/XML11EntityScanner.java
+++ /dev/null
@@ -1,1499 +0,0 @@
-/*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl;
-
-import com.sun.org.apache.xerces.internal.impl.XMLScanner.NameType;
-import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter;
-import com.sun.org.apache.xerces.internal.util.XML11Char;
-import com.sun.org.apache.xerces.internal.util.XMLChar;
-import com.sun.org.apache.xerces.internal.util.XMLStringBuffer;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager.Limit;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xni.XMLString;
-import com.sun.xml.internal.stream.Entity;
-import java.io.IOException;
-
-/**
- * Implements the entity scanner methods in
- * the context of XML 1.1.
- *
- * @xerces.internal
- *
- * @author Michael Glavassevich, IBM
- * @author Neil Graham, IBM
- * @version $Id: XML11EntityScanner.java,v 1.5 2010-11-01 04:39:40 joehw Exp $
- */
-
-public class XML11EntityScanner
- extends XMLEntityScanner {
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- public XML11EntityScanner() {
- super();
- } // <init>()
-
- //
- // XMLEntityScanner methods
- //
-
- /**
- * Returns the next character on the input.
- * <p>
- * <strong>Note:</strong> The character is <em>not</em> consumed.
- *
- * @throws IOException Thrown if i/o error occurs.
- * @throws EOFException Thrown on end of file.
- */
- public int peekChar() throws IOException {
-
- // load more characters, if needed
- if (fCurrentEntity.position == fCurrentEntity.count) {
- load(0, true, true);
- }
-
- // peek at character
- int c = fCurrentEntity.ch[fCurrentEntity.position];
-
- // return peeked character
- if (fCurrentEntity.isExternal()) {
- return (c != '\r' && c != 0x85 && c != 0x2028) ? c : '\n';
- }
- else {
- return c;
- }
-
- } // peekChar():int
-
- /**
- * Returns the next character on the input.
- * <p>
- * <strong>Note:</strong> The character is consumed.
- *
- * @throws IOException Thrown if i/o error occurs.
- * @throws EOFException Thrown on end of file.
- */
- protected int scanChar(NameType nt) throws IOException {
-
- // load more characters, if needed
- if (fCurrentEntity.position == fCurrentEntity.count) {
- load(0, true, true);
- }
-
- // scan character
- int offset = fCurrentEntity.position;
- int c = fCurrentEntity.ch[fCurrentEntity.position++];
- boolean external = false;
- if (c == '\n' ||
- ((c == '\r' || c == 0x85 || c == 0x2028) && (external = fCurrentEntity.isExternal()))) {
- fCurrentEntity.lineNumber++;
- fCurrentEntity.columnNumber = 1;
- if (fCurrentEntity.position == fCurrentEntity.count) {
- invokeListeners(1);
- fCurrentEntity.ch[0] = (char)c;
- load(1, false, false);
- offset = 0;
- }
- if (c == '\r' && external) {
- int cc = fCurrentEntity.ch[fCurrentEntity.position++];
- if (cc != '\n' && cc != 0x85) {
- fCurrentEntity.position--;
- }
- }
- c = '\n';
- }
-
- // return character that was scanned
- fCurrentEntity.columnNumber++;
- if (!detectingVersion) {
- checkEntityLimit(nt, fCurrentEntity, offset, fCurrentEntity.position - offset);
- }
- return c;
-
- } // scanChar():int
-
- /**
- * Returns a string matching the NMTOKEN production appearing immediately
- * on the input as a symbol, or null if NMTOKEN Name string is present.
- * <p>
- * <strong>Note:</strong> The NMTOKEN characters are consumed.
- * <p>
- * <strong>Note:</strong> The string returned must be a symbol. The
- * SymbolTable can be used for this purpose.
- *
- * @throws IOException Thrown if i/o error occurs.
- * @throws EOFException Thrown on end of file.
- *
- * @see com.sun.org.apache.xerces.internal.util.SymbolTable
- * @see com.sun.org.apache.xerces.internal.util.XML11Char#isXML11Name
- */
- protected String scanNmtoken() throws IOException {
- // load more characters, if needed
- if (fCurrentEntity.position == fCurrentEntity.count) {
- load(0, true, true);
- }
-
- // scan nmtoken
- int offset = fCurrentEntity.position;
-
- do {
- char ch = fCurrentEntity.ch[fCurrentEntity.position];
- if (XML11Char.isXML11Name(ch)) {
- if (++fCurrentEntity.position == fCurrentEntity.count) {
- int length = fCurrentEntity.position - offset;
- invokeListeners(length);
- if (length == fCurrentEntity.ch.length) {
- // bad luck we have to resize our buffer
- char[] tmp = new char[fCurrentEntity.ch.length << 1];
- System.arraycopy(fCurrentEntity.ch, offset,
- tmp, 0, length);
- fCurrentEntity.ch = tmp;
- }
- else {
- System.arraycopy(fCurrentEntity.ch, offset,
- fCurrentEntity.ch, 0, length);
- }
- offset = 0;
- if (load(length, false, false)) {
- break;
- }
- }
- }
- else if (XML11Char.isXML11NameHighSurrogate(ch)) {
- if (++fCurrentEntity.position == fCurrentEntity.count) {
- int length = fCurrentEntity.position - offset;
- invokeListeners(length);
- if (length == fCurrentEntity.ch.length) {
- // bad luck we have to resize our buffer
- char[] tmp = new char[fCurrentEntity.ch.length << 1];
- System.arraycopy(fCurrentEntity.ch, offset,
- tmp, 0, length);
- fCurrentEntity.ch = tmp;
- }
- else {
- System.arraycopy(fCurrentEntity.ch, offset,
- fCurrentEntity.ch, 0, length);
- }
- offset = 0;
- if (load(length, false, false)) {
- --fCurrentEntity.startPosition;
- --fCurrentEntity.position;
- break;
- }
- }
- char ch2 = fCurrentEntity.ch[fCurrentEntity.position];
- if ( !XMLChar.isLowSurrogate(ch2) ||
- !XML11Char.isXML11Name(XMLChar.supplemental(ch, ch2)) ) {
- --fCurrentEntity.position;
- break;
- }
- if (++fCurrentEntity.position == fCurrentEntity.count) {
- int length = fCurrentEntity.position - offset;
- invokeListeners(length);
- if (length == fCurrentEntity.ch.length) {
- // bad luck we have to resize our buffer
- char[] tmp = new char[fCurrentEntity.ch.length << 1];
- System.arraycopy(fCurrentEntity.ch, offset,
- tmp, 0, length);
- fCurrentEntity.ch = tmp;
- }
- else {
- System.arraycopy(fCurrentEntity.ch, offset,
- fCurrentEntity.ch, 0, length);
- }
- offset = 0;
- if (load(length, false, false)) {
- break;
- }
- }
- }
- else {
- break;
- }
- }
- while (true);
-
- int length = fCurrentEntity.position - offset;
- fCurrentEntity.columnNumber += length;
-
- // return nmtoken
- String symbol = null;
- if (length > 0) {
- symbol = fSymbolTable.addSymbol(fCurrentEntity.ch, offset, length);
- }
- return symbol;
-
- } // scanNmtoken():String
-
- /**
- * Returns a string matching the Name production appearing immediately
- * on the input as a symbol, or null if no Name string is present.
- * <p>
- * <strong>Note:</strong> The Name characters are consumed.
- * <p>
- * <strong>Note:</strong> The string returned must be a symbol. The
- * SymbolTable can be used for this purpose.
- *
- * @param nt The type of the name (element or attribute)
- *
- * @throws IOException Thrown if i/o error occurs.
- * @throws EOFException Thrown on end of file.
- *
- * @see com.sun.org.apache.xerces.internal.util.SymbolTable
- * @see com.sun.org.apache.xerces.internal.util.XML11Char#isXML11Name
- * @see com.sun.org.apache.xerces.internal.util.XML11Char#isXML11NameStart
- */
- protected String scanName(NameType nt) throws IOException {
- // load more characters, if needed
- if (fCurrentEntity.position == fCurrentEntity.count) {
- load(0, true, true);
- }
-
- // scan name
- int offset = fCurrentEntity.position;
- char ch = fCurrentEntity.ch[offset];
-
- if (XML11Char.isXML11NameStart(ch)) {
- if (++fCurrentEntity.position == fCurrentEntity.count) {
- invokeListeners(1);
- fCurrentEntity.ch[0] = ch;
- offset = 0;
- if (load(1, false, false)) {
- fCurrentEntity.columnNumber++;
- String symbol = fSymbolTable.addSymbol(fCurrentEntity.ch, 0, 1);
- return symbol;
- }
- }
- }
- else if (XML11Char.isXML11NameHighSurrogate(ch)) {
- if (++fCurrentEntity.position == fCurrentEntity.count) {
- invokeListeners(1);
- fCurrentEntity.ch[0] = ch;
- offset = 0;
- if (load(1, false, false)) {
- --fCurrentEntity.position;
- --fCurrentEntity.startPosition;
- return null;
- }
- }
- char ch2 = fCurrentEntity.ch[fCurrentEntity.position];
- if ( !XMLChar.isLowSurrogate(ch2) ||
- !XML11Char.isXML11NameStart(XMLChar.supplemental(ch, ch2)) ) {
- --fCurrentEntity.position;
- return null;
- }
- if (++fCurrentEntity.position == fCurrentEntity.count) {
- invokeListeners(2);
- fCurrentEntity.ch[0] = ch;
- fCurrentEntity.ch[1] = ch2;
- offset = 0;
- if (load(2, false, false)) {
- fCurrentEntity.columnNumber += 2;
- String symbol = fSymbolTable.addSymbol(fCurrentEntity.ch, 0, 2);
- return symbol;
- }
- }
- }
- else {
- return null;
- }
-
- int length = 0;
- do {
- ch = fCurrentEntity.ch[fCurrentEntity.position];
- if (XML11Char.isXML11Name(ch)) {
- if ((length = checkBeforeLoad(fCurrentEntity, offset, offset)) > 0) {
- offset = 0;
- if (load(length, false, false)) {
- break;
- }
- }
- }
- else if (XML11Char.isXML11NameHighSurrogate(ch)) {
- if ((length = checkBeforeLoad(fCurrentEntity, offset, offset)) > 0) {
- offset = 0;
- if (load(length, false, false)) {
- --fCurrentEntity.position;
- --fCurrentEntity.startPosition;
- break;
- }
- }
- char ch2 = fCurrentEntity.ch[fCurrentEntity.position];
- if ( !XMLChar.isLowSurrogate(ch2) ||
- !XML11Char.isXML11Name(XMLChar.supplemental(ch, ch2)) ) {
- --fCurrentEntity.position;
- break;
- }
- if ((length = checkBeforeLoad(fCurrentEntity, offset, offset)) > 0) {
- offset = 0;
- if (load(length, false, false)) {
- break;
- }
- }
- }
- else {
- break;
- }
- }
- while (true);
-
- length = fCurrentEntity.position - offset;
- fCurrentEntity.columnNumber += length;
-
- // return name
- String symbol = null;
- if (length > 0) {
- checkLimit(Limit.MAX_NAME_LIMIT, fCurrentEntity, offset, length);
- checkEntityLimit(nt, fCurrentEntity, offset, length);
- symbol = fSymbolTable.addSymbol(fCurrentEntity.ch, offset, length);
- }
- return symbol;
-
- } // scanName():String
-
- /**
- * Returns a string matching the NCName production appearing immediately
- * on the input as a symbol, or null if no NCName string is present.
- * <p>
- * <strong>Note:</strong> The NCName characters are consumed.
- * <p>
- * <strong>Note:</strong> The string returned must be a symbol. The
- * SymbolTable can be used for this purpose.
- *
- * @throws IOException Thrown if i/o error occurs.
- * @throws EOFException Thrown on end of file.
- *
- * @see com.sun.org.apache.xerces.internal.util.SymbolTable
- * @see com.sun.org.apache.xerces.internal.util.XML11Char#isXML11NCName
- * @see com.sun.org.apache.xerces.internal.util.XML11Char#isXML11NCNameStart
- */
- protected String scanNCName() throws IOException {
-
- // load more characters, if needed
- if (fCurrentEntity.position == fCurrentEntity.count) {
- load(0, true, true);
- }
-
- // scan name
- int offset = fCurrentEntity.position;
- char ch = fCurrentEntity.ch[offset];
-
- if (XML11Char.isXML11NCNameStart(ch)) {
- if (++fCurrentEntity.position == fCurrentEntity.count) {
- invokeListeners(1);
- fCurrentEntity.ch[0] = ch;
- offset = 0;
- if (load(1, false, false)) {
- fCurrentEntity.columnNumber++;
- String symbol = fSymbolTable.addSymbol(fCurrentEntity.ch, 0, 1);
- return symbol;
- }
- }
- }
- else if (XML11Char.isXML11NameHighSurrogate(ch)) {
- if (++fCurrentEntity.position == fCurrentEntity.count) {
- invokeListeners(1);
- fCurrentEntity.ch[0] = ch;
- offset = 0;
- if (load(1, false, false)) {
- --fCurrentEntity.position;
- --fCurrentEntity.startPosition;
- return null;
- }
- }
- char ch2 = fCurrentEntity.ch[fCurrentEntity.position];
- if ( !XMLChar.isLowSurrogate(ch2) ||
- !XML11Char.isXML11NCNameStart(XMLChar.supplemental(ch, ch2)) ) {
- --fCurrentEntity.position;
- return null;
- }
- if (++fCurrentEntity.position == fCurrentEntity.count) {
- invokeListeners(2);
- fCurrentEntity.ch[0] = ch;
- fCurrentEntity.ch[1] = ch2;
- offset = 0;
- if (load(2, false, false)) {
- fCurrentEntity.columnNumber += 2;
- String symbol = fSymbolTable.addSymbol(fCurrentEntity.ch, 0, 2);
- return symbol;
- }
- }
- }
- else {
- return null;
- }
-
- do {
- ch = fCurrentEntity.ch[fCurrentEntity.position];
- if (XML11Char.isXML11NCName(ch)) {
- if (++fCurrentEntity.position == fCurrentEntity.count) {
- int length = fCurrentEntity.position - offset;
- invokeListeners(length);
- if (length == fCurrentEntity.ch.length) {
- // bad luck we have to resize our buffer
- char[] tmp = new char[fCurrentEntity.ch.length << 1];
- System.arraycopy(fCurrentEntity.ch, offset,
- tmp, 0, length);
- fCurrentEntity.ch = tmp;
- }
- else {
- System.arraycopy(fCurrentEntity.ch, offset,
- fCurrentEntity.ch, 0, length);
- }
- offset = 0;
- if (load(length, false, false)) {
- break;
- }
- }
- }
- else if (XML11Char.isXML11NameHighSurrogate(ch)) {
- if (++fCurrentEntity.position == fCurrentEntity.count) {
- int length = fCurrentEntity.position - offset;
- invokeListeners(length);
- if (length == fCurrentEntity.ch.length) {
- // bad luck we have to resize our buffer
- char[] tmp = new char[fCurrentEntity.ch.length << 1];
- System.arraycopy(fCurrentEntity.ch, offset,
- tmp, 0, length);
- fCurrentEntity.ch = tmp;
- }
- else {
- System.arraycopy(fCurrentEntity.ch, offset,
- fCurrentEntity.ch, 0, length);
- }
- offset = 0;
- if (load(length, false, false)) {
- --fCurrentEntity.startPosition;
- --fCurrentEntity.position;
- break;
- }
- }
- char ch2 = fCurrentEntity.ch[fCurrentEntity.position];
- if ( !XMLChar.isLowSurrogate(ch2) ||
- !XML11Char.isXML11NCName(XMLChar.supplemental(ch, ch2)) ) {
- --fCurrentEntity.position;
- break;
- }
- if (++fCurrentEntity.position == fCurrentEntity.count) {
- int length = fCurrentEntity.position - offset;
- invokeListeners(length);
- if (length == fCurrentEntity.ch.length) {
- // bad luck we have to resize our buffer
- char[] tmp = new char[fCurrentEntity.ch.length << 1];
- System.arraycopy(fCurrentEntity.ch, offset,
- tmp, 0, length);
- fCurrentEntity.ch = tmp;
- }
- else {
- System.arraycopy(fCurrentEntity.ch, offset,
- fCurrentEntity.ch, 0, length);
- }
- offset = 0;
- if (load(length, false, false)) {
- break;
- }
- }
- }
- else {
- break;
- }
- }
- while (true);
-
- int length = fCurrentEntity.position - offset;
- fCurrentEntity.columnNumber += length;
-
- // return name
- String symbol = null;
- if (length > 0) {
- symbol = fSymbolTable.addSymbol(fCurrentEntity.ch, offset, length);
- }
- return symbol;
-
- } // scanNCName():String
-
- /**
- * Scans a qualified name from the input, setting the fields of the
- * QName structure appropriately.
- * <p>
- * <strong>Note:</strong> The qualified name characters are consumed.
- * <p>
- * <strong>Note:</strong> The strings used to set the values of the
- * QName structure must be symbols. The SymbolTable can be used for
- * this purpose.
- *
- * @param qname The qualified name structure to fill.
- * @param nt The type of the name (element or attribute)
- *
- * @return Returns true if a qualified name appeared immediately on
- * the input and was scanned, false otherwise.
- *
- * @throws IOException Thrown if i/o error occurs.
- * @throws EOFException Thrown on end of file.
- *
- * @see com.sun.org.apache.xerces.internal.util.SymbolTable
- * @see com.sun.org.apache.xerces.internal.util.XML11Char#isXML11Name
- * @see com.sun.org.apache.xerces.internal.util.XML11Char#isXML11NameStart
- */
- protected boolean scanQName(QName qname, XMLScanner.NameType nt) throws IOException {
-
- // load more characters, if needed
- if (fCurrentEntity.position == fCurrentEntity.count) {
- load(0, true, true);
- }
-
- // scan qualified name
- int offset = fCurrentEntity.position;
- char ch = fCurrentEntity.ch[offset];
-
- if (XML11Char.isXML11NCNameStart(ch)) {
- if (++fCurrentEntity.position == fCurrentEntity.count) {
- invokeListeners(1);
- fCurrentEntity.ch[0] = ch;
- offset = 0;
- if (load(1, false, false)) {
- fCurrentEntity.columnNumber++;
- String name = fSymbolTable.addSymbol(fCurrentEntity.ch, 0, 1);
- qname.setValues(null, name, name, null);
- checkEntityLimit(nt, fCurrentEntity, 0, 1);
- return true;
- }
- }
- }
- else if (XML11Char.isXML11NameHighSurrogate(ch)) {
- if (++fCurrentEntity.position == fCurrentEntity.count) {
- invokeListeners(1);
- fCurrentEntity.ch[0] = ch;
- offset = 0;
- if (load(1, false, false)) {
- --fCurrentEntity.startPosition;
- --fCurrentEntity.position;
- return false;
- }
- }
- char ch2 = fCurrentEntity.ch[fCurrentEntity.position];
- if ( !XMLChar.isLowSurrogate(ch2) ||
- !XML11Char.isXML11NCNameStart(XMLChar.supplemental(ch, ch2)) ) {
- --fCurrentEntity.position;
- return false;
- }
- if (++fCurrentEntity.position == fCurrentEntity.count) {
- invokeListeners(2);
- fCurrentEntity.ch[0] = ch;
- fCurrentEntity.ch[1] = ch2;
- offset = 0;
- if (load(2, false, false)) {
- fCurrentEntity.columnNumber += 2;
- String name = fSymbolTable.addSymbol(fCurrentEntity.ch, 0, 2);
- qname.setValues(null, name, name, null);
- checkEntityLimit(nt, fCurrentEntity, 0, 2);
- return true;
- }
- }
- }
- else {
- return false;
- }
-
- int index = -1;
- int length = 0;
- boolean sawIncompleteSurrogatePair = false;
- do {
- ch = fCurrentEntity.ch[fCurrentEntity.position];
- if (XML11Char.isXML11Name(ch)) {
- if (ch == ':') {
- if (index != -1) {
- break;
- }
- index = fCurrentEntity.position;
- //check prefix before further read
- checkLimit(Limit.MAX_NAME_LIMIT, fCurrentEntity, offset, index - offset);
- }
- if ((length = checkBeforeLoad(fCurrentEntity, offset, index)) > 0) {
- if (index != -1) {
- index = index - offset;
- }
- offset = 0;
- if (load(length, false, false)) {
- break;
- }
- }
- }
- else if (XML11Char.isXML11NameHighSurrogate(ch)) {
- if ((length = checkBeforeLoad(fCurrentEntity, offset, index)) > 0) {
- if (index != -1) {
- index = index - offset;
- }
- offset = 0;
- if (load(length, false, false)) {
- sawIncompleteSurrogatePair = true;
- --fCurrentEntity.startPosition;
- --fCurrentEntity.position;
- break;
- }
- }
- char ch2 = fCurrentEntity.ch[fCurrentEntity.position];
- if ( !XMLChar.isLowSurrogate(ch2) ||
- !XML11Char.isXML11Name(XMLChar.supplemental(ch, ch2)) ) {
- sawIncompleteSurrogatePair = true;
- --fCurrentEntity.position;
- break;
- }
- if ((length = checkBeforeLoad(fCurrentEntity, offset, index)) > 0) {
- if (index != -1) {
- index = index - offset;
- }
- offset = 0;
- if (load(length, false, false)) {
- break;
- }
- }
- }
- else {
- break;
- }
- }
- while (true);
-
- length = fCurrentEntity.position - offset;
- fCurrentEntity.columnNumber += length;
-
- if (length > 0) {
- String prefix = null;
- String localpart = null;
- String rawname = fSymbolTable.addSymbol(fCurrentEntity.ch,
- offset, length);
- if (index != -1) {
- int prefixLength = index - offset;
- //check the result: prefix
- checkLimit(Limit.MAX_NAME_LIMIT, fCurrentEntity, offset, prefixLength);
- prefix = fSymbolTable.addSymbol(fCurrentEntity.ch,
- offset, prefixLength);
- int len = length - prefixLength - 1;
- int startLocal = index +1;
- if (!XML11Char.isXML11NCNameStart(fCurrentEntity.ch[startLocal]) &&
- (!XML11Char.isXML11NameHighSurrogate(fCurrentEntity.ch[startLocal]) ||
- sawIncompleteSurrogatePair)){
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "IllegalQName",
- null,
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
- //check the result: localpart
- checkLimit(Limit.MAX_NAME_LIMIT, fCurrentEntity, index + 1, len);
- localpart = fSymbolTable.addSymbol(fCurrentEntity.ch,
- index + 1, len);
-
- }
- else {
- localpart = rawname;
- //check the result: localpart
- checkLimit(Limit.MAX_NAME_LIMIT, fCurrentEntity, offset, length);
- }
- qname.setValues(prefix, localpart, rawname, null);
- checkEntityLimit(nt, fCurrentEntity, offset, length);
- return true;
- }
- return false;
-
- } // scanQName(QName):boolean
-
- /**
- * Scans a range of parsed character data, setting the fields of the
- * XMLString structure, appropriately.
- * <p>
- * <strong>Note:</strong> The characters are consumed.
- * <p>
- * <strong>Note:</strong> This method does not guarantee to return
- * the longest run of parsed character data. This method may return
- * before markup due to reaching the end of the input buffer or any
- * other reason.
- * <p>
- * <strong>Note:</strong> The fields contained in the XMLString
- * structure are not guaranteed to remain valid upon subsequent calls
- * to the entity scanner. Therefore, the caller is responsible for
- * immediately using the returned character data or making a copy of
- * the character data.
- *
- * @param content The content structure to fill.
- *
- * @return Returns the next character on the input, if known. This
- * value may be -1 but this does <em>note</em> designate
- * end of file.
- *
- * @throws IOException Thrown if i/o error occurs.
- * @throws EOFException Thrown on end of file.
- */
- protected int scanContent(XMLString content) throws IOException {
-
- // load more characters, if needed
- if (fCurrentEntity.position == fCurrentEntity.count) {
- load(0, true, true);
- }
- else if (fCurrentEntity.position == fCurrentEntity.count - 1) {
- invokeListeners(1);
- fCurrentEntity.ch[0] = fCurrentEntity.ch[fCurrentEntity.count - 1];
- load(1, false, false);
- fCurrentEntity.position = 0;
- fCurrentEntity.startPosition = 0;
- }
-
- // normalize newlines
- int offset = fCurrentEntity.position;
- int c = fCurrentEntity.ch[offset];
- int newlines = 0;
- boolean counted = false;
- boolean external = fCurrentEntity.isExternal();
- if (c == '\n' || ((c == '\r' || c == 0x85 || c == 0x2028) && external)) {
- do {
- c = fCurrentEntity.ch[fCurrentEntity.position++];
- if ((c == '\r' ) && external) {
- newlines++;
- fCurrentEntity.lineNumber++;
- fCurrentEntity.columnNumber = 1;
- if (fCurrentEntity.position == fCurrentEntity.count) {
- checkEntityLimit(null, fCurrentEntity, offset, newlines);
- offset = 0;
- fCurrentEntity.baseCharOffset += (fCurrentEntity.position - fCurrentEntity.startPosition);
- fCurrentEntity.position = newlines;
- fCurrentEntity.startPosition = newlines;
- if (load(newlines, false, true)) {
- counted = true;
- break;
- }
- }
- int cc = fCurrentEntity.ch[fCurrentEntity.position];
- if (cc == '\n' || cc == 0x85) {
- fCurrentEntity.position++;
- offset++;
- }
- /*** NEWLINE NORMALIZATION ***/
- else {
- newlines++;
- }
- }
- else if (c == '\n' || ((c == 0x85 || c == 0x2028) && external)) {
- newlines++;
- fCurrentEntity.lineNumber++;
- fCurrentEntity.columnNumber = 1;
- if (fCurrentEntity.position == fCurrentEntity.count) {
- checkEntityLimit(null, fCurrentEntity, offset, newlines);
- offset = 0;
- fCurrentEntity.baseCharOffset += (fCurrentEntity.position - fCurrentEntity.startPosition);
- fCurrentEntity.position = newlines;
- fCurrentEntity.startPosition = newlines;
- if (load(newlines, false, true)) {
- counted = true;
- break;
- }
- }
- }
- else {
- fCurrentEntity.position--;
- break;
- }
- } while (fCurrentEntity.position < fCurrentEntity.count - 1);
- for (int i = offset; i < fCurrentEntity.position; i++) {
- fCurrentEntity.ch[i] = '\n';
- }
- int length = fCurrentEntity.position - offset;
- if (fCurrentEntity.position == fCurrentEntity.count - 1) {
- checkEntityLimit(null, fCurrentEntity, offset, length);
- content.setValues(fCurrentEntity.ch, offset, length);
- return -1;
- }
- }
-
- // inner loop, scanning for content
- if (external) {
- while (fCurrentEntity.position < fCurrentEntity.count) {
- c = fCurrentEntity.ch[fCurrentEntity.position++];
- if (!XML11Char.isXML11Content(c) || c == 0x85 || c == 0x2028) {
- fCurrentEntity.position--;
- break;
- }
- }
- }
- else {
- while (fCurrentEntity.position < fCurrentEntity.count) {
- c = fCurrentEntity.ch[fCurrentEntity.position++];
- // In internal entities control characters are allowed to appear unescaped.
- if (!XML11Char.isXML11InternalEntityContent(c)) {
- fCurrentEntity.position--;
- break;
- }
- }
- }
- int length = fCurrentEntity.position - offset;
- fCurrentEntity.columnNumber += length - newlines;
- if (!counted) {
- checkEntityLimit(null, fCurrentEntity, offset, length);
- }
- content.setValues(fCurrentEntity.ch, offset, length);
-
- // return next character
- if (fCurrentEntity.position != fCurrentEntity.count) {
- c = fCurrentEntity.ch[fCurrentEntity.position];
- // REVISIT: Does this need to be updated to fix the
- // #x0D ^#x0A newline normalization problem? -Ac
- if ((c == '\r' || c == 0x85 || c == 0x2028) && external) {
- c = '\n';
- }
- }
- else {
- c = -1;
- }
- return c;
-
- } // scanContent(XMLString):int
-
- /**
- * Scans a range of attribute value data, setting the fields of the
- * XMLString structure, appropriately.
- * <p>
- * <strong>Note:</strong> The characters are consumed.
- * <p>
- * <strong>Note:</strong> This method does not guarantee to return
- * the longest run of attribute value data. This method may return
- * before the quote character due to reaching the end of the input
- * buffer or any other reason.
- * <p>
- * <strong>Note:</strong> The fields contained in the XMLString
- * structure are not guaranteed to remain valid upon subsequent calls
- * to the entity scanner. Therefore, the caller is responsible for
- * immediately using the returned character data or making a copy of
- * the character data.
- *
- * @param quote The quote character that signifies the end of the
- * attribute value data.
- * @param content The content structure to fill.
- * @param isNSURI a flag indicating whether the content is a Namespace URI
- *
- * @return Returns the next character on the input, if known. This
- * value may be -1 but this does <em>note</em> designate
- * end of file.
- *
- * @throws IOException Thrown if i/o error occurs.
- * @throws EOFException Thrown on end of file.
- */
- protected int scanLiteral(int quote, XMLString content, boolean isNSURI)
- throws IOException {
- // load more characters, if needed
- if (fCurrentEntity.position == fCurrentEntity.count) {
- load(0, true, true);
- }
- else if (fCurrentEntity.position == fCurrentEntity.count - 1) {
- invokeListeners(1);
- fCurrentEntity.ch[0] = fCurrentEntity.ch[fCurrentEntity.count - 1];
- load(1, false, false);
- fCurrentEntity.startPosition = 0;
- fCurrentEntity.position = 0;
- }
-
- // normalize newlines
- int offset = fCurrentEntity.position;
- int c = fCurrentEntity.ch[offset];
- int newlines = 0;
- boolean external = fCurrentEntity.isExternal();
- if (c == '\n' || ((c == '\r' || c == 0x85 || c == 0x2028) && external)) {
- do {
- c = fCurrentEntity.ch[fCurrentEntity.position++];
- if ((c == '\r' ) && external) {
- newlines++;
- fCurrentEntity.lineNumber++;
- fCurrentEntity.columnNumber = 1;
- if (fCurrentEntity.position == fCurrentEntity.count) {
- offset = 0;
- fCurrentEntity.baseCharOffset += (fCurrentEntity.position - fCurrentEntity.startPosition);
- fCurrentEntity.position = newlines;
- fCurrentEntity.startPosition = newlines;
- if (load(newlines, false, true)) {
- break;
- }
- }
- int cc = fCurrentEntity.ch[fCurrentEntity.position];
- if (cc == '\n' || cc == 0x85) {
- fCurrentEntity.position++;
- offset++;
- }
- /*** NEWLINE NORMALIZATION ***/
- else {
- newlines++;
- }
- }
- else if (c == '\n' || ((c == 0x85 || c == 0x2028) && external)) {
- newlines++;
- fCurrentEntity.lineNumber++;
- fCurrentEntity.columnNumber = 1;
- if (fCurrentEntity.position == fCurrentEntity.count) {
- offset = 0;
- fCurrentEntity.baseCharOffset += (fCurrentEntity.position - fCurrentEntity.startPosition);
- fCurrentEntity.position = newlines;
- fCurrentEntity.startPosition = newlines;
- if (load(newlines, false, true)) {
- break;
- }
- }
- }
- else {
- fCurrentEntity.position--;
- break;
- }
- } while (fCurrentEntity.position < fCurrentEntity.count - 1);
- for (int i = offset; i < fCurrentEntity.position; i++) {
- fCurrentEntity.ch[i] = '\n';
- }
- int length = fCurrentEntity.position - offset;
- if (fCurrentEntity.position == fCurrentEntity.count - 1) {
- content.setValues(fCurrentEntity.ch, offset, length);
- return -1;
- }
- }
-
- // scan literal value
- if (external) {
- while (fCurrentEntity.position < fCurrentEntity.count) {
- c = fCurrentEntity.ch[fCurrentEntity.position++];
- if (c == quote || c == '%' || !XML11Char.isXML11Content(c)
- || c == 0x85 || c == 0x2028) {
- fCurrentEntity.position--;
- break;
- }
- }
- }
- else {
- while (fCurrentEntity.position < fCurrentEntity.count) {
- c = fCurrentEntity.ch[fCurrentEntity.position++];
- // In internal entities control characters are allowed to appear unescaped.
- if ((c == quote && !fCurrentEntity.literal)
- || c == '%' || !XML11Char.isXML11InternalEntityContent(c)) {
- fCurrentEntity.position--;
- break;
- }
- }
- }
- int length = fCurrentEntity.position - offset;
- fCurrentEntity.columnNumber += length - newlines;
-
- checkEntityLimit(null, fCurrentEntity, offset, length);
- if (isNSURI) {
- checkLimit(Limit.MAX_NAME_LIMIT, fCurrentEntity, offset, length);
- }
- content.setValues(fCurrentEntity.ch, offset, length);
-
- // return next character
- if (fCurrentEntity.position != fCurrentEntity.count) {
- c = fCurrentEntity.ch[fCurrentEntity.position];
- // NOTE: We don't want to accidentally signal the
- // end of the literal if we're expanding an
- // entity appearing in the literal. -Ac
- if (c == quote && fCurrentEntity.literal) {
- c = -1;
- }
- }
- else {
- c = -1;
- }
- return c;
-
- } // scanLiteral(int,XMLString):int
-
- /**
- * Scans a range of character data up to the specicied delimiter,
- * setting the fields of the XMLString structure, appropriately.
- * <p>
- * <strong>Note:</strong> The characters are consumed.
- * <p>
- * <strong>Note:</strong> This assumes that the internal buffer is
- * at least the same size, or bigger, than the length of the delimiter
- * and that the delimiter contains at least one character.
- * <p>
- * <strong>Note:</strong> This method does not guarantee to return
- * the longest run of character data. This method may return before
- * the delimiter due to reaching the end of the input buffer or any
- * other reason.
- * <p>
- * <strong>Note:</strong> The fields contained in the XMLString
- * structure are not guaranteed to remain valid upon subsequent calls
- * to the entity scanner. Therefore, the caller is responsible for
- * immediately using the returned character data or making a copy of
- * the character data.
- *
- * @param delimiter The string that signifies the end of the character
- * data to be scanned.
- * @param data The data structure to fill.
- *
- * @return Returns true if there is more data to scan, false otherwise.
- *
- * @throws IOException Thrown if i/o error occurs.
- * @throws EOFException Thrown on end of file.
- */
- protected boolean scanData(String delimiter, XMLStringBuffer buffer)
- throws IOException {
-
- boolean done = false;
- int delimLen = delimiter.length();
- char charAt0 = delimiter.charAt(0);
- boolean external = fCurrentEntity.isExternal();
- do {
- // load more characters, if needed
- if (fCurrentEntity.position == fCurrentEntity.count) {
- load(0, true, false);
- }
-
- boolean bNextEntity = false;
-
- while ((fCurrentEntity.position >= fCurrentEntity.count - delimLen)
- && (!bNextEntity))
- {
- System.arraycopy(fCurrentEntity.ch,
- fCurrentEntity.position,
- fCurrentEntity.ch,
- 0,
- fCurrentEntity.count - fCurrentEntity.position);
-
- bNextEntity = load(fCurrentEntity.count - fCurrentEntity.position, false, false);
- fCurrentEntity.position = 0;
- fCurrentEntity.startPosition = 0;
- }
-
- if (fCurrentEntity.position >= fCurrentEntity.count - delimLen) {
- // something must be wrong with the input: e.g., file ends an unterminated comment
- int length = fCurrentEntity.count - fCurrentEntity.position;
- checkEntityLimit(NameType.COMMENT, fCurrentEntity, fCurrentEntity.position, length);
- buffer.append (fCurrentEntity.ch, fCurrentEntity.position, length);
- fCurrentEntity.columnNumber += fCurrentEntity.count;
- fCurrentEntity.baseCharOffset += (fCurrentEntity.position - fCurrentEntity.startPosition);
- fCurrentEntity.position = fCurrentEntity.count;
- fCurrentEntity.startPosition = fCurrentEntity.count;
- load(0,true, false);
- return false;
- }
-
- // normalize newlines
- int offset = fCurrentEntity.position;
- int c = fCurrentEntity.ch[offset];
- int newlines = 0;
- if (c == '\n' || ((c == '\r' || c == 0x85 || c == 0x2028) && external)) {
- do {
- c = fCurrentEntity.ch[fCurrentEntity.position++];
- if ((c == '\r' ) && external) {
- newlines++;
- fCurrentEntity.lineNumber++;
- fCurrentEntity.columnNumber = 1;
- if (fCurrentEntity.position == fCurrentEntity.count) {
- offset = 0;
- fCurrentEntity.baseCharOffset += (fCurrentEntity.position - fCurrentEntity.startPosition);
- fCurrentEntity.position = newlines;
- fCurrentEntity.startPosition = newlines;
- if (load(newlines, false, true)) {
- break;
- }
- }
- int cc = fCurrentEntity.ch[fCurrentEntity.position];
- if (cc == '\n' || cc == 0x85) {
- fCurrentEntity.position++;
- offset++;
- }
- /*** NEWLINE NORMALIZATION ***/
- else {
- newlines++;
- }
- }
- else if (c == '\n' || ((c == 0x85 || c == 0x2028) && external)) {
- newlines++;
- fCurrentEntity.lineNumber++;
- fCurrentEntity.columnNumber = 1;
- if (fCurrentEntity.position == fCurrentEntity.count) {
- offset = 0;
- fCurrentEntity.baseCharOffset += (fCurrentEntity.position - fCurrentEntity.startPosition);
- fCurrentEntity.position = newlines;
- fCurrentEntity.startPosition = newlines;
- fCurrentEntity.count = newlines;
- if (load(newlines, false, true)) {
- break;
- }
- }
- }
- else {
- fCurrentEntity.position--;
- break;
- }
- } while (fCurrentEntity.position < fCurrentEntity.count - 1);
- for (int i = offset; i < fCurrentEntity.position; i++) {
- fCurrentEntity.ch[i] = '\n';
- }
- int length = fCurrentEntity.position - offset;
- if (fCurrentEntity.position == fCurrentEntity.count - 1) {
- checkEntityLimit(NameType.COMMENT, fCurrentEntity, offset, length);
- buffer.append(fCurrentEntity.ch, offset, length);
- return true;
- }
- }
-
- // iterate over buffer looking for delimiter
- if (external) {
- OUTER: while (fCurrentEntity.position < fCurrentEntity.count) {
- c = fCurrentEntity.ch[fCurrentEntity.position++];
- if (c == charAt0) {
- // looks like we just hit the delimiter
- int delimOffset = fCurrentEntity.position - 1;
- for (int i = 1; i < delimLen; i++) {
- if (fCurrentEntity.position == fCurrentEntity.count) {
- fCurrentEntity.position -= i;
- break OUTER;
- }
- c = fCurrentEntity.ch[fCurrentEntity.position++];
- if (delimiter.charAt(i) != c) {
- fCurrentEntity.position--;
- break;
- }
- }
- if (fCurrentEntity.position == delimOffset + delimLen) {
- done = true;
- break;
- }
- }
- else if (c == '\n' || c == '\r' || c == 0x85 || c == 0x2028) {
- fCurrentEntity.position--;
- break;
- }
- // In external entities control characters cannot appear
- // as literals so do not skip over them.
- else if (!XML11Char.isXML11ValidLiteral(c)) {
- fCurrentEntity.position--;
- int length = fCurrentEntity.position - offset;
- fCurrentEntity.columnNumber += length - newlines;
- checkEntityLimit(NameType.COMMENT, fCurrentEntity, offset, length);
- buffer.append(fCurrentEntity.ch, offset, length);
- return true;
- }
- }
- }
- else {
- OUTER: while (fCurrentEntity.position < fCurrentEntity.count) {
- c = fCurrentEntity.ch[fCurrentEntity.position++];
- if (c == charAt0) {
- // looks like we just hit the delimiter
- int delimOffset = fCurrentEntity.position - 1;
- for (int i = 1; i < delimLen; i++) {
- if (fCurrentEntity.position == fCurrentEntity.count) {
- fCurrentEntity.position -= i;
- break OUTER;
- }
- c = fCurrentEntity.ch[fCurrentEntity.position++];
- if (delimiter.charAt(i) != c) {
- fCurrentEntity.position--;
- break;
- }
- }
- if (fCurrentEntity.position == delimOffset + delimLen) {
- done = true;
- break;
- }
- }
- else if (c == '\n') {
- fCurrentEntity.position--;
- break;
- }
- // Control characters are allowed to appear as literals
- // in internal entities.
- else if (!XML11Char.isXML11Valid(c)) {
- fCurrentEntity.position--;
- int length = fCurrentEntity.position - offset;
- fCurrentEntity.columnNumber += length - newlines;
- checkEntityLimit(NameType.COMMENT, fCurrentEntity, offset, length);
- buffer.append(fCurrentEntity.ch, offset, length);
- return true;
- }
- }
- }
- int length = fCurrentEntity.position - offset;
- fCurrentEntity.columnNumber += length - newlines;
- checkEntityLimit(NameType.COMMENT, fCurrentEntity, offset, length);
- if (done) {
- length -= delimLen;
- }
- buffer.append(fCurrentEntity.ch, offset, length);
-
- // return true if string was skipped
- } while (!done);
- return !done;
-
- } // scanData(String,XMLString)
-
- /**
- * Skips a character appearing immediately on the input.
- * <p>
- * <strong>Note:</strong> The character is consumed only if it matches
- * the specified character.
- *
- * @param c The character to skip.
- *
- * @return Returns true if the character was skipped.
- *
- * @throws IOException Thrown if i/o error occurs.
- * @throws EOFException Thrown on end of file.
- */
- protected boolean skipChar(int c, NameType nt) throws IOException {
-
- // load more characters, if needed
- if (fCurrentEntity.position == fCurrentEntity.count) {
- load(0, true, true);
- }
-
- // skip character
- int offset = fCurrentEntity.position;
- int cc = fCurrentEntity.ch[fCurrentEntity.position];
- if (cc == c) {
- fCurrentEntity.position++;
- if (c == '\n') {
- fCurrentEntity.lineNumber++;
- fCurrentEntity.columnNumber = 1;
- }
- else {
- fCurrentEntity.columnNumber++;
- }
- checkEntityLimit(nt, fCurrentEntity, offset, fCurrentEntity.position - offset);
- return true;
- }
- else if (c == '\n' && ((cc == 0x2028 || cc == 0x85) && fCurrentEntity.isExternal())) {
- fCurrentEntity.position++;
- fCurrentEntity.lineNumber++;
- fCurrentEntity.columnNumber = 1;
- checkEntityLimit(nt, fCurrentEntity, offset, fCurrentEntity.position - offset);
- return true;
- }
- else if (c == '\n' && (cc == '\r' ) && fCurrentEntity.isExternal()) {
- // handle newlines
- if (fCurrentEntity.position == fCurrentEntity.count) {
- invokeListeners(1);
- fCurrentEntity.ch[0] = (char)cc;
- load(1, false, false);
- }
- int ccc = fCurrentEntity.ch[++fCurrentEntity.position];
- if (ccc == '\n' || ccc == 0x85) {
- fCurrentEntity.position++;
- }
- fCurrentEntity.lineNumber++;
- fCurrentEntity.columnNumber = 1;
- checkEntityLimit(nt, fCurrentEntity, offset, fCurrentEntity.position - offset);
- return true;
- }
-
- // character was not skipped
- return false;
-
- } // skipChar(int):boolean
-
- /**
- * Skips space characters appearing immediately on the input.
- * <p>
- * <strong>Note:</strong> The characters are consumed only if they are
- * space characters.
- *
- * @return Returns true if at least one space character was skipped.
- *
- * @throws IOException Thrown if i/o error occurs.
- * @throws EOFException Thrown on end of file.
- *
- * @see com.sun.org.apache.xerces.internal.util.XMLChar#isSpace
- * @see com.sun.org.apache.xerces.internal.util.XML11Char#isXML11Space
- */
- protected boolean skipSpaces() throws IOException {
-
- // load more characters, if needed
- if (fCurrentEntity.position == fCurrentEntity.count) {
- load(0, true, true);
- }
-
-
- //we are doing this check only in skipSpace() because it is called by
- //fMiscDispatcher and we want the parser to exit gracefully when document
- //is well-formed.
- //it is possible that end of document is reached and
- //fCurrentEntity becomes null
- //nothing was read so entity changed 'false' should be returned.
- if(fCurrentEntity == null){
- return false ;
- }
-
- // skip spaces
- int c = fCurrentEntity.ch[fCurrentEntity.position];
- int offset = fCurrentEntity.position - 1;
- // External -- Match: S + 0x85 + 0x2028, and perform end of line normalization
- if (fCurrentEntity.isExternal()) {
- if (XML11Char.isXML11Space(c)) {
- do {
- boolean entityChanged = false;
- // handle newlines
- if (c == '\n' || c == '\r' || c == 0x85 || c == 0x2028) {
- fCurrentEntity.lineNumber++;
- fCurrentEntity.columnNumber = 1;
- if (fCurrentEntity.position == fCurrentEntity.count - 1) {
- invokeListeners(1);
- fCurrentEntity.ch[0] = (char)c;
- entityChanged = load(1, true, false);
- if (!entityChanged) {
- // the load change the position to be 1,
- // need to restore it when entity not changed
- fCurrentEntity.startPosition = 0;
- fCurrentEntity.position = 0;
- } else if(fCurrentEntity == null){
- return true ;
- }
-
- }
- if (c == '\r') {
- // REVISIT: Does this need to be updated to fix the
- // #x0D ^#x0A newline normalization problem? -Ac
- int cc = fCurrentEntity.ch[++fCurrentEntity.position];
- if (cc != '\n' && cc != 0x85 ) {
- fCurrentEntity.position--;
- }
- }
- }
- else {
- fCurrentEntity.columnNumber++;
- }
-
- //If this is a general entity, spaces within a start element should be counted
- checkEntityLimit(null, fCurrentEntity, offset, fCurrentEntity.position - offset);
- offset = fCurrentEntity.position;
-
- // load more characters, if needed
- if (!entityChanged)
- fCurrentEntity.position++;
- if (fCurrentEntity.position == fCurrentEntity.count) {
- load(0, true, true);
-
- if(fCurrentEntity == null){
- return true ;
- }
-
- }
- } while (XML11Char.isXML11Space(c = fCurrentEntity.ch[fCurrentEntity.position]));
- return true;
- }
- }
- // Internal -- Match: S (only)
- else if (XMLChar.isSpace(c)) {
- do {
- boolean entityChanged = false;
- // handle newlines
- if (c == '\n') {
- fCurrentEntity.lineNumber++;
- fCurrentEntity.columnNumber = 1;
- if (fCurrentEntity.position == fCurrentEntity.count - 1) {
- invokeListeners(1);
- fCurrentEntity.ch[0] = (char)c;
- entityChanged = load(1, true, false);
- if (!entityChanged) {
- // the load change the position to be 1,
- // need to restore it when entity not changed
- fCurrentEntity.startPosition = 0;
- fCurrentEntity.position = 0;
- } else if(fCurrentEntity == null){
- return true ;
- }
- }
- }
- else {
- fCurrentEntity.columnNumber++;
- }
-
- //If this is a general entity, spaces within a start element should be counted
- checkEntityLimit(null, fCurrentEntity, offset, fCurrentEntity.position - offset);
- offset = fCurrentEntity.position;
-
- // load more characters, if needed
- if (!entityChanged)
- fCurrentEntity.position++;
- if (fCurrentEntity.position == fCurrentEntity.count) {
- load(0, true, true);
-
- if(fCurrentEntity == null){
- return true ;
- }
-
- }
- } while (XMLChar.isSpace(c = fCurrentEntity.ch[fCurrentEntity.position]));
- return true;
- }
-
- // no spaces were found
- return false;
-
- } // skipSpaces():boolean
-
- /**
- * Skips the specified string appearing immediately on the input.
- * <p>
- * <strong>Note:</strong> The characters are consumed only if they are
- * space characters.
- *
- * @param s The string to skip.
- *
- * @return Returns true if the string was skipped.
- *
- * @throws IOException Thrown if i/o error occurs.
- * @throws EOFException Thrown on end of file.
- */
- protected boolean skipString(String s) throws IOException {
-
- // load more characters, if needed
- if (fCurrentEntity.position == fCurrentEntity.count) {
- load(0, true, true);
- }
-
- // skip string
- final int length = s.length();
- final int beforeSkip = fCurrentEntity.position ;
- for (int i = 0; i < length; i++) {
- char c = fCurrentEntity.ch[fCurrentEntity.position++];
- if (c != s.charAt(i)) {
- fCurrentEntity.position -= i + 1;
- return false;
- }
- if (i < length - 1 && fCurrentEntity.position == fCurrentEntity.count) {
- invokeListeners(0);
- System.arraycopy(fCurrentEntity.ch, fCurrentEntity.count - i - 1, fCurrentEntity.ch, 0, i + 1);
- // REVISIT: Can a string to be skipped cross an
- // entity boundary? -Ac
- if (load(i + 1, false, false)) {
- fCurrentEntity.startPosition -= i + 1;
- fCurrentEntity.position -= i + 1;
- return false;
- }
- }
- }
- fCurrentEntity.columnNumber += length;
- if (!detectingVersion) {
- checkEntityLimit(null, fCurrentEntity, beforeSkip, length);
- }
- return true;
-
- } // skipString(String):boolean
-
-} // class XML11EntityScanner
diff --git a/src/com/sun/org/apache/xerces/internal/impl/XML11NSDocumentScannerImpl.java b/src/com/sun/org/apache/xerces/internal/impl/XML11NSDocumentScannerImpl.java
deleted file mode 100644
index ae7d7b8..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/XML11NSDocumentScannerImpl.java
+++ /dev/null
@@ -1,892 +0,0 @@
-/*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
- */
-
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl;
-
-import java.io.IOException;
-
-import com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidatorFilter;
-import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter;
-import com.sun.org.apache.xerces.internal.util.XMLAttributesImpl;
-import com.sun.org.apache.xerces.internal.util.XMLSymbols;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager;
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource;
-import javax.xml.stream.events.XMLEvent;
-
-
-/**
- * The scanner acts as the source for the document
- * information which is communicated to the document handler.
- *
- * This class scans an XML document, checks if document has a DTD, and if
- * DTD is not found the scanner will remove the DTD Validator from the pipeline and perform
- * namespace binding.
- *
- * Note: This scanner should only be used when the namespace processing is on!
- *
- * <p>
- * This component requires the following features and properties from the
- * component manager that uses it:
- * <ul>
- * <li>http://xml.org/sax/features/namespaces {true} -- if the value of this
- * feature is set to false this scanner must not be used.</li>
- * <li>http://xml.org/sax/features/validation</li>
- * <li>http://apache.org/xml/features/nonvalidating/load-external-dtd</li>
- * <li>http://apache.org/xml/features/scanner/notify-char-refs</li>
- * <li>http://apache.org/xml/features/scanner/notify-builtin-refs</li>
- * <li>http://apache.org/xml/properties/internal/symbol-table</li>
- * <li>http://apache.org/xml/properties/internal/error-reporter</li>
- * <li>http://apache.org/xml/properties/internal/entity-manager</li>
- * <li>http://apache.org/xml/properties/internal/dtd-scanner</li>
- * </ul>
- *
- * @xerces.internal
- *
- * @author Elena Litani, IBM
- * @author Michael Glavassevich, IBM
- * @author Sunitha Reddy, Sun Microsystems
- * @version $Id: XML11NSDocumentScannerImpl.java,v 1.6 2010-11-01 04:39:40 joehw Exp $
- */
-public class XML11NSDocumentScannerImpl extends XML11DocumentScannerImpl {
-
- /**
- * If is true, the dtd validator is no longer in the pipeline
- * and the scanner should bind namespaces
- */
- protected boolean fBindNamespaces;
-
- /**
- * If validating parser, make sure we report an error in the
- * scanner if DTD grammar is missing.
- */
- protected boolean fPerformValidation;
-
- // private data
- //
-
- /** DTD validator */
- private XMLDTDValidatorFilter fDTDValidator;
-
- /**
- * Saw spaces after element name or between attributes.
- *
- * This is reserved for the case where scanning of a start element spans
- * several methods, as is the case when scanning the start of a root element
- * where a DTD external subset may be read after scanning the element name.
- */
- private boolean fSawSpace;
-
-
- /**
- * The scanner is responsible for removing DTD validator
- * from the pipeline if it is not needed.
- *
- * @param validator the DTD validator from the pipeline
- */
- public void setDTDValidator(XMLDTDValidatorFilter validator) {
- fDTDValidator = validator;
- }
-
- /**
- * Scans a start element. This method will handle the binding of
- * namespace information and notifying the handler of the start
- * of the element.
- * <p>
- * <pre>
- * [44] EmptyElemTag ::= '&lt;' Name (S Attribute)* S? '/>'
- * [40] STag ::= '&lt;' Name (S Attribute)* S? '>'
- * </pre>
- * <p>
- * <strong>Note:</strong> This method assumes that the leading
- * '&lt;' character has been consumed.
- * <p>
- * <strong>Note:</strong> This method uses the fElementQName and
- * fAttributes variables. The contents of these variables will be
- * destroyed. The caller should copy important information out of
- * these variables before calling this method.
- *
- * @return True if element is empty. (i.e. It matches
- * production [44].
- */
- protected boolean scanStartElement() throws IOException, XNIException {
-
- if (DEBUG_START_END_ELEMENT)
- System.out.println(">>> scanStartElementNS()");
- // Note: namespace processing is on by default
- fEntityScanner.scanQName(fElementQName, NameType.ATTRIBUTE);
- // REVISIT - [Q] Why do we need this local variable? -- mrglavas
- String rawname = fElementQName.rawname;
- if (fBindNamespaces) {
- fNamespaceContext.pushContext();
- if (fScannerState == SCANNER_STATE_ROOT_ELEMENT) {
- if (fPerformValidation) {
- fErrorReporter.reportError(
- XMLMessageFormatter.XML_DOMAIN,
- "MSG_GRAMMAR_NOT_FOUND",
- new Object[] { rawname },
- XMLErrorReporter.SEVERITY_ERROR);
-
- if (fDoctypeName == null
- || !fDoctypeName.equals(rawname)) {
- fErrorReporter.reportError(
- XMLMessageFormatter.XML_DOMAIN,
- "RootElementTypeMustMatchDoctypedecl",
- new Object[] { fDoctypeName, rawname },
- XMLErrorReporter.SEVERITY_ERROR);
- }
- }
- }
- }
-
- // push element stack
- fCurrentElement = fElementStack.pushElement(fElementQName);
-
- // attributes
- boolean empty = false;
- fAttributes.removeAllAttributes();
- do {
- // spaces
- boolean sawSpace = fEntityScanner.skipSpaces();
-
- // end tag?
- int c = fEntityScanner.peekChar();
- if (c == '>') {
- fEntityScanner.scanChar(null);
- break;
- } else if (c == '/') {
- fEntityScanner.scanChar(null);
- if (!fEntityScanner.skipChar('>', null)) {
- reportFatalError(
- "ElementUnterminated",
- new Object[] { rawname });
- }
- empty = true;
- break;
- } else if (!isValidNameStartChar(c) || !sawSpace) {
- // Second chance. Check if this character is a high
- // surrogate of a valid name start character.
- if (!isValidNameStartHighSurrogate(c) || !sawSpace) {
- reportFatalError(
- "ElementUnterminated",
- new Object[] { rawname });
- }
- }
-
- // attributes
- scanAttribute(fAttributes);
- if (fSecurityManager != null && (!fSecurityManager.isNoLimit(fElementAttributeLimit)) &&
- fAttributes.getLength() > fElementAttributeLimit){
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "ElementAttributeLimit",
- new Object[]{rawname, new Integer(fElementAttributeLimit) },
- XMLErrorReporter.SEVERITY_FATAL_ERROR );
- }
-
- } while (true);
-
- if (fBindNamespaces) {
- // REVISIT: is it required? forbit xmlns prefix for element
- if (fElementQName.prefix == XMLSymbols.PREFIX_XMLNS) {
- fErrorReporter.reportError(
- XMLMessageFormatter.XMLNS_DOMAIN,
- "ElementXMLNSPrefix",
- new Object[] { fElementQName.rawname },
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
-
- // bind the element
- String prefix =
- fElementQName.prefix != null
- ? fElementQName.prefix
- : XMLSymbols.EMPTY_STRING;
- // assign uri to the element
- fElementQName.uri = fNamespaceContext.getURI(prefix);
- // make sure that object in the element stack is updated as well
- fCurrentElement.uri = fElementQName.uri;
-
- if (fElementQName.prefix == null && fElementQName.uri != null) {
- fElementQName.prefix = XMLSymbols.EMPTY_STRING;
- // making sure that the object in the element stack is updated too.
- fCurrentElement.prefix = XMLSymbols.EMPTY_STRING;
- }
- if (fElementQName.prefix != null && fElementQName.uri == null) {
- fErrorReporter.reportError(
- XMLMessageFormatter.XMLNS_DOMAIN,
- "ElementPrefixUnbound",
- new Object[] {
- fElementQName.prefix,
- fElementQName.rawname },
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
-
- // bind attributes (xmlns are already bound bellow)
- int length = fAttributes.getLength();
- for (int i = 0; i < length; i++) {
- fAttributes.getName(i, fAttributeQName);
-
- String aprefix =
- fAttributeQName.prefix != null
- ? fAttributeQName.prefix
- : XMLSymbols.EMPTY_STRING;
- String uri = fNamespaceContext.getURI(aprefix);
- // REVISIT: try removing the first "if" and see if it is faster.
- //
- if (fAttributeQName.uri != null
- && fAttributeQName.uri == uri) {
- continue;
- }
- if (aprefix != XMLSymbols.EMPTY_STRING) {
- fAttributeQName.uri = uri;
- if (uri == null) {
- fErrorReporter.reportError(
- XMLMessageFormatter.XMLNS_DOMAIN,
- "AttributePrefixUnbound",
- new Object[] {
- fElementQName.rawname,
- fAttributeQName.rawname,
- aprefix },
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
- fAttributes.setURI(i, uri);
- }
- }
-
- if (length > 1) {
- QName name = fAttributes.checkDuplicatesNS();
- if (name != null) {
- if (name.uri != null) {
- fErrorReporter.reportError(
- XMLMessageFormatter.XMLNS_DOMAIN,
- "AttributeNSNotUnique",
- new Object[] {
- fElementQName.rawname,
- name.localpart,
- name.uri },
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- } else {
- fErrorReporter.reportError(
- XMLMessageFormatter.XMLNS_DOMAIN,
- "AttributeNotUnique",
- new Object[] {
- fElementQName.rawname,
- name.rawname },
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
- }
- }
- }
-
- // call handler
- if (empty) {
- //decrease the markup depth..
- fMarkupDepth--;
-
- // check that this element was opened in the same entity
- if (fMarkupDepth < fEntityStack[fEntityDepth - 1]) {
- reportFatalError(
- "ElementEntityMismatch",
- new Object[] { fCurrentElement.rawname });
- }
-
- if (fDocumentHandler != null) {
- fDocumentHandler.emptyElement(fElementQName, fAttributes, null);
- }
-
- /*if (fBindNamespaces) {
- fNamespaceContext.popContext();
- }*/
- fScanEndElement = true;
-
- //pop the element off the stack..
- fElementStack.popElement();
- } else {
- if(dtdGrammarUtil != null) {
- dtdGrammarUtil.startElement(fElementQName, fAttributes);
- }
-
- if (fDocumentHandler != null) {
- fDocumentHandler.startElement(fElementQName, fAttributes, null);
- }
- }
-
- if (DEBUG_START_END_ELEMENT)
- System.out.println("<<< scanStartElement(): " + empty);
- return empty;
-
- } // scanStartElement():boolean
-
- /**
- * Scans the name of an element in a start or empty tag.
- *
- * @see #scanStartElement()
- */
- protected void scanStartElementName ()
- throws IOException, XNIException {
- // Note: namespace processing is on by default
- fEntityScanner.scanQName(fElementQName, NameType.ATTRIBUTE);
- // Must skip spaces here because the DTD scanner
- // would consume them at the end of the external subset.
- fSawSpace = fEntityScanner.skipSpaces();
- } // scanStartElementName()
-
- /**
- * Scans the remainder of a start or empty tag after the element name.
- *
- * @see #scanStartElement
- * @return True if element is empty.
- */
- protected boolean scanStartElementAfterName()
- throws IOException, XNIException {
-
- // REVISIT - [Q] Why do we need this local variable? -- mrglavas
- String rawname = fElementQName.rawname;
- if (fBindNamespaces) {
- fNamespaceContext.pushContext();
- if (fScannerState == SCANNER_STATE_ROOT_ELEMENT) {
- if (fPerformValidation) {
- fErrorReporter.reportError(
- XMLMessageFormatter.XML_DOMAIN,
- "MSG_GRAMMAR_NOT_FOUND",
- new Object[] { rawname },
- XMLErrorReporter.SEVERITY_ERROR);
-
- if (fDoctypeName == null
- || !fDoctypeName.equals(rawname)) {
- fErrorReporter.reportError(
- XMLMessageFormatter.XML_DOMAIN,
- "RootElementTypeMustMatchDoctypedecl",
- new Object[] { fDoctypeName, rawname },
- XMLErrorReporter.SEVERITY_ERROR);
- }
- }
- }
- }
-
- // push element stack
- fCurrentElement = fElementStack.pushElement(fElementQName);
-
- // attributes
- boolean empty = false;
- fAttributes.removeAllAttributes();
- do {
-
- // end tag?
- int c = fEntityScanner.peekChar();
- if (c == '>') {
- fEntityScanner.scanChar(null);
- break;
- } else if (c == '/') {
- fEntityScanner.scanChar(null);
- if (!fEntityScanner.skipChar('>', null)) {
- reportFatalError(
- "ElementUnterminated",
- new Object[] { rawname });
- }
- empty = true;
- break;
- } else if (!isValidNameStartChar(c) || !fSawSpace) {
- // Second chance. Check if this character is a high
- // surrogate of a valid name start character.
- if (!isValidNameStartHighSurrogate(c) || !fSawSpace) {
- reportFatalError(
- "ElementUnterminated",
- new Object[] { rawname });
- }
- }
-
- // attributes
- scanAttribute(fAttributes);
-
- // spaces
- fSawSpace = fEntityScanner.skipSpaces();
-
- } while (true);
-
- if (fBindNamespaces) {
- // REVISIT: is it required? forbit xmlns prefix for element
- if (fElementQName.prefix == XMLSymbols.PREFIX_XMLNS) {
- fErrorReporter.reportError(
- XMLMessageFormatter.XMLNS_DOMAIN,
- "ElementXMLNSPrefix",
- new Object[] { fElementQName.rawname },
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
-
- // bind the element
- String prefix =
- fElementQName.prefix != null
- ? fElementQName.prefix
- : XMLSymbols.EMPTY_STRING;
- // assign uri to the element
- fElementQName.uri = fNamespaceContext.getURI(prefix);
- // make sure that object in the element stack is updated as well
- fCurrentElement.uri = fElementQName.uri;
-
- if (fElementQName.prefix == null && fElementQName.uri != null) {
- fElementQName.prefix = XMLSymbols.EMPTY_STRING;
- // making sure that the object in the element stack is updated too.
- fCurrentElement.prefix = XMLSymbols.EMPTY_STRING;
- }
- if (fElementQName.prefix != null && fElementQName.uri == null) {
- fErrorReporter.reportError(
- XMLMessageFormatter.XMLNS_DOMAIN,
- "ElementPrefixUnbound",
- new Object[] {
- fElementQName.prefix,
- fElementQName.rawname },
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
-
- // bind attributes (xmlns are already bound bellow)
- int length = fAttributes.getLength();
- for (int i = 0; i < length; i++) {
- fAttributes.getName(i, fAttributeQName);
-
- String aprefix =
- fAttributeQName.prefix != null
- ? fAttributeQName.prefix
- : XMLSymbols.EMPTY_STRING;
- String uri = fNamespaceContext.getURI(aprefix);
- // REVISIT: try removing the first "if" and see if it is faster.
- //
- if (fAttributeQName.uri != null
- && fAttributeQName.uri == uri) {
- continue;
- }
- if (aprefix != XMLSymbols.EMPTY_STRING) {
- fAttributeQName.uri = uri;
- if (uri == null) {
- fErrorReporter.reportError(
- XMLMessageFormatter.XMLNS_DOMAIN,
- "AttributePrefixUnbound",
- new Object[] {
- fElementQName.rawname,
- fAttributeQName.rawname,
- aprefix },
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
- fAttributes.setURI(i, uri);
- }
- }
-
- if (length > 1) {
- QName name = fAttributes.checkDuplicatesNS();
- if (name != null) {
- if (name.uri != null) {
- fErrorReporter.reportError(
- XMLMessageFormatter.XMLNS_DOMAIN,
- "AttributeNSNotUnique",
- new Object[] {
- fElementQName.rawname,
- name.localpart,
- name.uri },
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- } else {
- fErrorReporter.reportError(
- XMLMessageFormatter.XMLNS_DOMAIN,
- "AttributeNotUnique",
- new Object[] {
- fElementQName.rawname,
- name.rawname },
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
- }
- }
- }
-
- // call handler
- if (fDocumentHandler != null) {
- if (empty) {
-
- //decrease the markup depth..
- fMarkupDepth--;
-
- // check that this element was opened in the same entity
- if (fMarkupDepth < fEntityStack[fEntityDepth - 1]) {
- reportFatalError(
- "ElementEntityMismatch",
- new Object[] { fCurrentElement.rawname });
- }
-
- fDocumentHandler.emptyElement(fElementQName, fAttributes, null);
-
- if (fBindNamespaces) {
- fNamespaceContext.popContext();
- }
- //pop the element off the stack..
- fElementStack.popElement();
- } else {
- fDocumentHandler.startElement(fElementQName, fAttributes, null);
- }
- }
-
- if (DEBUG_START_END_ELEMENT)
- System.out.println("<<< scanStartElementAfterName(): " + empty);
- return empty;
-
- } // scanStartElementAfterName()
-
- /**
- * Scans an attribute.
- * <p>
- * <pre>
- * [41] Attribute ::= Name Eq AttValue
- * </pre>
- * <p>
- * <strong>Note:</strong> This method assumes that the next
- * character on the stream is the first character of the attribute
- * name.
- * <p>
- * <strong>Note:</strong> This method uses the fAttributeQName and
- * fQName variables. The contents of these variables will be
- * destroyed.
- *
- * @param attributes The attributes list for the scanned attribute.
- */
- protected void scanAttribute(XMLAttributesImpl attributes)
- throws IOException, XNIException {
- if (DEBUG_START_END_ELEMENT)
- System.out.println(">>> scanAttribute()");
-
- // name
- fEntityScanner.scanQName(fAttributeQName, NameType.ATTRIBUTE);
-
- // equals
- fEntityScanner.skipSpaces();
- if (!fEntityScanner.skipChar('=', NameType.ATTRIBUTE)) {
- reportFatalError(
- "EqRequiredInAttribute",
- new Object[] {
- fCurrentElement.rawname,
- fAttributeQName.rawname });
- }
- fEntityScanner.skipSpaces();
-
- // content
- int attrIndex;
-
- if (fBindNamespaces) {
- attrIndex = attributes.getLength();
- attributes.addAttributeNS(
- fAttributeQName,
- XMLSymbols.fCDATASymbol,
- null);
- } else {
- int oldLen = attributes.getLength();
- attrIndex =
- attributes.addAttribute(
- fAttributeQName,
- XMLSymbols.fCDATASymbol,
- null);
-
- // WFC: Unique Att Spec
- if (oldLen == attributes.getLength()) {
- reportFatalError(
- "AttributeNotUnique",
- new Object[] {
- fCurrentElement.rawname,
- fAttributeQName.rawname });
- }
- }
-
- //REVISIT: one more case needs to be included: external PE and standalone is no
- boolean isVC = fHasExternalDTD && !fStandalone;
-
- /**
- * Determine whether this is a namespace declaration that will be subject
- * to the name limit check in the scanAttributeValue operation.
- * Namespace declaration format: xmlns="..." or xmlns:prefix="..."
- * Note that prefix:xmlns="..." isn't a namespace.
- */
- String localpart = fAttributeQName.localpart;
- String prefix = fAttributeQName.prefix != null
- ? fAttributeQName.prefix : XMLSymbols.EMPTY_STRING;
- boolean isNSDecl = fBindNamespaces & (prefix == XMLSymbols.PREFIX_XMLNS ||
- prefix == XMLSymbols.EMPTY_STRING && localpart == XMLSymbols.PREFIX_XMLNS);
-
- scanAttributeValue(this.fTempString, fTempString2, fAttributeQName.rawname,
- isVC, fCurrentElement.rawname, isNSDecl);
- String value = fTempString.toString();
- attributes.setValue(attrIndex, value);
- attributes.setNonNormalizedValue(attrIndex, fTempString2.toString());
- attributes.setSpecified(attrIndex, true);
-
- // record namespace declarations if any.
- if (fBindNamespaces) {
- if (isNSDecl) {
- if (value.length() > fXMLNameLimit) {
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "MaxXMLNameLimit",
- new Object[]{value, value.length(), fXMLNameLimit,
- fSecurityManager.getStateLiteral(XMLSecurityManager.Limit.MAX_NAME_LIMIT)},
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
- // get the internalized value of this attribute
- String uri = fSymbolTable.addSymbol(value);
-
- // 1. "xmlns" can't be bound to any namespace
- if (prefix == XMLSymbols.PREFIX_XMLNS
- && localpart == XMLSymbols.PREFIX_XMLNS) {
- fErrorReporter.reportError(
- XMLMessageFormatter.XMLNS_DOMAIN,
- "CantBindXMLNS",
- new Object[] { fAttributeQName },
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
-
- // 2. the namespace for "xmlns" can't be bound to any prefix
- if (uri == NamespaceContext.XMLNS_URI) {
- fErrorReporter.reportError(
- XMLMessageFormatter.XMLNS_DOMAIN,
- "CantBindXMLNS",
- new Object[] { fAttributeQName },
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
-
- // 3. "xml" can't be bound to any other namespace than it's own
- if (localpart == XMLSymbols.PREFIX_XML) {
- if (uri != NamespaceContext.XML_URI) {
- fErrorReporter.reportError(
- XMLMessageFormatter.XMLNS_DOMAIN,
- "CantBindXML",
- new Object[] { fAttributeQName },
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
- }
- // 4. the namespace for "xml" can't be bound to any other prefix
- else {
- if (uri == NamespaceContext.XML_URI) {
- fErrorReporter.reportError(
- XMLMessageFormatter.XMLNS_DOMAIN,
- "CantBindXML",
- new Object[] { fAttributeQName },
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
- }
-
- prefix =
- localpart != XMLSymbols.PREFIX_XMLNS
- ? localpart
- : XMLSymbols.EMPTY_STRING;
-
- // Declare prefix in context. Removing the association between a prefix and a
- // namespace name is permitted in XML 1.1, so if the uri value is the empty string,
- // the prefix is being unbound. -- mrglavas
- fNamespaceContext.declarePrefix(
- prefix,
- uri.length() != 0 ? uri : null);
- // bind namespace attribute to a namespace
- attributes.setURI(
- attrIndex,
- fNamespaceContext.getURI(XMLSymbols.PREFIX_XMLNS));
-
- } else {
- // attempt to bind attribute
- if (fAttributeQName.prefix != null) {
- attributes.setURI(
- attrIndex,
- fNamespaceContext.getURI(fAttributeQName.prefix));
- }
- }
- }
-
- if (DEBUG_START_END_ELEMENT)
- System.out.println("<<< scanAttribute()");
- } // scanAttribute(XMLAttributes)
-
- /**
- * Scans an end element.
- * <p>
- * <pre>
- * [42] ETag ::= '&lt;/' Name S? '>'
- * </pre>
- * <p>
- * <strong>Note:</strong> This method uses the fElementQName variable.
- * The contents of this variable will be destroyed. The caller should
- * copy the needed information out of this variable before calling
- * this method.
- *
- * @return The element depth.
- */
- protected int scanEndElement() throws IOException, XNIException {
- if (DEBUG_START_END_ELEMENT)
- System.out.println(">>> scanEndElement()");
-
- // pop context
- QName endElementName = fElementStack.popElement();
-
- // Take advantage of the fact that next string _should_ be "fElementQName.rawName",
- //In scanners most of the time is consumed on checks done for XML characters, we can
- // optimize on it and avoid the checks done for endElement,
- //we will also avoid symbol table lookup - neeraj.bajaj@sun.com
-
- // this should work both for namespace processing true or false...
-
- //REVISIT: if the string is not the same as expected.. we need to do better error handling..
- //We can skip this for now... In any case if the string doesn't match -- document is not well formed.
-
- if (!fEntityScanner.skipString(endElementName.rawname)) {
- reportFatalError(
- "ETagRequired",
- new Object[] { endElementName.rawname });
- }
-
- // end
- fEntityScanner.skipSpaces();
- if (!fEntityScanner.skipChar('>', NameType.ELEMENTEND)) {
- reportFatalError(
- "ETagUnterminated",
- new Object[] { endElementName.rawname });
- }
- fMarkupDepth--;
-
- //we have increased the depth for two markup "<" characters
- fMarkupDepth--;
-
- // check that this element was opened in the same entity
- if (fMarkupDepth < fEntityStack[fEntityDepth - 1]) {
- reportFatalError(
- "ElementEntityMismatch",
- new Object[] { endElementName.rawname });
- }
-
- // call handler
- if (fDocumentHandler != null) {
- fDocumentHandler.endElement(endElementName, null);
-
- /*if (fBindNamespaces) {
- fNamespaceContext.popContext();
- }*/
-
- }
-
- if(dtdGrammarUtil != null)
- dtdGrammarUtil.endElement(endElementName);
-
- return fMarkupDepth;
-
- } // scanEndElement():int
-
- public void reset(XMLComponentManager componentManager)
- throws XMLConfigurationException {
-
- super.reset(componentManager);
- fPerformValidation = false;
- fBindNamespaces = false;
- }
-
- /** Creates a content Driver. */
- protected Driver createContentDriver() {
- return new NS11ContentDriver();
- } // createContentDriver():Driver
-
-
- /** return the next state on the input
- *
- * @return int
- */
-
- public int next() throws IOException, XNIException {
- //since namespace context should still be valid when the parser is at the end element state therefore
- //we pop the context only when next() has been called after the end element state was encountered. - nb.
-
- if((fScannerLastState == XMLEvent.END_ELEMENT) && fBindNamespaces){
- fScannerLastState = -1;
- fNamespaceContext.popContext();
- }
-
- return fScannerLastState = super.next();
- }
-
-
- /**
- * Driver to handle content scanning.
- */
- protected final class NS11ContentDriver extends ContentDriver {
- /**
- * Scan for root element hook. This method is a hook for
- * subclasses to add code that handles scanning for the root
- * element. This method will also attempt to remove DTD validator
- * from the pipeline, if there is no DTD grammar. If DTD validator
- * is no longer in the pipeline bind namespaces in the scanner.
- *
- *
- * @return True if the caller should stop and return true which
- * allows the scanner to switch to a new scanning
- * Driver. A return value of false indicates that
- * the content Driver should continue as normal.
- */
- protected boolean scanRootElementHook()
- throws IOException, XNIException {
-
- if (fExternalSubsetResolver != null && !fSeenDoctypeDecl
- && !fDisallowDoctype && (fValidation || fLoadExternalDTD)) {
- scanStartElementName();
- resolveExternalSubsetAndRead();
- reconfigurePipeline();
- if (scanStartElementAfterName()) {
- setScannerState(SCANNER_STATE_TRAILING_MISC);
- setDriver(fTrailingMiscDriver);
- return true;
- }
- }
- else {
- reconfigurePipeline();
- if (scanStartElement()) {
- setScannerState(SCANNER_STATE_TRAILING_MISC);
- setDriver(fTrailingMiscDriver);
- return true;
- }
- }
- return false;
-
- } // scanRootElementHook():boolean
-
- /**
- * Re-configures pipeline by removing the DTD validator
- * if no DTD grammar exists. If no validator exists in the
- * pipeline or there is no DTD grammar, namespace binding
- * is performed by the scanner in the enclosing class.
- */
- private void reconfigurePipeline() {
- if (fDTDValidator == null) {
- fBindNamespaces = true;
- }
- else if (!fDTDValidator.hasGrammar()) {
- fBindNamespaces = true;
- fPerformValidation = fDTDValidator.validate();
- // re-configure pipeline
- XMLDocumentSource source = fDTDValidator.getDocumentSource();
- XMLDocumentHandler handler = fDTDValidator.getDocumentHandler();
- source.setDocumentHandler(handler);
- if (handler != null)
- handler.setDocumentSource(source);
- fDTDValidator.setDocumentSource(null);
- fDTDValidator.setDocumentHandler(null);
- }
- } // reconfigurePipeline()
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/XML11NamespaceBinder.java b/src/com/sun/org/apache/xerces/internal/impl/XML11NamespaceBinder.java
deleted file mode 100644
index 87e66c3..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/XML11NamespaceBinder.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2000-2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package com.sun.org.apache.xerces.internal.impl;
-
-
-/**
- * This class performs namespace binding on the startElement and endElement
- * method calls in accordance with Namespaces in XML 1.1. It extends the standard,
- * Namespace-1.0-compliant binder in order to do this.
- *
- * @xerces.internal
- *
- * @author Neil Graham, IBM
- *
- */
-public class XML11NamespaceBinder extends XMLNamespaceBinder {
-
- //
- // Constants
- //
-
- //
- // Data
- //
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- public XML11NamespaceBinder() {
- } // <init>()
- //
- // Public methods
- //
-
- //
- // Protected methods
- //
-
- // returns true iff the given prefix is bound to "" *and*
- // this is disallowed by the version of XML namespaces in use.
- protected boolean prefixBoundToNullURI(String uri, String localpart) {
- return false;
- } // prefixBoundToNullURI(String, String): boolean
-
-} // class XML11NamespaceBinder
diff --git a/src/com/sun/org/apache/xerces/internal/impl/XMLDTDScannerImpl.java b/src/com/sun/org/apache/xerces/internal/impl/XMLDTDScannerImpl.java
deleted file mode 100644
index d63df64..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/XMLDTDScannerImpl.java
+++ /dev/null
@@ -1,2200 +0,0 @@
-/*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
- */
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
-
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter;
-
-import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
-import com.sun.org.apache.xerces.internal.impl.XMLEntityHandler;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.util.XMLAttributesImpl;
-import com.sun.org.apache.xerces.internal.util.XMLChar;
-import com.sun.org.apache.xerces.internal.util.XMLStringBuffer;
-
-import com.sun.org.apache.xerces.internal.utils.XMLLimitAnalyzer;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager;
-import com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLDTDHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
-import com.sun.org.apache.xerces.internal.xni.XMLString;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponent;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDScanner;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-import com.sun.org.apache.xerces.internal.xni.Augmentations;
-import com.sun.xml.internal.stream.dtd.nonvalidating.DTDGrammar;
-import java.io.EOFException;
-import java.io.IOException;
-
-/**
- * This class is responsible for scanning the declarations found
- * in the internal and external subsets of a DTD in an XML document.
- * The scanner acts as the sources for the DTD information which is
- * communicated to the DTD handlers.
- * <p>
- * This component requires the following features and properties from the
- * component manager that uses it:
- * <ul>
- * <li>http://xml.org/sax/features/validation</li>
- * <li>http://apache.org/xml/features/scanner/notify-char-refs</li>
- * <li>http://apache.org/xml/properties/internal/symbol-table</li>
- * <li>http://apache.org/xml/properties/internal/error-reporter</li>
- * <li>http://apache.org/xml/properties/internal/entity-manager</li>
- * </ul>
- *
- * @author Arnaud Le Hors, IBM
- * @author Andy Clark, IBM
- * @author Glenn Marcy, IBM
- * @author Eric Ye, IBM
- *
- * @version $Id: XMLDTDScannerImpl.java,v 1.8 2010-11-01 04:39:41 joehw Exp $
- */
-public class XMLDTDScannerImpl
-extends XMLScanner
-implements XMLDTDScanner, XMLComponent, XMLEntityHandler {
-
- //
- // Constants
- //
-
- // scanner states
-
- /** Scanner state: end of input. */
- protected static final int SCANNER_STATE_END_OF_INPUT = 0;
-
- /** Scanner state: text declaration. */
- protected static final int SCANNER_STATE_TEXT_DECL = 1;
-
- /** Scanner state: markup declaration. */
- protected static final int SCANNER_STATE_MARKUP_DECL = 2;
-
- // recognized features and properties
-
- /** Recognized features. */
- private static final String[] RECOGNIZED_FEATURES = {
- VALIDATION,
- NOTIFY_CHAR_REFS,
- };
-
- /** Feature defaults. */
- private static final Boolean[] FEATURE_DEFAULTS = {
- null,
- Boolean.FALSE,
- };
-
- /** Recognized properties. */
- private static final String[] RECOGNIZED_PROPERTIES = {
- SYMBOL_TABLE,
- ERROR_REPORTER,
- ENTITY_MANAGER,
- };
-
- /** Property defaults. */
- private static final Object[] PROPERTY_DEFAULTS = {
- null,
- null,
- null,
- };
-
- // debugging
-
- /** Debug scanner state. */
- private static final boolean DEBUG_SCANNER_STATE = false;
-
- //
- // Data
- //
-
- // handlers
-
- /** DTD handler. */
- public XMLDTDHandler fDTDHandler = null;
-
- /** DTD content model handler. */
- protected XMLDTDContentModelHandler fDTDContentModelHandler;
-
- // state
-
- /** Scanner state. */
- protected int fScannerState;
-
- /** Standalone. */
- protected boolean fStandalone;
-
- /** Seen external DTD. */
- protected boolean fSeenExternalDTD;
-
- /** Seen external parameter entity. */
- protected boolean fSeenExternalPE;
-
- // private data
-
- /** Start DTD called. */
- private boolean fStartDTDCalled;
-
- /** Default attribute */
- private XMLAttributesImpl fAttributes = new XMLAttributesImpl();
-
- /**
- * Stack of content operators (either '|' or ',') in children
- * content.
- */
- private int[] fContentStack = new int[5];
-
- /** Size of content stack. */
- private int fContentDepth;
-
- /** Parameter entity stack to check well-formedness. */
- private int[] fPEStack = new int[5];
-
-
- /** Parameter entity stack to report start/end entity calls. */
- private boolean[] fPEReport = new boolean[5];
-
- /** Number of opened parameter entities. */
- private int fPEDepth;
-
- /** Markup depth. */
- private int fMarkUpDepth;
-
- /** Number of opened external entities. */
- private int fExtEntityDepth;
-
- /** Number of opened include sections. */
- private int fIncludeSectDepth;
-
- // temporary variables
-
- /** Array of 3 strings. */
- private String[] fStrings = new String[3];
-
- /** String. */
- private XMLString fString = new XMLString();
-
- /** String buffer. */
- private XMLStringBuffer fStringBuffer = new XMLStringBuffer();
-
- /** String buffer. */
- private XMLStringBuffer fStringBuffer2 = new XMLStringBuffer();
-
- /** Literal text. */
- private XMLString fLiteral = new XMLString();
-
- /** Literal text. */
- private XMLString fLiteral2 = new XMLString();
-
- /** Enumeration values. */
- private String[] fEnumeration = new String[5];
-
- /** Enumeration values count. */
- private int fEnumerationCount;
-
- /** Ignore conditional section buffer. */
- private XMLStringBuffer fIgnoreConditionalBuffer = new XMLStringBuffer(128);
-
- /** Object contains grammar information for a non-validaing parser. */
- DTDGrammar nvGrammarInfo = null;
-
- boolean nonValidatingMode = false;
- //
- // Constructors
- //
-
- /** Default constructor. */
- public XMLDTDScannerImpl() {
- } // <init>()
-
- /** Constructor for he use of non-XMLComponentManagers. */
- public XMLDTDScannerImpl(SymbolTable symbolTable,
- XMLErrorReporter errorReporter, XMLEntityManager entityManager) {
- fSymbolTable = symbolTable;
- fErrorReporter = errorReporter;
- fEntityManager = entityManager;
- entityManager.setProperty(SYMBOL_TABLE, fSymbolTable);
- }
-
- //
- // XMLDTDScanner methods
- //
-
- /**
- * Sets the input source.
- *
- * @param inputSource The input source or null.
- *
- * @throws IOException Thrown on i/o error.
- */
- public void setInputSource(XMLInputSource inputSource) throws IOException {
- if (inputSource == null) {
- // no system id was available
- if (fDTDHandler != null) {
- fDTDHandler.startDTD(null, null);
- fDTDHandler.endDTD(null);
- }
- if (nonValidatingMode){
- nvGrammarInfo.startDTD(null,null);
- nvGrammarInfo.endDTD(null);
- }
- return;
- }
- fEntityManager.setEntityHandler(this);
- fEntityManager.startDTDEntity(inputSource);
- } // setInputSource(XMLInputSource)
-
-
- public void setLimitAnalyzer(XMLLimitAnalyzer limitAnalyzer) {
- fLimitAnalyzer = limitAnalyzer;
- }
-
- /**
- * Scans the external subset of the document.
- *
- * @param complete True if the scanner should scan the document
- * completely, pushing all events to the registered
- * document handler. A value of false indicates that
- * that the scanner should only scan the next portion
- * of the document and return. A scanner instance is
- * permitted to completely scan a document if it does
- * not support this "pull" scanning model.
- *
- * @return True if there is more to scan, false otherwise.
- */
- public boolean scanDTDExternalSubset(boolean complete)
- throws IOException, XNIException {
-
- fEntityManager.setEntityHandler(this);
- if (fScannerState == SCANNER_STATE_TEXT_DECL) {
- fSeenExternalDTD = true;
- boolean textDecl = scanTextDecl();
- if (fScannerState == SCANNER_STATE_END_OF_INPUT) {
- return false;
- }
- else {
- // next state is markup decls regardless of whether there
- // is a TextDecl or not
- setScannerState(SCANNER_STATE_MARKUP_DECL);
- if (textDecl && !complete) {
- return true;
- }
- }
- }
- // keep dispatching "events"
- do {
- if (!scanDecls(complete)) {
- return false;
- }
- } while (complete);
-
- // return that there is more to scan
- return true;
-
- } // scanDTDExternalSubset(boolean):boolean
-
- /**
- * Scans the internal subset of the document.
- *
- * @param complete True if the scanner should scan the document
- * completely, pushing all events to the registered
- * document handler. A value of false indicates that
- * that the scanner should only scan the next portion
- * of the document and return. A scanner instance is
- * permitted to completely scan a document if it does
- * not support this "pull" scanning model.
- * @param standalone True if the document was specified as standalone.
- * This value is important for verifying certain
- * well-formedness constraints.
- * @param hasExternalDTD True if the document has an external DTD.
- * This allows the scanner to properly notify
- * the handler of the end of the DTD in the
- * absence of an external subset.
- *
- * @return True if there is more to scan, false otherwise.
- */
- public boolean scanDTDInternalSubset(boolean complete, boolean standalone,
- boolean hasExternalSubset)
- throws IOException, XNIException {
- // reset entity scanner
- //xxx:stax getText() is supposed to return only DTD internal subset
- //shouldn't we record position here before we go ahead ??
-
- fEntityScanner = (XMLEntityScanner)fEntityManager.getEntityScanner();
- fEntityManager.setEntityHandler(this);
- fStandalone = standalone;
- //System.out.println("state"+fScannerState);
- if (fScannerState == SCANNER_STATE_TEXT_DECL) {
- // call handler
- if (fDTDHandler != null) {
- fDTDHandler.startDTD(fEntityScanner, null);
- fStartDTDCalled = true;
- }
-
- if (nonValidatingMode){
- fStartDTDCalled = true;
- nvGrammarInfo.startDTD(fEntityScanner,null);
- }
- // set starting state for internal subset
- setScannerState(SCANNER_STATE_MARKUP_DECL);
- }
- // keep dispatching "events"
- do {
- if (!scanDecls(complete)) {
- // call handler
- if (fDTDHandler != null && hasExternalSubset == false) {
- fDTDHandler.endDTD(null);
- }
- if (nonValidatingMode && hasExternalSubset == false ){
- nvGrammarInfo.endDTD(null);
- }
- // we're done, set starting state for external subset
- setScannerState(SCANNER_STATE_TEXT_DECL);
- // we're done scanning DTD.
- fLimitAnalyzer.reset(XMLSecurityManager.Limit.GENERAL_ENTITY_SIZE_LIMIT);
- fLimitAnalyzer.reset(XMLSecurityManager.Limit.TOTAL_ENTITY_SIZE_LIMIT);
- return false;
- }
- } while (complete);
-
- // return that there is more to scan
- return true;
-
- } // scanDTDInternalSubset(boolean,boolean,boolean):boolean
-
- /**
- * Skip the DTD if javax.xml.stream.supportDTD is false.
- *
- * @param supportDTD The value of the property javax.xml.stream.supportDTD.
- * @return true if DTD is skipped, false otherwise.
- * @throws java.io.IOException if i/o error occurs
- */
- @Override
- public boolean skipDTD(boolean supportDTD) throws IOException {
- if (supportDTD)
- return false;
-
- fStringBuffer.clear();
- while (fEntityScanner.scanData("]", fStringBuffer)) {
- int c = fEntityScanner.peekChar();
- if (c != -1) {
- if (XMLChar.isHighSurrogate(c)) {
- scanSurrogates(fStringBuffer);
- }
- if (isInvalidLiteral(c)) {
- reportFatalError("InvalidCharInDTD",
- new Object[] { Integer.toHexString(c) });
- fEntityScanner.scanChar(null);
- }
- }
- }
- fEntityScanner.fCurrentEntity.position--;
- return true;
- }
-
- //
- // XMLComponent methods
- //
-
- /**
- * reset
- *
- * @param componentManager
- */
- public void reset(XMLComponentManager componentManager)
- throws XMLConfigurationException {
-
- super.reset(componentManager);
- init();
-
- } // reset(XMLComponentManager)
-
- // this is made for something like XMLDTDLoader--XMLComponentManager-free operation...
- public void reset() {
- super.reset();
- init();
-
- }
-
- public void reset(PropertyManager props) {
- setPropertyManager(props);
- super.reset(props);
- init() ;
- nonValidatingMode = true;
- //Revisit : Create new grammar until we implement GrammarPool.
- nvGrammarInfo = new DTDGrammar(fSymbolTable);
- }
- /**
- * Returns a list of feature identifiers that are recognized by
- * this component. This method may return null if no features
- * are recognized by this component.
- */
- public String[] getRecognizedFeatures() {
- return (String[])(RECOGNIZED_FEATURES.clone());
- } // getRecognizedFeatures():String[]
-
- /**
- * Returns a list of property identifiers that are recognized by
- * this component. This method may return null if no properties
- * are recognized by this component.
- */
- public String[] getRecognizedProperties() {
- return (String[])(RECOGNIZED_PROPERTIES.clone());
- } // getRecognizedProperties():String[]
-
- /**
- * Returns the default state for a feature, or null if this
- * component does not want to report a default value for this
- * feature.
- *
- * @param featureId The feature identifier.
- *
- * @since Xerces 2.2.0
- */
- public Boolean getFeatureDefault(String featureId) {
- for (int i = 0; i < RECOGNIZED_FEATURES.length; i++) {
- if (RECOGNIZED_FEATURES[i].equals(featureId)) {
- return FEATURE_DEFAULTS[i];
- }
- }
- return null;
- } // getFeatureDefault(String):Boolean
-
- /**
- * Returns the default state for a property, or null if this
- * component does not want to report a default value for this
- * property.
- *
- * @param propertyId The property identifier.
- *
- * @since Xerces 2.2.0
- */
- public Object getPropertyDefault(String propertyId) {
- for (int i = 0; i < RECOGNIZED_PROPERTIES.length; i++) {
- if (RECOGNIZED_PROPERTIES[i].equals(propertyId)) {
- return PROPERTY_DEFAULTS[i];
- }
- }
- return null;
- } // getPropertyDefault(String):Object
-
- //
- // XMLDTDSource methods
- //
-
- /**
- * setDTDHandler
- *
- * @param dtdHandler
- */
- public void setDTDHandler(XMLDTDHandler dtdHandler) {
- fDTDHandler = dtdHandler;
- } // setDTDHandler(XMLDTDHandler)
-
- /**
- * getDTDHandler
- *
- * @return the XMLDTDHandler
- */
- public XMLDTDHandler getDTDHandler() {
- return fDTDHandler;
- } // getDTDHandler(): XMLDTDHandler
-
- //
- // XMLDTDContentModelSource methods
- //
-
- /**
- * setDTDContentModelHandler
- *
- * @param dtdContentModelHandler
- */
- public void setDTDContentModelHandler(XMLDTDContentModelHandler
- dtdContentModelHandler) {
- fDTDContentModelHandler = dtdContentModelHandler;
- } // setDTDContentModelHandler
-
- /**
- * getDTDContentModelHandler
- *
- * @return XMLDTDContentModelHandler
- */
- public XMLDTDContentModelHandler getDTDContentModelHandler() {
- return fDTDContentModelHandler ;
- } // setDTDContentModelHandler
-
- //
- // XMLEntityHandler methods
- //
-
- /**
- * This method notifies of the start of an entity. The DTD has the
- * pseudo-name of "[dtd]" parameter entity names start with '%'; and
- * general entities are just specified by their name.
- *
- * @param name The name of the entity.
- * @param identifier The resource identifier.
- * @param encoding The auto-detected IANA encoding name of the entity
- * stream. This value will be null in those situations
- * where the entity encoding is not auto-detected (e.g.
- * internal entities or a document entity that is
- * parsed from a java.io.Reader).
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startEntity(String name,
- XMLResourceIdentifier identifier,
- String encoding, Augmentations augs) throws XNIException {
-
- super.startEntity(name, identifier, encoding, augs);
-
- boolean dtdEntity = name.equals("[dtd]");
- if (dtdEntity) {
- // call handler
- if (fDTDHandler != null && !fStartDTDCalled ) {
- fDTDHandler.startDTD(fEntityScanner, null);
- }
- if (fDTDHandler != null) {
- fDTDHandler.startExternalSubset(identifier,null);
- }
- fEntityManager.startExternalSubset();
- fEntityStore.startExternalSubset();
- fExtEntityDepth++;
- }
- else if (name.charAt(0) == '%') {
- pushPEStack(fMarkUpDepth, fReportEntity);
- if (fEntityScanner.isExternal()) {
- fExtEntityDepth++;
- }
- }
-
- // call handler
- if (fDTDHandler != null && !dtdEntity && fReportEntity) {
- fDTDHandler.startParameterEntity(name, identifier, encoding, null);
- }
-
- } // startEntity(String,XMLResourceIdentifier,String)
-
- /**
- * This method notifies the end of an entity. The DTD has the pseudo-name
- * of "[dtd]" parameter entity names start with '%'; and general entities
- * are just specified by their name.
- *
- * @param name The name of the entity.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endEntity(String name, Augmentations augs)
- throws XNIException, IOException {
-
- super.endEntity(name, augs);
-
- // if there is no data after the doctype
- //
- if (fScannerState == SCANNER_STATE_END_OF_INPUT)
- return;
-
- // Handle end of PE
- boolean reportEntity = fReportEntity;
- if (name.startsWith("%")) {
- reportEntity = peekReportEntity();
- // check well-formedness of the enity
- int startMarkUpDepth = popPEStack();
- // throw fatalError if this entity was incomplete and
- // was a freestanding decl
- if(startMarkUpDepth == 0 &&
- startMarkUpDepth < fMarkUpDepth) {
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "ILL_FORMED_PARAMETER_ENTITY_WHEN_USED_IN_DECL",
- new Object[]{ fEntityManager.fCurrentEntity.name},
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
- if (startMarkUpDepth != fMarkUpDepth) {
- reportEntity = false;
- if (fValidation) {
- // Proper nesting of parameter entities is a Validity Constraint
- // and must not be enforced when validation is off
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "ImproperDeclarationNesting",
- new Object[]{ name },
- XMLErrorReporter.SEVERITY_ERROR);
- }
- }
- if (fEntityScanner.isExternal()) {
- fExtEntityDepth--;
- }
- }
-
- // call handler
- boolean dtdEntity = name.equals("[dtd]");
- if (fDTDHandler != null && !dtdEntity && reportEntity) {
- fDTDHandler.endParameterEntity(name, null);
- }
-
- // end DTD
- if (dtdEntity) {
- if (fIncludeSectDepth != 0) {
- reportFatalError("IncludeSectUnterminated", null);
- }
- fScannerState = SCANNER_STATE_END_OF_INPUT;
- // call handler
- fEntityManager.endExternalSubset();
- fEntityStore.endExternalSubset();
-
- if (fDTDHandler != null) {
- fDTDHandler.endExternalSubset(null);
- fDTDHandler.endDTD(null);
- }
- fExtEntityDepth--;
- }
-
- //XML (Document Entity) is the last opened entity, however
- //if for some reason DTD Scanner receives this callback
- //there is something wrong (probably invalid XML), throw exception.
- //or
- //For standalone DTD loader, it might be the last opened entity
- //and if this is the last opened entity and fMarkUpDepth != 0 or
- //fIncludeSectDepth != 0 or fExtEntityDepth != 0 throw Exception
- if (augs != null && Boolean.TRUE.equals(augs.getItem(Constants.LAST_ENTITY))
- && ( fMarkUpDepth != 0 || fExtEntityDepth !=0 || fIncludeSectDepth != 0)){
- throw new EOFException();
- }
-
- } // endEntity(String)
-
- // helper methods
-
- /**
- * Sets the scanner state.
- *
- * @param state The new scanner state.
- */
- protected final void setScannerState(int state) {
-
- fScannerState = state;
- if (DEBUG_SCANNER_STATE) {
- System.out.print("### setScannerState: ");
- System.out.print(getScannerStateName(state));
- //System.out.println();
- }
-
- } // setScannerState(int)
-
- //
- // Private methods
- //
-
- /** Returns the scanner state name. */
- private static String getScannerStateName(int state) {
-
- if (DEBUG_SCANNER_STATE) {
- switch (state) {
- case SCANNER_STATE_END_OF_INPUT: return "SCANNER_STATE_END_OF_INPUT";
- case SCANNER_STATE_TEXT_DECL: return "SCANNER_STATE_TEXT_DECL";
- case SCANNER_STATE_MARKUP_DECL: return "SCANNER_STATE_MARKUP_DECL";
- }
- }
-
- return "??? ("+state+')';
-
- } // getScannerStateName(int):String
-
- protected final boolean scanningInternalSubset() {
- return fExtEntityDepth == 0;
- }
-
- /**
- * start a parameter entity dealing with the textdecl if there is any
- *
- * @param name The name of the parameter entity to start (without the '%')
- * @param literal Whether this is happening within a literal
- */
- protected void startPE(String name, boolean literal)
- throws IOException, XNIException {
- int depth = fPEDepth;
- String pName = "%"+name;
- if (fValidation && !fEntityStore.isDeclaredEntity(pName)) {
- fErrorReporter.reportError( XMLMessageFormatter.XML_DOMAIN,"EntityNotDeclared",
- new Object[]{name}, XMLErrorReporter.SEVERITY_ERROR);
- }
- fEntityManager.startEntity(false, fSymbolTable.addSymbol(pName),
- literal);
- // if we actually got a new entity and it's external
- // parse text decl if there is any
- if (depth != fPEDepth && fEntityScanner.isExternal()) {
- scanTextDecl();
- }
- }
-
- /**
- * Dispatch an XML "event".
- *
- * @param complete True if this method is intended to scan
- * and dispatch as much as possible.
- *
- * @return True if a TextDecl was scanned.
- *
- * @throws IOException Thrown on i/o error.
- * @throws XNIException Thrown on parse error.
- *
- */
- protected final boolean scanTextDecl()
- throws IOException, XNIException {
-
- // scan XMLDecl
- boolean textDecl = false;
- if (fEntityScanner.skipString("<?xml")) {
- fMarkUpDepth++;
- // NOTE: special case where document starts with a PI
- // whose name starts with "xml" (e.g. "xmlfoo")
- if (isValidNameChar(fEntityScanner.peekChar())) {
- fStringBuffer.clear();
- fStringBuffer.append("xml");
- while (isValidNameChar(fEntityScanner.peekChar())) {
- fStringBuffer.append((char)fEntityScanner.scanChar(null));
- }
- String target =
- fSymbolTable.addSymbol(fStringBuffer.ch,
- fStringBuffer.offset,
- fStringBuffer.length);
- scanPIData(target, fString);
- }
-
- // standard Text declaration
- else {
- // pseudo-attribute values
- String version = null;
- String encoding = null;
-
- scanXMLDeclOrTextDecl(true, fStrings);
- textDecl = true;
- fMarkUpDepth--;
-
- version = fStrings[0];
- encoding = fStrings[1];
-
- fEntityScanner.setEncoding(encoding);
-
- // call handler
- if (fDTDHandler != null) {
- fDTDHandler.textDecl(version, encoding, null);
- }
- }
- }
- fEntityManager.fCurrentEntity.mayReadChunks = true;
-
- return textDecl;
-
- } // scanTextDecl(boolean):boolean
-
- /**
- * Scans a processing data. This is needed to handle the situation
- * where a document starts with a processing instruction whose
- * target name <em>starts with</em> "xml". (e.g. xmlfoo)
- *
- * @param target The PI target
- * @param data The string to fill in with the data
- */
- protected final void scanPIData(String target, XMLString data)
- throws IOException, XNIException {
- //Venu REVISIT
- // super.scanPIData(target, data);
- fMarkUpDepth--;
-
- // call handler
- if (fDTDHandler != null) {
- fDTDHandler.processingInstruction(target, data, null);
- }
-
- } // scanPIData(String)
-
- /**
- * Scans a comment.
- * <p>
- * <pre>
- * [15] Comment ::= '&lt!--' ((Char - '-') | ('-' (Char - '-')))* '-->'
- * </pre>
- * <p>
- * <strong>Note:</strong> Called after scanning past '&lt;!--'
- */
- protected final void scanComment() throws IOException, XNIException {
-
- fReportEntity = false;
- scanComment(fStringBuffer);
- fMarkUpDepth--;
-
- // call handler
- if (fDTDHandler != null) {
- fDTDHandler.comment(fStringBuffer, null);
- }
- fReportEntity = true;
-
- } // scanComment()
-
- /**
- * Scans an element declaration
- * <p>
- * <pre>
- * [45] elementdecl ::= '&lt;!ELEMENT' S Name S contentspec S? '>'
- * [46] contentspec ::= 'EMPTY' | 'ANY' | Mixed | children
- * </pre>
- * <p>
- * <strong>Note:</strong> Called after scanning past '&lt;!ELEMENT'
- */
- protected final void scanElementDecl() throws IOException, XNIException {
-
- // spaces
- fReportEntity = false;
- if (!skipSeparator(true, !scanningInternalSubset())) {
- reportFatalError("MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ELEMENTDECL",
- null);
- }
-
- // element name
- String name = fEntityScanner.scanName(NameType.ELEMENTSTART);
- if (name == null) {
- reportFatalError("MSG_ELEMENT_TYPE_REQUIRED_IN_ELEMENTDECL",
- null);
- }
-
- // spaces
- if (!skipSeparator(true, !scanningInternalSubset())) {
- reportFatalError("MSG_SPACE_REQUIRED_BEFORE_CONTENTSPEC_IN_ELEMENTDECL",
- new Object[]{name});
- }
-
- // content model
- if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.startContentModel(name, null);
- }
- String contentModel = null;
- fReportEntity = true;
- if (fEntityScanner.skipString("EMPTY")) {
- contentModel = "EMPTY";
- // call handler
- if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.empty(null);
- }
- }
- else if (fEntityScanner.skipString("ANY")) {
- contentModel = "ANY";
- // call handler
- if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.any(null);
- }
- }
- else {
- if (!fEntityScanner.skipChar('(', null)) {
- reportFatalError("MSG_OPEN_PAREN_OR_ELEMENT_TYPE_REQUIRED_IN_CHILDREN",
- new Object[]{name});
- }
- if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.startGroup(null);
- }
- fStringBuffer.clear();
- fStringBuffer.append('(');
- fMarkUpDepth++;
- skipSeparator(false, !scanningInternalSubset());
-
- // Mixed content model
- if (fEntityScanner.skipString("#PCDATA")) {
- scanMixed(name);
- }
- else { // children content
- scanChildren(name);
- }
- contentModel = fStringBuffer.toString();
- }
-
- // call handler
- if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.endContentModel(null);
- }
-
- fReportEntity = false;
- skipSeparator(false, !scanningInternalSubset());
- // end
- if (!fEntityScanner.skipChar('>', null)) {
- reportFatalError("ElementDeclUnterminated", new Object[]{name});
- }
- fReportEntity = true;
- fMarkUpDepth--;
-
- // call handler
- if (fDTDHandler != null) {
- fDTDHandler.elementDecl(name, contentModel, null);
- }
- if (nonValidatingMode) nvGrammarInfo.elementDecl(name, contentModel, null);
- } // scanElementDecl()
-
- /**
- * scan Mixed content model
- * This assumes the content model has been parsed up to #PCDATA and
- * can simply append to fStringBuffer.
- * <pre>
- * [51] Mixed ::= '(' S? '#PCDATA' (S? '|' S? Name)* S? ')*'
- * | '(' S? '#PCDATA' S? ')'
- * </pre>
- *
- * @param elName The element type name this declaration is about.
- *
- * <strong>Note:</strong> Called after scanning past '(#PCDATA'.
- */
- private final void scanMixed(String elName)
- throws IOException, XNIException {
-
- String childName = null;
-
- fStringBuffer.append("#PCDATA");
- // call handler
- if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.pcdata(null);
- }
- skipSeparator(false, !scanningInternalSubset());
- while (fEntityScanner.skipChar('|', null)) {
- fStringBuffer.append('|');
- // call handler
- if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.separator(XMLDTDContentModelHandler.SEPARATOR_CHOICE,
- null);
- }
- skipSeparator(false, !scanningInternalSubset());
-
- childName = fEntityScanner.scanName(NameType.ENTITY);
- if (childName == null) {
- reportFatalError("MSG_ELEMENT_TYPE_REQUIRED_IN_MIXED_CONTENT",
- new Object[]{elName});
- }
- fStringBuffer.append(childName);
- // call handler
- if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.element(childName, null);
- }
- skipSeparator(false, !scanningInternalSubset());
- }
- // The following check must be done in a single call (as opposed to one
- // for ')' and then one for '*') to guarantee that callbacks are
- // properly nested. We do not want to trigger endEntity too early in
- // case we cross the boundary of an entity between the two characters.
- if (fEntityScanner.skipString(")*")) {
- fStringBuffer.append(")*");
- // call handler
- if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.endGroup(null);
- fDTDContentModelHandler.occurrence(XMLDTDContentModelHandler.OCCURS_ZERO_OR_MORE,
- null);
- }
- }
- else if (childName != null) {
- reportFatalError("MixedContentUnterminated",
- new Object[]{elName});
- }
- else if (fEntityScanner.skipChar(')', null)){
- fStringBuffer.append(')');
- // call handler
- if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.endGroup(null);
- }
- }
- else {
- reportFatalError("MSG_CLOSE_PAREN_REQUIRED_IN_CHILDREN",
- new Object[]{elName});
- }
- fMarkUpDepth--;
- // we are done
- }
-
- /**
- * scan children content model
- * This assumes it can simply append to fStringBuffer.
- * <pre>
- * [47] children ::= (choice | seq) ('?' | '*' | '+')?
- * [48] cp ::= (Name | choice | seq) ('?' | '*' | '+')?
- * [49] choice ::= '(' S? cp ( S? '|' S? cp )+ S? ')'
- * [50] seq ::= '(' S? cp ( S? ',' S? cp )* S? ')'
- * </pre>
- *
- * @param elName The element type name this declaration is about.
- *
- * <strong>Note:</strong> Called after scanning past the first open
- * paranthesis.
- */
- private final void scanChildren(String elName)
- throws IOException, XNIException {
-
- fContentDepth = 0;
- pushContentStack(0);
- int currentOp = 0;
- int c;
- while (true) {
- if (fEntityScanner.skipChar('(', null)) {
- fMarkUpDepth++;
- fStringBuffer.append('(');
- // call handler
- if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.startGroup(null);
- }
- // push current op on stack and reset it
- pushContentStack(currentOp);
- currentOp = 0;
- skipSeparator(false, !scanningInternalSubset());
- continue;
- }
- skipSeparator(false, !scanningInternalSubset());
- String childName = fEntityScanner.scanName(NameType.ELEMENTSTART);
- if (childName == null) {
- reportFatalError("MSG_OPEN_PAREN_OR_ELEMENT_TYPE_REQUIRED_IN_CHILDREN",
- new Object[]{elName});
- return;
- }
- // call handler
- if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.element(childName, null);
- }
- fStringBuffer.append(childName);
- c = fEntityScanner.peekChar();
- if (c == '?' || c == '*' || c == '+') {
- // call handler
- if (fDTDContentModelHandler != null) {
- short oc;
- if (c == '?') {
- oc = XMLDTDContentModelHandler.OCCURS_ZERO_OR_ONE;
- }
- else if (c == '*') {
- oc = XMLDTDContentModelHandler.OCCURS_ZERO_OR_MORE;
- }
- else {
- oc = XMLDTDContentModelHandler.OCCURS_ONE_OR_MORE;
- }
- fDTDContentModelHandler.occurrence(oc, null);
- }
- fEntityScanner.scanChar(null);
- fStringBuffer.append((char)c);
- }
- while (true) {
- skipSeparator(false, !scanningInternalSubset());
- c = fEntityScanner.peekChar();
- if (c == ',' && currentOp != '|') {
- currentOp = c;
- // call handler
- if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.separator(XMLDTDContentModelHandler.SEPARATOR_SEQUENCE,
- null);
- }
- fEntityScanner.scanChar(null);
- fStringBuffer.append(',');
- break;
- }
- else if (c == '|' && currentOp != ',') {
- currentOp = c;
- // call handler
- if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.separator(XMLDTDContentModelHandler.SEPARATOR_CHOICE,
- null);
- }
- fEntityScanner.scanChar(null);
- fStringBuffer.append('|');
- break;
- }
- else if (c != ')') {
- reportFatalError("MSG_CLOSE_PAREN_REQUIRED_IN_CHILDREN",
- new Object[]{elName});
- }
- // call handler
- if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.endGroup(null);
- }
- // restore previous op
- currentOp = popContentStack();
- short oc;
- // The following checks must be done in a single call (as
- // opposed to one for ')' and then one for '?', '*', and '+')
- // to guarantee that callbacks are properly nested. We do not
- // want to trigger endEntity too early in case we cross the
- // boundary of an entity between the two characters.
- if (fEntityScanner.skipString(")?")) {
- fStringBuffer.append(")?");
- // call handler
- if (fDTDContentModelHandler != null) {
- oc = XMLDTDContentModelHandler.OCCURS_ZERO_OR_ONE;
- fDTDContentModelHandler.occurrence(oc, null);
- }
- }
- else if (fEntityScanner.skipString(")+")) {
- fStringBuffer.append(")+");
- // call handler
- if (fDTDContentModelHandler != null) {
- oc = XMLDTDContentModelHandler.OCCURS_ONE_OR_MORE;
- fDTDContentModelHandler.occurrence(oc, null);
- }
- }
- else if (fEntityScanner.skipString(")*")) {
- fStringBuffer.append(")*");
- // call handler
- if (fDTDContentModelHandler != null) {
- oc = XMLDTDContentModelHandler.OCCURS_ZERO_OR_MORE;
- fDTDContentModelHandler.occurrence(oc, null);
- }
- }
- else {
- // no occurrence specified
- fEntityScanner.scanChar(null);
- fStringBuffer.append(')');
- }
- fMarkUpDepth--;
- if (fContentDepth == 0) {
- return;
- }
- }
- skipSeparator(false, !scanningInternalSubset());
- }
- }
-
- /**
- * Scans an attlist declaration
- * <p>
- * <pre>
- * [52] AttlistDecl ::= '&lt;!ATTLIST' S Name AttDef* S? '>'
- * [53] AttDef ::= S Name S AttType S DefaultDecl
- * </pre>
- * <p>
- * <strong>Note:</strong> Called after scanning past '&lt;!ATTLIST'
- */
- protected final void scanAttlistDecl() throws IOException, XNIException {
-
- // spaces
- fReportEntity = false;
- if (!skipSeparator(true, !scanningInternalSubset())) {
- reportFatalError("MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ATTLISTDECL",
- null);
- }
-
- // element name
- String elName = fEntityScanner.scanName(NameType.ELEMENTSTART);
- if (elName == null) {
- reportFatalError("MSG_ELEMENT_TYPE_REQUIRED_IN_ATTLISTDECL",
- null);
- }
-
- // call handler
- if (fDTDHandler != null) {
- fDTDHandler.startAttlist(elName, null);
- }
-
- // spaces
- if (!skipSeparator(true, !scanningInternalSubset())) {
- // no space, is it the end yet?
- if (fEntityScanner.skipChar('>', null)) {
- // yes, stop here
- // call handler
- if (fDTDHandler != null) {
- fDTDHandler.endAttlist(null);
- }
- fMarkUpDepth--;
- return;
- }
- else {
- reportFatalError("MSG_SPACE_REQUIRED_BEFORE_ATTRIBUTE_NAME_IN_ATTDEF",
- new Object[]{elName});
- }
- }
-
- // definitions
- while (!fEntityScanner.skipChar('>', null)) {
- String name = fEntityScanner.scanName(NameType.ATTRIBUTE);
- if (name == null) {
- reportFatalError("AttNameRequiredInAttDef",
- new Object[]{elName});
- }
- // spaces
- if (!skipSeparator(true, !scanningInternalSubset())) {
- reportFatalError("MSG_SPACE_REQUIRED_BEFORE_ATTTYPE_IN_ATTDEF",
- new Object[]{elName, name});
- }
- // type
- String type = scanAttType(elName, name);
-
- // spaces
- if (!skipSeparator(true, !scanningInternalSubset())) {
- reportFatalError("MSG_SPACE_REQUIRED_BEFORE_DEFAULTDECL_IN_ATTDEF",
- new Object[]{elName, name});
- }
-
- // default decl
- String defaultType = scanAttDefaultDecl(elName, name,
- type,
- fLiteral, fLiteral2);
- // REVISIT: Should we do anything with the non-normalized
- // default attribute value? -Ac
- // yes--according to bug 5073. - neilg
- String[] enumr = null;
- if( fDTDHandler != null || nonValidatingMode){
- if (fEnumerationCount != 0) {
- enumr = new String[fEnumerationCount];
- System.arraycopy(fEnumeration, 0, enumr,
- 0, fEnumerationCount);
- }
- }
- // call handler
- // Determine whether the default value to be passed should be null.
- // REVISIT: should probably check whether fLiteral.ch is null instead. LM.
- if (defaultType!=null && (defaultType.equals("#REQUIRED") ||
- defaultType.equals("#IMPLIED"))) {
- if (fDTDHandler != null){
- fDTDHandler.attributeDecl(elName, name, type, enumr,
- defaultType, null, null, null);
- }
- if(nonValidatingMode){
- nvGrammarInfo.attributeDecl(elName, name, type, enumr,
- defaultType, null, null, null);
-
- }
- }
- else {
- if (fDTDHandler != null){
- fDTDHandler.attributeDecl(elName, name, type, enumr,
- defaultType, fLiteral, fLiteral2, null);
- }
- if(nonValidatingMode){
- nvGrammarInfo.attributeDecl(elName, name, type, enumr,
- defaultType, fLiteral, fLiteral2, null);
- }
- }
- skipSeparator(false, !scanningInternalSubset());
- }
-
- // call handler
- if (fDTDHandler != null) {
- fDTDHandler.endAttlist(null);
- }
- fMarkUpDepth--;
- fReportEntity = true;
-
- } // scanAttlistDecl()
-
- /**
- * Scans an attribute type definition
- * <p>
- * <pre>
- * [54] AttType ::= StringType | TokenizedType | EnumeratedType
- * [55] StringType ::= 'CDATA'
- * [56] TokenizedType ::= 'ID'
- * | 'IDREF'
- * | 'IDREFS'
- * | 'ENTITY'
- * | 'ENTITIES'
- * | 'NMTOKEN'
- * | 'NMTOKENS'
- * [57] EnumeratedType ::= NotationType | Enumeration
- * [58] NotationType ::= 'NOTATION' S '(' S? Name (S? '|' S? Name)* S? ')'
- * [59] Enumeration ::= '(' S? Nmtoken (S? '|' S? Nmtoken)* S? ')'
- * </pre>
- * <p>
- * <strong>Note:</strong> Called after scanning past '&lt;!ATTLIST'
- *
- * @param elName The element type name this declaration is about.
- * @param atName The attribute name this declaration is about.
- */
- private final String scanAttType(String elName, String atName)
- throws IOException, XNIException {
-
- String type = null;
- fEnumerationCount = 0;
- /*
- * Watchout: the order here is important: when a string happens to
- * be a substring of another string, the longer one needs to be
- * looked for first!!
- */
- if (fEntityScanner.skipString("CDATA")) {
- type = "CDATA";
- }
- else if (fEntityScanner.skipString("IDREFS")) {
- type = "IDREFS";
- }
- else if (fEntityScanner.skipString("IDREF")) {
- type = "IDREF";
- }
- else if (fEntityScanner.skipString("ID")) {
- type = "ID";
- }
- else if (fEntityScanner.skipString("ENTITY")) {
- type = "ENTITY";
- }
- else if (fEntityScanner.skipString("ENTITIES")) {
- type = "ENTITIES";
- }
- else if (fEntityScanner.skipString("NMTOKENS")) {
- type = "NMTOKENS";
- }
- else if (fEntityScanner.skipString("NMTOKEN")) {
- type = "NMTOKEN";
- }
- else if (fEntityScanner.skipString("NOTATION")) {
- type = "NOTATION";
- // spaces
- if (!skipSeparator(true, !scanningInternalSubset())) {
- reportFatalError("MSG_SPACE_REQUIRED_AFTER_NOTATION_IN_NOTATIONTYPE",
- new Object[]{elName, atName});
- }
- // open paren
- int c = fEntityScanner.scanChar(null);
- if (c != '(') {
- reportFatalError("MSG_OPEN_PAREN_REQUIRED_IN_NOTATIONTYPE",
- new Object[]{elName, atName});
- }
- fMarkUpDepth++;
- do {
- skipSeparator(false, !scanningInternalSubset());
- String aName = fEntityScanner.scanName(NameType.ATTRIBUTE);
- if (aName == null) {
- reportFatalError("MSG_NAME_REQUIRED_IN_NOTATIONTYPE",
- new Object[]{elName, atName});
- }
- ensureEnumerationSize(fEnumerationCount + 1);
- fEnumeration[fEnumerationCount++] = aName;
- skipSeparator(false, !scanningInternalSubset());
- c = fEntityScanner.scanChar(null);
- } while (c == '|');
- if (c != ')') {
- reportFatalError("NotationTypeUnterminated",
- new Object[]{elName, atName});
- }
- fMarkUpDepth--;
- }
- else { // Enumeration
- type = "ENUMERATION";
- // open paren
- int c = fEntityScanner.scanChar(null);
- if (c != '(') {
- // "OPEN_PAREN_REQUIRED_BEFORE_ENUMERATION_IN_ATTRDECL",
- reportFatalError("AttTypeRequiredInAttDef",
- new Object[]{elName, atName});
- }
- fMarkUpDepth++;
- do {
- skipSeparator(false, !scanningInternalSubset());
- String token = fEntityScanner.scanNmtoken();
- if (token == null) {
- reportFatalError("MSG_NMTOKEN_REQUIRED_IN_ENUMERATION",
- new Object[]{elName, atName});
- }
- ensureEnumerationSize(fEnumerationCount + 1);
- fEnumeration[fEnumerationCount++] = token;
- skipSeparator(false, !scanningInternalSubset());
- c = fEntityScanner.scanChar(null);
- } while (c == '|');
- if (c != ')') {
- reportFatalError("EnumerationUnterminated",
- new Object[]{elName, atName});
- }
- fMarkUpDepth--;
- }
- return type;
-
- } // scanAttType():String
-
-
- /**
- * Scans an attribute default declaration
- * <p>
- * <pre>
- * [60] DefaultDecl ::= '#REQUIRED' | '#IMPLIED' | (('#FIXED' S)? AttValue)
- * </pre>
- *
- * @param name The name of the attribute being scanned.
- * @param defaultVal The string to fill in with the default value.
- */
- protected final String scanAttDefaultDecl(String elName, String atName,
- String type,
- XMLString defaultVal,
- XMLString nonNormalizedDefaultVal)
- throws IOException, XNIException {
-
- String defaultType = null;
- fString.clear();
- defaultVal.clear();
- if (fEntityScanner.skipString("#REQUIRED")) {
- defaultType = "#REQUIRED";
- }
- else if (fEntityScanner.skipString("#IMPLIED")) {
- defaultType = "#IMPLIED";
- }
- else {
- if (fEntityScanner.skipString("#FIXED")) {
- defaultType = "#FIXED";
- // spaces
- if (!skipSeparator(true, !scanningInternalSubset())) {
- reportFatalError("MSG_SPACE_REQUIRED_AFTER_FIXED_IN_DEFAULTDECL",
- new Object[]{elName, atName});
- }
- }
- // AttValue
- boolean isVC = !fStandalone && (fSeenExternalDTD || fSeenExternalPE) ;
- scanAttributeValue(defaultVal, nonNormalizedDefaultVal, atName,
- fAttributes, 0, isVC, elName, false);
- }
- return defaultType;
-
- } // ScanAttDefaultDecl
-
- /**
- * Scans an entity declaration
- * <p>
- * <pre>
- * [70] EntityDecl ::= GEDecl | PEDecl
- * [71] GEDecl ::= '&lt;!ENTITY' S Name S EntityDef S? '>'
- * [72] PEDecl ::= '&lt;!ENTITY' S '%' S Name S PEDef S? '>'
- * [73] EntityDef ::= EntityValue | (ExternalID NDataDecl?)
- * [74] PEDef ::= EntityValue | ExternalID
- * [75] ExternalID ::= 'SYSTEM' S SystemLiteral
- * | 'PUBLIC' S PubidLiteral S SystemLiteral
- * [76] NDataDecl ::= S 'NDATA' S Name
- * </pre>
- * <p>
- * <strong>Note:</strong> Called after scanning past '&lt;!ENTITY'
- */
- private final void scanEntityDecl() throws IOException, XNIException {
-
- boolean isPEDecl = false;
- boolean sawPERef = false;
- fReportEntity = false;
- if (fEntityScanner.skipSpaces()) {
- if (!fEntityScanner.skipChar('%', NameType.REFERENCE)) {
- isPEDecl = false; // <!ENTITY x "x">
- }
- else if (skipSeparator(true, !scanningInternalSubset())) {
- // <!ENTITY % x "x">
- isPEDecl = true;
- }
- else if (scanningInternalSubset()) {
- reportFatalError("MSG_SPACE_REQUIRED_BEFORE_ENTITY_NAME_IN_ENTITYDECL",
- null);
- isPEDecl = true;
- }
- else if (fEntityScanner.peekChar() == '%') {
- // <!ENTITY %%x; "x"> is legal
- skipSeparator(false, !scanningInternalSubset());
- isPEDecl = true;
- }
- else {
- sawPERef = true;
- }
- }
- else if (scanningInternalSubset() || !fEntityScanner.skipChar('%', NameType.REFERENCE)) {
- // <!ENTITY[^ ]...> or <!ENTITY[^ %]...>
- reportFatalError("MSG_SPACE_REQUIRED_BEFORE_ENTITY_NAME_IN_ENTITYDECL",
- null);
- isPEDecl = false;
- }
- else if (fEntityScanner.skipSpaces()) {
- // <!ENTITY% ...>
- reportFatalError("MSG_SPACE_REQUIRED_BEFORE_PERCENT_IN_PEDECL",
- null);
- isPEDecl = false;
- }
- else {
- sawPERef = true;
- }
- if (sawPERef) {
- while (true) {
- String peName = fEntityScanner.scanName(NameType.REFERENCE);
- if (peName == null) {
- reportFatalError("NameRequiredInPEReference", null);
- }
- else if (!fEntityScanner.skipChar(';', NameType.REFERENCE)) {
- reportFatalError("SemicolonRequiredInPEReference",
- new Object[]{peName});
- }
- else {
- startPE(peName, false);
- }
- fEntityScanner.skipSpaces();
- if (!fEntityScanner.skipChar('%', NameType.REFERENCE))
- break;
- if (!isPEDecl) {
- if (skipSeparator(true, !scanningInternalSubset())) {
- isPEDecl = true;
- break;
- }
- isPEDecl = fEntityScanner.skipChar('%', NameType.REFERENCE);
- }
- }
- }
-
- // name
- String name = fEntityScanner.scanName(NameType.ENTITY);
- if (name == null) {
- reportFatalError("MSG_ENTITY_NAME_REQUIRED_IN_ENTITYDECL", null);
- }
-
- // spaces
- if (!skipSeparator(true, !scanningInternalSubset())) {
- reportFatalError("MSG_SPACE_REQUIRED_AFTER_ENTITY_NAME_IN_ENTITYDECL",
- new Object[]{name});
- }
-
- // external id
- scanExternalID(fStrings, false);
- String systemId = fStrings[0];
- String publicId = fStrings[1];
-
- if (isPEDecl && systemId != null) {
- fSeenExternalPE = true;
- }
-
- String notation = null;
- // NDATA
- boolean sawSpace = skipSeparator(true, !scanningInternalSubset());
- if (!isPEDecl && fEntityScanner.skipString("NDATA")) {
- // check whether there was space before NDATA
- if (!sawSpace) {
- reportFatalError("MSG_SPACE_REQUIRED_BEFORE_NDATA_IN_UNPARSED_ENTITYDECL",
- new Object[]{name});
- }
-
- // spaces
- if (!skipSeparator(true, !scanningInternalSubset())) {
- reportFatalError("MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_UNPARSED_ENTITYDECL",
- new Object[]{name});
- }
- notation = fEntityScanner.scanName(NameType.NOTATION);
- if (notation == null) {
- reportFatalError("MSG_NOTATION_NAME_REQUIRED_FOR_UNPARSED_ENTITYDECL",
- new Object[]{name});
- }
- }
-
- // internal entity
- if (systemId == null) {
- scanEntityValue(name, isPEDecl, fLiteral, fLiteral2);
- // since we need it's value anyway, let's snag it so it doesn't get corrupted
- // if a new load takes place before we store the entity values
- fStringBuffer.clear();
- fStringBuffer2.clear();
- fStringBuffer.append(fLiteral.ch, fLiteral.offset, fLiteral.length);
- fStringBuffer2.append(fLiteral2.ch, fLiteral2.offset, fLiteral2.length);
- }
-
- // skip possible trailing space
- skipSeparator(false, !scanningInternalSubset());
-
- // end
- if (!fEntityScanner.skipChar('>', null)) {
- reportFatalError("EntityDeclUnterminated", new Object[]{name});
- }
- fMarkUpDepth--;
-
- // register entity and make callback
- if (isPEDecl) {
- name = "%" + name;
- }
- if (systemId != null) {
- String baseSystemId = fEntityScanner.getBaseSystemId();
- if (notation != null) {
- fEntityStore.addUnparsedEntity(name, publicId, systemId, baseSystemId, notation);
- }
- else {
- fEntityStore.addExternalEntity(name, publicId, systemId,
- baseSystemId);
- }
- if (fDTDHandler != null) {
- //Venu Revisit : why false has been removed in expandSYstem
- fResourceIdentifier.setValues(publicId, systemId, baseSystemId, XMLEntityManager.expandSystemId(systemId, baseSystemId ));
-
- if (notation != null) {
- fDTDHandler.unparsedEntityDecl(name, fResourceIdentifier,
- notation, null);
- }
- else {
- fDTDHandler.externalEntityDecl(name, fResourceIdentifier, null);
- }
- }
- }
- else {
- fEntityStore.addInternalEntity(name, fStringBuffer.toString());
- if (fDTDHandler != null) {
- fDTDHandler.internalEntityDecl(name, fStringBuffer, fStringBuffer2, null);
- }
- }
- fReportEntity = true;
-
- } // scanEntityDecl()
-
- /**
- * Scans an entity value.
- *
- * @param value The string to fill in with the value.
- * @param nonNormalizedValue The string to fill in with the
- * non-normalized value.
- *
- * <strong>Note:</strong> This method uses fString, fStringBuffer (through
- * the use of scanCharReferenceValue), and fStringBuffer2, anything in them
- * at the time of calling is lost.
- */
- protected final void scanEntityValue(String entityName, boolean isPEDecl, XMLString value,
- XMLString nonNormalizedValue)
- throws IOException, XNIException {
- int quote = fEntityScanner.scanChar(null);
- if (quote != '\'' && quote != '"') {
- reportFatalError("OpenQuoteMissingInDecl", null);
- }
- // store at which depth of entities we start
- int entityDepth = fEntityDepth;
-
- XMLString literal = fString;
- XMLString literal2 = fString;
- int countChar = 0;
- if (fLimitAnalyzer == null ) {
- fLimitAnalyzer = fEntityManager.fLimitAnalyzer;
- }
- fLimitAnalyzer.startEntity(entityName);
-
- if (fEntityScanner.scanLiteral(quote, fString, false) != quote) {
- fStringBuffer.clear();
- fStringBuffer2.clear();
- int offset;
- do {
- countChar = 0;
- offset = fStringBuffer.length;
- fStringBuffer.append(fString);
- fStringBuffer2.append(fString);
- if (fEntityScanner.skipChar('&', NameType.REFERENCE)) {
- if (fEntityScanner.skipChar('#', NameType.REFERENCE)) {
- fStringBuffer2.append("&#");
- scanCharReferenceValue(fStringBuffer, fStringBuffer2);
- }
- else {
- fStringBuffer.append('&');
- fStringBuffer2.append('&');
- String eName = fEntityScanner.scanName(NameType.REFERENCE);
- if (eName == null) {
- reportFatalError("NameRequiredInReference",
- null);
- }
- else {
- fStringBuffer.append(eName);
- fStringBuffer2.append(eName);
- }
- if (!fEntityScanner.skipChar(';', NameType.REFERENCE)) {
- reportFatalError("SemicolonRequiredInReference",
- new Object[]{eName});
- }
- else {
- fStringBuffer.append(';');
- fStringBuffer2.append(';');
- }
- }
- }
- else if (fEntityScanner.skipChar('%', NameType.REFERENCE)) {
- while (true) {
- fStringBuffer2.append('%');
- String peName = fEntityScanner.scanName(NameType.REFERENCE);
- if (peName == null) {
- reportFatalError("NameRequiredInPEReference",
- null);
- }
- else if (!fEntityScanner.skipChar(';', NameType.REFERENCE)) {
- reportFatalError("SemicolonRequiredInPEReference",
- new Object[]{peName});
- }
- else {
- if (scanningInternalSubset()) {
- reportFatalError("PEReferenceWithinMarkup",
- new Object[]{peName});
- }
- fStringBuffer2.append(peName);
- fStringBuffer2.append(';');
- }
- startPE(peName, true);
- // REVISIT: [Q] Why do we skip spaces here? -Ac
- // REVISIT: This will make returning the non-
- // normalized value harder. -Ac
- fEntityScanner.skipSpaces();
- if (!fEntityScanner.skipChar('%', NameType.REFERENCE))
- break;
- }
- }
- else {
- int c = fEntityScanner.peekChar();
- if (XMLChar.isHighSurrogate(c)) {
- countChar++;
- scanSurrogates(fStringBuffer2);
- }
- else if (isInvalidLiteral(c)) {
- reportFatalError("InvalidCharInLiteral",
- new Object[]{Integer.toHexString(c)});
- fEntityScanner.scanChar(null);
- }
- // if it's not the delimiting quote or if it is but from a
- // different entity than the one this literal started from,
- // simply append the character to our buffer
- else if (c != quote || entityDepth != fEntityDepth) {
- fStringBuffer.append((char)c);
- fStringBuffer2.append((char)c);
- fEntityScanner.scanChar(null);
- }
- }
- checkEntityLimit(isPEDecl, entityName, fStringBuffer.length - offset + countChar);
- } while (fEntityScanner.scanLiteral(quote, fString, false) != quote);
- checkEntityLimit(isPEDecl, entityName, fString.length);
- fStringBuffer.append(fString);
- fStringBuffer2.append(fString);
- literal = fStringBuffer;
- literal2 = fStringBuffer2;
- } else {
- checkEntityLimit(isPEDecl, entityName, literal);
- }
- value.setValues(literal);
- nonNormalizedValue.setValues(literal2);
- if (fLimitAnalyzer != null) {
- if (isPEDecl) {
- fLimitAnalyzer.endEntity(XMLSecurityManager.Limit.PARAMETER_ENTITY_SIZE_LIMIT, entityName);
- } else {
- fLimitAnalyzer.endEntity(XMLSecurityManager.Limit.GENERAL_ENTITY_SIZE_LIMIT, entityName);
- }
- }
-
- if (!fEntityScanner.skipChar(quote, null)) {
- reportFatalError("CloseQuoteMissingInDecl", null);
- }
- } // scanEntityValue(XMLString,XMLString):void
-
- /**
- * Scans a notation declaration
- * <p>
- * <pre>
- * [82] NotationDecl ::= '&lt;!NOTATION' S Name S (ExternalID|PublicID) S? '>'
- * [83] PublicID ::= 'PUBLIC' S PubidLiteral
- * </pre>
- * <p>
- * <strong>Note:</strong> Called after scanning past '&lt;!NOTATION'
- */
- private final void scanNotationDecl() throws IOException, XNIException {
-
- // spaces
- fReportEntity = false;
- if (!skipSeparator(true, !scanningInternalSubset())) {
- reportFatalError("MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_NOTATIONDECL",
- null);
- }
-
- // notation name
- String name = fEntityScanner.scanName(NameType.NOTATION);
- if (name == null) {
- reportFatalError("MSG_NOTATION_NAME_REQUIRED_IN_NOTATIONDECL",
- null);
- }
-
- // spaces
- if (!skipSeparator(true, !scanningInternalSubset())) {
- reportFatalError("MSG_SPACE_REQUIRED_AFTER_NOTATION_NAME_IN_NOTATIONDECL",
- new Object[]{name});
- }
-
- // external id
- scanExternalID(fStrings, true);
- String systemId = fStrings[0];
- String publicId = fStrings[1];
- String baseSystemId = fEntityScanner.getBaseSystemId();
-
- if (systemId == null && publicId == null) {
- reportFatalError("ExternalIDorPublicIDRequired",
- new Object[]{name});
- }
-
- // skip possible trailing space
- skipSeparator(false, !scanningInternalSubset());
-
- // end
- if (!fEntityScanner.skipChar('>', null)) {
- reportFatalError("NotationDeclUnterminated", new Object[]{name});
- }
- fMarkUpDepth--;
-
- fResourceIdentifier.setValues(publicId, systemId, baseSystemId, XMLEntityManager.expandSystemId(systemId, baseSystemId ));
- if (nonValidatingMode) nvGrammarInfo.notationDecl(name, fResourceIdentifier, null);
- // call handler
- if (fDTDHandler != null) {
- //Venu Revisit wby false has been removed.
- //fResourceIdentifier.setValues(publicId, systemId, baseSystemId, XMLEntityManager.expandSystemId(systemId, baseSystemId, false));
- fDTDHandler.notationDecl(name, fResourceIdentifier, null);
- }
- fReportEntity = true;
-
- } // scanNotationDecl()
-
- /**
- * Scans a conditional section. If it's a section to ignore the whole
- * section gets scanned through and this method only returns after the
- * closing bracket has been found. When it's an include section though, it
- * returns to let the main loop take care of scanning it. In that case the
- * end of the section if handled by the main loop (scanDecls).
- * <p>
- * <pre>
- * [61] conditionalSect ::= includeSect | ignoreSect
- * [62] includeSect ::= '&lt;![' S? 'INCLUDE' S? '[' extSubsetDecl ']]>'
- * [63] ignoreSect ::= '&lt;![' S? 'IGNORE' S? '[' ignoreSectContents* ']]>'
- * [64] ignoreSectContents ::= Ignore ('&lt;![' ignoreSectContents ']]>' Ignore)*
- * [65] Ignore ::= Char* - (Char* ('&lt;![' | ']]>') Char*)
- * </pre>
- * <p>
- * <strong>Note:</strong> Called after scanning past '&lt;![' */
- private final void scanConditionalSect(int currPEDepth)
- throws IOException, XNIException {
-
- fReportEntity = false;
- skipSeparator(false, !scanningInternalSubset());
-
- if (fEntityScanner.skipString("INCLUDE")) {
- skipSeparator(false, !scanningInternalSubset());
- if(currPEDepth != fPEDepth && fValidation) {
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "INVALID_PE_IN_CONDITIONAL",
- new Object[]{ fEntityManager.fCurrentEntity.name},
- XMLErrorReporter.SEVERITY_ERROR);
- }
- // call handler
- if (!fEntityScanner.skipChar('[', null)) {
- reportFatalError("MSG_MARKUP_NOT_RECOGNIZED_IN_DTD", null);
- }
-
- if (fDTDHandler != null) {
- fDTDHandler.startConditional(XMLDTDHandler.CONDITIONAL_INCLUDE,
- null);
- }
- fIncludeSectDepth++;
- // just stop there and go back to the main loop
- fReportEntity = true;
- }
- else if (fEntityScanner.skipString("IGNORE")) {
- skipSeparator(false, !scanningInternalSubset());
- if(currPEDepth != fPEDepth && fValidation) {
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "INVALID_PE_IN_CONDITIONAL",
- new Object[]{ fEntityManager.fCurrentEntity.name},
- XMLErrorReporter.SEVERITY_ERROR);
- }
- // call handler
- if (fDTDHandler != null) {
- fDTDHandler.startConditional(XMLDTDHandler.CONDITIONAL_IGNORE,
- null);
- }
- if (!fEntityScanner.skipChar('[', null)) {
- reportFatalError("MSG_MARKUP_NOT_RECOGNIZED_IN_DTD", null);
- }
- fReportEntity = true;
- int initialDepth = ++fIncludeSectDepth;
- if (fDTDHandler != null) {
- fIgnoreConditionalBuffer.clear();
- }
- while (true) {
- if (fEntityScanner.skipChar('<', null)) {
- if (fDTDHandler != null) {
- fIgnoreConditionalBuffer.append('<');
- }
- //
- // These tests are split so that we handle cases like
- // '<<![' and '<!<![' which we might otherwise miss.
- //
- if (fEntityScanner.skipChar('!', null)) {
- if(fEntityScanner.skipChar('[', null)) {
- if (fDTDHandler != null) {
- fIgnoreConditionalBuffer.append("![");
- }
- fIncludeSectDepth++;
- } else {
- if (fDTDHandler != null) {
- fIgnoreConditionalBuffer.append("!");
- }
- }
- }
- }
- else if (fEntityScanner.skipChar(']', null)) {
- if (fDTDHandler != null) {
- fIgnoreConditionalBuffer.append(']');
- }
- //
- // The same thing goes for ']<![' and '<]]>', etc.
- //
- if (fEntityScanner.skipChar(']', null)) {
- if (fDTDHandler != null) {
- fIgnoreConditionalBuffer.append(']');
- }
- while (fEntityScanner.skipChar(']', null)) {
- /* empty loop body */
- if (fDTDHandler != null) {
- fIgnoreConditionalBuffer.append(']');
- }
- }
- if (fEntityScanner.skipChar('>', null)) {
- if (fIncludeSectDepth-- == initialDepth) {
- fMarkUpDepth--;
- // call handler
- if (fDTDHandler != null) {
- fLiteral.setValues(fIgnoreConditionalBuffer.ch, 0,
- fIgnoreConditionalBuffer.length - 2);
- fDTDHandler.ignoredCharacters(fLiteral, null);
- fDTDHandler.endConditional(null);
- }
- return;
- } else if(fDTDHandler != null) {
- fIgnoreConditionalBuffer.append('>');
- }
- }
- }
- }
- else {
- int c = fEntityScanner.scanChar(null);
- if (fScannerState == SCANNER_STATE_END_OF_INPUT) {
- reportFatalError("IgnoreSectUnterminated", null);
- return;
- }
- if (fDTDHandler != null) {
- fIgnoreConditionalBuffer.append((char)c);
- }
- }
- }
- }
- else {
- reportFatalError("MSG_MARKUP_NOT_RECOGNIZED_IN_DTD", null);
- }
-
- } // scanConditionalSect()
-
- /**
- * Dispatch an XML "event".
- *
- * @param complete True if this method is intended to scan
- * and dispatch as much as possible.
- *
- * @return True if there is more to scan.
- *
- * @throws IOException Thrown on i/o error.
- * @throws XNIException Thrown on parse error.
- *
- */
- protected final boolean scanDecls(boolean complete)
- throws IOException, XNIException {
-
- skipSeparator(false, true);
- boolean again = true;
- //System.out.println("scanDecls"+fScannerState);
- while (again && fScannerState == SCANNER_STATE_MARKUP_DECL) {
- again = complete;
- if (fEntityScanner.skipChar('<', null)) {
- fMarkUpDepth++;
- if (fEntityScanner.skipChar('?', null)) {
- fStringBuffer.clear();
- scanPI(fStringBuffer);
- fMarkUpDepth--; // we're done with this decl
- }
- else if (fEntityScanner.skipChar('!', null)) {
- if (fEntityScanner.skipChar('-', null)) {
- if (!fEntityScanner.skipChar('-', null)) {
- reportFatalError("MSG_MARKUP_NOT_RECOGNIZED_IN_DTD",
- null);
- } else {
- scanComment();
- }
- }
- else if (fEntityScanner.skipString("ELEMENT")) {
- scanElementDecl();
- }
- else if (fEntityScanner.skipString("ATTLIST")) {
- scanAttlistDecl();
- }
- else if (fEntityScanner.skipString("ENTITY")) {
- scanEntityDecl();
- }
- else if (fEntityScanner.skipString("NOTATION")) {
- scanNotationDecl();
- }
- else if (fEntityScanner.skipChar('[', null) &&
- !scanningInternalSubset()) {
- scanConditionalSect(fPEDepth);
- }
- else {
- fMarkUpDepth--;
- reportFatalError("MSG_MARKUP_NOT_RECOGNIZED_IN_DTD",
- null);
- }
- }
- else {
- fMarkUpDepth--;
- reportFatalError("MSG_MARKUP_NOT_RECOGNIZED_IN_DTD", null);
- }
- }
- else if (fIncludeSectDepth > 0 && fEntityScanner.skipChar(']', null)) {
- // end of conditional section?
- if (!fEntityScanner.skipChar(']', null)
- || !fEntityScanner.skipChar('>', null)) {
- reportFatalError("IncludeSectUnterminated", null);
- }
- // call handler
- if (fDTDHandler != null) {
- fDTDHandler.endConditional(null);
- }
- // decreaseMarkupDepth();
- fIncludeSectDepth--;
- fMarkUpDepth--;
- }
- else if (scanningInternalSubset() &&
- fEntityScanner.peekChar() == ']') {
- // this is the end of the internal subset, let's stop here
- return false;
- }
- else if (fEntityScanner.skipSpaces()) {
- // simply skip
- }
- else {
- reportFatalError("MSG_MARKUP_NOT_RECOGNIZED_IN_DTD", null);
- }
- skipSeparator(false, true);
- }
- return fScannerState != SCANNER_STATE_END_OF_INPUT;
- }
-
- /**
- * Skip separator. This is typically just whitespace but it can also be one
- * or more parameter entity references.
- * <p>
- * If there are some it "expands them" by calling the corresponding entity
- * from the entity manager.
- * <p>
- * This is recursive and will process has many refs as possible.
- *
- * @param spaceRequired Specify whether some leading whitespace should be
- * found
- * @param lookForPERefs Specify whether parameter entity references should
- * be looked for
- * @return True if any leading whitespace was found or the end of a
- * parameter entity was crossed.
- */
- private boolean skipSeparator(boolean spaceRequired, boolean lookForPERefs)
- throws IOException, XNIException {
- int depth = fPEDepth;
- boolean sawSpace = fEntityScanner.skipSpaces();
- if (!lookForPERefs || !fEntityScanner.skipChar('%', NameType.REFERENCE)) {
- return !spaceRequired || sawSpace || (depth != fPEDepth);
- }
- while (true) {
- String name = fEntityScanner.scanName(NameType.ENTITY);
- if (name == null) {
- reportFatalError("NameRequiredInPEReference", null);
- }
- else if (!fEntityScanner.skipChar(';', NameType.REFERENCE)) {
- reportFatalError("SemicolonRequiredInPEReference",
- new Object[]{name});
- }
- startPE(name, false);
- fEntityScanner.skipSpaces();
- if (!fEntityScanner.skipChar('%', NameType.REFERENCE))
- return true;
- }
- }
-
-
- /*
- * Element Children Content Stack
- */
- private final void pushContentStack(int c) {
- if (fContentStack.length == fContentDepth) {
- int[] newStack = new int[fContentDepth * 2];
- System.arraycopy(fContentStack, 0, newStack, 0, fContentDepth);
- fContentStack = newStack;
- }
- fContentStack[fContentDepth++] = c;
- }
-
- private final int popContentStack() {
- return fContentStack[--fContentDepth];
- }
-
-
- /*
- * Parameter Entity Stack
- */
- private final void pushPEStack(int depth, boolean report) {
- if (fPEStack.length == fPEDepth) {
- int[] newIntStack = new int[fPEDepth * 2];
- System.arraycopy(fPEStack, 0, newIntStack, 0, fPEDepth);
- fPEStack = newIntStack;
- // report end/start calls
- boolean[] newBooleanStack = new boolean[fPEDepth * 2];
- System.arraycopy(fPEReport, 0, newBooleanStack, 0, fPEDepth);
- fPEReport = newBooleanStack;
-
- }
- fPEReport[fPEDepth] = report;
- fPEStack[fPEDepth++] = depth;
- }
-
- /** pop the stack */
- private final int popPEStack() {
- return fPEStack[--fPEDepth];
- }
-
- /** look at the top of the stack */
- private final boolean peekReportEntity() {
- return fPEReport[fPEDepth-1];
- }
-
-
- /*
- * Utility method
- */
- private final void ensureEnumerationSize(int size) {
- if (fEnumeration.length == size) {
- String[] newEnum = new String[size * 2];
- System.arraycopy(fEnumeration, 0, newEnum, 0, size);
- fEnumeration = newEnum;
- }
- }
-
- // private methods
- private void init() {
- // reset state related data
- fStartDTDCalled = false;
- fExtEntityDepth = 0;
- fIncludeSectDepth = 0;
- fMarkUpDepth = 0;
- fPEDepth = 0;
-
- fStandalone = false;
- fSeenExternalDTD = false;
- fSeenExternalPE = false;
-
- // set starting state
- setScannerState(SCANNER_STATE_TEXT_DECL);
- //new SymbolTable());
-
- fLimitAnalyzer = fEntityManager.fLimitAnalyzer;
- fSecurityManager = fEntityManager.fSecurityManager;
- }
-
- public DTDGrammar getGrammar(){
- return nvGrammarInfo;
- }
-
-} // class XMLDTDScannerImpl
diff --git a/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java b/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java
deleted file mode 100644
index 6d197c5..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java
+++ /dev/null
@@ -1,3292 +0,0 @@
-/*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
- */
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl;
-
-import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter;
-import com.sun.org.apache.xerces.internal.util.AugmentationsImpl;
-import com.sun.org.apache.xerces.internal.util.XMLAttributesIteratorImpl;
-import com.sun.org.apache.xerces.internal.util.XMLChar;
-import com.sun.org.apache.xerces.internal.util.XMLStringBuffer;
-import com.sun.org.apache.xerces.internal.util.XMLSymbols;
-import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager.Limit;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager;
-import com.sun.org.apache.xerces.internal.xni.Augmentations;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
-import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
-import com.sun.org.apache.xerces.internal.xni.XMLString;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponent;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentScanner;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-import com.sun.xml.internal.stream.XMLBufferListener;
-import com.sun.xml.internal.stream.XMLEntityStorage;
-import com.sun.xml.internal.stream.dtd.DTDGrammarUtil;
-import java.io.EOFException;
-import java.io.IOException;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.events.XMLEvent;
-
-
-/**
- *
- * This class is responsible for scanning the structure and content
- * of document fragments.
- *
- * This class has been modified as per the new design which is more suited to
- * efficiently build pull parser. Lot of improvements have been done and
- * the code has been added to support stax functionality/features.
- *
- * @author Neeraj Bajaj SUN Microsystems
- * @author K.Venugopal SUN Microsystems
- * @author Glenn Marcy, IBM
- * @author Andy Clark, IBM
- * @author Arnaud Le Hors, IBM
- * @author Eric Ye, IBM
- * @author Sunitha Reddy, SUN Microsystems
- * @version $Id: XMLDocumentFragmentScannerImpl.java,v 1.19 2010-11-02 19:54:55 joehw Exp $
- *
- */
-public class XMLDocumentFragmentScannerImpl
- extends XMLScanner
- implements XMLDocumentScanner, XMLComponent, XMLEntityHandler, XMLBufferListener {
-
- //
- // Constants
- //
-
- protected int fElementAttributeLimit, fXMLNameLimit;
-
- /** External subset resolver. **/
- protected ExternalSubsetResolver fExternalSubsetResolver;
-
- // scanner states
-
- //XXX this should be divided into more states.
- /** Scanner state: start of markup. */
- protected static final int SCANNER_STATE_START_OF_MARKUP = 21;
-
- /** Scanner state: content. */
- protected static final int SCANNER_STATE_CONTENT = 22;
-
- /** Scanner state: processing instruction. */
- protected static final int SCANNER_STATE_PI = 23;
-
- /** Scanner state: DOCTYPE. */
- protected static final int SCANNER_STATE_DOCTYPE = 24;
-
- /** Scanner state: XML Declaration */
- protected static final int SCANNER_STATE_XML_DECL = 25;
-
- /** Scanner state: root element. */
- protected static final int SCANNER_STATE_ROOT_ELEMENT = 26;
-
- /** Scanner state: comment. */
- protected static final int SCANNER_STATE_COMMENT = 27;
-
- /** Scanner state: reference. */
- protected static final int SCANNER_STATE_REFERENCE = 28;
-
- // <book type="hard"> reading attribute name 'type'
- protected static final int SCANNER_STATE_ATTRIBUTE = 29;
-
- // <book type="hard"> //reading attribute value.
- protected static final int SCANNER_STATE_ATTRIBUTE_VALUE = 30;
-
- /** Scanner state: trailing misc. USED BY DOCUMENT_SCANNER_IMPL*/
- //protected static final int SCANNER_STATE_TRAILING_MISC = 32;
-
- /** Scanner state: end of input. */
- protected static final int SCANNER_STATE_END_OF_INPUT = 33;
-
- /** Scanner state: terminated. */
- protected static final int SCANNER_STATE_TERMINATED = 34;
-
- /** Scanner state: CDATA section. */
- protected static final int SCANNER_STATE_CDATA = 35;
-
- /** Scanner state: Text declaration. */
- protected static final int SCANNER_STATE_TEXT_DECL = 36;
-
- /** Scanner state: Text declaration. */
- protected static final int SCANNER_STATE_CHARACTER_DATA = 37;
-
- //<book type="hard">foo</book>
- protected static final int SCANNER_STATE_START_ELEMENT_TAG = 38;
-
- //<book type="hard">foo</book> reading </book>
- protected static final int SCANNER_STATE_END_ELEMENT_TAG = 39;
-
- protected static final int SCANNER_STATE_CHAR_REFERENCE = 40;
- protected static final int SCANNER_STATE_BUILT_IN_REFS = 41;
-
- // feature identifiers
-
-
- /** Feature identifier: notify built-in refereces. */
- protected static final String NOTIFY_BUILTIN_REFS =
- Constants.XERCES_FEATURE_PREFIX + Constants.NOTIFY_BUILTIN_REFS_FEATURE;
-
- /** Property identifier: entity resolver. */
- protected static final String ENTITY_RESOLVER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_RESOLVER_PROPERTY;
-
- /** Feature identifier: standard uri conformant */
- protected static final String STANDARD_URI_CONFORMANT =
- Constants.XERCES_FEATURE_PREFIX +Constants.STANDARD_URI_CONFORMANT_FEATURE;
-
- /** Property identifier: Security property manager. */
- private static final String XML_SECURITY_PROPERTY_MANAGER =
- Constants.XML_SECURITY_PROPERTY_MANAGER;
-
- /** access external dtd: file protocol
- * For DOM/SAX, the secure feature is set to true by default
- */
- final static String EXTERNAL_ACCESS_DEFAULT = Constants.EXTERNAL_ACCESS_DEFAULT;
-
- // recognized features and properties
-
- /** Recognized features. */
- private static final String[] RECOGNIZED_FEATURES = {
- NAMESPACES,
- VALIDATION,
- NOTIFY_BUILTIN_REFS,
- NOTIFY_CHAR_REFS,
- Constants.STAX_REPORT_CDATA_EVENT
- };
-
- /** Feature defaults. */
- private static final Boolean[] FEATURE_DEFAULTS = {
- Boolean.TRUE,
- null,
- Boolean.FALSE,
- Boolean.FALSE,
- Boolean.TRUE
- };
-
- /** Recognized properties. */
- private static final String[] RECOGNIZED_PROPERTIES = {
- SYMBOL_TABLE,
- ERROR_REPORTER,
- ENTITY_MANAGER,
- XML_SECURITY_PROPERTY_MANAGER
- };
-
- /** Property defaults. */
- private static final Object[] PROPERTY_DEFAULTS = {
- null,
- null,
- null,
- null
- };
-
- private static final char [] cdata = {'[','C','D','A','T','A','['};
- static final char [] xmlDecl = {'<','?','x','m','l'};
- // private static final char [] endTag = {'<','/'};
- // debugging
-
- /** Debug scanner state. */
- private static final boolean DEBUG_SCANNER_STATE = false;
-
- /** Debug driver. */
- private static final boolean DEBUG_DISPATCHER = false;
-
- /** Debug content driver scanning. */
- protected static final boolean DEBUG_START_END_ELEMENT = false;
-
-
- /** Debug driver next */
- protected static final boolean DEBUG_NEXT = false ;
-
- /** Debug driver next */
- protected static final boolean DEBUG = false;
- protected static final boolean DEBUG_COALESCE = false;
- //
- // Data
- //
-
- // protected data
-
- /** Document handler. */
- protected XMLDocumentHandler fDocumentHandler;
- protected int fScannerLastState ;
-
- /** Entity Storage */
- protected XMLEntityStorage fEntityStore;
-
- /** Entity stack. */
- protected int[] fEntityStack = new int[4];
-
- /** Markup depth. */
- protected int fMarkupDepth;
-
- //is the element empty
- protected boolean fEmptyElement ;
-
- //track if we are reading attributes, this is usefule while
- //there is a callback
- protected boolean fReadingAttributes = false;
-
- /** Scanner state. */
- protected int fScannerState;
-
- /** SubScanner state: inside scanContent method. */
- protected boolean fInScanContent = false;
- protected boolean fLastSectionWasCData = false;
- protected boolean fLastSectionWasEntityReference = false;
- protected boolean fLastSectionWasCharacterData = false;
-
- /** has external dtd */
- protected boolean fHasExternalDTD;
-
- /** Standalone. */
- protected boolean fStandaloneSet;
- protected boolean fStandalone;
- protected String fVersion;
-
- // element information
-
- /** Current element. */
- protected QName fCurrentElement;
-
- /** Element stack. */
- protected ElementStack fElementStack = new ElementStack();
- protected ElementStack2 fElementStack2 = new ElementStack2();
-
- // other info
-
- /** Document system identifier.
- * REVISIT: So what's this used for? - NG
- * protected String fDocumentSystemId;
- ******/
-
- protected String fPITarget ;
-
- //xxx do we need to create an extra XMLString object... look for using fTempString for collecting all the data values
- protected XMLString fPIData = new XMLString();
-
- // features
-
-
- /** Notify built-in references. */
- protected boolean fNotifyBuiltInRefs = false;
-
- //STAX related properties
- //defaultValues.
- protected boolean fSupportDTD = true;
- protected boolean fReplaceEntityReferences = true;
- protected boolean fSupportExternalEntities = false;
- protected boolean fReportCdataEvent = false ;
- protected boolean fIsCoalesce = false ;
- protected String fDeclaredEncoding = null;
- /** Xerces Feature: Disallow doctype declaration. */
- protected boolean fDisallowDoctype = false;
-
- /**
- * comma-delimited list of protocols that are allowed for the purpose
- * of accessing external dtd or entity references
- */
- protected String fAccessExternalDTD = EXTERNAL_ACCESS_DEFAULT;
-
- /**
- * standard uri conformant (strict uri).
- * http://apache.org/xml/features/standard-uri-conformant
- */
- protected boolean fStrictURI;
-
- // drivers
-
- /** Active driver. */
- protected Driver fDriver;
-
- /** Content driver. */
- protected Driver fContentDriver = createContentDriver();
-
- // temporary variables
-
- /** Element QName. */
- protected QName fElementQName = new QName();
-
- /** Attribute QName. */
- protected QName fAttributeQName = new QName();
-
- /**
- * CHANGED: Using XMLAttributesIteratorImpl instead of XMLAttributesImpl. This class
- * implements Iterator interface so we can directly give Attributes in the form of
- * iterator.
- */
- protected XMLAttributesIteratorImpl fAttributes = new XMLAttributesIteratorImpl();
-
-
- /** String. */
- protected XMLString fTempString = new XMLString();
-
- /** String. */
- protected XMLString fTempString2 = new XMLString();
-
- /** Array of 3 strings. */
- private String[] fStrings = new String[3];
-
- /** Making the buffer accesible to derived class -- String buffer. */
- protected XMLStringBuffer fStringBuffer = new XMLStringBuffer();
-
- /** Making the buffer accesible to derived class -- String buffer. */
- protected XMLStringBuffer fStringBuffer2 = new XMLStringBuffer();
-
- /** stores character data. */
- /** Making the buffer accesible to derived class -- stores PI data */
- protected XMLStringBuffer fContentBuffer = new XMLStringBuffer();
-
- /** Single character array. */
- private final char[] fSingleChar = new char[1];
- private String fCurrentEntityName = null;
-
- // New members
- protected boolean fScanToEnd = false;
-
- protected DTDGrammarUtil dtdGrammarUtil= null;
-
- protected boolean fAddDefaultAttr = false;
-
- protected boolean foundBuiltInRefs = false;
-
-
- //skip element algorithm
- static final short MAX_DEPTH_LIMIT = 5 ;
- static final short ELEMENT_ARRAY_LENGTH = 200 ;
- static final short MAX_POINTER_AT_A_DEPTH = 4 ;
- static final boolean DEBUG_SKIP_ALGORITHM = false;
- //create a elemnet array of length equal to ELEMENT_ARRAY_LENGTH
- String [] fElementArray = new String[ELEMENT_ARRAY_LENGTH] ;
- //pointer location where last element was skipped
- short fLastPointerLocation = 0 ;
- short fElementPointer = 0 ;
- //2D array to store pointer info
- short [] [] fPointerInfo = new short[MAX_DEPTH_LIMIT] [MAX_POINTER_AT_A_DEPTH] ;
- protected String fElementRawname ;
- protected boolean fShouldSkip = false;
- protected boolean fAdd = false ;
- protected boolean fSkip = false;
-
- /** Reusable Augmentations. */
- private Augmentations fTempAugmentations = null;
- //
- // Constructors
- //
-
- /** Default constructor. */
- public XMLDocumentFragmentScannerImpl() {
- } // <init>()
-
- //
- // XMLDocumentScanner methods
- //
-
- /**
- * Sets the input source.
- *
- * @param inputSource The input source.
- *
- * @throws IOException Thrown on i/o error.
- */
- public void setInputSource(XMLInputSource inputSource) throws IOException {
- fEntityManager.setEntityHandler(this);
- fEntityManager.startEntity(false, "$fragment$", inputSource, false, true);
- // fDocumentSystemId = fEntityManager.expandSystemId(inputSource.getSystemId());
- } // setInputSource(XMLInputSource)
-
- /**
- * Scans a document.
- *
- * @param complete True if the scanner should scan the document
- * completely, pushing all events to the registered
- * document handler. A value of false indicates that
- * that the scanner should only scan the next portion
- * of the document and return. A scanner instance is
- * permitted to completely scan a document if it does
- * not support this "pull" scanning model.
- *
- * @return True if there is more to scan, false otherwise.
- */
- public boolean scanDocument(boolean complete)
- throws IOException, XNIException {
-
- // keep dispatching "events"
- fEntityManager.setEntityHandler(this);
- //System.out.println(" get Document Handler in NSDocumentHandler " + fDocumentHandler );
-
- int event = next();
- do {
- switch (event) {
- case XMLStreamConstants.START_DOCUMENT :
- //fDocumentHandler.startDocument(fEntityManager.getEntityScanner(),fEntityManager.getEntityScanner().getVersion(),fNamespaceContext,null);// not able to get
- break;
- case XMLStreamConstants.START_ELEMENT :
- //System.out.println(" in scann element");
- //fDocumentHandler.startElement(getElementQName(),fAttributes,null);
- break;
- case XMLStreamConstants.CHARACTERS :
- fEntityScanner.checkNodeCount(fEntityScanner.fCurrentEntity);
- fDocumentHandler.characters(getCharacterData(),null);
- break;
- case XMLStreamConstants.SPACE:
- //check if getCharacterData() is the right function to retrieve ignorableWhitespace information.
- //System.out.println("in the space");
- //fDocumentHandler.ignorableWhitespace(getCharacterData(), null);
- break;
- case XMLStreamConstants.ENTITY_REFERENCE :
- fEntityScanner.checkNodeCount(fEntityScanner.fCurrentEntity);
- //entity reference callback are given in startEntity
- break;
- case XMLStreamConstants.PROCESSING_INSTRUCTION :
- fEntityScanner.checkNodeCount(fEntityScanner.fCurrentEntity);
- fDocumentHandler.processingInstruction(getPITarget(),getPIData(),null);
- break;
- case XMLStreamConstants.COMMENT :
- fEntityScanner.checkNodeCount(fEntityScanner.fCurrentEntity);
- fDocumentHandler.comment(getCharacterData(),null);
- break;
- case XMLStreamConstants.DTD :
- //all DTD related callbacks are handled in DTDScanner.
- //1. Stax doesn't define DTD states as it does for XML Document.
- //therefore we don't need to take care of anything here. So Just break;
- break;
- case XMLStreamConstants.CDATA:
- fEntityScanner.checkNodeCount(fEntityScanner.fCurrentEntity);
- fDocumentHandler.startCDATA(null);
- //xxx: check if CDATA values comes from getCharacterData() function
- fDocumentHandler.characters(getCharacterData(),null);
- fDocumentHandler.endCDATA(null);
- //System.out.println(" in CDATA of the XMLNSDocumentScannerImpl");
- break;
- case XMLStreamConstants.NOTATION_DECLARATION :
- break;
- case XMLStreamConstants.ENTITY_DECLARATION :
- break;
- case XMLStreamConstants.NAMESPACE :
- break;
- case XMLStreamConstants.ATTRIBUTE :
- break;
- case XMLStreamConstants.END_ELEMENT :
- //do not give callback here.
- //this callback is given in scanEndElement function.
- //fDocumentHandler.endElement(getElementQName(),null);
- break;
- default :
- throw new InternalError("processing event: " + event);
-
- }
- //System.out.println("here in before calling next");
- event = next();
- //System.out.println("here in after calling next");
- } while (event!=XMLStreamConstants.END_DOCUMENT && complete);
-
- if(event == XMLStreamConstants.END_DOCUMENT) {
- fDocumentHandler.endDocument(null);
- return false;
- }
-
- return true;
-
- } // scanDocument(boolean):boolean
-
-
-
- public com.sun.org.apache.xerces.internal.xni.QName getElementQName(){
- if(fScannerLastState == XMLEvent.END_ELEMENT){
- fElementQName.setValues(fElementStack.getLastPoppedElement());
- }
- return fElementQName ;
- }
-
- /** return the next state on the input
- * @return int
- */
-
- public int next() throws IOException, XNIException {
- return fDriver.next();
- }
-
- //
- // XMLComponent methods
- //
-
- /**
- * Resets the component. The component can query the component manager
- * about any features and properties that affect the operation of the
- * component.
- *
- * @param componentManager The component manager.
- *
- * @throws SAXException Thrown by component on initialization error.
- * For example, if a feature or property is
- * required for the operation of the component, the
- * component manager may throw a
- * SAXNotRecognizedException or a
- * SAXNotSupportedException.
- */
-
- public void reset(XMLComponentManager componentManager)
- throws XMLConfigurationException {
-
- super.reset(componentManager);
-
- // other settings
- // fDocumentSystemId = null;
-
- // sax features
- //fAttributes.setNamespaces(fNamespaces);
-
- // xerces features
- fReportCdataEvent = componentManager.getFeature(Constants.STAX_REPORT_CDATA_EVENT, true);
- fSecurityManager = (XMLSecurityManager)componentManager.getProperty(Constants.SECURITY_MANAGER, null);
- fNotifyBuiltInRefs = componentManager.getFeature(NOTIFY_BUILTIN_REFS, false);
-
- Object resolver = componentManager.getProperty(ENTITY_RESOLVER, null);
- fExternalSubsetResolver = (resolver instanceof ExternalSubsetResolver) ?
- (ExternalSubsetResolver) resolver : null;
-
- //attribute
- fReadingAttributes = false;
- //xxx: external entities are supported in Xerces
- // it would be good to define feature for this case
- fSupportExternalEntities = true;
- fReplaceEntityReferences = true;
- fIsCoalesce = false;
-
- // setup Driver
- setScannerState(SCANNER_STATE_CONTENT);
- setDriver(fContentDriver);
-
- // JAXP 1.5 features and properties
- XMLSecurityPropertyManager spm = (XMLSecurityPropertyManager)
- componentManager.getProperty(XML_SECURITY_PROPERTY_MANAGER, null);
- fAccessExternalDTD = spm.getValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD);
-
- fStrictURI = componentManager.getFeature(STANDARD_URI_CONFORMANT, false);
-
- resetCommon();
- //fEntityManager.test();
- } // reset(XMLComponentManager)
-
-
- public void reset(PropertyManager propertyManager){
-
- super.reset(propertyManager);
-
- // other settings
- // fDocumentSystemId = null;
- fNamespaces = ((Boolean)propertyManager.getProperty(XMLInputFactory.IS_NAMESPACE_AWARE)).booleanValue();
- fNotifyBuiltInRefs = false ;
-
- //fElementStack2.clear();
- //fReplaceEntityReferences = true;
- //fSupportExternalEntities = true;
- Boolean bo = (Boolean)propertyManager.getProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES);
- fReplaceEntityReferences = bo.booleanValue();
- bo = (Boolean)propertyManager.getProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES);
- fSupportExternalEntities = bo.booleanValue();
- Boolean cdata = (Boolean)propertyManager.getProperty(Constants.ZEPHYR_PROPERTY_PREFIX + Constants.STAX_REPORT_CDATA_EVENT) ;
- if(cdata != null)
- fReportCdataEvent = cdata.booleanValue() ;
- Boolean coalesce = (Boolean)propertyManager.getProperty(XMLInputFactory.IS_COALESCING) ;
- if(coalesce != null)
- fIsCoalesce = coalesce.booleanValue();
- fReportCdataEvent = fIsCoalesce ? false : (fReportCdataEvent && true) ;
- //if fIsCoalesce is set to true, set the value of fReplaceEntityReferences to true,
- //if fIsCoalesce is set to false, take the value of fReplaceEntityReferences as set by application
- fReplaceEntityReferences = fIsCoalesce ? true : fReplaceEntityReferences;
- // setup Driver
- //we dont need to do this -- nb.
- //setScannerState(SCANNER_STATE_CONTENT);
- //setDriver(fContentDriver);
- //fEntityManager.test();
-
- // JAXP 1.5 features and properties
- XMLSecurityPropertyManager spm = (XMLSecurityPropertyManager)
- propertyManager.getProperty(XML_SECURITY_PROPERTY_MANAGER);
- fAccessExternalDTD = spm.getValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD);
-
- fSecurityManager = (XMLSecurityManager)propertyManager.getProperty(Constants.SECURITY_MANAGER);
- resetCommon();
- } // reset(XMLComponentManager)
-
- void resetCommon() {
- // initialize vars
- fMarkupDepth = 0;
- fCurrentElement = null;
- fElementStack.clear();
- fHasExternalDTD = false;
- fStandaloneSet = false;
- fStandalone = false;
- fInScanContent = false;
- //skipping algorithm
- fShouldSkip = false;
- fAdd = false;
- fSkip = false;
-
- fEntityStore = fEntityManager.getEntityStore();
- dtdGrammarUtil = null;
-
- if (fSecurityManager != null) {
- fElementAttributeLimit = fSecurityManager.getLimit(XMLSecurityManager.Limit.ELEMENT_ATTRIBUTE_LIMIT);
- fXMLNameLimit = fSecurityManager.getLimit(XMLSecurityManager.Limit.MAX_NAME_LIMIT);
- } else {
- fElementAttributeLimit = 0;
- fXMLNameLimit = XMLSecurityManager.Limit.MAX_NAME_LIMIT.defaultValue();
- }
- fLimitAnalyzer = fEntityManager.fLimitAnalyzer;
- }
-
- /**
- * Returns a list of feature identifiers that are recognized by
- * this component. This method may return null if no features
- * are recognized by this component.
- */
- public String[] getRecognizedFeatures() {
- return (String[])(RECOGNIZED_FEATURES.clone());
- } // getRecognizedFeatures():String[]
-
- /**
- * Sets the state of a feature. This method is called by the component
- * manager any time after reset when a feature changes state.
- * <p>
- * <strong>Note:</strong> Components should silently ignore features
- * that do not affect the operation of the component.
- *
- * @param featureId The feature identifier.
- * @param state The state of the feature.
- *
- * @throws SAXNotRecognizedException The component should not throw
- * this exception.
- * @throws SAXNotSupportedException The component should not throw
- * this exception.
- */
- public void setFeature(String featureId, boolean state)
- throws XMLConfigurationException {
-
- super.setFeature(featureId, state);
-
- // Xerces properties
- if (featureId.startsWith(Constants.XERCES_FEATURE_PREFIX)) {
- String feature = featureId.substring(Constants.XERCES_FEATURE_PREFIX.length());
- if (feature.equals(Constants.NOTIFY_BUILTIN_REFS_FEATURE)) {
- fNotifyBuiltInRefs = state;
- }
- }
-
- } // setFeature(String,boolean)
-
- /**
- * Returns a list of property identifiers that are recognized by
- * this component. This method may return null if no properties
- * are recognized by this component.
- */
- public String[] getRecognizedProperties() {
- return (String[])(RECOGNIZED_PROPERTIES.clone());
- } // getRecognizedProperties():String[]
-
- /**
- * Sets the value of a property. This method is called by the component
- * manager any time after reset when a property changes value.
- * <p>
- * <strong>Note:</strong> Components should silently ignore properties
- * that do not affect the operation of the component.
- *
- * @param propertyId The property identifier.
- * @param value The value of the property.
- *
- * @throws SAXNotRecognizedException The component should not throw
- * this exception.
- * @throws SAXNotSupportedException The component should not throw
- * this exception.
- */
- public void setProperty(String propertyId, Object value)
- throws XMLConfigurationException {
-
- super.setProperty(propertyId, value);
-
- // Xerces properties
- if (propertyId.startsWith(Constants.XERCES_PROPERTY_PREFIX)) {
- final int suffixLength = propertyId.length() - Constants.XERCES_PROPERTY_PREFIX.length();
- if (suffixLength == Constants.ENTITY_MANAGER_PROPERTY.length() &&
- propertyId.endsWith(Constants.ENTITY_MANAGER_PROPERTY)) {
- fEntityManager = (XMLEntityManager)value;
- return;
- }
- if (suffixLength == Constants.ENTITY_RESOLVER_PROPERTY.length() &&
- propertyId.endsWith(Constants.ENTITY_RESOLVER_PROPERTY)) {
- fExternalSubsetResolver = (value instanceof ExternalSubsetResolver) ?
- (ExternalSubsetResolver) value : null;
- return;
- }
- }
-
-
- // Xerces properties
- if (propertyId.startsWith(Constants.XERCES_PROPERTY_PREFIX)) {
- String property = propertyId.substring(Constants.XERCES_PROPERTY_PREFIX.length());
- if (property.equals(Constants.ENTITY_MANAGER_PROPERTY)) {
- fEntityManager = (XMLEntityManager)value;
- }
- return;
- }
-
- //JAXP 1.5 properties
- if (propertyId.equals(XML_SECURITY_PROPERTY_MANAGER))
- {
- XMLSecurityPropertyManager spm = (XMLSecurityPropertyManager)value;
- fAccessExternalDTD = spm.getValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD);
- }
-
- } // setProperty(String,Object)
-
- /**
- * Returns the default state for a feature, or null if this
- * component does not want to report a default value for this
- * feature.
- *
- * @param featureId The feature identifier.
- *
- * @since Xerces 2.2.0
- */
- public Boolean getFeatureDefault(String featureId) {
- for (int i = 0; i < RECOGNIZED_FEATURES.length; i++) {
- if (RECOGNIZED_FEATURES[i].equals(featureId)) {
- return FEATURE_DEFAULTS[i];
- }
- }
- return null;
- } // getFeatureDefault(String):Boolean
-
- /**
- * Returns the default state for a property, or null if this
- * component does not want to report a default value for this
- * property.
- *
- * @param propertyId The property identifier.
- *
- * @since Xerces 2.2.0
- */
- public Object getPropertyDefault(String propertyId) {
- for (int i = 0; i < RECOGNIZED_PROPERTIES.length; i++) {
- if (RECOGNIZED_PROPERTIES[i].equals(propertyId)) {
- return PROPERTY_DEFAULTS[i];
- }
- }
- return null;
- } // getPropertyDefault(String):Object
-
- //
- // XMLDocumentSource methods
- //
-
- /**
- * setDocumentHandler
- *
- * @param documentHandler
- */
- public void setDocumentHandler(XMLDocumentHandler documentHandler) {
- fDocumentHandler = documentHandler;
- //System.out.println(" In Set DOCUMENT HANDLER" + fDocumentHandler + " scanner =" + this);
- } // setDocumentHandler(XMLDocumentHandler)
-
-
- /** Returns the document handler */
- public XMLDocumentHandler getDocumentHandler(){
- return fDocumentHandler;
- }
-
- //
- // XMLEntityHandler methods
- //
-
- /**
- * This method notifies of the start of an entity. The DTD has the
- * pseudo-name of "[dtd]" parameter entity names start with '%'; and
- * general entities are just specified by their name.
- *
- * @param name The name of the entity.
- * @param identifier The resource identifier.
- * @param encoding The auto-detected IANA encoding name of the entity
- * stream. This value will be null in those situations
- * where the entity encoding is not auto-detected (e.g.
- * internal entities or a document entity that is
- * parsed from a java.io.Reader).
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startEntity(String name,
- XMLResourceIdentifier identifier,
- String encoding, Augmentations augs) throws XNIException {
-
- // keep track of this entity before fEntityDepth is increased
- if (fEntityDepth == fEntityStack.length) {
- int[] entityarray = new int[fEntityStack.length * 2];
- System.arraycopy(fEntityStack, 0, entityarray, 0, fEntityStack.length);
- fEntityStack = entityarray;
- }
- fEntityStack[fEntityDepth] = fMarkupDepth;
-
- super.startEntity(name, identifier, encoding, augs);
-
- // WFC: entity declared in external subset in standalone doc
- if(fStandalone && fEntityStore.isEntityDeclInExternalSubset(name)) {
- reportFatalError("MSG_REFERENCE_TO_EXTERNALLY_DECLARED_ENTITY_WHEN_STANDALONE",
- new Object[]{name});
- }
-
- /** we are not calling the handlers yet.. */
- // call handler
- if (fDocumentHandler != null && !fScanningAttribute) {
- if (!name.equals("[xml]")) {
- fDocumentHandler.startGeneralEntity(name, identifier, encoding, augs);
- }
- }
-
- } // startEntity(String,XMLResourceIdentifier,String)
-
- /**
- * This method notifies the end of an entity. The DTD has the pseudo-name
- * of "[dtd]" parameter entity names start with '%'; and general entities
- * are just specified by their name.
- *
- * @param name The name of the entity.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endEntity(String name, Augmentations augs) throws IOException, XNIException {
-
- /**
- * // flush possible pending output buffer - see scanContent
- * if (fInScanContent && fStringBuffer.length != 0
- * && fDocumentHandler != null) {
- * fDocumentHandler.characters(fStringBuffer, null);
- * fStringBuffer.length = 0; // make sure we know it's been flushed
- * }
- */
- super.endEntity(name, augs);
-
- // make sure markup is properly balanced
- if (fMarkupDepth != fEntityStack[fEntityDepth]) {
- reportFatalError("MarkupEntityMismatch", null);
- }
-
- /**/
- // call handler
- if (fDocumentHandler != null && !fScanningAttribute) {
- if (!name.equals("[xml]")) {
- fDocumentHandler.endGeneralEntity(name, augs);
- }
- }
-
-
- } // endEntity(String)
-
- //
- // Protected methods
- //
-
- // Driver factory methods
-
- /** Creates a content Driver. */
- protected Driver createContentDriver() {
- return new FragmentContentDriver();
- } // createContentDriver():Driver
-
- // scanning methods
-
- /**
- * Scans an XML or text declaration.
- * <p>
- * <pre>
- * [23] XMLDecl ::= '&lt;?xml' VersionInfo EncodingDecl? SDDecl? S? '?>'
- * [24] VersionInfo ::= S 'version' Eq (' VersionNum ' | " VersionNum ")
- * [80] EncodingDecl ::= S 'encoding' Eq ('"' EncName '"' | "'" EncName "'" )
- * [81] EncName ::= [A-Za-z] ([A-Za-z0-9._] | '-')*
- * [32] SDDecl ::= S 'standalone' Eq (("'" ('yes' | 'no') "'")
- * | ('"' ('yes' | 'no') '"'))
- *
- * [77] TextDecl ::= '&lt;?xml' VersionInfo? EncodingDecl S? '?>'
- * </pre>
- *
- * @param scanningTextDecl True if a text declaration is to
- * be scanned instead of an XML
- * declaration.
- */
- protected void scanXMLDeclOrTextDecl(boolean scanningTextDecl)
- throws IOException, XNIException {
-
- // scan decl
- super.scanXMLDeclOrTextDecl(scanningTextDecl, fStrings);
- fMarkupDepth--;
-
- // pseudo-attribute values
- String version = fStrings[0];
- String encoding = fStrings[1];
- String standalone = fStrings[2];
- fDeclaredEncoding = encoding;
- // set standalone
- fStandaloneSet = standalone != null;
- fStandalone = fStandaloneSet && standalone.equals("yes");
- ///xxx see where its used.. this is not used anywhere. it may be useful for entity to store this information
- //but this information is only related with Document Entity.
- fEntityManager.setStandalone(fStandalone);
-
-
- // call handler
- if (fDocumentHandler != null) {
- if (scanningTextDecl) {
- fDocumentHandler.textDecl(version, encoding, null);
- } else {
- fDocumentHandler.xmlDecl(version, encoding, standalone, null);
- }
- }
-
- if(version != null){
- fEntityScanner.setVersion(version);
- fEntityScanner.setXMLVersion(version);
- }
- // set encoding on reader, only if encoding was not specified by the application explicitly
- if (encoding != null && !fEntityScanner.getCurrentEntity().isEncodingExternallySpecified()) {
- fEntityScanner.setEncoding(encoding);
- }
-
- } // scanXMLDeclOrTextDecl(boolean)
-
- public String getPITarget(){
- return fPITarget ;
- }
-
- public XMLStringBuffer getPIData(){
- return fContentBuffer ;
- }
-
- //XXX: why not this function behave as per the state of the parser?
- public XMLString getCharacterData(){
- if(fUsebuffer){
- return fContentBuffer ;
- }else{
- return fTempString;
- }
-
- }
-
-
- /**
- * Scans a processing data. This is needed to handle the situation
- * where a document starts with a processing instruction whose
- * target name <em>starts with</em> "xml". (e.g. xmlfoo)
- *
- * @param target The PI target
- * @param data The XMLStringBuffer to fill in with the data
- */
- protected void scanPIData(String target, XMLStringBuffer data)
- throws IOException, XNIException {
-
- super.scanPIData(target, data);
-
- //set the PI target and values
- fPITarget = target ;
-
- fMarkupDepth--;
-
- } // scanPIData(String)
-
- /**
- * Scans a comment.
- * <p>
- * <pre>
- * [15] Comment ::= '&lt!--' ((Char - '-') | ('-' (Char - '-')))* '-->'
- * </pre>
- * <p>
- * <strong>Note:</strong> Called after scanning past '&lt;!--'
- */
- protected void scanComment() throws IOException, XNIException {
- fContentBuffer.clear();
- scanComment(fContentBuffer);
- //getTextCharacters can also be called for reading comments
- fUsebuffer = true;
- fMarkupDepth--;
-
- } // scanComment()
-
- //xxx value returned by this function may not remain valid if another event is scanned.
- public String getComment(){
- return fContentBuffer.toString();
- }
-
- void addElement(String rawname){
- if(fElementPointer < ELEMENT_ARRAY_LENGTH){
- //storing element raw name in a linear list of array
- fElementArray[fElementPointer] = rawname ;
- //storing elemnetPointer for particular element depth
-
- if(DEBUG_SKIP_ALGORITHM){
- StringBuffer sb = new StringBuffer() ;
- sb.append(" Storing element information ") ;
- sb.append(" fElementPointer = " + fElementPointer) ;
- sb.append(" fElementRawname = " + fElementQName.rawname) ;
- sb.append(" fElementStack.fDepth = " + fElementStack.fDepth);
- System.out.println(sb.toString()) ;
- }
-
- //store pointer information only when element depth is less MAX_DEPTH_LIMIT
- if(fElementStack.fDepth < MAX_DEPTH_LIMIT){
- short column = storePointerForADepth(fElementPointer);
- if(column > 0){
- short pointer = getElementPointer((short)fElementStack.fDepth, (short)(column - 1) );
- //identity comparison shouldn't take much time and we can rely on this
- //since its guaranteed to have same object id for same string.
- if(rawname == fElementArray[pointer]){
- fShouldSkip = true ;
- fLastPointerLocation = pointer ;
- //reset the things and return.
- resetPointer((short)fElementStack.fDepth , column) ;
- fElementArray[fElementPointer] = null ;
- return ;
- }else{
- fShouldSkip = false ;
- }
- }
- }
- fElementPointer++ ;
- }
- }
-
-
- void resetPointer(short depth, short column){
- fPointerInfo[depth] [column] = (short)0;
- }
-
- //returns column information at which pointer was stored.
- short storePointerForADepth(short elementPointer){
- short depth = (short) fElementStack.fDepth ;
-
- //Stores element pointer locations at particular depth , only 4 pointer locations
- //are stored at particular depth for now.
- for(short i = 0 ; i < MAX_POINTER_AT_A_DEPTH ; i++){
-
- if(canStore(depth, i)){
- fPointerInfo[depth][i] = elementPointer ;
- if(DEBUG_SKIP_ALGORITHM){
- StringBuffer sb = new StringBuffer() ;
- sb.append(" Pointer information ") ;
- sb.append(" fElementPointer = " + fElementPointer) ;
- sb.append(" fElementStack.fDepth = " + fElementStack.fDepth);
- sb.append(" column = " + i ) ;
- System.out.println(sb.toString()) ;
- }
- return i;
- }
- //else
- //pointer was not stored because we reached the limit
- }
- return -1 ;
- }
-
- boolean canStore(short depth, short column){
- //colum = 0 , means first element at particular depth
- //column = 1, means second element at particular depth
- // calle should make sure that it doesn't call for value outside allowed co-ordinates
- return fPointerInfo[depth][column] == 0 ? true : false ;
- }
-
-
- short getElementPointer(short depth, short column){
- //colum = 0 , means first element at particular depth
- //column = 1, means second element at particular depth
- // calle should make sure that it doesn't call for value outside allowed co-ordinates
- return fPointerInfo[depth][column] ;
- }
-
- //this function assumes that string passed is not null and skips
- //the following string from the buffer this makes sure
- boolean skipFromTheBuffer(String rawname) throws IOException{
- if(fEntityScanner.skipString(rawname)){
- char c = (char)fEntityScanner.peekChar() ;
- //If the start element was completely skipped we should encounter either ' '(space),
- //or '/' (in case of empty element) or '>'
- if( c == ' ' || c == '/' || c == '>'){
- fElementRawname = rawname ;
- return true ;
- } else{
- return false;
- }
- } else
- return false ;
- }
-
- boolean skipQElement(String rawname) throws IOException{
-
- final int c = fEntityScanner.getChar(rawname.length());
- //if this character is still valid element name -- this means string can't match
- if(XMLChar.isName(c)){
- return false;
- }else{
- return fEntityScanner.skipString(rawname);
- }
- }
-
- protected boolean skipElement() throws IOException {
-
- if(!fShouldSkip) return false ;
-
- if(fLastPointerLocation != 0){
- //Look at the next element stored in the array list.. we might just get a match.
- String rawname = fElementArray[fLastPointerLocation + 1] ;
- if(rawname != null && skipFromTheBuffer(rawname)){
- fLastPointerLocation++ ;
- if(DEBUG_SKIP_ALGORITHM){
- System.out.println("Element " + fElementRawname + " was SKIPPED at pointer location = " + fLastPointerLocation);
- }
- return true ;
- } else{
- //reset it back to zero... we haven't got the correct subset yet.
- fLastPointerLocation = 0 ;
-
- }
- }
- //xxx: we can put some logic here as from what column it should start looking
- //for now we always start at 0
- //fallback to tolerant algorithm, it would look for differnt element stored at different
- //depth and get us the pointer location.
- return fShouldSkip && skipElement((short)0);
-
- }
-
- //start of the column at which it should try searching
- boolean skipElement(short column) throws IOException {
- short depth = (short)fElementStack.fDepth ;
-
- if(depth > MAX_DEPTH_LIMIT){
- return fShouldSkip = false ;
- }
- for(short i = column ; i < MAX_POINTER_AT_A_DEPTH ; i++){
- short pointer = getElementPointer(depth , i ) ;
-
- if(pointer == 0){
- return fShouldSkip = false ;
- }
-
- if(fElementArray[pointer] != null && skipFromTheBuffer(fElementArray[pointer])){
- if(DEBUG_SKIP_ALGORITHM){
- System.out.println();
- System.out.println("Element " + fElementRawname + " was SKIPPED at depth = " + fElementStack.fDepth + " column = " + column );
- System.out.println();
- }
- fLastPointerLocation = pointer ;
- return fShouldSkip = true ;
- }
- }
- return fShouldSkip = false ;
- }
-
- /**
- * Scans a start element. This method will handle the binding of
- * namespace information and notifying the handler of the start
- * of the element.
- * <p>
- * <pre>
- * [44] EmptyElemTag ::= '&lt;' Name (S Attribute)* S? '/>'
- * [40] STag ::= '&lt;' Name (S Attribute)* S? '>'
- * </pre>
- * <p>
- * <strong>Note:</strong> This method assumes that the leading
- * '&lt;' character has been consumed.
- * <p>
- * <strong>Note:</strong> This method uses the fElementQName and
- * fAttributes variables. The contents of these variables will be
- * destroyed. The caller should copy important information out of
- * these variables before calling this method.
- * NB: Content in fAttributes is valid only till the state of the parser is XMLEvent.START_ELEMENT
- *
- * @return True if element is empty. (i.e. It matches
- * production [44].
- */
- // fElementQName will have the details of element just read..
- // fAttributes will have the details of all the attributes.
- protected boolean scanStartElement()
- throws IOException, XNIException {
-
- if (DEBUG_START_END_ELEMENT) System.out.println( this.getClass().toString() + ">>> scanStartElement()");
- //when skipping is true and no more elements should be added
- if(fSkip && !fAdd){
- //get the stored element -- if everything goes right this should match the
- //token in the buffer
-
- QName name = fElementStack.getNext();
-
- if(DEBUG_SKIP_ALGORITHM){
- System.out.println("Trying to skip String = " + name.rawname);
- }
-
- //Be conservative -- if skipping fails -- stop.
- fSkip = fEntityScanner.skipString(name.rawname);
-
- if(fSkip){
- if(DEBUG_SKIP_ALGORITHM){
- System.out.println("Element SUCESSFULLY skipped = " + name.rawname);
- }
- fElementStack.push();
- fElementQName = name;
- }else{
- //if skipping fails reposition the stack or fallback to normal way of processing
- fElementStack.reposition();
- if(DEBUG_SKIP_ALGORITHM){
- System.out.println("Element was NOT skipped, REPOSITIONING stack" );
- }
- }
- }
-
- //we are still at the stage of adding elements
- //the elements were not matched or
- //fSkip is not set to true
- if(!fSkip || fAdd){
- //get the next element from the stack
- fElementQName = fElementStack.nextElement();
- // name
- if (fNamespaces) {
- fEntityScanner.scanQName(fElementQName, NameType.ELEMENTSTART);
- } else {
- String name = fEntityScanner.scanName(NameType.ELEMENTSTART);
- fElementQName.setValues(null, name, name, null);
- }
-
- if(DEBUG)System.out.println("Element scanned in start element is " + fElementQName.toString());
- if(DEBUG_SKIP_ALGORITHM){
- if(fAdd){
- System.out.println("Elements are being ADDED -- elemet added is = " + fElementQName.rawname + " at count = " + fElementStack.fCount);
- }
- }
-
- }
-
- //when the elements are being added , we need to check if we are set for skipping the elements
- if(fAdd){
- //this sets the value of fAdd variable
- fElementStack.matchElement(fElementQName);
- }
-
-
- //xxx: We dont need another pointer, fCurrentElement, we can use fElementQName
- fCurrentElement = fElementQName;
-
- String rawname = fElementQName.rawname;
-
- fEmptyElement = false;
-
- fAttributes.removeAllAttributes();
-
- checkDepth(rawname);
- if(!seekCloseOfStartTag()){
- fReadingAttributes = true;
- fAttributeCacheUsedCount =0;
- fStringBufferIndex =0;
- fAddDefaultAttr = true;
- do {
- scanAttribute(fAttributes);
- if (fSecurityManager != null && !fSecurityManager.isNoLimit(fElementAttributeLimit) &&
- fAttributes.getLength() > fElementAttributeLimit){
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "ElementAttributeLimit",
- new Object[]{rawname, fElementAttributeLimit },
- XMLErrorReporter.SEVERITY_FATAL_ERROR );
- }
-
- } while (!seekCloseOfStartTag());
- fReadingAttributes=false;
- }
-
- if (fEmptyElement) {
- //decrease the markup depth..
- fMarkupDepth--;
-
- // check that this element was opened in the same entity
- if (fMarkupDepth < fEntityStack[fEntityDepth - 1]) {
- reportFatalError("ElementEntityMismatch",
- new Object[]{fCurrentElement.rawname});
- }
- // call handler
- if (fDocumentHandler != null) {
- fDocumentHandler.emptyElement(fElementQName, fAttributes, null);
- }
-
- //We should not be popping out the context here in endELement becaause the namespace context is still
- //valid when parser is at the endElement state.
- //if (fNamespaces) {
- // fNamespaceContext.popContext();
- //}
-
- //pop the element off the stack..
- fElementStack.popElement();
-
- } else {
-
- if(dtdGrammarUtil != null)
- dtdGrammarUtil.startElement(fElementQName, fAttributes);
- if(fDocumentHandler != null){
- //complete element and attributes are traversed in this function so we can send a callback
- //here.
- //<strong>we shouldn't be sending callback in scanDocument()</strong>
- fDocumentHandler.startElement(fElementQName, fAttributes, null);
- }
- }
-
-
- if (DEBUG_START_END_ELEMENT) System.out.println(this.getClass().toString() + "<<< scanStartElement(): "+fEmptyElement);
- return fEmptyElement;
-
- } // scanStartElement():boolean
-
- /**
- * Looks for the close of start tag, i.e. if it finds '>' or '/>'
- * Characters are consumed.
- */
- protected boolean seekCloseOfStartTag() throws IOException, XNIException {
- // spaces
- boolean sawSpace = fEntityScanner.skipSpaces();
-
- // end tag?
- final int c = fEntityScanner.peekChar();
- if (c == '>') {
- fEntityScanner.scanChar(null);
- return true;
- } else if (c == '/') {
- fEntityScanner.scanChar(null);
- if (!fEntityScanner.skipChar('>', NameType.ELEMENTEND)) {
- reportFatalError("ElementUnterminated",
- new Object[]{fElementQName.rawname});
- }
- fEmptyElement = true;
- return true;
- } else if (!isValidNameStartChar(c) || !sawSpace) {
- // Second chance. Check if this character is a high
- // surrogate of a valid name start character.
- if (!isValidNameStartHighSurrogate(c) || !sawSpace) {
- reportFatalError("ElementUnterminated",
- new Object[]{fElementQName.rawname});
- }
- }
-
- return false;
- }
-
- public boolean hasAttributes(){
- return fAttributes.getLength() > 0 ? true : false ;
- }
-
-
- /**
- * Scans an attribute.
- * <p>
- * <pre>
- * [41] Attribute ::= Name Eq AttValue
- * </pre>
- * <p>
- * <strong>Note:</strong> This method assumes that the next
- * character on the stream is the first character of the attribute
- * name.
- * <p>
- * <strong>Note:</strong> This method uses the fAttributeQName and
- * fQName variables. The contents of these variables will be
- * destroyed.
- *
- * @param attributes The attributes list for the scanned attribute.
- */
-
- /**
- * protected void scanAttribute(AttributeIteratorImpl attributes)
- * throws IOException, XNIException {
- * if (DEBUG_START_END_ELEMENT) System.out.println(">>> scanAttribute()");
- *
- *
- * // name
- * if (fNamespaces) {
- * fEntityScanner.scanQName(fAttributeQName);
- * }
- * else {
- * String name = fEntityScanner.scanName();
- * fAttributeQName.setValues(null, name, name, null);
- * }
- *
- * // equals
- * fEntityScanner.skipSpaces();
- * if (!fEntityScanner.skipChar('=')) {
- * reportFatalError("EqRequiredInAttribute",
- * new Object[]{fAttributeQName.rawname});
- * }
- * fEntityScanner.skipSpaces();
- *
- *
- * // content
- * int oldLen = attributes.getLength();
- */
- /**xxx there is one check of duplicate attribute that has been removed.
- * attributes.addAttribute(fAttributeQName, XMLSymbols.fCDATASymbol, null);
- *
- * // WFC: Unique Att Spec
- * if (oldLen == attributes.getLength()) {
- * reportFatalError("AttributeNotUnique",
- * new Object[]{fCurrentElement.rawname,
- * fAttributeQName.rawname});
- * }
- */
-
- /*
- //REVISIT: one more case needs to be included: external PE and standalone is no
- boolean isVC = fHasExternalDTD && !fStandalone;
- scanAttributeValue(fTempString, fTempString2,
- fAttributeQName.rawname, attributes,
- oldLen, isVC);
-
- //attributes.setValue(oldLen, fTempString.toString());
- //attributes.setNonNormalizedValue(oldLen, fTempString2.toString());
- //attributes.setSpecified(oldLen, true);
-
- AttributeImpl attribute = new AttributeImpl(fAttributeQName.prefix,fAttributeQName.localpart,fAttributeQName.uri,fTempString.toString(),fTempString2.toString(),XMLSymbols.fCDATASymbol,true);
- fAttributes.addAttribute(attribute);
- if (DEBUG_START_END_ELEMENT) System.out.println("<<< scanAttribute()");
- } // scanAttribute(XMLAttributes)
-
- */
-
- /** return the attribute iterator implementation */
- public XMLAttributesIteratorImpl getAttributeIterator(){
- if(dtdGrammarUtil != null && fAddDefaultAttr){
- dtdGrammarUtil.addDTDDefaultAttrs(fElementQName,fAttributes);
- fAddDefaultAttr = false;
- }
- return fAttributes;
- }
-
- /** return if standalone is set */
- public boolean standaloneSet(){
- return fStandaloneSet;
- }
- /** return if the doucment is standalone */
- public boolean isStandAlone(){
- return fStandalone ;
- }
- /**
- * Scans an attribute name value pair.
- * <p>
- * <pre>
- * [41] Attribute ::= Name Eq AttValue
- * </pre>
- * <p>
- * <strong>Note:</strong> This method assumes that the next
- * character on the stream is the first character of the attribute
- * name.
- * <p>
- * <strong>Note:</strong> This method uses the fAttributeQName and
- * fQName variables. The contents of these variables will be
- * destroyed.
- *
- * @param attributes The attributes list for the scanned attribute.
- */
-
- protected void scanAttribute(XMLAttributes attributes)
- throws IOException, XNIException {
- if (DEBUG_START_END_ELEMENT) System.out.println(this.getClass().toString() +">>> scanAttribute()");
-
- // name
- if (fNamespaces) {
- fEntityScanner.scanQName(fAttributeQName, NameType.ATTRIBUTENAME);
- } else {
- String name = fEntityScanner.scanName(NameType.ATTRIBUTENAME);
- fAttributeQName.setValues(null, name, name, null);
- }
-
- // equals
- fEntityScanner.skipSpaces();
- if (!fEntityScanner.skipChar('=', NameType.ATTRIBUTE)) {
- reportFatalError("EqRequiredInAttribute",
- new Object[] {fCurrentElement.rawname, fAttributeQName.rawname});
- }
- fEntityScanner.skipSpaces();
-
- int attIndex = 0 ;
- //REVISIT: one more case needs to be included: external PE and standalone is no
- boolean isVC = fHasExternalDTD && !fStandalone;
- //fTempString would store attribute value
- ///fTempString2 would store attribute non-normalized value
-
- //this function doesn't use 'attIndex'. We are adding the attribute later
- //after we have figured out that current attribute is not namespace declaration
- //since scanAttributeValue doesn't use attIndex parameter therefore we
- //can safely add the attribute later..
- XMLString tmpStr = getString();
-
- scanAttributeValue(tmpStr, fTempString2, fAttributeQName.rawname, attributes,
- attIndex, isVC, fCurrentElement.rawname, false);
-
- // content
- int oldLen = attributes.getLength();
- //if the attribute name already exists.. new value is replaced with old value
- attIndex = attributes.addAttribute(fAttributeQName, XMLSymbols.fCDATASymbol, null);
-
- // WFC: Unique Att Spec
- //attributes count will be same if the current attribute name already exists for this element name.
- //this means there are two duplicate attributes.
- if (oldLen == attributes.getLength()) {
- reportFatalError("AttributeNotUnique",
- new Object[]{fCurrentElement.rawname,
- fAttributeQName.rawname});
- }
-
- //tmpString contains attribute value
- //we are passing null as the attribute value
- attributes.setValue(attIndex, null, tmpStr);
-
- ///xxx: nonNormalizedValue is not being set as it is not required by SAX & DOM
- //attributes.setNonNormalizedValue(oldLen, fTempString2.toString());
- attributes.setSpecified(attIndex, true);
-
- if (DEBUG_START_END_ELEMENT) System.out.println(this.getClass().toString() +"<<< scanAttribute()");
-
- } // scanAttribute(XMLAttributes)
-
- /**
- * Scans element content.
- *
- * @return Returns the next character on the stream.
- */
- //CHANGED:
- //EARLIER: scanContent()
- //NOW: scanContent(XMLStringBuffer)
- //It makes things easy if this functions takes XMLStringBuffer as parameter..
- //this function appends the data to the buffer.
- protected int scanContent(XMLStringBuffer content) throws IOException, XNIException {
- //set the fTempString length to 0 before passing it on to scanContent
- //scanContent sets the correct co-ordinates as per the content read
- fTempString.length = 0;
- int c = fEntityScanner.scanContent(fTempString);
- content.append(fTempString);
- fTempString.length = 0;
- if (c == '\r') {
- // happens when there is the character reference &#13;
- //xxx: We know the next chracter.. we should just skip it and add ']' directlry
- fEntityScanner.scanChar(null);
- content.append((char)c);
- c = -1;
- } else if (c == ']') {
- //fStringBuffer.clear();
- //xxx: We know the next chracter.. we should just skip it and add ']' directlry
- content.append((char)fEntityScanner.scanChar(null));
- // remember where we are in case we get an endEntity before we
- // could flush the buffer out - this happens when we're parsing an
- // entity which ends with a ]
- fInScanContent = true;
- //
- // We work on a single character basis to handle cases such as:
- // ']]]>' which we might otherwise miss.
- //
- if (fEntityScanner.skipChar(']', null)) {
- content.append(']');
- while (fEntityScanner.skipChar(']', null)) {
- content.append(']');
- }
- if (fEntityScanner.skipChar('>', null)) {
- reportFatalError("CDEndInContent", null);
- }
- }
- fInScanContent = false;
- c = -1;
- }
- if (fDocumentHandler != null && content.length > 0) {
- //fDocumentHandler.characters(content, null);
- }
- return c;
-
- } // scanContent():int
-
-
- /**
- * Scans a CDATA section.
- * <p>
- * <strong>Note:</strong> This method uses the fTempString and
- * fStringBuffer variables.
- *
- * @param complete True if the CDATA section is to be scanned
- * completely.
- *
- * @return True if CDATA is completely scanned.
- */
- //CHANGED:
- protected boolean scanCDATASection(XMLStringBuffer contentBuffer, boolean complete)
- throws IOException, XNIException {
-
- // call handler
- if (fDocumentHandler != null) {
- //fDocumentHandler.startCDATA(null);
- }
-
- while (true) {
- //scanData will fill the contentBuffer
- if (!fEntityScanner.scanData("]]>", contentBuffer)) {
- break ;
- /** We dont need all this code if we pass ']]>' as delimeter..
- * int brackets = 2;
- * while (fEntityScanner.skipChar(']')) {
- * brackets++;
- * }
- *
- * //When we find more than 2 square brackets
- * if (fDocumentHandler != null && brackets > 2) {
- * //we dont need to clear the buffer..
- * //contentBuffer.clear();
- * for (int i = 2; i < brackets; i++) {
- * contentBuffer.append(']');
- * }
- * fDocumentHandler.characters(contentBuffer, null);
- * }
- *
- * if (fEntityScanner.skipChar('>')) {
- * break;
- * }
- * if (fDocumentHandler != null) {
- * //we dont need to clear the buffer now..
- * //contentBuffer.clear();
- * contentBuffer.append("]]");
- * fDocumentHandler.characters(contentBuffer, null);
- * }
- **/
- } else {
- int c = fEntityScanner.peekChar();
- if (c != -1 && isInvalidLiteral(c)) {
- if (XMLChar.isHighSurrogate(c)) {
- //contentBuffer.clear();
- //scan surrogates if any....
- scanSurrogates(contentBuffer);
- } else {
- reportFatalError("InvalidCharInCDSect",
- new Object[]{Integer.toString(c,16)});
- fEntityScanner.scanChar(null);
- }
- }
- //by this time we have also read surrogate contents if any...
- if (fDocumentHandler != null) {
- //fDocumentHandler.characters(contentBuffer, null);
- }
- }
- }
- fMarkupDepth--;
-
- if (fDocumentHandler != null && contentBuffer.length > 0) {
- //fDocumentHandler.characters(contentBuffer, null);
- }
-
- // call handler
- if (fDocumentHandler != null) {
- //fDocumentHandler.endCDATA(null);
- }
-
- return true;
-
- } // scanCDATASection(XMLStringBuffer, boolean):boolean
-
- /**
- * Scans an end element.
- * <p>
- * <pre>
- * [42] ETag ::= '&lt;/' Name S? '>'
- * </pre>
- * <p>
- * <strong>Note:</strong> This method uses the fElementQName variable.
- * The contents of this variable will be destroyed. The caller should
- * copy the needed information out of this variable before calling
- * this method.
- *
- * @return The element depth.
- */
- protected int scanEndElement() throws IOException, XNIException {
- if (DEBUG_START_END_ELEMENT) System.out.println(this.getClass().toString() +">>> scanEndElement()");
-
- // pop context
- QName endElementName = fElementStack.popElement();
-
- String rawname = endElementName.rawname;
- if(DEBUG)System.out.println("endElementName = " + endElementName.toString());
- // Take advantage of the fact that next string _should_ be "fElementQName.rawName",
- //In scanners most of the time is consumed on checks done for XML characters, we can
- // optimize on it and avoid the checks done for endElement,
- //we will also avoid symbol table lookup - neeraj.bajaj@sun.com
-
- // this should work both for namespace processing true or false...
-
- //REVISIT: if the string is not the same as expected.. we need to do better error handling..
- //We can skip this for now... In any case if the string doesn't match -- document is not well formed.
-
- if (!fEntityScanner.skipString(endElementName.rawname)) {
- reportFatalError("ETagRequired", new Object[]{rawname});
- }
-
- // end
- fEntityScanner.skipSpaces();
- if (!fEntityScanner.skipChar('>', NameType.ELEMENTEND)) {
- reportFatalError("ETagUnterminated",
- new Object[]{rawname});
- }
- fMarkupDepth--;
-
- //we have increased the depth for two markup "<" characters
- fMarkupDepth--;
-
- // check that this element was opened in the same entity
- if (fMarkupDepth < fEntityStack[fEntityDepth - 1]) {
- reportFatalError("ElementEntityMismatch",
- new Object[]{rawname});
- }
-
- //We should not be popping out the context here in endELement becaause the namespace context is still
- //valid when parser is at the endElement state.
-
- //if (fNamespaces) {
- // fNamespaceContext.popContext();
- //}
-
- // call handler
- if (fDocumentHandler != null ) {
- //end element is scanned in this function so we can send a callback
- //here.
- //<strong>we shouldn't be sending callback in scanDocument()</strong>
-
- fDocumentHandler.endElement(endElementName, null);
- }
- if(dtdGrammarUtil != null)
- dtdGrammarUtil.endElement(endElementName);
-
- return fMarkupDepth;
-
- } // scanEndElement():int
-
- /**
- * Scans a character reference.
- * <p>
- * <pre>
- * [66] CharRef ::= '&#' [0-9]+ ';' | '&#x' [0-9a-fA-F]+ ';'
- * </pre>
- */
- protected void scanCharReference()
- throws IOException, XNIException {
-
- fStringBuffer2.clear();
- int ch = scanCharReferenceValue(fStringBuffer2, null);
- fMarkupDepth--;
- if (ch != -1) {
- // call handler
-
- if (fDocumentHandler != null) {
- if (fNotifyCharRefs) {
- fDocumentHandler.startGeneralEntity(fCharRefLiteral, null, null, null);
- }
- Augmentations augs = null;
- if (fValidation && ch <= 0x20) {
- if (fTempAugmentations != null) {
- fTempAugmentations.removeAllItems();
- }
- else {
- fTempAugmentations = new AugmentationsImpl();
- }
- augs = fTempAugmentations;
- augs.putItem(Constants.CHAR_REF_PROBABLE_WS, Boolean.TRUE);
- }
- //xxx: How do we deal with this - how to return charReferenceValues
- //now this is being commented because this is taken care in scanDocument()
- //fDocumentHandler.characters(fStringBuffer2, null);
- if (fNotifyCharRefs) {
- fDocumentHandler.endGeneralEntity(fCharRefLiteral, null);
- }
- }
- }
-
- } // scanCharReference()
-
-
- /**
- * Scans an entity reference.
- *
- * @return returns true if the new entity is started. If it was built-in entity
- * 'false' is returned.
- * @throws IOException Thrown if i/o error occurs.
- * @throws XNIException Thrown if handler throws exception upon
- * notification.
- */
- protected void scanEntityReference(XMLStringBuffer content) throws IOException, XNIException {
- String name = fEntityScanner.scanName(NameType.REFERENCE);
- if (name == null) {
- reportFatalError("NameRequiredInReference", null);
- return;
- }
- if (!fEntityScanner.skipChar(';', NameType.REFERENCE)) {
- reportFatalError("SemicolonRequiredInReference", new Object []{name});
- }
- if (fEntityStore.isUnparsedEntity(name)) {
- reportFatalError("ReferenceToUnparsedEntity", new Object[]{name});
- }
- fMarkupDepth--;
- fCurrentEntityName = name;
-
- // handle built-in entities
- if (name == fAmpSymbol) {
- handleCharacter('&', fAmpSymbol, content);
- fScannerState = SCANNER_STATE_BUILT_IN_REFS;
- return ;
- } else if (name == fLtSymbol) {
- handleCharacter('<', fLtSymbol, content);
- fScannerState = SCANNER_STATE_BUILT_IN_REFS;
- return ;
- } else if (name == fGtSymbol) {
- handleCharacter('>', fGtSymbol, content);
- fScannerState = SCANNER_STATE_BUILT_IN_REFS;
- return ;
- } else if (name == fQuotSymbol) {
- handleCharacter('"', fQuotSymbol, content);
- fScannerState = SCANNER_STATE_BUILT_IN_REFS;
- return ;
- } else if (name == fAposSymbol) {
- handleCharacter('\'', fAposSymbol, content);
- fScannerState = SCANNER_STATE_BUILT_IN_REFS;
- return ;
- }
-
- //1. if the entity is external and support to external entities is not required
- // 2. or entities should not be replaced
- //3. or if it is built in entity reference.
- boolean isEE = fEntityStore.isExternalEntity(name);
- if((isEE && !fSupportExternalEntities) || (!isEE && !fReplaceEntityReferences) || foundBuiltInRefs){
- fScannerState = SCANNER_STATE_REFERENCE;
- return ;
- }
- // start general entity
- if (!fEntityStore.isDeclaredEntity(name)) {
- //SUPPORT_DTD=false && ReplaceEntityReferences should throw exception
- if (!fSupportDTD && fReplaceEntityReferences) {
- reportFatalError("EntityNotDeclared", new Object[]{name});
- return;
- }
- //REVISIT: one more case needs to be included: external PE and standalone is no
- if ( fHasExternalDTD && !fStandalone) {
- if (fValidation)
- fErrorReporter.reportError(fEntityScanner, XMLMessageFormatter.XML_DOMAIN,"EntityNotDeclared",
- new Object[]{name}, XMLErrorReporter.SEVERITY_ERROR);
- } else
- reportFatalError("EntityNotDeclared", new Object[]{name});
- }
- //we are starting the entity even if the entity was not declared
- //if that was the case it its taken care in XMLEntityManager.startEntity()
- //we immediately call the endEntity. Application gets to know if there was
- //any entity that was not declared.
- fEntityManager.startEntity(true, name, false);
- //set the scaner state to content.. parser will automatically revive itself at any point of time.
- //setScannerState(SCANNER_STATE_CONTENT);
- //return true ;
- } // scanEntityReference()
-
- // utility methods
-
- /**
- * Check if the depth exceeds the maxElementDepth limit
- * @param elementName name of the current element
- */
- void checkDepth(String elementName) {
- fLimitAnalyzer.addValue(Limit.MAX_ELEMENT_DEPTH_LIMIT, elementName, fElementStack.fDepth);
- if (fSecurityManager.isOverLimit(Limit.MAX_ELEMENT_DEPTH_LIMIT,fLimitAnalyzer)) {
- fSecurityManager.debugPrint(fLimitAnalyzer);
- reportFatalError("MaxElementDepthLimit", new Object[]{elementName,
- fLimitAnalyzer.getTotalValue(Limit.MAX_ELEMENT_DEPTH_LIMIT),
- fSecurityManager.getLimit(Limit.MAX_ELEMENT_DEPTH_LIMIT),
- "maxElementDepth"});
- }
- }
-
- /**
- * Calls document handler with a single character resulting from
- * built-in entity resolution.
- *
- * @param c
- * @param entity built-in name
- * @param XMLStringBuffer append the character to buffer
- *
- * we really dont need to call this function -- this function is only required when
- * we integrate with rest of Xerces2. SO maintaining the current behavior and still
- * calling this function to hanlde built-in entity reference.
- *
- */
- private void handleCharacter(char c, String entity, XMLStringBuffer content) throws XNIException {
- foundBuiltInRefs = true;
- checkEntityLimit(false, fEntityScanner.fCurrentEntity.name, 1);
- content.append(c);
- if (fDocumentHandler != null) {
- fSingleChar[0] = c;
- if (fNotifyBuiltInRefs) {
- fDocumentHandler.startGeneralEntity(entity, null, null, null);
- }
- fTempString.setValues(fSingleChar, 0, 1);
- //fDocumentHandler.characters(fTempString, null);
-
- if (fNotifyBuiltInRefs) {
- fDocumentHandler.endGeneralEntity(entity, null);
- }
- }
- } // handleCharacter(char)
-
- // helper methods
-
- /**
- * Sets the scanner state.
- *
- * @param state The new scanner state.
- */
- protected final void setScannerState(int state) {
-
- fScannerState = state;
- if (DEBUG_SCANNER_STATE) {
- System.out.print("### setScannerState: ");
- //System.out.print(fScannerState);
- System.out.print(getScannerStateName(state));
- System.out.println();
- }
-
- } // setScannerState(int)
-
-
- /**
- * Sets the Driver.
- *
- * @param Driver The new Driver.
- */
- protected final void setDriver(Driver driver) {
- fDriver = driver;
- if (DEBUG_DISPATCHER) {
- System.out.print("%%% setDriver: ");
- System.out.print(getDriverName(driver));
- System.out.println();
- }
- }
-
- //
- // Private methods
- //
-
- /** Returns the scanner state name. */
- protected String getScannerStateName(int state) {
-
- switch (state) {
- case SCANNER_STATE_DOCTYPE: return "SCANNER_STATE_DOCTYPE";
- case SCANNER_STATE_ROOT_ELEMENT: return "SCANNER_STATE_ROOT_ELEMENT";
- case SCANNER_STATE_START_OF_MARKUP: return "SCANNER_STATE_START_OF_MARKUP";
- case SCANNER_STATE_COMMENT: return "SCANNER_STATE_COMMENT";
- case SCANNER_STATE_PI: return "SCANNER_STATE_PI";
- case SCANNER_STATE_CONTENT: return "SCANNER_STATE_CONTENT";
- case SCANNER_STATE_REFERENCE: return "SCANNER_STATE_REFERENCE";
- case SCANNER_STATE_END_OF_INPUT: return "SCANNER_STATE_END_OF_INPUT";
- case SCANNER_STATE_TERMINATED: return "SCANNER_STATE_TERMINATED";
- case SCANNER_STATE_CDATA: return "SCANNER_STATE_CDATA";
- case SCANNER_STATE_TEXT_DECL: return "SCANNER_STATE_TEXT_DECL";
- case SCANNER_STATE_ATTRIBUTE: return "SCANNER_STATE_ATTRIBUTE";
- case SCANNER_STATE_ATTRIBUTE_VALUE: return "SCANNER_STATE_ATTRIBUTE_VALUE";
- case SCANNER_STATE_START_ELEMENT_TAG: return "SCANNER_STATE_START_ELEMENT_TAG";
- case SCANNER_STATE_END_ELEMENT_TAG: return "SCANNER_STATE_END_ELEMENT_TAG";
- case SCANNER_STATE_CHARACTER_DATA: return "SCANNER_STATE_CHARACTER_DATA" ;
- }
-
- return "??? ("+state+')';
-
- } // getScannerStateName(int):String
- public String getEntityName(){
- //return the cached name
- return fCurrentEntityName;
- }
-
- /** Returns the driver name. */
- public String getDriverName(Driver driver) {
-
- if (DEBUG_DISPATCHER) {
- if (driver != null) {
- String name = driver.getClass().getName();
- int index = name.lastIndexOf('.');
- if (index != -1) {
- name = name.substring(index + 1);
- index = name.lastIndexOf('$');
- if (index != -1) {
- name = name.substring(index + 1);
- }
- }
- return name;
- }
- }
- return "null";
-
- } // getDriverName():String
-
- /**
- * Check the protocol used in the systemId against allowed protocols
- *
- * @param systemId the Id of the URI
- * @param allowedProtocols a list of allowed protocols separated by comma
- * @return the name of the protocol if rejected, null otherwise
- */
- String checkAccess(String systemId, String allowedProtocols) throws IOException {
- String baseSystemId = fEntityScanner.getBaseSystemId();
- String expandedSystemId = XMLEntityManager.expandSystemId(systemId, baseSystemId, fStrictURI);
- return SecuritySupport.checkAccess(expandedSystemId, allowedProtocols, Constants.ACCESS_EXTERNAL_ALL);
- }
-
- //
- // Classes
- //
-
- /**
- * @author Neeraj Bajaj, Sun Microsystems.
- */
- protected static final class Element {
-
- //
- // Data
- //
-
- /** Symbol. */
- public QName qname;
-
- //raw name stored as characters
- public char[] fRawname;
-
- /** The next Element entry. */
- public Element next;
-
- //
- // Constructors
- //
-
- /**
- * Constructs a new Element from the given QName and next Element
- * reference.
- */
- public Element(QName qname, Element next) {
- this.qname.setValues(qname);
- this.fRawname = qname.rawname.toCharArray();
- this.next = next;
- }
-
- } // class Element
-
- /**
- * Element stack.
- *
- * @author Neeraj Bajaj, Sun Microsystems.
- */
- protected class ElementStack2 {
-
- //
- // Data
- //
-
- /** The stack data. */
- protected QName [] fQName = new QName[20];
-
- //Element depth
- protected int fDepth;
- //total number of elements
- protected int fCount;
- //current position
- protected int fPosition;
- //Mark refers to the position
- protected int fMark;
-
- protected int fLastDepth ;
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- public ElementStack2() {
- for (int i = 0; i < fQName.length; i++) {
- fQName[i] = new QName();
- }
- fMark = fPosition = 1;
- } // <init>()
-
- public void resize(){
- /**
- * int length = fElements.length;
- * Element [] temp = new Element[length * 2];
- * System.arraycopy(fElements, 0, temp, 0, length);
- * fElements = temp;
- */
- //resize QNames
- int oldLength = fQName.length;
- QName [] tmp = new QName[oldLength * 2];
- System.arraycopy(fQName, 0, tmp, 0, oldLength);
- fQName = tmp;
-
- for (int i = oldLength; i < fQName.length; i++) {
- fQName[i] = new QName();
- }
-
- }
-
-
- //
- // Public methods
- //
-
- /** Check if the element scanned during the start element
- *matches the stored element.
- *
- *@return true if the match suceeds.
- */
- public boolean matchElement(QName element) {
- //last depth is the depth when last elemnt was pushed
- //if last depth is greater than current depth
- if(DEBUG_SKIP_ALGORITHM){
- System.out.println("fLastDepth = " + fLastDepth);
- System.out.println("fDepth = " + fDepth);
- }
- boolean match = false;
- if(fLastDepth > fDepth && fDepth <= 2){
- if(DEBUG_SKIP_ALGORITHM){
- System.out.println("Checking if the elements match " + element.rawname + " , " + fQName[fDepth].rawname);
- }
- if(element.rawname == fQName[fDepth].rawname){
- fAdd = false;
- //mark this position
- //decrease the depth by 1 as arrays are 0 based
- fMark = fDepth - 1;
- //we found the match and from next element skipping will start, add 1
- fPosition = fMark + 1 ;
- match = true;
- //Once we get match decrease the count -- this was increased by nextElement()
- --fCount;
- if(DEBUG_SKIP_ALGORITHM){
- System.out.println("fAdd FALSE -- NOW ELEMENT SHOULD NOT BE ADDED");
- System.out.println("fMark = " + fMark);
- System.out.println("fPosition = " + fPosition);
- System.out.println("fDepth = " + fDepth);
- System.out.println("fCount = " + fCount);
- }
- }else{
- fAdd = true;
- if(DEBUG_SKIP_ALGORITHM)System.out.println("fAdd is " + fAdd);
- }
- }
- //store the last depth
- fLastDepth = fDepth++;
- return match;
- } // pushElement(QName):QName
-
- /**
- * This function doesn't increase depth. The function in this function is
- *broken down into two functions for efficiency. <@see>matchElement</see>.
- * This function just returns the pointer to the object and its values are set.
- *
- *@return QName reference to the next element in the list
- */
- public QName nextElement() {
-
- //if number of elements becomes equal to the length of array -- stop the skipping
- if (fCount == fQName.length) {
- fShouldSkip = false;
- fAdd = false;
- if(DEBUG_SKIP_ALGORITHM)System.out.println("SKIPPING STOPPED, fShouldSkip = " + fShouldSkip);
- //xxx: this is not correct, we are returning the last element
- //this wont make any difference since flag has been set to 'false'
- return fQName[--fCount];
- }
- if(DEBUG_SKIP_ALGORITHM){
- System.out.println("fCount = " + fCount);
- }
- return fQName[fCount++];
-
- }
-
- /** Note that this function is considerably different than nextElement()
- * This function just returns the previously stored elements
- */
- public QName getNext(){
- //when position reaches number of elements in the list..
- //set the position back to mark, making it a circular linked list.
- if(fPosition == fCount){
- fPosition = fMark;
- }
- return fQName[fPosition++];
- }
-
- /** returns the current depth
- */
- public int popElement(){
- return fDepth--;
- }
-
-
- /** Clears the stack without throwing away existing QName objects. */
- public void clear() {
- fLastDepth = 0;
- fDepth = 0;
- fCount = 0 ;
- fPosition = fMark = 1;
- } // clear()
-
- } // class ElementStack
-
- /**
- * Element stack. This stack operates without synchronization, error
- * checking, and it re-uses objects instead of throwing popped items
- * away.
- *
- * @author Andy Clark, IBM
- */
- protected class ElementStack {
-
- //
- // Data
- //
-
- /** The stack data. */
- protected QName[] fElements;
- protected int [] fInt = new int[20];
-
-
- //Element depth
- protected int fDepth;
- //total number of elements
- protected int fCount;
- //current position
- protected int fPosition;
- //Mark refers to the position
- protected int fMark;
-
- protected int fLastDepth ;
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- public ElementStack() {
- fElements = new QName[20];
- for (int i = 0; i < fElements.length; i++) {
- fElements[i] = new QName();
- }
- } // <init>()
-
- //
- // Public methods
- //
-
- /**
- * Pushes an element on the stack.
- * <p>
- * <strong>Note:</strong> The QName values are copied into the
- * stack. In other words, the caller does <em>not</em> orphan
- * the element to the stack. Also, the QName object returned
- * is <em>not</em> orphaned to the caller. It should be
- * considered read-only.
- *
- * @param element The element to push onto the stack.
- *
- * @return Returns the actual QName object that stores the
- */
- //XXX: THIS FUNCTION IS NOT USED
- public QName pushElement(QName element) {
- if (fDepth == fElements.length) {
- QName[] array = new QName[fElements.length * 2];
- System.arraycopy(fElements, 0, array, 0, fDepth);
- fElements = array;
- for (int i = fDepth; i < fElements.length; i++) {
- fElements[i] = new QName();
- }
- }
- fElements[fDepth].setValues(element);
- return fElements[fDepth++];
- } // pushElement(QName):QName
-
-
- /** Note that this function is considerably different than nextElement()
- * This function just returns the previously stored elements
- */
- public QName getNext(){
- //when position reaches number of elements in the list..
- //set the position back to mark, making it a circular linked list.
- if(fPosition == fCount){
- fPosition = fMark;
- }
- //store the position of last opened tag at particular depth
- //fInt[++fDepth] = fPosition;
- if(DEBUG_SKIP_ALGORITHM){
- System.out.println("Element at fPosition = " + fPosition + " is " + fElements[fPosition].rawname);
- }
- //return fElements[fPosition++];
- return fElements[fPosition];
- }
-
- /** This function should be called only when element was skipped sucessfully.
- * 1. Increase the depth - because element was sucessfully skipped.
- *2. Store the position of the element token in array "last opened tag" at depth.
- *3. increase the position counter so as to point to the next element in the array
- */
- public void push(){
-
- fInt[++fDepth] = fPosition++;
- }
-
- /** Check if the element scanned during the start element
- *matches the stored element.
- *
- *@return true if the match suceeds.
- */
- public boolean matchElement(QName element) {
- //last depth is the depth when last elemnt was pushed
- //if last depth is greater than current depth
- //if(DEBUG_SKIP_ALGORITHM){
- // System.out.println("Check if the element " + element.rawname + " matches");
- // System.out.println("fLastDepth = " + fLastDepth);
- // System.out.println("fDepth = " + fDepth);
- //}
- boolean match = false;
- if(fLastDepth > fDepth && fDepth <= 3){
- if(DEBUG_SKIP_ALGORITHM){
- System.out.println("----------ENTERED THE LOOP WHERE WE CHECK FOR MATCHING OF ELMENT-----");
- System.out.println("Depth = " + fDepth + " Checking if INCOMING element " + element.rawname + " match STORED ELEMENT " + fElements[fDepth - 1].rawname);
- }
- if(element.rawname == fElements[fDepth - 1].rawname){
- fAdd = false;
- //mark this position
- //decrease the depth by 1 as arrays are 0 based
- fMark = fDepth - 1;
- //we found the match
- fPosition = fMark;
- match = true;
- //Once we get match decrease the count -- this was increased by nextElement()
- --fCount;
- if(DEBUG_SKIP_ALGORITHM){
- System.out.println("NOW ELEMENT SHOULD NOT BE ADDED, fAdd is set to false");
- System.out.println("fMark = " + fMark);
- System.out.println("fPosition = " + fPosition);
- System.out.println("fDepth = " + fDepth);
- System.out.println("fCount = " + fCount);
- System.out.println("---------MATCH SUCEEDED-----------------");
- System.out.println("");
- }
- }else{
- fAdd = true;
- if(DEBUG_SKIP_ALGORITHM)System.out.println("fAdd is " + fAdd);
- }
- }
- //store the position for the current depth
- //when we are adding the elements, when skipping
- //starts even then this should be tracked ie. when
- //calling getNext()
- if(match){
- //from next element skipping will start, add 1
- fInt[fDepth] = fPosition++;
- } else{
- if(DEBUG_SKIP_ALGORITHM){
- System.out.println("At depth = " + fDepth + "array position is = " + (fCount - 1));
- }
- //sicne fInt[fDepth] contains pointer to the element array which are 0 based.
- fInt[fDepth] = fCount - 1;
- }
-
- //if number of elements becomes equal to the length of array -- stop the skipping
- //xxx: should we do "fCount == fInt.length"
- if (fCount == fElements.length) {
- fSkip = false;
- fAdd = false;
- //reposition the stack -- it seems to be too complex document and there is no symmerty in structure
- reposition();
- if(DEBUG_SKIP_ALGORITHM){
- System.out.println("ALL THE ELMENTS IN ARRAY HAVE BEEN FILLED");
- System.out.println("REPOSITIONING THE STACK");
- System.out.println("-----------SKIPPING STOPPED----------");
- System.out.println("");
- }
- return false;
- }
- if(DEBUG_SKIP_ALGORITHM){
- if(match){
- System.out.println("Storing fPosition = " + fInt[fDepth] + " at fDepth = " + fDepth);
- }else{
- System.out.println("Storing fCount = " + fInt[fDepth] + " at fDepth = " + fDepth);
- }
- }
- //store the last depth
- fLastDepth = fDepth;
- return match;
- } // matchElement(QName):QName
-
-
- /**
- * Returns the next element on the stack.
- *
- * @return Returns the actual QName object. Callee should
- * use this object to store the details of next element encountered.
- */
- public QName nextElement() {
- if(fSkip){
- fDepth++;
- //boundary checks are done in matchElement()
- return fElements[fCount++];
- } else if (fDepth == fElements.length) {
- QName[] array = new QName[fElements.length * 2];
- System.arraycopy(fElements, 0, array, 0, fDepth);
- fElements = array;
- for (int i = fDepth; i < fElements.length; i++) {
- fElements[i] = new QName();
- }
- }
-
- return fElements[fDepth++];
-
- } // pushElement(QName):QName
-
-
- /**
- * Pops an element off of the stack by setting the values of
- * the specified QName.
- * <p>
- * <strong>Note:</strong> The object returned is <em>not</em>
- * orphaned to the caller. Therefore, the caller should consider
- * the object to be read-only.
- */
- public QName popElement() {
- //return the same object that was pushed -- this would avoid
- //setting the values for every end element.
- //STRONG: this object is read only -- this object reference shouldn't be stored.
- if(fSkip || fAdd ){
- if(DEBUG_SKIP_ALGORITHM){
- System.out.println("POPPING Element, at position " + fInt[fDepth] + " element at that count is = " + fElements[fInt[fDepth]].rawname);
- System.out.println("");
- }
- return fElements[fInt[fDepth--]];
- } else{
- if(DEBUG_SKIP_ALGORITHM){
- System.out.println("Retrieveing element at depth = " + fDepth + " is " + fElements[fDepth].rawname );
- }
- return fElements[--fDepth] ;
- }
- //element.setValues(fElements[--fDepth]);
- } // popElement(QName)
-
- /** Reposition the stack. fInt [] contains all the opened tags at particular depth.
- * Transfer all the opened tags starting from depth '2' to the current depth and reposition them
- *as per the depth.
- */
- public void reposition(){
- for( int i = 2 ; i <= fDepth ; i++){
- fElements[i-1] = fElements[fInt[i]];
- }
- if(DEBUG_SKIP_ALGORITHM){
- for( int i = 0 ; i < fDepth ; i++){
- System.out.println("fElements[" + i + "]" + " = " + fElements[i].rawname);
- }
- }
- }
-
- /** Clears the stack without throwing away existing QName objects. */
- public void clear() {
- fDepth = 0;
- fLastDepth = 0;
- fCount = 0 ;
- fPosition = fMark = 1;
-
- } // clear()
-
- /**
- * This function is as a result of optimization done for endElement --
- * we dont need to set the value for every end element encouterd.
- * For Well formedness checks we can have the same QName object that was pushed.
- * the values will be set only if application need to know about the endElement
- * -- neeraj.bajaj@sun.com
- */
-
- public QName getLastPoppedElement(){
- return fElements[fDepth];
- }
- } // class ElementStack
-
- /**
- * Drives the parser to the next state/event on the input. Parser is guaranteed
- * to stop at the next state/event.
- *
- * Internally XML document is divided into several states. Each state represents
- * a sections of XML document. When this functions returns normally, it has read
- * the section of XML document and returns the state corresponding to section of
- * document which has been read. For optimizations, a particular driver
- * can read ahead of the section of document (state returned) just read and
- * can maintain a different internal state.
- *
- *
- * @author Neeraj Bajaj, Sun Microsystems
- */
- protected interface Driver {
-
-
- /**
- * Drives the parser to the next state/event on the input. Parser is guaranteed
- * to stop at the next state/event.
- *
- * Internally XML document is divided into several states. Each state represents
- * a sections of XML document. When this functions returns normally, it has read
- * the section of XML document and returns the state corresponding to section of
- * document which has been read. For optimizations, a particular driver
- * can read ahead of the section of document (state returned) just read and
- * can maintain a different internal state.
- *
- * @return state representing the section of document just read.
- *
- * @throws IOException Thrown on i/o error.
- * @throws XNIException Thrown on parse error.
- */
-
- public int next() throws IOException, XNIException;
-
- } // interface Driver
-
- /**
- * Driver to handle content scanning. This driver is capable of reading
- * the fragment of XML document. When it has finished reading fragment
- * of XML documents, it can pass the job of reading to another driver.
- *
- * This class has been modified as per the new design which is more suited to
- * efficiently build pull parser. Lot of performance improvements have been done and
- * the code has been added to support stax functionality/features.
- *
- * @author Neeraj Bajaj, Sun Microsystems
- *
- *
- * @author Andy Clark, IBM
- * @author Eric Ye, IBM
- */
- protected class FragmentContentDriver
- implements Driver {
-
- //
- // Driver methods
- //
-
- /**
- * decides the appropriate state of the parser
- */
- private void startOfMarkup() throws IOException {
- fMarkupDepth++;
- final int ch = fEntityScanner.peekChar();
-
- if (isValidNameStartChar(ch) || isValidNameStartHighSurrogate(ch)) {
- setScannerState(SCANNER_STATE_START_ELEMENT_TAG);
- } else {
- switch(ch){
- case '?' :{
- setScannerState(SCANNER_STATE_PI);
- fEntityScanner.skipChar(ch, null);
- break;
- }
- case '!' :{
- fEntityScanner.skipChar(ch, null);
- if (fEntityScanner.skipChar('-', null)) {
- if (!fEntityScanner.skipChar('-', NameType.COMMENT)) {
- reportFatalError("InvalidCommentStart",
- null);
- }
- setScannerState(SCANNER_STATE_COMMENT);
- } else if (fEntityScanner.skipString(cdata)) {
- setScannerState(SCANNER_STATE_CDATA );
- } else if (!scanForDoctypeHook()) {
- reportFatalError("MarkupNotRecognizedInContent",
- null);
- }
- break;
- }
- case '/' :{
- setScannerState(SCANNER_STATE_END_ELEMENT_TAG);
- fEntityScanner.skipChar(ch, NameType.ELEMENTEND);
- break;
- }
- default :{
- reportFatalError("MarkupNotRecognizedInContent", null);
- }
- }
- }
-
- }//startOfMarkup
-
- private void startOfContent() throws IOException {
- if (fEntityScanner.skipChar('<', null)) {
- setScannerState(SCANNER_STATE_START_OF_MARKUP);
- } else if (fEntityScanner.skipChar('&', NameType.REFERENCE)) {
- setScannerState(SCANNER_STATE_REFERENCE) ; //XMLEvent.ENTITY_REFERENCE ); //SCANNER_STATE_REFERENCE
- } else {
- //element content is there..
- setScannerState(SCANNER_STATE_CHARACTER_DATA);
- }
- }//startOfContent
-
-
- /**
- *
- * SCANNER_STATE_CONTENT and SCANNER_STATE_START_OF_MARKUP are two super states of the parser.
- * At any point of time when in doubt over the current state of the parser, the state should be
- * set to SCANNER_STATE_CONTENT. Parser will automatically revive itself and will set state of
- * the parser to one of its sub state.
- * sub states are defined in the parser on the basis of different XML component like
- * SCANNER_STATE_ENTITY_REFERENCE , SCANNER_STATE_START_ELEMENT, SCANNER_STATE_CDATA etc..
- * These sub states help the parser to have fine control over the parsing. These are the
- * different milepost, parser stops at each sub state (milepost). Based on this state it is
- * decided if paresr needs to stop at next milepost ??
- *
- */
- public void decideSubState() throws IOException {
- while( fScannerState == SCANNER_STATE_CONTENT || fScannerState == SCANNER_STATE_START_OF_MARKUP){
-
- switch (fScannerState) {
-
- case SCANNER_STATE_CONTENT: {
- startOfContent() ;
- break;
- }
-
- case SCANNER_STATE_START_OF_MARKUP: {
- startOfMarkup() ;
- break;
- }
- }
- }
- }//decideSubState
-
- /**
- * Drives the parser to the next state/event on the input. Parser is guaranteed
- * to stop at the next state/event. Internally XML document
- * is divided into several states. Each state represents a sections of XML
- * document. When this functions returns normally, it has read the section
- * of XML document and returns the state corresponding to section of
- * document which has been read. For optimizations, a particular driver
- * can read ahead of the section of document (state returned) just read and
- * can maintain a different internal state.
- *
- * State returned corresponds to Stax states.
- *
- * @return state representing the section of document just read.
- *
- * @throws IOException Thrown on i/o error.
- * @throws XNIException Thrown on parse error.
- */
-
- public int next() throws IOException, XNIException {
- while (true) {
- try {
- if(DEBUG_NEXT){
- System.out.println("NOW IN FragmentContentDriver");
- System.out.println("Entering the FragmentContentDriver with = " + getScannerStateName(fScannerState));
- }
-
- //decide the actual sub state of the scanner.For more information refer to the javadoc of
- //decideSubState.
-
- switch (fScannerState) {
- case SCANNER_STATE_CONTENT: {
- final int ch = fEntityScanner.peekChar();
- if (ch == '<') {
- fEntityScanner.scanChar(null);
- setScannerState(SCANNER_STATE_START_OF_MARKUP);
- } else if (ch == '&') {
- fEntityScanner.scanChar(NameType.REFERENCE);
- setScannerState(SCANNER_STATE_REFERENCE) ; //XMLEvent.ENTITY_REFERENCE ); //SCANNER_STATE_REFERENCE
- break;
- } else {
- //element content is there..
- setScannerState(SCANNER_STATE_CHARACTER_DATA);
- break;
- }
- }
-
- case SCANNER_STATE_START_OF_MARKUP: {
- startOfMarkup();
- break;
- }//case: SCANNER_STATE_START_OF_MARKUP
-
- }//end of switch
- //decideSubState() ;
-
- //do some special handling if isCoalesce is set to true.
- if(fIsCoalesce){
- fUsebuffer = true ;
- //if the last section was character data
- if(fLastSectionWasCharacterData){
-
- //if we dont encounter any CDATA or ENITY REFERENCE and current state is also not SCANNER_STATE_CHARACTER_DATA
- //return the last scanned charactrer data.
- if((fScannerState != SCANNER_STATE_CDATA) && (fScannerState != SCANNER_STATE_REFERENCE)
- && (fScannerState != SCANNER_STATE_CHARACTER_DATA)){
- fLastSectionWasCharacterData = false;
- return XMLEvent.CHARACTERS;
- }
- }//if last section was CDATA or ENTITY REFERENCE
- //xxx: there might be another entity reference or CDATA after this
- //<foo>blah blah &amp;&lt;<![CDATA[[aa]]>blah blah</foo>
- else if((fLastSectionWasCData || fLastSectionWasEntityReference)){
- //and current state is not SCANNER_STATE_CHARACTER_DATA
- //or SCANNER_STATE_CDATA or SCANNER_STATE_REFERENCE
- //this means there is nothing more to be coalesced.
- //return the CHARACTERS event.
- if((fScannerState != SCANNER_STATE_CDATA) && (fScannerState != SCANNER_STATE_REFERENCE)
- && (fScannerState != SCANNER_STATE_CHARACTER_DATA)){
-
- fLastSectionWasCData = false;
- fLastSectionWasEntityReference = false;
- return XMLEvent.CHARACTERS;
- }
- }
- }
-
-
- if(DEBUG_NEXT){
- System.out.println("Actual scanner state set by decideSubState is = " + getScannerStateName(fScannerState));
- }
-
- switch(fScannerState){
-
- case XMLEvent.START_DOCUMENT :
- return XMLEvent.START_DOCUMENT;
-
- case SCANNER_STATE_START_ELEMENT_TAG :{
-
- //xxx this function returns true when element is empty.. can be linked to end element event.
- //returns true if the element is empty
- fEmptyElement = scanStartElement() ;
- //if the element is empty the next event is "end element"
- if(fEmptyElement){
- setScannerState(SCANNER_STATE_END_ELEMENT_TAG);
- }else{
- //set the next possible state
- setScannerState(SCANNER_STATE_CONTENT);
- }
- return XMLEvent.START_ELEMENT ;
- }
-
- case SCANNER_STATE_CHARACTER_DATA: {
- if(DEBUG_COALESCE){
- System.out.println("fLastSectionWasCData = " + fLastSectionWasCData);
- System.out.println("fIsCoalesce = " + fIsCoalesce);
- }
- //if last section was either entity reference or cdata or character data we should be using buffer
- fUsebuffer = fLastSectionWasEntityReference || fLastSectionWasCData || fLastSectionWasCharacterData ;
-
- //When coalesce is set to true and last state was REFERENCE or CDATA or CHARACTER_DATA, buffer should not be cleared.
- if( fIsCoalesce && (fLastSectionWasEntityReference || fLastSectionWasCData || fLastSectionWasCharacterData) ){
- fLastSectionWasEntityReference = false;
- fLastSectionWasCData = false;
- fLastSectionWasCharacterData = true ;
- fUsebuffer = true;
- }else{
- //clear the buffer
- fContentBuffer.clear();
- }
-
- //set the fTempString length to 0 before passing it on to scanContent
- //scanContent sets the correct co-ordinates as per the content read
- fTempString.length = 0;
- int c = fEntityScanner.scanContent(fTempString);
- if(DEBUG){
- System.out.println("fTempString = " + fTempString);
- }
- if(fEntityScanner.skipChar('<', null)){
- //check if we have reached end of element
- if(fEntityScanner.skipChar('/', NameType.ELEMENTEND)){
- //increase the mark up depth
- fMarkupDepth++;
- fLastSectionWasCharacterData = false;
- setScannerState(SCANNER_STATE_END_ELEMENT_TAG);
- //check if its start of new element
- }else if(XMLChar.isNameStart(fEntityScanner.peekChar())){
- fMarkupDepth++;
- fLastSectionWasCharacterData = false;
- setScannerState(SCANNER_STATE_START_ELEMENT_TAG);
- }else{
- setScannerState(SCANNER_STATE_START_OF_MARKUP);
- //there can be cdata ahead if coalesce is true we should call again
- if(fIsCoalesce){
- fUsebuffer = true;
- fLastSectionWasCharacterData = true;
- fContentBuffer.append(fTempString);
- fTempString.length = 0;
- continue;
- }
- }
- //in case last section was either entity reference or cdata or character data -- we should be using buffer
- if(fUsebuffer){
- fContentBuffer.append(fTempString);
- fTempString.length = 0;
- }
- if(DEBUG){
- System.out.println("NOT USING THE BUFFER, STRING = " + fTempString.toString());
- }
- if(dtdGrammarUtil!= null && dtdGrammarUtil.isIgnorableWhiteSpace(fContentBuffer)){
- if(DEBUG)System.out.println("Return SPACE EVENT");
- return XMLEvent.SPACE;
- }else
- return XMLEvent.CHARACTERS;
-
- } else{
- fUsebuffer = true ;
- if(DEBUG){
- System.out.println("fContentBuffer = " + fContentBuffer);
- System.out.println("fTempString = " + fTempString);
- }
- fContentBuffer.append(fTempString);
- fTempString.length = 0;
- }
- if (c == '\r') {
- if(DEBUG){
- System.out.println("'\r' character found");
- }
- // happens when there is the character reference &#13;
- //xxx: We know the next chracter.. we should just skip it and add ']' directlry
- fEntityScanner.scanChar(null);
- fUsebuffer = true;
- fContentBuffer.append((char)c);
- c = -1 ;
- } else if (c == ']') {
- //fStringBuffer.clear();
- //xxx: We know the next chracter.. we should just skip it and add ']' directlry
- fUsebuffer = true;
- fContentBuffer.append((char)fEntityScanner.scanChar(null));
- // remember where we are in case we get an endEntity before we
- // could flush the buffer out - this happens when we're parsing an
- // entity which ends with a ]
- fInScanContent = true;
-
- // We work on a single character basis to handle cases such as:
- // ']]]>' which we might otherwise miss.
- //
- if (fEntityScanner.skipChar(']', null)) {
- fContentBuffer.append(']');
- while (fEntityScanner.skipChar(']', null)) {
- fContentBuffer.append(']');
- }
- if (fEntityScanner.skipChar('>', null)) {
- reportFatalError("CDEndInContent", null);
- }
- }
- c = -1 ;
- fInScanContent = false;
- }
-
- do{
- //xxx: we should be using only one buffer..
- // we need not to grow the buffer only when isCoalesce() is not true;
-
- if (c == '<') {
- fEntityScanner.scanChar(null);
- setScannerState(SCANNER_STATE_START_OF_MARKUP);
- break;
- }//xxx what should be the behavior if entity reference is present in the content ?
- else if (c == '&') {
- fEntityScanner.scanChar(NameType.REFERENCE);
- setScannerState(SCANNER_STATE_REFERENCE);
- break;
- }///xxx since this part is also characters, it should be merged...
- else if (c != -1 && isInvalidLiteral(c)) {
- if (XMLChar.isHighSurrogate(c)) {
- // special case: surrogates
- scanSurrogates(fContentBuffer) ;
- setScannerState(SCANNER_STATE_CONTENT);
- } else {
- reportFatalError("InvalidCharInContent",
- new Object[] {
- Integer.toString(c, 16)});
- fEntityScanner.scanChar(null);
- }
- break;
- }
- //xxx: scanContent also gives character callback.
- c = scanContent(fContentBuffer) ;
- //we should not be iterating again if fIsCoalesce is not set to true
-
- if(!fIsCoalesce){
- setScannerState(SCANNER_STATE_CONTENT);
- break;
- }
-
- }while(true);
-
- //if (fDocumentHandler != null) {
- // fDocumentHandler.characters(fContentBuffer, null);
- //}
- if(DEBUG)System.out.println("USING THE BUFFER, STRING START=" + fContentBuffer.toString() +"=END");
- //if fIsCoalesce is true there might be more data so call fDriver.next()
- if(fIsCoalesce){
- fLastSectionWasCharacterData = true ;
- continue;
- }else{
- if(dtdGrammarUtil!= null && dtdGrammarUtil.isIgnorableWhiteSpace(fContentBuffer)){
- if(DEBUG)System.out.println("Return SPACE EVENT");
- return XMLEvent.SPACE;
- } else
- return XMLEvent.CHARACTERS ;
- }
- }
-
- case SCANNER_STATE_END_ELEMENT_TAG :{
- if(fEmptyElement){
- //set it back to false.
- fEmptyElement = false;
- setScannerState(SCANNER_STATE_CONTENT);
- //check the case when there is comment after single element document
- //<foo/> and some comment after this
- return (fMarkupDepth == 0 && elementDepthIsZeroHook() ) ? XMLEvent.END_ELEMENT : XMLEvent.END_ELEMENT ;
-
- } else if(scanEndElement() == 0) {
- //It is last element of the document
- if (elementDepthIsZeroHook()) {
- //if element depth is zero , it indicates the end of the document
- //the state shouldn't be set, because it is set by elementDepthIsZeroHook() function
- //xxx understand this point once again..
- return XMLEvent.END_ELEMENT ;
- }
-
- }
- setScannerState(SCANNER_STATE_CONTENT);
- return XMLEvent.END_ELEMENT ;
- }
-
- case SCANNER_STATE_COMMENT: { //SCANNER_STATE_COMMENT:
- scanComment();
- setScannerState(SCANNER_STATE_CONTENT);
- return XMLEvent.COMMENT;
- //break;
- }
- case SCANNER_STATE_PI:{ //SCANNER_STATE_PI: {
- //clear the buffer first
- fContentBuffer.clear() ;
- //xxx: which buffer should be passed. Ideally we shouldn't have
- //more than two buffers --
- //xxx: where should we add the switch for buffering.
- scanPI(fContentBuffer);
- setScannerState(SCANNER_STATE_CONTENT);
- return XMLEvent.PROCESSING_INSTRUCTION;
- //break;
- }
- case SCANNER_STATE_CDATA :{ //SCANNER_STATE_CDATA: {
- //xxx: What if CDATA is the first event
- //<foo><![CDATA[hello<><>]]>append</foo>
-
- //we should not clear the buffer only when the last state was either SCANNER_STATE_REFERENCE or
- //SCANNER_STATE_CHARACTER_DATA or SCANNER_STATE_REFERENCE
- if(fIsCoalesce && ( fLastSectionWasEntityReference || fLastSectionWasCData || fLastSectionWasCharacterData)){
- fLastSectionWasCData = true ;
- fLastSectionWasEntityReference = false;
- fLastSectionWasCharacterData = false;
- }//if we dont need to coalesce clear the buffer
- else{
- fContentBuffer.clear();
- }
- fUsebuffer = true;
- //CDATA section is completely read in all the case.
- scanCDATASection(fContentBuffer , true);
- setScannerState(SCANNER_STATE_CONTENT);
- //1. if fIsCoalesce is set to true we set the variable fLastSectionWasCData to true
- //and just call fDispatche.next(). Since we have set the scanner state to
- //SCANNER_STATE_CONTENT (super state) parser will automatically recover and
- //behave appropriately. When isCoalesce is set to true we dont need to reportCDATA event
- //2. Check if application has set for reporting CDATA event
- //3. if the application has neither set the fIsCoalesce to true nor fReportCdataEvent
- //return the cdata event as characters.
- if(fIsCoalesce){
- fLastSectionWasCData = true ;
- //there might be more data to coalesce.
- continue;
- }else if(fReportCdataEvent){
- return XMLEvent.CDATA;
- } else{
- return XMLEvent.CHARACTERS;
- }
- }
-
- case SCANNER_STATE_REFERENCE :{
- fMarkupDepth++;
- foundBuiltInRefs = false;
-
- //we should not clear the buffer only when the last state was either CDATA or
- //SCANNER_STATE_CHARACTER_DATA or SCANNER_STATE_REFERENCE
- if(fIsCoalesce && ( fLastSectionWasEntityReference || fLastSectionWasCData || fLastSectionWasCharacterData)){
- //fLastSectionWasEntityReference or fLastSectionWasCData are only
- //used when fIsCoalesce is set to true.
- fLastSectionWasEntityReference = true ;
- fLastSectionWasCData = false;
- fLastSectionWasCharacterData = false;
- }//if we dont need to coalesce clear the buffer
- else{
- fContentBuffer.clear();
- }
- fUsebuffer = true ;
- //take care of character reference
- if (fEntityScanner.skipChar('#', NameType.REFERENCE)) {
- scanCharReferenceValue(fContentBuffer, null);
- fMarkupDepth--;
- if(!fIsCoalesce){
- setScannerState(SCANNER_STATE_CONTENT);
- return XMLEvent.CHARACTERS;
- }
- } else {
- // this function also starts new entity
- scanEntityReference(fContentBuffer);
- //if there was built-in entity reference & coalesce is not true
- //return CHARACTERS
- if(fScannerState == SCANNER_STATE_BUILT_IN_REFS && !fIsCoalesce){
- setScannerState(SCANNER_STATE_CONTENT);
- return XMLEvent.CHARACTERS;
- }
-
- //if there was a text declaration, call next() it will be taken care.
- if(fScannerState == SCANNER_STATE_TEXT_DECL){
- fLastSectionWasEntityReference = true ;
- continue;
- }
-
- if(fScannerState == SCANNER_STATE_REFERENCE){
- setScannerState(SCANNER_STATE_CONTENT);
- if (fReplaceEntityReferences && fEntityStore.isDeclaredEntity(fCurrentEntityName)) {
- // Skip the entity reference, we don't care
- continue;
- }
- return XMLEvent.ENTITY_REFERENCE;
- }
- }
- //Wether it was character reference, entity reference or built-in entity
- //set the next possible state to SCANNER_STATE_CONTENT
- setScannerState(SCANNER_STATE_CONTENT);
- fLastSectionWasEntityReference = true ;
- continue;
- }
-
- case SCANNER_STATE_TEXT_DECL: {
- // scan text decl
- if (fEntityScanner.skipString("<?xml")) {
- fMarkupDepth++;
- // NOTE: special case where entity starts with a PI
- // whose name starts with "xml" (e.g. "xmlfoo")
- if (isValidNameChar(fEntityScanner.peekChar())) {
- fStringBuffer.clear();
- fStringBuffer.append("xml");
-
- if (fNamespaces) {
- while (isValidNCName(fEntityScanner.peekChar())) {
- fStringBuffer.append((char)fEntityScanner.scanChar(null));
- }
- } else {
- while (isValidNameChar(fEntityScanner.peekChar())) {
- fStringBuffer.append((char)fEntityScanner.scanChar(null));
- }
- }
- String target = fSymbolTable.addSymbol(fStringBuffer.ch, fStringBuffer.offset, fStringBuffer.length);
- fContentBuffer.clear();
- scanPIData(target, fContentBuffer);
- }
-
- // standard text declaration
- else {
- //xxx: this function gives callback
- scanXMLDeclOrTextDecl(true);
- }
- }
- // now that we've straightened out the readers, we can read in chunks:
- fEntityManager.fCurrentEntity.mayReadChunks = true;
- setScannerState(SCANNER_STATE_CONTENT);
- //xxx: we don't return any state, so how do we get to know about TEXT declarations.
- //it seems we have to careful when to allow function issue a callback
- //and when to allow adapter issue a callback.
- continue;
- }
-
-
- case SCANNER_STATE_ROOT_ELEMENT: {
- if (scanRootElementHook()) {
- fEmptyElement = true;
- //rest would be taken care by fTrailingMiscDriver set by scanRootElementHook
- return XMLEvent.START_ELEMENT;
- }
- setScannerState(SCANNER_STATE_CONTENT);
- return XMLEvent.START_ELEMENT ;
- }
- case SCANNER_STATE_CHAR_REFERENCE : {
- fContentBuffer.clear();
- scanCharReferenceValue(fContentBuffer, null);
- fMarkupDepth--;
- setScannerState(SCANNER_STATE_CONTENT);
- return XMLEvent.CHARACTERS;
- }
- default:
- throw new XNIException("Scanner State " + fScannerState + " not Recognized ");
-
- }//switch
- }
- // premature end of file
- catch (EOFException e) {
- endOfFileHook(e);
- return -1;
- }
- } //while loop
- }//next
-
- //
- // Protected methods
- //
-
- // hooks
-
- // NOTE: These hook methods are added so that the full document
- // scanner can share the majority of code with this class.
-
- /**
- * Scan for DOCTYPE hook. This method is a hook for subclasses
- * to add code to handle scanning for a the "DOCTYPE" string
- * after the string "<!" has been scanned.
- *
- * @return True if the "DOCTYPE" was scanned; false if "DOCTYPE"
- * was not scanned.
- */
- protected boolean scanForDoctypeHook()
- throws IOException, XNIException {
- return false;
- } // scanForDoctypeHook():boolean
-
- /**
- * Element depth iz zero. This methos is a hook for subclasses
- * to add code to handle when the element depth hits zero. When
- * scanning a document fragment, an element depth of zero is
- * normal. However, when scanning a full XML document, the
- * scanner must handle the trailing miscellanous section of
- * the document after the end of the document's root element.
- *
- * @return True if the caller should stop and return true which
- * allows the scanner to switch to a new scanning
- * driver. A return value of false indicates that
- * the content driver should continue as normal.
- */
- protected boolean elementDepthIsZeroHook()
- throws IOException, XNIException {
- return false;
- } // elementDepthIsZeroHook():boolean
-
- /**
- * Scan for root element hook. This method is a hook for
- * subclasses to add code that handles scanning for the root
- * element. When scanning a document fragment, there is no
- * "root" element. However, when scanning a full XML document,
- * the scanner must handle the root element specially.
- *
- * @return True if the caller should stop and return true which
- * allows the scanner to switch to a new scanning
- * driver. A return value of false indicates that
- * the content driver should continue as normal.
- */
- protected boolean scanRootElementHook()
- throws IOException, XNIException {
- return false;
- } // scanRootElementHook():boolean
-
- /**
- * End of file hook. This method is a hook for subclasses to
- * add code that handles the end of file. The end of file in
- * a document fragment is OK if the markup depth is zero.
- * However, when scanning a full XML document, an end of file
- * is always premature.
- */
- protected void endOfFileHook(EOFException e)
- throws IOException, XNIException {
-
- // NOTE: An end of file is only only an error if we were
- // in the middle of scanning some markup. -Ac
- if (fMarkupDepth != 0) {
- reportFatalError("PrematureEOF", null);
- }
-
- } // endOfFileHook()
-
- } // class FragmentContentDriver
-
- static void pr(String str) {
- System.out.println(str) ;
- }
-
- protected boolean fUsebuffer ;
-
- /** this function gets an XMLString (which is used to store the attribute value) from the special pool
- * maintained for attributes.
- * fAttributeCacheUsedCount tracks the number of attributes that has been consumed from the pool.
- * if all the attributes has been consumed, it adds a new XMLString inthe pool and returns the same
- * XMLString.
- *
- * @return XMLString XMLString used to store an attribute value.
- */
-
- protected XMLString getString(){
- if(fAttributeCacheUsedCount < initialCacheCount || fAttributeCacheUsedCount < attributeValueCache.size()){
- return attributeValueCache.get(fAttributeCacheUsedCount++);
- } else{
- XMLString str = new XMLString();
- fAttributeCacheUsedCount++;
- attributeValueCache.add(str);
- return str;
- }
- }
-
- /**
- * Implements XMLBufferListener interface.
- */
-
- public void refresh(){
- refresh(0);
- }
-
- /**
- * receives callbacks from {@link XMLEntityReader } when buffer
- * is being changed.
- * @param refreshPosition
- */
- public void refresh(int refreshPosition){
- //If you are reading attributes and you got a callback
- //cache available attributes.
- if(fReadingAttributes){
- fAttributes.refresh();
- }
- if(fScannerState == SCANNER_STATE_CHARACTER_DATA){
- //since fTempString directly matches to the underlying main buffer
- //store the data into buffer
- fContentBuffer.append(fTempString);
- //clear the XMLString so that data can't be added again.
- fTempString.length = 0;
- fUsebuffer = true;
- }
- }
-
-} // class XMLDocumentFragmentScannerImpl
diff --git a/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentScannerImpl.java b/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentScannerImpl.java
deleted file mode 100644
index 6c62345..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentScannerImpl.java
+++ /dev/null
@@ -1,1499 +0,0 @@
-/*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
- */
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl;
-
-import com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDDescription;
-import com.sun.org.apache.xerces.internal.impl.validation.ValidationManager;
-import com.sun.org.apache.xerces.internal.util.NamespaceSupport;
-import com.sun.org.apache.xerces.internal.util.XMLChar;
-import com.sun.org.apache.xerces.internal.util.XMLResourceIdentifierImpl;
-import com.sun.org.apache.xerces.internal.util.XMLStringBuffer;
-import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
-import com.sun.org.apache.xerces.internal.xni.Augmentations;
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDScanner;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-import com.sun.xml.internal.stream.Entity;
-import com.sun.xml.internal.stream.StaxXMLInputSource;
-import com.sun.xml.internal.stream.dtd.DTDGrammarUtil;
-import java.io.EOFException;
-import java.io.IOException;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.events.XMLEvent;
-
-
-/**
- * This class is responsible for scanning XML document structure
- * and content.
- *
- * This class has been modified as per the new design which is more suited to
- * efficiently build pull parser. Lot of improvements have been done and
- * the code has been added to support stax functionality/features.
- *
- * @author Neeraj Bajaj, Sun Microsystems
- * @author K.Venugopal, Sun Microsystems
- * @author Glenn Marcy, IBM
- * @author Andy Clark, IBM
- * @author Arnaud Le Hors, IBM
- * @author Eric Ye, IBM
- * @author Sunitha Reddy, Sun Microsystems
- *
- * Refer to the table in unit-test javax.xml.stream.XMLStreamReaderTest.SupportDTD for changes
- * related to property SupportDTD.
- * @author Joe Wang, Sun Microsystems
- * @version $Id: XMLDocumentScannerImpl.java,v 1.17 2010-11-01 04:39:41 joehw Exp $
- */
-public class XMLDocumentScannerImpl
- extends XMLDocumentFragmentScannerImpl{
-
- //
- // Constants
- //
-
- // scanner states
-
- /** Scanner state: XML declaration. */
- protected static final int SCANNER_STATE_XML_DECL = 42;
-
- /** Scanner state: prolog. */
- protected static final int SCANNER_STATE_PROLOG = 43;
-
- /** Scanner state: trailing misc. */
- protected static final int SCANNER_STATE_TRAILING_MISC = 44;
-
- /** Scanner state: DTD internal declarations. */
- protected static final int SCANNER_STATE_DTD_INTERNAL_DECLS = 45;
-
- /** Scanner state: open DTD external subset. */
- protected static final int SCANNER_STATE_DTD_EXTERNAL = 46;
-
- /** Scanner state: DTD external declarations. */
- protected static final int SCANNER_STATE_DTD_EXTERNAL_DECLS = 47;
-
- /** Scanner state: NO MORE ELEMENTS. */
- protected static final int SCANNER_STATE_NO_SUCH_ELEMENT_EXCEPTION = 48;
-
- // feature identifiers
-
- /** Property identifier document scanner: */
- protected static final String DOCUMENT_SCANNER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.DOCUMENT_SCANNER_PROPERTY;
-
- /** Feature identifier: load external DTD. */
- protected static final String LOAD_EXTERNAL_DTD =
- Constants.XERCES_FEATURE_PREFIX + Constants.LOAD_EXTERNAL_DTD_FEATURE;
-
- /** Feature identifier: load external DTD. */
- protected static final String DISALLOW_DOCTYPE_DECL_FEATURE =
- Constants.XERCES_FEATURE_PREFIX + Constants.DISALLOW_DOCTYPE_DECL_FEATURE;
-
- // property identifiers
-
- /** Property identifier: DTD scanner. */
- protected static final String DTD_SCANNER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.DTD_SCANNER_PROPERTY;
-
- // property identifier: ValidationManager
- protected static final String VALIDATION_MANAGER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.VALIDATION_MANAGER_PROPERTY;
-
- /** property identifier: NamespaceContext */
- protected static final String NAMESPACE_CONTEXT =
- Constants.XERCES_PROPERTY_PREFIX + Constants.NAMESPACE_CONTEXT_PROPERTY;
-
- // recognized features and properties
-
- /** Recognized features. */
- private static final String[] RECOGNIZED_FEATURES = {
- LOAD_EXTERNAL_DTD,
- DISALLOW_DOCTYPE_DECL_FEATURE,
- };
-
- /** Feature defaults. */
- private static final Boolean[] FEATURE_DEFAULTS = {
- Boolean.TRUE,
- Boolean.FALSE,
- };
-
- /** Recognized properties. */
- private static final String[] RECOGNIZED_PROPERTIES = {
- DTD_SCANNER,
- VALIDATION_MANAGER
- };
-
- /** Property defaults. */
- private static final Object[] PROPERTY_DEFAULTS = {
- null,
- null
- };
-
- //
- // Data((Boolean)propertyManager.getProperty(XMLInputFactory.IS_NAMESPACE_AWARE)).booleanValue();
- //
-
- // properties
-
- /** DTD scanner. */
- protected XMLDTDScanner fDTDScanner = null;
-
- /** Validation manager . */
- //xxx: fValidationManager code needs to be added yet!
- protected ValidationManager fValidationManager;
-
- protected XMLStringBuffer fDTDDecl = null;
- protected boolean fReadingDTD = false;
- protected boolean fAddedListener = false;
-
- // protected data
-
- // other info
-
- /** Doctype name. */
- protected String fDoctypeName;
-
- /** Doctype declaration public identifier. */
- protected String fDoctypePublicId;
-
- /** Doctype declaration system identifier. */
- protected String fDoctypeSystemId;
-
- /** Namespace support. */
- protected NamespaceContext fNamespaceContext = new NamespaceSupport();
-
- // features
-
- /** Load external DTD. */
- protected boolean fLoadExternalDTD = true;
-
- // state
-
- /** Seen doctype declaration. */
- protected boolean fSeenDoctypeDecl;
-
- protected boolean fScanEndElement;
-
- //protected int fScannerLastState ;
-
- // drivers
-
- /** XML declaration driver. */
- protected Driver fXMLDeclDriver = new XMLDeclDriver();
-
- /** Prolog driver. */
- protected Driver fPrologDriver = new PrologDriver();
-
- /** DTD driver. */
- protected Driver fDTDDriver = null ;
-
- /** Trailing miscellaneous section driver. */
- protected Driver fTrailingMiscDriver = new TrailingMiscDriver();
- protected int fStartPos = 0;
- protected int fEndPos = 0;
- protected boolean fSeenInternalSubset= false;
- // temporary variables
-
- /** Array of 3 strings. */
- private String[] fStrings = new String[3];
-
- /** External subset source. */
- private XMLInputSource fExternalSubsetSource = null;
-
- /** A DTD Description. */
- private final XMLDTDDescription fDTDDescription = new XMLDTDDescription(null, null, null, null, null);
-
- private static final char [] DOCTYPE = {'D','O','C','T','Y','P','E'};
- private static final char [] COMMENTSTRING = {'-','-'};
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- public XMLDocumentScannerImpl() {} // <init>()
-
-
- //
- // XMLDocumentScanner methods
- //
-
-
- /**
- * Sets the input source.
- *
- * @param inputSource The input source.
- *
- * @throws IOException Thrown on i/o error.
- */
- public void setInputSource(XMLInputSource inputSource) throws IOException {
- fEntityManager.setEntityHandler(this);
- //this starts a new entity and sets the current entity to the document entity.
- fEntityManager.startDocumentEntity(inputSource);
- // fDocumentSystemId = fEntityManager.expandSystemId(inputSource.getSystemId());
- setScannerState(XMLEvent.START_DOCUMENT);
- } // setInputSource(XMLInputSource)
-
-
-
- /**return the state of the scanner */
- public int getScannetState(){
- return fScannerState ;
- }
-
-
-
-
- public void reset(PropertyManager propertyManager) {
- super.reset(propertyManager);
- // other settings
- fDoctypeName = null;
- fDoctypePublicId = null;
- fDoctypeSystemId = null;
- fSeenDoctypeDecl = false;
- fNamespaceContext.reset();
- fSupportDTD = ((Boolean)propertyManager.getProperty(XMLInputFactory.SUPPORT_DTD)).booleanValue();
-
- // xerces features
- fLoadExternalDTD = !((Boolean)propertyManager.getProperty(Constants.ZEPHYR_PROPERTY_PREFIX + Constants.IGNORE_EXTERNAL_DTD)).booleanValue();
- setScannerState(XMLEvent.START_DOCUMENT);
- setDriver(fXMLDeclDriver);
- fSeenInternalSubset = false;
- if(fDTDScanner != null){
- ((XMLDTDScannerImpl)fDTDScanner).reset(propertyManager);
- }
- fEndPos = 0;
- fStartPos = 0;
- if(fDTDDecl != null){
- fDTDDecl.clear();
- }
-
- }
-
- /**
- * Resets the component. The component can query the component manager
- * about any features and properties that affect the operation of the
- * component.
- *
- * @param componentManager The component manager.
- *
- * @throws SAXException Thrown by component on initialization error.
- * For example, if a feature or property is
- * required for the operation of the component, the
- * component manager may throw a
- * SAXNotRecognizedException or a
- * SAXNotSupportedException.
- */
- public void reset(XMLComponentManager componentManager)
- throws XMLConfigurationException {
-
- super.reset(componentManager);
-
- // other settings
- fDoctypeName = null;
- fDoctypePublicId = null;
- fDoctypeSystemId = null;
- fSeenDoctypeDecl = false;
- fExternalSubsetSource = null;
-
- // xerces features
- fLoadExternalDTD = componentManager.getFeature(LOAD_EXTERNAL_DTD, true);
- fDisallowDoctype = componentManager.getFeature(DISALLOW_DOCTYPE_DECL_FEATURE, false);
-
- fNamespaces = componentManager.getFeature(NAMESPACES, true);
-
- fSeenInternalSubset = false;
- // xerces properties
- fDTDScanner = (XMLDTDScanner)componentManager.getProperty(DTD_SCANNER);
-
- fValidationManager = (ValidationManager)componentManager.getProperty(VALIDATION_MANAGER, null);
-
- try {
- fNamespaceContext = (NamespaceContext)componentManager.getProperty(NAMESPACE_CONTEXT);
- }
- catch (XMLConfigurationException e) { }
- if (fNamespaceContext == null) {
- fNamespaceContext = new NamespaceSupport();
- }
- fNamespaceContext.reset();
-
- fEndPos = 0;
- fStartPos = 0;
- if(fDTDDecl != null)
- fDTDDecl.clear();
-
-
- //fEntityScanner.registerListener((XMLBufferListener)componentManager.getProperty(DOCUMENT_SCANNER));
-
- // setup driver
- setScannerState(SCANNER_STATE_XML_DECL);
- setDriver(fXMLDeclDriver);
-
- } // reset(XMLComponentManager)
-
-
- /**
- * Returns a list of feature identifiers that are recognized by
- * this component. This method may return null if no features
- * are recognized by this component.
- */
- public String[] getRecognizedFeatures() {
- String[] featureIds = super.getRecognizedFeatures();
- int length = featureIds != null ? featureIds.length : 0;
- String[] combinedFeatureIds = new String[length + RECOGNIZED_FEATURES.length];
- if (featureIds != null) {
- System.arraycopy(featureIds, 0, combinedFeatureIds, 0, featureIds.length);
- }
- System.arraycopy(RECOGNIZED_FEATURES, 0, combinedFeatureIds, length, RECOGNIZED_FEATURES.length);
- return combinedFeatureIds;
- } // getRecognizedFeatures():String[]
-
- /**
- * Sets the state of a feature. This method is called by the component
- * manager any time after reset when a feature changes state.
- * <p>
- * <strong>Note:</strong> Components should silently ignore features
- * that do not affect the operation of the component.
- *
- * @param featureId The feature identifier.
- * @param state The state of the feature.
- *
- * @throws SAXNotRecognizedException The component should not throw
- * this exception.
- * @throws SAXNotSupportedException The component should not throw
- * this exception.
- */
- public void setFeature(String featureId, boolean state)
- throws XMLConfigurationException {
-
- super.setFeature(featureId, state);
-
- // Xerces properties
- if (featureId.startsWith(Constants.XERCES_FEATURE_PREFIX)) {
- final int suffixLength = featureId.length() - Constants.XERCES_FEATURE_PREFIX.length();
-
- if (suffixLength == Constants.LOAD_EXTERNAL_DTD_FEATURE.length() &&
- featureId.endsWith(Constants.LOAD_EXTERNAL_DTD_FEATURE)) {
- fLoadExternalDTD = state;
- return;
- }
- else if (suffixLength == Constants.DISALLOW_DOCTYPE_DECL_FEATURE.length() &&
- featureId.endsWith(Constants.DISALLOW_DOCTYPE_DECL_FEATURE)) {
- fDisallowDoctype = state;
- return;
- }
- }
-
- } // setFeature(String,boolean)
-
- /**
- * Returns a list of property identifiers that are recognized by
- * this component. This method may return null if no properties
- * are recognized by this component.
- */
- public String[] getRecognizedProperties() {
- String[] propertyIds = super.getRecognizedProperties();
- int length = propertyIds != null ? propertyIds.length : 0;
- String[] combinedPropertyIds = new String[length + RECOGNIZED_PROPERTIES.length];
- if (propertyIds != null) {
- System.arraycopy(propertyIds, 0, combinedPropertyIds, 0, propertyIds.length);
- }
- System.arraycopy(RECOGNIZED_PROPERTIES, 0, combinedPropertyIds, length, RECOGNIZED_PROPERTIES.length);
- return combinedPropertyIds;
- } // getRecognizedProperties():String[]
-
- /**
- * Sets the value of a property. This method is called by the component
- * manager any time after reset when a property changes value.
- * <p>
- * <strong>Note:</strong> Components should silently ignore properties
- * that do not affect the operation of the component.
- *
- * @param propertyId The property identifier.
- * @param value The value of the property.
- *
- * @throws SAXNotRecognizedException The component should not throw
- * this exception.
- * @throws SAXNotSupportedException The component should not throw
- * this exception.
- */
- public void setProperty(String propertyId, Object value)
- throws XMLConfigurationException {
-
- super.setProperty(propertyId, value);
-
- // Xerces properties
- if (propertyId.startsWith(Constants.XERCES_PROPERTY_PREFIX)) {
- final int suffixLength = propertyId.length() - Constants.XERCES_PROPERTY_PREFIX.length();
-
- if (suffixLength == Constants.DTD_SCANNER_PROPERTY.length() &&
- propertyId.endsWith(Constants.DTD_SCANNER_PROPERTY)) {
- fDTDScanner = (XMLDTDScanner)value;
- }
- if (suffixLength == Constants.NAMESPACE_CONTEXT_PROPERTY.length() &&
- propertyId.endsWith(Constants.NAMESPACE_CONTEXT_PROPERTY)) {
- if (value != null) {
- fNamespaceContext = (NamespaceContext)value;
- }
- }
-
- return;
- }
-
- } // setProperty(String,Object)
-
- /**
- * Returns the default state for a feature, or null if this
- * component does not want to report a default value for this
- * feature.
- *
- * @param featureId The feature identifier.
- *
- * @since Xerces 2.2.0
- */
- public Boolean getFeatureDefault(String featureId) {
-
- for (int i = 0; i < RECOGNIZED_FEATURES.length; i++) {
- if (RECOGNIZED_FEATURES[i].equals(featureId)) {
- return FEATURE_DEFAULTS[i];
- }
- }
- return super.getFeatureDefault(featureId);
- } // getFeatureDefault(String):Boolean
-
- /**
- * Returns the default state for a property, or null if this
- * component does not want to report a default value for this
- * property.
- *
- * @param propertyId The property identifier.
- *
- * @since Xerces 2.2.0
- */
- public Object getPropertyDefault(String propertyId) {
- for (int i = 0; i < RECOGNIZED_PROPERTIES.length; i++) {
- if (RECOGNIZED_PROPERTIES[i].equals(propertyId)) {
- return PROPERTY_DEFAULTS[i];
- }
- }
- return super.getPropertyDefault(propertyId);
- } // getPropertyDefault(String):Object
-
- //
- // XMLEntityHandler methods
- //
-
- /**
- * This method notifies of the start of an entity. The DTD has the
- * pseudo-name of "[dtd]" parameter entity names start with '%'; and
- * general entities are just specified by their name.
- *
- * @param name The name of the entity.
- * @param identifier The resource identifier.
- * @param encoding The auto-detected IANA encoding name of the entity
- * stream. This value will be null in those situations
- * where the entity encoding is not auto-detected (e.g.
- * internal entities or a document entity that is
- * parsed from a java.io.Reader).
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startEntity(String name,
- XMLResourceIdentifier identifier,
- String encoding, Augmentations augs) throws XNIException {
-
- super.startEntity(name, identifier, encoding,augs);
-
- //register current document scanner as a listener for XMLEntityScanner
- fEntityScanner.registerListener(this);
-
- // prepare to look for a TextDecl if external general entity
- if (!name.equals("[xml]") && fEntityScanner.isExternal()) {
- // Don't do this if we're skipping the entity!
- if (augs == null || !((Boolean) augs.getItem(Constants.ENTITY_SKIPPED)).booleanValue()) {
- setScannerState(SCANNER_STATE_TEXT_DECL);
- }
- }
-
- // call handler
- /** comment this part.. LOCATOR problem.. */
- if (fDocumentHandler != null && name.equals("[xml]")) {
- fDocumentHandler.startDocument(fEntityScanner, encoding, fNamespaceContext, null);
- }
-
- } // startEntity(String,identifier,String)
-
-
- /**
- * This method notifies the end of an entity. The DTD has the pseudo-name
- * of "[dtd]" parameter entity names start with '%'; and general entities
- * are just specified by their name.
- *
- * @param name The name of the entity.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endEntity(String name, Augmentations augs) throws IOException, XNIException {
-
- super.endEntity(name, augs);
-
- if(name.equals("[xml]")){
- //if fMarkupDepth has reached 0.
- //and driver is fTrailingMiscDriver (which
- //handles end of document in normal case)
- //set the scanner state of SCANNER_STATE_TERMINATED
- if(fMarkupDepth == 0 && fDriver == fTrailingMiscDriver){
- //set the scanner set to SCANNER_STATE_TERMINATED
- setScannerState(SCANNER_STATE_TERMINATED) ;
- } else{
- //else we have reached the end of document prematurely
- //so throw EOFException.
- throw new java.io.EOFException();
- }
-
- //this is taken care in wrapper which generates XNI callbacks, There are no next events
-
- //if (fDocumentHandler != null) {
- //fDocumentHandler.endDocument(null);
- //}
- }
- } // endEntity(String)
-
-
- public XMLStringBuffer getDTDDecl(){
- Entity entity = fEntityScanner.getCurrentEntity();
- fDTDDecl.append(((Entity.ScannedEntity)entity).ch,fStartPos , fEndPos-fStartPos);
- if(fSeenInternalSubset)
- fDTDDecl.append("]>");
- return fDTDDecl;
- }
-
- public String getCharacterEncodingScheme(){
- return fDeclaredEncoding;
- }
-
- /** return the next state on the input
- *
- * @return int
- */
-
- public int next() throws IOException, XNIException {
- return fDriver.next();
- }
-
- //getNamespaceContext
- public NamespaceContext getNamespaceContext(){
- return fNamespaceContext ;
- }
-
-
-
- //
- // Protected methods
- //
-
- // driver factory methods
-
- /** Creates a content driver. */
- protected Driver createContentDriver() {
- return new ContentDriver();
- } // createContentDriver():Driver
-
- // scanning methods
-
- /** Scans a doctype declaration. */
- protected boolean scanDoctypeDecl(boolean supportDTD) throws IOException, XNIException {
-
- // spaces
- if (!fEntityScanner.skipSpaces()) {
- reportFatalError("MSG_SPACE_REQUIRED_BEFORE_ROOT_ELEMENT_TYPE_IN_DOCTYPEDECL",
- null);
- }
-
- // root element name
- fDoctypeName = fEntityScanner.scanName(NameType.DOCTYPE);
- if (fDoctypeName == null) {
- reportFatalError("MSG_ROOT_ELEMENT_TYPE_REQUIRED", null);
- }
-
- // external id
- if (fEntityScanner.skipSpaces()) {
- scanExternalID(fStrings, false);
- fDoctypeSystemId = fStrings[0];
- fDoctypePublicId = fStrings[1];
- fEntityScanner.skipSpaces();
- }
-
- fHasExternalDTD = fDoctypeSystemId != null;
-
- // Attempt to locate an external subset with an external subset resolver.
- if (supportDTD && !fHasExternalDTD && fExternalSubsetResolver != null) {
- fDTDDescription.setValues(null, null, fEntityManager.getCurrentResourceIdentifier().getExpandedSystemId(), null);
- fDTDDescription.setRootName(fDoctypeName);
- fExternalSubsetSource = fExternalSubsetResolver.getExternalSubset(fDTDDescription);
- fHasExternalDTD = fExternalSubsetSource != null;
- }
-
- // call handler
- if (supportDTD && fDocumentHandler != null) {
- // NOTE: I don't like calling the doctypeDecl callback until
- // end of the *full* doctype line (including internal
- // subset) is parsed correctly but SAX2 requires that
- // it knows the root element name and public and system
- // identifier for the startDTD call. -Ac
- if (fExternalSubsetSource == null) {
- fDocumentHandler.doctypeDecl(fDoctypeName, fDoctypePublicId, fDoctypeSystemId, null);
- }
- else {
- fDocumentHandler.doctypeDecl(fDoctypeName, fExternalSubsetSource.getPublicId(), fExternalSubsetSource.getSystemId(), null);
- }
- }
-
- // is there an internal subset?
- boolean internalSubset = true;
- if (!fEntityScanner.skipChar('[', null)) {
- internalSubset = false;
- fEntityScanner.skipSpaces();
- if (!fEntityScanner.skipChar('>', null)) {
- reportFatalError("DoctypedeclUnterminated", new Object[]{fDoctypeName});
- }
- fMarkupDepth--;
- }
- return internalSubset;
-
- } // scanDoctypeDecl():boolean
-
- //
- // Private methods
- //
- /** Set the scanner state after scanning DTD */
- protected void setEndDTDScanState() {
- setScannerState(SCANNER_STATE_PROLOG);
- setDriver(fPrologDriver);
- fEntityManager.setEntityHandler(XMLDocumentScannerImpl.this);
- fReadingDTD=false;
- }
-
- /** Returns the scanner state name. */
- protected String getScannerStateName(int state) {
-
- switch (state) {
- case SCANNER_STATE_XML_DECL: return "SCANNER_STATE_XML_DECL";
- case SCANNER_STATE_PROLOG: return "SCANNER_STATE_PROLOG";
- case SCANNER_STATE_TRAILING_MISC: return "SCANNER_STATE_TRAILING_MISC";
- case SCANNER_STATE_DTD_INTERNAL_DECLS: return "SCANNER_STATE_DTD_INTERNAL_DECLS";
- case SCANNER_STATE_DTD_EXTERNAL: return "SCANNER_STATE_DTD_EXTERNAL";
- case SCANNER_STATE_DTD_EXTERNAL_DECLS: return "SCANNER_STATE_DTD_EXTERNAL_DECLS";
- }
- return super.getScannerStateName(state);
-
- } // getScannerStateName(int):String
-
- //
- // Classes
- //
-
- /**
- * Driver to handle XMLDecl scanning.
- *
- * This class has been modified as per the new design which is more suited to
- * efficiently build pull parser. Lots of performance improvements have been done and
- * the code has been added to support stax functionality/features.
- *
- * @author Neeraj Bajaj, Sun Microsystems.
- *
- * @author Andy Clark, IBM
- */
- protected final class XMLDeclDriver
- implements Driver {
-
- //
- // Driver methods
- //
-
-
- public int next() throws IOException, XNIException {
- if(DEBUG_NEXT){
- System.out.println("NOW IN XMLDeclDriver");
- }
-
- // next driver is prolog regardless of whether there
- // is an XMLDecl in this document
- setScannerState(SCANNER_STATE_PROLOG);
- setDriver(fPrologDriver);
-
- //System.out.println("fEntityScanner = " + fEntityScanner);
- // scan XMLDecl
- try {
- if (fEntityScanner.skipString(xmlDecl)) {
- fMarkupDepth++;
- // NOTE: special case where document starts with a PI
- // whose name starts with "xml" (e.g. "xmlfoo")
- if (XMLChar.isName(fEntityScanner.peekChar())) {
- fStringBuffer.clear();
- fStringBuffer.append("xml");
- while (XMLChar.isName(fEntityScanner.peekChar())) {
- fStringBuffer.append((char)fEntityScanner.scanChar(null));
- }
- String target = fSymbolTable.addSymbol(fStringBuffer.ch, fStringBuffer.offset, fStringBuffer.length);
- //this function should fill the data.. and set the fEvent object to this event.
- fContentBuffer.clear() ;
- scanPIData(target, fContentBuffer);
- //REVISIT:where else we can set this value to 'true'
- fEntityManager.fCurrentEntity.mayReadChunks = true;
- //return PI event since PI was encountered
- return XMLEvent.PROCESSING_INSTRUCTION ;
- }
- // standard XML declaration
- else {
- scanXMLDeclOrTextDecl(false);
- //REVISIT:where else we can set this value to 'true'
- fEntityManager.fCurrentEntity.mayReadChunks = true;
- return XMLEvent.START_DOCUMENT;
- }
- } else{
- //REVISIT:where else we can set this value to 'true'
- fEntityManager.fCurrentEntity.mayReadChunks = true;
- //In both case return the START_DOCUMENT. ony difference is that first block will
- //cosume the XML declaration if any.
- return XMLEvent.START_DOCUMENT;
- }
-
-
- //START_OF_THE_DOCUMENT
-
-
- }
-
- // premature end of file
- catch (EOFException e) {
- reportFatalError("PrematureEOF", null);
- return -1;
- //throw e;
- }
-
- }
- } // class XMLDeclDriver
-
- /**
- * Driver to handle prolog scanning.
- *
- * @author Andy Clark, IBM
- */
- protected final class PrologDriver
- implements Driver {
-
- /**
- * Drives the parser to the next state/event on the input. Parser is guaranteed
- * to stop at the next state/event.
- *
- * Internally XML document is divided into several states. Each state represents
- * a sections of XML document. When this functions returns normally, it has read
- * the section of XML document and returns the state corresponding to section of
- * document which has been read. For optimizations, a particular driver
- * can read ahead of the section of document (state returned) just read and
- * can maintain a different internal state.
- *
- * @return state representing the section of document just read.
- *
- * @throws IOException Thrown on i/o error.
- * @throws XNIException Thrown on parse error.
- */
-
- public int next() throws IOException, XNIException {
- //System.out.println("here in next");
-
- if(DEBUG_NEXT){
- System.out.println("NOW IN PrologDriver");
- }
- try {
- do {
- switch (fScannerState) {
- case SCANNER_STATE_PROLOG: {
- fEntityScanner.skipSpaces();
- if (fEntityScanner.skipChar('<', null)) {
- setScannerState(SCANNER_STATE_START_OF_MARKUP);
- } else if (fEntityScanner.skipChar('&', NameType.REFERENCE)) {
- setScannerState(SCANNER_STATE_REFERENCE);
- } else {
- setScannerState(SCANNER_STATE_CONTENT);
- }
- break;
- }
-
- case SCANNER_STATE_START_OF_MARKUP: {
- fMarkupDepth++;
- if (isValidNameStartChar(fEntityScanner.peekChar()) ||
- isValidNameStartHighSurrogate(fEntityScanner.peekChar())) {
- setScannerState(SCANNER_STATE_ROOT_ELEMENT);
- setDriver(fContentDriver);
- //from now onwards this would be handled by fContentDriver,in the same next() call
- return fContentDriver.next();
- } else if (fEntityScanner.skipChar('!', null)) {
- if (fEntityScanner.skipChar('-', null)) {
- if (!fEntityScanner.skipChar('-', null)) {
- reportFatalError("InvalidCommentStart",
- null);
- }
- setScannerState(SCANNER_STATE_COMMENT);
- } else if (fEntityScanner.skipString(DOCTYPE)) {
- setScannerState(SCANNER_STATE_DOCTYPE);
- Entity entity = fEntityScanner.getCurrentEntity();
- if(entity instanceof Entity.ScannedEntity){
- fStartPos=((Entity.ScannedEntity)entity).position;
- }
- fReadingDTD=true;
- if(fDTDDecl == null)
- fDTDDecl = new XMLStringBuffer();
- fDTDDecl.append("<!DOCTYPE");
-
- } else {
- reportFatalError("MarkupNotRecognizedInProlog",
- null);
- }
- } else if (fEntityScanner.skipChar('?', null)) {
- setScannerState(SCANNER_STATE_PI);
- } else {
- reportFatalError("MarkupNotRecognizedInProlog",
- null);
- }
- break;
- }
- }
- } while (fScannerState == SCANNER_STATE_PROLOG || fScannerState == SCANNER_STATE_START_OF_MARKUP );
-
- switch(fScannerState){
- /**
- //this part is handled by FragmentContentHandler
- case SCANNER_STATE_ROOT_ELEMENT: {
- //we have read '<' and beginning of reading the start element tag
- setScannerState(SCANNER_STATE_START_ELEMENT_TAG);
- setDriver(fContentDriver);
- //from now onwards this would be handled by fContentDriver,in the same next() call
- return fContentDriver.next();
- }
- */
- case SCANNER_STATE_COMMENT: {
- //this function fills the data..
- scanComment();
- setScannerState(SCANNER_STATE_PROLOG);
- return XMLEvent.COMMENT;
- //setScannerState(SCANNER_STATE_PROLOG);
- //break;
- }
- case SCANNER_STATE_PI: {
- fContentBuffer.clear() ;
- scanPI(fContentBuffer);
- setScannerState(SCANNER_STATE_PROLOG);
- return XMLEvent.PROCESSING_INSTRUCTION;
- }
-
- case SCANNER_STATE_DOCTYPE: {
- if (fDisallowDoctype) {
- reportFatalError("DoctypeNotAllowed", null);
- }
-
- if (fSeenDoctypeDecl) {
- reportFatalError("AlreadySeenDoctype", null);
- }
- fSeenDoctypeDecl = true;
-
- // scanDoctypeDecl() sends XNI doctypeDecl event that
- // in SAX is converted to startDTD() event.
- if (scanDoctypeDecl(fSupportDTD)) {
- //allow parsing of entity decls to continue in order to stay well-formed
- setScannerState(SCANNER_STATE_DTD_INTERNAL_DECLS);
- fSeenInternalSubset = true;
- if(fDTDDriver == null){
- fDTDDriver = new DTDDriver();
- }
- setDriver(fContentDriver);
- //always return DTD event, the event however, will not contain any entities
- return fDTDDriver.next();
- }
-
- if(fSeenDoctypeDecl){
- Entity entity = fEntityScanner.getCurrentEntity();
- if(entity instanceof Entity.ScannedEntity){
- fEndPos = ((Entity.ScannedEntity)entity).position;
- }
- fReadingDTD = false;
- }
-
- // handle external subset
- if (fDoctypeSystemId != null) {
- if (((fValidation || fLoadExternalDTD)
- && (fValidationManager == null || !fValidationManager.isCachedDTD()))) {
- if (fSupportDTD) {
- setScannerState(SCANNER_STATE_DTD_EXTERNAL);
- } else {
- setScannerState(SCANNER_STATE_PROLOG);
- }
-
- setDriver(fContentDriver);
- if(fDTDDriver == null) {
- fDTDDriver = new DTDDriver();
- }
-
- return fDTDDriver.next();
- }
- }
- else if (fExternalSubsetSource != null) {
- if (((fValidation || fLoadExternalDTD)
- && (fValidationManager == null || !fValidationManager.isCachedDTD()))) {
- // This handles the case of a DOCTYPE that had neither an internal subset or an external subset.
- fDTDScanner.setInputSource(fExternalSubsetSource);
- fExternalSubsetSource = null;
- if (fSupportDTD)
- setScannerState(SCANNER_STATE_DTD_EXTERNAL_DECLS);
- else
- setScannerState(SCANNER_STATE_PROLOG);
- setDriver(fContentDriver);
- if(fDTDDriver == null)
- fDTDDriver = new DTDDriver();
- return fDTDDriver.next();
- }
- }
-
- // Send endDTD() call if:
- // a) systemId is null or if an external subset resolver could not locate an external subset.
- // b) "load-external-dtd" and validation are false
- // c) DTD grammar is cached
-
- // in XNI this results in 3 events: doctypeDecl, startDTD, endDTD
- // in SAX this results in 2 events: startDTD, endDTD
- if (fDTDScanner != null) {
- fDTDScanner.setInputSource(null);
- }
- setScannerState(SCANNER_STATE_PROLOG);
- return XMLEvent.DTD;
- }
-
- case SCANNER_STATE_CONTENT: {
- reportFatalError("ContentIllegalInProlog", null);
- fEntityScanner.scanChar(null);
- }
- case SCANNER_STATE_REFERENCE: {
- reportFatalError("ReferenceIllegalInProlog", null);
- }
-
- /**
- * if (complete) {
- * if (fEntityScanner.scanChar() != '<') {
- * reportFatalError("RootElementRequired", null);
- * }
- * setScannerState(SCANNER_STATE_ROOT_ELEMENT);
- * setDriver(fContentDriver);
- * }
- */
- }
- }
- // premature end of file
- catch (EOFException e) {
- reportFatalError("PrematureEOF", null);
- //xxx what should be returned here.... ???
- return -1 ;
- //throw e;
- }
- //xxx what should be returned here.... ???
- return -1;
-
- }
-
-
- } // class PrologDriver
-
- /**
- * Driver to handle the internal and external DTD subsets.
- *
- * @author Andy Clark, IBM
- */
- protected final class DTDDriver
- implements Driver {
-
- //
- // Driver methods
- //
-
- public int next() throws IOException, XNIException{
- // throw new XNIException("DTD Parsing is currently not supported");
- if(DEBUG_NEXT){
- System.out.println("Now in DTD Driver");
- }
-
- dispatch(true);
-
- if(DEBUG_NEXT){
- System.out.println("After calling dispatch(true) -- At this point whole DTD is read.");
- }
-
- //xxx: remove this hack and align this with reusing DTD components
- //currently this routine will only be executed from Stax
- if(fPropertyManager != null){
- dtdGrammarUtil = new DTDGrammarUtil(((XMLDTDScannerImpl)fDTDScanner).getGrammar(),fSymbolTable, fNamespaceContext);
- }
-
- return XMLEvent.DTD ;
- }
-
- /**
- * Dispatch an XML "event".
- *
- * @param complete True if this driver is intended to scan
- * and dispatch as much as possible.
- *
- * @return True if there is more to dispatch either from this
- * or a another driver.
- *
- * @throws IOException Thrown on i/o error.
- * @throws XNIException Thrown on parse error.
- */
- public boolean dispatch(boolean complete)
- throws IOException, XNIException {
- fEntityManager.setEntityHandler(null);
- try {
- boolean again;
- XMLResourceIdentifierImpl resourceIdentifier = new XMLResourceIdentifierImpl();
- if( fDTDScanner == null){
-
- if (fEntityManager.getEntityScanner() instanceof XML11EntityScanner){
- fDTDScanner = new XML11DTDScannerImpl();
- } else
-
- fDTDScanner = new XMLDTDScannerImpl();
-
- ((XMLDTDScannerImpl)fDTDScanner).reset(fPropertyManager);
- }
-
- fDTDScanner.setLimitAnalyzer(fLimitAnalyzer);
- do {
- again = false;
- switch (fScannerState) {
- case SCANNER_STATE_DTD_INTERNAL_DECLS: {
- boolean moreToScan = false;
- if (!fDTDScanner.skipDTD(fSupportDTD)) {
- // REVISIT: Should there be a feature for
- // the "complete" parameter?
- boolean completeDTD = true;
-
- moreToScan = fDTDScanner.scanDTDInternalSubset(completeDTD, fStandalone, fHasExternalDTD && fLoadExternalDTD);
- }
- Entity entity = fEntityScanner.getCurrentEntity();
- if(entity instanceof Entity.ScannedEntity){
- fEndPos=((Entity.ScannedEntity)entity).position;
- }
- fReadingDTD=false;
- if (!moreToScan) {
- // end doctype declaration
- if (!fEntityScanner.skipChar(']', null)) {
- reportFatalError("DoctypedeclNotClosed", new Object[]{fDoctypeName});
- }
- fEntityScanner.skipSpaces();
- if (!fEntityScanner.skipChar('>', null)) {
- reportFatalError("DoctypedeclUnterminated", new Object[]{fDoctypeName});
- }
- fMarkupDepth--;
-
- if (!fSupportDTD) {
- //simply reset the entity store without having to mess around
- //with the DTD Scanner code
- fEntityStore = fEntityManager.getEntityStore();
- fEntityStore.reset();
- } else {
- // scan external subset next unless we are ignoring DTDs
- if (fDoctypeSystemId != null && (fValidation || fLoadExternalDTD)) {
- setScannerState(SCANNER_STATE_DTD_EXTERNAL);
- break;
- }
- }
-
- setEndDTDScanState();
- return true;
-
- }
- break;
- }
- case SCANNER_STATE_DTD_EXTERNAL: {
- /**
- fDTDDescription.setValues(fDoctypePublicId, fDoctypeSystemId, null, null);
- fDTDDescription.setRootName(fDoctypeName);
- XMLInputSource xmlInputSource =
- fEntityManager.resolveEntity(fDTDDescription);
- fDTDScanner.setInputSource(xmlInputSource);
- setScannerState(SCANNER_STATE_DTD_EXTERNAL_DECLS);
- again = true;
- break;
- */
-
- resourceIdentifier.setValues(fDoctypePublicId, fDoctypeSystemId, null, null);
- XMLInputSource xmlInputSource = null ;
- StaxXMLInputSource staxInputSource = fEntityManager.resolveEntityAsPerStax(resourceIdentifier);
-
- // Check access permission. If the source is resolved by a resolver, the check is skipped.
- if (!staxInputSource.hasResolver()) {
- String accessError = checkAccess(fDoctypeSystemId, fAccessExternalDTD);
- if (accessError != null) {
- reportFatalError("AccessExternalDTD", new Object[]{ SecuritySupport.sanitizePath(fDoctypeSystemId), accessError });
- }
- }
- xmlInputSource = staxInputSource.getXMLInputSource();
- fDTDScanner.setInputSource(xmlInputSource);
- if (fEntityScanner.fCurrentEntity != null) {
- setScannerState(SCANNER_STATE_DTD_EXTERNAL_DECLS);
- } else {
- setScannerState(SCANNER_STATE_PROLOG);
- }
- again = true;
- break;
- }
- case SCANNER_STATE_DTD_EXTERNAL_DECLS: {
- // REVISIT: Should there be a feature for
- // the "complete" parameter?
- boolean completeDTD = true;
- boolean moreToScan = fDTDScanner.scanDTDExternalSubset(completeDTD);
- if (!moreToScan) {
- setEndDTDScanState();
- return true;
- }
- break;
- }
- case SCANNER_STATE_PROLOG : {
- // skip entity decls
- setEndDTDScanState();
- return true;
- }
- default: {
- throw new XNIException("DTDDriver#dispatch: scanner state="+fScannerState+" ("+getScannerStateName(fScannerState)+')');
- }
- }
- } while (complete || again);
- }
-
- // premature end of file
- catch (EOFException e) {
- e.printStackTrace();
- reportFatalError("PrematureEOF", null);
- return false;
- //throw e;
- }
-
- // cleanup
- finally {
- fEntityManager.setEntityHandler(XMLDocumentScannerImpl.this);
- }
-
- return true;
-
- }
-
- // dispatch(boolean):boolean
-
- } // class DTDDriver
-
- /**
- * Driver to handle content scanning.
- *
- * @author Andy Clark, IBM
- * @author Eric Ye, IBM
- */
- protected class ContentDriver
- extends FragmentContentDriver {
-
- //
- // Protected methods
- //
-
- // hooks
-
- // NOTE: These hook methods are added so that the full document
- // scanner can share the majority of code with this class.
-
- /**
- * Scan for DOCTYPE hook. This method is a hook for subclasses
- * to add code to handle scanning for a the "DOCTYPE" string
- * after the string "<!" has been scanned.
- *
- * @return True if the "DOCTYPE" was scanned; false if "DOCTYPE"
- * was not scanned.
- */
- protected boolean scanForDoctypeHook()
- throws IOException, XNIException {
-
- if (fEntityScanner.skipString(DOCTYPE)) {
- setScannerState(SCANNER_STATE_DOCTYPE);
- // fEntityScanner.markStartOfDTD();
- return true;
- }
- return false;
-
- } // scanForDoctypeHook():boolean
-
- /**
- * Element depth iz zero. This methos is a hook for subclasses
- * to add code to handle when the element depth hits zero. When
- * scanning a document fragment, an element depth of zero is
- * normal. However, when scanning a full XML document, the
- * scanner must handle the trailing miscellanous section of
- * the document after the end of the document's root element.
- *
- * @return True if the caller should stop and return true which
- * allows the scanner to switch to a new scanning
- * driver. A return value of false indicates that
- * the content driver should continue as normal.
- */
- protected boolean elementDepthIsZeroHook()
- throws IOException, XNIException {
-
- setScannerState(SCANNER_STATE_TRAILING_MISC);
- setDriver(fTrailingMiscDriver);
- return true;
-
- } // elementDepthIsZeroHook():boolean
-
- /**
- * Scan for root element hook. This method is a hook for
- * subclasses to add code that handles scanning for the root
- * element. When scanning a document fragment, there is no
- * "root" element. However, when scanning a full XML document,
- * the scanner must handle the root element specially.
- *
- * @return True if the caller should stop and return true which
- * allows the scanner to switch to a new scanning
- * driver. A return value of false indicates that
- * the content driver should continue as normal.
- */
- protected boolean scanRootElementHook()
- throws IOException, XNIException {
-
- if (scanStartElement()) {
- setScannerState(SCANNER_STATE_TRAILING_MISC);
- setDriver(fTrailingMiscDriver);
- return true;
- }
- return false;
-
- } // scanRootElementHook():boolean
-
- /**
- * End of file hook. This method is a hook for subclasses to
- * add code that handles the end of file. The end of file in
- * a document fragment is OK if the markup depth is zero.
- * However, when scanning a full XML document, an end of file
- * is always premature.
- */
- protected void endOfFileHook(EOFException e)
- throws IOException, XNIException {
-
- reportFatalError("PrematureEOF", null);
- // in case continue-after-fatal-error set, should not do this...
- //throw e;
-
- } // endOfFileHook()
-
- protected void resolveExternalSubsetAndRead()
- throws IOException, XNIException {
-
- fDTDDescription.setValues(null, null, fEntityManager.getCurrentResourceIdentifier().getExpandedSystemId(), null);
- fDTDDescription.setRootName(fElementQName.rawname);
- XMLInputSource src = fExternalSubsetResolver.getExternalSubset(fDTDDescription);
-
- if (src != null) {
- fDoctypeName = fElementQName.rawname;
- fDoctypePublicId = src.getPublicId();
- fDoctypeSystemId = src.getSystemId();
- // call document handler
- if (fDocumentHandler != null) {
- // This inserts a doctypeDecl event into the stream though no
- // DOCTYPE existed in the instance document.
- fDocumentHandler.doctypeDecl(fDoctypeName, fDoctypePublicId, fDoctypeSystemId, null);
- }
- try {
- fDTDScanner.setInputSource(src);
- while (fDTDScanner.scanDTDExternalSubset(true));
- } finally {
- fEntityManager.setEntityHandler(XMLDocumentScannerImpl.this);
- }
- }
- } // resolveExternalSubsetAndRead()
-
-
-
- } // class ContentDriver
-
- /**
- * Driver to handle trailing miscellaneous section scanning.
- *
- * @author Andy Clark, IBM
- * @author Eric Ye, IBM
- */
- protected final class TrailingMiscDriver
- implements Driver {
-
- //
- // Driver methods
- //
- public int next() throws IOException, XNIException{
- //this could for cases like <foo/>
- //look at scanRootElementHook
- if(fEmptyElement){
- fEmptyElement = false;
- return XMLEvent.END_ELEMENT;
- }
-
- try {
- if(fScannerState == SCANNER_STATE_TERMINATED){
- return XMLEvent.END_DOCUMENT ;}
- do {
- switch (fScannerState) {
- case SCANNER_STATE_TRAILING_MISC: {
-
- fEntityScanner.skipSpaces();
- //we should have reached the end of the document in
- //most cases.
- if(fScannerState == SCANNER_STATE_TERMINATED ){
- return XMLEvent.END_DOCUMENT ;
- }
- if (fEntityScanner.skipChar('<', null)) {
- setScannerState(SCANNER_STATE_START_OF_MARKUP);
- } else {
- setScannerState(SCANNER_STATE_CONTENT);
- }
- break;
- }
- case SCANNER_STATE_START_OF_MARKUP: {
- fMarkupDepth++;
- if (fEntityScanner.skipChar('?', null)) {
- setScannerState(SCANNER_STATE_PI);
- } else if (fEntityScanner.skipChar('!', null)) {
- setScannerState(SCANNER_STATE_COMMENT);
- } else if (fEntityScanner.skipChar('/', null)) {
- reportFatalError("MarkupNotRecognizedInMisc",
- null);
- } else if (isValidNameStartChar(fEntityScanner.peekChar()) ||
- isValidNameStartHighSurrogate(fEntityScanner.peekChar())) {
- reportFatalError("MarkupNotRecognizedInMisc",
- null);
- scanStartElement();
- setScannerState(SCANNER_STATE_CONTENT);
- } else {
- reportFatalError("MarkupNotRecognizedInMisc",
- null);
- }
- break;
- }
- }
- }while(fScannerState == SCANNER_STATE_START_OF_MARKUP || fScannerState == SCANNER_STATE_TRAILING_MISC);
- if(DEBUG_NEXT){
- System.out.println("State set by deciding while loop [TrailingMiscellaneous] is = " + getScannerStateName(fScannerState));
- }
- switch (fScannerState){
- case SCANNER_STATE_PI: {
- fContentBuffer.clear();
- scanPI(fContentBuffer);
- setScannerState(SCANNER_STATE_TRAILING_MISC);
- return XMLEvent.PROCESSING_INSTRUCTION ;
- }
- case SCANNER_STATE_COMMENT: {
- if (!fEntityScanner.skipString(COMMENTSTRING)) {
- reportFatalError("InvalidCommentStart", null);
- }
- scanComment();
- setScannerState(SCANNER_STATE_TRAILING_MISC);
- return XMLEvent.COMMENT;
- }
- case SCANNER_STATE_CONTENT: {
- int ch = fEntityScanner.peekChar();
- if (ch == -1) {
- setScannerState(SCANNER_STATE_TERMINATED);
- return XMLEvent.END_DOCUMENT ;
- } else{
- reportFatalError("ContentIllegalInTrailingMisc",
- null);
- fEntityScanner.scanChar(null);
- setScannerState(SCANNER_STATE_TRAILING_MISC);
- return XMLEvent.CHARACTERS;
- }
-
- }
- case SCANNER_STATE_REFERENCE: {
- reportFatalError("ReferenceIllegalInTrailingMisc",
- null);
- setScannerState(SCANNER_STATE_TRAILING_MISC);
- return XMLEvent.ENTITY_REFERENCE ;
- }
- case SCANNER_STATE_TERMINATED: {
- //there can't be any element after SCANNER_STATE_TERMINATED or when the parser
- //has reached the end of document
- setScannerState(SCANNER_STATE_NO_SUCH_ELEMENT_EXCEPTION);
- //xxx what to do when the scanner has reached the terminating state.
- return XMLEvent.END_DOCUMENT ;
- }
- case SCANNER_STATE_NO_SUCH_ELEMENT_EXCEPTION:{
- throw new java.util.NoSuchElementException("No more events to be parsed");
- }
- default: throw new XNIException("Scanner State " + fScannerState + " not Recognized ");
- }//switch
-
- } catch (EOFException e) {
- // NOTE: This is the only place we're allowed to reach
- // the real end of the document stream. Unless the
- // end of file was reached prematurely.
- if (fMarkupDepth != 0) {
- reportFatalError("PrematureEOF", null);
- return -1;
- //throw e;
- }
- //System.out.println("EOFException thrown") ;
- setScannerState(SCANNER_STATE_TERMINATED);
- }
-
- return XMLEvent.END_DOCUMENT;
-
- }//next
-
- } // class TrailingMiscDriver
-
- /**
- * Implements XMLBufferListener interface.
- */
-
-
- /**
- * receives callbacks from {@link XMLEntityReader } when buffer
- * is being changed.
- * @param refreshPosition
- */
- public void refresh(int refreshPosition){
- super.refresh(refreshPosition);
- if(fReadingDTD){
- Entity entity = fEntityScanner.getCurrentEntity();
- if(entity instanceof Entity.ScannedEntity){
- fEndPos=((Entity.ScannedEntity)entity).position;
- }
- fDTDDecl.append(((Entity.ScannedEntity)entity).ch,fStartPos , fEndPos-fStartPos);
- fStartPos = refreshPosition;
- }
- }
-
-} // class XMLDocumentScannerImpl
diff --git a/src/com/sun/org/apache/xerces/internal/impl/XMLEntityDescription.java b/src/com/sun/org/apache/xerces/internal/impl/XMLEntityDescription.java
deleted file mode 100644
index b94e08a..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/XMLEntityDescription.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl;
-
-import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
-
-/**
- * <p>This interface describes the properties of entities--their
- * physical location and their name.</p>
- *
- * @xerces.internal
- *
- * @author Michael Glavassevich, IBM
- *
- */
-public interface XMLEntityDescription extends XMLResourceIdentifier {
-
- /**
- * Sets the name of the entity.
- *
- * @param name the name of the entity
- */
- public void setEntityName(String name);
-
- /**
- * Returns the name of the entity.
- *
- * @return the name of the entity
- */
- public String getEntityName();
-
-} // XMLEntityDescription
diff --git a/src/com/sun/org/apache/xerces/internal/impl/XMLEntityHandler.java b/src/com/sun/org/apache/xerces/internal/impl/XMLEntityHandler.java
deleted file mode 100644
index a99a749..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/XMLEntityHandler.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2000-2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package com.sun.org.apache.xerces.internal.impl;
-
-import java.io.IOException;
-import com.sun.org.apache.xerces.internal.xni.Augmentations;
-import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-
-/**
- * The entity handler interface defines methods to report information
- * about the start and end of entities.
- *
- * @xerces.internal
- *
- * @see com.sun.org.apache.xerces.internal.impl.XMLEntityScanner
- *
- * @author Andy Clark, IBM
- *
- */
-public interface XMLEntityHandler {
-
- //
- // XMLEntityHandler methods
- //
-
- /**
- * This method notifies of the start of an entity. The DTD has the
- * pseudo-name of "[dtd]" parameter entity names start with '%'; and
- * general entities are just specified by their name.
- *
- * @param name The name of the entity.
- * @param identifier The resource identifier.
- * @param encoding The auto-detected IANA encoding name of the entity
- * stream. This value will be null in those situations
- * where the entity encoding is not auto-detected (e.g.
- * internal entities or a document entity that is
- * parsed from a java.io.Reader).
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startEntity(String name,
- XMLResourceIdentifier identifier,
- String encoding, Augmentations augs) throws XNIException;
-
- /**
- * This method notifies the end of an entity. The DTD has the pseudo-name
- * of "[dtd]" parameter entity names start with '%'; and general entities
- * are just specified by their name.
- *
- * @param name The name of the entity.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws IOException This exception might be thrown when there is premature end of entity
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endEntity(String name, Augmentations augs) throws IOException, XNIException;
-
-} // interface XMLEntityHandler
diff --git a/src/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java b/src/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java
deleted file mode 100644
index 570e2a6..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java
+++ /dev/null
@@ -1,3035 +0,0 @@
-/*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl ;
-
-import com.sun.org.apache.xerces.internal.impl.io.ASCIIReader;
-import com.sun.org.apache.xerces.internal.impl.io.UCSReader;
-import com.sun.org.apache.xerces.internal.impl.io.UTF8Reader;
-import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter;
-import com.sun.org.apache.xerces.internal.impl.validation.ValidationManager;
-import com.sun.org.apache.xerces.internal.util.*;
-import com.sun.org.apache.xerces.internal.util.URI;
-import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
-import com.sun.org.apache.xerces.internal.utils.XMLLimitAnalyzer;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager;
-import com.sun.org.apache.xerces.internal.xni.Augmentations;
-import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.parser.*;
-import com.sun.xml.internal.stream.Entity;
-import com.sun.xml.internal.stream.StaxEntityResolverWrapper;
-import com.sun.xml.internal.stream.StaxXMLInputSource;
-import com.sun.xml.internal.stream.XMLEntityStorage;
-import java.io.*;
-import java.lang.reflect.Method;
-import java.net.HttpURLConnection;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.net.URLConnection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Stack;
-import javax.xml.stream.XMLInputFactory;
-
-
-/**
- * Will keep track of current entity.
- *
- * The entity manager handles the registration of general and parameter
- * entities; resolves entities; and starts entities. The entity manager
- * is a central component in a standard parser configuration and this
- * class works directly with the entity scanner to manage the underlying
- * xni.
- * <p>
- * This component requires the following features and properties from the
- * component manager that uses it:
- * <ul>
- * <li>http://xml.org/sax/features/validation</li>
- * <li>http://xml.org/sax/features/external-general-entities</li>
- * <li>http://xml.org/sax/features/external-parameter-entities</li>
- * <li>http://apache.org/xml/features/allow-java-encodings</li>
- * <li>http://apache.org/xml/properties/internal/symbol-table</li>
- * <li>http://apache.org/xml/properties/internal/error-reporter</li>
- * <li>http://apache.org/xml/properties/internal/entity-resolver</li>
- * </ul>
- *
- *
- * @author Andy Clark, IBM
- * @author Arnaud Le Hors, IBM
- * @author K.Venugopal SUN Microsystems
- * @author Neeraj Bajaj SUN Microsystems
- * @author Sunitha Reddy SUN Microsystems
- * @version $Id: XMLEntityManager.java,v 1.17 2010-11-01 04:39:41 joehw Exp $
- */
-public class XMLEntityManager implements XMLComponent, XMLEntityResolver {
-
- //
- // Constants
- //
-
- /** Default buffer size (2048). */
- public static final int DEFAULT_BUFFER_SIZE = 8192;
-
- /** Default buffer size before we've finished with the XMLDecl: */
- public static final int DEFAULT_XMLDECL_BUFFER_SIZE = 64;
-
- /** Default internal entity buffer size (1024). */
- public static final int DEFAULT_INTERNAL_BUFFER_SIZE = 1024;
-
- // feature identifiers
-
- /** Feature identifier: validation. */
- protected static final String VALIDATION =
- Constants.SAX_FEATURE_PREFIX + Constants.VALIDATION_FEATURE;
-
- /**
- * standard uri conformant (strict uri).
- * http://apache.org/xml/features/standard-uri-conformant
- */
- protected boolean fStrictURI;
-
-
- /** Feature identifier: external general entities. */
- protected static final String EXTERNAL_GENERAL_ENTITIES =
- Constants.SAX_FEATURE_PREFIX + Constants.EXTERNAL_GENERAL_ENTITIES_FEATURE;
-
- /** Feature identifier: external parameter entities. */
- protected static final String EXTERNAL_PARAMETER_ENTITIES =
- Constants.SAX_FEATURE_PREFIX + Constants.EXTERNAL_PARAMETER_ENTITIES_FEATURE;
-
- /** Feature identifier: allow Java encodings. */
- protected static final String ALLOW_JAVA_ENCODINGS =
- Constants.XERCES_FEATURE_PREFIX + Constants.ALLOW_JAVA_ENCODINGS_FEATURE;
-
- /** Feature identifier: warn on duplicate EntityDef */
- protected static final String WARN_ON_DUPLICATE_ENTITYDEF =
- Constants.XERCES_FEATURE_PREFIX +Constants.WARN_ON_DUPLICATE_ENTITYDEF_FEATURE;
-
- /** Feature identifier: load external DTD. */
- protected static final String LOAD_EXTERNAL_DTD =
- Constants.XERCES_FEATURE_PREFIX + Constants.LOAD_EXTERNAL_DTD_FEATURE;
-
- // property identifiers
-
- /** Property identifier: symbol table. */
- protected static final String SYMBOL_TABLE =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY;
-
- /** Property identifier: error reporter. */
- protected static final String ERROR_REPORTER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY;
-
- /** Feature identifier: standard uri conformant */
- protected static final String STANDARD_URI_CONFORMANT =
- Constants.XERCES_FEATURE_PREFIX +Constants.STANDARD_URI_CONFORMANT_FEATURE;
-
- /** Property identifier: entity resolver. */
- protected static final String ENTITY_RESOLVER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_RESOLVER_PROPERTY;
-
- protected static final String STAX_ENTITY_RESOLVER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.STAX_ENTITY_RESOLVER_PROPERTY;
-
- // property identifier: ValidationManager
- protected static final String VALIDATION_MANAGER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.VALIDATION_MANAGER_PROPERTY;
-
- /** property identifier: buffer size. */
- protected static final String BUFFER_SIZE =
- Constants.XERCES_PROPERTY_PREFIX + Constants.BUFFER_SIZE_PROPERTY;
-
- /** property identifier: security manager. */
- protected static final String SECURITY_MANAGER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SECURITY_MANAGER_PROPERTY;
-
- protected static final String PARSER_SETTINGS =
- Constants.XERCES_FEATURE_PREFIX + Constants.PARSER_SETTINGS;
-
- /** Property identifier: Security property manager. */
- private static final String XML_SECURITY_PROPERTY_MANAGER =
- Constants.XML_SECURITY_PROPERTY_MANAGER;
-
- /** access external dtd: file protocol */
- static final String EXTERNAL_ACCESS_DEFAULT = Constants.EXTERNAL_ACCESS_DEFAULT;
-
- // recognized features and properties
-
- /** Recognized features. */
- private static final String[] RECOGNIZED_FEATURES = {
- VALIDATION,
- EXTERNAL_GENERAL_ENTITIES,
- EXTERNAL_PARAMETER_ENTITIES,
- ALLOW_JAVA_ENCODINGS,
- WARN_ON_DUPLICATE_ENTITYDEF,
- STANDARD_URI_CONFORMANT
- };
-
- /** Feature defaults. */
- private static final Boolean[] FEATURE_DEFAULTS = {
- null,
- Boolean.TRUE,
- Boolean.TRUE,
- Boolean.TRUE,
- Boolean.FALSE,
- Boolean.FALSE
- };
-
- /** Recognized properties. */
- private static final String[] RECOGNIZED_PROPERTIES = {
- SYMBOL_TABLE,
- ERROR_REPORTER,
- ENTITY_RESOLVER,
- VALIDATION_MANAGER,
- BUFFER_SIZE,
- SECURITY_MANAGER,
- XML_SECURITY_PROPERTY_MANAGER
- };
-
- /** Property defaults. */
- private static final Object[] PROPERTY_DEFAULTS = {
- null,
- null,
- null,
- null,
- new Integer(DEFAULT_BUFFER_SIZE),
- null,
- null
- };
-
- private static final String XMLEntity = "[xml]".intern();
- private static final String DTDEntity = "[dtd]".intern();
-
- // debugging
-
- /**
- * Debug printing of buffer. This debugging flag works best when you
- * resize the DEFAULT_BUFFER_SIZE down to something reasonable like
- * 64 characters.
- */
- private static final boolean DEBUG_BUFFER = false;
-
- /** warn on duplicate Entity declaration.
- * http://apache.org/xml/features/warn-on-duplicate-entitydef
- */
- protected boolean fWarnDuplicateEntityDef;
-
- /** Debug some basic entities. */
- private static final boolean DEBUG_ENTITIES = false;
-
- /** Debug switching readers for encodings. */
- private static final boolean DEBUG_ENCODINGS = false;
-
- // should be diplayed trace resolving messages
- private static final boolean DEBUG_RESOLVER = false ;
-
- //
- // Data
- //
-
- // features
-
- /**
- * Validation. This feature identifier is:
- * http://xml.org/sax/features/validation
- */
- protected boolean fValidation;
-
- /**
- * External general entities. This feature identifier is:
- * http://xml.org/sax/features/external-general-entities
- */
- protected boolean fExternalGeneralEntities;
-
- /**
- * External parameter entities. This feature identifier is:
- * http://xml.org/sax/features/external-parameter-entities
- */
- protected boolean fExternalParameterEntities;
-
- /**
- * Allow Java encoding names. This feature identifier is:
- * http://apache.org/xml/features/allow-java-encodings
- */
- protected boolean fAllowJavaEncodings = true ;
-
- /** Load external DTD. */
- protected boolean fLoadExternalDTD = true;
-
- // properties
-
- /**
- * Symbol table. This property identifier is:
- * http://apache.org/xml/properties/internal/symbol-table
- */
- protected SymbolTable fSymbolTable;
-
- /**
- * Error reporter. This property identifier is:
- * http://apache.org/xml/properties/internal/error-reporter
- */
- protected XMLErrorReporter fErrorReporter;
-
- /**
- * Entity resolver. This property identifier is:
- * http://apache.org/xml/properties/internal/entity-resolver
- */
- protected XMLEntityResolver fEntityResolver;
-
- /** Stax Entity Resolver. This property identifier is XMLInputFactory.ENTITY_RESOLVER */
-
- protected StaxEntityResolverWrapper fStaxEntityResolver;
-
- /** Property Manager. This is used from Stax */
- protected PropertyManager fPropertyManager ;
-
- /** StAX properties */
- boolean fSupportDTD = true;
- boolean fReplaceEntityReferences = true;
- boolean fSupportExternalEntities = true;
-
- /** used to restrict external access */
- protected String fAccessExternalDTD = EXTERNAL_ACCESS_DEFAULT;
-
- // settings
-
- /**
- * Validation manager. This property identifier is:
- * http://apache.org/xml/properties/internal/validation-manager
- */
- protected ValidationManager fValidationManager;
-
- // settings
-
- /**
- * Buffer size. We get this value from a property. The default size
- * is used if the input buffer size property is not specified.
- * REVISIT: do we need a property for internal entity buffer size?
- */
- protected int fBufferSize = DEFAULT_BUFFER_SIZE;
-
- /** Security Manager */
- protected XMLSecurityManager fSecurityManager = null;
-
- protected XMLLimitAnalyzer fLimitAnalyzer = null;
-
- protected int entityExpansionIndex;
-
- /**
- * True if the document entity is standalone. This should really
- * only be set by the document source (e.g. XMLDocumentScanner).
- */
- protected boolean fStandalone;
-
- // are the entities being parsed in the external subset?
- // NOTE: this *is not* the same as whether they're external entities!
- protected boolean fInExternalSubset = false;
-
-
- // handlers
- /** Entity handler. */
- protected XMLEntityHandler fEntityHandler;
-
- /** Current entity scanner */
- protected XMLEntityScanner fEntityScanner ;
-
- /** XML 1.0 entity scanner. */
- protected XMLEntityScanner fXML10EntityScanner;
-
- /** XML 1.1 entity scanner. */
- protected XMLEntityScanner fXML11EntityScanner;
-
- /** count of entities expanded: */
- protected int fEntityExpansionCount = 0;
-
- // entities
-
- /** Entities. */
- protected Map<String, Entity> fEntities = new HashMap<>();
-
- /** Entity stack. */
- protected Stack<Entity> fEntityStack = new Stack<>();
-
- /** Current entity. */
- protected Entity.ScannedEntity fCurrentEntity = null;
-
- /** identify if the InputSource is created by a resolver */
- boolean fISCreatedByResolver = false;
-
- // shared context
-
- protected XMLEntityStorage fEntityStorage ;
-
- protected final Object [] defaultEncoding = new Object[]{"UTF-8", null};
-
-
- // temp vars
-
- /** Resource identifer. */
- private final XMLResourceIdentifierImpl fResourceIdentifier = new XMLResourceIdentifierImpl();
-
- /** Augmentations for entities. */
- private final Augmentations fEntityAugs = new AugmentationsImpl();
-
- /** Pool of character buffers. */
- private CharacterBufferPool fBufferPool = new CharacterBufferPool(fBufferSize, DEFAULT_INTERNAL_BUFFER_SIZE);
-
- //
- // Constructors
- //
-
- /**
- * If this constructor is used to create the object, reset() should be invoked on this object
- */
- public XMLEntityManager() {
- //for entity managers not created by parsers
- fSecurityManager = new XMLSecurityManager(true);
- fEntityStorage = new XMLEntityStorage(this) ;
- setScannerVersion(Constants.XML_VERSION_1_0);
- } // <init>()
-
- /** Default constructor. */
- public XMLEntityManager(PropertyManager propertyManager) {
- fPropertyManager = propertyManager ;
- //pass a reference to current entity being scanned
- //fEntityStorage = new XMLEntityStorage(fCurrentEntity) ;
- fEntityStorage = new XMLEntityStorage(this) ;
- fEntityScanner = new XMLEntityScanner(propertyManager, this) ;
- reset(propertyManager);
- } // <init>()
-
- /**
- * Adds an internal entity declaration.
- * <p>
- * <strong>Note:</strong> This method ignores subsequent entity
- * declarations.
- * <p>
- * <strong>Note:</strong> The name should be a unique symbol. The
- * SymbolTable can be used for this purpose.
- *
- * @param name The name of the entity.
- * @param text The text of the entity.
- *
- * @see SymbolTable
- */
- public void addInternalEntity(String name, String text) {
- if (!fEntities.containsKey(name)) {
- Entity entity = new Entity.InternalEntity(name, text, fInExternalSubset);
- fEntities.put(name, entity);
- } else{
- if(fWarnDuplicateEntityDef){
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "MSG_DUPLICATE_ENTITY_DEFINITION",
- new Object[]{ name },
- XMLErrorReporter.SEVERITY_WARNING );
- }
- }
-
- } // addInternalEntity(String,String)
-
- /**
- * Adds an external entity declaration.
- * <p>
- * <strong>Note:</strong> This method ignores subsequent entity
- * declarations.
- * <p>
- * <strong>Note:</strong> The name should be a unique symbol. The
- * SymbolTable can be used for this purpose.
- *
- * @param name The name of the entity.
- * @param publicId The public identifier of the entity.
- * @param literalSystemId The system identifier of the entity.
- * @param baseSystemId The base system identifier of the entity.
- * This is the system identifier of the entity
- * where <em>the entity being added</em> and
- * is used to expand the system identifier when
- * the system identifier is a relative URI.
- * When null the system identifier of the first
- * external entity on the stack is used instead.
- *
- * @see SymbolTable
- */
- public void addExternalEntity(String name,
- String publicId, String literalSystemId,
- String baseSystemId) throws IOException {
- if (!fEntities.containsKey(name)) {
- if (baseSystemId == null) {
- // search for the first external entity on the stack
- int size = fEntityStack.size();
- if (size == 0 && fCurrentEntity != null && fCurrentEntity.entityLocation != null) {
- baseSystemId = fCurrentEntity.entityLocation.getExpandedSystemId();
- }
- for (int i = size - 1; i >= 0 ; i--) {
- Entity.ScannedEntity externalEntity =
- (Entity.ScannedEntity)fEntityStack.elementAt(i);
- if (externalEntity.entityLocation != null && externalEntity.entityLocation.getExpandedSystemId() != null) {
- baseSystemId = externalEntity.entityLocation.getExpandedSystemId();
- break;
- }
- }
- }
- Entity entity = new Entity.ExternalEntity(name,
- new XMLEntityDescriptionImpl(name, publicId, literalSystemId, baseSystemId,
- expandSystemId(literalSystemId, baseSystemId, false)), null, fInExternalSubset);
- fEntities.put(name, entity);
- } else{
- if(fWarnDuplicateEntityDef){
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "MSG_DUPLICATE_ENTITY_DEFINITION",
- new Object[]{ name },
- XMLErrorReporter.SEVERITY_WARNING );
- }
- }
-
- } // addExternalEntity(String,String,String,String)
-
-
- /**
- * Adds an unparsed entity declaration.
- * <p>
- * <strong>Note:</strong> This method ignores subsequent entity
- * declarations.
- * <p>
- * <strong>Note:</strong> The name should be a unique symbol. The
- * SymbolTable can be used for this purpose.
- *
- * @param name The name of the entity.
- * @param publicId The public identifier of the entity.
- * @param systemId The system identifier of the entity.
- * @param notation The name of the notation.
- *
- * @see SymbolTable
- */
- public void addUnparsedEntity(String name,
- String publicId, String systemId,
- String baseSystemId, String notation) {
- if (!fEntities.containsKey(name)) {
- Entity.ExternalEntity entity = new Entity.ExternalEntity(name,
- new XMLEntityDescriptionImpl(name, publicId, systemId, baseSystemId, null),
- notation, fInExternalSubset);
- fEntities.put(name, entity);
- } else{
- if(fWarnDuplicateEntityDef){
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "MSG_DUPLICATE_ENTITY_DEFINITION",
- new Object[]{ name },
- XMLErrorReporter.SEVERITY_WARNING );
- }
- }
- } // addUnparsedEntity(String,String,String,String)
-
-
- /** get the entity storage object from entity manager */
- public XMLEntityStorage getEntityStore(){
- return fEntityStorage ;
- }
-
- /** return the entity responsible for reading the entity */
- public XMLEntityScanner getEntityScanner(){
- if(fEntityScanner == null) {
- // default to 1.0
- if(fXML10EntityScanner == null) {
- fXML10EntityScanner = new XMLEntityScanner();
- }
- fXML10EntityScanner.reset(fSymbolTable, this, fErrorReporter);
- fEntityScanner = fXML10EntityScanner;
- }
- return fEntityScanner;
-
- }
-
- public void setScannerVersion(short version) {
-
- if(version == Constants.XML_VERSION_1_0) {
- if(fXML10EntityScanner == null) {
- fXML10EntityScanner = new XMLEntityScanner();
- }
- fXML10EntityScanner.reset(fSymbolTable, this, fErrorReporter);
- fEntityScanner = fXML10EntityScanner;
- fEntityScanner.setCurrentEntity(fCurrentEntity);
- } else {
- if(fXML11EntityScanner == null) {
- fXML11EntityScanner = new XML11EntityScanner();
- }
- fXML11EntityScanner.reset(fSymbolTable, this, fErrorReporter);
- fEntityScanner = fXML11EntityScanner;
- fEntityScanner.setCurrentEntity(fCurrentEntity);
- }
-
- }
-
- /**
- * This method uses the passed-in XMLInputSource to make
- * fCurrentEntity usable for reading.
- *
- * @param reference flag to indicate whether the entity is an Entity Reference.
- * @param name name of the entity (XML is it's the document entity)
- * @param xmlInputSource the input source, with sufficient information
- * to begin scanning characters.
- * @param literal True if this entity is started within a
- * literal value.
- * @param isExternal whether this entity should be treated as an internal or external entity.
- * @throws IOException if anything can't be read
- * XNIException If any parser-specific goes wrong.
- * @return the encoding of the new entity or null if a character stream was employed
- */
- public String setupCurrentEntity(boolean reference, String name, XMLInputSource xmlInputSource,
- boolean literal, boolean isExternal)
- throws IOException, XNIException {
- // get information
-
- final String publicId = xmlInputSource.getPublicId();
- String literalSystemId = xmlInputSource.getSystemId();
- String baseSystemId = xmlInputSource.getBaseSystemId();
- String encoding = xmlInputSource.getEncoding();
- final boolean encodingExternallySpecified = (encoding != null);
- Boolean isBigEndian = null;
-
- // create reader
- InputStream stream = null;
- Reader reader = xmlInputSource.getCharacterStream();
-
- // First chance checking strict URI
- String expandedSystemId = expandSystemId(literalSystemId, baseSystemId, fStrictURI);
- if (baseSystemId == null) {
- baseSystemId = expandedSystemId;
- }
- if (reader == null) {
- stream = xmlInputSource.getByteStream();
- if (stream == null) {
- URL location = new URL(expandedSystemId);
- URLConnection connect = location.openConnection();
- if (!(connect instanceof HttpURLConnection)) {
- stream = connect.getInputStream();
- }
- else {
- boolean followRedirects = true;
-
- // setup URLConnection if we have an HTTPInputSource
- if (xmlInputSource instanceof HTTPInputSource) {
- final HttpURLConnection urlConnection = (HttpURLConnection) connect;
- final HTTPInputSource httpInputSource = (HTTPInputSource) xmlInputSource;
-
- // set request properties
- Iterator<Map.Entry<String, String>> propIter = httpInputSource.getHTTPRequestProperties();
- while (propIter.hasNext()) {
- Map.Entry<String, String> entry = propIter.next();
- urlConnection.setRequestProperty(entry.getKey(), entry.getValue());
- }
-
- // set preference for redirection
- followRedirects = httpInputSource.getFollowHTTPRedirects();
- if (!followRedirects) {
- setInstanceFollowRedirects(urlConnection, followRedirects);
- }
- }
-
- stream = connect.getInputStream();
-
- // REVISIT: If the URLConnection has external encoding
- // information, we should be reading it here. It's located
- // in the charset parameter of Content-Type. -- mrglavas
-
- if (followRedirects) {
- String redirect = connect.getURL().toString();
- // E43: Check if the URL was redirected, and then
- // update literal and expanded system IDs if needed.
- if (!redirect.equals(expandedSystemId)) {
- literalSystemId = redirect;
- expandedSystemId = redirect;
- }
- }
- }
- }
-
- // wrap this stream in RewindableInputStream
- stream = new RewindableInputStream(stream);
-
- // perform auto-detect of encoding if necessary
- if (encoding == null) {
- // read first four bytes and determine encoding
- final byte[] b4 = new byte[4];
- int count = 0;
- for (; count<4; count++ ) {
- b4[count] = (byte)stream.read();
- }
- if (count == 4) {
- Object [] encodingDesc = getEncodingName(b4, count);
- encoding = (String)(encodingDesc[0]);
- isBigEndian = (Boolean)(encodingDesc[1]);
-
- stream.reset();
- // Special case UTF-8 files with BOM created by Microsoft
- // tools. It's more efficient to consume the BOM than make
- // the reader perform extra checks. -Ac
- if (count > 2 && encoding.equals("UTF-8")) {
- int b0 = b4[0] & 0xFF;
- int b1 = b4[1] & 0xFF;
- int b2 = b4[2] & 0xFF;
- if (b0 == 0xEF && b1 == 0xBB && b2 == 0xBF) {
- // ignore first three bytes...
- stream.skip(3);
- }
- }
- reader = createReader(stream, encoding, isBigEndian);
- } else {
- reader = createReader(stream, encoding, isBigEndian);
- }
- }
-
- // use specified encoding
- else {
- encoding = encoding.toUpperCase(Locale.ENGLISH);
-
- // If encoding is UTF-8, consume BOM if one is present.
- if (encoding.equals("UTF-8")) {
- final int[] b3 = new int[3];
- int count = 0;
- for (; count < 3; ++count) {
- b3[count] = stream.read();
- if (b3[count] == -1)
- break;
- }
- if (count == 3) {
- if (b3[0] != 0xEF || b3[1] != 0xBB || b3[2] != 0xBF) {
- // First three bytes are not BOM, so reset.
- stream.reset();
- }
- } else {
- stream.reset();
- }
- }
- // If encoding is UTF-16, we still need to read the first four bytes
- // in order to discover the byte order.
- else if (encoding.equals("UTF-16")) {
- final int[] b4 = new int[4];
- int count = 0;
- for (; count < 4; ++count) {
- b4[count] = stream.read();
- if (b4[count] == -1)
- break;
- }
- stream.reset();
-
- String utf16Encoding = "UTF-16";
- if (count >= 2) {
- final int b0 = b4[0];
- final int b1 = b4[1];
- if (b0 == 0xFE && b1 == 0xFF) {
- // UTF-16, big-endian
- utf16Encoding = "UTF-16BE";
- isBigEndian = Boolean.TRUE;
- }
- else if (b0 == 0xFF && b1 == 0xFE) {
- // UTF-16, little-endian
- utf16Encoding = "UTF-16LE";
- isBigEndian = Boolean.FALSE;
- }
- else if (count == 4) {
- final int b2 = b4[2];
- final int b3 = b4[3];
- if (b0 == 0x00 && b1 == 0x3C && b2 == 0x00 && b3 == 0x3F) {
- // UTF-16, big-endian, no BOM
- utf16Encoding = "UTF-16BE";
- isBigEndian = Boolean.TRUE;
- }
- if (b0 == 0x3C && b1 == 0x00 && b2 == 0x3F && b3 == 0x00) {
- // UTF-16, little-endian, no BOM
- utf16Encoding = "UTF-16LE";
- isBigEndian = Boolean.FALSE;
- }
- }
- }
- reader = createReader(stream, utf16Encoding, isBigEndian);
- }
- // If encoding is UCS-4, we still need to read the first four bytes
- // in order to discover the byte order.
- else if (encoding.equals("ISO-10646-UCS-4")) {
- final int[] b4 = new int[4];
- int count = 0;
- for (; count < 4; ++count) {
- b4[count] = stream.read();
- if (b4[count] == -1)
- break;
- }
- stream.reset();
-
- // Ignore unusual octet order for now.
- if (count == 4) {
- // UCS-4, big endian (1234)
- if (b4[0] == 0x00 && b4[1] == 0x00 && b4[2] == 0x00 && b4[3] == 0x3C) {
- isBigEndian = Boolean.TRUE;
- }
- // UCS-4, little endian (1234)
- else if (b4[0] == 0x3C && b4[1] == 0x00 && b4[2] == 0x00 && b4[3] == 0x00) {
- isBigEndian = Boolean.FALSE;
- }
- }
- }
- // If encoding is UCS-2, we still need to read the first four bytes
- // in order to discover the byte order.
- else if (encoding.equals("ISO-10646-UCS-2")) {
- final int[] b4 = new int[4];
- int count = 0;
- for (; count < 4; ++count) {
- b4[count] = stream.read();
- if (b4[count] == -1)
- break;
- }
- stream.reset();
-
- if (count == 4) {
- // UCS-2, big endian
- if (b4[0] == 0x00 && b4[1] == 0x3C && b4[2] == 0x00 && b4[3] == 0x3F) {
- isBigEndian = Boolean.TRUE;
- }
- // UCS-2, little endian
- else if (b4[0] == 0x3C && b4[1] == 0x00 && b4[2] == 0x3F && b4[3] == 0x00) {
- isBigEndian = Boolean.FALSE;
- }
- }
- }
-
- reader = createReader(stream, encoding, isBigEndian);
- }
-
- // read one character at a time so we don't jump too far
- // ahead, converting characters from the byte stream in
- // the wrong encoding
- if (DEBUG_ENCODINGS) {
- System.out.println("$$$ no longer wrapping reader in OneCharReader");
- }
- //reader = new OneCharReader(reader);
- }
-
- // We've seen a new Reader.
- // Push it on the stack so we can close it later.
- //fOwnReaders.add(reader);
-
- // push entity on stack
- if (fCurrentEntity != null) {
- fEntityStack.push(fCurrentEntity);
- }
-
- // create entity
- /* if encoding is specified externally, 'encoding' information present
- * in the prolog of the XML document is not considered. Hence, prolog can
- * be read in Chunks of data instead of byte by byte.
- */
- fCurrentEntity = new Entity.ScannedEntity(reference, name,
- new XMLResourceIdentifierImpl(publicId, literalSystemId, baseSystemId, expandedSystemId),
- stream, reader, encoding, literal, encodingExternallySpecified, isExternal);
- fCurrentEntity.setEncodingExternallySpecified(encodingExternallySpecified);
- fEntityScanner.setCurrentEntity(fCurrentEntity);
- fResourceIdentifier.setValues(publicId, literalSystemId, baseSystemId, expandedSystemId);
- if (fLimitAnalyzer != null) {
- fLimitAnalyzer.startEntity(name);
- }
- return encoding;
- } //setupCurrentEntity(String, XMLInputSource, boolean, boolean): String
-
-
- /**
- * Checks whether an entity given by name is external.
- *
- * @param entityName The name of the entity to check.
- * @return True if the entity is external, false otherwise
- * (including when the entity is not declared).
- */
- public boolean isExternalEntity(String entityName) {
-
- Entity entity = fEntities.get(entityName);
- if (entity == null) {
- return false;
- }
- return entity.isExternal();
- }
-
- /**
- * Checks whether the declaration of an entity given by name is
- * // in the external subset.
- *
- * @param entityName The name of the entity to check.
- * @return True if the entity was declared in the external subset, false otherwise
- * (including when the entity is not declared).
- */
- public boolean isEntityDeclInExternalSubset(String entityName) {
-
- Entity entity = fEntities.get(entityName);
- if (entity == null) {
- return false;
- }
- return entity.isEntityDeclInExternalSubset();
- }
-
-
-
- //
- // Public methods
- //
-
- /**
- * Sets whether the document entity is standalone.
- *
- * @param standalone True if document entity is standalone.
- */
- public void setStandalone(boolean standalone) {
- fStandalone = standalone;
- }
- // setStandalone(boolean)
-
- /** Returns true if the document entity is standalone. */
- public boolean isStandalone() {
- return fStandalone;
- } //isStandalone():boolean
-
- public boolean isDeclaredEntity(String entityName) {
-
- Entity entity = fEntities.get(entityName);
- return entity != null;
- }
-
- public boolean isUnparsedEntity(String entityName) {
-
- Entity entity = fEntities.get(entityName);
- if (entity == null) {
- return false;
- }
- return entity.isUnparsed();
- }
-
-
-
- // this simply returns the fResourceIdentifier object;
- // this should only be used with caution by callers that
- // carefully manage the entity manager's behaviour, so that
- // this doesn't returning meaningless or misleading data.
- // @return a reference to the current fResourceIdentifier object
- public XMLResourceIdentifier getCurrentResourceIdentifier() {
- return fResourceIdentifier;
- }
-
- /**
- * Sets the entity handler. When an entity starts and ends, the
- * entity handler is notified of the change.
- *
- * @param entityHandler The new entity handler.
- */
-
- public void setEntityHandler(com.sun.org.apache.xerces.internal.impl.XMLEntityHandler entityHandler) {
- fEntityHandler = (XMLEntityHandler) entityHandler;
- } // setEntityHandler(XMLEntityHandler)
-
- //this function returns StaxXMLInputSource
- public StaxXMLInputSource resolveEntityAsPerStax(XMLResourceIdentifier resourceIdentifier) throws java.io.IOException{
-
- if(resourceIdentifier == null ) return null;
-
- String publicId = resourceIdentifier.getPublicId();
- String literalSystemId = resourceIdentifier.getLiteralSystemId();
- String baseSystemId = resourceIdentifier.getBaseSystemId();
- String expandedSystemId = resourceIdentifier.getExpandedSystemId();
- // if no base systemId given, assume that it's relative
- // to the systemId of the current scanned entity
- // Sometimes the system id is not (properly) expanded.
- // We need to expand the system id if:
- // a. the expanded one was null; or
- // b. the base system id was null, but becomes non-null from the current entity.
- boolean needExpand = (expandedSystemId == null);
- // REVISIT: why would the baseSystemId ever be null? if we
- // didn't have to make this check we wouldn't have to reuse the
- // fXMLResourceIdentifier object...
- if (baseSystemId == null && fCurrentEntity != null && fCurrentEntity.entityLocation != null) {
- baseSystemId = fCurrentEntity.entityLocation.getExpandedSystemId();
- if (baseSystemId != null)
- needExpand = true;
- }
- if (needExpand)
- expandedSystemId = expandSystemId(literalSystemId, baseSystemId,false);
-
- // give the entity resolver a chance
- StaxXMLInputSource staxInputSource = null;
- XMLInputSource xmlInputSource = null;
-
- XMLResourceIdentifierImpl ri = null;
-
- if (resourceIdentifier instanceof XMLResourceIdentifierImpl) {
- ri = (XMLResourceIdentifierImpl)resourceIdentifier;
- } else {
- fResourceIdentifier.clear();
- ri = fResourceIdentifier;
- }
- ri.setValues(publicId, literalSystemId, baseSystemId, expandedSystemId);
- if(DEBUG_RESOLVER){
- System.out.println("BEFORE Calling resolveEntity") ;
- }
-
- fISCreatedByResolver = false;
- //either of Stax or Xerces would be null
- if(fStaxEntityResolver != null){
- staxInputSource = fStaxEntityResolver.resolveEntity(ri);
- if(staxInputSource != null) {
- fISCreatedByResolver = true;
- }
- }
-
- if(fEntityResolver != null){
- xmlInputSource = fEntityResolver.resolveEntity(ri);
- if(xmlInputSource != null) {
- fISCreatedByResolver = true;
- }
- }
-
- if(xmlInputSource != null){
- //wrap this XMLInputSource to StaxInputSource
- staxInputSource = new StaxXMLInputSource(xmlInputSource, fISCreatedByResolver);
- }
-
- // do default resolution
- //this works for both stax & Xerces, if staxInputSource is null, it means parser need to revert to default resolution
- if (staxInputSource == null) {
- // REVISIT: when systemId is null, I think we should return null.
- // is this the right solution? -SG
- //if (systemId != null)
- staxInputSource = new StaxXMLInputSource(new XMLInputSource(publicId, literalSystemId, baseSystemId));
- }else if(staxInputSource.hasXMLStreamOrXMLEventReader()){
- //Waiting for the clarification from EG. - nb
- }
-
- if (DEBUG_RESOLVER) {
- System.err.println("XMLEntityManager.resolveEntity(" + publicId + ")");
- System.err.println(" = " + xmlInputSource);
- }
-
- return staxInputSource;
-
- }
-
- /**
- * Resolves the specified public and system identifiers. This
- * method first attempts to resolve the entity based on the
- * EntityResolver registered by the application. If no entity
- * resolver is registered or if the registered entity handler
- * is unable to resolve the entity, then default entity
- * resolution will occur.
- *
- * @param publicId The public identifier of the entity.
- * @param systemId The system identifier of the entity.
- * @param baseSystemId The base system identifier of the entity.
- * This is the system identifier of the current
- * entity and is used to expand the system
- * identifier when the system identifier is a
- * relative URI.
- *
- * @return Returns an input source that wraps the resolved entity.
- * This method will never return null.
- *
- * @throws IOException Thrown on i/o error.
- * @throws XNIException Thrown by entity resolver to signal an error.
- */
- public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier) throws IOException, XNIException {
- if(resourceIdentifier == null ) return null;
- String publicId = resourceIdentifier.getPublicId();
- String literalSystemId = resourceIdentifier.getLiteralSystemId();
- String baseSystemId = resourceIdentifier.getBaseSystemId();
- String expandedSystemId = resourceIdentifier.getExpandedSystemId();
-
- // if no base systemId given, assume that it's relative
- // to the systemId of the current scanned entity
- // Sometimes the system id is not (properly) expanded.
- // We need to expand the system id if:
- // a. the expanded one was null; or
- // b. the base system id was null, but becomes non-null from the current entity.
- boolean needExpand = (expandedSystemId == null);
- // REVISIT: why would the baseSystemId ever be null? if we
- // didn't have to make this check we wouldn't have to reuse the
- // fXMLResourceIdentifier object...
- if (baseSystemId == null && fCurrentEntity != null && fCurrentEntity.entityLocation != null) {
- baseSystemId = fCurrentEntity.entityLocation.getExpandedSystemId();
- if (baseSystemId != null)
- needExpand = true;
- }
- if (needExpand)
- expandedSystemId = expandSystemId(literalSystemId, baseSystemId,false);
-
- // give the entity resolver a chance
- XMLInputSource xmlInputSource = null;
-
- if (fEntityResolver != null) {
- resourceIdentifier.setBaseSystemId(baseSystemId);
- resourceIdentifier.setExpandedSystemId(expandedSystemId);
- xmlInputSource = fEntityResolver.resolveEntity(resourceIdentifier);
- }
-
- // do default resolution
- // REVISIT: what's the correct behavior if the user provided an entity
- // resolver (fEntityResolver != null), but resolveEntity doesn't return
- // an input source (xmlInputSource == null)?
- // do we do default resolution, or do we just return null? -SG
- if (xmlInputSource == null) {
- // REVISIT: when systemId is null, I think we should return null.
- // is this the right solution? -SG
- //if (systemId != null)
- xmlInputSource = new XMLInputSource(publicId, literalSystemId, baseSystemId);
- }
-
- if (DEBUG_RESOLVER) {
- System.err.println("XMLEntityManager.resolveEntity(" + publicId + ")");
- System.err.println(" = " + xmlInputSource);
- }
-
- return xmlInputSource;
-
- } // resolveEntity(XMLResourceIdentifier):XMLInputSource
-
- /**
- * Starts a named entity.
- *
- * @param isGE flag to indicate whether the entity is a General Entity
- * @param entityName The name of the entity to start.
- * @param literal True if this entity is started within a literal
- * value.
- *
- * @throws IOException Thrown on i/o error.
- * @throws XNIException Thrown by entity handler to signal an error.
- */
- public void startEntity(boolean isGE, String entityName, boolean literal)
- throws IOException, XNIException {
-
- // was entity declared?
- Entity entity = fEntityStorage.getEntity(entityName);
- if (entity == null) {
- if (fEntityHandler != null) {
- String encoding = null;
- fResourceIdentifier.clear();
- fEntityAugs.removeAllItems();
- fEntityAugs.putItem(Constants.ENTITY_SKIPPED, Boolean.TRUE);
- fEntityHandler.startEntity(entityName, fResourceIdentifier, encoding, fEntityAugs);
- fEntityAugs.removeAllItems();
- fEntityAugs.putItem(Constants.ENTITY_SKIPPED, Boolean.TRUE);
- fEntityHandler.endEntity(entityName, fEntityAugs);
- }
- return;
- }
-
- // should we skip external entities?
- boolean external = entity.isExternal();
- Entity.ExternalEntity externalEntity = null;
- String extLitSysId = null, extBaseSysId = null, expandedSystemId = null;
- if (external) {
- externalEntity = (Entity.ExternalEntity)entity;
- extLitSysId = (externalEntity.entityLocation != null ? externalEntity.entityLocation.getLiteralSystemId() : null);
- extBaseSysId = (externalEntity.entityLocation != null ? externalEntity.entityLocation.getBaseSystemId() : null);
- expandedSystemId = expandSystemId(extLitSysId, extBaseSysId);
- boolean unparsed = entity.isUnparsed();
- boolean parameter = entityName.startsWith("%");
- boolean general = !parameter;
- if (unparsed || (general && !fExternalGeneralEntities) ||
- (parameter && !fExternalParameterEntities) ||
- !fSupportDTD || !fSupportExternalEntities) {
-
- if (fEntityHandler != null) {
- fResourceIdentifier.clear();
- final String encoding = null;
- fResourceIdentifier.setValues(
- (externalEntity.entityLocation != null ? externalEntity.entityLocation.getPublicId() : null),
- extLitSysId, extBaseSysId, expandedSystemId);
- fEntityAugs.removeAllItems();
- fEntityAugs.putItem(Constants.ENTITY_SKIPPED, Boolean.TRUE);
- fEntityHandler.startEntity(entityName, fResourceIdentifier, encoding, fEntityAugs);
- fEntityAugs.removeAllItems();
- fEntityAugs.putItem(Constants.ENTITY_SKIPPED, Boolean.TRUE);
- fEntityHandler.endEntity(entityName, fEntityAugs);
- }
- return;
- }
- }
-
- // is entity recursive?
- int size = fEntityStack.size();
- for (int i = size; i >= 0; i--) {
- Entity activeEntity = i == size
- ? fCurrentEntity
- : (Entity)fEntityStack.elementAt(i);
- if (activeEntity.name == entityName) {
- String path = entityName;
- for (int j = i + 1; j < size; j++) {
- activeEntity = (Entity)fEntityStack.elementAt(j);
- path = path + " -> " + activeEntity.name;
- }
- path = path + " -> " + fCurrentEntity.name;
- path = path + " -> " + entityName;
- fErrorReporter.reportError(this.getEntityScanner(),XMLMessageFormatter.XML_DOMAIN,
- "RecursiveReference",
- new Object[] { entityName, path },
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
-
- if (fEntityHandler != null) {
- fResourceIdentifier.clear();
- final String encoding = null;
- if (external) {
- fResourceIdentifier.setValues(
- (externalEntity.entityLocation != null ? externalEntity.entityLocation.getPublicId() : null),
- extLitSysId, extBaseSysId, expandedSystemId);
- }
- fEntityAugs.removeAllItems();
- fEntityAugs.putItem(Constants.ENTITY_SKIPPED, Boolean.TRUE);
- fEntityHandler.startEntity(entityName, fResourceIdentifier, encoding, fEntityAugs);
- fEntityAugs.removeAllItems();
- fEntityAugs.putItem(Constants.ENTITY_SKIPPED, Boolean.TRUE);
- fEntityHandler.endEntity(entityName, fEntityAugs);
- }
-
- return;
- }
- }
-
- // resolve external entity
- StaxXMLInputSource staxInputSource = null;
- XMLInputSource xmlInputSource = null ;
-
- if (external) {
- staxInputSource = resolveEntityAsPerStax(externalEntity.entityLocation);
- /** xxx: Waiting from the EG
- * //simply return if there was entity resolver registered and application
- * //returns either XMLStreamReader or XMLEventReader.
- * if(staxInputSource.hasXMLStreamOrXMLEventReader()) return ;
- */
- xmlInputSource = staxInputSource.getXMLInputSource() ;
- if (!fISCreatedByResolver) {
- //let the not-LoadExternalDTD or not-SupportDTD process to handle the situation
- if (fLoadExternalDTD) {
- String accessError = SecuritySupport.checkAccess(expandedSystemId, fAccessExternalDTD, Constants.ACCESS_EXTERNAL_ALL);
- if (accessError != null) {
- fErrorReporter.reportError(this.getEntityScanner(),XMLMessageFormatter.XML_DOMAIN,
- "AccessExternalEntity",
- new Object[] { SecuritySupport.sanitizePath(expandedSystemId), accessError },
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
- }
- }
- }
- // wrap internal entity
- else {
- Entity.InternalEntity internalEntity = (Entity.InternalEntity)entity;
- Reader reader = new StringReader(internalEntity.text);
- xmlInputSource = new XMLInputSource(null, null, null, reader, null);
- }
-
- // start the entity
- startEntity(isGE, entityName, xmlInputSource, literal, external);
-
- } // startEntity(String,boolean)
-
- /**
- * Starts the document entity. The document entity has the "[xml]"
- * pseudo-name.
- *
- * @param xmlInputSource The input source of the document entity.
- *
- * @throws IOException Thrown on i/o error.
- * @throws XNIException Thrown by entity handler to signal an error.
- */
- public void startDocumentEntity(XMLInputSource xmlInputSource)
- throws IOException, XNIException {
- startEntity(false, XMLEntity, xmlInputSource, false, true);
- } // startDocumentEntity(XMLInputSource)
-
- //xxx these methods are not required.
- /**
- * Starts the DTD entity. The DTD entity has the "[dtd]"
- * pseudo-name.
- *
- * @param xmlInputSource The input source of the DTD entity.
- *
- * @throws IOException Thrown on i/o error.
- * @throws XNIException Thrown by entity handler to signal an error.
- */
- public void startDTDEntity(XMLInputSource xmlInputSource)
- throws IOException, XNIException {
- startEntity(false, DTDEntity, xmlInputSource, false, true);
- } // startDTDEntity(XMLInputSource)
-
- // indicate start of external subset so that
- // location of entity decls can be tracked
- public void startExternalSubset() {
- fInExternalSubset = true;
- }
-
- public void endExternalSubset() {
- fInExternalSubset = false;
- }
-
- /**
- * Starts an entity.
- * <p>
- * This method can be used to insert an application defined XML
- * entity stream into the parsing stream.
- *
- * @param isGE flag to indicate whether the entity is a General Entity
- * @param name The name of the entity.
- * @param xmlInputSource The input source of the entity.
- * @param literal True if this entity is started within a
- * literal value.
- * @param isExternal whether this entity should be treated as an internal or external entity.
- *
- * @throws IOException Thrown on i/o error.
- * @throws XNIException Thrown by entity handler to signal an error.
- */
- public void startEntity(boolean isGE, String name,
- XMLInputSource xmlInputSource,
- boolean literal, boolean isExternal)
- throws IOException, XNIException {
-
- String encoding = setupCurrentEntity(isGE, name, xmlInputSource, literal, isExternal);
-
- //when entity expansion limit is set by the Application, we need to
- //check for the entity expansion limit set by the parser, if number of entity
- //expansions exceeds the entity expansion limit, parser will throw fatal error.
- // Note that this represents the nesting level of open entities.
- fEntityExpansionCount++;
- if(fLimitAnalyzer != null) {
- fLimitAnalyzer.addValue(entityExpansionIndex, name, 1);
- }
- if( fSecurityManager != null && fSecurityManager.isOverLimit(entityExpansionIndex, fLimitAnalyzer)){
- fSecurityManager.debugPrint(fLimitAnalyzer);
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,"EntityExpansionLimit",
- new Object[]{fSecurityManager.getLimitValueByIndex(entityExpansionIndex)},
- XMLErrorReporter.SEVERITY_FATAL_ERROR );
- // is there anything better to do than reset the counter?
- // at least one can envision debugging applications where this might
- // be useful...
- fEntityExpansionCount = 0;
- }
-
- // call handler
- if (fEntityHandler != null) {
- fEntityHandler.startEntity(name, fResourceIdentifier, encoding, null);
- }
-
- } // startEntity(String,XMLInputSource)
-
- /**
- * Return the current entity being scanned. Current entity is SET using startEntity function.
- * @return Entity.ScannedEntity
- */
-
- public Entity.ScannedEntity getCurrentEntity(){
- return fCurrentEntity ;
- }
-
- /**
- * Return the top level entity handled by this manager, or null
- * if no entity was added.
- */
- public Entity.ScannedEntity getTopLevelEntity() {
- return (Entity.ScannedEntity)
- (fEntityStack.empty() ? null : fEntityStack.elementAt(0));
- }
-
-
- /**
- * Close all opened InputStreams and Readers opened by this parser.
- */
- public void closeReaders() {
- /** this call actually does nothing, readers are closed in the endEntity method
- * through the current entity.
- * The change seems to have happened during the jdk6 development with the
- * addition of StAX
- **/
- }
-
- public void endEntity() throws IOException, XNIException {
-
- // call handler
- if (DEBUG_BUFFER) {
- System.out.print("(endEntity: ");
- print();
- System.out.println();
- }
- //pop the entity from the stack
- Entity.ScannedEntity entity = fEntityStack.size() > 0 ? (Entity.ScannedEntity)fEntityStack.pop() : null ;
-
- /** need to close the reader first since the program can end
- * prematurely (e.g. fEntityHandler.endEntity may throw exception)
- * leaving the reader open
- */
- //close the reader
- if(fCurrentEntity != null){
- //close the reader
- try{
- if (fLimitAnalyzer != null) {
- fLimitAnalyzer.endEntity(XMLSecurityManager.Limit.GENERAL_ENTITY_SIZE_LIMIT, fCurrentEntity.name);
- if (fCurrentEntity.name.equals("[xml]")) {
- fSecurityManager.debugPrint(fLimitAnalyzer);
- }
- }
- fCurrentEntity.close();
- }catch(IOException ex){
- throw new XNIException(ex);
- }
- }
-
- if (fEntityHandler != null) {
- //so this is the last opened entity, signal it to current fEntityHandler using Augmentation
- if(entity == null){
- fEntityAugs.removeAllItems();
- fEntityAugs.putItem(Constants.LAST_ENTITY, Boolean.TRUE);
- fEntityHandler.endEntity(fCurrentEntity.name, fEntityAugs);
- fEntityAugs.removeAllItems();
- }else{
- fEntityHandler.endEntity(fCurrentEntity.name, null);
- }
- }
- //check if it is a document entity
- boolean documentEntity = fCurrentEntity.name == XMLEntity;
-
- //set popped entity as current entity
- fCurrentEntity = entity;
- fEntityScanner.setCurrentEntity(fCurrentEntity);
-
- //check if there are any entity left in the stack -- if there are
- //no entries EOF has been reached.
- // throw exception when it is the last entity but it is not a document entity
-
- if(fCurrentEntity == null & !documentEntity){
- throw new EOFException() ;
- }
-
- if (DEBUG_BUFFER) {
- System.out.print(")endEntity: ");
- print();
- System.out.println();
- }
-
- } // endEntity()
-
-
- //
- // XMLComponent methods
- //
- public void reset(PropertyManager propertyManager){
- // xerces properties
- fSymbolTable = (SymbolTable)propertyManager.getProperty(Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY);
- fErrorReporter = (XMLErrorReporter)propertyManager.getProperty(Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY);
- try {
- fStaxEntityResolver = (StaxEntityResolverWrapper)propertyManager.getProperty(STAX_ENTITY_RESOLVER);
- } catch (XMLConfigurationException e) {
- fStaxEntityResolver = null;
- }
-
- fSupportDTD = ((Boolean)propertyManager.getProperty(XMLInputFactory.SUPPORT_DTD)).booleanValue();
- fReplaceEntityReferences = ((Boolean)propertyManager.getProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES)).booleanValue();
- fSupportExternalEntities = ((Boolean)propertyManager.getProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES)).booleanValue();
-
- // Zephyr feature ignore-external-dtd is the opposite of Xerces' load-external-dtd
- fLoadExternalDTD = !((Boolean)propertyManager.getProperty(Constants.ZEPHYR_PROPERTY_PREFIX + Constants.IGNORE_EXTERNAL_DTD)).booleanValue();
-
- // JAXP 1.5 feature
- XMLSecurityPropertyManager spm = (XMLSecurityPropertyManager) propertyManager.getProperty(XML_SECURITY_PROPERTY_MANAGER);
- fAccessExternalDTD = spm.getValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD);
-
- fSecurityManager = (XMLSecurityManager)propertyManager.getProperty(SECURITY_MANAGER);
-
- fLimitAnalyzer = new XMLLimitAnalyzer();
- //reset fEntityStorage
- fEntityStorage.reset(propertyManager);
- //reset XMLEntityReaderImpl
- fEntityScanner.reset(propertyManager);
-
- // initialize state
- //fStandalone = false;
- fEntities.clear();
- fEntityStack.removeAllElements();
- fCurrentEntity = null;
- fValidation = false;
- fExternalGeneralEntities = true;
- fExternalParameterEntities = true;
- fAllowJavaEncodings = true ;
- }
-
- /**
- * Resets the component. The component can query the component manager
- * about any features and properties that affect the operation of the
- * component.
- *
- * @param componentManager The component manager.
- *
- * @throws SAXException Thrown by component on initialization error.
- * For example, if a feature or property is
- * required for the operation of the component, the
- * component manager may throw a
- * SAXNotRecognizedException or a
- * SAXNotSupportedException.
- */
- public void reset(XMLComponentManager componentManager)
- throws XMLConfigurationException {
-
- boolean parser_settings = componentManager.getFeature(PARSER_SETTINGS, true);
-
- if (!parser_settings) {
- // parser settings have not been changed
- reset();
- if(fEntityScanner != null){
- fEntityScanner.reset(componentManager);
- }
- if(fEntityStorage != null){
- fEntityStorage.reset(componentManager);
- }
- return;
- }
-
- // sax features
- fValidation = componentManager.getFeature(VALIDATION, false);
- fExternalGeneralEntities = componentManager.getFeature(EXTERNAL_GENERAL_ENTITIES, true);
- fExternalParameterEntities = componentManager.getFeature(EXTERNAL_PARAMETER_ENTITIES, true);
-
- // xerces features
- fAllowJavaEncodings = componentManager.getFeature(ALLOW_JAVA_ENCODINGS, false);
- fWarnDuplicateEntityDef = componentManager.getFeature(WARN_ON_DUPLICATE_ENTITYDEF, false);
- fStrictURI = componentManager.getFeature(STANDARD_URI_CONFORMANT, false);
- fLoadExternalDTD = componentManager.getFeature(LOAD_EXTERNAL_DTD, true);
-
- // xerces properties
- fSymbolTable = (SymbolTable)componentManager.getProperty(SYMBOL_TABLE);
- fErrorReporter = (XMLErrorReporter)componentManager.getProperty(ERROR_REPORTER);
- fEntityResolver = (XMLEntityResolver)componentManager.getProperty(ENTITY_RESOLVER, null);
- fStaxEntityResolver = (StaxEntityResolverWrapper)componentManager.getProperty(STAX_ENTITY_RESOLVER, null);
- fValidationManager = (ValidationManager)componentManager.getProperty(VALIDATION_MANAGER, null);
- fSecurityManager = (XMLSecurityManager)componentManager.getProperty(SECURITY_MANAGER, null);
- entityExpansionIndex = fSecurityManager.getIndex(Constants.JDK_ENTITY_EXPANSION_LIMIT);
-
- //StAX Property
- fSupportDTD = true;
- fReplaceEntityReferences = true;
- fSupportExternalEntities = true;
-
- // JAXP 1.5 feature
- XMLSecurityPropertyManager spm = (XMLSecurityPropertyManager) componentManager.getProperty(XML_SECURITY_PROPERTY_MANAGER, null);
- if (spm == null) {
- spm = new XMLSecurityPropertyManager();
- }
- fAccessExternalDTD = spm.getValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD);
-
- //reset general state
- reset();
-
- fEntityScanner.reset(componentManager);
- fEntityStorage.reset(componentManager);
-
- } // reset(XMLComponentManager)
-
- // reset general state. Should not be called other than by
- // a class acting as a component manager but not
- // implementing that interface for whatever reason.
- public void reset() {
- fLimitAnalyzer = new XMLLimitAnalyzer();
- // initialize state
- fStandalone = false;
- fEntities.clear();
- fEntityStack.removeAllElements();
- fEntityExpansionCount = 0;
-
- fCurrentEntity = null;
- // reset scanner
- if(fXML10EntityScanner != null){
- fXML10EntityScanner.reset(fSymbolTable, this, fErrorReporter);
- }
- if(fXML11EntityScanner != null) {
- fXML11EntityScanner.reset(fSymbolTable, this, fErrorReporter);
- }
-
- // DEBUG
- if (DEBUG_ENTITIES) {
- addInternalEntity("text", "Hello, World.");
- addInternalEntity("empty-element", "<foo/>");
- addInternalEntity("balanced-element", "<foo></foo>");
- addInternalEntity("balanced-element-with-text", "<foo>Hello, World</foo>");
- addInternalEntity("balanced-element-with-entity", "<foo>&text;</foo>");
- addInternalEntity("unbalanced-entity", "<foo>");
- addInternalEntity("recursive-entity", "<foo>&recursive-entity2;</foo>");
- addInternalEntity("recursive-entity2", "<bar>&recursive-entity3;</bar>");
- addInternalEntity("recursive-entity3", "<baz>&recursive-entity;</baz>");
- try {
- addExternalEntity("external-text", null, "external-text.ent", "test/external-text.xml");
- addExternalEntity("external-balanced-element", null, "external-balanced-element.ent", "test/external-balanced-element.xml");
- addExternalEntity("one", null, "ent/one.ent", "test/external-entity.xml");
- addExternalEntity("two", null, "ent/two.ent", "test/ent/one.xml");
- }
- catch (IOException ex) {
- // should never happen
- }
- }
-
- fEntityHandler = null;
-
- // reset scanner
- //if(fEntityScanner!=null)
- // fEntityScanner.reset(fSymbolTable, this,fErrorReporter);
-
- }
- /**
- * Returns a list of feature identifiers that are recognized by
- * this component. This method may return null if no features
- * are recognized by this component.
- */
- public String[] getRecognizedFeatures() {
- return (String[])(RECOGNIZED_FEATURES.clone());
- } // getRecognizedFeatures():String[]
-
- /**
- * Sets the state of a feature. This method is called by the component
- * manager any time after reset when a feature changes state.
- * <p>
- * <strong>Note:</strong> Components should silently ignore features
- * that do not affect the operation of the component.
- *
- * @param featureId The feature identifier.
- * @param state The state of the feature.
- *
- * @throws SAXNotRecognizedException The component should not throw
- * this exception.
- * @throws SAXNotSupportedException The component should not throw
- * this exception.
- */
- public void setFeature(String featureId, boolean state)
- throws XMLConfigurationException {
-
- // xerces features
- if (featureId.startsWith(Constants.XERCES_FEATURE_PREFIX)) {
- final int suffixLength = featureId.length() - Constants.XERCES_FEATURE_PREFIX.length();
- if (suffixLength == Constants.ALLOW_JAVA_ENCODINGS_FEATURE.length() &&
- featureId.endsWith(Constants.ALLOW_JAVA_ENCODINGS_FEATURE)) {
- fAllowJavaEncodings = state;
- }
- if (suffixLength == Constants.LOAD_EXTERNAL_DTD_FEATURE.length() &&
- featureId.endsWith(Constants.LOAD_EXTERNAL_DTD_FEATURE)) {
- fLoadExternalDTD = state;
- return;
- }
- }
-
- } // setFeature(String,boolean)
-
- /**
- * Sets the value of a property. This method is called by the component
- * manager any time after reset when a property changes value.
- * <p>
- * <strong>Note:</strong> Components should silently ignore properties
- * that do not affect the operation of the component.
- *
- * @param propertyId The property identifier.
- * @param value The value of the property.
- *
- * @throws SAXNotRecognizedException The component should not throw
- * this exception.
- * @throws SAXNotSupportedException The component should not throw
- * this exception.
- */
- public void setProperty(String propertyId, Object value){
- // Xerces properties
- if (propertyId.startsWith(Constants.XERCES_PROPERTY_PREFIX)) {
- final int suffixLength = propertyId.length() - Constants.XERCES_PROPERTY_PREFIX.length();
-
- if (suffixLength == Constants.SYMBOL_TABLE_PROPERTY.length() &&
- propertyId.endsWith(Constants.SYMBOL_TABLE_PROPERTY)) {
- fSymbolTable = (SymbolTable)value;
- return;
- }
- if (suffixLength == Constants.ERROR_REPORTER_PROPERTY.length() &&
- propertyId.endsWith(Constants.ERROR_REPORTER_PROPERTY)) {
- fErrorReporter = (XMLErrorReporter)value;
- return;
- }
- if (suffixLength == Constants.ENTITY_RESOLVER_PROPERTY.length() &&
- propertyId.endsWith(Constants.ENTITY_RESOLVER_PROPERTY)) {
- fEntityResolver = (XMLEntityResolver)value;
- return;
- }
- if (suffixLength == Constants.BUFFER_SIZE_PROPERTY.length() &&
- propertyId.endsWith(Constants.BUFFER_SIZE_PROPERTY)) {
- Integer bufferSize = (Integer)value;
- if (bufferSize != null &&
- bufferSize.intValue() > DEFAULT_XMLDECL_BUFFER_SIZE) {
- fBufferSize = bufferSize.intValue();
- fEntityScanner.setBufferSize(fBufferSize);
- fBufferPool.setExternalBufferSize(fBufferSize);
- }
- }
- if (suffixLength == Constants.SECURITY_MANAGER_PROPERTY.length() &&
- propertyId.endsWith(Constants.SECURITY_MANAGER_PROPERTY)) {
- fSecurityManager = (XMLSecurityManager)value;
- }
- }
-
- //JAXP 1.5 properties
- if (propertyId.equals(XML_SECURITY_PROPERTY_MANAGER))
- {
- XMLSecurityPropertyManager spm = (XMLSecurityPropertyManager)value;
- fAccessExternalDTD = spm.getValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD);
- }
- }
-
- public void setLimitAnalyzer(XMLLimitAnalyzer fLimitAnalyzer) {
- this.fLimitAnalyzer = fLimitAnalyzer;
- }
-
- /**
- * Returns a list of property identifiers that are recognized by
- * this component. This method may return null if no properties
- * are recognized by this component.
- */
- public String[] getRecognizedProperties() {
- return (String[])(RECOGNIZED_PROPERTIES.clone());
- } // getRecognizedProperties():String[]
- /**
- * Returns the default state for a feature, or null if this
- * component does not want to report a default value for this
- * feature.
- *
- * @param featureId The feature identifier.
- *
- * @since Xerces 2.2.0
- */
- public Boolean getFeatureDefault(String featureId) {
- for (int i = 0; i < RECOGNIZED_FEATURES.length; i++) {
- if (RECOGNIZED_FEATURES[i].equals(featureId)) {
- return FEATURE_DEFAULTS[i];
- }
- }
- return null;
- } // getFeatureDefault(String):Boolean
-
- /**
- * Returns the default state for a property, or null if this
- * component does not want to report a default value for this
- * property.
- *
- * @param propertyId The property identifier.
- *
- * @since Xerces 2.2.0
- */
- public Object getPropertyDefault(String propertyId) {
- for (int i = 0; i < RECOGNIZED_PROPERTIES.length; i++) {
- if (RECOGNIZED_PROPERTIES[i].equals(propertyId)) {
- return PROPERTY_DEFAULTS[i];
- }
- }
- return null;
- } // getPropertyDefault(String):Object
-
- //
- // Public static methods
- //
-
- /**
- * Expands a system id and returns the system id as a URI, if
- * it can be expanded. A return value of null means that the
- * identifier is already expanded. An exception thrown
- * indicates a failure to expand the id.
- *
- * @param systemId The systemId to be expanded.
- *
- * @return Returns the URI string representing the expanded system
- * identifier. A null value indicates that the given
- * system identifier is already expanded.
- *
- */
- public static String expandSystemId(String systemId) {
- return expandSystemId(systemId, null);
- } // expandSystemId(String):String
-
- //
- // Public static methods
- //
-
- // current value of the "user.dir" property
- private static String gUserDir;
- // cached URI object for the current value of the escaped "user.dir" property stored as a URI
- private static URI gUserDirURI;
- // which ASCII characters need to be escaped
- private static boolean gNeedEscaping[] = new boolean[128];
- // the first hex character if a character needs to be escaped
- private static char gAfterEscaping1[] = new char[128];
- // the second hex character if a character needs to be escaped
- private static char gAfterEscaping2[] = new char[128];
- private static char[] gHexChs = {'0', '1', '2', '3', '4', '5', '6', '7',
- '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
- // initialize the above 3 arrays
- static {
- for (int i = 0; i <= 0x1f; i++) {
- gNeedEscaping[i] = true;
- gAfterEscaping1[i] = gHexChs[i >> 4];
- gAfterEscaping2[i] = gHexChs[i & 0xf];
- }
- gNeedEscaping[0x7f] = true;
- gAfterEscaping1[0x7f] = '7';
- gAfterEscaping2[0x7f] = 'F';
- char[] escChs = {' ', '<', '>', '#', '%', '"', '{', '}',
- '|', '\\', '^', '~', '[', ']', '`'};
- int len = escChs.length;
- char ch;
- for (int i = 0; i < len; i++) {
- ch = escChs[i];
- gNeedEscaping[ch] = true;
- gAfterEscaping1[ch] = gHexChs[ch >> 4];
- gAfterEscaping2[ch] = gHexChs[ch & 0xf];
- }
- }
-
- // To escape the "user.dir" system property, by using %HH to represent
- // special ASCII characters: 0x00~0x1F, 0x7F, ' ', '<', '>', '#', '%'
- // and '"'. It's a static method, so needs to be synchronized.
- // this method looks heavy, but since the system property isn't expected
- // to change often, so in most cases, we only need to return the URI
- // that was escaped before.
- // According to the URI spec, non-ASCII characters (whose value >= 128)
- // need to be escaped too.
- // REVISIT: don't know how to escape non-ASCII characters, especially
- // which encoding to use. Leave them for now.
- private static synchronized URI getUserDir() throws URI.MalformedURIException {
- // get the user.dir property
- String userDir = "";
- try {
- userDir = SecuritySupport.getSystemProperty("user.dir");
- }
- catch (SecurityException se) {
- }
-
- // return empty string if property value is empty string.
- if (userDir.length() == 0)
- return new URI("file", "", "", null, null);
- // compute the new escaped value if the new property value doesn't
- // match the previous one
- if (gUserDirURI != null && userDir.equals(gUserDir)) {
- return gUserDirURI;
- }
-
- // record the new value as the global property value
- gUserDir = userDir;
-
- char separator = java.io.File.separatorChar;
- userDir = userDir.replace(separator, '/');
-
- int len = userDir.length(), ch;
- StringBuffer buffer = new StringBuffer(len*3);
- // change C:/blah to /C:/blah
- if (len >= 2 && userDir.charAt(1) == ':') {
- ch = Character.toUpperCase(userDir.charAt(0));
- if (ch >= 'A' && ch <= 'Z') {
- buffer.append('/');
- }
- }
-
- // for each character in the path
- int i = 0;
- for (; i < len; i++) {
- ch = userDir.charAt(i);
- // if it's not an ASCII character, break here, and use UTF-8 encoding
- if (ch >= 128)
- break;
- if (gNeedEscaping[ch]) {
- buffer.append('%');
- buffer.append(gAfterEscaping1[ch]);
- buffer.append(gAfterEscaping2[ch]);
- // record the fact that it's escaped
- }
- else {
- buffer.append((char)ch);
- }
- }
-
- // we saw some non-ascii character
- if (i < len) {
- // get UTF-8 bytes for the remaining sub-string
- byte[] bytes = null;
- byte b;
- try {
- bytes = userDir.substring(i).getBytes("UTF-8");
- } catch (java.io.UnsupportedEncodingException e) {
- // should never happen
- return new URI("file", "", userDir, null, null);
- }
- len = bytes.length;
-
- // for each byte
- for (i = 0; i < len; i++) {
- b = bytes[i];
- // for non-ascii character: make it positive, then escape
- if (b < 0) {
- ch = b + 256;
- buffer.append('%');
- buffer.append(gHexChs[ch >> 4]);
- buffer.append(gHexChs[ch & 0xf]);
- }
- else if (gNeedEscaping[b]) {
- buffer.append('%');
- buffer.append(gAfterEscaping1[b]);
- buffer.append(gAfterEscaping2[b]);
- }
- else {
- buffer.append((char)b);
- }
- }
- }
-
- // change blah/blah to blah/blah/
- if (!userDir.endsWith("/"))
- buffer.append('/');
-
- gUserDirURI = new URI("file", "", buffer.toString(), null, null);
-
- return gUserDirURI;
- }
-
- /**
- * Absolutizes a URI using the current value
- * of the "user.dir" property as the base URI. If
- * the URI is already absolute, this is a no-op.
- *
- * @param uri the URI to absolutize
- */
- public static void absolutizeAgainstUserDir(URI uri)
- throws URI.MalformedURIException {
- uri.absolutize(getUserDir());
- }
-
- /**
- * Expands a system id and returns the system id as a URI, if
- * it can be expanded. A return value of null means that the
- * identifier is already expanded. An exception thrown
- * indicates a failure to expand the id.
- *
- * @param systemId The systemId to be expanded.
- *
- * @return Returns the URI string representing the expanded system
- * identifier. A null value indicates that the given
- * system identifier is already expanded.
- *
- */
- public static String expandSystemId(String systemId, String baseSystemId) {
-
- // check for bad parameters id
- if (systemId == null || systemId.length() == 0) {
- return systemId;
- }
- // if id already expanded, return
- try {
- URI uri = new URI(systemId);
- if (uri != null) {
- return systemId;
- }
- } catch (URI.MalformedURIException e) {
- // continue on...
- }
- // normalize id
- String id = fixURI(systemId);
-
- // normalize base
- URI base = null;
- URI uri = null;
- try {
- if (baseSystemId == null || baseSystemId.length() == 0 ||
- baseSystemId.equals(systemId)) {
- String dir = getUserDir().toString();
- base = new URI("file", "", dir, null, null);
- } else {
- try {
- base = new URI(fixURI(baseSystemId));
- } catch (URI.MalformedURIException e) {
- if (baseSystemId.indexOf(':') != -1) {
- // for xml schemas we might have baseURI with
- // a specified drive
- base = new URI("file", "", fixURI(baseSystemId), null, null);
- } else {
- String dir = getUserDir().toString();
- dir = dir + fixURI(baseSystemId);
- base = new URI("file", "", dir, null, null);
- }
- }
- }
- // expand id
- uri = new URI(base, id);
- } catch (Exception e) {
- // let it go through
-
- }
-
- if (uri == null) {
- return systemId;
- }
- return uri.toString();
-
- } // expandSystemId(String,String):String
-
- /**
- * Expands a system id and returns the system id as a URI, if
- * it can be expanded. A return value of null means that the
- * identifier is already expanded. An exception thrown
- * indicates a failure to expand the id.
- *
- * @param systemId The systemId to be expanded.
- *
- * @return Returns the URI string representing the expanded system
- * identifier. A null value indicates that the given
- * system identifier is already expanded.
- *
- */
- public static String expandSystemId(String systemId, String baseSystemId,
- boolean strict)
- throws URI.MalformedURIException {
-
- // check if there is a system id before
- // trying to expand it.
- if (systemId == null) {
- return null;
- }
-
- // system id has to be a valid URI
- if (strict) {
- try {
- // if it's already an absolute one, return it
- new URI(systemId);
- return systemId;
- }
- catch (URI.MalformedURIException ex) {
- }
- URI base = null;
- // if there isn't a base uri, use the working directory
- if (baseSystemId == null || baseSystemId.length() == 0) {
- base = new URI("file", "", getUserDir().toString(), null, null);
- }
- // otherwise, use the base uri
- else {
- try {
- base = new URI(baseSystemId);
- }
- catch (URI.MalformedURIException e) {
- // assume "base" is also a relative uri
- String dir = getUserDir().toString();
- dir = dir + baseSystemId;
- base = new URI("file", "", dir, null, null);
- }
- }
- // absolutize the system id using the base
- URI uri = new URI(base, systemId);
- // return the string rep of the new uri (an absolute one)
- return uri.toString();
-
- // if any exception is thrown, it'll get thrown to the caller.
- }
-
- // Assume the URIs are well-formed. If it turns out they're not, try fixing them up.
- try {
- return expandSystemIdStrictOff(systemId, baseSystemId);
- }
- catch (URI.MalformedURIException e) {
- /** Xerces URI rejects unicode, try java.net.URI
- * this is not ideal solution, but it covers known cases which either
- * Xerces URI or java.net.URI can handle alone
- * will file bug against java.net.URI
- */
- try {
- return expandSystemIdStrictOff1(systemId, baseSystemId);
- } catch (URISyntaxException ex) {
- // continue on...
- }
- }
- // check for bad parameters id
- if (systemId.length() == 0) {
- return systemId;
- }
-
- // normalize id
- String id = fixURI(systemId);
-
- // normalize base
- URI base = null;
- URI uri = null;
- try {
- if (baseSystemId == null || baseSystemId.length() == 0 ||
- baseSystemId.equals(systemId)) {
- base = getUserDir();
- }
- else {
- try {
- base = new URI(fixURI(baseSystemId).trim());
- }
- catch (URI.MalformedURIException e) {
- if (baseSystemId.indexOf(':') != -1) {
- // for xml schemas we might have baseURI with
- // a specified drive
- base = new URI("file", "", fixURI(baseSystemId).trim(), null, null);
- }
- else {
- base = new URI(getUserDir(), fixURI(baseSystemId));
- }
- }
- }
- // expand id
- uri = new URI(base, id.trim());
- }
- catch (Exception e) {
- // let it go through
-
- }
-
- if (uri == null) {
- return systemId;
- }
- return uri.toString();
-
- } // expandSystemId(String,String,boolean):String
-
- /**
- * Helper method for expandSystemId(String,String,boolean):String
- */
- private static String expandSystemIdStrictOn(String systemId, String baseSystemId)
- throws URI.MalformedURIException {
-
- URI systemURI = new URI(systemId, true);
- // If it's already an absolute one, return it
- if (systemURI.isAbsoluteURI()) {
- return systemId;
- }
-
- // If there isn't a base URI, use the working directory
- URI baseURI = null;
- if (baseSystemId == null || baseSystemId.length() == 0) {
- baseURI = getUserDir();
- }
- else {
- baseURI = new URI(baseSystemId, true);
- if (!baseURI.isAbsoluteURI()) {
- // assume "base" is also a relative uri
- baseURI.absolutize(getUserDir());
- }
- }
-
- // absolutize the system identifier using the base URI
- systemURI.absolutize(baseURI);
-
- // return the string rep of the new uri (an absolute one)
- return systemURI.toString();
-
- // if any exception is thrown, it'll get thrown to the caller.
-
- } // expandSystemIdStrictOn(String,String):String
-
- /**
- * Attempt to set whether redirects will be followed for an <code>HttpURLConnection</code>.
- * This may fail on earlier JDKs which do not support setting this preference.
- */
- public static void setInstanceFollowRedirects(HttpURLConnection urlCon, boolean followRedirects) {
- try {
- Method method = HttpURLConnection.class.getMethod("setInstanceFollowRedirects", new Class[] {Boolean.TYPE});
- method.invoke(urlCon, new Object[] {followRedirects ? Boolean.TRUE : Boolean.FALSE});
- }
- // setInstanceFollowRedirects doesn't exist.
- catch (Exception exc) {}
- }
-
-
- /**
- * Helper method for expandSystemId(String,String,boolean):String
- */
- private static String expandSystemIdStrictOff(String systemId, String baseSystemId)
- throws URI.MalformedURIException {
-
- URI systemURI = new URI(systemId, true);
- // If it's already an absolute one, return it
- if (systemURI.isAbsoluteURI()) {
- if (systemURI.getScheme().length() > 1) {
- return systemId;
- }
- /**
- * If the scheme's length is only one character,
- * it's likely that this was intended as a file
- * path. Fixing this up in expandSystemId to
- * maintain backwards compatibility.
- */
- throw new URI.MalformedURIException();
- }
-
- // If there isn't a base URI, use the working directory
- URI baseURI = null;
- if (baseSystemId == null || baseSystemId.length() == 0) {
- baseURI = getUserDir();
- }
- else {
- baseURI = new URI(baseSystemId, true);
- if (!baseURI.isAbsoluteURI()) {
- // assume "base" is also a relative uri
- baseURI.absolutize(getUserDir());
- }
- }
-
- // absolutize the system identifier using the base URI
- systemURI.absolutize(baseURI);
-
- // return the string rep of the new uri (an absolute one)
- return systemURI.toString();
-
- // if any exception is thrown, it'll get thrown to the caller.
-
- } // expandSystemIdStrictOff(String,String):String
-
- private static String expandSystemIdStrictOff1(String systemId, String baseSystemId)
- throws URISyntaxException, URI.MalformedURIException {
-
- java.net.URI systemURI = new java.net.URI(systemId);
- // If it's already an absolute one, return it
- if (systemURI.isAbsolute()) {
- if (systemURI.getScheme().length() > 1) {
- return systemId;
- }
- /**
- * If the scheme's length is only one character,
- * it's likely that this was intended as a file
- * path. Fixing this up in expandSystemId to
- * maintain backwards compatibility.
- */
- throw new URISyntaxException(systemId, "the scheme's length is only one character");
- }
-
- // If there isn't a base URI, use the working directory
- URI baseURI = null;
- if (baseSystemId == null || baseSystemId.length() == 0) {
- baseURI = getUserDir();
- }
- else {
- baseURI = new URI(baseSystemId, true);
- if (!baseURI.isAbsoluteURI()) {
- // assume "base" is also a relative uri
- baseURI.absolutize(getUserDir());
- }
- }
-
- // absolutize the system identifier using the base URI
-// systemURI.absolutize(baseURI);
- systemURI = (new java.net.URI(baseURI.toString())).resolve(systemURI);
-
- // return the string rep of the new uri (an absolute one)
- return systemURI.toString();
-
- // if any exception is thrown, it'll get thrown to the caller.
-
- } // expandSystemIdStrictOff(String,String):String
-
- //
- // Protected methods
- //
-
-
- /**
- * Returns the IANA encoding name that is auto-detected from
- * the bytes specified, with the endian-ness of that encoding where appropriate.
- *
- * @param b4 The first four bytes of the input.
- * @param count The number of bytes actually read.
- * @return a 2-element array: the first element, an IANA-encoding string,
- * the second element a Boolean which is true iff the document is big endian, false
- * if it's little-endian, and null if the distinction isn't relevant.
- */
- protected Object[] getEncodingName(byte[] b4, int count) {
-
- if (count < 2) {
- return defaultEncoding;
- }
-
- // UTF-16, with BOM
- int b0 = b4[0] & 0xFF;
- int b1 = b4[1] & 0xFF;
- if (b0 == 0xFE && b1 == 0xFF) {
- // UTF-16, big-endian
- return new Object [] {"UTF-16BE", new Boolean(true)};
- }
- if (b0 == 0xFF && b1 == 0xFE) {
- // UTF-16, little-endian
- return new Object [] {"UTF-16LE", new Boolean(false)};
- }
-
- // default to UTF-8 if we don't have enough bytes to make a
- // good determination of the encoding
- if (count < 3) {
- return defaultEncoding;
- }
-
- // UTF-8 with a BOM
- int b2 = b4[2] & 0xFF;
- if (b0 == 0xEF && b1 == 0xBB && b2 == 0xBF) {
- return defaultEncoding;
- }
-
- // default to UTF-8 if we don't have enough bytes to make a
- // good determination of the encoding
- if (count < 4) {
- return defaultEncoding;
- }
-
- // other encodings
- int b3 = b4[3] & 0xFF;
- if (b0 == 0x00 && b1 == 0x00 && b2 == 0x00 && b3 == 0x3C) {
- // UCS-4, big endian (1234)
- return new Object [] {"ISO-10646-UCS-4", new Boolean(true)};
- }
- if (b0 == 0x3C && b1 == 0x00 && b2 == 0x00 && b3 == 0x00) {
- // UCS-4, little endian (4321)
- return new Object [] {"ISO-10646-UCS-4", new Boolean(false)};
- }
- if (b0 == 0x00 && b1 == 0x00 && b2 == 0x3C && b3 == 0x00) {
- // UCS-4, unusual octet order (2143)
- // REVISIT: What should this be?
- return new Object [] {"ISO-10646-UCS-4", null};
- }
- if (b0 == 0x00 && b1 == 0x3C && b2 == 0x00 && b3 == 0x00) {
- // UCS-4, unusual octect order (3412)
- // REVISIT: What should this be?
- return new Object [] {"ISO-10646-UCS-4", null};
- }
- if (b0 == 0x00 && b1 == 0x3C && b2 == 0x00 && b3 == 0x3F) {
- // UTF-16, big-endian, no BOM
- // (or could turn out to be UCS-2...
- // REVISIT: What should this be?
- return new Object [] {"UTF-16BE", new Boolean(true)};
- }
- if (b0 == 0x3C && b1 == 0x00 && b2 == 0x3F && b3 == 0x00) {
- // UTF-16, little-endian, no BOM
- // (or could turn out to be UCS-2...
- return new Object [] {"UTF-16LE", new Boolean(false)};
- }
- if (b0 == 0x4C && b1 == 0x6F && b2 == 0xA7 && b3 == 0x94) {
- // EBCDIC
- // a la xerces1, return CP037 instead of EBCDIC here
- return new Object [] {"CP037", null};
- }
-
- return defaultEncoding;
-
- } // getEncodingName(byte[],int):Object[]
-
- /**
- * Creates a reader capable of reading the given input stream in
- * the specified encoding.
- *
- * @param inputStream The input stream.
- * @param encoding The encoding name that the input stream is
- * encoded using. If the user has specified that
- * Java encoding names are allowed, then the
- * encoding name may be a Java encoding name;
- * otherwise, it is an ianaEncoding name.
- * @param isBigEndian For encodings (like uCS-4), whose names cannot
- * specify a byte order, this tells whether the order is bigEndian. null menas
- * unknown or not relevant.
- *
- * @return Returns a reader.
- */
- protected Reader createReader(InputStream inputStream, String encoding, Boolean isBigEndian)
- throws IOException {
-
- // normalize encoding name
- if (encoding == null) {
- encoding = "UTF-8";
- }
-
- // try to use an optimized reader
- String ENCODING = encoding.toUpperCase(Locale.ENGLISH);
- if (ENCODING.equals("UTF-8")) {
- if (DEBUG_ENCODINGS) {
- System.out.println("$$$ creating UTF8Reader");
- }
- return new UTF8Reader(inputStream, fBufferSize, fErrorReporter.getMessageFormatter(XMLMessageFormatter.XML_DOMAIN), fErrorReporter.getLocale() );
- }
- if (ENCODING.equals("US-ASCII")) {
- if (DEBUG_ENCODINGS) {
- System.out.println("$$$ creating ASCIIReader");
- }
- return new ASCIIReader(inputStream, fBufferSize, fErrorReporter.getMessageFormatter(XMLMessageFormatter.XML_DOMAIN), fErrorReporter.getLocale());
- }
- if(ENCODING.equals("ISO-10646-UCS-4")) {
- if(isBigEndian != null) {
- boolean isBE = isBigEndian.booleanValue();
- if(isBE) {
- return new UCSReader(inputStream, UCSReader.UCS4BE);
- } else {
- return new UCSReader(inputStream, UCSReader.UCS4LE);
- }
- } else {
- fErrorReporter.reportError(this.getEntityScanner(),XMLMessageFormatter.XML_DOMAIN,
- "EncodingByteOrderUnsupported",
- new Object[] { encoding },
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
- }
- if(ENCODING.equals("ISO-10646-UCS-2")) {
- if(isBigEndian != null) { // sould never happen with this encoding...
- boolean isBE = isBigEndian.booleanValue();
- if(isBE) {
- return new UCSReader(inputStream, UCSReader.UCS2BE);
- } else {
- return new UCSReader(inputStream, UCSReader.UCS2LE);
- }
- } else {
- fErrorReporter.reportError(this.getEntityScanner(),XMLMessageFormatter.XML_DOMAIN,
- "EncodingByteOrderUnsupported",
- new Object[] { encoding },
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
- }
-
- // check for valid name
- boolean validIANA = XMLChar.isValidIANAEncoding(encoding);
- boolean validJava = XMLChar.isValidJavaEncoding(encoding);
- if (!validIANA || (fAllowJavaEncodings && !validJava)) {
- fErrorReporter.reportError(this.getEntityScanner(),XMLMessageFormatter.XML_DOMAIN,
- "EncodingDeclInvalid",
- new Object[] { encoding },
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- // NOTE: AndyH suggested that, on failure, we use ISO Latin 1
- // because every byte is a valid ISO Latin 1 character.
- // It may not translate correctly but if we failed on
- // the encoding anyway, then we're expecting the content
- // of the document to be bad. This will just prevent an
- // invalid UTF-8 sequence to be detected. This is only
- // important when continue-after-fatal-error is turned
- // on. -Ac
- encoding = "ISO-8859-1";
- }
-
- // try to use a Java reader
- String javaEncoding = EncodingMap.getIANA2JavaMapping(ENCODING);
- if (javaEncoding == null) {
- if(fAllowJavaEncodings) {
- javaEncoding = encoding;
- } else {
- fErrorReporter.reportError(this.getEntityScanner(),XMLMessageFormatter.XML_DOMAIN,
- "EncodingDeclInvalid",
- new Object[] { encoding },
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- // see comment above.
- javaEncoding = "ISO8859_1";
- }
- }
- if (DEBUG_ENCODINGS) {
- System.out.print("$$$ creating Java InputStreamReader: encoding="+javaEncoding);
- if (javaEncoding == encoding) {
- System.out.print(" (IANA encoding)");
- }
- System.out.println();
- }
- return new BufferedReader( new InputStreamReader(inputStream, javaEncoding));
-
- } // createReader(InputStream,String, Boolean): Reader
-
-
- /**
- * Return the public identifier for the current document event.
- * <p>
- * The return value is the public identifier of the document
- * entity or of the external parsed entity in which the markup
- * triggering the event appears.
- *
- * @return A string containing the public identifier, or
- * null if none is available.
- */
- public String getPublicId() {
- return (fCurrentEntity != null && fCurrentEntity.entityLocation != null) ? fCurrentEntity.entityLocation.getPublicId() : null;
- } // getPublicId():String
-
- /**
- * Return the expanded system identifier for the current document event.
- * <p>
- * The return value is the expanded system identifier of the document
- * entity or of the external parsed entity in which the markup
- * triggering the event appears.
- * <p>
- * If the system identifier is a URL, the parser must resolve it
- * fully before passing it to the application.
- *
- * @return A string containing the expanded system identifier, or null
- * if none is available.
- */
- public String getExpandedSystemId() {
- if (fCurrentEntity != null) {
- if (fCurrentEntity.entityLocation != null &&
- fCurrentEntity.entityLocation.getExpandedSystemId() != null ) {
- return fCurrentEntity.entityLocation.getExpandedSystemId();
- } else {
- // search for the first external entity on the stack
- int size = fEntityStack.size();
- for (int i = size - 1; i >= 0 ; i--) {
- Entity.ScannedEntity externalEntity =
- (Entity.ScannedEntity)fEntityStack.elementAt(i);
-
- if (externalEntity.entityLocation != null &&
- externalEntity.entityLocation.getExpandedSystemId() != null) {
- return externalEntity.entityLocation.getExpandedSystemId();
- }
- }
- }
- }
- return null;
- } // getExpandedSystemId():String
-
- /**
- * Return the literal system identifier for the current document event.
- * <p>
- * The return value is the literal system identifier of the document
- * entity or of the external parsed entity in which the markup
- * triggering the event appears.
- * <p>
- * @return A string containing the literal system identifier, or null
- * if none is available.
- */
- public String getLiteralSystemId() {
- if (fCurrentEntity != null) {
- if (fCurrentEntity.entityLocation != null &&
- fCurrentEntity.entityLocation.getLiteralSystemId() != null ) {
- return fCurrentEntity.entityLocation.getLiteralSystemId();
- } else {
- // search for the first external entity on the stack
- int size = fEntityStack.size();
- for (int i = size - 1; i >= 0 ; i--) {
- Entity.ScannedEntity externalEntity =
- (Entity.ScannedEntity)fEntityStack.elementAt(i);
-
- if (externalEntity.entityLocation != null &&
- externalEntity.entityLocation.getLiteralSystemId() != null) {
- return externalEntity.entityLocation.getLiteralSystemId();
- }
- }
- }
- }
- return null;
- } // getLiteralSystemId():String
-
- /**
- * Return the line number where the current document event ends.
- * <p>
- * <strong>Warning:</strong> The return value from the method
- * is intended only as an approximation for the sake of error
- * reporting; it is not intended to provide sufficient information
- * to edit the character content of the original XML document.
- * <p>
- * The return value is an approximation of the line number
- * in the document entity or external parsed entity where the
- * markup triggering the event appears.
- * <p>
- * If possible, the SAX driver should provide the line position
- * of the first character after the text associated with the document
- * event. The first line in the document is line 1.
- *
- * @return The line number, or -1 if none is available.
- */
- public int getLineNumber() {
- if (fCurrentEntity != null) {
- if (fCurrentEntity.isExternal()) {
- return fCurrentEntity.lineNumber;
- } else {
- // search for the first external entity on the stack
- int size = fEntityStack.size();
- for (int i=size-1; i>0 ; i--) {
- Entity.ScannedEntity firstExternalEntity = (Entity.ScannedEntity)fEntityStack.elementAt(i);
- if (firstExternalEntity.isExternal()) {
- return firstExternalEntity.lineNumber;
- }
- }
- }
- }
-
- return -1;
-
- } // getLineNumber():int
-
- /**
- * Return the column number where the current document event ends.
- * <p>
- * <strong>Warning:</strong> The return value from the method
- * is intended only as an approximation for the sake of error
- * reporting; it is not intended to provide sufficient information
- * to edit the character content of the original XML document.
- * <p>
- * The return value is an approximation of the column number
- * in the document entity or external parsed entity where the
- * markup triggering the event appears.
- * <p>
- * If possible, the SAX driver should provide the line position
- * of the first character after the text associated with the document
- * event.
- * <p>
- * If possible, the SAX driver should provide the line position
- * of the first character after the text associated with the document
- * event. The first column in each line is column 1.
- *
- * @return The column number, or -1 if none is available.
- */
- public int getColumnNumber() {
- if (fCurrentEntity != null) {
- if (fCurrentEntity.isExternal()) {
- return fCurrentEntity.columnNumber;
- } else {
- // search for the first external entity on the stack
- int size = fEntityStack.size();
- for (int i=size-1; i>0 ; i--) {
- Entity.ScannedEntity firstExternalEntity = (Entity.ScannedEntity)fEntityStack.elementAt(i);
- if (firstExternalEntity.isExternal()) {
- return firstExternalEntity.columnNumber;
- }
- }
- }
- }
-
- return -1;
- } // getColumnNumber():int
-
-
- //
- // Protected static methods
- //
-
- /**
- * Fixes a platform dependent filename to standard URI form.
- *
- * @param str The string to fix.
- *
- * @return Returns the fixed URI string.
- */
- protected static String fixURI(String str) {
-
- // handle platform dependent strings
- str = str.replace(java.io.File.separatorChar, '/');
-
- // Windows fix
- if (str.length() >= 2) {
- char ch1 = str.charAt(1);
- // change "C:blah" to "/C:blah"
- if (ch1 == ':') {
- char ch0 = Character.toUpperCase(str.charAt(0));
- if (ch0 >= 'A' && ch0 <= 'Z') {
- str = "/" + str;
- }
- }
- // change "//blah" to "file://blah"
- else if (ch1 == '/' && str.charAt(0) == '/') {
- str = "file:" + str;
- }
- }
-
- // replace spaces in file names with %20.
- // Original comment from JDK5: the following algorithm might not be
- // very performant, but people who want to use invalid URI's have to
- // pay the price.
- int pos = str.indexOf(' ');
- if (pos >= 0) {
- StringBuilder sb = new StringBuilder(str.length());
- // put characters before ' ' into the string builder
- for (int i = 0; i < pos; i++)
- sb.append(str.charAt(i));
- // and %20 for the space
- sb.append("%20");
- // for the remamining part, also convert ' ' to "%20".
- for (int i = pos+1; i < str.length(); i++) {
- if (str.charAt(i) == ' ')
- sb.append("%20");
- else
- sb.append(str.charAt(i));
- }
- str = sb.toString();
- }
-
- // done
- return str;
-
- } // fixURI(String):String
-
-
- //
- // Package visible methods
- //
- /** Prints the contents of the buffer. */
- final void print() {
- if (DEBUG_BUFFER) {
- if (fCurrentEntity != null) {
- System.out.print('[');
- System.out.print(fCurrentEntity.count);
- System.out.print(' ');
- System.out.print(fCurrentEntity.position);
- if (fCurrentEntity.count > 0) {
- System.out.print(" \"");
- for (int i = 0; i < fCurrentEntity.count; i++) {
- if (i == fCurrentEntity.position) {
- System.out.print('^');
- }
- char c = fCurrentEntity.ch[i];
- switch (c) {
- case '\n': {
- System.out.print("\\n");
- break;
- }
- case '\r': {
- System.out.print("\\r");
- break;
- }
- case '\t': {
- System.out.print("\\t");
- break;
- }
- case '\\': {
- System.out.print("\\\\");
- break;
- }
- default: {
- System.out.print(c);
- }
- }
- }
- if (fCurrentEntity.position == fCurrentEntity.count) {
- System.out.print('^');
- }
- System.out.print('"');
- }
- System.out.print(']');
- System.out.print(" @ ");
- System.out.print(fCurrentEntity.lineNumber);
- System.out.print(',');
- System.out.print(fCurrentEntity.columnNumber);
- } else {
- System.out.print("*NO CURRENT ENTITY*");
- }
- }
- } // print()
-
- /**
- * Buffer used in entity manager to reuse character arrays instead
- * of creating new ones every time.
- *
- * @xerces.internal
- *
- * @author Ankit Pasricha, IBM
- */
- private static class CharacterBuffer {
-
- /** character buffer */
- private char[] ch;
-
- /** whether the buffer is for an external or internal scanned entity */
- private boolean isExternal;
-
- public CharacterBuffer(boolean isExternal, int size) {
- this.isExternal = isExternal;
- ch = new char[size];
- }
- }
-
-
- /**
- * Stores a number of character buffers and provides it to the entity
- * manager to use when an entity is seen.
- *
- * @xerces.internal
- *
- * @author Ankit Pasricha, IBM
- */
- private static class CharacterBufferPool {
-
- private static final int DEFAULT_POOL_SIZE = 3;
-
- private CharacterBuffer[] fInternalBufferPool;
- private CharacterBuffer[] fExternalBufferPool;
-
- private int fExternalBufferSize;
- private int fInternalBufferSize;
- private int poolSize;
-
- private int fInternalTop;
- private int fExternalTop;
-
- public CharacterBufferPool(int externalBufferSize, int internalBufferSize) {
- this(DEFAULT_POOL_SIZE, externalBufferSize, internalBufferSize);
- }
-
- public CharacterBufferPool(int poolSize, int externalBufferSize, int internalBufferSize) {
- fExternalBufferSize = externalBufferSize;
- fInternalBufferSize = internalBufferSize;
- this.poolSize = poolSize;
- init();
- }
-
- /** Initializes buffer pool. **/
- private void init() {
- fInternalBufferPool = new CharacterBuffer[poolSize];
- fExternalBufferPool = new CharacterBuffer[poolSize];
- fInternalTop = -1;
- fExternalTop = -1;
- }
-
- /** Retrieves buffer from pool. **/
- public CharacterBuffer getBuffer(boolean external) {
- if (external) {
- if (fExternalTop > -1) {
- return (CharacterBuffer)fExternalBufferPool[fExternalTop--];
- }
- else {
- return new CharacterBuffer(true, fExternalBufferSize);
- }
- }
- else {
- if (fInternalTop > -1) {
- return (CharacterBuffer)fInternalBufferPool[fInternalTop--];
- }
- else {
- return new CharacterBuffer(false, fInternalBufferSize);
- }
- }
- }
-
- /** Returns buffer to pool. **/
- public void returnToPool(CharacterBuffer buffer) {
- if (buffer.isExternal) {
- if (fExternalTop < fExternalBufferPool.length - 1) {
- fExternalBufferPool[++fExternalTop] = buffer;
- }
- }
- else if (fInternalTop < fInternalBufferPool.length - 1) {
- fInternalBufferPool[++fInternalTop] = buffer;
- }
- }
-
- /** Sets the size of external buffers and dumps the old pool. **/
- public void setExternalBufferSize(int bufferSize) {
- fExternalBufferSize = bufferSize;
- fExternalBufferPool = new CharacterBuffer[poolSize];
- fExternalTop = -1;
- }
- }
-
- /**
- * This class wraps the byte inputstreams we're presented with.
- * We need it because java.io.InputStreams don't provide
- * functionality to reread processed bytes, and they have a habit
- * of reading more than one character when you call their read()
- * methods. This means that, once we discover the true (declared)
- * encoding of a document, we can neither backtrack to read the
- * whole doc again nor start reading where we are with a new
- * reader.
- *
- * This class allows rewinding an inputStream by allowing a mark
- * to be set, and the stream reset to that position. <strong>The
- * class assumes that it needs to read one character per
- * invocation when it's read() method is inovked, but uses the
- * underlying InputStream's read(char[], offset length) method--it
- * won't buffer data read this way!</strong>
- *
- * @xerces.internal
- *
- * @author Neil Graham, IBM
- * @author Glenn Marcy, IBM
- */
-
- protected final class RewindableInputStream extends InputStream {
-
- private InputStream fInputStream;
- private byte[] fData;
- private int fStartOffset;
- private int fEndOffset;
- private int fOffset;
- private int fLength;
- private int fMark;
-
- public RewindableInputStream(InputStream is) {
- fData = new byte[DEFAULT_XMLDECL_BUFFER_SIZE];
- fInputStream = is;
- fStartOffset = 0;
- fEndOffset = -1;
- fOffset = 0;
- fLength = 0;
- fMark = 0;
- }
-
- public void setStartOffset(int offset) {
- fStartOffset = offset;
- }
-
- public void rewind() {
- fOffset = fStartOffset;
- }
-
- public int read() throws IOException {
- int b = 0;
- if (fOffset < fLength) {
- return fData[fOffset++] & 0xff;
- }
- if (fOffset == fEndOffset) {
- return -1;
- }
- if (fOffset == fData.length) {
- byte[] newData = new byte[fOffset << 1];
- System.arraycopy(fData, 0, newData, 0, fOffset);
- fData = newData;
- }
- b = fInputStream.read();
- if (b == -1) {
- fEndOffset = fOffset;
- return -1;
- }
- fData[fLength++] = (byte)b;
- fOffset++;
- return b & 0xff;
- }
-
- public int read(byte[] b, int off, int len) throws IOException {
- int bytesLeft = fLength - fOffset;
- if (bytesLeft == 0) {
- if (fOffset == fEndOffset) {
- return -1;
- }
-
- /**
- * //System.out.println("fCurrentEntitty = " + fCurrentEntity );
- * //System.out.println("fInputStream = " + fInputStream );
- * // better get some more for the voracious reader... */
-
- if(fCurrentEntity.mayReadChunks || !fCurrentEntity.xmlDeclChunkRead) {
-
- if (!fCurrentEntity.xmlDeclChunkRead)
- {
- fCurrentEntity.xmlDeclChunkRead = true;
- len = Entity.ScannedEntity.DEFAULT_XMLDECL_BUFFER_SIZE;
- }
- return fInputStream.read(b, off, len);
- }
-
- int returnedVal = read();
- if(returnedVal == -1) {
- fEndOffset = fOffset;
- return -1;
- }
- b[off] = (byte)returnedVal;
- return 1;
-
- }
- if (len < bytesLeft) {
- if (len <= 0) {
- return 0;
- }
- } else {
- len = bytesLeft;
- }
- if (b != null) {
- System.arraycopy(fData, fOffset, b, off, len);
- }
- fOffset += len;
- return len;
- }
-
- public long skip(long n)
- throws IOException {
- int bytesLeft;
- if (n <= 0) {
- return 0;
- }
- bytesLeft = fLength - fOffset;
- if (bytesLeft == 0) {
- if (fOffset == fEndOffset) {
- return 0;
- }
- return fInputStream.skip(n);
- }
- if (n <= bytesLeft) {
- fOffset += n;
- return n;
- }
- fOffset += bytesLeft;
- if (fOffset == fEndOffset) {
- return bytesLeft;
- }
- n -= bytesLeft;
- /*
- * In a manner of speaking, when this class isn't permitting more
- * than one byte at a time to be read, it is "blocking". The
- * available() method should indicate how much can be read without
- * blocking, so while we're in this mode, it should only indicate
- * that bytes in its buffer are available; otherwise, the result of
- * available() on the underlying InputStream is appropriate.
- */
- return fInputStream.skip(n) + bytesLeft;
- }
-
- public int available() throws IOException {
- int bytesLeft = fLength - fOffset;
- if (bytesLeft == 0) {
- if (fOffset == fEndOffset) {
- return -1;
- }
- return fCurrentEntity.mayReadChunks ? fInputStream.available()
- : 0;
- }
- return bytesLeft;
- }
-
- public void mark(int howMuch) {
- fMark = fOffset;
- }
-
- public void reset() {
- fOffset = fMark;
- //test();
- }
-
- public boolean markSupported() {
- return true;
- }
-
- public void close() throws IOException {
- if (fInputStream != null) {
- fInputStream.close();
- fInputStream = null;
- }
- }
- } // end of RewindableInputStream class
-
- public void test(){
- //System.out.println("TESTING: Added familytree to entityManager");
- //Usecase1
- fEntityStorage.addExternalEntity("entityUsecase1",null,
- "/space/home/stax/sun/6thJan2004/zephyr/data/test.txt",
- "/space/home/stax/sun/6thJan2004/zephyr/data/entity.xml");
-
- //Usecase2
- fEntityStorage.addInternalEntity("entityUsecase2","<Test>value</Test>");
- fEntityStorage.addInternalEntity("entityUsecase3","value3");
- fEntityStorage.addInternalEntity("text", "Hello World.");
- fEntityStorage.addInternalEntity("empty-element", "<foo/>");
- fEntityStorage.addInternalEntity("balanced-element", "<foo></foo>");
- fEntityStorage.addInternalEntity("balanced-element-with-text", "<foo>Hello, World</foo>");
- fEntityStorage.addInternalEntity("balanced-element-with-entity", "<foo>&text;</foo>");
- fEntityStorage.addInternalEntity("unbalanced-entity", "<foo>");
- fEntityStorage.addInternalEntity("recursive-entity", "<foo>&recursive-entity2;</foo>");
- fEntityStorage.addInternalEntity("recursive-entity2", "<bar>&recursive-entity3;</bar>");
- fEntityStorage.addInternalEntity("recursive-entity3", "<baz>&recursive-entity;</baz>");
- fEntityStorage.addInternalEntity("ch","&#x00A9;");
- fEntityStorage.addInternalEntity("ch1","&#84;");
- fEntityStorage.addInternalEntity("% ch2","param");
- }
-
-} // class XMLEntityManager
diff --git a/src/com/sun/org/apache/xerces/internal/impl/XMLEntityScanner.java b/src/com/sun/org/apache/xerces/internal/impl/XMLEntityScanner.java
deleted file mode 100644
index ff02bba..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/XMLEntityScanner.java
+++ /dev/null
@@ -1,2318 +0,0 @@
-/*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl;
-
-
-import com.sun.org.apache.xerces.internal.impl.XMLScanner.NameType;
-import com.sun.org.apache.xerces.internal.impl.io.ASCIIReader;
-import com.sun.org.apache.xerces.internal.impl.io.UCSReader;
-import com.sun.org.apache.xerces.internal.impl.io.UTF8Reader;
-import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter;
-import com.sun.org.apache.xerces.internal.util.EncodingMap;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.util.XMLChar;
-import com.sun.org.apache.xerces.internal.util.XMLStringBuffer;
-import com.sun.org.apache.xerces.internal.utils.XMLLimitAnalyzer;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager.Limit;
-import com.sun.org.apache.xerces.internal.xni.*;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-import com.sun.xml.internal.stream.Entity;
-import com.sun.xml.internal.stream.Entity.ScannedEntity;
-import com.sun.xml.internal.stream.XMLBufferListener;
-import java.io.EOFException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.util.ArrayList;
-import java.util.Locale;
-
-/**
- * Implements the entity scanner methods.
- *
- * @author Neeraj Bajaj, Sun Microsystems
- * @author Andy Clark, IBM
- * @author Arnaud Le Hors, IBM
- * @author K.Venugopal Sun Microsystems
- *
- */
-public class XMLEntityScanner implements XMLLocator {
-
- protected Entity.ScannedEntity fCurrentEntity = null;
- protected int fBufferSize = XMLEntityManager.DEFAULT_BUFFER_SIZE;
-
- protected XMLEntityManager fEntityManager;
-
- /** Security manager. */
- protected XMLSecurityManager fSecurityManager = null;
-
- /** Limit analyzer. */
- protected XMLLimitAnalyzer fLimitAnalyzer = null;
-
- /** Debug switching readers for encodings. */
- private static final boolean DEBUG_ENCODINGS = false;
-
- /** Listeners which should know when load is being called */
- private ArrayList<XMLBufferListener> listeners = new ArrayList<>();
-
- private static final boolean [] VALID_NAMES = new boolean[127];
-
- /**
- * Debug printing of buffer. This debugging flag works best when you
- * resize the DEFAULT_BUFFER_SIZE down to something reasonable like
- * 64 characters.
- */
- private static final boolean DEBUG_BUFFER = false;
- private static final boolean DEBUG_SKIP_STRING = false;
- /**
- * To signal the end of the document entity, this exception will be thrown.
- */
- private static final EOFException END_OF_DOCUMENT_ENTITY = new EOFException() {
- private static final long serialVersionUID = 980337771224675268L;
- public Throwable fillInStackTrace() {
- return this;
- }
- };
-
- protected SymbolTable fSymbolTable = null;
- protected XMLErrorReporter fErrorReporter = null;
- int [] whiteSpaceLookup = new int[100];
- int whiteSpaceLen = 0;
- boolean whiteSpaceInfoNeeded = true;
-
- /**
- * Allow Java encoding names. This feature identifier is:
- * http://apache.org/xml/features/allow-java-encodings
- */
- protected boolean fAllowJavaEncodings;
-
- //Will be used only during internal subsets.
- //for appending data.
-
- /** Property identifier: symbol table. */
- protected static final String SYMBOL_TABLE =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY;
-
- /** Property identifier: error reporter. */
- protected static final String ERROR_REPORTER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY;
-
- /** Feature identifier: allow Java encodings. */
- protected static final String ALLOW_JAVA_ENCODINGS =
- Constants.XERCES_FEATURE_PREFIX + Constants.ALLOW_JAVA_ENCODINGS_FEATURE;
-
- protected PropertyManager fPropertyManager = null ;
-
- boolean isExternal = false;
- static {
-
- for(int i=0x0041;i<=0x005A ; i++){
- VALID_NAMES[i]=true;
- }
- for(int i=0x0061;i<=0x007A; i++){
- VALID_NAMES[i]=true;
- }
- for(int i=0x0030;i<=0x0039; i++){
- VALID_NAMES[i]=true;
- }
- VALID_NAMES[45]=true;
- VALID_NAMES[46]=true;
- VALID_NAMES[58]=true;
- VALID_NAMES[95]=true;
- }
-
- // Remember, that the XML version has explicitly been set,
- // so that XMLStreamReader.getVersion() can find that out.
- protected boolean xmlVersionSetExplicitly = false;
-
- // indicates that the operation is for detecting XML version
- boolean detectingVersion = false;
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- public XMLEntityScanner() {
- } // <init>()
-
-
- /** private constructor, this class can only be instantiated within this class. Instance of this class should
- * be obtained using getEntityScanner() or getEntityScanner(ScannedEntity scannedEntity)
- * @see getEntityScanner()
- * @see getEntityScanner(ScannedEntity)
- */
- public XMLEntityScanner(PropertyManager propertyManager, XMLEntityManager entityManager) {
- fEntityManager = entityManager ;
- reset(propertyManager);
- } // <init>()
-
-
- // set buffer size:
- public final void setBufferSize(int size) {
- // REVISIT: Buffer size passed to entity scanner
- // was not being kept in synch with the actual size
- // of the buffers in each scanned entity. If any
- // of the buffers were actually resized, it was possible
- // that the parser would throw an ArrayIndexOutOfBoundsException
- // for documents which contained names which are longer than
- // the current buffer size. Conceivably the buffer size passed
- // to entity scanner could be used to determine a minimum size
- // for resizing, if doubling its size is smaller than this
- // minimum. -- mrglavas
- fBufferSize = size;
- }
-
- /**
- * Resets the components.
- */
- public void reset(PropertyManager propertyManager){
- fSymbolTable = (SymbolTable)propertyManager.getProperty(SYMBOL_TABLE) ;
- fErrorReporter = (XMLErrorReporter)propertyManager.getProperty(ERROR_REPORTER) ;
- resetCommon();
- }
-
- /**
- * Resets the component. The component can query the component manager
- * about any features and properties that affect the operation of the
- * component.
- *
- * @param componentManager The component manager.
- *
- * @throws SAXException Thrown by component on initialization error.
- * For example, if a feature or property is
- * required for the operation of the component, the
- * component manager may throw a
- * SAXNotRecognizedException or a
- * SAXNotSupportedException.
- */
- public void reset(XMLComponentManager componentManager)
- throws XMLConfigurationException {
- // xerces features
- fAllowJavaEncodings = componentManager.getFeature(ALLOW_JAVA_ENCODINGS, false);
-
- //xerces properties
- fSymbolTable = (SymbolTable)componentManager.getProperty(SYMBOL_TABLE);
- fErrorReporter = (XMLErrorReporter)componentManager.getProperty(ERROR_REPORTER);
- resetCommon();
- } // reset(XMLComponentManager)
-
-
- public final void reset(SymbolTable symbolTable, XMLEntityManager entityManager,
- XMLErrorReporter reporter) {
- fCurrentEntity = null;
- fSymbolTable = symbolTable;
- fEntityManager = entityManager;
- fErrorReporter = reporter;
- fLimitAnalyzer = fEntityManager.fLimitAnalyzer;
- fSecurityManager = fEntityManager.fSecurityManager;
- }
-
- private void resetCommon() {
- fCurrentEntity = null;
- whiteSpaceLen = 0;
- whiteSpaceInfoNeeded = true;
- listeners.clear();
- fLimitAnalyzer = fEntityManager.fLimitAnalyzer;
- fSecurityManager = fEntityManager.fSecurityManager;
- }
-
- /**
- * Returns the XML version of the current entity. This will normally be the
- * value from the XML or text declaration or defaulted by the parser. Note that
- * that this value may be different than the version of the processing rules
- * applied to the current entity. For instance, an XML 1.1 document may refer to
- * XML 1.0 entities. In such a case the rules of XML 1.1 are applied to the entire
- * document. Also note that, for a given entity, this value can only be considered
- * final once the XML or text declaration has been read or once it has been
- * determined that there is no such declaration.
- */
- public final String getXMLVersion() {
- if (fCurrentEntity != null) {
- return fCurrentEntity.xmlVersion;
- }
- return null;
- } // getXMLVersion():String
-
- /**
- * Sets the XML version. This method is used by the
- * scanners to report the value of the version pseudo-attribute
- * in an XML or text declaration.
- *
- * @param xmlVersion the XML version of the current entity
- */
- public final void setXMLVersion(String xmlVersion) {
- xmlVersionSetExplicitly = true;
- fCurrentEntity.xmlVersion = xmlVersion;
- } // setXMLVersion(String)
-
-
- /** set the instance of current scanned entity.
- * @param ScannedEntity
- */
-
- public final void setCurrentEntity(Entity.ScannedEntity scannedEntity){
- fCurrentEntity = scannedEntity ;
- if(fCurrentEntity != null){
- isExternal = fCurrentEntity.isExternal();
- if(DEBUG_BUFFER)
- System.out.println("Current Entity is "+scannedEntity.name);
- }
- }
-
- public Entity.ScannedEntity getCurrentEntity(){
- return fCurrentEntity ;
- }
- //
- // XMLEntityReader methods
- //
-
- /**
- * Returns the base system identifier of the currently scanned
- * entity, or null if none is available.
- */
- public final String getBaseSystemId() {
- return (fCurrentEntity != null && fCurrentEntity.entityLocation != null) ? fCurrentEntity.entityLocation.getExpandedSystemId() : null;
- } // getBaseSystemId():String
-
- /**
- * @see com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier#setBaseSystemId(String)
- */
- public void setBaseSystemId(String systemId) {
- //no-op
- }
-
- ///////////// Locator methods start.
- public final int getLineNumber(){
- //if the entity is closed, we should return -1
- //xxx at first place why such call should be there...
- return fCurrentEntity != null ? fCurrentEntity.lineNumber : -1 ;
- }
-
- /**
- * @see com.sun.org.apache.xerces.internal.xni.XMLLocator#setLineNumber(int)
- */
- public void setLineNumber(int line) {
- //no-op
- }
-
-
- public final int getColumnNumber(){
- //if the entity is closed, we should return -1
- //xxx at first place why such call should be there...
- return fCurrentEntity != null ? fCurrentEntity.columnNumber : -1 ;
- }
-
- /**
- * @see com.sun.org.apache.xerces.internal.xni.XMLLocator#setColumnNumber(int)
- */
- public void setColumnNumber(int col) {
- // no-op
- }
-
-
- public final int getCharacterOffset(){
- return fCurrentEntity != null ? fCurrentEntity.fTotalCountTillLastLoad + fCurrentEntity.position : -1 ;
- }
-
- /** Returns the expanded system identifier. */
- public final String getExpandedSystemId() {
- return (fCurrentEntity != null && fCurrentEntity.entityLocation != null) ? fCurrentEntity.entityLocation.getExpandedSystemId() : null;
- }
-
- /**
- * @see com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier#setExpandedSystemId(String)
- */
- public void setExpandedSystemId(String systemId) {
- //no-op
- }
-
- /** Returns the literal system identifier. */
- public final String getLiteralSystemId() {
- return (fCurrentEntity != null && fCurrentEntity.entityLocation != null) ? fCurrentEntity.entityLocation.getLiteralSystemId() : null;
- }
-
- /**
- * @see com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier#setLiteralSystemId(String)
- */
- public void setLiteralSystemId(String systemId) {
- //no-op
- }
-
- /** Returns the public identifier. */
- public final String getPublicId() {
- return (fCurrentEntity != null && fCurrentEntity.entityLocation != null) ? fCurrentEntity.entityLocation.getPublicId() : null;
- }
-
- /**
- * @see com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier#setPublicId(String)
- */
- public void setPublicId(String publicId) {
- //no-op
- }
-
- ///////////////// Locator methods finished.
-
- /** the version of the current entity being scanned */
- public void setVersion(String version){
- fCurrentEntity.version = version;
- }
-
- public String getVersion(){
- if (fCurrentEntity != null)
- return fCurrentEntity.version ;
- return null;
- }
-
- /**
- * Returns the encoding of the current entity.
- * Note that, for a given entity, this value can only be
- * considered final once the encoding declaration has been read (or once it
- * has been determined that there is no such declaration) since, no encoding
- * having been specified on the XMLInputSource, the parser
- * will make an initial "guess" which could be in error.
- */
- public final String getEncoding() {
- if (fCurrentEntity != null) {
- return fCurrentEntity.encoding;
- }
- return null;
- } // getEncoding():String
-
- /**
- * Sets the encoding of the scanner. This method is used by the
- * scanners if the XMLDecl or TextDecl line contains an encoding
- * pseudo-attribute.
- * <p>
- * <strong>Note:</strong> The underlying character reader on the
- * current entity will be changed to accomodate the new encoding.
- * However, the new encoding is ignored if the current reader was
- * not constructed from an input stream (e.g. an external entity
- * that is resolved directly to the appropriate java.io.Reader
- * object).
- *
- * @param encoding The IANA encoding name of the new encoding.
- *
- * @throws IOException Thrown if the new encoding is not supported.
- *
- * @see com.sun.org.apache.xerces.internal.util.EncodingMap
- */
- public final void setEncoding(String encoding) throws IOException {
-
- if (DEBUG_ENCODINGS) {
- System.out.println("$$$ setEncoding: "+encoding);
- }
-
- if (fCurrentEntity.stream != null) {
- // if the encoding is the same, don't change the reader and
- // re-use the original reader used by the OneCharReader
- // NOTE: Besides saving an object, this overcomes deficiencies
- // in the UTF-16 reader supplied with the standard Java
- // distribution (up to and including 1.3). The UTF-16
- // decoder buffers 8K blocks even when only asked to read
- // a single char! -Ac
- if (fCurrentEntity.encoding == null ||
- !fCurrentEntity.encoding.equals(encoding)) {
- // UTF-16 is a bit of a special case. If the encoding is UTF-16,
- // and we know the endian-ness, we shouldn't change readers.
- // If it's ISO-10646-UCS-(2|4), then we'll have to deduce
- // the endian-ness from the encoding we presently have.
- if(fCurrentEntity.encoding != null && fCurrentEntity.encoding.startsWith("UTF-16")) {
- String ENCODING = encoding.toUpperCase(Locale.ENGLISH);
- if(ENCODING.equals("UTF-16")) return;
- if(ENCODING.equals("ISO-10646-UCS-4")) {
- if(fCurrentEntity.encoding.equals("UTF-16BE")) {
- fCurrentEntity.reader = new UCSReader(fCurrentEntity.stream, UCSReader.UCS4BE);
- } else {
- fCurrentEntity.reader = new UCSReader(fCurrentEntity.stream, UCSReader.UCS4LE);
- }
- return;
- }
- if(ENCODING.equals("ISO-10646-UCS-2")) {
- if(fCurrentEntity.encoding.equals("UTF-16BE")) {
- fCurrentEntity.reader = new UCSReader(fCurrentEntity.stream, UCSReader.UCS2BE);
- } else {
- fCurrentEntity.reader = new UCSReader(fCurrentEntity.stream, UCSReader.UCS2LE);
- }
- return;
- }
- }
- // wrap a new reader around the input stream, changing
- // the encoding
- if (DEBUG_ENCODINGS) {
- System.out.println("$$$ creating new reader from stream: "+
- fCurrentEntity.stream);
- }
- //fCurrentEntity.stream.reset();
- fCurrentEntity.reader = createReader(fCurrentEntity.stream, encoding, null);
- fCurrentEntity.encoding = encoding;
-
- } else {
- if (DEBUG_ENCODINGS)
- System.out.println("$$$ reusing old reader on stream");
- }
- }
-
- } // setEncoding(String)
-
- /** Returns true if the current entity being scanned is external. */
- public final boolean isExternal() {
- return fCurrentEntity.isExternal();
- } // isExternal():boolean
-
- public int getChar(int relative) throws IOException{
- if(arrangeCapacity(relative + 1, false)){
- return fCurrentEntity.ch[fCurrentEntity.position + relative];
- }else{
- return -1;
- }
- }//getChar()
-
- /**
- * Returns the next character on the input.
- * <p>
- * <strong>Note:</strong> The character is <em>not</em> consumed.
- *
- * @throws IOException Thrown if i/o error occurs.
- * @throws EOFException Thrown on end of file.
- */
- public int peekChar() throws IOException {
- if (DEBUG_BUFFER) {
- System.out.print("(peekChar: ");
- print();
- System.out.println();
- }
-
- // load more characters, if needed
- if (fCurrentEntity.position == fCurrentEntity.count) {
- load(0, true, true);
- }
-
- // peek at character
- int c = fCurrentEntity.ch[fCurrentEntity.position];
-
- // return peeked character
- if (DEBUG_BUFFER) {
- System.out.print(")peekChar: ");
- print();
- if (isExternal) {
- System.out.println(" -> '"+(c!='\r'?(char)c:'\n')+"'");
- } else {
- System.out.println(" -> '"+(char)c+"'");
- }
- }
- if (isExternal) {
- return c != '\r' ? c : '\n';
- } else {
- return c;
- }
-
- } // peekChar():int
-
- /**
- * Returns the next character on the input.
- * <p>
- * <strong>Note:</strong> The character is consumed.
- *
- * @param nt The type of the name (element or attribute)
- *
- * @throws IOException Thrown if i/o error occurs.
- * @throws EOFException Thrown on end of file.
- */
- protected int scanChar(NameType nt) throws IOException {
- if (DEBUG_BUFFER) {
- System.out.print("(scanChar: ");
- print();
- System.out.println();
- }
-
- // load more characters, if needed
- if (fCurrentEntity.position == fCurrentEntity.count) {
- load(0, true, true);
- }
-
- // scan character
- int offset = fCurrentEntity.position;
- int c = fCurrentEntity.ch[fCurrentEntity.position++];
- if (c == '\n' || (c == '\r' && isExternal)) {
- fCurrentEntity.lineNumber++;
- fCurrentEntity.columnNumber = 1;
- if (fCurrentEntity.position == fCurrentEntity.count) {
- invokeListeners(1);
- fCurrentEntity.ch[0] = (char)c;
- load(1, false, false);
- offset = 0;
- }
- if (c == '\r' && isExternal) {
- if (fCurrentEntity.ch[fCurrentEntity.position++] != '\n') {
- fCurrentEntity.position--;
- }
- c = '\n';
- }
- }
-
- // return character that was scanned
- if (DEBUG_BUFFER) {
- System.out.print(")scanChar: ");
- print();
- System.out.println(" -> '"+(char)c+"'");
- }
- fCurrentEntity.columnNumber++;
- if (!detectingVersion) {
- checkEntityLimit(nt, fCurrentEntity, offset, fCurrentEntity.position - offset);
- }
- return c;
-
- } // scanChar():int
-
- /**
- * Returns a string matching the NMTOKEN production appearing immediately
- * on the input as a symbol, or null if NMTOKEN Name string is present.
- * <p>
- * <strong>Note:</strong> The NMTOKEN characters are consumed.
- * <p>
- * <strong>Note:</strong> The string returned must be a symbol. The
- * SymbolTable can be used for this purpose.
- *
- * @throws IOException Thrown if i/o error occurs.
- * @throws EOFException Thrown on end of file.
- *
- * @see com.sun.org.apache.xerces.internal.util.SymbolTable
- * @see com.sun.org.apache.xerces.internal.util.XMLChar#isName
- */
- protected String scanNmtoken() throws IOException {
- if (DEBUG_BUFFER) {
- System.out.print("(scanNmtoken: ");
- print();
- System.out.println();
- }
-
- // load more characters, if needed
- if (fCurrentEntity.position == fCurrentEntity.count) {
- load(0, true, true);
- }
-
- // scan nmtoken
- int offset = fCurrentEntity.position;
- boolean vc = false;
- char c;
- while (true){
- //while (XMLChar.isName(fCurrentEntity.ch[fCurrentEntity.position])) {
- c = fCurrentEntity.ch[fCurrentEntity.position];
- if(c < 127){
- vc = VALID_NAMES[c];
- }else{
- vc = XMLChar.isName(c);
- }
- if(!vc)break;
-
- if (++fCurrentEntity.position == fCurrentEntity.count) {
- int length = fCurrentEntity.position - offset;
- invokeListeners(length);
- if (length == fCurrentEntity.fBufferSize) {
- // bad luck we have to resize our buffer
- char[] tmp = new char[fCurrentEntity.fBufferSize * 2];
- System.arraycopy(fCurrentEntity.ch, offset,
- tmp, 0, length);
- fCurrentEntity.ch = tmp;
- fCurrentEntity.fBufferSize *= 2;
- } else {
- System.arraycopy(fCurrentEntity.ch, offset,
- fCurrentEntity.ch, 0, length);
- }
- offset = 0;
- if (load(length, false, false)) {
- break;
- }
- }
- }
- int length = fCurrentEntity.position - offset;
- fCurrentEntity.columnNumber += length;
-
- // return nmtoken
- String symbol = null;
- if (length > 0) {
- symbol = fSymbolTable.addSymbol(fCurrentEntity.ch, offset, length);
- }
- if (DEBUG_BUFFER) {
- System.out.print(")scanNmtoken: ");
- print();
- System.out.println(" -> "+String.valueOf(symbol));
- }
- return symbol;
-
- } // scanNmtoken():String
-
- /**
- * Returns a string matching the Name production appearing immediately
- * on the input as a symbol, or null if no Name string is present.
- * <p>
- * <strong>Note:</strong> The Name characters are consumed.
- * <p>
- * <strong>Note:</strong> The string returned must be a symbol. The
- * SymbolTable can be used for this purpose.
- *
- * @param nt The type of the name (element or attribute)
- *
- * @throws IOException Thrown if i/o error occurs.
- * @throws EOFException Thrown on end of file.
- *
- * @see com.sun.org.apache.xerces.internal.util.SymbolTable
- * @see com.sun.org.apache.xerces.internal.util.XMLChar#isName
- * @see com.sun.org.apache.xerces.internal.util.XMLChar#isNameStart
- */
- protected String scanName(NameType nt) throws IOException {
- if (DEBUG_BUFFER) {
- System.out.print("(scanName: ");
- print();
- System.out.println();
- }
-
- // load more characters, if needed
- if (fCurrentEntity.position == fCurrentEntity.count) {
- load(0, true, true);
- }
-
- // scan name
- int offset = fCurrentEntity.position;
- int length;
- if (XMLChar.isNameStart(fCurrentEntity.ch[offset])) {
- if (++fCurrentEntity.position == fCurrentEntity.count) {
- invokeListeners(1);
- fCurrentEntity.ch[0] = fCurrentEntity.ch[offset];
- offset = 0;
- if (load(1, false, false)) {
- fCurrentEntity.columnNumber++;
- String symbol = fSymbolTable.addSymbol(fCurrentEntity.ch, 0, 1);
-
- if (DEBUG_BUFFER) {
- System.out.print(")scanName: ");
- print();
- System.out.println(" -> "+String.valueOf(symbol));
- }
- return symbol;
- }
- }
- boolean vc =false;
- while (true ){
- //XMLChar.isName(fCurrentEntity.ch[fCurrentEntity.position])) ;
- char c = fCurrentEntity.ch[fCurrentEntity.position];
- if(c < 127){
- vc = VALID_NAMES[c];
- }else{
- vc = XMLChar.isName(c);
- }
- if(!vc)break;
- if ((length = checkBeforeLoad(fCurrentEntity, offset, offset)) > 0) {
- offset = 0;
- if (load(length, false, false)) {
- break;
- }
- }
- }
- }
- length = fCurrentEntity.position - offset;
- fCurrentEntity.columnNumber += length;
-
- // return name
- String symbol;
- if (length > 0) {
- checkLimit(Limit.MAX_NAME_LIMIT, fCurrentEntity, offset, length);
- checkEntityLimit(nt, fCurrentEntity, offset, length);
- symbol = fSymbolTable.addSymbol(fCurrentEntity.ch, offset, length);
- } else
- symbol = null;
- if (DEBUG_BUFFER) {
- System.out.print(")scanName: ");
- print();
- System.out.println(" -> "+String.valueOf(symbol));
- }
- return symbol;
-
- } // scanName():String
-
- /**
- * Scans a qualified name from the input, setting the fields of the
- * QName structure appropriately.
- * <p>
- * <strong>Note:</strong> The qualified name characters are consumed.
- * <p>
- * <strong>Note:</strong> The strings used to set the values of the
- * QName structure must be symbols. The SymbolTable can be used for
- * this purpose.
- *
- * @param qname The qualified name structure to fill.
- * @param nt The type of the name (element or attribute)
- *
- * @return Returns true if a qualified name appeared immediately on
- * the input and was scanned, false otherwise.
- *
- * @throws IOException Thrown if i/o error occurs.
- * @throws EOFException Thrown on end of file.
- *
- * @see com.sun.org.apache.xerces.internal.util.SymbolTable
- * @see com.sun.org.apache.xerces.internal.util.XMLChar#isName
- * @see com.sun.org.apache.xerces.internal.util.XMLChar#isNameStart
- */
- protected boolean scanQName(QName qname, NameType nt) throws IOException {
- if (DEBUG_BUFFER) {
- System.out.print("(scanQName, "+qname+": ");
- print();
- System.out.println();
- }
-
- // load more characters, if needed
- if (fCurrentEntity.position == fCurrentEntity.count) {
- load(0, true, true);
- }
-
- // scan qualified name
- int offset = fCurrentEntity.position;
-
- //making a check if if the specified character is a valid name start character
- //as defined by production [5] in the XML 1.0 specification.
- // Name ::= (Letter | '_' | ':') (NameChar)*
-
- if (XMLChar.isNameStart(fCurrentEntity.ch[offset])) {
- if (++fCurrentEntity.position == fCurrentEntity.count) {
- invokeListeners(1);
- fCurrentEntity.ch[0] = fCurrentEntity.ch[offset];
- offset = 0;
-
- if (load(1, false, false)) {
- fCurrentEntity.columnNumber++;
- //adding into symbol table.
- //XXX We are trying to add single character in SymbolTable??????
- String name = fSymbolTable.addSymbol(fCurrentEntity.ch, 0, 1);
- qname.setValues(null, name, name, null);
- if (DEBUG_BUFFER) {
- System.out.print(")scanQName, "+qname+": ");
- print();
- System.out.println(" -> true");
- }
- checkEntityLimit(nt, fCurrentEntity, 0, 1);
- return true;
- }
- }
- int index = -1;
- boolean vc = false;
- int length;
- while ( true){
-
- //XMLChar.isName(fCurrentEntity.ch[fCurrentEntity.position])) ;
- char c = fCurrentEntity.ch[fCurrentEntity.position];
- if(c < 127){
- vc = VALID_NAMES[c];
- }else{
- vc = XMLChar.isName(c);
- }
- if(!vc)break;
- if (c == ':') {
- if (index != -1) {
- break;
- }
- index = fCurrentEntity.position;
- //check prefix before further read
- checkLimit(Limit.MAX_NAME_LIMIT, fCurrentEntity, offset, index - offset);
- }
- if ((length = checkBeforeLoad(fCurrentEntity, offset, index)) > 0) {
- if (index != -1) {
- index = index - offset;
- }
- offset = 0;
- if (load(length, false, false)) {
- break;
- }
- }
- }
- length = fCurrentEntity.position - offset;
- fCurrentEntity.columnNumber += length;
- if (length > 0) {
- String prefix = null;
- String localpart = null;
- String rawname = fSymbolTable.addSymbol(fCurrentEntity.ch,
- offset, length);
-
- if (index != -1) {
- int prefixLength = index - offset;
- //check the result: prefix
- checkLimit(Limit.MAX_NAME_LIMIT, fCurrentEntity, offset, prefixLength);
- prefix = fSymbolTable.addSymbol(fCurrentEntity.ch,
- offset, prefixLength);
- int len = length - prefixLength - 1;
- //check the result: localpart
- checkLimit(Limit.MAX_NAME_LIMIT, fCurrentEntity, index + 1, len);
- localpart = fSymbolTable.addSymbol(fCurrentEntity.ch,
- index + 1, len);
-
- } else {
- localpart = rawname;
- //check the result: localpart
- checkLimit(Limit.MAX_NAME_LIMIT, fCurrentEntity, offset, length);
- }
- qname.setValues(prefix, localpart, rawname, null);
- if (DEBUG_BUFFER) {
- System.out.print(")scanQName, "+qname+": ");
- print();
- System.out.println(" -> true");
- }
- checkEntityLimit(nt, fCurrentEntity, offset, length);
- return true;
- }
- }
-
- // no qualified name found
- if (DEBUG_BUFFER) {
- System.out.print(")scanQName, "+qname+": ");
- print();
- System.out.println(" -> false");
- }
- return false;
-
- } // scanQName(QName):boolean
-
- /**
- * Checks whether the end of the entity buffer has been reached. If yes,
- * checks against the limit and buffer size before loading more characters.
- *
- * @param entity the current entity
- * @param offset the offset from which the current read was started
- * @param nameOffset the offset from which the current name starts
- * @return the length of characters scanned before the end of the buffer,
- * zero if there is more to be read in the buffer
- */
- protected int checkBeforeLoad(Entity.ScannedEntity entity, int offset,
- int nameOffset) throws IOException {
- int length = 0;
- if (++entity.position == entity.count) {
- length = entity.position - offset;
- int nameLength = length;
- if (nameOffset != -1) {
- nameOffset = nameOffset - offset;
- nameLength = length - nameOffset;
- } else {
- nameOffset = offset;
- }
- //check limit before loading more data
- checkLimit(Limit.MAX_NAME_LIMIT, entity, nameOffset, nameLength);
- invokeListeners(length);
- if (length == entity.ch.length) {
- // bad luck we have to resize our buffer
- char[] tmp = new char[entity.fBufferSize * 2];
- System.arraycopy(entity.ch, offset, tmp, 0, length);
- entity.ch = tmp;
- entity.fBufferSize *= 2;
- }
- else {
- System.arraycopy(entity.ch, offset, entity.ch, 0, length);
- }
- }
- return length;
- }
-
- /**
- * If the current entity is an Entity reference, check the accumulated size
- * against the limit.
- *
- * @param nt type of name (element, attribute or entity)
- * @param entity The current entity
- * @param offset The index of the first byte
- * @param length The length of the entity scanned
- */
- protected void checkEntityLimit(NameType nt, ScannedEntity entity, int offset, int length) {
- if (entity == null || !entity.isGE) {
- return;
- }
-
- if (nt != NameType.REFERENCE) {
- checkLimit(Limit.GENERAL_ENTITY_SIZE_LIMIT, entity, offset, length);
- }
- if (nt == NameType.ELEMENTSTART || nt == NameType.ATTRIBUTENAME) {
- checkNodeCount(entity);
- }
- }
-
- /**
- * If the current entity is an Entity reference, counts the total nodes in
- * the entity and checks the accumulated value against the limit.
- *
- * @param entity The current entity
- */
- protected void checkNodeCount(ScannedEntity entity) {
- if (entity != null && entity.isGE) {
- checkLimit(Limit.ENTITY_REPLACEMENT_LIMIT, entity, 0, 1);
- }
- }
-
- /**
- * Checks whether the value of the specified Limit exceeds its limit
- *
- * @param limit The Limit to be checked
- * @param entity The current entity
- * @param offset The index of the first byte
- * @param length The length of the entity scanned
- */
- protected void checkLimit(Limit limit, ScannedEntity entity, int offset, int length) {
- fLimitAnalyzer.addValue(limit, entity.name, length);
- if (fSecurityManager.isOverLimit(limit, fLimitAnalyzer)) {
- fSecurityManager.debugPrint(fLimitAnalyzer);
- Object[] e = (limit == Limit.ENTITY_REPLACEMENT_LIMIT) ?
- new Object[]{fLimitAnalyzer.getValue(limit),
- fSecurityManager.getLimit(limit), fSecurityManager.getStateLiteral(limit)} :
- new Object[]{entity.name, fLimitAnalyzer.getValue(limit),
- fSecurityManager.getLimit(limit), fSecurityManager.getStateLiteral(limit)};
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN, limit.key(),
- e, XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
- if (fSecurityManager.isOverLimit(Limit.TOTAL_ENTITY_SIZE_LIMIT, fLimitAnalyzer)) {
- fSecurityManager.debugPrint(fLimitAnalyzer);
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN, "TotalEntitySizeLimit",
- new Object[]{fLimitAnalyzer.getTotalValue(Limit.TOTAL_ENTITY_SIZE_LIMIT),
- fSecurityManager.getLimit(Limit.TOTAL_ENTITY_SIZE_LIMIT),
- fSecurityManager.getStateLiteral(Limit.TOTAL_ENTITY_SIZE_LIMIT)},
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
- }
-
- /**
- * CHANGED:
- * Scans a range of parsed character data, This function appends the character data to
- * the supplied buffer.
- * <p>
- * <strong>Note:</strong> The characters are consumed.
- * <p>
- * <strong>Note:</strong> This method does not guarantee to return
- * the longest run of parsed character data. This method may return
- * before markup due to reaching the end of the input buffer or any
- * other reason.
- * <p>
- *
- * @param content The content structure to fill.
- *
- * @return Returns the next character on the input, if known. This
- * value may be -1 but this does <em>note</em> designate
- * end of file.
- *
- * @throws IOException Thrown if i/o error occurs.
- * @throws EOFException Thrown on end of file.
- */
- protected int scanContent(XMLString content) throws IOException {
- if (DEBUG_BUFFER) {
- System.out.print("(scanContent: ");
- print();
- System.out.println();
- }
-
- // load more characters, if needed
- if (fCurrentEntity.position == fCurrentEntity.count) {
- load(0, true, true);
- } else if (fCurrentEntity.position == fCurrentEntity.count - 1) {
- invokeListeners(1);
- fCurrentEntity.ch[0] = fCurrentEntity.ch[fCurrentEntity.count - 1];
- load(1, false, false);
- fCurrentEntity.position = 0;
- }
-
- // normalize newlines
- int offset = fCurrentEntity.position;
- int c = fCurrentEntity.ch[offset];
- int newlines = 0;
- boolean counted = false;
- if (c == '\n' || (c == '\r' && isExternal)) {
- if (DEBUG_BUFFER) {
- System.out.print("[newline, "+offset+", "+fCurrentEntity.position+": ");
- print();
- System.out.println();
- }
- do {
- c = fCurrentEntity.ch[fCurrentEntity.position++];
- if (c == '\r' && isExternal) {
- newlines++;
- fCurrentEntity.lineNumber++;
- fCurrentEntity.columnNumber = 1;
- if (fCurrentEntity.position == fCurrentEntity.count) {
- checkEntityLimit(null, fCurrentEntity, offset, newlines);
- offset = 0;
- fCurrentEntity.position = newlines;
- if (load(newlines, false, true)) {
- counted = true;
- break;
- }
- }
- if (fCurrentEntity.ch[fCurrentEntity.position] == '\n') {
- fCurrentEntity.position++;
- offset++;
- }
- /*** NEWLINE NORMALIZATION ***/
- else {
- newlines++;
- }
- } else if (c == '\n') {
- newlines++;
- fCurrentEntity.lineNumber++;
- fCurrentEntity.columnNumber = 1;
- if (fCurrentEntity.position == fCurrentEntity.count) {
- checkEntityLimit(null, fCurrentEntity, offset, newlines);
- offset = 0;
- fCurrentEntity.position = newlines;
- if (load(newlines, false, true)) {
- counted = true;
- break;
- }
- }
- } else {
- fCurrentEntity.position--;
- break;
- }
- } while (fCurrentEntity.position < fCurrentEntity.count - 1);
- for (int i = offset; i < fCurrentEntity.position; i++) {
- fCurrentEntity.ch[i] = '\n';
- }
- int length = fCurrentEntity.position - offset;
- if (fCurrentEntity.position == fCurrentEntity.count - 1) {
- checkEntityLimit(null, fCurrentEntity, offset, length);
- //CHANGED: dont replace the value.. append to the buffer. This gives control to the callee
- //on buffering the data..
- content.setValues(fCurrentEntity.ch, offset, length);
- //content.append(fCurrentEntity.ch, offset, length);
- if (DEBUG_BUFFER) {
- System.out.print("]newline, "+offset+", "+fCurrentEntity.position+": ");
- print();
- System.out.println();
- }
- return -1;
- }
- if (DEBUG_BUFFER) {
- System.out.print("]newline, "+offset+", "+fCurrentEntity.position+": ");
- print();
- System.out.println();
- }
- }
-
- while (fCurrentEntity.position < fCurrentEntity.count) {
- c = fCurrentEntity.ch[fCurrentEntity.position++];
- if (!XMLChar.isContent(c)) {
- fCurrentEntity.position--;
- break;
- }
- }
- int length = fCurrentEntity.position - offset;
- fCurrentEntity.columnNumber += length - newlines;
- if (!counted) {
- checkEntityLimit(null, fCurrentEntity, offset, length);
- }
-
- //CHANGED: dont replace the value.. append to the buffer. This gives control to the callee
- //on buffering the data..
- content.setValues(fCurrentEntity.ch, offset, length);
- //content.append(fCurrentEntity.ch, offset, length);
- // return next character
- if (fCurrentEntity.position != fCurrentEntity.count) {
- c = fCurrentEntity.ch[fCurrentEntity.position];
- // REVISIT: Does this need to be updated to fix the
- // #x0D ^#x0A newline normalization problem? -Ac
- if (c == '\r' && isExternal) {
- c = '\n';
- }
- } else {
- c = -1;
- }
- if (DEBUG_BUFFER) {
- System.out.print(")scanContent: ");
- print();
- System.out.println(" -> '"+(char)c+"'");
- }
- return c;
-
- } // scanContent(XMLString):int
-
- /**
- * Scans a range of attribute value data, setting the fields of the
- * XMLString structure, appropriately.
- * <p>
- * <strong>Note:</strong> The characters are consumed.
- * <p>
- * <strong>Note:</strong> This method does not guarantee to return
- * the longest run of attribute value data. This method may return
- * before the quote character due to reaching the end of the input
- * buffer or any other reason.
- * <p>
- * <strong>Note:</strong> The fields contained in the XMLString
- * structure are not guaranteed to remain valid upon subsequent calls
- * to the entity scanner. Therefore, the caller is responsible for
- * immediately using the returned character data or making a copy of
- * the character data.
- *
- * @param quote The quote character that signifies the end of the
- * attribute value data.
- * @param content The content structure to fill.
- * @param isNSURI a flag indicating whether the content is a Namespace URI
- *
- * @return Returns the next character on the input, if known. This
- * value may be -1 but this does <em>note</em> designate
- * end of file.
- *
- * @throws IOException Thrown if i/o error occurs.
- * @throws EOFException Thrown on end of file.
- */
- protected int scanLiteral(int quote, XMLString content, boolean isNSURI)
- throws IOException {
- if (DEBUG_BUFFER) {
- System.out.print("(scanLiteral, '"+(char)quote+"': ");
- print();
- System.out.println();
- }
- // load more characters, if needed
- if (fCurrentEntity.position == fCurrentEntity.count) {
- load(0, true, true);
- } else if (fCurrentEntity.position == fCurrentEntity.count - 1) {
- invokeListeners(1);
- fCurrentEntity.ch[0] = fCurrentEntity.ch[fCurrentEntity.count - 1];
- load(1, false, false);
- fCurrentEntity.position = 0;
- }
-
- // normalize newlines
- int offset = fCurrentEntity.position;
- int c = fCurrentEntity.ch[offset];
- int newlines = 0;
- if(whiteSpaceInfoNeeded)
- whiteSpaceLen=0;
- if (c == '\n' || (c == '\r' && isExternal)) {
- if (DEBUG_BUFFER) {
- System.out.print("[newline, "+offset+", "+fCurrentEntity.position+": ");
- print();
- System.out.println();
- }
- do {
- c = fCurrentEntity.ch[fCurrentEntity.position++];
- if (c == '\r' && isExternal) {
- newlines++;
- fCurrentEntity.lineNumber++;
- fCurrentEntity.columnNumber = 1;
- if (fCurrentEntity.position == fCurrentEntity.count) {
- offset = 0;
- fCurrentEntity.position = newlines;
- if (load(newlines, false, true)) {
- break;
- }
- }
- if (fCurrentEntity.ch[fCurrentEntity.position] == '\n') {
- fCurrentEntity.position++;
- offset++;
- }
- /*** NEWLINE NORMALIZATION ***/
- else {
- newlines++;
- }
- /***/
- } else if (c == '\n') {
- newlines++;
- fCurrentEntity.lineNumber++;
- fCurrentEntity.columnNumber = 1;
- if (fCurrentEntity.position == fCurrentEntity.count) {
- offset = 0;
- fCurrentEntity.position = newlines;
- if (load(newlines, false, true)) {
- break;
- }
- }
- /*** NEWLINE NORMALIZATION ***
- * if (fCurrentEntity.ch[fCurrentEntity.position] == '\r'
- * && external) {
- * fCurrentEntity.position++;
- * offset++;
- * }
- * /***/
- } else {
- fCurrentEntity.position--;
- break;
- }
- } while (fCurrentEntity.position < fCurrentEntity.count - 1);
- int i=0;
- for ( i = offset; i < fCurrentEntity.position; i++) {
- fCurrentEntity.ch[i] = '\n';
- storeWhiteSpace(i);
- }
-
- int length = fCurrentEntity.position - offset;
- if (fCurrentEntity.position == fCurrentEntity.count - 1) {
- content.setValues(fCurrentEntity.ch, offset, length);
- if (DEBUG_BUFFER) {
- System.out.print("]newline, "+offset+", "+fCurrentEntity.position+": ");
- print();
- System.out.println();
- }
- return -1;
- }
- if (DEBUG_BUFFER) {
- System.out.print("]newline, "+offset+", "+fCurrentEntity.position+": ");
- print();
- System.out.println();
- }
- }
-
- // scan literal value
- for (; fCurrentEntity.position<fCurrentEntity.count; fCurrentEntity.position++) {
- c = fCurrentEntity.ch[fCurrentEntity.position];
- if ((c == quote &&
- (!fCurrentEntity.literal || isExternal)) ||
- c == '%' || !XMLChar.isContent(c)) {
- break;
- }
- if (whiteSpaceInfoNeeded && c == '\t') {
- storeWhiteSpace(fCurrentEntity.position);
- }
- }
- int length = fCurrentEntity.position - offset;
- fCurrentEntity.columnNumber += length - newlines;
-
- checkEntityLimit(null, fCurrentEntity, offset, length);
- if (isNSURI) {
- checkLimit(Limit.MAX_NAME_LIMIT, fCurrentEntity, offset, length);
- }
- content.setValues(fCurrentEntity.ch, offset, length);
-
- // return next character
- if (fCurrentEntity.position != fCurrentEntity.count) {
- c = fCurrentEntity.ch[fCurrentEntity.position];
- // NOTE: We don't want to accidentally signal the
- // end of the literal if we're expanding an
- // entity appearing in the literal. -Ac
- if (c == quote && fCurrentEntity.literal) {
- c = -1;
- }
- } else {
- c = -1;
- }
- if (DEBUG_BUFFER) {
- System.out.print(")scanLiteral, '"+(char)quote+"': ");
- print();
- System.out.println(" -> '"+(char)c+"'");
- }
- return c;
-
- } // scanLiteral(int,XMLString):int
-
- /**
- * Save whitespace information. Increase the whitespace buffer by 100
- * when needed.
- *
- * For XML 1.0, legal characters below 0x20 are 0x09 (TAB), 0x0A (LF) and 0x0D (CR).
- *
- * @param whiteSpacePos position of a whitespace in the scanner entity buffer
- */
- private void storeWhiteSpace(int whiteSpacePos) {
- if (whiteSpaceLen >= whiteSpaceLookup.length) {
- int [] tmp = new int[whiteSpaceLookup.length + 100];
- System.arraycopy(whiteSpaceLookup, 0, tmp, 0, whiteSpaceLookup.length);
- whiteSpaceLookup = tmp;
- }
-
- whiteSpaceLookup[whiteSpaceLen++] = whiteSpacePos;
- }
-
- //CHANGED:
- /**
- * Scans a range of character data up to the specified delimiter,
- * setting the fields of the XMLString structure, appropriately.
- * <p>
- * <strong>Note:</strong> The characters are consumed.
- * <p>
- * <strong>Note:</strong> This assumes that the delimiter contains at
- * least one character.
- * <p>
- * <strong>Note:</strong> This method does not guarantee to return
- * the longest run of character data. This method may return before
- * the delimiter due to reaching the end of the input buffer or any
- * other reason.
- * <p>
- * @param delimiter The string that signifies the end of the character
- * data to be scanned.
- * @param buffer The XMLStringBuffer to fill.
- *
- * @return Returns true if there is more data to scan, false otherwise.
- *
- * @throws IOException Thrown if i/o error occurs.
- * @throws EOFException Thrown on end of file.
- */
- protected boolean scanData(String delimiter, XMLStringBuffer buffer)
- throws IOException {
-
- boolean done = false;
- int delimLen = delimiter.length();
- char charAt0 = delimiter.charAt(0);
- do {
- if (DEBUG_BUFFER) {
- System.out.print("(scanData: ");
- print();
- System.out.println();
- }
-
- // load more characters, if needed
-
- if (fCurrentEntity.position == fCurrentEntity.count) {
- load(0, true, false);
- }
-
- boolean bNextEntity = false;
-
- while ((fCurrentEntity.position > fCurrentEntity.count - delimLen)
- && (!bNextEntity))
- {
- System.arraycopy(fCurrentEntity.ch,
- fCurrentEntity.position,
- fCurrentEntity.ch,
- 0,
- fCurrentEntity.count - fCurrentEntity.position);
-
- bNextEntity = load(fCurrentEntity.count - fCurrentEntity.position, false, false);
- fCurrentEntity.position = 0;
- fCurrentEntity.startPosition = 0;
- }
-
- if (fCurrentEntity.position > fCurrentEntity.count - delimLen) {
- // something must be wrong with the input: e.g., file ends in an unterminated comment
- int length = fCurrentEntity.count - fCurrentEntity.position;
- checkEntityLimit(NameType.COMMENT, fCurrentEntity, fCurrentEntity.position, length);
- buffer.append (fCurrentEntity.ch, fCurrentEntity.position, length);
- fCurrentEntity.columnNumber += fCurrentEntity.count;
- fCurrentEntity.baseCharOffset += (fCurrentEntity.position - fCurrentEntity.startPosition);
- fCurrentEntity.position = fCurrentEntity.count;
- fCurrentEntity.startPosition = fCurrentEntity.count;
- load(0, true, false);
- return false;
- }
-
- // normalize newlines
- int offset = fCurrentEntity.position;
- int c = fCurrentEntity.ch[offset];
- int newlines = 0;
- if (c == '\n' || (c == '\r' && isExternal)) {
- if (DEBUG_BUFFER) {
- System.out.print("[newline, "+offset+", "+fCurrentEntity.position+": ");
- print();
- System.out.println();
- }
- do {
- c = fCurrentEntity.ch[fCurrentEntity.position++];
- if (c == '\r' && isExternal) {
- newlines++;
- fCurrentEntity.lineNumber++;
- fCurrentEntity.columnNumber = 1;
- if (fCurrentEntity.position == fCurrentEntity.count) {
- offset = 0;
- fCurrentEntity.position = newlines;
- if (load(newlines, false, true)) {
- break;
- }
- }
- if (fCurrentEntity.ch[fCurrentEntity.position] == '\n') {
- fCurrentEntity.position++;
- offset++;
- }
- /*** NEWLINE NORMALIZATION ***/
- else {
- newlines++;
- }
- } else if (c == '\n') {
- newlines++;
- fCurrentEntity.lineNumber++;
- fCurrentEntity.columnNumber = 1;
- if (fCurrentEntity.position == fCurrentEntity.count) {
- offset = 0;
- fCurrentEntity.position = newlines;
- fCurrentEntity.count = newlines;
- if (load(newlines, false, true)) {
- break;
- }
- }
- } else {
- fCurrentEntity.position--;
- break;
- }
- } while (fCurrentEntity.position < fCurrentEntity.count - 1);
- for (int i = offset; i < fCurrentEntity.position; i++) {
- fCurrentEntity.ch[i] = '\n';
- }
- int length = fCurrentEntity.position - offset;
- if (fCurrentEntity.position == fCurrentEntity.count - 1) {
- checkEntityLimit(NameType.COMMENT, fCurrentEntity, offset, length);
- buffer.append(fCurrentEntity.ch, offset, length);
- if (DEBUG_BUFFER) {
- System.out.print("]newline, "+offset+", "+fCurrentEntity.position+": ");
- print();
- System.out.println();
- }
- return true;
- }
- if (DEBUG_BUFFER) {
- System.out.print("]newline, "+offset+", "+fCurrentEntity.position+": ");
- print();
- System.out.println();
- }
- }
-
- // iterate over buffer looking for delimiter
- OUTER: while (fCurrentEntity.position < fCurrentEntity.count) {
- c = fCurrentEntity.ch[fCurrentEntity.position++];
- if (c == charAt0) {
- // looks like we just hit the delimiter
- int delimOffset = fCurrentEntity.position - 1;
- for (int i = 1; i < delimLen; i++) {
- if (fCurrentEntity.position == fCurrentEntity.count) {
- fCurrentEntity.position -= i;
- break OUTER;
- }
- c = fCurrentEntity.ch[fCurrentEntity.position++];
- if (delimiter.charAt(i) != c) {
- fCurrentEntity.position -= i;
- break;
- }
- }
- if (fCurrentEntity.position == delimOffset + delimLen) {
- done = true;
- break;
- }
- } else if (c == '\n' || (isExternal && c == '\r')) {
- fCurrentEntity.position--;
- break;
- } else if (XMLChar.isInvalid(c)) {
- fCurrentEntity.position--;
- int length = fCurrentEntity.position - offset;
- fCurrentEntity.columnNumber += length - newlines;
- checkEntityLimit(NameType.COMMENT, fCurrentEntity, offset, length);
- buffer.append(fCurrentEntity.ch, offset, length);
- return true;
- }
- }
- int length = fCurrentEntity.position - offset;
- fCurrentEntity.columnNumber += length - newlines;
- checkEntityLimit(NameType.COMMENT, fCurrentEntity, offset, length);
- if (done) {
- length -= delimLen;
- }
- buffer.append(fCurrentEntity.ch, offset, length);
-
- // return true if string was skipped
- if (DEBUG_BUFFER) {
- System.out.print(")scanData: ");
- print();
- System.out.println(" -> " + done);
- }
- } while (!done);
- return !done;
-
- } // scanData(String, XMLStringBuffer)
-
- /**
- * Skips a character appearing immediately on the input.
- * <p>
- * <strong>Note:</strong> The character is consumed only if it matches
- * the specified character.
- *
- * @param c The character to skip.
- * @param nt The type of the name (element or attribute)
- *
- * @return Returns true if the character was skipped.
- *
- * @throws IOException Thrown if i/o error occurs.
- * @throws EOFException Thrown on end of file.
- */
- protected boolean skipChar(int c, NameType nt) throws IOException {
- if (DEBUG_BUFFER) {
- System.out.print("(skipChar, '"+(char)c+"': ");
- print();
- System.out.println();
- }
-
- // load more characters, if needed
- if (fCurrentEntity.position == fCurrentEntity.count) {
- load(0, true, true);
- }
-
- // skip character
- int offset = fCurrentEntity.position;
- int cc = fCurrentEntity.ch[fCurrentEntity.position];
- if (cc == c) {
- fCurrentEntity.position++;
- if (c == '\n') {
- fCurrentEntity.lineNumber++;
- fCurrentEntity.columnNumber = 1;
- } else {
- fCurrentEntity.columnNumber++;
- }
- if (DEBUG_BUFFER) {
- System.out.print(")skipChar, '"+(char)c+"': ");
- print();
- System.out.println(" -> true");
- }
- checkEntityLimit(nt, fCurrentEntity, offset, fCurrentEntity.position - offset);
- return true;
- } else if (c == '\n' && cc == '\r' && isExternal) {
- // handle newlines
- if (fCurrentEntity.position == fCurrentEntity.count) {
- invokeListeners(1);
- fCurrentEntity.ch[0] = (char)cc;
- load(1, false, false);
- }
- fCurrentEntity.position++;
- if (fCurrentEntity.ch[fCurrentEntity.position] == '\n') {
- fCurrentEntity.position++;
- }
- fCurrentEntity.lineNumber++;
- fCurrentEntity.columnNumber = 1;
- if (DEBUG_BUFFER) {
- System.out.print(")skipChar, '"+(char)c+"': ");
- print();
- System.out.println(" -> true");
- }
- checkEntityLimit(nt, fCurrentEntity, offset, fCurrentEntity.position - offset);
- return true;
- }
-
- // character was not skipped
- if (DEBUG_BUFFER) {
- System.out.print(")skipChar, '"+(char)c+"': ");
- print();
- System.out.println(" -> false");
- }
- return false;
-
- } // skipChar(int):boolean
-
- public boolean isSpace(char ch){
- return (ch == ' ') || (ch == '\n') || (ch == '\t') || (ch == '\r');
- }
- /**
- * Skips space characters appearing immediately on the input.
- * <p>
- * <strong>Note:</strong> The characters are consumed only if they are
- * space characters.
- *
- * @return Returns true if at least one space character was skipped.
- *
- * @throws IOException Thrown if i/o error occurs.
- * @throws EOFException Thrown on end of file.
- *
- * @see com.sun.org.apache.xerces.internal.util.XMLChar#isSpace
- */
- protected boolean skipSpaces() throws IOException {
- if (DEBUG_BUFFER) {
- System.out.print("(skipSpaces: ");
- print();
- System.out.println();
- }
- //boolean entityChanged = false;
- // load more characters, if needed
- if (fCurrentEntity.position == fCurrentEntity.count) {
- load(0, true, true);
- }
-
- //we are doing this check only in skipSpace() because it is called by
- //fMiscDispatcher and we want the parser to exit gracefully when document
- //is well-formed.
- //it is possible that end of document is reached and
- //fCurrentEntity becomes null
- //nothing was read so entity changed 'false' should be returned.
- if(fCurrentEntity == null){
- return false ;
- }
-
- // skip spaces
- int c = fCurrentEntity.ch[fCurrentEntity.position];
- int offset = fCurrentEntity.position - 1;
- if (XMLChar.isSpace(c)) {
- do {
- boolean entityChanged = false;
- // handle newlines
- if (c == '\n' || (isExternal && c == '\r')) {
- fCurrentEntity.lineNumber++;
- fCurrentEntity.columnNumber = 1;
- if (fCurrentEntity.position == fCurrentEntity.count - 1) {
- invokeListeners(1);
- fCurrentEntity.ch[0] = (char)c;
- entityChanged = load(1, true, false);
- if (!entityChanged){
- // the load change the position to be 1,
- // need to restore it when entity not changed
- fCurrentEntity.position = 0;
- }else if(fCurrentEntity == null){
- return true ;
- }
- }
- if (c == '\r' && isExternal) {
- // REVISIT: Does this need to be updated to fix the
- // #x0D ^#x0A newline normalization problem? -Ac
- if (fCurrentEntity.ch[++fCurrentEntity.position] != '\n') {
- fCurrentEntity.position--;
- }
- }
- } else {
- fCurrentEntity.columnNumber++;
- }
-
- //If this is a general entity, spaces within a start element should be counted
- checkEntityLimit(null, fCurrentEntity, offset, fCurrentEntity.position - offset);
- offset = fCurrentEntity.position;
-
- // load more characters, if needed
- if (!entityChanged){
- fCurrentEntity.position++;
- }
-
- if (fCurrentEntity.position == fCurrentEntity.count) {
- load(0, true, true);
-
- //we are doing this check only in skipSpace() because it is called by
- //fMiscDispatcher and we want the parser to exit gracefully when document
- //is well-formed.
-
- //it is possible that end of document is reached and
- //fCurrentEntity becomes null
- //nothing was read so entity changed 'false' should be returned.
- if(fCurrentEntity == null){
- return true ;
- }
-
- }
- } while (XMLChar.isSpace(c = fCurrentEntity.ch[fCurrentEntity.position]));
- if (DEBUG_BUFFER) {
- System.out.print(")skipSpaces: ");
- print();
- System.out.println(" -> true");
- }
- return true;
- }
-
- // no spaces were found
- if (DEBUG_BUFFER) {
- System.out.print(")skipSpaces: ");
- print();
- System.out.println(" -> false");
- }
- return false;
-
- } // skipSpaces():boolean
-
-
- /**
- * @param length This function checks that following number of characters are available.
- * to the underlying buffer.
- * @return This function returns true if capacity asked is available.
- */
- public boolean arrangeCapacity(int length) throws IOException{
- return arrangeCapacity(length, false);
- }
-
- /**
- * @param length This function checks that following number of characters are available.
- * to the underlying buffer.
- * @param changeEntity a flag to indicate that the underlying function should change the entity
- * @return This function returns true if capacity asked is available.
- *
- */
- public boolean arrangeCapacity(int length, boolean changeEntity) throws IOException{
- //check if the capacity is availble in the current buffer
- //count is no. of characters in the buffer [x][m][l]
- //position is '0' based
- //System.out.println("fCurrent Entity " + fCurrentEntity);
- if((fCurrentEntity.count - fCurrentEntity.position) >= length) {
- return true;
- }
- if(DEBUG_SKIP_STRING){
- System.out.println("fCurrentEntity.count = " + fCurrentEntity.count);
- System.out.println("fCurrentEntity.position = " + fCurrentEntity.position);
- System.out.println("length = " + length);
- }
- boolean entityChanged = false;
- //load more characters -- this function shouldn't change the entity
- while((fCurrentEntity.count - fCurrentEntity.position) < length){
- if( (fCurrentEntity.ch.length - fCurrentEntity.position) < length){
- invokeListeners(0);
- System.arraycopy(fCurrentEntity.ch, fCurrentEntity.position, fCurrentEntity.ch,0,fCurrentEntity.count - fCurrentEntity.position);
- fCurrentEntity.count = fCurrentEntity.count - fCurrentEntity.position;
- fCurrentEntity.position = 0;
- }
-
- if((fCurrentEntity.count - fCurrentEntity.position) < length){
- int pos = fCurrentEntity.position;
- invokeListeners(pos);
- entityChanged = load(fCurrentEntity.count, changeEntity, false);
- fCurrentEntity.position = pos;
- if(entityChanged)break;
- }
- if(DEBUG_SKIP_STRING){
- System.out.println("fCurrentEntity.count = " + fCurrentEntity.count);
- System.out.println("fCurrentEntity.position = " + fCurrentEntity.position);
- System.out.println("length = " + length);
- }
- }
- //load changes the position.. set it back to the point where we started.
-
- //after loading check again.
- if((fCurrentEntity.count - fCurrentEntity.position) >= length) {
- return true;
- } else {
- return false;
- }
- }
-
- /**
- * Skips the specified string appearing immediately on the input.
- * <p>
- * <strong>Note:</strong> The characters are consumed only if all
- * the characters are skipped.
- *
- * @param s The string to skip.
- *
- * @return Returns true if the string was skipped.
- *
- * @throws IOException Thrown if i/o error occurs.
- * @throws EOFException Thrown on end of file.
- */
- protected boolean skipString(String s) throws IOException {
-
- final int length = s.length();
-
- //first make sure that required capacity is avaible
- if(arrangeCapacity(length, false)){
- final int beforeSkip = fCurrentEntity.position ;
- int afterSkip = fCurrentEntity.position + length - 1 ;
- if(DEBUG_SKIP_STRING){
- System.out.println("skipString,length = " + s + "," + length);
- System.out.println("Buffer string to be skipped = " + new String(fCurrentEntity.ch, beforeSkip, length));
- }
-
- //s.charAt() indexes are 0 to 'Length -1' based.
- int i = length - 1 ;
- //check from reverse
- while(s.charAt(i--) == fCurrentEntity.ch[afterSkip]){
- if(afterSkip-- == beforeSkip){
- fCurrentEntity.position = fCurrentEntity.position + length ;
- fCurrentEntity.columnNumber += length;
- if (!detectingVersion) {
- checkEntityLimit(null, fCurrentEntity, beforeSkip, length);
- }
- return true;
- }
- }
- }
-
- return false;
- } // skipString(String):boolean
-
- protected boolean skipString(char [] s) throws IOException {
-
- final int length = s.length;
- //first make sure that required capacity is avaible
- if(arrangeCapacity(length, false)){
- int beforeSkip = fCurrentEntity.position;
-
- if(DEBUG_SKIP_STRING){
- System.out.println("skipString,length = " + new String(s) + "," + length);
- System.out.println("skipString,length = " + new String(s) + "," + length);
- }
-
- for(int i=0;i<length;i++){
- if(!(fCurrentEntity.ch[beforeSkip++]==s[i])){
- return false;
- }
- }
- fCurrentEntity.position = fCurrentEntity.position + length ;
- fCurrentEntity.columnNumber += length;
- if (!detectingVersion) {
- checkEntityLimit(null, fCurrentEntity, beforeSkip, length);
- }
- return true;
-
- }
-
- return false;
- }
-
- //
- // Locator methods
- //
- //
- // Private methods
- //
-
- /**
- * Loads a chunk of text.
- *
- * @param offset The offset into the character buffer to
- * read the next batch of characters.
- * @param changeEntity True if the load should change entities
- * at the end of the entity, otherwise leave
- * the current entity in place and the entity
- * boundary will be signaled by the return
- * value.
- * @param notify Determine whether to notify listeners of
- * the event
- *
- * @returns Returns true if the entity changed as a result of this
- * load operation.
- */
- final boolean load(int offset, boolean changeEntity, boolean notify)
- throws IOException {
- if (DEBUG_BUFFER) {
- System.out.print("(load, "+offset+": ");
- print();
- System.out.println();
- }
- if (notify) {
- invokeListeners(offset);
- }
- //maintaing the count till last load
- fCurrentEntity.fTotalCountTillLastLoad = fCurrentEntity.fTotalCountTillLastLoad + fCurrentEntity.fLastCount ;
- // read characters
- int length = fCurrentEntity.ch.length - offset;
- if (!fCurrentEntity.mayReadChunks && length > XMLEntityManager.DEFAULT_XMLDECL_BUFFER_SIZE) {
- length = XMLEntityManager.DEFAULT_XMLDECL_BUFFER_SIZE;
- }
- if (DEBUG_BUFFER) System.out.println(" length to try to read: "+length);
- int count = fCurrentEntity.reader.read(fCurrentEntity.ch, offset, length);
- if (DEBUG_BUFFER) System.out.println(" length actually read: "+count);
-
- // reset count and position
- boolean entityChanged = false;
- if (count != -1) {
- if (count != 0) {
- // record the last count
- fCurrentEntity.fLastCount = count;
- fCurrentEntity.count = count + offset;
- fCurrentEntity.position = offset;
- }
- }
- // end of this entity
- else {
- fCurrentEntity.count = offset;
- fCurrentEntity.position = offset;
- entityChanged = true;
-
- if (changeEntity) {
- //notify the entity manager about the end of entity
- fEntityManager.endEntity();
- //return if the current entity becomes null
- if(fCurrentEntity == null){
- throw END_OF_DOCUMENT_ENTITY;
- }
- // handle the trailing edges
- if (fCurrentEntity.position == fCurrentEntity.count) {
- load(0, true, false);
- }
- }
-
- }
- if (DEBUG_BUFFER) {
- System.out.print(")load, "+offset+": ");
- print();
- System.out.println();
- }
-
- return entityChanged;
-
- } // load(int, boolean):boolean
-
- /**
- * Creates a reader capable of reading the given input stream in
- * the specified encoding.
- *
- * @param inputStream The input stream.
- * @param encoding The encoding name that the input stream is
- * encoded using. If the user has specified that
- * Java encoding names are allowed, then the
- * encoding name may be a Java encoding name;
- * otherwise, it is an ianaEncoding name.
- * @param isBigEndian For encodings (like uCS-4), whose names cannot
- * specify a byte order, this tells whether the order is bigEndian. null menas
- * unknown or not relevant.
- *
- * @return Returns a reader.
- */
- protected Reader createReader(InputStream inputStream, String encoding, Boolean isBigEndian)
- throws IOException {
-
- // normalize encoding name
- if (encoding == null) {
- encoding = "UTF-8";
- }
-
- // try to use an optimized reader
- String ENCODING = encoding.toUpperCase(Locale.ENGLISH);
- if (ENCODING.equals("UTF-8")) {
- if (DEBUG_ENCODINGS) {
- System.out.println("$$$ creating UTF8Reader");
- }
- return new UTF8Reader(inputStream, fCurrentEntity.fBufferSize, fErrorReporter.getMessageFormatter(XMLMessageFormatter.XML_DOMAIN), fErrorReporter.getLocale() );
- }
- if (ENCODING.equals("US-ASCII")) {
- if (DEBUG_ENCODINGS) {
- System.out.println("$$$ creating ASCIIReader");
- }
- return new ASCIIReader(inputStream, fCurrentEntity.fBufferSize, fErrorReporter.getMessageFormatter(XMLMessageFormatter.XML_DOMAIN), fErrorReporter.getLocale());
- }
- if(ENCODING.equals("ISO-10646-UCS-4")) {
- if(isBigEndian != null) {
- boolean isBE = isBigEndian.booleanValue();
- if(isBE) {
- return new UCSReader(inputStream, UCSReader.UCS4BE);
- } else {
- return new UCSReader(inputStream, UCSReader.UCS4LE);
- }
- } else {
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "EncodingByteOrderUnsupported",
- new Object[] { encoding },
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
- }
- if(ENCODING.equals("ISO-10646-UCS-2")) {
- if(isBigEndian != null) { // sould never happen with this encoding...
- boolean isBE = isBigEndian.booleanValue();
- if(isBE) {
- return new UCSReader(inputStream, UCSReader.UCS2BE);
- } else {
- return new UCSReader(inputStream, UCSReader.UCS2LE);
- }
- } else {
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "EncodingByteOrderUnsupported",
- new Object[] { encoding },
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
- }
-
- // check for valid name
- boolean validIANA = XMLChar.isValidIANAEncoding(encoding);
- boolean validJava = XMLChar.isValidJavaEncoding(encoding);
- if (!validIANA || (fAllowJavaEncodings && !validJava)) {
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "EncodingDeclInvalid",
- new Object[] { encoding },
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- // NOTE: AndyH suggested that, on failure, we use ISO Latin 1
- // because every byte is a valid ISO Latin 1 character.
- // It may not translate correctly but if we failed on
- // the encoding anyway, then we're expecting the content
- // of the document to be bad. This will just prevent an
- // invalid UTF-8 sequence to be detected. This is only
- // important when continue-after-fatal-error is turned
- // on. -Ac
- encoding = "ISO-8859-1";
- }
-
- // try to use a Java reader
- String javaEncoding = EncodingMap.getIANA2JavaMapping(ENCODING);
- if (javaEncoding == null) {
- if(fAllowJavaEncodings) {
- javaEncoding = encoding;
- } else {
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "EncodingDeclInvalid",
- new Object[] { encoding },
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- // see comment above.
- javaEncoding = "ISO8859_1";
- }
- }
- else if (javaEncoding.equals("ASCII")) {
- if (DEBUG_ENCODINGS) {
- System.out.println("$$$ creating ASCIIReader");
- }
- return new ASCIIReader(inputStream, fBufferSize, fErrorReporter.getMessageFormatter(XMLMessageFormatter.XML_DOMAIN), fErrorReporter.getLocale());
- }
-
- if (DEBUG_ENCODINGS) {
- System.out.print("$$$ creating Java InputStreamReader: encoding="+javaEncoding);
- if (javaEncoding == encoding) {
- System.out.print(" (IANA encoding)");
- }
- System.out.println();
- }
- return new InputStreamReader(inputStream, javaEncoding);
-
- } // createReader(InputStream,String, Boolean): Reader
-
- /**
- * Returns the IANA encoding name that is auto-detected from
- * the bytes specified, with the endian-ness of that encoding where appropriate.
- *
- * @param b4 The first four bytes of the input.
- * @param count The number of bytes actually read.
- * @return a 2-element array: the first element, an IANA-encoding string,
- * the second element a Boolean which is true iff the document is big endian, false
- * if it's little-endian, and null if the distinction isn't relevant.
- */
- protected Object[] getEncodingName(byte[] b4, int count) {
-
- if (count < 2) {
- return new Object[]{"UTF-8", null};
- }
-
- // UTF-16, with BOM
- int b0 = b4[0] & 0xFF;
- int b1 = b4[1] & 0xFF;
- if (b0 == 0xFE && b1 == 0xFF) {
- // UTF-16, big-endian
- return new Object [] {"UTF-16BE", new Boolean(true)};
- }
- if (b0 == 0xFF && b1 == 0xFE) {
- // UTF-16, little-endian
- return new Object [] {"UTF-16LE", new Boolean(false)};
- }
-
- // default to UTF-8 if we don't have enough bytes to make a
- // good determination of the encoding
- if (count < 3) {
- return new Object [] {"UTF-8", null};
- }
-
- // UTF-8 with a BOM
- int b2 = b4[2] & 0xFF;
- if (b0 == 0xEF && b1 == 0xBB && b2 == 0xBF) {
- return new Object [] {"UTF-8", null};
- }
-
- // default to UTF-8 if we don't have enough bytes to make a
- // good determination of the encoding
- if (count < 4) {
- return new Object [] {"UTF-8", null};
- }
-
- // other encodings
- int b3 = b4[3] & 0xFF;
- if (b0 == 0x00 && b1 == 0x00 && b2 == 0x00 && b3 == 0x3C) {
- // UCS-4, big endian (1234)
- return new Object [] {"ISO-10646-UCS-4", new Boolean(true)};
- }
- if (b0 == 0x3C && b1 == 0x00 && b2 == 0x00 && b3 == 0x00) {
- // UCS-4, little endian (4321)
- return new Object [] {"ISO-10646-UCS-4", new Boolean(false)};
- }
- if (b0 == 0x00 && b1 == 0x00 && b2 == 0x3C && b3 == 0x00) {
- // UCS-4, unusual octet order (2143)
- // REVISIT: What should this be?
- return new Object [] {"ISO-10646-UCS-4", null};
- }
- if (b0 == 0x00 && b1 == 0x3C && b2 == 0x00 && b3 == 0x00) {
- // UCS-4, unusual octect order (3412)
- // REVISIT: What should this be?
- return new Object [] {"ISO-10646-UCS-4", null};
- }
- if (b0 == 0x00 && b1 == 0x3C && b2 == 0x00 && b3 == 0x3F) {
- // UTF-16, big-endian, no BOM
- // (or could turn out to be UCS-2...
- // REVISIT: What should this be?
- return new Object [] {"UTF-16BE", new Boolean(true)};
- }
- if (b0 == 0x3C && b1 == 0x00 && b2 == 0x3F && b3 == 0x00) {
- // UTF-16, little-endian, no BOM
- // (or could turn out to be UCS-2...
- return new Object [] {"UTF-16LE", new Boolean(false)};
- }
- if (b0 == 0x4C && b1 == 0x6F && b2 == 0xA7 && b3 == 0x94) {
- // EBCDIC
- // a la xerces1, return CP037 instead of EBCDIC here
- return new Object [] {"CP037", null};
- }
-
- // default encoding
- return new Object [] {"UTF-8", null};
-
- } // getEncodingName(byte[],int):Object[]
-
- /**
- * xxx not removing endEntity() so that i remember that we need to implement it.
- * Ends an entity.
- *
- * @throws XNIException Thrown by entity handler to signal an error.
- */
- //
- /** Prints the contents of the buffer. */
- final void print() {
- if (DEBUG_BUFFER) {
- if (fCurrentEntity != null) {
- System.out.print('[');
- System.out.print(fCurrentEntity.count);
- System.out.print(' ');
- System.out.print(fCurrentEntity.position);
- if (fCurrentEntity.count > 0) {
- System.out.print(" \"");
- for (int i = 0; i < fCurrentEntity.count; i++) {
- if (i == fCurrentEntity.position) {
- System.out.print('^');
- }
- char c = fCurrentEntity.ch[i];
- switch (c) {
- case '\n': {
- System.out.print("\\n");
- break;
- }
- case '\r': {
- System.out.print("\\r");
- break;
- }
- case '\t': {
- System.out.print("\\t");
- break;
- }
- case '\\': {
- System.out.print("\\\\");
- break;
- }
- default: {
- System.out.print(c);
- }
- }
- }
- if (fCurrentEntity.position == fCurrentEntity.count) {
- System.out.print('^');
- }
- System.out.print('"');
- }
- System.out.print(']');
- System.out.print(" @ ");
- System.out.print(fCurrentEntity.lineNumber);
- System.out.print(',');
- System.out.print(fCurrentEntity.columnNumber);
- } else {
- System.out.print("*NO CURRENT ENTITY*");
- }
- }
- }
-
- /**
- * Registers the listener object and provides callback.
- * @param listener listener to which call back should be provided when scanner buffer
- * is being changed.
- */
- public void registerListener(XMLBufferListener listener) {
- if (!listeners.contains(listener)) {
- listeners.add(listener);
- }
- }
-
- /**
- *
- * @param loadPos Starting position from which new data is being loaded into scanner buffer.
- */
- public void invokeListeners(int loadPos){
- for (int i=0; i<listeners.size(); i++) {
- listeners.get(i).refresh(loadPos);
- }
- }
-
- /**
- * Skips space characters appearing immediately on the input that would
- * match non-terminal S (0x09, 0x0A, 0x0D, 0x20) before end of line
- * normalization is performed. This is useful when scanning structures
- * such as the XMLDecl and TextDecl that can only contain US-ASCII
- * characters.
- * <p>
- * <strong>Note:</strong> The characters are consumed only if they would
- * match non-terminal S before end of line normalization is performed.
- *
- * @return Returns true if at least one space character was skipped.
- *
- * @throws IOException Thrown if i/o error occurs.
- * @throws EOFException Thrown on end of file.
- *
- * @see com.sun.org.apache.xerces.internal.util.XMLChar#isSpace
- */
- protected final boolean skipDeclSpaces() throws IOException {
- if (DEBUG_BUFFER) {
- System.out.print("(skipDeclSpaces: ");
- //XMLEntityManager.print(fCurrentEntity);
- System.out.println();
- }
-
- // load more characters, if needed
- if (fCurrentEntity.position == fCurrentEntity.count) {
- load(0, true, false);
- }
-
- // skip spaces
- int c = fCurrentEntity.ch[fCurrentEntity.position];
- if (XMLChar.isSpace(c)) {
- boolean external = fCurrentEntity.isExternal();
- do {
- boolean entityChanged = false;
- // handle newlines
- if (c == '\n' || (external && c == '\r')) {
- fCurrentEntity.lineNumber++;
- fCurrentEntity.columnNumber = 1;
- if (fCurrentEntity.position == fCurrentEntity.count - 1) {
- fCurrentEntity.ch[0] = (char)c;
- entityChanged = load(1, true, false);
- if (!entityChanged)
- // the load change the position to be 1,
- // need to restore it when entity not changed
- fCurrentEntity.position = 0;
- }
- if (c == '\r' && external) {
- // REVISIT: Does this need to be updated to fix the
- // #x0D ^#x0A newline normalization problem? -Ac
- if (fCurrentEntity.ch[++fCurrentEntity.position] != '\n') {
- fCurrentEntity.position--;
- }
- }
- /*** NEWLINE NORMALIZATION ***
- * else {
- * if (fCurrentEntity.ch[fCurrentEntity.position + 1] == '\r'
- * && external) {
- * fCurrentEntity.position++;
- * }
- * }
- * /***/
- } else {
- fCurrentEntity.columnNumber++;
- }
- // load more characters, if needed
- if (!entityChanged)
- fCurrentEntity.position++;
- if (fCurrentEntity.position == fCurrentEntity.count) {
- load(0, true, false);
- }
- } while (XMLChar.isSpace(c = fCurrentEntity.ch[fCurrentEntity.position]));
- if (DEBUG_BUFFER) {
- System.out.print(")skipDeclSpaces: ");
- // XMLEntityManager.print(fCurrentEntity);
- System.out.println(" -> true");
- }
- return true;
- }
-
- // no spaces were found
- if (DEBUG_BUFFER) {
- System.out.print(")skipDeclSpaces: ");
- //XMLEntityManager.print(fCurrentEntity);
- System.out.println(" -> false");
- }
- return false;
-
- } // skipDeclSpaces():boolean
-
-
-} // class XMLEntityScanner
diff --git a/src/com/sun/org/apache/xerces/internal/impl/XMLErrorReporter.java b/src/com/sun/org/apache/xerces/internal/impl/XMLErrorReporter.java
deleted file mode 100644
index 1333a68..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/XMLErrorReporter.java
+++ /dev/null
@@ -1,612 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl;
-import com.sun.org.apache.xerces.internal.util.DefaultErrorHandler;
-import com.sun.org.apache.xerces.internal.util.ErrorHandlerProxy;
-import com.sun.org.apache.xerces.internal.util.MessageFormatter;
-import com.sun.org.apache.xerces.internal.xni.XMLLocator;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponent;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLParseException;
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.Map;
-import org.xml.sax.ErrorHandler;
-
-/**
- * This class is a common element of all parser configurations and is
- * used to report errors that occur. This component can be queried by
- * parser components from the component manager using the following
- * property ID:
- * <pre>
- * http://apache.org/xml/properties/internal/error-reporter
- * </pre>
- * <p>
- * Errors are separated into domains that categorize a class of errors.
- * In a parser configuration, the parser would register a
- * <code>MessageFormatter</code> for each domain that is capable of
- * localizing error messages and formatting them based on information
- * about the error. Any parser component can invent new error domains
- * and register additional message formatters to localize messages in
- * those domains.
- * <p>
- * This component requires the following features and properties from the
- * component manager that uses it:
- * <ul>
- * <li>http://apache.org/xml/properties/internal/error-handler</li>
- * </ul>
- * <p>
- * This component can use the following features and properties but they
- * are not required:
- * <ul>
- * <li>http://apache.org/xml/features/continue-after-fatal-error</li>
- * </ul>
- *
- * @xerces.internal
- *
- * @see MessageFormatter
- *
- * @author Eric Ye, IBM
- * @author Andy Clark, IBM
- *
- * @version $Id: XMLErrorReporter.java,v 1.5 2010-11-01 04:39:41 joehw Exp $
- */
-public class XMLErrorReporter
- implements XMLComponent {
-
- //
- // Constants
- //
-
- // severity
-
- /**
- * Severity: warning. Warnings represent informational messages only
- * that should not be considered serious enough to stop parsing or
- * indicate an error in the document's validity.
- */
- public static final short SEVERITY_WARNING = 0;
-
- /**
- * Severity: error. Common causes of errors are document structure and/or
- * content that that does not conform to the grammar rules specified for
- * the document. These are typically validation errors.
- */
- public static final short SEVERITY_ERROR = 1;
-
- /**
- * Severity: fatal error. Fatal errors are errors in the syntax of the
- * XML document or invalid byte sequences for a given encoding. The
- * XML 1.0 Specification mandates that errors of this type are not
- * recoverable.
- * <p>
- * <strong>Note:</strong> The parser does have a "continue after fatal
- * error" feature but it should be used with extreme caution and care.
- */
- public static final short SEVERITY_FATAL_ERROR = 2;
-
- // feature identifiers
-
- /** Feature identifier: continue after fatal error. */
- protected static final String CONTINUE_AFTER_FATAL_ERROR =
- Constants.XERCES_FEATURE_PREFIX + Constants.CONTINUE_AFTER_FATAL_ERROR_FEATURE;
-
- // property identifiers
-
- /** Property identifier: error handler. */
- protected static final String ERROR_HANDLER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_HANDLER_PROPERTY;
-
- // recognized features and properties
-
- /** Recognized features. */
- private static final String[] RECOGNIZED_FEATURES = {
- CONTINUE_AFTER_FATAL_ERROR,
- };
-
- /** Feature defaults. */
- private static final Boolean[] FEATURE_DEFAULTS = {
- null,
- };
-
- /** Recognized properties. */
- private static final String[] RECOGNIZED_PROPERTIES = {
- ERROR_HANDLER,
- };
-
- /** Property defaults. */
- private static final Object[] PROPERTY_DEFAULTS = {
- null,
- };
-
- //
- // Data
- //
-
- /** The locale to be used to format error messages. */
- protected Locale fLocale;
-
- /** Mapping of Message formatters for domains. */
- protected Map<String, MessageFormatter> fMessageFormatters;
-
- /** Error handler. */
- protected XMLErrorHandler fErrorHandler;
-
- /** Document locator. */
- protected XMLLocator fLocator;
-
- /** Continue after fatal error feature. */
- protected boolean fContinueAfterFatalError;
-
- /**
- * Default error handler. This error handler is only used in the
- * absence of a registered error handler so that errors are not
- * "swallowed" silently. This is one of the most common "problems"
- * reported by users of the parser.
- */
- protected XMLErrorHandler fDefaultErrorHandler;
-
- /** A SAX proxy to the error handler contained in this error reporter. */
- private ErrorHandler fSaxProxy = null;
-
- //
- // Constructors
- //
-
- /** Constructs an error reporter with a locator. */
- public XMLErrorReporter() {
-
- // REVISIT: [Q] Should the locator be passed to the reportError
- // method? Otherwise, there is no way for a parser
- // component to store information about where an
- // error occurred so as to report it later.
- //
- // An example would be to record the location of
- // IDREFs so that, at the end of the document, if
- // there is no associated ID declared, the error
- // could report the location information of the
- // reference. -Ac
- //
- // NOTE: I added another reportError method that allows the
- // caller to specify the location of the error being
- // reported. -Ac
-
- fMessageFormatters = new HashMap<>();
-
- } // <init>()
-
- //
- // Methods
- //
-
- /**
- * Sets the current locale.
- *
- * @param locale The new locale.
- */
- public void setLocale(Locale locale) {
- fLocale = locale;
- } // setLocale(Locale)
-
- /**
- * Gets the current locale.
- *
- * @return the current Locale
- */
- public Locale getLocale() {
- return fLocale ;
- } // getLocale(): Locale
-
- /**
- * Sets the document locator.
- *
- * @param locator The locator.
- */
- public void setDocumentLocator(XMLLocator locator) {
- fLocator = locator;
- } // setDocumentLocator(XMLLocator)
-
- /**
- * Registers a message formatter for the specified domain.
- * <p>
- * <strong>Note:</strong> Registering a message formatter for a domain
- * when there is already a formatter registered will cause the previous
- * formatter to be lost. This method replaces any previously registered
- * message formatter for the specified domain.
- *
- * @param domain
- * @param messageFormatter
- */
- public void putMessageFormatter(String domain,
- MessageFormatter messageFormatter) {
- fMessageFormatters.put(domain, messageFormatter);
- } // putMessageFormatter(String,MessageFormatter)
-
- /**
- * Returns the message formatter associated with the specified domain,
- * or null if no message formatter is registered for that domain.
- *
- * @param domain The domain of the message formatter.
- */
- public MessageFormatter getMessageFormatter(String domain) {
- return fMessageFormatters.get(domain);
- } // getMessageFormatter(String):MessageFormatter
-
- /**
- * Removes the message formatter for the specified domain and
- * returns the removed message formatter.
- *
- * @param domain The domain of the message formatter.
- */
- public MessageFormatter removeMessageFormatter(String domain) {
- return fMessageFormatters.remove(domain);
- } // removeMessageFormatter(String):MessageFormatter
-
- /**
- * Reports an error. The error message passed to the error handler
- * is formatted for the locale by the message formatter installed
- * for the specified error domain.
- *
- * @param domain The error domain.
- * @param key The key of the error message.
- * @param arguments The replacement arguments for the error message,
- * if needed.
- * @param severity The severity of the error.
- * @return The formatted error message.
- *
- * @see #SEVERITY_WARNING
- * @see #SEVERITY_ERROR
- * @see #SEVERITY_FATAL_ERROR
- */
- public String reportError(String domain, String key, Object[] arguments,
- short severity) throws XNIException {
- return reportError(fLocator, domain, key, arguments, severity);
- } // reportError(String,String,Object[],short):String
-
- /**
- * Reports an error. The error message passed to the error handler
- * is formatted for the locale by the message formatter installed
- * for the specified error domain.
- *
- * @param domain The error domain.
- * @param key The key of the error message.
- * @param arguments The replacement arguments for the error message,
- * if needed.
- * @param severity The severity of the error.
- * @param exception The exception to wrap.
- * @return The formatted error message.
- *
- * @see #SEVERITY_WARNING
- * @see #SEVERITY_ERROR
- * @see #SEVERITY_FATAL_ERROR
- */
- public String reportError(String domain, String key, Object[] arguments,
- short severity, Exception exception) throws XNIException {
- return reportError(fLocator, domain, key, arguments, severity, exception);
- } // reportError(String,String,Object[],short,Exception):String
-
- /**
- * Reports an error at a specific location.
- *
- * @param location The error location.
- * @param domain The error domain.
- * @param key The key of the error message.
- * @param arguments The replacement arguments for the error message,
- * if needed.
- * @param severity The severity of the error.
- * @return The formatted error message.
- *
- * @see #SEVERITY_WARNING
- * @see #SEVERITY_ERROR
- * @see #SEVERITY_FATAL_ERROR
- */
- public String reportError(XMLLocator location,
- String domain, String key, Object[] arguments,
- short severity) throws XNIException {
- return reportError(location, domain, key, arguments, severity, null);
- } // reportError(XMLLocator,String,String,Object[],short):String
-
- /**
- * Reports an error at a specific location.
- *
- * @param location The error location.
- * @param domain The error domain.
- * @param key The key of the error message.
- * @param arguments The replacement arguments for the error message,
- * if needed.
- * @param severity The severity of the error.
- * @param exception The exception to wrap.
- * @return The formatted error message.
- *
- * @see #SEVERITY_WARNING
- * @see #SEVERITY_ERROR
- * @see #SEVERITY_FATAL_ERROR
- */
- public String reportError(XMLLocator location,
- String domain, String key, Object[] arguments,
- short severity, Exception exception) throws XNIException {
-
- // REVISIT: [Q] Should we do anything about invalid severity
- // parameter? -Ac
-
- // format error message and create parse exception
- MessageFormatter messageFormatter = getMessageFormatter(domain);
- String message;
- if (messageFormatter != null) {
- message = messageFormatter.formatMessage(fLocale, key, arguments);
- }
- else {
- StringBuffer str = new StringBuffer();
- str.append(domain);
- str.append('#');
- str.append(key);
- int argCount = arguments != null ? arguments.length : 0;
- if (argCount > 0) {
- str.append('?');
- for (int i = 0; i < argCount; i++) {
- str.append(arguments[i]);
- if (i < argCount -1) {
- str.append('&');
- }
- }
- }
- message = str.toString();
- }
- XMLParseException parseException = (exception != null) ?
- new XMLParseException(location, message, exception) :
- new XMLParseException(location, message);
-
- // get error handler
- XMLErrorHandler errorHandler = fErrorHandler;
- if (errorHandler == null) {
- if (fDefaultErrorHandler == null) {
- fDefaultErrorHandler = new DefaultErrorHandler();
- }
- errorHandler = fDefaultErrorHandler;
- }
-
- // call error handler
- switch (severity) {
- case SEVERITY_WARNING: {
- errorHandler.warning(domain, key, parseException);
- break;
- }
- case SEVERITY_ERROR: {
- errorHandler.error(domain, key, parseException);
- break;
- }
- case SEVERITY_FATAL_ERROR: {
- errorHandler.fatalError(domain, key, parseException);
- if (!fContinueAfterFatalError) {
- throw parseException;
- }
- break;
- }
- }
- return message;
-
- } // reportError(XMLLocator,String,String,Object[],short,Exception):String
-
- //
- // XMLComponent methods
- //
-
- /**
- * Resets the component. The component can query the component manager
- * about any features and properties that affect the operation of the
- * component.
- *
- * @param componentManager The component manager.
- *
- * @throws SAXException Thrown by component on initialization error.
- * For example, if a feature or property is
- * required for the operation of the component, the
- * component manager may throw a
- * SAXNotRecognizedException or a
- * SAXNotSupportedException.
- */
- public void reset(XMLComponentManager componentManager)
- throws XNIException {
-
- // features
- fContinueAfterFatalError = componentManager.getFeature(CONTINUE_AFTER_FATAL_ERROR, false);
-
- // properties
- fErrorHandler = (XMLErrorHandler)componentManager.getProperty(ERROR_HANDLER);
-
- } // reset(XMLComponentManager)
-
- /**
- * Returns a list of feature identifiers that are recognized by
- * this component. This method may return null if no features
- * are recognized by this component.
- */
- public String[] getRecognizedFeatures() {
- return (String[])(RECOGNIZED_FEATURES.clone());
- } // getRecognizedFeatures():String[]
-
- /**
- * Sets the state of a feature. This method is called by the component
- * manager any time after reset when a feature changes state.
- * <p>
- * <strong>Note:</strong> Components should silently ignore features
- * that do not affect the operation of the component.
- *
- * @param featureId The feature identifier.
- * @param state The state of the feature.
- *
- * @throws SAXNotRecognizedException The component should not throw
- * this exception.
- * @throws SAXNotSupportedException The component should not throw
- * this exception.
- */
- public void setFeature(String featureId, boolean state)
- throws XMLConfigurationException {
-
- //
- // Xerces features
- //
-
- if (featureId.startsWith(Constants.XERCES_FEATURE_PREFIX)) {
- final int suffixLength = featureId.length() - Constants.XERCES_FEATURE_PREFIX.length();
-
- //
- // http://apache.org/xml/features/continue-after-fatal-error
- // Allows the parser to continue after a fatal error.
- // Normally, a fatal error would stop the parse.
- //
- if (suffixLength == Constants.CONTINUE_AFTER_FATAL_ERROR_FEATURE.length() &&
- featureId.endsWith(Constants.CONTINUE_AFTER_FATAL_ERROR_FEATURE)) {
- fContinueAfterFatalError = state;
- }
- }
-
- } // setFeature(String,boolean)
-
- // return state of given feature or false if unsupported.
- public boolean getFeature(String featureId)
- throws XMLConfigurationException {
-
- //
- // Xerces features
- //
-
- if (featureId.startsWith(Constants.XERCES_FEATURE_PREFIX)) {
- final int suffixLength = featureId.length() - Constants.XERCES_FEATURE_PREFIX.length();
-
- //
- // http://apache.org/xml/features/continue-after-fatal-error
- // Allows the parser to continue after a fatal error.
- // Normally, a fatal error would stop the parse.
- //
- if (suffixLength == Constants.CONTINUE_AFTER_FATAL_ERROR_FEATURE.length() &&
- featureId.endsWith(Constants.CONTINUE_AFTER_FATAL_ERROR_FEATURE)) {
- return fContinueAfterFatalError ;
- }
- }
- return false;
-
- } // setFeature(String,boolean)
-
- /**
- * Returns a list of property identifiers that are recognized by
- * this component. This method may return null if no properties
- * are recognized by this component.
- */
- public String[] getRecognizedProperties() {
- return (String[])(RECOGNIZED_PROPERTIES.clone());
- } // getRecognizedProperties():String[]
-
- /**
- * Sets the value of a property. This method is called by the component
- * manager any time after reset when a property changes value.
- * <p>
- * <strong>Note:</strong> Components should silently ignore properties
- * that do not affect the operation of the component.
- *
- * @param propertyId The property identifier.
- * @param value The value of the property.
- *
- * @throws SAXNotRecognizedException The component should not throw
- * this exception.
- * @throws SAXNotSupportedException The component should not throw
- * this exception.
- */
- public void setProperty(String propertyId, Object value)
- throws XMLConfigurationException {
-
- //
- // Xerces properties
- //
-
- if (propertyId.startsWith(Constants.XERCES_PROPERTY_PREFIX)) {
- final int suffixLength = propertyId.length() - Constants.XERCES_PROPERTY_PREFIX.length();
-
- if (suffixLength == Constants.ERROR_HANDLER_PROPERTY.length() &&
- propertyId.endsWith(Constants.ERROR_HANDLER_PROPERTY)) {
- fErrorHandler = (XMLErrorHandler)value;
- }
- }
-
- } // setProperty(String,Object)
-
- /**
- * Returns the default state for a feature, or null if this
- * component does not want to report a default value for this
- * feature.
- *
- * @param featureId The feature identifier.
- *
- * @since Xerces 2.2.0
- */
- public Boolean getFeatureDefault(String featureId) {
- for (int i = 0; i < RECOGNIZED_FEATURES.length; i++) {
- if (RECOGNIZED_FEATURES[i].equals(featureId)) {
- return FEATURE_DEFAULTS[i];
- }
- }
- return null;
- } // getFeatureDefault(String):Boolean
-
- /**
- * Returns the default state for a property, or null if this
- * component does not want to report a default value for this
- * property.
- *
- * @param propertyId The property identifier.
- *
- * @since Xerces 2.2.0
- */
- public Object getPropertyDefault(String propertyId) {
- for (int i = 0; i < RECOGNIZED_PROPERTIES.length; i++) {
- if (RECOGNIZED_PROPERTIES[i].equals(propertyId)) {
- return PROPERTY_DEFAULTS[i];
- }
- }
- return null;
- } // getPropertyDefault(String):Object
-
- /**
- * Get the internal XMLErrrorHandler.
- */
- public XMLErrorHandler getErrorHandler() {
- return fErrorHandler;
- }
-
- /**
- * Gets the internal XMLErrorHandler
- * as SAX ErrorHandler.
- */
- public ErrorHandler getSAXErrorHandler() {
- if (fSaxProxy == null) {
- fSaxProxy = new ErrorHandlerProxy() {
- protected XMLErrorHandler getErrorHandler() {
- return fErrorHandler;
- }
- };
- }
- return fSaxProxy;
- }
-
-} // class XMLErrorReporter
diff --git a/src/com/sun/org/apache/xerces/internal/impl/XMLNSDocumentScannerImpl.java b/src/com/sun/org/apache/xerces/internal/impl/XMLNSDocumentScannerImpl.java
deleted file mode 100644
index 264b908..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/XMLNSDocumentScannerImpl.java
+++ /dev/null
@@ -1,648 +0,0 @@
-/*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
- */
-
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl;
-
-import java.io.IOException;
-import com.sun.org.apache.xerces.internal.xni.XMLString;
-import com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidatorFilter;
-import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter;
-import com.sun.org.apache.xerces.internal.util.XMLAttributesImpl;
-import com.sun.org.apache.xerces.internal.util.XMLSymbols;
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager;
-
-import javax.xml.stream.events.XMLEvent;
-
-/**
- * This class adds the functionality of namespace processing.
- *
- * This class has been modified as per the new design which is more suited to
- * efficiently build pull parser. Lot of improvements have been done and
- * the code has been added to support stax functionality/features.
- *
- *
- * This class scans an XML document, checks if document has a DTD, and if
- * DTD is not found the scanner will remove the DTD Validator from the pipeline and perform
- * namespace binding.
- *
- *
- * @author Neeraj Bajaj, Sun Microsystems
- * @author Venugopal Rao K, Sun Microsystems
- * @author Elena Litani, IBM
- * @version $Id: XMLNSDocumentScannerImpl.java,v 1.11 2010-11-01 04:39:41 joehw Exp $
- */
-public class XMLNSDocumentScannerImpl
- extends XMLDocumentScannerImpl {
-
- /**
- * If is true, the dtd validator is no longer in the pipeline
- * and the scanner should bind namespaces
- */
- protected boolean fBindNamespaces;
-
- /** If validating parser, make sure we report an error in the
- * scanner if DTD grammar is missing.*/
- protected boolean fPerformValidation;
-
-
- /** Default value of this feature is false, when in Stax mode this should be true */
- protected boolean fNotAddNSDeclAsAttribute = false;
-
- /** DTD validator */
- private XMLDTDValidatorFilter fDTDValidator;
-
- /** xmlns, default Namespace, declared */
- private boolean fXmlnsDeclared = false;
-
- /** Resets the fields of this scanner.
- */
- public void reset(PropertyManager propertyManager) {
- setPropertyManager(propertyManager);
- super.reset(propertyManager);
- fBindNamespaces = false;
- fNotAddNSDeclAsAttribute = !((Boolean)propertyManager.getProperty(Constants.ADD_NAMESPACE_DECL_AS_ATTRIBUTE)).booleanValue();
- }
-
- public void reset(XMLComponentManager componentManager)
- throws XMLConfigurationException {
- super.reset(componentManager);
- fNotAddNSDeclAsAttribute = false ;
- fPerformValidation = false;
- fBindNamespaces = false;
- }
-
- /** return the next state on the input
- *
- * @return int
- */
-
- public int next() throws IOException, XNIException {
- //since namespace context should still be valid when the parser is at the end element state therefore
- //we pop the context only when next() has been called after the end element state was encountered. - nb.
-
- if((fScannerLastState == XMLEvent.END_ELEMENT) && fBindNamespaces){
- fScannerLastState = -1;
- fNamespaceContext.popContext();
- }
-
- return fScannerLastState = super.next();
- }
-
- /**
- * The scanner is responsible for removing DTD validator
- * from the pipeline if it is not needed.
- *
- * @param previous The filter component before DTDValidator
- * @param dtdValidator
- * The DTDValidator
- * @param next The documentHandler after the DTDValidator
- */
- public void setDTDValidator(XMLDTDValidatorFilter dtd){
- fDTDValidator = dtd;
- }
-
-
-
- /**
- * Scans a start element. This method will handle the binding of
- * namespace information and notifying the handler of the start
- * of the element.
- * <p>
- * <pre>
- * [44] EmptyElemTag ::= '&lt;' Name (S Attribute)* S? '/>'
- * [40] STag ::= '&lt;' Name (S Attribute)* S? '>'
- * </pre>
- * <p>
- * <strong>Note:</strong> This method assumes that the leading
- * '&lt;' character has been consumed.
- * <p>
- * <strong>Note:</strong> This method uses the fElementQName and
- * fAttributes variables. The contents of these variables will be
- * destroyed. The caller should copy important information out of
- * these variables before calling this method.
- *
- * @return True if element is empty. (i.e. It matches
- * production [44].
- */
- protected boolean scanStartElement()
- throws IOException, XNIException {
-
- if (DEBUG_START_END_ELEMENT) System.out.println(this.getClass().toString() +">>> scanStartElement()");
- //when skipping is true and no more elements should be added
- if(fSkip && !fAdd){
- //get the stored element -- if everything goes right this should match the
- //token in the buffer
-
- QName name = fElementStack.getNext();
-
- if(DEBUG_SKIP_ALGORITHM){
- System.out.println("Trying to skip String = " + name.rawname);
- }
-
- //Be conservative -- if skipping fails -- stop.
- fSkip = fEntityScanner.skipString(name.rawname); // skipQElement(name);
-
- if(fSkip){
- if(DEBUG_SKIP_ALGORITHM){
- System.out.println("Element SUCESSFULLY skipped = " + name.rawname);
- }
- fElementStack.push();
- fElementQName = name;
- }else{
- //if skipping fails reposition the stack or fallback to normal way of processing
- fElementStack.reposition();
- if(DEBUG_SKIP_ALGORITHM){
- System.out.println("Element was NOT skipped, REPOSITIONING stack" );
- }
- }
- }
-
- //we are still at the stage of adding elements
- //the elements were not matched or
- //fSkip is not set to true
- if(!fSkip || fAdd){
- //get the next element from the stack
- fElementQName = fElementStack.nextElement();
- // There are two variables,fNamespaces and fBindNamespaces
- //StAX uses XMLNSDocumentScannerImpl so this distinction needs to be maintained
- if (fNamespaces) {
- fEntityScanner.scanQName(fElementQName, NameType.ELEMENTSTART);
- } else {
- String name = fEntityScanner.scanName(NameType.ELEMENTSTART);
- fElementQName.setValues(null, name, name, null);
- }
-
- if(DEBUG)System.out.println("Element scanned in start element is " + fElementQName.toString());
- if(DEBUG_SKIP_ALGORITHM){
- if(fAdd){
- System.out.println("Elements are being ADDED -- elemet added is = " + fElementQName.rawname + " at count = " + fElementStack.fCount);
- }
- }
-
- }
-
- //when the elements are being added , we need to check if we are set for skipping the elements
- if(fAdd){
- //this sets the value of fAdd variable
- fElementStack.matchElement(fElementQName);
- }
-
- //xxx: We dont need another pointer, fCurrentElement, we can use fElementQName
- fCurrentElement = fElementQName;
-
- String rawname = fElementQName.rawname;
- checkDepth(rawname);
- if (fBindNamespaces) {
- fNamespaceContext.pushContext();
- if (fScannerState == SCANNER_STATE_ROOT_ELEMENT) {
- if (fPerformValidation) {
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "MSG_GRAMMAR_NOT_FOUND",
- new Object[]{ rawname},
- XMLErrorReporter.SEVERITY_ERROR);
-
- if (fDoctypeName == null || !fDoctypeName.equals(rawname)) {
- fErrorReporter.reportError( XMLMessageFormatter.XML_DOMAIN,
- "RootElementTypeMustMatchDoctypedecl",
- new Object[]{fDoctypeName, rawname},
- XMLErrorReporter.SEVERITY_ERROR);
- }
- }
- }
- }
-
-
- fEmptyElement = false;
- fAttributes.removeAllAttributes();
-
- if(!seekCloseOfStartTag()){
- fReadingAttributes = true;
- fAttributeCacheUsedCount =0;
- fStringBufferIndex =0;
- fAddDefaultAttr = true;
- fXmlnsDeclared = false;
-
- do {
- scanAttribute(fAttributes);
- if (fSecurityManager != null && (!fSecurityManager.isNoLimit(fElementAttributeLimit)) &&
- fAttributes.getLength() > fElementAttributeLimit){
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "ElementAttributeLimit",
- new Object[]{rawname, fElementAttributeLimit },
- XMLErrorReporter.SEVERITY_FATAL_ERROR );
- }
-
- } while (!seekCloseOfStartTag());
- fReadingAttributes=false;
- }
-
- if (fBindNamespaces) {
- // REVISIT: is it required? forbit xmlns prefix for element
- if (fElementQName.prefix == XMLSymbols.PREFIX_XMLNS) {
- fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN,
- "ElementXMLNSPrefix",
- new Object[]{fElementQName.rawname},
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
-
- // bind the element
- String prefix = fElementQName.prefix != null
- ? fElementQName.prefix : XMLSymbols.EMPTY_STRING;
- // assign uri to the element
- fElementQName.uri = fNamespaceContext.getURI(prefix);
- // make sure that object in the element stack is updated as well
- fCurrentElement.uri = fElementQName.uri;
-
- if (fElementQName.prefix == null && fElementQName.uri != null) {
- fElementQName.prefix = XMLSymbols.EMPTY_STRING;
- }
- if (fElementQName.prefix != null && fElementQName.uri == null) {
- fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN,
- "ElementPrefixUnbound",
- new Object[]{fElementQName.prefix, fElementQName.rawname},
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
-
- // bind attributes (xmlns are already bound bellow)
- int length = fAttributes.getLength();
- // fLength = 0; //initialize structure
- for (int i = 0; i < length; i++) {
- fAttributes.getName(i, fAttributeQName);
-
- String aprefix = fAttributeQName.prefix != null
- ? fAttributeQName.prefix : XMLSymbols.EMPTY_STRING;
- String uri = fNamespaceContext.getURI(aprefix);
- // REVISIT: try removing the first "if" and see if it is faster.
- //
- if (fAttributeQName.uri != null && fAttributeQName.uri == uri) {
- // checkDuplicates(fAttributeQName, fAttributes);
- continue;
- }
- if (aprefix != XMLSymbols.EMPTY_STRING) {
- fAttributeQName.uri = uri;
- if (uri == null) {
- fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN,
- "AttributePrefixUnbound",
- new Object[]{fElementQName.rawname,fAttributeQName.rawname,aprefix},
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
- fAttributes.setURI(i, uri);
- // checkDuplicates(fAttributeQName, fAttributes);
- }
- }
-
- if (length > 1) {
- QName name = fAttributes.checkDuplicatesNS();
- if (name != null) {
- if (name.uri != null) {
- fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN,
- "AttributeNSNotUnique",
- new Object[]{fElementQName.rawname, name.localpart, name.uri},
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- } else {
- fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN,
- "AttributeNotUnique",
- new Object[]{fElementQName.rawname, name.rawname},
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
- }
- }
- }
-
-
- if (fEmptyElement) {
- //decrease the markup depth..
- fMarkupDepth--;
-
- // check that this element was opened in the same entity
- if (fMarkupDepth < fEntityStack[fEntityDepth - 1]) {
- reportFatalError("ElementEntityMismatch",
- new Object[]{fCurrentElement.rawname});
- }
- // call handler
- if (fDocumentHandler != null) {
- if(DEBUG)
- System.out.println("emptyElement = " + fElementQName);
-
- fDocumentHandler.emptyElement(fElementQName, fAttributes, null);
- }
-
- //We should not be popping out the context here in endELement becaause the namespace context is still
- //valid when parser is at the endElement state.
- fScanEndElement = true;
- //if (fBindNamespaces) {
- // fNamespaceContext.popContext();
- //}
-
- //pop the element off the stack..
- fElementStack.popElement();
-
- } else {
-
- if(dtdGrammarUtil != null)
- dtdGrammarUtil.startElement(fElementQName,fAttributes);
- if(fDocumentHandler != null){
- //complete element and attributes are traversed in this function so we can send a callback
- //here.
- //<strong>we shouldn't be sending callback in scanDocument()</strong>
- if(DEBUG)
- System.out.println("startElement = " + fElementQName);
- fDocumentHandler.startElement(fElementQName, fAttributes, null);
- }
- }
-
-
- if (DEBUG_START_END_ELEMENT) System.out.println(this.getClass().toString() +"<<< scanStartElement(): "+fEmptyElement);
- return fEmptyElement;
-
- } // scanStartElement():boolean
-
-
-
- /**
- * Scans an attribute.
- * <p>
- * <pre>
- * [41] Attribute ::= Name Eq AttValue
- * </pre>
- * <p>
- * <strong>Note:</strong> This method assumes that the next
- * character on the stream is the first character of the attribute
- * name.
- * <p>
- * <strong>Note:</strong> This method uses the fAttributeQName and
- * fQName variables. The contents of these variables will be
- * destroyed.
- *
- * @param attributes The attributes list for the scanned attribute.
- */
- protected void scanAttribute(XMLAttributesImpl attributes)
- throws IOException, XNIException {
- if (DEBUG_START_END_ELEMENT) System.out.println(this.getClass().toString() +">>> scanAttribute()");
-
- // name
- fEntityScanner.scanQName(fAttributeQName, NameType.ATTRIBUTE);
-
- // equals
- fEntityScanner.skipSpaces();
- if (!fEntityScanner.skipChar('=', NameType.ATTRIBUTE)) {
- reportFatalError("EqRequiredInAttribute",
- new Object[]{fCurrentElement.rawname,fAttributeQName.rawname});
- }
- fEntityScanner.skipSpaces();
-
- // content
- int attrIndex = 0 ;
-
-
- //REVISIT: one more case needs to be included: external PE and standalone is no
- boolean isVC = fHasExternalDTD && !fStandalone;
-
- // REVISIT: it seems that this function should not take attributes, and length
- //fTempString would store attribute value
- ///fTempString2 would store attribute non-normalized value
-
- //this function doesn't use 'attIndex'. We are adding the attribute later
- //after we have figured out that current attribute is not namespace declaration
- //since scanAttributeValue doesn't use attIndex parameter therefore we
- //can safely add the attribute later..
- XMLString tmpStr = getString();
-
- /**
- * Determine whether this is a namespace declaration that will be subject
- * to the name limit check in the scanAttributeValue operation.
- * Namespace declaration format: xmlns="..." or xmlns:prefix="..."
- * Note that prefix:xmlns="..." isn't a namespace.
- */
- String localpart = fAttributeQName.localpart;
- String prefix = fAttributeQName.prefix != null
- ? fAttributeQName.prefix : XMLSymbols.EMPTY_STRING;
- boolean isNSDecl = fBindNamespaces & (prefix == XMLSymbols.PREFIX_XMLNS ||
- prefix == XMLSymbols.EMPTY_STRING && localpart == XMLSymbols.PREFIX_XMLNS);
-
- scanAttributeValue(tmpStr, fTempString2, fAttributeQName.rawname, attributes,
- attrIndex, isVC, fCurrentElement.rawname, isNSDecl);
-
- String value = null;
- //fTempString.toString();
-
- // record namespace declarations if any.
- if (fBindNamespaces) {
- if (isNSDecl) {
- //check the length of URI
- if (tmpStr.length > fXMLNameLimit) {
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "MaxXMLNameLimit",
- new Object[]{new String(tmpStr.ch,tmpStr.offset,tmpStr.length),
- tmpStr.length, fXMLNameLimit,
- fSecurityManager.getStateLiteral(XMLSecurityManager.Limit.MAX_NAME_LIMIT)},
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
- // get the internalized value of this attribute
- String uri = fSymbolTable.addSymbol(tmpStr.ch,tmpStr.offset,tmpStr.length);
- value = uri;
- // 1. "xmlns" can't be bound to any namespace
- if (prefix == XMLSymbols.PREFIX_XMLNS && localpart == XMLSymbols.PREFIX_XMLNS) {
- fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN,
- "CantBindXMLNS",
- new Object[]{fAttributeQName},
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
-
- // 2. the namespace for "xmlns" can't be bound to any prefix
- if (uri == NamespaceContext.XMLNS_URI) {
- fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN,
- "CantBindXMLNS",
- new Object[]{fAttributeQName},
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
-
- // 3. "xml" can't be bound to any other namespace than it's own
- if (localpart == XMLSymbols.PREFIX_XML) {
- if (uri != NamespaceContext.XML_URI) {
- fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN,
- "CantBindXML",
- new Object[]{fAttributeQName},
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
- }
- // 4. the namespace for "xml" can't be bound to any other prefix
- else {
- if (uri ==NamespaceContext.XML_URI) {
- fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN,
- "CantBindXML",
- new Object[]{fAttributeQName},
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
- }
- prefix = localpart != XMLSymbols.PREFIX_XMLNS ? localpart : XMLSymbols.EMPTY_STRING;
- //set it equal to XMLSymbols.PREFIX_XMLNS when namespace declaration
- // is of type xmlns = "..", in this case prefix = "" and localname = XMLSymbols.PREFIX_XMLNS
- //this special behavior is because of dependency on this behavior in DOM components
- if(prefix == XMLSymbols.EMPTY_STRING && localpart == XMLSymbols.PREFIX_XMLNS){
- fAttributeQName.prefix = XMLSymbols.PREFIX_XMLNS;
- }
- // http://www.w3.org/TR/1999/REC-xml-names-19990114/#dt-prefix
- // We should only report an error if there is a prefix,
- // that is, the local part is not "xmlns". -SG
- if (uri == XMLSymbols.EMPTY_STRING && localpart != XMLSymbols.PREFIX_XMLNS) {
- fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN,
- "EmptyPrefixedAttName",
- new Object[]{fAttributeQName},
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
-
- // check for duplicate prefix bindings
- if (((com.sun.org.apache.xerces.internal.util.NamespaceSupport) fNamespaceContext).containsPrefixInCurrentContext(prefix)) {
- reportFatalError("AttributeNotUnique",
- new Object[]{fCurrentElement.rawname,
- fAttributeQName.rawname});
- }
-
- // declare prefix in context
- boolean declared = fNamespaceContext.declarePrefix(prefix, uri.length() != 0 ? uri : null);
-
- // check for duplicate xmlns declarations
- if (!declared) { // by convention, prefix == "xmlns" | "xml"
- // error if duplicate declaration
- if (fXmlnsDeclared) {
- reportFatalError("AttributeNotUnique",
- new Object[]{fCurrentElement.rawname,
- fAttributeQName.rawname});
- }
-
- // xmlns declared
- fXmlnsDeclared = true;
- }
-
- //xerces internals (XSAttributeChecker) has dependency on namespace declaration returned
- //as part of XMLAttributes.
- //addition of namespace declaration to the attribute list is controlled by fNotAddNSDeclAsAttribute
- //feature. This is required in Stax where namespace declarations are not considered as attribute
-
- if(fNotAddNSDeclAsAttribute){
- return ;
- }
- }
- }
-
- //add the attributes to the list of attributes
- if (fBindNamespaces) {
- attrIndex = attributes.getLength();
- attributes.addAttributeNS(fAttributeQName, XMLSymbols.fCDATASymbol, null);
- } else {
- int oldLen = attributes.getLength();
- attrIndex = attributes.addAttribute(fAttributeQName, XMLSymbols.fCDATASymbol, null);
-
- // WFC: Unique Att Spec
- if (oldLen == attributes.getLength()) {
- reportFatalError("AttributeNotUnique",
- new Object[]{fCurrentElement.rawname,
- fAttributeQName.rawname});
- }
- }
-
- attributes.setValue(attrIndex, value,tmpStr);
- //attributes.setNonNormalizedValue(attrIndex, fTempString2.toString());
- //removing as we are not using non-normalized values . -Venu
- attributes.setSpecified(attrIndex, true);
-
- // attempt to bind attribute
- if (fAttributeQName.prefix != null) {
- attributes.setURI(attrIndex, fNamespaceContext.getURI(fAttributeQName.prefix));
- }
-
- if (DEBUG_START_END_ELEMENT) System.out.println(this.getClass().toString() +"<<< scanAttribute()");
- } // scanAttribute(XMLAttributes)
-
-
-
-
-
- /** Creates a content driver. */
- protected Driver createContentDriver() {
- return new NSContentDriver();
- } // createContentDriver():Driver
-
- /**
- * Driver to handle content scanning.
- */
- protected final class NSContentDriver
- extends ContentDriver {
- /**
- * Scan for root element hook. This method is a hook for
- * subclasses to add code that handles scanning for the root
- * element. This method will also attempt to remove DTD validator
- * from the pipeline, if there is no DTD grammar. If DTD validator
- * is no longer in the pipeline bind namespaces in the scanner.
- *
- *
- * @return True if the caller should stop and return true which
- * allows the scanner to switch to a new scanning
- * driver. A return value of false indicates that
- * the content driver should continue as normal.
- */
- protected boolean scanRootElementHook()
- throws IOException, XNIException {
-
- reconfigurePipeline();
- if (scanStartElement()) {
- setScannerState(SCANNER_STATE_TRAILING_MISC);
- setDriver(fTrailingMiscDriver);
- return true;
- }
- return false;
-
- } // scanRootElementHook():boolean
-
- /**
- * Re-configures pipeline by removing the DTD validator
- * if no DTD grammar exists. If no validator exists in the
- * pipeline or there is no DTD grammar, namespace binding
- * is performed by the scanner in the enclosing class.
- */
- private void reconfigurePipeline() {
- //fDTDValidator will be null in Stax mode
- if (fNamespaces && fDTDValidator == null) {
- fBindNamespaces = true;
- }
- else if (fNamespaces && !fDTDValidator.hasGrammar() ) {
- fBindNamespaces = true;
- fPerformValidation = fDTDValidator.validate();
- // re-configure pipeline by removing DTDValidator
- XMLDocumentSource source = fDTDValidator.getDocumentSource();
- XMLDocumentHandler handler = fDTDValidator.getDocumentHandler();
- source.setDocumentHandler(handler);
- if (handler != null)
- handler.setDocumentSource(source);
- fDTDValidator.setDocumentSource(null);
- fDTDValidator.setDocumentHandler(null);
- }
- } // reconfigurePipeline()
- }
-
-} // class XMLNSDocumentScannerImpl
diff --git a/src/com/sun/org/apache/xerces/internal/impl/XMLNamespaceBinder.java b/src/com/sun/org/apache/xerces/internal/impl/XMLNamespaceBinder.java
deleted file mode 100644
index 13c27bc..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/XMLNamespaceBinder.java
+++ /dev/null
@@ -1,889 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2000-2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package com.sun.org.apache.xerces.internal.impl;
-
-import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.util.XMLSymbols;
-import com.sun.org.apache.xerces.internal.xni.Augmentations;
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
-import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLLocator;
-import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
-import com.sun.org.apache.xerces.internal.xni.XMLString;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponent;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentFilter;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource;
-
-/**
- * This class performs namespace binding on the startElement and endElement
- * method calls and passes all other methods through to the registered
- * document handler. This class can be configured to only pass the
- * start and end prefix mappings (start/endPrefixMapping).
- * <p>
- * This component requires the following features and properties from the
- * component manager that uses it:
- * <ul>
- * <li>http://xml.org/sax/features/namespaces</li>
- * <li>http://apache.org/xml/properties/internal/symbol-table</li>
- * <li>http://apache.org/xml/properties/internal/error-reporter</li>
- * </ul>
- *
- * @xerces.internal
- *
- * @author Andy Clark, IBM
- *
- * @version $Id: XMLNamespaceBinder.java,v 1.4 2010-11-01 04:39:41 joehw Exp $
- */
-public class XMLNamespaceBinder
- implements XMLComponent, XMLDocumentFilter {
-
- //
- // Constants
- //
-
- // feature identifiers
-
- /** Feature identifier: namespaces. */
- protected static final String NAMESPACES =
- Constants.SAX_FEATURE_PREFIX + Constants.NAMESPACES_FEATURE;
-
- // property identifiers
-
- /** Property identifier: symbol table. */
- protected static final String SYMBOL_TABLE =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY;
-
- /** Property identifier: error reporter. */
- protected static final String ERROR_REPORTER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY;
-
- // recognized features and properties
-
- /** Recognized features. */
- private static final String[] RECOGNIZED_FEATURES = {
- NAMESPACES,
- };
-
- /** Feature defaults. */
- private static final Boolean[] FEATURE_DEFAULTS = {
- null,
- };
-
- /** Recognized properties. */
- private static final String[] RECOGNIZED_PROPERTIES = {
- SYMBOL_TABLE,
- ERROR_REPORTER,
- };
-
- /** Property defaults. */
- private static final Object[] PROPERTY_DEFAULTS = {
- null,
- null,
- };
-
- //
- // Data
- //
-
- // features
-
- /** Namespaces. */
- protected boolean fNamespaces;
-
- // properties
-
- /** Symbol table. */
- protected SymbolTable fSymbolTable;
-
- /** Error reporter. */
- protected XMLErrorReporter fErrorReporter;
-
- // handlers
-
- /** Document handler. */
- protected XMLDocumentHandler fDocumentHandler;
-
- protected XMLDocumentSource fDocumentSource;
-
- // settings
-
- /** Only pass start and end prefix mapping events. */
- protected boolean fOnlyPassPrefixMappingEvents;
-
- // shared context
-
- /** Namespace context. */
- private NamespaceContext fNamespaceContext;
-
- // temp vars
-
- /** Attribute QName. */
- private QName fAttributeQName = new QName();
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- public XMLNamespaceBinder() {
- } // <init>()
-
- //
- // Public methods
- //
-
- // settings
-
- /**
- * Sets whether the namespace binder only passes the prefix mapping
- * events to the registered document handler or passes all document
- * events.
- *
- * @param onlyPassPrefixMappingEvents True to pass only the prefix
- * mapping events; false to pass
- * all events.
- */
- public void setOnlyPassPrefixMappingEvents(boolean onlyPassPrefixMappingEvents) {
- fOnlyPassPrefixMappingEvents = onlyPassPrefixMappingEvents;
- } // setOnlyPassPrefixMappingEvents(boolean)
-
- /**
- * Returns true if the namespace binder only passes the prefix mapping
- * events to the registered document handler; false if the namespace
- * binder passes all document events.
- */
- public boolean getOnlyPassPrefixMappingEvents() {
- return fOnlyPassPrefixMappingEvents;
- } // getOnlyPassPrefixMappingEvents():boolean
-
- //
- // XMLComponent methods
- //
-
- /**
- * Resets the component. The component can query the component manager
- * about any features and properties that affect the operation of the
- * component.
- *
- * @param componentManager The component manager.
- *
- * @throws SAXException Thrown by component on initialization error.
- * For example, if a feature or property is
- * required for the operation of the component, the
- * component manager may throw a
- * SAXNotRecognizedException or a
- * SAXNotSupportedException.
- */
- public void reset(XMLComponentManager componentManager)
- throws XNIException {
-
- // features
- fNamespaces = componentManager.getFeature(NAMESPACES, true);
-
- // Xerces properties
- fSymbolTable = (SymbolTable)componentManager.getProperty(SYMBOL_TABLE);
- fErrorReporter = (XMLErrorReporter)componentManager.getProperty(ERROR_REPORTER);
-
- } // reset(XMLComponentManager)
-
- /**
- * Returns a list of feature identifiers that are recognized by
- * this component. This method may return null if no features
- * are recognized by this component.
- */
- public String[] getRecognizedFeatures() {
- return (String[])(RECOGNIZED_FEATURES.clone());
- } // getRecognizedFeatures():String[]
-
- /**
- * Sets the state of a feature. This method is called by the component
- * manager any time after reset when a feature changes state.
- * <p>
- * <strong>Note:</strong> Components should silently ignore features
- * that do not affect the operation of the component.
- *
- * @param featureId The feature identifier.
- * @param state The state of the feature.
- *
- * @throws SAXNotRecognizedException The component should not throw
- * this exception.
- * @throws SAXNotSupportedException The component should not throw
- * this exception.
- */
- public void setFeature(String featureId, boolean state)
- throws XMLConfigurationException {
- } // setFeature(String,boolean)
-
- /**
- * Returns a list of property identifiers that are recognized by
- * this component. This method may return null if no properties
- * are recognized by this component.
- */
- public String[] getRecognizedProperties() {
- return (String[])(RECOGNIZED_PROPERTIES.clone());
- } // getRecognizedProperties():String[]
-
- /**
- * Sets the value of a property during parsing.
- *
- * @param propertyId
- * @param value
- */
- public void setProperty(String propertyId, Object value)
- throws XMLConfigurationException {
-
- // Xerces properties
- if (propertyId.startsWith(Constants.XERCES_PROPERTY_PREFIX)) {
- final int suffixLength = propertyId.length() - Constants.XERCES_PROPERTY_PREFIX.length();
-
- if (suffixLength == Constants.SYMBOL_TABLE_PROPERTY.length() &&
- propertyId.endsWith(Constants.SYMBOL_TABLE_PROPERTY)) {
- fSymbolTable = (SymbolTable)value;
- }
- else if (suffixLength == Constants.ERROR_REPORTER_PROPERTY.length() &&
- propertyId.endsWith(Constants.ERROR_REPORTER_PROPERTY)) {
- fErrorReporter = (XMLErrorReporter)value;
- }
- return;
- }
-
- } // setProperty(String,Object)
-
- /**
- * Returns the default state for a feature, or null if this
- * component does not want to report a default value for this
- * feature.
- *
- * @param featureId The feature identifier.
- *
- * @since Xerces 2.2.0
- */
- public Boolean getFeatureDefault(String featureId) {
- for (int i = 0; i < RECOGNIZED_FEATURES.length; i++) {
- if (RECOGNIZED_FEATURES[i].equals(featureId)) {
- return FEATURE_DEFAULTS[i];
- }
- }
- return null;
- } // getFeatureDefault(String):Boolean
-
- /**
- * Returns the default state for a property, or null if this
- * component does not want to report a default value for this
- * property.
- *
- * @param propertyId The property identifier.
- *
- * @since Xerces 2.2.0
- */
- public Object getPropertyDefault(String propertyId) {
- for (int i = 0; i < RECOGNIZED_PROPERTIES.length; i++) {
- if (RECOGNIZED_PROPERTIES[i].equals(propertyId)) {
- return PROPERTY_DEFAULTS[i];
- }
- }
- return null;
- } // getPropertyDefault(String):Object
-
- //
- // XMLDocumentSource methods
- //
-
- /** Sets the document handler to receive information about the document. */
- public void setDocumentHandler(XMLDocumentHandler documentHandler) {
- fDocumentHandler = documentHandler;
- } // setDocumentHandler(XMLDocumentHandler)
-
- /** Returns the document handler */
- public XMLDocumentHandler getDocumentHandler() {
- return fDocumentHandler;
- } // setDocumentHandler(XMLDocumentHandler)
-
-
- //
- // XMLDocumentHandler methods
- //
-
- /** Sets the document source */
- public void setDocumentSource(XMLDocumentSource source){
- fDocumentSource = source;
- } // setDocumentSource
-
- /** Returns the document source */
- public XMLDocumentSource getDocumentSource (){
- return fDocumentSource;
- } // getDocumentSource
-
-
- /**
- * This method notifies the start of a general entity.
- * <p>
- * <strong>Note:</strong> This method is not called for entity references
- * appearing as part of attribute values.
- *
- * @param name The name of the general entity.
- * @param identifier The resource identifier.
- * @param encoding The auto-detected IANA encoding name of the entity
- * stream. This value will be null in those situations
- * where the entity encoding is not auto-detected (e.g.
- * internal entities or a document entity that is
- * parsed from a java.io.Reader).
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException Thrown by handler to signal an error.
- */
- public void startGeneralEntity(String name,
- XMLResourceIdentifier identifier,
- String encoding, Augmentations augs)
- throws XNIException {
- if (fDocumentHandler != null && !fOnlyPassPrefixMappingEvents) {
- fDocumentHandler.startGeneralEntity(name, identifier, encoding, augs);
- }
- } // startEntity(String,String,String,String,String)
-
- /**
- * Notifies of the presence of a TextDecl line in an entity. If present,
- * this method will be called immediately following the startEntity call.
- * <p>
- * <strong>Note:</strong> This method will never be called for the
- * document entity; it is only called for external general entities
- * referenced in document content.
- * <p>
- * <strong>Note:</strong> This method is not called for entity references
- * appearing as part of attribute values.
- *
- * @param version The XML version, or null if not specified.
- * @param encoding The IANA encoding name of the entity.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void textDecl(String version, String encoding, Augmentations augs)
- throws XNIException {
- if (fDocumentHandler != null && !fOnlyPassPrefixMappingEvents) {
- fDocumentHandler.textDecl(version, encoding, augs);
- }
- } // textDecl(String,String)
-
- /**
- * The start of the document.
- *
- * @param locator The system identifier of the entity if the entity
- * is external, null otherwise.
- * @param encoding The auto-detected IANA encoding name of the entity
- * stream. This value will be null in those situations
- * where the entity encoding is not auto-detected (e.g.
- * internal entities or a document entity that is
- * parsed from a java.io.Reader).
- * @param namespaceContext
- * The namespace context in effect at the
- * start of this document.
- * This object represents the current context.
- * Implementors of this class are responsible
- * for copying the namespace bindings from the
- * the current context (and its parent contexts)
- * if that information is important.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startDocument(XMLLocator locator, String encoding,
- NamespaceContext namespaceContext, Augmentations augs)
- throws XNIException {
- fNamespaceContext = namespaceContext;
-
- if (fDocumentHandler != null && !fOnlyPassPrefixMappingEvents) {
- fDocumentHandler.startDocument(locator, encoding, namespaceContext, augs);
- }
- } // startDocument(XMLLocator,String)
-
- /**
- * Notifies of the presence of an XMLDecl line in the document. If
- * present, this method will be called immediately following the
- * startDocument call.
- *
- * @param version The XML version.
- * @param encoding The IANA encoding name of the document, or null if
- * not specified.
- * @param standalone The standalone value, or null if not specified.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void xmlDecl(String version, String encoding, String standalone, Augmentations augs)
- throws XNIException {
- if (fDocumentHandler != null && !fOnlyPassPrefixMappingEvents) {
- fDocumentHandler.xmlDecl(version, encoding, standalone, augs);
- }
- } // xmlDecl(String,String,String)
-
- /**
- * Notifies of the presence of the DOCTYPE line in the document.
- *
- * @param rootElement The name of the root element.
- * @param publicId The public identifier if an external DTD or null
- * if the external DTD is specified using SYSTEM.
- * @param systemId The system identifier if an external DTD, null
- * otherwise.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void doctypeDecl(String rootElement,
- String publicId, String systemId, Augmentations augs)
- throws XNIException {
- if (fDocumentHandler != null && !fOnlyPassPrefixMappingEvents) {
- fDocumentHandler.doctypeDecl(rootElement, publicId, systemId, augs);
- }
- } // doctypeDecl(String,String,String)
-
- /**
- * A comment.
- *
- * @param text The text in the comment.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by application to signal an error.
- */
- public void comment(XMLString text, Augmentations augs) throws XNIException {
- if (fDocumentHandler != null && !fOnlyPassPrefixMappingEvents) {
- fDocumentHandler.comment(text, augs);
- }
- } // comment(XMLString)
-
- /**
- * A processing instruction. Processing instructions consist of a
- * target name and, optionally, text data. The data is only meaningful
- * to the application.
- * <p>
- * Typically, a processing instruction's data will contain a series
- * of pseudo-attributes. These pseudo-attributes follow the form of
- * element attributes but are <strong>not</strong> parsed or presented
- * to the application as anything other than text. The application is
- * responsible for parsing the data.
- *
- * @param target The target.
- * @param data The data or null if none specified.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void processingInstruction(String target, XMLString data, Augmentations augs)
- throws XNIException {
- if (fDocumentHandler != null && !fOnlyPassPrefixMappingEvents) {
- fDocumentHandler.processingInstruction(target, data, augs);
- }
- } // processingInstruction(String,XMLString)
-
-
- /**
- * Binds the namespaces. This method will handle calling the
- * document handler to start the prefix mappings.
- * <p>
- * <strong>Note:</strong> This method makes use of the
- * fAttributeQName variable. Any contents of the variable will
- * be destroyed. Caller should copy the values out of this
- * temporary variable before calling this method.
- *
- * @param element The name of the element.
- * @param attributes The element attributes.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startElement(QName element, XMLAttributes attributes, Augmentations augs)
- throws XNIException {
-
- if (fNamespaces) {
- handleStartElement(element, attributes, augs, false);
- }
- else if (fDocumentHandler != null) {
- fDocumentHandler.startElement(element, attributes, augs);
- }
-
-
- } // startElement(QName,XMLAttributes)
-
- /**
- * An empty element.
- *
- * @param element The name of the element.
- * @param attributes The element attributes.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void emptyElement(QName element, XMLAttributes attributes, Augmentations augs)
- throws XNIException {
-
- if (fNamespaces) {
- handleStartElement(element, attributes, augs, true);
- handleEndElement(element, augs, true);
- }
- else if (fDocumentHandler != null) {
- fDocumentHandler.emptyElement(element, attributes, augs);
- }
-
- } // emptyElement(QName,XMLAttributes)
-
- /**
- * Character content.
- *
- * @param text The content.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void characters(XMLString text, Augmentations augs) throws XNIException {
- if (fDocumentHandler != null && !fOnlyPassPrefixMappingEvents) {
- fDocumentHandler.characters(text, augs);
- }
- } // characters(XMLString)
-
- /**
- * Ignorable whitespace. For this method to be called, the document
- * source must have some way of determining that the text containing
- * only whitespace characters should be considered ignorable. For
- * example, the validator can determine if a length of whitespace
- * characters in the document are ignorable based on the element
- * content model.
- *
- * @param text The ignorable whitespace.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void ignorableWhitespace(XMLString text, Augmentations augs) throws XNIException {
- if (fDocumentHandler != null && !fOnlyPassPrefixMappingEvents) {
- fDocumentHandler.ignorableWhitespace(text, augs);
- }
- } // ignorableWhitespace(XMLString)
-
- /**
- * The end of an element.
- *
- * @param element The name of the element.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endElement(QName element, Augmentations augs) throws XNIException {
-
- if (fNamespaces) {
- handleEndElement(element, augs, false);
- }
- else if (fDocumentHandler != null) {
- fDocumentHandler.endElement(element, augs);
- }
-
- } // endElement(QName)
-
- /**
- * The start of a CDATA section.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startCDATA(Augmentations augs) throws XNIException {
- if (fDocumentHandler != null && !fOnlyPassPrefixMappingEvents) {
- fDocumentHandler.startCDATA(augs);
- }
- } // startCDATA()
-
- /**
- * The end of a CDATA section.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endCDATA(Augmentations augs) throws XNIException {
- if (fDocumentHandler != null && !fOnlyPassPrefixMappingEvents) {
- fDocumentHandler.endCDATA(augs);
- }
- } // endCDATA()
-
- /**
- * The end of the document.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endDocument(Augmentations augs) throws XNIException {
- if (fDocumentHandler != null && !fOnlyPassPrefixMappingEvents) {
- fDocumentHandler.endDocument(augs);
- }
- } // endDocument()
-
- /**
- * This method notifies the end of a general entity.
- * <p>
- * <strong>Note:</strong> This method is not called for entity references
- * appearing as part of attribute values.
- *
- * @param name The name of the entity.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void endGeneralEntity(String name, Augmentations augs) throws XNIException {
- if (fDocumentHandler != null && !fOnlyPassPrefixMappingEvents) {
- fDocumentHandler.endGeneralEntity(name, augs);
- }
- } // endEntity(String)
-
- //
- // Protected methods
- //
-
- /** Handles start element. */
- protected void handleStartElement(QName element, XMLAttributes attributes,
- Augmentations augs,
- boolean isEmpty) throws XNIException {
-
- // add new namespace context
- fNamespaceContext.pushContext();
-
- if (element.prefix == XMLSymbols.PREFIX_XMLNS) {
- fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN,
- "ElementXMLNSPrefix",
- new Object[]{element.rawname},
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
-
- // search for new namespace bindings
- int length = attributes.getLength();
- for (int i = 0; i < length; i++) {
- String localpart = attributes.getLocalName(i);
- String prefix = attributes.getPrefix(i);
- // when it's of form xmlns="..." or xmlns:prefix="...",
- // it's a namespace declaration. but prefix:xmlns="..." isn't.
- if (prefix == XMLSymbols.PREFIX_XMLNS ||
- prefix == XMLSymbols.EMPTY_STRING && localpart == XMLSymbols.PREFIX_XMLNS) {
-
- // get the internalized value of this attribute
- String uri = fSymbolTable.addSymbol(attributes.getValue(i));
-
- // 1. "xmlns" can't be bound to any namespace
- if (prefix == XMLSymbols.PREFIX_XMLNS && localpart == XMLSymbols.PREFIX_XMLNS) {
- fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN,
- "CantBindXMLNS",
- new Object[]{attributes.getQName(i)},
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
-
- // 2. the namespace for "xmlns" can't be bound to any prefix
- if (uri == NamespaceContext.XMLNS_URI) {
- fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN,
- "CantBindXMLNS",
- new Object[]{attributes.getQName(i)},
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
-
- // 3. "xml" can't be bound to any other namespace than it's own
- if (localpart == XMLSymbols.PREFIX_XML) {
- if (uri != NamespaceContext.XML_URI) {
- fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN,
- "CantBindXML",
- new Object[]{attributes.getQName(i)},
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
- }
- // 4. the namespace for "xml" can't be bound to any other prefix
- else {
- if (uri ==NamespaceContext.XML_URI) {
- fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN,
- "CantBindXML",
- new Object[]{attributes.getQName(i)},
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
- }
-
- prefix = localpart != XMLSymbols.PREFIX_XMLNS ? localpart : XMLSymbols.EMPTY_STRING;
-
- // http://www.w3.org/TR/1999/REC-xml-names-19990114/#dt-prefix
- // We should only report an error if there is a prefix,
- // that is, the local part is not "xmlns". -SG
- // Since this is an error condition in XML 1.0,
- // and should be relatively uncommon in XML 1.1,
- // making this test into a method call to reuse code
- // should be acceptable. - NG
- if(prefixBoundToNullURI(uri, localpart)) {
- fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN,
- "EmptyPrefixedAttName",
- new Object[]{attributes.getQName(i)},
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- continue;
- }
-
- // declare prefix in context
- fNamespaceContext.declarePrefix(prefix, uri.length() != 0 ? uri : null);
-
- }
- }
-
- // bind the element
- String prefix = element.prefix != null
- ? element.prefix : XMLSymbols.EMPTY_STRING;
- element.uri = fNamespaceContext.getURI(prefix);
- if (element.prefix == null && element.uri != null) {
- element.prefix = XMLSymbols.EMPTY_STRING;
- }
- if (element.prefix != null && element.uri == null) {
- fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN,
- "ElementPrefixUnbound",
- new Object[]{element.prefix, element.rawname},
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
-
- // bind the attributes
- for (int i = 0; i < length; i++) {
- attributes.getName(i, fAttributeQName);
- String aprefix = fAttributeQName.prefix != null
- ? fAttributeQName.prefix : XMLSymbols.EMPTY_STRING;
- String arawname = fAttributeQName.rawname;
- if (arawname == XMLSymbols.PREFIX_XMLNS) {
- fAttributeQName.uri = fNamespaceContext.getURI(XMLSymbols.PREFIX_XMLNS);
- attributes.setName(i, fAttributeQName);
- }
- else if (aprefix != XMLSymbols.EMPTY_STRING) {
- fAttributeQName.uri = fNamespaceContext.getURI(aprefix);
- if (fAttributeQName.uri == null) {
- fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN,
- "AttributePrefixUnbound",
- new Object[]{element.rawname,arawname,aprefix},
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
- attributes.setName(i, fAttributeQName);
- }
- }
-
- // verify that duplicate attributes don't exist
- // Example: <foo xmlns:a='NS' xmlns:b='NS' a:attr='v1' b:attr='v2'/>
- int attrCount = attributes.getLength();
- for (int i = 0; i < attrCount - 1; i++) {
- String auri = attributes.getURI(i);
- if (auri == null || auri == NamespaceContext.XMLNS_URI) {
- continue;
- }
- String alocalpart = attributes.getLocalName(i);
- for (int j = i + 1; j < attrCount; j++) {
- String blocalpart = attributes.getLocalName(j);
- String buri = attributes.getURI(j);
- if (alocalpart == blocalpart && auri == buri) {
- fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN,
- "AttributeNSNotUnique",
- new Object[]{element.rawname,alocalpart, auri},
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
- }
- }
-
- // call handler
- if (fDocumentHandler != null && !fOnlyPassPrefixMappingEvents) {
- if (isEmpty) {
- fDocumentHandler.emptyElement(element, attributes, augs);
- }
- else {
- fDocumentHandler.startElement(element, attributes, augs);
- }
- }
-
-
- } // handleStartElement(QName,XMLAttributes,boolean)
-
- /** Handles end element. */
- protected void handleEndElement(QName element, Augmentations augs, boolean isEmpty)
- throws XNIException {
-
- // bind element
- String eprefix = element.prefix != null ? element.prefix : XMLSymbols.EMPTY_STRING;
- element.uri = fNamespaceContext.getURI(eprefix);
- if (element.uri != null) {
- element.prefix = eprefix;
- }
-
- // call handlers
- if (fDocumentHandler != null && !fOnlyPassPrefixMappingEvents) {
- if (!isEmpty) {
- fDocumentHandler.endElement(element, augs);
- }
- }
-
- // pop context
- fNamespaceContext.popContext();
-
- } // handleEndElement(QName,boolean)
-
- // returns true iff the given prefix is bound to "" *and*
- // this is disallowed by the version of XML namespaces in use.
- protected boolean prefixBoundToNullURI(String uri, String localpart) {
- return (uri == XMLSymbols.EMPTY_STRING && localpart != XMLSymbols.PREFIX_XMLNS);
- } // prefixBoundToNullURI(String, String): boolean
-
-} // class XMLNamespaceBinder
diff --git a/src/com/sun/org/apache/xerces/internal/impl/XMLScanner.java b/src/com/sun/org/apache/xerces/internal/impl/XMLScanner.java
deleted file mode 100644
index fb12b42..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/XMLScanner.java
+++ /dev/null
@@ -1,1557 +0,0 @@
-/*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
- */
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl;
-
-import com.sun.org.apache.xerces.internal.util.Status;
-import com.sun.xml.internal.stream.XMLEntityStorage;
-import java.io.IOException;
-import java.util.ArrayList;
-import javax.xml.stream.events.XMLEvent;
-import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.util.XMLChar;
-import com.sun.org.apache.xerces.internal.util.XMLResourceIdentifierImpl;
-import com.sun.org.apache.xerces.internal.util.XMLStringBuffer;
-import com.sun.org.apache.xerces.internal.utils.XMLLimitAnalyzer;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager;
-import com.sun.org.apache.xerces.internal.xni.Augmentations;
-import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
-import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
-import com.sun.org.apache.xerces.internal.xni.XMLString;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponent;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-import com.sun.xml.internal.stream.Entity;
-
-//import com.sun.xml.stream.XMLEntityManager;
-//import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
-
-/**
- * This class is responsible for holding scanning methods common to
- * scanning the XML document structure and content as well as the DTD
- * structure and content. Both XMLDocumentScanner and XMLDTDScanner inherit
- * from this base class.
- *
- * <p>
- * This component requires the following features and properties from the
- * component manager that uses it:
- * <ul>
- * <li>http://xml.org/sax/features/validation</li>
- * <li>http://apache.org/xml/features/scanner/notify-char-refs</li>
- * <li>http://apache.org/xml/properties/internal/symbol-table</li>
- * <li>http://apache.org/xml/properties/internal/error-reporter</li>
- * <li>http://apache.org/xml/properties/internal/entity-manager</li>
- * </ul>
- *
- * @author Andy Clark, IBM
- * @author Arnaud Le Hors, IBM
- * @author Eric Ye, IBM
- * @author K.Venugopal SUN Microsystems
- * @author Sunitha Reddy, SUN Microsystems
- * @version $Id: XMLScanner.java,v 1.12 2010-11-01 04:39:41 joehw Exp $
- */
-public abstract class XMLScanner
- implements XMLComponent {
-
- //
- // Constants
- //
-
- // feature identifiers
-
- /** Feature identifier: namespaces. */
- protected static final String NAMESPACES =
- Constants.SAX_FEATURE_PREFIX + Constants.NAMESPACES_FEATURE;
-
- /** Feature identifier: validation. */
- protected static final String VALIDATION =
- Constants.SAX_FEATURE_PREFIX + Constants.VALIDATION_FEATURE;
-
- /** Feature identifier: notify character references. */
- protected static final String NOTIFY_CHAR_REFS =
- Constants.XERCES_FEATURE_PREFIX + Constants.NOTIFY_CHAR_REFS_FEATURE;
-
- // property identifiers
-
- protected static final String PARSER_SETTINGS =
- Constants.XERCES_FEATURE_PREFIX + Constants.PARSER_SETTINGS;
- /** Property identifier: symbol table. */
- protected static final String SYMBOL_TABLE =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY;
-
- /** Property identifier: error reporter. */
- protected static final String ERROR_REPORTER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY;
-
- /** Property identifier: entity manager. */
- protected static final String ENTITY_MANAGER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_MANAGER_PROPERTY;
-
- /** Property identifier: Security manager. */
- private static final String SECURITY_MANAGER = Constants.SECURITY_MANAGER;
-
- // debugging
-
- /** Debug attribute normalization. */
- protected static final boolean DEBUG_ATTR_NORMALIZATION = false;
-
- /**
- * Type of names
- */
- public static enum NameType {
- ATTRIBUTE("attribute"),
- ATTRIBUTENAME("attribute name"),
- COMMENT("comment"),
- DOCTYPE("doctype"),
- ELEMENTSTART("startelement"),
- ELEMENTEND("endelement"),
- ENTITY("entity"),
- NOTATION("notation"),
- PI("pi"),
- REFERENCE("reference");
-
- final String literal;
- NameType(String literal) {
- this.literal = literal;
- }
-
- String literal() {
- return literal;
- }
- }
-
- //xxx: setting the default value as false, as we dont need to calculate this value
- //we should have a feature when set to true computes this value
- private boolean fNeedNonNormalizedValue = false;
-
- protected ArrayList<XMLString> attributeValueCache = new ArrayList<>();
- protected ArrayList<XMLStringBuffer> stringBufferCache = new ArrayList<>();
- protected int fStringBufferIndex = 0;
- protected boolean fAttributeCacheInitDone = false;
- protected int fAttributeCacheUsedCount = 0;
-
- //
- // Data
- //
-
- // features
-
- /**
- * Validation. This feature identifier is:
- * http://xml.org/sax/features/validation
- */
- protected boolean fValidation = false;
-
- /** Namespaces. */
- protected boolean fNamespaces;
-
- /** Character references notification. */
- protected boolean fNotifyCharRefs = false;
-
- /** Internal parser-settings feature */
- protected boolean fParserSettings = true;
-
- // properties
-
- protected PropertyManager fPropertyManager = null ;
- /** Symbol table. */
- protected SymbolTable fSymbolTable;
-
- /** Error reporter. */
- protected XMLErrorReporter fErrorReporter;
-
- /** Entity manager. */
- //protected XMLEntityManager fEntityManager = PropertyManager.getEntityManager();
- protected XMLEntityManager fEntityManager = null ;
-
- /** xxx this should be available from EntityManager Entity storage */
- protected XMLEntityStorage fEntityStore = null ;
-
- /** Security manager. */
- protected XMLSecurityManager fSecurityManager = null;
-
- /** Limit analyzer. */
- protected XMLLimitAnalyzer fLimitAnalyzer = null;
-
- // protected data
-
- /** event type */
- protected XMLEvent fEvent ;
-
- /** Entity scanner, this always works on last entity that was opened. */
- protected XMLEntityScanner fEntityScanner = null;
-
- /** Entity depth. */
- protected int fEntityDepth;
-
- /** Literal value of the last character reference scanned. */
- protected String fCharRefLiteral = null;
-
- /** Scanning attribute. */
- protected boolean fScanningAttribute;
-
- /** Report entity boundary. */
- protected boolean fReportEntity;
-
- // symbols
-
- /** Symbol: "version". */
- protected final static String fVersionSymbol = "version".intern();
-
- /** Symbol: "encoding". */
- protected final static String fEncodingSymbol = "encoding".intern();
-
- /** Symbol: "standalone". */
- protected final static String fStandaloneSymbol = "standalone".intern();
-
- /** Symbol: "amp". */
- protected final static String fAmpSymbol = "amp".intern();
-
- /** Symbol: "lt". */
- protected final static String fLtSymbol = "lt".intern();
-
- /** Symbol: "gt". */
- protected final static String fGtSymbol = "gt".intern();
-
- /** Symbol: "quot". */
- protected final static String fQuotSymbol = "quot".intern();
-
- /** Symbol: "apos". */
- protected final static String fAposSymbol = "apos".intern();
-
- // temporary variables
-
- // NOTE: These objects are private to help prevent accidental modification
- // of values by a subclass. If there were protected *and* the sub-
- // modified the values, it would be difficult to track down the real
- // cause of the bug. By making these private, we avoid this
- // possibility.
-
- /** String. */
- private XMLString fString = new XMLString();
-
- /** String buffer. */
- private XMLStringBuffer fStringBuffer = new XMLStringBuffer();
-
- /** String buffer. */
- private XMLStringBuffer fStringBuffer2 = new XMLStringBuffer();
-
- /** String buffer. */
- private XMLStringBuffer fStringBuffer3 = new XMLStringBuffer();
-
- // temporary location for Resource identification information.
- protected XMLResourceIdentifierImpl fResourceIdentifier = new XMLResourceIdentifierImpl();
- int initialCacheCount = 6;
- //
- // XMLComponent methods
- //
-
- /**
- *
- *
- * @param componentManager The component manager.
- *
- * @throws SAXException Throws exception if required features and
- * properties cannot be found.
- */
- public void reset(XMLComponentManager componentManager)
- throws XMLConfigurationException {
-
- fParserSettings = componentManager.getFeature(PARSER_SETTINGS, true);
-
- if (!fParserSettings) {
- // parser settings have not been changed
- init();
- return;
- }
-
-
- // Xerces properties
- fSymbolTable = (SymbolTable)componentManager.getProperty(SYMBOL_TABLE);
- fErrorReporter = (XMLErrorReporter)componentManager.getProperty(ERROR_REPORTER);
- fEntityManager = (XMLEntityManager)componentManager.getProperty(ENTITY_MANAGER);
- fSecurityManager = (XMLSecurityManager)componentManager.getProperty(SECURITY_MANAGER);
-
- //this step is extra because we have separated the storage of entity
- fEntityStore = fEntityManager.getEntityStore() ;
-
- // sax features
- fValidation = componentManager.getFeature(VALIDATION, false);
- fNamespaces = componentManager.getFeature(NAMESPACES, true);
- fNotifyCharRefs = componentManager.getFeature(NOTIFY_CHAR_REFS, false);
-
- init();
- } // reset(XMLComponentManager)
-
- protected void setPropertyManager(PropertyManager propertyManager){
- fPropertyManager = propertyManager ;
- }
-
- /**
- * Sets the value of a property during parsing.
- *
- * @param propertyId
- * @param value
- */
- public void setProperty(String propertyId, Object value)
- throws XMLConfigurationException {
-
- // Xerces properties
- if (propertyId.startsWith(Constants.XERCES_PROPERTY_PREFIX)) {
- String property =
- propertyId.substring(Constants.XERCES_PROPERTY_PREFIX.length());
- if (property.equals(Constants.SYMBOL_TABLE_PROPERTY)) {
- fSymbolTable = (SymbolTable)value;
- } else if (property.equals(Constants.ERROR_REPORTER_PROPERTY)) {
- fErrorReporter = (XMLErrorReporter)value;
- } else if (property.equals(Constants.ENTITY_MANAGER_PROPERTY)) {
- fEntityManager = (XMLEntityManager)value;
- }
- }
-
- if (propertyId.equals(SECURITY_MANAGER)) {
- fSecurityManager = (XMLSecurityManager)value;
- }
- /*else if(propertyId.equals(Constants.STAX_PROPERTIES)){
- fStaxProperties = (HashMap)value;
- //TODO::discuss with neeraj what are his thoughts on passing properties.
- //For now use this
- }*/
-
- } // setProperty(String,Object)
-
- /*
- * Sets the feature of the scanner.
- */
- public void setFeature(String featureId, boolean value)
- throws XMLConfigurationException {
-
- if (VALIDATION.equals(featureId)) {
- fValidation = value;
- } else if (NOTIFY_CHAR_REFS.equals(featureId)) {
- fNotifyCharRefs = value;
- }
- }
-
- /*
- * Gets the state of the feature of the scanner.
- */
- public boolean getFeature(String featureId)
- throws XMLConfigurationException {
-
- if (VALIDATION.equals(featureId)) {
- return fValidation;
- } else if (NOTIFY_CHAR_REFS.equals(featureId)) {
- return fNotifyCharRefs;
- }
- throw new XMLConfigurationException(Status.NOT_RECOGNIZED, featureId);
- }
-
- //
- // Protected methods
- //
-
- // anybody calling this had better have set Symtoltable!
- protected void reset() {
- init();
-
- // DTD preparsing defaults:
- fValidation = true;
- fNotifyCharRefs = false;
-
- }
-
- public void reset(PropertyManager propertyManager) {
- init();
- // Xerces properties
- fSymbolTable = (SymbolTable)propertyManager.getProperty(Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY);
-
- fErrorReporter = (XMLErrorReporter)propertyManager.getProperty(Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY);
-
- fEntityManager = (XMLEntityManager)propertyManager.getProperty(ENTITY_MANAGER);
- fEntityStore = fEntityManager.getEntityStore() ;
- fEntityScanner = (XMLEntityScanner)fEntityManager.getEntityScanner() ;
- fSecurityManager = (XMLSecurityManager)propertyManager.getProperty(SECURITY_MANAGER);
-
- //fEntityManager.reset();
- // DTD preparsing defaults:
- fValidation = false;
- fNotifyCharRefs = false;
-
- }
- // common scanning methods
-
- /**
- * Scans an XML or text declaration.
- * <p>
- * <pre>
- * [23] XMLDecl ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>'
- * [24] VersionInfo ::= S 'version' Eq (' VersionNum ' | " VersionNum ")
- * [80] EncodingDecl ::= S 'encoding' Eq ('"' EncName '"' | "'" EncName "'" )
- * [81] EncName ::= [A-Za-z] ([A-Za-z0-9._] | '-')*
- * [32] SDDecl ::= S 'standalone' Eq (("'" ('yes' | 'no') "'")
- * | ('"' ('yes' | 'no') '"'))
- *
- * [77] TextDecl ::= '<?xml' VersionInfo? EncodingDecl S? '?>'
- * </pre>
- *
- * @param scanningTextDecl True if a text declaration is to
- * be scanned instead of an XML
- * declaration.
- * @param pseudoAttributeValues An array of size 3 to return the version,
- * encoding and standalone pseudo attribute values
- * (in that order).
- *
- * <strong>Note:</strong> This method uses fString, anything in it
- * at the time of calling is lost.
- */
- protected void scanXMLDeclOrTextDecl(boolean scanningTextDecl,
- String[] pseudoAttributeValues)
- throws IOException, XNIException {
-
- // pseudo-attribute values
- String version = null;
- String encoding = null;
- String standalone = null;
-
- // scan pseudo-attributes
- final int STATE_VERSION = 0;
- final int STATE_ENCODING = 1;
- final int STATE_STANDALONE = 2;
- final int STATE_DONE = 3;
- int state = STATE_VERSION;
-
- boolean dataFoundForTarget = false;
- boolean sawSpace = fEntityScanner.skipSpaces();
- // since pseudoattributes are *not* attributes,
- // their quotes don't need to be preserved in external parameter entities.
- // the XMLEntityScanner#scanLiteral method will continue to
- // emit -1 in such cases when it finds a quote; this is
- // fine for other methods that parse scanned entities,
- // but not for the scanning of pseudoattributes. So,
- // temporarily, we must mark the current entity as not being "literal"
- Entity.ScannedEntity currEnt = fEntityManager.getCurrentEntity();
- boolean currLiteral = currEnt.literal;
- currEnt.literal = false;
- while (fEntityScanner.peekChar() != '?') {
- dataFoundForTarget = true;
- String name = scanPseudoAttribute(scanningTextDecl, fString);
- switch (state) {
- case STATE_VERSION: {
- if (name.equals(fVersionSymbol)) {
- if (!sawSpace) {
- reportFatalError(scanningTextDecl
- ? "SpaceRequiredBeforeVersionInTextDecl"
- : "SpaceRequiredBeforeVersionInXMLDecl",
- null);
- }
- version = fString.toString();
- state = STATE_ENCODING;
- if (!versionSupported(version)) {
- reportFatalError("VersionNotSupported",
- new Object[]{version});
- }
-
- if (version.equals("1.1")) {
- Entity.ScannedEntity top = fEntityManager.getTopLevelEntity();
- if (top != null && (top.version == null || top.version.equals("1.0"))) {
- reportFatalError("VersionMismatch", null);
- }
- fEntityManager.setScannerVersion(Constants.XML_VERSION_1_1);
- }
-
- } else if (name.equals(fEncodingSymbol)) {
- if (!scanningTextDecl) {
- reportFatalError("VersionInfoRequired", null);
- }
- if (!sawSpace) {
- reportFatalError(scanningTextDecl
- ? "SpaceRequiredBeforeEncodingInTextDecl"
- : "SpaceRequiredBeforeEncodingInXMLDecl",
- null);
- }
- encoding = fString.toString();
- state = scanningTextDecl ? STATE_DONE : STATE_STANDALONE;
- } else {
- if (scanningTextDecl) {
- reportFatalError("EncodingDeclRequired", null);
- } else {
- reportFatalError("VersionInfoRequired", null);
- }
- }
- break;
- }
- case STATE_ENCODING: {
- if (name.equals(fEncodingSymbol)) {
- if (!sawSpace) {
- reportFatalError(scanningTextDecl
- ? "SpaceRequiredBeforeEncodingInTextDecl"
- : "SpaceRequiredBeforeEncodingInXMLDecl",
- null);
- }
- encoding = fString.toString();
- state = scanningTextDecl ? STATE_DONE : STATE_STANDALONE;
- // TODO: check encoding name; set encoding on
- // entity scanner
- } else if (!scanningTextDecl && name.equals(fStandaloneSymbol)) {
- if (!sawSpace) {
- reportFatalError("SpaceRequiredBeforeStandalone",
- null);
- }
- standalone = fString.toString();
- state = STATE_DONE;
- if (!standalone.equals("yes") && !standalone.equals("no")) {
- reportFatalError("SDDeclInvalid", new Object[] {standalone});
- }
- } else {
- reportFatalError("EncodingDeclRequired", null);
- }
- break;
- }
- case STATE_STANDALONE: {
- if (name.equals(fStandaloneSymbol)) {
- if (!sawSpace) {
- reportFatalError("SpaceRequiredBeforeStandalone",
- null);
- }
- standalone = fString.toString();
- state = STATE_DONE;
- if (!standalone.equals("yes") && !standalone.equals("no")) {
- reportFatalError("SDDeclInvalid", new Object[] {standalone});
- }
- } else {
- reportFatalError("SDDeclNameInvalid", null);
- }
- break;
- }
- default: {
- reportFatalError("NoMorePseudoAttributes", null);
- }
- }
- sawSpace = fEntityScanner.skipSpaces();
- }
- // restore original literal value
- if(currLiteral) {
- currEnt.literal = true;
- }
- // REVISIT: should we remove this error reporting?
- if (scanningTextDecl && state != STATE_DONE) {
- reportFatalError("MorePseudoAttributes", null);
- }
-
- // If there is no data in the xml or text decl then we fail to report error
- // for version or encoding info above.
- if (scanningTextDecl) {
- if (!dataFoundForTarget && encoding == null) {
- reportFatalError("EncodingDeclRequired", null);
- }
- } else {
- if (!dataFoundForTarget && version == null) {
- reportFatalError("VersionInfoRequired", null);
- }
- }
-
- // end
- if (!fEntityScanner.skipChar('?', null)) {
- reportFatalError("XMLDeclUnterminated", null);
- }
- if (!fEntityScanner.skipChar('>', null)) {
- reportFatalError("XMLDeclUnterminated", null);
-
- }
-
- // fill in return array
- pseudoAttributeValues[0] = version;
- pseudoAttributeValues[1] = encoding;
- pseudoAttributeValues[2] = standalone;
-
- } // scanXMLDeclOrTextDecl(boolean)
-
- /**
- * Scans a pseudo attribute.
- *
- * @param scanningTextDecl True if scanning this pseudo-attribute for a
- * TextDecl; false if scanning XMLDecl. This
- * flag is needed to report the correct type of
- * error.
- * @param value The string to fill in with the attribute
- * value.
- *
- * @return The name of the attribute
- *
- * <strong>Note:</strong> This method uses fStringBuffer2, anything in it
- * at the time of calling is lost.
- */
- protected String scanPseudoAttribute(boolean scanningTextDecl,
- XMLString value)
- throws IOException, XNIException {
-
- String name = scanPseudoAttributeName();
- // XMLEntityManager.print(fEntityManager.getCurrentEntity());
-
- if (name == null) {
- reportFatalError("PseudoAttrNameExpected", null);
- }
- fEntityScanner.skipSpaces();
- if (!fEntityScanner.skipChar('=', null)) {
- reportFatalError(scanningTextDecl ? "EqRequiredInTextDecl"
- : "EqRequiredInXMLDecl", new Object[]{name});
- }
- fEntityScanner.skipSpaces();
- int quote = fEntityScanner.peekChar();
- if (quote != '\'' && quote != '"') {
- reportFatalError(scanningTextDecl ? "QuoteRequiredInTextDecl"
- : "QuoteRequiredInXMLDecl" , new Object[]{name});
- }
- fEntityScanner.scanChar(NameType.ATTRIBUTE);
- int c = fEntityScanner.scanLiteral(quote, value, false);
- if (c != quote) {
- fStringBuffer2.clear();
- do {
- fStringBuffer2.append(value);
- if (c != -1) {
- if (c == '&' || c == '%' || c == '<' || c == ']') {
- fStringBuffer2.append((char)fEntityScanner.scanChar(NameType.ATTRIBUTE));
- } else if (XMLChar.isHighSurrogate(c)) {
- scanSurrogates(fStringBuffer2);
- } else if (isInvalidLiteral(c)) {
- String key = scanningTextDecl
- ? "InvalidCharInTextDecl" : "InvalidCharInXMLDecl";
- reportFatalError(key,
- new Object[] {Integer.toString(c, 16)});
- fEntityScanner.scanChar(null);
- }
- }
- c = fEntityScanner.scanLiteral(quote, value, false);
- } while (c != quote);
- fStringBuffer2.append(value);
- value.setValues(fStringBuffer2);
- }
- if (!fEntityScanner.skipChar(quote, null)) {
- reportFatalError(scanningTextDecl ? "CloseQuoteMissingInTextDecl"
- : "CloseQuoteMissingInXMLDecl",
- new Object[]{name});
- }
-
- // return
- return name;
-
- } // scanPseudoAttribute(XMLString):String
-
- /**
- * Scans the name of a pseudo attribute. The only legal names
- * in XML 1.0/1.1 documents are 'version', 'encoding' and 'standalone'.
- *
- * @return the name of the pseudo attribute or <code>null</code>
- * if a legal pseudo attribute name could not be scanned.
- */
- private String scanPseudoAttributeName() throws IOException, XNIException {
- final int ch = fEntityScanner.peekChar();
- switch (ch) {
- case 'v':
- if (fEntityScanner.skipString(fVersionSymbol)) {
- return fVersionSymbol;
- }
- break;
- case 'e':
- if (fEntityScanner.skipString(fEncodingSymbol)) {
- return fEncodingSymbol;
- }
- break;
- case 's':
- if (fEntityScanner.skipString(fStandaloneSymbol)) {
- return fStandaloneSymbol;
- }
- break;
- }
- return null;
- } // scanPseudoAttributeName()
-
- /**
- * Scans a processing instruction.
- * <p>
- * <pre>
- * [16] PI ::= '&lt;?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>'
- * [17] PITarget ::= Name - (('X' | 'x') ('M' | 'm') ('L' | 'l'))
- * </pre>
- */
- //CHANGED:
- //EARLIER: scanPI()
- //NOW: scanPI(XMLStringBuffer)
- //it makes things more easy if XMLStringBUffer is passed. Motivation for this change is same
- // as that for scanContent()
-
- protected void scanPI(XMLStringBuffer data) throws IOException, XNIException {
-
- // target
- fReportEntity = false;
- String target = fEntityScanner.scanName(NameType.PI);
- if (target == null) {
- reportFatalError("PITargetRequired", null);
- }
-
- // scan data
- scanPIData(target, data);
- fReportEntity = true;
-
- } // scanPI(XMLStringBuffer)
-
- /**
- * Scans a processing data. This is needed to handle the situation
- * where a document starts with a processing instruction whose
- * target name <em>starts with</em> "xml". (e.g. xmlfoo)
- *
- * This method would always read the whole data. We have while loop and data is buffered
- * until delimeter is encountered.
- *
- * @param target The PI target
- * @param data The string to fill in with the data
- */
-
- //CHANGED:
- //Earlier:This method uses the fStringBuffer and later buffer values are set to
- //the supplied XMLString....
- //Now: Changed the signature of this function to pass XMLStringBuffer.. and data would
- //be appended to that buffer
-
- protected void scanPIData(String target, XMLStringBuffer data)
- throws IOException, XNIException {
-
- // check target
- if (target.length() == 3) {
- char c0 = Character.toLowerCase(target.charAt(0));
- char c1 = Character.toLowerCase(target.charAt(1));
- char c2 = Character.toLowerCase(target.charAt(2));
- if (c0 == 'x' && c1 == 'm' && c2 == 'l') {
- reportFatalError("ReservedPITarget", null);
- }
- }
-
- // spaces
- if (!fEntityScanner.skipSpaces()) {
- if (fEntityScanner.skipString("?>")) {
- // we found the end, there is no data just return
- return;
- } else {
- // if there is data there should be some space
- reportFatalError("SpaceRequiredInPI", null);
- }
- }
-
- // since scanData appends the parsed data to the buffer passed
- // a while loop would append the whole of parsed data to the buffer(data:XMLStringBuffer)
- //until all of the data is buffered.
- if (fEntityScanner.scanData("?>", data)) {
- do {
- int c = fEntityScanner.peekChar();
- if (c != -1) {
- if (XMLChar.isHighSurrogate(c)) {
- scanSurrogates(data);
- } else if (isInvalidLiteral(c)) {
- reportFatalError("InvalidCharInPI",
- new Object[]{Integer.toHexString(c)});
- fEntityScanner.scanChar(null);
- }
- }
- } while (fEntityScanner.scanData("?>", data));
- }
-
- } // scanPIData(String,XMLString)
-
- /**
- * Scans a comment.
- * <p>
- * <pre>
- * [15] Comment ::= '&lt!--' ((Char - '-') | ('-' (Char - '-')))* '-->'
- * </pre>
- * <p>
- * <strong>Note:</strong> Called after scanning past '&lt;!--'
- * <strong>Note:</strong> This method uses fString, anything in it
- * at the time of calling is lost.
- *
- * @param text The buffer to fill in with the text.
- */
- protected void scanComment(XMLStringBuffer text)
- throws IOException, XNIException {
-
- //System.out.println( "XMLScanner#scanComment# In Scan Comment" );
- // text
- // REVISIT: handle invalid character, eof
- text.clear();
- while (fEntityScanner.scanData("--", text)) {
- int c = fEntityScanner.peekChar();
-
- //System.out.println( "XMLScanner#scanComment#text.toString() == " + text.toString() );
- //System.out.println( "XMLScanner#scanComment#c == " + c );
-
- if (c != -1) {
- if (XMLChar.isHighSurrogate(c)) {
- scanSurrogates(text);
- }
- else if (isInvalidLiteral(c)) {
- reportFatalError("InvalidCharInComment",
- new Object[] { Integer.toHexString(c) });
- fEntityScanner.scanChar(NameType.COMMENT);
- }
- }
- }
- if (!fEntityScanner.skipChar('>', NameType.COMMENT)) {
- reportFatalError("DashDashInComment", null);
- }
-
- } // scanComment()
-
- /**
- * Scans an attribute value and normalizes whitespace converting all
- * whitespace characters to space characters.
- *
- * [10] AttValue ::= '"' ([^<&"] | Reference)* '"' | "'" ([^<&'] | Reference)* "'"
- *
- * @param value The XMLString to fill in with the value.
- * @param nonNormalizedValue The XMLString to fill in with the
- * non-normalized value.
- * @param atName The name of the attribute being parsed (for error msgs).
- * @param attributes The attributes list for the scanned attribute.
- * @param attrIndex The index of the attribute to use from the list.
- * @param checkEntities true if undeclared entities should be reported as VC violation,
- * false if undeclared entities should be reported as WFC violation.
- * @param eleName The name of element to which this attribute belongs.
- * @param isNSURI a flag indicating whether the content is a Namespace URI
- *
- * <strong>Note:</strong> This method uses fStringBuffer2, anything in it
- * at the time of calling is lost.
- **/
- protected void scanAttributeValue(XMLString value, XMLString nonNormalizedValue,
- String atName, XMLAttributes attributes, int attrIndex, boolean checkEntities,
- String eleName, boolean isNSURI)
- throws IOException, XNIException {
- XMLStringBuffer stringBuffer = null;
- // quote
- int quote = fEntityScanner.peekChar();
- if (quote != '\'' && quote != '"') {
- reportFatalError("OpenQuoteExpected", new Object[]{eleName, atName});
- }
-
- fEntityScanner.scanChar(NameType.ATTRIBUTE);
- int entityDepth = fEntityDepth;
-
- int c = fEntityScanner.scanLiteral(quote, value, isNSURI);
- if (DEBUG_ATTR_NORMALIZATION) {
- System.out.println("** scanLiteral -> \""
- + value.toString() + "\"");
- }
- if(fNeedNonNormalizedValue){
- fStringBuffer2.clear();
- fStringBuffer2.append(value);
- }
- if(fEntityScanner.whiteSpaceLen > 0)
- normalizeWhitespace(value);
- if (DEBUG_ATTR_NORMALIZATION) {
- System.out.println("** normalizeWhitespace -> \""
- + value.toString() + "\"");
- }
- if (c != quote) {
- fScanningAttribute = true;
- stringBuffer = getStringBuffer();
- stringBuffer.clear();
- do {
- stringBuffer.append(value);
- if (DEBUG_ATTR_NORMALIZATION) {
- System.out.println("** value2: \""
- + stringBuffer.toString() + "\"");
- }
- if (c == '&') {
- fEntityScanner.skipChar('&', NameType.REFERENCE);
- if (entityDepth == fEntityDepth && fNeedNonNormalizedValue ) {
- fStringBuffer2.append('&');
- }
- if (fEntityScanner.skipChar('#', NameType.REFERENCE)) {
- if (entityDepth == fEntityDepth && fNeedNonNormalizedValue ) {
- fStringBuffer2.append('#');
- }
- int ch ;
- if (fNeedNonNormalizedValue)
- ch = scanCharReferenceValue(stringBuffer, fStringBuffer2);
- else
- ch = scanCharReferenceValue(stringBuffer, null);
-
- if (ch != -1) {
- if (DEBUG_ATTR_NORMALIZATION) {
- System.out.println("** value3: \""
- + stringBuffer.toString()
- + "\"");
- }
- }
- } else {
- String entityName = fEntityScanner.scanName(NameType.ENTITY);
- if (entityName == null) {
- reportFatalError("NameRequiredInReference", null);
- } else if (entityDepth == fEntityDepth && fNeedNonNormalizedValue) {
- fStringBuffer2.append(entityName);
- }
- if (!fEntityScanner.skipChar(';', NameType.REFERENCE)) {
- reportFatalError("SemicolonRequiredInReference",
- new Object []{entityName});
- } else if (entityDepth == fEntityDepth && fNeedNonNormalizedValue) {
- fStringBuffer2.append(';');
- }
- if (resolveCharacter(entityName, stringBuffer)) {
- checkEntityLimit(false, fEntityScanner.fCurrentEntity.name, 1);
- } else {
- if (fEntityStore.isExternalEntity(entityName)) {
- reportFatalError("ReferenceToExternalEntity",
- new Object[] { entityName });
- } else {
- if (!fEntityStore.isDeclaredEntity(entityName)) {
- //WFC & VC: Entity Declared
- if (checkEntities) {
- if (fValidation) {
- fErrorReporter.reportError(fEntityScanner,XMLMessageFormatter.XML_DOMAIN,
- "EntityNotDeclared",
- new Object[]{entityName},
- XMLErrorReporter.SEVERITY_ERROR);
- }
- } else {
- reportFatalError("EntityNotDeclared",
- new Object[]{entityName});
- }
- }
- fEntityManager.startEntity(true, entityName, true);
- }
- }
- }
- } else if (c == '<') {
- reportFatalError("LessthanInAttValue",
- new Object[] { eleName, atName });
- fEntityScanner.scanChar(null);
- if (entityDepth == fEntityDepth && fNeedNonNormalizedValue) {
- fStringBuffer2.append((char)c);
- }
- } else if (c == '%' || c == ']') {
- fEntityScanner.scanChar(null);
- stringBuffer.append((char)c);
- if (entityDepth == fEntityDepth && fNeedNonNormalizedValue) {
- fStringBuffer2.append((char)c);
- }
- if (DEBUG_ATTR_NORMALIZATION) {
- System.out.println("** valueF: \""
- + stringBuffer.toString() + "\"");
- }
- } else if (c == '\n' || c == '\r') {
- fEntityScanner.scanChar(null);
- stringBuffer.append(' ');
- if (entityDepth == fEntityDepth && fNeedNonNormalizedValue) {
- fStringBuffer2.append('\n');
- }
- } else if (c != -1 && XMLChar.isHighSurrogate(c)) {
- fStringBuffer3.clear();
- if (scanSurrogates(fStringBuffer3)) {
- stringBuffer.append(fStringBuffer3);
- if (entityDepth == fEntityDepth && fNeedNonNormalizedValue) {
- fStringBuffer2.append(fStringBuffer3);
- }
- if (DEBUG_ATTR_NORMALIZATION) {
- System.out.println("** valueI: \""
- + stringBuffer.toString()
- + "\"");
- }
- }
- } else if (c != -1 && isInvalidLiteral(c)) {
- reportFatalError("InvalidCharInAttValue",
- new Object[] {eleName, atName, Integer.toString(c, 16)});
- fEntityScanner.scanChar(null);
- if (entityDepth == fEntityDepth && fNeedNonNormalizedValue) {
- fStringBuffer2.append((char)c);
- }
- }
- c = fEntityScanner.scanLiteral(quote, value, isNSURI);
- if (entityDepth == fEntityDepth && fNeedNonNormalizedValue) {
- fStringBuffer2.append(value);
- }
- if(fEntityScanner.whiteSpaceLen > 0)
- normalizeWhitespace(value);
- //Todo ::Move this check to Attributes , do conversion
- //only if attribute is being accessed. -Venu
- } while (c != quote || entityDepth != fEntityDepth);
- stringBuffer.append(value);
- if (DEBUG_ATTR_NORMALIZATION) {
- System.out.println("** valueN: \""
- + stringBuffer.toString() + "\"");
- }
- value.setValues(stringBuffer);
- fScanningAttribute = false;
- }
- if(fNeedNonNormalizedValue)
- nonNormalizedValue.setValues(fStringBuffer2);
-
- // quote
- int cquote = fEntityScanner.scanChar(NameType.ATTRIBUTE);
- if (cquote != quote) {
- reportFatalError("CloseQuoteExpected", new Object[]{eleName, atName});
- }
- } // scanAttributeValue()
-
-
- /**
- * Resolves character entity references.
- * @param entityName the name of the entity
- * @param stringBuffer the current XMLStringBuffer to append the character to.
- * @return true if resolved, false otherwise
- */
- protected boolean resolveCharacter(String entityName, XMLStringBuffer stringBuffer) {
- /**
- * entityNames (symbols) are interned. The equals method would do the same,
- * but I'm leaving it as comparisons by references are common in the impl
- * and it made it explicit to others who read this code.
- */
- if (entityName == fAmpSymbol) {
- stringBuffer.append('&');
- return true;
- } else if (entityName == fAposSymbol) {
- stringBuffer.append('\'');
- return true;
- } else if (entityName == fLtSymbol) {
- stringBuffer.append('<');
- return true;
- } else if (entityName == fGtSymbol) {
- checkEntityLimit(false, fEntityScanner.fCurrentEntity.name, 1);
- stringBuffer.append('>');
- return true;
- } else if (entityName == fQuotSymbol) {
- checkEntityLimit(false, fEntityScanner.fCurrentEntity.name, 1);
- stringBuffer.append('"');
- return true;
- }
- return false;
- }
-
- /**
- * Scans External ID and return the public and system IDs.
- *
- * @param identifiers An array of size 2 to return the system id,
- * and public id (in that order).
- * @param optionalSystemId Specifies whether the system id is optional.
- *
- * <strong>Note:</strong> This method uses fString and fStringBuffer,
- * anything in them at the time of calling is lost.
- */
- protected void scanExternalID(String[] identifiers,
- boolean optionalSystemId)
- throws IOException, XNIException {
-
- String systemId = null;
- String publicId = null;
- if (fEntityScanner.skipString("PUBLIC")) {
- if (!fEntityScanner.skipSpaces()) {
- reportFatalError("SpaceRequiredAfterPUBLIC", null);
- }
- scanPubidLiteral(fString);
- publicId = fString.toString();
-
- if (!fEntityScanner.skipSpaces() && !optionalSystemId) {
- reportFatalError("SpaceRequiredBetweenPublicAndSystem", null);
- }
- }
-
- if (publicId != null || fEntityScanner.skipString("SYSTEM")) {
- if (publicId == null && !fEntityScanner.skipSpaces()) {
- reportFatalError("SpaceRequiredAfterSYSTEM", null);
- }
- int quote = fEntityScanner.peekChar();
- if (quote != '\'' && quote != '"') {
- if (publicId != null && optionalSystemId) {
- // looks like we don't have any system id
- // simply return the public id
- identifiers[0] = null;
- identifiers[1] = publicId;
- return;
- }
- reportFatalError("QuoteRequiredInSystemID", null);
- }
- fEntityScanner.scanChar(null);
- XMLString ident = fString;
- if (fEntityScanner.scanLiteral(quote, ident, false) != quote) {
- fStringBuffer.clear();
- do {
- fStringBuffer.append(ident);
- int c = fEntityScanner.peekChar();
- if (XMLChar.isMarkup(c) || c == ']') {
- fStringBuffer.append((char)fEntityScanner.scanChar(null));
- } else if (c != -1 && isInvalidLiteral(c)) {
- reportFatalError("InvalidCharInSystemID",
- new Object[] {Integer.toString(c, 16)});
- }
- } while (fEntityScanner.scanLiteral(quote, ident, false) != quote);
- fStringBuffer.append(ident);
- ident = fStringBuffer;
- }
- systemId = ident.toString();
- if (!fEntityScanner.skipChar(quote, null)) {
- reportFatalError("SystemIDUnterminated", null);
- }
- }
-
- // store result in array
- identifiers[0] = systemId;
- identifiers[1] = publicId;
- }
-
-
- /**
- * Scans public ID literal.
- *
- * [12] PubidLiteral ::= '"' PubidChar* '"' | "'" (PubidChar - "'")* "'"
- * [13] PubidChar::= #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]
- *
- * The returned string is normalized according to the following rule,
- * from http://www.w3.org/TR/REC-xml#dt-pubid:
- *
- * Before a match is attempted, all strings of white space in the public
- * identifier must be normalized to single space characters (#x20), and
- * leading and trailing white space must be removed.
- *
- * @param literal The string to fill in with the public ID literal.
- * @return True on success.
- *
- * <strong>Note:</strong> This method uses fStringBuffer, anything in it at
- * the time of calling is lost.
- */
- protected boolean scanPubidLiteral(XMLString literal)
- throws IOException, XNIException {
- int quote = fEntityScanner.scanChar(null);
- if (quote != '\'' && quote != '"') {
- reportFatalError("QuoteRequiredInPublicID", null);
- return false;
- }
-
- fStringBuffer.clear();
- // skip leading whitespace
- boolean skipSpace = true;
- boolean dataok = true;
- while (true) {
- int c = fEntityScanner.scanChar(null);
- if (c == ' ' || c == '\n' || c == '\r') {
- if (!skipSpace) {
- // take the first whitespace as a space and skip the others
- fStringBuffer.append(' ');
- skipSpace = true;
- }
- } else if (c == quote) {
- if (skipSpace) {
- // if we finished on a space let's trim it
- fStringBuffer.length--;
- }
- literal.setValues(fStringBuffer);
- break;
- } else if (XMLChar.isPubid(c)) {
- fStringBuffer.append((char)c);
- skipSpace = false;
- } else if (c == -1) {
- reportFatalError("PublicIDUnterminated", null);
- return false;
- } else {
- dataok = false;
- reportFatalError("InvalidCharInPublicID",
- new Object[]{Integer.toHexString(c)});
- }
- }
- return dataok;
- }
-
-
- /**
- * Normalize whitespace in an XMLString converting all whitespace
- * characters to space characters.
- */
- protected void normalizeWhitespace(XMLString value) {
- int i=0;
- int j=0;
- int [] buff = fEntityScanner.whiteSpaceLookup;
- int buffLen = fEntityScanner.whiteSpaceLen;
- int end = value.offset + value.length;
- while(i < buffLen){
- j = buff[i];
- if(j < end ){
- value.ch[j] = ' ';
- }
- i++;
- }
- }
-
- //
- // XMLEntityHandler methods
- //
-
- /**
- * This method notifies of the start of an entity. The document entity
- * has the pseudo-name of "[xml]" the DTD has the pseudo-name of "[dtd]"
- * parameter entity names start with '%'; and general entities are just
- * specified by their name.
- *
- * @param name The name of the entity.
- * @param identifier The resource identifier.
- * @param encoding The auto-detected IANA encoding name of the entity
- * stream. This value will be null in those situations
- * where the entity encoding is not auto-detected (e.g.
- * internal entities or a document entity that is
- * parsed from a java.io.Reader).
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startEntity(String name,
- XMLResourceIdentifier identifier,
- String encoding, Augmentations augs) throws XNIException {
-
- // keep track of the entity depth
- fEntityDepth++;
- // must reset entity scanner
- fEntityScanner = fEntityManager.getEntityScanner();
- fEntityStore = fEntityManager.getEntityStore() ;
- } // startEntity(String,XMLResourceIdentifier,String)
-
- /**
- * This method notifies the end of an entity. The document entity has
- * the pseudo-name of "[xml]" the DTD has the pseudo-name of "[dtd]"
- * parameter entity names start with '%'; and general entities are just
- * specified by their name.
- *
- * @param name The name of the entity.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endEntity(String name, Augmentations augs) throws IOException, XNIException {
-
- // keep track of the entity depth
- fEntityDepth--;
-
- } // endEntity(String)
-
- /**
- * Scans a character reference and append the corresponding chars to the
- * specified buffer.
- *
- * <p>
- * <pre>
- * [66] CharRef ::= '&#' [0-9]+ ';' | '&#x' [0-9a-fA-F]+ ';'
- * </pre>
- *
- * <strong>Note:</strong> This method uses fStringBuffer, anything in it
- * at the time of calling is lost.
- *
- * @param buf the character buffer to append chars to
- * @param buf2 the character buffer to append non-normalized chars to
- *
- * @return the character value or (-1) on conversion failure
- */
- protected int scanCharReferenceValue(XMLStringBuffer buf, XMLStringBuffer buf2)
- throws IOException, XNIException {
- int initLen = buf.length;
- // scan hexadecimal value
- boolean hex = false;
- if (fEntityScanner.skipChar('x', NameType.REFERENCE)) {
- if (buf2 != null) { buf2.append('x'); }
- hex = true;
- fStringBuffer3.clear();
- boolean digit = true;
-
- int c = fEntityScanner.peekChar();
- digit = (c >= '0' && c <= '9') ||
- (c >= 'a' && c <= 'f') ||
- (c >= 'A' && c <= 'F');
- if (digit) {
- if (buf2 != null) { buf2.append((char)c); }
- fEntityScanner.scanChar(NameType.REFERENCE);
- fStringBuffer3.append((char)c);
-
- do {
- c = fEntityScanner.peekChar();
- digit = (c >= '0' && c <= '9') ||
- (c >= 'a' && c <= 'f') ||
- (c >= 'A' && c <= 'F');
- if (digit) {
- if (buf2 != null) { buf2.append((char)c); }
- fEntityScanner.scanChar(NameType.REFERENCE);
- fStringBuffer3.append((char)c);
- }
- } while (digit);
- } else {
- reportFatalError("HexdigitRequiredInCharRef", null);
- }
- }
-
- // scan decimal value
- else {
- fStringBuffer3.clear();
- boolean digit = true;
-
- int c = fEntityScanner.peekChar();
- digit = c >= '0' && c <= '9';
- if (digit) {
- if (buf2 != null) { buf2.append((char)c); }
- fEntityScanner.scanChar(NameType.REFERENCE);
- fStringBuffer3.append((char)c);
-
- do {
- c = fEntityScanner.peekChar();
- digit = c >= '0' && c <= '9';
- if (digit) {
- if (buf2 != null) { buf2.append((char)c); }
- fEntityScanner.scanChar(NameType.REFERENCE);
- fStringBuffer3.append((char)c);
- }
- } while (digit);
- } else {
- reportFatalError("DigitRequiredInCharRef", null);
- }
- }
-
- // end
- if (!fEntityScanner.skipChar(';', NameType.REFERENCE)) {
- reportFatalError("SemicolonRequiredInCharRef", null);
- }
- if (buf2 != null) { buf2.append(';'); }
-
- // convert string to number
- int value = -1;
- try {
- value = Integer.parseInt(fStringBuffer3.toString(),
- hex ? 16 : 10);
-
- // character reference must be a valid XML character
- if (isInvalid(value)) {
- StringBuffer errorBuf = new StringBuffer(fStringBuffer3.length + 1);
- if (hex) errorBuf.append('x');
- errorBuf.append(fStringBuffer3.ch, fStringBuffer3.offset, fStringBuffer3.length);
- reportFatalError("InvalidCharRef",
- new Object[]{errorBuf.toString()});
- }
- } catch (NumberFormatException e) {
- // Conversion failed, let -1 value drop through.
- // If we end up here, the character reference was invalid.
- StringBuffer errorBuf = new StringBuffer(fStringBuffer3.length + 1);
- if (hex) errorBuf.append('x');
- errorBuf.append(fStringBuffer3.ch, fStringBuffer3.offset, fStringBuffer3.length);
- reportFatalError("InvalidCharRef",
- new Object[]{errorBuf.toString()});
- }
-
- // append corresponding chars to the given buffer
- if (!XMLChar.isSupplemental(value)) {
- buf.append((char) value);
- } else {
- // character is supplemental, split it into surrogate chars
- buf.append(XMLChar.highSurrogate(value));
- buf.append(XMLChar.lowSurrogate(value));
- }
-
- // char refs notification code
- if (fNotifyCharRefs && value != -1) {
- String literal = "#" + (hex ? "x" : "") + fStringBuffer3.toString();
- if (!fScanningAttribute) {
- fCharRefLiteral = literal;
- }
- }
-
- if (fEntityScanner.fCurrentEntity.isGE) {
- checkEntityLimit(false, fEntityScanner.fCurrentEntity.name, buf.length - initLen);
- }
- return value;
- }
- // returns true if the given character is not
- // valid with respect to the version of
- // XML understood by this scanner.
- protected boolean isInvalid(int value) {
- return (XMLChar.isInvalid(value));
- } // isInvalid(int): boolean
-
- // returns true if the given character is not
- // valid or may not be used outside a character reference
- // with respect to the version of XML understood by this scanner.
- protected boolean isInvalidLiteral(int value) {
- return (XMLChar.isInvalid(value));
- } // isInvalidLiteral(int): boolean
-
- // returns true if the given character is
- // a valid nameChar with respect to the version of
- // XML understood by this scanner.
- protected boolean isValidNameChar(int value) {
- return (XMLChar.isName(value));
- } // isValidNameChar(int): boolean
-
- // returns true if the given character is
- // a valid NCName character with respect to the version of
- // XML understood by this scanner.
- protected boolean isValidNCName(int value) {
- return (XMLChar.isNCName(value));
- } // isValidNCName(int): boolean
-
- // returns true if the given character is
- // a valid nameStartChar with respect to the version of
- // XML understood by this scanner.
- protected boolean isValidNameStartChar(int value) {
- return (XMLChar.isNameStart(value));
- } // isValidNameStartChar(int): boolean
-
- // returns true if the given character is
- // a valid high surrogate for a nameStartChar
- // with respect to the version of XML understood
- // by this scanner.
- protected boolean isValidNameStartHighSurrogate(int value) {
- return false;
- } // isValidNameStartHighSurrogate(int): boolean
-
- protected boolean versionSupported(String version ) {
- return version.equals("1.0") || version.equals("1.1");
- } // version Supported
-
- /**
- * Scans surrogates and append them to the specified buffer.
- * <p>
- * <strong>Note:</strong> This assumes the current char has already been
- * identified as a high surrogate.
- *
- * @param buf The StringBuffer to append the read surrogates to.
- * @return True if it succeeded.
- */
- protected boolean scanSurrogates(XMLStringBuffer buf)
- throws IOException, XNIException {
-
- int high = fEntityScanner.scanChar(null);
- int low = fEntityScanner.peekChar();
- if (!XMLChar.isLowSurrogate(low)) {
- reportFatalError("InvalidCharInContent",
- new Object[] {Integer.toString(high, 16)});
- return false;
- }
- fEntityScanner.scanChar(null);
-
- // convert surrogates to supplemental character
- int c = XMLChar.supplemental((char)high, (char)low);
-
- // supplemental character must be a valid XML character
- if (isInvalid(c)) {
- reportFatalError("InvalidCharInContent",
- new Object[]{Integer.toString(c, 16)});
- return false;
- }
-
- // fill in the buffer
- buf.append((char)high);
- buf.append((char)low);
-
- return true;
-
- } // scanSurrogates():boolean
-
-
- /**
- * Convenience function used in all XML scanners.
- */
- protected void reportFatalError(String msgId, Object[] args)
- throws XNIException {
- fErrorReporter.reportError(fEntityScanner, XMLMessageFormatter.XML_DOMAIN,
- msgId, args,
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
-
- // private methods
- private void init() {
- // initialize scanner
- fEntityScanner = null;
- // initialize vars
- fEntityDepth = 0;
- fReportEntity = true;
- fResourceIdentifier.clear();
-
- if(!fAttributeCacheInitDone){
- for(int i = 0; i < initialCacheCount; i++){
- attributeValueCache.add(new XMLString());
- stringBufferCache.add(new XMLStringBuffer());
- }
- fAttributeCacheInitDone = true;
- }
- fStringBufferIndex = 0;
- fAttributeCacheUsedCount = 0;
-
- }
-
- XMLStringBuffer getStringBuffer(){
- if((fStringBufferIndex < initialCacheCount )|| (fStringBufferIndex < stringBufferCache.size())){
- return stringBufferCache.get(fStringBufferIndex++);
- }else{
- XMLStringBuffer tmpObj = new XMLStringBuffer();
- fStringBufferIndex++;
- stringBufferCache.add(tmpObj);
- return tmpObj;
- }
- }
-
- /**
- * Add the count of the content buffer and check if the accumulated
- * value exceeds the limit
- * @param isPEDecl a flag to indicate whether the entity is parameter
- * @param entityName entity name
- * @param buffer content buffer
- */
- void checkEntityLimit(boolean isPEDecl, String entityName, XMLString buffer) {
- checkEntityLimit(isPEDecl, entityName, buffer.length);
- }
-
- /**
- * Add the count and check limit
- * @param isPEDecl a flag to indicate whether the entity is parameter
- * @param entityName entity name
- * @param len length of the buffer
- */
- void checkEntityLimit(boolean isPEDecl, String entityName, int len) {
- if (fLimitAnalyzer == null) {
- fLimitAnalyzer = fEntityManager.fLimitAnalyzer;
- }
- if (isPEDecl) {
- fLimitAnalyzer.addValue(XMLSecurityManager.Limit.PARAMETER_ENTITY_SIZE_LIMIT, "%" + entityName, len);
- if (fSecurityManager.isOverLimit(XMLSecurityManager.Limit.PARAMETER_ENTITY_SIZE_LIMIT, fLimitAnalyzer)) {
- fSecurityManager.debugPrint(fLimitAnalyzer);
- reportFatalError("MaxEntitySizeLimit", new Object[]{"%" + entityName,
- fLimitAnalyzer.getValue(XMLSecurityManager.Limit.PARAMETER_ENTITY_SIZE_LIMIT),
- fSecurityManager.getLimit(XMLSecurityManager.Limit.PARAMETER_ENTITY_SIZE_LIMIT),
- fSecurityManager.getStateLiteral(XMLSecurityManager.Limit.PARAMETER_ENTITY_SIZE_LIMIT)});
- }
- } else {
- fLimitAnalyzer.addValue(XMLSecurityManager.Limit.GENERAL_ENTITY_SIZE_LIMIT, entityName, len);
- if (fSecurityManager.isOverLimit(XMLSecurityManager.Limit.GENERAL_ENTITY_SIZE_LIMIT, fLimitAnalyzer)) {
- fSecurityManager.debugPrint(fLimitAnalyzer);
- reportFatalError("MaxEntitySizeLimit", new Object[]{entityName,
- fLimitAnalyzer.getValue(XMLSecurityManager.Limit.GENERAL_ENTITY_SIZE_LIMIT),
- fSecurityManager.getLimit(XMLSecurityManager.Limit.GENERAL_ENTITY_SIZE_LIMIT),
- fSecurityManager.getStateLiteral(XMLSecurityManager.Limit.GENERAL_ENTITY_SIZE_LIMIT)});
- }
- }
- if (fSecurityManager.isOverLimit(XMLSecurityManager.Limit.TOTAL_ENTITY_SIZE_LIMIT, fLimitAnalyzer)) {
- fSecurityManager.debugPrint(fLimitAnalyzer);
- reportFatalError("TotalEntitySizeLimit",
- new Object[]{fLimitAnalyzer.getTotalValue(XMLSecurityManager.Limit.TOTAL_ENTITY_SIZE_LIMIT),
- fSecurityManager.getLimit(XMLSecurityManager.Limit.TOTAL_ENTITY_SIZE_LIMIT),
- fSecurityManager.getStateLiteral(XMLSecurityManager.Limit.TOTAL_ENTITY_SIZE_LIMIT)});
- }
- }
-} // class XMLScanner
diff --git a/src/com/sun/org/apache/xerces/internal/impl/XMLStreamFilterImpl.java b/src/com/sun/org/apache/xerces/internal/impl/XMLStreamFilterImpl.java
deleted file mode 100644
index d147cc9..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/XMLStreamFilterImpl.java
+++ /dev/null
@@ -1,533 +0,0 @@
-/*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.org.apache.xerces.internal.impl;
-
-import javax.xml.XMLConstants;
-import javax.xml.stream.Location;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.StreamFilter;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.namespace.QName;
-import javax.xml.stream.events.XMLEvent;
-
-
-/**
- *
- * @author Joe Wang:
- * This is a rewrite of the original class. The focus is on removing caching, and make the filtered
- * stream reader more compatible with those in other implementations. Note however, that this version
- * will not solve all the issues related to the undefined condition in the spec. The priority is
- * to pass the TCK. Issues arising due to the requirement, that is, (1) should it initiate at BEGIN_DOCUMENT
- * or an accepted event; (2) should hasNext() advance the underlining stream in order to find an acceptable
- * event, would have to wait until 1.1 of StAX in which the filtered stream reader would be defined more clearly.
- */
-
-public class XMLStreamFilterImpl implements javax.xml.stream.XMLStreamReader {
-
- private StreamFilter fStreamFilter = null;
- private XMLStreamReader fStreamReader = null;
- private int fCurrentEvent;
- private boolean fEventAccepted = false;
-
- /**the very issue around a long discussion. but since we must pass the TCK, we have to allow
- * hasNext() to advance the underlining stream in order to find the next acceptable event
- */
- private boolean fStreamAdvancedByHasNext = false;
- /** Creates a new instance of XMLStreamFilterImpl */
-
- public XMLStreamFilterImpl(XMLStreamReader reader,StreamFilter filter){
- fStreamReader = reader;
- this.fStreamFilter = filter;
-
- //this is debatable to initiate at an acceptable event,
- //but it's neccessary in order to pass the TCK and yet avoid skipping element
- try {
- if (fStreamFilter.accept(fStreamReader)) {
- fEventAccepted = true;
- } else {
- findNextEvent();
- }
- }catch(XMLStreamException xs){
- System.err.println("Error while creating a stream Filter"+xs);
- }
- }
-
- /**
- *
- * @param sf
- */
- protected void setStreamFilter(StreamFilter sf){
- this.fStreamFilter = sf;
- }
-
- /**
- *
- * @return
- * @throws XMLStreamException
- */
- public int next() throws XMLStreamException {
- if (fStreamAdvancedByHasNext && fEventAccepted) {
- fStreamAdvancedByHasNext = false;
- return fCurrentEvent;
- }
- int event = findNextEvent();
- if (event != -1) {
- return event;
- }
-
- throw new IllegalStateException("The stream reader has reached the end of the document, or there are no more "+
- " items to return");
- }
- /**
- *
- * @throws XMLStreamException
- * @return
- */
- public int nextTag() throws XMLStreamException {
- if (fStreamAdvancedByHasNext && fEventAccepted &&
- (fCurrentEvent == XMLEvent.START_ELEMENT || fCurrentEvent == XMLEvent.START_ELEMENT)) {
- fStreamAdvancedByHasNext = false;
- return fCurrentEvent;
- }
-
- int event = findNextTag();
- if (event != -1) {
- return event;
- }
- throw new IllegalStateException("The stream reader has reached the end of the document, or there are no more "+
- " items to return");
- }
-
- /**
- *
- * @throws XMLStreamException
- * @return
- */
- public boolean hasNext() throws XMLStreamException {
- if (fStreamReader.hasNext()) {
- if (!fEventAccepted) {
- if ((fCurrentEvent = findNextEvent()) == -1) {
- return false;
- } else {
- fStreamAdvancedByHasNext = true;
- }
- }
- return true;
- }
- return false;
- }
-
- private int findNextEvent() throws XMLStreamException {
- fStreamAdvancedByHasNext = false;
- while(fStreamReader.hasNext()){
- fCurrentEvent = fStreamReader.next();
- if(fStreamFilter.accept(fStreamReader)){
- fEventAccepted = true;
- return fCurrentEvent;
- }
- }
- //although it seems that IllegalStateException should be thrown when next() is called
- //on a stream that has no more items, we have to assume END_DOCUMENT is always accepted
- //in order to pass the TCK
- if (fCurrentEvent == XMLEvent.END_DOCUMENT)
- return fCurrentEvent;
- else
- return -1;
- }
- private int findNextTag() throws XMLStreamException {
- fStreamAdvancedByHasNext = false;
- while(fStreamReader.hasNext()){
- fCurrentEvent = fStreamReader.nextTag();
- if(fStreamFilter.accept(fStreamReader)){
- fEventAccepted = true;
- return fCurrentEvent;
- }
- }
- if (fCurrentEvent == XMLEvent.END_DOCUMENT)
- return fCurrentEvent;
- else
- return -1;
- }
- /**
- *
- * @throws XMLStreamException
- */
- public void close() throws XMLStreamException {
- fStreamReader.close();
- }
-
- /**
- *
- * @return
- */
- public int getAttributeCount() {
- return fStreamReader.getAttributeCount();
- }
-
- /**
- *
- * @param index
- * @return
- */
- public QName getAttributeName(int index) {
- return fStreamReader.getAttributeName(index);
- }
-
- /**
- *
- * @param index
- * @return
- */
- public String getAttributeNamespace(int index) {
- return fStreamReader.getAttributeNamespace(index);
- }
-
- /**
- *
- * @param index
- * @return
- */
- public String getAttributePrefix(int index) {
- return fStreamReader.getAttributePrefix(index);
- }
-
- /**
- *
- * @param index
- * @return
- */
- public String getAttributeType(int index) {
- return fStreamReader.getAttributeType(index);
- }
-
- /**
- *
- * @param index
- * @return
- */
- public String getAttributeValue(int index) {
- return fStreamReader.getAttributeValue(index);
- }
-
- /**
- *
- * @param namespaceURI
- * @param localName
- * @return
- */
- public String getAttributeValue(String namespaceURI, String localName) {
- return fStreamReader.getAttributeValue(namespaceURI,localName);
- }
-
- /**
- *
- * @return
- */
- public String getCharacterEncodingScheme() {
- return fStreamReader.getCharacterEncodingScheme();
- }
-
- /**
- *
- * @throws XMLStreamException
- * @return
- */
- public String getElementText() throws XMLStreamException {
- return fStreamReader.getElementText();
- }
-
- /**
- *
- * @return
- */
- public String getEncoding() {
- return fStreamReader.getEncoding();
- }
-
- /**
- *
- * @return
- */
- public int getEventType() {
- return fStreamReader.getEventType();
- }
-
- /**
- *
- * @return
- */
- public String getLocalName() {
- return fStreamReader.getLocalName();
- }
-
- /**
- *
- * @return
- */
- public javax.xml.stream.Location getLocation() {
- return fStreamReader.getLocation();
- }
-
- /**
- *
- * @return
- */
- public javax.xml.namespace.QName getName() {
- return fStreamReader.getName();
- }
-
- /**
- *
- * @return
- */
- public javax.xml.namespace.NamespaceContext getNamespaceContext() {
- return fStreamReader.getNamespaceContext();
- }
-
- /**
- *
- * @return
- */
- public int getNamespaceCount() {
- return fStreamReader.getNamespaceCount();
- }
-
- /**
- *
- * @param index
- * @return
- */
- public String getNamespacePrefix(int index) {
- return fStreamReader.getNamespacePrefix(index);
- }
-
- /**
- *
- * @return
- */
- public String getNamespaceURI() {
- return fStreamReader.getNamespaceURI();
- }
-
- /**
- *
- * @param index
- * @return
- */
- public String getNamespaceURI(int index) {
- return fStreamReader.getNamespaceURI(index);
- }
-
- /**
- *
- * @param prefix
- * @return
- */
- public String getNamespaceURI(String prefix) {
- return fStreamReader.getNamespaceURI(prefix);
- }
-
- /**
- *
- * @return
- */
- public String getPIData() {
- return fStreamReader.getPIData();
- }
-
- /**
- *
- * @return
- */
- public String getPITarget() {
- return fStreamReader.getPITarget();
- }
-
- /**
- *
- * @return
- */
- public String getPrefix() {
- return fStreamReader.getPrefix();
- }
-
- /**
- *
- * @param name
- * @throws IllegalArgumentException
- * @return
- */
- public Object getProperty(java.lang.String name) throws java.lang.IllegalArgumentException {
- return fStreamReader.getProperty(name);
- }
-
- /**
- *
- * @return
- */
- public String getText() {
- return fStreamReader.getText();
- }
-
- /**
- *
- * @return
- */
- public char[] getTextCharacters() {
- return fStreamReader.getTextCharacters();
- }
-
- /**
- *
- * @param sourceStart
- * @param target
- * @param targetStart
- * @param length
- * @throws XMLStreamException
- * @return
- */
- public int getTextCharacters(int sourceStart, char[] target, int targetStart, int length) throws XMLStreamException {
- return fStreamReader.getTextCharacters(sourceStart, target,targetStart,length);
- }
-
- /**
- *
- * @return
- */
- public int getTextLength() {
- return fStreamReader.getTextLength();
- }
-
- /**
- *
- * @return
- */
- public int getTextStart() {
- return fStreamReader.getTextStart();
- }
-
- /**
- *
- * @return
- */
- public String getVersion() {
- return fStreamReader.getVersion();
- }
-
- /**
- *
- * @return
- */
- public boolean hasName() {
- return fStreamReader.hasName();
- }
-
- /**
- *
- * @return
- */
- public boolean hasText() {
- return fStreamReader.hasText();
- }
-
- /**
- *
- * @return
- * @param index
- */
- public boolean isAttributeSpecified(int index) {
- return fStreamReader.isAttributeSpecified(index);
- }
-
- /**
- *
- * @return
- */
- public boolean isCharacters() {
- return fStreamReader.isCharacters();
- }
-
- /**
- *
- * @return
- */
- public boolean isEndElement() {
- return fStreamReader.isEndElement();
- }
-
- /**
- *
- * @return
- */
- public boolean isStandalone() {
- return fStreamReader.isStandalone();
- }
-
- /**
- *
- * @return
- */
- public boolean isStartElement() {
- return fStreamReader.isStartElement();
- }
-
- /**
- *
- * @return
- */
- public boolean isWhiteSpace() {
- return fStreamReader.isWhiteSpace();
- }
-
-
- /**
- *
- * @param type
- * @param namespaceURI
- * @param localName
- * @throws XMLStreamException
- */
- public void require(int type, String namespaceURI, String localName) throws XMLStreamException {
- fStreamReader.require(type,namespaceURI,localName);
- }
-
- /**
- *
- * @return
- */
- public boolean standaloneSet() {
- return fStreamReader.standaloneSet();
- }
-
- /**
- *
- * @param index
- * @return
- */
- public String getAttributeLocalName(int index){
- return fStreamReader.getAttributeLocalName(index);
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/XMLStreamReaderImpl.java b/src/com/sun/org/apache/xerces/internal/impl/XMLStreamReaderImpl.java
deleted file mode 100644
index 350a87c..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/XMLStreamReaderImpl.java
+++ /dev/null
@@ -1,1366 +0,0 @@
-/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.org.apache.xerces.internal.impl;
-
-import com.sun.org.apache.xerces.internal.util.NamespaceContextWrapper;
-import com.sun.org.apache.xerces.internal.util.NamespaceSupport;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.util.XMLAttributesImpl;
-import com.sun.org.apache.xerces.internal.util.XMLChar;
-import com.sun.org.apache.xerces.internal.util.XMLStringBuffer;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-import com.sun.xml.internal.stream.Entity;
-import com.sun.xml.internal.stream.StaxErrorReporter;
-import com.sun.xml.internal.stream.XMLEntityStorage;
-import com.sun.xml.internal.stream.dtd.nonvalidating.DTDGrammar;
-import com.sun.xml.internal.stream.dtd.nonvalidating.XMLNotationDecl;
-import com.sun.xml.internal.stream.events.EntityDeclarationImpl;
-import com.sun.xml.internal.stream.events.NotationDeclarationImpl;
-import java.io.BufferedInputStream;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.List;
-import javax.xml.XMLConstants;
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.namespace.QName;
-import javax.xml.stream.Location;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.events.XMLEvent;
-
-/** This class implements javax.xml.stream.XMLStreamReader. It makes use of XML*Scanner classes to
- * derive most of its functionality. If desired, Application can reuse this instance by calling
- * reset() and setInputSource().
- *
- * @author Neeraj Bajaj Sun Microsystems,Inc.
- * @author K.Venugopal Sun Microsystems,Inc.
- * @author Sunitha Reddy Sun Microsystems,Inc.
- */
-public class XMLStreamReaderImpl implements javax.xml.stream.XMLStreamReader {
-
- /** Property identifier: entity manager. */
- protected static final String ENTITY_MANAGER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_MANAGER_PROPERTY;
-
- /** Property identifier: Error Reporter. */
- protected static final String ERROR_REPORTER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY;
-
- /** Property identifier: Symbol table. */
- protected static final String SYMBOL_TABLE =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY;
-
- protected static final String READER_IN_DEFINED_STATE =
- Constants.READER_IN_DEFINED_STATE;
-
- private SymbolTable fSymbolTable = new SymbolTable();
-
- /** Document scanner. */
- protected XMLDocumentScannerImpl fScanner = new XMLNSDocumentScannerImpl();
-
- //make Global NamespaceContextWrapper object, fScanner.getNamespaceContext() is dynamic object and ita value changes
- //as per the state of the parser.
- protected NamespaceContextWrapper fNamespaceContextWrapper = new NamespaceContextWrapper((NamespaceSupport)fScanner.getNamespaceContext()) ;
- protected XMLEntityManager fEntityManager = new XMLEntityManager();
- protected StaxErrorReporter fErrorReporter = new StaxErrorReporter();
-
-
- /** Entity scanner, this alwasy works on last entity that was opened. */
- protected XMLEntityScanner fEntityScanner = null;
-
- /** Input Source */
- protected XMLInputSource fInputSource = null;
- /** Store properties*/
- protected PropertyManager fPropertyManager = null ;
-
- /** current event type */
- private int fEventType ;
- /** debug flag*/
- static final boolean DEBUG = false ;
- /** more to scan */
- private boolean fReuse = true;
- private boolean fReaderInDefinedState = true ;
- private boolean fBindNamespaces = true;
- private String fDTDDecl = null;
- private String versionStr = null;
-
- /**
- * @param inputStream
- * @param props
- * @throws XMLStreamException
- */
- public XMLStreamReaderImpl(InputStream inputStream, PropertyManager props) throws XMLStreamException {
- init(props);
- //publicId, systemid, baseSystemId, inputStream, enocding
- XMLInputSource inputSource = new XMLInputSource(null,null,null,inputStream,null);
- //pass the input source to document scanner impl.
- setInputSource(inputSource);
- }
-
- public XMLDocumentScannerImpl getScanner(){
- System.out.println("returning scanner");
- return fScanner;
- }
- /**
- * @param systemid
- * @param props
- * @throws XMLStreamException
- */
- public XMLStreamReaderImpl(String systemid, PropertyManager props) throws XMLStreamException {
- init(props);
- //publicId, systemid, baseSystemId, inputStream, enocding
- XMLInputSource inputSource = new XMLInputSource(null,systemid,null);
- //pass the input source to document scanner impl.
- setInputSource(inputSource);
- }
-
-
- /**
- * @param inputStream
- * @param encoding
- * @param props
- * @throws XMLStreamException
- */
- public XMLStreamReaderImpl(InputStream inputStream, String encoding, PropertyManager props ) throws XMLStreamException {
- init(props);
- //publicId, systemid, baseSystemId, inputStream, enocding
- XMLInputSource inputSource = new XMLInputSource(null,null,null, new BufferedInputStream(inputStream),encoding );
- //pass the input source to document scanner impl.
- setInputSource(inputSource);
- }
-
- /**
- * @param reader
- * @param props
- * @throws XMLStreamException
- */
- public XMLStreamReaderImpl(Reader reader, PropertyManager props) throws XMLStreamException {
- init(props);
- //publicId, systemid, baseSystemId, inputStream, enocding
- //xxx: Using buffered reader
- XMLInputSource inputSource = new XMLInputSource(null,null,null,new BufferedReader(reader),null);
- //pass the input source to document scanner impl.
- setInputSource(inputSource);
- }
-
- /**
- * @param inputSource
- * @param props
- * @throws XMLStreamException
- */
- public XMLStreamReaderImpl(XMLInputSource inputSource, PropertyManager props) throws XMLStreamException {
- init(props);
- //pass the input source to document scanner impl.
- setInputSource(inputSource);
- }
-
- /**
- * @param inputSource
- * @throws XMLStreamException
- */
- public void setInputSource(XMLInputSource inputSource ) throws XMLStreamException {
- //once setInputSource() is called this instance is busy parsing the inputsource supplied
- //this instances is free for reuse if parser has reached END_DOCUMENT state or application has
- //called close()
- fReuse = false;
-
- try{
-
- fScanner.setInputSource(inputSource) ;
- //XMLStreamReader should be in defined state
- if(fReaderInDefinedState){
- fEventType = fScanner.next();
- if (versionStr == null)
- versionStr = getVersion();
-
- if (fEventType == XMLStreamConstants.START_DOCUMENT && versionStr != null && versionStr.equals("1.1")){
- switchToXML11Scanner();
- }
-
- }
- }catch(java.io.IOException ex){
- throw new XMLStreamException(ex);
- } catch(XNIException ex){ //Issue 56 XNIException not caught
- throw new XMLStreamException(ex.getMessage(), getLocation(), ex.getException());
- }
- }//setInputSource
-
- void init(PropertyManager propertyManager) throws XMLStreamException {
- fPropertyManager = propertyManager;
- //set Stax internal properties -- Note that these instances are being created in XMLReaderImpl.
- //1.SymbolTable
- //2.XMLMessageFormatter
- //3.XMLEntityManager
- //4. call reset()
- //1.
- propertyManager.setProperty(SYMBOL_TABLE, fSymbolTable ) ;
- //2.
- propertyManager.setProperty(ERROR_REPORTER, fErrorReporter ) ;
- //3.
- propertyManager.setProperty(ENTITY_MANAGER, fEntityManager);
- //4.
- reset();
- }
-
- /** This function tells if this instances is available for reuse.
- * One must call reset() and setInputSource() to be able to reuse
- * this instance.
- */
- public boolean canReuse(){
- if(DEBUG){
- System.out.println("fReuse = " + fReuse);
- System.out.println("fEventType = " + getEventTypeString(fEventType) );
- }
- //when parsing begins, fReuse is set to false
- //fReuse is set to 'true' when application calls close()
- return fReuse;
- }
-
- /**
- * Resets this instance so that this instance is ready for reuse.
- */
- public void reset(){
- fReuse = true;
- fEventType = 0 ;
- //reset entity manager
- fEntityManager.reset(fPropertyManager);
- //reset the scanner
- fScanner.reset(fPropertyManager);
- //REVISIT:this is too ugly -- we are getting XMLEntityManager and XMLEntityReader from
- //property manager, it should be only XMLEntityManager
- fDTDDecl = null;
- fEntityScanner = (XMLEntityScanner)fEntityManager.getEntityScanner() ;
- //default value for this property is true. However, this should be false when using XMLEventReader... Ugh..
- //because XMLEventReader should not have defined state.
- fReaderInDefinedState = ((Boolean)fPropertyManager.getProperty(READER_IN_DEFINED_STATE)).booleanValue();
- fBindNamespaces = ((Boolean)fPropertyManager.getProperty(XMLInputFactory.IS_NAMESPACE_AWARE)).booleanValue();
- versionStr = null;
- }
-
-
- /** Frees any resources associated with this Reader. This method does not close the underlying input source.
- * @throws XMLStreamException if there are errors freeing associated resources
- */
- public void close() throws XMLStreamException {
- //xxx: Check what this function is intended to do.
- //reset();
- fReuse = true ;
- }
-
-
- /** Returns the character encoding declared on the xml declaration Returns null if none was declared
- * @return the encoding declared in the document or null
- */
- public String getCharacterEncodingScheme() {
- return fScanner.getCharacterEncodingScheme();
-
- }
-
-
- /**
- * @return
- */
- public int getColumnNumber() {
- return fEntityScanner.getColumnNumber();
- }//getColumnNumber
-
- /** Return input encoding if known or null if unknown.
- * @return the encoding of this instance or null
- */
- public String getEncoding() {
- return fEntityScanner.getEncoding();
- }//getEncoding
-
- /** Returns the current value of the parse event as a string, this returns the string value of a CHARACTERS event, returns the value of a COMMENT, the replacement value for an ENTITY_REFERENCE, the string value of a CDATA section, the string value for a SPACE event, or the String value of the internal subset of the DTD. If an ENTITY_REFERENCE has been resolved, any character data will be reported as CHARACTERS events.
- * @return the current text or null
- */
- public int getEventType() {
- return fEventType ;
- }//getEventType
-
- /**
- * @return
- */
- public int getLineNumber() {
- return fEntityScanner.getLineNumber() ;
- }//getLineNumber
-
- public String getLocalName() {
- if(fEventType == XMLEvent.START_ELEMENT || fEventType == XMLEvent.END_ELEMENT){
- //xxx check whats the value of fCurrentElement
- return fScanner.getElementQName().localpart ;
- }
- else if(fEventType == XMLEvent.ENTITY_REFERENCE){
- return fScanner.getEntityName();
- }
- throw new IllegalStateException("Method getLocalName() cannot be called for " +
- getEventTypeString(fEventType) + " event.");
- }//getLocalName()
-
- /**
- * @return
- */
- public String getNamespaceURI() {
- //doesn't take care of Attribute as separte event
- if(fEventType == XMLEvent.START_ELEMENT || fEventType == XMLEvent.END_ELEMENT){
- return fScanner.getElementQName().uri ;
- }
- return null ;
- }//getNamespaceURI
-
- /** Get the data section of a processing instruction
- * @return the data or null
- */
-
- public String getPIData() {
- if( fEventType == XMLEvent.PROCESSING_INSTRUCTION){
- return fScanner.getPIData().toString();
- }
- else throw new java.lang.IllegalStateException("Current state of the parser is " + getEventTypeString(fEventType) +
- " But Expected state is " + XMLEvent.PROCESSING_INSTRUCTION ) ;
- }//getPIData
-
-
- /** Get the target of a processing instruction
- * @return the target or null
- */
- public String getPITarget() {
- if( fEventType == XMLEvent.PROCESSING_INSTRUCTION){
- return fScanner.getPITarget();
- }
- else throw new java.lang.IllegalStateException("Current state of the parser is " + getEventTypeString(fEventType) +
- " But Expected state is " + XMLEvent.PROCESSING_INSTRUCTION ) ;
-
- }//getPITarget
-
-
- /**
- * @return the prefix of the current event, or null if the event does
- * not have a prefix. For START_ELEMENT and END_ELEMENT, return
- * XMLConstants.DEFAULT_NS_PREFIX when no prefix is available.
- */
- public String getPrefix() {
- if(fEventType == XMLEvent.START_ELEMENT || fEventType == XMLEvent.END_ELEMENT){
- String prefix = fScanner.getElementQName().prefix;
- return prefix == null ? XMLConstants.DEFAULT_NS_PREFIX : prefix;
- }
- return null ;
- }//getPrefix()
-
-
-
- /**
- * @return
- */
- public char[] getTextCharacters() {
- if( fEventType == XMLEvent.CHARACTERS || fEventType == XMLEvent.COMMENT
- || fEventType == XMLEvent.CDATA || fEventType == XMLEvent.SPACE){
- return fScanner.getCharacterData().ch;
- } else{
- throw new IllegalStateException("Current state = " + getEventTypeString(fEventType)
- + " is not among the states " + getEventTypeString(XMLEvent.CHARACTERS) + " , "
- + getEventTypeString(XMLEvent.COMMENT) + " , " + getEventTypeString(XMLEvent.CDATA)
- + " , " + getEventTypeString(XMLEvent.SPACE) +" valid for getTextCharacters() " ) ;
- }
- }
-
- /**
- * @return
- */
- public int getTextLength() {
- if( fEventType == XMLEvent.CHARACTERS || fEventType == XMLEvent.COMMENT
- || fEventType == XMLEvent.CDATA || fEventType == XMLEvent.SPACE){
- return fScanner.getCharacterData().length;
- } else{
- throw new IllegalStateException("Current state = " + getEventTypeString(fEventType)
- + " is not among the states " + getEventTypeString(XMLEvent.CHARACTERS) + " , "
- + getEventTypeString(XMLEvent.COMMENT) + " , " + getEventTypeString(XMLEvent.CDATA)
- + " , " + getEventTypeString(XMLEvent.SPACE) +" valid for getTextLength() " ) ;
- }
-
- }
-
- /**
- * @return
- */
- public int getTextStart() {
- if( fEventType == XMLEvent.CHARACTERS || fEventType == XMLEvent.COMMENT || fEventType == XMLEvent.CDATA || fEventType == XMLEvent.SPACE){
- return fScanner.getCharacterData().offset;
- } else{
- throw new IllegalStateException("Current state = " + getEventTypeString(fEventType)
- + " is not among the states " + getEventTypeString(XMLEvent.CHARACTERS) + " , "
- + getEventTypeString(XMLEvent.COMMENT) + " , " + getEventTypeString(XMLEvent.CDATA)
- + " , " + getEventTypeString(XMLEvent.SPACE) +" valid for getTextStart() " ) ;
- }
- }
-
- /**
- * @return
- */
- public String getValue() {
- if(fEventType == XMLEvent.PROCESSING_INSTRUCTION){
- return fScanner.getPIData().toString();
- } else if(fEventType == XMLEvent.COMMENT){
- return fScanner.getComment();
- } else if(fEventType == XMLEvent.START_ELEMENT || fEventType == XMLEvent.END_ELEMENT){
- return fScanner.getElementQName().localpart ;
- } else if(fEventType == XMLEvent.CHARACTERS){
- return fScanner.getCharacterData().toString();
- }
- return null;
- }//getValue()
-
- /** Get the XML language version of the current document being parsed */
- public String getVersion() {
- //apply SAP's patch: the default version in the scanner was set to 1.0 because of DOM and SAX
- //so this patch is a workaround of the difference between StAX and DOM
- // SAPJVM: Return null if the XML version has not been declared (as specified in the JavaDoc).
-
- String version = fEntityScanner.getXMLVersion();
-
- return "1.0".equals(version) && !fEntityScanner.xmlVersionSetExplicitly ? null : version;
- }
-
- /**
- * @return
- */
- public boolean hasAttributes() {
- return fScanner.getAttributeIterator().getLength() > 0 ? true : false ;
- }
-
- /** this Funtion returns true if the current event has name */
- public boolean hasName() {
- if(fEventType == XMLEvent.START_ELEMENT || fEventType == XMLEvent.END_ELEMENT) {
- return true;
- } else {
- return false;
- }
- }//hasName()
-
- /**
- * @throws XMLStreamException
- * @return
- */
- public boolean hasNext() throws XMLStreamException {
- //the scanner returns -1 when it detects a broken stream
- if (fEventType == -1) return false;
- //we can check in scanners if the scanner state is not set to
- //terminating, we still have more events.
- return fEventType != XMLEvent.END_DOCUMENT;
- }
-
- /**
- * @return
- */
- public boolean hasValue() {
- if(fEventType == XMLEvent.START_ELEMENT || fEventType == XMLEvent.END_ELEMENT
- || fEventType == XMLEvent.ENTITY_REFERENCE || fEventType == XMLEvent.PROCESSING_INSTRUCTION
- || fEventType == XMLEvent.COMMENT || fEventType == XMLEvent.CHARACTERS) {
- return true;
- } else {
- return false;
- }
-
- }
-
- /**
- * @return
- */
- public boolean isEndElement() {
- return fEventType == XMLEvent.END_ELEMENT;
- }
-
- /**
- * @return
- */
- public boolean isStandalone() {
- return fScanner.isStandAlone();
- }
-
- /**
- * @return
- */
- public boolean isStartElement() {
- return fEventType == XMLEvent.START_ELEMENT;
- }
-
- /**
- * Returns true if the cursor points to a character data event that consists of all whitespace
- * Application calling this method needs to cache the value and avoid calling this method again
- * for the same event.
- * @return
- */
- public boolean isWhiteSpace() {
- if(isCharacters() || (fEventType == XMLStreamConstants.CDATA)){
- char [] ch = this.getTextCharacters();
- final int start = this.getTextStart();
- final int end = start + this.getTextLength();
- for (int i = start; i < end; i++){
- if(!XMLChar.isSpace(ch[i])){
- return false;
- }
- }
- return true;
- }
- return false;
- }
-
-
-
- /**
- * @throws XMLStreamException
- * @return
- */
- public int next() throws XMLStreamException {
- if( !hasNext() ) {
- if (fEventType != -1) {
- throw new java.util.NoSuchElementException( "END_DOCUMENT reached: no more elements on the stream." );
- } else {
- throw new XMLStreamException( "Error processing input source. The input stream is not complete." );
- }
- }
- try {
- fEventType = fScanner.next();
-
- if (versionStr == null) {
- versionStr = getVersion();
- }
-
- if (fEventType == XMLStreamConstants.START_DOCUMENT
- && versionStr != null
- && versionStr.equals("1.1")) {
- switchToXML11Scanner();
- }
-
- return fEventType;
- } catch (IOException ex) {
- // if this error occured trying to resolve the external DTD subset
- // and IS_VALIDATING == false, then this is not an XML error
- if (fScanner.fScannerState == fScanner.SCANNER_STATE_DTD_EXTERNAL) {
- Boolean isValidating = (Boolean) fPropertyManager.getProperty(
- XMLInputFactory.IS_VALIDATING);
- if (isValidating != null
- && !isValidating.booleanValue()) {
- // ignore the error, set scanner to known state
- fEventType = XMLEvent.DTD;
- fScanner.setScannerState(fScanner.SCANNER_STATE_PROLOG);
- fScanner.setDriver(fScanner.fPrologDriver);
- if (fDTDDecl == null
- || fDTDDecl.length() == 0) {
- fDTDDecl = "<!-- "
- + "Exception scanning External DTD Subset. "
- + "True contents of DTD cannot be determined. "
- + "Processing will continue as XMLInputFactory.IS_VALIDATING == false."
- + " -->";
- }
- return XMLEvent.DTD;
- }
- }
-
- // else real error
- throw new XMLStreamException(ex.getMessage(), getLocation(), ex);
- } catch (XNIException ex) {
- throw new XMLStreamException(
- ex.getMessage(),
- getLocation(),
- ex.getException());
- }
- } //next()
-
- private void switchToXML11Scanner() throws IOException{
-
- int oldEntityDepth = fScanner.fEntityDepth;
- com.sun.org.apache.xerces.internal.xni.NamespaceContext oldNamespaceContext = fScanner.fNamespaceContext;
-
- fScanner = new XML11NSDocumentScannerImpl();
-
- //get the new scanner state to old scanner's previous state
- fScanner.reset(fPropertyManager);
- fScanner.setPropertyManager(fPropertyManager);
- fEntityScanner = (XMLEntityScanner)fEntityManager.getEntityScanner() ;
- fEntityManager.fCurrentEntity.mayReadChunks = true;
- fScanner.setScannerState(XMLEvent.START_DOCUMENT);
-
- fScanner.fEntityDepth = oldEntityDepth;
- fScanner.fNamespaceContext = oldNamespaceContext;
- fEventType = fScanner.next();
- }
-
-
-
- final static String getEventTypeString(int eventType) {
- switch (eventType){
- case XMLEvent.START_ELEMENT:
- return "START_ELEMENT";
- case XMLEvent.END_ELEMENT:
- return "END_ELEMENT";
- case XMLEvent.PROCESSING_INSTRUCTION:
- return "PROCESSING_INSTRUCTION";
- case XMLEvent.CHARACTERS:
- return "CHARACTERS";
- case XMLEvent.COMMENT:
- return "COMMENT";
- case XMLEvent.START_DOCUMENT:
- return "START_DOCUMENT";
- case XMLEvent.END_DOCUMENT:
- return "END_DOCUMENT";
- case XMLEvent.ENTITY_REFERENCE:
- return "ENTITY_REFERENCE";
- case XMLEvent.ATTRIBUTE:
- return "ATTRIBUTE";
- case XMLEvent.DTD:
- return "DTD";
- case XMLEvent.CDATA:
- return "CDATA";
- case XMLEvent.SPACE:
- return "SPACE";
- }
- return "UNKNOWN_EVENT_TYPE, " + String.valueOf(eventType);
- }
-
- /** Returns the count of attributes on this START_ELEMENT,
- * this method is only valid on a START_ELEMENT or ATTRIBUTE. This
- * count excludes namespace definitions. Attribute indices are
- * zero-based.
- * @return returns the number of attributes
- * @throws IllegalStateException if this is not a START_ELEMENT or ATTRIBUTE
- */
- public int getAttributeCount() {
- //xxx: recognize SAX properties namespace, namespace-prefix to get XML Namespace declarations
- //does length includes namespace declarations ?
-
- //State should be either START_ELEMENT or ATTRIBUTE
- if( fEventType == XMLEvent.START_ELEMENT || fEventType == XMLEvent.ATTRIBUTE) {
- return fScanner.getAttributeIterator().getLength() ;
- } else{
- throw new java.lang.IllegalStateException( "Current state is not among the states "
- + getEventTypeString(XMLEvent.START_ELEMENT) + " , "
- + getEventTypeString(XMLEvent.ATTRIBUTE)
- + "valid for getAttributeCount()") ;
- }
- }//getAttributeCount
-
- /** Returns the localName of the attribute at the provided
- * index
- * @param index the position of the attribute
- * @return the localName of the attribute
- * @throws IllegalStateException if this is not a START_ELEMENT or ATTRIBUTE
- */
- public QName getAttributeName(int index) {
- //State should be either START_ELEMENT or ATTRIBUTE
- if( fEventType == XMLEvent.START_ELEMENT || fEventType == XMLEvent.ATTRIBUTE) {
- return convertXNIQNametoJavaxQName(fScanner.getAttributeIterator().getQualifiedName(index)) ;
- } else{
- throw new java.lang.IllegalStateException("Current state is not among the states "
- + getEventTypeString(XMLEvent.START_ELEMENT) + " , "
- + getEventTypeString(XMLEvent.ATTRIBUTE)
- + "valid for getAttributeName()") ;
- }
- }//getAttributeName
-
- /**
- * @param index
- * @return
- */
- public String getAttributeLocalName(int index) {
- //State should be either START_ELEMENT or ATTRIBUTE
- if( fEventType == XMLEvent.START_ELEMENT || fEventType == XMLEvent.ATTRIBUTE) {
- return fScanner.getAttributeIterator().getLocalName(index) ;
- } else{
- throw new java.lang.IllegalStateException() ;
- }
- }//getAttributeName
-
- /** Returns the namespace of the attribute at the provided
- * index
- * @param index the position of the attribute
- * @return the namespace URI (can be null)
- * @throws IllegalStateException if this is not a START_ELEMENT or ATTRIBUTE
- */
- public String getAttributeNamespace(int index) {
- //State should be either START_ELEMENT or ATTRIBUTE
- if( fEventType == XMLEvent.START_ELEMENT || fEventType == XMLEvent.ATTRIBUTE) {
- return fScanner.getAttributeIterator().getURI(index);
- } else{
- throw new java.lang.IllegalStateException("Current state is not among the states "
- + getEventTypeString(XMLEvent.START_ELEMENT) + " , "
- + getEventTypeString(XMLEvent.ATTRIBUTE)
- + "valid for getAttributeNamespace()") ;
- }
-
- }//getAttributeNamespace
-
- /** Returns the prefix of this attribute at the
- * provided index
- * @param index the position of the attribute
- * @return the prefix of the attribute
- * @throws IllegalStateException if this is not a START_ELEMENT or ATTRIBUTE
- */
- public String getAttributePrefix(int index) {
- //State should be either START_ELEMENT or ATTRIBUTE
- if( fEventType == XMLEvent.START_ELEMENT || fEventType == XMLEvent.ATTRIBUTE) {
- return fScanner.getAttributeIterator().getPrefix(index);
- } else{
- throw new java.lang.IllegalStateException("Current state is not among the states "
- + getEventTypeString(XMLEvent.START_ELEMENT) + " , "
- + getEventTypeString(XMLEvent.ATTRIBUTE)
- + "valid for getAttributePrefix()") ;
- }
- }//getAttributePrefix
-
- /** Returns the qname of the attribute at the provided index
- *
- * @param index the position of the attribute
- * @return the QName of the attribute
- * @throws IllegalStateException if this is not a START_ELEMENT or ATTRIBUTE
- */
- public javax.xml.namespace.QName getAttributeQName(int index) {
- //State should be either START_ELEMENT or ATTRIBUTE
- if( fEventType == XMLEvent.START_ELEMENT || fEventType == XMLEvent.ATTRIBUTE) {
- // create new object at runtime..
- String localName = fScanner.getAttributeIterator().getLocalName(index) ;
- String uri = fScanner.getAttributeIterator().getURI(index) ;
- return new javax.xml.namespace.QName(uri, localName) ;
- } else{
- throw new java.lang.IllegalStateException("Current state is not among the states "
- + getEventTypeString(XMLEvent.START_ELEMENT) + " , "
- + getEventTypeString(XMLEvent.ATTRIBUTE)
- + "valid for getAttributeQName()") ;
- }
- }//getAttributeQName
-
- /** Returns the XML type of the attribute at the provided
- * index
- * @param index the position of the attribute
- * @return the XML type of the attribute
- * @throws IllegalStateException if this is not a START_ELEMENT or ATTRIBUTE
- */
- public String getAttributeType(int index) {
- //State should be either START_ELEMENT or ATTRIBUTE
- if( fEventType == XMLEvent.START_ELEMENT || fEventType == XMLEvent.ATTRIBUTE) {
- return fScanner.getAttributeIterator().getType(index) ;
- } else{
- throw new java.lang.IllegalStateException("Current state is not among the states "
- + getEventTypeString(XMLEvent.START_ELEMENT) + " , "
- + getEventTypeString(XMLEvent.ATTRIBUTE)
- + "valid for getAttributeType()") ;
- }
-
- }//getAttributeType
-
- /** Returns the value of the attribute at the
- * index
- * @param index the position of the attribute
- * @return the attribute value
- * @throws IllegalStateException if this is not a START_ELEMENT or ATTRIBUTE
- */
- public String getAttributeValue(int index) {
- //State should be either START_ELEMENT or ATTRIBUTE
- if( fEventType == XMLEvent.START_ELEMENT || fEventType == XMLEvent.ATTRIBUTE) {
- return fScanner.getAttributeIterator().getValue(index) ;
- } else{
- throw new java.lang.IllegalStateException("Current state is not among the states "
- + getEventTypeString(XMLEvent.START_ELEMENT) + " , "
- + getEventTypeString(XMLEvent.ATTRIBUTE)
- + "valid for getAttributeValue()") ;
- }
-
- }//getAttributeValue
-
- /**
- * @param namespaceURI
- * @param localName
- * @return
- */
- public String getAttributeValue(String namespaceURI, String localName) {
- //State should be either START_ELEMENT or ATTRIBUTE
- if( fEventType == XMLEvent.START_ELEMENT || fEventType == XMLEvent.ATTRIBUTE) {
- XMLAttributesImpl attributes = fScanner.getAttributeIterator();
- if (namespaceURI == null) { //sjsxp issue 70
- return attributes.getValue(attributes.getIndexByLocalName(localName)) ;
- } else {
- return fScanner.getAttributeIterator().getValue(
- namespaceURI.length() == 0 ? null : namespaceURI, localName) ;
- }
-
- } else{
- throw new java.lang.IllegalStateException("Current state is not among the states "
- + getEventTypeString(XMLEvent.START_ELEMENT) + " , "
- + getEventTypeString(XMLEvent.ATTRIBUTE)
- + "valid for getAttributeValue()") ;
- }
-
- }
-
- /** Reads the content of a text-only element. Precondition:
- * the current event is START_ELEMENT. Postcondition:
- * The current event is the corresponding END_ELEMENT.
- * @throws XMLStreamException if the current event is not a START_ELEMENT or if
- * a non text element is encountered
- */
- public String getElementText() throws XMLStreamException {
-
- if(getEventType() != XMLStreamConstants.START_ELEMENT) {
- throw new XMLStreamException(
- "parser must be on START_ELEMENT to read next text", getLocation());
- }
- int eventType = next();
- StringBuffer content = new StringBuffer();
- while(eventType != XMLStreamConstants.END_ELEMENT ) {
- if(eventType == XMLStreamConstants.CHARACTERS
- || eventType == XMLStreamConstants.CDATA
- || eventType == XMLStreamConstants.SPACE
- || eventType == XMLStreamConstants.ENTITY_REFERENCE) {
- content.append(getText());
- } else if(eventType == XMLStreamConstants.PROCESSING_INSTRUCTION
- || eventType == XMLStreamConstants.COMMENT) {
- // skipping
- } else if(eventType == XMLStreamConstants.END_DOCUMENT) {
- throw new XMLStreamException("unexpected end of document when reading element text content");
- } else if(eventType == XMLStreamConstants.START_ELEMENT) {
- throw new XMLStreamException(
- "elementGetText() function expects text only elment but START_ELEMENT was encountered.", getLocation());
- } else {
- throw new XMLStreamException(
- "Unexpected event type "+ eventType, getLocation());
- }
- eventType = next();
- }
- return content.toString();
- }
-
- /** Return the current location of the processor.
- * If the Location is unknown the processor should return
- * an implementation of Location that returns -1 for the
- * location and null for the publicId and systemId.
- * The location information is only valid until next() is
- * called.
- */
- public Location getLocation() {
- return new Location() {
- String _systemId = fEntityScanner.getExpandedSystemId();
- String _publicId = fEntityScanner.getPublicId();
- int _offset = fEntityScanner.getCharacterOffset();
- int _columnNumber = fEntityScanner.getColumnNumber();
- int _lineNumber = fEntityScanner.getLineNumber();
- public String getLocationURI(){
- return _systemId;
- }
-
- public int getCharacterOffset(){
- return _offset;
- }
-
- public int getColumnNumber() {
- return _columnNumber;
- }
-
- public int getLineNumber(){
- return _lineNumber;
- }
-
- public String getPublicId(){
- return _publicId;
- }
-
- public String getSystemId(){
- return _systemId;
- }
-
- public String toString(){
- StringBuffer sbuffer = new StringBuffer() ;
- sbuffer.append("Line number = " + getLineNumber());
- sbuffer.append("\n") ;
- sbuffer.append("Column number = " + getColumnNumber());
- sbuffer.append("\n") ;
- sbuffer.append("System Id = " + getSystemId());
- sbuffer.append("\n") ;
- sbuffer.append("Public Id = " + getPublicId());
- sbuffer.append("\n") ;
- sbuffer.append("Location Uri= " + getLocationURI());
- sbuffer.append("\n") ;
- sbuffer.append("CharacterOffset = " + getCharacterOffset());
- sbuffer.append("\n") ;
- return sbuffer.toString();
- }
- } ;
-
- }
-
- /** Returns a QName for the current START_ELEMENT or END_ELEMENT event
- * @return the QName for the current START_ELEMENT or END_ELEMENT event
- */
- public javax.xml.namespace.QName getName() {
- if(fEventType == XMLEvent.START_ELEMENT || fEventType == XMLEvent.END_ELEMENT)
- return convertXNIQNametoJavaxQName(fScanner.getElementQName());
- else
- throw new java.lang.IllegalStateException("Illegal to call getName() "+
- "when event type is "+ getEventTypeString(fEventType) + "."
- + " Valid states are " + getEventTypeString(XMLEvent.START_ELEMENT) + ", "
- + getEventTypeString(XMLEvent.END_ELEMENT));
- }
-
- /** Returns a read only namespace context for the current
- * position. The context is transient and only valid until
- * a call to next() changes the state of the reader.
- * @return return a namespace context
- */
- public NamespaceContext getNamespaceContext() {
- return fNamespaceContextWrapper ;
- }
-
- /** Returns the count of namespaces declared on this START_ELEMENT or END_ELEMENT,
- * this method is only valid on a START_ELEMENT, END_ELEMENT or NAMESPACE. On
- * an END_ELEMENT the count is of the namespaces that are about to go
- * out of scope. This is the equivalent of the information reported
- * by SAX callback for an end element event.
- * @return returns the number of namespace declarations on this specific element
- * @throws IllegalStateException if this is not a START_ELEMENT, END_ELEMENT or NAMESPACE
- */
- public int getNamespaceCount() {
- //namespaceContext is dynamic object.
- //REVISIT: check if it specifies all conditions mentioned in the javadoc
- if(fEventType == XMLEvent.START_ELEMENT || fEventType == XMLEvent.END_ELEMENT || fEventType == XMLEvent.NAMESPACE){
- return fScanner.getNamespaceContext().getDeclaredPrefixCount() ;
- } else{
- throw new IllegalStateException("Current event state is " + getEventTypeString(fEventType)
- + " is not among the states " + getEventTypeString(XMLEvent.START_ELEMENT)
- + ", " + getEventTypeString(XMLEvent.END_ELEMENT) + ", "
- + getEventTypeString(XMLEvent.NAMESPACE)
- + " valid for getNamespaceCount()." );
- }
- }
-
- /** Returns the prefix for the namespace declared at the
- * index. Returns null if this is the default namespace
- * declaration
- *
- * @param index the position of the namespace declaration
- * @return returns the namespace prefix
- * @throws IllegalStateException if this is not a START_ELEMENT, END_ELEMENT or NAMESPACE
- */
- public String getNamespacePrefix(int index) {
- if(fEventType == XMLEvent.START_ELEMENT || fEventType == XMLEvent.END_ELEMENT || fEventType == XMLEvent.NAMESPACE){
- //namespaceContext is dynamic object.
- String prefix = fScanner.getNamespaceContext().getDeclaredPrefixAt(index) ;
- return prefix.equals("") ? null : prefix ;
- }
- else{
- throw new IllegalStateException("Current state " + getEventTypeString(fEventType)
- + " is not among the states " + getEventTypeString(XMLEvent.START_ELEMENT)
- + ", " + getEventTypeString(XMLEvent.END_ELEMENT) + ", "
- + getEventTypeString(XMLEvent.NAMESPACE)
- + " valid for getNamespacePrefix()." );
- }
- }
-
- /** Returns the uri for the namespace declared at the
- * index.
- *
- * @param index the position of the namespace declaration
- * @return returns the namespace uri
- * @throws IllegalStateException if this is not a START_ELEMENT, END_ELEMENT or NAMESPACE
- */
- public String getNamespaceURI(int index) {
- if(fEventType == XMLEvent.START_ELEMENT || fEventType == XMLEvent.END_ELEMENT || fEventType == XMLEvent.NAMESPACE){
- //namespaceContext is dynamic object.
- return fScanner.getNamespaceContext().getURI(fScanner.getNamespaceContext().getDeclaredPrefixAt(index));
- }
- else{
- throw new IllegalStateException("Current state " + getEventTypeString(fEventType)
- + " is not among the states " + getEventTypeString(XMLEvent.START_ELEMENT)
- + ", " + getEventTypeString(XMLEvent.END_ELEMENT) + ", "
- + getEventTypeString(XMLEvent.NAMESPACE)
- + " valid for getNamespaceURI()." );
- }
-
- }
-
- /** Get the value of a feature/property from the underlying implementation
- * @param name The name of the property, may not be null
- * @return The value of the property
- * @throws IllegalArgumentException if name is null
- */
- public Object getProperty(java.lang.String name) throws java.lang.IllegalArgumentException {
- if(name == null) throw new java.lang.IllegalArgumentException() ;
- if (fPropertyManager != null ){
- if(name.equals(fPropertyManager.STAX_NOTATIONS)){
- return getNotationDecls();
- }else if(name.equals(fPropertyManager.STAX_ENTITIES)){
- return getEntityDecls();
- }else
- return fPropertyManager.getProperty(name);
- }
- return null;
- }
-
- /** Returns the current value of the parse event as a string,
- * this returns the string value of a CHARACTERS event,
- * returns the value of a COMMENT, the replacement value
- * for an ENTITY_REFERENCE,
- * or the String value of the DTD
- * @return the current text or null
- * @throws java.lang.IllegalStateException if this state is not
- * a valid text state.
- */
- public String getText() {
- if( fEventType == XMLEvent.CHARACTERS || fEventType == XMLEvent.COMMENT
- || fEventType == XMLEvent.CDATA || fEventType == XMLEvent.SPACE){
- //this requires creation of new string
- //fEventType == XMLEvent.ENTITY_REFERENCE
- return fScanner.getCharacterData().toString() ;
- } else if(fEventType == XMLEvent.ENTITY_REFERENCE){
- String name = fScanner.getEntityName();
- if(name != null){
- if(fScanner.foundBuiltInRefs)
- return fScanner.getCharacterData().toString();
-
- XMLEntityStorage entityStore = fEntityManager.getEntityStore();
- Entity en = entityStore.getEntity(name);
- if(en == null)
- return null;
- if(en.isExternal())
- return ((Entity.ExternalEntity)en).entityLocation.getExpandedSystemId();
- else
- return ((Entity.InternalEntity)en).text;
- }else
- return null;
- }
- else if(fEventType == XMLEvent.DTD){
- if(fDTDDecl != null){
- return fDTDDecl;
- }
- XMLStringBuffer tmpBuffer = fScanner.getDTDDecl();
- fDTDDecl = tmpBuffer.toString();
- return fDTDDecl;
- } else{
- throw new IllegalStateException("Current state " + getEventTypeString(fEventType)
- + " is not among the states" + getEventTypeString(XMLEvent.CHARACTERS) + ", "
- + getEventTypeString(XMLEvent.COMMENT) + ", "
- + getEventTypeString(XMLEvent.CDATA) + ", "
- + getEventTypeString(XMLEvent.SPACE) + ", "
- + getEventTypeString(XMLEvent.ENTITY_REFERENCE) + ", "
- + getEventTypeString(XMLEvent.DTD) + " valid for getText() " ) ;
- }
- }//getText
-
-
- /** Test if the current event is of the given type and if the namespace and name match the current namespace and name of the current event.
- * If the namespaceURI is null it is not checked for equality, if the localName is null it is not checked for equality.
- * @param type the event type
- * @param namespaceURI the uri of the event, may be null
- * @param localName the localName of the event, may be null
- * @throws XMLStreamException if the required values are not matched.
- */
- public void require(int type, String namespaceURI, String localName) throws XMLStreamException {
- if( type != fEventType)
- throw new XMLStreamException("Event type " + getEventTypeString(type) + " specified did " +
- "not match with current parser event " + getEventTypeString(fEventType));
- if( namespaceURI != null && !namespaceURI.equals(getNamespaceURI()) )
- throw new XMLStreamException("Namespace URI " + namespaceURI +" specified did not match " +
- "with current namespace URI");
- if(localName != null && !localName.equals(getLocalName()))
- throw new XMLStreamException("LocalName " + localName +" specified did not match with " +
- "current local name");
- return;
- }
-
- /** Gets the the text associated with a CHARACTERS, SPACE or CDATA event.
- * Text starting a "sourceStart" is copied into "destination" starting at "targetStart".
- * Up to "length" characters are copied. The number of characters actually copied is returned.
- *
- * The "sourceStart" argument must be greater or equal to 0 and less than or equal to
- * the number of characters associated with the event. Usually, one requests text starting at a "sourceStart" of 0.
- * If the number of characters actually copied is less than the "length", then there is no more text.
- * Otherwise, subsequent calls need to be made until all text has been retrieved. For example:
- *
- * <code>
- * int length = 1024;
- * char[] myBuffer = new char[ length ];
- *
- * for ( int sourceStart = 0 ; ; sourceStart += length )
- * {
- * int nCopied = stream.getTextCharacters( sourceStart, myBuffer, 0, length );
- *
- * if (nCopied < length)
- * break;
- * }
- * </code>
- * XMLStreamException may be thrown if there are any XML errors in the underlying source.
- * The "targetStart" argument must be greater than or equal to 0 and less than the length of "target",
- * Length must be greater than 0 and "targetStart + length" must be less than or equal to length of "target".
- *
- * @param sourceStart the index of the first character in the source array to copy
- * @param target the destination array
- * @param targetStart the start offset in the target array
- * @param length the number of characters to copy
- * @return the number of characters actually copied
- * @throws XMLStreamException if the underlying XML source is not well-formed
- * @throws IndexOutOfBoundsException if targetStart < 0 or > than the length of target
- * @throws IndexOutOfBoundwhile(isCharacters()) ;sException if length < 0 or targetStart + length > length of target
- * @throws UnsupportedOperationException if this method is not supported
- * @throws NullPointerException is if target is null
- */
- public int getTextCharacters(int sourceStart, char[] target, int targetStart, int length) throws XMLStreamException {
-
- if(target == null){
- throw new NullPointerException("target char array can't be null") ;
- }
-
- if(targetStart < 0 || length < 0 || sourceStart < 0 || targetStart >= target.length ||
- (targetStart + length ) > target.length) {
- throw new IndexOutOfBoundsException();
- }
-
- //getTextStart() + sourceStart should not be greater than the lenght of number of characters
- //present
- int copiedLength = 0;
- //int presentDataLen = getTextLength() - (getTextStart()+sourceStart);
- int available = getTextLength() - sourceStart;
- if(available < 0){
- throw new IndexOutOfBoundsException("sourceStart is greater than" +
- "number of characters associated with this event");
- }
- if(available < length){
- copiedLength = available;
- } else{
- copiedLength = length;
- }
-
- System.arraycopy(getTextCharacters(), getTextStart() + sourceStart , target, targetStart, copiedLength);
- return copiedLength;
- }
-
- /** Return true if the current event has text, false otherwise
- * The following events have text:
- * CHARACTERS,DTD ,ENTITY_REFERENCE, COMMENT
- */
- public boolean hasText() {
- if(DEBUG) pr("XMLReaderImpl#EVENT TYPE = " + fEventType ) ;
- if( fEventType == XMLEvent.CHARACTERS || fEventType == XMLEvent.COMMENT || fEventType == XMLEvent.CDATA) {
- return fScanner.getCharacterData().length > 0;
- } else if(fEventType == XMLEvent.ENTITY_REFERENCE) {
- String name = fScanner.getEntityName();
- if(name != null){
- if(fScanner.foundBuiltInRefs)
- return true;
-
- XMLEntityStorage entityStore = fEntityManager.getEntityStore();
- Entity en = entityStore.getEntity(name);
- if(en == null)
- return false;
- if(en.isExternal()){
- return ((Entity.ExternalEntity)en).entityLocation.getExpandedSystemId() != null;
- } else{
- return ((Entity.InternalEntity)en).text != null ;
- }
- }else
- return false;
- } else {
- if(fEventType == XMLEvent.DTD)
- return fScanner.fSeenDoctypeDecl;
- }
- return false;
- }
-
- /** Returns a boolean which indicates if this
- * attribute was created by default
- * @param index the position of the attribute
- * @return true if this is a default attribute
- * @throws IllegalStateException if this is not a START_ELEMENT or ATTRIBUTE
- */
- public boolean isAttributeSpecified(int index) {
- //check that current state should be either START_ELEMENT or ATTRIBUTE
- if( (fEventType == XMLEvent.START_ELEMENT) || (fEventType == XMLEvent.ATTRIBUTE)){
- return fScanner.getAttributeIterator().isSpecified(index) ;
- } else{
- throw new IllegalStateException("Current state is not among the states "
- + getEventTypeString(XMLEvent.START_ELEMENT) + " , "
- + getEventTypeString(XMLEvent.ATTRIBUTE)
- + "valid for isAttributeSpecified()") ;
- }
- }
-
- /** Returns true if the cursor points to a character data event
- * @return true if the cursor points to character data, false otherwise
- */
- public boolean isCharacters() {
- return fEventType == XMLEvent.CHARACTERS ;
- }
-
- /** Skips any insignificant events (COMMENT and PROCESSING_INSTRUCTION)
- * until a START_ELEMENT or
- * END_ELEMENT is reached. If other than space characters are
- * encountered, an exception is thrown. This method should
- * be used when processing element-only content because
- * the parser is not able to recognize ignorable whitespace if
- * then DTD is missing or not interpreted.
- * @return the event type of the element read
- * @throws XMLStreamException if the current event is not white space
- */
- public int nextTag() throws XMLStreamException {
-
- int eventType = next();
- while((eventType == XMLStreamConstants.CHARACTERS && isWhiteSpace()) // skip whitespace
- || (eventType == XMLStreamConstants.CDATA && isWhiteSpace())
- // skip whitespace
- || eventType == XMLStreamConstants.SPACE
- || eventType == XMLStreamConstants.PROCESSING_INSTRUCTION
- || eventType == XMLStreamConstants.COMMENT
- ) {
- eventType = next();
- }
-
- if (eventType != XMLStreamConstants.START_ELEMENT && eventType != XMLStreamConstants.END_ELEMENT) {
- throw new XMLStreamException(
- "found: " + getEventTypeString(eventType)
- + ", expected " + getEventTypeString(XMLStreamConstants.START_ELEMENT)
- + " or " + getEventTypeString(XMLStreamConstants.END_ELEMENT),
- getLocation());
- }
-
- return eventType;
- }
-
- /** Checks if standalone was set in the document
- * @return true if standalone was set in the document, or false otherwise
- */
- public boolean standaloneSet() {
- //xxx: it requires if the standalone was set in the document ? This is different that if the document
- // is standalone
- return fScanner.standaloneSet() ;
- }
-
- /**
- * @param qname
- * @return
- */
- public javax.xml.namespace.QName convertXNIQNametoJavaxQName(com.sun.org.apache.xerces.internal.xni.QName qname){
- if (qname == null) return null;
- //xxx: prefix definition ?
- if(qname.prefix == null){
- return new javax.xml.namespace.QName(qname.uri, qname.localpart) ;
- } else{
- return new javax.xml.namespace.QName(qname.uri, qname.localpart, qname.prefix) ;
- }
- }
-
- /** Return the uri for the given prefix.
- * The uri returned depends on the current state of the processor.
- *
- * <p><strong>NOTE:</strong>The 'xml' prefix is bound as defined in
- * <a href="http://www.w3.org/TR/REC-xml-names/#ns-using">Namespaces in XML</a>
- * specification to "http://www.w3.org/XML/1998/namespace".
- *
- * <p><strong>NOTE:</strong> The 'xmlns' prefix must be resolved to following namespace
- * <a href="http://www.w3.org/2000/xmlns/">http://www.w3.org/2000/xmlns/</a>
- * @return the uri bound to the given prefix or null if it is not bound
- * @param prefix The prefix to lookup, may not be null
- * @throws IllegalStateException - if the prefix is null
- */
- public String getNamespaceURI(String prefix) {
- if(prefix == null) throw new java.lang.IllegalArgumentException("prefix cannot be null.") ;
-
- //first add the string to symbol table.. since internally identity comparisons are done.
- return fScanner.getNamespaceContext().getURI(fSymbolTable.addSymbol(prefix)) ;
- }
-
- //xxx: this function is not being used.
- protected void setPropertyManager(PropertyManager propertyManager){
- fPropertyManager = propertyManager ;
- //REVISIT: we were supplying hashmap ealier
- fScanner.setProperty("stax-properties",propertyManager);
- fScanner.setPropertyManager(propertyManager) ;
- }
-
- /**
- * @return returns the reference to property manager.
- */
- protected PropertyManager getPropertyManager(){
- return fPropertyManager ;
- }
-
- static void pr(String str) {
- System.out.println(str) ;
- }
-
- protected List getEntityDecls(){
- if(fEventType == XMLStreamConstants.DTD){
- XMLEntityStorage entityStore = fEntityManager.getEntityStore();
- ArrayList list = null;
- if(entityStore.hasEntities()){
- EntityDeclarationImpl decl = null;
- list = new ArrayList(entityStore.getEntitySize());
- Enumeration enu = entityStore.getEntityKeys();
- while(enu.hasMoreElements()){
- String key = (String)enu.nextElement();
- Entity en = (Entity)entityStore.getEntity(key);
- decl = new EntityDeclarationImpl();
- decl.setEntityName(key);
- if(en.isExternal()){
- decl.setXMLResourceIdentifier(((Entity.ExternalEntity)en).entityLocation);
- decl.setNotationName(((Entity.ExternalEntity)en).notation);
- }
- else
- decl.setEntityReplacementText(((Entity.InternalEntity)en).text);
- list.add(decl);
- }
- }
- return list;
- }
- return null;
- }
-
- protected List getNotationDecls(){
- if(fEventType == XMLStreamConstants.DTD){
- if(fScanner.fDTDScanner == null) return null;
- DTDGrammar grammar = ((XMLDTDScannerImpl)(fScanner.fDTDScanner)).getGrammar();
- if(grammar == null) return null;
- List notations = grammar.getNotationDecls();
-
- Iterator it = notations.iterator();
- ArrayList list = new ArrayList();
- while(it.hasNext()){
- XMLNotationDecl ni = (XMLNotationDecl)it.next();
- if(ni!= null){
- list.add(new NotationDeclarationImpl(ni));
- }
- }
- return list;
- }
- return null;
- }
-
-
-
-}//XMLReaderImpl
diff --git a/src/com/sun/org/apache/xerces/internal/impl/XMLVersionDetector.java b/src/com/sun/org/apache/xerces/internal/impl/XMLVersionDetector.java
deleted file mode 100644
index a7ab027..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/XMLVersionDetector.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl;
-
-import java.io.EOFException;
-import java.io.IOException;
-
-import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.xni.XMLString;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-import com.sun.xml.internal.stream.Entity.ScannedEntity;
-
-/**
- * This class scans the version of the document to determine
- * which scanner to use: XML 1.1 or XML 1.0.
- * The version is scanned using XML 1.1. scanner.
- *
- * @xerces.internal
- *
- * @author Neil Graham, IBM
- * @author Elena Litani, IBM
- */
-public class XMLVersionDetector {
-
- //
- // Constants
- //
-
- private final static char[] XML11_VERSION = new char[]{'1', '.', '1'};
-
-
- // property identifiers
-
- /** Property identifier: symbol table. */
- protected static final String SYMBOL_TABLE =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY;
-
- /** Property identifier: error reporter. */
- protected static final String ERROR_REPORTER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY;
-
- /** Property identifier: entity manager. */
- protected static final String ENTITY_MANAGER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_MANAGER_PROPERTY;
-
- //
- // Data
- //
-
- /** Symbol: "version". */
- protected final static String fVersionSymbol = "version".intern();
-
- // symbol: [xml]:
- protected static final String fXMLSymbol = "[xml]".intern();
-
- /** Symbol table. */
- protected SymbolTable fSymbolTable;
-
- /** Error reporter. */
- protected XMLErrorReporter fErrorReporter;
-
- /** Entity manager. */
- protected XMLEntityManager fEntityManager;
-
- protected String fEncoding = null;
-
- private XMLString fVersionNum = new XMLString();
-
- private final char [] fExpectedVersionString = {'<', '?', 'x', 'm', 'l', ' ', 'v', 'e', 'r', 's',
- 'i', 'o', 'n', '=', ' ', ' ', ' ', ' ', ' '};
-
- /**
- *
- *
- * @param componentManager The component manager.
- *
- * @throws SAXException Throws exception if required features and
- * properties cannot be found.
- */
- public void reset(XMLComponentManager componentManager)
- throws XMLConfigurationException {
-
- // Xerces properties
- fSymbolTable = (SymbolTable)componentManager.getProperty(SYMBOL_TABLE);
- fErrorReporter = (XMLErrorReporter)componentManager.getProperty(ERROR_REPORTER);
- fEntityManager = (XMLEntityManager)componentManager.getProperty(ENTITY_MANAGER);
- for(int i=14; i<fExpectedVersionString.length; i++ )
- fExpectedVersionString[i] = ' ';
- } // reset(XMLComponentManager)
-
- /**
- * Reset the reference to the appropriate scanner given the version of the
- * document and start document scanning.
- * @param scanner - the scanner to use
- * @param version - the version of the document (XML 1.1 or XML 1.0).
- */
- public void startDocumentParsing(XMLEntityHandler scanner, short version){
-
- if (version == Constants.XML_VERSION_1_0){
- fEntityManager.setScannerVersion(Constants.XML_VERSION_1_0);
- }
- else {
- fEntityManager.setScannerVersion(Constants.XML_VERSION_1_1);
- }
- // Make sure the locator used by the error reporter is the current entity scanner.
- fErrorReporter.setDocumentLocator(fEntityManager.getEntityScanner());
-
- // Note: above we reset fEntityScanner in the entity manager, thus in startEntity
- // in each scanner fEntityScanner field must be reset to reflect the change.
- //
- fEntityManager.setEntityHandler(scanner);
-
- scanner.startEntity(fXMLSymbol, fEntityManager.getCurrentResourceIdentifier(), fEncoding, null);
- }
-
-
- /**
- * This methods scans the XML declaration to find out the version
- * (and provisional encoding) of the document.
- * The scanning is doing using XML 1.1 scanner.
- * @param inputSource
- * @return short - Constants.XML_VERSION_1_1 if document version 1.1,
- * otherwise Constants.XML_VERSION_1_0
- * @throws IOException
- */
- public short determineDocVersion(XMLInputSource inputSource) throws IOException {
- fEncoding = fEntityManager.setupCurrentEntity(false, fXMLSymbol, inputSource, false, true);
-
- // Must use XML 1.0 scanner to handle whitespace correctly
- // in the XML declaration.
- fEntityManager.setScannerVersion(Constants.XML_VERSION_1_0);
- XMLEntityScanner scanner = fEntityManager.getEntityScanner();
- scanner.detectingVersion = true;
- try {
- if (!scanner.skipString("<?xml")) {
- // definitely not a well-formed 1.1 doc!
- scanner.detectingVersion = false;
- return Constants.XML_VERSION_1_0;
- }
- if (!scanner.skipDeclSpaces()) {
- fixupCurrentEntity(fEntityManager, fExpectedVersionString, 5);
- scanner.detectingVersion = false;
- return Constants.XML_VERSION_1_0;
- }
- if (!scanner.skipString("version")) {
- fixupCurrentEntity(fEntityManager, fExpectedVersionString, 6);
- scanner.detectingVersion = false;
- return Constants.XML_VERSION_1_0;
- }
- scanner.skipDeclSpaces();
- // Check if the next character is '='. If it is then consume it.
- if (scanner.peekChar() != '=') {
- fixupCurrentEntity(fEntityManager, fExpectedVersionString, 13);
- scanner.detectingVersion = false;
- return Constants.XML_VERSION_1_0;
- }
- scanner.scanChar(null);
- scanner.skipDeclSpaces();
- int quoteChar = scanner.scanChar(null);
- fExpectedVersionString[14] = (char) quoteChar;
- for (int versionPos = 0; versionPos < XML11_VERSION.length; versionPos++) {
- fExpectedVersionString[15 + versionPos] = (char) scanner.scanChar(null);
- }
- // REVISIT: should we check whether this equals quoteChar?
- fExpectedVersionString[18] = (char) scanner.scanChar(null);
- fixupCurrentEntity(fEntityManager, fExpectedVersionString, 19);
- int matched = 0;
- for (; matched < XML11_VERSION.length; matched++) {
- if (fExpectedVersionString[15 + matched] != XML11_VERSION[matched])
- break;
- }
- scanner.detectingVersion = false;
- if (matched == XML11_VERSION.length)
- return Constants.XML_VERSION_1_1;
- return Constants.XML_VERSION_1_0;
- // premature end of file
- }
- catch (EOFException e) {
- fErrorReporter.reportError(
- XMLMessageFormatter.XML_DOMAIN,
- "PrematureEOF",
- null,
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- scanner.detectingVersion = false;
- return Constants.XML_VERSION_1_0;
- }
- }
-
- // This method prepends "length" chars from the char array,
- // from offset 0, to the manager's fCurrentEntity.ch.
- private void fixupCurrentEntity(XMLEntityManager manager,
- char [] scannedChars, int length) {
- ScannedEntity currentEntity = manager.getCurrentEntity();
- if(currentEntity.count-currentEntity.position+length > currentEntity.ch.length) {
- //resize array; this case is hard to imagine...
- char[] tempCh = currentEntity.ch;
- currentEntity.ch = new char[length+currentEntity.count-currentEntity.position+1];
- System.arraycopy(tempCh, 0, currentEntity.ch, 0, tempCh.length);
- }
- if(currentEntity.position < length) {
- // have to move sensitive stuff out of the way...
- System.arraycopy(currentEntity.ch, currentEntity.position, currentEntity.ch, length, currentEntity.count-currentEntity.position);
- currentEntity.count += length-currentEntity.position;
- } else {
- // have to reintroduce some whitespace so this parses:
- for(int i=length; i<currentEntity.position; i++)
- currentEntity.ch[i]=' ';
- }
- // prepend contents...
- System.arraycopy(scannedChars, 0, currentEntity.ch, 0, length);
- currentEntity.position = 0;
- currentEntity.baseCharOffset = 0;
- currentEntity.startPosition = 0;
- currentEntity.columnNumber = currentEntity.lineNumber = 1;
- }
-
-} // class XMLVersionDetector
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dtd/BalancedDTDGrammar.java b/src/com/sun/org/apache/xerces/internal/impl/dtd/BalancedDTDGrammar.java
deleted file mode 100644
index 0b09e34..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dtd/BalancedDTDGrammar.java
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dtd;
-
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.xni.Augmentations;
-import com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-
-/**
- * <p>A DTD grammar that produces balanced syntax trees.</p>
- *
- * @xerces.internal
- *
- * @author Michael Glavassevich, IBM
- * @version $Id: BalancedDTDGrammar.java,v 1.1 2010/08/11 07:18:38 joehw Exp $
- */
-final class BalancedDTDGrammar extends DTDGrammar {
-
- //
- // Data
- //
-
- /** Mixed. */
- private boolean fMixed;
-
- /** Stack depth */
- private int fDepth = 0;
-
- /** Children content model operation stack. */
- private short [] fOpStack = null;
-
- /** Holder for choice/sequence/leaf groups at each depth. */
- private int [][] fGroupIndexStack;
-
- /** Sizes of the allocated portions of each int[] in fGroupIndexStack. */
- private int [] fGroupIndexStackSizes;
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- public BalancedDTDGrammar(SymbolTable symbolTable, XMLDTDDescription desc) {
- super(symbolTable, desc);
- } // BalancedDTDGrammar(SymbolTable,XMLDTDDescription)
-
- //
- // Public methods
- //
-
- /**
- * The start of a content model. Depending on the type of the content
- * model, specific methods may be called between the call to the
- * startContentModel method and the call to the endContentModel method.
- *
- * @param elementName The name of the element.
- * @param augs Additional information that may include infoset
- * augmentations.
- * @throws XNIException Thrown by handler to signal an error.
- */
- public final void startContentModel(String elementName, Augmentations augs)
- throws XNIException {
- fDepth = 0;
- initializeContentModelStacks();
- super.startContentModel(elementName, augs);
- } // startContentModel(String)
-
- /**
- * A start of either a mixed or children content model. A mixed
- * content model will immediately be followed by a call to the
- * <code>pcdata()</code> method. A children content model will
- * contain additional groups and/or elements.
- *
- * @param augs Additional information that may include infoset
- * augmentations.
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see #any
- * @see #empty
- */
- public final void startGroup(Augmentations augs) throws XNIException {
- ++fDepth;
- initializeContentModelStacks();
- fMixed = false;
- } // startGroup()
-
- /**
- * The appearance of "#PCDATA" within a group signifying a
- * mixed content model. This method will be the first called
- * following the content model's <code>startGroup()</code>.
- *
- *@param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see #startGroup
- */
- public final void pcdata(Augmentations augs) throws XNIException {
- fMixed = true;
- } // pcdata()
-
- /**
- * A referenced element in a mixed or children content model.
- *
- * @param elementName The name of the referenced element.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public final void element(String elementName, Augmentations augs) throws XNIException {
- addToCurrentGroup(addUniqueLeafNode(elementName));
- } // element(String)
-
- /**
- * The separator between choices or sequences of a mixed or children
- * content model.
- *
- * @param separator The type of children separator.
- * @param augs Additional information that may include infoset
- * augmentations.
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see org.apache.xerces.xni.XMLDTDContentModelHandler#SEPARATOR_CHOICE
- * @see org.apache.xerces.xni.XMLDTDContentModelHandler#SEPARATOR_SEQUENCE
- */
- public final void separator(short separator, Augmentations augs) throws XNIException {
- if (separator == XMLDTDContentModelHandler.SEPARATOR_CHOICE) {
- fOpStack[fDepth] = XMLContentSpec.CONTENTSPECNODE_CHOICE;
- }
- else if (separator == XMLDTDContentModelHandler.SEPARATOR_SEQUENCE) {
- fOpStack[fDepth] = XMLContentSpec.CONTENTSPECNODE_SEQ;
- }
- } // separator(short)
-
- /**
- * The occurrence count for a child in a children content model or
- * for the mixed content model group.
- *
- * @param occurrence The occurrence count for the last element
- * or group.
- * @param augs Additional information that may include infoset
- * augmentations.
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see org.apache.xerces.xni.XMLDTDContentModelHandler#OCCURS_ZERO_OR_ONE
- * @see org.apache.xerces.xni.XMLDTDContentModelHandler#OCCURS_ZERO_OR_MORE
- * @see org.apache.xerces.xni.XMLDTDContentModelHandler#OCCURS_ONE_OR_MORE
- */
- public final void occurrence(short occurrence, Augmentations augs) throws XNIException {
- if (!fMixed) {
- int currentIndex = fGroupIndexStackSizes[fDepth] - 1;
- if (occurrence == XMLDTDContentModelHandler.OCCURS_ZERO_OR_ONE) {
- fGroupIndexStack[fDepth][currentIndex] = addContentSpecNode(XMLContentSpec.CONTENTSPECNODE_ZERO_OR_ONE, fGroupIndexStack[fDepth][currentIndex], -1);
- }
- else if ( occurrence == XMLDTDContentModelHandler.OCCURS_ZERO_OR_MORE) {
- fGroupIndexStack[fDepth][currentIndex] = addContentSpecNode(XMLContentSpec.CONTENTSPECNODE_ZERO_OR_MORE, fGroupIndexStack[fDepth][currentIndex], -1);
- }
- else if ( occurrence == XMLDTDContentModelHandler.OCCURS_ONE_OR_MORE) {
- fGroupIndexStack[fDepth][currentIndex] = addContentSpecNode(XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE, fGroupIndexStack[fDepth][currentIndex], -1);
- }
- }
- } // occurrence(short)
-
- /**
- * The end of a group for mixed or children content models.
- *
- * @param augs Additional information that may include infoset
- * augmentations.
- * @throws XNIException Thrown by handler to signal an error.
- */
- public final void endGroup(Augmentations augs) throws XNIException {
- final int length = fGroupIndexStackSizes[fDepth];
- final int group = length > 0 ? addContentSpecNodes(0, length - 1) : addUniqueLeafNode(null);
- --fDepth;
- addToCurrentGroup(group);
- } // endGroup()
-
- /**
- * The end of the DTD.
- *
- * @param augs Additional information that may include infoset
- * augmentations.
- * @throws XNIException Thrown by handler to signal an error.
- */
- public final void endDTD(Augmentations augs) throws XNIException {
- super.endDTD(augs);
- fOpStack = null;
- fGroupIndexStack = null;
- fGroupIndexStackSizes = null;
- } // endDTD()
-
- //
- // Protected methods
- //
-
- /**
- * Adds the content spec to the given element declaration.
- */
- protected final void addContentSpecToElement(XMLElementDecl elementDecl) {
- int contentSpec = fGroupIndexStackSizes[0] > 0 ? fGroupIndexStack[0][0] : -1;
- setContentSpecIndex(fCurrentElementIndex, contentSpec);
- }
-
- //
- // Private methods
- //
-
- /**
- * Creates a subtree from the leaf nodes at the current depth.
- */
- private int addContentSpecNodes(int begin, int end) {
- if (begin == end) {
- return fGroupIndexStack[fDepth][begin];
- }
- final int middle = (begin + end) >>> 1;
- return addContentSpecNode(fOpStack[fDepth],
- addContentSpecNodes(begin, middle),
- addContentSpecNodes(middle + 1, end));
- } // addContentSpecNodes(int,int)
-
- /**
- * Initialize the stacks which temporarily hold content models.
- */
- private void initializeContentModelStacks() {
- if (fOpStack == null) {
- fOpStack = new short[8];
- fGroupIndexStack = new int [8][];
- fGroupIndexStackSizes = new int [8];
- }
- else if (fDepth == fOpStack.length) {
- short [] newOpStack = new short[fDepth * 2];
- System.arraycopy(fOpStack, 0, newOpStack, 0, fDepth);
- fOpStack = newOpStack;
- int [][] newGroupIndexStack = new int[fDepth * 2][];
- System.arraycopy(fGroupIndexStack, 0, newGroupIndexStack, 0, fDepth);
- fGroupIndexStack = newGroupIndexStack;
- int [] newGroupIndexStackLengths = new int[fDepth * 2];
- System.arraycopy(fGroupIndexStackSizes, 0, newGroupIndexStackLengths, 0, fDepth);
- fGroupIndexStackSizes = newGroupIndexStackLengths;
- }
- fOpStack[fDepth] = -1;
- fGroupIndexStackSizes[fDepth] = 0;
- } // initializeContentModelStacks()
-
- /**
- * Add XMLContentSpec to the current group.
- *
- * @param contentSpec handle to the XMLContentSpec to add to the current group
- */
- private void addToCurrentGroup(int contentSpec) {
- int [] currentGroup = fGroupIndexStack[fDepth];
- int length = fGroupIndexStackSizes[fDepth]++;
- if (currentGroup == null) {
- currentGroup = new int[8];
- fGroupIndexStack[fDepth] = currentGroup;
- }
- else if (length == currentGroup.length) {
- int [] newGroup = new int[currentGroup.length * 2];
- System.arraycopy(currentGroup, 0, newGroup, 0, currentGroup.length);
- currentGroup = newGroup;
- fGroupIndexStack[fDepth] = currentGroup;
- }
- currentGroup[length] = contentSpec;
- } // addToCurrentGroup(int)
-
-} // class BalancedDTDGrammar
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dtd/DTDGrammar.java b/src/com/sun/org/apache/xerces/internal/impl/dtd/DTDGrammar.java
deleted file mode 100644
index 03768b3..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dtd/DTDGrammar.java
+++ /dev/null
@@ -1,2651 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dtd;
-
-import com.sun.org.apache.xerces.internal.impl.dtd.models.CMAny;
-import com.sun.org.apache.xerces.internal.impl.dtd.models.CMBinOp;
-import com.sun.org.apache.xerces.internal.impl.dtd.models.CMLeaf;
-import com.sun.org.apache.xerces.internal.impl.dtd.models.CMNode;
-import com.sun.org.apache.xerces.internal.impl.dtd.models.CMUniOp;
-import com.sun.org.apache.xerces.internal.impl.dtd.models.ContentModelValidator;
-import com.sun.org.apache.xerces.internal.impl.dtd.models.DFAContentModel;
-import com.sun.org.apache.xerces.internal.impl.dtd.models.MixedContentModel;
-import com.sun.org.apache.xerces.internal.impl.dtd.models.SimpleContentModel;
-import com.sun.org.apache.xerces.internal.impl.dv.DatatypeValidator;
-import com.sun.org.apache.xerces.internal.impl.validation.EntityState;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.xni.Augmentations;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLDTDHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLLocator;
-import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
-import com.sun.org.apache.xerces.internal.xni.XMLString;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.grammars.Grammar;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDContentModelSource;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDSource;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * A DTD grammar. This class implements the XNI handler interfaces
- * for DTD information so that it can build the appropriate validation
- * structures automatically from the callbacks.
- *
- * @xerces.internal
- *
- * @author Eric Ye, IBM
- * @author Jeffrey Rodriguez, IBM
- * @author Andy Clark, IBM
- * @author Neil Graham, IBM
- *
- * @version $Id: DTDGrammar.java,v 1.4 2010/08/11 07:18:37 joehw Exp $
- */
-public class DTDGrammar
- implements XMLDTDHandler, XMLDTDContentModelHandler, EntityState, Grammar {
-
- //
- // Constants
- //
-
- /** Top level scope (-1). */
- public static final int TOP_LEVEL_SCOPE = -1;
-
- // private
-
- /** Chunk shift (8). */
- private static final int CHUNK_SHIFT = 8; // 2^8 = 256
-
- /** Chunk size (1 << CHUNK_SHIFT). */
- private static final int CHUNK_SIZE = (1 << CHUNK_SHIFT);
-
- /** Chunk mask (CHUNK_SIZE - 1). */
- private static final int CHUNK_MASK = CHUNK_SIZE - 1;
-
- /** Initial chunk count (1 << (10 - CHUNK_SHIFT)). */
- private static final int INITIAL_CHUNK_COUNT = (1 << (10 - CHUNK_SHIFT)); // 2^10 = 1k
-
- /** List flag (0x80). */
- private static final short LIST_FLAG = 0x80;
-
- /** List mask (~LIST_FLAG). */
- private static final short LIST_MASK = ~LIST_FLAG;
-
- // debugging
-
- /** Debug DTDGrammar. */
- private static final boolean DEBUG = false;
-
- //
- // Data
- //
-
- protected XMLDTDSource fDTDSource = null;
- protected XMLDTDContentModelSource fDTDContentModelSource = null;
-
- /** Current element index. */
- protected int fCurrentElementIndex;
-
- /** Current attribute index. */
- protected int fCurrentAttributeIndex;
-
- /** fReadingExternalDTD */
- protected boolean fReadingExternalDTD = false;
-
- /** Symbol table. */
- private SymbolTable fSymbolTable;
-
- // The XMLDTDDescription with which this Grammar is associated
- protected XMLDTDDescription fGrammarDescription = null;
-
- // element declarations
-
- /** Number of element declarations. */
- private int fElementDeclCount = 0;
-
- /** Element declaration name. */
- private QName fElementDeclName[][] = new QName[INITIAL_CHUNK_COUNT][];
-
- /**
- * Element declaration type.
- * @see XMLElementDecl
- */
- private short fElementDeclType[][] = new short[INITIAL_CHUNK_COUNT][];
-
- /**
- * Element declaration content spec index. This index value is used
- * to refer to the content spec information tables.
- */
- private int fElementDeclContentSpecIndex[][] = new int[INITIAL_CHUNK_COUNT][];
-
- /**
- * Element declaration content model validator. This validator is
- * constructed from the content spec nodes.
- */
- private ContentModelValidator fElementDeclContentModelValidator[][] = new ContentModelValidator[INITIAL_CHUNK_COUNT][];
-
- /** First attribute declaration of an element declaration. */
- private int fElementDeclFirstAttributeDeclIndex[][] = new int[INITIAL_CHUNK_COUNT][];
-
- /** Last attribute declaration of an element declaration. */
- private int fElementDeclLastAttributeDeclIndex[][] = new int[INITIAL_CHUNK_COUNT][];
-
- // attribute declarations
-
- /** Number of attribute declarations. */
- private int fAttributeDeclCount = 0 ;
-
- /** Attribute declaration name. */
- private QName fAttributeDeclName[][] = new QName[INITIAL_CHUNK_COUNT][];
-
- // is this grammar immutable? (fully constructed and not changeable)
- private boolean fIsImmutable = false;
-
- /**
- * Attribute declaration type.
- * @see XMLAttributeDecl
- */
- private short fAttributeDeclType[][] = new short[INITIAL_CHUNK_COUNT][];
-
- /** Attribute declaration enumeration values. */
- private String[] fAttributeDeclEnumeration[][] = new String[INITIAL_CHUNK_COUNT][][];
- private short fAttributeDeclDefaultType[][] = new short[INITIAL_CHUNK_COUNT][];
- private DatatypeValidator fAttributeDeclDatatypeValidator[][] = new DatatypeValidator[INITIAL_CHUNK_COUNT][];
- private String fAttributeDeclDefaultValue[][] = new String[INITIAL_CHUNK_COUNT][];
- private String fAttributeDeclNonNormalizedDefaultValue[][] = new String[INITIAL_CHUNK_COUNT][];
- private int fAttributeDeclNextAttributeDeclIndex[][] = new int[INITIAL_CHUNK_COUNT][];
-
- // content specs
-
- // here saves the content spec binary trees for element decls,
- // each element with a content model will hold a pointer which is
- // the index of the head node of the content spec tree.
-
- private int fContentSpecCount = 0;
- private short fContentSpecType[][] = new short[INITIAL_CHUNK_COUNT][];
- private Object fContentSpecValue[][] = new Object[INITIAL_CHUNK_COUNT][];
- private Object fContentSpecOtherValue[][] = new Object[INITIAL_CHUNK_COUNT][];
-
- // entities
-
- private int fEntityCount = 0;
- private String fEntityName[][] = new String[INITIAL_CHUNK_COUNT][];
- private String[][] fEntityValue = new String[INITIAL_CHUNK_COUNT][];
- private String[][] fEntityPublicId = new String[INITIAL_CHUNK_COUNT][];
- private String[][] fEntitySystemId = new String[INITIAL_CHUNK_COUNT][];
- private String[][] fEntityBaseSystemId = new String[INITIAL_CHUNK_COUNT][];
- private String[][] fEntityNotation = new String[INITIAL_CHUNK_COUNT][];
- private byte[][] fEntityIsPE = new byte[INITIAL_CHUNK_COUNT][];
- private byte[][] fEntityInExternal = new byte[INITIAL_CHUNK_COUNT][];
-
- // notations
-
- private int fNotationCount = 0;
- private String fNotationName[][] = new String[INITIAL_CHUNK_COUNT][];
- private String[][] fNotationPublicId = new String[INITIAL_CHUNK_COUNT][];
- private String[][] fNotationSystemId = new String[INITIAL_CHUNK_COUNT][];
- private String[][] fNotationBaseSystemId = new String[INITIAL_CHUNK_COUNT][];
-
- // other information
-
- /** Element index mapping table. */
- private final Map<String, Integer> fElementIndexMap = new HashMap<>();
-
- /** Entity index mapping table. */
- private final Map<String, Integer> fEntityIndexMap = new HashMap<>();
-
- /** Notation index mapping table. */
- private final Map<String, Integer> fNotationIndexMap = new HashMap<>();
-
- // temp variables
-
- /** Mixed. */
- private boolean fMixed;
-
- /** Temporary qualified name. */
- private final QName fQName = new QName();
-
- /** Temporary qualified name. */
- private final QName fQName2 = new QName();
-
- /** Temporary Attribute decl. */
- protected final XMLAttributeDecl fAttributeDecl = new XMLAttributeDecl();
-
- // for buildSyntaxTree method
-
- private int fLeafCount = 0;
- private int fEpsilonIndex = -1;
-
- /** Element declaration. */
- private XMLElementDecl fElementDecl = new XMLElementDecl();
-
- /** Entity declaration. */
- private XMLEntityDecl fEntityDecl = new XMLEntityDecl();
-
- /** Simple type. */
- private XMLSimpleType fSimpleType = new XMLSimpleType();
-
- /** Content spec node. */
- private XMLContentSpec fContentSpec = new XMLContentSpec();
-
- /** table of XMLElementDecl */
- Map<String, XMLElementDecl> fElementDeclTab = new HashMap<>();
-
- /** Children content model operation stack. */
- private short[] fOpStack = null;
-
- /** Children content model index stack. */
- private int[] fNodeIndexStack = null;
-
- /** Children content model previous node index stack. */
- private int[] fPrevNodeIndexStack = null;
-
- /** Stack depth */
- private int fDepth = 0;
-
- /** Entity stack. */
- private boolean[] fPEntityStack = new boolean[4];
- private int fPEDepth = 0;
-
- // additional fields(columns) for the element Decl pool in the Grammar
-
- /** flag if the elementDecl is External. */
- private int fElementDeclIsExternal[][] = new int[INITIAL_CHUNK_COUNT][];
-
-
- // additional fields(columns) for the attribute Decl pool in the Grammar
-
- /** flag if the AttributeDecl is External. */
- private int fAttributeDeclIsExternal[][] = new int[INITIAL_CHUNK_COUNT][];
-
- // for mixedElement method
-
- int valueIndex = -1;
- int prevNodeIndex = -1;
- int nodeIndex = -1;
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- public DTDGrammar(SymbolTable symbolTable, XMLDTDDescription desc) {
- fSymbolTable = symbolTable;
- fGrammarDescription = desc;
- } // <init>(SymbolTable)
-
- // Grammar methods
-
- // return the XMLDTDDescription object with which this is associated
- public XMLGrammarDescription getGrammarDescription() {
- return fGrammarDescription;
- } // getGrammarDescription(): XMLGrammarDescription
-
- //
- // Public methods
- //
-
- /**
- * Returns true if the specified element declaration is external.
- *
- * @param elementDeclIndex The element declaration index.
- */
- public boolean getElementDeclIsExternal(int elementDeclIndex) {
-
- if (elementDeclIndex < 0) {
- return false;
- }
-
- int chunk = elementDeclIndex >> CHUNK_SHIFT;
- int index = elementDeclIndex & CHUNK_MASK;
- return (fElementDeclIsExternal[chunk][index] != 0);
-
- } // getElementDeclIsExternal(int):boolean
-
- /**
- * Returns true if the specified attribute declaration is external.
- *
- * @param attributeDeclIndex Attribute declaration index.
- */
- public boolean getAttributeDeclIsExternal(int attributeDeclIndex) {
-
- if (attributeDeclIndex < 0) {
- return false;
- }
-
- int chunk = attributeDeclIndex >> CHUNK_SHIFT;
- int index = attributeDeclIndex & CHUNK_MASK;
- return (fAttributeDeclIsExternal[chunk][index] != 0);
- }
-
- public int getAttributeDeclIndex(int elementDeclIndex, String attributeDeclName) {
- if (elementDeclIndex == -1) {
- return -1;
- }
- int attDefIndex = getFirstAttributeDeclIndex(elementDeclIndex);
- while (attDefIndex != -1) {
- getAttributeDecl(attDefIndex, fAttributeDecl);
-
- if (fAttributeDecl.name.rawname == attributeDeclName
- || attributeDeclName.equals(fAttributeDecl.name.rawname) ) {
- return attDefIndex;
- }
- attDefIndex = getNextAttributeDeclIndex(attDefIndex);
- }
- return -1;
- } // getAttributeDeclIndex (int,QName)
-
- //
- // XMLDTDHandler methods
- //
-
- /**
- * The start of the DTD.
- *
- * @param locator The document locator, or null if the document
- * location cannot be reported during the parsing of
- * the document DTD. However, it is <em>strongly</em>
- * recommended that a locator be supplied that can
- * at least report the base system identifier of the
- * DTD.
- *
- * @param augs Additional information that may include infoset
- * augmentations.
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startDTD(XMLLocator locator, Augmentations augs) throws XNIException {
- //Initialize stack
- fOpStack = null;
- fNodeIndexStack = null;
- fPrevNodeIndexStack = null;
- } // startDTD(XMLLocator)
-
- /**
- * This method notifies of the start of an entity. The DTD has the
- * pseudo-name of "[dtd]" and parameter entity names start with '%'.
- * <p>
- * <strong>Note:</strong> Since the DTD is an entity, the handler
- * will be notified of the start of the DTD entity by calling the
- * startParameterEntity method with the entity name "[dtd]" <em>before</em> calling
- * the startDTD method.
- *
- * @param name The name of the parameter entity.
- * @param identifier The resource identifier.
- * @param encoding The auto-detected IANA encoding name of the entity
- * stream. This value will be null in those situations
- * where the entity encoding is not auto-detected (e.g.
- * internal parameter entities).
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startParameterEntity(String name,
- XMLResourceIdentifier identifier,
- String encoding,
- Augmentations augs) throws XNIException {
-
- // keep track of this entity before fEntityDepth is increased
- if (fPEDepth == fPEntityStack.length) {
- boolean[] entityarray = new boolean[fPEntityStack.length * 2];
- System.arraycopy(fPEntityStack, 0, entityarray, 0, fPEntityStack.length);
- fPEntityStack = entityarray;
- }
- fPEntityStack[fPEDepth] = fReadingExternalDTD;
- fPEDepth++;
-
- } // startParameterEntity(String,XMLResourceIdentifier,String,Augmentations)
-
- /**
- * The start of the DTD external subset.
- *
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startExternalSubset(XMLResourceIdentifier identifier,
- Augmentations augs) throws XNIException {
- fReadingExternalDTD = true;
- } // startExternalSubset(Augmentations)
-
- /**
- * This method notifies the end of an entity. The DTD has the pseudo-name
- * of "[dtd]" and parameter entity names start with '%'.
- * <p>
- * <strong>Note:</strong> Since the DTD is an entity, the handler
- * will be notified of the end of the DTD entity by calling the
- * endEntity method with the entity name "[dtd]" <em>after</em> calling
- * the endDTD method.
- *
- * @param name The name of the entity.
- * @param augs Additional information that may include infoset
- * augmentations.
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endParameterEntity(String name, Augmentations augs) throws XNIException {
-
- fPEDepth--;
- fReadingExternalDTD = fPEntityStack[fPEDepth];
-
- } // endParameterEntity(String,Augmentations)
-
- /**
- * The end of the DTD external subset.
- *
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endExternalSubset(Augmentations augs) throws XNIException {
- fReadingExternalDTD = false;
- } // endExternalSubset(Augmentations)
-
- /**
- * An element declaration.
- *
- * @param name The name of the element.
- * @param contentModel The element content model.
- * @param augs Additional information that may include infoset
- * augmentations.
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void elementDecl(String name, String contentModel, Augmentations augs)
- throws XNIException {
-
- XMLElementDecl tmpElementDecl = fElementDeclTab.get(name) ;
-
- // check if it is already defined
- if ( tmpElementDecl != null ) {
- if (tmpElementDecl.type == -1) {
- fCurrentElementIndex = getElementDeclIndex(name);
- }
- else {
- // duplicate element, ignored.
- return;
- }
- }
- else {
- fCurrentElementIndex = createElementDecl();//create element decl
- }
-
- XMLElementDecl elementDecl = new XMLElementDecl();
-
- fQName.setValues(null, name, name, null);
-
- elementDecl.name.setValues(fQName);
-
- elementDecl.contentModelValidator = null;
- elementDecl.scope= -1;
- if (contentModel.equals("EMPTY")) {
- elementDecl.type = XMLElementDecl.TYPE_EMPTY;
- }
- else if (contentModel.equals("ANY")) {
- elementDecl.type = XMLElementDecl.TYPE_ANY;
- }
- else if (contentModel.startsWith("(") ) {
- if (contentModel.indexOf("#PCDATA") > 0 ) {
- elementDecl.type = XMLElementDecl.TYPE_MIXED;
- }
- else {
- elementDecl.type = XMLElementDecl.TYPE_CHILDREN;
- }
- }
-
-
- //add(or set) this elementDecl to the local cache
- this.fElementDeclTab.put(name, elementDecl );
-
- fElementDecl = elementDecl;
- addContentSpecToElement(elementDecl);
-
- if ( DEBUG ) {
- System.out.println( "name = " + fElementDecl.name.localpart );
- System.out.println( "Type = " + fElementDecl.type );
- }
-
- setElementDecl(fCurrentElementIndex, fElementDecl );//set internal structure
-
- int chunk = fCurrentElementIndex >> CHUNK_SHIFT;
- int index = fCurrentElementIndex & CHUNK_MASK;
- ensureElementDeclCapacity(chunk);
- fElementDeclIsExternal[chunk][index] = (fReadingExternalDTD || fPEDepth > 0) ? 1 : 0;
-
- } // elementDecl(String,String)
-
- /**
- * An attribute declaration.
- *
- * @param elementName The name of the element that this attribute
- * is associated with.
- * @param attributeName The name of the attribute.
- * @param type The attribute type. This value will be one of
- * the following: "CDATA", "ENTITY", "ENTITIES",
- * "ENUMERATION", "ID", "IDREF", "IDREFS",
- * "NMTOKEN", "NMTOKENS", or "NOTATION".
- * @param enumeration If the type has the value "ENUMERATION", this
- * array holds the allowed attribute values;
- * otherwise, this array is null.
- * @param defaultType The attribute default type. This value will be
- * one of the following: "#FIXED", "#IMPLIED",
- * "#REQUIRED", or null.
- * @param defaultValue The attribute default value, or null if no
- * default value is specified.
- * @param nonNormalizedDefaultValue The attribute default value with no normalization
- * performed, or null if no default value is specified.
- *
- * @param augs Additional information that may include infoset
- * augmentations.
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void attributeDecl(String elementName, String attributeName,
- String type, String[] enumeration,
- String defaultType, XMLString defaultValue,
- XMLString nonNormalizedDefaultValue, Augmentations augs) throws XNIException {
-
- if ( this.fElementDeclTab.containsKey(elementName) ) {
- //if ElementDecl has already being created in the Grammar then remove from table,
- //this.fElementDeclTab.remove( (String) elementName );
- }
- // then it is forward reference to a element decl, create the elementDecl first.
- else {
- fCurrentElementIndex = createElementDecl();//create element decl
-
- XMLElementDecl elementDecl = new XMLElementDecl();
- elementDecl.name.setValues(null, elementName, elementName, null);
-
- elementDecl.scope= -1;
-
- //add(or set) this elementDecl to the local cache
- this.fElementDeclTab.put(elementName, elementDecl );
-
- //set internal structure
- setElementDecl(fCurrentElementIndex, elementDecl );
- }
-
- //Get Grammar index to grammar array
- int elementIndex = getElementDeclIndex(elementName);
-
- //return, when more than one definition is provided for the same attribute of given element type
- //only the first declaration is binding and later declarations are ignored
- if (getAttributeDeclIndex(elementIndex, attributeName) != -1) {
- return;
- }
-
- fCurrentAttributeIndex = createAttributeDecl();// Create current Attribute Decl
-
- fSimpleType.clear();
- if ( defaultType != null ) {
- if ( defaultType.equals( "#FIXED") ) {
- fSimpleType.defaultType = XMLSimpleType.DEFAULT_TYPE_FIXED;
- } else if ( defaultType.equals( "#IMPLIED") ) {
- fSimpleType.defaultType = XMLSimpleType.DEFAULT_TYPE_IMPLIED;
- } else if ( defaultType.equals( "#REQUIRED") ) {
- fSimpleType.defaultType = XMLSimpleType.DEFAULT_TYPE_REQUIRED;
- }
- }
- if ( DEBUG ) {
- System.out.println("defaultvalue = " + defaultValue.toString() );
- }
- fSimpleType.defaultValue = defaultValue!=null ? defaultValue.toString() : null;
- fSimpleType.nonNormalizedDefaultValue = nonNormalizedDefaultValue!=null ? nonNormalizedDefaultValue.toString() : null;
- fSimpleType.enumeration = enumeration;
-
- if (type.equals("CDATA")) {
- fSimpleType.type = XMLSimpleType.TYPE_CDATA;
- }
- else if ( type.equals("ID") ) {
- fSimpleType.type = XMLSimpleType.TYPE_ID;
- }
- else if ( type.startsWith("IDREF") ) {
- fSimpleType.type = XMLSimpleType.TYPE_IDREF;
- if (type.indexOf("S") > 0) {
- fSimpleType.list = true;
- }
- }
- else if (type.equals("ENTITIES")) {
- fSimpleType.type = XMLSimpleType.TYPE_ENTITY;
- fSimpleType.list = true;
- }
- else if (type.equals("ENTITY")) {
- fSimpleType.type = XMLSimpleType.TYPE_ENTITY;
- }
- else if (type.equals("NMTOKENS")) {
- fSimpleType.type = XMLSimpleType.TYPE_NMTOKEN;
- fSimpleType.list = true;
- }
- else if (type.equals("NMTOKEN")) {
- fSimpleType.type = XMLSimpleType.TYPE_NMTOKEN;
- }
- else if (type.startsWith("NOTATION") ) {
- fSimpleType.type = XMLSimpleType.TYPE_NOTATION;
- }
- else if (type.startsWith("ENUMERATION") ) {
- fSimpleType.type = XMLSimpleType.TYPE_ENUMERATION;
- }
- else {
- // REVISIT: Report error message. -Ac
- System.err.println("!!! unknown attribute type "+type);
- }
- // REVISIT: The datatype should be stored with the attribute value
- // and not special-cased in the XMLValidator. -Ac
- //fSimpleType.datatypeValidator = fDatatypeValidatorFactory.createDatatypeValidator(type, null, facets, fSimpleType.list);
-
- fQName.setValues(null, attributeName, attributeName, null);
- fAttributeDecl.setValues( fQName, fSimpleType, false );
-
- setAttributeDecl(elementIndex, fCurrentAttributeIndex, fAttributeDecl);
-
- int chunk = fCurrentAttributeIndex >> CHUNK_SHIFT;
- int index = fCurrentAttributeIndex & CHUNK_MASK;
- ensureAttributeDeclCapacity(chunk);
- fAttributeDeclIsExternal[chunk][index] = (fReadingExternalDTD || fPEDepth > 0) ? 1 : 0;
-
- } // attributeDecl(String,String,String,String[],String,XMLString,XMLString, Augmentations)
-
- /**
- * An internal entity declaration.
- *
- * @param name The name of the entity. Parameter entity names start with
- * '%', whereas the name of a general entity is just the
- * entity name.
- * @param text The value of the entity.
- * @param nonNormalizedText The non-normalized value of the entity. This
- * value contains the same sequence of characters that was in
- * the internal entity declaration, without any entity
- * references expanded.
- * @param augs Additional information that may include infoset
- * augmentations.
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void internalEntityDecl(String name, XMLString text,
- XMLString nonNormalizedText,
- Augmentations augs) throws XNIException {
-
- int entityIndex = getEntityDeclIndex(name);
- if( entityIndex == -1){
- entityIndex = createEntityDecl();
- boolean isPE = name.startsWith("%");
- boolean inExternal = (fReadingExternalDTD || fPEDepth > 0);
- XMLEntityDecl entityDecl = new XMLEntityDecl();
- entityDecl.setValues(name,null,null, null, null,
- text.toString(), isPE, inExternal);
-
- setEntityDecl(entityIndex, entityDecl);
- }
-
- } // internalEntityDecl(String,XMLString,XMLString)
-
- /**
- * An external entity declaration.
- *
- * @param name The name of the entity. Parameter entity names start
- * with '%', whereas the name of a general entity is just
- * the entity name.
- * @param identifier An object containing all location information
- * pertinent to this external entity declaration.
- * @param augs Additional information that may include infoset
- * augmentations.
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void externalEntityDecl(String name,
- XMLResourceIdentifier identifier,
- Augmentations augs) throws XNIException {
-
- int entityIndex = getEntityDeclIndex(name);
- if( entityIndex == -1){
- entityIndex = createEntityDecl();
- boolean isPE = name.startsWith("%");
- boolean inExternal = (fReadingExternalDTD || fPEDepth > 0);
-
- XMLEntityDecl entityDecl = new XMLEntityDecl();
- entityDecl.setValues(name, identifier.getPublicId(), identifier.getLiteralSystemId(),
- identifier.getBaseSystemId(),
- null, null, isPE, inExternal);
-
- setEntityDecl(entityIndex, entityDecl);
- }
- } // externalEntityDecl(String, XMLResourceIdentifier, Augmentations)
-
- /**
- * An unparsed entity declaration.
- *
- * @param name The name of the entity.
- * @param identifier An object containing all location information
- * pertinent to this entity.
- * @param notation The name of the notation.
- * @param augs Additional information that may include infoset
- * augmentations.
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void unparsedEntityDecl(String name, XMLResourceIdentifier identifier,
- String notation,
- Augmentations augs) throws XNIException {
-
- XMLEntityDecl entityDecl = new XMLEntityDecl();
- boolean isPE = name.startsWith("%");
- boolean inExternal = (fReadingExternalDTD || fPEDepth > 0);
-
- entityDecl.setValues(name,identifier.getPublicId(),identifier.getLiteralSystemId(),
- identifier.getBaseSystemId(), notation,
- null, isPE, inExternal);
- int entityIndex = getEntityDeclIndex(name);
- if (entityIndex == -1) {
- entityIndex = createEntityDecl();
- setEntityDecl(entityIndex, entityDecl);
- }
-
- } // unparsedEntityDecl(String,StringXMLResourceIdentifier,Augmentations)
-
- /**
- * A notation declaration
- *
- * @param name The name of the notation.
- * @param identifier An object containing all location information
- * pertinent to this notation.
- * @param augs Additional information that may include infoset
- * augmentations.
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void notationDecl(String name, XMLResourceIdentifier identifier,
- Augmentations augs) throws XNIException {
-
- XMLNotationDecl notationDecl = new XMLNotationDecl();
- notationDecl.setValues(name,identifier.getPublicId(),identifier.getLiteralSystemId(),
- identifier.getBaseSystemId());
- int notationIndex = getNotationDeclIndex(name);
- if (notationIndex == -1) {
- notationIndex = createNotationDecl();
- setNotationDecl(notationIndex, notationDecl);
- }
-
- } // notationDecl(String,XMLResourceIdentifier,Augmentations)
-
- /**
- * The end of the DTD.
- *
- * @param augs Additional information that may include infoset
- * augmentations.
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endDTD(Augmentations augs) throws XNIException {
- fIsImmutable = true;
- // make sure our description contains useful stuff...
- if (fGrammarDescription.getRootName() == null) {
- // we don't know what the root is; so use possibleRoots...
- int chunk, index = 0;
- String currName = null;
- final int size = fElementDeclCount;
- ArrayList elements = new ArrayList(size);
- for (int i = 0; i < size; ++i) {
- chunk = i >> CHUNK_SHIFT;
- index = i & CHUNK_MASK;
- currName = fElementDeclName[chunk][index].rawname;
- elements.add(currName);
- }
- fGrammarDescription.setPossibleRoots(elements);
- }
- } // endDTD()
-
- // sets the source of this handler
- public void setDTDSource(XMLDTDSource source) {
- fDTDSource = source;
- } // setDTDSource(XMLDTDSource)
-
- // returns the source of this handler
- public XMLDTDSource getDTDSource() {
- return fDTDSource;
- } // getDTDSource(): XMLDTDSource
-
- // no-op methods
-
- /**
- * Notifies of the presence of a TextDecl line in an entity. If present,
- * this method will be called immediately following the startEntity call.
- * <p>
- * <strong>Note:</strong> This method is only called for external
- * parameter entities referenced in the DTD.
- *
- * @param version The XML version, or null if not specified.
- * @param encoding The IANA encoding name of the entity.
- *
- * @param augs Additional information that may include infoset
- * augmentations.
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void textDecl(String version, String encoding, Augmentations augs)
- throws XNIException {}
-
- /**
- * A comment.
- *
- * @param text The text in the comment.
- * @param augs Additional information that may include infoset
- * augmentations.
- * @throws XNIException Thrown by application to signal an error.
- */
- public void comment(XMLString text, Augmentations augs) throws XNIException {}
-
- /**
- * A processing instruction. Processing instructions consist of a
- * target name and, optionally, text data. The data is only meaningful
- * to the application.
- * <p>
- * Typically, a processing instruction's data will contain a series
- * of pseudo-attributes. These pseudo-attributes follow the form of
- * element attributes but are <strong>not</strong> parsed or presented
- * to the application as anything other than text. The application is
- * responsible for parsing the data.
- *
- * @param target The target.
- * @param data The data or null if none specified.
- * @param augs Additional information that may include infoset
- * augmentations.
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void processingInstruction(String target, XMLString data,
- Augmentations augs) throws XNIException {}
-
- /**
- * The start of an attribute list.
- *
- * @param elementName The name of the element that this attribute
- * list is associated with.
- * @param augs Additional information that may include infoset
- * augmentations.
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startAttlist(String elementName, Augmentations augs)
- throws XNIException {}
-
- /**
- * The end of an attribute list.
- * @param augs Additional information that may include infoset
- * augmentations.
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endAttlist(Augmentations augs) throws XNIException {}
-
- /**
- * The start of a conditional section.
- *
- * @param type The type of the conditional section. This value will
- * either be CONDITIONAL_INCLUDE or CONDITIONAL_IGNORE.
- * @param augs Additional information that may include infoset
- * augmentations.
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see XMLDTDHandler#CONDITIONAL_INCLUDE
- * @see XMLDTDHandler#CONDITIONAL_IGNORE
- */
- public void startConditional(short type, Augmentations augs)
- throws XNIException {}
-
- /**
- * Characters within an IGNORE conditional section.
- *
- * @param text The ignored text.
- * @param augs Additional information that may include infoset
- * augmentations.
- */
- public void ignoredCharacters(XMLString text, Augmentations augs)
- throws XNIException {}
-
- /**
- * The end of a conditional section.
- * @param augs Additional information that may include infoset
- * augmentations.
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endConditional(Augmentations augs) throws XNIException {}
-
- //
- // XMLDTDContentModelHandler methods
- //
-
- // set content model source
- public void setDTDContentModelSource(XMLDTDContentModelSource source) {
- fDTDContentModelSource = source;
- }
-
- // get content model source
- public XMLDTDContentModelSource getDTDContentModelSource() {
- return fDTDContentModelSource;
- }
-
- /**
- * The start of a content model. Depending on the type of the content
- * model, specific methods may be called between the call to the
- * startContentModel method and the call to the endContentModel method.
- *
- * @param elementName The name of the element.
- * @param augs Additional information that may include infoset
- * augmentations.
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startContentModel(String elementName, Augmentations augs)
- throws XNIException {
-
- XMLElementDecl elementDecl = this.fElementDeclTab.get(elementName);
- if ( elementDecl != null ) {
- fElementDecl = elementDecl;
- }
- fDepth = 0;
- initializeContentModelStack();
-
- } // startContentModel(String)
-
- /**
- * A start of either a mixed or children content model. A mixed
- * content model will immediately be followed by a call to the
- * <code>pcdata()</code> method. A children content model will
- * contain additional groups and/or elements.
- *
- * @param augs Additional information that may include infoset
- * augmentations.
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see #any
- * @see #empty
- */
- public void startGroup(Augmentations augs) throws XNIException {
- fDepth++;
- initializeContentModelStack();
- fMixed = false;
- } // startGroup()
-
- /**
- * The appearance of "#PCDATA" within a group signifying a
- * mixed content model. This method will be the first called
- * following the content model's <code>startGroup()</code>.
- *
- *@param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see #startGroup
- */
- public void pcdata(Augmentations augs) throws XNIException {
- fMixed = true;
- } // pcdata()
-
- /**
- * A referenced element in a mixed or children content model.
- *
- * @param elementName The name of the referenced element.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void element(String elementName, Augmentations augs) throws XNIException {
- if (fMixed) {
- if (fNodeIndexStack[fDepth] == -1 ) {
- fNodeIndexStack[fDepth] = addUniqueLeafNode(elementName);
- }
- else {
- fNodeIndexStack[fDepth] = addContentSpecNode(XMLContentSpec.CONTENTSPECNODE_CHOICE,
- fNodeIndexStack[fDepth],
- addUniqueLeafNode(elementName));
- }
- }
- else {
- fNodeIndexStack[fDepth] = addContentSpecNode(XMLContentSpec.CONTENTSPECNODE_LEAF, elementName);
- }
- } // element(String)
-
- /**
- * The separator between choices or sequences of a mixed or children
- * content model.
- *
- * @param separator The type of children separator.
- * @param augs Additional information that may include infoset
- * augmentations.
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see org.apache.xerces.xni.XMLDTDContentModelHandler#SEPARATOR_CHOICE
- * @see org.apache.xerces.xni.XMLDTDContentModelHandler#SEPARATOR_SEQUENCE
- */
- public void separator(short separator, Augmentations augs) throws XNIException {
-
- if (!fMixed) {
- if (fOpStack[fDepth] != XMLContentSpec.CONTENTSPECNODE_SEQ && separator == XMLDTDContentModelHandler.SEPARATOR_CHOICE ) {
- if (fPrevNodeIndexStack[fDepth] != -1) {
- fNodeIndexStack[fDepth] = addContentSpecNode(fOpStack[fDepth], fPrevNodeIndexStack[fDepth], fNodeIndexStack[fDepth]);
- }
- fPrevNodeIndexStack[fDepth] = fNodeIndexStack[fDepth];
- fOpStack[fDepth] = XMLContentSpec.CONTENTSPECNODE_CHOICE;
- } else if (fOpStack[fDepth] != XMLContentSpec.CONTENTSPECNODE_CHOICE && separator == XMLDTDContentModelHandler.SEPARATOR_SEQUENCE) {
- if (fPrevNodeIndexStack[fDepth] != -1) {
- fNodeIndexStack[fDepth] = addContentSpecNode(fOpStack[fDepth], fPrevNodeIndexStack[fDepth], fNodeIndexStack[fDepth]);
- }
- fPrevNodeIndexStack[fDepth] = fNodeIndexStack[fDepth];
- fOpStack[fDepth] = XMLContentSpec.CONTENTSPECNODE_SEQ;
- }
- }
-
- } // separator(short)
-
- /**
- * The occurrence count for a child in a children content model or
- * for the mixed content model group.
- *
- * @param occurrence The occurrence count for the last element
- * or group.
- * @param augs Additional information that may include infoset
- * augmentations.
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see org.apache.xerces.xni.XMLDTDContentModelHandler#OCCURS_ZERO_OR_ONE
- * @see org.apache.xerces.xni.XMLDTDContentModelHandler#OCCURS_ZERO_OR_MORE
- * @see org.apache.xerces.xni.XMLDTDContentModelHandler#OCCURS_ONE_OR_MORE
- */
- public void occurrence(short occurrence, Augmentations augs) throws XNIException {
-
- if (!fMixed) {
- if (occurrence == XMLDTDContentModelHandler.OCCURS_ZERO_OR_ONE ) {
- fNodeIndexStack[fDepth] = addContentSpecNode(XMLContentSpec.CONTENTSPECNODE_ZERO_OR_ONE, fNodeIndexStack[fDepth], -1);
- } else if ( occurrence == XMLDTDContentModelHandler.OCCURS_ZERO_OR_MORE ) {
- fNodeIndexStack[fDepth] = addContentSpecNode(XMLContentSpec.CONTENTSPECNODE_ZERO_OR_MORE, fNodeIndexStack[fDepth], -1 );
- } else if ( occurrence == XMLDTDContentModelHandler.OCCURS_ONE_OR_MORE) {
- fNodeIndexStack[fDepth] = addContentSpecNode(XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE, fNodeIndexStack[fDepth], -1 );
- }
- }
-
- } // occurrence(short)
-
- /**
- * The end of a group for mixed or children content models.
- *
- * @param augs Additional information that may include infoset
- * augmentations.
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endGroup(Augmentations augs) throws XNIException {
-
- if (!fMixed) {
- if (fPrevNodeIndexStack[fDepth] != -1) {
- fNodeIndexStack[fDepth] = addContentSpecNode(fOpStack[fDepth], fPrevNodeIndexStack[fDepth], fNodeIndexStack[fDepth]);
- }
- int nodeIndex = fNodeIndexStack[fDepth--];
- fNodeIndexStack[fDepth] = nodeIndex;
- }
-
- } // endGroup()
-
- // no-op methods
-
- /**
- * A content model of ANY.
- *
- * @param augs Additional information that may include infoset
- * augmentations.
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see #empty
- * @see #startGroup
- */
- public void any(Augmentations augs) throws XNIException {}
-
- /**
- * A content model of EMPTY.
- *
- * @param augs Additional information that may include infoset
- * augmentations.
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see #any
- * @see #startGroup
- */
- public void empty(Augmentations augs) throws XNIException {}
-
- /**
- * The end of a content model.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endContentModel(Augmentations augs) throws XNIException {}
-
- //
- // Grammar methods
- //
-
- /** Returns true if this grammar is namespace aware. */
- public boolean isNamespaceAware() {
- return false;
- } // isNamespaceAware():boolean
-
- /** Returns the symbol table. */
- public SymbolTable getSymbolTable() {
- return fSymbolTable;
- } // getSymbolTable():SymbolTable
-
- /**
- * Returns the index of the first element declaration. This index
- * is then used to query more information about the element declaration.
- *
- * @see #getNextElementDeclIndex
- * @see #getElementDecl
- */
- public int getFirstElementDeclIndex() {
- return fElementDeclCount >= 0 ? 0 : -1;
- } // getFirstElementDeclIndex():int
-
- /**
- * Returns the next index of the element declaration following the
- * specified element declaration.
- *
- * @param elementDeclIndex The element declaration index.
- */
- public int getNextElementDeclIndex(int elementDeclIndex) {
- return elementDeclIndex < fElementDeclCount - 1
- ? elementDeclIndex + 1 : -1;
- } // getNextElementDeclIndex(int):int
-
- /**
- * getElementDeclIndex
- *
- * @param elementDeclName
- *
- * @return index of the elementDeclName in scope
- */
- public int getElementDeclIndex(String elementDeclName) {
- Integer mapping = fElementIndexMap.get(elementDeclName);
- if (mapping == null) {
- mapping = -1;
- }
- //System.out.println("getElementDeclIndex("+elementDeclName+") -> "+mapping);
- return mapping;
- } // getElementDeclIndex(String):int
-
- /** Returns the element decl index.
- * @param elementDeclQName qualilfied name of the element
- */
- public int getElementDeclIndex(QName elementDeclQName) {
- return getElementDeclIndex(elementDeclQName.rawname);
- } // getElementDeclIndex(QName):int
-
- /** make separate function for getting contentSpecType of element.
- * we can avoid setting of the element values.
- */
-
- public short getContentSpecType(int elementIndex){
- if (elementIndex < 0 || elementIndex >= fElementDeclCount) {
- return -1 ;
- }
-
- int chunk = elementIndex >> CHUNK_SHIFT;
- int index = elementIndex & CHUNK_MASK;
-
- if(fElementDeclType[chunk][index] == -1){
- return -1 ;
- }
- else{
- return (short) (fElementDeclType[chunk][index] & LIST_MASK);
- }
-
- }//getContentSpecType
-
- /**
- * getElementDecl
- *
- * @param elementDeclIndex
- * @param elementDecl The values of this structure are set by this call.
- *
- * @return True if find the element, False otherwise.
- */
- public boolean getElementDecl(int elementDeclIndex,
- XMLElementDecl elementDecl) {
-
- if (elementDeclIndex < 0 || elementDeclIndex >= fElementDeclCount) {
- return false;
- }
-
- int chunk = elementDeclIndex >> CHUNK_SHIFT;
- int index = elementDeclIndex & CHUNK_MASK;
-
- elementDecl.name.setValues(fElementDeclName[chunk][index]);
-
- if (fElementDeclType[chunk][index] == -1) {
- elementDecl.type = -1;
- elementDecl.simpleType.list = false;
- } else {
- elementDecl.type = (short) (fElementDeclType[chunk][index] & LIST_MASK);
- elementDecl.simpleType.list = (fElementDeclType[chunk][index] & LIST_FLAG) != 0;
- }
-
- /* Validators are null until we add that code */
- if (elementDecl.type == XMLElementDecl.TYPE_CHILDREN || elementDecl.type == XMLElementDecl.TYPE_MIXED) {
- elementDecl.contentModelValidator = getElementContentModelValidator(elementDeclIndex);
- }
-
- elementDecl.simpleType.datatypeValidator = null;
- elementDecl.simpleType.defaultType = -1;
- elementDecl.simpleType.defaultValue = null;
-
- return true;
-
- } // getElementDecl(int,XMLElementDecl):boolean
-
- QName getElementDeclName(int elementDeclIndex) {
- if (elementDeclIndex < 0 || elementDeclIndex >= fElementDeclCount) {
- return null;
- }
- int chunk = elementDeclIndex >> CHUNK_SHIFT;
- int index = elementDeclIndex & CHUNK_MASK;
- return fElementDeclName[chunk][index];
- }
-
- // REVISIT: Make this getAttributeDeclCount/getAttributeDeclAt. -Ac
-
- /**
- * getFirstAttributeDeclIndex
- *
- * @param elementDeclIndex
- *
- * @return index of the first attribute for element declaration elementDeclIndex
- */
- public int getFirstAttributeDeclIndex(int elementDeclIndex) {
- int chunk = elementDeclIndex >> CHUNK_SHIFT;
- int index = elementDeclIndex & CHUNK_MASK;
-
- return fElementDeclFirstAttributeDeclIndex[chunk][index];
- } // getFirstAttributeDeclIndex
-
- /**
- * getNextAttributeDeclIndex
- *
- * @param attributeDeclIndex
- *
- * @return index of the next attribute of the attribute at attributeDeclIndex
- */
- public int getNextAttributeDeclIndex(int attributeDeclIndex) {
- int chunk = attributeDeclIndex >> CHUNK_SHIFT;
- int index = attributeDeclIndex & CHUNK_MASK;
-
- return fAttributeDeclNextAttributeDeclIndex[chunk][index];
- } // getNextAttributeDeclIndex
-
- /**
- * getAttributeDecl
- *
- * @param attributeDeclIndex
- * @param attributeDecl The values of this structure are set by this call.
- *
- * @return true if getAttributeDecl was able to fill in the value of attributeDecl
- */
- public boolean getAttributeDecl(int attributeDeclIndex, XMLAttributeDecl attributeDecl) {
- if (attributeDeclIndex < 0 || attributeDeclIndex >= fAttributeDeclCount) {
- return false;
- }
- int chunk = attributeDeclIndex >> CHUNK_SHIFT;
- int index = attributeDeclIndex & CHUNK_MASK;
-
- attributeDecl.name.setValues(fAttributeDeclName[chunk][index]);
-
- short attributeType;
- boolean isList;
-
- if (fAttributeDeclType[chunk][index] == -1) {
-
- attributeType = -1;
- isList = false;
- } else {
- attributeType = (short) (fAttributeDeclType[chunk][index] & LIST_MASK);
- isList = (fAttributeDeclType[chunk][index] & LIST_FLAG) != 0;
- }
- attributeDecl.simpleType.setValues(attributeType,fAttributeDeclName[chunk][index].localpart,
- fAttributeDeclEnumeration[chunk][index],
- isList, fAttributeDeclDefaultType[chunk][index],
- fAttributeDeclDefaultValue[chunk][index],
- fAttributeDeclNonNormalizedDefaultValue[chunk][index],
- fAttributeDeclDatatypeValidator[chunk][index]);
- return true;
-
- } // getAttributeDecl
-
-
- /**
- * Returns whether the given attribute is of type CDATA or not
- *
- * @param elName The element name.
- * @param atName The attribute name.
- *
- * @return true if the attribute is of type CDATA
- */
- public boolean isCDATAAttribute(QName elName, QName atName) {
- int elDeclIdx = getElementDeclIndex(elName);
- if (getAttributeDecl(elDeclIdx, fAttributeDecl)
- && fAttributeDecl.simpleType.type != XMLSimpleType.TYPE_CDATA){
- return false;
- }
- return true;
- }
-
- /**
- * getEntityDeclIndex
- *
- * @param entityDeclName
- *
- * @return the index of the EntityDecl
- */
- public int getEntityDeclIndex(String entityDeclName) {
- if (entityDeclName == null || fEntityIndexMap.get(entityDeclName) == null) {
- return -1;
- }
-
- return fEntityIndexMap.get(entityDeclName);
- } // getEntityDeclIndex
-
- /**
- * getEntityDecl
- *
- * @param entityDeclIndex
- * @param entityDecl
- *
- * @return true if getEntityDecl was able to fill entityDecl with the contents of the entity
- * with index entityDeclIndex
- */
- public boolean getEntityDecl(int entityDeclIndex, XMLEntityDecl entityDecl) {
- if (entityDeclIndex < 0 || entityDeclIndex >= fEntityCount) {
- return false;
- }
- int chunk = entityDeclIndex >> CHUNK_SHIFT;
- int index = entityDeclIndex & CHUNK_MASK;
-
- entityDecl.setValues(fEntityName[chunk][index],
- fEntityPublicId[chunk][index],
- fEntitySystemId[chunk][index],
- fEntityBaseSystemId[chunk][index],
- fEntityNotation[chunk][index],
- fEntityValue[chunk][index],
- fEntityIsPE[chunk][index] == 0 ? false : true ,
- fEntityInExternal[chunk][index] == 0 ? false : true );
-
- return true;
- } // getEntityDecl
-
- /**
- * getNotationDeclIndex
- *
- * @param notationDeclName
- *
- * @return the index if found a notation with the name, otherwise -1.
- */
- public int getNotationDeclIndex(String notationDeclName) {
- if (notationDeclName == null || fNotationIndexMap.get(notationDeclName) == null) {
- return -1;
- }
-
- return fNotationIndexMap.get(notationDeclName);
- } // getNotationDeclIndex
-
- /**
- * getNotationDecl
- *
- * @param notationDeclIndex
- * @param notationDecl
- *
- * @return return true of getNotationDecl can fill notationDecl with information about
- * the notation at notationDeclIndex.
- */
- public boolean getNotationDecl(int notationDeclIndex, XMLNotationDecl notationDecl) {
- if (notationDeclIndex < 0 || notationDeclIndex >= fNotationCount) {
- return false;
- }
- int chunk = notationDeclIndex >> CHUNK_SHIFT;
- int index = notationDeclIndex & CHUNK_MASK;
-
- notationDecl.setValues(fNotationName[chunk][index],
- fNotationPublicId[chunk][index],
- fNotationSystemId[chunk][index],
- fNotationBaseSystemId[chunk][index]);
-
- return true;
-
- } // getNotationDecl
-
- /**
- * getContentSpec
- *
- * @param contentSpecIndex
- * @param contentSpec
- *
- * @return true if find the requested contentSpec node, false otherwise
- */
- public boolean getContentSpec(int contentSpecIndex, XMLContentSpec contentSpec) {
- if (contentSpecIndex < 0 || contentSpecIndex >= fContentSpecCount )
- return false;
-
- int chunk = contentSpecIndex >> CHUNK_SHIFT;
- int index = contentSpecIndex & CHUNK_MASK;
-
- contentSpec.type = fContentSpecType[chunk][index];
- contentSpec.value = fContentSpecValue[chunk][index];
- contentSpec.otherValue = fContentSpecOtherValue[chunk][index];
- return true;
- }
-
- /**
- * Returns the index to the content spec for the given element
- * declaration, or <code>-1</code> if the element declaration
- * index was invalid.
- */
- public int getContentSpecIndex(int elementDeclIndex) {
- if (elementDeclIndex < 0 || elementDeclIndex >= fElementDeclCount) {
- return -1;
- }
- final int chunk = elementDeclIndex >> CHUNK_SHIFT;
- final int index = elementDeclIndex & CHUNK_MASK;
- return fElementDeclContentSpecIndex[chunk][index];
- }
-
- /**
- * getContentSpecAsString
- *
- * @param elementDeclIndex
- *
- * @return String
- */
- public String getContentSpecAsString(int elementDeclIndex){
-
- if (elementDeclIndex < 0 || elementDeclIndex >= fElementDeclCount) {
- return null;
- }
-
- int chunk = elementDeclIndex >> CHUNK_SHIFT;
- int index = elementDeclIndex & CHUNK_MASK;
-
- int contentSpecIndex = fElementDeclContentSpecIndex[chunk][index];
-
- // lookup content spec node
- XMLContentSpec contentSpec = new XMLContentSpec();
-
- if (getContentSpec(contentSpecIndex, contentSpec)) {
-
- // build string
- StringBuffer str = new StringBuffer();
- int parentContentSpecType = contentSpec.type & 0x0f;
- int nextContentSpec;
- switch (parentContentSpecType) {
- case XMLContentSpec.CONTENTSPECNODE_LEAF: {
- str.append('(');
- if (contentSpec.value == null && contentSpec.otherValue == null) {
- str.append("#PCDATA");
- }
- else {
- str.append(contentSpec.value);
- }
- str.append(')');
- break;
- }
- case XMLContentSpec.CONTENTSPECNODE_ZERO_OR_ONE: {
- getContentSpec(((int[])contentSpec.value)[0], contentSpec);
- nextContentSpec = contentSpec.type;
-
- if (nextContentSpec == XMLContentSpec.CONTENTSPECNODE_LEAF) {
- str.append('(');
- str.append(contentSpec.value);
- str.append(')');
- } else if( nextContentSpec == XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE ||
- nextContentSpec == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_MORE ||
- nextContentSpec == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_ONE ) {
- str.append('(' );
- appendContentSpec(contentSpec, str,
- true, parentContentSpecType );
- str.append(')');
- } else {
- appendContentSpec(contentSpec, str,
- true, parentContentSpecType );
- }
- str.append('?');
- break;
- }
- case XMLContentSpec.CONTENTSPECNODE_ZERO_OR_MORE: {
- getContentSpec(((int[])contentSpec.value)[0], contentSpec);
- nextContentSpec = contentSpec.type;
-
- if ( nextContentSpec == XMLContentSpec.CONTENTSPECNODE_LEAF) {
- str.append('(');
- if (contentSpec.value == null && contentSpec.otherValue == null) {
- str.append("#PCDATA");
- }
- else if (contentSpec.otherValue != null) {
- str.append("##any:uri=").append(contentSpec.otherValue);
- }
- else if (contentSpec.value == null) {
- str.append("##any");
- }
- else {
- appendContentSpec(contentSpec, str,
- true, parentContentSpecType );
- }
- str.append(')');
- } else if( nextContentSpec == XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE ||
- nextContentSpec == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_MORE ||
- nextContentSpec == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_ONE ) {
- str.append('(' );
- appendContentSpec(contentSpec, str,
- true, parentContentSpecType );
- str.append(')');
- } else {
- appendContentSpec(contentSpec, str,
- true, parentContentSpecType );
- }
- str.append('*');
- break;
- }
- case XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE: {
- getContentSpec(((int[])contentSpec.value)[0], contentSpec);
- nextContentSpec = contentSpec.type;
-
- if ( nextContentSpec == XMLContentSpec.CONTENTSPECNODE_LEAF) {
- str.append('(');
- if (contentSpec.value == null && contentSpec.otherValue == null) {
- str.append("#PCDATA");
- }
- else if (contentSpec.otherValue != null) {
- str.append("##any:uri=").append(contentSpec.otherValue);
- }
- else if (contentSpec.value == null) {
- str.append("##any");
- }
- else {
- str.append(contentSpec.value);
- }
- str.append(')');
- } else if( nextContentSpec == XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE ||
- nextContentSpec == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_MORE ||
- nextContentSpec == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_ONE ) {
- str.append('(' );
- appendContentSpec(contentSpec, str,
- true, parentContentSpecType );
- str.append(')');
- } else {
- appendContentSpec(contentSpec, str,
- true, parentContentSpecType);
- }
- str.append('+');
- break;
- }
- case XMLContentSpec.CONTENTSPECNODE_CHOICE:
- case XMLContentSpec.CONTENTSPECNODE_SEQ: {
- appendContentSpec(contentSpec, str,
- true, parentContentSpecType );
- break;
- }
- case XMLContentSpec.CONTENTSPECNODE_ANY: {
- str.append("##any");
- if (contentSpec.otherValue != null) {
- str.append(":uri=");
- str.append(contentSpec.otherValue);
- }
- break;
- }
- case XMLContentSpec.CONTENTSPECNODE_ANY_OTHER: {
- str.append("##other:uri=");
- str.append(contentSpec.otherValue);
- break;
- }
- case XMLContentSpec.CONTENTSPECNODE_ANY_LOCAL: {
- str.append("##local");
- break;
- }
- default: {
- str.append("???");
- }
-
- } // switch type
-
- // return string
- return str.toString();
- }
-
- // not found
- return null;
-
- } // getContentSpecAsString(int):String
-
- // debugging
-
- public void printElements( ) {
- int elementDeclIndex = 0;
- XMLElementDecl elementDecl = new XMLElementDecl();
- while (getElementDecl(elementDeclIndex++, elementDecl)) {
-
- System.out.println("element decl: "+elementDecl.name+
- ", "+ elementDecl.name.rawname );
-
- // ", "+ elementDecl.contentModelValidator.toString());
- }
- }
-
- public void printAttributes(int elementDeclIndex) {
- int attributeDeclIndex = getFirstAttributeDeclIndex(elementDeclIndex);
- System.out.print(elementDeclIndex);
- System.out.print(" [");
- while (attributeDeclIndex != -1) {
- System.out.print(' ');
- System.out.print(attributeDeclIndex);
- printAttribute(attributeDeclIndex);
- attributeDeclIndex = getNextAttributeDeclIndex(attributeDeclIndex);
- if (attributeDeclIndex != -1) {
- System.out.print(",");
- }
- }
- System.out.println(" ]");
- }
-
- //
- // Protected methods
- //
-
- /**
- * Adds the content spec to the given element declaration.
- */
- protected void addContentSpecToElement(XMLElementDecl elementDecl) {
- if ((fDepth == 0 || (fDepth == 1 && elementDecl.type == XMLElementDecl.TYPE_MIXED)) &&
- fNodeIndexStack != null) {
- if (elementDecl.type == XMLElementDecl.TYPE_MIXED) {
- int pcdata = addUniqueLeafNode(null);
- if (fNodeIndexStack[0] == -1) {
- fNodeIndexStack[0] = pcdata;
- }
- else {
- fNodeIndexStack[0] = addContentSpecNode(XMLContentSpec.CONTENTSPECNODE_CHOICE,
- pcdata, fNodeIndexStack[0]);
- }
- }
- setContentSpecIndex(fCurrentElementIndex, fNodeIndexStack[fDepth]);
- }
- }
-
- /**
- * getElementContentModelValidator
- *
- * @param elementDeclIndex
- *
- * @return its ContentModelValidator if any.
- */
- protected ContentModelValidator getElementContentModelValidator(int elementDeclIndex) {
-
- int chunk = elementDeclIndex >> CHUNK_SHIFT;
- int index = elementDeclIndex & CHUNK_MASK;
-
- ContentModelValidator contentModel = fElementDeclContentModelValidator[chunk][index];
-
- // If we have one, just return that. Otherwise, gotta create one
- if (contentModel != null) {
- return contentModel;
- }
-
- int contentType = fElementDeclType[chunk][index];
- if (contentType == XMLElementDecl.TYPE_SIMPLE) {
- return null;
- }
-
- // Get the type of content this element has
- int contentSpecIndex = fElementDeclContentSpecIndex[chunk][index];
-
- /***
- if ( contentSpecIndex == -1 )
- return null;
- /***/
-
- XMLContentSpec contentSpec = new XMLContentSpec();
- getContentSpec( contentSpecIndex, contentSpec );
-
- // And create the content model according to the spec type
- if ( contentType == XMLElementDecl.TYPE_MIXED ) {
- //
- // Just create a mixel content model object. This type of
- // content model is optimized for mixed content validation.
- //
- ChildrenList children = new ChildrenList();
- contentSpecTree(contentSpecIndex, contentSpec, children);
- contentModel = new MixedContentModel(children.qname,
- children.type,
- 0, children.length,
- false);
- } else if (contentType == XMLElementDecl.TYPE_CHILDREN) {
- // This method will create an optimal model for the complexity
- // of the element's defined model. If its simple, it will create
- // a SimpleContentModel object. If its a simple list, it will
- // create a SimpleListContentModel object. If its complex, it
- // will create a DFAContentModel object.
- //
- contentModel = createChildModel(contentSpecIndex);
- } else {
- throw new RuntimeException("Unknown content type for a element decl "
- + "in getElementContentModelValidator() in AbstractDTDGrammar class");
- }
-
- // Add the new model to the content model for this element
- fElementDeclContentModelValidator[chunk][index] = contentModel;
-
- return contentModel;
-
- } // getElementContentModelValidator(int):ContentModelValidator
-
- protected int createElementDecl() {
- int chunk = fElementDeclCount >> CHUNK_SHIFT;
- int index = fElementDeclCount & CHUNK_MASK;
- ensureElementDeclCapacity(chunk);
- fElementDeclName[chunk][index] = new QName();
- fElementDeclType[chunk][index] = -1;
- fElementDeclContentModelValidator[chunk][index] = null;
- fElementDeclFirstAttributeDeclIndex[chunk][index] = -1;
- fElementDeclLastAttributeDeclIndex[chunk][index] = -1;
- return fElementDeclCount++;
- }
-
- protected void setElementDecl(int elementDeclIndex, XMLElementDecl elementDecl) {
- if (elementDeclIndex < 0 || elementDeclIndex >= fElementDeclCount) {
- return;
- }
- int chunk = elementDeclIndex >> CHUNK_SHIFT;
- int index = elementDeclIndex & CHUNK_MASK;
-
- fElementDeclName[chunk][index].setValues(elementDecl.name);
- fElementDeclType[chunk][index] = elementDecl.type;
-
- fElementDeclContentModelValidator[chunk][index] = elementDecl.contentModelValidator;
-
- if (elementDecl.simpleType.list == true ) {
- fElementDeclType[chunk][index] |= LIST_FLAG;
- }
-
- fElementIndexMap.put(elementDecl.name.rawname, elementDeclIndex);
- }
-
-
-
-
- protected void putElementNameMapping(QName name, int scope,
- int elementDeclIndex) {
- }
-
- protected void setFirstAttributeDeclIndex(int elementDeclIndex, int newFirstAttrIndex){
-
- if (elementDeclIndex < 0 || elementDeclIndex >= fElementDeclCount) {
- return;
- }
-
- int chunk = elementDeclIndex >> CHUNK_SHIFT;
- int index = elementDeclIndex & CHUNK_MASK;
-
- fElementDeclFirstAttributeDeclIndex[chunk][index] = newFirstAttrIndex;
- }
-
- protected void setContentSpecIndex(int elementDeclIndex, int contentSpecIndex){
-
- if (elementDeclIndex < 0 || elementDeclIndex >= fElementDeclCount) {
- return;
- }
-
- int chunk = elementDeclIndex >> CHUNK_SHIFT;
- int index = elementDeclIndex & CHUNK_MASK;
-
- fElementDeclContentSpecIndex[chunk][index] = contentSpecIndex;
- }
-
-
- protected int createAttributeDecl() {
- int chunk = fAttributeDeclCount >> CHUNK_SHIFT;
- int index = fAttributeDeclCount & CHUNK_MASK;
-
- ensureAttributeDeclCapacity(chunk);
- fAttributeDeclName[chunk][index] = new QName();
- fAttributeDeclType[chunk][index] = -1;
- fAttributeDeclDatatypeValidator[chunk][index] = null;
- fAttributeDeclEnumeration[chunk][index] = null;
- fAttributeDeclDefaultType[chunk][index] = XMLSimpleType.DEFAULT_TYPE_IMPLIED;
- fAttributeDeclDefaultValue[chunk][index] = null;
- fAttributeDeclNonNormalizedDefaultValue[chunk][index] = null;
- fAttributeDeclNextAttributeDeclIndex[chunk][index] = -1;
- return fAttributeDeclCount++;
- }
-
-
- protected void setAttributeDecl(int elementDeclIndex, int attributeDeclIndex,
- XMLAttributeDecl attributeDecl) {
- int attrChunk = attributeDeclIndex >> CHUNK_SHIFT;
- int attrIndex = attributeDeclIndex & CHUNK_MASK;
- fAttributeDeclName[attrChunk][attrIndex].setValues(attributeDecl.name);
- fAttributeDeclType[attrChunk][attrIndex] = attributeDecl.simpleType.type;
-
- if (attributeDecl.simpleType.list) {
- fAttributeDeclType[attrChunk][attrIndex] |= LIST_FLAG;
- }
- fAttributeDeclEnumeration[attrChunk][attrIndex] = attributeDecl.simpleType.enumeration;
- fAttributeDeclDefaultType[attrChunk][attrIndex] = attributeDecl.simpleType.defaultType;
- fAttributeDeclDatatypeValidator[attrChunk][attrIndex] = attributeDecl.simpleType.datatypeValidator;
-
- fAttributeDeclDefaultValue[attrChunk][attrIndex] = attributeDecl.simpleType.defaultValue;
- fAttributeDeclNonNormalizedDefaultValue[attrChunk][attrIndex] = attributeDecl.simpleType.nonNormalizedDefaultValue;
-
- int elemChunk = elementDeclIndex >> CHUNK_SHIFT;
- int elemIndex = elementDeclIndex & CHUNK_MASK;
- int index = fElementDeclFirstAttributeDeclIndex[elemChunk][elemIndex];
- while (index != -1) {
- if (index == attributeDeclIndex) {
- break;
- }
- attrChunk = index >> CHUNK_SHIFT;
- attrIndex = index & CHUNK_MASK;
- index = fAttributeDeclNextAttributeDeclIndex[attrChunk][attrIndex];
- }
- if (index == -1) {
- if (fElementDeclFirstAttributeDeclIndex[elemChunk][elemIndex] == -1) {
- fElementDeclFirstAttributeDeclIndex[elemChunk][elemIndex] = attributeDeclIndex;
- } else {
- index = fElementDeclLastAttributeDeclIndex[elemChunk][elemIndex];
- attrChunk = index >> CHUNK_SHIFT;
- attrIndex = index & CHUNK_MASK;
- fAttributeDeclNextAttributeDeclIndex[attrChunk][attrIndex] = attributeDeclIndex;
- }
- fElementDeclLastAttributeDeclIndex[elemChunk][elemIndex] = attributeDeclIndex;
- }
- }
-
- protected int createContentSpec() {
- int chunk = fContentSpecCount >> CHUNK_SHIFT;
- int index = fContentSpecCount & CHUNK_MASK;
-
- ensureContentSpecCapacity(chunk);
- fContentSpecType[chunk][index] = -1;
- fContentSpecValue[chunk][index] = null;
- fContentSpecOtherValue[chunk][index] = null;
-
- return fContentSpecCount++;
- }
-
- protected void setContentSpec(int contentSpecIndex, XMLContentSpec contentSpec) {
- int chunk = contentSpecIndex >> CHUNK_SHIFT;
- int index = contentSpecIndex & CHUNK_MASK;
-
- fContentSpecType[chunk][index] = contentSpec.type;
- fContentSpecValue[chunk][index] = contentSpec.value;
- fContentSpecOtherValue[chunk][index] = contentSpec.otherValue;
- }
-
-
- protected int createEntityDecl() {
- int chunk = fEntityCount >> CHUNK_SHIFT;
- int index = fEntityCount & CHUNK_MASK;
-
- ensureEntityDeclCapacity(chunk);
- fEntityIsPE[chunk][index] = 0;
- fEntityInExternal[chunk][index] = 0;
-
- return fEntityCount++;
- }
-
- protected void setEntityDecl(int entityDeclIndex, XMLEntityDecl entityDecl) {
- int chunk = entityDeclIndex >> CHUNK_SHIFT;
- int index = entityDeclIndex & CHUNK_MASK;
-
- fEntityName[chunk][index] = entityDecl.name;
- fEntityValue[chunk][index] = entityDecl.value;
- fEntityPublicId[chunk][index] = entityDecl.publicId;
- fEntitySystemId[chunk][index] = entityDecl.systemId;
- fEntityBaseSystemId[chunk][index] = entityDecl.baseSystemId;
- fEntityNotation[chunk][index] = entityDecl.notation;
- fEntityIsPE[chunk][index] = entityDecl.isPE ? (byte)1 : (byte)0;
- fEntityInExternal[chunk][index] = entityDecl.inExternal ? (byte)1 : (byte)0;
-
- fEntityIndexMap.put(entityDecl.name, entityDeclIndex);
- }
-
- protected int createNotationDecl() {
- int chunk = fNotationCount >> CHUNK_SHIFT;
- ensureNotationDeclCapacity(chunk);
- return fNotationCount++;
- }
-
- protected void setNotationDecl(int notationDeclIndex, XMLNotationDecl notationDecl) {
- int chunk = notationDeclIndex >> CHUNK_SHIFT;
- int index = notationDeclIndex & CHUNK_MASK;
-
- fNotationName[chunk][index] = notationDecl.name;
- fNotationPublicId[chunk][index] = notationDecl.publicId;
- fNotationSystemId[chunk][index] = notationDecl.systemId;
- fNotationBaseSystemId[chunk][index] = notationDecl.baseSystemId;
-
- fNotationIndexMap.put(notationDecl.name, notationDeclIndex);
- }
-
- /**
- * Create an XMLContentSpec for a single non-leaf
- *
- * @param nodeType the type of XMLContentSpec to create - from XMLContentSpec.CONTENTSPECNODE_*
- * @param nodeValue handle to an XMLContentSpec
- * @return handle to the newly create XMLContentSpec
- */
- protected int addContentSpecNode(short nodeType, String nodeValue) {
-
- // create content spec node
- int contentSpecIndex = createContentSpec();
-
- // set content spec node values
- fContentSpec.setValues(nodeType, nodeValue, null);
- setContentSpec(contentSpecIndex, fContentSpec);
-
- // return index
- return contentSpecIndex;
-
- } // addContentSpecNode(short,String):int
-
- /**
- * create an XMLContentSpec for a leaf
- *
- * @param elementName the name (Element) for the node
- * @return handle to the newly create XMLContentSpec
- */
- protected int addUniqueLeafNode(String elementName) {
-
- // create content spec node
- int contentSpecIndex = createContentSpec();
-
- // set content spec node values
- fContentSpec.setValues( XMLContentSpec.CONTENTSPECNODE_LEAF,
- elementName, null);
- setContentSpec(contentSpecIndex, fContentSpec);
-
- // return index
- return contentSpecIndex;
-
- } // addUniqueLeafNode(String):int
-
- /**
- * Create an XMLContentSpec for a two child leaf
- *
- * @param nodeType the type of XMLContentSpec to create - from XMLContentSpec.CONTENTSPECNODE_*
- * @param leftNodeIndex handle to an XMLContentSpec
- * @param rightNodeIndex handle to an XMLContentSpec
- * @return handle to the newly create XMLContentSpec
- */
- protected int addContentSpecNode(short nodeType,
- int leftNodeIndex, int rightNodeIndex) {
-
- // create content spec node
- int contentSpecIndex = createContentSpec();
-
- // set content spec node values
- int[] leftIntArray = new int[1];
- int[] rightIntArray = new int[1];
-
- leftIntArray[0] = leftNodeIndex;
- rightIntArray[0] = rightNodeIndex;
- fContentSpec.setValues(nodeType, leftIntArray, rightIntArray);
- setContentSpec(contentSpecIndex, fContentSpec);
-
- // return index
- return contentSpecIndex;
-
- } // addContentSpecNode(short,int,int):int
-
- /** Initialize content model stack. */
- protected void initializeContentModelStack() {
-
- if (fOpStack == null) {
- fOpStack = new short[8];
- fNodeIndexStack = new int[8];
- fPrevNodeIndexStack = new int[8];
- } else if (fDepth == fOpStack.length) {
- short[] newStack = new short[fDepth * 2];
- System.arraycopy(fOpStack, 0, newStack, 0, fDepth);
- fOpStack = newStack;
- int[] newIntStack = new int[fDepth * 2];
- System.arraycopy(fNodeIndexStack, 0, newIntStack, 0, fDepth);
- fNodeIndexStack = newIntStack;
- newIntStack = new int[fDepth * 2];
- System.arraycopy(fPrevNodeIndexStack, 0, newIntStack, 0, fDepth);
- fPrevNodeIndexStack = newIntStack;
- }
- fOpStack[fDepth] = -1;
- fNodeIndexStack[fDepth] = -1;
- fPrevNodeIndexStack[fDepth] = -1;
-
- } // initializeContentModelStack()
-
- boolean isImmutable() {
- return fIsImmutable;
- }
-
- //
- // Private methods
- //
-
- private void appendContentSpec(XMLContentSpec contentSpec,
- StringBuffer str, boolean parens,
- int parentContentSpecType ) {
-
- int thisContentSpec = contentSpec.type & 0x0f;
- switch (thisContentSpec) {
- case XMLContentSpec.CONTENTSPECNODE_LEAF: {
- if (contentSpec.value == null && contentSpec.otherValue == null) {
- str.append("#PCDATA");
- }
- else if (contentSpec.value == null && contentSpec.otherValue != null) {
- str.append("##any:uri=").append(contentSpec.otherValue);
- }
- else if (contentSpec.value == null) {
- str.append("##any");
- }
- else {
- str.append(contentSpec.value);
- }
- break;
- }
- case XMLContentSpec.CONTENTSPECNODE_ZERO_OR_ONE: {
- if (parentContentSpecType == XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE ||
- parentContentSpecType == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_MORE ||
- parentContentSpecType == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_ONE ) {
- getContentSpec(((int[])contentSpec.value)[0], contentSpec);
- str.append('(');
- appendContentSpec(contentSpec, str, true, thisContentSpec );
- str.append(')');
- }
- else {
- getContentSpec(((int[])contentSpec.value)[0], contentSpec);
- appendContentSpec( contentSpec, str, true, thisContentSpec );
- }
- str.append('?');
- break;
- }
- case XMLContentSpec.CONTENTSPECNODE_ZERO_OR_MORE: {
- if (parentContentSpecType == XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE ||
- parentContentSpecType == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_MORE ||
- parentContentSpecType == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_ONE ) {
- getContentSpec(((int[])contentSpec.value)[0], contentSpec);
- str.append('(');
- appendContentSpec(contentSpec, str, true, thisContentSpec);
- str.append(')' );
- }
- else {
- getContentSpec(((int[])contentSpec.value)[0], contentSpec);
- appendContentSpec(contentSpec, str, true, thisContentSpec);
- }
- str.append('*');
- break;
- }
- case XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE: {
- if (parentContentSpecType == XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE ||
- parentContentSpecType == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_MORE ||
- parentContentSpecType == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_ONE ) {
-
- str.append('(');
- getContentSpec(((int[])contentSpec.value)[0], contentSpec);
- appendContentSpec(contentSpec, str, true, thisContentSpec);
- str.append(')' );
- }
- else {
- getContentSpec(((int[])contentSpec.value)[0], contentSpec);
- appendContentSpec(contentSpec, str, true, thisContentSpec);
- }
- str.append('+');
- break;
- }
- case XMLContentSpec.CONTENTSPECNODE_CHOICE:
- case XMLContentSpec.CONTENTSPECNODE_SEQ: {
- if (parens) {
- str.append('(');
- }
- int type = contentSpec.type;
- int otherValue = ((int[])contentSpec.otherValue)[0];
- getContentSpec(((int[])contentSpec.value)[0], contentSpec);
- appendContentSpec(contentSpec, str, contentSpec.type != type, thisContentSpec);
- if (type == XMLContentSpec.CONTENTSPECNODE_CHOICE) {
- str.append('|');
- }
- else {
- str.append(',');
- }
- getContentSpec(otherValue, contentSpec);
- appendContentSpec(contentSpec, str, true, thisContentSpec);
- if (parens) {
- str.append(')');
- }
- break;
- }
- case XMLContentSpec.CONTENTSPECNODE_ANY: {
- str.append("##any");
- if (contentSpec.otherValue != null) {
- str.append(":uri=");
- str.append(contentSpec.otherValue);
- }
- break;
- }
- case XMLContentSpec.CONTENTSPECNODE_ANY_OTHER: {
- str.append("##other:uri=");
- str.append(contentSpec.otherValue);
- break;
- }
- case XMLContentSpec.CONTENTSPECNODE_ANY_LOCAL: {
- str.append("##local");
- break;
- }
- default: {
- str.append("???");
- break;
- }
-
- } // switch type
-
- } // appendContentSpec(XMLContentSpec.Provider,StringPool,XMLContentSpec,StringBuffer,boolean)
-
- // debugging
-
- private void printAttribute(int attributeDeclIndex) {
-
- XMLAttributeDecl attributeDecl = new XMLAttributeDecl();
- if (getAttributeDecl(attributeDeclIndex, attributeDecl)) {
- System.out.print(" { ");
- System.out.print(attributeDecl.name.localpart);
- System.out.print(" }");
- }
-
- } // printAttribute(int)
-
- // content models
-
- /**
- * When the element has a 'CHILDREN' model, this method is called to
- * create the content model object. It looks for some special case simple
- * models and creates SimpleContentModel objects for those. For the rest
- * it creates the standard DFA style model.
- */
- private synchronized ContentModelValidator createChildModel(int contentSpecIndex) {
-
- //
- // Get the content spec node for the element we are working on.
- // This will tell us what kind of node it is, which tells us what
- // kind of model we will try to create.
- //
- XMLContentSpec contentSpec = new XMLContentSpec();
- getContentSpec(contentSpecIndex, contentSpec);
-
- if ((contentSpec.type & 0x0f ) == XMLContentSpec.CONTENTSPECNODE_ANY ||
- (contentSpec.type & 0x0f ) == XMLContentSpec.CONTENTSPECNODE_ANY_OTHER ||
- (contentSpec.type & 0x0f ) == XMLContentSpec.CONTENTSPECNODE_ANY_LOCAL) {
- // let fall through to build a DFAContentModel
- }
-
- else if (contentSpec.type == XMLContentSpec.CONTENTSPECNODE_LEAF) {
- //
- // Check that the left value is not -1, since any content model
- // with PCDATA should be MIXED, so we should not have gotten here.
- //
- if (contentSpec.value == null && contentSpec.otherValue == null)
- throw new RuntimeException("ImplementationMessages.VAL_NPCD");
-
- //
- // Its a single leaf, so its an 'a' type of content model, i.e.
- // just one instance of one element. That one is definitely a
- // simple content model.
- //
-
- fQName.setValues(null, (String)contentSpec.value,
- (String)contentSpec.value, (String)contentSpec.otherValue);
- return new SimpleContentModel(contentSpec.type, fQName, null);
- } else if ((contentSpec.type == XMLContentSpec.CONTENTSPECNODE_CHOICE)
- || (contentSpec.type == XMLContentSpec.CONTENTSPECNODE_SEQ)) {
- //
- // Lets see if both of the children are leafs. If so, then it
- // it has to be a simple content model
- //
- XMLContentSpec contentSpecLeft = new XMLContentSpec();
- XMLContentSpec contentSpecRight = new XMLContentSpec();
-
- getContentSpec( ((int[])contentSpec.value)[0], contentSpecLeft);
- getContentSpec( ((int[])contentSpec.otherValue)[0], contentSpecRight);
-
- if ((contentSpecLeft.type == XMLContentSpec.CONTENTSPECNODE_LEAF)
- && (contentSpecRight.type == XMLContentSpec.CONTENTSPECNODE_LEAF)) {
- //
- // Its a simple choice or sequence, so we can do a simple
- // content model for it.
- //
- fQName.setValues(null, (String)contentSpecLeft.value,
- (String)contentSpecLeft.value, (String)contentSpecLeft.otherValue);
- fQName2.setValues(null, (String)contentSpecRight.value,
- (String)contentSpecRight.value, (String)contentSpecRight.otherValue);
- return new SimpleContentModel(contentSpec.type, fQName, fQName2);
- }
- } else if ((contentSpec.type == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_ONE)
- || (contentSpec.type == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_MORE)
- || (contentSpec.type == XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE)) {
- //
- // Its a repetition, so see if its one child is a leaf. If so
- // its a repetition of a single element, so we can do a simple
- // content model for that.
- //
- XMLContentSpec contentSpecLeft = new XMLContentSpec();
- getContentSpec(((int[])contentSpec.value)[0], contentSpecLeft);
-
- if (contentSpecLeft.type == XMLContentSpec.CONTENTSPECNODE_LEAF) {
- //
- // It is, so we can create a simple content model here that
- // will check for this repetition. We pass -1 for the unused
- // right node.
- //
- fQName.setValues(null, (String)contentSpecLeft.value,
- (String)contentSpecLeft.value, (String)contentSpecLeft.otherValue);
- return new SimpleContentModel(contentSpec.type, fQName, null);
- }
- } else {
- throw new RuntimeException("ImplementationMessages.VAL_CST");
- }
-
- //
- // Its not a simple content model, so here we have to create a DFA
- // for this element. So we create a DFAContentModel object. He
- // encapsulates all of the work to create the DFA.
- //
-
- fLeafCount = 0;
- //int leafCount = countLeaves(contentSpecIndex);
- fLeafCount = 0;
- CMNode cmn = buildSyntaxTree(contentSpecIndex, contentSpec);
-
- // REVISIT: has to be fLeafCount because we convert x+ to x,x*, one more leaf
- return new DFAContentModel( cmn, fLeafCount, false);
-
- } // createChildModel(int):ContentModelValidator
-
- private final CMNode buildSyntaxTree(int startNode,
- XMLContentSpec contentSpec) {
-
- // We will build a node at this level for the new tree
- CMNode nodeRet = null;
- getContentSpec(startNode, contentSpec);
- if ((contentSpec.type & 0x0f) == XMLContentSpec.CONTENTSPECNODE_ANY) {
- //nodeRet = new CMAny(contentSpec.type, -1, fLeafCount++);
- nodeRet = new CMAny(contentSpec.type, (String)contentSpec.otherValue, fLeafCount++);
- }
- else if ((contentSpec.type & 0x0f) == XMLContentSpec.CONTENTSPECNODE_ANY_OTHER) {
- nodeRet = new CMAny(contentSpec.type, (String)contentSpec.otherValue, fLeafCount++);
- }
- else if ((contentSpec.type & 0x0f) == XMLContentSpec.CONTENTSPECNODE_ANY_LOCAL) {
- nodeRet = new CMAny(contentSpec.type, null, fLeafCount++);
- }
- //
- // If this node is a leaf, then its an easy one. We just add it
- // to the tree.
- //
- else if (contentSpec.type == XMLContentSpec.CONTENTSPECNODE_LEAF) {
- //
- // Create a new leaf node, and pass it the current leaf count,
- // which is its DFA state position. Bump the leaf count after
- // storing it. This makes the positions zero based since we
- // store first and then increment.
- //
- fQName.setValues(null, (String)contentSpec.value,
- (String)contentSpec.value, (String)contentSpec.otherValue);
- nodeRet = new CMLeaf(fQName, fLeafCount++);
- }
- else {
- //
- // Its not a leaf, so we have to recurse its left and maybe right
- // nodes. Save both values before we recurse and trash the node.
- final int leftNode = ((int[])contentSpec.value)[0];
- final int rightNode = ((int[])contentSpec.otherValue)[0];
-
- if ((contentSpec.type == XMLContentSpec.CONTENTSPECNODE_CHOICE)
- || (contentSpec.type == XMLContentSpec.CONTENTSPECNODE_SEQ)) {
- //
- // Recurse on both children, and return a binary op node
- // with the two created sub nodes as its children. The node
- // type is the same type as the source.
- //
-
- nodeRet = new CMBinOp( contentSpec.type, buildSyntaxTree(leftNode, contentSpec)
- , buildSyntaxTree(rightNode, contentSpec));
- }
- else if (contentSpec.type == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_MORE) {
- nodeRet = new CMUniOp( contentSpec.type, buildSyntaxTree(leftNode, contentSpec));
- }
- else if (contentSpec.type == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_MORE
- || contentSpec.type == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_ONE
- || contentSpec.type == XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE) {
- nodeRet = new CMUniOp(contentSpec.type, buildSyntaxTree(leftNode, contentSpec));
- }
- else {
- throw new RuntimeException("ImplementationMessages.VAL_CST");
- }
- }
- // And return our new node for this level
- return nodeRet;
- }
-
- /**
- * Build a vector of valid QNames from Content Spec
- * table.
- *
- * @param contentSpecIndex
- * Content Spec index
- * @param vectorQName
- * Array of QName
- * @exception RuntimeException
- */
- private void contentSpecTree(int contentSpecIndex,
- XMLContentSpec contentSpec,
- ChildrenList children) {
-
- // Handle any and leaf nodes
- getContentSpec( contentSpecIndex, contentSpec);
- if ( contentSpec.type == XMLContentSpec.CONTENTSPECNODE_LEAF ||
- (contentSpec.type & 0x0f) == XMLContentSpec.CONTENTSPECNODE_ANY ||
- (contentSpec.type & 0x0f) == XMLContentSpec.CONTENTSPECNODE_ANY_LOCAL ||
- (contentSpec.type & 0x0f) == XMLContentSpec.CONTENTSPECNODE_ANY_OTHER) {
-
- // resize arrays, if needed
- if (children.length == children.qname.length) {
- QName[] newQName = new QName[children.length * 2];
- System.arraycopy(children.qname, 0, newQName, 0, children.length);
- children.qname = newQName;
- int[] newType = new int[children.length * 2];
- System.arraycopy(children.type, 0, newType, 0, children.length);
- children.type = newType;
- }
-
- // save values and return length
- children.qname[children.length] = new QName(null, (String)contentSpec.value,
- (String) contentSpec.value,
- (String) contentSpec.otherValue);
- children.type[children.length] = contentSpec.type;
- children.length++;
- return;
- }
-
- //
- // Its not a leaf, so we have to recurse its left and maybe right
- // nodes. Save both values before we recurse and trash the node.
- //
- final int leftNode = contentSpec.value != null
- ? ((int[])(contentSpec.value))[0] : -1;
- int rightNode = -1 ;
- if (contentSpec.otherValue != null )
- rightNode = ((int[])(contentSpec.otherValue))[0];
- else
- return;
-
- if (contentSpec.type == XMLContentSpec.CONTENTSPECNODE_CHOICE ||
- contentSpec.type == XMLContentSpec.CONTENTSPECNODE_SEQ) {
- contentSpecTree(leftNode, contentSpec, children);
- contentSpecTree(rightNode, contentSpec, children);
- return;
- }
-
- if (contentSpec.type == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_ONE ||
- contentSpec.type == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_MORE ||
- contentSpec.type == XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE) {
- contentSpecTree(leftNode, contentSpec, children);
- return;
- }
-
- // error
- throw new RuntimeException("Invalid content spec type seen in contentSpecTree() method of AbstractDTDGrammar class : "+contentSpec.type);
-
- } // contentSpecTree(int,XMLContentSpec,ChildrenList)
-
- // ensure capacity
-
- private void ensureElementDeclCapacity(int chunk) {
- if (chunk >= fElementDeclName.length) {
- fElementDeclIsExternal = resize(fElementDeclIsExternal,
- fElementDeclIsExternal.length * 2);
-
- fElementDeclName = resize(fElementDeclName, fElementDeclName.length * 2);
- fElementDeclType = resize(fElementDeclType, fElementDeclType.length * 2);
- fElementDeclContentModelValidator = resize(fElementDeclContentModelValidator, fElementDeclContentModelValidator.length * 2);
- fElementDeclContentSpecIndex = resize(fElementDeclContentSpecIndex,fElementDeclContentSpecIndex.length * 2);
- fElementDeclFirstAttributeDeclIndex = resize(fElementDeclFirstAttributeDeclIndex, fElementDeclFirstAttributeDeclIndex.length * 2);
- fElementDeclLastAttributeDeclIndex = resize(fElementDeclLastAttributeDeclIndex, fElementDeclLastAttributeDeclIndex.length * 2);
- }
- else if (fElementDeclName[chunk] != null) {
- return;
- }
-
- fElementDeclIsExternal[chunk] = new int[CHUNK_SIZE];
- fElementDeclName[chunk] = new QName[CHUNK_SIZE];
- fElementDeclType[chunk] = new short[CHUNK_SIZE];
- fElementDeclContentModelValidator[chunk] = new ContentModelValidator[CHUNK_SIZE];
- fElementDeclContentSpecIndex[chunk] = new int[CHUNK_SIZE];
- fElementDeclFirstAttributeDeclIndex[chunk] = new int[CHUNK_SIZE];
- fElementDeclLastAttributeDeclIndex[chunk] = new int[CHUNK_SIZE];
- return;
- }
-
- private void ensureAttributeDeclCapacity(int chunk) {
-
- if (chunk >= fAttributeDeclName.length) {
- fAttributeDeclIsExternal = resize(fAttributeDeclIsExternal,
- fAttributeDeclIsExternal.length * 2);
- fAttributeDeclName = resize(fAttributeDeclName, fAttributeDeclName.length * 2);
- fAttributeDeclType = resize(fAttributeDeclType, fAttributeDeclType.length * 2);
- fAttributeDeclEnumeration = resize(fAttributeDeclEnumeration, fAttributeDeclEnumeration.length * 2);
- fAttributeDeclDefaultType = resize(fAttributeDeclDefaultType, fAttributeDeclDefaultType.length * 2);
- fAttributeDeclDatatypeValidator = resize(fAttributeDeclDatatypeValidator, fAttributeDeclDatatypeValidator.length * 2);
- fAttributeDeclDefaultValue = resize(fAttributeDeclDefaultValue, fAttributeDeclDefaultValue.length * 2);
- fAttributeDeclNonNormalizedDefaultValue = resize(fAttributeDeclNonNormalizedDefaultValue, fAttributeDeclNonNormalizedDefaultValue.length * 2);
- fAttributeDeclNextAttributeDeclIndex = resize(fAttributeDeclNextAttributeDeclIndex, fAttributeDeclNextAttributeDeclIndex.length * 2);
- }
- else if (fAttributeDeclName[chunk] != null) {
- return;
- }
-
- fAttributeDeclIsExternal[chunk] = new int[CHUNK_SIZE];
- fAttributeDeclName[chunk] = new QName[CHUNK_SIZE];
- fAttributeDeclType[chunk] = new short[CHUNK_SIZE];
- fAttributeDeclEnumeration[chunk] = new String[CHUNK_SIZE][];
- fAttributeDeclDefaultType[chunk] = new short[CHUNK_SIZE];
- fAttributeDeclDatatypeValidator[chunk] = new DatatypeValidator[CHUNK_SIZE];
- fAttributeDeclDefaultValue[chunk] = new String[CHUNK_SIZE];
- fAttributeDeclNonNormalizedDefaultValue[chunk] = new String[CHUNK_SIZE];
- fAttributeDeclNextAttributeDeclIndex[chunk] = new int[CHUNK_SIZE];
- return;
- }
-
- private void ensureEntityDeclCapacity(int chunk) {
- if (chunk >= fEntityName.length) {
- fEntityName = resize(fEntityName, fEntityName.length * 2);
- fEntityValue = resize(fEntityValue, fEntityValue.length * 2);
- fEntityPublicId = resize(fEntityPublicId, fEntityPublicId.length * 2);
- fEntitySystemId = resize(fEntitySystemId, fEntitySystemId.length * 2);
- fEntityBaseSystemId = resize(fEntityBaseSystemId, fEntityBaseSystemId.length * 2);
- fEntityNotation = resize(fEntityNotation, fEntityNotation.length * 2);
- fEntityIsPE = resize(fEntityIsPE, fEntityIsPE.length * 2);
- fEntityInExternal = resize(fEntityInExternal, fEntityInExternal.length * 2);
- }
- else if (fEntityName[chunk] != null) {
- return;
- }
-
- fEntityName[chunk] = new String[CHUNK_SIZE];
- fEntityValue[chunk] = new String[CHUNK_SIZE];
- fEntityPublicId[chunk] = new String[CHUNK_SIZE];
- fEntitySystemId[chunk] = new String[CHUNK_SIZE];
- fEntityBaseSystemId[chunk] = new String[CHUNK_SIZE];
- fEntityNotation[chunk] = new String[CHUNK_SIZE];
- fEntityIsPE[chunk] = new byte[CHUNK_SIZE];
- fEntityInExternal[chunk] = new byte[CHUNK_SIZE];
- return;
- }
-
- private void ensureNotationDeclCapacity(int chunk) {
- if (chunk >= fNotationName.length) {
- fNotationName = resize(fNotationName, fNotationName.length * 2);
- fNotationPublicId = resize(fNotationPublicId, fNotationPublicId.length * 2);
- fNotationSystemId = resize(fNotationSystemId, fNotationSystemId.length * 2);
- fNotationBaseSystemId = resize(fNotationBaseSystemId, fNotationBaseSystemId.length * 2);
- }
- else if (fNotationName[chunk] != null) {
- return;
- }
-
- fNotationName[chunk] = new String[CHUNK_SIZE];
- fNotationPublicId[chunk] = new String[CHUNK_SIZE];
- fNotationSystemId[chunk] = new String[CHUNK_SIZE];
- fNotationBaseSystemId[chunk] = new String[CHUNK_SIZE];
- return;
- }
-
- private void ensureContentSpecCapacity(int chunk) {
- if (chunk >= fContentSpecType.length) {
- fContentSpecType = resize(fContentSpecType, fContentSpecType.length * 2);
- fContentSpecValue = resize(fContentSpecValue, fContentSpecValue.length * 2);
- fContentSpecOtherValue = resize(fContentSpecOtherValue, fContentSpecOtherValue.length * 2);
- }
- else if (fContentSpecType[chunk] != null) {
- return;
- }
-
- fContentSpecType[chunk] = new short[CHUNK_SIZE];
- fContentSpecValue[chunk] = new Object[CHUNK_SIZE];
- fContentSpecOtherValue[chunk] = new Object[CHUNK_SIZE];
- return;
- }
-
- //
- // Private static methods
- //
-
- // resize chunks
-
- private static byte[][] resize(byte array[][], int newsize) {
- byte newarray[][] = new byte[newsize][];
- System.arraycopy(array, 0, newarray, 0, array.length);
- return newarray;
- }
-
- private static short[][] resize(short array[][], int newsize) {
- short newarray[][] = new short[newsize][];
- System.arraycopy(array, 0, newarray, 0, array.length);
- return newarray;
- }
-
- private static int[][] resize(int array[][], int newsize) {
- int newarray[][] = new int[newsize][];
- System.arraycopy(array, 0, newarray, 0, array.length);
- return newarray;
- }
-
- private static DatatypeValidator[][] resize(DatatypeValidator array[][], int newsize) {
- DatatypeValidator newarray[][] = new DatatypeValidator[newsize][];
- System.arraycopy(array, 0, newarray, 0, array.length);
- return newarray;
- }
-
- private static ContentModelValidator[][] resize(ContentModelValidator array[][], int newsize) {
- ContentModelValidator newarray[][] = new ContentModelValidator[newsize][];
- System.arraycopy(array, 0, newarray, 0, array.length);
- return newarray;
- }
-
- private static Object[][] resize(Object array[][], int newsize) {
- Object newarray[][] = new Object[newsize][];
- System.arraycopy(array, 0, newarray, 0, array.length);
- return newarray;
- }
-
- private static QName[][] resize(QName array[][], int newsize) {
- QName newarray[][] = new QName[newsize][];
- System.arraycopy(array, 0, newarray, 0, array.length);
- return newarray;
- }
-
- private static String[][] resize(String array[][], int newsize) {
- String newarray[][] = new String[newsize][];
- System.arraycopy(array, 0, newarray, 0, array.length);
- return newarray;
- }
-
- private static String[][][] resize(String array[][][], int newsize) {
- String newarray[][][] = new String[newsize] [][];
- System.arraycopy(array, 0, newarray, 0, array.length);
- return newarray;
- }
-
- //
- // Classes
- //
-
- /**
- * Children list for <code>contentSpecTree</code> method.
- *
- * @xerces.internal
- *
- * @author Eric Ye, IBM
- */
- private static class ChildrenList {
-
- //
- // Data
- //
-
- /** Length. */
- public int length = 0;
-
- // NOTE: The following set of data is mutually exclusive. It is
- // written this way because Java doesn't have a native
- // union data structure. -Ac
-
- /** Left and right children names. */
- public QName[] qname = new QName[2];
-
- /** Left and right children types. */
- public int[] type = new int[2];
-
- //
- // Constructors
- //
-
- public ChildrenList () {}
-
- } // class ChildrenList
-
- //
- // EntityState methods
- //
- public boolean isEntityDeclared (String name){
- return (getEntityDeclIndex(name)!=-1)?true:false;
- }
-
- public boolean isEntityUnparsed (String name){
- int entityIndex = getEntityDeclIndex(name);
- if (entityIndex >-1) {
- int chunk = entityIndex >> CHUNK_SHIFT;
- int index = entityIndex & CHUNK_MASK;
- //for unparsed entity notation!=null
- return (fEntityNotation[chunk][index]!=null)?true:false;
- }
- return false;
- }
-} // class DTDGrammar
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dtd/DTDGrammarBucket.java b/src/com/sun/org/apache/xerces/internal/impl/dtd/DTDGrammarBucket.java
deleted file mode 100644
index fd656bc..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dtd/DTDGrammarBucket.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dtd;
-
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * This very simple class is the skeleton of what the DTDValidator could use
- * to store various grammars that it gets from the GrammarPool. As in the
- * case of XSGrammarBucket, one thinks of this object as being closely
- * associated with its validator; when fully mature, this class will be
- * filled from the GrammarPool when the DTDValidator is invoked on a
- * document, and, if a new DTD grammar is parsed, the new set will be
- * offered back to the GrammarPool for possible inclusion.
- *
- * @xerces.internal
- *
- * @author Neil Graham, IBM
- *
-*/
-public class DTDGrammarBucket {
-
- // REVISIT: make this class smarter and *way* more complete!
-
- //
- // Data
- //
-
- /** Grammars associated with element root name. */
- protected Map<XMLDTDDescription, DTDGrammar> fGrammars;
-
- // the unique grammar from fGrammars (or that we're
- // building) that is used in validation.
- protected DTDGrammar fActiveGrammar;
-
- // is the "active" grammar standalone?
- protected boolean fIsStandalone;
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- public DTDGrammarBucket() {
- fGrammars = new HashMap<>();
- } // <init>()
-
- //
- // Public methods
- //
-
- /**
- * Puts the specified grammar into the grammar pool and associate it to
- * a root element name (this being internal, the lack of generality is irrelevant).
- *
- * @param grammar The grammar.
- */
- public void putGrammar(DTDGrammar grammar) {
- XMLDTDDescription desc = (XMLDTDDescription)grammar.getGrammarDescription();
- fGrammars.put(desc, grammar);
- } // putGrammar(DTDGrammar)
-
- // retrieve a DTDGrammar given an XMLDTDDescription
- public DTDGrammar getGrammar(XMLGrammarDescription desc) {
- return fGrammars.get((XMLDTDDescription)desc);
- } // putGrammar(DTDGrammar)
-
- public void clear() {
- fGrammars.clear();
- fActiveGrammar = null;
- fIsStandalone = false;
- } // clear()
-
- // is the active grammar standalone? This must live here because
- // at the time the validator discovers this we don't yet know
- // what the active grammar should be (no info about root)
- void setStandalone(boolean standalone) {
- fIsStandalone = standalone;
- }
-
- boolean getStandalone() {
- return fIsStandalone;
- }
-
- // set the "active" grammar:
- void setActiveGrammar (DTDGrammar grammar) {
- fActiveGrammar = grammar;
- }
- DTDGrammar getActiveGrammar () {
- return fActiveGrammar;
- }
-} // class DTDGrammarBucket
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dtd/XML11DTDProcessor.java b/src/com/sun/org/apache/xerces/internal/impl/dtd/XML11DTDProcessor.java
deleted file mode 100644
index 4074986..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dtd/XML11DTDProcessor.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999-2002 The Apache Software Foundation.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dtd;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.XML11DTDScannerImpl;
-import com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl;
-import com.sun.org.apache.xerces.internal.impl.XMLEntityManager;
-import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.util.XML11Char;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLEntityResolver;
-
-/**
- * This class extends XMLDTDProcessor by giving it
- * the ability to parse XML 1.1 documents correctly. It can also be used
- * as a DTD loader, so that XML 1.1 external subsets can
- * be processed correctly (hence it's rather anomalous-appearing
- * derivation from XMLDTDLoader).
- *
- * @xerces.internal
- *
- * @author Neil Graham, IBM
- *
- */
-public class XML11DTDProcessor extends XMLDTDLoader{
-
- // constructors
-
- public XML11DTDProcessor() {
- super();
- } // <init>()
-
- public XML11DTDProcessor(SymbolTable symbolTable) {
- super(symbolTable);
- } // init(SymbolTable)
-
- public XML11DTDProcessor(SymbolTable symbolTable,
- XMLGrammarPool grammarPool) {
- super(symbolTable, grammarPool);
- } // init(SymbolTable, XMLGrammarPool)
-
- XML11DTDProcessor(SymbolTable symbolTable,
- XMLGrammarPool grammarPool, XMLErrorReporter errorReporter,
- XMLEntityResolver entityResolver) {
- super(symbolTable, grammarPool, errorReporter, entityResolver);
- } // init(SymbolTable, XMLGrammarPool, XMLErrorReporter, XMLEntityResolver)
-
- // overridden methods
-
- protected boolean isValidNmtoken(String nmtoken) {
- return XML11Char.isXML11ValidNmtoken(nmtoken);
- } // isValidNmtoken(String): boolean
-
- protected boolean isValidName(String name) {
- return XML11Char.isXML11ValidName(name);
- } // isValidNmtoken(String): boolean
-
- protected XMLDTDScannerImpl createDTDScanner(SymbolTable symbolTable,
- XMLErrorReporter errorReporter, XMLEntityManager entityManager) {
- return new XML11DTDScannerImpl(symbolTable, errorReporter, entityManager);
- } // createDTDScanner(SymbolTable, XMLErrorReporter, XMLEntityManager) : XMLDTDScannerImpl
-
- protected short getScannerVersion() {
- return Constants.XML_VERSION_1_1;
- } // getScannerVersion() : short
-
-} // class XML11DTDProcessor
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dtd/XML11DTDValidator.java b/src/com/sun/org/apache/xerces/internal/impl/dtd/XML11DTDValidator.java
deleted file mode 100644
index a39ba0b..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dtd/XML11DTDValidator.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999-2003 The Apache Software Foundation.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dtd;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
-
-/**
- * This allows the validator to correctlyhandle XML 1.1
- * documents.
- *
- * @xerces.internal
- *
- * @author Neil Graham
- */
-public class XML11DTDValidator extends XMLDTDValidator {
-
- //
- // Constants
- //
-
- protected final static String DTD_VALIDATOR_PROPERTY =
- Constants.XERCES_PROPERTY_PREFIX+Constants.DTD_VALIDATOR_PROPERTY;
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- public XML11DTDValidator() {
-
- super();
- } // <init>()
-
- // overridden so that this class has access to the same
- // grammarBucket as the corresponding DTDProcessor
- // will try and use...
- public void reset(XMLComponentManager manager) {
- XMLDTDValidator curr = null;
- if((curr = (XMLDTDValidator)manager.getProperty(DTD_VALIDATOR_PROPERTY)) != null &&
- curr != this) {
- fGrammarBucket = curr.getGrammarBucket();
- }
- super.reset(manager);
- } //reset(XMLComponentManager)
-
- protected void init() {
- if(fValidation || fDynamicValidation) {
- super.init();
- // now overwrite some entries in parent:
-
- try {
- fValID = fDatatypeValidatorFactory.getBuiltInDV("XML11ID");
- fValIDRef = fDatatypeValidatorFactory.getBuiltInDV("XML11IDREF");
- fValIDRefs = fDatatypeValidatorFactory.getBuiltInDV("XML11IDREFS");
- fValNMTOKEN = fDatatypeValidatorFactory.getBuiltInDV("XML11NMTOKEN");
- fValNMTOKENS = fDatatypeValidatorFactory.getBuiltInDV("XML11NMTOKENS");
-
- }
- catch (Exception e) {
- // should never happen
- e.printStackTrace(System.err);
- }
- }
- } // init()
-
-} // class XML11DTDValidator
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dtd/XML11NSDTDValidator.java b/src/com/sun/org/apache/xerces/internal/impl/dtd/XML11NSDTDValidator.java
deleted file mode 100644
index fc6dc91..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dtd/XML11NSDTDValidator.java
+++ /dev/null
@@ -1,266 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999-2003 The Apache Software Foundation.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2002, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dtd;
-
-import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
-import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter;
-import com.sun.org.apache.xerces.internal.util.XMLSymbols;
-import com.sun.org.apache.xerces.internal.xni.Augmentations;
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-
-/**
- * The DTD validator. The validator implements a document
- * filter: receiving document events from the scanner; validating
- * the content and structure; augmenting the InfoSet, if applicable;
- * and notifying the parser of the information resulting from the
- * validation process.
- * <p> Formerly, this component also handled DTD events and grammar construction.
- * To facilitate the development of a meaningful DTD grammar caching/preparsing
- * framework, this functionality has been moved into the XMLDTDLoader
- * class. Therefore, this class no longer implements the DTDFilter
- * or DTDContentModelFilter interfaces.
- * <p>
- * This component requires the following features and properties from the
- * component manager that uses it:
- * <ul>
- * <li>http://xml.org/sax/features/namespaces</li>
- * <li>http://xml.org/sax/features/validation</li>
- * <li>http://apache.org/xml/features/validation/dynamic</li>
- * <li>http://apache.org/xml/properties/internal/symbol-table</li>
- * <li>http://apache.org/xml/properties/internal/error-reporter</li>
- * <li>http://apache.org/xml/properties/internal/grammar-pool</li>
- * <li>http://apache.org/xml/properties/internal/datatype-validator-factory</li>
- * </ul>
- *
- * @xerces.internal
- *
- * @author Elena Litani, IBM
- * @author Michael Glavassevich, IBM
- *
-
- */
-public class XML11NSDTDValidator extends XML11DTDValidator {
-
- /** Attribute QName. */
- private QName fAttributeQName = new QName();
-
- /** Bind namespaces */
- protected final void startNamespaceScope(QName element, XMLAttributes attributes, Augmentations augs)
- throws XNIException {
-
- // add new namespace context
- fNamespaceContext.pushContext();
-
- if (element.prefix == XMLSymbols.PREFIX_XMLNS) {
- fErrorReporter.reportError(
- XMLMessageFormatter.XMLNS_DOMAIN,
- "ElementXMLNSPrefix",
- new Object[] { element.rawname },
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
-
- // search for new namespace bindings
- int length = attributes.getLength();
- for (int i = 0; i < length; i++) {
- String localpart = attributes.getLocalName(i);
- String prefix = attributes.getPrefix(i);
- // when it's of form xmlns="..." or xmlns:prefix="...",
- // it's a namespace declaration. but prefix:xmlns="..." isn't.
- if (prefix == XMLSymbols.PREFIX_XMLNS || prefix == XMLSymbols.EMPTY_STRING
- && localpart == XMLSymbols.PREFIX_XMLNS) {
-
- // get the internalized value of this attribute
- String uri = fSymbolTable.addSymbol(attributes.getValue(i));
-
- // 1. "xmlns" can't be bound to any namespace
- if (prefix == XMLSymbols.PREFIX_XMLNS && localpart == XMLSymbols.PREFIX_XMLNS) {
- fErrorReporter.reportError(
- XMLMessageFormatter.XMLNS_DOMAIN,
- "CantBindXMLNS",
- new Object[] { attributes.getQName(i)},
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
-
- // 2. the namespace for "xmlns" can't be bound to any prefix
- if (uri == NamespaceContext.XMLNS_URI) {
- fErrorReporter.reportError(
- XMLMessageFormatter.XMLNS_DOMAIN,
- "CantBindXMLNS",
- new Object[] { attributes.getQName(i)},
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
-
- // 3. "xml" can't be bound to any other namespace than it's own
- if (localpart == XMLSymbols.PREFIX_XML) {
- if (uri != NamespaceContext.XML_URI) {
- fErrorReporter.reportError(
- XMLMessageFormatter.XMLNS_DOMAIN,
- "CantBindXML",
- new Object[] { attributes.getQName(i)},
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
- }
- // 4. the namespace for "xml" can't be bound to any other prefix
- else {
- if (uri == NamespaceContext.XML_URI) {
- fErrorReporter.reportError(
- XMLMessageFormatter.XMLNS_DOMAIN,
- "CantBindXML",
- new Object[] { attributes.getQName(i)},
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
- }
-
- prefix = localpart != XMLSymbols.PREFIX_XMLNS ? localpart : XMLSymbols.EMPTY_STRING;
-
- // Declare prefix in context. Removing the association between a prefix and a
- // namespace name is permitted in XML 1.1, so if the uri value is the empty string,
- // the prefix is being unbound. -- mrglavas
- fNamespaceContext.declarePrefix(prefix, uri.length() != 0 ? uri : null);
- }
- }
-
- // bind the element
- String prefix = element.prefix != null ? element.prefix : XMLSymbols.EMPTY_STRING;
- element.uri = fNamespaceContext.getURI(prefix);
- if (element.prefix == null && element.uri != null) {
- element.prefix = XMLSymbols.EMPTY_STRING;
- }
- if (element.prefix != null && element.uri == null) {
- fErrorReporter.reportError(
- XMLMessageFormatter.XMLNS_DOMAIN,
- "ElementPrefixUnbound",
- new Object[] { element.prefix, element.rawname },
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
-
- // bind the attributes
- for (int i = 0; i < length; i++) {
- attributes.getName(i, fAttributeQName);
- String aprefix = fAttributeQName.prefix != null ? fAttributeQName.prefix : XMLSymbols.EMPTY_STRING;
- String arawname = fAttributeQName.rawname;
- if (arawname == XMLSymbols.PREFIX_XMLNS) {
- fAttributeQName.uri = fNamespaceContext.getURI(XMLSymbols.PREFIX_XMLNS);
- attributes.setName(i, fAttributeQName);
- } else if (aprefix != XMLSymbols.EMPTY_STRING) {
- fAttributeQName.uri = fNamespaceContext.getURI(aprefix);
- if (fAttributeQName.uri == null) {
- fErrorReporter.reportError(
- XMLMessageFormatter.XMLNS_DOMAIN,
- "AttributePrefixUnbound",
- new Object[] { element.rawname, arawname, aprefix },
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
- attributes.setName(i, fAttributeQName);
- }
- }
-
- // verify that duplicate attributes don't exist
- // Example: <foo xmlns:a='NS' xmlns:b='NS' a:attr='v1' b:attr='v2'/>
- int attrCount = attributes.getLength();
- for (int i = 0; i < attrCount - 1; i++) {
- String auri = attributes.getURI(i);
- if (auri == null || auri == NamespaceContext.XMLNS_URI) {
- continue;
- }
- String alocalpart = attributes.getLocalName(i);
- for (int j = i + 1; j < attrCount; j++) {
- String blocalpart = attributes.getLocalName(j);
- String buri = attributes.getURI(j);
- if (alocalpart == blocalpart && auri == buri) {
- fErrorReporter.reportError(
- XMLMessageFormatter.XMLNS_DOMAIN,
- "AttributeNSNotUnique",
- new Object[] { element.rawname, alocalpart, auri },
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
- }
- }
-
- } // startNamespaceScope(QName,XMLAttributes)
-
- /** Handles end element. */
- protected void endNamespaceScope(QName element, Augmentations augs, boolean isEmpty)
- throws XNIException {
-
- // bind element
- String eprefix = element.prefix != null ? element.prefix : XMLSymbols.EMPTY_STRING;
- element.uri = fNamespaceContext.getURI(eprefix);
- if (element.uri != null) {
- element.prefix = eprefix;
- }
-
- // call handlers
- if (fDocumentHandler != null) {
- if (!isEmpty) {
- fDocumentHandler.endElement(element, augs);
- }
- }
-
- // pop context
- fNamespaceContext.popContext();
-
- } // endNamespaceScope(QName,boolean)
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLAttributeDecl.java b/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLAttributeDecl.java
deleted file mode 100644
index a068fdc..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLAttributeDecl.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999-2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dtd;
-
-import com.sun.org.apache.xerces.internal.xni.QName;
-
-/**
-
- */
-public class XMLAttributeDecl {
-
- //
- // Data
- //
-
- /** name */
- public final QName name = new QName();
-
- /** simpleType */
- public final XMLSimpleType simpleType = new XMLSimpleType();
-
- /** optional */
- public boolean optional;
-
- //
- // Methods
- //
-
- /**
- * setValues
- *
- * @param name
- * @param simpleType
- * @param optional
- */
- public void setValues(QName name, XMLSimpleType simpleType, boolean optional) {
- this.name.setValues(name);
- this.simpleType.setValues(simpleType);
- this.optional = optional;
- } // setValues
-
- /**
- * clear
- */
- public void clear() {
- this.name.clear();
- this.simpleType.clear();
- this.optional = false;
- } // clear
-
-} // class XMLAttributeDecl
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLContentSpec.java b/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLContentSpec.java
deleted file mode 100644
index 39f51c8..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLContentSpec.java
+++ /dev/null
@@ -1,336 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999-2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dtd;
-
-/**
- * ContentSpec really exists to aid the parser classes in implementing
- * access to the grammar.
- * <p>
- * This class is used by the DTD scanner and the validator classes,
- * allowing them to be used separately or together. This "struct"
- * class is used to build content models for validation, where it
- * is more efficient to fetch all of the information for each of
- * these content model "fragments" than to fetch each field one at
- * a time. Since configurations are allowed to have validators
- * without a DTD scanner (i.e. a schema validator) and a DTD scanner
- * without a validator (non-validating processor), this class can be
- * used by each without requiring the presence of the other.
- * <p>
- * When processing element declarations, the DTD scanner will build
- * up a representation of the content model using the node types that
- * are defined here. Since a non-validating processor only needs to
- * remember the type of content model declared (i.e. ANY, EMPTY, MIXED,
- * or CHILDREN), it is free to discard the specific details of the
- * MIXED and CHILDREN content models described using this class.
- * <p>
- * In the typical case of a validating processor reading the grammar
- * of the document from a DTD, the information about the content model
- * declared will be preserved and later "compiled" into an efficient
- * form for use during element validation. Each content spec node
- * that is saved is assigned a unique index that is used as a handle
- * for the "value" or "otherValue" fields of other content spec nodes.
- * A leaf node has a "value" that is either an index in the string
- * pool of the element type of that leaf, or a value of -1 to indicate
- * the special "#PCDATA" leaf type used in a mixed content model.
- * <p>
- * For a mixed content model, the content spec will be made up of
- * leaf and choice content spec nodes, with an optional "zero or more"
- * node. For example, the mixed content declaration "(#PCDATA)" would
- * contain a single leaf node with a node value of -1. A mixed content
- * declaration of "(#PCDATA|foo)*" would have a content spec consisting
- * of two leaf nodes, for the "#PCDATA" and "foo" choices, a choice node
- * with the "value" set to the index of the "#PCDATA" leaf node and the
- * "otherValue" set to the index of the "foo" leaf node, and a "zero or
- * more" node with the "value" set to the index of the choice node. If
- * the content model has more choices, for example "(#PCDATA|a|b)*", then
- * there will be more corresponding choice and leaf nodes, the choice
- * nodes will be chained together through the "value" field with each
- * leaf node referenced by the "otherValue" field.
- * <p>
- * For element content models, there are sequence nodes and also "zero or
- * one" and "one or more" nodes. The leaf nodes would always have a valid
- * string pool index, as the "#PCDATA" leaf is not used in the declarations
- * for element content models.
- *
- * @xerces.internal
- *
- */
-public class XMLContentSpec {
-
- //
- // Constants
- //
-
- /**
- * Name or #PCDATA. Leaf nodes that represent parsed character
- * data (#PCDATA) have values of -1.
- */
- public static final short CONTENTSPECNODE_LEAF = 0;
-
- /** Represents a zero or one occurence count, '?'. */
- public static final short CONTENTSPECNODE_ZERO_OR_ONE = 1;
-
- /** Represents a zero or more occurence count, '*'. */
- public static final short CONTENTSPECNODE_ZERO_OR_MORE = 2;
-
- /** Represents a one or more occurence count, '+'. */
- public static final short CONTENTSPECNODE_ONE_OR_MORE = 3;
-
- /** Represents choice, '|'. */
- public static final short CONTENTSPECNODE_CHOICE = 4;
-
- /** Represents sequence, ','. */
- public static final short CONTENTSPECNODE_SEQ = 5;
-
- /**
- * Represents any namespace specified namespace. When the element
- * found in the document must belong to a specific namespace,
- * <code>otherValue</code> will contain the name of the namespace.
- * If <code>otherValue</code> is <code>-1</code> then the element
- * can be from any namespace.
- * <p>
- * Lists of valid namespaces are created from choice content spec
- * nodes that have any content spec nodes as children.
- */
- public static final short CONTENTSPECNODE_ANY = 6;
-
- /**
- * Represents any other namespace (XML Schema: ##other).
- * <p>
- * When the content spec node type is set to CONTENTSPECNODE_ANY_OTHER,
- * <code>value</code> will contain the namespace that <em>cannot</em>
- * occur.
- */
- public static final short CONTENTSPECNODE_ANY_OTHER = 7;
-
- /** Represents any local element (XML Schema: ##local). */
- public static final short CONTENTSPECNODE_ANY_LOCAL = 8;
-
- /** prcessContent is 'lax' **/
- public static final short CONTENTSPECNODE_ANY_LAX = 22;
-
- public static final short CONTENTSPECNODE_ANY_OTHER_LAX = 23;
-
- public static final short CONTENTSPECNODE_ANY_LOCAL_LAX = 24;
-
- /** processContent is 'skip' **/
-
- public static final short CONTENTSPECNODE_ANY_SKIP = 38;
-
- public static final short CONTENTSPECNODE_ANY_OTHER_SKIP = 39;
-
- public static final short CONTENTSPECNODE_ANY_LOCAL_SKIP = 40;
- //
- // Data
- //
-
- /**
- * The content spec node type.
- *
- * @see #CONTENTSPECNODE_LEAF
- * @see #CONTENTSPECNODE_ZERO_OR_ONE
- * @see #CONTENTSPECNODE_ZERO_OR_MORE
- * @see #CONTENTSPECNODE_ONE_OR_MORE
- * @see #CONTENTSPECNODE_CHOICE
- * @see #CONTENTSPECNODE_SEQ
- */
- public short type;
-
- /**
- * The "left hand" value object of the content spec node.
- * leaf name.localpart, single child for unary ops, left child for binary ops.
- */
- public Object value;
-
- /**
- * The "right hand" value of the content spec node.
- * leaf name.uri, right child for binary ops
- */
- public Object otherValue;
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- public XMLContentSpec() {
- clear();
- }
-
- /** Constructs a content spec with the specified values. */
- public XMLContentSpec(short type, Object value, Object otherValue) {
- setValues(type, value, otherValue);
- }
-
- /**
- * Constructs a content spec from the values in the specified content spec.
- */
- public XMLContentSpec(XMLContentSpec contentSpec) {
- setValues(contentSpec);
- }
-
- /**
- * Constructs a content spec from the values specified by the given
- * content spec provider and identifier.
- */
- public XMLContentSpec(XMLContentSpec.Provider provider,
- int contentSpecIndex) {
- setValues(provider, contentSpecIndex);
- }
-
- //
- // Public methods
- //
-
- /** Clears the values. */
- public void clear() {
- type = -1;
- value = null;
- otherValue = null;
- }
-
- /** Sets the values. */
- public void setValues(short type, Object value, Object otherValue) {
- this.type = type;
- this.value = value;
- this.otherValue = otherValue;
- }
-
- /** Sets the values of the specified content spec. */
- public void setValues(XMLContentSpec contentSpec) {
- type = contentSpec.type;
- value = contentSpec.value;
- otherValue = contentSpec.otherValue;
- }
-
- /**
- * Sets the values from the values specified by the given content spec
- * provider and identifier. If the specified content spec cannot be
- * provided, the values of this content spec are cleared.
- */
- public void setValues(XMLContentSpec.Provider provider,
- int contentSpecIndex) {
- if (!provider.getContentSpec(contentSpecIndex, this)) {
- clear();
- }
- }
-
-
- //
- // Object methods
- //
-
- /** Returns a hash code for this node. */
- public int hashCode() {
- return type << 16 |
- value.hashCode() << 8 |
- otherValue.hashCode();
- }
-
- /** Returns true if the two objects are equal. */
- public boolean equals(Object object) {
- if (object != null && object instanceof XMLContentSpec) {
- XMLContentSpec contentSpec = (XMLContentSpec)object;
- return type == contentSpec.type &&
- value == contentSpec.value &&
- otherValue == contentSpec.otherValue;
- }
- return false;
- }
-
-
- //
- // Interfaces
- //
-
- /**
- * Provides a means for walking the structure built out of
- * content spec "nodes". The user of this provider interface is
- * responsible for knowing what the content spec node values
- * "mean". If those values refer to content spec identifiers,
- * then the user can call back into the provider to get the
- * next content spec node in the structure.
- *
- * @xerces.internal
- */
- public interface Provider {
-
- //
- // XMLContentSpec.Provider methods
- //
-
- /**
- * Fills in the provided content spec structure with content spec
- * information for a unique identifier.
- *
- * @param contentSpecIndex The content spec identifier. All content
- * spec "nodes" have a unique identifier.
- * @param contentSpec The content spec struct to fill in with
- * the information.
- *
- * @return Returns true if the contentSpecIndex was found.
- */
- public boolean getContentSpec(int contentSpecIndex, XMLContentSpec contentSpec);
-
- } // interface Provider
-
-} // class XMLContentSpec
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDDescription.java b/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDDescription.java
deleted file mode 100644
index b9e48e9..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDDescription.java
+++ /dev/null
@@ -1,229 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2000-2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dtd;
-
-import java.util.ArrayList;
-import java.util.Vector;
-
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription;
-import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-import com.sun.org.apache.xerces.internal.util.XMLResourceIdentifierImpl;
-
-/**
- * All information specific to DTD grammars.
- *
- * @xerces.internal
- *
- * @author Neil Graham, IBM
- * @version $Id: XMLDTDDescription.java,v 1.4 2010/08/11 07:18:38 joehw Exp $
- */
-public class XMLDTDDescription extends XMLResourceIdentifierImpl
- implements com.sun.org.apache.xerces.internal.xni.grammars.XMLDTDDescription {
-
- // Data
-
- // pieces of information needed to make this usable as a Grammar key
- // if we know the root of this grammar, here's its name:
- protected String fRootName = null;
-
- // if we don't know the root name, this stores all elements that
- // could serve; fPossibleRoots and fRootName cannot both be non-null
- protected ArrayList fPossibleRoots = null;
-
- // Constructors:
- public XMLDTDDescription(XMLResourceIdentifier id, String rootName) {
- this.setValues(id.getPublicId(), id.getLiteralSystemId(),
- id.getBaseSystemId(), id.getExpandedSystemId());
- this.fRootName = rootName;
- this.fPossibleRoots = null;
- } // init(XMLResourceIdentifier, String)
-
- public XMLDTDDescription(String publicId, String literalId,
- String baseId, String expandedId, String rootName) {
- this.setValues(publicId, literalId, baseId, expandedId);
- this.fRootName = rootName;
- this.fPossibleRoots = null;
- } // init(String, String, String, String, String)
-
- public XMLDTDDescription(XMLInputSource source) {
- this.setValues(source.getPublicId(), null,
- source.getBaseSystemId(), source.getSystemId());
- this.fRootName = null;
- this.fPossibleRoots = null;
- } // init(XMLInputSource)
-
- // XMLGrammarDescription methods
-
- public String getGrammarType () {
- return XMLGrammarDescription.XML_DTD;
- } // getGrammarType(): String
-
- /**
- * @return the root name of this DTD or null if root name is unknown
- */
- public String getRootName() {
- return fRootName;
- } // getRootName(): String
-
- /** Set the root name **/
- public void setRootName(String rootName) {
- fRootName = rootName;
- fPossibleRoots = null;
- }
-
- /** Set possible roots **/
- public void setPossibleRoots(ArrayList possibleRoots) {
- fPossibleRoots = possibleRoots;
- }
-
- /** Set possible roots **/
- public void setPossibleRoots(Vector possibleRoots) {
- fPossibleRoots = (possibleRoots != null) ? new ArrayList(possibleRoots) : null;
- }
-
- /**
- * Compares this grammar with the given grammar. Currently, we compare
- * as follows:
- * - if grammar type not equal return false immediately
- * - try and find a common root name:
- * - if both have roots, use them
- * - else if one has a root, examine other's possible root's for a match;
- * - else try all combinations
- * - test fExpandedSystemId and fPublicId as above
- *
- * @param desc The description of the grammar to be compared with
- * @return True if they are equal, else false
- */
- public boolean equals(Object desc) {
- if (!(desc instanceof XMLGrammarDescription)) return false;
- if (!getGrammarType().equals(((XMLGrammarDescription)desc).getGrammarType())) {
- return false;
- }
- // assume it's a DTDDescription
- XMLDTDDescription dtdDesc = (XMLDTDDescription)desc;
- if (fRootName != null) {
- if ((dtdDesc.fRootName) != null && !dtdDesc.fRootName.equals(fRootName)) {
- return false;
- }
- else if (dtdDesc.fPossibleRoots != null && !dtdDesc.fPossibleRoots.contains(fRootName)) {
- return false;
- }
- }
- else if (fPossibleRoots != null) {
- if (dtdDesc.fRootName != null) {
- if (!fPossibleRoots.contains(dtdDesc.fRootName)) {
- return false;
- }
- }
- else if (dtdDesc.fPossibleRoots == null) {
- return false;
- }
- else {
- boolean found = false;
- final int size = fPossibleRoots.size();
- for (int i = 0; i < size; ++i) {
- String root = (String) fPossibleRoots.get(i);
- found = dtdDesc.fPossibleRoots.contains(root);
- if (found) break;
- }
- if (!found) return false;
- }
- }
- // if we got this far we've got a root match... try other two fields,
- // since so many different DTD's have roots in common:
- if (fExpandedSystemId != null) {
- if (!fExpandedSystemId.equals(dtdDesc.fExpandedSystemId)) {
- return false;
- }
- }
- else if (dtdDesc.fExpandedSystemId != null) {
- return false;
- }
- if (fPublicId != null) {
- if (!fPublicId.equals(dtdDesc.fPublicId)) {
- return false;
- }
- }
- else if (dtdDesc.fPublicId != null) {
- return false;
- }
- return true;
- }
-
- /**
- * Returns the hash code of this grammar
- * Because our .equals method is so complex, we just return a very
- * simple hash that might avoid calls to the equals method a bit...
- * @return The hash code
- */
- public int hashCode() {
- if (fExpandedSystemId != null) {
- return fExpandedSystemId.hashCode();
- }
- if (fPublicId != null) {
- return fPublicId.hashCode();
- }
- // give up; hope .equals can handle it:
- return 0;
- }
-} // class XMLDTDDescription
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDLoader.java b/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDLoader.java
deleted file mode 100644
index ea34394..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDLoader.java
+++ /dev/null
@@ -1,559 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999-2003 The Apache Software Foundation.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dtd;
-
-import java.io.EOFException;
-import java.io.IOException;
-import java.io.StringReader;
-import java.util.Locale;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl;
-import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
-import com.sun.org.apache.xerces.internal.impl.XMLEntityManager;
-import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter;
-
-import com.sun.org.apache.xerces.internal.util.Status;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.util.DefaultErrorHandler;
-
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarLoader;
-import com.sun.org.apache.xerces.internal.xni.grammars.Grammar;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLEntityResolver;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-
-
-/**
- * The DTD loader. The loader knows how to build grammars from XMLInputSources.
- * It extends the DTD processor in order to do this; it's
- * a separate class because DTD processors don't need to know how
- * to talk to the outside world in their role as instance-document
- * helpers.
- * <p>
- * This component requires the following features and properties. It
- * know ho to set them if no one else does:from the
- * <ul>
- * <li>http://xml.org/sax/features/namespaces</li>
- * <li>http://apache.org/xml/properties/internal/symbol-table</li>
- * <li>http://apache.org/xml/properties/internal/error-reporter</li>
- * <li>http://apache.org/xml/properties/internal/grammar-pool</li>
- * <li>http://apache.org/xml/properties/internal/datatype-validator-factory</li>
- * </ul>
- *
- * @xerces.internal
- *
- * @author Neil Graham, IBM
- * @author Michael Glavassevich, IBM
- *
- * @version $Id: XMLDTDLoader.java,v 1.6 2010-11-01 04:39:42 joehw Exp $
- */
-public class XMLDTDLoader
- extends XMLDTDProcessor
- implements XMLGrammarLoader {
-
- //
- // Constants
- //
-
- // feature identifiers
-
- /** Feature identifier: standard uri conformant feature. */
- protected static final String STANDARD_URI_CONFORMANT_FEATURE =
- Constants.XERCES_FEATURE_PREFIX + Constants.STANDARD_URI_CONFORMANT_FEATURE;
-
- /** Feature identifier: balance syntax trees. */
- protected static final String BALANCE_SYNTAX_TREES =
- Constants.XERCES_FEATURE_PREFIX + Constants.BALANCE_SYNTAX_TREES;
-
- // recognized features:
- private static final String[] LOADER_RECOGNIZED_FEATURES = {
- VALIDATION,
- WARN_ON_DUPLICATE_ATTDEF,
- WARN_ON_UNDECLARED_ELEMDEF,
- NOTIFY_CHAR_REFS,
- STANDARD_URI_CONFORMANT_FEATURE,
- BALANCE_SYNTAX_TREES
- };
-
- // property identifiers
-
- /** Property identifier: error handler. */
- protected static final String ERROR_HANDLER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_HANDLER_PROPERTY;
-
- /** Property identifier: entity resolver. */
- public static final String ENTITY_RESOLVER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_RESOLVER_PROPERTY;
-
- /** Property identifier: locale. */
- public static final String LOCALE =
- Constants.XERCES_PROPERTY_PREFIX + Constants.LOCALE_PROPERTY;
-
- /** Recognized properties. */
- private static final String[] LOADER_RECOGNIZED_PROPERTIES = {
- SYMBOL_TABLE,
- ERROR_REPORTER,
- ERROR_HANDLER,
- ENTITY_RESOLVER,
- GRAMMAR_POOL,
- DTD_VALIDATOR,
- LOCALE
- };
-
- // enforcing strict uri?
- private boolean fStrictURI = false;
-
- /** Controls whether the DTD grammar produces balanced syntax trees. */
- private boolean fBalanceSyntaxTrees = false;
-
- /** Entity resolver . */
- protected XMLEntityResolver fEntityResolver;
-
- // the scanner we use to actually read the DTD
- protected XMLDTDScannerImpl fDTDScanner;
-
- // the entity manager the scanner needs.
- protected XMLEntityManager fEntityManager;
-
- // what's our Locale?
- protected Locale fLocale;
-
- //
- // Constructors
- //
-
- /** Deny default construction; we need a SymtolTable! */
- public XMLDTDLoader() {
- this(new SymbolTable());
- } // <init>()
-
- public XMLDTDLoader(SymbolTable symbolTable) {
- this(symbolTable, null);
- } // init(SymbolTable)
-
- public XMLDTDLoader(SymbolTable symbolTable,
- XMLGrammarPool grammarPool) {
- this(symbolTable, grammarPool, null, new XMLEntityManager());
- } // init(SymbolTable, XMLGrammarPool)
-
- XMLDTDLoader(SymbolTable symbolTable,
- XMLGrammarPool grammarPool, XMLErrorReporter errorReporter,
- XMLEntityResolver entityResolver) {
- fSymbolTable = symbolTable;
- fGrammarPool = grammarPool;
- if(errorReporter == null) {
- errorReporter = new XMLErrorReporter();
- errorReporter.setProperty(ERROR_HANDLER, new DefaultErrorHandler());
- }
- fErrorReporter = errorReporter;
- // Add XML message formatter if there isn't one.
- if (fErrorReporter.getMessageFormatter(XMLMessageFormatter.XML_DOMAIN) == null) {
- XMLMessageFormatter xmft = new XMLMessageFormatter();
- fErrorReporter.putMessageFormatter(XMLMessageFormatter.XML_DOMAIN, xmft);
- fErrorReporter.putMessageFormatter(XMLMessageFormatter.XMLNS_DOMAIN, xmft);
- }
- fEntityResolver = entityResolver;
- if(fEntityResolver instanceof XMLEntityManager) {
- fEntityManager = (XMLEntityManager)fEntityResolver;
- } else {
- fEntityManager = new XMLEntityManager();
- }
- fEntityManager.setProperty(Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY, errorReporter);
- fDTDScanner = createDTDScanner(fSymbolTable, fErrorReporter, fEntityManager);
- fDTDScanner.setDTDHandler(this);
- fDTDScanner.setDTDContentModelHandler(this);
- reset();
- } // init(SymbolTable, XMLGrammarPool, XMLErrorReporter, XMLEntityResolver)
-
- // XMLGrammarLoader methods
-
- /**
- * Returns a list of feature identifiers that are recognized by
- * this component. This method may return null if no features
- * are recognized by this component.
- */
- public String[] getRecognizedFeatures() {
- return (String[])(LOADER_RECOGNIZED_FEATURES.clone());
- } // getRecognizedFeatures():String[]
-
- /**
- * Sets the state of a feature. This method is called by the component
- * manager any time after reset when a feature changes state.
- * <p>
- * <strong>Note:</strong> Components should silently ignore features
- * that do not affect the operation of the component.
- *
- * @param featureId The feature identifier.
- * @param state The state of the feature.
- *
- * @throws SAXNotRecognizedException The component should not throw
- * this exception.
- * @throws SAXNotSupportedException The component should not throw
- * this exception.
- */
- public void setFeature(String featureId, boolean state)
- throws XMLConfigurationException {
- if (featureId.equals(VALIDATION)) {
- fValidation = state;
- }
- else if (featureId.equals(WARN_ON_DUPLICATE_ATTDEF)) {
- fWarnDuplicateAttdef = state;
- }
- else if (featureId.equals(WARN_ON_UNDECLARED_ELEMDEF)) {
- fWarnOnUndeclaredElemdef = state;
- }
- else if (featureId.equals(NOTIFY_CHAR_REFS)) {
- fDTDScanner.setFeature(featureId, state);
- }
- else if (featureId.equals(STANDARD_URI_CONFORMANT_FEATURE)) {
- fStrictURI = state;
- }
- else if (featureId.equals(BALANCE_SYNTAX_TREES)) {
- fBalanceSyntaxTrees = state;
- }
- else {
- throw new XMLConfigurationException(Status.NOT_RECOGNIZED, featureId);
- }
- } // setFeature(String,boolean)
-
- /**
- * Returns a list of property identifiers that are recognized by
- * this component. This method may return null if no properties
- * are recognized by this component.
- */
- public String[] getRecognizedProperties() {
- return (String[])(LOADER_RECOGNIZED_PROPERTIES.clone());
- } // getRecognizedProperties():String[]
-
- /**
- * Returns the state of a property.
- *
- * @param propertyId The property identifier.
- *
- * @throws XMLConfigurationException Thrown on configuration error.
- */
- public Object getProperty(String propertyId)
- throws XMLConfigurationException {
- if (propertyId.equals(SYMBOL_TABLE)) {
- return fSymbolTable;
- }
- else if (propertyId.equals(ERROR_REPORTER)) {
- return fErrorReporter;
- }
- else if (propertyId.equals(ERROR_HANDLER)) {
- return fErrorReporter.getErrorHandler();
- }
- else if (propertyId.equals(ENTITY_RESOLVER)) {
- return fEntityResolver;
- }
- else if (propertyId.equals(LOCALE)) {
- return getLocale();
- }
- else if (propertyId.equals(GRAMMAR_POOL)) {
- return fGrammarPool;
- }
- else if (propertyId.equals(DTD_VALIDATOR)) {
- return fValidator;
- }
- throw new XMLConfigurationException(Status.NOT_RECOGNIZED, propertyId);
- } // getProperty(String): Object
-
- /**
- * Sets the value of a property. This method is called by the component
- * manager any time after reset when a property changes value.
- * <p>
- * <strong>Note:</strong> Components should silently ignore properties
- * that do not affect the operation of the component.
- *
- * @param propertyId The property identifier.
- * @param value The value of the property.
- *
- * @throws SAXNotRecognizedException The component should not throw
- * this exception.
- * @throws SAXNotSupportedException The component should not throw
- * this exception.
- */
- public void setProperty(String propertyId, Object value)
- throws XMLConfigurationException {
- if (propertyId.equals(SYMBOL_TABLE)) {
- fSymbolTable = (SymbolTable)value;
- fDTDScanner.setProperty(propertyId, value);
- fEntityManager.setProperty(propertyId, value);
- }
- else if(propertyId.equals(ERROR_REPORTER)) {
- fErrorReporter = (XMLErrorReporter)value;
- // Add XML message formatter if there isn't one.
- if (fErrorReporter.getMessageFormatter(XMLMessageFormatter.XML_DOMAIN) == null) {
- XMLMessageFormatter xmft = new XMLMessageFormatter();
- fErrorReporter.putMessageFormatter(XMLMessageFormatter.XML_DOMAIN, xmft);
- fErrorReporter.putMessageFormatter(XMLMessageFormatter.XMLNS_DOMAIN, xmft);
- }
- fDTDScanner.setProperty(propertyId, value);
- fEntityManager.setProperty(propertyId, value);
- }
- else if (propertyId.equals(ERROR_HANDLER)) {
- fErrorReporter.setProperty(propertyId, value);
- }
- else if (propertyId.equals(ENTITY_RESOLVER)) {
- fEntityResolver = (XMLEntityResolver)value;
- fEntityManager.setProperty(propertyId, value);
- }
- else if (propertyId.equals(LOCALE)) {
- setLocale((Locale) value);
- }
- else if(propertyId.equals(GRAMMAR_POOL)) {
- fGrammarPool = (XMLGrammarPool)value;
- }
- else {
- throw new XMLConfigurationException(Status.NOT_RECOGNIZED, propertyId);
- }
- } // setProperty(String,Object)
-
- /**
- * Returns the state of a feature.
- *
- * @param featureId The feature identifier.
- *
- * @throws XMLConfigurationException Thrown on configuration error.
- */
- public boolean getFeature(String featureId)
- throws XMLConfigurationException {
- if (featureId.equals(VALIDATION)) {
- return fValidation;
- }
- else if (featureId.equals(WARN_ON_DUPLICATE_ATTDEF)) {
- return fWarnDuplicateAttdef;
- }
- else if (featureId.equals(WARN_ON_UNDECLARED_ELEMDEF)) {
- return fWarnOnUndeclaredElemdef;
- }
- else if (featureId.equals(NOTIFY_CHAR_REFS)) {
- return fDTDScanner.getFeature(featureId);
- }
- else if (featureId.equals(STANDARD_URI_CONFORMANT_FEATURE)) {
- return fStrictURI;
- }
- else if (featureId.equals(BALANCE_SYNTAX_TREES)) {
- return fBalanceSyntaxTrees;
- }
- throw new XMLConfigurationException(Status.NOT_RECOGNIZED, featureId);
- } //getFeature(String): boolean
-
- /**
- * Set the locale to use for messages.
- *
- * @param locale The locale object to use for localization of messages.
- *
- * @exception XNIException Thrown if the parser does not support the
- * specified locale.
- */
- public void setLocale(Locale locale) {
- fLocale = locale;
- fErrorReporter.setLocale(locale);
- } // setLocale(Locale)
-
- /** Return the Locale the XMLGrammarLoader is using. */
- public Locale getLocale() {
- return fLocale;
- } // getLocale(): Locale
-
-
- /**
- * Sets the error handler.
- *
- * @param errorHandler The error handler.
- */
- public void setErrorHandler(XMLErrorHandler errorHandler) {
- fErrorReporter.setProperty(ERROR_HANDLER, errorHandler);
- } // setErrorHandler(XMLErrorHandler)
-
- /** Returns the registered error handler. */
- public XMLErrorHandler getErrorHandler() {
- return fErrorReporter.getErrorHandler();
- } // getErrorHandler(): XMLErrorHandler
-
- /**
- * Sets the entity resolver.
- *
- * @param entityResolver The new entity resolver.
- */
- public void setEntityResolver(XMLEntityResolver entityResolver) {
- fEntityResolver = entityResolver;
- fEntityManager.setProperty(ENTITY_RESOLVER, entityResolver);
- } // setEntityResolver(XMLEntityResolver)
-
- /** Returns the registered entity resolver. */
- public XMLEntityResolver getEntityResolver() {
- return fEntityResolver;
- } // getEntityResolver(): XMLEntityResolver
-
- /**
- * Returns a Grammar object by parsing the contents of the
- * entity pointed to by source.
- *
- * @param source the location of the entity which forms
- * the starting point of the grammar to be constructed.
- * @throws IOException When a problem is encountered reading the entity
- * XNIException When a condition arises (such as a FatalError) that requires parsing
- * of the entity be terminated.
- */
- public Grammar loadGrammar(XMLInputSource source)
- throws IOException, XNIException {
- reset();
- // First chance checking strict URI
- String eid = XMLEntityManager.expandSystemId(source.getSystemId(), source.getBaseSystemId(), fStrictURI);
- XMLDTDDescription desc = new XMLDTDDescription(source.getPublicId(), source.getSystemId(), source.getBaseSystemId(), eid, null);
- if (!fBalanceSyntaxTrees) {
- fDTDGrammar = new DTDGrammar(fSymbolTable, desc);
- }
- else {
- fDTDGrammar = new BalancedDTDGrammar(fSymbolTable, desc);
- }
- fGrammarBucket = new DTDGrammarBucket();
- fGrammarBucket.setStandalone(false);
- fGrammarBucket.setActiveGrammar(fDTDGrammar);
- // no reason to use grammar bucket's "put" method--we
- // know which grammar it is, and we don't know the root name anyway...
-
- // actually start the parsing!
- try {
- fDTDScanner.setInputSource(source);
- fDTDScanner.scanDTDExternalSubset(true);
- } catch (EOFException e) {
- // expected behaviour...
- }
- finally {
- // Close all streams opened by the parser.
- fEntityManager.closeReaders();
- }
- if(fDTDGrammar != null && fGrammarPool != null) {
- fGrammarPool.cacheGrammars(XMLDTDDescription.XML_DTD, new Grammar[] {fDTDGrammar});
- }
- return fDTDGrammar;
- } // loadGrammar(XMLInputSource): Grammar
-
- /**
- * Parse a DTD internal and/or external subset and insert the content
- * into the existing DTD grammar owned by the given DTDValidator.
- */
- public void loadGrammarWithContext(XMLDTDValidator validator, String rootName,
- String publicId, String systemId, String baseSystemId, String internalSubset)
- throws IOException, XNIException {
- final DTDGrammarBucket grammarBucket = validator.getGrammarBucket();
- final DTDGrammar activeGrammar = grammarBucket.getActiveGrammar();
- if (activeGrammar != null && !activeGrammar.isImmutable()) {
- fGrammarBucket = grammarBucket;
- fEntityManager.setScannerVersion(getScannerVersion());
- reset();
- try {
- // process internal subset
- if (internalSubset != null) {
- // To get the DTD scanner to end at the right place we have to fool
- // it into thinking that it reached the end of the internal subset
- // in a real document.
- StringBuffer buffer = new StringBuffer(internalSubset.length() + 2);
- buffer.append(internalSubset).append("]>");
- XMLInputSource is = new XMLInputSource(null, baseSystemId,
- null, new StringReader(buffer.toString()), null);
- fEntityManager.startDocumentEntity(is);
- fDTDScanner.scanDTDInternalSubset(true, false, systemId != null);
- }
- // process external subset
- if (systemId != null) {
- XMLDTDDescription desc = new XMLDTDDescription(publicId, systemId, baseSystemId, null, rootName);
- XMLInputSource source = fEntityManager.resolveEntity(desc);
- fDTDScanner.setInputSource(source);
- fDTDScanner.scanDTDExternalSubset(true);
- }
- }
- catch (EOFException e) {
- // expected behaviour...
- }
- finally {
- // Close all streams opened by the parser.
- fEntityManager.closeReaders();
- }
- }
- } // loadGrammarWithContext(XMLDTDValidator, String, String, String, String, String)
-
- // reset all the components that we rely upon
- protected void reset() {
- super.reset();
- fDTDScanner.reset();
- fEntityManager.reset();
- fErrorReporter.setDocumentLocator(fEntityManager.getEntityScanner());
- }
-
- protected XMLDTDScannerImpl createDTDScanner(SymbolTable symbolTable,
- XMLErrorReporter errorReporter, XMLEntityManager entityManager) {
- return new XMLDTDScannerImpl(symbolTable, errorReporter, entityManager);
- } // createDTDScanner(SymbolTable, XMLErrorReporter, XMLEntityManager) : XMLDTDScannerImpl
-
- protected short getScannerVersion() {
- return Constants.XML_VERSION_1_0;
- } // getScannerVersion() : short
-
-} // class XMLDTDLoader
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDProcessor.java b/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDProcessor.java
deleted file mode 100644
index 45e1b31..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDProcessor.java
+++ /dev/null
@@ -1,1752 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999-2002 The Apache Software Foundation.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dtd;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Locale;
-import java.util.Map;
-import java.util.StringTokenizer;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
-import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.util.XMLChar;
-import com.sun.org.apache.xerces.internal.util.XMLSymbols;
-import com.sun.org.apache.xerces.internal.xni.Augmentations;
-import com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLDTDHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLLocator;
-import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
-import com.sun.org.apache.xerces.internal.xni.XMLString;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.grammars.Grammar;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponent;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDContentModelFilter;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDContentModelSource;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDFilter;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDSource;
-
-/**
- * The DTD processor. The processor implements a DTD
- * filter: receiving DTD events from the DTD scanner; validating
- * the content and structure; building a grammar, if applicable;
- * and notifying the DTDHandler of the information resulting from the
- * process.
- * <p>
- * This component requires the following features and properties from the
- * component manager that uses it:
- * <ul>
- * <li>http://xml.org/sax/features/namespaces</li>
- * <li>http://apache.org/xml/properties/internal/symbol-table</li>
- * <li>http://apache.org/xml/properties/internal/error-reporter</li>
- * <li>http://apache.org/xml/properties/internal/grammar-pool</li>
- * <li>http://apache.org/xml/properties/internal/datatype-validator-factory</li>
- * </ul>
- *
- * @xerces.internal
- *
- * @author Neil Graham, IBM
- *
- * @version $Id: XMLDTDProcessor.java,v 1.5 2010-11-01 04:39:42 joehw Exp $
- */
-public class XMLDTDProcessor
- implements XMLComponent, XMLDTDFilter, XMLDTDContentModelFilter {
-
- //
- // Constants
- //
-
- /** Top level scope (-1). */
- private static final int TOP_LEVEL_SCOPE = -1;
-
- // feature identifiers
-
- /** Feature identifier: validation. */
- protected static final String VALIDATION =
- Constants.SAX_FEATURE_PREFIX + Constants.VALIDATION_FEATURE;
-
- /** Feature identifier: notify character references. */
- protected static final String NOTIFY_CHAR_REFS =
- Constants.XERCES_FEATURE_PREFIX + Constants.NOTIFY_CHAR_REFS_FEATURE;
-
- /** Feature identifier: warn on duplicate attdef */
- protected static final String WARN_ON_DUPLICATE_ATTDEF =
- Constants.XERCES_FEATURE_PREFIX +Constants.WARN_ON_DUPLICATE_ATTDEF_FEATURE;
-
- /** Feature identifier: warn on undeclared element referenced in content model. */
- protected static final String WARN_ON_UNDECLARED_ELEMDEF =
- Constants.XERCES_FEATURE_PREFIX + Constants.WARN_ON_UNDECLARED_ELEMDEF_FEATURE;
-
- protected static final String PARSER_SETTINGS =
- Constants.XERCES_FEATURE_PREFIX + Constants.PARSER_SETTINGS;
-
- // property identifiers
-
- /** Property identifier: symbol table. */
- protected static final String SYMBOL_TABLE =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY;
-
- /** Property identifier: error reporter. */
- protected static final String ERROR_REPORTER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY;
-
- /** Property identifier: grammar pool. */
- protected static final String GRAMMAR_POOL =
- Constants.XERCES_PROPERTY_PREFIX + Constants.XMLGRAMMAR_POOL_PROPERTY;
-
- /** Property identifier: validator . */
- protected static final String DTD_VALIDATOR =
- Constants.XERCES_PROPERTY_PREFIX + Constants.DTD_VALIDATOR_PROPERTY;
-
- // recognized features and properties
-
- /** Recognized features. */
- private static final String[] RECOGNIZED_FEATURES = {
- VALIDATION,
- WARN_ON_DUPLICATE_ATTDEF,
- WARN_ON_UNDECLARED_ELEMDEF,
- NOTIFY_CHAR_REFS,
- };
-
- /** Feature defaults. */
- private static final Boolean[] FEATURE_DEFAULTS = {
- null,
- Boolean.FALSE,
- Boolean.FALSE,
- null,
- };
-
- /** Recognized properties. */
- private static final String[] RECOGNIZED_PROPERTIES = {
- SYMBOL_TABLE,
- ERROR_REPORTER,
- GRAMMAR_POOL,
- DTD_VALIDATOR,
- };
-
- /** Property defaults. */
- private static final Object[] PROPERTY_DEFAULTS = {
- null,
- null,
- null,
- null,
- };
-
- // debugging
-
- //
- // Data
- //
-
- // features
-
- /** Validation. */
- protected boolean fValidation;
-
- /** Validation against only DTD */
- protected boolean fDTDValidation;
-
- /** warn on duplicate attribute definition, this feature works only when validation is true */
- protected boolean fWarnDuplicateAttdef;
-
- /** warn on undeclared element referenced in content model, this feature only works when valiation is true */
- protected boolean fWarnOnUndeclaredElemdef;
-
- // properties
-
- /** Symbol table. */
- protected SymbolTable fSymbolTable;
-
- /** Error reporter. */
- protected XMLErrorReporter fErrorReporter;
-
- /** Grammar bucket. */
- protected DTDGrammarBucket fGrammarBucket;
-
- // the validator to which we look for our grammar bucket (the
- // validator needs to hold the bucket so that it can initialize
- // the grammar with details like whether it's for a standalone document...
- protected XMLDTDValidator fValidator;
-
- // the grammar pool we'll try to add the grammar to:
- protected XMLGrammarPool fGrammarPool;
-
- // what's our Locale?
- protected Locale fLocale;
-
- // handlers
-
- /** DTD handler. */
- protected XMLDTDHandler fDTDHandler;
-
- /** DTD source. */
- protected XMLDTDSource fDTDSource;
-
- /** DTD content model handler. */
- protected XMLDTDContentModelHandler fDTDContentModelHandler;
-
- /** DTD content model source. */
- protected XMLDTDContentModelSource fDTDContentModelSource;
-
- // grammars
-
- /** DTD Grammar. */
- protected DTDGrammar fDTDGrammar;
-
- // state
-
- /** Perform validation. */
- private boolean fPerformValidation;
-
- /** True if in an ignore conditional section of the DTD. */
- protected boolean fInDTDIgnore;
-
- // information regarding the current element
-
- // validation states
-
- /** Mixed. */
- private boolean fMixed;
-
- // temporary variables
-
- /** Temporary entity declaration. */
- private final XMLEntityDecl fEntityDecl = new XMLEntityDecl();
-
- /** Notation declaration hash. */
- private final HashMap fNDataDeclNotations = new HashMap();
-
- /** DTD element declaration name. */
- private String fDTDElementDeclName = null;
-
- /** Mixed element type "hash". */
- private final ArrayList fMixedElementTypes = new ArrayList();
-
- /** Element declarations in DTD. */
- private final ArrayList fDTDElementDecls = new ArrayList();
-
- // to check for duplicate ID or ANNOTATION attribute declare in
- // ATTLIST, and misc VCs
-
- /** ID attribute names. */
- private HashMap fTableOfIDAttributeNames;
-
- /** NOTATION attribute names. */
- private HashMap fTableOfNOTATIONAttributeNames;
-
- /** NOTATION enumeration values. */
- private HashMap fNotationEnumVals;
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- public XMLDTDProcessor() {
-
- // initialize data
-
- } // <init>()
-
- //
- // XMLComponent methods
- //
-
- /*
- * Resets the component. The component can query the component manager
- * about any features and properties that affect the operation of the
- * component.
- *
- * @param componentManager The component manager.
- *
- * @throws SAXException Thrown by component on finitialization error.
- * For example, if a feature or property is
- * required for the operation of the component, the
- * component manager may throw a
- * SAXNotRecognizedException or a
- * SAXNotSupportedException.
- */
- public void reset(XMLComponentManager componentManager) throws XMLConfigurationException {
-
- boolean parser_settings = componentManager.getFeature(PARSER_SETTINGS, true);
-
- if (!parser_settings) {
- // parser settings have not been changed
- reset();
- return;
- }
-
- // sax features
- fValidation = componentManager.getFeature(VALIDATION, false);
-
- fDTDValidation =
- !(componentManager
- .getFeature(
- Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_VALIDATION_FEATURE, false));
-
- // Xerces features
-
- fWarnDuplicateAttdef = componentManager.getFeature(WARN_ON_DUPLICATE_ATTDEF, false);
- fWarnOnUndeclaredElemdef = componentManager.getFeature(WARN_ON_UNDECLARED_ELEMDEF, false);
-
- // get needed components
- fErrorReporter =
- (XMLErrorReporter) componentManager.getProperty(
- Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY);
- fSymbolTable =
- (SymbolTable) componentManager.getProperty(
- Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY);
-
- fGrammarPool = (XMLGrammarPool) componentManager.getProperty(GRAMMAR_POOL, null);
-
- try {
- fValidator = (XMLDTDValidator) componentManager.getProperty(DTD_VALIDATOR, null);
- } catch (ClassCastException e) {
- fValidator = null;
- }
- // we get our grammarBucket from the validator...
- if (fValidator != null) {
- fGrammarBucket = fValidator.getGrammarBucket();
- } else {
- fGrammarBucket = null;
- }
- reset();
-
- } // reset(XMLComponentManager)
-
- protected void reset() {
- // clear grammars
- fDTDGrammar = null;
- // initialize state
- fInDTDIgnore = false;
-
- fNDataDeclNotations.clear();
-
- // datatype validators
- if (fValidation) {
-
- if (fNotationEnumVals == null) {
- fNotationEnumVals = new HashMap();
- }
- fNotationEnumVals.clear();
-
- fTableOfIDAttributeNames = new HashMap();
- fTableOfNOTATIONAttributeNames = new HashMap();
- }
-
- }
- /**
- * Returns a list of feature identifiers that are recognized by
- * this component. This method may return null if no features
- * are recognized by this component.
- */
- public String[] getRecognizedFeatures() {
- return (String[])(RECOGNIZED_FEATURES.clone());
- } // getRecognizedFeatures():String[]
-
- /**
- * Sets the state of a feature. This method is called by the component
- * manager any time after reset when a feature changes state.
- * <p>
- * <strong>Note:</strong> Components should silently ignore features
- * that do not affect the operation of the component.
- *
- * @param featureId The feature identifier.
- * @param state The state of the feature.
- *
- * @throws SAXNotRecognizedException The component should not throw
- * this exception.
- * @throws SAXNotSupportedException The component should not throw
- * this exception.
- */
- public void setFeature(String featureId, boolean state)
- throws XMLConfigurationException {
- } // setFeature(String,boolean)
-
- /**
- * Returns a list of property identifiers that are recognized by
- * this component. This method may return null if no properties
- * are recognized by this component.
- */
- public String[] getRecognizedProperties() {
- return (String[])(RECOGNIZED_PROPERTIES.clone());
- } // getRecognizedProperties():String[]
-
- /**
- * Sets the value of a property. This method is called by the component
- * manager any time after reset when a property changes value.
- * <p>
- * <strong>Note:</strong> Components should silently ignore properties
- * that do not affect the operation of the component.
- *
- * @param propertyId The property identifier.
- * @param value The value of the property.
- *
- * @throws SAXNotRecognizedException The component should not throw
- * this exception.
- * @throws SAXNotSupportedException The component should not throw
- * this exception.
- */
- public void setProperty(String propertyId, Object value)
- throws XMLConfigurationException {
- } // setProperty(String,Object)
-
- /**
- * Returns the default state for a feature, or null if this
- * component does not want to report a default value for this
- * feature.
- *
- * @param featureId The feature identifier.
- *
- * @since Xerces 2.2.0
- */
- public Boolean getFeatureDefault(String featureId) {
- for (int i = 0; i < RECOGNIZED_FEATURES.length; i++) {
- if (RECOGNIZED_FEATURES[i].equals(featureId)) {
- return FEATURE_DEFAULTS[i];
- }
- }
- return null;
- } // getFeatureDefault(String):Boolean
-
- /**
- * Returns the default state for a property, or null if this
- * component does not want to report a default value for this
- * property.
- *
- * @param propertyId The property identifier.
- *
- * @since Xerces 2.2.0
- */
- public Object getPropertyDefault(String propertyId) {
- for (int i = 0; i < RECOGNIZED_PROPERTIES.length; i++) {
- if (RECOGNIZED_PROPERTIES[i].equals(propertyId)) {
- return PROPERTY_DEFAULTS[i];
- }
- }
- return null;
- } // getPropertyDefault(String):Object
-
- //
- // XMLDTDSource methods
- //
-
- /**
- * Sets the DTD handler.
- *
- * @param dtdHandler The DTD handler.
- */
- public void setDTDHandler(XMLDTDHandler dtdHandler) {
- fDTDHandler = dtdHandler;
- } // setDTDHandler(XMLDTDHandler)
-
- /**
- * Returns the DTD handler.
- *
- * @return The DTD handler.
- */
- public XMLDTDHandler getDTDHandler() {
- return fDTDHandler;
- } // getDTDHandler(): XMLDTDHandler
-
- //
- // XMLDTDContentModelSource methods
- //
-
- /**
- * Sets the DTD content model handler.
- *
- * @param dtdContentModelHandler The DTD content model handler.
- */
- public void setDTDContentModelHandler(XMLDTDContentModelHandler dtdContentModelHandler) {
- fDTDContentModelHandler = dtdContentModelHandler;
- } // setDTDContentModelHandler(XMLDTDContentModelHandler)
-
- /**
- * Gets the DTD content model handler.
- *
- * @return dtdContentModelHandler The DTD content model handler.
- */
- public XMLDTDContentModelHandler getDTDContentModelHandler() {
- return fDTDContentModelHandler;
- } // getDTDContentModelHandler(): XMLDTDContentModelHandler
-
- //
- // XMLDTDContentModelHandler and XMLDTDHandler methods
- //
-
- /**
- * The start of the DTD external subset.
- *
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startExternalSubset(XMLResourceIdentifier identifier,
- Augmentations augs) throws XNIException {
- if(fDTDGrammar != null)
- fDTDGrammar.startExternalSubset(identifier, augs);
- if(fDTDHandler != null){
- fDTDHandler.startExternalSubset(identifier, augs);
- }
- }
-
- /**
- * The end of the DTD external subset.
- *
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endExternalSubset(Augmentations augs) throws XNIException {
- if(fDTDGrammar != null)
- fDTDGrammar.endExternalSubset(augs);
- if(fDTDHandler != null){
- fDTDHandler.endExternalSubset(augs);
- }
- }
-
- /**
- * Check standalone entity reference.
- * Made static to make common between the validator and loader.
- *
- * @param name
- *@param grammar grammar to which entity belongs
- * @param tempEntityDecl empty entity declaration to put results in
- * @param errorReporter error reporter to send errors to
- *
- * @throws XNIException Thrown by application to signal an error.
- */
- protected static void checkStandaloneEntityRef(String name, DTDGrammar grammar,
- XMLEntityDecl tempEntityDecl, XMLErrorReporter errorReporter) throws XNIException {
- // check VC: Standalone Document Declartion, entities references appear in the document.
- int entIndex = grammar.getEntityDeclIndex(name);
- if (entIndex > -1) {
- grammar.getEntityDecl(entIndex, tempEntityDecl);
- if (tempEntityDecl.inExternal) {
- errorReporter.reportError( XMLMessageFormatter.XML_DOMAIN,
- "MSG_REFERENCE_TO_EXTERNALLY_DECLARED_ENTITY_WHEN_STANDALONE",
- new Object[]{name}, XMLErrorReporter.SEVERITY_ERROR);
- }
- }
- }
-
- /**
- * A comment.
- *
- * @param text The text in the comment.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by application to signal an error.
- */
- public void comment(XMLString text, Augmentations augs) throws XNIException {
-
- // call handlers
- if(fDTDGrammar != null)
- fDTDGrammar.comment(text, augs);
- if (fDTDHandler != null) {
- fDTDHandler.comment(text, augs);
- }
-
- } // comment(XMLString)
-
-
- /**
- * A processing instruction. Processing instructions consist of a
- * target name and, optionally, text data. The data is only meaningful
- * to the application.
- * <p>
- * Typically, a processing instruction's data will contain a series
- * of pseudo-attributes. These pseudo-attributes follow the form of
- * element attributes but are <strong>not</strong> parsed or presented
- * to the application as anything other than text. The application is
- * responsible for parsing the data.
- *
- * @param target The target.
- * @param data The data or null if none specified.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void processingInstruction(String target, XMLString data, Augmentations augs)
- throws XNIException {
-
- // call handlers
- if(fDTDGrammar != null)
- fDTDGrammar.processingInstruction(target, data, augs);
- if (fDTDHandler != null) {
- fDTDHandler.processingInstruction(target, data, augs);
- }
- } // processingInstruction(String,XMLString)
-
- //
- // XMLDTDHandler methods
- //
-
- /**
- * The start of the DTD.
- *
- * @param locator The document locator, or null if the document
- * location cannot be reported during the parsing of
- * the document DTD. However, it is <em>strongly</em>
- * recommended that a locator be supplied that can
- * at least report the base system identifier of the
- * DTD.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startDTD(XMLLocator locator, Augmentations augs) throws XNIException {
-
-
- // initialize state
- fNDataDeclNotations.clear();
- fDTDElementDecls.clear();
-
- // the grammar bucket's DTDGrammar will now be the
- // one we want, whether we're constructing it or not.
- // if we're not constructing it, then we should not have a reference
- // to it!
- if( !fGrammarBucket.getActiveGrammar().isImmutable()) {
- fDTDGrammar = fGrammarBucket.getActiveGrammar();
- }
-
- // call handlers
- if(fDTDGrammar != null )
- fDTDGrammar.startDTD(locator, augs);
- if (fDTDHandler != null) {
- fDTDHandler.startDTD(locator, augs);
- }
-
- } // startDTD(XMLLocator)
-
- /**
- * Characters within an IGNORE conditional section.
- *
- * @param text The ignored text.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void ignoredCharacters(XMLString text, Augmentations augs) throws XNIException {
-
- // ignored characters in DTD
- if(fDTDGrammar != null )
- fDTDGrammar.ignoredCharacters(text, augs);
- if (fDTDHandler != null) {
- fDTDHandler.ignoredCharacters(text, augs);
- }
- }
-
- /**
- * Notifies of the presence of a TextDecl line in an entity. If present,
- * this method will be called immediately following the startParameterEntity call.
- * <p>
- * <strong>Note:</strong> This method is only called for external
- * parameter entities referenced in the DTD.
- *
- * @param version The XML version, or null if not specified.
- * @param encoding The IANA encoding name of the entity.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void textDecl(String version, String encoding, Augmentations augs) throws XNIException {
-
- // call handlers
- if(fDTDGrammar != null )
- fDTDGrammar.textDecl(version, encoding, augs);
- if (fDTDHandler != null) {
- fDTDHandler.textDecl(version, encoding, augs);
- }
- }
-
- /**
- * This method notifies of the start of a parameter entity. The parameter
- * entity name start with a '%' character.
- *
- * @param name The name of the parameter entity.
- * @param identifier The resource identifier.
- * @param encoding The auto-detected IANA encoding name of the entity
- * stream. This value will be null in those situations
- * where the entity encoding is not auto-detected (e.g.
- * internal parameter entities).
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startParameterEntity(String name,
- XMLResourceIdentifier identifier,
- String encoding,
- Augmentations augs) throws XNIException {
-
- if (fPerformValidation && fDTDGrammar != null &&
- fGrammarBucket.getStandalone()) {
- checkStandaloneEntityRef(name, fDTDGrammar, fEntityDecl, fErrorReporter);
- }
- // call handlers
- if(fDTDGrammar != null )
- fDTDGrammar.startParameterEntity(name, identifier, encoding, augs);
- if (fDTDHandler != null) {
- fDTDHandler.startParameterEntity(name, identifier, encoding, augs);
- }
- }
-
- /**
- * This method notifies the end of a parameter entity. Parameter entity
- * names begin with a '%' character.
- *
- * @param name The name of the parameter entity.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endParameterEntity(String name, Augmentations augs) throws XNIException {
-
- // call handlers
- if(fDTDGrammar != null )
- fDTDGrammar.endParameterEntity(name, augs);
- if (fDTDHandler != null) {
- fDTDHandler.endParameterEntity(name, augs);
- }
- }
-
- /**
- * An element declaration.
- *
- * @param name The name of the element.
- * @param contentModel The element content model.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void elementDecl(String name, String contentModel, Augmentations augs)
- throws XNIException {
-
- //check VC: Unique Element Declaration
- if (fValidation) {
- if (fDTDElementDecls.contains(name)) {
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "MSG_ELEMENT_ALREADY_DECLARED",
- new Object[]{ name},
- XMLErrorReporter.SEVERITY_ERROR);
- }
- else {
- fDTDElementDecls.add(name);
- }
- }
-
- // call handlers
- if(fDTDGrammar != null )
- fDTDGrammar.elementDecl(name, contentModel, augs);
- if (fDTDHandler != null) {
- fDTDHandler.elementDecl(name, contentModel, augs);
- }
-
- } // elementDecl(String,String)
-
- /**
- * The start of an attribute list.
- *
- * @param elementName The name of the element that this attribute
- * list is associated with.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startAttlist(String elementName, Augmentations augs)
- throws XNIException {
-
- // call handlers
- if(fDTDGrammar != null )
- fDTDGrammar.startAttlist(elementName, augs);
- if (fDTDHandler != null) {
- fDTDHandler.startAttlist(elementName, augs);
- }
-
- } // startAttlist(String)
-
- /**
- * An attribute declaration.
- *
- * @param elementName The name of the element that this attribute
- * is associated with.
- * @param attributeName The name of the attribute.
- * @param type The attribute type. This value will be one of
- * the following: "CDATA", "ENTITY", "ENTITIES",
- * "ENUMERATION", "ID", "IDREF", "IDREFS",
- * "NMTOKEN", "NMTOKENS", or "NOTATION".
- * @param enumeration If the type has the value "ENUMERATION" or
- * "NOTATION", this array holds the allowed attribute
- * values; otherwise, this array is null.
- * @param defaultType The attribute default type. This value will be
- * one of the following: "#FIXED", "#IMPLIED",
- * "#REQUIRED", or null.
- * @param defaultValue The attribute default value, or null if no
- * default value is specified.
- * @param nonNormalizedDefaultValue The attribute default value with no normalization
- * performed, or null if no default value is specified.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void attributeDecl(String elementName, String attributeName,
- String type, String[] enumeration,
- String defaultType, XMLString defaultValue,
- XMLString nonNormalizedDefaultValue, Augmentations augs) throws XNIException {
-
- if (type != XMLSymbols.fCDATASymbol && defaultValue != null) {
- normalizeDefaultAttrValue(defaultValue);
- }
-
- if (fValidation) {
-
- boolean duplicateAttributeDef = false ;
-
- //Get Grammar index to grammar array
- DTDGrammar grammar = (fDTDGrammar != null? fDTDGrammar:fGrammarBucket.getActiveGrammar());
- int elementIndex = grammar.getElementDeclIndex( elementName);
- if (grammar.getAttributeDeclIndex(elementIndex, attributeName) != -1) {
- //more than one attribute definition is provided for the same attribute of a given element type.
- duplicateAttributeDef = true ;
-
- //this feature works only when validation is true.
- if(fWarnDuplicateAttdef){
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "MSG_DUPLICATE_ATTRIBUTE_DEFINITION",
- new Object[]{ elementName, attributeName },
- XMLErrorReporter.SEVERITY_WARNING );
- }
- }
-
-
- //
- // a) VC: One ID per Element Type, If duplicate ID attribute
- // b) VC: ID attribute Default. if there is a declareared attribute
- // default for ID it should be of type #IMPLIED or #REQUIRED
- if (type == XMLSymbols.fIDSymbol) {
- if (defaultValue != null && defaultValue.length != 0) {
- if (defaultType == null ||
- !(defaultType == XMLSymbols.fIMPLIEDSymbol ||
- defaultType == XMLSymbols.fREQUIREDSymbol)) {
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "IDDefaultTypeInvalid",
- new Object[]{ attributeName},
- XMLErrorReporter.SEVERITY_ERROR);
- }
- }
-
- if (!fTableOfIDAttributeNames.containsKey(elementName)) {
- fTableOfIDAttributeNames.put(elementName, attributeName);
- }
- else {
- //we should not report an error, when there is duplicate attribute definition for given element type
- //according to XML 1.0 spec, When more than one definition is provided for the same attribute of a given
- //element type, the first declaration is binding and later declaration are *ignored*. So processor should
- //ignore the second declarations, however an application would be warned of the duplicate attribute defintion
- // if http://apache.org/xml/features/validation/warn-on-duplicate-attdef feature is set to true,
- // one typical case where this could be a problem, when any XML file
- // provide the ID type information through internal subset so that it is available to the parser which read
- //only internal subset. Now that attribute declaration(ID Type) can again be part of external parsed entity
- //referenced. At that time if parser doesn't make this distinction it will throw an error for VC One ID per
- //Element Type, which (second defintion) actually should be ignored. Application behavior may differ on the
- //basis of error or warning thrown. - nb.
-
- if(!duplicateAttributeDef){
- String previousIDAttributeName = (String)fTableOfIDAttributeNames.get( elementName );//rule a)
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "MSG_MORE_THAN_ONE_ID_ATTRIBUTE",
- new Object[]{ elementName, previousIDAttributeName, attributeName},
- XMLErrorReporter.SEVERITY_ERROR);
- }
- }
- }
-
- //
- // VC: One Notation Per Element Type, should check if there is a
- // duplicate NOTATION attribute
-
- if (type == XMLSymbols.fNOTATIONSymbol) {
- // VC: Notation Attributes: all notation names in the
- // (attribute) declaration must be declared.
- for (int i=0; i<enumeration.length; i++) {
- fNotationEnumVals.put(enumeration[i], attributeName);
- }
-
- if (fTableOfNOTATIONAttributeNames.containsKey( elementName ) == false) {
- fTableOfNOTATIONAttributeNames.put( elementName, attributeName);
- }
- else {
- //we should not report an error, when there is duplicate attribute definition for given element type
- //according to XML 1.0 spec, When more than one definition is provided for the same attribute of a given
- //element type, the first declaration is binding and later declaration are *ignored*. So processor should
- //ignore the second declarations, however an application would be warned of the duplicate attribute definition
- // if http://apache.org/xml/features/validation/warn-on-duplicate-attdef feature is set to true, Application behavior may differ on the basis of error or
- //warning thrown. - nb.
-
- if(!duplicateAttributeDef){
-
- String previousNOTATIONAttributeName = (String) fTableOfNOTATIONAttributeNames.get( elementName );
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "MSG_MORE_THAN_ONE_NOTATION_ATTRIBUTE",
- new Object[]{ elementName, previousNOTATIONAttributeName, attributeName},
- XMLErrorReporter.SEVERITY_ERROR);
- }
- }
- }
-
- // VC: No Duplicate Tokens
- // XML 1.0 SE Errata - E2
- if (type == XMLSymbols.fENUMERATIONSymbol || type == XMLSymbols.fNOTATIONSymbol) {
- outer:
- for (int i = 0; i < enumeration.length; ++i) {
- for (int j = i + 1; j < enumeration.length; ++j) {
- if (enumeration[i].equals(enumeration[j])) {
- // Only report the first uniqueness violation. There could be others,
- // but additional overhead would be incurred tracking unique tokens
- // that have already been encountered. -- mrglavas
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- type == XMLSymbols.fENUMERATIONSymbol
- ? "MSG_DISTINCT_TOKENS_IN_ENUMERATION"
- : "MSG_DISTINCT_NOTATION_IN_ENUMERATION",
- new Object[]{ elementName, enumeration[i], attributeName },
- XMLErrorReporter.SEVERITY_ERROR);
- break outer;
- }
- }
- }
- }
-
- // VC: Attribute Default Legal
- boolean ok = true;
- if (defaultValue != null &&
- (defaultType == null ||
- (defaultType != null && defaultType == XMLSymbols.fFIXEDSymbol))) {
-
- String value = defaultValue.toString();
- if (type == XMLSymbols.fNMTOKENSSymbol ||
- type == XMLSymbols.fENTITIESSymbol ||
- type == XMLSymbols.fIDREFSSymbol) {
-
- StringTokenizer tokenizer = new StringTokenizer(value," ");
- if (tokenizer.hasMoreTokens()) {
- while (true) {
- String nmtoken = tokenizer.nextToken();
- if (type == XMLSymbols.fNMTOKENSSymbol) {
- if (!isValidNmtoken(nmtoken)) {
- ok = false;
- break;
- }
- }
- else if (type == XMLSymbols.fENTITIESSymbol ||
- type == XMLSymbols.fIDREFSSymbol) {
- if (!isValidName(nmtoken)) {
- ok = false;
- break;
- }
- }
- if (!tokenizer.hasMoreTokens()) {
- break;
- }
- }
- }
-
- }
- else {
- if (type == XMLSymbols.fENTITYSymbol ||
- type == XMLSymbols.fIDSymbol ||
- type == XMLSymbols.fIDREFSymbol ||
- type == XMLSymbols.fNOTATIONSymbol) {
-
- if (!isValidName(value)) {
- ok = false;
- }
-
- }
- else if (type == XMLSymbols.fNMTOKENSymbol ||
- type == XMLSymbols.fENUMERATIONSymbol) {
-
- if (!isValidNmtoken(value)) {
- ok = false;
- }
- }
-
- if (type == XMLSymbols.fNOTATIONSymbol ||
- type == XMLSymbols.fENUMERATIONSymbol) {
- ok = false;
- for (int i=0; i<enumeration.length; i++) {
- if (defaultValue.equals(enumeration[i])) {
- ok = true;
- }
- }
- }
-
- }
- if (!ok) {
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "MSG_ATT_DEFAULT_INVALID",
- new Object[]{attributeName, value},
- XMLErrorReporter.SEVERITY_ERROR);
- }
- }
- }
-
- // call handlers
- if(fDTDGrammar != null)
- fDTDGrammar.attributeDecl(elementName, attributeName,
- type, enumeration,
- defaultType, defaultValue, nonNormalizedDefaultValue, augs);
- if (fDTDHandler != null) {
- fDTDHandler.attributeDecl(elementName, attributeName,
- type, enumeration,
- defaultType, defaultValue, nonNormalizedDefaultValue, augs);
- }
-
- } // attributeDecl(String,String,String,String[],String,XMLString, XMLString, Augmentations)
-
- /**
- * The end of an attribute list.
- *
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endAttlist(Augmentations augs) throws XNIException {
-
- // call handlers
- if(fDTDGrammar != null)
- fDTDGrammar.endAttlist(augs);
- if (fDTDHandler != null) {
- fDTDHandler.endAttlist(augs);
- }
-
- } // endAttlist()
-
- /**
- * An internal entity declaration.
- *
- * @param name The name of the entity. Parameter entity names start with
- * '%', whereas the name of a general entity is just the
- * entity name.
- * @param text The value of the entity.
- * @param nonNormalizedText The non-normalized value of the entity. This
- * value contains the same sequence of characters that was in
- * the internal entity declaration, without any entity
- * references expanded.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void internalEntityDecl(String name, XMLString text,
- XMLString nonNormalizedText,
- Augmentations augs) throws XNIException {
-
- DTDGrammar grammar = (fDTDGrammar != null? fDTDGrammar: fGrammarBucket.getActiveGrammar());
- int index = grammar.getEntityDeclIndex(name) ;
-
- //If the same entity is declared more than once, the first declaration
- //encountered is binding, SAX requires only effective(first) declaration
- //to be reported to the application
-
- //REVISIT: Does it make sense to pass duplicate Entity information across
- //the pipeline -- nb?
-
- //its a new entity and hasn't been declared.
- if(index == -1){
- //store internal entity declaration in grammar
- if(fDTDGrammar != null)
- fDTDGrammar.internalEntityDecl(name, text, nonNormalizedText, augs);
- // call handlers
- if (fDTDHandler != null) {
- fDTDHandler.internalEntityDecl(name, text, nonNormalizedText, augs);
- }
- }
-
- } // internalEntityDecl(String,XMLString,XMLString)
-
-
- /**
- * An external entity declaration.
- *
- * @param name The name of the entity. Parameter entity names start
- * with '%', whereas the name of a general entity is just
- * the entity name.
- * @param identifier An object containing all location information
- * pertinent to this external entity.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void externalEntityDecl(String name, XMLResourceIdentifier identifier,
- Augmentations augs) throws XNIException {
-
- DTDGrammar grammar = (fDTDGrammar != null? fDTDGrammar: fGrammarBucket.getActiveGrammar());
- int index = grammar.getEntityDeclIndex(name) ;
-
- //If the same entity is declared more than once, the first declaration
- //encountered is binding, SAX requires only effective(first) declaration
- //to be reported to the application
-
- //REVISIT: Does it make sense to pass duplicate entity information across
- //the pipeline -- nb?
-
- //its a new entity and hasn't been declared.
- if(index == -1){
- //store external entity declaration in grammar
- if(fDTDGrammar != null)
- fDTDGrammar.externalEntityDecl(name, identifier, augs);
- // call handlers
- if (fDTDHandler != null) {
- fDTDHandler.externalEntityDecl(name, identifier, augs);
- }
- }
-
- } // externalEntityDecl(String,XMLResourceIdentifier, Augmentations)
-
- /**
- * An unparsed entity declaration.
- *
- * @param name The name of the entity.
- * @param identifier An object containing all location information
- * pertinent to this entity.
- * @param notation The name of the notation.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void unparsedEntityDecl(String name, XMLResourceIdentifier identifier,
- String notation,
- Augmentations augs) throws XNIException {
-
- // VC: Notation declared, in the production of NDataDecl
- if (fValidation) {
- fNDataDeclNotations.put(name, notation);
- }
-
- // call handlers
- if(fDTDGrammar != null)
- fDTDGrammar.unparsedEntityDecl(name, identifier, notation, augs);
- if (fDTDHandler != null) {
- fDTDHandler.unparsedEntityDecl(name, identifier, notation, augs);
- }
-
- } // unparsedEntityDecl(String,XMLResourceIdentifier,String,Augmentations)
-
- /**
- * A notation declaration
- *
- * @param name The name of the notation.
- * @param identifier An object containing all location information
- * pertinent to this notation.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void notationDecl(String name, XMLResourceIdentifier identifier,
- Augmentations augs) throws XNIException {
-
- // VC: Unique Notation Name
- if (fValidation) {
- DTDGrammar grammar = (fDTDGrammar != null ? fDTDGrammar : fGrammarBucket.getActiveGrammar());
- if (grammar.getNotationDeclIndex(name) != -1) {
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "UniqueNotationName",
- new Object[]{name},
- XMLErrorReporter.SEVERITY_ERROR);
- }
- }
-
- // call handlers
- if(fDTDGrammar != null)
- fDTDGrammar.notationDecl(name, identifier, augs);
- if (fDTDHandler != null) {
- fDTDHandler.notationDecl(name, identifier, augs);
- }
-
- } // notationDecl(String,XMLResourceIdentifier, Augmentations)
-
- /**
- * The start of a conditional section.
- *
- * @param type The type of the conditional section. This value will
- * either be CONDITIONAL_INCLUDE or CONDITIONAL_IGNORE.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see #CONDITIONAL_INCLUDE
- * @see #CONDITIONAL_IGNORE
- */
- public void startConditional(short type, Augmentations augs) throws XNIException {
-
- // set state
- fInDTDIgnore = type == XMLDTDHandler.CONDITIONAL_IGNORE;
-
- // call handlers
- if(fDTDGrammar != null)
- fDTDGrammar.startConditional(type, augs);
- if (fDTDHandler != null) {
- fDTDHandler.startConditional(type, augs);
- }
-
- } // startConditional(short)
-
- /**
- * The end of a conditional section.
- *
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endConditional(Augmentations augs) throws XNIException {
-
- // set state
- fInDTDIgnore = false;
-
- // call handlers
- if(fDTDGrammar != null)
- fDTDGrammar.endConditional(augs);
- if (fDTDHandler != null) {
- fDTDHandler.endConditional(augs);
- }
-
- } // endConditional()
-
- /**
- * The end of the DTD.
- *
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endDTD(Augmentations augs) throws XNIException {
-
-
- // save grammar
- if(fDTDGrammar != null) {
- fDTDGrammar.endDTD(augs);
- if(fGrammarPool != null)
- fGrammarPool.cacheGrammars(XMLGrammarDescription.XML_DTD, new Grammar[] {fDTDGrammar});
- }
- if (fValidation) {
- DTDGrammar grammar = (fDTDGrammar != null? fDTDGrammar: fGrammarBucket.getActiveGrammar());
-
- // VC : Notation Declared. for external entity declaration [Production 76].
- Iterator entities = fNDataDeclNotations.entrySet().iterator();
- while (entities.hasNext()) {
- Map.Entry entry = (Map.Entry) entities.next();
- String notation = (String) entry.getValue();
- if (grammar.getNotationDeclIndex(notation) == -1) {
- String entity = (String) entry.getKey();
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "MSG_NOTATION_NOT_DECLARED_FOR_UNPARSED_ENTITYDECL",
- new Object[]{entity, notation},
- XMLErrorReporter.SEVERITY_ERROR);
- }
- }
-
- // VC: Notation Attributes:
- // all notation names in the (attribute) declaration must be declared.
- Iterator notationVals = fNotationEnumVals.entrySet().iterator();
- while (notationVals.hasNext()) {
- Map.Entry entry = (Map.Entry) notationVals.next();
- String notation = (String) entry.getKey();
- if (grammar.getNotationDeclIndex(notation) == -1) {
- String attributeName = (String) entry.getValue();
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "MSG_NOTATION_NOT_DECLARED_FOR_NOTATIONTYPE_ATTRIBUTE",
- new Object[]{attributeName, notation},
- XMLErrorReporter.SEVERITY_ERROR);
- }
- }
-
- // VC: No Notation on Empty Element
- // An attribute of type NOTATION must not be declared on an element declared EMPTY.
- Iterator elementsWithNotations = fTableOfNOTATIONAttributeNames.entrySet().iterator();
- while (elementsWithNotations.hasNext()) {
- Map.Entry entry = (Map.Entry) elementsWithNotations.next();
- String elementName = (String) entry.getKey();
- int elementIndex = grammar.getElementDeclIndex(elementName);
- if (grammar.getContentSpecType(elementIndex) == XMLElementDecl.TYPE_EMPTY) {
- String attributeName = (String) entry.getValue();
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "NoNotationOnEmptyElement",
- new Object[]{elementName, attributeName},
- XMLErrorReporter.SEVERITY_ERROR);
- }
- }
-
- // should be safe to release these references
- fTableOfIDAttributeNames = null;
- fTableOfNOTATIONAttributeNames = null;
-
- // check whether each element referenced in a content model is declared
- if (fWarnOnUndeclaredElemdef) {
- checkDeclaredElements(grammar);
- }
- }
-
- // call handlers
- if (fDTDHandler != null) {
- fDTDHandler.endDTD(augs);
- }
-
- } // endDTD()
-
- // sets the XMLDTDSource of this handler
- public void setDTDSource(XMLDTDSource source ) {
- fDTDSource = source;
- } // setDTDSource(XMLDTDSource)
-
- // returns the XMLDTDSource of this handler
- public XMLDTDSource getDTDSource() {
- return fDTDSource;
- } // getDTDSource(): XMLDTDSource
-
- //
- // XMLDTDContentModelHandler methods
- //
-
- // sets the XMLContentModelDTDSource of this handler
- public void setDTDContentModelSource(XMLDTDContentModelSource source ) {
- fDTDContentModelSource = source;
- } // setDTDContentModelSource(XMLDTDContentModelSource)
-
- // returns the XMLDTDSource of this handler
- public XMLDTDContentModelSource getDTDContentModelSource() {
- return fDTDContentModelSource;
- } // getDTDContentModelSource(): XMLDTDContentModelSource
-
-
- /**
- * The start of a content model. Depending on the type of the content
- * model, specific methods may be called between the call to the
- * startContentModel method and the call to the endContentModel method.
- *
- * @param elementName The name of the element.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startContentModel(String elementName, Augmentations augs)
- throws XNIException {
-
- if (fValidation) {
- fDTDElementDeclName = elementName;
- fMixedElementTypes.clear();
- }
-
- // call handlers
- if(fDTDGrammar != null)
- fDTDGrammar.startContentModel(elementName, augs);
- if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.startContentModel(elementName, augs);
- }
-
- } // startContentModel(String)
-
- /**
- * A content model of ANY.
- *
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see #empty
- * @see #startGroup
- */
- public void any(Augmentations augs) throws XNIException {
- if(fDTDGrammar != null)
- fDTDGrammar.any(augs);
- if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.any(augs);
- }
- } // any()
-
- /**
- * A content model of EMPTY.
- *
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see #any
- * @see #startGroup
- */
- public void empty(Augmentations augs) throws XNIException {
- if(fDTDGrammar != null)
- fDTDGrammar.empty(augs);
- if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.empty(augs);
- }
- } // empty()
-
- /**
- * A start of either a mixed or children content model. A mixed
- * content model will immediately be followed by a call to the
- * <code>pcdata()</code> method. A children content model will
- * contain additional groups and/or elements.
- *
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see #any
- * @see #empty
- */
- public void startGroup(Augmentations augs) throws XNIException {
-
- fMixed = false;
- // call handlers
- if(fDTDGrammar != null)
- fDTDGrammar.startGroup(augs);
- if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.startGroup(augs);
- }
-
- } // startGroup()
-
- /**
- * The appearance of "#PCDATA" within a group signifying a
- * mixed content model. This method will be the first called
- * following the content model's <code>startGroup()</code>.
- *
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see #startGroup
- */
- public void pcdata(Augmentations augs) {
- fMixed = true;
- if(fDTDGrammar != null)
- fDTDGrammar.pcdata(augs);
- if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.pcdata(augs);
- }
- } // pcdata()
-
- /**
- * A referenced element in a mixed or children content model.
- *
- * @param elementName The name of the referenced element.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void element(String elementName, Augmentations augs) throws XNIException {
-
- // check VC: No duplicate Types, in a single mixed-content declaration
- if (fMixed && fValidation) {
- if (fMixedElementTypes.contains(elementName)) {
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "DuplicateTypeInMixedContent",
- new Object[]{fDTDElementDeclName, elementName},
- XMLErrorReporter.SEVERITY_ERROR);
- }
- else {
- fMixedElementTypes.add(elementName);
- }
- }
-
- // call handlers
- if(fDTDGrammar != null)
- fDTDGrammar.element(elementName, augs);
- if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.element(elementName, augs);
- }
-
- } // childrenElement(String)
-
- /**
- * The separator between choices or sequences of a mixed or children
- * content model.
- *
- * @param separator The type of children separator.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see #SEPARATOR_CHOICE
- * @see #SEPARATOR_SEQUENCE
- */
- public void separator(short separator, Augmentations augs)
- throws XNIException {
-
- // call handlers
- if(fDTDGrammar != null)
- fDTDGrammar.separator(separator, augs);
- if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.separator(separator, augs);
- }
-
- } // separator(short)
-
- /**
- * The occurrence count for a child in a children content model or
- * for the mixed content model group.
- *
- * @param occurrence The occurrence count for the last element
- * or group.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see #OCCURS_ZERO_OR_ONE
- * @see #OCCURS_ZERO_OR_MORE
- * @see #OCCURS_ONE_OR_MORE
- */
- public void occurrence(short occurrence, Augmentations augs)
- throws XNIException {
-
- // call handlers
- if(fDTDGrammar != null)
- fDTDGrammar.occurrence(occurrence, augs);
- if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.occurrence(occurrence, augs);
- }
-
- } // occurrence(short)
-
- /**
- * The end of a group for mixed or children content models.
- *
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endGroup(Augmentations augs) throws XNIException {
-
- // call handlers
- if(fDTDGrammar != null)
- fDTDGrammar.endGroup(augs);
- if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.endGroup(augs);
- }
-
- } // endGroup()
-
- /**
- * The end of a content model.
- *
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endContentModel(Augmentations augs) throws XNIException {
-
- // call handlers
- if(fDTDGrammar != null)
- fDTDGrammar.endContentModel(augs);
- if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.endContentModel(augs);
- }
-
- } // endContentModel()
-
- //
- // Private methods
- //
-
- /**
- * Normalize the attribute value of a non CDATA default attribute
- * collapsing sequences of space characters (x20)
- *
- * @param value The value to normalize
- * @return Whether the value was changed or not.
- */
- private boolean normalizeDefaultAttrValue(XMLString value) {
-
- boolean skipSpace = true; // skip leading spaces
- int current = value.offset;
- int end = value.offset + value.length;
- for (int i = value.offset; i < end; i++) {
- if (value.ch[i] == ' ') {
- if (!skipSpace) {
- // take the first whitespace as a space and skip the others
- value.ch[current++] = ' ';
- skipSpace = true;
- }
- else {
- // just skip it.
- }
- }
- else {
- // simply shift non space chars if needed
- if (current != i) {
- value.ch[current] = value.ch[i];
- }
- current++;
- skipSpace = false;
- }
- }
- if (current != end) {
- if (skipSpace) {
- // if we finished on a space trim it
- current--;
- }
- // set the new value length
- value.length = current - value.offset;
- return true;
- }
- return false;
- }
-
- protected boolean isValidNmtoken(String nmtoken) {
- return XMLChar.isValidNmtoken(nmtoken);
- } // isValidNmtoken(String): boolean
-
- protected boolean isValidName(String name) {
- return XMLChar.isValidName(name);
- } // isValidName(String): boolean
-
- /**
- * Checks that all elements referenced in content models have
- * been declared. This method calls out to the error handler
- * to indicate warnings.
- */
- private void checkDeclaredElements(DTDGrammar grammar) {
- int elementIndex = grammar.getFirstElementDeclIndex();
- XMLContentSpec contentSpec = new XMLContentSpec();
- while (elementIndex >= 0) {
- int type = grammar.getContentSpecType(elementIndex);
- if (type == XMLElementDecl.TYPE_CHILDREN || type == XMLElementDecl.TYPE_MIXED) {
- checkDeclaredElements(grammar,
- elementIndex,
- grammar.getContentSpecIndex(elementIndex),
- contentSpec);
- }
- elementIndex = grammar.getNextElementDeclIndex(elementIndex);
- }
- }
-
- /**
- * Does a recursive (if necessary) check on the specified element's
- * content spec to make sure that all children refer to declared
- * elements.
- */
- private void checkDeclaredElements(DTDGrammar grammar, int elementIndex,
- int contentSpecIndex, XMLContentSpec contentSpec) {
- grammar.getContentSpec(contentSpecIndex, contentSpec);
- if (contentSpec.type == XMLContentSpec.CONTENTSPECNODE_LEAF) {
- String value = (String) contentSpec.value;
- if (value != null && grammar.getElementDeclIndex(value) == -1) {
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "UndeclaredElementInContentSpec",
- new Object[]{grammar.getElementDeclName(elementIndex).rawname, value},
- XMLErrorReporter.SEVERITY_WARNING);
- }
- }
- // It's not a leaf, so we have to recurse its left and maybe right
- // nodes. Save both values before we recurse and trash the node.
- else if ((contentSpec.type == XMLContentSpec.CONTENTSPECNODE_CHOICE)
- || (contentSpec.type == XMLContentSpec.CONTENTSPECNODE_SEQ)) {
- final int leftNode = ((int[])contentSpec.value)[0];
- final int rightNode = ((int[])contentSpec.otherValue)[0];
- // Recurse on both children.
- checkDeclaredElements(grammar, elementIndex, leftNode, contentSpec);
- checkDeclaredElements(grammar, elementIndex, rightNode, contentSpec);
- }
- else if (contentSpec.type == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_MORE
- || contentSpec.type == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_ONE
- || contentSpec.type == XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE) {
- final int leftNode = ((int[])contentSpec.value)[0];
- checkDeclaredElements(grammar, elementIndex, leftNode, contentSpec);
- }
- }
-
-} // class XMLDTDProcessor
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDValidator.java b/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDValidator.java
deleted file mode 100644
index 27e7cda..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDValidator.java
+++ /dev/null
@@ -1,2069 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dtd;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.RevalidationHandler;
-import com.sun.org.apache.xerces.internal.impl.XMLEntityManager;
-import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
-import com.sun.org.apache.xerces.internal.impl.dtd.models.ContentModelValidator;
-import com.sun.org.apache.xerces.internal.impl.dv.DTDDVFactory;
-import com.sun.org.apache.xerces.internal.impl.dv.DatatypeValidator;
-import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException;
-import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter;
-import com.sun.org.apache.xerces.internal.impl.validation.ValidationManager;
-import com.sun.org.apache.xerces.internal.impl.validation.ValidationState;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.util.XMLChar;
-import com.sun.org.apache.xerces.internal.util.XMLSymbols;
-import com.sun.org.apache.xerces.internal.xni.Augmentations;
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
-import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLLocator;
-import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
-import com.sun.org.apache.xerces.internal.xni.XMLString;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.grammars.Grammar;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponent;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentFilter;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource;
-
-/**
- * The DTD validator. The validator implements a document
- * filter: receiving document events from the scanner; validating
- * the content and structure; augmenting the InfoSet, if applicable;
- * and notifying the parser of the information resulting from the
- * validation process.
- * <p> Formerly, this component also handled DTD events and grammar construction.
- * To facilitate the development of a meaningful DTD grammar caching/preparsing
- * framework, this functionality has been moved into the XMLDTDLoader
- * class. Therefore, this class no longer implements the DTDFilter
- * or DTDContentModelFilter interfaces.
- * <p>
- * This component requires the following features and properties from the
- * component manager that uses it:
- * <ul>
- * <li>http://xml.org/sax/features/namespaces</li>
- * <li>http://xml.org/sax/features/validation</li>
- * <li>http://apache.org/xml/features/validation/dynamic</li>
- * <li>http://apache.org/xml/properties/internal/symbol-table</li>
- * <li>http://apache.org/xml/properties/internal/error-reporter</li>
- * <li>http://apache.org/xml/properties/internal/grammar-pool</li>
- * <li>http://apache.org/xml/properties/internal/datatype-validator-factory</li>
- * </ul>
- *
- * @xerces.internal
- *
- * @author Eric Ye, IBM
- * @author Andy Clark, IBM
- * @author Jeffrey Rodriguez IBM
- * @author Neil Graham, IBM
- *
- * @version $Id: XMLDTDValidator.java,v 1.8 2010-11-01 04:39:42 joehw Exp $
- */
-public class XMLDTDValidator
- implements XMLComponent, XMLDocumentFilter, XMLDTDValidatorFilter, RevalidationHandler {
-
- //
- // Constants
- //
-
- /** Symbol: "&lt;&lt;datatypes>>". */
-
- /** Top level scope (-1). */
- private static final int TOP_LEVEL_SCOPE = -1;
-
- // feature identifiers
-
- /** Feature identifier: namespaces. */
- protected static final String NAMESPACES =
- Constants.SAX_FEATURE_PREFIX + Constants.NAMESPACES_FEATURE;
-
- /** Feature identifier: validation. */
- protected static final String VALIDATION =
- Constants.SAX_FEATURE_PREFIX + Constants.VALIDATION_FEATURE;
-
- /** Feature identifier: dynamic validation. */
- protected static final String DYNAMIC_VALIDATION =
- Constants.XERCES_FEATURE_PREFIX + Constants.DYNAMIC_VALIDATION_FEATURE;
-
- /** Feature identifier: balance syntax trees. */
- protected static final String BALANCE_SYNTAX_TREES =
- Constants.XERCES_FEATURE_PREFIX + Constants.BALANCE_SYNTAX_TREES;
-
- /** Feature identifier: warn on duplicate attdef */
- protected static final String WARN_ON_DUPLICATE_ATTDEF =
- Constants.XERCES_FEATURE_PREFIX + Constants.WARN_ON_DUPLICATE_ATTDEF_FEATURE;
-
- protected static final String PARSER_SETTINGS =
- Constants.XERCES_FEATURE_PREFIX + Constants.PARSER_SETTINGS;
-
-
-
- // property identifiers
-
- /** Property identifier: symbol table. */
- protected static final String SYMBOL_TABLE =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY;
-
- /** Property identifier: error reporter. */
- protected static final String ERROR_REPORTER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY;
-
- /** Property identifier: grammar pool. */
- protected static final String GRAMMAR_POOL =
- Constants.XERCES_PROPERTY_PREFIX + Constants.XMLGRAMMAR_POOL_PROPERTY;
-
- /** Property identifier: datatype validator factory. */
- protected static final String DATATYPE_VALIDATOR_FACTORY =
- Constants.XERCES_PROPERTY_PREFIX + Constants.DATATYPE_VALIDATOR_FACTORY_PROPERTY;
-
- // property identifier: ValidationManager
- protected static final String VALIDATION_MANAGER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.VALIDATION_MANAGER_PROPERTY;
-
- // recognized features and properties
-
- /** Recognized features. */
- private static final String[] RECOGNIZED_FEATURES = {
- NAMESPACES,
- VALIDATION,
- DYNAMIC_VALIDATION,
- BALANCE_SYNTAX_TREES
- };
-
- /** Feature defaults. */
- private static final Boolean[] FEATURE_DEFAULTS = {
- null,
- null,
- Boolean.FALSE,
- Boolean.FALSE,
- };
-
- /** Recognized properties. */
- private static final String[] RECOGNIZED_PROPERTIES = {
- SYMBOL_TABLE,
- ERROR_REPORTER,
- GRAMMAR_POOL,
- DATATYPE_VALIDATOR_FACTORY,
- VALIDATION_MANAGER
- };
-
- /** Property defaults. */
- private static final Object[] PROPERTY_DEFAULTS = {
- null,
- null,
- null,
- null,
- null,
- };
-
- // debugging
-
- /** Compile to true to debug attributes. */
- private static final boolean DEBUG_ATTRIBUTES = false;
-
- /** Compile to true to debug element children. */
- private static final boolean DEBUG_ELEMENT_CHILDREN = false;
-
- //
- // Data
- //
-
- // updated during reset
- protected ValidationManager fValidationManager = null;
-
- // validation state
- protected final ValidationState fValidationState = new ValidationState();
-
- // features
-
- /** Namespaces. */
- protected boolean fNamespaces;
-
- /** Validation. */
- protected boolean fValidation;
-
- /** Validation against only DTD */
- protected boolean fDTDValidation;
-
- /**
- * Dynamic validation. This state of this feature is only useful when
- * the validation feature is set to <code>true</code>.
- */
- protected boolean fDynamicValidation;
-
- /** Controls whether the DTD grammar produces balanced syntax trees. */
- protected boolean fBalanceSyntaxTrees;
-
- /** warn on duplicate attribute definition, this feature works only when validation is true */
- protected boolean fWarnDuplicateAttdef;
-
- // properties
-
- /** Symbol table. */
- protected SymbolTable fSymbolTable;
-
- /** Error reporter. */
- protected XMLErrorReporter fErrorReporter;
-
- // the grammar pool
- protected XMLGrammarPool fGrammarPool;
-
- /** Grammar bucket. */
- protected DTDGrammarBucket fGrammarBucket;
-
- /* location of the document as passed in from startDocument call */
- protected XMLLocator fDocLocation;
-
- /** Namespace support. */
- protected NamespaceContext fNamespaceContext = null;
-
- /** Datatype validator factory. */
- protected DTDDVFactory fDatatypeValidatorFactory;
-
- // handlers
-
- /** Document handler. */
- protected XMLDocumentHandler fDocumentHandler;
-
- protected XMLDocumentSource fDocumentSource;
- // grammars
-
- /** DTD Grammar. */
- protected DTDGrammar fDTDGrammar;
-
- // state
-
- /** True if seen DOCTYPE declaration. */
- protected boolean fSeenDoctypeDecl = false;
-
- /** Perform validation. */
- private boolean fPerformValidation;
-
- /** Schema type: None, DTD, Schema */
- private String fSchemaType;
-
- // information regarding the current element
-
- /** Current element name. */
- private final QName fCurrentElement = new QName();
-
- /** Current element index. */
- private int fCurrentElementIndex = -1;
-
- /** Current content spec type. */
- private int fCurrentContentSpecType = -1;
-
- /** The root element name. */
- private final QName fRootElement = new QName();
-
- private boolean fInCDATASection = false;
- // element stack
-
- /** Element index stack. */
- private int[] fElementIndexStack = new int[8];
-
- /** Content spec type stack. */
- private int[] fContentSpecTypeStack = new int[8];
-
- /** Element name stack. */
- private QName[] fElementQNamePartsStack = new QName[8];
-
- // children list and offset stack
-
- /**
- * Element children. This data structure is a growing stack that
- * holds the children of elements from the root to the current
- * element depth. This structure never gets "deeper" than the
- * deepest element. Space is re-used once each element is closed.
- * <p>
- * <strong>Note:</strong> This is much more efficient use of memory
- * than creating new arrays for each element depth.
- * <p>
- * <strong>Note:</strong> The use of this data structure is for
- * validation "on the way out". If the validation model changes to
- * "on the way in", then this data structure is not needed.
- */
- private QName[] fElementChildren = new QName[32];
-
- /** Element children count. */
- private int fElementChildrenLength = 0;
-
- /**
- * Element children offset stack. This stack refers to offsets
- * into the <code>fElementChildren</code> array.
- * @see #fElementChildren
- */
- private int[] fElementChildrenOffsetStack = new int[32];
-
- /** Element depth. */
- private int fElementDepth = -1;
-
- // validation states
-
- /** True if seen the root element. */
- private boolean fSeenRootElement = false;
-
- /** True if inside of element content. */
- private boolean fInElementContent = false;
-
- // temporary variables
-
- /** Temporary element declaration. */
- private XMLElementDecl fTempElementDecl = new XMLElementDecl();
-
- /** Temporary atribute declaration. */
- private final XMLAttributeDecl fTempAttDecl = new XMLAttributeDecl();
-
- /** Temporary entity declaration. */
- private final XMLEntityDecl fEntityDecl = new XMLEntityDecl();
-
- /** Temporary qualified name. */
- private final QName fTempQName = new QName();
-
- /** Temporary string buffers. */
- private final StringBuffer fBuffer = new StringBuffer();
-
- // symbols: general
-
- // attribute validators
-
- /** Datatype validator: ID. */
- protected DatatypeValidator fValID;
-
- /** Datatype validator: IDREF. */
- protected DatatypeValidator fValIDRef;
-
- /** Datatype validator: IDREFS. */
- protected DatatypeValidator fValIDRefs;
-
- /** Datatype validator: ENTITY. */
- protected DatatypeValidator fValENTITY;
-
- /** Datatype validator: ENTITIES. */
- protected DatatypeValidator fValENTITIES;
-
- /** Datatype validator: NMTOKEN. */
- protected DatatypeValidator fValNMTOKEN;
-
- /** Datatype validator: NMTOKENS. */
- protected DatatypeValidator fValNMTOKENS;
-
- /** Datatype validator: NOTATION. */
- protected DatatypeValidator fValNOTATION;
-
- // to check for duplicate ID or ANNOTATION attribute declare in
- // ATTLIST, and misc VCs
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- public XMLDTDValidator() {
-
- // initialize data
- for (int i = 0; i < fElementQNamePartsStack.length; i++) {
- fElementQNamePartsStack[i] = new QName();
- }
- fGrammarBucket = new DTDGrammarBucket();
-
- } // <init>()
-
- DTDGrammarBucket getGrammarBucket() {
- return fGrammarBucket;
- } // getGrammarBucket(): DTDGrammarBucket
-
- //
- // XMLComponent methods
- //
-
- /*
- * Resets the component. The component can query the component manager
- * about any features and properties that affect the operation of the
- * component.
- *
- * @param componentManager The component manager.
- *
- * @throws SAXException Thrown by component on finitialization error.
- * For example, if a feature or property is
- * required for the operation of the component, the
- * component manager may throw a
- * SAXNotRecognizedException or a
- * SAXNotSupportedException.
- */
- public void reset(XMLComponentManager componentManager)
- throws XMLConfigurationException {
-
- // clear grammars
- fDTDGrammar = null;
- fSeenDoctypeDecl = false;
- fInCDATASection = false;
- // initialize state
- fSeenRootElement = false;
- fInElementContent = false;
- fCurrentElementIndex = -1;
- fCurrentContentSpecType = -1;
-
- fRootElement.clear();
-
- fValidationState.resetIDTables();
-
- fGrammarBucket.clear();
- fElementDepth = -1;
- fElementChildrenLength = 0;
-
- boolean parser_settings = componentManager.getFeature(PARSER_SETTINGS, true);
-
- if (!parser_settings){
- // parser settings have not been changed
- fValidationManager.addValidationState(fValidationState);
- return;
- }
-
- // sax features
- fNamespaces = componentManager.getFeature(NAMESPACES, true);
- fValidation = componentManager.getFeature(VALIDATION, false);
- fDTDValidation = !(componentManager.getFeature(Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_VALIDATION_FEATURE, false));
-
- // Xerces features
- fDynamicValidation = componentManager.getFeature(DYNAMIC_VALIDATION, false);
- fBalanceSyntaxTrees = componentManager.getFeature(BALANCE_SYNTAX_TREES, false);
- fWarnDuplicateAttdef = componentManager.getFeature(WARN_ON_DUPLICATE_ATTDEF, false);
-
- fSchemaType = (String)componentManager.getProperty (Constants.JAXP_PROPERTY_PREFIX
- + Constants.SCHEMA_LANGUAGE, null);
-
- fValidationManager= (ValidationManager)componentManager.getProperty(VALIDATION_MANAGER);
- fValidationManager.addValidationState(fValidationState);
- fValidationState.setUsingNamespaces(fNamespaces);
-
- // get needed components
- fErrorReporter = (XMLErrorReporter)componentManager.getProperty(Constants.XERCES_PROPERTY_PREFIX+Constants.ERROR_REPORTER_PROPERTY);
- fSymbolTable = (SymbolTable)componentManager.getProperty(Constants.XERCES_PROPERTY_PREFIX+Constants.SYMBOL_TABLE_PROPERTY);
- fGrammarPool= (XMLGrammarPool)componentManager.getProperty(GRAMMAR_POOL, null);
-
- fDatatypeValidatorFactory = (DTDDVFactory)componentManager.getProperty(Constants.XERCES_PROPERTY_PREFIX + Constants.DATATYPE_VALIDATOR_FACTORY_PROPERTY);
- init();
-
- } // reset(XMLComponentManager)
-
- /**
- * Returns a list of feature identifiers that are recognized by
- * this component. This method may return null if no features
- * are recognized by this component.
- */
- public String[] getRecognizedFeatures() {
- return (String[])(RECOGNIZED_FEATURES.clone());
- } // getRecognizedFeatures():String[]
-
- /**
- * Sets the state of a feature. This method is called by the component
- * manager any time after reset when a feature changes state.
- * <p>
- * <strong>Note:</strong> Components should silently ignore features
- * that do not affect the operation of the component.
- *
- * @param featureId The feature identifier.
- * @param state The state of the feature.
- *
- * @throws SAXNotRecognizedException The component should not throw
- * this exception.
- * @throws SAXNotSupportedException The component should not throw
- * this exception.
- */
- public void setFeature(String featureId, boolean state)
- throws XMLConfigurationException {
- } // setFeature(String,boolean)
-
- /**
- * Returns a list of property identifiers that are recognized by
- * this component. This method may return null if no properties
- * are recognized by this component.
- */
- public String[] getRecognizedProperties() {
- return (String[])(RECOGNIZED_PROPERTIES.clone());
- } // getRecognizedProperties():String[]
-
- /**
- * Sets the value of a property. This method is called by the component
- * manager any time after reset when a property changes value.
- * <p>
- * <strong>Note:</strong> Components should silently ignore properties
- * that do not affect the operation of the component.
- *
- * @param propertyId The property identifier.
- * @param value The value of the property.
- *
- * @throws SAXNotRecognizedException The component should not throw
- * this exception.
- * @throws SAXNotSupportedException The component should not throw
- * this exception.
- */
- public void setProperty(String propertyId, Object value)
- throws XMLConfigurationException {
- } // setProperty(String,Object)
-
- /**
- * Returns the default state for a feature, or null if this
- * component does not want to report a default value for this
- * feature.
- *
- * @param featureId The feature identifier.
- *
- * @since Xerces 2.2.0
- */
- public Boolean getFeatureDefault(String featureId) {
- for (int i = 0; i < RECOGNIZED_FEATURES.length; i++) {
- if (RECOGNIZED_FEATURES[i].equals(featureId)) {
- return FEATURE_DEFAULTS[i];
- }
- }
- return null;
- } // getFeatureDefault(String):Boolean
-
- /**
- * Returns the default state for a property, or null if this
- * component does not want to report a default value for this
- * property.
- *
- * @param propertyId The property identifier.
- *
- * @since Xerces 2.2.0
- */
- public Object getPropertyDefault(String propertyId) {
- for (int i = 0; i < RECOGNIZED_PROPERTIES.length; i++) {
- if (RECOGNIZED_PROPERTIES[i].equals(propertyId)) {
- return PROPERTY_DEFAULTS[i];
- }
- }
- return null;
- } // getPropertyDefault(String):Object
-
- //
- // XMLDocumentSource methods
- //
-
- /** Sets the document handler to receive information about the document. */
- public void setDocumentHandler(XMLDocumentHandler documentHandler) {
- fDocumentHandler = documentHandler;
- } // setDocumentHandler(XMLDocumentHandler)
-
- /** Returns the document handler */
- public XMLDocumentHandler getDocumentHandler() {
- return fDocumentHandler;
- } // getDocumentHandler(): XMLDocumentHandler
-
-
- //
- // XMLDocumentHandler methods
- //
-
- /** Sets the document source */
- public void setDocumentSource(XMLDocumentSource source){
- fDocumentSource = source;
- } // setDocumentSource
-
- /** Returns the document source */
- public XMLDocumentSource getDocumentSource (){
- return fDocumentSource;
- } // getDocumentSource
-
- /**
- * The start of the document.
- *
- * @param locator The system identifier of the entity if the entity
- * is external, null otherwise.
- * @param encoding The auto-detected IANA encoding name of the entity
- * stream. This value will be null in those situations
- * where the entity encoding is not auto-detected (e.g.
- * internal entities or a document entity that is
- * parsed from a java.io.Reader).
- * @param namespaceContext
- * The namespace context in effect at the
- * start of this document.
- * This object represents the current context.
- * Implementors of this class are responsible
- * for copying the namespace bindings from the
- * the current context (and its parent contexts)
- * if that information is important.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startDocument(XMLLocator locator, String encoding,
- NamespaceContext namespaceContext, Augmentations augs)
- throws XNIException {
-
- // call handlers
- // get initial grammars
- if (fGrammarPool != null) {
- Grammar [] grammars = fGrammarPool.retrieveInitialGrammarSet(XMLGrammarDescription.XML_DTD);
- final int length = (grammars != null) ? grammars.length : 0;
- for (int i = 0; i < length; ++i) {
- fGrammarBucket.putGrammar((DTDGrammar)grammars[i]);
- }
- }
- fDocLocation = locator;
- fNamespaceContext = namespaceContext;
-
- if (fDocumentHandler != null) {
- fDocumentHandler.startDocument(locator, encoding, namespaceContext, augs);
- }
-
- } // startDocument(XMLLocator,String)
-
- /**
- * Notifies of the presence of an XMLDecl line in the document. If
- * present, this method will be called immediately following the
- * startDocument call.
- *
- * @param version The XML version.
- * @param encoding The IANA encoding name of the document, or null if
- * not specified.
- * @param standalone The standalone value, or null if not specified.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void xmlDecl(String version, String encoding, String standalone, Augmentations augs)
- throws XNIException {
-
- // save standalone state
- fGrammarBucket.setStandalone(standalone != null && standalone.equals("yes"));
-
- // call handlers
- if (fDocumentHandler != null) {
- fDocumentHandler.xmlDecl(version, encoding, standalone, augs);
- }
-
- } // xmlDecl(String,String,String)
-
- /**
- * Notifies of the presence of the DOCTYPE line in the document.
- *
- * @param rootElement The name of the root element.
- * @param publicId The public identifier if an external DTD or null
- * if the external DTD is specified using SYSTEM.
- * @param systemId The system identifier if an external DTD, null
- * otherwise.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void doctypeDecl(String rootElement, String publicId, String systemId,
- Augmentations augs)
- throws XNIException {
-
- // save root element state
- fSeenDoctypeDecl = true;
- fRootElement.setValues(null, rootElement, rootElement, null);
- // find or create grammar:
- String eid = null;
- try {
- eid = XMLEntityManager.expandSystemId(systemId, fDocLocation.getExpandedSystemId(), false);
- } catch (java.io.IOException e) {
- }
- XMLDTDDescription grammarDesc = new XMLDTDDescription(publicId, systemId, fDocLocation.getExpandedSystemId(), eid, rootElement);
- fDTDGrammar = fGrammarBucket.getGrammar(grammarDesc);
- if(fDTDGrammar == null) {
- // give grammar pool a chance...
- //
- // Do not bother checking the pool if no public or system identifier was provided.
- // Since so many different DTDs have roots in common, using only a root name as the
- // key may cause an unexpected grammar to be retrieved from the grammar pool. This scenario
- // would occur when an ExternalSubsetResolver has been queried and the
- // XMLInputSource returned contains an input stream but no external identifier.
- // This can never happen when the instance document specified a DOCTYPE. -- mrglavas
- if (fGrammarPool != null && (systemId != null || publicId != null)) {
- fDTDGrammar = (DTDGrammar)fGrammarPool.retrieveGrammar(grammarDesc);
- }
- }
- if(fDTDGrammar == null) {
- // we'll have to create it...
- if (!fBalanceSyntaxTrees) {
- fDTDGrammar = new DTDGrammar(fSymbolTable, grammarDesc);
- }
- else {
- fDTDGrammar = new BalancedDTDGrammar(fSymbolTable, grammarDesc);
- }
- } else {
- // we've found a cached one;so let's make sure not to read
- // any external subset!
- fValidationManager.setCachedDTD(true);
- }
- fGrammarBucket.setActiveGrammar(fDTDGrammar);
-
- // call handlers
- if (fDocumentHandler != null) {
- fDocumentHandler.doctypeDecl(rootElement, publicId, systemId, augs);
- }
-
- } // doctypeDecl(String,String,String, Augmentations)
-
-
- /**
- * The start of an element.
- *
- * @param element The name of the element.
- * @param attributes The element attributes.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startElement(QName element, XMLAttributes attributes, Augmentations augs)
- throws XNIException {
-
- handleStartElement(element, attributes, augs);
- // call handlers
- if (fDocumentHandler != null) {
- fDocumentHandler.startElement(element, attributes, augs);
-
- }
-
- } // startElement(QName,XMLAttributes)
-
- /**
- * An empty element.
- *
- * @param element The name of the element.
- * @param attributes The element attributes.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void emptyElement(QName element, XMLAttributes attributes, Augmentations augs)
- throws XNIException {
-
- boolean removed = handleStartElement(element, attributes, augs);
-
- if (fDocumentHandler !=null) {
- fDocumentHandler.emptyElement(element, attributes, augs);
- }
- if (!removed) {
- handleEndElement(element, augs, true);
- }
-
-
- } // emptyElement(QName,XMLAttributes)
-
- /**
- * Character content.
- *
- * @param text The content.
- *
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void characters(XMLString text, Augmentations augs) throws XNIException {
-
- boolean callNextCharacters = true;
-
- // REVISIT: [Q] Is there a more efficient way of doing this?
- // Perhaps if the scanner told us so we don't have to
- // look at the characters again. -Ac
- boolean allWhiteSpace = true;
- for (int i=text.offset; i< text.offset+text.length; i++) {
- if (!isSpace(text.ch[i])) {
- allWhiteSpace = false;
- break;
- }
- }
- // call the ignoreableWhiteSpace callback
- // never call ignorableWhitespace if we are in cdata section
- if (fInElementContent && allWhiteSpace && !fInCDATASection) {
- if (fDocumentHandler != null) {
- fDocumentHandler.ignorableWhitespace(text, augs);
- callNextCharacters = false;
- }
- }
-
- // validate
- if (fPerformValidation) {
- if (fInElementContent) {
- if (fGrammarBucket.getStandalone() &&
- fDTDGrammar.getElementDeclIsExternal(fCurrentElementIndex)) {
- if (allWhiteSpace) {
- fErrorReporter.reportError( XMLMessageFormatter.XML_DOMAIN,
- "MSG_WHITE_SPACE_IN_ELEMENT_CONTENT_WHEN_STANDALONE",
- null, XMLErrorReporter.SEVERITY_ERROR);
- }
- }
- if (!allWhiteSpace) {
- charDataInContent();
- }
-
- // For E15.2
- if (augs != null && augs.getItem(Constants.CHAR_REF_PROBABLE_WS) == Boolean.TRUE) {
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "MSG_CONTENT_INVALID_SPECIFIED",
- new Object[]{ fCurrentElement.rawname,
- fDTDGrammar.getContentSpecAsString(fElementDepth),
- "character reference"},
- XMLErrorReporter.SEVERITY_ERROR);
- }
- }
-
- if (fCurrentContentSpecType == XMLElementDecl.TYPE_EMPTY) {
- charDataInContent();
- }
- }
-
- // call handlers
- if (callNextCharacters && fDocumentHandler != null) {
- fDocumentHandler.characters(text, augs);
- }
-
- } // characters(XMLString)
-
-
-
- /**
- * Ignorable whitespace. For this method to be called, the document
- * source must have some way of determining that the text containing
- * only whitespace characters should be considered ignorable. For
- * example, the validator can determine if a length of whitespace
- * characters in the document are ignorable based on the element
- * content model.
- *
- * @param text The ignorable whitespace.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void ignorableWhitespace(XMLString text, Augmentations augs) throws XNIException {
-
- // call handlers
- if (fDocumentHandler != null) {
- fDocumentHandler.ignorableWhitespace(text, augs);
- }
-
- } // ignorableWhitespace(XMLString)
-
- /**
- * The end of an element.
- *
- * @param element The name of the element.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endElement(QName element, Augmentations augs) throws XNIException {
-
- handleEndElement(element, augs, false);
-
- } // endElement(QName)
-
- /**
- * The start of a CDATA section.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startCDATA(Augmentations augs) throws XNIException {
-
- if (fPerformValidation && fInElementContent) {
- charDataInContent();
- }
- fInCDATASection = true;
- // call handlers
- if (fDocumentHandler != null) {
- fDocumentHandler.startCDATA(augs);
- }
-
- } // startCDATA()
-
- /**
- * The end of a CDATA section.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endCDATA(Augmentations augs) throws XNIException {
-
- fInCDATASection = false;
- // call handlers
- if (fDocumentHandler != null) {
- fDocumentHandler.endCDATA(augs);
- }
-
- } // endCDATA()
-
- /**
- * The end of the document.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endDocument(Augmentations augs) throws XNIException {
-
- // call handlers
- if (fDocumentHandler != null) {
- fDocumentHandler.endDocument(augs);
- }
-
- } // endDocument()
-
- /**
- * A comment.
- *
- * @param text The text in the comment.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by application to signal an error.
- */
- public void comment(XMLString text, Augmentations augs) throws XNIException {
- // fixes E15.1
- if (fPerformValidation && fElementDepth >= 0 && fDTDGrammar != null) {
- fDTDGrammar.getElementDecl(fCurrentElementIndex, fTempElementDecl);
- if (fTempElementDecl.type == XMLElementDecl.TYPE_EMPTY) {
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "MSG_CONTENT_INVALID_SPECIFIED",
- new Object[]{ fCurrentElement.rawname,
- "EMPTY",
- "comment"},
- XMLErrorReporter.SEVERITY_ERROR);
- }
- }
- // call handlers
- if (fDocumentHandler != null) {
- fDocumentHandler.comment(text, augs);
- }
-
- } // comment(XMLString)
-
-
- /**
- * A processing instruction. Processing instructions consist of a
- * target name and, optionally, text data. The data is only meaningful
- * to the application.
- * <p>
- * Typically, a processing instruction's data will contain a series
- * of pseudo-attributes. These pseudo-attributes follow the form of
- * element attributes but are <strong>not</strong> parsed or presented
- * to the application as anything other than text. The application is
- * responsible for parsing the data.
- *
- * @param target The target.
- * @param data The data or null if none specified.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void processingInstruction(String target, XMLString data, Augmentations augs)
- throws XNIException {
-
- // fixes E15.1
- if (fPerformValidation && fElementDepth >= 0 && fDTDGrammar != null) {
- fDTDGrammar.getElementDecl(fCurrentElementIndex, fTempElementDecl);
- if (fTempElementDecl.type == XMLElementDecl.TYPE_EMPTY) {
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "MSG_CONTENT_INVALID_SPECIFIED",
- new Object[]{ fCurrentElement.rawname,
- "EMPTY",
- "processing instruction"},
- XMLErrorReporter.SEVERITY_ERROR);
- }
- }
- // call handlers
- if (fDocumentHandler != null) {
- fDocumentHandler.processingInstruction(target, data, augs);
- }
- } // processingInstruction(String,XMLString)
-
- /**
- * This method notifies the start of a general entity.
- * <p>
- * <strong>Note:</strong> This method is not called for entity references
- * appearing as part of attribute values.
- *
- * @param name The name of the general entity.
- * @param identifier The resource identifier.
- * @param encoding The auto-detected IANA encoding name of the entity
- * stream. This value will be null in those situations
- * where the entity encoding is not auto-detected (e.g.
- * internal entities or a document entity that is
- * parsed from a java.io.Reader).
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException Thrown by handler to signal an error.
- */
- public void startGeneralEntity(String name,
- XMLResourceIdentifier identifier,
- String encoding,
- Augmentations augs) throws XNIException {
- if (fPerformValidation && fElementDepth >= 0 && fDTDGrammar != null) {
- fDTDGrammar.getElementDecl(fCurrentElementIndex, fTempElementDecl);
- // fixes E15.1
- if (fTempElementDecl.type == XMLElementDecl.TYPE_EMPTY) {
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "MSG_CONTENT_INVALID_SPECIFIED",
- new Object[]{ fCurrentElement.rawname,
- "EMPTY", "ENTITY"},
- XMLErrorReporter.SEVERITY_ERROR);
- }
- if (fGrammarBucket.getStandalone()) {
- XMLDTDLoader.checkStandaloneEntityRef(name, fDTDGrammar, fEntityDecl, fErrorReporter);
- }
- }
- if (fDocumentHandler != null) {
- fDocumentHandler.startGeneralEntity(name, identifier, encoding, augs);
- }
- }
-
- /**
- * This method notifies the end of a general entity.
- * <p>
- * <strong>Note:</strong> This method is not called for entity references
- * appearing as part of attribute values.
- *
- * @param name The name of the entity.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void endGeneralEntity(String name, Augmentations augs) throws XNIException {
- // call handlers
- if (fDocumentHandler != null) {
- fDocumentHandler.endGeneralEntity(name, augs);
- }
- } // endEntity(String)
-
- /**
- * Notifies of the presence of a TextDecl line in an entity. If present,
- * this method will be called immediately following the startParameterEntity call.
- * <p>
- * <strong>Note:</strong> This method is only called for external
- * parameter entities referenced in the DTD.
- *
- * @param version The XML version, or null if not specified.
- * @param encoding The IANA encoding name of the entity.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void textDecl(String version, String encoding, Augmentations augs) throws XNIException {
-
- // call handlers
- if (fDocumentHandler != null) {
- fDocumentHandler.textDecl(version, encoding, augs);
- }
- }
-
-
- public final boolean hasGrammar(){
-
- return (fDTDGrammar != null);
- }
-
- public final boolean validate(){
- // Do validation if all of the following are true:
- // 1. The JAXP Schema Language property is not XML Schema
- // REVISIT: since only DTD and Schema are supported at this time,
- // such checking is sufficient. but if more schema types
- // are introduced in the future, we'll need to change it
- // to something like
- // (fSchemaType == null || fSchemaType == NS_XML_DTD)
- // 2. One of the following is true (validation features)
- // 2.1 Dynamic validation is off, and validation is on
- // 2.2 Dynamic validation is on, and DOCTYPE was seen
- // 3 Xerces schema validation feature is off, or DOCTYPE was seen.
- return (fSchemaType != Constants.NS_XMLSCHEMA) &&
- (!fDynamicValidation && fValidation ||
- fDynamicValidation && fSeenDoctypeDecl) &&
- (fDTDValidation || fSeenDoctypeDecl);
- }
-
- //REVISIT:we can convert into functions.. adding default attribute values.. and one validating.
-
- /** Add default attributes and validate. */
- protected void addDTDDefaultAttrsAndValidate(QName elementName, int elementIndex,
- XMLAttributes attributes)
- throws XNIException {
-
- // is there anything to do?
- if (elementIndex == -1 || fDTDGrammar == null) {
- return;
- }
-
- //
- // Check after all specified attrs are scanned
- // (1) report error for REQUIRED attrs that are missing (V_TAGc)
- // (2) add default attrs (FIXED and NOT_FIXED)
- //
- int attlistIndex = fDTDGrammar.getFirstAttributeDeclIndex(elementIndex);
-
- while (attlistIndex != -1) {
-
- fDTDGrammar.getAttributeDecl(attlistIndex, fTempAttDecl);
-
- if (DEBUG_ATTRIBUTES) {
- if (fTempAttDecl != null) {
- XMLElementDecl elementDecl = new XMLElementDecl();
- fDTDGrammar.getElementDecl(elementIndex, elementDecl);
- System.out.println("element: "+(elementDecl.name.localpart));
- System.out.println("attlistIndex " + attlistIndex + "\n"+
- "attName : '"+(fTempAttDecl.name.localpart) + "'\n"
- + "attType : "+fTempAttDecl.simpleType.type + "\n"
- + "attDefaultType : "+fTempAttDecl.simpleType.defaultType + "\n"
- + "attDefaultValue : '"+fTempAttDecl.simpleType.defaultValue + "'\n"
- + attributes.getLength() +"\n"
- );
- }
- }
- String attPrefix = fTempAttDecl.name.prefix;
- String attLocalpart = fTempAttDecl.name.localpart;
- String attRawName = fTempAttDecl.name.rawname;
- String attType = getAttributeTypeName(fTempAttDecl);
- int attDefaultType =fTempAttDecl.simpleType.defaultType;
- String attValue = null;
-
- if (fTempAttDecl.simpleType.defaultValue != null) {
- attValue = fTempAttDecl.simpleType.defaultValue;
- }
-
- boolean specified = false;
- boolean required = attDefaultType == XMLSimpleType.DEFAULT_TYPE_REQUIRED;
- boolean cdata = attType == XMLSymbols.fCDATASymbol;
-
- if (!cdata || required || attValue != null) {
- int attrCount = attributes.getLength();
- for (int i = 0; i < attrCount; i++) {
- if (attributes.getQName(i) == attRawName) {
- specified = true;
- break;
- }
- }
- }
-
- if (!specified) {
- if (required) {
- if (fPerformValidation) {
- Object[] args = {elementName.localpart, attRawName};
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "MSG_REQUIRED_ATTRIBUTE_NOT_SPECIFIED", args,
- XMLErrorReporter.SEVERITY_ERROR);
- }
- }
- else if (attValue != null) {
- if (fPerformValidation && fGrammarBucket.getStandalone()) {
- if (fDTDGrammar.getAttributeDeclIsExternal(attlistIndex)) {
-
- Object[] args = { elementName.localpart, attRawName};
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "MSG_DEFAULTED_ATTRIBUTE_NOT_SPECIFIED", args,
- XMLErrorReporter.SEVERITY_ERROR);
- }
- }
-
- // add namespace information
- if (fNamespaces) {
- int index = attRawName.indexOf(':');
- if (index != -1) {
- attPrefix = attRawName.substring(0, index);
- attPrefix = fSymbolTable.addSymbol(attPrefix);
- attLocalpart = attRawName.substring(index + 1);
- attLocalpart = fSymbolTable.addSymbol(attLocalpart);
- }
- }
-
- // add attribute
- fTempQName.setValues(attPrefix, attLocalpart, attRawName, fTempAttDecl.name.uri);
- int newAttr = attributes.addAttribute(fTempQName, attType, attValue);
- }
- }
- // get next att decl in the Grammar for this element
- attlistIndex = fDTDGrammar.getNextAttributeDeclIndex(attlistIndex);
- }
-
- // now iterate through the expanded attributes for
- // 1. if every attribute seen is declared in the DTD
- // 2. check if the VC: default_fixed holds
- // 3. validate every attribute.
- int attrCount = attributes.getLength();
- for (int i = 0; i < attrCount; i++) {
- String attrRawName = attributes.getQName(i);
- boolean declared = false;
- if (fPerformValidation) {
- if (fGrammarBucket.getStandalone()) {
- // check VC: Standalone Document Declaration, entities
- // references appear in the document.
- // REVISIT: this can be combined to a single check in
- // startEntity if we add one more argument in
- // startEnity, inAttrValue
- String nonNormalizedValue = attributes.getNonNormalizedValue(i);
- if (nonNormalizedValue != null) {
- String entityName = getExternalEntityRefInAttrValue(nonNormalizedValue);
- if (entityName != null) {
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "MSG_REFERENCE_TO_EXTERNALLY_DECLARED_ENTITY_WHEN_STANDALONE",
- new Object[]{entityName},
- XMLErrorReporter.SEVERITY_ERROR);
- }
- }
- }
- }
- int attDefIndex = -1;
- int position =
- fDTDGrammar.getFirstAttributeDeclIndex(elementIndex);
- while (position != -1) {
- fDTDGrammar.getAttributeDecl(position, fTempAttDecl);
- if (fTempAttDecl.name.rawname == attrRawName) {
- // found the match att decl,
- attDefIndex = position;
- declared = true;
- break;
- }
- position = fDTDGrammar.getNextAttributeDeclIndex(position);
- }
- if (!declared) {
- if (fPerformValidation) {
- // REVISIT - cache the elem/attr tuple so that we only
- // give this error once for each unique occurrence
- Object[] args = { elementName.rawname, attrRawName};
-
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "MSG_ATTRIBUTE_NOT_DECLARED",
- args,XMLErrorReporter.SEVERITY_ERROR);
- }
- continue;
- }
- // attribute is declared
-
- // fTempAttDecl should have the right value set now, so
- // the following is not needed
- // fGrammar.getAttributeDecl(attDefIndex,fTempAttDecl);
-
- String type = getAttributeTypeName(fTempAttDecl);
- attributes.setType(i, type);
- attributes.getAugmentations(i).putItem(Constants.ATTRIBUTE_DECLARED, Boolean.TRUE);
-
- boolean changedByNormalization = false;
- String oldValue = attributes.getValue(i);
- String attrValue = oldValue;
- if (attributes.isSpecified(i) && type != XMLSymbols.fCDATASymbol) {
- changedByNormalization = normalizeAttrValue(attributes, i);
- attrValue = attributes.getValue(i);
- if (fPerformValidation && fGrammarBucket.getStandalone()
- && changedByNormalization
- && fDTDGrammar.getAttributeDeclIsExternal(position)
- ) {
- // check VC: Standalone Document Declaration
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "MSG_ATTVALUE_CHANGED_DURING_NORMALIZATION_WHEN_STANDALONE",
- new Object[]{attrRawName, oldValue, attrValue},
- XMLErrorReporter.SEVERITY_ERROR);
- }
- }
- if (!fPerformValidation) {
- continue;
- }
- if (fTempAttDecl.simpleType.defaultType ==
- XMLSimpleType.DEFAULT_TYPE_FIXED) {
- String defaultValue = fTempAttDecl.simpleType.defaultValue;
-
- if (!attrValue.equals(defaultValue)) {
- Object[] args = {elementName.localpart,
- attrRawName,
- attrValue,
- defaultValue};
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "MSG_FIXED_ATTVALUE_INVALID",
- args, XMLErrorReporter.SEVERITY_ERROR);
- }
- }
-
- if (fTempAttDecl.simpleType.type == XMLSimpleType.TYPE_ENTITY ||
- fTempAttDecl.simpleType.type == XMLSimpleType.TYPE_ENUMERATION ||
- fTempAttDecl.simpleType.type == XMLSimpleType.TYPE_ID ||
- fTempAttDecl.simpleType.type == XMLSimpleType.TYPE_IDREF ||
- fTempAttDecl.simpleType.type == XMLSimpleType.TYPE_NMTOKEN ||
- fTempAttDecl.simpleType.type == XMLSimpleType.TYPE_NOTATION
- ) {
- validateDTDattribute(elementName, attrValue, fTempAttDecl);
- }
- } // for all attributes
-
- } // addDTDDefaultAttrsAndValidate(int,XMLAttrList)
-
- /** Checks entities in attribute values for standalone VC. */
- protected String getExternalEntityRefInAttrValue(String nonNormalizedValue) {
- int valLength = nonNormalizedValue.length();
- int ampIndex = nonNormalizedValue.indexOf('&');
- while (ampIndex != -1) {
- if (ampIndex + 1 < valLength &&
- nonNormalizedValue.charAt(ampIndex+1) != '#') {
- int semicolonIndex = nonNormalizedValue.indexOf(';', ampIndex+1);
- String entityName = nonNormalizedValue.substring(ampIndex+1, semicolonIndex);
- entityName = fSymbolTable.addSymbol(entityName);
- int entIndex = fDTDGrammar.getEntityDeclIndex(entityName);
- if (entIndex > -1) {
- fDTDGrammar.getEntityDecl(entIndex, fEntityDecl);
- if (fEntityDecl.inExternal ||
- (entityName = getExternalEntityRefInAttrValue(fEntityDecl.value)) != null) {
- return entityName;
- }
- }
- }
- ampIndex = nonNormalizedValue.indexOf('&', ampIndex+1);
- }
- return null;
- } // isExternalEntityRefInAttrValue(String):String
-
- /**
- * Validate attributes in DTD fashion.
- */
- protected void validateDTDattribute(QName element, String attValue,
- XMLAttributeDecl attributeDecl)
- throws XNIException {
-
- switch (attributeDecl.simpleType.type) {
- case XMLSimpleType.TYPE_ENTITY: {
- // NOTE: Save this information because invalidStandaloneAttDef
- boolean isAlistAttribute = attributeDecl.simpleType.list;
-
- try {
- if (isAlistAttribute) {
- fValENTITIES.validate(attValue, fValidationState);
- }
- else {
- fValENTITY.validate(attValue, fValidationState);
- }
- }
- catch (InvalidDatatypeValueException ex) {
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- ex.getKey(),
- ex.getArgs(),
- XMLErrorReporter.SEVERITY_ERROR );
-
- }
- break;
- }
-
- case XMLSimpleType.TYPE_NOTATION:
- case XMLSimpleType.TYPE_ENUMERATION: {
- boolean found = false;
- String [] enumVals = attributeDecl.simpleType.enumeration;
- if (enumVals == null) {
- found = false;
- }
- else
- for (int i = 0; i < enumVals.length; i++) {
- if (attValue == enumVals[i] || attValue.equals(enumVals[i])) {
- found = true;
- break;
- }
- }
-
- if (!found) {
- StringBuffer enumValueString = new StringBuffer();
- if (enumVals != null)
- for (int i = 0; i < enumVals.length; i++) {
- enumValueString.append(enumVals[i]+" ");
- }
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "MSG_ATTRIBUTE_VALUE_NOT_IN_LIST",
- new Object[]{attributeDecl.name.rawname, attValue, enumValueString},
- XMLErrorReporter.SEVERITY_ERROR);
- }
- break;
- }
-
- case XMLSimpleType.TYPE_ID: {
- try {
- fValID.validate(attValue, fValidationState);
- }
- catch (InvalidDatatypeValueException ex) {
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- ex.getKey(),
- ex.getArgs(),
- XMLErrorReporter.SEVERITY_ERROR );
- }
- break;
- }
-
- case XMLSimpleType.TYPE_IDREF: {
- boolean isAlistAttribute = attributeDecl.simpleType.list;//Caveat - Save this information because invalidStandaloneAttDef
-
- try {
- if (isAlistAttribute) {
- fValIDRefs.validate(attValue, fValidationState);
- }
- else {
- fValIDRef.validate(attValue, fValidationState);
- }
- }
- catch (InvalidDatatypeValueException ex) {
- if (isAlistAttribute) {
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "IDREFSInvalid",
- new Object[]{attValue},
- XMLErrorReporter.SEVERITY_ERROR );
- }
- else {
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- ex.getKey(),
- ex.getArgs(),
- XMLErrorReporter.SEVERITY_ERROR );
- }
-
- }
- break;
- }
-
- case XMLSimpleType.TYPE_NMTOKEN: {
- boolean isAlistAttribute = attributeDecl.simpleType.list;//Caveat - Save this information because invalidStandaloneAttDef
- //changes fTempAttDef
- try {
- if (isAlistAttribute) {
- fValNMTOKENS.validate(attValue, fValidationState);
- }
- else {
- fValNMTOKEN.validate(attValue, fValidationState);
- }
- }
- catch (InvalidDatatypeValueException ex) {
- if (isAlistAttribute) {
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "NMTOKENSInvalid",
- new Object[] { attValue},
- XMLErrorReporter.SEVERITY_ERROR);
- }
- else {
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "NMTOKENInvalid",
- new Object[] { attValue},
- XMLErrorReporter.SEVERITY_ERROR);
- }
- }
- break;
- }
-
- } // switch
-
- } // validateDTDattribute(QName,String,XMLAttributeDecl)
-
-
- /** Returns true if invalid standalone attribute definition. */
- protected boolean invalidStandaloneAttDef(QName element, QName attribute) {
- // REVISIT: This obviously needs to be fixed! -Ac
- boolean state = true;
- /*
- if (fStandaloneReader == -1) {
- return false;
- }
- // we are normalizing a default att value... this ok?
- if (element.rawname == -1) {
- return false;
- }
- return getAttDefIsExternal(element, attribute);
- */
- return state;
- }
-
-
- //
- // Private methods
- //
-
-
- /**
- * Normalize the attribute value of a non CDATA attributes collapsing
- * sequences of space characters (x20)
- *
- * @param attributes The list of attributes
- * @param index The index of the attribute to normalize
- */
- private boolean normalizeAttrValue(XMLAttributes attributes, int index) {
- // vars
- boolean leadingSpace = true;
- boolean spaceStart = false;
- boolean readingNonSpace = false;
- int count = 0;
- int eaten = 0;
- String attrValue = attributes.getValue(index);
- char[] attValue = new char[attrValue.length()];
-
- fBuffer.setLength(0);
- attrValue.getChars(0, attrValue.length(), attValue, 0);
- for (int i = 0; i < attValue.length; i++) {
-
- if (attValue[i] == ' ') {
-
- // now the tricky part
- if (readingNonSpace) {
- spaceStart = true;
- readingNonSpace = false;
- }
-
- if (spaceStart && !leadingSpace) {
- spaceStart = false;
- fBuffer.append(attValue[i]);
- count++;
- }
- else {
- if (leadingSpace || !spaceStart) {
- eaten ++;
- /*** BUG #3512 ***
- int entityCount = attributes.getEntityCount(index);
- for (int j = 0; j < entityCount; j++) {
- int offset = attributes.getEntityOffset(index, j);
- int length = attributes.getEntityLength(index, j);
- if (offset <= i-eaten+1) {
- if (offset+length >= i-eaten+1) {
- if (length > 0)
- length--;
- }
- }
- else {
- if (offset > 0)
- offset--;
- }
- attributes.setEntityOffset(index, j, offset);
- attributes.setEntityLength(index, j, length);
- }
- /***/
- }
- }
-
- }
- else {
- readingNonSpace = true;
- spaceStart = false;
- leadingSpace = false;
- fBuffer.append(attValue[i]);
- count++;
- }
- }
-
- // check if the last appended character is a space.
- if (count > 0 && fBuffer.charAt(count-1) == ' ') {
- fBuffer.setLength(count-1);
- /*** BUG #3512 ***
- int entityCount = attributes.getEntityCount(index);
- for (int j=0; j < entityCount; j++) {
- int offset = attributes.getEntityOffset(index, j);
- int length = attributes.getEntityLength(index, j);
- if (offset < count-1) {
- if (offset+length == count) {
- length--;
- }
- }
- else {
- offset--;
- }
- attributes.setEntityOffset(index, j, offset);
- attributes.setEntityLength(index, j, length);
- }
- /***/
- }
- String newValue = fBuffer.toString();
- attributes.setValue(index, newValue);
- return ! attrValue.equals(newValue);
- }
-
- /** Root element specified. */
- private final void rootElementSpecified(QName rootElement) throws XNIException {
- if (fPerformValidation) {
- String root1 = fRootElement.rawname;
- String root2 = rootElement.rawname;
- if (root1 == null || !root1.equals(root2)) {
- fErrorReporter.reportError( XMLMessageFormatter.XML_DOMAIN,
- "RootElementTypeMustMatchDoctypedecl",
- new Object[]{root1, root2},
- XMLErrorReporter.SEVERITY_ERROR);
- }
- }
- } // rootElementSpecified(QName)
-
- /**
- * Check that the content of an element is valid.
- * <p>
- * This is the method of primary concern to the validator. This method is called
- * upon the scanner reaching the end tag of an element. At that time, the
- * element's children must be structurally validated, so it calls this method.
- * The index of the element being checked (in the decl pool), is provided as
- * well as an array of element name indexes of the children. The validator must
- * confirm that this element can have these children in this order.
- * <p>
- * This can also be called to do 'what if' testing of content models just to see
- * if they would be valid.
- * <p>
- * Note that the element index is an index into the element decl pool, whereas
- * the children indexes are name indexes, i.e. into the string pool.
- * <p>
- * A value of -1 in the children array indicates a PCDATA node. All other
- * indexes will be positive and represent child elements. The count can be
- * zero, since some elements have the EMPTY content model and that must be
- * confirmed.
- *
- * @param elementIndex The index within the <code>ElementDeclPool</code> of this
- * element.
- * @param childCount The number of entries in the <code>children</code> array.
- * @param children The children of this element.
- *
- * @return The value -1 if fully valid, else the 0 based index of the child
- * that first failed. If the value returned is equal to the number
- * of children, then additional content is required to reach a valid
- * ending state.
- *
- * @exception Exception Thrown on error.
- */
- private int checkContent(int elementIndex,
- QName[] children,
- int childOffset,
- int childCount) throws XNIException {
-
- fDTDGrammar.getElementDecl(elementIndex, fTempElementDecl);
-
- // Get the element name index from the element
- final String elementType = fCurrentElement.rawname;
-
- // Get out the content spec for this element
- final int contentType = fCurrentContentSpecType;
-
-
- //
- // Deal with the possible types of content. We try to optimized here
- // by dealing specially with content models that don't require the
- // full DFA treatment.
- //
- if (contentType == XMLElementDecl.TYPE_EMPTY) {
- //
- // If the child count is greater than zero, then this is
- // an error right off the bat at index 0.
- //
- if (childCount != 0) {
- return 0;
- }
- }
- else if (contentType == XMLElementDecl.TYPE_ANY) {
- //
- // This one is open game so we don't pass any judgement on it
- // at all. Its assumed to fine since it can hold anything.
- //
- }
- else if (contentType == XMLElementDecl.TYPE_MIXED ||
- contentType == XMLElementDecl.TYPE_CHILDREN) {
- // Get the content model for this element, faulting it in if needed
- ContentModelValidator cmElem = null;
- cmElem = fTempElementDecl.contentModelValidator;
- int result = cmElem.validate(children, childOffset, childCount);
- return result;
- }
- else if (contentType == -1) {
- //REVISIT
- /****
- reportRecoverableXMLError(XMLMessages.MSG_ELEMENT_NOT_DECLARED,
- XMLMessages.VC_ELEMENT_VALID,
- elementType);
- /****/
- }
- else if (contentType == XMLElementDecl.TYPE_SIMPLE) {
-
- //REVISIT
- // this should never be reached in the case of DTD validation.
-
- }
- else {
- //REVISIT
- /****
- fErrorReporter.reportError(fErrorReporter.getLocator(),
- ImplementationMessages.XERCES_IMPLEMENTATION_DOMAIN,
- ImplementationMessages.VAL_CST,
- 0,
- null,
- XMLErrorReporter.ERRORTYPE_FATAL_ERROR);
- /****/
- }
-
- // We succeeded
- return -1;
-
- } // checkContent(int,int,QName[]):int
-
- /** Returns the content spec type for an element index. */
- private int getContentSpecType(int elementIndex) {
-
- int contentSpecType = -1;
- if (elementIndex > -1) {
- if (fDTDGrammar.getElementDecl(elementIndex,fTempElementDecl)) {
- contentSpecType = fTempElementDecl.type;
- }
- }
- return contentSpecType;
- }
-
- /** Character data in content. */
- private void charDataInContent() {
-
- if (DEBUG_ELEMENT_CHILDREN) {
- System.out.println("charDataInContent()");
- }
- if (fElementChildren.length <= fElementChildrenLength) {
- QName[] newarray = new QName[fElementChildren.length * 2];
- System.arraycopy(fElementChildren, 0, newarray, 0, fElementChildren.length);
- fElementChildren = newarray;
- }
- QName qname = fElementChildren[fElementChildrenLength];
- if (qname == null) {
- for (int i = fElementChildrenLength; i < fElementChildren.length; i++) {
- fElementChildren[i] = new QName();
- }
- qname = fElementChildren[fElementChildrenLength];
- }
- qname.clear();
- fElementChildrenLength++;
-
- } // charDataInCount()
-
- /** convert attribute type from ints to strings */
- private String getAttributeTypeName(XMLAttributeDecl attrDecl) {
-
- switch (attrDecl.simpleType.type) {
- case XMLSimpleType.TYPE_ENTITY: {
- return attrDecl.simpleType.list ? XMLSymbols.fENTITIESSymbol : XMLSymbols.fENTITYSymbol;
- }
- case XMLSimpleType.TYPE_ENUMERATION: {
- StringBuffer buffer = new StringBuffer();
- buffer.append('(');
- for (int i=0; i<attrDecl.simpleType.enumeration.length ; i++) {
- if (i > 0) {
- buffer.append('|');
- }
- buffer.append(attrDecl.simpleType.enumeration[i]);
- }
- buffer.append(')');
- return fSymbolTable.addSymbol(buffer.toString());
- }
- case XMLSimpleType.TYPE_ID: {
- return XMLSymbols.fIDSymbol;
- }
- case XMLSimpleType.TYPE_IDREF: {
- return attrDecl.simpleType.list ? XMLSymbols.fIDREFSSymbol : XMLSymbols.fIDREFSymbol;
- }
- case XMLSimpleType.TYPE_NMTOKEN: {
- return attrDecl.simpleType.list ? XMLSymbols.fNMTOKENSSymbol : XMLSymbols.fNMTOKENSymbol;
- }
- case XMLSimpleType.TYPE_NOTATION: {
- return XMLSymbols.fNOTATIONSymbol;
- }
- }
- return XMLSymbols.fCDATASymbol;
-
- } // getAttributeTypeName(XMLAttributeDecl):String
-
- /** initialization */
- protected void init() {
-
- // datatype validators
- if (fValidation || fDynamicValidation) {
- try {
- //REVISIT: datatypeRegistry + initialization of datatype
- // why do we cast to ListDatatypeValidator?
- fValID = fDatatypeValidatorFactory.getBuiltInDV(XMLSymbols.fIDSymbol);
- fValIDRef = fDatatypeValidatorFactory.getBuiltInDV(XMLSymbols.fIDREFSymbol);
- fValIDRefs = fDatatypeValidatorFactory.getBuiltInDV(XMLSymbols.fIDREFSSymbol);
- fValENTITY = fDatatypeValidatorFactory.getBuiltInDV(XMLSymbols.fENTITYSymbol);
- fValENTITIES = fDatatypeValidatorFactory.getBuiltInDV(XMLSymbols.fENTITIESSymbol);
- fValNMTOKEN = fDatatypeValidatorFactory.getBuiltInDV(XMLSymbols.fNMTOKENSymbol);
- fValNMTOKENS = fDatatypeValidatorFactory.getBuiltInDV(XMLSymbols.fNMTOKENSSymbol);
- fValNOTATION = fDatatypeValidatorFactory.getBuiltInDV(XMLSymbols.fNOTATIONSymbol);
-
- }
- catch (Exception e) {
- // should never happen
- e.printStackTrace(System.err);
- }
-
- }
-
- } // init()
-
- /** ensure element stack capacity */
- private void ensureStackCapacity (int newElementDepth) {
- if (newElementDepth == fElementQNamePartsStack.length) {
-
- QName[] newStackOfQueue = new QName[newElementDepth * 2];
- System.arraycopy(this.fElementQNamePartsStack, 0, newStackOfQueue, 0, newElementDepth );
- fElementQNamePartsStack = newStackOfQueue;
-
- QName qname = fElementQNamePartsStack[newElementDepth];
- if (qname == null) {
- for (int i = newElementDepth; i < fElementQNamePartsStack.length; i++) {
- fElementQNamePartsStack[i] = new QName();
- }
- }
-
- int[] newStack = new int[newElementDepth * 2];
- System.arraycopy(fElementIndexStack, 0, newStack, 0, newElementDepth);
- fElementIndexStack = newStack;
-
- newStack = new int[newElementDepth * 2];
- System.arraycopy(fContentSpecTypeStack, 0, newStack, 0, newElementDepth);
- fContentSpecTypeStack = newStack;
-
- }
- } // ensureStackCapacity
-
-
- //
- // Protected methods
- //
-
- /** Handle element
- * @return true if validator is removed from the pipeline
- */
- protected boolean handleStartElement(QName element, XMLAttributes attributes, Augmentations augs)
- throws XNIException {
-
-
- // VC: Root Element Type
- // see if the root element's name matches the one in DoctypeDecl
- if (!fSeenRootElement) {
- // REVISIT: Here are current assumptions about validation features
- // given that XMLSchema validator is in the pipeline
- //
- // http://xml.org/sax/features/validation = true
- // http://apache.org/xml/features/validation/schema = true
- //
- // [1] XML instance document only has reference to a DTD
- // Outcome: report validation errors only against dtd.
- //
- // [2] XML instance document has only XML Schema grammars:
- // Outcome: report validation errors only against schemas (no errors produced from DTD validator)
- //
- // [3] XML instance document has DTD and XML schemas:
- // [a] if schema language is not set outcome - validation errors reported against both grammars: DTD and schemas.
- // [b] if schema language is set to XML Schema - do not report validation errors
- //
- // if dynamic validation is on
- // validate only against grammar we've found (depending on settings
- // for schema feature)
- //
- //
- fPerformValidation = validate();
- fSeenRootElement = true;
- fValidationManager.setEntityState(fDTDGrammar);
- fValidationManager.setGrammarFound(fSeenDoctypeDecl);
- rootElementSpecified(element);
- }
- if (fDTDGrammar == null) {
-
- if (!fPerformValidation) {
- fCurrentElementIndex = -1;
- fCurrentContentSpecType = -1;
- fInElementContent = false;
- }
- if (fPerformValidation) {
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "MSG_GRAMMAR_NOT_FOUND",
- new Object[]{ element.rawname},
- XMLErrorReporter.SEVERITY_ERROR);
- }
- // modify pipeline
- if (fDocumentSource !=null ) {
- fDocumentSource.setDocumentHandler(fDocumentHandler);
- if (fDocumentHandler != null)
- fDocumentHandler.setDocumentSource(fDocumentSource);
- return true;
- }
- }
- else {
- // resolve the element
- fCurrentElementIndex = fDTDGrammar.getElementDeclIndex(element);
- //changed here.. new function for getContentSpecType
- fCurrentContentSpecType = fDTDGrammar.getContentSpecType(fCurrentElementIndex);
- if (fCurrentContentSpecType == -1 && fPerformValidation) {
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "MSG_ELEMENT_NOT_DECLARED",
- new Object[]{ element.rawname},
- XMLErrorReporter.SEVERITY_ERROR);
- }
-
- // 0. insert default attributes
- // 1. normalize the attributes
- // 2. validate the attrivute list.
- // TO DO:
- //changed here.. also pass element name,
- addDTDDefaultAttrsAndValidate(element, fCurrentElementIndex, attributes);
- }
-
- // set element content state
- fInElementContent = fCurrentContentSpecType == XMLElementDecl.TYPE_CHILDREN;
-
- // increment the element depth, add this element's
- // QName to its enclosing element 's children list
- fElementDepth++;
- if (fPerformValidation) {
- // push current length onto stack
- if (fElementChildrenOffsetStack.length <= fElementDepth) {
- int newarray[] = new int[fElementChildrenOffsetStack.length * 2];
- System.arraycopy(fElementChildrenOffsetStack, 0, newarray, 0, fElementChildrenOffsetStack.length);
- fElementChildrenOffsetStack = newarray;
- }
- fElementChildrenOffsetStack[fElementDepth] = fElementChildrenLength;
-
- // add this element to children
- if (fElementChildren.length <= fElementChildrenLength) {
- QName[] newarray = new QName[fElementChildrenLength * 2];
- System.arraycopy(fElementChildren, 0, newarray, 0, fElementChildren.length);
- fElementChildren = newarray;
- }
- QName qname = fElementChildren[fElementChildrenLength];
- if (qname == null) {
- for (int i = fElementChildrenLength; i < fElementChildren.length; i++) {
- fElementChildren[i] = new QName();
- }
- qname = fElementChildren[fElementChildrenLength];
- }
- qname.setValues(element);
- fElementChildrenLength++;
- }
-
- // save current element information
- fCurrentElement.setValues(element);
- ensureStackCapacity(fElementDepth);
- fElementQNamePartsStack[fElementDepth].setValues(fCurrentElement);
- fElementIndexStack[fElementDepth] = fCurrentElementIndex;
- fContentSpecTypeStack[fElementDepth] = fCurrentContentSpecType;
- startNamespaceScope(element, attributes, augs);
- return false;
-
- } // handleStartElement(QName,XMLAttributes)
-
- protected void startNamespaceScope(QName element, XMLAttributes attributes, Augmentations augs){
- }
-
- /** Handle end element. */
- protected void handleEndElement(QName element, Augmentations augs, boolean isEmpty)
- throws XNIException {
-
- // decrease element depth
- fElementDepth--;
-
- // validate
- if (fPerformValidation) {
- int elementIndex = fCurrentElementIndex;
- if (elementIndex != -1 && fCurrentContentSpecType != -1) {
- QName children[] = fElementChildren;
- int childrenOffset = fElementChildrenOffsetStack[fElementDepth + 1] + 1;
- int childrenLength = fElementChildrenLength - childrenOffset;
- int result = checkContent(elementIndex,
- children, childrenOffset, childrenLength);
-
- if (result != -1) {
- fDTDGrammar.getElementDecl(elementIndex, fTempElementDecl);
- if (fTempElementDecl.type == XMLElementDecl.TYPE_EMPTY) {
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "MSG_CONTENT_INVALID",
- new Object[]{ element.rawname, "EMPTY"},
- XMLErrorReporter.SEVERITY_ERROR);
- }
- else {
- String messageKey = result != childrenLength ?
- "MSG_CONTENT_INVALID" : "MSG_CONTENT_INCOMPLETE";
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- messageKey,
- new Object[]{ element.rawname,
- fDTDGrammar.getContentSpecAsString(elementIndex)},
- XMLErrorReporter.SEVERITY_ERROR);
- }
- }
- }
- fElementChildrenLength = fElementChildrenOffsetStack[fElementDepth + 1] + 1;
- }
-
- endNamespaceScope(fCurrentElement, augs, isEmpty);
-
- // now pop this element off the top of the element stack
- if (fElementDepth < -1) {
- throw new RuntimeException("FWK008 Element stack underflow");
- }
- if (fElementDepth < 0) {
- fCurrentElement.clear();
- fCurrentElementIndex = -1;
- fCurrentContentSpecType = -1;
- fInElementContent = false;
-
- // TO DO : fix this
- //
- // Check after document is fully parsed
- // (1) check that there was an element with a matching id for every
- // IDREF and IDREFS attr (V_IDREF0)
- //
- if (fPerformValidation) {
- String value = fValidationState.checkIDRefID();
- if (value != null) {
- fErrorReporter.reportError( XMLMessageFormatter.XML_DOMAIN,
- "MSG_ELEMENT_WITH_ID_REQUIRED",
- new Object[]{value},
- XMLErrorReporter.SEVERITY_ERROR );
- }
- }
- return;
- }
-
- // If Namespace enable then localName != rawName
- fCurrentElement.setValues(fElementQNamePartsStack[fElementDepth]);
-
- fCurrentElementIndex = fElementIndexStack[fElementDepth];
- fCurrentContentSpecType = fContentSpecTypeStack[fElementDepth];
- fInElementContent = (fCurrentContentSpecType == XMLElementDecl.TYPE_CHILDREN);
-
- } // handleEndElement(QName,boolean)
-
- protected void endNamespaceScope(QName element, Augmentations augs, boolean isEmpty){
-
- // call handlers
- if (fDocumentHandler != null && !isEmpty) {
- // NOTE: The binding of the element doesn't actually happen
- // yet because the namespace binder does that. However,
- // if it does it before this point, then the endPrefix-
- // Mapping calls get made too soon! As long as the
- // rawnames match, we know it'll have a good binding,
- // so we can just use the current element. -Ac
- fDocumentHandler.endElement(fCurrentElement, augs);
- }
- }
-
- // returns whether a character is space according to the
- // version of XML this validator supports.
- protected boolean isSpace(int c) {
- return XMLChar.isSpace(c);
- } // isSpace(int): boolean
-
- public boolean characterData(String data, Augmentations augs) {
- characters(new XMLString(data.toCharArray(), 0, data.length()), augs);
- return true;
- }
-
-} // class XMLDTDValidator
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDValidatorFilter.java b/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDValidatorFilter.java
deleted file mode 100644
index f05aba5..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDValidatorFilter.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001, 2002 The Apache Software Foundation.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2002, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dtd;
-
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentFilter;
-
-/**
- * Defines a DTD Validator filter to allow
- * components to query the DTD validator.
- *
- * @xerces.internal
- *
- * @author Elena Litani, IBM
- *
- */
-public interface XMLDTDValidatorFilter
- extends XMLDocumentFilter {
-
- /**
- * Returns true if the validator has a DTD grammar
- *
- * @return true if the validator has a DTD grammar
- */
- public boolean hasGrammar();
-
- /**
- * Return true if validator must validate the document
- *
- * @return true if validator must validate the document
- */
- public boolean validate();
-
-
-} // interface XMLDTDValidatorFilter
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLElementDecl.java b/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLElementDecl.java
deleted file mode 100644
index 287d10d..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLElementDecl.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999-2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dtd;
-
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.impl.dtd.models.ContentModelValidator;
-
-/**
- */
-public class XMLElementDecl {
-
- //
- // Constants
- //
-
- /** TYPE_ANY */
- public static final short TYPE_ANY = 0;
-
- /** TYPE_EMPTY */
- public static final short TYPE_EMPTY = 1;
-
- /** TYPE_MIXED */
- public static final short TYPE_MIXED = 2;
-
- /** TYPE_CHILDREN */
- public static final short TYPE_CHILDREN = 3;
-
- /** TYPE_SIMPLE */
- public static final short TYPE_SIMPLE = 4;
-
- //
- // Data
- //
-
- /** name */
- public final QName name = new QName();
-
- /** scope */
- public int scope = -1;
-
- /** type */
- public short type = -1;
-
- /** contentModelValidator */
- public ContentModelValidator contentModelValidator;
-
- /** simpleType */
- public final XMLSimpleType simpleType = new XMLSimpleType();
-
- //
- // Methods
- //
-
- /**
- * setValues
- *
- * @param name
- * @param scope
- * @param type
- * @param contentModelValidator
- * @param simpleType
- */
- public void setValues(QName name, int scope, short type, ContentModelValidator contentModelValidator, XMLSimpleType simpleType) {
- this.name.setValues(name);
- this.scope = scope;
- this.type = type;
- this.contentModelValidator = contentModelValidator;
- this.simpleType.setValues(simpleType);
- } // setValues
-
- /**
- * clear
- */
- public void clear() {
- this.name.clear();
- this.type = -1;
- this.scope = -1;
- this.contentModelValidator = null;
- this.simpleType.clear();
- } // clear
-
-} // class XMLElementDecl
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLEntityDecl.java b/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLEntityDecl.java
deleted file mode 100644
index 8496dc1..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLEntityDecl.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999-2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dtd;
-
-/**
- */
-public class XMLEntityDecl {
-
- //
- // Data
- //
-
- /** name */
- public String name;
-
- /** publicId */
- public String publicId;
-
- /** systemId */
- public String systemId;
-
- /** baseSystemId */
- public String baseSystemId;
-
- /** notation */
- public String notation;
-
- /** isPE */
- public boolean isPE;
-
- /** inExternal */
- /** <strong>Note:</strong> flag of where the entity is defined, not whether it is a external entity */
- public boolean inExternal;
-
- /** Value. */
- public String value;
-
- //
- // Methods
- //
-
- /**
- * setValues
- *
- * @param name
- * @param publicId
- * @param systemId
- * @param baseSystemId
- * @param notation
- * @param isPE
- * @param inExternal
- */
- public void setValues(String name, String publicId, String systemId,
- String baseSystemId, String notation,
- boolean isPE, boolean inExternal) {
- setValues(name, publicId, systemId, baseSystemId, notation, null, isPE, inExternal);
- }
-
- /**
- * setValues
- *
- * @param name
- * @param publicId
- * @param systemId
- * @param baseSystemId
- * @param value
- * @param notation
- * @param isPE
- * @param inExternal
- */
- public void setValues(String name, String publicId, String systemId,
- String baseSystemId, String notation,
- String value, boolean isPE, boolean inExternal) {
- this.name = name;
- this.publicId = publicId;
- this.systemId = systemId;
- this.baseSystemId = baseSystemId;
- this.notation = notation;
- this.value = value;
- this.isPE = isPE;
- this.inExternal = inExternal;
- } // setValues(String,String,String,String,String,boolean,boolean)
-
- /**
- * clear
- */
- public void clear() {
- this.name = null;
- this.publicId = null;
- this.systemId = null;
- this.baseSystemId = null;
- this.notation = null;
- this.value = null;
- this.isPE = false;
- this.inExternal = false;
-
- } // clear
-
-} // class XMLEntityDecl
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLNSDTDValidator.java b/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLNSDTDValidator.java
deleted file mode 100644
index bf4ecf8..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLNSDTDValidator.java
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999-2002 The Apache Software Foundation.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dtd;
-
-import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
-import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter;
-import com.sun.org.apache.xerces.internal.util.XMLSymbols;
-import com.sun.org.apache.xerces.internal.xni.Augmentations;
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-
-
-/**
- * The DTD validator. The validator implements a document
- * filter: receiving document events from the scanner; validating
- * the content and structure; augmenting the InfoSet, if applicable;
- * and notifying the parser of the information resulting from the
- * validation process.
- * <p> Formerly, this component also handled DTD events and grammar construction.
- * To facilitate the development of a meaningful DTD grammar caching/preparsing
- * framework, this functionality has been moved into the XMLDTDLoader
- * class. Therefore, this class no longer implements the DTDFilter
- * or DTDContentModelFilter interfaces.
- * <p>
- * This component requires the following features and properties from the
- * component manager that uses it:
- * <ul>
- * <li>http://xml.org/sax/features/namespaces</li>
- * <li>http://xml.org/sax/features/validation</li>
- * <li>http://apache.org/xml/features/validation/dynamic</li>
- * <li>http://apache.org/xml/properties/internal/symbol-table</li>
- * <li>http://apache.org/xml/properties/internal/error-reporter</li>
- * <li>http://apache.org/xml/properties/internal/grammar-pool</li>
- * <li>http://apache.org/xml/properties/internal/datatype-validator-factory</li>
- * </ul>
- *
- * @xerces.internal
- *
- * @author Elena Litani, IBM
- *
-
- */
-public class XMLNSDTDValidator
- extends XMLDTDValidator{
-
- /** Attribute QName. */
- private QName fAttributeQName = new QName();
-
-
- /** Bind namespaces */
- protected final void startNamespaceScope (QName element, XMLAttributes attributes,
- Augmentations augs) throws XNIException {
-
- // add new namespace context
- fNamespaceContext.pushContext();
-
- if (element.prefix == XMLSymbols.PREFIX_XMLNS) {
- fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN,
- "ElementXMLNSPrefix",
- new Object[]{element.rawname},
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
-
- // search for new namespace bindings
- int length = attributes.getLength();
- for (int i = 0; i < length; i++) {
- String localpart = attributes.getLocalName(i);
- String prefix = attributes.getPrefix(i);
- // when it's of form xmlns="..." or xmlns:prefix="...",
- // it's a namespace declaration. but prefix:xmlns="..." isn't.
- if (prefix == XMLSymbols.PREFIX_XMLNS ||
- prefix == XMLSymbols.EMPTY_STRING && localpart == XMLSymbols.PREFIX_XMLNS) {
-
- // get the internalized value of this attribute
- String uri = fSymbolTable.addSymbol(attributes.getValue(i));
-
- // 1. "xmlns" can't be bound to any namespace
- if (prefix == XMLSymbols.PREFIX_XMLNS && localpart == XMLSymbols.PREFIX_XMLNS) {
- fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN,
- "CantBindXMLNS",
- new Object[]{attributes.getQName(i)},
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
-
- // 2. the namespace for "xmlns" can't be bound to any prefix
- if (uri == NamespaceContext.XMLNS_URI) {
- fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN,
- "CantBindXMLNS",
- new Object[]{attributes.getQName(i)},
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
-
- // 3. "xml" can't be bound to any other namespace than it's own
- if (localpart == XMLSymbols.PREFIX_XML) {
- if (uri != NamespaceContext.XML_URI) {
- fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN,
- "CantBindXML",
- new Object[]{attributes.getQName(i)},
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
- }
- // 4. the namespace for "xml" can't be bound to any other prefix
- else {
- if (uri ==NamespaceContext.XML_URI) {
- fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN,
- "CantBindXML",
- new Object[]{attributes.getQName(i)},
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
- }
-
- prefix = localpart != XMLSymbols.PREFIX_XMLNS ? localpart : XMLSymbols.EMPTY_STRING;
-
- // http://www.w3.org/TR/1999/REC-xml-names-19990114/#dt-prefix
- // We should only report an error if there is a prefix,
- // that is, the local part is not "xmlns". -SG
- if (uri == XMLSymbols.EMPTY_STRING && localpart != XMLSymbols.PREFIX_XMLNS) {
- fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN,
- "EmptyPrefixedAttName",
- new Object[]{attributes.getQName(i)},
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- continue;
- }
-
- // declare prefix in context
- fNamespaceContext.declarePrefix(prefix, uri.length() != 0 ? uri : null);
- }
- }
-
- // bind the element
- String prefix = element.prefix != null
- ? element.prefix : XMLSymbols.EMPTY_STRING;
- element.uri = fNamespaceContext.getURI(prefix);
- if (element.prefix == null && element.uri != null) {
- element.prefix = XMLSymbols.EMPTY_STRING;
- }
- if (element.prefix != null && element.uri == null) {
- fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN,
- "ElementPrefixUnbound",
- new Object[]{element.prefix, element.rawname},
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
-
- // bind the attributes
- for (int i = 0; i < length; i++) {
- attributes.getName(i, fAttributeQName);
- String aprefix = fAttributeQName.prefix != null
- ? fAttributeQName.prefix : XMLSymbols.EMPTY_STRING;
- String arawname = fAttributeQName.rawname;
- if (arawname == XMLSymbols.PREFIX_XMLNS) {
- fAttributeQName.uri = fNamespaceContext.getURI(XMLSymbols.PREFIX_XMLNS);
- attributes.setName(i, fAttributeQName);
- }
- else if (aprefix != XMLSymbols.EMPTY_STRING) {
- fAttributeQName.uri = fNamespaceContext.getURI(aprefix);
- if (fAttributeQName.uri == null) {
- fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN,
- "AttributePrefixUnbound",
- new Object[]{element.rawname,arawname,aprefix},
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
- attributes.setName(i, fAttributeQName);
- }
- }
-
- // verify that duplicate attributes don't exist
- // Example: <foo xmlns:a='NS' xmlns:b='NS' a:attr='v1' b:attr='v2'/>
- int attrCount = attributes.getLength();
- for (int i = 0; i < attrCount - 1; i++) {
- String auri = attributes.getURI(i);
- if (auri == null || auri == NamespaceContext.XMLNS_URI) {
- continue;
- }
- String alocalpart = attributes.getLocalName(i);
- for (int j = i + 1; j < attrCount; j++) {
- String blocalpart = attributes.getLocalName(j);
- String buri = attributes.getURI(j);
- if (alocalpart == blocalpart && auri == buri) {
- fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN,
- "AttributeNSNotUnique",
- new Object[]{element.rawname,alocalpart, auri},
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
- }
- }
-
-
- } // startNamespaceScope(QName,XMLAttributes)
-
-
- /** Handles end element. */
- protected void endNamespaceScope(QName element, Augmentations augs, boolean isEmpty)
- throws XNIException {
-
- // bind element
- String eprefix = element.prefix != null ? element.prefix : XMLSymbols.EMPTY_STRING;
- element.uri = fNamespaceContext.getURI(eprefix);
- if (element.uri != null) {
- element.prefix = eprefix;
- }
-
- // call handlers
- if (fDocumentHandler != null) {
- if (!isEmpty) {
- fDocumentHandler.endElement(element, augs);
- }
- }
-
- // pop context
- fNamespaceContext.popContext();
-
- } // endNamespaceScope(QName,boolean)
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLNotationDecl.java b/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLNotationDecl.java
deleted file mode 100644
index 7541875..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLNotationDecl.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999-2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dtd;
-
-/**
- */
-public class XMLNotationDecl {
-
- //
- // Data
- //
-
- /** name */
- public String name;
-
- /** publicId */
- public String publicId;
-
- /** systemId */
- public String systemId;
-
- /** base systemId */
- public String baseSystemId;
-
- //
- // Methods
- //
-
- /**
- * setValues
- *
- * @param name
- * @param publicId
- * @param systemId
- */
- public void setValues(String name, String publicId, String systemId, String baseSystemId) {
- this.name = name;
- this.publicId = publicId;
- this.systemId = systemId;
- this.baseSystemId = baseSystemId;
- } // setValues
-
- /**
- * clear
- */
- public void clear() {
- this.name = null;
- this.publicId = null;
- this.systemId = null;
- this.baseSystemId = null;
- } // clear
-
-} // class XMLNotationDecl
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLSimpleType.java b/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLSimpleType.java
deleted file mode 100644
index c757e39..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLSimpleType.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999-2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dtd;
-
-import com.sun.org.apache.xerces.internal.impl.dv.DatatypeValidator;
-
-/**
- */
-public class XMLSimpleType {
-
- //
- // Constants
- //
-
- /** TYPE_CDATA */
- public static final short TYPE_CDATA = 0;
-
- /** TYPE_ENTITY */
- public static final short TYPE_ENTITY = 1;
-
- /** TYPE_ENUMERATION */
- public static final short TYPE_ENUMERATION = 2;
-
- /** TYPE_ID */
- public static final short TYPE_ID = 3;
-
- /** TYPE_IDREF */
- public static final short TYPE_IDREF = 4;
-
- /** TYPE_NMTOKEN */
- public static final short TYPE_NMTOKEN = 5;
-
- /** TYPE_NOTATION */
- public static final short TYPE_NOTATION = 6;
-
- /** TYPE_NAMED */
- public static final short TYPE_NAMED = 7;
-
- /** DEFAULT_TYPE_DEFAULT */
- public static final short DEFAULT_TYPE_DEFAULT = 3;
-
- /** DEFAULT_TYPE_FIXED */
- public static final short DEFAULT_TYPE_FIXED = 1;
-
- /** DEFAULT_TYPE_IMPLIED */
- public static final short DEFAULT_TYPE_IMPLIED = 0;
-
- /** DEFAULT_TYPE_REQUIRED */
- public static final short DEFAULT_TYPE_REQUIRED = 2;
-
- //
- // Data
- //
-
- /** type */
- public short type;
-
- /** name */
- public String name;
-
- /** enumeration */
- public String[] enumeration;
-
- /** list */
- public boolean list;
-
- /** defaultType */
- public short defaultType;
-
- /** defaultValue */
- public String defaultValue;
-
- /** non-normalized defaultValue */
- public String nonNormalizedDefaultValue;
-
- /** datatypeValidator */
- public DatatypeValidator datatypeValidator;
-
- //
- // Methods
- //
-
- /**
- * setValues
- *
- * @param type
- * @param name
- * @param enumeration
- * @param list
- * @param defaultType
- * @param defaultValue
- * @param nonNormalizedDefaultValue
- * @param datatypeValidator
- */
- public void setValues(short type, String name, String[] enumeration,
- boolean list, short defaultType,
- String defaultValue, String nonNormalizedDefaultValue,
- DatatypeValidator datatypeValidator) {
-
- this.type = type;
- this.name = name;
- // REVISIT: Should this be a copy? -Ac
- if (enumeration != null && enumeration.length > 0) {
- this.enumeration = new String[enumeration.length];
- System.arraycopy(enumeration, 0, this.enumeration, 0, this.enumeration.length);
- }
- else {
- this.enumeration = null;
- }
- this.list = list;
- this.defaultType = defaultType;
- this.defaultValue = defaultValue;
- this.nonNormalizedDefaultValue = nonNormalizedDefaultValue;
- this.datatypeValidator = datatypeValidator;
-
- } // setValues(short,String,String[],boolean,short,String,String,DatatypeValidator)
-
- /** Set values. */
- public void setValues(XMLSimpleType simpleType) {
-
- type = simpleType.type;
- name = simpleType.name;
- // REVISIT: Should this be a copy? -Ac
- if (simpleType.enumeration != null && simpleType.enumeration.length > 0) {
- enumeration = new String[simpleType.enumeration.length];
- System.arraycopy(simpleType.enumeration, 0, enumeration, 0, enumeration.length);
- }
- else {
- enumeration = null;
- }
- list = simpleType.list;
- defaultType = simpleType.defaultType;
- defaultValue = simpleType.defaultValue;
- nonNormalizedDefaultValue = simpleType.nonNormalizedDefaultValue;
- datatypeValidator = simpleType.datatypeValidator;
-
- } // setValues(XMLSimpleType)
-
- /**
- * clear
- */
- public void clear() {
- this.type = -1;
- this.name = null;
- this.enumeration = null;
- this.list = false;
- this.defaultType = -1;
- this.defaultValue = null;
- this.nonNormalizedDefaultValue = null;
- this.datatypeValidator = null;
- } // clear
-
-} // class XMLSimpleType
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dtd/models/CMAny.java b/src/com/sun/org/apache/xerces/internal/impl/dtd/models/CMAny.java
deleted file mode 100644
index 5c47d2e..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dtd/models/CMAny.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2000-2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dtd.models;
-
-
-/**
- * Content model any node.
- *
- * @xerces.internal
- *
- */
-public class CMAny
- extends CMNode {
-
- //
- // Data
- //
-
- /**
- * The any content model type. This value is one of the following:
- * XMLContentSpec.CONTENTSPECNODE_ANY,
- * XMLContentSpec.CONTENTSPECNODE_ANY_OTHER,
- * XMLContentSpec.CONTENTSPECNODE_ANY_LOCAL.
- */
- private int fType;
-
- /**
- * URI of the any content model. This value is set if the type is
- * of the following:
- * XMLContentSpec.CONTENTSPECNODE_ANY,
- * XMLContentSpec.CONTENTSPECNODE_ANY_OTHER.
- */
- private String fURI;
-
- /**
- * Part of the algorithm to convert a regex directly to a DFA
- * numbers each leaf sequentially. If its -1, that means its an
- * epsilon node. Zero and greater are non-epsilon positions.
- */
- private int fPosition = -1;
-
- //
- // Constructors
- //
-
- /** Constructs a content model any. */
- public CMAny(int type, String uri, int position) {
- super(type);
-
- // Store the information
- fType = type;
- fURI = uri;
- fPosition = position;
- }
-
- //
- // Package methods
- //
-
- final int getType() {
- return fType;
- }
-
- final String getURI() {
- return fURI;
- }
-
- final int getPosition()
- {
- return fPosition;
- }
-
- final void setPosition(int newPosition)
- {
- fPosition = newPosition;
- }
-
- //
- // CMNode methods
- //
-
- // package
-
- public boolean isNullable()
- {
- // Leaf nodes are never nullable unless its an epsilon node
- return (fPosition == -1);
- }
-
- public String toString()
- {
- StringBuffer strRet = new StringBuffer();
- strRet.append("(");
- strRet.append("##any:uri=");
- strRet.append(fURI);
- strRet.append(')');
- if (fPosition >= 0)
- {
- strRet.append
- (
- " (Pos:"
- + new Integer(fPosition).toString()
- + ")"
- );
- }
- return strRet.toString();
- }
-
- // protected
-
- protected void calcFirstPos(CMStateSet toSet)
- {
- // If we are an epsilon node, then the first pos is an empty set
- if (fPosition == -1)
- toSet.zeroBits();
-
- // Otherwise, its just the one bit of our position
- else
- toSet.setBit(fPosition);
- }
-
- protected void calcLastPos(CMStateSet toSet)
- {
- // If we are an epsilon node, then the last pos is an empty set
- if (fPosition == -1)
- toSet.zeroBits();
-
- // Otherwise, its just the one bit of our position
- else
- toSet.setBit(fPosition);
- }
-
-} // class CMAny
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dtd/models/CMBinOp.java b/src/com/sun/org/apache/xerces/internal/impl/dtd/models/CMBinOp.java
deleted file mode 100644
index 51df88d..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dtd/models/CMBinOp.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999-2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dtd.models;
-
-import com.sun.org.apache.xerces.internal.impl.dtd.XMLContentSpec;
-
-/**
- * Content model Bin-Op node.
- *
- * @xerces.internal
- *
- */
-public class CMBinOp extends CMNode
-{
- // -------------------------------------------------------------------
- // Constructors
- // -------------------------------------------------------------------
- public CMBinOp(int type, CMNode leftNode, CMNode rightNode)
- {
- super(type);
-
- // Insure that its one of the types we require
- if ((type() != XMLContentSpec.CONTENTSPECNODE_CHOICE)
- && (type() != XMLContentSpec.CONTENTSPECNODE_SEQ))
- {
- throw new RuntimeException("ImplementationMessages.VAL_BST");
- }
-
- // Store the nodes and init any data that needs it
- fLeftChild = leftNode;
- fRightChild = rightNode;
- }
-
-
- // -------------------------------------------------------------------
- // Package, final methods
- // -------------------------------------------------------------------
- final CMNode getLeft()
- {
- return fLeftChild;
- }
-
- final CMNode getRight()
- {
- return fRightChild;
- }
-
-
- // -------------------------------------------------------------------
- // Package, inherited methods
- // -------------------------------------------------------------------
- public boolean isNullable()
- {
- //
- // If its an alternation, then if either child is nullable then
- // this node is nullable. If its a concatenation, then both of
- // them have to be nullable.
- //
- if (type() == XMLContentSpec.CONTENTSPECNODE_CHOICE)
- return (fLeftChild.isNullable() || fRightChild.isNullable());
- else if (type() == XMLContentSpec.CONTENTSPECNODE_SEQ)
- return (fLeftChild.isNullable() && fRightChild.isNullable());
- else
- throw new RuntimeException("ImplementationMessages.VAL_BST");
- }
-
-
- // -------------------------------------------------------------------
- // Protected, inherited methods
- // -------------------------------------------------------------------
- protected void calcFirstPos(CMStateSet toSet)
- {
- if (type() == XMLContentSpec.CONTENTSPECNODE_CHOICE)
- {
- // Its the the union of the first positions of our children.
- toSet.setTo(fLeftChild.firstPos());
- toSet.union(fRightChild.firstPos());
- }
- else if (type() == XMLContentSpec.CONTENTSPECNODE_SEQ)
- {
- //
- // If our left child is nullable, then its the union of our
- // children's first positions. Else is our left child's first
- // positions.
- //
- toSet.setTo(fLeftChild.firstPos());
- if (fLeftChild.isNullable())
- toSet.union(fRightChild.firstPos());
- }
- else
- {
- throw new RuntimeException("ImplementationMessages.VAL_BST");
- }
- }
-
- protected void calcLastPos(CMStateSet toSet)
- {
- if (type() == XMLContentSpec.CONTENTSPECNODE_CHOICE)
- {
- // Its the the union of the first positions of our children.
- toSet.setTo(fLeftChild.lastPos());
- toSet.union(fRightChild.lastPos());
- }
- else if (type() == XMLContentSpec.CONTENTSPECNODE_SEQ)
- {
- //
- // If our right child is nullable, then its the union of our
- // children's last positions. Else is our right child's last
- // positions.
- //
- toSet.setTo(fRightChild.lastPos());
- if (fRightChild.isNullable())
- toSet.union(fLeftChild.lastPos());
- }
- else
- {
- throw new RuntimeException("ImplementationMessages.VAL_BST");
- }
- }
-
-
- // -------------------------------------------------------------------
- // Private data members
- //
- // fLeftChild
- // fRightChild
- // These are the references to the two nodes that are on either
- // side of this binary operation.
- // -------------------------------------------------------------------
- private CMNode fLeftChild;
- private CMNode fRightChild;
-};
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dtd/models/CMLeaf.java b/src/com/sun/org/apache/xerces/internal/impl/dtd/models/CMLeaf.java
deleted file mode 100644
index 0cc5dfb..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dtd/models/CMLeaf.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999-2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dtd.models;
-
-import com.sun.org.apache.xerces.internal.impl.dtd.XMLContentSpec;
-import com.sun.org.apache.xerces.internal.xni.QName;
-
-/**
- * Content model leaf node.
- *
- * @xerces.internal
- *
- */
-public class CMLeaf
- extends CMNode {
-
- //
- // Data
- //
-
- /** This is the element that this leaf represents. */
- private QName fElement = new QName();
-
- /**
- * Part of the algorithm to convert a regex directly to a DFA
- * numbers each leaf sequentially. If its -1, that means its an
- * epsilon node. Zero and greater are non-epsilon positions.
- */
- private int fPosition = -1;
-
- //
- // Constructors
- //
-
- /** Constructs a content model leaf. */
- public CMLeaf(QName element, int position) {
- super(XMLContentSpec.CONTENTSPECNODE_LEAF);
-
- // Store the element index and position
- fElement.setValues(element);
- fPosition = position;
- }
-
- /** Constructs a content model leaf. */
- public CMLeaf(QName element) {
- super(XMLContentSpec.CONTENTSPECNODE_LEAF);
-
- // Store the element index and position
- fElement.setValues(element);
- }
-
- //
- // Package methods
- //
-
- final QName getElement()
- {
- return fElement;
- }
-
- final int getPosition()
- {
- return fPosition;
- }
-
- final void setPosition(int newPosition)
- {
- fPosition = newPosition;
- }
-
- //
- // CMNode methods
- //
-
- // package
-
- public boolean isNullable()
- {
- // Leaf nodes are never nullable unless its an epsilon node
- return (fPosition == -1);
- }
-
- public String toString()
- {
- StringBuffer strRet = new StringBuffer(fElement.toString());
- strRet.append(" (");
- strRet.append(fElement.uri);
- strRet.append(',');
- strRet.append(fElement.localpart);
- strRet.append(')');
- if (fPosition >= 0)
- {
- strRet.append
- (
- " (Pos:"
- + new Integer(fPosition).toString()
- + ")"
- );
- }
- return strRet.toString();
- }
-
- // protected
-
- protected void calcFirstPos(CMStateSet toSet)
- {
- // If we are an epsilon node, then the first pos is an empty set
- if (fPosition == -1)
- toSet.zeroBits();
-
- // Otherwise, its just the one bit of our position
- else
- toSet.setBit(fPosition);
- }
-
- protected void calcLastPos(CMStateSet toSet)
- {
- // If we are an epsilon node, then the last pos is an empty set
- if (fPosition == -1)
- toSet.zeroBits();
-
- // Otherwise, its just the one bit of our position
- else
- toSet.setBit(fPosition);
- }
-
-} // class CMLeaf
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dtd/models/CMNode.java b/src/com/sun/org/apache/xerces/internal/impl/dtd/models/CMNode.java
deleted file mode 100644
index 29bfc43..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dtd/models/CMNode.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999-2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dtd.models;
-
-/**
- * A content model node.
- *
- * @xerces.internal
- *
- */
-public abstract class CMNode
-{
- // -------------------------------------------------------------------
- // Constructors
- // -------------------------------------------------------------------
- public CMNode(int type)
- {
- fType = type;
- }
-
-
- // -------------------------------------------------------------------
- // Package, abstract methods
- // -------------------------------------------------------------------
- // made this public so it could be implemented and used outside this package -neilg.
- public abstract boolean isNullable() ;
-
-
- // -------------------------------------------------------------------
- // Package final methods
- // -------------------------------------------------------------------
- public final int type()
- {
- return fType;
- }
-
- // made this public so it could be implemented and used outside this package -neilg.
- public final CMStateSet firstPos()
- {
- if (fFirstPos == null)
- {
- fFirstPos = new CMStateSet(fMaxStates);
- calcFirstPos(fFirstPos);
- }
- return fFirstPos;
- }
-
- // made this public so it could be implemented and used outside this package -neilg.
- public final CMStateSet lastPos()
- {
- if (fLastPos == null)
- {
- fLastPos = new CMStateSet(fMaxStates);
- calcLastPos(fLastPos);
- }
- return fLastPos;
- }
-
- final void setFollowPos(CMStateSet setToAdopt)
- {
- fFollowPos = setToAdopt;
- }
-
- public final void setMaxStates(int maxStates)
- {
- fMaxStates = maxStates;
- }
-
- /**
- * Allows the user to set arbitrary data on this content model
- * node. This is used by the a{n,m} optimization that runs
- * in constant space.
- */
- public void setUserData(Object userData) {
- fUserData = userData;
- }
-
- /**
- * Allows the user to get arbitrary data set on this content
- * model node. This is used by the a{n,m} optimization that runs
- * in constant space.
- */
- public Object getUserData() {
- return fUserData;
- }
-
- // -------------------------------------------------------------------
- // Protected, abstract methods
- // -------------------------------------------------------------------
- protected abstract void calcFirstPos(CMStateSet toSet) ;
-
- protected abstract void calcLastPos(CMStateSet toSet) ;
-
-
- // -------------------------------------------------------------------
- // Private data members
- //
- // fType
- // The type of node. This indicates whether its a leaf or an
- // operation. Though we also do derived classes for these types,
- // it is too expensive to use runtime typing to find this out.
- // This is one of the ContentSpecNode.NODE_XXX types.
- //
- // fFirstPos
- // The set of NFA states that represent the entry states of this
- // node in the DFA.
- //
- // fFollowPos
- // The set of NFA states that can be gotten to from from this
- // node in the DFA.
- //
- // fLastPos
- // The set of NFA states that represent the final states of this
- // node in the DFA.
- //
- // fMaxStates
- // The maximum number of states that the NFA has, which means the
- // max number of NFA states that have to be traced in the state
- // sets during the building of the DFA. Its unfortunate that it
- // has to be stored redundantly, but we need to fault in the
- // state set members and they have to be sized to this size. We
- // init to to -1 so it will cause an error if its used without
- // being initialized.
- // -------------------------------------------------------------------
- private int fType;
- private CMStateSet fFirstPos = null;
- private CMStateSet fFollowPos = null;
- private CMStateSet fLastPos = null;
- private int fMaxStates = -1;
- private Object fUserData = null;
-};
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dtd/models/CMStateSet.java b/src/com/sun/org/apache/xerces/internal/impl/dtd/models/CMStateSet.java
deleted file mode 100644
index d20a3a9..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dtd/models/CMStateSet.java
+++ /dev/null
@@ -1,343 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999-2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dtd.models;
-
-
-/**
- * This class is a very simple bitset class. The DFA content model code needs
- * to support a bit set, but the java BitSet class is way, way overkill. Our
- * bitset never needs to be expanded after creation, hash itself, etc...
- *
- * Since the vast majority of content models will never require more than 64
- * bits, and since allocation of anything in Java is expensive, this class
- * provides a hybrid implementation that uses two ints for instances that use
- * 64 bits or fewer. It has a byte array reference member which will only be
- * used if more than 64 bits are required.
- *
- * Note that the code that uses this class will never perform operations
- * on sets of different sizes, so that check does not have to be made here.
- *
- * @xerces.internal
- *
- */
-// made this class public so it can be accessed by
-// the XS content models from the schema package -neilg.
-public class CMStateSet
-{
- // -------------------------------------------------------------------
- // Constructors
- // -------------------------------------------------------------------
- public CMStateSet(int bitCount)
- {
- // Store the required bit count and insure its legal
- fBitCount = bitCount;
- if (fBitCount < 0)
- throw new RuntimeException("ImplementationMessages.VAL_CMSI");
-
- //
- // See if we need to allocate the byte array or whether we can live
- // within the 64 bit high performance scheme.
- //
- if (fBitCount > 64)
- {
- fByteCount = fBitCount / 8;
- if (fBitCount % 8 != 0)
- fByteCount++;
- fByteArray = new byte[fByteCount];
- }
-
- // Init all the bits to zero
- zeroBits();
- }
-
-
- // -------------------------------------------------------------------
- // Public inherited methods
- // -------------------------------------------------------------------
- public String toString()
- {
- StringBuffer strRet = new StringBuffer();
- try
- {
- strRet.append("{");
- for (int index = 0; index < fBitCount; index++)
- {
- if (getBit(index))
- strRet.append(" " + index);
- }
- strRet.append(" }");
- }
-
- catch(RuntimeException exToCatch)
- {
- //
- // We know this won't happen but we have to catch it to avoid it
- // having to be in our 'throws' list.
- //
- }
- return strRet.toString();
- }
-
-
- // -------------------------------------------------------------------
- // Package final methods
- // -------------------------------------------------------------------
-// the XS content models from the schema package -neilg.
- public final void intersection(CMStateSet setToAnd)
- {
- if (fBitCount < 65)
- {
- fBits1 &= setToAnd.fBits1;
- fBits2 &= setToAnd.fBits2;
- }
- else
- {
- for (int index = fByteCount - 1; index >= 0; index--)
- fByteArray[index] &= setToAnd.fByteArray[index];
- }
- }
-
- public final boolean getBit(int bitToGet)
- {
- if (bitToGet >= fBitCount)
- throw new RuntimeException("ImplementationMessages.VAL_CMSI");
-
- if (fBitCount < 65)
- {
- final int mask = (0x1 << (bitToGet % 32));
- if (bitToGet < 32)
- return (fBits1 & mask) != 0;
- else
- return (fBits2 & mask) != 0;
- }
- else
- {
- // Create the mask and byte values
- final byte mask = (byte)(0x1 << (bitToGet % 8));
- final int ofs = bitToGet >> 3;
-
- // And access the right bit and byte
- return ((fByteArray[ofs] & mask) != 0);
- }
- }
-
- public final boolean isEmpty()
- {
- if (fBitCount < 65)
- {
- return ((fBits1 == 0) && (fBits2 == 0));
- }
- else
- {
- for (int index = fByteCount - 1; index >= 0; index--)
- {
- if (fByteArray[index] != 0)
- return false;
- }
- }
- return true;
- }
-
- final boolean isSameSet(CMStateSet setToCompare)
- {
- if (fBitCount != setToCompare.fBitCount)
- return false;
-
- if (fBitCount < 65)
- {
- return ((fBits1 == setToCompare.fBits1)
- && (fBits2 == setToCompare.fBits2));
- }
-
- for (int index = fByteCount - 1; index >= 0; index--)
- {
- if (fByteArray[index] != setToCompare.fByteArray[index])
- return false;
- }
- return true;
- }
-
-// the XS content models from the schema package -neilg.
- public final void union(CMStateSet setToOr)
- {
- if (fBitCount < 65)
- {
- fBits1 |= setToOr.fBits1;
- fBits2 |= setToOr.fBits2;
- }
- else
- {
- for (int index = fByteCount - 1; index >= 0; index--)
- fByteArray[index] |= setToOr.fByteArray[index];
- }
- }
-
- public final void setBit(int bitToSet)
- {
- if (bitToSet >= fBitCount)
- throw new RuntimeException("ImplementationMessages.VAL_CMSI");
-
- if (fBitCount < 65)
- {
- final int mask = (0x1 << (bitToSet % 32));
- if (bitToSet < 32)
- {
- fBits1 &= ~mask;
- fBits1 |= mask;
- }
- else
- {
- fBits2 &= ~mask;
- fBits2 |= mask;
- }
- }
- else
- {
- // Create the mask and byte values
- final byte mask = (byte)(0x1 << (bitToSet % 8));
- final int ofs = bitToSet >> 3;
-
- // And access the right bit and byte
- fByteArray[ofs] &= ~mask;
- fByteArray[ofs] |= mask;
- }
- }
-
-// the XS content models from the schema package -neilg.
- public final void setTo(CMStateSet srcSet)
- {
- // They have to be the same size
- if (fBitCount != srcSet.fBitCount)
- throw new RuntimeException("ImplementationMessages.VAL_CMSI");
-
- if (fBitCount < 65)
- {
- fBits1 = srcSet.fBits1;
- fBits2 = srcSet.fBits2;
- }
- else
- {
- for (int index = fByteCount - 1; index >= 0; index--)
- fByteArray[index] = srcSet.fByteArray[index];
- }
- }
-
- // had to make this method public so it could be accessed from
- // schema package - neilg.
- public final void zeroBits()
- {
- if (fBitCount < 65)
- {
- fBits1 = 0;
- fBits2 = 0;
- }
- else
- {
- for (int index = fByteCount - 1; index >= 0; index--)
- fByteArray[index] = 0;
- }
- }
-
-
- // -------------------------------------------------------------------
- // Private data members
- //
- // fBitCount
- // The count of bits that the outside world wants to support,
- // so its the max bit index plus one.
- //
- // fByteCount
- // If the bit count is > 64, then we use the fByteArray member to
- // store the bits, and this indicates its size in bytes. Otherwise
- // its value is meaningless.
- //
- // fBits1
- // fBits2
- // When the bit count is < 64 (very common), these hold the bits.
- // Otherwise, the fByteArray member holds htem.
- // -------------------------------------------------------------------
- int fBitCount;
- int fByteCount;
- int fBits1;
- int fBits2;
- byte[] fByteArray;
- /* Optimization(Jan, 2001) */
- public boolean equals(Object o) {
- if (!(o instanceof CMStateSet)) return false;
- return isSameSet((CMStateSet)o);
- }
-
- public int hashCode() {
- if (fBitCount < 65)
- {
- return fBits1+ fBits2 * 31;
- }
- else
- {
- int hash = 0;
- for (int index = fByteCount - 1; index >= 0; index--)
- hash = fByteArray[index] + hash * 31;
- return hash;
- }
- }
- /* Optimization(Jan, 2001) */
-};
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dtd/models/CMUniOp.java b/src/com/sun/org/apache/xerces/internal/impl/dtd/models/CMUniOp.java
deleted file mode 100644
index 97f50c1..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dtd/models/CMUniOp.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999-2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dtd.models;
-
-import com.sun.org.apache.xerces.internal.impl.dtd.XMLContentSpec;
-
-/**
- * Content model Uni-Op node.
- *
- * @xerces.internal
- *
- */
-public class CMUniOp extends CMNode
-{
- // -------------------------------------------------------------------
- // Constructors
- // -------------------------------------------------------------------
- public CMUniOp(int type, CMNode childNode)
- {
- super(type);
-
- // Insure that its one of the types we require
- if ((type() != XMLContentSpec.CONTENTSPECNODE_ZERO_OR_ONE)
- && (type() != XMLContentSpec.CONTENTSPECNODE_ZERO_OR_MORE)
- && (type() != XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE))
- {
- throw new RuntimeException("ImplementationMessages.VAL_UST");
- }
-
- // Store the node and init any data that needs it
- fChild = childNode;
- }
-
-
- // -------------------------------------------------------------------
- // Package, final methods
- // -------------------------------------------------------------------
- final CMNode getChild()
- {
- return fChild;
- }
-
-
- // -------------------------------------------------------------------
- // Package, inherited methods
- // -------------------------------------------------------------------
- public boolean isNullable()
- {
- //
- // For debugging purposes, make sure we got rid of all non '*'
- // repetitions. Otherwise, '*' style nodes are always nullable.
- //
- if (type() == XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE)
- return fChild.isNullable();
- else
- return true;
- }
-
-
- // -------------------------------------------------------------------
- // Protected, inherited methods
- // -------------------------------------------------------------------
- protected void calcFirstPos(CMStateSet toSet)
- {
- // Its just based on our child node's first pos
- toSet.setTo(fChild.firstPos());
- }
-
- protected void calcLastPos(CMStateSet toSet)
- {
- // Its just based on our child node's last pos
- toSet.setTo(fChild.lastPos());
- }
-
-
- // -------------------------------------------------------------------
- // Private data members
- //
- // fChild
- // This is the reference to the one child that we have for this
- // unary operation.
- // -------------------------------------------------------------------
- private CMNode fChild;
-};
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dtd/models/ContentModelValidator.java b/src/com/sun/org/apache/xerces/internal/impl/dtd/models/ContentModelValidator.java
deleted file mode 100644
index b81f5c1..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dtd/models/ContentModelValidator.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999-2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dtd.models;
-
-import com.sun.org.apache.xerces.internal.xni.QName;
-
-/**
- */
-public interface ContentModelValidator {
-
- //
- // Methods
- //
-
- /**
- * validate
- *
- * @param children
- * @param offset
- * @param length
- *
- * @return The value -1 if fully valid, else the 0 based index of the child
- * that first failed. If the value returned is equal to the number
- * of children, then the specified children are valid but additional
- * content is required to reach a valid ending state.
- */
- public int validate(QName[] children, int offset, int length);
-
-} // interface ContentModelValidator
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dtd/models/DFAContentModel.java b/src/com/sun/org/apache/xerces/internal/impl/dtd/models/DFAContentModel.java
deleted file mode 100644
index 9a4e0f5..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dtd/models/DFAContentModel.java
+++ /dev/null
@@ -1,1033 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999-2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dtd.models;
-
-import java.util.HashMap;
-
-import com.sun.org.apache.xerces.internal.impl.dtd.XMLContentSpec;
-import com.sun.org.apache.xerces.internal.xni.QName;
-
-/**
-
- * @version $Id: DFAContentModel.java,v 1.4 2010/08/06 23:49:43 joehw Exp $
- * DFAContentModel is the derivative of ContentModel that does
- * all of the non-trivial element content validation. This class does
- * the conversion from the regular expression to the DFA that
- * it then uses in its validation algorithm.
- * <p>
- * <b>Note:</b> Upstream work insures that this class will never see
- * a content model with PCDATA in it. Any model with PCDATA is 'mixed'
- * and is handled via the MixedContentModel class since mixed models
- * are very constrained in form and easily handled via a special case.
- * This also makes implementation of this class much easier.
- *
- * @xerces.internal
- *
- * @version $Id: DFAContentModel.java,v 1.4 2010/08/06 23:49:43 joehw Exp $
- */
-public class DFAContentModel
- implements ContentModelValidator {
-
- //
- // Constants
- //
- // special strings
-
- /** Epsilon string. */
- private static String fEpsilonString = "<<CMNODE_EPSILON>>";
-
- /** End-of-content string. */
- private static String fEOCString = "<<CMNODE_EOC>>";
-
- /** initializing static members **/
- static {
- fEpsilonString = fEpsilonString.intern();
- fEOCString = fEOCString.intern();
- }
-
- // debugging
-
- /** Set to true to debug content model validation. */
- private static final boolean DEBUG_VALIDATE_CONTENT = false;
-
- //
- // Data
- //
-
- /* this is the EquivClassComparator object */
- //private EquivClassComparator comparator = null;
-
- /**
- * This is the map of unique input symbol elements to indices into
- * each state's per-input symbol transition table entry. This is part
- * of the built DFA information that must be kept around to do the
- * actual validation.
- */
- private QName fElemMap[] = null;
-
- /**
- * This is a map of whether the element map contains information
- * related to ANY models.
- */
- private int fElemMapType[] = null;
-
- /** The element map size. */
- private int fElemMapSize = 0;
-
- /** Boolean to distinguish Schema Mixed Content */
- private boolean fMixed;
-
- /**
- * The NFA position of the special EOC (end of content) node. This
- * is saved away since it's used during the DFA build.
- */
- private int fEOCPos = 0;
-
-
- /**
- * This is an array of booleans, one per state (there are
- * fTransTableSize states in the DFA) that indicates whether that
- * state is a final state.
- */
- private boolean fFinalStateFlags[] = null;
-
- /**
- * The list of follow positions for each NFA position (i.e. for each
- * non-epsilon leaf node.) This is only used during the building of
- * the DFA, and is let go afterwards.
- */
- private CMStateSet fFollowList[] = null;
-
- /**
- * This is the head node of our intermediate representation. It is
- * only non-null during the building of the DFA (just so that it
- * does not have to be passed all around.) Once the DFA is built,
- * this is no longer required so its nulled out.
- */
- private CMNode fHeadNode = null;
-
- /**
- * The count of leaf nodes. This is an important number that set some
- * limits on the sizes of data structures in the DFA process.
- */
- private int fLeafCount = 0;
-
- /**
- * An array of non-epsilon leaf nodes, which is used during the DFA
- * build operation, then dropped.
- */
- private CMLeaf fLeafList[] = null;
-
- /** Array mapping ANY types to the leaf list. */
- private int fLeafListType[] = null;
-
- //private ContentLeafNameTypeVector fLeafNameTypeVector = null;
-
- /**
- * The string pool of our parser session. This is set during construction
- * and kept around.
- */
- //private StringPool fStringPool = null;
-
- /**
- * This is the transition table that is the main by product of all
- * of the effort here. It is an array of arrays of ints. The first
- * dimension is the number of states we end up with in the DFA. The
- * second dimensions is the number of unique elements in the content
- * model (fElemMapSize). Each entry in the second dimension indicates
- * the new state given that input for the first dimension's start
- * state.
- * <p>
- * The fElemMap array handles mapping from element indexes to
- * positions in the second dimension of the transition table.
- */
- private int fTransTable[][] = null;
-
- /**
- * The number of valid entries in the transition table, and in the other
- * related tables such as fFinalStateFlags.
- */
- private int fTransTableSize = 0;
-
- /**
- * Flag that indicates that even though we have a "complicated"
- * content model, it is valid to have no content. In other words,
- * all parts of the content model are optional. For example:
- * <pre>
- * &lt;!ELEMENT AllOptional (Optional*,NotRequired?)&gt;
- * </pre>
- */
- private boolean fEmptyContentIsValid = false;
-
- // temp variables
-
- /** Temporary qualified name. */
- private final QName fQName = new QName();
-
- //
- // Constructors
- //
-
-
- //
- // Constructors
- //
-
- /**
- * Constructs a DFA content model.
- *
- * @param syntaxTree The syntax tree of the content model.
- * @param leafCount The number of leaves.
- * @param mixed
- *
- */
- public DFAContentModel(CMNode syntaxTree, int leafCount, boolean mixed) {
- // Store away our index and pools in members
- //fStringPool = stringPool;
- fLeafCount = leafCount;
-
-
- // this is for Schema Mixed Content
- fMixed = mixed;
-
- //
- // Ok, so lets grind through the building of the DFA. This method
- // handles the high level logic of the algorithm, but it uses a
- // number of helper classes to do its thing.
- //
- // In order to avoid having hundreds of references to the error and
- // string handlers around, this guy and all of his helper classes
- // just throw a simple exception and we then pass it along.
- //
- buildDFA(syntaxTree);
- }
-
- //
- // ContentModelValidator methods
- //
-
- /**
- * Check that the specified content is valid according to this
- * content model. This method can also be called to do 'what if'
- * testing of content models just to see if they would be valid.
- * <p>
- * A value of -1 in the children array indicates a PCDATA node. All other
- * indexes will be positive and represent child elements. The count can be
- * zero, since some elements have the EMPTY content model and that must be
- * confirmed.
- *
- * @param children The children of this element. Each integer is an index within
- * the <code>StringPool</code> of the child element name. An index
- * of -1 is used to indicate an occurrence of non-whitespace character
- * data.
- * @param offset Offset into the array where the children starts.
- * @param length The number of entries in the <code>children</code> array.
- *
- * @return The value -1 if fully valid, else the 0 based index of the child
- * that first failed. If the value returned is equal to the number
- * of children, then the specified children are valid but additional
- * content is required to reach a valid ending state.
- *
- */
- public int validate(QName[] children, int offset, int length) {
-
- if (DEBUG_VALIDATE_CONTENT)
- System.out.println("DFAContentModel#validateContent");
-
- //
- // A DFA content model must *always* have at least 1 child
- // so a failure is given if no children present.
- //
- // Defect 782: This is an incorrect statement because a DFA
- // content model is also used for constructions such as:
- //
- // (Optional*,NotRequired?)
- //
- // where a perfectly valid content would be NO CHILDREN.
- // Therefore, if there are no children, we must check to
- // see if the CMNODE_EOC marker is a valid start state! -Ac
- //
- if (length == 0) {
- if (DEBUG_VALIDATE_CONTENT) {
- System.out.println("!!! no children");
- System.out.println("elemMap="+fElemMap);
- for (int i = 0; i < fElemMap.length; i++) {
- String uri = fElemMap[i].uri;
- String localpart = fElemMap[i].localpart;
-
- System.out.println("fElemMap["+i+"]="+uri+","+
- localpart+" ("+
- uri+", "+
- localpart+
- ')');
-
- }
- System.out.println("EOCIndex="+fEOCString);
- }
-
- return fEmptyContentIsValid ? -1 : 0;
-
- } // if child count == 0
-
- //
- // Lets loop through the children in the array and move our way
- // through the states. Note that we use the fElemMap array to map
- // an element index to a state index.
- //
- int curState = 0;
- for (int childIndex = 0; childIndex < length; childIndex++)
- {
- // Get the current element index out
- final QName curElem = children[offset + childIndex];
- // ignore mixed text
- if (fMixed && curElem.localpart == null) {
- continue;
- }
-
- // Look up this child in our element map
- int elemIndex = 0;
- for (; elemIndex < fElemMapSize; elemIndex++)
- {
- int type = fElemMapType[elemIndex] & 0x0f ;
- if (type == XMLContentSpec.CONTENTSPECNODE_LEAF) {
- //System.out.println("fElemMap["+elemIndex+"]: "+fElemMap[elemIndex]);
- if (fElemMap[elemIndex].rawname == curElem.rawname) {
- break;
- }
- }
- else if (type == XMLContentSpec.CONTENTSPECNODE_ANY) {
- String uri = fElemMap[elemIndex].uri;
- if (uri == null || uri == curElem.uri) {
- break;
- }
- }
- else if (type == XMLContentSpec.CONTENTSPECNODE_ANY_LOCAL) {
- if (curElem.uri == null) {
- break;
- }
- }
- else if (type == XMLContentSpec.CONTENTSPECNODE_ANY_OTHER) {
- if (fElemMap[elemIndex].uri != curElem.uri) {
- break;
- }
- }
- }
-
- // If we didn't find it, then obviously not valid
- if (elemIndex == fElemMapSize) {
- if (DEBUG_VALIDATE_CONTENT) {
- System.out.println("!!! didn't find it");
-
- System.out.println("curElem : " +curElem );
- for (int i=0; i<fElemMapSize; i++) {
- System.out.println("fElemMap["+i+"] = " +fElemMap[i] );
- System.out.println("fElemMapType["+i+"] = " +fElemMapType[i] );
- }
- }
-
- return childIndex;
- }
-
- //
- // Look up the next state for this input symbol when in the
- // current state.
- //
- curState = fTransTable[curState][elemIndex];
-
- // If its not a legal transition, then invalid
- if (curState == -1) {
- if (DEBUG_VALIDATE_CONTENT)
- System.out.println("!!! not a legal transition");
- return childIndex;
- }
- }
-
- //
- // We transitioned all the way through the input list. However, that
- // does not mean that we ended in a final state. So check whether
- // our ending state is a final state.
- //
- if (DEBUG_VALIDATE_CONTENT)
- System.out.println("curState="+curState+", childCount="+length);
- if (!fFinalStateFlags[curState])
- return length;
-
- // success!
- return -1;
- } // validate
-
-
- //
- // Private methods
- //
-
- /**
- * Builds the internal DFA transition table from the given syntax tree.
- *
- * @param syntaxTree The syntax tree.
- *
- * @exception CMException Thrown if DFA cannot be built.
- */
- private void buildDFA(CMNode syntaxTree)
- {
- //
- // The first step we need to take is to rewrite the content model
- // using our CMNode objects, and in the process get rid of any
- // repetition short cuts, converting them into '*' style repetitions
- // or getting rid of repetitions altogether.
- //
- // The conversions done are:
- //
- // x+ -> (x|x*)
- // x? -> (x|epsilon)
- //
- // This is a relatively complex scenario. What is happening is that
- // we create a top level binary node of which the special EOC value
- // is set as the right side node. The the left side is set to the
- // rewritten syntax tree. The source is the original content model
- // info from the decl pool. The rewrite is done by buildSyntaxTree()
- // which recurses the decl pool's content of the element and builds
- // a new tree in the process.
- //
- // Note that, during this operation, we set each non-epsilon leaf
- // node's DFA state position and count the number of such leafs, which
- // is left in the fLeafCount member.
- //
- // The nodeTmp object is passed in just as a temp node to use during
- // the recursion. Otherwise, we'd have to create a new node on every
- // level of recursion, which would be piggy in Java (as is everything
- // for that matter.)
- //
-
- /* MODIFIED (Jan, 2001)
- *
- * Use following rules.
- * nullable(x+) := nullable(x), first(x+) := first(x), last(x+) := last(x)
- * nullable(x?) := true, first(x?) := first(x), last(x?) := last(x)
- *
- * The same computation of follow as x* is applied to x+
- *
- * The modification drastically reduces computation time of
- * "(a, (b, a+, (c, (b, a+)+, a+, (d, (c, (b, a+)+, a+)+, (b, a+)+, a+)+)+)+)+"
- */
-
- fQName.setValues(null, fEOCString, fEOCString, null);
- CMLeaf nodeEOC = new CMLeaf(fQName);
- fHeadNode = new CMBinOp
- (
- XMLContentSpec.CONTENTSPECNODE_SEQ
- , syntaxTree
- , nodeEOC
- );
-
- //
- // And handle specially the EOC node, which also must be numbered
- // and counted as a non-epsilon leaf node. It could not be handled
- // in the above tree build because it was created before all that
- // started. We save the EOC position since its used during the DFA
- // building loop.
- //
- fEOCPos = fLeafCount;
- nodeEOC.setPosition(fLeafCount++);
-
- //
- // Ok, so now we have to iterate the new tree and do a little more
- // work now that we know the leaf count. One thing we need to do is
- // to calculate the first and last position sets of each node. This
- // is cached away in each of the nodes.
- //
- // Along the way we also set the leaf count in each node as the
- // maximum state count. They must know this in order to create their
- // first/last pos sets.
- //
- // We also need to build an array of references to the non-epsilon
- // leaf nodes. Since we iterate it in the same way as before, this
- // will put them in the array according to their position values.
- //
- fLeafList = new CMLeaf[fLeafCount];
- fLeafListType = new int[fLeafCount];
- postTreeBuildInit(fHeadNode, 0);
-
- //
- // And, moving onward... We now need to build the follow position
- // sets for all the nodes. So we allocate an array of state sets,
- // one for each leaf node (i.e. each DFA position.)
- //
- fFollowList = new CMStateSet[fLeafCount];
- for (int index = 0; index < fLeafCount; index++)
- fFollowList[index] = new CMStateSet(fLeafCount);
- calcFollowList(fHeadNode);
- //
- // And finally the big push... Now we build the DFA using all the
- // states and the tree we've built up. First we set up the various
- // data structures we are going to use while we do this.
- //
- // First of all we need an array of unique element names in our
- // content model. For each transition table entry, we need a set of
- // contiguous indices to represent the transitions for a particular
- // input element. So we need to a zero based range of indexes that
- // map to element types. This element map provides that mapping.
- //
- fElemMap = new QName[fLeafCount];
- fElemMapType = new int[fLeafCount];
- fElemMapSize = 0;
- for (int outIndex = 0; outIndex < fLeafCount; outIndex++)
- {
- fElemMap[outIndex] = new QName();
-
- /****
- if ( (fLeafListType[outIndex] & 0x0f) != 0 ) {
- if (fLeafNameTypeVector == null) {
- fLeafNameTypeVector = new ContentLeafNameTypeVector();
- }
- }
- /****/
-
- // Get the current leaf's element index
- final QName element = fLeafList[outIndex].getElement();
-
- // See if the current leaf node's element index is in the list
- int inIndex = 0;
- for (; inIndex < fElemMapSize; inIndex++)
- {
- if (fElemMap[inIndex].rawname == element.rawname) {
- break;
- }
- }
-
- // If it was not in the list, then add it, if not the EOC node
- if (inIndex == fElemMapSize) {
- fElemMap[fElemMapSize].setValues(element);
- fElemMapType[fElemMapSize] = fLeafListType[outIndex];
- fElemMapSize++;
- }
- }
- // set up the fLeafNameTypeVector object if there is one.
- /*****
- if (fLeafNameTypeVector != null) {
- fLeafNameTypeVector.setValues(fElemMap, fElemMapType, fElemMapSize);
- }
-
- /***
- * Optimization(Jan, 2001); We sort fLeafList according to
- * elemIndex which is *uniquely* associated to each leaf.
- * We are *assuming* that each element appears in at least one leaf.
- **/
-
- int[] fLeafSorter = new int[fLeafCount + fElemMapSize];
- int fSortCount = 0;
-
- for (int elemIndex = 0; elemIndex < fElemMapSize; elemIndex++) {
- for (int leafIndex = 0; leafIndex < fLeafCount; leafIndex++) {
- final QName leaf = fLeafList[leafIndex].getElement();
- final QName element = fElemMap[elemIndex];
- if (leaf.rawname == element.rawname) {
- fLeafSorter[fSortCount++] = leafIndex;
- }
- }
- fLeafSorter[fSortCount++] = -1;
- }
-
- /* Optimization(Jan, 2001) */
-
- //
- // Next lets create some arrays, some that that hold transient
- // information during the DFA build and some that are permament.
- // These are kind of sticky since we cannot know how big they will
- // get, but we don't want to use any Java collections because of
- // performance.
- //
- // Basically they will probably be about fLeafCount*2 on average,
- // but can be as large as 2^(fLeafCount*2), worst case. So we start
- // with fLeafCount*4 as a middle ground. This will be very unlikely
- // to ever have to expand, though it if does, the overhead will be
- // somewhat ugly.
- //
- int curArraySize = fLeafCount * 4;
- CMStateSet[] statesToDo = new CMStateSet[curArraySize];
- fFinalStateFlags = new boolean[curArraySize];
- fTransTable = new int[curArraySize][];
-
- //
- // Ok we start with the initial set as the first pos set of the
- // head node (which is the seq node that holds the content model
- // and the EOC node.)
- //
- CMStateSet setT = fHeadNode.firstPos();
-
- //
- // Init our two state flags. Basically the unmarked state counter
- // is always chasing the current state counter. When it catches up,
- // that means we made a pass through that did not add any new states
- // to the lists, at which time we are done. We could have used a
- // expanding array of flags which we used to mark off states as we
- // complete them, but this is easier though less readable maybe.
- //
- int unmarkedState = 0;
- int curState = 0;
-
- //
- // Init the first transition table entry, and put the initial state
- // into the states to do list, then bump the current state.
- //
- fTransTable[curState] = makeDefStateList();
- statesToDo[curState] = setT;
- curState++;
-
- /* Optimization(Jan, 2001); This is faster for
- * a large content model such as, "(t001+|t002+|.... |t500+)".
- */
-
- HashMap stateTable = new HashMap();
-
- /* Optimization(Jan, 2001) */
-
- //
- // Ok, almost done with the algorithm... We now enter the
- // loop where we go until the states done counter catches up with
- // the states to do counter.
- //
- while (unmarkedState < curState)
- {
- //
- // Get the first unmarked state out of the list of states to do.
- // And get the associated transition table entry.
- //
- setT = statesToDo[unmarkedState];
- int[] transEntry = fTransTable[unmarkedState];
-
- // Mark this one final if it contains the EOC state
- fFinalStateFlags[unmarkedState] = setT.getBit(fEOCPos);
-
- // Bump up the unmarked state count, marking this state done
- unmarkedState++;
-
- // Loop through each possible input symbol in the element map
- CMStateSet newSet = null;
- /* Optimization(Jan, 2001) */
- int sorterIndex = 0;
- /* Optimization(Jan, 2001) */
- for (int elemIndex = 0; elemIndex < fElemMapSize; elemIndex++)
- {
- //
- // Build up a set of states which is the union of all of
- // the follow sets of DFA positions that are in the current
- // state. If we gave away the new set last time through then
- // create a new one. Otherwise, zero out the existing one.
- //
- if (newSet == null)
- newSet = new CMStateSet(fLeafCount);
- else
- newSet.zeroBits();
-
- /* Optimization(Jan, 2001) */
- int leafIndex = fLeafSorter[sorterIndex++];
-
- while (leafIndex != -1) {
- // If this leaf index (DFA position) is in the current set...
- if (setT.getBit(leafIndex))
- {
- //
- // If this leaf is the current input symbol, then we
- // want to add its follow list to the set of states to
- // transition to from the current state.
- //
- newSet.union(fFollowList[leafIndex]);
- }
-
- leafIndex = fLeafSorter[sorterIndex++];
- }
- /* Optimization(Jan, 2001) */
-
- //
- // If this new set is not empty, then see if its in the list
- // of states to do. If not, then add it.
- //
- if (!newSet.isEmpty())
- {
- //
- // Search the 'states to do' list to see if this new
- // state set is already in there.
- //
-
- /* Optimization(Jan, 2001) */
- Integer stateObj = (Integer)stateTable.get(newSet);
- int stateIndex = (stateObj == null ? curState : stateObj.intValue());
- /* Optimization(Jan, 2001) */
-
- // If we did not find it, then add it
- if (stateIndex == curState)
- {
- //
- // Put this new state into the states to do and init
- // a new entry at the same index in the transition
- // table.
- //
- statesToDo[curState] = newSet;
- fTransTable[curState] = makeDefStateList();
-
- /* Optimization(Jan, 2001) */
- stateTable.put(newSet, new Integer(curState));
- /* Optimization(Jan, 2001) */
-
- // We now have a new state to do so bump the count
- curState++;
-
- //
- // Null out the new set to indicate we adopted it.
- // This will cause the creation of a new set on the
- // next time around the loop.
- //
- newSet = null;
- }
-
- //
- // Now set this state in the transition table's entry
- // for this element (using its index), with the DFA
- // state we will move to from the current state when we
- // see this input element.
- //
- transEntry[elemIndex] = stateIndex;
-
- // Expand the arrays if we're full
- if (curState == curArraySize)
- {
- //
- // Yikes, we overflowed the initial array size, so
- // we've got to expand all of these arrays. So adjust
- // up the size by 50% and allocate new arrays.
- //
- final int newSize = (int)(curArraySize * 1.5);
- CMStateSet[] newToDo = new CMStateSet[newSize];
- boolean[] newFinalFlags = new boolean[newSize];
- int[][] newTransTable = new int[newSize][];
-
- // Copy over all of the existing content
- System.arraycopy(statesToDo, 0, newToDo, 0, curArraySize);
- System.arraycopy(fFinalStateFlags, 0, newFinalFlags, 0, curArraySize);
- System.arraycopy(fTransTable, 0, newTransTable, 0, curArraySize);
-
- // Store the new array size
- curArraySize = newSize;
- statesToDo = newToDo;
- fFinalStateFlags = newFinalFlags;
- fTransTable = newTransTable;
- }
- }
- }
- }
-
- // Check to see if we can set the fEmptyContentIsValid flag.
- fEmptyContentIsValid = ((CMBinOp)fHeadNode).getLeft().isNullable();
-
- //
- // And now we can say bye bye to the temp representation since we've
- // built the DFA.
- //
- if (DEBUG_VALIDATE_CONTENT)
- dumpTree(fHeadNode, 0);
- fHeadNode = null;
- fLeafList = null;
- fFollowList = null;
-
- }
-
- /**
- * Calculates the follow list of the current node.
- *
- * @param nodeCur The curent node.
- *
- * @exception CMException Thrown if follow list cannot be calculated.
- */
- private void calcFollowList(CMNode nodeCur)
- {
- // Recurse as required
- if (nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_CHOICE)
- {
- // Recurse only
- calcFollowList(((CMBinOp)nodeCur).getLeft());
- calcFollowList(((CMBinOp)nodeCur).getRight());
- }
- else if (nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_SEQ)
- {
- // Recurse first
- calcFollowList(((CMBinOp)nodeCur).getLeft());
- calcFollowList(((CMBinOp)nodeCur).getRight());
-
- //
- // Now handle our level. We use our left child's last pos
- // set and our right child's first pos set, so go ahead and
- // get them ahead of time.
- //
- final CMStateSet last = ((CMBinOp)nodeCur).getLeft().lastPos();
- final CMStateSet first = ((CMBinOp)nodeCur).getRight().firstPos();
-
- //
- // Now, for every position which is in our left child's last set
- // add all of the states in our right child's first set to the
- // follow set for that position.
- //
- for (int index = 0; index < fLeafCount; index++)
- {
- if (last.getBit(index))
- fFollowList[index].union(first);
- }
- }
- /***
- else if (nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_MORE)
- {
- // Recurse first
- calcFollowList(((CMUniOp)nodeCur).getChild());
-
- //
- // Now handle our level. We use our own first and last position
- // sets, so get them up front.
- //
- final CMStateSet first = nodeCur.firstPos();
- final CMStateSet last = nodeCur.lastPos();
-
- //
- // For every position which is in our last position set, add all
- // of our first position states to the follow set for that
- // position.
- //
- for (int index = 0; index < fLeafCount; index++)
- {
- if (last.getBit(index))
- fFollowList[index].union(first);
- }
- }
- else if ((nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE)
- || (nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_ONE))
- {
- throw new RuntimeException("ImplementationMessages.VAL_NIICM");
- }
- /***/
- else if (nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_MORE
- || nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE)
- {
- // Recurse first
- calcFollowList(((CMUniOp)nodeCur).getChild());
-
- //
- // Now handle our level. We use our own first and last position
- // sets, so get them up front.
- //
- final CMStateSet first = nodeCur.firstPos();
- final CMStateSet last = nodeCur.lastPos();
-
- //
- // For every position which is in our last position set, add all
- // of our first position states to the follow set for that
- // position.
- //
- for (int index = 0; index < fLeafCount; index++)
- {
- if (last.getBit(index))
- fFollowList[index].union(first);
- }
- }
-
- else if (nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_ONE) {
- // Recurse only
- calcFollowList(((CMUniOp)nodeCur).getChild());
- }
- /***/
- }
-
- /**
- * Dumps the tree of the current node to standard output.
- *
- * @param nodeCur The current node.
- * @param level The maximum levels to output.
- *
- * @exception CMException Thrown on error.
- */
- private void dumpTree(CMNode nodeCur, int level)
- {
- for (int index = 0; index < level; index++)
- System.out.print(" ");
-
- int type = nodeCur.type();
- if ((type == XMLContentSpec.CONTENTSPECNODE_CHOICE)
- || (type == XMLContentSpec.CONTENTSPECNODE_SEQ))
- {
- if (type == XMLContentSpec.CONTENTSPECNODE_CHOICE)
- System.out.print("Choice Node ");
- else
- System.out.print("Seq Node ");
-
- if (nodeCur.isNullable())
- System.out.print("Nullable ");
-
- System.out.print("firstPos=");
- System.out.print(nodeCur.firstPos().toString());
- System.out.print(" lastPos=");
- System.out.println(nodeCur.lastPos().toString());
-
- dumpTree(((CMBinOp)nodeCur).getLeft(), level+1);
- dumpTree(((CMBinOp)nodeCur).getRight(), level+1);
- }
- else if (nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_MORE)
- {
- System.out.print("Rep Node ");
-
- if (nodeCur.isNullable())
- System.out.print("Nullable ");
-
- System.out.print("firstPos=");
- System.out.print(nodeCur.firstPos().toString());
- System.out.print(" lastPos=");
- System.out.println(nodeCur.lastPos().toString());
-
- dumpTree(((CMUniOp)nodeCur).getChild(), level+1);
- }
- else if (nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_LEAF)
- {
- System.out.print
- (
- "Leaf: (pos="
- + ((CMLeaf)nodeCur).getPosition()
- + "), "
- + ((CMLeaf)nodeCur).getElement()
- + "(elemIndex="
- + ((CMLeaf)nodeCur).getElement()
- + ") "
- );
-
- if (nodeCur.isNullable())
- System.out.print(" Nullable ");
-
- System.out.print("firstPos=");
- System.out.print(nodeCur.firstPos().toString());
- System.out.print(" lastPos=");
- System.out.println(nodeCur.lastPos().toString());
- }
- else
- {
- throw new RuntimeException("ImplementationMessages.VAL_NIICM");
- }
- }
-
-
- /**
- * -1 is used to represent bad transitions in the transition table
- * entry for each state. So each entry is initialized to an all -1
- * array. This method creates a new entry and initializes it.
- */
- private int[] makeDefStateList()
- {
- int[] retArray = new int[fElemMapSize];
- for (int index = 0; index < fElemMapSize; index++)
- retArray[index] = -1;
- return retArray;
- }
-
- /** Post tree build initialization. */
- private int postTreeBuildInit(CMNode nodeCur, int curIndex)
- {
- // Set the maximum states on this node
- nodeCur.setMaxStates(fLeafCount);
-
- // Recurse as required
- if ((nodeCur.type() & 0x0f) == XMLContentSpec.CONTENTSPECNODE_ANY ||
- (nodeCur.type() & 0x0f) == XMLContentSpec.CONTENTSPECNODE_ANY_LOCAL ||
- (nodeCur.type() & 0x0f) == XMLContentSpec.CONTENTSPECNODE_ANY_OTHER) {
- // REVISIT: Don't waste these structures.
- QName qname = new QName(null, null, null, ((CMAny)nodeCur).getURI());
- fLeafList[curIndex] = new CMLeaf(qname, ((CMAny)nodeCur).getPosition());
- fLeafListType[curIndex] = nodeCur.type();
- curIndex++;
- }
- else if ((nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_CHOICE)
- || (nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_SEQ))
- {
- curIndex = postTreeBuildInit(((CMBinOp)nodeCur).getLeft(), curIndex);
- curIndex = postTreeBuildInit(((CMBinOp)nodeCur).getRight(), curIndex);
- }
- else if (nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_MORE
- || nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE
- || nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_ONE)
- {
- curIndex = postTreeBuildInit(((CMUniOp)nodeCur).getChild(), curIndex);
- }
- else if (nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_LEAF)
- {
- //
- // Put this node in the leaf list at the current index if its
- // a non-epsilon leaf.
- //
- final QName node = ((CMLeaf)nodeCur).getElement();
- if (node.localpart != fEpsilonString) {
- fLeafList[curIndex] = (CMLeaf)nodeCur;
- fLeafListType[curIndex] = XMLContentSpec.CONTENTSPECNODE_LEAF;
- curIndex++;
- }
- }
- else
- {
- throw new RuntimeException("ImplementationMessages.VAL_NIICM: type="+nodeCur.type());
- }
- return curIndex;
- }
-
-} // class DFAContentModel
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dtd/models/MixedContentModel.java b/src/com/sun/org/apache/xerces/internal/impl/dtd/models/MixedContentModel.java
deleted file mode 100644
index 8d4cda2..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dtd/models/MixedContentModel.java
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999-2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dtd.models;
-
-import com.sun.org.apache.xerces.internal.xni.QName;
-
-import com.sun.org.apache.xerces.internal.impl.dtd.XMLContentSpec;
-
-/**
- * MixedContentModel is a derivative of the abstract content model base
- * class that handles the special case of mixed model elements. If an element
- * is mixed model, it has PCDATA as its first possible content, followed
- * by an alternation of the possible children. The children cannot have any
- * numeration or order, so it must look like this:
- * <pre>
- * &lt;!ELEMENT Foo ((#PCDATA|a|b|c|)*)&gt;
- * </pre>
- * So, all we have to do is to keep an array of the possible children and
- * validate by just looking up each child being validated by looking it up
- * in the list.
- *
- * @xerces.internal
- *
- */
-public class MixedContentModel
- implements ContentModelValidator {
-
- //
- // Data
- //
-
- /** The count of possible children that we have to deal with. */
- private int fCount;
-
- /** The list of possible children that we have to accept. */
- private QName fChildren[];
-
- /** The type of the children to support ANY. */
- private int fChildrenType[];
-
- /* this is the EquivClassComparator object */
- //private EquivClassComparator comparator = null;
-
- /**
- * True if mixed content model is ordered. DTD mixed content models
- * are <em>always</em> unordered.
- */
- private boolean fOrdered;
-
- //
- // Constructors
- //
-
- /**
- * Constructs a mixed content model.
- *
- * @param children The list of allowed children.
- * @param type The list of the types of the children.
- * @param offset The start offset position in the children.
- * @param length The child count.
- * @param ordered True if content must be ordered.
- */
- public MixedContentModel(QName[] children, int[] type, int offset, int length , boolean ordered) {
- // Make our own copy now, which is exactly the right size
- fCount = length;
- fChildren = new QName[fCount];
- fChildrenType = new int[fCount];
- for (int i = 0; i < fCount; i++) {
- fChildren[i] = new QName(children[offset + i]);
- fChildrenType[i] = type[offset + i];
- }
- fOrdered = ordered;
-
- }
-
- //
- // ContentModelValidator methods
- //
-
-
- /**
- * Check that the specified content is valid according to this
- * content model. This method can also be called to do 'what if'
- * testing of content models just to see if they would be valid.
- * <p>
- * A value of -1 in the children array indicates a PCDATA node. All other
- * indexes will be positive and represent child elements. The count can be
- * zero, since some elements have the EMPTY content model and that must be
- * confirmed.
- *
- * @param children The children of this element. Each integer is an index within
- * the <code>StringPool</code> of the child element name. An index
- * of -1 is used to indicate an occurrence of non-whitespace character
- * data.
- * @param offset Offset into the array where the children starts.
- * @param length The number of entries in the <code>children</code> array.
- *
- * @return The value -1 if fully valid, else the 0 based index of the child
- * that first failed. If the value returned is equal to the number
- * of children, then the specified children are valid but additional
- * content is required to reach a valid ending state.
- *
- */
- public int validate(QName[] children, int offset, int length) {
-
- // must match order
- if (fOrdered) {
- int inIndex = 0;
- for (int outIndex = 0; outIndex < length; outIndex++) {
-
- // ignore mixed text
- final QName curChild = children[offset + outIndex];
- if (curChild.localpart == null) {
- continue;
- }
-
- // element must match
- int type = fChildrenType[inIndex];
- if (type == XMLContentSpec.CONTENTSPECNODE_LEAF) {
- if (fChildren[inIndex].rawname != children[offset + outIndex].rawname) {
- return outIndex;
- }
- }
- else if (type == XMLContentSpec.CONTENTSPECNODE_ANY) {
- String uri = fChildren[inIndex].uri;
- if (uri != null && uri != children[outIndex].uri) {
- return outIndex;
- }
- }
- else if (type == XMLContentSpec.CONTENTSPECNODE_ANY_LOCAL) {
- if (children[outIndex].uri != null) {
- return outIndex;
- }
- }
- else if (type == XMLContentSpec.CONTENTSPECNODE_ANY_OTHER) {
- if (fChildren[inIndex].uri == children[outIndex].uri) {
- return outIndex;
- }
- }
-
- // advance index
- inIndex++;
- }
- }
-
- // can appear in any order
- else {
- for (int outIndex = 0; outIndex < length; outIndex++)
- {
- // Get the current child out of the source index
- final QName curChild = children[offset + outIndex];
-
- // If its PCDATA, then we just accept that
- if (curChild.localpart == null)
- continue;
-
- // And try to find it in our list
- int inIndex = 0;
- for (; inIndex < fCount; inIndex++)
- {
- int type = fChildrenType[inIndex];
- if (type == XMLContentSpec.CONTENTSPECNODE_LEAF) {
- if (curChild.rawname == fChildren[inIndex].rawname) {
- break;
- }
- }
- else if (type == XMLContentSpec.CONTENTSPECNODE_ANY) {
- String uri = fChildren[inIndex].uri;
- if (uri == null || uri == children[outIndex].uri) {
- break;
- }
- }
- else if (type == XMLContentSpec.CONTENTSPECNODE_ANY_LOCAL) {
- if (children[outIndex].uri == null) {
- break;
- }
- }
- else if (type == XMLContentSpec.CONTENTSPECNODE_ANY_OTHER) {
- if (fChildren[inIndex].uri != children[outIndex].uri) {
- break;
- }
- }
- // REVISIT: What about checking for multiple ANY matches?
- // The content model ambiguity *could* be checked
- // by the caller before constructing the mixed
- // content model.
- }
-
- // We did not find this one, so the validation failed
- if (inIndex == fCount)
- return outIndex;
- }
- }
-
- // Everything seems to be in order, so return success
- return -1;
- } // validate
-
-} // class MixedContentModel
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dtd/models/SimpleContentModel.java b/src/com/sun/org/apache/xerces/internal/impl/dtd/models/SimpleContentModel.java
deleted file mode 100644
index 73ae37d..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dtd/models/SimpleContentModel.java
+++ /dev/null
@@ -1,320 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999-2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dtd.models;
-
-import com.sun.org.apache.xerces.internal.xni.QName;
-
-import com.sun.org.apache.xerces.internal.impl.dtd.XMLContentSpec;
-
-/**
- * SimpleContentModel is a derivative of the abstract content model base
- * class that handles a small set of simple content models that are just
- * way overkill to give the DFA treatment.
- * <p>
- * This class handles the following scenarios:
- * <ul>
- * <li> a
- * <li> a?
- * <li> a*
- * <li> a+
- * <li> a,b
- * <li> a|b
- * </ul>
- * <p>
- * These all involve a unary operation with one element type, or a binary
- * operation with two elements. These are very simple and can be checked
- * in a simple way without a DFA and without the overhead of setting up a
- * DFA for such a simple check.
- *
- * @xerces.internal
- *
- */
-public class SimpleContentModel
- implements ContentModelValidator {
-
- //
- // Constants
- //
-
- /** CHOICE */
- public static final short CHOICE = -1;
-
- /** SEQUENCE */
- public static final short SEQUENCE = -1;
-
- //
- // Data
- //
-
-
- /**
- * The element decl pool indices of the first (and optional second)
- * child node. The operation code tells us whether the second child
- * is used or not.
- */
- private QName fFirstChild = new QName();
-
- /**
- * The element decl pool indices of the first (and optional second)
- * child node. The operation code tells us whether the second child
- * is used or not.
- */
- private QName fSecondChild = new QName();
-
- /**
- * The operation that this object represents. Since this class only
- * does simple contents, there is only ever a single operation
- * involved (i.e. the children of the operation are always one or
- * two leafs.) This is one of the XMLDTDParams.CONTENTSPECNODE_XXX values.
- */
- private int fOperator;
-
- /* this is the EquivClassComparator object */
- //private EquivClassComparator comparator = null;
-
-
- //
- // Constructors
- //
-
- /**
- * Constructs a simple content model.
- *
- * @param operator The content model operator.
- * @param firstChild qualified name of the first child
- * @param secondChild qualified name of the second child
- *
- */
- public SimpleContentModel(short operator, QName firstChild, QName secondChild) {
- //
- // Store away the children and operation. This is all we need to
- // do the content model check.
- //
- // The operation is one of the ContentSpecNode.NODE_XXX values!
- //
- fFirstChild.setValues(firstChild);
- if (secondChild != null) {
- fSecondChild.setValues(secondChild);
- }
- else {
- fSecondChild.clear();
- }
- fOperator = operator;
- }
-
- //
- // ContentModelValidator methods
- //
-
- /**
- * Check that the specified content is valid according to this
- * content model. This method can also be called to do 'what if'
- * testing of content models just to see if they would be valid.
- * <p>
- * A value of -1 in the children array indicates a PCDATA node. All other
- * indexes will be positive and represent child elements. The count can be
- * zero, since some elements have the EMPTY content model and that must be
- * confirmed.
- *
- * @param children The children of this element. Each integer is an index within
- * the <code>StringPool</code> of the child element name. An index
- * of -1 is used to indicate an occurrence of non-whitespace character
- * data.
- * @param offset Offset into the array where the children starts.
- * @param length The number of entries in the <code>children</code> array.
- *
- * @return The value -1 if fully valid, else the 0 based index of the child
- * that first failed. If the value returned is equal to the number
- * of children, then the specified children are valid but additional
- * content is required to reach a valid ending state.
- *
- */
- public int validate(QName[] children, int offset, int length) {
-
- //
- // According to the type of operation, we do the correct type of
- // content check.
- //
- switch(fOperator)
- {
- case XMLContentSpec.CONTENTSPECNODE_LEAF :
- // If there is not a child, then report an error at index 0
- if (length == 0)
- return 0;
-
- // If the 0th child is not the right kind, report an error at 0
- if (children[offset].rawname != fFirstChild.rawname) {
- return 0;
- }
-
- // If more than one child, report an error at index 1
- if (length > 1)
- return 1;
- break;
-
- case XMLContentSpec.CONTENTSPECNODE_ZERO_OR_ONE :
- //
- // If there is one child, make sure its the right type. If not,
- // then its an error at index 0.
- //
- if (length == 1) {
- if (children[offset].rawname != fFirstChild.rawname) {
- return 0;
- }
- }
-
- //
- // If the child count is greater than one, then obviously
- // bad, so report an error at index 1.
- //
- if (length > 1)
- return 1;
- break;
-
- case XMLContentSpec.CONTENTSPECNODE_ZERO_OR_MORE :
- //
- // If the child count is zero, that's fine. If its more than
- // zero, then make sure that all children are of the element
- // type that we stored. If not, report the index of the first
- // failed one.
- //
- if (length > 0)
- {
- for (int index = 0; index < length; index++) {
- if (children[offset + index].rawname != fFirstChild.rawname) {
- return index;
- }
- }
- }
- break;
-
- case XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE :
- //
- // If the child count is zero, that's an error so report
- // an error at index 0.
- //
- if (length == 0)
- return 0;
-
- //
- // Otherwise we have to check them all to make sure that they
- // are of the correct child type. If not, then report the index
- // of the first one that is not.
- //
- for (int index = 0; index < length; index++) {
- if (children[offset + index].rawname != fFirstChild.rawname) {
- return index;
- }
- }
- break;
-
- case XMLContentSpec.CONTENTSPECNODE_CHOICE :
- //
- // There must be one and only one child, so if the element count
- // is zero, return an error at index 0.
- //
- if (length == 0)
- return 0;
-
- // If the zeroth element isn't one of our choices, error at 0
- if ((children[offset].rawname != fFirstChild.rawname) &&
- (children[offset].rawname != fSecondChild.rawname)) {
- return 0;
- }
-
- // If there is more than one element, then an error at 1
- if (length > 1)
- return 1;
- break;
-
- case XMLContentSpec.CONTENTSPECNODE_SEQ :
- //
- // There must be two children and they must be the two values
- // we stored, in the stored order.
- //
- if (length == 2) {
- if (children[offset].rawname != fFirstChild.rawname) {
- return 0;
- }
- if (children[offset + 1].rawname != fSecondChild.rawname) {
- return 1;
- }
- }
- else {
- if (length > 2) {
- return 2;
- }
-
- return length;
- }
-
- break;
-
- default :
- throw new RuntimeException("ImplementationMessages.VAL_CST");
- }
-
- // We survived, so return success status
- return -1;
- } // validate
-
-} // class SimpleContentModel
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/DTDDVFactory.java b/src/com/sun/org/apache/xerces/internal/impl/dv/DTDDVFactory.java
deleted file mode 100644
index ccfccb0..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/DTDDVFactory.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv;
-
-import com.sun.org.apache.xerces.internal.impl.dv.dtd.DTDDVFactoryImpl;
-import com.sun.org.apache.xerces.internal.impl.dv.dtd.XML11DTDDVFactoryImpl;
-import com.sun.org.apache.xerces.internal.utils.ObjectFactory;
-import java.util.Map;
-
-/**
- * The factory to create and return DTD types. The implementation should
- * store the created datatypes in static data, so that they can be shared by
- * multiple parser instance, and multiple threads.
- *
- * @xerces.internal
- *
- * @author Sandy Gao, IBM
- *
- * @version $Id: DTDDVFactory.java,v 1.6 2010-11-01 04:39:43 joehw Exp $
- */
-public abstract class DTDDVFactory {
-
- private static final String DEFAULT_FACTORY_CLASS =
- "com.sun.org.apache.xerces.internal.impl.dv.dtd.DTDDVFactoryImpl";
-
- private static final String XML11_DATATYPE_VALIDATOR_FACTORY =
- "com.sun.org.apache.xerces.internal.impl.dv.dtd.XML11DTDDVFactoryImpl";
-
- /**
- * Get an instance of the default DTDDVFactory implementation.
- *
- * @return an instance of DTDDVFactory implementation
- * @exception DVFactoryException cannot create an instance of the specified
- * class name or the default class name
- */
- public static final DTDDVFactory getInstance() throws DVFactoryException {
- return getInstance(DEFAULT_FACTORY_CLASS);
- }
-
- /**
- * Get an instance of DTDDVFactory implementation.
- *
- * @param factoryClass name of the implementation to load.
- * @return an instance of DTDDVFactory implementation
- * @exception DVFactoryException cannot create an instance of the specified
- * class name or the default class name
- */
- public static final DTDDVFactory getInstance(String factoryClass) throws DVFactoryException {
- try {
- if (DEFAULT_FACTORY_CLASS.equals(factoryClass)) {
- return new DTDDVFactoryImpl();
- } else if (XML11_DATATYPE_VALIDATOR_FACTORY.equals(factoryClass)) {
- return new XML11DTDDVFactoryImpl();
- } else {
- //fall back for compatibility
- return (DTDDVFactory)
- (ObjectFactory.newInstance(factoryClass, true));
- }
- }
- catch (ClassCastException e) {
- throw new DVFactoryException("DTD factory class " + factoryClass + " does not extend from DTDDVFactory.");
- }
- }
-
- // can't create a new object of this class
- protected DTDDVFactory() {}
-
- /**
- * return a dtd type of the given name
- *
- * @param name the name of the datatype
- * @return the datatype validator of the given name
- */
- public abstract DatatypeValidator getBuiltInDV(String name);
-
- /**
- * get all built-in DVs, which are stored in a map keyed by the name
- *
- * @return a map which contains all datatypes
- */
- public abstract Map<String, DatatypeValidator> getBuiltInTypes();
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/DVFactoryException.java b/src/com/sun/org/apache/xerces/internal/impl/dv/DVFactoryException.java
deleted file mode 100644
index 149d717..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/DVFactoryException.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv;
-
-/**
- * A runtime exception that's thrown if an error happens when the application
- * tries to get a DV factory instance.
- *
- * @xerces.internal
- *
- */
-public class DVFactoryException extends RuntimeException {
-
- /** Serialization version. */
- static final long serialVersionUID = -3738854697928682412L;
-
- public DVFactoryException() {
- super();
- }
-
- public DVFactoryException(String msg) {
- super(msg);
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/DatatypeException.java b/src/com/sun/org/apache/xerces/internal/impl/dv/DatatypeException.java
deleted file mode 100644
index f38b1d3..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/DatatypeException.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv;
-
-import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
-import java.util.ResourceBundle;
-import java.util.PropertyResourceBundle;
-import java.util.MissingResourceException;
-
-/**
- * Base class for datatype exceptions. For DTD types, the exception can be
- * created from an error message. For Schema types, it needs an error code
- * (as defined in Appendix C of the structure spec), plus an array of arguents,
- * for error message substitution.
- *
- * @xerces.internal
- *
- * @author Sandy Gao, IBM
- *
- * @version $Id: DatatypeException.java,v 1.6 2010-11-01 04:39:43 joehw Exp $
- */
-public class DatatypeException extends Exception {
-
- /** Serialization version. */
- static final long serialVersionUID = 1940805832730465578L;
-
- // used to store error code and error substitution arguments
- protected String key;
- protected Object[] args;
-
- /**
- * Create a new datatype exception by providing an error code and a list
- * of error message substitution arguments.
- *
- * @param key error code
- * @param args error arguments
- */
- public DatatypeException(String key, Object[] args) {
- super(key);
- this.key = key;
- this.args = args;
- }
-
- /**
- * Return the error code
- *
- * @return error code
- */
- public String getKey() {
- return key;
- }
-
- /**
- * Return the list of error arguments
- *
- * @return error arguments
- */
- public Object[] getArgs() {
- return args;
- }
-
- /**
- * Overrides this method to get the formatted&localized error message.
- *
- * REVISIT: the system locale is used to load the property file.
- * do we want to allow the appilcation to specify a
- * different locale?
- */
- public String getMessage() {
- ResourceBundle resourceBundle = null;
- resourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLSchemaMessages");
- if (resourceBundle == null)
- throw new MissingResourceException("Property file not found!", "com.sun.org.apache.xerces.internal.impl.msg.XMLSchemaMessages", key);
-
- String msg = resourceBundle.getString(key);
- if (msg == null) {
- msg = resourceBundle.getString("BadMessageKey");
- throw new MissingResourceException(msg, "com.sun.org.apache.xerces.internal.impl.msg.XMLSchemaMessages", key);
- }
-
- if (args != null) {
- try {
- msg = java.text.MessageFormat.format(msg, args);
- } catch (Exception e) {
- msg = resourceBundle.getString("FormatFailed");
- msg += " " + resourceBundle.getString(key);
- }
- }
-
- return msg;
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/DatatypeValidator.java b/src/com/sun/org/apache/xerces/internal/impl/dv/DatatypeValidator.java
deleted file mode 100644
index 68cd396..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/DatatypeValidator.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv;
-
-import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
-
-/**
- * The interface that a DTD datatype must implement. The implementation of this
- * interface must be thread-safe.
- *
- * @xerces.internal
- *
- * @author Sandy Gao, IBM
- *
- */
-public interface DatatypeValidator {
-
- /**
- * validate a given string against this DV
- *
- * @param content the string value that needs to be validated
- * @param context the validation context
- */
- public void validate(String content, ValidationContext context)
- throws InvalidDatatypeValueException;
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/InvalidDatatypeFacetException.java b/src/com/sun/org/apache/xerces/internal/impl/dv/InvalidDatatypeFacetException.java
deleted file mode 100644
index 22be4b5..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/InvalidDatatypeFacetException.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv;
-
-/**
- * Datatype exception for invalid facet. This exception is only used by
- * schema datatypes.
- *
- * @xerces.internal
- *
- * @author Sandy Gao, IBM
- *
- */
-public class InvalidDatatypeFacetException extends DatatypeException {
-
- /** Serialization version. */
- static final long serialVersionUID = -4104066085909970654L;
-
- /**
- * Create a new datatype exception by providing an error code and a list
- * of error message substitution arguments.
- *
- * @param key error code
- * @param args error arguments
- */
- public InvalidDatatypeFacetException(String key, Object[] args) {
- super(key, args);
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/InvalidDatatypeValueException.java b/src/com/sun/org/apache/xerces/internal/impl/dv/InvalidDatatypeValueException.java
deleted file mode 100644
index 648dd1e..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/InvalidDatatypeValueException.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001, 2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv;
-
-/**
- * Datatype exception for invalid values.
- *
- * @xerces.internal
- *
- * @author Sandy Gao, IBM
- *
- */
-public class InvalidDatatypeValueException extends DatatypeException {
-
- /** Serialization version. */
- static final long serialVersionUID = -5523739426958236125L;
-
- /**
- * Create a new datatype exception by providing an error code and a list
- * of error message substitution arguments.
- *
- * @param key error code
- * @param args error arguments
- */
- public InvalidDatatypeValueException(String key, Object[] args) {
- super(key, args);
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/SchemaDVFactory.java b/src/com/sun/org/apache/xerces/internal/impl/dv/SchemaDVFactory.java
deleted file mode 100644
index 902d9d3..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/SchemaDVFactory.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv;
-
-import com.sun.org.apache.xerces.internal.util.SymbolHash;
-import com.sun.org.apache.xerces.internal.xs.XSObjectList;
-import com.sun.org.apache.xerces.internal.utils.ObjectFactory;
-
-/**
- * Defines a factory API that enables applications to <p>
- * 1. to get the instance of specified SchemaDVFactory implementation <p>
- * 2. to create/return built-in schema simple types <p>
- * 3. to create user defined simple types. <p>
- *
- * Implementations of this abstract class can be used to get built-in simple
- * types and create user-defined simle types. <p>
- *
- * The implementation should store the built-in datatypes in static data, so
- * that they can be shared by multiple parser instance, and multiple threads.
- *
- * @xerces.internal
- *
- * @author Sandy Gao, IBM
- *
- * @version $Id: SchemaDVFactory.java,v 1.6 2010-11-01 04:39:43 joehw Exp $
- */
-public abstract class SchemaDVFactory {
-
- private static final String DEFAULT_FACTORY_CLASS = "com.sun.org.apache.xerces.internal.impl.dv.xs.SchemaDVFactoryImpl";
-
- /**
- * Get a default instance of SchemaDVFactory implementation.
- *
- * @return an instance of SchemaDVFactory implementation
- * @exception DVFactoryException cannot create an instance of the specified
- * class name or the default class name
- */
- public static synchronized final SchemaDVFactory getInstance() throws DVFactoryException {
- return getInstance(DEFAULT_FACTORY_CLASS);
- } //getInstance(): SchemaDVFactory
-
-
- /**
- * Get an instance of SchemaDVFactory implementation.
- *
- * @param factoryClass name of the schema factory implementation to instantiate.
- * @return an instance of SchemaDVFactory implementation
- * @exception DVFactoryException cannot create an instance of the specified
- * class name or the default class name
- */
- public static synchronized final SchemaDVFactory getInstance(String factoryClass) throws DVFactoryException {
-
- try {
- // if the class name is not specified, use the default one
- return (SchemaDVFactory)(ObjectFactory.newInstance(factoryClass, true));
- } catch (ClassCastException e4) {
- throw new DVFactoryException("Schema factory class " + factoryClass + " does not extend from SchemaDVFactory.");
- }
-
- }
-
- // can't create a new object of this class
- protected SchemaDVFactory(){}
-
- /**
- * Get a built-in simple type of the given name
- * REVISIT: its still not decided within the Schema WG how to define the
- * ur-types and if all simple types should be derived from a
- * complex type, so as of now we ignore the fact that anySimpleType
- * is derived from anyType, and pass 'null' as the base of
- * anySimpleType. It needs to be changed as per the decision taken.
- *
- * @param name the name of the datatype
- * @return the datatype validator of the given name
- */
- public abstract XSSimpleType getBuiltInType(String name);
-
- /**
- * get all built-in simple types, which are stored in a SymbolHash keyed by
- * the name
- *
- * @return a SymbolHash which contains all built-in simple types
- */
- public abstract SymbolHash getBuiltInTypes();
-
- /**
- * Create a new simple type which is derived by restriction from another
- * simple type.
- *
- * @param name name of the new type, could be null
- * @param targetNamespace target namespace of the new type, could be null
- * @param finalSet value of "final"
- * @param base base type of the new type
- * @param annotations set of annotations
- * @return the newly created simple type
- */
- public abstract XSSimpleType createTypeRestriction(String name, String targetNamespace,
- short finalSet, XSSimpleType base,
- XSObjectList annotations);
-
- /**
- * Create a new simple type which is derived by list from another simple
- * type.
- *
- * @param name name of the new type, could be null
- * @param targetNamespace target namespace of the new type, could be null
- * @param finalSet value of "final"
- * @param itemType item type of the list type
- * @param annotations set of annotations
- * @return the newly created simple type
- */
- public abstract XSSimpleType createTypeList(String name, String targetNamespace,
- short finalSet, XSSimpleType itemType,
- XSObjectList annotations);
-
- /**
- * Create a new simple type which is derived by union from a list of other
- * simple types.
- *
- * @param name name of the new type, could be null
- * @param targetNamespace target namespace of the new type, could be null
- * @param finalSet value of "final"
- * @param memberTypes member types of the union type
- * @param annotations set of annotations
- * @return the newly created simple type
- */
- public abstract XSSimpleType createTypeUnion(String name, String targetNamespace,
- short finalSet, XSSimpleType[] memberTypes,
- XSObjectList annotations);
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/ValidatedInfo.java b/src/com/sun/org/apache/xerces/internal/impl/dv/ValidatedInfo.java
deleted file mode 100644
index e6b8f26..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/ValidatedInfo.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv;
-
-import com.sun.org.apache.xerces.internal.xs.ShortList;
-
-/**
- * Class to get the information back after content is validated. This info
- * would be filled by validate().
- *
- * @xerces.internal
- *
- * @author Neeraj Bajaj, Sun Microsystems, inc.
- *
- */
-public class ValidatedInfo {
-
- /**
- * The normalized value of a string value
- */
- public String normalizedValue;
-
- /**
- * The actual value from a string value (QName, Boolean, etc.)
- * An array of Objects if the type is a list.
- */
- public Object actualValue;
-
- /**
- * The type of the actual value. It's one of the _DT constants
- * defined in XSConstants.java. The value is used to indicate
- * the most specific built-in type.
- * (i.e. short instead of decimal or integer).
- */
- public short actualValueType;
-
- /**
- * If the type is a union type, then the member type which
- * actually validated the string value.
- */
- public XSSimpleType memberType;
-
- /**
- * If
- * 1. the type is a union type where one of the member types is a list, or
- * if the type is a list; and
- * 2. the item type of the list is a union type
- * then an array of member types used to validate the values.
- */
- public XSSimpleType[] memberTypes;
-
- /**
- * In the case the value is a list or a list of unions, this value
- * indicates the type(s) of the items in the list.
- * For a normal list, the length of the array is 1; for list of unions,
- * the length of the array is the same as the length of the list.
- */
- public ShortList itemValueTypes;
-
- /**
- * reset the state of this object
- */
- public void reset() {
- this.normalizedValue = null;
- this.actualValue = null;
- this.memberType = null;
- this.memberTypes = null;
- }
-
- /**
- * Return a string representation of the value. If there is an actual
- * value, use toString; otherwise, use the normalized value.
- */
- public String stringValue() {
- if (actualValue == null)
- return normalizedValue;
- else
- return actualValue.toString();
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/ValidationContext.java b/src/com/sun/org/apache/xerces/internal/impl/dv/ValidationContext.java
deleted file mode 100644
index 6ff4d66..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/ValidationContext.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv;
-
-import java.util.Locale;
-
-/**
- * ValidationContext has all the information required for the
- * validation of: id, idref, entity, notation, qname
- *
- * @xerces.internal
- *
- * @author Sandy Gao, IBM
- * @version $Id: ValidationContext.java,v 1.6 2010/07/23 02:09:29 joehw Exp $
- */
-public interface ValidationContext {
- // whether to validate against facets
- public boolean needFacetChecking();
-
- // whether to do extra id/idref/entity checking
- public boolean needExtraChecking();
-
- // whether we need to normalize the value that is passed!
- public boolean needToNormalize();
-
- // are namespaces relevant in this context?
- public boolean useNamespaces();
-
- // entity
- public boolean isEntityDeclared (String name);
- public boolean isEntityUnparsed (String name);
-
- // id
- public boolean isIdDeclared (String name);
- public void addId(String name);
-
- // idref
- public void addIdRef(String name);
-
- // get symbol from symbol table
- public String getSymbol (String symbol);
-
- // qname
- public String getURI(String prefix);
-
- // Locale
- public Locale getLocale();
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/XSFacets.java b/src/com/sun/org/apache/xerces/internal/impl/dv/XSFacets.java
deleted file mode 100644
index 4baeaf1..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/XSFacets.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv;
-
-import java.util.Vector;
-
-import com.sun.org.apache.xerces.internal.xs.XSAnnotation;
-import com.sun.org.apache.xerces.internal.xs.XSObjectList;
-import com.sun.org.apache.xerces.internal.impl.xs.util.XSObjectListImpl;
-
-/**
- * The class used to pass all facets to {@link XSSimpleType#applyFacets}.
- *
- * @xerces.internal
- *
- * @author Sandy Gao, IBM
- *
- */
-public class XSFacets {
-
- /**
- * value of length facet.
- */
- public int length;
-
- /**
- * value of minLength facet.
- */
- public int minLength;
-
- /**
- * value of maxLength facet.
- */
- public int maxLength;
-
- /**
- * value of whiteSpace facet.
- */
- public short whiteSpace;
-
- /**
- * value of totalDigits facet.
- */
- public int totalDigits;
-
- /**
- * value of fractionDigits facet.
- */
- public int fractionDigits;
-
- /**
- * string containing value of pattern facet, for multiple patterns values
- * are ORed together.
- */
- public String pattern;
-
- /**
- * Vector containing values of Enumeration facet, as String's.
- */
- public Vector enumeration;
-
- /**
- * An array parallel to "Vector enumeration". It contains namespace context
- * of each enumeration value. Elements of this vector are NamespaceContext
- * objects.
- */
- public Vector enumNSDecls;
-
- /**
- * value of maxInclusive facet.
- */
- public String maxInclusive;
-
- /**
- * value of maxExclusive facet.
- */
- public String maxExclusive;
-
- /**
- * value of minInclusive facet.
- */
- public String minInclusive;
-
- /**
- * value of minExclusive facet.
- */
- public String minExclusive;
-
-
-
- public XSAnnotation lengthAnnotation;
- public XSAnnotation minLengthAnnotation;
- public XSAnnotation maxLengthAnnotation;
- public XSAnnotation whiteSpaceAnnotation;
- public XSAnnotation totalDigitsAnnotation;
- public XSAnnotation fractionDigitsAnnotation;
- public XSObjectListImpl patternAnnotations;
- public XSObjectList enumAnnotations;
- public XSAnnotation maxInclusiveAnnotation;
- public XSAnnotation maxExclusiveAnnotation;
- public XSAnnotation minInclusiveAnnotation;
- public XSAnnotation minExclusiveAnnotation;
-
- public void reset(){
- lengthAnnotation = null;
- minLengthAnnotation = null;
- maxLengthAnnotation = null;
- whiteSpaceAnnotation = null;
- totalDigitsAnnotation = null;
- fractionDigitsAnnotation = null;
- patternAnnotations = null;
- enumAnnotations = null;
- maxInclusiveAnnotation = null;
- maxExclusiveAnnotation = null;
- minInclusiveAnnotation = null;
- minExclusiveAnnotation = null;
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/XSSimpleType.java b/src/com/sun/org/apache/xerces/internal/impl/dv/XSSimpleType.java
deleted file mode 100644
index 5e24279..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/XSSimpleType.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv;
-
-import com.sun.org.apache.xerces.internal.xs.XSSimpleTypeDefinition;
-
-/**
- * This interface <code>XSSimpleType</code> represents the simple type
- * definition of schema component and defines methods to query the information
- * contained.
- * Any simple type (atomic, list or union) will implement this interface.
- * It inherits from <code>XSTypeDecl</code>.
- *
- * @xerces.internal
- *
- * @author Sandy Gao, IBM
- *
- */
-public interface XSSimpleType extends XSSimpleTypeDefinition {
-
- /**
- * constants defined for the values of 'whitespace' facet.
- * see <a href='http://www.w3.org/TR/xmlschema-2/#dt-whiteSpace'> XML Schema
- * Part 2: Datatypes </a>
- */
- /** preserve the white spaces */
- public static final short WS_PRESERVE = 0;
- /** replace the white spaces */
- public static final short WS_REPLACE = 1;
- /** collapse the white spaces */
- public static final short WS_COLLAPSE = 2;
-
- /**
- * Constant defined for the primitive built-in simple tpyes.
- * see <a href='http://www.w3.org/TR/xmlschema-2/#built-in-primitive-datatypes'>
- * XML Schema Part 2: Datatypes </a>
- */
- /** "string" type */
- public static final short PRIMITIVE_STRING = 1;
- /** "boolean" type */
- public static final short PRIMITIVE_BOOLEAN = 2;
- /** "decimal" type */
- public static final short PRIMITIVE_DECIMAL = 3;
- /** "float" type */
- public static final short PRIMITIVE_FLOAT = 4;
- /** "double" type */
- public static final short PRIMITIVE_DOUBLE = 5;
- /** "duration" type */
- public static final short PRIMITIVE_DURATION = 6;
- /** "dataTime" type */
- public static final short PRIMITIVE_DATETIME = 7;
- /** "time" type */
- public static final short PRIMITIVE_TIME = 8;
- /** "date" type */
- public static final short PRIMITIVE_DATE = 9;
- /** "gYearMonth" type */
- public static final short PRIMITIVE_GYEARMONTH = 10;
- /** "gYear" type */
- public static final short PRIMITIVE_GYEAR = 11;
- /** "gMonthDay" type */
- public static final short PRIMITIVE_GMONTHDAY = 12;
- /** "gDay" type */
- public static final short PRIMITIVE_GDAY = 13;
- /** "gMonth" type */
- public static final short PRIMITIVE_GMONTH = 14;
- /** "hexBinary" type */
- public static final short PRIMITIVE_HEXBINARY = 15;
- /** "base64Binary" type */
- public static final short PRIMITIVE_BASE64BINARY = 16;
- /** "anyURI" type */
- public static final short PRIMITIVE_ANYURI = 17;
- /** "QName" type */
- public static final short PRIMITIVE_QNAME = 18;
- /** "precisionDecimal" type */
- public static final short PRIMITIVE_PRECISIONDECIMAL = 19;
- /** "NOTATION" type */
- public static final short PRIMITIVE_NOTATION = 20;
-
- /**
- * return an ID representing the built-in primitive base type.
- * REVISIT: This method is (currently) for internal use only.
- * the constants returned from this method are not finalized yet.
- * the names and values might change in the further.
- *
- * @return an ID representing the built-in primitive base type
- */
- public short getPrimitiveKind();
-
- /**
- * validate a given string against this simple type.
- *
- * @param content the string value that needs to be validated
- * @param context the validation context
- * @param validatedInfo used to store validation result
- *
- * @return the actual value (QName, Boolean) of the string value
- */
- public Object validate(String content, ValidationContext context, ValidatedInfo validatedInfo)
- throws InvalidDatatypeValueException;
-
- /**
- * validate a given string value, represented by content.toString().
- * note that if content is a StringBuffer, for performance reasons,
- * it's possible that the content of the string buffer is modified.
- *
- * @param content the string value that needs to be validated
- * @param context the validation context
- * @param validatedInfo used to store validation result
- *
- * @return the actual value (QName, Boolean) of the string value
- */
- public Object validate(Object content, ValidationContext context, ValidatedInfo validatedInfo)
- throws InvalidDatatypeValueException;
-
- /**
- * Validate an actual value against this simple type.
- *
- * @param context the validation context
- * @param validatedInfo used to provide the actual value and member types
- * @exception InvalidDatatypeValueException exception for invalid values.
- */
- public void validate(ValidationContext context, ValidatedInfo validatedInfo)
- throws InvalidDatatypeValueException;
-
- /**
- * If this type is created from restriction, then some facets can be applied
- * to the simple type. <code>XSFacets</code> is used to pass the value of
- * different facets.
- *
- * @param facets the value of all the facets
- * @param presentFacet bit combination value of the costraining facet
- * constants which are present.
- * @param fixedFacet bit combination value of the costraining facet
- * constants which are fixed.
- * @param context the validation context
- * @exception InvalidDatatypeFacetException exception for invalid facet values.
- */
- public void applyFacets(XSFacets facets, short presentFacet, short fixedFacet, ValidationContext context)
- throws InvalidDatatypeFacetException;
-
- /**
- * Check whether two actual values are equal.
- *
- * @param value1 the first value
- * @param value2 the second value
- * @return true if the two value are equal
- */
- public boolean isEqual(Object value1, Object value2);
-
- /**
- * Check the order of the two actual values. (May not be supported by all
- * simple types.
- * REVISIT: Andy believes that a compare() method is necessary.
- * I don't see the necessity for schema (the only place where we
- * need to compare two values is to check min/maxIn/Exclusive
- * facets, but we only need a private method for this case.)
- * But Andy thinks XPATH potentially needs this compare() method.
- *
- * @param value1 the first value
- * @prarm value2 the second value
- * @return > 0 if value1 > value2
- * = 0 if value1 == value2
- * < = if value1 < value2
- */
- //public short compare(Object value1, Object value2);
-
- /**
- * Check whether this type is or is derived from ID.
- * REVISIT: this method makes ID special, which is not a good design.
- * but since ID is not a primitive, there doesn't seem to be a
- * clean way of doing it except to define special method like this.
- *
- * @return whether this simple type is or is derived from ID.
- */
- public boolean isIDType();
-
- /**
- * Return the whitespace corresponding to this datatype.
- *
- * @return valid values are WS_PRESERVE, WS_REPLACE, WS_COLLAPSE.
- * @exception DatatypeException
- * union datatypes don't have whitespace facet associated with them
- */
- public short getWhitespace() throws DatatypeException;
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/DTDDVFactoryImpl.java b/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/DTDDVFactoryImpl.java
deleted file mode 100644
index 0323412..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/DTDDVFactoryImpl.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.dtd;
-
-import com.sun.org.apache.xerces.internal.impl.dv.DTDDVFactory;
-import com.sun.org.apache.xerces.internal.impl.dv.DatatypeValidator;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * the factory to create/return built-in schema DVs and create user-defined DVs
- *
- * @xerces.internal
- *
- * @author Sandy Gao, IBM
- *
- */
-public class DTDDVFactoryImpl extends DTDDVFactory {
-
- static final Map<String, DatatypeValidator> fBuiltInTypes;
- static {
- Map<String, DatatypeValidator> builtInTypes = new HashMap<>();
- DatatypeValidator dvTemp;
-
- builtInTypes.put("string", new StringDatatypeValidator());
- builtInTypes.put("ID", new IDDatatypeValidator());
- dvTemp = new IDREFDatatypeValidator();
- builtInTypes.put("IDREF", dvTemp);
- builtInTypes.put("IDREFS", new ListDatatypeValidator(dvTemp));
- dvTemp = new ENTITYDatatypeValidator();
- builtInTypes.put("ENTITY", new ENTITYDatatypeValidator());
- builtInTypes.put("ENTITIES", new ListDatatypeValidator(dvTemp));
- builtInTypes.put("NOTATION", new NOTATIONDatatypeValidator());
- dvTemp = new NMTOKENDatatypeValidator();
- builtInTypes.put("NMTOKEN", dvTemp);
- builtInTypes.put("NMTOKENS", new ListDatatypeValidator(dvTemp));
-
- fBuiltInTypes = Collections.unmodifiableMap(builtInTypes);
- }
-
- /**
- * return a dtd type of the given name
- *
- * @param name the name of the datatype
- * @return the datatype validator of the given name
- */
- @Override
- public DatatypeValidator getBuiltInDV(String name) {
- return fBuiltInTypes.get(name);
- }
-
- /**
- * get all built-in DVs, which are stored in a Map keyed by the name
- *
- * @return a Map which contains all datatypes
- */
- @Override
- public Map<String, DatatypeValidator> getBuiltInTypes() {
- return new HashMap<>(fBuiltInTypes);
- }
-
-}// DTDDVFactoryImpl
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/ENTITYDatatypeValidator.java b/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/ENTITYDatatypeValidator.java
deleted file mode 100644
index 52f39b0..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/ENTITYDatatypeValidator.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.dtd;
-
-import com.sun.org.apache.xerces.internal.impl.dv.*;
-
-/**
- * <P>ENTITYDatatypeValidator implements the
- * DatattypeValidator interface.
- * This validator embodies the ENTITY attribute type
- * from XML1.0 recommendation.
- * The Value space of ENTITY is the set of all strings
- * that match the NCName production and have been
- * declared as an unparsed entity in a document
- * type definition.
- * The Lexical space of Entity is the set of all
- * strings that match the NCName production.
- * The value space of ENTITY is scoped to a specific
- * instance document.</P>
- *
- * @xerces.internal
- *
- * @author Jeffrey Rodriguez, IBM
- * @author Sandy Gao, IBM
- *
- */
-public class ENTITYDatatypeValidator implements DatatypeValidator {
-
- // construct an ENTITY datatype validator
- public ENTITYDatatypeValidator() {
- }
-
- /**
- * Checks that "content" string is valid ID value.
- * If invalid a Datatype validation exception is thrown.
- *
- * @param content the string value that needs to be validated
- * @param context the validation context
- * @throws InvalidDatatypeException if the content is
- * invalid according to the rules for the validators
- * @see InvalidDatatypeValueException
- */
- public void validate(String content, ValidationContext context) throws InvalidDatatypeValueException {
-
- if (!context.isEntityUnparsed(content))
- throw new InvalidDatatypeValueException("ENTITYNotUnparsed", new Object[]{content});
-
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/IDDatatypeValidator.java b/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/IDDatatypeValidator.java
deleted file mode 100644
index 54fac1a..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/IDDatatypeValidator.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.dtd;
-
-import com.sun.org.apache.xerces.internal.impl.dv.*;
-import com.sun.org.apache.xerces.internal.util.XMLChar;
-
-/**
- * <P>IDDatatypeValidator - ID represents the ID attribute
- * type from XML 1.0 Recommendation. The value space
- * od ID is the set of all strings that match the
- * NCName production and have been used in an XML
- * document. The lexical space of ID is the set of all
- * strings that match the NCName production.</P>
- * <P>The value space of ID is scoped to a specific
- * instance document.</P>
- * <P>The following constraint applies:
- * An ID must not appear more than once in an XML
- * document as a value of this type; i.e., ID values
- * must uniquely identify the elements which bear
- * them.</P>
- *
- * @xerces.internal
- *
- * @author Jeffrey Rodriguez, IBM
- * @author Sandy Gao, IBM
- *
- */
-public class IDDatatypeValidator implements DatatypeValidator {
-
- // construct an ID datatype validator
- public IDDatatypeValidator() {
- }
-
- /**
- * Checks that "content" string is valid ID value.
- * If invalid a Datatype validation exception is thrown.
- *
- * @param content the string value that needs to be validated
- * @param context the validation context
- * @throws InvalidDatatypeException if the content is
- * invalid according to the rules for the validators
- * @see InvalidDatatypeValueException
- */
- public void validate(String content, ValidationContext context) throws InvalidDatatypeValueException {
-
- //Check if is valid key-[81] EncName ::= [A-Za-z] ([A-Za-z0-9._] | '-')*
- if(context.useNamespaces()) {
- if (!XMLChar.isValidNCName(content)) {
- throw new InvalidDatatypeValueException("IDInvalidWithNamespaces", new Object[]{content});
- }
- }
- else {
- if (!XMLChar.isValidName(content)) {
- throw new InvalidDatatypeValueException("IDInvalid", new Object[]{content});
- }
- }
-
- if (context.isIdDeclared(content)) {
- throw new InvalidDatatypeValueException("IDNotUnique", new Object[]{content});
- }
-
- context.addId(content);
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/IDREFDatatypeValidator.java b/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/IDREFDatatypeValidator.java
deleted file mode 100644
index 4fa2a1c..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/IDREFDatatypeValidator.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.dtd;
-
-import com.sun.org.apache.xerces.internal.impl.dv.*;
-import com.sun.org.apache.xerces.internal.util.XMLChar;
-
-/**
- * <P>IDREFDatatypeValidator - represents the IDREFS
- * attribute type from XML 1.0 recommendation. The
- * Value Space of IDREF is the set of all strings
- * that match the NCName production and have been
- * used in an XML Document as the value of an element
- * or attribute of Type ID. The Lexical space of
- * IDREF is the set of strings that match the NCName
- * production.</P>
- * <P>The Value space of IDREF is scoped to a specific
- * instance document</P>
- *
- * @xerces.internal
- *
- * @author Jeffrey Rodriguez, IBM
- * @author Sandy Gao, IBM
- *
- */
-public class IDREFDatatypeValidator implements DatatypeValidator {
-
- // construct an IDREF datatype validator
- public IDREFDatatypeValidator() {
- }
-
- /**
- * Checks that "content" string is valid IDREF value.
- * If invalid a Datatype validation exception is thrown.
- *
- * @param content the string value that needs to be validated
- * @param context the validation context
- * @throws InvalidDatatypeException if the content is
- * invalid according to the rules for the validators
- * @see InvalidDatatypeValueException
- */
- public void validate(String content, ValidationContext context) throws InvalidDatatypeValueException {
-
- //Check if is valid key-[81] EncName ::= [A-Za-z] ([A-Za-z0-9._] | '-')*
- if(context.useNamespaces()) {
- if (!XMLChar.isValidNCName(content)) {
- throw new InvalidDatatypeValueException("IDREFInvalidWithNamespaces", new Object[]{content});
- }
- }
- else {
- if (!XMLChar.isValidName(content)) {
- throw new InvalidDatatypeValueException("IDREFInvalid", new Object[]{content});
- }
- }
-
- context.addIdRef(content);
-
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/ListDatatypeValidator.java b/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/ListDatatypeValidator.java
deleted file mode 100644
index 28a3fd0..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/ListDatatypeValidator.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.dtd;
-
-import com.sun.org.apache.xerces.internal.impl.dv.*;
-import java.util.StringTokenizer;
-
-/**
- * For list types: ENTITIES, IDREFS, NMTOKENS.
- *
- * @xerces.internal
- *
- * @author Jeffrey Rodriguez, IBM
- * @author Sandy Gao, IBM
- *
- */
-public class ListDatatypeValidator implements DatatypeValidator {
-
- // the type of items in the list
- DatatypeValidator fItemValidator;
-
- // construct a list datatype validator
- public ListDatatypeValidator(DatatypeValidator itemDV) {
- fItemValidator = itemDV;
- }
-
- /**
- * Checks that "content" string is valid.
- * If invalid a Datatype validation exception is thrown.
- *
- * @param content the string value that needs to be validated
- * @param context the validation context
- * @throws InvalidDatatypeException if the content is
- * invalid according to the rules for the validators
- * @see InvalidDatatypeValueException
- */
- public void validate(String content, ValidationContext context) throws InvalidDatatypeValueException {
-
- StringTokenizer parsedList = new StringTokenizer(content," ");
- int numberOfTokens = parsedList.countTokens();
- if (numberOfTokens == 0) {
- throw new InvalidDatatypeValueException("EmptyList", null);
- }
- //Check each token in list against base type
- while (parsedList.hasMoreTokens()) {
- this.fItemValidator.validate(parsedList.nextToken(), context);
- }
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/NMTOKENDatatypeValidator.java b/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/NMTOKENDatatypeValidator.java
deleted file mode 100644
index 94eb901..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/NMTOKENDatatypeValidator.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.dtd;
-
-import com.sun.org.apache.xerces.internal.impl.dv.*;
-import com.sun.org.apache.xerces.internal.util.XMLChar;
-
-/**
- * NMTOKEN datatype validator.
- *
- * @xerces.internal
- *
- * @author Jeffrey Rodriguez, IBM
- * @author Sandy Gao, IBM
- *
- */
-public class NMTOKENDatatypeValidator implements DatatypeValidator {
-
- // construct a NMTOKEN datatype validator
- public NMTOKENDatatypeValidator() {
- }
-
- /**
- * Checks that "content" string is valid NMTOKEN value.
- * If invalid a Datatype validation exception is thrown.
- *
- * @param content the string value that needs to be validated
- * @param context the validation context
- * @throws InvalidDatatypeException if the content is
- * invalid according to the rules for the validators
- * @see InvalidDatatypeValueException
- */
- public void validate(String content, ValidationContext context) throws InvalidDatatypeValueException {
- if (!XMLChar.isValidNmtoken(content)) {
- throw new InvalidDatatypeValueException("NMTOKENInvalid", new Object[]{content});
- }
- }
-
-} // class NMTOKENDatatypeValidator
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/NOTATIONDatatypeValidator.java b/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/NOTATIONDatatypeValidator.java
deleted file mode 100644
index 87d95cc..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/NOTATIONDatatypeValidator.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.dtd;
-
-import com.sun.org.apache.xerces.internal.impl.dv.*;
-
-/**
- * NOTATIONValidator defines the interface that data type validators must obey.
- * These validators can be supplied by the application writer and may be useful as
- * standalone code as well as plugins to the validator architecture.
- *
- * @xerces.internal
- *
- * @author Jeffrey Rodriguez, IBM
- * @author Sandy Gao, IBM
- *
- */
- public class NOTATIONDatatypeValidator implements DatatypeValidator {
-
- // construct a NOTATION datatype validator
- public NOTATIONDatatypeValidator() {
- }
-
- /**
- * Checks that "content" string is valid NOTATION value.
- * If invalid a Datatype validation exception is thrown.
- *
- * @param content the string value that needs to be validated
- * @param context the validation context
- * @throws InvalidDatatypeException if the content is
- * invalid according to the rules for the validators
- * @see InvalidDatatypeValueException
- */
- public void validate(String content, ValidationContext context) throws InvalidDatatypeValueException {
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/StringDatatypeValidator.java b/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/StringDatatypeValidator.java
deleted file mode 100644
index edc5c55..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/StringDatatypeValidator.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.dtd;
-
-import com.sun.org.apache.xerces.internal.impl.dv.*;
-
-/**
- * <P>StringValidator validates that XML content is a W3C string type.</P>
- * <P>The string datatype represents character strings in XML. The
- * value space of string is the set of finite-length sequences
- * of characters (as defined in [XML 1.0 Recommendation
- * (Second Edition)]) that match the Char production
- * from [XML 1.0 Recommendation (Second Edition)].
- * A character is an atomic unit of communication; it
- * is not further specified except to note that every
- * character has a corresponding Universal Code Set
- * code point ([ISO 10646],[Unicode] and [Unicode3]),
- * which is an integer.</P>
- *
- * @xerces.internal
- *
- */
-public class StringDatatypeValidator implements DatatypeValidator {
-
- // construct a string datatype validator
- public StringDatatypeValidator() {
- }
-
- /**
- * Checks that "content" string is valid string value.
- * If invalid a Datatype validation exception is thrown.
- *
- * @param content the string value that needs to be validated
- * @param context the validation context
- * @throws InvalidDatatypeException if the content is
- * invalid according to the rules for the validators
- * @see InvalidDatatypeValueException
- */
- public void validate(String content, ValidationContext context) throws InvalidDatatypeValueException {
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/XML11DTDDVFactoryImpl.java b/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/XML11DTDDVFactoryImpl.java
deleted file mode 100644
index 0c0b1f3..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/XML11DTDDVFactoryImpl.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.dtd;
-
-import com.sun.org.apache.xerces.internal.impl.dv.DatatypeValidator;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * the factory to create/return built-in XML 1.1 DVs and create user-defined DVs
- *
- * @xerces.internal
- *
- * @author Neil Graham, IBM
- *
- */
-public class XML11DTDDVFactoryImpl extends DTDDVFactoryImpl {
-
- static Map<String, DatatypeValidator> XML11BUILTINTYPES;
- static {
- Map<String, DatatypeValidator> xml11BuiltInTypes = new HashMap<>();
- xml11BuiltInTypes.put("XML11ID", new XML11IDDatatypeValidator());
- DatatypeValidator dvTemp = new XML11IDREFDatatypeValidator();
- xml11BuiltInTypes.put("XML11IDREF", dvTemp);
- xml11BuiltInTypes.put("XML11IDREFS", new ListDatatypeValidator(dvTemp));
- dvTemp = new XML11NMTOKENDatatypeValidator();
- xml11BuiltInTypes.put("XML11NMTOKEN", dvTemp);
- xml11BuiltInTypes.put("XML11NMTOKENS", new ListDatatypeValidator(dvTemp));
- XML11BUILTINTYPES = Collections.unmodifiableMap(xml11BuiltInTypes);
- } // <clinit>
-
- /**
- * return a dtd type of the given name
- * This will call the super class if and only if it does not
- * recognize the passed-in name.
- *
- * @param name the name of the datatype
- * @return the datatype validator of the given name
- */
- @Override
- public DatatypeValidator getBuiltInDV(String name) {
- if(XML11BUILTINTYPES.get(name) != null) {
- return XML11BUILTINTYPES.get(name);
- }
- return fBuiltInTypes.get(name);
- }
-
- /**
- * get all built-in DVs, which are stored in a Map keyed by the name
- * New XML 1.1 datatypes are inserted.
- *
- * @return a Map which contains all datatypes
- */
- @Override
- public Map<String, DatatypeValidator> getBuiltInTypes() {
- final HashMap<String, DatatypeValidator> toReturn = new HashMap<>(fBuiltInTypes);
- toReturn.putAll(XML11BUILTINTYPES);
- return toReturn;
- }
-}//XML11DTDDVFactoryImpl
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/XML11IDDatatypeValidator.java b/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/XML11IDDatatypeValidator.java
deleted file mode 100644
index e429625..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/XML11IDDatatypeValidator.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.dtd;
-
-import com.sun.org.apache.xerces.internal.impl.dv.*;
-import com.sun.org.apache.xerces.internal.util.XML11Char;
-
-/**
- * <P>IDDatatypeValidator - ID represents the ID attribute
- * type from XML 1.1 Recommendation. The value space
- * of ID is the set of all strings that match the
- * NCName production and have been used in an XML
- * document. The lexical space of ID is the set of all
- * strings that match the NCName production.</P>
- * <P>The value space of ID is scoped to a specific
- * instance document.</P>
- * <P>The following constraint applies:
- * An ID must not appear more than once in an XML
- * document as a value of this type; i.e., ID values
- * must uniquely identify the elements which bear
- * them.</P>
- *
- * @xerces.internal
- *
- * @author Jeffrey Rodriguez, IBM
- * @author Sandy Gao, IBM
- * @author Neil Graham, IBM
- *
- */
-public class XML11IDDatatypeValidator extends IDDatatypeValidator {
-
- // construct an ID datatype validator
- public XML11IDDatatypeValidator() {
- super();
- }
-
- /**
- * Checks that "content" string is valid ID value.
- * If invalid a Datatype validation exception is thrown.
- *
- * @param content the string value that needs to be validated
- * @param context the validation context
- * @throws InvalidDatatypeException if the content is
- * invalid according to the rules for the validators
- * @see InvalidDatatypeValueException
- */
- public void validate(String content, ValidationContext context) throws InvalidDatatypeValueException {
-
- //Check if is valid key-[81] EncName ::= [A-Za-z] ([A-Za-z0-9._] | '-')*
- if(context.useNamespaces()) {
- if (!XML11Char.isXML11ValidNCName(content)) {
- throw new InvalidDatatypeValueException("IDInvalidWithNamespaces", new Object[]{content});
- }
- }
- else {
- if (!XML11Char.isXML11ValidName(content)) {
- throw new InvalidDatatypeValueException("IDInvalid", new Object[]{content});
- }
- }
-
- if (context.isIdDeclared(content)) {
- throw new InvalidDatatypeValueException("IDNotUnique", new Object[]{content});
- }
-
- context.addId(content);
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/XML11IDREFDatatypeValidator.java b/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/XML11IDREFDatatypeValidator.java
deleted file mode 100644
index 0d8bbf6..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/XML11IDREFDatatypeValidator.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.dtd;
-
-import com.sun.org.apache.xerces.internal.impl.dv.*;
-import com.sun.org.apache.xerces.internal.util.XML11Char;
-
-/**
- * <P>IDREFDatatypeValidator - represents the IDREFS
- * attribute type from XML 1.1 recommendation. The
- * Value Space of IDREF is the set of all strings
- * that match the NCName production and have been
- * used in an XML Document as the value of an element
- * or attribute of Type ID. The Lexical space of
- * IDREF is the set of strings that match the NCName
- * production.</P>
- * <P>The Value space of IDREF is scoped to a specific
- * instance document</P>
- *
- * @xerces.internal
- *
- * @author Jeffrey Rodriguez, IBM
- * @author Sandy Gao, IBM
- * @author Neil Graham, IBM
- *
- */
-public class XML11IDREFDatatypeValidator extends IDREFDatatypeValidator {
-
- // construct an IDREF datatype validator
- public XML11IDREFDatatypeValidator() {
- super();
- }
-
- /**
- * Checks that "content" string is valid IDREF value.
- * If invalid a Datatype validation exception is thrown.
- *
- * @param content the string value that needs to be validated
- * @param context the validation context
- * @throws InvalidDatatypeException if the content is
- * invalid according to the rules for the validators
- * @see InvalidDatatypeValueException
- */
- public void validate(String content, ValidationContext context) throws InvalidDatatypeValueException {
-
- //Check if is valid key-[81] EncName ::= [A-Za-z] ([A-Za-z0-9._] | '-')*
- if(context.useNamespaces()) {
- if (!XML11Char.isXML11ValidNCName(content)) {
- throw new InvalidDatatypeValueException("IDREFInvalidWithNamespaces", new Object[]{content});
- }
- }
- else {
- if (!XML11Char.isXML11ValidName(content)) {
- throw new InvalidDatatypeValueException("IDREFInvalid", new Object[]{content});
- }
- }
-
- context.addIdRef(content);
-
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/XML11NMTOKENDatatypeValidator.java b/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/XML11NMTOKENDatatypeValidator.java
deleted file mode 100644
index 1a7296b..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/XML11NMTOKENDatatypeValidator.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.dtd;
-
-import com.sun.org.apache.xerces.internal.impl.dv.*;
-import com.sun.org.apache.xerces.internal.util.XML11Char;
-
-/**
- * NMTOKEN datatype validator for NMTokens from XML 1.1.
- *
- * @xerces.internal
- *
- * @author Jeffrey Rodriguez, IBM
- * @author Sandy Gao, IBM
- * @author Neil Graham, IBM
- *
- */
-public class XML11NMTOKENDatatypeValidator extends NMTOKENDatatypeValidator {
-
- // construct a NMTOKEN datatype validator
- public XML11NMTOKENDatatypeValidator() {
- super();
- }
-
- /**
- * Checks that "content" string is valid NMTOKEN value.
- * If invalid a Datatype validation exception is thrown.
- *
- * @param content the string value that needs to be validated
- * @param context the validation context
- * @throws InvalidDatatypeException if the content is
- * invalid according to the rules for the validators
- * @see InvalidDatatypeValueException
- */
- public void validate(String content, ValidationContext context) throws InvalidDatatypeValueException {
- if (!XML11Char.isXML11ValidNmtoken(content)) {
- throw new InvalidDatatypeValueException("NMTOKENInvalid", new Object[]{content});
- }
- }
-
-} // class XML11NMTOKENDatatypeValidator
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/util/Base64.java b/src/com/sun/org/apache/xerces/internal/impl/dv/util/Base64.java
deleted file mode 100644
index 1ab0752..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/util/Base64.java
+++ /dev/null
@@ -1,307 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.util;
-
-/**
- * This class provides encode/decode for RFC 2045 Base64 as
- * defined by RFC 2045, N. Freed and N. Borenstein.
- * RFC 2045: Multipurpose Internet Mail Extensions (MIME)
- * Part One: Format of Internet Message Bodies. Reference
- * 1996 Available at: http://www.ietf.org/rfc/rfc2045.txt
- * This class is used by XML Schema binary format validation
- *
- * This implementation does not encode/decode streaming
- * data. You need the data that you will encode/decode
- * already on a byte arrray.
- *
- * @xerces.internal
- *
- * @author Jeffrey Rodriguez
- * @author Sandy Gao
- */
-public final class Base64 {
-
- static private final int BASELENGTH = 128;
- static private final int LOOKUPLENGTH = 64;
- static private final int TWENTYFOURBITGROUP = 24;
- static private final int EIGHTBIT = 8;
- static private final int SIXTEENBIT = 16;
- static private final int SIXBIT = 6;
- static private final int FOURBYTE = 4;
- static private final int SIGN = -128;
- static private final char PAD = '=';
- static private final boolean fDebug = false;
- static final private byte [] base64Alphabet = new byte[BASELENGTH];
- static final private char [] lookUpBase64Alphabet = new char[LOOKUPLENGTH];
-
- static {
-
- for (int i = 0; i < BASELENGTH; ++i) {
- base64Alphabet[i] = -1;
- }
- for (int i = 'Z'; i >= 'A'; i--) {
- base64Alphabet[i] = (byte) (i-'A');
- }
- for (int i = 'z'; i>= 'a'; i--) {
- base64Alphabet[i] = (byte) ( i-'a' + 26);
- }
-
- for (int i = '9'; i >= '0'; i--) {
- base64Alphabet[i] = (byte) (i-'0' + 52);
- }
-
- base64Alphabet['+'] = 62;
- base64Alphabet['/'] = 63;
-
- for (int i = 0; i<=25; i++)
- lookUpBase64Alphabet[i] = (char)('A'+i);
-
- for (int i = 26, j = 0; i<=51; i++, j++)
- lookUpBase64Alphabet[i] = (char)('a'+ j);
-
- for (int i = 52, j = 0; i<=61; i++, j++)
- lookUpBase64Alphabet[i] = (char)('0' + j);
- lookUpBase64Alphabet[62] = (char)'+';
- lookUpBase64Alphabet[63] = (char)'/';
-
- }
-
- protected static boolean isWhiteSpace(char octect) {
- return (octect == 0x20 || octect == 0xd || octect == 0xa || octect == 0x9);
- }
-
- protected static boolean isPad(char octect) {
- return (octect == PAD);
- }
-
- protected static boolean isData(char octect) {
- return (octect < BASELENGTH && base64Alphabet[octect] != -1);
- }
-
- protected static boolean isBase64(char octect) {
- return (isWhiteSpace(octect) || isPad(octect) || isData(octect));
- }
-
- /**
- * Encodes hex octects into Base64
- *
- * @param binaryData Array containing binaryData
- * @return Encoded Base64 array
- */
- public static String encode(byte[] binaryData) {
-
- if (binaryData == null)
- return null;
-
- int lengthDataBits = binaryData.length*EIGHTBIT;
- if (lengthDataBits == 0) {
- return "";
- }
-
- int fewerThan24bits = lengthDataBits%TWENTYFOURBITGROUP;
- int numberTriplets = lengthDataBits/TWENTYFOURBITGROUP;
- int numberQuartet = fewerThan24bits != 0 ? numberTriplets+1 : numberTriplets;
- char encodedData[] = null;
-
- encodedData = new char[numberQuartet*4];
-
- byte k=0, l=0, b1=0,b2=0,b3=0;
-
- int encodedIndex = 0;
- int dataIndex = 0;
- if (fDebug) {
- System.out.println("number of triplets = " + numberTriplets );
- }
-
- for (int i=0; i<numberTriplets; i++) {
- b1 = binaryData[dataIndex++];
- b2 = binaryData[dataIndex++];
- b3 = binaryData[dataIndex++];
-
- if (fDebug) {
- System.out.println( "b1= " + b1 +", b2= " + b2 + ", b3= " + b3 );
- }
-
- l = (byte)(b2 & 0x0f);
- k = (byte)(b1 & 0x03);
-
- byte val1 = ((b1 & SIGN)==0)?(byte)(b1>>2):(byte)((b1)>>2^0xc0);
-
- byte val2 = ((b2 & SIGN)==0)?(byte)(b2>>4):(byte)((b2)>>4^0xf0);
- byte val3 = ((b3 & SIGN)==0)?(byte)(b3>>6):(byte)((b3)>>6^0xfc);
-
- if (fDebug) {
- System.out.println( "val2 = " + val2 );
- System.out.println( "k4 = " + (k<<4));
- System.out.println( "vak = " + (val2 | (k<<4)));
- }
-
- encodedData[encodedIndex++] = lookUpBase64Alphabet[ val1 ];
- encodedData[encodedIndex++] = lookUpBase64Alphabet[ val2 | ( k<<4 )];
- encodedData[encodedIndex++] = lookUpBase64Alphabet[ (l <<2 ) | val3 ];
- encodedData[encodedIndex++] = lookUpBase64Alphabet[ b3 & 0x3f ];
- }
-
- // form integral number of 6-bit groups
- if (fewerThan24bits == EIGHTBIT) {
- b1 = binaryData[dataIndex];
- k = (byte) ( b1 &0x03 );
- if (fDebug) {
- System.out.println("b1=" + b1);
- System.out.println("b1<<2 = " + (b1>>2) );
- }
- byte val1 = ((b1 & SIGN)==0)?(byte)(b1>>2):(byte)((b1)>>2^0xc0);
- encodedData[encodedIndex++] = lookUpBase64Alphabet[ val1 ];
- encodedData[encodedIndex++] = lookUpBase64Alphabet[ k<<4 ];
- encodedData[encodedIndex++] = PAD;
- encodedData[encodedIndex++] = PAD;
- } else if (fewerThan24bits == SIXTEENBIT) {
- b1 = binaryData[dataIndex];
- b2 = binaryData[dataIndex +1 ];
- l = ( byte ) ( b2 &0x0f );
- k = ( byte ) ( b1 &0x03 );
-
- byte val1 = ((b1 & SIGN)==0)?(byte)(b1>>2):(byte)((b1)>>2^0xc0);
- byte val2 = ((b2 & SIGN)==0)?(byte)(b2>>4):(byte)((b2)>>4^0xf0);
-
- encodedData[encodedIndex++] = lookUpBase64Alphabet[ val1 ];
- encodedData[encodedIndex++] = lookUpBase64Alphabet[ val2 | ( k<<4 )];
- encodedData[encodedIndex++] = lookUpBase64Alphabet[ l<<2 ];
- encodedData[encodedIndex++] = PAD;
- }
-
- return new String(encodedData);
- }
-
- /**
- * Decodes Base64 data into octects
- *
- * @param encoded string containing Base64 data
- * @return Array containind decoded data.
- */
- public static byte[] decode(String encoded) {
-
- if (encoded == null)
- return null;
-
- char[] base64Data = encoded.toCharArray();
- // remove white spaces
- int len = removeWhiteSpace(base64Data);
-
- if (len%FOURBYTE != 0) {
- return null;//should be divisible by four
- }
-
- int numberQuadruple = (len/FOURBYTE );
-
- if (numberQuadruple == 0)
- return new byte[0];
-
- byte decodedData[] = null;
- byte b1=0,b2=0,b3=0,b4=0;
- char d1=0,d2=0,d3=0,d4=0;
-
- int i = 0;
- int encodedIndex = 0;
- int dataIndex = 0;
- decodedData = new byte[ (numberQuadruple)*3];
-
- for (; i<numberQuadruple-1; i++) {
-
- if (!isData( (d1 = base64Data[dataIndex++]) )||
- !isData( (d2 = base64Data[dataIndex++]) )||
- !isData( (d3 = base64Data[dataIndex++]) )||
- !isData( (d4 = base64Data[dataIndex++]) ))
- return null;//if found "no data" just return null
-
- b1 = base64Alphabet[d1];
- b2 = base64Alphabet[d2];
- b3 = base64Alphabet[d3];
- b4 = base64Alphabet[d4];
-
- decodedData[encodedIndex++] = (byte)( b1 <<2 | b2>>4 ) ;
- decodedData[encodedIndex++] = (byte)(((b2 & 0xf)<<4 ) |( (b3>>2) & 0xf) );
- decodedData[encodedIndex++] = (byte)( b3<<6 | b4 );
- }
-
- if (!isData( (d1 = base64Data[dataIndex++]) ) ||
- !isData( (d2 = base64Data[dataIndex++]) )) {
- return null;//if found "no data" just return null
- }
-
- b1 = base64Alphabet[d1];
- b2 = base64Alphabet[d2];
-
- d3 = base64Data[dataIndex++];
- d4 = base64Data[dataIndex++];
- if (!isData( (d3 ) ) ||
- !isData( (d4 ) )) {//Check if they are PAD characters
- if (isPad( d3 ) && isPad( d4)) { //Two PAD e.g. 3c[Pad][Pad]
- if ((b2 & 0xf) != 0)//last 4 bits should be zero
- return null;
- byte[] tmp = new byte[ i*3 + 1 ];
- System.arraycopy( decodedData, 0, tmp, 0, i*3 );
- tmp[encodedIndex] = (byte)( b1 <<2 | b2>>4 ) ;
- return tmp;
- } else if (!isPad( d3) && isPad(d4)) { //One PAD e.g. 3cQ[Pad]
- b3 = base64Alphabet[ d3 ];
- if ((b3 & 0x3 ) != 0)//last 2 bits should be zero
- return null;
- byte[] tmp = new byte[ i*3 + 2 ];
- System.arraycopy( decodedData, 0, tmp, 0, i*3 );
- tmp[encodedIndex++] = (byte)( b1 <<2 | b2>>4 );
- tmp[encodedIndex] = (byte)(((b2 & 0xf)<<4 ) |( (b3>>2) & 0xf) );
- return tmp;
- } else {
- return null;//an error like "3c[Pad]r", "3cdX", "3cXd", "3cXX" where X is non data
- }
- } else { //No PAD e.g 3cQl
- b3 = base64Alphabet[ d3 ];
- b4 = base64Alphabet[ d4 ];
- decodedData[encodedIndex++] = (byte)( b1 <<2 | b2>>4 ) ;
- decodedData[encodedIndex++] = (byte)(((b2 & 0xf)<<4 ) |( (b3>>2) & 0xf) );
- decodedData[encodedIndex++] = (byte)( b3<<6 | b4 );
-
- }
-
- return decodedData;
- }
-
- /**
- * remove WhiteSpace from MIME containing encoded Base64 data.
- *
- * @param data the byte array of base64 data (with WS)
- * @return the new length
- */
- protected static int removeWhiteSpace(char[] data) {
- if (data == null)
- return 0;
-
- // count characters that's not whitespace
- int newSize = 0;
- int len = data.length;
- for (int i = 0; i < len; i++) {
- if (!isWhiteSpace(data[i]))
- data[newSize++] = data[i];
- }
- return newSize;
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/util/ByteListImpl.java b/src/com/sun/org/apache/xerces/internal/impl/dv/util/ByteListImpl.java
deleted file mode 100644
index 984fb2a..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/util/ByteListImpl.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xerces.internal.impl.dv.util;
-
-import java.util.AbstractList;
-
-import com.sun.org.apache.xerces.internal.xs.XSException;
-import com.sun.org.apache.xerces.internal.xs.datatypes.ByteList;
-
-/**
- * Implementation of <code>com.sun.org.apache.xerces.internal.xs.datatypes.ByteList</code>.
- *
- * @xerces.internal
- *
- * @author Ankit Pasricha, IBM
- *
- * @version $Id: ByteListImpl.java,v 1.7 2010-11-01 04:39:46 joehw Exp $
- */
-public class ByteListImpl extends AbstractList implements ByteList {
-
- // actually data stored in a byte array
- protected final byte[] data;
-
- // canonical representation of the data
- protected String canonical;
-
- public ByteListImpl(byte[] data) {
- this.data = data;
- }
-
- /**
- * The number of <code>byte</code>s in the list. The range of
- * valid child object indices is 0 to <code>length-1</code> inclusive.
- */
- public int getLength() {
- return data.length;
- }
-
- /**
- * Checks if the <code>byte</code> <code>item</code> is a
- * member of this list.
- * @param item <code>byte</code> whose presence in this list
- * is to be tested.
- * @return True if this list contains the <code>byte</code>
- * <code>item</code>.
- */
- public boolean contains(byte item) {
- for (int i = 0; i < data.length; ++i) {
- if (data[i] == item) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Returns the <code>index</code>th item in the collection. The index
- * starts at 0.
- * @param index index into the collection.
- * @return The <code>byte</code> at the <code>index</code>th
- * position in the <code>ByteList</code>.
- * @exception XSException
- * INDEX_SIZE_ERR: if <code>index</code> is greater than or equal to the
- * number of objects in the list.
- */
- public byte item(int index)
- throws XSException {
-
- if(index < 0 || index > data.length - 1) {
- throw new XSException(XSException.INDEX_SIZE_ERR, null);
- }
- return data[index];
- }
-
- /*
- * List methods
- */
-
- public Object get(int index) {
- if (index >= 0 && index < data.length) {
- return new Byte(data[index]);
- }
- throw new IndexOutOfBoundsException("Index: " + index);
- }
-
- public int size() {
- return getLength();
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/util/HexBin.java b/src/com/sun/org/apache/xerces/internal/impl/dv/util/HexBin.java
deleted file mode 100644
index fb477ac..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/util/HexBin.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.util;
-
-/**
- * format validation
- *
- * This class encodes/decodes hexadecimal data
- *
- * @xerces.internal
- *
- * @author Jeffrey Rodriguez
- */
-public final class HexBin {
- static private final int BASELENGTH = 128;
- static private final int LOOKUPLENGTH = 16;
- static final private byte [] hexNumberTable = new byte[BASELENGTH];
- static final private char [] lookUpHexAlphabet = new char[LOOKUPLENGTH];
-
-
- static {
- for (int i = 0; i < BASELENGTH; i++ ) {
- hexNumberTable[i] = -1;
- }
- for ( int i = '9'; i >= '0'; i--) {
- hexNumberTable[i] = (byte) (i-'0');
- }
- for ( int i = 'F'; i>= 'A'; i--) {
- hexNumberTable[i] = (byte) ( i-'A' + 10 );
- }
- for ( int i = 'f'; i>= 'a'; i--) {
- hexNumberTable[i] = (byte) ( i-'a' + 10 );
- }
-
- for(int i = 0; i<10; i++ ) {
- lookUpHexAlphabet[i] = (char)('0'+i);
- }
- for(int i = 10; i<=15; i++ ) {
- lookUpHexAlphabet[i] = (char)('A'+i -10);
- }
- }
-
- /**
- * Encode a byte array to hex string
- *
- * @param binaryData array of byte to encode
- * @return return encoded string
- */
- static public String encode(byte[] binaryData) {
- if (binaryData == null)
- return null;
- int lengthData = binaryData.length;
- int lengthEncode = lengthData * 2;
- char[] encodedData = new char[lengthEncode];
- int temp;
- for (int i = 0; i < lengthData; i++) {
- temp = binaryData[i];
- if (temp < 0)
- temp += 256;
- encodedData[i*2] = lookUpHexAlphabet[temp >> 4];
- encodedData[i*2+1] = lookUpHexAlphabet[temp & 0xf];
- }
- return new String(encodedData);
- }
-
- /**
- * Decode hex string to a byte array
- *
- * @param encoded encoded string
- * @return return array of byte to encode
- */
- static public byte[] decode(String encoded) {
- if (encoded == null)
- return null;
- int lengthData = encoded.length();
- if (lengthData % 2 != 0)
- return null;
-
- char[] binaryData = encoded.toCharArray();
- int lengthDecode = lengthData / 2;
- byte[] decodedData = new byte[lengthDecode];
- byte temp1, temp2;
- char tempChar;
- for( int i = 0; i<lengthDecode; i++ ){
- tempChar = binaryData[i*2];
- temp1 = (tempChar < BASELENGTH) ? hexNumberTable[tempChar] : -1;
- if (temp1 == -1)
- return null;
- tempChar = binaryData[i*2+1];
- temp2 = (tempChar < BASELENGTH) ? hexNumberTable[tempChar] : -1;
- if (temp2 == -1)
- return null;
- decodedData[i] = (byte)((temp1 << 4) | temp2);
- }
- return decodedData;
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/AbstractDateTimeDV.java b/src/com/sun/org/apache/xerces/internal/impl/dv/xs/AbstractDateTimeDV.java
deleted file mode 100644
index d9d6587..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/AbstractDateTimeDV.java
+++ /dev/null
@@ -1,1178 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.xs;
-
-import java.math.BigDecimal;
-
-import javax.xml.datatype.DatatypeFactory;
-import javax.xml.datatype.Duration;
-import javax.xml.datatype.XMLGregorianCalendar;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.jaxp.datatype.DatatypeFactoryImpl;
-import com.sun.org.apache.xerces.internal.xs.datatypes.XSDateTime;
-
-/**
- * This is the base class of all date/time datatype validators.
- * It implements common code for parsing, validating and comparing datatypes.
- * Classes that extend this class, must implement parse() method.
- *
- * REVISIT: There are many instance variables, which would cause problems
- * when we support grammar caching. A grammar is possibly used by
- * two parser instances at the same time, then the same simple type
- * decl object can be used to validate two strings at the same time.
- * -SG
- *
- * @xerces.internal
- *
- * @author Elena Litani
- * @author Len Berman
- * @author Gopal Sharma, SUN Microsystems Inc.
- *
- * @version $Id: AbstractDateTimeDV.java,v 1.7 2010-11-01 04:39:46 joehw Exp $
- */
-public abstract class AbstractDateTimeDV extends TypeValidator {
-
- //debugging
- private static final boolean DEBUG = false;
- //define shared variables for date/time
- //define constants to be used in assigning default values for
- //all date/time excluding duration
- protected final static int YEAR = 2000;
- protected final static int MONTH = 01;
- protected final static int DAY = 01;
- protected static final DatatypeFactory datatypeFactory = new DatatypeFactoryImpl();
-
- @Override
- public short getAllowedFacets() {
- return (XSSimpleTypeDecl.FACET_PATTERN | XSSimpleTypeDecl.FACET_WHITESPACE | XSSimpleTypeDecl.FACET_ENUMERATION | XSSimpleTypeDecl.FACET_MAXINCLUSIVE | XSSimpleTypeDecl.FACET_MININCLUSIVE | XSSimpleTypeDecl.FACET_MAXEXCLUSIVE | XSSimpleTypeDecl.FACET_MINEXCLUSIVE);
- }//getAllowedFacets()
-
- // distinguishes between identity and equality for date/time values
- // ie: two values representing the same "moment in time" but with different
- // remembered timezones are now equal but not identical.
- @Override
- public boolean isIdentical(Object value1, Object value2) {
- if (!(value1 instanceof DateTimeData) || !(value2 instanceof DateTimeData)) {
- return false;
- }
-
- DateTimeData v1 = (DateTimeData) value1;
- DateTimeData v2 = (DateTimeData) value2;
-
- // original timezones must be the same in addition to date/time values
- // being 'equal'
- if ((v1.timezoneHr == v2.timezoneHr) && (v1.timezoneMin == v2.timezoneMin)) {
- return v1.equals(v2);
- }
-
- return false;
- }//isIdentical()
-
- // the parameters are in compiled form (from getActualValue)
- @Override
- public int compare(Object value1, Object value2) {
- return compareDates(((DateTimeData) value1),
- ((DateTimeData) value2), true);
- }//compare()
-
- /**
- * Compare algorithm described in dateDime (3.2.7). Duration datatype
- * overwrites this method
- *
- * @param date1 normalized date representation of the first value
- * @param date2 normalized date representation of the second value
- * @param strict
- * @return less, greater, less_equal, greater_equal, equal
- */
- protected short compareDates(DateTimeData date1, DateTimeData date2, boolean strict) {
- if (date1.utc == date2.utc) {
- return compareOrder(date1, date2);
- }
- short c1, c2;
-
- DateTimeData tempDate = new DateTimeData(null, this);
-
- if (date1.utc == 'Z') {
-
- //compare date1<=date1<=(date2 with time zone -14)
- //
- cloneDate(date2, tempDate); //clones date1 value to global temporary storage: fTempDate
- tempDate.timezoneHr = 14;
- tempDate.timezoneMin = 0;
- tempDate.utc = '+';
- normalize(tempDate);
- c1 = compareOrder(date1, tempDate);
- if (c1 == LESS_THAN) {
- return c1;
- }
-
- //compare date1>=(date2 with time zone +14)
- //
- cloneDate(date2, tempDate); //clones date1 value to global temporary storage: tempDate
- tempDate.timezoneHr = -14;
- tempDate.timezoneMin = 0;
- tempDate.utc = '-';
- normalize(tempDate);
- c2 = compareOrder(date1, tempDate);
- if (c2 == GREATER_THAN) {
- return c2;
- }
-
- return INDETERMINATE;
- } else if (date2.utc == 'Z') {
-
- //compare (date1 with time zone -14)<=date2
- //
- cloneDate(date1, tempDate); //clones date1 value to global temporary storage: tempDate
- tempDate.timezoneHr = -14;
- tempDate.timezoneMin = 0;
- tempDate.utc = '-';
- if (DEBUG) {
- System.out.println("tempDate=" + dateToString(tempDate));
- }
- normalize(tempDate);
- c1 = compareOrder(tempDate, date2);
- if (DEBUG) {
- System.out.println("date=" + dateToString(date2));
- System.out.println("tempDate=" + dateToString(tempDate));
- }
- if (c1 == LESS_THAN) {
- return c1;
- }
-
- //compare (date1 with time zone +14)<=date2
- //
- cloneDate(date1, tempDate); //clones date1 value to global temporary storage: tempDate
- tempDate.timezoneHr = 14;
- tempDate.timezoneMin = 0;
- tempDate.utc = '+';
- normalize(tempDate);
- c2 = compareOrder(tempDate, date2);
- if (DEBUG) {
- System.out.println("tempDate=" + dateToString(tempDate));
- }
- if (c2 == GREATER_THAN) {
- return c2;
- }
-
- return INDETERMINATE;
- }
- return INDETERMINATE;
-
- }
-
- /**
- * Given normalized values, determines order-relation between give date/time
- * objects.
- *
- * @param date1 date/time object
- * @param date2 date/time object
- * @return 0 if date1 and date2 are equal, a value less than 0 if date1 is
- * less than date2, a value greater than 0 if date1 is greater than date2
- */
- protected short compareOrder(DateTimeData date1, DateTimeData date2) {
- if (date1.position < 1) {
- if (date1.year < date2.year) {
- return -1;
- }
- if (date1.year > date2.year) {
- return 1;
- }
- }
- if (date1.position < 2) {
- if (date1.month < date2.month) {
- return -1;
- }
- if (date1.month > date2.month) {
- return 1;
- }
- }
- if (date1.day < date2.day) {
- return -1;
- }
- if (date1.day > date2.day) {
- return 1;
- }
- if (date1.hour < date2.hour) {
- return -1;
- }
- if (date1.hour > date2.hour) {
- return 1;
- }
- if (date1.minute < date2.minute) {
- return -1;
- }
- if (date1.minute > date2.minute) {
- return 1;
- }
- if (date1.second < date2.second) {
- return -1;
- }
- if (date1.second > date2.second) {
- return 1;
- }
- if (date1.utc < date2.utc) {
- return -1;
- }
- if (date1.utc > date2.utc) {
- return 1;
- }
- return 0;
- }
-
- /**
- * Parses time hh:mm:ss.sss and time zone if any
- *
- * @param start
- * @param end
- * @param data
- * @exception RuntimeException
- */
- protected void getTime(String buffer, int start, int end, DateTimeData data) throws RuntimeException {
-
- int stop = start + 2;
-
- //get hours (hh)
- data.hour = parseInt(buffer, start, stop);
-
- //get minutes (mm)
-
- if (buffer.charAt(stop++) != ':') {
- throw new RuntimeException("Error in parsing time zone");
- }
- start = stop;
- stop = stop + 2;
- data.minute = parseInt(buffer, start, stop);
-
- //get seconds (ss)
- if (buffer.charAt(stop++) != ':') {
- throw new RuntimeException("Error in parsing time zone");
- }
-
- //find UTC sign if any
- int sign = findUTCSign(buffer, start, end);
-
- //get seconds (ms)
- start = stop;
- stop = sign < 0 ? end : sign;
- data.second = parseSecond(buffer, start, stop);
-
- //parse UTC time zone (hh:mm)
- if (sign > 0) {
- getTimeZone(buffer, data, sign, end);
- }
- }
-
- /**
- * Parses date CCYY-MM-DD
- *
- * @param buffer
- * @param start start position
- * @param end end position
- * @param date
- * @exception RuntimeException
- */
- protected int getDate(String buffer, int start, int end, DateTimeData date) throws RuntimeException {
-
- start = getYearMonth(buffer, start, end, date);
-
- if (buffer.charAt(start++) != '-') {
- throw new RuntimeException("CCYY-MM must be followed by '-' sign");
- }
- int stop = start + 2;
- date.day = parseInt(buffer, start, stop);
- return stop;
- }
-
- /**
- * Parses date CCYY-MM
- *
- * @param buffer
- * @param start start position
- * @param end end position
- * @param date
- * @exception RuntimeException
- */
- protected int getYearMonth(String buffer, int start, int end, DateTimeData date) throws RuntimeException {
-
- if (buffer.charAt(0) == '-') {
- // REVISIT: date starts with preceding '-' sign
- // do we have to do anything with it?
- //
- start++;
- }
- int i = indexOf(buffer, start, end, '-');
- if (i == -1) {
- throw new RuntimeException("Year separator is missing or misplaced");
- }
- int length = i - start;
- if (length < 4) {
- throw new RuntimeException("Year must have 'CCYY' format");
- } else if (length > 4 && buffer.charAt(start) == '0') {
- throw new RuntimeException("Leading zeros are required if the year value would otherwise have fewer than four digits; otherwise they are forbidden");
- }
- date.year = parseIntYear(buffer, i);
- if (buffer.charAt(i) != '-') {
- throw new RuntimeException("CCYY must be followed by '-' sign");
- }
- start = ++i;
- i = start + 2;
- date.month = parseInt(buffer, start, i);
- return i; //fStart points right after the MONTH
- }
-
- /**
- * Shared code from Date and YearMonth datatypes. Finds if time zone sign is
- * present
- *
- * @param end
- * @param date
- * @exception RuntimeException
- */
- protected void parseTimeZone(String buffer, int start, int end, DateTimeData date) throws RuntimeException {
-
- //fStart points right after the date
-
- if (start < end) {
- if (!isNextCharUTCSign(buffer, start, end)) {
- throw new RuntimeException("Error in month parsing");
- } else {
- getTimeZone(buffer, date, start, end);
- }
- }
- }
-
- /**
- * Parses time zone: 'Z' or {+,-} followed by hh:mm
- *
- * @param data
- * @param sign
- * @exception RuntimeException
- */
- protected void getTimeZone(String buffer, DateTimeData data, int sign, int end) throws RuntimeException {
- data.utc = buffer.charAt(sign);
-
- if (buffer.charAt(sign) == 'Z') {
- if (end > (++sign)) {
- throw new RuntimeException("Error in parsing time zone");
- }
- return;
- }
- if (sign <= (end - 6)) {
-
- int negate = buffer.charAt(sign) == '-' ? -1 : 1;
- //parse hr
- int stop = ++sign + 2;
- data.timezoneHr = negate * parseInt(buffer, sign, stop);
- if (buffer.charAt(stop++) != ':') {
- throw new RuntimeException("Error in parsing time zone");
- }
-
- //parse min
- data.timezoneMin = negate * parseInt(buffer, stop, stop + 2);
-
- if (stop + 2 != end) {
- throw new RuntimeException("Error in parsing time zone");
- }
- if (data.timezoneHr != 0 || data.timezoneMin != 0) {
- data.normalized = false;
- }
- } else {
- throw new RuntimeException("Error in parsing time zone");
- }
- if (DEBUG) {
- System.out.println("time[hh]=" + data.timezoneHr + " time[mm]=" + data.timezoneMin);
- }
- }
-
- /**
- * Computes index of given char within StringBuffer
- *
- * @param start
- * @param end
- * @param ch character to look for in StringBuffer
- * @return index of ch within StringBuffer
- */
- protected int indexOf(String buffer, int start, int end, char ch) {
- for (int i = start; i < end; i++) {
- if (buffer.charAt(i) == ch) {
- return i;
- }
- }
- return -1;
- }
-
- /**
- * Validates given date/time object accoring to W3C PR Schema [D.1 ISO 8601
- * Conventions]
- *
- * @param data
- */
- protected void validateDateTime(DateTimeData data) {
-
- //REVISIT: should we throw an exception for not valid dates
- // or reporting an error message should be sufficient?
-
- /**
- * XML Schema 1.1 - RQ-123: Allow year 0000 in date related types.
- */
- if (!Constants.SCHEMA_1_1_SUPPORT && data.year == 0) {
- throw new RuntimeException("The year \"0000\" is an illegal year value");
-
- }
-
- if (data.month < 1 || data.month > 12) {
- throw new RuntimeException("The month must have values 1 to 12");
-
- }
-
- //validate days
- if (data.day > maxDayInMonthFor(data.year, data.month) || data.day < 1) {
- throw new RuntimeException("The day must have values 1 to 31");
- }
-
- //validate hours
- if (data.hour > 23 || data.hour < 0) {
- if (data.hour == 24 && data.minute == 0 && data.second == 0) {
- data.hour = 0;
- if (++data.day > maxDayInMonthFor(data.year, data.month)) {
- data.day = 1;
- if (++data.month > 12) {
- data.month = 1;
- if (Constants.SCHEMA_1_1_SUPPORT) {
- ++data.year;
- } else if (++data.year == 0) {
- data.year = 1;
- }
- }
- }
- } else {
- throw new RuntimeException("Hour must have values 0-23, unless 24:00:00");
- }
- }
-
- //validate
- if (data.minute > 59 || data.minute < 0) {
- throw new RuntimeException("Minute must have values 0-59");
- }
-
- //validate
- if (data.second >= 60 || data.second < 0) {
- throw new RuntimeException("Second must have values 0-59");
-
- }
-
- //validate
- if (data.timezoneHr > 14 || data.timezoneHr < -14) {
- throw new RuntimeException("Time zone should have range -14:00 to +14:00");
- } else {
- if ((data.timezoneHr == 14 || data.timezoneHr == -14) && data.timezoneMin != 0) {
- throw new RuntimeException("Time zone should have range -14:00 to +14:00");
- } else if (data.timezoneMin > 59 || data.timezoneMin < -59) {
- throw new RuntimeException("Minute must have values 0-59");
- }
- }
-
- }
-
- /**
- * Return index of UTC char: 'Z', '+', '-'
- *
- * @param start
- * @param end
- * @return index of the UTC character that was found
- */
- protected int findUTCSign(String buffer, int start, int end) {
- int c;
- for (int i = start; i < end; i++) {
- c = buffer.charAt(i);
- if (c == 'Z' || c == '+' || c == '-') {
- return i;
- }
-
- }
- return -1;
- }
-
- /**
- * Returns
- * <code>true</code> if the character at start is 'Z', '+' or '-'.
- */
- protected final boolean isNextCharUTCSign(String buffer, int start, int end) {
- if (start < end) {
- char c = buffer.charAt(start);
- return (c == 'Z' || c == '+' || c == '-');
- }
- return false;
- }
-
- /**
- * Given start and end position, parses string value
- *
- * @param buffer string to parse
- * @param start start position
- * @param end end position
- * @return return integer representation of characters
- */
- protected int parseInt(String buffer, int start, int end)
- throws NumberFormatException {
- //REVISIT: more testing on this parsing needs to be done.
- int radix = 10;
- int result = 0;
- int digit = 0;
- int limit = -Integer.MAX_VALUE;
- int multmin = limit / radix;
- int i = start;
- do {
- digit = getDigit(buffer.charAt(i));
- if (digit < 0) {
- throw new NumberFormatException("'" + buffer + "' has wrong format");
- }
- if (result < multmin) {
- throw new NumberFormatException("'" + buffer + "' has wrong format");
- }
- result *= radix;
- if (result < limit + digit) {
- throw new NumberFormatException("'" + buffer + "' has wrong format");
- }
- result -= digit;
-
- } while (++i < end);
- return -result;
- }
-
- // parse Year differently to support negative value.
- protected int parseIntYear(String buffer, int end) {
- int radix = 10;
- int result = 0;
- boolean negative = false;
- int i = 0;
- int limit;
- int multmin;
- int digit = 0;
-
- if (buffer.charAt(0) == '-') {
- negative = true;
- limit = Integer.MIN_VALUE;
- i++;
-
- } else {
- limit = -Integer.MAX_VALUE;
- }
- multmin = limit / radix;
- while (i < end) {
- digit = getDigit(buffer.charAt(i++));
- if (digit < 0) {
- throw new NumberFormatException("'" + buffer + "' has wrong format");
- }
- if (result < multmin) {
- throw new NumberFormatException("'" + buffer + "' has wrong format");
- }
- result *= radix;
- if (result < limit + digit) {
- throw new NumberFormatException("'" + buffer + "' has wrong format");
- }
- result -= digit;
- }
-
- if (negative) {
- if (i > 1) {
- return result;
- } else {
- throw new NumberFormatException("'" + buffer + "' has wrong format");
- }
- }
- return -result;
-
- }
-
- /**
- * If timezone present - normalize dateTime [E Adding durations to
- * dateTimes]
- *
- * @param date CCYY-MM-DDThh:mm:ss+03
- */
- protected void normalize(DateTimeData date) {
-
- // REVISIT: we have common code in addDuration() for durations
- // should consider reorganizing it.
- //
-
- //add minutes (from time zone)
- int negate = -1;
-
- if (DEBUG) {
- System.out.println("==>date.minute" + date.minute);
- System.out.println("==>date.timezoneMin" + date.timezoneMin);
- }
- int temp = date.minute + negate * date.timezoneMin;
- int carry = fQuotient(temp, 60);
- date.minute = mod(temp, 60, carry);
-
- if (DEBUG) {
- System.out.println("==>carry: " + carry);
- }
- //add hours
- temp = date.hour + negate * date.timezoneHr + carry;
- carry = fQuotient(temp, 24);
- date.hour = mod(temp, 24, carry);
- if (DEBUG) {
- System.out.println("==>date.hour" + date.hour);
- System.out.println("==>carry: " + carry);
- }
-
- date.day = date.day + carry;
-
- while (true) {
- temp = maxDayInMonthFor(date.year, date.month);
- if (date.day < 1) {
- date.day = date.day + maxDayInMonthFor(date.year, date.month - 1);
- carry = -1;
- } else if (date.day > temp) {
- date.day = date.day - temp;
- carry = 1;
- } else {
- break;
- }
- temp = date.month + carry;
- date.month = modulo(temp, 1, 13);
- date.year = date.year + fQuotient(temp, 1, 13);
- if (date.year == 0 && !Constants.SCHEMA_1_1_SUPPORT) {
- date.year = (date.timezoneHr < 0 || date.timezoneMin < 0) ? 1 : -1;
- }
- }
- date.utc = 'Z';
- }
-
- /**
- * @param date
- */
- protected void saveUnnormalized(DateTimeData date) {
- date.unNormYear = date.year;
- date.unNormMonth = date.month;
- date.unNormDay = date.day;
- date.unNormHour = date.hour;
- date.unNormMinute = date.minute;
- date.unNormSecond = date.second;
- }
-
- /**
- * Resets object representation of date/time
- *
- * @param data date/time object
- */
- protected void resetDateObj(DateTimeData data) {
- data.year = 0;
- data.month = 0;
- data.day = 0;
- data.hour = 0;
- data.minute = 0;
- data.second = 0;
- data.utc = 0;
- data.timezoneHr = 0;
- data.timezoneMin = 0;
- }
-
- /**
- * Given {year,month} computes maximum number of days for given month
- *
- * @param year
- * @param month
- * @return integer containg the number of days in a given month
- */
- protected int maxDayInMonthFor(int year, int month) {
- //validate days
- if (month == 4 || month == 6 || month == 9 || month == 11) {
- return 30;
- } else if (month == 2) {
- if (isLeapYear(year)) {
- return 29;
- } else {
- return 28;
- }
- } else {
- return 31;
- }
- }
-
- private boolean isLeapYear(int year) {
-
- //REVISIT: should we take care about Julian calendar?
- return ((year % 4 == 0) && ((year % 100 != 0) || (year % 400 == 0)));
- }
-
- //
- // help function described in W3C PR Schema [E Adding durations to dateTimes]
- //
- protected int mod(int a, int b, int quotient) {
- //modulo(a, b) = a - fQuotient(a,b)*b
- return (a - quotient * b);
- }
-
- //
- // help function described in W3C PR Schema [E Adding durations to dateTimes]
- //
- protected int fQuotient(int a, int b) {
-
- //fQuotient(a, b) = the greatest integer less than or equal to a/b
- return (int) Math.floor((float) a / b);
- }
-
- //
- // help function described in W3C PR Schema [E Adding durations to dateTimes]
- //
- protected int modulo(int temp, int low, int high) {
- //modulo(a - low, high - low) + low
- int a = temp - low;
- int b = high - low;
- return (mod(a, b, fQuotient(a, b)) + low);
- }
-
- //
- // help function described in W3C PR Schema [E Adding durations to dateTimes]
- //
- protected int fQuotient(int temp, int low, int high) {
- //fQuotient(a - low, high - low)
-
- return fQuotient(temp - low, high - low);
- }
-
- protected String dateToString(DateTimeData date) {
- StringBuffer message = new StringBuffer(25);
- append(message, date.year, 4);
- message.append('-');
- append(message, date.month, 2);
- message.append('-');
- append(message, date.day, 2);
- message.append('T');
- append(message, date.hour, 2);
- message.append(':');
- append(message, date.minute, 2);
- message.append(':');
- append(message, date.second);
- append(message, (char) date.utc, 0);
- return message.toString();
- }
-
- protected final void append(StringBuffer message, int value, int nch) {
- if (value == Integer.MIN_VALUE) {
- message.append(value);
- return;
- }
- if (value < 0) {
- message.append('-');
- value = -value;
- }
- if (nch == 4) {
- if (value < 10) {
- message.append("000");
- } else if (value < 100) {
- message.append("00");
- } else if (value < 1000) {
- message.append('0');
- }
- message.append(value);
- } else if (nch == 2) {
- if (value < 10) {
- message.append('0');
- }
- message.append(value);
- } else {
- if (value != 0) {
- message.append((char) value);
- }
- }
- }
-
- protected final void append(StringBuffer message, double value) {
- if (value < 0) {
- message.append('-');
- value = -value;
- }
- if (value < 10) {
- message.append('0');
- }
- append2(message, value);
- }
-
- protected final void append2(StringBuffer message, double value) {
- final int intValue = (int) value;
- if (value == intValue) {
- message.append(intValue);
- } else {
- append3(message, value);
- }
- }
-
- private void append3(StringBuffer message, double value) {
- String d = String.valueOf(value);
- int eIndex = d.indexOf('E');
- if (eIndex == -1) {
- message.append(d);
- return;
- }
- int exp;
- if (value < 1) {
- // Need to convert from scientific notation of the form
- // n.nnn...E-N (N >= 4) to a normal decimal value.
- try {
- exp = parseInt(d, eIndex + 2, d.length());
- } // This should never happen.
- // It's only possible if String.valueOf(double) is broken.
- catch (Exception e) {
- message.append(d);
- return;
- }
- message.append("0.");
- for (int i = 1; i < exp; ++i) {
- message.append('0');
- }
- // Remove trailing zeros.
- int end = eIndex - 1;
- while (end > 0) {
- char c = d.charAt(end);
- if (c != '0') {
- break;
- }
- --end;
- }
- // Now append the digits to the end. Skip over the decimal point.
- for (int i = 0; i <= end; ++i) {
- char c = d.charAt(i);
- if (c != '.') {
- message.append(c);
- }
- }
- } else {
- // Need to convert from scientific notation of the form
- // n.nnn...EN (N >= 7) to a normal decimal value.
- try {
- exp = parseInt(d, eIndex + 1, d.length());
- } // This should never happen.
- // It's only possible if String.valueOf(double) is broken.
- catch (Exception e) {
- message.append(d);
- return;
- }
- final int integerEnd = exp + 2;
- for (int i = 0; i < eIndex; ++i) {
- char c = d.charAt(i);
- if (c != '.') {
- if (i == integerEnd) {
- message.append('.');
- }
- message.append(c);
- }
- }
- // Append trailing zeroes if necessary.
- for (int i = integerEnd - eIndex; i > 0; --i) {
- message.append('0');
- }
- }
- }
-
- protected double parseSecond(String buffer, int start, int end)
- throws NumberFormatException {
- int dot = -1;
- for (int i = start; i < end; i++) {
- char ch = buffer.charAt(i);
- if (ch == '.') {
- dot = i;
- } else if (ch > '9' || ch < '0') {
- throw new NumberFormatException("'" + buffer + "' has wrong format");
- }
- }
- if (dot == -1) {
- if (start + 2 != end) {
- throw new NumberFormatException("'" + buffer + "' has wrong format");
- }
- } else if (start + 2 != dot || dot + 1 == end) {
- throw new NumberFormatException("'" + buffer + "' has wrong format");
- }
- return Double.parseDouble(buffer.substring(start, end));
- }
-
- //
- //Private help functions
- //
- private void cloneDate(DateTimeData finalValue, DateTimeData tempDate) {
- tempDate.year = finalValue.year;
- tempDate.month = finalValue.month;
- tempDate.day = finalValue.day;
- tempDate.hour = finalValue.hour;
- tempDate.minute = finalValue.minute;
- tempDate.second = finalValue.second;
- tempDate.utc = finalValue.utc;
- tempDate.timezoneHr = finalValue.timezoneHr;
- tempDate.timezoneMin = finalValue.timezoneMin;
- }
-
- /**
- * Represents date time data
- */
- static final class DateTimeData implements XSDateTime {
-
- int year, month, day, hour, minute, utc;
- double second;
- int timezoneHr, timezoneMin;
- private String originalValue;
- boolean normalized = true;
- int unNormYear;
- int unNormMonth;
- int unNormDay;
- int unNormHour;
- int unNormMinute;
- double unNormSecond;
- // used for comparisons - to decide the 'interesting' portions of
- // a date/time based data type.
- int position;
- // a pointer to the type that was used go generate this data
- // note that this is not the actual simple type, but one of the
- // statically created XXXDV objects, so this won't cause any GC problem.
- final AbstractDateTimeDV type;
- private volatile String canonical;
-
- public DateTimeData(String originalValue, AbstractDateTimeDV type) {
- this.originalValue = originalValue;
- this.type = type;
- }
-
- public DateTimeData(int year, int month, int day, int hour, int minute,
- double second, int utc, String originalValue, boolean normalized, AbstractDateTimeDV type) {
- this.year = year;
- this.month = month;
- this.day = day;
- this.hour = hour;
- this.minute = minute;
- this.second = second;
- this.utc = utc;
- this.type = type;
- this.originalValue = originalValue;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (!(obj instanceof DateTimeData)) {
- return false;
- }
- return type.compareDates(this, (DateTimeData) obj, true) == 0;
- }
-
- // If two DateTimeData are equals - then they should have the same
- // hashcode. This means we need to convert the date to UTC before
- // we return its hashcode.
- // The DateTimeData is unfortunately mutable - so we cannot
- // cache the result of the conversion...
- //
- @Override
- public int hashCode() {
- final DateTimeData tempDate = new DateTimeData(null, type);
- type.cloneDate(this, tempDate);
- type.normalize(tempDate);
- return type.dateToString(tempDate).hashCode();
- }
-
- @Override
- public String toString() {
- if (canonical == null) {
- canonical = type.dateToString(this);
- }
- return canonical;
- }
- /* (non-Javadoc)
- * @see org.apache.xerces.xs.datatypes.XSDateTime#getYear()
- */
-
- @Override
- public int getYears() {
- if (type instanceof DurationDV) {
- return 0;
- }
- return normalized ? year : unNormYear;
- }
- /* (non-Javadoc)
- * @see org.apache.xerces.xs.datatypes.XSDateTime#getMonth()
- */
-
- @Override
- public int getMonths() {
- if (type instanceof DurationDV) {
- return year * 12 + month;
- }
- return normalized ? month : unNormMonth;
- }
- /* (non-Javadoc)
- * @see org.apache.xerces.xs.datatypes.XSDateTime#getDay()
- */
-
- @Override
- public int getDays() {
- if (type instanceof DurationDV) {
- return 0;
- }
- return normalized ? day : unNormDay;
- }
- /* (non-Javadoc)
- * @see org.apache.xerces.xs.datatypes.XSDateTime#getHour()
- */
-
- @Override
- public int getHours() {
- if (type instanceof DurationDV) {
- return 0;
- }
- return normalized ? hour : unNormHour;
- }
- /* (non-Javadoc)
- * @see org.apache.xerces.xs.datatypes.XSDateTime#getMinutes()
- */
-
- @Override
- public int getMinutes() {
- if (type instanceof DurationDV) {
- return 0;
- }
- return normalized ? minute : unNormMinute;
- }
- /* (non-Javadoc)
- * @see org.apache.xerces.xs.datatypes.XSDateTime#getSeconds()
- */
-
- @Override
- public double getSeconds() {
- if (type instanceof DurationDV) {
- return day * 24 * 60 * 60 + hour * 60 * 60 + minute * 60 + second;
- }
- return normalized ? second : unNormSecond;
- }
- /* (non-Javadoc)
- * @see org.apache.xerces.xs.datatypes.XSDateTime#hasTimeZone()
- */
-
- @Override
- public boolean hasTimeZone() {
- return utc != 0;
- }
- /* (non-Javadoc)
- * @see org.apache.xerces.xs.datatypes.XSDateTime#getTimeZoneHours()
- */
-
- @Override
- public int getTimeZoneHours() {
- return timezoneHr;
- }
- /* (non-Javadoc)
- * @see org.apache.xerces.xs.datatypes.XSDateTime#getTimeZoneMinutes()
- */
-
- @Override
- public int getTimeZoneMinutes() {
- return timezoneMin;
- }
- /* (non-Javadoc)
- * @see org.apache.xerces.xs.datatypes.XSDateTime#getLexicalValue()
- */
-
- @Override
- public String getLexicalValue() {
- return originalValue;
- }
- /* (non-Javadoc)
- * @see org.apache.xerces.xs.datatypes.XSDateTime#normalize()
- */
-
- @Override
- public XSDateTime normalize() {
- if (!normalized) {
- DateTimeData dt = (DateTimeData) this.clone();
- dt.normalized = true;
- return dt;
- }
- return this;
- }
- /* (non-Javadoc)
- * @see org.apache.xerces.xs.datatypes.XSDateTime#isNormalized()
- */
-
- @Override
- public boolean isNormalized() {
- return normalized;
- }
-
- @Override
- public Object clone() {
- DateTimeData dt = new DateTimeData(this.year, this.month, this.day, this.hour,
- this.minute, this.second, this.utc, this.originalValue, this.normalized, this.type);
- dt.canonical = this.canonical;
- dt.position = position;
- dt.timezoneHr = this.timezoneHr;
- dt.timezoneMin = this.timezoneMin;
- dt.unNormYear = this.unNormYear;
- dt.unNormMonth = this.unNormMonth;
- dt.unNormDay = this.unNormDay;
- dt.unNormHour = this.unNormHour;
- dt.unNormMinute = this.unNormMinute;
- dt.unNormSecond = this.unNormSecond;
- return dt;
- }
-
- /* (non-Javadoc)
- * @see org.apache.xerces.xs.datatypes.XSDateTime#getXMLGregorianCalendar()
- */
- @Override
- public XMLGregorianCalendar getXMLGregorianCalendar() {
- return type.getXMLGregorianCalendar(this);
- }
- /* (non-Javadoc)
- * @see org.apache.xerces.xs.datatypes.XSDateTime#getDuration()
- */
-
- @Override
- public Duration getDuration() {
- return type.getDuration(this);
- }
- }
-
- protected XMLGregorianCalendar getXMLGregorianCalendar(DateTimeData data) {
- return null;
- }
-
- protected Duration getDuration(DateTimeData data) {
- return null;
- }
-
- protected final BigDecimal getFractionalSecondsAsBigDecimal(DateTimeData data) {
- final StringBuffer buf = new StringBuffer();
- append3(buf, data.unNormSecond);
- String value = buf.toString();
- final int index = value.indexOf('.');
- if (index == -1) {
- return null;
- }
- value = value.substring(index);
- final BigDecimal _val = new BigDecimal(value);
- if (_val.compareTo(BigDecimal.valueOf(0)) == 0) {
- return null;
- }
- return _val;
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/AnyAtomicDV.java b/src/com/sun/org/apache/xerces/internal/impl/dv/xs/AnyAtomicDV.java
deleted file mode 100644
index e7dbf96..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/AnyAtomicDV.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.xs;
-
-import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException;
-import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
-
-/**
- * Represent the schema type "anyAtomicType"
- *
- * @xerces.experimental
- *
- * @author Ankit Pasricha, IBM
- *
- */
-class AnyAtomicDV extends TypeValidator {
-
- public short getAllowedFacets() {
- return 0;
- }
-
- public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException {
- return content;
- }
-
-} // class AnyAtomicDV
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/AnySimpleDV.java b/src/com/sun/org/apache/xerces/internal/impl/dv/xs/AnySimpleDV.java
deleted file mode 100644
index 0a8bf00..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/AnySimpleDV.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.xs;
-
-import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException;
-import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
-
-/**
- * Represent the schema type "anySimpleType"
- *
- * @xerces.internal
- *
- * @author Neeraj Bajaj, Sun Microsystems, inc.
- * @author Sandy Gao, IBM
- *
- */
-public class AnySimpleDV extends TypeValidator {
-
- public short getAllowedFacets() {
- // anySimpleType doesn't allow any facet, not even whiteSpace
- return 0;
- }
-
- public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException {
- return content;
- }
-
-} // class AnySimpleDV
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/AnyURIDV.java b/src/com/sun/org/apache/xerces/internal/impl/dv/xs/AnyURIDV.java
deleted file mode 100644
index 3458dac..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/AnyURIDV.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.xs;
-
-import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException;
-import com.sun.org.apache.xerces.internal.util.URI;
-import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
-
-/**
- * Represent the schema type "anyURI"
- *
- * @xerces.internal
- *
- * @author Neeraj Bajaj, Sun Microsystems, inc.
- * @author Sandy Gao, IBM
- *
- */
-public class AnyURIDV extends TypeValidator {
-
- private static final URI BASE_URI;
- static {
- URI uri = null;
- try {
- uri = new URI("abc://def.ghi.jkl");
- } catch (URI.MalformedURIException ex) {
- }
- BASE_URI = uri;
- }
-
- public short getAllowedFacets(){
- return (XSSimpleTypeDecl.FACET_LENGTH | XSSimpleTypeDecl.FACET_MINLENGTH | XSSimpleTypeDecl.FACET_MAXLENGTH | XSSimpleTypeDecl.FACET_PATTERN | XSSimpleTypeDecl.FACET_ENUMERATION | XSSimpleTypeDecl.FACET_WHITESPACE );
- }
-
- // before we return string we have to make sure it is correct URI as per spec.
- // for some types (string and derived), they just return the string itself
- public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException {
- // check 3.2.17.c0 must: URI (rfc 2396/2723)
- try {
- if( content.length() != 0 ) {
- // encode special characters using XLink 5.4 algorithm
- final String encoded = encode(content);
- // Support for relative URLs
- // According to Java 1.1: URLs may also be specified with a
- // String and the URL object that it is related to.
- new URI(BASE_URI, encoded );
- }
- } catch (URI.MalformedURIException ex) {
- throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "anyURI"});
- }
-
- // REVISIT: do we need to return the new URI object?
- return content;
- }
-
- // which ASCII characters need to be escaped
- private static boolean gNeedEscaping[] = new boolean[128];
- // the first hex character if a character needs to be escaped
- private static char gAfterEscaping1[] = new char[128];
- // the second hex character if a character needs to be escaped
- private static char gAfterEscaping2[] = new char[128];
- private static char[] gHexChs = {'0', '1', '2', '3', '4', '5', '6', '7',
- '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
- // initialize the above 3 arrays
- static {
- for (int i = 0; i <= 0x1f; i++) {
- gNeedEscaping[i] = true;
- gAfterEscaping1[i] = gHexChs[i >> 4];
- gAfterEscaping2[i] = gHexChs[i & 0xf];
- }
- gNeedEscaping[0x7f] = true;
- gAfterEscaping1[0x7f] = '7';
- gAfterEscaping2[0x7f] = 'F';
- char[] escChs = {' ', '<', '>', '"', '{', '}',
- '|', '\\', '^', '~', '`'};
- int len = escChs.length;
- char ch;
- for (int i = 0; i < len; i++) {
- ch = escChs[i];
- gNeedEscaping[ch] = true;
- gAfterEscaping1[ch] = gHexChs[ch >> 4];
- gAfterEscaping2[ch] = gHexChs[ch & 0xf];
- }
- }
-
- // To encode special characters in anyURI, by using %HH to represent
- // special ASCII characters: 0x00~0x1F, 0x7F, ' ', '<', '>', etc.
- // and non-ASCII characters (whose value >= 128).
- private static String encode(String anyURI){
- int len = anyURI.length(), ch;
- StringBuffer buffer = new StringBuffer(len*3);
-
- // for each character in the anyURI
- int i = 0;
- for (; i < len; i++) {
- ch = anyURI.charAt(i);
- // if it's not an ASCII character, break here, and use UTF-8 encoding
- if (ch >= 128)
- break;
- if (gNeedEscaping[ch]) {
- buffer.append('%');
- buffer.append(gAfterEscaping1[ch]);
- buffer.append(gAfterEscaping2[ch]);
- }
- else {
- buffer.append((char)ch);
- }
- }
-
- // we saw some non-ascii character
- if (i < len) {
- // get UTF-8 bytes for the remaining sub-string
- byte[] bytes = null;
- byte b;
- try {
- bytes = anyURI.substring(i).getBytes("UTF-8");
- } catch (java.io.UnsupportedEncodingException e) {
- // should never happen
- return anyURI;
- }
- len = bytes.length;
-
- // for each byte
- for (i = 0; i < len; i++) {
- b = bytes[i];
- // for non-ascii character: make it positive, then escape
- if (b < 0) {
- ch = b + 256;
- buffer.append('%');
- buffer.append(gHexChs[ch >> 4]);
- buffer.append(gHexChs[ch & 0xf]);
- }
- else if (gNeedEscaping[b]) {
- buffer.append('%');
- buffer.append(gAfterEscaping1[b]);
- buffer.append(gAfterEscaping2[b]);
- }
- else {
- buffer.append((char)b);
- }
- }
- }
-
- // If encoding happened, create a new string;
- // otherwise, return the orginal one.
- if (buffer.length() != len) {
- return buffer.toString();
- }
- else {
- return anyURI;
- }
- }
-
-} // class AnyURIDV
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/Base64BinaryDV.java b/src/com/sun/org/apache/xerces/internal/impl/dv/xs/Base64BinaryDV.java
deleted file mode 100644
index fcfa039..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/Base64BinaryDV.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.xs;
-
-import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException;
-import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
-import com.sun.org.apache.xerces.internal.impl.dv.util.Base64;
-import com.sun.org.apache.xerces.internal.impl.dv.util.ByteListImpl;
-
-/**
- * Represent the schema type "base64Binary"
- *
- * @xerces.internal
- *
- * @author Neeraj Bajaj, Sun Microsystems, inc.
- * @author Sandy Gao, IBM
- *
- * @version $Id: Base64BinaryDV.java,v 1.7 2010-11-01 04:39:46 joehw Exp $
- */
-public class Base64BinaryDV extends TypeValidator {
-
- public short getAllowedFacets(){
- return (XSSimpleTypeDecl.FACET_LENGTH | XSSimpleTypeDecl.FACET_MINLENGTH | XSSimpleTypeDecl.FACET_MAXLENGTH | XSSimpleTypeDecl.FACET_PATTERN | XSSimpleTypeDecl.FACET_ENUMERATION | XSSimpleTypeDecl.FACET_WHITESPACE );
- }
-
- public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException {
- byte[] decoded = Base64.decode(content);
- if (decoded == null)
- throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "base64Binary"});
-
- return new XBase64(decoded);
- }
-
- // length of a binary type is the number of bytes
- public int getDataLength(Object value) {
- return ((XBase64)value).getLength();
- }
-
- /**
- * represent base64 data
- */
- private static final class XBase64 extends ByteListImpl {
-
- public XBase64(byte[] data) {
- super(data);
- }
- public synchronized String toString() {
- if (canonical == null) {
- canonical = Base64.encode(data);
- }
- return canonical;
- }
-
- public boolean equals(Object obj) {
- if (!(obj instanceof XBase64))
- return false;
- byte[] odata = ((XBase64)obj).data;
- int len = data.length;
- if (len != odata.length)
- return false;
- for (int i = 0; i < len; i++) {
- if (data[i] != odata[i])
- return false;
- }
- return true;
- }
-
- public int hashCode() {
- int hash = 0;
- for (int i = 0; i < data.length; ++i) {
- hash = hash * 37 + (((int) data[i]) & 0xff);
- }
- return hash;
- }
- }
-} // class Base64BinaryDV
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/BaseDVFactory.java b/src/com/sun/org/apache/xerces/internal/impl/dv/xs/BaseDVFactory.java
deleted file mode 100644
index 198f3ab..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/BaseDVFactory.java
+++ /dev/null
@@ -1,250 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2002, 2003,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.xs;
-
-import com.sun.org.apache.xerces.internal.impl.dv.SchemaDVFactory;
-import com.sun.org.apache.xerces.internal.impl.dv.XSFacets;
-import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType;
-import com.sun.org.apache.xerces.internal.util.SymbolHash;
-import com.sun.org.apache.xerces.internal.xs.XSConstants;
-import com.sun.org.apache.xerces.internal.xs.XSObjectList;
-
-/**
- * the factory to create/return built-in schema DVs and create user-defined DVs
- *
- * @xerces.internal
- *
- * @author Neeraj Bajaj, Sun Microsystems, inc.
- * @author Sandy Gao, IBM
- *
- * @version $Id: BaseDVFactory.java,v 1.7 2010-11-01 04:39:46 joehw Exp $
- */
-public class BaseDVFactory extends SchemaDVFactory {
-
- static final String URI_SCHEMAFORSCHEMA = "http://www.w3.org/2001/XMLSchema";
-
- // there are 27 types. 53 is the closest prime number to 27*2=54.
- static SymbolHash fBaseTypes = new SymbolHash(53);
- static {
- createBuiltInTypes(fBaseTypes);
- }
-
- /**
- * Get a built-in simple type of the given name
- * REVISIT: its still not decided within the Schema WG how to define the
- * ur-types and if all simple types should be derived from a
- * complex type, so as of now we ignore the fact that anySimpleType
- * is derived from anyType, and pass 'null' as the base of
- * anySimpleType. It needs to be changed as per the decision taken.
- *
- * @param name the name of the datatype
- * @return the datatype validator of the given name
- */
- public XSSimpleType getBuiltInType(String name) {
- return (XSSimpleType)fBaseTypes.get(name);
- }
-
- /**
- * get all built-in simple types, which are stored in a hashtable keyed by
- * the name
- *
- * @return a hashtable which contains all built-in simple types
- */
- public SymbolHash getBuiltInTypes() {
- return (SymbolHash)fBaseTypes.makeClone();
- }
-
- /**
- * Create a new simple type which is derived by restriction from another
- * simple type.
- *
- * @param name name of the new type, could be null
- * @param targetNamespace target namespace of the new type, could be null
- * @param finalSet value of "final"
- * @param base base type of the new type
- * @param annotations set of annotations
- * @return the newly created simple type
- */
- public XSSimpleType createTypeRestriction(String name, String targetNamespace,
- short finalSet, XSSimpleType base, XSObjectList annotations) {
- return new XSSimpleTypeDecl((XSSimpleTypeDecl)base, name, targetNamespace, finalSet, false, annotations);
- }
-
- /**
- * Create a new simple type which is derived by list from another simple
- * type.
- *
- * @param name name of the new type, could be null
- * @param targetNamespace target namespace of the new type, could be null
- * @param finalSet value of "final"
- * @param itemType item type of the list type
- * @param annotations set of annotations
- * @return the newly created simple type
- */
- public XSSimpleType createTypeList(String name, String targetNamespace,
- short finalSet, XSSimpleType itemType,
- XSObjectList annotations) {
- return new XSSimpleTypeDecl(name, targetNamespace, finalSet, (XSSimpleTypeDecl)itemType, false, annotations);
- }
-
- /**
- * Create a new simple type which is derived by union from a list of other
- * simple types.
- *
- * @param name name of the new type, could be null
- * @param targetNamespace target namespace of the new type, could be null
- * @param finalSet value of "final"
- * @param memberTypes member types of the union type
- * @param annotations set of annotations
- * @return the newly created simple type
- */
- public XSSimpleType createTypeUnion(String name, String targetNamespace,
- short finalSet, XSSimpleType[] memberTypes,
- XSObjectList annotations) {
- int typeNum = memberTypes.length;
- XSSimpleTypeDecl[] mtypes = new XSSimpleTypeDecl[typeNum];
- System.arraycopy(memberTypes, 0, mtypes, 0, typeNum);
-
- return new XSSimpleTypeDecl(name, targetNamespace, finalSet, mtypes, annotations);
- }
-
- // create all built-in types
- static void createBuiltInTypes(SymbolHash types) {
- // base schema simple type names
- final String ANYSIMPLETYPE = "anySimpleType";
- final String ANYURI = "anyURI";
- final String BASE64BINARY = "base64Binary";
- final String BOOLEAN = "boolean";
- final String BYTE = "byte";
- final String DATE = "date";
- final String DATETIME = "dateTime";
- final String DAY = "gDay";
- final String DECIMAL = "decimal";
- final String INT = "int";
- final String INTEGER = "integer";
- final String LONG = "long";
- final String NEGATIVEINTEGER = "negativeInteger";
- final String MONTH = "gMonth";
- final String MONTHDAY = "gMonthDay";
- final String NONNEGATIVEINTEGER= "nonNegativeInteger";
- final String NONPOSITIVEINTEGER= "nonPositiveInteger";
- final String POSITIVEINTEGER = "positiveInteger";
- final String SHORT = "short";
- final String STRING = "string";
- final String TIME = "time";
- final String UNSIGNEDBYTE = "unsignedByte";
- final String UNSIGNEDINT = "unsignedInt";
- final String UNSIGNEDLONG = "unsignedLong";
- final String UNSIGNEDSHORT = "unsignedShort";
- final String YEAR = "gYear";
- final String YEARMONTH = "gYearMonth";
-
- final XSFacets facets = new XSFacets();
-
- XSSimpleTypeDecl anySimpleType = XSSimpleTypeDecl.fAnySimpleType;
- types.put(ANYSIMPLETYPE, anySimpleType);
- XSSimpleTypeDecl stringDV = new XSSimpleTypeDecl(anySimpleType, STRING, XSSimpleTypeDecl.DV_STRING, XSSimpleType.ORDERED_FALSE, false, false, false, true, XSConstants.STRING_DT);
- types.put(STRING, stringDV);
- types.put(BOOLEAN, new XSSimpleTypeDecl(anySimpleType, BOOLEAN, XSSimpleTypeDecl.DV_BOOLEAN, XSSimpleType.ORDERED_FALSE, false, true, false, true, XSConstants.BOOLEAN_DT));
- XSSimpleTypeDecl decimalDV = new XSSimpleTypeDecl(anySimpleType, DECIMAL, XSSimpleTypeDecl.DV_DECIMAL, XSSimpleType.ORDERED_TOTAL, false, false, true, true, XSConstants.DECIMAL_DT);
- types.put(DECIMAL, decimalDV);
-
- types.put(ANYURI, new XSSimpleTypeDecl(anySimpleType, ANYURI, XSSimpleTypeDecl.DV_ANYURI, XSSimpleType.ORDERED_FALSE, false, false, false, true, XSConstants.ANYURI_DT));
- types.put(BASE64BINARY, new XSSimpleTypeDecl(anySimpleType, BASE64BINARY, XSSimpleTypeDecl.DV_BASE64BINARY, XSSimpleType.ORDERED_FALSE, false, false, false, true, XSConstants.BASE64BINARY_DT));
- types.put(DATETIME, new XSSimpleTypeDecl(anySimpleType, DATETIME, XSSimpleTypeDecl.DV_DATETIME, XSSimpleType.ORDERED_PARTIAL, false, false, false, true, XSConstants.DATETIME_DT));
- types.put(TIME, new XSSimpleTypeDecl(anySimpleType, TIME, XSSimpleTypeDecl.DV_TIME, XSSimpleType.ORDERED_PARTIAL, false, false, false, true, XSConstants.TIME_DT));
- types.put(DATE, new XSSimpleTypeDecl(anySimpleType, DATE, XSSimpleTypeDecl.DV_DATE, XSSimpleType.ORDERED_PARTIAL, false, false, false, true, XSConstants.DATE_DT));
- types.put(YEARMONTH, new XSSimpleTypeDecl(anySimpleType, YEARMONTH, XSSimpleTypeDecl.DV_GYEARMONTH, XSSimpleType.ORDERED_PARTIAL, false, false, false, true, XSConstants.GYEARMONTH_DT));
- types.put(YEAR, new XSSimpleTypeDecl(anySimpleType, YEAR, XSSimpleTypeDecl.DV_GYEAR, XSSimpleType.ORDERED_PARTIAL, false, false, false, true, XSConstants.GYEAR_DT));
- types.put(MONTHDAY, new XSSimpleTypeDecl(anySimpleType, MONTHDAY, XSSimpleTypeDecl.DV_GMONTHDAY, XSSimpleType.ORDERED_PARTIAL, false, false, false, true, XSConstants.GMONTHDAY_DT));
- types.put(DAY, new XSSimpleTypeDecl(anySimpleType, DAY, XSSimpleTypeDecl.DV_GDAY, XSSimpleType.ORDERED_PARTIAL, false, false, false, true, XSConstants.GDAY_DT));
- types.put(MONTH, new XSSimpleTypeDecl(anySimpleType, MONTH, XSSimpleTypeDecl.DV_GMONTH, XSSimpleType.ORDERED_PARTIAL, false, false, false, true, XSConstants.GMONTH_DT));
-
- XSSimpleTypeDecl integerDV = new XSSimpleTypeDecl(decimalDV, INTEGER, XSSimpleTypeDecl.DV_INTEGER, XSSimpleType.ORDERED_TOTAL, false, false, true, true, XSConstants.INTEGER_DT);
- types.put(INTEGER, integerDV);
-
- facets.maxInclusive = "0";
- XSSimpleTypeDecl nonPositiveDV = new XSSimpleTypeDecl(integerDV, NONPOSITIVEINTEGER, URI_SCHEMAFORSCHEMA, (short)0, false, null, XSConstants.NONPOSITIVEINTEGER_DT);
- nonPositiveDV.applyFacets1(facets , XSSimpleType.FACET_MAXINCLUSIVE, (short)0);
- types.put(NONPOSITIVEINTEGER, nonPositiveDV);
-
- facets.maxInclusive = "-1";
- XSSimpleTypeDecl negativeDV = new XSSimpleTypeDecl(nonPositiveDV, NEGATIVEINTEGER, URI_SCHEMAFORSCHEMA, (short)0, false, null, XSConstants.NEGATIVEINTEGER_DT);
- negativeDV.applyFacets1(facets , XSSimpleType.FACET_MAXINCLUSIVE, (short)0);
- types.put(NEGATIVEINTEGER, negativeDV);
-
- facets.maxInclusive = "9223372036854775807";
- facets.minInclusive = "-9223372036854775808";
- XSSimpleTypeDecl longDV = new XSSimpleTypeDecl(integerDV, LONG, URI_SCHEMAFORSCHEMA, (short)0, false, null, XSConstants.LONG_DT);
- longDV.applyFacets1(facets , (short)(XSSimpleType.FACET_MAXINCLUSIVE | XSSimpleType.FACET_MININCLUSIVE), (short)0 );
- types.put(LONG, longDV);
-
-
- facets.maxInclusive = "2147483647";
- facets.minInclusive = "-2147483648";
- XSSimpleTypeDecl intDV = new XSSimpleTypeDecl(longDV, INT, URI_SCHEMAFORSCHEMA, (short)0, false, null, XSConstants.INT_DT);
- intDV.applyFacets1(facets, (short)(XSSimpleType.FACET_MAXINCLUSIVE | XSSimpleType.FACET_MININCLUSIVE), (short)0 );
- types.put(INT, intDV);
-
- facets.maxInclusive = "32767";
- facets.minInclusive = "-32768";
- XSSimpleTypeDecl shortDV = new XSSimpleTypeDecl(intDV, SHORT , URI_SCHEMAFORSCHEMA, (short)0, false, null, XSConstants.SHORT_DT);
- shortDV.applyFacets1(facets, (short)(XSSimpleType.FACET_MAXINCLUSIVE | XSSimpleType.FACET_MININCLUSIVE), (short)0 );
- types.put(SHORT, shortDV);
-
- facets.maxInclusive = "127";
- facets.minInclusive = "-128";
- XSSimpleTypeDecl byteDV = new XSSimpleTypeDecl(shortDV, BYTE , URI_SCHEMAFORSCHEMA, (short)0, false, null, XSConstants.BYTE_DT);
- byteDV.applyFacets1(facets, (short)(XSSimpleType.FACET_MAXINCLUSIVE | XSSimpleType.FACET_MININCLUSIVE), (short)0 );
- types.put(BYTE, byteDV);
-
- facets.minInclusive = "0" ;
- XSSimpleTypeDecl nonNegativeDV = new XSSimpleTypeDecl(integerDV, NONNEGATIVEINTEGER , URI_SCHEMAFORSCHEMA, (short)0, false, null, XSConstants.NONNEGATIVEINTEGER_DT);
- nonNegativeDV.applyFacets1(facets, XSSimpleType.FACET_MININCLUSIVE, (short)0 );
- types.put(NONNEGATIVEINTEGER, nonNegativeDV);
-
- facets.maxInclusive = "18446744073709551615" ;
- XSSimpleTypeDecl unsignedLongDV = new XSSimpleTypeDecl(nonNegativeDV, UNSIGNEDLONG , URI_SCHEMAFORSCHEMA, (short)0, false, null, XSConstants.UNSIGNEDLONG_DT);
- unsignedLongDV.applyFacets1(facets, XSSimpleType.FACET_MAXINCLUSIVE, (short)0 );
- types.put(UNSIGNEDLONG, unsignedLongDV);
-
- facets.maxInclusive = "4294967295" ;
- XSSimpleTypeDecl unsignedIntDV = new XSSimpleTypeDecl(unsignedLongDV, UNSIGNEDINT , URI_SCHEMAFORSCHEMA, (short)0, false, null, XSConstants.UNSIGNEDINT_DT);
- unsignedIntDV.applyFacets1(facets, XSSimpleType.FACET_MAXINCLUSIVE, (short)0 );
- types.put(UNSIGNEDINT, unsignedIntDV);
-
- facets.maxInclusive = "65535" ;
- XSSimpleTypeDecl unsignedShortDV = new XSSimpleTypeDecl(unsignedIntDV, UNSIGNEDSHORT , URI_SCHEMAFORSCHEMA, (short)0, false, null, XSConstants.UNSIGNEDSHORT_DT);
- unsignedShortDV.applyFacets1(facets, XSSimpleType.FACET_MAXINCLUSIVE, (short)0 );
- types.put(UNSIGNEDSHORT, unsignedShortDV);
-
- facets.maxInclusive = "255" ;
- XSSimpleTypeDecl unsignedByteDV = new XSSimpleTypeDecl(unsignedShortDV, UNSIGNEDBYTE , URI_SCHEMAFORSCHEMA, (short)0, false, null, XSConstants.UNSIGNEDBYTE_DT);
- unsignedByteDV.applyFacets1(facets, XSSimpleType.FACET_MAXINCLUSIVE, (short)0 );
- types.put(UNSIGNEDBYTE, unsignedByteDV);
-
- facets.minInclusive = "1" ;
- XSSimpleTypeDecl positiveIntegerDV = new XSSimpleTypeDecl(nonNegativeDV, POSITIVEINTEGER , URI_SCHEMAFORSCHEMA, (short)0, false, null, XSConstants.POSITIVEINTEGER_DT);
- positiveIntegerDV.applyFacets1(facets, XSSimpleType.FACET_MININCLUSIVE, (short)0 );
- types.put(POSITIVEINTEGER, positiveIntegerDV);
- }//createBuiltInTypes(SymbolHash)
-
-}//BaseDVFactory
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/BaseSchemaDVFactory.java b/src/com/sun/org/apache/xerces/internal/impl/dv/xs/BaseSchemaDVFactory.java
deleted file mode 100644
index da30a8f..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/BaseSchemaDVFactory.java
+++ /dev/null
@@ -1,329 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.xs;
-
-import com.sun.org.apache.xerces.internal.impl.dv.SchemaDVFactory;
-import com.sun.org.apache.xerces.internal.impl.dv.XSFacets;
-import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType;
-import com.sun.org.apache.xerces.internal.impl.xs.XSDeclarationPool;
-import com.sun.org.apache.xerces.internal.util.SymbolHash;
-import com.sun.org.apache.xerces.internal.xs.XSConstants;
-import com.sun.org.apache.xerces.internal.xs.XSObjectList;
-
-/**
- * the base factory to create/return built-in schema DVs and create user-defined DVs
- *
- * @xerces.internal
- *
- * @author Neeraj Bajaj, Sun Microsystems, inc.
- * @author Sandy Gao, IBM
- * @author Khaled Noaman, IBM
- *
- * @version $Id: BaseSchemaDVFactory.java,v 1.2 2010-10-26 23:01:03 joehw Exp $
- */
-public abstract class BaseSchemaDVFactory extends SchemaDVFactory {
-
- static final String URI_SCHEMAFORSCHEMA = "http://www.w3.org/2001/XMLSchema";
-
- protected XSDeclarationPool fDeclPool = null;
-
- // create common built-in types
- protected static void createBuiltInTypes(SymbolHash builtInTypes, XSSimpleTypeDecl baseAtomicType) {
- // all schema simple type names
- final String ANYSIMPLETYPE = "anySimpleType";
- final String ANYURI = "anyURI";
- final String BASE64BINARY = "base64Binary";
- final String BOOLEAN = "boolean";
- final String BYTE = "byte";
- final String DATE = "date";
- final String DATETIME = "dateTime";
- final String DAY = "gDay";
- final String DECIMAL = "decimal";
- final String DOUBLE = "double";
- final String DURATION = "duration";
- final String ENTITY = "ENTITY";
- final String ENTITIES = "ENTITIES";
- final String FLOAT = "float";
- final String HEXBINARY = "hexBinary";
- final String ID = "ID";
- final String IDREF = "IDREF";
- final String IDREFS = "IDREFS";
- final String INT = "int";
- final String INTEGER = "integer";
- final String LONG = "long";
- final String NAME = "Name";
- final String NEGATIVEINTEGER = "negativeInteger";
- final String MONTH = "gMonth";
- final String MONTHDAY = "gMonthDay";
- final String NCNAME = "NCName";
- final String NMTOKEN = "NMTOKEN";
- final String NMTOKENS = "NMTOKENS";
- final String LANGUAGE = "language";
- final String NONNEGATIVEINTEGER= "nonNegativeInteger";
- final String NONPOSITIVEINTEGER= "nonPositiveInteger";
- final String NORMALIZEDSTRING = "normalizedString";
- final String NOTATION = "NOTATION";
- final String POSITIVEINTEGER = "positiveInteger";
- final String QNAME = "QName";
- final String SHORT = "short";
- final String STRING = "string";
- final String TIME = "time";
- final String TOKEN = "token";
- final String UNSIGNEDBYTE = "unsignedByte";
- final String UNSIGNEDINT = "unsignedInt";
- final String UNSIGNEDLONG = "unsignedLong";
- final String UNSIGNEDSHORT = "unsignedShort";
- final String YEAR = "gYear";
- final String YEARMONTH = "gYearMonth";
-
- final XSFacets facets = new XSFacets();
-
- builtInTypes.put(ANYSIMPLETYPE, XSSimpleTypeDecl.fAnySimpleType);
-
- XSSimpleTypeDecl stringDV = new XSSimpleTypeDecl(baseAtomicType, STRING, XSSimpleTypeDecl.DV_STRING, XSSimpleType.ORDERED_FALSE, false, false, false , true, XSConstants.STRING_DT);
- builtInTypes.put(STRING, stringDV);
- builtInTypes.put(BOOLEAN, new XSSimpleTypeDecl(baseAtomicType, BOOLEAN, XSSimpleTypeDecl.DV_BOOLEAN, XSSimpleType.ORDERED_FALSE, false, true, false, true, XSConstants.BOOLEAN_DT));
- XSSimpleTypeDecl decimalDV = new XSSimpleTypeDecl(baseAtomicType, DECIMAL, XSSimpleTypeDecl.DV_DECIMAL, XSSimpleType.ORDERED_TOTAL, false, false, true, true, XSConstants.DECIMAL_DT);
- builtInTypes.put(DECIMAL, decimalDV);
-
- builtInTypes.put(ANYURI, new XSSimpleTypeDecl(baseAtomicType, ANYURI, XSSimpleTypeDecl.DV_ANYURI, XSSimpleType.ORDERED_FALSE, false, false, false, true, XSConstants.ANYURI_DT));
- builtInTypes.put(BASE64BINARY, new XSSimpleTypeDecl(baseAtomicType, BASE64BINARY, XSSimpleTypeDecl.DV_BASE64BINARY, XSSimpleType.ORDERED_FALSE, false, false, false, true, XSConstants.BASE64BINARY_DT));
-
- XSSimpleTypeDecl durationDV = new XSSimpleTypeDecl(baseAtomicType, DURATION, XSSimpleTypeDecl.DV_DURATION, XSSimpleType.ORDERED_PARTIAL, false, false, false, true, XSConstants.DURATION_DT);
- builtInTypes.put(DURATION, durationDV);
-
- builtInTypes.put(DATETIME, new XSSimpleTypeDecl(baseAtomicType, DATETIME, XSSimpleTypeDecl.DV_DATETIME, XSSimpleType.ORDERED_PARTIAL, false, false, false, true, XSConstants.DATETIME_DT));
- builtInTypes.put(TIME, new XSSimpleTypeDecl(baseAtomicType, TIME, XSSimpleTypeDecl.DV_TIME, XSSimpleType.ORDERED_PARTIAL, false, false, false, true, XSConstants.TIME_DT));
- builtInTypes.put(DATE, new XSSimpleTypeDecl(baseAtomicType, DATE, XSSimpleTypeDecl.DV_DATE, XSSimpleType.ORDERED_PARTIAL, false, false, false, true, XSConstants.DATE_DT));
- builtInTypes.put(YEARMONTH, new XSSimpleTypeDecl(baseAtomicType, YEARMONTH, XSSimpleTypeDecl.DV_GYEARMONTH, XSSimpleType.ORDERED_PARTIAL, false, false, false, true, XSConstants.GYEARMONTH_DT));
- builtInTypes.put(YEAR, new XSSimpleTypeDecl(baseAtomicType, YEAR, XSSimpleTypeDecl.DV_GYEAR, XSSimpleType.ORDERED_PARTIAL, false, false, false, true, XSConstants.GYEAR_DT));
- builtInTypes.put(MONTHDAY, new XSSimpleTypeDecl(baseAtomicType, MONTHDAY, XSSimpleTypeDecl.DV_GMONTHDAY, XSSimpleType.ORDERED_PARTIAL, false, false, false, true, XSConstants.GMONTHDAY_DT));
- builtInTypes.put(DAY, new XSSimpleTypeDecl(baseAtomicType, DAY, XSSimpleTypeDecl.DV_GDAY, XSSimpleType.ORDERED_PARTIAL, false, false, false, true, XSConstants.GDAY_DT));
- builtInTypes.put(MONTH, new XSSimpleTypeDecl(baseAtomicType, MONTH, XSSimpleTypeDecl.DV_GMONTH, XSSimpleType.ORDERED_PARTIAL, false, false, false, true, XSConstants.GMONTH_DT));
-
- XSSimpleTypeDecl integerDV = new XSSimpleTypeDecl(decimalDV, INTEGER, XSSimpleTypeDecl.DV_INTEGER, XSSimpleType.ORDERED_TOTAL, false, false, true, true, XSConstants.INTEGER_DT);
- builtInTypes.put(INTEGER, integerDV);
-
- facets.maxInclusive = "0";
- XSSimpleTypeDecl nonPositiveDV = new XSSimpleTypeDecl(integerDV, NONPOSITIVEINTEGER, URI_SCHEMAFORSCHEMA, (short)0, false, null, XSConstants.NONPOSITIVEINTEGER_DT);
- nonPositiveDV.applyFacets1(facets , XSSimpleType.FACET_MAXINCLUSIVE, (short)0);
- builtInTypes.put(NONPOSITIVEINTEGER, nonPositiveDV);
-
- facets.maxInclusive = "-1";
- XSSimpleTypeDecl negativeDV = new XSSimpleTypeDecl(nonPositiveDV, NEGATIVEINTEGER, URI_SCHEMAFORSCHEMA, (short)0, false, null, XSConstants.NEGATIVEINTEGER_DT);
- negativeDV.applyFacets1(facets , XSSimpleType.FACET_MAXINCLUSIVE, (short)0);
- builtInTypes.put(NEGATIVEINTEGER, negativeDV);
-
- facets.maxInclusive = "9223372036854775807";
- facets.minInclusive = "-9223372036854775808";
- XSSimpleTypeDecl longDV = new XSSimpleTypeDecl(integerDV, LONG, URI_SCHEMAFORSCHEMA, (short)0, false, null, XSConstants.LONG_DT);
- longDV.applyFacets1(facets , (short)(XSSimpleType.FACET_MAXINCLUSIVE | XSSimpleType.FACET_MININCLUSIVE), (short)0 );
- builtInTypes.put(LONG, longDV);
-
- facets.maxInclusive = "2147483647";
- facets.minInclusive = "-2147483648";
- XSSimpleTypeDecl intDV = new XSSimpleTypeDecl(longDV, INT, URI_SCHEMAFORSCHEMA, (short)0, false, null, XSConstants.INT_DT);
- intDV.applyFacets1(facets, (short)(XSSimpleType.FACET_MAXINCLUSIVE | XSSimpleType.FACET_MININCLUSIVE), (short)0 );
- builtInTypes.put(INT, intDV);
-
- facets.maxInclusive = "32767";
- facets.minInclusive = "-32768";
- XSSimpleTypeDecl shortDV = new XSSimpleTypeDecl(intDV, SHORT , URI_SCHEMAFORSCHEMA, (short)0, false, null, XSConstants.SHORT_DT);
- shortDV.applyFacets1(facets, (short)(XSSimpleType.FACET_MAXINCLUSIVE | XSSimpleType.FACET_MININCLUSIVE), (short)0 );
- builtInTypes.put(SHORT, shortDV);
-
- facets.maxInclusive = "127";
- facets.minInclusive = "-128";
- XSSimpleTypeDecl byteDV = new XSSimpleTypeDecl(shortDV, BYTE , URI_SCHEMAFORSCHEMA, (short)0, false, null, XSConstants.BYTE_DT);
- byteDV.applyFacets1(facets, (short)(XSSimpleType.FACET_MAXINCLUSIVE | XSSimpleType.FACET_MININCLUSIVE), (short)0 );
- builtInTypes.put(BYTE, byteDV);
-
- facets.minInclusive = "0" ;
- XSSimpleTypeDecl nonNegativeDV = new XSSimpleTypeDecl(integerDV, NONNEGATIVEINTEGER , URI_SCHEMAFORSCHEMA, (short)0, false, null, XSConstants.NONNEGATIVEINTEGER_DT);
- nonNegativeDV.applyFacets1(facets, XSSimpleType.FACET_MININCLUSIVE, (short)0 );
- builtInTypes.put(NONNEGATIVEINTEGER, nonNegativeDV);
-
- facets.maxInclusive = "18446744073709551615" ;
- XSSimpleTypeDecl unsignedLongDV = new XSSimpleTypeDecl(nonNegativeDV, UNSIGNEDLONG , URI_SCHEMAFORSCHEMA, (short)0, false, null, XSConstants.UNSIGNEDLONG_DT);
- unsignedLongDV.applyFacets1(facets, XSSimpleType.FACET_MAXINCLUSIVE, (short)0 );
- builtInTypes.put(UNSIGNEDLONG, unsignedLongDV);
-
- facets.maxInclusive = "4294967295" ;
- XSSimpleTypeDecl unsignedIntDV = new XSSimpleTypeDecl(unsignedLongDV, UNSIGNEDINT , URI_SCHEMAFORSCHEMA, (short)0, false, null, XSConstants.UNSIGNEDINT_DT);
- unsignedIntDV.applyFacets1(facets, XSSimpleType.FACET_MAXINCLUSIVE, (short)0 );
- builtInTypes.put(UNSIGNEDINT, unsignedIntDV);
-
- facets.maxInclusive = "65535" ;
- XSSimpleTypeDecl unsignedShortDV = new XSSimpleTypeDecl(unsignedIntDV, UNSIGNEDSHORT , URI_SCHEMAFORSCHEMA, (short)0, false, null, XSConstants.UNSIGNEDSHORT_DT);
- unsignedShortDV.applyFacets1(facets, XSSimpleType.FACET_MAXINCLUSIVE, (short)0 );
- builtInTypes.put(UNSIGNEDSHORT, unsignedShortDV);
-
- facets.maxInclusive = "255" ;
- XSSimpleTypeDecl unsignedByteDV = new XSSimpleTypeDecl(unsignedShortDV, UNSIGNEDBYTE , URI_SCHEMAFORSCHEMA, (short)0, false, null, XSConstants.UNSIGNEDBYTE_DT);
- unsignedByteDV.applyFacets1(facets, XSSimpleType.FACET_MAXINCLUSIVE, (short)0 );
- builtInTypes.put(UNSIGNEDBYTE, unsignedByteDV);
-
- facets.minInclusive = "1" ;
- XSSimpleTypeDecl positiveIntegerDV = new XSSimpleTypeDecl(nonNegativeDV, POSITIVEINTEGER , URI_SCHEMAFORSCHEMA, (short)0, false, null, XSConstants.POSITIVEINTEGER_DT);
- positiveIntegerDV.applyFacets1(facets, XSSimpleType.FACET_MININCLUSIVE, (short)0 );
- builtInTypes.put(POSITIVEINTEGER, positiveIntegerDV);
-
- builtInTypes.put(FLOAT, new XSSimpleTypeDecl(baseAtomicType, FLOAT, XSSimpleTypeDecl.DV_FLOAT, XSSimpleType.ORDERED_PARTIAL, true, true, true, true, XSConstants.FLOAT_DT));
- builtInTypes.put(DOUBLE, new XSSimpleTypeDecl(baseAtomicType, DOUBLE, XSSimpleTypeDecl.DV_DOUBLE, XSSimpleType.ORDERED_PARTIAL, true, true, true, true, XSConstants.DOUBLE_DT));
- builtInTypes.put(HEXBINARY, new XSSimpleTypeDecl(baseAtomicType, HEXBINARY, XSSimpleTypeDecl.DV_HEXBINARY, XSSimpleType.ORDERED_FALSE, false, false, false, true, XSConstants.HEXBINARY_DT));
- builtInTypes.put(NOTATION, new XSSimpleTypeDecl(baseAtomicType, NOTATION, XSSimpleTypeDecl.DV_NOTATION, XSSimpleType.ORDERED_FALSE, false, false, false, true, XSConstants.NOTATION_DT));
-
- facets.whiteSpace = XSSimpleType.WS_REPLACE;
- XSSimpleTypeDecl normalizedDV = new XSSimpleTypeDecl(stringDV, NORMALIZEDSTRING , URI_SCHEMAFORSCHEMA, (short)0, false, null, XSConstants.NORMALIZEDSTRING_DT);
- normalizedDV.applyFacets1(facets, XSSimpleType.FACET_WHITESPACE, (short)0 );
- builtInTypes.put(NORMALIZEDSTRING, normalizedDV);
-
- facets.whiteSpace = XSSimpleType.WS_COLLAPSE;
- XSSimpleTypeDecl tokenDV = new XSSimpleTypeDecl(normalizedDV, TOKEN , URI_SCHEMAFORSCHEMA, (short)0, false, null, XSConstants.TOKEN_DT);
- tokenDV.applyFacets1(facets, XSSimpleType.FACET_WHITESPACE, (short)0 );
- builtInTypes.put(TOKEN, tokenDV);
-
- facets.whiteSpace = XSSimpleType.WS_COLLAPSE;
- facets.pattern = "([a-zA-Z]{1,8})(-[a-zA-Z0-9]{1,8})*";
- XSSimpleTypeDecl languageDV = new XSSimpleTypeDecl(tokenDV, LANGUAGE , URI_SCHEMAFORSCHEMA, (short)0, false, null, XSConstants.LANGUAGE_DT);
- languageDV.applyFacets1(facets, (short)(XSSimpleType.FACET_WHITESPACE | XSSimpleType.FACET_PATTERN) ,(short)0);
- builtInTypes.put(LANGUAGE, languageDV);
-
- facets.whiteSpace = XSSimpleType.WS_COLLAPSE;
- XSSimpleTypeDecl nameDV = new XSSimpleTypeDecl(tokenDV, NAME , URI_SCHEMAFORSCHEMA, (short)0, false, null, XSConstants.NAME_DT);
- nameDV.applyFacets1(facets, XSSimpleType.FACET_WHITESPACE, (short)0, XSSimpleTypeDecl.SPECIAL_PATTERN_NAME);
- builtInTypes.put(NAME, nameDV);
-
- facets.whiteSpace = XSSimpleType.WS_COLLAPSE;
- XSSimpleTypeDecl ncnameDV = new XSSimpleTypeDecl(nameDV, NCNAME , URI_SCHEMAFORSCHEMA, (short)0, false, null, XSConstants.NCNAME_DT) ;
- ncnameDV.applyFacets1(facets, XSSimpleType.FACET_WHITESPACE, (short)0, XSSimpleTypeDecl.SPECIAL_PATTERN_NCNAME);
- builtInTypes.put(NCNAME, ncnameDV);
-
- builtInTypes.put(QNAME, new XSSimpleTypeDecl(baseAtomicType, QNAME, XSSimpleTypeDecl.DV_QNAME, XSSimpleType.ORDERED_FALSE, false, false, false, true, XSConstants.QNAME_DT));
-
- builtInTypes.put(ID, new XSSimpleTypeDecl(ncnameDV, ID, XSSimpleTypeDecl.DV_ID, XSSimpleType.ORDERED_FALSE, false, false, false , true, XSConstants.ID_DT));
- XSSimpleTypeDecl idrefDV = new XSSimpleTypeDecl(ncnameDV, IDREF , XSSimpleTypeDecl.DV_IDREF, XSSimpleType.ORDERED_FALSE, false, false, false, true, XSConstants.IDREF_DT);
- builtInTypes.put(IDREF, idrefDV);
-
- facets.minLength = 1;
- XSSimpleTypeDecl tempDV = new XSSimpleTypeDecl(null, URI_SCHEMAFORSCHEMA, (short)0, idrefDV, true, null);
- XSSimpleTypeDecl idrefsDV = new XSSimpleTypeDecl(tempDV, IDREFS, URI_SCHEMAFORSCHEMA, (short)0, false, null);
- idrefsDV.applyFacets1(facets, XSSimpleType.FACET_MINLENGTH, (short)0);
- builtInTypes.put(IDREFS, idrefsDV);
-
- XSSimpleTypeDecl entityDV = new XSSimpleTypeDecl(ncnameDV, ENTITY , XSSimpleTypeDecl.DV_ENTITY, XSSimpleType.ORDERED_FALSE, false, false, false, true, XSConstants.ENTITY_DT);
- builtInTypes.put(ENTITY, entityDV);
-
- facets.minLength = 1;
- tempDV = new XSSimpleTypeDecl(null, URI_SCHEMAFORSCHEMA, (short)0, entityDV, true, null);
- XSSimpleTypeDecl entitiesDV = new XSSimpleTypeDecl(tempDV, ENTITIES, URI_SCHEMAFORSCHEMA, (short)0, false, null);
- entitiesDV.applyFacets1(facets, XSSimpleType.FACET_MINLENGTH, (short)0);
- builtInTypes.put(ENTITIES, entitiesDV);
-
- facets.whiteSpace = XSSimpleType.WS_COLLAPSE;
- XSSimpleTypeDecl nmtokenDV = new XSSimpleTypeDecl(tokenDV, NMTOKEN, URI_SCHEMAFORSCHEMA, (short)0, false, null, XSConstants.NMTOKEN_DT);
- nmtokenDV.applyFacets1(facets, XSSimpleType.FACET_WHITESPACE, (short)0, XSSimpleTypeDecl.SPECIAL_PATTERN_NMTOKEN);
- builtInTypes.put(NMTOKEN, nmtokenDV);
-
- facets.minLength = 1;
- tempDV = new XSSimpleTypeDecl(null, URI_SCHEMAFORSCHEMA, (short)0, nmtokenDV, true, null);
- XSSimpleTypeDecl nmtokensDV = new XSSimpleTypeDecl(tempDV, NMTOKENS, URI_SCHEMAFORSCHEMA, (short)0, false, null);
- nmtokensDV.applyFacets1(facets, XSSimpleType.FACET_MINLENGTH, (short)0);
- builtInTypes.put(NMTOKENS, nmtokensDV);
- } //createBuiltInTypes()
-
- /**
- * Create a new simple type which is derived by restriction from another
- * simple type.
- *
- * @param name name of the new type, could be null
- * @param targetNamespace target namespace of the new type, could be null
- * @param finalSet value of "final"
- * @param base base type of the new type
- * @param annotations set of annotations
- * @return the newly created simple type
- */
- public XSSimpleType createTypeRestriction(String name, String targetNamespace,
- short finalSet, XSSimpleType base, XSObjectList annotations) {
-
- if (fDeclPool != null) {
- XSSimpleTypeDecl st= fDeclPool.getSimpleTypeDecl();
- return st.setRestrictionValues((XSSimpleTypeDecl)base, name, targetNamespace, finalSet, annotations);
- }
- return new XSSimpleTypeDecl((XSSimpleTypeDecl)base, name, targetNamespace, finalSet, false, annotations);
- }
-
- /**
- * Create a new simple type which is derived by list from another simple
- * type.
- *
- * @param name name of the new type, could be null
- * @param targetNamespace target namespace of the new type, could be null
- * @param finalSet value of "final"
- * @param itemType item type of the list type
- * @param annotations set of annotations
- * @return the newly created simple type
- */
- public XSSimpleType createTypeList(String name, String targetNamespace,
- short finalSet, XSSimpleType itemType,
- XSObjectList annotations) {
- if (fDeclPool != null) {
- XSSimpleTypeDecl st= fDeclPool.getSimpleTypeDecl();
- return st.setListValues(name, targetNamespace, finalSet, (XSSimpleTypeDecl)itemType, annotations);
- }
- return new XSSimpleTypeDecl(name, targetNamespace, finalSet, (XSSimpleTypeDecl)itemType, false, annotations);
- }
-
- /**
- * Create a new simple type which is derived by union from a list of other
- * simple types.
- *
- * @param name name of the new type, could be null
- * @param targetNamespace target namespace of the new type, could be null
- * @param finalSet value of "final"
- * @param memberTypes member types of the union type
- * @param annotations set of annotations
- * @return the newly created simple type
- */
- public XSSimpleType createTypeUnion(String name, String targetNamespace,
- short finalSet, XSSimpleType[] memberTypes,
- XSObjectList annotations) {
- int typeNum = memberTypes.length;
- XSSimpleTypeDecl[] mtypes = new XSSimpleTypeDecl[typeNum];
- System.arraycopy(memberTypes, 0, mtypes, 0, typeNum);
-
- if (fDeclPool != null) {
- XSSimpleTypeDecl st= fDeclPool.getSimpleTypeDecl();
- return st.setUnionValues(name, targetNamespace, finalSet, mtypes, annotations);
- }
- return new XSSimpleTypeDecl(name, targetNamespace, finalSet, mtypes, annotations);
- }
-
- public void setDeclPool (XSDeclarationPool declPool){
- fDeclPool = declPool;
- }
-
- /** Implementation internal **/
- public XSSimpleTypeDecl newXSSimpleTypeDecl() {
- return new XSSimpleTypeDecl();
- }
-} //BaseSchemaDVFactory
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/BooleanDV.java b/src/com/sun/org/apache/xerces/internal/impl/dv/xs/BooleanDV.java
deleted file mode 100644
index 90857ef..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/BooleanDV.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.xs;
-
-import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException;
-import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
-
-/**
- * Represent the schema type "boolean"
- *
- * @xerces.internal
- *
- * @author Neeraj Bajaj, Sun Microsystems, inc.
- * @author Sandy Gao, IBM
- *
- */
-public class BooleanDV extends TypeValidator{
-
- private static final String fValueSpace[] = {"false", "true", "0", "1"};
-
- public short getAllowedFacets(){
- return (XSSimpleTypeDecl.FACET_PATTERN | XSSimpleTypeDecl.FACET_WHITESPACE);
- }
-
- public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException {
- Boolean ret = null;
-
- if (content.equals(fValueSpace[0]) || content.equals(fValueSpace[2]))
- ret = Boolean.FALSE;
- else if (content.equals(fValueSpace[1]) || content.equals(fValueSpace[3]))
- ret = Boolean.TRUE;
- else
- throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "boolean"});
- return ret;
- }
-
-} // class BooleanDV
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DateDV.java b/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DateDV.java
deleted file mode 100644
index 01b0eab..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DateDV.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.xs;
-
-import javax.xml.datatype.DatatypeConstants;
-import javax.xml.datatype.XMLGregorianCalendar;
-
-import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException;
-import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
-
-/**
- * Validator for <date> datatype (W3C Schema datatypes)
- *
- * @xerces.internal
- *
- * @author Elena Litani
- * @author Gopal Sharma, SUN Microsystems Inc.
- *
- * @version $Id: DateDV.java,v 1.7 2010-11-01 04:39:46 joehw Exp $
- */
-public class DateDV extends DateTimeDV {
-
- public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException {
- try{
- return parse(content);
- } catch(Exception ex){
- throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "date"});
- }
- }
-
- /**
- * Parses, validates and computes normalized version of dateTime object
- *
- * @param str The lexical representation of dateTime object CCYY-MM-DD
- * with possible time zone Z or (-),(+)hh:mm
- * @return normalized dateTime representation
- * @exception SchemaDateTimeException Invalid lexical representation
- */
- protected DateTimeData parse(String str) throws SchemaDateTimeException {
- DateTimeData date = new DateTimeData(str, this);
- int len = str.length();
-
- int end = getDate(str, 0, len, date);
- parseTimeZone (str, end, len, date);
-
- //validate and normalize
- //REVISIT: do we need SchemaDateTimeException?
- validateDateTime(date);
-
- //save unnormalized values
- saveUnnormalized(date);
-
- if (date.utc!=0 && date.utc!='Z') {
- normalize(date);
- }
- return date;
- }
-
- protected String dateToString(DateTimeData date) {
- StringBuffer message = new StringBuffer(25);
- append(message, date.year, 4);
- message.append('-');
- append(message, date.month, 2);
- message.append('-');
- append(message, date.day, 2);
- append(message, (char)date.utc, 0);
- return message.toString();
- }
-
- protected XMLGregorianCalendar getXMLGregorianCalendar(DateTimeData date) {
- return datatypeFactory.newXMLGregorianCalendar(date.unNormYear, date.unNormMonth,
- date.unNormDay, DatatypeConstants.FIELD_UNDEFINED, DatatypeConstants.FIELD_UNDEFINED,
- DatatypeConstants.FIELD_UNDEFINED, DatatypeConstants.FIELD_UNDEFINED,
- date.hasTimeZone() ? (date.timezoneHr * 60 + date.timezoneMin) : DatatypeConstants.FIELD_UNDEFINED);
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DateTimeDV.java b/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DateTimeDV.java
deleted file mode 100644
index 6b2011d..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DateTimeDV.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.xs;
-
-import java.math.BigInteger;
-
-import javax.xml.datatype.DatatypeConstants;
-import javax.xml.datatype.XMLGregorianCalendar;
-
-import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException;
-import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
-
-/**
- * Validator for &lt;dateTime&gt; datatype (W3C Schema Datatypes)
- *
- * @xerces.internal
- *
- * @author Elena Litani
- * @author Gopal Sharma, SUN Microsystem Inc.
- *
- * @version $Id: DateTimeDV.java,v 1.7 2010-11-01 04:39:46 joehw Exp $
- */
-public class DateTimeDV extends AbstractDateTimeDV {
-
- public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException {
- try{
- return parse(content);
- } catch(Exception ex){
- throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "dateTime"});
- }
- }
-
- /**
- * Parses, validates and computes normalized version of dateTime object
- *
- * @param str The lexical representation of dateTime object CCYY-MM-DDThh:mm:ss.sss
- * with possible time zone Z or (-),(+)hh:mm
- * @return normalized dateTime representation
- * @exception SchemaDateTimeException Invalid lexical representation
- */
- protected DateTimeData parse(String str) throws SchemaDateTimeException {
- DateTimeData date = new DateTimeData(str, this);
- int len = str.length();
-
- int end = indexOf (str, 0, len, 'T');
-
- // both time and date
- int dateEnd = getDate(str, 0, end, date);
- getTime(str, end+1, len, date);
-
- //Check the separator character between Date and Time
- if (dateEnd != end) {
- throw new RuntimeException(str
- + " is an invalid dateTime dataype value. "
- + "Invalid character(s) seprating date and time values.");
- }
-
- //validate and normalize
-
- //REVISIT: do we need SchemaDateTimeException?
- validateDateTime(date);
-
- //save unnormalized values
- saveUnnormalized(date);
-
- if (date.utc!=0 && date.utc!='Z') {
- normalize(date);
- }
- return date;
- }
-
- protected XMLGregorianCalendar getXMLGregorianCalendar(DateTimeData date) {
- return datatypeFactory.newXMLGregorianCalendar(BigInteger.valueOf(date.unNormYear), date.unNormMonth,
- date.unNormDay, date.unNormHour, date.unNormMinute,
- (int)date.unNormSecond, date.unNormSecond != 0 ? getFractionalSecondsAsBigDecimal(date) : null,
- date.hasTimeZone() ? (date.timezoneHr * 60 + date.timezoneMin) : DatatypeConstants.FIELD_UNDEFINED);
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DayDV.java b/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DayDV.java
deleted file mode 100644
index 1e501f0..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DayDV.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.xs;
-
-import javax.xml.datatype.DatatypeConstants;
-import javax.xml.datatype.XMLGregorianCalendar;
-
-import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException;
-import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
-
-/**
- * Validator for &lt;gDay&gt; datatype (W3C Schema datatypes)
- *
- * @xerces.internal
- *
- * @author Elena Litani
- * @author Gopal Sharma, SUN Microsystem Inc.
- * @version $Id: DayDV.java,v 1.7 2010-11-01 04:39:46 joehw Exp $
- */
-public class DayDV extends AbstractDateTimeDV {
-
- //size without time zone: ---09
- private final static int DAY_SIZE=5;
-
- public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException {
- try{
- return parse(content);
- } catch(Exception ex){
- throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "gDay"});
- }
- }
-
- /**
- * Parses, validates and computes normalized version of gDay object
- *
- * @param str The lexical representation of gDay object ---DD
- * with possible time zone Z or (-),(+)hh:mm
- * Pattern: ---(\\d\\d)(Z|(([-+])(\\d\\d)(:(\\d\\d))?
- * @return normalized date representation
- * @exception SchemaDateTimeException Invalid lexical representation
- */
- protected DateTimeData parse(String str) throws SchemaDateTimeException {
- DateTimeData date = new DateTimeData(str, this);
- int len = str.length();
-
- if (str.charAt(0)!='-' || str.charAt(1)!='-' || str.charAt(2)!='-') {
- throw new SchemaDateTimeException ("Error in day parsing");
- }
-
- //initialize values
- date.year=YEAR;
- date.month=MONTH;
-
- date.day=parseInt(str, 3,5);
-
- if ( DAY_SIZE<len ) {
- if (!isNextCharUTCSign(str, DAY_SIZE, len)) {
- throw new SchemaDateTimeException ("Error in day parsing");
- }
- else {
- getTimeZone(str, date, DAY_SIZE, len);
- }
- }
-
- //validate and normalize
- validateDateTime(date);
-
- //save unnormalized values
- saveUnnormalized(date);
-
- if ( date.utc!=0 && date.utc!='Z' ) {
- normalize(date);
- }
- date.position = 2;
- return date;
- }
-
- /**
- * Converts gDay object representation to String
- *
- * @param date gDay object
- * @return lexical representation of gDay: ---DD with an optional time zone sign
- */
- protected String dateToString(DateTimeData date) {
- StringBuffer message = new StringBuffer(6);
- message.append('-');
- message.append('-');
- message.append('-');
- append(message, date.day, 2);
- append(message, (char)date.utc, 0);
- return message.toString();
- }
-
- protected XMLGregorianCalendar getXMLGregorianCalendar(DateTimeData date) {
- return datatypeFactory.newXMLGregorianCalendar(DatatypeConstants.FIELD_UNDEFINED, DatatypeConstants.FIELD_UNDEFINED,
- date.unNormDay, DatatypeConstants.FIELD_UNDEFINED, DatatypeConstants.FIELD_UNDEFINED,
- DatatypeConstants.FIELD_UNDEFINED, DatatypeConstants.FIELD_UNDEFINED,
- date.hasTimeZone() ? date.timezoneHr * 60 + date.timezoneMin : DatatypeConstants.FIELD_UNDEFINED);
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DayTimeDurationDV.java b/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DayTimeDurationDV.java
deleted file mode 100644
index dd16f19..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DayTimeDurationDV.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xerces.internal.impl.dv.xs;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-
-import javax.xml.datatype.DatatypeConstants;
-import javax.xml.datatype.Duration;
-
-import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException;
-import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
-
-/**
- * Used to validate the <dayTimeDuration> type
- *
- * @xerces.internal
- *
- * @author Ankit Pasricha, IBM
- *
- * @version $Id: DayTimeDurationDV.java,v 1.6 2010-11-01 04:39:46 joehw Exp $
- */
-class DayTimeDurationDV extends DurationDV {
-
- public Object getActualValue(String content, ValidationContext context)
- throws InvalidDatatypeValueException {
- try {
- return parse(content, DurationDV.DAYTIMEDURATION_TYPE);
- }
- catch (Exception ex) {
- throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "dayTimeDuration"});
- }
- }
-
- protected Duration getDuration(DateTimeData date) {
- int sign = 1;
- if (date.day<0 || date.hour<0 || date.minute<0 || date.second<0) {
- sign = -1;
- }
- return datatypeFactory.newDuration(sign == 1, null, null,
- date.day != DatatypeConstants.FIELD_UNDEFINED?BigInteger.valueOf(sign*date.day):null,
- date.hour != DatatypeConstants.FIELD_UNDEFINED?BigInteger.valueOf(sign*date.hour):null,
- date.minute != DatatypeConstants.FIELD_UNDEFINED?BigInteger.valueOf(sign*date.minute):null,
- date.second != DatatypeConstants.FIELD_UNDEFINED?new BigDecimal(String.valueOf(sign*date.second)):null);
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DecimalDV.java b/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DecimalDV.java
deleted file mode 100644
index 622042b..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DecimalDV.java
+++ /dev/null
@@ -1,392 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001,2002,2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.xs;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-
-import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException;
-import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
-import com.sun.org.apache.xerces.internal.xs.datatypes.XSDecimal;
-import java.util.Objects;
-
-/**
- * Represent the schema type "decimal"
- *
- * @xerces.internal
- *
- * @author Neeraj Bajaj, Sun Microsystems, inc.
- * @author Sandy Gao, IBM
- *
- */
-public class DecimalDV extends TypeValidator {
-
- @Override
- public final short getAllowedFacets(){
- return ( XSSimpleTypeDecl.FACET_PATTERN | XSSimpleTypeDecl.FACET_WHITESPACE | XSSimpleTypeDecl.FACET_ENUMERATION |XSSimpleTypeDecl.FACET_MAXINCLUSIVE |XSSimpleTypeDecl.FACET_MININCLUSIVE | XSSimpleTypeDecl.FACET_MAXEXCLUSIVE | XSSimpleTypeDecl.FACET_MINEXCLUSIVE | XSSimpleTypeDecl.FACET_TOTALDIGITS | XSSimpleTypeDecl.FACET_FRACTIONDIGITS);
- }
-
- @Override
- public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException {
- try {
- return new XDecimal(content);
- } catch (NumberFormatException nfe) {
- throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "decimal"});
- }
- }
-
- @Override
- public final int compare(Object value1, Object value2){
- return ((XDecimal)value1).compareTo((XDecimal)value2);
- }
-
- @Override
- public final int getTotalDigits(Object value){
- return ((XDecimal)value).totalDigits;
- }
-
- @Override
- public final int getFractionDigits(Object value){
- return ((XDecimal)value).fracDigits;
- }
-
- // Avoid using the heavy-weight java.math.BigDecimal
- static final class XDecimal implements XSDecimal {
- // sign: 0 for vlaue 0; 1 for positive values; -1 for negative values
- int sign = 1;
- // total digits. >= 1
- int totalDigits = 0;
- // integer digits when sign != 0
- int intDigits = 0;
- // fraction digits when sign != 0
- int fracDigits = 0;
- // the string representing the integer part
- String ivalue = "";
- // the string representing the fraction part
- String fvalue = "";
- // whether the canonical form contains decimal point
- boolean integer = false;
-
- XDecimal(String content) throws NumberFormatException {
- initD(content);
- }
- XDecimal(String content, boolean integer) throws NumberFormatException {
- if (integer)
- initI(content);
- else
- initD(content);
- }
- void initD(String content) throws NumberFormatException {
- int len = content.length();
- if (len == 0)
- throw new NumberFormatException();
-
- // these 4 variables are used to indicate where the integre/fraction
- // parts start/end.
- int intStart = 0, intEnd = 0, fracStart = 0, fracEnd = 0;
-
- // Deal with leading sign symbol if present
- if (content.charAt(0) == '+') {
- // skip '+', so intStart should be 1
- intStart = 1;
- }
- else if (content.charAt(0) == '-') {
- // keep '-', so intStart is stil 0
- intStart = 1;
- sign = -1;
- }
-
- // skip leading zeroes in integer part
- int actualIntStart = intStart;
- while (actualIntStart < len && content.charAt(actualIntStart) == '0') {
- actualIntStart++;
- }
-
- // Find the ending position of the integer part
- for (intEnd = actualIntStart;
- intEnd < len && TypeValidator.isDigit(content.charAt(intEnd));
- intEnd++);
-
- // Not reached the end yet
- if (intEnd < len) {
- // the remaining part is not ".DDD", error
- if (content.charAt(intEnd) != '.')
- throw new NumberFormatException();
-
- // fraction part starts after '.', and ends at the end of the input
- fracStart = intEnd + 1;
- fracEnd = len;
- }
-
- // no integer part, no fraction part, error.
- if (intStart == intEnd && fracStart == fracEnd)
- throw new NumberFormatException();
-
- // ignore trailing zeroes in fraction part
- while (fracEnd > fracStart && content.charAt(fracEnd-1) == '0') {
- fracEnd--;
- }
-
- // check whether there is non-digit characters in the fraction part
- for (int fracPos = fracStart; fracPos < fracEnd; fracPos++) {
- if (!TypeValidator.isDigit(content.charAt(fracPos)))
- throw new NumberFormatException();
- }
-
- intDigits = intEnd - actualIntStart;
- fracDigits = fracEnd - fracStart;
- totalDigits = intDigits + fracDigits;
-
- if (intDigits > 0) {
- ivalue = content.substring(actualIntStart, intEnd);
- if (fracDigits > 0)
- fvalue = content.substring(fracStart, fracEnd);
- }
- else {
- if (fracDigits > 0) {
- fvalue = content.substring(fracStart, fracEnd);
- }
- else {
- // ".00", treat it as "0"
- sign = 0;
- }
- }
- }
- void initI(String content) throws NumberFormatException {
- int len = content.length();
- if (len == 0)
- throw new NumberFormatException();
-
- // these 2 variables are used to indicate where the integre start/end.
- int intStart = 0, intEnd = 0;
-
- // Deal with leading sign symbol if present
- if (content.charAt(0) == '+') {
- // skip '+', so intStart should be 1
- intStart = 1;
- }
- else if (content.charAt(0) == '-') {
- // keep '-', so intStart is stil 0
- intStart = 1;
- sign = -1;
- }
-
- // skip leading zeroes in integer part
- int actualIntStart = intStart;
- while (actualIntStart < len && content.charAt(actualIntStart) == '0') {
- actualIntStart++;
- }
-
- // Find the ending position of the integer part
- for (intEnd = actualIntStart;
- intEnd < len && TypeValidator.isDigit(content.charAt(intEnd));
- intEnd++);
-
- // Not reached the end yet, error
- if (intEnd < len)
- throw new NumberFormatException();
-
- // no integer part, error.
- if (intStart == intEnd)
- throw new NumberFormatException();
-
- intDigits = intEnd - actualIntStart;
- fracDigits = 0;
- totalDigits = intDigits;
-
- if (intDigits > 0) {
- ivalue = content.substring(actualIntStart, intEnd);
- }
- else {
- // "00", treat it as "0"
- sign = 0;
- }
-
- integer = true;
- }
-
- @Override
- public boolean equals(Object val) {
- if (val == this)
- return true;
-
- if (!(val instanceof XDecimal))
- return false;
- XDecimal oval = (XDecimal)val;
-
- if (sign != oval.sign)
- return false;
- if (sign == 0)
- return true;
-
- return intDigits == oval.intDigits && fracDigits == oval.fracDigits &&
- ivalue.equals(oval.ivalue) && fvalue.equals(oval.fvalue);
- }
-
- @Override
- public int hashCode() {
- int hash = 7;
- hash = 17 * hash + this.sign;
- if (this.sign == 0) return hash;
- hash = 17 * hash + this.intDigits;
- hash = 17 * hash + this.fracDigits;
- hash = 17 * hash + Objects.hashCode(this.ivalue);
- hash = 17 * hash + Objects.hashCode(this.fvalue);
- return hash;
- }
-
- public int compareTo(XDecimal val) {
- if (sign != val.sign)
- return sign > val.sign ? 1 : -1;
- if (sign == 0)
- return 0;
- return sign * intComp(val);
- }
- private int intComp(XDecimal val) {
- if (intDigits != val.intDigits)
- return intDigits > val.intDigits ? 1 : -1;
- int ret = ivalue.compareTo(val.ivalue);
- if (ret != 0)
- return ret > 0 ? 1 : -1;;
- ret = fvalue.compareTo(val.fvalue);
- return ret == 0 ? 0 : (ret > 0 ? 1 : -1);
- }
-
- private String canonical;
- @Override
- public synchronized String toString() {
- if (canonical == null) {
- makeCanonical();
- }
- return canonical;
- }
-
- private void makeCanonical() {
- if (sign == 0) {
- if (integer)
- canonical = "0";
- else
- canonical = "0.0";
- return;
- }
- if (integer && sign > 0) {
- canonical = ivalue;
- return;
- }
- // for -0.1, total digits is 1, so we need 3 extra spots
- final StringBuilder buffer = new StringBuilder(totalDigits+3);
- if (sign == -1)
- buffer.append('-');
- if (intDigits != 0)
- buffer.append(ivalue);
- else
- buffer.append('0');
- if (!integer) {
- buffer.append('.');
- if (fracDigits != 0) {
- buffer.append(fvalue);
- }
- else {
- buffer.append('0');
- }
- }
- canonical = buffer.toString();
- }
-
- @Override
- public BigDecimal getBigDecimal() {
- if (sign == 0) {
- return new BigDecimal(BigInteger.ZERO);
- }
- return new BigDecimal(toString());
- }
-
- @Override
- public BigInteger getBigInteger() throws NumberFormatException {
- if (fracDigits != 0) {
- throw new NumberFormatException();
- }
- if (sign == 0) {
- return BigInteger.ZERO;
- }
- if (sign == 1) {
- return new BigInteger(ivalue);
- }
- return new BigInteger("-" + ivalue);
- }
-
- @Override
- public long getLong() throws NumberFormatException {
- if (fracDigits != 0) {
- throw new NumberFormatException();
- }
- if (sign == 0) {
- return 0L;
- }
- if (sign == 1) {
- return Long.parseLong(ivalue);
- }
- return Long.parseLong("-" + ivalue);
- }
-
- @Override
- public int getInt() throws NumberFormatException {
- if (fracDigits != 0) {
- throw new NumberFormatException();
- }
- if (sign == 0) {
- return 0;
- }
- if (sign == 1) {
- return Integer.parseInt(ivalue);
- }
- return Integer.parseInt("-" + ivalue);
- }
-
- @Override
- public short getShort() throws NumberFormatException {
- if (fracDigits != 0) {
- throw new NumberFormatException();
- }
- if (sign == 0) {
- return 0;
- }
- if (sign == 1) {
- return Short.parseShort(ivalue);
- }
- return Short.parseShort("-" + ivalue);
- }
-
- @Override
- public byte getByte() throws NumberFormatException {
- if (fracDigits != 0) {
- throw new NumberFormatException();
- }
- if (sign == 0) {
- return 0;
- }
- if (sign == 1) {
- return Byte.parseByte(ivalue);
- }
- return Byte.parseByte("-" + ivalue);
- }
- }
-} // class DecimalDV
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DoubleDV.java b/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DoubleDV.java
deleted file mode 100644
index e884d0d..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DoubleDV.java
+++ /dev/null
@@ -1,260 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.xs;
-
-import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException;
-import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
-import com.sun.org.apache.xerces.internal.xs.datatypes.XSDouble;
-
-/**
- * Represent the schema type "double"
- *
- * @xerces.internal
- *
- * @author Neeraj Bajaj, Sun Microsystems, inc.
- * @author Sandy Gao, IBM
- *
- * @version $Id: DoubleDV.java,v 1.7 2010-11-01 04:39:46 joehw Exp $
- */
-public class DoubleDV extends TypeValidator {
-
- public short getAllowedFacets(){
- return ( XSSimpleTypeDecl.FACET_PATTERN | XSSimpleTypeDecl.FACET_WHITESPACE | XSSimpleTypeDecl.FACET_ENUMERATION |XSSimpleTypeDecl.FACET_MAXINCLUSIVE |XSSimpleTypeDecl.FACET_MININCLUSIVE | XSSimpleTypeDecl.FACET_MAXEXCLUSIVE | XSSimpleTypeDecl.FACET_MINEXCLUSIVE );
- }//getAllowedFacets()
-
- //convert a String to Double form, we have to take care of cases specified in spec like INF, -INF and NaN
- public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException {
- try{
- return new XDouble(content);
- } catch (NumberFormatException ex){
- throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "double"});
- }
- }//getActualValue()
-
- // Can't call Double#compareTo method, because it's introduced in jdk 1.2
- public int compare(Object value1, Object value2) {
- return ((XDouble)value1).compareTo((XDouble)value2);
- }//compare()
-
- //distinguishes between identity and equality for double datatype
- //0.0 is equal but not identical to -0.0
- public boolean isIdentical (Object value1, Object value2) {
- if (value2 instanceof XDouble) {
- return ((XDouble)value1).isIdentical((XDouble)value2);
- }
- return false;
- }//isIdentical()
-
- /**
- * Returns true if it's possible that the given
- * string represents a valid floating point value
- * (excluding NaN, INF and -INF).
- */
- static boolean isPossibleFP(String val) {
- final int length = val.length();
- for (int i = 0; i < length; ++i) {
- char c = val.charAt(i);
- if (!(c >= '0' && c <= '9' || c == '.' ||
- c == '-' || c == '+' || c == 'E' || c == 'e')) {
- return false;
- }
- }
- return true;
- }
-
- private static final class XDouble implements XSDouble {
- private final double value;
- public XDouble(String s) throws NumberFormatException {
- if (isPossibleFP(s)) {
- value = Double.parseDouble(s);
- }
- else if ( s.equals("INF") ) {
- value = Double.POSITIVE_INFINITY;
- }
- else if ( s.equals("-INF") ) {
- value = Double.NEGATIVE_INFINITY;
- }
- else if ( s.equals("NaN" ) ) {
- value = Double.NaN;
- }
- else {
- throw new NumberFormatException(s);
- }
- }
-
- public boolean equals(Object val) {
- if (val == this)
- return true;
-
- if (!(val instanceof XDouble))
- return false;
- XDouble oval = (XDouble)val;
-
- // NOTE: we don't distinguish 0.0 from -0.0
- if (value == oval.value)
- return true;
-
- if (value != value && oval.value != oval.value)
- return true;
-
- return false;
- }
-
- public int hashCode() {
- // This check is necessary because doubleToLongBits(+0) != doubleToLongBits(-0)
- if (value == 0d) {
- return 0;
- }
- long v = Double.doubleToLongBits(value);
- return (int) (v ^ (v >>> 32));
- }
-
- // NOTE: 0.0 is equal but not identical to -0.0
- public boolean isIdentical (XDouble val) {
- if (val == this) {
- return true;
- }
-
- if (value == val.value) {
- return (value != 0.0d ||
- (Double.doubleToLongBits(value) == Double.doubleToLongBits(val.value)));
- }
-
- if (value != value && val.value != val.value)
- return true;
-
- return false;
- }
-
- private int compareTo(XDouble val) {
- double oval = val.value;
-
- // this < other
- if (value < oval)
- return -1;
- // this > other
- if (value > oval)
- return 1;
- // this == other
- // NOTE: we don't distinguish 0.0 from -0.0
- if (value == oval)
- return 0;
-
- // one of the 2 values or both is/are NaN(s)
-
- if (value != value) {
- // this = NaN = other
- if (oval != oval)
- return 0;
- // this is NaN <> other
- return INDETERMINATE;
- }
-
- // other is NaN <> this
- return INDETERMINATE;
- }
-
- private String canonical;
- public synchronized String toString() {
- if (canonical == null) {
- if (value == Double.POSITIVE_INFINITY)
- canonical = "INF";
- else if (value == Double.NEGATIVE_INFINITY)
- canonical = "-INF";
- else if (value != value)
- canonical = "NaN";
- // NOTE: we don't distinguish 0.0 from -0.0
- else if (value == 0)
- canonical = "0.0E1";
- else {
- // REVISIT: use the java algorithm for now, because we
- // don't know what to output for 1.1d (which is no
- // actually 1.1)
- canonical = Double.toString(value);
- // if it contains 'E', then it should be a valid schema
- // canonical representation
- if (canonical.indexOf('E') == -1) {
- int len = canonical.length();
- // at most 3 longer: E, -, 9
- char[] chars = new char[len+3];
- canonical.getChars(0, len, chars, 0);
- // expected decimal point position
- int edp = chars[0] == '-' ? 2 : 1;
- // for non-zero integer part
- if (value >= 1 || value <= -1) {
- // decimal point position
- int dp = canonical.indexOf('.');
- // move the digits: ddd.d --> d.ddd
- for (int i = dp; i > edp; i--) {
- chars[i] = chars[i-1];
- }
- chars[edp] = '.';
- // trim trailing zeros: d00.0 --> d.000 --> d.
- while (chars[len-1] == '0')
- len--;
- // add the last zero if necessary: d. --> d.0
- if (chars[len-1] == '.')
- len++;
- // append E: d.dd --> d.ddE
- chars[len++] = 'E';
- // how far we shifted the decimal point
- int shift = dp - edp;
- // append the exponent --> d.ddEd
- // the exponent is at most 7
- chars[len++] = (char)(shift + '0');
- }
- else {
- // non-zero digit point
- int nzp = edp + 1;
- // skip zeros: 0.003
- while (chars[nzp] == '0')
- nzp++;
- // put the first non-zero digit to the left of '.'
- chars[edp-1] = chars[nzp];
- chars[edp] = '.';
- // move other digits (non-zero) to the right of '.'
- for (int i = nzp+1, j = edp+1; i < len; i++, j++)
- chars[j] = chars[i];
- // adjust the length
- len -= nzp - edp;
- // append 0 if nessary: 0.03 --> 3. --> 3.0
- if (len == edp + 1)
- chars[len++] = '0';
- // append E-: d.dd --> d.ddE-
- chars[len++] = 'E';
- chars[len++] = '-';
- // how far we shifted the decimal point
- int shift = nzp - edp;
- // append the exponent --> d.ddEd
- // the exponent is at most 3
- chars[len++] = (char)(shift + '0');
- }
- canonical = new String(chars, 0, len);
- }
- }
- }
- return canonical;
- }
- public double getValue() {
- return value;
- }
- }
-} // class DoubleDV
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DurationDV.java b/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DurationDV.java
deleted file mode 100644
index 1ec86d0..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DurationDV.java
+++ /dev/null
@@ -1,390 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.xs;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-
-import javax.xml.datatype.DatatypeConstants;
-import javax.xml.datatype.Duration;
-
-import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException;
-import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
-
-/**
- * Validator for &lt;duration&gt; datatype (W3C Schema Datatypes)
- *
- * @xerces.internal
- *
- * @author Elena Litani
- * @author Gopal Sharma, SUN Microsystem Inc.
- * @version $Id: DurationDV.java,v 1.7 2010-11-01 04:39:47 joehw Exp $
- */
-public class DurationDV extends AbstractDateTimeDV {
-
- public static final int DURATION_TYPE = 0;
- public static final int YEARMONTHDURATION_TYPE = 1;
- public static final int DAYTIMEDURATION_TYPE = 2;
- // order-relation on duration is a partial order. The dates below are used to
- // for comparison of 2 durations, based on the fact that
- // duration x and y is x<=y iff s+x<=s+y
- // see 3.2.6 duration W3C schema datatype specs
- //
- // the dates are in format: {CCYY,MM,DD, H, S, M, MS, timezone}
- private final static DateTimeData[] DATETIMES= {
- new DateTimeData(1696, 9, 1, 0, 0, 0, 'Z', null, true, null),
- new DateTimeData(1697, 2, 1, 0, 0, 0, 'Z', null, true, null),
- new DateTimeData(1903, 3, 1, 0, 0, 0, 'Z', null, true, null),
- new DateTimeData(1903, 7, 1, 0, 0, 0, 'Z', null, true, null)};
-
- public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException{
- try{
- return parse(content, DURATION_TYPE);
- } catch (Exception ex) {
- throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "duration"});
- }
- }
-
- /**
- * Parses, validates and computes normalized version of duration object
- *
- * @param str The lexical representation of duration object PnYn MnDTnH nMnS
- * @param durationType
- * @return normalized date representation
- * @exception SchemaDateTimeException Invalid lexical representation
- */
- protected DateTimeData parse(String str, int durationType) throws SchemaDateTimeException{
- int len = str.length();
- DateTimeData date= new DateTimeData(str, this);
-
- int start = 0;
- char c=str.charAt(start++);
- if ( c!='P' && c!='-' ) {
- throw new SchemaDateTimeException();
- }
- else {
- date.utc=(c=='-')?'-':0;
- if ( c=='-' && str.charAt(start++)!='P' ) {
- throw new SchemaDateTimeException();
- }
- }
-
- int negate = 1;
- //negative duration
- if ( date.utc=='-' ) {
- negate = -1;
-
- }
- //at least one number and designator must be seen after P
- boolean designator = false;
-
- int endDate = indexOf (str, start, len, 'T');
- if ( endDate == -1 ) {
- endDate = len;
- }
- else if (durationType == YEARMONTHDURATION_TYPE) {
- throw new SchemaDateTimeException();
- }
-
- //find 'Y'
- int end = indexOf (str, start, endDate, 'Y');
- if ( end!=-1 ) {
-
- if (durationType == DAYTIMEDURATION_TYPE) {
- throw new SchemaDateTimeException();
- }
-
- //scan year
- date.year=negate * parseInt(str,start,end);
- start = end+1;
- designator = true;
- }
-
- end = indexOf (str, start, endDate, 'M');
- if ( end!=-1 ) {
-
- if (durationType == DAYTIMEDURATION_TYPE) {
- throw new SchemaDateTimeException();
- }
-
- //scan month
- date.month=negate * parseInt(str,start,end);
- start = end+1;
- designator = true;
- }
-
- end = indexOf (str, start, endDate, 'D');
- if ( end!=-1 ) {
-
- if(durationType == YEARMONTHDURATION_TYPE) {
- throw new SchemaDateTimeException();
- }
-
- //scan day
- date.day=negate * parseInt(str,start,end);
- start = end+1;
- designator = true;
- }
-
- if ( len == endDate && start!=len ) {
- throw new SchemaDateTimeException();
- }
- if ( len !=endDate ) {
-
- //scan hours, minutes, seconds
- //REVISIT: can any item include a decimal fraction or only seconds?
- //
-
- end = indexOf (str, ++start, len, 'H');
- if ( end!=-1 ) {
- //scan hours
- date.hour=negate * parseInt(str,start,end);
- start=end+1;
- designator = true;
- }
-
- end = indexOf (str, start, len, 'M');
- if ( end!=-1 ) {
- //scan min
- date.minute=negate * parseInt(str,start,end);
- start=end+1;
- designator = true;
- }
-
- end = indexOf (str, start, len, 'S');
- if ( end!=-1 ) {
- //scan seconds
- date.second = negate * parseSecond(str, start, end);
- start=end+1;
- designator = true;
- }
- // no additional data shouls appear after last item
- // P1Y1M1DT is illigal value as well
- if ( start != len || str.charAt(--start)=='T' ) {
- throw new SchemaDateTimeException();
- }
- }
-
- if ( !designator ) {
- throw new SchemaDateTimeException();
- }
-
- return date;
- }
-
- /**
- * Compares 2 given durations. (refer to W3C Schema Datatypes "3.2.6 duration")
- *
- * @param date1 Unnormalized duration
- * @param date2 Unnormalized duration
- * @param strict (min/max)Exclusive strict == true ( LESS_THAN ) or ( GREATER_THAN )
- * (min/max)Inclusive strict == false (LESS_EQUAL) or (GREATER_EQUAL)
- * @return INDETERMINATE if the order relationship between date1 and date2 is indeterminate.
- * EQUAL if the order relation between date1 and date2 is EQUAL.
- * If the strict parameter is true, return LESS_THAN if date1 is less than date2 and
- * return GREATER_THAN if date1 is greater than date2.
- * If the strict parameter is false, return LESS_THAN if date1 is less than OR equal to date2 and
- * return GREATER_THAN if date1 is greater than OR equal to date2
- */
- protected short compareDates(DateTimeData date1, DateTimeData date2, boolean strict) {
-
- //REVISIT: this is unoptimazed vs of comparing 2 durations
- // Algorithm is described in 3.2.6.2 W3C Schema Datatype specs
- //
-
- //add constA to both durations
- short resultA, resultB= INDETERMINATE;
- //try and see if the objects are equal
- resultA = compareOrder (date1, date2);
- if ( resultA == 0 ) {
- return 0;
- }
-
- DateTimeData[] result = new DateTimeData[2];
- result[0] = new DateTimeData(null, this);
- result[1] = new DateTimeData(null, this);
-
- //long comparison algorithm is required
- DateTimeData tempA = addDuration (date1, DATETIMES[0], result[0]);
- DateTimeData tempB = addDuration (date2, DATETIMES[0], result[1]);
- resultA = compareOrder(tempA, tempB);
- if ( resultA == INDETERMINATE ) {
- return INDETERMINATE;
- }
-
- tempA = addDuration(date1, DATETIMES[1], result[0]);
- tempB = addDuration(date2, DATETIMES[1], result[1]);
- resultB = compareOrder(tempA, tempB);
- resultA = compareResults(resultA, resultB, strict);
- if (resultA == INDETERMINATE) {
- return INDETERMINATE;
- }
-
- tempA = addDuration(date1, DATETIMES[2], result[0]);
- tempB = addDuration(date2, DATETIMES[2], result[1]);
- resultB = compareOrder(tempA, tempB);
- resultA = compareResults(resultA, resultB, strict);
- if (resultA == INDETERMINATE) {
- return INDETERMINATE;
- }
-
- tempA = addDuration(date1, DATETIMES[3], result[0]);
- tempB = addDuration(date2, DATETIMES[3], result[1]);
- resultB = compareOrder(tempA, tempB);
- resultA = compareResults(resultA, resultB, strict);
-
- return resultA;
- }
-
- private short compareResults(short resultA, short resultB, boolean strict){
-
- if ( resultB == INDETERMINATE ) {
- return INDETERMINATE;
- }
- else if ( resultA!=resultB && strict ) {
- return INDETERMINATE;
- }
- else if ( resultA!=resultB && !strict ) {
- if ( resultA!=0 && resultB!=0 ) {
- return INDETERMINATE;
- }
- else {
- return (resultA!=0)?resultA:resultB;
- }
- }
- return resultA;
- }
-
- private DateTimeData addDuration(DateTimeData date, DateTimeData addto, DateTimeData duration) {
-
- //REVISIT: some code could be shared between normalize() and this method,
- // however is it worth moving it? The structures are different...
- //
-
- resetDateObj(duration);
- //add months (may be modified additionaly below)
- int temp = addto.month + date.month;
- duration.month = modulo (temp, 1, 13);
- int carry = fQuotient (temp, 1, 13);
-
- //add years (may be modified additionaly below)
- duration.year=addto.year + date.year + carry;
-
- //add seconds
- double dtemp = addto.second + date.second;
- carry = (int)Math.floor(dtemp/60);
- duration.second = dtemp - carry*60;
-
- //add minutes
- temp = addto.minute +date.minute + carry;
- carry = fQuotient (temp, 60);
- duration.minute= mod(temp, 60, carry);
-
- //add hours
- temp = addto.hour + date.hour + carry;
- carry = fQuotient(temp, 24);
- duration.hour = mod(temp, 24, carry);
-
-
- duration.day=addto.day + date.day + carry;
-
- while ( true ) {
-
- temp=maxDayInMonthFor(duration.year, duration.month);
- if ( duration.day < 1 ) { //original duration was negative
- duration.day = duration.day + maxDayInMonthFor(duration.year, duration.month-1);
- carry=-1;
- }
- else if ( duration.day > temp ) {
- duration.day = duration.day - temp;
- carry=1;
- }
- else {
- break;
- }
- temp = duration.month+carry;
- duration.month = modulo(temp, 1, 13);
- duration.year = duration.year+fQuotient(temp, 1, 13);
- }
-
- duration.utc='Z';
- return duration;
- }
-
- protected double parseSecond(String buffer, int start, int end)
- throws NumberFormatException {
- int dot = -1;
- for (int i = start; i < end; i++) {
- char ch = buffer.charAt(i);
- if (ch == '.')
- dot = i;
- else if (ch > '9' || ch < '0')
- throw new NumberFormatException("'" + buffer + "' has wrong format");
- }
- if (dot+1 == end) {
- throw new NumberFormatException("'" + buffer + "' has wrong format");
- }
- double value = Double.parseDouble(buffer.substring(start, end));
- if (value == Double.POSITIVE_INFINITY) {
- throw new NumberFormatException("'" + buffer + "' has wrong format");
- }
- return value;
- }
-
- protected String dateToString(DateTimeData date) {
- StringBuffer message = new StringBuffer(30);
- if ( date.year<0 || date.month<0 || date.day<0
- || date.hour<0 || date.minute<0 || date.second<0) {
- message.append('-');
- }
- message.append('P');
- message.append((date.year < 0?-1:1) * date.year);
- message.append('Y');
- message.append((date.month < 0?-1:1) * date.month);
- message.append('M');
- message.append((date.day < 0?-1:1) * date.day);
- message.append('D');
- message.append('T');
- message.append((date.hour < 0?-1:1) * date.hour);
- message.append('H');
- message.append((date.minute < 0?-1:1) * date.minute);
- message.append('M');
- append2(message, (date.second < 0?-1:1) * date.second);
- message.append('S');
-
- return message.toString();
- }
-
- protected Duration getDuration(DateTimeData date) {
- int sign = 1;
- if ( date.year<0 || date.month<0 || date.day<0
- || date.hour<0 || date.minute<0 || date.second<0) {
- sign = -1;
- }
- return datatypeFactory.newDuration(sign == 1,
- date.year != DatatypeConstants.FIELD_UNDEFINED?BigInteger.valueOf(sign*date.year):null,
- date.month != DatatypeConstants.FIELD_UNDEFINED?BigInteger.valueOf(sign*date.month):null,
- date.day != DatatypeConstants.FIELD_UNDEFINED?BigInteger.valueOf(sign*date.day):null,
- date.hour != DatatypeConstants.FIELD_UNDEFINED?BigInteger.valueOf(sign*date.hour):null,
- date.minute != DatatypeConstants.FIELD_UNDEFINED?BigInteger.valueOf(sign*date.minute):null,
- date.second != DatatypeConstants.FIELD_UNDEFINED?new BigDecimal(String.valueOf(sign*date.second)):null);
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/EntityDV.java b/src/com/sun/org/apache/xerces/internal/impl/dv/xs/EntityDV.java
deleted file mode 100644
index 1a62ac9..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/EntityDV.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.xs;
-
-import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException;
-import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
-import com.sun.org.apache.xerces.internal.util.XMLChar;
-
-/**
- * Represent the schema type "entity"
- *
- * @xerces.internal
- *
- * @author Neeraj Bajaj, Sun Microsystems, inc.
- * @author Sandy Gao, IBM
- *
- */
-public class EntityDV extends TypeValidator {
-
- public short getAllowedFacets(){
- return (XSSimpleTypeDecl.FACET_LENGTH | XSSimpleTypeDecl.FACET_MINLENGTH | XSSimpleTypeDecl.FACET_MAXLENGTH | XSSimpleTypeDecl.FACET_PATTERN | XSSimpleTypeDecl.FACET_ENUMERATION | XSSimpleTypeDecl.FACET_WHITESPACE );
- }
-
- public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException {
- if (!XMLChar.isValidNCName(content)) {
- throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "NCName"});
- }
-
- return content;
- }
-
- public void checkExtraRules(Object value, ValidationContext context) throws InvalidDatatypeValueException {
- if (!context.isEntityUnparsed((String)value)) {
- throw new InvalidDatatypeValueException("UndeclaredEntity", new Object[]{value});
- }
- }
-
-} // class EntityDV
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/ExtendedSchemaDVFactoryImpl.java b/src/com/sun/org/apache/xerces/internal/impl/dv/xs/ExtendedSchemaDVFactoryImpl.java
deleted file mode 100644
index fa7e79e..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/ExtendedSchemaDVFactoryImpl.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.xs;
-
-import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType;
-import com.sun.org.apache.xerces.internal.util.SymbolHash;
-
-/**
- * A special factory to create/return built-in schema DVs and create user-defined DVs
- * that includes anyAtomicType, yearMonthDuration and dayTimeDuration
- *
- * @xerces.internal
- *
- * @author Khaled Noaman, IBM
- *
- * @version $Id: ExtendedSchemaDVFactoryImpl.java,v 1.2 2010-10-26 23:01:03 joehw Exp $
- */
-public class ExtendedSchemaDVFactoryImpl extends BaseSchemaDVFactory {
-
- static SymbolHash fBuiltInTypes = new SymbolHash();
- static {
- createBuiltInTypes();
- }
-
- // create all built-in types
- static void createBuiltInTypes() {
- final String ANYATOMICTYPE = "anyAtomicType";
- final String DURATION = "duration";
- final String YEARMONTHDURATION = "yearMonthDuration";
- final String DAYTIMEDURATION = "dayTimeDuration";
-
- createBuiltInTypes(fBuiltInTypes, XSSimpleTypeDecl.fAnyAtomicType);
-
- // add anyAtomicType
- fBuiltInTypes.put(ANYATOMICTYPE, XSSimpleTypeDecl.fAnyAtomicType);
-
- // add 2 duration types
- XSSimpleTypeDecl durationDV = (XSSimpleTypeDecl)fBuiltInTypes.get(DURATION);
- fBuiltInTypes.put(YEARMONTHDURATION, new XSSimpleTypeDecl(durationDV, YEARMONTHDURATION, XSSimpleTypeDecl.DV_YEARMONTHDURATION, XSSimpleType.ORDERED_PARTIAL, false, false, false, true, XSSimpleTypeDecl.YEARMONTHDURATION_DT));
- fBuiltInTypes.put(DAYTIMEDURATION, new XSSimpleTypeDecl(durationDV, DAYTIMEDURATION, XSSimpleTypeDecl.DV_DAYTIMEDURATION, XSSimpleType.ORDERED_PARTIAL, false, false, false, true, XSSimpleTypeDecl.DAYTIMEDURATION_DT));
- } //createBuiltInTypes()
-
- /**
- * Get a built-in simple type of the given name
- * REVISIT: its still not decided within the Schema WG how to define the
- * ur-types and if all simple types should be derived from a
- * complex type, so as of now we ignore the fact that anySimpleType
- * is derived from anyType, and pass 'null' as the base of
- * anySimpleType. It needs to be changed as per the decision taken.
- *
- * @param name the name of the datatype
- * @return the datatype validator of the given name
- */
- public XSSimpleType getBuiltInType(String name) {
- return (XSSimpleType)fBuiltInTypes.get(name);
- }
-
- /**
- * get all built-in simple types, which are stored in a hashtable keyed by
- * the name
- *
- * @return a hashtable which contains all built-in simple types
- */
- public SymbolHash getBuiltInTypes() {
- return (SymbolHash)fBuiltInTypes.makeClone();
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/FloatDV.java b/src/com/sun/org/apache/xerces/internal/impl/dv/xs/FloatDV.java
deleted file mode 100644
index 9ff0ecf..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/FloatDV.java
+++ /dev/null
@@ -1,241 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.xs;
-
-import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException;
-import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
-import com.sun.org.apache.xerces.internal.xs.datatypes.XSFloat;
-
-/**
- * Represent the schema type "float"
- *
- * @xerces.internal
- *
- * @author Neeraj Bajaj, Sun Microsystems, inc.
- * @author Sandy Gao, IBM
- *
- * @version $Id: FloatDV.java,v 1.7 2010-11-01 04:39:47 joehw Exp $
- */
-public class FloatDV extends TypeValidator {
-
- public short getAllowedFacets(){
- return ( XSSimpleTypeDecl.FACET_PATTERN | XSSimpleTypeDecl.FACET_WHITESPACE | XSSimpleTypeDecl.FACET_ENUMERATION |XSSimpleTypeDecl.FACET_MAXINCLUSIVE |XSSimpleTypeDecl.FACET_MININCLUSIVE | XSSimpleTypeDecl.FACET_MAXEXCLUSIVE | XSSimpleTypeDecl.FACET_MINEXCLUSIVE );
- }//getAllowedFacets()
-
- //convert a String to Float form, we have to take care of cases specified in spec like INF, -INF and NaN
- public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException {
- try{
- return new XFloat(content);
- } catch (NumberFormatException ex){
- throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "float"});
- }
- }//getActualValue()
-
- // Can't call Float#compareTo method, because it's introduced in jdk 1.2
- public int compare(Object value1, Object value2){
- return ((XFloat)value1).compareTo((XFloat)value2);
- }//compare()
-
- //distinguishes between identity and equality for float datatype
- //0.0 is equal but not identical to -0.0
- public boolean isIdentical (Object value1, Object value2) {
- if (value2 instanceof XFloat) {
- return ((XFloat)value1).isIdentical((XFloat)value2);
- }
- return false;
- }//isIdentical()
-
- private static final class XFloat implements XSFloat {
-
- private final float value;
- public XFloat(String s) throws NumberFormatException {
- if (DoubleDV.isPossibleFP(s)) {
- value = Float.parseFloat(s);
- }
- else if ( s.equals("INF") ) {
- value = Float.POSITIVE_INFINITY;
- }
- else if ( s.equals("-INF") ) {
- value = Float.NEGATIVE_INFINITY;
- }
- else if ( s.equals("NaN") ) {
- value = Float.NaN;
- }
- else {
- throw new NumberFormatException(s);
- }
- }
-
- public boolean equals(Object val) {
- if (val == this)
- return true;
-
- if (!(val instanceof XFloat))
- return false;
- XFloat oval = (XFloat)val;
-
- // NOTE: we don't distinguish 0.0 from -0.0
- if (value == oval.value)
- return true;
-
- if (value != value && oval.value != oval.value)
- return true;
-
- return false;
- }
-
- public int hashCode() {
- // This check is necessary because floatToIntBits(+0) != floatToIntBits(-0)
- return (value == 0f) ? 0 : Float.floatToIntBits(value);
- }
-
- // NOTE: 0.0 is equal but not identical to -0.0
- public boolean isIdentical (XFloat val) {
- if (val == this) {
- return true;
- }
-
- if (value == val.value) {
- return (value != 0.0f ||
- (Float.floatToIntBits(value) == Float.floatToIntBits(val.value)));
- }
-
- if (value != value && val.value != val.value)
- return true;
-
- return false;
- }
-
- private int compareTo(XFloat val) {
- float oval = val.value;
-
- // this < other
- if (value < oval)
- return -1;
- // this > other
- if (value > oval)
- return 1;
- // this == other
- // NOTE: we don't distinguish 0.0 from -0.0
- if (value == oval)
- return 0;
-
- // one of the 2 values or both is/are NaN(s)
-
- if (value != value) {
- // this = NaN = other
- if (oval != oval)
- return 0;
- // this is NaN <> other
- return INDETERMINATE;
- }
-
- // other is NaN <> this
- return INDETERMINATE;
- }
-
- private String canonical;
- public synchronized String toString() {
- if (canonical == null) {
- if (value == Float.POSITIVE_INFINITY)
- canonical = "INF";
- else if (value == Float.NEGATIVE_INFINITY)
- canonical = "-INF";
- else if (value != value)
- canonical = "NaN";
- // NOTE: we don't distinguish 0.0 from -0.0
- else if (value == 0)
- canonical = "0.0E1";
- else {
- // REVISIT: use the java algorithm for now, because we
- // don't know what to output for 1.1f (which is no
- // actually 1.1)
- canonical = Float.toString(value);
- // if it contains 'E', then it should be a valid schema
- // canonical representation
- if (canonical.indexOf('E') == -1) {
- int len = canonical.length();
- // at most 3 longer: E, -, 9
- char[] chars = new char[len+3];
- canonical.getChars(0, len, chars, 0);
- // expected decimal point position
- int edp = chars[0] == '-' ? 2 : 1;
- // for non-zero integer part
- if (value >= 1 || value <= -1) {
- // decimal point position
- int dp = canonical.indexOf('.');
- // move the digits: ddd.d --> d.ddd
- for (int i = dp; i > edp; i--) {
- chars[i] = chars[i-1];
- }
- chars[edp] = '.';
- // trim trailing zeros: d00.0 --> d.000 --> d.
- while (chars[len-1] == '0')
- len--;
- // add the last zero if necessary: d. --> d.0
- if (chars[len-1] == '.')
- len++;
- // append E: d.dd --> d.ddE
- chars[len++] = 'E';
- // how far we shifted the decimal point
- int shift = dp - edp;
- // append the exponent --> d.ddEd
- // the exponent is at most 7
- chars[len++] = (char)(shift + '0');
- }
- else {
- // non-zero digit point
- int nzp = edp + 1;
- // skip zeros: 0.003
- while (chars[nzp] == '0')
- nzp++;
- // put the first non-zero digit to the left of '.'
- chars[edp-1] = chars[nzp];
- chars[edp] = '.';
- // move other digits (non-zero) to the right of '.'
- for (int i = nzp+1, j = edp+1; i < len; i++, j++)
- chars[j] = chars[i];
- // adjust the length
- len -= nzp - edp;
- // append 0 if nessary: 0.03 --> 3. --> 3.0
- if (len == edp + 1)
- chars[len++] = '0';
- // append E-: d.dd --> d.ddE-
- chars[len++] = 'E';
- chars[len++] = '-';
- // how far we shifted the decimal point
- int shift = nzp - edp;
- // append the exponent --> d.ddEd
- // the exponent is at most 3
- chars[len++] = (char)(shift + '0');
- }
- canonical = new String(chars, 0, len);
- }
- }
- }
- return canonical;
- }
-
- public float getValue() {
- return value;
- }
- }
-} // class FloatDV
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/FullDVFactory.java b/src/com/sun/org/apache/xerces/internal/impl/dv/xs/FullDVFactory.java
deleted file mode 100644
index d003c48..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/FullDVFactory.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2002, 2003,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.xs;
-
-import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType;
-import com.sun.org.apache.xerces.internal.impl.dv.XSFacets;
-import com.sun.org.apache.xerces.internal.util.SymbolHash;
-import com.sun.org.apache.xerces.internal.xs.XSConstants;
-
-/**
- * the factory to create/return built-in schema DVs and create user-defined DVs
- *
- * @xerces.internal
- *
- * @author Neeraj Bajaj, Sun Microsystems, inc.
- * @author Sandy Gao, IBM
- *
- */
-public class FullDVFactory extends BaseDVFactory {
-
- static final String URI_SCHEMAFORSCHEMA = "http://www.w3.org/2001/XMLSchema";
-
- // there are 45 types. 89 is the closest prime number to 45*2=90.
- static SymbolHash fFullTypes = new SymbolHash(89);
- static {
- createBuiltInTypes(fFullTypes);
- }
-
- /**
- * Get a built-in simple type of the given name
- * REVISIT: its still not decided within the Schema WG how to define the
- * ur-types and if all simple types should be derived from a
- * complex type, so as of now we ignore the fact that anySimpleType
- * is derived from anyType, and pass 'null' as the base of
- * anySimpleType. It needs to be changed as per the decision taken.
- *
- * @param name the name of the datatype
- * @return the datatype validator of the given name
- */
- public XSSimpleType getBuiltInType(String name) {
- return (XSSimpleType)fFullTypes.get(name);
- }
-
- /**
- * get all built-in simple types, which are stored in a hashtable keyed by
- * the name
- *
- * @return a hashtable which contains all built-in simple types
- */
- public SymbolHash getBuiltInTypes() {
- return (SymbolHash)fFullTypes.makeClone();
- }
-
- // create all built-in types
- static void createBuiltInTypes(SymbolHash types) {
- // create base types first
- BaseDVFactory.createBuiltInTypes(types);
-
- // full schema simple type names
- final String DOUBLE = "double";
- final String DURATION = "duration";
- final String ENTITY = "ENTITY";
- final String ENTITIES = "ENTITIES";
- final String FLOAT = "float";
- final String HEXBINARY = "hexBinary";
- final String ID = "ID";
- final String IDREF = "IDREF";
- final String IDREFS = "IDREFS";
- final String NAME = "Name";
- final String NCNAME = "NCName";
- final String NMTOKEN = "NMTOKEN";
- final String NMTOKENS = "NMTOKENS";
- final String LANGUAGE = "language";
- final String NORMALIZEDSTRING = "normalizedString";
- final String NOTATION = "NOTATION";
- final String QNAME = "QName";
- final String STRING = "string";
- final String TOKEN = "token";
-
- final XSFacets facets = new XSFacets();
-
- XSSimpleTypeDecl anySimpleType = XSSimpleTypeDecl.fAnySimpleType;
- XSSimpleTypeDecl stringDV = (XSSimpleTypeDecl)types.get(STRING);
-
- types.put(FLOAT, new XSSimpleTypeDecl(anySimpleType, FLOAT, XSSimpleTypeDecl.DV_FLOAT, XSSimpleType.ORDERED_PARTIAL, true, true, true, true, XSConstants.FLOAT_DT));
- types.put(DOUBLE, new XSSimpleTypeDecl(anySimpleType, DOUBLE, XSSimpleTypeDecl.DV_DOUBLE, XSSimpleType.ORDERED_PARTIAL, true, true, true, true, XSConstants.DOUBLE_DT));
- types.put(DURATION, new XSSimpleTypeDecl(anySimpleType, DURATION, XSSimpleTypeDecl.DV_DURATION, XSSimpleType.ORDERED_PARTIAL, false, false, false, true, XSConstants.DURATION_DT));
- types.put(HEXBINARY, new XSSimpleTypeDecl(anySimpleType, HEXBINARY, XSSimpleTypeDecl.DV_HEXBINARY, XSSimpleType.ORDERED_FALSE, false, false, false, true, XSConstants.HEXBINARY_DT));
- types.put(QNAME, new XSSimpleTypeDecl(anySimpleType, QNAME, XSSimpleTypeDecl.DV_QNAME, XSSimpleType.ORDERED_FALSE, false, false, false, true, XSConstants.QNAME_DT));
- types.put(NOTATION, new XSSimpleTypeDecl(anySimpleType, NOTATION, XSSimpleTypeDecl.DV_NOTATION, XSSimpleType.ORDERED_FALSE, false, false, false, true, XSConstants.NOTATION_DT));
-
- facets.whiteSpace = XSSimpleType.WS_REPLACE;
- XSSimpleTypeDecl normalizedDV = new XSSimpleTypeDecl(stringDV, NORMALIZEDSTRING , URI_SCHEMAFORSCHEMA, (short)0, false, null, XSConstants.NORMALIZEDSTRING_DT);
- normalizedDV.applyFacets1(facets, XSSimpleType.FACET_WHITESPACE, (short)0 );
- types.put(NORMALIZEDSTRING, normalizedDV);
-
- facets.whiteSpace = XSSimpleType.WS_COLLAPSE;
- XSSimpleTypeDecl tokenDV = new XSSimpleTypeDecl(normalizedDV, TOKEN , URI_SCHEMAFORSCHEMA, (short)0, false, null, XSConstants.TOKEN_DT);
- tokenDV.applyFacets1(facets, XSSimpleType.FACET_WHITESPACE, (short)0 );
- types.put(TOKEN, tokenDV);
-
- facets.whiteSpace = XSSimpleType.WS_COLLAPSE;
- facets.pattern = "([a-zA-Z]{1,8})(-[a-zA-Z0-9]{1,8})*";
- XSSimpleTypeDecl languageDV = new XSSimpleTypeDecl(tokenDV, LANGUAGE , URI_SCHEMAFORSCHEMA, (short)0, false, null, XSConstants.LANGUAGE_DT);
- languageDV.applyFacets1(facets, (short)(XSSimpleType.FACET_WHITESPACE | XSSimpleType.FACET_PATTERN) ,(short)0);
- types.put(LANGUAGE, languageDV);
-
- facets.whiteSpace = XSSimpleType.WS_COLLAPSE;
- XSSimpleTypeDecl nameDV = new XSSimpleTypeDecl(tokenDV, NAME , URI_SCHEMAFORSCHEMA, (short)0, false, null, XSConstants.NAME_DT);
- nameDV.applyFacets1(facets, XSSimpleType.FACET_WHITESPACE, (short)0, XSSimpleTypeDecl.SPECIAL_PATTERN_NAME);
- types.put(NAME, nameDV);
-
- facets.whiteSpace = XSSimpleType.WS_COLLAPSE;
- XSSimpleTypeDecl ncnameDV = new XSSimpleTypeDecl(nameDV, NCNAME , URI_SCHEMAFORSCHEMA, (short)0, false, null, XSConstants.NCNAME_DT) ;
- ncnameDV.applyFacets1(facets, XSSimpleType.FACET_WHITESPACE, (short)0, XSSimpleTypeDecl.SPECIAL_PATTERN_NCNAME);
- types.put(NCNAME, ncnameDV);
-
- types.put(ID, new XSSimpleTypeDecl(ncnameDV, ID, XSSimpleTypeDecl.DV_ID, XSSimpleType.ORDERED_FALSE, false, false, false , true, XSConstants.ID_DT));
- XSSimpleTypeDecl idrefDV = new XSSimpleTypeDecl(ncnameDV, IDREF , XSSimpleTypeDecl.DV_IDREF, XSSimpleType.ORDERED_FALSE, false, false, false, true, XSConstants.IDREF_DT);
- types.put(IDREF, idrefDV);
-
- facets.minLength = 1;
- XSSimpleTypeDecl tempDV = new XSSimpleTypeDecl(null, URI_SCHEMAFORSCHEMA, (short)0, idrefDV, true, null);
- XSSimpleTypeDecl idrefsDV = new XSSimpleTypeDecl(tempDV, IDREFS, URI_SCHEMAFORSCHEMA, (short)0, false, null);
- idrefsDV.applyFacets1(facets, XSSimpleType.FACET_MINLENGTH, (short)0);
- types.put(IDREFS, idrefsDV);
-
- XSSimpleTypeDecl entityDV = new XSSimpleTypeDecl(ncnameDV, ENTITY , XSSimpleTypeDecl.DV_ENTITY, XSSimpleType.ORDERED_FALSE, false, false, false, true, XSConstants.ENTITY_DT);
- types.put(ENTITY, entityDV);
-
- facets.minLength = 1;
- tempDV = new XSSimpleTypeDecl(null, URI_SCHEMAFORSCHEMA, (short)0, entityDV, true, null);
- XSSimpleTypeDecl entitiesDV = new XSSimpleTypeDecl(tempDV, ENTITIES, URI_SCHEMAFORSCHEMA, (short)0, false, null);
- entitiesDV.applyFacets1(facets, XSSimpleType.FACET_MINLENGTH, (short)0);
- types.put(ENTITIES, entitiesDV);
-
-
- facets.whiteSpace = XSSimpleType.WS_COLLAPSE;
- XSSimpleTypeDecl nmtokenDV = new XSSimpleTypeDecl(tokenDV, NMTOKEN, URI_SCHEMAFORSCHEMA, (short)0, false, null, XSConstants.NMTOKEN_DT);
- nmtokenDV.applyFacets1(facets, XSSimpleType.FACET_WHITESPACE, (short)0, XSSimpleTypeDecl.SPECIAL_PATTERN_NMTOKEN);
- types.put(NMTOKEN, nmtokenDV);
-
- facets.minLength = 1;
- tempDV = new XSSimpleTypeDecl(null, URI_SCHEMAFORSCHEMA, (short)0, nmtokenDV, true, null);
- XSSimpleTypeDecl nmtokensDV = new XSSimpleTypeDecl(tempDV, NMTOKENS, URI_SCHEMAFORSCHEMA, (short)0, false, null);
- nmtokensDV.applyFacets1(facets, XSSimpleType.FACET_MINLENGTH, (short)0);
- types.put(NMTOKENS, nmtokensDV);
- }//createBuiltInTypes(SymbolHash)
-
-}//XFormsDVFactory
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/HexBinaryDV.java b/src/com/sun/org/apache/xerces/internal/impl/dv/xs/HexBinaryDV.java
deleted file mode 100644
index 2b87226..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/HexBinaryDV.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.xs;
-
-import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException;
-import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
-import com.sun.org.apache.xerces.internal.impl.dv.util.ByteListImpl;
-import com.sun.org.apache.xerces.internal.impl.dv.util.HexBin;
-
-/**
- * Represent the schema type "hexBinary"
- *
- * @xerces.internal
- *
- * @author Neeraj Bajaj, Sun Microsystems, inc.
- * @author Sandy Gao, IBM
- *
- * @version $Id: HexBinaryDV.java,v 1.7 2010-11-01 04:39:47 joehw Exp $
- */
-public class HexBinaryDV extends TypeValidator {
-
- public short getAllowedFacets(){
- return (XSSimpleTypeDecl.FACET_LENGTH | XSSimpleTypeDecl.FACET_MINLENGTH | XSSimpleTypeDecl.FACET_MAXLENGTH | XSSimpleTypeDecl.FACET_PATTERN | XSSimpleTypeDecl.FACET_ENUMERATION | XSSimpleTypeDecl.FACET_WHITESPACE );
- }
-
- public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException {
- byte[] decoded = HexBin.decode(content);
- if (decoded == null)
- throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "hexBinary"});
-
- return new XHex(decoded);
- }
-
- // length of a binary type is the number of bytes
- public int getDataLength(Object value) {
- return ((XHex)value).getLength();
- }
-
- private static final class XHex extends ByteListImpl {
-
- public XHex(byte[] data) {
- super(data);
- }
- public synchronized String toString() {
- if (canonical == null) {
- canonical = HexBin.encode(data);
- }
- return canonical;
- }
-
- public boolean equals(Object obj) {
- if (!(obj instanceof XHex))
- return false;
- byte[] odata = ((XHex)obj).data;
- int len = data.length;
- if (len != odata.length)
- return false;
- for (int i = 0; i < len; i++) {
- if (data[i] != odata[i])
- return false;
- }
- return true;
- }
-
- public int hashCode() {
- int hash = 0;
- for (int i = 0; i < data.length; ++i) {
- hash = hash * 37 + (((int) data[i]) & 0xff);
- }
- return hash;
- }
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/IDDV.java b/src/com/sun/org/apache/xerces/internal/impl/dv/xs/IDDV.java
deleted file mode 100644
index 91621d4..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/IDDV.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.xs;
-
-import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException;
-import com.sun.org.apache.xerces.internal.util.XMLChar;
-import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
-
-/**
- * Represent the schema type "ID"
- *
- * @xerces.internal
- *
- * @author Neeraj Bajaj, Sun Microsystems, inc.
- * @author Sandy Gao, IBM
- *
- */
-public class IDDV extends TypeValidator{
-
- public short getAllowedFacets(){
- return (XSSimpleTypeDecl.FACET_LENGTH | XSSimpleTypeDecl.FACET_MINLENGTH | XSSimpleTypeDecl.FACET_MAXLENGTH | XSSimpleTypeDecl.FACET_PATTERN | XSSimpleTypeDecl.FACET_ENUMERATION | XSSimpleTypeDecl.FACET_WHITESPACE );
- }
-
- public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException {
- if (!XMLChar.isValidNCName(content)) {
- throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "NCName"});
- }
- return content;
- }
-
- public void checkExtraRules(Object value, ValidationContext context) throws InvalidDatatypeValueException {
- String content = (String)value;
- if (context.isIdDeclared(content))
- throw new InvalidDatatypeValueException("cvc-id.2", new Object[]{content});
- context.addId(content);
- }
-} // class IDDV
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/IDREFDV.java b/src/com/sun/org/apache/xerces/internal/impl/dv/xs/IDREFDV.java
deleted file mode 100644
index ff0fdfd..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/IDREFDV.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.xs;
-
-import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException;
-import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
-import com.sun.org.apache.xerces.internal.util.XMLChar;
-
-/**
- * Represent the schema type "IDREF"
- *
- * @xerces.internal
- *
- * @author Neeraj Bajaj, Sun Microsystems, inc.
- * @author Sandy Gao, IBM
- *
- */
-public class IDREFDV extends TypeValidator{
-
- public short getAllowedFacets(){
- return (XSSimpleTypeDecl.FACET_LENGTH | XSSimpleTypeDecl.FACET_MINLENGTH | XSSimpleTypeDecl.FACET_MAXLENGTH | XSSimpleTypeDecl.FACET_PATTERN | XSSimpleTypeDecl.FACET_ENUMERATION | XSSimpleTypeDecl.FACET_WHITESPACE );
- }
-
- public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException {
- if (!XMLChar.isValidNCName(content)) {
- throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "NCName"});
- }
- return content;
- }
-
- public void checkExtraRules(Object value, ValidationContext context) throws InvalidDatatypeValueException {
- context.addIdRef((String)value);
- }
-
-}//IDREF class
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/IntegerDV.java b/src/com/sun/org/apache/xerces/internal/impl/dv/xs/IntegerDV.java
deleted file mode 100644
index a1a0c4b..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/IntegerDV.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.xs;
-
-import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException;
-import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
-
-/**
- * Represent the schema type "integer"
- *
- * @xerces.internal
- *
- * @author Sandy Gao, IBM
- *
- */
-public class IntegerDV extends DecimalDV {
-
- public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException {
- try {
- return new XDecimal(content, true);
- } catch (NumberFormatException nfe) {
- throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "integer"});
- }
- }
-
-} // class EntityDV
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/ListDV.java b/src/com/sun/org/apache/xerces/internal/impl/dv/xs/ListDV.java
deleted file mode 100644
index ca07432..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/ListDV.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001,2002,2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.xs;
-
-import java.util.AbstractList;
-
-import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException;
-import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
-import com.sun.org.apache.xerces.internal.xs.datatypes.ObjectList;
-
-/**
- * Represent the schema list types
- *
- * @xerces.internal
- *
- * @author Neeraj Bajaj, Sun Microsystems, inc.
- * @author Sandy Gao, IBM
- *
- * @version $Id: ListDV.java,v 1.7 2010-11-01 04:39:47 joehw Exp $
- */
-public class ListDV extends TypeValidator{
-
- public short getAllowedFacets(){
- return (XSSimpleTypeDecl.FACET_LENGTH | XSSimpleTypeDecl.FACET_MINLENGTH | XSSimpleTypeDecl.FACET_MAXLENGTH | XSSimpleTypeDecl.FACET_PATTERN | XSSimpleTypeDecl.FACET_ENUMERATION | XSSimpleTypeDecl.FACET_WHITESPACE );
- }
-
- // this method should never be called: XSSimpleTypeDecl is responsible for
- // calling the item type for the convertion
- public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException{
- return content;
- }
-
- // length of a list type is the number of items in the list
- public int getDataLength(Object value) {
- return ((ListData)value).getLength();
- }
-
- final static class ListData extends AbstractList implements ObjectList {
- final Object[] data;
- private String canonical;
- public ListData(Object[] data) {
- this.data = data;
- }
- public synchronized String toString() {
- if (canonical == null) {
- int len = data.length;
- StringBuffer buf = new StringBuffer();
- if (len > 0) {
- buf.append(data[0].toString());
- }
- for (int i = 1; i < len; i++) {
- buf.append(' ');
- buf.append(data[i].toString());
- }
- canonical = buf.toString();
- }
- return canonical;
- }
- public int getLength() {
- return data.length;
- }
- public boolean equals(Object obj) {
- if (!(obj instanceof ListData))
- return false;
- Object[] odata = ((ListData)obj).data;
-
- int count = data.length;
- if (count != odata.length)
- return false;
-
- for (int i = 0 ; i < count ; i++) {
- if (!data[i].equals(odata[i]))
- return false;
- }//end of loop
-
- //everything went fine.
- return true;
- }
-
- public int hashCode() {
- int hash = 0;
- for (int i = 0; i < data.length; ++i) {
- hash ^= data[i].hashCode();
- }
- return hash;
- }
-
- public boolean contains(Object item) {
- for (int i = 0;i < data.length; i++) {
- if (item == data[i]) {
- return true;
- }
- }
- return false;
- }
-
- public Object item(int index) {
- if (index < 0 || index >= data.length) {
- return null;
- }
- return data[index];
- }
-
- /*
- * List methods
- */
-
- public Object get(int index) {
- if (index >= 0 && index < data.length) {
- return data[index];
- }
- throw new IndexOutOfBoundsException("Index: " + index);
- }
-
- public int size() {
- return getLength();
- }
- }
-} // class ListDV
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/MonthDV.java b/src/com/sun/org/apache/xerces/internal/impl/dv/xs/MonthDV.java
deleted file mode 100644
index ea57736..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/MonthDV.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.xs;
-
-import javax.xml.datatype.DatatypeConstants;
-import javax.xml.datatype.XMLGregorianCalendar;
-
-import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException;
-import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
-
-/**
- * Validator for &lt;gMonth&gt; datatype (W3C Schema Datatypes)
- *
- * @xerces.internal
- *
- * @author Elena Litani
- * @author Gopal Sharma, SUN Microsystem Inc.
- *
- * @version $Id: MonthDV.java,v 1.8 2010-11-01 04:39:47 joehw Exp $
- */
-
-public class MonthDV extends AbstractDateTimeDV {
-
- /**
- * Convert a string to a compiled form
- *
- * @param content The lexical representation of gMonth
- * @return a valid and normalized gMonth object
- */
- public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException{
- try{
- return parse(content);
- } catch(Exception ex){
- throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "gMonth"});
- }
- }
-
- /**
- * Parses, validates and computes normalized version of gMonth object
- *
- * @param str The lexical representation of gMonth object --MM
- * with possible time zone Z or (-),(+)hh:mm
- * @return normalized date representation
- * @exception SchemaDateTimeException Invalid lexical representation
- */
- protected DateTimeData parse(String str) throws SchemaDateTimeException{
- DateTimeData date = new DateTimeData(str, this);
- int len = str.length();
-
- //set constants
- date.year=YEAR;
- date.day=DAY;
- if (str.charAt(0)!='-' || str.charAt(1)!='-') {
- throw new SchemaDateTimeException("Invalid format for gMonth: "+str);
- }
- int stop = 4;
- date.month=parseInt(str,2,stop);
-
- // REVISIT: allow both --MM and --MM-- now.
- // need to remove the following 4 lines to disallow --MM--
- // when the errata is offically in the rec.
- if (str.length() >= stop+2 &&
- str.charAt(stop) == '-' && str.charAt(stop+1) == '-') {
- stop += 2;
- }
- if (stop < len) {
- if (!isNextCharUTCSign(str, stop, len)) {
- throw new SchemaDateTimeException ("Error in month parsing: "+str);
- }
- else {
- getTimeZone(str, date, stop, len);
- }
- }
- //validate and normalize
- validateDateTime(date);
-
- //save unnormalized values
- saveUnnormalized(date);
-
- if ( date.utc!=0 && date.utc!='Z' ) {
- normalize(date);
- }
- date.position = 1;
- return date;
- }
-
- /**
- * Overwrite compare algorithm to optimize month comparison
- *
- * REVISIT: this one is lack of the third parameter: boolean strict, so it
- * doesn't override the method in the base. But maybe this method
- * is not correctly implemented, and I did encounter errors when
- * trying to add the extra parameter. I'm leaving it as is. -SG
- *
- * @param date1
- * @param date2
- * @return less, greater, equal, indeterminate
- */
- /*protected short compareDates(DateTimeData date1, DateTimeData date2) {
-
- if ( date1.utc==date2.utc ) {
- return (short)((date1.month>=date2.month)?(date1.month>date2.month)?1:0:-1);
- }
-
- if ( date1.utc=='Z' || date2.utc=='Z' ) {
-
- if ( date1.month==date2.month ) {
- //--05--Z and --05--
- return INDETERMINATE;
- }
- if ( (date1.month+1 == date2.month || date1.month-1 == date2.month) ) {
- //--05--Z and (--04-- or --05--)
- //REVISIT: should this case be less than or equal?
- // maxExclusive should fail but what about maxInclusive
- //
- return INDETERMINATE;
- }
- }
-
- if ( date1.month<date2.month ) {
- return -1;
- }
- else {
- return 1;
- }
-
- }*/
-
- /**
- * Converts month object representation to String
- *
- * @param date month object
- * @return lexical representation of month: --MM with an optional time zone sign
- */
- protected String dateToString(DateTimeData date) {
- StringBuffer message = new StringBuffer(5);
- message.append('-');
- message.append('-');
- append(message, date.month, 2);
- append(message, (char)date.utc, 0);
- return message.toString();
- }
-
- protected XMLGregorianCalendar getXMLGregorianCalendar(DateTimeData date) {
- return datatypeFactory.newXMLGregorianCalendar(DatatypeConstants.FIELD_UNDEFINED, date.unNormMonth,
- DatatypeConstants.FIELD_UNDEFINED, DatatypeConstants.FIELD_UNDEFINED, DatatypeConstants.FIELD_UNDEFINED,
- DatatypeConstants.FIELD_UNDEFINED, DatatypeConstants.FIELD_UNDEFINED,
- date.hasTimeZone() ? date.timezoneHr * 60 + date.timezoneMin : DatatypeConstants.FIELD_UNDEFINED);
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/MonthDayDV.java b/src/com/sun/org/apache/xerces/internal/impl/dv/xs/MonthDayDV.java
deleted file mode 100644
index 4b4dc11..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/MonthDayDV.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.xs;
-
-import javax.xml.datatype.DatatypeConstants;
-import javax.xml.datatype.XMLGregorianCalendar;
-
-import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException;
-import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
-
-/**
- * Validator for &lt;gMonthDay&gt; datatype (W3C Schema Datatypes)
- *
- * @xerces.internal
- *
- * @author Elena Litani
- * @author Gopal Sharma, SUN Microsystem Inc.
- *
- * @version $Id: MonthDayDV.java,v 1.7 2010-11-01 04:39:47 joehw Exp $
- */
-
-public class MonthDayDV extends AbstractDateTimeDV {
-
- //size without time zone: --MM-DD
- private final static int MONTHDAY_SIZE = 7;
-
- /**
- * Convert a string to a compiled form
- *
- * @param content The lexical representation of gMonthDay
- * @return a valid and normalized gMonthDay object
- */
- public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException {
- try{
- return parse(content);
- } catch(Exception ex){
- throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "gMonthDay"});
- }
- }
-
- /**
- * Parses, validates and computes normalized version of gMonthDay object
- *
- * @param str The lexical representation of gMonthDay object --MM-DD
- * with possible time zone Z or (-),(+)hh:mm
- * @return normalized date representation
- * @exception SchemaDateTimeException Invalid lexical representation
- */
- protected DateTimeData parse(String str) throws SchemaDateTimeException{
- DateTimeData date = new DateTimeData(str, this);
- int len = str.length();
-
- //initialize
- date.year=YEAR;
-
- if (str.charAt(0)!='-' || str.charAt(1)!='-') {
- throw new SchemaDateTimeException("Invalid format for gMonthDay: "+str);
- }
- date.month=parseInt(str, 2, 4);
- int start=4;
-
- if (str.charAt(start++)!='-') {
- throw new SchemaDateTimeException("Invalid format for gMonthDay: " + str);
- }
-
- date.day=parseInt(str, start, start+2);
-
- if ( MONTHDAY_SIZE<len ) {
- if (!isNextCharUTCSign(str, MONTHDAY_SIZE, len)) {
- throw new SchemaDateTimeException ("Error in month parsing:" +str);
- }
- else {
- getTimeZone(str, date, MONTHDAY_SIZE, len);
- }
- }
- //validate and normalize
-
- validateDateTime(date);
-
- //save unnormalized values
- saveUnnormalized(date);
-
- if ( date.utc!=0 && date.utc!='Z' ) {
- normalize(date);
- }
- date.position = 1;
- return date;
- }
-
- /**
- * Converts gMonthDay object representation to String
- *
- * @param date gmonthDay object
- * @return lexical representation of month: --MM-DD with an optional time zone sign
- */
- protected String dateToString(DateTimeData date) {
- StringBuffer message = new StringBuffer(8);
- message.append('-');
- message.append('-');
- append(message, date.month, 2);
- message.append('-');
- append(message, date.day, 2);
- append(message, (char)date.utc, 0);
- return message.toString();
- }
-
- protected XMLGregorianCalendar getXMLGregorianCalendar(DateTimeData date) {
- return datatypeFactory.newXMLGregorianCalendar(DatatypeConstants.FIELD_UNDEFINED, date.unNormMonth, date.unNormDay,
- DatatypeConstants.FIELD_UNDEFINED, DatatypeConstants.FIELD_UNDEFINED,
- DatatypeConstants.FIELD_UNDEFINED, DatatypeConstants.FIELD_UNDEFINED,
- date.hasTimeZone() ? date.timezoneHr * 60 + date.timezoneMin : DatatypeConstants.FIELD_UNDEFINED);
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/PrecisionDecimalDV.java b/src/com/sun/org/apache/xerces/internal/impl/dv/xs/PrecisionDecimalDV.java
deleted file mode 100644
index a75f03a..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/PrecisionDecimalDV.java
+++ /dev/null
@@ -1,446 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xerces.internal.impl.dv.xs;
-
-import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException;
-import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
-
-/**
- * Validator for <precisionDecimal> datatype (W3C Schema 1.1)
- *
- * @xerces.experimental
- *
- * @author Ankit Pasricha, IBM
- *
- */
-class PrecisionDecimalDV extends TypeValidator {
-
- static final class XPrecisionDecimal {
-
- // sign: 0 for absent; 1 for positive values; -1 for negative values (except in case of INF, -INF)
- int sign = 1;
- // total digits. >= 1
- int totalDigits = 0;
- // integer digits when sign != 0
- int intDigits = 0;
- // fraction digits when sign != 0
- int fracDigits = 0;
- //precision
- //int precision = 0;
- // the string representing the integer part
- String ivalue = "";
- // the string representing the fraction part
- String fvalue = "";
-
- int pvalue = 0;
-
-
- XPrecisionDecimal(String content) throws NumberFormatException {
- if(content.equals("NaN")) {
- ivalue = content;
- sign = 0;
- }
- if(content.equals("+INF") || content.equals("INF") || content.equals("-INF")) {
- ivalue = content.charAt(0) == '+' ? content.substring(1) : content;
- return;
- }
- initD(content);
- }
-
- void initD(String content) throws NumberFormatException {
- int len = content.length();
- if (len == 0)
- throw new NumberFormatException();
-
- // these 4 variables are used to indicate where the integre/fraction
- // parts start/end.
- int intStart = 0, intEnd = 0, fracStart = 0, fracEnd = 0;
-
- // Deal with leading sign symbol if present
- if (content.charAt(0) == '+') {
- // skip '+', so intStart should be 1
- intStart = 1;
- }
- else if (content.charAt(0) == '-') {
- intStart = 1;
- sign = -1;
- }
-
- // skip leading zeroes in integer part
- int actualIntStart = intStart;
- while (actualIntStart < len && content.charAt(actualIntStart) == '0') {
- actualIntStart++;
- }
-
- // Find the ending position of the integer part
- for (intEnd = actualIntStart; intEnd < len && TypeValidator.isDigit(content.charAt(intEnd)); intEnd++);
-
- // Not reached the end yet
- if (intEnd < len) {
- // the remaining part is not ".DDD" or "EDDD" or "eDDD", error
- if (content.charAt(intEnd) != '.' && content.charAt(intEnd) != 'E' && content.charAt(intEnd) != 'e')
- throw new NumberFormatException();
-
- if(content.charAt(intEnd) == '.') {
- // fraction part starts after '.', and ends at the end of the input
- fracStart = intEnd + 1;
-
- // find location of E or e (if present)
- // Find the ending position of the fracion part
- for (fracEnd = fracStart;
- fracEnd < len && TypeValidator.isDigit(content.charAt(fracEnd));
- fracEnd++);
- }
- else {
- pvalue = Integer.parseInt(content.substring(intEnd + 1, len));
- }
- }
-
- // no integer part, no fraction part, error.
- if (intStart == intEnd && fracStart == fracEnd)
- throw new NumberFormatException();
-
- // ignore trailing zeroes in fraction part
- /*while (fracEnd > fracStart && content.charAt(fracEnd-1) == '0') {
- fracEnd--;
- }*/
-
- // check whether there is non-digit characters in the fraction part
- for (int fracPos = fracStart; fracPos < fracEnd; fracPos++) {
- if (!TypeValidator.isDigit(content.charAt(fracPos)))
- throw new NumberFormatException();
- }
-
- intDigits = intEnd - actualIntStart;
- fracDigits = fracEnd - fracStart;
-
- if (intDigits > 0) {
- ivalue = content.substring(actualIntStart, intEnd);
- }
-
- if (fracDigits > 0) {
- fvalue = content.substring(fracStart, fracEnd);
- if(fracEnd < len) {
- pvalue = Integer.parseInt(content.substring(fracEnd + 1, len));
- }
- }
- totalDigits = intDigits + fracDigits;
- }
-
- // Construct a canonical String representation of this number
- // for the purpose of deriving a hashCode value compliant with
- // equals.
- // The toString representation will be:
- // NaN for NaN, INF for +infinity, -INF for -infinity, 0 for zero,
- // and [1-9].[0-9]*[1-9]?(E[1-9][0-9]*)? for other numbers.
- private static String canonicalToStringForHashCode(String ivalue, String fvalue, int sign, int pvalue) {
- if ("NaN".equals(ivalue)) {
- return "NaN";
- }
- if ("INF".equals(ivalue)) {
- return sign < 0 ? "-INF" : "INF";
- }
- final StringBuilder builder = new StringBuilder();
- final int ilen = ivalue.length();
- final int flen0 = fvalue.length();
- int lastNonZero;
- for (lastNonZero = flen0; lastNonZero > 0 ; lastNonZero--) {
- if (fvalue.charAt(lastNonZero -1 ) != '0') break;
- }
- final int flen = lastNonZero;
- int iStart;
- int exponent = pvalue;
- for (iStart = 0; iStart < ilen; iStart++) {
- if (ivalue.charAt(iStart) != '0') break;
- }
- int fStart = 0;
- if (iStart < ivalue.length()) {
- builder.append(sign == -1 ? "-" : "");
- builder.append(ivalue.charAt(iStart));
- iStart++;
- } else {
- if (flen > 0) {
- for (fStart = 0; fStart < flen; fStart++) {
- if (fvalue.charAt(fStart) != '0') break;
- }
- if (fStart < flen) {
- builder.append(sign == -1 ? "-" : "");
- builder.append(fvalue.charAt(fStart));
- exponent -= ++fStart;
- } else {
- return "0";
- }
- } else {
- return "0";
- }
- }
-
- if (iStart < ilen || fStart < flen) {
- builder.append('.');
- }
- while (iStart < ilen) {
- builder.append(ivalue.charAt(iStart++));
- exponent++;
- }
- while (fStart < flen) {
- builder.append(fvalue.charAt(fStart++));
- }
- if (exponent != 0) {
- builder.append("E").append(exponent);
- }
- return builder.toString();
- }
-
- @Override
- public boolean equals(Object val) {
- if (val == this)
- return true;
-
- if (!(val instanceof XPrecisionDecimal))
- return false;
- XPrecisionDecimal oval = (XPrecisionDecimal)val;
-
- return this.compareTo(oval) == EQUAL;
- }
-
- @Override
- public int hashCode() {
- // There's nothing else we can use easily, because equals could
- // return true for widely different representation of the
- // same number - and we don't have any canonical representation.
- // The problem here is that we must ensure that if two numbers
- // are equals then their hash code must also be equals.
- // hashCode for 1.01E1 should be the same as hashCode for 0.101E2
- // So we call cannonicalToStringForHashCode - which implements an
- // algorithm that invents a normalized string representation
- // for this number, and we return a hash for that.
- return canonicalToStringForHashCode(ivalue, fvalue, sign, pvalue).hashCode();
- }
-
- /**
- * @return
- */
- private int compareFractionalPart(XPrecisionDecimal oval) {
- if(fvalue.equals(oval.fvalue))
- return EQUAL;
-
- StringBuffer temp1 = new StringBuffer(fvalue);
- StringBuffer temp2 = new StringBuffer(oval.fvalue);
-
- truncateTrailingZeros(temp1, temp2);
- return temp1.toString().compareTo(temp2.toString());
- }
-
- private void truncateTrailingZeros(StringBuffer fValue, StringBuffer otherFValue) {
- for(int i = fValue.length() - 1;i >= 0; i--)
- if(fValue.charAt(i) == '0')
- fValue.deleteCharAt(i);
- else
- break;
-
- for(int i = otherFValue.length() - 1;i >= 0; i--)
- if(otherFValue.charAt(i) == '0')
- otherFValue.deleteCharAt(i);
- else
- break;
- }
-
- public int compareTo(XPrecisionDecimal val) {
-
- // seen NaN
- if(sign == 0)
- return INDETERMINATE;
-
- //INF is greater than everything and equal to itself
- if(ivalue.equals("INF") || val.ivalue.equals("INF")) {
- if(ivalue.equals(val.ivalue))
- return EQUAL;
- else if(ivalue.equals("INF"))
- return GREATER_THAN;
- return LESS_THAN;
- }
-
- //-INF is smaller than everything and equal itself
- if(ivalue.equals("-INF") || val.ivalue.equals("-INF")) {
- if(ivalue.equals(val.ivalue))
- return EQUAL;
- else if(ivalue.equals("-INF"))
- return LESS_THAN;
- return GREATER_THAN;
- }
-
- if (sign != val.sign)
- return sign > val.sign ? GREATER_THAN : LESS_THAN;
-
- return sign * compare(val);
- }
-
- // To enable comparison - the exponent part of the decimal will be limited
- // to the max value of int.
- private int compare(XPrecisionDecimal val) {
-
- if(pvalue != 0 || val.pvalue != 0) {
- if(pvalue == val.pvalue)
- return intComp(val);
- else {
-
- if(intDigits + pvalue != val.intDigits + val.pvalue)
- return intDigits + pvalue > val.intDigits + val.pvalue ? GREATER_THAN : LESS_THAN;
-
- //otherwise the 2 combined values are the same
- if(pvalue > val.pvalue) {
- int expDiff = pvalue - val.pvalue;
- StringBuffer buffer = new StringBuffer(ivalue);
- StringBuffer fbuffer = new StringBuffer(fvalue);
- for(int i = 0;i < expDiff; i++) {
- if(i < fracDigits) {
- buffer.append(fvalue.charAt(i));
- fbuffer.deleteCharAt(i);
- }
- else
- buffer.append('0');
- }
- return compareDecimal(buffer.toString(), val.ivalue, fbuffer.toString(), val.fvalue);
- }
- else {
- int expDiff = val.pvalue - pvalue;
- StringBuffer buffer = new StringBuffer(val.ivalue);
- StringBuffer fbuffer = new StringBuffer(val.fvalue);
- for(int i = 0;i < expDiff; i++) {
- if(i < val.fracDigits) {
- buffer.append(val.fvalue.charAt(i));
- fbuffer.deleteCharAt(i);
- }
- else
- buffer.append('0');
- }
- return compareDecimal(ivalue, buffer.toString(), fvalue, fbuffer.toString());
- }
- }
- }
- else {
- return intComp(val);
- }
- }
-
- /**
- * @param val
- * @return
- */
- private int intComp(XPrecisionDecimal val) {
- if (intDigits != val.intDigits)
- return intDigits > val.intDigits ? GREATER_THAN : LESS_THAN;
-
- return compareDecimal(ivalue, val.ivalue, fvalue, val.fvalue);
- }
-
- /**
- * @param val
- * @return
- */
- private int compareDecimal(String iValue, String fValue, String otherIValue, String otherFValue) {
- int ret = iValue.compareTo(otherIValue);
- if (ret != 0)
- return ret > 0 ? GREATER_THAN : LESS_THAN;
-
- if(fValue.equals(otherFValue))
- return EQUAL;
-
- StringBuffer temp1=new StringBuffer(fValue);
- StringBuffer temp2=new StringBuffer(otherFValue);
-
- truncateTrailingZeros(temp1, temp2);
- ret = temp1.toString().compareTo(temp2.toString());
- return ret == 0 ? EQUAL : (ret > 0 ? GREATER_THAN : LESS_THAN);
- }
-
- private String canonical;
-
- @Override
- public synchronized String toString() {
- if (canonical == null) {
- makeCanonical();
- }
- return canonical;
- }
-
- private void makeCanonical() {
- // REVISIT: to be determined by working group
- canonical = "TBD by Working Group";
- }
-
- /**
- * @param decimal
- * @return
- */
- public boolean isIdentical(XPrecisionDecimal decimal) {
- if(ivalue.equals(decimal.ivalue) && (ivalue.equals("INF") || ivalue.equals("-INF") || ivalue.equals("NaN")))
- return true;
-
- if(sign == decimal.sign && intDigits == decimal.intDigits && fracDigits == decimal.fracDigits && pvalue == decimal.pvalue
- && ivalue.equals(decimal.ivalue) && fvalue.equals(decimal.fvalue))
- return true;
- return false;
- }
-
- }
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.impl.dv.xs.TypeValidator#getAllowedFacets()
- */
- @Override
- public short getAllowedFacets() {
- return ( XSSimpleTypeDecl.FACET_PATTERN | XSSimpleTypeDecl.FACET_WHITESPACE | XSSimpleTypeDecl.FACET_ENUMERATION |XSSimpleTypeDecl.FACET_MAXINCLUSIVE |XSSimpleTypeDecl.FACET_MININCLUSIVE | XSSimpleTypeDecl.FACET_MAXEXCLUSIVE | XSSimpleTypeDecl.FACET_MINEXCLUSIVE | XSSimpleTypeDecl.FACET_TOTALDIGITS | XSSimpleTypeDecl.FACET_FRACTIONDIGITS);
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.impl.dv.xs.TypeValidator#getActualValue(java.lang.String, com.sun.org.apache.xerces.internal.impl.dv.ValidationContext)
- */
- @Override
- public Object getActualValue(String content, ValidationContext context)
- throws InvalidDatatypeValueException {
- try {
- return new XPrecisionDecimal(content);
- } catch (NumberFormatException nfe) {
- throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "precisionDecimal"});
- }
- }
-
- @Override
- public int compare(Object value1, Object value2) {
- return ((XPrecisionDecimal)value1).compareTo((XPrecisionDecimal)value2);
- }
-
- @Override
- public int getFractionDigits(Object value) {
- return ((XPrecisionDecimal)value).fracDigits;
- }
-
- @Override
- public int getTotalDigits(Object value) {
- return ((XPrecisionDecimal)value).totalDigits;
- }
-
- @Override
- public boolean isIdentical(Object value1, Object value2) {
- if(!(value2 instanceof XPrecisionDecimal) || !(value1 instanceof XPrecisionDecimal))
- return false;
- return ((XPrecisionDecimal)value1).isIdentical((XPrecisionDecimal)value2);
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/QNameDV.java b/src/com/sun/org/apache/xerces/internal/impl/dv/xs/QNameDV.java
deleted file mode 100644
index 347e104..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/QNameDV.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.xs;
-
-import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException;
-import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
-import com.sun.org.apache.xerces.internal.util.XMLChar;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xs.datatypes.XSQName;
-
-/**
- * Represent the schema type "QName" and "NOTATION"
- *
- * @xerces.internal
- *
- * @author Neeraj Bajaj, Sun Microsystems, inc.
- * @author Sandy Gao, IBM
- *
- */
-public class QNameDV extends TypeValidator {
-
- private static final String EMPTY_STRING = "".intern();
-
- public short getAllowedFacets() {
- return (XSSimpleTypeDecl.FACET_LENGTH | XSSimpleTypeDecl.FACET_MINLENGTH | XSSimpleTypeDecl.FACET_MAXLENGTH | XSSimpleTypeDecl.FACET_PATTERN | XSSimpleTypeDecl.FACET_ENUMERATION | XSSimpleTypeDecl.FACET_WHITESPACE);
- }
-
- public Object getActualValue(String content, ValidationContext context)
- throws InvalidDatatypeValueException {
-
- // "prefix:localpart" or "localpart"
- // get prefix and local part out of content
- String prefix, localpart;
- int colonptr = content.indexOf(":");
- if (colonptr > 0) {
- prefix = context.getSymbol(content.substring(0,colonptr));
- localpart = content.substring(colonptr+1);
- } else {
- prefix = EMPTY_STRING;
- localpart = content;
- }
-
- // both prefix (if any) a nd localpart must be valid NCName
- if (prefix.length() > 0 && !XMLChar.isValidNCName(prefix))
- throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "QName"});
-
- if(!XMLChar.isValidNCName(localpart))
- throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "QName"});
-
- // resove prefix to a uri, report an error if failed
- String uri = context.getURI(prefix);
- if (prefix.length() > 0 && uri == null)
- throw new InvalidDatatypeValueException("UndeclaredPrefix", new Object[]{content, prefix});
-
- return new XQName(prefix, context.getSymbol(localpart), context.getSymbol(content), uri);
-
- }
-
- // REVISIT: qname and notation shouldn't support length facets.
- // now we just return the length of the rawname
- public int getDataLength(Object value) {
- return ((XQName)value).rawname.length();
- }
-
- /**
- * represent QName data
- */
- private static final class XQName extends QName implements XSQName {
- /** Constructs a QName with the specified values. */
- public XQName(String prefix, String localpart, String rawname, String uri) {
- setValues(prefix, localpart, rawname, uri);
- } // <init>(String,String,String,String)
-
- /** Returns true if the two objects are equal. */
- public boolean equals(Object object) {
- if (object instanceof QName) {
- QName qname = (QName)object;
- return uri == qname.uri && localpart == qname.localpart;
- }
- return false;
- } // equals(Object):boolean
-
- public synchronized String toString() {
- return rawname;
- }
- public javax.xml.namespace.QName getJAXPQName() {
- return new javax.xml.namespace.QName(uri, localpart, prefix);
- }
- public QName getXNIQName() {
- return this;
- }
- }
-} // class QNameDVDV
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/SchemaDVFactoryImpl.java b/src/com/sun/org/apache/xerces/internal/impl/dv/xs/SchemaDVFactoryImpl.java
deleted file mode 100644
index 3e0570b..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/SchemaDVFactoryImpl.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.xs;
-
-
-import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType;
-import com.sun.org.apache.xerces.internal.util.SymbolHash;
-
-/**
- * the factory to create/return built-in schema DVs and create user-defined DVs
- *
- * @xerces.internal
- *
- * @author Neeraj Bajaj, Sun Microsystems, inc.
- * @author Sandy Gao, IBM
- *
- * @version $Id: SchemaDVFactoryImpl.java,v 1.7 2010-11-01 04:39:47 joehw Exp $
- */
-public class SchemaDVFactoryImpl extends BaseSchemaDVFactory {
-
- static final SymbolHash fBuiltInTypes = new SymbolHash();
-
- static {
- createBuiltInTypes();
- }
-
- // create all built-in types
- static void createBuiltInTypes() {
- createBuiltInTypes(fBuiltInTypes, XSSimpleTypeDecl.fAnySimpleType);
-
- // TODO: move specific 1.0 DV implementation from base
- } //createBuiltInTypes()
-
- /**
- * Get a built-in simple type of the given name
- * REVISIT: its still not decided within the Schema WG how to define the
- * ur-types and if all simple types should be derived from a
- * complex type, so as of now we ignore the fact that anySimpleType
- * is derived from anyType, and pass 'null' as the base of
- * anySimpleType. It needs to be changed as per the decision taken.
- *
- * @param name the name of the datatype
- * @return the datatype validator of the given name
- */
- public XSSimpleType getBuiltInType(String name) {
- return (XSSimpleType)fBuiltInTypes.get(name);
- }
-
- /**
- * get all built-in simple types, which are stored in a hashtable keyed by
- * the name
- *
- * @return a hashtable which contains all built-in simple types
- */
- public SymbolHash getBuiltInTypes() {
- return (SymbolHash)fBuiltInTypes.makeClone();
- }
-
-}//SchemaDVFactoryImpl
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/SchemaDateTimeException.java b/src/com/sun/org/apache/xerces/internal/impl/dv/xs/SchemaDateTimeException.java
deleted file mode 100644
index 917ec59..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/SchemaDateTimeException.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.xs;
-
-/**
- * @xerces.internal
- *
- */
-public class SchemaDateTimeException extends RuntimeException {
-
- /** Serialization version. */
- static final long serialVersionUID = -8520832235337769040L;
-
- public SchemaDateTimeException () {
- super();
- }
-
- public SchemaDateTimeException (String s) {
- super (s);
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/StringDV.java b/src/com/sun/org/apache/xerces/internal/impl/dv/xs/StringDV.java
deleted file mode 100644
index 010bc1b..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/StringDV.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.xs;
-
-import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException;
-import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
-
-/**
- * Represent the schema type "string"
- *
- * @xerces.internal
- *
- * @author Neeraj Bajaj, Sun Microsystems, inc.
- * @author Sandy Gao, IBM
- *
- */
-public class StringDV extends TypeValidator {
-
- public short getAllowedFacets(){
- return (XSSimpleTypeDecl.FACET_LENGTH | XSSimpleTypeDecl.FACET_MINLENGTH | XSSimpleTypeDecl.FACET_MAXLENGTH | XSSimpleTypeDecl.FACET_PATTERN | XSSimpleTypeDecl.FACET_ENUMERATION | XSSimpleTypeDecl.FACET_WHITESPACE );
- }
-
- public Object getActualValue(String content, ValidationContext context)
- throws InvalidDatatypeValueException {
- return content;
- }
-
-} // class StringDV
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/TimeDV.java b/src/com/sun/org/apache/xerces/internal/impl/dv/xs/TimeDV.java
deleted file mode 100644
index c9bbae2..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/TimeDV.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.xs;
-
-import javax.xml.datatype.DatatypeConstants;
-import javax.xml.datatype.XMLGregorianCalendar;
-
-import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException;
-import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
-
-/**
- * Validator for &lt;time&gt; datatype (W3C Schema Datatypes)
- *
- * @xerces.internal
- *
- * @author Elena Litani
- * @author Gopal Sharma, SUN Microsystem Inc.
- *
- * @version $Id: TimeDV.java,v 1.7 2010-11-01 04:39:47 joehw Exp $
- */
-public class TimeDV extends AbstractDateTimeDV {
-
- /**
- * Convert a string to a compiled form
- *
- * @param content The lexical representation of time
- * @return a valid and normalized time object
- */
- public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException{
- try{
- return parse(content);
- } catch(Exception ex){
- throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "time"});
- }
- }
-
- /**
- * Parses, validates and computes normalized version of time object
- *
- * @param str The lexical representation of time object hh:mm:ss.sss
- * with possible time zone Z or (-),(+)hh:mm
- * Pattern: "(\\d\\d):(\\d\\d):(\\d\\d)(\\.(\\d)*)?(Z|(([-+])(\\d\\d)(:(\\d\\d))?))?")
- * @return normalized time representation
- * @exception SchemaDateTimeException Invalid lexical representation
- */
- protected DateTimeData parse(String str) throws SchemaDateTimeException{
- DateTimeData date = new DateTimeData(str, this);
- int len = str.length();
-
- // time
- // initialize to default values
- date.year=YEAR;
- date.month=MONTH;
- date.day=15;
- getTime(str, 0, len, date);
-
- //validate and normalize
-
- validateDateTime(date);
-
- //save unnormalized values
- saveUnnormalized(date);
-
- if ( date.utc!=0 && date.utc != 'Z') {
- normalize(date);
- }
- date.position = 2;
- return date;
- }
-
- /**
- * Converts time object representation to String
- *
- * @param date time object
- * @return lexical representation of time: hh:mm:ss.sss with an optional time zone sign
- */
- protected String dateToString(DateTimeData date) {
- StringBuffer message = new StringBuffer(16);
- append(message, date.hour, 2);
- message.append(':');
- append(message, date.minute, 2);
- message.append(':');
- append(message, date.second);
-
- append(message, (char)date.utc, 0);
- return message.toString();
- }
-
- protected XMLGregorianCalendar getXMLGregorianCalendar(DateTimeData date) {
- return datatypeFactory.newXMLGregorianCalendar(null, DatatypeConstants.FIELD_UNDEFINED,
- DatatypeConstants.FIELD_UNDEFINED, date.unNormHour, date.unNormMinute,
- (int)date.unNormSecond, date.unNormSecond != 0 ? getFractionalSecondsAsBigDecimal(date) : null,
- date.hasTimeZone() ? (date.timezoneHr * 60 + date.timezoneMin) : DatatypeConstants.FIELD_UNDEFINED);
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/TypeValidator.java b/src/com/sun/org/apache/xerces/internal/impl/dv/xs/TypeValidator.java
deleted file mode 100644
index 989902d..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/TypeValidator.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.xs;
-
-import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException;
-import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
-
-/**
- * All primitive types plus ID/IDREF/ENTITY/INTEGER are derived from this abstract
- * class. It provides extra information XSSimpleTypeDecl requires from each
- * type: allowed facets, converting String to actual value, check equality,
- * comparison, etc.
- *
- * @xerces.internal
- *
- * @author Neeraj Bajaj, Sun Microsystems, inc.
- * @author Sandy Gao, IBM
- *
- */
-public abstract class TypeValidator {
-
- // which facets are allowed for this type
- public abstract short getAllowedFacets();
-
- // convert a string to an actual value. for example,
- // for number types (decimal, double, float, and types derived from them),
- // get the BigDecimal, Double, Flout object.
- // for some types (string and derived), they just return the string itself
- public abstract Object getActualValue(String content, ValidationContext context)
- throws InvalidDatatypeValueException;
-
- // for ID/IDREF/ENTITY types, do some extra checking after the value is
- // checked to be valid with respect to both lexical representation and
- // facets
- public void checkExtraRules(Object value, ValidationContext context) throws InvalidDatatypeValueException {
- }
-
- // the following methods might not be supported by every DV.
- // but XSSimpleTypeDecl should know which type supports which methods,
- // and it's an *internal* error if a method is called on a DV that
- // doesn't support it.
-
- //order constants
- public static final short LESS_THAN = -1;
- public static final short EQUAL = 0;
- public static final short GREATER_THAN = 1;
- public static final short INDETERMINATE = 2;
-
- // where there is distinction between identity and equality, this method
- // will be overwritten
- // checks whether the two values are identical; for ex, this distinguishes
- // -0.0 from 0.0
- public boolean isIdentical (Object value1, Object value2) {
- return value1.equals(value2);
- }
-
- // check the order relation between the two values
- // the parameters are in compiled form (from getActualValue)
- public int compare(Object value1, Object value2) {
- return -1;
- }
-
- // get the length of the value
- // the parameters are in compiled form (from getActualValue)
- public int getDataLength(Object value) {
- return (value instanceof String) ? ((String)value).length() : -1;
- }
-
- // get the number of digits of the value
- // the parameters are in compiled form (from getActualValue)
- public int getTotalDigits(Object value) {
- return -1;
- }
-
- // get the number of fraction digits of the value
- // the parameters are in compiled form (from getActualValue)
- public int getFractionDigits(Object value) {
- return -1;
- }
-
- // check whether the character is in the range 0x30 ~ 0x39
- public static final boolean isDigit(char ch) {
- return ch >= '0' && ch <= '9';
- }
-
- // if the character is in the range 0x30 ~ 0x39, return its int value (0~9),
- // otherwise, return -1
- public static final int getDigit(char ch) {
- return isDigit(ch) ? ch - '0' : -1;
- }
-
-} // interface TypeValidator
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/UnionDV.java b/src/com/sun/org/apache/xerces/internal/impl/dv/xs/UnionDV.java
deleted file mode 100644
index 0a29639..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/UnionDV.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.xs;
-
-import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException;
-import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
-
-/**
- * Represent the schema union types
- *
- * @xerces.internal
- *
- * @author Neeraj Bajaj, Sun Microsystems, inc.
- * @author Sandy Gao, IBM
- *
- */
-public class UnionDV extends TypeValidator{
-
- public short getAllowedFacets(){
- return (XSSimpleTypeDecl.FACET_PATTERN | XSSimpleTypeDecl.FACET_ENUMERATION );
- }
-
- // this method should never be called: XSSimpleTypeDecl is responsible for
- // calling the member types for the convertion
- public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException{
- return content;
- }
-
-} // class UnionDV
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/XSSimpleTypeDecl.java b/src/com/sun/org/apache/xerces/internal/impl/dv/xs/XSSimpleTypeDecl.java
deleted file mode 100644
index c9c9134..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/XSSimpleTypeDecl.java
+++ /dev/null
@@ -1,3398 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.xs;
-
-import java.util.AbstractList;
-import java.util.Locale;
-import java.util.StringTokenizer;
-import java.util.Vector;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.dv.DatatypeException;
-import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeFacetException;
-import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException;
-import com.sun.org.apache.xerces.internal.impl.dv.ValidatedInfo;
-import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
-import com.sun.org.apache.xerces.internal.impl.dv.XSFacets;
-import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType;
-import com.sun.org.apache.xerces.internal.impl.xpath.regex.RegularExpression;
-import com.sun.org.apache.xerces.internal.impl.xpath.regex.ParseException;
-import com.sun.org.apache.xerces.internal.impl.xs.SchemaSymbols;
-import com.sun.org.apache.xerces.internal.impl.xs.util.ShortListImpl;
-import com.sun.org.apache.xerces.internal.impl.xs.util.StringListImpl;
-import com.sun.org.apache.xerces.internal.impl.xs.util.XSObjectListImpl;
-import com.sun.org.apache.xerces.internal.util.XMLChar;
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-import com.sun.org.apache.xerces.internal.xs.ShortList;
-import com.sun.org.apache.xerces.internal.xs.StringList;
-import com.sun.org.apache.xerces.internal.xs.XSAnnotation;
-import com.sun.org.apache.xerces.internal.xs.XSConstants;
-import com.sun.org.apache.xerces.internal.xs.XSFacet;
-import com.sun.org.apache.xerces.internal.xs.XSMultiValueFacet;
-import com.sun.org.apache.xerces.internal.xs.XSNamespaceItem;
-import com.sun.org.apache.xerces.internal.xs.XSObjectList;
-import com.sun.org.apache.xerces.internal.xs.XSSimpleTypeDefinition;
-import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
-import com.sun.org.apache.xerces.internal.xs.datatypes.ObjectList;
-import org.w3c.dom.TypeInfo;
-
-/**
- * @xerces.internal
- *
- * @author Sandy Gao, IBM
- * @author Neeraj Bajaj, Sun Microsystems, inc.
- *
- * @version $Id: XSSimpleTypeDecl.java 3029 2011-04-24 17:50:18Z joehw $
- */
-public class XSSimpleTypeDecl implements XSSimpleType, TypeInfo {
-
- protected static final short DV_STRING = PRIMITIVE_STRING;
- protected static final short DV_BOOLEAN = PRIMITIVE_BOOLEAN;
- protected static final short DV_DECIMAL = PRIMITIVE_DECIMAL;
- protected static final short DV_FLOAT = PRIMITIVE_FLOAT;
- protected static final short DV_DOUBLE = PRIMITIVE_DOUBLE;
- protected static final short DV_DURATION = PRIMITIVE_DURATION;
- protected static final short DV_DATETIME = PRIMITIVE_DATETIME;
- protected static final short DV_TIME = PRIMITIVE_TIME;
- protected static final short DV_DATE = PRIMITIVE_DATE;
- protected static final short DV_GYEARMONTH = PRIMITIVE_GYEARMONTH;
- protected static final short DV_GYEAR = PRIMITIVE_GYEAR;
- protected static final short DV_GMONTHDAY = PRIMITIVE_GMONTHDAY;
- protected static final short DV_GDAY = PRIMITIVE_GDAY;
- protected static final short DV_GMONTH = PRIMITIVE_GMONTH;
- protected static final short DV_HEXBINARY = PRIMITIVE_HEXBINARY;
- protected static final short DV_BASE64BINARY = PRIMITIVE_BASE64BINARY;
- protected static final short DV_ANYURI = PRIMITIVE_ANYURI;
- protected static final short DV_QNAME = PRIMITIVE_QNAME;
- protected static final short DV_PRECISIONDECIMAL = PRIMITIVE_PRECISIONDECIMAL;
- protected static final short DV_NOTATION = PRIMITIVE_NOTATION;
-
- protected static final short DV_ANYSIMPLETYPE = 0;
- protected static final short DV_ID = DV_NOTATION + 1;
- protected static final short DV_IDREF = DV_NOTATION + 2;
- protected static final short DV_ENTITY = DV_NOTATION + 3;
- protected static final short DV_INTEGER = DV_NOTATION + 4;
- protected static final short DV_LIST = DV_NOTATION + 5;
- protected static final short DV_UNION = DV_NOTATION + 6;
- protected static final short DV_YEARMONTHDURATION = DV_NOTATION + 7;
- protected static final short DV_DAYTIMEDURATION = DV_NOTATION + 8;
- protected static final short DV_ANYATOMICTYPE = DV_NOTATION + 9;
-
- private static final TypeValidator[] gDVs = {
- new AnySimpleDV(),
- new StringDV(),
- new BooleanDV(),
- new DecimalDV(),
- new FloatDV(),
- new DoubleDV(),
- new DurationDV(),
- new DateTimeDV(),
- new TimeDV(),
- new DateDV(),
- new YearMonthDV(),
- new YearDV(),
- new MonthDayDV(),
- new DayDV(),
- new MonthDV(),
- new HexBinaryDV(),
- new Base64BinaryDV(),
- new AnyURIDV(),
- new QNameDV(),
- new PrecisionDecimalDV(), // XML Schema 1.1 type
- new QNameDV(), // notation use the same one as qname
- new IDDV(),
- new IDREFDV(),
- new EntityDV(),
- new IntegerDV(),
- new ListDV(),
- new UnionDV(),
- new YearMonthDurationDV(), // XML Schema 1.1 type
- new DayTimeDurationDV(), // XML Schema 1.1 type
- new AnyAtomicDV() // XML Schema 1.1 type
- };
-
- static final short NORMALIZE_NONE = 0;
- static final short NORMALIZE_TRIM = 1;
- static final short NORMALIZE_FULL = 2;
- static final short[] fDVNormalizeType = {
- NORMALIZE_NONE, //AnySimpleDV(),
- NORMALIZE_FULL, //StringDV(),
- NORMALIZE_TRIM, //BooleanDV(),
- NORMALIZE_TRIM, //DecimalDV(),
- NORMALIZE_TRIM, //FloatDV(),
- NORMALIZE_TRIM, //DoubleDV(),
- NORMALIZE_TRIM, //DurationDV(),
- NORMALIZE_TRIM, //DateTimeDV(),
- NORMALIZE_TRIM, //TimeDV(),
- NORMALIZE_TRIM, //DateDV(),
- NORMALIZE_TRIM, //YearMonthDV(),
- NORMALIZE_TRIM, //YearDV(),
- NORMALIZE_TRIM, //MonthDayDV(),
- NORMALIZE_TRIM, //DayDV(),
- NORMALIZE_TRIM, //MonthDV(),
- NORMALIZE_TRIM, //HexBinaryDV(),
- NORMALIZE_NONE, //Base64BinaryDV(), // Base64 know how to deal with spaces
- NORMALIZE_TRIM, //AnyURIDV(),
- NORMALIZE_TRIM, //QNameDV(),
- NORMALIZE_TRIM, //PrecisionDecimalDV() (Schema 1.1)
- NORMALIZE_TRIM, //QNameDV(), // notation
- NORMALIZE_TRIM, //IDDV(),
- NORMALIZE_TRIM, //IDREFDV(),
- NORMALIZE_TRIM, //EntityDV(),
- NORMALIZE_TRIM, //IntegerDV(),
- NORMALIZE_FULL, //ListDV(),
- NORMALIZE_NONE, //UnionDV(),
- NORMALIZE_TRIM, //YearMonthDurationDV() (Schema 1.1)
- NORMALIZE_TRIM, //DayTimeDurationDV() (Schema 1.1)
- NORMALIZE_NONE, //AnyAtomicDV() (Schema 1.1)
- };
-
- static final short SPECIAL_PATTERN_NONE = 0;
- static final short SPECIAL_PATTERN_NMTOKEN = 1;
- static final short SPECIAL_PATTERN_NAME = 2;
- static final short SPECIAL_PATTERN_NCNAME = 3;
-
- static final String[] SPECIAL_PATTERN_STRING = {
- "NONE", "NMTOKEN", "Name", "NCName"
- };
-
- static final String[] WS_FACET_STRING = {
- "preserve", "replace", "collapse"
- };
-
- static final String URI_SCHEMAFORSCHEMA = "http://www.w3.org/2001/XMLSchema";
- static final String ANY_TYPE = "anyType";
-
- // XML Schema 1.1 type constants
- public static final short YEARMONTHDURATION_DT = 46;
- public static final short DAYTIMEDURATION_DT = 47;
- public static final short PRECISIONDECIMAL_DT = 48;
- public static final short ANYATOMICTYPE_DT = 49;
-
- // DOM Level 3 TypeInfo Derivation Method constants
- static final int DERIVATION_ANY = 0;
- static final int DERIVATION_RESTRICTION = 1;
- static final int DERIVATION_EXTENSION = 2;
- static final int DERIVATION_UNION = 4;
- static final int DERIVATION_LIST = 8;
-
- static final ValidationContext fEmptyContext = new ValidationContext() {
- public boolean needFacetChecking() {
- return true;
- }
- public boolean needExtraChecking() {
- return false;
- }
- public boolean needToNormalize() {
- return true;
- }
- public boolean useNamespaces () {
- return true;
- }
- public boolean isEntityDeclared (String name) {
- return false;
- }
- public boolean isEntityUnparsed (String name) {
- return false;
- }
- public boolean isIdDeclared (String name) {
- return false;
- }
- public void addId(String name) {
- }
- public void addIdRef(String name) {
- }
- public String getSymbol (String symbol) {
- return symbol.intern();
- }
- public String getURI(String prefix) {
- return null;
- }
- public Locale getLocale() {
- return Locale.getDefault();
- }
- };
-
- protected static TypeValidator[] getGDVs() {
- return (TypeValidator[])gDVs.clone();
- }
- private TypeValidator[] fDVs = gDVs;
- protected void setDVs(TypeValidator[] dvs) {
- fDVs = dvs;
- }
-
- // this will be true if this is a static XSSimpleTypeDecl
- // and hence must remain immutable (i.e., applyFacets
- // may not be permitted to have any effect).
- private boolean fIsImmutable = false;
-
- private XSSimpleTypeDecl fItemType;
- private XSSimpleTypeDecl[] fMemberTypes;
- // The most specific built-in type kind.
- private short fBuiltInKind;
-
- private String fTypeName;
- private String fTargetNamespace;
- private short fFinalSet = 0;
- private XSSimpleTypeDecl fBase;
- private short fVariety = -1;
- private short fValidationDV = -1;
-
- private short fFacetsDefined = 0;
- private short fFixedFacet = 0;
-
- //for constraining facets
- private short fWhiteSpace = 0;
- private int fLength = -1;
- private int fMinLength = -1;
- private int fMaxLength = -1;
- private int fTotalDigits = -1;
- private int fFractionDigits = -1;
- private Vector fPattern;
- private Vector fPatternStr;
- private Vector fEnumeration;
- private short[] fEnumerationType;
- private ShortList[] fEnumerationItemType; // used in case fenumerationType value is LIST or LISTOFUNION
- private ShortList fEnumerationTypeList;
- private ObjectList fEnumerationItemTypeList;
- private StringList fLexicalPattern;
- private StringList fLexicalEnumeration;
- private ObjectList fActualEnumeration;
- private Object fMaxInclusive;
- private Object fMaxExclusive;
- private Object fMinExclusive;
- private Object fMinInclusive;
-
- // annotations for constraining facets
- public XSAnnotation lengthAnnotation;
- public XSAnnotation minLengthAnnotation;
- public XSAnnotation maxLengthAnnotation;
- public XSAnnotation whiteSpaceAnnotation;
- public XSAnnotation totalDigitsAnnotation;
- public XSAnnotation fractionDigitsAnnotation;
- public XSObjectListImpl patternAnnotations;
- public XSObjectList enumerationAnnotations;
- public XSAnnotation maxInclusiveAnnotation;
- public XSAnnotation maxExclusiveAnnotation;
- public XSAnnotation minInclusiveAnnotation;
- public XSAnnotation minExclusiveAnnotation;
-
- // facets as objects
- private XSObjectListImpl fFacets;
-
- // enumeration and pattern facets
- private XSObjectListImpl fMultiValueFacets;
-
- // simpleType annotations
- private XSObjectList fAnnotations = null;
-
- private short fPatternType = SPECIAL_PATTERN_NONE;
-
- // for fundamental facets
- private short fOrdered;
- private boolean fFinite;
- private boolean fBounded;
- private boolean fNumeric;
-
- // The namespace schema information item corresponding to the target namespace
- // of the simple type definition, if it is globally declared; or null otherwise.
- private XSNamespaceItem fNamespaceItem = null;
-
- // default constructor
- public XSSimpleTypeDecl(){}
-
- //Create a new built-in primitive types (and id/idref/entity/integer/yearMonthDuration)
- protected XSSimpleTypeDecl(XSSimpleTypeDecl base, String name, short validateDV,
- short ordered, boolean bounded, boolean finite,
- boolean numeric, boolean isImmutable, short builtInKind) {
- fIsImmutable = isImmutable;
- fBase = base;
- fTypeName = name;
- fTargetNamespace = URI_SCHEMAFORSCHEMA;
- // To simplify the code for anySimpleType, we treat it as an atomic type
- fVariety = VARIETY_ATOMIC;
- fValidationDV = validateDV;
- fFacetsDefined = FACET_WHITESPACE;
- if (validateDV == DV_ANYSIMPLETYPE ||
- validateDV == DV_ANYATOMICTYPE ||
- validateDV == DV_STRING) {
- fWhiteSpace = WS_PRESERVE;
- }
- else {
- fWhiteSpace = WS_COLLAPSE;
- fFixedFacet = FACET_WHITESPACE;
- }
- this.fOrdered = ordered;
- this.fBounded = bounded;
- this.fFinite = finite;
- this.fNumeric = numeric;
- fAnnotations = null;
-
- // Specify the build in kind for this primitive type
- fBuiltInKind = builtInKind;
- }
-
- //Create a new simple type for restriction for built-in types
- protected XSSimpleTypeDecl(XSSimpleTypeDecl base, String name, String uri, short finalSet, boolean isImmutable,
- XSObjectList annotations, short builtInKind) {
- this(base, name, uri, finalSet, isImmutable, annotations);
- // Specify the build in kind for this built-in type
- fBuiltInKind = builtInKind;
- }
-
- //Create a new simple type for restriction.
- protected XSSimpleTypeDecl(XSSimpleTypeDecl base, String name, String uri, short finalSet, boolean isImmutable,
- XSObjectList annotations) {
- fBase = base;
- fTypeName = name;
- fTargetNamespace = uri;
- fFinalSet = finalSet;
- fAnnotations = annotations;
-
- fVariety = fBase.fVariety;
- fValidationDV = fBase.fValidationDV;
- switch (fVariety) {
- case VARIETY_ATOMIC:
- break;
- case VARIETY_LIST:
- fItemType = fBase.fItemType;
- break;
- case VARIETY_UNION:
- fMemberTypes = fBase.fMemberTypes;
- break;
- }
-
- // always inherit facets from the base.
- // in case a type is created, but applyFacets is not called
- fLength = fBase.fLength;
- fMinLength = fBase.fMinLength;
- fMaxLength = fBase.fMaxLength;
- fPattern = fBase.fPattern;
- fPatternStr = fBase.fPatternStr;
- fEnumeration = fBase.fEnumeration;
- fEnumerationType = fBase.fEnumerationType;
- fEnumerationItemType = fBase.fEnumerationItemType;
- fWhiteSpace = fBase.fWhiteSpace;
- fMaxExclusive = fBase.fMaxExclusive;
- fMaxInclusive = fBase.fMaxInclusive;
- fMinExclusive = fBase.fMinExclusive;
- fMinInclusive = fBase.fMinInclusive;
- fTotalDigits = fBase.fTotalDigits;
- fFractionDigits = fBase.fFractionDigits;
- fPatternType = fBase.fPatternType;
- fFixedFacet = fBase.fFixedFacet;
- fFacetsDefined = fBase.fFacetsDefined;
-
- // always inherit facet annotations in case applyFacets is not called.
- lengthAnnotation = fBase.lengthAnnotation;
- minLengthAnnotation = fBase.minLengthAnnotation;
- maxLengthAnnotation = fBase.maxLengthAnnotation;
- patternAnnotations = fBase.patternAnnotations;
- enumerationAnnotations = fBase.enumerationAnnotations;
- whiteSpaceAnnotation = fBase.whiteSpaceAnnotation;
- maxExclusiveAnnotation = fBase.maxExclusiveAnnotation;
- maxInclusiveAnnotation = fBase.maxInclusiveAnnotation;
- minExclusiveAnnotation = fBase.minExclusiveAnnotation;
- minInclusiveAnnotation = fBase.minInclusiveAnnotation;
- totalDigitsAnnotation = fBase.totalDigitsAnnotation;
- fractionDigitsAnnotation = fBase.fractionDigitsAnnotation;
-
- //we also set fundamental facets information in case applyFacets is not called.
- calcFundamentalFacets();
- fIsImmutable = isImmutable;
-
- // Inherit from the base type
- fBuiltInKind = base.fBuiltInKind;
- }
-
- //Create a new simple type for list.
- protected XSSimpleTypeDecl(String name, String uri, short finalSet, XSSimpleTypeDecl itemType, boolean isImmutable,
- XSObjectList annotations) {
- fBase = fAnySimpleType;
- fTypeName = name;
- fTargetNamespace = uri;
- fFinalSet = finalSet;
- fAnnotations = annotations;
-
- fVariety = VARIETY_LIST;
- fItemType = (XSSimpleTypeDecl)itemType;
- fValidationDV = DV_LIST;
- fFacetsDefined = FACET_WHITESPACE;
- fFixedFacet = FACET_WHITESPACE;
- fWhiteSpace = WS_COLLAPSE;
-
- //setting fundamental facets
- calcFundamentalFacets();
- fIsImmutable = isImmutable;
-
- // Values of this type are lists
- fBuiltInKind = XSConstants.LIST_DT;
- }
-
- //Create a new simple type for union.
- protected XSSimpleTypeDecl(String name, String uri, short finalSet, XSSimpleTypeDecl[] memberTypes,
- XSObjectList annotations) {
- fBase = fAnySimpleType;
- fTypeName = name;
- fTargetNamespace = uri;
- fFinalSet = finalSet;
- fAnnotations = annotations;
-
- fVariety = VARIETY_UNION;
- fMemberTypes = memberTypes;
- fValidationDV = DV_UNION;
- // even for union, we set whitespace to something
- // this will never be used, but we can use fFacetsDefined to check
- // whether applyFacets() is allwwed: it's not allowed
- // if fFacetsDefined != 0
- fFacetsDefined = FACET_WHITESPACE;
- fWhiteSpace = WS_COLLAPSE;
-
- //setting fundamental facets
- calcFundamentalFacets();
- // none of the schema-defined types are unions, so just set
- // fIsImmutable to false.
- fIsImmutable = false;
-
- // No value can be of this type, so it's unavailable.
- fBuiltInKind = XSConstants.UNAVAILABLE_DT;
- }
-
- //set values for restriction.
- protected XSSimpleTypeDecl setRestrictionValues(XSSimpleTypeDecl base, String name, String uri, short finalSet,
- XSObjectList annotations) {
- //decline to do anything if the object is immutable.
- if(fIsImmutable) return null;
- fBase = base;
- fAnonymous = false;
- fTypeName = name;
- fTargetNamespace = uri;
- fFinalSet = finalSet;
- fAnnotations = annotations;
-
- fVariety = fBase.fVariety;
- fValidationDV = fBase.fValidationDV;
- switch (fVariety) {
- case VARIETY_ATOMIC:
- break;
- case VARIETY_LIST:
- fItemType = fBase.fItemType;
- break;
- case VARIETY_UNION:
- fMemberTypes = fBase.fMemberTypes;
- break;
- }
-
- // always inherit facets from the base.
- // in case a type is created, but applyFacets is not called
- fLength = fBase.fLength;
- fMinLength = fBase.fMinLength;
- fMaxLength = fBase.fMaxLength;
- fPattern = fBase.fPattern;
- fPatternStr = fBase.fPatternStr;
- fEnumeration = fBase.fEnumeration;
- fEnumerationType = fBase.fEnumerationType;
- fEnumerationItemType = fBase.fEnumerationItemType;
- fWhiteSpace = fBase.fWhiteSpace;
- fMaxExclusive = fBase.fMaxExclusive;
- fMaxInclusive = fBase.fMaxInclusive;
- fMinExclusive = fBase.fMinExclusive;
- fMinInclusive = fBase.fMinInclusive;
- fTotalDigits = fBase.fTotalDigits;
- fFractionDigits = fBase.fFractionDigits;
- fPatternType = fBase.fPatternType;
- fFixedFacet = fBase.fFixedFacet;
- fFacetsDefined = fBase.fFacetsDefined;
-
- //we also set fundamental facets information in case applyFacets is not called.
- calcFundamentalFacets();
-
- // Inherit from the base type
- fBuiltInKind = base.fBuiltInKind;
-
- return this;
- }
-
- //set values for list.
- protected XSSimpleTypeDecl setListValues(String name, String uri, short finalSet, XSSimpleTypeDecl itemType,
- XSObjectList annotations) {
- //decline to do anything if the object is immutable.
- if(fIsImmutable) return null;
- fBase = fAnySimpleType;
- fAnonymous = false;
- fTypeName = name;
- fTargetNamespace = uri;
- fFinalSet = finalSet;
- fAnnotations = annotations;
-
- fVariety = VARIETY_LIST;
- fItemType = (XSSimpleTypeDecl)itemType;
- fValidationDV = DV_LIST;
- fFacetsDefined = FACET_WHITESPACE;
- fFixedFacet = FACET_WHITESPACE;
- fWhiteSpace = WS_COLLAPSE;
-
- //setting fundamental facets
- calcFundamentalFacets();
-
- // Values of this type are lists
- fBuiltInKind = XSConstants.LIST_DT;
-
- return this;
- }
-
- //set values for union.
- protected XSSimpleTypeDecl setUnionValues(String name, String uri, short finalSet, XSSimpleTypeDecl[] memberTypes,
- XSObjectList annotations) {
- //decline to do anything if the object is immutable.
- if(fIsImmutable) return null;
- fBase = fAnySimpleType;
- fAnonymous = false;
- fTypeName = name;
- fTargetNamespace = uri;
- fFinalSet = finalSet;
- fAnnotations = annotations;
-
- fVariety = VARIETY_UNION;
- fMemberTypes = memberTypes;
- fValidationDV = DV_UNION;
- // even for union, we set whitespace to something
- // this will never be used, but we can use fFacetsDefined to check
- // whether applyFacets() is allwwed: it's not allowed
- // if fFacetsDefined != 0
- fFacetsDefined = FACET_WHITESPACE;
- fWhiteSpace = WS_COLLAPSE;
-
- //setting fundamental facets
- calcFundamentalFacets();
-
- // No value can be of this type, so it's unavailable.
- fBuiltInKind = XSConstants.UNAVAILABLE_DT;
-
- return this;
- }
-
- public short getType () {
- return XSConstants.TYPE_DEFINITION;
- }
-
- public short getTypeCategory () {
- return SIMPLE_TYPE;
- }
-
- public String getName() {
- return getAnonymous()?null:fTypeName;
- }
-
- public String getTypeName() {
- return fTypeName;
- }
-
- public String getNamespace() {
- return fTargetNamespace;
- }
-
- public short getFinal(){
- return fFinalSet;
- }
-
- public boolean isFinal(short derivation) {
- return (fFinalSet & derivation) != 0;
- }
-
- public XSTypeDefinition getBaseType(){
- return fBase;
- }
-
- public boolean getAnonymous() {
- return fAnonymous || (fTypeName == null);
- }
-
- public short getVariety(){
- // for anySimpleType, return absent variaty
- return fValidationDV == DV_ANYSIMPLETYPE ? VARIETY_ABSENT : fVariety;
- }
-
- public boolean isIDType(){
- switch (fVariety) {
- case VARIETY_ATOMIC:
- return fValidationDV == DV_ID;
- case VARIETY_LIST:
- return fItemType.isIDType();
- case VARIETY_UNION:
- for (int i = 0; i < fMemberTypes.length; i++) {
- if (fMemberTypes[i].isIDType())
- return true;
- }
- }
- return false;
- }
-
- public short getWhitespace() throws DatatypeException{
- if (fVariety == VARIETY_UNION) {
- throw new DatatypeException("dt-whitespace", new Object[]{fTypeName});
- }
- return fWhiteSpace;
- }
-
- public short getPrimitiveKind() {
- if (fVariety == VARIETY_ATOMIC && fValidationDV != DV_ANYSIMPLETYPE) {
- if (fValidationDV == DV_ID || fValidationDV == DV_IDREF || fValidationDV == DV_ENTITY) {
- return DV_STRING;
- }
- else if (fValidationDV == DV_INTEGER) {
- return DV_DECIMAL;
- }
- else if (Constants.SCHEMA_1_1_SUPPORT && (fValidationDV == DV_YEARMONTHDURATION || fValidationDV == DV_DAYTIMEDURATION)) {
- return DV_DURATION;
- }
- else {
- return fValidationDV;
- }
- }
- else {
- // REVISIT: error situation. runtime exception?
- return (short)0;
- }
- }
-
- /**
- * Returns the closest built-in type category this type represents or
- * derived from. For example, if this simple type is a built-in derived
- * type integer the <code>INTEGER_DV</code> is returned.
- */
- public short getBuiltInKind() {
- return this.fBuiltInKind;
- }
-
- /**
- * If variety is <code>atomic</code> the primitive type definition (a
- * built-in primitive datatype definition or the simple ur-type
- * definition) is available, otherwise <code>null</code>.
- */
- public XSSimpleTypeDefinition getPrimitiveType() {
- if (fVariety == VARIETY_ATOMIC && fValidationDV != DV_ANYSIMPLETYPE) {
- XSSimpleTypeDecl pri = this;
- // recursively get base, until we reach anySimpleType
- while (pri.fBase != fAnySimpleType)
- pri = pri.fBase;
- return pri;
- }
- else {
- // REVISIT: error situation. runtime exception?
- return null;
- }
- }
-
- /**
- * If variety is <code>list</code> the item type definition (an atomic or
- * union simple type definition) is available, otherwise
- * <code>null</code>.
- */
- public XSSimpleTypeDefinition getItemType() {
- if (fVariety == VARIETY_LIST) {
- return fItemType;
- }
- else {
- // REVISIT: error situation. runtime exception?
- return null;
- }
- }
-
- /**
- * If variety is <code>union</code> the list of member type definitions (a
- * non-empty sequence of simple type definitions) is available,
- * otherwise an empty <code>XSObjectList</code>.
- */
- public XSObjectList getMemberTypes() {
- if (fVariety == VARIETY_UNION) {
- return new XSObjectListImpl(fMemberTypes, fMemberTypes.length);
- }
- else {
- return XSObjectListImpl.EMPTY_LIST;
- }
- }
-
- /**
- * If <restriction> is chosen
- */
- public void applyFacets(XSFacets facets, short presentFacet, short fixedFacet, ValidationContext context)
- throws InvalidDatatypeFacetException {
- if (context == null) {
- context = fEmptyContext;
- }
- applyFacets(facets, presentFacet, fixedFacet, SPECIAL_PATTERN_NONE, context);
- }
-
- /**
- * built-in derived types by restriction
- */
- void applyFacets1(XSFacets facets, short presentFacet, short fixedFacet) {
-
- try {
- applyFacets(facets, presentFacet, fixedFacet, SPECIAL_PATTERN_NONE, fDummyContext);
- } catch (InvalidDatatypeFacetException e) {
- // should never gets here, internel error
- throw new RuntimeException("internal error");
- }
- // we've now applied facets; so lock this object:
- fIsImmutable = true;
- }
-
- /**
- * built-in derived types by restriction
- */
- void applyFacets1(XSFacets facets, short presentFacet, short fixedFacet, short patternType) {
-
- try {
- applyFacets(facets, presentFacet, fixedFacet, patternType, fDummyContext);
- } catch (InvalidDatatypeFacetException e) {
- // should never gets here, internel error
- throw new RuntimeException("internal error");
- }
- // we've now applied facets; so lock this object:
- fIsImmutable = true;
- }
-
- /**
- * If <restriction> is chosen, or built-in derived types by restriction
- */
- void applyFacets(XSFacets facets, short presentFacet, short fixedFacet, short patternType, ValidationContext context)
- throws InvalidDatatypeFacetException {
-
- // if the object is immutable, should not apply facets...
- if(fIsImmutable) return;
- ValidatedInfo tempInfo = new ValidatedInfo();
-
- // clear facets. because we always inherit facets in the constructor
- // REVISIT: in fact, we don't need to clear them.
- // we can convert 5 string values (4 bounds + 1 enum) to actual values,
- // store them somewhere, then do facet checking at once, instead of
- // going through the following steps. (lots of checking are redundant:
- // for example, ((presentFacet & FACET_XXX) != 0))
-
- fFacetsDefined = 0;
- fFixedFacet = 0;
-
- int result = 0 ;
-
- // step 1: parse present facets
- short allowedFacet = fDVs[fValidationDV].getAllowedFacets();
-
- // length
- if ((presentFacet & FACET_LENGTH) != 0) {
- if ((allowedFacet & FACET_LENGTH) == 0) {
- reportError("cos-applicable-facets", new Object[]{"length", fTypeName});
- } else {
- fLength = facets.length;
- lengthAnnotation = facets.lengthAnnotation;
- fFacetsDefined |= FACET_LENGTH;
- if ((fixedFacet & FACET_LENGTH) != 0)
- fFixedFacet |= FACET_LENGTH;
- }
- }
- // minLength
- if ((presentFacet & FACET_MINLENGTH) != 0) {
- if ((allowedFacet & FACET_MINLENGTH) == 0) {
- reportError("cos-applicable-facets", new Object[]{"minLength", fTypeName});
- } else {
- fMinLength = facets.minLength;
- minLengthAnnotation = facets.minLengthAnnotation;
- fFacetsDefined |= FACET_MINLENGTH;
- if ((fixedFacet & FACET_MINLENGTH) != 0)
- fFixedFacet |= FACET_MINLENGTH;
- }
- }
- // maxLength
- if ((presentFacet & FACET_MAXLENGTH) != 0) {
- if ((allowedFacet & FACET_MAXLENGTH) == 0) {
- reportError("cos-applicable-facets", new Object[]{"maxLength", fTypeName});
- } else {
- fMaxLength = facets.maxLength;
- maxLengthAnnotation = facets.maxLengthAnnotation;
- fFacetsDefined |= FACET_MAXLENGTH;
- if ((fixedFacet & FACET_MAXLENGTH) != 0)
- fFixedFacet |= FACET_MAXLENGTH;
- }
- }
- // pattern
- if ((presentFacet & FACET_PATTERN) != 0) {
- if ((allowedFacet & FACET_PATTERN) == 0) {
- reportError("cos-applicable-facets", new Object[]{"pattern", fTypeName});
- } else {
- patternAnnotations = facets.patternAnnotations;
- RegularExpression regex = null;
- try {
- regex = new RegularExpression(facets.pattern, "X", context.getLocale());
- } catch (Exception e) {
- reportError("InvalidRegex", new Object[]{facets.pattern, e.getLocalizedMessage()});
- }
- if (regex != null) {
- fPattern = new Vector();
- fPattern.addElement(regex);
- fPatternStr = new Vector();
- fPatternStr.addElement(facets.pattern);
- fFacetsDefined |= FACET_PATTERN;
- if ((fixedFacet & FACET_PATTERN) != 0)
- fFixedFacet |= FACET_PATTERN;
- }
- }
- }
-
- // whiteSpace
- if ((presentFacet & FACET_WHITESPACE) != 0) {
- if ((allowedFacet & FACET_WHITESPACE) == 0) {
- reportError("cos-applicable-facets", new Object[]{"whiteSpace", fTypeName});
- } else {
- fWhiteSpace = facets.whiteSpace;
- whiteSpaceAnnotation = facets.whiteSpaceAnnotation;
- fFacetsDefined |= FACET_WHITESPACE;
- if ((fixedFacet & FACET_WHITESPACE) != 0)
- fFixedFacet |= FACET_WHITESPACE;
- }
- }
- // enumeration
- if ((presentFacet & FACET_ENUMERATION) != 0) {
- if ((allowedFacet & FACET_ENUMERATION) == 0) {
- reportError("cos-applicable-facets", new Object[]{"enumeration", fTypeName});
- } else {
- fEnumeration = new Vector();
- Vector enumVals = facets.enumeration;
- fEnumerationType = new short[enumVals.size()];
- fEnumerationItemType = new ShortList[enumVals.size()];
- Vector enumNSDecls = facets.enumNSDecls;
- ValidationContextImpl ctx = new ValidationContextImpl(context);
- enumerationAnnotations = facets.enumAnnotations;
- for (int i = 0; i < enumVals.size(); i++) {
- if (enumNSDecls != null)
- ctx.setNSContext((NamespaceContext)enumNSDecls.elementAt(i));
- try {
- ValidatedInfo info = getActualEnumValue((String)enumVals.elementAt(i), ctx, tempInfo);
- // check 4.3.5.c0 must: enumeration values from the value space of base
- fEnumeration.addElement(info.actualValue);
- fEnumerationType[i] = info.actualValueType;
- fEnumerationItemType[i] = info.itemValueTypes;
- } catch (InvalidDatatypeValueException ide) {
- reportError("enumeration-valid-restriction", new Object[]{enumVals.elementAt(i), this.getBaseType().getName()});
- }
- }
- fFacetsDefined |= FACET_ENUMERATION;
- if ((fixedFacet & FACET_ENUMERATION) != 0)
- fFixedFacet |= FACET_ENUMERATION;
- }
- }
-
- // maxInclusive
- if ((presentFacet & FACET_MAXINCLUSIVE) != 0) {
- if ((allowedFacet & FACET_MAXINCLUSIVE) == 0) {
- reportError("cos-applicable-facets", new Object[]{"maxInclusive", fTypeName});
- } else {
- maxInclusiveAnnotation = facets.maxInclusiveAnnotation;
- try {
- fMaxInclusive = fBase.getActualValue(facets.maxInclusive, context, tempInfo, true);
- fFacetsDefined |= FACET_MAXINCLUSIVE;
- if ((fixedFacet & FACET_MAXINCLUSIVE) != 0)
- fFixedFacet |= FACET_MAXINCLUSIVE;
- } catch (InvalidDatatypeValueException ide) {
- reportError(ide.getKey(), ide.getArgs());
- reportError("FacetValueFromBase", new Object[]{fTypeName, facets.maxInclusive,
- "maxInclusive", fBase.getName()});
- }
-
- // check against fixed value in base
- if (((fBase.fFacetsDefined & FACET_MAXINCLUSIVE) != 0)) {
- if ((fBase.fFixedFacet & FACET_MAXINCLUSIVE) != 0) {
- if (fDVs[fValidationDV].compare(fMaxInclusive, fBase.fMaxInclusive) != 0)
- reportError( "FixedFacetValue", new Object[]{"maxInclusive", fMaxInclusive, fBase.fMaxInclusive, fTypeName});
- }
- }
- // maxInclusive from base
- try {
- fBase.validate(context, tempInfo);
- } catch (InvalidDatatypeValueException ide) {
- reportError(ide.getKey(), ide.getArgs());
- reportError("FacetValueFromBase", new Object[]{fTypeName, facets.maxInclusive,
- "maxInclusive", fBase.getName()});
- }
- }
- }
-
- // maxExclusive
- boolean needCheckBase = true;
- if ((presentFacet & FACET_MAXEXCLUSIVE) != 0) {
- if ((allowedFacet & FACET_MAXEXCLUSIVE) == 0) {
- reportError("cos-applicable-facets", new Object[]{"maxExclusive", fTypeName});
- } else {
- maxExclusiveAnnotation = facets.maxExclusiveAnnotation;
- try {
- fMaxExclusive = fBase.getActualValue(facets.maxExclusive, context, tempInfo, true);
- fFacetsDefined |= FACET_MAXEXCLUSIVE;
- if ((fixedFacet & FACET_MAXEXCLUSIVE) != 0)
- fFixedFacet |= FACET_MAXEXCLUSIVE;
- } catch (InvalidDatatypeValueException ide) {
- reportError(ide.getKey(), ide.getArgs());
- reportError("FacetValueFromBase", new Object[]{fTypeName, facets.maxExclusive,
- "maxExclusive", fBase.getName()});
- }
-
- // check against fixed value in base
- if (((fBase.fFacetsDefined & FACET_MAXEXCLUSIVE) != 0)) {
- result = fDVs[fValidationDV].compare(fMaxExclusive, fBase.fMaxExclusive);
- if ((fBase.fFixedFacet & FACET_MAXEXCLUSIVE) != 0 && result != 0) {
- reportError( "FixedFacetValue", new Object[]{"maxExclusive", facets.maxExclusive, fBase.fMaxExclusive, fTypeName});
- }
- if (result == 0) {
- needCheckBase = false;
- }
- }
- // maxExclusive from base
- if (needCheckBase) {
- try {
- fBase.validate(context, tempInfo);
- } catch (InvalidDatatypeValueException ide) {
- reportError(ide.getKey(), ide.getArgs());
- reportError("FacetValueFromBase", new Object[]{fTypeName, facets.maxExclusive,
- "maxExclusive", fBase.getName()});
- }
- }
- // If maxExclusive == base.maxExclusive, then we only need to check
- // maxExclusive <= base.maxInclusive
- else if (((fBase.fFacetsDefined & FACET_MAXINCLUSIVE) != 0)) {
- if (fDVs[fValidationDV].compare(fMaxExclusive, fBase.fMaxInclusive) > 0) {
- reportError( "maxExclusive-valid-restriction.2", new Object[]{facets.maxExclusive, fBase.fMaxInclusive});
- }
- }
- }
- }
- // minExclusive
- needCheckBase = true;
- if ((presentFacet & FACET_MINEXCLUSIVE) != 0) {
- if ((allowedFacet & FACET_MINEXCLUSIVE) == 0) {
- reportError("cos-applicable-facets", new Object[]{"minExclusive", fTypeName});
- } else {
- minExclusiveAnnotation = facets.minExclusiveAnnotation;
- try {
- fMinExclusive = fBase.getActualValue(facets.minExclusive, context, tempInfo, true);
- fFacetsDefined |= FACET_MINEXCLUSIVE;
- if ((fixedFacet & FACET_MINEXCLUSIVE) != 0)
- fFixedFacet |= FACET_MINEXCLUSIVE;
- } catch (InvalidDatatypeValueException ide) {
- reportError(ide.getKey(), ide.getArgs());
- reportError("FacetValueFromBase", new Object[]{fTypeName, facets.minExclusive,
- "minExclusive", fBase.getName()});
- }
-
- // check against fixed value in base
- if (((fBase.fFacetsDefined & FACET_MINEXCLUSIVE) != 0)) {
- result = fDVs[fValidationDV].compare(fMinExclusive, fBase.fMinExclusive);
- if ((fBase.fFixedFacet & FACET_MINEXCLUSIVE) != 0 && result != 0) {
- reportError( "FixedFacetValue", new Object[]{"minExclusive", facets.minExclusive, fBase.fMinExclusive, fTypeName});
- }
- if (result == 0) {
- needCheckBase = false;
- }
- }
- // minExclusive from base
- if (needCheckBase) {
- try {
- fBase.validate(context, tempInfo);
- } catch (InvalidDatatypeValueException ide) {
- reportError(ide.getKey(), ide.getArgs());
- reportError("FacetValueFromBase", new Object[]{fTypeName, facets.minExclusive,
- "minExclusive", fBase.getName()});
- }
- }
- // If minExclusive == base.minExclusive, then we only need to check
- // minExclusive >= base.minInclusive
- else if (((fBase.fFacetsDefined & FACET_MININCLUSIVE) != 0)) {
- if (fDVs[fValidationDV].compare(fMinExclusive, fBase.fMinInclusive) < 0) {
- reportError( "minExclusive-valid-restriction.3", new Object[]{facets.minExclusive, fBase.fMinInclusive});
- }
- }
- }
- }
- // minInclusive
- if ((presentFacet & FACET_MININCLUSIVE) != 0) {
- if ((allowedFacet & FACET_MININCLUSIVE) == 0) {
- reportError("cos-applicable-facets", new Object[]{"minInclusive", fTypeName});
- } else {
- minInclusiveAnnotation = facets.minInclusiveAnnotation;
- try {
- fMinInclusive = fBase.getActualValue(facets.minInclusive, context, tempInfo, true);
- fFacetsDefined |= FACET_MININCLUSIVE;
- if ((fixedFacet & FACET_MININCLUSIVE) != 0)
- fFixedFacet |= FACET_MININCLUSIVE;
- } catch (InvalidDatatypeValueException ide) {
- reportError(ide.getKey(), ide.getArgs());
- reportError("FacetValueFromBase", new Object[]{fTypeName, facets.minInclusive,
- "minInclusive", fBase.getName()});
- }
-
- // check against fixed value in base
- if (((fBase.fFacetsDefined & FACET_MININCLUSIVE) != 0)) {
- if ((fBase.fFixedFacet & FACET_MININCLUSIVE) != 0) {
- if (fDVs[fValidationDV].compare(fMinInclusive, fBase.fMinInclusive) != 0)
- reportError( "FixedFacetValue", new Object[]{"minInclusive", facets.minInclusive, fBase.fMinInclusive, fTypeName});
- }
- }
- // minInclusive from base
- try {
- fBase.validate(context, tempInfo);
- } catch (InvalidDatatypeValueException ide) {
- reportError(ide.getKey(), ide.getArgs());
- reportError("FacetValueFromBase", new Object[]{fTypeName, facets.minInclusive,
- "minInclusive", fBase.getName()});
- }
- }
- }
-
- // totalDigits
- if ((presentFacet & FACET_TOTALDIGITS) != 0) {
- if ((allowedFacet & FACET_TOTALDIGITS) == 0) {
- reportError("cos-applicable-facets", new Object[]{"totalDigits", fTypeName});
- } else {
- totalDigitsAnnotation = facets.totalDigitsAnnotation;
- fTotalDigits = facets.totalDigits;
- fFacetsDefined |= FACET_TOTALDIGITS;
- if ((fixedFacet & FACET_TOTALDIGITS) != 0)
- fFixedFacet |= FACET_TOTALDIGITS;
- }
- }
- // fractionDigits
- if ((presentFacet & FACET_FRACTIONDIGITS) != 0) {
- if ((allowedFacet & FACET_FRACTIONDIGITS) == 0) {
- reportError("cos-applicable-facets", new Object[]{"fractionDigits", fTypeName});
- } else {
- fFractionDigits = facets.fractionDigits;
- fractionDigitsAnnotation = facets.fractionDigitsAnnotation;
- fFacetsDefined |= FACET_FRACTIONDIGITS;
- if ((fixedFacet & FACET_FRACTIONDIGITS) != 0)
- fFixedFacet |= FACET_FRACTIONDIGITS;
- }
- }
-
- // token type: internal use, so do less checking
- if (patternType != SPECIAL_PATTERN_NONE) {
- fPatternType = patternType;
- }
-
- // step 2: check facets against each other: length, bounds
- if(fFacetsDefined != 0) {
-
- // check 4.3.2.c1 must: minLength <= maxLength
- if(((fFacetsDefined & FACET_MINLENGTH ) != 0 ) && ((fFacetsDefined & FACET_MAXLENGTH) != 0))
- {
- if(fMinLength > fMaxLength)
- reportError("minLength-less-than-equal-to-maxLength", new Object[]{Integer.toString(fMinLength), Integer.toString(fMaxLength), fTypeName});
- }
-
- // check 4.3.8.c1 error: maxInclusive + maxExclusive
- if (((fFacetsDefined & FACET_MAXEXCLUSIVE) != 0) && ((fFacetsDefined & FACET_MAXINCLUSIVE) != 0)) {
- reportError( "maxInclusive-maxExclusive", new Object[]{fMaxInclusive, fMaxExclusive, fTypeName});
- }
-
- // check 4.3.9.c1 error: minInclusive + minExclusive
- if (((fFacetsDefined & FACET_MINEXCLUSIVE) != 0) && ((fFacetsDefined & FACET_MININCLUSIVE) != 0)) {
- reportError("minInclusive-minExclusive", new Object[]{fMinInclusive, fMinExclusive, fTypeName});
- }
-
- // check 4.3.7.c1 must: minInclusive <= maxInclusive
- if (((fFacetsDefined & FACET_MAXINCLUSIVE) != 0) && ((fFacetsDefined & FACET_MININCLUSIVE) != 0)) {
- result = fDVs[fValidationDV].compare(fMinInclusive, fMaxInclusive);
- if (result != -1 && result != 0)
- reportError("minInclusive-less-than-equal-to-maxInclusive", new Object[]{fMinInclusive, fMaxInclusive, fTypeName});
- }
-
- // check 4.3.8.c2 must: minExclusive <= maxExclusive ??? minExclusive < maxExclusive
- if (((fFacetsDefined & FACET_MAXEXCLUSIVE) != 0) && ((fFacetsDefined & FACET_MINEXCLUSIVE) != 0)) {
- result = fDVs[fValidationDV].compare(fMinExclusive, fMaxExclusive);
- if (result != -1 && result != 0)
- reportError( "minExclusive-less-than-equal-to-maxExclusive", new Object[]{fMinExclusive, fMaxExclusive, fTypeName});
- }
-
- // check 4.3.9.c2 must: minExclusive < maxInclusive
- if (((fFacetsDefined & FACET_MAXINCLUSIVE) != 0) && ((fFacetsDefined & FACET_MINEXCLUSIVE) != 0)) {
- if (fDVs[fValidationDV].compare(fMinExclusive, fMaxInclusive) != -1)
- reportError( "minExclusive-less-than-maxInclusive", new Object[]{fMinExclusive, fMaxInclusive, fTypeName});
- }
-
- // check 4.3.10.c1 must: minInclusive < maxExclusive
- if (((fFacetsDefined & FACET_MAXEXCLUSIVE) != 0) && ((fFacetsDefined & FACET_MININCLUSIVE) != 0)) {
- if (fDVs[fValidationDV].compare(fMinInclusive, fMaxExclusive) != -1)
- reportError( "minInclusive-less-than-maxExclusive", new Object[]{fMinInclusive, fMaxExclusive, fTypeName});
- }
-
- // check 4.3.12.c1 must: fractionDigits <= totalDigits
- if (((fFacetsDefined & FACET_FRACTIONDIGITS) != 0) &&
- ((fFacetsDefined & FACET_TOTALDIGITS) != 0)) {
- if (fFractionDigits > fTotalDigits)
- reportError( "fractionDigits-totalDigits", new Object[]{Integer.toString(fFractionDigits), Integer.toString(fTotalDigits), fTypeName});
- }
-
- // step 3: check facets against base
- // check 4.3.1.c1 error: length & (fBase.maxLength | fBase.minLength)
- if((fFacetsDefined & FACET_LENGTH) != 0 ){
- if ((fBase.fFacetsDefined & FACET_MINLENGTH) != 0 &&
- fLength < fBase.fMinLength) {
- // length, fBase.minLength and fBase.maxLength defined
- reportError("length-minLength-maxLength.1.1", new Object[]{fTypeName, Integer.toString(fLength), Integer.toString(fBase.fMinLength)});
- }
- if ((fBase.fFacetsDefined & FACET_MAXLENGTH) != 0 &&
- fLength > fBase.fMaxLength) {
- // length and fBase.maxLength defined
- reportError("length-minLength-maxLength.2.1", new Object[]{fTypeName, Integer.toString(fLength), Integer.toString(fBase.fMaxLength)});
- }
- if ( (fBase.fFacetsDefined & FACET_LENGTH) != 0 ) {
- // check 4.3.1.c2 error: length != fBase.length
- if ( fLength != fBase.fLength )
- reportError( "length-valid-restriction", new Object[]{Integer.toString(fLength), Integer.toString(fBase.fLength), fTypeName});
- }
- }
-
- // check 4.3.1.c1 error: fBase.length & (maxLength | minLength)
- if((fBase.fFacetsDefined & FACET_LENGTH) != 0 || (fFacetsDefined & FACET_LENGTH) != 0){
- if ((fFacetsDefined & FACET_MINLENGTH) != 0){
- if (fBase.fLength < fMinLength) {
- // fBase.length, minLength and maxLength defined
- reportError("length-minLength-maxLength.1.1", new Object[]{fTypeName, Integer.toString(fBase.fLength), Integer.toString(fMinLength)});
- }
- if ((fBase.fFacetsDefined & FACET_MINLENGTH) == 0){
- reportError("length-minLength-maxLength.1.2.a", new Object[]{fTypeName});
- }
- if (fMinLength != fBase.fMinLength){
- reportError("length-minLength-maxLength.1.2.b", new Object[]{fTypeName, Integer.toString(fMinLength), Integer.toString(fBase.fMinLength)});
- }
- }
- if ((fFacetsDefined & FACET_MAXLENGTH) != 0){
- if (fBase.fLength > fMaxLength) {
- // fBase.length, minLength and maxLength defined
- reportError("length-minLength-maxLength.2.1", new Object[]{fTypeName, Integer.toString(fBase.fLength), Integer.toString(fMaxLength)});
- }
- if ((fBase.fFacetsDefined & FACET_MAXLENGTH) == 0){
- reportError("length-minLength-maxLength.2.2.a", new Object[]{fTypeName});
- }
- if (fMaxLength != fBase.fMaxLength){
- reportError("length-minLength-maxLength.2.2.b", new Object[]{fTypeName, Integer.toString(fMaxLength), Integer.toString(fBase.fBase.fMaxLength)});
- }
- }
- }
-
- // check 4.3.2.c1 must: minLength <= fBase.maxLength
- if ( ((fFacetsDefined & FACET_MINLENGTH ) != 0 ) ) {
- if ( (fBase.fFacetsDefined & FACET_MAXLENGTH ) != 0 ) {
- if ( fMinLength > fBase.fMaxLength ) {
- reportError("minLength-less-than-equal-to-maxLength", new Object[]{Integer.toString(fMinLength), Integer.toString(fBase.fMaxLength), fTypeName});
- }
- }
- else if ( (fBase.fFacetsDefined & FACET_MINLENGTH) != 0 ) {
- if ( (fBase.fFixedFacet & FACET_MINLENGTH) != 0 && fMinLength != fBase.fMinLength ) {
- reportError( "FixedFacetValue", new Object[]{"minLength", Integer.toString(fMinLength), Integer.toString(fBase.fMinLength), fTypeName});
- }
-
- // check 4.3.2.c2 error: minLength < fBase.minLength
- if ( fMinLength < fBase.fMinLength ) {
- reportError( "minLength-valid-restriction", new Object[]{Integer.toString(fMinLength), Integer.toString(fBase.fMinLength), fTypeName});
- }
- }
- }
-
-
- // check 4.3.2.c1 must: maxLength < fBase.minLength
- if ( ((fFacetsDefined & FACET_MAXLENGTH ) != 0 ) && ((fBase.fFacetsDefined & FACET_MINLENGTH ) != 0 )) {
- if ( fMaxLength < fBase.fMinLength) {
- reportError("minLength-less-than-equal-to-maxLength", new Object[]{Integer.toString(fBase.fMinLength), Integer.toString(fMaxLength)});
- }
- }
-
- // check 4.3.3.c1 error: maxLength > fBase.maxLength
- if ( (fFacetsDefined & FACET_MAXLENGTH) != 0 ) {
- if ( (fBase.fFacetsDefined & FACET_MAXLENGTH) != 0 ){
- if(( (fBase.fFixedFacet & FACET_MAXLENGTH) != 0 )&& fMaxLength != fBase.fMaxLength ) {
- reportError( "FixedFacetValue", new Object[]{"maxLength", Integer.toString(fMaxLength), Integer.toString(fBase.fMaxLength), fTypeName});
- }
- if ( fMaxLength > fBase.fMaxLength ) {
- reportError( "maxLength-valid-restriction", new Object[]{Integer.toString(fMaxLength), Integer.toString(fBase.fMaxLength), fTypeName});
- }
- }
- }
-
- /* // check 4.3.7.c2 error:
- // maxInclusive > fBase.maxInclusive
- // maxInclusive >= fBase.maxExclusive
- // maxInclusive < fBase.minInclusive
- // maxInclusive <= fBase.minExclusive
-
- if (((fFacetsDefined & FACET_MAXINCLUSIVE) != 0)) {
- if (((fBase.fFacetsDefined & FACET_MAXINCLUSIVE) != 0)) {
- result = fDVs[fValidationDV].compare(fMaxInclusive, fBase.fMaxInclusive);
- if ((fBase.fFixedFacet & FACET_MAXINCLUSIVE) != 0 && result != 0) {
- reportError( "FixedFacetValue", new Object[]{"maxInclusive", fMaxInclusive, fBase.fMaxInclusive, fTypeName});
- }
- if (result != -1 && result != 0) {
- reportError( "maxInclusive-valid-restriction.1", new Object[]{fMaxInclusive, fBase.fMaxInclusive, fTypeName});
- }
- }
- if (((fBase.fFacetsDefined & FACET_MAXEXCLUSIVE) != 0) &&
- fDVs[fValidationDV].compare(fMaxInclusive, fBase.fMaxExclusive) != -1){
- reportError( "maxInclusive-valid-restriction.1", new Object[]{fMaxInclusive, fBase.fMaxExclusive, fTypeName});
- }
-
- if ((( fBase.fFacetsDefined & FACET_MININCLUSIVE) != 0)) {
- result = fDVs[fValidationDV].compare(fMaxInclusive, fBase.fMinInclusive);
- if (result != 1 && result != 0) {
- reportError( "maxInclusive-valid-restriction.1", new Object[]{fMaxInclusive, fBase.fMinInclusive, fTypeName});
- }
- }
-
- if ((( fBase.fFacetsDefined & FACET_MINEXCLUSIVE) != 0) &&
- fDVs[fValidationDV].compare(fMaxInclusive, fBase.fMinExclusive ) != 1)
- reportError( "maxInclusive-valid-restriction.1", new Object[]{fMaxInclusive, fBase.fMinExclusive, fTypeName});
- }
-
- // check 4.3.8.c3 error:
- // maxExclusive > fBase.maxExclusive
- // maxExclusive > fBase.maxInclusive
- // maxExclusive <= fBase.minInclusive
- // maxExclusive <= fBase.minExclusive
- if (((fFacetsDefined & FACET_MAXEXCLUSIVE) != 0)) {
- if ((( fBase.fFacetsDefined & FACET_MAXEXCLUSIVE) != 0)) {
- result= fDVs[fValidationDV].compare(fMaxExclusive, fBase.fMaxExclusive);
- if ((fBase.fFixedFacet & FACET_MAXEXCLUSIVE) != 0 && result != 0) {
- reportError( "FixedFacetValue", new Object[]{"maxExclusive", fMaxExclusive, fBase.fMaxExclusive, fTypeName});
- }
- if (result != -1 && result != 0) {
- reportError( "maxExclusive-valid-restriction.1", new Object[]{fMaxExclusive, fBase.fMaxExclusive, fTypeName});
- }
- }
-
- if ((( fBase.fFacetsDefined & FACET_MAXINCLUSIVE) != 0)) {
- result= fDVs[fValidationDV].compare(fMaxExclusive, fBase.fMaxInclusive);
- if (result != -1 && result != 0) {
- reportError( "maxExclusive-valid-restriction.2", new Object[]{fMaxExclusive, fBase.fMaxInclusive, fTypeName});
- }
- }
-
- if ((( fBase.fFacetsDefined & FACET_MINEXCLUSIVE) != 0) &&
- fDVs[fValidationDV].compare(fMaxExclusive, fBase.fMinExclusive ) != 1)
- reportError( "maxExclusive-valid-restriction.3", new Object[]{fMaxExclusive, fBase.fMinExclusive, fTypeName});
-
- if ((( fBase.fFacetsDefined & FACET_MININCLUSIVE) != 0) &&
- fDVs[fValidationDV].compare(fMaxExclusive, fBase.fMinInclusive) != 1)
- reportError( "maxExclusive-valid-restriction.4", new Object[]{fMaxExclusive, fBase.fMinInclusive, fTypeName});
- }
-
- // check 4.3.9.c3 error:
- // minExclusive < fBase.minExclusive
- // minExclusive > fBase.maxInclusive
- // minExclusive < fBase.minInclusive
- // minExclusive >= fBase.maxExclusive
- if (((fFacetsDefined & FACET_MINEXCLUSIVE) != 0)) {
- if ((( fBase.fFacetsDefined & FACET_MINEXCLUSIVE) != 0)) {
- result= fDVs[fValidationDV].compare(fMinExclusive, fBase.fMinExclusive);
- if ((fBase.fFixedFacet & FACET_MINEXCLUSIVE) != 0 && result != 0) {
- reportError( "FixedFacetValue", new Object[]{"minExclusive", fMinExclusive, fBase.fMinExclusive, fTypeName});
- }
- if (result != 1 && result != 0) {
- reportError( "minExclusive-valid-restriction.1", new Object[]{fMinExclusive, fBase.fMinExclusive, fTypeName});
- }
- }
-
- if ((( fBase.fFacetsDefined & FACET_MAXINCLUSIVE) != 0)) {
- result=fDVs[fValidationDV].compare(fMinExclusive, fBase.fMaxInclusive);
-
- if (result != -1 && result != 0) {
- reportError( "minExclusive-valid-restriction.2", new Object[]{fMinExclusive, fBase.fMaxInclusive, fTypeName});
- }
- }
-
- if ((( fBase.fFacetsDefined & FACET_MININCLUSIVE) != 0)) {
- result = fDVs[fValidationDV].compare(fMinExclusive, fBase.fMinInclusive);
-
- if (result != 1 && result != 0) {
- reportError( "minExclusive-valid-restriction.3", new Object[]{fMinExclusive, fBase.fMinInclusive, fTypeName});
- }
- }
-
- if ((( fBase.fFacetsDefined & FACET_MAXEXCLUSIVE) != 0) &&
- fDVs[fValidationDV].compare(fMinExclusive, fBase.fMaxExclusive) != -1)
- reportError( "minExclusive-valid-restriction.4", new Object[]{fMinExclusive, fBase.fMaxExclusive, fTypeName});
- }
-
- // check 4.3.10.c2 error:
- // minInclusive < fBase.minInclusive
- // minInclusive > fBase.maxInclusive
- // minInclusive <= fBase.minExclusive
- // minInclusive >= fBase.maxExclusive
- if (((fFacetsDefined & FACET_MININCLUSIVE) != 0)) {
- if (((fBase.fFacetsDefined & FACET_MININCLUSIVE) != 0)) {
- result = fDVs[fValidationDV].compare(fMinInclusive, fBase.fMinInclusive);
-
- if ((fBase.fFixedFacet & FACET_MININCLUSIVE) != 0 && result != 0) {
- reportError( "FixedFacetValue", new Object[]{"minInclusive", fMinInclusive, fBase.fMinInclusive, fTypeName});
- }
- if (result != 1 && result != 0) {
- reportError( "minInclusive-valid-restriction.1", new Object[]{fMinInclusive, fBase.fMinInclusive, fTypeName});
- }
- }
- if ((( fBase.fFacetsDefined & FACET_MAXINCLUSIVE) != 0)) {
- result=fDVs[fValidationDV].compare(fMinInclusive, fBase.fMaxInclusive);
- if (result != -1 && result != 0) {
- reportError( "minInclusive-valid-restriction.2", new Object[]{fMinInclusive, fBase.fMaxInclusive, fTypeName});
- }
- }
- if ((( fBase.fFacetsDefined & FACET_MINEXCLUSIVE) != 0) &&
- fDVs[fValidationDV].compare(fMinInclusive, fBase.fMinExclusive ) != 1)
- reportError( "minInclusive-valid-restriction.3", new Object[]{fMinInclusive, fBase.fMinExclusive, fTypeName});
- if ((( fBase.fFacetsDefined & FACET_MAXEXCLUSIVE) != 0) &&
- fDVs[fValidationDV].compare(fMinInclusive, fBase.fMaxExclusive) != -1)
- reportError( "minInclusive-valid-restriction.4", new Object[]{fMinInclusive, fBase.fMaxExclusive, fTypeName});
- }
- */
- // check 4.3.11.c1 error: totalDigits > fBase.totalDigits
- if (((fFacetsDefined & FACET_TOTALDIGITS) != 0)) {
- if ((( fBase.fFacetsDefined & FACET_TOTALDIGITS) != 0)) {
- if ((fBase.fFixedFacet & FACET_TOTALDIGITS) != 0 && fTotalDigits != fBase.fTotalDigits) {
- reportError("FixedFacetValue", new Object[]{"totalDigits", Integer.toString(fTotalDigits), Integer.toString(fBase.fTotalDigits), fTypeName});
- }
- if (fTotalDigits > fBase.fTotalDigits) {
- reportError( "totalDigits-valid-restriction", new Object[]{Integer.toString(fTotalDigits), Integer.toString(fBase.fTotalDigits), fTypeName});
- }
- }
- }
-
- // check 4.3.12.c1 must: fractionDigits <= base.totalDigits
- if ((fFacetsDefined & FACET_FRACTIONDIGITS) != 0) {
- if ((fBase.fFacetsDefined & FACET_TOTALDIGITS) != 0) {
- if (fFractionDigits > fBase.fTotalDigits)
- reportError( "fractionDigits-totalDigits", new Object[]{Integer.toString(fFractionDigits), Integer.toString(fTotalDigits), fTypeName});
- }
- }
-
- // check 4.3.12.c2 error: fractionDigits > fBase.fractionDigits
- // check fixed value for fractionDigits
- if (((fFacetsDefined & FACET_FRACTIONDIGITS) != 0)) {
- if ((( fBase.fFacetsDefined & FACET_FRACTIONDIGITS) != 0)) {
- if (((fBase.fFixedFacet & FACET_FRACTIONDIGITS) != 0 && fFractionDigits != fBase.fFractionDigits) ||
- (fValidationDV == DV_INTEGER && fFractionDigits != 0)) {
- reportError("FixedFacetValue", new Object[]{"fractionDigits", Integer.toString(fFractionDigits), Integer.toString(fBase.fFractionDigits), fTypeName});
- }
- if (fFractionDigits > fBase.fFractionDigits) {
- reportError( "fractionDigits-valid-restriction", new Object[]{Integer.toString(fFractionDigits), Integer.toString(fBase.fFractionDigits), fTypeName});
- }
- }
- else if (fValidationDV == DV_INTEGER && fFractionDigits != 0) {
- reportError("FixedFacetValue", new Object[]{"fractionDigits", Integer.toString(fFractionDigits), "0", fTypeName});
- }
- }
-
- // check 4.3.6.c1 error:
- // (whiteSpace = preserve || whiteSpace = replace) && fBase.whiteSpace = collapese or
- // whiteSpace = preserve && fBase.whiteSpace = replace
-
- if ( (fFacetsDefined & FACET_WHITESPACE) != 0 && (fBase.fFacetsDefined & FACET_WHITESPACE) != 0 ){
- if ( (fBase.fFixedFacet & FACET_WHITESPACE) != 0 && fWhiteSpace != fBase.fWhiteSpace ) {
- reportError( "FixedFacetValue", new Object[]{"whiteSpace", whiteSpaceValue(fWhiteSpace), whiteSpaceValue(fBase.fWhiteSpace), fTypeName});
- }
-
- if ( fWhiteSpace == WS_PRESERVE && fBase.fWhiteSpace == WS_COLLAPSE ){
- reportError( "whiteSpace-valid-restriction.1", new Object[]{fTypeName, "preserve"});
- }
- if ( fWhiteSpace == WS_REPLACE && fBase.fWhiteSpace == WS_COLLAPSE ){
- reportError( "whiteSpace-valid-restriction.1", new Object[]{fTypeName, "replace"});
- }
- if ( fWhiteSpace == WS_PRESERVE && fBase.fWhiteSpace == WS_REPLACE ){
- reportError( "whiteSpace-valid-restriction.2", new Object[]{fTypeName});
- }
- }
- }//fFacetsDefined != null
-
- // step 4: inherit other facets from base (including fTokeyType)
-
- // inherit length
- if ( (fFacetsDefined & FACET_LENGTH) == 0 && (fBase.fFacetsDefined & FACET_LENGTH) != 0 ) {
- fFacetsDefined |= FACET_LENGTH;
- fLength = fBase.fLength;
- lengthAnnotation = fBase.lengthAnnotation;
- }
- // inherit minLength
- if ( (fFacetsDefined & FACET_MINLENGTH) == 0 && (fBase.fFacetsDefined & FACET_MINLENGTH) != 0 ) {
- fFacetsDefined |= FACET_MINLENGTH;
- fMinLength = fBase.fMinLength;
- minLengthAnnotation = fBase.minLengthAnnotation;
- }
- // inherit maxLength
- if ((fFacetsDefined & FACET_MAXLENGTH) == 0 && (fBase.fFacetsDefined & FACET_MAXLENGTH) != 0 ) {
- fFacetsDefined |= FACET_MAXLENGTH;
- fMaxLength = fBase.fMaxLength;
- maxLengthAnnotation = fBase.maxLengthAnnotation;
- }
- // inherit pattern
- if ( (fBase.fFacetsDefined & FACET_PATTERN) != 0 ) {
- if ((fFacetsDefined & FACET_PATTERN) == 0) {
- fFacetsDefined |= FACET_PATTERN;
- fPattern = fBase.fPattern;
- fPatternStr = fBase.fPatternStr;
- patternAnnotations = fBase.patternAnnotations;
- }
- else {
- for (int i = fBase.fPattern.size()-1; i >= 0; --i) {
- fPattern.addElement(fBase.fPattern.elementAt(i));
- fPatternStr.addElement(fBase.fPatternStr.elementAt(i));
- }
- if (fBase.patternAnnotations != null) {
- if (patternAnnotations != null) {
- for (int i = fBase.patternAnnotations.getLength()-1; i >= 0; --i) {
- patternAnnotations.addXSObject(fBase.patternAnnotations.item(i));
- }
- }
- else {
- patternAnnotations = fBase.patternAnnotations;
- }
- }
- }
- }
- // inherit whiteSpace
- if ( (fFacetsDefined & FACET_WHITESPACE) == 0 && (fBase.fFacetsDefined & FACET_WHITESPACE) != 0 ) {
- fFacetsDefined |= FACET_WHITESPACE;
- fWhiteSpace = fBase.fWhiteSpace;
- whiteSpaceAnnotation = fBase.whiteSpaceAnnotation;
- }
- // inherit enumeration
- if ((fFacetsDefined & FACET_ENUMERATION) == 0 && (fBase.fFacetsDefined & FACET_ENUMERATION) != 0) {
- fFacetsDefined |= FACET_ENUMERATION;
- fEnumeration = fBase.fEnumeration;
- enumerationAnnotations = fBase.enumerationAnnotations;
- }
- // inherit maxExclusive
- if ((( fBase.fFacetsDefined & FACET_MAXEXCLUSIVE) != 0) &&
- !((fFacetsDefined & FACET_MAXEXCLUSIVE) != 0) && !((fFacetsDefined & FACET_MAXINCLUSIVE) != 0)) {
- fFacetsDefined |= FACET_MAXEXCLUSIVE;
- fMaxExclusive = fBase.fMaxExclusive;
- maxExclusiveAnnotation = fBase.maxExclusiveAnnotation;
- }
- // inherit maxInclusive
- if ((( fBase.fFacetsDefined & FACET_MAXINCLUSIVE) != 0) &&
- !((fFacetsDefined & FACET_MAXEXCLUSIVE) != 0) && !((fFacetsDefined & FACET_MAXINCLUSIVE) != 0)) {
- fFacetsDefined |= FACET_MAXINCLUSIVE;
- fMaxInclusive = fBase.fMaxInclusive;
- maxInclusiveAnnotation = fBase.maxInclusiveAnnotation;
- }
- // inherit minExclusive
- if ((( fBase.fFacetsDefined & FACET_MINEXCLUSIVE) != 0) &&
- !((fFacetsDefined & FACET_MINEXCLUSIVE) != 0) && !((fFacetsDefined & FACET_MININCLUSIVE) != 0)) {
- fFacetsDefined |= FACET_MINEXCLUSIVE;
- fMinExclusive = fBase.fMinExclusive;
- minExclusiveAnnotation = fBase.minExclusiveAnnotation;
- }
- // inherit minExclusive
- if ((( fBase.fFacetsDefined & FACET_MININCLUSIVE) != 0) &&
- !((fFacetsDefined & FACET_MINEXCLUSIVE) != 0) && !((fFacetsDefined & FACET_MININCLUSIVE) != 0)) {
- fFacetsDefined |= FACET_MININCLUSIVE;
- fMinInclusive = fBase.fMinInclusive;
- minInclusiveAnnotation = fBase.minInclusiveAnnotation;
- }
- // inherit totalDigits
- if ((( fBase.fFacetsDefined & FACET_TOTALDIGITS) != 0) &&
- !((fFacetsDefined & FACET_TOTALDIGITS) != 0)) {
- fFacetsDefined |= FACET_TOTALDIGITS;
- fTotalDigits = fBase.fTotalDigits;
- totalDigitsAnnotation = fBase.totalDigitsAnnotation;
- }
- // inherit fractionDigits
- if ((( fBase.fFacetsDefined & FACET_FRACTIONDIGITS) != 0)
- && !((fFacetsDefined & FACET_FRACTIONDIGITS) != 0)) {
- fFacetsDefined |= FACET_FRACTIONDIGITS;
- fFractionDigits = fBase.fFractionDigits;
- fractionDigitsAnnotation = fBase.fractionDigitsAnnotation;
- }
- //inherit tokeytype
- if ((fPatternType == SPECIAL_PATTERN_NONE ) && (fBase.fPatternType != SPECIAL_PATTERN_NONE)) {
- fPatternType = fBase.fPatternType ;
- }
-
- // step 5: mark fixed values
- fFixedFacet |= fBase.fFixedFacet;
-
- //step 6: setting fundamental facets
- calcFundamentalFacets();
-
- } //applyFacets()
-
- /**
- * validate a value, and return the compiled form
- */
- public Object validate(String content, ValidationContext context, ValidatedInfo validatedInfo) throws InvalidDatatypeValueException {
-
- if (context == null)
- context = fEmptyContext;
-
- if (validatedInfo == null)
- validatedInfo = new ValidatedInfo();
- else
- validatedInfo.memberType = null;
-
- // first normalize string value, and convert it to actual value
- boolean needNormalize = context==null||context.needToNormalize();
- Object ob = getActualValue(content, context, validatedInfo, needNormalize);
-
- validate(context, validatedInfo);
-
- return ob;
-
- }
-
- protected ValidatedInfo getActualEnumValue(String lexical, ValidationContext ctx, ValidatedInfo info)
- throws InvalidDatatypeValueException {
- return fBase.validateWithInfo(lexical, ctx, info);
- }
-
- /**
- * validate a value, and return the compiled form
- */
- public ValidatedInfo validateWithInfo(String content, ValidationContext context, ValidatedInfo validatedInfo) throws InvalidDatatypeValueException {
-
- if (context == null)
- context = fEmptyContext;
-
- if (validatedInfo == null)
- validatedInfo = new ValidatedInfo();
- else
- validatedInfo.memberType = null;
-
- // first normalize string value, and convert it to actual value
- boolean needNormalize = context==null||context.needToNormalize();
- getActualValue(content, context, validatedInfo, needNormalize);
-
- validate(context, validatedInfo);
-
- return validatedInfo;
-
- }
-
- /**
- * validate a value, and return the compiled form
- */
- public Object validate(Object content, ValidationContext context, ValidatedInfo validatedInfo) throws InvalidDatatypeValueException {
-
- if (context == null)
- context = fEmptyContext;
-
- if (validatedInfo == null)
- validatedInfo = new ValidatedInfo();
- else
- validatedInfo.memberType = null;
-
- // first normalize string value, and convert it to actual value
- boolean needNormalize = context==null||context.needToNormalize();
- Object ob = getActualValue(content, context, validatedInfo, needNormalize);
-
- validate(context, validatedInfo);
-
- return ob;
-
- }
-
- /**
- * validate an actual value against this DV
- *
- * @param context the validation context
- * @param validatedInfo used to provide the actual value and member types
- */
- public void validate(ValidationContext context, ValidatedInfo validatedInfo)
- throws InvalidDatatypeValueException {
-
- if (context == null)
- context = fEmptyContext;
-
- // then validate the actual value against the facets
- if (context.needFacetChecking() &&
- (fFacetsDefined != 0 && fFacetsDefined != FACET_WHITESPACE)) {
- checkFacets(validatedInfo);
- }
-
- // now check extra rules: for ID/IDREF/ENTITY
- if (context.needExtraChecking()) {
- checkExtraRules(context, validatedInfo);
- }
-
- }
-
- private void checkFacets(ValidatedInfo validatedInfo) throws InvalidDatatypeValueException {
-
- Object ob = validatedInfo.actualValue;
- String content = validatedInfo.normalizedValue;
- short type = validatedInfo.actualValueType;
- ShortList itemType = validatedInfo.itemValueTypes;
-
- // For QName and NOTATION types, we don't check length facets
- if (fValidationDV != DV_QNAME && fValidationDV != DV_NOTATION) {
- int length = fDVs[fValidationDV].getDataLength(ob);
-
- // maxLength
- if ( (fFacetsDefined & FACET_MAXLENGTH) != 0 ) {
- if ( length > fMaxLength ) {
- throw new InvalidDatatypeValueException("cvc-maxLength-valid",
- new Object[]{content, Integer.toString(length), Integer.toString(fMaxLength), fTypeName});
- }
- }
-
- //minLength
- if ( (fFacetsDefined & FACET_MINLENGTH) != 0 ) {
- if ( length < fMinLength ) {
- throw new InvalidDatatypeValueException("cvc-minLength-valid",
- new Object[]{content, Integer.toString(length), Integer.toString(fMinLength), fTypeName});
- }
- }
-
- //length
- if ( (fFacetsDefined & FACET_LENGTH) != 0 ) {
- if ( length != fLength ) {
- throw new InvalidDatatypeValueException("cvc-length-valid",
- new Object[]{content, Integer.toString(length), Integer.toString(fLength), fTypeName});
- }
- }
- }
-
- //enumeration
- if ( ((fFacetsDefined & FACET_ENUMERATION) != 0 ) ) {
- boolean present = false;
- final int enumSize = fEnumeration.size();
- final short primitiveType1 = convertToPrimitiveKind(type);
- for (int i = 0; i < enumSize; i++) {
- final short primitiveType2 = convertToPrimitiveKind(fEnumerationType[i]);
- if ((primitiveType1 == primitiveType2 ||
- primitiveType1 == XSConstants.ANYSIMPLETYPE_DT && primitiveType2 == XSConstants.STRING_DT ||
- primitiveType1 == XSConstants.STRING_DT && primitiveType2 == XSConstants.ANYSIMPLETYPE_DT)
- && fEnumeration.elementAt(i).equals(ob)) {
- if (primitiveType1 == XSConstants.LIST_DT || primitiveType1 == XSConstants.LISTOFUNION_DT) {
- ShortList enumItemType = fEnumerationItemType[i];
- final int typeList1Length = itemType != null ? itemType.getLength() : 0;
- final int typeList2Length = enumItemType != null ? enumItemType.getLength() : 0;
- if (typeList1Length == typeList2Length) {
- int j;
- for (j = 0; j < typeList1Length; ++j) {
- final short primitiveItem1 = convertToPrimitiveKind(itemType.item(j));
- final short primitiveItem2 = convertToPrimitiveKind(enumItemType.item(j));
- if (primitiveItem1 != primitiveItem2) {
- if (primitiveItem1 == XSConstants.ANYSIMPLETYPE_DT && primitiveItem2 == XSConstants.STRING_DT ||
- primitiveItem1 == XSConstants.STRING_DT && primitiveItem2 == XSConstants.ANYSIMPLETYPE_DT) {
- continue;
- }
- break;
- }
- }
- if (j == typeList1Length) {
- present = true;
- break;
- }
- }
- }
- else {
- present = true;
- break;
- }
- }
- }
- if(!present){
- throw new InvalidDatatypeValueException("cvc-enumeration-valid",
- new Object [] {content, fEnumeration.toString()});
- }
- }
-
- //fractionDigits
- if ((fFacetsDefined & FACET_FRACTIONDIGITS) != 0) {
- int scale = fDVs[fValidationDV].getFractionDigits(ob);
- if (scale > fFractionDigits) {
- throw new InvalidDatatypeValueException("cvc-fractionDigits-valid",
- new Object[] {content, Integer.toString(scale), Integer.toString(fFractionDigits)});
- }
- }
-
- //totalDigits
- if ((fFacetsDefined & FACET_TOTALDIGITS)!=0) {
- int totalDigits = fDVs[fValidationDV].getTotalDigits(ob);
- if (totalDigits > fTotalDigits) {
- throw new InvalidDatatypeValueException("cvc-totalDigits-valid",
- new Object[] {content, Integer.toString(totalDigits), Integer.toString(fTotalDigits)});
- }
- }
-
- int compare;
-
- //maxinclusive
- if ( (fFacetsDefined & FACET_MAXINCLUSIVE) != 0 ) {
- compare = fDVs[fValidationDV].compare(ob, fMaxInclusive);
- if (compare != -1 && compare != 0) {
- throw new InvalidDatatypeValueException("cvc-maxInclusive-valid",
- new Object[] {content, fMaxInclusive, fTypeName});
- }
- }
-
- //maxExclusive
- if ( (fFacetsDefined & FACET_MAXEXCLUSIVE) != 0 ) {
- compare = fDVs[fValidationDV].compare(ob, fMaxExclusive );
- if (compare != -1) {
- throw new InvalidDatatypeValueException("cvc-maxExclusive-valid",
- new Object[] {content, fMaxExclusive, fTypeName});
- }
- }
-
- //minInclusive
- if ( (fFacetsDefined & FACET_MININCLUSIVE) != 0 ) {
- compare = fDVs[fValidationDV].compare(ob, fMinInclusive);
- if (compare != 1 && compare != 0) {
- throw new InvalidDatatypeValueException("cvc-minInclusive-valid",
- new Object[] {content, fMinInclusive, fTypeName});
- }
- }
-
- //minExclusive
- if ( (fFacetsDefined & FACET_MINEXCLUSIVE) != 0 ) {
- compare = fDVs[fValidationDV].compare(ob, fMinExclusive);
- if (compare != 1) {
- throw new InvalidDatatypeValueException("cvc-minExclusive-valid",
- new Object[] {content, fMinExclusive, fTypeName});
- }
- }
-
- }
-
- private void checkExtraRules(ValidationContext context, ValidatedInfo validatedInfo) throws InvalidDatatypeValueException {
-
- Object ob = validatedInfo.actualValue;
-
- if (fVariety == VARIETY_ATOMIC) {
-
- fDVs[fValidationDV].checkExtraRules(ob, context);
-
- } else if (fVariety == VARIETY_LIST) {
-
- ListDV.ListData values = (ListDV.ListData)ob;
- XSSimpleType memberType = validatedInfo.memberType;
- int len = values.getLength();
- try {
- if (fItemType.fVariety == VARIETY_UNION) {
- XSSimpleTypeDecl[] memberTypes = (XSSimpleTypeDecl[])validatedInfo.memberTypes;
- for (int i = len-1; i >= 0; i--) {
- validatedInfo.actualValue = values.item(i);
- validatedInfo.memberType = memberTypes[i];
- fItemType.checkExtraRules(context, validatedInfo);
- }
- } else { // (fVariety == VARIETY_ATOMIC)
- for (int i = len-1; i >= 0; i--) {
- validatedInfo.actualValue = values.item(i);
- fItemType.checkExtraRules(context, validatedInfo);
- }
- }
- }
- finally {
- validatedInfo.actualValue = values;
- validatedInfo.memberType = memberType;
- }
-
- } else { // (fVariety == VARIETY_UNION)
-
- ((XSSimpleTypeDecl)validatedInfo.memberType).checkExtraRules(context, validatedInfo);
-
- }
-
- }// checkExtraRules()
-
- //we can still return object for internal use.
- private Object getActualValue(Object content, ValidationContext context,
- ValidatedInfo validatedInfo, boolean needNormalize)
- throws InvalidDatatypeValueException{
-
- String nvalue;
- if (needNormalize) {
- nvalue = normalize(content, fWhiteSpace);
- } else {
- nvalue = content.toString();
- }
- if ( (fFacetsDefined & FACET_PATTERN ) != 0 ) {
- if (fPattern.size()==0 && nvalue.length()>0) {
- throw new InvalidDatatypeValueException("cvc-pattern-valid",
- new Object[]{content,
- "(empty string)",
- fTypeName});
- }
- RegularExpression regex;
- for (int idx = fPattern.size()-1; idx >= 0; idx--) {
- regex = (RegularExpression)fPattern.elementAt(idx);
- if (!regex.matches(nvalue)){
- throw new InvalidDatatypeValueException("cvc-pattern-valid",
- new Object[]{content,
- fPatternStr.elementAt(idx),
- fTypeName});
- }
- }
- }
-
- if (fVariety == VARIETY_ATOMIC) {
-
- // validate special kinds of token, in place of old pattern matching
- if (fPatternType != SPECIAL_PATTERN_NONE) {
-
- boolean seenErr = false;
- if (fPatternType == SPECIAL_PATTERN_NMTOKEN) {
- // PATTERN "\\c+"
- seenErr = !XMLChar.isValidNmtoken(nvalue);
- }
- else if (fPatternType == SPECIAL_PATTERN_NAME) {
- // PATTERN "\\i\\c*"
- seenErr = !XMLChar.isValidName(nvalue);
- }
- else if (fPatternType == SPECIAL_PATTERN_NCNAME) {
- // PATTERN "[\\i-[:]][\\c-[:]]*"
- seenErr = !XMLChar.isValidNCName(nvalue);
- }
- if (seenErr) {
- throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1",
- new Object[]{nvalue, SPECIAL_PATTERN_STRING[fPatternType]});
- }
- }
-
- validatedInfo.normalizedValue = nvalue;
- Object avalue = fDVs[fValidationDV].getActualValue(nvalue, context);
- validatedInfo.actualValue = avalue;
- validatedInfo.actualValueType = fBuiltInKind;
-
- return avalue;
-
- } else if (fVariety == VARIETY_LIST) {
-
- StringTokenizer parsedList = new StringTokenizer(nvalue, " ");
- int countOfTokens = parsedList.countTokens() ;
- Object[] avalue = new Object[countOfTokens];
- boolean isUnion = fItemType.getVariety() == VARIETY_UNION;
- short[] itemTypes = new short[isUnion ? countOfTokens : 1];
- if (!isUnion)
- itemTypes[0] = fItemType.fBuiltInKind;
- XSSimpleTypeDecl[] memberTypes = new XSSimpleTypeDecl[countOfTokens];
- for(int i = 0 ; i < countOfTokens ; i ++){
- // we can't call fItemType.validate(), otherwise checkExtraRules()
- // will be called twice: once in fItemType.validate, once in
- // validate method of this type.
- // so we take two steps to get the actual value:
- // 1. fItemType.getActualValue()
- // 2. fItemType.chekcFacets()
- avalue[i] = fItemType.getActualValue(parsedList.nextToken(), context, validatedInfo, false);
- if (context.needFacetChecking() &&
- (fItemType.fFacetsDefined != 0 && fItemType.fFacetsDefined != FACET_WHITESPACE)) {
- fItemType.checkFacets(validatedInfo);
- }
- memberTypes[i] = (XSSimpleTypeDecl)validatedInfo.memberType;
- if (isUnion)
- itemTypes[i] = memberTypes[i].fBuiltInKind;
- }
-
- ListDV.ListData v = new ListDV.ListData(avalue);
- validatedInfo.actualValue = v;
- validatedInfo.actualValueType = isUnion ? XSConstants.LISTOFUNION_DT : XSConstants.LIST_DT;
- validatedInfo.memberType = null;
- validatedInfo.memberTypes = memberTypes;
- validatedInfo.itemValueTypes = new ShortListImpl(itemTypes, itemTypes.length);
- validatedInfo.normalizedValue = nvalue;
-
- return v;
-
- } else { // (fVariety == VARIETY_UNION)
- final Object _content = (fMemberTypes.length > 1 && content != null) ? content.toString() : content;
- for (int i = 0; i < fMemberTypes.length; i++) {
- try {
- // we can't call fMemberType[i].validate(), otherwise checkExtraRules()
- // will be called twice: once in fMemberType[i].validate, once in
- // validate method of this type.
- // so we take two steps to get the actual value:
- // 1. fMemberType[i].getActualValue()
- // 2. fMemberType[i].chekcFacets()
- Object aValue = fMemberTypes[i].getActualValue(_content, context, validatedInfo, true);
- if (context.needFacetChecking() &&
- (fMemberTypes[i].fFacetsDefined != 0 && fMemberTypes[i].fFacetsDefined != FACET_WHITESPACE)) {
- fMemberTypes[i].checkFacets(validatedInfo);
- }
- validatedInfo.memberType = fMemberTypes[i];
- return aValue;
- } catch(InvalidDatatypeValueException invalidValue) {
- }
- }
- StringBuffer typesBuffer = new StringBuffer();
- XSSimpleTypeDecl decl;
- for(int i = 0;i < fMemberTypes.length; i++) {
- if(i != 0)
- typesBuffer.append(" | ");
- decl = fMemberTypes[i];
- if(decl.fTargetNamespace != null) {
- typesBuffer.append('{');
- typesBuffer.append(decl.fTargetNamespace);
- typesBuffer.append('}');
- }
- typesBuffer.append(decl.fTypeName);
- if(decl.fEnumeration != null) {
- Vector v = decl.fEnumeration;
- typesBuffer.append(" : [");
- for(int j = 0;j < v.size(); j++) {
- if(j != 0)
- typesBuffer.append(',');
- typesBuffer.append(v.elementAt(j));
- }
- typesBuffer.append(']');
- }
- }
- throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.3",
- new Object[]{content, fTypeName, typesBuffer.toString()});
- }
-
- }//getActualValue()
-
- public boolean isEqual(Object value1, Object value2) {
- if (value1 == null) {
- return false;
- }
- return value1.equals(value2);
- }//isEqual()
-
- // determine whether the two values are identical
- public boolean isIdentical (Object value1, Object value2) {
- if (value1 == null) {
- return false;
- }
- return fDVs[fValidationDV].isIdentical(value1, value2);
- }//isIdentical()
-
- // normalize the string according to the whiteSpace facet
- public static String normalize(String content, short ws) {
- int len = content == null ? 0 : content.length();
- if (len == 0 || ws == WS_PRESERVE)
- return content;
-
- StringBuffer sb = new StringBuffer();
- if (ws == WS_REPLACE) {
- char ch;
- // when it's replace, just replace #x9, #xa, #xd by #x20
- for (int i = 0; i < len; i++) {
- ch = content.charAt(i);
- if (ch != 0x9 && ch != 0xa && ch != 0xd)
- sb.append(ch);
- else
- sb.append((char)0x20);
- }
- } else {
- char ch;
- int i;
- boolean isLeading = true;
- // when it's collapse
- for (i = 0; i < len; i++) {
- ch = content.charAt(i);
- // append real characters, so we passed leading ws
- if (ch != 0x9 && ch != 0xa && ch != 0xd && ch != 0x20) {
- sb.append(ch);
- isLeading = false;
- }
- else {
- // for whitespaces, we skip all following ws
- for (; i < len-1; i++) {
- ch = content.charAt(i+1);
- if (ch != 0x9 && ch != 0xa && ch != 0xd && ch != 0x20)
- break;
- }
- // if it's not a leading or tailing ws, then append a space
- if (i < len - 1 && !isLeading)
- sb.append((char)0x20);
- }
- }
- }
-
- return sb.toString();
- }
-
- // normalize the string according to the whiteSpace facet
- protected String normalize(Object content, short ws) {
- if (content == null)
- return null;
-
- // If pattern is not defined, we can skip some of the normalization.
- // Otherwise we have to normalize the data for correct result of
- // pattern validation.
- if ( (fFacetsDefined & FACET_PATTERN ) == 0 ) {
- short norm_type = fDVNormalizeType[fValidationDV];
- if (norm_type == NORMALIZE_NONE) {
- return content.toString();
- }
- else if (norm_type == NORMALIZE_TRIM) {
- return XMLChar.trim(content.toString());
- }
- }
-
- if (!(content instanceof StringBuffer)) {
- String strContent = content.toString();
- return normalize(strContent, ws);
- }
-
- StringBuffer sb = (StringBuffer)content;
- int len = sb.length();
- if (len == 0)
- return "";
- if (ws == WS_PRESERVE)
- return sb.toString();
-
- if (ws == WS_REPLACE) {
- char ch;
- // when it's replace, just replace #x9, #xa, #xd by #x20
- for (int i = 0; i < len; i++) {
- ch = sb.charAt(i);
- if (ch == 0x9 || ch == 0xa || ch == 0xd)
- sb.setCharAt(i, (char)0x20);
- }
- } else {
- char ch;
- int i, j = 0;
- boolean isLeading = true;
- // when it's collapse
- for (i = 0; i < len; i++) {
- ch = sb.charAt(i);
- // append real characters, so we passed leading ws
- if (ch != 0x9 && ch != 0xa && ch != 0xd && ch != 0x20) {
- sb.setCharAt(j++, ch);
- isLeading = false;
- }
- else {
- // for whitespaces, we skip all following ws
- for (; i < len-1; i++) {
- ch = sb.charAt(i+1);
- if (ch != 0x9 && ch != 0xa && ch != 0xd && ch != 0x20)
- break;
- }
- // if it's not a leading or tailing ws, then append a space
- if (i < len - 1 && !isLeading)
- sb.setCharAt(j++, (char)0x20);
- }
- }
- sb.setLength(j);
- }
-
- return sb.toString();
- }
-
- void reportError(String key, Object[] args) throws InvalidDatatypeFacetException {
- throw new InvalidDatatypeFacetException(key, args);
- }
-
-
- private String whiteSpaceValue(short ws){
- return WS_FACET_STRING[ws];
- }
-
- /**
- * Fundamental Facet: ordered.
- */
- public short getOrdered() {
- return fOrdered;
- }
-
- /**
- * Fundamental Facet: bounded.
- */
- public boolean getBounded(){
- return fBounded;
- }
-
- /**
- * Fundamental Facet: cardinality.
- */
- public boolean getFinite(){
- return fFinite;
- }
-
- /**
- * Fundamental Facet: numeric.
- */
- public boolean getNumeric(){
- return fNumeric;
- }
-
- /**
- * Convenience method. [Facets]: check whether a facet is defined on this
- * type.
- * @param facetName The name of the facet.
- * @return True if the facet is defined, false otherwise.
- */
- public boolean isDefinedFacet(short facetName) {
- if (fValidationDV == DV_ANYSIMPLETYPE ||
- fValidationDV == DV_ANYATOMICTYPE) {
- return false;
- }
- if ((fFacetsDefined & facetName) != 0) {
- return true;
- }
- if (fPatternType != SPECIAL_PATTERN_NONE) {
- return facetName == FACET_PATTERN;
- }
- if (fValidationDV == DV_INTEGER) {
- return facetName == FACET_PATTERN || facetName == FACET_FRACTIONDIGITS;
- }
- return false;
- }
-
- /**
- * [facets]: all facets defined on this type. The value is a bit
- * combination of FACET_XXX constants of all defined facets.
- */
- public short getDefinedFacets() {
- if (fValidationDV == DV_ANYSIMPLETYPE ||
- fValidationDV == DV_ANYATOMICTYPE) {
- return FACET_NONE;
- }
- if (fPatternType != SPECIAL_PATTERN_NONE) {
- return (short)(fFacetsDefined | FACET_PATTERN);
- }
- if (fValidationDV == DV_INTEGER) {
- return (short)(fFacetsDefined | FACET_PATTERN | FACET_FRACTIONDIGITS);
- }
- return fFacetsDefined;
- }
-
- /**
- * Convenience method. [Facets]: check whether a facet is defined and
- * fixed on this type.
- * @param facetName The name of the facet.
- * @return True if the facet is fixed, false otherwise.
- */
- public boolean isFixedFacet(short facetName) {
- if ((fFixedFacet & facetName) != 0)
- return true;
- if (fValidationDV == DV_INTEGER)
- return facetName == FACET_FRACTIONDIGITS;
- return false;
- }
-
- /**
- * [facets]: all defined facets for this type which are fixed.
- */
- public short getFixedFacets() {
- if (fValidationDV == DV_INTEGER)
- return (short)(fFixedFacet | FACET_FRACTIONDIGITS);
- return fFixedFacet;
- }
-
- /**
- * Convenience method. Returns a value of a single constraining facet for
- * this simple type definition. This method must not be used to retrieve
- * values for <code>enumeration</code> and <code>pattern</code> facets.
- * @param facetName The name of the facet, i.e.
- * <code>FACET_LENGTH, FACET_TOTALDIGITS </code> (see
- * <code>XSConstants</code>). To retrieve the value for a pattern or
- * an enumeration, see <code>enumeration</code> and
- * <code>pattern</code>.
- * @return A value of the facet specified in <code>facetName</code> for
- * this simple type definition or <code>null</code>.
- */
- public String getLexicalFacetValue(short facetName) {
- switch (facetName) {
- case FACET_LENGTH:
- return (fLength == -1)?null:Integer.toString(fLength);
- case FACET_MINLENGTH:
- return (fMinLength == -1)?null:Integer.toString(fMinLength);
- case FACET_MAXLENGTH:
- return (fMaxLength == -1)?null:Integer.toString(fMaxLength);
- case FACET_WHITESPACE:
- if (fValidationDV == DV_ANYSIMPLETYPE ||
- fValidationDV == DV_ANYATOMICTYPE) {
- return null;
- }
- return WS_FACET_STRING[fWhiteSpace];
- case FACET_MAXINCLUSIVE:
- return (fMaxInclusive == null)?null:fMaxInclusive.toString();
- case FACET_MAXEXCLUSIVE:
- return (fMaxExclusive == null)?null:fMaxExclusive.toString();
- case FACET_MINEXCLUSIVE:
- return (fMinExclusive == null)?null:fMinExclusive.toString();
- case FACET_MININCLUSIVE:
- return (fMinInclusive == null)?null:fMinInclusive.toString();
- case FACET_TOTALDIGITS:
- return (fTotalDigits == -1)?null:Integer.toString(fTotalDigits);
- case FACET_FRACTIONDIGITS:
- if (fValidationDV == DV_INTEGER) {
- return "0";
- }
- return (fFractionDigits == -1)?null:Integer.toString(fFractionDigits);
- }
- return null;
- }
-
- /**
- * A list of enumeration values if it exists, otherwise an empty
- * <code>StringList</code>.
- */
- public StringList getLexicalEnumeration() {
- if (fLexicalEnumeration == null){
- if (fEnumeration == null)
- return StringListImpl.EMPTY_LIST;
- int size = fEnumeration.size();
- String[] strs = new String[size];
- for (int i = 0; i < size; i++)
- strs[i] = fEnumeration.elementAt(i).toString();
- fLexicalEnumeration = new StringListImpl(strs, size);
- }
- return fLexicalEnumeration;
- }
-
- /**
- * A list of actual enumeration values if it exists, otherwise an empty
- * <code>ObjectList</code>.
- */
- public ObjectList getActualEnumeration() {
- if (fActualEnumeration == null) {
- fActualEnumeration = new AbstractObjectList() {
- public int getLength() {
- return (fEnumeration != null) ? fEnumeration.size() : 0;
- }
- public boolean contains(Object item) {
- return (fEnumeration != null && fEnumeration.contains(item));
- }
- public Object item(int index) {
- if (index < 0 || index >= getLength()) {
- return null;
- }
- return fEnumeration.elementAt(index);
- }
- };
- }
- return fActualEnumeration;
- }
-
- /**
- * A list of enumeration type values (as a list of ShortList objects) if it exists, otherwise returns
- * null
- */
- public ObjectList getEnumerationItemTypeList() {
- if (fEnumerationItemTypeList == null) {
- if(fEnumerationItemType == null)
- return null;
- fEnumerationItemTypeList = new AbstractObjectList() {
- public int getLength() {
- return (fEnumerationItemType != null) ? fEnumerationItemType.length : 0;
- }
- public boolean contains(Object item) {
- if(fEnumerationItemType == null || !(item instanceof ShortList))
- return false;
- for(int i = 0;i < fEnumerationItemType.length; i++)
- if(fEnumerationItemType[i] == item)
- return true;
- return false;
- }
- public Object item(int index) {
- if (index < 0 || index >= getLength()) {
- return null;
- }
- return fEnumerationItemType[index];
- }
- };
- }
- return fEnumerationItemTypeList;
- }
-
- public ShortList getEnumerationTypeList() {
- if (fEnumerationTypeList == null) {
- if (fEnumerationType == null) {
- return ShortListImpl.EMPTY_LIST;
- }
- fEnumerationTypeList = new ShortListImpl (fEnumerationType, fEnumerationType.length);
- }
- return fEnumerationTypeList;
- }
-
- /**
- * A list of pattern values if it exists, otherwise an empty
- * <code>StringList</code>.
- */
- public StringList getLexicalPattern() {
- if (fPatternType == SPECIAL_PATTERN_NONE && fValidationDV != DV_INTEGER && fPatternStr == null)
- return StringListImpl.EMPTY_LIST;
- if (fLexicalPattern == null){
- int size = fPatternStr == null ? 0 : fPatternStr.size();
- String[] strs;
- if (fPatternType == SPECIAL_PATTERN_NMTOKEN) {
- strs = new String[size+1];
- strs[size] = "\\c+";
- }
- else if (fPatternType == SPECIAL_PATTERN_NAME) {
- strs = new String[size+1];
- strs[size] = "\\i\\c*";
- }
- else if (fPatternType == SPECIAL_PATTERN_NCNAME) {
- strs = new String[size+2];
- strs[size] = "\\i\\c*";
- strs[size+1] = "[\\i-[:]][\\c-[:]]*";
- }
- else if (fValidationDV == DV_INTEGER) {
- strs = new String[size+1];
- strs[size] = "[\\-+]?[0-9]+";
- }
- else {
- strs = new String[size];
- }
- for (int i = 0; i < size; i++)
- strs[i] = (String)fPatternStr.elementAt(i);
- fLexicalPattern = new StringListImpl(strs, strs.length);
- }
- return fLexicalPattern;
- }
-
- /**
- * [annotations]: a set of annotations for this simple type component if
- * it exists, otherwise an empty <code>XSObjectList</code>.
- */
- public XSObjectList getAnnotations() {
- return (fAnnotations != null) ? fAnnotations : XSObjectListImpl.EMPTY_LIST;
- }
-
- private void calcFundamentalFacets() {
- setOrdered();
- setNumeric();
- setBounded();
- setCardinality();
- }
-
- private void setOrdered(){
-
- // When {variety} is atomic, {value} is inherited from {value} of {base type definition}. For all "primitive" types {value} is as specified in the table in Fundamental Facets (C.1).
- if(fVariety == VARIETY_ATOMIC){
- this.fOrdered = fBase.fOrdered;
- }
-
- // When {variety} is list, {value} is false.
- else if(fVariety == VARIETY_LIST){
- this.fOrdered = ORDERED_FALSE;
- }
-
- // When {variety} is union, the {value} is partial unless one of the following:
- // 1. If every member of {member type definitions} is derived from a common ancestor other than the simple ur-type, then {value} is the same as that ancestor's ordered facet.
- // 2. If every member of {member type definitions} has a {value} of false for the ordered facet, then {value} is false.
- else if(fVariety == VARIETY_UNION){
- int length = fMemberTypes.length;
- // REVISIT: is the length possible to be 0?
- if (length == 0) {
- this.fOrdered = ORDERED_PARTIAL;
- return;
- }
- // we need to process the first member type before entering the loop
- short ancestorId = getPrimitiveDV(fMemberTypes[0].fValidationDV);
- boolean commonAnc = ancestorId != DV_ANYSIMPLETYPE;
- boolean allFalse = fMemberTypes[0].fOrdered == ORDERED_FALSE;
- // for the other member types, check whether the value is false
- // and whether they have the same ancestor as the first one
- for (int i = 1; i < fMemberTypes.length && (commonAnc || allFalse); i++) {
- if (commonAnc)
- commonAnc = ancestorId == getPrimitiveDV(fMemberTypes[i].fValidationDV);
- if (allFalse)
- allFalse = fMemberTypes[i].fOrdered == ORDERED_FALSE;
- }
- if (commonAnc) {
- // REVISIT: all member types should have the same ordered value
- // just use the first one. Can we assume this?
- this.fOrdered = fMemberTypes[0].fOrdered;
- } else if (allFalse) {
- this.fOrdered = ORDERED_FALSE;
- } else {
- this.fOrdered = ORDERED_PARTIAL;
- }
- }
-
- }//setOrdered
-
- private void setNumeric(){
- if(fVariety == VARIETY_ATOMIC){
- this.fNumeric = fBase.fNumeric;
- }
- else if(fVariety == VARIETY_LIST){
- this.fNumeric = false;
- }
- else if(fVariety == VARIETY_UNION){
- XSSimpleType[] memberTypes = fMemberTypes;
- for(int i = 0 ; i < memberTypes.length ; i++){
- if(!memberTypes[i].getNumeric() ){
- this.fNumeric = false;
- return;
- }
- }
- this.fNumeric = true;
- }
-
- }//setNumeric
-
- private void setBounded(){
- if(fVariety == VARIETY_ATOMIC){
- if( (((this.fFacetsDefined & FACET_MININCLUSIVE) != 0) || ((this.fFacetsDefined & FACET_MINEXCLUSIVE) != 0))
- && (((this.fFacetsDefined & FACET_MAXINCLUSIVE) != 0) || ((this.fFacetsDefined & FACET_MAXEXCLUSIVE) != 0)) ){
- this.fBounded = true;
- }
- else{
- this.fBounded = false;
- }
- }
- else if(fVariety == VARIETY_LIST){
- if( ((this.fFacetsDefined & FACET_LENGTH) != 0 ) || ( ((this.fFacetsDefined & FACET_MINLENGTH) != 0 )
- && ((this.fFacetsDefined & FACET_MAXLENGTH) != 0 )) ){
- this.fBounded = true;
- }
- else{
- this.fBounded = false;
- }
-
- }
- else if(fVariety == VARIETY_UNION){
-
- XSSimpleTypeDecl [] memberTypes = this.fMemberTypes;
- short ancestorId = 0 ;
-
- if(memberTypes.length > 0){
- ancestorId = getPrimitiveDV(memberTypes[0].fValidationDV);
- }
-
- for(int i = 0 ; i < memberTypes.length ; i++){
- if(!memberTypes[i].getBounded() || (ancestorId != getPrimitiveDV(memberTypes[i].fValidationDV)) ){
- this.fBounded = false;
- return;
- }
- }
- this.fBounded = true;
- }
-
- }//setBounded
-
- private boolean specialCardinalityCheck(){
- if( (fBase.fValidationDV == XSSimpleTypeDecl.DV_DATE) || (fBase.fValidationDV == XSSimpleTypeDecl.DV_GYEARMONTH)
- || (fBase.fValidationDV == XSSimpleTypeDecl.DV_GYEAR) || (fBase.fValidationDV == XSSimpleTypeDecl.DV_GMONTHDAY)
- || (fBase.fValidationDV == XSSimpleTypeDecl.DV_GDAY) || (fBase.fValidationDV == XSSimpleTypeDecl.DV_GMONTH) ){
- return true;
- }
- return false;
-
- } //specialCardinalityCheck()
-
- private void setCardinality(){
- if(fVariety == VARIETY_ATOMIC){
- if(fBase.fFinite){
- this.fFinite = true;
- }
- else {// (!fBase.fFinite)
- if ( ((this.fFacetsDefined & FACET_LENGTH) != 0 ) || ((this.fFacetsDefined & FACET_MAXLENGTH) != 0 )
- || ((this.fFacetsDefined & FACET_TOTALDIGITS) != 0 ) ){
- this.fFinite = true;
- }
- else if( (((this.fFacetsDefined & FACET_MININCLUSIVE) != 0 ) || ((this.fFacetsDefined & FACET_MINEXCLUSIVE) != 0 ))
- && (((this.fFacetsDefined & FACET_MAXINCLUSIVE) != 0 ) || ((this.fFacetsDefined & FACET_MAXEXCLUSIVE) != 0 )) ){
- if( ((this.fFacetsDefined & FACET_FRACTIONDIGITS) != 0 ) || specialCardinalityCheck()){
- this.fFinite = true;
- }
- else{
- this.fFinite = false;
- }
- }
- else{
- this.fFinite = false;
- }
- }
- }
- else if(fVariety == VARIETY_LIST){
- if( ((this.fFacetsDefined & FACET_LENGTH) != 0 ) || ( ((this.fFacetsDefined & FACET_MINLENGTH) != 0 )
- && ((this.fFacetsDefined & FACET_MAXLENGTH) != 0 )) ){
- this.fFinite = true;
- }
- else{
- this.fFinite = false;
- }
-
- }
- else if(fVariety == VARIETY_UNION){
- XSSimpleType [] memberTypes = fMemberTypes;
- for(int i = 0 ; i < memberTypes.length ; i++){
- if(!(memberTypes[i].getFinite()) ){
- this.fFinite = false;
- return;
- }
- }
- this.fFinite = true;
- }
-
- }//setCardinality
-
- private short getPrimitiveDV(short validationDV){
-
- if (validationDV == DV_ID || validationDV == DV_IDREF || validationDV == DV_ENTITY){
- return DV_STRING;
- }
- else if (validationDV == DV_INTEGER) {
- return DV_DECIMAL;
- }
- else if (Constants.SCHEMA_1_1_SUPPORT && (validationDV == DV_YEARMONTHDURATION || validationDV == DV_DAYTIMEDURATION)) {
- return DV_DURATION;
- }
- else {
- return validationDV;
- }
-
- }//getPrimitiveDV()
-
- public boolean derivedFromType(XSTypeDefinition ancestor, short derivation) {
- // REVISIT: implement according to derivation
-
- // ancestor is null, return false
- if (ancestor == null) {
- return false;
- }
- // extract the actual XSTypeDefinition if the given ancestor is a delegate.
- while (ancestor instanceof XSSimpleTypeDelegate) {
- ancestor = ((XSSimpleTypeDelegate) ancestor).type;
- }
- // ancestor is anyType, return true
- // anyType is the only type whose base type is itself
- if (ancestor.getBaseType() == ancestor) {
- return true;
- }
- // recursively get base, and compare it with ancestor
- XSTypeDefinition type = this;
- while (type != ancestor && // compare with ancestor
- type != fAnySimpleType) { // reached anySimpleType
- type = type.getBaseType();
- }
- return type == ancestor;
- }
-
- public boolean derivedFrom(String ancestorNS, String ancestorName, short derivation) {
- // REVISIT: implement according to derivation
-
- // ancestor is null, retur false
- if (ancestorName == null)
- return false;
- // ancestor is anyType, return true
- if (URI_SCHEMAFORSCHEMA.equals(ancestorNS) &&
- ANY_TYPE.equals(ancestorName)) {
- return true;
- }
-
- // recursively get base, and compare it with ancestor
- XSTypeDefinition type = this;
- while (!(ancestorName.equals(type.getName()) &&
- ((ancestorNS == null && type.getNamespace() == null) ||
- (ancestorNS != null && ancestorNS.equals(type.getNamespace())))) && // compare with ancestor
- type != fAnySimpleType) { // reached anySimpleType
- type = (XSTypeDefinition)type.getBaseType();
- }
-
- return type != fAnySimpleType;
- }
-
- /**
- * Checks if a type is derived from another by restriction, given the name
- * and namespace. See:
- * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#TypeInfo-isDerivedFrom
- *
- * @param ancestorNS
- * The namspace of the ancestor type declaration
- * @param ancestorName
- * The name of the ancestor type declaration
- * @param derivationMethod
- * The derivation method
- *
- * @return boolean True if the ancestor type is derived from the reference type by the specifiied derivation method.
- */
- public boolean isDOMDerivedFrom(String ancestorNS, String ancestorName, int derivationMethod) {
-
- // ancestor is null, return false
- if (ancestorName == null)
- return false;
-
- // ancestor is anyType, return true
- if (SchemaSymbols.URI_SCHEMAFORSCHEMA.equals(ancestorNS)
- && SchemaSymbols.ATTVAL_ANYTYPE.equals(ancestorName)
- && (((derivationMethod & DERIVATION_RESTRICTION) != 0)
- || (derivationMethod == DERIVATION_ANY))) {
- return true;
- }
-
- // restriction
- if ((derivationMethod & DERIVATION_RESTRICTION) != 0) {
- if (isDerivedByRestriction(ancestorNS, ancestorName, this)) {
- return true;
- }
- }
-
- // list
- if ((derivationMethod & DERIVATION_LIST) != 0) {
- if (isDerivedByList(ancestorNS, ancestorName, this)) {
- return true;
- }
- }
-
- // union
- if ((derivationMethod & DERIVATION_UNION) != 0) {
- if (isDerivedByUnion(ancestorNS, ancestorName, this)) {
- return true;
- }
- }
-
- // extension
- if (((derivationMethod & DERIVATION_EXTENSION) != 0)
- && (((derivationMethod & DERIVATION_RESTRICTION) == 0)
- && ((derivationMethod & DERIVATION_LIST) == 0)
- && ((derivationMethod & DERIVATION_UNION) == 0))) {
- return false;
- }
-
- // If the value of the parameter is 0 i.e. no bit (corresponding to
- // restriction, list, extension or union) is set to 1 for the
- // derivationMethod parameter.
- if (((derivationMethod & DERIVATION_EXTENSION) == 0)
- && (((derivationMethod & DERIVATION_RESTRICTION) == 0)
- && ((derivationMethod & DERIVATION_LIST) == 0)
- && ((derivationMethod & DERIVATION_UNION) == 0))) {
- return isDerivedByAny(ancestorNS, ancestorName, this);
- }
-
- return false;
- }
-
-
- /**
- * Checks if a type is derived from another by any combination of restriction, list ir union. See:
- * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#TypeInfo-isDerivedFrom
- *
- * @param ancestorNS
- * The namspace of the ancestor type declaration
- * @param ancestorName
- * The name of the ancestor type declaration
- * @param type
- * The reference type definition
- *
- * @return boolean True if the type is derived by restriciton for the reference type
- */
- private boolean isDerivedByAny(String ancestorNS, String ancestorName,
- XSTypeDefinition type) {
-
- boolean derivedFrom = false;
- XSTypeDefinition oldType = null;
- // for each base, item or member type
- while (type != null && type != oldType) {
-
- // If the ancestor type is reached or is the same as this type.
- if ((ancestorName.equals(type.getName()))
- && ((ancestorNS == null && type.getNamespace() == null)
- || (ancestorNS != null && ancestorNS.equals(type.getNamespace())))) {
- derivedFrom = true;
- break;
- }
-
- // check if derived by restriction or list or union
- if (isDerivedByRestriction(ancestorNS, ancestorName, type)) {
- return true;
- } else if (isDerivedByList(ancestorNS, ancestorName, type)) {
- return true;
- } else if (isDerivedByUnion(ancestorNS, ancestorName, type)) {
- return true;
- }
- oldType = type;
- // get the base, item or member type depending on the variety
- if (((XSSimpleTypeDecl) type).getVariety() == VARIETY_ABSENT
- || ((XSSimpleTypeDecl) type).getVariety() == VARIETY_ATOMIC) {
- type = type.getBaseType();
- } else if (((XSSimpleTypeDecl) type).getVariety() == VARIETY_UNION) {
- for (int i = 0; i < ((XSSimpleTypeDecl) type).getMemberTypes().getLength(); i++) {
- return isDerivedByAny(ancestorNS, ancestorName,
- (XSTypeDefinition) ((XSSimpleTypeDecl) type)
- .getMemberTypes().item(i));
- }
- } else if (((XSSimpleTypeDecl) type).getVariety() == VARIETY_LIST) {
- type = ((XSSimpleTypeDecl) type).getItemType();
- }
- }
-
- return derivedFrom;
- }
-
- /**
- * DOM Level 3
- * Checks if a type is derived from another by restriction. See:
- * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#TypeInfo-isDerivedFrom
- *
- * @param ancestorNS
- * The namspace of the ancestor type declaration
- * @param ancestorName
- * The name of the ancestor type declaration
- * @param type
- * The reference type definition
- *
- * @return boolean True if the type is derived by restriciton for the
- * reference type
- */
- private boolean isDerivedByRestriction (String ancestorNS, String ancestorName, XSTypeDefinition type) {
- XSTypeDefinition oldType = null;
- while (type != null && type != oldType) {
- if ((ancestorName.equals(type.getName()))
- && ((ancestorNS != null && ancestorNS.equals(type.getNamespace()))
- || (type.getNamespace() == null && ancestorNS == null))) {
-
- return true;
- }
- oldType = type;
- type = type.getBaseType();
- }
-
- return false;
- }
-
- /**
- * Checks if a type is derived from another by list. See:
- * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#TypeInfo-isDerivedFrom
- *
- * @param ancestorNS
- * The namspace of the ancestor type declaration
- * @param ancestorName
- * The name of the ancestor type declaration
- * @param type
- * The reference type definition
- *
- * @return boolean True if the type is derived by list for the reference type
- */
- private boolean isDerivedByList (String ancestorNS, String ancestorName, XSTypeDefinition type) {
- // If the variety is union
- if (type !=null && ((XSSimpleTypeDefinition)type).getVariety() == VARIETY_LIST) {
-
- // get the {item type}
- XSTypeDefinition itemType = ((XSSimpleTypeDefinition)type).getItemType();
-
- // T2 is the {item type definition}
- if (itemType != null) {
-
- // T2 is derived from the other type definition by DERIVATION_RESTRICTION
- if (isDerivedByRestriction(ancestorNS, ancestorName, itemType)) {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * Checks if a type is derived from another by union. See:
- * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#TypeInfo-isDerivedFrom
- *
- * @param ancestorNS
- * The namspace of the ancestor type declaration
- * @param ancestorName
- * The name of the ancestor type declaration
- * @param type
- * The reference type definition
- *
- * @return boolean True if the type is derived by union for the reference type
- */
- private boolean isDerivedByUnion (String ancestorNS, String ancestorName, XSTypeDefinition type) {
-
- // If the variety is union
- if (type !=null && ((XSSimpleTypeDefinition)type).getVariety() == VARIETY_UNION) {
-
- // get member types
- XSObjectList memberTypes = ((XSSimpleTypeDefinition)type).getMemberTypes();
-
- for (int i = 0; i < memberTypes.getLength(); i++) {
- // One of the {member type definitions} is T2.
- if (memberTypes.item(i) != null) {
- // T2 is derived from the other type definition by DERIVATION_RESTRICTION
- if (isDerivedByRestriction(ancestorNS, ancestorName,(XSSimpleTypeDefinition)memberTypes.item(i))) {
- return true;
- }
- }
- }
- }
- return false;
- }
-
-
- static final XSSimpleTypeDecl fAnySimpleType = new XSSimpleTypeDecl(null, "anySimpleType", DV_ANYSIMPLETYPE, ORDERED_FALSE, false, true, false, true, XSConstants.ANYSIMPLETYPE_DT);
-
- static final XSSimpleTypeDecl fAnyAtomicType = new XSSimpleTypeDecl(fAnySimpleType, "anyAtomicType", DV_ANYATOMICTYPE, ORDERED_FALSE, false, true, false, true, XSSimpleTypeDecl.ANYATOMICTYPE_DT);
-
- /**
- * Validation context used to validate facet values.
- */
- static final ValidationContext fDummyContext = new ValidationContext() {
- public boolean needFacetChecking() {
- return true;
- }
-
- public boolean needExtraChecking() {
- return false;
- }
- public boolean needToNormalize() {
- return false;
- }
- public boolean useNamespaces() {
- return true;
- }
-
- public boolean isEntityDeclared(String name) {
- return false;
- }
-
- public boolean isEntityUnparsed(String name) {
- return false;
- }
-
- public boolean isIdDeclared(String name) {
- return false;
- }
-
- public void addId(String name) {
- }
-
- public void addIdRef(String name) {
- }
-
- public String getSymbol (String symbol) {
- return symbol.intern();
- }
-
- public String getURI(String prefix) {
- return null;
- }
-
- public Locale getLocale() {
- return Locale.getDefault();
- }
- };
-
- private boolean fAnonymous = false;
-
- /**
- * A wrapper of ValidationContext, to provide a way of switching to a
- * different Namespace declaration context.
- */
- static final class ValidationContextImpl implements ValidationContext {
-
- final ValidationContext fExternal;
-
- ValidationContextImpl(ValidationContext external) {
- fExternal = external;
- }
-
- NamespaceContext fNSContext;
- void setNSContext(NamespaceContext nsContext) {
- fNSContext = nsContext;
- }
-
- public boolean needFacetChecking() {
- return fExternal.needFacetChecking();
- }
-
- public boolean needExtraChecking() {
- return fExternal.needExtraChecking();
- }
- public boolean needToNormalize() {
- return fExternal.needToNormalize();
- }
- // schema validation is predicated upon namespaces
- public boolean useNamespaces() {
- return true;
- }
-
- public boolean isEntityDeclared (String name) {
- return fExternal.isEntityDeclared(name);
- }
-
- public boolean isEntityUnparsed (String name) {
- return fExternal.isEntityUnparsed(name);
- }
-
- public boolean isIdDeclared (String name) {
- return fExternal.isIdDeclared(name);
- }
-
- public void addId(String name) {
- fExternal.addId(name);
- }
-
- public void addIdRef(String name) {
- fExternal.addIdRef(name);
- }
-
- public String getSymbol (String symbol) {
- return fExternal.getSymbol(symbol);
- }
-
- public String getURI(String prefix) {
- if (fNSContext == null) {
- return fExternal.getURI(prefix);
- }
- else {
- return fNSContext.getURI(prefix);
- }
- }
-
- public Locale getLocale() {
- return fExternal.getLocale();
- }
- }
-
- public void reset(){
-
- // if it's immutable, can't be reset:
- if (fIsImmutable) return;
- fItemType = null;
- fMemberTypes = null;
-
- fTypeName = null;
- fTargetNamespace = null;
- fFinalSet = 0;
- fBase = null;
- fVariety = -1;
- fValidationDV = -1;
-
- fFacetsDefined = 0;
- fFixedFacet = 0;
-
- //for constraining facets
- fWhiteSpace = 0;
- fLength = -1;
- fMinLength = -1;
- fMaxLength = -1;
- fTotalDigits = -1;
- fFractionDigits = -1;
- fPattern = null;
- fPatternStr = null;
- fEnumeration = null;
- fEnumerationType = null;
- fEnumerationItemType = null;
- fLexicalPattern = null;
- fLexicalEnumeration = null;
- fMaxInclusive = null;
- fMaxExclusive = null;
- fMinExclusive = null;
- fMinInclusive = null;
- lengthAnnotation = null;
- minLengthAnnotation = null;
- maxLengthAnnotation = null;
- whiteSpaceAnnotation = null;
- totalDigitsAnnotation = null;
- fractionDigitsAnnotation = null;
- patternAnnotations = null;
- enumerationAnnotations = null;
- maxInclusiveAnnotation = null;
- maxExclusiveAnnotation = null;
- minInclusiveAnnotation = null;
- minExclusiveAnnotation = null;
-
- fPatternType = SPECIAL_PATTERN_NONE;
- fAnnotations = null;
- fFacets = null;
-
- // REVISIT: reset for fundamental facets
- }
-
- /**
- * @see com.sun.org.apache.xerces.internal.xs.XSObject#getNamespaceItem()
- */
- public XSNamespaceItem getNamespaceItem() {
- return fNamespaceItem;
- }
-
- public void setNamespaceItem(XSNamespaceItem namespaceItem) {
- fNamespaceItem = namespaceItem;
- }
-
- /**
- * @see java.lang.Object#toString()
- */
- public String toString() {
- return this.fTargetNamespace+"," +this.fTypeName;
- }
-
- /**
- * A list of constraining facets if it exists, otherwise an empty
- * <code>XSObjectList</code>. Note: This method must not be used to
- * retrieve values for <code>enumeration</code> and <code>pattern</code>
- * facets.
- */
- public XSObjectList getFacets() {
- if (fFacets == null &&
- (fFacetsDefined != 0 || fValidationDV == DV_INTEGER)) {
-
- XSFacetImpl[] facets = new XSFacetImpl[10];
- int count = 0;
- if ((fFacetsDefined & FACET_WHITESPACE) != 0 &&
- fValidationDV != DV_ANYSIMPLETYPE &&
- fValidationDV != DV_ANYATOMICTYPE) {
- facets[count] =
- new XSFacetImpl(
- FACET_WHITESPACE,
- WS_FACET_STRING[fWhiteSpace],
- (fFixedFacet & FACET_WHITESPACE) != 0,
- whiteSpaceAnnotation);
- count++;
- }
- if (fLength != -1) {
- facets[count] =
- new XSFacetImpl(
- FACET_LENGTH,
- Integer.toString(fLength),
- (fFixedFacet & FACET_LENGTH) != 0,
- lengthAnnotation);
- count++;
- }
- if (fMinLength != -1) {
- facets[count] =
- new XSFacetImpl(
- FACET_MINLENGTH,
- Integer.toString(fMinLength),
- (fFixedFacet & FACET_MINLENGTH) != 0,
- minLengthAnnotation);
- count++;
- }
- if (fMaxLength != -1) {
- facets[count] =
- new XSFacetImpl(
- FACET_MAXLENGTH,
- Integer.toString(fMaxLength),
- (fFixedFacet & FACET_MAXLENGTH) != 0,
- maxLengthAnnotation);
- count++;
- }
- if (fTotalDigits != -1) {
- facets[count] =
- new XSFacetImpl(
- FACET_TOTALDIGITS,
- Integer.toString(fTotalDigits),
- (fFixedFacet & FACET_TOTALDIGITS) != 0,
- totalDigitsAnnotation);
- count++;
- }
- if (fValidationDV == DV_INTEGER) {
- facets[count] =
- new XSFacetImpl(
- FACET_FRACTIONDIGITS,
- "0",
- true,
- fractionDigitsAnnotation);
- count++;
- }
- else if (fFractionDigits != -1) {
- facets[count] =
- new XSFacetImpl(
- FACET_FRACTIONDIGITS,
- Integer.toString(fFractionDigits),
- (fFixedFacet & FACET_FRACTIONDIGITS) != 0,
- fractionDigitsAnnotation);
- count++;
- }
- if (fMaxInclusive != null) {
- facets[count] =
- new XSFacetImpl(
- FACET_MAXINCLUSIVE,
- fMaxInclusive.toString(),
- (fFixedFacet & FACET_MAXINCLUSIVE) != 0,
- maxInclusiveAnnotation);
- count++;
- }
- if (fMaxExclusive != null) {
- facets[count] =
- new XSFacetImpl(
- FACET_MAXEXCLUSIVE,
- fMaxExclusive.toString(),
- (fFixedFacet & FACET_MAXEXCLUSIVE) != 0,
- maxExclusiveAnnotation);
- count++;
- }
- if (fMinExclusive != null) {
- facets[count] =
- new XSFacetImpl(
- FACET_MINEXCLUSIVE,
- fMinExclusive.toString(),
- (fFixedFacet & FACET_MINEXCLUSIVE) != 0,
- minExclusiveAnnotation);
- count++;
- }
- if (fMinInclusive != null) {
- facets[count] =
- new XSFacetImpl(
- FACET_MININCLUSIVE,
- fMinInclusive.toString(),
- (fFixedFacet & FACET_MININCLUSIVE) != 0,
- minInclusiveAnnotation);
- count++;
- }
- fFacets = (count > 0) ? new XSObjectListImpl(facets, count) : XSObjectListImpl.EMPTY_LIST;
- }
- return (fFacets != null) ? fFacets : XSObjectListImpl.EMPTY_LIST;
- }
-
- /**
- * A list of enumeration and pattern constraining facets if it exists,
- * otherwise an empty <code>XSObjectList</code>.
- */
- public XSObjectList getMultiValueFacets() {
- if (fMultiValueFacets == null &&
- ((fFacetsDefined & FACET_ENUMERATION) != 0 ||
- (fFacetsDefined & FACET_PATTERN) != 0 ||
- fPatternType != SPECIAL_PATTERN_NONE ||
- fValidationDV == DV_INTEGER)) {
-
- XSMVFacetImpl[] facets = new XSMVFacetImpl[2];
- int count = 0;
- if ((fFacetsDefined & FACET_PATTERN) != 0 ||
- fPatternType != SPECIAL_PATTERN_NONE ||
- fValidationDV == DV_INTEGER) {
- facets[count] =
- new XSMVFacetImpl(
- FACET_PATTERN,
- this.getLexicalPattern(),
- patternAnnotations);
- count++;
- }
- if (fEnumeration != null) {
- facets[count] =
- new XSMVFacetImpl(
- FACET_ENUMERATION,
- this.getLexicalEnumeration(),
- enumerationAnnotations);
- count++;
- }
- fMultiValueFacets = new XSObjectListImpl(facets, count);
- }
- return (fMultiValueFacets != null) ?
- fMultiValueFacets : XSObjectListImpl.EMPTY_LIST;
- }
-
- public Object getMinInclusiveValue() {
- return fMinInclusive;
- }
-
- public Object getMinExclusiveValue() {
- return fMinExclusive;
- }
-
- public Object getMaxInclusiveValue() {
- return fMaxInclusive;
- }
-
- public Object getMaxExclusiveValue() {
- return fMaxExclusive;
- }
-
- public void setAnonymous(boolean anon) {
- fAnonymous = anon;
- }
-
- private static final class XSFacetImpl implements XSFacet {
- final short kind;
- final String value;
- final boolean fixed;
- final XSObjectList annotations;
-
- public XSFacetImpl(short kind, String value, boolean fixed, XSAnnotation annotation) {
- this.kind = kind;
- this.value = value;
- this.fixed = fixed;
-
- if (annotation != null) {
- this.annotations = new XSObjectListImpl();
- ((XSObjectListImpl)this.annotations).addXSObject(annotation);
- }
- else {
- this.annotations = XSObjectListImpl.EMPTY_LIST;
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.sun.org.apache.xerces.internal.xs.XSFacet#getAnnotation()
- */
- /**
- * Optional. Annotation.
- */
- public XSAnnotation getAnnotation() {
- return (XSAnnotation) annotations.item(0);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.sun.org.apache.xerces.internal.xs.XSFacet#getAnnotations()
- */
- /**
- * Optional. Annotations.
- */
- public XSObjectList getAnnotations() {
- return annotations;
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xs.XSFacet#getFacetKind()
- */
- public short getFacetKind() {
- return kind;
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xs.XSFacet#getLexicalFacetValue()
- */
- public String getLexicalFacetValue() {
- return value;
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xs.XSFacet#isFixed()
- */
- public boolean getFixed() {
- return fixed;
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xs.XSObject#getName()
- */
- public String getName() {
- return null;
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xs.XSObject#getNamespace()
- */
- public String getNamespace() {
- return null;
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xs.XSObject#getNamespaceItem()
- */
- public XSNamespaceItem getNamespaceItem() {
- // REVISIT: implement
- return null;
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xs.XSObject#getType()
- */
- public short getType() {
- return XSConstants.FACET;
- }
-
- }
-
- private static final class XSMVFacetImpl implements XSMultiValueFacet {
- final short kind;
- final XSObjectList annotations;
- final StringList values;
-
- public XSMVFacetImpl(short kind, StringList values, XSObjectList annotations) {
- this.kind = kind;
- this.values = values;
- this.annotations = (annotations != null) ? annotations : XSObjectListImpl.EMPTY_LIST;
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xs.XSFacet#getFacetKind()
- */
- public short getFacetKind() {
- return kind;
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xs.XSMultiValueFacet#getAnnotations()
- */
- public XSObjectList getAnnotations() {
- return annotations;
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xs.XSMultiValueFacet#getLexicalFacetValues()
- */
- public StringList getLexicalFacetValues() {
- return values;
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xs.XSObject#getName()
- */
- public String getName() {
- return null;
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xs.XSObject#getNamespace()
- */
- public String getNamespace() {
- return null;
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xs.XSObject#getNamespaceItem()
- */
- public XSNamespaceItem getNamespaceItem() {
- // REVISIT: implement
- return null;
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xs.XSObject#getType()
- */
- public short getType() {
- return XSConstants.MULTIVALUE_FACET;
- }
- }
-
- private static abstract class AbstractObjectList extends AbstractList implements ObjectList {
- public Object get(int index) {
- if (index >= 0 && index < getLength()) {
- return item(index);
- }
- throw new IndexOutOfBoundsException("Index: " + index);
- }
- public int size() {
- return getLength();
- }
- }
-
- public String getTypeNamespace() {
- return getNamespace();
- }
-
- public boolean isDerivedFrom(String typeNamespaceArg, String typeNameArg, int derivationMethod) {
- return isDOMDerivedFrom(typeNamespaceArg, typeNameArg, derivationMethod);
- }
-
- private short convertToPrimitiveKind(short valueType) {
- /** Primitive datatypes. */
- if (valueType <= XSConstants.NOTATION_DT) {
- return valueType;
- }
- /** Types derived from string. */
- if (valueType <= XSConstants.ENTITY_DT) {
- return XSConstants.STRING_DT;
- }
- /** Types derived from decimal. */
- if (valueType <= XSConstants.POSITIVEINTEGER_DT) {
- return XSConstants.DECIMAL_DT;
- }
- /** Other types. */
- return valueType;
- }
-
-} // class XSSimpleTypeDecl
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/XSSimpleTypeDelegate.java b/src/com/sun/org/apache/xerces/internal/impl/dv/xs/XSSimpleTypeDelegate.java
deleted file mode 100644
index 1b683db..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/XSSimpleTypeDelegate.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.xs;
-
-import com.sun.org.apache.xerces.internal.impl.dv.DatatypeException;
-import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeFacetException;
-import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException;
-import com.sun.org.apache.xerces.internal.impl.dv.ValidatedInfo;
-import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
-import com.sun.org.apache.xerces.internal.impl.dv.XSFacets;
-import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType;
-import com.sun.org.apache.xerces.internal.xs.StringList;
-import com.sun.org.apache.xerces.internal.xs.XSNamespaceItem;
-import com.sun.org.apache.xerces.internal.xs.XSObjectList;
-import com.sun.org.apache.xerces.internal.xs.XSSimpleTypeDefinition;
-import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
-
-/**
- * Base class for XSSimpleType wrapper implementations.
- *
- * @xerces.internal
- *
- * @version $Id: XSSimpleTypeDelegate.java,v 1.3 2010-11-01 04:39:47 joehw Exp $
- */
-public class XSSimpleTypeDelegate
- implements XSSimpleType {
-
- protected final XSSimpleType type;
-
- public XSSimpleTypeDelegate(XSSimpleType type) {
- if (type == null) {
- throw new NullPointerException();
- }
- this.type = type;
- }
-
- public XSSimpleType getWrappedXSSimpleType() {
- return type;
- }
-
- public XSObjectList getAnnotations() {
- return type.getAnnotations();
- }
-
- public boolean getBounded() {
- return type.getBounded();
- }
-
- public short getBuiltInKind() {
- return type.getBuiltInKind();
- }
-
- public short getDefinedFacets() {
- return type.getDefinedFacets();
- }
-
- public XSObjectList getFacets() {
- return type.getFacets();
- }
-
- public boolean getFinite() {
- return type.getFinite();
- }
-
- public short getFixedFacets() {
- return type.getFixedFacets();
- }
-
- public XSSimpleTypeDefinition getItemType() {
- return type.getItemType();
- }
-
- public StringList getLexicalEnumeration() {
- return type.getLexicalEnumeration();
- }
-
- public String getLexicalFacetValue(short facetName) {
- return type.getLexicalFacetValue(facetName);
- }
-
- public StringList getLexicalPattern() {
- return type.getLexicalPattern();
- }
-
- public XSObjectList getMemberTypes() {
- return type.getMemberTypes();
- }
-
- public XSObjectList getMultiValueFacets() {
- return type.getMultiValueFacets();
- }
-
- public boolean getNumeric() {
- return type.getNumeric();
- }
-
- public short getOrdered() {
- return type.getOrdered();
- }
-
- public XSSimpleTypeDefinition getPrimitiveType() {
- return type.getPrimitiveType();
- }
-
- public short getVariety() {
- return type.getVariety();
- }
-
- public boolean isDefinedFacet(short facetName) {
- return type.isDefinedFacet(facetName);
- }
-
- public boolean isFixedFacet(short facetName) {
- return type.isFixedFacet(facetName);
- }
-
- public boolean derivedFrom(String namespace, String name, short derivationMethod) {
- return type.derivedFrom(namespace, name, derivationMethod);
- }
-
- public boolean derivedFromType(XSTypeDefinition ancestorType, short derivationMethod) {
- return type.derivedFromType(ancestorType, derivationMethod);
- }
-
- public boolean getAnonymous() {
- return type.getAnonymous();
- }
-
- public XSTypeDefinition getBaseType() {
- return type.getBaseType();
- }
-
- public short getFinal() {
- return type.getFinal();
- }
-
- public short getTypeCategory() {
- return type.getTypeCategory();
- }
-
- public boolean isFinal(short restriction) {
- return type.isFinal(restriction);
- }
-
- public String getName() {
- return type.getName();
- }
-
- public String getNamespace() {
- return type.getNamespace();
- }
-
- public XSNamespaceItem getNamespaceItem() {
- return type.getNamespaceItem();
- }
-
- public short getType() {
- return type.getType();
- }
-
- public void applyFacets(XSFacets facets, short presentFacet, short fixedFacet, ValidationContext context)
- throws InvalidDatatypeFacetException {
- type.applyFacets(facets, presentFacet, fixedFacet, context);
- }
-
- public short getPrimitiveKind() {
- return type.getPrimitiveKind();
- }
-
- public short getWhitespace() throws DatatypeException {
- return type.getWhitespace();
- }
-
- public boolean isEqual(Object value1, Object value2) {
- return type.isEqual(value1, value2);
- }
-
- public boolean isIDType() {
- return type.isIDType();
- }
-
- public void validate(ValidationContext context, ValidatedInfo validatedInfo)
- throws InvalidDatatypeValueException {
- type.validate(context, validatedInfo);
- }
-
- public Object validate(String content, ValidationContext context, ValidatedInfo validatedInfo)
- throws InvalidDatatypeValueException {
- return type.validate(content, context, validatedInfo);
- }
-
- public Object validate(Object content, ValidationContext context, ValidatedInfo validatedInfo)
- throws InvalidDatatypeValueException {
- return type.validate(content, context, validatedInfo);
- }
-
- public String toString() {
- return type.toString();
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/YearDV.java b/src/com/sun/org/apache/xerces/internal/impl/dv/xs/YearDV.java
deleted file mode 100644
index d069c40..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/YearDV.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.xs;
-
-import javax.xml.datatype.DatatypeConstants;
-import javax.xml.datatype.XMLGregorianCalendar;
-
-import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException;
-import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
-
-/**
- * Validator for &lt;gYear&gt; datatype (W3C Schema Datatypes)
- *
- * @xerces.internal
- *
- * @author Elena Litani
- * @author Gopal Sharma, SUN Microsystem Inc.
- *
- * @version $Id: YearDV.java,v 1.7 2010-11-01 04:39:47 joehw Exp $
- */
-
-public class YearDV extends AbstractDateTimeDV {
-
- /**
- * Convert a string to a compiled form
- *
- * @param content The lexical representation of time
- * @return a valid and normalized time object
- */
- public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException{
- try{
- return parse(content);
- } catch(Exception ex){
- throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "gYear"});
- }
- }
-
- /**
- * Parses, validates and computes normalized version of gYear object
- *
- * @param str The lexical representation of year object CCYY
- * with possible time zone Z or (-),(+)hh:mm
- * @return normalized date representation
- * @exception SchemaDateTimeException Invalid lexical representation
- */
- protected DateTimeData parse(String str) throws SchemaDateTimeException{
- DateTimeData date = new DateTimeData(str, this);
- int len = str.length();
-
- // check for preceding '-' sign
- int start = 0;
- if (str.charAt(0)=='-') {
- start = 1;
- }
- int sign = findUTCSign(str, start, len);
-
- final int length = ((sign == -1) ? len : sign) - start;
- if (length < 4) {
- throw new RuntimeException("Year must have 'CCYY' format");
- }
- else if (length > 4 && str.charAt(start) == '0') {
- throw new RuntimeException("Leading zeros are required if the year value would otherwise have fewer than four digits; otherwise they are forbidden");
- }
-
- if (sign == -1) {
- date.year=parseIntYear(str, len);
- }
- else {
- date.year=parseIntYear(str, sign);
- getTimeZone (str, date, sign, len);
- }
-
- //initialize values
- date.month=MONTH;
- date.day=1;
-
- //validate and normalize
- validateDateTime(date);
-
- //save unnormalized values
- saveUnnormalized(date);
-
- if ( date.utc!=0 && date.utc!='Z' ) {
- normalize(date);
- }
- date.position = 0;
- return date;
- }
-
- /**
- * Converts year object representation to String
- *
- * @param date year object
- * @return lexical representation of month: CCYY with optional time zone sign
- */
- protected String dateToString(DateTimeData date) {
- StringBuffer message = new StringBuffer(5);
- append(message, date.year, 4);
- append(message, (char)date.utc, 0);
- return message.toString();
- }
-
- protected XMLGregorianCalendar getXMLGregorianCalendar(DateTimeData date) {
- return datatypeFactory.newXMLGregorianCalendar(date.unNormYear, DatatypeConstants.FIELD_UNDEFINED,
- DatatypeConstants.FIELD_UNDEFINED, DatatypeConstants.FIELD_UNDEFINED, DatatypeConstants.FIELD_UNDEFINED,
- DatatypeConstants.FIELD_UNDEFINED, DatatypeConstants.FIELD_UNDEFINED,
- date.hasTimeZone() ? date.timezoneHr * 60 + date.timezoneMin : DatatypeConstants.FIELD_UNDEFINED);
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/YearMonthDV.java b/src/com/sun/org/apache/xerces/internal/impl/dv/xs/YearMonthDV.java
deleted file mode 100644
index 6b96deb..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/YearMonthDV.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.dv.xs;
-
-import javax.xml.datatype.DatatypeConstants;
-import javax.xml.datatype.XMLGregorianCalendar;
-
-import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException;
-import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
-
-/**
- * Validator for &lt;gYearMonth&gt; datatype (W3C Schema Datatypes)
- *
- * @xerces.internal
- *
- * @author Elena Litani
- * @author Gopal Sharma, SUN Microsystem Inc.
- *
- * @version $Id: YearMonthDV.java,v 1.7 2010-11-01 04:39:47 joehw Exp $
- */
-public class YearMonthDV extends AbstractDateTimeDV{
-
- /**
- * Convert a string to a compiled form
- *
- * @param content The lexical representation of gYearMonth
- * @return a valid and normalized gYearMonth object
- */
- public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException{
- try{
- return parse(content);
- } catch(Exception ex){
- throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "gYearMonth"});
- }
- }
-
- /**
- * Parses, validates and computes normalized version of gYearMonth object
- *
- * @param str The lexical representation of gYearMonth object CCYY-MM
- * with possible time zone Z or (-),(+)hh:mm
- * @return normalized date representation
- * @exception SchemaDateTimeException Invalid lexical representation
- */
- protected DateTimeData parse(String str) throws SchemaDateTimeException{
- DateTimeData date = new DateTimeData(str, this);
- int len = str.length();
-
- // get date
- int end = getYearMonth(str, 0, len, date);
- date.day = DAY;
- parseTimeZone (str, end, len, date);
-
- //validate and normalize
-
- validateDateTime(date);
-
- //save unnormalized values
- saveUnnormalized(date);
-
- if ( date.utc!=0 && date.utc!='Z' ) {
- normalize(date);
- }
- date.position = 0;
- return date;
- }
-
- protected String dateToString(DateTimeData date) {
- StringBuffer message = new StringBuffer(25);
- append(message, date.year, 4);
- message.append('-');
- append(message, date.month, 2);
- append(message, (char)date.utc, 0);
- return message.toString();
- }
-
- protected XMLGregorianCalendar getXMLGregorianCalendar(DateTimeData date) {
- return datatypeFactory.newXMLGregorianCalendar(date.unNormYear, date.unNormMonth, DatatypeConstants.FIELD_UNDEFINED,
- DatatypeConstants.FIELD_UNDEFINED, DatatypeConstants.FIELD_UNDEFINED,
- DatatypeConstants.FIELD_UNDEFINED, DatatypeConstants.FIELD_UNDEFINED,
- date.hasTimeZone() ? date.timezoneHr * 60 + date.timezoneMin : DatatypeConstants.FIELD_UNDEFINED);
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/YearMonthDurationDV.java b/src/com/sun/org/apache/xerces/internal/impl/dv/xs/YearMonthDurationDV.java
deleted file mode 100644
index 4723a65..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/xs/YearMonthDurationDV.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xerces.internal.impl.dv.xs;
-
-import java.math.BigInteger;
-
-import javax.xml.datatype.DatatypeConstants;
-import javax.xml.datatype.Duration;
-
-import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException;
-import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
-
-/**
- * Used to validate the <yearMonthDuration> type
- *
- * @xerces.internal
- *
- * @author Ankit Pasricha, IBM
- *
- * @version $Id: YearMonthDurationDV.java,v 1.6 2010-11-01 04:39:47 joehw Exp $
- */
-class YearMonthDurationDV extends DurationDV {
-
- public Object getActualValue(String content, ValidationContext context)
- throws InvalidDatatypeValueException {
- try {
- return parse(content, DurationDV.YEARMONTHDURATION_TYPE);
- }
- catch (Exception ex) {
- throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "yearMonthDuration"});
- }
- }
-
- protected Duration getDuration(DateTimeData date) {
- int sign = 1;
- if ( date.year<0 || date.month<0) {
- sign = -1;
- }
- return datatypeFactory.newDuration(sign == 1,
- date.year != DatatypeConstants.FIELD_UNDEFINED?BigInteger.valueOf(sign*date.year):null,
- date.month != DatatypeConstants.FIELD_UNDEFINED?BigInteger.valueOf(sign*date.month):null,
- null,
- null,
- null,
- null);
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/io/ASCIIReader.java b/src/com/sun/org/apache/xerces/internal/impl/io/ASCIIReader.java
deleted file mode 100644
index 0698c58..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/io/ASCIIReader.java
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2000-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.io;
-
-import java.io.InputStream;
-import java.io.IOException;
-import java.io.Reader;
-import java.util.Locale;
-import com.sun.org.apache.xerces.internal.util.MessageFormatter;
-import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter;
-
-import com.sun.xml.internal.stream.util.BufferAllocator;
-import com.sun.xml.internal.stream.util.ThreadLocalBufferAllocator;
-
-/**
- * A simple ASCII byte reader. This is an optimized reader for reading
- * byte streams that only contain 7-bit ASCII characters.
- *
- * @xerces.internal
- *
- * @author Andy Clark, IBM
- *
- */
-public class ASCIIReader
- extends Reader {
-
- //
- // Constants
- //
-
- /** Default byte buffer size (2048). */
- public static final int DEFAULT_BUFFER_SIZE = 2048;
-
- //
- // Data
- //
-
- /** Input stream. */
- protected InputStream fInputStream;
-
- /** Byte buffer. */
- protected byte[] fBuffer;
-
- // message formatter; used to produce localized
- // exception messages
- private MessageFormatter fFormatter = null;
-
- //Locale to use for messages
- private Locale fLocale = null;
-
- //
- // Constructors
- //
-
- /**
- * Constructs an ASCII reader from the specified input stream
- * using the default buffer size.
- *
- * @param inputStream The input stream.
- * @param messageFormatter the MessageFormatter to use to message reporting.
- * @param locale the Locale for which messages are to be reported
- */
- public ASCIIReader(InputStream inputStream, MessageFormatter messageFormatter,
- Locale locale) {
- this(inputStream, DEFAULT_BUFFER_SIZE, messageFormatter, locale);
- } // <init>(InputStream, MessageFormatter, Locale)
-
- /**
- * Constructs an ASCII reader from the specified input stream
- * and buffer size.
- *
- * @param inputStream The input stream.
- * @param size The initial buffer size.
- * @param messageFormatter the MessageFormatter to use to message reporting.
- * @param locale the Locale for which messages are to be reported
- */
- public ASCIIReader(InputStream inputStream, int size,
- MessageFormatter messageFormatter, Locale locale) {
- fInputStream = inputStream;
- BufferAllocator ba = ThreadLocalBufferAllocator.getBufferAllocator();
- fBuffer = ba.getByteBuffer(size);
- if (fBuffer == null) {
- fBuffer = new byte[size];
- }
- fFormatter = messageFormatter;
- fLocale = locale;
- } // <init>(InputStream,int, MessageFormatter, Locale)
-
- //
- // Reader methods
- //
-
- /**
- * Read a single character. This method will block until a character is
- * available, an I/O error occurs, or the end of the stream is reached.
- *
- * <p> Subclasses that intend to support efficient single-character input
- * should override this method.
- *
- * @return The character read, as an integer in the range 0 to 127
- * (<tt>0x00-0x7f</tt>), or -1 if the end of the stream has
- * been reached
- *
- * @exception IOException If an I/O error occurs
- */
- public int read() throws IOException {
- int b0 = fInputStream.read();
- if (b0 >= 0x80) {
- throw new MalformedByteSequenceException(fFormatter,
- fLocale, XMLMessageFormatter.XML_DOMAIN,
- "InvalidASCII", new Object [] {Integer.toString(b0)});
- }
- return b0;
- } // read():int
-
- /**
- * Read characters into a portion of an array. This method will block
- * until some input is available, an I/O error occurs, or the end of the
- * stream is reached.
- *
- * @param ch Destination buffer
- * @param offset Offset at which to start storing characters
- * @param length Maximum number of characters to read
- *
- * @return The number of characters read, or -1 if the end of the
- * stream has been reached
- *
- * @exception IOException If an I/O error occurs
- */
- public int read(char ch[], int offset, int length) throws IOException {
- if (length > fBuffer.length) {
- length = fBuffer.length;
- }
- int count = fInputStream.read(fBuffer, 0, length);
- for (int i = 0; i < count; i++) {
- int b0 = fBuffer[i];
- if (b0 < 0) {
- throw new MalformedByteSequenceException(fFormatter,
- fLocale, XMLMessageFormatter.XML_DOMAIN,
- "InvalidASCII", new Object [] {Integer.toString(b0 & 0x0FF)});
- }
- ch[offset + i] = (char)b0;
- }
- return count;
- } // read(char[],int,int)
-
- /**
- * Skip characters. This method will block until some characters are
- * available, an I/O error occurs, or the end of the stream is reached.
- *
- * @param n The number of characters to skip
- *
- * @return The number of characters actually skipped
- *
- * @exception IOException If an I/O error occurs
- */
- public long skip(long n) throws IOException {
- return fInputStream.skip(n);
- } // skip(long):long
-
- /**
- * Tell whether this stream is ready to be read.
- *
- * @return True if the next read() is guaranteed not to block for input,
- * false otherwise. Note that returning false does not guarantee that the
- * next read will block.
- *
- * @exception IOException If an I/O error occurs
- */
- public boolean ready() throws IOException {
- return false;
- } // ready()
-
- /**
- * Tell whether this stream supports the mark() operation.
- */
- public boolean markSupported() {
- return fInputStream.markSupported();
- } // markSupported()
-
- /**
- * Mark the present position in the stream. Subsequent calls to reset()
- * will attempt to reposition the stream to this point. Not all
- * character-input streams support the mark() operation.
- *
- * @param readAheadLimit Limit on the number of characters that may be
- * read while still preserving the mark. After
- * reading this many characters, attempting to
- * reset the stream may fail.
- *
- * @exception IOException If the stream does not support mark(),
- * or if some other I/O error occurs
- */
- public void mark(int readAheadLimit) throws IOException {
- fInputStream.mark(readAheadLimit);
- } // mark(int)
-
- /**
- * Reset the stream. If the stream has been marked, then attempt to
- * reposition it at the mark. If the stream has not been marked, then
- * attempt to reset it in some way appropriate to the particular stream,
- * for example by repositioning it to its starting point. Not all
- * character-input streams support the reset() operation, and some support
- * reset() without supporting mark().
- *
- * @exception IOException If the stream has not been marked,
- * or if the mark has been invalidated,
- * or if the stream does not support reset(),
- * or if some other I/O error occurs
- */
- public void reset() throws IOException {
- fInputStream.reset();
- } // reset()
-
- /**
- * Close the stream. Once a stream has been closed, further read(),
- * ready(), mark(), or reset() invocations will throw an IOException.
- * Closing a previously-closed stream, however, has no effect.
- *
- * @exception IOException If an I/O error occurs
- */
- public void close() throws IOException {
- BufferAllocator ba = ThreadLocalBufferAllocator.getBufferAllocator();
- ba.returnByteBuffer(fBuffer);
- fBuffer = null;
- fInputStream.close();
- } // close()
-
-} // class ASCIIReader
diff --git a/src/com/sun/org/apache/xerces/internal/impl/io/MalformedByteSequenceException.java b/src/com/sun/org/apache/xerces/internal/impl/io/MalformedByteSequenceException.java
deleted file mode 100644
index d685177..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/io/MalformedByteSequenceException.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.io;
-
-import java.io.CharConversionException;
-import java.util.Locale;
-import com.sun.org.apache.xerces.internal.util.MessageFormatter;
-
-/**
- * <p>Signals that a malformed byte sequence was detected
- * by a <code>java.io.Reader</code> that decodes bytes
- * of a given encoding into characters.</p>
- *
- * @xerces.internal
- *
- * @author Michael Glavassevich, IBM
- *
- */
-public class MalformedByteSequenceException extends CharConversionException {
-
- /** Serialization version. */
- static final long serialVersionUID = 8436382245048328739L;
-
- //
- // Data
- //
-
- /** message formatter **/
- private MessageFormatter fFormatter;
-
- /** locale for error message **/
- private Locale fLocale;
-
- /** error domain **/
- private String fDomain;
-
- /** key for the error message **/
- private String fKey;
-
- /** replacement arguements for the error message **/
- private Object[] fArguments;
-
- /** message text for this message, initially null **/
- private String fMessage;
-
- //
- // Constructors
- //
-
- /**
- * Constructs a MalformedByteSequenceException with the given
- * parameters which may be passed to an error reporter to
- * generate a localized string for this exception.
- *
- * @param formatter The MessageFormatter used for building the
- * message text for this exception.
- * @param locale The Locale for which messages are to be reported.
- * @param domain The error domain.
- * @param key The key of the error message.
- * @param arguments The replacement arguments for the error message,
- * if needed.
- */
- public MalformedByteSequenceException(MessageFormatter formatter,
- Locale locale, String domain, String key, Object[] arguments) {
- fFormatter = formatter;
- fLocale = locale;
- fDomain = domain;
- fKey = key;
- fArguments = arguments;
- } // <init>(MessageFormatter, Locale, String, String, Object[])
-
- //
- // Public methods
- //
-
- /**
- * <p>Returns the error domain of the error message.</p>
- *
- * @return the error domain
- */
- public String getDomain () {
- return fDomain;
- } // getDomain
-
- /**
- * <p>Returns the key of the error message.</p>
- *
- * @return the error key of the error message
- */
- public String getKey () {
- return fKey;
- } // getKey()
-
- /**
- * <p>Returns the replacement arguments for the error
- * message or <code>null</code> if none exist.</p>
- *
- * @return the replacement arguments for the error message
- * or <code>null</code> if none exist
- */
- public Object[] getArguments () {
- return fArguments;
- } // getArguments();
-
- /**
- * <p>Returns the localized message for this exception.</p>
- *
- * @return the localized message for this exception.
- */
- public String getMessage() {
- if (fMessage == null) {
- fMessage = fFormatter.formatMessage(fLocale, fKey, fArguments);
- // The references to the message formatter and locale
- // aren't needed anymore so null them.
- fFormatter = null;
- fLocale = null;
- }
- return fMessage;
- } // getMessage()
-
-} // MalformedByteSequenceException
diff --git a/src/com/sun/org/apache/xerces/internal/impl/io/UCSReader.java b/src/com/sun/org/apache/xerces/internal/impl/io/UCSReader.java
deleted file mode 100644
index 74db5f6..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/io/UCSReader.java
+++ /dev/null
@@ -1,311 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2000-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.io;
-
-import java.io.InputStream;
-import java.io.IOException;
-import java.io.Reader;
-
-import com.sun.xml.internal.stream.util.BufferAllocator;
-import com.sun.xml.internal.stream.util.ThreadLocalBufferAllocator;
-
-/**
- * Reader for UCS-2 and UCS-4 encodings.
- * (i.e., encodings from ISO-10646-UCS-(2|4)).
- *
- * @xerces.internal
- *
- * @author Neil Graham, IBM
- *
- */
-public class UCSReader extends Reader {
-
- //
- // Constants
- //
-
- /** Default byte buffer size (8192, larger than that of ASCIIReader
- * since it's reasonable to surmise that the average UCS-4-encoded
- * file should be 4 times as large as the average ASCII-encoded file).
- */
- public static final int DEFAULT_BUFFER_SIZE = 8192;
-
- public static final short UCS2LE = 1;
- public static final short UCS2BE = 2;
- public static final short UCS4LE = 4;
- public static final short UCS4BE = 8;
-
- //
- // Data
- //
-
- /** Input stream. */
- protected InputStream fInputStream;
-
- /** Byte buffer. */
- protected byte[] fBuffer;
-
- // what kind of data we're dealing with
- protected short fEncoding;
-
- //
- // Constructors
- //
-
- /**
- * Constructs an ASCII reader from the specified input stream
- * using the default buffer size. The Endian-ness and whether this is
- * UCS-2 or UCS-4 needs also to be known in advance.
- *
- * @param inputStream The input stream.
- * @param encoding One of UCS2LE, UCS2BE, UCS4LE or UCS4BE.
- */
- public UCSReader(InputStream inputStream, short encoding) {
- this(inputStream, DEFAULT_BUFFER_SIZE, encoding);
- } // <init>(InputStream, short)
-
- /**
- * Constructs an ASCII reader from the specified input stream
- * and buffer size. The Endian-ness and whether this is
- * UCS-2 or UCS-4 needs also to be known in advance.
- *
- * @param inputStream The input stream.
- * @param size The initial buffer size.
- * @param encoding One of UCS2LE, UCS2BE, UCS4LE or UCS4BE.
- */
- public UCSReader(InputStream inputStream, int size, short encoding) {
- fInputStream = inputStream;
- BufferAllocator ba = ThreadLocalBufferAllocator.getBufferAllocator();
- fBuffer = ba.getByteBuffer(size);
- if (fBuffer == null) {
- fBuffer = new byte[size];
- }
- fEncoding = encoding;
- } // <init>(InputStream,int,short)
-
- //
- // Reader methods
- //
-
- /**
- * Read a single character. This method will block until a character is
- * available, an I/O error occurs, or the end of the stream is reached.
- *
- * <p> Subclasses that intend to support efficient single-character input
- * should override this method.
- *
- * @return The character read, as an integer in the range 0 to 127
- * (<tt>0x00-0x7f</tt>), or -1 if the end of the stream has
- * been reached
- *
- * @exception IOException If an I/O error occurs
- */
- public int read() throws IOException {
- int b0 = fInputStream.read() & 0xff;
- if (b0 == 0xff)
- return -1;
- int b1 = fInputStream.read() & 0xff;
- if (b1 == 0xff)
- return -1;
- if(fEncoding >=4) {
- int b2 = fInputStream.read() & 0xff;
- if (b2 == 0xff)
- return -1;
- int b3 = fInputStream.read() & 0xff;
- if (b3 == 0xff)
- return -1;
- System.err.println("b0 is " + (b0 & 0xff) + " b1 " + (b1 & 0xff) + " b2 " + (b2 & 0xff) + " b3 " + (b3 & 0xff));
- if (fEncoding == UCS4BE)
- return (b0<<24)+(b1<<16)+(b2<<8)+b3;
- else
- return (b3<<24)+(b2<<16)+(b1<<8)+b0;
- } else { // UCS-2
- if (fEncoding == UCS2BE)
- return (b0<<8)+b1;
- else
- return (b1<<8)+b0;
- }
- } // read():int
-
- /**
- * Read characters into a portion of an array. This method will block
- * until some input is available, an I/O error occurs, or the end of the
- * stream is reached.
- *
- * @param ch Destination buffer
- * @param offset Offset at which to start storing characters
- * @param length Maximum number of characters to read
- *
- * @return The number of characters read, or -1 if the end of the
- * stream has been reached
- *
- * @exception IOException If an I/O error occurs
- */
- public int read(char ch[], int offset, int length) throws IOException {
- int byteLength = length << ((fEncoding >= 4)?2:1);
- if (byteLength > fBuffer.length) {
- byteLength = fBuffer.length;
- }
- int count = fInputStream.read(fBuffer, 0, byteLength);
- if(count == -1) return -1;
- // try and make count be a multiple of the number of bytes we're looking for
- if(fEncoding >= 4) { // BigEndian
- // this looks ugly, but it avoids an if at any rate...
- int numToRead = (4 - (count & 3) & 3);
- for(int i=0; i<numToRead; i++) {
- int charRead = fInputStream.read();
- if(charRead == -1) { // end of input; something likely went wrong!A Pad buffer with nulls.
- for (int j = i;j<numToRead; j++)
- fBuffer[count+j] = 0;
- break;
- } else {
- fBuffer[count+i] = (byte)charRead;
- }
- }
- count += numToRead;
- } else {
- int numToRead = count & 1;
- if(numToRead != 0) {
- count++;
- int charRead = fInputStream.read();
- if(charRead == -1) { // end of input; something likely went wrong!A Pad buffer with nulls.
- fBuffer[count] = 0;
- } else {
- fBuffer[count] = (byte)charRead;
- }
- }
- }
-
- // now count is a multiple of the right number of bytes
- int numChars = count >> ((fEncoding >= 4)?2:1);
- int curPos = 0;
- for (int i = 0; i < numChars; i++) {
- int b0 = fBuffer[curPos++] & 0xff;
- int b1 = fBuffer[curPos++] & 0xff;
- if(fEncoding >=4) {
- int b2 = fBuffer[curPos++] & 0xff;
- int b3 = fBuffer[curPos++] & 0xff;
- if (fEncoding == UCS4BE)
- ch[offset+i] = (char)((b0<<24)+(b1<<16)+(b2<<8)+b3);
- else
- ch[offset+i] = (char)((b3<<24)+(b2<<16)+(b1<<8)+b0);
- } else { // UCS-2
- if (fEncoding == UCS2BE)
- ch[offset+i] = (char)((b0<<8)+b1);
- else
- ch[offset+i] = (char)((b1<<8)+b0);
- }
- }
- return numChars;
- } // read(char[],int,int)
-
- /**
- * Skip characters. This method will block until some characters are
- * available, an I/O error occurs, or the end of the stream is reached.
- *
- * @param n The number of characters to skip
- *
- * @return The number of characters actually skipped
- *
- * @exception IOException If an I/O error occurs
- */
- public long skip(long n) throws IOException {
- // charWidth will represent the number of bits to move
- // n leftward to get num of bytes to skip, and then move the result rightward
- // to get num of chars effectively skipped.
- // The trick with &'ing, as with elsewhere in this dcode, is
- // intended to avoid an expensive use of / that might not be optimized
- // away.
- int charWidth = (fEncoding >=4)?2:1;
- long bytesSkipped = fInputStream.skip(n<<charWidth);
- if((bytesSkipped & (charWidth | 1)) == 0) return bytesSkipped >> charWidth;
- return (bytesSkipped >> charWidth) + 1;
- } // skip(long):long
-
- /**
- * Tell whether this stream is ready to be read.
- *
- * @return True if the next read() is guaranteed not to block for input,
- * false otherwise. Note that returning false does not guarantee that the
- * next read will block.
- *
- * @exception IOException If an I/O error occurs
- */
- public boolean ready() throws IOException {
- return false;
- } // ready()
-
- /**
- * Tell whether this stream supports the mark() operation.
- */
- public boolean markSupported() {
- return fInputStream.markSupported();
- } // markSupported()
-
- /**
- * Mark the present position in the stream. Subsequent calls to reset()
- * will attempt to reposition the stream to this point. Not all
- * character-input streams support the mark() operation.
- *
- * @param readAheadLimit Limit on the number of characters that may be
- * read while still preserving the mark. After
- * reading this many characters, attempting to
- * reset the stream may fail.
- *
- * @exception IOException If the stream does not support mark(),
- * or if some other I/O error occurs
- */
- public void mark(int readAheadLimit) throws IOException {
- fInputStream.mark(readAheadLimit);
- } // mark(int)
-
- /**
- * Reset the stream. If the stream has been marked, then attempt to
- * reposition it at the mark. If the stream has not been marked, then
- * attempt to reset it in some way appropriate to the particular stream,
- * for example by repositioning it to its starting point. Not all
- * character-input streams support the reset() operation, and some support
- * reset() without supporting mark().
- *
- * @exception IOException If the stream has not been marked,
- * or if the mark has been invalidated,
- * or if the stream does not support reset(),
- * or if some other I/O error occurs
- */
- public void reset() throws IOException {
- fInputStream.reset();
- } // reset()
-
- /**
- * Close the stream. Once a stream has been closed, further read(),
- * ready(), mark(), or reset() invocations will throw an IOException.
- * Closing a previously-closed stream, however, has no effect.
- *
- * @exception IOException If an I/O error occurs
- */
- public void close() throws IOException {
- BufferAllocator ba = ThreadLocalBufferAllocator.getBufferAllocator();
- ba.returnByteBuffer(fBuffer);
- fBuffer = null;
- fInputStream.close();
- } // close()
-
-} // class UCSReader
diff --git a/src/com/sun/org/apache/xerces/internal/impl/io/UTF8Reader.java b/src/com/sun/org/apache/xerces/internal/impl/io/UTF8Reader.java
deleted file mode 100644
index 4624205..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/io/UTF8Reader.java
+++ /dev/null
@@ -1,716 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2000-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.io;
-
-import java.io.InputStream;
-import java.io.IOException;
-import java.io.Reader;
-
-import java.util.Locale;
-import com.sun.org.apache.xerces.internal.util.MessageFormatter;
-import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter;
-
-import com.sun.xml.internal.stream.util.BufferAllocator;
-import com.sun.xml.internal.stream.util.ThreadLocalBufferAllocator;
-
-/**
- * <p>A UTF-8 reader.</p>
- *
- * @xerces.internal
- *
- * @author Andy Clark, IBM
- *
- */
-public class UTF8Reader
- extends Reader {
-
- //
- // Constants
- //
-
- /** Default byte buffer size (2048). */
- public static final int DEFAULT_BUFFER_SIZE = 2048;
-
- // debugging
-
- /** Debug read. */
- private static final boolean DEBUG_READ = false;
-
- //
- // Data
- //
-
- /** Input stream. */
- protected InputStream fInputStream;
-
- /** Byte buffer. */
- protected byte[] fBuffer;
-
- /** Offset into buffer. */
- protected int fOffset;
-
- /** Surrogate character. */
- private int fSurrogate = -1;
-
- // message formatter; used to produce localized
- // exception messages
- private MessageFormatter fFormatter = null;
-
- //Locale to use for messages
- private Locale fLocale = null;
-
- //
- // Constructors
- //
-
- /**
- * Constructs a UTF-8 reader from the specified input stream
- * using the default buffer size. Primarily for testing.
- *
- * @param inputStream The input stream.
- */
- public UTF8Reader(InputStream inputStream) {
- this(inputStream, DEFAULT_BUFFER_SIZE, new XMLMessageFormatter(), Locale.getDefault());
- } // <init>(InputStream, MessageFormatter)
-
- /**
- * Constructs a UTF-8 reader from the specified input stream
- * using the default buffer size and the given MessageFormatter.
- *
- * @param inputStream The input stream.
- * @param messageFormatter given MessageFormatter
- * @param locale Locale to use for messages
- */
- public UTF8Reader(InputStream inputStream, MessageFormatter messageFormatter,
- Locale locale) {
- this(inputStream, DEFAULT_BUFFER_SIZE, messageFormatter, locale);
- } // <init>(InputStream, MessageFormatter, Locale)
-
- /**
- * Constructs a UTF-8 reader from the specified input stream,
- * buffer size and MessageFormatter.
- *
- * @param inputStream The input stream.
- * @param size The initial buffer size.
- * @param messageFormatter the formatter for localizing/formatting errors.
- * @param locale the Locale to use for messages
- */
- public UTF8Reader(InputStream inputStream, int size,
- MessageFormatter messageFormatter, Locale locale) {
- fInputStream = inputStream;
- BufferAllocator ba = ThreadLocalBufferAllocator.getBufferAllocator();
- fBuffer = ba.getByteBuffer(size);
- if (fBuffer == null) {
- fBuffer = new byte[size];
- }
- fFormatter = messageFormatter;
- fLocale = locale;
- } // <init>(InputStream, int, MessageFormatter, Locale)
-
- //
- // Reader methods
- //
-
- /**
- * Read a single character. This method will block until a character is
- * available, an I/O error occurs, or the end of the stream is reached.
- *
- * <p> Subclasses that intend to support efficient single-character input
- * should override this method.
- *
- * @return The character read, as an integer in the range 0 to 16383
- * (<tt>0x00-0xffff</tt>), or -1 if the end of the stream has
- * been reached
- *
- * @exception IOException If an I/O error occurs
- */
- public int read() throws IOException {
-
- // decode character
- int c = fSurrogate;
- if (fSurrogate == -1) {
- // NOTE: We use the index into the buffer if there are remaining
- // bytes from the last block read. -Ac
- int index = 0;
-
- // get first byte
- int b0 = index == fOffset
- ? fInputStream.read() : fBuffer[index++] & 0x00FF;
- if (b0 == -1) {
- return -1;
- }
-
- // UTF-8: [0xxx xxxx]
- // Unicode: [0000 0000] [0xxx xxxx]
- if (b0 < 0x80) {
- c = (char)b0;
- }
-
- // UTF-8: [110y yyyy] [10xx xxxx]
- // Unicode: [0000 0yyy] [yyxx xxxx]
- else if ((b0 & 0xE0) == 0xC0 && (b0 & 0x1E) != 0) {
- int b1 = index == fOffset
- ? fInputStream.read() : fBuffer[index++] & 0x00FF;
- if (b1 == -1) {
- expectedByte(2, 2);
- }
- if ((b1 & 0xC0) != 0x80) {
- invalidByte(2, 2, b1);
- }
- c = ((b0 << 6) & 0x07C0) | (b1 & 0x003F);
- }
-
- // UTF-8: [1110 zzzz] [10yy yyyy] [10xx xxxx]
- // Unicode: [zzzz yyyy] [yyxx xxxx]
- else if ((b0 & 0xF0) == 0xE0) {
- int b1 = index == fOffset
- ? fInputStream.read() : fBuffer[index++] & 0x00FF;
- if (b1 == -1) {
- expectedByte(2, 3);
- }
- if ((b1 & 0xC0) != 0x80
- || (b0 == 0xED && b1 >= 0xA0)
- || ((b0 & 0x0F) == 0 && (b1 & 0x20) == 0)) {
- invalidByte(2, 3, b1);
- }
- int b2 = index == fOffset
- ? fInputStream.read() : fBuffer[index++] & 0x00FF;
- if (b2 == -1) {
- expectedByte(3, 3);
- }
- if ((b2 & 0xC0) != 0x80) {
- invalidByte(3, 3, b2);
- }
- c = ((b0 << 12) & 0xF000) | ((b1 << 6) & 0x0FC0) |
- (b2 & 0x003F);
- }
-
- // UTF-8: [1111 0uuu] [10uu zzzz] [10yy yyyy] [10xx xxxx]*
- // Unicode: [1101 10ww] [wwzz zzyy] (high surrogate)
- // [1101 11yy] [yyxx xxxx] (low surrogate)
- // * uuuuu = wwww + 1
- else if ((b0 & 0xF8) == 0xF0) {
- int b1 = index == fOffset
- ? fInputStream.read() : fBuffer[index++] & 0x00FF;
- if (b1 == -1) {
- expectedByte(2, 4);
- }
- if ((b1 & 0xC0) != 0x80
- || ((b1 & 0x30) == 0 && (b0 & 0x07) == 0)) {
- invalidByte(2, 3, b1);
- }
- int b2 = index == fOffset
- ? fInputStream.read() : fBuffer[index++] & 0x00FF;
- if (b2 == -1) {
- expectedByte(3, 4);
- }
- if ((b2 & 0xC0) != 0x80) {
- invalidByte(3, 3, b2);
- }
- int b3 = index == fOffset
- ? fInputStream.read() : fBuffer[index++] & 0x00FF;
- if (b3 == -1) {
- expectedByte(4, 4);
- }
- if ((b3 & 0xC0) != 0x80) {
- invalidByte(4, 4, b3);
- }
- int uuuuu = ((b0 << 2) & 0x001C) | ((b1 >> 4) & 0x0003);
- if (uuuuu > 0x10) {
- invalidSurrogate(uuuuu);
- }
- int wwww = uuuuu - 1;
- int hs = 0xD800 |
- ((wwww << 6) & 0x03C0) | ((b1 << 2) & 0x003C) |
- ((b2 >> 4) & 0x0003);
- int ls = 0xDC00 | ((b2 << 6) & 0x03C0) | (b3 & 0x003F);
- c = hs;
- fSurrogate = ls;
- }
-
- // error
- else {
- invalidByte(1, 1, b0);
- }
- }
-
- // use surrogate
- else {
- fSurrogate = -1;
- }
-
- // return character
- if (DEBUG_READ) {
- System.out.println("read(): 0x"+Integer.toHexString(c));
- }
- return c;
-
- } // read():int
-
- /**
- * Read characters into a portion of an array. This method will block
- * until some input is available, an I/O error occurs, or the end of the
- * stream is reached.
- *
- * @param ch Destination buffer
- * @param offset Offset at which to start storing characters
- * @param length Maximum number of characters to read
- *
- * @return The number of characters read, or -1 if the end of the
- * stream has been reached
- *
- * @exception IOException If an I/O error occurs
- */
- public int read(char ch[], int offset, int length) throws IOException {
-
- // handle surrogate
- int out = offset;
- if (fSurrogate != -1) {
- ch[offset + 1] = (char)fSurrogate;
- fSurrogate = -1;
- length--;
- out++;
- }
-
- // read bytes
- int count = 0;
- if (fOffset == 0) {
- // adjust length to read
- if (length > fBuffer.length) {
- length = fBuffer.length;
- }
-
- // perform read operation
- count = fInputStream.read(fBuffer, 0, length);
- if (count == -1) {
- return -1;
- }
- count += out - offset;
- }
-
- // skip read; last character was in error
- // NOTE: Having an offset value other than zero means that there was
- // an error in the last character read. In this case, we have
- // skipped the read so we don't consume any bytes past the
- // error. By signalling the error on the next block read we
- // allow the method to return the most valid characters that
- // it can on the previous block read. -Ac
- else {
- count = fOffset;
- fOffset = 0;
- }
-
- // convert bytes to characters
- final int total = count;
- int in;
- byte byte1;
- final byte byte0 = 0;
- for (in = 0; in < total; in++) {
- byte1 = fBuffer[in];
- if (byte1 >= byte0) {
- ch[out++] = (char)byte1;
- }
- else {
- break;
- }
- }
- for ( ; in < total; in++) {
- byte1 = fBuffer[in];
-
- // UTF-8: [0xxx xxxx]
- // Unicode: [0000 0000] [0xxx xxxx]
- if (byte1 >= byte0) {
- ch[out++] = (char)byte1;
- continue;
- }
-
- // UTF-8: [110y yyyy] [10xx xxxx]
- // Unicode: [0000 0yyy] [yyxx xxxx]
- int b0 = byte1 & 0x0FF;
- if ((b0 & 0xE0) == 0xC0 && (b0 & 0x1E) != 0) {
- int b1 = -1;
- if (++in < total) {
- b1 = fBuffer[in] & 0x00FF;
- }
- else {
- b1 = fInputStream.read();
- if (b1 == -1) {
- if (out > offset) {
- fBuffer[0] = (byte)b0;
- fOffset = 1;
- return out - offset;
- }
- expectedByte(2, 2);
- }
- count++;
- }
- if ((b1 & 0xC0) != 0x80) {
- if (out > offset) {
- fBuffer[0] = (byte)b0;
- fBuffer[1] = (byte)b1;
- fOffset = 2;
- return out - offset;
- }
- invalidByte(2, 2, b1);
- }
- int c = ((b0 << 6) & 0x07C0) | (b1 & 0x003F);
- ch[out++] = (char)c;
- count -= 1;
- continue;
- }
-
- // UTF-8: [1110 zzzz] [10yy yyyy] [10xx xxxx]
- // Unicode: [zzzz yyyy] [yyxx xxxx]
- if ((b0 & 0xF0) == 0xE0) {
- int b1 = -1;
- if (++in < total) {
- b1 = fBuffer[in] & 0x00FF;
- }
- else {
- b1 = fInputStream.read();
- if (b1 == -1) {
- if (out > offset) {
- fBuffer[0] = (byte)b0;
- fOffset = 1;
- return out - offset;
- }
- expectedByte(2, 3);
- }
- count++;
- }
- if ((b1 & 0xC0) != 0x80
- || (b0 == 0xED && b1 >= 0xA0)
- || ((b0 & 0x0F) == 0 && (b1 & 0x20) == 0)) {
- if (out > offset) {
- fBuffer[0] = (byte)b0;
- fBuffer[1] = (byte)b1;
- fOffset = 2;
- return out - offset;
- }
- invalidByte(2, 3, b1);
- }
- int b2 = -1;
- if (++in < total) {
- b2 = fBuffer[in] & 0x00FF;
- }
- else {
- b2 = fInputStream.read();
- if (b2 == -1) {
- if (out > offset) {
- fBuffer[0] = (byte)b0;
- fBuffer[1] = (byte)b1;
- fOffset = 2;
- return out - offset;
- }
- expectedByte(3, 3);
- }
- count++;
- }
- if ((b2 & 0xC0) != 0x80) {
- if (out > offset) {
- fBuffer[0] = (byte)b0;
- fBuffer[1] = (byte)b1;
- fBuffer[2] = (byte)b2;
- fOffset = 3;
- return out - offset;
- }
- invalidByte(3, 3, b2);
- }
- int c = ((b0 << 12) & 0xF000) | ((b1 << 6) & 0x0FC0) |
- (b2 & 0x003F);
- ch[out++] = (char)c;
- count -= 2;
- continue;
- }
-
- // UTF-8: [1111 0uuu] [10uu zzzz] [10yy yyyy] [10xx xxxx]*
- // Unicode: [1101 10ww] [wwzz zzyy] (high surrogate)
- // [1101 11yy] [yyxx xxxx] (low surrogate)
- // * uuuuu = wwww + 1
- if ((b0 & 0xF8) == 0xF0) {
- int b1 = -1;
- if (++in < total) {
- b1 = fBuffer[in] & 0x00FF;
- }
- else {
- b1 = fInputStream.read();
- if (b1 == -1) {
- if (out > offset) {
- fBuffer[0] = (byte)b0;
- fOffset = 1;
- return out - offset;
- }
- expectedByte(2, 4);
- }
- count++;
- }
- if ((b1 & 0xC0) != 0x80
- || ((b1 & 0x30) == 0 && (b0 & 0x07) == 0)) {
- if (out > offset) {
- fBuffer[0] = (byte)b0;
- fBuffer[1] = (byte)b1;
- fOffset = 2;
- return out - offset;
- }
- invalidByte(2, 4, b1);
- }
- int b2 = -1;
- if (++in < total) {
- b2 = fBuffer[in] & 0x00FF;
- }
- else {
- b2 = fInputStream.read();
- if (b2 == -1) {
- if (out > offset) {
- fBuffer[0] = (byte)b0;
- fBuffer[1] = (byte)b1;
- fOffset = 2;
- return out - offset;
- }
- expectedByte(3, 4);
- }
- count++;
- }
- if ((b2 & 0xC0) != 0x80) {
- if (out > offset) {
- fBuffer[0] = (byte)b0;
- fBuffer[1] = (byte)b1;
- fBuffer[2] = (byte)b2;
- fOffset = 3;
- return out - offset;
- }
- invalidByte(3, 4, b2);
- }
- int b3 = -1;
- if (++in < total) {
- b3 = fBuffer[in] & 0x00FF;
- }
- else {
- b3 = fInputStream.read();
- if (b3 == -1) {
- if (out > offset) {
- fBuffer[0] = (byte)b0;
- fBuffer[1] = (byte)b1;
- fBuffer[2] = (byte)b2;
- fOffset = 3;
- return out - offset;
- }
- expectedByte(4, 4);
- }
- count++;
- }
- if ((b3 & 0xC0) != 0x80) {
- if (out > offset) {
- fBuffer[0] = (byte)b0;
- fBuffer[1] = (byte)b1;
- fBuffer[2] = (byte)b2;
- fBuffer[3] = (byte)b3;
- fOffset = 4;
- return out - offset;
- }
- invalidByte(4, 4, b2);
- }
-
- // check if output buffer is large enough to hold 2 surrogate chars
- if (out + 1 >= ch.length) {
- fBuffer[0] = (byte)b0;
- fBuffer[1] = (byte)b1;
- fBuffer[2] = (byte)b2;
- fBuffer[3] = (byte)b3;
- fOffset = 4;
- return out - offset;
- }
-
- // decode bytes into surrogate characters
- int uuuuu = ((b0 << 2) & 0x001C) | ((b1 >> 4) & 0x0003);
- if (uuuuu > 0x10) {
- invalidSurrogate(uuuuu);
- }
- int wwww = uuuuu - 1;
- int zzzz = b1 & 0x000F;
- int yyyyyy = b2 & 0x003F;
- int xxxxxx = b3 & 0x003F;
- int hs = 0xD800 | ((wwww << 6) & 0x03C0) | (zzzz << 2) | (yyyyyy >> 4);
- int ls = 0xDC00 | ((yyyyyy << 6) & 0x03C0) | xxxxxx;
-
- // set characters
- ch[out++] = (char)hs;
- ch[out++] = (char)ls;
- count -= 2;
- continue;
- }
-
- // error
- if (out > offset) {
- fBuffer[0] = (byte)b0;
- fOffset = 1;
- return out - offset;
- }
- invalidByte(1, 1, b0);
- }
-
- // return number of characters converted
- if (DEBUG_READ) {
- System.out.println("read(char[],"+offset+','+length+"): count="+count);
- }
- return count;
-
- } // read(char[],int,int)
-
- /**
- * Skip characters. This method will block until some characters are
- * available, an I/O error occurs, or the end of the stream is reached.
- *
- * @param n The number of characters to skip
- *
- * @return The number of characters actually skipped
- *
- * @exception IOException If an I/O error occurs
- */
- public long skip(long n) throws IOException {
-
- long remaining = n;
- final char[] ch = new char[fBuffer.length];
- do {
- int length = ch.length < remaining ? ch.length : (int)remaining;
- int count = read(ch, 0, length);
- if (count > 0) {
- remaining -= count;
- }
- else {
- break;
- }
- } while (remaining > 0);
-
- long skipped = n - remaining;
- return skipped;
-
- } // skip(long):long
-
- /**
- * Tell whether this stream is ready to be read.
- *
- * @return True if the next read() is guaranteed not to block for input,
- * false otherwise. Note that returning false does not guarantee that the
- * next read will block.
- *
- * @exception IOException If an I/O error occurs
- */
- public boolean ready() throws IOException {
- return false;
- } // ready()
-
- /**
- * Tell whether this stream supports the mark() operation.
- */
- public boolean markSupported() {
- return false;
- } // markSupported()
-
- /**
- * Mark the present position in the stream. Subsequent calls to reset()
- * will attempt to reposition the stream to this point. Not all
- * character-input streams support the mark() operation.
- *
- * @param readAheadLimit Limit on the number of characters that may be
- * read while still preserving the mark. After
- * reading this many characters, attempting to
- * reset the stream may fail.
- *
- * @exception IOException If the stream does not support mark(),
- * or if some other I/O error occurs
- */
- public void mark(int readAheadLimit) throws IOException {
- throw new IOException(fFormatter.formatMessage(fLocale, "OperationNotSupported", new Object[]{"mark()", "UTF-8"}));
- } // mark(int)
-
- /**
- * Reset the stream. If the stream has been marked, then attempt to
- * reposition it at the mark. If the stream has not been marked, then
- * attempt to reset it in some way appropriate to the particular stream,
- * for example by repositioning it to its starting point. Not all
- * character-input streams support the reset() operation, and some support
- * reset() without supporting mark().
- *
- * @exception IOException If the stream has not been marked,
- * or if the mark has been invalidated,
- * or if the stream does not support reset(),
- * or if some other I/O error occurs
- */
- public void reset() throws IOException {
- fOffset = 0;
- fSurrogate = -1;
- } // reset()
-
- /**
- * Close the stream. Once a stream has been closed, further read(),
- * ready(), mark(), or reset() invocations will throw an IOException.
- * Closing a previously-closed stream, however, has no effect.
- *
- * @exception IOException If an I/O error occurs
- */
- public void close() throws IOException {
- BufferAllocator ba = ThreadLocalBufferAllocator.getBufferAllocator();
- ba.returnByteBuffer(fBuffer);
- fBuffer = null;
- fInputStream.close();
- } // close()
-
- //
- // Private methods
- //
-
- /** Throws an exception for expected byte. */
- private void expectedByte(int position, int count)
- throws MalformedByteSequenceException {
-
- throw new MalformedByteSequenceException(fFormatter,
- fLocale,
- XMLMessageFormatter.XML_DOMAIN,
- "ExpectedByte",
- new Object[] {Integer.toString(position), Integer.toString(count)});
-
- } // expectedByte(int,int)
-
- /** Throws an exception for invalid byte. */
- private void invalidByte(int position, int count, int c)
- throws MalformedByteSequenceException {
-
- throw new MalformedByteSequenceException(fFormatter,
- fLocale,
- XMLMessageFormatter.XML_DOMAIN,
- "InvalidByte",
- new Object [] {Integer.toString(position), Integer.toString(count)});
-
- } // invalidByte(int,int,int)
-
- /** Throws an exception for invalid surrogate bits. */
- private void invalidSurrogate(int uuuuu) throws MalformedByteSequenceException {
-
- throw new MalformedByteSequenceException(fFormatter,
- fLocale,
- XMLMessageFormatter.XML_DOMAIN,
- "InvalidHighSurrogate",
- new Object[] {Integer.toHexString(uuuuu)});
-
- } // invalidSurrogate(int)
-
-} // class UTF8Reader
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages.properties
deleted file mode 100644
index 8f91ee9..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages.properties
+++ /dev/null
@@ -1,69 +0,0 @@
-# This file stores localized messages for the Xerces
-# DOM implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-BadMessageKey = The error message corresponding to the message key can not be found.
-FormatFailed = An internal error occurred while formatting the following message:\n
-
-# DOM Core
-
-# exception codes
-DOMSTRING_SIZE_ERR = The specified range of text does not fit into a DOMString.
-HIERARCHY_REQUEST_ERR = An attempt was made to insert a node where it is not permitted.
-INDEX_SIZE_ERR = The index or size is negative, or greater than the allowed value.
-INUSE_ATTRIBUTE_ERR = An attempt is made to add an attribute that is already in use elsewhere.
-INVALID_ACCESS_ERR = A parameter or an operation is not supported by the underlying object.
-INVALID_CHARACTER_ERR = An invalid or illegal XML character is specified.
-INVALID_MODIFICATION_ERR = An attempt is made to modify the type of the underlying object.
-INVALID_STATE_ERR = An attempt is made to use an object that is not, or is no longer, usable.
-NAMESPACE_ERR = An attempt is made to create or change an object in a way which is incorrect with regard to namespaces.
-NOT_FOUND_ERR = An attempt is made to reference a node in a context where it does not exist.
-NOT_SUPPORTED_ERR = The implementation does not support the requested type of object or operation.
-NO_DATA_ALLOWED_ERR = Data is specified for a node which does not support data.
-NO_MODIFICATION_ALLOWED_ERR = An attempt is made to modify an object where modifications are not allowed.
-SYNTAX_ERR = An invalid or illegal string is specified.
-VALIDATION_ERR = A call to a method such as insertBefore or removeChild would make the Node invalid with respect to document grammar.
-WRONG_DOCUMENT_ERR = A node is used in a different document than the one that created it.
-TYPE_MISMATCH_ERR = The value type for this parameter name is incompatible with the expected value type.
-
-#error messages or exceptions
-FEATURE_NOT_SUPPORTED = The parameter {0} is recognized but the requested value cannot be set.
-FEATURE_NOT_FOUND = The parameter {0} is not recognized.
-STRING_TOO_LONG = The resulting string is too long to fit in a DOMString: ''{0}''.
-
-#DOM Level 3 DOMError codes
-wf-invalid-character = The text {0} of the {1} node contains invalid XML characters.
-wf-invalid-character-in-node-name = The {0} node named {1} contains invalid XML characters.
-cdata-sections-splitted = CDATA sections containing the CDATA section termination marker '']]>''
-doctype-not-allowed = DOCTYPE declaration is not allowed.
-unsupported-encoding = The encoding {0} is not supported.
-
-#Error codes used in DOM Normalizer
-InvalidXMLCharInDOM = An invalid XML character (Unicode: 0x{0}) was found in the DOM during normalization.
-UndeclaredEntRefInAttrValue = The attribute \"{0}\" value \"{1}\" referenced an entity that was not declared.
-NullLocalElementName = A null local name was encountered during namespace normalization of element {0}.
-NullLocalAttrName = A null local name was encountered during namespace normalization of attribute {0}.
-
-#Error codes used in DOMParser
-InvalidDocumentClassName = The class name of the document factory \"{0}\" used to construct the DOM tree is not of type org.w3c.dom.Document.
-MissingDocumentClassName = The class name of the document factory \"{0}\" used to construct the DOM tree could not be found.
-CannotCreateDocumentClass = The class named \"{0}\" could not be constructed as a org.w3c.dom.Document.
-
-# Error codes used by JAXP DocumentBuilder
-jaxp-order-not-supported = Property ''{0}'' must be set before setting property ''{1}''.
-jaxp-null-input-source = The source specified cannot be null.
-
-#Ranges
-BAD_BOUNDARYPOINTS_ERR = The boundary-points of a Range do not meet specific requirements.
-INVALID_NODE_TYPE_ERR = The container of a boundary-point of a Range is being set to either a node of an invalid type or a node with an ancestor of an invalid type.
-
-
-#Events
-UNSPECIFIED_EVENT_TYPE_ERR = The Event's type was not specified by initializing the event before the method was called.
-
-
-jaxp-schema-support=Both the setSchema method and the schemaLanguage property is used
-
-jaxp_feature_not_supported=Feature "{0}" is not supported.
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_de.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_de.properties
deleted file mode 100644
index 8125537..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_de.properties
+++ /dev/null
@@ -1,69 +0,0 @@
-# This file stores localized messages for the Xerces
-# DOM implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-BadMessageKey = Die zum Meldungsschl\u00FCssel geh\u00F6rige Fehlermeldung kann nicht gefunden werden.
-FormatFailed = Beim Formatieren der folgenden Meldung ist ein interner Fehler aufgetreten:\n
-
-# DOM Core
-
-# exception codes
-DOMSTRING_SIZE_ERR = Der angegebene Textbereich passt nicht in eine DOMString.
-HIERARCHY_REQUEST_ERR = Es wurde versucht, einen Knoten an einer Stelle einzuf\u00FCgen, an der dies nicht zul\u00E4ssig ist.
-INDEX_SIZE_ERR = Index oder Gr\u00F6\u00DFe ist negativ oder gr\u00F6\u00DFer als der zul\u00E4ssige Wert.
-INUSE_ATTRIBUTE_ERR = Es wurde versucht, ein Attribut hinzuzuf\u00FCgen, das bereits an einer anderen Stelle verwendet wird.
-INVALID_ACCESS_ERR = Ein Parameter oder Vorgang wird nicht vom zugrunde liegenden Objekt unterst\u00FCtzt.
-INVALID_CHARACTER_ERR = Ung\u00FCltiges XML-Zeichen angegeben.
-INVALID_MODIFICATION_ERR = Es wurde versucht, den Typ des zugrunde liegenden Objekts zu \u00E4ndern.
-INVALID_STATE_ERR = Es wurde versucht, ein Objekt zu \u00E4ndern, das nicht verwendet werden kann.
-NAMESPACE_ERR = Es wurde versucht, ein Objekt auf eine Weise zu erstellen oder zu \u00E4ndern, die falsch in Bezug auf Namespaces ist.
-NOT_FOUND_ERR = Es wurde versucht, einen Knoten in einem Kontext zu referenzieren, in dem er nicht vorhanden ist.
-NOT_SUPPORTED_ERR = Der angeforderte Typ des Objekts oder Vorgangs wird nicht von der Implementierung unterst\u00FCtzt.
-NO_DATA_ALLOWED_ERR = Daten wurden f\u00FCr einen Knoten angegeben, der keine Daten unterst\u00FCtzt.
-NO_MODIFICATION_ALLOWED_ERR = Es wurde versucht, ein Objekt zu \u00E4ndern, bei dem \u00C4nderungen nicht zul\u00E4ssig sind.
-SYNTAX_ERR = Ung\u00FCltige Zeichenfolge angegeben.
-VALIDATION_ERR = Aufruf einer Methode wie insertBefore oder removeChild w\u00FCrde die Dokumentgrammatik des Knotens ung\u00FCltig machen.
-WRONG_DOCUMENT_ERR = Ein Knoten wird in einem anderen Dokument verwendet als dem, von dem er erstellt wurde.
-TYPE_MISMATCH_ERR = Der Werttyp f\u00FCr diesen Parameternamen ist nicht mit dem erwarteten Werttyp kompatibel.
-
-#error messages or exceptions
-FEATURE_NOT_SUPPORTED = Parameter {0} wird erkannt, aber der angeforderte Wert kann nicht festgelegt werden.
-FEATURE_NOT_FOUND = Parameter {0} ist unbekannt.
-STRING_TOO_LONG = Die resultierende Zeichenfolge ist zu lang, um in eine DOMString zupassen: "{0}".
-
-#DOM Level 3 DOMError codes
-wf-invalid-character = Text {0} des {1}-Knotens enth\u00E4lt ung\u00FCltige XML-Zeichen.
-wf-invalid-character-in-node-name = {0}-Knoten mit dem Namen {1} enth\u00E4lt ung\u00FCltige XML-Zeichen.
-cdata-sections-splitted = CDATA-Abschnitt mit dem CDATA-Abschnittsabschlusszeichen "]]>"
-doctype-not-allowed = DOCTYPE-Deklaration ist nicht zul\u00E4ssig.
-unsupported-encoding = Codierung {0} wird nicht unterst\u00FCtzt.
-
-#Error codes used in DOM Normalizer
-InvalidXMLCharInDOM = Ung\u00FCltiges XML-Zeichen (Unicode: 0x{0}) wurde bei der Normalisierung im DOM gefunden.
-UndeclaredEntRefInAttrValue = Attribut "{0}" Wert "{1}" referenzierte eine nicht deklarierte Entity.
-NullLocalElementName = Lokaler Nullname wurde bei der Namespace-Normalisierung von Element {0} gefunden.
-NullLocalAttrName = Lokaler Nullname wurde bei der Namespace-Normalisierung von Attribut {0} gefunden.
-
-#Error codes used in DOMParser
-InvalidDocumentClassName = Der Klassenname der Dokument-Factory "{0}", mit dem der DOM-Baum erstellt wurde, hat nicht den Typ org.w3c.dom.Document.
-MissingDocumentClassName = Der Klassenname der Dokument-Factory "{0}", mit dem der DOM-Baum erstellt wurde, konnte nicht gefunden werden.
-CannotCreateDocumentClass = Die Klasse mit dem Namen "{0}" konnte nicht als org.w3c.dom.Document erstellt werden.
-
-# Error codes used by JAXP DocumentBuilder
-jaxp-order-not-supported = Eigenschaft "{0}" muss vor der Eigenschaft "{1}" festgelegt werden.
-jaxp-null-input-source = Angegebene Quelle darf nicht null sein.
-
-#Ranges
-BAD_BOUNDARYPOINTS_ERR = Grenzwerte eines Bereichs entsprechen nicht den speziellen Anforderungen.
-INVALID_NODE_TYPE_ERR = Container eines Grenzwertes eines Bereichs wird entweder auf einen Knoten mit einem ung\u00FCltigen Typ oder auf einen Knoten mit einem Vorg\u00E4nge eines ung\u00FCltigen Typs gesetzt.
-
-
-#Events
-UNSPECIFIED_EVENT_TYPE_ERR = Der Ereignistyp wurde nicht durch Initialisieren des Ereignisses vor dem Aufruf der Methode angegeben.
-
-
-jaxp-schema-support=setSchema-Methode und schemaLanguage-Eigenschaft werden verwendet
-
-jaxp_feature_not_supported=Feature "{0}" wird nicht unterst\u00FCtzt.
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_es.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_es.properties
deleted file mode 100644
index 094021e..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_es.properties
+++ /dev/null
@@ -1,69 +0,0 @@
-# This file stores localized messages for the Xerces
-# DOM implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-BadMessageKey = No se ha encontrado el mensaje de error correspondiente a la clave de mensaje.
-FormatFailed = Se ha producido un error interno al formatear el siguiente mensaje:\n
-
-# DOM Core
-
-# exception codes
-DOMSTRING_SIZE_ERR = El rango especificado de texto no cabe en una cadena DOM.
-HIERARCHY_REQUEST_ERR = Se ha realizado un intento de insertar un nodo donde no est\u00E1 permitido.
-INDEX_SIZE_ERR = El \u00EDndice o tama\u00F1o es negativo o superior al valor permitido.
-INUSE_ATTRIBUTE_ERR = Se ha realizado un intento de agregar un atributo que ya se est\u00E1 utilizando en otro lugar.
-INVALID_ACCESS_ERR = El objeto subyacente no soporta un par\u00E1metro o una operaci\u00F3n.
-INVALID_CHARACTER_ERR = Se ha especificado un car\u00E1cter XML no v\u00E1lido o no permitido.
-INVALID_MODIFICATION_ERR = Se ha realizado un intento de modificar el tipo de objeto subyacente.
-INVALID_STATE_ERR = Se ha realizado un intento de utilizar un objeto que ya no se puede utilizar.
-NAMESPACE_ERR = Se ha realizado un intento de crear o cambiar un objeto de un modo incorrecto con respecto a los espacios de nombres.
-NOT_FOUND_ERR = Se ha realizado un intento de hacer referencia a un nodo en un contexto en el que no existe.
-NOT_SUPPORTED_ERR = La implantaci\u00F3n no soporta el tipo solicitado de objeto u operaci\u00F3n.
-NO_DATA_ALLOWED_ERR = Se han especificado datos para un nodo que no soporta datos.
-NO_MODIFICATION_ALLOWED_ERR = Se ha realizado un intento de modificar un objeto en el que no est\u00E1n permitidas las modificaciones.
-SYNTAX_ERR = Se ha especificado una cadena no v\u00E1lida o no permitida.
-VALIDATION_ERR = Una llamada a un m\u00E9todo como insertBefore o removeChild invalidar\u00EDa el nodo con respecto a la gram\u00E1tica del documento.
-WRONG_DOCUMENT_ERR = Se ha utilizado un nodo en un documento distinto al que lo cre\u00F3.
-TYPE_MISMATCH_ERR = El tipo de valor para este nombre de par\u00E1metro no es compatible con el tipo de valor esperado.
-
-#error messages or exceptions
-FEATURE_NOT_SUPPORTED = Se reconoce el par\u00E1metro {0} pero no se puede definir el valor solicitado.
-FEATURE_NOT_FOUND = No se reconoce el par\u00E1metro {0}.
-STRING_TOO_LONG = La cadena resultante es demasiado larga para que quepa en una cadena DOM: ''{0}''.
-
-#DOM Level 3 DOMError codes
-wf-invalid-character = El texto {0} del nodo {1} contiene caracteres XML no v\u00E1lidos.
-wf-invalid-character-in-node-name = El nodo {0} con el nombre {1} contiene caracteres XML no v\u00E1lidos.
-cdata-sections-splitted = Las secciones CDATA contienen el marcador de terminaci\u00F3n de secci\u00F3n CDATA '']]>''
-doctype-not-allowed = La declaraci\u00F3n DOCTYPE no est\u00E1 permitida.
-unsupported-encoding = La codificaci\u00F3n {0} no est\u00E1 soportada.
-
-#Error codes used in DOM Normalizer
-InvalidXMLCharInDOM = Se ha encontrado un car\u00E1cter XML (Unicode: 0x{0}) no v\u00E1lido en DOM durante la normalizaci\u00F3n.
-UndeclaredEntRefInAttrValue = El atributo "{0}" con valor "{1}" ha hecho referencia a una entidad que no se declar\u00F3.
-NullLocalElementName = Se ha encontrado un nombre local nulo durante la normalizaci\u00F3n del espacio de nombres del elemento {0}.
-NullLocalAttrName = Se ha encontrado un nombre local nulo durante la normalizaci\u00F3n del espacio de nombres del atributo {0}.
-
-#Error codes used in DOMParser
-InvalidDocumentClassName = El nombre de clase de la f\u00E1brica de documentos "{0}" utilizado para construir el \u00E1rbol DOM no es del tipo org.w3c.dom.Document.
-MissingDocumentClassName = No se ha encontrado el nombre de clase de la f\u00E1brica de documentos "{0}" utilizado para construir el \u00E1rbol DOM.
-CannotCreateDocumentClass = No se ha podido construir la clase con el nombre "{0}" como un org.w3c.dom.Document.
-
-# Error codes used by JAXP DocumentBuilder
-jaxp-order-not-supported = La propiedad ''{0}'' debe definirse antes de definir la propiedad ''{1}''.
-jaxp-null-input-source = El origen especificado no puede ser nulo.
-
-#Ranges
-BAD_BOUNDARYPOINTS_ERR = Los puntos de l\u00EDmite de un rango no cumplen los requisitos espec\u00EDficos.
-INVALID_NODE_TYPE_ERR = El contenedor de un punto de l\u00EDmite de un rango se est\u00E1 definiendo en un nodo de un tipo no v\u00E1lido o un nodo con un ascendiente de un tipo no v\u00E1lido.
-
-
-#Events
-UNSPECIFIED_EVENT_TYPE_ERR = No se ha especificado el tipo de evento mediante la inicializaci\u00F3n del evento antes de que se llame al m\u00E9todo.
-
-
-jaxp-schema-support=Se utiliza tanto el m\u00E9todo setSchema como la propiedad schemaLanguage
-
-jaxp_feature_not_supported=La funci\u00F3n "{0}" no est\u00E1 soportada.
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_fr.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_fr.properties
deleted file mode 100644
index 9241fd9..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_fr.properties
+++ /dev/null
@@ -1,69 +0,0 @@
-# This file stores localized messages for the Xerces
-# DOM implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-BadMessageKey = Le message d'erreur correspondant \u00E0 la cl\u00E9 de message est introuvable.
-FormatFailed = Une erreur interne est survenue lors du formatage du message suivant :\n
-
-# DOM Core
-
-# exception codes
-DOMSTRING_SIZE_ERR = La plage de texte indiqu\u00E9e ne tient pas dans un \u00E9l\u00E9ment DOMString.
-HIERARCHY_REQUEST_ERR = Tentative d'insertion d'un noeud \u00E0 un emplacement non autoris\u00E9.
-INDEX_SIZE_ERR = L'index ou la taille est n\u00E9gatif ou d\u00E9passe la valeur autoris\u00E9e.
-INUSE_ATTRIBUTE_ERR = Tentative d'ajout d'un attribut d\u00E9j\u00E0 utilis\u00E9 ailleurs.
-INVALID_ACCESS_ERR = Un param\u00E8tre ou une op\u00E9ration n'est pas pris en charge par l'objet sous-jacent.
-INVALID_CHARACTER_ERR = Un caract\u00E8re XML non valide ou non admis est indiqu\u00E9.
-INVALID_MODIFICATION_ERR = Tentative de modification du type de l'objet sous-jacent.
-INVALID_STATE_ERR = Tentative d'utilisation d'un objet qui n'est pas ou plus utilisable.
-NAMESPACE_ERR = Tentative de cr\u00E9ation ou de modification d'un objet incorrecte par rapport aux espaces de noms.
-NOT_FOUND_ERR = Tentative de r\u00E9f\u00E9rencement d'un noeud dans un contexte o\u00F9 il n'existe pas.
-NOT_SUPPORTED_ERR = L'impl\u00E9mentation ne prend pas en charge le type d'objet ou d'op\u00E9ration demand\u00E9.
-NO_DATA_ALLOWED_ERR = Des donn\u00E9es ont \u00E9t\u00E9 indiqu\u00E9es pour un noeud ne prenant pas en charge les donn\u00E9es.
-NO_MODIFICATION_ALLOWED_ERR = Tentative de modification d'un objet pour lequel les modifications ne sont pas autoris\u00E9es.
-SYNTAX_ERR = Une cha\u00EEne non valide ou non admise est indiqu\u00E9e.
-VALIDATION_ERR = L'appel d'une m\u00E9thode comme insertBefore ou removeChild risque de rendre le noeud non valide par rapport \u00E0 la grammaire de document.
-WRONG_DOCUMENT_ERR = Un noeud est utilis\u00E9 dans un document diff\u00E9rent de celui l'ayant cr\u00E9\u00E9.
-TYPE_MISMATCH_ERR = Le type de valeur pour ce nom de param\u00E8tre n'est pas compatible avec le type de valeur attendu.
-
-#error messages or exceptions
-FEATURE_NOT_SUPPORTED = Le param\u00E8tre {0} est reconnu mais la valeur demand\u00E9e ne peut pas \u00EAtre d\u00E9finie.
-FEATURE_NOT_FOUND = Le param\u00E8tre {0} n''est pas reconnu.
-STRING_TOO_LONG = La cha\u00EEne obtenue est trop longue pour tenir dans un \u00E9l\u00E9ment DOMString : ''{0}''.
-
-#DOM Level 3 DOMError codes
-wf-invalid-character = Le texte {0} du noeud {1} contient des caract\u00E8res XML non valides.
-wf-invalid-character-in-node-name = Le noeud {0} nomm\u00E9 {1} contient des caract\u00E8res XML non valides.
-cdata-sections-splitted = Sections CDATA contenant le marqueur de fin de section CDATA '']]>''
-doctype-not-allowed = La d\u00E9claration DOCTYPE n'est pas autoris\u00E9e.
-unsupported-encoding = L''encodage {0} n''est pas pris en charge.
-
-#Error codes used in DOM Normalizer
-InvalidXMLCharInDOM = Un caract\u00E8re XML non valide (Unicode : 0x{0}) a \u00E9t\u00E9 trouv\u00E9 dans le DOM au cours de la normalisation.
-UndeclaredEntRefInAttrValue = La valeur de l''attribut "{0}", "{1}", r\u00E9f\u00E9ren\u00E7ait une entit\u00E9 non d\u00E9clar\u00E9e.
-NullLocalElementName = Un nom local NULL a \u00E9t\u00E9 d\u00E9tect\u00E9 au cours de la normalisation de l''espace de noms de l''\u00E9l\u00E9ment {0}.
-NullLocalAttrName = Un nom local NULL a \u00E9t\u00E9 d\u00E9tect\u00E9 au cours de la normalisation de l''espace de noms de l''attribut {0}.
-
-#Error codes used in DOMParser
-InvalidDocumentClassName = Le nom de classe de la fabrique de documents "{0}" utilis\u00E9e pour construire l''arborescence DOM n''est pas de type org.w3c.dom.Document.
-MissingDocumentClassName = Le nom de classe de la fabrique de documents "{0}" utilis\u00E9e pour construire l''arborescence DOM est introuvable.
-CannotCreateDocumentClass = La classe nomm\u00E9e "{0}" n''a pas pu \u00EAtre construite en tant que org.w3c.dom.Document.
-
-# Error codes used by JAXP DocumentBuilder
-jaxp-order-not-supported = La propri\u00E9t\u00E9 ''{0}'' doit \u00EAtre d\u00E9finie avant la propri\u00E9t\u00E9 ''{1}''.
-jaxp-null-input-source = La source indiqu\u00E9e ne peut pas \u00EAtre NULL.
-
-#Ranges
-BAD_BOUNDARYPOINTS_ERR = Les points de limite d'une plage ne r\u00E9pondent pas aux exigences sp\u00E9cifiques.
-INVALID_NODE_TYPE_ERR = Le conteneur d'un point de limite d'une plage est d\u00E9fini sur un noeud de type non valide ou sur un noeud ayant un anc\u00EAtre de type non valide.
-
-
-#Events
-UNSPECIFIED_EVENT_TYPE_ERR = Le type d'\u00E9v\u00E9nement n'a pas \u00E9t\u00E9 indiqu\u00E9 en initialisant l'\u00E9v\u00E9nement avant l'appel de la m\u00E9thode.
-
-
-jaxp-schema-support=La m\u00E9thode setSchema et la propri\u00E9t\u00E9 schemaLanguage sont utilis\u00E9es
-
-jaxp_feature_not_supported=La fonctionnalit\u00E9 ''{0}'' n''est pas prise en charge.
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_it.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_it.properties
deleted file mode 100644
index 4f4fabb..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_it.properties
+++ /dev/null
@@ -1,69 +0,0 @@
-# This file stores localized messages for the Xerces
-# DOM implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-BadMessageKey = Impossibile trovare il messaggio di errore corrispondente alla chiave di messaggio.
-FormatFailed = Si \u00E8 verificato un errore interno durante la formattazione del seguente messaggio:\n
-
-# DOM Core
-
-# exception codes
-DOMSTRING_SIZE_ERR = L'intervallo di testo specificato non si adatta in DOMString.
-HIERARCHY_REQUEST_ERR = Si \u00E8 tentato di inserire un nodo in un punto in cui non \u00E8 consentito.
-INDEX_SIZE_ERR = L'indice o la dimensione \u00E8 negativa o maggiore del valore consentito.
-INUSE_ATTRIBUTE_ERR = Si \u00E8 tentato di aggiungere un attributo gi\u00E0 in uso altrove.
-INVALID_ACCESS_ERR = Un parametro o un'operazione non \u00E8 supportata dall'oggetto di base.
-INVALID_CHARACTER_ERR = \u00C8 stato specificato un carattere XML non valido.
-INVALID_MODIFICATION_ERR = Si \u00E8 tentato di modificare il tipo dell'oggetto di base.
-INVALID_STATE_ERR = Si \u00E8 tentato di utilizzare un oggetto che non \u00E8 o non \u00E8 pi\u00F9 utilizzabile.
-NAMESPACE_ERR = Si \u00E8 tentato di creare o modificare un oggetto in modo errato per quel che riguarda gli spazi di nomi.
-NOT_FOUND_ERR = Si \u00E8 tentato di fare riferimento a un nodo in un contesto in cui non esiste.
-NOT_SUPPORTED_ERR = L'implementazione non supporta il tipo richiesto di oggetto o operazione.
-NO_DATA_ALLOWED_ERR = Sono stati specificati dati per un nodo che non supporta dati.
-NO_MODIFICATION_ALLOWED_ERR = Si \u00E8 tentato di modificare un oggetto non modificabile.
-SYNTAX_ERR = \u00C8 stata specificata una stringa non valida.
-VALIDATION_ERR = Se si richiama un metodo come insertBefore o removeChild, il nodo non sar\u00E0 valido per quel che riguarda la grammatica del documento.
-WRONG_DOCUMENT_ERR = Un nodo \u00E8 utilizzato in un documento diverso da quello che lo ha creato.
-TYPE_MISMATCH_ERR = Il tipo di valore per questo nome parametro non \u00E8 compatibile con il tipo di valore previsto.
-
-#error messages or exceptions
-FEATURE_NOT_SUPPORTED = Il parametro {0} \u00E8 stato riconosciuto, ma non \u00E8 possibile impostare il valore richiesto.
-FEATURE_NOT_FOUND = Il parametro {0} non \u00E8 riconosciuto.
-STRING_TOO_LONG = La stringa risultante \u00E8 troppo lunga per adattarsi in DOMString: ''{0}''.
-
-#DOM Level 3 DOMError codes
-wf-invalid-character = Il testo {0} del nodo {1} contiene caratteri XML non validi.
-wf-invalid-character-in-node-name = Il nodo {0} denominato {1} contiene caratteri XML non validi.
-cdata-sections-splitted = Sezioni CDATA che contengono l'indicatore di fine della sezione CDATA '']]>''
-doctype-not-allowed = Dichiarazione DOCTYPE non consentita.
-unsupported-encoding = La codifica {0} non \u00E8 supportata.
-
-#Error codes used in DOM Normalizer
-InvalidXMLCharInDOM = \u00C8 stato trovato un carattere XML non valido (Unicode: 0x{0}) in DOM durante la normalizzazione.
-UndeclaredEntRefInAttrValue = L''attributo "{0}" con valore "{1}" fa riferimento a un''entit\u00E0 non dichiarata.
-NullLocalElementName = \u00C8 stato rilevato un nome locale nullo durante la normalizzazione dello spazio di nomi dell''elemento {0}.
-NullLocalAttrName = \u00C8 stato rilevato un nome locale nullo durante la normalizzazione dello spazio di nomi dell''attributo {0}.
-
-#Error codes used in DOMParser
-InvalidDocumentClassName = Il nome classe del document factory "{0}" utilizzato per creare la struttura DOM non \u00E8 di tipo org.w3c.dom.Document.
-MissingDocumentClassName = Impossibile trovare il nome classe del document factory "{0}" utilizzato per creare la struttura DOM.
-CannotCreateDocumentClass = Impossibile creare la classe denominata "{0}" come org.w3c.dom.Document.
-
-# Error codes used by JAXP DocumentBuilder
-jaxp-order-not-supported = Impostare la propriet\u00E0 ''{0}'' prima di impostare la propriet\u00E0 ''{1}''.
-jaxp-null-input-source = L'origine specificata non pu\u00F2 essere nulla.
-
-#Ranges
-BAD_BOUNDARYPOINTS_ERR = I punti limite di un intervallo non rispettano i requisiti specifici.
-INVALID_NODE_TYPE_ERR = Il contenitore di un punto limite di un intervallo \u00E8 stato impostato su un nodo di tipo non valido o su un nodo con un predecessore di tipo non valido.
-
-
-#Events
-UNSPECIFIED_EVENT_TYPE_ERR = Il tipo di evento non \u00E8 stato specificato inizializzando l'evento prima che fosse richiamato il metodo.
-
-
-jaxp-schema-support=Sono stati utilizzati sia il metodo setSchema che la propriet\u00E0 schemaLanguage
-
-jaxp_feature_not_supported=La funzione "{0}" non \u00E8 supportata.
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_ja.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_ja.properties
deleted file mode 100644
index c3b3dd9..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_ja.properties
+++ /dev/null
@@ -1,69 +0,0 @@
-# This file stores localized messages for the Xerces
-# DOM implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-BadMessageKey = \u30E1\u30C3\u30BB\u30FC\u30B8\u30FB\u30AD\u30FC\u306B\u5BFE\u5FDC\u3059\u308B\u30A8\u30E9\u30FC\u30FB\u30E1\u30C3\u30BB\u30FC\u30B8\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002
-FormatFailed = \u6B21\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\u306E\u66F8\u5F0F\u8A2D\u5B9A\u4E2D\u306B\u5185\u90E8\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F:\n
-
-# DOM Core
-
-# exception codes
-DOMSTRING_SIZE_ERR = \u6307\u5B9A\u3057\u305F\u30C6\u30AD\u30B9\u30C8\u7BC4\u56F2\u306FDOMString\u306B\u53CE\u307E\u308A\u307E\u305B\u3093\u3002
-HIERARCHY_REQUEST_ERR = \u8A31\u53EF\u3055\u308C\u3066\u3044\u306A\u3044\u5834\u6240\u3067\u30CE\u30FC\u30C9\u3092\u633F\u5165\u3057\u3088\u3046\u3068\u3057\u307E\u3057\u305F\u3002
-INDEX_SIZE_ERR = \u7D22\u5F15\u307E\u305F\u306F\u30B5\u30A4\u30BA\u304C\u8CA0\u304B\u3001\u8A31\u5BB9\u5024\u3088\u308A\u5927\u304D\u304F\u306A\u3063\u3066\u3044\u307E\u3059\u3002
-INUSE_ATTRIBUTE_ERR = \u4ED6\u306E\u5834\u6240\u3067\u3059\u3067\u306B\u4F7F\u7528\u3055\u308C\u3066\u3044\u308B\u5C5E\u6027\u3092\u8FFD\u52A0\u3057\u3088\u3046\u3068\u3057\u307E\u3057\u305F\u3002
-INVALID_ACCESS_ERR = \u57FA\u790E\u3068\u306A\u308B\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u3067\u30D1\u30E9\u30E1\u30FC\u30BF\u307E\u305F\u306F\u64CD\u4F5C\u304C\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
-INVALID_CHARACTER_ERR = \u7121\u52B9\u307E\u305F\u306F\u4E0D\u6B63\u306AXML\u6587\u5B57\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002
-INVALID_MODIFICATION_ERR = \u57FA\u790E\u3068\u306A\u308B\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u30BF\u30A4\u30D7\u3092\u5909\u66F4\u3057\u3088\u3046\u3068\u3057\u307E\u3057\u305F\u3002
-INVALID_STATE_ERR = \u4F7F\u7528\u3067\u304D\u306A\u3044\u304B\u3001\u4ECA\u5F8C\u4F7F\u7528\u3067\u304D\u306A\u304F\u306A\u308B\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u3092\u4F7F\u7528\u3057\u3088\u3046\u3068\u3057\u307E\u3057\u305F\u3002
-NAMESPACE_ERR = \u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u306B\u95A2\u3057\u3066\u4E0D\u9069\u5207\u306A\u65B9\u6CD5\u3067\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u3092\u4F5C\u6210\u307E\u305F\u306F\u5909\u66F4\u3057\u3088\u3046\u3068\u3057\u307E\u3057\u305F\u3002
-NOT_FOUND_ERR = \u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u306B\u5B58\u5728\u3057\u306A\u3044\u30CE\u30FC\u30C9\u3092\u53C2\u7167\u3057\u3088\u3046\u3068\u3057\u307E\u3057\u305F\u3002
-NOT_SUPPORTED_ERR = \u30EA\u30AF\u30A8\u30B9\u30C8\u3057\u305F\u30BF\u30A4\u30D7\u306E\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u307E\u305F\u306F\u64CD\u4F5C\u306F\u5B9F\u88C5\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
-NO_DATA_ALLOWED_ERR = \u30C7\u30FC\u30BF\u3092\u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u306A\u3044\u30CE\u30FC\u30C9\u306B\u5BFE\u3057\u3066\u30C7\u30FC\u30BF\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002
-NO_MODIFICATION_ALLOWED_ERR = \u5909\u66F4\u304C\u8A31\u53EF\u3055\u308C\u3066\u3044\u306A\u3044\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u3092\u5909\u66F4\u3057\u3088\u3046\u3068\u3057\u307E\u3057\u305F\u3002
-SYNTAX_ERR = \u7121\u52B9\u307E\u305F\u306F\u4E0D\u6B63\u306A\u6587\u5B57\u5217\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002
-VALIDATION_ERR = insertBefore\u3001removeChild\u306A\u3069\u306E\u30E1\u30BD\u30C3\u30C9\u3092\u547C\u3073\u51FA\u3059\u3068\u3001\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u69CB\u6587\u306B\u95A2\u3057\u3066\u30CE\u30FC\u30C9\u304C\u7121\u52B9\u306B\u306A\u308A\u307E\u3059\u3002
-WRONG_DOCUMENT_ERR = \u30CE\u30FC\u30C9\u304C\u3001\u305D\u306E\u30CE\u30FC\u30C9\u3092\u4F5C\u6210\u3057\u305F\u3082\u306E\u3068\u306F\u7570\u306A\u308B\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3067\u4F7F\u7528\u3055\u308C\u3066\u3044\u307E\u3059\u3002
-TYPE_MISMATCH_ERR = \u3053\u306E\u30D1\u30E9\u30E1\u30FC\u30BF\u540D\u306E\u5024\u30BF\u30A4\u30D7\u306F\u3001\u4E88\u60F3\u3057\u305F\u5024\u30BF\u30A4\u30D7\u3068\u4E92\u63DB\u6027\u304C\u3042\u308A\u307E\u305B\u3093\u3002
-
-#error messages or exceptions
-FEATURE_NOT_SUPPORTED = \u30D1\u30E9\u30E1\u30FC\u30BF{0}\u306F\u8A8D\u8B58\u3055\u308C\u307E\u3059\u304C\u3001\u30EA\u30AF\u30A8\u30B9\u30C8\u3057\u305F\u5024\u306F\u8A2D\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002
-FEATURE_NOT_FOUND = \u30D1\u30E9\u30E1\u30FC\u30BF{0}\u306F\u8A8D\u8B58\u3055\u308C\u307E\u305B\u3093\u3002
-STRING_TOO_LONG = \u7D50\u679C\u306E\u6587\u5B57\u5217\u306F\u9577\u3059\u304E\u308B\u305F\u3081\u3001DOMString\u306B\u53CE\u307E\u308A\u307E\u305B\u3093: ''{0}''\u3002
-
-#DOM Level 3 DOMError codes
-wf-invalid-character = {1}\u30CE\u30FC\u30C9\u306E\u30C6\u30AD\u30B9\u30C8{0}\u306B\u7121\u52B9\u306AXML\u6587\u5B57\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u3002
-wf-invalid-character-in-node-name = {1}\u3068\u3044\u3046\u540D\u524D\u306E{0}\u30CE\u30FC\u30C9\u306B\u7121\u52B9\u306AXML\u6587\u5B57\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u3002
-cdata-sections-splitted = CDATA\u30BB\u30AF\u30B7\u30E7\u30F3\u306BCDATA\u30BB\u30AF\u30B7\u30E7\u30F3\u7D42\u4E86\u30DE\u30FC\u30AB\u30FC'']]>''\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059
-doctype-not-allowed = DOCTYPE\u5BA3\u8A00\u306F\u8A31\u53EF\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
-unsupported-encoding = \u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0{0}\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
-
-#Error codes used in DOM Normalizer
-InvalidXMLCharInDOM = \u6B63\u898F\u5316\u4E2D\u306BDOM\u5185\u306B\u7121\u52B9\u306AXML\u6587\u5B57(Unicode: 0x{0})\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002
-UndeclaredEntRefInAttrValue = \u5C5E\u6027"{0}"\u306E\u5024"{1}"\u3067\u53C2\u7167\u3055\u308C\u3066\u3044\u308B\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u304C\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
-NullLocalElementName = \u8981\u7D20{0}\u306E\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u306E\u6B63\u898F\u5316\u4E2D\u306Bnull\u306E\u30ED\u30FC\u30AB\u30EB\u540D\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002
-NullLocalAttrName = \u5C5E\u6027{0}\u306E\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u306E\u6B63\u898F\u5316\u4E2D\u306Bnull\u306E\u30ED\u30FC\u30AB\u30EB\u540D\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002
-
-#Error codes used in DOMParser
-InvalidDocumentClassName = DOM\u30C4\u30EA\u30FC\u306E\u69CB\u7BC9\u306B\u4F7F\u7528\u3055\u308C\u308B\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u30FB\u30D5\u30A1\u30AF\u30C8\u30EA"{0}"\u306E\u30AF\u30E9\u30B9\u540D\u304C\u30BF\u30A4\u30D7org.w3c.dom.Document\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
-MissingDocumentClassName = DOM\u30C4\u30EA\u30FC\u306E\u69CB\u7BC9\u306B\u4F7F\u7528\u3055\u308C\u308B\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u30FB\u30D5\u30A1\u30AF\u30C8\u30EA"{0}"\u306E\u30AF\u30E9\u30B9\u540D\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002
-CannotCreateDocumentClass = "{0}"\u3068\u3044\u3046\u540D\u524D\u306E\u30AF\u30E9\u30B9\u3092org.w3c.dom.Document\u3068\u3057\u3066\u69CB\u7BC9\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002
-
-# Error codes used by JAXP DocumentBuilder
-jaxp-order-not-supported = \u30D7\u30ED\u30D1\u30C6\u30A3''{1}''\u3092\u8A2D\u5B9A\u3059\u308B\u524D\u306B\u30D7\u30ED\u30D1\u30C6\u30A3''{0}''\u3092\u8A2D\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
-jaxp-null-input-source = \u6307\u5B9A\u3057\u305F\u30BD\u30FC\u30B9\u306Fnull\u306B\u3067\u304D\u307E\u305B\u3093\u3002
-
-#Ranges
-BAD_BOUNDARYPOINTS_ERR = Range\u306E\u5883\u754C\u70B9\u304C\u7279\u5B9A\u306E\u8981\u4EF6\u3092\u6E80\u305F\u3057\u3066\u3044\u307E\u305B\u3093\u3002
-INVALID_NODE_TYPE_ERR = Range\u306E\u5883\u754C\u70B9\u306E\u30B3\u30F3\u30C6\u30CA\u304C\u3001\u7121\u52B9\u306A\u30BF\u30A4\u30D7\u306E\u30CE\u30FC\u30C9\u307E\u305F\u306F\u7121\u52B9\u306A\u30BF\u30A4\u30D7\u306E\u7956\u5148\u3092\u6301\u3064\u30CE\u30FC\u30C9\u306B\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002
-
-
-#Events
-UNSPECIFIED_EVENT_TYPE_ERR = \u30E1\u30BD\u30C3\u30C9\u3092\u547C\u3073\u51FA\u3059\u524D\u306E\u30A4\u30D9\u30F3\u30C8\u306E\u521D\u671F\u5316\u3067\u3001\u30A4\u30D9\u30F3\u30C8\u306E\u30BF\u30A4\u30D7\u304C\u6307\u5B9A\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002
-
-
-jaxp-schema-support=setSchema\u30E1\u30BD\u30C3\u30C9\u304A\u3088\u3073schemaLanguage\u30D7\u30ED\u30D1\u30C6\u30A3\u306E\u4E21\u65B9\u304C\u4F7F\u7528\u3055\u308C\u3066\u3044\u307E\u3059
-
-jaxp_feature_not_supported=\u6A5F\u80FD"{0}"\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_ko.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_ko.properties
deleted file mode 100644
index 59cb8f4..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_ko.properties
+++ /dev/null
@@ -1,69 +0,0 @@
-# This file stores localized messages for the Xerces
-# DOM implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-BadMessageKey = \uBA54\uC2DC\uC9C0 \uD0A4\uC5D0 \uD574\uB2F9\uD558\uB294 \uC624\uB958 \uBA54\uC2DC\uC9C0\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
-FormatFailed = \uB2E4\uC74C \uBA54\uC2DC\uC9C0\uC758 \uD615\uC2DD\uC744 \uC9C0\uC815\uD558\uB294 \uC911 \uB0B4\uBD80 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4.\n
-
-# DOM Core
-
-# exception codes
-DOMSTRING_SIZE_ERR = \uD14D\uC2A4\uD2B8\uC758 \uC9C0\uC815\uB41C \uBC94\uC704\uAC00 DOMString\uC5D0 \uB9DE\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
-HIERARCHY_REQUEST_ERR = \uC0BD\uC785\uC774 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uB294 \uB178\uB4DC\uB97C \uC0BD\uC785\uD558\uB824\uACE0 \uC2DC\uB3C4\uD588\uC2B5\uB2C8\uB2E4.
-INDEX_SIZE_ERR = \uC778\uB371\uC2A4 \uB610\uB294 \uD06C\uAE30\uAC00 \uC74C\uC218\uC774\uAC70\uB098 \uD5C8\uC6A9\uB418\uB294 \uAC12\uBCF4\uB2E4 \uD07D\uB2C8\uB2E4.
-INUSE_ATTRIBUTE_ERR = \uB2E4\uB978 \uC704\uCE58\uC5D0\uC11C \uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC778 \uC18D\uC131\uC744 \uCD94\uAC00\uD558\uB824\uACE0 \uC2DC\uB3C4\uD588\uC2B5\uB2C8\uB2E4.
-INVALID_ACCESS_ERR = \uAE30\uBCF8 \uAC1D\uCCB4\uC5D0\uC11C \uB9E4\uAC1C\uBCC0\uC218 \uB610\uB294 \uC791\uC5C5\uC744 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
-INVALID_CHARACTER_ERR = \uBD80\uC801\uD569\uD558\uAC70\uB098 \uC798\uBABB\uB41C XML \uBB38\uC790\uAC00 \uC9C0\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
-INVALID_MODIFICATION_ERR = \uAE30\uBCF8 \uAC1D\uCCB4\uC758 \uC720\uD615\uC744 \uC218\uC815\uD558\uB824\uACE0 \uC2DC\uB3C4\uD588\uC2B5\uB2C8\uB2E4.
-INVALID_STATE_ERR = \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uAC70\uB098 \uB354 \uC774\uC0C1 \uC0AC\uC6A9\uC774 \uD5C8\uAC00\uB418\uC9C0 \uC54A\uC740 \uAC1D\uCCB4\uB97C \uC0AC\uC6A9\uD558\uB824\uACE0 \uC2DC\uB3C4\uD588\uC2B5\uB2C8\uB2E4.
-NAMESPACE_ERR = \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uC5D0 \uB300\uD574 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC740 \uBC29\uC2DD\uC73C\uB85C \uAC1D\uCCB4\uB97C \uC0DD\uC131\uD558\uAC70\uB098 \uBCC0\uACBD\uD558\uB824\uACE0 \uC2DC\uB3C4\uD588\uC2B5\uB2C8\uB2E4.
-NOT_FOUND_ERR = \uC874\uC7AC\uD558\uC9C0 \uC54A\uB294 \uCEE8\uD14D\uC2A4\uD2B8\uC758 \uB178\uB4DC\uB97C \uCC38\uC870\uD558\uB824\uACE0 \uC2DC\uB3C4\uD588\uC2B5\uB2C8\uB2E4.
-NOT_SUPPORTED_ERR = \uAD6C\uD604\uC5D0\uC11C \uC694\uCCAD\uB41C \uC720\uD615\uC758 \uAC1D\uCCB4 \uB610\uB294 \uC791\uC5C5\uC744 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
-NO_DATA_ALLOWED_ERR = \uB370\uC774\uD130\uB97C \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 \uB178\uB4DC\uC5D0 \uB300\uD574 \uB370\uC774\uD130\uAC00 \uC9C0\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
-NO_MODIFICATION_ALLOWED_ERR = \uC218\uC815\uC774 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uB294 \uAC1D\uCCB4\uB97C \uC218\uC815\uD558\uB824\uACE0 \uC2DC\uB3C4\uD588\uC2B5\uB2C8\uB2E4.
-SYNTAX_ERR = \uBD80\uC801\uD569\uD558\uAC70\uB098 \uC798\uBABB\uB41C \uBB38\uC790\uC5F4\uC774 \uC9C0\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
-VALIDATION_ERR = insertBefore \uB610\uB294 removeChild\uC640 \uAC19\uC740 \uBA54\uC18C\uB4DC\uB97C \uD638\uCD9C\uD558\uBA74 \uB178\uB4DC\uAC00 \uBB38\uC11C \uBB38\uBC95\uC5D0 \uB300\uD574 \uBD80\uC801\uD569\uD574\uC9D1\uB2C8\uB2E4.
-WRONG_DOCUMENT_ERR = \uB178\uB4DC\uAC00 \uC0DD\uC131\uB41C \uBB38\uC11C\uAC00 \uC544\uB2CC \uB2E4\uB978 \uBB38\uC11C\uC5D0\uC11C \uC0AC\uC6A9\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
-TYPE_MISMATCH_ERR = \uC774 \uB9E4\uAC1C\uBCC0\uC218 \uC774\uB984\uC5D0 \uB300\uD55C \uAC12 \uC720\uD615\uC774 \uD544\uC694\uD55C \uAC12 \uC720\uD615\uACFC \uD638\uD658\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
-
-#error messages or exceptions
-FEATURE_NOT_SUPPORTED = {0} \uB9E4\uAC1C\uBCC0\uC218\uAC00 \uC778\uC2DD\uB418\uC5C8\uC9C0\uB9CC \uC694\uCCAD\uB41C \uAC12\uC744 \uC124\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
-FEATURE_NOT_FOUND = {0} \uB9E4\uAC1C\uBCC0\uC218\uB97C \uC778\uC2DD\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
-STRING_TOO_LONG = \uACB0\uACFC \uBB38\uC790\uC5F4\uC774 \uB108\uBB34 \uCEE4\uC11C DOMString\uC5D0 \uB9DE\uC9C0 \uC54A\uC74C: ''{0}''.
-
-#DOM Level 3 DOMError codes
-wf-invalid-character = {1} \uB178\uB4DC\uC758 {0} \uD14D\uC2A4\uD2B8\uC5D0 \uBD80\uC801\uD569\uD55C XML \uBB38\uC790\uAC00 \uD3EC\uD568\uB418\uC5B4 \uC788\uC2B5\uB2C8\uB2E4.
-wf-invalid-character-in-node-name = \uC774\uB984\uC774 {1}\uC778 {0} \uB178\uB4DC\uC5D0 \uBD80\uC801\uD569\uD55C XML \uBB38\uC790\uAC00 \uD3EC\uD568\uB418\uC5B4 \uC788\uC2B5\uB2C8\uB2E4.
-cdata-sections-splitted = CDATA \uC139\uC158 \uC885\uB8CC \uD45C\uC2DC\uC790 '']]>''\uB97C \uD3EC\uD568\uD558\uB294 CDATA \uC139\uC158
-doctype-not-allowed = DOCTYPE \uC120\uC5B8\uC740 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
-unsupported-encoding = {0} \uC778\uCF54\uB529\uC740 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
-
-#Error codes used in DOM Normalizer
-InvalidXMLCharInDOM = \uC815\uADDC\uD654 \uC911 DOM\uC5D0\uC11C \uBD80\uC801\uD569\uD55C XML \uBB38\uC790(\uC720\uB2C8\uCF54\uB4DC: 0x{0})\uAC00 \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
-UndeclaredEntRefInAttrValue = \uC18D\uC131 "{0}" \uAC12 "{1}"\uC774(\uAC00) \uC120\uC5B8\uB418\uC9C0 \uC54A\uC740 \uC5D4\uD2F0\uD2F0\uB97C \uCC38\uC870\uD588\uC2B5\uB2C8\uB2E4.
-NullLocalElementName = {0} \uC694\uC18C\uC758 \uB124\uC784\uC2A4\uD398\uC774\uC2A4 \uC815\uADDC\uD654 \uC911 \uB110 \uB85C\uCEEC \uC774\uB984\uC774 \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
-NullLocalAttrName = {0} \uC18D\uC131\uC758 \uB124\uC784\uC2A4\uD398\uC774\uC2A4 \uC815\uADDC\uD654 \uC911 \uB110 \uB85C\uCEEC \uC774\uB984\uC774 \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
-
-#Error codes used in DOMParser
-InvalidDocumentClassName = DOM \uD2B8\uB9AC \uC0DD\uC131\uC5D0 \uC0AC\uC6A9\uB41C \uBB38\uC11C \uD329\uD1A0\uB9AC "{0}"\uC758 \uD074\uB798\uC2A4 \uC774\uB984\uC740 org.w3c.dom.Document \uC720\uD615\uC774 \uC544\uB2D9\uB2C8\uB2E4.
-MissingDocumentClassName = DOM \uD2B8\uB9AC \uC0DD\uC131\uC5D0 \uC0AC\uC6A9\uB41C \uBB38\uC11C \uD329\uD1A0\uB9AC "{0}"\uC758 \uD074\uB798\uC2A4 \uC774\uB984\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
-CannotCreateDocumentClass = \uC774\uB984\uC774 "{0}"\uC778 \uD074\uB798\uC2A4\uB97C org.w3c.dom.Document\uB85C \uC0DD\uC131\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
-
-# Error codes used by JAXP DocumentBuilder
-jaxp-order-not-supported = ''{1}'' \uC18D\uC131\uC744 \uC124\uC815\uD558\uAE30 \uC804\uC5D0 ''{0}'' \uC18D\uC131\uC744 \uC124\uC815\uD574\uC57C \uD569\uB2C8\uB2E4.
-jaxp-null-input-source = \uC9C0\uC815\uB41C \uC18C\uC2A4\uB294 \uB110\uC77C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
-
-#Ranges
-BAD_BOUNDARYPOINTS_ERR = \uBC94\uC704\uC758 \uACBD\uACC4 \uC9C0\uC810\uC774 \uD2B9\uC815 \uC694\uAD6C \uC0AC\uD56D\uC744 \uCDA9\uC871\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
-INVALID_NODE_TYPE_ERR = \uBC94\uC704\uC758 \uACBD\uACC4 \uC9C0\uC810 \uCEE8\uD14C\uC774\uB108\uAC00 \uBD80\uC801\uD569\uD55C \uC720\uD615\uC758 \uB178\uB4DC \uB610\uB294 \uBD80\uC801\uD569\uD55C \uC720\uD615\uC758 \uC870\uC0C1\uC744 \uAC00\uC9C4 \uB178\uB4DC\uB85C \uC124\uC815\uB418\uACE0 \uC788\uC2B5\uB2C8\uB2E4.
-
-
-#Events
-UNSPECIFIED_EVENT_TYPE_ERR = \uBA54\uC18C\uB4DC\uAC00 \uD638\uCD9C\uB418\uAE30 \uC804\uC5D0 \uC774\uBCA4\uD2B8\uB97C \uCD08\uAE30\uD654\uD558\uC5EC \uC774\uBCA4\uD2B8 \uC720\uD615\uC774 \uC9C0\uC815\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4.
-
-
-jaxp-schema-support=setSchema \uBA54\uC18C\uB4DC\uC640 schemaLanguage \uC18D\uC131\uC774 \uBAA8\uB450 \uC0AC\uC6A9\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
-
-jaxp_feature_not_supported="{0}" \uAE30\uB2A5\uC740 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_pt_BR.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_pt_BR.properties
deleted file mode 100644
index 5fcc566..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_pt_BR.properties
+++ /dev/null
@@ -1,69 +0,0 @@
-# This file stores localized messages for the Xerces
-# DOM implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-BadMessageKey = N\u00E3o foi poss\u00EDvel encontrar a mensagem de erro correspondente \u00E0 chave da mensagem.
-FormatFailed = Ocorreu um erro interno ao formatar a mensagem a seguir:\n
-
-# DOM Core
-
-# exception codes
-DOMSTRING_SIZE_ERR = A faixa de texto especificada n\u00E3o se ajusta a DOMString.
-HIERARCHY_REQUEST_ERR = Houve uma tentativa de inserir um n\u00F3 onde n\u00E3o era permitido.
-INDEX_SIZE_ERR = O \u00EDndice ou o tamanho \u00E9 negativo ou maior que o valor permitido.
-INUSE_ATTRIBUTE_ERR = Houve uma tentativa de adicionar um atributo que j\u00E1 est\u00E1 sendo usado em outro lugar.
-INVALID_ACCESS_ERR = Um par\u00E2metro ou uma opera\u00E7\u00E3o n\u00E3o suportado pelo objeto subjacente.
-INVALID_CHARACTER_ERR = Um caractere XML inv\u00E1lido ou ilegal foi especificado.
-INVALID_MODIFICATION_ERR = Houve uma tentativa de modificar o tipo de objeto subjacente.
-INVALID_STATE_ERR = Houve uma tentativa de usar um objeto que n\u00E3o \u00E9 mais utiliz\u00E1vel.
-NAMESPACE_ERR = Houve uma tentativa de criar ou alterar um objeto de uma forma incorreta em rela\u00E7\u00E3o aos namespaces.
-NOT_FOUND_ERR = Houve uma tentativa de fazer refer\u00EAncia a um n\u00F3 em um contexto no qual ele n\u00E3o existe.
-NOT_SUPPORTED_ERR = A implementa\u00E7\u00E3o n\u00E3o suporta o tipo solicitado de objeto ou opera\u00E7\u00E3o.
-NO_DATA_ALLOWED_ERR = Os dados foram especificados para um n\u00F3 que n\u00E3o suporta dados.
-NO_MODIFICATION_ALLOWED_ERR = Foi feita uma tentativa de modificar um objeto no qual n\u00E3o s\u00E3o permitidas modifica\u00E7\u00F5es.
-SYNTAX_ERR = Uma string inv\u00E1lida ou ilegal foi especificada.
-VALIDATION_ERR = Uma chamada para um m\u00E9todo como insertBefore ou removeChild tornaria o N\u00F3 inv\u00E1lido em rela\u00E7\u00E3o \u00E0 gram\u00E1tica do documento.
-WRONG_DOCUMENT_ERR = Um n\u00F3 \u00E9 usado em um documento diferente daquele que foi criado.
-TYPE_MISMATCH_ERR = O tipo de valor do nome deste par\u00E2metro \u00E9 incompat\u00EDvel com o tipo de valor esperado.
-
-#error messages or exceptions
-FEATURE_NOT_SUPPORTED = O par\u00E2metro {0} \u00E9 reconhecido, mas o valor solicitado n\u00E3o pode ser definido.
-FEATURE_NOT_FOUND = O par\u00E2metro {0} n\u00E3o \u00E9 reconhecido.
-STRING_TOO_LONG = A string resultante \u00E9 muito longa para se ajustar a uma DOMString: ''{0}''.
-
-#DOM Level 3 DOMError codes
-wf-invalid-character = O texto {0} do n\u00F3 {1} cont\u00E9m caracteres XML inv\u00E1lidos.
-wf-invalid-character-in-node-name = O n\u00F3 {0} com o nome {1} cont\u00E9m caracteres XML inv\u00E1lidos.
-cdata-sections-splitted = Se\u00E7\u00F5es CDATA que cont\u00EAm o marcador '']]>'' de termina\u00E7\u00E3o de se\u00E7\u00E3o CDATA
-doctype-not-allowed = A declara\u00E7\u00E3o DOCTYPE n\u00E3o \u00E9 permitida.
-unsupported-encoding = A codifica\u00E7\u00E3o {0} n\u00E3o \u00E9 suportada.
-
-#Error codes used in DOM Normalizer
-InvalidXMLCharInDOM = Um caractere XML inv\u00E1lido (Unicode: 0x {0}) foi encontrado no DOM durante a normaliza\u00E7\u00E3o.
-UndeclaredEntRefInAttrValue = O atributo "{0}" valor "{1}" mencionou uma entidade que n\u00E3o foi declarada.
-NullLocalElementName = Um nome de local nulo foi encontrado durante a normaliza\u00E7\u00E3o do namespace do elemento {0}.
-NullLocalAttrName = Um nome de local nulo foi encontrado durante a normaliza\u00E7\u00E3o do namespace do atributo {0}.
-
-#Error codes used in DOMParser
-InvalidDocumentClassName = O nome da classe do factory do documento "{0}" usado para construir a \u00E1rvore DOM n\u00E3o \u00E9 do tipo org.w3c.dom.Document.
-MissingDocumentClassName = N\u00E3o foi poss\u00EDvel encontrar o nome da classe do factory do documento "{0}" usado para construir a \u00E1rvore DOM.
-CannotCreateDocumentClass = N\u00E3o foi poss\u00EDvel construir a classe com o nome "{0}" como um org.w3c.dom.Document.
-
-# Error codes used by JAXP DocumentBuilder
-jaxp-order-not-supported = A propriedade ''{0}'' deve ser estabelecida antes da defini\u00E7\u00E3o da propriedade ''{1}''.
-jaxp-null-input-source = A origem especificada n\u00E3o pode ser nula.
-
-#Ranges
-BAD_BOUNDARYPOINTS_ERR = Os pontos-limite de uma Faixa n\u00E3o atendem aos requisitos espec\u00EDficos.
-INVALID_NODE_TYPE_ERR = O container de um ponto-limite de uma Faixa est\u00E1 sendo definido para um n\u00F3 de um tipo inv\u00E1lido ou um n\u00F3 com um ancestral de um tipo inv\u00E1lido.
-
-
-#Events
-UNSPECIFIED_EVENT_TYPE_ERR = O tipo de Evento n\u00E3o foi especificado por meio da inicializa\u00E7\u00E3o do evento antes do m\u00E9todo ser chamado.
-
-
-jaxp-schema-support=O m\u00E9todo setSchema e a propriedade schemaLanguage foram usados
-
-jaxp_feature_not_supported=O recurso "{0}" n\u00E3o \u00E9 suportado.
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_sv.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_sv.properties
deleted file mode 100644
index c3ec779..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_sv.properties
+++ /dev/null
@@ -1,69 +0,0 @@
-# This file stores localized messages for the Xerces
-# DOM implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-BadMessageKey = Hittar inte felmeddelandet som motsvarar meddelandenyckeln.
-FormatFailed = Ett internt fel intr\u00E4ffade vid formatering av f\u00F6ljande meddelande:\n
-
-# DOM Core
-
-# exception codes
-DOMSTRING_SIZE_ERR = Angivet textintervall ryms inte i DOMString.
-HIERARCHY_REQUEST_ERR = Ett f\u00F6rs\u00F6k gjordes att infoga nod d\u00E4r det inte \u00E4r till\u00E5tet.
-INDEX_SIZE_ERR = Index eller storlek \u00E4r negativt tal eller st\u00F6rre \u00E4n till\u00E5tet v\u00E4rde.
-INUSE_ATTRIBUTE_ERR = Ett f\u00F6rs\u00F6k g\u00F6rs att l\u00E4gga till ett attribut som redan anv\u00E4nds p\u00E5 annan plats.
-INVALID_ACCESS_ERR = En parameter eller en \u00E5tg\u00E4rd st\u00F6ds inte av underliggande objekt.
-INVALID_CHARACTER_ERR = Ett ogiltigt eller otill\u00E5tet XML-tecken har angetts.
-INVALID_MODIFICATION_ERR = Ett f\u00F6rs\u00F6k g\u00F6rs att \u00E4ndra typ av underliggande objekt.
-INVALID_STATE_ERR = Ett f\u00F6rs\u00F6k g\u00F6rs att anv\u00E4nda ett objekt som inte (l\u00E4ngre) \u00E4r anv\u00E4ndbar.
-NAMESPACE_ERR = Ett f\u00F6rs\u00F6k g\u00F6rs att skapa eller \u00E4ndra ett objekt p\u00E5 ett felaktigt s\u00E4tt avseende namnrymder.
-NOT_FOUND_ERR = Ett f\u00F6rs\u00F6k g\u00F6rs att skapa referens till en nod i ett sammanhang d\u00E4r den inte finns.
-NOT_SUPPORTED_ERR = Implementeringen saknar st\u00F6d f\u00F6r beg\u00E4rd typ av objekt eller \u00E5tg\u00E4rd.
-NO_DATA_ALLOWED_ERR = Data anges f\u00F6r en nod som inte st\u00F6der data.
-NO_MODIFICATION_ALLOWED_ERR = F\u00F6rs\u00F6ker \u00E4ndra ett objekt d\u00E4r \u00E4ndringar inte \u00E4r till\u00E5tna.
-SYNTAX_ERR = En ogiltig eller otill\u00E5ten str\u00E4ng anges.
-VALIDATION_ERR = Ett anrop till en metod som insertBefore eller removeChild skulle g\u00F6ra noden ogiltig med aktuell dokumentgrammatik.
-WRONG_DOCUMENT_ERR = En nod anv\u00E4nds i ett annat dokument \u00E4n det som skapade noden.
-TYPE_MISMATCH_ERR = V\u00E4rdetypen f\u00F6r detta parameternamn \u00E4r inkompatibelt med f\u00F6rv\u00E4ntad v\u00E4rdetyp.
-
-#error messages or exceptions
-FEATURE_NOT_SUPPORTED = Parametern {0} kan identifieras, men det beg\u00E4rda v\u00E4rdet kan inte anges.
-FEATURE_NOT_FOUND = Parametern {0} kan inte identifieras.
-STRING_TOO_LONG = Resultatstr\u00E4ngen \u00E4r f\u00F6r l\u00E5ng och ryms inte i DOMString: ''{0}''.
-
-#DOM Level 3 DOMError codes
-wf-invalid-character = Texten {0} i noden {1} inneh\u00E5ller ogiltiga XML-tecken.
-wf-invalid-character-in-node-name = Noden {0} med namnet {1} inneh\u00E5ller ogiltiga XML-tecken.
-cdata-sections-splitted = CDATA-sektioner inneh\u00E5ller avslutningsmark\u00F6ren '']]>''
-doctype-not-allowed = DOCTYPE-deklaration \u00E4r inte till\u00E5tet.
-unsupported-encoding = Kodningen {0} st\u00F6ds inte.
-
-#Error codes used in DOM Normalizer
-InvalidXMLCharInDOM = Ett ogiltigt XML-tecken (Unicode: 0x{0}) hittades i DOM vid normalisering.
-UndeclaredEntRefInAttrValue = Attributet "{0}" med v\u00E4rdet "{1}" refererade en enhet som inte har deklarerats.
-NullLocalElementName = Ett lokalt namn med null-v\u00E4rde p\u00E5tr\u00E4ffades vid namnrymdsnormalisering av elementet {0}.
-NullLocalAttrName = Ett lokalt namn med null-v\u00E4rde p\u00E5tr\u00E4ffades vid namnrymdsnormalisering av attributet {0}.
-
-#Error codes used in DOMParser
-InvalidDocumentClassName = Klassnamnet p\u00E5 dokumentfabrik "{0}" som anv\u00E4nds vid konstruktion av DOM-tr\u00E4det \u00E4r inte typ org.w3c.dom.Document.
-MissingDocumentClassName = Hittade inte klassnamnet p\u00E5 dokumentfabrik "{0}" som anv\u00E4nds vid konstruktion av DOM-tr\u00E4det.
-CannotCreateDocumentClass = Klassen "{0}" kunde inte konstrueras som org.w3c.dom.Document.
-
-# Error codes used by JAXP DocumentBuilder
-jaxp-order-not-supported = Egenskapen ''{0}'' m\u00E5ste anges f\u00F6re inst\u00E4llning av egenskapen ''{1}''.
-jaxp-null-input-source = Angiven k\u00E4lla f\u00E5r inte vara null.
-
-#Ranges
-BAD_BOUNDARYPOINTS_ERR = Gr\u00E4nspunkterna i ett intervall uppfyller inte de specifika kraven.
-INVALID_NODE_TYPE_ERR = En container med gr\u00E4nspunktsintervall anges till nod av ogiltig typ eller nod med \u00F6verordnad av ogiltig typ.
-
-
-#Events
-UNSPECIFIED_EVENT_TYPE_ERR = H\u00E4ndelsetyp specificerades inte n\u00E4r h\u00E4ndelsen initierades f\u00F6re metodanrop.
-
-
-jaxp-schema-support=B\u00E5de setSchema-metoden och schemaLanguage-egenskapen anv\u00E4nds
-
-jaxp_feature_not_supported=Funktionen "{0}" st\u00F6ds inte.
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_zh_CN.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_zh_CN.properties
deleted file mode 100644
index 224c7a6..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_zh_CN.properties
+++ /dev/null
@@ -1,69 +0,0 @@
-# This file stores localized messages for the Xerces
-# DOM implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-BadMessageKey = \u627E\u4E0D\u5230\u4E0E\u6D88\u606F\u5173\u952E\u5B57\u5BF9\u5E94\u7684\u9519\u8BEF\u6D88\u606F\u3002
-FormatFailed = \u8BBE\u7F6E\u4EE5\u4E0B\u6D88\u606F\u7684\u683C\u5F0F\u65F6\u51FA\u73B0\u5185\u90E8\u9519\u8BEF:\n
-
-# DOM Core
-
-# exception codes
-DOMSTRING_SIZE_ERR = \u6307\u5B9A\u7684\u6587\u672C\u8303\u56F4\u4E0D\u9002\u5408 DOMString\u3002
-HIERARCHY_REQUEST_ERR = \u5C1D\u8BD5\u5728\u4E0D\u5141\u8BB8\u7684\u4F4D\u7F6E\u63D2\u5165\u8282\u70B9\u3002
-INDEX_SIZE_ERR = \u7D22\u5F15\u6216\u5927\u5C0F\u4E3A\u8D1F\u503C, \u6216\u8005\u5927\u4E8E\u5141\u8BB8\u7684\u503C\u3002
-INUSE_ATTRIBUTE_ERR = \u5C1D\u8BD5\u6DFB\u52A0\u5DF2\u5728\u5176\u4ED6\u4F4D\u7F6E\u4F7F\u7528\u7684\u5C5E\u6027\u3002
-INVALID_ACCESS_ERR = \u57FA\u7840\u5BF9\u8C61\u4E0D\u652F\u6301\u53C2\u6570\u6216\u64CD\u4F5C\u3002
-INVALID_CHARACTER_ERR = \u6307\u5B9A\u7684 XML \u5B57\u7B26\u65E0\u6548\u6216\u975E\u6CD5\u3002
-INVALID_MODIFICATION_ERR = \u5C1D\u8BD5\u4FEE\u6539\u57FA\u7840\u5BF9\u8C61\u7684\u7C7B\u578B\u3002
-INVALID_STATE_ERR = \u5C1D\u8BD5\u4F7F\u7528\u65E0\u6CD5\u4F7F\u7528\u6216\u4E0D\u518D\u53EF\u7528\u7684\u5BF9\u8C61\u3002
-NAMESPACE_ERR = \u5C1D\u8BD5\u4EE5\u9519\u8BEF\u7684\u540D\u79F0\u7A7A\u95F4\u521B\u5EFA\u6216\u66F4\u6539\u65B9\u5F0F\u6765\u521B\u5EFA\u6216\u66F4\u6539\u5BF9\u8C61\u3002
-NOT_FOUND_ERR = \u5C1D\u8BD5\u5728\u4E0A\u4E0B\u6587\u4E2D\u5F15\u7528\u4E0D\u5B58\u5728\u7684\u8282\u70B9\u3002
-NOT_SUPPORTED_ERR = \u5B9E\u73B0\u4E0D\u652F\u6301\u8BF7\u6C42\u7684\u5BF9\u8C61\u6216\u64CD\u4F5C\u7C7B\u578B\u3002
-NO_DATA_ALLOWED_ERR = \u5DF2\u4E3A\u4E0D\u652F\u6301\u6570\u636E\u7684\u8282\u70B9\u6307\u5B9A\u6570\u636E\u3002
-NO_MODIFICATION_ALLOWED_ERR = \u5C1D\u8BD5\u4FEE\u6539\u4E0D\u5141\u8BB8\u4FEE\u6539\u7684\u5BF9\u8C61\u3002
-SYNTAX_ERR = \u6307\u5B9A\u7684\u5B57\u7B26\u4E32\u65E0\u6548\u6216\u975E\u6CD5\u3002
-VALIDATION_ERR = \u5C31\u6587\u6863\u8BED\u6CD5\u65B9\u9762\u800C\u8A00, \u8C03\u7528 insertBefore \u6216 removeChild \u7B49\u65B9\u6CD5\u5C06\u5BFC\u81F4 Node \u65E0\u6548\u3002
-WRONG_DOCUMENT_ERR = \u4F7F\u7528\u8282\u70B9\u7684\u6587\u6863\u4E0E\u521B\u5EFA\u8282\u70B9\u7684\u6587\u6863\u4E0D\u76F8\u540C\u3002
-TYPE_MISMATCH_ERR = \u6B64\u53C2\u6570\u540D\u79F0\u7684\u503C\u7C7B\u578B\u4E0E\u9884\u671F\u7684\u503C\u7C7B\u578B\u4E0D\u517C\u5BB9\u3002
-
-#error messages or exceptions
-FEATURE_NOT_SUPPORTED = \u5DF2\u8BC6\u522B\u53C2\u6570{0}, \u4F46\u65E0\u6CD5\u8BBE\u7F6E\u8BF7\u6C42\u7684\u503C\u3002
-FEATURE_NOT_FOUND = \u65E0\u6CD5\u8BC6\u522B\u53C2\u6570{0}\u3002
-STRING_TOO_LONG = \u751F\u6210\u7684\u5B57\u7B26\u4E32\u592A\u957F, \u4E0D\u9002\u5408 DOMString: ''{0}''\u3002
-
-#DOM Level 3 DOMError codes
-wf-invalid-character = {1}\u8282\u70B9\u7684\u6587\u672C{0}\u5305\u542B\u65E0\u6548 XML \u5B57\u7B26\u3002
-wf-invalid-character-in-node-name = \u540D\u4E3A{1}\u7684{0}\u8282\u70B9\u5305\u542B\u65E0\u6548 XML \u5B57\u7B26\u3002
-cdata-sections-splitted = \u5305\u542B CDATA \u8282\u7EC8\u6B62\u6807\u8BB0 '']]>'' \u7684 CDATA \u8282
-doctype-not-allowed = \u4E0D\u5141\u8BB8 DOCTYPE \u58F0\u660E\u3002
-unsupported-encoding = \u4E0D\u652F\u6301\u7F16\u7801{0}\u3002
-
-#Error codes used in DOM Normalizer
-InvalidXMLCharInDOM = \u8FDB\u884C\u89C4\u8303\u5316\u65F6, \u5728 DOM \u4E2D\u627E\u5230\u7684 XML \u5B57\u7B26 (Unicode: 0x{0}) \u65E0\u6548\u3002
-UndeclaredEntRefInAttrValue = \u5C5E\u6027 "{0}" \u503C "{1}" \u5F15\u7528\u4E86\u672A\u58F0\u660E\u7684\u5B9E\u4F53\u3002
-NullLocalElementName = \u5BF9\u5143\u7D20{0}\u8FDB\u884C\u540D\u79F0\u7A7A\u95F4\u89C4\u8303\u5316\u65F6\u9047\u5230\u4E86\u7A7A\u672C\u5730\u540D\u79F0\u3002
-NullLocalAttrName = \u5BF9\u5C5E\u6027{0}\u8FDB\u884C\u540D\u79F0\u7A7A\u95F4\u89C4\u8303\u5316\u65F6\u9047\u5230\u4E86\u7A7A\u672C\u5730\u540D\u79F0\u3002
-
-#Error codes used in DOMParser
-InvalidDocumentClassName = \u7528\u4E8E\u6784\u9020 DOM \u6811\u7684\u6587\u6863\u5DE5\u5382 "{0}" \u7684\u7C7B\u540D\u4E0D\u662F org.w3c.dom.Document \u7C7B\u578B\u3002
-MissingDocumentClassName = \u627E\u4E0D\u5230\u7528\u4E8E\u6784\u9020 DOM \u6811\u7684\u6587\u6863\u5DE5\u5382 "{0}" \u7684\u7C7B\u540D\u3002
-CannotCreateDocumentClass = \u540D\u4E3A "{0}" \u7684\u7C7B\u65E0\u6CD5\u6784\u9020\u4E3A org.w3c.dom.Document\u3002
-
-# Error codes used by JAXP DocumentBuilder
-jaxp-order-not-supported = \u5FC5\u987B\u5728\u8BBE\u7F6E\u5C5E\u6027 ''{1}'' \u4E4B\u524D\u8BBE\u7F6E\u5C5E\u6027 ''{0}''\u3002
-jaxp-null-input-source = \u6307\u5B9A\u7684\u6E90\u4E0D\u80FD\u4E3A\u7A7A\u503C\u3002
-
-#Ranges
-BAD_BOUNDARYPOINTS_ERR = Range \u7684\u8FB9\u754C\u70B9\u4E0D\u7B26\u5408\u7279\u5B9A\u8981\u6C42\u3002
-INVALID_NODE_TYPE_ERR = Range \u7684\u8FB9\u754C\u70B9\u7684\u5BB9\u5668\u8BBE\u7F6E\u4E3A\u65E0\u6548\u7C7B\u578B\u7684\u8282\u70B9\u6216\u5177\u6709\u65E0\u6548\u7C7B\u578B\u7684\u539F\u7EA7\u7684\u8282\u70B9\u3002
-
-
-#Events
-UNSPECIFIED_EVENT_TYPE_ERR = Event \u7C7B\u578B\u4E0D\u662F\u901A\u8FC7\u5728\u8C03\u7528\u65B9\u6CD5\u524D\u521D\u59CB\u5316\u6B64\u4E8B\u4EF6\u6307\u5B9A\u7684\u3002
-
-
-jaxp-schema-support=\u540C\u65F6\u4F7F\u7528\u4E86 setSchema \u65B9\u6CD5\u548C schemaLanguage \u5C5E\u6027
-
-jaxp_feature_not_supported=\u4E0D\u652F\u6301\u529F\u80FD "{0}"\u3002
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_zh_TW.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_zh_TW.properties
deleted file mode 100644
index cae43a5..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_zh_TW.properties
+++ /dev/null
@@ -1,69 +0,0 @@
-# This file stores localized messages for the Xerces
-# DOM implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-BadMessageKey = \u627E\u4E0D\u5230\u5C0D\u61C9\u8A0A\u606F\u7D22\u5F15\u9375\u7684\u932F\u8AA4\u8A0A\u606F\u3002
-FormatFailed = \u683C\u5F0F\u5316\u4E0B\u5217\u8A0A\u606F\u6642\u767C\u751F\u5167\u90E8\u932F\u8AA4:\n
-
-# DOM Core
-
-# exception codes
-DOMSTRING_SIZE_ERR = \u6307\u5B9A\u7684\u6587\u5B57\u7BC4\u570D\u7121\u6CD5\u7D0D\u5165 DOMString\u3002
-HIERARCHY_REQUEST_ERR = \u5617\u8A66\u5728\u4E0D\u5141\u8A31\u7684\u4F4D\u7F6E\u63D2\u5165\u7BC0\u9EDE\u3002
-INDEX_SIZE_ERR = \u7D22\u5F15\u6216\u5927\u5C0F\u70BA\u8CA0\u503C\uFF0C\u6216\u662F\u5927\u65BC\u5141\u8A31\u7684\u503C\u3002
-INUSE_ATTRIBUTE_ERR = \u5617\u8A66\u65B0\u589E\u5DF2\u7D93\u5728\u4ED6\u8655\u4F7F\u7528\u7684\u5C6C\u6027\u3002
-INVALID_ACCESS_ERR = \u5E95\u5C64\u7269\u4EF6\u4E0D\u652F\u63F4\u7684\u53C3\u6578\u6216\u4F5C\u696D\u3002
-INVALID_CHARACTER_ERR = \u6307\u5B9A\u4E86\u7121\u6548\u7684 XML \u5B57\u5143\u3002
-INVALID_MODIFICATION_ERR = \u5617\u8A66\u4FEE\u6539\u5E95\u5C64\u7269\u4EF6\u7684\u985E\u578B\u3002
-INVALID_STATE_ERR = \u5617\u8A66\u4F7F\u7528\u4E0D\u53EF\u7528\u6216\u7121\u6CD5\u518D\u4F7F\u7528\u7684\u7269\u4EF6\u3002
-NAMESPACE_ERR = \u5C0D\u65BC\u547D\u540D\u7A7A\u9593\u800C\u8A00\uFF0C\u5617\u8A66\u4F7F\u7528\u4E0D\u6B63\u78BA\u7684\u65B9\u5F0F\u4F86\u5EFA\u7ACB\u6216\u8B8A\u66F4\u7269\u4EF6\u3002
-NOT_FOUND_ERR = \u5617\u8A66\u5728\u76F8\u95DC\u8CC7\u8A0A\u74B0\u5883\u4E2D\u53C3\u7167\u4E0D\u5B58\u5728\u7684\u7BC0\u9EDE\u3002
-NOT_SUPPORTED_ERR = \u5BE6\u884C\u4E0D\u652F\u63F4\u8981\u6C42\u7684\u7269\u4EF6\u6216\u4F5C\u696D\u985E\u578B\u3002
-NO_DATA_ALLOWED_ERR = \u70BA\u4E0D\u652F\u63F4\u8CC7\u6599\u7684\u7BC0\u9EDE\u6307\u5B9A\u4E86\u8CC7\u6599\u3002
-NO_MODIFICATION_ALLOWED_ERR = \u5617\u8A66\u4FEE\u6539\u4E0D\u5141\u8A31\u4FEE\u6539\u7684\u7269\u4EF6\u3002
-SYNTAX_ERR = \u6307\u5B9A\u4E86\u7121\u6548\u7684\u5B57\u4E32\u3002
-VALIDATION_ERR = \u5C0D\u65BC\u6587\u4EF6\u6587\u6CD5\u800C\u8A00\uFF0C\u547C\u53EB insertBefore \u6216 removeChild \u4E4B\u985E\u7684\u65B9\u6CD5\uFF0C\u6703\u4F7F\u5F97\u7BC0\u9EDE\u7121\u6548\u3002
-WRONG_DOCUMENT_ERR = \u7BC0\u9EDE\u7528\u5728\u6709\u5225\u65BC\u5EFA\u7ACB\u8A72\u7BC0\u9EDE\u6587\u4EF6\u7684\u4E0D\u540C\u6587\u4EF6\u3002
-TYPE_MISMATCH_ERR = \u6B64\u53C3\u6578\u540D\u7A31\u7684\u503C\u985E\u578B\u8207\u9810\u671F\u7684\u503C\u985E\u578B\u4E0D\u76F8\u5BB9\u3002
-
-#error messages or exceptions
-FEATURE_NOT_SUPPORTED = \u53EF\u8FA8\u8B58\u53C3\u6578 {0}\uFF0C\u4F46\u7121\u6CD5\u8A2D\u5B9A\u8981\u6C42\u7684\u503C\u3002
-FEATURE_NOT_FOUND = \u7121\u6CD5\u8FA8\u8B58\u53C3\u6578 {0}\u3002
-STRING_TOO_LONG = \u7D50\u679C\u5B57\u4E32\u592A\u9577\uFF0C\u7121\u6CD5\u7D0D\u5165 DOMString: ''{0}''\u3002
-
-#DOM Level 3 DOMError codes
-wf-invalid-character = {1} \u7BC0\u9EDE\u7684\u6587\u5B57 {0} \u5305\u542B\u7121\u6548\u7684 XML \u5B57\u5143\u3002
-wf-invalid-character-in-node-name = \u540D\u7A31\u70BA {1} \u7684 {0} \u7BC0\u9EDE\u5305\u542B\u7121\u6548\u7684 XML \u5B57\u5143\u3002
-cdata-sections-splitted = \u5305\u542B CDATA \u6BB5\u843D\u7D42\u6B62\u6A19\u8A18 '']]>'' \u7684 CDATA \u6BB5\u843D
-doctype-not-allowed = \u4E0D\u5141\u8A31 DOCTYPE \u5BA3\u544A\u3002
-unsupported-encoding = \u4E0D\u652F\u63F4\u7DE8\u78BC {0}\u3002
-
-#Error codes used in DOM Normalizer
-InvalidXMLCharInDOM = \u6B63\u898F\u5316\u671F\u9593\u5728 DOM \u4E2D\u627E\u5230\u7121\u6548\u7684 XML \u5B57\u5143 (Unicode: 0x{0})\u3002
-UndeclaredEntRefInAttrValue = \u5C6C\u6027 "{0}" \u503C "{1}" \u53C3\u7167\u672A\u5BA3\u544A\u7684\u5BE6\u9AD4\u3002
-NullLocalElementName = \u5143\u7D20 {0} \u547D\u540D\u7A7A\u9593\u6B63\u898F\u5316\u671F\u9593\uFF0C\u51FA\u73FE\u7A7A\u503C\u5340\u57DF\u540D\u7A31\u3002
-NullLocalAttrName = \u5C6C\u6027 {0} \u547D\u540D\u7A7A\u9593\u6B63\u898F\u5316\u671F\u9593\uFF0C\u51FA\u73FE\u7A7A\u503C\u5340\u57DF\u540D\u7A31\u3002
-
-#Error codes used in DOMParser
-InvalidDocumentClassName = \u7528\u65BC\u5EFA\u69CB DOM \u6A39\u72C0\u7D50\u69CB\u7684\u6587\u4EF6\u8655\u7406\u7AD9 "{0}" \u985E\u5225\u540D\u7A31\u4E26\u975E\u985E\u578B org.w3c.dom.Document\u3002
-MissingDocumentClassName = \u627E\u4E0D\u5230\u7528\u65BC\u5EFA\u69CB DOM \u6A39\u72C0\u7D50\u69CB\u7684\u6587\u4EF6\u8655\u7406\u7AD9 "{0}" \u985E\u5225\u540D\u7A31\u3002
-CannotCreateDocumentClass = \u540D\u7A31\u70BA "{0}" \u7684\u985E\u5225\u7121\u6CD5\u5EFA\u69CB\u70BA org.w3c.dom.Document\u3002
-
-# Error codes used by JAXP DocumentBuilder
-jaxp-order-not-supported = \u8A2D\u5B9A\u5C6C\u6027 ''{1}'' \u4E4B\u524D\uFF0C\u5FC5\u9808\u8A2D\u5B9A\u5C6C\u6027 ''{0}''\u3002
-jaxp-null-input-source = \u6307\u5B9A\u7684\u4F86\u6E90\u4E0D\u53EF\u70BA\u7A7A\u503C\u3002
-
-#Ranges
-BAD_BOUNDARYPOINTS_ERR = \u7BC4\u570D\u7684\u754C\u9650\u9EDE\u4E0D\u7B26\u5408\u7279\u5B9A\u7684\u9700\u6C42\u3002
-INVALID_NODE_TYPE_ERR = \u7BC4\u570D\u7684\u754C\u9650\u9EDE\u5BB9\u5668\u88AB\u8A2D\u70BA\u7121\u6548\u985E\u578B\u7684\u7BC0\u9EDE\uFF0C\u6216\u662F\u7956\u7CFB\u70BA\u7121\u6548\u985E\u578B\u7684\u7BC0\u9EDE\u3002
-
-
-#Events
-UNSPECIFIED_EVENT_TYPE_ERR = \u547C\u53EB\u65B9\u6CD5\u4E4B\u524D\u8D77\u59CB\u4E8B\u4EF6\uFF0C\u4E0D\u6703\u6307\u5B9A\u4E8B\u4EF6\u7684\u985E\u578B\u3002
-
-
-jaxp-schema-support=\u540C\u6642\u4F7F\u7528 setSchema \u65B9\u6CD5\u8207 schemaLanguage \u5C6C\u6027
-
-jaxp_feature_not_supported=\u4E0D\u652F\u63F4\u529F\u80FD "{0}"\u3002
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages.properties
deleted file mode 100644
index da1eeec..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages.properties
+++ /dev/null
@@ -1,29 +0,0 @@
-# This file stores localized messages for the Xerces JAXP Datatype API implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-BadMessageKey = The error message corresponding to the message key can not be found.
-FormatFailed = An internal error occurred while formatting the following message:\n
-
-FieldCannotBeNull={0} cannot be called with 'null' parameter.
-UnknownField={0} called with an unknown field\:{1}
-#There are two similar keys 'InvalidXMLGreogorianCalendarValue' . Suffix (year, month) has been added and are used as per the context.
-InvalidXGCValue-milli=Year \= {0}, Month \= {1}, Day \= {2}, Hour \= {3}, Minute \= {4}, Second \= {5}, fractionalSecond \= {6}, Timezone \= {7} , is not a valid representation of an XML Gregorian Calendar value.
-#There are two similar keys 'InvalidXMLGreogorianCalendarValue' . Suffix (year, month) has been added and are used as per the context.
-InvalidXGCValue-fractional=Year \= {0}, Month \= {1}, Day \= {2}, Hour \= {3}, Minute \= {4}, Second \= {5}, fractionalSecond \= {6}, Timezone \= {7} , is not a valid representation of an XML Gregorian Calendar value.
-
-InvalidXGCFields=Invalid set of fields set for XMLGregorianCalendar
-
-InvalidFractional=Invalid value {0} for fractional second.
-
-#XGC stands for XML Gregorian Calendar
-InvalidXGCRepresentation="{0}" is not a valid representation of an XML Gregorian Calendar value.
-
-InvalidFieldValue=Invalid value {0} for {1} field.
-
-NegativeField= {0} field is negative
-
-AllFieldsNull=All the fields (javax.xml.datatype.DatatypeConstants.Field) are null.
-
-TooLarge={0} value "{1}" too large to be supported by this implementation
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_de.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_de.properties
deleted file mode 100644
index 1819cd2..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_de.properties
+++ /dev/null
@@ -1,29 +0,0 @@
-# This file stores localized messages for the Xerces JAXP Datatype API implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-BadMessageKey = Die zum Meldungsschl\u00FCssel geh\u00F6rige Fehlermeldung kann nicht gefunden werden.
-FormatFailed = Beim Formatieren der folgenden Meldung ist ein interner Fehler aufgetreten:\n
-
-FieldCannotBeNull={0} kann nicht mit "Null"-Parameter aufgerufen werden.
-UnknownField={0} mit unbekanntem Feld aufgerufen:{1}
-#There are two similar keys 'InvalidXMLGreogorianCalendarValue' . Suffix (year, month) has been added and are used as per the context.
-InvalidXGCValue-milli=Jahr = {0}, Monat = {1}, Tag = {2}, Stunde= {3}, Minute = {4}, Sekunde = {5}, fractionalSecond = {6}, Zeitzone = {7} ist keine g\u00FCltige Darstellung eines XML-Wertes f\u00FCr einen gregorianischen Kalender.
-#There are two similar keys 'InvalidXMLGreogorianCalendarValue' . Suffix (year, month) has been added and are used as per the context.
-InvalidXGCValue-fractional=Jahr = {0}, Monat = {1}, Tag = {2}, Stunde= {3}, Minute = {4}, Sekunde = {5}, fractionalSecond = {6}, Zeitzone = {7} ist keine g\u00FCltige Darstellung eines XML-Wertes f\u00FCr einen gregorianischen Kalender.
-
-InvalidXGCFields=Ung\u00FCltige Gruppe von Feldern f\u00FCr XMLGregorianCalendar festgelegt
-
-InvalidFractional=Ung\u00FCltiger Wert {0} f\u00FCr Sekundenbruchteil.
-
-#XGC stands for XML Gregorian Calendar
-InvalidXGCRepresentation="{0}" ist keine g\u00FCltige Darstellung eines XML-Wertes f\u00FCr einen gregorianischen Kalender.
-
-InvalidFieldValue=Ung\u00FCltiger Wert {0} f\u00FCr Feld {1}.
-
-NegativeField= Feld {0} ist negativ
-
-AllFieldsNull=Alle Felder (javax.xml.datatype.DatatypeConstants.Field) sind null.
-
-TooLarge={0}-Wert "{1}" zu gro\u00DF, um von dieser Implementierung unterst\u00FCtzt zu werden
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_es.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_es.properties
deleted file mode 100644
index a7a879e..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_es.properties
+++ /dev/null
@@ -1,29 +0,0 @@
-# This file stores localized messages for the Xerces JAXP Datatype API implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-BadMessageKey = No se ha encontrado el mensaje de error correspondiente a la clave de mensaje.
-FormatFailed = Se ha producido un error interno al formatear el siguiente mensaje:\n
-
-FieldCannotBeNull=no se puede llamar a {0} con un par\u00E1metro ''nulo''.
-UnknownField=se ha llamado a {0} con un campo desconocido:{1}
-#There are two similar keys 'InvalidXMLGreogorianCalendarValue' . Suffix (year, month) has been added and are used as per the context.
-InvalidXGCValue-milli=A\u00F1o = {0}, Mes = {1}, D\u00EDa = {2}, Hora = {3}, Minuto = {4}, Segundo = {5}, Segundo Fraccionario = {6}, Zona Horaria = {7} , no es una representaci\u00F3n v\u00E1lida de un valor del calendario gregoriano XML.
-#There are two similar keys 'InvalidXMLGreogorianCalendarValue' . Suffix (year, month) has been added and are used as per the context.
-InvalidXGCValue-fractional=A\u00F1o = {0}, Mes = {1}, D\u00EDa = {2}, Hora = {3}, Minuto = {4}, Segundo = {5}, Segundo Fraccionario = {6}, Zona Horaria = {7} , no es una representaci\u00F3n v\u00E1lida de un valor del calendario gregoriano XML.
-
-InvalidXGCFields=Juego de campos no v\u00E1lido definido para el calendario gregoriano XML
-
-InvalidFractional=Valor no v\u00E1lido {0} para el segundo fraccionario.
-
-#XGC stands for XML Gregorian Calendar
-InvalidXGCRepresentation="{0}" no es una representaci\u00F3n v\u00E1lida de un valor del calendario gregoriano XML.
-
-InvalidFieldValue=Valor no v\u00E1lido {0} para el campo {1}.
-
-NegativeField= El campo {0} es negativo
-
-AllFieldsNull=Todos los campos (javax.xml.datatype.DatatypeConstants.Field) son nulos.
-
-TooLarge=El valor "{1}" de {0} es demasiado largo para que esta implantaci\u00F3n pueda soportarlo
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_fr.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_fr.properties
deleted file mode 100644
index 271ffe7..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_fr.properties
+++ /dev/null
@@ -1,29 +0,0 @@
-# This file stores localized messages for the Xerces JAXP Datatype API implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-BadMessageKey = Le message d'erreur correspondant \u00E0 la cl\u00E9 de message est introuvable.
-FormatFailed = Une erreur interne est survenue lors du formatage du message suivant :\n
-
-FieldCannotBeNull=Impossible d''appeler {0} avec le param\u00E8tre ''null''.
-UnknownField={0} a \u00E9t\u00E9 appel\u00E9 avec un champ inconnu : {1}
-#There are two similar keys 'InvalidXMLGreogorianCalendarValue' . Suffix (year, month) has been added and are used as per the context.
-InvalidXGCValue-milli=Ann\u00E9e = {0}, Mois = {1}, Jour = {2}, Heure = {3}, Minute = {4}, Seconde = {5}, Fraction de seconde = {6}, Fuseau horaire = {7} ne repr\u00E9sentent pas des valeurs de calendrier gr\u00E9gorien XML valides.
-#There are two similar keys 'InvalidXMLGreogorianCalendarValue' . Suffix (year, month) has been added and are used as per the context.
-InvalidXGCValue-fractional=Ann\u00E9e = {0}, Mois = {1}, Jour = {2}, Heure = {3}, Minute = {4}, Seconde = {5}, Fraction de seconde = {6}, Fuseau horaire = {7} ne repr\u00E9sentent pas des valeurs de calendrier gr\u00E9gorien XML valides.
-
-InvalidXGCFields=Ensemble de champs non valide pour XMLGregorianCalendar
-
-InvalidFractional=Valeur non valide {0} pour la fraction de seconde.
-
-#XGC stands for XML Gregorian Calendar
-InvalidXGCRepresentation="{0}" ne repr\u00E9sente pas une valeur de calendrier gr\u00E9gorien XML valide.
-
-InvalidFieldValue=Valeur {0} non valide pour le champ {1}.
-
-NegativeField= Le champ {0} est n\u00E9gatif
-
-AllFieldsNull=Tous les champs (javax.xml.datatype.DatatypeConstants.Field) sont NULL.
-
-TooLarge=La valeur {0} "{1}" est trop \u00E9lev\u00E9e pour \u00EAtre prise en charge par cette impl\u00E9mentation
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_it.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_it.properties
deleted file mode 100644
index 67aa9c3..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_it.properties
+++ /dev/null
@@ -1,29 +0,0 @@
-# This file stores localized messages for the Xerces JAXP Datatype API implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-BadMessageKey = Impossibile trovare il messaggio di errore corrispondente alla chiave di messaggio.
-FormatFailed = Si \u00E8 verificato un errore interno durante la formattazione del seguente messaggio:\n
-
-FieldCannotBeNull=Impossibile richiamare {0} con un parametro ''null''.
-UnknownField={0} richiamato con un campo sconosciuto:{1}
-#There are two similar keys 'InvalidXMLGreogorianCalendarValue' . Suffix (year, month) has been added and are used as per the context.
-InvalidXGCValue-milli=Anno = {0}, mese = {1}, giorno = {2}, ora = {3}, minuto = {4}, secondo = {5}, frazione di secondo = {6}, fuso orario = {7} non \u00E8 una rappresentazione valida di un valore di calendario gregoriano XML.
-#There are two similar keys 'InvalidXMLGreogorianCalendarValue' . Suffix (year, month) has been added and are used as per the context.
-InvalidXGCValue-fractional=Anno = {0}, mese = {1}, giorno = {2}, ora = {3}, minuto = {4}, secondo = {5}, frazione di secondo = {6}, fuso orario = {7} non \u00E8 una rappresentazione valida di un valore di calendario gregoriano XML.
-
-InvalidXGCFields=Impostato set di campi non valido per XMLGregorianCalendar
-
-InvalidFractional=Valore {0} non valido per la frazione di secondo.
-
-#XGC stands for XML Gregorian Calendar
-InvalidXGCRepresentation="{0}" non \u00E8 una rappresentazione valida di un valore di calendario gregoriano XML.
-
-InvalidFieldValue=Valore {0} non valido per il campo {1}.
-
-NegativeField= Il campo {0} \u00E8 negativo
-
-AllFieldsNull=Tutti i campi (javax.xml.datatype.DatatypeConstants.Field) sono nulli.
-
-TooLarge=Il valore {0} "{1}" \u00E8 troppo grande per essere supportato da questa implementazione
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_ja.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_ja.properties
deleted file mode 100644
index 89e0c02..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_ja.properties
+++ /dev/null
@@ -1,29 +0,0 @@
-# This file stores localized messages for the Xerces JAXP Datatype API implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-BadMessageKey = \u30E1\u30C3\u30BB\u30FC\u30B8\u30FB\u30AD\u30FC\u306B\u5BFE\u5FDC\u3059\u308B\u30A8\u30E9\u30FC\u30FB\u30E1\u30C3\u30BB\u30FC\u30B8\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002
-FormatFailed = \u6B21\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\u306E\u66F8\u5F0F\u8A2D\u5B9A\u4E2D\u306B\u5185\u90E8\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F:\n
-
-FieldCannotBeNull={0}\u306F''null''\u30D1\u30E9\u30E1\u30FC\u30BF\u3067\u306F\u547C\u3073\u51FA\u305B\u307E\u305B\u3093\u3002
-UnknownField={0}\u306F\u4E0D\u660E\u306A\u30D5\u30A3\u30FC\u30EB\u30C9\u3067\u547C\u3073\u51FA\u3055\u308C\u307E\u3057\u305F: {1}
-#There are two similar keys 'InvalidXMLGreogorianCalendarValue' . Suffix (year, month) has been added and are used as per the context.
-InvalidXGCValue-milli=\u5E74={0}\u3001\u6708={1}\u3001\u65E5={2}\u3001\u6642={3}\u3001\u5206={4}\u3001\u79D2={5}\u3001\u5C0F\u6570\u79D2={6}\u3001\u30BF\u30A4\u30E0\u30BE\u30FC\u30F3={7}\u306F\u3001XML\u30B0\u30EC\u30B4\u30EA\u30AA\u66A6\u306E\u5024\u306E\u6709\u52B9\u306A\u8868\u73FE\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
-#There are two similar keys 'InvalidXMLGreogorianCalendarValue' . Suffix (year, month) has been added and are used as per the context.
-InvalidXGCValue-fractional=\u5E74={0}\u3001\u6708={1}\u3001\u65E5={2}\u3001\u6642={3}\u3001\u5206={4}\u3001\u79D2={5}\u3001\u5C0F\u6570\u79D2={6}\u3001\u30BF\u30A4\u30E0\u30BE\u30FC\u30F3={7}\u306F\u3001XML\u30B0\u30EC\u30B4\u30EA\u30AA\u66A6\u306E\u5024\u306E\u6709\u52B9\u306A\u8868\u73FE\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
-
-InvalidXGCFields=XMLGregorianCalendar\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u30FB\u30BB\u30C3\u30C8\u304C\u7121\u52B9\u3067\u3059
-
-InvalidFractional=\u5C0F\u6570\u79D2\u306E\u5024{0}\u304C\u7121\u52B9\u3067\u3059\u3002
-
-#XGC stands for XML Gregorian Calendar
-InvalidXGCRepresentation="{0}"\u306F\u3001XML\u30B0\u30EC\u30B4\u30EA\u30AA\u66A6\u306E\u5024\u306E\u6709\u52B9\u306A\u8868\u73FE\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
-
-InvalidFieldValue={1}\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u5024{0}\u304C\u7121\u52B9\u3067\u3059\u3002
-
-NegativeField= {0}\u30D5\u30A3\u30FC\u30EB\u30C9\u304C\u8CA0\u3067\u3059
-
-AllFieldsNull=\u3059\u3079\u3066\u306E\u30D5\u30A3\u30FC\u30EB\u30C9(javax.xml.datatype.DatatypeConstants.Field)\u304Cnull\u3067\u3059\u3002
-
-TooLarge={0}\u306E\u5024"{1}"\u304C\u5927\u304D\u3059\u304E\u308B\u305F\u3081\u3001\u3053\u306E\u5B9F\u88C5\u3067\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u307E\u305B\u3093
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_ko.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_ko.properties
deleted file mode 100644
index 7dfc1a0..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_ko.properties
+++ /dev/null
@@ -1,29 +0,0 @@
-# This file stores localized messages for the Xerces JAXP Datatype API implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-BadMessageKey = \uBA54\uC2DC\uC9C0 \uD0A4\uC5D0 \uD574\uB2F9\uD558\uB294 \uC624\uB958 \uBA54\uC2DC\uC9C0\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
-FormatFailed = \uB2E4\uC74C \uBA54\uC2DC\uC9C0\uC758 \uD615\uC2DD\uC744 \uC9C0\uC815\uD558\uB294 \uC911 \uB0B4\uBD80 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4.\n
-
-FieldCannotBeNull={0}\uC740(\uB294) ''null'' \uB9E4\uAC1C\uBCC0\uC218\uB85C \uD638\uCD9C\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
-UnknownField={0}\uC774(\uAC00) \uC54C \uC218 \uC5C6\uB294 \uD544\uB4DC\uB85C \uD638\uCD9C\uB428:{1}
-#There are two similar keys 'InvalidXMLGreogorianCalendarValue' . Suffix (year, month) has been added and are used as per the context.
-InvalidXGCValue-milli=\uC5F0\uB3C4 = {0}, \uC6D4 = {1}, \uB0A0\uC9DC = {2}, \uC2DC\uAC04 = {3}, \uBD84 = {4}, \uCD08 = {5}, \uC18C\uC218\uC810 \uC774\uD558 \uCD08 = {6}, \uC2DC\uAC04\uB300 = {7}\uC740(\uB294) XML \uC591\uB825 \uAC12\uC5D0 \uBD80\uC801\uD569\uD55C \uD615\uC2DD\uC785\uB2C8\uB2E4.
-#There are two similar keys 'InvalidXMLGreogorianCalendarValue' . Suffix (year, month) has been added and are used as per the context.
-InvalidXGCValue-fractional=\uC5F0\uB3C4 = {0}, \uC6D4 = {1}, \uB0A0\uC9DC = {2}, \uC2DC\uAC04 = {3}, \uBD84 = {4}, \uCD08 = {5}, \uC18C\uC218\uC810 \uC774\uD558 \uCD08 = {6}, \uC2DC\uAC04\uB300 = {7}\uC740(\uB294) XML \uC591\uB825 \uAC12\uC5D0 \uBD80\uC801\uD569\uD55C \uD615\uC2DD\uC785\uB2C8\uB2E4.
-
-InvalidXGCFields=XMLGregorianCalendar\uC5D0 \uB300\uD574 \uBD80\uC801\uD569\uD55C \uD544\uB4DC \uC9D1\uD569\uC774 \uC124\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
-
-InvalidFractional={0}\uC740(\uB294) \uC18C\uC218\uC810 \uC774\uD558 \uCD08\uC5D0 \uB300\uD574 \uBD80\uC801\uD569\uD55C \uAC12\uC785\uB2C8\uB2E4.
-
-#XGC stands for XML Gregorian Calendar
-InvalidXGCRepresentation="{0}"\uC740(\uB294) XML \uC591\uB825 \uAC12\uC5D0 \uBD80\uC801\uD569\uD55C \uD615\uC2DD\uC785\uB2C8\uB2E4.
-
-InvalidFieldValue={0}\uC740(\uB294) {1} \uD544\uB4DC\uC5D0 \uB300\uD574 \uBD80\uC801\uD569\uD55C \uAC12\uC785\uB2C8\uB2E4.
-
-NegativeField= {0} \uD544\uB4DC\uAC00 \uC74C\uC218\uC785\uB2C8\uB2E4.
-
-AllFieldsNull=\uBAA8\uB4E0 \uD544\uB4DC(javax.xml.datatype.DatatypeConstants.Field)\uAC00 \uB110\uC785\uB2C8\uB2E4.
-
-TooLarge={0} \uAC12 "{1}"\uC774(\uAC00) \uC774 \uAD6C\uD604\uC5D0\uC11C \uC9C0\uC6D0\uB418\uB294 \uAC12\uC5D0 \uBE44\uD574 \uB108\uBB34 \uD07D\uB2C8\uB2E4.
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_pt_BR.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_pt_BR.properties
deleted file mode 100644
index ad8d3b7..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_pt_BR.properties
+++ /dev/null
@@ -1,29 +0,0 @@
-# This file stores localized messages for the Xerces JAXP Datatype API implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-BadMessageKey = N\u00E3o foi poss\u00EDvel encontrar a mensagem de erro correspondente \u00E0 chave da mensagem.
-FormatFailed = Ocorreu um erro interno ao formatar a mensagem a seguir:\n
-
-FieldCannotBeNull={0} n\u00E3o pode ser chamado com o par\u00E2metro ''null''.
-UnknownField={0} chamado com um campo desconhecido:{1}
-#There are two similar keys 'InvalidXMLGreogorianCalendarValue' . Suffix (year, month) has been added and are used as per the context.
-InvalidXGCValue-milli=Ano = {0}, M\u00EAs = {1}, Dia = {2}, Hora = {3}, Minuto = {4}, Segundo = {5}, fractionalSecond = {6}, Fuso hor\u00E1rio = {7} , n\u00E3o \u00E9 uma representa\u00E7\u00E3o v\u00E1lida de um valor do Calend\u00E1rio Gregoriano XML.
-#There are two similar keys 'InvalidXMLGreogorianCalendarValue' . Suffix (year, month) has been added and are used as per the context.
-InvalidXGCValue-fractional=Ano = {0}, M\u00EAs = {1}, Dia = {2}, Hora = {3}, Minuto = {4}, Segundo = {5}, fractionalSecond = {6}, Fuso hor\u00E1rio = {7} , n\u00E3o \u00E9 uma representa\u00E7\u00E3o v\u00E1lida de um valor do Calend\u00E1rio Gregoriano XML.
-
-InvalidXGCFields=Conjunto inv\u00E1lido de conjunto de campos para XMLGregorianCalendar
-
-InvalidFractional=Valor inv\u00E1lido {0} para segundo fracional.
-
-#XGC stands for XML Gregorian Calendar
-InvalidXGCRepresentation="{0}" n\u00E3o \u00E9 uma representa\u00E7\u00E3o v\u00E1lida de um valor do Calend\u00E1rio Gregoriano XML.
-
-InvalidFieldValue=Valor inv\u00E1lido {0} para o campo {1}.
-
-NegativeField= o campo {0} \u00E9 negativo
-
-AllFieldsNull=Todos os campos (javax.xml.datatype.DatatypeConstants.Field) s\u00E3o nulos.
-
-TooLarge=valor {0} "{1}" muito grande para ser suportado por esta implementa\u00E7\u00E3o
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_sv.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_sv.properties
deleted file mode 100644
index dc7a156..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_sv.properties
+++ /dev/null
@@ -1,29 +0,0 @@
-# This file stores localized messages for the Xerces JAXP Datatype API implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-BadMessageKey = Hittar inte felmeddelandet som motsvarar meddelandenyckeln.
-FormatFailed = Ett internt fel intr\u00E4ffade vid formatering av f\u00F6ljande meddelande:\n
-
-FieldCannotBeNull={0} kan inte anropas med null-parameter.
-UnknownField={0} anropades med ok\u00E4nt f\u00E4lt:{1}
-#There are two similar keys 'InvalidXMLGreogorianCalendarValue' . Suffix (year, month) has been added and are used as per the context.
-InvalidXGCValue-milli=\u00C5r = {0}, m\u00E5nad = {1}, dag = {2}, timme = {3}, minut = {4}, sekund = {5}, br\u00E5kdelssekund = {6}, tidszon = {7} \u00E4r ogiltigt v\u00E4rde f\u00F6r gregoriansk kalender i XML.
-#There are two similar keys 'InvalidXMLGreogorianCalendarValue' . Suffix (year, month) has been added and are used as per the context.
-InvalidXGCValue-fractional=\u00C5r = {0}, m\u00E5nad = {1}, dag = {2}, timme = {3}, minut = {4}, sekund = {5}, br\u00E5kdelssekund = {6}, tidszon = {7} \u00E4r ogiltigt v\u00E4rde f\u00F6r gregoriansk kalender i XML.
-
-InvalidXGCFields=Ogiltig upps\u00E4ttning med f\u00E4lt angivet i XMLGregorianCalendar
-
-InvalidFractional=Ogiltigt v\u00E4rde {0} angivet f\u00F6r br\u00E5kdelssekund.
-
-#XGC stands for XML Gregorian Calendar
-InvalidXGCRepresentation="{0}" \u00E4r ogiltigt v\u00E4rde f\u00F6r gregoriansk kalender i XML.
-
-InvalidFieldValue={0} \u00E4r ett ogiltigt v\u00E4rde i f\u00E4ltet {1}.
-
-NegativeField= F\u00E4ltet {0} \u00E4r negativt
-
-AllFieldsNull=Alla f\u00E4lt (javax.xml.datatype.DatatypeConstants.Field) \u00E4r null.
-
-TooLarge={0}-v\u00E4rdet "{1}" \u00E4r f\u00F6r stort och kan inte anv\u00E4ndas i denna implementering
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_zh_CN.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_zh_CN.properties
deleted file mode 100644
index e5c8c0b..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_zh_CN.properties
+++ /dev/null
@@ -1,29 +0,0 @@
-# This file stores localized messages for the Xerces JAXP Datatype API implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-BadMessageKey = \u627E\u4E0D\u5230\u4E0E\u6D88\u606F\u5173\u952E\u5B57\u5BF9\u5E94\u7684\u9519\u8BEF\u6D88\u606F\u3002
-FormatFailed = \u8BBE\u7F6E\u4EE5\u4E0B\u6D88\u606F\u7684\u683C\u5F0F\u65F6\u51FA\u73B0\u5185\u90E8\u9519\u8BEF:\n
-
-FieldCannotBeNull=\u65E0\u6CD5\u4F7F\u7528 ''null'' \u53C2\u6570\u8C03\u7528{0}\u3002
-UnknownField=\u4F7F\u7528\u672A\u77E5\u5B57\u6BB5\u8C03\u7528\u4E86{0}: {1}
-#There are two similar keys 'InvalidXMLGreogorianCalendarValue' . Suffix (year, month) has been added and are used as per the context.
-InvalidXGCValue-milli=\u5E74 = {0}, \u6708 = {1}, \u65E5 = {2}, \u5C0F\u65F6 = {3}, \u5206 = {4}, \u79D2 = {5}, \u5C0F\u6570\u79D2 = {6}, \u65F6\u533A = {7} \u4E0D\u662F XML \u683C\u91CC\u5386\u503C\u7684\u6709\u6548\u8868\u793A\u3002
-#There are two similar keys 'InvalidXMLGreogorianCalendarValue' . Suffix (year, month) has been added and are used as per the context.
-InvalidXGCValue-fractional=\u5E74 = {0}, \u6708 = {1}, \u65E5 = {2}, \u5C0F\u65F6 = {3}, \u5206 = {4}, \u79D2 = {5}, \u5C0F\u6570\u79D2 = {6}, \u65F6\u533A = {7} \u4E0D\u662F XML \u683C\u91CC\u5386\u503C\u7684\u6709\u6548\u8868\u793A\u3002
-
-InvalidXGCFields=\u4E3A XMLGregorianCalendar \u8BBE\u7F6E\u7684\u5B57\u6BB5\u96C6\u65E0\u6548
-
-InvalidFractional=\u5C0F\u6570\u79D2\u7684\u503C {0} \u65E0\u6548\u3002
-
-#XGC stands for XML Gregorian Calendar
-InvalidXGCRepresentation="{0}" \u4E0D\u662F XML \u683C\u91CC\u5386\u503C\u7684\u6709\u6548\u8868\u793A\u3002
-
-InvalidFieldValue={1}\u5B57\u6BB5\u7684\u503C{0}\u65E0\u6548\u3002
-
-NegativeField= {0}\u5B57\u6BB5\u4E3A\u8D1F\u503C
-
-AllFieldsNull=\u6240\u6709\u5B57\u6BB5 (javax.xml.datatype.DatatypeConstants.Field) \u5747\u4E3A\u7A7A\u503C\u3002
-
-TooLarge={0}\u503C "{1}" \u592A\u5927, \u65E0\u6CD5\u7531\u6B64\u5B9E\u73B0\u652F\u6301
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_zh_TW.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_zh_TW.properties
deleted file mode 100644
index 2cb7ffe..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_zh_TW.properties
+++ /dev/null
@@ -1,29 +0,0 @@
-# This file stores localized messages for the Xerces JAXP Datatype API implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-BadMessageKey = \u627E\u4E0D\u5230\u5C0D\u61C9\u8A0A\u606F\u7D22\u5F15\u9375\u7684\u932F\u8AA4\u8A0A\u606F\u3002
-FormatFailed = \u683C\u5F0F\u5316\u4E0B\u5217\u8A0A\u606F\u6642\u767C\u751F\u5167\u90E8\u932F\u8AA4:\n
-
-FieldCannotBeNull=\u7121\u6CD5\u4F7F\u7528 ''null'' \u53C3\u6578\u547C\u53EB {0}
-UnknownField=\u4F7F\u7528\u4E0D\u660E\u7684\u6B04\u4F4D\u547C\u53EB {0}:{1}
-#There are two similar keys 'InvalidXMLGreogorianCalendarValue' . Suffix (year, month) has been added and are used as per the context.
-InvalidXGCValue-milli=\u5E74 = {0}\u3001\u6708 = {1}\u3001\u65E5 = {2}\u3001\u5C0F\u6642 = {3}\u3001\u5206\u9418 = {4}\u3001\u79D2 = {5}\u3001\u5C0F\u6578\u79D2 = {6}\u3001\u6642\u5340 = {7}\uFF0C\u4E0D\u662F XML \u516C\u66C6\u503C\u7684\u6709\u6548\u8868\u793A\u6CD5\u3002
-#There are two similar keys 'InvalidXMLGreogorianCalendarValue' . Suffix (year, month) has been added and are used as per the context.
-InvalidXGCValue-fractional=\u5E74 = {0}\u3001\u6708 = {1}\u3001\u65E5 = {2}\u3001\u5C0F\u6642 = {3}\u3001\u5206\u9418 = {4}\u3001\u79D2 = {5}\u3001\u5C0F\u6578\u79D2 = {6}\u3001\u6642\u5340 = {7}\uFF0C\u4E0D\u662F XML \u516C\u66C6\u503C\u7684\u6709\u6548\u8868\u793A\u6CD5\u3002
-
-InvalidXGCFields=XMLGregorianCalendar \u8A2D\u5B9A\u4E86\u7121\u6548\u7684\u6B04\u4F4D\u96C6
-
-InvalidFractional=\u5C0F\u6578\u79D2\u7684\u503C {0} \u7121\u6548\u3002
-
-#XGC stands for XML Gregorian Calendar
-InvalidXGCRepresentation="{0}" \u4E0D\u662F XML \u516C\u66C6\u503C\u7684\u6709\u6548\u8868\u793A\u6CD5\u3002
-
-InvalidFieldValue={1} \u6B04\u4F4D\u7684\u503C {0} \u7121\u6548\u3002
-
-NegativeField= {0} \u6B04\u4F4D\u70BA\u8CA0\u503C
-
-AllFieldsNull=\u6240\u6709\u6B04\u4F4D (javax.xml.datatype.DatatypeConstants.Field) \u7686\u70BA\u7A7A\u503C\u3002
-
-TooLarge={0} \u503C "{1}" \u592A\u5927\uFF0C\u6B64\u5BE6\u884C\u4E0D\u652F\u63F4
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages.properties
deleted file mode 100644
index 812d10b..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages.properties
+++ /dev/null
@@ -1,29 +0,0 @@
-# This file stores localized messages for the Xerces JAXP Validation API implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-# Messages for message reporting
-BadMessageKey = The error message corresponding to the message key can not be found.
-FormatFailed = An internal error occurred while formatting the following message:\n
-
-# SchemaFactory error messages
-SchemaLanguageNull = The schema language specified cannot be null.
-SchemaLanguageLengthZero = The schema language specified cannot have a length of zero characters.
-SchemaSourceArrayNull = The Source array parameter cannot be null.
-SchemaSourceArrayMemberNull = The Source array parameter cannot contain any items that are null.
-SchemaFactorySourceUnrecognized = Source parameter of type ''{0}'' is not recognized this SchemaFactory.
-
-# Validator error messages
-SourceParameterNull = Source parameter cannot be null.
-SourceNotAccepted = Source parameter of type ''{0}'' is not accepted by this validator.
-SourceResultMismatch = Source parameter of type ''{0}'' is not compatible with result parameter of type ''{1}''.
-
-# TypeInfoProvider error messages
-TypeInfoProviderIllegalState = A TypeInfoProvider cannot be queried outside of a startElement callback.
-
-# General error messages
-FeatureNameNull = The feature name cannot be null.
-ProperyNameNull = The property name cannot be null.
-SAXSourceNullInputSource = The SAXSource specified contains no InputSource.
-
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_de.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_de.properties
deleted file mode 100644
index cc22748..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_de.properties
+++ /dev/null
@@ -1,29 +0,0 @@
-# This file stores localized messages for the Xerces JAXP Validation API implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-# Messages for message reporting
-BadMessageKey = Die zum Meldungsschl\u00FCssel geh\u00F6rige Fehlermeldung kann nicht gefunden werden.
-FormatFailed = Beim Formatieren der folgenden Meldung ist ein interner Fehler aufgetreten:\n
-
-# SchemaFactory error messages
-SchemaLanguageNull = Angegebene Schemasprache darf nicht null sein.
-SchemaLanguageLengthZero = Angegebene Schemasprache darf nicht null Zeichen lang sein.
-SchemaSourceArrayNull = Quellarrayparameter darf nicht null sein.
-SchemaSourceArrayMemberNull = Quellarrayparameter darf keine Nullelemente enthalten.
-SchemaFactorySourceUnrecognized = Quellparameter des Typs "{0}" ist in dieser SchemaFactory unbekannt.
-
-# Validator error messages
-SourceParameterNull = Quellparameter darf nicht null sein.
-SourceNotAccepted = Quellparameter des Typs "{0}" wird von diesem Validator nicht akzeptiert.
-SourceResultMismatch = Quellparameter des Typs "{0}" ist nicht mit dem Ergebnisparameter des Typs "{1}" kompatibel.
-
-# TypeInfoProvider error messages
-TypeInfoProviderIllegalState = TypeInfoProvider kann nicht au\u00DFerhalb eines startElement-R\u00FCckrufs abgefragt werden.
-
-# General error messages
-FeatureNameNull = Featurename darf nicht null sein.
-ProperyNameNull = Eigenschaftsname darf nicht null sein.
-SAXSourceNullInputSource = Angegebene SAXSource enth\u00E4lt keine InputSource.
-
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_es.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_es.properties
deleted file mode 100644
index 3798a22..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_es.properties
+++ /dev/null
@@ -1,29 +0,0 @@
-# This file stores localized messages for the Xerces JAXP Validation API implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-# Messages for message reporting
-BadMessageKey = No se ha encontrado el mensaje de error correspondiente a la clave de mensaje.
-FormatFailed = Se ha producido un error interno al formatear el siguiente mensaje:\n
-
-# SchemaFactory error messages
-SchemaLanguageNull = El idioma del esquema especificado no puede ser nulo.
-SchemaLanguageLengthZero = El idioma del esquema especificado no puede tener una longitud de cero caracteres.
-SchemaSourceArrayNull = El par\u00E1metro de matriz de origen no puede ser nulo.
-SchemaSourceArrayMemberNull = El par\u00E1metro de matriz de origen no puede contener ning\u00FAn elemento que sea nulo.
-SchemaFactorySourceUnrecognized = Este SchemaFactory no reconoce el par\u00E1metro de origen del tipo ''{0}''.
-
-# Validator error messages
-SourceParameterNull = El par\u00E1metro de origen no puede ser nulo.
-SourceNotAccepted = Este validador no acepta el par\u00E1metro de origen del tipo ''{0}''.
-SourceResultMismatch = El par\u00E1metro de origen del tipo ''{0}'' no es compatible con el par\u00E1metro de resultado del tipo ''{1}''.
-
-# TypeInfoProvider error messages
-TypeInfoProviderIllegalState = Un TypeInfoProvider no puede consultarse fuera de una devoluci\u00F3n de llamada de startElement.
-
-# General error messages
-FeatureNameNull = El nombre de la funci\u00F3n no puede ser nulo.
-ProperyNameNull = El nombre de la propiedad no puede ser nulo.
-SAXSourceNullInputSource = El SAXSource especificado no contiene ning\u00FAn valor de InputSource.
-
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_fr.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_fr.properties
deleted file mode 100644
index fae2fce..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_fr.properties
+++ /dev/null
@@ -1,29 +0,0 @@
-# This file stores localized messages for the Xerces JAXP Validation API implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-# Messages for message reporting
-BadMessageKey = Le message d'erreur correspondant \u00E0 la cl\u00E9 de message est introuvable.
-FormatFailed = Une erreur interne est survenue lors du formatage du message suivant :\n
-
-# SchemaFactory error messages
-SchemaLanguageNull = La langue de sch\u00E9ma indiqu\u00E9e ne peut pas \u00EAtre NULL.
-SchemaLanguageLengthZero = La longueur de la langue de sch\u00E9ma indiqu\u00E9e ne peut \u00EAtre de z\u00E9ro caract\u00E8re.
-SchemaSourceArrayNull = Le param\u00E8tre de tableau source ne peut pas \u00EAtre NULL.
-SchemaSourceArrayMemberNull = Le param\u00E8tre de tableau source ne peut pas contenir d'\u00E9l\u00E9ment NULL.
-SchemaFactorySourceUnrecognized = Le param\u00E8tre source de type ''{0}'' n''est pas reconnu par cet \u00E9l\u00E9ment SchemaFactory.
-
-# Validator error messages
-SourceParameterNull = Le param\u00E8tre source ne peut pas \u00EAtre NULL.
-SourceNotAccepted = Le param\u00E8tre source de type ''{0}'' n''est pas accept\u00E9 par ce valideur.
-SourceResultMismatch = Le param\u00E8tre source de type ''{0}'' n''est pas compatible avec le param\u00E8tre de r\u00E9sultat de type ''{1}''.
-
-# TypeInfoProvider error messages
-TypeInfoProviderIllegalState = Un \u00E9l\u00E9ment TypeInfoProvider ne peut pas \u00EAtre interrog\u00E9 en dehors d'un callback startElement.
-
-# General error messages
-FeatureNameNull = Le nom de fonctionnalit\u00E9 ne peut pas \u00EAtre NULL.
-ProperyNameNull = Le nom de propri\u00E9t\u00E9 ne peut pas \u00EAtre NULL.
-SAXSourceNullInputSource = L'\u00E9l\u00E9ment SAXSource indiqu\u00E9 ne contient aucun \u00E9l\u00E9ment InputSource.
-
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_it.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_it.properties
deleted file mode 100644
index c7645b8..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_it.properties
+++ /dev/null
@@ -1,29 +0,0 @@
-# This file stores localized messages for the Xerces JAXP Validation API implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-# Messages for message reporting
-BadMessageKey = Impossibile trovare il messaggio di errore corrispondente alla chiave di messaggio.
-FormatFailed = Si \u00E8 verificato un errore interno durante la formattazione del seguente messaggio:\n
-
-# SchemaFactory error messages
-SchemaLanguageNull = La lingua dello schema specificata non pu\u00F2 essere nulla.
-SchemaLanguageLengthZero = La lingua dello schema specificata non pu\u00F2 avere una lunghezza di zero caratteri.
-SchemaSourceArrayNull = Il parametro di array di origine non pu\u00F2 essere nullo.
-SchemaSourceArrayMemberNull = Il parametro di array di origine non pu\u00F2 contenere elementi nulli.
-SchemaFactorySourceUnrecognized = Il parametro di origine di tipo ''{0}'' non \u00E8 riconosciuto in questo SchemaFactory.
-
-# Validator error messages
-SourceParameterNull = Il parametro di origine non pu\u00F2 essere nullo.
-SourceNotAccepted = Il parametro di origine di tipo ''{0}'' non \u00E8 accettato da questo validator.
-SourceResultMismatch = Il parametro di origine di tipo ''{0}'' non \u00E8 compatibile con il parametro dei risultati di tipo ''{1}''.
-
-# TypeInfoProvider error messages
-TypeInfoProviderIllegalState = Impossibile eseguire una query su TypeInfoProvider al di fuori di un callback startElement.
-
-# General error messages
-FeatureNameNull = Il nome funzione non pu\u00F2 essere nullo.
-ProperyNameNull = Il nome propriet\u00E0 non pu\u00F2 essere nullo.
-SAXSourceNullInputSource = Il valore specificato per SAXSource non contiene InputSource.
-
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_ja.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_ja.properties
deleted file mode 100644
index 1894606..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_ja.properties
+++ /dev/null
@@ -1,29 +0,0 @@
-# This file stores localized messages for the Xerces JAXP Validation API implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-# Messages for message reporting
-BadMessageKey = \u30E1\u30C3\u30BB\u30FC\u30B8\u30FB\u30AD\u30FC\u306B\u5BFE\u5FDC\u3059\u308B\u30A8\u30E9\u30FC\u30FB\u30E1\u30C3\u30BB\u30FC\u30B8\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002
-FormatFailed = \u6B21\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\u306E\u66F8\u5F0F\u8A2D\u5B9A\u4E2D\u306B\u5185\u90E8\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F:\n
-
-# SchemaFactory error messages
-SchemaLanguageNull = \u6307\u5B9A\u3057\u305F\u30B9\u30AD\u30FC\u30DE\u8A00\u8A9E\u306Fnull\u306B\u3067\u304D\u307E\u305B\u3093\u3002
-SchemaLanguageLengthZero = \u6307\u5B9A\u3057\u305F\u30B9\u30AD\u30FC\u30DE\u8A00\u8A9E\u306E\u9577\u3055\u306F\u30BC\u30ED\u6587\u5B57\u306B\u3067\u304D\u307E\u305B\u3093\u3002
-SchemaSourceArrayNull = Source\u914D\u5217\u30D1\u30E9\u30E1\u30FC\u30BF\u306Fnull\u306B\u3067\u304D\u307E\u305B\u3093\u3002
-SchemaSourceArrayMemberNull = Source\u914D\u5217\u30D1\u30E9\u30E1\u30FC\u30BF\u306B\u306F\u3001null\u306E\u30A2\u30A4\u30C6\u30E0\u3092\u542B\u3081\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002
-SchemaFactorySourceUnrecognized = \u30BF\u30A4\u30D7''{0}''\u306ESource\u30D1\u30E9\u30E1\u30FC\u30BF\u306F\u3001\u3053\u306ESchemaFactory\u3067\u306F\u8A8D\u8B58\u3055\u308C\u307E\u305B\u3093\u3002
-
-# Validator error messages
-SourceParameterNull = Source\u30D1\u30E9\u30E1\u30FC\u30BF\u306Fnull\u306B\u3067\u304D\u307E\u305B\u3093\u3002
-SourceNotAccepted = \u30BF\u30A4\u30D7''{0}''\u306ESource\u30D1\u30E9\u30E1\u30FC\u30BF\u306F\u3001\u3053\u306E\u30D0\u30EA\u30C7\u30FC\u30BF\u3067\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\u3002
-SourceResultMismatch = \u30BF\u30A4\u30D7''{0}''\u306ESource\u30D1\u30E9\u30E1\u30FC\u30BF\u306F\u3001\u30BF\u30A4\u30D7''{1}''\u306E\u7D50\u679C\u30D1\u30E9\u30E1\u30FC\u30BF\u3068\u4E92\u63DB\u6027\u304C\u3042\u308A\u307E\u305B\u3093\u3002
-
-# TypeInfoProvider error messages
-TypeInfoProviderIllegalState = TypeInfoProvider\u306F\u3001startElement\u30B3\u30FC\u30EB\u30D0\u30C3\u30AF\u306E\u5916\u3067\u554F\u3044\u5408\u305B\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002
-
-# General error messages
-FeatureNameNull = \u6A5F\u80FD\u540D\u306Fnull\u306B\u3067\u304D\u307E\u305B\u3093\u3002
-ProperyNameNull = \u30D7\u30ED\u30D1\u30C6\u30A3\u540D\u306Fnull\u306B\u3067\u304D\u307E\u305B\u3093\u3002
-SAXSourceNullInputSource = \u6307\u5B9A\u3057\u305FSAXSource\u306B\u306F\u3001InputSource\u306F\u542B\u307E\u308C\u3066\u3044\u307E\u305B\u3093\u3002
-
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_ko.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_ko.properties
deleted file mode 100644
index 01598bf..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_ko.properties
+++ /dev/null
@@ -1,29 +0,0 @@
-# This file stores localized messages for the Xerces JAXP Validation API implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-# Messages for message reporting
-BadMessageKey = \uBA54\uC2DC\uC9C0 \uD0A4\uC5D0 \uD574\uB2F9\uD558\uB294 \uC624\uB958 \uBA54\uC2DC\uC9C0\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
-FormatFailed = \uB2E4\uC74C \uBA54\uC2DC\uC9C0\uC758 \uD615\uC2DD\uC744 \uC9C0\uC815\uD558\uB294 \uC911 \uB0B4\uBD80 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4.\n
-
-# SchemaFactory error messages
-SchemaLanguageNull = \uC9C0\uC815\uB41C \uC2A4\uD0A4\uB9C8 \uC5B8\uC5B4\uB294 \uB110\uC77C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
-SchemaLanguageLengthZero = \uC9C0\uC815\uB41C \uC2A4\uD0A4\uB9C8 \uC5B8\uC5B4\uC758 \uAE38\uC774\uB294 0\uC790\uC77C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
-SchemaSourceArrayNull = \uC18C\uC2A4 \uBC30\uC5F4 \uB9E4\uAC1C\uBCC0\uC218\uB294 \uB110\uC77C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
-SchemaSourceArrayMemberNull = \uC18C\uC2A4 \uBC30\uC5F4 \uB9E4\uAC1C\uBCC0\uC218\uC5D0\uB294 \uB110\uC778 \uD56D\uBAA9\uC774 \uD3EC\uD568\uB420 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
-SchemaFactorySourceUnrecognized = \uC774 SchemaFactory\uAC00 ''{0}'' \uC720\uD615\uC758 \uC18C\uC2A4 \uB9E4\uAC1C\uBCC0\uC218\uB97C \uC778\uC2DD\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
-
-# Validator error messages
-SourceParameterNull = \uC18C\uC2A4 \uB9E4\uAC1C\uBCC0\uC218\uB294 \uB110\uC77C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
-SourceNotAccepted = \uC774 \uAC80\uC99D\uAE30\uB294 ''{0}'' \uC720\uD615\uC758 \uC18C\uC2A4 \uB9E4\uAC1C\uBCC0\uC218\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
-SourceResultMismatch = ''{0}'' \uC720\uD615\uC758 \uC18C\uC2A4 \uB9E4\uAC1C\uBCC0\uC218\uAC00 ''{1}'' \uC720\uD615\uC758 \uACB0\uACFC \uB9E4\uAC1C\uBCC0\uC218\uC640 \uD638\uD658\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
-
-# TypeInfoProvider error messages
-TypeInfoProviderIllegalState = TypeInfoProvider\uB294 startElement \uCF5C\uBC31 \uC678\uBD80\uC5D0\uC11C \uC9C8\uC758\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
-
-# General error messages
-FeatureNameNull = \uAE30\uB2A5 \uC774\uB984\uC740 \uB110\uC77C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
-ProperyNameNull = \uC18D\uC131 \uC774\uB984\uC740 \uB110\uC77C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
-SAXSourceNullInputSource = \uC9C0\uC815\uB41C SAXSource\uC5D0 InputSource\uAC00 \uD3EC\uD568\uB418\uC5B4 \uC788\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
-
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_pt_BR.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_pt_BR.properties
deleted file mode 100644
index d19bbe2..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_pt_BR.properties
+++ /dev/null
@@ -1,29 +0,0 @@
-# This file stores localized messages for the Xerces JAXP Validation API implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-# Messages for message reporting
-BadMessageKey = N\u00E3o foi poss\u00EDvel encontrar a mensagem de erro correspondente \u00E0 chave da mensagem.
-FormatFailed = Ocorreu um erro interno ao formatar a mensagem a seguir:\n
-
-# SchemaFactory error messages
-SchemaLanguageNull = O idioma do esquema especificado n\u00E3o pode ser nulo.
-SchemaLanguageLengthZero = O idioma do esquema especificado n\u00E3o pode ter um tamanho de zero caracteres.
-SchemaSourceArrayNull = O par\u00E2metro do array de Origem n\u00E3o pode ser nulo.
-SchemaSourceArrayMemberNull = O par\u00E2metro do array de Origem n\u00E3o pode conter nenhum item que seja nulo.
-SchemaFactorySourceUnrecognized = O par\u00E2metro de origem do tipo ''{0}'' n\u00E3o reconheceu este SchemaFactory.
-
-# Validator error messages
-SourceParameterNull = O par\u00E2metro de origem n\u00E3o pode ser nulo.
-SourceNotAccepted = O par\u00E2metro de origem do tipo ''{0}'' n\u00E3o \u00E9 aceito por este validador.
-SourceResultMismatch = O par\u00E2metro do origem do tipo ''{0}'' n\u00E3o \u00E9 compat\u00EDvel com o par\u00E2metro de resultado do tipo ''{1}''.
-
-# TypeInfoProvider error messages
-TypeInfoProviderIllegalState = Um TypeInfoProvider n\u00E3o pode ser consultado fora de um callback startElement.
-
-# General error messages
-FeatureNameNull = O nome do recurso n\u00E3o pode ser nulo.
-ProperyNameNull = O nome da propriedade n\u00E3o pode ser nulo.
-SAXSourceNullInputSource = O SAXSource especificado n\u00E3o cont\u00E9m InputSource.
-
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_sv.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_sv.properties
deleted file mode 100644
index 74c33a0..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_sv.properties
+++ /dev/null
@@ -1,29 +0,0 @@
-# This file stores localized messages for the Xerces JAXP Validation API implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-# Messages for message reporting
-BadMessageKey = Hittar inte felmeddelandet som motsvarar meddelandenyckeln.
-FormatFailed = Ett internt fel intr\u00E4ffade vid formatering av f\u00F6ljande meddelande:\n
-
-# SchemaFactory error messages
-SchemaLanguageNull = Angivet schemaspr\u00E5k f\u00E5r inte vara null.
-SchemaLanguageLengthZero = Angivet schemaspr\u00E5k f\u00E5r inte ha en l\u00E4ngd som \u00E4r noll tecken.
-SchemaSourceArrayNull = Parametern f\u00F6r Source-uppst\u00E4llning f\u00E5r inte vara null.
-SchemaSourceArrayMemberNull = Parametern f\u00F6r Source-uppst\u00E4llning f\u00E5r inte inneh\u00E5lla n\u00E5gra objekt som \u00E4r null.
-SchemaFactorySourceUnrecognized = Source-parametrar av typ ''{0}'' identifieras inte av SchemaFactory.
-
-# Validator error messages
-SourceParameterNull = Source-parameter f\u00E5r inte vara null.
-SourceNotAccepted = Source-parametrar av typ ''{0}'' accepteras inte av valideraren.
-SourceResultMismatch = Source-parametrar av typ ''{0}'' \u00E4r inte kompatibla med resultatparametrar av typ ''{1}''.
-
-# TypeInfoProvider error messages
-TypeInfoProviderIllegalState = TypeInfoProvider f\u00E5r inte ta emot fr\u00E5gor utanf\u00F6r respons fr\u00E5n startElement.
-
-# General error messages
-FeatureNameNull = Funktionsnamn f\u00E5r inte vara null.
-ProperyNameNull = Egenskapsnamn f\u00E5r inte vara null.
-SAXSourceNullInputSource = Angiven SAXSource inneh\u00E5ller ingen InputSource.
-
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_zh_CN.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_zh_CN.properties
deleted file mode 100644
index d45ac71..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_zh_CN.properties
+++ /dev/null
@@ -1,29 +0,0 @@
-# This file stores localized messages for the Xerces JAXP Validation API implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-# Messages for message reporting
-BadMessageKey = \u627E\u4E0D\u5230\u4E0E\u6D88\u606F\u5173\u952E\u5B57\u5BF9\u5E94\u7684\u9519\u8BEF\u6D88\u606F\u3002
-FormatFailed = \u8BBE\u7F6E\u4EE5\u4E0B\u6D88\u606F\u7684\u683C\u5F0F\u65F6\u51FA\u73B0\u5185\u90E8\u9519\u8BEF:\n
-
-# SchemaFactory error messages
-SchemaLanguageNull = \u6307\u5B9A\u7684\u65B9\u6848\u8BED\u8A00\u4E0D\u80FD\u4E3A\u7A7A\u503C\u3002
-SchemaLanguageLengthZero = \u6307\u5B9A\u7684\u65B9\u6848\u8BED\u8A00\u7684\u957F\u5EA6\u4E0D\u80FD\u4E3A\u96F6\u4E2A\u5B57\u7B26\u3002
-SchemaSourceArrayNull = Source \u6570\u7EC4\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A\u503C\u3002
-SchemaSourceArrayMemberNull = Source \u6570\u7EC4\u53C2\u6570\u4E0D\u80FD\u5305\u542B\u4EFB\u4F55\u4E3A\u7A7A\u503C\u7684\u9879\u3002
-SchemaFactorySourceUnrecognized = \u6B64 SchemaFactory \u65E0\u6CD5\u8BC6\u522B\u7C7B\u578B\u4E3A ''{0}'' \u7684 Source \u53C2\u6570\u3002
-
-# Validator error messages
-SourceParameterNull = Source \u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A\u503C\u3002
-SourceNotAccepted = \u6B64\u9A8C\u8BC1\u7A0B\u5E8F\u4E0D\u63A5\u53D7\u7C7B\u578B\u4E3A ''{0}'' \u7684 Source \u53C2\u6570\u3002
-SourceResultMismatch = \u7C7B\u578B\u4E3A ''{0}'' \u7684 Source \u53C2\u6570\u4E0E\u7C7B\u578B\u4E3A ''{1}'' \u7684\u7ED3\u679C\u53C2\u6570\u4E0D\u517C\u5BB9\u3002
-
-# TypeInfoProvider error messages
-TypeInfoProviderIllegalState = \u65E0\u6CD5\u5728 startElement \u56DE\u8C03\u5916\u90E8\u67E5\u8BE2 TypeInfoProvider\u3002
-
-# General error messages
-FeatureNameNull = \u529F\u80FD\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A\u503C\u3002
-ProperyNameNull = \u5C5E\u6027\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A\u503C\u3002
-SAXSourceNullInputSource = \u6307\u5B9A\u7684 SAXSource \u4E0D\u5305\u542B InputSource\u3002
-
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_zh_TW.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_zh_TW.properties
deleted file mode 100644
index 0db86b6..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_zh_TW.properties
+++ /dev/null
@@ -1,29 +0,0 @@
-# This file stores localized messages for the Xerces JAXP Validation API implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-# Messages for message reporting
-BadMessageKey = \u627E\u4E0D\u5230\u5C0D\u61C9\u8A0A\u606F\u7D22\u5F15\u9375\u7684\u932F\u8AA4\u8A0A\u606F\u3002
-FormatFailed = \u683C\u5F0F\u5316\u4E0B\u5217\u8A0A\u606F\u6642\u767C\u751F\u5167\u90E8\u932F\u8AA4:\n
-
-# SchemaFactory error messages
-SchemaLanguageNull = \u6307\u5B9A\u7684\u7DB1\u8981\u8A9E\u8A00\u4E0D\u53EF\u70BA\u7A7A\u503C\u3002
-SchemaLanguageLengthZero = \u6307\u5B9A\u7684\u7DB1\u8981\u8A9E\u8A00\u4E0D\u53EF\u70BA\u96F6\u5B57\u5143\u9577\u5EA6\u3002
-SchemaSourceArrayNull = \u4F86\u6E90\u9663\u5217\u53C3\u6578\u4E0D\u53EF\u70BA\u7A7A\u503C\u3002
-SchemaSourceArrayMemberNull = \u4F86\u6E90\u9663\u5217\u53C3\u6578\u4E0D\u53EF\u5305\u542B\u4EFB\u4F55\u7A7A\u503C\u9805\u76EE\u3002
-SchemaFactorySourceUnrecognized = \u985E\u578B ''{0}'' \u7684\u4F86\u6E90\u53C3\u6578\u7121\u6CD5\u8FA8\u8B58\u6B64 SchemaFactory\u3002
-
-# Validator error messages
-SourceParameterNull = \u4F86\u6E90\u53C3\u6578\u4E0D\u53EF\u70BA\u7A7A\u503C\u3002
-SourceNotAccepted = \u6B64\u9A57\u8B49\u7A0B\u5F0F\u4E0D\u63A5\u53D7\u985E\u578B ''{0}'' \u7684\u4F86\u6E90\u53C3\u6578\u3002
-SourceResultMismatch = \u985E\u578B ''{0}'' \u7684\u4F86\u6E90\u53C3\u6578\u8207\u985E\u578B ''{1}'' \u7684\u7D50\u679C\u53C3\u6578\u4E0D\u76F8\u5BB9\u3002
-
-# TypeInfoProvider error messages
-TypeInfoProviderIllegalState = \u4E0D\u53EF\u5728 startElement \u56DE\u547C\u4E4B\u5916\u67E5\u8A62 TypeInfoProvider\u3002
-
-# General error messages
-FeatureNameNull = \u529F\u80FD\u540D\u7A31\u4E0D\u53EF\u70BA\u7A7A\u503C\u3002
-ProperyNameNull = \u5C6C\u6027\u540D\u7A31\u4E0D\u53EF\u70BA\u7A7A\u503C\u3002
-SAXSourceNullInputSource = \u6307\u5B9A\u7684 SAXSource \u672A\u5305\u542B InputSource\u3002
-
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages.properties
deleted file mode 100644
index 5e7ba8b..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages.properties
+++ /dev/null
@@ -1,35 +0,0 @@
-# This file stores localized messages for the Xerces
-# SAX implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-
-BadMessageKey = The error message corresponding to the message key can not be found.
-FormatFailed = An internal error occurred while formatting the following message:\n
-
-# JAXP messages
-schema-not-supported = The specified schema language is not supported.
-jaxp-order-not-supported = Property ''{0}'' must be set before setting property ''{1}''.
-schema-already-specified = Property ''{0}'' cannot be set when a non-null Schema object has already been specified.
-
-# feature messages
-feature-not-supported = Feature ''{0}'' is not supported.
-feature-not-recognized = Feature ''{0}'' is not recognized.
-true-not-supported = True state for feature ''{0}'' is not supported.
-false-not-supported = False state for feature ''{0}'' is not supported.
-feature-read-only = Feature ''{0}'' is read only.
-jaxp-secureprocessing-feature = FEATURE_SECURE_PROCESSING: Cannot set the feature to false when security manager is present.
-
-# property messages
-property-not-supported = Property ''{0}'' is not supported.
-property-not-recognized = Property ''{0}'' is not recognized.
-property-read-only = Property ''{0}'' is read only.
-property-not-parsing-supported = Property ''{0}'' is not supported while parsing.
-dom-node-read-not-supported = Cannot read DOM node property. No DOM tree exists.
-incompatible-class = The value specified for property ''{0}'' cannot be casted to {1}.
-
-start-document-not-called=Property "{0}" should be called after startDocument event is thrown
-nullparameter=the name parameter for "{0}" is null
-errorHandlerNotSet=Warning\: validation was turned on but an org.xml.sax.ErrorHandler was not set, which is probably not what is desired. Parser will use a default ErrorHandler to print the first {0} errors. Please call the 'setErrorHandler' method to fix this.
-errorHandlerDebugMsg=Error\: URI \= "{0}", Line \= "{1}", \: {2}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_de.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_de.properties
deleted file mode 100644
index 10aa813..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_de.properties
+++ /dev/null
@@ -1,35 +0,0 @@
-# This file stores localized messages for the Xerces
-# SAX implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-
-BadMessageKey = Die zum Meldungsschl\u00FCssel geh\u00F6rige Fehlermeldung kann nicht gefunden werden.
-FormatFailed = Beim Formatieren der folgenden Meldung ist ein interner Fehler aufgetreten:\n
-
-# JAXP messages
-schema-not-supported = Die angegebene Schemasprache wird nicht unterst\u00FCtzt.
-jaxp-order-not-supported = Eigenschaft "{0}" muss vor der Eigenschaft "{1}" festgelegt werden.
-schema-already-specified = Eigenschaft "{0}" kann nicht festgelegt werden, wenn bereits ein Schemaobjekt ungleich null angegeben wurde.
-
-# feature messages
-feature-not-supported = Feature "{0}" wird nicht unterst\u00FCtzt.
-feature-not-recognized = Feature "{0}" ist unbekannt.
-true-not-supported = Status "True" f\u00FCr Feature "{0}" wird nicht unterst\u00FCtzt.
-false-not-supported = Status "False" f\u00FCr Feature "{0}" wird nicht unterst\u00FCtzt.
-feature-read-only = Feature "{0}" ist schreibgesch\u00FCtzt.
-jaxp-secureprocessing-feature = FEATURE_SECURE_PROCESSING: Feature kann nicht auf "false" gesetzt werden, wenn Security Manager vorhanden ist.
-
-# property messages
-property-not-supported = Eigenschaft "{0}" wird nicht unterst\u00FCtzt.
-property-not-recognized = Eigenschaft "{0}" ist unbekannt.
-property-read-only = Eigenschaft "{0}" ist schreibgesch\u00FCtzt.
-property-not-parsing-supported = Eigenschaft "{0}" wird beim Parsen nicht unterst\u00FCtzt.
-dom-node-read-not-supported = DOM-Knoteneigenschaft kann nicht gelesen werden. Kein DOM-Baum vorhanden.
-incompatible-class = Der f\u00FCr Eigenschaft "{0}" angegebene Wert kann nicht in {1} konvertiert werden.
-
-start-document-not-called=Eigenschaft "{0}" sollte aufgerufen werden, nachdem das startDocument-Ereignis ausgel\u00F6st wurde
-nullparameter=Namensparameter f\u00FCr "{0}" ist null
-errorHandlerNotSet=Warnung: Validierung wurde eingeschaltet, aber es wurde kein org.xml.sax.ErrorHandler festgelegt. Dies ist wahrscheinlich nicht beabsichtigt. Parser druckt die ersten {0} Fehler mit einem Standard-ErrorHandler. Rufen Sie die Methode "setErrorHandler" auf, um dies zu beheben.
-errorHandlerDebugMsg=Fehler: URI = "{0}", Zeile = "{1}", : {2}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_es.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_es.properties
deleted file mode 100644
index ecdcdb9..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_es.properties
+++ /dev/null
@@ -1,35 +0,0 @@
-# This file stores localized messages for the Xerces
-# SAX implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-
-BadMessageKey = No se ha encontrado el mensaje de error correspondiente a la clave de mensaje.
-FormatFailed = Se ha producido un error interno al formatear el siguiente mensaje:\n
-
-# JAXP messages
-schema-not-supported = El idioma del esquema especificado no est\u00E1 soportado.
-jaxp-order-not-supported = La propiedad ''{0}'' debe definirse antes de definir la propiedad ''{1}''.
-schema-already-specified = La propiedad ''{0}'' no puede definirse cuando un objeto de esquema no nulo ya se haya especificado.
-
-# feature messages
-feature-not-supported = La funci\u00F3n "{0}" no est\u00E1 soportada.
-feature-not-recognized = La funci\u00F3n "{0}" no se ha reconocido.
-true-not-supported = El estado true para la funci\u00F3n ''{0}'' no est\u00E1 soportado.
-false-not-supported = El estado false para la funci\u00F3n ''{0}'' no est\u00E1 soportado.
-feature-read-only = La funci\u00F3n "{0}" es de s\u00F3lo lectura.
-jaxp-secureprocessing-feature = FEATURE_SECURE_PROCESSING: no se puede definir la funci\u00F3n en false cuando est\u00E1 presente el gestor de seguridad.
-
-# property messages
-property-not-supported = La propiedad "{0}" no est\u00E1 soportada.
-property-not-recognized = La propiedad "{0}" no se ha reconocido.
-property-read-only = La propiedad "{0}" es de s\u00F3lo lectura.
-property-not-parsing-supported = La propiedad "{0}" no est\u00E1 soportada durante el an\u00E1lisis.
-dom-node-read-not-supported = No se puede leer la propiedad del nodo DOM. No existe el \u00E1rbol DOM.
-incompatible-class = El valor especificado para la propiedad ''{0}'' no se puede convertir en {1}.
-
-start-document-not-called=La propiedad "{0}" debe llamarse despu\u00E9s de que se haya devuelto el evento startDocument
-nullparameter=el par\u00E1metro de nombre para "{0}" es nulo
-errorHandlerNotSet=Advertencia: se activ\u00F3 la validaci\u00F3n pero no se defini\u00F3 un org.xml.sax.ErrorHandler, lo cual probablemente sea un resultado no deseado. El analizador utilizar\u00E1 un ErrorHandler por defecto para imprimir los primeros {0} errores. Llame al m\u00E9todo ''setErrorHandler'' para solucionarlo.
-errorHandlerDebugMsg=Error: URI = "{0}", L\u00EDnea = "{1}", : {2}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_fr.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_fr.properties
deleted file mode 100644
index 1457b66..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_fr.properties
+++ /dev/null
@@ -1,35 +0,0 @@
-# This file stores localized messages for the Xerces
-# SAX implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-
-BadMessageKey = Le message d'erreur correspondant \u00E0 la cl\u00E9 de message est introuvable.
-FormatFailed = Une erreur interne est survenue lors du formatage du message suivant :\n
-
-# JAXP messages
-schema-not-supported = La langue de sch\u00E9ma indiqu\u00E9e n'est pas prise en charge.
-jaxp-order-not-supported = La propri\u00E9t\u00E9 ''{0}'' doit \u00EAtre d\u00E9finie avant la propri\u00E9t\u00E9 ''{1}''.
-schema-already-specified = La propri\u00E9t\u00E9 ''{0}'' ne peut pas \u00EAtre d\u00E9finie lorsqu''un objet de sch\u00E9ma non NULL a d\u00E9j\u00E0 \u00E9t\u00E9 indiqu\u00E9.
-
-# feature messages
-feature-not-supported = La fonctionnalit\u00E9 ''{0}'' n''est pas prise en charge.
-feature-not-recognized = La fonctionnalit\u00E9 ''{0}'' n''est pas reconnue.
-true-not-supported = L''\u00E9tat True de la fonctionnalit\u00E9 ''{0}'' n''est pas pris en charge.
-false-not-supported = L''\u00E9tat False de la fonctionnalit\u00E9 ''{0}'' n''est pas pris en charge.
-feature-read-only = La fonctionnalit\u00E9 ''{0}''est accessible en lecture seule.
-jaxp-secureprocessing-feature = FEATURE_SECURE_PROCESSING : impossible de d\u00E9finir la fonctionnalit\u00E9 sur False en pr\u00E9sence du gestionnaire de s\u00E9curit\u00E9.
-
-# property messages
-property-not-supported = La propri\u00E9t\u00E9 ''{0}'' n''est pas prise en charge.
-property-not-recognized = La propri\u00E9t\u00E9 ''{0}'' n''est pas reconnue.
-property-read-only = La propri\u00E9t\u00E9 ''{0}'' est accessible en lecture seule.
-property-not-parsing-supported = La propri\u00E9t\u00E9 ''{0}'' n''est pas prise en charge au cours de l''analyse.
-dom-node-read-not-supported = Impossible de lire la propri\u00E9t\u00E9 de noeud DOM. Aucune arborescence DOM n'existe.
-incompatible-class = La valeur indiqu\u00E9e pour la propri\u00E9t\u00E9 ''{0}'' ne peut pas \u00EAtre convertie en {1}.
-
-start-document-not-called=La propri\u00E9t\u00E9 "{0}" doit \u00EAtre appel\u00E9e apr\u00E8s qu''un \u00E9v\u00E9nement startDocument est g\u00E9n\u00E9r\u00E9
-nullparameter=le param\u00E8tre de nom pour "{0}" est NULL
-errorHandlerNotSet=Avertissement : la validation a \u00E9t\u00E9 activ\u00E9e mais aucun \u00E9l\u00E9ment org.xml.sax.ErrorHandler n''a \u00E9t\u00E9 d\u00E9fini, ce qui devrait probablement \u00EAtre le cas. L''analyseur utilisera un gestionnaire d''erreurs par d\u00E9faut pour imprimer les {0} premi\u00E8res erreurs. Appelez la m\u00E9thode ''setErrorHandler'' pour r\u00E9soudre ce probl\u00E8me.
-errorHandlerDebugMsg=Erreur : URI = "{0}", ligne = "{1}", : {2}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_it.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_it.properties
deleted file mode 100644
index f82faf4..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_it.properties
+++ /dev/null
@@ -1,35 +0,0 @@
-# This file stores localized messages for the Xerces
-# SAX implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-
-BadMessageKey = Impossibile trovare il messaggio di errore corrispondente alla chiave di messaggio.
-FormatFailed = Si \u00E8 verificato un errore interno durante la formattazione del seguente messaggio:\n
-
-# JAXP messages
-schema-not-supported = La lingua dello schema specificata non \u00E8 supportata.
-jaxp-order-not-supported = Impostare la propriet\u00E0 ''{0}'' prima di impostare la propriet\u00E0 ''{1}''.
-schema-already-specified = Impossibile impostare la propriet\u00E0 ''{0}'' se \u00E8 gi\u00E0 stato specificato un oggetto di schema non nullo.
-
-# feature messages
-feature-not-supported = La funzione "{0}" non \u00E8 supportata.
-feature-not-recognized = La funzione "{0}" non \u00E8 riconosciuta.
-true-not-supported = Lo stato true per la funzione "{0}" non \u00E8 supportato.
-false-not-supported = Lo stato false per la funzione "{0}" non \u00E8 supportato.
-feature-read-only = La funzione "{0}" \u00E8 di sola lettura.
-jaxp-secureprocessing-feature = FEATURE_SECURE_PROCESSING: impossibile impostare la funzione su false se \u00E8 presente Security Manager.
-
-# property messages
-property-not-supported = La propriet\u00E0 "{0}" non \u00E8 supportata.
-property-not-recognized = La propriet\u00E0 "{0}" non \u00E8 riconosciuta.
-property-read-only = La propriet\u00E0 "{0}" \u00E8 di sola lettura.
-property-not-parsing-supported = La propriet\u00E0 "{0}" non \u00E8 supportata durante l''analisi.
-dom-node-read-not-supported = Impossibile leggere la propriet\u00E0 di nodo DOM. Non esiste alcuna struttura DOM.
-incompatible-class = Impossibile eseguire la conversione cast del valore specificato per la propriet\u00E0 ''{0}'' in {1}.
-
-start-document-not-called=Richiamare la propriet\u00E0 "{0}" dopo l''esecuzione dell''evento startDocument
-nullparameter=il parametro del nome per "{0}" \u00E8 nullo
-errorHandlerNotSet=Avvertenza: la convalida \u00E8 stata attivata, ma org.xml.sax.ErrorHandler non \u00E8 stato impostato, il che potrebbe essere un errore. Il parser utilizzer\u00E0 un ErrorHandler predefinito per visualizzare i primi {0} errori. Richiamare il metodo ''setErrorHandler'' per correggere questo problema.
-errorHandlerDebugMsg=Errore: URI = "{0}", riga = "{1}", : {2}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_ja.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_ja.properties
deleted file mode 100644
index bb70f39..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_ja.properties
+++ /dev/null
@@ -1,35 +0,0 @@
-# This file stores localized messages for the Xerces
-# SAX implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-
-BadMessageKey = \u30E1\u30C3\u30BB\u30FC\u30B8\u30FB\u30AD\u30FC\u306B\u5BFE\u5FDC\u3059\u308B\u30A8\u30E9\u30FC\u30FB\u30E1\u30C3\u30BB\u30FC\u30B8\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002
-FormatFailed = \u6B21\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\u306E\u66F8\u5F0F\u8A2D\u5B9A\u4E2D\u306B\u5185\u90E8\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F:\n
-
-# JAXP messages
-schema-not-supported = \u6307\u5B9A\u3057\u305F\u30B9\u30AD\u30FC\u30DE\u8A00\u8A9E\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
-jaxp-order-not-supported = \u30D7\u30ED\u30D1\u30C6\u30A3''{1}''\u3092\u8A2D\u5B9A\u3059\u308B\u524D\u306B\u30D7\u30ED\u30D1\u30C6\u30A3''{0}''\u3092\u8A2D\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
-schema-already-specified = null\u4EE5\u5916\u306E\u30B9\u30AD\u30FC\u30DE\u30FB\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u304C\u3059\u3067\u306B\u6307\u5B9A\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u3001\u30D7\u30ED\u30D1\u30C6\u30A3''{0}''\u306F\u8A2D\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002
-
-# feature messages
-feature-not-supported = \u6A5F\u80FD''{0}''\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
-feature-not-recognized = \u6A5F\u80FD''{0}''\u306F\u8A8D\u8B58\u3055\u308C\u307E\u305B\u3093\u3002
-true-not-supported = \u6A5F\u80FD''{0}''\u306Etrue\u306E\u72B6\u614B\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
-false-not-supported = \u6A5F\u80FD''{0}''\u306Efalse\u306E\u72B6\u614B\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
-feature-read-only = \u6A5F\u80FD''{0}''\u306F\u8AAD\u53D6\u308A\u5C02\u7528\u3067\u3059\u3002
-jaxp-secureprocessing-feature = FEATURE_SECURE_PROCESSING: \u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u30FB\u30DE\u30CD\u30FC\u30B8\u30E3\u304C\u5B58\u5728\u3059\u308B\u3068\u304D\u3001\u6A5F\u80FD\u3092false\u306B\u8A2D\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002
-
-# property messages
-property-not-supported = \u30D7\u30ED\u30D1\u30C6\u30A3''{0}''\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
-property-not-recognized = \u30D7\u30ED\u30D1\u30C6\u30A3''{0}''\u306F\u8A8D\u8B58\u3055\u308C\u307E\u305B\u3093\u3002
-property-read-only = \u30D7\u30ED\u30D1\u30C6\u30A3''{0}''\u306F\u8AAD\u53D6\u308A\u5C02\u7528\u3067\u3059\u3002
-property-not-parsing-supported = \u89E3\u6790\u4E2D\u306B\u306F\u30D7\u30ED\u30D1\u30C6\u30A3''{0}''\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
-dom-node-read-not-supported = DOM\u30CE\u30FC\u30C9\u30FB\u30D7\u30ED\u30D1\u30C6\u30A3\u3092\u8AAD\u307F\u53D6\u308C\u307E\u305B\u3093\u3002DOM\u30C4\u30EA\u30FC\u304C\u5B58\u5728\u3057\u307E\u305B\u3093\u3002
-incompatible-class = \u30D7\u30ED\u30D1\u30C6\u30A3''{0}''\u306B\u6307\u5B9A\u3057\u305F\u5024\u306F{1}\u306B\u30AD\u30E3\u30B9\u30C8\u3067\u304D\u307E\u305B\u3093\u3002
-
-start-document-not-called=startDocument\u30A4\u30D9\u30F3\u30C8\u304C\u30B9\u30ED\u30FC\u3055\u308C\u305F\u5F8C\u3001\u30D7\u30ED\u30D1\u30C6\u30A3"{0}"\u3092\u547C\u3073\u51FA\u3059\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059
-nullparameter="{0}"\u306E\u540D\u524D\u30D1\u30E9\u30E1\u30FC\u30BF\u304Cnull\u3067\u3059
-errorHandlerNotSet=\u8B66\u544A: \u691C\u8A3C\u306F\u30AA\u30F3\u306B\u306A\u3063\u3066\u3044\u307E\u3059\u304C\u3001org.xml.sax.ErrorHandler\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u5FC5\u8981\u3068\u3055\u308C\u3066\u3044\u308B\u30CF\u30F3\u30C9\u30E9\u306F\u3053\u306E\u30CF\u30F3\u30C9\u30E9\u3067\u306F\u306A\u3044\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002\u30D1\u30FC\u30B5\u30FC\u3067\u306F\u3001\u30C7\u30D5\u30A9\u30EB\u30C8\u306EErrorHandler\u3092\u4F7F\u7528\u3057\u3066\u6700\u521D\u306E{0}\u30A8\u30E9\u30FC\u304C\u51FA\u529B\u3055\u308C\u307E\u3059\u3002\u3053\u306E\u554F\u984C\u3092\u4FEE\u6B63\u3059\u308B\u306B\u306F\u3001''setErrorHandler''\u30E1\u30BD\u30C3\u30C9\u3092\u547C\u3073\u51FA\u3057\u3066\u304F\u3060\u3055\u3044\u3002
-errorHandlerDebugMsg=\u30A8\u30E9\u30FC: URI = "{0}"\u3001\u884C = "{1}"\u3001: {2}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_ko.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_ko.properties
deleted file mode 100644
index 6ca431a..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_ko.properties
+++ /dev/null
@@ -1,35 +0,0 @@
-# This file stores localized messages for the Xerces
-# SAX implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-
-BadMessageKey = \uBA54\uC2DC\uC9C0 \uD0A4\uC5D0 \uD574\uB2F9\uD558\uB294 \uC624\uB958 \uBA54\uC2DC\uC9C0\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
-FormatFailed = \uB2E4\uC74C \uBA54\uC2DC\uC9C0\uC758 \uD615\uC2DD\uC744 \uC9C0\uC815\uD558\uB294 \uC911 \uB0B4\uBD80 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4.\n
-
-# JAXP messages
-schema-not-supported = \uC9C0\uC815\uB41C \uC2A4\uD0A4\uB9C8 \uC5B8\uC5B4\uB294 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
-jaxp-order-not-supported = ''{1}'' \uC18D\uC131\uC744 \uC124\uC815\uD558\uAE30 \uC804\uC5D0 ''{0}'' \uC18D\uC131\uC744 \uC124\uC815\uD574\uC57C \uD569\uB2C8\uB2E4.
-schema-already-specified = \uB110\uC774 \uC544\uB2CC \uC2A4\uD0A4\uB9C8 \uAC1D\uCCB4\uAC00 \uC774\uBBF8 \uC9C0\uC815\uB41C \uACBD\uC6B0 ''{0}'' \uC18D\uC131\uC744 \uC124\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
-
-# feature messages
-feature-not-supported = ''{0}'' \uAE30\uB2A5\uC740 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
-feature-not-recognized = ''{0}'' \uAE30\uB2A5\uC744 \uC778\uC2DD\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
-true-not-supported = ''{0}'' \uAE30\uB2A5\uC758 True \uC0C1\uD0DC\uB294 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
-false-not-supported = ''{0}'' \uAE30\uB2A5\uC758 False \uC0C1\uD0DC\uB294 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
-feature-read-only = ''{0}'' \uAE30\uB2A5\uC740 \uC77D\uAE30 \uC804\uC6A9\uC785\uB2C8\uB2E4.
-jaxp-secureprocessing-feature = FEATURE_SECURE_PROCESSING: \uBCF4\uC548 \uAD00\uB9AC\uC790\uAC00 \uC788\uC744 \uACBD\uC6B0 \uAE30\uB2A5\uC744 false\uB85C \uC124\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
-
-# property messages
-property-not-supported = ''{0}'' \uC18D\uC131\uC740 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
-property-not-recognized = ''{0}'' \uC18D\uC131\uC744 \uC778\uC2DD\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
-property-read-only = ''{0}'' \uC18D\uC131\uC740 \uC77D\uAE30 \uC804\uC6A9\uC785\uB2C8\uB2E4.
-property-not-parsing-supported = \uAD6C\uBB38 \uBD84\uC11D \uC911 ''{0}'' \uC18D\uC131\uC740 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
-dom-node-read-not-supported = DOM \uB178\uB4DC \uC18D\uC131\uC744 \uC77D\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. DOM \uD2B8\uB9AC\uAC00 \uC874\uC7AC\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
-incompatible-class = ''{0}'' \uC18D\uC131\uC5D0 \uB300\uD574 \uC9C0\uC815\uB41C \uAC12\uC758 \uB370\uC774\uD130\uD615\uC744 {1}(\uC73C)\uB85C \uBCC0\uD658\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
-
-start-document-not-called="{0}" \uC18D\uC131\uC740 startDocument \uC774\uBCA4\uD2B8\uAC00 \uBC1C\uC0DD\uB41C \uD6C4 \uD638\uCD9C\uD574\uC57C \uD569\uB2C8\uB2E4.
-nullparameter="{0}"\uC5D0 \uB300\uD55C \uC774\uB984 \uB9E4\uAC1C\uBCC0\uC218\uAC00 \uB110\uC785\uB2C8\uB2E4.
-errorHandlerNotSet=\uACBD\uACE0: \uAC80\uC99D\uC774 \uC124\uC815\uB418\uC5C8\uC9C0\uB9CC org.xml.sax.ErrorHandler\uAC00 \uC801\uC808\uD788 \uC124\uC815\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4. \uAD6C\uBB38 \uBD84\uC11D\uAE30\uAC00 \uAE30\uBCF8 ErrorHandler\uB97C \uC0AC\uC6A9\uD558\uC5EC \uCC98\uC74C {0}\uAC1C\uC758 \uC624\uB958\uB97C \uC778\uC1C4\uD569\uB2C8\uB2E4. \uC774 \uC624\uB958\uB97C \uC218\uC815\uD558\uB824\uBA74 ''setErrorHandler'' \uBA54\uC18C\uB4DC\uB97C \uD638\uCD9C\uD558\uC2ED\uC2DC\uC624.
-errorHandlerDebugMsg=\uC624\uB958: URI = "{0}", \uD589 = "{1}", : {2}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_pt_BR.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_pt_BR.properties
deleted file mode 100644
index af18d61..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_pt_BR.properties
+++ /dev/null
@@ -1,35 +0,0 @@
-# This file stores localized messages for the Xerces
-# SAX implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-
-BadMessageKey = N\u00E3o foi poss\u00EDvel encontrar a mensagem de erro correspondente \u00E0 chave da mensagem.
-FormatFailed = Ocorreu um erro interno ao formatar a mensagem a seguir:\n
-
-# JAXP messages
-schema-not-supported = O idioma do esquema especificado n\u00E3o \u00E9 suportado.
-jaxp-order-not-supported = A propriedade ''{0}'' deve ser definida antes da defini\u00E7\u00E3o da propriedade ''{1}''.
-schema-already-specified = A propriedade ''{0}'' n\u00E3o pode ser definida quando um objeto do Esquema n\u00E3o nulo j\u00E1 tiver sido especificado.
-
-# feature messages
-feature-not-supported = O recurso ''{0}'' n\u00E3o \u00E9 suportado.
-feature-not-recognized = O recurso ''{0}'' n\u00E3o \u00E9 reconhecido.
-true-not-supported = Estado verdadeiro do recurso ''{0}'' n\u00E3o suportado.
-false-not-supported = Estado falso do recurso ''{0}'' n\u00E3o suportado.
-feature-read-only = O recurso ''{0}'' \u00E9 somente para leitura.
-jaxp-secureprocessing-feature = FEATURE_SECURE_PROCESSING: N\u00E3o \u00E9 poss\u00EDvel definir o recurso como falso quando o gerenciador de seguran\u00E7a est\u00E1 presente.
-
-# property messages
-property-not-supported = A propriedade ''{0}'' n\u00E3o \u00E9 suportada.
-property-not-recognized = A propriedade ''{0}'' n\u00E3o \u00E9 reconhecida.
-property-read-only = A propriedade ''{0}'' \u00E9 somente para leitura.
-property-not-parsing-supported = A propriedade ''{0}'' n\u00E3o \u00E9 suportada durante o parsing.
-dom-node-read-not-supported = N\u00E3o \u00E9 poss\u00EDvel ler a propriedade do n\u00F3 de DOM. N\u00E3o existe uma \u00E1rvore de DOM.
-incompatible-class = O valor especificado para a propriedade ''{0}'' n\u00E3o pode ser transmitido para ''{1}''.
-
-start-document-not-called=A propriedade "{0}" deve ser chamada ap\u00F3s o evento startDocument ser lan\u00E7ado
-nullparameter=o par\u00E2metro de nome de "{0}" \u00E9 nulo
-errorHandlerNotSet=Advert\u00EAncia: A valida\u00E7\u00E3o foi ativada, mas um org.xml.sax.ErrorHandler n\u00E3o foi definido, provavelmente porque n\u00E3o era necess\u00E1rio. O parser usar\u00E1 um ErrorHandler padr\u00E3o para imprimir os primeiros {0} erros. Chame o m\u00E9todo ''setErrorHandler'' para corrigir o problema.
-errorHandlerDebugMsg=Erro: URI = "{0}", Linha = "{1}", : {2}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_sv.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_sv.properties
deleted file mode 100644
index f7634f2..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_sv.properties
+++ /dev/null
@@ -1,35 +0,0 @@
-# This file stores localized messages for the Xerces
-# SAX implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-
-BadMessageKey = Hittar inte felmeddelandet som motsvarar meddelandenyckeln.
-FormatFailed = Ett internt fel intr\u00E4ffade vid formatering av f\u00F6ljande meddelande:\n
-
-# JAXP messages
-schema-not-supported = Angivet schemaspr\u00E5k st\u00F6ds inte.
-jaxp-order-not-supported = Egenskapen ''{0}'' m\u00E5ste anges f\u00F6re inst\u00E4llning av egenskapen ''{1}''.
-schema-already-specified = Egenskapen ''{0}'' kan inte anges om ett Schema-objekt som \u00E4r icke-null redan har angetts.
-
-# feature messages
-feature-not-supported = Funktionen ''{0}'' st\u00F6ds inte.
-feature-not-recognized = Funktionen ''{0}'' \u00E4r ok\u00E4nd.
-true-not-supported = True-tillst\u00E5nd f\u00F6r funktionen ''{0}'' st\u00F6ds inte.
-false-not-supported = False-tillst\u00E5nd f\u00F6r funktionen ''{0}'' st\u00F6ds inte.
-feature-read-only = Funktionen ''{0}'' \u00E4r skrivskyddad.
-jaxp-secureprocessing-feature = FEATURE_SECURE_PROCESSING: Funktionen kan inte anges till false om s\u00E4kerhetshanteraren anv\u00E4nds.
-
-# property messages
-property-not-supported = Egenskapen ''{0}'' st\u00F6ds inte.
-property-not-recognized = Egenskapen ''{0}'' \u00E4r ok\u00E4nd.
-property-read-only = Egenskapen ''{0}'' \u00E4r skrivskyddad.
-property-not-parsing-supported = Egenskapen ''{0}'' st\u00F6ds inte vid tolkning.
-dom-node-read-not-supported = Kan inte l\u00E4sa egenskap f\u00F6r DOM-nod. Det finns inget DOM-tr\u00E4d.
-incompatible-class = V\u00E4rdet angivet f\u00F6r egenskapen ''{0}'' kan inte omvandlas till {1}.
-
-start-document-not-called=Egenskapen "{0}" b\u00F6r anropas efter startDocument-h\u00E4ndelsen utl\u00F6ses
-nullparameter=namnparametern f\u00F6r "{0}" \u00E4r null
-errorHandlerNotSet=Varning: valideringen startades, men det fanns ingen angiven org.xml.sax.ErrorHandler. Parser anv\u00E4nder ErrorHandler av standardtyp vid utskrift av de f\u00F6rsta {0} felen. Korrigera felet genom anrop av setErrorHandler-metoden.
-errorHandlerDebugMsg=Fel: URI = "{0}", Rad = "{1}", : {2}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_zh_CN.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_zh_CN.properties
deleted file mode 100644
index 3b5a5bc..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_zh_CN.properties
+++ /dev/null
@@ -1,35 +0,0 @@
-# This file stores localized messages for the Xerces
-# SAX implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-
-BadMessageKey = \u627E\u4E0D\u5230\u4E0E\u6D88\u606F\u5173\u952E\u5B57\u5BF9\u5E94\u7684\u9519\u8BEF\u6D88\u606F\u3002
-FormatFailed = \u8BBE\u7F6E\u4EE5\u4E0B\u6D88\u606F\u7684\u683C\u5F0F\u65F6\u51FA\u73B0\u5185\u90E8\u9519\u8BEF:\n
-
-# JAXP messages
-schema-not-supported = \u4E0D\u652F\u6301\u6307\u5B9A\u7684\u65B9\u6848\u8BED\u8A00\u3002
-jaxp-order-not-supported = \u5FC5\u987B\u5728\u8BBE\u7F6E\u5C5E\u6027 ''{1}'' \u4E4B\u524D\u8BBE\u7F6E\u5C5E\u6027 ''{0}''\u3002
-schema-already-specified = \u65E0\u6CD5\u5728\u6307\u5B9A\u4E86\u975E\u7A7A Schema \u5BF9\u8C61\u7684\u60C5\u51B5\u4E0B\u8BBE\u7F6E\u5C5E\u6027 ''{0}''\u3002
-
-# feature messages
-feature-not-supported = \u4E0D\u652F\u6301\u529F\u80FD ''{0}''\u3002
-feature-not-recognized = \u65E0\u6CD5\u8BC6\u522B\u529F\u80FD ''{0}''\u3002
-true-not-supported = \u4E0D\u652F\u6301\u529F\u80FD ''{0}'' \u7684\u201C\u771F\u201D\u72B6\u6001\u3002
-false-not-supported = \u4E0D\u652F\u6301\u529F\u80FD ''{0}'' \u7684\u201C\u5047\u201D\u72B6\u6001\u3002
-feature-read-only = \u529F\u80FD ''{0}'' \u4E3A\u53EA\u8BFB\u3002
-jaxp-secureprocessing-feature = FEATURE_SECURE_PROCESSING: \u5B58\u5728 Security Manager \u65F6, \u65E0\u6CD5\u5C06\u6B64\u529F\u80FD\u8BBE\u7F6E\u4E3A\u201C\u5047\u201D\u3002
-
-# property messages
-property-not-supported = \u4E0D\u652F\u6301\u5C5E\u6027 ''{0}''\u3002
-property-not-recognized = \u65E0\u6CD5\u8BC6\u522B\u5C5E\u6027 ''{0}''\u3002
-property-read-only = \u5C5E\u6027 ''{0}'' \u4E3A\u53EA\u8BFB\u3002
-property-not-parsing-supported = \u89E3\u6790\u65F6\u4E0D\u652F\u6301\u5C5E\u6027 ''{0}''\u3002
-dom-node-read-not-supported = \u65E0\u6CD5\u8BFB\u53D6 DOM \u8282\u70B9\u5C5E\u6027\u3002\u4E0D\u5B58\u5728 DOM \u6811\u3002
-incompatible-class = \u4E3A\u5C5E\u6027 ''{0}'' \u6307\u5B9A\u7684\u503C\u4E0D\u80FD\u8F6C\u6362\u4E3A{1}\u3002
-
-start-document-not-called=\u5E94\u5728\u629B\u51FA startDocument \u4E8B\u4EF6\u540E\u8C03\u7528\u5C5E\u6027 "{0}"
-nullparameter="{0}" \u7684\u540D\u79F0\u53C2\u6570\u4E3A\u7A7A\u503C
-errorHandlerNotSet=\u8B66\u544A: \u5DF2\u542F\u7528\u9A8C\u8BC1, \u4F46\u672A\u8BBE\u7F6E org.xml.sax.ErrorHandler, \u8FD9\u53EF\u80FD\u4E0D\u662F\u9884\u671F\u7ED3\u679C\u3002\u89E3\u6790\u5668\u5C06\u4F7F\u7528\u9ED8\u8BA4 ErrorHandler \u6765\u8F93\u51FA\u524D {0} \u4E2A\u9519\u8BEF\u3002\u8BF7\u8C03\u7528 ''setErrorHandler'' \u65B9\u6CD5\u4EE5\u89E3\u51B3\u6B64\u95EE\u9898\u3002
-errorHandlerDebugMsg=\u9519\u8BEF: URI = "{0}", \u884C = "{1}", : {2}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_zh_TW.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_zh_TW.properties
deleted file mode 100644
index 0b75d65..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_zh_TW.properties
+++ /dev/null
@@ -1,35 +0,0 @@
-# This file stores localized messages for the Xerces
-# SAX implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-
-BadMessageKey = \u627E\u4E0D\u5230\u5C0D\u61C9\u8A0A\u606F\u7D22\u5F15\u9375\u7684\u932F\u8AA4\u8A0A\u606F\u3002
-FormatFailed = \u683C\u5F0F\u5316\u4E0B\u5217\u8A0A\u606F\u6642\u767C\u751F\u5167\u90E8\u932F\u8AA4:\n
-
-# JAXP messages
-schema-not-supported = \u4E0D\u652F\u63F4\u6307\u5B9A\u7684\u7DB1\u8981\u8A9E\u8A00\u3002
-jaxp-order-not-supported = \u8A2D\u5B9A\u5C6C\u6027 ''{1}'' \u4E4B\u524D\uFF0C\u5FC5\u9808\u8A2D\u5B9A\u5C6C\u6027 ''{0}''\u3002
-schema-already-specified = \u5DF2\u7D93\u6307\u5B9A\u975E\u7A7A\u503C\u7DB1\u8981\u7269\u4EF6\u6642\uFF0C\u7121\u6CD5\u8A2D\u5B9A\u5C6C\u6027 ''{0}''\u3002
-
-# feature messages
-feature-not-supported = \u4E0D\u652F\u63F4\u529F\u80FD ''{0}''\u3002
-feature-not-recognized = \u7121\u6CD5\u8FA8\u8B58\u529F\u80FD ''{0}''\u3002
-true-not-supported = \u4E0D\u652F\u63F4\u529F\u80FD ''{0}'' \u7684\u771F\u72C0\u614B\u3002
-false-not-supported = \u4E0D\u652F\u63F4\u529F\u80FD ''{0}'' \u7684\u507D\u72C0\u614B\u3002
-feature-read-only = \u529F\u80FD ''{0}'' \u70BA\u552F\u8B80\u3002
-jaxp-secureprocessing-feature = FEATURE_SECURE_PROCESSING: \u5B89\u5168\u7BA1\u7406\u7A0B\u5F0F\u5B58\u5728\u6642\uFF0C\u7121\u6CD5\u5C07\u529F\u80FD\u8A2D\u70BA\u507D\u3002
-
-# property messages
-property-not-supported = \u4E0D\u652F\u63F4\u5C6C\u6027 ''{0}''\u3002
-property-not-recognized = \u7121\u6CD5\u8FA8\u8B58\u5C6C\u6027 ''{0}''\u3002
-property-read-only = \u5C6C\u6027 ''{0}'' \u70BA\u552F\u8B80\u3002
-property-not-parsing-supported = \u5256\u6790\u6642\u4E0D\u652F\u63F4\u5C6C\u6027 ''{0}''\u3002
-dom-node-read-not-supported = \u7121\u6CD5\u8B80\u53D6 DOM \u7BC0\u9EDE\u5C6C\u6027\u3002DOM \u6A39\u72C0\u7D50\u69CB\u4E0D\u5B58\u5728\u3002
-incompatible-class = \u70BA\u5C6C\u6027 ''{0}'' \u6307\u5B9A\u7684\u503C\u4E0D\u53EF\u8F49\u63DB\u70BA {1}\u3002
-
-start-document-not-called=\u767C\u751F startDocument \u4E8B\u4EF6\u4E4B\u5F8C\uFF0C\u61C9\u547C\u53EB\u5C6C\u6027 "{0}"\u3002
-nullparameter="{0}" \u7684\u540D\u7A31\u53C3\u6578\u70BA\u7A7A\u503C
-errorHandlerNotSet=\u8B66\u544A: \u5DF2\u958B\u555F\u9A57\u8B49\uFF0C\u4F46\u662F\u672A\u8A2D\u5B9A org.xml.sax.ErrorHandler\uFF0C\u9019\u53EF\u80FD\u4E0D\u662F\u6240\u8981\u7684\u72C0\u614B\u3002\u5256\u6790\u5668\u5C07\u4F7F\u7528\u9810\u8A2D\u7684 ErrorHandler \u4F86\u5217\u5370\u7B2C\u4E00\u500B {0} \u932F\u8AA4\u3002\u8ACB\u547C\u53EB ''setErrorHandler'' \u65B9\u6CD5\u4F86\u4FEE\u6B63\u6B64\u554F\u984C\u3002
-errorHandlerDebugMsg=\u932F\u8AA4: URI = "{0}"\uFF0C\u884C = "{1}"\uFF0C: {2}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages.properties
deleted file mode 100644
index ea35c9e..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages.properties
+++ /dev/null
@@ -1,36 +0,0 @@
-# Messages for message reporting
-BadMessageKey = The error message corresponding to the message key can not be found.
-FormatFailed = An internal error occurred while formatting the following message:\n
-
-# Messages for erroneous input
-NoFallback = An 'include' with href ''{0}''failed, and no 'fallback' element was found.
-MultipleFallbacks = The [children] of an 'include' element cannot contain more than one 'fallback' element.
-FallbackParent = A 'fallback' element was found that did not have 'include' as the parent.
-IncludeChild = Elements from namespace ''http://www.w3.org/2001/XInclude'', other than ''fallback'', are not allowed to be children of ''include'' elements. However, ''{0}'' was found.
-FallbackChild = Elements from namespace ''http://www.w3.org/2001/XInclude'', other than ''include'', are not allowed to be children of ''fallback'' elements. However, ''{0}'' was found.
-HrefMissing = The 'href' attribute of an 'include' element is missing.
-RecursiveInclude = Recursive include detected. Document ''{0}'' was already processed.
-InvalidParseValue = Invalid value for ''parse'' attribute on ''include'' element: ''{0}''.
-XMLParseError = Error attempting to parse XML file (href=''{0}''). Reason: {1}
-XMLResourceError = Include operation failed, reverting to fallback. Resource error reading file as XML (href=''{0}''). Reason: {1}
-TextResourceError = Include operation failed, reverting to fallback. Resource error reading file as text (href=''{0}''). Reason: {1}
-NO_XPointerSchema = Schema for \"{0}\" is not supported by default. Define your own schema for {0}.See http://apache.org/xml/properties/xpointer-schema
-NO_SubResourceIdentified = No Subresource is identified by the XPointer Processor for Pointer {0}.
-NonDuplicateNotation = Multiple notations were used which had the name ''{0}'', but which were not determined to be duplicates.
-NonDuplicateUnparsedEntity = Multiple unparsed entities were used which had the name ''{0}'', but which were not determined to be duplicates.
-XpointerMissing = xpointer attribute must be present when href attribute is absent.
-AcceptMalformed = Characters outside the range #x20 through #x7E are not allowed in the value of the 'accept' attribute of an 'include' element.
-AcceptLanguageMalformed = Characters outside the range #x20 through #x7E are not allowed in the value of the 'accept-language' attribute of an 'include' element.
-RootElementRequired = A well-formed document requires a root element.
-MultipleRootElements = A well-formed document must not contain multiple root elements.
-ContentIllegalAtTopLevel = The replacement of an 'include' element appearing as the document element in the top-level source infoset cannot contain characters.
-UnexpandedEntityReferenceIllegal = The replacement of an 'include' element appearing as the document element in the top-level source infoset cannot contain unexpanded entity references.
-HrefFragmentIdentifierIllegal = Fragment identifiers must not be used. The ''href'' attribute value ''{0}'' is not permitted.
-HrefSyntacticallyInvalid = ''href'' attribute value ''{0}'' is syntactically invalid. After applying escaping rules the value is neither a syntactically correct URI or IRI.
-XPointerStreamability = An xpointer was specified that points to a location in the source infoset. This location cannot be accessed due to the streaming nature of the processor.
-
-XPointerResolutionUnsuccessful = XPointer resolution unsuccessful.
-
-# Messages from erroneous set-up
-IncompatibleNamespaceContext = The type of the NamespaceContext is incompatible with using XInclude; it must be an instance of XIncludeNamespaceSupport
-ExpandedSystemId = Could not expand system id of included resource
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_de.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_de.properties
deleted file mode 100644
index a4ada7f..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_de.properties
+++ /dev/null
@@ -1,36 +0,0 @@
-# Messages for message reporting
-BadMessageKey = Die zum Meldungsschl\u00FCssel geh\u00F6rige Fehlermeldung kann nicht gefunden werden.
-FormatFailed = Beim Formatieren der folgenden Meldung ist ein interner Fehler aufgetreten:\n
-
-# Messages for erroneous input
-NoFallback = "include" mit href "{0}" nicht erfolgreich, und es wurde kein "fallback"-Element gefunden.
-MultipleFallbacks = Die [untergeordneten Elemente] eines "include"-Elements k\u00F6nnen nicht mehrere "fallback"-Elemente enthalten.
-FallbackParent = Ein "fallback"-Element wurde gefunden, f\u00FCr das "include" nicht das \u00FCbergeordnete Element war.
-IncludeChild = Andere Elemente aus Namespace "http://www.w3.org/2001/XInclude" als "fallback" d\u00FCrfen keine untergeordneten Elemente von "include"-Elementen sein. Es wurde aber "{0}" gefunden.
-FallbackChild = Andere Elemente aus Namespace "http://www.w3.org/2001/XInclude" als "include" d\u00FCrfen keine untergeordneten Elemente von "fallback"-Elementen sein. Es wurde aber "{0}" gefunden.
-HrefMissing = "href"-Attribut eines "include"-Elements fehlt.
-RecursiveInclude = Rekursives "include" ermittelt. Dokument "{0}" wurde bereits verarbeitet.
-InvalidParseValue = Ung\u00FCltiger Wert f\u00FCr "parse"-Attribut bei "include"-Element: "{0}".
-XMLParseError = Fehler beim Versuch, XML-Datei zu parsen (href=''{0}''). Ursache: {1}
-XMLResourceError = Include-Vorgang nicht erfolgreich. Zur\u00FCck zu Fallback. Ressourcenfehler beim Lesen der Datei als XML (href="{0}"). Grund: {1}
-TextResourceError = Include-Vorgang nicht erfolgreich. Zur\u00FCck zu Fallback. Ressourcenfehler beim Lesen der Datei als Text (href="{0}"). Grund: {1}
-NO_XPointerSchema = Schema f\u00FCr "{0}" wird standardm\u00E4\u00DFig nicht unterst\u00FCtzt. Definieren Sie Ihr eigenes Schema f\u00FCr {0}. Siehe http://apache.org/xml/properties/xpointer-schema
-NO_SubResourceIdentified = Keine Subressource von XPointer-Prozessor f\u00FCr Zeiger {0} identifiziert.
-NonDuplicateNotation = Mehrere Notationen mit dem Namen "{0}" wurden verwendet, die aber nicht als Duplikate ermittelt wurden.
-NonDuplicateUnparsedEntity = Mehrere nicht geparste Entitys mit dem Namen "{0}" wurden verwendet, die aber nicht als Duplikate ermittelt wurden.
-XpointerMissing = xpointer-Attribut muss vorhanden sein, wenn href-Attribut fehlt.
-AcceptMalformed = Zeichen au\u00DFerhalb des Bereichs #x20 bis #x7E sind im Wert des "accept"-Attributs eines "include"-Elements nicht zul\u00E4ssig.
-AcceptLanguageMalformed = Zeichen au\u00DFerhalb des Bereichs #x20 bis #x7E sind im Wert des "accept-language"-Attributs eines "include"-Elements nicht zul\u00E4ssig.
-RootElementRequired = F\u00FCr ein ordnungsgem\u00E4\u00DF formatiertes Dokument ist ein Root-Element erforderlich.
-MultipleRootElements = Ein ordnungsgem\u00E4\u00DF formatiertes Dokument darf nicht mehrere Root-Elemente enthalten.
-ContentIllegalAtTopLevel = Der Ersatz eines "include"-Elements, das als Dokumentelement im Quell-Infoset der obersten Ebene angezeigt wird, darf keine Zeichen enthalten.
-UnexpandedEntityReferenceIllegal = Der Ersatz eines "include"-Elements, das als Dokumentelement im Quell-Infoset der obersten Ebene angezeigt wird, darf keine nicht erweiterten Entityreferenzen enthalten.
-HrefFragmentIdentifierIllegal = Fragment-IDs d\u00FCrfen nicht verwendet werden. Der "href"-Attributwert "{0}" ist nicht zul\u00E4ssig.
-HrefSyntacticallyInvalid = "href"-Attributwert "{0}" hat eine ung\u00FCltige Syntax. Nach Anwenden der Escape-Regeln ist der Wert kein syntaktisch korrekter URI oder IRI.
-XPointerStreamability = Es wurde ein xpointer angegeben, der auf eine Stelle im Quell-Infoset verweist. Auf diese Stelle kann aufgrund des Streamingcharakters des Prozessors nicht zugegriffen werden.
-
-XPointerResolutionUnsuccessful = XPointer-Aufl\u00F6sung nicht erfolgreich.
-
-# Messages from erroneous set-up
-IncompatibleNamespaceContext = Typ des NamespaceContext ist nicht mit der Verwendung von XInclude kompatibel. Muss eine Instanz von XIncludeNamespaceSupport sein
-ExpandedSystemId = System-ID der aufgenommenen Ressource konnte nicht erweitert werden
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_es.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_es.properties
deleted file mode 100644
index 4332c15..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_es.properties
+++ /dev/null
@@ -1,36 +0,0 @@
-# Messages for message reporting
-BadMessageKey = No se ha encontrado el mensaje de error correspondiente a la clave de mensaje.
-FormatFailed = Se ha producido un error interno al formatear el siguiente mensaje:\n
-
-# Messages for erroneous input
-NoFallback = Ha fallado un elemento ''include'' con href ''{0}'' y no se ha encontrado ning\u00FAn elemento ''fallback''.
-MultipleFallbacks = Los [secundarios] de un elemento 'include' no pueden contener m\u00E1s de un elemento 'fallback'.
-FallbackParent = Se ha encontrado un elemento 'fallback' que no ten\u00EDa un elemento 'include' como principal.
-IncludeChild = No se permite que los elementos del espacio de nombres ''http://www.w3.org/2001/XInclude'', distintos de los elementos ''fallback'' sean secundarios de los elementos ''include''. Sin embargo, se ha encontrado ''{0}''.
-FallbackChild = No se permite que los elementos del espacio de nombres ''http://www.w3.org/2001/XInclude'', distintos de los elementos ''include'' sean secundarios de los elementos ''fallback''. Sin embargo, se ha encontrado ''{0}''.
-HrefMissing = Falta el atributo 'href' de un elemento 'include'.
-RecursiveInclude = Se ha detectado un elemento include recursivo. El documento ''{0}'' ya se ha procesado.
-InvalidParseValue = Valor no v\u00E1lido para el atributo ''parse'' en el elemento ''include'': ''{0}''.
-XMLParseError = Error al intentar analizar el archivo XML (href=''{0}''). Motivo: {1}
-XMLResourceError = Fallo de la operaci\u00F3n include, conversi\u00F3n a fallback. Error del recurso al leer el archivo como XML (href=''{0}''). Motivo: {1}
-TextResourceError = Fallo de la operaci\u00F3n include, conversi\u00F3n a fallback. Error del recurso al leer el archivo como texto (href=''{0}''). Motivo: {1}
-NO_XPointerSchema = El esquema para "{0}" no est\u00E1 soportado por defecto. Defina su propio esquema para {0}. Consulte http://apache.org/xml/properties/xpointer-schema
-NO_SubResourceIdentified = El procesador XPointer no ha identificado el subrecurso para el puntero {0}.
-NonDuplicateNotation = Se han utilizado varias notaciones con el nombre''{0}'', pero no se ha determinado que sean duplicados.
-NonDuplicateUnparsedEntity = Se han utilizado varias entidades no analizadas con el nombre''{0}'', pero no se ha determinado que sean duplicados.
-XpointerMissing = el atributo xpointer debe estar presente cuando el atributo href est\u00E9 ausente.
-AcceptMalformed = Los caracteres fuera del rango de #x20 a #x7E no est\u00E1n permitidos en el valor del atributo 'accept' de un elemento 'include'.
-AcceptLanguageMalformed = Los caracteres fuera del rango #x20 through #x7E no est\u00E1n permitidos en el valor del atributo 'accept-language' de un elemento 'include'.
-RootElementRequired = Un documento con formato correcto necesita un elemento ra\u00EDz.
-MultipleRootElements = Un documento con formato correcto no debe contener varios elementos ra\u00EDz.
-ContentIllegalAtTopLevel = La sustituci\u00F3n de un elemento 'include' que aparece como el elemento de documento en el juego de informaci\u00F3n de origen de nivel superior no puede contener caracteres.
-UnexpandedEntityReferenceIllegal = La sustituci\u00F3n de un elemento 'include' que aparece como el elemento de documento en el juego de informaci\u00F3n de origen de nivel superior no puede contener referencias de entidad no ampliadas.
-HrefFragmentIdentifierIllegal = Los identificadores de fragmento no deben utilizarse. El valor del atributo ''href'' ''{0}'' no est\u00E1 permitido.
-HrefSyntacticallyInvalid = El valor del atributo ''href'' ''{0}'' no es v\u00E1lido sint\u00E1cticamente. Despu\u00E9s de aplicar las reglas de escape, el valor no es un URI ni un IRI sint\u00E1cticamente correctos.
-XPointerStreamability = Se ha especificado un xpointer que apunta a una ubicaci\u00F3n en el juego de informaci\u00F3n de origen. No se puede acceder a esta ubicaci\u00F3n debido a la naturaleza de flujo del procesador.
-
-XPointerResolutionUnsuccessful = Resoluci\u00F3n de XPointer incorrecta.
-
-# Messages from erroneous set-up
-IncompatibleNamespaceContext = El tipo de NamespaceContext es incompatible con el uso de XInclude; debe ser una instancia de XIncludeNamespaceSupport
-ExpandedSystemId = No se ha podido ampliar el identificador del sistema del recurso incluido
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_fr.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_fr.properties
deleted file mode 100644
index 96ef912..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_fr.properties
+++ /dev/null
@@ -1,36 +0,0 @@
-# Messages for message reporting
-BadMessageKey = Le message d'erreur correspondant \u00E0 la cl\u00E9 de message est introuvable.
-FormatFailed = Une erreur interne est survenue lors du formatage du message suivant :\n
-
-# Messages for erroneous input
-NoFallback = Echec d''un \u00E9l\u00E9ment ''include'' avec l''attribut href ''{0}'' ; aucun \u00E9l\u00E9ment ''fallback'' n''a \u00E9t\u00E9 trouv\u00E9.
-MultipleFallbacks = Les [enfants] d'un \u00E9l\u00E9ment 'include' ne doivent pas contenir plusieurs \u00E9l\u00E9ments 'fallback'.
-FallbackParent = Un \u00E9l\u00E9ment 'fallback' n'ayant pas l'\u00E9l\u00E9ment 'include' comme parent \u00E9t\u00E9 trouv\u00E9.
-IncludeChild = Les \u00E9l\u00E9ments de l''espace de noms ''http://www.w3.org/2001/XInclude'', autres que ''fallback'', ne peuvent pas \u00EAtre des enfants des \u00E9l\u00E9ments ''include''. Cependant, ''{0}'' a \u00E9t\u00E9 trouv\u00E9.
-FallbackChild = Les \u00E9l\u00E9ments de l''espace de noms ''http://www.w3.org/2001/XInclude'', autres que ''include'', ne peuvent pas \u00EAtre des enfants des \u00E9l\u00E9ments ''fallback''. Cependant, ''{0}'' a \u00E9t\u00E9 trouv\u00E9.
-HrefMissing = L'attribut 'href' d'un \u00E9l\u00E9ment 'include' est manquant.
-RecursiveInclude = El\u00E9ment "include" r\u00E9cursif d\u00E9tect\u00E9. Le document ''{0}'' a d\u00E9j\u00E0 \u00E9t\u00E9 trait\u00E9.
-InvalidParseValue = Valeur non valide pour l''attribut ''parse'' sur l''\u00E9l\u00E9ment ''include'' : ''{0}''.
-XMLParseError = Erreur lors de la tentative d''analyse du fichier XML (href=''{0}''). Raison : {1}
-XMLResourceError = Echec de l''op\u00E9ration Include, r\u00E9tablissement de l''\u00E9l\u00E9ment fallback. Erreur de ressource lors de la lecture du fichier en tant que XML (href=''{0}''). Raison : {1}
-TextResourceError = Echec de l''op\u00E9ration Include, r\u00E9tablissement de l''\u00E9l\u00E9ment fallback. Erreur de ressource lors de la lecture du fichier en tant que texte (href=''{0}''). Raison : {1}
-NO_XPointerSchema = Par d\u00E9faut, le sch\u00E9ma pour "{0}" n''est pas pris en charge. D\u00E9finissez votre propre sch\u00E9ma pour {0}. Reportez-vous \u00E0 l''adresse http://apache.org/xml/properties/xpointer-schema
-NO_SubResourceIdentified = Aucune sous-ressource n''est identifi\u00E9e par le processeur XPointer pour le pointeur {0}.
-NonDuplicateNotation = Plusieurs notations portant le nom ''{0}'' ont \u00E9t\u00E9 utilis\u00E9es, mais elles n''ont pas \u00E9t\u00E9 consid\u00E9r\u00E9es comme des doublons.
-NonDuplicateUnparsedEntity = Plusieurs entit\u00E9s non analys\u00E9es portant le nom ''{0}'' ont \u00E9t\u00E9 utilis\u00E9es, mais elles n''ont pas \u00E9t\u00E9 consid\u00E9r\u00E9es comme des doublons.
-XpointerMissing = l'attribut xpointer doit \u00EAtre pr\u00E9sent lorsque l'attribut href est absent.
-AcceptMalformed = Les caract\u00E8res non compris entre #x20 et #x7E ne sont pas autoris\u00E9s comme valeur de l'attribut 'accept' d'un \u00E9l\u00E9ment 'include'.
-AcceptLanguageMalformed = Les caract\u00E8res non compris entre #x20 et #x7E ne sont pas autoris\u00E9s comme valeur de l'attribut 'accept-language' d'un \u00E9l\u00E9ment 'include'.
-RootElementRequired = Un document dont le format est correct requiert un \u00E9l\u00E9ment racine.
-MultipleRootElements = Un document dont le format est correct ne doit pas contenir plusieurs \u00E9l\u00E9ments racine.
-ContentIllegalAtTopLevel = Le remplacement d'un \u00E9l\u00E9ment 'include' affich\u00E9 en tant qu'\u00E9l\u00E9ment de document dans l'ensemble d'information source de niveau sup\u00E9rieur ne doit pas contenir de caract\u00E8res.
-UnexpandedEntityReferenceIllegal = Le remplacement d'un \u00E9l\u00E9ment 'include' affich\u00E9 en tant qu'\u00E9l\u00E9ment de document dans l'ensemble d'information source de niveau sup\u00E9rieur ne doit pas contenir de r\u00E9f\u00E9rences d'entit\u00E9 non d\u00E9velopp\u00E9es.
-HrefFragmentIdentifierIllegal = Les identificateurs de fragment ne doivent pas \u00EAtre utilis\u00E9s. La valeur d''attribut ''href'' ''{0}'' n''est pas autoris\u00E9e.
-HrefSyntacticallyInvalid = La syntaxe de la valeur d''attribut ''href'' ''{0}'' est incorrecte. Apr\u00E8s l''application des r\u00E8gles d''\u00E9chappement, la valeur n''est pas un URI ou un IRI exprim\u00E9 dans une syntaxe correcte.
-XPointerStreamability = Un XPointer pointant sur un emplacement de l'ensemble d'information source a \u00E9t\u00E9 indiqu\u00E9. Cet emplacement est inaccessible en raison des caract\u00E9ristiques de transmission en continu du processeur.
-
-XPointerResolutionUnsuccessful = Echec de la r\u00E9solution de XPointer.
-
-# Messages from erroneous set-up
-IncompatibleNamespaceContext = Le type de l'\u00E9l\u00E9ment NamespaceContext n'est pas compatible avec l'utilisation de l'\u00E9l\u00E9ment XInclude ; il doit s'agir d'une instance de XIncludeNamespaceSupport
-ExpandedSystemId = Impossible de d\u00E9velopper l'ID syst\u00E8me de la ressource incluse
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_it.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_it.properties
deleted file mode 100644
index 198fe5b..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_it.properties
+++ /dev/null
@@ -1,36 +0,0 @@
-# Messages for message reporting
-BadMessageKey = Impossibile trovare il messaggio di errore corrispondente alla chiave di messaggio.
-FormatFailed = Si \u00E8 verificato un errore interno durante la formattazione del seguente messaggio:\n
-
-# Messages for erroneous input
-NoFallback = Errore dell''elemento ''include'' con href ''{0}''. Non \u00E8 stato trovato alcune elemento ''fallback''.
-MultipleFallbacks = [children] di un elemento 'include' non possono contenere pi\u00F9 elementi 'fallback'.
-FallbackParent = \u00C8 stato trovato un elemento 'fallback' che non ha un elemento 'include' come padre.
-IncludeChild = Gli elementi dello spazio di nomi ''http://www.w3.org/2001/XInclude'' diversi da ''fallback'' non possono avere elementi figlio di elementi ''include''. Tuttavia, \u00E8 stato trovato ''{0}''.
-FallbackChild = Gli elementi dello spazio di nomi ''http://www.w3.org/2001/XInclude'' diversi da ''include'' non possono avere elementi figlio di elementi ''fallback''. Tuttavia, \u00E8 stato trovato ''{0}''.
-HrefMissing = Manca l'attributo 'href' di un elemento 'include'.
-RecursiveInclude = Inclusione ricorsiva rilevata. Il documento ''{0}'' \u00E8 gi\u00E0 stato elaborato.
-InvalidParseValue = Valore non valido per l''attributo ''parse'' nell''elemento ''include'': ''{0}''.
-XMLParseError = Errore durante il tentativo di analizzare il file XML (href=''{0}''). Causa: {1}
-XMLResourceError = Operazione di inclusione non riuscita. Verr\u00E0 ripristinato il fallback. Errore di risorsa durante la lettura del file come XML (href=''{0}''). Motivo: {1}
-TextResourceError = Operazione di inclusione non riuscita. Verr\u00E0 ripristinato il fallback. Errore di risorsa durante la lettura del file come testo (href=''{0}''). Motivo: {1}
-NO_XPointerSchema = Lo schema per "{0}" non \u00E8 supportato per impostazione predefinita. Definire il proprio schema per {0}. Vedere http://apache.org/xml/properties/xpointer-schema.
-NO_SubResourceIdentified = Nessuna risorsa secondaria identificata dal processore XPointer per il puntatore {0}.
-NonDuplicateNotation = Sono state utilizzate pi\u00F9 notazioni con il nome ''{0}'', ma \u00E8 stato determinato che non sono duplicati.
-NonDuplicateUnparsedEntity = Sono state utilizzate pi\u00F9 entit\u00E0 non analizzate con il nome ''{0}'', ma \u00E8 stato determinato che non sono duplicati.
-XpointerMissing = L'attributo xpointer deve essere presente se \u00E8 assente l'attributo href.
-AcceptMalformed = I caratteri che non rientrano tra #x20 e #x7E non sono consentiti nel valore dell'attributo 'accept' di un elemento 'include'.
-AcceptLanguageMalformed = I caratteri che non rientrano tra #x20 e #x7E non sono consentiti nel valore dell'attributo 'accept-language' di un elemento 'include'.
-RootElementRequired = Un documento con formato corretto richiede un elemento radice.
-MultipleRootElements = Un documento con formato corretto non deve contenere pi\u00F9 elementi radice.
-ContentIllegalAtTopLevel = La sostituzione di un elemento 'include' indicato come elemento di documento nel set di informazioni di origine nel livello superiore non pu\u00F2 contenere caratteri.
-UnexpandedEntityReferenceIllegal = La sostituzione di un elemento 'include' indicato come elemento di documento nel set di informazioni di origine nel livello superiore non pu\u00F2 contenere riferimenti di entit\u00E0 non espansi.
-HrefFragmentIdentifierIllegal = Non utilizzare gli identificativi di frammento. Il valore ''{0}'' dell''attributo ''href'' non \u00E8 consentito.
-HrefSyntacticallyInvalid = Il valore ''{0}'' dell''attributo ''href'' non \u00E8 valido a livello di sintassi. Dopo aver applicato le regole di escape, il valore non \u00E8 un URI o un IRI con sintassi corretta.
-XPointerStreamability = \u00C8 stato specificato un xpointer che punta a una posizione nel set di informazioni di origine. Non \u00E8 possibile accedere a questa posizione poich\u00E9 il processore \u00E8 di tipo streaming.
-
-XPointerResolutionUnsuccessful = Risoluzione di XPointer non riuscita.
-
-# Messages from erroneous set-up
-IncompatibleNamespaceContext = Il tipo di NamespaceContext non \u00E8 compatibile con l'uso di XInclude; deve essere un'istanza di XIncludeNamespaceSupport.
-ExpandedSystemId = Impossibile espandere l'ID di sistema della risorsa inclusa
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_ja.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_ja.properties
deleted file mode 100644
index 55abfda..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_ja.properties
+++ /dev/null
@@ -1,36 +0,0 @@
-# Messages for message reporting
-BadMessageKey = \u30E1\u30C3\u30BB\u30FC\u30B8\u30FB\u30AD\u30FC\u306B\u5BFE\u5FDC\u3059\u308B\u30A8\u30E9\u30FC\u30FB\u30E1\u30C3\u30BB\u30FC\u30B8\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002
-FormatFailed = \u6B21\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\u306E\u66F8\u5F0F\u8A2D\u5B9A\u4E2D\u306B\u5185\u90E8\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F:\n
-
-# Messages for erroneous input
-NoFallback = href ''{0}''\u3092\u542B\u3080''include''\u304C\u5931\u6557\u3057\u3001''fallback''\u8981\u7D20\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002
-MultipleFallbacks = 'include'\u8981\u7D20\u306E[children]\u306B\u306F\u3001\u8907\u6570\u306E'fallback'\u8981\u7D20\u3092\u542B\u3081\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002
-FallbackParent = \u89AA\u3068\u3057\u3066'include'\u3092\u6301\u305F\u306A\u3044'fallback'\u8981\u7D20\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002
-IncludeChild = \u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9''http://www.w3.org/2001/XInclude''\u304B\u3089\u306E\u8981\u7D20\u306F\u3001''fallback''\u3092\u9664\u3044\u3066\u3001''include''\u8981\u7D20\u306E\u5B50\u306B\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002\u305D\u308C\u306B\u3082\u304B\u304B\u308F\u3089\u305A\u3001''{0}''\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002
-FallbackChild = \u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9''http://www.w3.org/2001/XInclude''\u304B\u3089\u306E\u8981\u7D20\u306F\u3001''include''\u3092\u9664\u3044\u3066\u3001''fallback''\u8981\u7D20\u306E\u5B50\u306B\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002\u305D\u308C\u306B\u3082\u304B\u304B\u308F\u3089\u305A\u3001''{0}''\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002
-HrefMissing = 'include'\u8981\u7D20\u306E'href'\u5C5E\u6027\u304C\u3042\u308A\u307E\u305B\u3093\u3002
-RecursiveInclude = \u518D\u5E30\u7684\u306Ainclude\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F\u3002\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8''{0}''\u306F\u3059\u3067\u306B\u51E6\u7406\u3055\u308C\u3066\u3044\u307E\u3059\u3002
-InvalidParseValue = ''include''\u8981\u7D20\u306E''parse''\u5C5E\u6027\u306E\u5024\u304C\u7121\u52B9\u3067\u3059: ''{0}''\u3002
-XMLParseError = XML\u30D5\u30A1\u30A4\u30EB\u306E\u89E3\u6790\u8A66\u884C\u4E2D\u306B\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F(href=''{0}'')\u3002\u7406\u7531: {1}
-XMLResourceError = \u30A4\u30F3\u30AF\u30EB\u30FC\u30C9\u64CD\u4F5C\u304C\u5931\u6557\u3057\u3001\u30D5\u30A9\u30FC\u30EB\u30D0\u30C3\u30AF\u306B\u623B\u308A\u307E\u3059\u3002\u30D5\u30A1\u30A4\u30EB\u3092XML\u3068\u3057\u3066\u8AAD\u53D6\u308A\u4E2D\u306B\u30EA\u30BD\u30FC\u30B9\u30FB\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F(href=''{0}'')\u3002\u7406\u7531: {1}
-TextResourceError = \u30A4\u30F3\u30AF\u30EB\u30FC\u30C9\u64CD\u4F5C\u304C\u5931\u6557\u3057\u3001\u30D5\u30A9\u30FC\u30EB\u30D0\u30C3\u30AF\u306B\u623B\u308A\u307E\u3059\u3002\u30D5\u30A1\u30A4\u30EB\u3092\u30C6\u30AD\u30B9\u30C8\u3068\u3057\u3066\u8AAD\u53D6\u308A\u4E2D\u306B\u30EA\u30BD\u30FC\u30B9\u30FB\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F(href=''{0}'')\u3002\u7406\u7531: {1}
-NO_XPointerSchema = \u30C7\u30D5\u30A9\u30EB\u30C8\u3067\u306F\u3001"{0}"\u306E\u30B9\u30AD\u30FC\u30DE\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002{0}\u306B\u5BFE\u3057\u3066\u72EC\u81EA\u306E\u30B9\u30AD\u30FC\u30DE\u3092\u5B9A\u7FA9\u3057\u3066\u304F\u3060\u3055\u3044\u3002http://apache.org/xml/properties/xpointer-schema\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044
-NO_SubResourceIdentified = \u30DD\u30A4\u30F3\u30BF{0}\u306EXPointer\u30D7\u30ED\u30BB\u30C3\u30B5\u3067\u306F\u30B5\u30D6\u30EA\u30BD\u30FC\u30B9\u306F\u8B58\u5225\u3055\u308C\u307E\u305B\u3093\u3002
-NonDuplicateNotation = \u540D\u524D\u304C''{0}''\u306E\u8907\u6570\u306E\u8868\u8A18\u6CD5\u304C\u4F7F\u7528\u3055\u308C\u3066\u3044\u307E\u3059\u304C\u3001\u3053\u308C\u3089\u306E\u8868\u8A18\u6CD5\u306F\u91CD\u8907\u3068\u307F\u306A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
-NonDuplicateUnparsedEntity = \u540D\u524D\u304C''{0}''\u306E\u8907\u6570\u306E\u672A\u89E3\u6790\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u304C\u4F7F\u7528\u3055\u308C\u3066\u3044\u307E\u3059\u304C\u3001\u3053\u308C\u3089\u306E\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u306F\u91CD\u8907\u3068\u307F\u306A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
-XpointerMissing = href\u5C5E\u6027\u304C\u5B58\u5728\u3057\u306A\u3044\u5834\u5408\u306F\u3001xpointer\u5C5E\u6027\u304C\u5FC5\u8981\u3067\u3059\u3002
-AcceptMalformed = #x20\u304B\u3089#x7E\u306E\u7BC4\u56F2\u306B\u542B\u307E\u308C\u306A\u3044\u6587\u5B57\u306F\u3001'include'\u8981\u7D20\u306E'accept'\u5C5E\u6027\u306E\u5024\u306B\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\u3002
-AcceptLanguageMalformed = #x20\u304B\u3089#x7E\u306E\u7BC4\u56F2\u306B\u542B\u307E\u308C\u306A\u3044\u6587\u5B57\u306F\u3001'include'\u8981\u7D20\u306E'accept-language'\u5C5E\u6027\u306E\u5024\u306B\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\u3002
-RootElementRequired = \u6574\u5F62\u5F0F\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306B\u306F\u30EB\u30FC\u30C8\u8981\u7D20\u304C\u5FC5\u8981\u3067\u3059\u3002
-MultipleRootElements = \u6574\u5F62\u5F0F\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306B\u306F\u3001\u8907\u6570\u306E\u30EB\u30FC\u30C8\u8981\u7D20\u3092\u542B\u3081\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002
-ContentIllegalAtTopLevel = \u30C8\u30C3\u30D7\u30EC\u30D9\u30EB\u306E\u30BD\u30FC\u30B9\u60C5\u5831\u30BB\u30C3\u30C8\u306B\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u8981\u7D20\u3068\u3057\u3066\u51FA\u73FE\u3059\u308B'include'\u8981\u7D20\u306E\u7F6E\u63DB\u306B\u306F\u3001\u6587\u5B57\u3092\u542B\u3081\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002
-UnexpandedEntityReferenceIllegal = \u30C8\u30C3\u30D7\u30EC\u30D9\u30EB\u306E\u30BD\u30FC\u30B9\u60C5\u5831\u30BB\u30C3\u30C8\u306B\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u8981\u7D20\u3068\u3057\u3066\u51FA\u73FE\u3059\u308B'include'\u8981\u7D20\u306E\u7F6E\u63DB\u306B\u306F\u3001\u5C55\u958B\u3057\u3066\u3044\u306A\u3044\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u53C2\u7167\u3092\u542B\u3081\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002
-HrefFragmentIdentifierIllegal = \u30D5\u30E9\u30B0\u30E1\u30F3\u30C8\u8B58\u5225\u5B50\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\u3002''href''\u5C5E\u6027\u306E\u5024''{0}''\u306F\u8A31\u53EF\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
-HrefSyntacticallyInvalid = ''href''\u5C5E\u6027\u306E\u5024''{0}''\u306E\u69CB\u6587\u304C\u7121\u52B9\u3067\u3059\u3002\u30A8\u30B9\u30B1\u30FC\u30D7\u30FB\u30EB\u30FC\u30EB\u3092\u9069\u7528\u3059\u308B\u3068\u3001\u5024\u306F\u6B63\u3057\u3044\u69CB\u6587\u306EURI\u307E\u305F\u306FIRI\u306B\u306A\u308A\u307E\u305B\u3093\u3002
-XPointerStreamability = \u30BD\u30FC\u30B9\u60C5\u5831\u30BB\u30C3\u30C8\u5185\u306E\u5834\u6240\u3092\u6307\u3059xpointer\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u30D7\u30ED\u30BB\u30C3\u30B5\u306E\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u306E\u6027\u8CEA\u4E0A\u3001\u3053\u306E\u5834\u6240\u306B\u306F\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u305B\u3093\u3002
-
-XPointerResolutionUnsuccessful = XPointer\u306E\u89E3\u6C7A\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002
-
-# Messages from erroneous set-up
-IncompatibleNamespaceContext = NamespaceContext\u306E\u30BF\u30A4\u30D7\u306F\u3001XInclude\u306E\u4F7F\u7528\u3068\u4E92\u63DB\u6027\u304C\u3042\u308A\u307E\u305B\u3093\u3002XIncludeNamespaceSupport\u306E\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059
-ExpandedSystemId = \u30A4\u30F3\u30AF\u30EB\u30FC\u30C9\u3055\u308C\u305F\u30EA\u30BD\u30FC\u30B9\u306E\u30B7\u30B9\u30C6\u30E0ID\u3092\u62E1\u5F35\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_ko.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_ko.properties
deleted file mode 100644
index 7163690..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_ko.properties
+++ /dev/null
@@ -1,36 +0,0 @@
-# Messages for message reporting
-BadMessageKey = \uBA54\uC2DC\uC9C0 \uD0A4\uC5D0 \uD574\uB2F9\uD558\uB294 \uC624\uB958 \uBA54\uC2DC\uC9C0\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
-FormatFailed = \uB2E4\uC74C \uBA54\uC2DC\uC9C0\uC758 \uD615\uC2DD\uC744 \uC9C0\uC815\uD558\uB294 \uC911 \uB0B4\uBD80 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4.\n
-
-# Messages for erroneous input
-NoFallback = href ''{0}''\uC744(\uB97C) \uC0AC\uC6A9\uD55C ''include''\uB97C \uC2E4\uD328\uD588\uC73C\uBA70 ''fallback'' \uC694\uC18C\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
-MultipleFallbacks = 'include' \uC694\uC18C\uC758 [children]\uC5D0\uB294 \uB450 \uAC1C \uC774\uC0C1\uC758 'fallback' \uC694\uC18C\uAC00 \uD3EC\uD568\uB420 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
-FallbackParent = \uC0C1\uC704\uB85C 'include'\uB97C \uD3EC\uD568\uD558\uC9C0 \uC54A\uC740 'fallback' \uC694\uC18C\uAC00 \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
-IncludeChild = ''fallback'' \uC678\uC5D0 \uB2E4\uB978 ''http://www.w3.org/2001/XInclude'' \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uC758 \uC694\uC18C\uB294 ''include'' \uC694\uC18C\uC758 \uD558\uC704 \uD56D\uBAA9\uC77C \uC218 \uC5C6\uC9C0\uB9CC, ''{0}''\uC774(\uAC00) \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
-FallbackChild = ''include'' \uC678\uC5D0 \uB2E4\uB978 ''http://www.w3.org/2001/XInclude'' \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uC758 \uC694\uC18C\uB294 ''fallback'' \uC694\uC18C\uC758 \uD558\uC704 \uD56D\uBAA9\uC77C \uC218 \uC5C6\uC9C0\uB9CC, ''{0}''\uC774(\uAC00) \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
-HrefMissing = 'include' \uC694\uC18C\uC758 'href' \uC18D\uC131\uC774 \uB204\uB77D\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
-RecursiveInclude = \uC21C\uD658 include\uAC00 \uAC10\uC9C0\uB418\uC5C8\uC2B5\uB2C8\uB2E4. ''{0}'' \uBB38\uC11C\uAC00 \uC774\uBBF8 \uCC98\uB9AC\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
-InvalidParseValue = ''include'' \uC694\uC18C\uC5D0 ''parse'' \uC18D\uC131\uC5D0 \uB300\uD574 \uBD80\uC801\uD569\uD55C \uAC12\uC774 \uC788\uC74C: ''{0}''.
-XMLParseError = XML \uD30C\uC77C(href=''{0}'')\uC758 \uAD6C\uBB38\uC744 \uBD84\uC11D\uD558\uB824\uACE0 \uC2DC\uB3C4\uD558\uB294 \uC911 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. \uC6D0\uC778: {1}
-XMLResourceError = Include \uC791\uC5C5\uC744 \uC2E4\uD328\uD558\uC5EC fallback\uC73C\uB85C \uBCF5\uC6D0\uD558\uB294 \uC911\uC785\uB2C8\uB2E4. \uD30C\uC77C\uC744 XML(href=''{0}'')\uB85C \uC77D\uB294 \uC911 \uB9AC\uC18C\uC2A4 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. \uC6D0\uC778: {1}
-TextResourceError = Include \uC791\uC5C5\uC744 \uC2E4\uD328\uD558\uC5EC fallback\uC73C\uB85C \uBCF5\uC6D0\uD558\uB294 \uC911\uC785\uB2C8\uB2E4. \uD30C\uC77C\uC744 \uD14D\uC2A4\uD2B8(href=''{0}'')\uB85C \uC77D\uB294 \uC911 \uB9AC\uC18C\uC2A4 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. \uC6D0\uC778: {1}
-NO_XPointerSchema = \uAE30\uBCF8\uC801\uC73C\uB85C "{0}"\uC5D0 \uB300\uD55C \uC2A4\uD0A4\uB9C8\uB294 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. {0}\uC5D0 \uB300\uD574 \uACE0\uC720\uD55C \uC2A4\uD0A4\uB9C8\uB97C \uC815\uC758\uD558\uC2ED\uC2DC\uC624. http://apache.org/xml/properties/xpointer-schema\uB97C \uCC38\uC870\uD558\uC2ED\uC2DC\uC624.
-NO_SubResourceIdentified = {0} \uD3EC\uC778\uD130\uC5D0 \uB300\uD55C XPointer \uD504\uB85C\uC138\uC11C\uAC00 \uC2DD\uBCC4\uD55C \uD558\uC704 \uB9AC\uC18C\uC2A4\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.
-NonDuplicateNotation = \uC774\uB984\uC774 ''{0}''\uC774\uC9C0\uB9CC \uC911\uBCF5\uB41C \uAC83\uC73C\uB85C \uD655\uC778\uB418\uC9C0 \uC54A\uC740 \uD45C\uAE30\uBC95\uC774 \uC5EC\uB7EC \uAC1C \uC0AC\uC6A9\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
-NonDuplicateUnparsedEntity = \uC774\uB984\uC774 ''{0}''\uC774\uC9C0\uB9CC \uC911\uBCF5\uB41C \uAC83\uC73C\uB85C \uD655\uC778\uB418\uC9C0 \uC54A\uC558\uC73C\uBA70 \uAD6C\uBB38\uC774 \uBD84\uC11D\uB418\uC9C0 \uC54A\uC740 \uC5D4\uD2F0\uD2F0\uAC00 \uC5EC\uB7EC \uAC1C \uC0AC\uC6A9\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
-XpointerMissing = href \uC18D\uC131\uC774 \uC5C6\uC744 \uACBD\uC6B0 xpointer \uC18D\uC131\uC774 \uC788\uC5B4\uC57C \uD569\uB2C8\uB2E4.
-AcceptMalformed = 'include' \uC694\uC18C\uC758 'accept' \uC18D\uC131\uAC12\uC5D0\uC11C\uB294 #x20 - #x7E \uBC94\uC704\uC5D0 \uC18D\uD558\uC9C0 \uC54A\uB294 \uBB38\uC790\uAC00 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
-AcceptLanguageMalformed = 'include' \uC694\uC18C\uC758 'accept-language' \uC18D\uC131\uAC12\uC5D0\uC11C\uB294 #x20 - #x7E \uBC94\uC704\uC5D0 \uC18D\uD558\uC9C0 \uC54A\uB294 \uBB38\uC790\uAC00 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
-RootElementRequired = \uC62C\uBC14\uB978 \uD615\uC2DD\uC758 \uBB38\uC11C\uC5D0\uB294 \uB8E8\uD2B8 \uC694\uC18C\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4.
-MultipleRootElements = \uC62C\uBC14\uB978 \uD615\uC2DD\uC758 \uBB38\uC11C\uC5D0\uB294 \uB8E8\uD2B8 \uC694\uC18C\uAC00 \uC5EC\uB7EC \uAC1C \uD3EC\uD568\uB418\uC9C0 \uC54A\uC544\uC57C \uD569\uB2C8\uB2E4.
-ContentIllegalAtTopLevel = \uCD5C\uC0C1\uC704 \uB808\uBCA8 \uC18C\uC2A4 infoset\uC5D0\uC11C \uBB38\uC11C \uC694\uC18C\uB85C \uB098\uD0C0\uB098\uB294 'include' \uC694\uC18C\uC758 \uB300\uCCB4\uC5D0\uB294 \uBB38\uC790\uAC00 \uD3EC\uD568\uB420 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
-UnexpandedEntityReferenceIllegal = \uCD5C\uC0C1\uC704 \uB808\uBCA8 \uC18C\uC2A4 infoset\uC5D0\uC11C \uBB38\uC11C \uC694\uC18C\uB85C \uB098\uD0C0\uB098\uB294 'include' \uC694\uC18C\uC758 \uB300\uCCB4\uC5D0\uB294 \uD655\uC7A5\uB418\uC9C0 \uC54A\uC740 \uC5D4\uD2F0\uD2F0 \uCC38\uC870\uAC00 \uD3EC\uD568\uB420 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
-HrefFragmentIdentifierIllegal = \uBD80\uBD84 \uC2DD\uBCC4\uC790\uB294 \uC0AC\uC6A9\uD558\uC9C0 \uC54A\uC544\uC57C \uD569\uB2C8\uB2E4. ''href'' \uC18D\uC131\uAC12 ''{0}''\uC740(\uB294) \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
-HrefSyntacticallyInvalid = ''href'' \uC18D\uC131\uAC12 ''{0}''\uC774(\uAC00) \uAD6C\uBB38\uC801\uC73C\uB85C \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. \uC774\uC2A4\uCF00\uC774\uD504 \uADDC\uCE59\uC744 \uC801\uC6A9\uD55C \uD6C4 \uAC12\uC774 \uAD6C\uBB38\uC801\uC73C\uB85C \uC62C\uBC14\uB978 URI \uB610\uB294 IRI\uAC00 \uC544\uB2CC \uAC83\uC73C\uB85C \uD655\uC778\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
-XPointerStreamability = \uC18C\uC2A4 infoset\uC758 \uC704\uCE58\uB97C \uAC00\uB9AC\uD0A4\uB294 xpointer\uAC00 \uC9C0\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uD504\uB85C\uC138\uC11C\uC758 \uC2A4\uD2B8\uB9AC\uBC0D \uD2B9\uC131\uC73C\uB85C \uC778\uD574 \uC774 \uC704\uCE58\uC5D0 \uC561\uC138\uC2A4\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
-
-XPointerResolutionUnsuccessful = XPointer \uBD84\uC11D\uC744 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4.
-
-# Messages from erroneous set-up
-IncompatibleNamespaceContext = NamespaceContext\uC758 \uC720\uD615\uC774 \uC0AC\uC6A9 \uC911\uC778 XInclude\uC640 \uD638\uD658\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. XIncludeNamespaceSupport\uC758 \uC778\uC2A4\uD134\uC2A4\uC5EC\uC57C \uD569\uB2C8\uB2E4.
-ExpandedSystemId = \uD3EC\uD568\uB41C \uB9AC\uC18C\uC2A4\uC758 \uC2DC\uC2A4\uD15C ID\uB97C \uD655\uC7A5\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_pt_BR.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_pt_BR.properties
deleted file mode 100644
index 531e919..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_pt_BR.properties
+++ /dev/null
@@ -1,36 +0,0 @@
-# Messages for message reporting
-BadMessageKey = N\u00E3o foi poss\u00EDvel encontrar a mensagem de erro correspondente \u00E0 chave da mensagem.
-FormatFailed = Ocorreu um erro interno ao formatar a mensagem a seguir:\n
-
-# Messages for erroneous input
-NoFallback = Falha em um ''include'' com href ''{0}'' e n\u00E3o foi encontrado elemento ''fallback''.
-MultipleFallbacks = O [children] de um elemento 'include' n\u00E3o pode conter mais de um elemento 'fallback'.
-FallbackParent = Um elemento 'fallback' que foi encontrado n\u00E3o tinha 'include' como pai.
-IncludeChild = Elementos do namespace ''http://www.w3.org/2001/XInclude'', diferentes de ''fallback'', n\u00E3o podem ser filhos dos elementos ''include''. No entanto, ''{0}'' foi encontrado.
-FallbackChild = Elementos do namespace ''http://www.w3.org/2001/XInclude'', diferentes de ''include'', n\u00E3o podem ser filhos dos elementos ''fallback''. No entanto, ''{0}'' foi encontrado.
-HrefMissing = O atributo 'href' de um elemento 'include' n\u00E3o foi encontrado.
-RecursiveInclude = Inclus\u00E3o recursiva detectada. O documento ''{0}'' j\u00E1 foi processado.
-InvalidParseValue = Valor inv\u00E1lido para o atributo ''parse'' no elemento ''include'': ''{0}''.
-XMLParseError = Erro ao tentar fazer parse do arquivo XML (href=''{0}''). Motivo: {1}
-XMLResourceError = Falha na opera\u00E7\u00E3o de inclus\u00E3o; revertendo para fallback. Erro do recurso ao ler o arquivo como XML (href=''{0}''). Motivo: {1}
-TextResourceError = Falha na opera\u00E7\u00E3o de inclus\u00E3o; revertendo para fallback. Erro do recurso ao ler o arquivo como texto (href=''{0}''). Motivo: {1}
-NO_XPointerSchema = Por padr\u00E3o, o esquema para "{0}" n\u00E3o \u00E9 suportado. Defina seu pr\u00F3prio esquema para {0}. Consulte http://apache.org/xml/properties/xpointer-schema
-NO_SubResourceIdentified = Nenhum Sub-recurso foi identificado pelo Processador XPointer do Ponteiro {0}.
-NonDuplicateNotation = Foram usadas v\u00E1rias nota\u00E7\u00F5es que tinham o nome ''{0}'', mas n\u00E3o foram determinadas como duplica\u00E7\u00F5es.
-NonDuplicateUnparsedEntity = Foram usadas v\u00E1rias entidades que tinham o nome ''{0}'', mas n\u00E3o foram determinadas como duplica\u00E7\u00F5es.
-XpointerMissing = o atributo xpointer dever\u00E1 estar presente quando o atributo href estiver ausente.
-AcceptMalformed = N\u00E3o s\u00E3o permitidos caracteres fora da faixa #x20 at\u00E9 #x7E no valor do atributo 'accept' de um elemento 'include'.
-AcceptLanguageMalformed = N\u00E3o s\u00E3o permitidos caracteres fora da faixa #x20 at\u00E9 #x7E no valor do atributo 'accept-language' de um elemento 'include'.
-RootElementRequired = Um documento correto requer um elemento-raiz.
-MultipleRootElements = Um documento correto n\u00E3o deve conter v\u00E1rios elementos-raiz.
-ContentIllegalAtTopLevel = A substitui\u00E7\u00E3o de um elemento 'include' que aparece como o elemento do documento no conjunto de informa\u00E7\u00F5es de origem de n\u00EDvel superior n\u00E3o pode conter caracteres.
-UnexpandedEntityReferenceIllegal = A substitui\u00E7\u00E3o de um elemento 'include' que aparece como o elemento do documento no conjunto de informa\u00E7\u00F5es de origem de n\u00EDvel superior n\u00E3o pode conter refer\u00EAncias da entidade n\u00E3o expandidas.
-HrefFragmentIdentifierIllegal = Os identificadores de fragmento n\u00E3o devem ser usados. O valor do atributo ''href'' "{0}'' n\u00E3o \u00E9 permitido.
-HrefSyntacticallyInvalid = o valor do atributo ''href'' ''{0}'' \u00E9 inv\u00E1lido sintaticamente. Ap\u00F3s aplicar as regras de escape, o valor n\u00E3o \u00E9 um URI ou IRI correto.
-XPointerStreamability = Foi especificado um xpointer que aponta para uma localiza\u00E7\u00E3o no conjunto de informa\u00E7\u00F5es de origem. Esta localiza\u00E7\u00E3o n\u00E3o pode ser acessada em decorr\u00EAncia da natureza do fluxo do processador.
-
-XPointerResolutionUnsuccessful = Resolu\u00E7\u00E3o de XPointer malsucedida.
-
-# Messages from erroneous set-up
-IncompatibleNamespaceContext = O tipo de NamespaceContext \u00E9 incompat\u00EDvel ao usar XInclude. Deve ser uma inst\u00E2ncia de XIncludeNamespaceSupport
-ExpandedSystemId = N\u00E3o foi poss\u00EDvel expandir o id do sistema do recurso inclu\u00EDdo
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_sv.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_sv.properties
deleted file mode 100644
index d79ebbd..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_sv.properties
+++ /dev/null
@@ -1,36 +0,0 @@
-# Messages for message reporting
-BadMessageKey = Hittar inte felmeddelandet som motsvarar meddelandenyckeln.
-FormatFailed = Ett internt fel intr\u00E4ffade vid formatering av f\u00F6ljande meddelande:\n
-
-# Messages for erroneous input
-NoFallback = Ett ''include'' med href ''{0}'' utf\u00F6rdes inte, hittade inget \u00E5terskapningselement (''fallback'').
-MultipleFallbacks = [underordnade] i ett 'include'-element f\u00E5r inte inneh\u00E5lla fler \u00E4n ett 'fallback'-element.
-FallbackParent = Ett 'fallback'-element hittades utan n\u00E5got 'include' som \u00F6verordnat element.
-IncludeChild = Element fr\u00E5n namnrymd ''http://www.w3.org/2001/XInclude'', ut\u00F6ver ''fallback'', \u00E4r inte till\u00E5tna som underordnade i ''include''-element. Hittade d\u00E4remot ''{0}''.
-FallbackChild = Element fr\u00E5n namnrymd ''http://www.w3.org/2001/XInclude'', ut\u00F6ver ''include'', \u00E4r inte till\u00E5tna som underordnade i ''fallback''-element. Hittade d\u00E4remot ''{0}''.
-HrefMissing = Ett 'href'-attribut i ett 'include'-element saknas.
-RecursiveInclude = Rekursiv inkludering uppt\u00E4cktes. Dokumentet ''{0}'' har redan bearbetats.
-InvalidParseValue = Ogiltigt v\u00E4rde f\u00F6r ''parse''-attribut i ''include''-element: ''{0}''.
-XMLParseError = Fel vid f\u00F6rs\u00F6k att tolka XML-fil (href=''{0}''). Orsak: {1}
-XMLResourceError = Inkluderings\u00E5tg\u00E4rden utf\u00F6rdes inte, \u00E5terst\u00E4ller genom att \u00E5terskapa. Resursfel vid l\u00E4sning av fil som XML (href=''{0}''). Orsak: {1}
-TextResourceError = Inkluderings\u00E5tg\u00E4rden utf\u00F6rdes inte, \u00E5terst\u00E4ller genom att \u00E5terskapa. Resursfel vid l\u00E4sning av fil som text (href=''{0}''). Orsak: {1}
-NO_XPointerSchema = Schema f\u00F6r "{0}" st\u00F6ds inte som standard. Definiera ett eget schema f\u00F6r {0}.Se http://apache.org/xml/properties/xpointer-schema
-NO_SubResourceIdentified = Ingen Subresource har identifierats av XPointer-processorn f\u00F6r pekare {0}.
-NonDuplicateNotation = Flera noteringar anv\u00E4nds med namnet ''{0}'', men som inte fastst\u00E4lls som dubbletter.
-NonDuplicateUnparsedEntity = Flera otolkade enheter anv\u00E4nds med namnet ''{0}'', men som inte fastst\u00E4lls som dubbletter.
-XpointerMissing = Om href-attribut saknas m\u00E5ste det finnas ett xpointer-attribut.
-AcceptMalformed = Tecken utanf\u00F6r intervallet #x20 till #x7E till\u00E5ts inte i v\u00E4rdet f\u00F6r 'accept'-attributet i 'include'-element.
-AcceptLanguageMalformed = Tecken utanf\u00F6r intervallet #x20 till #x7E till\u00E5ts inte i v\u00E4rdet f\u00F6r 'accept-language'-attributet i 'include'-element.
-RootElementRequired = Ett v\u00E4lformulerat dokument kr\u00E4ver ett rotelement.
-MultipleRootElements = Ett v\u00E4lformulerat dokument f\u00E5r inte inneh\u00E5lla flera rotelement.
-ContentIllegalAtTopLevel = Ers\u00E4ttningen av ett 'include'-element som f\u00F6rekommer som dokumentelement i k\u00E4llans informationsupps\u00E4ttning p\u00E5 \u00F6versta niv\u00E5n f\u00E5r inte inneh\u00E5lla tecken.
-UnexpandedEntityReferenceIllegal = Ers\u00E4ttningen av ett 'include'-element som f\u00F6rekommer som dokumentelement i k\u00E4llans informationsupps\u00E4ttning p\u00E5 \u00F6versta niv\u00E5n f\u00E5r inte inneh\u00E5lla ut\u00F6kade enhetsreferenser.
-HrefFragmentIdentifierIllegal = Fragmentidentifierare f\u00E5r inte anv\u00E4ndas. ''href''-attributv\u00E4rdet ''{0}'' \u00E4r inte till\u00E5tet.
-HrefSyntacticallyInvalid = ''href''-attributv\u00E4rdet ''{0}'' \u00E4r syntaktiskt ogiltigt. Efter till\u00E4mpning av avbrottsregler har v\u00E4rdet varken syntaktiskt korrekt URI eller IRI.
-XPointerStreamability = En xpointer har angetts som pekar till en plats i k\u00E4llans informationsupps\u00E4ttning. Det finns ingen \u00E5tkomst till denna plats p\u00E5 grund av processorns str\u00F6mningsmetod.
-
-XPointerResolutionUnsuccessful = XPointer-matchningen utf\u00F6rdes inte.
-
-# Messages from erroneous set-up
-IncompatibleNamespaceContext = Typ av NamespaceContext \u00E4r inkompatibel med XInclude; det kr\u00E4vs en instans av XIncludeNamespaceSupport
-ExpandedSystemId = Kunde inte ut\u00F6ka system-ID:t f\u00F6r inkluderad resurs
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_zh_CN.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_zh_CN.properties
deleted file mode 100644
index 8e32a73..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_zh_CN.properties
+++ /dev/null
@@ -1,36 +0,0 @@
-# Messages for message reporting
-BadMessageKey = \u627E\u4E0D\u5230\u4E0E\u6D88\u606F\u5173\u952E\u5B57\u5BF9\u5E94\u7684\u9519\u8BEF\u6D88\u606F\u3002
-FormatFailed = \u8BBE\u7F6E\u4EE5\u4E0B\u6D88\u606F\u7684\u683C\u5F0F\u65F6\u51FA\u73B0\u5185\u90E8\u9519\u8BEF:\n
-
-# Messages for erroneous input
-NoFallback = \u5E26\u6709 href ''{0}'' \u7684 ''include'' \u5931\u8D25, \u5E76\u4E14\u627E\u4E0D\u5230 ''fallback'' \u5143\u7D20\u3002
-MultipleFallbacks = 'include' \u5143\u7D20\u7684 [children] \u4E0D\u80FD\u5305\u542B\u591A\u4E2A 'fallback' \u5143\u7D20\u3002
-FallbackParent = \u627E\u5230\u672A\u5C06 'include' \u4F5C\u4E3A\u7236\u7EA7\u7684 'fallback' \u5143\u7D20\u3002
-IncludeChild = \u4E0D\u5141\u8BB8\u5C06\u540D\u79F0\u7A7A\u95F4 ''http://www.w3.org/2001/XInclude'' (\u800C\u975E ''fallback'') \u4E2D\u7684\u5143\u7D20\u4F5C\u4E3A ''include'' \u5143\u7D20\u7684\u5B50\u7EA7\u3002\u4F46\u662F, \u627E\u5230 ''{0}''\u3002
-FallbackChild = \u4E0D\u5141\u8BB8\u5C06\u540D\u79F0\u7A7A\u95F4 ''http://www.w3.org/2001/XInclude'' (\u800C\u975E ''include'') \u4E2D\u7684\u5143\u7D20\u4F5C\u4E3A ''fallback'' \u5143\u7D20\u7684\u5B50\u7EA7\u3002\u4F46\u662F, \u627E\u5230 ''{0}''\u3002
-HrefMissing = \u7F3A\u5C11 'include' \u5143\u7D20\u7684 'href' \u5C5E\u6027\u3002
-RecursiveInclude = \u68C0\u6D4B\u5230\u9012\u5F52 include\u3002\u5DF2\u5904\u7406\u6587\u6863 ''{0}''\u3002
-InvalidParseValue = ''include'' \u5143\u7D20\u7684 ''parse'' \u5C5E\u6027\u7684\u503C\u65E0\u6548: ''{0}''\u3002
-XMLParseError = \u5C1D\u8BD5\u89E3\u6790 XML \u6587\u4EF6 (href=''{0}'') \u65F6\u51FA\u9519\u3002\u539F\u56E0: {1}
-XMLResourceError = Include \u64CD\u4F5C\u5931\u8D25, \u5E76\u8FD8\u539F\u4E3A fallback\u3002\u4EE5 XML (href=''{0}'') \u683C\u5F0F\u8BFB\u53D6\u6587\u4EF6\u65F6\u51FA\u73B0\u8D44\u6E90\u9519\u8BEF\u3002\u539F\u56E0: {1}
-TextResourceError = Include \u64CD\u4F5C\u5931\u8D25, \u5E76\u8FD8\u539F\u4E3A fallback\u3002\u4EE5\u6587\u672C (href=''{0}'') \u683C\u5F0F\u8BFB\u53D6\u6587\u4EF6\u65F6\u51FA\u73B0\u8D44\u6E90\u9519\u8BEF\u3002\u539F\u56E0: {1}
-NO_XPointerSchema = \u9ED8\u8BA4\u60C5\u51B5\u4E0B, \u4E0D\u652F\u6301 "{0}" \u7684\u65B9\u6848\u3002\u8BF7\u4E3A{0}\u5B9A\u4E49\u60A8\u81EA\u5DF1\u7684\u65B9\u6848\u3002\u8BF7\u8BBF\u95EE http://apache.org/xml/properties/xpointer-schema
-NO_SubResourceIdentified = \u65E0\u6CD5\u901A\u8FC7 XPointer Processor for Pointer {0} \u8BC6\u522B Subresource\u3002
-NonDuplicateNotation = \u4F7F\u7528\u4E86\u591A\u4E2A\u540D\u4E3A ''{0}'' \u7684\u8BB0\u53F7, \u4F46\u672A\u5C06\u8FD9\u4E9B\u8BB0\u53F7\u786E\u5B9A\u4E3A\u91CD\u590D\u9879\u3002
-NonDuplicateUnparsedEntity = \u4F7F\u7528\u4E86\u591A\u4E2A\u540D\u4E3A ''{0}'' \u7684\u672A\u89E3\u6790\u5B9E\u4F53, \u4F46\u672A\u5C06\u8FD9\u4E9B\u5B9E\u4F53\u786E\u5B9A\u4E3A\u91CD\u590D\u9879\u3002
-XpointerMissing = \u7F3A\u5C11 href \u5C5E\u6027\u65F6, \u5FC5\u987B\u5B58\u5728 xpointer \u5C5E\u6027\u3002
-AcceptMalformed = 'include' \u5143\u7D20\u7684 'accept' \u5C5E\u6027\u7684\u503C\u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528\u8303\u56F4 #x20 \u81F3 #x7E \u4EE5\u5916\u7684\u5B57\u7B26\u3002
-AcceptLanguageMalformed = 'include' \u5143\u7D20\u7684 'accept-language' \u5C5E\u6027\u7684\u503C\u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528\u8303\u56F4 #x20 \u81F3 #x7E \u4EE5\u5916\u7684\u5B57\u7B26\u3002
-RootElementRequired = \u683C\u5F0F\u6B63\u786E\u7684\u6587\u6863\u9700\u8981\u4E00\u4E2A\u6839\u5143\u7D20\u3002
-MultipleRootElements = \u683C\u5F0F\u6B63\u786E\u7684\u6587\u6863\u4E0D\u80FD\u5305\u542B\u591A\u4E2A\u6839\u5143\u7D20\u3002
-ContentIllegalAtTopLevel = \u5728\u9876\u7EA7\u6E90\u4FE1\u606F\u96C6\u4E2D\u663E\u793A\u4E3A\u6587\u6863\u5143\u7D20\u7684 'include' \u5143\u7D20\u7684\u66FF\u4EE3\u9879\u4E0D\u80FD\u5305\u542B\u5B57\u7B26\u3002
-UnexpandedEntityReferenceIllegal = \u5728\u9876\u7EA7\u6E90\u4FE1\u606F\u96C6\u4E2D\u663E\u793A\u4E3A\u6587\u6863\u5143\u7D20\u7684 'include' \u5143\u7D20\u7684\u66FF\u4EE3\u9879\u4E0D\u80FD\u5305\u542B\u672A\u5C55\u5F00\u7684\u5B9E\u4F53\u5F15\u7528\u3002
-HrefFragmentIdentifierIllegal = \u4E0D\u80FD\u4F7F\u7528\u7247\u6BB5\u6807\u8BC6\u7B26\u3002\u4E0D\u5141\u8BB8\u4F7F\u7528 ''href'' \u5C5E\u6027\u503C ''{0}''\u3002
-HrefSyntacticallyInvalid = ''href'' \u5C5E\u6027\u503C ''{0}'' \u7684\u8BED\u6CD5\u65E0\u6548\u3002\u5E94\u7528\u8F6C\u4E49\u89C4\u5219\u540E, \u8BE5\u503C\u4E0D\u662F\u8BED\u6CD5\u6B63\u786E\u7684 URI \u6216 IRI\u3002
-XPointerStreamability = \u5DF2\u6307\u5B9A\u6307\u5411\u6E90\u4FE1\u606F\u96C6\u4E2D\u7684\u4F4D\u7F6E\u7684 xpointer\u3002\u7531\u4E8E\u5904\u7406\u7A0B\u5E8F\u7684\u6D41\u5F0F\u6027\u8D28, \u65E0\u6CD5\u8BBF\u95EE\u6B64\u4F4D\u7F6E\u3002
-
-XPointerResolutionUnsuccessful = XPointer \u89E3\u6790\u672A\u6210\u529F\u3002
-
-# Messages from erroneous set-up
-IncompatibleNamespaceContext = NamespaceContext \u7684\u7C7B\u578B\u4E0E\u4F7F\u7528 XInclude \u4E0D\u517C\u5BB9; \u5B83\u5FC5\u987B\u662F XIncludeNamespaceSupport \u7684\u5B9E\u4F8B
-ExpandedSystemId = \u65E0\u6CD5\u6269\u5C55\u5305\u542B\u8D44\u6E90\u7684\u7CFB\u7EDF ID
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_zh_TW.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_zh_TW.properties
deleted file mode 100644
index 69cd034..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_zh_TW.properties
+++ /dev/null
@@ -1,36 +0,0 @@
-# Messages for message reporting
-BadMessageKey = \u627E\u4E0D\u5230\u5C0D\u61C9\u8A0A\u606F\u7D22\u5F15\u9375\u7684\u932F\u8AA4\u8A0A\u606F\u3002
-FormatFailed = \u683C\u5F0F\u5316\u4E0B\u5217\u8A0A\u606F\u6642\u767C\u751F\u5167\u90E8\u932F\u8AA4:\n
-
-# Messages for erroneous input
-NoFallback = \u542B\u6709 href ''{0}'' \u7684 ''include'' \u5931\u6557\uFF0C\u627E\u4E0D\u5230 ''fallback'' \u5143\u7D20\u3002
-MultipleFallbacks = 'include' \u5143\u7D20\u7684 [children] \u4E0D\u53EF\u5305\u542B\u8D85\u904E\u4E00\u500B\u4EE5\u4E0A\u7684 'fallback' \u5143\u7D20\u3002
-FallbackParent = \u627E\u5230\u4E00\u500B\u4E0D\u5177\u6709 'include' \u4F5C\u70BA\u7236\u9805\u7684 'fallback' \u5143\u7D20\u3002
-IncludeChild = \u4F86\u81EA\u547D\u540D\u7A7A\u9593 ''http://www.w3.org/2001/XInclude'' \u4E14\u4E0D\u662F ''fallback'' \u7684\u5143\u7D20\uFF0C\u4E0D\u5141\u8A31\u6210\u70BA ''include'' \u5143\u7D20\u7684\u5B50\u9805\u3002\u4E0D\u904E\uFF0C\u537B\u627E\u5230 ''{0}''\u3002
-FallbackChild = \u4F86\u81EA\u547D\u540D\u7A7A\u9593 ''http://www.w3.org/2001/XInclude'' \u4E14\u4E0D\u662F ''include'' \u7684\u5143\u7D20\uFF0C\u4E0D\u5141\u8A31\u6210\u70BA ''fallback'' \u5143\u7D20\u7684\u5B50\u9805\u3002\u4E0D\u904E\uFF0C\u537B\u627E\u5230 ''{0}''\u3002
-HrefMissing = \u907A\u6F0F 'include' \u5143\u7D20\u7684 'href' \u5C6C\u6027\u3002
-RecursiveInclude = \u5075\u6E2C\u5230\u905E\u8FF4\u5305\u542B\u3002\u5DF2\u7D93\u8655\u7406\u6587\u4EF6 ''{0}''\u3002
-InvalidParseValue = ''include'' \u5143\u7D20\u4E0A ''parse'' \u5C6C\u6027\u7684\u7121\u6548\u503C: ''{0}''\u3002
-XMLParseError = \u5617\u8A66\u5256\u6790 XML \u6A94\u6848 (href=''{0}'') \u6642\u767C\u751F\u932F\u8AA4\u3002\u539F\u56E0: {1}
-XMLResourceError = \u5305\u542B\u4F5C\u696D\u5931\u6557\uFF0C\u56DE\u5FA9\u81F3\u5F8C\u63F4\u3002\u4EE5 XML (href=''{0}'') \u65B9\u5F0F\u8B80\u53D6\u6A94\u6848\u6642\u767C\u751F\u8CC7\u6E90\u932F\u8AA4\u3002\u539F\u56E0: {1}
-TextResourceError = \u5305\u542B\u4F5C\u696D\u5931\u6557\uFF0C\u56DE\u5FA9\u81F3\u5F8C\u63F4\u3002\u4EE5\u6587\u5B57 (href=''{0}'') \u65B9\u5F0F\u8B80\u53D6\u6A94\u6848\u6642\u767C\u751F\u8CC7\u6E90\u932F\u8AA4\u3002\u539F\u56E0: {1}
-NO_XPointerSchema = \u9810\u8A2D\u4E0D\u652F\u63F4 "{0}" \u7684\u7DB1\u8981\u3002\u8ACB\u70BA {0} \u5B9A\u7FA9\u60A8\u81EA\u5DF1\u7684\u7DB1\u8981\u3002\u8ACB\u53C3\u95B1 http://apache.org/xml/properties/xpointer-schema
-NO_SubResourceIdentified = XPointer \u8655\u7406\u5668\u672A\u80FD\u70BA\u6307\u6A19 {0} \u8B58\u5225\u4EFB\u4F55\u5B50\u8CC7\u6E90\u3002
-NonDuplicateNotation = \u4F7F\u7528\u540D\u7A31\u70BA ''{0}'' \u7684\u591A\u500B\u8868\u793A\u6CD5\uFF0C\u4F46\u662F\u672A\u80FD\u5224\u65B7\u9019\u4E9B\u8868\u793A\u6CD5\u91CD\u8907\u3002
-NonDuplicateUnparsedEntity = \u4F7F\u7528\u540D\u7A31\u70BA ''{0}'' \u7684\u591A\u500B\u672A\u5256\u6790\u5BE6\u9AD4\uFF0C\u4F46\u662F\u672A\u80FD\u5224\u65B7\u9019\u4E9B\u5BE6\u9AD4\u91CD\u8907\u3002
-XpointerMissing = \u6C92\u6709 href \u5C6C\u6027\u6642\uFF0C\u5FC5\u9808\u6709 xpointer \u5C6C\u6027\u3002
-AcceptMalformed = 'include' \u5143\u7D20\u7684 'accept' \u5C6C\u6027\u503C\u4E2D\uFF0C\u4E0D\u5141\u8A31\u7BC4\u570D #x20 \u81F3 #x7E \u4E4B\u5916\u7684\u5B57\u5143\u3002
-AcceptLanguageMalformed = 'include' \u5143\u7D20\u7684 'accept-language' \u5C6C\u6027\u503C\u4E2D\uFF0C\u4E0D\u5141\u8A31\u7BC4\u570D #x20 \u81F3 #x7E \u4E4B\u5916\u7684\u5B57\u5143\u3002
-RootElementRequired = \u683C\u5F0F\u6B63\u78BA\u7684\u6587\u4EF6\u9700\u8981\u6839\u5143\u7D20\u3002
-MultipleRootElements = \u683C\u5F0F\u6B63\u78BA\u7684\u6587\u4EF6\u4E0D\u53EF\u5305\u542B\u591A\u500B\u6839\u5143\u7D20\u3002
-ContentIllegalAtTopLevel = \u53D6\u4EE3 'include' \u5143\u7D20\u4F5C\u70BA\u6700\u4E0A\u5C64\u4F86\u6E90 infoset \u7684\u6587\u4EF6\u5143\u7D20\u4E0D\u80FD\u5305\u542B\u5B57\u5143\u3002
-UnexpandedEntityReferenceIllegal = \u53D6\u4EE3 'include' \u5143\u7D20\u4F5C\u70BA\u6700\u4E0A\u5C64\u4F86\u6E90 infoset \u7684\u6587\u4EF6\u5143\u7D20\u4E0D\u80FD\u5305\u542B\u672A\u5C55\u958B\u7684\u5BE6\u9AD4\u53C3\u7167\u3002
-HrefFragmentIdentifierIllegal = \u4E0D\u53EF\u4F7F\u7528\u7247\u6BB5 ID\u3002\u4E0D\u5141\u8A31 ''href'' \u5C6C\u6027\u503C ''{0}''\u3002
-HrefSyntacticallyInvalid = ''href'' \u5C6C\u6027\u503C ''{0}'' \u53E5\u6CD5\u7121\u6548\u3002\u5957\u7528\u9041\u96E2\u898F\u5247\u4E4B\u5F8C\uFF0C\u503C\u70BA\u53E5\u6CD5\u6B63\u78BA\u7684 URI \u6216 IRI\u3002
-XPointerStreamability = \u6307\u5B9A xpointer \u6307\u5411\u4F86\u6E90 infoset \u4E2D\u7684\u4F4D\u7F6E\u3002\u7531\u65BC\u8655\u7406\u5668\u4E32\u6D41\u7279\u6027\uFF0C\u56E0\u6B64\u7121\u6CD5\u5B58\u53D6\u6B64\u4F4D\u7F6E\u3002
-
-XPointerResolutionUnsuccessful = XPointer \u89E3\u6790\u5931\u6557\u3002
-
-# Messages from erroneous set-up
-IncompatibleNamespaceContext = NamespaceContext \u985E\u578B\u8207\u4F7F\u7528 XInclude \u4E0D\u76F8\u5BB9; \u5B83\u5FC5\u9808\u662F XIncludeNamespaceSupport \u7684\u57F7\u884C\u8655\u7406
-ExpandedSystemId = \u7121\u6CD5\u5C55\u958B\u5305\u542B\u8CC7\u6E90\u7684\u7CFB\u7D71 ID
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter.java b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter.java
deleted file mode 100644
index adb8c44..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.msg;
-
-import com.sun.org.apache.xerces.internal.util.MessageFormatter;
-import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * XMLMessageFormatter provides error messages for the XML 1.0 Recommendation and for
- * the Namespaces Recommendation
- *
- * @xerces.internal
- *
- * @author Eric Ye, IBM
- * @version $Id: XMLMessageFormatter.java 3094 2012-03-21 05:50:01Z joehw $
- *
- */
-public class XMLMessageFormatter implements MessageFormatter {
- /**
- * The domain of messages concerning the XML 1.0 specification.
- */
- public static final String XML_DOMAIN = "http://www.w3.org/TR/1998/REC-xml-19980210";
- public static final String XMLNS_DOMAIN = "http://www.w3.org/TR/1999/REC-xml-names-19990114";
-
- // private objects to cache the locale and resource bundle
- private Locale fLocale = null;
- private ResourceBundle fResourceBundle = null;
-
- //
- // MessageFormatter methods
- //
-
- /**
- * Formats a message with the specified arguments using the given
- * locale information.
- *
- * @param locale The locale of the message.
- * @param key The message key.
- * @param arguments The message replacement text arguments. The order
- * of the arguments must match that of the placeholders
- * in the actual message.
- *
- * @return Returns the formatted message.
- *
- * @throws MissingResourceException Thrown if the message with the
- * specified key cannot be found.
- */
- public String formatMessage(Locale locale, String key, Object[] arguments)
- throws MissingResourceException {
-
- if (fResourceBundle == null || locale != fLocale) {
- if (locale != null) {
- fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages", locale);
- // memorize the most-recent locale
- fLocale = locale;
- }
- if (fResourceBundle == null)
- fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages");
- }
-
- // format message
- String msg;
- try {
- msg = fResourceBundle.getString(key);
- if (arguments != null) {
- try {
- msg = java.text.MessageFormat.format(msg, arguments);
- }
- catch (Exception e) {
- msg = fResourceBundle.getString("FormatFailed");
- msg += " " + fResourceBundle.getString(key);
- }
- }
- }
-
- // error
- catch (MissingResourceException e) {
- msg = fResourceBundle.getString("BadMessageKey");
- throw new MissingResourceException(key, msg, key);
- }
-
- // no message
- if (msg == null) {
- msg = key;
- if (arguments.length > 0) {
- StringBuffer str = new StringBuffer(msg);
- str.append('?');
- for (int i = 0; i < arguments.length; i++) {
- if (i > 0) {
- str.append('&');
- }
- str.append(String.valueOf(arguments[i]));
- }
- }
- }
-
- return msg;
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_de.java b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_de.java
deleted file mode 100644
index 1f9d281..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_de.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.msg;
-
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-import java.util.PropertyResourceBundle;
-
-import com.sun.org.apache.xerces.internal.util.MessageFormatter;
-import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
-
-/**
- * XMLMessageFormatter provides error messages for the XML 1.0 Recommendation and for
- * the Namespaces Recommendation
- *
- * @xerces.internal
- *
- * @author Eric Ye, IBM
- * @version $Id: XMLMessageFormatter_de.java 3094 2012-03-21 05:50:01Z joehw $
- *
- */
-public class XMLMessageFormatter_de implements MessageFormatter {
- /**
- * The domain of messages concerning the XML 1.0 specification.
- */
- public static final String XML_DOMAIN = "http://www.w3.org/TR/1998/REC-xml-19980210";
- public static final String XMLNS_DOMAIN = "http://www.w3.org/TR/1999/REC-xml-names-19990114";
-
- // private objects to cache the locale and resource bundle
- private Locale fLocale = null;
- private ResourceBundle fResourceBundle = null;
-
- //
- // MessageFormatter methods
- //
-
- /**
- * Formats a message with the specified arguments using the given
- * locale information.
- *
- * @param locale The locale of the message.
- * @param key The message key.
- * @param arguments The message replacement text arguments. The order
- * of the arguments must match that of the placeholders
- * in the actual message.
- *
- * @return Returns the formatted message.
- *
- * @throws MissingResourceException Thrown if the message with the
- * specified key cannot be found.
- */
- public String formatMessage(Locale locale, String key, Object[] arguments)
- throws MissingResourceException {
-
- if (fResourceBundle == null || locale != fLocale) {
- if (locale != null) {
- fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages", locale);
- // memorize the most-recent locale
- fLocale = locale;
- }
- if (fResourceBundle == null)
- fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages");
- }
-
- // format message
- String msg;
- try {
- msg = fResourceBundle.getString(key);
- if (arguments != null) {
- try {
- msg = java.text.MessageFormat.format(msg, arguments);
- }
- catch (Exception e) {
- msg = fResourceBundle.getString("FormatFailed");
- msg += " " + fResourceBundle.getString(key);
- }
- }
- }
-
- // error
- catch (MissingResourceException e) {
- msg = fResourceBundle.getString("BadMessageKey");
- throw new MissingResourceException(key, msg, key);
- }
-
- // no message
- if (msg == null) {
- msg = key;
- if (arguments.length > 0) {
- StringBuffer str = new StringBuffer(msg);
- str.append('?');
- for (int i = 0; i < arguments.length; i++) {
- if (i > 0) {
- str.append('&');
- }
- str.append(String.valueOf(arguments[i]));
- }
- }
- }
-
- return msg;
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_es.java b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_es.java
deleted file mode 100644
index 164a251..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_es.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.msg;
-
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-import java.util.PropertyResourceBundle;
-
-import com.sun.org.apache.xerces.internal.util.MessageFormatter;
-import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
-
-/**
- * XMLMessageFormatter provides error messages for the XML 1.0 Recommendation and for
- * the Namespaces Recommendation
- *
- * @xerces.internal
- *
- * @author Eric Ye, IBM
- * @version $Id: XMLMessageFormatter_es.java 3094 2012-03-21 05:50:01Z joehw $
- *
- */
-public class XMLMessageFormatter_es implements MessageFormatter {
- /**
- * The domain of messages concerning the XML 1.0 specification.
- */
- public static final String XML_DOMAIN = "http://www.w3.org/TR/1998/REC-xml-19980210";
- public static final String XMLNS_DOMAIN = "http://www.w3.org/TR/1999/REC-xml-names-19990114";
-
- // private objects to cache the locale and resource bundle
- private Locale fLocale = null;
- private ResourceBundle fResourceBundle = null;
-
- //
- // MessageFormatter methods
- //
-
- /**
- * Formats a message with the specified arguments using the given
- * locale information.
- *
- * @param locale The locale of the message.
- * @param key The message key.
- * @param arguments The message replacement text arguments. The order
- * of the arguments must match that of the placeholders
- * in the actual message.
- *
- * @return Returns the formatted message.
- *
- * @throws MissingResourceException Thrown if the message with the
- * specified key cannot be found.
- */
- public String formatMessage(Locale locale, String key, Object[] arguments)
- throws MissingResourceException {
-
- if (fResourceBundle == null || locale != fLocale) {
- if (locale != null) {
- fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages", locale);
- // memorize the most-recent locale
- fLocale = locale;
- }
- if (fResourceBundle == null)
- fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages");
- }
-
- // format message
- String msg;
- try {
- msg = fResourceBundle.getString(key);
- if (arguments != null) {
- try {
- msg = java.text.MessageFormat.format(msg, arguments);
- }
- catch (Exception e) {
- msg = fResourceBundle.getString("FormatFailed");
- msg += " " + fResourceBundle.getString(key);
- }
- }
- }
-
- // error
- catch (MissingResourceException e) {
- msg = fResourceBundle.getString("BadMessageKey");
- throw new MissingResourceException(key, msg, key);
- }
-
- // no message
- if (msg == null) {
- msg = key;
- if (arguments.length > 0) {
- StringBuffer str = new StringBuffer(msg);
- str.append('?');
- for (int i = 0; i < arguments.length; i++) {
- if (i > 0) {
- str.append('&');
- }
- str.append(String.valueOf(arguments[i]));
- }
- }
- }
-
- return msg;
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_fr.java b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_fr.java
deleted file mode 100644
index e4e4129..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_fr.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.msg;
-
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-import java.util.PropertyResourceBundle;
-
-import com.sun.org.apache.xerces.internal.util.MessageFormatter;
-import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
-
-/**
- * XMLMessageFormatter provides error messages for the XML 1.0 Recommendation and for
- * the Namespaces Recommendation
- *
- * @xerces.internal
- *
- * @author Eric Ye, IBM
- * @version $Id: XMLMessageFormatter_fr.java 3094 2012-03-21 05:50:01Z joehw $
- *
- */
-public class XMLMessageFormatter_fr implements MessageFormatter {
- /**
- * The domain of messages concerning the XML 1.0 specification.
- */
- public static final String XML_DOMAIN = "http://www.w3.org/TR/1998/REC-xml-19980210";
- public static final String XMLNS_DOMAIN = "http://www.w3.org/TR/1999/REC-xml-names-19990114";
-
- // private objects to cache the locale and resource bundle
- private Locale fLocale = null;
- private ResourceBundle fResourceBundle = null;
-
- //
- // MessageFormatter methods
- //
-
- /**
- * Formats a message with the specified arguments using the given
- * locale information.
- *
- * @param locale The locale of the message.
- * @param key The message key.
- * @param arguments The message replacement text arguments. The order
- * of the arguments must match that of the placeholders
- * in the actual message.
- *
- * @return Returns the formatted message.
- *
- * @throws MissingResourceException Thrown if the message with the
- * specified key cannot be found.
- */
- public String formatMessage(Locale locale, String key, Object[] arguments)
- throws MissingResourceException {
-
- if (fResourceBundle == null || locale != fLocale) {
- if (locale != null) {
- fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages", locale);
- // memorize the most-recent locale
- fLocale = locale;
- }
- if (fResourceBundle == null)
- fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages");
- }
-
- // format message
- String msg;
- try {
- msg = fResourceBundle.getString(key);
- if (arguments != null) {
- try {
- msg = java.text.MessageFormat.format(msg, arguments);
- }
- catch (Exception e) {
- msg = fResourceBundle.getString("FormatFailed");
- msg += " " + fResourceBundle.getString(key);
- }
- }
- }
-
- // error
- catch (MissingResourceException e) {
- msg = fResourceBundle.getString("BadMessageKey");
- throw new MissingResourceException(key, msg, key);
- }
-
- // no message
- if (msg == null) {
- msg = key;
- if (arguments.length > 0) {
- StringBuffer str = new StringBuffer(msg);
- str.append('?');
- for (int i = 0; i < arguments.length; i++) {
- if (i > 0) {
- str.append('&');
- }
- str.append(String.valueOf(arguments[i]));
- }
- }
- }
-
- return msg;
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_it.java b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_it.java
deleted file mode 100644
index e2dd513..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_it.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.msg;
-
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-import java.util.PropertyResourceBundle;
-
-import com.sun.org.apache.xerces.internal.util.MessageFormatter;
-import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
-
-/**
- * XMLMessageFormatter provides error messages for the XML 1.0 Recommendation and for
- * the Namespaces Recommendation
- *
- * @xerces.internal
- *
- * @author Eric Ye, IBM
- * @version $Id: XMLMessageFormatter_it.java 3094 2012-03-21 05:50:01Z joehw $
- *
- */
-public class XMLMessageFormatter_it implements MessageFormatter {
- /**
- * The domain of messages concerning the XML 1.0 specification.
- */
- public static final String XML_DOMAIN = "http://www.w3.org/TR/1998/REC-xml-19980210";
- public static final String XMLNS_DOMAIN = "http://www.w3.org/TR/1999/REC-xml-names-19990114";
-
- // private objects to cache the locale and resource bundle
- private Locale fLocale = null;
- private ResourceBundle fResourceBundle = null;
-
- //
- // MessageFormatter methods
- //
-
- /**
- * Formats a message with the specified arguments using the given
- * locale information.
- *
- * @param locale The locale of the message.
- * @param key The message key.
- * @param arguments The message replacement text arguments. The order
- * of the arguments must match that of the placeholders
- * in the actual message.
- *
- * @return Returns the formatted message.
- *
- * @throws MissingResourceException Thrown if the message with the
- * specified key cannot be found.
- */
- public String formatMessage(Locale locale, String key, Object[] arguments)
- throws MissingResourceException {
-
- if (fResourceBundle == null || locale != fLocale) {
- if (locale != null) {
- fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages", locale);
- // memorize the most-recent locale
- fLocale = locale;
- }
- if (fResourceBundle == null)
- fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages");
- }
-
- // format message
- String msg;
- try {
- msg = fResourceBundle.getString(key);
- if (arguments != null) {
- try {
- msg = java.text.MessageFormat.format(msg, arguments);
- }
- catch (Exception e) {
- msg = fResourceBundle.getString("FormatFailed");
- msg += " " + fResourceBundle.getString(key);
- }
- }
- }
-
- // error
- catch (MissingResourceException e) {
- msg = fResourceBundle.getString("BadMessageKey");
- throw new MissingResourceException(key, msg, key);
- }
-
- // no message
- if (msg == null) {
- msg = key;
- if (arguments.length > 0) {
- StringBuffer str = new StringBuffer(msg);
- str.append('?');
- for (int i = 0; i < arguments.length; i++) {
- if (i > 0) {
- str.append('&');
- }
- str.append(String.valueOf(arguments[i]));
- }
- }
- }
-
- return msg;
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_ja.java b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_ja.java
deleted file mode 100644
index b3fb856..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_ja.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.msg;
-
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-import java.util.PropertyResourceBundle;
-
-import com.sun.org.apache.xerces.internal.util.MessageFormatter;
-import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
-
-/**
- * XMLMessageFormatter provides error messages for the XML 1.0 Recommendation and for
- * the Namespaces Recommendation
- *
- * @xerces.internal
- *
- * @author Eric Ye, IBM
- * @version $Id: XMLMessageFormatter_ja.java 3094 2012-03-21 05:50:01Z joehw $
- *
- */
-public class XMLMessageFormatter_ja implements MessageFormatter {
- /**
- * The domain of messages concerning the XML 1.0 specification.
- */
- public static final String XML_DOMAIN = "http://www.w3.org/TR/1998/REC-xml-19980210";
- public static final String XMLNS_DOMAIN = "http://www.w3.org/TR/1999/REC-xml-names-19990114";
-
- // private objects to cache the locale and resource bundle
- private Locale fLocale = null;
- private ResourceBundle fResourceBundle = null;
-
- //
- // MessageFormatter methods
- //
-
- /**
- * Formats a message with the specified arguments using the given
- * locale information.
- *
- * @param locale The locale of the message.
- * @param key The message key.
- * @param arguments The message replacement text arguments. The order
- * of the arguments must match that of the placeholders
- * in the actual message.
- *
- * @return Returns the formatted message.
- *
- * @throws MissingResourceException Thrown if the message with the
- * specified key cannot be found.
- */
- public String formatMessage(Locale locale, String key, Object[] arguments)
- throws MissingResourceException {
-
- if (fResourceBundle == null || locale != fLocale) {
- if (locale != null) {
- fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages", locale);
- // memorize the most-recent locale
- fLocale = locale;
- }
- if (fResourceBundle == null)
- fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages");
- }
-
- // format message
- String msg;
- try {
- msg = fResourceBundle.getString(key);
- if (arguments != null) {
- try {
- msg = java.text.MessageFormat.format(msg, arguments);
- }
- catch (Exception e) {
- msg = fResourceBundle.getString("FormatFailed");
- msg += " " + fResourceBundle.getString(key);
- }
- }
- }
-
- // error
- catch (MissingResourceException e) {
- msg = fResourceBundle.getString("BadMessageKey");
- throw new MissingResourceException(key, msg, key);
- }
-
- // no message
- if (msg == null) {
- msg = key;
- if (arguments.length > 0) {
- StringBuffer str = new StringBuffer(msg);
- str.append('?');
- for (int i = 0; i < arguments.length; i++) {
- if (i > 0) {
- str.append('&');
- }
- str.append(String.valueOf(arguments[i]));
- }
- }
- }
-
- return msg;
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_ko.java b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_ko.java
deleted file mode 100644
index 3de7757..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_ko.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.msg;
-
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-import java.util.PropertyResourceBundle;
-
-import com.sun.org.apache.xerces.internal.util.MessageFormatter;
-import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
-
-/**
- * XMLMessageFormatter provides error messages for the XML 1.0 Recommendation and for
- * the Namespaces Recommendation
- *
- * @xerces.internal
- *
- * @author Eric Ye, IBM
- * @version $Id: XMLMessageFormatter_ko.java 3094 2012-03-21 05:50:01Z joehw $
- *
- */
-public class XMLMessageFormatter_ko implements MessageFormatter {
- /**
- * The domain of messages concerning the XML 1.0 specification.
- */
- public static final String XML_DOMAIN = "http://www.w3.org/TR/1998/REC-xml-19980210";
- public static final String XMLNS_DOMAIN = "http://www.w3.org/TR/1999/REC-xml-names-19990114";
-
- // private objects to cache the locale and resource bundle
- private Locale fLocale = null;
- private ResourceBundle fResourceBundle = null;
-
- //
- // MessageFormatter methods
- //
-
- /**
- * Formats a message with the specified arguments using the given
- * locale information.
- *
- * @param locale The locale of the message.
- * @param key The message key.
- * @param arguments The message replacement text arguments. The order
- * of the arguments must match that of the placeholders
- * in the actual message.
- *
- * @return Returns the formatted message.
- *
- * @throws MissingResourceException Thrown if the message with the
- * specified key cannot be found.
- */
- public String formatMessage(Locale locale, String key, Object[] arguments)
- throws MissingResourceException {
-
- if (fResourceBundle == null || locale != fLocale) {
- if (locale != null) {
- fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages", locale);
- // memorize the most-recent locale
- fLocale = locale;
- }
- if (fResourceBundle == null)
- fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages");
- }
-
- // format message
- String msg;
- try {
- msg = fResourceBundle.getString(key);
- if (arguments != null) {
- try {
- msg = java.text.MessageFormat.format(msg, arguments);
- }
- catch (Exception e) {
- msg = fResourceBundle.getString("FormatFailed");
- msg += " " + fResourceBundle.getString(key);
- }
- }
- }
-
- // error
- catch (MissingResourceException e) {
- msg = fResourceBundle.getString("BadMessageKey");
- throw new MissingResourceException(key, msg, key);
- }
-
- // no message
- if (msg == null) {
- msg = key;
- if (arguments.length > 0) {
- StringBuffer str = new StringBuffer(msg);
- str.append('?');
- for (int i = 0; i < arguments.length; i++) {
- if (i > 0) {
- str.append('&');
- }
- str.append(String.valueOf(arguments[i]));
- }
- }
- }
-
- return msg;
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_pt_BR.java b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_pt_BR.java
deleted file mode 100644
index 59b3d1d..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_pt_BR.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.msg;
-
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-import java.util.PropertyResourceBundle;
-
-import com.sun.org.apache.xerces.internal.util.MessageFormatter;
-import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
-
-/**
- * XMLMessageFormatter provides error messages for the XML 1.0 Recommendation and for
- * the Namespaces Recommendation
- *
- * @xerces.internal
- *
- * @author Eric Ye, IBM
- * @version $Id: XMLMessageFormatter_pt_BR.java 3094 2012-03-21 05:50:01Z joehw $
- *
- */
-public class XMLMessageFormatter_pt_BR implements MessageFormatter {
- /**
- * The domain of messages concerning the XML 1.0 specification.
- */
- public static final String XML_DOMAIN = "http://www.w3.org/TR/1998/REC-xml-19980210";
- public static final String XMLNS_DOMAIN = "http://www.w3.org/TR/1999/REC-xml-names-19990114";
-
- // private objects to cache the locale and resource bundle
- private Locale fLocale = null;
- private ResourceBundle fResourceBundle = null;
-
- //
- // MessageFormatter methods
- //
-
- /**
- * Formats a message with the specified arguments using the given
- * locale information.
- *
- * @param locale The locale of the message.
- * @param key The message key.
- * @param arguments The message replacement text arguments. The order
- * of the arguments must match that of the placeholders
- * in the actual message.
- *
- * @return Returns the formatted message.
- *
- * @throws MissingResourceException Thrown if the message with the
- * specified key cannot be found.
- */
- public String formatMessage(Locale locale, String key, Object[] arguments)
- throws MissingResourceException {
-
- if (fResourceBundle == null || locale != fLocale) {
- if (locale != null) {
- fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages", locale);
- // memorize the most-recent locale
- fLocale = locale;
- }
- if (fResourceBundle == null)
- fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages");
- }
-
- // format message
- String msg;
- try {
- msg = fResourceBundle.getString(key);
- if (arguments != null) {
- try {
- msg = java.text.MessageFormat.format(msg, arguments);
- }
- catch (Exception e) {
- msg = fResourceBundle.getString("FormatFailed");
- msg += " " + fResourceBundle.getString(key);
- }
- }
- }
-
- // error
- catch (MissingResourceException e) {
- msg = fResourceBundle.getString("BadMessageKey");
- throw new MissingResourceException(key, msg, key);
- }
-
- // no message
- if (msg == null) {
- msg = key;
- if (arguments.length > 0) {
- StringBuffer str = new StringBuffer(msg);
- str.append('?');
- for (int i = 0; i < arguments.length; i++) {
- if (i > 0) {
- str.append('&');
- }
- str.append(String.valueOf(arguments[i]));
- }
- }
- }
-
- return msg;
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_sv.java b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_sv.java
deleted file mode 100644
index 00217ae..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_sv.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.msg;
-
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-import java.util.PropertyResourceBundle;
-
-import com.sun.org.apache.xerces.internal.util.MessageFormatter;
-import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
-
-/**
- * XMLMessageFormatter provides error messages for the XML 1.0 Recommendation and for
- * the Namespaces Recommendation
- *
- * @xerces.internal
- *
- * @author Eric Ye, IBM
- * @version $Id: XMLMessageFormatter_sv.java 3094 2012-03-21 05:50:01Z joehw $
- *
- */
-public class XMLMessageFormatter_sv implements MessageFormatter {
- /**
- * The domain of messages concerning the XML 1.0 specification.
- */
- public static final String XML_DOMAIN = "http://www.w3.org/TR/1998/REC-xml-19980210";
- public static final String XMLNS_DOMAIN = "http://www.w3.org/TR/1999/REC-xml-names-19990114";
-
- // private objects to cache the locale and resource bundle
- private Locale fLocale = null;
- private ResourceBundle fResourceBundle = null;
-
- //
- // MessageFormatter methods
- //
-
- /**
- * Formats a message with the specified arguments using the given
- * locale information.
- *
- * @param locale The locale of the message.
- * @param key The message key.
- * @param arguments The message replacement text arguments. The order
- * of the arguments must match that of the placeholders
- * in the actual message.
- *
- * @return Returns the formatted message.
- *
- * @throws MissingResourceException Thrown if the message with the
- * specified key cannot be found.
- */
- public String formatMessage(Locale locale, String key, Object[] arguments)
- throws MissingResourceException {
-
- if (fResourceBundle == null || locale != fLocale) {
- if (locale != null) {
- fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages", locale);
- // memorize the most-recent locale
- fLocale = locale;
- }
- if (fResourceBundle == null)
- fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages");
- }
-
- // format message
- String msg;
- try {
- msg = fResourceBundle.getString(key);
- if (arguments != null) {
- try {
- msg = java.text.MessageFormat.format(msg, arguments);
- }
- catch (Exception e) {
- msg = fResourceBundle.getString("FormatFailed");
- msg += " " + fResourceBundle.getString(key);
- }
- }
- }
-
- // error
- catch (MissingResourceException e) {
- msg = fResourceBundle.getString("BadMessageKey");
- throw new MissingResourceException(key, msg, key);
- }
-
- // no message
- if (msg == null) {
- msg = key;
- if (arguments.length > 0) {
- StringBuffer str = new StringBuffer(msg);
- str.append('?');
- for (int i = 0; i < arguments.length; i++) {
- if (i > 0) {
- str.append('&');
- }
- str.append(String.valueOf(arguments[i]));
- }
- }
- }
-
- return msg;
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_zh_CN.java b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_zh_CN.java
deleted file mode 100644
index 4cfa968..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_zh_CN.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.msg;
-
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-import java.util.PropertyResourceBundle;
-
-import com.sun.org.apache.xerces.internal.util.MessageFormatter;
-import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
-
-/**
- * XMLMessageFormatter provides error messages for the XML 1.0 Recommendation and for
- * the Namespaces Recommendation
- *
- * @xerces.internal
- *
- * @author Eric Ye, IBM
- * @version $Id: XMLMessageFormatter_zh_CN.java 3094 2012-03-21 05:50:01Z joehw $
- *
- */
-public class XMLMessageFormatter_zh_CN implements MessageFormatter {
- /**
- * The domain of messages concerning the XML 1.0 specification.
- */
- public static final String XML_DOMAIN = "http://www.w3.org/TR/1998/REC-xml-19980210";
- public static final String XMLNS_DOMAIN = "http://www.w3.org/TR/1999/REC-xml-names-19990114";
-
- // private objects to cache the locale and resource bundle
- private Locale fLocale = null;
- private ResourceBundle fResourceBundle = null;
-
- //
- // MessageFormatter methods
- //
-
- /**
- * Formats a message with the specified arguments using the given
- * locale information.
- *
- * @param locale The locale of the message.
- * @param key The message key.
- * @param arguments The message replacement text arguments. The order
- * of the arguments must match that of the placeholders
- * in the actual message.
- *
- * @return Returns the formatted message.
- *
- * @throws MissingResourceException Thrown if the message with the
- * specified key cannot be found.
- */
- public String formatMessage(Locale locale, String key, Object[] arguments)
- throws MissingResourceException {
-
- if (fResourceBundle == null || locale != fLocale) {
- if (locale != null) {
- fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages", locale);
- // memorize the most-recent locale
- fLocale = locale;
- }
- if (fResourceBundle == null)
- fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages");
- }
-
- // format message
- String msg;
- try {
- msg = fResourceBundle.getString(key);
- if (arguments != null) {
- try {
- msg = java.text.MessageFormat.format(msg, arguments);
- }
- catch (Exception e) {
- msg = fResourceBundle.getString("FormatFailed");
- msg += " " + fResourceBundle.getString(key);
- }
- }
- }
-
- // error
- catch (MissingResourceException e) {
- msg = fResourceBundle.getString("BadMessageKey");
- throw new MissingResourceException(key, msg, key);
- }
-
- // no message
- if (msg == null) {
- msg = key;
- if (arguments.length > 0) {
- StringBuffer str = new StringBuffer(msg);
- str.append('?');
- for (int i = 0; i < arguments.length; i++) {
- if (i > 0) {
- str.append('&');
- }
- str.append(String.valueOf(arguments[i]));
- }
- }
- }
-
- return msg;
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_zh_TW.java b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_zh_TW.java
deleted file mode 100644
index 4f34fa2..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_zh_TW.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.msg;
-
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-import java.util.PropertyResourceBundle;
-
-import com.sun.org.apache.xerces.internal.util.MessageFormatter;
-import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
-
-/**
- * XMLMessageFormatter provides error messages for the XML 1.0 Recommendation and for
- * the Namespaces Recommendation
- *
- * @xerces.internal
- *
- * @author Eric Ye, IBM
- * @version $Id: XMLMessageFormatter_zh_TW.java 3094 2012-03-21 05:50:01Z joehw $
- *
- */
-public class XMLMessageFormatter_zh_TW implements MessageFormatter {
- /**
- * The domain of messages concerning the XML 1.0 specification.
- */
- public static final String XML_DOMAIN = "http://www.w3.org/TR/1998/REC-xml-19980210";
- public static final String XMLNS_DOMAIN = "http://www.w3.org/TR/1999/REC-xml-names-19990114";
-
- // private objects to cache the locale and resource bundle
- private Locale fLocale = null;
- private ResourceBundle fResourceBundle = null;
-
- //
- // MessageFormatter methods
- //
-
- /**
- * Formats a message with the specified arguments using the given
- * locale information.
- *
- * @param locale The locale of the message.
- * @param key The message key.
- * @param arguments The message replacement text arguments. The order
- * of the arguments must match that of the placeholders
- * in the actual message.
- *
- * @return Returns the formatted message.
- *
- * @throws MissingResourceException Thrown if the message with the
- * specified key cannot be found.
- */
- public String formatMessage(Locale locale, String key, Object[] arguments)
- throws MissingResourceException {
-
- if (fResourceBundle == null || locale != fLocale) {
- if (locale != null) {
- fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages", locale);
- // memorize the most-recent locale
- fLocale = locale;
- }
- if (fResourceBundle == null)
- fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLMessages");
- }
-
- // format message
- String msg;
- try {
- msg = fResourceBundle.getString(key);
- if (arguments != null) {
- try {
- msg = java.text.MessageFormat.format(msg, arguments);
- }
- catch (Exception e) {
- msg = fResourceBundle.getString("FormatFailed");
- msg += " " + fResourceBundle.getString(key);
- }
- }
- }
-
- // error
- catch (MissingResourceException e) {
- msg = fResourceBundle.getString("BadMessageKey");
- throw new MissingResourceException(key, msg, key);
- }
-
- // no message
- if (msg == null) {
- msg = key;
- if (arguments.length > 0) {
- StringBuffer str = new StringBuffer(msg);
- str.append('?');
- for (int i = 0; i < arguments.length; i++) {
- if (i > 0) {
- str.append('&');
- }
- str.append(String.valueOf(arguments[i]));
- }
- }
- }
-
- return msg;
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages.properties
deleted file mode 100644
index 01531f7..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages.properties
+++ /dev/null
@@ -1,305 +0,0 @@
-# This file contains error and warning messages related to XML
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-# @version
-
- BadMessageKey = The error message corresponding to the message key can not be found.
- FormatFailed = An internal error occurred while formatting the following message:\n
-
-# Document messages
- PrematureEOF=Premature end of file.
-# 2.1 Well-Formed XML Documents
- RootElementRequired = The root element is required in a well-formed document.
-# 2.2 Characters
-
- InvalidCharInCDSect = An invalid XML character (Unicode: 0x{0}) was found in the CDATA section.
- InvalidCharInContent = An invalid XML character (Unicode: 0x{0}) was found in the element content of the document.
- TwoColonsInQName = An invalid second ':' was found in the element type or attribute name.
- ColonNotLegalWithNS = A colon is not allowed in the name ''{0}'' when namespaces are enabled.
- InvalidCharInMisc = An invalid XML character (Unicode: 0x{0}) was found in markup after the end of the element content.
- InvalidCharInProlog = An invalid XML character (Unicode: 0x{0}) was found in the prolog of the document.
- InvalidCharInXMLDecl = An invalid XML character (Unicode: 0x{0}) was found in the XML declaration.
-# 2.4 Character Data and Markup
- CDEndInContent = The character sequence \"]]>\" must not appear in content unless used to mark the end of a CDATA section.
-# 2.7 CDATA Sections
- CDSectUnterminated = The CDATA section must end with \"]]>\".
-# 2.8 Prolog and Document Type Declaration
- XMLDeclMustBeFirst = The XML declaration may only appear at the very beginning of the document.
- EqRequiredInXMLDecl = The '' = '' character must follow \"{0}\" in the XML declaration.
- QuoteRequiredInXMLDecl = The value following \"{0}\" in the XML declaration must be a quoted string.
- XMLDeclUnterminated = The XML declaration must end with \"?>\".
- VersionInfoRequired = The version is required in the XML declaration.
- SpaceRequiredBeforeVersionInXMLDecl = White space is required before the version pseudo attribute in the XML declaration.
- SpaceRequiredBeforeEncodingInXMLDecl = White space is required before the encoding pseudo attribute in the XML declaration.
- SpaceRequiredBeforeStandalone = White space is required before the encoding pseudo attribute in the XML declaration.
- MarkupNotRecognizedInProlog = The markup in the document preceding the root element must be well-formed.
- MarkupNotRecognizedInMisc = The markup in the document following the root element must be well-formed.
- AlreadySeenDoctype = Already seen doctype.
- DoctypeNotAllowed = DOCTYPE is disallowed when the feature "http://apache.org/xml/features/disallow-doctype-decl" set to true.
- ContentIllegalInProlog = Content is not allowed in prolog.
- ReferenceIllegalInProlog = Reference is not allowed in prolog.
-# Trailing Misc
- ContentIllegalInTrailingMisc=Content is not allowed in trailing section.
- ReferenceIllegalInTrailingMisc=Reference is not allowed in trailing section.
-
-# 2.9 Standalone Document Declaration
- SDDeclInvalid = The standalone document declaration value must be \"yes\" or \"no\", not \"{0}\".
- SDDeclNameInvalid = The standalone name in XML declaration may be misspelled.
-# 2.12 Language Identification
- XMLLangInvalid = The xml:lang attribute value \"{0}\" is an invalid language identifier.
-# 3. Logical Structures
- ETagRequired = The element type \"{0}\" must be terminated by the matching end-tag \"</{0}>\".
-# 3.1 Start-Tags, End-Tags, and Empty-Element Tags
- ElementUnterminated = Element type \"{0}\" must be followed by either attribute specifications, \">\" or \"/>\".
- EqRequiredInAttribute = Attribute name \"{1}\" associated with an element type \"{0}\" must be followed by the '' = '' character.
- OpenQuoteExpected = Open quote is expected for attribute \"{1}\" associated with an element type \"{0}\".
- CloseQuoteExpected = Close quote is expected for attribute \"{1}\" associated with an element type \"{0}\".
- AttributeNotUnique = Attribute \"{1}\" was already specified for element \"{0}\".
- AttributeNSNotUnique = Attribute \"{1}\" bound to namespace \"{2}\" was already specified for element \"{0}\".
- ETagUnterminated = The end-tag for element type \"{0}\" must end with a ''>'' delimiter.
- MarkupNotRecognizedInContent = The content of elements must consist of well-formed character data or markup.
- DoctypeIllegalInContent = A DOCTYPE is not allowed in content.
-# 4.1 Character and Entity References
- ReferenceUnterminated = The reference must be terminated by a ';' delimiter.
-# 4.3.2 Well-Formed Parsed Entities
- ReferenceNotInOneEntity = The reference must be entirely contained within the same parsed entity.
- ElementEntityMismatch = The element \"{0}\" must start and end within the same entity.
- MarkupEntityMismatch=XML document structures must start and end within the same entity.
-
-# Messages common to Document and DTD
-# 2.2 Characters
- InvalidCharInAttValue = An invalid XML character (Unicode: 0x{2}) was found in the value of attribute \"{1}\" and element is \"{0}\".
- InvalidCharInComment = An invalid XML character (Unicode: 0x{0}) was found in the comment.
- InvalidCharInPI = An invalid XML character (Unicode: 0x{0}) was found in the processing instruction.
- InvalidCharInInternalSubset = An invalid XML character (Unicode: 0x{0}) was found in the internal subset of the DTD.
- InvalidCharInTextDecl = An invalid XML character (Unicode: 0x{0}) was found in the text declaration.
-# 2.3 Common Syntactic Constructs
- QuoteRequiredInAttValue = The value of attribute \"{1}\" must begin with either a single or double quote character.
- LessthanInAttValue = The value of attribute \"{1}\" associated with an element type \"{0}\" must not contain the ''<'' character.
- AttributeValueUnterminated = The value for attribute \"{1}\" must end with the matching quote character.
-# 2.5 Comments
- InvalidCommentStart = Comment must start with \"<!--\".
- DashDashInComment = The string \"--\" is not permitted within comments.
- CommentUnterminated = The comment must end with \"-->\".
- COMMENT_NOT_IN_ONE_ENTITY = The comment is not enclosed xin the same entity.
-# 2.6 Processing Instructions
- PITargetRequired = The processing instruction must begin with the name of the target.
- SpaceRequiredInPI = White space is required between the processing instruction target and data.
- PIUnterminated = The processing instruction must end with \"?>\".
- ReservedPITarget = The processing instruction target matching \"[xX][mM][lL]\" is not allowed.
- PI_NOT_IN_ONE_ENTITY = The processing instruction is not enclosed in the same entity.
-# 2.8 Prolog and Document Type Declaration
- VersionInfoInvalid = Invalid version \"{0}\".
- VersionNotSupported = XML version \"{0}\" is not supported, only XML 1.0 is supported.
- VersionNotSupported11 = XML version \"{0}\" is not supported, only XML 1.0 and XML 1.1 are supported.
- VersionMismatch= An entity cannot include another entity of a later version.
-# 4.1 Character and Entity References
- DigitRequiredInCharRef = A decimal representation must immediately follow the \"&#\" in a character reference.
- HexdigitRequiredInCharRef = A hexadecimal representation must immediately follow the \"&#x\" in a character reference.
- SemicolonRequiredInCharRef = The character reference must end with the ';' delimiter.
- InvalidCharRef = Character reference \"&#{0}\" is an invalid XML character.
- NameRequiredInReference = The entity name must immediately follow the '&' in the entity reference.
- SemicolonRequiredInReference = The reference to entity \"{0}\" must end with the '';'' delimiter.
-# 4.3.1 The Text Declaration
- TextDeclMustBeFirst = The text declaration may only appear at the very beginning of the external parsed entity.
- EqRequiredInTextDecl = The '' = '' character must follow \"{0}\" in the text declaration.
- QuoteRequiredInTextDecl = The value following \"{0}\" in the text declaration must be a quoted string.
- CloseQuoteMissingInTextDecl = closing quote in the value following \"{0}\" in the text declaration is missing.
- SpaceRequiredBeforeVersionInTextDecl = White space is required before the version pseudo attribute in the text declaration.
- SpaceRequiredBeforeEncodingInTextDecl = White space is required before the encoding pseudo attribute in the text declaration.
- TextDeclUnterminated = The text declaration must end with \"?>\".
- EncodingDeclRequired = The encoding declaration is required in the text declaration.
- NoMorePseudoAttributes = No more pseudo attributes are allowed.
- MorePseudoAttributes = More pseudo attributes are expected.
- PseudoAttrNameExpected = A pseudo attribute name is expected.
-# 4.3.2 Well-Formed Parsed Entities
- CommentNotInOneEntity = The comment must be entirely contained within the same parsed entity.
- PINotInOneEntity = The processing instruction must be entirely contained within the same parsed entity.
-# 4.3.3 Character Encoding in Entities
- EncodingDeclInvalid = Invalid encoding name \"{0}\".
- EncodingByteOrderUnsupported = Given byte order for encoding \"{0}\" is not supported.
- InvalidByte = Invalid byte {0} of {1}-byte UTF-8 sequence.
- ExpectedByte = Expected byte {0} of {1}-byte UTF-8 sequence.
- InvalidHighSurrogate = High surrogate bits in UTF-8 sequence must not exceed 0x10 but found 0x{0}.
- OperationNotSupported = Operation \"{0}\" not supported by {1} reader.
- InvalidASCII = Byte \"{0}\" is not a member of the (7-bit) ASCII character set.
- CharConversionFailure = An entity determined to be in a certain encoding must not contain sequences illegal in that encoding.
-
-# DTD Messages
-# 2.2 Characters
- InvalidCharInEntityValue = An invalid XML character (Unicode: 0x{0}) was found in the literal entity value.
- InvalidCharInExternalSubset = An invalid XML character (Unicode: 0x{0}) was found in the external subset of the DTD.
- InvalidCharInIgnoreSect = An invalid XML character (Unicode: 0x{0}) was found in the excluded conditional section.
- InvalidCharInPublicID = An invalid XML character (Unicode: 0x{0}) was found in the public identifier.
- InvalidCharInSystemID = An invalid XML character (Unicode: 0x{0}) was found in the system identifier.
-# 2.3 Common Syntactic Constructs
- SpaceRequiredAfterSYSTEM = White space is required after keyword SYSTEM in DOCTYPE decl.
- QuoteRequiredInSystemID = The system identifier must begin with either a single or double quote character.
- SystemIDUnterminated = The system identifier must end with the matching quote character.
- SpaceRequiredAfterPUBLIC = White spaces are required after keyword PUBLIC in DOCTYPE decl.
- QuoteRequiredInPublicID = The public identifier must begin with either a single or double quote character.
- PublicIDUnterminated = The public identifier must end with the matching quote character.
- PubidCharIllegal = The character (Unicode: 0x{0}) is not permitted in the public identifier.
- SpaceRequiredBetweenPublicAndSystem = White spaces are required between publicId and systemId.
-# 2.8 Prolog and Document Type Declaration
- MSG_SPACE_REQUIRED_BEFORE_ROOT_ELEMENT_TYPE_IN_DOCTYPEDECL = White space is required after \"<!DOCTYPE\" in the document type declaration.
- MSG_ROOT_ELEMENT_TYPE_REQUIRED = The root element type must appear after \"<!DOCTYPE\" in the document type declaration.
- DoctypedeclUnterminated = The document type declaration for root element type \"{0}\" must end with ''>''.
- DoctypedeclNotClosed = The document type declaration for root element type \"{0}\" must be closed with '']''.
- PEReferenceWithinMarkup = The parameter entity reference \"%{0};\" cannot occur within markup in the internal subset of the DTD.
- MSG_MARKUP_NOT_RECOGNIZED_IN_DTD = The markup declarations contained or pointed to by the document type declaration must be well-formed.
-# 2.10 White Space Handling
- MSG_XML_SPACE_DECLARATION_ILLEGAL = The attribute declaration for \"xml:space\" must be given as an enumerated type whose only possible values are \"default\" and \"preserve\".
-# 3.2 Element Type Declarations
- MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ELEMENTDECL = White space is required after \"<!ELEMENT\" in the element type declaration.
- MSG_ELEMENT_TYPE_REQUIRED_IN_ELEMENTDECL = The element type is required in the element type declaration.
- MSG_SPACE_REQUIRED_BEFORE_CONTENTSPEC_IN_ELEMENTDECL = White space is required after the element type \"{0}\" in the element type declaration.
- MSG_CONTENTSPEC_REQUIRED_IN_ELEMENTDECL = The constraint is required after the element type \"{0}\" in the element type declaration.
- ElementDeclUnterminated = The declaration for element type \"{0}\" must end with ''>''.
-# 3.2.1 Element Content
- MSG_OPEN_PAREN_OR_ELEMENT_TYPE_REQUIRED_IN_CHILDREN = A ''('' character or an element type is required in the declaration of element type \"{0}\".
- MSG_CLOSE_PAREN_REQUIRED_IN_CHILDREN = A '')'' is required in the declaration of element type \"{0}\".
-# 3.2.2 Mixed Content
- MSG_ELEMENT_TYPE_REQUIRED_IN_MIXED_CONTENT = An element type is required in the declaration of element type \"{0}\".
- MSG_CLOSE_PAREN_REQUIRED_IN_MIXED = A '')'' is required in the declaration of element type \"{0}\".
- MixedContentUnterminated = The mixed content model \"{0}\" must end with \")*\" when the types of child elements are constrained.
-# 3.3 Attribute-List Declarations
- MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ATTLISTDECL = White space is required after \"<!ATTLIST\" in the attribute-list declaration.
- MSG_ELEMENT_TYPE_REQUIRED_IN_ATTLISTDECL = The element type is required in the attribute-list declaration.
- MSG_SPACE_REQUIRED_BEFORE_ATTRIBUTE_NAME_IN_ATTDEF = White space is required before the attribute name in the attribute-list declaration for element \"{0}\".
- AttNameRequiredInAttDef = The attribute name must be specified in the attribute-list declaration for element \"{0}\".
- MSG_SPACE_REQUIRED_BEFORE_ATTTYPE_IN_ATTDEF = White space is required before the attribute type in the declaration of attribute \"{1}\" for element \"{0}\".
- AttTypeRequiredInAttDef = The attribute type is required in the declaration of attribute \"{1}\" for element \"{0}\".
- MSG_SPACE_REQUIRED_BEFORE_DEFAULTDECL_IN_ATTDEF = White space is required before the attribute default in the declaration of attribute \"{1}\" for element \"{0}\".
- MSG_DUPLICATE_ATTRIBUTE_DEFINITION = More than one attribute definition is provided for the same attribute \"{1}\" of a given element \"{0}\".
-# 3.3.1 Attribute Types
- MSG_SPACE_REQUIRED_AFTER_NOTATION_IN_NOTATIONTYPE = White space must appear after \"NOTATION\" in the \"{1}\" attribute declaration.
- MSG_OPEN_PAREN_REQUIRED_IN_NOTATIONTYPE = The ''('' character must follow \"NOTATION\" in the \"{1}\" attribute declaration.
- MSG_NAME_REQUIRED_IN_NOTATIONTYPE = The notation name is required in the notation type list for the \"{1}\" attribute declaration.
- NotationTypeUnterminated = The notation type list must end with '')'' in the \"{1}\" attribute declaration.
- MSG_NMTOKEN_REQUIRED_IN_ENUMERATION = The name token is required in the enumerated type list for the \"{1}\" attribute declaration.
- EnumerationUnterminated = The enumerated type list must end with '')'' in the \"{1}\" attribute declaration.
- MSG_DISTINCT_TOKENS_IN_ENUMERATION = The enumeration value \"{1}\" was specified more than once in the declaration of attribute \"{2}\" for element \"{0}\". The NMTOKENS in a single Enumeration attribute declaration must all be distinct.
- MSG_DISTINCT_NOTATION_IN_ENUMERATION = The enumeration value \"{1}\" was specified more than once in the declaration of attribute \"{2}\" for element \"{0}\". The NOTATION names in a single NotationType attribute declaration must all be distinct.
-# 3.3.2 Attribute Defaults
- MSG_SPACE_REQUIRED_AFTER_FIXED_IN_DEFAULTDECL = White space must appear after \"FIXED\" in the \"{1}\" attribute declaration.
-# 3.4 Conditional Sections
- IncludeSectUnterminated = The included conditional section must end with \"]]>\".
- IgnoreSectUnterminated = The excluded conditional section must end with \"]]>\".
-# 4.1 Character and Entity References
- NameRequiredInPEReference = The entity name must immediately follow the '%' in the parameter entity reference.
- SemicolonRequiredInPEReference = The parameter entity reference \"%{0};\" must end with the '';'' delimiter.
-# 4.2 Entity Declarations
- MSG_SPACE_REQUIRED_BEFORE_ENTITY_NAME_IN_ENTITYDECL = White space is required after \"<!ENTITY\" in the entity declaration.
- MSG_SPACE_REQUIRED_BEFORE_PERCENT_IN_PEDECL = White space is required between \"<!ENTITY\" and the '%' character in the parameter entity declaration.
- MSG_SPACE_REQUIRED_BEFORE_ENTITY_NAME_IN_PEDECL = White space is required between the '%' and the entity name in the parameter entity declaration.
- MSG_ENTITY_NAME_REQUIRED_IN_ENTITYDECL = The name of the entity is required in the entity declaration.
- MSG_SPACE_REQUIRED_AFTER_ENTITY_NAME_IN_ENTITYDECL = White space is required between the entity name \"{0}\" and the definition in the entity declaration.
- MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_UNPARSED_ENTITYDECL = White space is required between \"NDATA\" and the notation name in the declaration for the entity \"{0}\".
- MSG_SPACE_REQUIRED_BEFORE_NDATA_IN_UNPARSED_ENTITYDECL = White space is required before \"NDATA\" in the declaration for the entity \"{0}\".
- MSG_NOTATION_NAME_REQUIRED_FOR_UNPARSED_ENTITYDECL = The notation name is required after \"NDATA\" in the declaration for the entity \"{0}\".
- EntityDeclUnterminated = The declaration for the entity \"{0}\" must end with ''>''.
- MSG_DUPLICATE_ENTITY_DEFINITION = Entity \"{0}\" is declared more than once.
-# 4.2.2 External Entities
- ExternalIDRequired = The external entity declaration must begin with either \"SYSTEM\" or \"PUBLIC\".
- MSG_SPACE_REQUIRED_BEFORE_PUBIDLITERAL_IN_EXTERNALID = White space is required between \"PUBLIC\" and the public identifier.
- MSG_SPACE_REQUIRED_AFTER_PUBIDLITERAL_IN_EXTERNALID = White space is required between the public identifier and the system identifier.
- MSG_SPACE_REQUIRED_BEFORE_SYSTEMLITERAL_IN_EXTERNALID = White space is required between \"SYSTEM\" and the system identifier.
- MSG_URI_FRAGMENT_IN_SYSTEMID = The fragment identifier should not be specified as part of the system identifier \"{0}\".
-# 4.7 Notation Declarations
- MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_NOTATIONDECL = White space is required after \"<!NOTATION\" in the notation declaration.
- MSG_NOTATION_NAME_REQUIRED_IN_NOTATIONDECL = The name of the notation is required in the notation declaration.
- MSG_SPACE_REQUIRED_AFTER_NOTATION_NAME_IN_NOTATIONDECL = White space is required after the notation name \"{0}\" in the notation declaration.
- ExternalIDorPublicIDRequired = The declaration for the notation \"{0}\" must include a system or public identifier.
- NotationDeclUnterminated = The declaration for the notation \"{0}\" must end with ''>''.
-
-# Validation messages
- DuplicateTypeInMixedContent = The element type \"{1}\" was already specified in the content model of the element decl \"{0}\".
- ENTITIESInvalid = Attribute value \"{1}\" of type ENTITIES must be the names of one or more unparsed entities.
- ENTITYInvalid = Attribute value \"{1}\" of type ENTITY must be the name of an unparsed entity.
- IDDefaultTypeInvalid = The ID attribute \"{0}\" must have a declared default of \"#IMPLIED\" or \"#REQUIRED\".
- IDInvalid = Attribute value \"{0}\" of type ID must be a name.
- IDInvalidWithNamespaces = Attribute value \"{0}\" of type ID must be an NCName when namespaces are enabled.
- IDNotUnique = Attribute value \"{0}\" of type ID must be unique within the document.
- IDREFInvalid = Attribute value \"{0}\" of type IDREF must be a name.
- IDREFInvalidWithNamespaces = Attribute value \"{0}\" of type IDREF must be an NCName when namespaces are enabled.
- IDREFSInvalid = Attribute value \"{0}\" of type IDREFS must be one or more names.
- ILL_FORMED_PARAMETER_ENTITY_WHEN_USED_IN_DECL = The replacement text of parameter entity \"{0}\" must include properly nested declarations when the entity reference is used as a complete declaration.
- ImproperDeclarationNesting = The replacement text of parameter entity \"{0}\" must include properly nested declarations.
- ImproperGroupNesting = The replacement text of parameter entity \"{0}\" must include properly nested pairs of parentheses.
- INVALID_PE_IN_CONDITIONAL = The replacement text of parameter entity \"{0}\" must include the entire conditional section or just INCLUDE or IGNORE.
- MSG_ATTRIBUTE_NOT_DECLARED = Attribute \"{1}\" must be declared for element type \"{0}\".
- MSG_ATTRIBUTE_VALUE_NOT_IN_LIST = Attribute \"{0}\" with value \"{1}\" must have a value from the list \"{2}\".
- MSG_ATTVALUE_CHANGED_DURING_NORMALIZATION_WHEN_STANDALONE = The value \"{1}\" of attribute \"{0}\" must not be changed by normalization (to \"{2}\") in a standalone document.
- MSG_CONTENT_INCOMPLETE = The content of element type \"{0}\" is incomplete, it must match \"{1}\".
- MSG_CONTENT_INVALID = The content of element type \"{0}\" must match \"{1}\".
- MSG_CONTENT_INVALID_SPECIFIED = The content of element type \"{0}\" must match \"{1}\". Children of type \"{2}\" are not allowed.
- MSG_DEFAULTED_ATTRIBUTE_NOT_SPECIFIED = Attribute \"{1}\" for element type \"{0}\" has a default value and must be specified in a standalone document.
- MSG_DUPLICATE_ATTDEF = Attribute \"{1}\" is already declared for element type \"{0}\".
- MSG_ELEMENT_ALREADY_DECLARED = Element type \"{0}\" must not be declared more than once.
- MSG_ELEMENT_NOT_DECLARED = Element type \"{0}\" must be declared.
- MSG_GRAMMAR_NOT_FOUND = Document is invalid: no grammar found.
- MSG_ELEMENT_WITH_ID_REQUIRED = An element with the identifier \"{0}\" must appear in the document.
- MSG_EXTERNAL_ENTITY_NOT_PERMITTED = The reference to external entity \"{0}\" is not permitted in a standalone document.
- MSG_FIXED_ATTVALUE_INVALID = Attribute \"{1}\" with value \"{2}\" must have a value of \"{3}\".
- MSG_MORE_THAN_ONE_ID_ATTRIBUTE = Element type \"{0}\" already has attribute \"{1}\" of type ID, a second attribute \"{2}\" of type ID is not permitted.
- MSG_MORE_THAN_ONE_NOTATION_ATTRIBUTE = Element type \"{0}\" already has attribute \"{1}\" of type NOTATION, a second attribute \"{2}\" of type NOTATION is not permitted.
- MSG_NOTATION_NOT_DECLARED_FOR_NOTATIONTYPE_ATTRIBUTE = The notation \"{1}\" must be declared when referenced in the notation type list for attribute \"{0}\".
- MSG_NOTATION_NOT_DECLARED_FOR_UNPARSED_ENTITYDECL = The notation \"{1}\" must be declared when referenced in the unparsed entity declaration for \"{0}\".
- MSG_REFERENCE_TO_EXTERNALLY_DECLARED_ENTITY_WHEN_STANDALONE = The reference to entity \"{0}\" declared in an external parsed entity is not permitted in a standalone document.
- MSG_REQUIRED_ATTRIBUTE_NOT_SPECIFIED = Attribute \"{1}\" is required and must be specified for element type \"{0}\".
- MSG_WHITE_SPACE_IN_ELEMENT_CONTENT_WHEN_STANDALONE = White space must not occur between elements declared in an external parsed entity with element content in a standalone document.
- NMTOKENInvalid = Attribute value \"{0}\" of type NMTOKEN must be a name token.
- NMTOKENSInvalid = Attribute value \"{0}\" of type NMTOKENS must be one or more name tokens.
- NoNotationOnEmptyElement = Element type \"{0}\" which was declared EMPTY cannot declare attribute \"{1}\" of type NOTATION.
- RootElementTypeMustMatchDoctypedecl = Document root element \"{1}\", must match DOCTYPE root \"{0}\".
- UndeclaredElementInContentSpec = The content model of element \"{0}\" refers to the undeclared element \"{1}\".
- UniqueNotationName = The declaration for the notation \"{0}\" is not unique. A given Name must not be declared in more than one notation declaration.
- ENTITYFailedInitializeGrammar = ENTITYDatatype Validator: Failed Need to call initialize method with a valid Grammar reference.
- ENTITYNotUnparsed = ENTITY \"{0}\" is not unparsed.
- ENTITYNotValid = ENTITY \"{0}\" is not valid.
- EmptyList = Value of type ENTITIES, IDREFS, and NMTOKENS cannot be empty list.
-
-# Entity related messages
-# 3.1 Start-Tags, End-Tags, and Empty-Element Tags
- ReferenceToExternalEntity = The external entity reference \"&{0};\" is not permitted in an attribute value.
- AccessExternalDTD = External DTD: Failed to read external DTD ''{0}'', because ''{1}'' access is not allowed due to restriction set by the accessExternalDTD property.
- AccessExternalEntity = External Entity: Failed to read external document ''{0}'', because ''{1}'' access is not allowed due to restriction set by the accessExternalDTD property.
-
-# 4.1 Character and Entity References
- EntityNotDeclared = The entity \"{0}\" was referenced, but not declared.
- ReferenceToUnparsedEntity = The unparsed entity reference \"&{0};\" is not permitted.
- RecursiveReference = Recursive entity reference \"{0}\". (Reference path: {1}),
- RecursiveGeneralReference = Recursive general entity reference \"&{0};\". (Reference path: {1}),
- RecursivePEReference = Recursive parameter entity reference \"%{0};\". (Reference path: {1}),
-# 4.3.3 Character Encoding in Entities
- EncodingNotSupported = The encoding \"{0}\" is not supported.
- EncodingRequired = A parsed entity not encoded in either UTF-8 or UTF-16 must contain an encoding declaration.
-
-# Namespaces support
-# 4. Using Qualified Names
- IllegalQName = Element or attribute do not match QName production: QName::=(NCName':')?NCName.
- ElementXMLNSPrefix = Element \"{0}\" cannot have \"xmlns\" as its prefix.
- ElementPrefixUnbound = The prefix \"{0}\" for element \"{1}\" is not bound.
- AttributePrefixUnbound = The prefix \"{2}\" for attribute \"{1}\" associated with an element type \"{0}\" is not bound.
- EmptyPrefixedAttName = The value of the attribute \"{0}\" is invalid. Prefixed namespace bindings may not be empty.
- PrefixDeclared = The namespace prefix \"{0}\" was not declared.
- CantBindXMLNS = The prefix "xmlns" cannot be bound to any namespace explicitly; neither can the namespace for "xmlns" be bound to any prefix explicitly.
- CantBindXML = The prefix "xml" cannot be bound to any namespace other than its usual namespace; neither can the namespace for "xml" be bound to any prefix other than "xml".
- MSG_ATT_DEFAULT_INVALID = The defaultValue \"{1}\" of attribute \"{0}\" is not legal as for the lexical constraints of this attribute type.
-
-# REVISIT: These need messages
- MSG_SPACE_REQUIRED_AFTER_SYSTEMLITERAL_IN_EXTERNALID=MSG_SPACE_REQUIRED_AFTER_SYSTEMLITERAL_IN_EXTERNALID
- OpenQuoteMissingInDecl=OpenQuoteMissingInDecl
- InvalidCharInLiteral=InvalidCharInLiteral
-
-
-# Implementation limits
- EntityExpansionLimit=JAXP00010001: The parser has encountered more than \"{0}\" entity expansions in this document; this is the limit imposed by the JDK.
- ElementAttributeLimit=JAXP00010002: Element \"{0}\" has more than \"{1}\" attributes, \"{1}\" is the limit imposed by the JDK.
- MaxEntitySizeLimit=JAXP00010003: The length of entity \"{0}\" is \"{1}\" that exceeds the \"{2}\" limit set by \"{3}\".
- TotalEntitySizeLimit=JAXP00010004: The accumulated size of entities is \"{0}\" that exceeded the \"{1}\" limit set by \"{2}\".
- MaxXMLNameLimit=JAXP00010005: The length of entity \"{0}\" is \"{1}\" that exceeds the \"{2}\" limit set by \"{3}\".
- MaxElementDepthLimit=JAXP00010006: The element \"{0}\" has a depth of \"{1}\" that exceeds the limit \"{2}\" set by \"{3}\".
- EntityReplacementLimit=JAXP00010007: The total number of nodes in entity references is \"{0}\" that is over the limit \"{1}\" set by \"{2}\".
-
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_de.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_de.properties
deleted file mode 100644
index 0848270..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_de.properties
+++ /dev/null
@@ -1,305 +0,0 @@
-# This file contains error and warning messages related to XML
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-# @version
-
- BadMessageKey = Die zum Meldungsschl\u00FCssel geh\u00F6rige Fehlermeldung kann nicht gefunden werden.
- FormatFailed = Beim Formatieren der folgenden Meldung ist ein interner Fehler aufgetreten:\n
-
-# Document messages
- PrematureEOF=Vorzeitiges Dateiende.
-# 2.1 Well-Formed XML Documents
- RootElementRequired = Root-Element ist in einem ordnungsgem\u00E4\u00DF formatierten Dokument erforderlich.
-# 2.2 Characters
-
- InvalidCharInCDSect = Ung\u00FCltiges XML-Zeichen (Unicode: 0x{0}) wurde im CDATA-Abschnitt gefunden.
- InvalidCharInContent = Ung\u00FCltiges XML-Zeichen (Unicode: 0x{0}) wurde im Elementcontent des Dokuments gefunden.
- TwoColonsInQName = Ung\u00FCltiger zweiter ":" wurde im Elementtyp oder Attributnamen gefunden.
- ColonNotLegalWithNS = Doppelpunkt nicht zul\u00E4ssig im Namen "{0}", wenn Namespaces aktiviert sind.
- InvalidCharInMisc = Ung\u00FCltiges XML-Zeichen (Unicode: 0x{0}) wurde im Markup nach Ende des Elementcontents gefunden.
- InvalidCharInProlog = Ung\u00FCltiges XML-Zeichen (Unicode: 0x{0}) wurde im Prolog des Dokuments gefunden.
- InvalidCharInXMLDecl = Ung\u00FCltiges XML-Zeichen (Unicode: 0x{0}) wurde in der XML-Deklaration gefunden.
-# 2.4 Character Data and Markup
- CDEndInContent = Zeichenfolge""]]>" darf nur im Content enthalten sein, wenn sie das Ende eines CDATA-Abschnitts markiert.
-# 2.7 CDATA Sections
- CDSectUnterminated = CDATA-Abschnitt muss mit "]]>" enden.
-# 2.8 Prolog and Document Type Declaration
- XMLDeclMustBeFirst = XML-Deklaration darf nur ganz am Anfang des Dokuments enthalten sein.
- EqRequiredInXMLDecl = Zeichen " = " muss auf "{0}" in der XML-Deklaration folgen.
- QuoteRequiredInXMLDecl = Der Wert nach "{0}" in der XML-Deklaration muss eine Zeichenfolge in Anf\u00FChrungszeichen sein.
- XMLDeclUnterminated = XML-Deklaration muss mit "?>" enden.
- VersionInfoRequired = Version ist in der XML-Deklaration erforderlich.
- SpaceRequiredBeforeVersionInXMLDecl = Leerstelle vor dem Versionspseudoattribut in der XML-Deklaration erforderlich.
- SpaceRequiredBeforeEncodingInXMLDecl = Leerstelle vor dem Codierungspseudoattribut in der XML-Deklaration erforderlich.
- SpaceRequiredBeforeStandalone = Leerstelle vor dem Codierungspseudoattribut in der XML-Deklaration erforderlich.
- MarkupNotRecognizedInProlog = Markup im Dokument vor dem Root-Element muss ordnungsgem\u00E4\u00DF formatiert sein.
- MarkupNotRecognizedInMisc = Markup im Dokument nach dem Root-Element muss ordnungsgem\u00E4\u00DF formatiert sein.
- AlreadySeenDoctype = doctype bereits gesehen.
- DoctypeNotAllowed = DOCTYPE ist nicht zul\u00E4ssig, wenn das Feature "http://apache.org/xml/features/disallow-doctype-decl" auf "true" gesetzt ist.
- ContentIllegalInProlog = Content ist nicht zul\u00E4ssig in Prolog.
- ReferenceIllegalInProlog = Referenz ist nicht zul\u00E4ssig in Prolog.
-# Trailing Misc
- ContentIllegalInTrailingMisc=Content ist nicht zul\u00E4ssig in angeh\u00E4ngtem Abschnitt.
- ReferenceIllegalInTrailingMisc=Referenz ist nicht zul\u00E4ssig in angeh\u00E4ngtem Abschnitt.
-
-# 2.9 Standalone Document Declaration
- SDDeclInvalid = Standalone-Dokumentdeklarationswert muss "Ja" oder "Nein" und nicht "{0}" sein.
- SDDeclNameInvalid = Der Standalone-Name in der XML-Deklaration ist m\u00F6glicherweise falsch geschrieben.
-# 2.12 Language Identification
- XMLLangInvalid = xml:lang-Attributwert "{0}" ist eine ung\u00FCltige Sprach-ID.
-# 3. Logical Structures
- ETagRequired = Elementtyp "{0}" muss mit dem entsprechenden Endtag "</{0}>" beendet werden.
-# 3.1 Start-Tags, End-Tags, and Empty-Element Tags
- ElementUnterminated = Auf Elementtyp "{0}" m\u00FCssen entweder Attributspezifikationen, ">" oder "/>" folgen.
- EqRequiredInAttribute = Mit Elementtyp "{0}" verkn\u00FCpfter Attributname "{1}" muss vom Zeichen " = " gefolgt werden.
- OpenQuoteExpected = \u00D6ffnendes Anf\u00FChrungszeichen wird f\u00FCr Attribut "{1}" erwartet, das mit Elementtyp "{0}" verkn\u00FCpft ist.
- CloseQuoteExpected = Schlie\u00DFendes Anf\u00FChrungszeichen wird f\u00FCr Attribut "{1}" erwartet, das mit Elementtyp "{0}" verkn\u00FCpft ist.
- AttributeNotUnique = Attribut "{1}" wurde bereits f\u00FCr Element "{0}" angegeben.
- AttributeNSNotUnique = An Namespace "{2}" gebundenes Attribut "{1}" wurde bereits f\u00FCr Element "{0}" angegeben.
- ETagUnterminated = Endtag f\u00FCr Elementtyp "{0}" muss mit einem ">"-Begrenzungszeichen enden.
- MarkupNotRecognizedInContent = Der Content von Elementen muss aus ordnungsgem\u00E4\u00DF formatierten Zeichendaten oder Markups bestehen.
- DoctypeIllegalInContent = DOCTYPE ist nicht zul\u00E4ssig in Content.
-# 4.1 Character and Entity References
- ReferenceUnterminated = Referenz muss mit einem ";"-Begrenzungszeichen beendet werden.
-# 4.3.2 Well-Formed Parsed Entities
- ReferenceNotInOneEntity = Referenz muss vollst\u00E4ndig in derselben geparsten Entity enthalten sein.
- ElementEntityMismatch = Element "{0}" muss innerhalb derselben Entity beginnen und enden.
- MarkupEntityMismatch=XML-Dokumentstrukturen m\u00FCssen innerhalb derselben Entity beginnen und enden.
-
-# Messages common to Document and DTD
-# 2.2 Characters
- InvalidCharInAttValue = Ung\u00FCltiges XML-Zeichen (Unicode: 0x{2}) wurde im Wert des Attributs "{1}" gefunden. Element ist "{0}".
- InvalidCharInComment = Ung\u00FCltiges XML-Zeichen (Unicode: 0x{0}) wurde im Kommentar gefunden.
- InvalidCharInPI = Ung\u00FCltiges XML-Zeichen (Unicode: 0x{0}) wurde in der Verarbeitungsanweisung gefunden.
- InvalidCharInInternalSubset = Ung\u00FCltiges XML-Zeichen (Unicode: 0x{0}) wurde in der internen Teilmenge der DTD gefunden.
- InvalidCharInTextDecl = Ung\u00FCltiges XML-Zeichen (Unicode: 0x{0}) wurde in der Textdeklaration gefunden.
-# 2.3 Common Syntactic Constructs
- QuoteRequiredInAttValue = Wert des Attributs "{1}" muss mit einem einzelnen oder doppelten Anf\u00FChrungszeichen beginnen.
- LessthanInAttValue = Wert des Attributs "{1}", das mit Elementtyp "{0}" verkn\u00FCpft ist, darf nicht das Zeichen "<" enthalten.
- AttributeValueUnterminated = Wert f\u00FCr Attribut "{1}" muss mit dem entsprechenden Anf\u00FChrungszeichen enden.
-# 2.5 Comments
- InvalidCommentStart = Kommentar muss mit "<!--" beginnen.
- DashDashInComment = Zeichenfolge "--" ist in Kommentaren nicht zul\u00E4ssig.
- CommentUnterminated = Kommentar muss mit "-->" enden.
- COMMENT_NOT_IN_ONE_ENTITY = Kommentar ist nicht in derselben Entity enthalten.
-# 2.6 Processing Instructions
- PITargetRequired = Verarbeitungsanweisung muss mit dem Namen des Ziels beginnen.
- SpaceRequiredInPI = Leerstelle ist zwischen dem Ziel der Verarbeitungsanweisung und den Daten erforderlich.
- PIUnterminated = Verarbeitungsanweisung muss mit "?>" enden.
- ReservedPITarget = Verarbeitungsanweisungsziel, das "[xX][mM][lL]" entspricht, ist nicht zul\u00E4ssig.
- PI_NOT_IN_ONE_ENTITY = Verarbeitungsanweisung ist nicht in derselben Entity enthalten.
-# 2.8 Prolog and Document Type Declaration
- VersionInfoInvalid = Ung\u00FCltige Version "{0}".
- VersionNotSupported = XML-Version "{0}" wird nicht unterst\u00FCtzt. Nur XML 1.0 wird unterst\u00FCtzt.
- VersionNotSupported11 = XML-Version "{0}" wird nicht unterst\u00FCtzt. Nur XML 1.0 und XML 1.1 werden unterst\u00FCtzt.
- VersionMismatch= Eine Entity kann keine andere Entity einer sp\u00E4teren Version enthalten.
-# 4.1 Character and Entity References
- DigitRequiredInCharRef = Auf "&#" in einer Zeichenreferenz muss umgehend eine Dezimaldarstellung folgen.
- HexdigitRequiredInCharRef = Auf "&#x" in einer Zeichenreferenz muss umgehend eine hexadezimale Darstellung folgen.
- SemicolonRequiredInCharRef = Zeichenreferenz muss mit dem Begrenzungszeichen ";" enden.
- InvalidCharRef = Zeichenreferenz "&#{0}" ist ein ung\u00FCltiges XML-Zeichen.
- NameRequiredInReference = Auf "&" in der Entityreferenz muss umgehend der Entityname folgen.
- SemicolonRequiredInReference = Referenz zu Entity "{0}" muss mit dem Begrenzungszeichen ";" enden.
-# 4.3.1 The Text Declaration
- TextDeclMustBeFirst = Textdeklaration darf nur ganz am Anfang der externen geparsten Entity enthalten sein.
- EqRequiredInTextDecl = Zeichen " = " muss auf "{0}" in der Textdeklaration folgen.
- QuoteRequiredInTextDecl = Der Wert nach "{0}" in der Textdeklaration muss eine Zeichenfolge in Anf\u00FChrungszeichen sein.
- CloseQuoteMissingInTextDecl = Schlie\u00DFendes Anf\u00FChrungszeichen im Wert nach "{0}" in der Textdeklaration fehlt.
- SpaceRequiredBeforeVersionInTextDecl = Leerstelle vor dem Versionspseudoattribut in der Textdeklaration erforderlich.
- SpaceRequiredBeforeEncodingInTextDecl = Leerstelle vor dem Codierungspseudoattribut in der Textdeklaration erforderlich.
- TextDeclUnterminated = Textdeklaration muss mit "?>" enden.
- EncodingDeclRequired = Codierungsdeklaration ist in der Textdeklaration erforderlich.
- NoMorePseudoAttributes = Es sind keine weiteren Pseudoattribute zul\u00E4ssig.
- MorePseudoAttributes = Es werden weitere Pseudoattribute erwartet.
- PseudoAttrNameExpected = Pseudoattributname wird erwartet.
-# 4.3.2 Well-Formed Parsed Entities
- CommentNotInOneEntity = Kommentar muss vollst\u00E4ndig in derselben geparsten Entity enthalten sein.
- PINotInOneEntity = Verarbeitungsanweisung muss vollst\u00E4ndig in derselben geparsten Entity enthalten sein.
-# 4.3.3 Character Encoding in Entities
- EncodingDeclInvalid = Ung\u00FCltiger Codierungsname "{0}".
- EncodingByteOrderUnsupported = Angegebene Bytereihenfolge f\u00FCr die Codierung von "{0}" wird nicht unterst\u00FCtzt.
- InvalidByte = Ung\u00FCltiges Byte {0} von {1}-Byte-UTF-8-Sequenz.
- ExpectedByte = Byte {0} von {1}-Byte-UTF-8-Sequenz erwartet.
- InvalidHighSurrogate = High-Surrogate-Bits in UTF-8-Sequenz d\u00FCrfen 0x10 nicht \u00FCberschreiten, gefunden wurde aber 0x{0}.
- OperationNotSupported = Vorgang "{0}" nicht unterst\u00FCtzt von {1}-Reader.
- InvalidASCII = Byte "{0}" geh\u00F6rt nicht zum (7-Bit) ASCII-Zeichensatz.
- CharConversionFailure = Eine Entity, f\u00FCr die eine bestimmte Codierung ermittelt wurde, darf keine Sequenzen enthalten, die in dieser Codierung ung\u00FCltig sind.
-
-# DTD Messages
-# 2.2 Characters
- InvalidCharInEntityValue = Ung\u00FCltiges XML-Zeichen (Unicode: 0x{0}) wurde im literalen Entitywert gefunden.
- InvalidCharInExternalSubset = Ung\u00FCltiges XML-Zeichen (Unicode: 0x{0}) wurde in der externen Teilmenge der DTD gefunden.
- InvalidCharInIgnoreSect = Ung\u00FCltiges XML-Zeichen (Unicode: 0x{0}) wurde im ausgeschlossenen Bedingungsabschnitt gefunden.
- InvalidCharInPublicID = Ung\u00FCltiges XML-Zeichen (Unicode: 0x{0}) wurde in der \u00F6ffentlichen ID gefunden.
- InvalidCharInSystemID = Ung\u00FCltiges XML-Zeichen (Unicode: 0x{0}) wurde in der System-ID gefunden.
-# 2.3 Common Syntactic Constructs
- SpaceRequiredAfterSYSTEM = Leerstelle nach Schl\u00FCsselwort SYSTEM in DOCTYPE-Deklaration erforderlich.
- QuoteRequiredInSystemID = System-ID muss mit einem einzelnen oder doppelten Anf\u00FChrungszeichen beginnen.
- SystemIDUnterminated = System-ID muss mit dem entsprechenden Anf\u00FChrungszeichen enden.
- SpaceRequiredAfterPUBLIC = Leerstellen nach Schl\u00FCsselwort PUBLIC in DOCTYPE-Deklaration erforderlich.
- QuoteRequiredInPublicID = \u00D6ffentliche ID muss mit einem einzelnen oder doppelten Anf\u00FChrungszeichen beginnen.
- PublicIDUnterminated = \u00D6ffentliche ID muss mit dem entsprechenden Anf\u00FChrungszeichen enden.
- PubidCharIllegal = Zeichen (Unicode: 0x{0}) ist nicht zul\u00E4ssig in der \u00F6ffentlichen ID.
- SpaceRequiredBetweenPublicAndSystem = Leerstellen erforderlich zwischen publicId und systemId.
-# 2.8 Prolog and Document Type Declaration
- MSG_SPACE_REQUIRED_BEFORE_ROOT_ELEMENT_TYPE_IN_DOCTYPEDECL = Leerstelle nach "<!DOCTYPE" in der Dokumenttypdeklaration erforderlich.
- MSG_ROOT_ELEMENT_TYPE_REQUIRED = Root-Elementtyp muss nach "<!DOCTYPE" in der Dokumenttypdeklaration enthalten sein.
- DoctypedeclUnterminated = Dokumenttypdeklaration f\u00FCr Root-Elementtyp "{0}" muss mit ">" enden.
- DoctypedeclNotClosed = Dokumenttypdeklaration f\u00FCr Root-Elementtyp "{0}" muss mit '']'' enden.
- PEReferenceWithinMarkup = Parameterentityreferenz "%{0};" darf nicht in Markup in der internen Teilmenge der DTD vorkommen.
- MSG_MARKUP_NOT_RECOGNIZED_IN_DTD = Die Markup-Deklarationen, die in der Dokumenttypdeklaration enthalten sind bzw. auf die von der Dokumenttypdeklaration verwiesen wird, m\u00FCssen ordnungsgem\u00E4\u00DF formatiert sein.
-# 2.10 White Space Handling
- MSG_XML_SPACE_DECLARATION_ILLEGAL = Attributdeklaration f\u00FCr "xml:space" muss als aufgez\u00E4hlter Typ angegeben werden, dessen einzigen m\u00F6glichen Werte "default" und "preserve" sind.
-# 3.2 Element Type Declarations
- MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ELEMENTDECL = Leerstelle nach "<!ELEMENT" in der Elementtypdeklaration erforderlich.
- MSG_ELEMENT_TYPE_REQUIRED_IN_ELEMENTDECL = Elementtyp ist in der Elementtypdeklaration erforderlich.
- MSG_SPACE_REQUIRED_BEFORE_CONTENTSPEC_IN_ELEMENTDECL = Leerstelle nach Elementtyp "{0}" in der Elementtypdeklaration erforderlich.
- MSG_CONTENTSPEC_REQUIRED_IN_ELEMENTDECL = Constraint ist nach dem Elementtyp "{0}" in der Elementtypdeklaration erforderlich.
- ElementDeclUnterminated = Deklaration f\u00FCr Elementtyp "{0}" muss mit ">" enden.
-# 3.2.1 Element Content
- MSG_OPEN_PAREN_OR_ELEMENT_TYPE_REQUIRED_IN_CHILDREN = Das Zeichen "(" oder ein Elementtyp ist in der Deklaration des Elementtyps "{0}" erforderlich.
- MSG_CLOSE_PAREN_REQUIRED_IN_CHILDREN = Das Zeichen ")" ist in der Deklaration des Elementtyps "{0}" erforderlich.
-# 3.2.2 Mixed Content
- MSG_ELEMENT_TYPE_REQUIRED_IN_MIXED_CONTENT = Ein Elementtyp ist in der Deklaration des Elementtyps "{0}" erforderlich.
- MSG_CLOSE_PAREN_REQUIRED_IN_MIXED = Das Zeichen ")" ist in der Deklaration des Elementtyps "{0}" erforderlich.
- MixedContentUnterminated = Das Mischcontentmodell "{0}" muss mit ")*" enden, wenn die Typen der untergeordneten Elemente eingeschr\u00E4nkt sind.
-# 3.3 Attribute-List Declarations
- MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ATTLISTDECL = Leerstelle nach "<!ATTLIST" in der Attributlistendeklaration erforderlich.
- MSG_ELEMENT_TYPE_REQUIRED_IN_ATTLISTDECL = Elementtyp ist in der Attributlistendeklaration erforderlich.
- MSG_SPACE_REQUIRED_BEFORE_ATTRIBUTE_NAME_IN_ATTDEF = Leerstelle vor dem Attributnamen in der Attributlistendeklaration f\u00FCr Element "{0}" erforderlich.
- AttNameRequiredInAttDef = Attributname muss in der Attributlistendeklaration f\u00FCr Element "{0}" angegeben werden.
- MSG_SPACE_REQUIRED_BEFORE_ATTTYPE_IN_ATTDEF = Leerstelle vor dem Attributtyp in der Deklaration des Attributs "{1}" f\u00FCr Element "{0}" erforderlich.
- AttTypeRequiredInAttDef = Attributtyp ist in der Deklaration des Attributs "{1}" f\u00FCr Element "{0}" erforderlich.
- MSG_SPACE_REQUIRED_BEFORE_DEFAULTDECL_IN_ATTDEF = Leerstelle vor dem Attributstandard in der Deklaration des Attributs "{1}" f\u00FCr Element "{0}" erforderlich.
- MSG_DUPLICATE_ATTRIBUTE_DEFINITION = Mehrere Attributdefinitionen f\u00FCr dasselbe Attribut "{1}" eines Elements "{0}" angegeben.
-# 3.3.1 Attribute Types
- MSG_SPACE_REQUIRED_AFTER_NOTATION_IN_NOTATIONTYPE = Leerstelle nach "NOTATION" in der "{1}"-Attributdeklaration erforderlich.
- MSG_OPEN_PAREN_REQUIRED_IN_NOTATIONTYPE = Das Zeichen "(" muss auf "NOTATION" in der "{1}"-Attributdeklaration folgen.
- MSG_NAME_REQUIRED_IN_NOTATIONTYPE = Notationsname ist in der Notationstypliste f\u00FCr die "{1}"-Attributdeklaration erforderlich.
- NotationTypeUnterminated = Notationstypliste muss mit ")" in der"{1}"-Attributdeklaration enden.
- MSG_NMTOKEN_REQUIRED_IN_ENUMERATION = Namenstoken ist in der aufgez\u00E4hlten Typliste f\u00FCr die "{1}"-Attributdeklaration erforderlich.
- EnumerationUnterminated = Aufgez\u00E4hlte Typliste muss mit ")" in der"{1}"-Attributdeklaration enden.
- MSG_DISTINCT_TOKENS_IN_ENUMERATION = Enumerationswert "{1}" wurde mehrmals in der Deklaration des Attributs "{2}" f\u00FCr Element "{0}" angegeben. Die NMTOKENS in einer einzelnen "Enumeration"-Attributdeklaration m\u00FCssen alle eindeutig sein.
- MSG_DISTINCT_NOTATION_IN_ENUMERATION = Enumerationswert "{1}" wurde mehrmals in der Deklaration des Attributs "{2}" f\u00FCr Element "{0}" angegeben. Die NOTATION-Namen in einer einzelnen NotationType-Attributdeklaration m\u00FCssen alle eindeutig sein.
-# 3.3.2 Attribute Defaults
- MSG_SPACE_REQUIRED_AFTER_FIXED_IN_DEFAULTDECL = Leerstelle nach "FIXED" in der "{1}"-Attributdeklaration erforderlich.
-# 3.4 Conditional Sections
- IncludeSectUnterminated = Der eingeschlossene Bedingungsabschnitt muss mit "]]>" enden.
- IgnoreSectUnterminated = Der ausgeschlossene Bedingungsabschnitt muss mit "]]>" enden.
-# 4.1 Character and Entity References
- NameRequiredInPEReference = Auf "%" in der Parameterentityreferenz muss umgehend der Entityname folgen.
- SemicolonRequiredInPEReference = Parameterentityreferenz "%{0};" muss mit dem Begrenzungszeichen ";" enden.
-# 4.2 Entity Declarations
- MSG_SPACE_REQUIRED_BEFORE_ENTITY_NAME_IN_ENTITYDECL = Leerstelle nach "<!ENTITY" in der Entitydeklaration erforderlich.
- MSG_SPACE_REQUIRED_BEFORE_PERCENT_IN_PEDECL = Leerstelle zwischen "<!ENTITY" und dem Zeichen "%" in der Parameterentitydeklaration erforderlich.
- MSG_SPACE_REQUIRED_BEFORE_ENTITY_NAME_IN_PEDECL = Leerstelle zwischen "%" und dem Entitynamen in der Parameterentitydeklaration erforderlich.
- MSG_ENTITY_NAME_REQUIRED_IN_ENTITYDECL = Name der Entity ist in der Entitydeklaration erforderlich.
- MSG_SPACE_REQUIRED_AFTER_ENTITY_NAME_IN_ENTITYDECL = Leerstelle zwischen dem Entitynamen "{0}" und der Definition in der Entitydeklaration erforderlich.
- MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_UNPARSED_ENTITYDECL = Leerstelle zwischen "NDATA" und dem Notationsnamen in der Deklaration f\u00FCr die Entity "{0} erforderlich.
- MSG_SPACE_REQUIRED_BEFORE_NDATA_IN_UNPARSED_ENTITYDECL = Leerstelle vor "NDATA" in der Deklaration f\u00FCr die Entity "{0} erforderlich.
- MSG_NOTATION_NAME_REQUIRED_FOR_UNPARSED_ENTITYDECL = Notationsname ist nach "NDATA" in der Deklaration f\u00FCr die Entity "{0} erforderlich.
- EntityDeclUnterminated = Deklaration f\u00FCr Entity "{0}" muss mit ">" enden.
- MSG_DUPLICATE_ENTITY_DEFINITION = Entity "{0}" wurde mehrmals deklariert.
-# 4.2.2 External Entities
- ExternalIDRequired = Externe Entitydeklaration muss mit "SYSTEM" oder "PUBLIC" beginnen.
- MSG_SPACE_REQUIRED_BEFORE_PUBIDLITERAL_IN_EXTERNALID = Leerstelle zwischen "PUBLIC" und der \u00F6ffentlichen ID erforderlich.
- MSG_SPACE_REQUIRED_AFTER_PUBIDLITERAL_IN_EXTERNALID = Leerstelle zwischen der \u00F6ffentlichen ID und der System-ID erforderlich.
- MSG_SPACE_REQUIRED_BEFORE_SYSTEMLITERAL_IN_EXTERNALID = Leerstelle zwischen "SYSTEM" und der System-ID erforderlich.
- MSG_URI_FRAGMENT_IN_SYSTEMID = Fragment-ID darf nicht als Teil der System-ID "{0}" angegeben werden.
-# 4.7 Notation Declarations
- MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_NOTATIONDECL = Leerstelle nach "<!NOTATION" in der Notationsdeklaration erforderlich.
- MSG_NOTATION_NAME_REQUIRED_IN_NOTATIONDECL = Name der Notation ist in der Notationsdeklaration erforderlich.
- MSG_SPACE_REQUIRED_AFTER_NOTATION_NAME_IN_NOTATIONDECL = Leerstelle nach dem Notationsnamen "{0}" in der Notationsdeklaration erforderlich.
- ExternalIDorPublicIDRequired = Deklaration f\u00FCr die Notation "{0}" muss eine System- oder eine \u00F6ffentliche ID enthalten.
- NotationDeclUnterminated = Deklaration f\u00FCr die Notation "{0}" muss mit ">" enden.
-
-# Validation messages
- DuplicateTypeInMixedContent = Elementtyp "{1}" wurde bereits im Contentmodell der Elementdeklaration"{0}" angegeben.
- ENTITIESInvalid = Attributwert "{1}" mit dem Typ ENTITIES muss aus den Namen von mindestens einer geparsten Entity bestehen.
- ENTITYInvalid = Attributwert "{1}" mit dem Typ ENTITY muss aus dem Namen einer geparsten Entity bestehen.
- IDDefaultTypeInvalid = ID-Attribut "{0}" muss den deklarierten Standardwert "#IMPLIED" oder "#REQUIRED" haben.
- IDInvalid = Attributwert "{0}" mit dem Typ ID muss ein Name sein.
- IDInvalidWithNamespaces = Attributwert "{0}" mit dem Typ ID muss ein NCName sein, wenn Namespaces aktiviert sind.
- IDNotUnique = Attributwert "{0}" mit dem Typ ID muss eindeutig im Dokument sein.
- IDREFInvalid = Attributwert "{0}" mit dem Typ IDREF muss ein Name sein.
- IDREFInvalidWithNamespaces = Attributwert "{0}" mit dem Typ IDREF muss ein NCName sein, wenn Namespaces aktiviert sind.
- IDREFSInvalid = Attributwert "{0}" mit dem Typ IDREFS muss mindestens ein Name sein.
- ILL_FORMED_PARAMETER_ENTITY_WHEN_USED_IN_DECL = Ersatztext der Parameterentity "{0}" muss ordnungsgem\u00E4\u00DF verschachtelte Deklarationen enthalten, wenn die Entityreferenz als vollst\u00E4ndige Deklaration verwendet wird.
- ImproperDeclarationNesting = Ersatztext der Parameterentity "{0}" muss ordnungsgem\u00E4\u00DF verschachtelte Deklarationen enthalten.
- ImproperGroupNesting = Ersatztext der Parameterentity "{0}" muss ordnungsgem\u00E4\u00DF verschachtelte Klammernpaare enthalten.
- INVALID_PE_IN_CONDITIONAL = Ersatztext der Parameterentity "{0}" muss den gesamten Bedingungsabschnitt oder nur INCLUDE oder IGNORE enthalten.
- MSG_ATTRIBUTE_NOT_DECLARED = Attribut "{1}" muss f\u00FCr Elementtyp "{0}" deklariert werden.
- MSG_ATTRIBUTE_VALUE_NOT_IN_LIST = Attribut "{0}" mit Wert "{1}" muss einen Wert aus der Liste "{2}" haben.
- MSG_ATTVALUE_CHANGED_DURING_NORMALIZATION_WHEN_STANDALONE = Der Wert "{1}" des Attributs "{0}" darf nicht von der Normalisierung (zu "{2}") in einem Standalone-Dokument ge\u00E4ndert werden.
- MSG_CONTENT_INCOMPLETE = Content des Elementtyps "{0}" ist unvollst\u00E4ndig. Muss "{1}" entsprechen.
- MSG_CONTENT_INVALID = Content des Elementtyps "{0}" muss "{1}" entsprechen.
- MSG_CONTENT_INVALID_SPECIFIED = Content des Elementtyps "{0}" muss "{1}" entsprechen. Untergeordnete Elemente mit dem Typ "{2}" sind nicht zul\u00E4ssig.
- MSG_DEFAULTED_ATTRIBUTE_NOT_SPECIFIED = Attribut "{1}" f\u00FCr Elementtyp "{0}" hat einen Standardwert und muss in einem Standalone-Dokument angegeben werden.
- MSG_DUPLICATE_ATTDEF = Attribut "{1}" ist bereits deklariert f\u00FCr Elementtyp "{0}".
- MSG_ELEMENT_ALREADY_DECLARED = Elementtyp "{0}" darf nicht mehrmals deklariert werden.
- MSG_ELEMENT_NOT_DECLARED = Elementtyp "{0}" muss deklariert werden.
- MSG_GRAMMAR_NOT_FOUND = Dokument ist ung\u00FCltig. Keine Grammatik gefunden.
- MSG_ELEMENT_WITH_ID_REQUIRED = Element mit "{0}" ist im Dokument erforderlich.
- MSG_EXTERNAL_ENTITY_NOT_PERMITTED = Referenz zur externen Entity "{0}" ist in einem Standalone-Dokument nicht zul\u00E4ssig.
- MSG_FIXED_ATTVALUE_INVALID = Attribut "{1}" mit Wert "{2}" muss den Wert"{3}" haben.
- MSG_MORE_THAN_ONE_ID_ATTRIBUTE = Elementtyp "{0}" hat bereits ein Attribut "{1}" mit dem Typ ID. Ein zweites Attribut "{2}" mit dem Typ ID ist nicht zul\u00E4ssig.
- MSG_MORE_THAN_ONE_NOTATION_ATTRIBUTE = Elementtyp "{0}" hat bereits ein Attribut "{1}" mit dem Typ NOTATION. Ein zweites Attribut "{2}" mit dem Typ NOTATION ist nicht zul\u00E4ssig.
- MSG_NOTATION_NOT_DECLARED_FOR_NOTATIONTYPE_ATTRIBUTE = Notation "{1}" muss deklariert werden, wenn sie in der Notationstypliste f\u00FCr Attribut "{0}" referenziert wird.
- MSG_NOTATION_NOT_DECLARED_FOR_UNPARSED_ENTITYDECL = Notation "{1}" muss deklariert werden, wenn sie in der Deklaration der nicht geparsten Entity f\u00FCr "{0}" referenziert wird.
- MSG_REFERENCE_TO_EXTERNALLY_DECLARED_ENTITY_WHEN_STANDALONE = Referenz zur Entity "{0}", die in einer externen geparsten Entity deklariert wird, ist in einem Standalone-Dokument nicht zul\u00E4ssig.
- MSG_REQUIRED_ATTRIBUTE_NOT_SPECIFIED = Attribut "{1}" ist erforderlich und muss f\u00FCr Elementtyp "{0}" angegeben werden.
- MSG_WHITE_SPACE_IN_ELEMENT_CONTENT_WHEN_STANDALONE = Es d\u00FCrfen keine Leerstellen zwischen Elementen in einem Standalone-Dokument vorkommen, die in einer externen geparsten Entity mit Elementcontent deklariert sind.
- NMTOKENInvalid = Attributwert "{0}" mit dem Typ NMTOKEN muss ein Namenstoken sein.
- NMTOKENSInvalid = Attributwert "{0}" mit dem Typ NMTOKENS muss mindestens ein Namenstoken sein.
- NoNotationOnEmptyElement = Elementtyp "{0}", der als EMPTY deklariert wurde, kann nicht das Attribut "{1}" mit dem Typ NOTATION deklarieren.
- RootElementTypeMustMatchDoctypedecl = Document Root-Element "{1}"muss mit DOCTYPE-Root "{0}" \u00FCbereinstimmen.
- UndeclaredElementInContentSpec = Contentmodell des Elements "{0}" verweist auf das nicht deklarierte Element "{1}".
- UniqueNotationName = Deklaration f\u00FCr die Notation "{0}" ist nicht eindeutig. Ein jeweiliger Name darf nicht in mehreren Notationsdeklarationen deklariert werden.
- ENTITYFailedInitializeGrammar = ENTITYDatatype-Validator: Nicht erfolgreich. Initialisierungsmethode muss mit einer g\u00FCltigen Grammatikreferenz aufgerufen werden. \t
- ENTITYNotUnparsed = ENTITY "{0}" ist geparst.
- ENTITYNotValid = ENTITY "{0}" ist nicht g\u00FCltig.
- EmptyList = Werte der Typen ENTITIES, IDREFS und NMTOKENS d\u00FCrfen keine leeren Listen sein.
-
-# Entity related messages
-# 3.1 Start-Tags, End-Tags, and Empty-Element Tags
- ReferenceToExternalEntity = Externe Entityreferenz "&{0};" ist in einem Attributwert nicht zul\u00E4ssig.
- AccessExternalDTD = Externe DTD: Lesen von externer DTD "{0}" nicht erfolgreich, da "{1}"-Zugriff wegen der von der Eigenschaft "accessExternalDTD" festgelegten Einschr\u00E4nkung nicht zul\u00E4ssig ist.
- AccessExternalEntity = Externe Entity: Lesen des externen Dokuments "{0}" nicht erfolgreich, da "{1}"-Zugriff wegen der von der Eigenschaft "accessExternalDTD" festgelegten Einschr\u00E4nkung nicht zul\u00E4ssig ist.
-
-# 4.1 Character and Entity References
- EntityNotDeclared = Entity "{0}" wurde referenziert aber nicht deklariert.
- ReferenceToUnparsedEntity = Nicht geparste Entityreferenz "&{0};" ist nicht zul\u00E4ssig.
- RecursiveReference = Rekursive Entityreferenz "{0}". (Referenzpfad: {1}),
- RecursiveGeneralReference = Rekursive allgemeine Entityreferenz "&{0};". (Referenzpfad: {1}),
- RecursivePEReference = Rekursive Parameterentityreferenz "%{0};". (Referenzpfad: {1}),
-# 4.3.3 Character Encoding in Entities
- EncodingNotSupported = Codierung "{0}" wird nicht unterst\u00FCtzt.
- EncodingRequired = Eine nicht in UTF-8 oder UTF-16 codierte geparste Entity muss eine Codierungsdeklaration enthalten.
-
-# Namespaces support
-# 4. Using Qualified Names
- IllegalQName = Element oder Attribut stimmt nicht mit QName-Production \u00FCberein: QName::=(NCName':')?NCName.
- ElementXMLNSPrefix = Element "{0}" darf nicht "xmlns" als Pr\u00E4fix enthalten.
- ElementPrefixUnbound = Pr\u00E4fix "{0}" f\u00FCr Element "{1}" ist nicht gebunden.
- AttributePrefixUnbound = Pr\u00E4fix "{2}" f\u00FCr Attribut "{1}", das mit Elementtyp "{0}" verkn\u00FCpft ist, ist nicht gebunden.
- EmptyPrefixedAttName = Wert des Attributs "{0}" ist ung\u00FCltig. Namespace Bindings mit Pr\u00E4fix d\u00FCrfen nicht leer sein.
- PrefixDeclared = Namespace-Pr\u00E4fix "{0}" wurde nicht deklariert.
- CantBindXMLNS = Pr\u00E4fix "xmlns" kann nicht explizit an einen Namespace gebunden werden. Umgekehrt kann auch der Namespace f\u00FCr "xmlns" nicht explizit an ein Pr\u00E4fix gebunden werden.
- CantBindXML = Pr\u00E4fix "xml" kann nicht an einen anderen Namespace als den gew\u00F6hnlichen gebunden werden. Umgekehrt kann auch der Namespace f\u00FCr "xml" nicht an ein anderes Pr\u00E4fix als "xml" gebunden werden.
- MSG_ATT_DEFAULT_INVALID = defaultValue "{1}" von Attribut "{0}" ist aufgrund der lexikalischen Constraints dieses Attributtyps nicht g\u00FCltig.
-
-# REVISIT: These need messages
- MSG_SPACE_REQUIRED_AFTER_SYSTEMLITERAL_IN_EXTERNALID=MSG_SPACE_REQUIRED_AFTER_SYSTEMLITERAL_IN_EXTERNALID
- OpenQuoteMissingInDecl=OpenQuoteMissingInDecl
- InvalidCharInLiteral=InvalidCharInLiteral
-
-
-# Implementation limits
- EntityExpansionLimit=JAXP00010001: Der Parser hat mehr als {0} Entityerweiterungen in diesem Dokument gefunden. Dies ist der von JDK vorgeschriebene Grenzwert.
- ElementAttributeLimit=JAXP00010002: Element "{0}" hat mehr als {1} Attribute. "{1}" ist der von JDK vorgeschriebene Grenzwert.
- MaxEntitySizeLimit=JAXP00010003: Die L\u00E4nge von Entity "{0}" ist "{1}" und \u00FCberschreitet den Grenzwert "{2}", der von "{3}" festgelegt wurde.
- TotalEntitySizeLimit=JAXP00010004: Die akkumulierte Gr\u00F6\u00DFe von Entitys ist "{0}" und \u00FCberschreitet den Grenzwert "{1}", der von "{2}" festgelegt wurde.
- MaxXMLNameLimit=JAXP00010005: Die L\u00E4nge von Entity "{0}" ist "{1}" und \u00FCberschreitet den Grenzwert "{2}", der von "{3}" festgelegt wurde.
- MaxElementDepthLimit=JAXP00010006: Die Tiefe von Element "{0}" ist "{1}" und \u00FCberschreitet den Grenzwert "{2}", der von "{3}" festgelegt wurde.
- EntityReplacementLimit=JAXP00010007: Die Gesamtanzahl von Knoten in Entityreferenzen betr\u00E4gt "{0}". Das liegt \u00FCber dem von "{2}" festgelegten Grenzwert "{1}".
-
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_es.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_es.properties
deleted file mode 100644
index 108eeeb..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_es.properties
+++ /dev/null
@@ -1,305 +0,0 @@
-# This file contains error and warning messages related to XML
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-# @version
-
- BadMessageKey = No se ha encontrado el mensaje de error correspondiente a la clave de mensaje.
- FormatFailed = Se ha producido un error interno al formatear el siguiente mensaje:\n
-
-# Document messages
- PrematureEOF=Final de archivo prematuro.
-# 2.1 Well-Formed XML Documents
- RootElementRequired = El elemento ra\u00EDz es necesario en un documento con formato correcto.
-# 2.2 Characters
-
- InvalidCharInCDSect = Se ha encontrado un car\u00E1cter XML (Unicode: 0x{0}) no v\u00E1lido en la secci\u00F3n CDATA.
- InvalidCharInContent = Se ha encontrado un car\u00E1cter XML (Unicode: 0x{0}) no v\u00E1lido en el contenido del elemento del documento.
- TwoColonsInQName = Se ha encontrado un segundo ':' no v\u00E1lido en el tipo de elemento o en el nombre del atributo.
- ColonNotLegalWithNS = No se permite incluir dos puntos en el nombre ''{0}'' cuando se activan los espacios de nombres.
- InvalidCharInMisc = Se ha encontrado un car\u00E1cter XML (Unicode: 0x{0}) no v\u00E1lido en el marcador al finalizar el contenido del elemento.
- InvalidCharInProlog = Se ha encontrado un car\u00E1cter XML (Unicode: 0x{0}) no v\u00E1lido en el pr\u00F3logo del documento.
- InvalidCharInXMLDecl = Se ha encontrado un car\u00E1cter XML (Unicode: 0x{0}) no v\u00E1lido en la declaraci\u00F3n XML.
-# 2.4 Character Data and Markup
- CDEndInContent = La secuencia de caracteres "]]>" no debe aparecer en el contenido, a menos que se utilice para marcar el final de una secci\u00F3n CDATA.
-# 2.7 CDATA Sections
- CDSectUnterminated = La secci\u00F3n CDATA debe finalizar en "]]>".
-# 2.8 Prolog and Document Type Declaration
- XMLDeclMustBeFirst = La declaraci\u00F3n XML s\u00F3lo puede aparecer al principio del documento.
- EqRequiredInXMLDecl = El car\u00E1cter '' = '' debe aparecer despu\u00E9s de "{0}" en la declaraci\u00F3n XML.
- QuoteRequiredInXMLDecl = El valor despu\u00E9s de "{0}" en la declaraci\u00F3n XML debe ser una cadena con comillas.
- XMLDeclUnterminated = La declaraci\u00F3n XML debe finalizar en "?>".
- VersionInfoRequired = La versi\u00F3n es necesaria en la declaraci\u00F3n XML.
- SpaceRequiredBeforeVersionInXMLDecl = Es necesario un espacio en blanco antes del pseudo atributo version en la declaraci\u00F3n XML.
- SpaceRequiredBeforeEncodingInXMLDecl = Es necesario un espacio en blanco antes del pseudo atributo encoding en la declaraci\u00F3n XML.
- SpaceRequiredBeforeStandalone = Es necesario un espacio en blanco antes del pseudo atributo encoding en la declaraci\u00F3n XML.
- MarkupNotRecognizedInProlog = El marcador en el documento que precede al elemento ra\u00EDz debe tener el formato correcto.
- MarkupNotRecognizedInMisc = El marcador en el documento que aparece tras el elemento ra\u00EDz debe tener el formato correcto.
- AlreadySeenDoctype = Tipo de documento ya consultado.
- DoctypeNotAllowed = DOCTYPE no est\u00E1 permitido cuando la funci\u00F3n "http://apache.org/xml/features/disallow-doctype-decl" se ha definido en true.
- ContentIllegalInProlog = El contenido no est\u00E1 permitido en el pr\u00F3logo.
- ReferenceIllegalInProlog = La referencia no est\u00E1 permitida en el pr\u00F3logo.
-# Trailing Misc
- ContentIllegalInTrailingMisc=El contenido no est\u00E1 permitido en la secci\u00F3n final.
- ReferenceIllegalInTrailingMisc=La referencia no est\u00E1 permitida en la secci\u00F3n final.
-
-# 2.9 Standalone Document Declaration
- SDDeclInvalid = El valor de declaraci\u00F3n del documento aut\u00F3nomo debe ser "yes" o "no", pero nunca "{0}".
- SDDeclNameInvalid = Puede que el nombre aut\u00F3nomo de la declaraci\u00F3n XML est\u00E9 mal escrito.
-# 2.12 Language Identification
- XMLLangInvalid = El valor del atributo xml:lang "{0}" es un identificador de idioma no v\u00E1lido.
-# 3. Logical Structures
- ETagRequired = El tipo de elemento "{0}" debe finalizar por la etiqueta final coincidente "</{0}>".
-# 3.1 Start-Tags, End-Tags, and Empty-Element Tags
- ElementUnterminated = El tipo de elemento "{0}" debe ir seguido de una de estas especificaciones de atributo: ">" o "/>".
- EqRequiredInAttribute = El nombre de atributo "{1}" asociado a un tipo de elemento "{0}" debe ir seguido del car\u00E1cter '' = ''.
- OpenQuoteExpected = Las comillas de apertura se deben utilizar para el atributo "{1}" asociado a un tipo de elemento "{0}".
- CloseQuoteExpected = Las comillas de cierre se deben utilizar para el atributo "{1}" asociado a un tipo de elemento "{0}".
- AttributeNotUnique = El atributo "{1}" ya se ha especificado para el elemento "{0}".
- AttributeNSNotUnique = El atributo "{1}" enlazado al espacio de nombres "{2}" ya se ha especificado para el elemento "{0}".
- ETagUnterminated = La etiqueta final para el tipo de elemento "{0}" debe finalizar en un delimitador ''>''.
- MarkupNotRecognizedInContent = El contenido de los elementos debe constar de marcadores o datos de car\u00E1cter con un formato correcto.
- DoctypeIllegalInContent = No se permite un DOCTYPE en el contenido.
-# 4.1 Character and Entity References
- ReferenceUnterminated = La referencia debe finalizar con un delimitador ';'.
-# 4.3.2 Well-Formed Parsed Entities
- ReferenceNotInOneEntity = La referencia debe incluirse totalmente en la misma entidad analizada.
- ElementEntityMismatch = El elemento "{0}" debe empezar y finalizar en la misma entidad.
- MarkupEntityMismatch=Las estructuras del documento XML deben empezar y finalizar en la misma entidad.
-
-# Messages common to Document and DTD
-# 2.2 Characters
- InvalidCharInAttValue = Se ha encontrado un car\u00E1cter XML (Unicode: 0x{2}) no v\u00E1lido en el valor del atributo "{1}" y el elemento es "{0}".
- InvalidCharInComment = Se ha encontrado un car\u00E1cter XML (Unicode: 0x{0}) no v\u00E1lido en el comentario.
- InvalidCharInPI = Se ha encontrado un car\u00E1cter XML (Unicode: 0x{0}) no v\u00E1lido en la instrucci\u00F3n de procesamiento.
- InvalidCharInInternalSubset = Se ha encontrado un car\u00E1cter XML (Unicode: 0x{0}) no v\u00E1lido en el subconjunto interno del DTD.
- InvalidCharInTextDecl = Se ha encontrado un car\u00E1cter XML (Unicode: 0x{0}) no v\u00E1lido en la declaraci\u00F3n de texto.
-# 2.3 Common Syntactic Constructs
- QuoteRequiredInAttValue = El valor del atributo "{1}" debe empezar por un car\u00E1cter de comillas dobles o simples.
- LessthanInAttValue = El valor del atributo "{1}" asociado a un tipo de elemento "{0}" no debe contener el car\u00E1cter ''<''.
- AttributeValueUnterminated = El valor para el atributo "{1}" debe finalizar en un car\u00E1cter de comillas coincidentes.
-# 2.5 Comments
- InvalidCommentStart = El comentario debe empezar por "<!--".
- DashDashInComment = La cadena "--" no est\u00E1 permitida en los comentarios.
- CommentUnterminated = El comentario debe finalizar en "-->".
- COMMENT_NOT_IN_ONE_ENTITY = El comentario no est\u00E1 incluido en la misma entidad.
-# 2.6 Processing Instructions
- PITargetRequired = La instrucci\u00F3n de procesamiento debe empezar por el nombre del destino.
- SpaceRequiredInPI = Es necesario un espacio en blanco entre el destino de la instrucci\u00F3n de procesamiento y los datos.
- PIUnterminated = La instrucci\u00F3n de procesamiento debe finalizar en "?>".
- ReservedPITarget = El destino de la instrucci\u00F3n de procesamiento que coincide con "[xX][mM][lL]" no est\u00E1 permitido.
- PI_NOT_IN_ONE_ENTITY = La instrucci\u00F3n de procesamiento no est\u00E1 incluida en la misma entidad.
-# 2.8 Prolog and Document Type Declaration
- VersionInfoInvalid = Versi\u00F3n no v\u00E1lida "{0}".
- VersionNotSupported = La versi\u00F3n XML "{0}" no est\u00E1 soportada, s\u00F3lo la versi\u00F3n XML 1.0 est\u00E1 soportada.
- VersionNotSupported11 = La versi\u00F3n XML "{0}" no est\u00E1 soportada, s\u00F3lo las versiones XML 1.0 y XML 1.1 est\u00E1n soportadas.
- VersionMismatch= Una entidad no puede incluir otra entidad de una versi\u00F3n posterior.
-# 4.1 Character and Entity References
- DigitRequiredInCharRef = Una representaci\u00F3n decimal debe aparecer inmediatamente despu\u00E9s de "&#" en una referencia de caracteres.
- HexdigitRequiredInCharRef = Una representaci\u00F3n hexadecimal debe aparecer inmediatamente despu\u00E9s de "&#" en una referencia de caracteres.
- SemicolonRequiredInCharRef = La referencia de caracteres debe finalizar en el delimitador ';'.
- InvalidCharRef = La referencia de caracteres "&#{0}" es un car\u00E1cter XML no v\u00E1lido.
- NameRequiredInReference = El nombre de la entidad debe aparecer inmediatamente despu\u00E9s de '&' en la referencia de entidades.
- SemicolonRequiredInReference = La referencia a la entidad "{0}" debe finalizar en el delimitador '';''.
-# 4.3.1 The Text Declaration
- TextDeclMustBeFirst = La declaraci\u00F3n de texto s\u00F3lo puede aparecer al principio de la entidad analizada externa.
- EqRequiredInTextDecl = El car\u00E1cter '' = '' debe aparecer despu\u00E9s de "{0}" en la declaraci\u00F3n de texto.
- QuoteRequiredInTextDecl = El valor despu\u00E9s de "{0}" en la declaraci\u00F3n de texto debe ser una cadena con comillas.
- CloseQuoteMissingInTextDecl = Faltan las comillas de cierre en el valor despu\u00E9s de "{0}" en la declaraci\u00F3n de texto.
- SpaceRequiredBeforeVersionInTextDecl = Es necesario un espacio en blanco antes del pseudo atributo version en la declaraci\u00F3n de texto.
- SpaceRequiredBeforeEncodingInTextDecl = Es necesario un espacio en blanco antes del pseudo atributo encoding en la declaraci\u00F3n de texto.
- TextDeclUnterminated = La declaraci\u00F3n de texto debe finalizar en "?>".
- EncodingDeclRequired = La declaraci\u00F3n de codificaci\u00F3n es necesaria en la declaraci\u00F3n de texto.
- NoMorePseudoAttributes = No se permiten m\u00E1s pseudo atributos.
- MorePseudoAttributes = Se esperan m\u00E1s pseudo atributos.
- PseudoAttrNameExpected = Se espera el nombre de un pseudo atributo.
-# 4.3.2 Well-Formed Parsed Entities
- CommentNotInOneEntity = El comentario debe incluirse totalmente en la misma entidad analizada.
- PINotInOneEntity = La instrucci\u00F3n de procesamiento debe incluirse totalmente en la misma entidad analizada.
-# 4.3.3 Character Encoding in Entities
- EncodingDeclInvalid = Nombre de codificaci\u00F3n no v\u00E1lido "{0}".
- EncodingByteOrderUnsupported = El orden de bytes proporcionado para la codificaci\u00F3n "{0}" no est\u00E1 soportado.
- InvalidByte = Byte no v\u00E1lido {0} de la secuencia UTF-8 de {1} bytes
- ExpectedByte = Byte esperado {0} de la secuencia UTF-8 de {1} bytes.
- InvalidHighSurrogate = Los bits de sustituci\u00F3n superior en la secuencia UTF-8 no deben exceder 0x10 pero se han encontrado 0x{0}.
- OperationNotSupported = La operaci\u00F3n "{0}" no est\u00E1 soportada por el lector {1}.
- InvalidASCII = El byte "{0}"no es un miembro del juego de caracteres ASCII (7 bits).
- CharConversionFailure = Una entidad con una codificaci\u00F3n determinada no debe contener secuencias no permitidas en dicha codificaci\u00F3n.
-
-# DTD Messages
-# 2.2 Characters
- InvalidCharInEntityValue = Se ha encontrado un car\u00E1cter XML (Unicode: 0x{0}) no v\u00E1lido en el valor de entidad literal.
- InvalidCharInExternalSubset = Se ha encontrado un car\u00E1cter XML (Unicode: 0x{0}) no v\u00E1lido en el subjuego externo del DTD.
- InvalidCharInIgnoreSect = Se ha encontrado un car\u00E1cter XML (Unicode: 0x{0}) no v\u00E1lido en la secci\u00F3n condicional excluida.
- InvalidCharInPublicID = Se ha encontrado un car\u00E1cter XML (Unicode: 0x{0}) no v\u00E1lido en el identificador p\u00FAblico.
- InvalidCharInSystemID = Se ha encontrado un car\u00E1cter XML (Unicode: 0x{0}) no v\u00E1lido en el identificador del sistema.
-# 2.3 Common Syntactic Constructs
- SpaceRequiredAfterSYSTEM = Es necesario un espacio en blanco despu\u00E9s de la palabra clave SYSTEM en la declaraci\u00F3n DOCTYPE.
- QuoteRequiredInSystemID = El identificador del sistema debe empezar por un car\u00E1cter de comillas dobles o simples.
- SystemIDUnterminated = El identificador del sistema debe finalizar en un car\u00E1cter de comillas coincidente.
- SpaceRequiredAfterPUBLIC = Son necesarios espacios en blanco despu\u00E9s de la palabra clave PUBLIC en la declaraci\u00F3n DOCTYPE.
- QuoteRequiredInPublicID = El identificador p\u00FAblico debe empezar por un car\u00E1cter de comillas dobles o simples.
- PublicIDUnterminated = El identificador p\u00FAblico debe finalizar en un car\u00E1cter de comillas coincidente.
- PubidCharIllegal = El car\u00E1cter (Unicode: 0x{0}) no est\u00E1 permitido en el identificador p\u00FAblico.
- SpaceRequiredBetweenPublicAndSystem = Son necesarios espacios en blanco entre publicId y systemId.
-# 2.8 Prolog and Document Type Declaration
- MSG_SPACE_REQUIRED_BEFORE_ROOT_ELEMENT_TYPE_IN_DOCTYPEDECL = Es necesario un espacio en blanco despu\u00E9s de "<!DOCTYPE" en la declaraci\u00F3n de tipo de documento.
- MSG_ROOT_ELEMENT_TYPE_REQUIRED = El tipo de elemento ra\u00EDz debe aparecer despu\u00E9s de "<!DOCTYPE" en la declaraci\u00F3n de tipo de documento.
- DoctypedeclUnterminated = La declaraci\u00F3n de tipo de documento para el tipo de elemento ra\u00EDz "{0}" debe finalizar en ''>''.
- DoctypedeclNotClosed = La declaraci\u00F3n de tipo de documento para el tipo de elemento ra\u00EDz "{0}" debe finalizar en '']''.
- PEReferenceWithinMarkup = La referencia de entidad del par\u00E1metro "%{0};" no puede producirse en el marcador en el subconjunto interno del DTD.
- MSG_MARKUP_NOT_RECOGNIZED_IN_DTD = Las declaraciones de marcador que se incluyen o a las que apunta la declaraci\u00F3n de tipo de documento deben tener el formato correcto.
-# 2.10 White Space Handling
- MSG_XML_SPACE_DECLARATION_ILLEGAL = La declaraci\u00F3n de atributo para "xml:space" debe ofrecerse como un tipo enumerado cuyos \u00FAnicos valores posibles son "default" y "preserve".
-# 3.2 Element Type Declarations
- MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ELEMENTDECL = Es necesario un espacio en blanco despu\u00E9s de "<!ELEMENT" en la declaraci\u00F3n de tipo de elemento.
- MSG_ELEMENT_TYPE_REQUIRED_IN_ELEMENTDECL = El tipo de elemento es necesario en la declaraci\u00F3n de tipo de elemento.
- MSG_SPACE_REQUIRED_BEFORE_CONTENTSPEC_IN_ELEMENTDECL = Es necesario un espacio en blanco despu\u00E9s del tipo de elemento "{0}" en la declaraci\u00F3n de tipo de elemento.
- MSG_CONTENTSPEC_REQUIRED_IN_ELEMENTDECL = Es necesaria la restricci\u00F3n despu\u00E9s del tipo de elemento "{0}" en la declaraci\u00F3n de tipo de elemento.
- ElementDeclUnterminated = La declaraci\u00F3n para el tipo de elemento "{0}" debe finalizar en ''>''.
-# 3.2.1 Element Content
- MSG_OPEN_PAREN_OR_ELEMENT_TYPE_REQUIRED_IN_CHILDREN = Un car\u00E1cter ''('' o un tipo de elemento es necesario en la declaraci\u00F3n de tipo de elemento "{0}".
- MSG_CLOSE_PAREN_REQUIRED_IN_CHILDREN = Un car\u00E1cter '')'' es necesario en la declaraci\u00F3n de tipo de elemento "{0}".
-# 3.2.2 Mixed Content
- MSG_ELEMENT_TYPE_REQUIRED_IN_MIXED_CONTENT = Un tipo de elemento es necesario en la declaraci\u00F3n de tipo de elemento "{0}".
- MSG_CLOSE_PAREN_REQUIRED_IN_MIXED = Un car\u00E1cter '')'' es necesario en la declaraci\u00F3n de tipo de elemento "{0}".
- MixedContentUnterminated = El modelo de contenido mixto "{0}" debe finalizar en ")*" cuando los tipos de elementos secundarios est\u00E1n restringidos.
-# 3.3 Attribute-List Declarations
- MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ATTLISTDECL = Es necesario un espacio en blanco despu\u00E9s de "<!ATTLIST" en la declaraci\u00F3n de la lista de atributos.
- MSG_ELEMENT_TYPE_REQUIRED_IN_ATTLISTDECL = El tipo de elemento es necesario en la declaraci\u00F3n de la lista de atributos.
- MSG_SPACE_REQUIRED_BEFORE_ATTRIBUTE_NAME_IN_ATTDEF = Es necesario un espacio en blanco antes del nombre de atributo en la declaraci\u00F3n de la lista de atributos para el elemento "{0}".
- AttNameRequiredInAttDef = Se debe especificar el nombre del atributo en la declaraci\u00F3n de la lista de atributos para el elemento "{0}".
- MSG_SPACE_REQUIRED_BEFORE_ATTTYPE_IN_ATTDEF = Es necesario un espacio en blanco antes del tipo de atributo en la declaraci\u00F3n del atributo "{1}" para el elemento "{0}".
- AttTypeRequiredInAttDef = Es necesario el tipo de atributo en la declaraci\u00F3n del atributo "{1}" para el elemento "{0}".
- MSG_SPACE_REQUIRED_BEFORE_DEFAULTDECL_IN_ATTDEF = Es necesario un espacio en blanco antes del atributo por defecto en la declaraci\u00F3n del atributo "{1}" para el elemento "{0}".
- MSG_DUPLICATE_ATTRIBUTE_DEFINITION = Se ha proporcionado m\u00E1s de una definici\u00F3n de atributo para el mismo atributo "{1}" de un elemento determinado "{0}".
-# 3.3.1 Attribute Types
- MSG_SPACE_REQUIRED_AFTER_NOTATION_IN_NOTATIONTYPE = Debe aparecer un espacio en blanco despu\u00E9s de "NOTATION" en la declaraci\u00F3n de atributo "{1}".
- MSG_OPEN_PAREN_REQUIRED_IN_NOTATIONTYPE = El car\u00E1cter ''('' debe aparecer despu\u00E9s de "NOTATION" en la declaraci\u00F3n de atributo "{1}".
- MSG_NAME_REQUIRED_IN_NOTATIONTYPE = El nombre de notaci\u00F3n es necesario en la lista de tipos de notaci\u00F3n para la declaraci\u00F3n de atributo "{1}".
- NotationTypeUnterminated = La lista de tipos de notaciones debe finalizar en '')'' en la declaraci\u00F3n del atributo "{1}".
- MSG_NMTOKEN_REQUIRED_IN_ENUMERATION = El token de nombre es necesario en la lista de tipos enumerados para la declaraci\u00F3n del atributo "{1}".
- EnumerationUnterminated = La lista de tipos enumerados debe finalizar en '')'' en la declaraci\u00F3n del atributo "{1}".
- MSG_DISTINCT_TOKENS_IN_ENUMERATION = El valor de enumeraci\u00F3n "{1}" se especific\u00F3 m\u00E1s de una vez en la declaraci\u00F3n del atributo "{2}" para el token "{0}". Todos los NMTOKENS en una declaraci\u00F3n del atributo Enumeration \u00FAnico deben ser distintos.
- MSG_DISTINCT_NOTATION_IN_ENUMERATION = El valor de enumeraci\u00F3n "{1}" se especific\u00F3 m\u00E1s de una vez en la declaraci\u00F3n del atributo "{2}" para el elemento "{0}". Todos los nombres NOTATION en una declaraci\u00F3n del atributo NotationType \u00FAnico deben ser distintos.
-# 3.3.2 Attribute Defaults
- MSG_SPACE_REQUIRED_AFTER_FIXED_IN_DEFAULTDECL = Debe aparecer un espacio en blanco despu\u00E9s de "FIXED" en la declaraci\u00F3n de atributo "{1}".
-# 3.4 Conditional Sections
- IncludeSectUnterminated = La secci\u00F3n condicional incluida debe finalizar en "]]>".
- IgnoreSectUnterminated = La secci\u00F3n condicional excluida debe finalizar en "]]>".
-# 4.1 Character and Entity References
- NameRequiredInPEReference = El nombre de la entidad debe aparecer inmediatamente despu\u00E9s de '%' en la referencia de entidad de par\u00E1metro.
- SemicolonRequiredInPEReference = La referencia de entidad de par\u00E1metro "%{0};" debe finalizar en el delimitador '';''.
-# 4.2 Entity Declarations
- MSG_SPACE_REQUIRED_BEFORE_ENTITY_NAME_IN_ENTITYDECL = Es necesario un espacio en blanco despu\u00E9s de "<!ENTITY" en la declaraci\u00F3n de entidad.
- MSG_SPACE_REQUIRED_BEFORE_PERCENT_IN_PEDECL = Es necesario un espacio en blanco entre "<!ENTITY" y el car\u00E1cter '%' en la declaraci\u00F3n de entidad de par\u00E1metro.
- MSG_SPACE_REQUIRED_BEFORE_ENTITY_NAME_IN_PEDECL = Es necesario un espacio en blanco entre '%' y el nombre de entidad en la declaraci\u00F3n de entidad de par\u00E1metro.
- MSG_ENTITY_NAME_REQUIRED_IN_ENTITYDECL = El nombre de la entidad es necesario en la declaraci\u00F3n de entidad.
- MSG_SPACE_REQUIRED_AFTER_ENTITY_NAME_IN_ENTITYDECL = Es necesario un espacio en blanco entre el nombre de entidad "{0}" y la definici\u00F3n en la declaraci\u00F3n de entidad.
- MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_UNPARSED_ENTITYDECL = Es necesario un espacio en blanco entre "NDATA" y el nombre de notaci\u00F3n en la declaraci\u00F3n para la entidad "{0}".
- MSG_SPACE_REQUIRED_BEFORE_NDATA_IN_UNPARSED_ENTITYDECL = Es necesario un espacio en blanco antes de "NDATA" en la declaraci\u00F3n para la entidad "{0}".
- MSG_NOTATION_NAME_REQUIRED_FOR_UNPARSED_ENTITYDECL = El nombre de notaci\u00F3n es necesario despu\u00E9s de "NDATA" en la declaraci\u00F3n para la entidad "{0}".
- EntityDeclUnterminated = La declaraci\u00F3n para la entidad "{0}" debe finalizar en ''>''.
- MSG_DUPLICATE_ENTITY_DEFINITION = La entidad "{0}" se ha declarado m\u00E1s de una vez.
-# 4.2.2 External Entities
- ExternalIDRequired = La declaraci\u00F3n de entidad externa debe empezar por "SYSTEM" o "PUBLIC".
- MSG_SPACE_REQUIRED_BEFORE_PUBIDLITERAL_IN_EXTERNALID = Es necesario un espacio en blanco entre "PUBLIC" y el identificador p\u00FAblico.
- MSG_SPACE_REQUIRED_AFTER_PUBIDLITERAL_IN_EXTERNALID = Es necesario un espacio en blanco entre el identificador p\u00FAblico y el identificador del sistema.
- MSG_SPACE_REQUIRED_BEFORE_SYSTEMLITERAL_IN_EXTERNALID = Es necesario un espacio en blanco entre "SYSTEM" y el identificador del sistema.
- MSG_URI_FRAGMENT_IN_SYSTEMID = No se debe especificar el identificador del fragmento como parte del identificador del sistema "{0}".
-# 4.7 Notation Declarations
- MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_NOTATIONDECL = Es necesario un espacio en blanco despu\u00E9s de "<!NOTATION" en la declaraci\u00F3n de notaci\u00F3n.
- MSG_NOTATION_NAME_REQUIRED_IN_NOTATIONDECL = El nombre de la notaci\u00F3n es necesario en la declaraci\u00F3n de notaci\u00F3n.
- MSG_SPACE_REQUIRED_AFTER_NOTATION_NAME_IN_NOTATIONDECL = Es necesario un espacio en blanco despu\u00E9s del nombre de la notaci\u00F3n "{0}" en la declaraci\u00F3n de notaci\u00F3n.
- ExternalIDorPublicIDRequired = La declaraci\u00F3n para la notaci\u00F3n "{0}" debe incluir un identificador p\u00FAblico o del sistema.
- NotationDeclUnterminated = La declaraci\u00F3n para la notaci\u00F3n "{0}" debe finalizar en ''>''.
-
-# Validation messages
- DuplicateTypeInMixedContent = El tipo de elemento "{1}" ya se especific\u00F3 en el modelo de contenido de la declaraci\u00F3n de elementos "{0}".
- ENTITIESInvalid = El valor de atributo "{1}" del tipo ENTITIES debe ser el nombre de una o m\u00E1s entidades no analizadas.
- ENTITYInvalid = El valor de atributo "{1}" del tipo ENTITY debe ser el nombre de una entidad no analizada.
- IDDefaultTypeInvalid = El atributo de identificador "{0}" debe tener un valor por defecto declarado de "#IMPLIED" o "#REQUIRED".
- IDInvalid = El valor de atributo "{0}" del tipo ID debe ser un nombre.
- IDInvalidWithNamespaces = El valor de atributo "{0}" del tipo ID debe ser un NCName cuando los espacios de nombres est\u00E9n activados.
- IDNotUnique = El valor de atributo "{0}" del tipo ID debe ser \u00FAnico en el documento.
- IDREFInvalid = El valor de atributo "{0}" del tipo IDREF debe ser un nombre.
- IDREFInvalidWithNamespaces = El valor de atributo "{0}" del tipo IDREF debe ser un NCName cuando los espacios de nombres est\u00E9n activados.
- IDREFSInvalid = El valor de atributo "{0}" del tipo IDREFS debe ser uno o m\u00E1s nombres.
- ILL_FORMED_PARAMETER_ENTITY_WHEN_USED_IN_DECL = El texto de sustituci\u00F3n de la entidad del par\u00E1metro "{0}" debe incluir declaraciones correctamente anidadas cuando la referencia de entidad se utiliza como una declaraci\u00F3n completa.
- ImproperDeclarationNesting = El texto de sustituci\u00F3n de la entidad del par\u00E1metro "{0}" debe incluir declaraciones correctamente anidadas.
- ImproperGroupNesting = El texto de sustituci\u00F3n de la entidad del par\u00E1metro "{0}" debe incluir pares de par\u00E9ntesis correctamente anidados.
- INVALID_PE_IN_CONDITIONAL = El texto de sustituci\u00F3n de la entidad del par\u00E1metro "{0}" debe incluir la secci\u00F3n condicional completa o s\u00F3lo INCLUDE o IGNORE.
- MSG_ATTRIBUTE_NOT_DECLARED = El atributo "{1}" se debe haber declarado para el tipo de elemento "{0}".
- MSG_ATTRIBUTE_VALUE_NOT_IN_LIST = El atributo "{0}" con el valor "{1}" debe tener un valor de la lista "{2}".
- MSG_ATTVALUE_CHANGED_DURING_NORMALIZATION_WHEN_STANDALONE = El valor "{1}" del atributo "{0}" no se debe cambiar mediante la normalizaci\u00F3n (a "{2}") en un documento aut\u00F3nomo.
- MSG_CONTENT_INCOMPLETE = El contenido del tipo de elemento "{0}" es incompleto, debe coincidir con "{1}".
- MSG_CONTENT_INVALID = El contenido del tipo de elemento "{0}" debe coincidir con "{1}".
- MSG_CONTENT_INVALID_SPECIFIED = El contenido del tipo de elemento "{0}" debe coincidir con "{1}". Los secundarios del tipo "{2}" no est\u00E1n permitidos.
- MSG_DEFAULTED_ATTRIBUTE_NOT_SPECIFIED = El atributo "{1}" para el tipo de elemento "{0}" tiene un valor por defecto y debe especificarse en un documento aut\u00F3nomo.
- MSG_DUPLICATE_ATTDEF = El atributo "{1}" ya se ha declarado para el tipo de elemento "{0}".
- MSG_ELEMENT_ALREADY_DECLARED = El tipo de elemento "{0}" no debe declararse m\u00E1s de una vez.
- MSG_ELEMENT_NOT_DECLARED = El tipo de elemento "{0}" debe declararse.
- MSG_GRAMMAR_NOT_FOUND = El documento no es v\u00E1lido: no se ha encontrado la gram\u00E1tica.
- MSG_ELEMENT_WITH_ID_REQUIRED = Un elemento con el identificador "{0}" debe aparecer en el documento.
- MSG_EXTERNAL_ENTITY_NOT_PERMITTED = La referencia a la entidad externa "{0}" no est\u00E1 permitida en un documento aut\u00F3nomo.
- MSG_FIXED_ATTVALUE_INVALID = El atributo "{1}" con el valor "{2}" debe tener un valor de "{3}".
- MSG_MORE_THAN_ONE_ID_ATTRIBUTE = El tipo de elemento "{0}" ya tiene un atributo "{1}" del tipo ID, un segundo atributo "{2}" del tipo ID no est\u00E1 permitido.
- MSG_MORE_THAN_ONE_NOTATION_ATTRIBUTE = El tipo de elemento "{0}" ya tiene un atributo "{1}" del tipo NOTATION, un segundo atributo "{2}" del tipo NOTATION no est\u00E1 permitido.
- MSG_NOTATION_NOT_DECLARED_FOR_NOTATIONTYPE_ATTRIBUTE = La notaci\u00F3n "{1}" debe declararse cuando se hace referencia a la misma en la lista de tipos de notaci\u00F3n para el atributo "{0}".
- MSG_NOTATION_NOT_DECLARED_FOR_UNPARSED_ENTITYDECL = La notaci\u00F3n "{1}" debe declararse cuando se hace referencia a la misma en la declaraci\u00F3n de entidad no analizada para "{0}".
- MSG_REFERENCE_TO_EXTERNALLY_DECLARED_ENTITY_WHEN_STANDALONE = La referencia a la entidad "{0}" declarada en una entidad analizada externa no est\u00E1 permitida en un documento aut\u00F3nomo.
- MSG_REQUIRED_ATTRIBUTE_NOT_SPECIFIED = El atributo "{1}" es necesario y debe especificarse para el tipo de elemento "{0}".
- MSG_WHITE_SPACE_IN_ELEMENT_CONTENT_WHEN_STANDALONE = No debe incluirse un espacio en blanco entre los elementos declarados en una entidad analizada externa con el contenido del elemento en un documento aut\u00F3nomo.
- NMTOKENInvalid = El valor de atributo "{0}" del tipo NMTOKEN debe ser un token de nombre.
- NMTOKENSInvalid = El valor de atributo "{0}" del tipo NMTOKENS debe ser uno o m\u00E1s tokens de nombre.
- NoNotationOnEmptyElement = El tipo de elemento "{0}" que se declar\u00F3 como EMPTY no puede declarar el atributo "{1}" del tipo NOTATION.
- RootElementTypeMustMatchDoctypedecl = El elemento ra\u00EDz del documento "{1}", debe coincidir con la ra\u00EDz DOCTYPE "{0}".
- UndeclaredElementInContentSpec = El modelo de contenido del elemento "{0}" hace referencia al elemento no declarado "{1}".
- UniqueNotationName = La declaraci\u00F3n de la notaci\u00F3n "{0}" no es \u00FAnica. Un nombre determinado no debe declararse en m\u00E1s de una declaraci\u00F3n de notaci\u00F3n.
- ENTITYFailedInitializeGrammar = Fallo del validador ENTITYDatatype. Es necesario llamar al m\u00E9todo de inicializaci\u00F3n con una referencia de gram\u00E1tica v\u00E1lida. \t
- ENTITYNotUnparsed = ENTITY "{0}"no est\u00E1 sin analizar.
- ENTITYNotValid = ENTITY "{0}" no es v\u00E1lida.
- EmptyList = El valor de tipo ENTITIES, IDREFS y NMTOKENS no puede ser una lista vac\u00EDa.
-
-# Entity related messages
-# 3.1 Start-Tags, End-Tags, and Empty-Element Tags
- ReferenceToExternalEntity = La referencia de entidad externa "&{0};" no est\u00E1 permitida en un valor de atributo.
- AccessExternalDTD = DTD externa: fallo al leer DTD externa ''{0}'' porque el acceso a ''{1}'' no est\u00E1 permitido debido a una restricci\u00F3n que ha definido la propiedad accessExternalDTD.
- AccessExternalEntity = Entidad externa: fallo al leer el documento externo ''{0}'' porque el acceso a ''{1}'' no est\u00E1 permitido debido a una restricci\u00F3n que ha definido la propiedad accessExternalDTD.
-
-# 4.1 Character and Entity References
- EntityNotDeclared = Se hizo referencia a la entidad "{0}", pero no se declar\u00F3.
- ReferenceToUnparsedEntity = La referencia de entidad no analizada "&{0};" no est\u00E1 permitida.
- RecursiveReference = Referencia de entidad recursiva "{0}". (Ruta de acceso de referencia: {1}),
- RecursiveGeneralReference = Referencia de entidad general recursiva "&{0};". (Ruta de acceso de referencia: {1}),
- RecursivePEReference = Referencia de entidad de par\u00E1metro recursiva "%{0};". (Ruta de acceso de referencia: {1}),
-# 4.3.3 Character Encoding in Entities
- EncodingNotSupported = La codificaci\u00F3n "{0}" no est\u00E1 soportada.
- EncodingRequired = Una entidad analizada no codificada en UTF-8 o UTF-16 debe contener una declaraci\u00F3n de codificaci\u00F3n.
-
-# Namespaces support
-# 4. Using Qualified Names
- IllegalQName = El elemento o el atributo no coinciden con la producci\u00F3n del QName: QName::=(NCName':')?NCName.
- ElementXMLNSPrefix = El elemento "{0}" no puede tener "xmlns" como prefijo.
- ElementPrefixUnbound = El prefijo "{0}" para el elemento "{1}" no est\u00E1 enlazado.
- AttributePrefixUnbound = El prefijo "{2}" para el atributo "{1}" asociado a un tipo de elemento "{0}" no est\u00E1 enlazado.
- EmptyPrefixedAttName = El valor del atributo "{0}" no es v\u00E1lido. Los enlaces de espacio de nombres utilizados de prefijo no pueden estar vac\u00EDos.
- PrefixDeclared = El prefijo de espacio de nombres "{0}" no se ha declarado.
- CantBindXMLNS = El prefijo "xmlns" no puede enlazarse a ning\u00FAn espacio de nombres expl\u00EDcitamente; tampoco puede enlazarse el espacio de nombres para "xmlns" a cualquier prefijo expl\u00EDcitamente.
- CantBindXML = El prefijo "xml" no puede enlazarse a ning\u00FAn espacio de nombres que no sea el habitual; tampoco puede enlazarse el espacio de nombres para "xml" a cualquier prefijo que no sea "xml".
- MSG_ATT_DEFAULT_INVALID = El valor por defecto "{1}" del atributo "{0}" no es legal para las restricciones l\u00E9xicas de este tipo de atributo.
-
-# REVISIT: These need messages
- MSG_SPACE_REQUIRED_AFTER_SYSTEMLITERAL_IN_EXTERNALID=MSG_SPACE_REQUIRED_AFTER_SYSTEMLITERAL_IN_EXTERNALID
- OpenQuoteMissingInDecl=OpenQuoteMissingInDecl
- InvalidCharInLiteral=InvalidCharInLiteral
-
-
-# Implementation limits
- EntityExpansionLimit=JAXP00010001: el analizador ha encontrado m\u00E1s de "{0}"ampliaciones de entidad en este documento; \u00E9ste es el l\u00EDmite impuesto por el JDK.
- ElementAttributeLimit=JAXP00010002: el elemento "{0}" tiene m\u00E1s de "{1}" atributos, "{1}" es el l\u00EDmite impuesto por el JDK.
- MaxEntitySizeLimit=JAXP00010003: la longitud de la entidad "{0}" es "{1}", que excede el l\u00EDmite de "{2}" que ha definido "{3}".
- TotalEntitySizeLimit=JAXP00010004: el tama\u00F1o acumulado de las entidades es "{0}" y excede el l\u00EDmite de "{1}" definido por "{2}".
- MaxXMLNameLimit=JAXP00010005: la longitud de la entidad "{0}" es "{1}" y excede el l\u00EDmite de "{2}" definido por "{3}".
- MaxElementDepthLimit=JAXP00010006: El elemento "{0}" tiene una profundidad de "{1}" que excede el l\u00EDmite "{2}" definido por "{3}".
- EntityReplacementLimit=JAXP00010007: El n\u00FAmero total de nodos en las referencias de entidad es de "{0}" que supera el l\u00EDmite de "{1}" definido por "{2}".
-
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_fr.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_fr.properties
deleted file mode 100644
index c9c31bb..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_fr.properties
+++ /dev/null
@@ -1,305 +0,0 @@
-# This file contains error and warning messages related to XML
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-# @version
-
- BadMessageKey = Le message d'erreur correspondant \u00E0 la cl\u00E9 de message est introuvable.
- FormatFailed = Une erreur interne s'est produite pendant la mise en forme du message suivant :\n
-
-# Document messages
- PrematureEOF=Fin pr\u00E9matur\u00E9e du fichier.
-# 2.1 Well-Formed XML Documents
- RootElementRequired = L'\u00E9l\u00E9ment racine est obligatoire dans un document au format correct.
-# 2.2 Characters
-
- InvalidCharInCDSect = Un caract\u00E8re XML non valide (Unicode : 0x{0}) a \u00E9t\u00E9 d\u00E9tect\u00E9 dans la section CDATA.
- InvalidCharInContent = Un caract\u00E8re XML non valide (Unicode : 0x{0}) a \u00E9t\u00E9 d\u00E9tect\u00E9 dans le contenu d''\u00E9l\u00E9ment du document.
- TwoColonsInQName = Un deuxi\u00E8me ":" non valide a \u00E9t\u00E9 d\u00E9tect\u00E9 dans le type d'\u00E9l\u00E9ment ou le nom d'attribut.
- ColonNotLegalWithNS = Les deux-points ne sont pas autoris\u00E9s dans le nom ''{0}'' lorsque les espaces de noms sont activ\u00E9s.
- InvalidCharInMisc = Un caract\u00E8re XML non valide (Unicode : 0x{0}) a \u00E9t\u00E9 d\u00E9tect\u00E9 dans le balisage apr\u00E8s la fin du contenu d''\u00E9l\u00E9ment.
- InvalidCharInProlog = Un caract\u00E8re XML non valide (Unicode : 0x{0}) a \u00E9t\u00E9 d\u00E9tect\u00E9 dans le prologue du document.
- InvalidCharInXMLDecl = Un caract\u00E8re XML non valide (Unicode : 0x{0}) a \u00E9t\u00E9 d\u00E9tect\u00E9 dans la d\u00E9claration XML.
-# 2.4 Character Data and Markup
- CDEndInContent = La s\u00E9quence de caract\u00E8res "]]>" ne doit pas figurer dans le contenu sauf si elle est utilis\u00E9e pour baliser la fin d'une section CDATA.
-# 2.7 CDATA Sections
- CDSectUnterminated = La section CDATA doit se terminer par "]]>".
-# 2.8 Prolog and Document Type Declaration
- XMLDeclMustBeFirst = La d\u00E9claration XML ne peut figurer qu'au d\u00E9but du document.
- EqRequiredInXMLDecl = Le caract\u00E8re ''='' doit suivre "{0}" dans la d\u00E9claration XML.
- QuoteRequiredInXMLDecl = La valeur suivant "{0}" dans la d\u00E9claration XML doit \u00EAtre une cha\u00EEne entre guillemets.
- XMLDeclUnterminated = La d\u00E9claration XML doit se terminer par "?>".
- VersionInfoRequired = La version est obligatoire dans la d\u00E9claration XML.
- SpaceRequiredBeforeVersionInXMLDecl = Un espace est obligatoire devant le pseudo-attribut version dans la d\u00E9claration XML.
- SpaceRequiredBeforeEncodingInXMLDecl = Un espace est obligatoire devant le pseudo-attribut encoding dans la d\u00E9claration XML.
- SpaceRequiredBeforeStandalone = Un espace est obligatoire devant le pseudo-attribut encoding dans la d\u00E9claration XML.
- MarkupNotRecognizedInProlog = Le balisage du document pr\u00E9c\u00E9dant l'\u00E9l\u00E9ment racine doit avoir un format correct.
- MarkupNotRecognizedInMisc = Le balisage du document suivant l'\u00E9l\u00E9ment racine doit avoir un format correct.
- AlreadySeenDoctype = DOCTYPE d\u00E9j\u00E0 vu.
- DoctypeNotAllowed = DOCTYPE n'est pas autoris\u00E9 lorsque la fonctionnalit\u00E9 "http://apache.org/xml/features/disallow-doctype-decl" est d\u00E9finie sur True.
- ContentIllegalInProlog = Contenu non autoris\u00E9 dans le prologue.
- ReferenceIllegalInProlog = R\u00E9f\u00E9rence non autoris\u00E9e dans le prologue.
-# Trailing Misc
- ContentIllegalInTrailingMisc=Contenu non autoris\u00E9 dans la section de fin.
- ReferenceIllegalInTrailingMisc=R\u00E9f\u00E9rence non autoris\u00E9e dans la section de fin.
-
-# 2.9 Standalone Document Declaration
- SDDeclInvalid = La valeur de d\u00E9claration de document autonome doit \u00EAtre "oui" ou "non", mais pas "{0}".
- SDDeclNameInvalid = Le nom de document autonome contenu dans la d\u00E9claration XML est peut-\u00EAtre mal orthographi\u00E9.
-# 2.12 Language Identification
- XMLLangInvalid = La valeur d''attribut xml:lang "{0}" est un identificateur de langue non valide.
-# 3. Logical Structures
- ETagRequired = Le type d''\u00E9l\u00E9ment "{0}" doit se terminer par la balise de fin correspondante "</{0}>".
-# 3.1 Start-Tags, End-Tags, and Empty-Element Tags
- ElementUnterminated = Le type d''\u00E9l\u00E9ment "{0}" doit \u00EAtre suivi des sp\u00E9cifications d''attribut, ">" ou "/>".
- EqRequiredInAttribute = Le nom d''attribut "{1}" associ\u00E9 \u00E0 un type d''\u00E9l\u00E9ment "{0}" doit \u00EAtre suivi du caract\u00E8re ''=''.
- OpenQuoteExpected = Des guillemets ouvrants sont attendus pour l''attribut "{1}" associ\u00E9 \u00E0 un type d''\u00E9l\u00E9ment "{0}".
- CloseQuoteExpected = Des guillemets fermants sont attendus pour l''attribut "{1}" associ\u00E9 \u00E0 un type d''\u00E9l\u00E9ment "{0}".
- AttributeNotUnique = L''attribut "{1}" a d\u00E9j\u00E0 \u00E9t\u00E9 sp\u00E9cifi\u00E9 pour l''\u00E9l\u00E9ment "{0}".
- AttributeNSNotUnique = L''attribut "{1}" li\u00E9 \u00E0 l''espace de noms "{2}" a d\u00E9j\u00E0 \u00E9t\u00E9 sp\u00E9cifi\u00E9 pour l''\u00E9l\u00E9ment "{0}".
- ETagUnterminated = La balise de fin pour le type d''\u00E9l\u00E9ment "{0}" doit se terminer par un d\u00E9limiteur ''>''.
- MarkupNotRecognizedInContent = Le contenu des \u00E9l\u00E9ments doit inclure un balisage ou des caract\u00E8res au format correct.
- DoctypeIllegalInContent = Un DOCTYPE n'est pas autoris\u00E9 dans le contenu.
-# 4.1 Character and Entity References
- ReferenceUnterminated = La r\u00E9f\u00E9rence doit se terminer par un d\u00E9limiteur ';'.
-# 4.3.2 Well-Formed Parsed Entities
- ReferenceNotInOneEntity = La r\u00E9f\u00E9rence doit \u00EAtre enti\u00E8rement incluse dans la m\u00EAme entit\u00E9 analys\u00E9e.
- ElementEntityMismatch = L''\u00E9l\u00E9ment "{0}" doit commencer et se terminer dans la m\u00EAme entit\u00E9.
- MarkupEntityMismatch=Les structures de document XML doivent commencer et se terminer dans la m\u00EAme entit\u00E9.
-
-# Messages common to Document and DTD
-# 2.2 Characters
- InvalidCharInAttValue = Un caract\u00E8re XML non valide (Unicode : 0x{2}) a \u00E9t\u00E9 d\u00E9tect\u00E9 dans la valeur de l''attribut "{1}" et l''\u00E9l\u00E9ment est "{0}".
- InvalidCharInComment = Un caract\u00E8re XML non valide (Unicode : 0x{0}) a \u00E9t\u00E9 d\u00E9tect\u00E9 dans le commentaire.
- InvalidCharInPI = Un caract\u00E8re XML non valide (Unicode : 0x{0}) a \u00E9t\u00E9 d\u00E9tect\u00E9 dans l''instruction de traitement.
- InvalidCharInInternalSubset = Un caract\u00E8re XML non valide (Unicode : 0x{0}) a \u00E9t\u00E9 d\u00E9tect\u00E9 dans le sous-ensemble interne de la DTD.
- InvalidCharInTextDecl = Un caract\u00E8re XML non valide (Unicode : 0x{0}) a \u00E9t\u00E9 d\u00E9tect\u00E9 dans la d\u00E9claration textuelle.
-# 2.3 Common Syntactic Constructs
- QuoteRequiredInAttValue = La valeur de l''attribut "{1}" doit commencer par une apostrophe ou des guillemets.
- LessthanInAttValue = La valeur de l''attribut "{1}" associ\u00E9 \u00E0 un type d''\u00E9l\u00E9ment "{0}" ne doit pas contenir le caract\u00E8re ''<''.
- AttributeValueUnterminated = La valeur de l''attribut "{1}" doit se terminer par les guillemets correspondants.
-# 2.5 Comments
- InvalidCommentStart = Le commentaire doit commencer par "<!--".
- DashDashInComment = La cha\u00EEne "--" n'est pas autoris\u00E9e dans les commentaires.
- CommentUnterminated = Le commentaire doit se terminer par "-->".
- COMMENT_NOT_IN_ONE_ENTITY = Le commentaire n'est pas compris dans la m\u00EAme entit\u00E9.
-# 2.6 Processing Instructions
- PITargetRequired = L'instruction de traitement doit commencer par le nom de la cible.
- SpaceRequiredInPI = Un espace est obligatoire entre les donn\u00E9es et la cible de l'instruction de traitement.
- PIUnterminated = L'instruction de traitement doit se terminer par "?>".
- ReservedPITarget = La cible de l'instruction de traitement correspondant \u00E0 "[xX][mM][lL]" n'est pas autoris\u00E9e.
- PI_NOT_IN_ONE_ENTITY = L'instruction de traitement n'est pas comprise dans la m\u00EAme entit\u00E9.
-# 2.8 Prolog and Document Type Declaration
- VersionInfoInvalid = Version "{0}" non valide.
- VersionNotSupported = La version XML "{0}" n''est pas prise en charge. Seule la version XML 1.0 est prise en charge.
- VersionNotSupported11 = La version XML "{0}" n''est pas prise en charge. Seules les versions XML 1.0 et XML 1.1 sont prises en charge.
- VersionMismatch= Une entit\u00E9 ne peut pas inclure une autre entit\u00E9 d'une version ult\u00E9rieure.
-# 4.1 Character and Entity References
- DigitRequiredInCharRef = Une repr\u00E9sentation d\u00E9cimale doit imm\u00E9diatement suivre la cha\u00EEne "&#" dans une r\u00E9f\u00E9rence de caract\u00E8re.
- HexdigitRequiredInCharRef = Une repr\u00E9sentation hexad\u00E9cimale doit imm\u00E9diatement suivre la cha\u00EEne "&#x" dans une r\u00E9f\u00E9rence de caract\u00E8re.
- SemicolonRequiredInCharRef = La r\u00E9f\u00E9rence de caract\u00E8re doit se terminer par le d\u00E9limiteur ';'.
- InvalidCharRef = La r\u00E9f\u00E9rence de caract\u00E8re "&#{0}" est un caract\u00E8re XML non valide.
- NameRequiredInReference = Le nom de l'identit\u00E9 doit imm\u00E9diatement suivre le caract\u00E8re "&" dans la r\u00E9f\u00E9rence d'entit\u00E9.
- SemicolonRequiredInReference = La r\u00E9f\u00E9rence \u00E0 l''entit\u00E9 "{0}" doit se terminer par le d\u00E9limiteur '';''.
-# 4.3.1 The Text Declaration
- TextDeclMustBeFirst = La d\u00E9claration textuelle ne doit figurer qu'au d\u00E9but de l'entit\u00E9 analys\u00E9e externe.
- EqRequiredInTextDecl = Le caract\u00E8re ''='' doit suivre "{0}" dans la d\u00E9claration textuelle.
- QuoteRequiredInTextDecl = La valeur suivant "{0}" dans la d\u00E9claration textuelle doit \u00EAtre une cha\u00EEne entre guillemets.
- CloseQuoteMissingInTextDecl = Dans la valeur suivant "{0}" dans la d\u00E9claration textuelle, il manque les guillemets fermants.
- SpaceRequiredBeforeVersionInTextDecl = Un espace est obligatoire devant le pseudo-attribut version dans la d\u00E9claration textuelle.
- SpaceRequiredBeforeEncodingInTextDecl = Un espace est obligatoire devant le pseudo-attribut encoding dans la d\u00E9claration textuelle.
- TextDeclUnterminated = La d\u00E9claration textuelle doit se terminer par "?>".
- EncodingDeclRequired = La d\u00E9claration d'encodage est obligatoire dans la d\u00E9claration textuelle.
- NoMorePseudoAttributes = Aucun autre pseudo-attribut n'est autoris\u00E9.
- MorePseudoAttributes = D'autres pseudo-attributs sont attendus.
- PseudoAttrNameExpected = Un nom de pseudo-attribut est attendu.
-# 4.3.2 Well-Formed Parsed Entities
- CommentNotInOneEntity = Le commentaire doit \u00EAtre enti\u00E8rement inclus dans la m\u00EAme entit\u00E9 analys\u00E9e.
- PINotInOneEntity = L'instruction de traitement doit \u00EAtre enti\u00E8rement incluse dans la m\u00EAme entit\u00E9 analys\u00E9e.
-# 4.3.3 Character Encoding in Entities
- EncodingDeclInvalid = Nom d''encodage "{0}" non valide.
- EncodingByteOrderUnsupported = L''ordre des octets donn\u00E9 pour encoder "{0}" n''est pas pris en charge.
- InvalidByte = Octet {0} de la s\u00E9quence UTF-8 \u00E0 {1} octets non valide.
- ExpectedByte = Octet {0} de la s\u00E9quence UTF-8 \u00E0 {1} octets attendu.
- InvalidHighSurrogate = Les bits de substitution sup\u00E9rieurs (High surrogate) dans la s\u00E9quence UTF-8 ne doivent pas d\u00E9passer 0x10 mais des bits 0x{0} ont \u00E9t\u00E9 d\u00E9tect\u00E9s.
- OperationNotSupported = Op\u00E9ration "{0}" non prise en charge par le lecteur {1}.
- InvalidASCII = L''octet "{0}" n''appartient pas au jeu de caract\u00E8res ASCII (7 bits).
- CharConversionFailure = Une entit\u00E9 respectant un certain encodage ne doit pas contenir de s\u00E9quences non admises dans cet encodage.
-
-# DTD Messages
-# 2.2 Characters
- InvalidCharInEntityValue = Un caract\u00E8re XML non valide (Unicode : 0x{0}) a \u00E9t\u00E9 d\u00E9tect\u00E9 dans la valeur d''entit\u00E9 litt\u00E9rale.
- InvalidCharInExternalSubset = Un caract\u00E8re XML non valide (Unicode : 0x{0}) a \u00E9t\u00E9 d\u00E9tect\u00E9 dans le sous-ensemble externe de la DTD.
- InvalidCharInIgnoreSect = Un caract\u00E8re XML non valide (Unicode : 0x{0}) a \u00E9t\u00E9 d\u00E9tect\u00E9 dans la section conditionnelle exclue.
- InvalidCharInPublicID = Un caract\u00E8re XML non valide (Unicode : 0x{0}) a \u00E9t\u00E9 d\u00E9tect\u00E9 dans l''identificateur public.
- InvalidCharInSystemID = Un caract\u00E8re XML non valide (Unicode : 0x{0}) a \u00E9t\u00E9 d\u00E9tect\u00E9 dans l''identificateur syst\u00E8me.
-# 2.3 Common Syntactic Constructs
- SpaceRequiredAfterSYSTEM = Un espace est obligatoire apr\u00E8s le mot-cl\u00E9 SYSTEM dans la d\u00E9claration DOCTYPE.
- QuoteRequiredInSystemID = L'identificateur syst\u00E8me doit commencer par une apostrophe ou des guillemets.
- SystemIDUnterminated = L'identificateur syst\u00E8me doit se terminer par les guillemets correspondants.
- SpaceRequiredAfterPUBLIC = Un espace est obligatoire apr\u00E8s le mot-cl\u00E9 PUBLIC dans la d\u00E9claration DOCTYPE.
- QuoteRequiredInPublicID = L'identificateur public doit commencer par une apostrophe ou des guillemets.
- PublicIDUnterminated = L'identificateur public doit se terminer par les guillemets correspondants.
- PubidCharIllegal = Ce caract\u00E8re (Unicode : 0x{0}) n''est pas autoris\u00E9 dans l''identificateur public.
- SpaceRequiredBetweenPublicAndSystem = Des espaces sont obligatoires entre les ID publicId et systemId.
-# 2.8 Prolog and Document Type Declaration
- MSG_SPACE_REQUIRED_BEFORE_ROOT_ELEMENT_TYPE_IN_DOCTYPEDECL = Un espace est obligatoire apr\u00E8s "<!DOCTYPE" dans la d\u00E9claration de type de document.
- MSG_ROOT_ELEMENT_TYPE_REQUIRED = Le type d'\u00E9l\u00E9ment racine doit figurer apr\u00E8s "<!DOCTYPE" dans la d\u00E9claration de type de document.
- DoctypedeclUnterminated = La d\u00E9claration de type de document pour le type d''\u00E9l\u00E9ment racine "{0}" doit se terminer par ''>''.
- DoctypedeclNotClosed = La d\u00E9claration de type de document pour le type d''\u00E9l\u00E9ment racine "{0}" doit se terminer par '']''.
- PEReferenceWithinMarkup = La r\u00E9f\u00E9rence d''entit\u00E9 de param\u00E8tre "%{0};" ne peut pas survenir dans le balisage du sous-ensemble interne de la DTD.
- MSG_MARKUP_NOT_RECOGNIZED_IN_DTD = Les d\u00E9clarations de balisage contenues dans la d\u00E9claration de type de document ou sur lesquelles pointe cette derni\u00E8re doivent avoir un format correct.
-# 2.10 White Space Handling
- MSG_XML_SPACE_DECLARATION_ILLEGAL = La d\u00E9claration d'attribut pour "xml:space" doit \u00EAtre pr\u00E9sent\u00E9e comme type \u00E9num\u00E9r\u00E9 dont les seules valeurs possibles sont "default" et "preserve".
-# 3.2 Element Type Declarations
- MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ELEMENTDECL = Un espace est obligatoire apr\u00E8s "<!ELEMENT" dans la d\u00E9claration de type d'\u00E9l\u00E9ment.
- MSG_ELEMENT_TYPE_REQUIRED_IN_ELEMENTDECL = Le type d'\u00E9l\u00E9ment est obligatoire dans la d\u00E9claration de type d'\u00E9l\u00E9ment.
- MSG_SPACE_REQUIRED_BEFORE_CONTENTSPEC_IN_ELEMENTDECL = Un espace est obligatoire apr\u00E8s le type d''\u00E9l\u00E9ment "{0}" dans la d\u00E9claration de type d''\u00E9l\u00E9ment.
- MSG_CONTENTSPEC_REQUIRED_IN_ELEMENTDECL = La contrainte est obligatoire apr\u00E8s le type d''\u00E9l\u00E9ment "{0}" dans la d\u00E9claration de type d''\u00E9l\u00E9ment.
- ElementDeclUnterminated = La d\u00E9claration du type d''\u00E9l\u00E9ment "{0}" doit se terminer par ''>''.
-# 3.2.1 Element Content
- MSG_OPEN_PAREN_OR_ELEMENT_TYPE_REQUIRED_IN_CHILDREN = Un caract\u00E8re ''('' ou un type d''\u00E9l\u00E9ment est obligatoire dans la d\u00E9claration du type d''\u00E9l\u00E9ment "{0}".
- MSG_CLOSE_PAREN_REQUIRED_IN_CHILDREN = Un caract\u00E8re '')'' est obligatoire dans la d\u00E9claration du type d''\u00E9l\u00E9ment "{0}".
-# 3.2.2 Mixed Content
- MSG_ELEMENT_TYPE_REQUIRED_IN_MIXED_CONTENT = Un type d''\u00E9l\u00E9ment est obligatoire dans la d\u00E9claration du type d''\u00E9l\u00E9ment "{0}".
- MSG_CLOSE_PAREN_REQUIRED_IN_MIXED = Un caract\u00E8re '')'' est obligatoire dans la d\u00E9claration du type d''\u00E9l\u00E9ment "{0}".
- MixedContentUnterminated = Le mod\u00E8le de contenu mixte "{0}" doit se terminer par ")*" lorsque les types d''\u00E9l\u00E9ment enfant sont contraints.
-# 3.3 Attribute-List Declarations
- MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ATTLISTDECL = Un espace est obligatoire apr\u00E8s "<!ATTLIST" dans la d\u00E9claration de liste d'attributs.
- MSG_ELEMENT_TYPE_REQUIRED_IN_ATTLISTDECL = Le type d'\u00E9l\u00E9ment est obligatoire dans la d\u00E9claration de liste d'attributs.
- MSG_SPACE_REQUIRED_BEFORE_ATTRIBUTE_NAME_IN_ATTDEF = Un espace est obligatoire avant le nom d''attribut dans la d\u00E9claration de liste d''attributs de l''\u00E9l\u00E9ment "{0}".
- AttNameRequiredInAttDef = Le nom d''attribut doit \u00EAtre sp\u00E9cifi\u00E9 dans la d\u00E9claration de liste d''attributs de l''\u00E9l\u00E9ment "{0}".
- MSG_SPACE_REQUIRED_BEFORE_ATTTYPE_IN_ATTDEF = Un espace est obligatoire avant le type d''attribut dans la d\u00E9claration de l''attribut "{1}" de l''\u00E9l\u00E9ment "{0}".
- AttTypeRequiredInAttDef = Le type d''attribut est obligatoire dans la d\u00E9claration de l''attribut "{1}" de l''\u00E9l\u00E9ment "{0}".
- MSG_SPACE_REQUIRED_BEFORE_DEFAULTDECL_IN_ATTDEF = Un espace est obligatoire avant la valeur par d\u00E9faut de l''attribut dans la d\u00E9claration de l''attribut "{1}" de l''\u00E9l\u00E9ment "{0}".
- MSG_DUPLICATE_ATTRIBUTE_DEFINITION = Plusieurs d\u00E9finitions d''attribut sont fournies pour le m\u00EAme attribut "{1}" d''un \u00E9l\u00E9ment donn\u00E9 "{0}".
-# 3.3.1 Attribute Types
- MSG_SPACE_REQUIRED_AFTER_NOTATION_IN_NOTATIONTYPE = Un espace doit figurer apr\u00E8s "NOTATION" dans la d\u00E9claration d''attribut "{1}".
- MSG_OPEN_PAREN_REQUIRED_IN_NOTATIONTYPE = Le caract\u00E8re ''('' doit suivre "NOTATION" dans la d\u00E9claration d''attribut "{1}".
- MSG_NAME_REQUIRED_IN_NOTATIONTYPE = Le nom de notation est obligatoire dans la liste des types de notation de la d\u00E9claration d''attribut "{1}".
- NotationTypeUnterminated = La liste des types de notation doit se terminer par '')'' dans la d\u00E9claration d''attribut "{1}".
- MSG_NMTOKEN_REQUIRED_IN_ENUMERATION = Le jeton de nom est obligatoire dans la liste des types \u00E9num\u00E9r\u00E9s pour la d\u00E9claration d''attribut "{1}".
- EnumerationUnterminated = La liste des types \u00E9num\u00E9r\u00E9s doit se terminer par '')'' dans la d\u00E9claration d''attribut "{1}".
- MSG_DISTINCT_TOKENS_IN_ENUMERATION = La valeur d''\u00E9num\u00E9ration "{1}" a \u00E9t\u00E9 indiqu\u00E9e plusieurs fois dans la d\u00E9claration de l''attribut "{2}" pour l''\u00E9l\u00E9ment "{0}". Les valeurs NMTOKENS d''une d\u00E9claration d''attribut Enumeration unique doivent toutes \u00EAtre distinctes.
- MSG_DISTINCT_NOTATION_IN_ENUMERATION = La valeur d''\u00E9num\u00E9ration "{1}" a \u00E9t\u00E9 indiqu\u00E9e plusieurs fois dans la d\u00E9claration de l''attribut "{2}" pour l''\u00E9l\u00E9ment "{0}". Les noms NOTATION d''une d\u00E9claration d''attribut NotationType unique doivent tous \u00EAtre distincts.
-# 3.3.2 Attribute Defaults
- MSG_SPACE_REQUIRED_AFTER_FIXED_IN_DEFAULTDECL = Un espace doit figurer apr\u00E8s "FIXED" dans la d\u00E9claration d''attribut "{1}".
-# 3.4 Conditional Sections
- IncludeSectUnterminated = La section conditionnelle incluse doit se terminer par "]]>".
- IgnoreSectUnterminated = La section conditionnelle exclue doit se terminer par "]]>".
-# 4.1 Character and Entity References
- NameRequiredInPEReference = Le nom de l'entit\u00E9 doit imm\u00E9diatement suivre le caract\u00E8re "%" dans la r\u00E9f\u00E9rence d'entit\u00E9 de param\u00E8tre.
- SemicolonRequiredInPEReference = La r\u00E9f\u00E9rence d''entit\u00E9 de param\u00E8tre "%{0};" doit se terminer par le d\u00E9limiteur '';''.
-# 4.2 Entity Declarations
- MSG_SPACE_REQUIRED_BEFORE_ENTITY_NAME_IN_ENTITYDECL = Un espace est obligatoire apr\u00E8s "<!ENTITY" dans la d\u00E9claration d'entit\u00E9.
- MSG_SPACE_REQUIRED_BEFORE_PERCENT_IN_PEDECL = Un espace est obligatoire entre "<!ENTITY" et le caract\u00E8re "%" dans la d\u00E9claration d'entit\u00E9 de param\u00E8tre.
- MSG_SPACE_REQUIRED_BEFORE_ENTITY_NAME_IN_PEDECL = Un espace est obligatoire entre "%" et le nom de l'entit\u00E9 dans la d\u00E9claration d'entit\u00E9 de param\u00E8tre.
- MSG_ENTITY_NAME_REQUIRED_IN_ENTITYDECL = Le nom de l'entit\u00E9 est obligatoire dans la d\u00E9claration d'entit\u00E9.
- MSG_SPACE_REQUIRED_AFTER_ENTITY_NAME_IN_ENTITYDECL = Un espace est obligatoire entre le nom de l''entit\u00E9 "{0}" et la d\u00E9finition dans la d\u00E9claration d''entit\u00E9.
- MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_UNPARSED_ENTITYDECL = Un espace est obligatoire entre "NDATA" et le nom de notation dans la d\u00E9claration de l''entit\u00E9 "{0}".
- MSG_SPACE_REQUIRED_BEFORE_NDATA_IN_UNPARSED_ENTITYDECL = Un espace est obligatoire avant "NDATA" dans la d\u00E9claration de l''entit\u00E9 "{0}".
- MSG_NOTATION_NAME_REQUIRED_FOR_UNPARSED_ENTITYDECL = Le nom de notation est obligatoire apr\u00E8s "NDATA" dans la d\u00E9claration de l''entit\u00E9 "{0}".
- EntityDeclUnterminated = La d\u00E9claration de l''entit\u00E9 "{0}" doit se terminer par ''>''.
- MSG_DUPLICATE_ENTITY_DEFINITION = L''entit\u00E9 "{0}" est d\u00E9clar\u00E9e plusieurs fois.
-# 4.2.2 External Entities
- ExternalIDRequired = La d\u00E9claration d'entit\u00E9 externe doit commencer par "SYSTEM" ou "PUBLIC".
- MSG_SPACE_REQUIRED_BEFORE_PUBIDLITERAL_IN_EXTERNALID = Un espace est obligatoire entre "PUBLIC" et l'identificateur public.
- MSG_SPACE_REQUIRED_AFTER_PUBIDLITERAL_IN_EXTERNALID = Un espace est obligatoire entre l'identificateur public et l'identificateur syst\u00E8me.
- MSG_SPACE_REQUIRED_BEFORE_SYSTEMLITERAL_IN_EXTERNALID = Un espace est obligatoire entre "SYSTEM" et l'identificateur syst\u00E8me.
- MSG_URI_FRAGMENT_IN_SYSTEMID = L''identificateur du fragment ne doit pas \u00EAtre sp\u00E9cifi\u00E9 comme faisant partie de l''identificateur syst\u00E8me "{0}".
-# 4.7 Notation Declarations
- MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_NOTATIONDECL = Un espace est obligatoire apr\u00E8s "<!NOTATION" dans la d\u00E9claration de notation.
- MSG_NOTATION_NAME_REQUIRED_IN_NOTATIONDECL = Le nom de la notation est obligatoire dans la d\u00E9claration de notation.
- MSG_SPACE_REQUIRED_AFTER_NOTATION_NAME_IN_NOTATIONDECL = Un espace est obligatoire apr\u00E8s le nom de notation "{0}" dans la d\u00E9claration de notation.
- ExternalIDorPublicIDRequired = La d\u00E9claration de la notation "{0}" doit inclure un identificateur syst\u00E8me ou public.
- NotationDeclUnterminated = La d\u00E9claration de la notation "{0}" doit se terminer par ''>''.
-
-# Validation messages
- DuplicateTypeInMixedContent = Le type d''\u00E9l\u00E9ment "{1}" a d\u00E9j\u00E0 \u00E9t\u00E9 sp\u00E9cifi\u00E9 dans le mod\u00E8le de contenu de la d\u00E9claration d''\u00E9l\u00E9ment "{0}".
- ENTITIESInvalid = La valeur d''attribut "{1}" de type ENTITIES doit correspondre au nom d''au moins une entit\u00E9 non analys\u00E9e.
- ENTITYInvalid = La valeur d''attribut "{1}" de type ENTITY doit correspondre au nom d''une entit\u00E9 non analys\u00E9e.
- IDDefaultTypeInvalid = L''attribut d''ID "{0}" doit avoir une valeur par d\u00E9faut d\u00E9clar\u00E9e de "#IMPLIED" ou "#REQUIRED".
- IDInvalid = La valeur d''attribut "{0}" de type ID doit \u00EAtre un nom.
- IDInvalidWithNamespaces = La valeur d''attribut "{0}" de type ID doit \u00EAtre un NCName lorsque les espaces de noms sont activ\u00E9s.
- IDNotUnique = La valeur d''attribut "{0}" de type ID doit \u00EAtre unique dans le document.
- IDREFInvalid = La valeur d''attribut "{0}" de type IDREF doit \u00EAtre un nom.
- IDREFInvalidWithNamespaces = La valeur d''attribut "{0}" de type IDREF doit \u00EAtre un NCName lorsque les espaces de noms sont activ\u00E9s.
- IDREFSInvalid = Une valeur d''attribut "{0}" de type IDREFS doit correspondre \u00E0 au moins un nom.
- ILL_FORMED_PARAMETER_ENTITY_WHEN_USED_IN_DECL = Le texte de remplacement de l''entit\u00E9 de param\u00E8tre "{0}" doit inclure des d\u00E9clarations correctement imbriqu\u00E9es lorsque la r\u00E9f\u00E9rence d''entit\u00E9 est utilis\u00E9e comme d\u00E9claration compl\u00E8te.
- ImproperDeclarationNesting = Le texte de remplacement de l''entit\u00E9 de param\u00E8tre "{0}" doit inclure des d\u00E9clarations correctement imbriqu\u00E9es.
- ImproperGroupNesting = Le texte de remplacement de l''entit\u00E9 de param\u00E8tre "{0}" doit inclure des paires de parenth\u00E8ses correctement imbriqu\u00E9es.
- INVALID_PE_IN_CONDITIONAL = Le texte de remplacement de l''entit\u00E9 de param\u00E8tre "{0}" doit inclure la section conditionnelle compl\u00E8te ou seulement INCLUDE ou IGNORE.
- MSG_ATTRIBUTE_NOT_DECLARED = L''attribut "{1}" doit \u00EAtre d\u00E9clar\u00E9 pour le type d''\u00E9l\u00E9ment "{0}".
- MSG_ATTRIBUTE_VALUE_NOT_IN_LIST = L''attribut "{0}" de valeur "{1}" doit avoir une valeur issue de la liste "{2}".
- MSG_ATTVALUE_CHANGED_DURING_NORMALIZATION_WHEN_STANDALONE = La valeur "{1}" de l''attribut "{0}" ne doit pas \u00EAtre modifi\u00E9e par normalisation (et devenir "{2}") dans un document autonome.
- MSG_CONTENT_INCOMPLETE = Le contenu du type d''\u00E9l\u00E9ment "{0}" est incomplet. Il doit correspondre \u00E0 "{1}".
- MSG_CONTENT_INVALID = Le contenu du type d''\u00E9l\u00E9ment "{0}" doit correspondre \u00E0 "{1}".
- MSG_CONTENT_INVALID_SPECIFIED = Le contenu du type d''\u00E9l\u00E9ment "{0}" doit correspondre \u00E0 "{1}". Les enfants de type "{2}" ne sont pas autoris\u00E9s.
- MSG_DEFAULTED_ATTRIBUTE_NOT_SPECIFIED = L''attribut "{1}" du type d''\u00E9l\u00E9ment "{0}" a une valeur par d\u00E9faut et doit \u00EAtre sp\u00E9cifi\u00E9 dans un document autonome.
- MSG_DUPLICATE_ATTDEF = L''attribut "{1}" est d\u00E9j\u00E0 d\u00E9clar\u00E9 pour le type d''\u00E9l\u00E9ment "{0}".
- MSG_ELEMENT_ALREADY_DECLARED = Le type d''\u00E9l\u00E9ment "{0}" ne doit pas \u00EAtre d\u00E9clar\u00E9 plusieurs fois.
- MSG_ELEMENT_NOT_DECLARED = Le type d''\u00E9l\u00E9ment "{0}" doit \u00EAtre d\u00E9clar\u00E9.
- MSG_GRAMMAR_NOT_FOUND = Le document n'est pas valide : aucune grammaire d\u00E9tect\u00E9e.
- MSG_ELEMENT_WITH_ID_REQUIRED = Un \u00E9l\u00E9ment avec l''identificateur "{0}" doit figurer dans le document.
- MSG_EXTERNAL_ENTITY_NOT_PERMITTED = La r\u00E9f\u00E9rence \u00E0 l''entit\u00E9 externe "{0}" n''est pas autoris\u00E9e dans le document autonome.
- MSG_FIXED_ATTVALUE_INVALID = L''attribut "{1}" de valeur "{2}" doit avoir une valeur de "{3}".
- MSG_MORE_THAN_ONE_ID_ATTRIBUTE = Le type d''\u00E9l\u00E9ment "{0}" a d\u00E9j\u00E0 l''attribut "{1}" de type ID. Un deuxi\u00E8me attribut "{2}" de type ID n''est pas autoris\u00E9.
- MSG_MORE_THAN_ONE_NOTATION_ATTRIBUTE = Le type d''\u00E9l\u00E9ment "{0}" a d\u00E9j\u00E0 l''attribut "{1}" de type NOTATION. Un deuxi\u00E8me attribut "{2}" de type NOTATION n''est pas autoris\u00E9.
- MSG_NOTATION_NOT_DECLARED_FOR_NOTATIONTYPE_ATTRIBUTE = La notation "{1}" doit \u00EAtre d\u00E9clar\u00E9e lorsqu''elle est r\u00E9f\u00E9renc\u00E9e dans la liste des types de notation de l''attribut "{0}".
- MSG_NOTATION_NOT_DECLARED_FOR_UNPARSED_ENTITYDECL = La notation "{1}" doit \u00EAtre d\u00E9clar\u00E9e lorsqu''elle est r\u00E9f\u00E9renc\u00E9e dans la d\u00E9claration d''entit\u00E9 non analys\u00E9e pour "{0}".
- MSG_REFERENCE_TO_EXTERNALLY_DECLARED_ENTITY_WHEN_STANDALONE = La r\u00E9f\u00E9rence \u00E0 l''entit\u00E9 "{0}" d\u00E9clar\u00E9e dans une entit\u00E9 analys\u00E9e externe n''est pas autoris\u00E9e dans un document autonome.
- MSG_REQUIRED_ATTRIBUTE_NOT_SPECIFIED = L''attribut "{1}" est obligatoire et doit \u00EAtre sp\u00E9cifi\u00E9 pour le type d''\u00E9l\u00E9ment "{0}".
- MSG_WHITE_SPACE_IN_ELEMENT_CONTENT_WHEN_STANDALONE = Aucun espace ne doit figurer entre les \u00E9l\u00E9ments d\u00E9clar\u00E9s dans une entit\u00E9 analys\u00E9e externe avec le contenu des \u00E9l\u00E9ments dans un document autonome.
- NMTOKENInvalid = La valeur d''attribut "{0}" de type NMTOKEN doit correspondre \u00E0 un jeton de nom.
- NMTOKENSInvalid = La valeur d''attribut "{0}" de type NMTOKENS doit correspondre \u00E0 au moins un jeton de nom.
- NoNotationOnEmptyElement = Le type d''\u00E9l\u00E9ment "{0}" d\u00E9clar\u00E9 EMPTY ne peut pas d\u00E9clarer un attribut "{1}" de type NOTATION.
- RootElementTypeMustMatchDoctypedecl = L''\u00E9l\u00E9ment racine de document "{1}" doit correspondre \u00E0 la racine DOCTYPE "{0}".
- UndeclaredElementInContentSpec = Le mod\u00E8le de contenu de l''\u00E9l\u00E9ment "{0}" fait r\u00E9f\u00E9rence \u00E0 l''\u00E9l\u00E9ment non d\u00E9clar\u00E9 "{1}".
- UniqueNotationName = La d\u00E9claration de la notation "{0}" n''est pas unique. Une valeur Name donn\u00E9e ne doit pas \u00EAtre d\u00E9clar\u00E9e dans plusieurs d\u00E9clarations de notation.
- ENTITYFailedInitializeGrammar = Valideur ENTITYDatatype : \u00E9chec. Besoin d'appeler une m\u00E9thode d'initialisation avec une r\u00E9f\u00E9rence de grammaire valide. \t
- ENTITYNotUnparsed = La valeur ENTITY "{0}" est analys\u00E9e.
- ENTITYNotValid = La valeur ENTITY "{0}" n''est pas valide.
- EmptyList = Une valeur de type ENTITIES, IDREFS et NMTOKENS ne peut pas correspondre \u00E0 une liste vide.
-
-# Entity related messages
-# 3.1 Start-Tags, End-Tags, and Empty-Element Tags
- ReferenceToExternalEntity = La r\u00E9f\u00E9rence d''entit\u00E9 externe "&{0};" n''est pas autoris\u00E9e dans une valeur d''attribut.
- AccessExternalDTD = DTD externe : \u00E9chec de la lecture de la DTD externe ''{0}'', car l''acc\u00E8s ''{1}'' n''est pas autoris\u00E9 en raison d''une restriction d\u00E9finie par la propri\u00E9t\u00E9 accessExternalDTD.
- AccessExternalEntity = Entit\u00E9 externe : \u00E9chec de la lecture du document externe ''{0}'', car l''acc\u00E8s ''{1}'' n''est pas autoris\u00E9 en raison d''une restriction d\u00E9finie par la propri\u00E9t\u00E9 accessExternalDTD.
-
-# 4.1 Character and Entity References
- EntityNotDeclared = L''entit\u00E9 "{0}" \u00E9tait r\u00E9f\u00E9renc\u00E9e, mais pas d\u00E9clar\u00E9e.
- ReferenceToUnparsedEntity = La r\u00E9f\u00E9rence d''entit\u00E9 non analys\u00E9e "&{0};" n''est pas autoris\u00E9e.
- RecursiveReference = R\u00E9f\u00E9rence d''entit\u00E9 r\u00E9cursive "{0}". (Chemin de r\u00E9f\u00E9rence : {1}),
- RecursiveGeneralReference = R\u00E9f\u00E9rence d''entit\u00E9 g\u00E9n\u00E9rale r\u00E9cursive "&{0};". (Chemin de r\u00E9f\u00E9rence : {1}),
- RecursivePEReference = R\u00E9f\u00E9rence d''entit\u00E9 de param\u00E8tre r\u00E9cursive "%{0};". (Chemin de r\u00E9f\u00E9rence : {1}),
-# 4.3.3 Character Encoding in Entities
- EncodingNotSupported = L''encodage "{0}" n''est pas pris en charge.
- EncodingRequired = Une entit\u00E9 analys\u00E9e sans encodage UTF-8 ou UTF-16 doit contenir une d\u00E9claration d'encodage.
-
-# Namespaces support
-# 4. Using Qualified Names
- IllegalQName = L'\u00E9l\u00E9ment ou l'attribut ne correspond pas \u00E0 la production QName : QName::=(NCName':')?NCName.
- ElementXMLNSPrefix = L''\u00E9l\u00E9ment "{0}" ne peut pas avoir "xmlns" comme pr\u00E9fixe.
- ElementPrefixUnbound = Le pr\u00E9fixe "{0}" de l''\u00E9l\u00E9ment "{1}" n''est pas li\u00E9.
- AttributePrefixUnbound = Le pr\u00E9fixe "{2}" de l''attribut "{1}" associ\u00E9 \u00E0 un type d''\u00E9l\u00E9ment "{0}" n''est pas li\u00E9.
- EmptyPrefixedAttName = La valeur de l''attribut "{0}" n''est pas valide. Les liaisons d''espaces de noms pr\u00E9fix\u00E9s ne peuvent pas \u00EAtre vides.
- PrefixDeclared = Le pr\u00E9fixe d''espace de noms "{0}" n''\u00E9tait pas d\u00E9clar\u00E9.
- CantBindXMLNS = Le pr\u00E9fixe "xmlns" ne peut pas \u00EAtre li\u00E9 \u00E0 un espace de noms de fa\u00E7on explicite, pas plus que l'espace de noms de "xmlns" \u00E0 un pr\u00E9fixe quelconque.
- CantBindXML = Le pr\u00E9fixe "xml" ne peut pas \u00EAtre li\u00E9 \u00E0 un autre espace de noms que son espace de noms habituel. L'espace de noms de "xml" ne peut pas non plus \u00EAtre li\u00E9 \u00E0 un autre pr\u00E9fixe que "xml".
- MSG_ATT_DEFAULT_INVALID = La valeur par d\u00E9faut "{1}" de l''attribut "{0}" n''est pas admise conform\u00E9ment aux contraintes lexicales de ce type d''attribut.
-
-# REVISIT: These need messages
- MSG_SPACE_REQUIRED_AFTER_SYSTEMLITERAL_IN_EXTERNALID=MSG_SPACE_REQUIRED_AFTER_SYSTEMLITERAL_IN_EXTERNALID
- OpenQuoteMissingInDecl=OpenQuoteMissingInDecl
- InvalidCharInLiteral=InvalidCharInLiteral
-
-
-# Implementation limits
- EntityExpansionLimit=JAXP00010001 : L''analyseur a rencontr\u00E9 plus de "{0}" d\u00E9veloppements d''entit\u00E9 dans ce document. Il s''agit de la limite impos\u00E9e par le JDK.
- ElementAttributeLimit=JAXP00010002 : L''\u00E9l\u00E9ment "{0}" a plus de "{1}" attributs. "{1}" est la limite impos\u00E9e par le JDK.
- MaxEntitySizeLimit=JAXP00010003 : La longueur de l''entit\u00E9 "{0}" est de "{1}". Cette valeur d\u00E9passe la limite de "{2}" d\u00E9finie par "{3}".
- TotalEntitySizeLimit=JAXP00010004 : La taille cumul\u00E9e des entit\u00E9s est "{0}" et d\u00E9passe la limite de "{1}" d\u00E9finie par "{2}".
- MaxXMLNameLimit=JAXP00010005 : La longueur de l''entit\u00E9 "{0}" est de "{1}". Cette valeur d\u00E9passe la limite de "{2}" d\u00E9finie par "{3}".
- MaxElementDepthLimit=JAXP00010006 : l''\u00E9l\u00E9ment "{0}" a une profondeur de "{1}" qui d\u00E9passe la limite de "{2}" d\u00E9finie par "{3}".
- EntityReplacementLimit=JAXP00010007 : Le nombre total de noeuds dans les r\u00E9f\u00E9rences d''entit\u00E9 est "{0}", soit plus que la limite de "{1}" d\u00E9finie par "{2}".
-
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_it.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_it.properties
deleted file mode 100644
index 1cca604..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_it.properties
+++ /dev/null
@@ -1,305 +0,0 @@
-# This file contains error and warning messages related to XML
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-# @version
-
- BadMessageKey = Impossibile trovare il messaggio di errore corrispondente alla chiave di messaggio.
- FormatFailed = Si \u00E8 verificato un errore interno durante la formattazione del seguente messaggio:\n
-
-# Document messages
- PrematureEOF=Fine del file anticipata.
-# 2.1 Well-Formed XML Documents
- RootElementRequired = L'elemento radice \u00E8 obbligatorio in un documento con formato corretto.
-# 2.2 Characters
-
- InvalidCharInCDSect = \u00C8 stato trovato un carattere XML non valido (Unicode: 0x{0}) nella sezione CDATA.
- InvalidCharInContent = \u00C8 stato trovato un carattere XML non valido (Unicode: 0x{0}) nel contenuto dell''elemento del documento.
- TwoColonsInQName = \u00C8 stato trovato un secondo carattere dei due punti (':') non valido nel tipo di elemento o nel nome attributo.
- ColonNotLegalWithNS = Non sono consentiti i due punti nel nome "{0}" se sono abilitati gli spazi di nomi.
- InvalidCharInMisc = \u00C8 stato trovato un carattere XML non valido (Unicode: 0x{0}) nel markup dopo la fine del contenuto dell''elemento.
- InvalidCharInProlog = \u00C8 stato trovato un carattere XML non valido (Unicode: 0x{0}) nel prologo del documento.
- InvalidCharInXMLDecl = \u00C8 stato trovato un carattere XML non valido (Unicode: 0x{0}) nella dichiarazione XML.
-# 2.4 Character Data and Markup
- CDEndInContent = La sequenza di caratteri "]]>" non deve essere presente nel contenuto a meno che non sia utilizzata per contrassegnare la fine di una sezione CDATA.
-# 2.7 CDATA Sections
- CDSectUnterminated = La sezione CDATA deve terminare con "]]>".
-# 2.8 Prolog and Document Type Declaration
- XMLDeclMustBeFirst = La dichiarazione XML pu\u00F2 comparire solo all'inizio del documento.
- EqRequiredInXMLDecl = Il carattere '' = '' deve seguire "{0}" nella dichiarazione XML.
- QuoteRequiredInXMLDecl = Il valore che segue "{0}" nella dichiarazione XML deve essere una stringa compresa tra apici.
- XMLDeclUnterminated = La dichiarazione XML deve terminare con "?>".
- VersionInfoRequired = La versione \u00E8 obbligatoria nella dichiarazione XML.
- SpaceRequiredBeforeVersionInXMLDecl = \u00C8 richiesto uno spazio prima dell'attributo pseudo della versione nella dichiarazione XML.
- SpaceRequiredBeforeEncodingInXMLDecl = \u00C8 richiesto uno spazio prima dell'attributo pseudo di codifica nella dichiarazione XML.
- SpaceRequiredBeforeStandalone = \u00C8 richiesto uno spazio prima dell'attributo pseudo di codifica nella dichiarazione XML.
- MarkupNotRecognizedInProlog = Il markup nel documento che precede l'elemento radice deve avere un formato corretto.
- MarkupNotRecognizedInMisc = Il markup nel documento che segue l'elemento radice deve avere un formato corretto.
- AlreadySeenDoctype = Doctype gi\u00E0 presente.
- DoctypeNotAllowed = DOCTYPE non \u00E8 consentito se la funzione "http://apache.org/xml/features/disallow-doctype-decl" \u00E8 impostata su true.
- ContentIllegalInProlog = Il contenuto non \u00E8 consentito nel prologo.
- ReferenceIllegalInProlog = Il riferimento non \u00E8 consentito nel prologo.
-# Trailing Misc
- ContentIllegalInTrailingMisc=Il contenuto non \u00E8 consentito nella sezione finale.
- ReferenceIllegalInTrailingMisc=Il riferimento non \u00E8 consentito nella sezione finale.
-
-# 2.9 Standalone Document Declaration
- SDDeclInvalid = Il valore della dichiarazione del documento standalone deve essere "yes" o "no", non "{0}".
- SDDeclNameInvalid = Il nome standalone nella dichiarazione XML potrebbe essere stato digitato in modo errato.
-# 2.12 Language Identification
- XMLLangInvalid = Il valore dell''attributo xml:lang "{0}" \u00E8 un identificativo di lingua non valido.
-# 3. Logical Structures
- ETagRequired = Il tipo di elemento "{0}" deve terminare con la corrispondente tag finale "</{0}>".
-# 3.1 Start-Tags, End-Tags, and Empty-Element Tags
- ElementUnterminated = Il tipo di elemento "{0}" deve essere seguito dalle specifiche di attributo ">" o "/>".
- EqRequiredInAttribute = Il nome attributo "{1}" associato a un tipo di elemento "{0}" deve essere seguito dal carattere '' = ''.
- OpenQuoteExpected = \u00C8 previsto un apice di apertura per l''attributo "{1}" associato a un tipo di elemento "{0}".
- CloseQuoteExpected = \u00C8 previsto un apice di chiusura per l''attributo "{1}" associato a un tipo di elemento "{0}".
- AttributeNotUnique = L''attributo "{1}" \u00E8 gi\u00E0 stato specificato per l''elemento "{0}".
- AttributeNSNotUnique = L''attributo "{1}" associato allo spazio di nomi "{2}" \u00E8 gi\u00E0 stato specificato per l''elemento "{0}".
- ETagUnterminated = La tag finale per il tipo di elemento "{0}" deve terminare con un delimitatore ''>''.
- MarkupNotRecognizedInContent = Il contenuto degli elementi deve essere composto da dati o markup di caratteri con formato corretto.
- DoctypeIllegalInContent = DOCTYPE non \u00E8 consentito nel contenuto.
-# 4.1 Character and Entity References
- ReferenceUnterminated = Il riferimento deve terminare con un delimitatore ';'.
-# 4.3.2 Well-Formed Parsed Entities
- ReferenceNotInOneEntity = Il riferimento deve essere compreso completamente all'interno della stessa entit\u00E0 analizzata.
- ElementEntityMismatch = L''elemento "{0}" deve iniziare e finire con la stessa entit\u00E0.
- MarkupEntityMismatch=Le strutture di documenti XML devono iniziare e finire con la stessa entit\u00E0.
-
-# Messages common to Document and DTD
-# 2.2 Characters
- InvalidCharInAttValue = \u00C8 stato trovato un carattere XML non valido (Unicode: 0x{2}) nel valore dell''attributo "{1}". L''elemento \u00E8 "{0}".
- InvalidCharInComment = \u00C8 stato trovato un carattere XML non valido (Unicode: 0x{0}) nel commento.
- InvalidCharInPI = \u00C8 stato trovato un carattere XML non valido (Unicode: 0x{0}) nell''istruzione di elaborazione.
- InvalidCharInInternalSubset = \u00C8 stato trovato un carattere XML non valido (Unicode: 0x{0}) nel set secondario interno del DTD.
- InvalidCharInTextDecl = \u00C8 stato trovato un carattere XML non valido (Unicode: 0x{0}) nella dichiarazione testuale.
-# 2.3 Common Syntactic Constructs
- QuoteRequiredInAttValue = Il valore dell''attributo "{1}" deve iniziare con un apice o una virgoletta.
- LessthanInAttValue = Il valore dell''attributo "{1}" associato a un tipo di elemento "{0}" non deve essere contenere il carattere ''<''.
- AttributeValueUnterminated = Il valore dell''attributo "{1}" deve terminare con un apice corrispondente.
-# 2.5 Comments
- InvalidCommentStart = Il commento deve iniziare con "<!--".
- DashDashInComment = La stringa "--" non \u00E8 consentita nei commenti.
- CommentUnterminated = Il commento deve terminare con "-->".
- COMMENT_NOT_IN_ONE_ENTITY = Il commento non \u00E8 compreso all'interno della stessa entit\u00E0.
-# 2.6 Processing Instructions
- PITargetRequired = L'istruzione di elaborazione deve iniziare con il nome della destinazione.
- SpaceRequiredInPI = \u00C8 richiesto uno spazio tra la destinazione delle istruzioni di elaborazione e i dati.
- PIUnterminated = L'istruzione di elaborazione deve terminare con "?>".
- ReservedPITarget = Non \u00E8 consentita una destinazione di istruzione di elaborazione corrispondente a "[xX][mM][lL]".
- PI_NOT_IN_ONE_ENTITY = L'istruzione di elaborazione non \u00E8 compresa all'interno della stessa entit\u00E0.
-# 2.8 Prolog and Document Type Declaration
- VersionInfoInvalid = Versione "{0}" non valida.
- VersionNotSupported = La versione XML "{0}" non \u00E8 supportata. Solo la versione XML 1.0 \u00E8 supportata.
- VersionNotSupported11 = La versione XML "{0}" non \u00E8 supportata. Solo le versioni XML 1.0 e XML 1.1 sono supportate.
- VersionMismatch= Un'entit\u00E0 non pu\u00F2 includerne un'altra con una versione successiva.
-# 4.1 Character and Entity References
- DigitRequiredInCharRef = Una rappresentazione decimale deve seguire immediatamente "&#" in un riferimento di carattere.
- HexdigitRequiredInCharRef = Una rappresentazione esadecimale deve seguire immediatamente "&#" in un riferimento di carattere.
- SemicolonRequiredInCharRef = Il riferimento di carattere deve terminare con il delimitatore ';'.
- InvalidCharRef = Il riferimento di carattere "&#{0}" \u00E8 un carattere XML non valido.
- NameRequiredInReference = Il nome entit\u00E0 deve seguire immediatamente '&' nel riferimento di entit\u00E0.
- SemicolonRequiredInReference = Il riferimento di entit\u00E0 "{0}" deve terminare con il delimitatore '';''.
-# 4.3.1 The Text Declaration
- TextDeclMustBeFirst = La dichiarazione di testo pu\u00F2 comparire solo all'inizio dell'entit\u00E0 esterna analizzata.
- EqRequiredInTextDecl = Il carattere '' = '' deve seguire "{0}" nella dichiarazione di testo.
- QuoteRequiredInTextDecl = Il valore che segue "{0}" nella dichiarazione di testo deve essere una stringa compresa tra apici.
- CloseQuoteMissingInTextDecl = manca l''apice di chiusura nel valore che segue "{0}" nella dichiarazione di testo.
- SpaceRequiredBeforeVersionInTextDecl = \u00C8 richiesto uno spazio prima dell'attributo pseudo della versione nella dichiarazione del testo.
- SpaceRequiredBeforeEncodingInTextDecl = \u00C8 richiesto uno spazio prima dell'attributo pseudo di codifica nella dichiarazione del testo.
- TextDeclUnterminated = La dichiarazione di testo deve terminare con "?>".
- EncodingDeclRequired = La dichiarazione di codifica \u00E8 obbligatoria nella dichiarazione di testo.
- NoMorePseudoAttributes = Non sono consentiti altri attributi pseudo.
- MorePseudoAttributes = Sono previsti altri attributi pseudo.
- PseudoAttrNameExpected = \u00C8 previsto un nome attributo pseudo.
-# 4.3.2 Well-Formed Parsed Entities
- CommentNotInOneEntity = Il commento deve essere compreso completamente all'interno della stessa entit\u00E0 analizzata.
- PINotInOneEntity = L'istruzione di elaborazione deve essere compresa completamente all'interno della stessa entit\u00E0 analizzata.
-# 4.3.3 Character Encoding in Entities
- EncodingDeclInvalid = Nome codifica "{0}" non valido.
- EncodingByteOrderUnsupported = L''ordine di byte specificato per la codifica "{0}" non \u00E8 supportato.
- InvalidByte = Byte non valido {0} della sequenza UTF-8 a {1} byte.
- ExpectedByte = \u00C8 previsto il byte {0} della sequenza UTF-8 a {1} byte.
- InvalidHighSurrogate = I bit per surrogato alto nella sequenza UTF-8 non devono superare 0x10, ma \u00E8 stato trovato 0x{0}.
- OperationNotSupported = Operazione "{0}" non supportata dal processo di lettura {1}.
- InvalidASCII = Il byte "{0}" non fa parte del set di caratteri ASCII (a 7 bit).
- CharConversionFailure = Un'entit\u00E0 che deve trovarsi in una determinata codifica non pu\u00F2 contenere sequenze non valide in quella codifica.
-
-# DTD Messages
-# 2.2 Characters
- InvalidCharInEntityValue = \u00C8 stato trovato un carattere XML non valido (Unicode: 0x{0}) nel valore dell''entit\u00E0.
- InvalidCharInExternalSubset = \u00C8 stato trovato un carattere XML non valido (Unicode: 0x{0}) nel set secondario esterno del DTD.
- InvalidCharInIgnoreSect = \u00C8 stato trovato un carattere XML non valido (Unicode: 0x{0}) nella sezione condizionale esclusa.
- InvalidCharInPublicID = \u00C8 stato trovato un carattere XML non valido (Unicode: 0x{0}) nell''identificativo pubblico.
- InvalidCharInSystemID = \u00C8 stato trovato un carattere XML non valido (Unicode: 0x{0}) nell''identificativo di sistema.
-# 2.3 Common Syntactic Constructs
- SpaceRequiredAfterSYSTEM = \u00C8 richiesto uno spazio dopo la parola chiave SYSTEM nella dichiarazione DOCTYPE.
- QuoteRequiredInSystemID = L'identificativo di sistema deve iniziare con un apice o con virgolette.
- SystemIDUnterminated = L'identificativo di sistema deve terminare con un apice corrispondente.
- SpaceRequiredAfterPUBLIC = Sono richiesti spazi dopo la parola chiave PUBLIC nella dichiarazione DOCTYPE.
- QuoteRequiredInPublicID = L'identificativo pubblico deve iniziare con un apice o con le virgolette.
- PublicIDUnterminated = L'identificativo pubblico deve terminare con un apice corrispondente.
- PubidCharIllegal = Il carattere (Unicode: 0x{0}) non \u00E8 consentito nell''identificativo pubblico.
- SpaceRequiredBetweenPublicAndSystem = Sono richiesti spazi tra publicId e systemId.
-# 2.8 Prolog and Document Type Declaration
- MSG_SPACE_REQUIRED_BEFORE_ROOT_ELEMENT_TYPE_IN_DOCTYPEDECL = \u00C8 richiesto uno spazio dopo "<!DOCTYPE" nella dichiarazione del tipo di documento.
- MSG_ROOT_ELEMENT_TYPE_REQUIRED = Il tipo di elemento radice deve comparire dopo "<!DOCTYPE" nella dichiarazione del tipo di documento.
- DoctypedeclUnterminated = La dichiarazione del tipo di documento per il tipo di elemento radice "{0}" deve terminare con ''>''.
- DoctypedeclNotClosed = La dichiarazione del tipo di documento per il tipo di elemento radice "{0}" deve terminare con '']''.
- PEReferenceWithinMarkup = Il riferimento di entit\u00E0 di parametro "%{0};" non pu\u00F2 essere presente nel markup del set secondario interno del DTD.
- MSG_MARKUP_NOT_RECOGNIZED_IN_DTD = Le dichiarazioni di markup contenute o indicate dalla dichiarazione del tipo di documento devono avere un formato corretto.
-# 2.10 White Space Handling
- MSG_XML_SPACE_DECLARATION_ILLEGAL = La dichiarazione di attributo "xml:space" deve essere specificata come tipo enumerato, i cui unici possibili valori sono "default" e "preserve".
-# 3.2 Element Type Declarations
- MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ELEMENTDECL = \u00C8 richiesto uno spazio dopo "<!ELEMENT" nella dichiarazione del tipo di elemento.
- MSG_ELEMENT_TYPE_REQUIRED_IN_ELEMENTDECL = Il tipo di elemento \u00E8 obbligatorio nella dichiarazione del tipo di elemento.
- MSG_SPACE_REQUIRED_BEFORE_CONTENTSPEC_IN_ELEMENTDECL = \u00C8 richiesto uno spazio dopo il tipo di elemento "{0}" nella dichiarazione del tipo di elemento.
- MSG_CONTENTSPEC_REQUIRED_IN_ELEMENTDECL = \u00C8 richiesto uno vincolo dopo il tipo di elemento "{0}" nella dichiarazione del tipo di elemento.
- ElementDeclUnterminated = La dichiarazione per il tipo di elemento "{0}" deve terminare con ''>''.
-# 3.2.1 Element Content
- MSG_OPEN_PAREN_OR_ELEMENT_TYPE_REQUIRED_IN_CHILDREN = Un carattere ''('' o un tipo di elemento \u00E8 obbligatorio nella dichiarazione del tipo di elemento "{0}".
- MSG_CLOSE_PAREN_REQUIRED_IN_CHILDREN = Un carattere '')'' \u00E8 obbligatorio nella dichiarazione del tipo di elemento "{0}".
-# 3.2.2 Mixed Content
- MSG_ELEMENT_TYPE_REQUIRED_IN_MIXED_CONTENT = Un tipo di elemento \u00E8 obbligatorio nella dichiarazione del tipo di elemento "{0}".
- MSG_CLOSE_PAREN_REQUIRED_IN_MIXED = Un carattere '')'' \u00E8 obbligatorio nella dichiarazione del tipo di elemento "{0}".
- MixedContentUnterminated = Il modello di contenuto misto "{0}" deve terminare con ")*" se i tipi di elementi figlio hanno vincoli.
-# 3.3 Attribute-List Declarations
- MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ATTLISTDECL = \u00C8 richiesto uno spazio dopo "<!ATTLIST" nella dichiarazione della lista di attributi.
- MSG_ELEMENT_TYPE_REQUIRED_IN_ATTLISTDECL = Il tipo di elemento \u00E8 obbligatorio nella dichiarazione della lista di attributi.
- MSG_SPACE_REQUIRED_BEFORE_ATTRIBUTE_NAME_IN_ATTDEF = \u00C8 richiesto uno spazio prima del nome attributo nella dichiarazione della lista di attributi per l''elemento "{0}".
- AttNameRequiredInAttDef = Specificare il nome attributo nella dichiarazione della lista di attributi per l''elemento "{0}".
- MSG_SPACE_REQUIRED_BEFORE_ATTTYPE_IN_ATTDEF = \u00C8 richiesto uno spazio prima del tipo di attributo nella dichiarazione dell''attributo "{1}" per l''elemento "{0}".
- AttTypeRequiredInAttDef = Il tipo di attributo \u00E8 obbligatorio nella dichiarazione dell''attributo "{1}" per l''elemento "{0}".
- MSG_SPACE_REQUIRED_BEFORE_DEFAULTDECL_IN_ATTDEF = \u00C8 richiesto uno spazio prima del valore predefinito di attributo nella dichiarazione dell''attributo "{1}" per l''elemento "{0}".
- MSG_DUPLICATE_ATTRIBUTE_DEFINITION = Sono state specificate pi\u00F9 definizioni di attributo per lo stesso attributo "{1}" dell''elemento "{0}" specificato.
-# 3.3.1 Attribute Types
- MSG_SPACE_REQUIRED_AFTER_NOTATION_IN_NOTATIONTYPE = Deve essere presente uno spazio dopo "NOTATION" nella dichiarazione di attributo "{1}".
- MSG_OPEN_PAREN_REQUIRED_IN_NOTATIONTYPE = Il carattere ''('' deve seguire "NOTATION" nella dichiarazione di attributo "{1}".
- MSG_NAME_REQUIRED_IN_NOTATIONTYPE = Il nome notazione \u00E8 obbligatorio nella lista di tipi di notazione per la dichiarazione di attributo "{1}".
- NotationTypeUnterminated = La lista di tipi di notazione deve terminare con '')'' nella dichiarazione di attributo "{1}".
- MSG_NMTOKEN_REQUIRED_IN_ENUMERATION = Il nome token \u00E8 obbligatorio nella lista di tipi enumerati per la dichiarazione di attributo "{1}".
- EnumerationUnterminated = La lista di tipi enumerati deve terminare con '')'' nella dichiarazione di attributo "{1}".
- MSG_DISTINCT_TOKENS_IN_ENUMERATION = Il valore di enumerazione "{1}" \u00E8 stato specificato pi\u00F9 volte nella dichiarazione dell''attributo "{2}" per l''elemento "{0}". I valori di NMTOKENS in una dichiarazione singola di attributo Enumeration devono essere tutti diversi.
- MSG_DISTINCT_NOTATION_IN_ENUMERATION = Il valore di enumerazione "{1}" \u00E8 stato specificato pi\u00F9 volte nella dichiarazione dell''attributo "{2}" per l''elemento "{0}". I nomi NOTATION in una dichiarazione singola di attributo NotationType devono essere tutti diversi.
-# 3.3.2 Attribute Defaults
- MSG_SPACE_REQUIRED_AFTER_FIXED_IN_DEFAULTDECL = Deve essere presente uno spazio dopo "FIXED" nella dichiarazione di attributo "{1}".
-# 3.4 Conditional Sections
- IncludeSectUnterminated = La sezione condizionale inclusa deve terminare con "]]>".
- IgnoreSectUnterminated = La sezione condizionale esclusa deve terminare con "]]>".
-# 4.1 Character and Entity References
- NameRequiredInPEReference = Il nome entit\u00E0 deve seguire immediatamente '%' nel riferimento di entit\u00E0 di parametro.
- SemicolonRequiredInPEReference = Il riferimento di entit\u00E0 di parametro "%{0};" deve terminare con il delimitatore '';''.
-# 4.2 Entity Declarations
- MSG_SPACE_REQUIRED_BEFORE_ENTITY_NAME_IN_ENTITYDECL = \u00C8 richiesto uno spazio dopo "<!ENTITY" nella dichiarazione dell'entit\u00E0.
- MSG_SPACE_REQUIRED_BEFORE_PERCENT_IN_PEDECL = \u00C8 richiesto uno spazio tra "<!ENTITY" e il carattere '%' nella dichiarazione dell'entit\u00E0 di parametro.
- MSG_SPACE_REQUIRED_BEFORE_ENTITY_NAME_IN_PEDECL = \u00C8 richiesto uno spazio tra '%' e il nome entit\u00E0 nella dichiarazione dell'entit\u00E0 di parametro.
- MSG_ENTITY_NAME_REQUIRED_IN_ENTITYDECL = Il nome dell'entit\u00E0 \u00E8 obbligatorio nella dichiarazione di entit\u00E0.
- MSG_SPACE_REQUIRED_AFTER_ENTITY_NAME_IN_ENTITYDECL = \u00C8 richiesto uno spazio tra il nome entit\u00E0 "{0}" e la definizione nella dichiarazione dell''entit\u00E0:
- MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_UNPARSED_ENTITYDECL = \u00C8 richiesto uno spazio tra "NDATA" e il nome notazione nella dichiarazione dell''entit\u00E0 "{0}".
- MSG_SPACE_REQUIRED_BEFORE_NDATA_IN_UNPARSED_ENTITYDECL = \u00C8 richiesto uno spazio prima di "NDATA" nella dichiarazione dell''entit\u00E0 "{0}".
- MSG_NOTATION_NAME_REQUIRED_FOR_UNPARSED_ENTITYDECL = Il nome notazione \u00E8 obbligatorio dopo "NDATA" nella dichiarazione dell''entit\u00E0 "{0}".
- EntityDeclUnterminated = La dichiarazione per l''entit\u00E0 "{0}" deve terminare con ''>''.
- MSG_DUPLICATE_ENTITY_DEFINITION = L''entit\u00E0 "{0}" \u00E8 stata dichiarata pi\u00F9 volte.
-# 4.2.2 External Entities
- ExternalIDRequired = La dichiarazione di entit\u00E0 esterna deve iniziare con "SYSTEM" o "PUBLIC".
- MSG_SPACE_REQUIRED_BEFORE_PUBIDLITERAL_IN_EXTERNALID = \u00C8 richiesto uno spazio tra "PUBLIC" e l'identificativo pubblico.
- MSG_SPACE_REQUIRED_AFTER_PUBIDLITERAL_IN_EXTERNALID = \u00C8 richiesto uno spazio tra l'identificativo pubblico e quello di sistema.
- MSG_SPACE_REQUIRED_BEFORE_SYSTEMLITERAL_IN_EXTERNALID = \u00C8 richiesto uno spazio tra "SYSTEM" e l'identificativo di sistema.
- MSG_URI_FRAGMENT_IN_SYSTEMID = L''identificativo di frammento non deve essere specificato nell''identificativo di sistema "{0}".
-# 4.7 Notation Declarations
- MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_NOTATIONDECL = \u00C8 richiesto uno spazio dopo "<!NOTATION" nella dichiarazione della notazione.
- MSG_NOTATION_NAME_REQUIRED_IN_NOTATIONDECL = Il nome della notazione \u00E8 obbligatorio nella dichiarazione di notazione.
- MSG_SPACE_REQUIRED_AFTER_NOTATION_NAME_IN_NOTATIONDECL = \u00C8 richiesto uno spazio dopo il nome notazione "{0}" nella dichiarazione della notazione.
- ExternalIDorPublicIDRequired = La dichiarazione per la notazione "{0}" deve includere un identificativo di sistema o pubblico.
- NotationDeclUnterminated = La dichiarazione per la notazione "{0}" deve terminare con ''>''.
-
-# Validation messages
- DuplicateTypeInMixedContent = Il tipo di elemento "{1}" \u00E8 gi\u00E0 stato specificato nel modello di contenuto della dichiarazione di elemento "{0}".
- ENTITIESInvalid = Il valore di attributo "{1}" di tipo ENTITIES deve corrispondere ai nomi di una o pi\u00F9 entit\u00E0 non analizzate.
- ENTITYInvalid = Il valore di attributo "{1}" di tipo ENTITY deve corrispondere al nome di un''entit\u00E0 non analizzata.
- IDDefaultTypeInvalid = Nell''attributo ID "{0}" deve essere dichiarato un valore predefinito "#IMPLIED" o "#REQUIRED".
- IDInvalid = Il valore di attributo "{0}" di tipo ID deve essere un nome.
- IDInvalidWithNamespaces = Il valore di attributo "{0}" di tipo ID deve essere un NCName se sono abilitati gli spazi di nomi.
- IDNotUnique = Il valore di attributo "{0}" di tipo ID deve essere univoco all''interno del documento.
- IDREFInvalid = Il valore di attributo "{0}" di tipo IDREF deve essere un nome.
- IDREFInvalidWithNamespaces = Il valore di attributo "{0}" di tipo IDREF deve essere un NCName se sono abilitati gli spazi di nomi.
- IDREFSInvalid = Il valore di attributo "{0}" di tipo IDREFS deve corrispondere a uno o pi\u00F9 nomi.
- ILL_FORMED_PARAMETER_ENTITY_WHEN_USED_IN_DECL = Il testo di sostituzione dell''entit\u00E0 di parametro "{0}" deve includere dichiarazioni nidificate correttamente se il riferimento dell''entit\u00E0 \u00E8 utilizzato come dichiarazione completa.
- ImproperDeclarationNesting = Il testo di sostituzione dell''entit\u00E0 di parametro "{0}" deve includere dichiarazioni nidificate correttamente.
- ImproperGroupNesting = Il testo di sostituzione dell''entit\u00E0 di parametro "{0}" deve includere coppie di parentesi nidificate correttamente.
- INVALID_PE_IN_CONDITIONAL = Il testo di sostituzione dell''entit\u00E0 di parametro "{0}" deve includere tutta la sezione condizionale oppure solo INCLUDE o IGNORE.
- MSG_ATTRIBUTE_NOT_DECLARED = Dichiarare l''attributo "{1}" per il tipo di elemento "{0}".
- MSG_ATTRIBUTE_VALUE_NOT_IN_LIST = L''attributo "{0}" con valore "{1}" deve avere un valore della lista "{2}".
- MSG_ATTVALUE_CHANGED_DURING_NORMALIZATION_WHEN_STANDALONE = Il valore "{1}" dell''attributo "{0}" non deve essere modificato dalla normalizzazione (in "{2}") in un documento standalone.
- MSG_CONTENT_INCOMPLETE = Il contenuto del tipo di elemento "{0}" \u00E8 incompleto. Deve corrispondere a "{1}".
- MSG_CONTENT_INVALID = Il contenuto del tipo di elemento "{0}" deve corrispondere a "{1}".
- MSG_CONTENT_INVALID_SPECIFIED = Il contenuto del tipo di elemento "{0}" deve corrispondere a "{1}". Non sono consentiti elementi figlio di tipo "{2}".
- MSG_DEFAULTED_ATTRIBUTE_NOT_SPECIFIED = L''attributo "{1}" per il tipo di elemento "{0}" ha un valore predefinito e deve essere specificato in un documento standalone.
- MSG_DUPLICATE_ATTDEF = L''attributo "{1}" \u00E8 gi\u00E0 stato dichiarato per il tipo di elemento "{0}".
- MSG_ELEMENT_ALREADY_DECLARED = Il tipo di elemento "{0}" non deve essere dichiarato pi\u00F9 volte.
- MSG_ELEMENT_NOT_DECLARED = Il tipo di elemento "{0}" deve essere dichiarato.
- MSG_GRAMMAR_NOT_FOUND = Documento non valido: nessuna grammatica trovata.
- MSG_ELEMENT_WITH_ID_REQUIRED = Un elemento con identificativo "{0}" deve esistere nel documento.
- MSG_EXTERNAL_ENTITY_NOT_PERMITTED = Il riferimento all''entit\u00E0 esterna "{0}" non \u00E8 consentito in un documento standalone.
- MSG_FIXED_ATTVALUE_INVALID = L''attributo "{1}" con valore "{2}" deve avere un valore "{3}".
- MSG_MORE_THAN_ONE_ID_ATTRIBUTE = Il tipo di elemento "{0}" ha gi\u00E0 un attributo "{1}" di tipo ID. Non \u00E8 consentito un secondo attributo "{2}" di tipo ID.
- MSG_MORE_THAN_ONE_NOTATION_ATTRIBUTE = Il tipo di elemento "{0}" ha gi\u00E0 un attributo "{1}" di tipo NOTATION. Non \u00E8 consentito un secondo attributo "{2}" di tipo NOTATION.
- MSG_NOTATION_NOT_DECLARED_FOR_NOTATIONTYPE_ATTRIBUTE = La notazione "{1}" deve essere dichiarata se vi viene fatto riferimento nella lista dei tipi di notazione per l''attributo "{0}".
- MSG_NOTATION_NOT_DECLARED_FOR_UNPARSED_ENTITYDECL = La notazione "{1}" deve essere dichiarata se vi viene fatto riferimento dichiarazione di entit\u00E0 non analizzata per "{0}".
- MSG_REFERENCE_TO_EXTERNALLY_DECLARED_ENTITY_WHEN_STANDALONE = Il riferimento all''entit\u00E0 "{0}" dichiarata in un''entit\u00E0 esterna analizzata non \u00E8 consentito in un documento standalone.
- MSG_REQUIRED_ATTRIBUTE_NOT_SPECIFIED = L''attributo "{1}" \u00E8 obbligatorio e deve essere specificato per il tipo di elemento "{0}".
- MSG_WHITE_SPACE_IN_ELEMENT_CONTENT_WHEN_STANDALONE = Non deve esistere nessuno spazio tra gli elementi dichiarati in un'entit\u00E0 esterna analizzata con il contenuto dell'elemento in un documento standalone.
- NMTOKENInvalid = Il valore di attributo "{0}" di tipo NMTOKEN deve essere un token di nome.
- NMTOKENSInvalid = Il valore di attributo "{0}" di tipo NMTOKENS deve corrispondere a uno o pi\u00F9 token di nomi.
- NoNotationOnEmptyElement = Il tipo di elemento "{0}" dichiarato come EMPTY non pu\u00F2 dichiarare l''attributo "{1}" di tipo NOTATION.
- RootElementTypeMustMatchDoctypedecl = L''elemento radice "{1}" del documento deve corrispondere alla radice DOCTYPE "{0}".
- UndeclaredElementInContentSpec = Il modello di contenuto dell''elemento "{0}" fa riferimento a un elemento "{1}" non dichiarato.
- UniqueNotationName = La dichiarazione per la notazione "{0}" non \u00E8 univoca. Un nome non deve essere dichiarato pi\u00F9 volte nella dichiarazione di una notazione.
- ENTITYFailedInitializeGrammar = ENTITYDatatype Validator: errore. \u00C8 necessario richiamare il metodo di inizializzazione con un riferimento di grammatica valido. \t
- ENTITYNotUnparsed = ENTITY "{0}" non analizzata.
- ENTITYNotValid = ENTITY "{0}" non valida.
- EmptyList = I valori di tipo ENTITIES, IDREFS e NMTOKENS non possono essere una lista vuota.
-
-# Entity related messages
-# 3.1 Start-Tags, End-Tags, and Empty-Element Tags
- ReferenceToExternalEntity = Il riferimento di entit\u00E0 esterna "&{0};" non \u00E8 consentito in un valore di attributo.
- AccessExternalDTD = DTD esterna: lettura della DTD esterna ''{0}'' non riuscita. Accesso ''{1}'' non consentito a causa della limitazione definita dalla propriet\u00E0 accessExternalDTD.
- AccessExternalEntity = Entit\u00E0 esterna: lettura del documento esterno ''{0}'' non riuscita. Accesso ''{1}'' non consentito a causa della limitazione definita dalla propriet\u00E0 accessExternalDTD.
-
-# 4.1 Character and Entity References
- EntityNotDeclared = L''entit\u00E0 "{0}" \u00E8 indicata da un riferimento, ma non \u00E8 dichiarata.
- ReferenceToUnparsedEntity = Il riferimento di entit\u00E0 non analizzata "&{0};" non \u00E8 consentito.
- RecursiveReference = Riferimento di entit\u00E0 ricorsivo "{0}" (percorso riferimento: {1}).
- RecursiveGeneralReference = Riferimento di entit\u00E0 generale ricorsivo "&{0};" (percorso riferimento: {1}).
- RecursivePEReference = Riferimento di entit\u00E0 parametro ricorsivo "%{0};" (percorso riferimento: {1}).
-# 4.3.3 Character Encoding in Entities
- EncodingNotSupported = La codifica "{0}" non \u00E8 supportata.
- EncodingRequired = Un'entit\u00E0 analizzata non codificata in UTF-8 o UTF-16 deve contenere una dichiarazione di codifica.
-
-# Namespaces support
-# 4. Using Qualified Names
- IllegalQName = L'elemento o l'attributo non corrisponde alla produzione del QName: QName::=(NCName':')?NCName.
- ElementXMLNSPrefix = L''elemento "{0}" non pu\u00F2 avere "xmlns" come prefisso.
- ElementPrefixUnbound = Il prefisso "{0}" per l''elemento "{1}" non \u00E8 associato.
- AttributePrefixUnbound = Il prefisso "{2}" per l''attributo "{1}" associato a un tipo di elemento "{0}" non \u00E8 associato.
- EmptyPrefixedAttName = Il valore dell''attributo "{0}" non \u00E8 valido. Le associazioni di spazi di nomi con prefisso non possono essere vuote.
- PrefixDeclared = Il prefisso spazio di nomi "{0}" non \u00E8 stato dichiarato.
- CantBindXMLNS = Il prefisso "xmlns" non pu\u00F2 essere associato esplicitamente a uno spazio di nomi, n\u00E9 lo spazio di nomi per "xmlns" pu\u00F2 essere associato esplicitamente a un prefisso.
- CantBindXML = Il prefisso "xml" non pu\u00F2 essere associato a uno spazio di nomi diverso da quello al quale appartiene, n\u00E9 lo spazio di nomi per "xml" pu\u00F2 essere associato a un prefisso diverso da "xml".
- MSG_ATT_DEFAULT_INVALID = defaultValue "{1}" dell''attributo "{0}" non valido per i vincoli lessicali di questo tipo di attributo.
-
-# REVISIT: These need messages
- MSG_SPACE_REQUIRED_AFTER_SYSTEMLITERAL_IN_EXTERNALID=MSG_SPACE_REQUIRED_AFTER_SYSTEMLITERAL_IN_EXTERNALID
- OpenQuoteMissingInDecl=OpenQuoteMissingInDecl
- InvalidCharInLiteral=InvalidCharInLiteral
-
-
-# Implementation limits
- EntityExpansionLimit=JAXP00010001: il parser ha rilevato pi\u00F9 "{0}" espansioni di entit\u00E0 nel documento. Questo \u00E8 il limite imposto dal kit JDK.
- ElementAttributeLimit=JAXP00010002: l''elemento "{0}" contiene pi\u00F9 di "{1}" attributi. "{1}" \u00E8 il limite imposto dal kit JDK.
- MaxEntitySizeLimit=JAXP00010003: la lunghezza dell''entit\u00E0 "{0}" \u00E8 "{1}". Tale valore supera il limite "{2}" definito da "{3}".
- TotalEntitySizeLimit=JAXP00010004: le dimensioni accumulate delle entit\u00E0 sono pari a "{0}". Tale valore supera il limite "{1}" definito da "{2}".
- MaxXMLNameLimit=JAXP00010005: la lunghezza dell''entit\u00E0 "{0}" \u00E8 "{1}". Tale valore supera il limite "{2}" definito da "{3}".
- MaxElementDepthLimit=JAXP00010006: la profondit\u00E0 dell''elemento "{0}" \u00E8 "{1}". Tale valore supera il limite "{2}" definito da "{3}".
- EntityReplacementLimit=JAXP00010007: il numero totale di nodi nei riferimenti entit\u00E0 \u00E8 "{0}". Tale valore supera il limite di "{1}" impostato da "{2}".
-
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ja.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ja.properties
deleted file mode 100644
index 74e0594..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ja.properties
+++ /dev/null
@@ -1,305 +0,0 @@
-# This file contains error and warning messages related to XML
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-# @version
-
- BadMessageKey = \u30E1\u30C3\u30BB\u30FC\u30B8\u30FB\u30AD\u30FC\u306B\u5BFE\u5FDC\u3059\u308B\u30A8\u30E9\u30FC\u30FB\u30E1\u30C3\u30BB\u30FC\u30B8\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002
- FormatFailed = \u6B21\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\u306E\u66F8\u5F0F\u8A2D\u5B9A\u4E2D\u306B\u5185\u90E8\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F:\n
-
-# Document messages
- PrematureEOF=\u9014\u4E2D\u3067\u30D5\u30A1\u30A4\u30EB\u306E\u672B\u5C3E\u306B\u9054\u3057\u307E\u3057\u305F\u3002
-# 2.1 Well-Formed XML Documents
- RootElementRequired = \u6574\u5F62\u5F0F\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306B\u306F\u30EB\u30FC\u30C8\u8981\u7D20\u304C\u5FC5\u8981\u3067\u3059\u3002
-# 2.2 Characters
-
- InvalidCharInCDSect = CDATA\u30BB\u30AF\u30B7\u30E7\u30F3\u306B\u7121\u52B9\u306AXML\u6587\u5B57(Unicode: 0x{0})\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002
- InvalidCharInContent = \u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u8981\u7D20\u30B3\u30F3\u30C6\u30F3\u30C4\u306B\u7121\u52B9\u306AXML\u6587\u5B57(Unicode: 0x{0})\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002
- TwoColonsInQName = \u8981\u7D20\u30BF\u30A4\u30D7\u307E\u305F\u306F\u5C5E\u6027\u540D\u306B\u7121\u52B9\u306A':'\u304C\u3082\u30461\u3064\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002
- ColonNotLegalWithNS = \u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u304C\u6709\u52B9\u306B\u306A\u3063\u3066\u3044\u308B\u5834\u5408\u3001\u540D\u524D''{0}''\u306B\u30B3\u30ED\u30F3\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\u3002
- InvalidCharInMisc = \u8981\u7D20\u30B3\u30F3\u30C6\u30F3\u30C4\u306E\u7D42\u308F\u308A\u306E\u5F8C\u306E\u30DE\u30FC\u30AF\u30A2\u30C3\u30D7\u306B\u7121\u52B9\u306AXML\u6587\u5B57(Unicode: 0x{0})\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002
- InvalidCharInProlog = \u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u30D7\u30ED\u30ED\u30FC\u30B0\u306B\u7121\u52B9\u306AXML\u6587\u5B57(Unicode: 0x{0})\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002
- InvalidCharInXMLDecl = XML\u5BA3\u8A00\u306B\u7121\u52B9\u306AXML\u6587\u5B57(Unicode: 0x{0})\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002
-# 2.4 Character Data and Markup
- CDEndInContent = \u6587\u5B57\u30B7\u30FC\u30B1\u30F3\u30B9"]]>"\u306F\u3001CDATA\u30BB\u30AF\u30B7\u30E7\u30F3\u306E\u7D42\u308F\u308A\u3092\u793A\u3059\u76EE\u7684\u4EE5\u5916\u3067\u30B3\u30F3\u30C6\u30F3\u30C4\u306B\u4F7F\u7528\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002
-# 2.7 CDATA Sections
- CDSectUnterminated = CDATA\u30BB\u30AF\u30B7\u30E7\u30F3\u306F"]]>"\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
-# 2.8 Prolog and Document Type Declaration
- XMLDeclMustBeFirst = XML\u5BA3\u8A00\u306F\u3001\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u5148\u982D\u3067\u306E\u307F\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002
- EqRequiredInXMLDecl = XML\u5BA3\u8A00\u3067\u306F\u3001"{0}"\u306E\u5F8C\u306B'' = ''\u6587\u5B57\u304C\u5FC5\u8981\u3067\u3059\u3002
- QuoteRequiredInXMLDecl = XML\u5BA3\u8A00\u306E"{0}"\u306E\u5F8C\u306B\u7D9A\u304F\u5024\u306F\u3001\u5F15\u7528\u7B26\u3067\u56F2\u3093\u3060\u6587\u5B57\u5217\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- XMLDeclUnterminated = XML\u5BA3\u8A00\u306F"?>"\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- VersionInfoRequired = XML\u5BA3\u8A00\u306B\u306F\u30D0\u30FC\u30B8\u30E7\u30F3\u304C\u5FC5\u8981\u3067\u3059\u3002
- SpaceRequiredBeforeVersionInXMLDecl = XML\u5BA3\u8A00\u3067\u306F\u3001\u30D0\u30FC\u30B8\u30E7\u30F3\u7591\u4F3C\u5C5E\u6027\u306E\u524D\u306B\u7A7A\u767D\u304C\u5FC5\u8981\u3067\u3059\u3002
- SpaceRequiredBeforeEncodingInXMLDecl = XML\u5BA3\u8A00\u3067\u306F\u3001\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u7591\u4F3C\u5C5E\u6027\u306E\u524D\u306B\u7A7A\u767D\u304C\u5FC5\u8981\u3067\u3059\u3002
- SpaceRequiredBeforeStandalone = XML\u5BA3\u8A00\u3067\u306F\u3001\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u7591\u4F3C\u5C5E\u6027\u306E\u524D\u306B\u7A7A\u767D\u304C\u5FC5\u8981\u3067\u3059\u3002
- MarkupNotRecognizedInProlog = \u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u5185\u306E\u30EB\u30FC\u30C8\u8981\u7D20\u3088\u308A\u524D\u306E\u30DE\u30FC\u30AF\u30A2\u30C3\u30D7\u306F\u6574\u5F62\u5F0F\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- MarkupNotRecognizedInMisc = \u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u5185\u306E\u30EB\u30FC\u30C8\u8981\u7D20\u306B\u7D9A\u304F\u30DE\u30FC\u30AF\u30A2\u30C3\u30D7\u306F\u6574\u5F62\u5F0F\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- AlreadySeenDoctype = DOCTYPE\u306F\u3059\u3067\u306B\u5B58\u5728\u3057\u307E\u3059\u3002
- DoctypeNotAllowed = \u6A5F\u80FD"http://apache.org/xml/features/disallow-doctype-decl"\u304Ctrue\u306B\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u3001DOCTYPE\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002
- ContentIllegalInProlog = \u30D7\u30ED\u30ED\u30FC\u30B0\u306B\u306F\u30B3\u30F3\u30C6\u30F3\u30C4\u3092\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002
- ReferenceIllegalInProlog = \u30D7\u30ED\u30ED\u30FC\u30B0\u306B\u306F\u53C2\u7167\u3092\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002
-# Trailing Misc
- ContentIllegalInTrailingMisc=\u5F8C\u7D9A\u30BB\u30AF\u30B7\u30E7\u30F3\u306B\u306F\u30B3\u30F3\u30C6\u30F3\u30C4\u3092\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002
- ReferenceIllegalInTrailingMisc=\u5F8C\u7D9A\u30BB\u30AF\u30B7\u30E7\u30F3\u306B\u306F\u53C2\u7167\u3092\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002
-
-# 2.9 Standalone Document Declaration
- SDDeclInvalid = \u30B9\u30BF\u30F3\u30C9\u30A2\u30ED\u30F3\u30FB\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u5BA3\u8A00\u306E\u5024\u306F\u3001"{0}"\u3067\u306F\u306A\u304F\u3001"yes"\u307E\u305F\u306F"no"\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- SDDeclNameInvalid = XML\u5BA3\u8A00\u306E\u30B9\u30BF\u30F3\u30C9\u30A2\u30ED\u30F3\u540D\u304C\u9593\u9055\u3063\u3066\u3044\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002
-# 2.12 Language Identification
- XMLLangInvalid = xml:lang\u5C5E\u6027\u306E\u5024"{0}"\u306F\u7121\u52B9\u306A\u8A00\u8A9E\u8B58\u5225\u5B50\u3067\u3059\u3002
-# 3. Logical Structures
- ETagRequired = \u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306F\u3001\u5BFE\u5FDC\u3059\u308B\u7D42\u4E86\u30BF\u30B0"</{0}>"\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
-# 3.1 Start-Tags, End-Tags, and Empty-Element Tags
- ElementUnterminated = \u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306E\u5F8C\u306B\u306F\u3001\u5C5E\u6027\u6307\u5B9A">"\u307E\u305F\u306F"/>"\u304C\u5FC5\u8981\u3067\u3059\u3002
- EqRequiredInAttribute = \u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306B\u95A2\u9023\u4ED8\u3051\u3089\u308C\u3066\u3044\u308B\u5C5E\u6027\u540D"{1}"\u306E\u5F8C\u306B\u306F\u3001'' = ''\u6587\u5B57\u304C\u5FC5\u8981\u3067\u3059\u3002
- OpenQuoteExpected = \u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306B\u95A2\u9023\u4ED8\u3051\u3089\u308C\u3066\u3044\u308B\u5C5E\u6027"{1}"\u306B\u306F\u3001\u958B\u59CB\u5F15\u7528\u7B26\u304C\u5FC5\u8981\u3067\u3059\u3002
- CloseQuoteExpected = \u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306B\u95A2\u9023\u4ED8\u3051\u3089\u308C\u3066\u3044\u308B\u5C5E\u6027"{1}"\u306B\u306F\u3001\u7D42\u4E86\u5F15\u7528\u7B26\u304C\u5FC5\u8981\u3067\u3059\u3002
- AttributeNotUnique = \u5C5E\u6027"{1}"\u306F\u8981\u7D20"{0}"\u306B\u5BFE\u3057\u3066\u3059\u3067\u306B\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002
- AttributeNSNotUnique = \u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9"{2}"\u306B\u30D0\u30A4\u30F3\u30C9\u3055\u308C\u305F\u5C5E\u6027"{1}"\u306F\u8981\u7D20"{0}"\u306B\u5BFE\u3057\u3066\u3059\u3067\u306B\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002
- ETagUnterminated = \u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306E\u7D42\u4E86\u30BF\u30B0\u306F''>''\u30C7\u30EA\u30DF\u30BF\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- MarkupNotRecognizedInContent = \u8981\u7D20\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u306F\u3001\u6574\u5F62\u5F0F\u306E\u6587\u5B57\u30C7\u30FC\u30BF\u307E\u305F\u306F\u30DE\u30FC\u30AF\u30A2\u30C3\u30D7\u3067\u69CB\u6210\u3055\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- DoctypeIllegalInContent = \u30B3\u30F3\u30C6\u30F3\u30C4\u306B\u306FDOCTYPE\u3092\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002
-# 4.1 Character and Entity References
- ReferenceUnterminated = \u53C2\u7167\u306F';'\u30C7\u30EA\u30DF\u30BF\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
-# 4.3.2 Well-Formed Parsed Entities
- ReferenceNotInOneEntity = \u53C2\u7167\u306F\u3001\u540C\u3058\u89E3\u6790\u6E08\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u5185\u306B\u5B8C\u5168\u306B\u542B\u307E\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- ElementEntityMismatch = \u8981\u7D20"{0}"\u306F\u3001\u540C\u3058\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u5185\u3067\u958B\u59CB\u304A\u3088\u3073\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- MarkupEntityMismatch=XML\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u69CB\u9020\u306F\u3001\u540C\u3058\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u5185\u3067\u958B\u59CB\u304A\u3088\u3073\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
-
-# Messages common to Document and DTD
-# 2.2 Characters
- InvalidCharInAttValue = \u5C5E\u6027"{1}"\u306E\u5024\u306B\u7121\u52B9\u306AXML\u6587\u5B57(Unicode: 0x{2})\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002\u8981\u7D20\u306F"{0}"\u3067\u3059\u3002
- InvalidCharInComment = \u30B3\u30E1\u30F3\u30C8\u306B\u7121\u52B9\u306AXML\u6587\u5B57(Unicode: 0x{0})\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002
- InvalidCharInPI = \u51E6\u7406\u547D\u4EE4\u306B\u7121\u52B9\u306AXML\u6587\u5B57(Unicode: 0x{0})\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002
- InvalidCharInInternalSubset = DTD\u306E\u5185\u90E8\u30B5\u30D6\u30BB\u30C3\u30C8\u306B\u7121\u52B9\u306AXML\u6587\u5B57(Unicode: 0x{0})\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002
- InvalidCharInTextDecl = \u30C6\u30AD\u30B9\u30C8\u5BA3\u8A00\u306B\u7121\u52B9\u306AXML\u6587\u5B57(Unicode: 0x{0})\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002
-# 2.3 Common Syntactic Constructs
- QuoteRequiredInAttValue = \u5C5E\u6027"{1}"\u306E\u5024\u306E\u5148\u982D\u306B\u306F\u3001\u4E00\u91CD\u5F15\u7528\u7B26\u6587\u5B57\u307E\u305F\u306F\u4E8C\u91CD\u5F15\u7528\u7B26\u6587\u5B57\u304C\u5FC5\u8981\u3067\u3059\u3002
- LessthanInAttValue = \u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306B\u95A2\u9023\u4ED8\u3051\u3089\u308C\u3066\u3044\u308B\u5C5E\u6027"{1}"\u306E\u5024\u306B\u306F\u3001''<''\u6587\u5B57\u3092\u542B\u3081\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002
- AttributeValueUnterminated = \u5C5E\u6027"{1}"\u306E\u5024\u306F\u3001\u5BFE\u5FDC\u3059\u308B\u5F15\u7528\u7B26\u6587\u5B57\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
-# 2.5 Comments
- InvalidCommentStart = \u30B3\u30E1\u30F3\u30C8\u306E\u5148\u982D\u306B\u306F"<!--"\u304C\u5FC5\u8981\u3067\u3059\u3002
- DashDashInComment = \u30B3\u30E1\u30F3\u30C8\u5185\u3067\u306F\u6587\u5B57\u5217"--"\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\u3002
- CommentUnterminated = \u30B3\u30E1\u30F3\u30C8\u306F"-->"\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- COMMENT_NOT_IN_ONE_ENTITY = \u30B3\u30E1\u30F3\u30C8\u304C\u540C\u3058\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u3067\u56F2\u307E\u308C\u3066\u3044\u307E\u305B\u3093\u3002
-# 2.6 Processing Instructions
- PITargetRequired = \u51E6\u7406\u547D\u4EE4\u306E\u5148\u982D\u306B\u306F\u30BF\u30FC\u30B2\u30C3\u30C8\u306E\u540D\u524D\u304C\u5FC5\u8981\u3067\u3059\u3002
- SpaceRequiredInPI = \u51E6\u7406\u547D\u4EE4\u30BF\u30FC\u30B2\u30C3\u30C8\u3068\u30C7\u30FC\u30BF\u306E\u9593\u306B\u306F\u7A7A\u767D\u304C\u5FC5\u8981\u3067\u3059\u3002
- PIUnterminated = \u51E6\u7406\u547D\u4EE4\u306F"?>"\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- ReservedPITarget = "[xX][mM][lL]"\u3068\u4E00\u81F4\u3059\u308B\u51E6\u7406\u547D\u4EE4\u30BF\u30FC\u30B2\u30C3\u30C8\u306F\u8A31\u53EF\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
- PI_NOT_IN_ONE_ENTITY = \u51E6\u7406\u547D\u4EE4\u304C\u540C\u3058\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u3067\u56F2\u307E\u308C\u3066\u3044\u307E\u305B\u3093\u3002
-# 2.8 Prolog and Document Type Declaration
- VersionInfoInvalid = \u30D0\u30FC\u30B8\u30E7\u30F3"{0}"\u306F\u7121\u52B9\u3067\u3059\u3002
- VersionNotSupported = XML\u30D0\u30FC\u30B8\u30E7\u30F3"{0}"\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u308B\u306E\u306FXML 1.0\u306E\u307F\u3067\u3059\u3002
- VersionNotSupported11 = XML\u30D0\u30FC\u30B8\u30E7\u30F3"{0}"\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u308B\u306E\u306FXML 1.0\u304A\u3088\u3073XML 1.1\u306E\u307F\u3067\u3059\u3002
- VersionMismatch= \u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u306B\u306F\u3001\u5F8C\u7D9A\u30D0\u30FC\u30B8\u30E7\u30F3\u306E\u5225\u306E\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u3092\u542B\u3081\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002
-# 4.1 Character and Entity References
- DigitRequiredInCharRef = \u6587\u5B57\u53C2\u7167\u3067\u306F\u300110\u9032\u8868\u73FE\u306F"&#"\u306E\u76F4\u5F8C\u306B\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- HexdigitRequiredInCharRef = \u6587\u5B57\u53C2\u7167\u3067\u306F\u300116\u9032\u8868\u73FE\u306F"&#x"\u306E\u76F4\u5F8C\u306B\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- SemicolonRequiredInCharRef = \u6587\u5B57\u53C2\u7167\u306F';'\u30C7\u30EA\u30DF\u30BF\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- InvalidCharRef = \u6587\u5B57\u53C2\u7167"&#{0}"\u306F\u7121\u52B9\u306AXML\u6587\u5B57\u3067\u3059\u3002
- NameRequiredInReference = \u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u53C2\u7167\u3067\u306F\u3001\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u540D\u306F'&'\u306E\u76F4\u5F8C\u306B\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- SemicolonRequiredInReference = \u30A8\u30F3\u30C6\u30A3\u30C6\u30A3"{0}"\u3078\u306E\u53C2\u7167\u306F'';''\u30C7\u30EA\u30DF\u30BF\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
-# 4.3.1 The Text Declaration
- TextDeclMustBeFirst = \u30C6\u30AD\u30B9\u30C8\u5BA3\u8A00\u306F\u3001\u5916\u90E8\u306E\u89E3\u6790\u6E08\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u306E\u5148\u982D\u3067\u306E\u307F\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002
- EqRequiredInTextDecl = \u30C6\u30AD\u30B9\u30C8\u5BA3\u8A00\u3067\u306F\u3001"{0}"\u306E\u5F8C\u306B'' = ''\u6587\u5B57\u304C\u5FC5\u8981\u3067\u3059\u3002
- QuoteRequiredInTextDecl = \u30C6\u30AD\u30B9\u30C8\u5BA3\u8A00\u306E"{0}"\u306E\u5F8C\u306B\u7D9A\u304F\u5024\u306F\u3001\u5F15\u7528\u7B26\u3067\u56F2\u3093\u3060\u6587\u5B57\u5217\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- CloseQuoteMissingInTextDecl = \u30C6\u30AD\u30B9\u30C8\u5BA3\u8A00\u306E"{0}"\u306E\u5F8C\u306B\u7D9A\u304F\u5024\u306B\u7D42\u4E86\u5F15\u7528\u7B26\u304C\u3042\u308A\u307E\u305B\u3093\u3002
- SpaceRequiredBeforeVersionInTextDecl = \u30C6\u30AD\u30B9\u30C8\u5BA3\u8A00\u3067\u306F\u3001\u30D0\u30FC\u30B8\u30E7\u30F3\u7591\u4F3C\u5C5E\u6027\u306E\u524D\u306B\u7A7A\u767D\u304C\u5FC5\u8981\u3067\u3059\u3002
- SpaceRequiredBeforeEncodingInTextDecl = \u30C6\u30AD\u30B9\u30C8\u5BA3\u8A00\u3067\u306F\u3001\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u7591\u4F3C\u5C5E\u6027\u306E\u524D\u306B\u7A7A\u767D\u304C\u5FC5\u8981\u3067\u3059\u3002
- TextDeclUnterminated = \u30C6\u30AD\u30B9\u30C8\u5BA3\u8A00\u306F"?>"\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- EncodingDeclRequired = \u30C6\u30AD\u30B9\u30C8\u5BA3\u8A00\u306B\u306F\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u5BA3\u8A00\u304C\u5FC5\u8981\u3067\u3059\u3002
- NoMorePseudoAttributes = \u3053\u308C\u4EE5\u4E0A\u306E\u7591\u4F3C\u5C5E\u6027\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002
- MorePseudoAttributes = \u7591\u4F3C\u5C5E\u6027\u304C\u3055\u3089\u306B\u5FC5\u8981\u3067\u3059\u3002
- PseudoAttrNameExpected = \u7591\u4F3C\u5C5E\u6027\u540D\u304C\u5FC5\u8981\u3067\u3059\u3002
-# 4.3.2 Well-Formed Parsed Entities
- CommentNotInOneEntity = \u30B3\u30E1\u30F3\u30C8\u306F\u3001\u540C\u3058\u89E3\u6790\u6E08\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u5185\u306B\u5B8C\u5168\u306B\u542B\u307E\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- PINotInOneEntity = \u51E6\u7406\u547D\u4EE4\u306F\u3001\u540C\u3058\u89E3\u6790\u6E08\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u5185\u306B\u5B8C\u5168\u306B\u542B\u307E\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
-# 4.3.3 Character Encoding in Entities
- EncodingDeclInvalid = \u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u540D"{0}"\u304C\u7121\u52B9\u3067\u3059\u3002
- EncodingByteOrderUnsupported = \u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0"{0}"\u306B\u6307\u5B9A\u3055\u308C\u305F\u30D0\u30A4\u30C8\u9806\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
- InvalidByte = {1}\u30D0\u30A4\u30C8\u306EUTF-8\u30B7\u30FC\u30B1\u30F3\u30B9\u306E\u30D0\u30A4\u30C8{0}\u304C\u7121\u52B9\u3067\u3059\u3002
- ExpectedByte = {1}\u30D0\u30A4\u30C8\u306EUTF-8\u30B7\u30FC\u30B1\u30F3\u30B9\u306E\u30D0\u30A4\u30C8{0}\u304C\u5FC5\u8981\u3067\u3059\u3002
- InvalidHighSurrogate = UTF-8\u30B7\u30FC\u30B1\u30F3\u30B9\u306E\u4E0A\u4F4D\u30B5\u30ED\u30B2\u30FC\u30C8\u30FB\u30D3\u30C3\u30C8\u306E\u4E0A\u9650\u306F0x10\u3067\u3059\u304C\u30010x{0}\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F\u3002
- OperationNotSupported = \u64CD\u4F5C"{0}"\u306F{1}\u30EA\u30FC\u30C0\u30FC\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
- InvalidASCII = \u30D0\u30A4\u30C8"{0}"\u306F\u3001(7\u30D3\u30C3\u30C8) ASCII\u6587\u5B57\u30BB\u30C3\u30C8\u306E\u30E1\u30F3\u30D0\u30FC\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
- CharConversionFailure = \u7279\u5B9A\u306E\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u3067\u3042\u308B\u3068\u78BA\u5B9A\u3055\u308C\u305F\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u306B\u306F\u3001\u305D\u306E\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u3067\u4E0D\u6B63\u306A\u30B7\u30FC\u30B1\u30F3\u30B9\u3092\u542B\u3081\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002
-
-# DTD Messages
-# 2.2 Characters
- InvalidCharInEntityValue = \u30EA\u30C6\u30E9\u30EB\u30FB\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u5024\u306B\u7121\u52B9\u306AXML\u6587\u5B57(Unicode: 0x{0})\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002
- InvalidCharInExternalSubset = DTD\u306E\u5916\u90E8\u30B5\u30D6\u30BB\u30C3\u30C8\u306B\u7121\u52B9\u306AXML\u6587\u5B57(Unicode: 0x{0})\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002
- InvalidCharInIgnoreSect = \u9664\u5916\u6761\u4EF6\u4ED8\u304D\u30BB\u30AF\u30B7\u30E7\u30F3\u306B\u7121\u52B9\u306AXML\u6587\u5B57(Unicode: 0x{0})\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002
- InvalidCharInPublicID = \u516C\u958B\u8B58\u5225\u5B50\u306B\u7121\u52B9\u306AXML\u6587\u5B57(Unicode: 0x{0})\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002
- InvalidCharInSystemID = \u30B7\u30B9\u30C6\u30E0\u8B58\u5225\u5B50\u306B\u7121\u52B9\u306AXML\u6587\u5B57(Unicode: 0x{0})\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002
-# 2.3 Common Syntactic Constructs
- SpaceRequiredAfterSYSTEM = DOCTYPE\u5BA3\u8A00\u3067\u306F\u3001\u30AD\u30FC\u30EF\u30FC\u30C9SYSTEM\u306E\u5F8C\u306B\u7A7A\u767D\u304C\u5FC5\u8981\u3067\u3059\u3002
- QuoteRequiredInSystemID = \u30B7\u30B9\u30C6\u30E0\u8B58\u5225\u5B50\u306E\u5148\u982D\u306B\u306F\u3001\u4E00\u91CD\u5F15\u7528\u7B26\u6587\u5B57\u307E\u305F\u306F\u4E8C\u91CD\u5F15\u7528\u7B26\u6587\u5B57\u304C\u5FC5\u8981\u3067\u3059\u3002
- SystemIDUnterminated = \u30B7\u30B9\u30C6\u30E0\u8B58\u5225\u5B50\u306F\u3001\u5BFE\u5FDC\u3059\u308B\u5F15\u7528\u7B26\u6587\u5B57\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- SpaceRequiredAfterPUBLIC = DOCTYPE\u5BA3\u8A00\u3067\u306F\u3001\u30AD\u30FC\u30EF\u30FC\u30C9PUBLIC\u306E\u5F8C\u306B\u7A7A\u767D\u304C\u5FC5\u8981\u3067\u3059\u3002
- QuoteRequiredInPublicID = \u516C\u958B\u8B58\u5225\u5B50\u306E\u5148\u982D\u306B\u306F\u3001\u4E00\u91CD\u5F15\u7528\u7B26\u6587\u5B57\u307E\u305F\u306F\u4E8C\u91CD\u5F15\u7528\u7B26\u6587\u5B57\u304C\u5FC5\u8981\u3067\u3059\u3002
- PublicIDUnterminated = \u516C\u958B\u8B58\u5225\u5B50\u306F\u3001\u5BFE\u5FDC\u3059\u308B\u5F15\u7528\u7B26\u6587\u5B57\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- PubidCharIllegal = \u516C\u958B\u8B58\u5225\u5B50\u3067\u306F\u3001\u6587\u5B57(Unicode: 0x{0})\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\u3002
- SpaceRequiredBetweenPublicAndSystem = \u516C\u958B\u8B58\u5225\u5B50\u3068\u30B7\u30B9\u30C6\u30E0\u8B58\u5225\u5B50\u306E\u9593\u306B\u306F\u7A7A\u767D\u304C\u5FC5\u8981\u3067\u3059\u3002
-# 2.8 Prolog and Document Type Declaration
- MSG_SPACE_REQUIRED_BEFORE_ROOT_ELEMENT_TYPE_IN_DOCTYPEDECL = \u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u30FB\u30BF\u30A4\u30D7\u5BA3\u8A00\u3067\u306F\u3001"<!DOCTYPE"\u306E\u5F8C\u306B\u7A7A\u767D\u304C\u5FC5\u8981\u3067\u3059\u3002
- MSG_ROOT_ELEMENT_TYPE_REQUIRED = \u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u30FB\u30BF\u30A4\u30D7\u5BA3\u8A00\u3067\u306F\u3001"<!DOCTYPE"\u306E\u5F8C\u306B\u30EB\u30FC\u30C8\u8981\u7D20\u30BF\u30A4\u30D7\u304C\u5FC5\u8981\u3067\u3059\u3002
- DoctypedeclUnterminated = \u30EB\u30FC\u30C8\u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306E\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u30FB\u30BF\u30A4\u30D7\u5BA3\u8A00\u306F''>''\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- DoctypedeclNotClosed = \u30EB\u30FC\u30C8\u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306E\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u30FB\u30BF\u30A4\u30D7\u5BA3\u8A00\u306F'']''\u3067\u9589\u3058\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- PEReferenceWithinMarkup = \u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u53C2\u7167"%{0};"\u306F\u3001DTD\u306E\u5185\u90E8\u30B5\u30D6\u30BB\u30C3\u30C8\u306E\u30DE\u30FC\u30AF\u30A2\u30C3\u30D7\u5185\u306B\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002
- MSG_MARKUP_NOT_RECOGNIZED_IN_DTD = \u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u30FB\u30BF\u30A4\u30D7\u5BA3\u8A00\u306B\u542B\u307E\u308C\u308B\u304B\u3001\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u30FB\u30BF\u30A4\u30D7\u5BA3\u8A00\u304C\u6307\u3057\u3066\u3044\u308B\u30DE\u30FC\u30AF\u30A2\u30C3\u30D7\u5BA3\u8A00\u306F\u6574\u5F62\u5F0F\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
-# 2.10 White Space Handling
- MSG_XML_SPACE_DECLARATION_ILLEGAL = "xml:space"\u306E\u5C5E\u6027\u5BA3\u8A00\u306F\u3001"default"\u304A\u3088\u3073"preserve"\u306E\u307F\u3092\u4F7F\u7528\u3067\u304D\u308B\u5217\u6319\u30BF\u30A4\u30D7\u3068\u3057\u3066\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
-# 3.2 Element Type Declarations
- MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ELEMENTDECL = \u8981\u7D20\u30BF\u30A4\u30D7\u5BA3\u8A00\u3067\u306F\u3001"<!ELEMENT"\u306E\u5F8C\u306B\u7A7A\u767D\u304C\u5FC5\u8981\u3067\u3059\u3002
- MSG_ELEMENT_TYPE_REQUIRED_IN_ELEMENTDECL = \u8981\u7D20\u30BF\u30A4\u30D7\u5BA3\u8A00\u306B\u306F\u8981\u7D20\u30BF\u30A4\u30D7\u304C\u5FC5\u8981\u3067\u3059\u3002
- MSG_SPACE_REQUIRED_BEFORE_CONTENTSPEC_IN_ELEMENTDECL = \u8981\u7D20\u30BF\u30A4\u30D7\u5BA3\u8A00\u3067\u306F\u3001\u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306E\u5F8C\u306B\u7A7A\u767D\u304C\u5FC5\u8981\u3067\u3059\u3002
- MSG_CONTENTSPEC_REQUIRED_IN_ELEMENTDECL = \u8981\u7D20\u30BF\u30A4\u30D7\u5BA3\u8A00\u3067\u306F\u3001\u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306E\u5F8C\u306B\u5236\u7D04\u304C\u5FC5\u8981\u3067\u3059\u3002
- ElementDeclUnterminated = \u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306E\u5BA3\u8A00\u306F''>''\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
-# 3.2.1 Element Content
- MSG_OPEN_PAREN_OR_ELEMENT_TYPE_REQUIRED_IN_CHILDREN = \u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306E\u5BA3\u8A00\u306B\u306F''(''\u6587\u5B57\u307E\u305F\u306F\u8981\u7D20\u30BF\u30A4\u30D7\u304C\u5FC5\u8981\u3067\u3059\u3002
- MSG_CLOSE_PAREN_REQUIRED_IN_CHILDREN = \u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306E\u5BA3\u8A00\u306B\u306F'')''\u304C\u5FC5\u8981\u3067\u3059\u3002
-# 3.2.2 Mixed Content
- MSG_ELEMENT_TYPE_REQUIRED_IN_MIXED_CONTENT = \u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306E\u5BA3\u8A00\u306B\u306F\u8981\u7D20\u30BF\u30A4\u30D7\u304C\u5FC5\u8981\u3067\u3059\u3002
- MSG_CLOSE_PAREN_REQUIRED_IN_MIXED = \u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306E\u5BA3\u8A00\u306B\u306F'')''\u304C\u5FC5\u8981\u3067\u3059\u3002
- MixedContentUnterminated = \u5B50\u8981\u7D20\u306E\u30BF\u30A4\u30D7\u304C\u5236\u7D04\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u3001\u6DF7\u5408\u30B3\u30F3\u30C6\u30F3\u30C4\u30FB\u30E2\u30C7\u30EB"{0}"\u306F")*"\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
-# 3.3 Attribute-List Declarations
- MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ATTLISTDECL = \u5C5E\u6027\u30EA\u30B9\u30C8\u5BA3\u8A00\u3067\u306F\u3001"<!ATTLIST"\u306E\u5F8C\u306B\u7A7A\u767D\u304C\u5FC5\u8981\u3067\u3059\u3002
- MSG_ELEMENT_TYPE_REQUIRED_IN_ATTLISTDECL = \u5C5E\u6027\u30EA\u30B9\u30C8\u5BA3\u8A00\u306B\u306F\u8981\u7D20\u30BF\u30A4\u30D7\u304C\u5FC5\u8981\u3067\u3059\u3002
- MSG_SPACE_REQUIRED_BEFORE_ATTRIBUTE_NAME_IN_ATTDEF = \u8981\u7D20"{0}"\u306E\u5C5E\u6027\u30EA\u30B9\u30C8\u5BA3\u8A00\u3067\u306F\u3001\u5C5E\u6027\u540D\u306E\u524D\u306B\u7A7A\u767D\u304C\u5FC5\u8981\u3067\u3059\u3002
- AttNameRequiredInAttDef = \u8981\u7D20"{0}"\u306E\u5C5E\u6027\u30EA\u30B9\u30C8\u5BA3\u8A00\u306B\u306F\u5C5E\u6027\u540D\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- MSG_SPACE_REQUIRED_BEFORE_ATTTYPE_IN_ATTDEF = \u8981\u7D20"{0}"\u306E\u5C5E\u6027"{1}"\u306E\u5BA3\u8A00\u3067\u306F\u3001\u5C5E\u6027\u30BF\u30A4\u30D7\u306E\u524D\u306B\u7A7A\u767D\u304C\u5FC5\u8981\u3067\u3059\u3002
- AttTypeRequiredInAttDef = \u8981\u7D20"{0}"\u306E\u5C5E\u6027"{1}"\u306E\u5BA3\u8A00\u306B\u306F\u5C5E\u6027\u30BF\u30A4\u30D7\u304C\u5FC5\u8981\u3067\u3059\u3002
- MSG_SPACE_REQUIRED_BEFORE_DEFAULTDECL_IN_ATTDEF = \u8981\u7D20"{0}"\u306E\u5C5E\u6027"{1}"\u306E\u5BA3\u8A00\u3067\u306F\u3001\u5C5E\u6027\u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u524D\u306B\u7A7A\u767D\u304C\u5FC5\u8981\u3067\u3059\u3002
- MSG_DUPLICATE_ATTRIBUTE_DEFINITION = \u7279\u5B9A\u306E\u8981\u7D20"{0}"\u306E\u540C\u4E00\u5C5E\u6027"{1}"\u306B\u8907\u6570\u306E\u5C5E\u6027\u5B9A\u7FA9\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002
-# 3.3.1 Attribute Types
- MSG_SPACE_REQUIRED_AFTER_NOTATION_IN_NOTATIONTYPE = "{1}"\u5C5E\u6027\u5BA3\u8A00\u3067\u306F\u3001"NOTATION"\u306E\u5F8C\u306B\u7A7A\u767D\u304C\u5FC5\u8981\u3067\u3059\u3002
- MSG_OPEN_PAREN_REQUIRED_IN_NOTATIONTYPE = "{1}"\u5C5E\u6027\u5BA3\u8A00\u3067\u306F\u3001"NOTATION"\u306E\u5F8C\u306B''(''\u6587\u5B57\u304C\u5FC5\u8981\u3067\u3059\u3002
- MSG_NAME_REQUIRED_IN_NOTATIONTYPE = "{1}"\u5C5E\u6027\u5BA3\u8A00\u306E\u8868\u8A18\u6CD5\u30BF\u30A4\u30D7\u30FB\u30EA\u30B9\u30C8\u306B\u306F\u8868\u8A18\u540D\u304C\u5FC5\u8981\u3067\u3059\u3002
- NotationTypeUnterminated = "{1}"\u5C5E\u6027\u5BA3\u8A00\u306E\u8868\u8A18\u6CD5\u30BF\u30A4\u30D7\u30FB\u30EA\u30B9\u30C8\u306F'')''\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- MSG_NMTOKEN_REQUIRED_IN_ENUMERATION = "{1}"\u5C5E\u6027\u5BA3\u8A00\u306E\u5217\u6319\u30BF\u30A4\u30D7\u30FB\u30EA\u30B9\u30C8\u306B\u306F\u540D\u524D\u30C8\u30FC\u30AF\u30F3\u304C\u5FC5\u8981\u3067\u3059\u3002
- EnumerationUnterminated = "{1}"\u5C5E\u6027\u5BA3\u8A00\u306E\u5217\u6319\u30BF\u30A4\u30D7\u30FB\u30EA\u30B9\u30C8\u306F'')''\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- MSG_DISTINCT_TOKENS_IN_ENUMERATION = \u8981\u7D20"{0}"\u306E\u5C5E\u6027"{2}"\u306E\u5BA3\u8A00\u3067\u5217\u6319\u5024"{1}"\u304C\u8907\u6570\u56DE\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u5358\u4E00\u306EEnumeration\u5C5E\u6027\u5BA3\u8A00\u306B\u304A\u3051\u308BNMTOKENS\u306F\u3059\u3079\u3066\u7570\u306A\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- MSG_DISTINCT_NOTATION_IN_ENUMERATION = \u8981\u7D20"{0}"\u306E\u5C5E\u6027"{2}"\u306E\u5BA3\u8A00\u3067\u5217\u6319\u5024"{1}"\u304C\u8907\u6570\u56DE\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u5358\u4E00\u306ENotationType\u5C5E\u6027\u5BA3\u8A00\u306B\u304A\u3051\u308BNOTATION\u306E\u540D\u524D\u306F\u3059\u3079\u3066\u7570\u306A\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
-# 3.3.2 Attribute Defaults
- MSG_SPACE_REQUIRED_AFTER_FIXED_IN_DEFAULTDECL = "{1}"\u5C5E\u6027\u5BA3\u8A00\u3067\u306F\u3001"FIXED"\u306E\u5F8C\u306B\u7A7A\u767D\u304C\u5FC5\u8981\u3067\u3059\u3002
-# 3.4 Conditional Sections
- IncludeSectUnterminated = \u5305\u542B\u6761\u4EF6\u4ED8\u304D\u30BB\u30AF\u30B7\u30E7\u30F3\u306F"]]>"\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- IgnoreSectUnterminated = \u9664\u5916\u6761\u4EF6\u4ED8\u304D\u30BB\u30AF\u30B7\u30E7\u30F3\u306E\u6700\u5F8C\u306F"]]>"\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
-# 4.1 Character and Entity References
- NameRequiredInPEReference = \u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u53C2\u7167\u3067\u306F\u3001\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u540D\u306F'%'\u306E\u76F4\u5F8C\u306B\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- SemicolonRequiredInPEReference = \u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u53C2\u7167"%{0};"\u306F'';''\u30C7\u30EA\u30DF\u30BF\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
-# 4.2 Entity Declarations
- MSG_SPACE_REQUIRED_BEFORE_ENTITY_NAME_IN_ENTITYDECL = \u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u5BA3\u8A00\u3067\u306F\u3001"<!ENTITY"\u306E\u5F8C\u306B\u7A7A\u767D\u304C\u5FC5\u8981\u3067\u3059\u3002
- MSG_SPACE_REQUIRED_BEFORE_PERCENT_IN_PEDECL = \u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u5BA3\u8A00\u3067\u306F\u3001"<!ENTITY"\u3068'%'\u6587\u5B57\u306E\u9593\u306B\u7A7A\u767D\u304C\u5FC5\u8981\u3067\u3059\u3002
- MSG_SPACE_REQUIRED_BEFORE_ENTITY_NAME_IN_PEDECL = \u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u5BA3\u8A00\u3067\u306F\u3001'%'\u3068\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u540D\u306E\u9593\u306B\u7A7A\u767D\u304C\u5FC5\u8981\u3067\u3059\u3002
- MSG_ENTITY_NAME_REQUIRED_IN_ENTITYDECL = \u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u5BA3\u8A00\u306B\u306F\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u306E\u540D\u524D\u304C\u5FC5\u8981\u3067\u3059\u3002
- MSG_SPACE_REQUIRED_AFTER_ENTITY_NAME_IN_ENTITYDECL = \u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u5BA3\u8A00\u3067\u306F\u3001\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u540D"{0}"\u3068\u5B9A\u7FA9\u306E\u9593\u306B\u7A7A\u767D\u304C\u5FC5\u8981\u3067\u3059\u3002
- MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_UNPARSED_ENTITYDECL = \u30A8\u30F3\u30C6\u30A3\u30C6\u30A3"{0}"\u306E\u5BA3\u8A00\u3067\u306F\u3001"NDATA"\u3068\u8868\u8A18\u540D\u306E\u9593\u306B\u7A7A\u767D\u304C\u5FC5\u8981\u3067\u3059\u3002
- MSG_SPACE_REQUIRED_BEFORE_NDATA_IN_UNPARSED_ENTITYDECL = \u30A8\u30F3\u30C6\u30A3\u30C6\u30A3"{0}"\u306E\u5BA3\u8A00\u3067\u306F\u3001"NDATA"\u306E\u524D\u306B\u7A7A\u767D\u304C\u5FC5\u8981\u3067\u3059\u3002
- MSG_NOTATION_NAME_REQUIRED_FOR_UNPARSED_ENTITYDECL = \u30A8\u30F3\u30C6\u30A3\u30C6\u30A3"{0}"\u306E\u5BA3\u8A00\u3067\u306F\u3001"NDATA"\u306E\u5F8C\u306B\u8868\u8A18\u540D\u304C\u5FC5\u8981\u3067\u3059\u3002
- EntityDeclUnterminated = \u30A8\u30F3\u30C6\u30A3\u30C6\u30A3"{0}"\u306E\u5BA3\u8A00\u306F''>''\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- MSG_DUPLICATE_ENTITY_DEFINITION = \u30A8\u30F3\u30C6\u30A3\u30C6\u30A3"{0}"\u304C\u8907\u6570\u56DE\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u3059\u3002
-# 4.2.2 External Entities
- ExternalIDRequired = \u5916\u90E8\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u5BA3\u8A00\u306E\u5148\u982D\u306B\u306F"SYSTEM"\u307E\u305F\u306F"PUBLIC"\u304C\u5FC5\u8981\u3067\u3059\u3002
- MSG_SPACE_REQUIRED_BEFORE_PUBIDLITERAL_IN_EXTERNALID = "PUBLIC"\u3068\u516C\u958B\u8B58\u5225\u5B50\u306E\u9593\u306B\u306F\u7A7A\u767D\u304C\u5FC5\u8981\u3067\u3059\u3002
- MSG_SPACE_REQUIRED_AFTER_PUBIDLITERAL_IN_EXTERNALID = \u516C\u958B\u8B58\u5225\u5B50\u3068\u30B7\u30B9\u30C6\u30E0\u8B58\u5225\u5B50\u306E\u9593\u306B\u306F\u7A7A\u767D\u304C\u5FC5\u8981\u3067\u3059\u3002
- MSG_SPACE_REQUIRED_BEFORE_SYSTEMLITERAL_IN_EXTERNALID = "SYSTEM"\u3068\u30B7\u30B9\u30C6\u30E0\u8B58\u5225\u5B50\u306E\u9593\u306B\u306F\u7A7A\u767D\u304C\u5FC5\u8981\u3067\u3059\u3002
- MSG_URI_FRAGMENT_IN_SYSTEMID = \u30D5\u30E9\u30B0\u30E1\u30F3\u30C8\u8B58\u5225\u5B50\u306F\u3001\u30B7\u30B9\u30C6\u30E0\u8B58\u5225\u5B50"{0}"\u306E\u4E00\u90E8\u3068\u3057\u3066\u6307\u5B9A\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002
-# 4.7 Notation Declarations
- MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_NOTATIONDECL = \u8868\u8A18\u6CD5\u5BA3\u8A00\u3067\u306F\u3001"<!NOTATION"\u306E\u5F8C\u306B\u7A7A\u767D\u304C\u5FC5\u8981\u3067\u3059\u3002
- MSG_NOTATION_NAME_REQUIRED_IN_NOTATIONDECL = \u8868\u8A18\u6CD5\u5BA3\u8A00\u306B\u306F\u8868\u8A18\u306E\u540D\u524D\u304C\u5FC5\u8981\u3067\u3059\u3002
- MSG_SPACE_REQUIRED_AFTER_NOTATION_NAME_IN_NOTATIONDECL = \u8868\u8A18\u6CD5\u5BA3\u8A00\u3067\u306F\u3001\u8868\u8A18\u540D"{0}"\u306E\u5F8C\u306B\u7A7A\u767D\u304C\u5FC5\u8981\u3067\u3059\u3002
- ExternalIDorPublicIDRequired = \u8868\u8A18\u6CD5"{0}"\u306E\u5BA3\u8A00\u306B\u306F\u3001\u30B7\u30B9\u30C6\u30E0\u8B58\u5225\u5B50\u307E\u305F\u306F\u516C\u958B\u8B58\u5225\u5B50\u3092\u542B\u3081\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- NotationDeclUnterminated = \u8868\u8A18\u6CD5"{0}"\u306E\u5BA3\u8A00\u306F''>''\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
-
-# Validation messages
- DuplicateTypeInMixedContent = \u8981\u7D20\u30BF\u30A4\u30D7"{1}"\u306F\u3001\u8981\u7D20\u5BA3\u8A00"{0}"\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u30FB\u30E2\u30C7\u30EB\u3067\u3059\u3067\u306B\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002
- ENTITIESInvalid = \u30BF\u30A4\u30D7ENTITIES\u306E\u5C5E\u6027\u5024"{1}"\u306F\u30011\u3064\u4EE5\u4E0A\u306E\u672A\u89E3\u6790\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u306E\u540D\u524D\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- ENTITYInvalid = \u30BF\u30A4\u30D7ENTITY\u306E\u5C5E\u6027\u5024"{1}"\u306F\u3001\u672A\u89E3\u6790\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u306E\u540D\u524D\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- IDDefaultTypeInvalid = ID\u5C5E\u6027"{0}"\u306B\u306F\u3001"#IMPLIED"\u307E\u305F\u306F"#REQUIRED"\u306E\u5BA3\u8A00\u6E08\u30C7\u30D5\u30A9\u30EB\u30C8\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- IDInvalid = \u30BF\u30A4\u30D7ID\u306E\u5C5E\u6027\u5024"{0}"\u306F\u3001\u540D\u524D\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- IDInvalidWithNamespaces = \u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u304C\u6709\u52B9\u306B\u306A\u3063\u3066\u3044\u308B\u5834\u5408\u3001\u30BF\u30A4\u30D7ID\u306E\u5C5E\u6027\u5024"{0}"\u306FNCName\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- IDNotUnique = \u30BF\u30A4\u30D7ID\u306E\u5C5E\u6027\u5024"{0}"\u306F\u3001\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u5185\u3067\u4E00\u610F\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- IDREFInvalid = \u30BF\u30A4\u30D7IDREF\u306E\u5C5E\u6027\u5024"{0}"\u306F\u3001\u540D\u524D\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- IDREFInvalidWithNamespaces = \u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u304C\u6709\u52B9\u306B\u306A\u3063\u3066\u3044\u308B\u5834\u5408\u3001\u30BF\u30A4\u30D7IDREF\u306E\u5C5E\u6027\u5024"{0}"\u306FNCName\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- IDREFSInvalid = \u30BF\u30A4\u30D7IDREFS\u306E\u5C5E\u6027\u5024"{0}"\u306F\u30011\u3064\u4EE5\u4E0A\u306E\u540D\u524D\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- ILL_FORMED_PARAMETER_ENTITY_WHEN_USED_IN_DECL = \u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u53C2\u7167\u304C\u5B8C\u5168\u306A\u5BA3\u8A00\u3068\u3057\u3066\u4F7F\u7528\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u3001\u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3"{0}"\u306E\u7F6E\u63DB\u30C6\u30AD\u30B9\u30C8\u306B\u306F\u3001\u9069\u5207\u306B\u30CD\u30B9\u30C8\u3055\u308C\u305F\u5BA3\u8A00\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- ImproperDeclarationNesting = \u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3"{0}"\u306E\u7F6E\u63DB\u30C6\u30AD\u30B9\u30C8\u306B\u306F\u3001\u9069\u5207\u306B\u30CD\u30B9\u30C8\u3055\u308C\u305F\u5BA3\u8A00\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- ImproperGroupNesting = \u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3"{0}"\u306E\u7F6E\u63DB\u30C6\u30AD\u30B9\u30C8\u306B\u306F\u3001\u9069\u5207\u306B\u30CD\u30B9\u30C8\u3055\u308C\u305F\u4E38\u30AB\u30C3\u30B3\u306E\u30DA\u30A2\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- INVALID_PE_IN_CONDITIONAL = \u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3"{0}"\u306E\u7F6E\u63DB\u30C6\u30AD\u30B9\u30C8\u306B\u306F\u3001\u6761\u4EF6\u4ED8\u304D\u30BB\u30AF\u30B7\u30E7\u30F3\u5168\u4F53\u304B\u3001INCLUDE\u307E\u305F\u306FIGNORE\u306E\u307F\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- MSG_ATTRIBUTE_NOT_DECLARED = \u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306B\u5BFE\u3057\u3066\u5C5E\u6027"{1}"\u304C\u5BA3\u8A00\u3055\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- MSG_ATTRIBUTE_VALUE_NOT_IN_LIST = \u5024"{1}"\u3092\u6301\u3064\u5C5E\u6027"{0}"\u306B\u306F\u3001\u30EA\u30B9\u30C8"{2}"\u304B\u3089\u306E\u5024\u304C\u5FC5\u8981\u3067\u3059\u3002
- MSG_ATTVALUE_CHANGED_DURING_NORMALIZATION_WHEN_STANDALONE = \u5C5E\u6027"{0}"\u306E\u5024"{1}"\u306F\u3001\u30B9\u30BF\u30F3\u30C9\u30A2\u30ED\u30F3\u30FB\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3067\u6B63\u898F\u5316\u306B\u3088\u3063\u3066("{2}"\u306B)\u5909\u66F4\u3055\u308C\u306A\u3044\u3088\u3046\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- MSG_CONTENT_INCOMPLETE = \u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u304C\u4E0D\u5B8C\u5168\u3067\u3059\u3002"{1}"\u3068\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- MSG_CONTENT_INVALID = \u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u306F"{1}"\u3068\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- MSG_CONTENT_INVALID_SPECIFIED = \u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u306F"{1}"\u3068\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\u30BF\u30A4\u30D7"{2}"\u306E\u5B50\u306F\u8A31\u53EF\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
- MSG_DEFAULTED_ATTRIBUTE_NOT_SPECIFIED = \u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306E\u5C5E\u6027"{1}"\u306F\u3001\u30C7\u30D5\u30A9\u30EB\u30C8\u5024\u3092\u6301\u3061\u3001\u30B9\u30BF\u30F3\u30C9\u30A2\u30ED\u30F3\u30FB\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3067\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- MSG_DUPLICATE_ATTDEF = \u5C5E\u6027"{1}"\u306F\u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306B\u5BFE\u3057\u3066\u3059\u3067\u306B\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u3059\u3002
- MSG_ELEMENT_ALREADY_DECLARED = \u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306F\u8907\u6570\u56DE\u5BA3\u8A00\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002
- MSG_ELEMENT_NOT_DECLARED = \u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u3092\u5BA3\u8A00\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- MSG_GRAMMAR_NOT_FOUND = \u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u304C\u7121\u52B9\u3067\u3059: \u69CB\u6587\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002
- MSG_ELEMENT_WITH_ID_REQUIRED = \u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306B\u306F\u8B58\u5225\u5B50"{0}"\u3092\u6301\u3064\u8981\u7D20\u304C\u5FC5\u8981\u3067\u3059\u3002
- MSG_EXTERNAL_ENTITY_NOT_PERMITTED = \u5916\u90E8\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3"{0}"\u3078\u306E\u53C2\u7167\u306F\u3001\u30B9\u30BF\u30F3\u30C9\u30A2\u30ED\u30F3\u30FB\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3067\u306F\u8A31\u53EF\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
- MSG_FIXED_ATTVALUE_INVALID = \u5024"{2}"\u3092\u6301\u3064\u5C5E\u6027"{1}"\u306B\u306F\u3001"{3}"\u306E\u5024\u304C\u5FC5\u8981\u3067\u3059\u3002
- MSG_MORE_THAN_ONE_ID_ATTRIBUTE = \u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306B\u306F\u3001\u30BF\u30A4\u30D7ID\u306E\u5C5E\u6027"{1}"\u304C\u3059\u3067\u306B\u3042\u308A\u307E\u3059\u3002\u30BF\u30A4\u30D7ID\u306E\u5C5E\u6027"{2}"\u3092\u3082\u30461\u3064\u6307\u5B9A\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002
- MSG_MORE_THAN_ONE_NOTATION_ATTRIBUTE = \u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306B\u306F\u3001\u30BF\u30A4\u30D7NOTATION\u306E\u5C5E\u6027"{1}"\u304C\u3059\u3067\u306B\u3042\u308A\u307E\u3059\u3002\u30BF\u30A4\u30D7NOTATION\u306E\u5C5E\u6027"{2}"\u3092\u3082\u30461\u3064\u6307\u5B9A\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002
- MSG_NOTATION_NOT_DECLARED_FOR_NOTATIONTYPE_ATTRIBUTE = \u5C5E\u6027"{0}"\u306E\u8868\u8A18\u6CD5\u30BF\u30A4\u30D7\u30FB\u30EA\u30B9\u30C8\u3067\u53C2\u7167\u3055\u308C\u308B\u5834\u5408\u3001\u8868\u8A18\u6CD5"{1}"\u3092\u5BA3\u8A00\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- MSG_NOTATION_NOT_DECLARED_FOR_UNPARSED_ENTITYDECL = "{0}"\u306E\u672A\u89E3\u6790\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u5BA3\u8A00\u3067\u53C2\u7167\u3055\u308C\u308B\u5834\u5408\u3001\u8868\u8A18\u6CD5"{1}"\u3092\u5BA3\u8A00\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- MSG_REFERENCE_TO_EXTERNALLY_DECLARED_ENTITY_WHEN_STANDALONE = \u5916\u90E8\u306E\u89E3\u6790\u6E08\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u3067\u5BA3\u8A00\u3055\u308C\u3066\u3044\u308B\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3"{0}"\u3078\u306E\u53C2\u7167\u306F\u3001\u30B9\u30BF\u30F3\u30C9\u30A2\u30ED\u30F3\u30FB\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3067\u306F\u8A31\u53EF\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
- MSG_REQUIRED_ATTRIBUTE_NOT_SPECIFIED = \u5C5E\u6027"{1}"\u304C\u5FC5\u8981\u3067\u3059\u3002\u3053\u306E\u5C5E\u6027\u306F\u3001\u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306B\u5BFE\u3057\u3066\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- MSG_WHITE_SPACE_IN_ELEMENT_CONTENT_WHEN_STANDALONE = \u30B9\u30BF\u30F3\u30C9\u30A2\u30ED\u30F3\u30FB\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3067\u306F\u3001\u8981\u7D20\u30B3\u30F3\u30C6\u30F3\u30C4\u3092\u6301\u3064\u5916\u90E8\u306E\u89E3\u6790\u6E08\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u3067\u5BA3\u8A00\u3055\u308C\u308B\u8981\u7D20\u9593\u306B\u7A7A\u767D\u306F\u4E0D\u8981\u3067\u3059\u3002
- NMTOKENInvalid = \u30BF\u30A4\u30D7NMTOKEN\u306E\u5C5E\u6027\u5024"{0}"\u306F\u3001\u540D\u524D\u30C8\u30FC\u30AF\u30F3\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- NMTOKENSInvalid = \u30BF\u30A4\u30D7NMTOKENS\u306E\u5C5E\u6027\u5024"{0}"\u306F\u30011\u3064\u4EE5\u4E0A\u306E\u540D\u524D\u30C8\u30FC\u30AF\u30F3\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- NoNotationOnEmptyElement = EMPTY\u3068\u5BA3\u8A00\u3055\u308C\u305F\u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u3067\u306F\u3001\u30BF\u30A4\u30D7NOTATION\u306E\u5C5E\u6027"{1}"\u3092\u5BA3\u8A00\u3067\u304D\u307E\u305B\u3093\u3002
- RootElementTypeMustMatchDoctypedecl = \u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u30FB\u30EB\u30FC\u30C8\u8981\u7D20"{1}"\u306FDOCTYPE\u30EB\u30FC\u30C8"{0}"\u3068\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- UndeclaredElementInContentSpec = \u8981\u7D20"{0}"\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u30FB\u30E2\u30C7\u30EB\u3067\u672A\u5BA3\u8A00\u306E\u8981\u7D20"{1}"\u304C\u53C2\u7167\u3055\u308C\u3066\u3044\u307E\u3059\u3002
- UniqueNotationName = \u8868\u8A18\u6CD5"{0}"\u306E\u5BA3\u8A00\u304C\u4E00\u610F\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002\u540C\u3058\u540D\u524D\u3092\u8907\u6570\u306E\u8868\u8A18\u6CD5\u5BA3\u8A00\u3067\u5BA3\u8A00\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002
- ENTITYFailedInitializeGrammar = ENTITYDatatype\u30D0\u30EA\u30C7\u30FC\u30BF: \u6709\u52B9\u306A\u69CB\u6587\u53C2\u7167\u306B\u3088\u308B\u521D\u671F\u5316\u30E1\u30BD\u30C3\u30C9\u306E\u547C\u51FA\u3057\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002 \t
- ENTITYNotUnparsed = ENTITY "{0}"\u306F\u672A\u89E3\u6790\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
- ENTITYNotValid = ENTITY "{0}"\u306F\u6709\u52B9\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
- EmptyList = \u30BF\u30A4\u30D7ENTITIES\u3001IDREFS\u304A\u3088\u3073NMTOKENS\u306E\u5024\u306F\u7A7A\u306E\u30EA\u30B9\u30C8\u306B\u3067\u304D\u307E\u305B\u3093\u3002
-
-# Entity related messages
-# 3.1 Start-Tags, End-Tags, and Empty-Element Tags
- ReferenceToExternalEntity = \u5916\u90E8\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u53C2\u7167"&{0};"\u306F\u3001\u5C5E\u6027\u5024\u3067\u306F\u8A31\u53EF\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
- AccessExternalDTD = \u5916\u90E8DTD: accessExternalDTD\u30D7\u30ED\u30D1\u30C6\u30A3\u3067\u8A2D\u5B9A\u3055\u308C\u305F\u5236\u9650\u306B\u3088\u308A''{1}''\u30A2\u30AF\u30BB\u30B9\u304C\u8A31\u53EF\u3055\u308C\u3066\u3044\u306A\u3044\u305F\u3081\u3001\u5916\u90E8DTD ''{0}''\u306E\u8AAD\u53D6\u308A\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002
- AccessExternalEntity = \u5916\u90E8\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3: accessExternalDTD\u30D7\u30ED\u30D1\u30C6\u30A3\u3067\u8A2D\u5B9A\u3055\u308C\u305F\u5236\u9650\u306B\u3088\u308A''{1}''\u30A2\u30AF\u30BB\u30B9\u304C\u8A31\u53EF\u3055\u308C\u3066\u3044\u306A\u3044\u305F\u3081\u3001\u5916\u90E8\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8''{0}''\u306E\u8AAD\u53D6\u308A\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002
-
-# 4.1 Character and Entity References
- EntityNotDeclared = \u30A8\u30F3\u30C6\u30A3\u30C6\u30A3"{0}"\u304C\u53C2\u7167\u3055\u308C\u3066\u3044\u307E\u3059\u304C\u3001\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
- ReferenceToUnparsedEntity = \u672A\u89E3\u6790\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u53C2\u7167"&{0};"\u306F\u8A31\u53EF\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
- RecursiveReference = \u518D\u5E30\u7684\u306A\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u53C2\u7167"{0}"\u3067\u3059\u3002(\u53C2\u7167\u30D1\u30B9: {1})\u3001
- RecursiveGeneralReference = \u518D\u5E30\u7684\u306A\u4E00\u822C\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u53C2\u7167"&{0};"\u3067\u3059\u3002(\u53C2\u7167\u30D1\u30B9: {1})\u3001
- RecursivePEReference = \u518D\u5E30\u7684\u306A\u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u53C2\u7167"%{0};"\u3067\u3059\u3002(\u53C2\u7167\u30D1\u30B9: {1})\u3001
-# 4.3.3 Character Encoding in Entities
- EncodingNotSupported = \u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0"{0}"\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
- EncodingRequired = \u30A8\u30F3\u30B3\u30FC\u30C9\u304CUTF-8\u3068UTF-16\u306E\u3044\u305A\u308C\u3067\u3082\u306A\u3044\u89E3\u6790\u6E08\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u306B\u306F\u3001\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u5BA3\u8A00\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
-
-# Namespaces support
-# 4. Using Qualified Names
- IllegalQName = \u8981\u7D20\u307E\u305F\u306F\u5C5E\u6027\u304CQName\u751F\u6210\u3068\u4E00\u81F4\u3057\u307E\u305B\u3093: QName::=(NCName':')?NCName\u3002
- ElementXMLNSPrefix = \u8981\u7D20"{0}"\u306E\u63A5\u982D\u8F9E\u3068\u3057\u3066"xmlns"\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002
- ElementPrefixUnbound = \u8981\u7D20"{1}"\u306E\u63A5\u982D\u8F9E"{0}"\u304C\u30D0\u30A4\u30F3\u30C9\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
- AttributePrefixUnbound = \u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306B\u95A2\u9023\u4ED8\u3051\u3089\u308C\u3066\u3044\u308B\u5C5E\u6027"{1}"\u306E\u63A5\u982D\u8F9E"{2}"\u304C\u30D0\u30A4\u30F3\u30C9\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
- EmptyPrefixedAttName = \u5C5E\u6027"{0}"\u306E\u5024\u304C\u7121\u52B9\u3067\u3059\u3002\u63A5\u982D\u8F9E\u306E\u4ED8\u3044\u305F\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u30FB\u30D0\u30A4\u30F3\u30C7\u30A3\u30F3\u30B0\u306F\u7A7A\u306B\u3067\u304D\u307E\u305B\u3093\u3002
- PrefixDeclared = \u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u306E\u63A5\u982D\u8F9E"{0}"\u304C\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
- CantBindXMLNS = \u63A5\u982D\u8F9E"xmlns"\u306F\u3001\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u306B\u660E\u793A\u7684\u306B\u30D0\u30A4\u30F3\u30C9\u3067\u304D\u307E\u305B\u3093\u3002\u307E\u305F\u3001"xmlns"\u306E\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u3082\u3001\u63A5\u982D\u8F9E\u306B\u660E\u793A\u7684\u306B\u30D0\u30A4\u30F3\u30C9\u3067\u304D\u307E\u305B\u3093\u3002
- CantBindXML = \u63A5\u982D\u8F9E"xml"\u306F\u3001\u901A\u5E38\u306E\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u4EE5\u5916\u306E\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u306B\u30D0\u30A4\u30F3\u30C9\u3067\u304D\u307E\u305B\u3093\u3002\u307E\u305F\u3001"xml"\u306E\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u3082\u3001"xml"\u4EE5\u5916\u306E\u63A5\u982D\u8F9E\u306B\u30D0\u30A4\u30F3\u30C9\u3067\u304D\u307E\u305B\u3093\u3002
- MSG_ATT_DEFAULT_INVALID = \u5C5E\u6027"{0}"\u306EdefaultValue "{1}"\u306F\u3001\u3053\u306E\u5C5E\u6027\u30BF\u30A4\u30D7\u306E\u5B57\u53E5\u5236\u7D04\u306B\u95A2\u3057\u3066\u6709\u52B9\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
-
-# REVISIT: These need messages
- MSG_SPACE_REQUIRED_AFTER_SYSTEMLITERAL_IN_EXTERNALID=MSG_SPACE_REQUIRED_AFTER_SYSTEMLITERAL_IN_EXTERNALID
- OpenQuoteMissingInDecl=OpenQuoteMissingInDecl
- InvalidCharInLiteral=InvalidCharInLiteral
-
-
-# Implementation limits
- EntityExpansionLimit=JAXP00010001: \u30D1\u30FC\u30B5\u30FC\u306B\u3088\u3063\u3066\u3001\u3053\u306E\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u5185\u3067"{0}"\u3092\u8D85\u3048\u308B\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u62E1\u5F35\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F\u3002\u3053\u308C\u306F\u3001JDK\u306B\u3088\u308B\u5236\u9650\u3067\u3059\u3002
- ElementAttributeLimit=JAXP00010002: \u8981\u7D20"{0}"\u306B"{1}"\u3092\u8D85\u3048\u308B\u5C5E\u6027\u304C\u5B58\u5728\u3057\u307E\u3059\u3002"{1}"\u306F\u3001JDK\u306B\u3088\u308B\u5236\u9650\u3067\u3059\u3002
- MaxEntitySizeLimit=JAXP00010003: \u30A8\u30F3\u30C6\u30A3\u30C6\u30A3"{0}"\u306E\u9577\u3055\u306F"{1}"\u3067\u3001"{3}"\u3067\u8A2D\u5B9A\u3055\u308C\u305F\u5236\u9650"{2}"\u3092\u8D85\u3048\u3066\u3044\u307E\u3059\u3002
- TotalEntitySizeLimit=JAXP00010004: \u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u306E\u7D2F\u7A4D\u30B5\u30A4\u30BA"{0}"\u306F\u3001"{2}"\u3067\u8A2D\u5B9A\u3055\u308C\u305F\u5236\u9650"{1}"\u3092\u8D85\u3048\u307E\u3057\u305F\u3002
- MaxXMLNameLimit=JAXP00010005: \u30A8\u30F3\u30C6\u30A3\u30C6\u30A3"{0}"\u306E\u9577\u3055\u306F"{1}"\u3067\u3001"{3}"\u3067\u8A2D\u5B9A\u3055\u308C\u305F\u5236\u9650"{2}"\u3092\u8D85\u3048\u3066\u3044\u307E\u3059\u3002
- MaxElementDepthLimit=JAXP00010006: \u8981\u7D20"{0}"\u306E\u6DF1\u3055\u306F"{1}"\u3067\u3001"{3}"\u3067\u8A2D\u5B9A\u3055\u308C\u305F\u5236\u9650"{2}"\u3092\u8D85\u3048\u3066\u3044\u307E\u3059\u3002
- EntityReplacementLimit=JAXP00010007: \u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u53C2\u7167\u306E\u5408\u8A08\u30CE\u30FC\u30C9\u6570\u306F"{0}"\u3067\u3001"{2}"\u3067\u8A2D\u5B9A\u3055\u308C\u305F\u5236\u9650"{1}"\u3092\u8D85\u3048\u3066\u3044\u307E\u3059\u3002
-
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ko.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ko.properties
deleted file mode 100644
index e90be33..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ko.properties
+++ /dev/null
@@ -1,305 +0,0 @@
-# This file contains error and warning messages related to XML
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-# @version
-
- BadMessageKey = \uBA54\uC2DC\uC9C0 \uD0A4\uC5D0 \uD574\uB2F9\uD558\uB294 \uC624\uB958 \uBA54\uC2DC\uC9C0\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
- FormatFailed = \uB2E4\uC74C \uBA54\uC2DC\uC9C0\uC758 \uD615\uC2DD\uC744 \uC9C0\uC815\uD558\uB294 \uC911 \uB0B4\uBD80 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4.\n
-
-# Document messages
- PrematureEOF=\uC608\uAE30\uCE58 \uC54A\uC740 \uD30C\uC77C\uC758 \uB05D\uC785\uB2C8\uB2E4.
-# 2.1 Well-Formed XML Documents
- RootElementRequired = \uC62C\uBC14\uB978 \uD615\uC2DD\uC758 \uBB38\uC11C\uC5D0\uB294 \uB8E8\uD2B8 \uC694\uC18C\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4.
-# 2.2 Characters
-
- InvalidCharInCDSect = CDATA \uC139\uC158\uC5D0\uC11C \uBD80\uC801\uD569\uD55C XML \uBB38\uC790(\uC720\uB2C8\uCF54\uB4DC: 0x{0})\uAC00 \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
- InvalidCharInContent = \uBB38\uC11C\uC758 \uC694\uC18C \uCF58\uD150\uCE20\uC5D0\uC11C \uBD80\uC801\uD569\uD55C XML \uBB38\uC790(\uC720\uB2C8\uCF54\uB4DC: 0x{0})\uAC00 \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
- TwoColonsInQName = \uC694\uC18C \uC720\uD615 \uB610\uB294 \uC18D\uC131 \uC774\uB984\uC5D0\uC11C \uBD80\uC801\uD569\uD55C \uB450\uBC88\uC9F8 ':'\uC774 \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
- ColonNotLegalWithNS = \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uAC00 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uB41C \uACBD\uC6B0 ''{0}'' \uC774\uB984\uC5D0\uC11C\uB294 \uCF5C\uB860\uC774 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
- InvalidCharInMisc = \uC694\uC18C \uCF58\uD150\uCE20 \uB05D\uAE4C\uC9C0 \uC77D\uC740 \uD6C4 \uB9C8\uD06C\uC5C5\uC5D0\uC11C \uBD80\uC801\uD569\uD55C XML \uBB38\uC790(\uC720\uB2C8\uCF54\uB4DC: 0x{0})\uAC00 \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
- InvalidCharInProlog = \uBB38\uC11C\uC758 \uD504\uB864\uB85C\uADF8\uC5D0\uC11C \uBD80\uC801\uD569\uD55C XML \uBB38\uC790(\uC720\uB2C8\uCF54\uB4DC: 0x{0})\uAC00 \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
- InvalidCharInXMLDecl = XML \uC120\uC5B8\uC5D0\uC11C \uBD80\uC801\uD569\uD55C XML \uBB38\uC790(\uC720\uB2C8\uCF54\uB4DC: 0x{0})\uAC00 \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
-# 2.4 Character Data and Markup
- CDEndInContent = \uBB38\uC790 \uC2DC\uD000\uC2A4 "]]>"\uB294 CDATA \uC139\uC158 \uB05D\uC744 \uD45C\uC2DC\uD558\uB294 \uB370 \uC0AC\uC6A9\uB418\uC9C0 \uC54A\uB294 \uACBD\uC6B0 \uCF58\uD150\uCE20\uC5D0 \uB098\uD0C0\uB098\uC9C0 \uC54A\uC544\uC57C \uD569\uB2C8\uB2E4.
-# 2.7 CDATA Sections
- CDSectUnterminated = CDATA \uC139\uC158\uC740 "]]>"\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4.
-# 2.8 Prolog and Document Type Declaration
- XMLDeclMustBeFirst = XML \uC120\uC5B8\uC740 \uBB38\uC11C \uB9E8 \uC55E\uC5D0\uB9CC \uB098\uD0C0\uB0A0 \uC218 \uC788\uC2B5\uB2C8\uB2E4.
- EqRequiredInXMLDecl = XML \uC120\uC5B8\uC5D0\uC11C\uB294 "{0}" \uB2E4\uC74C\uC5D0 '' = '' \uBB38\uC790\uAC00 \uC640\uC57C \uD569\uB2C8\uB2E4.
- QuoteRequiredInXMLDecl = XML \uC120\uC5B8\uC5D0\uC11C "{0}" \uB2E4\uC74C\uC5D0 \uC624\uB294 \uAC12\uC740 \uB530\uC634\uD45C\uAC00 \uBD99\uC740 \uBB38\uC790\uC5F4\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- XMLDeclUnterminated = XML \uC120\uC5B8\uC740 "?>"\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4.
- VersionInfoRequired = XML \uC120\uC5B8\uC5D0\uB294 \uBC84\uC804\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.
- SpaceRequiredBeforeVersionInXMLDecl = XML \uC120\uC5B8\uC5D0\uC11C\uB294 \uBC84\uC804 \uC758\uC0AC \uC18D\uC131 \uC55E\uC5D0 \uACF5\uBC31\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.
- SpaceRequiredBeforeEncodingInXMLDecl = XML \uC120\uC5B8\uC5D0\uC11C\uB294 \uC778\uCF54\uB529 \uC758\uC0AC \uC18D\uC131 \uC55E\uC5D0 \uACF5\uBC31\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.
- SpaceRequiredBeforeStandalone = XML \uC120\uC5B8\uC5D0\uC11C\uB294 \uC778\uCF54\uB529 \uC758\uC0AC \uC18D\uC131 \uC55E\uC5D0 \uACF5\uBC31\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.
- MarkupNotRecognizedInProlog = \uBB38\uC11C\uC5D0\uC11C \uB8E8\uD2B8 \uC694\uC18C \uC55E\uC5D0 \uC624\uB294 \uB9C8\uD06C\uC5C5\uC740 \uC62C\uBC14\uB978 \uD615\uC2DD\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- MarkupNotRecognizedInMisc = \uBB38\uC11C\uC5D0\uC11C \uB8E8\uD2B8 \uC694\uC18C \uB2E4\uC74C\uC5D0 \uC624\uB294 \uB9C8\uD06C\uC5C5\uC740 \uC62C\uBC14\uB978 \uD615\uC2DD\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- AlreadySeenDoctype = doctype\uC774 \uC774\uBBF8 \uD45C\uC2DC\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
- DoctypeNotAllowed = DOCTYPE\uC740 "http://apache.org/xml/features/disallow-doctype-decl" \uAE30\uB2A5\uC774 true\uB85C \uC124\uC815\uB41C \uACBD\uC6B0 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
- ContentIllegalInProlog = \uD504\uB864\uB85C\uADF8\uC5D0\uC11C\uB294 \uCF58\uD150\uCE20\uAC00 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
- ReferenceIllegalInProlog = \uD504\uB864\uB85C\uADF8\uC5D0\uC11C\uB294 \uCC38\uC870\uAC00 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
-# Trailing Misc
- ContentIllegalInTrailingMisc=\uD6C4\uD589 \uC139\uC158\uC5D0\uC11C\uB294 \uCF58\uD150\uCE20\uAC00 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
- ReferenceIllegalInTrailingMisc=\uD6C4\uD589 \uC139\uC158\uC5D0\uC11C\uB294 \uCC38\uC870\uAC00 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
-
-# 2.9 Standalone Document Declaration
- SDDeclInvalid = \uB3C5\uB9BD\uD615 \uBB38\uC11C \uC120\uC5B8 \uAC12\uC740 "{0}"\uC774(\uAC00) \uC544\uB2CC "yes" \uB610\uB294 "no"\uC5EC\uC57C \uD569\uB2C8\uB2E4.
- SDDeclNameInvalid = XML \uC120\uC5B8\uC758 \uB3C5\uB9BD\uD615 \uC774\uB984\uC758 \uCCA0\uC790\uAC00 \uC798\uBABB\uB418\uC5C8\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4.
-# 2.12 Language Identification
- XMLLangInvalid = xml:lang \uC18D\uC131\uAC12 "{0}"\uC740(\uB294) \uBD80\uC801\uD569\uD55C \uC5B8\uC5B4 \uC2DD\uBCC4\uC790\uC785\uB2C8\uB2E4.
-# 3. Logical Structures
- ETagRequired = \uC694\uC18C \uC720\uD615 "{0}"\uC740(\uB294) \uC9DD\uC774 \uB9DE\uB294 \uC885\uB8CC \uD0DC\uADF8 "</{0}>"(\uC73C)\uB85C \uC885\uB8CC\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4.
-# 3.1 Start-Tags, End-Tags, and Empty-Element Tags
- ElementUnterminated = \uC694\uC18C \uC720\uD615 "{0}" \uB2E4\uC74C\uC5D0\uB294 \uC18D\uC131 \uC0AC\uC591 ">" \uB610\uB294 "/>"\uAC00 \uC640\uC57C \uD569\uB2C8\uB2E4.
- EqRequiredInAttribute = \uC694\uC18C \uC720\uD615 "{0}"\uACFC(\uC640) \uC5F0\uAD00\uB41C \uC18D\uC131 \uC774\uB984 "{1}" \uB2E4\uC74C\uC5D0\uB294 '' = '' \uBB38\uC790\uAC00 \uC640\uC57C \uD569\uB2C8\uB2E4.
- OpenQuoteExpected = \uC694\uC18C \uC720\uD615 "{0}"\uACFC(\uC640) \uC5F0\uAD00\uB41C "{1}" \uC18D\uC131\uC5D0\uB294 \uC5EC\uB294 \uB530\uC634\uD45C\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4.
- CloseQuoteExpected = \uC694\uC18C \uC720\uD615 "{0}"\uACFC(\uC640) \uC5F0\uAD00\uB41C "{1}" \uC18D\uC131\uC5D0\uB294 \uB2EB\uB294 \uB530\uC634\uD45C\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4.
- AttributeNotUnique = "{1}" \uC18D\uC131\uC774 "{0}" \uC694\uC18C\uC5D0 \uB300\uD574 \uC774\uBBF8 \uC9C0\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
- AttributeNSNotUnique = "{2}" \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uC5D0 \uBC14\uC778\uB4DC\uB41C "{1}" \uC18D\uC131\uC774 "{0}" \uC694\uC18C\uC5D0 \uB300\uD574 \uC774\uBBF8 \uC9C0\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
- ETagUnterminated = \uC694\uC18C \uC720\uD615 "{0}"\uC5D0 \uB300\uD55C \uC885\uB8CC \uD0DC\uADF8\uB294 ''>'' \uAD6C\uBD84\uC790\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4.
- MarkupNotRecognizedInContent = \uC694\uC18C \uCF58\uD150\uCE20\uB294 \uC62C\uBC14\uB978 \uD615\uC2DD\uC758 \uBB38\uC790 \uB370\uC774\uD130 \uB610\uB294 \uB9C8\uD06C\uC5C5\uC73C\uB85C \uAD6C\uC131\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- DoctypeIllegalInContent = \uCF58\uD150\uCE20\uC5D0\uC11C\uB294 DOCTYPE\uC774 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
-# 4.1 Character and Entity References
- ReferenceUnterminated = \uCC38\uC870\uB294 ';' \uAD6C\uBD84\uC790\uB85C \uC885\uB8CC\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4.
-# 4.3.2 Well-Formed Parsed Entities
- ReferenceNotInOneEntity = \uCC38\uC870\uB294 \uAD6C\uBB38\uC774 \uBD84\uC11D\uB41C \uB3D9\uC77C\uD55C \uC5D4\uD2F0\uD2F0\uC5D0 \uC644\uC804\uD788 \uD3EC\uD568\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- ElementEntityMismatch = "{0}" \uC694\uC18C\uB294 \uB3D9\uC77C\uD55C \uC5D4\uD2F0\uD2F0\uC5D0\uC11C \uC2DC\uC791\uB418\uACE0 \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4.
- MarkupEntityMismatch=XML \uBB38\uC11C \uAD6C\uC870\uB294 \uB3D9\uC77C\uD55C \uC5D4\uD2F0\uD2F0\uC5D0\uC11C \uC2DC\uC791\uB418\uACE0 \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4.
-
-# Messages common to Document and DTD
-# 2.2 Characters
- InvalidCharInAttValue = "{1}" \uC18D\uC131\uC758 \uAC12\uC5D0\uC11C \uBD80\uC801\uD569\uD55C XML \uBB38\uC790(\uC720\uB2C8\uCF54\uB4DC: 0x{2})\uAC00 \uBC1C\uACAC\uB418\uC5C8\uC73C\uBA70 \uC694\uC18C\uAC00 "{0}"\uC785\uB2C8\uB2E4.
- InvalidCharInComment = \uC8FC\uC11D\uC5D0\uC11C \uBD80\uC801\uD569\uD55C XML \uBB38\uC790(\uC720\uB2C8\uCF54\uB4DC: 0x{0})\uAC00 \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
- InvalidCharInPI = \uCC98\uB9AC \uBA85\uB839\uC5D0\uC11C \uBD80\uC801\uD569\uD55C XML \uBB38\uC790(\uC720\uB2C8\uCF54\uB4DC: 0x{0})\uAC00 \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
- InvalidCharInInternalSubset = DTD\uC758 \uB0B4\uBD80 \uBD80\uBD84 \uC9D1\uD569\uC5D0\uC11C \uBD80\uC801\uD569\uD55C XML \uBB38\uC790(\uC720\uB2C8\uCF54\uB4DC: 0x{0})\uAC00 \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
- InvalidCharInTextDecl = \uD14D\uC2A4\uD2B8 \uC120\uC5B8\uC5D0\uC11C \uBD80\uC801\uD569\uD55C XML \uBB38\uC790(\uC720\uB2C8\uCF54\uB4DC: 0x{0})\uAC00 \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
-# 2.3 Common Syntactic Constructs
- QuoteRequiredInAttValue = "{1}" \uC18D\uC131\uC758 \uAC12\uC740 \uC791\uC740 \uB530\uC634\uD45C \uB610\uB294 \uD070 \uB530\uC634\uD45C \uBB38\uC790\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4.
- LessthanInAttValue = \uC694\uC18C \uC720\uD615 "{0}"\uACFC(\uC640) \uC5F0\uAD00\uB41C "{1}" \uC18D\uC131\uC758 \uAC12\uC5D0\uB294 ''<'' \uBB38\uC790\uAC00 \uD3EC\uD568\uB418\uC9C0 \uC54A\uC544\uC57C \uD569\uB2C8\uB2E4.
- AttributeValueUnterminated = "{1}" \uC18D\uC131\uC758 \uAC12\uC740 \uC9DD\uC774 \uB9DE\uB294 \uB530\uC634\uD45C \uBB38\uC790\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4.
-# 2.5 Comments
- InvalidCommentStart = \uC8FC\uC11D\uC740 "<!--"\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4.
- DashDashInComment = \uC8FC\uC11D\uC5D0\uC11C\uB294 "--" \uBB38\uC790\uC5F4\uC774 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
- CommentUnterminated = \uC8FC\uC11D\uC740 "-->"\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4.
- COMMENT_NOT_IN_ONE_ENTITY = \uC8FC\uC11D\uC774 \uB3D9\uC77C\uD55C \uC5D4\uD2F0\uD2F0 \uC548\uC5D0 \uC788\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
-# 2.6 Processing Instructions
- PITargetRequired = \uCC98\uB9AC \uBA85\uB839\uC740 \uB300\uC0C1 \uC774\uB984\uC73C\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4.
- SpaceRequiredInPI = \uCC98\uB9AC \uBA85\uB839 \uB300\uC0C1\uACFC \uB370\uC774\uD130 \uC0AC\uC774\uC5D0\uB294 \uACF5\uBC31\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.
- PIUnterminated = \uCC98\uB9AC \uBA85\uB839\uC740 "?>"\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4.
- ReservedPITarget = "[xX][mM][lL]"\uACFC \uC77C\uCE58\uD558\uB294 \uCC98\uB9AC \uBA85\uB839 \uB300\uC0C1\uC740 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
- PI_NOT_IN_ONE_ENTITY = \uCC98\uB9AC \uBA85\uB839\uC774 \uB3D9\uC77C\uD55C \uC5D4\uD2F0\uD2F0 \uC548\uC5D0 \uC788\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
-# 2.8 Prolog and Document Type Declaration
- VersionInfoInvalid = "{0}"\uC740(\uB294) \uBD80\uC801\uD569\uD55C \uBC84\uC804\uC785\uB2C8\uB2E4.
- VersionNotSupported = XML \uBC84\uC804 "{0}"\uC740(\uB294) \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. XML 1.0\uB9CC \uC9C0\uC6D0\uB429\uB2C8\uB2E4.
- VersionNotSupported11 = XML \uBC84\uC804 "{0}"\uC740(\uB294) \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. XML 1.0 \uBC0F XML 1.1\uB9CC \uC9C0\uC6D0\uB429\uB2C8\uB2E4.
- VersionMismatch= \uD558\uB098\uC758 \uC5D4\uD2F0\uD2F0\uC5D0\uB294 \uC774\uD6C4 \uBC84\uC804\uC758 \uB2E4\uB978 \uC5D4\uD2F0\uD2F0\uAC00 \uD3EC\uD568\uB420 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
-# 4.1 Character and Entity References
- DigitRequiredInCharRef = \uBB38\uC790 \uCC38\uC870\uC5D0\uC11C\uB294 "&#" \uBC14\uB85C \uB2E4\uC74C\uC5D0 \uC2ED\uC9C4\uC218 \uD45C\uD604\uC774 \uC640\uC57C \uD569\uB2C8\uB2E4.
- HexdigitRequiredInCharRef = \uBB38\uC790 \uCC38\uC870\uC5D0\uC11C\uB294 "&#x" \uBC14\uB85C \uB2E4\uC74C\uC5D0 16\uC9C4\uC218 \uD45C\uD604\uC774 \uC640\uC57C \uD569\uB2C8\uB2E4.
- SemicolonRequiredInCharRef = \uBB38\uC790 \uCC38\uC870\uB294 ';' \uAD6C\uBD84\uC790\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4.
- InvalidCharRef = \uBB38\uC790 \uCC38\uC870 "&#{0}"\uC740(\uB294) \uBD80\uC801\uD569\uD55C XML \uBB38\uC790\uC785\uB2C8\uB2E4.
- NameRequiredInReference = \uC5D4\uD2F0\uD2F0 \uCC38\uC870\uC5D0\uC11C\uB294 '&' \uBC14\uB85C \uB2E4\uC74C\uC5D0 \uC5D4\uD2F0\uD2F0 \uC774\uB984\uC774 \uC640\uC57C \uD569\uB2C8\uB2E4.
- SemicolonRequiredInReference = "{0}" \uC5D4\uD2F0\uD2F0\uC5D0 \uB300\uD55C \uCC38\uC870\uB294 '';'' \uAD6C\uBD84\uC790\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4.
-# 4.3.1 The Text Declaration
- TextDeclMustBeFirst = \uD14D\uC2A4\uD2B8 \uC120\uC5B8\uC740 \uAD6C\uBB38\uC774 \uBD84\uC11D\uB41C \uC678\uBD80 \uC5D4\uD2F0\uD2F0 \uB9E8 \uC55E\uC5D0\uB9CC \uB098\uD0C0\uB0A0 \uC218 \uC788\uC2B5\uB2C8\uB2E4.
- EqRequiredInTextDecl = \uD14D\uC2A4\uD2B8 \uC120\uC5B8\uC5D0\uC11C\uB294 "{0}" \uB2E4\uC74C\uC5D0 '' = '' \uBB38\uC790\uAC00 \uC640\uC57C \uD569\uB2C8\uB2E4.
- QuoteRequiredInTextDecl = \uD14D\uC2A4\uD2B8 \uC120\uC5B8\uC5D0\uC11C "{0}" \uB2E4\uC74C\uC5D0 \uC624\uB294 \uAC12\uC740 \uB530\uC634\uD45C\uAC00 \uBD99\uC740 \uBB38\uC790\uC5F4\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- CloseQuoteMissingInTextDecl = \uD14D\uC2A4\uD2B8 \uC120\uC5B8\uC5D0\uC11C "{0}" \uB2E4\uC74C\uC5D0 \uC624\uB294 \uAC12\uC758 \uB2EB\uB294 \uB530\uC634\uD45C\uAC00 \uB204\uB77D\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
- SpaceRequiredBeforeVersionInTextDecl = \uD14D\uC2A4\uD2B8 \uC120\uC5B8\uC740 \uBC84\uC804 \uC758\uC0AC \uC18D\uC131 \uC55E\uC5D0 \uACF5\uBC31\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.
- SpaceRequiredBeforeEncodingInTextDecl = \uD14D\uC2A4\uD2B8 \uC120\uC5B8\uC740 \uC778\uCF54\uB529 \uC758\uC0AC \uC18D\uC131 \uC55E\uC5D0 \uACF5\uBC31\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.
- TextDeclUnterminated = \uD14D\uC2A4\uD2B8 \uC120\uC5B8\uC740 "?>"\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4.
- EncodingDeclRequired = \uD14D\uC2A4\uD2B8 \uC120\uC5B8\uC5D0\uB294 \uC778\uCF54\uB529 \uC120\uC5B8\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.
- NoMorePseudoAttributes = \uC758\uC0AC \uC18D\uC131\uC740 \uB354 \uC774\uC0C1 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
- MorePseudoAttributes = \uC758\uC0AC \uC18D\uC131\uC774 \uB354 \uD544\uC694\uD569\uB2C8\uB2E4.
- PseudoAttrNameExpected = \uC758\uC0AC \uC18D\uC131 \uC774\uB984\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.
-# 4.3.2 Well-Formed Parsed Entities
- CommentNotInOneEntity = \uC8FC\uC11D\uC740 \uAD6C\uBB38\uC774 \uBD84\uC11D\uB41C \uB3D9\uC77C\uD55C \uC5D4\uD2F0\uD2F0\uC5D0 \uC644\uC804\uD788 \uD3EC\uD568\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- PINotInOneEntity = \uCC98\uB9AC \uBA85\uB839\uC740 \uAD6C\uBB38\uC774 \uBD84\uC11D\uB41C \uB3D9\uC77C\uD55C \uC5D4\uD2F0\uD2F0\uC5D0 \uC644\uC804\uD788 \uD3EC\uD568\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4.
-# 4.3.3 Character Encoding in Entities
- EncodingDeclInvalid = "{0}"\uC740(\uB294) \uBD80\uC801\uD569\uD55C \uC778\uCF54\uB529 \uC774\uB984\uC785\uB2C8\uB2E4.
- EncodingByteOrderUnsupported = "{0}" \uC778\uCF54\uB529\uC5D0 \uB300\uD574 \uC81C\uACF5\uB41C \uBC14\uC774\uD2B8 \uC21C\uC11C\uB294 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
- InvalidByte = {0}\uC740(\uB294) {1}\uBC14\uC774\uD2B8 UTF-8 \uC2DC\uD000\uC2A4\uC5D0 \uB300\uD574 \uBD80\uC801\uD569\uD55C \uBC14\uC774\uD2B8\uC785\uB2C8\uB2E4.
- ExpectedByte = {1}\uBC14\uC774\uD2B8 UTF-8 \uC2DC\uD000\uC2A4\uC5D0 \uD544\uC694\uD55C \uBC14\uC774\uD2B8\uB294 {0}\uC785\uB2C8\uB2E4.
- InvalidHighSurrogate = UTF-8 \uC2DC\uD000\uC2A4\uC758 \uB192\uC740 \uB300\uB9AC \uBE44\uD2B8\uB294 0x10\uC744 \uCD08\uACFC\uD558\uC9C0 \uC54A\uC544\uC57C \uD558\uC9C0\uB9CC 0x{0}\uC774(\uAC00) \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
- OperationNotSupported = {1} \uC77D\uAE30 \uD504\uB85C\uADF8\uB7A8\uC740 "{0}" \uC791\uC5C5\uC744 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
- InvalidASCII = \uBC14\uC774\uD2B8 "{0}"\uC740(\uB294) (7\uBE44\uD2B8) ASCII \uBB38\uC790 \uC9D1\uD569\uC5D0 \uC18D\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
- CharConversionFailure = \uD2B9\uC815 \uC778\uCF54\uB529 \uD615\uC2DD\uC774\uC5B4\uC57C \uD558\uB294 \uAC83\uC73C\uB85C \uD655\uC778\uB41C \uC5D4\uD2F0\uD2F0\uC5D0\uB294 \uD574\uB2F9 \uC778\uCF54\uB529\uC5D0 \uBD80\uC801\uD569\uD55C \uC2DC\uD000\uC2A4\uAC00 \uD3EC\uD568\uB418\uC9C0 \uC54A\uC544\uC57C \uD569\uB2C8\uB2E4.
-
-# DTD Messages
-# 2.2 Characters
- InvalidCharInEntityValue = \uB9AC\uD130\uB7F4 \uC5D4\uD2F0\uD2F0 \uAC12\uC5D0\uC11C \uBD80\uC801\uD569\uD55C XML \uBB38\uC790(\uC720\uB2C8\uCF54\uB4DC: 0x{0})\uAC00 \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
- InvalidCharInExternalSubset = DTD\uC758 \uC678\uBD80 \uBD80\uBD84 \uC9D1\uD569\uC5D0\uC11C \uBD80\uC801\uD569\uD55C XML \uBB38\uC790(\uC720\uB2C8\uCF54\uB4DC: 0x{0})\uAC00 \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
- InvalidCharInIgnoreSect = \uC81C\uC678\uB41C \uC870\uAC74\uBD80 \uC139\uC158\uC5D0\uC11C \uBD80\uC801\uD569\uD55C XML \uBB38\uC790(\uC720\uB2C8\uCF54\uB4DC: 0x{0})\uAC00 \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
- InvalidCharInPublicID = \uACF5\uC6A9 \uC2DD\uBCC4\uC790\uC5D0 \uBD80\uC801\uD569\uD55C XML \uBB38\uC790(\uC720\uB2C8\uCF54\uB4DC: 0x{0})\uAC00 \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
- InvalidCharInSystemID = \uC2DC\uC2A4\uD15C \uC2DD\uBCC4\uC790\uC5D0 \uBD80\uC801\uD569\uD55C XML \uBB38\uC790(\uC720\uB2C8\uCF54\uB4DC: 0x{0})\uAC00 \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
-# 2.3 Common Syntactic Constructs
- SpaceRequiredAfterSYSTEM = DOCTYPE \uC120\uC5B8\uC5D0\uB294 SYSTEM \uD0A4\uC6CC\uB4DC \uB2E4\uC74C\uC5D0 \uACF5\uBC31\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.
- QuoteRequiredInSystemID = \uC2DC\uC2A4\uD15C \uC2DD\uBCC4\uC790\uB294 \uC791\uC740 \uB530\uC634\uD45C \uB610\uB294 \uD070 \uB530\uC634\uD45C \uBB38\uC790\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4.
- SystemIDUnterminated = \uC2DC\uC2A4\uD15C \uC2DD\uBCC4\uC790\uB294 \uC9DD\uC774 \uB9DE\uB294 \uB530\uC634\uD45C \uBB38\uC790\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4.
- SpaceRequiredAfterPUBLIC = DOCTYPE \uC120\uC5B8\uC5D0\uB294 PUBLIC \uD0A4\uC6CC\uB4DC \uB2E4\uC74C\uC5D0 \uACF5\uBC31\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.
- QuoteRequiredInPublicID = \uACF5\uC6A9 \uC2DD\uBCC4\uC790\uB294 \uC791\uC740 \uB530\uC634\uD45C \uB610\uB294 \uD070 \uB530\uC634\uD45C \uBB38\uC790\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4.
- PublicIDUnterminated = \uACF5\uC6A9 \uC2DD\uBCC4\uC790\uB294 \uC9DD\uC774 \uB9DE\uB294 \uB530\uC634\uD45C \uBB38\uC790\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4.
- PubidCharIllegal = \uACF5\uC6A9 \uC2DD\uBCC4\uC790\uC5D0\uB294 \uBB38\uC790(\uC720\uB2C8\uCF54\uB4DC: 0x{0})\uAC00 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
- SpaceRequiredBetweenPublicAndSystem = publicId\uC640 systemId \uC0AC\uC774\uC5D0\uB294 \uACF5\uBC31\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.
-# 2.8 Prolog and Document Type Declaration
- MSG_SPACE_REQUIRED_BEFORE_ROOT_ELEMENT_TYPE_IN_DOCTYPEDECL = \uBB38\uC11C \uC720\uD615 \uC120\uC5B8\uC5D0\uC11C\uB294 "<!DOCTYPE" \uB2E4\uC74C\uC5D0 \uACF5\uBC31\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.
- MSG_ROOT_ELEMENT_TYPE_REQUIRED = \uBB38\uC11C \uC720\uD615 \uC120\uC5B8\uC5D0\uC11C\uB294 "<!DOCTYPE" \uB2E4\uC74C\uC5D0 \uB8E8\uD2B8 \uC694\uC18C \uC720\uD615\uC774 \uB098\uD0C0\uB098\uC57C \uD569\uB2C8\uB2E4.
- DoctypedeclUnterminated = \uB8E8\uD2B8 \uC694\uC18C \uC720\uD615 "{0}"\uC5D0 \uB300\uD55C \uBB38\uC11C \uC720\uD615 \uC120\uC5B8\uC740 ''>''\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4.
- DoctypedeclNotClosed = \uB8E8\uD2B8 \uC694\uC18C \uC720\uD615 "{0}"\uC5D0 \uB300\uD55C \uBB38\uC11C \uC720\uD615 \uC120\uC5B8\uC740 '']''\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4.
- PEReferenceWithinMarkup = \uB9E4\uAC1C\uBCC0\uC218 \uC5D4\uD2F0\uD2F0 \uCC38\uC870 "%{0};"\uC740 DTD\uC758 \uB0B4\uBD80 \uBD80\uBD84 \uC9D1\uD569\uC5D0 \uC788\uB294 \uB9C8\uD06C\uC5C5 \uC548\uC5D0 \uD45C\uC2DC\uB420 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
- MSG_MARKUP_NOT_RECOGNIZED_IN_DTD = \uBB38\uC11C \uC720\uD615 \uC120\uC5B8\uC744 \uD3EC\uD568\uD558\uAC70\uB098 \uBB38\uC11C \uC720\uD615 \uC120\uC5B8\uC774 \uAC00\uB9AC\uD0A4\uB294 \uB9C8\uD06C\uC5C5 \uC120\uC5B8\uC740 \uC62C\uBC14\uB978 \uD615\uC2DD\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.
-# 2.10 White Space Handling
- MSG_XML_SPACE_DECLARATION_ILLEGAL = "xml:space"\uC5D0 \uB300\uD55C \uC18D\uC131 \uC120\uC5B8\uC740 "default" \uBC0F "preserve" \uAC12\uB9CC \uAC00\uB2A5\uD55C \uC5F4\uAC70 \uC720\uD615\uC73C\uB85C \uC9C0\uC815\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4.
-# 3.2 Element Type Declarations
- MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ELEMENTDECL = \uC694\uC18C \uC720\uD615 \uC120\uC5B8\uC5D0\uC11C\uB294 "<!ELEMENT" \uB2E4\uC74C\uC5D0 \uACF5\uBC31\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.
- MSG_ELEMENT_TYPE_REQUIRED_IN_ELEMENTDECL = \uC694\uC18C \uC720\uD615 \uC120\uC5B8\uC5D0\uB294 \uC694\uC18C \uC720\uD615\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.
- MSG_SPACE_REQUIRED_BEFORE_CONTENTSPEC_IN_ELEMENTDECL = \uC694\uC18C \uC720\uD615 \uC120\uC5B8\uC5D0\uC11C\uB294 \uC694\uC18C \uC720\uD615 "{0}" \uB2E4\uC74C\uC5D0 \uACF5\uBC31\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.
- MSG_CONTENTSPEC_REQUIRED_IN_ELEMENTDECL = \uC694\uC18C \uC720\uD615 \uC120\uC5B8\uC5D0\uC11C\uB294 \uC694\uC18C \uC720\uD615 "{0}" \uB2E4\uC74C\uC5D0 \uC81C\uC57D \uC870\uAC74\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.
- ElementDeclUnterminated = \uC694\uC18C \uC720\uD615 "{0}"\uC5D0 \uB300\uD55C \uC120\uC5B8\uC740 ''>''\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4.
-# 3.2.1 Element Content
- MSG_OPEN_PAREN_OR_ELEMENT_TYPE_REQUIRED_IN_CHILDREN = \uC694\uC18C \uC720\uD615 "{0}"\uC758 \uC120\uC5B8\uC5D0\uB294 ''('' \uBB38\uC790 \uB610\uB294 \uC694\uC18C \uC720\uD615\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.
- MSG_CLOSE_PAREN_REQUIRED_IN_CHILDREN = \uC694\uC18C \uC720\uD615 "{0}"\uC758 \uC120\uC5B8\uC5D0\uB294 '')''\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4.
-# 3.2.2 Mixed Content
- MSG_ELEMENT_TYPE_REQUIRED_IN_MIXED_CONTENT = \uC694\uC18C \uC720\uD615 "{0}"\uC758 \uC120\uC5B8\uC5D0\uB294 \uC694\uC18C \uC720\uD615\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.
- MSG_CLOSE_PAREN_REQUIRED_IN_MIXED = \uC694\uC18C \uC720\uD615 "{0}"\uC758 \uC120\uC5B8\uC5D0\uB294 '')''\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4.
- MixedContentUnterminated = \uD558\uC704 \uC694\uC18C \uC720\uD615\uC774 \uC81C\uD55C\uB418\uB294 \uACBD\uC6B0 \uD63C\uD569 \uCF58\uD150\uCE20 \uBAA8\uB378 "{0}"\uC740(\uB294) ")*"\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4.
-# 3.3 Attribute-List Declarations
- MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ATTLISTDECL = attribute-list \uC120\uC5B8\uC5D0\uC11C\uB294 "<!ATTLIST" \uB2E4\uC74C\uC5D0 \uACF5\uBC31\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.
- MSG_ELEMENT_TYPE_REQUIRED_IN_ATTLISTDECL = attribute-list \uC120\uC5B8\uC5D0\uB294 \uC694\uC18C \uC720\uD615\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.
- MSG_SPACE_REQUIRED_BEFORE_ATTRIBUTE_NAME_IN_ATTDEF = "{0}" \uC694\uC18C\uC5D0 \uB300\uD55C attribute-list \uC120\uC5B8\uC5D0\uC11C\uB294 \uC18D\uC131 \uC774\uB984 \uC55E\uC5D0 \uACF5\uBC31\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.
- AttNameRequiredInAttDef = "{0}" \uC694\uC18C\uC5D0 \uB300\uD55C attribute-list \uC120\uC5B8\uC5D0\uB294 \uC18D\uC131 \uC774\uB984\uC774 \uC9C0\uC815\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- MSG_SPACE_REQUIRED_BEFORE_ATTTYPE_IN_ATTDEF = "{0}" \uC694\uC18C\uC5D0 \uB300\uD55C "{1}" \uC18D\uC131\uC758 \uC120\uC5B8\uC5D0\uC11C\uB294 \uC18D\uC131 \uC720\uD615 \uC55E\uC5D0 \uACF5\uBC31\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.
- AttTypeRequiredInAttDef = "{0}" \uC694\uC18C\uC5D0 \uB300\uD55C "{1}" \uC18D\uC131\uC758 \uC120\uC5B8\uC5D0\uB294 \uC18D\uC131 \uC720\uD615\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.
- MSG_SPACE_REQUIRED_BEFORE_DEFAULTDECL_IN_ATTDEF = "{0}" \uC694\uC18C\uC5D0 \uB300\uD55C "{1}" \uC18D\uC131\uC758 \uC120\uC5B8\uC5D0\uC11C\uB294 \uC18D\uC131 \uAE30\uBCF8\uAC12 \uC55E\uC5D0 \uACF5\uBC31\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.
- MSG_DUPLICATE_ATTRIBUTE_DEFINITION = \uC81C\uACF5\uB41C \uC694\uC18C "{0}"\uC758 \uB3D9\uC77C\uD55C \uC18D\uC131 "{1}"\uC5D0 \uB300\uD574 \uC18D\uC131 \uC815\uC758\uAC00 \uB450 \uAC1C \uC774\uC0C1 \uC81C\uACF5\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
-# 3.3.1 Attribute Types
- MSG_SPACE_REQUIRED_AFTER_NOTATION_IN_NOTATIONTYPE = "{1}" \uC18D\uC131 \uC120\uC5B8\uC5D0\uC11C\uB294 "NOTATION" \uB2E4\uC74C\uC5D0 \uACF5\uBC31\uC774 \uB098\uD0C0\uB098\uC57C \uD569\uB2C8\uB2E4.
- MSG_OPEN_PAREN_REQUIRED_IN_NOTATIONTYPE = "{1}" \uC18D\uC131 \uC120\uC5B8\uC5D0\uC11C\uB294 "NOTATION" \uB2E4\uC74C\uC5D0 ''('' \uBB38\uC790\uAC00 \uC640\uC57C \uD569\uB2C8\uB2E4.
- MSG_NAME_REQUIRED_IN_NOTATIONTYPE = "{1}" \uC18D\uC131 \uC120\uC5B8\uC5D0 \uB300\uD55C \uD45C\uAE30\uBC95 \uC720\uD615 \uBAA9\uB85D\uC5D0\uB294 \uD45C\uAE30\uBC95 \uC774\uB984\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.
- NotationTypeUnterminated = "{1}" \uC18D\uC131 \uC120\uC5B8\uC5D0\uC11C \uD45C\uAE30\uBC95 \uC720\uD615 \uBAA9\uB85D\uC740 '')''\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4.
- MSG_NMTOKEN_REQUIRED_IN_ENUMERATION = "{1}" \uC18D\uC131 \uC120\uC5B8\uC5D0 \uB300\uD55C \uC5F4\uAC70 \uC720\uD615 \uBAA9\uB85D\uC5D0\uB294 \uC774\uB984 \uD1A0\uD070\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.
- EnumerationUnterminated = "{1}" \uC18D\uC131 \uC120\uC5B8\uC5D0\uC11C \uC5F4\uAC70 \uC720\uD615 \uBAA9\uB85D\uC740 '')''\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4.
- MSG_DISTINCT_TOKENS_IN_ENUMERATION = "{0}" \uC694\uC18C\uC5D0 \uB300\uD55C "{2}" \uC18D\uC131\uC758 \uC120\uC5B8\uC5D0\uC11C \uBAA9\uB85D \uAC12 "{1}"\uC774(\uAC00) \uB450 \uBC88 \uC774\uC0C1 \uC9C0\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uB2E8\uC77C \uBAA9\uB85D \uC18D\uC131 \uC120\uC5B8\uC5D0\uC11C NMTOKENS\uB294 \uBAA8\uB450 \uACE0\uC720\uD574\uC57C \uD569\uB2C8\uB2E4.
- MSG_DISTINCT_NOTATION_IN_ENUMERATION = "{0}" \uC694\uC18C\uC5D0 \uB300\uD55C "{2}" \uC18D\uC131\uC758 \uC120\uC5B8\uC5D0\uC11C \uBAA9\uB85D \uAC12 "{1}"\uC774(\uAC00) \uB450 \uBC88 \uC774\uC0C1 \uC9C0\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uB2E8\uC77C NotationType \uC18D\uC131 \uC120\uC5B8\uC5D0\uC11C NOTATION \uC774\uB984\uC740 \uBAA8\uB450 \uACE0\uC720\uD574\uC57C \uD569\uB2C8\uB2E4.
-# 3.3.2 Attribute Defaults
- MSG_SPACE_REQUIRED_AFTER_FIXED_IN_DEFAULTDECL = "{1}" \uC18D\uC131 \uC120\uC5B8\uC5D0\uC11C\uB294 "FIXED" \uB2E4\uC74C\uC5D0 \uACF5\uBC31\uC774 \uB098\uD0C0\uB098\uC57C \uD569\uB2C8\uB2E4.
-# 3.4 Conditional Sections
- IncludeSectUnterminated = \uD3EC\uD568\uB41C \uC870\uAC74\uBD80 \uC139\uC158\uC740 "]]>"\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4.
- IgnoreSectUnterminated = \uC81C\uC678\uB41C \uC870\uAC74\uBD80 \uC139\uC158\uC740 "]]>"\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4.
-# 4.1 Character and Entity References
- NameRequiredInPEReference = \uB9E4\uAC1C\uBCC0\uC218 \uC5D4\uD2F0\uD2F0 \uCC38\uC870\uC5D0\uC11C\uB294 '%' \uBC14\uB85C \uB2E4\uC74C\uC5D0 \uC5D4\uD2F0\uD2F0 \uC774\uB984\uC774 \uC640\uC57C \uD569\uB2C8\uB2E4.
- SemicolonRequiredInPEReference = \uB9E4\uAC1C\uBCC0\uC218 \uC5D4\uD2F0\uD2F0 \uCC38\uC870 "%{0};"\uC740 '';'' \uAD6C\uBD84\uC790\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4.
-# 4.2 Entity Declarations
- MSG_SPACE_REQUIRED_BEFORE_ENTITY_NAME_IN_ENTITYDECL = \uC5D4\uD2F0\uD2F0 \uC120\uC5B8\uC5D0\uC11C\uB294 "<!ENTITY" \uB2E4\uC74C\uC5D0 \uACF5\uBC31\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.
- MSG_SPACE_REQUIRED_BEFORE_PERCENT_IN_PEDECL = \uB9E4\uAC1C\uBCC0\uC218 \uC5D4\uD2F0\uD2F0 \uC120\uC5B8\uC5D0\uC11C\uB294 "<!ENTITY"\uC640 '%' \uBB38\uC790 \uC0AC\uC774\uC5D0 \uACF5\uBC31\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.
- MSG_SPACE_REQUIRED_BEFORE_ENTITY_NAME_IN_PEDECL = \uB9E4\uAC1C\uBCC0\uC218 \uC5D4\uD2F0\uD2F0 \uC120\uC5B8\uC5D0\uC11C\uB294 '%'\uC640 \uC5D4\uD2F0\uD2F0 \uC774\uB984 \uC0AC\uC774\uC5D0 \uACF5\uBC31\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.
- MSG_ENTITY_NAME_REQUIRED_IN_ENTITYDECL = \uC5D4\uD2F0\uD2F0 \uC120\uC5B8\uC5D0\uB294 \uC5D4\uD2F0\uD2F0 \uC774\uB984\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.
- MSG_SPACE_REQUIRED_AFTER_ENTITY_NAME_IN_ENTITYDECL = \uC5D4\uD2F0\uD2F0 \uC120\uC5B8\uC5D0\uC11C\uB294 \uC5D4\uD2F0\uD2F0 \uC774\uB984 "{0}"\uACFC(\uC640) \uC815\uC758 \uC0AC\uC774\uC5D0 \uACF5\uBC31\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.
- MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_UNPARSED_ENTITYDECL = "{0}" \uC5D4\uD2F0\uD2F0\uC5D0 \uB300\uD55C \uC120\uC5B8\uC5D0\uC11C\uB294 "NDATA"\uC640 \uD45C\uAE30\uBC95 \uC774\uB984 \uC0AC\uC774\uC5D0 \uACF5\uBC31\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.
- MSG_SPACE_REQUIRED_BEFORE_NDATA_IN_UNPARSED_ENTITYDECL = "{0}" \uC5D4\uD2F0\uD2F0\uC5D0 \uB300\uD55C \uC120\uC5B8\uC5D0\uC11C\uB294 "NDATA" \uC55E\uC5D0 \uACF5\uBC31\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.
- MSG_NOTATION_NAME_REQUIRED_FOR_UNPARSED_ENTITYDECL = "{0}" \uC5D4\uD2F0\uD2F0\uC5D0 \uB300\uD55C \uC120\uC5B8\uC5D0\uC11C\uB294 "NDATA" \uB2E4\uC74C\uC5D0 \uD45C\uAE30\uBC95 \uC774\uB984\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.
- EntityDeclUnterminated = "{0}" \uC5D4\uD2F0\uD2F0\uC5D0 \uB300\uD55C \uC120\uC5B8\uC740 ''>''\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4.
- MSG_DUPLICATE_ENTITY_DEFINITION = "{0}" \uC5D4\uD2F0\uD2F0\uAC00 \uB450 \uBC88 \uC774\uC0C1 \uC120\uC5B8\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
-# 4.2.2 External Entities
- ExternalIDRequired = \uC678\uBD80 \uC5D4\uD2F0\uD2F0 \uC120\uC5B8\uC740 "SYSTEM" \uB610\uB294 "PUBLIC"\uC73C\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4.
- MSG_SPACE_REQUIRED_BEFORE_PUBIDLITERAL_IN_EXTERNALID = "PUBLIC"\uACFC \uACF5\uC6A9 \uC2DD\uBCC4\uC790 \uC0AC\uC774\uC5D0\uB294 \uACF5\uBC31\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.
- MSG_SPACE_REQUIRED_AFTER_PUBIDLITERAL_IN_EXTERNALID = \uACF5\uC6A9 \uC2DD\uBCC4\uC790\uC640 \uC2DC\uC2A4\uD15C \uC2DD\uBCC4\uC790 \uC0AC\uC774\uC5D0\uB294 \uACF5\uBC31\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.
- MSG_SPACE_REQUIRED_BEFORE_SYSTEMLITERAL_IN_EXTERNALID = "SYSTEM"\uACFC \uC2DC\uC2A4\uD15C \uC2DD\uBCC4\uC790 \uC0AC\uC774\uC5D0\uB294 \uACF5\uBC31\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.
- MSG_URI_FRAGMENT_IN_SYSTEMID = \uBD80\uBD84 \uC2DD\uBCC4\uC790\uB294 \uC2DC\uC2A4\uD15C \uC2DD\uBCC4\uC790 "{0}"\uC758 \uC77C\uBD80\uB85C \uC9C0\uC815\uB418\uC9C0 \uC54A\uC544\uC57C \uD569\uB2C8\uB2E4.
-# 4.7 Notation Declarations
- MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_NOTATIONDECL = \uD45C\uAE30\uBC95 \uC120\uC5B8\uC5D0\uC11C\uB294 "<!NOTATION" \uB2E4\uC74C\uC5D0 \uACF5\uBC31\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.
- MSG_NOTATION_NAME_REQUIRED_IN_NOTATIONDECL = \uD45C\uAE30\uBC95 \uC120\uC5B8\uC5D0\uB294 \uD45C\uAE30\uBC95 \uC774\uB984\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.
- MSG_SPACE_REQUIRED_AFTER_NOTATION_NAME_IN_NOTATIONDECL = \uD45C\uAE30\uBC95 \uC120\uC5B8\uC5D0\uC11C\uB294 \uD45C\uAE30\uBC95 \uC774\uB984 "{0}" \uB2E4\uC74C\uC5D0 \uACF5\uBC31\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.
- ExternalIDorPublicIDRequired = "{0}" \uD45C\uAE30\uBC95\uC5D0 \uB300\uD55C \uC120\uC5B8\uC5D0\uB294 \uC2DC\uC2A4\uD15C \uB610\uB294 \uACF5\uC6A9 \uC2DD\uBCC4\uC790\uAC00 \uD3EC\uD568\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- NotationDeclUnterminated = "{0}" \uD45C\uAE30\uBC95\uC5D0 \uB300\uD55C \uC120\uC5B8\uC740 ''>''\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4.
-
-# Validation messages
- DuplicateTypeInMixedContent = \uC694\uC18C \uC720\uD615 "{1}"\uC774(\uAC00) \uC694\uC18C \uC120\uC5B8 "{0}"\uC758 \uCF58\uD150\uCE20 \uBAA8\uB378\uC5D0 \uC774\uBBF8 \uC9C0\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
- ENTITIESInvalid = ENTITIES \uC720\uD615\uC758 \uC18D\uC131\uAC12 "{1}"\uC740(\uB294) \uAD6C\uBB38\uC774 \uBD84\uC11D\uB418\uC9C0 \uC54A\uC740 \uD558\uB098 \uC774\uC0C1\uC758 \uC5D4\uD2F0\uD2F0\uC5D0 \uB300\uD55C \uC774\uB984\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- ENTITYInvalid = ENTITY \uC720\uD615\uC758 \uC18D\uC131\uAC12 "{1}"\uC740(\uB294) \uAD6C\uBB38\uC774 \uBD84\uC11D\uB418\uC9C0 \uC54A\uC740 \uC5D4\uD2F0\uD2F0\uC5D0 \uB300\uD55C \uC774\uB984\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- IDDefaultTypeInvalid = ID \uC18D\uC131 "{0}"\uC758 \uC120\uC5B8\uB41C \uAE30\uBCF8\uAC12\uC740 "#IMPLIED" \uB610\uB294 "#REQUIRED"\uC5EC\uC57C \uD569\uB2C8\uB2E4.
- IDInvalid = ID \uC720\uD615\uC758 \uC18D\uC131\uAC12 "{0}"\uC740(\uB294) \uC774\uB984\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- IDInvalidWithNamespaces = \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uAC00 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uB41C \uACBD\uC6B0 ID \uC720\uD615\uC758 \uC18D\uC131\uAC12 "{0}"\uC740(\uB294) NCName\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- IDNotUnique = ID \uC720\uD615\uC758 \uC18D\uC131\uAC12 "{0}"\uC740(\uB294) \uBB38\uC11C \uB0B4\uC5D0\uC11C \uACE0\uC720\uD574\uC57C \uD569\uB2C8\uB2E4.
- IDREFInvalid = IDREF \uC720\uD615\uC758 \uC18D\uC131\uAC12 "{0}"\uC740(\uB294) \uC774\uB984\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- IDREFInvalidWithNamespaces = \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uAC00 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uB41C \uACBD\uC6B0 IDREF \uC720\uD615\uC758 \uC18D\uC131\uAC12 "{0}"\uC740(\uB294) NCName\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- IDREFSInvalid = IDREFS \uC720\uD615\uC758 \uC18D\uC131\uAC12 "{0}"\uC740(\uB294) \uD558\uB098 \uC774\uC0C1\uC758 \uC774\uB984\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- ILL_FORMED_PARAMETER_ENTITY_WHEN_USED_IN_DECL = \uC5D4\uD2F0\uD2F0 \uCC38\uC870\uAC00 \uC804\uCCB4 \uC120\uC5B8\uC73C\uB85C \uC0AC\uC6A9\uB41C \uACBD\uC6B0 \uB9E4\uAC1C\uBCC0\uC218 \uC5D4\uD2F0\uD2F0 "{0}"\uC758 \uB300\uCCB4 \uD14D\uC2A4\uD2B8\uC5D0\uB294 \uC81C\uB300\uB85C \uC911\uCCA9\uB41C \uC120\uC5B8\uC774 \uD3EC\uD568\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- ImproperDeclarationNesting = \uB9E4\uAC1C\uBCC0\uC218 \uC5D4\uD2F0\uD2F0 "{0}"\uC758 \uB300\uCCB4 \uD14D\uC2A4\uD2B8\uC5D0\uB294 \uC81C\uB300\uB85C \uC911\uCCA9\uB41C \uC120\uC5B8\uC774 \uD3EC\uD568\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- ImproperGroupNesting = \uB9E4\uAC1C\uBCC0\uC218 \uC5D4\uD2F0\uD2F0 "{0}"\uC758 \uB300\uCCB4 \uD14D\uC2A4\uD2B8\uC5D0\uB294 \uC81C\uB300\uB85C \uC911\uCCA9\uB41C \uAD04\uD638 \uC30D\uC774 \uD3EC\uD568\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- INVALID_PE_IN_CONDITIONAL = \uB9E4\uAC1C\uBCC0\uC218 \uC5D4\uD2F0\uD2F0 "{0}"\uC758 \uB300\uCCB4 \uD14D\uC2A4\uD2B8\uC5D0\uB294 \uC804\uCCB4 \uC870\uAC74\uBD80 \uC139\uC158\uC774 \uD3EC\uD568\uB418\uAC70\uB098 INCLUDE \uB610\uB294 IGNORE\uB9CC \uD3EC\uD568\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- MSG_ATTRIBUTE_NOT_DECLARED = \uC694\uC18C \uC720\uD615 "{0}"\uC5D0 \uB300\uD55C "{1}" \uC18D\uC131\uC744 \uC120\uC5B8\uD574\uC57C \uD569\uB2C8\uB2E4.
- MSG_ATTRIBUTE_VALUE_NOT_IN_LIST = \uAC12\uC774 "{1}"\uC778 "{0}" \uC18D\uC131\uC5D0\uB294 "{2}" \uBAA9\uB85D\uC758 \uAC12\uC774 \uC0AC\uC6A9\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- MSG_ATTVALUE_CHANGED_DURING_NORMALIZATION_WHEN_STANDALONE = "{0}" \uC18D\uC131\uC758 "{1}" \uAC12\uC740 \uB3C5\uB9BD\uD615 \uBB38\uC11C\uC5D0\uC11C \uC815\uADDC\uD654\uC5D0 \uC758\uD574 "{2}"(\uC73C)\uB85C \uBCC0\uACBD\uB418\uC9C0 \uC54A\uC544\uC57C \uD569\uB2C8\uB2E4.
- MSG_CONTENT_INCOMPLETE = \uC694\uC18C \uC720\uD615 "{0}"\uC758 \uCF58\uD150\uCE20\uAC00 \uBD88\uC644\uC804\uD569\uB2C8\uB2E4. \uD574\uB2F9 \uCF58\uD150\uCE20\uB294 "{1}"\uACFC(\uC640) \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4.
- MSG_CONTENT_INVALID = \uC694\uC18C \uC720\uD615 "{0}"\uC758 \uCF58\uD150\uCE20\uB294 "{1}"\uACFC(\uC640) \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4.
- MSG_CONTENT_INVALID_SPECIFIED = \uC694\uC18C \uC720\uD615 "{0}"\uC758 \uCF58\uD150\uCE20\uB294 "{1}"\uACFC(\uC640) \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4. "{2}" \uC720\uD615\uC758 \uD558\uC704 \uD56D\uBAA9\uC740 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
- MSG_DEFAULTED_ATTRIBUTE_NOT_SPECIFIED = \uC694\uC18C \uC720\uD615 "{0}"\uC5D0 \uB300\uD55C "{1}" \uC18D\uC131\uC5D0 \uAE30\uBCF8\uAC12\uC774 \uC788\uC73C\uBA70 \uB3C5\uB9BD\uD615 \uBB38\uC11C\uC5D0 \uC9C0\uC815\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- MSG_DUPLICATE_ATTDEF = \uC694\uC18C \uC720\uD615 "{0}"\uC5D0 \uB300\uD55C "{1}" \uC18D\uC131\uC774 \uC774\uBBF8 \uC120\uC5B8\uB418\uC5B4 \uC788\uC2B5\uB2C8\uB2E4.
- MSG_ELEMENT_ALREADY_DECLARED = \uC694\uC18C \uC720\uD615 "{0}"\uC740(\uB294) \uB450 \uBC88 \uC774\uC0C1 \uC120\uC5B8\uB418\uC9C0 \uC54A\uC544\uC57C \uD569\uB2C8\uB2E4.
- MSG_ELEMENT_NOT_DECLARED = \uC694\uC18C \uC720\uD615 "{0}"\uC744(\uB97C) \uC120\uC5B8\uD574\uC57C \uD569\uB2C8\uB2E4.
- MSG_GRAMMAR_NOT_FOUND = \uBB38\uC11C\uAC00 \uBD80\uC801\uD569\uD568: \uBB38\uBC95\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
- MSG_ELEMENT_WITH_ID_REQUIRED = \uC2DD\uBCC4\uC790\uAC00 "{0}"\uC778 \uC694\uC18C\uAC00 \uBB38\uC11C\uC5D0 \uB098\uD0C0\uB098\uC57C \uD569\uB2C8\uB2E4.
- MSG_EXTERNAL_ENTITY_NOT_PERMITTED = \uB3C5\uB9BD\uD615 \uBB38\uC11C\uC5D0\uC11C\uB294 \uC678\uBD80 \uC5D4\uD2F0\uD2F0 "{0}"\uC5D0 \uB300\uD55C \uCC38\uC870\uAC00 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
- MSG_FIXED_ATTVALUE_INVALID = \uAC12\uC774 "{2}"\uC778 "{1}" \uC18D\uC131\uC758 \uAC12\uC740 "{3}"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- MSG_MORE_THAN_ONE_ID_ATTRIBUTE = \uC694\uC18C \uC720\uD615 "{0}"\uC5D0 ID \uC720\uD615\uC758 "{1}" \uC18D\uC131\uC774 \uC774\uBBF8 \uC788\uC73C\uBBC0\uB85C ID \uC720\uD615\uC758 \uB450\uBC88\uC9F8 \uC18D\uC131 "{2}"\uC774(\uAC00) \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
- MSG_MORE_THAN_ONE_NOTATION_ATTRIBUTE = \uC694\uC18C \uC720\uD615 "{0}"\uC5D0 NOTATION \uC720\uD615\uC758 "{1}" \uC18D\uC131\uC774 \uC774\uBBF8 \uC788\uC73C\uBBC0\uB85C NOTATION \uC720\uD615\uC758 \uB450\uBC88\uC9F8 \uC18D\uC131 "{2}"\uC774(\uAC00) \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
- MSG_NOTATION_NOT_DECLARED_FOR_NOTATIONTYPE_ATTRIBUTE = "{1}" \uD45C\uAE30\uBC95\uC740 "{0}" \uC18D\uC131\uC5D0 \uB300\uD55C \uD45C\uAE30\uBC95 \uC720\uD615 \uBAA9\uB85D\uC5D0\uC11C \uCC38\uC870\uB418\uB294 \uACBD\uC6B0 \uC120\uC5B8\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- MSG_NOTATION_NOT_DECLARED_FOR_UNPARSED_ENTITYDECL = "{1}" \uD45C\uAE30\uBC95\uC740 "{0}"\uC5D0 \uB300\uD574 \uAD6C\uBB38\uC774 \uBD84\uC11D\uB418\uC9C0 \uC54A\uC740 \uC5D4\uD2F0\uD2F0 \uC120\uC5B8\uC5D0\uC11C \uCC38\uC870\uB418\uB294 \uACBD\uC6B0 \uC120\uC5B8\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- MSG_REFERENCE_TO_EXTERNALLY_DECLARED_ENTITY_WHEN_STANDALONE = \uB3C5\uB9BD\uD615 \uBB38\uC11C\uC5D0\uC11C\uB294 \uAD6C\uBB38\uC774 \uBD84\uC11D\uB41C \uC678\uBD80 \uC5D4\uD2F0\uD2F0\uC5D0\uC11C \uC120\uC5B8\uB41C "{0}" \uC5D4\uD2F0\uD2F0\uC5D0 \uB300\uD55C \uCC38\uC870\uAC00 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
- MSG_REQUIRED_ATTRIBUTE_NOT_SPECIFIED = "{1}" \uC18D\uC131\uC774 \uD544\uC694\uD558\uBA70 \uC694\uC18C \uC720\uD615 "{0}"\uC5D0 \uB300\uD574 \uC9C0\uC815\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- MSG_WHITE_SPACE_IN_ELEMENT_CONTENT_WHEN_STANDALONE = \uB3C5\uB9BD\uD615 \uBB38\uC11C\uC5D0\uC11C\uB294 \uC694\uC18C \uCF58\uD150\uCE20\uB97C \uAC00\uC9C0\uBA70 \uAD6C\uBB38\uC774 \uBD84\uC11D\uB41C \uC678\uBD80 \uC5D4\uD2F0\uD2F0\uC5D0\uC11C \uC120\uC5B8\uB41C \uC694\uC18C \uC0AC\uC774\uC5D0 \uACF5\uBC31\uC774 \uC5C6\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- NMTOKENInvalid = NMTOKEN \uC720\uD615\uC758 \uC18D\uC131\uAC12 "{0}"\uC740(\uB294) \uC774\uB984 \uD1A0\uD070\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- NMTOKENSInvalid = NMTOKENS \uC720\uD615\uC758 \uC18D\uC131\uAC12 "{0}"\uC740(\uB294) \uD558\uB098 \uC774\uC0C1\uC758 \uC774\uB984 \uD1A0\uD070\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- NoNotationOnEmptyElement = EMPTY\uB85C \uC120\uC5B8\uB41C \uC694\uC18C \uC720\uD615 "{0}"\uC740(\uB294) NOTATION \uC720\uD615\uC758 "{1}" \uC18D\uC131\uC744 \uC120\uC5B8\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
- RootElementTypeMustMatchDoctypedecl = \uBB38\uC11C \uB8E8\uD2B8 \uC694\uC18C "{1}"\uC740(\uB294) DOCTYPE \uB8E8\uD2B8 "{0}"\uACFC(\uC640) \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4.
- UndeclaredElementInContentSpec = "{0}" \uC694\uC18C\uC758 \uCF58\uD150\uCE20 \uBAA8\uB378\uC774 \uC120\uC5B8\uB418\uC9C0 \uC54A\uC740 \uC694\uC18C "{1}"\uC744(\uB97C) \uCC38\uC870\uD569\uB2C8\uB2E4.
- UniqueNotationName = "{0}" \uD45C\uAE30\uBC95\uC5D0 \uB300\uD55C \uC120\uC5B8\uC774 \uACE0\uC720\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. \uC81C\uACF5\uB41C \uC774\uB984\uC740 \uB450 \uAC1C \uC774\uC0C1\uC758 \uD45C\uAE30\uBC95 \uC120\uC5B8\uC5D0\uC11C \uC120\uC5B8\uB418\uC9C0 \uC54A\uC544\uC57C \uD569\uB2C8\uB2E4.
- ENTITYFailedInitializeGrammar = ENTITYDatatype \uAC80\uC99D\uAE30: \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uC801\uD569\uD55C \uBB38\uBC95 \uCC38\uC870\uB85C \uCD08\uAE30\uD654 \uBA54\uC18C\uB4DC\uB97C \uD638\uCD9C\uD574\uC57C \uD569\uB2C8\uB2E4. \t
- ENTITYNotUnparsed = ENTITY "{0}"\uC758 \uAD6C\uBB38\uC774 \uBD84\uC11D\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4.
- ENTITYNotValid = ENTITY "{0}"\uC774(\uAC00) \uBD80\uC801\uD569\uD569\uB2C8\uB2E4.
- EmptyList = ENTITIES, IDREFS \uBC0F NMTOKENS \uC720\uD615\uC758 \uAC12\uC740 \uBE48 \uBAA9\uB85D\uC77C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
-
-# Entity related messages
-# 3.1 Start-Tags, End-Tags, and Empty-Element Tags
- ReferenceToExternalEntity = \uC18D\uC131\uAC12\uC5D0\uC11C\uB294 \uC678\uBD80 \uC5D4\uD2F0\uD2F0 \uCC38\uC870 "&{0};"\uC774 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
- AccessExternalDTD = \uC678\uBD80 DTD: accessExternalDTD \uC18D\uC131\uC73C\uB85C \uC124\uC815\uB41C \uC81C\uD55C\uC73C\uB85C \uC778\uD574 ''{1}'' \uC561\uC138\uC2A4\uAC00 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC73C\uBBC0\uB85C \uC678\uBD80 DTD ''{0}'' \uC77D\uAE30\uB97C \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4.
- AccessExternalEntity = \uC678\uBD80 \uC5D4\uD2F0\uD2F0: accessExternalDTD \uC18D\uC131\uC73C\uB85C \uC124\uC815\uB41C \uC81C\uD55C\uC73C\uB85C \uC778\uD574 ''{1}'' \uC561\uC138\uC2A4\uAC00 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC73C\uBBC0\uB85C \uC678\uBD80 \uBB38\uC11C ''{0}'' \uC77D\uAE30\uB97C \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4.
-
-# 4.1 Character and Entity References
- EntityNotDeclared = "{0}" \uC5D4\uD2F0\uD2F0\uAC00 \uCC38\uC870\uB418\uC5C8\uC9C0\uB9CC \uC120\uC5B8\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4.
- ReferenceToUnparsedEntity = \uAD6C\uBB38\uC774 \uBD84\uC11D\uB418\uC9C0 \uC54A\uC740 \uC5D4\uD2F0\uD2F0 \uCC38\uC870 "&{0};"\uC740(\uB294) \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
- RecursiveReference = "{0}"\uC740(\uB294) \uC21C\uD658 \uC5D4\uD2F0\uD2F0 \uCC38\uC870\uC785\uB2C8\uB2E4(\uCC38\uC870 \uACBD\uB85C: {1}).
- RecursiveGeneralReference = "&{0};"\uC740 \uC21C\uD658 \uC77C\uBC18 \uC5D4\uD2F0\uD2F0 \uCC38\uC870\uC785\uB2C8\uB2E4(\uCC38\uC870 \uACBD\uB85C: {1}).
- RecursivePEReference = "%{0};"\uC740 \uC21C\uD658 \uB9E4\uAC1C\uBCC0\uC218 \uC5D4\uD2F0\uD2F0 \uCC38\uC870\uC785\uB2C8\uB2E4(\uCC38\uC870 \uACBD\uB85C: {1}).
-# 4.3.3 Character Encoding in Entities
- EncodingNotSupported = "{0}" \uC778\uCF54\uB529\uC740 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
- EncodingRequired = UTF-8 \uB610\uB294 UTF-16\uC73C\uB85C \uC778\uCF54\uB529\uB418\uC9C0 \uC54A\uC740 \uAD6C\uBB38\uC774 \uBD84\uC11D\uB41C \uC5D4\uD2F0\uD2F0\uC5D0\uB294 \uC778\uCF54\uB529 \uC120\uC5B8\uC774 \uD3EC\uD568\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4.
-
-# Namespaces support
-# 4. Using Qualified Names
- IllegalQName = \uC694\uC18C \uB610\uB294 \uC18D\uC131\uC774 QName \uC791\uC131\uACFC \uC77C\uCE58\uD558\uC9C0 \uC54A\uC74C: QName::=(NCName':')?NCName.
- ElementXMLNSPrefix = "{0}" \uC694\uC18C\uC5D0\uB294 "xmlns"\uAC00 \uC811\uB450\uC5B4\uB85C \uC0AC\uC6A9\uB420 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
- ElementPrefixUnbound = "{1}" \uC694\uC18C\uC5D0 \uB300\uD55C "{0}" \uC811\uB450\uC5B4\uAC00 \uBC14\uC778\uB4DC\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4.
- AttributePrefixUnbound = \uC694\uC18C \uC720\uD615 "{0}"\uACFC(\uC640) \uC5F0\uAD00\uB41C "{1}" \uC18D\uC131\uC758 "{2}" \uC811\uB450\uC5B4\uAC00 \uBC14\uC778\uB4DC\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4.
- EmptyPrefixedAttName = "{0}" \uC18D\uC131\uC758 \uAC12\uC774 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. \uC811\uB450\uC5B4\uAC00 \uC9C0\uC815\uB41C \uB124\uC784\uC2A4\uD398\uC774\uC2A4 \uBC14\uC778\uB529\uC740 \uBE44\uC6CC \uB458 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
- PrefixDeclared = \uB124\uC784\uC2A4\uD398\uC774\uC2A4 \uC811\uB450\uC5B4 "{0}"\uC774(\uAC00) \uC120\uC5B8\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4.
- CantBindXMLNS = "xmlns" \uC811\uB450\uC5B4\uB294 \uBA85\uC2DC\uC801\uC73C\uB85C \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uC5D0 \uBC14\uC778\uB4DC\uB420 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. "xmlns"\uC5D0 \uB300\uD55C \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uB3C4 \uBA85\uC2DC\uC801\uC73C\uB85C \uC811\uB450\uC5B4\uC5D0 \uBC14\uC778\uB4DC\uB420 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
- CantBindXML = "xml" \uC811\uB450\uC5B4\uB294 \uC77C\uBC18 \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uAC00 \uC544\uB2CC \uB2E4\uB978 \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uC5D0 \uBC14\uC778\uB4DC\uB420 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. "xml"\uC5D0 \uB300\uD55C \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uB3C4 "xml" \uC774\uC678\uC758 \uC811\uB450\uC5B4\uC5D0 \uBC14\uC778\uB4DC\uB420 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
- MSG_ATT_DEFAULT_INVALID = "{0}" \uC18D\uC131\uC758 defaultValue "{1}"\uC740(\uB294) \uC774 \uC18D\uC131 \uC720\uD615\uC758 \uB809\uC2DC\uCE7C \uC81C\uC57D \uC870\uAC74\uC5D0 \uB300\uD55C \uAC12\uC73C\uB85C \uBD80\uC801\uD569\uD569\uB2C8\uB2E4.
-
-# REVISIT: These need messages
- MSG_SPACE_REQUIRED_AFTER_SYSTEMLITERAL_IN_EXTERNALID=MSG_SPACE_REQUIRED_AFTER_SYSTEMLITERAL_IN_EXTERNALID
- OpenQuoteMissingInDecl=OpenQuoteMissingInDecl
- InvalidCharInLiteral=InvalidCharInLiteral
-
-
-# Implementation limits
- EntityExpansionLimit=JAXP00010001: \uAD6C\uBB38 \uBD84\uC11D\uAE30\uAC00 \uC774 \uBB38\uC11C\uC5D0\uC11C "{0}"\uAC1C\uB97C \uCD08\uACFC\uD558\uB294 \uC5D4\uD2F0\uD2F0 \uD655\uC7A5\uC744 \uBC1C\uACAC\uD588\uC2B5\uB2C8\uB2E4. \uC774\uB294 JDK\uC5D0\uC11C \uC801\uC6A9\uD558\uB294 \uC81C\uD55C\uC785\uB2C8\uB2E4.
- ElementAttributeLimit=JAXP00010002: "{0}" \uC694\uC18C\uC5D0 "{1}"\uAC1C\uB97C \uCD08\uACFC\uD558\uB294 \uC18D\uC131\uC774 \uC788\uC2B5\uB2C8\uB2E4. "{1}"\uC740(\uB294) JDK\uC5D0\uC11C \uC801\uC6A9\uD558\uB294 \uC81C\uD55C\uC785\uB2C8\uB2E4.
- MaxEntitySizeLimit=JAXP00010003: "{0}" \uC5D4\uD2F0\uD2F0\uC758 \uAE38\uC774\uAC00 "{3}"\uC5D0\uC11C \uC124\uC815\uB41C "{2}" \uC81C\uD55C\uC744 \uCD08\uACFC\uD558\uB294 "{1}"\uC785\uB2C8\uB2E4.
- TotalEntitySizeLimit=JAXP00010004: \uC5D4\uD2F0\uD2F0\uC758 \uB204\uC801 \uD06C\uAE30\uAC00 "{2}"\uC5D0\uC11C \uC124\uC815\uD55C "{1}" \uC81C\uD55C\uC744 \uCD08\uACFC\uD558\uB294 "{0}"\uC785\uB2C8\uB2E4.
- MaxXMLNameLimit=JAXP00010005: "{0}" \uC5D4\uD2F0\uD2F0\uC758 \uAE38\uC774\uAC00 "{3}"\uC5D0\uC11C \uC124\uC815\uD55C "{2}" \uC81C\uD55C\uC744 \uCD08\uACFC\uD558\uB294 "{1}"\uC785\uB2C8\uB2E4.
- MaxElementDepthLimit=JAXP00010006: "{0}" \uC694\uC18C\uC758 \uAE4A\uC774\uAC00 "{3}"\uC5D0\uC11C \uC124\uC815\uB41C "{2}" \uC81C\uD55C\uC744 \uCD08\uACFC\uD558\uB294 "{1}"\uC785\uB2C8\uB2E4.
- EntityReplacementLimit=JAXP00010007: \uC5D4\uD2F0\uD2F0 \uCC38\uC870\uC758 \uCD1D \uB178\uB4DC \uC218\uAC00 "{2}"\uC5D0\uC11C \uC124\uC815\uD55C "{1}" \uC81C\uD55C\uC744 \uCD08\uACFC\uD558\uB294 "{0}"\uC785\uB2C8\uB2E4.
-
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_pt_BR.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_pt_BR.properties
deleted file mode 100644
index 93ae48e..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_pt_BR.properties
+++ /dev/null
@@ -1,305 +0,0 @@
-# This file contains error and warning messages related to XML
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-# @version
-
- BadMessageKey = N\u00E3o foi poss\u00EDvel encontrar a mensagem de erro correspondente \u00E0 chave da mensagem.
- FormatFailed = Ocorreu um erro interno ao formatar a mensagem a seguir:\n
-
-# Document messages
- PrematureEOF=Fim prematuro do arquivo.
-# 2.1 Well-Formed XML Documents
- RootElementRequired = O elemento-raiz \u00E9 necess\u00E1rio em um documento correto.
-# 2.2 Characters
-
- InvalidCharInCDSect = Um caractere XML inv\u00E1lido (Unicode: 0x{0}) foi encontrado na se\u00E7\u00E3o CDATA.
- InvalidCharInContent = Um caractere XML inv\u00E1lido (Unicode: 0x {0}) foi encontrado no conte\u00FAdo do elemento do documento.
- TwoColonsInQName = Um segundo ':' inv\u00E1lido foi encontrado no tipo de elemento ou no nome do atributo.
- ColonNotLegalWithNS = N\u00E3o \u00E9 permitido usar dois-pontos no nome ''{0}'' quando namespaces estiverem ativados.
- InvalidCharInMisc = Um caractere XML inv\u00E1lido (Unicode: 0x {0}) foi encontrado na marca\u00E7\u00E3o ap\u00F3s o fim do conte\u00FAdo do elemento.
- InvalidCharInProlog = Um caractere XML inv\u00E1lido (Unicode: 0x {0}) foi encontrado no pr\u00F3logo do documento.
- InvalidCharInXMLDecl = Um caractere XML inv\u00E1lido (Unicode: 0x{0}) foi encontrado na declara\u00E7\u00E3o XML.
-# 2.4 Character Data and Markup
- CDEndInContent = A sequ\u00EAncia de caracteres "]]>" n\u00E3o deve aparecer no conte\u00FAdo, a menos que seja usada para marcar o fim de uma se\u00E7\u00E3o CDATA.
-# 2.7 CDATA Sections
- CDSectUnterminated = A se\u00E7\u00E3o CDATA deve terminar com "]]>".
-# 2.8 Prolog and Document Type Declaration
- XMLDeclMustBeFirst = A declara\u00E7\u00E3o XML pode aparecer somente bem no in\u00EDcio do documento.
- EqRequiredInXMLDecl = O caractere '' = '' deve estar ap\u00F3s "{0}" na declara\u00E7\u00E3o XML.
- QuoteRequiredInXMLDecl = O valor ap\u00F3s "{0}" na declara\u00E7\u00E3o XML deve ser uma string entre aspas.
- XMLDeclUnterminated = A declara\u00E7\u00E3o XML deve terminar com "?>".
- VersionInfoRequired = A vers\u00E3o \u00E9 obrigat\u00F3ria na declara\u00E7\u00E3o XML.
- SpaceRequiredBeforeVersionInXMLDecl = O espa\u00E7o em branco \u00E9 necess\u00E1rio antes do pseudo-atributo da vers\u00E3o na declara\u00E7\u00E3o XML.
- SpaceRequiredBeforeEncodingInXMLDecl = O espa\u00E7o em branco \u00E9 necess\u00E1rio antes de codificar o pseudo-atributo na declara\u00E7\u00E3o XML.
- SpaceRequiredBeforeStandalone = O espa\u00E7o em branco \u00E9 necess\u00E1rio antes de codificar o pseudo-atributo na declara\u00E7\u00E3o XML.
- MarkupNotRecognizedInProlog = A marca\u00E7\u00E3o no documento que precede o elemento-raiz deve estar correta.
- MarkupNotRecognizedInMisc = A marca\u00E7\u00E3o no documento ap\u00F3s o elemento-raiz deve estar correta.
- AlreadySeenDoctype = Tipo de documento j\u00E1 visto.
- DoctypeNotAllowed = DOCTYPE fica desativado quando o recurso "http://apache.org/xml/features/disallow-doctype-decl" \u00E9 definido como verdadeiro.
- ContentIllegalInProlog = O conte\u00FAdo n\u00E3o \u00E9 permitido no pr\u00F3logo.
- ReferenceIllegalInProlog = A refer\u00EAncia n\u00E3o \u00E9 permitida no pr\u00F3logo.
-# Trailing Misc
- ContentIllegalInTrailingMisc=O conte\u00FAdo n\u00E3o \u00E9 permitido na se\u00E7\u00E3o \u00E0 esquerda.
- ReferenceIllegalInTrailingMisc=A refer\u00EAncia n\u00E3o \u00E9 permitida na se\u00E7\u00E3o \u00E0 esquerda.
-
-# 2.9 Standalone Document Declaration
- SDDeclInvalid = O valor da declara\u00E7\u00E3o do documento stand-alone deve ser "sim" ou "n\u00E3o", mas n\u00E3o deve ser "{0}".
- SDDeclNameInvalid = O nome standalone na declara\u00E7\u00E3o XML pode estar grafado incorretamente.
-# 2.12 Language Identification
- XMLLangInvalid = O valor do atributo xml:lang "{0}" \u00E9 um identificador de idioma inv\u00E1lido.
-# 3. Logical Structures
- ETagRequired = O tipo de elemento {0}" deve ser encerrado pela tag final correspondente "</{0}>".
-# 3.1 Start-Tags, End-Tags, and Empty-Element Tags
- ElementUnterminated = O tipo de elemento "{0}" deve ser seguido pelas especifica\u00E7\u00F5es do atributo, ">" ou "/>".
- EqRequiredInAttribute = O nome do atributo "{1}" associado a um tipo de elemento "{0}" deve ser seguido do caractere '' = ''.
- OpenQuoteExpected = S\u00E3o esperadas aspas de abertura para o atributo "{1}" associado a um tipo de elemento "{0}".
- CloseQuoteExpected = S\u00E3o esperadas aspas de fechamento para o atributo "{1}" associado a um tipo de elemento "{0}".
- AttributeNotUnique = O atributo "{1}" j\u00E1 foi especificado para o elemento "{0}".
- AttributeNSNotUnique = O atributo "{1}" vinculado ao namespace "{2}" j\u00E1 foi especificado para o elemento "{0}".
- ETagUnterminated = A tag final do tipo de elemento "{0}" deve terminar com um delimitador ''>".
- MarkupNotRecognizedInContent = O conte\u00FAdo dos elementos deve consistir em dados ou marca\u00E7\u00E3o do caractere correto.
- DoctypeIllegalInContent = Um DOCTYPE n\u00E3o \u00E9 permitido no conte\u00FAdo.
-# 4.1 Character and Entity References
- ReferenceUnterminated = A refer\u00EAncia deve ser encerrada por um delimitador ';'.
-# 4.3.2 Well-Formed Parsed Entities
- ReferenceNotInOneEntity = A refer\u00EAncia deve estar totalmente contida na mesma entidade submetida a parsing.
- ElementEntityMismatch = O elemento "{0}" deve come\u00E7ar e terminar com a mesma entidade.
- MarkupEntityMismatch=As estruturas do documento XML devem come\u00E7ar e terminar com a mesma entidade.
-
-# Messages common to Document and DTD
-# 2.2 Characters
- InvalidCharInAttValue = Um caractere XML inv\u00E1lido (Unicode: 0x {2}) foi encontrado no valor do atributo "{1}" e o elemento \u00E9 "{0}".
- InvalidCharInComment = Um caractere XML inv\u00E1lido (Unicode: 0x{0}) foi encontrado no coment\u00E1rio.
- InvalidCharInPI = Um caractere XML inv\u00E1lido (Unicode: 0x{0}) foi encontrado na instru\u00E7\u00E3o de processamento.
- InvalidCharInInternalSubset = Um caractere XML inv\u00E1lido (Unicode: 0x {0}) foi encontrado no subconjunto interno do DTD.
- InvalidCharInTextDecl = Um caractere XML inv\u00E1lido (Unicode: 0x{0}) foi encontrado na declara\u00E7\u00E3o de texto.
-# 2.3 Common Syntactic Constructs
- QuoteRequiredInAttValue = O valor do atributo "{1}" deve come\u00E7ar com aspas simples ou duplas.
- LessthanInAttValue = O valor do atributo "{1}" associado a um tipo de elemento "{0}" n\u00E3o deve conter o caractere ''<''.
- AttributeValueUnterminated = O valor do atributo "{1}" deve terminar com as aspas correspondentes.
-# 2.5 Comments
- InvalidCommentStart = O coment\u00E1rio deve come\u00E7ar com "<!--".
- DashDashInComment = A string "--" n\u00E3o \u00E9 permitida nos coment\u00E1rios.
- CommentUnterminated = O coment\u00E1rio deve terminar com "-->".
- COMMENT_NOT_IN_ONE_ENTITY = O coment\u00E1rio n\u00E3o est\u00E1 entre chaves na mesma entidade.
-# 2.6 Processing Instructions
- PITargetRequired = A instru\u00E7\u00E3o de processamento deve come\u00E7ar com o nome do destino.
- SpaceRequiredInPI = O espa\u00E7o em branco \u00E9 obrigat\u00F3rio entre o destino da instru\u00E7\u00E3o de processamento e os dados.
- PIUnterminated = A instru\u00E7\u00E3o de processamento deve terminar com "?>".
- ReservedPITarget = O destino da instru\u00E7\u00E3o de processamento correspondente "[xX][mM][lL]" n\u00E3o \u00E9 permitido.
- PI_NOT_IN_ONE_ENTITY = A instru\u00E7\u00E3o de processamento n\u00E3o est\u00E1 entre chaves na mesma entidade.
-# 2.8 Prolog and Document Type Declaration
- VersionInfoInvalid = Vers\u00E3o inv\u00E1lida "{0}".
- VersionNotSupported = Vers\u00E3o XML "{0}" n\u00E3o suportada; somente XML 1.0 \u00E9 suportada.
- VersionNotSupported11 = Vers\u00E3o XML "{0}" n\u00E3o suportada, somente XML 1.0 e XML 1.1 s\u00E3o suportadas.
- VersionMismatch= Uma entidade n\u00E3o pode incluir outra entidade de uma vers\u00E3o posterior.
-# 4.1 Character and Entity References
- DigitRequiredInCharRef = Uma representa\u00E7\u00E3o decimal deve seguir imediatamente o "&#" em uma refer\u00EAncia de caractere.
- HexdigitRequiredInCharRef = Uma representa\u00E7\u00E3o hexadecimal deve seguir imediatamente o "&#" em uma refer\u00EAncia de caractere.
- SemicolonRequiredInCharRef = A refer\u00EAncia de caractere deve terminar com o delimitador ';'.
- InvalidCharRef = A refer\u00EAncia do caractere "&#{0}" \u00E9 um caractere XML inv\u00E1lido.
- NameRequiredInReference = O nome da entidade deve seguir imediatamente o '&' na refer\u00EAncia da entidade.
- SemicolonRequiredInReference = A refer\u00EAncia \u00E0 entidade "{0}" deve terminar com o delimitador '';''.
-# 4.3.1 The Text Declaration
- TextDeclMustBeFirst = A declara\u00E7\u00E3o de texto somente pode aparecer bem no in\u00EDcio da entidade externa submetida a parsing.
- EqRequiredInTextDecl = O caractere '' = '' deve estar ap\u00F3s "{0}" na declara\u00E7\u00E3o de texto.
- QuoteRequiredInTextDecl = O valor ap\u00F3s "{0}" na declara\u00E7\u00E3o de texto deve ser uma string entre aspas.
- CloseQuoteMissingInTextDecl = n\u00E3o foi encontrada a aspa de fechamento no valor ap\u00F3s "{0}" na declara\u00E7\u00E3o de texto.
- SpaceRequiredBeforeVersionInTextDecl = O espa\u00E7o em branco \u00E9 necess\u00E1rio antes do pseudo-atributo da vers\u00E3o na declara\u00E7\u00E3o de texto.
- SpaceRequiredBeforeEncodingInTextDecl = O espa\u00E7o em branco \u00E9 necess\u00E1rio antes de codificar o pseudo-atributo na declara\u00E7\u00E3o de texto.
- TextDeclUnterminated = A declara\u00E7\u00E3o de texto deve terminar com "?>".
- EncodingDeclRequired = A declara\u00E7\u00E3o de codifica\u00E7\u00E3o \u00E9 necess\u00E1ria na declara\u00E7\u00E3o de texto.
- NoMorePseudoAttributes = N\u00E3o s\u00E3o mais permitidos pseudo-atributos.
- MorePseudoAttributes = S\u00E3o esperados mais pseudo-atributos.
- PseudoAttrNameExpected = \u00C9 esperado um nome de um pseudo-atributo.
-# 4.3.2 Well-Formed Parsed Entities
- CommentNotInOneEntity = O coment\u00E1rio deve estar totalmente contido na mesma entidade submetida a parsing.
- PINotInOneEntity = A instru\u00E7\u00E3o de processamento deve estar totalmente contida na mesma entidade submetida a parsing.
-# 4.3.3 Character Encoding in Entities
- EncodingDeclInvalid = Nome da codifica\u00E7\u00E3o inv\u00E1lida "{0}".
- EncodingByteOrderUnsupported = A ordem de bytes fornecida para codifica\u00E7\u00E3o "{0}" n\u00E3o \u00E9 suportada.
- InvalidByte = Byte inv\u00E1lido {0} da sequ\u00EAncia UTF-8 do byte {1}.
- ExpectedByte = Esperava {0} byte da sequ\u00EAncia UTF-8 do byte {1}.
- InvalidHighSurrogate = Os bits substitutos altos na sequ\u00EAncia da UTF-8 n\u00E3o devem exceder 0x10 mas foi encontrado 0x{0}.
- OperationNotSupported = A opera\u00E7\u00E3o "{0}" n\u00E3o \u00E9 suportada pelo leitor {1}.
- InvalidASCII = O byte "{0}" n\u00E3o \u00E9 membro do conjunto de caracteres ASCII (7 bits).
- CharConversionFailure = Uma entidade destinada a estar em uma determinada codifica\u00E7\u00E3o n\u00E3o deve conter sequ\u00EAncias inv\u00E1lidas na referida codifica\u00E7\u00E3o.
-
-# DTD Messages
-# 2.2 Characters
- InvalidCharInEntityValue = Um caractere XML inv\u00E1lido (Unicode: 0x {0}) foi encontrado no valor da entidade da literal.
- InvalidCharInExternalSubset = Um caractere XML inv\u00E1lido (Unicode: 0x {0}) foi encontrado no subconjunto externo do DTD.
- InvalidCharInIgnoreSect = Um caractere XML inv\u00E1lido (Unicode: 0x{0}) foi encontrado na se\u00E7\u00E3o condicional exclu\u00EDda.
- InvalidCharInPublicID = Um caractere XML inv\u00E1lido (Unicode: 0x{0}) foi encontrado no identificador p\u00FAblico.
- InvalidCharInSystemID = Um caractere XML inv\u00E1lido (Unicode: 0x{0}) foi encontrado no identificador do sistema.
-# 2.3 Common Syntactic Constructs
- SpaceRequiredAfterSYSTEM = \u00C9 necess\u00E1rio um espa\u00E7o em branco ap\u00F3s a palavra-chave SYTEM na declara\u00E7\u00E3o DOCTYPE.
- QuoteRequiredInSystemID = O identificador do sistema deve come\u00E7ar com aspas simples ou duplas.
- SystemIDUnterminated = O identificador do sistema deve terminar com as aspas correspondentes.
- SpaceRequiredAfterPUBLIC = S\u00E3o necess\u00E1rios espa\u00E7os em branco ap\u00F3s a palavra-chave PUBLIC na declara\u00E7\u00E3o DOCTYPE.
- QuoteRequiredInPublicID = O identificador p\u00FAblico deve come\u00E7ar com aspas simples ou duplas.
- PublicIDUnterminated = O identificador p\u00FAblico deve terminar com as aspas correspondentes.
- PubidCharIllegal = O caractere XML (Unicode: 0x{0}) n\u00E3o \u00E9 permitido no identificador p\u00FAblico.
- SpaceRequiredBetweenPublicAndSystem = Espa\u00E7os em branco s\u00E3o necess\u00E1rios entre publicId e systemId.
-# 2.8 Prolog and Document Type Declaration
- MSG_SPACE_REQUIRED_BEFORE_ROOT_ELEMENT_TYPE_IN_DOCTYPEDECL = O espa\u00E7o em branco \u00E9 necess\u00E1rio ap\u00F3s "<!DOCTYPE" na declara\u00E7\u00E3o do tipo de documento.
- MSG_ROOT_ELEMENT_TYPE_REQUIRED = O tipo de elemento-raiz deve aparecer ap\u00F3s "<!DOCTYPE" na declara\u00E7\u00E3o do tipo de documento.
- DoctypedeclUnterminated = A declara\u00E7\u00E3o do tipo de documento do tipo de elemento "{0}" deve terminar com ''>''.
- DoctypedeclNotClosed = A declara\u00E7\u00E3o do tipo de documento do tipo de elemento "{0}" deve terminar com '']''.
- PEReferenceWithinMarkup = A refer\u00EAncia da entidade do par\u00E2metro "%{0};" n\u00E3o pode ocorrer na marca\u00E7\u00E3o no subconjunto interno do DTD.
- MSG_MARKUP_NOT_RECOGNIZED_IN_DTD = As declara\u00E7\u00F5es de marca\u00E7\u00E3o contidas ou apontadas pela declara\u00E7\u00E3o do tipo de documento devem estar corretas.
-# 2.10 White Space Handling
- MSG_XML_SPACE_DECLARATION_ILLEGAL = Deve ser fornecida a declara\u00E7\u00E3o do atributo para "xml:space" como um tipo enumerado, cujo os \u00FAnicos valores poss\u00EDveis s\u00E3o "padr\u00E3o" e "preserve".
-# 3.2 Element Type Declarations
- MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ELEMENTDECL = O espa\u00E7o em branco \u00E9 necess\u00E1rio ap\u00F3s "<!ELEMENT" na declara\u00E7\u00E3o do tipo de elemento.
- MSG_ELEMENT_TYPE_REQUIRED_IN_ELEMENTDECL = O tipo de elemento \u00E9 necess\u00E1rio na declara\u00E7\u00E3o do tipo de elemento.
- MSG_SPACE_REQUIRED_BEFORE_CONTENTSPEC_IN_ELEMENTDECL = O espa\u00E7o em branco \u00E9 necess\u00E1rio ap\u00F3s o tipo de elemento "{0}" na declara\u00E7\u00E3o do tipo de elemento.
- MSG_CONTENTSPEC_REQUIRED_IN_ELEMENTDECL = A restri\u00E7\u00E3o \u00E9 necess\u00E1ria ap\u00F3s o tipo de elemento "{0}" na declara\u00E7\u00E3o do tipo de elemento.
- ElementDeclUnterminated = A declara\u00E7\u00E3o do tipo de elemento "{0}" deve terminar com ''>''.
-# 3.2.1 Element Content
- MSG_OPEN_PAREN_OR_ELEMENT_TYPE_REQUIRED_IN_CHILDREN = \u00C9 necess\u00E1rio um caractere ''('' ou um tipo de elemento na declara\u00E7\u00E3o do tipo de elemento "{0}".
- MSG_CLOSE_PAREN_REQUIRED_IN_CHILDREN = \u00C9 necess\u00E1rio um caractere '')'' na declara\u00E7\u00E3o do tipo de elemento "{0}".
-# 3.2.2 Mixed Content
- MSG_ELEMENT_TYPE_REQUIRED_IN_MIXED_CONTENT = \u00C9 necess\u00E1rio um tipo de elemento na declara\u00E7\u00E3o do tipo de elemento "{0}".
- MSG_CLOSE_PAREN_REQUIRED_IN_MIXED = \u00C9 necess\u00E1rio um caractere '')'' na declara\u00E7\u00E3o do tipo de elemento "{0}".
- MixedContentUnterminated = O modelo de conte\u00FAdo misto "{0}" deve terminar com ")*" quando os tipos de elementos filhos forem restringidos.
-# 3.3 Attribute-List Declarations
- MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ATTLISTDECL = O espa\u00E7o em branco \u00E9 necess\u00E1rio ap\u00F3s "<!ATTLIST" na declara\u00E7\u00E3o da lista de atributos.
- MSG_ELEMENT_TYPE_REQUIRED_IN_ATTLISTDECL = \u00C9 necess\u00E1rio o tipo de elemento na declara\u00E7\u00E3o da lista de atributos.
- MSG_SPACE_REQUIRED_BEFORE_ATTRIBUTE_NAME_IN_ATTDEF = \u00C9 necess\u00E1rio o espa\u00E7o em branco antes do nome do atributo na declara\u00E7\u00E3o da lista de atributos do elemento "{0}".
- AttNameRequiredInAttDef = O nome do atributo deve ser especificado na declara\u00E7\u00E3o da lista de atributos do elemento "{0}".
- MSG_SPACE_REQUIRED_BEFORE_ATTTYPE_IN_ATTDEF = \u00C9 necess\u00E1rio o espa\u00E7o em branco antes do tipo de atributo na declara\u00E7\u00E3o do atributo "{1}" do elemento "{0}".
- AttTypeRequiredInAttDef = \u00C9 necess\u00E1rio o tipo de atributo na declara\u00E7\u00E3o do atributo "{1}" do elemento "{0}".
- MSG_SPACE_REQUIRED_BEFORE_DEFAULTDECL_IN_ATTDEF = \u00C9 necess\u00E1rio o espa\u00E7o em branco antes do padr\u00E3o do atributo na declara\u00E7\u00E3o do atributo "{1}" do elemento "{0}".
- MSG_DUPLICATE_ATTRIBUTE_DEFINITION = Mais de uma defini\u00E7\u00E3o de atributo fornecida para o mesmo atributo "{1}" de um determinado elemento "{0}".
-# 3.3.1 Attribute Types
- MSG_SPACE_REQUIRED_AFTER_NOTATION_IN_NOTATIONTYPE = O espa\u00E7o em branco deve aparecer ap\u00F3s "NOTATION" na declara\u00E7\u00E3o do atributo "{1}".
- MSG_OPEN_PAREN_REQUIRED_IN_NOTATIONTYPE = O caractere ''('' deve estar ap\u00F3s "NOTATION" na declara\u00E7\u00E3o do atributo "{1}".
- MSG_NAME_REQUIRED_IN_NOTATIONTYPE = \u00C9 necess\u00E1rio o nome da nota\u00E7\u00E3o na lista de tipos de nota\u00E7\u00E3o para a declara\u00E7\u00E3o do atributo "{1}".
- NotationTypeUnterminated = A lista de tipos de nota\u00E7\u00E3o deve terminar com '')'' na declara\u00E7\u00E3o do atributo "{1}".
- MSG_NMTOKEN_REQUIRED_IN_ENUMERATION = O token do nome \u00E9 obrigat\u00F3rio na lista de tipos enumerada para a declara\u00E7\u00E3o do atributo "{1}".
- EnumerationUnterminated = A lista de tipos enumerada deve terminar com '')'' na declara\u00E7\u00E3o do atributo "{1}".
- MSG_DISTINCT_TOKENS_IN_ENUMERATION = O valor da enumera\u00E7\u00E3o "{1}" foi especificado mais de uma vez na declara\u00E7\u00E3o do atributo "{2}" do elemento "{0}". Os NMTOKENS em uma declara\u00E7\u00E3o de atributo de Enumera\u00E7\u00E3o \u00FAnica devem ser todos distintos.
- MSG_DISTINCT_NOTATION_IN_ENUMERATION = O valor da enumera\u00E7\u00E3o "{1}" foi especificado mais de uma vez na declara\u00E7\u00E3o do atributo "{2}" do elemento "{0}". Os nomes da NOTATION em uma declara\u00E7\u00E3o do atributo NotationType \u00FAnica devem ser todos distintos.
-# 3.3.2 Attribute Defaults
- MSG_SPACE_REQUIRED_AFTER_FIXED_IN_DEFAULTDECL = O espa\u00E7o em branco deve aparecer ap\u00F3s "FIXED" na declara\u00E7\u00E3o do atributo "{1}".
-# 3.4 Conditional Sections
- IncludeSectUnterminated = A se\u00E7\u00E3o condicional inclu\u00EDda deve terminar com "]]>".
- IgnoreSectUnterminated = A se\u00E7\u00E3o condicional exclu\u00EDda deve terminar com "]]>".
-# 4.1 Character and Entity References
- NameRequiredInPEReference = O nome da entidade deve seguir imediatamente o '%' na refer\u00EAncia da entidade do par\u00E2metro.
- SemicolonRequiredInPEReference = A refer\u00EAncia da entidade do par\u00E2metro "%{0};" deve terminar com o delimitador '';".
-# 4.2 Entity Declarations
- MSG_SPACE_REQUIRED_BEFORE_ENTITY_NAME_IN_ENTITYDECL = O espa\u00E7o em branco \u00E9 necess\u00E1rio ap\u00F3s "<!ENTITY" na declara\u00E7\u00E3o da entidade.
- MSG_SPACE_REQUIRED_BEFORE_PERCENT_IN_PEDECL = O espa\u00E7o em branco \u00E9 necess\u00E1rio entre "<!ENTITY" e o caractere '%' na declara\u00E7\u00E3o da entidade do par\u00E2metro.
- MSG_SPACE_REQUIRED_BEFORE_ENTITY_NAME_IN_PEDECL = O espa\u00E7o em branco \u00E9 necess\u00E1rio entre '%' e o nome da entidade na declara\u00E7\u00E3o da entidade do par\u00E2metro.
- MSG_ENTITY_NAME_REQUIRED_IN_ENTITYDECL = O nome da entidade \u00E9 necess\u00E1rio na declara\u00E7\u00E3o da entidade.
- MSG_SPACE_REQUIRED_AFTER_ENTITY_NAME_IN_ENTITYDECL = O espa\u00E7o em branco \u00E9 necess\u00E1rio entre o nome da entidade "{0}" e a defini\u00E7\u00E3o da declara\u00E7\u00E3o da entidade.
- MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_UNPARSED_ENTITYDECL = \u00C9 necess\u00E1rio um espa\u00E7o em branco entre "NDATA" e o nome da nota\u00E7\u00E3o na declara\u00E7\u00E3o da entidade "{0}".
- MSG_SPACE_REQUIRED_BEFORE_NDATA_IN_UNPARSED_ENTITYDECL = O espa\u00E7o em branco \u00E9 necess\u00E1rio antes de "NDATA" na declara\u00E7\u00E3o da entidade "{0}".
- MSG_NOTATION_NAME_REQUIRED_FOR_UNPARSED_ENTITYDECL = O nome da nota\u00E7\u00E3o \u00E9 necess\u00E1rio ap\u00F3s "NDATA" na declara\u00E7\u00E3o da entidade "{0}".
- EntityDeclUnterminated = A declara\u00E7\u00E3o da entidade "{0}" deve terminar com ''>''.
- MSG_DUPLICATE_ENTITY_DEFINITION = A entidade "{0}" foi declarada mais de uma vez.
-# 4.2.2 External Entities
- ExternalIDRequired = A declara\u00E7\u00E3o da entidade externa deve come\u00E7ar com "SYSTEM" ou "PUBLIC".
- MSG_SPACE_REQUIRED_BEFORE_PUBIDLITERAL_IN_EXTERNALID = O espa\u00E7o em branco \u00E9 necess\u00E1rio entre "PUBLIC" e o identificador p\u00FAblico.
- MSG_SPACE_REQUIRED_AFTER_PUBIDLITERAL_IN_EXTERNALID = O espa\u00E7o em branco \u00E9 necess\u00E1rio entre o identificador p\u00FAblico e o identificador do sistema.
- MSG_SPACE_REQUIRED_BEFORE_SYSTEMLITERAL_IN_EXTERNALID = O espa\u00E7o em branco \u00E9 necess\u00E1rio entre "SYSTEM" e o identificador do sistema.
- MSG_URI_FRAGMENT_IN_SYSTEMID = O identificador do fragmento n\u00E3o deve ser especificado como parte do identificador do sistema "{0}".
-# 4.7 Notation Declarations
- MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_NOTATIONDECL = O espa\u00E7o em branco \u00E9 necess\u00E1rio ap\u00F3s "<!NOTATION" na declara\u00E7\u00E3o da nota\u00E7\u00E3o.
- MSG_NOTATION_NAME_REQUIRED_IN_NOTATIONDECL = O nome da nota\u00E7\u00E3o \u00E9 obrigat\u00F3rio na declara\u00E7\u00E3o de nota\u00E7\u00E3o.
- MSG_SPACE_REQUIRED_AFTER_NOTATION_NAME_IN_NOTATIONDECL = O espa\u00E7o em branco \u00E9 necess\u00E1rio ap\u00F3s o nome da nota\u00E7\u00E3o "{0}" na declara\u00E7\u00E3o de nota\u00E7\u00E3o.
- ExternalIDorPublicIDRequired = A declara\u00E7\u00E3o da nota\u00E7\u00E3o "{0}" deve incluir um identificador p\u00FAblico ou do sistema.
- NotationDeclUnterminated = A declara\u00E7\u00E3o da nota\u00E7\u00E3o "{0}" deve terminar com ''>''.
-
-# Validation messages
- DuplicateTypeInMixedContent = O tipo de elemento "{1}" j\u00E1 foi especificado no modelo de conte\u00FAdo da declara\u00E7\u00E3o do elemento "{0}".
- ENTITIESInvalid = O valor do atributo "{1}" do tipo ENTITIES deve ser o nome de uma ou mais entidades n\u00E3o submetidas a parsing.
- ENTITYInvalid = O valor do atributo "{1}" do tipo ENTITY deve ser o nome de uma entidade n\u00E3o submetida a parsing.
- IDDefaultTypeInvalid = O atributo do ID "{0}" deve ter um padr\u00E3o declarado "#IMPLIED" ou "#REQUIRED".
- IDInvalid = O valor do atributo "{0}" do ID de tipo deve ser um nome.
- IDInvalidWithNamespaces = O valor do atributo "{0}" do ID de tipo deve ser um NCName quando os namespaces estiverem ativados.
- IDNotUnique = O valor do atributo "{0}" do ID de tipo deve ser exclusivo no documento.
- IDREFInvalid = O valor do atributo "{0}" do IDREF de tipo deve ser um nome.
- IDREFInvalidWithNamespaces = O valor do atributo "{0}" do IDREF de tipo deve ser um NCName quando os namespaces estiverem ativados.
- IDREFSInvalid = O valor do atributo "{0}" de tipo IDREFS deve ter um ou mais nomes.
- ILL_FORMED_PARAMETER_ENTITY_WHEN_USED_IN_DECL = O texto de substitui\u00E7\u00E3o da entidade do par\u00E2metro "{0}" deve incluir as declara\u00E7\u00F5es aninhadas corretamente quando a refer\u00EAncia da entidade for usada como uma declara\u00E7\u00E3o completa.
- ImproperDeclarationNesting = O texto de substitui\u00E7\u00E3o da entidade do par\u00E2metro "{0}" deve incluir as declara\u00E7\u00F5es aninhadas corretamente.
- ImproperGroupNesting = O texto de substitui\u00E7\u00E3o da entidade do par\u00E2metro "{0}" deve incluir pares de par\u00EAnteses aninhados corretamente.
- INVALID_PE_IN_CONDITIONAL = O texto de substitui\u00E7\u00E3o da entidade do par\u00E2metro "{0}" deve incluir a se\u00E7\u00E3o condicional inteira ou apenas INCLUDE ou IGNORE.
- MSG_ATTRIBUTE_NOT_DECLARED = O atributo "{1}" deve ser declarado para o tipo de elemento "{0}".
- MSG_ATTRIBUTE_VALUE_NOT_IN_LIST = O atributo "{0}" com o valor "{1}" deve ter um valor da lista "{2}".
- MSG_ATTVALUE_CHANGED_DURING_NORMALIZATION_WHEN_STANDALONE = O valor "{1}" do atributo "{0}" n\u00E3o deve ser alterado por meio da normaliza\u00E7\u00E3o (para "{2}") em um documento stand-alone.
- MSG_CONTENT_INCOMPLETE = O conte\u00FAdo do tipo de elemento "{0}" est\u00E1 incompleto; ele deve corresponder a "{1}".
- MSG_CONTENT_INVALID = O conte\u00FAdo do tipo de elemento "{0}" deve corresponder a "{1}".
- MSG_CONTENT_INVALID_SPECIFIED = O conte\u00FAdo do tipo de elemento "{0}" deve corresponder a "{1}". N\u00E3o s\u00E3o permitidos os filhos do tipo "{2}".
- MSG_DEFAULTED_ATTRIBUTE_NOT_SPECIFIED = O atributo "{1}" do tipo de elemento "{0}" tem um valor padr\u00E3o e deve ser especificado em um documento stand-alone.
- MSG_DUPLICATE_ATTDEF = O atributo "{1}" j\u00E1 foi declarado para o tipo de elemento "{0}".
- MSG_ELEMENT_ALREADY_DECLARED = O tipo de elemento "{0}" n\u00E3o deve ser declarado mais de uma vez.
- MSG_ELEMENT_NOT_DECLARED = O tipo de elemento "{0}" deve ser declarado.
- MSG_GRAMMAR_NOT_FOUND = O documento \u00E9 inv\u00E1lido: nenhuma gram\u00E1tica encontrada.
- MSG_ELEMENT_WITH_ID_REQUIRED = Um elemento com o identificador "{0}" deve aparecer no documento.
- MSG_EXTERNAL_ENTITY_NOT_PERMITTED = A refer\u00EAncia \u00E0 entidade externa "{0}" n\u00E3o \u00E9 permitida em um documento stand-alone.
- MSG_FIXED_ATTVALUE_INVALID = O atributo "{1}" com o valor "{2}" deve ter um valor "{3}".
- MSG_MORE_THAN_ONE_ID_ATTRIBUTE = O tipo de elemento "{0}" j\u00E1 tem o atributo "{1}" do ID do tipo; um segundo atributo "{2}" do ID de tipo n\u00E3o \u00E9 permitido.
- MSG_MORE_THAN_ONE_NOTATION_ATTRIBUTE = O tipo de elemento "{0}" j\u00E1 tem o atributo "{1}" do tipo NOTATION; um segundo atributo "{2}" do tipo NOTATION n\u00E3o \u00E9 permitido.
- MSG_NOTATION_NOT_DECLARED_FOR_NOTATIONTYPE_ATTRIBUTE = A nota\u00E7\u00E3o "{1}" deve ser declarada quando referenciada na lista de tipos de nota\u00E7\u00E3o do atributo "{0}".
- MSG_NOTATION_NOT_DECLARED_FOR_UNPARSED_ENTITYDECL = A nota\u00E7\u00E3o "{1}" deve ser declarada quando referenciada na declara\u00E7\u00E3o da entidade n\u00E3o submetida a parsing para "{0}".
- MSG_REFERENCE_TO_EXTERNALLY_DECLARED_ENTITY_WHEN_STANDALONE = A refer\u00EAncia \u00E0 entidade "{0}" declarada em uma entidade externa submetida a parsing n\u00E3o \u00E9 permitida em um documento stand-alone.
- MSG_REQUIRED_ATTRIBUTE_NOT_SPECIFIED = O atributo "{1}" \u00E9 necess\u00E1rio e deve ser especificado para o tipo de elemento "{0}".
- MSG_WHITE_SPACE_IN_ELEMENT_CONTENT_WHEN_STANDALONE = N\u00E3o deve haver espa\u00E7o em branco entre os elementos declarados em uma entidade externa submetida a parsing com o conte\u00FAdo do elemento em um documento stand-alone.
- NMTOKENInvalid = O valor do atributo "{0}" do tipo NMTOKEN deve ser um token de nome.
- NMTOKENSInvalid = O valor do atributo "{0}" do tipo NMTOKENS deve ter um ou mais tokens de nome.
- NoNotationOnEmptyElement = O tipo de elemento "{0}" que foi declarado EMPTY n\u00E3o pode declarar o atributo "{1}" do tipo NOTATION.
- RootElementTypeMustMatchDoctypedecl = O elemento-raiz do documento "{1}" deve corresponder \u00E0 raiz de DOCTYPE "{0}".
- UndeclaredElementInContentSpec = O modelo do conte\u00FAdo do elemento "{0}" refere-se ao elemento n\u00E3o declarado "{1}".
- UniqueNotationName = A declara\u00E7\u00E3o da nota\u00E7\u00E3o "{0}" n\u00E3o \u00E9 exclusiva. Um Nome fornecido n\u00E3o deve ser declarado em mais de uma declara\u00E7\u00E3o de nota\u00E7\u00E3o.
- ENTITYFailedInitializeGrammar = Validador de ENTITYDatatype: Falha ao chamar o m\u00E9todo de inicializa\u00E7\u00E3o com uma refer\u00EAncia de Gram\u00E1tica v\u00E1lida. \t
- ENTITYNotUnparsed = ENTITY "{0}" n\u00E3o \u00E9 submetida a parsing.
- ENTITYNotValid = ENTITY "{0}" n\u00E3o \u00E9 v\u00E1lida.
- EmptyList = O valor dos tipos ENTITIES, IDREFS e NMTOKENS n\u00E3o pode estar na lista vazia.
-
-# Entity related messages
-# 3.1 Start-Tags, End-Tags, and Empty-Element Tags
- ReferenceToExternalEntity = A refer\u00EAncia da entidade externa "&{0};" n\u00E3o \u00E9 permitida em um valor do atributo.
- AccessExternalDTD = DTD Externo: falha ao ler o DTD ''{0}'' externo porque o acesso a ''{1}'' n\u00E3o \u00E9 permitido em decorr\u00EAncia de uma restri\u00E7\u00E3o definida pela propriedade accessExternalDTD.
- AccessExternalEntity = Entidade Externa: falha ao ler o documento ''{0}'' externo porque o acesso a ''{1}'' n\u00E3o \u00E9 permitido em decorr\u00EAncia de uma restri\u00E7\u00E3o definida pela propriedade accessExternalDTD.
-
-# 4.1 Character and Entity References
- EntityNotDeclared = A entidade "{0}" foi referenciada, mas n\u00E3o declarada.
- ReferenceToUnparsedEntity = A refer\u00EAncia da entidade n\u00E3o submetida a parsing "&{0};" n\u00E3o \u00E9 permitida.
- RecursiveReference = Refer\u00EAncia da entidade recursiva "{0}". (Caminho de refer\u00EAncia: {1}),
- RecursiveGeneralReference = Refer\u00EAncia geral da entidade recursiva "&{0};". (Caminho de refer\u00EAncia: {1}),
- RecursivePEReference = Refer\u00EAncia da entidade do par\u00E2metro recursivo "%{0};". (Caminho de refer\u00EAncia: {1}),
-# 4.3.3 Character Encoding in Entities
- EncodingNotSupported = A codifica\u00E7\u00E3o "{0}" n\u00E3o \u00E9 suportada.
- EncodingRequired = Uma entidade submetida a parsing n\u00E3o codificada em UTF-8 nem em UTF-16 deve conter uma declara\u00E7\u00E3o de codifica\u00E7\u00E3o.
-
-# Namespaces support
-# 4. Using Qualified Names
- IllegalQName = O elemento ou o atributo n\u00E3o correspondem \u00E0 produ\u00E7\u00E3o QName: QName::=(NCName':')?NCName.
- ElementXMLNSPrefix = O elemento "{0}" n\u00E3o pode ter "xmlns" como seu prefixo.
- ElementPrefixUnbound = O prefixo "{0}" do elemento "{1}" n\u00E3o est\u00E1 vinculado.
- AttributePrefixUnbound = O prefixo "{2}" do atributo "{1}" associado a um tipo de elemento "{0}" n\u00E3o est\u00E1 vinculado.
- EmptyPrefixedAttName = O valor do atributo "{0}" \u00E9 inv\u00E1lido. Associa\u00E7\u00F5es de namespace prefixadas n\u00E3o podem ficar vazias.
- PrefixDeclared = O prefixo do namespace "{0}" n\u00E3o foi declarado.
- CantBindXMLNS = O prefixo "xmlns" n\u00E3o pode ser vinculado a um namespace explicitamente, assim como o namespace de "xmlns" n\u00E3o pode ser vinculado a um prefixo explicitamente.
- CantBindXML = O prefixo "xml" n\u00E3o pode ser vinculado a um namespace diferente do namespace comum, assim como o namespace de "xml" n\u00E3o pode ser vinculado a um prefixo diferente de "xml".
- MSG_ATT_DEFAULT_INVALID = O defaultValue "{1}" do atributo "{0}" n\u00E3o \u00E9 v\u00E1lido para as restri\u00E7\u00F5es l\u00E9xicas deste tipo de atributo.
-
-# REVISIT: These need messages
- MSG_SPACE_REQUIRED_AFTER_SYSTEMLITERAL_IN_EXTERNALID=MSG_SPACE_REQUIRED_AFTER_SYSTEMLITERAL_IN_EXTERNALID
- OpenQuoteMissingInDecl=OpenQuoteMissingInDecl
- InvalidCharInLiteral=InvalidCharInLiteral
-
-
-# Implementation limits
- EntityExpansionLimit=JAXP00010001: O parser detectou mais de "{0}" expans\u00F5es da entidade neste documento. Este \u00E9 o limite imposto pelo JDK.
- ElementAttributeLimit=JAXP00010002: o elemento "{0}" tem mais de "{1}" atributos. "{1}" \u00E9 o limite imposto pelo JDK.
- MaxEntitySizeLimit=JAXP00010003: o tamanho da entidade "{0}" \u00E9 "{1}", o que excede o limite de "{2}" definido por "{3}".
- TotalEntitySizeLimit=JAXP00010004: o tamanho acumulado de entidades \u00E9 "{0}", o que excedeu o limite de "{1}" definido por "{2}".
- MaxXMLNameLimit=JAXP00010005: o tamanho da entidade "{0}" \u00E9 "{1}", o que excede o limite de "{2}" definido por "{3}".
- MaxElementDepthLimit=JAXP00010006: o elemento "{0}" tem uma profundidade de "{1}" que excede o limite de "{2}" definido por "{3}".
- EntityReplacementLimit=JAXP00010007: O n\u00FAmero total de n\u00F3s nas refer\u00EAncias da entidade \u00E9 de "{0}", o que est\u00E1 acima do limite de "{1}" definido por "{2}".
-
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_sv.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_sv.properties
deleted file mode 100644
index 4f54e5f..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_sv.properties
+++ /dev/null
@@ -1,305 +0,0 @@
-# This file contains error and warning messages related to XML
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-# @version
-
- BadMessageKey = Hittar inte felmeddelandet som motsvarar meddelandenyckeln.
- FormatFailed = Ett internt fel intr\u00E4ffade vid formatering av f\u00F6ljande meddelande:\n
-
-# Document messages
- PrematureEOF=Filen har avslutats f\u00F6r tidigt.
-# 2.1 Well-Formed XML Documents
- RootElementRequired = Rotelementet kr\u00E4vs i ett v\u00E4lformulerat dokument.
-# 2.2 Characters
-
- InvalidCharInCDSect = Ett ogiltigt XML-tecken (Unicode: 0x{0}) hittades i CDATA-sektionen.
- InvalidCharInContent = Ett ogiltigt XML-tecken (Unicode: 0x{0}) hittades i dokumentets elementinneh\u00E5ll.
- TwoColonsInQName = En ogiltig andra f\u00F6rekomst av ':' hittades i elementtyp eller attributnamn.
- ColonNotLegalWithNS = Kolon \u00E4r inte till\u00E5tet i namnet ''{0}'' om namnrymder \u00E4r aktiverade.
- InvalidCharInMisc = Ett ogiltigt XML-tecken (Unicode: 0x{0}) hittades i kodtext efter elementinneh\u00E5llet.
- InvalidCharInProlog = Ett ogiltigt XML-tecken (Unicode: 0x{0}) hittades i dokumentets prolog.
- InvalidCharInXMLDecl = Ett ogiltigt XML-tecken (Unicode: 0x{0}) hittades i XML-deklarationen.
-# 2.4 Character Data and Markup
- CDEndInContent = Teckensekvensen "]]>" f\u00E5r inte f\u00F6rekomma i inneh\u00E5llet, s\u00E5vida det inte anv\u00E4nds f\u00F6r att markera slut av CDATA-sektion.
-# 2.7 CDATA Sections
- CDSectUnterminated = CDATA-sektionen m\u00E5ste sluta med "]]>".
-# 2.8 Prolog and Document Type Declaration
- XMLDeclMustBeFirst = XML-deklarationen f\u00E5r endast f\u00F6rekomma allra \u00F6verst i dokumentet.
- EqRequiredInXMLDecl = Tecknet '' = '' m\u00E5ste anges efter "{0}" i XML-deklarationen.
- QuoteRequiredInXMLDecl = V\u00E4rdet som f\u00F6ljer "{0}" i XML-deklarationen m\u00E5ste omges av citattecken.
- XMLDeclUnterminated = XML-deklarationen m\u00E5ste avslutas med "?>".
- VersionInfoRequired = Versionen kr\u00E4vs i XML-deklarationen.
- SpaceRequiredBeforeVersionInXMLDecl = Tomt utrymme kr\u00E4vs f\u00F6re versionens pseudoattribut i XML-deklarationen.
- SpaceRequiredBeforeEncodingInXMLDecl = Tomt utrymme kr\u00E4vs f\u00F6re kodningens pseudoattribut i XML-deklarationen.
- SpaceRequiredBeforeStandalone = Tomt utrymme kr\u00E4vs f\u00F6re kodningens pseudoattribut i XML-deklarationen.
- MarkupNotRecognizedInProlog = Dokumentets kodtext f\u00F6re rotelementet m\u00E5ste vara v\u00E4lformulerad.
- MarkupNotRecognizedInMisc = Dokumentets kodtext efter rotelementet m\u00E5ste vara v\u00E4lformulerad.
- AlreadySeenDoctype = DOCTYPE har redan tagits emot.
- DoctypeNotAllowed = DOCTYPE \u00E4r inte till\u00E5tet om funktionen "http://apache.org/xml/features/disallow-doctype-decl" anges som true.
- ContentIllegalInProlog = Inneh\u00E5llet \u00E4r inte till\u00E5tet i prologen.
- ReferenceIllegalInProlog = Referensen \u00E4r inte till\u00E5ten i prologen.
-# Trailing Misc
- ContentIllegalInTrailingMisc=Inneh\u00E5llet \u00E4r inte till\u00E5tet i efterf\u00F6ljande sektion.
- ReferenceIllegalInTrailingMisc=Referensen \u00E4r inte till\u00E5ten i efterf\u00F6ljande sektion.
-
-# 2.9 Standalone Document Declaration
- SDDeclInvalid = Deklarationsv\u00E4rdet f\u00F6r frist\u00E5ende dokument m\u00E5ste vara "yes" eller "no", inte "{0}".
- SDDeclNameInvalid = Det frist\u00E5ende namnet i XML-deklarationen kan vara felstavat.
-# 2.12 Language Identification
- XMLLangInvalid = Attributv\u00E4rdet "{0}" f\u00F6r xml:lang \u00E4r en ogiltig spr\u00E5kidentifierare.
-# 3. Logical Structures
- ETagRequired = Elementtyp "{0}" m\u00E5ste avslutas med matchande sluttagg "</{0}>".
-# 3.1 Start-Tags, End-Tags, and Empty-Element Tags
- ElementUnterminated = Elementtyp "{0}" m\u00E5ste f\u00F6ljas av n\u00E5gondera av attributspecifikationerna ">" eller "/>".
- EqRequiredInAttribute = Attributnamnet "{1}" som associeras med elementtyp "{0}" m\u00E5ste f\u00F6ljas av likhetstecknet ('' = '').
- OpenQuoteExpected = \u00D6ppningscitattecken f\u00F6rv\u00E4ntas f\u00F6r attributet "{1}" som associeras med elementtyp "{0}".
- CloseQuoteExpected = Slutcitattecken f\u00F6rv\u00E4ntas f\u00F6r attributet "{1}" som associeras med elementtyp "{0}".
- AttributeNotUnique = Attributet "{1}" har redan angetts f\u00F6r elementet "{0}".
- AttributeNSNotUnique = Attributet "{1}" bundet till namnrymden "{2}" har redan angetts f\u00F6r elementet "{0}".
- ETagUnterminated = Sluttaggen f\u00F6r elementtyp "{0}" m\u00E5ste avslutas med en ''>''-avgr\u00E4nsare.
- MarkupNotRecognizedInContent = Elementinneh\u00E5llet m\u00E5ste best\u00E5 av v\u00E4lformulerad(e) teckendata eller kodtext.
- DoctypeIllegalInContent = DOCTYPE \u00E4r inte till\u00E5tet i inneh\u00E5llet.
-# 4.1 Character and Entity References
- ReferenceUnterminated = Referensen m\u00E5ste avslutas med en ';'-avgr\u00E4nsare.
-# 4.3.2 Well-Formed Parsed Entities
- ReferenceNotInOneEntity = Referensen m\u00E5ste finnas med inom samma tolkade enhet.
- ElementEntityMismatch = Elementet "{0}" m\u00E5ste b\u00F6rja och sluta inom samma enhet.
- MarkupEntityMismatch=XML-dokumentstrukturer m\u00E5ste b\u00F6rja och sluta inom samma enhet.
-
-# Messages common to Document and DTD
-# 2.2 Characters
- InvalidCharInAttValue = Ett ogiltigt XML-tecken (Unicode: 0x{2}) hittades i attributv\u00E4rdet "{1}" och elementet \u00E4r "{0}".
- InvalidCharInComment = Ett ogiltigt XML-tecken (Unicode: 0x{0}) hittades i kommentaren.
- InvalidCharInPI = Ett ogiltigt XML-tecken (Unicode: 0x{0}) hittades i bearbetningsinstruktionen.
- InvalidCharInInternalSubset = Ett ogiltigt XML-tecken (Unicode: 0x{0}) hittades i den interna delm\u00E4ngden i DTD.
- InvalidCharInTextDecl = Ett ogiltigt XML-tecken (Unicode: 0x{0}) hittades i textdeklarationen.
-# 2.3 Common Syntactic Constructs
- QuoteRequiredInAttValue = Attributv\u00E4rdet "{1}" m\u00E5ste b\u00F6rja med antingen enkelt eller dubbelt citattecken.
- LessthanInAttValue = Attributv\u00E4rdet "{1}" som associeras med elementtyp "{0}" f\u00E5r inte inneh\u00E5lla n\u00E5got ''<''-tecken.
- AttributeValueUnterminated = Attributv\u00E4rdet "{1}" m\u00E5ste avslutas med matchande citattecken.
-# 2.5 Comments
- InvalidCommentStart = Kommentarer m\u00E5ste inledas med "<!--".
- DashDashInComment = Str\u00E4ngen "--" \u00E4r inte till\u00E5ten inom kommentarer.
- CommentUnterminated = Kommentaren m\u00E5ste avslutas med "-->".
- COMMENT_NOT_IN_ONE_ENTITY = Kommentaren innesluts inte i samma enhet.
-# 2.6 Processing Instructions
- PITargetRequired = Bearbetningsinstruktionen m\u00E5ste b\u00F6rja med m\u00E5lnamnet.
- SpaceRequiredInPI = Tomt utrymme kr\u00E4vs mellan bearbetningsinstruktionens m\u00E5l och data.
- PIUnterminated = Bearbetningsinstruktionen m\u00E5ste avslutas med "?>".
- ReservedPITarget = Bearbetningsinstruktionens m\u00E5lmatchning "[xX][mM][lL]" \u00E4r inte till\u00E5ten.
- PI_NOT_IN_ONE_ENTITY = Bearbetningsinstruktionen innesluts inte i samma enhet.
-# 2.8 Prolog and Document Type Declaration
- VersionInfoInvalid = Ogiltig version "{0}".
- VersionNotSupported = XML-versionen "{0}" st\u00F6ds inte, endast XML 1.0 st\u00F6ds.
- VersionNotSupported11 = XML-versionen "{0}" st\u00F6ds inte, endast XML 1.0 och XML 1.1 st\u00F6ds.
- VersionMismatch= En enhet kan inte inkludera n\u00E5gon annan enhet som har en senare version.
-# 4.1 Character and Entity References
- DigitRequiredInCharRef = Ett decimalt uttryck m\u00E5ste anges direkt efter "&#" i en teckenreferens.
- HexdigitRequiredInCharRef = Ett hexadecimalt uttryck m\u00E5ste anges direkt efter "&#x" i en teckenreferens.
- SemicolonRequiredInCharRef = Teckenreferensen m\u00E5ste avslutas med ';'-avgr\u00E4nsare.
- InvalidCharRef = Teckenreferensen "&#{0}" \u00E4r ett ogiltigt XML-tecken.
- NameRequiredInReference = Enhetsnamnet m\u00E5ste omedelbart f\u00F6ljas av '&' i enhetsreferensen.
- SemicolonRequiredInReference = Referensen till enhet "{0}" m\u00E5ste avslutas med '';''-avgr\u00E4nsare.
-# 4.3.1 The Text Declaration
- TextDeclMustBeFirst = Textdeklarationen m\u00E5ste anges direkt i b\u00F6rjan av externt tolkad enhet.
- EqRequiredInTextDecl = Ett likhetstecken ('' = '') m\u00E5ste anges efter "{0}" i textdeklarationen.
- QuoteRequiredInTextDecl = V\u00E4rdet som f\u00F6ljer "{0}" i textdeklarationen m\u00E5ste omges av citattecken.
- CloseQuoteMissingInTextDecl = avslutande citattecken saknas f\u00F6r v\u00E4rdet efter "{0}" i textdeklarationen.
- SpaceRequiredBeforeVersionInTextDecl = Tomt utrymme kr\u00E4vs f\u00F6re versionens pseudoattribut i textdeklarationen.
- SpaceRequiredBeforeEncodingInTextDecl = Tomt utrymme kr\u00E4vs f\u00F6re kodningens pseudoattribut i textdeklarationen.
- TextDeclUnterminated = Textdeklarationen m\u00E5ste avslutas med "?>".
- EncodingDeclRequired = Koddeklaration kr\u00E4vs i textdeklarationen.
- NoMorePseudoAttributes = Inga fler pseudoattribut \u00E4r till\u00E5tna.
- MorePseudoAttributes = Ytterligare pseudoattribut f\u00F6rv\u00E4ntas.
- PseudoAttrNameExpected = Ett pseudoattributnamn f\u00F6rv\u00E4ntas.
-# 4.3.2 Well-Formed Parsed Entities
- CommentNotInOneEntity = Kommentaren m\u00E5ste finnas med inom samma tolkade enhet.
- PINotInOneEntity = Bearbetningsinstruktionen m\u00E5ste finnas med inom samma tolkade enhet.
-# 4.3.3 Character Encoding in Entities
- EncodingDeclInvalid = Ogiltigt kodnamn, "{0}".
- EncodingByteOrderUnsupported = Angiven byteordningsf\u00F6ljd i kodning "{0}" st\u00F6ds inte.
- InvalidByte = Ogiltig byte {0} i UTF-8-sekvensen f\u00F6r {1}-byte.
- ExpectedByte = F\u00F6rv\u00E4ntad byte {0} i UTF-8-sekvensen f\u00F6r {1}-byte.
- InvalidHighSurrogate = H\u00F6ga surrogatbitar i UTF-8-sekvens f\u00E5r inte \u00F6verskrida 0x10, men 0x{0} hittades.
- OperationNotSupported = \u00C5tg\u00E4rden "{0}" st\u00F6ds inte i l\u00E4saren {1}.
- InvalidASCII = Byte "{0}" ing\u00E5r inte i ASCII-teckenupps\u00E4ttningen (7 bitar).
- CharConversionFailure = En enhet som fastst\u00E4lls anv\u00E4nda ett visst kodformat f\u00E5r inte inneh\u00E5lla sekvenser som \u00E4r otill\u00E5tna i kodningen.
-
-# DTD Messages
-# 2.2 Characters
- InvalidCharInEntityValue = Ett ogiltigt XML-tecken (Unicode: 0x{0}) hittades i det litterala enhetsv\u00E4rdet.
- InvalidCharInExternalSubset = Ett ogiltigt XML-tecken (Unicode: 0x{0}) hittades i den externa delm\u00E4ngden i DTD.
- InvalidCharInIgnoreSect = Ett ogiltigt XML-tecken (Unicode: 0x{0}) hittades i sektionen f\u00F6r exkluderade villkor.
- InvalidCharInPublicID = Ett ogiltigt XML-tecken (Unicode: 0x{0}) hittades i allm\u00E4n identifierare.
- InvalidCharInSystemID = Ett ogiltigt XML-tecken (Unicode: 0x{0}) hittades i systemidentifierare.
-# 2.3 Common Syntactic Constructs
- SpaceRequiredAfterSYSTEM = Tomt utrymme kr\u00E4vs efter nyckelordet SYSTEM i DOCTYPE-deklarationen.
- QuoteRequiredInSystemID = Systemidentifieraren m\u00E5ste inledas med antingen enkelt eller dubbelt citattecken.
- SystemIDUnterminated = Systemidentifieraren m\u00E5ste avslutas med matchande citattecken.
- SpaceRequiredAfterPUBLIC = Tomma utrymmen kr\u00E4vs efter nyckelordet PUBLIC i DOCTYPE-deklarationen.
- QuoteRequiredInPublicID = Den allm\u00E4nna identifieraren m\u00E5ste inledas med antingen enkelt eller dubbelt citattecken.
- PublicIDUnterminated = Den allm\u00E4nna identifieraren m\u00E5ste avslutas med matchande citattecken.
- PubidCharIllegal = Tecknet (Unicode: 0x{0}) \u00E4r inte till\u00E5tet i den allm\u00E4nna identifieraren.
- SpaceRequiredBetweenPublicAndSystem = Tomma utrymmen kr\u00E4vs mellan publicId och systemId.
-# 2.8 Prolog and Document Type Declaration
- MSG_SPACE_REQUIRED_BEFORE_ROOT_ELEMENT_TYPE_IN_DOCTYPEDECL = Tomt utrymme kr\u00E4vs efter "<!DOCTYPE" i dokumenttypdeklarationen.
- MSG_ROOT_ELEMENT_TYPE_REQUIRED = Rotelementtyp m\u00E5ste anges efter "<!DOCTYPE" i dokumenttypdeklarationen.
- DoctypedeclUnterminated = Dokumenttypdeklarationen f\u00F6r rotelementtyp "{0}" m\u00E5ste avslutas med ''>''.
- DoctypedeclNotClosed = Dokumenttypsdeklarationen f\u00F6r rotelementtypen "{0}" m\u00E5ste st\u00E4ngas med '']''.
- PEReferenceWithinMarkup = Parameterreferensen "%{0};" f\u00E5r inte f\u00F6rekomma i kodtexten i den interna delm\u00E4ngden i DTD.
- MSG_MARKUP_NOT_RECOGNIZED_IN_DTD = Kodtextdeklarationerna som finns med eller pekas till fr\u00E5n dokumenttypdeklarationen m\u00E5ste vara v\u00E4lformulerade.
-# 2.10 White Space Handling
- MSG_XML_SPACE_DECLARATION_ILLEGAL = Attributdeklarationen f\u00F6r "xml:space" m\u00E5ste anges som uppr\u00E4kningstyp vars enda m\u00F6jliga v\u00E4rden \u00E4r "default" och "preserve".
-# 3.2 Element Type Declarations
- MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ELEMENTDECL = Tomt utrymme kr\u00E4vs efter "<!ELEMENT" i elementtypdeklarationen.
- MSG_ELEMENT_TYPE_REQUIRED_IN_ELEMENTDECL = Elementtyp m\u00E5ste anges i elementtypdeklarationen.
- MSG_SPACE_REQUIRED_BEFORE_CONTENTSPEC_IN_ELEMENTDECL = Tomt utrymme kr\u00E4vs efter elementtyp "{0}" i elementtypdeklarationen.
- MSG_CONTENTSPEC_REQUIRED_IN_ELEMENTDECL = Begr\u00E4nsningen kr\u00E4vs efter elementtyp "{0}" i elementtypdeklarationen.
- ElementDeclUnterminated = Deklarationen f\u00F6r elementtyp "{0}" m\u00E5ste avslutas med ''>''.
-# 3.2.1 Element Content
- MSG_OPEN_PAREN_OR_ELEMENT_TYPE_REQUIRED_IN_CHILDREN = Tecknet ''('' eller en elementtyp m\u00E5ste anges i deklarationen av elementtyp "{0}".
- MSG_CLOSE_PAREN_REQUIRED_IN_CHILDREN = Tecknet '')'' m\u00E5ste anges i deklarationen av elementtyp "{0}".
-# 3.2.2 Mixed Content
- MSG_ELEMENT_TYPE_REQUIRED_IN_MIXED_CONTENT = En elementtyp m\u00E5ste anges i deklarationen av elementtyp "{0}".
- MSG_CLOSE_PAREN_REQUIRED_IN_MIXED = Tecknet '')'' m\u00E5ste anges i deklarationen av elementtyp "{0}".
- MixedContentUnterminated = Modellen med blandat inneh\u00E5ll "{0}" m\u00E5ste avslutas med ")*" om typer av underordnade element \u00E4r begr\u00E4nsade.
-# 3.3 Attribute-List Declarations
- MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ATTLISTDECL = Tomt utrymme kr\u00E4vs efter "<!ATTLIST" i deklarationen f\u00F6r attributlista.
- MSG_ELEMENT_TYPE_REQUIRED_IN_ATTLISTDECL = Elementtyp m\u00E5ste anges i deklarationen f\u00F6r attributlista.
- MSG_SPACE_REQUIRED_BEFORE_ATTRIBUTE_NAME_IN_ATTDEF = Tomt utrymme kr\u00E4vs f\u00F6re attributnamnet i deklarationen f\u00F6r attributlista f\u00F6r elementet "{0}".
- AttNameRequiredInAttDef = Attributnamnet m\u00E5ste anges i deklarationen f\u00F6r attributlista f\u00F6r elementet "{0}".
- MSG_SPACE_REQUIRED_BEFORE_ATTTYPE_IN_ATTDEF = Tomt utrymme kr\u00E4vs f\u00F6re attributtyp i deklarationen f\u00F6r attributet "{1}" f\u00F6r elementet "{0}".
- AttTypeRequiredInAttDef = Attributtyp m\u00E5ste anges i deklarationen f\u00F6r attributet "{1}" f\u00F6r elementet "{0}".
- MSG_SPACE_REQUIRED_BEFORE_DEFAULTDECL_IN_ATTDEF = Tomt utrymme kr\u00E4vs f\u00F6re attributstandardv\u00E4rde i deklarationen f\u00F6r attributet "{1}" f\u00F6r elementet "{0}".
- MSG_DUPLICATE_ATTRIBUTE_DEFINITION = Det finns fler \u00E4n en attributdefinition f\u00F6r samma attribut "{1}" f\u00F6r angivet element "{0}".
-# 3.3.1 Attribute Types
- MSG_SPACE_REQUIRED_AFTER_NOTATION_IN_NOTATIONTYPE = Tomt utrymme m\u00E5ste anges efter "NOTATION" i attributdeklarationen "{1}".
- MSG_OPEN_PAREN_REQUIRED_IN_NOTATIONTYPE = Tecknet ''('' m\u00E5ste anges efter "NOTATION" i attributdeklarationen "{1}".
- MSG_NAME_REQUIRED_IN_NOTATIONTYPE = Notationsnamn m\u00E5ste anges i notationstyplistan f\u00F6r attributdeklarationen "{1}".
- NotationTypeUnterminated = Notationstyplistan m\u00E5ste avslutas med '')'' i attributdeklarationen "{1}".
- MSG_NMTOKEN_REQUIRED_IN_ENUMERATION = Namntecken m\u00E5ste anges i uppr\u00E4kningstyplistan f\u00F6r attributdeklarationen "{1}".
- EnumerationUnterminated = Uppr\u00E4kningstyplistan m\u00E5ste avslutas med '')'' i attributdeklarationen "{1}".
- MSG_DISTINCT_TOKENS_IN_ENUMERATION = Uppr\u00E4kningsv\u00E4rdet "{1}" har angetts fler \u00E4n en g\u00E5ng i attributdeklarationen "{2}" f\u00F6r elementet "{0}". Alla NMTOKENS i en och samma attributdeklaration f\u00F6r Enumeration m\u00E5ste vara unika.
- MSG_DISTINCT_NOTATION_IN_ENUMERATION = Uppr\u00E4kningsv\u00E4rdet "{1}" har angetts fler \u00E4n en g\u00E5ng i attributdeklarationen "{2}" f\u00F6r elementet "{0}". Alla NOTATION-namn i en och samma attributdeklaration f\u00F6r NotationType m\u00E5ste vara unika.
-# 3.3.2 Attribute Defaults
- MSG_SPACE_REQUIRED_AFTER_FIXED_IN_DEFAULTDECL = Tomt utrymme m\u00E5ste anges efter "FIXED" i attributdeklarationen "{1}".
-# 3.4 Conditional Sections
- IncludeSectUnterminated = Sektionen f\u00F6r inkluderade villkor m\u00E5ste avslutas med "]]>".
- IgnoreSectUnterminated = Sektionen f\u00F6r exkluderade villkor m\u00E5ste avslutas med "]]>".
-# 4.1 Character and Entity References
- NameRequiredInPEReference = Enhetsnamnet m\u00E5ste omedelbart f\u00F6ljas av '%' i parameterreferensen.
- SemicolonRequiredInPEReference = Parameterreferensen "%{0};" m\u00E5ste avslutas med '';''-avgr\u00E4nsare.
-# 4.2 Entity Declarations
- MSG_SPACE_REQUIRED_BEFORE_ENTITY_NAME_IN_ENTITYDECL = Tomt utrymme kr\u00E4vs efter "<!ENTITY" i enhetsdeklarationen.
- MSG_SPACE_REQUIRED_BEFORE_PERCENT_IN_PEDECL = Tomt utrymme kr\u00E4vs mellan "<!ENTITY" och '%'-tecknet i parameterdeklarationen.
- MSG_SPACE_REQUIRED_BEFORE_ENTITY_NAME_IN_PEDECL = Tomt utrymme kr\u00E4vs mellan '%' och enhetsnamnet i parameterdeklarationen.
- MSG_ENTITY_NAME_REQUIRED_IN_ENTITYDECL = Namnet p\u00E5 enheten m\u00E5ste anges i enhetsdeklarationen.
- MSG_SPACE_REQUIRED_AFTER_ENTITY_NAME_IN_ENTITYDECL = Tomt utrymme kr\u00E4vs mellan enhetsnamnet "{0}" och definitionen i enhetsdeklarationen.
- MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_UNPARSED_ENTITYDECL = Tomt utrymme kr\u00E4vs mellan "NDATA" och notationsnamnet i deklarationen f\u00F6r enheten "{0}".
- MSG_SPACE_REQUIRED_BEFORE_NDATA_IN_UNPARSED_ENTITYDECL = Tomt utrymme kr\u00E4vs f\u00F6re "NDATA" i deklarationen f\u00F6r enheten "{0}".
- MSG_NOTATION_NAME_REQUIRED_FOR_UNPARSED_ENTITYDECL = Notationsnamnet m\u00E5ste anges efter "NDATA" i deklarationen f\u00F6r enheten "{0}".
- EntityDeclUnterminated = Deklarationen f\u00F6r enheten "{0}" m\u00E5ste avslutas med ''>''.
- MSG_DUPLICATE_ENTITY_DEFINITION = Enheten "{0}" har deklarerats mer \u00E4n en g\u00E5ng.
-# 4.2.2 External Entities
- ExternalIDRequired = Den externa enhetsdeklarationen m\u00E5ste inledas med antingen "SYSTEM" eller "PUBLIC".
- MSG_SPACE_REQUIRED_BEFORE_PUBIDLITERAL_IN_EXTERNALID = Tomt utrymme kr\u00E4vs mellan "PUBLIC" och den allm\u00E4nna identifieraren.
- MSG_SPACE_REQUIRED_AFTER_PUBIDLITERAL_IN_EXTERNALID = Tomt utrymme kr\u00E4vs mellan den allm\u00E4nna identifieraren och systemidentifieraren.
- MSG_SPACE_REQUIRED_BEFORE_SYSTEMLITERAL_IN_EXTERNALID = Tomt utrymme kr\u00E4vs mellan "SYSTEM" och systemidentifieraren.
- MSG_URI_FRAGMENT_IN_SYSTEMID = Fragmentidentifieraren f\u00E5r inte anges som del av systemidentifieraren "{0}".
-# 4.7 Notation Declarations
- MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_NOTATIONDECL = Tomt utrymme kr\u00E4vs efter "<!NOTATION" i notationsdeklarationen.
- MSG_NOTATION_NAME_REQUIRED_IN_NOTATIONDECL = Namnet p\u00E5 notationen m\u00E5ste anges i notationsdeklarationen.
- MSG_SPACE_REQUIRED_AFTER_NOTATION_NAME_IN_NOTATIONDECL = Tomt utrymme kr\u00E4vs efter notationsnamnet "{0}" i notationsdeklarationen.
- ExternalIDorPublicIDRequired = Deklarationen f\u00F6r notationen "{0}" m\u00E5ste inkludera systemidentifierare eller allm\u00E4n identifierare.
- NotationDeclUnterminated = Deklarationen f\u00F6r notationen "{0}" m\u00E5ste avslutas med ''>''.
-
-# Validation messages
- DuplicateTypeInMixedContent = Elementtyp "{1}" har redan angetts i modellen med inneh\u00E5ll f\u00F6r elementdeklarationen "{0}".
- ENTITIESInvalid = Attributv\u00E4rdet "{1}" av typen ENTITIES m\u00E5ste motsvara namnen p\u00E5 en eller flera otolkade enheter.
- ENTITYInvalid = Attributv\u00E4rdet "{1}" av typen ENTITY m\u00E5ste motsvara namnet p\u00E5 en otolkad enhet.
- IDDefaultTypeInvalid = Id-attributet "{0}" m\u00E5ste inneh\u00E5lla deklarerat standardv\u00E4rde "#IMPLIED" eller "#REQUIRED".
- IDInvalid = Attributv\u00E4rdet "{0}" av typen ID m\u00E5ste vara ett namn.
- IDInvalidWithNamespaces = Attributv\u00E4rdet "{0}" av typen ID m\u00E5ste vara NCName om namnrymder anv\u00E4nds.
- IDNotUnique = Attributv\u00E4rdet "{0}" av typen ID m\u00E5ste vara unikt inom dokumentet.
- IDREFInvalid = Attributv\u00E4rdet "{0}" av typen IDREF m\u00E5ste vara ett namn.
- IDREFInvalidWithNamespaces = Attributv\u00E4rdet "{0}" av typen IDREF m\u00E5ste vara NCName om namnrymder anv\u00E4nds.
- IDREFSInvalid = Attributv\u00E4rdet "{0}" av typen IDREFS m\u00E5ste vara ett eller flera namn.
- ILL_FORMED_PARAMETER_ENTITY_WHEN_USED_IN_DECL = Ers\u00E4ttningstexten f\u00F6r parameterenheten "{0}" m\u00E5ste inkludera korrekt kapslade deklarationer om enhetsreferensen anv\u00E4nds som fullst\u00E4ndig deklaration.
- ImproperDeclarationNesting = Ers\u00E4ttningstexten f\u00F6r parameterenheten "{0}" m\u00E5ste inkludera deklarationer som \u00E4r korrekt kapslade.
- ImproperGroupNesting = Ers\u00E4ttningstexten f\u00F6r parameterenheten "{0}" m\u00E5ste inkludera parentespar som \u00E4r korrekt kapslade.
- INVALID_PE_IN_CONDITIONAL = Ers\u00E4ttningstexten f\u00F6r parameterenheten "{0}" m\u00E5st inkludera hela villkorssektionen eller endast INCLUDE eller IGNORE.
- MSG_ATTRIBUTE_NOT_DECLARED = Attributet "{1}" m\u00E5ste deklareras f\u00F6r elementtyp "{0}".
- MSG_ATTRIBUTE_VALUE_NOT_IN_LIST = Attributet "{0}" med v\u00E4rdet "{1}" m\u00E5ste ha ett v\u00E4rde fr\u00E5n listan "{2}".
- MSG_ATTVALUE_CHANGED_DURING_NORMALIZATION_WHEN_STANDALONE = V\u00E4rdet "{1}" f\u00F6r attributet "{0}" f\u00E5r inte \u00E4ndras vid normalisering (till "{2}") i ett frist\u00E5ende dokument.
- MSG_CONTENT_INCOMPLETE = Inneh\u00E5llet i elementtyp "{0}" \u00E4r ofullst\u00E4ndigt, det m\u00E5ste matcha "{1}".
- MSG_CONTENT_INVALID = Inneh\u00E5llet i elementtyp "{0}" m\u00E5ste matcha "{1}".
- MSG_CONTENT_INVALID_SPECIFIED = Inneh\u00E5llet i elementtyp "{0}" m\u00E5ste matcha "{1}". Underordnade till typ "{2}" \u00E4r inte till\u00E5tna.
- MSG_DEFAULTED_ATTRIBUTE_NOT_SPECIFIED = Attributet "{1}" f\u00F6r elementtyp "{0}" har ett standardv\u00E4rde och m\u00E5ste anges i ett frist\u00E5ende dokument.
- MSG_DUPLICATE_ATTDEF = Attributet "{1}" har redan deklarerats f\u00F6r elementtyp "{0}".
- MSG_ELEMENT_ALREADY_DECLARED = Elementtyp "{0}" f\u00E5r deklareras endast en g\u00E5ng.
- MSG_ELEMENT_NOT_DECLARED = Elementtyp "{0}" m\u00E5ste deklareras.
- MSG_GRAMMAR_NOT_FOUND = Dokumentet \u00E4r ogiltigt: hittade ingen grammatik.
- MSG_ELEMENT_WITH_ID_REQUIRED = Ett element med identifieraren "{0}" m\u00E5ste finnas med i dokumentet.
- MSG_EXTERNAL_ENTITY_NOT_PERMITTED = Referens till den externa enheten "{0}" \u00E4r inte till\u00E5tet i frist\u00E5ende dokument.
- MSG_FIXED_ATTVALUE_INVALID = Attributet "{1}" med v\u00E4rdet "{2}" m\u00E5ste ha v\u00E4rdet "{3}".
- MSG_MORE_THAN_ONE_ID_ATTRIBUTE = Elementtyp "{0}" har redan attributet "{1}" av id-typ, ett andra attribut "{2}" av samma typ \u00E4r inte till\u00E5tet.
- MSG_MORE_THAN_ONE_NOTATION_ATTRIBUTE = Elementtyp "{0}" har redan attributet "{1}" av NOTATION-typ, ett andra attribut "{2}" av samma typ \u00E4r inte till\u00E5tet.
- MSG_NOTATION_NOT_DECLARED_FOR_NOTATIONTYPE_ATTRIBUTE = Notationen "{1}" m\u00E5ste deklareras vid referens i notationstyplistan f\u00F6r attributet "{0}".
- MSG_NOTATION_NOT_DECLARED_FOR_UNPARSED_ENTITYDECL = Notationen "{1}" m\u00E5ste deklareras vid referens i otolkad enhetsdeklaration f\u00F6r "{0}".
- MSG_REFERENCE_TO_EXTERNALLY_DECLARED_ENTITY_WHEN_STANDALONE = Referensen till enheten "{0}" som har deklarerats i en externt tolkad enhet \u00E4r inte till\u00E5tet i frist\u00E5ende dokument.
- MSG_REQUIRED_ATTRIBUTE_NOT_SPECIFIED = Attributet "{1}" m\u00E5ste anges f\u00F6r elementtyp "{0}".
- MSG_WHITE_SPACE_IN_ELEMENT_CONTENT_WHEN_STANDALONE = Tomt utrymme f\u00E5r inte f\u00F6rekomma mellan element som har deklarerats i en externt tolkad enhet med elementinneh\u00E5ll i frist\u00E5ende dokument.
- NMTOKENInvalid = Attributv\u00E4rdet "{0}" av typen NMTOKEN m\u00E5ste vara ett namntecken.
- NMTOKENSInvalid = Attributv\u00E4rdet "{0}" av typen NMTOKENS m\u00E5ste vara ett eller flera namntecken.
- NoNotationOnEmptyElement = Elementtyp "{0}" med deklarationen EMPTY kan inte deklareras med attributet "{1}" av typen NOTATION.
- RootElementTypeMustMatchDoctypedecl = Dokumentrotelementet "{1}" m\u00E5ste matcha DOCTYPE-roten "{0}".
- UndeclaredElementInContentSpec = Modellen med inneh\u00E5ll f\u00F6r elementet "{0}" refererar till elementet "{1}" som inte har deklarerats.
- UniqueNotationName = Deklarationen f\u00F6r notationen "{0}" \u00E4r inte unik. Ett namn f\u00E5r inte deklareras i fler \u00E4n en notationsdeklaration.
- ENTITYFailedInitializeGrammar = ENTITYDatatype-validerare: Behov att anropa initieringsmetod med giltig grammatikreferens utf\u00F6rdes inte. \t
- ENTITYNotUnparsed = ENTITY "{0}" \u00E4r otolkat.
- ENTITYNotValid = ENTITY "{0}" \u00E4r inte giltigt.
- EmptyList = V\u00E4rdet f\u00F6r typ ENTITIES, IDREFS och NMTOKENS f\u00E5r inte vara en tom lista.
-
-# Entity related messages
-# 3.1 Start-Tags, End-Tags, and Empty-Element Tags
- ReferenceToExternalEntity = Den externa enhetsreferensen "&{0};" till\u00E5ts inte i ett attributv\u00E4rde.
- AccessExternalDTD = Extern DTD: Kunde inte l\u00E4sa extern DTD ''{0}'', eftersom ''{1}'' \u00E5tkomst inte till\u00E5ts p\u00E5 grund av begr\u00E4nsning som anges av accessExternalDTD-egenskapen.
- AccessExternalEntity = Extern enhet: Kunde inte l\u00E4sa externt dokument ''{0}'', eftersom ''{1}'' \u00E5tkomst inte till\u00E5ts p\u00E5 grund av begr\u00E4nsning som anges av accessExternalDTD-egenskapen.
-
-# 4.1 Character and Entity References
- EntityNotDeclared = Enheten "{0}" har refererats, men \u00E4r inte deklarerad.
- ReferenceToUnparsedEntity = Den otolkade enhetsreferensen "&{0};" \u00E4r inte till\u00E5ten.
- RecursiveReference = Rekursiv enhetsreferens "{0}". (Referenss\u00F6kv\u00E4g: {1}),
- RecursiveGeneralReference = Rekursiv allm\u00E4n enhetsreferens "&{0};". (Referenss\u00F6kv\u00E4g: {1}),
- RecursivePEReference = Rekursiv parameterreferens "%{0};". (Referenss\u00F6kv\u00E4g: {1}),
-# 4.3.3 Character Encoding in Entities
- EncodingNotSupported = Kodningen "{0}" st\u00F6ds inte.
- EncodingRequired = En tolkad enhet som inte \u00E4r kodad i varken UTF-8 eller UTF-16 m\u00E5ste ha en kodningsdeklaration.
-
-# Namespaces support
-# 4. Using Qualified Names
- IllegalQName = Element eller attribut matchar inte QName-produktion: QName::=(NCName':')?NCName.
- ElementXMLNSPrefix = Elementet "{0}" kan inte anv\u00E4ndas med "xmlns" som prefix.
- ElementPrefixUnbound = Prefixet "{0}" f\u00F6r elementet "{1}" \u00E4r inte bundet.
- AttributePrefixUnbound = Prefixet "{2}" f\u00F6r attributet "{1}" som associeras med elementtyp "{0}" \u00E4r inte bundet.
- EmptyPrefixedAttName = Ogiltigt v\u00E4rde f\u00F6r attributet "{0}". Namnrymdsbindningar som prefix kanske inte \u00E4r tomma.
- PrefixDeclared = Namnrymdsprefixet "{0}" har inte deklarerats.
- CantBindXMLNS = Prefixet "xmlns" kan inte bindas till en specifik namnrymd och namnrymden f\u00F6r "xmlns" kan inte heller bindas till ett specifikt prefix.
- CantBindXML = Prefixet "xml" kan inte bindas till en namnrymd ut\u00F6ver den vanliga och namnrymden f\u00F6r "xml" kan inte heller bindas till n\u00E5got annat prefix \u00E4n "xml".
- MSG_ATT_DEFAULT_INVALID = defaultValue "{1}" f\u00F6r attributet "{0}" \u00E4r inte till\u00E5tet vad g\u00E4ller de lexikala begr\u00E4nsningarna f\u00F6r denna attributtyp.
-
-# REVISIT: These need messages
- MSG_SPACE_REQUIRED_AFTER_SYSTEMLITERAL_IN_EXTERNALID=MSG_SPACE_REQUIRED_AFTER_SYSTEMLITERAL_IN_EXTERNALID
- OpenQuoteMissingInDecl=OpenQuoteMissingInDecl
- InvalidCharInLiteral=InvalidCharInLiteral
-
-
-# Implementation limits
- EntityExpansionLimit=JAXP00010001: Parsern har p\u00E5tr\u00E4ffat fler \u00E4n "{0}" enhetstill\u00E4gg i dokumentet - gr\u00E4nsv\u00E4rdet f\u00F6r JDK har uppn\u00E5tts.
- ElementAttributeLimit=JAXP00010002: Elementet "{0}" har fler \u00E4n "{1}" attribut, "{1}" \u00E4r gr\u00E4nsv\u00E4rdet f\u00F6r JDK.
- MaxEntitySizeLimit=JAXP00010003: L\u00E4ngden p\u00E5 enheten "{0}" \u00E4r "{1}" som \u00F6verskriver gr\u00E4nsv\u00E4rdet p\u00E5 "{2}" som anges av "{3}".
- TotalEntitySizeLimit=JAXP00010004: Den ackumulerade storleken f\u00F6r enheter \u00E4r "{0}", vilket \u00F6verskrider gr\u00E4nsv\u00E4rdet "{1}" som anges av "{2}".
- MaxXMLNameLimit=JAXP00010005: L\u00E4ngden p\u00E5 enheten "{0}" \u00E4r "{1}", vilket \u00F6verskrider gr\u00E4nsv\u00E4rdet "{2}" som anges av "{3}".
- MaxElementDepthLimit=JAXP00010006: Elementet "{0}" har djupet "{1}" vilket \u00E4r st\u00F6rre \u00E4n gr\u00E4nsen "{2}" som anges av "{3}".
- EntityReplacementLimit=JAXP00010007: Det totala antalet noder i enhetsreferenser \u00E4r "{0}", vilket \u00E4r \u00F6ver gr\u00E4nsen "{1}" som har angetts av "{2}".
-
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_CN.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_CN.properties
deleted file mode 100644
index dc2e1d0..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_CN.properties
+++ /dev/null
@@ -1,305 +0,0 @@
-# This file contains error and warning messages related to XML
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-# @version
-
- BadMessageKey = \u627E\u4E0D\u5230\u4E0E\u6D88\u606F\u5173\u952E\u5B57\u5BF9\u5E94\u7684\u9519\u8BEF\u6D88\u606F\u3002
- FormatFailed = \u8BBE\u7F6E\u4EE5\u4E0B\u6D88\u606F\u7684\u683C\u5F0F\u65F6\u51FA\u73B0\u5185\u90E8\u9519\u8BEF:\n
-
-# Document messages
- PrematureEOF=\u6587\u4EF6\u63D0\u524D\u7ED3\u675F\u3002
-# 2.1 Well-Formed XML Documents
- RootElementRequired = \u6839\u5143\u7D20\u5E94\u8BE5\u4F4D\u4E8E\u683C\u5F0F\u6B63\u786E\u7684\u6587\u6863\u4E2D\u3002
-# 2.2 Characters
-
- InvalidCharInCDSect = \u5728 CDATA \u8282\u4E2D\u627E\u5230\u65E0\u6548\u7684 XML \u5B57\u7B26 (Unicode: 0x{0})\u3002
- InvalidCharInContent = \u5728\u6587\u6863\u7684\u5143\u7D20\u5185\u5BB9\u4E2D\u627E\u5230\u65E0\u6548\u7684 XML \u5B57\u7B26 (Unicode: 0x{0})\u3002
- TwoColonsInQName = \u5728\u5143\u7D20\u5185\u5BB9\u6216\u5C5E\u6027\u540D\u4E2D\u627E\u5230\u65E0\u6548\u7684\u7B2C\u4E8C\u4E2A ':'\u3002
- ColonNotLegalWithNS = \u5F53\u542F\u7528\u540D\u79F0\u7A7A\u95F4\u65F6, \u4E0D\u5141\u8BB8\u5728\u540D\u79F0 ''{0}'' \u4E2D\u4F7F\u7528\u5192\u53F7\u3002
- InvalidCharInMisc = \u5728\u5143\u7D20\u5185\u5BB9\u7ED3\u5C3E\u540E\u7684\u6807\u8BB0\u4E2D\u627E\u5230\u65E0\u6548\u7684 XML \u5B57\u7B26 (Unicode: 0x{0})\u3002
- InvalidCharInProlog = \u5728\u6587\u6863\u524D\u8A00\u4E2D\u627E\u5230\u65E0\u6548\u7684 XML \u5B57\u7B26 (Unicode: 0x{0})\u3002
- InvalidCharInXMLDecl = \u5728 XML \u58F0\u660E\u4E2D\u627E\u5230\u65E0\u6548\u7684 XML \u5B57\u7B26 (Unicode: 0x{0})\u3002
-# 2.4 Character Data and Markup
- CDEndInContent = \u9664\u975E\u4F7F\u7528\u5B57\u7B26\u5E8F\u5217 "]]>" \u6765\u6807\u8BB0 CDATA \u8282\u7684\u7ED3\u5C3E, \u5426\u5219\u8BE5\u5B57\u7B26\u5E8F\u5217\u4E0D\u80FD\u51FA\u73B0\u5728\u5185\u5BB9\u4E2D\u3002
-# 2.7 CDATA Sections
- CDSectUnterminated = CDATA \u8282\u5FC5\u987B\u4EE5 "]]>" \u7ED3\u5C3E\u3002
-# 2.8 Prolog and Document Type Declaration
- XMLDeclMustBeFirst = XML \u58F0\u660E\u53EA\u80FD\u51FA\u73B0\u5728\u6587\u6863\u7684\u6700\u5F00\u5934\u5904\u3002
- EqRequiredInXMLDecl = \u5728 XML \u58F0\u660E\u4E2D, "{0}" \u540E\u9762\u5FC5\u987B\u8DDF\u6709 '' = '' \u5B57\u7B26\u3002
- QuoteRequiredInXMLDecl = XML \u58F0\u660E\u4E2D "{0}" \u540E\u9762\u8DDF\u968F\u7684\u503C\u5FC5\u987B\u662F\u7528\u5F15\u53F7\u62EC\u8D77\u6765\u7684\u5B57\u7B26\u4E32\u3002
- XMLDeclUnterminated = XML \u58F0\u660E\u5FC5\u987B\u4EE5 "?>" \u7ED3\u5C3E\u3002
- VersionInfoRequired = XML \u58F0\u660E\u4E2D\u9700\u8981\u6B64\u7248\u672C\u3002
- SpaceRequiredBeforeVersionInXMLDecl = \u5728 XML \u58F0\u660E\u4E2D\u7684\u7248\u672C\u4F2A\u5C5E\u6027\u524D\u9762\u5FC5\u987B\u6709\u7A7A\u683C\u3002
- SpaceRequiredBeforeEncodingInXMLDecl = \u5728 XML \u58F0\u660E\u4E2D\u7684\u7F16\u7801\u4F2A\u5C5E\u6027\u524D\u9762\u5FC5\u987B\u6709\u7A7A\u683C\u3002
- SpaceRequiredBeforeStandalone = \u5728 XML \u58F0\u660E\u4E2D\u7684\u7F16\u7801\u4F2A\u5C5E\u6027\u524D\u9762\u5FC5\u987B\u6709\u7A7A\u683C\u3002
- MarkupNotRecognizedInProlog = \u6587\u6863\u4E2D\u6839\u5143\u7D20\u524D\u9762\u7684\u6807\u8BB0\u5FC5\u987B\u683C\u5F0F\u6B63\u786E\u3002
- MarkupNotRecognizedInMisc = \u6587\u6863\u4E2D\u6839\u5143\u7D20\u540E\u9762\u7684\u6807\u8BB0\u5FC5\u987B\u683C\u5F0F\u6B63\u786E\u3002
- AlreadySeenDoctype = \u5DF2\u7ECF\u770B\u5230 doctype\u3002
- DoctypeNotAllowed = \u5C06\u529F\u80FD "http://apache.org/xml/features/disallow-doctype-decl" \u8BBE\u7F6E\u4E3A\u201C\u771F\u201D\u65F6, \u4E0D\u5141\u8BB8\u4F7F\u7528 DOCTYPE\u3002
- ContentIllegalInProlog = \u524D\u8A00\u4E2D\u4E0D\u5141\u8BB8\u6709\u5185\u5BB9\u3002
- ReferenceIllegalInProlog = \u524D\u8A00\u4E2D\u4E0D\u5141\u8BB8\u6709\u5F15\u7528\u3002
-# Trailing Misc
- ContentIllegalInTrailingMisc=\u5C3E\u968F\u8282\u4E2D\u4E0D\u5141\u8BB8\u6709\u5185\u5BB9\u3002
- ReferenceIllegalInTrailingMisc=\u5C3E\u968F\u8282\u4E2D\u4E0D\u5141\u8BB8\u6709\u5F15\u7528\u3002
-
-# 2.9 Standalone Document Declaration
- SDDeclInvalid = \u72EC\u7ACB\u6587\u6863\u58F0\u660E\u503C\u5FC5\u987B\u4E3A "\u662F" \u6216 "\u5426", \u4E0D\u80FD\u4E3A "{0}"\u3002
- SDDeclNameInvalid = XML \u58F0\u660E\u4E2D\u7684\u72EC\u7ACB\u540D\u79F0\u53EF\u80FD\u62FC\u5199\u6709\u8BEF\u3002
-# 2.12 Language Identification
- XMLLangInvalid = xml:lang \u5C5E\u6027\u503C "{0}" \u662F\u65E0\u6548\u7684\u8BED\u8A00\u6807\u8BC6\u7B26\u3002
-# 3. Logical Structures
- ETagRequired = \u5143\u7D20\u7C7B\u578B "{0}" \u5FC5\u987B\u7531\u5339\u914D\u7684\u7ED3\u675F\u6807\u8BB0 "</{0}>" \u7EC8\u6B62\u3002
-# 3.1 Start-Tags, End-Tags, and Empty-Element Tags
- ElementUnterminated = \u5143\u7D20\u7C7B\u578B "{0}" \u5FC5\u987B\u540E\u8DDF\u5C5E\u6027\u89C4\u8303 ">" \u6216 "/>"\u3002
- EqRequiredInAttribute = \u4E0E\u5143\u7D20\u7C7B\u578B "{0}" \u76F8\u5173\u8054\u7684\u5C5E\u6027\u540D "{1}" \u5FC5\u987B\u540E\u8DDF '' = '' \u5B57\u7B26\u3002
- OpenQuoteExpected = \u4E0E\u5143\u7D20\u7C7B\u578B "{0}" \u76F8\u5173\u8054\u7684\u5C5E\u6027 "{1}" \u5E94\u6709\u5DE6\u5F15\u53F7\u3002
- CloseQuoteExpected = \u4E0E\u5143\u7D20\u7C7B\u578B "{0}" \u76F8\u5173\u8054\u7684\u5C5E\u6027 "{1}" \u5E94\u6709\u53F3\u5F15\u53F7\u3002
- AttributeNotUnique = \u5DF2\u7ECF\u4E3A\u5143\u7D20 "{0}" \u6307\u5B9A\u5C5E\u6027 "{1}"\u3002
- AttributeNSNotUnique = \u5DF2\u7ECF\u4E3A\u5143\u7D20 "{0}" \u6307\u5B9A\u7ED1\u5B9A\u5230\u540D\u79F0\u7A7A\u95F4 "{2}" \u7684\u5C5E\u6027 "{1}"\u3002
- ETagUnterminated = \u5143\u7D20\u7C7B\u578B "{0}" \u7684\u7ED3\u675F\u6807\u8BB0\u5FC5\u987B\u4EE5 ''>'' \u5206\u9694\u7B26\u7ED3\u675F\u3002
- MarkupNotRecognizedInContent = \u5143\u7D20\u5185\u5BB9\u5FC5\u987B\u7531\u683C\u5F0F\u6B63\u786E\u7684\u5B57\u7B26\u6570\u636E\u6216\u6807\u8BB0\u7EC4\u6210\u3002
- DoctypeIllegalInContent = \u5185\u5BB9\u4E2D\u4E0D\u5141\u8BB8\u6709 DOCTYPE\u3002
-# 4.1 Character and Entity References
- ReferenceUnterminated = \u5F15\u7528\u5FC5\u987B\u4EE5 ';' \u5206\u9694\u7B26\u7EC8\u6B62\u3002
-# 4.3.2 Well-Formed Parsed Entities
- ReferenceNotInOneEntity = \u5F15\u7528\u5FC5\u987B\u5B8C\u5168\u5305\u542B\u5728\u540C\u4E00\u4E2A\u5DF2\u89E3\u6790\u5B9E\u4F53\u5185\u3002
- ElementEntityMismatch = \u5143\u7D20 "{0}" \u5FC5\u987B\u4ECE\u5934\u81F3\u5C3E\u5305\u542B\u5728\u540C\u4E00\u4E2A\u5B9E\u4F53\u5185\u3002
- MarkupEntityMismatch=XML \u6587\u6863\u7ED3\u6784\u5FC5\u987B\u4ECE\u5934\u81F3\u5C3E\u5305\u542B\u5728\u540C\u4E00\u4E2A\u5B9E\u4F53\u5185\u3002
-
-# Messages common to Document and DTD
-# 2.2 Characters
- InvalidCharInAttValue = \u5728 "{1}" \u5C5E\u6027\u503C\u4E2D\u627E\u5230\u65E0\u6548\u7684 XML \u5B57\u7B26 (Unicode: 0x{2}), \u5E76\u4E14\u5143\u7D20\u4E3A "{0}"\u3002
- InvalidCharInComment = \u5728\u6CE8\u91CA\u4E2D\u627E\u5230\u65E0\u6548\u7684 XML \u5B57\u7B26 (Unicode: 0x{0})\u3002
- InvalidCharInPI = \u5728\u5904\u7406\u6307\u4EE4\u4E2D\u627E\u5230\u65E0\u6548\u7684 XML \u5B57\u7B26 (Unicode: 0x{0})\u3002
- InvalidCharInInternalSubset = \u5728 DTD \u7684\u5185\u90E8\u5B50\u96C6\u4E2D\u627E\u5230\u65E0\u6548\u7684 XML \u5B57\u7B26 (Unicode: 0x{0})\u3002
- InvalidCharInTextDecl = \u5728\u6587\u672C\u58F0\u660E\u4E2D\u627E\u5230\u65E0\u6548\u7684 XML \u5B57\u7B26 (Unicode: 0x{0})\u3002
-# 2.3 Common Syntactic Constructs
- QuoteRequiredInAttValue = "{1}" \u5C5E\u6027\u503C\u5FC5\u987B\u4EE5\u5355\u5F15\u53F7\u5B57\u7B26\u6216\u53CC\u5F15\u53F7\u5B57\u7B26\u5F00\u5934\u3002
- LessthanInAttValue = \u4E0E\u5143\u7D20\u7C7B\u578B "{0}" \u76F8\u5173\u8054\u7684 "{1}" \u5C5E\u6027\u503C\u4E0D\u80FD\u5305\u542B ''<'' \u5B57\u7B26\u3002
- AttributeValueUnterminated = "{1}" \u5C5E\u6027\u503C\u5FC5\u987B\u4EE5\u5339\u914D\u7684\u5F15\u53F7\u5B57\u7B26\u7ED3\u5C3E\u3002
-# 2.5 Comments
- InvalidCommentStart = \u6CE8\u91CA\u5FC5\u987B\u4EE5 "<!--" \u5F00\u5934\u3002
- DashDashInComment = \u6CE8\u91CA\u4E2D\u4E0D\u5141\u8BB8\u51FA\u73B0\u5B57\u7B26\u4E32 "--"\u3002
- CommentUnterminated = \u6CE8\u91CA\u5FC5\u987B\u4EE5 "-->" \u7ED3\u5C3E\u3002
- COMMENT_NOT_IN_ONE_ENTITY = \u6CE8\u91CA\u6CA1\u6709\u5305\u542B\u5728\u540C\u4E00\u4E2A\u5B9E\u4F53\u5185\u3002
-# 2.6 Processing Instructions
- PITargetRequired = \u5904\u7406\u6307\u4EE4\u5FC5\u987B\u4EE5\u76EE\u6807\u540D\u79F0\u5F00\u5934\u3002
- SpaceRequiredInPI = \u5728\u5904\u7406\u6307\u4EE4\u76EE\u6807\u548C\u6570\u636E\u4E4B\u95F4\u9700\u8981\u6709\u7A7A\u683C\u3002
- PIUnterminated = \u5904\u7406\u6307\u4EE4\u5FC5\u987B\u4EE5 "?>" \u7ED3\u5C3E\u3002
- ReservedPITarget = \u4E0D\u5141\u8BB8\u6709\u5339\u914D "[xX][mM][lL]" \u7684\u5904\u7406\u6307\u4EE4\u76EE\u6807\u3002
- PI_NOT_IN_ONE_ENTITY = \u5904\u7406\u6307\u4EE4\u6CA1\u6709\u5305\u542B\u5728\u540C\u4E00\u4E2A\u5B9E\u4F53\u5185\u3002
-# 2.8 Prolog and Document Type Declaration
- VersionInfoInvalid = \u7248\u672C "{0}" \u65E0\u6548\u3002
- VersionNotSupported = \u4E0D\u652F\u6301 XML \u7248\u672C "{0}", \u53EA\u652F\u6301 XML 1.0\u3002
- VersionNotSupported11 = \u4E0D\u652F\u6301 XML \u7248\u672C "{0}", \u53EA\u652F\u6301 XML 1.0 \u548C XML 1.1\u3002
- VersionMismatch= \u5B9E\u4F53\u4E0D\u80FD\u5305\u542B\u8F83\u9AD8\u7248\u672C\u7684\u53E6\u4E00\u4E2A\u5B9E\u4F53\u3002
-# 4.1 Character and Entity References
- DigitRequiredInCharRef = \u5728\u5B57\u7B26\u5F15\u7528\u4E2D, \u5341\u8FDB\u5236\u8868\u793A\u65B9\u6CD5\u5FC5\u987B\u7D27\u8DDF\u5728 "&#" \u540E\u9762\u3002
- HexdigitRequiredInCharRef = \u5728\u5B57\u7B26\u5F15\u7528\u4E2D, \u5341\u516D\u8FDB\u5236\u8868\u793A\u65B9\u6CD5\u5FC5\u987B\u7D27\u8DDF\u5728 "&#x" \u540E\u9762\u3002
- SemicolonRequiredInCharRef = \u5B57\u7B26\u5F15\u7528\u5FC5\u987B\u4EE5 ';' \u5206\u9694\u7B26\u7ED3\u5C3E\u3002
- InvalidCharRef = \u5B57\u7B26\u5F15\u7528 "&#{0}" \u662F\u65E0\u6548\u7684 XML \u5B57\u7B26\u3002
- NameRequiredInReference = \u5728\u5B9E\u4F53\u5F15\u7528\u4E2D, \u5B9E\u4F53\u540D\u79F0\u5FC5\u987B\u7D27\u8DDF\u5728 '&' \u540E\u9762\u3002
- SemicolonRequiredInReference = \u5BF9\u5B9E\u4F53 "{0}" \u7684\u5F15\u7528\u5FC5\u987B\u4EE5 '';'' \u5206\u9694\u7B26\u7ED3\u5C3E\u3002
-# 4.3.1 The Text Declaration
- TextDeclMustBeFirst = \u6587\u672C\u58F0\u660E\u53EA\u80FD\u51FA\u73B0\u5728\u5DF2\u89E3\u6790\u7684\u5916\u90E8\u5B9E\u4F53\u7684\u6700\u5F00\u5934\u5904\u3002
- EqRequiredInTextDecl = \u5728\u6587\u672C\u58F0\u660E\u4E2D, "{0}" \u540E\u9762\u5FC5\u987B\u8DDF\u6709 '' = '' \u5B57\u7B26\u3002
- QuoteRequiredInTextDecl = \u6587\u672C\u58F0\u660E\u4E2D "{0}" \u540E\u9762\u8DDF\u968F\u7684\u503C\u5FC5\u987B\u662F\u7528\u5F15\u53F7\u62EC\u8D77\u6765\u7684\u5B57\u7B26\u4E32\u3002
- CloseQuoteMissingInTextDecl = \u6587\u672C\u58F0\u660E\u4E2D "{0}" \u540E\u9762\u8DDF\u968F\u7684\u503C\u7F3A\u5C11\u53F3\u5F15\u53F7\u3002
- SpaceRequiredBeforeVersionInTextDecl = \u5728\u6587\u672C\u58F0\u660E\u4E2D\u7684\u7248\u672C\u4F2A\u5C5E\u6027\u524D\u9762\u5FC5\u987B\u6709\u7A7A\u683C\u3002
- SpaceRequiredBeforeEncodingInTextDecl = \u5728\u6587\u672C\u58F0\u660E\u4E2D\u7684\u7F16\u7801\u4F2A\u5C5E\u6027\u524D\u9762\u5FC5\u987B\u6709\u7A7A\u683C\u3002
- TextDeclUnterminated = \u6587\u672C\u58F0\u660E\u5FC5\u987B\u4EE5 "?>" \u7ED3\u5C3E\u3002
- EncodingDeclRequired = \u6587\u672C\u58F0\u660E\u4E2D\u9700\u8981\u7F16\u7801\u58F0\u660E\u3002
- NoMorePseudoAttributes = \u4E0D\u5141\u8BB8\u4F7F\u7528\u66F4\u591A\u7684\u4F2A\u5C5E\u6027\u3002
- MorePseudoAttributes = \u5E94\u8BE5\u6709\u66F4\u591A\u7684\u4F2A\u5C5E\u6027\u3002
- PseudoAttrNameExpected = \u5E94\u8BE5\u6709\u4F2A\u5C5E\u6027\u540D\u3002
-# 4.3.2 Well-Formed Parsed Entities
- CommentNotInOneEntity = \u6CE8\u91CA\u5FC5\u987B\u5B8C\u5168\u5305\u542B\u5728\u540C\u4E00\u4E2A\u5DF2\u89E3\u6790\u5B9E\u4F53\u5185\u3002
- PINotInOneEntity = \u5904\u7406\u6307\u4EE4\u5FC5\u987B\u5B8C\u5168\u5305\u542B\u5728\u540C\u4E00\u4E2A\u5DF2\u89E3\u6790\u5B9E\u4F53\u5185\u3002
-# 4.3.3 Character Encoding in Entities
- EncodingDeclInvalid = \u7F16\u7801\u540D\u79F0 "{0}" \u65E0\u6548\u3002
- EncodingByteOrderUnsupported = \u4E0D\u652F\u6301\u7F16\u7801 "{0}" \u7684\u7ED9\u5B9A\u5B57\u8282\u987A\u5E8F\u3002
- InvalidByte = {1} \u5B57\u8282\u7684 UTF-8 \u5E8F\u5217\u7684\u5B57\u8282 {0} \u65E0\u6548\u3002
- ExpectedByte = \u5E94\u4E3A {1} \u5B57\u8282\u7684 UTF-8 \u5E8F\u5217\u7684\u5B57\u8282 {0}\u3002
- InvalidHighSurrogate = UTF-8 \u5E8F\u5217\u4E2D\u7684\u9AD8\u4EE3\u7406\u4F4D\u4E0D\u80FD\u8D85\u8FC7 0x10, \u4F46\u627E\u5230 0x{0}\u3002
- OperationNotSupported = {1}\u8BFB\u8FDB\u7A0B\u4E0D\u652F\u6301\u64CD\u4F5C "{0}"\u3002
- InvalidASCII = \u5B57\u8282 "{0}" \u4E0D\u662F (7 \u4F4D) ASCII \u5B57\u7B26\u96C6\u7684\u6210\u5458\u3002
- CharConversionFailure = \u786E\u5B9A\u5C5E\u4E8E\u67D0\u4E2A\u7F16\u7801\u7684\u5B9E\u4F53\u4E0D\u80FD\u5305\u542B\u5728\u8BE5\u7F16\u7801\u4E2D\u975E\u6CD5\u7684\u5E8F\u5217\u3002
-
-# DTD Messages
-# 2.2 Characters
- InvalidCharInEntityValue = \u5728\u6587\u5B57\u5B9E\u4F53\u503C\u4E2D\u627E\u5230\u65E0\u6548\u7684 XML \u5B57\u7B26 (Unicode: 0x{0})\u3002
- InvalidCharInExternalSubset = \u5728 DTD \u7684\u5916\u90E8\u5B50\u96C6\u4E2D\u627E\u5230\u65E0\u6548\u7684 XML \u5B57\u7B26 (Unicode: 0x{0})\u3002
- InvalidCharInIgnoreSect = \u5728\u6392\u9664\u7684\u6761\u4EF6\u8282\u4E2D\u627E\u5230\u65E0\u6548\u7684 XML \u5B57\u7B26 (Unicode: 0x{0})\u3002
- InvalidCharInPublicID = \u5728\u516C\u5171\u6807\u8BC6\u7B26\u4E2D\u627E\u5230\u65E0\u6548\u7684 XML \u5B57\u7B26 (Unicode: 0x{0})\u3002
- InvalidCharInSystemID = \u5728\u7CFB\u7EDF\u6807\u8BC6\u7B26\u4E2D\u627E\u5230\u65E0\u6548\u7684 XML \u5B57\u7B26 (Unicode: 0x{0})\u3002
-# 2.3 Common Syntactic Constructs
- SpaceRequiredAfterSYSTEM = \u5728 DOCTYPE \u58F0\u660E\u4E2D\u7684\u5173\u952E\u5B57 SYSTEM \u540E\u9762\u9700\u8981\u6709\u7A7A\u683C\u3002
- QuoteRequiredInSystemID = \u7CFB\u7EDF\u6807\u8BC6\u7B26\u5FC5\u987B\u4EE5\u5355\u5F15\u53F7\u5B57\u7B26\u6216\u53CC\u5F15\u53F7\u5B57\u7B26\u5F00\u5934\u3002
- SystemIDUnterminated = \u7CFB\u7EDF\u6807\u8BC6\u7B26\u5FC5\u987B\u4EE5\u5339\u914D\u7684\u5F15\u53F7\u5B57\u7B26\u7ED3\u5C3E\u3002
- SpaceRequiredAfterPUBLIC = \u5728 DOCTYPE \u58F0\u660E\u4E2D\u7684\u5173\u952E\u5B57 PUBLIC \u540E\u9762\u9700\u8981\u6709\u7A7A\u683C\u3002
- QuoteRequiredInPublicID = \u516C\u5171\u6807\u8BC6\u7B26\u5FC5\u987B\u4EE5\u5355\u5F15\u53F7\u5B57\u7B26\u6216\u53CC\u5F15\u53F7\u5B57\u7B26\u5F00\u5934\u3002
- PublicIDUnterminated = \u516C\u5171\u6807\u8BC6\u7B26\u5FC5\u987B\u4EE5\u5339\u914D\u7684\u5F15\u53F7\u5B57\u7B26\u7ED3\u5C3E\u3002
- PubidCharIllegal = \u516C\u5171\u6807\u8BC6\u7B26\u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528\u8BE5\u5B57\u7B26 (Unicode: 0x{0})\u3002
- SpaceRequiredBetweenPublicAndSystem = \u5728 publicId \u548C systemId \u4E4B\u95F4\u9700\u8981\u6709\u7A7A\u683C\u3002
-# 2.8 Prolog and Document Type Declaration
- MSG_SPACE_REQUIRED_BEFORE_ROOT_ELEMENT_TYPE_IN_DOCTYPEDECL = \u5728\u6587\u6863\u7C7B\u578B\u58F0\u660E\u4E2D\u7684 "<!DOCTYPE" \u540E\u9762\u9700\u8981\u6709\u7A7A\u683C\u3002
- MSG_ROOT_ELEMENT_TYPE_REQUIRED = \u5728\u6587\u6863\u7C7B\u578B\u58F0\u660E\u4E2D, \u6839\u5143\u7D20\u7C7B\u578B\u5FC5\u987B\u51FA\u73B0\u5728 "<!DOCTYPE" \u540E\u9762\u3002
- DoctypedeclUnterminated = \u6839\u5143\u7D20\u7C7B\u578B "{0}" \u7684\u6587\u6863\u7C7B\u578B\u58F0\u660E\u5FC5\u987B\u4EE5 ''>'' \u7ED3\u5C3E\u3002
- DoctypedeclNotClosed = \u6839\u5143\u7D20\u7C7B\u578B "{0}" \u7684\u6587\u6863\u7C7B\u578B\u58F0\u660E\u5FC5\u987B\u4EE5 '']'' \u7ED3\u5C3E\u3002
- PEReferenceWithinMarkup = \u53C2\u6570\u5B9E\u4F53\u5F15\u7528 "%{0};" \u4E0D\u80FD\u51FA\u73B0\u5728 DTD \u7684\u5185\u90E8\u5B50\u96C6\u4E2D\u7684\u6807\u8BB0\u5185\u3002
- MSG_MARKUP_NOT_RECOGNIZED_IN_DTD = \u6587\u6863\u7C7B\u578B\u58F0\u660E\u5305\u542B\u6216\u6307\u5411\u7684\u6807\u8BB0\u58F0\u660E\u5FC5\u987B\u683C\u5F0F\u6B63\u786E\u3002
-# 2.10 White Space Handling
- MSG_XML_SPACE_DECLARATION_ILLEGAL = "xml:space" \u7684\u5C5E\u6027\u58F0\u660E\u5FC5\u987B\u6307\u5B9A\u4E3A\u679A\u4E3E\u7C7B\u578B, \u5B83\u7684\u53EF\u80FD\u503C\u53EA\u6709 "default" \u548C "preserve"\u3002
-# 3.2 Element Type Declarations
- MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ELEMENTDECL = \u5728\u5143\u7D20\u7C7B\u578B\u58F0\u660E\u4E2D\u7684 "<!ELEMENT" \u540E\u9762\u9700\u8981\u6709\u7A7A\u683C\u3002
- MSG_ELEMENT_TYPE_REQUIRED_IN_ELEMENTDECL = \u5143\u7D20\u7C7B\u578B\u58F0\u660E\u4E2D\u9700\u8981\u6709\u5143\u7D20\u7C7B\u578B\u3002
- MSG_SPACE_REQUIRED_BEFORE_CONTENTSPEC_IN_ELEMENTDECL = \u5728\u5143\u7D20\u7C7B\u578B\u58F0\u660E\u4E2D\u7684\u5143\u7D20\u7C7B\u578B "{0}" \u540E\u9762\u9700\u8981\u6709\u7A7A\u683C\u3002
- MSG_CONTENTSPEC_REQUIRED_IN_ELEMENTDECL = \u5728\u5143\u7D20\u7C7B\u578B\u58F0\u660E\u4E2D\u7684\u5143\u7D20\u7C7B\u578B "{0}" \u540E\u9762\u9700\u8981\u6709\u7EA6\u675F\u6761\u4EF6\u3002
- ElementDeclUnterminated = \u5143\u7D20\u7C7B\u578B "{0}" \u7684\u58F0\u660E\u5FC5\u987B\u4EE5 ''>'' \u7ED3\u5C3E\u3002
-# 3.2.1 Element Content
- MSG_OPEN_PAREN_OR_ELEMENT_TYPE_REQUIRED_IN_CHILDREN = \u5728\u5143\u7D20\u7C7B\u578B "{0}" \u7684\u58F0\u660E\u4E2D\u9700\u8981\u6709 ''('' \u5B57\u7B26\u6216\u5143\u7D20\u7C7B\u578B\u3002
- MSG_CLOSE_PAREN_REQUIRED_IN_CHILDREN = \u5728\u5143\u7D20\u7C7B\u578B "{0}" \u7684\u58F0\u660E\u4E2D\u9700\u8981\u6709 '')''\u3002
-# 3.2.2 Mixed Content
- MSG_ELEMENT_TYPE_REQUIRED_IN_MIXED_CONTENT = \u5728\u5143\u7D20\u7C7B\u578B "{0}" \u7684\u58F0\u660E\u4E2D\u9700\u8981\u6709\u5143\u7D20\u7C7B\u578B\u3002
- MSG_CLOSE_PAREN_REQUIRED_IN_MIXED = \u5728\u5143\u7D20\u7C7B\u578B "{0}" \u7684\u58F0\u660E\u4E2D\u9700\u8981\u6709 '')''\u3002
- MixedContentUnterminated = \u5F53\u5B50\u5143\u7D20\u7C7B\u578B\u53D7\u7EA6\u675F\u65F6, \u6DF7\u5408\u5185\u5BB9\u6A21\u578B "{0}" \u5FC5\u987B\u4EE5 ")*" \u7ED3\u5C3E\u3002
-# 3.3 Attribute-List Declarations
- MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ATTLISTDECL = \u5728\u5C5E\u6027\u5217\u8868\u58F0\u660E\u4E2D\u7684 "<!ATTLIST" \u540E\u9762\u9700\u8981\u6709\u7A7A\u683C\u3002
- MSG_ELEMENT_TYPE_REQUIRED_IN_ATTLISTDECL = \u5C5E\u6027\u5217\u8868\u58F0\u660E\u4E2D\u9700\u8981\u6709\u5143\u7D20\u7C7B\u578B\u3002
- MSG_SPACE_REQUIRED_BEFORE_ATTRIBUTE_NAME_IN_ATTDEF = \u5728\u5143\u7D20 "{0}" \u7684\u5C5E\u6027\u5217\u8868\u58F0\u660E\u4E2D\u7684\u5C5E\u6027\u540D\u524D\u9762\u9700\u8981\u6709\u7A7A\u683C\u3002
- AttNameRequiredInAttDef = \u5728\u5143\u7D20 "{0}" \u7684\u5C5E\u6027\u5217\u8868\u58F0\u660E\u4E2D\u5FC5\u987B\u6307\u5B9A\u5C5E\u6027\u540D\u3002
- MSG_SPACE_REQUIRED_BEFORE_ATTTYPE_IN_ATTDEF = \u5728\u5143\u7D20 "{0}" \u7684\u5C5E\u6027 "{1}" \u7684\u58F0\u660E\u4E2D, \u5728\u5C5E\u6027\u7C7B\u578B\u524D\u9762\u9700\u8981\u6709\u7A7A\u683C\u3002
- AttTypeRequiredInAttDef = \u5728\u5143\u7D20 "{0}" \u7684\u5C5E\u6027 "{1}" \u7684\u58F0\u660E\u4E2D\u9700\u8981\u6709\u5C5E\u6027\u7C7B\u578B\u3002
- MSG_SPACE_REQUIRED_BEFORE_DEFAULTDECL_IN_ATTDEF = \u5728\u5143\u7D20 "{0}" \u7684\u5C5E\u6027 "{1}" \u7684\u58F0\u660E\u4E2D, \u5728\u5C5E\u6027\u9ED8\u8BA4\u503C\u524D\u9762\u9700\u8981\u6709\u7A7A\u683C\u3002
- MSG_DUPLICATE_ATTRIBUTE_DEFINITION = \u4E3A\u6307\u5B9A\u5143\u7D20 "{0}" \u7684\u540C\u4E00\u5C5E\u6027 "{1}" \u63D0\u4F9B\u4E86\u591A\u4E2A\u5C5E\u6027\u5B9A\u4E49\u3002
-# 3.3.1 Attribute Types
- MSG_SPACE_REQUIRED_AFTER_NOTATION_IN_NOTATIONTYPE = \u5728 "{1}" \u5C5E\u6027\u58F0\u660E\u4E2D, \u7A7A\u683C\u5FC5\u987B\u51FA\u73B0\u5728 "NOTATION" \u540E\u9762\u3002
- MSG_OPEN_PAREN_REQUIRED_IN_NOTATIONTYPE = \u5728 "{1}" \u5C5E\u6027\u58F0\u660E\u4E2D, "NOTATION" \u540E\u9762\u5FC5\u987B\u8DDF\u6709 ''('' \u5B57\u7B26\u3002
- MSG_NAME_REQUIRED_IN_NOTATIONTYPE = \u5728 "{1}" \u5C5E\u6027\u58F0\u660E\u7684\u8BB0\u53F7\u7C7B\u578B\u5217\u8868\u4E2D\u9700\u8981\u6709\u8BB0\u53F7\u540D\u79F0\u3002
- NotationTypeUnterminated = \u5728 "{1}" \u5C5E\u6027\u58F0\u660E\u4E2D, \u8BB0\u53F7\u7C7B\u578B\u5217\u8868\u5FC5\u987B\u4EE5 '')'' \u7ED3\u5C3E\u3002
- MSG_NMTOKEN_REQUIRED_IN_ENUMERATION = \u5728 "{1}" \u5C5E\u6027\u58F0\u660E\u7684\u679A\u4E3E\u7C7B\u578B\u5217\u8868\u4E2D\u9700\u8981\u6709\u540D\u79F0\u6807\u8BB0\u3002
- EnumerationUnterminated = \u5728 "{1}" \u5C5E\u6027\u58F0\u660E\u4E2D, \u679A\u4E3E\u7C7B\u578B\u5217\u8868\u5FC5\u987B\u4EE5 '')'' \u7ED3\u5C3E\u3002
- MSG_DISTINCT_TOKENS_IN_ENUMERATION = \u5728\u5143\u7D20 "{0}" \u7684\u5C5E\u6027 "{2}" \u7684\u58F0\u660E\u4E2D, \u679A\u4E3E\u503C "{1}" \u6307\u5B9A\u4E86\u591A\u6B21\u3002\u5355\u4E2A\u679A\u4E3E\u5C5E\u6027\u58F0\u660E\u4E2D\u7684 NMTOKENS \u5FC5\u987B\u5168\u90E8\u4E0D\u76F8\u540C\u3002
- MSG_DISTINCT_NOTATION_IN_ENUMERATION = \u5728\u5143\u7D20 "{0}" \u7684\u5C5E\u6027 "{2}" \u7684\u58F0\u660E\u4E2D, \u679A\u4E3E\u503C "{1}" \u6307\u5B9A\u4E86\u591A\u6B21\u3002\u5355\u4E2A NotationType \u5C5E\u6027\u58F0\u660E\u4E2D\u7684 NOTATION \u540D\u79F0\u5FC5\u987B\u5168\u90E8\u4E0D\u76F8\u540C\u3002
-# 3.3.2 Attribute Defaults
- MSG_SPACE_REQUIRED_AFTER_FIXED_IN_DEFAULTDECL = \u5728 "{1}" \u5C5E\u6027\u58F0\u660E\u4E2D, \u7A7A\u683C\u5FC5\u987B\u51FA\u73B0\u5728 "FIXED" \u540E\u9762\u3002
-# 3.4 Conditional Sections
- IncludeSectUnterminated = \u5305\u542B\u7684\u6761\u4EF6\u8282\u5FC5\u987B\u4EE5 "]]>" \u7ED3\u5C3E\u3002
- IgnoreSectUnterminated = \u6392\u9664\u7684\u6761\u4EF6\u8282\u5FC5\u987B\u4EE5 "]]>" \u7ED3\u5C3E\u3002
-# 4.1 Character and Entity References
- NameRequiredInPEReference = \u5728\u53C2\u6570\u5B9E\u4F53\u5F15\u7528\u4E2D, \u5B9E\u4F53\u540D\u79F0\u5FC5\u987B\u7D27\u8DDF\u5728 '%' \u540E\u9762\u3002
- SemicolonRequiredInPEReference = \u53C2\u6570\u5B9E\u4F53\u5F15\u7528 "%{0};" \u5FC5\u987B\u4EE5 '';'' \u5206\u9694\u7B26\u7ED3\u5C3E\u3002
-# 4.2 Entity Declarations
- MSG_SPACE_REQUIRED_BEFORE_ENTITY_NAME_IN_ENTITYDECL = \u5728\u5B9E\u4F53\u58F0\u660E\u4E2D\u7684 "<!ENTITY" \u540E\u9762\u9700\u8981\u6709\u7A7A\u683C\u3002
- MSG_SPACE_REQUIRED_BEFORE_PERCENT_IN_PEDECL = \u5728\u53C2\u6570\u5B9E\u4F53\u58F0\u660E\u4E2D\u7684 "<!ENTITY" \u548C '%' \u5B57\u7B26\u4E4B\u95F4\u9700\u8981\u6709\u7A7A\u683C\u3002
- MSG_SPACE_REQUIRED_BEFORE_ENTITY_NAME_IN_PEDECL = \u5728\u53C2\u6570\u5B9E\u4F53\u58F0\u660E\u4E2D\u7684 '%' \u548C\u5B9E\u4F53\u540D\u79F0\u4E4B\u95F4\u9700\u8981\u6709\u7A7A\u683C\u3002
- MSG_ENTITY_NAME_REQUIRED_IN_ENTITYDECL = \u5B9E\u4F53\u58F0\u660E\u4E2D\u9700\u8981\u6709\u5B9E\u4F53\u540D\u79F0\u3002
- MSG_SPACE_REQUIRED_AFTER_ENTITY_NAME_IN_ENTITYDECL = \u5728\u5B9E\u4F53\u58F0\u660E\u4E2D\u7684\u5B9E\u4F53\u540D\u79F0 "{0}" \u548C\u5B9A\u4E49\u4E4B\u95F4\u9700\u8981\u6709\u7A7A\u683C\u3002
- MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_UNPARSED_ENTITYDECL = \u5728\u5B9E\u4F53 "{0}" \u7684\u58F0\u660E\u4E2D\u7684 "NDATA" \u548C\u8BB0\u53F7\u540D\u79F0\u4E4B\u95F4\u9700\u8981\u6709\u7A7A\u683C\u3002
- MSG_SPACE_REQUIRED_BEFORE_NDATA_IN_UNPARSED_ENTITYDECL = \u5728\u5B9E\u4F53 "{0}" \u7684\u58F0\u660E\u4E2D\u7684 "NDATA" \u524D\u9762\u9700\u8981\u6709\u7A7A\u683C\u3002
- MSG_NOTATION_NAME_REQUIRED_FOR_UNPARSED_ENTITYDECL = \u5728\u5B9E\u4F53 "{0}" \u7684\u58F0\u660E\u4E2D\u7684 "NDATA" \u540E\u9762\u9700\u8981\u6709\u8BB0\u53F7\u540D\u79F0\u3002
- EntityDeclUnterminated = \u5B9E\u4F53 "{0}" \u7684\u58F0\u660E\u5FC5\u987B\u4EE5 ''>'' \u7ED3\u5C3E\u3002
- MSG_DUPLICATE_ENTITY_DEFINITION = \u5B9E\u4F53 "{0}" \u58F0\u660E\u4E86\u591A\u6B21\u3002
-# 4.2.2 External Entities
- ExternalIDRequired = \u5916\u90E8\u5B9E\u4F53\u58F0\u660E\u5FC5\u987B\u4EE5 "SYSTEM" \u6216 "PUBLIC" \u5F00\u5934\u3002
- MSG_SPACE_REQUIRED_BEFORE_PUBIDLITERAL_IN_EXTERNALID = \u5728 "PUBLIC" \u548C\u516C\u5171\u6807\u8BC6\u7B26\u4E4B\u95F4\u9700\u8981\u6709\u7A7A\u683C\u3002
- MSG_SPACE_REQUIRED_AFTER_PUBIDLITERAL_IN_EXTERNALID = \u5728\u516C\u5171\u6807\u8BC6\u7B26\u548C\u7CFB\u7EDF\u6807\u8BC6\u7B26\u4E4B\u95F4\u9700\u8981\u6709\u7A7A\u683C\u3002
- MSG_SPACE_REQUIRED_BEFORE_SYSTEMLITERAL_IN_EXTERNALID = \u5728 "SYSTEM" \u548C\u7CFB\u7EDF\u6807\u8BC6\u7B26\u4E4B\u95F4\u9700\u8981\u6709\u7A7A\u683C\u3002
- MSG_URI_FRAGMENT_IN_SYSTEMID = \u7247\u6BB5\u6807\u8BC6\u7B26\u4E0D\u80FD\u6307\u5B9A\u4E3A\u7CFB\u7EDF\u6807\u8BC6\u7B26 "{0}" \u7684\u4E00\u90E8\u5206\u3002
-# 4.7 Notation Declarations
- MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_NOTATIONDECL = \u5728\u8BB0\u53F7\u58F0\u660E\u4E2D\u7684 "<!NOTATION" \u540E\u9762\u9700\u8981\u6709\u7A7A\u683C\u3002
- MSG_NOTATION_NAME_REQUIRED_IN_NOTATIONDECL = \u8BB0\u53F7\u58F0\u660E\u4E2D\u9700\u8981\u6709\u8BB0\u53F7\u540D\u79F0\u3002
- MSG_SPACE_REQUIRED_AFTER_NOTATION_NAME_IN_NOTATIONDECL = \u5728\u8BB0\u53F7\u58F0\u660E\u4E2D\u7684\u8BB0\u53F7\u540D\u79F0 "{0}" \u540E\u9762\u9700\u8981\u6709\u7A7A\u683C\u3002
- ExternalIDorPublicIDRequired = \u8BB0\u53F7 "{0}" \u7684\u58F0\u660E\u5FC5\u987B\u5305\u542B\u7CFB\u7EDF\u6807\u8BC6\u7B26\u6216\u516C\u5171\u6807\u8BC6\u7B26\u3002
- NotationDeclUnterminated = \u8BB0\u53F7 "{0}" \u7684\u58F0\u660E\u5FC5\u987B\u4EE5 ''>'' \u7ED3\u5C3E\u3002
-
-# Validation messages
- DuplicateTypeInMixedContent = \u5728\u5143\u7D20\u58F0\u660E "{0}" \u7684\u5185\u5BB9\u6A21\u578B\u4E2D\u5DF2\u7ECF\u6307\u5B9A\u4E86\u5143\u7D20\u7C7B\u578B "{1}"\u3002
- ENTITIESInvalid = \u7C7B\u578B\u4E3A ENTITIES \u7684\u5C5E\u6027\u503C "{1}" \u5FC5\u987B\u662F\u4E00\u4E2A\u6216\u591A\u4E2A\u672A\u89E3\u6790\u5B9E\u4F53\u7684\u540D\u79F0\u3002
- ENTITYInvalid = \u7C7B\u578B\u4E3A ENTITY \u7684\u5C5E\u6027\u503C "{1}" \u5FC5\u987B\u662F\u672A\u89E3\u6790\u5B9E\u4F53\u7684\u540D\u79F0\u3002
- IDDefaultTypeInvalid = ID \u5C5E\u6027 "{0}" \u5FC5\u987B\u5177\u6709\u5DF2\u58F0\u660E\u7684\u9ED8\u8BA4\u503C "#IMPLIED" \u6216 "#REQUIRED"\u3002
- IDInvalid = \u7C7B\u578B\u4E3A ID \u7684\u5C5E\u6027\u503C "{0}" \u5FC5\u987B\u662F\u540D\u79F0\u3002
- IDInvalidWithNamespaces = \u542F\u7528\u540D\u79F0\u7A7A\u95F4\u65F6, \u7C7B\u578B\u4E3A ID \u7684\u5C5E\u6027\u503C "{0}" \u5FC5\u987B\u662F NCName\u3002
- IDNotUnique = \u7C7B\u578B\u4E3A ID \u7684\u5C5E\u6027\u503C "{0}" \u5728\u6587\u6863\u5185\u5FC5\u987B\u662F\u552F\u4E00\u7684\u3002
- IDREFInvalid = \u7C7B\u578B\u4E3A IDREF \u7684\u5C5E\u6027\u503C "{0}" \u5FC5\u987B\u662F\u540D\u79F0\u3002
- IDREFInvalidWithNamespaces = \u542F\u7528\u540D\u79F0\u7A7A\u95F4\u65F6, \u7C7B\u578B\u4E3A IDREF \u7684\u5C5E\u6027\u503C "{0}" \u5FC5\u987B\u662F NCName\u3002
- IDREFSInvalid = \u7C7B\u578B\u4E3A IDREFS \u7684\u5C5E\u6027\u503C "{0}" \u5FC5\u987B\u662F\u4E00\u4E2A\u6216\u591A\u4E2A\u540D\u79F0\u3002
- ILL_FORMED_PARAMETER_ENTITY_WHEN_USED_IN_DECL = \u5F53\u5B9E\u4F53\u5F15\u7528\u7528\u4F5C\u5B8C\u6574\u58F0\u660E\u65F6, \u53C2\u6570\u5B9E\u4F53 "{0}" \u7684\u66FF\u6362\u6587\u672C\u5FC5\u987B\u5305\u542B\u6B63\u786E\u5D4C\u5957\u7684\u58F0\u660E\u3002
- ImproperDeclarationNesting = \u53C2\u6570\u5B9E\u4F53 "{0}" \u7684\u66FF\u6362\u6587\u672C\u5FC5\u987B\u5305\u542B\u6B63\u786E\u5D4C\u5957\u7684\u58F0\u660E\u3002
- ImproperGroupNesting = \u53C2\u6570\u5B9E\u4F53 "{0}" \u7684\u66FF\u6362\u6587\u672C\u5FC5\u987B\u5305\u542B\u6B63\u786E\u5D4C\u5957\u7684\u62EC\u53F7\u5BF9\u3002
- INVALID_PE_IN_CONDITIONAL = \u53C2\u6570\u5B9E\u4F53 "{0}" \u7684\u66FF\u6362\u6587\u672C\u5FC5\u987B\u5305\u542B\u6574\u4E2A\u6761\u4EF6\u8282, \u6216\u8005\u4EC5\u5305\u542B INCLUDE \u6216 IGNORE\u3002
- MSG_ATTRIBUTE_NOT_DECLARED = \u5FC5\u987B\u4E3A\u5143\u7D20\u7C7B\u578B "{0}" \u58F0\u660E\u5C5E\u6027 "{1}"\u3002
- MSG_ATTRIBUTE_VALUE_NOT_IN_LIST = \u503C\u4E3A "{1}" \u7684\u5C5E\u6027 "{0}" \u5FC5\u987B\u5177\u6709\u5217\u8868 "{2}" \u4E2D\u7684\u503C\u3002
- MSG_ATTVALUE_CHANGED_DURING_NORMALIZATION_WHEN_STANDALONE = \u5728\u72EC\u7ACB\u6587\u6863\u4E2D, \u5C5E\u6027 "{0}" \u7684\u503C "{1}" \u4E0D\u80FD\u901A\u8FC7\u89C4\u8303\u5316\u8FDB\u884C\u66F4\u6539 (\u66F4\u6539\u4E3A "{2}")\u3002
- MSG_CONTENT_INCOMPLETE = \u5143\u7D20\u7C7B\u578B\u4E3A "{0}" \u7684\u5185\u5BB9\u4E0D\u5B8C\u6574, \u5B83\u5FC5\u987B\u5339\u914D "{1}"\u3002
- MSG_CONTENT_INVALID = \u5143\u7D20\u7C7B\u578B\u4E3A "{0}" \u7684\u5185\u5BB9\u5FC5\u987B\u5339\u914D "{1}"\u3002
- MSG_CONTENT_INVALID_SPECIFIED = \u5143\u7D20\u7C7B\u578B\u4E3A "{0}" \u7684\u5185\u5BB9\u5FC5\u987B\u5339\u914D "{1}"\u3002\u4E0D\u5141\u8BB8\u4F7F\u7528\u7C7B\u578B\u4E3A "{2}" \u7684\u5B50\u7EA7\u3002
- MSG_DEFAULTED_ATTRIBUTE_NOT_SPECIFIED = \u5143\u7D20\u7C7B\u578B\u4E3A "{0}" \u7684\u5C5E\u6027 "{1}" \u5177\u6709\u9ED8\u8BA4\u503C, \u5E76\u4E14\u5FC5\u987B\u5728\u72EC\u7ACB\u6587\u6863\u4E2D\u6307\u5B9A\u3002
- MSG_DUPLICATE_ATTDEF = \u5DF2\u7ECF\u4E3A\u5143\u7D20\u7C7B\u578B "{0}" \u58F0\u660E\u5C5E\u6027 "{1}"\u3002
- MSG_ELEMENT_ALREADY_DECLARED = \u5143\u7D20\u7C7B\u578B "{0}" \u4E0D\u80FD\u58F0\u660E\u591A\u6B21\u3002
- MSG_ELEMENT_NOT_DECLARED = \u5FC5\u987B\u58F0\u660E\u5143\u7D20\u7C7B\u578B "{0}"\u3002
- MSG_GRAMMAR_NOT_FOUND = \u6587\u6863\u65E0\u6548: \u627E\u4E0D\u5230\u8BED\u6CD5\u3002
- MSG_ELEMENT_WITH_ID_REQUIRED = \u6587\u6863\u4E2D\u5FC5\u987B\u5305\u542B\u6807\u8BC6\u7B26\u4E3A "{0}" \u7684\u5143\u7D20\u3002
- MSG_EXTERNAL_ENTITY_NOT_PERMITTED = \u5728\u72EC\u7ACB\u6587\u6863\u4E2D\u4E0D\u5141\u8BB8\u5F15\u7528\u5916\u90E8\u5B9E\u4F53 "{0}"\u3002
- MSG_FIXED_ATTVALUE_INVALID = \u503C\u4E3A "{2}" \u7684\u5C5E\u6027 "{1}" \u5FC5\u987B\u5177\u6709 "{3}" \u7684\u503C\u3002
- MSG_MORE_THAN_ONE_ID_ATTRIBUTE = \u5143\u7D20\u7C7B\u578B "{0}" \u5DF2\u7ECF\u5177\u6709\u7C7B\u578B\u4E3A ID \u7684\u5C5E\u6027 "{1}", \u4E0D\u5141\u8BB8\u4F7F\u7528\u7C7B\u578B\u4E3A ID \u7684\u53E6\u4E00\u4E2A\u5C5E\u6027 "{2}"\u3002
- MSG_MORE_THAN_ONE_NOTATION_ATTRIBUTE = \u5143\u7D20\u7C7B\u578B "{0}" \u5DF2\u7ECF\u5177\u6709\u7C7B\u578B\u4E3A NOTATION \u7684\u5C5E\u6027 "{1}", \u4E0D\u5141\u8BB8\u4F7F\u7528\u7C7B\u578B\u4E3A NOTATION \u7684\u53E6\u4E00\u4E2A\u5C5E\u6027 "{2}"\u3002
- MSG_NOTATION_NOT_DECLARED_FOR_NOTATIONTYPE_ATTRIBUTE = \u5728\u5C5E\u6027 "{0}" \u7684\u8BB0\u53F7\u7C7B\u578B\u5217\u8868\u4E2D\u5F15\u7528\u8BB0\u53F7 "{1}" \u65F6, \u5FC5\u987B\u58F0\u660E\u8BE5\u8BB0\u53F7\u3002
- MSG_NOTATION_NOT_DECLARED_FOR_UNPARSED_ENTITYDECL = \u5728 "{0}" \u7684\u672A\u89E3\u6790\u5B9E\u4F53\u58F0\u660E\u4E2D\u5F15\u7528\u8BB0\u53F7 "{1}" \u65F6, \u5FC5\u987B\u58F0\u660E\u8BE5\u8BB0\u53F7\u3002
- MSG_REFERENCE_TO_EXTERNALLY_DECLARED_ENTITY_WHEN_STANDALONE = \u5728\u72EC\u7ACB\u6587\u6863\u4E2D\u4E0D\u5141\u8BB8\u5F15\u7528\u5DF2\u89E3\u6790\u7684\u5916\u90E8\u5B9E\u4F53\u4E2D\u58F0\u660E\u7684\u5B9E\u4F53 "{0}"\u3002
- MSG_REQUIRED_ATTRIBUTE_NOT_SPECIFIED = \u9700\u8981\u5C5E\u6027 "{1}", \u5E76\u4E14\u5FC5\u987B\u4E3A\u5143\u7D20\u7C7B\u578B "{0}" \u6307\u5B9A\u8BE5\u5C5E\u6027\u3002
- MSG_WHITE_SPACE_IN_ELEMENT_CONTENT_WHEN_STANDALONE = \u5BF9\u4E8E\u5728\u72EC\u7ACB\u6587\u6863\u4E2D\u5177\u6709\u5143\u7D20\u5185\u5BB9\u7684\u5DF2\u89E3\u6790\u7684\u5916\u90E8\u5B9E\u4F53, \u5728\u8BE5\u5B9E\u4F53\u4E2D\u58F0\u660E\u7684\u5143\u7D20\u4E4B\u95F4\u4E0D\u80FD\u51FA\u73B0\u7A7A\u683C\u3002
- NMTOKENInvalid = \u7C7B\u578B\u4E3A NMTOKEN \u7684\u5C5E\u6027\u503C "{0}" \u5FC5\u987B\u662F\u540D\u79F0\u6807\u8BB0\u3002
- NMTOKENSInvalid = \u7C7B\u578B\u4E3A NMTOKENS \u7684\u5C5E\u6027\u503C "{0}" \u5FC5\u987B\u662F\u4E00\u4E2A\u6216\u591A\u4E2A\u540D\u79F0\u6807\u8BB0\u3002
- NoNotationOnEmptyElement = \u5DF2\u58F0\u660E\u4E3A EMPTY \u7684\u5143\u7D20\u7C7B\u578B "{0}" \u4E0D\u80FD\u58F0\u660E\u7C7B\u578B\u4E3A NOTATION \u7684\u5C5E\u6027 "{1}"\u3002
- RootElementTypeMustMatchDoctypedecl = \u6587\u6863\u6839\u5143\u7D20 "{1}" \u5FC5\u987B\u5339\u914D DOCTYPE \u6839 "{0}"\u3002
- UndeclaredElementInContentSpec = \u5143\u7D20 "{0}" \u7684\u5185\u5BB9\u6A21\u578B\u5F15\u7528\u672A\u58F0\u660E\u7684\u5143\u7D20 "{1}"\u3002
- UniqueNotationName = \u8BB0\u53F7 "{0}" \u7684\u58F0\u660E\u4E0D\u662F\u552F\u4E00\u7684\u3002\u4E0D\u80FD\u5728\u591A\u4E2A\u8BB0\u53F7\u58F0\u660E\u4E2D\u58F0\u660E\u6307\u5B9A\u7684\u540D\u79F0\u3002
- ENTITYFailedInitializeGrammar = ENTITYDatatype \u9A8C\u8BC1\u7A0B\u5E8F: \u672A\u80FD\u4F7F\u7528\u6709\u6548\u7684\u8BED\u6CD5\u5F15\u7528\u8C03\u7528\u521D\u59CB\u5316\u65B9\u6CD5\u3002\t
- ENTITYNotUnparsed = ENTITY "{0}" \u4E0D\u662F\u672A\u89E3\u6790\u7684\u3002
- ENTITYNotValid = ENTITY "{0}" \u65E0\u6548\u3002
- EmptyList = \u7C7B\u578B\u4E3A ENTITIES, IDREFS \u548C NMTOKENS \u7684\u503C\u4E0D\u80FD\u662F\u7A7A\u5217\u8868\u3002
-
-# Entity related messages
-# 3.1 Start-Tags, End-Tags, and Empty-Element Tags
- ReferenceToExternalEntity = \u5C5E\u6027\u503C\u4E2D\u4E0D\u5141\u8BB8\u91C7\u7528\u5916\u90E8\u5B9E\u4F53\u5F15\u7528 "&{0};"\u3002
- AccessExternalDTD = \u5916\u90E8 DTD: \u65E0\u6CD5\u8BFB\u53D6\u5916\u90E8 DTD ''{0}'', \u56E0\u4E3A accessExternalDTD \u5C5E\u6027\u8BBE\u7F6E\u7684\u9650\u5236\u5BFC\u81F4\u4E0D\u5141\u8BB8 ''{1}'' \u8BBF\u95EE\u3002
- AccessExternalEntity = \u5916\u90E8\u5B9E\u4F53: \u65E0\u6CD5\u8BFB\u53D6\u5916\u90E8\u6587\u6863 ''{0}'', \u56E0\u4E3A accessExternalDTD \u5C5E\u6027\u8BBE\u7F6E\u7684\u9650\u5236\u5BFC\u81F4\u4E0D\u5141\u8BB8 ''{1}'' \u8BBF\u95EE\u3002
-
-# 4.1 Character and Entity References
- EntityNotDeclared = \u5F15\u7528\u4E86\u5B9E\u4F53 "{0}", \u4F46\u672A\u58F0\u660E\u5B83\u3002
- ReferenceToUnparsedEntity = \u4E0D\u5141\u8BB8\u4F7F\u7528\u672A\u89E3\u6790\u7684\u5B9E\u4F53\u5F15\u7528 "&{0};"\u3002
- RecursiveReference = \u9012\u5F52\u5B9E\u4F53\u5F15\u7528 "{0}"\u3002(\u5F15\u7528\u8DEF\u5F84: {1}),
- RecursiveGeneralReference = \u9012\u5F52\u4E00\u822C\u5B9E\u4F53\u5F15\u7528 "&{0};"\u3002(\u5F15\u7528\u8DEF\u5F84: {1}),
- RecursivePEReference = \u9012\u5F52\u53C2\u6570\u5B9E\u4F53\u5F15\u7528 "%{0};"\u3002(\u5F15\u7528\u8DEF\u5F84: {1}),
-# 4.3.3 Character Encoding in Entities
- EncodingNotSupported = \u4E0D\u652F\u6301\u7F16\u7801 "{0}"\u3002
- EncodingRequired = \u5982\u679C\u5DF2\u89E3\u6790\u7684\u5B9E\u4F53\u672A\u4F7F\u7528 UTF-8 \u6216 UTF-16 \u8FDB\u884C\u7F16\u7801, \u5219\u8BE5\u5B9E\u4F53\u5FC5\u987B\u5305\u542B\u7F16\u7801\u58F0\u660E\u3002
-
-# Namespaces support
-# 4. Using Qualified Names
- IllegalQName = \u5143\u7D20\u6216\u5C5E\u6027\u4E0D\u5339\u914D QName \u751F\u4EA7: QName::=(NCName':')?NCName\u3002
- ElementXMLNSPrefix = \u5143\u7D20 "{0}" \u4E0D\u80FD\u4F7F\u7528 "xmlns" \u4F5C\u4E3A\u524D\u7F00\u3002
- ElementPrefixUnbound = \u5143\u7D20 "{1}" \u7684\u524D\u7F00 "{0}" \u672A\u7ED1\u5B9A\u3002
- AttributePrefixUnbound = \u4E0E\u5143\u7D20\u7C7B\u578B "{0}" \u76F8\u5173\u8054\u7684\u5C5E\u6027 "{1}" \u7684\u524D\u7F00 "{2}" \u672A\u7ED1\u5B9A\u3002
- EmptyPrefixedAttName = \u5C5E\u6027 "{0}" \u7684\u503C\u65E0\u6548\u3002\u5E26\u524D\u7F00\u7684\u540D\u79F0\u7A7A\u95F4\u7ED1\u5B9A\u4E0D\u80FD\u4E3A\u7A7A\u3002
- PrefixDeclared = \u672A\u58F0\u660E\u540D\u79F0\u7A7A\u95F4\u524D\u7F00 "{0}"\u3002
- CantBindXMLNS = \u524D\u7F00 "xmlns" \u4E0D\u80FD\u663E\u5F0F\u7ED1\u5B9A\u5230\u4EFB\u4F55\u540D\u79F0\u7A7A\u95F4; "xmlns" \u7684\u540D\u79F0\u7A7A\u95F4\u4E5F\u4E0D\u80FD\u663E\u5F0F\u7ED1\u5B9A\u5230\u4EFB\u4F55\u524D\u7F00\u3002
- CantBindXML = \u524D\u7F00 "xml" \u4E0D\u80FD\u7ED1\u5B9A\u5230\u9664\u5B83\u7684\u5E38\u7528\u540D\u79F0\u7A7A\u95F4\u5916\u7684\u4EFB\u4F55\u540D\u79F0\u7A7A\u95F4; "xml" \u7684\u540D\u79F0\u7A7A\u95F4\u4E5F\u4E0D\u80FD\u7ED1\u5B9A\u5230\u9664 "xml" \u5916\u7684\u4EFB\u4F55\u524D\u7F00\u3002
- MSG_ATT_DEFAULT_INVALID = \u5C5E\u6027 "{0}" \u7684 defaultValue "{1}" \u975E\u6CD5, \u56E0\u4E3A\u6B64\u5C5E\u6027\u7C7B\u578B\u5177\u6709\u8BCD\u6C47\u7EA6\u675F\u6761\u4EF6\u3002
-
-# REVISIT: These need messages
- MSG_SPACE_REQUIRED_AFTER_SYSTEMLITERAL_IN_EXTERNALID=MSG_SPACE_REQUIRED_AFTER_SYSTEMLITERAL_IN_EXTERNALID
- OpenQuoteMissingInDecl=OpenQuoteMissingInDecl
- InvalidCharInLiteral=InvalidCharInLiteral
-
-
-# Implementation limits
- EntityExpansionLimit=JAXP00010001: \u89E3\u6790\u5668\u5728\u6B64\u6587\u6863\u4E2D\u9047\u5230\u591A\u4E2A "{0}" \u5B9E\u4F53\u6269\u5C55; \u8FD9\u662F JDK \u65BD\u52A0\u7684\u9650\u5236\u3002
- ElementAttributeLimit=JAXP00010002: \u5143\u7D20 "{0}" \u5177\u6709\u591A\u4E2A "{1}" \u5C5E\u6027, "{1}" \u662F JDK \u65BD\u52A0\u7684\u9650\u5236\u3002
- MaxEntitySizeLimit=JAXP00010003: \u5B9E\u4F53 "{0}" \u7684\u957F\u5EA6\u4E3A "{1}", \u8D85\u8FC7\u4E86 "{3}" \u8BBE\u7F6E\u7684 "{2}" \u9650\u5236\u3002
- TotalEntitySizeLimit=JAXP00010004: \u5B9E\u4F53\u7684\u7D2F\u8BA1\u5927\u5C0F\u4E3A "{0}", \u8D85\u8FC7\u4E86 "{2}" \u8BBE\u7F6E\u7684 "{1}" \u9650\u5236\u3002
- MaxXMLNameLimit=JAXP00010005: \u5B9E\u4F53 "{0}" \u7684\u957F\u5EA6\u4E3A "{1}", \u8D85\u8FC7\u4E86 "{3}" \u8BBE\u7F6E\u7684 "{2}" \u9650\u5236\u3002
- MaxElementDepthLimit=JAXP00010006: \u5143\u7D20 "{0}" \u7684\u6DF1\u5EA6 "{1}" \u8D85\u8FC7\u4E86 "{3}" \u8BBE\u7F6E\u7684\u9650\u5236 "{2}"\u3002
- EntityReplacementLimit=JAXP00010007: \u5B9E\u4F53\u5F15\u7528\u4E2D\u7684\u8282\u70B9\u603B\u6570\u4E3A "{0}", \u8D85\u8FC7\u4E86 "{2}" \u8BBE\u7F6E\u7684\u9650\u5236 "{1}"\u3002
-
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_TW.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_TW.properties
deleted file mode 100644
index 80e01f2..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_TW.properties
+++ /dev/null
@@ -1,305 +0,0 @@
-# This file contains error and warning messages related to XML
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-# @version
-
- BadMessageKey = \u627E\u4E0D\u5230\u5C0D\u61C9\u8A0A\u606F\u7D22\u5F15\u9375\u7684\u932F\u8AA4\u8A0A\u606F\u3002
- FormatFailed = \u683C\u5F0F\u5316\u4E0B\u5217\u8A0A\u606F\u6642\u767C\u751F\u5167\u90E8\u932F\u8AA4:\n
-
-# Document messages
- PrematureEOF=\u6A94\u6848\u63D0\u65E9\u7D50\u675F\u3002
-# 2.1 Well-Formed XML Documents
- RootElementRequired = \u683C\u5F0F\u6B63\u78BA\u7684\u6587\u4EF6\u9700\u8981\u6839\u5143\u7D20\u3002
-# 2.2 Characters
-
- InvalidCharInCDSect = \u5728 CDATA \u6BB5\u843D\u4E2D\u627E\u5230\u7121\u6548\u7684 XML \u5B57\u5143 (Unicode: 0x{0})\u3002
- InvalidCharInContent = \u5728\u6587\u4EF6\u5143\u7D20\u5167\u5BB9\u4E2D\u627E\u5230\u7121\u6548\u7684 XML \u5B57\u5143 (Unicode: 0x{0})\u3002
- TwoColonsInQName = \u5728\u5143\u7D20\u985E\u578B\u6216\u5C6C\u6027\u540D\u7A31\u4E2D\u627E\u5230\u7121\u6548\u7684\u7B2C\u4E8C\u500B ':'\u3002
- ColonNotLegalWithNS = \u555F\u7528\u547D\u540D\u7A7A\u9593\u6642\uFF0C\u540D\u7A31 ''{0}'' \u4E2D\u4E0D\u5141\u8A31\u5192\u865F\u3002
- InvalidCharInMisc = \u5728\u5143\u7D20\u5167\u5BB9\u7D50\u675F\u5F8C\u7684\u6A19\u8A18\u4E2D\u627E\u5230\u7121\u6548\u7684 XML \u5B57\u5143 (Unicode: 0x{0})\u3002
- InvalidCharInProlog = \u5728\u6587\u4EF6\u5BA3\u544A\u96C6\u4E2D\u627E\u5230\u7121\u6548\u7684 XML \u5B57\u5143 (Unicode: 0x{0})\u3002
- InvalidCharInXMLDecl = \u5728 XML \u5BA3\u544A\u4E2D\u627E\u5230\u7121\u6548\u7684 XML \u5B57\u5143 (Unicode: 0x{0})\u3002
-# 2.4 Character Data and Markup
- CDEndInContent = \u5B57\u5143\u9806\u5E8F "]]>" \u4E0D\u53EF\u51FA\u73FE\u5728\u5167\u5BB9\u4E2D\uFF0C\u9664\u975E\u7528\u65BC\u6A19\u793A CDATA \u6BB5\u843D\u7684\u7D50\u5C3E\u3002
-# 2.7 CDATA Sections
- CDSectUnterminated = CDATA \u6BB5\u843D\u7D50\u5C3E\u5FC5\u9808\u662F "]]>"\u3002
-# 2.8 Prolog and Document Type Declaration
- XMLDeclMustBeFirst = XML \u5BA3\u544A\u50C5\u80FD\u51FA\u73FE\u5728\u6587\u4EF6\u7684\u958B\u982D\u3002
- EqRequiredInXMLDecl = \u5728 XML \u5BA3\u544A\u4E2D\uFF0C'' = '' \u5B57\u5143\u5FC5\u9808\u7DCA\u63A5\u5728 "{0}" \u4E4B\u5F8C\u3002
- QuoteRequiredInXMLDecl = \u5728 XML \u5BA3\u544A\u4E2D\uFF0C"{0}" \u4E4B\u5F8C\u7684\u503C\u5FC5\u9808\u662F\u4EE5\u5F15\u865F\u62EC\u4F4F\u7684\u5B57\u4E32\u3002
- XMLDeclUnterminated = XML \u5BA3\u544A\u7D50\u5C3E\u5FC5\u9808\u662F "?>"\u3002
- VersionInfoRequired = XML \u5BA3\u544A\u4E2D\u9700\u8981\u7248\u672C\u3002
- SpaceRequiredBeforeVersionInXMLDecl = \u5728 XML \u5BA3\u544A\u4E2D\uFF0C\u7248\u672C\u865B\u64EC\u5C6C\u6027\u4E4B\u524D\u9700\u8981\u6709\u7A7A\u683C\u3002
- SpaceRequiredBeforeEncodingInXMLDecl = \u5728 XML \u5BA3\u544A\u4E2D\uFF0C\u7DE8\u78BC\u865B\u64EC\u5C6C\u6027\u4E4B\u524D\u9700\u8981\u6709\u7A7A\u683C\u3002
- SpaceRequiredBeforeStandalone = \u5728 XML \u5BA3\u544A\u4E2D\uFF0C\u7DE8\u78BC\u865B\u64EC\u5C6C\u6027\u4E4B\u524D\u9700\u8981\u6709\u7A7A\u683C\u3002
- MarkupNotRecognizedInProlog = \u6587\u4EF6\u4E2D\u6839\u5143\u7D20\u524D\u7684\u6A19\u8A18\u5FC5\u9808\u683C\u5F0F\u6B63\u78BA\u3002
- MarkupNotRecognizedInMisc = \u6587\u4EF6\u4E2D\u6839\u5143\u7D20\u5F8C\u7684\u6A19\u8A18\u5FC5\u9808\u683C\u5F0F\u6B63\u78BA\u3002
- AlreadySeenDoctype = doctype \u5DF2\u7D93\u51FA\u73FE\u904E\u3002
- DoctypeNotAllowed = \u7576\u529F\u80FD "http://apache.org/xml/features/disallow-doctype-decl" \u8A2D\u70BA\u771F\u6642\uFF0C\u4E0D\u5141\u8A31 DOCTYPE\u3002
- ContentIllegalInProlog = \u5BA3\u544A\u96C6\u4E2D\u4E0D\u5141\u8A31\u5167\u5BB9\u3002
- ReferenceIllegalInProlog = \u5BA3\u544A\u96C6\u4E2D\u4E0D\u5141\u8A31\u53C3\u7167\u3002
-# Trailing Misc
- ContentIllegalInTrailingMisc=\u5C3E\u7AEF\u6BB5\u843D\u4E2D\u4E0D\u5141\u8A31\u5167\u5BB9\u3002
- ReferenceIllegalInTrailingMisc=\u5C3E\u7AEF\u6BB5\u843D\u4E2D\u4E0D\u5141\u8A31\u53C3\u7167\u3002
-
-# 2.9 Standalone Document Declaration
- SDDeclInvalid = \u7368\u7ACB\u6587\u4EF6\u5BA3\u544A\u503C\u5FC5\u9808\u662F "yes" \u6216 "no"\uFF0C\u800C\u975E "{0}"\u3002
- SDDeclNameInvalid = XML \u5BA3\u544A\u4E2D\u7684\u7368\u7ACB\u540D\u7A31\u53EF\u80FD\u62FC\u932F\u4E86\u3002
-# 2.12 Language Identification
- XMLLangInvalid = xml:lang \u5C6C\u6027\u503C "{0}" \u70BA\u7121\u6548\u7684\u8A9E\u8A00 ID\u3002
-# 3. Logical Structures
- ETagRequired = \u5143\u7D20\u985E\u578B "{0}" \u5FC5\u9808\u7531\u914D\u5C0D\u7684\u7D50\u675F\u6A19\u8A18 "</{0}>" \u7D42\u6B62\u3002
-# 3.1 Start-Tags, End-Tags, and Empty-Element Tags
- ElementUnterminated = \u5143\u7D20\u985E\u578B "{0}" \u4E4B\u5F8C\u5FC5\u9808\u7DCA\u63A5\u5C6C\u6027\u8A2D\u5B9A ">" \u6216 "/>"\u3002
- EqRequiredInAttribute = \u95DC\u806F\u5143\u7D20\u985E\u578B "{0}" \u7684\u5C6C\u6027\u540D\u7A31 "{1}" \u4E4B\u5F8C\u5FC5\u9808\u7DCA\u63A5 '' = '' \u5B57\u5143\u3002
- OpenQuoteExpected = \u95DC\u806F\u5143\u7D20\u985E\u578B "{0}" \u7684\u5C6C\u6027 "{1}" \u9810\u671F\u6709\u958B\u982D\u5F15\u865F\u3002
- CloseQuoteExpected = \u95DC\u806F\u5143\u7D20\u985E\u578B "{0}" \u7684\u5C6C\u6027 "{1}" \u9810\u671F\u6709\u7D50\u675F\u5F15\u865F\u3002
- AttributeNotUnique = \u5DF2\u7D93\u70BA\u5143\u7D20 "{0}" \u6307\u5B9A\u5C6C\u6027 "{1}"\u3002
- AttributeNSNotUnique = \u5DF2\u7D93\u70BA\u5143\u7D20 "{0}" \u6307\u5B9A\u9023\u7D50\u547D\u540D\u7A7A\u9593 "{2}" \u7684\u5C6C\u6027 "{1}"\u3002
- ETagUnterminated = \u5143\u7D20\u985E\u578B "{0}" \u7684\u7D50\u675F\u6A19\u8A18\u7D50\u5C3E\u5FC5\u9808\u662F ''>'' \u5206\u754C\u5B57\u5143\u3002
- MarkupNotRecognizedInContent = \u5143\u7D20\u7684\u5167\u5BB9\u5FC5\u9808\u7531\u683C\u5F0F\u6B63\u78BA\u7684\u4F4D\u63CF\u8FF0\u8CC7\u6599\u6216\u6A19\u8A18\u6240\u7D44\u6210\u3002
- DoctypeIllegalInContent = \u5167\u5BB9\u4E0D\u5141\u8A31 DOCTYPE\u3002
-# 4.1 Character and Entity References
- ReferenceUnterminated = \u53C3\u7167\u5FC5\u9808\u7531 ';' \u5206\u754C\u5B57\u5143\u7D42\u6B62\u3002
-# 4.3.2 Well-Formed Parsed Entities
- ReferenceNotInOneEntity = \u53C3\u7167\u5FC5\u9808\u6574\u500B\u5305\u542B\u5728\u76F8\u540C\u7684\u5256\u6790\u5BE6\u9AD4\u5167\u3002
- ElementEntityMismatch = \u5143\u7D20 "{0}" \u7684\u958B\u982D\u8207\u7D50\u5C3E\u5FC5\u9808\u5728\u76F8\u540C\u5BE6\u9AD4\u5167\u3002
- MarkupEntityMismatch=XML \u6587\u4EF6\u7D50\u69CB\u7684\u958B\u982D\u8207\u7D50\u5C3E\u5FC5\u9808\u5728\u76F8\u540C\u5BE6\u9AD4\u5167\u3002
-
-# Messages common to Document and DTD
-# 2.2 Characters
- InvalidCharInAttValue = \u5728\u5C6C\u6027 "{1}" \u7684\u503C\u4E2D\u627E\u5230\u7121\u6548\u7684 XML \u5B57\u5143 (Unicode: 0x{2}) \u4E14\u5143\u7D20\u70BA "{0}"\u3002
- InvalidCharInComment = \u5728\u8A3B\u89E3\u4E2D\u627E\u5230\u7121\u6548\u7684 XML \u5B57\u5143 (Unicode: 0x{0})\u3002
- InvalidCharInPI = \u5728\u8655\u7406\u6307\u793A\u4E2D\u627E\u5230\u7121\u6548\u7684 XML \u5B57\u5143 (Unicode: 0x{0})\u3002
- InvalidCharInInternalSubset = \u5728 DTD \u5167\u90E8\u5B50\u96C6\u4E2D\u627E\u5230\u7121\u6548\u7684 XML \u5B57\u5143 (Unicode: 0x{0})\u3002
- InvalidCharInTextDecl = \u5728\u6587\u5B57\u5BA3\u544A\u4E2D\u627E\u5230\u7121\u6548\u7684 XML \u5B57\u5143 (Unicode: 0x{0})\u3002
-# 2.3 Common Syntactic Constructs
- QuoteRequiredInAttValue = \u5C6C\u6027 "{1}" \u7684\u503C\u958B\u982D\u5FC5\u9808\u70BA\u55AE\u5F15\u865F\u6216\u96D9\u5F15\u865F\u5B57\u5143\u3002
- LessthanInAttValue = \u95DC\u806F\u5143\u7D20\u985E\u578B "{0}" \u4E4B\u5C6C\u6027 "{1}" \u7684\u503C\u4E0D\u53EF\u5305\u542B ''<'' \u5B57\u5143\u3002
- AttributeValueUnterminated = \u5C6C\u6027 "{1}" \u7684\u503C\u7D50\u5C3E\u5FC5\u9808\u662F\u914D\u5C0D\u7684\u5F15\u865F\u5B57\u5143\u3002
-# 2.5 Comments
- InvalidCommentStart = \u8A3B\u89E3\u958B\u982D\u5FC5\u9808\u70BA "<!--"\u3002
- DashDashInComment = \u8A3B\u89E3\u4E0D\u5141\u8A31\u5B57\u4E32 "--"\u3002
- CommentUnterminated = \u8A3B\u89E3\u7D50\u5C3E\u5FC5\u9808\u70BA "-->"\u3002
- COMMENT_NOT_IN_ONE_ENTITY = \u8A3B\u89E3\u672A\u5305\u542B\u5728\u76F8\u540C\u5BE6\u9AD4\u5167\u3002
-# 2.6 Processing Instructions
- PITargetRequired = \u8655\u7406\u6307\u793A\u7684\u958B\u982D\u5FC5\u9808\u662F\u76EE\u6A19\u7684\u540D\u7A31\u3002
- SpaceRequiredInPI = \u8655\u7406\u6307\u793A\u76EE\u6A19\u8207\u8CC7\u6599\u4E4B\u9593\u9700\u8981\u7A7A\u683C\u3002
- PIUnterminated = \u8655\u7406\u6307\u793A\u7D50\u5C3E\u5FC5\u9808\u662F "?>"\u3002
- ReservedPITarget = \u4E0D\u5141\u8A31\u7B26\u5408 "[xX][mM][lL]" \u7684\u8655\u7406\u6307\u793A\u76EE\u6A19\u3002
- PI_NOT_IN_ONE_ENTITY = \u8655\u7406\u6307\u793A\u672A\u5305\u542B\u5728\u76F8\u540C\u5BE6\u9AD4\u5167\u3002
-# 2.8 Prolog and Document Type Declaration
- VersionInfoInvalid = \u7121\u6548\u7684\u7248\u672C "{0}"\u3002
- VersionNotSupported = \u4E0D\u652F\u63F4 XML \u7248\u672C "{0}"\uFF0C\u50C5\u652F\u63F4 XML 1.0\u3002
- VersionNotSupported11 = \u4E0D\u652F\u63F4 XML \u7248\u672C "{0}"\uFF0C\u50C5\u652F\u63F4 XML 1.0 \u8207 XML 1.1\u3002
- VersionMismatch= \u5BE6\u9AD4\u4E0D\u53EF\u5305\u542B\u8F03\u65B0\u7248\u672C\u7684\u5176\u4ED6\u5BE6\u9AD4\u3002
-# 4.1 Character and Entity References
- DigitRequiredInCharRef = \u5728\u5B57\u5143\u53C3\u7167\u4E2D\uFF0C\u5341\u9032\u4F4D\u8868\u793A\u6CD5\u5FC5\u9808\u7DCA\u63A5\u5728 "&#" \u4E4B\u5F8C\u3002
- HexdigitRequiredInCharRef = \u5728\u5B57\u5143\u53C3\u7167\u4E2D\uFF0C\u5341\u516D\u9032\u4F4D\u8868\u793A\u6CD5\u5FC5\u9808\u7DCA\u63A5\u5728 "&#x" \u4E4B\u5F8C\u3002
- SemicolonRequiredInCharRef = \u5B57\u5143\u53C3\u7167\u7684\u7D50\u5C3E\u5FC5\u9808\u662F ';' \u5206\u754C\u5B57\u5143\u3002
- InvalidCharRef = \u5B57\u5143\u53C3\u7167 "&#{0}" \u70BA\u7121\u6548\u7684 XML \u5B57\u5143\u3002
- NameRequiredInReference = \u5728\u5BE6\u9AD4\u53C3\u7167\u4E2D\uFF0C\u5BE6\u9AD4\u540D\u7A31\u5FC5\u9808\u7DCA\u63A5\u5728 '&' \u4E4B\u5F8C\u3002
- SemicolonRequiredInReference = \u5BE6\u9AD4 "{0}" \u7684\u53C3\u7167\u7D50\u5C3E\u5FC5\u9808\u70BA '';'' \u5206\u754C\u5B57\u5143\u3002
-# 4.3.1 The Text Declaration
- TextDeclMustBeFirst = \u6587\u5B57\u5BA3\u544A\u50C5\u80FD\u51FA\u73FE\u5728\u5916\u90E8\u5256\u6790\u5BE6\u9AD4\u7684\u958B\u982D\u3002
- EqRequiredInTextDecl = \u5728\u6587\u5B57\u5BA3\u544A\u4E2D\uFF0C'' = '' \u5B57\u5143\u5FC5\u9808\u7DCA\u63A5\u5728 "{0}" \u4E4B\u5F8C\u3002
- QuoteRequiredInTextDecl = \u6587\u5B57\u5BA3\u544A\u4E2D "{0}" \u4E4B\u5F8C\u7684\u503C\u5FC5\u9808\u662F\u4EE5\u5F15\u865F\u62EC\u4F4F\u7684\u5B57\u4E32\u3002
- CloseQuoteMissingInTextDecl = \u6587\u5B57\u5BA3\u544A\u4E2D\uFF0C\u907A\u6F0F "{0}" \u4E4B\u5F8C\u7684\u503C\u7684\u7D50\u675F\u5F15\u865F\u3002
- SpaceRequiredBeforeVersionInTextDecl = \u5728\u6587\u5B57\u5BA3\u544A\u4E2D\uFF0C\u7248\u672C\u865B\u64EC\u5C6C\u6027\u4E4B\u524D\u9700\u8981\u6709\u7A7A\u683C\u3002
- SpaceRequiredBeforeEncodingInTextDecl = \u5728\u6587\u5B57\u5BA3\u544A\u4E2D\uFF0C\u7DE8\u78BC\u865B\u64EC\u5C6C\u6027\u4E4B\u524D\u9700\u8981\u6709\u7A7A\u683C\u3002
- TextDeclUnterminated = \u6587\u5B57\u5BA3\u544A\u7D50\u5C3E\u5FC5\u9808\u662F "?>"\u3002
- EncodingDeclRequired = \u6587\u5B57\u5BA3\u544A\u4E2D\u9700\u8981\u7DE8\u78BC\u5BA3\u544A\u3002
- NoMorePseudoAttributes = \u4E0D\u5141\u8A31\u66F4\u591A\u7684\u865B\u64EC\u5C6C\u6027\u3002
- MorePseudoAttributes = \u9810\u671F\u66F4\u591A\u7684\u865B\u64EC\u5C6C\u6027\u3002
- PseudoAttrNameExpected = \u9810\u671F\u4E00\u500B\u865B\u64EC\u5C6C\u6027\u540D\u7A31\u3002
-# 4.3.2 Well-Formed Parsed Entities
- CommentNotInOneEntity = \u8A3B\u89E3\u5FC5\u9808\u6574\u500B\u5305\u542B\u5728\u76F8\u540C\u7684\u5256\u6790\u5BE6\u9AD4\u5167\u3002
- PINotInOneEntity = \u8655\u7406\u6307\u793A\u5FC5\u9808\u6574\u500B\u5305\u542B\u5728\u76F8\u540C\u7684\u5256\u6790\u5BE6\u9AD4\u5167\u3002
-# 4.3.3 Character Encoding in Entities
- EncodingDeclInvalid = \u7121\u6548\u7684\u7DE8\u78BC\u540D\u7A31 "{0}"\u3002
- EncodingByteOrderUnsupported = \u4E0D\u652F\u63F4\u7DE8\u78BC "{0}" \u7684\u6307\u5B9A\u4F4D\u5143\u7D44\u9806\u5E8F\u3002
- InvalidByte = {1}-byte UTF-8 \u5E8F\u5217\u7684\u7121\u6548\u4F4D\u5143\u7D44 {0}\u3002
- ExpectedByte = {1}-byte UTF-8 \u5E8F\u5217\u9810\u671F\u7684\u4F4D\u5143\u7D44 {0}\u3002
- InvalidHighSurrogate = UTF-8 \u5E8F\u5217\u4E2D\u9AD8\u66FF\u4EE3\u4F4D\u5143\u4E0D\u53EF\u8D85\u904E 0x10\uFF0C\u4F46\u627E\u5230 0x{0}\u3002
- OperationNotSupported = {1} \u8B80\u53D6\u5668\u4E0D\u652F\u63F4\u4F5C\u696D "{0}"\u3002
- InvalidASCII = \u7D44\u5143\u7D44 "{0}" \u4E0D\u662F (7 \u4F4D\u5143) ASCII \u5B57\u5143\u96C6\u7684\u6210\u54E1\u3002
- CharConversionFailure = \u6C7A\u5B9A\u4F7F\u7528\u7279\u5B9A\u7DE8\u78BC\u7684\u5BE6\u9AD4\uFF0C\u5728\u8A72\u7DE8\u78BC\u4E2D\u4E0D\u53EF\u5305\u542B\u7121\u6548\u7684\u5E8F\u5217\u3002
-
-# DTD Messages
-# 2.2 Characters
- InvalidCharInEntityValue = \u5728\u6587\u5B57\u5BE6\u9AD4\u503C\u4E2D\u627E\u5230\u7121\u6548\u7684 XML \u5B57\u5143 (Unicode: 0x{0})\u3002
- InvalidCharInExternalSubset = \u5728 DTD \u5916\u90E8\u5B50\u96C6\u4E2D\u627E\u5230\u7121\u6548\u7684 XML \u5B57\u5143 (Unicode: 0x{0})\u3002
- InvalidCharInIgnoreSect = \u5728\u6392\u9664\u7684\u689D\u4EF6\u6027\u6BB5\u843D\u4E2D\u627E\u5230\u7121\u6548\u7684 XML \u5B57\u5143 (Unicode: 0x{0})\u3002
- InvalidCharInPublicID = \u5728\u516C\u7528 ID \u4E2D\u627E\u5230\u7121\u6548\u7684 XML \u5B57\u5143 (Unicode: 0x{0})\u3002
- InvalidCharInSystemID = \u5728\u7CFB\u7D71 ID \u4E2D\u627E\u5230\u7121\u6548\u7684 XML \u5B57\u5143 (Unicode: 0x{0})\u3002
-# 2.3 Common Syntactic Constructs
- SpaceRequiredAfterSYSTEM = \u5728 DOCTYPE \u5BA3\u544A\u4E2D\u95DC\u9375\u5B57 SYSTEM \u4E4B\u5F8C\u9700\u8981\u7A7A\u683C\u3002
- QuoteRequiredInSystemID = \u7CFB\u7D71 ID \u7684\u958B\u982D\u5FC5\u9808\u70BA\u55AE\u5F15\u865F\u6216\u96D9\u5F15\u865F\u5B57\u5143\u3002
- SystemIDUnterminated = \u7CFB\u7D71 ID \u7684\u7D50\u5C3E\u5FC5\u9808\u662F\u914D\u5C0D\u7684\u5F15\u865F\u5B57\u5143\u3002
- SpaceRequiredAfterPUBLIC = \u5728 DOCTYPE \u5BA3\u544A\u4E2D\u95DC\u9375\u5B57 PUBLIC \u4E4B\u5F8C\u9700\u8981\u7A7A\u683C\u3002
- QuoteRequiredInPublicID = \u516C\u7528 ID \u7684\u958B\u982D\u5FC5\u9808\u70BA\u55AE\u5F15\u865F\u6216\u96D9\u5F15\u865F\u5B57\u5143\u3002
- PublicIDUnterminated = \u516C\u7528 ID \u7684\u7D50\u5C3E\u5FC5\u9808\u662F\u914D\u5C0D\u7684\u5F15\u865F\u5B57\u5143\u3002
- PubidCharIllegal = \u516C\u7528 ID \u4E2D\u4E0D\u5141\u8A31\u5B57\u5143 (Unicode: 0x{0})\u3002
- SpaceRequiredBetweenPublicAndSystem = publicId \u8207 systemId \u4E4B\u9593\u9700\u8981\u7A7A\u683C\u3002
-# 2.8 Prolog and Document Type Declaration
- MSG_SPACE_REQUIRED_BEFORE_ROOT_ELEMENT_TYPE_IN_DOCTYPEDECL = \u5728\u6587\u4EF6\u985E\u578B\u5BA3\u544A\u4E2D "<!DOCTYPE" \u4E4B\u5F8C\u9700\u8981\u7A7A\u683C\u3002
- MSG_ROOT_ELEMENT_TYPE_REQUIRED = \u5728\u6587\u4EF6\u985E\u578B\u5BA3\u544A\u4E2D\uFF0C\u6839\u5143\u7D20\u985E\u578B\u5FC5\u9808\u51FA\u73FE\u5728 "<!DOCTYPE" \u4E4B\u5F8C\u3002
- DoctypedeclUnterminated = \u6839\u5143\u7D20\u985E\u578B "{0}" \u7684\u6587\u4EF6\u985E\u578B\u5BA3\u544A\u7D50\u5C3E\u5FC5\u9808\u70BA ''>''\u3002
- DoctypedeclNotClosed = \u6839\u5143\u7D20\u985E\u578B "{0}" \u7684\u6587\u4EF6\u985E\u578B\u5BA3\u544A\u7D50\u5C3E\u5FC5\u9808\u70BA '']''\u3002
- PEReferenceWithinMarkup = DTD \u5167\u90E8\u5B57\u96C6\u7684\u6A19\u8A18\u5167\u4E0D\u80FD\u51FA\u73FE\u53C3\u6578\u5BE6\u9AD4\u53C3\u7167 "%{0};"\u3002
- MSG_MARKUP_NOT_RECOGNIZED_IN_DTD = \u6587\u4EF6\u985E\u578B\u5BA3\u544A\u5305\u542B\u6216\u6307\u5411\u7684\u6A19\u8A18\u5BA3\u544A\u5FC5\u9808\u683C\u5F0F\u6B63\u78BA\u3002
-# 2.10 White Space Handling
- MSG_XML_SPACE_DECLARATION_ILLEGAL = "xml:space" \u7684\u5C6C\u6027\u5BA3\u544A\u5FC5\u9808\u6307\u5B9A\u70BA\u5217\u8209\u985E\u578B\uFF0C\u5176\u53EF\u80FD\u7684\u503C\u70BA "default" \u8207 "preserve"\u3002
-# 3.2 Element Type Declarations
- MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ELEMENTDECL = \u5728\u5143\u7D20\u985E\u578B\u5BA3\u544A\u4E2D "<!ELEMENT" \u4E4B\u5F8C\u9700\u8981\u7A7A\u683C\u3002
- MSG_ELEMENT_TYPE_REQUIRED_IN_ELEMENTDECL = \u5143\u7D20\u985E\u578B\u5BA3\u544A\u4E2D\u9700\u8981\u5143\u7D20\u985E\u578B\u3002
- MSG_SPACE_REQUIRED_BEFORE_CONTENTSPEC_IN_ELEMENTDECL = \u5728\u5143\u7D20\u985E\u578B\u5BA3\u544A\u4E2D\u5143\u7D20\u985E\u578B "{0}" \u4E4B\u5F8C\u9700\u8981\u7A7A\u683C\u3002
- MSG_CONTENTSPEC_REQUIRED_IN_ELEMENTDECL = \u5728\u5143\u7D20\u985E\u578B\u5BA3\u544A\u4E2D\u5143\u7D20\u985E\u578B "{0}" \u4E4B\u5F8C\u9700\u8981\u9650\u5236\u689D\u4EF6\u3002
- ElementDeclUnterminated = \u5143\u7D20\u985E\u578B "{0}" \u7684\u5BA3\u544A\u7D50\u5C3E\u5FC5\u9808\u70BA ''>''\u3002
-# 3.2.1 Element Content
- MSG_OPEN_PAREN_OR_ELEMENT_TYPE_REQUIRED_IN_CHILDREN = \u5143\u7D20\u985E\u578B "{0}" \u7684\u5BA3\u544A\u4E2D\u9700\u8981\u4E00\u500B ''('' \u5B57\u5143\u6216\u5143\u7D20\u985E\u578B\u3002
- MSG_CLOSE_PAREN_REQUIRED_IN_CHILDREN = \u5143\u7D20\u985E\u578B "{0}" \u7684\u5BA3\u544A\u4E2D\u9700\u8981\u4E00\u500B '')''\u3002
-# 3.2.2 Mixed Content
- MSG_ELEMENT_TYPE_REQUIRED_IN_MIXED_CONTENT = \u5143\u7D20\u985E\u578B "{0}" \u7684\u5BA3\u544A\u4E2D\u9700\u8981\u4E00\u500B\u5143\u7D20\u985E\u578B\u3002
- MSG_CLOSE_PAREN_REQUIRED_IN_MIXED = \u5143\u7D20\u985E\u578B "{0}" \u7684\u5BA3\u544A\u4E2D\u9700\u8981\u4E00\u500B '')''\u3002
- MixedContentUnterminated = \u5B50\u9805\u5143\u7D20\u7684\u985E\u578B\u53D7\u5230\u9650\u5236\u6642\uFF0C\u6DF7\u5408\u5167\u5BB9\u6A21\u578B "{0}" \u7684\u7D50\u5C3E\u5FC5\u9808\u70BA ")*"\u3002
-# 3.3 Attribute-List Declarations
- MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ATTLISTDECL = \u5728 attribute-list \u5BA3\u544A\u4E2D "<!ATTLIST" \u4E4B\u5F8C\u9700\u8981\u7A7A\u683C\u3002
- MSG_ELEMENT_TYPE_REQUIRED_IN_ATTLISTDECL = attribute-list \u5BA3\u544A\u4E2D\u9700\u8981\u5143\u7D20\u985E\u578B\u3002
- MSG_SPACE_REQUIRED_BEFORE_ATTRIBUTE_NAME_IN_ATTDEF = \u5143\u7D20 "{0}" \u7684 attribute-list \u5BA3\u544A\u4E2D\uFF0C\u5C6C\u6027\u540D\u7A31\u4E4B\u524D\u9700\u8981\u7A7A\u683C\u3002
- AttNameRequiredInAttDef = \u5143\u7D20 "{0}" \u7684 attribute-list \u5BA3\u544A\u5FC5\u9808\u6307\u5B9A\u5C6C\u6027\u540D\u7A31\u3002
- MSG_SPACE_REQUIRED_BEFORE_ATTTYPE_IN_ATTDEF = \u5143\u7D20 "{0}" \u5C6C\u6027 "{1}" \u7684\u5BA3\u544A\u4E2D\uFF0C\u5C6C\u6027\u985E\u578B\u4E4B\u524D\u9700\u8981\u7A7A\u683C\u3002
- AttTypeRequiredInAttDef = \u5143\u7D20 "{0}" \u5C6C\u6027 "{1}" \u7684\u5BA3\u544A\u4E2D\u9700\u8981\u5C6C\u6027\u985E\u578B\u3002
- MSG_SPACE_REQUIRED_BEFORE_DEFAULTDECL_IN_ATTDEF = \u5143\u7D20 "{0}" \u5C6C\u6027 "{1}" \u7684\u5BA3\u544A\u4E2D\uFF0C\u5C6C\u6027\u9810\u8A2D\u4E4B\u524D\u9700\u8981\u7A7A\u683C\u3002
- MSG_DUPLICATE_ATTRIBUTE_DEFINITION = \u70BA\u6307\u5B9A\u5143\u7D20 "{0}" \u7684\u76F8\u540C\u5C6C\u6027 "{1}" \u63D0\u4F9B\u4E86\u8D85\u904E\u4E00\u500B\u4EE5\u4E0A\u7684\u5C6C\u6027\u5B9A\u7FA9\u3002
-# 3.3.1 Attribute Types
- MSG_SPACE_REQUIRED_AFTER_NOTATION_IN_NOTATIONTYPE = "{1}" \u5C6C\u6027\u5BA3\u544A\u4E2D "NOTATION" \u4E4B\u5F8C\u5FC5\u9808\u6709\u7A7A\u683C\u3002
- MSG_OPEN_PAREN_REQUIRED_IN_NOTATIONTYPE = \u5728 "{1}" \u5C6C\u6027\u5BA3\u544A\u4E2D\uFF0C''('' \u5B57\u5143\u5FC5\u9808\u7DCA\u63A5\u5728 "NOTATION" \u4E4B\u5F8C\u3002
- MSG_NAME_REQUIRED_IN_NOTATIONTYPE = "{1}" \u5C6C\u6027\u5BA3\u544A\u7684\u8868\u793A\u6CD5\u985E\u578B\u6E05\u55AE\u4E2D\uFF0C\u9700\u8981\u8868\u793A\u6CD5\u540D\u7A31\u3002
- NotationTypeUnterminated = \u5728 "{1}" \u5C6C\u6027\u5BA3\u544A\u4E2D\uFF0C\u8868\u793A\u6CD5\u985E\u578B\u6E05\u55AE\u7684\u7D50\u5C3E\u5FC5\u9808\u70BA '')''\u3002
- MSG_NMTOKEN_REQUIRED_IN_ENUMERATION = "{1}" \u5C6C\u6027\u5BA3\u544A\u7684\u5217\u8209\u985E\u578B\u6E05\u55AE\u4E2D\uFF0C\u9700\u8981\u540D\u7A31\u8A18\u865F\u3002
- EnumerationUnterminated = \u5728 "{1}" \u5C6C\u6027\u5BA3\u544A\u4E2D\uFF0C\u5217\u8209\u985E\u578B\u6E05\u55AE\u7684\u7D50\u5C3E\u5FC5\u9808\u70BA '')''\u3002
- MSG_DISTINCT_TOKENS_IN_ENUMERATION = \u5143\u7D20 "{0}" \u7684\u5C6C\u6027 "{2}" \u5BA3\u544A\u4E2D\uFF0C\u6307\u5B9A\u8D85\u904E\u4E00\u6B21\u4EE5\u4E0A\u7684\u5217\u8209\u503C "{1}"\u3002\u55AE\u4E00 Enumeration \u5C6C\u6027\u5BA3\u544A\u4E2D\u7684 NMTOKENS \u5FC5\u9808\u5168\u90E8\u90FD\u4E0D\u76F8\u540C\u3002
- MSG_DISTINCT_NOTATION_IN_ENUMERATION = \u5143\u7D20 "{0}" \u5C6C\u6027 "{2}" \u7684\u5BA3\u544A\u4E2D\uFF0C\u6307\u5B9A\u8D85\u904E\u4E00\u6B21\u4EE5\u4E0A\u7684\u5217\u8209\u503C "{1}"\u3002\u55AE\u4E00 NotationType \u5C6C\u6027\u5BA3\u544A\u4E2D\u7684 NOTATION \u540D\u7A31\u5FC5\u9808\u5168\u90E8\u90FD\u4E0D\u76F8\u540C\u3002
-# 3.3.2 Attribute Defaults
- MSG_SPACE_REQUIRED_AFTER_FIXED_IN_DEFAULTDECL = "{1}" \u5C6C\u6027\u5BA3\u544A\u4E2D "FIXED" \u4E4B\u5F8C\u5FC5\u9808\u6709\u7A7A\u683C\u3002
-# 3.4 Conditional Sections
- IncludeSectUnterminated = \u5305\u542B\u689D\u4EF6\u6027\u6BB5\u843D\u7D50\u5C3E\u5FC5\u9808\u662F "]]>"\u3002
- IgnoreSectUnterminated = \u6392\u9664\u689D\u4EF6\u6027\u6BB5\u843D\u7D50\u5C3E\u5FC5\u9808\u662F "]]>"\u3002
-# 4.1 Character and Entity References
- NameRequiredInPEReference = \u5728\u53C3\u6578\u5BE6\u9AD4\u53C3\u7167\u4E2D\uFF0C\u5BE6\u9AD4\u540D\u7A31\u5FC5\u9808\u7DCA\u63A5\u5728 '%' \u4E4B\u5F8C\u3002
- SemicolonRequiredInPEReference = \u53C3\u6578\u5BE6\u9AD4\u53C3\u7167 "%{0};" \u7684\u7D50\u5C3E\u5FC5\u9808\u70BA '';'' \u5206\u754C\u5B57\u5143\u3002
-# 4.2 Entity Declarations
- MSG_SPACE_REQUIRED_BEFORE_ENTITY_NAME_IN_ENTITYDECL = \u5728\u5BE6\u9AD4\u5BA3\u544A\u4E2D "<!ENTITY" \u4E4B\u5F8C\u9700\u8981\u7A7A\u683C\u3002
- MSG_SPACE_REQUIRED_BEFORE_PERCENT_IN_PEDECL = \u5728\u53C3\u6578\u5BE6\u9AD4\u5BA3\u544A\u4E2D\uFF0C"<!ENTITY" \u8207 '%' \u5B57\u5143\u4E4B\u9593\u9700\u8981\u7A7A\u683C\u3002
- MSG_SPACE_REQUIRED_BEFORE_ENTITY_NAME_IN_PEDECL = \u5728\u53C3\u6578\u5BE6\u9AD4\u5BA3\u544A\u4E2D\uFF0C'%' \u8207\u5BE6\u9AD4\u540D\u7A31\u4E4B\u9593\u9700\u8981\u7A7A\u683C\u3002
- MSG_ENTITY_NAME_REQUIRED_IN_ENTITYDECL = \u5BE6\u9AD4\u5BA3\u544A\u4E2D\u9700\u8981\u5BE6\u9AD4\u7684\u540D\u7A31\u3002
- MSG_SPACE_REQUIRED_AFTER_ENTITY_NAME_IN_ENTITYDECL = \u5728\u5BE6\u9AD4\u5BA3\u544A\u4E2D\uFF0C\u5BE6\u9AD4\u540D\u7A31 "{0}" \u8207\u5B9A\u7FA9\u4E4B\u9593\u9700\u8981\u7A7A\u683C\u3002
- MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_UNPARSED_ENTITYDECL = \u5728\u5BE6\u9AD4 "{0}" \u7684\u5BA3\u544A\u4E2D\uFF0C"NDATA" \u8207\u8868\u793A\u6CD5\u540D\u7A31\u4E4B\u9593\u9700\u8981\u7A7A\u683C\u3002
- MSG_SPACE_REQUIRED_BEFORE_NDATA_IN_UNPARSED_ENTITYDECL = \u5728\u5BE6\u9AD4 "{0}" \u7684\u5BA3\u544A\u4E2D\uFF0C"NDATA" \u4E4B\u524D\u9700\u8981\u7A7A\u683C\u3002
- MSG_NOTATION_NAME_REQUIRED_FOR_UNPARSED_ENTITYDECL = \u5728\u5BE6\u9AD4 "{0}" \u7684\u5BA3\u544A\u4E2D\uFF0C"NDATA" \u4E4B\u5F8C\u9700\u8981\u8868\u793A\u6CD5\u540D\u7A31\u3002
- EntityDeclUnterminated = \u5BE6\u9AD4 "{0}" \u7684\u5BA3\u544A\u7D50\u5C3E\u5FC5\u9808\u70BA ''>''\u3002
- MSG_DUPLICATE_ENTITY_DEFINITION = \u5BE6\u9AD4 "{0}" \u5BA3\u544A\u8D85\u904E\u4E00\u6B21\u4EE5\u4E0A\u3002
-# 4.2.2 External Entities
- ExternalIDRequired = \u5916\u90E8\u5BE6\u9AD4\u5BA3\u544A\u7684\u958B\u982D\u5FC5\u9808\u70BA "SYSTEM" \u6216 "PUBLIC"\u3002
- MSG_SPACE_REQUIRED_BEFORE_PUBIDLITERAL_IN_EXTERNALID = "PUBLIC" \u8207\u516C\u7528 ID \u4E4B\u9593\u9700\u8981\u7A7A\u683C\u3002
- MSG_SPACE_REQUIRED_AFTER_PUBIDLITERAL_IN_EXTERNALID = \u516C\u7528 ID \u8207\u7CFB\u7D71 ID \u4E4B\u9593\u9700\u8981\u7A7A\u683C\u3002
- MSG_SPACE_REQUIRED_BEFORE_SYSTEMLITERAL_IN_EXTERNALID = "SYSTEM" \u8207\u7CFB\u7D71 ID \u4E4B\u9593\u9700\u8981\u7A7A\u683C\u3002
- MSG_URI_FRAGMENT_IN_SYSTEMID = \u7247\u6BB5 ID \u4E0D\u61C9\u6307\u5B9A\u70BA\u7CFB\u7D71 ID "{0}" \u7684\u4E00\u90E8\u5206\u3002
-# 4.7 Notation Declarations
- MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_NOTATIONDECL = \u5728\u8868\u793A\u6CD5\u5BA3\u544A\u4E2D "<!NOTATION" \u4E4B\u5F8C\u9700\u8981\u7A7A\u683C\u3002
- MSG_NOTATION_NAME_REQUIRED_IN_NOTATIONDECL = \u8868\u793A\u6CD5\u5BA3\u544A\u4E2D\u9700\u8981\u8868\u793A\u6CD5\u7684\u540D\u7A31\u3002
- MSG_SPACE_REQUIRED_AFTER_NOTATION_NAME_IN_NOTATIONDECL = \u5728\u8868\u793A\u6CD5\u5BA3\u544A\u4E2D\u8868\u793A\u6CD5\u540D\u7A31 "{0}" \u4E4B\u5F8C\u9700\u8981\u7A7A\u683C\u3002
- ExternalIDorPublicIDRequired = \u8868\u793A\u6CD5 "{0}" \u7684\u5BA3\u544A\u5FC5\u9808\u5305\u542B\u7CFB\u7D71\u6216\u516C\u7528 ID\u3002
- NotationDeclUnterminated = \u8868\u793A\u6CD5 "{0}" \u7684\u5BA3\u544A\u7D50\u5C3E\u5FC5\u9808\u70BA ''>''\u3002
-
-# Validation messages
- DuplicateTypeInMixedContent = \u5143\u7D20\u5BA3\u544A "{0}" \u7684\u5167\u5BB9\u6A21\u578B\u4E2D\u5DF2\u7D93\u6307\u5B9A\u5143\u7D20\u985E\u578B "{1}"\u3002
- ENTITIESInvalid = \u985E\u578B ENTITIES \u7684\u5C6C\u6027\u503C "{1}" \u5FC5\u9808\u662F\u4E00\u6216\u591A\u500B\u672A\u5256\u6790\u5BE6\u9AD4\u7684\u540D\u7A31\u3002
- ENTITYInvalid = \u985E\u578B ENTITY \u7684\u5C6C\u6027\u503C "{1}" \u5FC5\u9808\u662F\u4E00\u500B\u672A\u5256\u6790\u5BE6\u9AD4\u7684\u540D\u7A31\u3002
- IDDefaultTypeInvalid = ID \u5C6C\u6027 "{0}" \u5FC5\u9808\u5177\u6709 "#IMPLIED" \u6216 "#REQUIRED" \u7684\u5BA3\u544A\u9810\u8A2D\u3002
- IDInvalid = \u985E\u578B ID \u7684\u5C6C\u6027\u503C "{0}" \u5FC5\u9808\u662F\u540D\u7A31\u3002
- IDInvalidWithNamespaces = \u555F\u7528\u547D\u540D\u7A7A\u9593\u6642\uFF0C\u985E\u578B ID \u7684\u5C6C\u6027\u503C "{0}" \u5FC5\u9808\u662F NCName\u3002
- IDNotUnique = \u985E\u578B ID \u7684\u5C6C\u6027\u503C "{0}" \u5FC5\u9808\u662F\u6587\u4EF6\u5167\u7684\u552F\u4E00\u503C\u3002
- IDREFInvalid = \u985E\u578B IDREF \u7684\u5C6C\u6027\u503C "{0}" \u5FC5\u9808\u662F\u540D\u7A31\u3002
- IDREFInvalidWithNamespaces = \u555F\u7528\u547D\u540D\u7A7A\u9593\u6642\uFF0C\u985E\u578B IDREF \u7684\u5C6C\u6027\u503C "{0}" \u5FC5\u9808\u662F NCName\u3002
- IDREFSInvalid = \u985E\u578B IDREFS \u7684\u5C6C\u6027\u503C "{0}" \u5FC5\u9808\u662F\u4E00\u6216\u591A\u500B\u540D\u7A31\u3002
- ILL_FORMED_PARAMETER_ENTITY_WHEN_USED_IN_DECL = \u7576\u5BE6\u9AD4\u53C3\u7167\u7576\u4F5C\u5B8C\u6574\u5BA3\u544A\u6642\uFF0C\u53C3\u6578\u5BE6\u9AD4 "{0}" \u7684\u53D6\u4EE3\u6587\u5B57\u5FC5\u9808\u5305\u542B\u6B63\u78BA\u5DE2\u72C0\u7D50\u69CB\u7684\u5BA3\u544A\u3002
- ImproperDeclarationNesting = \u53C3\u6578\u5BE6\u9AD4 "{0}" \u7684\u53D6\u4EE3\u6587\u5B57\u5FC5\u9808\u5305\u542B\u6B63\u78BA\u5DE2\u72C0\u7D50\u69CB\u7684\u5BA3\u544A\u3002
- ImproperGroupNesting = \u53C3\u6578\u5BE6\u9AD4 "{0}" \u7684\u53D6\u4EE3\u6587\u5B57\u5FC5\u9808\u5305\u542B\u6B63\u78BA\u5DE2\u72C0\u7D50\u69CB\u7684\u6210\u5C0D\u62EC\u865F\u3002
- INVALID_PE_IN_CONDITIONAL = \u53C3\u6578\u5BE6\u9AD4 "{0}" \u7684\u53D6\u4EE3\u6587\u5B57\u5FC5\u9808\u5305\u542B\u6574\u500B\u689D\u4EF6\u6027\u6BB5\u843D\u6216\u50C5\u5305\u542B INCLUDE \u6216 IGNORE\u3002
- MSG_ATTRIBUTE_NOT_DECLARED = \u5143\u7D20\u985E\u578B "{0}" \u5FC5\u9808\u5BA3\u544A\u5C6C\u6027 "{1}"\u3002
- MSG_ATTRIBUTE_VALUE_NOT_IN_LIST = \u5177\u6709\u503C "{1}" \u7684\u5C6C\u6027 "{0}" \u5FC5\u9808\u5177\u6709\u4F86\u81EA\u6E05\u55AE "{2}" \u7684\u503C\u3002
- MSG_ATTVALUE_CHANGED_DURING_NORMALIZATION_WHEN_STANDALONE = \u5728\u7368\u7ACB\u6587\u4EF6\u4E2D\uFF0C\u5C6C\u6027 "{0}" \u7684\u503C "{1}" \u4E0D\u53EF\u900F\u904E\u6B63\u898F\u5316\u9032\u884C\u8B8A\u66F4 (\u6210\u70BA "{2}")\u3002
- MSG_CONTENT_INCOMPLETE = \u5143\u7D20\u985E\u578B "{0}" \u7684\u5167\u5BB9\u4E0D\u5B8C\u6574\uFF0C\u5B83\u5FC5\u9808\u914D\u5C0D "{1}"\u3002
- MSG_CONTENT_INVALID = \u5143\u7D20\u985E\u578B "{0}" \u7684\u5167\u5BB9\u5FC5\u9808\u914D\u5C0D "{1}"\u3002
- MSG_CONTENT_INVALID_SPECIFIED = \u5143\u7D20\u985E\u578B "{0}" \u7684\u5167\u5BB9\u5FC5\u9808\u914D\u5C0D "{1}"\u3002\u4E0D\u5141\u8A31\u985E\u578B "{2}" \u7684\u5B50\u9805\u3002
- MSG_DEFAULTED_ATTRIBUTE_NOT_SPECIFIED = \u5143\u7D20\u985E\u578B "{0}" \u7684\u5C6C\u6027 "{1}" \u5177\u6709\u9810\u8A2D\u503C\uFF0C\u4E14\u5FC5\u9808\u5728\u7368\u7ACB\u6587\u4EF6\u4E2D\u6307\u5B9A\u3002
- MSG_DUPLICATE_ATTDEF = \u5143\u7D20\u985E\u578B "{0}" \u5DF2\u7D93\u5BA3\u544A\u5C6C\u6027 "{1}"\u3002
- MSG_ELEMENT_ALREADY_DECLARED = \u5143\u7D20\u985E\u578B "{0}" \u4E0D\u53EF\u5BA3\u544A\u8D85\u904E\u4E00\u6B21\u4EE5\u4E0A\u3002
- MSG_ELEMENT_NOT_DECLARED = \u5FC5\u9808\u5BA3\u544A\u5143\u7D20\u985E\u578B "{0}"\u3002
- MSG_GRAMMAR_NOT_FOUND = \u6587\u4EF6\u7121\u6548: \u627E\u4E0D\u5230\u6587\u6CD5\u3002
- MSG_ELEMENT_WITH_ID_REQUIRED = ID \u70BA "{0}" \u7684\u5143\u7D20\u5FC5\u9808\u51FA\u73FE\u5728\u6587\u4EF6\u4E2D\u3002
- MSG_EXTERNAL_ENTITY_NOT_PERMITTED = \u7368\u7ACB\u6587\u4EF6\u4E2D\u4E0D\u5141\u8A31\u53C3\u7167\u5916\u90E8\u5BE6\u9AD4 "{0}"\u3002
- MSG_FIXED_ATTVALUE_INVALID = \u5177\u6709\u503C "{2}" \u7684\u5C6C\u6027 "{1}" \u5FC5\u9808\u5177\u6709 "{3}" \u7684\u503C\u3002
- MSG_MORE_THAN_ONE_ID_ATTRIBUTE = \u5143\u7D20\u985E\u578B "{0}" \u5DF2\u7D93\u5177\u6709\u985E\u578B ID \u7684\u5C6C\u6027 "{1}"\uFF0C\u4E0D\u5141\u8A31\u8A72\u985E\u578B ID \u7684\u7B2C\u4E8C\u500B\u5C6C\u6027 "{2}"\u3002
- MSG_MORE_THAN_ONE_NOTATION_ATTRIBUTE = \u5143\u7D20\u985E\u578B "{0}" \u5DF2\u7D93\u5177\u6709\u985E\u578B NOTATION \u7684\u5C6C\u6027 "{1}"\uFF0C\u4E0D\u5141\u8A31\u8A72\u985E\u578B NOTATION \u7684\u7B2C\u4E8C\u500B\u5C6C\u6027 "{2}"\u3002
- MSG_NOTATION_NOT_DECLARED_FOR_NOTATIONTYPE_ATTRIBUTE = \u82E5\u8981\u5728\u5C6C\u6027 "{0}" \u7684\u8868\u793A\u6CD5\u985E\u578B\u6E05\u55AE\u4E2D\u53C3\u7167\u8868\u793A\u6CD5 "{1}"\uFF0C\u5FC5\u9808\u4E88\u4EE5\u5BA3\u544A\u3002
- MSG_NOTATION_NOT_DECLARED_FOR_UNPARSED_ENTITYDECL = \u82E5\u8981\u5728 "{0}" \u7684\u672A\u5256\u6790\u5BE6\u9AD4\u5BA3\u544A\u4E2D\u53C3\u7167\u8868\u793A\u6CD5 "{1}"\uFF0C\u5FC5\u9808\u4E88\u4EE5\u5BA3\u544A\u3002
- MSG_REFERENCE_TO_EXTERNALLY_DECLARED_ENTITY_WHEN_STANDALONE = \u5728\u7368\u7ACB\u6587\u4EF6\u4E2D\uFF0C\u4E0D\u5141\u8A31\u53C3\u7167\u5916\u90E8\u5256\u6790\u5BE6\u9AD4\u4E2D\u5BA3\u544A\u7684\u5BE6\u9AD4 "{0}"\u3002
- MSG_REQUIRED_ATTRIBUTE_NOT_SPECIFIED = \u5143\u7D20\u985E\u578B "{0}" \u9700\u8981\u5C6C\u6027 "{1}" \u4E14\u5FC5\u9808\u4E88\u4EE5\u6307\u5B9A\u3002
- MSG_WHITE_SPACE_IN_ELEMENT_CONTENT_WHEN_STANDALONE = \u5728\u7368\u7ACB\u6587\u4EF6\u4E2D\uFF0C\u5177\u6709\u5143\u7D20\u5167\u5BB9\u7684\u5916\u90E8\u5256\u6790\u5BE6\u9AD4\u4E2D\u5BA3\u544A\u7684\u5143\u7D20\u4E4B\u9593\uFF0C\u4E0D\u53EF\u6709\u7A7A\u683C\u3002
- NMTOKENInvalid = \u985E\u578B NMTOKEN \u7684\u5C6C\u6027\u503C "{0}" \u5FC5\u9808\u662F\u540D\u7A31\u8A18\u865F\u3002
- NMTOKENSInvalid = \u985E\u578B NMTOKENS \u7684\u5C6C\u6027\u503C "{0}" \u5FC5\u9808\u662F\u4E00\u6216\u591A\u500B\u540D\u7A31\u8A18\u865F\u3002
- NoNotationOnEmptyElement = \u5BA3\u544A EMPTY \u7684\u5143\u7D20\u985E\u578B "{0}" \u4E0D\u53EF\u5BA3\u544A\u985E\u578B NOTATION \u7684\u5C6C\u6027 "{1}"\u3002
- RootElementTypeMustMatchDoctypedecl = \u6587\u4EF6\u6839\u5143\u7D20 "{1}" \u5FC5\u9808\u914D\u5C0D DOCTYPE \u6839 "{0}"\u3002
- UndeclaredElementInContentSpec = \u5143\u7D20 "{0}" \u7684\u5167\u5BB9\u6A21\u578B\u53C3\u7167\u672A\u5BA3\u544A\u7684\u5143\u7D20 "{1}"\u3002
- UniqueNotationName = \u8868\u793A\u6CD5 "{0}" \u7684\u5BA3\u544A\u4E26\u975E\u552F\u4E00\u3002\u6307\u5B9A\u7684 Name \u4E0D\u80FD\u5728\u4E00\u500B\u4EE5\u4E0A\u7684\u8868\u793A\u6CD5\u5BA3\u544A\u4E2D\u5BA3\u544A\u3002
- ENTITYFailedInitializeGrammar = ENTITYDatatype \u9A57\u8B49\u7A0B\u5F0F: \u5931\u6557\u3002\u9700\u8981\u4F7F\u7528\u6709\u6548\u7684\u6587\u6CD5\u53C3\u7167\u4F86\u547C\u53EB\u8D77\u59CB\u65B9\u6CD5\u3002\t
- ENTITYNotUnparsed = ENTITY "{0}" \u4E26\u975E\u672A\u7D93\u5256\u6790\u3002
- ENTITYNotValid = ENTITY "{0}" \u7121\u6548\u3002
- EmptyList = \u985E\u578B ENTITIES\u3001IDREFS \u8207 NMTOKENS \u7684\u503C\u4E0D\u53EF\u70BA\u7A7A\u767D\u6E05\u55AE\u3002
-
-# Entity related messages
-# 3.1 Start-Tags, End-Tags, and Empty-Element Tags
- ReferenceToExternalEntity = \u5C6C\u6027\u503C\u4E0D\u5141\u8A31\u53C3\u7167\u5916\u90E8\u5BE6\u9AD4 "&{0};"\u3002
- AccessExternalDTD = \u5916\u90E8 DTD: \u7121\u6CD5\u8B80\u53D6\u5916\u90E8 DTD ''{0}''\uFF0C\u56E0\u70BA accessExternalDTD \u5C6C\u6027\u8A2D\u5B9A\u7684\u9650\u5236\uFF0C\u6240\u4EE5\u4E0D\u5141\u8A31 ''{1}'' \u5B58\u53D6\u3002
- AccessExternalEntity = \u5916\u90E8\u5BE6\u9AD4: \u7121\u6CD5\u8B80\u53D6\u5916\u90E8\u6587\u4EF6 ''{0}''\uFF0C\u56E0\u70BA accessExternalDTD \u5C6C\u6027\u8A2D\u5B9A\u7684\u9650\u5236\uFF0C\u6240\u4EE5\u4E0D\u5141\u8A31 ''{1}'' \u5B58\u53D6\u3002
-
-# 4.1 Character and Entity References
- EntityNotDeclared = \u53C3\u7167\u4E86\u5BE6\u9AD4 "{0}"\uFF0C\u4F46\u662F\u672A\u5BA3\u544A\u3002
- ReferenceToUnparsedEntity = \u4E0D\u5141\u8A31\u672A\u5256\u6790\u7684\u5BE6\u9AD4\u53C3\u7167 "&{0};"\u3002
- RecursiveReference = \u905E\u8FF4\u5BE6\u9AD4\u53C3\u7167 "{0}"\u3002(\u53C3\u7167\u8DEF\u5F91: {1})\uFF0C
- RecursiveGeneralReference = \u905E\u8FF4\u4E00\u822C\u5BE6\u9AD4\u53C3\u7167 "&{0};"\u3002(\u53C3\u7167\u8DEF\u5F91: {1})\uFF0C
- RecursivePEReference = \u905E\u8FF4\u53C3\u6578\u5BE6\u9AD4\u53C3\u7167 "%{0};"\u3002(\u53C3\u7167\u8DEF\u5F91: {1})\uFF0C
-# 4.3.3 Character Encoding in Entities
- EncodingNotSupported = \u4E0D\u652F\u63F4\u7DE8\u78BC "{0}"\u3002
- EncodingRequired = \u672A\u4F7F\u7528 UTF-8 \u6216 UTF-16 \u7DE8\u78BC\u7684\u5256\u6790\u5BE6\u9AD4\uFF0C\u5FC5\u9808\u5305\u542B\u7DE8\u78BC\u5BA3\u544A\u3002
-
-# Namespaces support
-# 4. Using Qualified Names
- IllegalQName = \u5143\u7D20\u6216\u5C6C\u6027\u4E0D\u7B26\u5408 QName \u7522\u751F: QName::=(NCName':')?NCName\u3002
- ElementXMLNSPrefix = \u5143\u7D20 "{0}" \u4E0D\u80FD\u4F7F\u7528 "xmlns" \u4F5C\u70BA\u524D\u7F6E\u78BC\u3002
- ElementPrefixUnbound = \u5143\u7D20 "{1}" \u7684\u524D\u7F6E\u78BC "{0}" \u672A\u9023\u7D50\u3002
- AttributePrefixUnbound = \u95DC\u806F\u5143\u7D20\u985E\u578B "{0}" \u4E4B\u5C6C\u6027 "{1}" \u7684\u524D\u7F6E\u78BC "{2}" \u672A\u9023\u7D50\u3002
- EmptyPrefixedAttName = \u5C6C\u6027 "{0}" \u7684\u503C\u7121\u6548\u3002\u524D\u7F6E\u7684\u547D\u540D\u7A7A\u9593\u9023\u7D50\u4E0D\u53EF\u70BA\u7A7A\u767D\u3002
- PrefixDeclared = \u672A\u5BA3\u544A\u547D\u540D\u7A7A\u9593\u524D\u7F6E\u78BC "{0}"\u3002
- CantBindXMLNS = \u524D\u7F6E\u78BC "xmlns" \u7121\u6CD5\u660E\u78BA\u9023\u7D50\u4EFB\u4F55\u547D\u540D\u7A7A\u9593; "xmlns" \u7684\u547D\u540D\u7A7A\u9593\u4E5F\u7121\u6CD5\u660E\u78BA\u9023\u7D50\u4EFB\u4F55\u524D\u7F6E\u78BC\u3002
- CantBindXML = \u524D\u7F6E\u78BC "xml" \u7121\u6CD5\u9023\u7D50\u4E00\u822C\u547D\u540D\u7A7A\u9593\u4E4B\u5916\u7684\u4EFB\u4F55\u547D\u540D\u7A7A\u9593; "xml" \u7684\u547D\u540D\u7A7A\u9593\u4E5F\u7121\u6CD5\u9023\u7D50 "xml" \u4E4B\u5916\u7684\u4EFB\u4F55\u547D\u540D\u7A7A\u9593\u3002
- MSG_ATT_DEFAULT_INVALID = \u7531\u65BC\u6B64\u5C6C\u6027\u985E\u578B\u7684\u8A9E\u5F59\u9650\u5236\u689D\u4EF6\uFF0C\u5C6C\u6027 "{0}" \u7684 defaultValue "{1}" \u7121\u6548\u3002
-
-# REVISIT: These need messages
- MSG_SPACE_REQUIRED_AFTER_SYSTEMLITERAL_IN_EXTERNALID=MSG_SPACE_REQUIRED_AFTER_SYSTEMLITERAL_IN_EXTERNALID
- OpenQuoteMissingInDecl=OpenQuoteMissingInDecl
- InvalidCharInLiteral=InvalidCharInLiteral
-
-
-# Implementation limits
- EntityExpansionLimit=JAXP00010001: \u5256\u6790\u5668\u5728\u6B64\u6587\u4EF6\u4E2D\u9047\u5230 "{0}" \u500B\u4EE5\u4E0A\u7684\u5BE6\u9AD4\u64F4\u5145; \u9019\u662F JDK \u6240\u898F\u5B9A\u7684\u9650\u5236\u3002
- ElementAttributeLimit=JAXP00010002: \u5143\u7D20 "{0}" \u5177\u6709\u8D85\u904E "{1}" \u500B\u4EE5\u4E0A\u7684\u5C6C\u6027\uFF0C"{1}" \u662F JDK \u6240\u898F\u5B9A\u7684\u9650\u5236\u3002
- MaxEntitySizeLimit=JAXP00010003: \u5BE6\u9AD4 "{0}" \u7684\u9577\u5EA6\u70BA "{1}"\uFF0C\u8D85\u904E "{3}" \u6240\u8A2D\u5B9A\u7684 "{2}" \u9650\u5236\u3002
- TotalEntitySizeLimit=JAXP00010004: \u5BE6\u9AD4\u7684\u7D2F\u7A4D\u5927\u5C0F\u70BA "{0}"\uFF0C\u8D85\u904E "{2}" \u6240\u8A2D\u5B9A\u7684 "{1}" \u9650\u5236\u3002
- MaxXMLNameLimit=JAXP00010005: \u5BE6\u9AD4 "{0}" \u7684\u9577\u5EA6\u70BA "{1}"\uFF0C\u8D85\u904E "{3}" \u6240\u8A2D\u5B9A\u7684 "{2}" \u9650\u5236\u3002
- MaxElementDepthLimit=JAXP00010006: \u5143\u7D20 "{0}" \u7684\u6DF1\u5EA6\u70BA "{1}"\uFF0C\u8D85\u904E "{3}" \u6240\u8A2D\u5B9A\u7684 "{2}" \u9650\u5236\u3002
- EntityReplacementLimit=JAXP00010007: \u5BE6\u9AD4\u53C3\u7167\u4E2D\u7684\u7BC0\u9EDE\u7E3D\u6578\u70BA "{0}"\uFF0C\u8D85\u904E "{2}" \u6240\u8A2D\u5B9A\u7684 "{1}" \u9650\u5236\u3002
-
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages.properties
deleted file mode 100644
index 468eb1b..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages.properties
+++ /dev/null
@@ -1,291 +0,0 @@
-# This file contains error and warning messages related to XML Schema
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
- BadMessageKey = The error message corresponding to the message key can not be found.
- FormatFailed = An internal error occurred while formatting the following message:\n
-
-# For internal use
-
- Internal-Error = Internal error: {0}.
- dt-whitespace = Whitespace facet value is not available for the union simpleType ''{0}''
- GrammarConflict = One of the grammar(s) returned from the user's grammar pool is in conflict with another grammar.
-
-# Identity constraints
-
- AbsentKeyValue = Identity Constraint error (cvc-identity-constraint.4.2.1): element \"{0}\" has a key with no value.
- DuplicateField = Duplicate match in scope for field \"{0}\".
- DuplicateKey = Duplicate key value [{0}] declared for identity constraint of element \"{1}\".
- DuplicateUnique = Duplicate unique value [{0}] declared for identity constraint of element \"{1}\".
- FieldMultipleMatch = Identity constraint error: field \"{0}\" matches more than one value within the scope of its selector; fields must match unique values.
- FixedDiffersFromActual = The content of this element is not equivalent to the value of the \"fixed\" attribute in the element's declaration in the schema.
- KeyMatchesNillable = Identity Constraint error (cvc-identity-constraint.4.2.3): element \"{0}\" has a key which matches an element which has nillable set to true.
- KeyNotEnoughValues = Not enough values specified for <key name=\"{1}\"> identity constraint specified for element \"{0}\".
- KeyNotFound = Key ''{0}'' with value ''{1}'' not found for identity constraint of element ''{2}''.
- KeyRefNotEnoughValues = Not enough values specified for <keyref name=\"{1}\"> identity constraint specified for element \"{0}\".
- KeyRefOutOfScope = Identity Constraint error: identity constraint \"{0}\" has a keyref which refers to a key or unique that is out of scope.
- KeyRefReferNotFound = Key reference declaration \"{0}\" refers to unknown key with name \"{1}\".
- UniqueNotEnoughValues = Not enough values specified for <unique> identity constraint specified for element \"{0}\".
- UnknownField = Internal identity constraint error; unknown field \"{0}\".
-
-# Ideally, we should only use the following error keys, not the ones under
-# "Identity constraints". And we should cover all of the following errors.
-
-#validation (3.X.4)
-
- cvc-attribute.3 = cvc-attribute.3: The value ''{2}'' of attribute ''{1}'' on element ''{0}'' is not valid with respect to its type, ''{3}''.
- cvc-attribute.4 = cvc-attribute.4: The value ''{2}'' of attribute ''{1}'' on element ''{0}'' is not valid with respect to its fixed '{'value constraint'}'. The attribute must have a value of ''{3}''.
- cvc-complex-type.2.1 = cvc-complex-type.2.1: Element ''{0}'' must have no character or element information item [children], because the type''s content type is empty.
- cvc-complex-type.2.2 = cvc-complex-type.2.2: Element ''{0}'' must have no element [children], and the value must be valid.
- cvc-complex-type.2.3 = cvc-complex-type.2.3: Element ''{0}'' cannot have character [children], because the type''s content type is element-only.
- cvc-complex-type.2.4.a = cvc-complex-type.2.4.a: Invalid content was found starting with element ''{0}''. One of ''{1}'' is expected.
- cvc-complex-type.2.4.b = cvc-complex-type.2.4.b: The content of element ''{0}'' is not complete. One of ''{1}'' is expected.
- cvc-complex-type.2.4.c = cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element ''{0}''.
- cvc-complex-type.2.4.d = cvc-complex-type.2.4.d: Invalid content was found starting with element ''{0}''. No child element is expected at this point.
- cvc-complex-type.2.4.e = cvc-complex-type.2.4.d: Invalid content was found starting with element ''{0}''. No child element ''{1}'' is expected at this point.
- cvc-complex-type.3.1 = cvc-complex-type.3.1: Value ''{2}'' of attribute ''{1}'' of element ''{0}'' is not valid with respect to the corresponding attribute use. Attribute ''{1}'' has a fixed value of ''{3}''.
- cvc-complex-type.3.2.1 = cvc-complex-type.3.2.1: Element ''{0}'' does not have an attribute wildcard for attribute ''{1}''.
- cvc-complex-type.3.2.2 = cvc-complex-type.3.2.2: Attribute ''{1}'' is not allowed to appear in element ''{0}''.
- cvc-complex-type.4 = cvc-complex-type.4: Attribute ''{1}'' must appear on element ''{0}''.
- cvc-complex-type.5.1 = cvc-complex-type.5.1: In element ''{0}'', attribute ''{1}'' is a Wild ID. But there is already a Wild ID ''{2}''. There can be only one.
- cvc-complex-type.5.2 = cvc-complex-type.5.2: In element ''{0}'', attribute ''{1}'' is a Wild ID. But there is already an attribute ''{2}'' derived from ID among the '{'attribute uses'}'.
- cvc-datatype-valid.1.2.1 = cvc-datatype-valid.1.2.1: ''{0}'' is not a valid value for ''{1}''.
- cvc-datatype-valid.1.2.2 = cvc-datatype-valid.1.2.2: ''{0}'' is not a valid value of list type ''{1}''.
- cvc-datatype-valid.1.2.3 = cvc-datatype-valid.1.2.3: ''{0}'' is not a valid value of union type ''{1}''.
- cvc-elt.1 = cvc-elt.1: Cannot find the declaration of element ''{0}''.
- cvc-elt.2 = cvc-elt.2: The value of '{'abstract'}' in the element declaration for ''{0}'' must be false.
- cvc-elt.3.1 = cvc-elt.3.1: Attribute ''{1}'' must not appear on element ''{0}'', because the '{'nillable'}' property of ''{0}'' is false.
- cvc-elt.3.2.1 = cvc-elt.3.2.1: Element ''{0}'' cannot have character or element information [children], because ''{1}'' is specified.
- cvc-elt.3.2.2 = cvc-elt.3.2.2: There must be no fixed '{'value constraint'}' for element ''{0}'', because ''{1}'' is specified.
- cvc-elt.4.1 = cvc-elt.4.1: The value ''{2}'' of attribute ''{1}'' of element ''{0}'' is not a valid QName.
- cvc-elt.4.2 = cvc-elt.4.2: Cannot resolve ''{1}'' to a type definition for element ''{0}''.
- cvc-elt.4.3 = cvc-elt.4.3: Type ''{1}'' is not validly derived from the type definition, ''{2}'', of element ''{0}''.
- cvc-elt.5.1.1 = cvc-elt.5.1.1: '{'value constraint'}' ''{2}'' of element ''{0}'' is not a valid default value for type ''{1}''.
- cvc-elt.5.2.2.1 = cvc-elt.5.2.2.1: Element ''{0}'' must have no element information item [children].
- cvc-elt.5.2.2.2.1 = cvc-elt.5.2.2.2.1: The value ''{1}'' of element ''{0}'' does not match the fixed '{'value constraint'}' value ''{2}''.
- cvc-elt.5.2.2.2.2 = cvc-elt.5.2.2.2.2: The value ''{1}'' of element ''{0}'' does not match the '{'value constraint'}' value ''{2}''.
- cvc-enumeration-valid = cvc-enumeration-valid: Value ''{0}'' is not facet-valid with respect to enumeration ''{1}''. It must be a value from the enumeration.
- cvc-fractionDigits-valid = cvc-fractionDigits-valid: Value ''{0}'' has {1} fraction digits, but the number of fraction digits has been limited to {2}.
- cvc-id.1 = cvc-id.1: There is no ID/IDREF binding for IDREF ''{0}''.
- cvc-id.2 = cvc-id.2: There are multiple occurrences of ID value ''{0}''.
- cvc-id.3 = cvc-id.3: A field of identity constraint ''{0}'' matched element ''{1}'', but this element does not have a simple type.
- cvc-length-valid = cvc-length-valid: Value ''{0}'' with length = ''{1}'' is not facet-valid with respect to length ''{2}'' for type ''{3}''.
- cvc-maxExclusive-valid = cvc-maxExclusive-valid: Value ''{0}'' is not facet-valid with respect to maxExclusive ''{1}'' for type ''{2}''.
- cvc-maxInclusive-valid = cvc-maxInclusive-valid: Value ''{0}'' is not facet-valid with respect to maxInclusive ''{1}'' for type ''{2}''.
- cvc-maxLength-valid = cvc-maxLength-valid: Value ''{0}'' with length = ''{1}'' is not facet-valid with respect to maxLength ''{2}'' for type ''{3}''.
- cvc-minExclusive-valid = cvc-minExclusive-valid: Value ''{0}'' is not facet-valid with respect to minExclusive ''{1}'' for type ''{2}''.
- cvc-minInclusive-valid = cvc-minInclusive-valid: Value ''{0}'' is not facet-valid with respect to minInclusive ''{1}'' for type ''{2}''.
- cvc-minLength-valid = cvc-minLength-valid: Value ''{0}'' with length = ''{1}'' is not facet-valid with respect to minLength ''{2}'' for type ''{3}''.
- cvc-pattern-valid = cvc-pattern-valid: Value ''{0}'' is not facet-valid with respect to pattern ''{1}'' for type ''{2}''.
- cvc-totalDigits-valid = cvc-totalDigits-valid: Value ''{0}'' has {1} total digits, but the number of total digits has been limited to {2}.
- cvc-type.2 = cvc-type.2: The type definition cannot be abstract for element {0}.
- cvc-type.3.1.1 = cvc-type.3.1.1: Element ''{0}'' is a simple type, so it cannot have attributes, excepting those whose namespace name is identical to ''http://www.w3.org/2001/XMLSchema-instance'' and whose [local name] is one of ''type'', ''nil'', ''schemaLocation'' or ''noNamespaceSchemaLocation''. However, the attribute, ''{1}'' was found.
- cvc-type.3.1.2 = cvc-type.3.1.2: Element ''{0}'' is a simple type, so it must have no element information item [children].
- cvc-type.3.1.3 = cvc-type.3.1.3: The value ''{1}'' of element ''{0}'' is not valid.
-
-#schema valid (3.X.3)
-
- schema_reference.access = schema_reference: Failed to read schema document ''{0}'', because ''{1}'' access is not allowed due to restriction set by the accessExternalSchema property.
- schema_reference.4 = schema_reference.4: Failed to read schema document ''{0}'', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
- src-annotation = src-annotation: <annotation> elements can only contain <appinfo> and <documentation> elements, but ''{0}'' was found.
- src-attribute.1 = src-attribute.1: The properties ''default'' and ''fixed'' cannot both be present in attribute declaration ''{0}''. Use only one of them.
- src-attribute.2 = src-attribute.2: : The property ''default'' is present in attribute ''{0}'', so the value of ''use'' must be ''optional''.
- src-attribute.3.1 = src-attribute.3.1: One of 'ref' or 'name' must be present in a local attribute declaration.
- src-attribute.3.2 = src-attribute.3.2: The content must match (annotation?) for the attribute reference ''{0}''.
- src-attribute.4 = src-attribute.4: Attribute ''{0}'' has both a ''type'' attribute and an anonymous ''simpleType'' child. Only one of these is allowed for an attribute.
- src-attribute_group.2 = src-attribute_group.2: The intersection of wildcards is not expressible for attribute group ''{0}''.
- src-attribute_group.3 = src-attribute_group.3: Circular definitions detected for attribute group ''{0}''. Recursively following attribute group references eventually leads back to itself.
- src-ct.1 = src-ct.1: Complex Type Definition Representation Error for type ''{0}''. When <complexContent> is used, the base type must be a complexType. ''{1}'' is a simpleType.
- src-ct.2.1 = src-ct.2.1: Complex Type Definition Representation Error for type ''{0}''. When <simpleContent> is used, the base type must be a complexType whose content type is simple, or, only if restriction is specified, a complex type with mixed content and emptiable particle, or, only if extension is specified, a simple type. ''{1}'' satisfies none of these conditions.
- src-ct.2.2 = src-ct.2.2: Complex Type Definition Representation Error for type ''{0}''. When a complexType with simpleContent restricts a complexType with mixed content and emptiable particle, then there must be a <simpleType> among the children of <restriction>.
- src-ct.4 = src-ct.4: Complex Type Definition Representation Error for type ''{0}''. The intersection of wildcards is not expressible.
- src-ct.5 = src-ct.5: Complex Type Definition Representation Error for type ''{0}''. The union of wildcards is not expressible.
- src-element.1 = src-element.1: The properties ''default'' and ''fixed'' cannot both be present in element declaration ''{0}''. Use only one of them.
- src-element.2.1 = src-element.2.1: : One of 'ref' or 'name' must be present in a local element declaration.
- src-element.2.2 = src-element.2.2: Since ''{0}'' contains the ''ref'' attribute, its content must match (annotation?). However, ''{1}'' was found.
- src-element.3 = src-element.3: Element ''{0}'' has both a ''type'' attribute and a ''anonymous type'' child. Only one of these is allowed for an element.
- src-import.1.1 = src-import.1.1: The namespace attribute ''{0}'' of an <import> element information item must not be the same as the targetNamespace of the schema it exists in.
- src-import.1.2 = src-import.1.2: If the namespace attribute is not present on an <import> element information item then the enclosing schema must have a targetNamespace.
- src-import.2 = src-import.2: The root element of document ''{0}'' has to have the namespace name ''http://www.w3.org/2001/XMLSchema'' and the local name ''schema''.
- src-import.3.1 = src-import.3.1: The namespace attribute, ''{0}'', of an <import> element information item must be identical to the targetNamespace attribute, ''{1}'', of the imported document.
- src-import.3.2 = src-import.3.2: An <import> element information item that had no namespace attribute was found, so the imported document cannot have a targetNamespace attribute. However, the targetNamespace ''{1}'' was found in the imported document.
- src-include.1 = src-include.1: The root element of document ''{0}'' has to have the namespace name ''http://www.w3.org/2001/XMLSchema'' and the local name ''schema''.
- src-include.2.1 = src-include.2.1: The targetNamespace of the referenced schema, currently ''{1}'', must be identical to that of the including schema, currently ''{0}''.
- src-redefine.2 = src-redefine.2: The root element of document ''{0}'' has to have the namespace name ''http://www.w3.org/2001/XMLSchema'' and the local name ''schema''.
- src-redefine.3.1 = src-redefine.3.1: The targetNamespace of the referenced schema, currently ''{1}'', must be identical to that of the redefining schema, currently ''{0}''.
- src-redefine.5.a.a = src-redefine.5.a.a: No non-annotation children of <simpleType> were found. <simpleType> children of <redefine> elements must have <restriction> descendants, with 'base' attributes that refer to themselves.
- src-redefine.5.a.b = src-redefine.5.a.b: ''{0}'' is not a valid child element. <simpleType> children of <redefine> elements must have <restriction> descendants, with ''base'' attributes that refer to themselves.
- src-redefine.5.a.c = src-redefine.5.a.c: ''{0}'' does not have a ''base'' attribute that refers to the redefined element, ''{1}''. <simpleType> children of <redefine> elements must have <restriction> descendants, with ''base'' attributes that refer to themselves.
- src-redefine.5.b.a = src-redefine.5.b.a: No non-annotation children of <complexType> were found. <complexType> children of <redefine> elements must have <extension> or <restriction> descendants, with 'base' attributes that refer to themselves.
- src-redefine.5.b.b = src-redefine.5.b.b: No non-annotation grandchildren of <complexType> were found. <complexType> children of <redefine> elements must have <extension> or <restriction> descendants, with 'base' attributes that refer to themselves.
- src-redefine.5.b.c = src-redefine.5.b.c: ''{0}'' is not a valid grandchild element. <complexType> children of <redefine> elements must have <extension> or <restriction> descendants, with ''base'' attributes that refer to themselves.
- src-redefine.5.b.d = src-redefine.5.b.d: ''{0}'' does not have a ''base'' attribute that refers to the redefined element, ''{1}''. <complexType> children of <redefine> elements must have <extension> or <restriction> descendants, with ''base'' attributes that refer to themselves.
- src-redefine.6.1.1 = src-redefine.6.1.1: If a group child of a <redefine> element contains a group referring itself, it must have exactly 1; this one has ''{0}''.
- src-redefine.6.1.2 = src-redefine.6.1.2: The group ''{0}'', which contains a reference to a group being redefined, must have ''minOccurs'' = ''maxOccurs'' = 1.
- src-redefine.6.2.1 = src-redefine.6.2.1: No group in the redefined schema has a name matching ''{0}''.
- src-redefine.6.2.2 = src-redefine.6.2.2: Group ''{0}'' does not properly restrict the group it redefines; constraint violated: ''{1}''.
- src-redefine.7.1 = src-redefine.7.1: If an attributeGroup child of a <redefine> element contains an attributeGroup referring itself, it must have exactly 1; this one has {0}.
- src-redefine.7.2.1 = src-redefine.7.2.1: No attributeGroup in the redefined schema has a name matching ''{0}''.
- src-redefine.7.2.2 = src-redefine.7.2.2: AttributeGroup ''{0}'' does not properly restrict the attributeGroup it redefines; constraint violated: ''{1}''.
- src-resolve = src-resolve: Cannot resolve the name ''{0}'' to a(n) ''{1}'' component.
- src-resolve.4.1 = src-resolve.4.1: Error resolving component ''{2}''. It was detected that ''{2}'' has no namespace, but components with no target namespace are not referenceable from schema document ''{0}''. If ''{2}'' is intended to have a namespace, perhaps a prefix needs to be provided. If it is intended that ''{2}'' has no namespace, then an ''import'' without a "namespace" attribute should be added to ''{0}''.
- src-resolve.4.2 = src-resolve.4.2: Error resolving component ''{2}''. It was detected that ''{2}'' is in namespace ''{1}'', but components from this namespace are not referenceable from schema document ''{0}''. If this is the incorrect namespace, perhaps the prefix of ''{2}'' needs to be changed. If this is the correct namespace, then an appropriate ''import'' tag should be added to ''{0}''.
- src-simple-type.2.a = src-simple-type.2.a: A <restriction> element was found that has both a base [attribute] and a <simpleType> element among its [children]. Only one is allowed.
- src-simple-type.2.b = src-simple-type.2.b: A <restriction> element was found that has neither a base [attribute] nor a <simpleType> element among its [children]. One is required.
- src-simple-type.3.a = src-simple-type.3.a: A <list> element was found that has both an itemType [attribute] and a <simpleType> element among its [children]. Only one is allowed.
- src-simple-type.3.b = src-simple-type.3.b: A <list> element was found that has neither an itemType [attribute] nor a <simpleType> element among its [children]. One is required.
- src-single-facet-value = src-single-facet-value: The facet ''{0}'' is defined more than once.
- src-union-memberTypes-or-simpleTypes = src-union-memberTypes-or-simpleTypes: A <union> element must have either a non-empty memberTypes [attribute] or at least one <simpleType> element among its [children].
-
-#constraint valid (3.X.6)
-
- ag-props-correct.2 = ag-props-correct.2: Error for attribute group ''{0}''. Duplicate attribute uses with the same name and target namespace are specified. Name of duplicate attribute use is ''{1}''.
- ag-props-correct.3 = ag-props-correct.3: Error for attribute group ''{0}''. Two attribute declarations, ''{1}'' and ''{2}'' have types which are derived from ID.
- a-props-correct.2 = a-props-correct.2: Invalid value constraint value ''{1}'' in attribute ''{0}''.
- a-props-correct.3 = a-props-correct.3: Attribute ''{0}'' cannot use ''fixed'' or ''default'', because the attribute''s '{'type definition'}' is ID, or is derived from ID.
- au-props-correct.2 = au-props-correct.2: In the attribute declaration of ''{0}'', a fixed value of ''{1}'' was specified. So if the attribute use referring to ''{0}'' also has a '{'value constraint'}', it must be fixed and its value must be ''{1}''.
- cos-all-limited.1.2 = cos-all-limited.1.2: An 'all' model group must appear in a particle with '{'min occurs'}' = '{'max occurs'}' = 1, and that particle must be part of a pair which constitutes the '{'content type'}' of a complex type definition.
- cos-all-limited.2 = cos-all-limited.2: The '{'max occurs'}' of an element in an ''all'' model group must be 0 or 1. The value ''{0}'' for element ''{1}'' is invalid.
- cos-applicable-facets = cos-applicable-facets: Facet ''{0}'' is not allowed by type {1}.
- cos-ct-extends.1.1 = cos-ct-extends.1.1: Type ''{0}'' was derived by extension from type ''{1}''. However, the ''final'' attribute of ''{1}'' forbids derivation by extension.
- cos-ct-extends.1.4.3.2.2.1.a = cos-ct-extends.1.4.3.2.2.1.a: The content type of a derived type and that of its base must both be mixed or both be element-only. Type ''{0}'' is element only, but its base type is not.
- cos-ct-extends.1.4.3.2.2.1.b = cos-ct-extends.1.4.3.2.2.1.b: The content type of a derived type and that of its base must both be mixed or both be element-only. Type ''{0}'' is mixed, but its base type is not.
- cos-element-consistent = cos-element-consistent: Error for type ''{0}''. Multiple elements with name ''{1}'', with different types, appear in the model group.
- cos-list-of-atomic = cos-list-of-atomic: In the definition of list type ''{0}'', type ''{1}'' is an invalid list element type because it is not atomic (''{1}'' is either a list type, or a union type which contains a list).
- cos-nonambig = cos-nonambig: {0} and {1} (or elements from their substitution group) violate \"Unique Particle Attribution\". During validation against this schema, ambiguity would be created for those two particles.
- cos-particle-restrict.a = cos-particle-restrict.a: Derived particle is empty, and base is not emptiable.
- cos-particle-restrict.b = cos-particle-restrict.b: Base particle is empty, but derived particle is not.
- cos-particle-restrict.2 = cos-particle-restrict.2: Forbidden particle restriction: ''{0}''.
- cos-st-restricts.1.1 = cos-st-restricts.1.1: The type ''{1}'' is atomic, so its '{'base type definition'}', ''{0}'', must be an atomic simple type definition or a built-in primitive datatype.
- cos-st-restricts.2.1 = cos-st-restricts.2.1: In the definition of list type ''{0}'', type ''{1}'' is an invalid item type because it is either a list type, or a union type that contains a list.
- cos-st-restricts.2.3.1.1 = cos-st-restricts.2.3.1.1: The '{'final'}' component of the '{'item type definition'}', ''{0}'', contains ''list''. This means that ''{0}'' cannot be used as an item type for list type ''{1}''.
- cos-st-restricts.3.3.1.1 = cos-st-restricts.3.3.1.1: The '{'final'}' component of the '{'member type definitions'}', ''{0}'', contains ''union''. This means that ''{0}'' cannot be used as an member type for union type ''{1}''.
- cos-valid-default.2.1 = cos-valid-default.2.1: Element ''{0}'' has a value constraint and must have a mixed or simple content model.
- cos-valid-default.2.2.2 = cos-valid-default.2.2.2: Since element ''{0}'' has a '{'value constraint'}' and its type definition has mixed '{'content type'}', then the particle of the '{'content type'}' must be emptiable.
- c-props-correct.2 = c-props-correct.2: Cardinality of Fields for keyref ''{0}'' and key ''{1}'' must match each other.
- ct-props-correct.3 = ct-props-correct.3: Circular definitions detected for complex type ''{0}''. This means that ''{0}'' is contained in its own type hierarchy, which is an error.
- ct-props-correct.4 = ct-props-correct.4: Error for type ''{0}''. Duplicate attribute uses with the same name and target namespace are specified. Name of duplicate attribute use is ''{1}''.
- ct-props-correct.5 = ct-props-correct.5: Error for type ''{0}''. Two attribute declarations, ''{1}'' and ''{2}'' have types which are derived from ID.
- derivation-ok-restriction.1 = derivation-ok-restriction.1: Type ''{0}'' was derived by restriction from type ''{1}''. However, ''{1}'' has a '{'final'}' property that forbids derivation by restriction.
- derivation-ok-restriction.2.1.1 = derivation-ok-restriction.2.1.1: Error for type ''{0}''. The attribute use ''{1}'' in this type has a ''use'' value of ''{2}'', which is inconsistent with the value of ''required'' in a matching attribute use in the base type.
- derivation-ok-restriction.2.1.2 = derivation-ok-restriction.2.1.2: Error for type ''{0}''. The attribute use ''{1}'' in this type has type ''{2}'', which is not validly derived from ''{3}'', the type of the matching attribute use in the base type.
- derivation-ok-restriction.2.1.3.a = derivation-ok-restriction.2.1.3.a: Error for type ''{0}''. The attribute use ''{1}'' in this type has an effective value constraint which is not fixed, and the effective value constraint of the matching attribute use in the base type is fixed.
- derivation-ok-restriction.2.1.3.b = derivation-ok-restriction.2.1.3.b: Error for type ''{0}''. The attribute use ''{1}'' in this type has an effective value constraint fixed with a value of ''{2}'', which is not consistent with the value of ''{3}'' for the fixed effective value constraint of the matching attribute use in the base type.
- derivation-ok-restriction.2.2.a = derivation-ok-restriction.2.2.a: Error for type ''{0}''. The attribute use ''{1}'' in this type does not have a matching attribute use in the base, and the base type does not have a wildcard attribute.
- derivation-ok-restriction.2.2.b = derivation-ok-restriction.2.2.b: Error for type ''{0}''. The attribute use ''{1}'' in this type does not have a matching attribute use in the base, and the wildcard in the base type does not allow the namespace ''{2}'' of this attribute use.
- derivation-ok-restriction.3 = derivation-ok-restriction.3: Error for type ''{0}''. The attribute use ''{1}'' in the base type has REQUIRED as true, but there is no matching attribute use in the derived type.
- derivation-ok-restriction.4.1 = derivation-ok-restriction.4.1: Error for type ''{0}''. The derivation has an attribute wildcard, but the base does not have one.
- derivation-ok-restriction.4.2 = derivation-ok-restriction.4.2: Error for type ''{0}''. The wildcard in the derivation is not a valid wildcard subset of the one in the base.
- derivation-ok-restriction.4.3 = derivation-ok-restriction.4.3: Error for type ''{0}''. The process contents of the wildcard in the derivation ({1}) is weaker than that in the base ({2}).
- derivation-ok-restriction.5.2.2.1 = derivation-ok-restriction.5.2.2.1: Error for type ''{0}''. The simple content type of this type, ''{1}'', is not a valid restriction of the simple content type of the base, ''{2}''.
- derivation-ok-restriction.5.3.2 = derivation-ok-restriction.5.3.2: Error for type ''{0}''. The content type of this type is empty, but the content type of the base, ''{1}'', is not empty or emptiable.
- derivation-ok-restriction.5.4.1.2 = derivation-ok-restriction.5.4.1.2: Error for type ''{0}''. The content type of this type is mixed, but the content type of the base, ''{1}'', is not.
- derivation-ok-restriction.5.4.2 = derivation-ok-restriction.5.4.2: Error for type ''{0}''. The particle of the type is not a valid restriction of the particle of the base.
- enumeration-required-notation = enumeration-required-notation: The NOTATION type, ''{0}'' used by {2} ''{1}'', must have an enumeration facet value which specifies the notation elements used by this type.
- enumeration-valid-restriction = enumeration-valid-restriction: Enumeration value ''{0}'' is not in the value space of the base type, {1}.
- e-props-correct.2 = e-props-correct.2: Invalid value constraint value ''{1}'' in element ''{0}''.
- e-props-correct.4 = e-props-correct.4: The '{'type definition'}' of element ''{0}'' is not validly derived from the '{'type definition'}' of the substitutionHead ''{1}'', or the '{'substitution group exclusions'}' property of ''{1}'' does not allow this derivation.
- e-props-correct.5 = e-props-correct.5: A '{'value constraint'}' must not be present on element ''{0}'', because the element''s '{'type definition'}' or '{'type definition'}'''s '{'content type'}' is ID, or is derived from ID.
- e-props-correct.6 = e-props-correct.6: Circular substitution group detected for element ''{0}''.
- fractionDigits-valid-restriction = fractionDigits-valid-restriction: In the definition of {2}, the value ''{0}'' for the facet ''fractionDigits'' is invalid, because it must be <= the value for ''fractionDigits'' which was set to ''{1}'' in one of the ancestor types.
- fractionDigits-totalDigits = fractionDigits-totalDigits: In the definition of {2}, the value ''{0}'' for the facet ''fractionDigits'' is invalid, because the value must be <= the value for ''totalDigits'' which is ''{1}''.
- length-minLength-maxLength.1.1 = length-minLength-maxLength.1.1: For type {0}, it is an error for the value of length ''{1}'' to be less than the value of minLength ''{2}''.
- length-minLength-maxLength.1.2.a = length-minLength-maxLength.1.2.a: For type {0}, it is an error for the base to not have a minLength facet if the current restriction has the minLength facet and the current restriction or base has the length facet.
- length-minLength-maxLength.1.2.b = length-minLength-maxLength.1.2.b: For type {0}, it is an error for the current minLength ''{1}'' to not equal the base minLength ''{2}''.
- length-minLength-maxLength.2.1 = length-minLength-maxLength.2.1: For type {0}, it is an error for the value of length ''{1}'' to be greater than the value of maxLength ''{2}''.
- length-minLength-maxLength.2.2.a = length-minLength-maxLength.2.2.a: For type {0}, it is an error for the base to not have a maxLength facet if the current restriction has the maxLength facet and the current restriction or base has the length facet.
- length-minLength-maxLength.2.2.b = length-minLength-maxLength.2.2.b: For type {0}, it is an error for the current maxLength ''{1}'' to not equal the base maxLength ''{2}''.
- length-valid-restriction = length-valid-restriction: Error for type ''{2}''. The value of length = ''{0}'' must be = the value of that of the base type ''{1}''.
- maxExclusive-valid-restriction.1 = maxExclusive-valid-restriction.1: Error for type ''{2}''. The maxExclusive value =''{0}'' must be <= maxExclusive of the base type ''{1}''.
- maxExclusive-valid-restriction.2 = maxExclusive-valid-restriction.2: Error for type ''{2}''. The maxExclusive value =''{0}'' must be <= maxInclusive of the base type ''{1}''.
- maxExclusive-valid-restriction.3 = maxExclusive-valid-restriction.3: Error for type ''{2}''. The maxExclusive value =''{0}'' must be > minInclusive of the base type ''{1}''.
- maxExclusive-valid-restriction.4 = maxExclusive-valid-restriction.4: Error for type ''{2}''. The maxExclusive value =''{0}'' must be > minExclusive of the base type ''{1}''.
- maxInclusive-maxExclusive = maxInclusive-maxExclusive: It is an error for both maxInclusive and maxExclusive to be specified for the same datatype. In {2}, maxInclusive = ''{0}'' and maxExclusive = ''{1}''.
- maxInclusive-valid-restriction.1 = maxInclusive-valid-restriction.1: Error for type ''{2}''. The maxInclusive value =''{0}'' must be <= maxInclusive of the base type ''{1}''.
- maxInclusive-valid-restriction.2 = maxInclusive-valid-restriction.2: Error for type ''{2}''. The maxInclusive value =''{0}'' must be < maxExclusive of the base type ''{1}''.
- maxInclusive-valid-restriction.3 = maxInclusive-valid-restriction.3: Error for type ''{2}''. The maxInclusive value =''{0}'' must be >= minInclusive of the base type ''{1}''.
- maxInclusive-valid-restriction.4 = maxInclusive-valid-restriction.4: Error for type ''{2}''. The maxInclusive value =''{0}'' must be > minExclusive of the base type ''{1}''.
- maxLength-valid-restriction = maxLength-valid-restriction: In the definition of {2}, maxLength value = ''{0}'' must be <= that of the base type ''{1}''.
- mg-props-correct.2 = mg-props-correct.2: Circular definitions detected for group ''{0}''. Recursively following the '{'term'}' values of the particles leads to a particle whose '{'term'}' is the group itself.
- minExclusive-less-than-equal-to-maxExclusive = minExclusive-less-than-equal-to-maxExclusive: In the definition of {2}, minExclusive value = ''{0}'' must be <= maxExclusive value = ''{1}''.
- minExclusive-less-than-maxInclusive = minExclusive-less-than-maxInclusive: In the definition of {2}, minExclusive value = ''{0}'' must be < maxInclusive value = ''{1}''.
- minExclusive-valid-restriction.1 = minExclusive-valid-restriction.1: Error for type ''{2}''. The minExclusive value =''{0}'' must be >= minExclusive of the base type ''{1}''.
- minExclusive-valid-restriction.2 = minExclusive-valid-restriction.2: Error for type ''{2}''. The minExclusive value =''{0}'' must be <= maxInclusive of the base type ''{1}''.
- minExclusive-valid-restriction.3 = minExclusive-valid-restriction.3: Error for type ''{2}''. The minExclusive value =''{0}'' must be >= minInclusive of the base type ''{1}''.
- minExclusive-valid-restriction.4 = minExclusive-valid-restriction.4: Error for type ''{2}''. The minExclusive value =''{0}'' must be < maxExclusive of the base type ''{1}''.
- minInclusive-less-than-equal-to-maxInclusive = minInclusive-less-than-equal-to-maxInclusive: In the definition of {2}, minInclusive value = ''{0}'' must be <= maxInclusive value = ''{1}''.
- minInclusive-less-than-maxExclusive = minInclusive-less-than-maxExclusive: In the definition of {2}, minInclusive value = ''{0}'' must be < maxExclusive value = ''{1}''.
- minInclusive-minExclusive = minInclusive-minExclusive: It is an error for both minInclusive and minExclusive to be specified for the same datatype. In {2}, minInclusive = ''{0}'' and minExclusive = ''{1}''.
- minInclusive-valid-restriction.1 = minInclusive-valid-restriction.1: Error for type ''{2}''. The minInclusive value =''{0}'' must be >= minInclusive of the base type ''{1}''.
- minInclusive-valid-restriction.2 = minInclusive-valid-restriction.2: Error for type ''{2}''. The minInclusive value =''{0}'' must be <= maxInclusive of the base type ''{1}''.
- minInclusive-valid-restriction.3 = minInclusive-valid-restriction.3: Error for type ''{2}''. The minInclusive value =''{0}'' must be > minExclusive of the base type ''{1}''.
- minInclusive-valid-restriction.4 = minInclusive-valid-restriction.4: Error for type ''{2}''. The minInclusive value =''{0}'' must be < maxExclusive of the base type ''{1}''.
- minLength-less-than-equal-to-maxLength = minLength-less-than-equal-to-maxLength: In the definition of {2}, value of minLength = ''{0}'' must be < value of maxLength = ''{1}''.
- minLength-valid-restriction = minLength-valid-restriction: In the definition of {2}, minLength = ''{0}'' must be >= than that of the base type, ''{1}''.
- no-xmlns = no-xmlns: The {name} of an attribute declaration must not match 'xmlns'.
- no-xsi = no-xsi: The '{'target namespace'}' of an attribute declaration must not match ''{0}''.
- p-props-correct.2.1 = p-props-correct.2.1: In the declaration of ''{0}'', the value of ''minOccurs'' is ''{1}'', but it must not be greater than the value of ''maxOccurs'', which is ''{2}''.
- rcase-MapAndSum.1 = rcase-MapAndSum.1: There is not a complete functional mapping between the particles.
- rcase-MapAndSum.2 = rcase-MapAndSum.2: Group''s occurrence range, ({0},{1}), is not a valid restriction of base group''s occurrence range, ({2},{3}).
- rcase-NameAndTypeOK.1 = rcase-NameAndTypeOK.1: Elements have names and target namespaces which are not the same: Element ''{0}'' in namespace ''{1}'' and element ''{2}'' in namespace ''{3}''.
- rcase-NameAndTypeOK.2 = rcase-NameAndTypeOK.2: Error for the particle whose '{'term'}' is the element declaration ''{0}''. The element declaration''s '{'nillable'}' is true, but the corresponding particle in the base type has an element declaration whose '{'nillable'}' is false.
- rcase-NameAndTypeOK.3 = rcase-NameAndTypeOK.3: Error for the particle whose '{'term'}' is the element declaration ''{0}''. Its occurrence range, ({1},{2}), is not a valid restriction of the range, ({3},{4}, of the corresponding particle in the base type.
- rcase-NameAndTypeOK.4.a = rcase-NameAndTypeOK.4.a: Element ''{0}'' is not fixed, but the corresponding element in the base type is fixed with value ''{1}''.
- rcase-NameAndTypeOK.4.b = rcase-NameAndTypeOK.4.b: Element ''{0}'' is fixed with value ''{1}'', but the corresponding element in the base type is fixed with value ''{2}''.
- rcase-NameAndTypeOK.5 = rcase-NameAndTypeOK.5: Identity constraints for element ''{0}'' are not a subset of those in base.
- rcase-NameAndTypeOK.6 = rcase-NameAndTypeOK.6: The disallowed substitutions for element ''{0}'' are not a superset of those in the base.
- rcase-NameAndTypeOK.7 = rcase-NameAndTypeOK.7: The type of element ''{0}'', ''{1}'', is not derived from the type of the base element, ''{2}''.
- rcase-NSCompat.1 = rcase-NSCompat.1: Element ''{0}'' has a namespace ''{1}'' which is not allowed by the wildcard in the base.
- rcase-NSCompat.2 = rcase-NSCompat.2: Error for the particle whose '{'term'}' is the element declaration ''{0}''. Its occurrence range, ({1},{2}), is not a valid restriction of the range, ({3},{4}, of the corresponding particle in the base type.
- rcase-NSRecurseCheckCardinality.1 = rcase-NSRecurseCheckCardinality.1: There is not a complete functional mapping between the particles.
- rcase-NSRecurseCheckCardinality.2 = rcase-NSRecurseCheckCardinality.2: Group''s occurrence range, ({0},{1}), is not a valid restriction of base wildcard''s range, ({2},{3}).
- rcase-NSSubset.1 = rcase-NSSubset.1: Wildcard is not a subset of corresponding wildcard in base.
- rcase-NSSubset.2 = rcase-NSSubset.2: Wildcard''s occurrence range, ({0},{1}), is not a valid restriction of that in the base, ({2},{3}),.
- rcase-NSSubset.3 = rcase-NSSubset.3: Wildcard''s process contents, ''{0}'', is weaker than that in the base, ''{1}''.
- rcase-Recurse.1 = rcase-Recurse.1: Group''s occurrence range, ({0},{1}), is not a valid restriction of base group''s occurrence range, ({2},{3}).
- rcase-Recurse.2 = rcase-Recurse.2: There is not a complete functional mapping between the particles.
- rcase-RecurseLax.1 = rcase-RecurseLax.1: Group''s occurrence range, ({0},{1}), is not a valid restriction of base group''s occurrence range, ({2},{3}).
- rcase-RecurseLax.2 = rcase-RecurseLax.2: There is not a complete functional mapping between the particles.
- rcase-RecurseUnordered.1 = rcase-RecurseUnordered.1: Group''s occurrence range, ({0},{1}), is not a valid restriction of base group''s occurrence range, ({2},{3}).
- rcase-RecurseUnordered.2 = rcase-RecurseUnordered.2: There is not a complete functional mapping between the particles.
-# We're using sch-props-correct.2 instead of the old src-redefine.1
-# src-redefine.1 = src-redefine.1: The component ''{0}'' is begin redefined, but its corresponding component isn't in the schema document being redefined (with namespace ''{2}''), but in a different document, with namespace ''{1}''.
- sch-props-correct.2 = sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of ''{0}''.
- st-props-correct.2 = st-props-correct.2: Circular definitions have been detected for simple type ''{0}''. This means that ''{0}'' is contained in its own type hierarchy, which is an error.
- st-props-correct.3 = st-props-correct.3: Error for type ''{0}''. The value of '{'final'}' of the '{'base type definition'}', ''{1}'', forbids derivation by restriction.
- totalDigits-valid-restriction = totalDigits-valid-restriction: In the definition of {2}, the value ''{0}'' for the facet ''totalDigits'' is invalid, because it must be <= the value for ''totalDigits'' which was set to ''{1}'' in one of the ancestor types.
- whiteSpace-valid-restriction.1 = whiteSpace-valid-restriction.1: In the definition of {0}, the value ''{1}'' for the facet ''whitespace'' is invalid, because the value for ''whitespace'' has been set to ''collapse'' in one of the ancestor types.
- whiteSpace-valid-restriction.2 = whiteSpace-valid-restriction.2: In the definition of {0}, the value ''preserve'' for the facet ''whitespace'' is invalid, because the value for ''whitespace'' has been set to ''replace'' in one of the ancestor types.
-
-#schema for Schemas
-
- s4s-att-invalid-value = s4s-att-invalid-value: Invalid attribute value for ''{1}'' in element ''{0}''. Recorded reason: {2}
- s4s-att-must-appear = s4s-att-must-appear: Attribute ''{1}'' must appear in element ''{0}''.
- s4s-att-not-allowed = s4s-att-not-allowed: Attribute ''{1}'' cannot appear in element ''{0}''.
- s4s-elt-invalid = s4s-elt-invalid: Element ''{0}'' is not a valid element in a schema document.
- s4s-elt-must-match.1 = s4s-elt-must-match.1: The content of ''{0}'' must match {1}. A problem was found starting at: {2}.
- s4s-elt-must-match.2 = s4s-elt-must-match.2: The content of ''{0}'' must match {1}. Not enough elements were found.
- # the "invalid-content" messages provide less information than the "must-match" counterparts above. They're used for complex types when providing a "match" would be an information dump
- s4s-elt-invalid-content.1 = s4s-elt-invalid-content.1: The content of ''{0}'' is invalid. Element ''{1}'' is invalid, misplaced, or occurs too often.
- s4s-elt-invalid-content.2 = s4s-elt-invalid-content.2: The content of ''{0}'' is invalid. Element ''{1}'' cannot be empty.
- s4s-elt-invalid-content.3 = s4s-elt-invalid-content.3: Elements of type ''{0}'' cannot appear after declarations as children of a <schema> element.
- s4s-elt-schema-ns = s4s-elt-schema-ns: The namespace of element ''{0}'' must be from the schema namespace, ''http://www.w3.org/2001/XMLSchema''.
- s4s-elt-character = s4s-elt-character: Non-whitespace characters are not allowed in schema elements other than ''xs:appinfo'' and ''xs:documentation''. Saw ''{0}''.
-
-# codes not defined by the spec
-
- c-fields-xpaths = c-fields-xpaths: The field value = ''{0}'' is not valid.
- c-general-xpath = c-general-xpath: The expression ''{0}'' is not valid with respect to the XPath subset supported by XML Schema.
- c-general-xpath-ns = c-general-xpath-ns: A namespace prefix in XPath expression ''{0}'' was not bound to a namespace.
- c-selector-xpath = c-selector-xpath: The selector value = ''{0}'' is not valid; selector xpaths cannot contain attributes.
- EmptyTargetNamespace = EmptyTargetNamespace: In schema document ''{0}'', the value of the ''targetNamespace'' attribute cannot be an empty string.
- FacetValueFromBase = FacetValueFromBase: In the declaration of type ''{0}'', value ''{1}'' of facet ''{2}'' must be from the value space of the base type, ''{3}''.
- FixedFacetValue = FixedFacetValue: In the definition of {3}, the value ''{1}'' for the facet ''{0}'' is invalid, because the value for ''{0}'' has been set to ''{2}'' in one of the ancestor types, and '{'fixed'}' = true.
- InvalidRegex = InvalidRegex: Pattern value ''{0}'' is not a valid regular expression. The reported error was: ''{1}'' at column ''{2}''.
- MaxOccurLimit = Current configuration of the parser doesn''t allow a maxOccurs attribute value to be set greater than the value {0}.
- PublicSystemOnNotation = PublicSystemOnNotation: At least one of ''public'' and ''system'' must appear in element ''notation''.
- SchemaLocation = SchemaLocation: schemaLocation value = ''{0}'' must have even number of URI''s.
- TargetNamespace.1 = TargetNamespace.1: Expecting namespace ''{0}'', but the target namespace of the schema document is ''{1}''.
- TargetNamespace.2 = TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace of ''{1}''.
- UndeclaredEntity = UndeclaredEntity: Entity ''{0}'' is not declared.
- UndeclaredPrefix = UndeclaredPrefix: Cannot resolve ''{0}'' as a QName: the prefix ''{1}'' is not declared.
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_de.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_de.properties
deleted file mode 100644
index a0d2c6d..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_de.properties
+++ /dev/null
@@ -1,291 +0,0 @@
-# This file contains error and warning messages related to XML Schema
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
- BadMessageKey = Die zum Meldungsschl\u00FCssel geh\u00F6rige Fehlermeldung kann nicht gefunden werden.
- FormatFailed = Beim Formatieren der folgenden Meldung ist ein interner Fehler aufgetreten:\n
-
-# For internal use
-
- Internal-Error = Interner Fehler: {0}.
- dt-whitespace = Leerstellen-Facet-Wert ist nicht f\u00FCr Vereinigungsmenge simpleType ''{0}'' verf\u00FCgbar
- GrammarConflict = Eine vom Grammatikpool des Benutzers zur\u00FCckgegebene Grammatik steht im Konflikt mit einer anderen Grammatik.
-
-# Identity constraints
-
- AbsentKeyValue = Identity Constraint-Fehler (cvc-identity-constraint.4.2.1): Element ''{0}'' hat einen Schl\u00FCssel ohne Wert.
- DuplicateField = Doppelte \u00DCbereinstimmung in Geltungsbereich f\u00FCr Feld ''{0}''.
- DuplicateKey = Doppelter Schl\u00FCsselwert [{0}] f\u00FCr Identity Constraint des Elements ''{1}''deklariert.
- DuplicateUnique = Doppelter eindeutiger Wert [{0}] f\u00FCr Identity Constraint des Elements ''{1}'' deklariert.
- FieldMultipleMatch = Identity Constraint-Fehler: Feld ''{0}'' entspricht mehreren Werten im Geltungsbereich seines Selektors. Felder m\u00FCssen eindeutigen Werten entsprechen.
- FixedDiffersFromActual = Content dieses Elements entspricht nicht dem Wert des 'fixed'-Attributs in der Elementdeklaration im Schema.
- KeyMatchesNillable = Identity Constraint-Fehler (cvc-identity-constraint.4.2.3): Element ''{0}'' hat einen Schl\u00FCssel, der einem Element entspricht, bei dem ''nillable'' auf ''true'' gesetzt wurde.
- KeyNotEnoughValues = Nicht gen\u00FCgend Werte angegeben f\u00FCr <key name=''{1}''> Identity Constraint f\u00FCr Element ''{0}''.
- KeyNotFound = Schl\u00FCssel ''{0}'' mit Wert ''{1}'' nicht gefunden f\u00FCr Identity Constraint des Elements ''{2}''.
- KeyRefNotEnoughValues = Nicht gen\u00FCgend Werte angegeben f\u00FCr <keyref name=''{1}''> Identity Constraint f\u00FCr Element ''{0}''.
- KeyRefOutOfScope = Identity Constraint-Fehler: Identity Constraint ''{0}'' hat eine keyref, die zu einem Key- oder Unique-Constraint au\u00DFerhalb des Geltungsbereichs verweist.
- KeyRefReferNotFound = Schl\u00FCsselreferenzdeklaration ''{0}'' verweist auf einen unbekannten Schl\u00FCssel mit dem Namen ''{1}''.
- UniqueNotEnoughValues = Nicht gen\u00FCgend Werte angegeben f\u00FCr <unique> Identity Constraint f\u00FCr Element ''{0}''.
- UnknownField = Interner Identity Constraint-Fehler. Unbekanntes Feld ''{0}''.
-
-# Ideally, we should only use the following error keys, not the ones under
-# "Identity constraints". And we should cover all of the following errors.
-
-#validation (3.X.4)
-
- cvc-attribute.3 = cvc-attribute.3: Wert ''{2}'' des Attributs ''{1}'' bei Element ''{0}'' hat keinen g\u00FCltigen Typ ''{3}''.
- cvc-attribute.4 = cvc-attribute.4: Wert ''{2}'' des Attributs ''{1}'' bei Element ''{0}'' hat keinen g\u00FCltigen festen '{'value constraint'}'. Attribute muss den Wert ''{3}'' haben.
- cvc-complex-type.2.1 = cvc-complex-type.2.1: Element ''{0}'' darf kein Zeichen- oder Elementinformationselement [untergeordnete Elemente] haben, da der Contenttyp des Typs leer ist.
- cvc-complex-type.2.2 = cvc-complex-type.2.2: Element ''{0}'' darf kein Element [untergeordnete Elemente] haben, und der Wert muss g\u00FCltig sein.
- cvc-complex-type.2.3 = cvc-complex-type.2.3: Element ''{0}'' darf keine Zeichen [untergeordnete Elemente] haben, da der Contenttyp des Typs ''element-only'' ist.
- cvc-complex-type.2.4.a = cvc-complex-type.2.4.a: Ung\u00FCltiger Content wurde beginnend mit Element ''{0}'' gefunden. ''{1}'' wird erwartet.
- cvc-complex-type.2.4.b = cvc-complex-type.2.4.b: Content des Elements ''{0}'' ist nicht vollst\u00E4ndig. ''{1}'' wird erwartet.
- cvc-complex-type.2.4.c = cvc-complex-type.2.4.c: \u00DCbereinstimmungsplatzhalter ist streng, aber es kann keine Deklaration f\u00FCr Element ''{0}'' gefunden werden.
- cvc-complex-type.2.4.d = cvc-complex-type.2.4.d: Ung\u00FCltiger Content wurde beginnend mit Element ''{0}'' gefunden. An dieser Stelle wird kein untergeordnetes Element erwartet.
- cvc-complex-type.2.4.e = cvc-complex-type.2.4.d: Ung\u00FCltiger Content wurde beginnend mit Element ''{0}'' gefunden. An dieser Stelle wird kein untergeordnetes Element ''{1}'' erwartet.
- cvc-complex-type.3.1 = cvc-complex-type.3.1: Wert ''{2}'' des Attributs ''{1}'' des Elements ''{0}'' ist ung\u00FCltig in Bezug auf die entsprechende Attributverwendung. Attribut ''{1}'' hat den festen Wert ''{3}''.
- cvc-complex-type.3.2.1 = cvc-complex-type.3.2.1: Element ''{0}'' hat keinen Attributplatzhalter f\u00FCr Attribut ''{1}''.
- cvc-complex-type.3.2.2 = cvc-complex-type.3.2.2: Attribut ''{1}'' darf nicht in Element ''{0}'' vorkommen.
- cvc-complex-type.4 = cvc-complex-type.4: Attribut ''{1}'' muss in Element ''{0}'' vorkommen.
- cvc-complex-type.5.1 = cvc-complex-type.5.1: In Element ''{0}'' ist Attribut ''{1}'' ein Platzhalter. Es ist aber bereits ein Platzhalter ''{2}'' vorhanden. Nur ein Platzhalter ist zul\u00E4ssig.
- cvc-complex-type.5.2 = cvc-complex-type.5.2: In Element ''{0}'' ist Attribut ''{1}'' ein Platzhalter. Es ist aber bereits ein Attribut ''{2}'' vorhanden, das von einer ID unter den '{'attribute uses'}' abgeleitet wurde.
- cvc-datatype-valid.1.2.1 = cvc-datatype-valid.1.2.1: ''{0}'' ist kein g\u00FCltiger Wert f\u00FCr ''{1}''.
- cvc-datatype-valid.1.2.2 = cvc-datatype-valid.1.2.2: ''{0}'' ist kein g\u00FCltiger Wert des Listentyps ''{1}''.
- cvc-datatype-valid.1.2.3 = cvc-datatype-valid.1.2.3: ''{0}'' ist kein g\u00FCltiger Wert des Vereinigungsmengentyps ''{1}''.
- cvc-elt.1 = cvc-elt.1: Deklaration des Elements ''{0}'' kann nicht gefunden werden.
- cvc-elt.2 = cvc-elt.2: Wert von '{'abstract'}' in der Elementdeklaration f\u00FCr ''{0}'' muss ''false'' sein.
- cvc-elt.3.1 = cvc-elt.3.1: Attribut ''{1}'' darf nicht in Element ''{0}'' vorkommen, da die die Eigenschaft '{'nillable'}' von ''{0}'' ''false'' ist.
- cvc-elt.3.2.1 = cvc-elt.3.2.1: Element ''{0}'' darf keine Zeichen- oder Elementinformationen [untergeordnete Elemente] haben, da ''{1}'' angegeben wurde.
- cvc-elt.3.2.2 = cvc-elt.3.2.2: Es darf kein fester '{'value constraint'}' f\u00FCr Element ''{0}'' vorhanden sein, da ''{1}'' angegeben wurde.
- cvc-elt.4.1 = cvc-elt.4.1: Wert ''{2}'' des Attributs ''{1}'' von Element ''{0}'' ist kein g\u00FCltiger QName.
- cvc-elt.4.2 = cvc-elt.4.2: ''{1}'' kann nicht als Typdefinition f\u00FCr Element ''{0}'' aufgel\u00F6st werden.
- cvc-elt.4.3 = cvc-elt.4.3: Typ ''{1}'' wurde nicht auf g\u00FCltige Weise von der Typdefinition ''{2}'' des Elements ''{0}'' abgeleitet.
- cvc-elt.5.1.1 = cvc-elt.5.1.1: '{'value constraint'}' ''{2}'' des Elements ''{0}'' ist kein g\u00FCltiger Standardwert f\u00FCr Typ ''{1}''.
- cvc-elt.5.2.2.1 = cvc-elt.5.2.2.1: Element ''{0}'' darf keine Elementinformationselemente [untergeordnete Elemente] haben.
- cvc-elt.5.2.2.2.1 = cvc-elt.5.2.2.2.1: Wert ''{1}'' des Elements ''{0}'' stimmt nicht mit dem festen '{'value constraint'}'-Wert ''{2}'' \u00FCberein.
- cvc-elt.5.2.2.2.2 = cvc-elt.5.2.2.2.2: Wert ''{1}'' des Elements ''{0}'' stimmt nicht mit dem '{'value constraint'}'-Wert ''{2}'' \u00FCberein.
- cvc-enumeration-valid = cvc-enumeration-valid: Wert ''{0}'' ist nicht Facet-g\u00FCltig in Bezug auf Enumeration ''{1}''. Er muss ein Wert aus der Enumeration sein.
- cvc-fractionDigits-valid = cvc-fractionDigits-valid: Wert ''{0}'' enth\u00E4lt {1} Bruchziffern, die Anzahl an Bruchziffern wurde aber auf {2} beschr\u00E4nkt.
- cvc-id.1 = cvc-id.1: Kein ID/IDREF-Binding f\u00FCr IDREF ''{0}'' vorhanden.
- cvc-id.2 = cvc-id.2: ID-Wert ''{0}'' kommt mehrmals vor.
- cvc-id.3 = cvc-id.3: Ein Feld von Identity Constraint ''{0}'' entsprach Element ''{1}''. Dieses Element hat aber keinen Simple Type.
- cvc-length-valid = cvc-length-valid: Wert ''{0}'' mit L\u00E4nge = ''{1}'' ist nicht Facet-g\u00FCltig in Bezug auf die L\u00E4nge ''{2}'' f\u00FCr Typ ''{3}''.
- cvc-maxExclusive-valid = cvc-maxExclusive-valid: Wert ''{0}'' ist nicht Facet-g\u00FCltig in Bezug auf maxExclusive ''{1}'' f\u00FCr Typ ''{2}''.
- cvc-maxInclusive-valid = cvc-maxInclusive-valid: Wert ''{0}'' ist nicht Facet-g\u00FCltig in Bezug auf maxInclusive ''{1}'' f\u00FCr Typ ''{2}''.
- cvc-maxLength-valid = cvc-maxLength-valid: Wert ''{0}'' mit L\u00E4nge = ''{1}'' ist nicht Facet-g\u00FCltig in Bezug auf maxLength ''{2}'' f\u00FCr Typ ''{3}''.
- cvc-minExclusive-valid = cvc-minExclusive-valid: Wert ''{0}'' ist nicht Facet-g\u00FCltig in Bezug auf minExclusive ''{1}'' f\u00FCr Typ ''{2}''.
- cvc-minInclusive-valid = cvc-minInclusive-valid: Wert ''{0}'' ist nicht Facet-g\u00FCltig in Bezug auf minInclusive ''{1}'' f\u00FCr Typ ''{2}''.
- cvc-minLength-valid = cvc-minLength-valid: Wert ''{0}'' mit L\u00E4nge = ''{1}'' ist nicht Facet-g\u00FCltig in Bezug auf minLength ''{2}'' f\u00FCr Typ ''{3}''.
- cvc-pattern-valid = cvc-pattern-valid: Wert ''{0}'' ist nicht Facet-g\u00FCltig in Bezug auf Muster ''{1}'' f\u00FCr Typ ''{2}''.
- cvc-totalDigits-valid = cvc-totalDigits-valid: Wert ''{0}'' enth\u00E4lt {1} Gesamtziffern, die Anzahl an Gesamtziffern wurde aber auf {2} beschr\u00E4nkt.
- cvc-type.2 = cvc-type.2: Typdefinition kann nicht abstrakt f\u00FCr Element {0} sein.
- cvc-type.3.1.1 = cvc-type.3.1.1: Element ''{0}'' ist Simple Type und kann daher keine Attribute haben, mit Ausnahme der Attribute, deren Namespace-Name mit ''http://www.w3.org/2001/XMLSchema-instance'' identisch ist und deren [lokaler Name] ''type'', ''nil'', ''schemaLocation'' oder ''noNamespaceSchemaLocation'' lautet. Es wurde allerdings das Attribut ''{1}'' gefunden.
- cvc-type.3.1.2 = cvc-type.3.1.2: Element ''{0}'' ist Simple Type und darf daher keine Elementinformationselemente [untergeordnete Elemente] haben.
- cvc-type.3.1.3 = cvc-type.3.1.3: Wert ''{1}'' des Elements ''{0}'' ist ung\u00FCltig.
-
-#schema valid (3.X.3)
-
- schema_reference.access = schema_reference: Schemadokument ''{0}'' konnte nicht gelesen werden, weil der ''{1}''-Zugriff wegen der von der Eigenschaft accessExternalSchema festgelegten Einschr\u00E4nkung nicht zul\u00E4ssig ist.
- schema_reference.4 = schema_reference.4: Schemadokument ''{0}'' konnte nicht gelesen werden, da 1) das Dokument nicht gefunden werden konnte; 2) das Dokument nicht gelesen werden konnte; 3) das Root-Element des Dokuments nicht <xsd:schema> ist.
- src-annotation = src-annotation: <annotation>-Elemente k\u00F6nnen nur <appinfo>- und <documentation>-Elemente enthalten, aber es wurde ''{0}'' gefunden.
- src-attribute.1 = src-attribute.1: Die Eigenschaften ''default'' und ''fixed'' k\u00F6nnen nicht beide in der Attributdeklaration ''{0}'' vorhanden sein. Verwenden Sie nur eine dieser Eigenschaften.
- src-attribute.2 = src-attribute.2: : Eigenschaft ''default'' ist im Attribut ''{0}'' vorhanden. Daher muss der Wert von ''use'' ''optional'' lauten.
- src-attribute.3.1 = src-attribute.3.1: 'ref' oder 'name' muss in einer lokalen Attributdeklaration vorhanden sein.
- src-attribute.3.2 = src-attribute.3.2: Content muss mit (annotation?) f\u00FCr die Attributreferenz ''{0}'' \u00FCbereinstimmen.
- src-attribute.4 = src-attribute.4: Attribut ''{0}'' hat sowohl das Attribut ''type'' als auch ein anonymes untergeordnetes Element ''simpleType''. Nur eins davon ist f\u00FCr Attribute zul\u00E4ssig.
- src-attribute_group.2 = src-attribute_group.2: Schnittmenge von Platzhaltern kann nicht f\u00FCr Attributgruppe ''{0}'' ausgedr\u00FCckt werden.
- src-attribute_group.3 = src-attribute_group.3: Zyklische Definitionen f\u00FCr Attributgruppe ''{0}'' ermittelt. Das rekursive Folgen von Attributgruppenreferenzen f\u00FChrt schlie\u00DFlich zu sich selbst zur\u00FCck.
- src-ct.1 = src-ct.1: Darstellungsfehler bei Complex Type-Definition f\u00FCr Typ ''{0}''. Wenn <complexContent> verwendet wird, muss der Basistyp ein complexType sein. ''{1}'' ist ein simpleType.
- src-ct.2.1 = src-ct.2.1: Darstellungsfehler bei Complex Type-Definition f\u00FCr Typ ''{0}''. Wenn <simpleContent> verwendet wird, muss der Basistyp ein complexType sein, dessen Contenttyp ''simple'' ist, oder, wenn eine Einschr\u00E4nkung angegeben wurde, ein ''complex''-Typ mit gemischtem Content und einem Partikel, das geleert werden kann, oder, wenn eine Erweiterung angegeben wurde, ein ''simple''-Typ. ''{1}'' erf\u00FCllt keine dieser Bedingungen.
- src-ct.2.2 = src-ct.2.2: Darstellungsfehler bei Complex Type-Definition f\u00FCr Typ ''{0}''. Wenn ein complexType mit simpleContent einen complexType mit gemischtem Content und einem Partikel, das geleert werden kann, einschr\u00E4nkt, muss ein <simpleType> in den untergeordneten Elementen von <restriction> enthalten sein.
- src-ct.4 = src-ct.4: Darstellungsfehler bei Complex Type-Definition f\u00FCr Typ ''{0}''. Die Schnittmenge der Platzhalter kann nicht ausgedr\u00FCckt werden.
- src-ct.5 = src-ct.5: Darstellungsfehler bei Complex Type-Definition f\u00FCr Typ ''{0}''. Die Vereinigungsmenge der Platzhalter kann nicht ausgedr\u00FCckt werden.
- src-element.1 = src-element.1: Die Eigenschaften ''default'' und ''fixed'' k\u00F6nnen nicht beide in der Elementdeklaration ''{0}'' vorhanden sein. Verwenden Sie nur eine dieser Eigenschaften.
- src-element.2.1 = src-element.2.1: : 'ref' oder 'name' muss in einer lokalen Elementdeklaration vorhanden sein.
- src-element.2.2 = src-element.2.2: Da ''{0}'' das Attribut ''ref'' enth\u00E4lt, muss der Content (annotation?) entsprechen. Es wurde allerdings ''{1}'' gefunden.
- src-element.3 = src-element.3: Element ''{0}'' hat sowohl das Attribut ''type'' als auch ein untergeordnetes Element ''anonymous type''. Nur eins davon ist f\u00FCr Elemente zul\u00E4ssig.
- src-import.1.1 = src-import.1.1: Namespace-Attribut ''{0}'' eines <import>-Elementinformationselements darf nicht mit dem targetNamespace des Schemas identisch sein, in dem es vorhanden ist.
- src-import.1.2 = src-import.1.2: Wenn das Namespace-Attribut nicht bei einem <import>-Elementinformationselement vorhanden ist, muss das einschlie\u00DFende Schema einen targetNamespace haben.
- src-import.2 = src-import.2: Das Root-Element des Dokuments ''{0}'' muss den Namespace-Namen ''http://www.w3.org/2001/XMLSchema'' und den lokalen Namen ''schema'' haben.
- src-import.3.1 = src-import.3.1: Namespace-Attribut ''{0}'' eines <import>-Elementinformationselements muss mit dem targetNamespace-Attribut ''{1}'' des importierten Dokuments identisch sein.
- src-import.3.2 = src-import.3.2: Es wurde ein <import>-Elementinformationselement ohne Namespace-Attribut gefunden. Daher kann das importierte Dokument kein targetNamespace-Attribut haben. targetNamespace ''{1}'' wurde aber im importierten Dokument gefunden.
- src-include.1 = src-include.1: Das Root-Element des Dokuments ''{0}'' muss den Namespace-Namen ''http://www.w3.org/2001/XMLSchema'' und den lokalen Namen ''schema'' haben.
- src-include.2.1 = src-include.2.1: targetNamespace des referenzierten Schemas, derzeit ''{1}'', muss mit dem im umfassenden Schema, derzeit ''{0}'', identisch sein.
- src-redefine.2 = src-redefine.2: Das Root-Element des Dokuments ''{0}'' muss den Namespace-Namen ''http://www.w3.org/2001/XMLSchema'' und den lokalen Namen ''schema'' haben.
- src-redefine.3.1 = src-redefine.3.1: targetNamespace des referenzierten Schemas, derzeit ''{1}'', muss mit dem im neu definierenden Schema, derzeit ''{0}'', identisch sein.
- src-redefine.5.a.a = src-redefine.5.a.a: Keine untergeordneten Nicht-Annotationselemente von <simpleType> gefunden. Untergeordnete <simpleType>-Elemente von <redefine>-Elementen m\u00FCssen <restriction>-Nachkommen mit 'base'-Attributen haben, die auf sich selbst verweisen.
- src-redefine.5.a.b = src-redefine.5.a.b: ''{0}'' ist kein g\u00FCltiges untergeordnetes Element. Untergeordnete <simpleType>-Elemente von <redefine>-Elementen m\u00FCssen <restriction>-Nachkommen mit ''base''-Attributen haben, die auf sich selbst verweisen.
- src-redefine.5.a.c = src-redefine.5.a.c: ''{0}'' hat kein ''base''-Attribut, das auf das neu definierte Element ''{1}'' verweist. Untergeordnete <simpleType>-Elemente von <redefine>-Elementen m\u00FCssen <restriction>-Nachkommen mit ''base''-Attributen haben, die auf sich selbst verweisen.
- src-redefine.5.b.a = src-redefine.5.b.a: Keine untergeordneten Nicht-Annotationselemente von <complexType> gefunden. Untergeordnete <complexType>-Elemente von <redefine>-Elementen m\u00FCssen <extension>- oder <restriction>-Nachkommen mit 'base'-Attributen haben, die auf sich selbst verweisen.
- src-redefine.5.b.b = src-redefine.5.b.b: Keine untergeordneten Nicht-Annotationselemente der zweiten Generation von <complexType> gefunden. Untergeordnete <complexType>-Elemente von <redefine>-Elementen m\u00FCssen <extension>- oder <restriction>-Nachkommen mit 'base'-Attributen haben, die auf sich selbst verweisen.
- src-redefine.5.b.c = src-redefine.5.b.c: ''{0}'' ist kein g\u00FCltiges untergeordnetes Element der zweiten Generation. Untergeordnete <complexType>-Elemente von <redefine>-Elementen m\u00FCssen <extension>- oder <restriction>-Nachkommen mit ''base''-Attributen haben, die auf sich selbst verweisen.
- src-redefine.5.b.d = src-redefine.5.b.d: ''{0}'' hat kein ''base''-Attribut, das auf das neu definierte Element ''{1}'' verweist. Untergeordnete <complexType>-Elemente von <redefine>-Elementen m\u00FCssen <extension>- oder <restriction>-Nachkommen mit ''base''-Attributen haben, die auf sich selbst verweisen.
- src-redefine.6.1.1 = src-redefine.6.1.1: Wenn ein untergeordnetes Gruppenelement eines <redefine>-Elements eine Gruppe enth\u00E4lt, die auf sich selbst verweist, muss genau 1 vorhanden sein. Hier sind ''{0}'' vorhanden.
- src-redefine.6.1.2 = src-redefine.6.1.2: Bei Gruppe ''{0}'', die eine Referenz zu einer Gruppe enth\u00E4lt, die neu definiert wird, muss ''minOccurs'' = ''maxOccurs'' = 1 gelten.
- src-redefine.6.2.1 = src-redefine.6.2.1: Keine Gruppe im neu definierten Schema hat einen Namen, der ''{0}'' entspricht.
- src-redefine.6.2.2 = src-redefine.6.2.2: Gruppe ''{0}'' schr\u00E4nkt die Gruppe, die neu definiert wird, nicht ordnungsgem\u00E4\u00DF ein. Verletzter Constraint: ''{1}''.
- src-redefine.7.1 = src-redefine.7.1: Wenn ein untergeordnetes attributeGroup-Element eines <redefine>-Elements eine attributeGroup enth\u00E4lt, die auf sich selbst verweist, muss genau 1 vorhanden sein. Hier sind {0} vorhanden.
- src-redefine.7.2.1 = src-redefine.7.2.1: Keine attributeGroup im neu definierten Schema hat einen Namen, der ''{0}'' entspricht.
- src-redefine.7.2.2 = src-redefine.7.2.2: attributeGroup ''{0}'' schr\u00E4nkt die attributeGroup, die neu definiert wird, nicht ordnungsgem\u00E4\u00DF ein. Verletzter Constraint: ''{1}''.
- src-resolve = src-resolve: Name ''{0}'' kann nicht als ''{1}''-Komponente aufgel\u00F6st werden.
- src-resolve.4.1 = src-resolve.4.1: Fehler beim Aufl\u00F6sen von Komponente ''{2}''. Es wurde ermittelt, dass ''{2}'' keinen Namespace hat, aber Komponenten ohne Ziel-Namespace k\u00F6nnen nicht aus Schemadokument ''{0}'' referenziert werden. Wenn ''{2}'' einen Namespace haben soll, muss m\u00F6glicherweise ein Pr\u00E4fix angegeben werden. Wenn ''{2}'' keinen Namespace haben soll, muss ein ''import'' ohne ''namespace''-Attribut zu ''{0}'' hinzugef\u00FCgt werden.
- src-resolve.4.2 = src-resolve.4.2: Fehler beim Aufl\u00F6sen von Komponente ''{2}''. Es wurde ermittelt, dass ''{2}'' in Namespace ''{1}'' vorhanden ist, aber Komponenten aus diesem Namespace k\u00F6nnen nicht aus Schemadokument ''{0}'' referenziert werden. Wenn dies der falsche Namespace ist, muss m\u00F6glicherweise das Pr\u00E4fix von ''{2}'' ge\u00E4ndert werden. Wenn dies der richtige Namespace ist, muss ein entsprechendes ''import''-Tag zu ''{0}'' hinzugef\u00FCgt werden.
- src-simple-type.2.a = src-simple-type.2.a: Es wurde ein <restriction>-Element gefunden, das sowohl ein 'base'-[Attribut] als auch ein <simpleType>-Element in seinen [untergeordneten Elementen] enth\u00E4lt. Nur eines davon ist zul\u00E4ssig.
- src-simple-type.2.b = src-simple-type.2.b: Es wurde ein <restriction>-Element gefunden, das weder ein 'base'-[Attribut] noch ein <simpleType>-Element in seinen [untergeordneten Elementen] enth\u00E4lt. Eines davon ist erforderlich.
- src-simple-type.3.a = src-simple-type.3.a: Es wurde ein <list>-Element gefunden, das sowohl ein 'itemType'-[Attribut] als auch ein <simpleType>-Element in seinen [untergeordneten Elementen] enth\u00E4lt. Nur eines davon ist zul\u00E4ssig.
- src-simple-type.3.b = src-simple-type.3.b: Es wurde ein <list>-Element gefunden, das weder ein 'itemType'-[Attribut] noch ein <simpleType>-Element in seinen [untergeordneten Elementen] enth\u00E4lt. Eines davon ist erforderlich.
- src-single-facet-value = src-single-facet-value: Facet ''{0}'' ist mehrmals definiert.
- src-union-memberTypes-or-simpleTypes = src-union-memberTypes-or-simpleTypes: Ein <union>-Element muss entweder ein nicht leeres memberTypes-[Attribut] oder mindestens ein <simpleType>-Element in seinen [untergeordneten Elementen] enthalten.
-
-#constraint valid (3.X.6)
-
- ag-props-correct.2 = ag-props-correct.2: Fehler bei Attributgruppe ''{0}''. Es wurden doppelte Attributverwendungen mit demselben Namen und Ziel-Namespace angegeben. Name der doppelten Attributverwendung lautet ''{1}''.
- ag-props-correct.3 = ag-props-correct.3: Fehler bei Attributgruppe ''{0}''. Zwei Attributdeklarationen (''{1}'' und ''{2}'') haben Typen, die aus ID abgeleitet wurden.
- a-props-correct.2 = a-props-correct.2: Ung\u00FCltiger Werte-Constraint-Wert ''{1}'' in Attribut ''{0}''.
- a-props-correct.3 = a-props-correct.3: Bei Attribut ''{0}'' kann ''fixed'' oder ''default'' nicht verwendet werden, da die '{'type definition'}' des Attributs ''ID'' ist oder aus ID abgeleitet wurde.
- au-props-correct.2 = au-props-correct.2: In der Attributdeklaration von ''{0}'' wurde der feste Wert ''{1}'' angegeben. Wenn also die Attributverwendung, die auf ''{0}'' verweist, auch einen '{'value constraint'}' hat, muss sie fest sein, und der Wert muss ''{1}'' lauten.
- cos-all-limited.1.2 = cos-all-limited.1.2: Eine 'all'-Modellgruppe muss in einem Partikel mit '{'min occurs'}' = '{'max occurs'}' = 1 vorkommen, und dieses Partikel muss zu einem Paar geh\u00F6ren, das den '{'content type'}' einer Complex Type-Definition darstellt.
- cos-all-limited.2 = cos-all-limited.2: '{'max occurs'}' eines Elements in einer ''all''-Modellgruppe muss 0 oder 1 sein. Der Wert ''{0}'' f\u00FCr Element ''{1}'' ist ung\u00FCltig.
- cos-applicable-facets = cos-applicable-facets: Facet ''{0}'' ist nicht zul\u00E4ssig f\u00FCr Typ {1}.
- cos-ct-extends.1.1 = cos-ct-extends.1.1: Typ ''{0}'' wurde durch die Erweiterung von Typ ''{1}'' abgeleitet. Das Attribut ''final'' von ''{1}'' l\u00E4sst die Ableitung durch Erweiterung aber nicht zu.
- cos-ct-extends.1.4.3.2.2.1.a = cos-ct-extends.1.4.3.2.2.1.a: Der Contenttyp eines abgeleiteten Typs und der seiner Basis m\u00FCssen beide ''mixed'' oder ''element-only'' sein. Typ ''{0}'' ist ''element only'', aber sein Basistyp nicht.
- cos-ct-extends.1.4.3.2.2.1.b = cos-ct-extends.1.4.3.2.2.1.b: Der Contenttyp eines abgeleiteten Typs und der seiner Basis m\u00FCssen beide ''mixed'' oder ''element-only'' sein. Typ ''{0}'' ist ''mixed'', aber sein Basistyp nicht.
- cos-element-consistent = cos-element-consistent: Fehler bei Typ ''{0}''. Mehrere Elemente mit Namen ''{1}'' und unterschiedlichen Typen kommen in der Modellgruppe vor.
- cos-list-of-atomic = cos-list-of-atomic: In der Definition von Listentyp ''{0}'' ist Typ ''{1}'' ein ung\u00FCltiger Listenelementtyp, da er nicht atomar ist (''{1}'' ist entweder ein Listentyp oder ein Vereinigungsmengentyp, der eine Liste enth\u00E4lt).
- cos-nonambig = cos-nonambig: {0} und {1} (oder Elemente aus ihrer Substitutionsgruppe) verletzen ''Unique Particle Attribution''. Bei der Validierung f\u00FCr dieses Schema w\u00FCrde eine Mehrdeutigkeit f\u00FCr diese beiden Partikel erstellt.
- cos-particle-restrict.a = cos-particle-restrict.a: Abgeleitetes Partikel ist leer, und die Basis kann nicht geleert werden.
- cos-particle-restrict.b = cos-particle-restrict.b: Basispartikel ist leer, aber das abgeleitete Partikel ist nicht leer.
- cos-particle-restrict.2 = cos-particle-restrict.2: Unzul\u00E4ssige Partikeleinschr\u00E4nkung: ''{0}''.
- cos-st-restricts.1.1 = cos-st-restricts.1.1: Typ ''{1}'' ist atomar. Daher muss die zugeh\u00F6rige '{'base type definition'}' ''{0}'' eine atomare Simple Type-Definition oder ein integrierter primitiver Datentyp sein.
- cos-st-restricts.2.1 = cos-st-restricts.2.1: In der Definition von Listentyp ''{0}'' ist Typ ''{1}'' ein ung\u00FCltiger Elementtyp, da er entweder ein Listentyp oder ein Vereinigungsmengentyp ist, der eine Liste enth\u00E4lt.
- cos-st-restricts.2.3.1.1 = cos-st-restricts.2.3.1.1: Komponente '{'final'}' der '{'item type definition'}' ''{0}'' enth\u00E4lt ''list''. Dies bedeutet, dass ''{0}'' nicht als Elementtyp f\u00FCr Listentyp ''{1}'' verwendet werden kann.
- cos-st-restricts.3.3.1.1 = cos-st-restricts.3.3.1.1: Komponente '{'final'}' der '{'member type definitions'}' ''{0}'' enth\u00E4lt ''union''. Dies bedeutet, dass ''{0}'' nicht als Mitgliedstyp f\u00FCr Vereinigungsmengentyp ''{1}'' verwendet werden kann.
- cos-valid-default.2.1 = cos-valid-default.2.1: Element ''{0}'' hat einen Werte-Constraint und muss ein Misch- oder ein einfaches Contentmodell haben.
- cos-valid-default.2.2.2 = cos-valid-default.2.2.2: Da Element ''{0}'' einen '{'value constraint'}' hat und seine Typdefinition einen gemischten '{'content type'}' hat, muss das Partikel des '{'content type'}' geleert werden k\u00F6nnen.
- c-props-correct.2 = c-props-correct.2: Kardinalit\u00E4t von Feldern f\u00FCr keyref ''{0}'' und Schl\u00FCssel ''{1}'' muss sich gegenseitig entsprechen.
- ct-props-correct.3 = ct-props-correct.3: Zyklische Definitionen f\u00FCr Complex Type ''{0}'' ermittelt. Dies bedeutet, dass ''{0}'' in der eigenen Typhierarchie enthalten ist. Dies ist ein Fehler.
- ct-props-correct.4 = ct-props-correct.4: Fehler bei Typ ''{0}''. Es wurden doppelte Attributverwendungen mit demselben Namen und Ziel-Namespace angegeben. Name der doppelten Attributverwendung lautet ''{1}''.
- ct-props-correct.5 = ct-props-correct.5: Fehler bei Typ ''{0}''. Zwei Attributdeklarationen (''{1}'' und ''{2}'') haben Typen, die aus ID abgeleitet wurden.
- derivation-ok-restriction.1 = derivation-ok-restriction.1: Typ ''{0}'' wurde durch die Einschr\u00E4nkung von Typ ''{1}'' abgeleitet. ''{1}'' hat aber eine '{'final'}'-Eigenschaft, die die Ableitung durch Einschr\u00E4nkung nicht zul\u00E4sst.
- derivation-ok-restriction.2.1.1 = derivation-ok-restriction.2.1.1: Fehler bei Typ ''{0}''. Attributverwendung ''{1}'' in diesem Typ hat den ''use''-Wert ''{2}'', der nicht mit dem Wert von ''required'' in einer \u00FCbereinstimmenden Attributverwendung im Basistyp konsistent ist.
- derivation-ok-restriction.2.1.2 = derivation-ok-restriction.2.1.2: Fehler bei Typ ''{0}''. Attributverwendung ''{1}'' in diesem Typ hat den Typ ''{2}'', der nicht auf g\u00FCltige Weise von ''{3}'' abgeleitet wurde, dem Typ der \u00FCbereinstimmenden Attributverwendung im Basistyp.
- derivation-ok-restriction.2.1.3.a = derivation-ok-restriction.2.1.3.a: Fehler bei Typ ''{0}''. Attributverwendung ''{1}'' in diesem Typ hat einen effektiven Werte-Constraint, der nicht fest ist, und der effektive Werte-Constraint der \u00FCbereinstimmenden Attributverwendung im Basistyp ist fest.
- derivation-ok-restriction.2.1.3.b = derivation-ok-restriction.2.1.3.b: Fehler bei Typ ''{0}''. Attributverwendung ''{1}'' in diesem Typ hat einen effektiven festen Werte-Constraint mit dem Wert ''{2}''. Dies ist nicht mit dem Wert ''{3}'' f\u00FCr den festen effektiven Werte-Constraint der \u00FCbereinstimmenden Attributverwendung im Basistyp konsistent.
- derivation-ok-restriction.2.2.a = derivation-ok-restriction.2.2.a: Fehler bei Typ ''{0}''. Attributverwendung ''{1}'' in diesem Typ hat keine \u00FCbereinstimmende Attributverwendung in der Basis, und der Basistyp hat kein Platzhalterattribut.
- derivation-ok-restriction.2.2.b = derivation-ok-restriction.2.2.b: Fehler bei Typ ''{0}''. Attributverwendung ''{1}'' in diesem Typ hat keine \u00FCbereinstimmende Attributverwendung in der Basis, und der Platzhalter im Basistyp l\u00E4sst den Namespace ''{2}'' dieser Attributverwendung nicht zu.
- derivation-ok-restriction.3 = derivation-ok-restriction.3: Fehler bei Typ ''{0}''. Bei Attributverwendung ''{1}'' im Basistyp ist REQUIRED ''true'', aber es ist keine \u00FCbereinstimmende Attributverwendung im abgeleiteten Typ vorhanden.
- derivation-ok-restriction.4.1 = derivation-ok-restriction.4.1: Fehler bei Typ ''{0}''. Ableitung hat einen Attributplatzhalter, aber die Basis hat keinen.
- derivation-ok-restriction.4.2 = derivation-ok-restriction.4.2: Fehler bei Typ ''{0}''. Platzhalter in der Ableitung ist keine g\u00FCltige Platzhalter-Teilmenge des Platzhalters in der Basis.
- derivation-ok-restriction.4.3 = derivation-ok-restriction.4.3: Fehler bei Typ ''{0}''. Prozesscontent des Platzhalters in der Ableitung ({1}) ist schw\u00E4cher als der Content in der Basis ({2}).
- derivation-ok-restriction.5.2.2.1 = derivation-ok-restriction.5.2.2.1: Fehler bei Typ ''{0}''. Einfacher Contenttyp dieses Typs ''{1}'' ist keine g\u00FCltige Einschr\u00E4nkung des einfachen Contenttyps der Basis ''{2}''.
- derivation-ok-restriction.5.3.2 = derivation-ok-restriction.5.3.2: Fehler bei Typ ''{0}''. Contenttyp dieses Typs ist leer, aber der Contenttyps der Basis ''{1}'' ist nicht leer oder kann nicht geleert werden.
- derivation-ok-restriction.5.4.1.2 = derivation-ok-restriction.5.4.1.2: Fehler bei Typ ''{0}''. Contenttyp dieses Typs ist ''mixed'', aber der Contenttyps der Basis ''{1}'' nicht.
- derivation-ok-restriction.5.4.2 = derivation-ok-restriction.5.4.2: Fehler bei Typ ''{0}''. Partikel des Typs ist keine g\u00FCltige Einschr\u00E4nkung des Partikels der Basis.
- enumeration-required-notation = enumeration-required-notation: NOTATION-Typ ''{0}'', der von {2} ''{1}'' verwendet wird, muss einen Enumerations-Facet-Wert haben, der die von diesem Typ verwendeten Notationselemente angibt.
- enumeration-valid-restriction = enumeration-valid-restriction: Enumerationswert ''{0}'' ist nicht im Wertebereich des Basistyps {1} vorhanden.
- e-props-correct.2 = e-props-correct.2: Ung\u00FCltiger Werte-Constraint-Wert ''{1}'' in Element ''{0}''.
- e-props-correct.4 = e-props-correct.4: '{'type definition'}' von Element ''{0}'' wurde nicht auf g\u00FCltige Weise von der '{'type definition'}' von substitutionHead ''{1}'' abgeleitet, oder die '{'substitution group exclusions'}'-Eigenschaft von ''{1}'' l\u00E4sst diese Ableitung nicht zu.
- e-props-correct.5 = e-props-correct.5: '{'value constraint'}' darf nicht bei Element ''{0}'' vorhanden sein, da die '{'type definition'}' des Elements oder der '{'content type'}' der '{'type definition'}' ID ist oder von ID abgeleitet wurde.
- e-props-correct.6 = e-props-correct.6: Zyklische Substitutionsgruppe f\u00FCr Element ''{0}'' ermittelt.
- fractionDigits-valid-restriction = fractionDigits-valid-restriction: In der Definition von {2} ist der Wert ''{0}'' f\u00FCr Facet ''fractionDigits'' ung\u00FCltig, da er <= dem Wert f\u00FCr ''fractionDigits'' sein muss, der in einem der Vorg\u00E4ngertypen auf ''{1}'' gesetzt wurde.
- fractionDigits-totalDigits = fractionDigits-totalDigits: In der Definition von {2} ist der Wert ''{0}'' f\u00FCr Facet ''fractionDigits'' ung\u00FCltig, da der Wert <= dem Wert f\u00FCr ''totalDigits'' sein muss, der ''{1}'' ist.
- length-minLength-maxLength.1.1 = length-minLength-maxLength.1.1: Bei Typ {0} gilt es als Fehler, wenn der Wert von length ''{1}'' kleiner als der Wert von minLength ''{2}'' ist.
- length-minLength-maxLength.1.2.a = length-minLength-maxLength.1.2.a: Bei Typ {0} gilt es als Fehler, wenn die Basis kein minLength-Facet hat, wenn die aktuelle Einschr\u00E4nkung das minLength-Facet und die aktuelle Einschr\u00E4nkung oder Basis das length-Facet hat.
- length-minLength-maxLength.1.2.b = length-minLength-maxLength.1.2.b: Bei Typ {0} gilt es als Fehler, wenn die aktuelle minLength ''{1}'' nicht mit der Basis-minLength ''{2}'' identisch ist.
- length-minLength-maxLength.2.1 = length-minLength-maxLength.2.1: Bei Typ {0} gilt es als Fehler, wenn der Wert von length ''{1}'' gr\u00F6\u00DFer als der Wert von maxLength ''{2}'' ist.
- length-minLength-maxLength.2.2.a = length-minLength-maxLength.2.2.a: Bei Typ {0} gilt es als Fehler, wenn die Basis kein maxLength-Facet hat, wenn die aktuelle Einschr\u00E4nkung das maxLength-Facet und die aktuelle Einschr\u00E4nkung oder Basis das length-Facet hat.
- length-minLength-maxLength.2.2.b = length-minLength-maxLength.2.2.b: Bei Typ {0} gilt es als Fehler, wenn die aktuelle maxLength ''{1}'' nicht mit der Basis-maxLength ''{2}'' identisch ist.
- length-valid-restriction = length-valid-restriction: Fehler bei Typ ''{2}''. Der Wert von length = ''{0}'' muss mit dem Wert des Basistyps ''{1}'' identisch sein.
- maxExclusive-valid-restriction.1 = maxExclusive-valid-restriction.1: Fehler bei Typ ''{2}''. maxExclusive-Wert =''{0}'' muss <= maxExclusive des Basistyps ''{1}'' sein.
- maxExclusive-valid-restriction.2 = maxExclusive-valid-restriction.2: Fehler bei Typ ''{2}''. maxExclusive-Wert =''{0}'' muss <= maxInclusive des Basistyps ''{1}'' sein.
- maxExclusive-valid-restriction.3 = maxExclusive-valid-restriction.3: Fehler bei Typ ''{2}''. maxExclusive-Wert =''{0}'' muss > minInclusive des Basistyps ''{1}'' sein.
- maxExclusive-valid-restriction.4 = maxExclusive-valid-restriction.4: Fehler bei Typ ''{2}''. maxExclusive-Wert =''{0}'' muss > minExclusive des Basistyps ''{1}'' sein.
- maxInclusive-maxExclusive = maxInclusive-maxExclusive: Es gilt als Fehler, wenn sowohl maxInclusive als auch maxExclusive f\u00FCr denselben Datentyp angegeben werden. In {2} gilt: maxInclusive = ''{0}'' und maxExclusive = ''{1}''.
- maxInclusive-valid-restriction.1 = maxInclusive-valid-restriction.1: Fehler bei Typ ''{2}''. maxInclusive-Wert =''{0}'' muss <= maxInclusive des Basistyps ''{1}'' sein.
- maxInclusive-valid-restriction.2 = maxInclusive-valid-restriction.2: Fehler bei Typ ''{2}''. maxInclusive-Wert =''{0}'' muss < maxExclusive des Basistyps ''{1}'' sein.
- maxInclusive-valid-restriction.3 = maxInclusive-valid-restriction.3: Fehler bei Typ ''{2}''. maxInclusive-Wert =''{0}'' muss >= maxInclusive des Basistyps ''{1}'' sein.
- maxInclusive-valid-restriction.4 = maxInclusive-valid-restriction.4: Fehler bei Typ ''{2}''. maxInclusive-Wert =''{0}'' muss > minExclusive des Basistyps ''{1}'' sein.
- maxLength-valid-restriction = maxLength-valid-restriction: In der Definition von {2} muss maxLength-Wert = ''{0}'' <= dem Wert des Basistyps ''{1}'' sein.
- mg-props-correct.2 = mg-props-correct.2: Zyklische Definitionen f\u00FCr Gruppe ''{0}'' ermittelt. Rekursives Folgen der '{'term'}'-Werte der Partikel f\u00FChrt zu einem Partikel, dessen '{'term'}' die Gruppe selbst ist.
- minExclusive-less-than-equal-to-maxExclusive = minExclusive-less-than-equal-to-maxExclusive: In der Definition von {2} muss minExclusive-Wert = ''{0}'' <= maxExclusive-Wert = ''{1}'' sein.
- minExclusive-less-than-maxInclusive = minExclusive-less-than-maxInclusive: In der Definition von {2} muss minExclusive-Wert = ''{0}'' < maxInclusive-Wert = ''{1}'' sein.
- minExclusive-valid-restriction.1 = minExclusive-valid-restriction.1: Fehler bei Typ ''{2}''. minExclusive-Wert =''{0}'' muss >= minExclusive des Basistyps ''{1}'' sein.
- minExclusive-valid-restriction.2 = minExclusive-valid-restriction.2: Fehler bei Typ ''{2}''. minExclusive-Wert =''{0}'' muss <= maxInclusive des Basistyps ''{1}'' sein.
- minExclusive-valid-restriction.3 = minExclusive-valid-restriction.3: Fehler bei Typ ''{2}''. minExclusive-Wert =''{0}'' muss >= minInclusive des Basistyps ''{1}'' sein.
- minExclusive-valid-restriction.4 = minExclusive-valid-restriction.4: Fehler bei Typ ''{2}''. minExclusive-Wert =''{0}'' muss < maxExclusive des Basistyps ''{1}'' sein.
- minInclusive-less-than-equal-to-maxInclusive = minInclusive-less-than-equal-to-maxInclusive: In der Definition von {2} muss minInclusive-Wert = ''{0}'' <= maxInclusive-Wert = ''{1}'' sein.
- minInclusive-less-than-maxExclusive = minInclusive-less-than-maxExclusive: In der Definition von {2} muss minInclusive-Wert = ''{0}'' < maxExclusive-Wert = ''{1}'' sein.
- minInclusive-minExclusive = minInclusive-minExclusive: Es gilt als Fehler, wenn sowohl minInclusive als auch minExclusive f\u00FCr denselben Datentyp angegeben werden. In {2} gilt: minInclusive = ''{0}'' und minExclusive = ''{1}''.
- minInclusive-valid-restriction.1 = minInclusive-valid-restriction.1: Fehler bei Typ ''{2}''. minInclusive-Wert =''{0}'' muss >= minInclusive des Basistyps ''{1}'' sein.
- minInclusive-valid-restriction.2 = minInclusive-valid-restriction.2: Fehler bei Typ ''{2}''. minInclusive-Wert =''{0}'' muss <= maxInclusive des Basistyps ''{1}'' sein.
- minInclusive-valid-restriction.3 = minInclusive-valid-restriction.3: Fehler bei Typ ''{2}''. minInclusive-Wert =''{0}'' muss > minExclusive des Basistyps ''{1}'' sein.
- minInclusive-valid-restriction.4 = minInclusive-valid-restriction.4: Fehler bei Typ ''{2}''. minInclusive-Wert =''{0}'' muss < maxExclusive des Basistyps ''{1}'' sein.
- minLength-less-than-equal-to-maxLength = minLength-less-than-equal-to-maxLength: In der Definition von {2} muss der Wert von minLength = ''{0}'' < dem Wert von maxLength = ''{1}'' sein.
- minLength-valid-restriction = minLength-valid-restriction: In der Definition von {2} muss minLength = ''{0}'' >= dem Wert des Basistyps ''{1}'' sein.
- no-xmlns = no-xmlns: {name} einer Attributdeklaration darf nicht mit 'xmlns' \u00FCbereinstimmen.
- no-xsi = no-xsi: '{'target namespace'}' einer Attributdeklaration darf nicht mit ''{0}'' \u00FCbereinstimmen.
- p-props-correct.2.1 = p-props-correct.2.1: In der Deklaration von ''{0}'' ist der Wert von ''minOccurs'' ''{1}'', er darf aber nicht gr\u00F6\u00DFer als der Wert von ''maxOccurs'' sein, der ''{2}'' lautet.
- rcase-MapAndSum.1 = rcase-MapAndSum.1: Es ist keine vollst\u00E4ndige Funktionszuordnung zwischen den Partikeln vorhanden.
- rcase-MapAndSum.2 = rcase-MapAndSum.2: Vorkommensbereich der Gruppe ({0},{1}) ist keine g\u00FCltige Einschr\u00E4nkung des Vorkommensbereichs der Basisgruppe ({2},{3}).
- rcase-NameAndTypeOK.1 = rcase-NameAndTypeOK.1: Elemente haben Namen und Ziel-Namespaces, die nicht identisch sind: Element ''{0}'' in Namespace ''{1}'' und Element ''{2}'' in Namespace ''{3}''.
- rcase-NameAndTypeOK.2 = rcase-NameAndTypeOK.2: Fehler beim Partikel, dessen '{'term'}' die Elementdeklaration ''{0}'' ist. '{'nillable'}' ist bei der Elementdeklaration ''true'', aber das entsprechende Partikel im Basistyp hat eine Elementdeklaration, bei der '{'nillable'}' ''false'' ist.
- rcase-NameAndTypeOK.3 = rcase-NameAndTypeOK.3: Fehler beim Partikel, dessen '{'term'}' die Elementdeklaration ''{0}'' ist. Der Vorkommensbereich ({1},{2}) ist keine g\u00FCltige Einschr\u00E4nkung des Bereichs ({3},{4}) des entsprechenden Partikels im Basistyp.
- rcase-NameAndTypeOK.4.a = rcase-NameAndTypeOK.4.a: Element ''{0}'' ist nicht fest, aber das entsprechende Element im Basistyp ist fest mit Wert ''{1}''.
- rcase-NameAndTypeOK.4.b = rcase-NameAndTypeOK.4.b: Element ''{0}'' ist fest mit dem Wert ''{1}'', aber das entsprechende Element im Basistyp ist fest mit Wert ''{2}''.
- rcase-NameAndTypeOK.5 = rcase-NameAndTypeOK.5: Identity Constraints f\u00FCr Element ''{0}'' sind keine Teilmenge der Constraints in der Basis.
- rcase-NameAndTypeOK.6 = rcase-NameAndTypeOK.6: Die unzul\u00E4ssigen Substitutionen f\u00FCr Element ''{0}'' sind keine Obermenge der Substitutionen in der Basis.
- rcase-NameAndTypeOK.7 = rcase-NameAndTypeOK.7: Typ des Elements ''{0}'' ''{1}'' wurde nicht vom Typ des Basiselements ''{2}'' abgeleitet.
- rcase-NSCompat.1 = rcase-NSCompat.1: Element ''{0}'' hat den Namespace ''{1}''. Dies wird vom Platzhalter in der Basis nicht zugelassen.
- rcase-NSCompat.2 = rcase-NSCompat.2: Fehler beim Partikel, dessen '{'term'}' die Elementdeklaration ''{0}'' ist. Der Vorkommensbereich ({1},{2}) ist keine g\u00FCltige Einschr\u00E4nkung des Bereichs ({3},{4}) des entsprechenden Partikels im Basistyp.
- rcase-NSRecurseCheckCardinality.1 = rcase-NSRecurseCheckCardinality.1: Es ist keine vollst\u00E4ndige Funktionszuordnung zwischen den Partikeln vorhanden.
- rcase-NSRecurseCheckCardinality.2 = rcase-NSRecurseCheckCardinality.2: Vorkommensbereich der Gruppe ({0},{1}) ist keine g\u00FCltige Einschr\u00E4nkung des Bereichs des Basisplatzhalters ({2},{3}).
- rcase-NSSubset.1 = rcase-NSSubset.1: Platzhalter ist keine Teilmenge des entsprechenden Platzhalters in der Basis.
- rcase-NSSubset.2 = rcase-NSSubset.2: Vorkommensbereich des Platzhalters ({0},{1}) ist keine g\u00FCltige Einschr\u00E4nkung des Bereichs in der Basis ({2},{3}).
- rcase-NSSubset.3 = rcase-NSSubset.3: Prozesscontent des Platzhalters (''{0}'') ist schw\u00E4cher als der in der Basis ''{1}''.
- rcase-Recurse.1 = rcase-Recurse.1: Vorkommensbereich der Gruppe ({0},{1}) ist keine g\u00FCltige Einschr\u00E4nkung des Vorkommensbereichs der Basisgruppe ({2},{3}).
- rcase-Recurse.2 = rcase-Recurse.2: Es ist keine vollst\u00E4ndige Funktionszuordnung zwischen den Partikeln vorhanden.
- rcase-RecurseLax.1 = rcase-RecurseLax.1: Vorkommensbereich der Gruppe ({0},{1}) ist keine g\u00FCltige Einschr\u00E4nkung des Vorkommensbereichs der Basisgruppe ({2},{3}).
- rcase-RecurseLax.2 = rcase-RecurseLax.2: Es ist keine vollst\u00E4ndige Funktionszuordnung zwischen den Partikeln vorhanden.
- rcase-RecurseUnordered.1 = rcase-RecurseUnordered.1: Vorkommensbereich der Gruppe ({0},{1}) ist keine g\u00FCltige Einschr\u00E4nkung des Vorkommensbereichs der Basisgruppe ({2},{3}).
- rcase-RecurseUnordered.2 = rcase-RecurseUnordered.2: Es ist keine vollst\u00E4ndige Funktionszuordnung zwischen den Partikeln vorhanden.
-# We're using sch-props-correct.2 instead of the old src-redefine.1
-# src-redefine.1 = src-redefine.1: The component ''{0}'' is begin redefined, but its corresponding component isn't in the schema document being redefined (with namespace ''{2}''), but in a different document, with namespace ''{1}''.
- sch-props-correct.2 = sch-props-correct.2: Ein Schema kann nicht zwei globale Komponenten mit demselben Namen enthalten. Dieses Schema enth\u00E4lt zwei Vorkommen von ''{0}''.
- st-props-correct.2 = st-props-correct.2: Zyklische Definitionen wurden f\u00FCr Simple Type ''{0}'' ermittelt. Dies bedeutet, dass ''{0}'' in der eigenen Typhierarchie enthalten ist. Dies ist ein Fehler.
- st-props-correct.3 = st-props-correct.3: Fehler bei Typ ''{0}''. Der Wert von '{'final'}' der '{'base type definition'}' ''{1}'' l\u00E4sst keine Ableitung durch Einschr\u00E4nkung zu.
- totalDigits-valid-restriction = totalDigits-valid-restriction: In der Definition von {2} ist der Wert ''{0}'' f\u00FCr Facet ''totalDigits'' ung\u00FCltig, da er <= dem Wert f\u00FCr ''totalDigits'' sein muss, der in einem der Vorg\u00E4ngertypen auf ''{1}'' gesetzt wurde.
- whiteSpace-valid-restriction.1 = whiteSpace-valid-restriction.1: In der Definition von {0} ist der Wert ''{1}'' f\u00FCr Facet ''whitespace'' ung\u00FCltig, da der Wert f\u00FCr ''whitespace'' in einem der Vorg\u00E4ngertypen auf ''collapse'' gesetzt wurde.
- whiteSpace-valid-restriction.2 = whiteSpace-valid-restriction.2: In der Definition von {0} ist der Wert ''preserve'' f\u00FCr Facet ''whitespace'' ung\u00FCltig, da der Wert f\u00FCr ''whitespace'' in einem der Vorg\u00E4ngertypen auf ''replace'' gesetzt wurde.
-
-#schema for Schemas
-
- s4s-att-invalid-value = s4s-att-invalid-value: Ung\u00FCltiger Attributwert f\u00FCr ''{1}'' in Element ''{0}''. Aufgezeichneter Grund: {2}
- s4s-att-must-appear = s4s-att-must-appear: Attribut ''{1}'' muss in Element ''{0}'' vorkommen.
- s4s-att-not-allowed = s4s-att-not-allowed: Attribut ''{1}'' darf nicht in Element ''{0}'' vorkommen.
- s4s-elt-invalid = s4s-elt-invalid: Element ''{0}'' ist kein g\u00FCltiges Element in einem Schemadokument.
- s4s-elt-must-match.1 = s4s-elt-must-match.1: Content von ''{0}'' muss {1} entsprechen. Beim Start bei {2} ist ein Problem aufgetreten.
- s4s-elt-must-match.2 = s4s-elt-must-match.2: Content von ''{0}'' muss {1} entsprechen. Nicht gen\u00FCgend Elemente gefunden.
- # the "invalid-content" messages provide less information than the "must-match" counterparts above. They're used for complex types when providing a "match" would be an information dump
- s4s-elt-invalid-content.1 = s4s-elt-invalid-content.1: Content von ''{0}'' ist ung\u00FCltig. Element ''{1}'' ist ung\u00FCltig, nicht an der erwarteten Stelle oder kommt zu oft vor.
- s4s-elt-invalid-content.2 = s4s-elt-invalid-content.2: Content von ''{0}'' ist ung\u00FCltig. Element ''{1}'' darf nicht leer sein.
- s4s-elt-invalid-content.3 = s4s-elt-invalid-content.3: Elemente mit dem Typ ''{0}'' k\u00F6nnen nicht nach Deklarationen als untergeordnete Elemente eines <schema>-Elements vorkommen.
- s4s-elt-schema-ns = s4s-elt-schema-ns: Namespace des Elements ''{0}'' muss aus dem Schema-Namespace ''http://www.w3.org/2001/XMLSchema'' stammen.
- s4s-elt-character = s4s-elt-character: In anderen Schemaelementen als ''xs:appinfo'' und ''xs:documentation'' sind nur Leerstellen zul\u00E4ssig. ''{0}'' gefunden.
-
-# codes not defined by the spec
-
- c-fields-xpaths = c-fields-xpaths: Feldwert = ''{0}'' ist ung\u00FCltig.
- c-general-xpath = c-general-xpath: Ausdruck ''{0}'' ist ung\u00FCltig in Bezug auf die vom XML-Schema unterst\u00FCtzte XPath-Teilmenge.
- c-general-xpath-ns = c-general-xpath-ns: Namespace-Pr\u00E4fix in XPath-Ausdruck ''{0}'' war an einen Namespace gebunden.
- c-selector-xpath = c-selector-xpath: Selektor-Wert = ''{0}'' ist ung\u00FCltig. Selektor-XPaths k\u00F6nnen keine Attribute enthalten.
- EmptyTargetNamespace = EmptyTargetNamespace: In Schemadokument ''{0}'' kann der Wert des ''targetNamespace''-Attributs keine leere Zeichenfolge sein.
- FacetValueFromBase = FacetValueFromBase: In der Deklaration von Typ ''{0}'' muss der Wert ''{1}'' von Facet ''{2}'' aus dem Wertebereich des Basistyps ''{3}'' stammen.
- FixedFacetValue = FixedFacetValue: In der Definition von {3} ist der Wert ''{1}'' f\u00FCr Facet ''{0}'' ung\u00FCltig, da der Wert f\u00FCr ''{0}'' in einem der Vorg\u00E4ngertypen auf ''{2}'' gesetzt wurde und ''{''fixed'}''' = true ist.
- InvalidRegex = InvalidRegex: Musterwert ''{0}'' ist kein g\u00FCltiger regul\u00E4rer Ausdruck. Der gemeldete Fehler war: ''{1}'' bei Spalte ''{2}''.
- MaxOccurLimit = Aktuelle Konfiguration des Parsers l\u00E4sst nicht zu, dass ein maxOccurs-Attributwert auf einen h\u00F6heren Wert als {0} gesetzt wird.
- PublicSystemOnNotation = PublicSystemOnNotation: Mindestens eines der Elemente 'public' und 'system' muss im Element 'notation' vorkommen.
- SchemaLocation = SchemaLocation: schemaLocation-Wert = ''{0}'' muss eine gerade Anzahl an URIs haben.
- TargetNamespace.1 = TargetNamespace.1: Namespace ''{0}'' wird erwartet, aber der Ziel-Namespace des Schemadokuments ist ''{1}''.
- TargetNamespace.2 = TargetNamespace.2: Kein Namespace wird erwartet, aber das Schemadokument hat den Ziel-Namespace ''{1}''.
- UndeclaredEntity = UndeclaredEntity: Entity ''{0}'' ist nicht deklariert.
- UndeclaredPrefix = UndeclaredPrefix: ''{0}'' kann nicht als QName aufgel\u00F6st werden: Pr\u00E4fix ''{1}'' ist nicht deklariert.
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_es.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_es.properties
deleted file mode 100644
index 2e22ced..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_es.properties
+++ /dev/null
@@ -1,291 +0,0 @@
-# This file contains error and warning messages related to XML Schema
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
- BadMessageKey = No se ha encontrado el mensaje de error correspondiente a la clave de mensaje.
- FormatFailed = Se ha producido un error interno al formatear el siguiente mensaje:\n
-
-# For internal use
-
- Internal-Error = Error interno: {0}.
- dt-whitespace = El valor de faceta de espacio en blanco no est\u00E1 disponible para simpleType de uni\u00F3n ''{0}''
- GrammarConflict = Una de las gram\u00E1ticas devueltas del pool de gram\u00E1tica del usuario entra en conflicto con otra gram\u00E1tica.
-
-# Identity constraints
-
- AbsentKeyValue = Error de restricci\u00F3n de identidad (cvc-identity-constraint.4.2.1): el elemento "{0}" tiene una clave sin valor.
- DuplicateField = Coincidencia duplicada en \u00E1mbito del campo "{0}".
- DuplicateKey = Valor de clave duplicado [{0}] declarado para la restricci\u00F3n de identidad del elemento "{1}".
- DuplicateUnique = Valor \u00FAnico duplicado [{0}] declarado para la restricci\u00F3n de identidad del elemento "{1}".
- FieldMultipleMatch = Error de restricci\u00F3n de identidad: el campo "{0}" coincide con m\u00E1s de un valor en el \u00E1mbito de su selector; los campos deben coincidir con valores \u00FAnicos.
- FixedDiffersFromActual = El contenido de este elemento no es equivalente al valor del atributo "fixed" en la declaraci\u00F3n del elemento del esquema.
- KeyMatchesNillable = Error de restricci\u00F3n de identidad (cvc-identity-constraint.4.2.3): el elemento "{0}" tiene una clave que coincide con un elemento cuyo valor de Permite Nill est\u00E1 definido en true.
- KeyNotEnoughValues = No se han especificado suficientes valores para la restricci\u00F3n de identidad <key name="{1}"> especificada para el elemento "{0}".
- KeyNotFound = No se ha encontrado la clave ''{0}'' con el valor ''{1}'' para la restricci\u00F3n de identidad del elemento ''{2}''.
- KeyRefNotEnoughValues = No se han especificado suficientes valores para la restricci\u00F3n de identidad <keyref name="{1}"> especificada para el elemento "{0}".
- KeyRefOutOfScope = Error de restricci\u00F3n de identidad: la restricci\u00F3n de identidad "{0}" tiene una referencia de clave que hace referencia a una clave o elemento \u00FAnico que se encuentra fuera de \u00E1mbito.
- KeyRefReferNotFound = La declaraci\u00F3n de referencia de clave "{0}" hace referencia a una clave desconocida con el nombre "{1}".
- UniqueNotEnoughValues = No se han especificado suficientes valores para la restricci\u00F3n de identidad <unique> especificada para el elemento "{0}".
- UnknownField = Error de restricci\u00F3n de identidad interno; campo desconocido "{0}".
-
-# Ideally, we should only use the following error keys, not the ones under
-# "Identity constraints". And we should cover all of the following errors.
-
-#validation (3.X.4)
-
- cvc-attribute.3 = cvc-attribute.3: El valor ''{2}'' del atributo ''{1}'' del elemento ''{0}'' no es v\u00E1lido con respecto a su tipo, ''{3}''.
- cvc-attribute.4 = cvc-attribute.4: El valor ''{2}'' del atributo ''{1}'' del elemento ''{0}'' no es v\u00E1lido con respecto a su '{'value constraint'}' fija. El atributo debe tener un valor de ''{3}''.
- cvc-complex-type.2.1 = cvc-complex-type.2.1: El elemento ''{0}'' no debe tener ning\u00FAn car\u00E1cter ni ning\u00FAn elemento de informaci\u00F3n de elemento [secundarios], porque el tipo de contenido de tipo est\u00E1 vac\u00EDo.
- cvc-complex-type.2.2 = cvc-complex-type.2.2: El elemento ''{0}'' no debe tener ning\u00FAn elemento [secundarios] y el valor debe ser v\u00E1lido.
- cvc-complex-type.2.3 = cvc-complex-type.2.3: El elemento ''{0}'' no debe tener ning\u00FAn car\u00E1cter [secundarios], porque el tipo de contenido del tipo es s\u00F3lo de elemento.
- cvc-complex-type.2.4.a = cvc-complex-type.2.4.a: Se ha encontrado contenido no v\u00E1lido a partir del elemento ''{0}''. Se esperaba uno de ''{1}''.
- cvc-complex-type.2.4.b = cvc-complex-type.2.4.b: El contenido del elemento ''{0}'' no est\u00E1 completo. Se esperaba uno de ''{1}''.
- cvc-complex-type.2.4.c = cvc-complex-type.2.4.c: El comod\u00EDn coincidente es estricto, pero no se ha encontrado ninguna declaraci\u00F3n para el elemento ''{0}''.
- cvc-complex-type.2.4.d = cvc-complex-type.2.4.d: Se ha encontrado contenido no v\u00E1lido a partir del elemento ''{0}''. No se espera ning\u00FAn elemento secundario en este punto.
- cvc-complex-type.2.4.e = cvc-complex-type.2.4.d: Se ha encontrado contenido no v\u00E1lido a partir del elemento ''{0}''. No se espera ning\u00FAn elemento secundario ''{1}'' en este punto.
- cvc-complex-type.3.1 = cvc-complex-type.3.1: El valor ''{2}'' del atributo ''{1}'' del elemento ''{0}'' no es v\u00E1lido con respecto al uso de atributo correspondiente. El atributo ''{1}'' tiene un valor fijo de ''{3}''.
- cvc-complex-type.3.2.1 = cvc-complex-type.3.2.1: El elemento ''{0}'' no tiene un comod\u00EDn de atributo para el atributo ''{1}''.
- cvc-complex-type.3.2.2 = cvc-complex-type.3.2.2: No est\u00E1 permitido que el atributo ''{1}'' aparezca en el elemento ''{0}''.
- cvc-complex-type.4 = cvc-complex-type.4: El atributo ''{1}'' debe aparecer en el elemento ''{0}''.
- cvc-complex-type.5.1 = cvc-complex-type.5.1: En el elemento ''{0}'', el atributo ''{1}'' es un identificador de comod\u00EDn, pero ya existe un identificador de comod\u00EDn ''{2}''. S\u00F3lo puede existir uno.
- cvc-complex-type.5.2 = cvc-complex-type.5.2: En el elemento ''{0}'', el atributo ''{1}'' es un identificador de comod\u00EDn, pero ya existe un atributo ''{2}'' derivado del identificador entre los '{'attribute uses'}'.
- cvc-datatype-valid.1.2.1 = cvc-datatype-valid.1.2.1: ''{0}'' no es un valor v\u00E1lido para ''{1}''.
- cvc-datatype-valid.1.2.2 = cvc-datatype-valid.1.2.2: ''{0}'' no es un valor v\u00E1lido de tipo de lista ''{1}''.
- cvc-datatype-valid.1.2.3 = cvc-datatype-valid.1.2.3: ''{0}'' no es un valor v\u00E1lido de tipo de uni\u00F3n ''{1}''.
- cvc-elt.1 = cvc-elt.1: No se ha encontrado la declaraci\u00F3n del elemento ''{0}''.
- cvc-elt.2 = cvc-elt.2: El valor de '{'abstract'}' en la declaraci\u00F3n de elemento para ''{0}'' debe ser false.
- cvc-elt.3.1 = cvc-elt.3.1: El atributo ''{1}'' no debe aparecer en el elemento ''{0}'', porque la propiedad '{'nillable'}' de ''{0}'' tiene el valor false.
- cvc-elt.3.2.1 = cvc-elt.3.2.1: El elemento ''{0}'' no debe tener ning\u00FAn car\u00E1cter ni informaci\u00F3n de elemento [secundarios], porque se ha especificado ''{1}''.
- cvc-elt.3.2.2 = cvc-elt.3.2.2: No debe haber ning\u00FAn valor fijo de '{'value constraint'}' para el elemento ''{0}'', porque se ha especificado ''{1}''.
- cvc-elt.4.1 = cvc-elt.4.1: El valor ''{2}'' del atributo ''{1}'' del elemento ''{0}'' no es un QName v\u00E1lido.
- cvc-elt.4.2 = cvc-elt.4.2: No se puede resolver ''{1}'' en una definici\u00F3n de tipo para el elemento ''{0}''.
- cvc-elt.4.3 = cvc-elt.4.3: El tipo ''{1}'' no se ha derivado de forma v\u00E1lida de la definici\u00F3n de tipo ''{2}'' del elemento ''{0}''.
- cvc-elt.5.1.1 = cvc-elt.5.1.1: '{'value constraint'}' ''{2}'' del elemento ''{0}'' no es un valor por defecto v\u00E1lido para el tipo ''{1}''.
- cvc-elt.5.2.2.1 = cvc-elt.5.2.2.1: El elemento ''{0}'' no debe tener ning\u00FAn elemento de informaci\u00F3n de elemento [secundarios].
- cvc-elt.5.2.2.2.1 = cvc-elt.5.2.2.2.1: El valor ''{1}'' del elemento ''{0}'' no coincide con el valor de '{'value constraint'}' fijo ''{2}''.
- cvc-elt.5.2.2.2.2 = cvc-elt.5.2.2.2.2: El valor ''{1}'' del elemento ''{0}'' no coincide con el valor de '{'value constraint'}' ''{2}''.
- cvc-enumeration-valid = cvc-enumeration-valid: El valor ''{0}'' no es de faceta v\u00E1lida con respecto a la enumeraci\u00F3n ''{1}''. Debe ser un valor de la enumeraci\u00F3n.
- cvc-fractionDigits-valid = cvc-fractionDigits-valid: El valor ''{0}'' tiene {1} d\u00EDgitos fraccionarios, pero el n\u00FAmero de d\u00EDgitos fraccionarios se ha limitado a {2}.
- cvc-id.1 = cvc-id.1: No hay ning\u00FAn enlace de identificador/IDREF para IDREF ''{0}''.
- cvc-id.2 = cvc-id.2: Hay varias incidencias del valor de identificador ''{0}''.
- cvc-id.3 = cvc-id.3: Un campo de restricci\u00F3n de identidad ''{0}'' coincide con el elemento ''{1}'', pero el elemento no es de tipo simple.
- cvc-length-valid = cvc-length-valid: El valor ''{0}'' con la longitud = ''{1}'' no es de faceta v\u00E1lida con respecto a la longitud ''{2}'' para el tipo ''{3}''.
- cvc-maxExclusive-valid = cvc-maxExclusive-valid: El valor ''{0}'' no es de faceta v\u00E1lida con respecto a maxExclusive ''{1}'' para el tipo ''{2}''.
- cvc-maxInclusive-valid = cvc-maxInclusive-valid: El valor ''{0}'' no es de faceta v\u00E1lida con respecto a maxInclusive ''{1}'' para el tipo ''{2}''.
- cvc-maxLength-valid = cvc-maxLength-valid: El valor ''{0}'' con la longitud = ''{1}'' no es de faceta v\u00E1lida con respecto a maxLength ''{2}'' para el tipo ''{3}''.
- cvc-minExclusive-valid = cvc-minExclusive-valid: El valor ''{0}'' no es de faceta v\u00E1lida con respecto a minExclusive ''{1}''para el tipo ''{2}''.
- cvc-minInclusive-valid = cvc-minInclusive-valid: El valor ''{0}'' no es de faceta v\u00E1lida con respecto a minInclusive ''{1}'' para el tipo ''{2}''.
- cvc-minLength-valid = cvc-minLength-valid: El valor ''{0}'' con la longitud = ''{1}'' no es de faceta v\u00E1lida con respecto a minLength ''{2}'' para el tipo ''{3}''.
- cvc-pattern-valid = cvc-pattern-valid: El valor ''{0}'' no es de faceta v\u00E1lida con respecto al patr\u00F3n ''{1}'' para el tipo ''{2}''.
- cvc-totalDigits-valid = cvc-totalDigits-valid: El valor''{0}'' tiene {1} d\u00EDgitos totales, pero el n\u00FAmero de d\u00EDgitos totales se ha limitado a {2}.
- cvc-type.2 = cvc-type.2: La definici\u00F3n de tipo no puede ser abstracta para el elemento {0}.
- cvc-type.3.1.1 = cvc-type.3.1.1: El elemento ''{0}'' es un tipo simple, por lo que no puede tener atributos, excepto aquellos cuyo espacio de nombres sea ''http://www.w3.org/2001/XMLSchema-instance'' y cuyo [nombre local] sea de tipo ''type'', ''nil'', ''schemaLocation'' o ''noNamespaceSchemaLocation''. Sin embargo, se ha encontrado el atributo ''{1}''.
- cvc-type.3.1.2 = cvc-type.3.1.2: El elemento''{0}'' es un tipo simple, por lo que no debe tener ning\u00FAn elemento de informaci\u00F3n de elemento [secundarios].
- cvc-type.3.1.3 = cvc-type.3.1.3: El valor ''{1}'' del elemento ''{0}'' no es v\u00E1lido.
-
-#schema valid (3.X.3)
-
- schema_reference.access = schema_reference: fallo al leer el documento de esquema ''{0}'' porque no se permite el acceso ''{1}'' debido a una restricci\u00F3n definida por la propiedad accessExternalSchema.
- schema_reference.4 = schema_reference.4: Fallo al leer el documento de esquema ''{0}'', porque 1) no se ha encontrado el documento; 2) no se ha podido leer el documento; 3) el elemento ra\u00EDz del documento no es <xsd:schema>.
- src-annotation = src-annotation: Los elementos de <annotation> s\u00F3lo pueden contener elementos de <appinfo> y <documentation>, pero se ha encontrado ''{0}''.
- src-attribute.1 = src-attribute.1: Las propiedades ''default'' y ''fixed'' no pueden estar presentes de forma simult\u00E1nea en la declaraci\u00F3n de atributo ''{0}''. Utilice s\u00F3lo una de ellas.
- src-attribute.2 = src-attribute.2: : La propiedad ''default'' est\u00E1 presente en el atributo ''{0}'', por lo que el valor de ''use'' debe ser ''optional''.
- src-attribute.3.1 = src-attribute.3.1: 'ref' o 'name' deben estar presentes en una declaraci\u00F3n de atributo local.
- src-attribute.3.2 = src-attribute.3.2: El contenido debe coincidir con (annotation?) para la referencia de atributo ''{0}''.
- src-attribute.4 = src-attribute.4: El atributo ''{0}'' tiene un atributo ''type'' y un secundario an\u00F3nimo ''simpleType''. S\u00F3lo se permite uno de estos como atributo.
- src-attribute_group.2 = src-attribute_group.2: La intersecci\u00F3n de comodines no se puede expresar para el grupo de atributos ''{0}''.
- src-attribute_group.3 = src-attribute_group.3: Se han detectado definiciones circulares para el grupo de atributos ''{0}''. El seguimiento de forma recurrente de las referencias de grupo de atributos vuelve de forma eventual a s\u00ED mismo.
- src-ct.1 = src-ct.1: Error de representaci\u00F3n de definici\u00F3n de tipo complejo para el tipo ''{0}''. Si se utiliza <complexContent>, el tipo de base debe ser complexType. ''{1}'' es simpleType.
- src-ct.2.1 = src-ct.2.1: Error de representaci\u00F3n de definici\u00F3n de tipo complejo para el tipo ''{0}''. Si se utiliza <simpleContent>, el tipo de base debe ser complexType cuyo tipo de contenido sea simple o, s\u00F3lo en caso de que se especifique una restricci\u00F3n, un tipo complejo con contenido mixto y part\u00EDcula que se pueda vaciar o, s\u00F3lo si se especifica la extensi\u00F3n, un tipo simple. ''{1}'' no cumple ninguna de estas condiciones.
- src-ct.2.2 = src-ct.2.2: Error de representaci\u00F3n de definici\u00F3n de tipo complejo para el tipo ''{0}''. Cuando complexType con simpleContent restringe un valor de complexType con contenido mixto y part\u00EDcula que se pueda vaciar, debe haber un valor <simpleType> entre los secundarios de <restriction>.
- src-ct.4 = src-ct.4: Error de representaci\u00F3n de definici\u00F3n de tipo complejo para el tipo ''{0}''. La intersecci\u00F3n de los comodines no se puede expresar.
- src-ct.5 = src-ct.5: Error de representaci\u00F3n de definici\u00F3n de tipo complejo para el tipo ''{0}''. La uni\u00F3n de los comodines no se puede expresar.
- src-element.1 = src-element.1: Las propiedades ''default'' y ''fixed'' no pueden estar presentes de forma simult\u00E1nea en la declaraci\u00F3n de elemento ''{0}''. Utilice s\u00F3lo una de ellas.
- src-element.2.1 = src-element.2.1: : 'ref' o 'name' deben estar presentes en una declaraci\u00F3n de elemento local.
- src-element.2.2 = src-element.2.2: Como ''{0}'' contiene el atributo ''ref'', su contenido debe coincidir con (annotation?). Sin embargo, se ha encontrado ''{1}''.
- src-element.3 = src-element.3: El elemento ''{0}'' tiene un atributo ''type'' y un secundario ''anonymous type''. Solo se permite uno de estos para un elemento.
- src-import.1.1 = src-import.1.1: El atributo de espacio de nombres ''{0}'' de un elemento de informaci\u00F3n de elemento <import> no debe ser igual que el valor de targetNamespace del esquema en el que existe.
- src-import.1.2 = src-import.1.2: Si el atributo de espacio de nombres no est\u00E1 presente en un elemento de informaci\u00F3n de elemento <import>, el esquema delimitador debe tener un targetNamespace.
- src-import.2 = src-import.2: El espacio de nombres del elemento ra\u00EDz del documento ''{0}'' debe llamarse ''http://www.w3.org/2001/XMLSchema'' y el nombre local ''schema''.
- src-import.3.1 = src-import.3.1: El atributo de espacio de nombres, ''{0}'', de un elemento de informaci\u00F3n de elemento <import> debe ser id\u00E9ntico al atributo targetNamespace, ''{1}'', del documento importado.
- src-import.3.2 = src-import.3.2: Se ha encontrado un elemento de informaci\u00F3n de elemento <import> que no ten\u00EDa ning\u00FAn atributo de espacio de nombres, por lo que el documento importado no puede tener un atributo targetNamespace. Sin embargo, se ha encontrado el valor de targetNamespace ''{1}'' en el documento importado.
- src-include.1 = src-include.1: El espacio de nombres del elemento ra\u00EDz del documento ''{0}'' debe llamarse ''http://www.w3.org/2001/XMLSchema'' y el nombre local ''schema''.
- src-include.2.1 = src-include.2.1: El valor de targetNamespace del esquema de referencia, actualmente ''{1}'', debe ser igual al del esquema incluido, que actualmente es ''{0}''.
- src-redefine.2 = src-redefine.2: El espacio de nombres del elemento ra\u00EDz del documento ''{0}'' debe llamarse ''http://www.w3.org/2001/XMLSchema'' y el nombre local ''schema''.
- src-redefine.3.1 = src-redefine.3.1: El valor de targetNamespace del esquema de referencia, que actualmente es ''{1}'', debe ser igual al del esquema redefinido, que actualmente es ''{0}''.
- src-redefine.5.a.a = src-redefine.5.a.a: No se ha encontrado ning\u00FAn secundario sin anotaci\u00F3n de <simpleType>. Los secundarios de <simpleType> de los elementos <redefine> deben tener descendientes de <restriction>, con atributos de 'base' que hagan referencia a s\u00ED mismos.
- src-redefine.5.a.b = src-redefine.5.a.b: ''{0}'' no es un elemento secundario v\u00E1lido. Los secundarios de <simpleType> de los elementos <redefine> deben tener descendientes de <restriction>, con atributos de ''base'' que hagan referencia a s\u00ED mismos.
- src-redefine.5.a.c = src-redefine.5.a.c: ''{0}'' no tiene un atributo de ''base'' que hace referencia al elemento redefinido, ''{1}''. Los secundarios de <simpleType> de los elementos <redefine> deben tener descendientes de <restriction>, con atributos de ''base'' que hagan referencia a s\u00ED mismos.
- src-redefine.5.b.a = src-redefine.5.b.a: No se ha encontrado ning\u00FAn secundario sin anotaci\u00F3n de <complexType>. Los secundarios de <complexType> de los elementos <redefine> deben tener descendientes de <extension> o <restriction>, con atributos de 'base' que hagan referencia a s\u00ED mismos.
- src-redefine.5.b.b = src-redefine.5.b.b:No se ha encontrado ning\u00FAn terciario sin anotaci\u00F3n de <complexType>. Los secundarios de <complexType> de los elementos <redefine> deben tener descendientes de <extension> o <restriction>, con atributos de 'base' que hagan referencia a s\u00ED mismos.
- src-redefine.5.b.c = src-redefine.5.b.c: ''{0}'' no es un elemento terciario v\u00E1lido. Los secundarios de <complexType> de los elementos <redefine> deben tener descendientes de <extension> o <restriction>, con atributos de ''base'' que hagan referencia a s\u00ED mismos.
- src-redefine.5.b.d = src-redefine.5.b.d: ''{0}'' no tiene un atributo de ''base'' que hace referencia al elemento redefinido, ''{1}''. Los secundarios de <complexType> de los elementos <redefine> deben tener descendientes de <extension> o <restriction>, con atributos de ''base'' que hagan referencia a s\u00ED mismos.
- src-redefine.6.1.1 = src-redefine.6.1.1: Si un secundario de grupo de un elemento <redefine> contiene un grupo que hace referencia a s\u00ED mismo, debe tener exactamente 1; \u00E9ste tiene ''{0}''.
- src-redefine.6.1.2 = src-redefine.6.1.2: El grupo ''{0}'', que contiene una referencia a un grupo que se est\u00E1 redefiniendo debe tener un valor de ''minOccurs'' = ''maxOccurs'' = 1.
- src-redefine.6.2.1 = src-redefine.6.2.1: No hay ning\u00FAn grupo en el esquema redefinido con un nombre que coincida con ''{0}''.
- src-redefine.6.2.2 = src-redefine.6.2.2: El grupo ''{0}'' no restringe correctamente al grupo que redefine; se ha violado la restricci\u00F3n: ''{1}''.
- src-redefine.7.1 = src-redefine.7.1: Si un secundario de attributeGroup de un elemento <redefine> contiene un valor de attributeGroup que hace referencia a s\u00ED mismo, debe tener exactamente 1; \u00E9ste tiene {0}.
- src-redefine.7.2.1 = src-redefine.7.2.1: No hay ning\u00FAn valor de attributeGroup en el esquema redefinido con un nombre que coincida con ''{0}''.
- src-redefine.7.2.2 = src-redefine.7.2.2: el valor de attributeGroup ''{0}'' no restringe correctamente el valor de attributeGroup que redefine; se ha violado la restricci\u00F3n: ''{1}''.
- src-resolve = src-resolve: No se puede resolver el nombre ''{0}'' para un componente ''{1}''.
- src-resolve.4.1 = src-resolve.4.1: Error al resolver el componente ''{2}''. Se ha detectado que ''{2}'' no tiene espacio de nombres, pero no se puede hacer referencia a los componentes sin espacio de nombres de destino desde el documento de esquema ''{0}''. Si se pretende que''{2}'' tenga un espacio de nombres, puede que sea necesario proporcionar un prefijo. Si se pretende que ''{2}'' no tenga ning\u00FAn espacio de nombres, es necesario agregar un atributo ''import'' sin un atributo "namespace" a ''{0}''.
- src-resolve.4.2 = src-resolve.4.2: Error al resolver el componente ''{2}''. Se ha detectado que ''{2}'' est\u00E1 en el espacio de nombres ''{1}'', pero no se puede hacer referencia a los componentes de este espacio de nombres desde el documento de esquema ''{0}''. Si es el espacio de nombres incorrecto, puede que sea necesario cambiar el prefijo ''{2}''. Si es el espacio de nombres correcto, es necesario agregar la etiqueta ''import'' correspondiente a ''{0}''.
- src-simple-type.2.a = src-simple-type.2.a: Se ha encontrado un elemento <restriction> que tiene un [atributo] base y un elemento <simpleType> entre sus [secundarios]. S\u00F3lo se permite uno.
- src-simple-type.2.b = src-simple-type.2.b: Se ha encontrado un elemento <restriction> que no tiene ni un [atributo] base ni un elemento <simpleType> entre sus [secundarios]. Se requiere uno.
- src-simple-type.3.a = src-simple-type.3.a: Se ha encontrado un elemento <list> que tiene un [atributo] itemType y un elemento <simpleType> entre sus [secundarios]. S\u00F3lo se permite uno.
- src-simple-type.3.b = src-simple-type.3.b: Se ha encontrado un elemento <list> que no tiene ni un [atributo] itemType ni un elemento <simpleType> entre sus [secundarios]. Se requiere uno.
- src-single-facet-value = src-single-facet-value: La faceta ''{0}'' est\u00E1 definida m\u00E1s de una vez.
- src-union-memberTypes-or-simpleTypes = src-union-memberTypes-or-simpleTypes: Un elemento <union> debe tener un [atributo] memberTypes no vac\u00EDo o al menos un elemento <simpleType> entre sus [secundarios].
-
-#constraint valid (3.X.6)
-
- ag-props-correct.2 = ag-props-correct.2: Error en el grupo de atributos ''{0}''. Se han especificado usos de atributo duplicados con el mismo nombre y espacio de nombres de destino. El nombre del uso de atributo duplicado es ''{1}''.
- ag-props-correct.3 = ag-props-correct.3: Error en el grupo de atributos ''{0}''. Dos declaraciones de atributo, ''{1}'' y ''{2}'', tienen tipos que se derivan del identificador.
- a-props-correct.2 = a-props-correct.2: Valor de restricci\u00F3n de valor ''{1}'' no v\u00E1lido en el atributo ''{0}''.
- a-props-correct.3 = a-props-correct.3: El atributo ''{0}'' no puede utilizar ''fixed'' ni ''default'', porque el valor de '{'type definition'}' del atributo es el identificador o se deriva del identificador.
- au-props-correct.2 = au-props-correct.2: En la declaraci\u00F3n de atributo de ''{0}'', se ha especificado un valor fijo de ''{1}''. Por lo tanto, si el uso del atributo que hace referencia a ''{0}'' tambi\u00E9n tiene un valor de '{'value constraint'}', debe fijarse y el valor debe ser ''{1}''.
- cos-all-limited.1.2 = cos-all-limited.1.2:Debe aparecer un grupo de modelos 'all' en una part\u00EDcula con '{'min occurs'}' = '{'max occurs'}' = 1 y dicha part\u00EDcula debe formar parte de un par que constituya el valor de '{'content type'}' de una definici\u00F3n de tipo complejo.
- cos-all-limited.2 = cos-all-limited.2: El valor de '{'max occurs'}' de un elemento de un grupo de modelos ''all'' debe ser 0 o 1. El valor ''{0}'' del elemento ''{1}'' no es v\u00E1lido.
- cos-applicable-facets = cos-applicable-facets: El tipo {1} no permite la faceta ''{0}''.
- cos-ct-extends.1.1 = cos-ct-extends.1.1: El tipo ''{0}'' se ha derivado por extensi\u00F3n del tipo ''{1}''. Sin embargo, el atributo ''final'' de ''{1}'' proh\u00EDbe la derivaci\u00F3n por extensi\u00F3n.
- cos-ct-extends.1.4.3.2.2.1.a = cos-ct-extends.1.4.3.2.2.1.a: El tipo de contenido de un tipo derivado y el de su base deben ser mixtos o ser ambos s\u00F3lo de elemento. El tipo ''{0}'' es de s\u00F3lo elemento, pero su tipo base no lo es.
- cos-ct-extends.1.4.3.2.2.1.b = cos-ct-extends.1.4.3.2.2.1.b: El tipo de contenido de un tipo derivado y el de su base deben ser mixtos o ser ambos s\u00F3lo de elemento. El tipo ''{0}'' es mixto, pero su tipo base no lo es.
- cos-element-consistent = cos-element-consistent: Error para el tipo ''{0}''. Aparecen en el grupo de modelos varios elementos con el nombre ''{1}'' y con tipos diferentes.
- cos-list-of-atomic = cos-list-of-atomic: En la definici\u00F3n de tipo de lista ''{0}'', el tipo ''{1}'' es un tipo de elemento de lista no v\u00E1lido porque no es at\u00F3mico (''{1}'' es un tipo de lista o un tipo de uni\u00F3n que contiene una lista).
- cos-nonambig = cos-nonambig: {0} y {1} (o los elementos de su grupo de sustituci\u00F3n) violan la "atribuci\u00F3n de part\u00EDcula \u00FAnica". Durante la validaci\u00F3n a partir de este esquema, se crear\u00E1 ambig\u00FCedad para estas dos part\u00EDculas.
- cos-particle-restrict.a = cos-particle-restrict.a: La part\u00EDcula derivada est\u00E1 vac\u00EDa y la base no se puede vaciar.
- cos-particle-restrict.b = cos-particle-restrict.b: La part\u00EDcula base est\u00E1 vac\u00EDa, pero la part\u00EDcula derivada no.
- cos-particle-restrict.2 = cos-particle-restrict.2: Restricci\u00F3n de part\u00EDcula prohibida: ''{0}''.
- cos-st-restricts.1.1 = cos-st-restricts.1.1: El tipo ''{1}'' es at\u00F3mico, por lo que su '{'base type definition'}', ''{0}'', debe ser una definici\u00F3n de tipo simple at\u00F3mico o un tipo de dato primitivo incorporado.
- cos-st-restricts.2.1 = cos-st-restricts.2.1: En la definici\u00F3n de tipo de lista ''{0}'', el tipo ''{1}'' es un tipo de elemento no v\u00E1lido porque es un tipo de lista o un tipo de uni\u00F3n que contiene una lista.
- cos-st-restricts.2.3.1.1 = cos-st-restricts.2.3.1.1: El componente '{'final'}' de '{'item type definition'}', ''{0}'', contiene ''list''. Significa que ''{0}'' no se puede utilizar como un tipo de elemento para el tipo de lista ''{1}''.
- cos-st-restricts.3.3.1.1 = cos-st-restricts.3.3.1.1: El componente '{'final'}' de '{'member type definitions'}', ''{0}'', contiene ''union''. Significa que ''{0}'' no se puede utilizar como un tipo de miembro para el tipo de uni\u00F3n ''{1}''.
- cos-valid-default.2.1 = cos-valid-default.2.1: El elemento ''{0}'' contiene una restricci\u00F3n de valor y debe tener un modelo de contenido mixto o simple.
- cos-valid-default.2.2.2 = cos-valid-default.2.2.2: Como el elemento ''{0}'' tiene una '{'value constraint'}' y su definici\u00F3n de tipo tiene un '{'content type'}' mixto, la part\u00EDcula de '{'content type'}' debe poder vaciarse.
- c-props-correct.2 = c-props-correct.2: La cardinalidad de los campos de la referencia de clave ''{0}'' y la clave ''{1}'' deben coincidir.
- ct-props-correct.3 = ct-props-correct.3: Se han detectado definiciones circulares para el tipo complejo ''{0}''. Significa que ''{0}'' est\u00E1 contenido en su propia jerarqu\u00EDa de tipos, lo que es un error.
- ct-props-correct.4 = ct-props-correct.4: Error para el tipo ''{0}''. Se han especificado usos de atributo duplicados con el mismo nombre y espacio de nombres de destino. El nombre del uso de atributo duplicado es ''{1}''.
- ct-props-correct.5 = ct-props-correct.5: Error para el tipo ''{0}''. Dos declaraciones de atributo, ''{1}'' y ''{2}'','' tienen tipos que se derivan del identificador.
- derivation-ok-restriction.1 = derivation-ok-restriction.1: El tipo ''{0}'' se ha derivado por restricci\u00F3n del tipo ''{1}''. Sin embargo, ''{1}'' tiene una propiedad '{'final'}' que proh\u00EDbe la derivaci\u00F3n por restricci\u00F3n.
- derivation-ok-restriction.2.1.1 = derivation-ok-restriction.2.1.1: Error para el tipo ''{0}''. El uso de atributo ''{1}'' en este tipo tiene un valor ''use'' de ''{2}'', que es incoherente con el valor de ''required'' en un uso de atributo coincidente del tipo base.
- derivation-ok-restriction.2.1.2 = derivation-ok-restriction.2.1.2: Error para el tipo ''{0}''. El uso de atributo ''{1}'' en este tipo tiene el tipo ''{2}'', que no se ha derivado de forma v\u00E1lida de ''{3}'', el tipo de uso de atributo coincidente del tipo base.
- derivation-ok-restriction.2.1.3.a = derivation-ok-restriction.2.1.3.a: Error para el tipo ''{0}''. El uso de atributo ''{1}'' en este tipo tiene una restricci\u00F3n de valor efectivo que no es fija y la restricci\u00F3n de valor efectivo del uso de atributo coincidente en el tipo base es fija.
- derivation-ok-restriction.2.1.3.b = derivation-ok-restriction.2.1.3.b: Error para el tipo ''{0}''. El uso de atributo ''{1}'' en este tipo tiene una restricci\u00F3n de valor efectivo fija con un valor de ''{2}'', que no es coherente con el valor de ''{3}'' para la restricci\u00F3n de valor efectivo fija del uso de atributo coincidente en el tipo base.
- derivation-ok-restriction.2.2.a = derivation-ok-restriction.2.2.a: Error para el tipo ''{0}''. El uso de atributo ''{1}'' en este tipo no tiene un uso de atributo coincidente en la base y el tipo base no tiene un atributo de comod\u00EDn.
- derivation-ok-restriction.2.2.b = derivation-ok-restriction.2.2.b: Error para el tipo ''{0}''. El uso de atributo ''{1}'' en este tipo no tiene un uso de atributo coincidente en la base y el comod\u00EDn en el tipo base no permite el espacio de nombres ''{2}'' de este uso de atributo.
- derivation-ok-restriction.3 = derivation-ok-restriction.3: Error para el tipo ''{0}''. El uso de atributo ''{1}'' en el tipo base tiene el valor REQUIRED como true, pero no hay ning\u00FAn uso de atributo coincidente en el tipo derivado.
- derivation-ok-restriction.4.1 = derivation-ok-restriction.4.1: Error para el tipo ''{0}''. La derivaci\u00F3n tiene un comod\u00EDn de atributo, pero la base no tiene uno.
- derivation-ok-restriction.4.2 = derivation-ok-restriction.4.2: Error para el tipo ''{0}''. El comod\u00EDn de la derivaci\u00F3n no es un subjuego de comodines v\u00E1lido del de la base.
- derivation-ok-restriction.4.3 = derivation-ok-restriction.4.3: Error para el tipo ''{0}''. El contenido del proceso del comod\u00EDn de la derivaci\u00F3n ({1}) es m\u00E1s d\u00E9bil que el de la base ({2}).
- derivation-ok-restriction.5.2.2.1 = derivation-ok-restriction.5.2.2.1: Error para el tipo ''{0}''. El tipo de contenido simple de este tipo, ''{1}'', no es una restricci\u00F3n v\u00E1lida del tipo de contenido simple de la base, ''{2}''.
- derivation-ok-restriction.5.3.2 = derivation-ok-restriction.5.3.2: Error para el tipo ''{0}''. El tipo de contenido de este tipo est\u00E1 vac\u00EDo, pero el tipo de contenido de la base, ''{1}'', no est\u00E1 vac\u00EDo o no se puede vaciar.
- derivation-ok-restriction.5.4.1.2 = derivation-ok-restriction.5.4.1.2: Error para el tipo ''{0}''. El tipo de contenido de este tipo es mixto, pero el tipo de contenido de la base, ''{1}'', no lo es.
- derivation-ok-restriction.5.4.2 = derivation-ok-restriction.5.4.2: Error para el tipo ''{0}''. La part\u00EDcula del tipo no es una restricci\u00F3n v\u00E1lida de la part\u00EDcula de la base.
- enumeration-required-notation = enumeration-required-notation: El tipo NOTATION ''{0}'', utilizado por {2} ''{1}'', debe tener un valor de faceta de enumeraci\u00F3n que especifique los elementos de notaci\u00F3n que utiliza este tipo.
- enumeration-valid-restriction = enumeration-valid-restriction: El valor de enumeraci\u00F3n ''{0}'' no se encuentra en el espacio reservado para el valor del tipo base, {1}.
- e-props-correct.2 = e-props-correct.2: Valor de restricci\u00F3n de valor ''{1}'' no v\u00E1lido en el elemento ''{0}''.
- e-props-correct.4 = e-props-correct.4: El valor de '{'type definition'}' del elemento ''{0}'' no se ha derivado de forma v\u00E1lida del valor de '{'type definition'}' de substitutionHead ''{1}'' o la propiedad '{'substitution group exclusions'}' de ''{1}'' no permite esta derivaci\u00F3n.
- e-props-correct.5 = e-props-correct.5: Un valor de '{'value constraint'}' no debe estar presente en el elemento ''{0}'', porque la '{'type definition'}' del elemento o el '{'content type'}' de '{'type definition'}' es un identificador o se deriva del identificador.
- e-props-correct.6 = e-props-correct.6: Se ha detectado un grupo de sustituci\u00F3n circular para el elemento ''{0}''.
- fractionDigits-valid-restriction = fractionDigits-valid-restriction: En la definici\u00F3n de {2}, el valor ''{0}'' para la faceta ''fractionDigits'' no es v\u00E1lido porque debe ser menor o igual que el valor de ''fractionDigits'' que se ha definido en ''{1}'' en uno de los tipos de ascendientes.
- fractionDigits-totalDigits = fractionDigits-totalDigits: En la definici\u00F3n de {2}, el valor ''{0}'' para la faceta ''fractionDigits'' no es v\u00E1lido porque debe ser menor o igual que el valor de ''totalDigits'', que es ''{1}''.
- length-minLength-maxLength.1.1 = length-minLength-maxLength.1.1: Para el tipo {0}, es un error que el valor de la longitud ''{1}'' sea inferior al valor de minLength ''{2}''.
- length-minLength-maxLength.1.2.a = length-minLength-maxLength.1.2.a: Para el tipo {0}, es un error que la base no tener una faceta de minLength si la restricci\u00F3n actual tiene la faceta de minLength y la restricci\u00F3n o base actual tiene la faceta de longitud.
- length-minLength-maxLength.1.2.b = length-minLength-maxLength.1.2.b: Para el tipo {0}, es un error que el valor de minLength actual ''{1}'' no sea igual al valor de minLength de base ''{2}''.
- length-minLength-maxLength.2.1 = length-minLength-maxLength.2.1: Para el tipo {0}, es un error que el valor de la longitud ''{1}'' sea superior al valor de maxLength ''{2}''.
- length-minLength-maxLength.2.2.a = length-minLength-maxLength.2.2.a: Para el tipo {0}, es un error que la base no tener una faceta de maxLength si la restricci\u00F3n actual tiene la faceta de maxLength y la restricci\u00F3n o base actual tiene la faceta de longitud.
- length-minLength-maxLength.2.2.b = length-minLength-maxLength.2.2.b: Para el tipo {0}, es un error que el valor de maxLength actual ''{1}'' no sea igual al valor de maxLength de base ''{2}''.
- length-valid-restriction = length-valid-restriction: Error para el tipo ''{2}''. El valor de la longitud = ''{0}'' debe ser igual que el valor del tipo base ''{1}''.
- maxExclusive-valid-restriction.1 = maxExclusive-valid-restriction.1: Error para el tipo ''{2}''. El valor de maxExclusive =''{0}'' debe ser menor o igual que el valor de maxExclusive del tipo base ''{1}''.
- maxExclusive-valid-restriction.2 = maxExclusive-valid-restriction.2: Error para el tipo ''{2}''. El valor de maxExclusive =''{0}'' debe ser menor o igual que el valor de maxInclusive del tipo base ''{1}''.
- maxExclusive-valid-restriction.3 = maxExclusive-valid-restriction.3: Error para el tipo ''{2}''. El valor de maxExclusive =''{0}''debe ser mayor que el valor de minInclusive del tipo base ''{1}''.
- maxExclusive-valid-restriction.4 = maxExclusive-valid-restriction.4: Error para el tipo ''{2}''. El valor de maxExclusive =''{0}'' debe ser mayor que el valor de minExclusive del tipo base ''{1}''.
- maxInclusive-maxExclusive = maxInclusive-maxExclusive: Es un error especificar maxInclusive y maxExclusive para el mismo tipo de dato. En {2}, maxInclusive = ''{0}'' y maxExclusive = ''{1}''.
- maxInclusive-valid-restriction.1 = maxInclusive-valid-restriction.1: Error para el tipo ''{2}''. El valor de maxInclusive =''{0}'' debe ser menor o igual que el valor de maxInclusive del tipo base ''{1}''.
- maxInclusive-valid-restriction.2 = maxInclusive-valid-restriction.2: Error para el tipo ''{2}''. El valor de maxInclusive =''{0}'' debe ser menor que el valor de maxExclusive del tipo base ''{1}''.
- maxInclusive-valid-restriction.3 = maxInclusive-valid-restriction.3: Error para el tipo ''{2}''. El valor de maxInclusive =''{0}'' debe ser mayor o igual que el valor de minInclusive del tipo base ''{1}''.
- maxInclusive-valid-restriction.4 = maxInclusive-valid-restriction.4: Error para el tipo ''{2}''. El valor de maxInclusive =''{0}'' debe ser mayor que el valor de minExclusive del tipo base ''{1}''.
- maxLength-valid-restriction = maxLength-valid-restriction: En la definici\u00F3n de {2}, el valor de maxLength = ''{0}'' debe ser menor o igual que el del tipo base ''{1}''.
- mg-props-correct.2 = mg-props-correct.2: Se han detectado definiciones circulares para el grupo ''{0}''. El seguimiento recurrente de los valores '{'term'}' de las part\u00EDculas provoca una part\u00EDcula cuyo valor de '{'term'}' es el mismo grupo.
- minExclusive-less-than-equal-to-maxExclusive = minExclusive-less-than-equal-to-maxExclusive: En la definici\u00F3n de {2}, el valor de minExclusive = ''{0}'' debe ser menor o igual que el valor de maxExclusive = ''{1}''.
- minExclusive-less-than-maxInclusive = minExclusive-less-than-maxInclusive: En la definici\u00F3n de {2}, el valor de minExclusive = ''{0}''debe ser menor que el valor de maxInclusive = ''{1}''.
- minExclusive-valid-restriction.1 = minExclusive-valid-restriction.1: Error para el tipo ''{2}''. El valor de minExclusive =''{0}'' debe ser mayor o igual que el valor de minExclusive del tipo base ''{1}''.
- minExclusive-valid-restriction.2 = minExclusive-valid-restriction.2: Error para el tipo ''{2}''. El valor de minExclusive =''{0}'' debe ser menor o igual que el valor de maxInclusive del tipo base ''{1}''.
- minExclusive-valid-restriction.3 = minExclusive-valid-restriction.3: Error para el tipo ''{2}''. El valor de minExclusive =''{0}'' debe ser mayor o igual que el valor de minInclusive del tipo base ''{1}''.
- minExclusive-valid-restriction.4 = minExclusive-valid-restriction.4: Error para el tipo ''{2}''. El valor de minExclusive =''{0}'' debe ser menor que el valor de maxExclusive del tipo base ''{1}''.
- minInclusive-less-than-equal-to-maxInclusive = minInclusive-less-than-equal-to-maxInclusive: En la definici\u00F3n de {2}, el valor de minInclusive = ''{0}'' debe ser menor o igual que el valor de maxInclusive = ''{1}''.
- minInclusive-less-than-maxExclusive = minInclusive-less-than-maxExclusive: En la definici\u00F3n de {2}, el valor de minInclusive = ''{0}'' debe ser menor que el valor de maxExclusive = ''{1}''.
- minInclusive-minExclusive = minInclusive-minExclusive: Es un error especificar minInclusive y minExclusive para el mismo tipo de dato. En {2}, minInclusive = ''{0}'' y minExclusive = ''{1}''.
- minInclusive-valid-restriction.1 = minInclusive-valid-restriction.1: Error para el tipo ''{2}''. El valor de minInclusive =''{0}'' debe ser mayor o igual que el valor de minInclusive del tipo base ''{1}''.
- minInclusive-valid-restriction.2 = minInclusive-valid-restriction.2: Error para el tipo ''{2}''. El valor de minInclusive =''{0}'' debe ser menor o igual que el valor de maxInclusive del tipo base ''{1}''.
- minInclusive-valid-restriction.3 = minInclusive-valid-restriction.3: Error para el tipo ''{2}''. El valor de minInclusive =''{0}'' debe ser mayor que el valor de minExclusive del tipo base ''{1}''.
- minInclusive-valid-restriction.4 = minInclusive-valid-restriction.4: Error para el tipo ''{2}''. El valor de minInclusive =''{0}'' debe ser menor que el valor de maxExclusive del tipo base ''{1}''.
- minLength-less-than-equal-to-maxLength = minLength-less-than-equal-to-maxLength: En la definici\u00F3n de {2}, el valor de minLength = ''{0}'' debe ser menor que el valor de maxLength = ''{1}''.
- minLength-valid-restriction = minLength-valid-restriction: En la definici\u00F3n de {2}, el valor de minLength = ''{0}'' debe ser mayor o igual que el del tipo base, ''{1}''.
- no-xmlns = no-xmlns: El valor de {name} de una declaraci\u00F3n de atributo no debe coincidir con 'xmlns'.
- no-xsi = no-xsi: El valor de '{'target namespace'}' de una declaraci\u00F3n de atributo no debe coincidir con ''{0}''.
- p-props-correct.2.1 = p-props-correct.2.1: En la declaraci\u00F3n de ''{0}'', el valor de ''minOccurs'' es ''{1}'', pero no debe ser superior al valor de ''maxOccurs'', que es ''{2}''.
- rcase-MapAndSum.1 = rcase-MapAndSum.1: No existe ninguna asignaci\u00F3n funcional completa entre las part\u00EDculas.
- rcase-MapAndSum.2 = rcase-MapAndSum.2: El rango de incidencia del grupo, ({0},{1}), no es una restricci\u00F3n v\u00E1lida del rango de incidencia del grupo base, ({2},{3}).
- rcase-NameAndTypeOK.1 = rcase-NameAndTypeOK.1: Los elementos tienen nombres y espacios de nombres de destino distintos: El elemento''{0}'' en el espacio de nombres ''{1}'' y el elemento ''{2}'' en el espacio de nombres ''{3}''.
- rcase-NameAndTypeOK.2 = rcase-NameAndTypeOK.2: Error para la part\u00EDcula cuyo valor de '{'term'}' es la declaraci\u00F3n de elemento ''{0}''. El valor de '{'nillable'}' de la declaraci\u00F3n de elemento es true, pero la part\u00EDcula correspondiente en el tipo base tiene una declaraci\u00F3n de elemento cuyo valor de '{'nillable'}' es false.
- rcase-NameAndTypeOK.3 = rcase-NameAndTypeOK.3: Error para la part\u00EDcula cuyo valor de '{'term'}' es la declaraci\u00F3n de elemento ''{0}''. Su rango de incidencia, ({1},{2}), no es una restricci\u00F3n v\u00E1lida del rango, ({3},{4}, de la part\u00EDcula correspondiente en el tipo base.
- rcase-NameAndTypeOK.4.a = rcase-NameAndTypeOK.4.a: El elemento ''{0}'' no es fijo, pero el elemento correspondiente en el tipo base es fijo con el valor ''{1}''.
- rcase-NameAndTypeOK.4.b = rcase-NameAndTypeOK.4.b: El elemento ''{0}'' es fijo con el valor ''{1}'', pero el elemento correspondiente en el tipo base es fijo con el valor ''{2}''.
- rcase-NameAndTypeOK.5 = rcase-NameAndTypeOK.5: Las restricciones de identidad del elemento ''{0}'' no son un subjuego de las de la base.
- rcase-NameAndTypeOK.6 = rcase-NameAndTypeOK.6: Las sustituciones no permitidas del elemento ''{0}'' no son un subjuego de las de la base.
- rcase-NameAndTypeOK.7 = rcase-NameAndTypeOK.7: El tipo de elemento ''{0}'', ''{1}'', no est\u00E1 derivado del tipo del elemento base, ''{2}''.
- rcase-NSCompat.1 = rcase-NSCompat.1: El elemento ''{0}'' tiene un espacio de nombres ''{1}'' que no est\u00E1 permitido por el comod\u00EDn de la base.
- rcase-NSCompat.2 = rcase-NSCompat.2: Error para la part\u00EDcula cuyo valor de '{'term'}' es la declaraci\u00F3n de elemento ''{0}''. Su rango de incidencia, ({1},{2}), no es una restricci\u00F3n v\u00E1lida del rango, ({3},{4}, de la part\u00EDcula correspondiente en el tipo base.
- rcase-NSRecurseCheckCardinality.1 = rcase-NSRecurseCheckCardinality.1: No existe ninguna asignaci\u00F3n funcional completa entre las part\u00EDculas.
- rcase-NSRecurseCheckCardinality.2 = rcase-NSRecurseCheckCardinality.2: El rango de incidencia del grupo, ({0},{1}), no es una restricci\u00F3n v\u00E1lida del rango de comod\u00EDn de la base, ({2},{3}).
- rcase-NSSubset.1 = rcase-NSSubset.1: El comod\u00EDn no es un subjuego del comod\u00EDn correspondiente de la base.
- rcase-NSSubset.2 = rcase-NSSubset.2: El rango de incidencia del comod\u00EDn, ({0},{1}), no es una restricci\u00F3n v\u00E1lida del de la base, ({2},{3}).
- rcase-NSSubset.3 = rcase-NSSubset.3: El contenido del proceso del comod\u00EDn, ''{0}'', es m\u00E1s d\u00E9bil que el de la base, ''{1}''.
- rcase-Recurse.1 = rcase-Recurse.1: El rango de incidencia del grupo, ({0},{1}), no es una restricci\u00F3n v\u00E1lida del rango de incidencia del grupo base, ({2},{3}).
- rcase-Recurse.2 = rcase-Recurse.2: No existe ninguna asignaci\u00F3n funcional completa entre las part\u00EDculas.
- rcase-RecurseLax.1 = rcase-RecurseLax.1: El rango de incidencia del grupo, ({0},{1}), no es una restricci\u00F3n v\u00E1lida del rango de incidencia del grupo base, ({2},{3}).
- rcase-RecurseLax.2 = rcase-RecurseLax.2: No existe ninguna asignaci\u00F3n funcional completa entre las part\u00EDculas.
- rcase-RecurseUnordered.1 = rcase-RecurseUnordered.1: El rango de incidencia del grupo, ({0},{1}), no es una restricci\u00F3n v\u00E1lida del rango de incidencia del grupo base, ({2},{3}).
- rcase-RecurseUnordered.2 = rcase-RecurseUnordered.2: No existe ninguna asignaci\u00F3n funcional completa entre las part\u00EDculas.
-# We're using sch-props-correct.2 instead of the old src-redefine.1
-# src-redefine.1 = src-redefine.1: The component ''{0}'' is begin redefined, but its corresponding component isn't in the schema document being redefined (with namespace ''{2}''), but in a different document, with namespace ''{1}''.
- sch-props-correct.2 = sch-props-correct.2: Un esquema no puede contener dos componentes globales con el mismo nombre; \u00E9ste contiene dos incidencias de ''{0}''.
- st-props-correct.2 = st-props-correct.2: Se han detectado definiciones circulares para el tipo simple ''{0}''. Significa que ''{0}'' est\u00E1 contenido en su propia jerarqu\u00EDa de tipos, lo que es un error.
- st-props-correct.3 = st-props-correct.3: Error para el tipo ''{0}''. El valor de '{'final'}' de '{'base type definition'}', ''{1}'', proh\u00EDbe la derivaci\u00F3n por restricci\u00F3n.
- totalDigits-valid-restriction = totalDigits-valid-restriction: En la definici\u00F3n de {2}, el valor ''{0}'' para la faceta ''totalDigits'' no es v\u00E1lido porque debe ser menor o igual que el valor de ''totalDigits'' que se ha definido en ''{1}'' en uno de los tipos de ascendientes.
- whiteSpace-valid-restriction.1 = whiteSpace-valid-restriction.1: En la definici\u00F3n de {0}, el valor ''{1}'' para la faceta ''whitespace'' no es v\u00E1lido porque el valor de ''whitespace'' se ha definido en ''collapse'' en uno de los tipos de ascendientes.
- whiteSpace-valid-restriction.2 = whiteSpace-valid-restriction.2: En la definici\u00F3n de {0}, el valor ''preserve'' para la faceta ''whitespace'' no es v\u00E1lido porque el valor de ''whitespace'' se ha definido en ''replace'' en uno de los tipos de ascendientes.
-
-#schema for Schemas
-
- s4s-att-invalid-value = s4s-att-invalid-value: Valor de atributo no v\u00E1lido para ''{1}'' en el elemento ''{0}''. Motivo registrado: {2}
- s4s-att-must-appear = s4s-att-must-appear: El atributo ''{1}'' debe aparecer en el elemento ''{0}''.
- s4s-att-not-allowed = s4s-att-not-allowed: El atributo ''{1}'' no puede aparecer en el elemento ''{0}''.
- s4s-elt-invalid = s4s-elt-invalid: El elemento ''{0}'' no es un elemento v\u00E1lido en un documento de esquema.
- s4s-elt-must-match.1 = s4s-elt-must-match.1: El contenido de ''{0}'' debe coincidir con {1}. Se ha encontrado un problema que comienza en: {2}.
- s4s-elt-must-match.2 = s4s-elt-must-match.2: El contenido de ''{0}'' debe coincidir con {1}. No se han encontrado suficientes elementos.
- # the "invalid-content" messages provide less information than the "must-match" counterparts above. They're used for complex types when providing a "match" would be an information dump
- s4s-elt-invalid-content.1 = s4s-elt-invalid-content.1: El contenido de ''{0}'' no es v\u00E1lido. El elemento ''{1}'' no es v\u00E1lido, est\u00E1 mal situado o aparece con demasiada frecuencia.
- s4s-elt-invalid-content.2 = s4s-elt-invalid-content.2: El contenido de ''{0}'' no es v\u00E1lido. El elemento ''{1}'' no puede estar vac\u00EDo.
- s4s-elt-invalid-content.3 = s4s-elt-invalid-content.3: Los elementos de tipo''{0}'' no pueden aparecer despu\u00E9s de las declaraciones como secundarios de un elemento de <schema>.
- s4s-elt-schema-ns = s4s-elt-schema-ns: El espacio de nombres del elemento ''{0}'' debe ser del espacio de nombres del esquema, ''http://www.w3.org/2001/XMLSchema''.
- s4s-elt-character = s4s-elt-character: Los caracteres distintos de los espacios en blanco no est\u00E1n permitidos en elementos de esquema que no sean ''xs:appinfo'' y ''xs:documentation''. Se ha obtenido ''{0}''.
-
-# codes not defined by the spec
-
- c-fields-xpaths = c-fields-xpaths: El valor de campo = ''{0}'' no es v\u00E1lido.
- c-general-xpath = c-general-xpath: La expresi\u00F3n ''{0}'' no es v\u00E1lida con respecto al subjuego de XPath soportado por el esquema XML.
- c-general-xpath-ns = c-general-xpath-ns: Un prefijo de espacio de nombres en la expresi\u00F3n XPath''{0}'' no estaba enlazado a ning\u00FAn espacio de nombres.
- c-selector-xpath = c-selector-xpath: El valor de selector = ''{0}'' no es v\u00E1lido; los valores de Xpath en el selector no pueden contener atributos.
- EmptyTargetNamespace = EmptyTargetNamespace: En el documento de esquema ''{0}'', el valor del atributo ''targetNamespace'' no puede ser una cadena vac\u00EDa.
- FacetValueFromBase = FacetValueFromBase: En la declaraci\u00F3n de tipo ''{0}'', el valor ''{1}'' de la faceta ''{2}'' debe proceder del espacio reservado para el valor del tipo base, ''{3}''.
- FixedFacetValue = FixedFacetValue: En la definici\u00F3n de {3}, el valor ''{1}'' para la faceta ''{0}'' no es v\u00E1lido porque el valor de ''{0}'' se ha definido en ''{2}'' en uno de los tipos de ascendientes y '{'fixed'}' = true.
- InvalidRegex = InvalidRegex: El valor del patr\u00F3n ''{0}'' no es una expresi\u00F3n regular v\u00E1lida. El error registrado ha sido: ''{1}'' en la columna ''{2}''.
- MaxOccurLimit = La configuraci\u00F3n actual del analizador no permite que la definici\u00F3n del valor del atributo maxOccurs sea mayor que {0}.
- PublicSystemOnNotation = PublicSystemOnNotation: Al menos un valor de ''public'' y ''system'' debe aparecer en el elemento ''notation''.
- SchemaLocation = SchemaLocation: El valor de schemaLocation = ''{0}'' debe tener un n\u00FAmero par de URI.
- TargetNamespace.1 = TargetNamespace.1: Se esperaba el espacio de nombres ''{0}'', pero el espacio de nombres de destino del documento de esquema es ''{1}''.
- TargetNamespace.2 = TargetNamespace.2: No se esperaba ning\u00FAn espacio de nombres, pero el documento de esquema tiene un espacio de nombres de destino ''{1}''.
- UndeclaredEntity = UndeclaredEntity: La entidad ''{0}'' no est\u00E1 declarada.
- UndeclaredPrefix = UndeclaredPrefix: No se puede resolver ''{0}'' como QName: no se ha declarado el prefijo ''{1}''.
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_fr.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_fr.properties
deleted file mode 100644
index 74ae32c..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_fr.properties
+++ /dev/null
@@ -1,291 +0,0 @@
-# This file contains error and warning messages related to XML Schema
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
- BadMessageKey = Le message d'erreur correspondant \u00E0 la cl\u00E9 de message est introuvable.
- FormatFailed = Une erreur interne est survenue lors du formatage du message suivant :\n
-
-# For internal use
-
- Internal-Error = Erreur interne : {0}.
- dt-whitespace = La valeur de facet de caract\u00E8re non imprimable n''est pas disponible pour le simpleType d''union ''{0}''
- GrammarConflict = L'une des grammaires renvoy\u00E9es \u00E0 partir du pool de grammaires de l'utilisateur est en conflit avec une autre grammaire.
-
-# Identity constraints
-
- AbsentKeyValue = Erreur de contrainte d''identit\u00E9 (cvc-identity-constraint.4.2.1) : l''\u00E9l\u00E9ment "{0}" a une cl\u00E9 sans valeur.
- DuplicateField = Correspondance en double dans la port\u00E9e du champ "{0}".
- DuplicateKey = Valeur de cl\u00E9 en double [{0}] d\u00E9clar\u00E9e pour la contrainte d''identit\u00E9 de l''\u00E9l\u00E9ment "{1}".
- DuplicateUnique = Valeur unique en double [{0}] d\u00E9clar\u00E9e pour la contrainte d''identit\u00E9 de l''\u00E9l\u00E9ment "{1}".
- FieldMultipleMatch = Erreur de contrainte d''identit\u00E9 : le champ "{0}" concorde avec plusieurs valeurs dans la port\u00E9e de son s\u00E9lecteur ; les champs doivent concorder avec des valeurs uniques.
- FixedDiffersFromActual = Le contenu de l'\u00E9l\u00E9ment n'\u00E9quivaut pas \u00E0 la valeur de l'attribut "fixed" dans la d\u00E9claration de l'\u00E9l\u00E9ment du sch\u00E9ma.
- KeyMatchesNillable = Erreur de contrainte d''identit\u00E9 (cvc-identity-constraint.4.2.3) : l''\u00E9l\u00E9ment "{0}" a une cl\u00E9 qui concorde avec un \u00E9l\u00E9ment dont l''attribut nillable a la valeur True.
- KeyNotEnoughValues = Le nombre de valeurs indiqu\u00E9es pour la contrainte d''identit\u00E9 <key name="{1}"> de l''\u00E9l\u00E9ment "{0}" est insuffisant.
- KeyNotFound = La cl\u00E9 ''{0}'' ayant la valeur ''{1}'' est introuvable pour la contrainte d''identit\u00E9 de l''\u00E9l\u00E9ment ''{2}''.
- KeyRefNotEnoughValues = Le nombre de valeurs indiqu\u00E9es pour la contrainte d''identit\u00E9 <keyref name="{1}"> de l''\u00E9l\u00E9ment "{0}" est insuffisant.
- KeyRefOutOfScope = Erreur de contrainte d''identit\u00E9 : la contrainte d''identit\u00E9 "{0}" comporte une r\u00E9f\u00E9rence keyref se rapportant \u00E0 une cl\u00E9 ou \u00E0 une valeur unique hors port\u00E9e.
- KeyRefReferNotFound = La d\u00E9claration de r\u00E9f\u00E9rence de cl\u00E9 "{0}" se rapporte \u00E0 une cl\u00E9 inconnue portant le nom "{1}".
- UniqueNotEnoughValues = Le nombre de valeurs indiqu\u00E9es pour la contrainte d''identit\u00E9 <unique> de l''\u00E9l\u00E9ment "{0}" est insuffisant.
- UnknownField = Erreur de contrainte d''identit\u00E9 interne ; champ inconnu "{0}".
-
-# Ideally, we should only use the following error keys, not the ones under
-# "Identity constraints". And we should cover all of the following errors.
-
-#validation (3.X.4)
-
- cvc-attribute.3 = cvc-attribute.3 : La valeur ''{2}'' de l''attribut ''{1}'' de l''\u00E9l\u00E9ment ''{0}'' n''est pas valide par rapport \u00E0 son type, ''{3}''.
- cvc-attribute.4 = cvc-attribute.4 : La valeur ''{2}'' de l''attribut ''{1}'' de l''\u00E9l\u00E9ment ''{0}'' n''est pas valide par rapport \u00E0 son attribut '{'value constraint'}' fixe. L''attribut doit avoir une valeur de ''{3}''.
- cvc-complex-type.2.1 = cvc-complex-type.2.1 : L''\u00E9l\u00E9ment ''{0}'' ne doit comporter aucun enfant ([children]) de type caract\u00E8re ou \u00E9l\u00E9ment d''information, car le type de contenu du type est vide.
- cvc-complex-type.2.2 = cvc-complex-type.2.2 : L''\u00E9l\u00E9ment ''{0}'' ne doit comporter aucun enfant ([children]) de type \u00E9l\u00E9ment et la valeur doit \u00EAtre valide.
- cvc-complex-type.2.3 = cvc-complex-type.2.3 : L''\u00E9l\u00E9ment ''{0}'' ne doit comporter aucun enfant ([children]) de type caract\u00E8re, car le type porte le type de contenu "element-only".
- cvc-complex-type.2.4.a = cvc-complex-type.2.4.a : Contenu non valide trouv\u00E9 \u00E0 partir de l''\u00E9l\u00E9ment ''{0}''. L''une des valeurs ''{1}'' est attendue.
- cvc-complex-type.2.4.b = cvc-complex-type.2.4.b : Le contenu de l''\u00E9l\u00E9ment ''{0}'' n''est pas complet. L''un des \u00E9l\u00E9ments ''{1}'' est attendu.
- cvc-complex-type.2.4.c = cvc-complex-type.2.4.c : Le caract\u00E8re g\u00E9n\u00E9rique concordant est strict, mais aucune d\u00E9claration ne peut \u00EAtre trouv\u00E9e pour l''\u00E9l\u00E9ment ''{0}''.
- cvc-complex-type.2.4.d = cvc-complex-type.2.4.d : Contenu non valide trouv\u00E9 \u00E0 partir de l''\u00E9l\u00E9ment ''{0}''. Aucun \u00E9l\u00E9ment enfant n''est attendu \u00E0 cet endroit.
- cvc-complex-type.2.4.e = cvc-complex-type.2.4.d : Contenu non valide trouv\u00E9 \u00E0 partir de l''\u00E9l\u00E9ment ''{0}''. Aucun \u00E9l\u00E9ment enfant ''{1}'' n''est attendu \u00E0 cet endroit.
- cvc-complex-type.3.1 = cvc-complex-type.3.1 : La valeur ''{2}'' de l''attribut ''{1}'' de l''\u00E9l\u00E9ment ''{0}'' n''est pas valide par rapport \u00E0 la syntaxe d''attribut correspondante. L''attribut ''{1}'' a une valeur fixe de ''{3}''.
- cvc-complex-type.3.2.1 = cvc-complex-type.3.2.1 : L''\u00E9l\u00E9ment ''{0}'' ne dispose d''aucun caract\u00E8re g\u00E9n\u00E9rique d''attribut pour l''attribut ''{1}''.
- cvc-complex-type.3.2.2 = cvc-complex-type.3.2.2 : L''attribut ''{1}'' n''est pas autoris\u00E9 dans l''\u00E9l\u00E9ment ''{0}''.
- cvc-complex-type.4 = cvc-complex-type.4 : L''attribut ''{1}'' doit figurer dans l''\u00E9l\u00E9ment ''{0}''.
- cvc-complex-type.5.1 = cvc-complex-type.5.1 : Dans l''\u00E9l\u00E9ment ''{0}'', l''attribut ''{1}'' est un ID g\u00E9n\u00E9rique. Or, il existe d\u00E9j\u00E0 un ID g\u00E9n\u00E9rique ''{2}''. Il ne peut en exister qu''un seul.
- cvc-complex-type.5.2 = cvc-complex-type.5.2 : Dans l''\u00E9l\u00E9ment ''{0}'', l''attribut ''{1}'' est un ID g\u00E9n\u00E9rique. Or, il existe d\u00E9j\u00E0 un attribut ''{2}'' d\u00E9riv\u00E9 de l''ID dans '{'attribute uses'}'.
- cvc-datatype-valid.1.2.1 = cvc-datatype-valid.1.2.1 : ''{0}'' n''est pas une valeur valide pour ''{1}''.
- cvc-datatype-valid.1.2.2 = cvc-datatype-valid.1.2.2 : ''{0}'' n''est pas une valeur valide du type de liste ''{1}''.
- cvc-datatype-valid.1.2.3 = cvc-datatype-valid.1.2.3 : ''{0}'' n''est pas une valeur valide du type d''union ''{1}''.
- cvc-elt.1 = cvc-elt.1 : D\u00E9claration de l''\u00E9l\u00E9ment ''{0}'' introuvable.
- cvc-elt.2 = cvc-elt.2 : La valeur de l''attribut '{'abstract'}' dans la d\u00E9claration de l''\u00E9l\u00E9ment pour ''{0}'' doit \u00EAtre False.
- cvc-elt.3.1 = cvc-elt.3.1 : L''attribut ''{1}'' ne doit pas figurer dans l''\u00E9l\u00E9ment ''{0}'', car la propri\u00E9t\u00E9 '{'nillable'}' de ''{0}'' est False.
- cvc-elt.3.2.1 = cvc-elt.3.2.1 : L''\u00E9l\u00E9ment ''{0}'' ne doit comporter aucun enfant ([children]) de type caract\u00E8re ou \u00E9l\u00E9ment d''information, car ''{1}'' est indiqu\u00E9.
- cvc-elt.3.2.2 = cvc-elt.3.2.2 : Il ne doit y avoir aucun attribut '{'value constraint'}' fixe pour l''\u00E9l\u00E9ment ''{0}'', car ''{1}'' est indiqu\u00E9.
- cvc-elt.4.1 = cvc-elt.4.1 : La valeur ''{2}'' de l''attribut ''{1}'' de l''\u00E9l\u00E9ment ''{0}'' n''est pas un QName valide.
- cvc-elt.4.2 = cvc-elt.4.2 : Impossible de r\u00E9soudre ''{1}'' en une d\u00E9finition de type pour l''\u00E9l\u00E9ment ''{0}''.
- cvc-elt.4.3 = cvc-elt.4.3 : La d\u00E9rivation du type ''{1}'' \u00E0 partir de la d\u00E9finition de type ''{2}'' de l''\u00E9l\u00E9ment "{0}" n''est pas valide.
- cvc-elt.5.1.1 = cvc-elt.5.1.1 : L''attribut '{'value constraint'}' ''{2}'' de l''\u00E9l\u00E9ment ''{0}'' n''est pas une valeur par d\u00E9faut valide pour le type ''{1}''.
- cvc-elt.5.2.2.1 = cvc-elt.5.2.2.1 : L''\u00E9l\u00E9ment ''{0}'' ne doit comporter aucun enfant ([children]) de type \u00E9l\u00E9ment d''information.
- cvc-elt.5.2.2.2.1 = cvc-elt.5.2.2.2.1 : La valeur ''{1}'' de l''\u00E9l\u00E9ment ''{0}'' ne concorde pas avec la valeur de l''attribut '{'value constraint'}' fixe ''{2}''.
- cvc-elt.5.2.2.2.2 = cvc-elt.5.2.2.2.2 : La valeur ''{1}'' de l''\u00E9l\u00E9ment ''{0}'' ne concorde pas avec la valeur de l''attribut '{'value constraint'}' ''{2}''.
- cvc-enumeration-valid = cvc-enumeration-valid : La valeur ''{0}'' n''est pas un facet valide par rapport \u00E0 l''\u00E9num\u00E9ration ''{1}''. Il doit s''agir d''une valeur provenant de l''\u00E9num\u00E9ration.
- cvc-fractionDigits-valid = cvc-fractionDigits-valid : La valeur ''{0}'' poss\u00E8de {1} chiffres apr\u00E8s la virgule, mais le nombre de chiffres apr\u00E8s la virgule ne doit pas d\u00E9passer {2}.
- cvc-id.1 = cvc-id.1 : Aucune liaison ID/IDREF pour l''IDREF ''{0}''.
- cvc-id.2 = cvc-id.2 : Occurrences multiples de la valeur d''ID ''{0}''.
- cvc-id.3 = cvc-id.3 : Un champ de contrainte d''identit\u00E9 "{0}" a \u00E9t\u00E9 mis en correspondance avec l''\u00E9l\u00E9ment "{1}", mais cet \u00E9l\u00E9ment ne comporte pas de type simple.
- cvc-length-valid = cvc-length-valid : La valeur ''{0}'', ayant pour longueur ''{1}'', n''est pas un facet valide par rapport \u00E0 la longueur ''{2}'' pour le type ''{3}''.
- cvc-maxExclusive-valid = cvc-maxExclusive-valid : La valeur ''{0}'' n''est pas un facet valide par rapport \u00E0 maxExclusive ''{1}'' pour le type ''{2}''.
- cvc-maxInclusive-valid = cvc-maxInclusive-valid : La valeur ''{0}'' n''est pas un facet valide par rapport \u00E0 maxInclusive ''{1}'' pour le type ''{2}''.
- cvc-maxLength-valid = cvc-maxLength-valid : La valeur ''{0}'', ayant pour longueur ''{1}'', n''est pas un facet valide par rapport \u00E0 maxLength ''{2}'' pour le type ''{3}''.
- cvc-minExclusive-valid = cvc-minExclusive-valid : La valeur ''{0}'' n''est pas un facet valide par rapport \u00E0 minExclusive ''{1}'' pour le type ''{2}''.
- cvc-minInclusive-valid = cvc-minInclusive-valid : La valeur ''{0}'' n''est pas un facet valide par rapport \u00E0 minInclusive ''{1}'' pour le type ''{2}''.
- cvc-minLength-valid = cvc-minLength-valid : La valeur ''{0}'', ayant pour longueur ''{1}'', n''est pas un facet valide par rapport \u00E0 minLength ''{2}'' pour le type ''{3}''.
- cvc-pattern-valid = cvc-pattern-valid : La valeur ''{0}'' n''est pas un facet valide par rapport au mod\u00E8le ''{1}'' pour le type ''{2}''.
- cvc-totalDigits-valid = cvc-totalDigits-valid : La valeur ''{0}'' poss\u00E8de un total de {1} chiffres, mais le nombre total de chiffres ne doit pas d\u00E9passer {2}.
- cvc-type.2 = cvc-type.2 : La d\u00E9finition de type ne doit pas \u00EAtre abstract pour l''\u00E9l\u00E9ment {0}.
- cvc-type.3.1.1 = cvc-type.3.1.1 : L''\u00E9l\u00E9ment ''{0}'' est de type simple et ne peut donc pas avoir d''attributs, \u00E0 l''exception de ceux o\u00F9 le nom d''espace de noms est identique \u00E0 ''http://www.w3.org/2001/XMLSchema-instance'' et o\u00F9 [local name] est ''type'', ''nil'', ''schemaLocation'' ou ''noNamespaceSchemaLocation''. Cependant, l''attribut ''{1}'' a \u00E9t\u00E9 trouv\u00E9.
- cvc-type.3.1.2 = cvc-type.3.1.2 : L''\u00E9l\u00E9ment ''{0}'' est de type simple et ne doit comporter aucun enfant ([children]) de type \u00E9l\u00E9ment d''information.
- cvc-type.3.1.3 = cvc-type.3.1.3 : La valeur ''{1}'' de l''\u00E9l\u00E9ment ''{0}'' n''est pas valide.
-
-#schema valid (3.X.3)
-
- schema_reference.access = schema_reference : \u00E9chec de la lecture du document de sch\u00E9ma ''{0}'', car l''acc\u00E8s ''{1}'' n''est pas autoris\u00E9 en raison d''une restriction d\u00E9finie par la propri\u00E9t\u00E9 accessExternalSchema.
- schema_reference.4 = schema_reference.4 : Echec de la lecture du document de sch\u00E9ma ''{0}'' pour les raisons suivantes : 1) Le document est introuvable ; 2) Le document n''a pas pu \u00EAtre lu ; 3) L''\u00E9l\u00E9ment racine du document n''est pas <xsd:schema>.
- src-annotation = src-annotation : Les \u00E9l\u00E9ments <annotation> ne peuvent contenir que des \u00E9l\u00E9ments <appinfo> et <documentation>, mais ''{0}'' a \u00E9t\u00E9 trouv\u00E9.
- src-attribute.1 = src-attribute.1 : Les propri\u00E9t\u00E9s ''default'' et ''fixed'' ne peuvent pas figurer simultan\u00E9ment dans la d\u00E9claration d''attribut ''{0}''. Utilisez uniquement l''une d''entre elles.
- src-attribute.2 = src-attribute.2 : La propri\u00E9t\u00E9 ''default'' figure dans l''attribut ''{0}'', la valeur de ''use'' doit donc \u00EAtre ''optional''.
- src-attribute.3.1 = src-attribute.3.1 : 'ref' ou 'name' doit figurer dans les d\u00E9clarations d'attribut local.
- src-attribute.3.2 = src-attribute.3.2 : Le contenu doit concorder avec (annotation?) pour la r\u00E9f\u00E9rence d''attribut ''{0}''.
- src-attribute.4 = src-attribute.4 : L''attribut ''{0}'' pr\u00E9sente un attribut ''type'' et un enfant ''simpleType'' anonyme. Seul un d''entre eux est autoris\u00E9 dans un attribut.
- src-attribute_group.2 = src-attribute_group.2 : L''intersection de caract\u00E8res g\u00E9n\u00E9riques ne peut pas \u00EAtre exprim\u00E9e pour le groupe d''attribut ''{0}''.
- src-attribute_group.3 = src-attribute_group.3 : D\u00E9finitions circulaires d\u00E9tect\u00E9es pour le groupe d''attribut ''{0}''. Le suivi r\u00E9cursif des r\u00E9f\u00E9rences de groupe d''attribut conduit \u00E0 lui-m\u00EAme.
- src-ct.1 = src-ct.1 : Erreur de repr\u00E9sentation de la d\u00E9finition de type complexe pour le type ''{0}''. Lorsque <complexContent> est utilis\u00E9, le type de base doit \u00EAtre complexType. ''{1}'' est simpleType.
- src-ct.2.1 = src-ct.2.1 : Erreur de repr\u00E9sentation de la d\u00E9finition de type complexe pour le type ''{0}''. Lorsque <simpleContent> est utilis\u00E9, le type de base doit \u00EAtre complexType avec un type de contenu simple. Si une restriction est indiqu\u00E9e, il peut s''agir d''un type complexe avec un contenu mixte et une particule pouvant \u00EAtre vide ou, si une extension est indiqu\u00E9e, d''un type simple. ''{1}'' ne respecte aucune de ces conditions.
- src-ct.2.2 = src-ct.2.2 : Erreur de repr\u00E9sentation de la d\u00E9finition de type complexe pour le type ''{0}''. Lorsqu''un complexType avec un simpleContent restreint un complexType comportant un contenu mixte et une particule pouvant \u00EAtre vide, un <simpleType> doit figurer parmi les enfants de <restriction>.
- src-ct.4 = src-ct.4 : Erreur de repr\u00E9sentation de la d\u00E9finition de type complexe pour le type ''{0}''. L''intersection de caract\u00E8res g\u00E9n\u00E9riques ne peut pas \u00EAtre exprim\u00E9e.
- src-ct.5 = src-ct.5 : Erreur de repr\u00E9sentation de la d\u00E9finition de type complexe pour le type ''{0}''. L''union de caract\u00E8res g\u00E9n\u00E9riques ne peut pas \u00EAtre exprim\u00E9e.
- src-element.1 = src-element.1 : Les propri\u00E9t\u00E9s ''default'' et ''fixed'' ne peuvent pas figurer simultan\u00E9ment dans la d\u00E9claration d''\u00E9l\u00E9ment ''{0}''. Utilisez uniquement l''une d''entre elles.
- src-element.2.1 = src-element.2.1 : 'ref' ou 'name' doit figurer dans les d\u00E9clarations d'\u00E9l\u00E9ment local.
- src-element.2.2 = src-element.2.2 : Puisque ''{0}'' contient l''attribut ''ref'', son contenu doit concorder avec (annotation?). Cependant, ''{1}'' a \u00E9t\u00E9 trouv\u00E9.
- src-element.3 = src-element.3 : L''\u00E9l\u00E9ment ''{0}'' pr\u00E9sente un attribut ''type'' et un enfant ''anonymous type''. Seul un d''entre eux est autoris\u00E9 dans un \u00E9l\u00E9ment.
- src-import.1.1 = src-import.1.1 : L''attribut namespace "{0}" d''un \u00E9l\u00E9ment d''information d''\u00E9l\u00E9ment <import> ne doit pas \u00EAtre identique \u00E0 l''attribut targetNamespace du sch\u00E9ma dans lequel il figure.
- src-import.1.2 = src-import.1.2 : Si l'attribut namespace ne figure pas dans un \u00E9l\u00E9ment d'information d'\u00E9l\u00E9ment <import>, le sch\u00E9ma englobant doit avoir un attribut targetNamespace.
- src-import.2 = src-import.2 : L''\u00E9l\u00E9ment racine du document ''{0}'' doit avoir le nom d''espace de noms ''http://www.w3.org/2001/XMLSchema'' et le nom local ''schema''.
- src-import.3.1 = src-import.3.1 : L''attribut namespace "{0}" d''un \u00E9l\u00E9ment d''information d''\u00E9l\u00E9ment <import> doit \u00EAtre identique \u00E0 l''attribut targetNamespace ''{1}'' du document import\u00E9.
- src-import.3.2 = src-import.3.2 : Un \u00E9l\u00E9ment d''information d''\u00E9l\u00E9ment <import> sans attribut namespace a \u00E9t\u00E9 trouv\u00E9. Le document import\u00E9 ne peut donc pas avoir un attribut targetNamespace. Cependant, l''attribut targetNamespace ''{1}'' a \u00E9t\u00E9 trouv\u00E9 dans le document import\u00E9.
- src-include.1 = src-include.1 : L''\u00E9l\u00E9ment racine du document ''{0}'' doit avoir le nom d''espace de noms ''http://www.w3.org/2001/XMLSchema'' et le nom local ''schema''.
- src-include.2.1 = src-include.2.1: L''attribut targetNamespace du sch\u00E9ma r\u00E9f\u00E9renc\u00E9, actuellement ''{1}'', doit \u00EAtre identique \u00E0 celui du sch\u00E9ma d''inclusion, actuellement ''{0}''.
- src-redefine.2 = src-redefine.2 : L''\u00E9l\u00E9ment racine du document ''{0}'' doit avoir le nom d''espace de noms ''http://www.w3.org/2001/XMLSchema'' et le nom local ''schema''.
- src-redefine.3.1 = src-redefine.3.1 : L''attribut targetNamespace du sch\u00E9ma r\u00E9f\u00E9renc\u00E9, actuellement ''{1}'', doit \u00EAtre identique \u00E0 celui du sch\u00E9ma de red\u00E9finition, actuellement ''{0}''.
- src-redefine.5.a.a = src-redefine.5.a.a : Aucun enfant de non-annotation de <simpleType> n'a \u00E9t\u00E9 trouv\u00E9. Les enfants <simpleType> des \u00E9l\u00E9ments <redefine> doivent comporter des descendants <restriction>, avec des attributs "base" faisant r\u00E9f\u00E9rence \u00E0 eux-m\u00EAmes.
- src-redefine.5.a.b = src-redefine.5.a.b : ''{0}'' n''est pas un \u00E9l\u00E9ment enfant valide. Les enfants <simpleType> des \u00E9l\u00E9ments <redefine> doivent comporter des descendants <restriction>, avec des attributs ''base'' faisant r\u00E9f\u00E9rence \u00E0 eux-m\u00EAmes.
- src-redefine.5.a.c = src-redefine.5.a.c : ''{0}'' ne comporte pas d''attribut ''base'' faisant r\u00E9f\u00E9rence \u00E0 l''\u00E9l\u00E9ment red\u00E9fini, ''{1}''. Les enfants <simpleType> des \u00E9l\u00E9ments <redefine> doivent comporter des descendants <restriction>, avec des attributs ''base'' faisant r\u00E9f\u00E9rence \u00E0 eux-m\u00EAmes.
- src-redefine.5.b.a = src-redefine.5.b.a : Aucun enfant de non-annotation de <complexType> n'a \u00E9t\u00E9 trouv\u00E9. Les enfants <complexType> des \u00E9l\u00E9ments <redefine> doivent comporter des descendants <extension> ou <restriction>, avec des attributs "base" faisant r\u00E9f\u00E9rence \u00E0 eux-m\u00EAmes.
- src-redefine.5.b.b = src-redefine.5.b.b : Aucun petit-enfant de non-annotation de <complexType> n'a \u00E9t\u00E9 trouv\u00E9. Les enfants <complexType> des \u00E9l\u00E9ments <redefine> doivent comporter des descendants <extension> ou <restriction>, avec des attributs "base" faisant r\u00E9f\u00E9rence \u00E0 eux-m\u00EAmes.
- src-redefine.5.b.c = src-redefine.5.b.c : ''{0}'' n''est pas un \u00E9l\u00E9ment petit-enfant valide. Les enfants <complexType> des \u00E9l\u00E9ments <redefine> doivent comporter des descendants <extension> ou <restriction>, avec des attributs ''base'' faisant r\u00E9f\u00E9rence \u00E0 eux-m\u00EAmes.
- src-redefine.5.b.d = src-redefine.5.b.d : ''{0}'' ne comporte pas d''attribut ''base'' faisant r\u00E9f\u00E9rence \u00E0 l''\u00E9l\u00E9ment red\u00E9fini, ''{1}''. Les enfants <complexType> des \u00E9l\u00E9ments <redefine> doivent comporter des descendants <extension> ou<restriction>, avec des attributs ''base'' faisant r\u00E9f\u00E9rence \u00E0 eux-m\u00EAmes.
- src-redefine.6.1.1 = src-redefine.6.1.1 : Si un enfant de groupe d''un \u00E9l\u00E9ment <redefine> contient un groupe faisant r\u00E9f\u00E9rence \u00E0 lui-m\u00EAme, il ne doit en comporter qu''un seul ; celui-ci en comporte ''{0}''.
- src-redefine.6.1.2 = src-redefine.6.1.2 : Le groupe ''{0}'' qui contient une r\u00E9f\u00E9rence \u00E0 un groupe en cours de red\u00E9finition doit respecter la condition ''minOccurs'' = ''maxOccurs'' = 1.
- src-redefine.6.2.1 = src-redefine.6.2.1 : Aucun groupe dans le sch\u00E9ma red\u00E9fini ne comporte un nom concordant avec ''{0}''.
- src-redefine.6.2.2 = src-redefine.6.2.2 : Le groupe ''{0}'' ne restreint pas correctement le groupe qu''il red\u00E9finit ; contrainte viol\u00E9e : ''{1}''.
- src-redefine.7.1 = src-redefine.7.1 : Si un enfant attributeGroup d''un \u00E9l\u00E9ment <redefine> contient un \u00E9l\u00E9ment attributeGroup faisant r\u00E9f\u00E9rence \u00E0 lui-m\u00EAme, il ne doit en comporter qu''un seul ; celui-ci en comporte {0}.
- src-redefine.7.2.1 = src-redefine.7.2.1 : Aucun \u00E9l\u00E9ment attributeGroup dans le sch\u00E9ma red\u00E9fini ne comporte un nom concordant avec ''{0}''.
- src-redefine.7.2.2 = src-redefine.7.2.2 : L''\u00E9l\u00E9ment attributeGroup ''{0}'' ne restreint pas correctement l''\u00E9l\u00E9ment attributeGroup qu''il red\u00E9finit ; contrainte viol\u00E9e : ''{1}''.
- src-resolve = src-resolve : Impossible de r\u00E9soudre le nom ''{0}'' en un composant ''{1}''.
- src-resolve.4.1 = src-resolve.4.1 : Erreur lors de la r\u00E9solution du composant ''{2}''. ''{2}'' ne comporte pas d''espace de noms, mais les composants sans espace de noms ne peuvent pas \u00EAtre r\u00E9f\u00E9renc\u00E9s \u00E0 partir du document de sch\u00E9ma ''{0}''. Si ''{2}'' doit avoir un espace de noms, un pr\u00E9fixe doit \u00E9ventuellement \u00EAtre indiqu\u00E9. Si ''{2}'' ne doit pas avoir d''espace de noms, une balise ''import'' sans un attribut "namespace" doit \u00EAtre ajout\u00E9e \u00E0 ''{0}''.
- src-resolve.4.2 = src-resolve.4.2 : Erreur lors de la r\u00E9solution du composant ''{2}''. ''{2}'' se trouve dans l''espace de noms ''{1}'', mais les composants de cet espace de noms ne peuvent pas \u00EAtre r\u00E9f\u00E9renc\u00E9s \u00E0 partir du document de sch\u00E9ma ''{0}''. S''il s''agit d''un espace de noms incorrect, le pr\u00E9fixe de ''{2}'' doit \u00E9ventuellement \u00EAtre modifi\u00E9. S''il est correct, une balise ''import'' appropri\u00E9e doit \u00EAtre ajout\u00E9e \u00E0 ''{0}''.
- src-simple-type.2.a = src-simple-type.2.a : Un \u00E9l\u00E9ment <restriction> a \u00E9t\u00E9 trouv\u00E9 avec une valeur [attribute] de base et un \u00E9l\u00E9ment <simpleType> parmi ses enfants ([children]). Un seul de ces \u00E9l\u00E9ments est autoris\u00E9.
- src-simple-type.2.b = src-simple-type.2.b : Un \u00E9l\u00E9ment <restriction> a \u00E9t\u00E9 trouv\u00E9 sans valeur [attribute] de base ni \u00E9l\u00E9ment <simpleType> parmi ses enfants ([children]). Un de ces \u00E9l\u00E9ments est obligatoire.
- src-simple-type.3.a = src-simple-type.3.a : Un \u00E9l\u00E9ment <list> a \u00E9t\u00E9 trouv\u00E9 avec une valeur [attribute] itemType ou un \u00E9l\u00E9ment <simpleType> parmi ses enfants ([children]). Un seul de ces \u00E9l\u00E9ments est autoris\u00E9.
- src-simple-type.3.b = src-simple-type.3.b : Un \u00E9l\u00E9ment <list> a \u00E9t\u00E9 trouv\u00E9 sans valeur [attribute] itemType ni \u00E9l\u00E9ment <simpleType> parmi ses enfants ([children]). Un de ces \u00E9l\u00E9ments est obligatoire.
- src-single-facet-value = src-single-facet-value : Le facet ''{0}'' est d\u00E9fini plusieurs fois.
- src-union-memberTypes-or-simpleTypes = src-union-memberTypes-or-simpleTypes : Un \u00E9l\u00E9ment <union> doit avoir une valeur [attribute] memberTypes non vide ou au moins un \u00E9l\u00E9ment <simpleType> parmi ses enfants ([children]).
-
-#constraint valid (3.X.6)
-
- ag-props-correct.2 = ag-props-correct.2 : Erreur dans le groupe d''attributs ''{0}''. Des occurrences d''attributs en double avec un nom et un espace de noms cible identiques sont indiqu\u00E9es. Le nom de l''occurrence d''attribut en double est ''{1}''.
- ag-props-correct.3 = ag-props-correct.3 : Erreur dans le groupe d''attributs ''{0}''. Deux d\u00E9clarations d''attribut, ''{1}'' et ''{2}'', ont des types d\u00E9riv\u00E9s de l''ID.
- a-props-correct.2 = a-props-correct.2 : Valeur de contrainte de valeur ''{1}'' non valide dans l''attribut ''{0}''.
- a-props-correct.3 = a-props-correct.3 : L''attribut ''{0}'' ne peut pas utiliser ''fixed'' ou ''default'', car sa valeur '{'type definition'}' est identique \u00E0 l''ID ou en est d\u00E9riv\u00E9e.
- au-props-correct.2 = au-props-correct.2 : Dans la d\u00E9claration d''attribut de ''{0}'', la valeur fixe ''{1}'' a \u00E9t\u00E9 indiqu\u00E9e. Par cons\u00E9quent, si l''occurrence de l''attribut faisant r\u00E9f\u00E9rence \u00E0 ''{0}'' comporte \u00E9galement '{'value constraint'}', celle-ci doit \u00EAtre fixe et sa valeur doit \u00EAtre ''{1}''.
- cos-all-limited.1.2 = cos-all-limited.1.2 : Un groupe de mod\u00E8les 'all' doit figurer dans une particule o\u00F9 '{'min occurs'}' = '{'max occurs'}' = 1. Cette particule doit en outre faire partie d'une paire constituant la valeur '{'content type'}' d'une d\u00E9finition de type complexe.
- cos-all-limited.2 = cos-all-limited.2 : La valeur '{'max occurs'}' d''un \u00E9l\u00E9ment dans un groupe de mod\u00E8les ''all'' doit \u00EAtre 0 ou 1. La valeur ''{0}'' pour l''\u00E9l\u00E9ment ''{1}'' n''est pas valide.
- cos-applicable-facets = cos-applicable-facets : Le facet ''{0}'' n''est pas autoris\u00E9 pour le type {1}.
- cos-ct-extends.1.1 = cos-ct-extends.1.1 : Le type ''{0}'' est d\u00E9riv\u00E9 par l''extension du type ''{1}''. Toutefois, l''attribut ''final'' de ''{1}'' n''autorise pas la d\u00E9rivation par extension.
- cos-ct-extends.1.4.3.2.2.1.a = cos-ct-extends.1.4.3.2.2.1.a : Le type de contenu d''un type d\u00E9riv\u00E9 et celui de sa base doivent tous les deux \u00EAtre mixtes (mixed) ou \u00E9l\u00E9ment uniquement (element-only). Le type ''{0}'' est \u00E9l\u00E9ment uniquement, mais le type de sa base ne l''est pas.
- cos-ct-extends.1.4.3.2.2.1.b = cos-ct-extends.1.4.3.2.2.1.b : Le type de contenu d''un type d\u00E9riv\u00E9 et celui de sa base doivent tous les deux \u00EAtre mixtes (mixed) ou \u00E9l\u00E9ment uniquement (element-only). Le type ''{0}'' est mixte, mais le type de sa base ne l''est pas.
- cos-element-consistent = cos-element-consistent : Erreur dans le type ''{0}''. Plusieurs \u00E9l\u00E9ments portant le nom ''{1}'', de divers types, figurent dans le groupe de mod\u00E8les.
- cos-list-of-atomic = cos-list-of-atomic : Dans la d\u00E9finition du type de liste ''{0}'', le type ''{1}'' est un type d''\u00E9l\u00E9ment de liste non valide car il n''est pas atomique (''{1}'' est un type de liste ou un type d''union contenant une liste).
- cos-nonambig = cos-nonambig : {0} et {1} (ou des \u00E9l\u00E9ments de leur groupe de substitution) violent la r\u00E8gle d''attribution de particule unique (Unique Particle Attribution). Au cours de la validation par rapport \u00E0 ce sch\u00E9ma, ces deux particules peuvent devenir ambigu\u00EBs.
- cos-particle-restrict.a = cos-particle-restrict.a : La particule d\u00E9riv\u00E9e est vide et la base ne peut pas \u00EAtre vide.
- cos-particle-restrict.b = cos-particle-restrict.b : La particule de base est vide, mais la particule d\u00E9riv\u00E9e ne l'est pas.
- cos-particle-restrict.2 = cos-particle-restrict.2 : Restriction de particule interdite : ''{0}''.
- cos-st-restricts.1.1 = cos-st-restricts.1.1 : Le type ''{1}'' \u00E9tant non d\u00E9composable, sa valeur '{'base type definition'}', ''{0}'', doit \u00EAtre une d\u00E9finition de type simple atomique ou un type de donn\u00E9es primitif int\u00E9gr\u00E9.
- cos-st-restricts.2.1 = cos-st-restricts.2.1 : Dans la d\u00E9finition du type de liste ''{0}'', le type ''{1}'' est un type d''\u00E9l\u00E9ment non valide car il s''agit d''un type de liste ou un type d''union contenant une liste.
- cos-st-restricts.2.3.1.1 = cos-st-restricts.2.3.1.1 : Le composant '{'final'}' de la valeur '{'item type definition'}', ''{0}'', contient ''list''. Cela signifie que la valeur ''{0}'' ne peut pas \u00EAtre utilis\u00E9e en tant que type d''\u00E9l\u00E9ment pour le type de liste ''{1}''.
- cos-st-restricts.3.3.1.1 = cos-st-restricts.3.3.1.1 : Le composant '{'final'}' de la valeur '{'member type definitions'}', ''{0}'', contient ''union''. Cela signifie que la valeur ''{0}'' ne peut pas \u00EAtre utilis\u00E9e en tant que type de membre pour le type d''union ''{1}''.
- cos-valid-default.2.1 = cos-valid-default.2.1 : L''\u00E9l\u00E9ment ''{0}'' comporte une contrainte de valeur et doit disposer d''un mod\u00E8le de contenu mixte ou simple.
- cos-valid-default.2.2.2 = cos-valid-default.2.2.2 : Puisque l''\u00E9l\u00E9ment ''{0}'' comporte une valeur '{'value constraint'}' et que sa d\u00E9finition de type a la valeur '{'content type'}' mixte, la particule de '{'content type'}' doit pouvoir \u00EAtre vide.
- c-props-correct.2 = c-props-correct.2 : La cardinalit\u00E9 des champs pour les valeurs keyref ''{0}'' et key ''{1}'' doit concorder.
- ct-props-correct.3 = ct-props-correct.3 : D\u00E9finitions circulaires d\u00E9tect\u00E9es pour le type complexe ''{0}''. Cela signifie que ''{0}'' est contenu dans sa propre hi\u00E9rarchie des types, ce qui est une erreur.
- ct-props-correct.4 = ct-props-correct.4 : Erreur dans le type ''{0}''. Des occurrences d''attributs en double avec un nom et un espace de noms cible identiques sont indiqu\u00E9es. Le nom de l''occurrence d''attribut en double est ''{1}''.
- ct-props-correct.5 = ct-props-correct.5 : Erreur dans le type ''{0}''. Deux d\u00E9clarations d''attribut, ''{1}'' et ''{2}'', ont des types d\u00E9riv\u00E9s de l''ID.
- derivation-ok-restriction.1 = derivation-ok-restriction.1 : Le type ''{0}'' a \u00E9t\u00E9 d\u00E9riv\u00E9 par restriction du type ''{1}''. Cependant, ''{1}'' comporte une propri\u00E9t\u00E9 '{'final'}' interdisant la d\u00E9rivation par restriction.
- derivation-ok-restriction.2.1.1 = derivation-ok-restriction.2.1.1 : Erreur dans le type ''{0}''. L''occurrence d''attribut ''{1}'' dans ce type comporte une valeur ''use'' de ''{2}'', ce qui est incoh\u00E9rent avec la valeur ''required'' dans une occurrence d''attribut correspondante dans le type de base.
- derivation-ok-restriction.2.1.2 = derivation-ok-restriction.2.1.2 : Erreur dans le type ''{0}''. L''occurrence d''attribut ''{1}'' dans ce type comporte le type ''{2}'', dont la d\u00E9rivation \u00E0 partir de ''{3}'', le type de l''occurrence d''attribut correspondante dans le type de base, n''est pas valide.
- derivation-ok-restriction.2.1.3.a = derivation-ok-restriction.2.1.3.a : Erreur dans le type ''{0}''. L''occurrence d''attribut ''{1}'' dans ce type comporte une contrainte de valeur effective qui n''est pas fixe, et la contrainte de valeur effective de l''occurrence d''attribut correspondante dans le type de base est fixe.
- derivation-ok-restriction.2.1.3.b = derivation-ok-restriction.2.1.3.b : Erreur dans le type ''{0}''. L''occurrence d''attribut ''{1}'' dans ce type comporte une contrainte de valeur effective fixe ayant une valeur de ''{2}'', ce qui n''est pas coh\u00E9rent avec la valeur de ''{3}'' pour la contrainte de valeur effective fixe de l''occurrence d''attribut correspondante dans le type de base.
- derivation-ok-restriction.2.2.a = derivation-ok-restriction.2.2.a : Erreur dans le type ''{0}''. L''occurrence d''attribut ''{1}'' dans ce type ne comporte pas d''occurrence d''attribut correspondante dans la base, et le type de base ne poss\u00E8de pas d''attribut de caract\u00E8re g\u00E9n\u00E9rique.
- derivation-ok-restriction.2.2.b = derivation-ok-restriction.2.2.b : Erreur dans le type ''{0}''. L''occurrence d''attribut ''{1}'' dans ce type ne comporte pas d''occurrence d''attribut correspondante dans la base, et le caract\u00E8re g\u00E9n\u00E9rique dans le type de base n''accepte pas l''espace de noms ''{2}'' de cette occurrence d''attribut.
- derivation-ok-restriction.3 = derivation-ok-restriction.3 : Erreur dans le type ''{0}''. Le param\u00E8tre REQUIRED de l''occurrence d''attribut ''{1}'' du type de base a la valeur True, mais il n''existe aucune occurrence d''attribut correspondante dans le type d\u00E9riv\u00E9.
- derivation-ok-restriction.4.1 = derivation-ok-restriction.4.1 : Erreur dans le type ''{0}''. La d\u00E9rivation comporte un caract\u00E8re g\u00E9n\u00E9rique d''attribut mais le type de base n''en a pas.
- derivation-ok-restriction.4.2 = derivation-ok-restriction.4.2 : Erreur dans le type ''{0}''. Le caract\u00E8re g\u00E9n\u00E9rique de la d\u00E9rivation n''est pas un sous-ensemble de caract\u00E8res g\u00E9n\u00E9riques valide de celui du type de base.
- derivation-ok-restriction.4.3 = derivation-ok-restriction.4.3 : Erreur dans le type ''{0}''. Le contenu de processus du caract\u00E8re g\u00E9n\u00E9rique de la d\u00E9rivation ({1}) est plus faible que celui du type de base ({2}).
- derivation-ok-restriction.5.2.2.1 = derivation-ok-restriction.5.2.2.1 : Erreur dans le type ''{0}''. Le type de contenu simple de ce type, ''{1}'', n''est pas une restriction valide du type de contenu simple du type de base, ''{2}''.
- derivation-ok-restriction.5.3.2 = derivation-ok-restriction.5.3.2 : Erreur dans le type ''{0}''. Le type de contenu de ce type est vide, mais le type de contenu du type de base, ''{1}'', n''est pas vide ou ne peut pas \u00EAtre vide.
- derivation-ok-restriction.5.4.1.2 = derivation-ok-restriction.5.4.1.2 : Erreur dans le type ''{0}''. Le type de contenu de ce type est mixte, mais le type de contenu du type de base, ''{1}'', ne l''est pas.
- derivation-ok-restriction.5.4.2 = derivation-ok-restriction.5.4.2 : Erreur dans le type ''{0}''. La particule du type n''est pas une restriction valide de la particule du type de base.
- enumeration-required-notation = enumeration-required-notation : Le type NOTATION, ''{0}'' utilis\u00E9 par {2} ''{1}'', doit comporter une valeur de facet d''\u00E9num\u00E9ration indiquant les \u00E9l\u00E9ments de notation utilis\u00E9s par ce type.
- enumeration-valid-restriction = enumeration-valid-restriction : La valeur d''\u00E9num\u00E9ration ''{0}'' n''est pas comprise l''espace de valeurs du type de base, {1}.
- e-props-correct.2 = e-props-correct.2 : Valeur de contrainte de valeur ''{1}'' non valide dans l''\u00E9l\u00E9ment ''{0}''.
- e-props-correct.4 = e-props-correct.4 : La valeur '{'type definition'}' de l''\u00E9l\u00E9ment ''{0}'' n''est pas d\u00E9riv\u00E9e de fa\u00E7on valide \u00E0 partir de la valeur '{'type definition'}' de l''\u00E9l\u00E9ment substitutionHead ''{1}'', ou la propri\u00E9t\u00E9 '{'substitution group exclusions'}' de ''{1}'' n''accepte pas cette d\u00E9rivation.
- e-props-correct.5 = e-props-correct.5 : Une valeur '{'value constraint'}' ne doit pas figurer dans l''\u00E9l\u00E9ment ''{0}'', car sa valeur '{'type definition'}' ou le '{'content type'}' de sa valeur '{'type definition'}' est identique \u00E0 l''ID ou en est d\u00E9riv\u00E9.
- e-props-correct.6 = e-props-correct.6 : Groupe de substitution circulaire d\u00E9tect\u00E9 pour \u00E9l\u00E9ment ''{0}''.
- fractionDigits-valid-restriction = fractionDigits-valid-restriction : Dans la d\u00E9finition de {2}, la valeur ''{0}'' pour le facet ''fractionDigits'' n''est pas valide car elle doit \u00EAtre <= \u00E0 la valeur de ''fractionDigits'', qui a \u00E9t\u00E9 d\u00E9finie sur ''{1}'' dans l''un des types d''anc\u00EAtre.
- fractionDigits-totalDigits = fractionDigits-totalDigits : Dans la d\u00E9finition de {2}, la valeur ''{0}'' pour le facet ''fractionDigits'' n''est pas valide car elle doit \u00EAtre <= \u00E0 la valeur de ''totalDigits'', d\u00E9finie sur ''{1}''.
- length-minLength-maxLength.1.1 = length-minLength-maxLength.1.1 : Pour le type {0}, si la valeur de longueur ''{1}'' est inf\u00E9rieure \u00E0 la valeur de minLength ''{2}'', une erreur est g\u00E9n\u00E9r\u00E9e.
- length-minLength-maxLength.1.2.a = length-minLength-maxLength.1.2.a : Pour le type {0}, une erreur est g\u00E9n\u00E9r\u00E9e si le type de base ne comporte pas un facet minLength lorsque la restriction en cours comporte le facet minLength, et que la restriction ou le type de base en cours comporte le facet de longueur.
- length-minLength-maxLength.1.2.b = length-minLength-maxLength.1.2.b : Pour le type {0}, si la valeur de minLength en cours ''{1}'' n''est pas \u00E9gale \u00E0 la valeur de minLength de base ''{2}'', une erreur est g\u00E9n\u00E9r\u00E9e.
- length-minLength-maxLength.2.1 = length-minLength-maxLength.2.1 : Pour le type {0}, si la valeur de longueur ''{1}'' est sup\u00E9rieure \u00E0 la valeur de maxLength ''{2}'', une erreur est g\u00E9n\u00E9r\u00E9e.
- length-minLength-maxLength.2.2.a = length-minLength-maxLength.2.2.a : Pour le type {0}, une erreur est g\u00E9n\u00E9r\u00E9e si le type de base ne comporte pas un facet maxLength lorsque la restriction en cours comporte le facet maxLength, et que la restriction ou le type de base en cours comporte le facet de longueur.
- length-minLength-maxLength.2.2.b = length-minLength-maxLength.2.2.b : Pour le type {0}, si la valeur maxLength en cours ''{1}'' n''est pas \u00E9gale \u00E0 la valeur maxLength de base ''{2}'', une erreur est g\u00E9n\u00E9r\u00E9e.
- length-valid-restriction = length-valid-restriction : Erreur dans le type ''{2}''. La valeur de longueur ''{0}'' doit \u00EAtre \u00E9gale \u00E0 la celle du type de base ''{1}''.
- maxExclusive-valid-restriction.1 = maxExclusive-valid-restriction.1 : Erreur dans le type ''{2}''. La valeur maxExclusive ''{0}'' doit \u00EAtre <= \u00E0 la valeur maxExclusive du type de base ''{1}''.
- maxExclusive-valid-restriction.2 = maxExclusive-valid-restriction.2 : Erreur dans le type ''{2}''. La valeur maxExclusive ''{0}'' doit \u00EAtre <= \u00E0 la valeur maxInclusive du type de base ''{1}''.
- maxExclusive-valid-restriction.3 = maxExclusive-valid-restriction.3 : Erreur dans le type ''{2}''. La valeur maxExclusive ''{0}'' doit \u00EAtre > \u00E0 la valeur minInclusive du type de base ''{1}''.
- maxExclusive-valid-restriction.4 = maxExclusive-valid-restriction.4 : Erreur dans le type ''{2}''. La valeur maxExclusive ''{0}'' doit \u00EAtre > \u00E0 la valeur minExclusive du type de base ''{1}''.
- maxInclusive-maxExclusive = maxInclusive-maxExclusive : Vous ne pouvez pas indiquer \u00E0 la fois maxInclusive et maxExclusive pour le m\u00EAme type de donn\u00E9es. Dans {2}, maxInclusive = ''{0}'' et maxExclusive = ''{1}''.
- maxInclusive-valid-restriction.1 = maxInclusive-valid-restriction.1 : Erreur dans le type ''{2}''. La valeur maxInclusive ''{0}'' doit \u00EAtre <= \u00E0 la valeur maxInclusive du type de base ''{1}''.
- maxInclusive-valid-restriction.2 = maxInclusive-valid-restriction.2 : Erreur dans le type ''{2}''. La valeur maxInclusive ''{0}'' doit \u00EAtre < \u00E0 la valeur maxExclusive du type de base ''{1}''.
- maxInclusive-valid-restriction.3 = maxInclusive-valid-restriction.3 : Erreur dans le type ''{2}''. La valeur maxInclusive ''{0}'' doit \u00EAtre >= \u00E0 la valeur minInclusive du type de base ''{1}''.
- maxInclusive-valid-restriction.4 = maxInclusive-valid-restriction.4 : Erreur dans le type ''{2}''. La valeur maxInclusive ''{0}'' doit \u00EAtre > \u00E0 la valeur minExclusive du type de base ''{1}''.
- maxLength-valid-restriction = maxLength-valid-restriction : Dans la d\u00E9finition de {2}, la valeur maxLength ''{0}'' doit \u00EAtre <= \u00E0 celle du type de base ''{1}''.
- mg-props-correct.2 = mg-props-correct.2 : D\u00E9finitions circulaires d\u00E9tect\u00E9es pour le groupe ''{0}''. Le suivi r\u00E9cursif des valeurs '{'term'}' des particules conduit \u00E0 une particule o\u00F9 '{'term'}' est le groupe proprement dit.
- minExclusive-less-than-equal-to-maxExclusive = minExclusive-less-than-equal-to-maxExclusive : Dans la d\u00E9finition de {2}, la valeur minExclusive ''{0}'' doit \u00EAtre <= \u00E0 la valeur maxExclusive ''{1}''.
- minExclusive-less-than-maxInclusive = minExclusive-less-than-maxInclusive : Dans la d\u00E9finition de {2}, la valeur minExclusive ''{0}'' doit \u00EAtre < \u00E0 la valeur maxInclusive ''{1}''.
- minExclusive-valid-restriction.1 = minExclusive-valid-restriction.1 : Erreur dans le type ''{2}''. La valeur minExclusive ''{0}'' doit \u00EAtre >= \u00E0 la valeur minExclusive du type de base ''{1}''.
- minExclusive-valid-restriction.2 = minExclusive-valid-restriction.2 : Erreur dans le type ''{2}''. La valeur minExclusive ''{0}'' doit \u00EAtre <= \u00E0 la valeur maxInclusive du type de base ''{1}''.
- minExclusive-valid-restriction.3 = minExclusive-valid-restriction.3 : Erreur dans le type ''{2}''. La valeur minExclusive ''{0}'' doit \u00EAtre >= \u00E0 la valeur minInclusive du type de base ''{1}''.
- minExclusive-valid-restriction.4 = minExclusive-valid-restriction.4 : Erreur dans le type ''{2}''. La valeur minExclusive ''{0}'' doit \u00EAtre < \u00E0 la valeur maxExclusive du type de base ''{1}''.
- minInclusive-less-than-equal-to-maxInclusive = minInclusive-less-than-equal-to-maxInclusive : Dans la d\u00E9finition de {2}, la valeur minInclusive ''{0}'' doit \u00EAtre <= \u00E0 la valeur maxInclusive ''{1}''.
- minInclusive-less-than-maxExclusive = minInclusive-less-than-maxExclusive : Dans la d\u00E9finition de {2}, la valeur minInclusive ''{0}'' doit \u00EAtre < \u00E0 la valeur maxExclusive ''{1}''.
- minInclusive-minExclusive = minInclusive-minExclusive : Vous ne pouvez pas indiquer \u00E0 la fois minInclusive et minExclusive pour le m\u00EAme type de donn\u00E9es. Dans {2}, minInclusive = ''{0}'' et minExclusive = ''{1}''.
- minInclusive-valid-restriction.1 = minInclusive-valid-restriction.1 : Erreur dans le type ''{2}''. La valeur minInclusive ''{0}'' doit \u00EAtre >= \u00E0 la valeur minInclusive du type de base ''{1}''.
- minInclusive-valid-restriction.2 = minInclusive-valid-restriction.2 : Erreur dans le type ''{2}''. La valeur minInclusive ''{0}'' doit \u00EAtre <= \u00E0 la valeur maxInclusive du type de base ''{1}''.
- minInclusive-valid-restriction.3 = minInclusive-valid-restriction.3 : Erreur dans le type ''{2}''. La valeur minInclusive ''{0}'' doit \u00EAtre > \u00E0 la valeur minExclusive du type de base ''{1}''.
- minInclusive-valid-restriction.4 = minInclusive-valid-restriction.4 : Erreur dans le type ''{2}''. La valeur minInclusive ''{0}'' doit \u00EAtre < \u00E0 la valeur maxExclusive du type de base ''{1}''.
- minLength-less-than-equal-to-maxLength = minLength-less-than-equal-to-maxLength: Dans la d\u00E9finition de {2}, la valeur de minLength ''{0}'' doit \u00EAtre < \u00E0 la valeur de maxLength ''{1}''.
- minLength-valid-restriction = minLength-valid-restriction : Dans la d\u00E9finition de {2}, la valeur de minLength ''{0}'' doit \u00EAtre >= \u00E0 celle du type de base, ''{1}''.
- no-xmlns = no-xmlns : La valeur {name} d'une d\u00E9claration d'attribut ne doit pas \u00EAtre identique \u00E0 'xmlns'.
- no-xsi = no-xsi : La valeur '{'target namespace'}' d''une d\u00E9claration d''attribut ne doit pas \u00EAtre identique \u00E0 ''{0}''.
- p-props-correct.2.1 = p-props-correct.2.1 : Dans la d\u00E9claration de ''{0}'', la valeur de ''minOccurs'' est ''{1}'', mais elle ne doit pas \u00EAtre sup\u00E9rieure \u00E0 la valeur de ''maxOccurs'', qui est ''{2}''.
- rcase-MapAndSum.1 = rcase-MapAndSum.1 : Aucune mise en correspondance fonctionnelle compl\u00E8te entre les particules.
- rcase-MapAndSum.2 = rcase-MapAndSum.2 : La plage d''occurrences du groupe, ({0},{1}), n''est pas une restriction valide de la plage d''occurrences du groupe de base, ({2},{3}).
- rcase-NameAndTypeOK.1 = rcase-NameAndTypeOK.1 : Les \u00E9l\u00E9ments ont des noms (name) et des espaces de noms cible (target namespace) diff\u00E9rents : \u00E9l\u00E9ment "{0}" dans l''espace de noms "{1}" et \u00E9l\u00E9ment ''{2}'' dans l''espace de noms ''{3}''.
- rcase-NameAndTypeOK.2 = rcase-NameAndTypeOK.2 : Erreur dans la particule o\u00F9 la valeur '{'term'}' est la d\u00E9claration d''\u00E9l\u00E9ment ''{0}''. La valeur '{'nillable'}' de la d\u00E9claration d''\u00E9l\u00E9ment est True, mais la particule correspondante dans le type de base comporte une d\u00E9claration d''\u00E9l\u00E9ment o\u00F9 la valeur '{'nillable'}' est False.
- rcase-NameAndTypeOK.3 = rcase-NameAndTypeOK.3 : Erreur dans la particule o\u00F9 la valeur '{'term'}' est la d\u00E9claration d''\u00E9l\u00E9ment ''{0}''. Sa plage d''occurrences, ({1},{2}), n''est pas une restriction valide de la plage ({3},{4}) de la particule correspondante dans le type de base.
- rcase-NameAndTypeOK.4.a = rcase-NameAndTypeOK.4.a : L''\u00E9l\u00E9ment ''{0}'' n''est pas fixe, mais l''\u00E9l\u00E9ment correspondant dans le type de base est fixe avec la valeur ''{1}''.
- rcase-NameAndTypeOK.4.b = rcase-NameAndTypeOK.4.b : L''\u00E9l\u00E9ment ''{0}'' est fixe avec la valeur ''{1}'', mais l''\u00E9l\u00E9ment correspondant dans le type de base est fixe avec la valeur ''{2}''.
- rcase-NameAndTypeOK.5 = rcase-NameAndTypeOK.5 : Les contraintes d''identit\u00E9 de l''\u00E9l\u00E9ment "{0}" ne sont pas un sous-ensemble de celles de la base.
- rcase-NameAndTypeOK.6 = rcase-NameAndTypeOK.6 : Les substitutions non autoris\u00E9es pour l''\u00E9l\u00E9ment ''{0}'' ne sont pas un sur-ensemble de celles de la base.
- rcase-NameAndTypeOK.7 = rcase-NameAndTypeOK.7 : Le type de l''\u00E9l\u00E9ment ''{0}'', ''{1}'', n''est pas d\u00E9riv\u00E9 du type de l''\u00E9l\u00E9ment de base, ''{2}''.
- rcase-NSCompat.1 = rcase-NSCompat.1 : L''\u00E9l\u00E9ment ''{0}'' comporte un espace de noms ''{1}'' non autoris\u00E9 par le caract\u00E8re g\u00E9n\u00E9rique de la base.
- rcase-NSCompat.2 = rcase-NSCompat.2 : Erreur dans la particule o\u00F9 la valeur '{'term'}' est la d\u00E9claration d''\u00E9l\u00E9ment ''{0}''. Sa plage d''occurrences, ({1},{2}), n''est pas une restriction valide de la plage ({3},{4}) de la particule correspondante dans le type de base.
- rcase-NSRecurseCheckCardinality.1 = rcase-NSRecurseCheckCardinality.1 : Aucune mise en correspondance fonctionnelle compl\u00E8te entre les particules.
- rcase-NSRecurseCheckCardinality.2 = rcase-NSRecurseCheckCardinality.2 : La plage d''occurrences du groupe, ({0},{1}), n''est pas une restriction valide de la plage \u00E0 caract\u00E8re g\u00E9n\u00E9rique de la base, ({2},{3}).
- rcase-NSSubset.1 = rcase-NSSubset.1 : Le caract\u00E8re g\u00E9n\u00E9rique n'est pas un sous-ensemble du caract\u00E8re g\u00E9n\u00E9rique correspondant dans la base.
- rcase-NSSubset.2 = rcase-NSSubset.2 : La plage d''occurrences du caract\u00E8re g\u00E9n\u00E9rique, ({0},{1}), n''est pas une restriction valide de celle de la base, ({2},{3}).
- rcase-NSSubset.3 = rcase-NSSubset.3 : Le contenu de processus de caract\u00E8re g\u00E9n\u00E9rique, ''{0}'', est plus faible que celui figurant dans la base, ''{1}''.
- rcase-Recurse.1 = rcase-Recurse.1 : La plage d''occurrences du groupe, ({0},{1}), n''est pas une restriction valide de la plage d''occurrences du groupe de base, ({2},{3}).
- rcase-Recurse.2 = rcase-Recurse.2 : Aucune mise en correspondance fonctionnelle compl\u00E8te entre les particules.
- rcase-RecurseLax.1 = rcase-RecurseLax.1 : La plage d''occurrences du groupe, ({0},{1}), n''est pas une restriction valide de la plage d''occurrences du groupe de base, ({2},{3}).
- rcase-RecurseLax.2 = rcase-RecurseLax.2 : Aucune mise en correspondance fonctionnelle compl\u00E8te entre les particules.
- rcase-RecurseUnordered.1 = rcase-RecurseUnordered.1 : La plage d''occurrences du groupe, ({0},{1}), n''est pas une restriction valide de la plage d''occurrences du groupe de base, ({2},{3}).
- rcase-RecurseUnordered.2 = rcase-RecurseUnordered.2 : Aucune mise en correspondance fonctionnelle compl\u00E8te entre les particules.
-# We're using sch-props-correct.2 instead of the old src-redefine.1
-# src-redefine.1 = src-redefine.1: The component ''{0}'' is begin redefined, but its corresponding component isn't in the schema document being redefined (with namespace ''{2}''), but in a different document, with namespace ''{1}''.
- sch-props-correct.2 = sch-props-correct.2 : Un sch\u00E9ma ne peut pas contenir deux composants globaux de m\u00EAme nom ; celui-ci contient deux occurrences de ''{0}''.
- st-props-correct.2 = st-props-correct.2 : D\u00E9finitions circulaires d\u00E9tect\u00E9es pour le type simple ''{0}''. Cela signifie que ''{0}'' est contenu dans sa propre hi\u00E9rarchie des types, ce qui est une erreur.
- st-props-correct.3 = st-props-correct.3 : Erreur dans le type ''{0}''. La valeur '{'final'}' de '{'base type definition'}', ''{1}'', n''accepte pas la d\u00E9rivation par restriction.
- totalDigits-valid-restriction = totalDigits-valid-restriction : Dans la d\u00E9finition de {2}, la valeur ''{0}'' pour le facet ''totalDigits'' n''est pas valide car elle doit \u00EAtre <= \u00E0 la valeur de ''totalDigits'', qui a \u00E9t\u00E9 d\u00E9finie sur ''{1}'' dans l''un des types d''anc\u00EAtre.
- whiteSpace-valid-restriction.1 = whiteSpace-valid-restriction.1 : Dans la d\u00E9finition de {0}, la valeur ''{1}'' du facet ''whitespace'' n''est pas valide car elle a \u00E9t\u00E9 d\u00E9finie sur ''collapse'' dans l''un des types d''anc\u00EAtre.
- whiteSpace-valid-restriction.2 = whiteSpace-valid-restriction.2 : Dans la d\u00E9finition de {0}, la valeur ''preserve'' du facet ''whitespace'' n''est pas valide car la valeur de ''whitespace'' a \u00E9t\u00E9 d\u00E9finie sur ''replace'' dans l''un des types d''anc\u00EAtre.
-
-#schema for Schemas
-
- s4s-att-invalid-value = s4s-att-invalid-value : Valeur d''attribut non valide pour ''{1}'' dans l''\u00E9l\u00E9ment ''{0}''. Raison enregistr\u00E9e : {2}
- s4s-att-must-appear = s4s-att-must-appear : L''attribut ''{1}'' doit figurer dans l''\u00E9l\u00E9ment ''{0}''.
- s4s-att-not-allowed = s4s-att-not-allowed : L''attribut ''{1}'' ne doit pas figurer dans l''\u00E9l\u00E9ment ''{0}''.
- s4s-elt-invalid = s4s-elt-invalid : L''\u00E9l\u00E9ment ''{0}'' n''est pas un \u00E9l\u00E9ment valide dans un document de sch\u00E9ma.
- s4s-elt-must-match.1 = s4s-elt-must-match.1 : Le contenu de ''{0}'' doit concorder avec {1}. Probl\u00E8me d\u00E9tect\u00E9 \u00E0 partir de : {2}.
- s4s-elt-must-match.2 = s4s-elt-must-match.2 : Le contenu de ''{0}'' doit concorder avec {1}. Nombre insuffisant d''\u00E9l\u00E9ments trouv\u00E9s.
- # the "invalid-content" messages provide less information than the "must-match" counterparts above. They're used for complex types when providing a "match" would be an information dump
- s4s-elt-invalid-content.1 = s4s-elt-invalid-content.1 : Le contenu de ''{0}'' n''est pas valide. L''\u00E9l\u00E9ment ''{1}'' n''est pas valide, est mal plac\u00E9 ou compte trop d''occurrences.
- s4s-elt-invalid-content.2 = s4s-elt-invalid-content.2 : Le contenu de ''{0}'' n''est pas valide. L''\u00E9l\u00E9ment ''{1}'' ne peut pas \u00EAtre vide.
- s4s-elt-invalid-content.3 = s4s-elt-invalid-content.3 : Les \u00E9l\u00E9ments de type ''{0}'' ne peuvent pas appara\u00EEtre apr\u00E8s les d\u00E9clarations en tant qu''enfants d''un \u00E9l\u00E9ment <schema>.
- s4s-elt-schema-ns = s4s-elt-schema-ns : L''espace de noms de l''\u00E9l\u00E9ment ''{0}'' doit \u00EAtre issu de l''espace de noms du schema, ''http://www.w3.org/2001/XMLSchema''.
- s4s-elt-character = s4s-elt-character : Les caract\u00E8res imprimables ne sont pas autoris\u00E9s dans les \u00E9l\u00E9ments de sch\u00E9ma autres que ''xs:appinfo'' et ''xs:documentation''. ''{0}'' a \u00E9t\u00E9 d\u00E9tect\u00E9.
-
-# codes not defined by the spec
-
- c-fields-xpaths = c-fields-xpaths : La valeur de champ ''{0}'' n''est pas valide.
- c-general-xpath = c-general-xpath : L''expression ''{0}'' n''est pas valide par rapport au sous-ensemble XPath pris en charge par le sch\u00E9ma XML.
- c-general-xpath-ns = c-general-xpath-ns : Un pr\u00E9fixe d''espace de noms dans l''expression XPath ''{0}'' n''est li\u00E9 \u00E0 aucun espace de noms.
- c-selector-xpath = c-selector-xpath : La valeur de s\u00E9lecteur ''{0}'' n''est pas valide ; les XPath de s\u00E9lecteur ne peuvent pas contenir d''attributs.
- EmptyTargetNamespace = EmptyTargetNamespace : Dans le document de sch\u00E9ma ''{0}'', la valeur de l''attribut ''targetNamespace'' ne peut pas \u00EAtre une cha\u00EEne vide.
- FacetValueFromBase = FacetValueFromBase : Dans la d\u00E9claration de type ''{0}'', la valeur ''{1}'' du facet ''{2}'' doit \u00EAtre issue de l''espace de valeurs du type de base, ''{3}''.
- FixedFacetValue = FixedFacetValue : Dans la d\u00E9finition de {3}, la valeur ''{1}'' du facet ''{0}'' n''est pas valide, car la valeur de ''{0}'' a \u00E9t\u00E9 d\u00E9finie sur ''{2}'' dans l''un des types d''anc\u00EAtre, et '{'fixed'}' = true.
- InvalidRegex = InvalidRegex : La valeur de mod\u00E8le ''{0}'' n''est pas une expression r\u00E9guli\u00E8re valide. L''erreur signal\u00E9e est ''{1}'', au niveau de la colonne ''{2}''.
- MaxOccurLimit = La configuration en cours de l''analyseur ne permet pas de d\u00E9finir une valeur d''attribut maxOccurs sur une valeur sup\u00E9rieure \u00E0 {0}.
- PublicSystemOnNotation = PublicSystemOnNotation : Au moins une des valeurs ''public'' et ''system'' doit figurer dans l'\u00E9l\u00E9ment ''notation''.
- SchemaLocation = SchemaLocation : La valeur schemaLocation ''{0}'' doit comporter un nombre pair d''URI.
- TargetNamespace.1 = TargetNamespace.1 : Espace de noms "{0}" attendu mais l''espace de noms cible du document de sch\u00E9ma est ''{1}''.
- TargetNamespace.2 = TargetNamespace.2 : Aucun espace de noms attendu mais le document de sch\u00E9ma comporte un espace de noms cible de ''{1}''.
- UndeclaredEntity = UndeclaredEntity : L''entit\u00E9 ''{0}'' n''est pas d\u00E9clar\u00E9e.
- UndeclaredPrefix = UndeclaredPrefix : Impossible de r\u00E9soudre ''{0}'' en un QName : le pr\u00E9fixe ''{1}'' n''est pas d\u00E9clar\u00E9.
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_it.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_it.properties
deleted file mode 100644
index 1a80b3d..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_it.properties
+++ /dev/null
@@ -1,291 +0,0 @@
-# This file contains error and warning messages related to XML Schema
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
- BadMessageKey = Impossibile trovare il messaggio di errore corrispondente alla chiave di messaggio.
- FormatFailed = Si \u00E8 verificato un errore interno durante la formattazione del seguente messaggio:\n
-
-# For internal use
-
- Internal-Error = Errore interno: {0}.
- dt-whitespace = Spazio vuoto non disponibile come valore di facet per il simpleType di unione ''{0}''
- GrammarConflict = Una grammatica restituita dal pool di grammatiche dell'utente \u00E8 in conflitto con un'altra grammatica.
-
-# Identity constraints
-
- AbsentKeyValue = Errore del vincolo di identit\u00E0 (cvc-identity-constraint.4.2.1): l''elemento "{0}" ha una chiave senza alcun valore.
- DuplicateField = Corrispondenza duplicata nell''ambito per il campo "{0}".
- DuplicateKey = Valore chiave duplicato [{0}] dichiarato per il vincolo di identit\u00E0 dell''elemento "{1}".
- DuplicateUnique = Valore univoco duplicato [{0}] dichiarato per il vincolo di identit\u00E0 dell''elemento "{1}".
- FieldMultipleMatch = Errore del vincolo di identit\u00E0: il campo "{0}" corrisponde a pi\u00F9 valori nell''ambito del proprio selettore; i campi devono corrispondere a valori univoci.
- FixedDiffersFromActual = Il contenuto di questo elemento non equivale al valore dell'attributo "fixed" nella dichiarazione dell'elemento nello schema.
- KeyMatchesNillable = Errore del vincolo di identit\u00E0 (cvc-identity-constraint.4.2.3): l''elemento "{0}" ha una chiave corrispondente a un elemento con un valore annullabile impostato su true.
- KeyNotEnoughValues = Valori insufficienti forniti per il vincolo di identit\u00E0 <key name="{1}"> specificato per l''elemento "{0}".
- KeyNotFound = Chiave "{0}"con valore "{1}" non trovata per il vincolo di identit\u00E0 dell''elemento "{2}".
- KeyRefNotEnoughValues = Valori insufficienti forniti per il vincolo di identit\u00E0 <keyref name="{1}"> specificato per l''elemento "{0}".
- KeyRefOutOfScope = Errore del vincolo di identit\u00E0: il vincolo di identit\u00E0 "{0}" ha un keyref che fa riferimento a una chiave o a un valore univoco fuori ambito.
- KeyRefReferNotFound = La dichiarazione "{0}" del riferimento chiave fa riferimento a una chiave sconosciuta denominata "{1}".
- UniqueNotEnoughValues = Valori insufficienti forniti per il vincolo di identit\u00E0 <unique> specificato per l''elemento "{0}".
- UnknownField = Errore interno del vincolo di identit\u00E0; campo "{0}" sconosciuto
-
-# Ideally, we should only use the following error keys, not the ones under
-# "Identity constraints". And we should cover all of the following errors.
-
-#validation (3.X.4)
-
- cvc-attribute.3 = cvc-attribute.3: il valore ''{2}'' dell''attributo ''{1}'' sull''elemento ''{0}'' non \u00E8 valido rispetto al suo tipo ''{3}''.
- cvc-attribute.4 = cvc-attribute.4: il valore ''{2}'' dell''attributo ''{1}'' sull''elemento ''{0}'' non \u00E8 valido rispetto al suo '{'value constraint'}' fisso. L''attributo deve avere un valore pari a ''{3}''.
- cvc-complex-type.2.1 = cvc-complex-type.2.1: l''elemento "{0}" non deve avere [children] di voci di informazioni di carattere o elemento perch\u00E9 il tipo di contenuto \u00E8 vuoto.
- cvc-complex-type.2.2 = cvc-complex-type.2.2: l''elemento "{0}" non deve avere [children] di tipo elemento e il valore deve essere valido.
- cvc-complex-type.2.3 = cvc-complex-type.2.3: l''elemento "{0}" non deve avere [children] di tipo carattere perch\u00E9 il tipo di contenuto \u00E8 di soli elementi.
- cvc-complex-type.2.4.a = cvc-complex-type.2.4.a: contenuto non valido che inizia con l''elemento "{0}". \u00C8 previsto un elemento "{1}".
- cvc-complex-type.2.4.b = cvc-complex-type.2.4.b: il contenuto dell''elemento "{0}" non \u00E8 completo. \u00C8 previsto un elemento "{1}".
- cvc-complex-type.2.4.c = cvc-complex-type.2.4.c: il carattere jolly corrispondente \u00E8 rigoroso ma non \u00E8 possibile trovare una dichiarazione per l''elemento "{0}".
- cvc-complex-type.2.4.d = cvc-complex-type.2.4.d: contenuto non valido che inizia con l''elemento "{0}". Non sono previsti elementi figlio in questo punto.
- cvc-complex-type.2.4.e = cvc-complex-type.2.4.d: contenuto non valido che inizia con l''elemento "{0}". Non \u00E8 previsto un elemento figlio ''{1}'' in questo punto.
- cvc-complex-type.3.1 = cvc-complex-type.3.1: il valore "{2}" dell''attributo "{1}" dell''elemento "{0}" non \u00E8 valido rispetto al uso corrispondente dell''attributo. L''attributo ''{1}'' ha un valore fisso pari a ''{3}''.
- cvc-complex-type.3.2.1 = cvc-complex-type.3.2.1: l''elemento "{0}" non ha un carattere jolly di attributo per l''attributo "{1}".
- cvc-complex-type.3.2.2 = cvc-complex-type.3.2.2: l''attributo "{1}" non \u00E8 consentito nell''elemento "{0}".
- cvc-complex-type.4 = cvc-complex-type.4: l''attributo ''{1}'' deve apparire sull''elemento "{0}".
- cvc-complex-type.5.1 = cvc-complex-type.5.1: nell''elemento "{0}", l''attributo "{1}" \u00E8 un ID Wild ma esiste gi\u00E0 un ID Wild "{2}". Pu\u00F2 esisterne solo uno.
- cvc-complex-type.5.2 = cvc-complex-type.5.2: nell''elemento "{0}", l''attributo "{1}" \u00E8 un ID Wild ma esiste gi\u00E0 un attributo "{2}" derivato dall''ID tra '{'attribute uses'}'.
- cvc-datatype-valid.1.2.1 = cvc-datatype-valid.1.2.1: "{0}" non \u00E8 un valore valido per "{1}".
- cvc-datatype-valid.1.2.2 = cvc-datatype-valid.1.2.2: "{0}" non \u00E8 un valore valido per il tipo di lista "{1}".
- cvc-datatype-valid.1.2.3 = cvc-datatype-valid.1.2.3: "{0}" non \u00E8 un valore valido per il tipo di unione "{1}".
- cvc-elt.1 = cvc-elt.1: impossibile trovare la dichiarazione dell''elemento "{0}".
- cvc-elt.2 = cvc-elt.2: il valore di '{'abstract'}' nella dichiarazione di elemento per "{0}" deve essere false.
- cvc-elt.3.1 = cvc-elt.3.1: l''attributo "{1}" non deve apparire sull''elemento "{0}" perch\u00E9 la propriet\u00E0 '{'nillable'}' di "{0}" \u00E8 false.
- cvc-elt.3.2.1 = cvc-elt.3.2.1: l''elemento "{0}" non deve avere [children] di informazioni di tipo carattere o elemento perch\u00E9 \u00E8 specificato "{1}".
- cvc-elt.3.2.2 = cvc-elt.3.2.2: non deve esistere alcun '{'value constraint'}' fisso per l''elemento "{0}" perch\u00E9 \u00E8 specificato "{1}".
- cvc-elt.4.1 = cvc-elt.4.1: il valore "{2}" dell''attributo "{1}" per l''elemento "{0}" non \u00E8 un QName valido.
- cvc-elt.4.2 = cvc-elt.4.2: impossibile risolvere "{1}" in una definizione tipo per l''elemento "{0}".
- cvc-elt.4.3 = cvc-elt.4.3: tipo "{1}" non derivato in modo valido dalla definizione tipo ''{2}'' dell''elemento "{0}".
- cvc-elt.5.1.1 = cvc-elt.5.1.1: '{'value constraint'}' "{2}" dell''elemento "{0}" non \u00E8 un valore predefinito valido per il tipo "{1}".
- cvc-elt.5.2.2.1 = cvc-elt.5.2.2.1: l''elemento "{0}" non deve avere [children] di voci di informazioni di elemento.
- cvc-elt.5.2.2.2.1 = cvc-elt.5.2.2.2.1: il valore "{1}" dell''elemento "{0}" non corrisponde al valore fisso di '{'value constraint'}' "{2}".
- cvc-elt.5.2.2.2.2 = cvc-elt.5.2.2.2.2: il valore "{1}" dell''elemento "{0}" non corrisponde al valore di '{'value constraint'}' "{2}".
- cvc-enumeration-valid = cvc-enumeration-valid: il valore "{0}" non \u00E8 valido come facet rispetto all''enumerazione "{1}". Deve essere un valore dell''enumerazione.
- cvc-fractionDigits-valid = cvc-fractionDigits-valid: il valore ''{0}'' ha {1} cifre di frazione, ma il numero di cifre di frazione \u00E8 stato limitato a {2}.
- cvc-id.1 = cvc-id.1: non esiste alcuna associazione ID/IDREF per l''IDREF "{0}".
- cvc-id.2 = cvc-id.2: esistono pi\u00F9 ricorrenze del valore di ID "{0}".
- cvc-id.3 = cvc-id.3: un campo del vincolo di identit\u00E0 "{0}" corrispondeva all''elemento "{1}" ma questo elemento non ha un tipo semplice.
- cvc-length-valid = cvc-length-valid: il valore "{0}" con lunghezza = "{1}" non \u00E8 valido come facet rispetto alla lunghezza "{2}" per il tipo "{3}".
- cvc-maxExclusive-valid = cvc-maxExclusive-valid: il valore "{0}" non \u00E8 valido come facet rispetto a maxExclusive "{1}" per il tipo ''{2}''.
- cvc-maxInclusive-valid = cvc-maxInclusive-valid: il valore "{0}" non \u00E8 valido come facet rispetto a maxInclusive "{1}" per il tipo ''{2}''.
- cvc-maxLength-valid = cvc-maxLength-valid: il valore "{0}" con lunghezza = "{1}" non \u00E8 valido come facet rispetto a maxLength "{2}" per il tipo "{3}".
- cvc-minExclusive-valid = cvc-minExclusive-valid: il valore "{0}" non \u00E8 valido come facet rispetto a minExclusive "{1}" per il tipo ''{2}''.
- cvc-minInclusive-valid = cvc-minInclusive-valid: il valore "{0}" non \u00E8 valido come facet rispetto a minExclusive "{1}" per il tipo ''{2}''.
- cvc-minLength-valid = cvc-minLength-valid: il valore "{0}" con lunghezza = "{1}" non \u00E8 valido come facet rispetto a minLength "{2}" per il tipo "{3}".
- cvc-pattern-valid = cvc-pattern-valid: il valore "{0}" non \u00E8 valido come facet rispetto al pattern "{1}" per il tipo ''{2}''.
- cvc-totalDigits-valid = cvc-totalDigits-valid: il valore ''{0}'' ha {1} cifre di totale, ma il numero di cifre di totale \u00E8 stato limitato a {2}.
- cvc-type.2 = cvc-type.2: la definizione tipo non pu\u00F2 essere astratta per l''elemento {0}.
- cvc-type.3.1.1 = cvc-type.3.1.1: l''elemento ''{0}'' \u00E8 di tipo semplice, quindi non pu\u00F2 avere attributi, tranne quelli il cui spazio di nomi \u00E8 uguale ''http://www.w3.org/2001/XMLSchema-instance'' e il cui [local name] \u00E8 uno tra ''type'', ''nil'', ''schemaLocation'' o ''noNamespaceSchemaLocation''. \u00C8 stato trovato l''attributo ''{1}''.
- cvc-type.3.1.2 = cvc-type.3.1.2: l''elemento "{0}" \u00E8 di tipo semplice, quindi non deve avere [children] di voci di informazioni di elemento.
- cvc-type.3.1.3 = cvc-type.3.1.3: il valore "{1}" dell''elemento "{0}" non \u00E8 valido.
-
-#schema valid (3.X.3)
-
- schema_reference.access = schema_reference: lettura del documento di schema ''{0}'' non riuscita. Accesso ''{1}'' non consentito a causa della limitazione definita dalla propriet\u00E0 accessExternalSchema.
- schema_reference.4 = schema_reference.4: lettura del documento di schema "{0}" non riuscita perch\u00E9 1) non \u00E8 stato possibile trovare il documento; 2) non \u00E8 stato possibile leggere il documento; 3) l''elemento radice del documento non \u00E8 <xsd:schema>.
- src-annotation = src-annotation: possono essere contenuti soltanto elementi <appinfo> e <documentation>, ma \u00E8 stato trovato ''{0}''.
- src-attribute.1 = src-attribute.1: le propriet\u00E0 ''default'' e ''fixed'' non possono essere entrambi presenti nella dichiarazione di attributo ''{0}''. Utilizzarne solo una.
- src-attribute.2 = src-attribute.2: la propriet\u00E0 ''default'' \u00E8 presente nell''attributo ''{0}'', quindi il valore di ''use'' deve essere ''optional''.
- src-attribute.3.1 = src-attribute.3.1: in una dichiarazione di attributo locale deve essere presente 'ref' o 'name'.
- src-attribute.3.2 = src-attribute.3.2: il contenuto deve corrispondere a (annotation?) per il riferimento di attributo "{0}".
- src-attribute.4 = src-attribute.4: l''attributo "{0}" ha sia un attributo ''type'' che un elemento figlio "simpleType" anonimo. \u00C8 consentito uno solo di questi valori per un attributo.
- src-attribute_group.2 = src-attribute_group.2: non \u00E8 possibile esprimere l''intersezione di caratteri jolly per il gruppo di attributi ''{0}''.
- src-attribute_group.3 = src-attribute_group.3: sono state rilevate definizioni circolari per il gruppo di attributi ''{0}''. Se si seguono ricorsivamente i riferimenti ai gruppi di attributi, si torna inevitabilmente al punto di partenza.
- src-ct.1 = src-ct.1: errore di rappresentazione della definizione di tipo complesso per il tipo ''{0}''. Se si utilizza <complexContent>, il tipo di base deve essere un complexType. ''{1}'' \u00E8 simpleType.
- src-ct.2.1 = src-ct.2.1: errore di rappresentazione della definizione di tipo complesso per il tipo ''{0}''. Se si utilizza <complexContent>, il tipo di base deve essere un complexType con tipo di contenuto semplice oppure, se \u00E8 specificata solo la limitazione, un tipo complesso con contenuto misto e parte svuotabile oppure, se \u00E8 specificato solo l''estensione, un tipo semplice. ''{1}'' non soddisfa alcuna di queste condizioni.
- src-ct.2.2 = src-ct.2.2: errore di rappresentazione della definizione di tipo complesso per il tipo "{0}". Quando un complexType con simpleContent limita un complexType con contenuto misto e parte svuotabile, deve esistere un <simpleType> tra gli elementi figlio di <restriction>.
- src-ct.4 = src-ct.4: errore di rappresentazione della definizione di tipo complesso per il tipo ''{0}''. Non \u00E8 possibile esprimere l''intersezione di caratteri jolly.
- src-ct.5 = src-ct.5: errore di rappresentazione della definizione di tipo complesso per il tipo ''{0}''. Non \u00E8 possibile esprimere l''unione di caratteri jolly.
- src-element.1 = src-element.1: le propriet\u00E0 ''default'' e ''fixed'' non possono essere entrambi presenti nella dichiarazione di elemento ''{0}''. Utilizzarne solo una.
- src-element.2.1 = src-element.2.1: in una dichiarazione di elemento locale deve essere presente 'ref' o 'name'.
- src-element.2.2 = src-element.2.2: poich\u00E9 ''{0}'' contiene l''attributo ''ref'', il suo contenuto deve corrispondere a (annotation?), ma \u00E8 stato trovato ''{1}''.
- src-element.3 = src-element.3: l''elemento "{0}" ha sia un attributo ''type'' che un elemento figlio "anonymous type". \u00C8 consentito uno solo di questi valori per un elemento.
- src-import.1.1 = src-import.1.1: l''attributo "{0}" dello spazio di nomi di una voce di informazioni di elemento <import> non deve essere uguale al targetNamespace dello schema in cui esiste.
- src-import.1.2 = src-import.1.2: se l''attributo dello spazio di nomi non \u00E8 presente in una voce di informazioni di elemento <import>, lo schema che lo contiene deve avere un targetNamespace.
- src-import.2 = src-import.2: l''elemento radice del documento "{0}" deve avere lo spazio di nomi denominato ''http://www.w3.org/2001/XMLSchema'' e il nome locale ''schema''.
- src-import.3.1 = src-import.3.1: l''attributo "{0}" dello spazio di nomi di una voce di informazioni di elemento <import> deve essere uguale all''attributo targetNamespace ''{1}'' del documento importato.
- src-import.3.2 = src-import.3.2: non esiste alcun attributo dello spazio di nomi nella voce di informazioni di elemento <import>, pertanto il documento importato non pu\u00F2 avere alcun attributo targetNamespace. tuttavia, \u00E8 stato trovato targetNamespace ''{1}'' nel documento importato.
- src-include.1 = src-include.1: l''elemento radice del documento "{0}" deve avere lo spazio di nomi denominato ''http://www.w3.org/2001/XMLSchema'' e il nome locale ''schema''.
- src-include.2.1 = src-include.2.1: targetNamespace dello schema di riferimento (attualmente "{1}") deve essere identico a quello dello schema di inclusione (attualmente "{0}").
- src-redefine.2 = src-redefine.2: l''elemento radice del documento "{0}" deve avere lo spazio di nomi denominato ''http://www.w3.org/2001/XMLSchema'' e il nome locale ''schema''.
- src-redefine.3.1 = src-redefine.3.1: targetNamespace dello schema di riferimento (attualmente "{1}") deve essere identico a quello dello schema di ridefinizione (attualmente "{0}").
- src-redefine.5.a.a = src-redefine.5.a.a: non \u00E8 stato trovato alcun elemento figlio di non annotazione di tipo <simpleType>. Gli elementi figlio <simpleType> di elementi <redefine> devono avere discendenti <restriction>, con attributi 'base' che fanno riferimento a s\u00E9 stessi.
- src-redefine.5.a.b = src-redefine.5.a.b: ''{0}'' non \u00E8 un elemento figlio valido. Gli elementi figlio <simpleType> di elementi <redefine> devono avere discendenti <restriction>, con attributi ''base'' che fanno riferimento a s\u00E9 stessi.
- src-redefine.5.a.c = src-redefine.5.a.c: ''{0}'' non dispone di un attributo "base" che fa riferimento all''elemento ridefinito ''{1}''. Gli elementi figlio <simpleType> di elementi <redefine> devono avere discendenti <restriction>, con attributi ''base'' che fanno riferimento a s\u00E9 stessi.
- src-redefine.5.b.a = src-redefine.5.b.a: non \u00E8 stato trovato alcun elemento figlio di non annotazione di tipo <complexType>. Gli elementi figlio <complexType> di elementi <redefine> devono avere discendenti <extension> o <restriction>, con attributi 'base' che fanno riferimento a s\u00E9 stessi.
- src-redefine.5.b.b = src-redefine.5.b.b: non \u00E8 stato trovato alcun elemento nipote di non annotazione di tipo <complexType>. Gli elementi figlio <complexType> di elementi <redefine> devono avere discendenti <extension> o <restriction>, con attributi 'base' che fanno riferimento a s\u00E9 stessi.
- src-redefine.5.b.c = src-redefine.5.b.c: ''{0}'' non \u00E8 un elemento nipote valido. Gli elementi figlio <complexType> di elementi <redefine> devono avere discendenti <extension> o <restriction>, con attributi ''base'' che fanno riferimento a s\u00E9 stessi.
- src-redefine.5.b.d = src-redefine.5.b.d: ''{0}'' non dispone di un attributo "base" che fa riferimento all''elemento ridefinito ''{1}''. Gli elementi figlio <complexType> di elementi <redefine> devono avere discendenti <extension> o <restriction>, con attributi ''base'' che fanno riferimento a s\u00E9 stessi.
- src-redefine.6.1.1 = src-redefine.6.1.1: se un elemento figlio del gruppo di un elemento <redefine> contiene un gruppo che fa riferimento a s\u00E9 stesso, deve averne esattamente uno, mentre questo ne ha "{0}".
- src-redefine.6.1.2 = src-redefine.6.1.2: il gruppo "{0}" che contiene un riferimento a un gruppo in fase di ridefinizione deve avere minOccurs = maxOccurs = 1.
- src-redefine.6.2.1 = src-redefine.6.2.1: nessun gruppo nello schema ridefinito con nome corrispondente a "{0}".
- src-redefine.6.2.2 = src-redefine.6.2.2: il gruppo "{0}" non limita correttamente il gruppo che ridefinisce; vincolo violato: "{1}".
- src-redefine.7.1 = src-redefine.7.1: se un elemento figlio attributeGroup di un elemento <redefine> contiene un attributeGroup che fa riferimento a s\u00E9 stesso, deve averne esattamente uno, mentre questo ne ha "{0}".
- src-redefine.7.2.1 = src-redefine.7.2.1: nessun attributeGroup nello schema ridefinito con nome corrispondente a "{0}".
- src-redefine.7.2.2 = src-redefine.7.2.2: AttributeGroup "{0}" non limita correttamente l''AttributeGroup che ridefinisce; vincolo violato: "{1}".
- src-resolve = src-resolve: impossibile risolvere il nome "{0}" in un componente {1}.
- src-resolve.4.1 = src-resolve.4.1: errore durante la risoluzione del componente ''{2}''. \u00C8 stato rilevato che ''{2}'' non dispone di uno spazio di nomi, ma ai componenti senza spazi di nomi di destinazione non \u00E8 possibile fare riferimento dal documento di schema ''{0}''. Se \u00E8 previsto che ''{2}'' abbia uno spazio di nomi, \u00E8 probabile che sia necessario specificare un prefisso. Se, invece, \u00E8 previsto che ''{2}'' non abbia uno spazio di nomi, aggiungere ''import'' senza un attributo "namespace" a ''{0}''.
- src-resolve.4.2 = src-resolve.4.2: errore durante la risoluzione del componente ''{2}''. \u00C8 stato rilevato che ''{2}'' si trova nello spazio di nomi ''{1}'', ma ai componenti di questo spazio di nomi di destinazione non \u00E8 possibile fare riferimento dal documento di schema ''{0}''. Se questo spazio di nomi \u00E8 errato, \u00E8 probabile che sia necessario modificare il prefisso ''{2}''. Se lo spazio di nomi \u00E8 corretto, aggiungere la tag ''import'' adeguata a ''{0}''.
- src-simple-type.2.a = src-simple-type.2.a: \u00E8 stato trovato un elemento <restriction> che contiene sia un [attribute] di base che un elemento <simpleType> tra i rispettivi [children]. \u00C8 consentito solo uno.
- src-simple-type.2.b = src-simple-type.2.b: \u00E8 stato trovato un elemento <restriction> che non contiene n\u00E9 un [attribute] di base n\u00E9 un elemento <simpleType> tra i rispettivi [children]. Ne \u00E8 richiesto uno.
- src-simple-type.3.a = src-simple-type.3.a: \u00E8 stato trovato un elemento <list> che contiene sia un [attribute] itemType che un elemento <simpleType> tra i rispettivi [children]. \u00C8 consentito solo uno.
- src-simple-type.3.b = src-simple-type.3.b: \u00E8 stato trovato un elemento <list> che non contiene n\u00E9 un [attribute] itemType n\u00E9 un elemento <simpleType> tra i rispettivi [children]. Ne \u00E8 richiesto uno.
- src-single-facet-value = src-single-facet-value: il facet ''{0}'' \u00E8 stato definito pi\u00F9 volte.
- src-union-memberTypes-or-simpleTypes = src-union-memberTypes-or-simpleTypes: un elemento <union> deve avere un [attribute] memberTypes non vuoto o almeno un elemento <simpleType> tra i rispettivi [children].
-
-#constraint valid (3.X.6)
-
- ag-props-correct.2 = ag-props-correct.2: errore per il gruppo di attributi "{0}". Sono specificati usi di attributi duplicati con lo stesso nome e spazio di nomi di destinazione. Il nome dell''uso dell''attributo duplicato \u00E8 "{1}".
- ag-props-correct.3 = ag-props-correct.3: errore per il gruppo di attributi "{0}". Due dichiarazioni di attributo, "{1}" e "{2}" hanno tipi derivati dall''ID.
- a-props-correct.2 = a-props-correct.2: valore di vincolo di valore "{1}" non valido nell''attributo "{0}".
- a-props-correct.3 = a-props-correct.3: l''attributo ''{0}'' non pu\u00F2 utilizzare il valore ''fixed'' o ''default'' poich\u00E9 la '{'type definition'}' dell''attributo \u00E8 un ID o \u00E8 derivata dall''ID.
- au-props-correct.2 = au-props-correct.2: nella dichiarazione di attributo di ''{0}'' \u00E8 stato specificato un valore fisso ''{1}''. Se, pertanto, l''uso dell''attributo che fa riferimento a ''{0}'' ha anche un valore '{'value constraint'}', deve essere fisso e il suo valore deve essere ''{1}''.
- cos-all-limited.1.2 = cos-all-limited.1.2: deve apparire un gruppo di modelli 'all' in una parte con '{'min occurs'}' = '{'max occurs'}' = 1 e la parte deve far parte di una coppia che costituisca il '{'content type'}' di una definizione di tipo complesso.
- cos-all-limited.2 = cos-all-limited.2: il valore '{'max occurs'}' di un elemento in un gruppo di modelli ''all'' deve essere 0 o 1. Il valore ''{0}'' per l''elemento ''{1}'' non \u00E8 valido.
- cos-applicable-facets = cos-applicable-facets: facet ''{0}'' non consentito dal tipo {1}.
- cos-ct-extends.1.1 = cos-ct-extends.1.1: il tipo ''{0}'' \u00E8 stato derivato mediante estensione dal tipo ''{1}'', ma l''attributo "final" di ''{1}'' impedisce la derivazione mediante estensione.
- cos-ct-extends.1.4.3.2.2.1.a = cos-ct-extends.1.4.3.2.2.1.a: Il tipo di contenuto di un tipo derivato e quello della rispettiva base devono essere entrambi misti o di soli elementi. Il tipo ''{0}'' \u00E8 di soli elementi, mentre la rispettiva base non lo \u00E8.
- cos-ct-extends.1.4.3.2.2.1.b = cos-ct-extends.1.4.3.2.2.1.b: Il tipo di contenuto di un tipo derivato e quello della rispettiva base devono essere entrambi misti o di soli elementi. Il tipo ''{0}'' \u00E8 misto, mentre la rispettiva base non lo \u00E8.
- cos-element-consistent = cos-element-consistent: errore per il tipo "{0}". Nel gruppo di modelli appaiono pi\u00F9 elementi con nome "{1}" e tipi diversi.
- cos-list-of-atomic = cos-list-of-atomic: nella definizione del tipo di lista ''{0}'', il tipo ''{1}'' non \u00E8 valido poich\u00E9 non \u00E8 indivisibile (''{1}'' \u00E8 un tipo di lista o un tipo di unione che contiene una lista).
- cos-nonambig = cos-nonambig: {0} e {1} (o gli elementi derivanti dal gruppo di sostituzione) violano "Unique Particle Attribution". Durante la convalida su questo schema, si creerebbe un''ambiguit\u00E0 per le due parti.
- cos-particle-restrict.a = cos-particle-restrict.a: la parte derivata \u00E8 vuota, mente la base non \u00E8 svuotabile.
- cos-particle-restrict.b = cos-particle-restrict.b: la parte della base \u00E8 vuota, mente la parte derivata non lo \u00E8.
- cos-particle-restrict.2 = cos-particle-restrict.2: limitazione di parte vietata: ''{0}''.
- cos-st-restricts.1.1 = cos-st-restricts.1.1: il tipo ''{1}'' \u00E8 indivisibile, quindi la '{'base type definition'}' "{0}" deve essere una definizione di tipo semplice indivisibile o un tipo di dati predefinito incorporato.
- cos-st-restricts.2.1 = cos-st-restricts.2.1: nella definizione del tipo di lista ''{0}'', il tipo ''{1}'' non \u00E8 valido poich\u00E9 \u00E8 un tipo di lista o un tipo di unione che contiene una lista.
- cos-st-restricts.2.3.1.1 = cos-st-restricts.2.3.1.1: il componente '{'final'}' di '{'item type definition'}' ''{0}'' contiene ''list'', pertanto ''{0}'' non pu\u00F2 essere utilizzato come tipo di elemento per il tipo di lista ''{1}''.
- cos-st-restricts.3.3.1.1 = cos-st-restricts.3.3.1.1: il componente '{'final'}' di '{'member type definitions'}' ''{0}'' contiene ''union'', pertanto ''{0}'' non pu\u00F2 essere utilizzato come tipo di membro per il tipo di unione ''{1}''.
- cos-valid-default.2.1 = cos-valid-default.2.1: l''elemento "{0}" ha un vincolo di valore e deve avere un modello di contenuto misto o semplice.
- cos-valid-default.2.2.2 = cos-valid-default.2.2.2: l''elemento ''{0}'' ha un '{'value constraint'}' e la rispettiva definizione del tipo contiene '{'content type'}' misto, quindi la parte di '{'content type'}' deve essere svuotabile.
- c-props-correct.2 = c-props-correct.2: la cardinalit\u00E0 dei campi per il keyref "{0}" e per la chiave "{1}" deve corrispondere.
- ct-props-correct.3 = ct-props-correct.3: sono state rilevate definizioni circolari per il tipo complesso ''{0}''. Ci\u00F2 significa che ''{0}'' si trova all''interno della sua stessa gerarchia di tipi, il che \u00E8 errato.
- ct-props-correct.4 = ct-props-correct.4: errore per il tipo "{0}". Sono specificati usi di attributi duplicati con lo stesso nome e spazio di nomi di destinazione. Il nome dell''uso dell''attributo duplicato \u00E8 "{1}".
- ct-props-correct.5 = ct-props-correct.5: errore per il tipo "{0}". Due dichiarazioni di attributo, "{1}" e "{2}" hanno tipi derivati dall''ID.
- derivation-ok-restriction.1 = derivation-ok-restriction.1: il tipo ''{0}'' \u00E8 stato derivato mediante limitazione dal tipo ''{1}'', ma ''{1}'' ha una propriet\u00E0 '{'final'}' che impedisce la derivazione mediante limitazione.
- derivation-ok-restriction.2.1.1 = derivation-ok-restriction.2.1.1: errore per il tipo "{0}". Un uso dell''attributo ''{1}'' in questo tipo ha un valore "use" ''{2}'' che \u00E8 incoerente con il valore di ''required'' in un uso corrispondente dell''attributo nel tipo di base.
- derivation-ok-restriction.2.1.2 = derivation-ok-restriction.2.12: errore per il tipo "{0}". Un uso dell''attributo ''{1}'' in questo tipo ha un valore tipo ''{2}'' che \u00E8 stato derivato in modo valido da ''{3}'', ovvero dal tipo di uso corrispondente dell''attributo nel tipo di base.
- derivation-ok-restriction.2.1.3.a = derivation-ok-restriction.2.1.3.a: errore per il tipo "{0}". L''uso dell''attributo ''{1}'' in questo tipo ha un vincolo di valore effettivo che \u00E8 fisso, mentre il vincolo di valore effettivo dell''uso dell''attributo corrispondente nel tipo di base \u00E8 fisso.
- derivation-ok-restriction.2.1.3.b = derivation-ok-restriction.2.1.3.b: errore per il tipo "{0}". L''uso dell''attributo ''{1}'' in questo tipo ha un vincolo di valore effettivo fisso con valore ''{2}'', che \u00E8 incoerente con il valore ''{3}'' per il vincolo di valore effettivo fisso dell''uso dell''attributo corrispondente nel tipo di base.
- derivation-ok-restriction.2.2.a = derivation-ok-restriction.2.2.a: errore per il tipo "{0}". L''uso dell''attributo ''{1}'' in questo tipo non ha un uso dell''attributo corrispondente nella base e il tipo di base non ha alcun attributo di carattere jolly.
- derivation-ok-restriction.2.2.b = derivation-ok-restriction.2.2.b: errore per il tipo "{0}". L''uso dell''attributo ''{1}'' in questo tipo non ha un uso dell''attributo corrispondente nella base e il carattere jolly nel tipo di base non consente lo spazio di nomi ''{2}'' di questo uso dell''attributo.
- derivation-ok-restriction.3 = derivation-ok-restriction.3: errore per il tipo "{0}". Nell''uso dell''attributo ''{1}'' nel tipo di base, REQUIRED \u00E8 impostato su true, ma non esiste alcun uso dell''attributo corrispondente nel tipo derivato.
- derivation-ok-restriction.4.1 = derivation-ok-restriction.4.1: errore per il tipo "{0}". La derivazione ha un carattere jolly dell''attributo, ma la base non ne ha uno.
- derivation-ok-restriction.4.2 = derivation-ok-restriction.4.2: errore per il tipo "{0}". Il carattere jolly nella derivazione non \u00E8 un subset di caratteri jolly valido di quello nella base.
- derivation-ok-restriction.4.3 = derivation-ok-restriction.4.3: errore per il tipo "{0}". Il contenuto del processo del carattere jolly nella derivazione ({1}) \u00E8 pi\u00F9 debole di quello nella base ({2}).
- derivation-ok-restriction.5.2.2.1 = derivation-ok-restriction.5.2.2.1: errore per il tipo ''{0}''. Il tipo di contenuto semplice ''del tipo ''{1}'' non \u00E8 una limitazione valida del tipo di contenuto semplice della base ''{2}''.
- derivation-ok-restriction.5.3.2 = derivation-ok-restriction.5.3.2: errore per il tipo ''{0}''. Il tipo di contenuto di questo tipo \u00E8 vuoto, ma il tipo di contenuto della base ''{1}'' non \u00E8 vuoto o svuotabile.
- derivation-ok-restriction.5.4.1.2 = derivation-ok-restriction.5.4.1.2: errore per il tipo "{0}". Il tipo di contenuto di questo tipo \u00E8 misto, ma il tipo di contenuto della base ''{1}'' non lo \u00E8.
- derivation-ok-restriction.5.4.2 = derivation-ok-restriction.5.4.2: errore per il tipo "{0}". La parte del tipo non \u00E8 una limitazione valida della parte della base.
- enumeration-required-notation = enumeration-required-notation: il tipo NOTATION ''{0}'' utilizzato da {2} ''{1}'' deve avere un valore di facet di enumerazione che specifica gli elementi di notazione utilizzati da questo tipo.
- enumeration-valid-restriction = enumeration-valid-restriction: il valore di enumerazione "{0}" non \u00E8 nello spazio dei valori del tipo di base {1}.
- e-props-correct.2 = e-props-correct.2: valore di vincolo di valore "{1}" non valido nell''elemento "{0}".
- e-props-correct.4 = e-props-correct.4: '{'type definition'}' dell''elemento "{0}" non \u00E8 stata derivata in modo valido da '{'type definition'}' di substitutionHead "{1}" o la propriet\u00E0 '{'substitution group exclusions'}' di ''{1}'' non consente questa derivazione.
- e-props-correct.5 = e-props-correct.5: non deve esistere '{'value constraint'}' sull''elemento "{0}" perch\u00E9 '{'type definition'}' dell''elemento o '{'content type'}' di '{'type definition'}' \u00E8 un ID o \u00E8 derivato da un ID.
- e-props-correct.6 = e-props-correct.6: gruppo di sostituzione circolare rilevato per l''elemento "{0}".
- fractionDigits-valid-restriction = fractionDigits-valid-restriction: nella definizione di {2}, il valore ''{0}'' per il facet ''fractionDigits'' non \u00E8 valido. Deve essere <= rispetto al valore per ''fractionDigits'', impostato su ''{1}'' in uno dei tipi di predecessore.
- fractionDigits-totalDigits = fractionDigits-totalDigits: nella definizione di {2}, il valore ''{0}'' per il facet ''fractionDigits'' non \u00E8 valido. Il valore deve essere <= rispetto al valore per ''totalDigits'', impostato su ''{1}''.
- length-minLength-maxLength.1.1 = length-minLength-maxLength.1.1: per il tipo {0}, il valore di lunghezza ''{1}'' non pu\u00F2 essere minore del valore di minLength ''{2}''.
- length-minLength-maxLength.1.2.a = length-minLength-maxLength.1.2.a: per il tipo {0}, la base non pu\u00F2 avere un facet minLength se la limitazione corrente ha un facet minLength e la limitazione corrente o la base ha un facet di lunghezza.
- length-minLength-maxLength.1.2.b = length-minLength-maxLength.1.2.b: per il tipo {0}, il valore corrente di minLength ''{1}'' deve essere uguale a valore di minLength ''{2}'' della base.
- length-minLength-maxLength.2.1 = length-minLength-maxLength.2.1: per il tipo {0}, il valore di lunghezza ''{1}'' non pu\u00F2 essere maggiore del valore di maxLength ''{2}''.
- length-minLength-maxLength.2.2.a = length-minLength-maxLength.2.2.a: per il tipo {0}, la base non pu\u00F2 avere un facet maxLength se la limitazione corrente ha un facet maxLength e la limitazione corrente o la base ha un facet di lunghezza.
- length-minLength-maxLength.2.2.b = length-minLength-maxLength.2.2.b: per il tipo {0}, il valore corrente di maxLength ''{1}'' deve essere uguale a valore di maxLength ''{2}'' della base.
- length-valid-restriction = length-valid-restriction: errore per il tipo ''{2}''. Il valore della lunghezza = "{0}" deve essere = al valore di quella del tipo di base "{1}".
- maxExclusive-valid-restriction.1 = maxExclusive-valid-restriction.1: errore per il tipo ''{2}''. Il valore maxExclusive ="{0}" deve essere <= maxExclusive del tipo di base "{1}".
- maxExclusive-valid-restriction.2 = maxExclusive-valid-restriction.2: errore per il tipo ''{2}''. Il valore maxInclusive ="{0}" deve essere <= maxExclusive del tipo di base "{1}".
- maxExclusive-valid-restriction.3 = maxExclusive-valid-restriction.3: errore per il tipo ''{2}''. Il valore maxExclusive ="{0}" deve essere > minInclusive del tipo di base "{1}".
- maxExclusive-valid-restriction.4 = maxExclusive-valid-restriction.2: errore per il tipo ''{2}''. Il valore maxExclusive ="{0}" deve essere > minExclusive del tipo di base "{1}".
- maxInclusive-maxExclusive = maxInclusive-maxExclusive: non \u00E8 possibile specificare sia maxInclusive che maxExclusive per lo stesso tipo di dati. In {2}, maxInclusive = ''{0}'' e maxExclusive = ''{1}''.
- maxInclusive-valid-restriction.1 = maxInclusive-valid-restriction.1: errore per il tipo ''{2}''. Il valore maxInclusive ="{0}" deve essere <= maxInclusive del tipo di base "{1}".
- maxInclusive-valid-restriction.2 = maxInclusive-valid-restriction.2: errore per il tipo ''{2}''. Il valore maxInclusive ="{0}" deve essere <= maxExclusive del tipo di base "{1}".
- maxInclusive-valid-restriction.3 = maxInclusive-valid-restriction.3: errore per il tipo ''{2}''. Il valore maxInclusive ="{0}" deve essere >= minInclusive del tipo di base "{1}".
- maxInclusive-valid-restriction.4 = maxInclusive-valid-restriction.4: errore per il tipo ''{2}''. Il valore maxInclusive ="{0}" deve essere > minExclusive del tipo di base "{1}".
- maxLength-valid-restriction = maxLength-valid-restriction: nella definizione di {2}, il valore maxLength = "{0}" deve essere <= rispetto a quello del tipo di base "{1}".
- mg-props-correct.2 = mg-props-correct.2: definizioni circolari rilevate per il gruppo ''{0}''. Se si seguono in maniera ricorsiva i valori '{'term'}' delle parti, se ne avr\u00E0 una il cui '{'term'}' \u00E8 il gruppo stesso.
- minExclusive-less-than-equal-to-maxExclusive = minExclusive-less-than-equal-to-maxExclusive: nella definizione di {2}, il valore minExclusive = ''{0}'' deve essere <= rispetto al valore maxExclusive = ''{1}''.
- minExclusive-less-than-maxInclusive = minExclusive-less-than-maxInclusive: nella definizione di {2}, il valore minExclusive = ''{0}'' deve essere <= rispetto al valore maxInclusive = ''{1}''.
- minExclusive-valid-restriction.1 = minExclusive-valid-restriction.1: errore per il tipo ''{2}''. Il valore minExclusive ="{0}" deve essere >= minExclusive del tipo di base "{1}".
- minExclusive-valid-restriction.2 = minExclusive-valid-restriction.2: errore per il tipo ''{2}''. Il valore minExclusive ="{0}" deve essere <= maxInclusive del tipo di base "{1}".
- minExclusive-valid-restriction.3 = minExclusive-valid-restriction.4: errore per il tipo ''{2}''. Il valore minExclusive ="{0}" deve essere >= minInclusive del tipo di base "{1}".
- minExclusive-valid-restriction.4 = minExclusive-valid-restriction.4: errore per il tipo ''{2}''. Il valore minExclusive ="{0}" deve essere < maxExclusive del tipo di base "{1}".
- minInclusive-less-than-equal-to-maxInclusive = minInclusive-less-than-equal-to-maxInclusive: nella definizione di {2}, il valore minInclusive = ''{0}'' deve essere <= rispetto al valore maxInclusive = ''{1}''.
- minInclusive-less-than-maxExclusive = minInclusive-less-than-maxExclusive: nella definizione di {2}, il valore minInclusive = ''{0}'' deve essere < rispetto al valore maxExclusive = ''{1}''.
- minInclusive-minExclusive = minInclusive-minExclusive: non \u00E8 possibile specificare sia minInclusive che minExclusive per lo stesso tipo di dati. In {2}, minInclusive = ''{0}'' e minExclusive = ''{1}''.
- minInclusive-valid-restriction.1 = minInclusive-valid-restriction.1: errore per il tipo ''{2}''. Il valore minInclusive ="{0}" deve essere >= minInclusive del tipo di base "{1}".
- minInclusive-valid-restriction.2 = minInclusive-valid-restriction.2: errore per il tipo ''{2}''. Il valore minInclusive ="{0}" deve essere <= maxInclusive del tipo di base "{1}".
- minInclusive-valid-restriction.3 = minInclusive-valid-restriction.3: errore per il tipo ''{2}''. Il valore minInclusive ="{0}" deve essere > minExclusive del tipo di base "{1}".
- minInclusive-valid-restriction.4 = minInclusive-valid-restriction.4: errore per il tipo ''{2}''. Il valore minInclusive ="{0}" deve essere < maxExclusive del tipo di base "{1}".
- minLength-less-than-equal-to-maxLength = minLength-less-than-equal-to-maxLength: nella definizione di {2}, il valore minLength = ''{0}'' deve essere < rispetto al valore maxLength = ''{1}''.
- minLength-valid-restriction = minLength-valid-restriction: nella definizione di {2}, minLength = ''{0}'' deve essere >= rispetto a quello del tipo di base ''{1}''.
- no-xmlns = no-xmlns: il {'name'} di una dichiarazione di attributo non deve corrispondere a 'xmlns'.
- no-xsi = no-xsi: il '{'target namespace'}' di una dichiarazione di attributo non deve corrispondere a "{0}".
- p-props-correct.2.1 = p-props-correct.2.1: nella dichiarazione di ''{0}'', il valore di ''minOccurs'' \u00E8 ''{1}'', ma non deve essere maggiore del valore di ''maxOccurs'', che \u00E8 ''{2}''.
- rcase-MapAndSum.1 = rcase-MapAndSum.1: non esiste un mapping funzionale completo tra le parti.
- rcase-MapAndSum.2 = rcase-MapAndSum.2: l''intervallo di ricorrenza ({0},{1}) del gruppo non \u00E8 una limitazione valida dell''intervallo di ricorrenza ({2},{3}) del gruppo di base.
- rcase-NameAndTypeOK.1 = rcase-NameAndTypeOK.1: alcuni elementi hanno nomi e spazi di nomi di destinazione che non sono uguali: l''elemento "{0}" nello spazio di nomi "{1}" e l''elemento "{2}" nello spazio di nomi "{3}".
- rcase-NameAndTypeOK.2 = rcase-NameAndTypeOK.2: errore per la parte il cui '{'term'}' \u00E8 la dichiarazione di elemento ''{0}''. Il valore '{'nillable'}' della dichiarazione di elemento \u00E8 impostato su true, ma la parte corrispondente nel tipo di base contiene una dichiarazione di elemento per la quale '{'nillable'}' \u00E8 impostato su false.
- rcase-NameAndTypeOK.3 = rcase-NameAndTypeOK.3: errore per la parte il cui '{'term'}' \u00E8 la dichiarazione di elemento ''{0}''. L''intervallo di ricorrenza ({1},{2}) non \u00E8 una limitazione valida dell''intervallo ({3},{4}) della parte corrispondente nel tipo di base.
- rcase-NameAndTypeOK.4.a = rcase-NameAndTypeOK.4.a: l''elemento "{0}" non \u00E8 fisso, ma l''elemento corrispondente nel tipo di base \u00E8 fisso con il valore ''{1}''.
- rcase-NameAndTypeOK.4.b = rcase-NameAndTypeOK.4.b: l''elemento "{0}" \u00E8 fisso con il valore ''{1}'', ma l''elemento corrispondente nel tipo di base \u00E8 fisso con il valore ''{2}''.
- rcase-NameAndTypeOK.5 = rcase-NameAndTypeOK.5: i vincoli di identit\u00E0 per l''elemento "{0}" non sono un subset di quelli nella base.
- rcase-NameAndTypeOK.6 = rcase-NameAndTypeOK.6: le sostituzioni non consentite per l''elemento "{0}" non sono un superset di quelle nella base.
- rcase-NameAndTypeOK.7 = rcase-NameAndTypeOK.7: il tipo "{1}" dell''elemento "{0}" non deriva dal tipo dell''elemento di base "{2}".
- rcase-NSCompat.1 = rcase-NSCompat.1: l''elemento "{0}" ha uno spazio di nomi "{1}" che non \u00E8 consentito dal carattere jolly nella base.
- rcase-NSCompat.2 = rcase-NSCompat.2: errore per la parte il cui '{'term'}' \u00E8 la dichiarazione di elemento ''{0}''. L''intervallo di ricorrenza ({1},{2}) non \u00E8 una limitazione valida dell''intervallo ({3},{4}) della parte corrispondente nel tipo di base.
- rcase-NSRecurseCheckCardinality.1 = rcase-NSRecurseCheckCardinality.1: non esiste un mapping funzionale completo tra le parti.
- rcase-NSRecurseCheckCardinality.2 = rcase-NSRecurseCheckCardinality.2: l''intervallo di ricorrenza ({0},{1}) del gruppo non \u00E8 una limitazione valida dell''intervallo ({2},{3}) del carattere jolly di base.
- rcase-NSSubset.1 = rcase-NSSubset.1: il carattere jolly non \u00E8 un subset del carattere jolly corrispondente nella base.
- rcase-NSSubset.2 = rcase-NSSubset.2: l''intervallo di ricorrenza ({0},{1}) del carattere jolly non \u00E8 una limitazione valida di quello nella base ({2},{3}).
- rcase-NSSubset.3 = rcase-NSSubset.3: il contenuto ''{0}'' del processo del carattere jolly \u00E8 pi\u00F9 debole di quello della base ''{1}''.
- rcase-Recurse.1 = rcase-Recurse.1: l''intervallo di ricorrenza ({0},{1}) del gruppo non \u00E8 una limitazione valida dell''intervallo di ricorrenza ({2},{3}) del gruppo di base.
- rcase-Recurse.2 = rcase-Recurse.2: non esiste un mapping funzionale completo tra le parti.
- rcase-RecurseLax.1 = rcase-RecurseLax.1: l''intervallo di ricorrenza ({0},{1}) del gruppo non \u00E8 una limitazione valida dell''intervallo di ricorrenza ({2},{3}) del gruppo di base.
- rcase-RecurseLax.2 = rcase-RecurseLax.2: non esiste un mapping funzionale completo tra le parti.
- rcase-RecurseUnordered.1 = rcase-RecurseUnordered.1: l''intervallo di ricorrenza ({0},{1}) del gruppo non \u00E8 una limitazione valida dell''intervallo di ricorrenza ({2},{3}) del gruppo di base.
- rcase-RecurseUnordered.2 = rcase-RecurseUnordered.2: non esiste un mapping funzionale completo tra le parti.
-# We're using sch-props-correct.2 instead of the old src-redefine.1
-# src-redefine.1 = src-redefine.1: The component ''{0}'' is begin redefined, but its corresponding component isn't in the schema document being redefined (with namespace ''{2}''), but in a different document, with namespace ''{1}''.
- sch-props-correct.2 = sch-props-correct.2: uno schema non pu\u00F2 contenere due componenti globali con lo stesso nome; questo contiene due ricorrenze di "{0}".
- st-props-correct.2 = st-props-correct.2: sono state rilevate definizioni circolari per il tipo semplice ''{0}''. Ci\u00F2 significa che ''{0}'' si trova all''interno della sua stessa gerarchia di tipi, il che \u00E8 errato.
- st-props-correct.3 = st-props-correct.3: errore per il tipo ''{0}''. Il valore di '{'final'}' per '{'base type definition'}', ''{1}'', impedisce la derivazione mediante limitazione.
- totalDigits-valid-restriction = totalDigits-valid-restriction: nella definizione di {2}, il valore ''{0}'' per il facet ''totalDigits'' non \u00E8 valido. Deve essere <= rispetto al valore per ''totalDigits'', impostato su ''{1}'' in uno dei tipi di predecessore.
- whiteSpace-valid-restriction.1 = whiteSpace-valid-restriction.1: nella definizione di {0}, il valore ''{1}'' per il facet ''whitespace'' non \u00E8 valido. Il valore per ''whitespace'' \u00E8 stato impostato su ''collapse'' in uno dei tipi di predecessore.
- whiteSpace-valid-restriction.2 = whiteSpace-valid-restriction.2: nella definizione di {0}, il valore ''preserve'' per il facet ''whitespace'' non \u00E8 valido. Il valore per ''whitespace'' \u00E8 stato impostato su ''replace'' in uno dei tipi di predecessore.
-
-#schema for Schemas
-
- s4s-att-invalid-value = s4s-att-invalid-value: valore di attributo non valido per "{1}" nell''elemento "{0}": Motivo registrato: {2}
- s4s-att-must-appear = s4s-att-must-appear: l''attributo ''{1}'' deve apparire nell''elemento "{0}".
- s4s-att-not-allowed = s4s-att-not-allowed: l''attributo ''{1}'' non pu\u00F2 apparire nell''elemento "{0}".
- s4s-elt-invalid = s4s-elt-invalid: l''elemento "{0}" non \u00E8 un elemento valido nel documento dello schema.
- s4s-elt-must-match.1 = s4s-elt-must-match.1: il contenuto di "{0}" deve corrispondere a {1}. Si \u00E8 verificato un problema con inizio in {2}.
- s4s-elt-must-match.2 = s4s-elt-must-match.2: il contenuto di "{0}" deve corrispondere a {1}. Non sono stati trovati elementi sufficienti.
- # the "invalid-content" messages provide less information than the "must-match" counterparts above. They're used for complex types when providing a "match" would be an information dump
- s4s-elt-invalid-content.1 = s4s-elt-invalid-content.1: il contenuto di ''{0}'' non \u00E8 valido. L''elemento ''{1}'' non \u00E8 valido, si trova in una posizione errata o \u00E8 presente troppe volte.
- s4s-elt-invalid-content.2 = s4s-elt-invalid-content.2: il contenuto di ''{0}'' non \u00E8 valido. L''elemento ''{1}'' non pu\u00F2 essere vuoto.
- s4s-elt-invalid-content.3 = s4s-elt-invalid-content.3: gli elementi di tipo ''{0}'' non possono trovarsi dopo dichiarazioni come elementi figlio di un elemento <schema>.
- s4s-elt-schema-ns = s4s-elt-schema-ns: lo spazio di nomi dell''elemento ''{0}'' deve derivare dallo spazio di nomi dello schema ''http://www.w3.org/2001/XMLSchema''.
- s4s-elt-character = s4s-elt-character: non sono consentiti caratteri diversi dallo spazio negli elementi di schema diversi da ''xs:appinfo'' e ''xs:documentation''. Rilevato "{0}".
-
-# codes not defined by the spec
-
- c-fields-xpaths = c-fields-xpaths: il valore di campo = "{0}" non \u00E8 valido.
- c-general-xpath = c-general-xpath: l''espressione "{0}" non \u00E8 valida rispetto al subset XPath supportato dallo schema XML.
- c-general-xpath-ns = c-general-xpath-ns: un prefisso dello spazio di nomi nell''espressione XPath "{0}" non \u00E8 associato a uno spazio di nomi.
- c-selector-xpath = c-selector-xpath: il valore del selettore = "{0}" non \u00E8 valido; gli XPath del selettore non possono contenere attributi.
- EmptyTargetNamespace = EmptyTargetNamespace: nel documento di schema ''{0}'' il valore dell''attributo ''targetNamespace'' non pu\u00F2 essere una stringa vuota.
- FacetValueFromBase = FacetValueFromBase: nella dichiarazione del tipo ''{0}'' il valore ''{1}'' del facet ''{2}'' deve provenire dallo spazio di valori del tipo di base ''{3}''.
- FixedFacetValue = FixedFacetValue: nella definizione di {3}, il valore ''{1}'' per il facet ''{0}'' non \u00E8 valido. Il valore per ''{0}'' \u00E8 stato impostato su ''{2}'' in uno dei tipi di predecessore e '{'fixed'}' = true.
- InvalidRegex = InvalidRegex: il valore di pattern "{0}" non \u00E8 un''espressione regolare valida. Errore segnalato ''{1}'' nella colonna ''{2}''.
- MaxOccurLimit = La configurazione corrente del parser non consente che un valore di attributo maxOccurs sia impostato su un valore maggiore del valore {0}.
- PublicSystemOnNotation = PublicSystemOnNotation: almeno uno tra ''public'' e ''system'' deve essere presente nell'elemento ''notation''.
- SchemaLocation = SchemaLocation: il valore = ''{0}'' di schemaLocation deve avere un numero pari di URI.
- TargetNamespace.1 = TargetNamespace.1: lo spazio di nomi previsto \u00E8 "{0}", ma lo spazio di nomi di destinazione del documento dello schema \u00E8 "{1}".
- TargetNamespace.2 = TargetNamespace.2: non \u00E8 previsto nessuno spazio di nomi, ma il documento dello schema ha uno spazio di nomi di destinazione ''{1}''.
- UndeclaredEntity = UndeclaredEntity: l''entit\u00E0 ''{0}'' non \u00E8 stata dichiarata.
- UndeclaredPrefix = UndeclaredPrefix: impossibile risolvere ''{0}'' come QName. Il prefisso ''{1}'' non \u00E8 stato dichiarato.
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_ja.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_ja.properties
deleted file mode 100644
index f04867d..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_ja.properties
+++ /dev/null
@@ -1,291 +0,0 @@
-# This file contains error and warning messages related to XML Schema
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
- BadMessageKey = \u30E1\u30C3\u30BB\u30FC\u30B8\u30FB\u30AD\u30FC\u306B\u5BFE\u5FDC\u3059\u308B\u30A8\u30E9\u30FC\u30FB\u30E1\u30C3\u30BB\u30FC\u30B8\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002
- FormatFailed = \u6B21\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\u306E\u66F8\u5F0F\u8A2D\u5B9A\u4E2D\u306B\u5185\u90E8\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F:\n
-
-# For internal use
-
- Internal-Error = \u5185\u90E8\u30A8\u30E9\u30FC: {0}\u3002
- dt-whitespace = \u5171\u7528\u4F53\u306EsimpleType ''{0}''\u306B\u306F\u7A7A\u767D\u306E\u30D5\u30A1\u30BB\u30C3\u30C8\u5024\u3092\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093
- GrammarConflict = \u30E6\u30FC\u30B6\u30FC\u306E\u69CB\u6587\u30D7\u30FC\u30EB\u304B\u3089\u623B\u3055\u308C\u305F\u69CB\u6587\u306E\u3044\u305A\u308C\u304B\u304C\u4ED6\u306E\u69CB\u6587\u3068\u7AF6\u5408\u3057\u3066\u3044\u307E\u3059\u3002
-
-# Identity constraints
-
- AbsentKeyValue = \u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u5236\u7D04\u30A8\u30E9\u30FC(cvc-identity-constraint.4.2.1): \u8981\u7D20"{0}"\u306B\u5024\u306E\u306A\u3044\u30AD\u30FC\u304C\u3042\u308A\u307E\u3059\u3002
- DuplicateField = \u30D5\u30A3\u30FC\u30EB\u30C9"{0}"\u306E\u30B9\u30B3\u30FC\u30D7\u5185\u3067\u4E00\u81F4\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059\u3002
- DuplicateKey = \u8981\u7D20"{1}"\u306E\u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u5236\u7D04\u3067\u5BA3\u8A00\u3055\u308C\u305Fkey\u306E\u5024[{0}]\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059\u3002
- DuplicateUnique = \u8981\u7D20"{1}"\u306E\u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u5236\u7D04\u3067\u5BA3\u8A00\u3055\u308C\u305Funique\u306E\u5024[{0}]\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059\u3002
- FieldMultipleMatch = \u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u5236\u7D04\u30A8\u30E9\u30FC: \u30D5\u30A3\u30FC\u30EB\u30C9"{0}"\u304C\u30BB\u30EC\u30AF\u30BF\u306E\u30B9\u30B3\u30FC\u30D7\u5185\u306E\u8907\u6570\u306E\u5024\u3068\u4E00\u81F4\u3057\u3066\u3044\u307E\u3059\u3002\u30D5\u30A3\u30FC\u30EB\u30C9\u306Funique\u306E\u5024\u3068\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- FixedDiffersFromActual = \u3053\u306E\u8981\u7D20\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u306F\u3001\u30B9\u30AD\u30FC\u30DE\u5185\u306E\u8981\u7D20\u5BA3\u8A00\u3067\u306E"fixed"\u5C5E\u6027\u306E\u5024\u3068\u7570\u306A\u308A\u307E\u3059\u3002
- KeyMatchesNillable = \u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u5236\u7D04\u30A8\u30E9\u30FC(cvc-identity-constraint.4.2.3): \u8981\u7D20"{0}"\u306B\u306F\u3001nillable\u304Ctrue\u3067\u3042\u308B\u8981\u7D20\u3068\u4E00\u81F4\u3059\u308B\u30AD\u30FC\u304C\u3042\u308A\u307E\u3059\u3002
- KeyNotEnoughValues = \u8981\u7D20"{0}"\u306B\u6307\u5B9A\u3055\u308C\u3066\u3044\u308B<key name="{1}">\u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u5236\u7D04\u306B\u3001\u5341\u5206\u306A\u5024\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
- KeyNotFound = \u8981\u7D20''{2}''\u306E\u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u5236\u7D04\u3067\u3001\u5024''{1}''\u306E\u30AD\u30FC''{0}''\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002
- KeyRefNotEnoughValues = \u8981\u7D20"{0}"\u306B\u6307\u5B9A\u3055\u308C\u3066\u3044\u308B<keyref name="{1}">\u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u5236\u7D04\u306B\u3001\u5341\u5206\u306A\u5024\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
- KeyRefOutOfScope = \u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u5236\u7D04\u30A8\u30E9\u30FC: \u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u5236\u7D04"{0}"\u306B\u3001\u30B9\u30B3\u30FC\u30D7\u5916\u306Ekey\u3084unique\u3092\u53C2\u7167\u3057\u3066\u3044\u308Bkeyref\u304C\u3042\u308A\u307E\u3059\u3002
- KeyRefReferNotFound = \u30AD\u30FC\u53C2\u7167\u306E\u5BA3\u8A00"{0}"\u304C\u3001"{1}"\u3068\u3044\u3046\u540D\u524D\u306E\u4E0D\u660E\u306A\u30AD\u30FC\u3092\u53C2\u7167\u3057\u3066\u3044\u307E\u3059\u3002
- UniqueNotEnoughValues = \u8981\u7D20"{0}"\u306B\u6307\u5B9A\u3055\u308C\u3066\u3044\u308B<unique>\u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u5236\u7D04\u306B\u3001\u5341\u5206\u306A\u5024\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
- UnknownField = \u5185\u90E8\u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u5236\u7D04\u30A8\u30E9\u30FC: \u30D5\u30A3\u30FC\u30EB\u30C9"{0}"\u304C\u4E0D\u660E\u3067\u3059\u3002
-
-# Ideally, we should only use the following error keys, not the ones under
-# "Identity constraints". And we should cover all of the following errors.
-
-#validation (3.X.4)
-
- cvc-attribute.3 = cvc-attribute.3: \u8981\u7D20''{0}''\u306E\u5C5E\u6027''{1}''\u306E\u5024''{2}''\u306F\u3001\u305D\u306E\u30BF\u30A4\u30D7''{3}''\u306B\u5BFE\u3057\u3066\u7121\u52B9\u3067\u3059\u3002
- cvc-attribute.4 = cvc-attribute.4: \u8981\u7D20''{0}''\u306E\u5C5E\u6027''{1}''\u306E\u5024''{2}''\u306F\u3001\u56FA\u5B9A\u306E'{'value constraint'}'\u306B\u5BFE\u3057\u3066\u7121\u52B9\u3067\u3059\u3002\u5C5E\u6027\u306E\u5024\u306F''{3}''\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- cvc-complex-type.2.1 = cvc-complex-type.2.1: \u30BF\u30A4\u30D7\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u30FB\u30BF\u30A4\u30D7\u304C\u7A7A\u767D\u3067\u3042\u308B\u305F\u3081\u3001\u8981\u7D20''{0}''\u306B\u306F\u6587\u5B57\u3084\u8981\u7D20\u60C5\u5831\u30A2\u30A4\u30C6\u30E0[children]\u3092\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\u3002
- cvc-complex-type.2.2 = cvc-complex-type.2.2: \u8981\u7D20''{0}''\u306F\u8981\u7D20[children]\u3092\u542B\u307E\u305A\u3001\u6709\u52B9\u306A\u5024\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- cvc-complex-type.2.3 = cvc-complex-type.2.3: \u30BF\u30A4\u30D7\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u30FB\u30BF\u30A4\u30D7\u304C\u8981\u7D20\u306E\u307F\u3067\u3042\u308B\u305F\u3081\u3001\u8981\u7D20''{0}''\u306B\u306F\u6587\u5B57[children]\u3092\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\u3002
- cvc-complex-type.2.4.a = cvc-complex-type.2.4.a: \u8981\u7D20''{0}''\u3067\u59CB\u307E\u308B\u7121\u52B9\u306A\u30B3\u30F3\u30C6\u30F3\u30C4\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002''{1}''\u306E\u3044\u305A\u308C\u304B\u304C\u5FC5\u8981\u3067\u3059\u3002
- cvc-complex-type.2.4.b = cvc-complex-type.2.4.b: \u8981\u7D20''{0}''\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u306F\u4E0D\u5B8C\u5168\u3067\u3059\u3002''{1}''\u306E\u3044\u305A\u308C\u304B\u304C\u5FC5\u8981\u3067\u3059\u3002
- cvc-complex-type.2.4.c = cvc-complex-type.2.4.c: \u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9\u306E\u4E00\u81F4\u306F\u53B3\u5BC6\u3067\u3059\u304C\u3001\u8981\u7D20''{0}''\u3067\u5BA3\u8A00\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002
- cvc-complex-type.2.4.d = cvc-complex-type.2.4.d: \u8981\u7D20''{0}''\u3067\u59CB\u307E\u308B\u7121\u52B9\u306A\u30B3\u30F3\u30C6\u30F3\u30C4\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002\u3053\u3053\u3067\u306F\u5B50\u8981\u7D20\u3092\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\u3002
- cvc-complex-type.2.4.e = cvc-complex-type.2.4.d: \u8981\u7D20''{0}''\u3067\u59CB\u307E\u308B\u7121\u52B9\u306A\u30B3\u30F3\u30C6\u30F3\u30C4\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002\u3053\u3053\u3067\u306F\u5B50\u8981\u7D20''{1}''\u3092\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\u3002
- cvc-complex-type.3.1 = cvc-complex-type.3.1: \u8981\u7D20''{0}''\u306E\u5C5E\u6027''{1}''\u306E\u5024''{2}''\u306F\u3001\u5BFE\u5FDC\u3059\u308B\u5C5E\u6027\u4F7F\u7528\u306B\u5BFE\u3057\u3066\u7121\u52B9\u3067\u3059\u3002\u5C5E\u6027''{1}''\u306B\u306F\u56FA\u5B9A\u5024''{3}"\u304C\u3042\u308A\u307E\u3059\u3002
- cvc-complex-type.3.2.1 = cvc-complex-type.3.2.1: \u8981\u7D20''{0}''\u306B\u3001\u5C5E\u6027''{1}''\u7528\u306E\u5C5E\u6027\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9\u304C\u3042\u308A\u307E\u305B\u3093\u3002
- cvc-complex-type.3.2.2 = cvc-complex-type.3.2.2: \u8981\u7D20''{0}''\u306B\u5C5E\u6027''{1}''\u3092\u542B\u3081\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002
- cvc-complex-type.4 = cvc-complex-type.4: \u8981\u7D20''{0}''\u306B\u5C5E\u6027''{1}''\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- cvc-complex-type.5.1 = cvc-complex-type.5.1: \u8981\u7D20''{0}''\u3067\u306F\u5C5E\u6027''{1}''\u304CWild ID\u3067\u3059\u304C\u3001\u3059\u3067\u306BWild ID ''{2}''\u304C\u5B58\u5728\u3057\u3066\u3044\u307E\u3059\u3002\u8A31\u53EF\u3055\u308C\u308BWild ID\u306F1\u3064\u306E\u307F\u3067\u3059\u3002
- cvc-complex-type.5.2 = cvc-complex-type.5.2: \u8981\u7D20''{0}''\u3067\u306F\u5C5E\u6027''{1}''\u304CWild ID\u3067\u3059\u304C\u3001ID\u304B\u3089\u5C0E\u51FA\u3055\u308C\u305F\u5C5E\u6027''{2}''\u304C'{'attribute uses'}'\u306B\u3059\u3067\u306B\u5B58\u5728\u3057\u3066\u3044\u307E\u3059\u3002
- cvc-datatype-valid.1.2.1 = cvc-datatype-valid.1.2.1: ''{0}''\u306F''{1}''\u306E\u6709\u52B9\u306A\u5024\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
- cvc-datatype-valid.1.2.2 = cvc-datatype-valid.1.2.2: ''{0}''\u306F\u30EA\u30B9\u30C8\u30FB\u30BF\u30A4\u30D7''{1}''\u306E\u6709\u52B9\u306A\u5024\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
- cvc-datatype-valid.1.2.3 = cvc-datatype-valid.1.2.3: ''{0}''\u306F\u5171\u7528\u4F53\u30BF\u30A4\u30D7''{1}''\u306E\u6709\u52B9\u306A\u5024\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
- cvc-elt.1 = cvc-elt.1: \u8981\u7D20''{0}''\u306E\u5BA3\u8A00\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002
- cvc-elt.2 = cvc-elt.2: ''{0}''\u306B\u5BFE\u3059\u308B\u8981\u7D20\u5BA3\u8A00\u306E\u5024'{'abstract'}'\u306F\u3001false\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- cvc-elt.3.1 = cvc-elt.3.1: \u5C5E\u6027''{1}''\u306F\u8981\u7D20''{0}''\u306B\u8868\u793A\u3055\u308C\u307E\u305B\u3093\u3002\u3053\u308C\u306F\u3001'{'nillable'}'\u30D7\u30ED\u30D1\u30C6\u30A3(''{0}'')\u304Cfalse\u3067\u3042\u308B\u305F\u3081\u3067\u3059\u3002
- cvc-elt.3.2.1 = cvc-elt.3.2.1: ''{1}''\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u308B\u305F\u3081\u3001\u8981\u7D20''{0}''\u306B\u306F\u6587\u5B57\u3084\u8981\u7D20\u60C5\u5831[children]\u3092\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\u3002
- cvc-elt.3.2.2 = cvc-elt.3.2.2: \u56FA\u5B9A\u306E'{'value constraint'}'\u3092\u8981\u7D20''{0}''\u306B\u5BFE\u3057\u3066\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\u3002''{1}''\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002
- cvc-elt.4.1 = cvc-elt.4.1: \u8981\u7D20''{0}''\u306E\u5C5E\u6027''{1}''\u306E\u5024''{2}''\u306F\u6709\u52B9\u306AQName\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
- cvc-elt.4.2 = cvc-elt.4.2: ''{1}''\u3092\u8981\u7D20''{0}''\u306E\u30BF\u30A4\u30D7\u5B9A\u7FA9\u306B\u89E3\u6C7A\u3067\u304D\u307E\u305B\u3093\u3002
- cvc-elt.4.3 = cvc-elt.4.3: \u30BF\u30A4\u30D7''{1}''\u306F\u3001\u8981\u7D20''{0}''\u306E\u30BF\u30A4\u30D7\u5B9A\u7FA9''{2}''\u304B\u3089\u6B63\u5E38\u306B\u5C0E\u51FA\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
- cvc-elt.5.1.1 = cvc-elt.5.1.1: '{'value constraint'}' ''{2}''(\u8981\u7D20''{0}'')\u306F\u3001\u30BF\u30A4\u30D7''{1}''\u306E\u6709\u52B9\u306A\u30C7\u30D5\u30A9\u30EB\u30C8\u5024\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
- cvc-elt.5.2.2.1 = cvc-elt.5.2.2.1: \u8981\u7D20''{0}''\u306B\u306F\u8981\u7D20\u60C5\u5831\u30A2\u30A4\u30C6\u30E0[children]\u3092\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\u3002
- cvc-elt.5.2.2.2.1 = cvc-elt.5.2.2.2.1: \u8981\u7D20''{0}''\u306E\u5024''{1}''\u304C\u3001\u56FA\u5B9A\u306E'{'value constraint'}'\u5024''{2}''\u306B\u4E00\u81F4\u3057\u307E\u305B\u3093\u3002
- cvc-elt.5.2.2.2.2 = cvc-elt.5.2.2.2.2: \u8981\u7D20''{0}''\u306E\u5024''{1}''\u304C\u3001'{'value constraint'}'\u5024''{2}''\u306B\u4E00\u81F4\u3057\u307E\u305B\u3093\u3002
- cvc-enumeration-valid = cvc-enumeration-valid: \u5024''{0}''\u306F\u3001\u5217\u6319''{1}''\u306B\u5BFE\u3057\u3066\u30D5\u30A1\u30BB\u30C3\u30C8\u304C\u6709\u52B9\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002\u5217\u6319\u304B\u3089\u306E\u5024\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- cvc-fractionDigits-valid = cvc-fractionDigits-valid: \u5024''{0}''\u306E\u5C0F\u6570\u306E\u6841\u6570\u306F{1}\u3067\u3059\u304C\u3001\u5C0F\u6570\u306E\u6841\u6570\u306F{2}\u306B\u5236\u9650\u3055\u308C\u3066\u3044\u307E\u3059\u3002
- cvc-id.1 = cvc-id.1: IDREF ''{0}''\u306EID/IDREF\u30D0\u30A4\u30F3\u30C7\u30A3\u30F3\u30B0\u306F\u3042\u308A\u307E\u305B\u3093\u3002
- cvc-id.2 = cvc-id.2: ID\u5024''{0}''\u304C\u8907\u6570\u51FA\u73FE\u3057\u3066\u3044\u307E\u3059\u3002
- cvc-id.3 = cvc-id.3: \u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u5236\u7D04''{0}''\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u304C\u8981\u7D20''{1}''\u306B\u4E00\u81F4\u3057\u3066\u3044\u307E\u3059\u304C\u3001\u3053\u306E\u8981\u7D20\u306B\u306F\u5358\u7D14\u578B\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u305B\u3093\u3002
- cvc-length-valid = cvc-length-valid: \u9577\u3055\u304C''{1}''\u3067\u3042\u308B\u5024''{0}''\u306F\u3001\u30BF\u30A4\u30D7''{3}''\u306E\u9577\u3055''{2}''\u306B\u5BFE\u3057\u3066\u30D5\u30A1\u30BB\u30C3\u30C8\u304C\u6709\u52B9\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
- cvc-maxExclusive-valid = cvc-maxExclusive-valid: \u5024''{0}''\u306F\u3001\u30BF\u30A4\u30D7''{2}''\u306EmaxExclusive ''{1}''\u306B\u5BFE\u3057\u3066\u30D5\u30A1\u30BB\u30C3\u30C8\u304C\u6709\u52B9\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
- cvc-maxInclusive-valid = cvc-maxInclusive-valid: \u5024''{0}''\u306F\u3001\u30BF\u30A4\u30D7''{2}''\u306EmaxInclusive ''{1}''\u306B\u5BFE\u3057\u3066\u30D5\u30A1\u30BB\u30C3\u30C8\u304C\u6709\u52B9\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
- cvc-maxLength-valid = cvc-maxLength-valid: \u9577\u3055\u304C''{1}''\u3067\u3042\u308B\u5024''{0}''\u306F\u3001\u30BF\u30A4\u30D7''{3}''\u306EmaxLength ''{2}''\u306B\u5BFE\u3057\u3066\u30D5\u30A1\u30BB\u30C3\u30C8\u304C\u6709\u52B9\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
- cvc-minExclusive-valid = cvc-minExclusive-valid: \u5024''{0}''\u306F\u3001\u30BF\u30A4\u30D7''{2}''\u306EminExclusive ''{1}''\u306B\u5BFE\u3057\u3066\u30D5\u30A1\u30BB\u30C3\u30C8\u304C\u6709\u52B9\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
- cvc-minInclusive-valid = cvc-minInclusive-valid: \u5024''{0}''\u306F\u3001\u30BF\u30A4\u30D7''{2}''\u306EminInclusive ''{1}''\u306B\u5BFE\u3057\u3066\u30D5\u30A1\u30BB\u30C3\u30C8\u304C\u6709\u52B9\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
- cvc-minLength-valid = cvc-minLength-valid: \u9577\u3055\u304C''{1}''\u3067\u3042\u308B\u5024''{0}''\u306F\u3001\u30BF\u30A4\u30D7''{3}''\u306EminLength ''{2}''\u306B\u5BFE\u3057\u3066\u30D5\u30A1\u30BB\u30C3\u30C8\u304C\u6709\u52B9\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
- cvc-pattern-valid = cvc-pattern-valid: \u5024''{0}''\u306F\u3001\u30BF\u30A4\u30D7''{2}''\u306E\u30D1\u30BF\u30FC\u30F3''{1}''\u306B\u5BFE\u3057\u3066\u30D5\u30A1\u30BB\u30C3\u30C8\u304C\u6709\u52B9\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
- cvc-totalDigits-valid = cvc-totalDigits-valid: \u5024''{0}''\u306E\u7DCF\u6841\u6570\u306F{1}\u3067\u3059\u304C\u3001\u7DCF\u6841\u6570\u306F{2}\u306B\u5236\u9650\u3055\u308C\u3066\u3044\u307E\u3059\u3002
- cvc-type.2 = cvc-type.2: \u30BF\u30A4\u30D7\u306E\u5B9A\u7FA9\u306F\u8981\u7D20{0}\u306B\u5BFE\u3057\u3066\u62BD\u8C61\u7684\u306B\u306F\u3067\u304D\u307E\u305B\u3093\u3002
- cvc-type.3.1.1 = cvc-type.3.1.1: \u8981\u7D20''{0}''\u306F\u5358\u7D14\u578B\u3067\u3042\u308B\u305F\u3081\u3001\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u540D\u304C''http://www.w3.org/2001/XMLSchema-instance''\u3068\u540C\u4E00\u306E\u5C5E\u6027\u3068[local name]\u304C''type''\u3001''nil''\u3001''schemaLocation''\u307E\u305F\u306F''noNamespaceSchemaLocation''\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5C5E\u6027\u4EE5\u5916\u306F\u3001\u5C5E\u6027\u3092\u542B\u3081\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002\u305D\u308C\u306B\u3082\u304B\u304B\u308F\u3089\u305A\u5C5E\u6027''{1}''\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002
- cvc-type.3.1.2 = cvc-type.3.1.2: \u8981\u7D20''{0}''\u306F\u5358\u7D14\u578B\u3067\u3042\u308B\u305F\u3081\u3001\u8981\u7D20\u60C5\u5831\u30A2\u30A4\u30C6\u30E0[children]\u3092\u542B\u3081\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002
- cvc-type.3.1.3 = cvc-type.3.1.3: \u8981\u7D20''{0}''\u306E\u5024''{1}''\u306F\u7121\u52B9\u3067\u3059\u3002
-
-#schema valid (3.X.3)
-
- schema_reference.access = schema_reference: accessExternalSchema\u30D7\u30ED\u30D1\u30C6\u30A3\u3067\u8A2D\u5B9A\u3055\u308C\u305F\u5236\u9650\u306B\u3088\u308A''{1}''\u30A2\u30AF\u30BB\u30B9\u304C\u8A31\u53EF\u3055\u308C\u3066\u3044\u306A\u3044\u305F\u3081\u3001\u30B9\u30AD\u30FC\u30DE\u30FB\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8''{0}''\u306E\u8AAD\u53D6\u308A\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002
- schema_reference.4 = schema_reference.4: 1)\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u304C\u898B\u3064\u304B\u3089\u306A\u304B\u3063\u305F\u30012)\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3092\u8AAD\u307F\u53D6\u308C\u306A\u304B\u3063\u305F\u30013)\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u30EB\u30FC\u30C8\u8981\u7D20\u304C<xsd:schema>\u3067\u306F\u306A\u304B\u3063\u305F\u305F\u3081\u3001\u30B9\u30AD\u30FC\u30DE\u30FB\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8''{0}''\u306E\u8AAD\u53D6\u308A\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002
- src-annotation = src-annotation: <annotation>\u8981\u7D20\u306B\u542B\u3081\u308B\u3053\u3068\u304C\u3067\u304D\u308B\u306E\u306F<appinfo>\u8981\u7D20\u304A\u3088\u3073<documentation>\u8981\u7D20\u306E\u307F\u3067\u3059\u304C\u3001''{0}''\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002
- src-attribute.1 = src-attribute.1: ''default''\u3068''fixed''\u306E\u4E21\u65B9\u306E\u30D7\u30ED\u30D1\u30C6\u30A3\u3092\u5C5E\u6027\u5BA3\u8A00''{0}''\u306B\u542B\u3081\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002\u3044\u305A\u308C\u304B\u4E00\u65B9\u306E\u307F\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002
- src-attribute.2 = src-attribute.2: : \u5C5E\u6027''{0}''\u306B\u30D7\u30ED\u30D1\u30C6\u30A3''default''\u304C\u4F7F\u7528\u3055\u308C\u3066\u3044\u308B\u305F\u3081\u3001''use''\u306E\u5024\u306F''optional''\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- src-attribute.3.1 = src-attribute.3.1: 'ref'\u307E\u305F\u306F'name'\u306E\u3044\u305A\u308C\u304B\u304C\u30ED\u30FC\u30AB\u30EB\u5C5E\u6027\u5BA3\u8A00\u306B\u4F7F\u7528\u3055\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- src-attribute.3.2 = src-attribute.3.2: \u30B3\u30F3\u30C6\u30F3\u30C4\u306F\u5C5E\u6027\u53C2\u7167''{0}''\u306E(annotation?)\u3068\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- src-attribute.4 = src-attribute.4: \u5C5E\u6027''{0}''\u306B\u3001''type''\u5C5E\u6027\u3068\u533F\u540D\u306E\u5B50''simpleType''\u306E\u4E21\u65B9\u304C\u4F7F\u7528\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u5C5E\u6027\u306B\u306F\u3053\u308C\u3089\u306E\u3046\u3061\u3044\u305A\u308C\u304B\u4E00\u65B9\u306E\u307F\u3092\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002
- src-attribute_group.2 = src-attribute_group.2: \u5C5E\u6027\u30B0\u30EB\u30FC\u30D7''{0}''\u306B\u5BFE\u3057\u3066\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9\u306E\u5171\u901A\u90E8\u5206\u306F\u8868\u73FE\u3067\u304D\u307E\u305B\u3093\u3002
- src-attribute_group.3 = src-attribute_group.3: \u5C5E\u6027\u30B0\u30EB\u30FC\u30D7''{0}''\u3067\u5FAA\u74B0\u5B9A\u7FA9\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F\u3002\u5C5E\u6027\u30B0\u30EB\u30FC\u30D7\u53C2\u7167\u3092\u518D\u5E30\u7684\u306B\u305F\u3069\u308B\u3068\u3001\u6700\u7D42\u7684\u306B\u306F\u305D\u306E\u5C5E\u6027\u30B0\u30EB\u30FC\u30D7\u306B\u623B\u308A\u307E\u3059\u3002
- src-ct.1 = src-ct.1: \u30BF\u30A4\u30D7''{0}''\u306B\u5BFE\u3059\u308B\u8907\u5408\u578B\u5B9A\u7FA9\u8868\u73FE\u30A8\u30E9\u30FC\u3002<complexContent>\u304C\u4F7F\u7528\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u3001\u30D9\u30FC\u30B9\u30FB\u30BF\u30A4\u30D7\u306FcomplexType\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002''{1}''\u306FsimpleType\u3067\u3059\u3002
- src-ct.2.1 = src-ct.2.1: \u30BF\u30A4\u30D7''{0}''\u306B\u5BFE\u3059\u308B\u8907\u5408\u578B\u5B9A\u7FA9\u8868\u73FE\u30A8\u30E9\u30FC\u3002<simpleContent>\u304C\u4F7F\u7528\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u306E\u30D9\u30FC\u30B9\u30FB\u30BF\u30A4\u30D7\u306F\u3001\u5358\u7D14\u3067\u3042\u308B\u304B\u3001\u5236\u9650\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u306B\u304B\u304E\u308A\u6DF7\u5408\u30B3\u30F3\u30C6\u30F3\u30C4\u3068\u7A7A\u306B\u3067\u304D\u308B\u30D1\u30FC\u30C6\u30A3\u30AF\u30EB\u3092\u6301\u3064\u8907\u5408\u578B\u3067\u3042\u308B\u304B\u3001\u307E\u305F\u306F\u62E1\u5F35\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u306B\u304B\u304E\u308A\u5358\u7D14\u578B\u3067\u3042\u308B\u30B3\u30F3\u30C6\u30F3\u30C4\u30FB\u30BF\u30A4\u30D7\u3092\u6301\u3064complexType\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002''{1}''\u306F\u3001\u3053\u308C\u3089\u306E\u3069\u306E\u6761\u4EF6\u3082\u6E80\u305F\u3057\u3066\u3044\u307E\u305B\u3093\u3002
- src-ct.2.2 = src-ct.2.2: \u30BF\u30A4\u30D7''{0}''\u306B\u5BFE\u3059\u308B\u8907\u5408\u578B\u5B9A\u7FA9\u8868\u73FE\u30A8\u30E9\u30FC\u3002simpleContent\u3092\u6301\u3064complexType\u304C\u3001\u6DF7\u5408\u30B3\u30F3\u30C6\u30F3\u30C4\u3068\u7A7A\u306B\u3067\u304D\u308B\u30D1\u30FC\u30C6\u30A3\u30AF\u30EB\u3092\u6301\u3064complexType\u3092\u5236\u9650\u3059\u308B\u5834\u5408\u3001<restriction>\u306E\u5B50\u306E\u4E2D\u306B<simpleType>\u304C\u5B58\u5728\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- src-ct.4 = src-ct.4: \u30BF\u30A4\u30D7''{0}''\u306B\u5BFE\u3059\u308B\u8907\u5408\u578B\u5B9A\u7FA9\u8868\u73FE\u30A8\u30E9\u30FC\u3002\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9\u306E\u5171\u901A\u90E8\u5206\u306F\u8868\u73FE\u3067\u304D\u307E\u305B\u3093\u3002
- src-ct.5 = src-ct.5: \u30BF\u30A4\u30D7''{0}''\u306B\u5BFE\u3059\u308B\u8907\u5408\u578B\u5B9A\u7FA9\u8868\u73FE\u30A8\u30E9\u30FC\u3002\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9\u306E\u5171\u7528\u4F53\u306F\u8868\u73FE\u3067\u304D\u307E\u305B\u3093\u3002
- src-element.1 = src-element.1: ''default''\u3068''fixed''\u306E\u4E21\u65B9\u306E\u30D7\u30ED\u30D1\u30C6\u30A3\u3092\u8981\u7D20\u5BA3\u8A00''{0}''\u306B\u542B\u3081\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002\u3044\u305A\u308C\u304B\u4E00\u65B9\u306E\u307F\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002
- src-element.2.1 = src-element.2.1: : 'ref'\u307E\u305F\u306F'name'\u306E\u3044\u305A\u308C\u304B\u304C\u30ED\u30FC\u30AB\u30EB\u8981\u7D20\u5BA3\u8A00\u306B\u4F7F\u7528\u3055\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- src-element.2.2 = src-element.2.2: ''{0}''\u306B''ref''\u5C5E\u6027\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u305F\u3081\u3001\u305D\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u306F(annotation?)\u3068\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\u305F\u3060\u3057\u3001''{1}''\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002
- src-element.3 = src-element.3: \u8981\u7D20''{0}''\u306B''type''\u5C5E\u6027\u3068\u5B50''anonymous type''\u306E\u4E21\u65B9\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u3002\u8981\u7D20\u306B\u306F\u3053\u308C\u3089\u306E\u3046\u3061\u3044\u305A\u308C\u304B\u4E00\u65B9\u306E\u307F\u3092\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002
- src-import.1.1 = src-import.1.1: <import>\u8981\u7D20\u60C5\u5831\u30A2\u30A4\u30C6\u30E0\u306E\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u5C5E\u6027''{0}''\u306F\u3001\u5C5E\u6027\u304C\u5B58\u5728\u3059\u308B\u30B9\u30AD\u30FC\u30DE\u306EtargetNamespace\u3068\u540C\u3058\u3082\u306E\u306B\u306F\u3067\u304D\u307E\u305B\u3093\u3002
- src-import.1.2 = src-import.1.2: <import>\u8981\u7D20\u60C5\u5831\u30A2\u30A4\u30C6\u30E0\u306B\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u5C5E\u6027\u304C\u5B58\u5728\u3057\u306A\u3044\u5834\u5408\u3001\u5305\u542B\u3059\u308B\u30B9\u30AD\u30FC\u30DE\u306B\u306FtargetNamespace\u304C\u5FC5\u8981\u3067\u3059\u3002
- src-import.2 = src-import.2: \u30C9\u30AD\u30E5\u30E1\u30F3\u30C8''{0}''\u306E\u30EB\u30FC\u30C8\u8981\u7D20\u306B\u306F\u3001\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u540D''http://www.w3.org/2001/XMLSchema''\u304A\u3088\u3073\u30ED\u30FC\u30AB\u30EB\u540D''schema''\u304C\u5FC5\u8981\u3067\u3059\u3002
- src-import.3.1 = src-import.3.1: <import>\u8981\u7D20\u60C5\u5831\u30A2\u30A4\u30C6\u30E0\u306E\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u5C5E\u6027''{0}''\u306F\u3001\u30A4\u30F3\u30DD\u30FC\u30C8\u3057\u305F\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306EtargetNamespace\u5C5E\u6027''{1}''\u3068\u540C\u3058\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- src-import.3.2 = src-import.3.2: \u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u5C5E\u6027\u306E\u306A\u3044<import>\u8981\u7D20\u60C5\u5831\u30A2\u30A4\u30C6\u30E0\u304C\u898B\u3064\u304B\u3063\u305F\u305F\u3081\u3001\u30A4\u30F3\u30DD\u30FC\u30C8\u3057\u305F\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306BtargetNamespace\u5C5E\u6027\u3092\u542B\u3081\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002\u305F\u3060\u3057\u3001\u30A4\u30F3\u30DD\u30FC\u30C8\u3057\u305F\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306BtargetNamespace ''{1}''\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002
- src-include.1 = src-include.1: \u30C9\u30AD\u30E5\u30E1\u30F3\u30C8''{0}''\u306E\u30EB\u30FC\u30C8\u8981\u7D20\u306B\u306F\u3001\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u540D''http://www.w3.org/2001/XMLSchema''\u304A\u3088\u3073\u30ED\u30FC\u30AB\u30EB\u540D''schema''\u304C\u5FC5\u8981\u3067\u3059\u3002
- src-include.2.1 = src-include.2.1: \u73FE\u5728''{1}''\u3067\u3042\u308B\u53C2\u7167\u30B9\u30AD\u30FC\u30DE\u306EtargetNamespace\u306F\u3001\u73FE\u5728''{0}''\u3067\u3042\u308B\u30A4\u30F3\u30AF\u30EB\u30FC\u30C9\u3059\u308B\u30B9\u30AD\u30FC\u30DE\u306E\u3082\u306E\u3068\u540C\u3058\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- src-redefine.2 = src-redefine.2: \u30C9\u30AD\u30E5\u30E1\u30F3\u30C8''{0}''\u306E\u30EB\u30FC\u30C8\u8981\u7D20\u306B\u306F\u3001\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u540D''http://www.w3.org/2001/XMLSchema''\u304A\u3088\u3073\u30ED\u30FC\u30AB\u30EB\u540D''schema''\u304C\u5FC5\u8981\u3067\u3059\u3002
- src-redefine.3.1 = src-redefine.3.1: \u73FE\u5728''{1}''\u3067\u3042\u308B\u53C2\u7167\u30B9\u30AD\u30FC\u30DE\u306EtargetNamespace\u306F\u3001\u73FE\u5728''{0}''\u3067\u3042\u308B\u518D\u5B9A\u7FA9\u3059\u308B\u30B9\u30AD\u30FC\u30DE\u306E\u3082\u306E\u3068\u540C\u3058\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- src-redefine.5.a.a = src-redefine.5.a.a: <simpleType>\u306E\u6CE8\u91C8\u4EE5\u5916\u306E\u5B50\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002<redefine>\u8981\u7D20\u306E<simpleType>\u306E\u5B50\u306B\u306F\u3001\u305D\u308C\u81EA\u4F53\u3092\u53C2\u7167\u3059\u308B'base'\u5C5E\u6027\u3092\u6301\u3064<restriction>\u306E\u5B50\u5B6B\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- src-redefine.5.a.b = src-redefine.5.a.b: ''{0}''\u306F\u6709\u52B9\u306A\u5B50\u8981\u7D20\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002<redefine>\u8981\u7D20\u306E<simpleType>\u306E\u5B50\u306B\u306F\u3001\u305D\u308C\u81EA\u4F53\u3092\u53C2\u7167\u3059\u308B''base''\u5C5E\u6027\u3092\u6301\u3064<restriction>\u306E\u5B50\u5B6B\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- src-redefine.5.a.c = src-redefine.5.a.c: ''{0}''\u306B\u518D\u5B9A\u7FA9\u6E08\u306E\u8981\u7D20''{1}''\u3092\u53C2\u7167\u3059\u308B''base''\u5C5E\u6027\u304C\u3042\u308A\u307E\u305B\u3093\u3002<redefine>\u8981\u7D20\u306E<simpleType>\u306E\u5B50\u306B\u306F\u3001\u305D\u308C\u81EA\u4F53\u3092\u53C2\u7167\u3059\u308B''base''\u5C5E\u6027\u3092\u6301\u3064<restriction>\u306E\u5B50\u5B6B\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- src-redefine.5.b.a = src-redefine.5.b.a: <complexType>\u306E\u6CE8\u91C8\u4EE5\u5916\u306E\u5B50\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002<redefine>\u8981\u7D20\u306E<complexType>\u306E\u5B50\u306B\u306F\u3001\u305D\u308C\u81EA\u4F53\u3092\u53C2\u7167\u3059\u308B'base'\u5C5E\u6027\u3092\u6301\u3064<extension>\u307E\u305F\u306F<restriction>\u306E\u5B50\u5B6B\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- src-redefine.5.b.b = src-redefine.5.b.b: <complexType>\u306E\u6CE8\u91C8\u4EE5\u5916\u306E\u5B6B\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002<redefine>\u8981\u7D20\u306E<complexType>\u306E\u5B50\u306B\u306F\u3001\u305D\u308C\u81EA\u4F53\u3092\u53C2\u7167\u3059\u308B'base'\u5C5E\u6027\u3092\u6301\u3064<extension>\u307E\u305F\u306F<restriction>\u306E\u5B50\u5B6B\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- src-redefine.5.b.c = src-redefine.5.b.c: ''{0}''\u306F\u6709\u52B9\u306A\u5B6B\u8981\u7D20\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002<redefine>\u8981\u7D20\u306E<complexType>\u306E\u5B50\u306B\u306F\u3001\u305D\u308C\u81EA\u4F53\u3092\u53C2\u7167\u3059\u308B''base''\u5C5E\u6027\u3092\u6301\u3064<extension>\u307E\u305F\u306F<restriction>\u306E\u5B50\u5B6B\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- src-redefine.5.b.d = src-redefine.5.b.d: ''{0}''\u306B\u518D\u5B9A\u7FA9\u6E08\u306E\u8981\u7D20''{1}''\u3092\u53C2\u7167\u3059\u308B''base''\u5C5E\u6027\u304C\u3042\u308A\u307E\u305B\u3093\u3002<redefine>\u8981\u7D20\u306E<complexType>\u306E\u5B50\u306B\u306F\u3001\u305D\u308C\u81EA\u4F53\u3092\u53C2\u7167\u3059\u308B''base''\u5C5E\u6027\u3092\u6301\u3064<extension>\u307E\u305F\u306F<restriction>\u306E\u5B50\u5B6B\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- src-redefine.6.1.1 = src-redefine.6.1.1: <redefine>\u8981\u7D20\u306E\u5B50\u30B0\u30EB\u30FC\u30D7\u306B\u305D\u308C\u81EA\u4F53\u3092\u53C2\u7167\u3059\u308B\u30B0\u30EB\u30FC\u30D7\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u5834\u5408\u3001\u305D\u308C\u306F1\u3064\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\u3053\u308C\u306B\u306F''{0}''\u304C\u542B\u307E\u308C\u307E\u3059\u3002
- src-redefine.6.1.2 = src-redefine.6.1.2: \u518D\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u308B\u30B0\u30EB\u30FC\u30D7\u3078\u306E\u53C2\u7167\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u30B0\u30EB\u30FC\u30D7''{0}''\u306B\u306F''minOccurs'' = ''maxOccurs'' = 1\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- src-redefine.6.2.1 = src-redefine.6.2.1: \u518D\u5B9A\u7FA9\u3055\u308C\u305F\u30B9\u30AD\u30FC\u30DE\u306B\u306F\u3001''{0}''\u3068\u4E00\u81F4\u3059\u308B\u540D\u524D\u3092\u6301\u3064\u30B0\u30EB\u30FC\u30D7\u304C\u3042\u308A\u307E\u305B\u3093\u3002
- src-redefine.6.2.2 = src-redefine.6.2.2: \u30B0\u30EB\u30FC\u30D7''{0}''\u3067\u306F\u518D\u5B9A\u7FA9\u3057\u305F\u30B0\u30EB\u30FC\u30D7\u304C\u9069\u5207\u306B\u5236\u9650\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u5236\u7D04\u9055\u53CD: ''{1}''\u3002
- src-redefine.7.1 = src-redefine.7.1: <redefine>\u8981\u7D20\u306EattributeGroup\u306E\u5B50\u306B\u305D\u308C\u81EA\u4F53\u3092\u53C2\u7167\u3059\u308BattributeGroup\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u5834\u5408\u306F1\u3064\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u304C\u3001\u3053\u308C\u306B\u306F{0}\u542B\u307E\u308C\u307E\u3059\u3002
- src-redefine.7.2.1 = src-redefine.7.2.1: \u518D\u5B9A\u7FA9\u3055\u308C\u305F\u30B9\u30AD\u30FC\u30DE\u306B\u306F\u3001''{0}''\u3068\u4E00\u81F4\u3059\u308B\u540D\u524D\u3092\u6301\u3064attributeGroup\u304C\u3042\u308A\u307E\u305B\u3093\u3002
- src-redefine.7.2.2 = src-redefine.7.2.2: AttributeGroup ''{0}''\u3067\u306F\u518D\u5B9A\u7FA9\u3057\u305FattributeGroup\u304C\u9069\u5207\u306B\u5236\u9650\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u5236\u7D04\u9055\u53CD: ''{1}''\u3002
- src-resolve = src-resolve: \u540D\u524D''{0}''\u3092''{1}''\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306B\u89E3\u6C7A\u3067\u304D\u307E\u305B\u3093\u3002
- src-resolve.4.1 = src-resolve.4.1: \u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8''{2}''\u306E\u89E3\u6C7A\u4E2D\u306B\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002''{2}''\u306B\u306F\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u304C\u5B58\u5728\u3057\u307E\u305B\u3093\u304C\u3001\u30BF\u30FC\u30B2\u30C3\u30C8\u30FB\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u306E\u306A\u3044\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306F\u30B9\u30AD\u30FC\u30DE\u30FB\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8''{0}''\u304B\u3089\u53C2\u7167\u3067\u304D\u307E\u305B\u3093\u3002''{2}''\u306B\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u3092\u6307\u5B9A\u3059\u308B\u5834\u5408\u306F\u3001\u63A5\u982D\u8F9E\u306E\u8FFD\u52A0\u304C\u5FC5\u8981\u306B\u306A\u308B\u3053\u3068\u304C\u3042\u308A\u307E\u3059\u3002''{2}''\u306B\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u3092\u6307\u5B9A\u3057\u306A\u3044\u5834\u5408\u306F\u3001"namespace"\u5C5E\u6027\u306E\u306A\u3044''import''\u3092''{0}''\u306B\u8FFD\u52A0\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- src-resolve.4.2 = src-resolve.4.2: \u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8''{2}''\u306E\u89E3\u6C7A\u4E2D\u306B\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002''{2}''\u306F\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9''{1}''\u306B\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u304C\u3001\u3053\u306E\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u304B\u3089\u306E\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306F\u30B9\u30AD\u30FC\u30DE\u30FB\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8''{0}''\u304B\u3089\u53C2\u7167\u3067\u304D\u307E\u305B\u3093\u3002\u3053\u306E\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u304C\u6B63\u3057\u304F\u306A\u3044\u5834\u5408\u306F\u3001''{2}''\u306E\u63A5\u982D\u8F9E\u306E\u5909\u66F4\u304C\u5FC5\u8981\u306B\u306A\u308B\u3053\u3068\u304C\u3042\u308A\u307E\u3059\u3002\u3053\u306E\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u304C\u6B63\u3057\u3044\u5834\u5408\u306F\u3001\u9069\u5207\u306A''import''\u30BF\u30B0\u3092''{0}''\u306B\u8FFD\u52A0\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- src-simple-type.2.a = src-simple-type.2.a: [children]\u306B\u30D9\u30FC\u30B9[attribute]\u3068<simpleType>\u8981\u7D20\u306E\u4E21\u65B9\u3092\u542B\u3080<restriction>\u8981\u7D20\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002\u3044\u305A\u308C\u304B\u4E00\u65B9\u306E\u307F\u3092\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002
- src-simple-type.2.b = src-simple-type.2.b: [children]\u306B\u30D9\u30FC\u30B9[attribute]\u3082<simpleType>\u8981\u7D20\u3082\u306A\u3044<restriction>\u8981\u7D20\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002\u3044\u305A\u308C\u304B\u4E00\u65B9\u304C\u5FC5\u8981\u3067\u3059\u3002
- src-simple-type.3.a = src-simple-type.3.a: [children]\u306BitemType [attribute]\u3068<simpleType>\u8981\u7D20\u306E\u4E21\u65B9\u3092\u542B\u3080<list>\u8981\u7D20\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002\u3044\u305A\u308C\u304B\u4E00\u65B9\u306E\u307F\u3092\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002
- src-simple-type.3.b = src-simple-type.3.b: [children]\u306BitemType [attribute]\u3082<simpleType>\u8981\u7D20\u3082\u306A\u3044<list>\u8981\u7D20\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002\u3044\u305A\u308C\u304B\u4E00\u65B9\u304C\u5FC5\u8981\u3067\u3059\u3002
- src-single-facet-value = src-single-facet-value: \u30D5\u30A1\u30BB\u30C3\u30C8''{0}''\u304C\u8907\u6570\u56DE\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u3059\u3002
- src-union-memberTypes-or-simpleTypes = src-union-memberTypes-or-simpleTypes: <union>\u8981\u7D20\u306EmemberTypes [attribute]\u304C\u7A7A\u3067\u306A\u3044\u304B\u3001[children]\u306B\u5C11\u306A\u304F\u3068\u30821\u3064\u306E<simpleType>\u8981\u7D20\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
-
-#constraint valid (3.X.6)
-
- ag-props-correct.2 = ag-props-correct.2: \u5C5E\u6027\u30B0\u30EB\u30FC\u30D7''{0}''\u306E\u30A8\u30E9\u30FC\u3002\u540C\u3058\u540D\u524D\u304A\u3088\u3073\u30BF\u30FC\u30B2\u30C3\u30C8\u30FB\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u3092\u6301\u3064\u91CD\u8907\u3059\u308B\u5C5E\u6027\u4F7F\u7528\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u91CD\u8907\u3059\u308B\u5C5E\u6027\u4F7F\u7528\u306E\u540D\u524D\u306F''{1}''\u3067\u3059\u3002
- ag-props-correct.3 = ag-props-correct.3: \u5C5E\u6027\u30B0\u30EB\u30FC\u30D7''{0}''\u306E\u30A8\u30E9\u30FC\u30022\u3064\u306E\u5C5E\u6027\u5BA3\u8A00''{1}''\u3068''{2}''\u306BID\u304B\u3089\u5C0E\u51FA\u3057\u305F\u30BF\u30A4\u30D7\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u3002
- a-props-correct.2 = a-props-correct.2: \u5C5E\u6027''{0}''\u306E\u5024\u5236\u7D04\u306E\u5024''{1}''\u304C\u7121\u52B9\u3067\u3059\u3002
- a-props-correct.3 = a-props-correct.3: \u5C5E\u6027''{0}''\u3067\u306F''fixed''\u3082''default''\u3082\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\u3002\u3053\u308C\u306F\u3001\u5C5E\u6027\u306E'{'type definition'}'\u304CID\u3067\u3042\u308B\u304B\u3001ID\u304B\u3089\u5C0E\u51FA\u3055\u308C\u305F\u3082\u306E\u3067\u3042\u308B\u305F\u3081\u3067\u3059\u3002
- au-props-correct.2 = au-props-correct.2: ''{0}''\u306E\u5C5E\u6027\u5BA3\u8A00\u3067\u306F\u3001\u56FA\u5B9A\u5024''{1}''\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u305D\u306E\u305F\u3081\u3001''{0}''\u3092\u53C2\u7167\u3059\u308B\u5C5E\u6027\u4F7F\u7528\u306B'{'value constraint'}'\u3082\u542B\u307E\u308C\u3066\u3044\u308B\u5834\u5408\u306F\u3001\u305D\u308C\u3092\u56FA\u5B9A\u3057\u3001\u305D\u306E\u5024\u3092''{1}''\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- cos-all-limited.1.2 = cos-all-limited.1.2: 'all'\u306E\u30E2\u30C7\u30EB\u30FB\u30B0\u30EB\u30FC\u30D7\u306F'{'min occurs'}' = '{'max occurs'}' = 1\u306E\u30D1\u30FC\u30C6\u30A3\u30AF\u30EB\u306B\u542B\u307E\u308C\u308B\u5FC5\u8981\u304C\u3042\u308A\u3001\u30D1\u30FC\u30C6\u30A3\u30AF\u30EB\u306F\u8907\u5408\u578B\u5B9A\u7FA9\u306E'{'content type'}'\u3092\u69CB\u6210\u3059\u308B1\u7D44\u306E\u4E00\u90E8\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- cos-all-limited.2 = cos-all-limited.2: ''all''\u306E\u30E2\u30C7\u30EB\u30FB\u30B0\u30EB\u30FC\u30D7\u306E\u8981\u7D20\u306E'{'max occurs'}'\u306F0\u304B1\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\u8981\u7D20''{1}''\u306E\u5024''{0}''\u306F\u7121\u52B9\u3067\u3059\u3002
- cos-applicable-facets = cos-applicable-facets: \u30BF\u30A4\u30D7{1}\u306B\u30D5\u30A1\u30BB\u30C3\u30C8''{0}''\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\u3002
- cos-ct-extends.1.1 = cos-ct-extends.1.1: \u30BF\u30A4\u30D7''{0}''\u306F\u30BF\u30A4\u30D7''{1}''\u306E\u62E1\u5F35\u306B\u3088\u3063\u3066\u5C0E\u51FA\u3055\u308C\u305F\u3082\u306E\u3067\u3059\u3002\u305F\u3060\u3057\u3001''{1}''\u306E''final''\u5C5E\u6027\u306B\u3088\u3063\u3066\u3001\u62E1\u5F35\u306B\u3088\u308B\u5C0E\u51FA\u304C\u7981\u6B62\u3055\u308C\u3066\u3044\u307E\u3059\u3002
- cos-ct-extends.1.4.3.2.2.1.a = cos-ct-extends.1.4.3.2.2.1.a: \u5C0E\u51FA\u3055\u308C\u305F\u30BF\u30A4\u30D7\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u30FB\u30BF\u30A4\u30D7\u3068\u305D\u306E\u30D9\u30FC\u30B9\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u30FB\u30BF\u30A4\u30D7\u306F\u4E21\u65B9\u3068\u3082\u6DF7\u5408\u578B\u306B\u3059\u308B\u304B\u3001\u8981\u7D20\u306E\u307F\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\u30BF\u30A4\u30D7''{0}''\u306F\u8981\u7D20\u306E\u307F\u3067\u3059\u304C\u3001\u305D\u306E\u30D9\u30FC\u30B9\u30FB\u30BF\u30A4\u30D7\u306F\u8981\u7D20\u306E\u307F\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
- cos-ct-extends.1.4.3.2.2.1.b = cos-ct-extends.1.4.3.2.2.1.b: \u5C0E\u51FA\u3055\u308C\u305F\u30BF\u30A4\u30D7\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u30FB\u30BF\u30A4\u30D7\u3068\u305D\u306E\u30D9\u30FC\u30B9\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u30FB\u30BF\u30A4\u30D7\u306F\u4E21\u65B9\u3068\u3082\u6DF7\u5408\u578B\u306B\u3059\u308B\u304B\u3001\u8981\u7D20\u306E\u307F\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\u30BF\u30A4\u30D7''{0}''\u306F\u6DF7\u5408\u578B\u3067\u3059\u304C\u3001\u305D\u306E\u30D9\u30FC\u30B9\u30FB\u30BF\u30A4\u30D7\u306F\u6DF7\u5408\u578B\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
- cos-element-consistent = cos-element-consistent: \u30BF\u30A4\u30D7''{0}''\u306E\u30A8\u30E9\u30FC\u3002''{1}''\u3068\u3044\u3046\u540D\u524D\u306E\u7570\u306A\u308B\u30BF\u30A4\u30D7\u306E\u8907\u6570\u306E\u8981\u7D20\u304C\u30E2\u30C7\u30EB\u30FB\u30B0\u30EB\u30FC\u30D7\u306B\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u3002
- cos-list-of-atomic = cos-list-of-atomic: \u30BF\u30A4\u30D7''{1}''\u306F\u30A2\u30C8\u30DF\u30C3\u30AF\u3067\u306F\u306A\u3044\u305F\u3081(''{1}''\u306F\u30EA\u30B9\u30C8\u30FB\u30BF\u30A4\u30D7\u304B\u3001\u30EA\u30B9\u30C8\u3092\u542B\u3080\u5171\u7528\u4F53\u30BF\u30A4\u30D7\u3067\u3042\u308B\u305F\u3081)\u3001\u30EA\u30B9\u30C8\u30FB\u30BF\u30A4\u30D7''{0}''\u306E\u5B9A\u7FA9\u3067\u306F\u7121\u52B9\u306A\u30EA\u30B9\u30C8\u8981\u7D20\u30BF\u30A4\u30D7\u3067\u3059\u3002
- cos-nonambig = cos-nonambig: {0}\u3068{1} (\u307E\u305F\u306F\u7F6E\u63DB\u30B0\u30EB\u30FC\u30D7\u306E\u8981\u7D20)\u304C"Unique Particle Attribution"\u306B\u9055\u53CD\u3057\u3066\u3044\u307E\u3059\u3002\u3053\u306E\u30B9\u30AD\u30FC\u30DE\u306B\u5BFE\u3059\u308B\u691C\u8A3C\u6642\u306B\u3001\u3053\u308C\u30892\u3064\u306E\u30D1\u30FC\u30C6\u30A3\u30AF\u30EB\u306B\u3042\u3044\u307E\u3044\u3055\u304C\u751F\u3058\u308B\u3068\u8003\u3048\u3089\u308C\u307E\u3059\u3002
- cos-particle-restrict.a = cos-particle-restrict.a: \u5C0E\u51FA\u3055\u308C\u305F\u30D1\u30FC\u30C6\u30A3\u30AF\u30EB\u304C\u7A7A\u3067\u3042\u308A\u3001\u30D9\u30FC\u30B9\u306F\u7A7A\u306B\u3067\u304D\u307E\u305B\u3093\u3002
- cos-particle-restrict.b = cos-particle-restrict.b: \u30D9\u30FC\u30B9\u306E\u30D1\u30FC\u30C6\u30A3\u30AF\u30EB\u306F\u7A7A\u3067\u3059\u304C\u3001\u5C0E\u51FA\u3055\u308C\u305F\u30D1\u30FC\u30C6\u30A3\u30AF\u30EB\u306F\u7A7A\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
- cos-particle-restrict.2 = cos-particle-restrict.2: \u7981\u6B62\u3055\u308C\u305F\u30D1\u30FC\u30C6\u30A3\u30AF\u30EB\u306E\u5236\u9650: ''{0}''\u3002
- cos-st-restricts.1.1 = cos-st-restricts.1.1: \u30BF\u30A4\u30D7''{1}''\u306F\u30A2\u30C8\u30DF\u30C3\u30AF\u3067\u3042\u308B\u305F\u3081\u3001\u305D\u306E'{'base type definition'}' ''{0}''\u306F\u30A2\u30C8\u30DF\u30C3\u30AF\u306E\u5358\u7D14\u578B\u5B9A\u7FA9\u304B\u30D7\u30EA\u30DF\u30C6\u30A3\u30D6\u306E\u7D44\u8FBC\u307F\u30C7\u30FC\u30BF\u578B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- cos-st-restricts.2.1 = cos-st-restricts.2.1: \u30BF\u30A4\u30D7''{1}''\u306F\u30EA\u30B9\u30C8\u30FB\u30BF\u30A4\u30D7\u304B\u3001\u30EA\u30B9\u30C8\u3092\u542B\u3080\u5171\u7528\u4F53\u30BF\u30A4\u30D7\u3067\u3042\u308B\u305F\u3081\u3001\u30EA\u30B9\u30C8\u30FB\u30BF\u30A4\u30D7''{0}''\u306E\u5B9A\u7FA9\u3067\u306F\u7121\u52B9\u306A\u30A2\u30A4\u30C6\u30E0\u30FB\u30BF\u30A4\u30D7\u3067\u3059\u3002
- cos-st-restricts.2.3.1.1 = cos-st-restricts.2.3.1.1: '{'item type definition'}' ''{0}''\u306E'{'final'}'\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306B\u306F\u3001''list''\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u3002\u3064\u307E\u308A\u3001''{0}''\u306F\u30EA\u30B9\u30C8\u30FB\u30BF\u30A4\u30D7''{1}''\u306E\u30A2\u30A4\u30C6\u30E0\u30FB\u30BF\u30A4\u30D7\u3068\u3057\u3066\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\u3002
- cos-st-restricts.3.3.1.1 = cos-st-restricts.3.3.1.1: '{'member type definitions'}' ''{0}''\u306E'{'final'}'\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306B\u306F\u3001''union''\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u3002\u3064\u307E\u308A\u3001''{0}''\u306F\u5171\u7528\u4F53\u30BF\u30A4\u30D7''{1}''\u306E\u30E1\u30F3\u30D0\u30FC\u30FB\u30BF\u30A4\u30D7\u3068\u3057\u3066\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\u3002
- cos-valid-default.2.1 = cos-valid-default.2.1: \u8981\u7D20''{0}''\u306B\u306F\u5024\u5236\u7D04\u304C\u542B\u307E\u308C\u3066\u304A\u308A\u3001\u6DF7\u5408\u307E\u305F\u306F\u5358\u7D14\u30B3\u30F3\u30C6\u30F3\u30C4\u30FB\u30E2\u30C7\u30EB\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- cos-valid-default.2.2.2 = cos-valid-default.2.2.2: \u8981\u7D20''{0}''\u306B\u306F'{'value constraint'}'\u304C\u542B\u307E\u308C\u3066\u304A\u308A\u3001\u305D\u306E\u30BF\u30A4\u30D7\u5B9A\u7FA9\u306B\u306F\u6DF7\u5408'{'content type'}'\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u305F\u3081\u3001'{'content type'}'\u306E\u30D1\u30FC\u30C6\u30A3\u30AF\u30EB\u306F\u7A7A\u306B\u3067\u304D\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- c-props-correct.2 = c-props-correct.2: keyref ''{0}''\u3068key ''{1}''\u306B\u5BFE\u3059\u308B\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u30AB\u30FC\u30C7\u30A3\u30CA\u30EA\u30C6\u30A3\u304C\u76F8\u4E92\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- ct-props-correct.3 = ct-props-correct.3: \u8907\u5408\u578B''{0}''\u3067\u5FAA\u74B0\u5B9A\u7FA9\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F\u3002\u3064\u307E\u308A\u3001''{0}''\u304C\u305D\u308C\u81EA\u4F53\u306E\u30BF\u30A4\u30D7\u968E\u5C64\u306B\u542B\u307E\u308C\u3066\u3044\u308B\u305F\u3081\u30A8\u30E9\u30FC\u306B\u306A\u3063\u3066\u3044\u307E\u3059\u3002
- ct-props-correct.4 = ct-props-correct.4: \u30BF\u30A4\u30D7''{0}''\u306E\u30A8\u30E9\u30FC\u3002\u540C\u3058\u540D\u524D\u304A\u3088\u3073\u30BF\u30FC\u30B2\u30C3\u30C8\u30FB\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u3092\u6301\u3064\u91CD\u8907\u3059\u308B\u5C5E\u6027\u4F7F\u7528\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u91CD\u8907\u3059\u308B\u5C5E\u6027\u4F7F\u7528\u306E\u540D\u524D\u306F''{1}''\u3067\u3059\u3002
- ct-props-correct.5 = ct-props-correct.5: \u30BF\u30A4\u30D7''{0}''\u306E\u30A8\u30E9\u30FC\u30022\u3064\u306E\u5C5E\u6027\u5BA3\u8A00''{1}''\u3068''{2}''\u306BID\u304B\u3089\u5C0E\u51FA\u3057\u305F\u30BF\u30A4\u30D7\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u3002
- derivation-ok-restriction.1 = derivation-ok-restriction.1: \u30BF\u30A4\u30D7''{0}''\u306F\u30BF\u30A4\u30D7''{1}''\u306E\u5236\u9650\u306B\u3088\u3063\u3066\u5C0E\u51FA\u3055\u308C\u305F\u3082\u306E\u3067\u3059\u3002\u305F\u3060\u3057\u3001''{1}''\u306E'{'final'}'\u30D7\u30ED\u30D1\u30C6\u30A3\u306B\u3088\u3063\u3066\u3001\u5236\u9650\u306B\u3088\u308B\u5C0E\u51FA\u304C\u7981\u6B62\u3055\u308C\u3066\u3044\u307E\u3059\u3002
- derivation-ok-restriction.2.1.1 = derivation-ok-restriction.2.1.1: \u30BF\u30A4\u30D7''{0}''\u306E\u30A8\u30E9\u30FC\u3002\u3053\u306E\u30BF\u30A4\u30D7\u306E\u5C5E\u6027\u4F7F\u7528''{1}''\u306B\u306F\u3001\u30D9\u30FC\u30B9\u30FB\u30BF\u30A4\u30D7\u306E\u5BFE\u5FDC\u3059\u308B\u5C5E\u6027\u4F7F\u7528\u306E\u5024''required''\u3068\u4E00\u8CAB\u6027\u304C\u306A\u3044''{2}''\u306E''use''\u5024\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u3002
- derivation-ok-restriction.2.1.2 = derivation-ok-restriction.2.1.2: \u30BF\u30A4\u30D7''{0}''\u306E\u30A8\u30E9\u30FC\u3002\u3053\u306E\u30BF\u30A4\u30D7\u306E\u5C5E\u6027\u4F7F\u7528''{1}''\u306B\u306F\u3001\u30D9\u30FC\u30B9\u30FB\u30BF\u30A4\u30D7\u306E\u5BFE\u5FDC\u3059\u308B\u5C5E\u6027\u4F7F\u7528\u306E\u30BF\u30A4\u30D7''{3}''\u304B\u3089\u6B63\u5E38\u306B\u5C0E\u51FA\u3055\u308C\u305F\u3082\u306E\u3067\u306F\u306A\u3044\u30BF\u30A4\u30D7''{2}''\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u3002
- derivation-ok-restriction.2.1.3.a = derivation-ok-restriction.2.1.3.a: \u30BF\u30A4\u30D7''{0}''\u306E\u30A8\u30E9\u30FC\u3002\u3053\u306E\u30BF\u30A4\u30D7\u306E\u5C5E\u6027\u4F7F\u7528''{1}''\u306B\u306F\u3001\u56FA\u5B9A\u3055\u308C\u3066\u3044\u306A\u3044\u6709\u52B9\u306A\u5024\u5236\u7D04\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u304C\u3001\u30D9\u30FC\u30B9\u30FB\u30BF\u30A4\u30D7\u306E\u5BFE\u5FDC\u3059\u308B\u5C5E\u6027\u4F7F\u7528\u306E\u6709\u52B9\u306A\u5024\u5236\u7D04\u306F\u56FA\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002
- derivation-ok-restriction.2.1.3.b = derivation-ok-restriction.2.1.3.b: \u30BF\u30A4\u30D7''{0}''\u306E\u30A8\u30E9\u30FC\u3002\u3053\u306E\u30BF\u30A4\u30D7\u306E\u5C5E\u6027\u4F7F\u7528''{1}''\u306B\u306F\u3001\u5024''{2}''\u3067\u56FA\u5B9A\u3055\u308C\u3066\u3044\u308B\u6709\u52B9\u306A\u5024\u5236\u7D04\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u304C\u3001\u30D9\u30FC\u30B9\u30FB\u30BF\u30A4\u30D7\u306E\u5BFE\u5FDC\u3059\u308B\u5C5E\u6027\u4F7F\u7528\u306E\u56FA\u5B9A\u3055\u308C\u3066\u3044\u308B\u6709\u52B9\u306A\u5024\u5236\u7D04\u306E\u5024''{3}''\u3068\u4E00\u8CAB\u6027\u304C\u3042\u308A\u307E\u305B\u3093\u3002
- derivation-ok-restriction.2.2.a = derivation-ok-restriction.2.2.a: \u30BF\u30A4\u30D7''{0}''\u306E\u30A8\u30E9\u30FC\u3002\u3053\u306E\u30BF\u30A4\u30D7\u306E\u5C5E\u6027\u4F7F\u7528''{1}''\u306F\u30D9\u30FC\u30B9\u306E\u5C5E\u6027\u4F7F\u7528\u3068\u5BFE\u5FDC\u3057\u3066\u304A\u3089\u305A\u3001\u30D9\u30FC\u30B9\u30FB\u30BF\u30A4\u30D7\u306B\u306F\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9\u5C5E\u6027\u306F\u3042\u308A\u307E\u305B\u3093\u3002
- derivation-ok-restriction.2.2.b = derivation-ok-restriction.2.2.b: \u30BF\u30A4\u30D7''{0}''\u306E\u30A8\u30E9\u30FC\u3002\u3053\u306E\u30BF\u30A4\u30D7\u306E\u5C5E\u6027\u4F7F\u7528''{1}''\u306F\u30D9\u30FC\u30B9\u306E\u5C5E\u6027\u4F7F\u7528\u3068\u5BFE\u5FDC\u3057\u3066\u304A\u3089\u305A\u3001\u30D9\u30FC\u30B9\u30FB\u30BF\u30A4\u30D7\u306E\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9\u3067\u306F\u3053\u306E\u5C5E\u6027\u4F7F\u7528\u306E\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9''{2}''\u304C\u8A31\u53EF\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
- derivation-ok-restriction.3 = derivation-ok-restriction.3: \u30BF\u30A4\u30D7''{0}''\u306E\u30A8\u30E9\u30FC\u3002\u30D9\u30FC\u30B9\u30FB\u30BF\u30A4\u30D7\u306E\u5C5E\u6027\u4F7F\u7528''{1}''\u3067\u306FREQUIRED\u304Ctrue\u3067\u3059\u304C\u3001\u5C0E\u51FA\u3055\u308C\u305F\u30BF\u30A4\u30D7\u306B\u306F\u305D\u308C\u3068\u5BFE\u5FDC\u3059\u308B\u5C5E\u6027\u4F7F\u7528\u304C\u3042\u308A\u307E\u305B\u3093\u3002
- derivation-ok-restriction.4.1 = derivation-ok-restriction.4.1: \u30BF\u30A4\u30D7''{0}''\u306E\u30A8\u30E9\u30FC\u3002\u5C0E\u51FA\u306B\u306F\u5C5E\u6027\u306E\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u304C\u3001\u30D9\u30FC\u30B9\u306B\u306F\u542B\u307E\u308C\u3066\u3044\u307E\u305B\u3093\u3002
- derivation-ok-restriction.4.2 = derivation-ok-restriction.4.2: \u30BF\u30A4\u30D7''{0}''\u306E\u30A8\u30E9\u30FC\u3002\u5C0E\u51FA\u306E\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9\u306F\u30D9\u30FC\u30B9\u306E\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9\u306E\u6709\u52B9\u306A\u30B5\u30D6\u30BB\u30C3\u30C8\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
- derivation-ok-restriction.4.3 = derivation-ok-restriction.4.3: \u30BF\u30A4\u30D7''{0}''\u306E\u30A8\u30E9\u30FC\u3002\u5C0E\u51FA({1})\u306E\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9\u306E\u30D7\u30ED\u30BB\u30B9\u30FB\u30B3\u30F3\u30C6\u30F3\u30C4\u304C\u3001\u30D9\u30FC\u30B9({2})\u306E\u3082\u306E\u3088\u308A\u5F31\u304F\u306A\u3063\u3066\u3044\u307E\u3059\u3002
- derivation-ok-restriction.5.2.2.1 = derivation-ok-restriction.5.2.2.1: \u30BF\u30A4\u30D7''{0}''\u306E\u30A8\u30E9\u30FC\u3002\u3053\u306E\u30BF\u30A4\u30D7\u306E\u5358\u7D14\u30B3\u30F3\u30C6\u30F3\u30C4\u30FB\u30BF\u30A4\u30D7''{1}''\u306F\u3001\u30D9\u30FC\u30B9\u306E\u5358\u7D14\u30B3\u30F3\u30C6\u30F3\u30C4\u30FB\u30BF\u30A4\u30D7''{2}''\u306E\u6709\u52B9\u306A\u5236\u9650\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
- derivation-ok-restriction.5.3.2 = derivation-ok-restriction.5.3.2: \u30BF\u30A4\u30D7''{0}''\u306E\u30A8\u30E9\u30FC\u3002\u3053\u306E\u30BF\u30A4\u30D7\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u30FB\u30BF\u30A4\u30D7\u306F\u7A7A\u3067\u3059\u304C\u3001\u30D9\u30FC\u30B9\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u30FB\u30BF\u30A4\u30D7''{1}''\u306F\u7A7A\u3067\u306F\u306A\u3044\u304B\u3001\u7A7A\u306B\u3067\u304D\u307E\u305B\u3093\u3002
- derivation-ok-restriction.5.4.1.2 = derivation-ok-restriction.5.4.1.2: \u30BF\u30A4\u30D7''{0}''\u306E\u30A8\u30E9\u30FC\u3002\u3053\u306E\u30BF\u30A4\u30D7\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u30FB\u30BF\u30A4\u30D7\u306F\u6DF7\u5408\u578B\u3067\u3059\u304C\u3001\u30D9\u30FC\u30B9\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u30FB\u30BF\u30A4\u30D7''{1}''\u306F\u6DF7\u5408\u578B\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
- derivation-ok-restriction.5.4.2 = derivation-ok-restriction.5.4.2: \u30BF\u30A4\u30D7''{0}''\u306E\u30A8\u30E9\u30FC\u3002\u3053\u306E\u30BF\u30A4\u30D7\u306E\u30D1\u30FC\u30C6\u30A3\u30AF\u30EB\u306F\u30D9\u30FC\u30B9\u306E\u30D1\u30FC\u30C6\u30A3\u30AF\u30EB\u306E\u6709\u52B9\u306A\u5236\u9650\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
- enumeration-required-notation = enumeration-required-notation: {2} ''{1}''\u3067\u4F7F\u7528\u3055\u308C\u308BNOTATION\u30BF\u30A4\u30D7''{0}''\u306B\u306F\u3001\u3053\u306E\u30BF\u30A4\u30D7\u3067\u4F7F\u7528\u3055\u308C\u308B\u8868\u8A18\u6CD5\u8981\u7D20\u3092\u6307\u5B9A\u3059\u308B\u5217\u6319\u30D5\u30A1\u30BB\u30C3\u30C8\u5024\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- enumeration-valid-restriction = enumeration-valid-restriction: \u5217\u6319\u5024''{0}''\u306F\u30D9\u30FC\u30B9\u30FB\u30BF\u30A4\u30D7\u306E\u5024\u7A7A\u9593{1}\u306B\u5B58\u5728\u3057\u307E\u305B\u3093\u3002
- e-props-correct.2 = e-props-correct.2: \u8981\u7D20''{0}''\u306E\u5024\u5236\u7D04\u306E\u5024''{1}''\u304C\u7121\u52B9\u3067\u3059\u3002
- e-props-correct.4 = e-props-correct.4: \u8981\u7D20''{0}''\u306E'{'type definition'}'\u304CsubstitutionHead ''{1}''\u306E'{'type definition'}'\u304B\u3089\u6B63\u5E38\u306B\u5C0E\u51FA\u3055\u308C\u305F\u3082\u306E\u3067\u306A\u3044\u304B\u3001''{1}''\u306E'{'substitution group exclusions'}'\u30D7\u30ED\u30D1\u30C6\u30A3\u3067\u3053\u306E\u5C0E\u51FA\u304C\u8A31\u53EF\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
- e-props-correct.5 = e-props-correct.5: \u8981\u7D20\u306E'{'type definition'}'\u307E\u305F\u306F'{'type definition'}'\u306E'{'content type'}'\u306FID\u3067\u3042\u308B\u304B\u3001ID\u304B\u3089\u5C0E\u51FA\u3055\u308C\u305F\u3082\u306E\u3067\u3042\u308B\u305F\u3081\u3001\u8981\u7D20''{0}''\u306B'{'value constraint'}'\u3092\u542B\u3081\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002
- e-props-correct.6 = e-props-correct.6: \u8981\u7D20''{0}''\u3067\u5FAA\u74B0\u7F6E\u63DB\u30B0\u30EB\u30FC\u30D7\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F\u3002
- fractionDigits-valid-restriction = fractionDigits-valid-restriction: \u30D5\u30A1\u30BB\u30C3\u30C8''fractionDigits''\u306E\u5024''{0}''\u306F\u3001\u7956\u5148\u30BF\u30A4\u30D7\u306E\u3044\u305A\u308C\u304B\u3067''{1}''\u306B\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u308B''fractionDigits''\u306E\u5024\u4EE5\u4E0B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308B\u305F\u3081\u3001{2}\u306E\u5B9A\u7FA9\u3067\u306F\u7121\u52B9\u3067\u3059\u3002
- fractionDigits-totalDigits = fractionDigits-totalDigits: \u30D5\u30A1\u30BB\u30C3\u30C8''fractionDigits''\u306E\u5024''{0}''\u306F\u3001''totalDigits''\u306E\u5024''{1}''\u4EE5\u4E0B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308B\u305F\u3081\u3001{2}\u306E\u5B9A\u7FA9\u3067\u306F\u7121\u52B9\u3067\u3059\u3002
- length-minLength-maxLength.1.1 = length-minLength-maxLength.1.1: \u30BF\u30A4\u30D7{0}\u3067\u306F\u3001length\u306E\u5024''{1}''\u304CminLength\u306E\u5024''{2}''\u3088\u308A\u5C0F\u3055\u3044\u3068\u3001\u30A8\u30E9\u30FC\u306B\u306A\u308A\u307E\u3059\u3002
- length-minLength-maxLength.1.2.a = length-minLength-maxLength.1.2.a: \u30BF\u30A4\u30D7{0}\u3067\u306F\u3001\u73FE\u5728\u306E\u5236\u9650\u306E\u30D5\u30A1\u30BB\u30C3\u30C8\u304CminLength\u3067\u3042\u308A\u3001\u73FE\u5728\u306E\u5236\u9650\u307E\u305F\u306F\u30D9\u30FC\u30B9\u306E\u30D5\u30A1\u30BB\u30C3\u30C8\u304Clength\u3067\u3042\u308B\u5834\u5408\u3001\u30D9\u30FC\u30B9\u306BminLength\u30D5\u30A1\u30BB\u30C3\u30C8\u304C\u542B\u307E\u308C\u3066\u3044\u306A\u3044\u3068\u3001\u30A8\u30E9\u30FC\u306B\u306A\u308A\u307E\u3059\u3002
- length-minLength-maxLength.1.2.b = length-minLength-maxLength.1.2.b: \u30BF\u30A4\u30D7{0}\u3067\u306F\u3001\u73FE\u5728\u306EminLength ''{1}''\u304C\u30D9\u30FC\u30B9\u306EminLength ''{2}''\u3068\u7B49\u3057\u304F\u306A\u3044\u3068\u3001\u30A8\u30E9\u30FC\u306B\u306A\u308A\u307E\u3059\u3002
- length-minLength-maxLength.2.1 = length-minLength-maxLength.2.1: \u30BF\u30A4\u30D7{0}\u3067\u306F\u3001length\u306E\u5024''{1}''\u304CmaxLength\u306E\u5024''{2}''\u3088\u308A\u5927\u304D\u3044\u3068\u3001\u30A8\u30E9\u30FC\u306B\u306A\u308A\u307E\u3059\u3002
- length-minLength-maxLength.2.2.a = length-minLength-maxLength.2.2.a: \u30BF\u30A4\u30D7{0}\u3067\u306F\u3001\u73FE\u5728\u306E\u5236\u9650\u306E\u30D5\u30A1\u30BB\u30C3\u30C8\u304CmaxLength\u3067\u3042\u308A\u3001\u73FE\u5728\u306E\u5236\u9650\u307E\u305F\u306F\u30D9\u30FC\u30B9\u306E\u30D5\u30A1\u30BB\u30C3\u30C8\u304Clength\u3067\u3042\u308B\u5834\u5408\u3001\u30D9\u30FC\u30B9\u306BmaxLength\u30D5\u30A1\u30BB\u30C3\u30C8\u304C\u542B\u307E\u308C\u3066\u3044\u306A\u3044\u3068\u3001\u30A8\u30E9\u30FC\u306B\u306A\u308A\u307E\u3059\u3002
- length-minLength-maxLength.2.2.b = length-minLength-maxLength.2.2.b: \u30BF\u30A4\u30D7{0}\u3067\u306F\u3001\u73FE\u5728\u306EmaxLength ''{1}''\u304C\u30D9\u30FC\u30B9\u306EmaxLength ''{2}''\u3068\u7B49\u3057\u304F\u306A\u3044\u3068\u3001\u30A8\u30E9\u30FC\u306B\u306A\u308A\u307E\u3059\u3002
- length-valid-restriction = length-valid-restriction: \u30BF\u30A4\u30D7''{2}''\u306E\u30A8\u30E9\u30FC\u3002\u9577\u3055\u306E\u5024''{0}''\u306F\u30D9\u30FC\u30B9\u30FB\u30BF\u30A4\u30D7''{1}''\u306Elength\u306E\u5024\u3068\u540C\u3058\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- maxExclusive-valid-restriction.1 = maxExclusive-valid-restriction.1: \u30BF\u30A4\u30D7''{2}''\u306E\u30A8\u30E9\u30FC\u3002maxExclusive\u306E\u5024''{0}''\u306F\u30D9\u30FC\u30B9\u30FB\u30BF\u30A4\u30D7''{1}''\u306EmaxExclusive\u4EE5\u4E0B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- maxExclusive-valid-restriction.2 = maxExclusive-valid-restriction.2: \u30BF\u30A4\u30D7''{2}''\u306E\u30A8\u30E9\u30FC\u3002maxExclusive\u306E\u5024''{0}''\u306F\u30D9\u30FC\u30B9\u30FB\u30BF\u30A4\u30D7''{1}''\u306EmaxInclusive\u4EE5\u4E0B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- maxExclusive-valid-restriction.3 = maxExclusive-valid-restriction.3: \u30BF\u30A4\u30D7''{2}''\u306E\u30A8\u30E9\u30FC\u3002maxExclusive\u306E\u5024''{0}''\u306F\u30D9\u30FC\u30B9\u30FB\u30BF\u30A4\u30D7''{1}''\u306EminInclusive\u3088\u308A\u5927\u304D\u304F\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- maxExclusive-valid-restriction.4 = maxExclusive-valid-restriction.4: \u30BF\u30A4\u30D7''{2}''\u306E\u30A8\u30E9\u30FC\u3002maxExclusive\u306E\u5024''{0}''\u306F\u30D9\u30FC\u30B9\u30FB\u30BF\u30A4\u30D7''{1}''\u306EminExclusive\u3088\u308A\u5927\u304D\u304F\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- maxInclusive-maxExclusive = maxInclusive-maxExclusive: \u540C\u3058\u30C7\u30FC\u30BF\u578B\u306B\u5BFE\u3057\u3066maxInclusive\u3068maxExclusive\u306E\u4E21\u65B9\u3092\u6307\u5B9A\u3057\u305F\u3053\u3068\u306B\u3088\u308B\u30A8\u30E9\u30FC\u3067\u3059\u3002{2}\u3067\u306F\u3001maxInclusive\u306F''{0}''\u3001maxExclusive\u306F''{1}''\u3067\u3059\u3002
- maxInclusive-valid-restriction.1 = maxInclusive-valid-restriction.1: \u30BF\u30A4\u30D7''{2}''\u306E\u30A8\u30E9\u30FC\u3002maxInclusive\u306E\u5024''{0}''\u306F\u30D9\u30FC\u30B9\u30FB\u30BF\u30A4\u30D7''{1}''\u306EmaxInclusive\u4EE5\u4E0B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- maxInclusive-valid-restriction.2 = maxInclusive-valid-restriction.2: \u30BF\u30A4\u30D7''{2}''\u306E\u30A8\u30E9\u30FC\u3002maxInclusive\u306E\u5024''{0}''\u306F\u30D9\u30FC\u30B9\u30FB\u30BF\u30A4\u30D7''{1}''\u306EmaxExclusive\u3088\u308A\u5C0F\u3055\u304F\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- maxInclusive-valid-restriction.3 = maxInclusive-valid-restriction.3: \u30BF\u30A4\u30D7''{2}''\u306E\u30A8\u30E9\u30FC\u3002maxInclusive\u306E\u5024''{0}''\u306F\u30D9\u30FC\u30B9\u30FB\u30BF\u30A4\u30D7''{1}''\u306EminInclusive\u4EE5\u4E0A\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- maxInclusive-valid-restriction.4 = maxInclusive-valid-restriction.4: \u30BF\u30A4\u30D7''{2}''\u306E\u30A8\u30E9\u30FC\u3002maxInclusive\u306E\u5024''{0}''\u306F\u30D9\u30FC\u30B9\u30FB\u30BF\u30A4\u30D7''{1}''\u306EminExclusive\u3088\u308A\u5927\u304D\u304F\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- maxLength-valid-restriction = maxLength-valid-restriction: {2}\u306E\u5B9A\u7FA9\u3067\u306F\u3001maxLength\u306E\u5024''{0}''\u306F\u30D9\u30FC\u30B9\u30FB\u30BF\u30A4\u30D7''{1}''\u306E\u5024\u4EE5\u4E0B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- mg-props-correct.2 = mg-props-correct.2: \u30B0\u30EB\u30FC\u30D7''{0}''\u3067\u5FAA\u74B0\u5B9A\u7FA9\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F\u3002\u30D1\u30FC\u30C6\u30A3\u30AF\u30EB\u306E'{'term'}'\u5024\u3092\u518D\u5E30\u7684\u306B\u305F\u3069\u308B\u3068\u3001'{'term'}'\u304C\u30B0\u30EB\u30FC\u30D7\u81EA\u4F53\u3067\u3042\u308B\u30D1\u30FC\u30C6\u30A3\u30AF\u30EB\u306B\u9054\u3057\u307E\u3059\u3002
- minExclusive-less-than-equal-to-maxExclusive = minExclusive-less-than-equal-to-maxExclusive: {2}\u306E\u5B9A\u7FA9\u3067\u306F\u3001minExclusive\u306E\u5024''{0}''\u306FmaxExclusive\u306E\u5024''{1}''\u4EE5\u4E0B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- minExclusive-less-than-maxInclusive = minExclusive-less-than-maxInclusive: {2}\u306E\u5B9A\u7FA9\u3067\u306F\u3001minExclusive\u306E\u5024''{0}''\u306FmaxInclusive\u306E\u5024''{1}''\u3088\u308A\u5C0F\u3055\u304F\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- minExclusive-valid-restriction.1 = minExclusive-valid-restriction.1: \u30BF\u30A4\u30D7''{2}''\u306E\u30A8\u30E9\u30FC\u3002minExclusive\u306E\u5024''{0}''\u306F\u30D9\u30FC\u30B9\u30FB\u30BF\u30A4\u30D7''{1}''\u306EminExclusive\u4EE5\u4E0A\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- minExclusive-valid-restriction.2 = minExclusive-valid-restriction.2: ''\u30BF\u30A4\u30D7''{2}''\u306E\u30A8\u30E9\u30FC\u3002minExclusive\u306E\u5024''{0}''\u306F\u30D9\u30FC\u30B9\u30FB\u30BF\u30A4\u30D7''{1}''\u306EmaxInclusive\u4EE5\u4E0B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- minExclusive-valid-restriction.3 = minExclusive-valid-restriction.3: \u30BF\u30A4\u30D7''{2}''\u306E\u30A8\u30E9\u30FC\u3002minExclusive\u306E\u5024''{0}''\u306F\u30D9\u30FC\u30B9\u30FB\u30BF\u30A4\u30D7''{1}''\u306EminInclusive\u4EE5\u4E0A\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- minExclusive-valid-restriction.4 = minExclusive-valid-restriction.4: \u30BF\u30A4\u30D7''{2}''\u306E\u30A8\u30E9\u30FC\u3002minExclusive\u306E\u5024''{0}''\u306F\u30D9\u30FC\u30B9\u30FB\u30BF\u30A4\u30D7''{1}''\u306EmaxExclusive\u3088\u308A\u5C0F\u3055\u304F\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- minInclusive-less-than-equal-to-maxInclusive = minInclusive-less-than-equal-to-maxInclusive: {2}\u306E\u5B9A\u7FA9\u3067\u306F\u3001minInclusive\u306E\u5024''{0}''\u306FmaxInclusive\u306E\u5024''{1}''\u4EE5\u4E0B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- minInclusive-less-than-maxExclusive = minInclusive-less-than-maxExclusive: {2}\u306E\u5B9A\u7FA9\u3067\u306F\u3001minInclusive\u306E\u5024''{0}''\u306FmaxExclusive\u306E\u5024''{1}''\u3088\u308A\u5C0F\u3055\u304F\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- minInclusive-minExclusive = minInclusive-minExclusive: \u540C\u3058\u30C7\u30FC\u30BF\u578B\u306B\u5BFE\u3057\u3066minInclusive\u3068minExclusive\u306E\u4E21\u65B9\u3092\u6307\u5B9A\u3057\u305F\u3053\u3068\u306B\u3088\u308B\u30A8\u30E9\u30FC\u3067\u3059\u3002{2}\u3067\u306F\u3001minInclusive\u306F''{0}''\u3001minExclusive\u306F''{1}''\u3067\u3059\u3002
- minInclusive-valid-restriction.1 = minInclusive-valid-restriction.1: \u30BF\u30A4\u30D7''{2}''\u306E\u30A8\u30E9\u30FC\u3002minInclusive\u306E\u5024''{0}''\u306F\u30D9\u30FC\u30B9\u30FB\u30BF\u30A4\u30D7''{1}''\u306EminInclusive\u4EE5\u4E0A\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- minInclusive-valid-restriction.2 = minInclusive-valid-restriction.2: \u30BF\u30A4\u30D7''{2}''\u306E\u30A8\u30E9\u30FC\u3002minInclusive\u306E\u5024''{0}''\u306F\u30D9\u30FC\u30B9\u30FB\u30BF\u30A4\u30D7''{1}''\u306EmaxInclusive\u4EE5\u4E0B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- minInclusive-valid-restriction.3 = minInclusive-valid-restriction.3: \u30BF\u30A4\u30D7''{2}''\u306E\u30A8\u30E9\u30FC\u3002minInclusive\u306E\u5024''{0}''\u306F\u30D9\u30FC\u30B9\u30FB\u30BF\u30A4\u30D7''{1}''\u306EminExclusive\u3088\u308A\u5927\u304D\u304F\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- minInclusive-valid-restriction.4 = minInclusive-valid-restriction.4: \u30BF\u30A4\u30D7''{2}''\u306E\u30A8\u30E9\u30FC\u3002minInclusive\u306E\u5024''{0}''\u306F\u30D9\u30FC\u30B9\u30FB\u30BF\u30A4\u30D7''{1}''\u306EmaxExclusive\u3088\u308A\u5C0F\u3055\u304F\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- minLength-less-than-equal-to-maxLength = minLength-less-than-equal-to-maxLength: {2}\u306E\u5B9A\u7FA9\u3067\u306F\u3001minLength\u306E\u5024''{0}''\u306FmaxLength\u306E\u5024''{1}''\u3088\u308A\u5C0F\u3055\u304F\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- minLength-valid-restriction = minLength-valid-restriction: {2}\u306E\u5B9A\u7FA9\u3067\u306F\u3001minLength\u306E\u5024''{0}''\u306F\u30D9\u30FC\u30B9\u30FB\u30BF\u30A4\u30D7''{1}''\u306E\u5024\u4EE5\u4E0A\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- no-xmlns = no-xmlns: \u5C5E\u6027\u5BA3\u8A00\u306E{name}\u3092'xmlns'\u3068\u540C\u4E00\u306B\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002
- no-xsi = no-xsi: \u5C5E\u6027\u5BA3\u8A00\u306E'{'target namespace'}'\u3092''{0}''\u3068\u540C\u4E00\u306B\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002
- p-props-correct.2.1 = p-props-correct.2.1: ''{0}''\u306E\u5BA3\u8A00\u3067\u306F\u3001''minOccurs''\u306E\u5024\u306F''{1}''\u3067\u3059\u304C\u3001''maxOccurs''\u306E\u5024''{2}''\u3088\u308A\u5927\u304D\u304F\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002
- rcase-MapAndSum.1 = rcase-MapAndSum.1: \u30D1\u30FC\u30C6\u30A3\u30AF\u30EB\u9593\u306B\u5B8C\u5168\u306A\u6A5F\u80FD\u30DE\u30C3\u30D4\u30F3\u30B0\u304C\u3042\u308A\u307E\u305B\u3093\u3002
- rcase-MapAndSum.2 = rcase-MapAndSum.2: \u30B0\u30EB\u30FC\u30D7\u306E\u51FA\u73FE\u7BC4\u56F2({0},{1})\u304C\u30D9\u30FC\u30B9\u30FB\u30B0\u30EB\u30FC\u30D7\u306E\u51FA\u73FE\u7BC4\u56F2({2},{3})\u306E\u6709\u52B9\u306A\u5236\u9650\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
- rcase-NameAndTypeOK.1 = rcase-NameAndTypeOK.1: \u8981\u7D20\u306B\u7570\u306A\u308B\u540D\u524D\u3084\u30BF\u30FC\u30B2\u30C3\u30C8\u30FB\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u304C\u542B\u307E\u308C\u307E\u3059: \u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9''{1}''\u306E\u8981\u7D20''{0}''\u304A\u3088\u3073\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9''{3}''\u306E\u8981\u7D20''{2}''\u3067\u3059\u3002
- rcase-NameAndTypeOK.2 = rcase-NameAndTypeOK.2: '{'term'}'\u304C\u8981\u7D20\u5BA3\u8A00''{0}''\u3067\u3042\u308B\u30D1\u30FC\u30C6\u30A3\u30AF\u30EB\u306E\u30A8\u30E9\u30FC\u3002\u8981\u7D20\u5BA3\u8A00\u306E'{'nillable'}'\u306Ftrue\u3067\u3059\u304C\u3001\u30D9\u30FC\u30B9\u30FB\u30BF\u30A4\u30D7\u306E\u5BFE\u5FDC\u3059\u308B\u30D1\u30FC\u30C6\u30A3\u30AF\u30EB\u306B\u306F'{'nillable'}'\u304Cfalse\u306E\u8981\u7D20\u5BA3\u8A00\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u3002
- rcase-NameAndTypeOK.3 = rcase-NameAndTypeOK.3: '{'term'}'\u304C\u8981\u7D20\u5BA3\u8A00''{0}''\u3067\u3042\u308B\u30D1\u30FC\u30C6\u30A3\u30AF\u30EB\u306E\u30A8\u30E9\u30FC\u3002\u51FA\u73FE\u7BC4\u56F2({1},{2})\u306F\u3001\u30D9\u30FC\u30B9\u30FB\u30BF\u30A4\u30D7\u306E\u5BFE\u5FDC\u3059\u308B\u30D1\u30FC\u30C6\u30A3\u30AF\u30EB\u306E\u7BC4\u56F2({3},{4}\u306E\u6709\u52B9\u306A\u5236\u9650\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
- rcase-NameAndTypeOK.4.a = rcase-NameAndTypeOK.4.a: \u8981\u7D20''{0}''\u306F\u56FA\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u304C\u3001\u30D9\u30FC\u30B9\u30FB\u30BF\u30A4\u30D7\u306E\u5BFE\u5FDC\u3059\u308B\u8981\u7D20\u306F\u5024''{1}''\u3067\u56FA\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002
- rcase-NameAndTypeOK.4.b = rcase-NameAndTypeOK.4.b: \u8981\u7D20''{0}''\u306F\u5024''{1}''\u3067\u56FA\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u304C\u3001\u30D9\u30FC\u30B9\u30FB\u30BF\u30A4\u30D7\u306E\u5BFE\u5FDC\u3059\u308B\u8981\u7D20\u306F\u5024''{2}''\u3067\u56FA\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002
- rcase-NameAndTypeOK.5 = rcase-NameAndTypeOK.5: \u8981\u7D20''{0}''\u306E\u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u5236\u7D04\u304C\u30D9\u30FC\u30B9\u306E\u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u5236\u7D04\u306E\u30B5\u30D6\u30BB\u30C3\u30C8\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
- rcase-NameAndTypeOK.6 = rcase-NameAndTypeOK.6: \u8981\u7D20''{0}''\u306Edisallowed substitutions\u306F\u30D9\u30FC\u30B9\u306Edisallowed substitutions\u306E\u30B9\u30FC\u30D1\u30FC\u30BB\u30C3\u30C8\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
- rcase-NameAndTypeOK.7 = rcase-NameAndTypeOK.7: \u8981\u7D20''{0}''\u306E\u30BF\u30A4\u30D7''{1}''\u306F\u3001\u30D9\u30FC\u30B9\u8981\u7D20\u306E\u30BF\u30A4\u30D7''{2}''\u304B\u3089\u5C0E\u51FA\u3055\u308C\u305F\u3082\u306E\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
- rcase-NSCompat.1 = rcase-NSCompat.1: \u8981\u7D20''{0}''\u306B\u3001\u30D9\u30FC\u30B9\u306E\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9\u3067\u8A31\u53EF\u3055\u308C\u3066\u3044\u306A\u3044\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9''{1}''\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u3002
- rcase-NSCompat.2 = rcase-NSCompat.2: '{'term'}'\u304C\u8981\u7D20\u5BA3\u8A00''{0}''\u3067\u3042\u308B\u30D1\u30FC\u30C6\u30A3\u30AF\u30EB\u306E\u30A8\u30E9\u30FC\u3002\u51FA\u73FE\u7BC4\u56F2({1},{2})\u306F\u3001\u30D9\u30FC\u30B9\u30FB\u30BF\u30A4\u30D7\u306E\u5BFE\u5FDC\u3059\u308B\u30D1\u30FC\u30C6\u30A3\u30AF\u30EB\u306E\u7BC4\u56F2({3},{4}\u306E\u6709\u52B9\u306A\u5236\u9650\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
- rcase-NSRecurseCheckCardinality.1 = rcase-NSRecurseCheckCardinality.1: \u30D1\u30FC\u30C6\u30A3\u30AF\u30EB\u9593\u306B\u5B8C\u5168\u306A\u6A5F\u80FD\u30DE\u30C3\u30D4\u30F3\u30B0\u304C\u3042\u308A\u307E\u305B\u3093\u3002
- rcase-NSRecurseCheckCardinality.2 = rcase-NSRecurseCheckCardinality.2: \u30B0\u30EB\u30FC\u30D7\u306E\u51FA\u73FE\u7BC4\u56F2({0},{1})\u304C\u30D9\u30FC\u30B9\u306E\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9\u306E\u7BC4\u56F2({2},{3})\u306E\u6709\u52B9\u306A\u5236\u9650\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
- rcase-NSSubset.1 = rcase-NSSubset.1: \u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9\u304C\u3001\u30D9\u30FC\u30B9\u306E\u5BFE\u5FDC\u3059\u308B\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9\u306E\u30B5\u30D6\u30BB\u30C3\u30C8\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
- rcase-NSSubset.2 = rcase-NSSubset.2: \u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9\u306E\u51FA\u73FE\u7BC4\u56F2({0},{1})\u306F\u3001\u30D9\u30FC\u30B9\u306E\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9\u306E\u51FA\u73FE\u7BC4\u56F2({2},{3})\u306E\u6709\u52B9\u306A\u5236\u9650\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
- rcase-NSSubset.3 = rcase-NSSubset.3: \u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9\u306E\u30D7\u30ED\u30BB\u30B9\u30FB\u30B3\u30F3\u30C6\u30F3\u30C4''{0}''\u304C\u3001\u30D9\u30FC\u30B9\u306E\u3082\u306E''{1}''\u3088\u308A\u5F31\u304F\u306A\u3063\u3066\u3044\u307E\u3059\u3002
- rcase-Recurse.1 = rcase-Recurse.1: \u30B0\u30EB\u30FC\u30D7\u306E\u51FA\u73FE\u7BC4\u56F2({0},{1})\u304C\u30D9\u30FC\u30B9\u30FB\u30B0\u30EB\u30FC\u30D7\u306E\u51FA\u73FE\u7BC4\u56F2({2},{3})\u306E\u6709\u52B9\u306A\u5236\u9650\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
- rcase-Recurse.2 = rcase-Recurse.2: \u30D1\u30FC\u30C6\u30A3\u30AF\u30EB\u9593\u306B\u5B8C\u5168\u306A\u6A5F\u80FD\u30DE\u30C3\u30D4\u30F3\u30B0\u304C\u3042\u308A\u307E\u305B\u3093\u3002
- rcase-RecurseLax.1 = rcase-RecurseLax.1: \u30B0\u30EB\u30FC\u30D7\u306E\u51FA\u73FE\u7BC4\u56F2({0},{1})\u304C\u30D9\u30FC\u30B9\u30FB\u30B0\u30EB\u30FC\u30D7\u306E\u51FA\u73FE\u7BC4\u56F2({2},{3})\u306E\u6709\u52B9\u306A\u5236\u9650\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
- rcase-RecurseLax.2 = rcase-RecurseLax.2: \u30D1\u30FC\u30C6\u30A3\u30AF\u30EB\u9593\u306B\u5B8C\u5168\u306A\u6A5F\u80FD\u30DE\u30C3\u30D4\u30F3\u30B0\u304C\u3042\u308A\u307E\u305B\u3093\u3002
- rcase-RecurseUnordered.1 = rcase-RecurseUnordered.1: \u30B0\u30EB\u30FC\u30D7\u306E\u51FA\u73FE\u7BC4\u56F2({0},{1})\u304C\u30D9\u30FC\u30B9\u30FB\u30B0\u30EB\u30FC\u30D7\u306E\u51FA\u73FE\u7BC4\u56F2({2},{3})\u306E\u6709\u52B9\u306A\u5236\u9650\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
- rcase-RecurseUnordered.2 = rcase-RecurseUnordered.2: \u30D1\u30FC\u30C6\u30A3\u30AF\u30EB\u9593\u306B\u5B8C\u5168\u306A\u6A5F\u80FD\u30DE\u30C3\u30D4\u30F3\u30B0\u304C\u3042\u308A\u307E\u305B\u3093\u3002
-# We're using sch-props-correct.2 instead of the old src-redefine.1
-# src-redefine.1 = src-redefine.1: The component ''{0}'' is begin redefined, but its corresponding component isn't in the schema document being redefined (with namespace ''{2}''), but in a different document, with namespace ''{1}''.
- sch-props-correct.2 = sch-props-correct.2: \u30B9\u30AD\u30FC\u30DE\u306B\u306F\u540C\u3058\u540D\u524D\u3092\u6301\u30642\u3064\u306E\u30B0\u30ED\u30FC\u30D0\u30EB\u30FB\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u3092\u542B\u3081\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002\u3053\u306E\u30B9\u30AD\u30FC\u30DE\u306B\u306F''{0}''\u304C2\u3064\u3042\u308A\u307E\u3059\u3002
- st-props-correct.2 = st-props-correct.2: \u5358\u7D14\u578B''{0}''\u3067\u5FAA\u74B0\u5B9A\u7FA9\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F\u3002\u3064\u307E\u308A\u3001''{0}''\u304C\u305D\u308C\u81EA\u4F53\u306E\u30BF\u30A4\u30D7\u968E\u5C64\u306B\u542B\u307E\u308C\u3066\u3044\u308B\u305F\u3081\u30A8\u30E9\u30FC\u306B\u306A\u3063\u3066\u3044\u307E\u3059\u3002
- st-props-correct.3 = st-props-correct.3: \u30BF\u30A4\u30D7''{0}''\u306E\u30A8\u30E9\u30FC\u3002'{'base type definition'}'\u306E'{'final'}'\u306E\u5024''{1}''\u306F\u3001\u5236\u9650\u306B\u3088\u3063\u3066\u5C0E\u51FA\u3092\u7981\u6B62\u3057\u3066\u3044\u307E\u3059\u3002
- totalDigits-valid-restriction = totalDigits-valid-restriction: \u30D5\u30A1\u30BB\u30C3\u30C8''totalDigits''\u306E\u5024''{0}''\u306F\u3001\u7956\u5148\u30BF\u30A4\u30D7\u306E\u3044\u305A\u308C\u304B\u3067''{1}''\u306B\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u308B''totalDigits''\u306E\u5024\u4EE5\u4E0B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308B\u305F\u3081\u3001{2}\u306E\u5B9A\u7FA9\u3067\u306F\u7121\u52B9\u3067\u3059\u3002
- whiteSpace-valid-restriction.1 = whiteSpace-valid-restriction.1: \u7956\u5148\u30BF\u30A4\u30D7\u306E\u3044\u305A\u308C\u304B\u3067''whitespace''\u306E\u5024\u304C''collapse''\u306B\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u308B\u305F\u3081\u3001{0}\u306E\u5B9A\u7FA9\u3067\u306F\u30D5\u30A1\u30BB\u30C3\u30C8''whitespace''\u306E\u5024''{1}''\u306F\u7121\u52B9\u3067\u3059\u3002
- whiteSpace-valid-restriction.2 = whiteSpace-valid-restriction.2: \u7956\u5148\u30BF\u30A4\u30D7\u306E\u3044\u305A\u308C\u304B\u3067''whitespace''\u306E\u5024\u304C''replace''\u306B\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u308B\u305F\u3081\u3001{0}\u306E\u5B9A\u7FA9\u3067\u306F\u30D5\u30A1\u30BB\u30C3\u30C8''whitespace''\u306E\u5024''preserve''\u306F\u7121\u52B9\u3067\u3059\u3002
-
-#schema for Schemas
-
- s4s-att-invalid-value = s4s-att-invalid-value: \u8981\u7D20''{0}''\u306E''{1}''\u306E\u5C5E\u6027\u5024\u304C\u7121\u52B9\u3067\u3059\u3002\u8A18\u9332\u3055\u308C\u305F\u7406\u7531: {2}
- s4s-att-must-appear = s4s-att-must-appear: \u8981\u7D20''{0}''\u306B\u5C5E\u6027''{1}''\u3092\u542B\u3081\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- s4s-att-not-allowed = s4s-att-not-allowed: \u8981\u7D20''{0}''\u306B\u5C5E\u6027''{1}''\u3092\u542B\u3081\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002
- s4s-elt-invalid = s4s-elt-invalid: \u8981\u7D20''{0}''\u306F\u30B9\u30AD\u30FC\u30DE\u30FB\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u6709\u52B9\u306A\u8981\u7D20\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
- s4s-elt-must-match.1 = s4s-elt-must-match.1: ''{0}''\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u306F{1}\u3068\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002{2}\u4EE5\u964D\u306B\u554F\u984C\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002
- s4s-elt-must-match.2 = s4s-elt-must-match.2: ''{0}''\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u306F{1}\u3068\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\u5341\u5206\u306A\u8981\u7D20\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002
- # the "invalid-content" messages provide less information than the "must-match" counterparts above. They're used for complex types when providing a "match" would be an information dump
- s4s-elt-invalid-content.1 = s4s-elt-invalid-content.1: ''{0}''\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u306F\u7121\u52B9\u3067\u3059\u3002\u8981\u7D20''{1}''\u304C\u7121\u52B9\u304B\u3001\u4F4D\u7F6E\u304C\u6B63\u3057\u304F\u306A\u3044\u304B\u3001\u51FA\u73FE\u983B\u5EA6\u304C\u9AD8\u3059\u304E\u307E\u3059\u3002
- s4s-elt-invalid-content.2 = s4s-elt-invalid-content.2: ''{0}''\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u306F\u7121\u52B9\u3067\u3059\u3002\u8981\u7D20''{1}''\u306F\u7A7A\u306B\u3067\u304D\u307E\u305B\u3093\u3002
- s4s-elt-invalid-content.3 = s4s-elt-invalid-content.3: \u30BF\u30A4\u30D7''{0}''\u306E\u8981\u7D20\u306F\u3001\u5BA3\u8A00\u306E\u5F8C\u306B<schema>\u8981\u7D20\u306E\u5B50\u3068\u3057\u3066\u542B\u3081\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002
- s4s-elt-schema-ns = s4s-elt-schema-ns: \u8981\u7D20''{0}''\u306E\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u306F\u30B9\u30AD\u30FC\u30DE\u306E\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9''http://www.w3.org/2001/XMLSchema''\u304B\u3089\u306E\u3082\u306E\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- s4s-elt-character = s4s-elt-character: ''xs:appinfo''\u3068''xs:documentation''\u4EE5\u5916\u306E\u30B9\u30AD\u30FC\u30DE\u8981\u7D20\u3067\u306F\u975E\u7A7A\u767D\u6587\u5B57\u306F\u8A31\u53EF\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002''{0}''\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002
-
-# codes not defined by the spec
-
- c-fields-xpaths = c-fields-xpaths: field\u306E\u5024''{0}''\u304C\u7121\u52B9\u3067\u3059\u3002
- c-general-xpath = c-general-xpath: \u5F0F''{0}''\u306F\u3001XML\u30B9\u30AD\u30FC\u30DE\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u308BXPath\u30B5\u30D6\u30BB\u30C3\u30C8\u306B\u5BFE\u3057\u3066\u7121\u52B9\u3067\u3059\u3002
- c-general-xpath-ns = c-general-xpath-ns: XPath\u5F0F''{0}''\u306E\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u306E\u63A5\u982D\u8F9E\u304C\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u306B\u30D0\u30A4\u30F3\u30C9\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3067\u3057\u305F\u3002
- c-selector-xpath = c-selector-xpath: selector\u306E\u5024''{0}''\u306F\u7121\u52B9\u3067\u3059\u3002selector\u306EXPath\u306B\u306F\u5C5E\u6027\u3092\u542B\u3081\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002
- EmptyTargetNamespace = EmptyTargetNamespace: \u30B9\u30AD\u30FC\u30DE\u30FB\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8''{0}''\u3067\u306F\u3001''targetNamespace''\u5C5E\u6027\u306E\u5024\u3092\u7A7A\u306E\u6587\u5B57\u5217\u306B\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002
- FacetValueFromBase = FacetValueFromBase: \u30BF\u30A4\u30D7''{0}''\u306E\u5BA3\u8A00\u3067\u306F\u3001\u30D5\u30A1\u30BB\u30C3\u30C8''{2}''\u306E\u5024''{1}''\u306F\u30D9\u30FC\u30B9\u30FB\u30BF\u30A4\u30D7''{3}''\u306E\u5024\u7A7A\u9593\u304B\u3089\u306E\u3082\u306E\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- FixedFacetValue = FixedFacetValue: {3}\u306E\u5B9A\u7FA9\u3067\u306F\u30D5\u30A1\u30BB\u30C3\u30C8''{0}''\u306E\u5024''{1}''\u306F\u7121\u52B9\u3067\u3059\u3002\u3053\u308C\u306F\u3001''{0}''\u306E\u5024\u304C\u7956\u5148\u30BF\u30A4\u30D7\u306E\u3044\u305A\u308C\u304B\u3067''{2}''\u306B\u8A2D\u5B9A\u3055\u308C\u3066\u304A\u308A\u3001'{'fixed'}' = true\u3067\u3042\u308B\u305F\u3081\u3067\u3059\u3002
- InvalidRegex = InvalidRegex: pattern\u306E\u5024''{0}''\u306F\u7121\u52B9\u306A\u6B63\u898F\u8868\u73FE\u3067\u3059\u3002\u5217''{2}''\u3067''{1}''\u30A8\u30E9\u30FC\u304C\u5831\u544A\u3055\u308C\u307E\u3057\u305F\u3002
- MaxOccurLimit = \u73FE\u5728\u306E\u30D1\u30FC\u30B5\u30FC\u306E\u69CB\u6210\u3067\u306F\u3001maxOccurs\u5C5E\u6027\u306B\u5024{0}\u3088\u308A\u5927\u304D\u3044\u5024\u3092\u8A2D\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002
- PublicSystemOnNotation = PublicSystemOnNotation: \u8981\u7D20''notation''\u306B\u306F''public''\u304A\u3088\u3073''system''\u306E\u5C11\u306A\u304F\u3068\u30821\u3064\u304C\u5FC5\u8981\u3067\u3059\u3002
- SchemaLocation = SchemaLocation: schemaLocation\u306E\u5024''{0}''\u306B\u306F\u5076\u6570\u500B\u306EURI\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
- TargetNamespace.1 = TargetNamespace.1: \u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9''{0}''\u304C\u5FC5\u8981\u3067\u3059\u304C\u3001\u30B9\u30AD\u30FC\u30DE\u30FB\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u30BF\u30FC\u30B2\u30C3\u30C8\u30FB\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u306F''{1}''\u3067\u3059\u3002
- TargetNamespace.2 = TargetNamespace.2: \u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u306F\u5FC5\u8981\u3042\u308A\u307E\u305B\u3093\u304C\u3001\u30B9\u30AD\u30FC\u30DE\u30FB\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306B''{1}''\u306E\u30BF\u30FC\u30B2\u30C3\u30C8\u30FB\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u3002
- UndeclaredEntity = UndeclaredEntity: \u30A8\u30F3\u30C6\u30A3\u30C6\u30A3''{0}''\u304C\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
- UndeclaredPrefix = UndeclaredPrefix: ''{0}''\u3092QName\u3068\u3057\u3066\u89E3\u6C7A\u3067\u304D\u307E\u305B\u3093\u3002\u63A5\u982D\u8F9E''{1}''\u304C\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_ko.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_ko.properties
deleted file mode 100644
index fc3b3d3..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_ko.properties
+++ /dev/null
@@ -1,291 +0,0 @@
-# This file contains error and warning messages related to XML Schema
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
- BadMessageKey = \uBA54\uC2DC\uC9C0 \uD0A4\uC5D0 \uD574\uB2F9\uD558\uB294 \uC624\uB958 \uBA54\uC2DC\uC9C0\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
- FormatFailed = \uB2E4\uC74C \uBA54\uC2DC\uC9C0\uC758 \uD615\uC2DD\uC744 \uC9C0\uC815\uD558\uB294 \uC911 \uB0B4\uBD80 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4.\n
-
-# For internal use
-
- Internal-Error = \uB0B4\uBD80 \uC624\uB958: {0}.
- dt-whitespace = \uD569\uC9D1\uD569 simpleType ''{0}''\uC5D0 \uB300\uD55C \uACF5\uBC31 \uBA74 \uAC12\uC744 \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
- GrammarConflict = \uC0AC\uC6A9\uC790 \uBB38\uBC95 \uD480\uC5D0\uC11C \uBC18\uD658\uB41C \uBB38\uBC95 \uC911 \uD558\uB098\uAC00 \uB2E4\uB978 \uBB38\uBC95\uACFC \uCDA9\uB3CC\uD569\uB2C8\uB2E4.
-
-# Identity constraints
-
- AbsentKeyValue = ID \uC81C\uC57D \uC870\uAC74 \uC624\uB958(cvc-identity-constraint.4.2.1): "{0}" \uC694\uC18C\uC5D0 \uAC12\uC774 \uC5C6\uB294 \uD0A4\uAC00 \uC788\uC2B5\uB2C8\uB2E4.
- DuplicateField = "{0}" \uD544\uB4DC \uBC94\uC704\uC5D0 \uC911\uBCF5 \uC0AC\uD56D\uC774 \uC788\uC2B5\uB2C8\uB2E4.
- DuplicateKey = \uC911\uBCF5 \uD0A4 \uAC12 [{0}]\uC774(\uAC00) "{1}" \uC694\uC18C\uC758 ID \uC81C\uC57D \uC870\uAC74\uC5D0 \uB300\uD574 \uC120\uC5B8\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
- DuplicateUnique = \uC911\uBCF5 \uACE0\uC720 \uAC12 [{0}]\uC774(\uAC00) "{1}" \uC694\uC18C\uC758 ID \uC81C\uC57D \uC870\uAC74\uC5D0 \uB300\uD574 \uC120\uC5B8\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
- FieldMultipleMatch = ID \uC81C\uC57D \uC870\uAC74 \uC624\uB958: "{0}" \uD544\uB4DC\uAC00 \uD574\uB2F9 \uC120\uD0DD\uAE30 \uBC94\uC704 \uB0B4\uC5D0 \uD3EC\uD568\uB41C \uC5EC\uB7EC \uAC12\uACFC \uC77C\uCE58\uD569\uB2C8\uB2E4. \uD544\uB4DC\uB294 \uACE0\uC720 \uAC12\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4.
- FixedDiffersFromActual = \uC774 \uC694\uC18C\uC758 \uCF58\uD150\uCE20\uAC00 \uC2A4\uD0A4\uB9C8\uC758 \uC694\uC18C \uC120\uC5B8\uC5D0 \uC788\uB294 "fixed" \uC18D\uC131\uAC12\uACFC \uC77C\uCE58\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
- KeyMatchesNillable = ID \uC81C\uC57D \uC870\uAC74 \uC624\uB958(cvc-identity-constraint.4.2.3): "{0}" \uC694\uC18C\uC5D0 nillable\uC774 true\uB85C \uC124\uC815\uB41C \uC694\uC18C\uC640 \uC77C\uCE58\uD558\uB294 \uD0A4\uAC00 \uC788\uC2B5\uB2C8\uB2E4.
- KeyNotEnoughValues = "{0}" \uC694\uC18C\uC758 <key name="{1}"> ID \uC81C\uC57D \uC870\uAC74\uC5D0 \uB300\uD574 \uC9C0\uC815\uB41C \uAC12\uC774 \uBD80\uC871\uD569\uB2C8\uB2E4.
- KeyNotFound = ''{2}'' \uC694\uC18C\uC758 ID \uC81C\uC57D \uC870\uAC74\uC5D0 \uB300\uD574 \uAC12\uC774 ''{1}''\uC778 ''{0}'' \uD0A4\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
- KeyRefNotEnoughValues = "{0}" \uC694\uC18C\uC758 <keyref name="{1}"> ID \uC81C\uC57D \uC870\uAC74\uC5D0 \uB300\uD574 \uC9C0\uC815\uB41C \uAC12\uC774 \uBD80\uC871\uD569\uB2C8\uB2E4.
- KeyRefOutOfScope = ID \uC81C\uC57D \uC870\uAC74 \uC624\uB958: ID \uC81C\uC57D \uC870\uAC74 "{0}"\uC758 keyref\uAC00 \uBC94\uC704\uC5D0\uC11C \uBC97\uC5B4\uB09C \uD0A4 \uB610\uB294 \uACE0\uC720 \uD56D\uBAA9\uC744 \uCC38\uC870\uD569\uB2C8\uB2E4.
- KeyRefReferNotFound = \uD0A4 \uCC38\uC870 \uC120\uC5B8 "{0}"\uC740(\uB294) \uC774\uB984\uC774 "{1}"\uC778 \uC54C \uC218 \uC5C6\uB294 \uD0A4\uB97C \uCC38\uC870\uD569\uB2C8\uB2E4.
- UniqueNotEnoughValues = "{0}" \uC694\uC18C\uC758 <unique> ID \uC81C\uC57D \uC870\uAC74\uC5D0 \uB300\uD574 \uC9C0\uC815\uB41C \uAC12\uC774 \uBD80\uC871\uD569\uB2C8\uB2E4.
- UnknownField = \uB0B4\uBD80 ID \uC81C\uC57D \uC870\uAC74 \uC624\uB958: "{0}"\uC740(\uB294) \uC54C \uC218 \uC5C6\uB294 \uD544\uB4DC\uC785\uB2C8\uB2E4.
-
-# Ideally, we should only use the following error keys, not the ones under
-# "Identity constraints". And we should cover all of the following errors.
-
-#validation (3.X.4)
-
- cvc-attribute.3 = cvc-attribute.3: ''{0}'' \uC694\uC18C\uC758 ''{1}'' \uC18D\uC131\uC5D0 \uB300\uD55C ''{2}'' \uAC12\uC774 ''{3}'' \uC720\uD615\uC5D0 \uB300\uD574 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4.
- cvc-attribute.4 = cvc-attribute.4: ''{0}'' \uC694\uC18C\uC758 ''{1}'' \uC18D\uC131\uC5D0 \uB300\uD55C ''{2}'' \uAC12\uC774 \uACE0\uC815\uB41C '{'value constraint'}'\uC5D0 \uB300\uD574 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. \uC18D\uC131\uC758 \uAC12\uC740 ''{3}''\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- cvc-complex-type.2.1 = cvc-complex-type.2.1: \uC720\uD615\uC758 \uCF58\uD150\uCE20 \uC720\uD615\uC774 \uBE44\uC5B4 \uC788\uC73C\uBBC0\uB85C ''{0}'' \uC694\uC18C\uC5D0\uB294 \uBB38\uC790 \uB610\uB294 \uC694\uC18C \uC815\uBCF4 \uD56D\uBAA9 [children]\uC774 \uC5C6\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- cvc-complex-type.2.2 = cvc-complex-type.2.2: ''{0}'' \uC694\uC18C\uC5D0\uB294 \uC694\uC18C [children]\uC774 \uC5C6\uC5B4\uC57C \uD558\uBA70 \uAC12\uC774 \uC801\uD569\uD574\uC57C \uD569\uB2C8\uB2E4.
- cvc-complex-type.2.3 = cvc-complex-type.2.3: \uC720\uD615\uC758 \uCF58\uD150\uCE20 \uC720\uD615\uC774 \uC694\uC18C \uC804\uC6A9\uC774\uBBC0\uB85C ''{0}'' \uC694\uC18C\uC5D0\uB294 \uBB38\uC790 [children]\uC774 \uD3EC\uD568\uB420 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
- cvc-complex-type.2.4.a = cvc-complex-type.2.4.a: ''{0}'' \uC694\uC18C\uB85C \uC2DC\uC791\uD558\uB294 \uBD80\uC801\uD569\uD55C \uCF58\uD150\uCE20\uAC00 \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4. ''{1}'' \uC911 \uD558\uB098\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4.
- cvc-complex-type.2.4.b = cvc-complex-type.2.4.b: ''{0}'' \uC694\uC18C\uC758 \uCF58\uD150\uCE20\uAC00 \uBD88\uC644\uC804\uD569\uB2C8\uB2E4. ''{1}'' \uC911 \uD558\uB098\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4.
- cvc-complex-type.2.4.c = cvc-complex-type.2.4.c: \uC77C\uCE58\uD558\uB294 \uC640\uC77C\uB4DC \uCE74\uB4DC \uBB38\uC790\uAC00 \uC5C4\uACA9\uD558\uAC8C \uC801\uC6A9\uB418\uC9C0\uB9CC ''{0}'' \uC694\uC18C\uC5D0 \uB300\uD55C \uC120\uC5B8\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
- cvc-complex-type.2.4.d = cvc-complex-type.2.4.d: ''{0}'' \uC694\uC18C\uB85C \uC2DC\uC791\uD558\uB294 \uBD80\uC801\uD569\uD55C \uCF58\uD150\uCE20\uAC00 \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uC5EC\uAE30\uC5D0\uB294 \uD558\uC704 \uC694\uC18C\uAC00 \uD544\uC694\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
- cvc-complex-type.2.4.e = cvc-complex-type.2.4.d: ''{0}'' \uC694\uC18C\uB85C \uC2DC\uC791\uD558\uB294 \uBD80\uC801\uD569\uD55C \uCF58\uD150\uCE20\uAC00 \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uC5EC\uAE30\uC5D0\uB294 \uD558\uC704 \uC694\uC18C ''{1}''\uC774(\uAC00) \uD544\uC694\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
- cvc-complex-type.3.1 = cvc-complex-type.3.1: ''{0}'' \uC694\uC18C\uC758 ''{1}'' \uC18D\uC131\uC5D0 \uB300\uD55C ''{2}'' \uAC12\uC774 \uD574\uB2F9 \uC18D\uC131 \uC0AC\uC6A9\uC5D0 \uB300\uD574 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. ''{1}'' \uC18D\uC131\uC758 \uACE0\uC815\uB41C \uAC12\uC774 ''{3}''\uC785\uB2C8\uB2E4.
- cvc-complex-type.3.2.1 = cvc-complex-type.3.2.1: ''{0}'' \uC694\uC18C\uC5D0 ''{1}'' \uC18D\uC131\uC5D0 \uB300\uD55C \uC18D\uC131 \uC640\uC77C\uB4DC \uCE74\uB4DC \uBB38\uC790\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.
- cvc-complex-type.3.2.2 = cvc-complex-type.3.2.2: ''{1}'' \uC18D\uC131\uC740 ''{0}'' \uC694\uC18C\uC5D0 \uB098\uD0C0\uB0A0 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
- cvc-complex-type.4 = cvc-complex-type.4: ''{1}'' \uC18D\uC131\uC740 ''{0}'' \uC694\uC18C\uC5D0 \uB098\uD0C0\uB098\uC57C \uD569\uB2C8\uB2E4.
- cvc-complex-type.5.1 = cvc-complex-type.5.1: ''{0}'' \uC694\uC18C\uC5D0\uC11C ''{1}'' \uC18D\uC131\uC774 \uB300\uCCB4 ID\uC774\uC9C0\uB9CC \uB300\uCCB4 ID ''{2}''\uC774(\uAC00) \uC774\uBBF8 \uC788\uC2B5\uB2C8\uB2E4. \uD558\uB098\uB9CC \uC0AC\uC6A9\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.
- cvc-complex-type.5.2 = cvc-complex-type.5.2: ''{0}'' \uC694\uC18C\uC5D0\uC11C ''{1}'' \uC18D\uC131\uC774 \uB300\uCCB4 ID\uC774\uC9C0\uB9CC '{'attribute uses'}' \uC911 ID\uC5D0\uC11C \uD30C\uC0DD\uB41C ''{2}'' \uC18D\uC131\uC774 \uC774\uBBF8 \uC788\uC2B5\uB2C8\uB2E4.
- cvc-datatype-valid.1.2.1 = cvc-datatype-valid.1.2.1: ''{0}''\uC740(\uB294) ''{1}''\uC5D0 \uB300\uD574 \uC801\uD569\uD55C \uAC12\uC774 \uC544\uB2D9\uB2C8\uB2E4.
- cvc-datatype-valid.1.2.2 = cvc-datatype-valid.1.2.2: ''{0}''\uC740(\uB294) \uBAA9\uB85D \uC720\uD615 ''{1}''\uC758 \uC801\uD569\uD55C \uAC12\uC774 \uC544\uB2D9\uB2C8\uB2E4.
- cvc-datatype-valid.1.2.3 = cvc-datatype-valid.1.2.3: ''{0}''\uC740(\uB294) \uD569\uC9D1\uD569 \uC720\uD615 ''{1}''\uC758 \uC801\uD569\uD55C \uAC12\uC774 \uC544\uB2D9\uB2C8\uB2E4.
- cvc-elt.1 = cvc-elt.1: ''{0}'' \uC694\uC18C\uC758 \uC120\uC5B8\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
- cvc-elt.2 = cvc-elt.2: ''{0}''\uC5D0 \uB300\uD55C \uC694\uC18C \uC120\uC5B8\uC5D0\uC11C '{'abstract'}'\uC758 \uAC12\uC740 false\uC5EC\uC57C \uD569\uB2C8\uB2E4.
- cvc-elt.3.1 = cvc-elt.3.1: ''{0}''\uC758 '{'nillable'}' \uC18D\uC131\uC774 false\uC774\uBBC0\uB85C ''{1}'' \uC18D\uC131\uC740 ''{0}'' \uC694\uC18C\uC5D0 \uB098\uD0C0\uB098\uC9C0 \uC54A\uC544\uC57C \uD569\uB2C8\uB2E4.
- cvc-elt.3.2.1 = cvc-elt.3.2.1: ''{1}''\uC774(\uAC00) \uC9C0\uC815\uB418\uC5C8\uC73C\uBBC0\uB85C ''{0}'' \uC694\uC18C\uC5D0\uB294 \uBB38\uC790 \uB610\uB294 \uC694\uC18C \uC815\uBCF4 [children]\uC774 \uD3EC\uD568\uB420 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
- cvc-elt.3.2.2 = cvc-elt.3.2.2: ''{1}''\uC774(\uAC00) \uC9C0\uC815\uB418\uC5C8\uC73C\uBBC0\uB85C ''{0}'' \uC694\uC18C\uC5D0 \uB300\uD574 \uACE0\uC815\uB41C '{'value constraint'}'\uAC00 \uC5C6\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- cvc-elt.4.1 = cvc-elt.4.1: ''{0}'' \uC694\uC18C\uC758 ''{1}'' \uC18D\uC131\uC5D0 \uB300\uD55C ''{2}'' \uAC12\uC740 \uC801\uD569\uD55C QName\uC774 \uC544\uB2D9\uB2C8\uB2E4.
- cvc-elt.4.2 = cvc-elt.4.2: ''{1}''\uC744(\uB97C) ''{0}'' \uC694\uC18C\uC5D0 \uB300\uD55C \uC720\uD615 \uC815\uC758\uB85C \uBD84\uC11D\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
- cvc-elt.4.3 = cvc-elt.4.3: ''{1}'' \uC720\uD615\uC740 ''{0}'' \uC694\uC18C\uC758 \uC720\uD615 \uC815\uC758 ''{2}''\uC5D0\uC11C \uC801\uD569\uD558\uAC8C \uD30C\uC0DD\uB41C \uAC83\uC774 \uC544\uB2D9\uB2C8\uB2E4.
- cvc-elt.5.1.1 = cvc-elt.5.1.1: ''{0}'' \uC694\uC18C\uC758 '{'value constraint'}' ''{2}''\uC740(\uB294) ''{1}'' \uC720\uD615\uC5D0 \uB300\uD574 \uC801\uD569\uD55C \uAE30\uBCF8\uAC12\uC774 \uC544\uB2D9\uB2C8\uB2E4.
- cvc-elt.5.2.2.1 = cvc-elt.5.2.2.1: ''{0}'' \uC694\uC18C\uC5D0\uB294 \uC694\uC18C \uC815\uBCF4 \uD56D\uBAA9 [children]\uC774 \uC5C6\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- cvc-elt.5.2.2.2.1 = cvc-elt.5.2.2.2.1: ''{0}'' \uC694\uC18C\uC758 ''{1}'' \uAC12\uC774 \uACE0\uC815\uB41C '{'value constraint'}' \uAC12 ''{2}''\uACFC(\uC640) \uC77C\uCE58\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
- cvc-elt.5.2.2.2.2 = cvc-elt.5.2.2.2.2: ''{0}'' \uC694\uC18C\uC758 ''{1}'' \uAC12\uC774 '{'value constraint'}' \uAC12 ''{2}''\uACFC(\uC640) \uC77C\uCE58\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
- cvc-enumeration-valid = cvc-enumeration-valid: ''{0}'' \uAC12\uC740 ''{1}'' \uBAA9\uB85D\uC5D0 \uB300\uD574 \uC801\uD569\uD55C \uBA74\uC774 \uC544\uB2D9\uB2C8\uB2E4. \uBAA9\uB85D\uC758 \uAC12\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- cvc-fractionDigits-valid = cvc-fractionDigits-valid: ''{0}'' \uAC12\uC758 \uC18C\uC218\uC810 \uC774\uD558 \uC790\uB9BF\uC218\uAC00 {1}\uC774\uC9C0\uB9CC \uC18C\uC218\uC810 \uC774\uD558 \uC790\uB9BF\uC218\uB294 {2}(\uC73C)\uB85C \uC81C\uD55C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
- cvc-id.1 = cvc-id.1: IDREF ''{0}''\uC5D0 \uB300\uD55C ID/IDREF \uBC14\uC778\uB529\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.
- cvc-id.2 = cvc-id.2: ID \uAC12 ''{0}''\uC774(\uAC00) \uC5EC\uB7EC \uBC88 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4.
- cvc-id.3 = cvc-id.3: ID \uC81C\uC57D \uC870\uAC74 ''{0}''\uC758 \uD544\uB4DC\uAC00 ''{1}'' \uC694\uC18C\uC640 \uC77C\uCE58\uD558\uC9C0\uB9CC \uC774 \uC694\uC18C\uB294 \uB2E8\uC21C \uC720\uD615\uC744 \uC0AC\uC6A9\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
- cvc-length-valid = cvc-length-valid: length = ''{1}''\uC778 ''{0}'' \uAC12\uC740 ''{3}'' \uC720\uD615\uC758 length ''{2}''\uC5D0 \uB300\uD574 \uC801\uD569\uD55C \uBA74\uC774 \uC544\uB2D9\uB2C8\uB2E4.
- cvc-maxExclusive-valid = cvc-maxExclusive-valid: ''{0}'' \uAC12\uC740 ''{2}'' \uC720\uD615\uC758 maxExclusive ''{1}''\uC5D0 \uB300\uD574 \uC801\uD569\uD55C \uBA74\uC774 \uC544\uB2D9\uB2C8\uB2E4.
- cvc-maxInclusive-valid = cvc-maxInclusive-valid: ''{0}'' \uAC12\uC740 ''{2}'' \uC720\uD615\uC758 maxInclusive ''{1}''\uC5D0 \uB300\uD574 \uC801\uD569\uD55C \uBA74\uC774 \uC544\uB2D9\uB2C8\uB2E4.
- cvc-maxLength-valid = cvc-maxLength-valid: length = ''{1}''\uC778 ''{0}'' \uAC12\uC740 ''{3}'' \uC720\uD615\uC758 maxLength ''{2}''\uC5D0 \uB300\uD574 \uC801\uD569\uD55C \uBA74\uC774 \uC544\uB2D9\uB2C8\uB2E4.
- cvc-minExclusive-valid = cvc-minExclusive-valid: ''{0}'' \uAC12\uC740 ''{2}'' \uC720\uD615\uC758 minExclusive ''{1}''\uC5D0 \uB300\uD574 \uC801\uD569\uD55C \uBA74\uC774 \uC544\uB2D9\uB2C8\uB2E4.
- cvc-minInclusive-valid = cvc-minInclusive-valid: ''{0}'' \uAC12\uC740 ''{2}'' \uC720\uD615\uC758 minInclusive ''{1}''\uC5D0 \uB300\uD574 \uC801\uD569\uD55C \uBA74\uC774 \uC544\uB2D9\uB2C8\uB2E4.
- cvc-minLength-valid = cvc-minLength-valid: length = ''{1}''\uC778 ''{0}'' \uAC12\uC740 ''{3}'' \uC720\uD615\uC758 minLength ''{2}''\uC5D0 \uB300\uD574 \uC801\uD569\uD55C \uBA74\uC774 \uC544\uB2D9\uB2C8\uB2E4.
- cvc-pattern-valid = cvc-pattern-valid: ''{0}'' \uAC12\uC740 ''{2}'' \uC720\uD615\uC758 ''{1}'' \uD328\uD134\uC5D0 \uB300\uD574 \uC801\uD569\uD55C \uBA74\uC774 \uC544\uB2D9\uB2C8\uB2E4.
- cvc-totalDigits-valid = cvc-totalDigits-valid: ''{0}'' \uAC12\uC758 \uCD1D \uC790\uB9BF\uC218\uAC00 {1}\uC774\uC9C0\uB9CC \uCD1D \uC790\uB9BF\uC218\uB294 {2}(\uC73C)\uB85C \uC81C\uD55C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
- cvc-type.2 = cvc-type.2: {0} \uC694\uC18C\uC5D0 \uB300\uD55C \uC720\uD615 \uC815\uC758\uB294 \uCD94\uC0C1\uC801\uC77C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
- cvc-type.3.1.1 = cvc-type.3.1.1: ''{0}'' \uC694\uC18C\uB294 \uB2E8\uC21C \uC720\uD615\uC774\uBBC0\uB85C \uB124\uC784\uC2A4\uD398\uC774\uC2A4 \uC774\uB984\uC774 ''http://www.w3.org/2001/XMLSchema-instance''\uC774\uBA70 [local name]\uC774 ''type'', ''nil'', ''schemaLocation'' \uB610\uB294 ''noNamespaceSchemaLocation'' \uC911 \uD558\uB098\uC778 \uC18D\uC131\uC744 \uC81C\uC678\uD558\uACE0 \uB2E4\uB978 \uC18D\uC131\uC744 \uD3EC\uD568\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uD558\uC9C0\uB9CC ''{1}'' \uC18D\uC131\uC774 \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
- cvc-type.3.1.2 = cvc-type.3.1.2: ''{0}'' \uC694\uC18C\uB294 \uB2E8\uC21C \uC720\uD615\uC774\uBBC0\uB85C \uC694\uC18C \uC815\uBCF4 \uD56D\uBAA9 [children]\uC744 \uD3EC\uD568\uD558\uC9C0 \uC54A\uC544\uC57C \uD569\uB2C8\uB2E4.
- cvc-type.3.1.3 = cvc-type.3.1.3: ''{0}'' \uC694\uC18C\uC758 ''{1}'' \uAC12\uC774 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4.
-
-#schema valid (3.X.3)
-
- schema_reference.access = schema_reference: accessExternalSchema \uC18D\uC131\uC73C\uB85C \uC124\uC815\uB41C \uC81C\uD55C\uC73C\uB85C \uC778\uD574 ''{1}'' \uC561\uC138\uC2A4\uAC00 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC73C\uBBC0\uB85C \uC2A4\uD0A4\uB9C8 \uBB38\uC11C ''{0}'' \uC77D\uAE30\uB97C \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4.
- schema_reference.4 = schema_reference.4: \uC2A4\uD0A4\uB9C8 \uBB38\uC11C ''{0}'' \uC77D\uAE30\uB97C \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uC6D0\uC778: 1) \uBB38\uC11C\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. 2) \uBB38\uC11C\uB97C \uC77D\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. 3) \uBB38\uC11C\uC758 \uB8E8\uD2B8 \uC694\uC18C\uAC00 <xsd:schema>\uAC00 \uC544\uB2D9\uB2C8\uB2E4.
- src-annotation = src-annotation: <annotation> \uC694\uC18C\uC5D0\uB294 <appinfo> \uBC0F <documentation> \uC694\uC18C\uB9CC \uD3EC\uD568\uB420 \uC218 \uC788\uC9C0\uB9CC ''{0}''\uC774(\uAC00) \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
- src-attribute.1 = src-attribute.1: ''default'' \uBC0F ''fixed'' \uC18D\uC131\uC740 \uC18D\uC131 \uC120\uC5B8 ''{0}''\uC5D0 \uD568\uAED8 \uC874\uC7AC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uD558\uB098\uB9CC \uC0AC\uC6A9\uD558\uC2ED\uC2DC\uC624.
- src-attribute.2 = src-attribute.2: ''default'' \uC18D\uC131\uC774 ''{0}'' \uC18D\uC131\uC5D0 \uC874\uC7AC\uD558\uBBC0\uB85C ''use'' \uAC12\uC740 ''optional''\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- src-attribute.3.1 = src-attribute.3.1: 'ref' \uB610\uB294 'name' \uC911 \uD558\uB098\uAC00 \uB85C\uCEEC \uC18D\uC131 \uC120\uC5B8\uC5D0 \uC874\uC7AC\uD574\uC57C \uD569\uB2C8\uB2E4.
- src-attribute.3.2 = src-attribute.3.2: \uCF58\uD150\uCE20\uAC00 \uC18D\uC131 \uCC38\uC870 ''{0}''\uC5D0 \uB300\uD55C (annotation?)\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4.
- src-attribute.4 = src-attribute.4: ''{0}'' \uC18D\uC131\uC5D0 ''type'' \uC18D\uC131\uACFC \uC775\uBA85\uC758 ''simpleType'' \uD558\uC704 \uC18D\uC131\uC774 \uBAA8\uB450 \uC788\uC2B5\uB2C8\uB2E4. \uC774 \uC911 \uD558\uB098\uB9CC \uC18D\uC131\uC5D0 \uD5C8\uC6A9\uB429\uB2C8\uB2E4.
- src-attribute_group.2 = src-attribute_group.2: \uC18D\uC131 \uADF8\uB8F9 ''{0}''\uC5D0 \uB300\uD574 \uC640\uC77C\uB4DC \uCE74\uB4DC \uBB38\uC790\uC758 \uAD50\uC9D1\uD569\uC744 \uD45C\uD604\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
- src-attribute_group.3 = src-attribute_group.3: \uC18D\uC131 \uADF8\uB8F9 ''{0}''\uC5D0 \uB300\uD55C \uC21C\uD658 \uC815\uC758\uAC00 \uAC10\uC9C0\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uC21C\uD658\uC801\uC73C\uB85C \uB4A4\uC5D0 \uC624\uB294 \uC18D\uC131 \uADF8\uB8F9 \uCC38\uC870\uAC00 \uACB0\uAD6D \uC790\uC2E0\uC5D0\uAC8C \uB3CC\uC544\uC635\uB2C8\uB2E4.
- src-ct.1 = src-ct.1: ''{0}'' \uC720\uD615\uC5D0 \uB300\uD55C \uBCF5\uD569 \uC720\uD615 \uC815\uC758 \uD45C\uD604 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. <complexContent>\uAC00 \uC0AC\uC6A9\uB418\uB294 \uACBD\uC6B0 complexType\uC774 \uAE30\uBCF8 \uC720\uD615\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4. ''{1}''\uC740(\uB294) simpleType\uC785\uB2C8\uB2E4.
- src-ct.2.1 = src-ct.2.1: ''{0}'' \uC720\uD615\uC5D0 \uB300\uD55C \uBCF5\uD569 \uC720\uD615 \uC815\uC758 \uD45C\uD604 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. <simpleContent>\uAC00 \uC0AC\uC6A9\uB418\uB294 \uACBD\uC6B0 \uCF58\uD150\uCE20 \uC720\uD615\uC774 \uB2E8\uC21C \uC720\uD615\uC778 complexType, \uD63C\uD569 \uCF58\uD150\uCE20 \uBC0F \uBE44\uC6B8 \uC218 \uC788\uB294 \uC870\uAC01\uC744 \uAC00\uC9C4 \uBCF5\uD569 \uC720\uD615(\uC81C\uD55C \uC0AC\uD56D\uC774 \uC9C0\uC815\uB41C \uACBD\uC6B0\uC5D0\uB9CC) \uB610\uB294 \uB2E8\uC21C \uC720\uD615(\uD655\uC7A5\uC774 \uC9C0\uC815\uB41C \uACBD\uC6B0\uC5D0\uB9CC)\uC774 \uAE30\uBCF8 \uC720\uD615\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4. ''{1}''\uC740(\uB294) \uC774\uB7EC\uD55C \uC870\uAC74\uC744 \uCDA9\uC871\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
- src-ct.2.2 = src-ct.2.2: ''{0}'' \uC720\uD615\uC5D0 \uB300\uD55C \uBCF5\uD569 \uC720\uD615 \uC815\uC758 \uD45C\uD604 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. simpleContent\uB97C \uAC00\uC9C4 complexType\uC774 \uD63C\uD569 \uCF58\uD150\uCE20 \uBC0F \uBE44\uC6B8 \uC218 \uC788\uB294 \uC870\uAC01\uC744 \uAC00\uC9C4 complexType\uC744 \uC81C\uD55C\uD558\uB294 \uACBD\uC6B0 <restriction>\uC758 \uD558\uC704 \uD56D\uBAA9 \uC911 <simpleType>\uC774 \uC788\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- src-ct.4 = src-ct.4: ''{0}'' \uC720\uD615\uC5D0 \uB300\uD55C \uBCF5\uD569 \uC720\uD615 \uC815\uC758 \uD45C\uD604 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. \uC640\uC77C\uB4DC \uCE74\uB4DC \uBB38\uC790\uC758 \uAD50\uC9D1\uD569\uC744 \uD45C\uD604\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
- src-ct.5 = src-ct.5: ''{0}'' \uC720\uD615\uC5D0 \uB300\uD55C \uBCF5\uD569 \uC720\uD615 \uC815\uC758 \uD45C\uD604 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. \uC640\uC77C\uB4DC \uCE74\uB4DC \uBB38\uC790\uC758 \uD569\uC9D1\uD569\uC744 \uD45C\uD604\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
- src-element.1 = src-element.1: ''default'' \uBC0F ''fixed'' \uC18D\uC131\uC740 \uC694\uC18C \uC120\uC5B8 ''{0}''\uC5D0 \uD568\uAED8 \uC874\uC7AC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uD558\uB098\uB9CC \uC0AC\uC6A9\uD558\uC2ED\uC2DC\uC624.
- src-element.2.1 = src-element.2.1: 'ref' \uB610\uB294 'name' \uC911 \uD558\uB098\uAC00 \uB85C\uCEEC \uC694\uC18C \uC120\uC5B8\uC5D0 \uC874\uC7AC\uD574\uC57C \uD569\uB2C8\uB2E4.
- src-element.2.2 = src-element.2.2: ''{0}''\uC5D0 ''ref'' \uC18D\uC131\uC774 \uD3EC\uD568\uB418\uC5B4 \uC788\uC73C\uBBC0\uB85C \uD574\uB2F9 \uCF58\uD150\uCE20\uB294 (annotation?)\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4. \uD558\uC9C0\uB9CC ''{1}''\uC774(\uAC00) \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
- src-element.3 = src-element.3: ''{0}'' \uC694\uC18C\uC5D0 ''type'' \uC18D\uC131\uACFC ''anonymous type'' \uD558\uC704 \uC18D\uC131\uC774 \uBAA8\uB450 \uC788\uC2B5\uB2C8\uB2E4. \uC774 \uC911 \uD558\uB098\uB9CC \uC694\uC18C\uC5D0 \uD5C8\uC6A9\uB429\uB2C8\uB2E4.
- src-import.1.1 = src-import.1.1: <import> \uC694\uC18C \uC815\uBCF4 \uD56D\uBAA9\uC758 \uB124\uC784\uC2A4\uD398\uC774\uC2A4 \uC18D\uC131 ''{0}''\uC740(\uB294) \uC874\uC7AC\uD558\uB294 \uC2A4\uD0A4\uB9C8\uC758 targetNamespace\uC640 \uB2EC\uB77C\uC57C \uD569\uB2C8\uB2E4.
- src-import.1.2 = src-import.1.2: \uB124\uC784\uC2A4\uD398\uC774\uC2A4 \uC18D\uC131\uC774 <import> \uC694\uC18C \uC815\uBCF4 \uD56D\uBAA9\uC5D0 \uC874\uC7AC\uD558\uC9C0 \uC54A\uC744 \uACBD\uC6B0 \uD3EC\uD568\uD558\uACE0 \uC788\uB294 \uC2A4\uD0A4\uB9C8\uC5D0 targetNamespace\uAC00 \uC788\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- src-import.2 = src-import.2: ''{0}'' \uBB38\uC11C\uC758 \uB8E8\uD2B8 \uC694\uC18C\uC5D0 \uB124\uC784\uC2A4\uD398\uC774\uC2A4 \uC774\uB984 ''http://www.w3.org/2001/XMLSchema''\uC640 \uB85C\uCEEC \uC774\uB984 ''schema''\uAC00 \uC788\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- src-import.3.1 = src-import.3.1: <import> \uC694\uC18C \uC815\uBCF4 \uD56D\uBAA9\uC758 \uB124\uC784\uC2A4\uD398\uC774\uC2A4 \uC18D\uC131 ''{0}''\uC774(\uAC00) \uC784\uD3EC\uD2B8\uB41C \uBB38\uC11C\uC758 targetNamespace \uC18D\uC131 ''{1}''\uACFC(\uC640) \uB3D9\uC77C\uD574\uC57C \uD569\uB2C8\uB2E4.
- src-import.3.2 = src-import.3.2: \uB124\uC784\uC2A4\uD398\uC774\uC2A4 \uC18D\uC131\uC774 \uC5C6\uB294 <import> \uC694\uC18C \uC815\uBCF4 \uD56D\uBAA9\uC774 \uBC1C\uACAC\uB418\uC5C8\uC73C\uBBC0\uB85C \uC784\uD3EC\uD2B8\uB41C \uBB38\uC11C\uC5D0\uB294 targetNamespace \uC18D\uC131\uC774 \uD3EC\uD568\uB420 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uD558\uC9C0\uB9CC \uC784\uD3EC\uD2B8\uB41C \uBB38\uC11C\uC5D0\uC11C targetNamespace ''{1}''\uC774(\uAC00) \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
- src-include.1 = src-include.1: ''{0}'' \uBB38\uC11C\uC758 \uB8E8\uD2B8 \uC694\uC18C\uC5D0 \uB124\uC784\uC2A4\uD398\uC774\uC2A4 \uC774\uB984 ''http://www.w3.org/2001/XMLSchema''\uC640 \uB85C\uCEEC \uC774\uB984 ''schema''\uAC00 \uC788\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- src-include.2.1 = src-include.2.1: \uCC38\uC870\uB41C \uC2A4\uD0A4\uB9C8(\uD604\uC7AC''{1}'')\uC640 \uD3EC\uD568\uD558\uB294 \uC2A4\uD0A4\uB9C8(\uD604\uC7AC ''{0}'')\uC758 targetNamespace\uB294 \uB3D9\uC77C\uD574\uC57C \uD569\uB2C8\uB2E4.
- src-redefine.2 = src-redefine.2: ''{0}'' \uBB38\uC11C\uC758 \uB8E8\uD2B8 \uC694\uC18C\uC5D0 \uB124\uC784\uC2A4\uD398\uC774\uC2A4 \uC774\uB984 ''http://www.w3.org/2001/XMLSchema''\uC640 \uB85C\uCEEC \uC774\uB984 ''schema''\uAC00 \uC788\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- src-redefine.3.1 = src-redefine.3.1: \uCC38\uC870\uB41C \uC2A4\uD0A4\uB9C8(\uD604\uC7AC''{1}'')\uC640 \uC7AC\uC815\uC758\uD558\uB294 \uC2A4\uD0A4\uB9C8(\uD604\uC7AC ''{0}'')\uC758 targetNamespace\uB294 \uB3D9\uC77C\uD574\uC57C \uD569\uB2C8\uB2E4.
- src-redefine.5.a.a = src-redefine.5.a.a: <simpleType>\uC758 \uBE44\uC8FC\uC11D \uD558\uC704 \uD56D\uBAA9\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. <redefine> \uC694\uC18C\uC758 <simpleType> \uD558\uC704 \uD56D\uBAA9\uC5D0\uB294 \uC790\uC2E0\uC744 \uCC38\uC870\uD558\uB294 'base' \uC18D\uC131\uC744 \uAC00\uC9C4 <restriction> \uC885\uC18D \uD56D\uBAA9\uC774 \uC788\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- src-redefine.5.a.b = src-redefine.5.a.b: ''{0}''\uC740(\uB294) \uC801\uD569\uD55C \uD558\uC704 \uC694\uC18C\uAC00 \uC544\uB2D9\uB2C8\uB2E4. <redefine> \uC694\uC18C\uC758 <simpleType> \uD558\uC704 \uD56D\uBAA9\uC5D0\uB294 \uC790\uC2E0\uC744 \uCC38\uC870\uD558\uB294 ''base'' \uC18D\uC131\uC744 \uAC00\uC9C4 <restriction> \uC885\uC18D \uD56D\uBAA9\uC774 \uC788\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- src-redefine.5.a.c = src-redefine.5.a.c: ''{0}''\uC5D0 \uC7AC\uC815\uC758\uB41C \uC694\uC18C ''{1}''\uC744(\uB97C) \uCC38\uC870\uD558\uB294 ''base'' \uC18D\uC131\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. <redefine> \uC694\uC18C\uC758 <simpleType> \uD558\uC704 \uD56D\uBAA9\uC5D0\uB294 \uC790\uC2E0\uC744 \uCC38\uC870\uD558\uB294 ''base'' \uC18D\uC131\uC744 \uAC00\uC9C4 <restriction> \uC885\uC18D \uD56D\uBAA9\uC774 \uC788\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- src-redefine.5.b.a = src-redefine.5.b.a: <complexType>\uC758 \uBE44\uC8FC\uC11D \uD558\uC704 \uD56D\uBAA9\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. <redefine> \uC694\uC18C\uC758 <complexType> \uD558\uC704 \uD56D\uBAA9\uC5D0\uB294 \uC790\uC2E0\uC744 \uCC38\uC870\uD558\uB294 'base' \uC18D\uC131\uC744 \uAC00\uC9C4 <extension> \uB610\uB294 <restriction> \uC885\uC18D \uD56D\uBAA9\uC774 \uC788\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- src-redefine.5.b.b = src-redefine.5.b.b: <complexType>\uC758 \uBE44\uC8FC\uC11D \uCD5C\uD558\uC704 \uD56D\uBAA9\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. <redefine> \uC694\uC18C\uC758 <complexType> \uD558\uC704 \uD56D\uBAA9\uC5D0\uB294 \uC790\uC2E0\uC744 \uCC38\uC870\uD558\uB294 'base' \uC18D\uC131\uC744 \uAC00\uC9C4 <extension> \uB610\uB294 <restriction> \uC885\uC18D \uD56D\uBAA9\uC774 \uC788\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- src-redefine.5.b.c = src-redefine.5.b.c: ''{0}''\uC740(\uB294) \uC801\uD569\uD55C \uCD5C\uD558\uC704 \uC694\uC18C\uAC00 \uC544\uB2D9\uB2C8\uB2E4. <redefine> \uC694\uC18C\uC758 <complexType> \uD558\uC704 \uD56D\uBAA9\uC5D0\uB294 \uC790\uC2E0\uC744 \uCC38\uC870\uD558\uB294 ''base'' \uC18D\uC131\uC744 \uAC00\uC9C4 <extension> \uB610\uB294 <restriction> \uC885\uC18D \uD56D\uBAA9\uC774 \uC788\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- src-redefine.5.b.d = src-redefine.5.b.d: ''{0}''\uC5D0 \uC7AC\uC815\uC758\uB41C \uC694\uC18C ''{1}''\uC744(\uB97C) \uCC38\uC870\uD558\uB294 ''base'' \uC18D\uC131\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. <redefine> \uC694\uC18C\uC758 <complexType> \uD558\uC704 \uD56D\uBAA9\uC5D0\uB294 \uC790\uC2E0\uC744 \uCC38\uC870\uD558\uB294 ''base'' \uC18D\uC131\uC744 \uAC00\uC9C4 <extension> \uB610\uB294 <restriction> \uC885\uC18D \uD56D\uBAA9\uC774 \uC788\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- src-redefine.6.1.1 = src-redefine.6.1.1: <redefine> \uC694\uC18C\uC758 \uADF8\uB8F9 \uD558\uC704\uC5D0 \uC790\uC2E0\uC744 \uCC38\uC870\uD558\uB294 \uADF8\uB8F9\uC774 \uD3EC\uD568\uB418\uC5B4 \uC788\uC744 \uACBD\uC6B0 \uC815\uD655\uD788 1\uC774\uC5B4\uC57C \uC0AC\uC6A9\uB418\uC5B4\uC57C \uD558\uC9C0\uB9CC ''{0}''\uC774(\uAC00) \uC0AC\uC6A9\uB429\uB2C8\uB2E4.
- src-redefine.6.1.2 = src-redefine.6.1.2: \uC7AC\uC815\uC758\uD558\uB824\uB294 \uADF8\uB8F9\uC5D0 \uB300\uD55C \uCC38\uC870\uB97C \uD3EC\uD568\uD558\uB294 ''{0}'' \uADF8\uB8F9\uC5D0\uB294 ''minOccurs'' = ''maxOccurs'' = 1\uC774 \uC0AC\uC6A9\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- src-redefine.6.2.1 = src-redefine.6.2.1: \uC7AC\uC815\uC758\uB41C \uC2A4\uD0A4\uB9C8\uC5D0 \uC774\uB984\uC774 ''{0}''\uC778 \uADF8\uB8F9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.
- src-redefine.6.2.2 = src-redefine.6.2.2: ''{0}'' \uADF8\uB8F9\uC740 \uC7AC\uC815\uC758\uD558\uB294 \uADF8\uB8F9\uC744 \uC81C\uB300\uB85C \uC81C\uD55C\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. \uC704\uBC18\uB41C \uC81C\uC57D \uC870\uAC74: ''{1}''.
- src-redefine.7.1 = src-redefine.7.1: <redefine> \uC694\uC18C\uC758 attributeGroup \uD558\uC704\uC5D0 \uC790\uC2E0\uC744 \uCC38\uC870\uD558\uB294 attributeGroup\uC774 \uD3EC\uD568\uB418\uC5B4 \uC788\uC744 \uACBD\uC6B0 \uC815\uD655\uD788 1\uC774 \uC0AC\uC6A9\uB418\uC5B4\uC57C \uD558\uC9C0\uB9CC {0}\uC774(\uAC00) \uC0AC\uC6A9\uB429\uB2C8\uB2E4.
- src-redefine.7.2.1 = src-redefine.7.2.1: \uC7AC\uC815\uC758\uB41C \uC2A4\uD0A4\uB9C8\uC5D0 \uC774\uB984\uC774 ''{0}''\uC778 attributeGroup\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.
- src-redefine.7.2.2 = src-redefine.7.2.2: AttributeGroup ''{0}''\uC740(\uB294) \uC7AC\uC815\uC758\uD558\uB294 attributeGroup\uC744 \uC81C\uB300\uB85C \uC81C\uD55C\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. \uC704\uBC18\uB41C \uC81C\uC57D \uC870\uAC74: ''{1}''.
- src-resolve = src-resolve: ''{0}'' \uC774\uB984\uC744 ''{1}'' \uAD6C\uC131 \uC694\uC18C\uB85C \uBD84\uC11D\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
- src-resolve.4.1 = src-resolve.4.1: ''{2}'' \uAD6C\uC131 \uC694\uC18C\uB97C \uBD84\uC11D\uD558\uB294 \uC911 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. ''{2}''\uC5D0 \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uAC00 \uC5C6\uB294 \uAC83\uC73C\uB85C \uD655\uC778\uB418\uC5C8\uC9C0\uB9CC \uC2A4\uD0A4\uB9C8 \uBB38\uC11C ''{0}''\uC5D0\uC11C \uB300\uC0C1 \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uAC00 \uC5C6\uB294 \uAD6C\uC131 \uC694\uC18C\uB97C \uCC38\uC870\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. ''{2}''\uC5D0 \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uAC00 \uC788\uC5B4\uC57C \uD560 \uACBD\uC6B0 \uC811\uB450\uC5B4\uB97C \uC81C\uACF5\uD574\uC57C \uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4. ''{2}''\uC5D0 \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uAC00 \uC5C6\uC5B4\uC57C \uD560 \uACBD\uC6B0 "namespace" \uC18D\uC131 \uC5C6\uC774 ''import''\uB97C ''{0}''\uC5D0 \uCD94\uAC00\uD574\uC57C \uD569\uB2C8\uB2E4.
- src-resolve.4.2 = src-resolve.4.2: ''{2}'' \uAD6C\uC131 \uC694\uC18C\uB97C \uBD84\uC11D\uD558\uB294 \uC911 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. ''{2}''\uC774(\uAC00) ''{1}'' \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uC5D0 \uC788\uB294 \uAC83\uC73C\uB85C \uD655\uC778\uB418\uC5C8\uC9C0\uB9CC \uC2A4\uD0A4\uB9C8 \uBB38\uC11C ''{0}''\uC5D0\uC11C \uC774 \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uC758 \uAD6C\uC131 \uC694\uC18C\uB97C \uCC38\uC870\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uC62C\uBC14\uB974\uC9C0 \uC54A\uC740 \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uC77C \uACBD\uC6B0 \uC811\uB450\uC5B4\uC778 ''{2}''\uC744(\uB97C) \uBCC0\uACBD\uD574\uC57C \uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4. \uC62C\uBC14\uB978 \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uC77C \uACBD\uC6B0 \uC801\uD569\uD55C ''import'' \uD0DC\uADF8\uB97C ''{0}''\uC5D0 \uCD94\uAC00\uD574\uC57C \uD569\uB2C8\uB2E4.
- src-simple-type.2.a = src-simple-type.2.a: \uD574\uB2F9 [children] \uC911 base [attribute]\uC640 <simpleType> \uC694\uC18C\uAC00 \uBAA8\uB450 \uC788\uB294 <restriction> \uC694\uC18C\uAC00 \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uD558\uB098\uB9CC \uD5C8\uC6A9\uB429\uB2C8\uB2E4.
- src-simple-type.2.b = src-simple-type.2.b: \uD574\uB2F9 [children] \uC911 base [attribute]\uC640 <simpleType> \uC694\uC18C\uAC00 \uBAA8\uB450 \uC5C6\uB294 <restriction> \uC694\uC18C\uAC00 \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uD558\uB098\uB9CC \uD544\uC694\uD569\uB2C8\uB2E4.
- src-simple-type.3.a = src-simple-type.3.a: \uD574\uB2F9 [children] \uC911 itemType [attribute]\uC640 <simpleType> \uC694\uC18C\uAC00 \uBAA8\uB450 \uC788\uB294 <list> \uC694\uC18C\uAC00 \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uD558\uB098\uB9CC \uD5C8\uC6A9\uB429\uB2C8\uB2E4.
- src-simple-type.3.b = src-simple-type.3.b: \uD574\uB2F9 [children] \uC911 itemType [attribute]\uC640 <simpleType> \uC694\uC18C\uAC00 \uBAA8\uB450 \uC5C6\uB294 <list> \uC694\uC18C\uAC00 \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uD558\uB098\uB9CC \uD544\uC694\uD569\uB2C8\uB2E4.
- src-single-facet-value = src-single-facet-value: ''{0}'' \uBA74\uC774 \uB450 \uBC88 \uC774\uC0C1 \uC815\uC758\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
- src-union-memberTypes-or-simpleTypes = src-union-memberTypes-or-simpleTypes: <union> \uC694\uC18C\uC5D0\uB294 \uD574\uB2F9 [children] \uC911 \uBE44\uC5B4 \uC788\uC9C0 \uC54A\uC740 memberTypes [attribute] \uB610\uB294 \uD558\uB098 \uC774\uC0C1\uC758 <simpleType> \uC694\uC18C\uAC00 \uC788\uC5B4\uC57C \uD569\uB2C8\uB2E4.
-
-#constraint valid (3.X.6)
-
- ag-props-correct.2 = ag-props-correct.2: \uC18D\uC131 \uADF8\uB8F9 ''{0}''\uC5D0 \uB300\uD574 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. \uC774\uB984 \uBC0F \uB300\uC0C1 \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uAC00 \uB3D9\uC77C\uD55C \uC911\uBCF5 \uC18D\uC131 \uC0AC\uC6A9\uC774 \uC9C0\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uC911\uBCF5 \uC18D\uC131 \uC0AC\uC6A9\uC758 \uC774\uB984\uC740 ''{1}''\uC785\uB2C8\uB2E4.
- ag-props-correct.3 = ag-props-correct.3: \uC18D\uC131 \uADF8\uB8F9 ''{0}''\uC5D0 \uB300\uD574 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. \uB450 \uAC1C\uC758 \uC18D\uC131 \uC120\uC5B8 ''{1}'' \uBC0F ''{2}''\uC5D0 ID\uC5D0\uC11C \uD30C\uC0DD\uB41C \uC720\uD615\uC774 \uC788\uC2B5\uB2C8\uB2E4.
- a-props-correct.2 = a-props-correct.2: ''{0}'' \uC18D\uC131\uC758 \uAC12 \uC81C\uC57D \uC870\uAC74 \uAC12 ''{1}''\uC774(\uAC00) \uBD80\uC801\uD569\uD569\uB2C8\uB2E4.
- a-props-correct.3 = a-props-correct.3: \uC18D\uC131\uC758 '{'type definition'}'\uC774 ID\uC774\uAC70\uB098 ID\uC5D0\uC11C \uD30C\uC0DD\uB41C \uAC83\uC774\uBBC0\uB85C ''{0}'' \uC18D\uC131\uC740 ''fixed'' \uB610\uB294 ''default''\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
- au-props-correct.2 = au-props-correct.2: ''{0}''\uC758 \uC18D\uC131 \uC120\uC5B8\uC5D0\uC11C \uACE0\uC815\uB41C \uAC12 ''{1}''\uC774(\uAC00) \uC9C0\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uB530\uB77C\uC11C ''{0}''\uC744(\uB97C) \uCC38\uC870\uD558\uB294 \uC18D\uC131 \uC0AC\uC6A9\uC5D0\uB3C4 '{'value constraint'}'\uAC00 \uC788\uC744 \uACBD\uC6B0 \uACE0\uC815\uB418\uC5B4\uC57C \uD558\uBA70 \uAC12\uC740 ''{1}''\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- cos-all-limited.1.2 = cos-all-limited.1.2: 'all' \uBAA8\uB378 \uADF8\uB8F9\uC774 '{'min occurs'}' = '{'max occurs'}' = 1\uC778 \uC870\uAC01\uC5D0 \uB098\uD0C0\uB098\uC57C \uD558\uBA70 \uD574\uB2F9 \uC870\uAC01\uC740 \uBCF5\uD569 \uC720\uD615 \uC815\uC758\uC758 '{'content type'}'\uC744 \uAD6C\uC131\uD558\uB294 \uC30D\uC758 \uC77C\uBD80\uC5EC\uC57C \uD569\uB2C8\uB2E4.
- cos-all-limited.2 = cos-all-limited.2: ''all'' \uBAA8\uB378 \uADF8\uB8F9\uC5D0 \uD3EC\uD568\uB41C \uC694\uC18C\uC758 '{'max occurs'}'\uB294 0 \uB610\uB294 1\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4. ''{1}'' \uC694\uC18C\uC5D0 \uB300\uD55C ''{0}'' \uAC12\uC774 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4.
- cos-applicable-facets = cos-applicable-facets: {1} \uC720\uD615\uC5D0\uC11C\uB294 ''{0}'' \uBA74\uC774 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
- cos-ct-extends.1.1 = cos-ct-extends.1.1: ''{0}'' \uC720\uD615\uC740 ''{1}'' \uC720\uD615\uC5D0\uC11C \uD655\uC7A5\uC5D0 \uC758\uD574 \uD30C\uC0DD\uB418\uC5C8\uC9C0\uB9CC ''{1}''\uC758 ''final'' \uC18D\uC131\uC740 \uD655\uC7A5\uC5D0 \uC758\uD55C \uD30C\uC0DD\uC744 \uAE08\uC9C0\uD569\uB2C8\uB2E4.
- cos-ct-extends.1.4.3.2.2.1.a = cos-ct-extends.1.4.3.2.2.1.a: \uD30C\uC0DD\uB41C \uC720\uD615\uACFC \uD574\uB2F9 \uAE30\uBCF8 \uC720\uD615\uC758 \uCF58\uD150\uCE20 \uC720\uD615\uC740 \uBAA8\uB450 \uD63C\uD569\uB418\uAC70\uB098 \uBAA8\uB450 \uC694\uC18C \uC804\uC6A9\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4. ''{0}'' \uC720\uD615\uC740 \uC694\uC18C \uC804\uC6A9\uC774\uC9C0\uB9CC \uD574\uB2F9 \uAE30\uBCF8 \uC720\uD615\uC740 \uC694\uC18C \uC804\uC6A9\uC774 \uC544\uB2D9\uB2C8\uB2E4.
- cos-ct-extends.1.4.3.2.2.1.b = cos-ct-extends.1.4.3.2.2.1.b: \uD30C\uC0DD\uB41C \uC720\uD615\uACFC \uD574\uB2F9 \uAE30\uBCF8 \uC720\uD615\uC758 \uCF58\uD150\uCE20 \uC720\uD615\uC740 \uBAA8\uB450 \uD63C\uD569\uB418\uAC70\uB098 \uBAA8\uB450 \uC694\uC18C \uC804\uC6A9\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4. ''{0}'' \uC720\uD615\uC740 \uD63C\uD569\uB418\uC5B4 \uC788\uC9C0\uB9CC \uD574\uB2F9 \uAE30\uBCF8 \uC720\uD615\uC740 \uD63C\uD569\uB418\uC5B4 \uC788\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
- cos-element-consistent = cos-element-consistent: ''{0}'' \uC720\uD615\uC5D0 \uB300\uD574 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. \uC774\uB984\uC774 ''{1}''\uC774\uBA70 \uC720\uD615\uC774 \uB2E4\uB978 \uC5EC\uB7EC \uC694\uC18C\uAC00 \uBAA8\uB378 \uADF8\uB8F9\uC5D0 \uB098\uD0C0\uB0A9\uB2C8\uB2E4.
- cos-list-of-atomic = cos-list-of-atomic: \uBAA9\uB85D \uC720\uD615 ''{0}''\uC758 \uC815\uC758\uC5D0\uC11C ''{1}'' \uC720\uD615\uC740 \uAE30\uBCF8 \uB2E8\uC704\uAC00 \uC544\uB2C8\uBBC0\uB85C \uBD80\uC801\uD569\uD55C \uBAA9\uB85D \uC694\uC18C \uC720\uD615\uC785\uB2C8\uB2E4. ''{1}''\uC774(\uAC00) \uBAA9\uB85D \uC720\uD615\uC774\uAC70\uB098 \uBAA9\uB85D\uC744 \uD3EC\uD568\uD558\uB294 \uD569\uC9D1\uD569 \uC720\uD615\uC785\uB2C8\uB2E4.
- cos-nonambig = cos-nonambig: {0} \uBC0F {1}(\uB610\uB294 \uD574\uB2F9 \uB300\uCCB4 \uADF8\uB8F9\uC758 \uC694\uC18C)\uC774(\uAC00) "Unique Particle Attribution"\uC744 \uC704\uBC18\uD569\uB2C8\uB2E4. \uC774 \uC2A4\uD0A4\uB9C8\uC5D0 \uB300\uD55C \uAC80\uC99D \uC911 \uC774\uB7EC\uD55C \uB450 \uC870\uAC01\uC774 \uBAA8\uD638\uD574\uC9C8 \uC218 \uC788\uC2B5\uB2C8\uB2E4.
- cos-particle-restrict.a = cos-particle-restrict.a: \uD30C\uC0DD\uB41C \uC870\uAC01\uC774 \uBE44\uC5B4 \uC788\uC73C\uBBC0\uB85C \uAE30\uBCF8 \uC870\uAC01\uC744 \uBE44\uC6B8 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
- cos-particle-restrict.b = cos-particle-restrict.b: \uAE30\uBCF8 \uC870\uAC01\uC740 \uBE44\uC5B4 \uC788\uC9C0\uB9CC \uD30C\uC0DD\uB41C \uC870\uAC01\uC740 \uBE44\uC5B4 \uC788\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
- cos-particle-restrict.2 = cos-particle-restrict.2: \uAE08\uC9C0\uB41C \uC870\uAC01 \uC81C\uD55C \uC0AC\uD56D: ''{0}''.
- cos-st-restricts.1.1 = cos-st-restricts.1.1: ''{1}'' \uC720\uD615\uC774 \uAE30\uBCF8 \uB2E8\uC704\uC774\uBBC0\uB85C \uD574\uB2F9 '{'base type definition'}' ''{0}''\uC740(\uB294) \uAE30\uBCF8 \uB2E8\uC21C \uC720\uD615 \uC815\uC758 \uB610\uB294 \uB0B4\uC7A5\uB41C \uAE30\uBCF8 \uB370\uC774\uD130 \uC720\uD615\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- cos-st-restricts.2.1 = cos-st-restricts.2.1: \uBAA9\uB85D \uC720\uD615 ''{0}''\uC758 \uC815\uC758\uC5D0\uC11C ''{1}'' \uC720\uD615\uC740 \uBAA9\uB85D \uC720\uD615\uC774\uAC70\uB098 \uBAA9\uB85D\uC744 \uD3EC\uD568\uD558\uB294 \uD569\uC9D1\uD569 \uC720\uD615\uC774\uBBC0\uB85C \uBD80\uC801\uD569\uD55C \uD56D\uBAA9 \uC720\uD615\uC785\uB2C8\uB2E4.
- cos-st-restricts.2.3.1.1 = cos-st-restricts.2.3.1.1: '{'item type definition'}' ''{0}''\uC758 '{'final'}' \uAD6C\uC131 \uC694\uC18C\uC5D0 ''list''\uAC00 \uD3EC\uD568\uB418\uC5B4 \uC788\uC2B5\uB2C8\uB2E4. \uB530\uB77C\uC11C ''{0}''\uC744(\uB97C) \uBAA9\uB85D \uC720\uD615 ''{1}''\uC5D0 \uB300\uD55C \uD56D\uBAA9 \uC720\uD615\uC73C\uB85C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
- cos-st-restricts.3.3.1.1 = cos-st-restricts.3.3.1.1: '{'member type definitions'}' ''{0}''\uC758 '{'final'}' \uAD6C\uC131 \uC694\uC18C\uC5D0 ''union''\uC774 \uD3EC\uD568\uB418\uC5B4 \uC788\uC2B5\uB2C8\uB2E4. \uB530\uB77C\uC11C ''{0}''\uC744(\uB97C) \uD569\uC9D1\uD569 \uC720\uD615 ''{1}''\uC5D0 \uB300\uD55C \uBA64\uBC84 \uC720\uD615\uC73C\uB85C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
- cos-valid-default.2.1 = cos-valid-default.2.1: ''{0}'' \uC694\uC18C\uC5D0 \uAC12 \uC81C\uC57D \uC870\uAC74\uC774 \uC788\uC73C\uBBC0\uB85C \uD63C\uD569 \uB610\uB294 \uB2E8\uC21C \uCF58\uD150\uCE20 \uBAA8\uB378\uC774 \uD3EC\uD568\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- cos-valid-default.2.2.2 = cos-valid-default.2.2.2: ''{0}'' \uC694\uC18C\uC5D0 '{'value constraint'}'\uAC00 \uC788\uC73C\uBA70 \uD574\uB2F9 \uC720\uD615 \uC815\uC758\uC5D0 \uD63C\uD569 '{'content type'}'\uC774 \uC788\uC73C\uBBC0\uB85C '{'content type'}'\uC758 \uC870\uAC01\uC744 \uBE44\uC6B8 \uC218 \uC788\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- c-props-correct.2 = c-props-correct.2: keyref ''{0}''\uACFC(\uC640) \uD0A4 ''{1}''\uC5D0 \uB300\uD55C \uD544\uB4DC \uAE30\uC218\uB294 \uC11C\uB85C \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4.
- ct-props-correct.3 = ct-props-correct.3: \uBCF5\uD569 \uC720\uD615 ''{0}''\uC5D0 \uB300\uD55C \uC21C\uD658 \uC815\uC758\uAC00 \uAC10\uC9C0\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uB530\uB77C\uC11C ''{0}''\uC740(\uB294) \uACE0\uC720\uD55C \uC720\uD615 \uACC4\uCE35\uC5D0 \uD3EC\uD568\uB41C \uAC83\uC774\uBA70 \uC774\uB294 \uC624\uB958\uC785\uB2C8\uB2E4.
- ct-props-correct.4 = ct-props-correct.4: ''{0}'' \uC720\uD615\uC5D0 \uB300\uD574 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. \uC774\uB984 \uBC0F \uB300\uC0C1 \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uAC00 \uB3D9\uC77C\uD55C \uC911\uBCF5 \uC18D\uC131 \uC0AC\uC6A9\uC774 \uC9C0\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uC911\uBCF5 \uC18D\uC131 \uC0AC\uC6A9\uC758 \uC774\uB984\uC740 ''{1}''\uC785\uB2C8\uB2E4.
- ct-props-correct.5 = ct-props-correct.5: ''{0}'' \uC720\uD615\uC5D0 \uB300\uD574 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. \uB450 \uAC1C\uC758 \uC18D\uC131 \uC120\uC5B8 ''{1}'' \uBC0F ''{2}''\uC5D0 ID\uC5D0\uC11C \uD30C\uC0DD\uB41C \uC720\uD615\uC774 \uC788\uC2B5\uB2C8\uB2E4.
- derivation-ok-restriction.1 = derivation-ok-restriction.1: ''{0}'' \uC720\uD615\uC740 ''{1}'' \uC720\uD615\uC5D0\uC11C \uC81C\uD55C \uC0AC\uD56D\uC5D0 \uC758\uD574 \uD30C\uC0DD\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uD558\uC9C0\uB9CC ''{1}''\uC5D0\uB294 \uC81C\uD55C \uC0AC\uD56D\uC5D0 \uC758\uD55C \uD30C\uC0DD\uC744 \uAE08\uC9C0\uD558\uB294 '{'final'}' \uC18D\uC131\uC774 \uC788\uC2B5\uB2C8\uB2E4.
- derivation-ok-restriction.2.1.1 = derivation-ok-restriction.2.1.1: ''{0}'' \uC720\uD615\uC5D0 \uB300\uD574 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. \uC774 \uC720\uD615\uC758 \uC18D\uC131 \uC0AC\uC6A9 ''{1}''\uC5D0 \uB300\uD55C ''use'' \uAC12\uC774 ''{2}''\uC785\uB2C8\uB2E4. \uC774\uB294 \uAE30\uBCF8 \uC720\uD615\uC758 \uC77C\uCE58\uD558\uB294 \uC18D\uC131 \uC0AC\uC6A9\uC5D0 \uB300\uD55C \uAC12\uC778 ''required''\uC640 \uB2E4\uB985\uB2C8\uB2E4.
- derivation-ok-restriction.2.1.2 = derivation-ok-restriction.2.1.2: ''{0}'' \uC720\uD615\uC5D0 \uB300\uD574 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. \uC774 \uC720\uD615\uC758 \uC18D\uC131 \uC0AC\uC6A9 ''{1}''\uC5D0 \uB300\uD55C \uC720\uD615\uC774 ''{2}''\uC785\uB2C8\uB2E4. \uC774\uB294 \uAE30\uBCF8 \uC720\uD615\uC758 \uC77C\uCE58\uD558\uB294 \uC18D\uC131 \uC0AC\uC6A9\uC5D0 \uB300\uD55C \uC720\uD615\uC778 ''{3}''\uC5D0\uC11C \uC801\uD569\uD558\uAC8C \uD30C\uC0DD\uB41C \uAC83\uC774 \uC544\uB2D9\uB2C8\uB2E4.
- derivation-ok-restriction.2.1.3.a = derivation-ok-restriction.2.1.3.a: ''{0}'' \uC720\uD615\uC5D0 \uB300\uD574 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. \uC774 \uC720\uD615\uC758 \uC18D\uC131 \uC0AC\uC6A9 ''{1}''\uC5D0\uB294 \uACE0\uC815\uB418\uC9C0 \uC54A\uC740 \uC720\uD6A8\uD55C \uAC12 \uC81C\uC57D \uC870\uAC74\uC774 \uC788\uC73C\uBA70, \uAE30\uBCF8 \uC720\uD615\uC758 \uC77C\uCE58\uD558\uB294 \uC18D\uC131 \uC0AC\uC6A9\uC5D0 \uB300\uD55C \uC720\uD6A8\uD55C \uAC12 \uC81C\uC57D \uC870\uAC74\uC740 \uACE0\uC815\uB418\uC5B4 \uC788\uC2B5\uB2C8\uB2E4.
- derivation-ok-restriction.2.1.3.b = derivation-ok-restriction.2.1.3.b: ''{0}'' \uC720\uD615\uC5D0 \uB300\uD574 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. \uC774 \uC720\uD615\uC758 \uC18D\uC131 \uC0AC\uC6A9 ''{1}''\uC5D0 ''{2}'' \uAC12\uC73C\uB85C \uACE0\uC815\uB41C \uC720\uD6A8\uD55C \uAC12 \uC81C\uC57D \uC870\uAC74\uC774 \uC788\uC2B5\uB2C8\uB2E4. \uC774\uB294 \uAE30\uBCF8 \uC720\uD615\uC758 \uC77C\uCE58\uD558\uB294 \uC18D\uC131 \uC0AC\uC6A9\uC5D0 \uB300\uD55C \uACE0\uC815\uB41C \uC720\uD6A8\uD55C \uAC12 \uC81C\uC57D \uC870\uAC74\uC758 \uAC12\uC778 ''{3}''\uACFC(\uC640) \uB2E4\uB985\uB2C8\uB2E4.
- derivation-ok-restriction.2.2.a = derivation-ok-restriction.2.2.a: ''{0}'' \uC720\uD615\uC5D0 \uB300\uD574 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. \uC774 \uC720\uD615\uC758 \uC18D\uC131 \uC0AC\uC6A9 ''{1}''\uACFC(\uC640) \uAE30\uBCF8 \uC720\uD615\uC758 \uC18D\uC131 \uC0AC\uC6A9\uC774 \uC77C\uCE58\uD558\uC9C0 \uC54A\uC73C\uBA70 \uAE30\uBCF8 \uC720\uD615\uC5D0 \uC640\uC77C\uB4DC \uCE74\uB4DC \uBB38\uC790 \uC18D\uC131\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.
- derivation-ok-restriction.2.2.b = derivation-ok-restriction.2.2.b: ''{0}'' \uC720\uD615\uC5D0 \uB300\uD574 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. \uC774 \uC720\uD615\uC758 \uC18D\uC131 \uC0AC\uC6A9 ''{1}''\uACFC(\uC640) \uAE30\uBCF8 \uC720\uD615\uC758 \uC18D\uC131 \uC0AC\uC6A9\uC774 \uC77C\uCE58\uD558\uC9C0 \uC54A\uC73C\uBA70 \uAE30\uBCF8 \uC720\uD615\uC758 \uC640\uC77C\uB4DC \uCE74\uB4DC \uBB38\uC790\uAC00 \uC774 \uC18D\uC131 \uC0AC\uC6A9\uC758 ''{2}'' \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uB97C \uD5C8\uC6A9\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
- derivation-ok-restriction.3 = derivation-ok-restriction.3: ''{0}'' \uC720\uD615\uC5D0 \uB300\uD574 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. \uAE30\uBCF8 \uC720\uD615\uC758 \uC18D\uC131 \uC0AC\uC6A9 ''{1}''\uC5D0 \uB300\uD55C REQUIRED\uAC00 true\uC774\uC9C0\uB9CC \uD30C\uC0DD \uC720\uD615\uC5D0 \uC77C\uCE58\uD558\uB294 \uC18D\uC131 \uC0AC\uC6A9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.
- derivation-ok-restriction.4.1 = derivation-ok-restriction.4.1: ''{0}'' \uC720\uD615\uC5D0 \uB300\uD574 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. \uD30C\uC0DD \uC720\uD615\uC5D0\uB294 \uC18D\uC131 \uC640\uC77C\uB4DC \uCE74\uB4DC \uBB38\uC790\uAC00 \uC788\uC9C0\uB9CC \uAE30\uBCF8 \uC720\uD615\uC5D0\uB294 \uC5C6\uC2B5\uB2C8\uB2E4.
- derivation-ok-restriction.4.2 = derivation-ok-restriction.4.2: ''{0}'' \uC720\uD615\uC5D0 \uB300\uD574 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. \uD30C\uC0DD \uC720\uD615\uC758 \uC640\uC77C\uB4DC \uCE74\uB4DC \uBB38\uC790\uAC00 \uAE30\uBCF8 \uC720\uD615\uC758 \uC640\uC77C\uB4DC \uCE74\uB4DC \uBB38\uC790\uC5D0 \uB300\uD574 \uC801\uD569\uD55C \uC640\uC77C\uB4DC \uCE74\uB4DC \uBB38\uC790 \uBD80\uBD84 \uC9D1\uD569\uC774 \uC544\uB2D9\uB2C8\uB2E4.
- derivation-ok-restriction.4.3 = derivation-ok-restriction.4.3: ''{0}'' \uC720\uD615\uC5D0 \uB300\uD574 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. \uD30C\uC0DD \uC720\uD615({1})\uC758 \uC640\uC77C\uB4DC \uCE74\uB4DC \uBB38\uC790\uC5D0 \uB300\uD55C \uD504\uB85C\uC138\uC2A4 \uCF58\uD150\uCE20\uAC00 \uAE30\uBCF8 \uC720\uD615({2})\uC758 \uC640\uC77C\uB4DC \uCE74\uB4DC \uBB38\uC790\uBCF4\uB2E4 \uD558\uC704\uC785\uB2C8\uB2E4.
- derivation-ok-restriction.5.2.2.1 = derivation-ok-restriction.5.2.2.1: ''{0}'' \uC720\uD615\uC5D0 \uB300\uD574 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. \uC774 \uC720\uD615 ''{1}''\uC758 \uB2E8\uC21C \uCF58\uD150\uCE20 \uC720\uD615\uC774 \uAE30\uBCF8 \uC720\uD615 ''{2}''\uC758 \uB2E8\uC21C \uCF58\uD150\uCE20 \uC720\uD615\uC5D0 \uB300\uD574 \uC801\uD569\uD55C \uC81C\uD55C \uC0AC\uD56D\uC774 \uC544\uB2D9\uB2C8\uB2E4.
- derivation-ok-restriction.5.3.2 = derivation-ok-restriction.5.3.2: ''{0}'' \uC720\uD615\uC5D0 \uB300\uD574 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. \uC774 \uC720\uD615\uC758 \uCF58\uD150\uCE20 \uC720\uD615\uC774 \uBE44\uC5B4 \uC788\uC9C0\uB9CC \uAE30\uBCF8 \uC720\uD615 ''{1}''\uC758 \uCF58\uD150\uCE20 \uC720\uD615\uC740 \uBE44\uC5B4 \uC788\uC9C0 \uC54A\uAC70\uB098 \uBE44\uC6B8 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
- derivation-ok-restriction.5.4.1.2 = derivation-ok-restriction.5.4.1.2: ''{0}'' \uC720\uD615\uC5D0 \uB300\uD574 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. \uC774 \uC720\uD615\uC758 \uCF58\uD150\uCE20 \uC720\uD615\uC740 \uD63C\uD569\uB418\uC5B4 \uC788\uC9C0\uB9CC \uAE30\uBCF8 \uC720\uD615 ''{1}''\uC758 \uCF58\uD150\uCE20 \uC720\uD615\uC740 \uD63C\uD569\uB418\uC5B4 \uC788\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
- derivation-ok-restriction.5.4.2 = derivation-ok-restriction.5.4.2: ''{0}'' \uC720\uD615\uC5D0 \uB300\uD574 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. \uC720\uD615 \uC870\uAC01\uC774 \uAE30\uBCF8 \uC720\uD615\uC758 \uC870\uAC01\uC5D0 \uB300\uD574 \uC801\uD569\uD55C \uC81C\uD55C \uC0AC\uD56D\uC774 \uC544\uB2D9\uB2C8\uB2E4.
- enumeration-required-notation = enumeration-required-notation: {2} ''{1}''\uC5D0 \uC0AC\uC6A9\uB418\uB294 NOTATION \uC720\uD615 ''{0}''\uC5D0\uB294 \uC774 \uC720\uD615\uC5D0 \uC0AC\uC6A9\uB418\uB294 \uD45C\uAE30\uBC95 \uC694\uC18C\uB97C \uC9C0\uC815\uD558\uB294 \uBAA9\uB85D \uBA74 \uAC12\uC774 \uC788\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- enumeration-valid-restriction = enumeration-valid-restriction: \uBAA9\uB85D \uAC12 ''{0}''\uC774(\uAC00) \uAE30\uBCF8 \uC720\uD615 {1}\uC758 \uAC12 \uACF5\uAC04\uC5D0 \uC5C6\uC2B5\uB2C8\uB2E4.
- e-props-correct.2 = e-props-correct.2: ''{0}'' \uC694\uC18C\uC758 \uAC12 \uC81C\uC57D \uC870\uAC74 \uAC12 ''{1}''\uC774(\uAC00) \uBD80\uC801\uD569\uD569\uB2C8\uB2E4.
- e-props-correct.4 = e-props-correct.4: ''{0}'' \uC694\uC18C\uC758 '{'type definition'}'\uC774 substitutionHead ''{1}''\uC758 '{'type definition'}'\uC5D0\uC11C \uC801\uD569\uD558\uAC8C \uD30C\uC0DD\uB41C \uAC83\uC774 \uC544\uB2C8\uAC70\uB098 ''{1}''\uC758 '{'substitution group exclusions'}' \uC18D\uC131\uC774 \uC774 \uD30C\uC0DD\uC744 \uD5C8\uC6A9\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
- e-props-correct.5 = e-props-correct.5: \uC694\uC18C\uC758 '{'type definition'}' \uB610\uB294 '{'type definition'}'\uC758 '{'content type'}'\uC774 ID\uC774\uAC70\uB098 ID\uC5D0\uC11C \uD30C\uC0DD\uB41C \uAC83\uC774\uBBC0\uB85C '{'value constraint'}'\uB294 ''{0}'' \uC694\uC18C\uC5D0 \uC5C6\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- e-props-correct.6 = e-props-correct.6: ''{0}'' \uC694\uC18C\uC5D0 \uB300\uD55C \uC21C\uD658 \uB300\uCCB4 \uADF8\uB8F9\uC774 \uAC10\uC9C0\uB418\uC5C8\uC2B5\uB2C8\uB2E4..
- fractionDigits-valid-restriction = fractionDigits-valid-restriction: {2}\uC758 \uC815\uC758\uC5D0\uC11C ''fractionDigits'' \uBA74\uC5D0 \uB300\uD55C ''{0}'' \uAC12\uC774 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. \uC774 \uAC12\uC740 \uC870\uC0C1 \uC720\uD615 \uC911 \uD558\uB098\uC5D0\uC11C ''{1}''(\uC73C)\uB85C \uC124\uC815\uB41C ''fractionDigits''\uC5D0 \uB300\uD55C \uAC12\uBCF4\uB2E4 \uC791\uAC70\uB098 \uAC19\uC544\uC57C \uD569\uB2C8\uB2E4.
- fractionDigits-totalDigits = fractionDigits-totalDigits: {2}\uC758 \uC815\uC758\uC5D0\uC11C ''fractionDigits'' \uBA74\uC5D0 \uB300\uD55C ''{0}'' \uAC12\uC774 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. \uC774 \uAC12\uC740 ''totalDigits''\uC5D0 \uB300\uD55C \uAC12\uC778 ''{1}''\uBCF4\uB2E4 \uC791\uAC70\uB098 \uAC19\uC544\uC57C \uD569\uB2C8\uB2E4.
- length-minLength-maxLength.1.1 = length-minLength-maxLength.1.1: {0} \uC720\uD615\uC758 \uACBD\uC6B0 length ''{1}''\uC758 \uAC12\uC740 minLength ''{2}''\uC758 \uAC12\uBCF4\uB2E4 \uC791\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
- length-minLength-maxLength.1.2.a = length-minLength-maxLength.1.2.a: {0} \uC720\uD615\uC758 \uACBD\uC6B0 \uD604\uC7AC \uC81C\uD55C \uC0AC\uD56D\uC5D0 minLength \uBA74\uC774 \uC788\uACE0 \uD604\uC7AC \uC81C\uD55C \uC0AC\uD56D \uB610\uB294 \uAE30\uBCF8 \uC720\uD615\uC5D0 length \uBA74\uC774 \uC788\uC744 \uACBD\uC6B0 \uAE30\uBCF8 \uC720\uD615\uC5D0 minLength \uBA74\uC774 \uC788\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- length-minLength-maxLength.1.2.b = length-minLength-maxLength.1.2.b: {0} \uC720\uD615\uC758 \uACBD\uC6B0 \uD604\uC7AC minLength ''{1}''\uC774(\uAC00) \uAE30\uBCF8 minLength ''{2}''\uACFC(\uC640) \uAC19\uC544\uC57C \uD569\uB2C8\uB2E4.
- length-minLength-maxLength.2.1 = length-minLength-maxLength.2.1: {0} \uC720\uD615\uC758 \uACBD\uC6B0 length ''{1}''\uC758 \uAC12\uC740 maxLength ''{2}''\uC758 \uAC12\uBCF4\uB2E4 \uD06C\uC9C0 \uC54A\uC544\uC57C \uD569\uB2C8\uB2E4.
- length-minLength-maxLength.2.2.a = length-minLength-maxLength.2.2.a: {0} \uC720\uD615\uC758 \uACBD\uC6B0 \uD604\uC7AC \uC81C\uD55C \uC0AC\uD56D\uC5D0 maxLength \uBA74\uC774 \uC788\uACE0 \uD604\uC7AC \uC81C\uD55C \uC0AC\uD56D \uB610\uB294 \uAE30\uBCF8 \uC720\uD615\uC5D0 length \uBA74\uC774 \uC788\uC744 \uACBD\uC6B0 \uAE30\uBCF8 \uC720\uD615\uC5D0 maxLength \uBA74\uC774 \uC788\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- length-minLength-maxLength.2.2.b = length-minLength-maxLength.2.2.b: {0} \uC720\uD615\uC758 \uACBD\uC6B0 \uD604\uC7AC maxLength ''{1}''\uC740(\uB294) \uAE30\uBCF8 maxLength ''{2}''\uACFC(\uC640) \uAC19\uC544\uC57C \uD569\uB2C8\uB2E4.
- length-valid-restriction = length-valid-restriction: ''{2}'' \uC720\uD615\uC5D0 \uB300\uD574 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. length = ''{0}''\uC778 \uAC12\uC740 \uAE30\uBCF8 \uC720\uD615 ''{1}''\uC758 \uD574\uB2F9 \uAC12\uACFC \uAC19\uC544\uC57C \uD569\uB2C8\uB2E4.
- maxExclusive-valid-restriction.1 = maxExclusive-valid-restriction.1: ''{2}'' \uC720\uD615\uC5D0 \uB300\uD574 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. maxExclusive \uAC12 = ''{0}''\uC740(\uB294) \uAE30\uBCF8 \uC720\uD615 ''{1}''\uC758 maxExclusive\uBCF4\uB2E4 \uC791\uAC70\uB098 \uAC19\uC544\uC57C \uD569\uB2C8\uB2E4.
- maxExclusive-valid-restriction.2 = maxExclusive-valid-restriction.2: ''{2}'' \uC720\uD615\uC5D0 \uB300\uD574 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. maxExclusive \uAC12 = ''{0}''\uC740(\uB294) \uAE30\uBCF8 \uC720\uD615 ''{1}''\uC758 maxInclusive\uBCF4\uB2E4 \uC791\uAC70\uB098 \uAC19\uC544\uC57C \uD569\uB2C8\uB2E4.
- maxExclusive-valid-restriction.3 = maxExclusive-valid-restriction.3: ''{2}'' \uC720\uD615\uC5D0 \uB300\uD574 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. maxExclusive \uAC12 = ''{0}''\uC740(\uB294) \uAE30\uBCF8 \uC720\uD615 ''{1}''\uC758 minInclusive\uBCF4\uB2E4 \uCEE4\uC57C \uD569\uB2C8\uB2E4.
- maxExclusive-valid-restriction.4 = maxExclusive-valid-restriction.4: ''{2}'' \uC720\uD615\uC5D0 \uB300\uD574 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. maxExclusive \uAC12 = ''{0}''\uC740(\uB294) \uAE30\uBCF8 \uC720\uD615 ''{1}''\uC758 minExclusive\uBCF4\uB2E4 \uCEE4\uC57C \uD569\uB2C8\uB2E4.
- maxInclusive-maxExclusive = maxInclusive-maxExclusive: maxInclusive\uC640 maxExclusive\uB294 \uB3D9\uC77C\uD55C \uB370\uC774\uD130 \uC720\uD615\uC5D0 \uB300\uD574 \uC9C0\uC815\uB418\uC9C0 \uC54A\uC544\uC57C \uD569\uB2C8\uB2E4. {2}\uC5D0 maxInclusive = ''{0}''\uACFC(\uC640) maxExclusive = ''{1}''\uC774(\uAC00) \uC9C0\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
- maxInclusive-valid-restriction.1 = maxInclusive-valid-restriction.1: ''{2}'' \uC720\uD615\uC5D0 \uB300\uD574 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. maxInclusive \uAC12 = ''{0}''\uC740(\uB294) \uAE30\uBCF8 \uC720\uD615 ''{1}''\uC758 maxInclusive\uBCF4\uB2E4 \uC791\uAC70\uB098 \uAC19\uC544\uC57C \uD569\uB2C8\uB2E4.
- maxInclusive-valid-restriction.2 = maxInclusive-valid-restriction.2: ''{2}'' \uC720\uD615\uC5D0 \uB300\uD574 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. maxInclusive \uAC12 = ''{0}''\uC740(\uB294) \uAE30\uBCF8 \uC720\uD615 ''{1}''\uC758 maxExclusive\uBCF4\uB2E4 \uC791\uC544\uC57C \uD569\uB2C8\uB2E4.
- maxInclusive-valid-restriction.3 = maxInclusive-valid-restriction.3: ''{2}'' \uC720\uD615\uC5D0 \uB300\uD574 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. maxInclusive \uAC12 = ''{0}''\uC740(\uB294) \uAE30\uBCF8 \uC720\uD615 ''{1}''\uC758 minInclusive\uBCF4\uB2E4 \uD06C\uAC70\uB098 \uAC19\uC544\uC57C \uD569\uB2C8\uB2E4.
- maxInclusive-valid-restriction.4 = maxInclusive-valid-restriction.4: ''{2}'' \uC720\uD615\uC5D0 \uB300\uD574 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. maxInclusive \uAC12 = ''{0}''\uC740(\uB294) \uAE30\uBCF8 \uC720\uD615 ''{1}''\uC758 minExclusive\uBCF4\uB2E4 \uCEE4\uC57C \uD569\uB2C8\uB2E4.
- maxLength-valid-restriction = maxLength-valid-restriction: {2}\uC758 \uC815\uC758\uC5D0\uC11C maxLength \uAC12 = ''{0}''\uC740(\uB294) \uAE30\uBCF8 \uC720\uD615 ''{1}''\uC758 \uAC12\uBCF4\uB2E4 \uC791\uAC70\uB098 \uAC19\uC544\uC57C \uD569\uB2C8\uB2E4.
- mg-props-correct.2 = mg-props-correct.2: ''{0}'' \uADF8\uB8F9\uC5D0 \uB300\uD55C \uC21C\uD658 \uC815\uC758\uAC00 \uAC10\uC9C0\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uC21C\uD658\uC801\uC73C\uB85C \uB4A4\uC5D0 \uC624\uB294 '{'term'}' \uC870\uAC01 \uAC12\uC774 '{'term'}'\uC774 \uADF8\uB8F9 \uC790\uC2E0\uC778 \uC870\uAC01\uC5D0 \uB3C4\uB2EC\uD569\uB2C8\uB2E4.
- minExclusive-less-than-equal-to-maxExclusive = minExclusive-less-than-equal-to-maxExclusive: {2}\uC758 \uC815\uC758\uC5D0\uC11C minExclusive \uAC12 = ''{0}''\uC740(\uB294) maxExclusive \uAC12 = ''{1}''\uBCF4\uB2E4 \uC791\uAC70\uB098 \uAC19\uC544\uC57C \uD569\uB2C8\uB2E4.
- minExclusive-less-than-maxInclusive = minExclusive-less-than-maxInclusive: {2}\uC758 \uC815\uC758\uC5D0\uC11C minExclusive \uAC12 = ''{0}''\uC740(\uB294) maxInclusive \uAC12 = ''{1}''\uBCF4\uB2E4 \uC791\uC544\uC57C \uD569\uB2C8\uB2E4.
- minExclusive-valid-restriction.1 = minExclusive-valid-restriction.1: ''{2}'' \uC720\uD615\uC5D0 \uB300\uD574 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. minExclusive \uAC12 = ''{0}''\uC740(\uB294) \uAE30\uBCF8 \uC720\uD615 ''{1}''\uC758 minExclusive\uBCF4\uB2E4 \uD06C\uAC70\uB098 \uAC19\uC544\uC57C \uD569\uB2C8\uB2E4.
- minExclusive-valid-restriction.2 = minExclusive-valid-restriction.2: ''{2}'' \uC720\uD615\uC5D0 \uB300\uD574 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. minExclusive \uAC12 = ''{0}''\uC740(\uB294) \uAE30\uBCF8 \uC720\uD615 ''{1}''\uC758 maxInclusive\uBCF4\uB2E4 \uC791\uAC70\uB098 \uAC19\uC544\uC57C \uD569\uB2C8\uB2E4.
- minExclusive-valid-restriction.3 = minExclusive-valid-restriction.3: ''{2}'' \uC720\uD615\uC5D0 \uB300\uD574 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. minExclusive \uAC12 = ''{0}''\uC740(\uB294) \uAE30\uBCF8 \uC720\uD615 ''{1}''\uC758 minInclusive\uBCF4\uB2E4 \uD06C\uAC70\uB098 \uAC19\uC544\uC57C \uD569\uB2C8\uB2E4.
- minExclusive-valid-restriction.4 = minExclusive-valid-restriction.4: ''{2}'' \uC720\uD615\uC5D0 \uB300\uD574 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. minExclusive \uAC12 = ''{0}''\uC740(\uB294) \uAE30\uBCF8 \uC720\uD615 ''{1}''\uC758 maxExclusive\uBCF4\uB2E4 \uC791\uC544\uC57C \uD569\uB2C8\uB2E4.
- minInclusive-less-than-equal-to-maxInclusive = minInclusive-less-than-equal-to-maxInclusive: {2}\uC758 \uC815\uC758\uC5D0\uC11C minInclusive \uAC12 = ''{0}''\uC740(\uB294) maxInclusive \uAC12 = ''{1}''\uBCF4\uB2E4 \uC791\uAC70\uB098 \uAC19\uC544\uC57C \uD569\uB2C8\uB2E4.
- minInclusive-less-than-maxExclusive = minInclusive-less-than-maxExclusive: {2}\uC758 \uC815\uC758\uC5D0\uC11C minInclusive \uAC12 = ''{0}''\uC740(\uB294) maxExclusive \uAC12 = ''{1}''\uBCF4\uB2E4 \uC791\uC544\uC57C \uD569\uB2C8\uB2E4.
- minInclusive-minExclusive = minInclusive-minExclusive: minInclusive\uC640 minExclusive\uB294 \uB3D9\uC77C\uD55C \uB370\uC774\uD130 \uC720\uD615\uC5D0 \uB300\uD574 \uC9C0\uC815\uB418\uC9C0 \uC54A\uC544\uC57C \uD569\uB2C8\uB2E4. {2}\uC5D0 minInclusive = ''{0}''\uACFC(\uC640) minExclusive = ''{1}''\uC774(\uAC00) \uC9C0\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
- minInclusive-valid-restriction.1 = minInclusive-valid-restriction.1: ''{2}'' \uC720\uD615\uC5D0 \uB300\uD574 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. minInclusive \uAC12 = ''{0}''\uC740(\uB294) \uAE30\uBCF8 \uC720\uD615 ''{1}''\uC758 minInclusive\uBCF4\uB2E4 \uD06C\uAC70\uB098 \uAC19\uC544\uC57C \uD569\uB2C8\uB2E4.
- minInclusive-valid-restriction.2 = minInclusive-valid-restriction.2: ''{2}'' \uC720\uD615\uC5D0 \uB300\uD574 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. minInclusive \uAC12 = ''{0}''\uC740(\uB294) \uAE30\uBCF8 \uC720\uD615 ''{1}''\uC758 maxInclusive\uBCF4\uB2E4 \uC791\uAC70\uB098 \uAC19\uC544\uC57C \uD569\uB2C8\uB2E4.
- minInclusive-valid-restriction.3 = minInclusive-valid-restriction.3: ''{2}'' \uC720\uD615\uC5D0 \uB300\uD574 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. minInclusive \uAC12 = ''{0}''\uC740(\uB294) \uAE30\uBCF8 \uC720\uD615 ''{1}''\uC758 minExclusive\uBCF4\uB2E4 \uCEE4\uC57C \uD569\uB2C8\uB2E4.
- minInclusive-valid-restriction.4 = minInclusive-valid-restriction.4: ''{2}'' \uC720\uD615\uC5D0 \uB300\uD574 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. minInclusive \uAC12 = ''{0}''\uC740(\uB294) \uAE30\uBCF8 \uC720\uD615 ''{1}''\uC758 maxExclusive\uBCF4\uB2E4 \uC791\uC544\uC57C \uD569\uB2C8\uB2E4.
- minLength-less-than-equal-to-maxLength = minLength-less-than-equal-to-maxLength: {2}\uC758 \uC815\uC758\uC5D0\uC11C minLength \uAC12 = ''{0}''\uC740(\uB294) maxLength \uAC12 = ''{1}''\uBCF4\uB2E4 \uC791\uC544\uC57C \uD569\uB2C8\uB2E4.
- minLength-valid-restriction = minLength-valid-restriction: {2}\uC758 \uC815\uC758\uC5D0\uC11C minLength = ''{0}''\uC740(\uB294) \uAE30\uBCF8 \uC720\uD615 ''{1}''\uC758 \uAC12\uBCF4\uB2E4 \uD06C\uAC70\uB098 \uAC19\uC544\uC57C \uD569\uB2C8\uB2E4.
- no-xmlns = no-xmlns: \uC18D\uC131 \uC120\uC5B8\uC758 {name}\uC740 'xmlns'\uC640 \uC77C\uCE58\uD558\uC9C0 \uC54A\uC544\uC57C \uD569\uB2C8\uB2E4.
- no-xsi = no-xsi: \uC18D\uC131 \uC120\uC5B8\uC758 '{'target namespace'}'\uB294 ''{0}''\uACFC(\uC640) \uC77C\uCE58\uD558\uC9C0 \uC54A\uC544\uC57C \uD569\uB2C8\uB2E4.
- p-props-correct.2.1 = p-props-correct.2.1: ''{0}''\uC758 \uC120\uC5B8\uC5D0\uC11C ''minOccurs'' \uAC12\uC774 ''{1}''\uC774\uC9C0\uB9CC \uC774 \uAC12\uC740 ''maxOccurs'' \uAC12 ''{2}''\uBCF4\uB2E4 \uD06C\uC9C0 \uC54A\uC544\uC57C \uD569\uB2C8\uB2E4.
- rcase-MapAndSum.1 = rcase-MapAndSum.1: \uC870\uAC01 \uAC04 \uC804\uCCB4 \uAE30\uB2A5 \uB9E4\uD551\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.
- rcase-MapAndSum.2 = rcase-MapAndSum.2: \uADF8\uB8F9\uC758 \uBC1C\uC0DD \uBC94\uC704({0},{1})\uAC00 \uAE30\uBCF8 \uADF8\uB8F9\uC758 \uBC1C\uC0DD \uBC94\uC704({2},{3})\uC5D0 \uB300\uD574 \uC801\uD569\uD55C \uC81C\uD55C \uC0AC\uD56D\uC774 \uC544\uB2D9\uB2C8\uB2E4.
- rcase-NameAndTypeOK.1 = rcase-NameAndTypeOK.1: \uC694\uC18C\uC5D0 \uB3D9\uC77C\uD558\uC9C0 \uC54A\uC740 \uC774\uB984 \uBC0F \uB300\uC0C1 \uB124\uC784\uC2A4\uD398\uC774\uC2A4(''{1}'' \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uC758 ''{0}'' \uC694\uC18C \uBC0F ''{3}'' \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uC758 ''{2}'' \uC694\uC18C)\uAC00 \uC788\uC2B5\uB2C8\uB2E4.
- rcase-NameAndTypeOK.2 = rcase-NameAndTypeOK.2: '{'term'}'\uC774 \uC694\uC18C \uC120\uC5B8 ''{0}''\uC778 \uC870\uAC01\uC5D0 \uB300\uD574 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. \uC694\uC18C \uC120\uC5B8\uC758 '{'nillable'}'\uC774 true\uC774\uC9C0\uB9CC \uAE30\uBCF8 \uC720\uD615\uC758 \uD574\uB2F9 \uC870\uAC01\uC5D0 '{'nillable'}'\uC774 false\uC778 \uC694\uC18C \uC120\uC5B8\uC774 \uC788\uC2B5\uB2C8\uB2E4.
- rcase-NameAndTypeOK.3 = rcase-NameAndTypeOK.3: '{'term'}'\uC774 \uC694\uC18C \uC120\uC5B8 ''{0}''\uC778 \uC870\uAC01\uC5D0 \uB300\uD574 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. \uBC18\uBCF5 \uBC94\uC704({1},{2})\uAC00 \uAE30\uBCF8 \uC720\uD615\uC5D0 \uC788\uB294 \uD574\uB2F9 \uC870\uAC01\uC758 \uBC94\uC704({3},{4})\uC5D0 \uB300\uD574 \uC801\uD569\uD55C \uC81C\uD55C \uC0AC\uD56D\uC774 \uC544\uB2D9\uB2C8\uB2E4.
- rcase-NameAndTypeOK.4.a = rcase-NameAndTypeOK.4.a: ''{0}'' \uC694\uC18C\uB294 \uACE0\uC815\uB418\uC5B4 \uC788\uC9C0 \uC54A\uC9C0\uB9CC \uAE30\uBCF8 \uC720\uD615\uC758 \uD574\uB2F9 \uC694\uC18C\uB294 ''{1}'' \uAC12\uC73C\uB85C \uACE0\uC815\uB418\uC5B4 \uC788\uC2B5\uB2C8\uB2E4.
- rcase-NameAndTypeOK.4.b = rcase-NameAndTypeOK.4.b: ''{0}'' \uC694\uC18C\uB294 ''{1}'' \uAC12\uC73C\uB85C \uACE0\uC815\uB418\uC5B4 \uC788\uC9C0\uB9CC \uAE30\uBCF8 \uC720\uD615\uC758 \uD574\uB2F9 \uC694\uC18C\uB294 ''{2}'' \uAC12\uC73C\uB85C \uACE0\uC815\uB418\uC5B4 \uC788\uC2B5\uB2C8\uB2E4.
- rcase-NameAndTypeOK.5 = rcase-NameAndTypeOK.5: ''{0}'' \uC694\uC18C\uC5D0 \uB300\uD55C ID \uC81C\uC57D \uC870\uAC74\uC740 \uAE30\uBCF8 \uC720\uD615\uC758 ID \uC81C\uC57D \uC870\uAC74\uC5D0 \uB300\uD55C \uBD80\uBD84 \uC9D1\uD569\uC774 \uC544\uB2D9\uB2C8\uB2E4.
- rcase-NameAndTypeOK.6 = rcase-NameAndTypeOK.6: ''{0}'' \uC694\uC18C\uC5D0 \uB300\uD574 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uB294 \uB300\uCCB4\uB294 \uAE30\uBCF8 \uC720\uD615\uC758 \uD574\uB2F9 \uB300\uCCB4\uC5D0 \uB300\uD55C \uB300\uC9D1\uD569\uC774 \uC544\uB2D9\uB2C8\uB2E4.
- rcase-NameAndTypeOK.7 = rcase-NameAndTypeOK.7: ''{0}'' \uC694\uC18C\uC758 \uC720\uD615 ''{1}''\uC740(\uB294) \uAE30\uBCF8 \uC694\uC18C\uC758 \uC720\uD615 ''{2}''\uC5D0\uC11C \uD30C\uC0DD\uB41C \uAC83\uC774 \uC544\uB2D9\uB2C8\uB2E4.
- rcase-NSCompat.1 = rcase-NSCompat.1: ''{0}'' \uC694\uC18C\uC5D0\uB294 \uAE30\uBCF8 \uC720\uD615\uC758 \uC640\uC77C\uB4DC \uCE74\uB4DC \uBB38\uC790\uC5D0\uC11C \uD5C8\uC6A9\uD558\uC9C0 \uC54A\uB294 ''{1}'' \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uAC00 \uC788\uC2B5\uB2C8\uB2E4.
- rcase-NSCompat.2 = rcase-NSCompat.2: '{'term'}'\uC774 \uC694\uC18C \uC120\uC5B8 ''{0}''\uC778 \uC870\uAC01\uC5D0 \uB300\uD574 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. \uBC18\uBCF5 \uBC94\uC704({1},{2})\uAC00 \uAE30\uBCF8 \uC720\uD615\uC5D0 \uC788\uB294 \uD574\uB2F9 \uC870\uAC01\uC758 \uBC94\uC704({3},{4})\uC5D0 \uB300\uD574 \uC801\uD569\uD55C \uC81C\uD55C \uC0AC\uD56D\uC774 \uC544\uB2D9\uB2C8\uB2E4.
- rcase-NSRecurseCheckCardinality.1 = rcase-NSRecurseCheckCardinality.1: \uC870\uAC01 \uAC04 \uC804\uCCB4 \uAE30\uB2A5 \uB9E4\uD551\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.
- rcase-NSRecurseCheckCardinality.2 = rcase-NSRecurseCheckCardinality.2: \uADF8\uB8F9\uC758 \uBC1C\uC0DD \uBC94\uC704({0},{1})\uAC00 \uAE30\uBCF8 \uC640\uC77C\uB4DC \uCE74\uB4DC \uBB38\uC790\uC758 \uBC94\uC704({2},{3})\uC5D0 \uB300\uD574 \uC801\uD569\uD55C \uC81C\uD55C \uC0AC\uD56D\uC774 \uC544\uB2D9\uB2C8\uB2E4.
- rcase-NSSubset.1 = rcase-NSSubset.1: \uC640\uC77C\uB4DC \uCE74\uB4DC \uBB38\uC790\uAC00 \uAE30\uBCF8 \uC720\uD615\uC758 \uD574\uB2F9 \uC640\uC77C\uB4DC \uCE74\uB4DC \uBB38\uC790\uC5D0 \uB300\uD55C \uBD80\uBD84 \uC9D1\uD569\uC774 \uC544\uB2D9\uB2C8\uB2E4.
- rcase-NSSubset.2 = rcase-NSSubset.2: \uC640\uC77C\uB4DC \uCE74\uB4DC \uBB38\uC790\uC758 \uBC1C\uC0DD \uBC94\uC704({0},{1})\uAC00 \uAE30\uBCF8 \uC720\uD615\uC758 \uC640\uC77C\uB4DC \uCE74\uB4DC \uBB38\uC790 \uBC94\uC704({2},{3})\uC5D0 \uB300\uD574 \uC801\uD569\uD55C \uC81C\uD55C \uC0AC\uD56D\uC774 \uC544\uB2D9\uB2C8\uB2E4.
- rcase-NSSubset.3 = rcase-NSSubset.3: \uC640\uC77C\uB4DC \uCE74\uB4DC \uBB38\uC790\uC758 \uD504\uB85C\uC138\uC2A4 \uCF58\uD150\uCE20 ''{0}''\uC774(\uAC00) \uAE30\uBCF8 \uC720\uD615\uC758 \uCF58\uD150\uCE20 ''{1}''\uBCF4\uB2E4 \uD558\uC704\uC785\uB2C8\uB2E4.
- rcase-Recurse.1 = rcase-Recurse.1: \uADF8\uB8F9\uC758 \uBC1C\uC0DD \uBC94\uC704({0},{1})\uAC00 \uAE30\uBCF8 \uADF8\uB8F9\uC758 \uBC1C\uC0DD \uBC94\uC704({2},{3})\uC5D0 \uB300\uD574 \uC801\uD569\uD55C \uC81C\uD55C \uC0AC\uD56D\uC774 \uC544\uB2D9\uB2C8\uB2E4.
- rcase-Recurse.2 = rcase-Recurse.2: \uC870\uAC01 \uAC04 \uC804\uCCB4 \uAE30\uB2A5 \uB9E4\uD551\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.
- rcase-RecurseLax.1 = rcase-RecurseLax.1: \uADF8\uB8F9\uC758 \uBC1C\uC0DD \uBC94\uC704({0},{1})\uAC00 \uAE30\uBCF8 \uADF8\uB8F9\uC758 \uBC1C\uC0DD \uBC94\uC704({2},{3})\uC5D0 \uB300\uD574 \uC801\uD569\uD55C \uC81C\uD55C \uC0AC\uD56D\uC774 \uC544\uB2D9\uB2C8\uB2E4.
- rcase-RecurseLax.2 = rcase-RecurseLax.2: \uC870\uAC01 \uAC04 \uC804\uCCB4 \uAE30\uB2A5 \uB9E4\uD551\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.
- rcase-RecurseUnordered.1 = rcase-RecurseUnordered.1: \uADF8\uB8F9\uC758 \uBC1C\uC0DD \uBC94\uC704({0},{1})\uAC00 \uAE30\uBCF8 \uADF8\uB8F9\uC758 \uBC1C\uC0DD \uBC94\uC704({2},{3})\uC5D0 \uB300\uD574 \uC801\uD569\uD55C \uC81C\uD55C \uC0AC\uD56D\uC774 \uC544\uB2D9\uB2C8\uB2E4.
- rcase-RecurseUnordered.2 = rcase-RecurseUnordered.2: \uC870\uAC01 \uAC04 \uC804\uCCB4 \uAE30\uB2A5 \uB9E4\uD551\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.
-# We're using sch-props-correct.2 instead of the old src-redefine.1
-# src-redefine.1 = src-redefine.1: The component ''{0}'' is begin redefined, but its corresponding component isn't in the schema document being redefined (with namespace ''{2}''), but in a different document, with namespace ''{1}''.
- sch-props-correct.2 = sch-props-correct.2: \uC2A4\uD0A4\uB9C8\uC5D0\uB294 \uB3D9\uC77C\uD55C \uC774\uB984\uC744 \uAC00\uC9C4 \uB450 \uAC1C\uC758 \uC804\uC5ED \uAD6C\uC131 \uC694\uC18C\uAC00 \uD3EC\uD568\uB420 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uC774 \uC2A4\uD0A4\uB9C8\uC5D0\uB294 \uB450 \uAC1C\uC758 ''{0}''\uC774(\uAC00) \uD3EC\uD568\uB418\uC5B4 \uC788\uC2B5\uB2C8\uB2E4.
- st-props-correct.2 = st-props-correct.2: \uB2E8\uC21C \uC720\uD615 ''{0}''\uC5D0 \uB300\uD55C \uC21C\uD658 \uC815\uC758\uAC00 \uAC10\uC9C0\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uB530\uB77C\uC11C ''{0}''\uC740(\uB294) \uACE0\uC720\uD55C \uC720\uD615 \uACC4\uCE35\uC5D0 \uD3EC\uD568\uB41C \uAC83\uC774\uBA70 \uC774\uB294 \uC624\uB958\uC785\uB2C8\uB2E4.
- st-props-correct.3 = st-props-correct.3: ''{0}'' \uC720\uD615\uC5D0 \uB300\uD574 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. '{'base type definition'}' ''{1}''\uC758 '{'final'}' \uAC12\uC740 \uC81C\uD55C \uC0AC\uD56D\uC5D0 \uC758\uD55C \uD30C\uC0DD\uC744 \uAE08\uC9C0\uD569\uB2C8\uB2E4.
- totalDigits-valid-restriction = totalDigits-valid-restriction: {2}\uC758 \uC815\uC758\uC5D0\uC11C ''totalDigits'' \uBA74\uC5D0 \uB300\uD55C ''{0}'' \uAC12\uC774 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. \uC774 \uAC12\uC740 \uC870\uC0C1 \uC720\uD615 \uC911 \uD558\uB098\uC5D0\uC11C ''{1}''(\uC73C)\uB85C \uC124\uC815\uB41C ''totalDigits''\uC5D0 \uB300\uD55C \uAC12\uBCF4\uB2E4 \uC791\uAC70\uB098 \uAC19\uC544\uC57C \uD569\uB2C8\uB2E4.
- whiteSpace-valid-restriction.1 = whiteSpace-valid-restriction.1: {0}\uC758 \uC815\uC758\uC5D0\uC11C ''whitespace'' \uBA74\uC5D0 \uB300\uD55C ''{1}'' \uAC12\uC774 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. ''whitespace''\uC5D0 \uB300\uD55C \uAC12\uC774 \uC870\uC0C1 \uC720\uD615 \uC911 \uD558\uB098\uC5D0\uC11C ''collapse''\uB85C \uC124\uC815\uB418\uC5C8\uAE30 \uB54C\uBB38\uC785\uB2C8\uB2E4.
- whiteSpace-valid-restriction.2 = whiteSpace-valid-restriction.2: {0}\uC758 \uC815\uC758\uC5D0\uC11C ''whitespace'' \uBA74\uC5D0 \uB300\uD55C ''preserve'' \uAC12\uC774 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. ''whitespace''\uC5D0 \uB300\uD55C \uAC12\uC774 \uC870\uC0C1 \uC720\uD615 \uC911 \uD558\uB098\uC5D0\uC11C ''replace''\uB85C \uC124\uC815\uB418\uC5C8\uAE30 \uB54C\uBB38\uC785\uB2C8\uB2E4.
-
-#schema for Schemas
-
- s4s-att-invalid-value = s4s-att-invalid-value: ''{0}'' \uC694\uC18C\uC758 ''{1}''\uC5D0 \uB300\uD55C \uC18D\uC131\uAC12\uC774 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. \uAE30\uB85D\uB41C \uC6D0\uC778: {2}
- s4s-att-must-appear = s4s-att-must-appear: ''{1}'' \uC18D\uC131\uC740 ''{0}'' \uC694\uC18C\uC5D0 \uB098\uD0C0\uB098\uC57C \uD569\uB2C8\uB2E4.
- s4s-att-not-allowed = s4s-att-not-allowed: ''{1}'' \uC18D\uC131\uC740 ''{0}'' \uC694\uC18C\uC5D0 \uB098\uD0C0\uB0A0 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
- s4s-elt-invalid = s4s-elt-invalid: ''{0}'' \uC694\uC18C\uB294 \uC2A4\uD0A4\uB9C8 \uBB38\uC11C\uC5D0\uC11C \uC801\uD569\uD55C \uC694\uC18C\uAC00 \uC544\uB2D9\uB2C8\uB2E4.
- s4s-elt-must-match.1 = s4s-elt-must-match.1: ''{0}''\uC758 \uCF58\uD150\uCE20\uB294 {1}\uACFC(\uC640) \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4. {2}\uC5D0\uC11C \uC2DC\uC791\uB41C \uBB38\uC81C\uAC00 \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
- s4s-elt-must-match.2 = s4s-elt-must-match.2: ''{0}''\uC758 \uCF58\uD150\uCE20\uB294 {1}\uACFC(\uC640) \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4. \uBC1C\uACAC\uB41C \uC694\uC18C\uAC00 \uBD80\uC871\uD569\uB2C8\uB2E4.
- # the "invalid-content" messages provide less information than the "must-match" counterparts above. They're used for complex types when providing a "match" would be an information dump
- s4s-elt-invalid-content.1 = s4s-elt-invalid-content.1: ''{0}''\uC758 \uCF58\uD150\uCE20\uAC00 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. ''{1}'' \uC694\uC18C\uAC00 \uBD80\uC801\uD569\uD558\uAC70\uB098 \uB108\uBB34 \uC790\uC8FC \uBC1C\uC0DD\uD558\uAC70\uB098 \uD574\uB2F9 \uC694\uC18C\uC758 \uC704\uCE58\uAC00 \uC798\uBABB\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
- s4s-elt-invalid-content.2 = s4s-elt-invalid-content.2: ''{0}''\uC758 \uCF58\uD150\uCE20\uAC00 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. ''{1}'' \uC694\uC18C\uB294 \uBE44\uC6CC \uB458 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
- s4s-elt-invalid-content.3 = s4s-elt-invalid-content.3: ''{0}'' \uC720\uD615\uC758 \uC694\uC18C\uB294 <schema> \uC694\uC18C\uC758 \uD558\uC704 \uD56D\uBAA9\uC73C\uB85C \uC120\uC5B8 \uB4A4\uC5D0 \uB098\uD0C0\uB0A0 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
- s4s-elt-schema-ns = s4s-elt-schema-ns: ''{0}'' \uC694\uC18C\uC758 \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uB294 \uC2A4\uD0A4\uB9C8 \uB124\uC784\uC2A4\uD398\uC774\uC2A4 ''http://www.w3.org/2001/XMLSchema''\uC5D0\uC11C \uC640\uC57C \uD569\uB2C8\uB2E4.
- s4s-elt-character = s4s-elt-character: ''xs:appinfo'' \uBC0F ''xs:documentation'' \uC678\uC5D0 \uB2E4\uB978 \uC2A4\uD0A4\uB9C8 \uC694\uC18C\uC5D0\uC11C\uB294 \uACF5\uBC31\uC774 \uC544\uB2CC \uBB38\uC790\uAC00 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. ''{0}''\uC774(\uAC00) \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
-
-# codes not defined by the spec
-
- c-fields-xpaths = c-fields-xpaths: \uD544\uB4DC \uAC12 = ''{0}''\uC774(\uAC00) \uBD80\uC801\uD569\uD569\uB2C8\uB2E4.
- c-general-xpath = c-general-xpath: ''{0}'' \uD45C\uD604\uC2DD\uC740 XML \uC2A4\uD0A4\uB9C8\uAC00 \uC9C0\uC6D0\uD558\uB294 XPath \uBD80\uBD84 \uC9D1\uD569\uC5D0 \uB300\uD574 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4.
- c-general-xpath-ns = c-general-xpath-ns: XPath \uD45C\uD604\uC2DD ''{0}''\uC758 \uB124\uC784\uC2A4\uD398\uC774\uC2A4 \uC811\uB450\uC5B4\uAC00 \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uC5D0 \uBC14\uC778\uB4DC\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4.
- c-selector-xpath = c-selector-xpath: \uC120\uD0DD\uAE30 \uAC12 = ''{0}''\uC774(\uAC00) \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. \uC120\uD0DD\uAE30 XPath\uC5D0\uB294 \uC18D\uC131\uC774 \uD3EC\uD568\uB420 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
- EmptyTargetNamespace = EmptyTargetNamespace: \uC2A4\uD0A4\uB9C8 \uBB38\uC11C ''{0}''\uC758 ''targetNamespace'' \uC18D\uC131\uAC12\uC740 \uBE48 \uBB38\uC790\uC5F4\uC77C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
- FacetValueFromBase = FacetValueFromBase: ''{0}'' \uC720\uD615\uC758 \uC120\uC5B8\uC5D0\uC11C ''{2}'' \uBA74\uC758 ''{1}'' \uAC12\uC740 \uAE30\uBCF8 \uC720\uD615 ''{3}''\uC758 \uAC12 \uACF5\uBC31\uC5D0\uC11C \uC640\uC57C \uD569\uB2C8\uB2E4.
- FixedFacetValue = FixedFacetValue: {3}\uC758 \uC815\uC758\uC5D0\uC11C ''{0}'' \uBA74\uC5D0 \uB300\uD55C ''{1}'' \uAC12\uC774 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. ''{0}''\uC5D0 \uB300\uD55C \uAC12\uC774 \uC870\uC0C1 \uC720\uD615 \uC911 \uD558\uB098\uC5D0\uC11C ''{2}''(\uC73C)\uB85C \uC124\uC815\uB418\uC5C8\uC73C\uBA70 '{'fixed'}' = true\uC774\uAE30 \uB54C\uBB38\uC785\uB2C8\uB2E4.
- InvalidRegex = InvalidRegex: \uD328\uD134 \uAC12 ''{0}''\uC740(\uB294) \uC801\uD569\uD55C \uC815\uADDC \uD45C\uD604\uC2DD\uC774 \uC544\uB2D9\uB2C8\uB2E4. ''{2}'' \uC5F4\uC5D0\uC11C ''{1}'' \uC624\uB958\uAC00 \uBCF4\uACE0\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
- MaxOccurLimit = \uAD6C\uBB38 \uBD84\uC11D\uAE30\uC758 \uD604\uC7AC \uAD6C\uC131\uC5D0\uC11C maxOccurs \uC18D\uC131\uAC12\uC744 {0} \uAC12\uBCF4\uB2E4 \uD06C\uAC8C \uC124\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
- PublicSystemOnNotation = PublicSystemOnNotation: \uD558\uB098 \uC774\uC0C1\uC758 ''public''\uACFC ''system''\uC774 ''notation'' \uC694\uC18C\uC5D0 \uB098\uD0C0\uB098\uC57C \uD569\uB2C8\uB2E4.
- SchemaLocation = SchemaLocation: schemaLocation \uAC12 = ''{0}''\uC5D0\uB294 \uC9DD\uC218 \uAC1C\uC758 URI\uAC00 \uC788\uC5B4\uC57C \uD569\uB2C8\uB2E4.
- TargetNamespace.1 = TargetNamespace.1: ''{0}'' \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uAC00 \uD544\uC694\uD558\uC9C0\uB9CC \uC2A4\uD0A4\uB9C8 \uBB38\uC11C\uC758 \uB300\uC0C1 \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uAC00 ''{1}''\uC785\uB2C8\uB2E4.
- TargetNamespace.2 = TargetNamespace.2: \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uAC00 \uD544\uC694\uD558\uC9C0 \uC54A\uC9C0\uB9CC \uC2A4\uD0A4\uB9C8 \uBB38\uC11C\uC758 \uB300\uC0C1 \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uAC00 ''{1}''\uC785\uB2C8\uB2E4.
- UndeclaredEntity = UndeclaredEntity: ''{0}'' \uC5D4\uD2F0\uD2F0\uAC00 \uC120\uC5B8\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4.
- UndeclaredPrefix = UndeclaredPrefix: ''{0}''\uC744(\uB97C) QName\uC73C\uB85C \uBD84\uC11D\uD560 \uC218 \uC5C6\uC74C: ''{1}'' \uC811\uB450\uC5B4\uAC00 \uC120\uC5B8\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4.
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_pt_BR.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_pt_BR.properties
deleted file mode 100644
index d063302..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_pt_BR.properties
+++ /dev/null
@@ -1,291 +0,0 @@
-# This file contains error and warning messages related to XML Schema
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
- BadMessageKey = N\u00E3o foi poss\u00EDvel encontrar a mensagem de erro correspondente \u00E0 chave da mensagem.
- FormatFailed = Ocorreu um erro interno ao formatar a mensagem a seguir:\n
-
-# For internal use
-
- Internal-Error = Erro interno: {0}.
- dt-whitespace = O valor do aspecto do espa\u00E7o em branco n\u00E3o est\u00E1 dispon\u00EDvel para o simpleType ''{0}'' da uni\u00E3o
- GrammarConflict = Uma das gram\u00E1ticas retornadas do pool de gram\u00E1tica do usu\u00E1rio est\u00E1 em conflito com outra.
-
-# Identity constraints
-
- AbsentKeyValue = Erro de Restri\u00E7\u00E3o de identidade (cvc-identity-constraint.4.2.1): o elemento "{0}" tem uma chave sem valor.
- DuplicateField = Correspond\u00EAncia duplicada no escopo do campo "{0}".
- DuplicateKey = Valor da chave duplicado [{0}] declarado para a restri\u00E7\u00E3o de identidade do elemento "{1}".
- DuplicateUnique = Valor exclusivo duplicado [{0}] declarado para a restri\u00E7\u00E3o de identidade do elemento "{1}".
- FieldMultipleMatch = Erro de restri\u00E7\u00E3o de identidade: o campo "{0}" corresponde a mais de um valor no escopo deste seletor; os campos devem corresponder a valores exclusivos.
- FixedDiffersFromActual = O conte\u00FAdo deste elemento n\u00E3o \u00E9 equivalente ao valor do atributo "fixed" na declara\u00E7\u00E3o do elemento do esquema.
- KeyMatchesNillable = Erro de restri\u00E7\u00E3o de identidade (cvc-identity-constraint.4.2.3): o elemento "{0}" tem uma chave que corresponde a um elemento o qual tem anul\u00E1vel definido como verdadeiro.
- KeyNotEnoughValues = N\u00E3o h\u00E1 valores suficientes especificados para a restri\u00E7\u00E3o de identidade de <key name="{1}"> especificada para o elemento "{0}".
- KeyNotFound = Chave ''{0}'' com valor ''{1}'' n\u00E3o encontrada para a restri\u00E7\u00E3o de identidade do elemento ''{2}''.
- KeyRefNotEnoughValues = N\u00E3o h\u00E1 valores suficientes especificados para a restri\u00E7\u00E3o de identidade de <keyref name="{1}"> especificada para o elemento "{0}".
- KeyRefOutOfScope = Erro de restri\u00E7\u00E3o de identidade: a restri\u00E7\u00E3o de identidade "{0}" tem uma keyref que se refere a uma chave exclusiva a qual est\u00E1 fora do escopo.
- KeyRefReferNotFound = A declara\u00E7\u00E3o de refer\u00EAncia da chave "{0}" refere-se a uma chave com o nome "{1}".
- UniqueNotEnoughValues = N\u00E3o h\u00E1 valores suficientes especificados para a restri\u00E7\u00E3o de identidade <unique> especificada para o elemento "{0}".
- UnknownField = Erro interno de restri\u00E7\u00E3o de identidade; campo desconhecido "{0}".
-
-# Ideally, we should only use the following error keys, not the ones under
-# "Identity constraints". And we should cover all of the following errors.
-
-#validation (3.X.4)
-
- cvc-attribute.3 = cvc-attribute.3: O valor ''{2}'' do atributo ''{1}'' no elemento ''{0}'' n\u00E3o \u00E9 v\u00E1lido em rela\u00E7\u00E3o ao seu tipo, ''{3}''.
- cvc-attribute.4 = cvc-attribute.4: O valor ''{2}'' do atributo ''{1}'' no elemento ''{0}'' n\u00E3o \u00E9 v\u00E1lido em rela\u00E7\u00E3o \u00E0 sua '{'value constraint'}' fixa. O atributo deve ter um valor ''{3}''.
- cvc-complex-type.2.1 = cvc-complex-type.2.1: O elemento ''{0}'' n\u00E3o deve ter um caractere ou um item com informa\u00E7\u00F5es do elemento [children] porque o tipo de conte\u00FAdo do tipo \u00E9 vazio.
- cvc-complex-type.2.2 = cvc-complex-type.2.2: O elemento ''{0}'' n\u00E3o deve ter um elemento [children] e o valor deve ser v\u00E1lido.
- cvc-complex-type.2.3 = cvc-complex-type.2.3: O elemento ''{0}'' n\u00E3o pode ter um caractere [children] porque o tipo de conte\u00FAdo do tipo \u00E9 somente elemento.
- cvc-complex-type.2.4.a = cvc-complex-type.2.4.a: Foi detectado um conte\u00FAdo inv\u00E1lido come\u00E7ando com o elemento ''{0}''. Era esperado um dos ''{1}''.
- cvc-complex-type.2.4.b = cvc-complex-type.2.4.b: O conte\u00FAdo do elemento ''{0}'' n\u00E3o est\u00E1 completo. Era esperado um dos ''{1}''.
- cvc-complex-type.2.4.c = cvc-complex-type.2.4.c: O curinga correspondente \u00E9 restrito, mas nenhuma declara\u00E7\u00E3o pode ser encontrada para o elemento ''{0}''.
- cvc-complex-type.2.4.d = cvc-complex-type.2.4.d: Conte\u00FAdo inv\u00E1lido encontrado ao iniciar com o elemento ''{0}''. Nenhum elemento filho \u00E9 esperado neste ponto.
- cvc-complex-type.2.4.e = cvc-complex-type.2.4.d: Foi encontrado um conte\u00FAdo inv\u00E1lido come\u00E7ando com o elemento ''{0}''. Nenhum elemento filho "{1}" \u00E9 esperado neste ponto.
- cvc-complex-type.3.1 = cvc-complex-type.3.1: O valor ''{2}'' do atributo ''{1}'' do elemento ''{0}'' n\u00E3o \u00E9 v\u00E1lido em rela\u00E7\u00E3o ao uso do atributo correspondente. O atributo ''{1}'' tem um valor fixo de ''{3}''.
- cvc-complex-type.3.2.1 = cvc-complex-type.3.2.1: O elemento ''{0}'' n\u00E3o tem um curinga do atributo ''{1}''.
- cvc-complex-type.3.2.2 = cvc-complex-type.3.2.2: O atributo ''{1}'' n\u00E3o pode aparecer no elemento ''{0}''.
- cvc-complex-type.4 = cvc-complex-type.4: O atributo ''{1}'' deve aparecer no elemento ''{0}''.
- cvc-complex-type.5.1 = cvc-complex-type.5.1: No elemento ''{0}'', o atributo ''{1}'' \u00E9 um ID Curinga, mas j\u00E1 existe um ID Curinga ''{2}''. Pode haver somente um.
- cvc-complex-type.5.2 = cvc-complex-type.5.2: No elemento, ''{0}'', o atributo ''{1}'' \u00E9 um ID Curinga, mas j\u00E1 existe um atributo ''{2}'' obtido do ID entre os '{'attribute uses'}'.
- cvc-datatype-valid.1.2.1 = cvc-datatype-valid.1.2.1: ''{0}'' n\u00E3o \u00E9 um valor v\u00E1lido para ''{1}''.
- cvc-datatype-valid.1.2.2 = cvc-datatype-valid.1.2.2: ''{0}'' n\u00E3o \u00E9 um valor v\u00E1lido do tipo de lista ''{1}''.
- cvc-datatype-valid.1.2.3 = cvc-datatype-valid.1.2.3: ''{0}'' n\u00E3o \u00E9 um valor v\u00E1lido do tipo de uni\u00E3o ''{1}''.
- cvc-elt.1 = cvc-elt.1: N\u00E3o pode localizar a declara\u00E7\u00E3o do elemento ''{0}''.
- cvc-elt.2 = cvc-elt.2: O valor de "{"abstract"}" na declara\u00E7\u00E3o do elemento para ''{0}'' deve ser falso.
- cvc-elt.3.1 = cvc-elt.3.1: O atributo ''{1}'' n\u00E3o deve aparecer no elemento ''{0}'' porque a propriedade '{'nillable'}' de ''{0}'' \u00E9 falsa.
- cvc-elt.3.2.1 = cvc-elt.3.2.1: O elemento ''{0}'' n\u00E3o pode ter informa\u00E7\u00F5es de caractere ou de elemento [children] porque ''{1}'' foi especificado.
- cvc-elt.3.2.2 = cvc-elt.3.2.2: N\u00E3o deve haver "{"value constraint"}" fixo para o elemento ''{0}'' porque ''{1}'' foi especificado.
- cvc-elt.4.1 = cvc-elt.4.1: O valor ''{2}'' do atributo ''{1}'' do elemento ''{0}'' n\u00E3o \u00E9 um QName v\u00E1lido.
- cvc-elt.4.2 = cvc-elt.4.2: N\u00E3o \u00E9 poss\u00EDvel resolver ''{1}'' para uma defini\u00E7\u00E3o de tipo de elemento ''{0}''.
- cvc-elt.4.3 = cvc-elt.4.3: O tipo ''{1}'' n\u00E3o \u00E9 obtido de forma v\u00E1lida da defini\u00E7\u00E3o do tipo, ''{2}'', do elemento ''{0}''.
- cvc-elt.5.1.1 = cvc-elt.5.1.1: "{"value constraint"}" ''{2}'' do elemento ''{0}'' n\u00E3o \u00E9 um valor padr\u00E3o v\u00E1lido para o tipo ''{1}''.
- cvc-elt.5.2.2.1 = cvc-elt.5.2.2.1: O elemento ''{0}'' n\u00E3o deve ter item de informa\u00E7\u00F5es do elemento [children].
- cvc-elt.5.2.2.2.1 = cvc-elt.5.2.2.2.1: O valor ''{1}'' do elemento ''{0}'' n\u00E3o corresponde ao valor fixo de '{'value constraint'}' ''{2}''.
- cvc-elt.5.2.2.2.2 = cvc-elt.5.2.2.2.2: O valor ''{1}'' do elemento ''{0}'' n\u00E3o corresponde ao valor de '{'value constraint'}' ''{2}'' .
- cvc-enumeration-valid = cvc-enumeration-valid: O valor ''{0}'' n\u00E3o tem um aspecto v\u00E1lido em rela\u00E7\u00E3o \u00E0 enumera\u00E7\u00E3o ''{1}''. Deve ser um valor da enumera\u00E7\u00E3o.
- cvc-fractionDigits-valid = cvc-fractionDigits-valid: O valor ''{0}'' tem {1} d\u00EDgitos fracion\u00E1rios, mas o n\u00FAmero de d\u00EDgitos fracion\u00E1rios foi limitado a {2}.
- cvc-id.1 = cvc-id.1: N\u00E3o h\u00E1 associa\u00E7\u00E3o de ID/IDREF para IDREF ''{0}''.
- cvc-id.2 = cvc-id.2: H\u00E1 v\u00E1rias ocorr\u00EAncias do valor do ID ''{0}''.
- cvc-id.3 = cvc-id.3: Um campo da restri\u00E7\u00E3o de identidade ''{0}'' correspondia ao elemento ''{1}'', mas este elemento n\u00E3o tem um tipo simples.
- cvc-length-valid = cvc-length-valid: O valor ''{0}'' com tamanho = ''{1}'' n\u00E3o tem um aspecto v\u00E1lido em rela\u00E7\u00E3o ao tamanho ''{2}'' do tipo ''{3}''.
- cvc-maxExclusive-valid = cvc-maxExclusive-valid: O valor ''{0}'' n\u00E3o tem um aspecto v\u00E1lido em rela\u00E7\u00E3o ao maxExclusive ''{1}'' do tipo ''{2}''.
- cvc-maxInclusive-valid = cvc-maxInclusive-valid: O valor ''{0}'' n\u00E3o tem um aspecto v\u00E1lido em rela\u00E7\u00E3o ao maxInclusive ''{1}'' do tipo ''{2}''.
- cvc-maxLength-valid = cvc-maxLength-valid: O valor ''{0}'' com tamanho = ''{1}'' n\u00E3o tem um aspecto v\u00E1lido em rela\u00E7\u00E3o ao maxLength ''{2}'' do tipo ''{3}''.
- cvc-minExclusive-valid = cvc-minExclusive-valid: O valor ''{0}'' n\u00E3o tem um aspecto v\u00E1lido em rela\u00E7\u00E3o ao minExclusive ''{1}'' do tipo ''{2}''.
- cvc-minInclusive-valid = cvc-minInclusive-valid: O valor ''{0}'' n\u00E3o tem um aspecto v\u00E1lido em rela\u00E7\u00E3o ao minInclusive ''{1}'' do tipo ''{2}''.
- cvc-minLength-valid = cvc-minLength-valid: O valor ''{0}'' com tamanho = ''{1}'' n\u00E3o tem um aspecto v\u00E1lido em rela\u00E7\u00E3o ao minLength ''{2}'' do tipo ''{3}''.
- cvc-pattern-valid = cvc-pattern-valid: O valor ''{0}'' n\u00E3o tem um aspecto v\u00E1lido em rela\u00E7\u00E3o ao padr\u00E3o ''{1}'' do tipo ''{2}''.
- cvc-totalDigits-valid = cvc-totalDigits-valid: O valor ''{0}'' tem {1} d\u00EDgitos do total, mas o n\u00FAmero de d\u00EDgitos do total foi limitado a {2}.
- cvc-type.2 = cvc-type.2: A defini\u00E7\u00E3o do tipo n\u00E3o pode ser abstrata para o elemento {0}.
- cvc-type.3.1.1 = cvc-type.3.1.1: O elemento ''{0}'' tem um tipo simples. Dessa forma, n\u00E3o pode haver atributos, exceto aqueles cujo nome do namespace \u00E9 id\u00EAntico a ''http://www.w3.org/2001/XMLSchema-instance'' e cujo [local name] \u00E9 um dos seguintes ''type'', ''nil'', ''schemaLocation'' ou ''noNamespaceSchemaLocation''. No entanto, o atributo ''{1}'' foi encontrado.
- cvc-type.3.1.2 = cvc-type.3.1.2: O elemento ''{0}'' tem um tipo simples. Dessa forma, n\u00E3o deve haver um item de informa\u00E7\u00F5es do elemento [children].
- cvc-type.3.1.3 = cvc-type.3.1.3: O valor ''{1}'' do elemento ''{0}'' n\u00E3o \u00E9 v\u00E1lido.
-
-#schema valid (3.X.3)
-
- schema_reference.access = schema_reference: falha ao ler o documento de esquema ''{0}'' porque o acesso a ''{1}'' n\u00E3o \u00E9 permitido em decorr\u00EAncia de uma restri\u00E7\u00E3o definida pela propriedade accessExternalSchema.
- schema_reference.4 = schema_reference.4: Falha ao ler o documento do esquema ''{0}'' porque 1) n\u00E3o foi poss\u00EDvel encontrar o documento; 2) n\u00E3o foi poss\u00EDvel ler o documento; 3) o elemento-raiz do documento n\u00E3o \u00E9 <xsd:schema>.
- src-annotation = src-annotation: os elementos de <annotation> podem conter somente os elementos <appinfo> e <documentation>, mas foi encontrado ''{0}''.
- src-attribute.1 = src-attribute.1: As propriedades ''padr\u00E3o'' e ''fixed'' n\u00E3o podem estar presentes na declara\u00E7\u00E3o do atributo ''{0}''. Use somente uma delas.
- src-attribute.2 = src-attribute.2: : A propriedade ''padr\u00E3o'' est\u00E1 presente no atributo ''{0}''. Dessa forma, o valor de ''use'' deve ser ''optional''.
- src-attribute.3.1 = src-attribute.3.1: 'ref' ou 'name' deve estar presente na declara\u00E7\u00E3o do atributo de local.
- src-attribute.3.2 = src-attribute.3.2: O conte\u00FAdo deve corresponder a (annotation?) da refer\u00EAncia do atributo ''{0}''.
- src-attribute.4 = src-attribute.4: O atributo ''{0}'' tem um atributo ''type'' e um ''simpleType'' filho an\u00F4nimo. Somente um deles \u00E9 permitido para um atributo.
- src-attribute_group.2 = src-attribute_group.2: A intersec\u00E7\u00E3o dos curingas n\u00E3o \u00E9 express\u00EDvel para o grupo de atributos ''{0}''.
- src-attribute_group.3 = src-attribute_group.3: Defini\u00E7\u00F5es circulares detectadas para o grupo de atributos ''{0}''. Seguir as refer\u00EAncias do grupo de atributos de forma recursiva acaba conduzindo a ele pr\u00F3prio.
- src-ct.1 = src-ct.1: Erro de Representa\u00E7\u00E3o da Defini\u00E7\u00E3o do Tipo Complexo para o tipo ''{0}''. Quando <complexContent> \u00E9 usado, o tipo base deve ser um complexType. ''{1}'' \u00E9 um simpleType.
- src-ct.2.1 = src-ct.2.1: Erro de Representa\u00E7\u00E3o da Defini\u00E7\u00E3o do Tipo Complexo do tipo ''{0}''. Quando <simpleContent> \u00E9 usado, o tipo de base deve ser um complexType cujo tipo de conte\u00FAdo \u00E9 simples ou, somente se a restri\u00E7\u00E3o for especificada, um tipo complexo com conte\u00FAdo misto e uma part\u00EDcula esvazi\u00E1vel, ou, somente se a extens\u00E3o for especificada, um tipo simples. ''{1}'' n\u00E3o satisfaz nenhuma dessas condi\u00E7\u00F5es.
- src-ct.2.2 = src-ct.2.2: Erro de Representa\u00E7\u00E3o de Defini\u00E7\u00E3o do Tipo Complexo do tipo ''{0}''. Quando um complexType com simpleContent \u00E9 restrito a um complexType com conte\u00FAdo misto e part\u00EDcula esvazi\u00E1vel, ent\u00E3o deve haver um <simpleType> entre os filhos de <restriction>.
- src-ct.4 = src-ct.4: Erro de Representa\u00E7\u00E3o de Defini\u00E7\u00E3o de Tipo Complexo do tipo ''{0}''. A intersec\u00E7\u00E3o de curingas n\u00E3o \u00E9 express\u00EDvel.
- src-ct.5 = src-ct.5: Erro de Representa\u00E7\u00E3o da Defini\u00E7\u00E3o do Tipo Complexo do tipo ''{0}''. A uni\u00E3o de curingas n\u00E3o \u00E9 express\u00EDvel.
- src-element.1 = src-element.1: As propriedades ''padr\u00E3o'' e ''fixed'' n\u00E3o podem estar presentes na declara\u00E7\u00E3o do elemento ''{0}''. Use somente uma delas.
- src-element.2.1 = src-attribute.2.1: 'ref' ou 'name' deve estar presente na declara\u00E7\u00E3o de elemento do local.
- src-element.2.2 = src-element.2.2: Como ''{0}'' cont\u00E9m o atributo ''ref'', seu conte\u00FAdo deve ser correspondente (annotation?). No entanto, ''{1}'' foi encontrado.
- src-element.3 = src-element.3: O elemento ''{0}'' tem um atributo ''type'' e um filho ''anonymous type''. Somente um deles \u00E9 permitido para um elemento.
- src-import.1.1 = src-import.1.1: O atributo do namespace ''{0}'' de um item de informa\u00E7\u00E3o do elemento <import> n\u00E3o deve ser igual ao targetNamespace do esquema existente nele.
- src-import.1.2 = src-import.1.2: Se o atributo do namespace n\u00E3o estiver presente em um item de informa\u00E7\u00E3o do elemento <import>, ent\u00E3o o esquema delimitador deve ter um targetNamespace.
- src-import.2 = src-import.2: O elemento-raiz do documento "{0}'' deve ter o nome do namespace ''http://www.w3.org/2001/XMLSchema'' e o nome do local ''schema''.
- src-import.3.1 = src-import.3.1: O atributo do namespace, ''{0}'', de um item de informa\u00E7\u00E3o do elemento <import> deve ser id\u00EAntico ao atributo targetNamespace, ''{1}'', do documento importado.
- src-import.3.2 = src-import.3.2: Um item de informa\u00E7\u00E3o do elemento <import> que n\u00E3o tinha atributo de namespace foi encontrado. Dessa forma, o documento importado n\u00E3o pode ter um atributo de targetNamespace. No entanto, o targetNamespace ''{1}'' foi encontrado no documento importado.
- src-include.1 = src-include.1: O elemento-raiz do documento "{0}'' deve ter o nome do namespace ''http://www.w3.org/2001/XMLSchema'' e o nome do local ''schema''.
- src-include.2.1 = src-include.2.1: O targetNamespace do esquema mencionado, atualmente ''{1}'', deve ser id\u00EAntico ao do esquema de inclus\u00E3o, atualmente ''{0}''.
- src-redefine.2 = src-redefine.2: O elemento-raiz do documento "{0}'' deve ter o nome do namespace ''http://www.w3.org/2001/XMLSchema'' e o nome do local ''schema''.
- src-redefine.3.1 = src-redefine.3.1: O targetNamespace do esquema mencionado, atualmente ''{1}'', deve ser id\u00EAntico ao do esquema de redefini\u00E7\u00E3o, atualmente ''{0}''.
- src-redefine.5.a.a = src-redefine.5.a.a: N\u00E3o foram encontrados filhos sem anota\u00E7\u00E3o de <simpleType>. Os filhos <simpleType> dos elementos <redefine> devem ter descendentes de <restriction> com atributos 'base' que fazem refer\u00EAncia a eles pr\u00F3prios.
- src-redefine.5.a.b = src-redefine.5.a.b: ''{0}'' n\u00E3o \u00E9 um elemento filho v\u00E1lido. Os filhos <simpleType> dos elementos <redefine> devem ter descendentes de <restriction> com atributos ''base'' que fazem refer\u00EAncia a eles pr\u00F3prios.
- src-redefine.5.a.c = src-redefine.5.a.c: ''{0}'' n\u00E3o tem um atributo "base" que faz refer\u00EAncia ao elemento ''{1}''. <simpleType> filhos dos elementos <redefine> devem ter descendentes de <restriction> com atributos ''base'' que fazem refer\u00EAncia a eles pr\u00F3prios.
- src-redefine.5.b.a = src-redefine.5.b.a: Nenhum filho sem anota\u00E7\u00E3o de <complexType> foi encontrado. Os filhos de <complexType> dos elementos <redefine> devem ter os descendentes <extension> ou <restriction>, com atributos 'base' que fazem refer\u00EAncia a eles pr\u00F3prios.
- src-redefine.5.b.b = src-redefine.5.b.b: Nenhum neto sem anota\u00E7\u00E3o de <complexType> foi encontrado. Os filhos de <complexType> dos elementos <redefine> devem ter os descendentes <extension> ou <restriction> com atributos 'base' que fazem refer\u00EAncia a eles pr\u00F3prios.
- src-redefine.5.b.c = src-redefine.5.b.c: ''{0}'' n\u00E3o \u00E9 um elemento do neto v\u00E1lido. Os filhos de <complexType> dos elementos <redefine> devem ter os descendentes <extension> ou <restriction> com atributos ''base'' que fazem refer\u00EAncia a eles pr\u00F3prios.
- src-redefine.5.b.d = src-redefine.5.b.d: ''{0}'' n\u00E3o tem um atributo "base" que faz refer\u00EAncia ao elemento redefinido ''{1}''. Os filhos de <complexType> dos elementos <redefine> devem ter descendentes de <extension> ou <restriction> com atributos ''base'' que fazem refer\u00EAncia a eles pr\u00F3prios.
- src-redefine.6.1.1 = src-redefine.6.1.1: Se um filho do grupo de um elemento <redefine> contiver um grupo que faz refer\u00EAncia a si pr\u00F3prio, ele deve ter exatamente 1; este tem ''{0}''.
- src-redefine.6.1.2 = src-redefine.6.1.2: O grupo ''{0}'' que cont\u00E9m um refer\u00EAncia a um grupo que est\u00E1 sendo redefinido deve ter ''minOccurs'' = ''maxOccurs'' = 1.
- src-redefine.6.2.1 = src-redefine.6.2.1: Nenhum grupo no esquema redefinido tem uma correspond\u00EAncia de nome ''{0}''.
- src-redefine.6.2.2 = src-redefine.6.2.2: O grupo ''{0}'' n\u00E3o restringe adequadamente o grupo que ele redefine; restri\u00E7\u00E3o violada: ''{1}''.
- src-redefine.7.1 = src-redefine.7.1: Se um filho de attributeGroup de um elemento <redefine> contiver um attributeGroup que faz refer\u00EAncia a ele pr\u00F3prio, ele deve ter exatamente 1; este tem {0}.
- src-redefine.7.2.1 = src-redefine.7.2.1: Nenhum attributeGroup no esquema redefinido tem uma correspond\u00EAncia de nome ''{0}''.
- src-redefine.7.2.2 = src-redefine.7.2.2: O AttributeGroup ''{0}'' n\u00E3o restringe adequadamente o attributeGroup que ele redefine; restri\u00E7\u00E3o violada: ''{1}''.
- src-resolve = src-resolve: N\u00E3o \u00E9 poss\u00EDvel resolver o nome ''{0}'' para um componente ''{1}''.
- src-resolve.4.1 = src-resolve.4.1: Erro ao resolver o componente ''{2}''. Foi detectado que ''{2}'' n\u00E3o tem namespace, mas n\u00E3o \u00E9 poss\u00EDvel fazer refer\u00EAncia aos componentes em namespace de destino usando o documento do esquema ''{0}''. Se ''{2}'' for destinado a um namespace, talvez seja necess\u00E1rio um prefixo. Se for determinado que ''{2}'' n\u00E3o tem namespace, ent\u00E3o uma "importa\u00E7\u00E3o" sem um atributo "namespace" dever\u00E1 ser adicionada a "{0}".
- src-resolve.4.2 = src-resolve.4.2: Erro ao resolver o componente ''{2}''. Foi detectado que ''{2}'' est\u00E1 no namespace ''{1}'', mas n\u00E3o \u00E9 poss\u00EDvel fazer refer\u00EAncia aos componentes em namespace de destino usando o documento do esquema ''{0}''. Se este for o namespace incorreto, talvez o prefixo de ''{2}'' precise ser alterado. Se este for o namespace correto, ent\u00E3o a tag de "importa\u00E7\u00E3o" apropriada dever\u00E1 ser adicionada a ''{0}''.
- src-simple-type.2.a = src-simple-type.2.a: Foi encontrado um elemento <restriction> que tem um [attribute] base e um elemento <simpleType> entre seus [children]. Somente um \u00E9 permitido.
- src-simple-type.2.b = src-simple-type.2.b: Foi encontrado um elemento <restriction> que n\u00E3o tem um [attribute] base nem um elemento <simpleType> entre seus [children]. \u00C9 necess\u00E1rio um.
- src-simple-type.3.a = src-simple-type.3.a: Foi encontrado um elemento <list> que tem um itemType [attribute] e um elemento <simpleType> entre seus [children]. Somente um \u00E9 permitido.
- src-simple-type.3.b = src-simple-type.3.b: Foi encontrado um elemento <list> que n\u00E3o tem um itemType [attribute] nem um elemento <simpleType> entre seus [children]. Um \u00E9 necess\u00E1rio.
- src-single-facet-value = src-single-facet-value: O aspecto ''{0}'' foi definido mais de uma vez.
- src-union-memberTypes-or-simpleTypes = src-union-memberTypes-or-simpleTypes: Um elemento <union> deve ter um memberTypes [attribute] n\u00E3o vazio ou pelo menos um elemento <simpleType> entre seus [children].
-
-#constraint valid (3.X.6)
-
- ag-props-correct.2 = ag-props-correct.2: Erro do grupo de atributos ''{0}''. Os usos do atributo duplicado com o mesmo nome e namespace de destino foram especificados. O nome de uso do atributo duplicado \u00E9 ''{1}''.
- ag-props-correct.3 = ag-props-correct.3: Erro do grupo de atributos ''{0}''. Duas declara\u00E7\u00F5es de atributo ''{1}'' e ''{2}'' t\u00EAm tipos que s\u00E3o obtidos do ID.
- a-props-correct.2 = a-props-correct.2: Valor de restri\u00E7\u00E3o inv\u00E1lido ''{1}'' no atributo ''{0}''.
- a-props-correct.3 = a-props-correct.3: O atributo ''{0}'' n\u00E3o pode usar ''fixed'' ou ''padr\u00E3o'' porque o '{'type definition'}' do atributo \u00E9 ID ou \u00E9 obtida do ID.
- au-props-correct.2 = au-props-correct.2: Na declara\u00E7\u00E3o do atributo de ''{0}'', foi especificado um valor fixo de ''{1}''. Dessa forma, se o uso do atributo que faz refer\u00EAncia a ''{0}'' tamb\u00E9m tiver uma '{'value constraint'}', ele deve ser corrigido e seu valor deve ser ''{1}''.
- cos-all-limited.1.2 = cos-all-limited.1.2: Um grupo de modelos 'all' deve ser exibido em uma part\u00EDcula com '{'min occurs'}' = '{'max occurs'}' = 1 e essa part\u00EDcula deve fazer parte de um par que constitui o '{'content type'}' de uma defini\u00E7\u00E3o de tipo complexa.
- cos-all-limited.2 = cos-all-limited.2: O "{"max occurs"}" de um elemento em um grupo de modelos ''all'' deve ser 0 ou 1. O valor ''{0}'' do elemento ''{1}'' \u00E9 inv\u00E1lido.
- cos-applicable-facets = cos-applicable-facets: O aspecto ''{0}'' n\u00E3o \u00E9 permitido pelo tipo {1}.
- cos-ct-extends.1.1 = cos-ct-extends.1.1: O tipo ''{0}'' foi obtido atrav\u00E9s da extens\u00E3o do tipo ''{1}''. No entanto, o atributo ''final'' de ''{1}'' pro\u00EDbe a obten\u00E7\u00E3o por meio da extens\u00E3o.
- cos-ct-extends.1.4.3.2.2.1.a = cos-ct-extends.1.4.3.2.2.1.a: O tipo de conte\u00FAdo de um tipo derivado e o de sua base deve ser misto ou ambos devem ser de somente do elemento. O tipo ''{0}'' \u00E9 somente do elemento, mas sua base n\u00E3o \u00E9.
- cos-ct-extends.1.4.3.2.2.1.b = cos-ct-extends.1.4.3.2.2.1.b: O tipo de conte\u00FAdo de um tipo derivado e sua base devem ser mistos ou ambos devem ser somente de elemento. O tipo ''{0}'' \u00E9 misto, mas seu tipo de base n\u00E3o \u00E9.
- cos-element-consistent = cos-element-consistent: Erro do tipo ''{0}''. V\u00E1rios elementos com o nome ''{1}'' com diferentes tipos aparecem no grupo de modelos.
- cos-list-of-atomic = cos-list-of-atomic: Na defini\u00E7\u00E3o do tipo de lista ''{0}'', o tipo ''{1}'' \u00E9 um tipo de elemento da lista inv\u00E1lido porque n\u00E3o \u00E9 at\u00F4mico (''{1}'' \u00E9 um tipo de lista ou um tipo de uni\u00E3o que cont\u00E9m uma lista).
- cos-nonambig = cos-nonambig: {0} e {1} (ou elementos de seu grupo de substitui\u00E7\u00E3o) violam a "Unique Particle Attribution". Durante a valida\u00E7\u00E3o deste esquema, a ambiguidade ser\u00E1 criada para essas duas part\u00EDculas.
- cos-particle-restrict.a = cos-particle-restrict.a: A part\u00EDcula obtida est\u00E1 vazia e a base n\u00E3o pode ser esvaziada.
- cos-particle-restrict.b = cos-particle-restrict.b: A part\u00EDcula base est\u00E1 vazia, mas a part\u00EDcula obtida n\u00E3o est\u00E1.
- cos-particle-restrict.2 = cos-particle-restrict.2: Restri\u00E7\u00E3o de part\u00EDcula proibida: ''{0}''.
- cos-st-restricts.1.1 = cos-st-restricts.1.1: O tipo ''{1}'' \u00E9 at\u00F4mico. Dessa forma, sua '{'base type definition'}', ''{0}'', deve ser uma defini\u00E7\u00E3o de tipo simples at\u00F4mico ou um tipo de dados primitivo criado.
- cos-st-restricts.2.1 = cos-st-restricts.2.1: Na defini\u00E7\u00E3o do tipo de lista ''{0}'', o tipo ''{1}'' \u00E9 um tipo de item inv\u00E1lido porque \u00E9 um tipo de lista ou um tipo de uni\u00E3o que cont\u00E9m uma lista.
- cos-st-restricts.2.3.1.1 = cos-st-restricts.2.3.1.1: O componente "{"final"}" da "{"item type definition"}" ''{0}'' cont\u00E9m ''list''. Isso significa que ''{0}'' n\u00E3o pode ser usado como um tipo de item do tipo de lista ''{1}''.
- cos-st-restricts.3.3.1.1 = cos-st-restricts.3.3.1.1: O componente "{"final"}" de "{"member type definitions"}", ''{0}'', cont\u00E9m ''union''. Isso significa que ''{0}'' n\u00E3o pode ser usado como um tipo de membro do tipo de uni\u00E3o ''{1}''.
- cos-valid-default.2.1 = cos-valid-padr\u00E3o.2.1: O elemento ''{0}'' tem uma restri\u00E7\u00E3o de valor e deve ter um modelo de conte\u00FAdo simples ou misto.
- cos-valid-default.2.2.2 = cos-valid-padr\u00E3o.2.2.2: Como o elemento ''{0}'' tem uma '{'value constraint'}' e sua defini\u00E7\u00E3o de tipo tem {''content type'}' misto, ent\u00E3o a part\u00EDcula do '{'content type'}' deve ser esvazi\u00E1vel.
- c-props-correct.2 = c-props-correct.2: A cardinalidade dos Campos de keyref ''{0}'' e chave ''{1}'' deve ser correspondente.
- ct-props-correct.3 = ct-props-correct.3: Defini\u00E7\u00F5es circulares detectadas para o tipo complexo ''{0}''. Isso significa que ''{0}'' est\u00E1 contido em sua pr\u00F3pria hierarquia de tipo, o que \u00E9 um erro.
- ct-props-correct.4 = ct-props-correct.4: Erro do tipo ''{0}''. Os usos do atributo duplicado com o mesmo nome e namespace de destino foram especificados. O nome do uso do atributo duplicado \u00E9 ''{1}''.
- ct-props-correct.5 = ct-props-correct.5: Erro do tipo ''{0}''. Duas declara\u00E7\u00F5es do atributo ''{1}'' e ''{2}'' t\u00EAm tipos que s\u00E3o obtidos do ID.
- derivation-ok-restriction.1 = derivation-ok-restriction.1: O tipo ''{0}'' foi obtido por meio da restri\u00E7\u00E3o do tipo ''{1}''. No entanto, ''{1}'' tem uma propriedade '{'final'}' que pro\u00EDbe a deriva\u00E7\u00E3o por restri\u00E7\u00E3o.
- derivation-ok-restriction.2.1.1 = derivation-ok-restriction.2.1.1: Erro do tipo ''{0}''. O uso do atributo ''{1}'' neste tipo tem um valor de ''uso'' de ''{2}'', que \u00E9 inconsistente com o valor ''obrigat\u00F3rio'' em um uso de atributo correspondente no tipo de base.
- derivation-ok-restriction.2.1.2 = derivation-ok-restriction.2.1.2: Erro do tipo ''{0}''. O uso do atributo ''{1}'' neste tipo tem o tipo ''{2}'', que \u00E9 obtido de forma v\u00E1lida de "{3}", o tipo de uso do atributo correspondente no tipo de base.
- derivation-ok-restriction.2.1.3.a = derivation-ok-restriction.2.1.3.a: Erro do tipo ''{0}''. O uso do atributo ''{1}'' neste tipo tem uma restri\u00E7\u00E3o de valor efetivo que n\u00E3o \u00E9 fixa e a restri\u00E7\u00E3o de valor efetivo do atributo correspondente no tipo de base \u00E9 fixa.
- derivation-ok-restriction.2.1.3.b = derivation-ok-restriction.2.1.3.b: Erro do tipo ''{0}''. O uso do atributo ''{1}'' neste tipo tem uma restri\u00E7\u00E3o de valor efetivo fixa com um valor de "{2}" que n\u00E3o \u00E9 consistente com o valor de "{3}" para a restri\u00E7\u00E3o de valor efetivo fixa do uso do atributo correspondente no tipo de base.
- derivation-ok-restriction.2.2.a = derivation-ok-restriction.2.2.a: Erro do tipo ''{0}''. O uso do atributo ''{1}'' neste tipo n\u00E3o tem um uso de atributo correspondente na base e o tipo de base n\u00E3o tem um atributo curinga.
- derivation-ok-restriction.2.2.b = derivation-ok-restriction.2.2.b: Erro do tipo ''{0}''. O uso do atributo ''{1}'' neste tipo n\u00E3o tem um uso de atributo correspondente na base e o curinga no tipo de base n\u00E3o permite o namespace "{2}" deste uso do atributo.
- derivation-ok-restriction.3 = derivation-ok-restriction.3: Erro do tipo ''{0}''. O uso do atributo ''{1}'' no tipo de base tem REQUIRED como verdadeiro, mas n\u00E3o h\u00E1 uso de atributo correspondente no tipo obtido.
- derivation-ok-restriction.4.1 = derivation-ok-restriction.4.1: Erro do tipo ''{0}''. A deriva\u00E7\u00E3o tem um curinga de atributo, mas a base n\u00E3o tem.
- derivation-ok-restriction.4.2 = derivation-ok-restriction.4.2: Erro do tipo ''{0}''. O curinga na deriva\u00E7\u00E3o n\u00E3o \u00E9 um subconjunto de curingas v\u00E1lido daquele da base.
- derivation-ok-restriction.4.3 = derivation-ok-restriction.4.3: Erro do tipo ''{0}''. O conte\u00FAdo do processo do curinga na deriva\u00E7\u00E3o ({1}) \u00E9 mais fraco que aquele da base ({2}).
- derivation-ok-restriction.5.2.2.1 = derivation-ok-restriction.5.2.2.1: Erro do tipo ''{0}''. O tipo de conte\u00FAdo simples deste tipo ''{1}'' n\u00E3o se trata de uma restri\u00E7\u00E3o v\u00E1lida do tipo de conte\u00FAdo simples da base, ''{2}''.
- derivation-ok-restriction.5.3.2 = derivation-ok-restriction.5.3.2: Erro do tipo ''{0}''. O tipo de conte\u00FAdo deste tipo est\u00E1 vazio, mas o tipo de conte\u00FAdo da base, ''{1}'', n\u00E3o est\u00E1 vazio ou \u00E9 esvazi\u00E1vel.
- derivation-ok-restriction.5.4.1.2 = derivation-ok-restriction.5.4.1.2: Erro do tipo ''{0}''. O tipo de conte\u00FAdo deste tipo \u00E9 misto, mas o tipo de conte\u00FAdo da base ''{1}'' n\u00E3o \u00E9.
- derivation-ok-restriction.5.4.2 = derivation-ok-restriction.5.4.2: Erro do tipo ''{0}''. A part\u00EDcula do tipo n\u00E3o \u00E9 uma restri\u00E7\u00E3o v\u00E1lida da part\u00EDcula da base.
- enumeration-required-notation = enumeration-required-notation: O tipo de NOTATION, ''{0}'' usado por {2} ''{1}'', deve ter um valor de aspecto de enumera\u00E7\u00E3o que especifica os elementos de nota\u00E7\u00E3o usados por este tipo.
- enumeration-valid-restriction = enumeration-valid-restriction: O valor da enumera\u00E7\u00E3o ''{0}'' n\u00E3o \u00E9 o espa\u00E7o do valor do tipo de base, {1}.
- e-props-correct.2 = e-props-correct.2: Valor de restri\u00E7\u00E3o de valor inv\u00E1lido ''{1}'' no elemento ''{0}''.
- e-props-correct.4 = e-props-correct.4: A "{"type definition"}" do elemento ''{0}'' n\u00E3o \u00E9 obtida de forma v\u00E1lida a partir da "{"type definition"}" de substitutionHead ''{1}'' ou a propriedade "{"substitution group exclusions"}" de ''{1}'' n\u00E3o permite esta deriva\u00E7\u00E3o.
- e-props-correct.5 = e-props-correct.5: Uma "{"value constraint"}" n\u00E3o deve estar presente no elemento ''{0}'' porque a "{"type definition"}" do elemento ou o "{"content type"}" da "{"type definition"}" \u00E9 ID ou obtida do ID.
- e-props-correct.6 = e-props-correct.6: Grupo de substitui\u00E7\u00E3o circular detectada para o elemento ''{0}''.
- fractionDigits-valid-restriction = fractionDigits-valid-restriction: Na defini\u00E7\u00E3o de {2}, o valor ''{0}'' de ''fractionDigits'' do aspecto \u00E9 inv\u00E1lido porque ele deve ser <= ao valor de ''fractionDigits'' que foi definido como ''{1}'' em um dos tipos de ancestrais.
- fractionDigits-totalDigits = fractionDigits-totalDigits: Na defini\u00E7\u00E3o de {2}, o valor ''{0}'' do aspecto ''fractionDigits'' \u00E9 inv\u00E1lido porque o valor deve ser <= o valor de ''totalDigits'' que \u00E9 ''{1}''.
- length-minLength-maxLength.1.1 = length-minLength-maxLength.1.1: Para o tipo {0}, \u00E9 um erro para que o valor do tamanho ''{1}'' seja menor que o valor de minLength ''{2}''.
- length-minLength-maxLength.1.2.a = length-minLength-maxLength.1.2.a: Para o tipo {0}, \u00E9 um erro para que a base n\u00E3o tenha um aspecto de minLength, se a restri\u00E7\u00E3o atual tiver o aspecto minLength e a restri\u00E7\u00E3o atual ou a base tenha o aspecto de tamanho.
- length-minLength-maxLength.1.2.b = length-minLength-maxLength.1.2.b: Para o tipo {0}, \u00E9 um erro para que o minLength ''{1}'' atual n\u00E3o seja igual ao minLength ''{2}'' base.
- length-minLength-maxLength.2.1 = length-minLength-maxLength.1.2: Para o tipo {0}, \u00E9 um erro para que o valor do tamanho ''{1}'' seja maior que o valor de maxLength ''{2}''.
- length-minLength-maxLength.2.2.a = length-minLength-maxLength.2.2.a: Para o tipo {0}, \u00E9 um erro para que a base n\u00E3o tenha um aspecto de maxLength, se a restri\u00E7\u00E3o atual tiver o aspecto maxLength e a restri\u00E7\u00E3o atual ou a base tiver o aspecto de tamanho.
- length-minLength-maxLength.2.2.b = length-minLength-maxLength.2.2.b: Para o tipo {0}, \u00E9 um erro para que o maxLength ''{1}'' atual n\u00E3o seja igual ao maxnLength ''{2}'' base.
- length-valid-restriction = length-valid-restriction: Erro do tipo ''{2}''. O valor do tamanho = ''{0}'' deve ser = o valor do tipo de base ''{1}''.
- maxExclusive-valid-restriction.1 = maxExclusive-valid-restriction.1: Erro do tipo ''{2}''. O valor maxExclusive =''{0}'' deve ser <= maxExclusive do tipo de base ''{1}''.
- maxExclusive-valid-restriction.2 = maxExclusive-valid-restriction.2: Erro do tipo ''{2}''. O valor maxExclusive =''{0}'' deve ser <= maxInclusive do tipo de base ''{1}''.
- maxExclusive-valid-restriction.3 = maxExclusive-valid-restriction.3: Erro do tipo ''{2}''. O valor maxExclusive =''{0}'' deve ser > minExclusive do tipo de base ''{1}''.
- maxExclusive-valid-restriction.4 = maxExclusive-valid-restriction.4: Erro do tipo ''{2}''. O valor maxExclusive =''{0}'' deve ser > minExclusive do tipo de base ''{1}''.
- maxInclusive-maxExclusive = maxInclusive-maxExclusive: \u00C9 um erro para que maxInclusive e maxExclusive sejam especificados para o mesmo tipo de dados. Em {2}, maxInclusive = ''{0}'' e maxExclusive = ''{1}''.
- maxInclusive-valid-restriction.1 = maxInclusive-valid-restriction.1: Erro do tipo ''{2}''. O valor maxInclusive =''{0}'' deve ser <= maxInclusive do tipo de base ''{1}''.
- maxInclusive-valid-restriction.2 = maxInclusive-valid-restriction.2: Erro do tipo ''{2}''. O valor maxInclusive =''{0}'' deve ser <= maxExclusive do tipo de base ''{1}''.
- maxInclusive-valid-restriction.3 = maxInclusive-valid-restriction.3: Erro do tipo ''{2}''. O valor maxInclusive =''{0}'' deve ser > = minInclusive do tipo de base ''{1}''.
- maxInclusive-valid-restriction.4 = maxInclusive-valid-restriction.4: Erro do tipo ''{2}''. O valor maxInclusive =''{0}'' deve ser > minInclusive do tipo de base ''{1}''.
- maxLength-valid-restriction = maxLength-valid-restriction: Na defini\u00E7\u00E3o de {2}, o valor maxLength = ''{0}'' deve ser <= que o do tipo de base ''{1}''.
- mg-props-correct.2 = mg-props-correct.2: Defini\u00E7\u00F5es circulares detectadas para o grupo ''{0}''. Seguir de forma recursiva dos valores de '{'term'}' das part\u00EDculas conduz a uma part\u00EDcula cujo '{'term'}' \u00E9 o pr\u00F3prio grupo.
- minExclusive-less-than-equal-to-maxExclusive = minExclusive-less-than-equal-to-maxExclusive: Na defini\u00E7\u00E3o de {2}, o valor minExclusive = ''{0}'' deve ser <= que o valor maxExclusive = ''{1}''.
- minExclusive-less-than-maxInclusive = minExclusive-less-than-maxInclusive: Na defini\u00E7\u00E3o de {2}, o valor minExclusive = ''{0}'' deve ser <= que o valor maxInclusive = ''{1}''.
- minExclusive-valid-restriction.1 = minExclusive-valid-restriction.1: Erro do tipo ''{2}''. O valor minExclusive =''{0}'' deve ser >= minExclusive do tipo de base ''{1}''.
- minExclusive-valid-restriction.2 = minExclusive-valid-restriction.2: Erro do tipo ''{2}''. O valor minExclusive =''{0}'' deve ser <= maxExclusive do tipo de base ''{1}''.
- minExclusive-valid-restriction.3 = minExclusive-valid-restriction.3: Erro do tipo ''{2}''. O valor minExclusive =''{0}'' deve ser >= minInclusive do tipo de base ''{1}''.
- minExclusive-valid-restriction.4 = minExclusive-valid-restriction.4: Erro do tipo ''{2}''. O valor minExclusive =''{0}'' deve ser < maxExclusive do tipo de base ''{1}''.
- minInclusive-less-than-equal-to-maxInclusive = minInclusive-less-than-equal-to-maxInclusive: Na defini\u00E7\u00E3o de {2}, o valor minInclusive = ''{0}'' deve ser <= que o valor maxInclusive = ''{1}''.
- minInclusive-less-than-maxExclusive = minInclusive-less-than-maxExclusive: Na defini\u00E7\u00E3o de {2}, o valor minInclusive = ''{0}'' deve ser <= que o valor maxExclusive = ''{1}''.
- minInclusive-minExclusive = minInclusive-minExclusive: \u00C9 um erro para que minInclusive e minExclusive sejam especificados para o mesmo tipo de dados. Em {2}, minInclusive = ''{0}'' e minExclusive = ''{1}''.
- minInclusive-valid-restriction.1 = minInclusive-valid-restriction.1: Erro do tipo ''{2}''. O valor minInclusive =''{0}'' deve ser >= minInclusive do tipo de base ''{1}''.
- minInclusive-valid-restriction.2 = minInclusive-valid-restriction.2: Erro do tipo ''{2}''. O valor minInclusive =''{0}'' deve ser <= maxInclusive do tipo de base ''{1}''.
- minInclusive-valid-restriction.3 = minInclusive-valid-restriction.3: Erro do tipo ''{2}''. O valor minInclusive =''{0}'' deve ser > minExclusive do tipo de base ''{1}''.
- minInclusive-valid-restriction.4 = minInclusive-valid-restriction.4: Erro do tipo ''{2}''. O valor minInclusive =''{0}'' deve ser <= maxExclusive do tipo de base ''{1}''.
- minLength-less-than-equal-to-maxLength = minLength-less-than-equal-to-maxLength: Na defini\u00E7\u00E3o de {2}, o valor minLength = ''{0}'' deve ser < o valor de maxLength = ''{1}''.
- minLength-valid-restriction = minLength-valid-restriction: Na defini\u00E7\u00E3o de {2}, minLength = ''{0}'' deve ser >= que o do tipo de base ''{1}''.
- no-xmlns = no-xmlns: O {name} de uma declara\u00E7\u00E3o de atributo n\u00E3o deve corresponder a 'xmlns'.
- no-xsi = no-xsi: O "{"target namespace"}" de uma declara\u00E7\u00E3o do atributo n\u00E3o deve corresponder a ''{0}''.
- p-props-correct.2.1 = p-props-correct.2.1: Na declara\u00E7\u00E3o de ''{0}'', o valor de ''minOccurs'' \u00E9 ''{1}'', mas n\u00E3o deve ser maior que o valor de ''maxOccurs'', que \u00E9 ''{2}''.
- rcase-MapAndSum.1 = rcase-MapAndSum.1: N\u00E3o h\u00E1 um mapeamento funcional completo entre as part\u00EDculas.
- rcase-MapAndSum.2 = rcase-MapAndSum.2: A faixa de ocorr\u00EAncia do grupo, ({0},{1}), n\u00E3o \u00E9 uma restri\u00E7\u00E3o v\u00E1lida da faixa de ocorr\u00EAncia do grupo base, ({2},{3}).
- rcase-NameAndTypeOK.1 = rcase-NameAndTypeOK.1: Os elementos t\u00EAm nomes e namespaces de destino que n\u00E3o s\u00E3o iguais: Elemento ''{0}'' no namespace ''{1}'' e elemento ''{2}'' no namespace ''{3}''.
- rcase-NameAndTypeOK.2 = rcase-NameAndTypeOK.2: Erro da part\u00EDcula cujo "{"term"}" \u00E9 a declara\u00E7\u00E3o do elemento ''{0}''. O "{"nillable"}" da declara\u00E7\u00E3o do elemento \u00E9 verdadeiro, mas a part\u00EDcula correspondente no tipo de base tem uma declara\u00E7\u00E3o de elemento cujo "{"nillable"}" \u00E9 falso.
- rcase-NameAndTypeOK.3 = rcase-NameAndTypeOK.3: Erro da part\u00EDcula cujo "{"term"}" \u00E9 a declara\u00E7\u00E3o do elemento ''{0}''. Sua faixa de ocorr\u00EAncia, ({1},{2}) n\u00E3o \u00E9 uma restri\u00E7\u00E3o v\u00E1lida da faixa, ({3},{4} da part\u00EDcula correspondente no tipo de base.
- rcase-NameAndTypeOK.4.a = rcase-NameAndTypeOK.4.a: O elemento ''{0}'' n\u00E3o est\u00E1 fixado, mas o elemento correspondente no tipo de base est\u00E1 fixado com o valor ''{1}''.
- rcase-NameAndTypeOK.4.b = rcase-NameAndTypeOK.4.b: O elemento ''{0}'' est\u00E1 fixado com o valor ''{1}'', mas o elemento correspondente no tipo de base est\u00E1 fixado com o valor ''{2}''.
- rcase-NameAndTypeOK.5 = rcase-NameAndTypeOK.5: Restri\u00E7\u00F5es de identidade do elemento ''{0}'' n\u00E3o s\u00E3o subconjuntos daquelas da base.
- rcase-NameAndTypeOK.6 = rcase-NameAndTypeOK.6: As substitui\u00E7\u00F5es n\u00E3o permitidas do elemento ''{0}'' n\u00E3o s\u00E3o um superconjunto daquelas da base.
- rcase-NameAndTypeOK.7 = rcase-NameAndTypeOK.7: O tipo de elemento ''{0}'', ''{1}'' n\u00E3o \u00E9 obtido do tipo de elemento base ''{2}''.
- rcase-NSCompat.1 = rcase-NSCompat.1: O elemento ''{0}'' tem um namespace ''{1}'' que n\u00E3o \u00E9 permitido pelo curinga na base.
- rcase-NSCompat.2 = rcase-NSCompat.2: Erro da part\u00EDcula cujo "{"term"}" \u00E9 a declara\u00E7\u00E3o do elemento ''{0}''. Sua faixa de ocorr\u00EAncia, ({1},{2}), n\u00E3o \u00E9 uma restri\u00E7\u00E3o v\u00E1lida da faixa, ({3},{4}, da part\u00EDcula correspondente no tipo de base.
- rcase-NSRecurseCheckCardinality.1 = rcase-NSRecurseCheckCardinality.1: N\u00E3o h\u00E1 um mapeamento funcional completo entre as part\u00EDculas.
- rcase-NSRecurseCheckCardinality.2 = rcase-NSRecurseCheckCardinality.2: A faixa de ocorr\u00EAncias do grupo, ({0},{1}), n\u00E3o \u00E9 uma restri\u00E7\u00E3o v\u00E1lida da faixa de curingas base, ({2},{3}).
- rcase-NSSubset.1 = rcase-NSSubset.1: Curinga n\u00E3o \u00E9 um subconjunto de curingas correspondente na base.
- rcase-NSSubset.2 = rcase-NSSubset.2: A faixa de ocorr\u00EAncias de curinga, ({0},{1}), n\u00E3o \u00E9 uma restri\u00E7\u00E3o v\u00E1lida daquela da base, ({2},{3}),.
- rcase-NSSubset.3 = rcase-NSSubset.3: O conte\u00FAdo do processo do curinga, ''{0}'', \u00E9 mais fraco que aquele da base, ''{1}''.
- rcase-Recurse.1 = rcase-Recurse.1: A faixa de ocorr\u00EAncia do grupo, ({0},{1}), n\u00E3o \u00E9 uma restri\u00E7\u00E3o v\u00E1lida da faixa de ocorr\u00EAncia do grupo base, ({2},{3}).
- rcase-Recurse.2 = rcase-Recurse.2: N\u00E3o h\u00E1 um mapeamento funcional completo entre as part\u00EDculas.
- rcase-RecurseLax.1 = rcase-RecurseLax.1: A faixa de ocorr\u00EAncias do grupo, ({0},{1}), n\u00E3o \u00E9 uma restri\u00E7\u00E3o v\u00E1lida da faixa de ocorr\u00EAncias do grupo base, ({2},{3}).
- rcase-RecurseLax.2 = rcase-RecurseLax.2: N\u00E3o h\u00E1 um mapeamento funcional completo entre as part\u00EDculas.
- rcase-RecurseUnordered.1 = rcase-RecurseUnordered.1: A faixa de ocorr\u00EAncias do grupo, ({0},{1}), n\u00E3o \u00E9 uma restri\u00E7\u00E3o v\u00E1lida da faixa de ocorr\u00EAncias do grupo base, ({2},{3}).
- rcase-RecurseUnordered.2 = rcase-RecurseUnordered.2: N\u00E3o h\u00E1 um mapeamento funcional completo entre as part\u00EDculas.
-# We're using sch-props-correct.2 instead of the old src-redefine.1
-# src-redefine.1 = src-redefine.1: The component ''{0}'' is begin redefined, but its corresponding component isn't in the schema document being redefined (with namespace ''{2}''), but in a different document, with namespace ''{1}''.
- sch-props-correct.2 = sch-props-correct.2: Um esquema n\u00E3o pode conter dois componentes globais com o mesmo nome; este esquema cont\u00E9m duas ocorr\u00EAncias de ''{0}''.
- st-props-correct.2 = st-props-correct.2: Defini\u00E7\u00F5es circulares detectadas para o tipo simples {0}''. Isso significa que ''{0}'' est\u00E1 contido em sua pr\u00F3pria hierarquia de tipo, o que \u00E9 um erro.
- st-props-correct.3 = st-props-correct.3: Erro do tipo ''{0}''. O valor de '{'final'}' da '{'base type definition'}', ''{1}'', pro\u00EDbe a obten\u00E7\u00E3o por restri\u00E7\u00E3o.
- totalDigits-valid-restriction = totalDigits-valid-restriction: Na defini\u00E7\u00E3o de {2}, o valor ''{0}'' do "totalDigits"'' do aspecto \u00E9 inv\u00E1lido porque ele deve ser <= ao valor de ''totalDigits", que foi definido como ''{1}'' em um dos tipos de ancestrais.
- whiteSpace-valid-restriction.1 = whiteSpace-valid-restriction.1: Na defini\u00E7\u00E3o de {0}, o valor ''{1}'' do aspecto ''whitespace'' \u00E9 inv\u00E1lido porque o valor para ''whitespace'' foi definido como ''colapse'' em um dos tipos de ancestrais.
- whiteSpace-valid-restriction.2 = whiteSpace-valid-restriction.2: Na defini\u00E7\u00E3o de {0}, o valor do aspecto ''preserve'' \u00E9 inv\u00E1lido para o aspecto "whitespace" porque o valor para ''whitespace'' foi definido como ''replace'' em um dos tipos de ancestrais.
-
-#schema for Schemas
-
- s4s-att-invalid-value = s4s-att-invalid-value: Valor de atributo inv\u00E1lido para ''{1}'' no elemento''{0}''. Motivo gravado: {2}
- s4s-att-must-appear = s4s-att-must-appear: O atributo ''{1}'' deve aparecer no elemento ''{0}''.
- s4s-att-not-allowed = s4s-att-not-allowed: O atributo ''{1}'' n\u00E3o pode aparecer no elemento ''{0}''.
- s4s-elt-invalid = s4s-elt-invalid: O elemento ''{0}'' n\u00E3o \u00E9 um elemento v\u00E1lido em um documento do esquema.
- s4s-elt-must-match.1 = s4s-elt-must-match.1: O conte\u00FAdo de ''{0}'' deve corresponder a {1}. Foi detectado um problema come\u00E7ando em: {2}.
- s4s-elt-must-match.2 = s4s-elt-must-match.2: O conte\u00FAdo de ''{0}'' deve corresponder a {1}. N\u00E3o foram encontrados elementos suficientes.
- # the "invalid-content" messages provide less information than the "must-match" counterparts above. They're used for complex types when providing a "match" would be an information dump
- s4s-elt-invalid-content.1 = s4s-elt-invalid-content.1: O conte\u00FAdo de ''{0}'' \u00E9 inv\u00E1lido. O elemento ''{1}'' \u00E9 inv\u00E1lido, mal posicionado ou ocorre com muita frequ\u00EAncia.
- s4s-elt-invalid-content.2 = s4s-elt-invalid-content.2: O conte\u00FAdo de ''{0}'' \u00E9 inv\u00E1lido. O elemento ''{1}'' n\u00E3o pode ficar vazio.
- s4s-elt-invalid-content.3 = s4s-elt-invalid-content.3: Os elementos do tipo ''{0}'' n\u00E3o podem aparecer ap\u00F3s as declara\u00E7\u00F5es como filhos de um elemento de <schema>.
- s4s-elt-schema-ns = s4s-elt-schema-ns: O namespace do elemento ''{0}'' deve ser do namespace do esquema, ''http://www.w3.org/2001/XMLSchema''.
- s4s-elt-character = s4s-elt-character: N\u00E3o s\u00E3o permitidos caracteres sem espa\u00E7o em branco nos elementos do esquema diferentes de ''xs:appinfo'' e ''xs:documentation''. Verificado ''{0}''.
-
-# codes not defined by the spec
-
- c-fields-xpaths = c-fields-xpaths: O valor do campo = ''{0}'' n\u00E3o \u00E9 v\u00E1lido.
- c-general-xpath = c-general-xpath: A express\u00E3o ''{0}'' n\u00E3o \u00E9 v\u00E1lida em rela\u00E7\u00E3o ao subconjunto de XPath suportado pelo Esquema XML.
- c-general-xpath-ns = c-general-xpath-ns: Um prefixo de namespace na express\u00E3o de XPath ''{0}'' n\u00E3o foi associado a um namespace.
- c-selector-xpath = c-selector-xpath: O valor do seletor = ''{0}'' n\u00E3o \u00E9 v\u00E1lido; os xpaths do seletor n\u00E3o podem conter atributos.
- EmptyTargetNamespace = EmptyTargetNamespace: No documento do esquema ''{0}'', o valor do atributo ''targetNamespace'' n\u00E3o pode ser uma string vazia.
- FacetValueFromBase = FacetValueFromBase: Na declara\u00E7\u00E3o do tipo ''{0}'', o valor ''{1}'' do aspecto ''{2}'' deve ser proveniente do espa\u00E7o de valor do tipo de base, ''{3}''.
- FixedFacetValue = FixedFacetValue: Na defini\u00E7\u00E3o de {3}, o valor ''{1}'' do aspecto ''{0}'' \u00E9 inv\u00E1lido porque o valor de ''{0}'' foi enviado para ''{2}'' em um dos tipos de ancestrais e '{'fixed'}' = true.
- InvalidRegex = InvalidRegex: O valor do padr\u00E3o ''{0}'' n\u00E3o \u00E9 uma express\u00E3o regular v\u00E1lida. O erro reportado foi: ''{1}'' na coluna ''{2}''.
- MaxOccurLimit = A configura\u00E7\u00E3o atual do parser n\u00E3o permite que o valor de um atributo maxOccurs seja definido como maior que o valor {0}.
- PublicSystemOnNotation = PublicSystemOnNotation: Pelo menos ''public'' e ''system'' devem aparecer no elemento ''notation''.
- SchemaLocation = SchemaLocation: schemaLocation value = ''{0}''deve ter n\u00FAmero par de URIs.
- TargetNamespace.1 = TargetNamespace.1: Esperava o namespace ''{0}'', mas o namespace de destino do documento do esquema \u00E9 ''{1}''.
- TargetNamespace.2 = TargetNamespace.2: Exceto no namespace, mas o documento do esquema tem um namespace de destino ''{1}''.
- UndeclaredEntity = UndeclaredEntity: A entidade ''{0}'' n\u00E3o foi declarada.
- UndeclaredPrefix = UndeclaredPrefix: N\u00E3o \u00E9 poss\u00EDvel resolver ''{0}'' como um QName: o prefixo ''{1}'' n\u00E3o foi declarado.
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_sv.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_sv.properties
deleted file mode 100644
index ffe9d79..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_sv.properties
+++ /dev/null
@@ -1,291 +0,0 @@
-# This file contains error and warning messages related to XML Schema
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
- BadMessageKey = Hittar inte felmeddelandet som motsvarar meddelandenyckeln.
- FormatFailed = Ett internt fel intr\u00E4ffade vid formatering av f\u00F6ljande meddelande:\n
-
-# For internal use
-
- Internal-Error = Internt fel: {0}.
- dt-whitespace = Aspektv\u00E4rde f\u00F6r blanktecken \u00E4r inte tillg\u00E4ngligt f\u00F6r simpleType ''{0}'' med union
- GrammarConflict = Genererad grammatik fr\u00E5n anv\u00E4ndarens grammatikpool strider mot annan grammatik.
-
-# Identity constraints
-
- AbsentKeyValue = Fel vid id-begr\u00E4nsning (cvc-identity-constraint.4.2.1): elementet "{0}" har en nyckel som saknar v\u00E4rde.
- DuplicateField = Dubblettmatchning inom omfattningen av f\u00E4ltet "{0}".
- DuplicateKey = Duplicerat nyckelv\u00E4rde [{0}] har deklarerats f\u00F6r id-begr\u00E4nsning av elementet "{1}".
- DuplicateUnique = Duplicerat unikt v\u00E4rde [{0}] har deklarerats f\u00F6r id-begr\u00E4nsning av elementet "{1}".
- FieldMultipleMatch = Fel vid id-begr\u00E4nsning: f\u00E4ltet "{0}" matchar fler \u00E4n ett v\u00E4rde inom omfattningen av v\u00E4ljaren; f\u00E4lt m\u00E5ste matcha unika v\u00E4rden.
- FixedDiffersFromActual = Elementets inneh\u00E5ll motsvarar inte v\u00E4rdet av attributet som anges som "fixed" i elementdeklarationen i schemat.
- KeyMatchesNillable = Fel vid id-begr\u00E4nsning (cvc-identity-constraint.4.2.3): elementet "{0}" har en nyckel som matchar ett element med nullbart v\u00E4rde angivet som true.
- KeyNotEnoughValues = Det finns inte tillr\u00E4ckligt m\u00E5nga v\u00E4rden angivna f\u00F6r <key name="{1}"> som id-begr\u00E4nsning f\u00F6r elementet "{0}".
- KeyNotFound = Nyckeln ''{0}'' med v\u00E4rdet ''{1}'' hittades inte f\u00F6r id-begr\u00E4nsning f\u00F6r element ''{2}''.
- KeyRefNotEnoughValues = Det finns inte tillr\u00E4ckligt m\u00E5nga v\u00E4rden angivna f\u00F6r <keyref name="{1}"> som id-begr\u00E4nsning f\u00F6r elementet "{0}".
- KeyRefOutOfScope = Fel vid id-begr\u00E4nsning: id-begr\u00E4nsning "{0}" har en nyckelreferens som refererar till nyckel eller unikt v\u00E4rde utanf\u00F6r definitionsomr\u00E5det.
- KeyRefReferNotFound = Nyckelreferensdeklarationen "{0}" refererar till ok\u00E4nd nyckel med namnet "{1}".
- UniqueNotEnoughValues = Det finns inte tillr\u00E4ckligt m\u00E5nga v\u00E4rden angivna f\u00F6r <unique> som id-begr\u00E4nsning f\u00F6r elementet "{0}".
- UnknownField = Fel vid intern id-begr\u00E4nsning; ok\u00E4nt f\u00E4lt "{0}".
-
-# Ideally, we should only use the following error keys, not the ones under
-# "Identity constraints". And we should cover all of the following errors.
-
-#validation (3.X.4)
-
- cvc-attribute.3 = cvc-attribute.3: V\u00E4rdet ''{2}'' f\u00F6r attributet ''{1}'' i elementet ''{0}'' har ogiltig typ, ''{3}''.
- cvc-attribute.4 = cvc-attribute.4: V\u00E4rdet ''{2}'' f\u00F6r attributet ''{1}'' i elementet ''{0}'' har ogiltig fast '{'v\u00E4rdebegr\u00E4nsning'}'. Attributet m\u00E5ste ha v\u00E4rdet ''{3}''.
- cvc-complex-type.2.1 = cvc-complex-type.2.1: Elementet ''{0}'' f\u00E5r inte ha [underordnade] objekt med tecken- eller elementinformation, eftersom inneh\u00E5llstyp \u00E4r tomt.
- cvc-complex-type.2.2 = cvc-complex-type.2.2: Elementet ''{0}'' f\u00E5r inte ha [underordnade] element och v\u00E4rdet m\u00E5ste vara giltigt.
- cvc-complex-type.2.3 = cvc-complex-type.2.3: Elementet ''{0}'' f\u00E5r inte ha [underordnade] tecken, eftersom inneh\u00E5llstyp \u00E4r endast element.
- cvc-complex-type.2.4.a = cvc-complex-type.2.4.a: Ogiltigt inneh\u00E5ll hittades med b\u00F6rjan med elementet ''{0}''. N\u00E5got av ''{1}'' f\u00F6rv\u00E4ntas.
- cvc-complex-type.2.4.b = cvc-complex-type.2.4.b: Inneh\u00E5llet i elementet ''{0}'' \u00E4r inte fullst\u00E4ndigt. N\u00E5got av ''{1}'' f\u00F6rv\u00E4ntas.
- cvc-complex-type.2.4.c = cvc-complex-type.2.4.c: Matchningen av jokertecken \u00E4r strikt, men ingen deklaration hittades f\u00F6r elementet ''{0}''.
- cvc-complex-type.2.4.d = cvc-complex-type.2.4.d: Ogiltigt inneh\u00E5ll hittades med b\u00F6rjan med elementet ''{0}''. Inget underordnat element f\u00F6rv\u00E4ntas i det h\u00E4r skedet.
- cvc-complex-type.2.4.e = cvc-complex-type.2.4.d: Ogiltigt inneh\u00E5ll hittades med b\u00F6rjan med elementet ''{0}''. Det underordnade elementet ''{1}'' f\u00F6rv\u00E4ntas i det h\u00E4r skedet.
- cvc-complex-type.3.1 = cvc-complex-type.3.1: V\u00E4rdet ''{2}'' f\u00F6r attributet ''{1}'' i elementet ''{0}'' \u00E4r inte giltigt med motsvarande attributanv\u00E4ndning. Attributet ''{1}'' har det fasta v\u00E4rdet ''{3}''.
- cvc-complex-type.3.2.1 = cvc-complex-type.3.2.1: Elementet ''{0}'' saknar attributjokertecken f\u00F6r attributet ''{1}''.
- cvc-complex-type.3.2.2 = cvc-complex-type.3.2.2: Attributet ''{1}'' \u00E4r inte till\u00E5tet i elementet ''{0}''.
- cvc-complex-type.4 = cvc-complex-type.4: Attributet ''{1}'' m\u00E5ste anger i elementet ''{0}''.
- cvc-complex-type.5.1 = cvc-complex-type.5.1: I elementet ''{0}'' \u00E4r attributet ''{1}'' ett joker-id. Joker-id ''{2}'' finns redan och endast ett id kan anv\u00E4ndas.
- cvc-complex-type.5.2 = cvc-complex-type.5.2: I elementet ''{0}'' \u00E4r attributet ''{1}'' ett joker-id. Det finns redan ett attribut ''{2}'' som tas fr\u00E5n id bland '{'attributanv\u00E4ndningar'}'.
- cvc-datatype-valid.1.2.1 = cvc-datatype-valid.1.2.1: ''{0}'' \u00E4r inte n\u00E5got giltigt v\u00E4rde f\u00F6r ''{1}''.
- cvc-datatype-valid.1.2.2 = cvc-datatype-valid.1.2.2: ''{0}'' \u00E4r inte n\u00E5got giltigt v\u00E4rde f\u00F6r listtyp ''{1}''.
- cvc-datatype-valid.1.2.3 = cvc-datatype-valid.1.2.3: ''{0}'' \u00E4r inte n\u00E5got giltigt v\u00E4rde f\u00F6r uniontyp ''{1}''.
- cvc-elt.1 = cvc-elt.1: Kan inte hitta deklarationen f\u00F6r elementet ''{0}''.
- cvc-elt.2 = cvc-elt.2: V\u00E4rdet f\u00F6r '{'abstrakt'}' i elementdeklarationen f\u00F6r ''{0}'' m\u00E5ste anges som false.
- cvc-elt.3.1 = cvc-elt.3.1: Attributet ''{1}'' f\u00E5r inte anges i elementet ''{0}'', eftersom '{'nullbar'}' egenskap f\u00F6r ''{0}'' har angetts som false.
- cvc-elt.3.2.1 = cvc-elt.3.2.1: Elementet ''{0}'' f\u00E5r inte inneh\u00E5lla [underordnade] med tecken- eller elementinformation eftersom ''{1}'' har angetts.
- cvc-elt.3.2.2 = cvc-elt.3.2.2: Det f\u00E5r inte finnas n\u00E5gon fast '{'v\u00E4rdebegr\u00E4nsning'}' f\u00F6r elementet ''{0}'' eftersom ''{1}'' har angetts.
- cvc-elt.4.1 = cvc-elt.4.1: V\u00E4rdet ''{2}'' f\u00F6r attributet ''{1}'' i elementet ''{0}'' \u00E4r inte n\u00E5got giltigt QName.
- cvc-elt.4.2 = cvc-elt.4.2: Kan inte matcha ''{1}'' med typdefinition f\u00F6r elementet ''{0}''.
- cvc-elt.4.3 = cvc-elt.4.3: Typ ''{1}'' \u00E4r inte giltigt att tas fr\u00E5n typdefinitionen ''{2}'' i elementet ''{0}''.
- cvc-elt.5.1.1 = cvc-elt.5.1.1: '{'v\u00E4rdebegr\u00E4nsning'}' ''{2}'' i elementet ''{0}'' \u00E4r inte n\u00E5got giltigt standardv\u00E4rde f\u00F6r typ ''{1}''.
- cvc-elt.5.2.2.1 = cvc-elt.5.2.2.1: Elementet ''{0}'' f\u00E5r inte ha [underordnade] objekt med elementinformation.
- cvc-elt.5.2.2.2.1 = cvc-elt.5.2.2.2.1: V\u00E4rdet ''{1}'' i elementet ''{0}'' matchar inte v\u00E4rdet med fast '{'v\u00E4rdebegr\u00E4nsning'}', ''{2}''.
- cvc-elt.5.2.2.2.2 = cvc-elt.5.2.2.2.2: V\u00E4rdet ''{1}'' i elementet ''{0}'' matchar inte v\u00E4rdet med '{'v\u00E4rdebegr\u00E4nsning'}', ''{2}''.
- cvc-enumeration-valid = cvc-enumeration-valid: V\u00E4rdet ''{0}'' \u00E4r ogiltigt med aktuell uppr\u00E4kning ''{1}''. V\u00E4rdet m\u00E5ste ing\u00E5 i uppr\u00E4kningen.
- cvc-fractionDigits-valid = cvc-fractionDigits-valid: V\u00E4rdet ''{0}'' har {1} br\u00E5ktalssiffror, men antalet br\u00E5ktalssiffror \u00E4r begr\u00E4nsat till {2}.
- cvc-id.1 = cvc-id.1: Det finns ingen ID/IDREF-bindning f\u00F6r IDREF ''{0}''.
- cvc-id.2 = cvc-id.2: Det finns flera f\u00F6rekomster av id-v\u00E4rdet ''{0}''.
- cvc-id.3 = cvc-id.3: Ett f\u00E4lt med id-begr\u00E4nsning ''{0}'' matchade elementet ''{1}'', men elementet saknar enkel typ.
- cvc-length-valid = cvc-length-valid: V\u00E4rdet ''{0}'' med l\u00E4ngd = ''{1}'' \u00E4r ogiltigt med den aktuella l\u00E4ngden ''{2}'' f\u00F6r typ ''{3}''.
- cvc-maxExclusive-valid = cvc-maxExclusive-valid: V\u00E4rdet ''{0}'' \u00E4r ogiltigt med aktuellt maxExclusive ''{1}'' f\u00F6r typ ''{2}''.
- cvc-maxInclusive-valid = cvc-maxInclusive-valid: V\u00E4rdet ''{0}'' \u00E4r ogiltigt med aktuellt maxInclusive ''{1}'' f\u00F6r typ ''{2}''.
- cvc-maxLength-valid = cvc-maxLength-valid: V\u00E4rdet ''{0}'' med l\u00E4ngd = ''{1}'' \u00E4r ogiltigt med aktuellt maxLength ''{2}'' f\u00F6r typ ''{3}''.
- cvc-minExclusive-valid = cvc-minExclusive-valid: V\u00E4rdet ''{0}'' \u00E4r ogiltigt med aktuellt minExclusive ''{1}'' f\u00F6r typ ''{2}''.
- cvc-minInclusive-valid = cvc-minInclusive-valid: V\u00E4rdet ''{0}'' \u00E4r ogiltigt med aktuellt minInclusive ''{1}'' f\u00F6r typ ''{2}''.
- cvc-minLength-valid = cvc-minLength-valid: V\u00E4rdet ''{0}'' med l\u00E4ngd = ''{1}'' \u00E4r ogiltigt med aktuellt minLength ''{2}'' f\u00F6r typ ''{3}''.
- cvc-pattern-valid = cvc-pattern-valid: V\u00E4rdet ''{0}'' \u00E4r ogiltigt med aktuellt m\u00F6nster ''{1}'' f\u00F6r typ ''{2}''.
- cvc-totalDigits-valid = cvc-totalDigits-valid: V\u00E4rdet ''{0}'' har {1} siffror, men det totala antalet siffror \u00E4r begr\u00E4nsat till {2}.
- cvc-type.2 = cvc-type.2: Typdefinitionen kan inte vara abstrakt f\u00F6r elementet {0}.
- cvc-type.3.1.1 = cvc-type.3.1.1: Elementet ''{0}'' har enkel typ och kan inte inneh\u00E5lla attribut, ut\u00F6ver s\u00E5dana vars namnrymd \u00E4r identisk med ''http://www.w3.org/2001/XMLSchema-instance'' och vars [lokala namn] har n\u00E5gotdera av ''type'', ''nil'', ''schemaLocation'' eller ''noNamespaceSchemaLocation''. Hittade dock attributet ''{1}''.
- cvc-type.3.1.2 = cvc-type.3.1.2: Elementet ''{0}'' har enkel typ och f\u00E5r inte inneh\u00E5lla [underordnade] med elementinformation.
- cvc-type.3.1.3 = cvc-type.3.1.3: V\u00E4rdet ''{1}'' i elementet ''{0}'' \u00E4r ogiltigt.
-
-#schema valid (3.X.3)
-
- schema_reference.access = schema_reference: Kunde inte l\u00E4sa schemadokumentet ''{0}'' eftersom ''{1}''-\u00E5tkomst inte till\u00E5ts p\u00E5 grund av begr\u00E4nsning som anges av egenskapen accessExternalSchema.
- schema_reference.4 = schema_reference.4: L\u00E4sning av schemadokument ''{0}'' utf\u00F6rdes inte p\u00E5 grund av 1) det g\u00E5r inte att hitta dokumentet; 2) det g\u00E5r inte att l\u00E4sa dokumentet; 3) dokumentets rotelement \u00E4r inte <xsd:schema>.
- src-annotation = src-annotation: element f\u00F6r <anteckningar> f\u00E5r endast inneh\u00E5lla element f\u00F6r <appinfo> och <dokumentation>, men ''{0}'' hittades.
- src-attribute.1 = src-attribute.1: B\u00E5da egenskaperna ''default'' och ''fixed'' kan inte samtidigt ing\u00E5 i attributdeklarationen ''{0}''. Anv\u00E4nd en av dem.
- src-attribute.2 = src-attribute.2: Egenskapen ''default'' finns med i attributet ''{0}'', vilket inneb\u00E4r att v\u00E4rdet f\u00F6r ''use'' m\u00E5ste vara ''optional''.
- src-attribute.3.1 = src-attribute.3.1: Antingen 'ref' eller 'name' m\u00E5ste finnas med i lokal attributdeklaration.
- src-attribute.3.2 = src-attribute.3.2: Inneh\u00E5llet m\u00E5ste matcha (annotation?) f\u00F6r attributreferens ''{0}''.
- src-attribute.4 = src-attribute.4: Attributet ''{0}'' har b\u00E5de ett ''typ''-attribut och en anonym ''simpleType''-underordnad. Endast ett av dessa till\u00E5ts som attribut.
- src-attribute_group.2 = src-attribute_group.2: Snittet mellan jokertecken kan inte uttryckas f\u00F6r attributgruppen ''{0}''.
- src-attribute_group.3 = src-attribute_group.3: Cirkul\u00E4ra definitioner har identifierats f\u00F6r attributgruppen ''{0}''. Rekursivt efterf\u00F6ljande attributgruppreferenser leder s\u00E5 sm\u00E5ningom tillbaka till sig sj\u00E4lv.
- src-ct.1 = src-ct.1: Fel intr\u00E4ffade vid representationen av definition f\u00F6r typ ''{0}''. Om <complexContent> anv\u00E4nds m\u00E5ste bastyp vara complexType. ''{1}'' \u00E4r simpleType.
- src-ct.2.1 = src-ct.2.1: Fel intr\u00E4ffade vid representationen av definition f\u00F6r typ ''{0}''. Om <simpleContent> anv\u00E4nds m\u00E5ste bastyp vara complexType vars inneh\u00E5ll \u00E4r enkelt, eller, om det finns en angiven begr\u00E4nsning, komplex typ med blandat inneh\u00E5ll och t\u00F6mningsbar partikel, eller, om det finns ett angivet till\u00E4gg, enkel typ. ''{1}'' uppfyller inget av dessa villkor.
- src-ct.2.2 = src-ct.2.2: Fel intr\u00E4ffade vid representationen av definition f\u00F6r typ ''{0}''. Om complexType med simpleContent begr\u00E4nsar complexType med blandat inneh\u00E5ll och t\u00F6mningsbar partikel m\u00E5ste det finnas en <simpleType> bland underordnade i <restriction>.
- src-ct.4 = src-ct.4: Fel intr\u00E4ffade vid representationen av definition f\u00F6r typ ''{0}''. Snittet mellan jokertecken kan inte uttryckas.
- src-ct.5 = src-ct.5: Fel intr\u00E4ffade vid representationen av definition f\u00F6r typ ''{0}''. Unionen mellan jokertecken kan inte uttryckas.
- src-element.1 = src-element.1: B\u00E5da egenskaperna ''default'' och ''fixed'' kan inte samtidigt ing\u00E5 i elementdeklarationen ''{0}''. Anv\u00E4nd en av dem.
- src-element.2.1 = src-element.2.1: Antingen 'ref' eller 'name' m\u00E5ste anges i den lokala elementdeklarationen.
- src-element.2.2 = src-element.2.2: Eftersom ''{0}'' inneh\u00E5ller ett ''ref''-attribut m\u00E5ste inneh\u00E5llet matcha (annotation?). ''{1}'' hittades dock inte.
- src-element.3 = src-element.3: Elementet ''{0}'' inneh\u00E5ller b\u00E5de ''type''-attribut och underordnat ''anonymous type''. Endast ett av dessa \u00E4r till\u00E5tet i ett element.
- src-import.1.1 = src-import.1.1: Namnrymdsattributet ''{0}'' i ett objekt med elementinformation f\u00F6r <import> f\u00E5r inte vara samma som targetNamespace i det schema som det ing\u00E5r i.
- src-import.1.2 = src-import.1.2: Om namnrymdsattributet inte finns med i ett objekt med elementinformation f\u00F6r <import> m\u00E5ste omslutande schema ha ett angivet targetNamespace.
- src-import.2 = src-import.2: Rotelementet f\u00F6r dokumentet ''{0}'' m\u00E5ste ha namnrymdsnamnet ''http://www.w3.org/2001/XMLSchema'' och det lokala namnet ''schema''.
- src-import.3.1 = src-import.3.1: Namnrymdsattributet ''{0}'' f\u00F6r ett objekt med elementinformation f\u00F6r <import> m\u00E5ste vara identiskt med targetNamespace-attributet ''{1}'' i det importerade dokumentet.
- src-import.3.2 = src-import.3.2: Ett objekt med elementinformation f\u00F6r <import> som saknade namnrymdsattribut hittades och d\u00E4rf\u00F6r kan importerat dokument inte anv\u00E4ndas med attributet targetNamespace. targetNamespace ''{1}'' hittades dock i importerat dokument.
- src-include.1 = src-include.1: Rotelementet f\u00F6r dokumentet ''{0}'' m\u00E5ste ha namnrymdsnamnet ''http://www.w3.org/2001/XMLSchema'' och det lokala namnet ''schema''.
- src-include.2.1 = src-include.2.1: targetNamespace f\u00F6r refererat schema, f\u00F6r n\u00E4rvarande ''{1}'', m\u00E5ste vara identiskt med motsvarande i inkluderat schema, f\u00F6r n\u00E4rvarande ''{0}''.
- src-redefine.2 = src-redefine.2: Rotelementet f\u00F6r dokumentet ''{0}'' m\u00E5ste ha namnrymdsnamnet ''http://www.w3.org/2001/XMLSchema'' och det lokala namnet ''schema''.
- src-redefine.3.1 = src-include.3.1: targetNamespace f\u00F6r refererat schema, f\u00F6r n\u00E4rvarande ''{1}'', m\u00E5ste vara identiskt med motsvarande i omdefinierande schema, f\u00F6r n\u00E4rvarande ''{0}''.
- src-redefine.5.a.a = src-redefine.5.a.a: Hittade inga <simpleType>-underordnade med icke-anteckning. <simpleType>-underordnade i <redefine>-element m\u00E5ste ha <restriction>-underordnade, med 'base'-attribut som refererar till sig sj\u00E4lva.
- src-redefine.5.a.b = src-redefine.5.a.b: ''{0}'' \u00E4r inte n\u00E5got giltigt underordnat element. <simpleType>-underordnade i <redefine>-element m\u00E5ste ha <restriction>-underordnade, med ''base''-attribut som refererar till sig sj\u00E4lva.
- src-redefine.5.a.c = src-redefine.5.a.c: ''{0}'' saknar ett ''base''-attribut som refererar till det omdefinierade elementet ''{1}''. <simpleType>-underordnade i <redefine>-element m\u00E5ste ha <restriction>-underordnade, med ''base''-attribut som refererar till sig sj\u00E4lva.
- src-redefine.5.b.a = src-redefine.5.b.a: Hittade inga <complexType>-underordnade med icke-anteckning. <complexType>-underordnade i <redefine>-element m\u00E5ste ha <extension>- eller <restriction>-underordnade, med 'base'-attribut som refererar till sig sj\u00E4lva.
- src-redefine.5.b.b = src-redefine.5.b.b: Hittade inga <complexType>-underordnade p\u00E5 l\u00E4gsta niv\u00E5 med icke-anteckning. <complexType>-underordnade i <redefine>-element m\u00E5ste ha <extension>- eller <restriction>-underordnade, med 'base'-attribut som refererar till sig sj\u00E4lva.
- src-redefine.5.b.c = src-redefine.5.a.c: ''{0}'' \u00E4r inte n\u00E5got giltigt underordnat element p\u00E5 l\u00E4gsta niv\u00E5. <complexType>-underordnade i <redefine>-element m\u00E5ste ha <extension>- eller <restriction>-underordnade, med ''base''-attribut som refererar till sig sj\u00E4lva.
- src-redefine.5.b.d = src-redefine.5.a.d: ''{0}'' saknar ett ''base''-attribut som refererar till det omdefinierade elementet ''{1}''. <complexType>-underordnade i <redefine>-element m\u00E5ste ha <extension>- eller <restriction>-underordnade, med ''base''-attribut som refererar till sig sj\u00E4lva.
- src-redefine.6.1.1 = src-redefine.6.1.1: Om en underordnad grupp i ett <redefine>-element inneh\u00E5ller en grupp som refererar sig sj\u00E4lv m\u00E5ste den ha exakt 1; den h\u00E4r har ''{0}''.
- src-redefine.6.1.2 = src-redefine.6.1.2: Gruppen ''{0}'', som inneh\u00E5ller en referens till en grupp som omdefinieras, m\u00E5ste anges som ''minOccurs'' = ''maxOccurs'' = 1.
- src-redefine.6.2.1 = src-redefine.6.2.1: Det finns ingen grupp i det omdefinierade schemat med ett namn som matchar ''{0}''.
- src-redefine.6.2.2 = src-redefine.6.2.2: Gruppen ''{0}'' ger ingen korrekt begr\u00E4nsning av gruppen som omdefinieras; brott mot begr\u00E4nsning: ''{1}''.
- src-redefine.7.1 = src-redefine.7.1: Om en attributeGroup-underordnad i ett <redefine>-element inneh\u00E5ller attributeGroup som refererar till sig sj\u00E4lv m\u00E5ste den ha exakt 1; den h\u00E4r har {0}.
- src-redefine.7.2.1 = src-redefine.7.2.1: Det finns ingen attributeGroup i det omdefinierade schemat med ett namn som matchar ''{0}''.
- src-redefine.7.2.2 = src-redefine.7.2.2: AttributeGroup ''{0}'' ger ingen korrekt begr\u00E4nsning av attributeGroup som omdefinieras; brott mot begr\u00E4nsning: ''{1}''.
- src-resolve = src-resolve: Namnet ''{0}'' kan inte matchas med komponenten ''{1}''.
- src-resolve.4.1 = src-resolve.4.1: Ett fel intr\u00E4ffade vid matchning av komponenten ''{2}''. Systemet uppt\u00E4ckte att ''{2}'' saknar namnrymd och komponenter utan namnrymd kan inte refereras till fr\u00E5n schemadokumentet ''{0}''. Om ''{2}'' ska anv\u00E4ndas med namnrymd kanske du beh\u00F6ver ange ett prefix. Om ''{2}'' ska anv\u00E4ndas utan namnrymd b\u00F6r du l\u00E4gga till ''import'' utan "namespace"-attribut till ''{0}''.
- src-resolve.4.2 = src-resolve.4.2: Ett fel intr\u00E4ffade vid matchning av komponent ''{2}''. Systemet uppt\u00E4ckte att ''{2}'' finns i namnrymden ''{1}'' och komponenter fr\u00E5n denna namnrymd kan inte refereras till fr\u00E5n schemadokumentet ''{0}''. Om detta \u00E4r en felaktig namnrymd kanske du m\u00E5ste \u00E4ndra prefixet ''{2}''. Om namnrymden \u00E4r korrekt beh\u00F6ver du l\u00E4gga till l\u00E4mplig ''import''-tagg i ''{0}''.
- src-simple-type.2.a = src-simple-type.2.a: Ett <restriction>-element hittades med b\u00E5de ett bas-[attribut] och ett <simpleType>-element bland [underordnade]. Endast ett av dem \u00E4r till\u00E5tet.
- src-simple-type.2.b = src-simple-type.2.b: Ett <restriction>-element hittades med varken ett bas-[attribut] eller ett <simpleType>-element bland [underordnade]. N\u00E5gotdera av dem kr\u00E4vs.
- src-simple-type.3.a = src-simple-type.3.a: Ett <list>-element hittades med b\u00E5de ett itemType-[attribut] och ett <simpleType>-element bland [underordnade]. Endast ett av dem \u00E4r till\u00E5tet.
- src-simple-type.3.b = src-simple-type.3.b: Ett <list>-element hittades med varken ett itemType-[attribut] eller ett <simpleType>-element bland [underordnade]. N\u00E5gotdera av dem kr\u00E4vs.
- src-single-facet-value = src-single-facet-value: Aspekten (facet) ''{0}'' har definierats fler \u00E4n en g\u00E5ng.
- src-union-memberTypes-or-simpleTypes = src-union-memberTypes-or-simpleTypes: Ett <union>-element m\u00E5ste anges med antingen ett icke-tomt memberTypes-[attribut] eller minst ett <simpleType>-element bland [underordnade].
-
-#constraint valid (3.X.6)
-
- ag-props-correct.2 = ag-props-correct.2: Ett fel intr\u00E4ffade f\u00F6r attributgruppen ''{0}''. Duplicerad attributanv\u00E4ndning med samma namn och namnrymd. Namnet p\u00E5 dubbletten \u00E4r ''{1}''.
- ag-props-correct.3 = ag-props-correct.3: Ett fel intr\u00E4ffade f\u00F6r attributgruppen ''{0}''. Tv\u00E5 attributdeklarationer, ''{1}'' och ''{2}'' har angetts med typer som h\u00E4rleds fr\u00E5n ID.
- a-props-correct.2 = a-props-correct.2: Ogiltigt v\u00E4rde f\u00F6r begr\u00E4nsning, ''{1}'', i attributet ''{0}''.
- a-props-correct.3 = a-props-correct.3: Attributet ''{0}'' f\u00E5r inte anv\u00E4nda ''fixed'' eller ''default'', eftersom attributets '{'typdefinition'}' \u00E4r ID eller h\u00E4rleds fr\u00E5n ID.
- au-props-correct.2 = au-props-correct.2: Det fasta v\u00E4rdet ''{1}'' har angetts i attributdeklarationen ''{0}''. Om attributet som refererar till ''{0}'' \u00E4ven inneh\u00E5ller en '{'v\u00E4rdebegr\u00E4nsning'}' m\u00E5ste du l\u00F6sa detta och ange v\u00E4rdet ''{1}''.
- cos-all-limited.1.2 = cos-all-limited.1.2: En 'all'-modellgrupp m\u00E5ste anges i en partikel med '{'min f\u00F6rekomster'}' = '{'max f\u00F6rekomster'}' = 1 och partikeln m\u00E5ste vara en del i ett par som utg\u00F6r '{'inneh\u00E5llstyp'}' i en komplex typdefinition.
- cos-all-limited.2 = cos-all-limited.2: V\u00E4rdet f\u00F6r '{'max f\u00F6rekomster'}' i ett element i en ''all''-modellgrupp m\u00E5ste vara 0 eller 1. V\u00E4rdet ''{0}'' f\u00F6r elementet ''{1}'' \u00E4r ogiltigt.
- cos-applicable-facets = cos-applicable-facets: Aspekten (facet) ''{0}'' \u00E4r inte till\u00E5ten med typ {1}.
- cos-ct-extends.1.1 = cos-ct-extends.1.1: Typ ''{0}'' h\u00E4rleds fr\u00E5n ett till\u00E4gg fr\u00E5n typ ''{1}''. Attributet ''final'' i ''{1}'' till\u00E5ter dock inte h\u00E4rledning av till\u00E4gg.
- cos-ct-extends.1.4.3.2.2.1.a = cos-ct-extends.1.4.3.2.2.1.a: Inneh\u00E5llstyp f\u00F6r h\u00E4rledd typ och f\u00F6r basen m\u00E5ste b\u00E5da vara blandade eller endast element. Typ ''{0}'' \u00E4r endast element, men d\u00E4remot inte basen.
- cos-ct-extends.1.4.3.2.2.1.b = cos-ct-extends.1.4.3.2.2.1.b: Inneh\u00E5llstyp f\u00F6r h\u00E4rledd typ och f\u00F6r basen m\u00E5ste b\u00E5da vara blandade eller endast element. Typ ''{0}'' \u00E4r blandat, men d\u00E4remot inte basen.
- cos-element-consistent = cos-element-consistent: Ett fel intr\u00E4ffade f\u00F6r typ ''{0}''. Flera element med namnet ''{1}'', med olika typer, har angetts i modellgruppen.
- cos-list-of-atomic = cos-list-of-atomic: I definitionen av listtyp ''{0}'' \u00E4r typ ''{1}'' en ogiltig typ av listelement eftersom den inte \u00E4r atomisk (''{1}'' \u00E4r antingen en listtyp eller en uniontyp som inneh\u00E5ller en lista).
- cos-nonambig = cos-nonambig: {0} och {1} (eller element fr\u00E5n ers\u00E4ttningsgruppen) bryter mot "Unique Particle Attribution". Detta skapar tvetydighet f\u00F6r partiklarna vid validering gentemot detta schema.
- cos-particle-restrict.a = cos-particle-restrict.a: H\u00E4rledd partikel \u00E4r tom och basen \u00E4r inte t\u00F6mningsbar.
- cos-particle-restrict.b = cos-particle-restrict.b: Baspartikeln \u00E4r tom, men den h\u00E4rledda partikeln \u00E4r inte det.
- cos-particle-restrict.2 = cos-particle-restrict.2: F\u00F6rbjuden partikelbegr\u00E4nsning: ''{0}''.
- cos-st-restricts.1.1 = cos-st-restricts.1.1: Typ ''{1}'' \u00E4r atomisk och d\u00E4rf\u00F6r m\u00E5ste '{'bastypdefinitionen'}', ''{0}'', anges som atomisk enkel typ eller inbyggd primitiv datatyp.
- cos-st-restricts.2.1 = cos-st-restricts.2.1: I definitionen av listtyp ''{0}'' \u00E4r typ ''{1}'' en ogiltig objekttyp eftersom det \u00E4r antingen en listtyp eller en uniontyp som inneh\u00E5ller en lista.
- cos-st-restricts.2.3.1.1 = cos-st-restricts.2.3.1.1: Den '{'sista'}' komponenten i '{'objekttypdefinitionen'}', ''{0}'', inneh\u00E5ller ''list''. Detta betyder att ''{0}'' inte kan anv\u00E4ndas som objekttyp f\u00F6r listtyp ''{1}''.
- cos-st-restricts.3.3.1.1 = cos-st-restricts.3.3.1.1: Den '{'sista'}' komponenten i '{'medlemtypdefinitionerna'}', ''{0}'', inneh\u00E5ller ''union''. Detta betyder att ''{0}'' inte kan anv\u00E4ndas som medlemstyp f\u00F6r uniontyp ''{1}''.
- cos-valid-default.2.1 = cos-valid-default.2.1: Elementet ''{0}'' har en v\u00E4rdebegr\u00E4nsning och m\u00E5ste ha en blandad eller enkel inneh\u00E5llsmodell.
- cos-valid-default.2.2.2 = cos-valid-default.2.2.2: Eftersom elementet ''{0}'' har en '{'v\u00E4rdebegr\u00E4nsning'}' och typdefinitionen har blandad '{'inneh\u00E5llstyp'}' s\u00E5 m\u00E5ste partikeln av '{'inneh\u00E5llstyp'}' vara t\u00F6mningsbar.
- c-props-correct.2 = c-props-correct.2: Kardinalitet av f\u00E4lt med nyckelreferens ''{0}'' och nyckel ''{1}'' m\u00E5ste matcha varandra.
- ct-props-correct.3 = ct-props-correct.3: Cirkul\u00E4ra definitioner har identifierats f\u00F6r komplex typ ''{0}''. Detta inneb\u00E4r att ''{0}'' ing\u00E5r i sin egen typhierarki, vilket \u00E4r fel.
- ct-props-correct.4 = ct-props-correct.4: Ett fel intr\u00E4ffade f\u00F6r typ ''{0}''. Duplicerad attributanv\u00E4ndning med samma namn och namnrymd. Namnet p\u00E5 dubbletten \u00E4r ''{1}''.
- ct-props-correct.5 = ct-props-correct.5: Ett fel intr\u00E4ffade f\u00F6r typ ''{0}''. Tv\u00E5 attributdeklarationer, ''{1}'' och ''{2}'', anv\u00E4nds med typer som h\u00E4rleds fr\u00E5n ID.
- derivation-ok-restriction.1 = derivation-ok-restriction.1: Typ ''{0}'' h\u00E4rleddes genom begr\u00E4nsning fr\u00E5n typ ''{1}''. ''{1}'' har d\u00E4remot en '{'slutlig'}' egenskap som f\u00F6rbjuder h\u00E4rledning via begr\u00E4nsning.
- derivation-ok-restriction.2.1.1 = derivation-ok-restriction.2.1.1: Ett fel intr\u00E4ffade f\u00F6r typ ''{0}''. Attributanv\u00E4ndning ''{1}'' i denna typ har ''use''-v\u00E4rdet ''{2}'' vilket inte \u00E4r konsekvent med v\u00E4rdet f\u00F6r ''required'' i matchande attributanv\u00E4ndning i bastypen.
- derivation-ok-restriction.2.1.2 = derivation-ok-restriction.2.1.2: Ett fel intr\u00E4ffade f\u00F6r typ ''{0}''. Attributanv\u00E4ndning ''{1}'' i denna typ har typ ''{2}'', som inte f\u00E5r h\u00E4rledas fr\u00E5n ''{3}'', typ i matchande attributanv\u00E4ndning i bastypen.
- derivation-ok-restriction.2.1.3.a = derivation-ok-restriction.2.1.3.a: Ett fel intr\u00E4ffade f\u00F6r typ ''{0}''. Attributanv\u00E4ndning ''{1}'' i denna typ har en effektiv v\u00E4rdebegr\u00E4nsning som inte \u00E4r fast, medan den effektiva v\u00E4rdebegr\u00E4nsningen i matchande attributanv\u00E4ndning i bastypen \u00E4r fast.
- derivation-ok-restriction.2.1.3.b = derivation-ok-restriction.2.1.3.b: Ett fel intr\u00E4ffade f\u00F6r typ ''{0}''. Attributanv\u00E4ndning ''{1}'' i denna typ har en effektiv v\u00E4rdebegr\u00E4nsning med det fasta v\u00E4rdet ''{2}'', vilket inte \u00E4r konsekvent med v\u00E4rdet ''{3}'' f\u00F6r den fasta effektiva v\u00E4rdebegr\u00E4nsningen f\u00F6r matchande attributanv\u00E4ndning i bastypen.
- derivation-ok-restriction.2.2.a = derivation-ok-restriction.2.2.a: Ett fel intr\u00E4ffade f\u00F6r typ ''{0}''. Attributanv\u00E4ndning ''{1}'' i denna typ har inte n\u00E5gon matchande attributanv\u00E4ndning i basen och bastypen saknar jokerteckenattribut.
- derivation-ok-restriction.2.2.b = derivation-ok-restriction.2.2.b: Ett fel intr\u00E4ffade f\u00F6r typ ''{0}''. Attributanv\u00E4ndning ''{1}'' i denna typ har inte n\u00E5gon matchande attributanv\u00E4ndning i basen och namnrymden ''{2}'' i denna attributanv\u00E4ndning till\u00E5ts inte av jokertecknet i bastypen.
- derivation-ok-restriction.3 = derivation-ok-restriction.3: Ett fel intr\u00E4ffade f\u00F6r typ ''{0}''. Attributanv\u00E4ndning ''{1}'' i bastypen har REQUIRED angivet som true, men det finns ingen matchande attributanv\u00E4ndning i h\u00E4rledd typ.
- derivation-ok-restriction.4.1 = derivation-ok-restriction.4.1: Ett fel intr\u00E4ffade f\u00F6r typen ''{0}''. H\u00E4rledningen har ett attributjokertecken, men motsvarande i basen saknas.
- derivation-ok-restriction.4.2 = derivation-ok-restriction.4.2: Ett fel intr\u00E4ffade f\u00F6r typen ''{0}''. Jokertecknet i h\u00E4rledningen \u00E4r inte n\u00E5gon giltig jokerteckendel som motsvarar det i basen.
- derivation-ok-restriction.4.3 = derivation-ok-restriction.4.3: Ett fel intr\u00E4ffade f\u00F6r typ ''{0}''. Processinneh\u00E5llet f\u00F6r jokertecken i h\u00E4rledning ({1}) \u00E4r svagare \u00E4n det i basen ({2}).
- derivation-ok-restriction.5.2.2.1 = derivation-ok-restriction.5.2.2.1: Ett fel intr\u00E4ffade f\u00F6r typ ''{0}''. Den enkla inneh\u00E5llstypen f\u00F6r denna typ, ''{1}'', \u00E4r inte n\u00E5gon giltig begr\u00E4nsning av den enkla inneh\u00E5llstypen f\u00F6r basen, ''{2}''.
- derivation-ok-restriction.5.3.2 = derivation-ok-restriction.5.3.2: Ett fel intr\u00E4ffade f\u00F6r typ ''{0}''. Inneh\u00E5llstypen f\u00F6r denna typ \u00E4r tom, men inneh\u00E5llstypen f\u00F6r basen, ''{1}'', \u00E4r inte tom eller t\u00F6mningsbar.
- derivation-ok-restriction.5.4.1.2 = derivation-ok-restriction.5.4.1.2: Ett fel intr\u00E4ffade f\u00F6r typ ''{0}''. Inneh\u00E5llstypen f\u00F6r denna typ \u00E4r blandad, medan inneh\u00E5llstypen f\u00F6r basen, ''{1}'', inte \u00E4r det.
- derivation-ok-restriction.5.4.2 = derivation-ok-restriction.5.4.2: Ett fel intr\u00E4ffade f\u00F6r typ ''{0}''. Typpartikeln \u00E4r inte n\u00E5gon giltig begr\u00E4nsning f\u00F6r partikeln i basen.
- enumeration-required-notation = enumeration-required-notation: NOTATION-typ, ''{0}'' anv\u00E4nds av {2} ''{1}'', m\u00E5ste anges med uppr\u00E4kningsaspektv\u00E4rde som specificerar de notationselement som anv\u00E4nds av denna typ.
- enumeration-valid-restriction = enumeration-valid-restriction: Uppr\u00E4kningsv\u00E4rdet ''{0}'' finns inte i bastypens, {1}, v\u00E4rdeutrymme.
- e-props-correct.2 = e-props-correct.2: Ogiltigt v\u00E4rde f\u00F6r begr\u00E4nsningsv\u00E4rde ''{1}'' i elementet ''{0}''.
- e-props-correct.4 = e-props-correct.4: '{'Typdefinition'}' f\u00F6r elementet ''{0}'' har en ogiltig h\u00E4rledning fr\u00E5n '{'typdefinitionen'}' f\u00F6r substitutionHead ''{1}'' eller s\u00E5 till\u00E5ts inte denna h\u00E4rledning av egenskapen ''{1}'' f\u00F6r '{'ers\u00E4ttningsgruppexkluderingar'}'.
- e-props-correct.5 = e-props-correct.5: En '{'v\u00E4rdebegr\u00E4nsning'}' f\u00E5r inte finnas med i elementet ''{0}'' eftersom elementets '{'typdefinition'}' eller '{'typdefinitionens'}' '{'inneh\u00E5llstyp'}' \u00E4r ID, eller h\u00E4rleds fr\u00E5n ID.
- e-props-correct.6 = e-props-correct.6: Cirkul\u00E4r ers\u00E4ttningsgrupp identifierades f\u00F6r elementet ''{0}''.
- fractionDigits-valid-restriction = fractionDigits-valid-restriction: I definitionen f\u00F6r {2} \u00E4r v\u00E4rdet ''{0}'' f\u00F6r ''fractionDigits'' ogiltigt eftersom det m\u00E5ste vara mindre \u00E4n eller lika med v\u00E4rdet f\u00F6r ''fractionDigits'' som har angetts som ''{1}'' i n\u00E5gon typ f\u00F6r \u00F6verordnad.
- fractionDigits-totalDigits = fractionDigits-totalDigits: I definitionen av {2} \u00E4r v\u00E4rdet ''{0}'' f\u00F6r ''fractionDigits'' ogiltigt eftersom v\u00E4rdet m\u00E5ste vara mindre \u00E4n eller lika med v\u00E4rdet f\u00F6r ''totalDigits'' som \u00E4r ''{1}''.
- length-minLength-maxLength.1.1 = length-minLength-maxLength.1.1: Vid anv\u00E4ndning av typ {0} \u00E4r det fel om l\u00E4ngdv\u00E4rdet ''{1}'' \u00E4r mindre \u00E4n v\u00E4rdet f\u00F6r minLength ''{2}''.
- length-minLength-maxLength.1.2.a = length-minLength-maxLength.1.2.a: Vid anv\u00E4ndning av typ {0} \u00E4r det fel om basen inte har en minLength-aspekt n\u00E4r aktuell begr\u00E4nsning har minLength-aspekt och aktuell begr\u00E4nsning eller bas har angetts med l\u00E4ngdaspekt.
- length-minLength-maxLength.1.2.b = length-minLength-maxLength.1.2.b: Vid anv\u00E4ndning av typ {0} \u00E4r det fel om aktuell minLength ''{1}'' inte \u00E4r lika med basen minLength ''{2}''.
- length-minLength-maxLength.2.1 = length-minLength-maxLength.2.1: Vid anv\u00E4ndning av typ {0} \u00E4r det fel om l\u00E4ngdv\u00E4rdet ''{1}'' \u00E4r st\u00F6rre \u00E4n v\u00E4rdet f\u00F6r maxLength ''{2}''.
- length-minLength-maxLength.2.2.a = length-minLength-maxLength.2.2.a: Vid anv\u00E4ndning av typ {0} \u00E4r det fel om basen inte har en maxLength-aspekt n\u00E4r aktuell begr\u00E4nsning har maxLength-aspekt och aktuell begr\u00E4nsning eller bas har angetts med l\u00E4ngdaspekt.
- length-minLength-maxLength.2.2.b = length-minLength-maxLength.2.2.b: Vid anv\u00E4ndning av typ {0} \u00E4r det fel om aktuell maxLength ''{1}'' inte \u00E4r lika med basen maxLength ''{2}''.
- length-valid-restriction = length-valid-restriction: Ett fel intr\u00E4ffade f\u00F6r typ ''{2}''. L\u00E4ngdv\u00E4rdet ''{0}'' m\u00E5ste vara lika med v\u00E4rdet f\u00F6r bastyp ''{1}''.
- maxExclusive-valid-restriction.1 = maxExclusive-valid-restriction.1: Ett fel intr\u00E4ffade f\u00F6r typ ''{2}''. maxExclusive-v\u00E4rdet ''{0}'' m\u00E5ste vara mindre \u00E4n eller lika med maxExclusive i bastyp ''{1}''.
- maxExclusive-valid-restriction.2 = maxExclusive-valid-restriction.2: Ett fel intr\u00E4ffade f\u00F6r typ ''{2}''. maxExclusive-v\u00E4rdet ''{0}'' m\u00E5ste vara mindre \u00E4n eller lika med maxInclusive i bastyp ''{1}''.
- maxExclusive-valid-restriction.3 = maxExclusive-valid-restriction.3: Ett fel intr\u00E4ffade f\u00F6r typ ''{2}''. maxExclusive-v\u00E4rdet ''{0}'' m\u00E5ste vara st\u00F6rre \u00E4n minInclusive i bastyp ''{1}''.
- maxExclusive-valid-restriction.4 = maxExclusive-valid-restriction.4: Ett fel intr\u00E4ffade f\u00F6r typ ''{2}''. maxExclusive-v\u00E4rdet ''{0}'' m\u00E5ste vara st\u00F6rre \u00E4n minExclusive i bastyp ''{1}''.
- maxInclusive-maxExclusive = maxInclusive-maxExclusive: Det \u00E4r fel om b\u00E5de maxInclusive och maxExclusive anges f\u00F6r samma datatyp. I {2} \u00E4r maxInclusive ''{0}'' och maxExclusive ''{1}''.
- maxInclusive-valid-restriction.1 = maxInclusive-valid-restriction.1: Ett fel intr\u00E4ffade f\u00F6r typ ''{2}''. maxInclusive-v\u00E4rdet ''{0}'' m\u00E5ste vara mindre \u00E4n eller lika med maxInclusive i bastyp ''{1}''.
- maxInclusive-valid-restriction.2 = maxInclusive-valid-restriction.2: Ett fel intr\u00E4ffade f\u00F6r typ ''{2}''. maxInclusive-v\u00E4rdet ''{0}'' m\u00E5ste vara mindre \u00E4n maxExclusive i bastyp ''{1}''.
- maxInclusive-valid-restriction.3 = maxInclusive-valid-restriction.3: Ett fel intr\u00E4ffade f\u00F6r typ ''{2}''. maxInclusive-v\u00E4rdet ''{0}'' m\u00E5ste vara st\u00F6rre \u00E4n eller lika med minInclusive i bastyp ''{1}''.
- maxInclusive-valid-restriction.4 = maxInclusive-valid-restriction.4: Ett fel intr\u00E4ffade f\u00F6r typ ''{2}''. maxInclusive-v\u00E4rdet ''{0}'' m\u00E5ste vara st\u00F6rre \u00E4n minExclusive i bastyp ''{1}''.
- maxLength-valid-restriction = maxLength-valid-restriction: I definitionen f\u00F6r {2} m\u00E5ste maxLength-v\u00E4rdet ''{0}'' vara mindre \u00E4n eller lika med v\u00E4rdet i bastyp ''{1}''.
- mg-props-correct.2 = mg-props-correct.2: Cirkul\u00E4ra definitioner identifierades f\u00F6r gruppen ''{0}''. Rekursivt efterf\u00F6ljande v\u00E4rdena f\u00F6r '{'term'}' i partiklarna leder till en partikel vars '{'term'}' \u00E4r den ursprungliga gruppen.
- minExclusive-less-than-equal-to-maxExclusive = minExclusive-less-than-equal-to-maxExclusive: I definitionen f\u00F6r {2} m\u00E5ste minExclusive-v\u00E4rdet ''{0}'' vara mindre \u00E4n eller lika med maxExclusive-v\u00E4rdet ''{1}''.
- minExclusive-less-than-maxInclusive = minExclusive-less-than-maxInclusive: I definitionen f\u00F6r {2} m\u00E5ste minExclusive-v\u00E4rdet ''{0}'' vara mindre \u00E4n maxInclusive-v\u00E4rdet ''{1}''.
- minExclusive-valid-restriction.1 = minExclusive-valid-restriction.1: Ett fel intr\u00E4ffade f\u00F6r typ ''{2}''. minExclusive-v\u00E4rdet ''{0}'' m\u00E5ste vara st\u00F6rre \u00E4n eller lika med minExclusive i bastyp ''{1}''.
- minExclusive-valid-restriction.2 = minExclusive-valid-restriction.2: Ett fel intr\u00E4ffade f\u00F6r typ ''{2}''. minExclusive-v\u00E4rdet ''{0}'' m\u00E5ste vara mindre \u00E4n eller lika med maxInclusive i bastyp ''{1}''.
- minExclusive-valid-restriction.3 = minExclusive-valid-restriction.3: Ett fel intr\u00E4ffade f\u00F6r typ ''{2}''. minExclusive-v\u00E4rdet ''{0}'' m\u00E5ste vara st\u00F6rre \u00E4n eller lika med minInclusive i bastyp ''{1}''.
- minExclusive-valid-restriction.4 = minExclusive-valid-restriction.4: Ett fel intr\u00E4ffade f\u00F6r typ ''{2}''. minExclusive-v\u00E4rdet ''{0}'' m\u00E5ste vara mindre \u00E4n maxExclusive i bastyp ''{1}''.
- minInclusive-less-than-equal-to-maxInclusive = minInclusive-less-than-equal-to-maxInclusive: I definitionen f\u00F6r {2} m\u00E5ste minInclusive-v\u00E4rdet ''{0}'' vara mindre \u00E4n eller lika med maxInclusive-v\u00E4rdet ''{1}''.
- minInclusive-less-than-maxExclusive = minInclusive-less-than-maxExclusive: I definitionen f\u00F6r {2} m\u00E5ste minInclusive-v\u00E4rdet ''{0}'' vara mindre \u00E4n maxExclusive-v\u00E4rdet ''{1}''.
- minInclusive-minExclusive = minInclusive-minExclusive: Det \u00E4r fel om b\u00E5de minInclusive och minExclusive anges f\u00F6r samma datatyp. I {2} \u00E4r minInclusive ''{0}'' och minExclusive ''{1}''.
- minInclusive-valid-restriction.1 = minInclusive-valid-restriction.1: Ett fel intr\u00E4ffade f\u00F6r typ ''{2}''. minInclusive-v\u00E4rdet ''{0}'' m\u00E5ste vara st\u00F6rre \u00E4n eller lika med minInclusive i bastyp ''{1}''.
- minInclusive-valid-restriction.2 = minInclusive-valid-restriction.2: Ett fel intr\u00E4ffade f\u00F6r typ ''{2}''. minInclusive-v\u00E4rdet ''{0}'' m\u00E5ste vara mindre \u00E4n eller lika med maxInclusive i bastyp ''{1}''.
- minInclusive-valid-restriction.3 = minInclusive-valid-restriction.3: Ett fel intr\u00E4ffade f\u00F6r typ ''{2}''. minInclusive-v\u00E4rdet ''{0}'' m\u00E5ste vara st\u00F6rre \u00E4n minExclusive i bastyp ''{1}''.
- minInclusive-valid-restriction.4 = minInclusive-valid-restriction.4: Ett fel intr\u00E4ffade f\u00F6r typ ''{2}''. minInclusive-v\u00E4rdet ''{0}'' m\u00E5ste vara mindre \u00E4n maxExclusive i bastyp ''{1}''.
- minLength-less-than-equal-to-maxLength = minLength-less-than-equal-to-maxLength: I definitionen f\u00F6r {2} m\u00E5ste minLength-v\u00E4rdet ''{0}'' vara mindre \u00E4n maxLength-v\u00E4rdet ''{1}''.
- minLength-valid-restriction = minLength-valid-restriction: I definitionen f\u00F6r {2} m\u00E5ste minLength-v\u00E4rdet ''{0}'' vara st\u00F6rre \u00E4n eller lika med v\u00E4rdet i bastyp ''{1}''.
- no-xmlns = no-xmlns: Ett {namn} p\u00E5 en attributdeklaration f\u00E5r inte matcha 'xmlns'.
- no-xsi = no-xsi: En '{'m\u00E5lnamnrymd'}' i en attributdeklaration f\u00E5r inte matcha ''{0}''.
- p-props-correct.2.1 = p-props-correct.2.1: I deklarationen ''{0}'' \u00E4r v\u00E4rdet f\u00F6r ''minOccurs'' ''{1}'', men det f\u00E5r inte vara st\u00F6rre \u00E4n v\u00E4rdet f\u00F6r ''maxOccurs'' (som \u00E4r ''{2}'').
- rcase-MapAndSum.1 = rcase-MapAndSum.1: Det finns ingen fullst\u00E4ndigt fungerande mappning mellan partiklarna.
- rcase-MapAndSum.2 = rcase-MapAndSum.2: Gruppens f\u00F6rekomstintervall ({0},{1}) \u00E4r inte n\u00E5gon giltig begr\u00E4nsning f\u00F6r basgruppens f\u00F6rekomstintervall, ({2},{3}).
- rcase-NameAndTypeOK.1 = rcase-NameAndTypeOK.1: Element har namn och m\u00E5lnamnrymder som inte \u00E4r desamma: Elementet ''{0}'' i namnrymd ''{1}'' och elementet ''{2}'' i namnrymd ''{3}''.
- rcase-NameAndTypeOK.2 = rcase-NameAndTypeOK.2: Ett fel intr\u00E4ffade f\u00F6r partikeln vars '{'term'}' \u00E4r elementdeklarationen ''{0}''. Elementdeklarationens v\u00E4rde som \u00E4r '{'nullbart'}' har angetts som true, men motsvarande partikel i bastypen har en elementdeklaration vars v\u00E4rde som \u00E4r '{'nullbart'}' har angetts som false.
- rcase-NameAndTypeOK.3 = rcase-NameAndTypeOK.3: Ett fel intr\u00E4ffade f\u00F6r partikeln vars '{'term'}' \u00E4r elementdeklarationen ''{0}''. F\u00F6rekomstintervallet, ({1},{2}), \u00E4r inte n\u00E5gon giltig begr\u00E4nsning f\u00F6r intervallet, ({3},{4}, i motsvarande partikel i bastypen.
- rcase-NameAndTypeOK.4.a = rcase-NameAndTypeOK.4.a: Elementet ''{0}'' har inte n\u00E5got fast v\u00E4rde, men motsvarande element i bastypen har angetts med det fasta v\u00E4rdet ''{1}''.
- rcase-NameAndTypeOK.4.b = rcase-NameAndTypeOK.4.b: Elementet ''{0}'' har det fasta v\u00E4rdet ''{1}'', men motsvarande element i bastypen har angetts med det fasta v\u00E4rdet ''{2}''.
- rcase-NameAndTypeOK.5 = rcase-NameAndTypeOK.5: Identitetsbegr\u00E4nsningarna f\u00F6r elementet ''{0}'' \u00E4r inte n\u00E5gon del av de som finns i basen.
- rcase-NameAndTypeOK.6 = rcase-NameAndTypeOK.6: De avaktiverade ers\u00E4ttningarna f\u00F6r elementet ''{0}'' \u00E4r inte inneslutna i basen.
- rcase-NameAndTypeOK.7 = rcase-NameAndTypeOK.7: Elementtyp ''{0}'', ''{1}'' h\u00E4rleds inte fr\u00E5n typ av baselement, ''{2}''.
- rcase-NSCompat.1 = rcase-NSCompat.1: Elementet ''{0}'' har namnrymden ''{1}'' som inte \u00E4r till\u00E5tet av jokertecknet i basen.
- rcase-NSCompat.2 = rcase-NSCompat.2: Ett fel intr\u00E4ffade f\u00F6r partikeln vars '{'term'}' \u00E4r elementdeklarationen ''{0}''. F\u00F6rekomstintervallet, ({1},{2}), \u00E4r inte n\u00E5gon giltig begr\u00E4nsning f\u00F6r intervallet, ({3},{4}, i motsvarande partikel i bastypen.
- rcase-NSRecurseCheckCardinality.1 = rcase-NSRecurseCheckCardinality.1: Det finns ingen fullst\u00E4ndigt fungerande mappning mellan partiklarna.
- rcase-NSRecurseCheckCardinality.2 = rcase-NSRecurseCheckCardinality.2: Gruppens f\u00F6rekomstintervall ({0},{1}) \u00E4r inte n\u00E5gon giltig begr\u00E4nsning f\u00F6r basjokertecknets intervall, ({2},{3}).
- rcase-NSSubset.1 = rcase-NSSubset.1: Jokertecknet \u00E4r inte n\u00E5gon del av motsvarande jokertecken i basen.
- rcase-NSSubset.2 = rcase-NSSubset.2: Jokertecknets f\u00F6rekomstintervall ({0},{1}), \u00E4r inte n\u00E5gon giltig begr\u00E4nsning som motsvarar den i basen, ({2},{3}),.
- rcase-NSSubset.3 = rcase-NSSubset.3: Jokertecknets processinneh\u00E5ll, ''{0}'', \u00E4r svagare \u00E4n det i basen, ''{1}''.
- rcase-Recurse.1 = rcase-Recurse.1: Gruppens f\u00F6rekomstintervall ({0},{1}) \u00E4r inte n\u00E5gon giltig begr\u00E4nsning f\u00F6r basgruppens f\u00F6rekomstintervall, ({2},{3}).
- rcase-Recurse.2 = rcase-Recurse.2: Det finns ingen fullst\u00E4ndigt fungerande mappning mellan partiklarna.
- rcase-RecurseLax.1 = rcase-RecurseLax.1: Gruppens f\u00F6rekomstintervall ({0},{1}) \u00E4r inte n\u00E5gon giltig begr\u00E4nsning f\u00F6r basgruppens f\u00F6rekomstintervall, ({2},{3}).
- rcase-RecurseLax.2 = rcase-RecurseLax.2: Det finns ingen fullst\u00E4ndigt fungerande mappning mellan partiklarna.
- rcase-RecurseUnordered.1 = rcase-RecurseUnordered.1: Gruppens f\u00F6rekomstintervall ({0},{1}) \u00E4r inte n\u00E5gon giltig begr\u00E4nsning f\u00F6r basgruppens f\u00F6rekomstintervall, ({2},{3}).
- rcase-RecurseUnordered.2 = rcase-RecurseUnordered.2: Det finns ingen fullst\u00E4ndigt fungerande mappning mellan partiklarna.
-# We're using sch-props-correct.2 instead of the old src-redefine.1
-# src-redefine.1 = src-redefine.1: The component ''{0}'' is begin redefined, but its corresponding component isn't in the schema document being redefined (with namespace ''{2}''), but in a different document, with namespace ''{1}''.
- sch-props-correct.2 = sch-props-correct.2: Ett schema kan inte inneh\u00E5lla tv\u00E5 globala komponenter med samma namn. Detta schema har tv\u00E5 f\u00F6rekomster av ''{0}''.
- st-props-correct.2 = st-props-correct.2: Cirkul\u00E4ra definitioner har identifierats f\u00F6r enkel typ ''{0}''. Detta inneb\u00E4r att ''{0}'' ing\u00E5r i sin egen typhierarki, vilket \u00E4r fel.
- st-props-correct.3 = st-props-correct.3: Ett fel intr\u00E4ffade f\u00F6r typ ''{0}''. V\u00E4rdet f\u00F6r '{'slutgiltigt'}' i '{'bastypdefinitionen'}', ''{1}'', f\u00F6rbjuder h\u00E4rledning med begr\u00E4nsning.
- totalDigits-valid-restriction = totalDigits-valid-restriction: I definitionen f\u00F6r {2} \u00E4r v\u00E4rdet ''{0}'' f\u00F6r ''totalDigits'' ogiltigt eftersom det m\u00E5ste vara mindre \u00E4n eller lika med v\u00E4rdet f\u00F6r ''totalDigits'' som har angetts som ''{1}'' i n\u00E5gon typ f\u00F6r \u00F6verordnad.
- whiteSpace-valid-restriction.1 = whiteSpace-valid-restriction.1: I definitionen f\u00F6r {0} \u00E4r v\u00E4rdet ''{1}'' f\u00F6r ''whitespace'' ogiltigt, eftersom v\u00E4rdet f\u00F6r ''whitespace'' har angetts som ''collapse'' i n\u00E5gon typ f\u00F6r \u00F6verordnad.
- whiteSpace-valid-restriction.2 = whiteSpace-valid-restriction.2: I definitionen f\u00F6r {0} \u00E4r v\u00E4rdet ''preserve'' f\u00F6r ''whitespace'' ogiltigt, eftersom v\u00E4rdet f\u00F6r ''whitespace'' har angetts som ''replace'' i n\u00E5gon typ f\u00F6r \u00F6verordnad.
-
-#schema for Schemas
-
- s4s-att-invalid-value = s4s-att-invalid-value: Attributv\u00E4rdet f\u00F6r ''{1}'' i elementet ''{0}'' \u00E4r ogiltigt. Registrerad orsak: {2}
- s4s-att-must-appear = s4s-att-must-appear: Attributet ''{1}'' m\u00E5ste anges i elementet ''{0}''.
- s4s-att-not-allowed = s4s-att-not-allowed: Attributet ''{1}'' f\u00E5r inte anges i elementet ''{0}''.
- s4s-elt-invalid = s4s-elt-invalid: Elementet ''{0}'' \u00E4r inte n\u00E5got giltigt element i schemadokument.
- s4s-elt-must-match.1 = s4s-elt-must-match.1: Inneh\u00E5llet i ''{0}'' m\u00E5ste matcha {1}. Ett problem hittades med b\u00F6rjan fr\u00E5n: {2}.
- s4s-elt-must-match.2 = s4s-elt-must-match.2: Inneh\u00E5llet i ''{0}'' m\u00E5ste matcha {1}. Hittade inte tillr\u00E4ckligt med element.
- # the "invalid-content" messages provide less information than the "must-match" counterparts above. They're used for complex types when providing a "match" would be an information dump
- s4s-elt-invalid-content.1 = s4s-elt-invalid-content.1: Inneh\u00E5llet i ''{0}'' \u00E4r ogiltigt. Elementet ''{1}'' \u00E4r ogiltigt, felplacerat eller har f\u00F6r m\u00E5nga f\u00F6rekomster.
- s4s-elt-invalid-content.2 = s4s-elt-invalid-content.2: Inneh\u00E5llet i ''{0}'' \u00E4r ogiltigt. Elementet ''{1}'' m\u00E5ste anges.
- s4s-elt-invalid-content.3 = s4s-elt-invalid-content.3: Element av typ ''{0}'' kan inte anges efter deklarationer som under underordnade i <schema>element.
- s4s-elt-schema-ns = s4s-elt-schema-ns: Namnrymden i elementet ''{0}'' m\u00E5ste komma fr\u00E5n schemats namnrymd, ''http://www.w3.org/2001/XMLSchema''.
- s4s-elt-character = s4s-elt-character: Tecken som inte \u00E4r blanktecken till\u00E5ts inte i andra schemaelement \u00E4n ''xs:appinfo'' och ''xs:documentation''. Uppt\u00E4ckte ''{0}''.
-
-# codes not defined by the spec
-
- c-fields-xpaths = c-fields-xpaths: F\u00E4ltv\u00E4rdet = ''{0}'' \u00E4r ogiltigt.
- c-general-xpath = c-general-xpath: Uttrycket ''{0}'' \u00E4r ogiltigt med den XPath-delm\u00E4ngd som st\u00F6ds i XML-schema.
- c-general-xpath-ns = c-general-xpath-ns: Ett namnrymdsprefix i XPath-uttrycket ''{0}'' var inte bundet till n\u00E5gon namnrymd.
- c-selector-xpath = c-selector-xpath: V\u00E4ljarv\u00E4rdet ''{0}'' \u00E4r ogiltigt; xpath f\u00F6r v\u00E4ljare f\u00E5r inte inneh\u00E5lla attribut.
- EmptyTargetNamespace = EmptyTargetNamespace: I schemadokumentet ''{0}'' f\u00E5r v\u00E4rdet f\u00F6r attributet ''targetNamespace'' inte vara en tom str\u00E4ng.
- FacetValueFromBase = FacetValueFromBase: I deklarationen av typ ''{0}'' m\u00E5ste v\u00E4rdet ''{1}'' f\u00F6r aspekt ''{2}'' komma fr\u00E5n v\u00E4rdeutrymmet i bastypen ''{3}''.
- FixedFacetValue = FixedFacetValue: I definitionen f\u00F6r {3} \u00E4r v\u00E4rdet ''{1}'' f\u00F6r aspekten ''{0}'' ogiltigt eftersom v\u00E4rdet f\u00F6r ''{0}'' har angetts som ''{2}'' i n\u00E5gon av typerna f\u00F6r \u00F6verordnade samtidigt som '{'fast'}' = true.
- InvalidRegex = InvalidRegex: M\u00F6nsterv\u00E4rdet ''{0}'' \u00E4r inte n\u00E5got giltigt regulj\u00E4rt uttryck. Det rapporterade felet \u00E4r: ''{1}'' i kolumn ''{2}''.
- MaxOccurLimit = Den aktuella konfigurationen f\u00F6r parsern till\u00E5ter inte att attributv\u00E4rdet f\u00F6r Occurs anges som st\u00F6rre \u00E4n v\u00E4rdet {0}.
- PublicSystemOnNotation = PublicSystemOnNotation: \u00C5tminstone ett av ''public'' och ''system'' m\u00E5ste anges i elementets ''notation''.
- SchemaLocation = SchemaLocation: schemaLocation-v\u00E4rdet ''{0}'' m\u00E5ste anges med ett j\u00E4mnt antal URI:er.
- TargetNamespace.1 = TargetNamespace.1: F\u00F6rv\u00E4ntade namnrymden ''{0}'', men m\u00E5lnamnrymden f\u00F6r schemadokumentet \u00E4r ''{1}''.
- TargetNamespace.2 = TargetNamespace.2: F\u00F6rv\u00E4ntade inte n\u00E5gon namnrymd, men schemadokumentet har angetts med m\u00E5lnamnrymden ''{1}''.
- UndeclaredEntity = UndeclaredEntity: Enhet ''{0}'' har inte deklarerats.
- UndeclaredPrefix = UndeclaredPrefix: Kan inte matcha ''{0}'' som QName: prefixet ''{1}'' har inte deklarerats.
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_zh_CN.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_zh_CN.properties
deleted file mode 100644
index c05aacc..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_zh_CN.properties
+++ /dev/null
@@ -1,291 +0,0 @@
-# This file contains error and warning messages related to XML Schema
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
- BadMessageKey = \u627E\u4E0D\u5230\u4E0E\u6D88\u606F\u5173\u952E\u5B57\u5BF9\u5E94\u7684\u9519\u8BEF\u6D88\u606F\u3002
- FormatFailed = \u8BBE\u7F6E\u4EE5\u4E0B\u6D88\u606F\u7684\u683C\u5F0F\u65F6\u51FA\u73B0\u5185\u90E8\u9519\u8BEF:\n
-
-# For internal use
-
- Internal-Error = \u5185\u90E8\u9519\u8BEF: {0}\u3002
- dt-whitespace = \u7A7A\u767D\u9762\u503C\u4E0D\u53EF\u7528\u4E8E\u8054\u5408 simpleType ''{0}''
- GrammarConflict = \u7528\u6237\u7684\u8BED\u6CD5\u6C60\u8FD4\u56DE\u7684\u8BED\u6CD5\u4E4B\u4E00\u4E0E\u53E6\u4E00\u4E2A\u8BED\u6CD5\u51B2\u7A81\u3002
-
-# Identity constraints
-
- AbsentKeyValue = \u8EAB\u4EFD\u7EA6\u675F\u6761\u4EF6\u9519\u8BEF (cvc-identity-constraint.4.2.1): \u5143\u7D20 "{0}" \u7684\u4E00\u4E2A\u5173\u952E\u5B57\u6CA1\u6709\u503C\u3002
- DuplicateField = \u5B57\u6BB5 "{0}" \u5728\u4F5C\u7528\u57DF\u5185\u6709\u91CD\u590D\u5339\u914D\u3002
- DuplicateKey = \u4E3A\u5143\u7D20 "{1}" \u7684\u8EAB\u4EFD\u7EA6\u675F\u6761\u4EF6\u58F0\u660E\u7684\u5173\u952E\u5B57\u503C [{0}] \u91CD\u590D\u3002
- DuplicateUnique = \u4E3A\u5143\u7D20 "{1}" \u7684\u8EAB\u4EFD\u7EA6\u675F\u6761\u4EF6\u58F0\u660E\u7684\u552F\u4E00\u503C [{0}] \u91CD\u590D\u3002
- FieldMultipleMatch = \u8EAB\u4EFD\u7EA6\u675F\u6761\u4EF6\u9519\u8BEF: \u5B57\u6BB5 "{0}" \u4E0E\u5176\u9009\u62E9\u5668\u4F5C\u7528\u57DF\u5185\u7684\u591A\u4E2A\u503C\u5339\u914D; \u5B57\u6BB5\u5FC5\u987B\u4E0E\u552F\u4E00\u503C\u5339\u914D\u3002
- FixedDiffersFromActual = \u6B64\u5143\u7D20\u7684\u5185\u5BB9\u4E0E\u65B9\u6848\u4E2D\u5143\u7D20\u58F0\u660E\u7684 "fixed" \u5C5E\u6027\u7684\u503C\u4E0D\u76F8\u540C\u3002
- KeyMatchesNillable = \u8EAB\u4EFD\u7EA6\u675F\u6761\u4EF6\u9519\u8BEF (cvc-identity-constraint.4.2.3): \u5143\u7D20 "{0}" \u5177\u6709\u4E00\u4E2A\u4E0E nillable \u8BBE\u7F6E\u4E3A\u201C\u771F\u201D\u7684\u5143\u7D20\u5339\u914D\u7684\u5173\u952E\u5B57\u3002
- KeyNotEnoughValues = \u5BF9\u4E8E\u4E3A\u5143\u7D20 "{0}" \u6307\u5B9A\u7684 <key name="{1}"> \u8EAB\u4EFD\u7EA6\u675F\u6761\u4EF6, \u6CA1\u6709\u4E3A\u5B83\u6307\u5B9A\u8DB3\u591F\u7684\u503C\u3002
- KeyNotFound = \u6CA1\u6709\u4E3A\u5143\u7D20 ''{2}'' \u7684\u8EAB\u4EFD\u7EA6\u675F\u6761\u4EF6\u627E\u5230\u503C\u4E3A ''{1}'' \u7684\u5173\u952E\u5B57 ''{0}''\u3002
- KeyRefNotEnoughValues = \u5BF9\u4E8E\u4E3A\u5143\u7D20 "{0}" \u6307\u5B9A\u7684 <keyref name="{1}"> \u8EAB\u4EFD\u7EA6\u675F\u6761\u4EF6, \u6CA1\u6709\u4E3A\u5B83\u6307\u5B9A\u8DB3\u591F\u7684\u503C\u3002
- KeyRefOutOfScope = \u8EAB\u4EFD\u7EA6\u675F\u6761\u4EF6\u9519\u8BEF: \u8EAB\u4EFD\u7EA6\u675F\u6761\u4EF6 "{0}" \u5177\u6709\u4E00\u4E2A\u5F15\u7528\u4E86\u4F5C\u7528\u57DF\u4E4B\u5916\u7684\u5173\u952E\u5B57\u6216\u552F\u4E00\u503C\u7684 keyref\u3002
- KeyRefReferNotFound = \u5173\u952E\u5B57\u5F15\u7528\u58F0\u660E "{0}" \u5F15\u7528\u4E86\u540D\u4E3A "{1}" \u7684\u672A\u77E5\u5173\u952E\u5B57\u3002
- UniqueNotEnoughValues = \u5BF9\u4E8E\u4E3A\u5143\u7D20 "{0}" \u6307\u5B9A\u7684 <unique> \u8EAB\u4EFD\u7EA6\u675F\u6761\u4EF6, \u6CA1\u6709\u4E3A\u5B83\u6307\u5B9A\u8DB3\u591F\u7684\u503C\u3002
- UnknownField = \u5185\u90E8\u8EAB\u4EFD\u7EA6\u675F\u6761\u4EF6\u9519\u8BEF; \u5B57\u6BB5 "{0}" \u672A\u77E5\u3002
-
-# Ideally, we should only use the following error keys, not the ones under
-# "Identity constraints". And we should cover all of the following errors.
-
-#validation (3.X.4)
-
- cvc-attribute.3 = cvc-attribute.3: \u5728\u5143\u7D20 ''{0}'' \u4E2D, \u5C5E\u6027 ''{1}'' \u7684\u503C ''{2}'' \u4E0E\u5176\u7C7B\u578B ''{3}'' \u4E0D\u5339\u914D\u3002
- cvc-attribute.4 = cvc-attribute.4: \u5728\u5143\u7D20 ''{0}'' \u4E2D, \u5C5E\u6027 ''{1}'' \u7684\u503C ''{2}'' \u4E0E\u5176\u56FA\u5B9A\u7684 '{'value constraint'}' \u4E0D\u5339\u914D\u3002\u8BE5\u5C5E\u6027\u7684\u503C\u5FC5\u987B\u4E3A ''{3}''\u3002
- cvc-complex-type.2.1 = cvc-complex-type.2.1: \u5143\u7D20 ''{0}'' \u5FC5\u987B\u4E0D\u542B\u5B57\u7B26\u6216\u5143\u7D20\u4FE1\u606F\u9879 [\u5B50\u7EA7], \u56E0\u4E3A\u8BE5\u7C7B\u578B\u7684\u5185\u5BB9\u7C7B\u578B\u4E3A\u7A7A\u3002
- cvc-complex-type.2.2 = cvc-complex-type.2.2: \u5143\u7D20 ''{0}'' \u5FC5\u987B\u4E0D\u542B\u5143\u7D20 [\u5B50\u7EA7], \u5E76\u4E14\u5176\u503C\u5FC5\u987B\u6709\u6548\u3002
- cvc-complex-type.2.3 = cvc-complex-type.2.3: \u5143\u7D20 ''{0}'' \u5FC5\u987B\u4E0D\u542B\u5B57\u7B26 [\u5B50\u7EA7], \u56E0\u4E3A\u8BE5\u7C7B\u578B\u7684\u5185\u5BB9\u7C7B\u578B\u4E3A\u201C\u4EC5\u5143\u7D20\u201D\u3002
- cvc-complex-type.2.4.a = cvc-complex-type.2.4.a: \u53D1\u73B0\u4E86\u4EE5\u5143\u7D20 ''{0}'' \u5F00\u5934\u7684\u65E0\u6548\u5185\u5BB9\u3002\u5E94\u4EE5 ''{1}'' \u4E4B\u4E00\u5F00\u5934\u3002
- cvc-complex-type.2.4.b = cvc-complex-type.2.4.b: \u5143\u7D20 ''{0}'' \u7684\u5185\u5BB9\u4E0D\u5B8C\u6574\u3002\u5E94\u4E3A ''{1}'' \u4E4B\u4E00\u3002
- cvc-complex-type.2.4.c = cvc-complex-type.2.4.c: \u901A\u914D\u7B26\u7684\u5339\u914D\u5F88\u5168\u9762, \u4F46\u65E0\u6CD5\u627E\u5230\u5143\u7D20 ''{0}'' \u7684\u58F0\u660E\u3002
- cvc-complex-type.2.4.d = cvc-complex-type.2.4.d: \u53D1\u73B0\u4E86\u4EE5\u5143\u7D20 ''{0}'' \u5F00\u5934\u7684\u65E0\u6548\u5185\u5BB9\u3002\u6B64\u5904\u4E0D\u5E94\u542B\u6709\u5B50\u5143\u7D20\u3002
- cvc-complex-type.2.4.e = cvc-complex-type.2.4.d: \u53D1\u73B0\u4E86\u4EE5\u5143\u7D20 ''{0}'' \u5F00\u5934\u7684\u65E0\u6548\u5185\u5BB9\u3002\u6B64\u5904\u4E0D\u5E94\u542B\u6709\u5B50\u5143\u7D20 ''{1}''\u3002
- cvc-complex-type.3.1 = cvc-complex-type.3.1: \u5728\u5143\u7D20 ''{0}'' \u4E2D, \u5C5E\u6027 ''{1}'' \u7684\u503C ''{2}'' \u4E0E\u76F8\u5E94\u7684\u5C5E\u6027\u7528\u6CD5\u4E0D\u5339\u914D\u3002\u5C5E\u6027 ''{1}'' \u5177\u6709\u56FA\u5B9A\u503C ''{3}''\u3002
- cvc-complex-type.3.2.1 = cvc-complex-type.3.2.1: \u5143\u7D20 ''{0}'' \u6CA1\u6709\u5C5E\u6027 ''{1}'' \u7684\u5C5E\u6027\u901A\u914D\u7B26\u3002
- cvc-complex-type.3.2.2 = cvc-complex-type.3.2.2: \u5143\u7D20 ''{0}'' \u4E2D\u4E0D\u5141\u8BB8\u51FA\u73B0\u5C5E\u6027 ''{1}''\u3002
- cvc-complex-type.4 = cvc-complex-type.4: \u5143\u7D20 ''{0}'' \u4E2D\u5FC5\u987B\u5305\u542B\u5C5E\u6027 ''{1}''\u3002
- cvc-complex-type.5.1 = cvc-complex-type.5.1: \u5728\u5143\u7D20 ''{0}'' \u4E2D, \u5C5E\u6027 ''{1}'' \u662F\u4E00\u4E2A\u901A\u7528 ID\u3002\u4F46\u5DF2\u5B58\u5728\u901A\u7528 ID ''{2}''\u3002\u53EA\u80FD\u6709\u4E00\u4E2A\u901A\u7528 ID\u3002
- cvc-complex-type.5.2 = cvc-complex-type.5.2: \u5728\u5143\u7D20 ''{0}'' \u4E2D, \u5C5E\u6027 ''{1}'' \u662F\u4E00\u4E2A\u901A\u7528 ID\u3002\u4F46\u5DF2\u6709\u4E00\u4E2A\u5C5E\u6027 ''{2}'' \u662F\u4ECE '{'attribute uses'}' \u4E2D\u7684 ID \u6D3E\u751F\u7684\u3002
- cvc-datatype-valid.1.2.1 = cvc-datatype-valid.1.2.1: ''{0}'' \u4E0D\u662F ''{1}'' \u7684\u6709\u6548\u503C\u3002
- cvc-datatype-valid.1.2.2 = cvc-datatype-valid.1.2.2: ''{0}'' \u4E0D\u662F\u5217\u8868\u7C7B\u578B ''{1}'' \u7684\u6709\u6548\u503C\u3002
- cvc-datatype-valid.1.2.3 = cvc-datatype-valid.1.2.3: ''{0}'' \u4E0D\u662F\u8054\u5408\u7C7B\u578B ''{1}'' \u7684\u6709\u6548\u503C\u3002
- cvc-elt.1 = cvc-elt.1: \u627E\u4E0D\u5230\u5143\u7D20 ''{0}'' \u7684\u58F0\u660E\u3002
- cvc-elt.2 = cvc-elt.2: ''{0}'' \u7684\u5143\u7D20\u58F0\u660E\u4E2D '{'abstract'}' \u7684\u503C\u5FC5\u987B\u4E3A\u201C\u5047\u201D\u3002
- cvc-elt.3.1 = cvc-elt.3.1: \u5143\u7D20 ''{0}'' \u4E2D\u4E0D\u80FD\u5305\u542B\u5C5E\u6027 ''{1}'', \u56E0\u4E3A ''{0}'' \u7684 '{'nillable'}' \u5C5E\u6027\u4E3A\u201C\u5047\u201D\u3002
- cvc-elt.3.2.1 = cvc-elt.3.2.1: \u5143\u7D20 ''{0}'' \u5FC5\u987B\u4E0D\u542B\u5B57\u7B26\u6216\u5143\u7D20\u4FE1\u606F [\u5B50\u7EA7], \u56E0\u4E3A\u5DF2\u6307\u5B9A ''{1}''\u3002
- cvc-elt.3.2.2 = cvc-elt.3.2.2: \u5143\u7D20 ''{0}'' \u4E0D\u80FD\u5305\u542B\u56FA\u5B9A\u7684 '{'value constraint'}', \u56E0\u4E3A\u5DF2\u6307\u5B9A ''{1}''\u3002
- cvc-elt.4.1 = cvc-elt.4.1: \u5143\u7D20 ''{0}'' \u7684\u5C5E\u6027 ''{1}'' \u7684\u503C ''{2}'' \u4E0D\u662F\u6709\u6548\u7684\u9650\u5B9A\u540D\u3002
- cvc-elt.4.2 = cvc-elt.4.2: \u65E0\u6CD5\u5C06 ''{1}'' \u89E3\u6790\u4E3A\u5143\u7D20 ''{0}'' \u7684\u7C7B\u578B\u5B9A\u4E49\u3002
- cvc-elt.4.3 = cvc-elt.4.3: \u7C7B\u578B ''{1}'' \u4E0D\u662F\u4ECE\u5143\u7D20 ''{0}'' \u7684\u7C7B\u578B\u5B9A\u4E49 ''{2}'' \u6709\u6548\u6D3E\u751F\u7684\u3002
- cvc-elt.5.1.1 = cvc-elt.5.1.1: \u5143\u7D20 ''{0}'' \u7684 '{'value constraint'}' ''{2}'' \u4E0D\u662F\u7C7B\u578B ''{1}'' \u7684\u6709\u6548\u9ED8\u8BA4\u503C\u3002
- cvc-elt.5.2.2.1 = cvc-elt.5.2.2.1: \u5143\u7D20 ''{0}'' \u5FC5\u987B\u4E0D\u542B\u5143\u7D20\u4FE1\u606F\u9879 [\u5B50\u7EA7]\u3002
- cvc-elt.5.2.2.2.1 = cvc-elt.5.2.2.2.1: \u5143\u7D20 ''{0}'' \u7684\u503C ''{1}'' \u4E0E\u56FA\u5B9A\u7684 '{'value constraint'}' \u503C ''{2}'' \u4E0D\u5339\u914D\u3002
- cvc-elt.5.2.2.2.2 = cvc-elt.5.2.2.2.2: \u5143\u7D20 ''{0}'' \u7684\u503C ''{1}'' \u4E0E '{'value constraint'}' \u503C ''{2}'' \u4E0D\u5339\u914D\u3002
- cvc-enumeration-valid = cvc-enumeration-valid: \u5BF9\u4E8E\u679A\u4E3E ''{1}'', \u503C ''{0}'' \u4E0D\u5177\u6709\u9762\u6709\u6548\u6027\u3002\u5B83\u5FC5\u987B\u662F\u6765\u81EA\u679A\u4E3E\u7684\u503C\u3002
- cvc-fractionDigits-valid = cvc-fractionDigits-valid: \u503C ''{0}'' \u5177\u6709 {1} \u4F4D\u5C0F\u6570, \u4F46\u5C0F\u6570\u4F4D\u6570\u5DF2\u9650\u5236\u4E3A {2}\u3002
- cvc-id.1 = cvc-id.1: IDREF ''{0}'' \u6CA1\u6709 ID/IDREF \u7ED1\u5B9A\u3002
- cvc-id.2 = cvc-id.2: ID \u503C ''{0}'' \u51FA\u73B0\u4E86\u591A\u6B21\u3002
- cvc-id.3 = cvc-id.3: \u8EAB\u4EFD\u7EA6\u675F\u6761\u4EF6 ''{0}'' \u7684\u5B57\u6BB5\u4E0E\u5143\u7D20 ''{1}'' \u5339\u914D, \u4F46\u6B64\u5143\u7D20\u6CA1\u6709\u7B80\u5355\u7C7B\u578B\u3002
- cvc-length-valid = cvc-length-valid: \u5BF9\u4E8E\u7C7B\u578B\u4E3A ''{3}'' \u7684 length ''{2}'', length = ''{1}'' \u7684\u503C ''{0}'' \u4E0D\u5177\u6709\u9762\u6709\u6548\u6027\u3002
- cvc-maxExclusive-valid = cvc-maxExclusive-valid: \u5BF9\u4E8E\u7C7B\u578B\u4E3A ''{2}'' \u7684 maxExclusive ''{1}'', \u503C ''{0}'' \u4E0D\u5177\u6709\u9762\u6709\u6548\u6027\u3002
- cvc-maxInclusive-valid = cvc-maxInclusive-valid: \u5BF9\u4E8E\u7C7B\u578B\u4E3A ''{2}'' \u7684 maxInclusive ''{1}'', \u503C ''{0}'' \u4E0D\u5177\u6709\u9762\u6709\u6548\u6027\u3002
- cvc-maxLength-valid = cvc-maxLength-valid: \u5BF9\u4E8E\u7C7B\u578B\u4E3A ''{3}'' \u7684 maxLength ''{2}'', length = ''{1}'' \u7684\u503C ''{0}'' \u4E0D\u5177\u6709\u9762\u6709\u6548\u6027\u3002
- cvc-minExclusive-valid = cvc-minExclusive-valid: \u5BF9\u4E8E\u7C7B\u578B\u4E3A ''{2}'' \u7684 minExclusive ''{1}'', \u503C ''{0}'' \u4E0D\u5177\u6709\u9762\u6709\u6548\u6027\u3002
- cvc-minInclusive-valid = cvc-minInclusive-valid: \u5BF9\u4E8E\u7C7B\u578B\u4E3A ''{2}'' \u7684 minInclusive ''{1}'', \u503C ''{0}'' \u4E0D\u5177\u6709\u9762\u6709\u6548\u6027\u3002
- cvc-minLength-valid = cvc-minLength-valid: \u5BF9\u4E8E\u7C7B\u578B\u4E3A ''{3}'' \u7684 minLength ''{2}'', length = ''{1}'' \u7684\u503C ''{0}'' \u4E0D\u5177\u6709\u9762\u6709\u6548\u6027\u3002
- cvc-pattern-valid = cvc-pattern-valid: \u5BF9\u4E8E\u7C7B\u578B\u4E3A ''{2}'' \u7684\u6A21\u5F0F ''{1}'', \u503C ''{0}'' \u4E0D\u5177\u6709\u9762\u6709\u6548\u6027\u3002
- cvc-totalDigits-valid = cvc-totalDigits-valid: \u503C ''{0}'' \u603B\u5171\u6709 {1} \u4F4D, \u4F46\u603B\u4F4D\u6570\u5DF2\u9650\u5236\u4E3A {2}\u3002
- cvc-type.2 = cvc-type.2: \u65E0\u6CD5\u4E3A\u5143\u7D20 {0} \u63D0\u53D6\u7C7B\u578B\u5B9A\u4E49\u3002
- cvc-type.3.1.1 = cvc-type.3.1.1: \u5143\u7D20 ''{0}'' \u662F\u7B80\u5355\u7C7B\u578B, \u56E0\u6B64\u5FC5\u987B\u4E0D\u542B\u5C5E\u6027 (\u9664\u4E86\u90A3\u4E9B\u540D\u79F0\u7A7A\u95F4\u540D\u4E0E ''http://www.w3.org/2001/XMLSchema-instance'' \u76F8\u540C\u4E14 [\u672C\u5730\u540D\u79F0] \u4E3A ''type'', ''nil'', ''schemaLocation'' \u6216 ''noNamespaceSchemaLocation'' \u7684\u5143\u7D20)\u3002\u4F46\u662F\u53D1\u73B0\u4E86\u5C5E\u6027 ''{1}''\u3002
- cvc-type.3.1.2 = cvc-type.3.1.2: \u5143\u7D20 ''{0}'' \u662F\u7B80\u5355\u7C7B\u578B, \u56E0\u6B64\u5B83\u5FC5\u987B\u4E0D\u542B\u5143\u7D20\u4FE1\u606F\u9879 [\u5B50\u7EA7]\u3002
- cvc-type.3.1.3 = cvc-type.3.1.3: \u5143\u7D20 ''{0}'' \u7684\u503C ''{1}'' \u65E0\u6548\u3002
-
-#schema valid (3.X.3)
-
- schema_reference.access = schema_reference: \u7531\u4E8E accessExternalSchema \u5C5E\u6027\u8BBE\u7F6E\u7684\u9650\u5236\u800C\u4E0D\u5141\u8BB8 ''{1}'' \u8BBF\u95EE, \u56E0\u6B64\u65E0\u6CD5\u8BFB\u53D6\u65B9\u6848\u6587\u6863 ''{0}''\u3002
- schema_reference.4 = schema_reference.4: \u65E0\u6CD5\u8BFB\u53D6\u65B9\u6848\u6587\u6863 ''{0}'', \u539F\u56E0\u4E3A 1) \u65E0\u6CD5\u627E\u5230\u6587\u6863; 2) \u65E0\u6CD5\u8BFB\u53D6\u6587\u6863; 3) \u6587\u6863\u7684\u6839\u5143\u7D20\u4E0D\u662F <xsd:schema>\u3002
- src-annotation = src-annotation: <annotation> \u5143\u7D20\u53EA\u80FD\u5305\u542B <appinfo> \u548C <documentation> \u5143\u7D20, \u4F46\u53D1\u73B0\u4E86 ''{0}''\u3002
- src-attribute.1 = src-attribute.1: \u5C5E\u6027\u58F0\u660E ''{0}'' \u4E2D\u4E0D\u80FD\u540C\u65F6\u5B58\u5728\u7279\u6027 ''default'' \u548C ''fixed''\u3002\u5E94\u53EA\u4F7F\u7528\u5176\u4E2D\u4E00\u4E2A\u3002
- src-attribute.2 = src-attribute.2: \u5C5E\u6027 ''{0}'' \u4E2D\u5B58\u5728\u7279\u6027 ''default'', \u56E0\u6B64 ''use'' \u7684\u503C\u5FC5\u987B\u4E3A ''optional''\u3002
- src-attribute.3.1 = src-attribute.3.1: \u672C\u5730\u5C5E\u6027\u58F0\u660E\u4E2D\u5FC5\u987B\u5B58\u5728 'ref' \u6216 'name' \u4E4B\u4E00\u3002
- src-attribute.3.2 = src-attribute.3.2: \u5C5E\u6027\u5F15\u7528 ''{0}'' \u4E2D\u7684\u5185\u5BB9\u5FC5\u987B\u5339\u914D (\u6CE8\u91CA?)\u3002
- src-attribute.4 = src-attribute.4: \u5C5E\u6027 ''{0}'' \u540C\u65F6\u5177\u6709 ''type'' \u5C5E\u6027\u548C\u533F\u540D ''simpleType'' \u5B50\u7EA7\u3002\u4E00\u4E2A\u5C5E\u6027\u53EA\u80FD\u5177\u6709\u8FD9\u4E24\u8005\u4E4B\u4E00\u3002
- src-attribute_group.2 = src-attribute_group.2: \u65E0\u6CD5\u8868\u8FBE\u5C5E\u6027\u7EC4 ''{0}'' \u7684\u901A\u914D\u7B26\u4EA4\u96C6\u3002
- src-attribute_group.3 = src-attribute_group.3: \u5728\u5C5E\u6027\u7EC4 ''{0}'' \u4E2D\u68C0\u6D4B\u5230\u5FAA\u73AF\u5B9A\u4E49\u3002\u9012\u5F52\u8DDF\u968F\u5C5E\u6027\u7EC4\u5F15\u7528\u6700\u7EC8\u5C06\u5F15\u5BFC\u56DE\u81EA\u8EAB\u3002
- src-ct.1 = src-ct.1: \u7C7B\u578B ''{0}'' \u7684\u590D\u6742\u7C7B\u578B\u5B9A\u4E49\u7684\u8868\u8FBE\u5F62\u5F0F\u9519\u8BEF\u3002\u4F7F\u7528 <complexContent> \u65F6, \u57FA\u7C7B\u578B\u5FC5\u987B\u4E3A complexType\u3002''{1}'' \u662F simpleType\u3002
- src-ct.2.1 = src-ct.2.1: \u7C7B\u578B ''{0}'' \u7684\u590D\u6742\u7C7B\u578B\u5B9A\u4E49\u7684\u8868\u8FBE\u5F62\u5F0F\u9519\u8BEF\u3002\u4F7F\u7528 <simpleContent> \u65F6, \u57FA\u7C7B\u578B\u5FC5\u987B\u4E3A complexType, \u5176\u5185\u5BB9\u7C7B\u578B\u4E3A\u201C\u7B80\u5355\u201D, \u6216\u8005\u4E3A\u5177\u6709\u201C\u6DF7\u5408\u201D\u5185\u5BB9\u548C\u53EF\u7A7A\u7C92\u5B50\u7684\u590D\u6742\u7C7B\u578B (\u4EC5\u5F53\u6307\u5B9A\u4E86\u9650\u5236\u65F6), \u6216\u8005\u4E3A\u7B80\u5355\u7C7B\u578B (\u4EC5\u5F53\u6307\u5B9A\u4E86\u6269\u5C55\u65F6)\u3002''{1}'' \u4E0D\u6EE1\u8DB3\u6240\u6709\u8FD9\u4E9B\u6761\u4EF6\u3002
- src-ct.2.2 = src-ct.2.2: \u7C7B\u578B ''{0}'' \u7684\u590D\u6742\u7C7B\u578B\u5B9A\u4E49\u7684\u8868\u8FBE\u5F62\u5F0F\u9519\u8BEF\u3002\u5982\u679C\u5177\u6709 simpleContent \u7684 complexType \u9650\u5236\u5177\u6709\u201C\u6DF7\u5408\u201D\u5185\u5BB9\u548C\u53EF\u7A7A\u7C92\u5B50\u7684 complexType, \u90A3\u4E48 <restriction> \u7684\u5B50\u7EA7\u4E2D\u5FC5\u987B\u5B58\u5728 <simpleType>\u3002
- src-ct.4 = src-ct.4: \u7C7B\u578B ''{0}'' \u7684\u590D\u6742\u7C7B\u578B\u5B9A\u4E49\u7684\u8868\u8FBE\u5F62\u5F0F\u9519\u8BEF\u3002\u65E0\u6CD5\u8868\u8FBE\u901A\u914D\u7B26\u7684\u4EA4\u96C6\u3002
- src-ct.5 = src-ct.5: \u7C7B\u578B ''{0}'' \u7684\u590D\u6742\u7C7B\u578B\u5B9A\u4E49\u7684\u8868\u8FBE\u5F62\u5F0F\u9519\u8BEF\u3002\u65E0\u6CD5\u8868\u8FBE\u901A\u914D\u7B26\u7684\u5E76\u96C6\u3002
- src-element.1 = src-element.1: \u5143\u7D20\u58F0\u660E ''{0}'' \u4E2D\u4E0D\u80FD\u540C\u65F6\u5B58\u5728\u5C5E\u6027 ''default'' \u548C ''fixed''\u3002\u5E94\u53EA\u4F7F\u7528\u5176\u4E2D\u4E00\u4E2A\u3002
- src-element.2.1 = src-element.2.1: \u672C\u5730\u5143\u7D20\u58F0\u660E\u4E2D\u5FC5\u987B\u5B58\u5728 'ref' \u6216 'name'\u3002
- src-element.2.2 = src-element.2.2: \u7531\u4E8E ''{0}'' \u5305\u542B ''ref'' \u5C5E\u6027, \u5176\u5185\u5BB9\u5FC5\u987B\u5339\u914D (\u6CE8\u91CA?)\u3002\u4F46\u662F, \u53D1\u73B0\u4E86 ''{1}''\u3002
- src-element.3 = src-element.3: \u5143\u7D20 ''{0}'' \u540C\u65F6\u5177\u6709 ''type'' \u5C5E\u6027\u548C ''anonymous type'' \u5B50\u7EA7\u3002\u5143\u7D20\u4E2D\u53EA\u5141\u8BB8\u5177\u6709\u5176\u4E2D\u4E00\u9879\u3002
- src-import.1.1 = src-import.1.1: <import> \u5143\u7D20\u4FE1\u606F\u9879\u7684\u540D\u79F0\u7A7A\u95F4\u5C5E\u6027 ''{0}'' \u4E0D\u80FD\u4E0E\u65B9\u6848\u4E2D\u5176\u62E5\u6709\u7684 targetNamespace \u76F8\u540C\u3002
- src-import.1.2 = src-import.1.2: \u5982\u679C <import> \u5143\u7D20\u4FE1\u606F\u9879\u4E2D\u4E0D\u5B58\u5728\u540D\u79F0\u7A7A\u95F4\u5C5E\u6027, \u5219\u5C01\u95ED\u65B9\u6848\u4E2D\u5FC5\u987B\u5177\u6709 targetNamespace\u3002
- src-import.2 = src-import.2: \u6587\u6863 ''{0}'' \u7684\u6839\u5143\u7D20\u5FC5\u987B\u5177\u6709\u540D\u79F0\u7A7A\u95F4\u540D ''http://www.w3.org/2001/XMLSchema'' \u548C\u672C\u5730\u540D\u79F0 ''schema''\u3002
- src-import.3.1 = src-import.3.1: <import> \u5143\u7D20\u4FE1\u606F\u9879\u7684\u540D\u79F0\u7A7A\u95F4\u5C5E\u6027 ''{0}'' \u5FC5\u987B\u4E0E\u5BFC\u5165\u6587\u6863\u7684 targetNamespace \u5C5E\u6027 ''{1}'' \u76F8\u540C\u3002
- src-import.3.2 = src-import.3.2: \u53D1\u73B0\u4E86\u6CA1\u6709\u540D\u79F0\u7A7A\u95F4\u5C5E\u6027\u7684 <import> \u5143\u7D20\u4FE1\u606F\u9879, \u56E0\u6B64\u5BFC\u5165\u6587\u6863\u5FC5\u987B\u4E0D\u542B targetNamespace \u5C5E\u6027\u3002\u4F46\u662F, \u5728\u5BFC\u5165\u6587\u6863\u4E2D\u53D1\u73B0\u4E86 targetNamespace ''{1}''\u3002
- src-include.1 = src-include.1: \u6587\u6863 ''{0}'' \u7684\u6839\u5143\u7D20\u5FC5\u987B\u5177\u6709\u540D\u79F0\u7A7A\u95F4\u540D ''http://www.w3.org/2001/XMLSchema'' \u548C\u672C\u5730\u540D\u79F0 ''schema''\u3002
- src-include.2.1 = src-include.2.1: \u5F15\u7528\u7684\u65B9\u6848 (\u5F53\u524D\u4E3A ''{1}'') \u7684 targetNamespace \u5FC5\u987B\u4E0E\u5305\u542B\u7684\u65B9\u6848 (\u5F53\u524D\u4E3A ''{0}'') \u7684 targetNamespace \u76F8\u540C\u3002
- src-redefine.2 = src-redefine.2: \u6587\u6863 ''{0}'' \u7684\u6839\u5143\u7D20\u5FC5\u987B\u5177\u6709\u540D\u79F0\u7A7A\u95F4\u540D ''http://www.w3.org/2001/XMLSchema'' \u548C\u672C\u5730\u540D\u79F0 ''schema''\u3002
- src-redefine.3.1 = src-redefine.3.1: \u5F15\u7528\u7684\u65B9\u6848 (\u5F53\u524D\u4E3A ''{1}'') \u7684 targetNamespace \u5FC5\u987B\u4E0E\u91CD\u65B0\u5B9A\u4E49\u7684\u65B9\u6848 (\u5F53\u524D\u4E3A ''{0}'') \u7684 targetNamespace \u76F8\u540C\u3002
- src-redefine.5.a.a = src-redefine.5.a.a: \u627E\u4E0D\u5230 <simpleType> \u7684\u975E\u6CE8\u91CA\u5B50\u7EA7\u3002<redefine> \u5143\u7D20\u7684 <simpleType> \u5B50\u7EA7\u5FC5\u987B\u5177\u6709 <restriction> \u5B50\u9879, \u5E76\u5E26\u6709\u5F15\u7528\u5176\u81EA\u8EAB\u7684 'base' \u5C5E\u6027\u3002
- src-redefine.5.a.b = src-redefine.5.a.b: ''{0}'' \u4E0D\u662F\u6709\u6548\u7684\u5B50\u5143\u7D20\u3002<redefine> \u5143\u7D20\u7684 <simpleType> \u5B50\u7EA7\u5FC5\u987B\u5177\u6709 <restriction> \u5B50\u9879, \u5E76\u5E26\u6709\u5F15\u7528\u5176\u81EA\u8EAB\u7684 ''base'' \u5C5E\u6027\u3002
- src-redefine.5.a.c = src-redefine.5.a.c: ''{0}'' \u4E0D\u542B\u5F15\u7528\u91CD\u65B0\u5B9A\u4E49\u7684\u5143\u7D20 ''{1}'' \u7684 ''base'' \u5C5E\u6027\u3002<redefine> \u5143\u7D20\u7684 <simpleType> \u5B50\u7EA7\u5FC5\u987B\u5177\u6709 <restriction> \u5B50\u9879, \u5E76\u5E26\u6709\u5F15\u7528\u5176\u81EA\u8EAB\u7684 ''base'' \u5C5E\u6027\u3002
- src-redefine.5.b.a = src-redefine.5.b.a: \u627E\u4E0D\u5230 <complexType> \u7684\u975E\u6CE8\u91CA\u5B50\u7EA7\u3002<redefine> \u5143\u7D20\u7684 <complexType> \u5B50\u7EA7\u5FC5\u987B\u5177\u6709 <extension> \u6216 <restriction> \u5B50\u9879, \u5E76\u5E26\u6709\u5F15\u7528\u5176\u81EA\u8EAB\u7684 'base' \u5C5E\u6027\u3002
- src-redefine.5.b.b = src-redefine.5.b.b: \u627E\u4E0D\u5230 <complexType> \u7684\u975E\u6CE8\u91CA\u5B50\u5B50\u7EA7\u3002<redefine> \u5143\u7D20\u7684 <complexType> \u5B50\u7EA7\u5FC5\u987B\u5177\u6709 <extension> \u6216 <restriction> \u5B50\u9879, \u5E76\u5E26\u6709\u5F15\u7528\u5176\u81EA\u8EAB\u7684 'base' \u5C5E\u6027\u3002
- src-redefine.5.b.c = src-redefine.5.b.c: ''{0}'' \u4E0D\u662F\u6709\u6548\u7684\u5B50\u5B50\u7EA7\u5143\u7D20\u3002<redefine> \u5143\u7D20\u7684 <complexType> \u5B50\u7EA7\u5FC5\u987B\u5177\u6709 <extension> \u6216 <restriction> \u5B50\u9879, \u5E76\u5E26\u6709\u5F15\u7528\u5176\u81EA\u8EAB\u7684 ''base'' \u5C5E\u6027\u3002
- src-redefine.5.b.d = src-redefine.5.b.d: ''{0}'' \u4E0D\u542B\u5F15\u7528\u91CD\u65B0\u5B9A\u4E49\u7684\u5143\u7D20 ''{1}'' \u7684 ''base'' \u5C5E\u6027\u3002<redefine> \u5143\u7D20\u7684 <complexType> \u5B50\u7EA7\u5FC5\u987B\u5177\u6709 <extension> \u6216 <restriction> \u5B50\u9879, \u5E76\u5E26\u6709\u5F15\u7528\u5176\u81EA\u8EAB\u7684 ''base'' \u5C5E\u6027\u3002
- src-redefine.6.1.1 = src-redefine.6.1.1: \u5982\u679C <redefine> \u5143\u7D20\u7684\u7EC4\u5B50\u7EA7\u5305\u542B\u5F15\u7528\u5176\u81EA\u8EAB\u7684\u7EC4, \u5219\u5B83\u5FC5\u987B\u6B63\u597D\u5305\u542B\u4E00\u4E2A\u7EC4; \u6B64\u7EC4\u5177\u6709 ''{0}''\u3002
- src-redefine.6.1.2 = src-redefine.6.1.2: \u7EC4 ''{0}'' (\u5305\u542B\u5BF9\u8981\u91CD\u65B0\u5B9A\u4E49\u7684\u7EC4\u7684\u5F15\u7528) \u5FC5\u987B\u6EE1\u8DB3 ''minOccurs'' = ''maxOccurs'' = 1\u3002
- src-redefine.6.2.1 = src-redefine.6.2.1: \u91CD\u65B0\u5B9A\u4E49\u7684\u65B9\u6848\u4E2D\u65E0\u540D\u79F0\u4E0E ''{0}'' \u5339\u914D\u7684\u7EC4\u3002
- src-redefine.6.2.2 = src-redefine.6.2.2: \u7EC4 ''{0}'' \u672A\u6B63\u786E\u9650\u5236\u5176\u91CD\u65B0\u5B9A\u4E49\u7684\u7EC4; \u8FDD\u53CD\u4E86\u7EA6\u675F\u6761\u4EF6: ''{1}''\u3002
- src-redefine.7.1 = src-redefine.7.1: \u5982\u679C <redefine> \u5143\u7D20\u7684 attributeGroup \u5B50\u7EA7\u5305\u542B\u5F15\u7528\u5176\u81EA\u8EAB\u7684 attributeGroup, \u5219\u5B83\u5FC5\u987B\u6B63\u597D\u5305\u542B\u4E00\u4E2A\u7EC4; \u6B64\u7EC4\u5177\u6709 {0}\u3002
- src-redefine.7.2.1 = src-redefine.7.2.1: \u91CD\u65B0\u5B9A\u4E49\u7684\u65B9\u6848\u4E2D\u6CA1\u6709\u540D\u79F0\u4E0E ''{0}'' \u5339\u914D\u7684 attributeGroup\u3002
- src-redefine.7.2.2 = src-redefine.7.2.2: AttributeGroup ''{0}'' \u672A\u6B63\u786E\u9650\u5236\u5176\u91CD\u65B0\u5B9A\u4E49\u7684 attributeGroup; \u8FDD\u53CD\u4E86\u7EA6\u675F\u6761\u4EF6: ''{1}''\u3002
- src-resolve = src-resolve: \u65E0\u6CD5\u5C06\u540D\u79F0 ''{0}'' \u89E3\u6790\u4E3A ''{1}'' \u7EC4\u4EF6\u3002
- src-resolve.4.1 = src-resolve.4.1: \u89E3\u6790\u7EC4\u4EF6 ''{2}'' \u65F6\u51FA\u9519\u3002\u5728\u8BE5\u7EC4\u4EF6\u4E2D\u68C0\u6D4B\u5230 ''{2}'' \u6CA1\u6709\u540D\u79F0\u7A7A\u95F4, \u4F46\u65E0\u6CD5\u4ECE\u65B9\u6848\u6587\u6863 ''{0}'' \u5F15\u7528\u6CA1\u6709\u76EE\u6807\u540D\u79F0\u7A7A\u95F4\u7684\u7EC4\u4EF6\u3002\u5982\u679C ''{2}'' \u9700\u8981\u5177\u6709\u540D\u79F0\u7A7A\u95F4, \u5219\u5F88\u53EF\u80FD\u9700\u8981\u63D0\u4F9B\u524D\u7F00\u3002\u5982\u679C ''{2}'' \u4E0D\u9700\u8981\u5177\u6709\u540D\u79F0\u7A7A\u95F4, \u5219\u5E94\u5C06\u6CA1\u6709 "namespace" \u5C5E\u6027\u7684 ''import'' \u6DFB\u52A0\u5230 ''{0}''\u3002
- src-resolve.4.2 = src-resolve.4.2: \u89E3\u6790\u7EC4\u4EF6 ''{2}'' \u65F6\u51FA\u9519\u3002\u5728\u8BE5\u7EC4\u4EF6\u4E2D\u68C0\u6D4B\u5230 ''{2}'' \u4F4D\u4E8E\u540D\u79F0\u7A7A\u95F4 ''{1}'' \u4E2D, \u4F46\u65E0\u6CD5\u4ECE\u65B9\u6848\u6587\u6863 ''{0}'' \u5F15\u7528\u6B64\u540D\u79F0\u7A7A\u95F4\u7684\u7EC4\u4EF6\u3002\u5982\u679C\u8FD9\u662F\u4E0D\u6B63\u786E\u7684\u540D\u79F0\u7A7A\u95F4, \u5219\u5F88\u53EF\u80FD\u9700\u8981\u66F4\u6539 ''{2}'' \u7684\u524D\u7F00\u3002\u5982\u679C\u8FD9\u662F\u6B63\u786E\u7684\u540D\u79F0\u7A7A\u95F4, \u5219\u5E94\u5C06\u9002\u5F53\u7684 ''import'' \u6807\u8BB0\u6DFB\u52A0\u5230 ''{0}''\u3002
- src-simple-type.2.a = src-simple-type.2.a: \u53D1\u73B0 <restriction> \u5143\u7D20\u7684 [\u5B50\u7EA7] \u4E2D\u540C\u65F6\u5177\u6709\u57FA [\u5C5E\u6027] \u548C <simpleType> \u5143\u7D20\u3002\u53EA\u5141\u8BB8\u5177\u6709\u4E00\u4E2A\u3002
- src-simple-type.2.b = src-simple-type.2.b: \u53D1\u73B0 <restriction> \u5143\u7D20\u7684 [\u5B50\u7EA7] \u4E2D\u65E2\u6CA1\u6709\u57FA [\u5C5E\u6027], \u4E5F\u6CA1\u6709 <simpleType> \u5143\u7D20\u3002\u5FC5\u987B\u5177\u6709\u5176\u4E2D\u4E00\u4E2A\u3002
- src-simple-type.3.a = src-simple-type.3.a: \u53D1\u73B0 <list> \u5143\u7D20\u7684 [\u5B50\u7EA7] \u4E2D\u540C\u65F6\u5177\u6709 itemType [\u5C5E\u6027] \u548C <simpleType> \u5143\u7D20\u3002\u53EA\u5141\u8BB8\u5177\u6709\u4E00\u4E2A\u3002
- src-simple-type.3.b = src-simple-type.3.b: \u53D1\u73B0 <list> \u5143\u7D20\u7684 [\u5B50\u7EA7] \u4E2D\u65E2\u6CA1\u6709 itemType [\u5C5E\u6027], \u4E5F\u6CA1\u6709 <simpleType> \u5143\u7D20\u3002\u5FC5\u987B\u5177\u6709\u5176\u4E2D\u4E00\u4E2A\u3002
- src-single-facet-value = src-single-facet-value: \u591A\u6B21\u5B9A\u4E49\u4E86\u9762 ''{0}''\u3002
- src-union-memberTypes-or-simpleTypes = src-union-memberTypes-or-simpleTypes: <union> \u5143\u7D20\u7684 [\u5B50\u7EA7] \u4E2D\u5FC5\u987B\u5177\u6709\u975E\u7A7A memberTypes [\u5C5E\u6027] \u6216\u81F3\u5C11\u4E00\u4E2A <simpleType> \u5143\u7D20\u3002
-
-#constraint valid (3.X.6)
-
- ag-props-correct.2 = ag-props-correct.2: \u5C5E\u6027\u7EC4 ''{0}'' \u9519\u8BEF\u3002\u6307\u5B9A\u4E86\u5177\u6709\u76F8\u540C\u540D\u79F0\u548C\u76EE\u6807\u540D\u79F0\u7A7A\u95F4\u7684\u91CD\u590D\u5C5E\u6027\u7528\u6CD5\u3002\u91CD\u590D\u5C5E\u6027\u7528\u6CD5\u7684\u540D\u79F0\u4E3A ''{1}''\u3002
- ag-props-correct.3 = ag-props-correct.3: \u5C5E\u6027\u7EC4 ''{0}'' \u9519\u8BEF\u3002\u4E24\u4E2A\u5C5E\u6027\u58F0\u660E ''{1}'' \u548C ''{2}'' \u5177\u6709\u7684\u7C7B\u578B\u662F\u4ECE ID \u6D3E\u751F\u7684\u3002
- a-props-correct.2 = a-props-correct.2: \u5C5E\u6027 ''{0}'' \u4E2D\u7684\u503C\u7EA6\u675F\u6761\u4EF6\u7684\u503C ''{1}'' \u65E0\u6548\u3002
- a-props-correct.3 = a-props-correct.3: \u5C5E\u6027 ''{0}'' \u4E0D\u80FD\u4F7F\u7528 ''fixed'' \u6216 ''default'', \u56E0\u4E3A\u5176 '{'type definition'}' \u4E3A ID, \u6216\u8005\u662F\u4ECE ID \u6D3E\u751F\u7684\u3002
- au-props-correct.2 = au-props-correct.2: \u5728 ''{0}'' \u7684\u5C5E\u6027\u58F0\u660E\u4E2D, \u6307\u5B9A\u4E86\u56FA\u5B9A\u503C ''{1}''\u3002\u56E0\u6B64\u5982\u679C\u5F15\u7528 ''{0}'' \u7684\u5C5E\u6027\u7528\u6CD5\u540C\u65F6\u5177\u6709 '{'value constraint'}', \u5219\u5B83\u5FC5\u987B\u662F\u56FA\u5B9A\u7684, \u5E76\u4E14\u5176\u503C\u5FC5\u987B\u4E3A ''{1}''\u3002
- cos-all-limited.1.2 = cos-all-limited.1.2: '{'min occurs'}' = '{'max occurs'}' = 1 \u7684\u7C92\u5B50\u4E2D\u5FC5\u987B\u5305\u542B 'all' \u6A21\u578B\u7EC4, \u8BE5\u7C92\u5B50\u5FC5\u987B\u662F\u7EC4\u6210\u590D\u6742\u7C7B\u578B\u5B9A\u4E49\u7684 '{'content type'}' \u5BF9\u7684\u4E00\u90E8\u5206\u3002
- cos-all-limited.2 = cos-all-limited.2: \u5728 ''all'' \u6A21\u578B\u7EC4\u4E2D\u5143\u7D20\u7684 '{'max occurs'}' \u5FC5\u987B\u4E3A 0 \u6216 1\u3002\u5143\u7D20 ''{1}'' \u7684\u503C ''{0}'' \u65E0\u6548\u3002
- cos-applicable-facets = cos-applicable-facets: \u7C7B\u578B {1} \u4E0D\u5141\u8BB8\u9762 ''{0}''\u3002
- cos-ct-extends.1.1 = cos-ct-extends.1.1: \u7C7B\u578B ''{0}'' \u662F\u4ECE\u7C7B\u578B ''{1}'' \u7684\u6269\u5C55\u6D3E\u751F\u7684\u3002\u4F46\u662F, ''{1}'' \u7684 ''final'' \u5C5E\u6027\u7981\u6B62\u7531\u6269\u5C55\u6D3E\u751F\u3002
- cos-ct-extends.1.4.3.2.2.1.a = cos-ct-extends.1.4.3.2.2.1.a: \u6D3E\u751F\u7C7B\u578B\u53CA\u5176\u57FA\u7C7B\u578B\u7684\u5185\u5BB9\u7C7B\u578B\u90FD\u5FC5\u987B\u4E3A\u201C\u6DF7\u5408\u201D\u6216\u201C\u4EC5\u5143\u7D20\u201D\u3002\u7C7B\u578B ''{0}'' \u4E3A\u201C\u4EC5\u5143\u7D20\u201D, \u4F46\u5176\u57FA\u7C7B\u578B\u4E0D\u662F\u3002
- cos-ct-extends.1.4.3.2.2.1.b = cos-ct-extends.1.4.3.2.2.1.b: \u6D3E\u751F\u7C7B\u578B\u53CA\u5176\u57FA\u7C7B\u578B\u7684\u5185\u5BB9\u7C7B\u578B\u90FD\u5FC5\u987B\u4E3A\u201C\u6DF7\u5408\u201D\u6216\u201C\u4EC5\u5143\u7D20\u201D\u3002\u7C7B\u578B ''{0}'' \u4E3A\u201C\u6DF7\u5408\u201D, \u4F46\u5176\u57FA\u7C7B\u578B\u4E0D\u662F\u3002
- cos-element-consistent = cos-element-consistent: \u7C7B\u578B ''{0}'' \u9519\u8BEF\u3002\u6A21\u578B\u7EC4\u4E2D\u5B58\u5728\u540D\u79F0\u4E3A ''{1}'' \u4E14\u5177\u6709\u4E0D\u540C\u7C7B\u578B\u7684\u591A\u4E2A\u5143\u7D20\u3002
- cos-list-of-atomic = cos-list-of-atomic: \u5728\u5217\u8868\u7C7B\u578B ''{0}'' \u7684\u5B9A\u4E49\u4E2D, \u7C7B\u578B ''{1}'' \u662F\u65E0\u6548\u7684\u5217\u8868\u5143\u7D20\u7C7B\u578B, \u56E0\u4E3A\u5B83\u4E0D\u662F\u539F\u5B50 (''{1}'' \u65E2\u4E0D\u662F\u5217\u8868\u7C7B\u578B, \u4E5F\u4E0D\u662F\u5305\u542B\u5217\u8868\u7684\u8054\u5408\u7C7B\u578B)\u3002
- cos-nonambig = cos-nonambig: {0} \u548C {1} (\u6216\u6765\u81EA\u5176\u66FF\u4EE3\u7EC4\u7684\u5143\u7D20) \u8FDD\u53CD\u4E86 "\u552F\u4E00\u7C92\u5B50\u5C5E\u6027"\u3002\u6839\u636E\u6B64\u65B9\u6848\u8FDB\u884C\u9A8C\u8BC1\u671F\u95F4, \u8FD9\u4E24\u4E2A\u7C92\u5B50\u4F1A\u9020\u6210\u6B67\u4E49\u3002
- cos-particle-restrict.a = cos-particle-restrict.a: \u6D3E\u751F\u7684\u7C92\u5B50\u4E3A\u7A7A, \u800C\u57FA\u7C92\u5B50\u4E0D\u53EF\u4E3A\u7A7A\u3002
- cos-particle-restrict.b = cos-particle-restrict.b: \u57FA\u7C92\u5B50\u4E3A\u7A7A, \u4F46\u6D3E\u751F\u7C92\u5B50\u4E0D\u4E3A\u7A7A\u3002
- cos-particle-restrict.2 = cos-particle-restrict.2: \u7981\u6B62\u7C92\u5B50\u9650\u5236: ''{0}''\u3002
- cos-st-restricts.1.1 = cos-st-restricts.1.1: \u7C7B\u578B ''{1}'' \u4E3A\u539F\u5B50, \u56E0\u6B64\u5176 '{'base type definition'}' ''{0}'' \u5FC5\u987B\u4E3A\u539F\u5B50\u7B80\u5355\u7C7B\u578B\u5B9A\u4E49\u6216\u5185\u7F6E\u57FA\u5143\u6570\u636E\u7C7B\u578B\u3002
- cos-st-restricts.2.1 = cos-st-restricts.2.1: \u5728\u5217\u8868\u7C7B\u578B ''{0}'' \u7684\u5B9A\u4E49\u4E2D, \u7C7B\u578B ''{1}'' \u662F\u65E0\u6548\u7684\u9879\u7C7B\u578B, \u56E0\u4E3A\u5B83\u65E2\u4E0D\u662F\u5217\u8868\u7C7B\u578B, \u4E5F\u4E0D\u662F\u5305\u542B\u5217\u8868\u7684\u8054\u5408\u7C7B\u578B\u3002
- cos-st-restricts.2.3.1.1 = cos-st-restricts.2.3.1.1: '{'item type definition'}' \u7684 '{'final'}' \u7EC4\u4EF6 ''{0}'' \u5305\u542B ''list''\u3002\u8FD9\u8868\u793A ''{0}'' \u4E0D\u80FD\u7528\u4F5C\u5217\u8868\u7C7B\u578B ''{1}'' \u7684\u9879\u7C7B\u578B\u3002
- cos-st-restricts.3.3.1.1 = cos-st-restricts.3.3.1.1: '{'member type definitions'}' ''{0}'' \u7684 '{'final'}' \u7EC4\u4EF6\u5305\u542B ''union''\u3002\u8FD9\u8868\u793A ''{0}'' \u4E0D\u80FD\u7528\u4F5C\u8054\u5408\u7C7B\u578B ''{1}'' \u7684\u6210\u5458\u7C7B\u578B\u3002
- cos-valid-default.2.1 = cos-valid-default.2.1: \u5143\u7D20 ''{0}'' \u5177\u6709\u503C\u7EA6\u675F\u6761\u4EF6, \u5E76\u4E14\u5FC5\u987B\u5177\u6709\u201C\u6DF7\u5408\u201D\u6216\u201C\u7B80\u5355\u201D\u5185\u5BB9\u6A21\u578B\u3002
- cos-valid-default.2.2.2 = cos-valid-default.2.2.2: \u7531\u4E8E\u5143\u7D20 ''{0}'' \u5177\u6709 '{'value constraint'}', \u5E76\u4E14\u5176\u7C7B\u578B\u5B9A\u4E49\u5177\u6709\u6DF7\u5408\u7684 '{'content type'}', \u5219 '{'content type'}' \u7684\u7C92\u5B50\u5FC5\u987B\u53EF\u4E3A\u7A7A\u3002
- c-props-correct.2 = c-props-correct.2: \u952E\u5F15\u7528 ''{0}'' \u548C\u952E ''{1}'' \u4E2D\u5B57\u6BB5\u7684\u57FA\u6570\u5FC5\u987B\u76F8\u540C\u3002
- ct-props-correct.3 = ct-props-correct.3: \u5728\u590D\u6742\u7C7B\u578B ''{0}'' \u4E2D\u68C0\u6D4B\u5230\u5FAA\u73AF\u5B9A\u4E49\u3002\u8FD9\u8868\u793A ''{0}'' \u5305\u542B\u5728\u5176\u81EA\u8EAB\u7684\u7C7B\u578B\u5206\u5C42\u7ED3\u6784\u4E2D, \u8FD9\u662F\u9519\u8BEF\u7684\u3002
- ct-props-correct.4 = ct-props-correct.4: \u7C7B\u578B ''{0}'' \u9519\u8BEF\u3002\u6307\u5B9A\u4E86\u5177\u6709\u76F8\u540C\u540D\u79F0\u548C\u76EE\u6807\u540D\u79F0\u7A7A\u95F4\u7684\u91CD\u590D\u5C5E\u6027\u7528\u6CD5\u3002\u91CD\u590D\u5C5E\u6027\u7528\u6CD5\u7684\u540D\u79F0\u4E3A ''{1}''\u3002
- ct-props-correct.5 = ct-props-correct.5: \u7C7B\u578B ''{0}'' \u9519\u8BEF\u3002\u4E24\u4E2A\u5C5E\u6027\u58F0\u660E ''{1}'' \u548C ''{2}'' \u5177\u6709\u4ECE ID \u6D3E\u751F\u7684\u7C7B\u578B\u3002
- derivation-ok-restriction.1 = derivation-ok-restriction.1: \u7C7B\u578B ''{0}'' \u7531\u9650\u5236\u4ECE\u7C7B\u578B ''{1}'' \u6D3E\u751F\u3002\u4F46\u662F, ''{1}'' \u5177\u6709\u7981\u6B62\u7531\u9650\u5236\u6D3E\u751F\u7684 '{'final'}' \u5C5E\u6027\u3002
- derivation-ok-restriction.2.1.1 = derivation-ok-restriction.2.1.1: \u7C7B\u578B ''{0}'' \u9519\u8BEF\u3002\u6B64\u7C7B\u578B\u4E2D\u7684\u5C5E\u6027\u7528\u6CD5 ''{1}'' \u5177\u6709 ''{2}'' \u7684 ''use'' \u503C, \u8FD9\u4E0E\u57FA\u7C7B\u578B\u4E2D\u7684\u5339\u914D\u5C5E\u6027\u7528\u6CD5\u7684 ''required'' \u503C\u4E0D\u4E00\u81F4\u3002
- derivation-ok-restriction.2.1.2 = derivation-ok-restriction.2.1.2: \u7C7B\u578B ''{0}'' \u9519\u8BEF\u3002\u6B64\u7C7B\u578B\u4E2D\u7684\u5C5E\u6027\u7528\u6CD5 ''{1}'' \u5177\u6709\u7C7B\u578B ''{2}'', \u5B83\u4E0D\u662F\u4ECE\u57FA\u7C7B\u578B\u4E2D\u7684\u5339\u914D\u5C5E\u6027\u7528\u6CD5\u7684\u7C7B\u578B ''{3}'' \u6709\u6548\u6D3E\u751F\u7684\u3002
- derivation-ok-restriction.2.1.3.a = derivation-ok-restriction.2.1.3.a: \u7C7B\u578B ''{0}'' \u9519\u8BEF\u3002\u6B64\u7C7B\u578B\u4E2D\u7684\u5C5E\u6027\u7528\u6CD5 ''{1}'' \u5177\u6709\u4E0D\u56FA\u5B9A\u7684\u6709\u6548\u503C\u7EA6\u675F\u6761\u4EF6, \u800C\u57FA\u7C7B\u578B\u4E2D\u7684\u5339\u914D\u5C5E\u6027\u7528\u6CD5\u7684\u6709\u6548\u503C\u7EA6\u675F\u6761\u4EF6\u662F\u56FA\u5B9A\u7684\u3002
- derivation-ok-restriction.2.1.3.b = derivation-ok-restriction.2.1.3.b: \u7C7B\u578B ''{0}'' \u9519\u8BEF\u3002\u6B64\u7C7B\u578B\u4E2D\u7684\u5C5E\u6027\u7528\u6CD5 ''{1}'' \u5177\u6709\u503C\u4E3A ''{2}'' \u7684\u56FA\u5B9A\u6709\u6548\u503C\u7EA6\u675F\u6761\u4EF6, \u8FD9\u4E0E\u57FA\u7C7B\u578B\u4E2D\u7684\u5339\u914D\u5C5E\u6027\u7528\u6CD5\u7684\u56FA\u5B9A\u6709\u6548\u503C\u7EA6\u675F\u6761\u4EF6\u7684\u503C ''{3}'' \u4E0D\u4E00\u81F4\u3002
- derivation-ok-restriction.2.2.a = derivation-ok-restriction.2.2.a: \u7C7B\u578B ''{0}'' \u9519\u8BEF\u3002\u6B64\u7C7B\u578B\u4E2D\u7684\u5C5E\u6027\u7528\u6CD5 ''{1}'' \u5728\u57FA\u7C7B\u578B\u4E2D\u6CA1\u6709\u5339\u914D\u7684\u5C5E\u6027\u7528\u6CD5, \u5E76\u4E14\u57FA\u7C7B\u578B\u6CA1\u6709\u901A\u914D\u7B26\u5C5E\u6027\u3002
- derivation-ok-restriction.2.2.b = derivation-ok-restriction.2.2.b: \u7C7B\u578B ''{0}'' \u9519\u8BEF\u3002\u6B64\u7C7B\u578B\u4E2D\u7684\u5C5E\u6027\u7528\u6CD5 ''{1}'' \u5728\u57FA\u7C7B\u578B\u4E2D\u6CA1\u6709\u5339\u914D\u7684\u5C5E\u6027\u7528\u6CD5, \u5E76\u4E14\u57FA\u7C7B\u578B\u4E2D\u7684\u901A\u914D\u7B26\u4E0D\u5141\u8BB8\u6B64\u5C5E\u6027\u7528\u6CD5\u7684\u540D\u79F0\u7A7A\u95F4 ''{2}''\u3002
- derivation-ok-restriction.3 = derivation-ok-restriction.3: \u7C7B\u578B ''{0}'' \u9519\u8BEF\u3002\u57FA\u7C7B\u578B\u4E2D\u7684\u5C5E\u6027\u7528\u6CD5 ''{1}'' \u7684 REQUIRED \u4E3A\u201C\u771F\u201D, \u4F46\u5728\u6D3E\u751F\u7C7B\u578B\u4E2D\u6CA1\u6709\u5339\u914D\u7684\u5C5E\u6027\u7528\u6CD5\u3002
- derivation-ok-restriction.4.1 = derivation-ok-restriction.4.1: \u7C7B\u578B ''{0}'' \u9519\u8BEF\u3002\u6D3E\u751F\u7C7B\u578B\u5177\u6709\u4E00\u4E2A\u5C5E\u6027\u901A\u914D\u7B26, \u4F46\u57FA\u7C7B\u578B\u4E0D\u5177\u6709\u5C5E\u6027\u901A\u914D\u7B26\u3002
- derivation-ok-restriction.4.2 = derivation-ok-restriction.4.2: \u7C7B\u578B ''{0}'' \u9519\u8BEF\u3002\u6D3E\u751F\u7C7B\u578B\u4E2D\u7684\u901A\u914D\u7B26\u4E0D\u662F\u57FA\u7C7B\u578B\u4E2D\u901A\u914D\u7B26\u7684\u6709\u6548\u901A\u914D\u7B26\u5B50\u96C6\u3002
- derivation-ok-restriction.4.3 = derivation-ok-restriction.4.3: \u7C7B\u578B ''{0}'' \u9519\u8BEF\u3002\u6D3E\u751F\u7C7B\u578B ({1}) \u4E2D\u901A\u914D\u7B26\u7684\u6D41\u7A0B\u5185\u5BB9\u5F31\u4E8E\u57FA\u7C7B\u578B ({2}) \u4E2D\u901A\u914D\u7B26\u7684\u6D41\u7A0B\u5185\u5BB9\u3002
- derivation-ok-restriction.5.2.2.1 = derivation-ok-restriction.5.2.2.1: \u7C7B\u578B ''{0}'' \u9519\u8BEF\u3002\u6B64\u7C7B\u578B\u7684\u7B80\u5355\u5185\u5BB9\u7C7B\u578B ''{1}'' \u4E0D\u5728\u57FA\u7C7B\u578B\u7684\u7B80\u5355\u5185\u5BB9\u7C7B\u578B ''{2}'' \u7684\u6709\u6548\u9650\u5236\u4E4B\u5185\u3002
- derivation-ok-restriction.5.3.2 = derivation-ok-restriction.5.3.2: \u7C7B\u578B ''{0}'' \u9519\u8BEF\u3002\u6B64\u7C7B\u578B\u7684\u5185\u5BB9\u7C7B\u578B\u4E3A\u7A7A, \u4F46\u57FA\u7C7B\u578B\u7684\u5185\u5BB9\u7C7B\u578B ''{1}'' \u4E0D\u4E3A\u7A7A\u6216\u4E0D\u80FD\u4E3A\u7A7A\u3002
- derivation-ok-restriction.5.4.1.2 = derivation-ok-restriction.5.4.1.2: \u7C7B\u578B ''{0}'' \u9519\u8BEF\u3002\u6B64\u7C7B\u578B\u7684\u5185\u5BB9\u7C7B\u578B\u4E3A\u201C\u6DF7\u5408\u201D, \u4F46\u57FA\u7C7B\u578B\u7684\u5185\u5BB9\u7C7B\u578B ''{1}'' \u4E0D\u4E3A\u201C\u6DF7\u5408\u201D\u3002
- derivation-ok-restriction.5.4.2 = derivation-ok-restriction.5.4.2: \u7C7B\u578B ''{0}'' \u9519\u8BEF\u3002\u6B64\u7C7B\u578B\u7684\u7C92\u5B50\u4E0D\u5728\u57FA\u7C7B\u578B\u7684\u7C92\u5B50\u7684\u6709\u6548\u9650\u5236\u4E4B\u5185\u3002
- enumeration-required-notation = enumeration-required-notation: {2} ''{1}'' \u4F7F\u7528\u7684 NOTATION \u7C7B\u578B ''{0}'' \u5FC5\u987B\u5177\u6709\u679A\u4E3E\u9762\u503C, \u7528\u4E8E\u6307\u5B9A\u6B64\u7C7B\u578B\u4F7F\u7528\u7684\u6CE8\u91CA\u5143\u7D20\u3002
- enumeration-valid-restriction = enumeration-valid-restriction: \u679A\u4E3E\u503C ''{0}'' \u4E0D\u5728\u57FA\u7C7B\u578B {1} \u7684\u503C\u7A7A\u95F4\u4E2D\u3002
- e-props-correct.2 = e-props-correct.2: \u5143\u7D20 ''{0}'' \u4E2D\u7684\u503C\u7EA6\u675F\u6761\u4EF6\u7684\u503C ''{1}'' \u65E0\u6548\u3002
- e-props-correct.4 = e-props-correct.4: \u5143\u7D20 ''{0}'' \u7684 '{'type definition'}' \u4E0D\u662F\u4ECE substitutionHead ''{1}'' \u7684 '{'type definition'}' \u6709\u6548\u6D3E\u751F\u7684, \u6216\u8005 ''{1}'' \u7684 '{'substitution group exclusions'}' \u5C5E\u6027\u4E0D\u5141\u8BB8\u8FDB\u884C\u6B64\u6D3E\u751F\u3002
- e-props-correct.5 = e-props-correct.5: \u5143\u7D20 ''{0}'' \u4E2D\u4E0D\u80FD\u5305\u542B '{'value constraint'}', \u56E0\u4E3A\u5143\u7D20\u7684 '{'type definition'}' \u6216 '{'type definition'}' \u7684 '{'content type'}' \u4E3A ID, \u6216\u8005\u662F\u4ECE ID \u6D3E\u751F\u7684\u3002
- e-props-correct.6 = e-props-correct.6: \u5728\u5143\u7D20 ''{0}'' \u4E2D\u68C0\u6D4B\u5230\u5FAA\u73AF\u66FF\u4EE3\u7EC4\u3002
- fractionDigits-valid-restriction = fractionDigits-valid-restriction: \u5728 {2} \u7684\u5B9A\u4E49\u4E2D, \u9762 ''fractionDigits'' \u7684\u503C ''{0}'' \u65E0\u6548, \u56E0\u4E3A\u8BE5\u503C\u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E ''fractionDigits'' \u7684\u503C, \u4F46\u5728\u539F\u7EA7\u7C7B\u578B\u4E4B\u4E00\u4E2D\u5DF2\u5C06\u5176\u8BBE\u7F6E\u4E3A ''{1}''\u3002
- fractionDigits-totalDigits = fractionDigits-totalDigits: \u5728 {2} \u7684\u5B9A\u4E49\u4E2D, \u9762 ''fractionDigits'' \u7684\u503C ''{0}'' \u65E0\u6548, \u56E0\u4E3A\u8BE5\u503C\u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E ''totalDigits'' \u7684\u503C ''{1}''\u3002
- length-minLength-maxLength.1.1 = length-minLength-maxLength.1.1: \u5BF9\u4E8E\u7C7B\u578B {0}, \u957F\u5EA6 ''{1}'' \u7684\u503C\u5C0F\u4E8E minLength \u7684\u503C ''{2}'' \u662F\u9519\u8BEF\u7684\u3002
- length-minLength-maxLength.1.2.a = length-minLength-maxLength.1.2.a: \u5BF9\u4E8E\u7C7B\u578B {0}, \u5982\u679C\u5F53\u524D\u9650\u5236\u5177\u6709 minLength \u9762\u5E76\u4E14\u5F53\u524D\u9650\u5236\u6216\u57FA\u7C7B\u578B\u5177\u6709 length \u9762, \u5219\u57FA\u7C7B\u578B\u6CA1\u6709 minLength \u9762\u662F\u9519\u8BEF\u7684\u3002
- length-minLength-maxLength.1.2.b = length-minLength-maxLength.1.2.b: \u5BF9\u4E8E\u7C7B\u578B {0}, \u5F53\u524D minLength ''{1}'' \u4E0D\u7B49\u4E8E\u57FA\u7C7B\u578B minLength ''{2}'' \u662F\u9519\u8BEF\u7684\u3002
- length-minLength-maxLength.2.1 = length-minLength-maxLength.2.1: \u5BF9\u4E8E\u7C7B\u578B {0}, \u957F\u5EA6 ''{1}'' \u7684\u503C\u5927\u4E8E maxLength ''{2}'' \u7684\u503C\u662F\u9519\u8BEF\u7684\u3002
- length-minLength-maxLength.2.2.a = length-minLength-maxLength.2.2.a: \u5BF9\u4E8E\u7C7B\u578B {0}, \u5982\u679C\u5F53\u524D\u9650\u5236\u5177\u6709 maxLength \u9762\u5E76\u4E14\u5F53\u524D\u9650\u5236\u6216\u57FA\u7C7B\u578B\u5177\u6709 length \u9762, \u5219\u57FA\u7C7B\u578B\u6CA1\u6709 maxLength \u9762\u662F\u9519\u8BEF\u7684\u3002
- length-minLength-maxLength.2.2.b = length-minLength-maxLength.2.2.b: \u5BF9\u4E8E\u7C7B\u578B {0}, \u5F53\u524D maxLength ''{1}'' \u4E0D\u7B49\u4E8E\u57FA\u7C7B\u578B maxLength ''{2}'' \u662F\u9519\u8BEF\u7684\u3002
- length-valid-restriction = length-valid-restriction: \u7C7B\u578B ''{2}'' \u9519\u8BEF\u3002\u957F\u5EA6\u7684\u503C ''{0}'' \u5FC5\u987B\u7B49\u4E8E\u57FA\u7C7B\u578B ''{1}'' \u7684\u957F\u5EA6\u503C\u3002
- maxExclusive-valid-restriction.1 = maxExclusive-valid-restriction.1: \u7C7B\u578B ''{2}'' \u9519\u8BEF\u3002maxExclusive \u503C ''{0}'' \u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E\u57FA\u7C7B\u578B ''{1}'' \u7684 maxExclusive\u3002
- maxExclusive-valid-restriction.2 = maxExclusive-valid-restriction.2: \u7C7B\u578B ''{2}'' \u9519\u8BEF\u3002maxExclusive \u503C ''{0}'' \u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E\u57FA\u7C7B\u578B ''{1}'' \u7684 maxInclusive\u3002
- maxExclusive-valid-restriction.3 = maxExclusive-valid-restriction.3: \u7C7B\u578B ''{2}'' \u9519\u8BEF\u3002maxExclusive \u503C ''{0}'' \u5FC5\u987B\u5927\u4E8E\u57FA\u7C7B\u578B ''{1}'' \u7684 minInclusive\u3002
- maxExclusive-valid-restriction.4 = maxExclusive-valid-restriction.4: \u7C7B\u578B ''{2}'' \u9519\u8BEF\u3002maxExclusive \u503C ''{0}'' \u5FC5\u987B\u5927\u4E8E\u57FA\u7C7B\u578B ''{1}'' \u7684 minExclusive\u3002
- maxInclusive-maxExclusive = maxInclusive-maxExclusive: \u4E3A\u540C\u4E00\u4E2A\u6570\u636E\u7C7B\u578B\u540C\u65F6\u6307\u5B9A maxInclusive \u548C maxExclusive \u662F\u9519\u8BEF\u7684\u3002\u5728 {2} \u4E2D, maxInclusive = ''{0}'' \u5E76\u4E14 maxExclusive = ''{1}''\u3002
- maxInclusive-valid-restriction.1 = maxInclusive-valid-restriction.1: \u7C7B\u578B ''{2}'' \u9519\u8BEF\u3002maxInclusive \u503C ''{0}'' \u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E\u57FA\u7C7B\u578B ''{1}'' \u7684 maxInclusive\u3002
- maxInclusive-valid-restriction.2 = maxInclusive-valid-restriction.2: \u7C7B\u578B ''{2}'' \u9519\u8BEF\u3002maxInclusive \u503C ''{0}'' \u5FC5\u987B\u5C0F\u4E8E\u57FA\u7C7B\u578B ''{1}'' \u7684 maxExclusive\u3002
- maxInclusive-valid-restriction.3 = maxInclusive-valid-restriction.3: \u7C7B\u578B ''{2}'' \u9519\u8BEF\u3002maxInclusive \u503C ''{0}'' \u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E\u57FA\u7C7B\u578B ''{1}'' \u7684 minInclusive\u3002
- maxInclusive-valid-restriction.4 = maxInclusive-valid-restriction.4: \u7C7B\u578B ''{2}'' \u9519\u8BEF\u3002maxInclusive \u503C ''{0}'' \u5FC5\u987B\u5927\u4E8E\u57FA\u7C7B\u578B ''{1}'' \u7684 minExclusive\u3002
- maxLength-valid-restriction = maxLength-valid-restriction: \u5728 {2} \u7684\u5B9A\u4E49\u4E2D, maxLength \u503C ''{0}'' \u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E\u57FA\u7C7B\u578B ''{1}'' \u7684 maxLength\u3002
- mg-props-correct.2 = mg-props-correct.2: \u5728\u7EC4 ''{0}'' \u4E2D\u68C0\u6D4B\u5230\u5FAA\u73AF\u5B9A\u4E49\u3002\u9012\u5F52\u8DDF\u968F\u7C92\u5B50\u7684 '{'term'}' \u4EE5\u4E0B\u503C\u4F1A\u5F15\u5BFC\u5230\u5176 '{'term'}' \u662F\u7EC4\u81EA\u8EAB\u7684\u7C92\u5B50\u3002
- minExclusive-less-than-equal-to-maxExclusive = minExclusive-less-than-equal-to-maxExclusive: \u5728 {2} \u7684\u5B9A\u4E49\u4E2D, minExclusive \u503C ''{0}'' \u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E maxExclusive \u503C ''{1}''\u3002
- minExclusive-less-than-maxInclusive = minExclusive-less-than-maxInclusive: \u5728 {2} \u7684\u5B9A\u4E49\u4E2D, minExclusive \u503C ''{0}'' \u5FC5\u987B\u5C0F\u4E8E maxInclusive \u503C ''{1}''\u3002
- minExclusive-valid-restriction.1 = minExclusive-valid-restriction.1: \u7C7B\u578B ''{2}'' \u9519\u8BEF\u3002minExclusive \u503C ''{0}'' \u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E\u57FA\u7C7B\u578B ''{1}'' \u7684 minExclusive\u3002
- minExclusive-valid-restriction.2 = minExclusive-valid-restriction.2: \u7C7B\u578B ''{2}'' \u9519\u8BEF\u3002minExclusive \u503C ''{0}'' \u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E\u57FA\u7C7B\u578B ''{1}'' \u7684 maxInclusive\u3002
- minExclusive-valid-restriction.3 = minExclusive-valid-restriction.3: \u7C7B\u578B ''{2}'' \u9519\u8BEF\u3002minExclusive \u503C ''{0}'' \u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E\u57FA\u7C7B\u578B ''{1}'' \u7684 minInclusive\u3002
- minExclusive-valid-restriction.4 = minExclusive-valid-restriction.4: \u7C7B\u578B ''{2}'' \u9519\u8BEF\u3002minExclusive \u503C ''{0}'' \u5FC5\u987B\u5C0F\u4E8E\u57FA\u7C7B\u578B ''{1}'' \u7684 maxExclusive\u3002
- minInclusive-less-than-equal-to-maxInclusive = minInclusive-less-than-equal-to-maxInclusive: \u5728 {2} \u7684\u5B9A\u4E49\u4E2D, minInclusive \u503C ''{0}'' \u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E maxInclusive \u503C ''{1}''\u3002
- minInclusive-less-than-maxExclusive = minInclusive-less-than-maxExclusive: \u5728 {2} \u7684\u5B9A\u4E49\u4E2D, minInclusive \u503C ''{0}'' \u5FC5\u987B\u5C0F\u4E8E maxExclusive \u503C ''{1}''\u3002
- minInclusive-minExclusive = minInclusive-minExclusive: \u4E3A\u540C\u4E00\u4E2A\u6570\u636E\u7C7B\u578B\u540C\u65F6\u6307\u5B9A minInclusive \u548C minExclusive \u662F\u9519\u8BEF\u7684\u3002\u5728 {2} \u4E2D, minInclusive = ''{0}'' \u5E76\u4E14 minExclusive = ''{1}''\u3002
- minInclusive-valid-restriction.1 = minInclusive-valid-restriction.1: \u7C7B\u578B ''{2}'' \u9519\u8BEF\u3002minInclusive \u503C ''{0}'' \u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E\u57FA\u7C7B\u578B ''{1}'' \u7684 minInclusive\u3002
- minInclusive-valid-restriction.2 = minInclusive-valid-restriction.2: \u7C7B\u578B ''{2}'' \u9519\u8BEF\u3002minInclusive \u503C ''{0}'' \u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E\u57FA\u7C7B\u578B ''{1}'' \u7684 maxInclusive\u3002
- minInclusive-valid-restriction.3 = minInclusive-valid-restriction.3: \u7C7B\u578B ''{2}'' \u9519\u8BEF\u3002minInclusive \u503C ''{0}'' \u5FC5\u987B\u5927\u4E8E\u57FA\u7C7B\u578B ''{1}'' \u7684 minExclusive\u3002
- minInclusive-valid-restriction.4 = minInclusive-valid-restriction.4: \u7C7B\u578B ''{2}'' \u9519\u8BEF\u3002minInclusive \u503C ''{0}'' \u5FC5\u987B\u5C0F\u4E8E\u57FA\u7C7B\u578B ''{1}'' \u7684 maxExclusive\u3002
- minLength-less-than-equal-to-maxLength = minLength-less-than-equal-to-maxLength: \u5728 {2} \u7684\u5B9A\u4E49\u4E2D, minLength \u7684\u503C ''{0}'' \u5FC5\u987B\u5C0F\u4E8E maxLength \u7684\u503C ''{1}''\u3002
- minLength-valid-restriction = minLength-valid-restriction: \u5728 {2} \u7684\u5B9A\u4E49\u4E2D, minLength ''{0}'' \u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E\u57FA\u7C7B\u578B\u7684 minLength ''{1}''\u3002
- no-xmlns = no-xmlns: \u5C5E\u6027\u58F0\u660E\u7684 {name} \u4E0D\u80FD\u4E0E 'xmlns' \u5339\u914D\u3002
- no-xsi = no-xsi: \u5C5E\u6027\u58F0\u660E\u7684 '{'target namespace'}' \u4E0D\u80FD\u4E0E ''{0}'' \u5339\u914D\u3002
- p-props-correct.2.1 = p-props-correct.2.1: \u5728 ''{0}'' \u7684\u58F0\u660E\u4E2D, ''minOccurs'' \u7684\u503C\u4E3A ''{1}'', \u4F46\u8BE5\u503C\u4E0D\u80FD\u5927\u4E8E ''maxOccurs'' \u7684\u503C ''{2}''\u3002
- rcase-MapAndSum.1 = rcase-MapAndSum.1: \u7C92\u5B50\u4E4B\u95F4\u6CA1\u6709\u5B8C\u6574\u7684\u529F\u80FD\u6620\u5C04\u3002
- rcase-MapAndSum.2 = rcase-MapAndSum.2: \u7EC4\u7684\u53D1\u751F\u8303\u56F4 ({0},{1}) \u4E0D\u5728\u57FA\u7EC4\u7684\u53D1\u751F\u8303\u56F4 ({2},{3}) \u7684\u6709\u6548\u9650\u5236\u4E4B\u5185\u3002
- rcase-NameAndTypeOK.1 = rcase-NameAndTypeOK.1: \u5143\u7D20\u7684\u540D\u79F0\u548C\u76EE\u6807\u540D\u79F0\u7A7A\u95F4\u4E0D\u76F8\u540C: \u540D\u79F0\u7A7A\u95F4 ''{1}'' \u4E2D\u7684\u5143\u7D20\u4E3A ''{0}'', \u540D\u79F0\u7A7A\u95F4 ''{3}'' \u4E2D\u7684\u5143\u7D20\u4E3A ''{2}''\u3002
- rcase-NameAndTypeOK.2 = rcase-NameAndTypeOK.2: \u5176 '{'term'}' \u4E3A\u5143\u7D20\u58F0\u660E ''{0}'' \u7684\u7C92\u5B50\u9519\u8BEF\u3002\u5143\u7D20\u58F0\u660E\u7684 '{'nillable'}' \u4E3A\u201C\u771F\u201D, \u4F46\u57FA\u7C7B\u578B\u4E2D\u5BF9\u5E94\u7684\u7C92\u5B50\u5177\u6709 '{'nillable'}' \u4E3A\u201C\u5047\u201D\u7684\u5143\u7D20\u58F0\u660E\u3002
- rcase-NameAndTypeOK.3 = rcase-NameAndTypeOK.3: \u5176 '{'term'}' \u4E3A\u5143\u7D20\u58F0\u660E ''{0}'' \u7684\u7C92\u5B50\u9519\u8BEF\u3002\u8BE5\u7C92\u5B50\u7684\u53D1\u751F\u8303\u56F4 ({1},{2}) \u4E0D\u5728\u57FA\u7C7B\u578B\u4E2D\u5BF9\u5E94\u7C92\u5B50\u7684\u8303\u56F4 ({3},{4}) \u7684\u6709\u6548\u9650\u5236\u4E4B\u5185\u3002
- rcase-NameAndTypeOK.4.a = rcase-NameAndTypeOK.4.a: \u5143\u7D20 ''{0}'' \u4E0D\u662F\u56FA\u5B9A\u7684, \u4F46\u57FA\u7C7B\u578B\u4E2D\u7684\u5BF9\u5E94\u5143\u7D20\u662F\u56FA\u5B9A\u7684, \u4E14\u503C\u4E3A ''{1}''\u3002
- rcase-NameAndTypeOK.4.b = rcase-NameAndTypeOK.4.b: \u5143\u7D20 ''{0}'' \u662F\u56FA\u5B9A\u7684, \u4E14\u503C\u4E3A ''{1}'', \u4F46\u57FA\u7C7B\u578B\u4E2D\u7684\u5BF9\u5E94\u5143\u7D20\u662F\u56FA\u5B9A\u7684, \u4E14\u503C\u4E3A ''{2}''\u3002
- rcase-NameAndTypeOK.5 = rcase-NameAndTypeOK.5: \u5143\u7D20 ''{0}'' \u7684\u8EAB\u4EFD\u7EA6\u675F\u6761\u4EF6\u4E0D\u662F\u57FA\u7C7B\u578B\u4E2D\u90A3\u4E9B\u8EAB\u4EFD\u7EA6\u675F\u6761\u4EF6\u7684\u5B50\u96C6\u3002
- rcase-NameAndTypeOK.6 = rcase-NameAndTypeOK.6: \u5143\u7D20 ''{0}'' \u7684\u4E0D\u63A5\u53D7\u66FF\u4EE3\u4E0D\u662F\u57FA\u5143\u7D20\u4E2D\u4E0D\u63A5\u53D7\u66FF\u4EE3\u7684\u8D85\u96C6\u3002
- rcase-NameAndTypeOK.7 = rcase-NameAndTypeOK.7: \u5143\u7D20 ''{0}'' \u7684\u7C7B\u578B ''{1}'' \u4E0D\u662F\u4ECE\u57FA\u5143\u7D20\u7684\u7C7B\u578B ''{2}'' \u6D3E\u751F\u7684\u3002
- rcase-NSCompat.1 = rcase-NSCompat.1: \u5143\u7D20 ''{0}'' \u5177\u6709\u540D\u79F0\u7A7A\u95F4 ''{1}'', \u5728\u57FA\u5143\u7D20\u4E2D, \u901A\u914D\u7B26\u4E0D\u5141\u8BB8\u5177\u6709\u6B64\u540D\u79F0\u7A7A\u95F4\u3002
- rcase-NSCompat.2 = rcase-NSCompat.2: \u5176 '{'term'}' \u4E3A\u5143\u7D20\u58F0\u660E ''{0}'' \u7684\u7C92\u5B50\u9519\u8BEF\u3002\u8BE5\u7C92\u5B50\u7684\u53D1\u751F\u8303\u56F4 ({1},{2}) \u4E0D\u5728\u57FA\u7C7B\u578B\u4E2D\u5BF9\u5E94\u7C92\u5B50\u7684\u8303\u56F4 ({3},{4}) \u7684\u6709\u6548\u9650\u5236\u4E4B\u5185\u3002
- rcase-NSRecurseCheckCardinality.1 = rcase-NSRecurseCheckCardinality.1: \u7C92\u5B50\u4E4B\u95F4\u6CA1\u6709\u5B8C\u6574\u7684\u529F\u80FD\u6620\u5C04\u3002
- rcase-NSRecurseCheckCardinality.2 = rcase-NSRecurseCheckCardinality.2: \u7EC4\u7684\u53D1\u751F\u8303\u56F4 ({0},{1}) \u4E0D\u5728\u57FA\u672C\u901A\u914D\u7B26\u8303\u56F4 ({2},{3}) \u7684\u6709\u6548\u9650\u5236\u4E4B\u5185\u3002
- rcase-NSSubset.1 = rcase-NSSubset.1: \u901A\u914D\u7B26\u4E0D\u662F\u57FA\u672C\u901A\u914D\u7B26\u4E2D\u5BF9\u5E94\u901A\u914D\u7B26\u7684\u5B50\u96C6\u3002
- rcase-NSSubset.2 = rcase-NSSubset.2: \u901A\u914D\u7B26\u7684\u53D1\u751F\u8303\u56F4 ({0},{1}) \u4E0D\u5728\u57FA\u672C\u901A\u914D\u7B26\u4E2D\u53D1\u751F\u8303\u56F4 ({2},{3}) \u7684\u6709\u6548\u9650\u5236\u4E4B\u5185\u3002
- rcase-NSSubset.3 = rcase-NSSubset.3: \u901A\u914D\u7B26\u7684\u6D41\u7A0B\u5185\u5BB9 ''{0}'' \u5F31\u4E8E\u57FA\u672C\u901A\u914D\u7B26\u4E2D\u7684\u6D41\u7A0B\u5185\u5BB9 ''{1}''\u3002
- rcase-Recurse.1 = rcase-Recurse.1: \u7EC4\u7684\u53D1\u751F\u8303\u56F4 ({0},{1}) \u4E0D\u5728\u57FA\u7EC4\u7684\u53D1\u751F\u8303\u56F4 ({2},{3}) \u7684\u6709\u6548\u9650\u5236\u4E4B\u5185\u3002
- rcase-Recurse.2 = rcase-Recurse.2: \u7C92\u5B50\u4E4B\u95F4\u6CA1\u6709\u5B8C\u6574\u7684\u529F\u80FD\u6620\u5C04\u3002
- rcase-RecurseLax.1 = rcase-RecurseLax.1: \u7EC4\u7684\u53D1\u751F\u8303\u56F4 ({0},{1}) \u4E0D\u5728\u57FA\u7EC4\u7684\u53D1\u751F\u8303\u56F4 ({2},{3}) \u7684\u6709\u6548\u9650\u5236\u4E4B\u5185\u3002
- rcase-RecurseLax.2 = rcase-RecurseLax.2: \u7C92\u5B50\u4E4B\u95F4\u6CA1\u6709\u5B8C\u6574\u7684\u529F\u80FD\u6620\u5C04\u3002
- rcase-RecurseUnordered.1 = rcase-RecurseUnordered.1: \u7EC4\u7684\u53D1\u751F\u8303\u56F4 ({0},{1}) \u4E0D\u5728\u57FA\u7EC4\u7684\u53D1\u751F\u8303\u56F4 ({2},{3}) \u7684\u6709\u6548\u9650\u5236\u4E4B\u5185\u3002
- rcase-RecurseUnordered.2 = rcase-RecurseUnordered.2: \u7C92\u5B50\u4E4B\u95F4\u6CA1\u6709\u5B8C\u6574\u7684\u529F\u80FD\u6620\u5C04\u3002
-# We're using sch-props-correct.2 instead of the old src-redefine.1
-# src-redefine.1 = src-redefine.1: The component ''{0}'' is begin redefined, but its corresponding component isn't in the schema document being redefined (with namespace ''{2}''), but in a different document, with namespace ''{1}''.
- sch-props-correct.2 = sch-props-correct.2: \u65B9\u6848\u4E0D\u80FD\u5305\u542B\u5177\u6709\u76F8\u540C\u540D\u79F0\u7684\u4E24\u4E2A\u5168\u5C40\u7EC4\u4EF6; \u800C\u6B64\u65B9\u6848\u4E2D\u5305\u542B\u4E24\u4E2A ''{0}''\u3002
- st-props-correct.2 = st-props-correct.2: \u5728\u7B80\u5355\u7C7B\u578B ''{0}'' \u4E2D\u68C0\u6D4B\u5230\u5FAA\u73AF\u5B9A\u4E49\u3002\u8FD9\u8868\u793A ''{0}'' \u5305\u542B\u5728\u5176\u81EA\u8EAB\u7684\u7C7B\u578B\u5206\u5C42\u7ED3\u6784\u4E2D, \u8FD9\u662F\u9519\u8BEF\u7684\u3002
- st-props-correct.3 = st-props-correct.3: \u7C7B\u578B ''{0}'' \u9519\u8BEF\u3002'{'base type definition'}' \u7684 '{'final'}' \u7684\u503C ''{1}'' \u7981\u6B62\u7531\u9650\u5236\u6D3E\u751F\u3002
- totalDigits-valid-restriction = totalDigits-valid-restriction: \u5728 {2} \u7684\u5B9A\u4E49\u4E2D, \u9762 ''totalDigits'' \u7684\u503C ''{0}'' \u65E0\u6548, \u56E0\u4E3A\u8BE5\u503C\u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E ''totalDigits'' \u7684\u503C, \u800C\u5728\u539F\u7EA7\u7C7B\u578B\u4E4B\u4E00\u4E2D\u5DF2\u5C06\u5176\u8BBE\u7F6E\u4E3A ''{1}''\u3002
- whiteSpace-valid-restriction.1 = whiteSpace-valid-restriction.1: \u5728 {0} \u7684\u5B9A\u4E49\u4E2D, \u9762 ''whitespace'' \u7684\u503C ''{1}'' \u65E0\u6548, \u56E0\u4E3A ''whitespace'' \u7684\u503C\u5DF2\u5728\u539F\u7EA7\u7C7B\u578B\u4E4B\u4E00\u4E2D\u8BBE\u7F6E\u4E3A ''collapse''\u3002
- whiteSpace-valid-restriction.2 = whiteSpace-valid-restriction.2: \u5728 {0} \u7684\u5B9A\u4E49\u4E2D, \u9762 ''whitespace'' \u7684\u503C ''preserve'' \u65E0\u6548, \u56E0\u4E3A ''whitespace'' \u7684\u503C\u5DF2\u5728\u539F\u7EA7\u7C7B\u578B\u4E4B\u4E00\u4E2D\u8BBE\u7F6E\u4E3A ''replace''\u3002
-
-#schema for Schemas
-
- s4s-att-invalid-value = s4s-att-invalid-value: \u5143\u7D20 ''{0}'' \u4E2D ''{1}'' \u7684\u5C5E\u6027\u503C\u65E0\u6548\u3002\u8BB0\u5F55\u7684\u539F\u56E0: {2}
- s4s-att-must-appear = s4s-att-must-appear: \u5143\u7D20 ''{0}'' \u4E2D\u5FC5\u987B\u5305\u542B\u5C5E\u6027 ''{1}''\u3002
- s4s-att-not-allowed = s4s-att-not-allowed: \u5143\u7D20 ''{0}'' \u4E2D\u4E0D\u80FD\u5305\u542B\u5C5E\u6027 ''{1}''\u3002
- s4s-elt-invalid = s4s-elt-invalid: \u5143\u7D20 ''{0}'' \u4E0D\u662F\u65B9\u6848\u6587\u6863\u4E2D\u7684\u6709\u6548\u5143\u7D20\u3002
- s4s-elt-must-match.1 = s4s-elt-must-match.1: ''{0}'' \u7684\u5185\u5BB9\u5FC5\u987B\u4E0E {1} \u5339\u914D\u3002\u53D1\u73B0\u95EE\u9898, \u5F00\u59CB\u4E8E: {2}\u3002
- s4s-elt-must-match.2 = s4s-elt-must-match.2: ''{0}'' \u7684\u5185\u5BB9\u5FC5\u987B\u4E0E {1} \u5339\u914D\u3002\u627E\u4E0D\u5230\u8DB3\u591F\u7684\u5143\u7D20\u3002
- # the "invalid-content" messages provide less information than the "must-match" counterparts above. They're used for complex types when providing a "match" would be an information dump
- s4s-elt-invalid-content.1 = s4s-elt-invalid-content.1: ''{0}'' \u7684\u5185\u5BB9\u65E0\u6548\u3002\u5143\u7D20 ''{1}'' \u65E0\u6548, \u6240\u653E\u4F4D\u7F6E\u9519\u8BEF\u6216\u51FA\u73B0\u6B21\u6570\u8FC7\u591A\u3002
- s4s-elt-invalid-content.2 = s4s-elt-invalid-content.2: ''{0}'' \u7684\u5185\u5BB9\u65E0\u6548\u3002\u5143\u7D20 ''{1}'' \u4E0D\u80FD\u4E3A\u7A7A\u3002
- s4s-elt-invalid-content.3 = s4s-elt-invalid-content.3: \u7C7B\u578B\u4E3A ''{0}'' \u7684\u5143\u7D20\u4E0D\u80FD\u5728\u58F0\u660E\u7684\u540E\u9762\u4F5C\u4E3A <schema> \u5143\u7D20\u7684\u5B50\u7EA7\u51FA\u73B0\u3002
- s4s-elt-schema-ns = s4s-elt-schema-ns: \u5143\u7D20 ''{0}'' \u7684\u540D\u79F0\u7A7A\u95F4\u5FC5\u987B\u6765\u81EA\u65B9\u6848\u540D\u79F0\u7A7A\u95F4 ''http://www.w3.org/2001/XMLSchema''\u3002
- s4s-elt-character = s4s-elt-character: \u65B9\u6848\u5143\u7D20\u4E2D\u4E0D\u5141\u8BB8\u51FA\u73B0\u9664 ''xs:appinfo'' \u548C ''xs:documentation'' \u4E4B\u5916\u7684\u975E\u7A7A\u683C\u5B57\u7B26\u3002\u53D1\u73B0\u4E86 ''{0}''\u3002
-
-# codes not defined by the spec
-
- c-fields-xpaths = c-fields-xpaths: \u5B57\u6BB5\u503C ''{0}'' \u65E0\u6548\u3002
- c-general-xpath = c-general-xpath: \u8868\u8FBE\u5F0F ''{0}'' \u4E0E XML \u65B9\u6848\u6240\u652F\u6301\u7684 XPath \u5B50\u96C6\u4E0D\u5339\u914D\u3002
- c-general-xpath-ns = c-general-xpath-ns: XPath \u8868\u8FBE\u5F0F ''{0}'' \u4E2D\u7684\u540D\u79F0\u7A7A\u95F4\u524D\u7F00\u672A\u7ED1\u5B9A\u5230\u540D\u79F0\u7A7A\u95F4\u3002
- c-selector-xpath = c-selector-xpath: \u9009\u62E9\u5668\u503C ''{0}'' \u65E0\u6548; \u9009\u62E9\u5668 xpath \u4E0D\u80FD\u5305\u542B\u5C5E\u6027\u3002
- EmptyTargetNamespace = EmptyTargetNamespace: \u5728\u65B9\u6848\u6587\u6863 ''{0}'' \u4E2D, ''targetNamespace'' \u5C5E\u6027\u7684\u503C\u4E0D\u80FD\u4E3A\u7A7A\u5B57\u7B26\u4E32\u3002
- FacetValueFromBase = FacetValueFromBase: \u5728\u7C7B\u578B ''{0}'' \u7684\u58F0\u660E\u4E2D, \u9762 ''{2}'' \u7684\u503C ''{1}'' \u5FC5\u987B\u6765\u81EA\u57FA\u7C7B\u578B\u7684\u503C\u7A7A\u95F4 ''{3}''\u3002
- FixedFacetValue = FixedFacetValue: \u5728 {3} \u7684\u5B9A\u4E49\u4E2D, \u9762 ''{0}'' \u7684\u503C ''{1}'' \u65E0\u6548, \u56E0\u4E3A ''{0}'' \u7684\u503C\u5DF2\u5728\u539F\u7EA7\u7C7B\u578B\u4E4B\u4E00\u4E2D\u8BBE\u7F6E\u4E3A ''{2}'', \u5E76\u4E14 '{'fixed'}' = true\u3002
- InvalidRegex = InvalidRegex: \u6A21\u5F0F\u503C ''{0}'' \u4E0D\u662F\u6709\u6548\u7684\u6B63\u5219\u8868\u8FBE\u5F0F\u3002\u5217 ''{2}'' \u4E0A\u62A5\u544A\u7684\u9519\u8BEF\u4E3A: ''{1}''\u3002
- MaxOccurLimit = \u89E3\u6790\u5668\u7684\u5F53\u524D\u914D\u7F6E\u4E0D\u5141\u8BB8\u5C06 maxOccurs \u5C5E\u6027\u503C\u8BBE\u7F6E\u4E3A\u5927\u4E8E\u503C {0}\u3002
- PublicSystemOnNotation = PublicSystemOnNotation: \u5143\u7D20 ''notation'' \u4E2D\u5FC5\u987B\u81F3\u5C11\u51FA\u73B0 ''public'' \u548C ''system'' \u4E2D\u7684\u4E00\u4E2A\u3002
- SchemaLocation = SchemaLocation: schemaLocation \u503C ''{0}'' \u5FC5\u987B\u5177\u6709\u5076\u6570\u4E2A URI\u3002
- TargetNamespace.1 = TargetNamespace.1: \u5E94\u4E3A\u540D\u79F0\u7A7A\u95F4 ''{0}'', \u4F46\u65B9\u6848\u6587\u6863\u7684\u76EE\u6807\u540D\u79F0\u7A7A\u95F4\u4E3A ''{1}''\u3002
- TargetNamespace.2 = TargetNamespace.2: \u4E0D\u9700\u8981\u540D\u79F0\u7A7A\u95F4, \u4F46\u6B64\u65B9\u6848\u6587\u6863\u7684\u76EE\u6807\u540D\u79F0\u7A7A\u95F4\u4E3A ''{1}''\u3002
- UndeclaredEntity = UndeclaredEntity: \u672A\u58F0\u660E\u5B9E\u4F53 ''{0}''\u3002
- UndeclaredPrefix = UndeclaredPrefix: \u65E0\u6CD5\u5C06 ''{0}'' \u89E3\u6790\u4E3A\u9650\u5B9A\u540D: \u672A\u58F0\u660E\u524D\u7F00 ''{1}''\u3002
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_zh_TW.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_zh_TW.properties
deleted file mode 100644
index 9f170b1..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_zh_TW.properties
+++ /dev/null
@@ -1,291 +0,0 @@
-# This file contains error and warning messages related to XML Schema
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
- BadMessageKey = \u627E\u4E0D\u5230\u5C0D\u61C9\u8A0A\u606F\u7D22\u5F15\u9375\u7684\u932F\u8AA4\u8A0A\u606F\u3002
- FormatFailed = \u683C\u5F0F\u5316\u4E0B\u5217\u8A0A\u606F\u6642\u767C\u751F\u5167\u90E8\u932F\u8AA4:\n
-
-# For internal use
-
- Internal-Error = \u5167\u90E8\u932F\u8AA4: {0}\u3002
- dt-whitespace = \u806F\u96C6 simpleType ''{0}'' \u6C92\u6709\u53EF\u7528\u7684\u7A7A\u683C Facet \u503C
- GrammarConflict = \u5F9E\u4F7F\u7528\u8005\u6587\u6CD5\u96C6\u5340\u4E2D\u50B3\u56DE\u7684\u4E00\u500B\u6587\u6CD5\u8207\u5176\u4ED6\u6587\u6CD5\u885D\u7A81\u3002
-
-# Identity constraints
-
- AbsentKeyValue = \u8B58\u5225\u9650\u5236\u689D\u4EF6\u932F\u8AA4 (cvc-identity-constraint.4.2.1): \u5143\u7D20 "{0}" \u5177\u6709\u7684\u91D1\u9470\u6C92\u6709\u503C\u3002
- DuplicateField = \u7BC4\u570D\u4E2D\u7684\u6B04\u4F4D "{0}" \u91CD\u8907\u914D\u5C0D\u3002
- DuplicateKey = \u70BA\u5143\u7D20 "{1}" \u7684\u8B58\u5225\u9650\u5236\u689D\u4EF6\u5BA3\u544A\u4E86\u91CD\u8907\u7684\u91D1\u9470\u503C [{0}]\u3002
- DuplicateUnique = \u70BA\u5143\u7D20 "{1}" \u7684\u8B58\u5225\u9650\u5236\u689D\u4EF6\u5BA3\u544A\u4E86\u91CD\u8907\u7684\u552F\u4E00\u503C [{0}]\u3002
- FieldMultipleMatch = \u8B58\u5225\u9650\u5236\u689D\u4EF6\u932F\u8AA4: \u6B04\u4F4D "{0}" \u7B26\u5408\u5176\u9078\u53D6\u5668\u7BC4\u570D\u5167\u8D85\u904E\u4E00\u500B\u4EE5\u4E0A\u7684\u503C; \u6B04\u4F4D\u5FC5\u9808\u7B26\u5408\u552F\u4E00\u503C\u3002
- FixedDiffersFromActual = \u6B64\u5143\u7D20\u7684\u5167\u5BB9\u4E0D\u7B49\u65BC\u7DB1\u8981\u5143\u7D20\u5BA3\u544A\u4E2D "fixed" \u5C6C\u6027\u7684\u503C\u3002
- KeyMatchesNillable = \u8B58\u5225\u9650\u5236\u689D\u4EF6\u932F\u8AA4 (cvc-identity-constraint.4.2.3): \u5143\u7D20 "{0}" \u5177\u6709\u7684\u91D1\u9470\uFF0C\u7B26\u5408 nillable \u8A2D\u70BA\u771F\u7684\u5143\u7D20\u3002
- KeyNotEnoughValues = \u6C92\u6709\u8DB3\u5920\u7684\u503C\u6307\u5B9A\u5143\u7D20 "{0}" \u6307\u5B9A\u7684 <key name="{1}"> \u8B58\u5225\u9650\u5236\u689D\u4EF6\u3002
- KeyNotFound = \u5143\u7D20 ''{2}'' \u7684\u8B58\u5225\u9650\u5236\u689D\u4EF6\u627E\u4E0D\u5230\u503C ''{1}'' \u7684\u91D1\u9470 ''{0}''\u3002
- KeyRefNotEnoughValues = \u6C92\u6709\u8DB3\u5920\u7684\u503C\u6307\u5B9A\u5143\u7D20 "{0}" \u6307\u5B9A\u7684 <keyref name="{1}"> \u8B58\u5225\u9650\u5236\u689D\u4EF6\u3002
- KeyRefOutOfScope = \u8B58\u5225\u9650\u5236\u689D\u4EF6\u932F\u8AA4: \u8B58\u5225\u9650\u5236\u689D\u4EF6 "{0}" \u5177\u6709\u4E00\u500B keyref\uFF0C\u5B83\u53C3\u7167\u4E86\u7BC4\u570D\u4E4B\u5916\u7684\u91D1\u9470\u6216\u552F\u4E00\u503C\u3002
- KeyRefReferNotFound = \u91D1\u9470\u53C3\u7167\u5BA3\u544A "{0}" \u53C3\u7167\u4E86\u540D\u7A31\u70BA "{1}" \u7684\u4E0D\u660E\u91D1\u9470\u3002
- UniqueNotEnoughValues = \u6C92\u6709\u8DB3\u5920\u7684\u503C\u6307\u5B9A\u5143\u7D20 "{0}" \u6307\u5B9A\u7684 <unique> \u8B58\u5225\u9650\u5236\u689D\u4EF6\u3002
- UnknownField = \u5167\u90E8\u8B58\u5225\u9650\u5236\u689D\u4EF6\u932F\u8AA4; \u4E0D\u660E\u7684\u6B04\u4F4D "{0}"\u3002
-
-# Ideally, we should only use the following error keys, not the ones under
-# "Identity constraints". And we should cover all of the following errors.
-
-#validation (3.X.4)
-
- cvc-attribute.3 = cvc-attribute.3: \u5143\u7D20 ''{0}'' \u4E0A\u5C6C\u6027 ''{1}'' \u7684\u503C ''{2}'' \u5C0D\u65BC\u5176\u985E\u578B ''{3}'' \u7121\u6548\u3002
- cvc-attribute.4 = cvc-attribute.4: \u5143\u7D20 ''{0}'' \u4E0A\u5C6C\u6027 ''{1}'' \u7684\u503C ''{2}'' \u5C0D\u65BC\u5176\u56FA\u5B9A '{'value constraint'}' \u7121\u6548\u3002\u5C6C\u6027\u5FC5\u9808\u5177\u6709 ''{3}'' \u7684\u503C\u3002
- cvc-complex-type.2.1 = cvc-complex-type.2.1: \u5143\u7D20 ''{0}'' \u4E0D\u80FD\u6709\u5B57\u5143\u6216\u5143\u7D20\u8CC7\u8A0A\u9805\u76EE [children]\uFF0C\u56E0\u70BA\u985E\u578B\u7684\u5167\u5BB9\u985E\u578B\u70BA\u7A7A\u767D\u3002
- cvc-complex-type.2.2 = cvc-complex-type.2.2: \u5143\u7D20 ''{0}'' \u4E0D\u80FD\u6709\u5143\u7D20 [children]\uFF0C\u4E14\u503C\u5FC5\u9808\u6709\u6548\u3002
- cvc-complex-type.2.3 = cvc-complex-type.2.3: \u5143\u7D20 ''{0}'' \u4E0D\u80FD\u6709\u5B57\u5143 [children]\uFF0C\u56E0\u70BA\u985E\u578B\u7684\u5167\u5BB9\u985E\u578B\u70BA element-only\u3002
- cvc-complex-type.2.4.a = cvc-complex-type.2.4.a: \u5F9E\u5143\u7D20 ''{0}'' \u958B\u59CB\u627E\u5230\u7121\u6548\u7684\u5167\u5BB9\u3002\u9810\u671F\u4E00\u500B ''{1}''\u3002
- cvc-complex-type.2.4.b = cvc-complex-type.2.4.b: \u5143\u7D20 ''{0}'' \u7684\u5167\u5BB9\u4E0D\u5B8C\u6574\u3002\u9810\u671F\u4E00\u500B ''{1}''\u3002
- cvc-complex-type.2.4.c = cvc-complex-type.2.4.c: \u56B4\u683C\u6BD4\u5C0D\u842C\u7528\u5B57\u5143\uFF0C\u4F46\u662F\u627E\u4E0D\u5230\u5143\u7D20 ''{0}'' \u7684\u5BA3\u544A\u3002
- cvc-complex-type.2.4.d = cvc-complex-type.2.4.d: \u5F9E\u5143\u7D20 ''{0}'' \u958B\u59CB\u627E\u5230\u7121\u6548\u7684\u5167\u5BB9\u3002\u6B64\u8655\u672A\u9810\u671F\u5B50\u9805\u5143\u7D20\u3002
- cvc-complex-type.2.4.e = cvc-complex-type.2.4.d: \u5F9E\u5143\u7D20 ''{0}'' \u958B\u59CB\u627E\u5230\u7121\u6548\u7684\u5167\u5BB9\u3002\u6B64\u8655\u672A\u9810\u671F\u5B50\u9805\u5143\u7D20 ''{1}''\u3002
- cvc-complex-type.3.1 = cvc-complex-type.3.1: \u5143\u7D20 ''{0}'' \u5C6C\u6027 ''{1}'' \u7684\u503C ''{2}'' \u5C0D\u65BC\u5C6C\u6027\u4F7F\u7528\u7121\u6548\u3002\u5C6C\u6027 ''{1}'' \u5177\u6709 ''{3}'' \u7684\u56FA\u5B9A\u503C\u3002
- cvc-complex-type.3.2.1 = cvc-complex-type.3.2.1: \u5143\u7D20 ''{0}'' \u6C92\u6709\u5C6C\u6027 ''{1}'' \u7684\u5C6C\u6027\u842C\u7528\u5B57\u5143\u3002
- cvc-complex-type.3.2.2 = cvc-complex-type.3.2.2: \u4E0D\u5141\u8A31\u5C6C\u6027 ''{1}'' \u51FA\u73FE\u5728\u5143\u7D20 ''{0}'' \u4E2D\u3002
- cvc-complex-type.4 = cvc-complex-type.4: \u5C6C\u6027 ''{1}'' \u5FC5\u9808\u51FA\u73FE\u5728\u5143\u7D20 ''{0}'' \u4E2D\u3002
- cvc-complex-type.5.1 = cvc-complex-type.5.1: \u5728\u5143\u7D20 ''{0}'' \u4E2D\uFF0C\u5C6C\u6027 ''{1}'' \u70BA Wild ID\u3002\u4F46\u662F\u5DF2\u7D93\u6709\u4E00\u500B Wild ID ''{2}''\u3002\u53EA\u80FD\u6709\u4E00\u500B Wild ID\u3002
- cvc-complex-type.5.2 = cvc-complex-type.5.2: \u5728\u5143\u7D20 ''{0}'' \u4E2D\uFF0C\u5C6C\u6027 ''{1}'' \u70BA Wild ID\u3002\u4F46\u662F\u5DF2\u7D93\u6709\u4E00\u500B\u5F9E '{'attribute uses'}' \u4E2D\u7684 ID \u884D\u751F\u800C\u4F86\u7684\u5C6C\u6027 ''{2}''\u3002
- cvc-datatype-valid.1.2.1 = cvc-datatype-valid.1.2.1: ''{0}'' \u4E0D\u662F ''{1}'' \u7684\u6709\u6548\u503C\u3002
- cvc-datatype-valid.1.2.2 = cvc-datatype-valid.1.2.2: ''{0}'' \u4E0D\u662F\u6E05\u55AE\u985E\u578B ''{1}'' \u7684\u6709\u6548\u503C\u3002
- cvc-datatype-valid.1.2.3 = cvc-datatype-valid.1.2.3: ''{0}'' \u4E0D\u662F\u806F\u96C6\u985E\u578B ''{1}'' \u7684\u6709\u6548\u503C\u3002
- cvc-elt.1 = cvc-elt.1: \u627E\u4E0D\u5230\u5143\u7D20 ''{0}'' \u7684\u5BA3\u544A\u3002
- cvc-elt.2 = cvc-elt.2: ''{0}'' \u5143\u7D20\u5BA3\u544A\u4E2D '{'abstract'}' \u7684\u503C\u5FC5\u9808\u70BA\u507D\u3002
- cvc-elt.3.1 = cvc-elt.3.1: \u5C6C\u6027 ''{1}'' \u4E0D\u53EF\u51FA\u73FE\u5728\u5143\u7D20 ''{0}'' \u4E2D\uFF0C\u56E0\u70BA ''{0}'' \u7684 '{'nillable'}' \u5C6C\u6027\u70BA\u507D\u3002
- cvc-elt.3.2.1 = cvc-elt.3.2.1: \u5143\u7D20 ''{0}'' \u4E0D\u53EF\u6709\u5B57\u5143\u6216\u5143\u7D20\u8CC7\u8A0A [children]\uFF0C\u56E0\u70BA\u6307\u5B9A\u4E86 ''{1}''\u3002
- cvc-elt.3.2.2 = cvc-elt.3.2.2: \u5143\u7D20 ''{0}'' \u4E0D\u53EF\u6709\u56FA\u5B9A\u7684 '{'value constraint'}'\uFF0C\u56E0\u70BA\u6307\u5B9A\u4E86 ''{1}''\u3002
- cvc-elt.4.1 = cvc-elt.4.1: \u5143\u7D20 ''{0}'' \u5C6C\u6027 ''{1}'' \u7684\u503C ''{2}'' \u4E0D\u662F\u6709\u6548\u7684 QName\u3002
- cvc-elt.4.2 = cvc-elt.4.2: \u7121\u6CD5\u5C07 ''{1}'' \u89E3\u6790\u70BA\u5143\u7D20 ''{0}'' \u7684\u985E\u578B\u5B9A\u7FA9\u3002
- cvc-elt.4.3 = cvc-elt.4.3: \u985E\u578B ''{1}'' \u4E0D\u662F\u6709\u6548\u884D\u751F\u81EA\u5143\u7D20 ''{0}'' \u7684\u985E\u578B\u5B9A\u7FA9 ''{2}''\u3002
- cvc-elt.5.1.1 = cvc-elt.5.1.1: \u5143\u7D20 ''{0}'' \u7684 '{'value constraint'}' ''{2}'' \u4E0D\u662F\u985E\u578B ''{1}'' \u7684\u6709\u6548\u9810\u8A2D\u503C\u3002
- cvc-elt.5.2.2.1 = cvc-elt.5.2.2.1: \u5143\u7D20 ''{0}'' \u4E0D\u53EF\u6709\u5143\u7D20\u8CC7\u8A0A\u9805\u76EE [children]\u3002
- cvc-elt.5.2.2.2.1 = cvc-elt.5.2.2.2.1: \u5143\u7D20 ''{0}'' \u7684\u503C ''{1}'' \u4E0D\u7B26\u5408\u56FA\u5B9A '{'value constraint'}' \u503C ''{2}''\u3002
- cvc-elt.5.2.2.2.2 = cvc-elt.5.2.2.2.2: \u5143\u7D20 ''{0}'' \u7684\u503C ''{1}'' \u4E0D\u7B26\u5408 '{'value constraint'}' \u503C ''{2}''\u3002
- cvc-enumeration-valid = cvc-enumeration-valid: \u503C ''{0}'' \u5C0D\u65BC\u5217\u8209 ''{1}'' \u800C\u8A00\u4E26\u975E facet-valid\u3002\u5B83\u5FC5\u9808\u662F\u4F86\u81EA\u5217\u8209\u7684\u503C\u3002
- cvc-fractionDigits-valid = cvc-fractionDigits-valid: \u503C ''{0}'' \u5177\u6709 {1} \u5206\u6578\u4F4D\u6578\uFF0C\u4F46\u662F\u5206\u6578\u4F4D\u6578\u7684\u6578\u76EE\u9650\u5236\u70BA {2}\u3002
- cvc-id.1 = cvc-id.1: IDREF ''{0}'' \u6C92\u6709 ID/IDREF \u9023\u7D50\u3002
- cvc-id.2 = cvc-id.2: \u6709\u591A\u500B ID \u503C ''{0}''\u3002
- cvc-id.3 = cvc-id.3: \u8B58\u5225\u9650\u5236\u689D\u4EF6 ''{0}'' \u7684\u6B04\u4F4D\u7B26\u5408\u5143\u7D20 ''{1}''\uFF0C\u4F46\u662F\u6B64\u5143\u7D20\u6C92\u6709\u7C21\u55AE\u985E\u578B\u3002
- cvc-length-valid = cvc-length-valid: \u9577\u5EA6 = ''{1}'' \u7684\u503C ''{0}'' \u5C0D\u65BC\u985E\u578B ''{3}'' \u9577\u5EA6 ''{2}'' \u800C\u8A00\u4E26\u975E facet-valid\u3002
- cvc-maxExclusive-valid = cvc-maxExclusive-valid: \u503C ''{0}'' \u5C0D\u65BC\u985E\u578B ''{2}'' maxExclusive ''{1}'' \u800C\u8A00\u4E26\u975E facet-valid\u3002
- cvc-maxInclusive-valid = cvc-maxInclusive-valid: \u503C ''{0}'' \u5C0D\u65BC\u985E\u578B ''{2}'' maxInclusive ''{1}'' \u800C\u8A00\u4E26\u975E facet-valid\u3002
- cvc-maxLength-valid = cvc-maxLength-valid: \u9577\u5EA6 = ''{1}'' \u7684\u503C ''{0}'' \u5C0D\u65BC\u985E\u578B ''{3}'' maxLength ''{2}'' \u800C\u8A00\u4E26\u975E facet-valid\u3002
- cvc-minExclusive-valid = cvc-minExclusive-valid: \u503C ''{0}'' \u5C0D\u65BC\u985E\u578B ''{2}'' minExclusive ''{1}'' \u800C\u8A00\u4E26\u975E facet-valid\u3002
- cvc-minInclusive-valid = cvc-minInclusive-valid: \u503C ''{0}'' \u5C0D\u65BC\u985E\u578B ''{2}'' minInclusive ''{1}'' \u800C\u8A00\u4E26\u975E facet-valid\u3002
- cvc-minLength-valid = cvc-minLength-valid: \u9577\u5EA6 = ''{1}'' \u7684\u503C ''{0}'' \u5C0D\u65BC\u985E\u578B ''{3}'' minLength ''{2}'' \u800C\u8A00\u4E26\u975E facet-valid\u3002
- cvc-pattern-valid = cvc-pattern-valid: \u503C ''{0}'' \u5C0D\u65BC\u985E\u578B ''{2}'' \u6A23\u5F0F ''{1}'' \u800C\u8A00\u4E26\u975E facet-valid\u3002
- cvc-totalDigits-valid = cvc-totalDigits-valid: \u503C ''{0}'' \u5177\u6709 {1} \u7E3D\u4F4D\u6578\uFF0C\u4F46\u662F\u7E3D\u4F4D\u6578\u7684\u6578\u76EE\u9650\u5236\u70BA {2}\u3002
- cvc-type.2 = cvc-type.2: \u5143\u7D20 {0} \u7684\u985E\u578B\u5B9A\u7FA9\u4E0D\u53EF\u70BA\u62BD\u8C61\u3002
- cvc-type.3.1.1 = cvc-type.3.1.1: \u5143\u7D20 ''{0}'' \u70BA\u7C21\u55AE\u985E\u578B\uFF0C\u56E0\u6B64\u4E0D\u80FD\u6709\u5C6C\u6027\uFF0C\u4F46\u4E0D\u5305\u62EC\u547D\u540D\u7A7A\u9593\u540D\u7A31\u7B49\u65BC ''http://www.w3.org/2001/XMLSchema-instance'' \u8207 [local name] \u70BA ''type''\u3001''nil''\u3001''schemaLocation'' \u6216 ''noNamespaceSchemaLocation'' \u5176\u4E2D\u4E4B\u4E00\u8005\u3002\u4E0D\u904E\uFF0C\u627E\u5230\u5C6C\u6027 ''{1}''\u3002
- cvc-type.3.1.2 = cvc-type.3.1.2: \u5143\u7D20 ''{0}'' \u70BA\u7C21\u55AE\u985E\u578B\uFF0C\u56E0\u6B64\u4E0D\u53EF\u6709\u5143\u7D20\u8CC7\u8A0A\u9805\u76EE [children]\u3002
- cvc-type.3.1.3 = cvc-type.3.1.3: \u5143\u7D20 ''{0}'' \u7684\u503C ''{1}'' \u7121\u6548\u3002
-
-#schema valid (3.X.3)
-
- schema_reference.access = schema_reference: \u7121\u6CD5\u8B80\u53D6\u7DB1\u8981\u6587\u4EF6 ''{0}''\uFF0C\u56E0\u70BA accessExternalSchema \u5C6C\u6027\u8A2D\u5B9A\u7684\u9650\u5236\uFF0C\u6240\u4EE5\u4E0D\u5141\u8A31 ''{1}'' \u5B58\u53D6\u3002
- schema_reference.4 = schema_reference.4: \u7121\u6CD5\u8B80\u53D6\u7DB1\u8981\u6587\u4EF6 ''{0}''\uFF0C\u56E0\u70BA 1) \u627E\u4E0D\u5230\u6587\u4EF6; 2) \u7121\u6CD5\u8B80\u53D6\u6587\u4EF6; 3) \u6587\u4EF6\u7684\u6839\u5143\u7D20\u4E0D\u662F <xsd:schema>\u3002
- src-annotation = src-annotation: <annotation> \u5143\u7D20\u50C5\u80FD\u5305\u542B <appinfo> \u8207 <documentation> \u5143\u7D20\uFF0C\u4F46\u627E\u5230 ''{0}''\u3002
- src-attribute.1 = src-attribute.1: \u5C6C\u6027 ''default'' \u8207 ''fixed'' \u4E0D\u53EF\u540C\u6642\u51FA\u73FE\u5728\u5C6C\u6027\u5BA3\u544A ''{0}'' \u4E2D\u3002\u8ACB\u53EA\u4F7F\u7528\u5176\u4E2D\u4E00\u500B\u3002
- src-attribute.2 = src-attribute.2: : \u5C6C\u6027 ''default'' \u51FA\u73FE\u5728\u5C6C\u6027 ''{0}'' \u4E2D\uFF0C\u56E0\u6B64 ''use'' \u7684\u503C\u5FC5\u9808\u662F ''optional''\u3002
- src-attribute.3.1 = src-attribute.3.1: 'ref' \u6216 'name' \u5176\u4E2D\u4E4B\u4E00\u5FC5\u9808\u51FA\u73FE\u5728\u5340\u57DF\u5C6C\u6027\u5BA3\u544A\u4E2D\u3002
- src-attribute.3.2 = src-attribute.3.2: \u5167\u5BB9\u5FC5\u9808\u7B26\u5408 (annotation?) \u5C6C\u6027\u53C3\u7167 ''{0}''\u3002
- src-attribute.4 = src-attribute.4: \u5C6C\u6027 ''{0}'' \u540C\u6642\u5177\u6709 ''type'' \u5C6C\u6027\u8207\u533F\u540D ''simpleType'' \u5B50\u9805\u3002\u5C6C\u6027\u50C5\u5141\u8A31\u5176\u4E2D\u4E4B\u4E00\u3002
- src-attribute_group.2 = src-attribute_group.2: \u842C\u7528\u5B57\u5143\u7684\u4EA4\u96C6\u5C0D\u65BC\u5C6C\u6027\u7FA4\u7D44 ''{0}'' \u7121\u6CD5\u8868\u793A\u3002
- src-attribute_group.3 = src-attribute_group.3: \u5C6C\u6027\u7FA4\u7D44 ''{0}'' \u5075\u6E2C\u5230\u5FAA\u74B0\u5B9A\u7FA9\u3002\u905E\u8FF4\u4F7F\u7528\u5C6C\u6027\u7FA4\u7D44\u53C3\u7167\u5C07\u6703\u56DE\u5230\u672C\u8EAB\u3002
- src-ct.1 = src-ct.1: \u985E\u578B ''{0}'' \u7684\u8907\u96DC\u985E\u578B\u5B9A\u7FA9\u8868\u793A\u932F\u8AA4\u3002\u7576\u4F7F\u7528 <complexContent> \u6642\uFF0C\u57FA\u790E\u985E\u578B\u5FC5\u9808\u70BA complexType\u3002''{1}'' \u70BA simpleType\u3002
- src-ct.2.1 = src-ct.2.1: \u985E\u578B ''{0}'' \u7684\u8907\u96DC\u985E\u578B\u5B9A\u7FA9\u8868\u793A\u932F\u8AA4\u3002\u4F7F\u7528 <simpleContent> \u6642\uFF0C\u57FA\u790E\u985E\u578B\u5FC5\u9808\u70BA complexType\uFF0C\u4F46\u5176\u5167\u5BB9\u985E\u578B\u70BA\u7C21\u55AE; \u6216\u8005\u6307\u5B9A\u9650\u5236\u6642\uFF0C\u5176\u5167\u5BB9\u70BA\u6DF7\u5408\u5167\u5BB9\u8207\u53EF\u7A7A\u767D\u7269\u4EF6\u7684\u8907\u96DC\u985E\u578B; \u6216\u8005\u6307\u5B9A\u64F4\u5145\u5957\u4EF6\u6642\uFF0C\u5176\u5167\u5BB9\u70BA\u7C21\u55AE\u985E\u578B\u3002''{1}'' \u4E0D\u7B26\u5408\u9019\u4E9B\u689D\u4EF6\u3002
- src-ct.2.2 = src-ct.2.2: \u985E\u578B ''{0}'' \u7684\u8907\u96DC\u985E\u578B\u5B9A\u7FA9\u8868\u793A\u932F\u8AA4\u3002\u7576\u5177\u6709 simpleContent \u7684 complexType \u9650\u5236\u5177\u6709\u6DF7\u5408\u5167\u5BB9\u7684 complexType \u8207\u53EF\u7A7A\u767D\u7269\u4EF6\u6642\uFF0C\u5728 <restriction> \u7684\u5B50\u9805\u7576\u4E2D\u5FC5\u9808\u6709\u4E00\u500B <simpleType>\u3002
- src-ct.4 = src-ct.4: \u985E\u578B ''{0}'' \u7684\u8907\u96DC\u985E\u578B\u5B9A\u7FA9\u8868\u793A\u932F\u8AA4\u3002\u842C\u7528\u5B57\u5143\u7684\u4EA4\u96C6\u7121\u6CD5\u8868\u793A\u3002
- src-ct.5 = src-ct.5: \u985E\u578B ''{0}'' \u7684\u8907\u96DC\u985E\u578B\u5B9A\u7FA9\u8868\u793A\u932F\u8AA4\u3002\u842C\u7528\u5B57\u5143\u7684\u806F\u96C6\u7121\u6CD5\u8868\u793A\u3002
- src-element.1 = src-element.1: \u5C6C\u6027 ''default'' \u8207 ''fixed'' \u4E0D\u53EF\u540C\u6642\u51FA\u73FE\u5728\u5143\u7D20\u5BA3\u544A ''{0}'' \u4E2D\u3002\u8ACB\u53EA\u4F7F\u7528\u5176\u4E2D\u4E00\u500B\u3002
- src-element.2.1 = src-element.2.1: : 'ref' \u6216 'name' \u5176\u4E2D\u4E4B\u4E00\u5FC5\u9808\u51FA\u73FE\u5728\u5340\u57DF\u5143\u7D20\u5BA3\u544A\u4E2D\u3002
- src-element.2.2 = src-element.2.2: \u7531\u65BC ''{0}'' \u5305\u542B ''ref'' \u5C6C\u6027\uFF0C\u5176\u5167\u5BB9\u5FC5\u9808\u7B26\u5408 (annotation?)\u3002\u4E0D\u904E\uFF0C\u627E\u5230 ''{1}''\u3002
- src-element.3 = src-element.3: \u5143\u7D20 ''{0}'' \u540C\u6642\u5177\u6709 ''type'' \u5C6C\u6027\u8207 ''anonymous type'' \u5B50\u9805\u3002\u5143\u7D20\u50C5\u5141\u8A31\u5176\u4E2D\u4E4B\u4E00\u3002
- src-import.1.1 = src-import.1.1: <import> \u5143\u7D20\u8CC7\u8A0A\u9805\u76EE\u7684\u547D\u540D\u7A7A\u9593\u5C6C\u6027 ''{0}'' \u4E0D\u53EF\u8207\u5B83\u6240\u5B58\u5728\u7DB1\u8981\u7684 targetNamespace \u76F8\u540C\u3002
- src-import.1.2 = src-import.1.2: \u82E5\u547D\u540D\u7A7A\u9593\u5C6C\u6027\u672A\u51FA\u73FE\u5728 <import> \u5143\u7D20\u8CC7\u8A0A\u9805\u76EE\u4E0A\uFF0C\u5247\u5305\u542B\u7684\u7DB1\u8981\u5FC5\u9808\u6709 targetNamespace\u3002
- src-import.2 = src-import.2: \u6587\u4EF6 ''{0}'' \u7684\u6839\u5143\u7D20\u5FC5\u9808\u5177\u6709\u547D\u540D\u7A7A\u9593\u540D\u7A31 ''http://www.w3.org/2001/XMLSchema'' \u8207\u5340\u57DF\u540D\u7A31 ''schema''\u3002
- src-import.3.1 = src-import.3.1: <import> \u5143\u7D20\u8CC7\u8A0A\u9805\u76EE\u7684\u547D\u540D\u7A7A\u9593\u5C6C\u6027 ''{0}'' \u5FC5\u9808\u7B49\u65BC\u532F\u5165\u6587\u4EF6\u7684 targetNamespace \u5C6C\u6027 ''{1}''\u3002
- src-import.3.2 = src-import.3.2: \u627E\u5230\u6C92\u6709\u547D\u540D\u7A7A\u9593\u5C6C\u6027\u7684 <import> \u5143\u7D20\u8CC7\u8A0A\u9805\u76EE\uFF0C\u56E0\u6B64\uFF0C\u532F\u5165\u7684\u6587\u4EF6\u4E0D\u80FD\u5177\u6709 targetNamespace \u5C6C\u6027\u3002\u4E0D\u904E\uFF0C\u5728\u532F\u5165\u7684\u6587\u4EF6\u4E2D\u627E\u5230 targetNamespace ''{1}''\u3002
- src-include.1 = src-include.1: \u6587\u4EF6 ''{0}'' \u7684\u6839\u5143\u7D20\u5FC5\u9808\u5177\u6709\u547D\u540D\u7A7A\u9593\u540D\u7A31 ''http://www.w3.org/2001/XMLSchema'' \u8207\u5340\u57DF\u540D\u7A31 ''schema''\u3002
- src-include.2.1 = src-include.2.1: \u53C3\u7167\u7DB1\u8981\u7684 targetNamespace (\u76EE\u524D\u70BA ''{1}'') \u5FC5\u9808\u7B49\u65BC\u5305\u542B\u7DB1\u8981\u7684 targetNamespace (\u76EE\u524D\u70BA ''{0}'')\u3002
- src-redefine.2 = src-redefine.2: \u6587\u4EF6 ''{0}'' \u7684\u6839\u5143\u7D20\u5FC5\u9808\u5177\u6709\u547D\u540D\u7A7A\u9593\u540D\u7A31 ''http://www.w3.org/2001/XMLSchema'' \u8207\u5340\u57DF\u540D\u7A31 ''schema''\u3002
- src-redefine.3.1 = src-redefine.3.1: \u53C3\u7167\u7DB1\u8981\u7684 targetNamespace (\u76EE\u524D\u70BA ''{1}'') \u5FC5\u9808\u7B49\u65BC\u91CD\u65B0\u5B9A\u7FA9\u7DB1\u8981\u7684 targetNamespace (\u76EE\u524D\u70BA ''{0}'')\u3002
- src-redefine.5.a.a = src-redefine.5.a.a: \u627E\u4E0D\u5230 <simpleType> \u975E\u8A3B\u89E3\u5B50\u9805\u3002<redefine> \u5143\u7D20\u7684 <simpleType> \u5B50\u9805\u5FC5\u9808\u5177\u6709 <restriction> \u5B50\u7CFB\u8207\u53C3\u7167\u672C\u8EAB\u7684 'base' \u5C6C\u6027\u3002
- src-redefine.5.a.b = src-redefine.5.a.b: ''{0}'' \u4E0D\u662F\u6709\u6548\u5B50\u9805\u5143\u7D20\u3002<redefine> \u5143\u7D20\u7684 <simpleType> \u5B50\u9805\u5FC5\u9808\u5177\u6709 <restriction> \u5B50\u7CFB\u8207\u53C3\u7167\u672C\u8EAB\u7684 ''base'' \u5C6C\u6027\u3002
- src-redefine.5.a.c = src-redefine.5.a.c: ''{0}'' \u6C92\u6709\u53C3\u7167\u91CD\u65B0\u5B9A\u7FA9\u5143\u7D20 (''{1}'') \u7684 ''base'' \u5C6C\u6027\u3002<redefine> \u5143\u7D20\u7684 <simpleType> \u5B50\u9805\u5FC5\u9808\u5177\u6709 <restriction> \u5B50\u7CFB\u8207\u53C3\u7167\u672C\u8EAB\u7684 ''base'' \u5C6C\u6027\u3002
- src-redefine.5.b.a = src-redefine.5.b.a: \u627E\u4E0D\u5230 <complexType> \u7684\u975E\u8A3B\u89E3\u5B50\u9805\u3002<redefine> \u5143\u7D20\u7684 <complexType> \u5B50\u9805\u5FC5\u9808\u5177\u6709 <extension> \u6216 <restriction> \u5B50\u7CFB\u8207\u53C3\u7167\u672C\u8EAB\u7684 'base' \u5C6C\u6027\u3002
- src-redefine.5.b.b = src-redefine.5.b.b: \u627E\u4E0D\u5230 <complexType> \u7684\u975E\u8A3B\u89E3\u5B6B\u7CFB\u3002<redefine> \u5143\u7D20\u7684 <complexType> \u5B50\u9805\u5FC5\u9808\u5177\u6709 <extension> \u6216 <restriction> \u5B50\u7CFB\u8207\u53C3\u7167\u672C\u8EAB\u7684 'base' \u5C6C\u6027\u3002
- src-redefine.5.b.c = src-redefine.5.b.c: ''{0}'' \u4E0D\u662F\u6709\u6548\u5B6B\u7CFB\u5143\u7D20\u3002<redefine> \u5143\u7D20\u7684 <complexType> \u5B50\u9805\u5FC5\u9808\u5177\u6709 <extension> \u6216 <restriction> \u5B50\u7CFB\u8207\u53C3\u7167\u672C\u8EAB\u7684 ''base'' \u5C6C\u6027\u3002
- src-redefine.5.b.d = src-redefine.5.b.d: ''{0}'' \u6C92\u6709\u53C3\u7167\u91CD\u65B0\u5B9A\u7FA9\u5143\u7D20 (''{1}'') \u7684 ''base'' \u5C6C\u6027\u3002<redefine> \u5143\u7D20\u7684 <complexType> \u5B50\u9805\u5FC5\u9808\u5177\u6709 <extension> \u6216 <restriction> \u5B50\u7CFB\u8207\u53C3\u7167\u672C\u8EAB\u7684 ''base'' \u5C6C\u6027\u3002
- src-redefine.6.1.1 = src-redefine.6.1.1: \u82E5 <redefine> \u5143\u7D20\u7684\u7FA4\u7D44\u5B50\u9805\u5305\u542B\u53C3\u7167\u672C\u8EAB\u7684\u7FA4\u7D44\uFF0C\u5B83\u5FC5\u9808\u525B\u597D\u53EA\u6709 1 \u500B; \u6B64\u9805\u6709 ''{0}'' \u500B\u3002
- src-redefine.6.1.2 = src-redefine.6.1.2: \u5305\u542B\u91CD\u65B0\u5B9A\u7FA9\u7FA4\u7D44\u53C3\u7167\u7684\u7FA4\u7D44 ''{0}'' \u5FC5\u9808\u5177\u6709 ''minOccurs'' = ''maxOccurs'' = 1\u3002
- src-redefine.6.2.1 = src-redefine.6.2.1: \u91CD\u65B0\u5B9A\u7FA9\u7DB1\u8981\u4E2D\u6C92\u6709\u7FA4\u7D44\u5177\u6709\u7B26\u5408 ''{0}'' \u7684\u540D\u7A31\u3002
- src-redefine.6.2.2 = src-redefine.6.2.2: \u7FA4\u7D44 ''{0}'' \u672A\u9069\u7576\u9650\u5236\u5B83\u91CD\u65B0\u5B9A\u7FA9\u7684\u7FA4\u7D44; \u9055\u53CD\u9650\u5236\u689D\u4EF6: ''{1}''\u3002
- src-redefine.7.1 = src-redefine.7.1: \u82E5 <redefine> \u5143\u7D20\u7684 attributeGroup \u5B50\u9805\u5305\u542B\u53C3\u7167\u672C\u8EAB\u7684 attributeGroup\uFF0C\u5B83\u5FC5\u9808\u525B\u597D\u53EA\u6709 1 \u500B; \u6B64\u9805\u6709 ''{0}'' \u500B\u3002
- src-redefine.7.2.1 = src-redefine.7.2.1: \u91CD\u65B0\u5B9A\u7FA9\u7DB1\u8981\u4E2D\u6C92\u6709 attributeGroup \u5177\u6709\u7B26\u5408 ''{0}'' \u7684\u540D\u7A31\u3002
- src-redefine.7.2.2 = src-redefine.7.2.2: AttributeGroup ''{0}'' \u672A\u9069\u7576\u9650\u5236\u5B83\u91CD\u65B0\u5B9A\u7FA9\u7684 AttributeGroup; \u9055\u53CD\u9650\u5236\u689D\u4EF6: ''{1}''\u3002
- src-resolve = src-resolve: \u7121\u6CD5\u5C07\u540D\u7A31 ''{0}'' \u89E3\u6790\u70BA ''{1}'' \u5143\u4EF6\u3002
- src-resolve.4.1 = src-resolve.4.1: \u89E3\u6790\u5143\u4EF6 ''{2}'' \u6642\u767C\u751F\u932F\u8AA4\u3002\u5075\u6E2C\u5230 ''{2}'' \u6C92\u6709\u547D\u540D\u7A7A\u9593\uFF0C\u4F46\u662F\uFF0C\u5F9E\u7DB1\u8981\u6587\u4EF6 ''{0}'' \u7121\u6CD5\u53C3\u7167\u6C92\u6709\u76EE\u6A19\u547D\u540D\u7A7A\u9593\u7684\u5143\u4EF6\u3002\u82E5\u8981\u8B93 ''{2}'' \u5177\u6709\u547D\u540D\u7A7A\u9593\uFF0C\u53EF\u8003\u616E\u63D0\u4F9B\u524D\u7F6E\u78BC\u3002\u82E5\u4E0D\u8981\u8B93 ''{2}'' \u5177\u6709\u547D\u540D\u7A7A\u9593\uFF0C\u5247\u61C9\u5C07\u6C92\u6709 "namespace" \u5C6C\u6027\u7684 ''import'' \u65B0\u589E\u81F3 ''{0}''\u3002
- src-resolve.4.2 = src-resolve.4.2: \u89E3\u6790\u5143\u4EF6 ''{2}'' \u6642\u767C\u751F\u932F\u8AA4\u3002\u5075\u6E2C\u5230 ''{2}'' \u4F4D\u65BC\u547D\u540D\u7A7A\u9593 ''{1}'' \u4E2D\uFF0C\u4F46\u662F\uFF0C\u5F9E\u7DB1\u8981\u6587\u4EF6 ''{0}'' \u7121\u6CD5\u53C3\u7167\u6B64\u547D\u540D\u7A7A\u9593\u7684\u5143\u4EF6\u3002\u82E5\u6B64\u70BA\u4E0D\u6B63\u78BA\u7684\u547D\u540D\u7A7A\u9593\uFF0C\u53EF\u8003\u616E\u8B8A\u66F4 ''{2}'' \u7684\u524D\u7F6E\u78BC\u3002\u82E5\u6B64\u70BA\u6B63\u78BA\u7684\u547D\u540D\u7A7A\u9593\uFF0C\u5247\u61C9\u5C07\u9069\u7576\u7684 ''import'' \u6A19\u8A18\u65B0\u589E\u81F3 ''{0}''\u3002
- src-simple-type.2.a = src-simple-type.2.a: \u627E\u5230 <restriction> \u5143\u7D20\uFF0C\u5728\u5176 [children] \u4E2D\u540C\u6642\u6709\u57FA\u790E [attribute] \u8207 <simpleType> \u5143\u7D20\u3002\u50C5\u5141\u8A31\u5176\u4E2D\u4E00\u9805\u3002
- src-simple-type.2.b = src-simple-type.2.b: \u627E\u5230 <restriction> \u5143\u7D20\uFF0C\u5728\u5176 [children] \u4E2D\u6C92\u6709\u57FA\u790E [attribute]\uFF0C\u4E5F\u6C92\u6709 <simpleType> \u5143\u7D20\u3002\u9700\u8981\u5176\u4E2D\u4E00\u9805\u3002
- src-simple-type.3.a = src-simple-type.3.a: \u627E\u5230 <list> \u5143\u7D20\uFF0C\u5728\u5176 [children] \u4E2D\u540C\u6642\u6709 itemType [attribute] \u8207 <simpleType> \u5143\u7D20\u3002\u50C5\u5141\u8A31\u5176\u4E2D\u4E00\u9805\u3002
- src-simple-type.3.b = src-simple-type.3.b: \u627E\u5230 <list> \u5143\u7D20\uFF0C\u5728\u5176 [children] \u4E2D\u6C92\u6709 itemType [attribute]\uFF0C\u4E5F\u6C92\u6709 <simpleType> \u5143\u7D20\u3002\u9700\u8981\u5176\u4E2D\u4E00\u9805\u3002
- src-single-facet-value = src-single-facet-value: \u5B9A\u7FA9 facet ''{0}'' \u8D85\u904E\u4E00\u6B21\u4EE5\u4E0A\u3002
- src-union-memberTypes-or-simpleTypes = src-union-memberTypes-or-simpleTypes: <union> \u5143\u7D20\u5728\u5176 [children] \u4E2D\uFF0C\u5FC5\u9808\u5177\u6709\u975E\u7A7A\u767D memberTypes [attribute] \u6216\u81F3\u5C11\u4E00\u500B <simpleType> \u5143\u7D20\u3002
-
-#constraint valid (3.X.6)
-
- ag-props-correct.2 = ag-props-correct.2: \u5C6C\u6027\u7FA4\u7D44 ''{0}'' \u7684\u932F\u8AA4\u3002\u91CD\u8907\u5C6C\u6027\u4F7F\u7528\u76F8\u540C\u540D\u7A31\u4E14\u6307\u5B9A\u4E86\u76EE\u6A19\u547D\u540D\u7A7A\u9593\u3002\u91CD\u8907\u5C6C\u6027\u4F7F\u7528\u7684\u540D\u7A31\u70BA ''{1}''\u3002
- ag-props-correct.3 = ag-props-correct.3: \u5C6C\u6027\u7FA4\u7D44 ''{0}'' \u7684\u932F\u8AA4\u3002\u5169\u500B\u5C6C\u6027\u5BA3\u544A ''{1}'' \u8207 ''{2}'' \u5177\u6709\u884D\u751F\u81EA ID \u7684\u985E\u578B\u3002
- a-props-correct.2 = a-props-correct.2: \u5C6C\u6027 ''{0}'' \u4E2D\u7684\u503C\u9650\u5236\u689D\u4EF6\u503C ''{1}'' \u7121\u6548\u3002
- a-props-correct.3 = a-props-correct.3: \u5C6C\u6027 ''{0}'' \u7121\u6CD5\u4F7F\u7528 ''fixed'' \u6216 ''default''\uFF0C\u56E0\u70BA\u5C6C\u6027\u7684 '{'type definition'}' \u70BA ID\uFF0C\u6216\u884D\u751F\u81EA ID\u3002
- au-props-correct.2 = au-props-correct.2: \u5728 ''{0}'' \u7684\u5C6C\u6027\u5BA3\u544A\u4E2D\uFF0C\u6307\u5B9A\u4E86 ''{1}'' \u7684\u56FA\u5B9A\u503C\u3002\u56E0\u6B64\uFF0C\u82E5\u53C3\u7167 ''{0}'' \u7684\u5C6C\u6027\u4F7F\u7528\u4E5F\u5177\u6709 '{'value constraint'}'\uFF0C\u5B83\u5FC5\u9808\u662F\u56FA\u5B9A\u503C\u4E14\u503C\u5FC5\u9808\u70BA ''{1}''\u3002
- cos-all-limited.1.2 = cos-all-limited.1.2: 'all' \u6A21\u578B\u7FA4\u7D44\u5FC5\u9808\u51FA\u73FE\u5728 '{'min occurs'}' = '{'max occurs'}' = 1 \u7684\u7269\u4EF6\u4E2D\uFF0C\u4E14\u8A72\u7269\u4EF6\u5FC5\u9808\u662F\u4E00\u5C0D\u7D44\u6210\u8907\u96DC\u985E\u578B\u5B9A\u7FA9\u4E4B '{'content type'}' \u7269\u4EF6\u4E2D\u7684\u4E00\u90E8\u5206\u3002
- cos-all-limited.2 = cos-all-limited.2: ''all'' \u6A21\u578B\u7FA4\u7D44\u4E2D\u5143\u7D20\u7684 '{'max occurs'}' \u5FC5\u9808\u662F 0 \u6216 1\u3002\u5143\u7D20 ''{1}'' \u7684\u503C ''{0}'' \u7121\u6548\u3002
- cos-applicable-facets = cos-applicable-facets: \u985E\u578B {1} \u4E0D\u5141\u8A31 Facet ''{0}''\u3002
- cos-ct-extends.1.1 = cos-ct-extends.1.1: \u985E\u578B ''{0}'' \u662F\u7531\u64F4\u5145\u5957\u4EF6\u5F9E\u985E\u578B ''{1}'' \u884D\u751F\u3002\u4E0D\u904E\uFF0C''{1}'' \u7684 ''final'' \u5C6C\u6027\u7981\u6B62\u7531\u64F4\u5145\u5957\u4EF6\u884D\u751F\u3002
- cos-ct-extends.1.4.3.2.2.1.a = cos-ct-extends.1.4.3.2.2.1.a: \u884D\u751F\u985E\u578B\u8207\u5176\u57FA\u790E\u7684\u5167\u5BB9\u985E\u578B\u7686\u5FC5\u9808\u662F\u6DF7\u5408\u985E\u578B\u6216\u5169\u8005\u7686\u662F element-only\u3002\u985E\u578B ''{0}'' \u662F element-only\uFF0C\u4F46\u5176\u57FA\u790E\u985E\u578B\u5247\u5426\u3002
- cos-ct-extends.1.4.3.2.2.1.b = cos-ct-extends.1.4.3.2.2.1.b: \u884D\u751F\u985E\u578B\u8207\u5176\u57FA\u790E\u7684\u5167\u5BB9\u985E\u578B\u7686\u5FC5\u9808\u662F\u6DF7\u5408\u985E\u578B\u6216\u5169\u8005\u7686\u662F element-only\u3002\u985E\u578B ''{0}'' \u70BA\u6DF7\u5408\u985E\u578B\uFF0C\u4F46\u5176\u57FA\u790E\u985E\u578B\u5247\u5426\u3002
- cos-element-consistent = cos-element-consistent: \u985E\u578B ''{0}'' \u7684\u932F\u8AA4\u3002\u5728\u6A21\u578B\u7FA4\u7D44\u4E2D\u51FA\u73FE\u540D\u7A31 ''{1}''\u3001\u4E0D\u540C\u985E\u578B\u7684\u591A\u500B\u5143\u7D20\u3002
- cos-list-of-atomic = cos-list-of-atomic: \u6E05\u55AE\u985E\u578B ''{0}'' \u7684\u5B9A\u7FA9\u4E2D\uFF0C\u985E\u578B ''{1}'' \u662F\u7121\u6548\u7684\u6E05\u55AE\u5143\u7D20\u985E\u578B\uFF0C\u56E0\u70BA\u5B83\u4E0D\u662F\u55AE\u5143\u985E\u578B (''{1}'' \u70BA\u6E05\u55AE\u985E\u578B\uFF0C\u6216\u5305\u542B\u6E05\u55AE\u7684\u806F\u96C6\u985E\u578B)\u3002
- cos-nonambig = cos-nonambig: {0} \u8207 {1} (\u6216\u4F86\u81EA\u5176\u66FF\u4EE3\u7FA4\u7D44\u7684\u5143\u7D20) \u9055\u53CD\u300C\u552F\u4E00\u7269\u4EF6\u5C6C\u6027\u300D\u3002\u4F9D\u6B64\u7DB1\u8981\u9A57\u8B49\u671F\u9593\uFF0C\u70BA\u9019\u5169\u500B\u7269\u4EF6\u5EFA\u7ACB\u4E86\u4E0D\u78BA\u5B9A\u6027\u3002
- cos-particle-restrict.a = cos-particle-restrict.a: \u884D\u751F\u7269\u4EF6\u70BA\u7A7A\u767D\uFF0C\u5247\u57FA\u790E\u7269\u4EF6\u4E0D\u53EF\u70BA\u7A7A\u767D\u3002
- cos-particle-restrict.b = cos-particle-restrict.b: \u57FA\u790E\u7269\u4EF6\u70BA\u7A7A\u767D\uFF0C\u4F46\u662F\u884D\u751F\u7269\u4EF6\u5247\u5426\u3002
- cos-particle-restrict.2 = cos-particle-restrict.2: \u7981\u6B62\u7684\u7269\u4EF6\u9650\u5236: ''{0}''\u3002
- cos-st-restricts.1.1 = cos-st-restricts.1.1: \u985E\u578B ''{1}'' \u70BA\u55AE\u5143\u985E\u578B\uFF0C\u56E0\u6B64\u5176 '{'base type definition'}' (''{0}'') \u5FC5\u9808\u662F\u55AE\u5143\u7C21\u55AE\u985E\u578B\u5B9A\u7FA9\u6216\u5167\u5EFA\u7684\u539F\u59CB\u8CC7\u6599\u985E\u578B\u3002
- cos-st-restricts.2.1 = cos-st-restricts.2.1: \u6E05\u55AE\u985E\u578B ''{0}'' \u7684\u5B9A\u7FA9\u4E2D\uFF0C\u985E\u578B ''{1}'' \u662F\u7121\u6548\u7684\u9805\u76EE\u985E\u578B\uFF0C\u56E0\u70BA\u5B83\u662F\u6E05\u55AE\u985E\u578B\uFF0C\u6216\u5305\u542B\u6E05\u55AE\u7684\u806F\u96C6\u985E\u578B\u3002
- cos-st-restricts.2.3.1.1 = cos-st-restricts.2.3.1.1: '{'item type definition'}' \u7684 '{'final'}' \u5143\u4EF6 ''{0}'' \u5305\u542B ''list''\u3002\u9019\u4EE3\u8868 ''{0}'' \u7121\u6CD5\u4F5C\u70BA\u6E05\u55AE\u985E\u578B ''{1}'' \u7684\u9805\u76EE\u985E\u578B\u3002
- cos-st-restricts.3.3.1.1 = cos-st-restricts.3.3.1.1: '{'member type definitions'}' \u7684 '{'final'}' \u5143\u4EF6 ''{0}'' \u5305\u542B ''union''\u3002\u9019\u4EE3\u8868 ''{0}'' \u7121\u6CD5\u4F5C\u70BA\u806F\u96C6\u985E\u578B ''{1}'' \u7684\u6210\u54E1\u985E\u578B\u3002
- cos-valid-default.2.1 = cos-valid-default.2.1: \u5143\u7D20 ''{0}'' \u5177\u6709\u503C\u9650\u5236\u689D\u4EF6\uFF0C\u4E14\u5FC5\u9808\u5177\u6709\u6DF7\u5408\u6216\u7C21\u55AE\u5167\u5BB9\u6A21\u578B\u3002
- cos-valid-default.2.2.2 = cos-valid-default.2.2.2: \u7531\u65BC\u5143\u7D20 ''{0}'' \u5177\u6709 '{'value constraint'}' \u4E14\u5176\u985E\u578B\u5B9A\u7FA9\u5177\u6709\u6DF7\u5408\u7684 '{'content type'}'\uFF0C\u56E0\u6B64 '{'content type'}' \u7684\u7269\u4EF6\u5FC5\u9808\u662F\u53EF\u7A7A\u767D\u3002
- c-props-correct.2 = c-props-correct.2: keyref ''{0}'' \u8207 key ''{1}'' \u7684 Fields \u57FA\u6578\u5F7C\u6B64\u5FC5\u9808\u76F8\u7B26\u3002
- ct-props-correct.3 = ct-props-correct.3: \u5075\u6E2C\u5230\u8907\u96DC\u985E\u578B ''{0}'' \u7684\u5FAA\u74B0\u5B9A\u7FA9\u3002\u9019\u4EE3\u8868 ''{0}'' \u5305\u542B\u5728\u81EA\u8EAB\u985E\u578B\u968E\u5C64\u4E2D\uFF0C\u9019\u662F\u4E00\u9805\u932F\u8AA4\u3002
- ct-props-correct.4 = ct-props-correct.4: \u985E\u578B ''{0}'' \u7684\u932F\u8AA4\u3002\u91CD\u8907\u5C6C\u6027\u4F7F\u7528\u76F8\u540C\u540D\u7A31\u4E14\u6307\u5B9A\u4E86\u76EE\u6A19\u547D\u540D\u7A7A\u9593\u3002\u91CD\u8907\u5C6C\u6027\u4F7F\u7528\u7684\u540D\u7A31\u70BA ''{1}''\u3002
- ct-props-correct.5 = ct-props-correct.5: \u985E\u578B ''{0}'' \u7684\u932F\u8AA4\u3002\u5169\u500B\u5C6C\u6027\u5BA3\u544A ''{1}'' \u8207 ''{2}'' \u5177\u6709\u884D\u751F\u81EA ID \u7684\u985E\u578B\u3002
- derivation-ok-restriction.1 = derivation-ok-restriction.1: \u985E\u578B ''{0}'' \u7531\u9650\u5236\u5F9E\u985E\u578B ''{1}'' \u884D\u751F\u3002\u4E0D\u904E\uFF0C''{1}'' \u5177\u6709 '{'final'}' \u5C6C\u6027\uFF0C\u7981\u6B62\u7531\u9650\u5236\u884D\u751F\u3002
- derivation-ok-restriction.2.1.1 = derivation-ok-restriction.2.1.1: \u985E\u578B ''{0}'' \u7684\u932F\u8AA4\u3002\u6B64\u985E\u578B\u4E2D\u4F7F\u7528 ''{1}'' \u7684\u5C6C\u6027\u5177\u6709 ''use'' \u503C\u7684 ''{2}''\uFF0C\u9019\u8207\u57FA\u790E\u985E\u578B\u4E2D\u4F7F\u7528\u7B26\u5408\u5C6C\u6027\u7684 ''required'' \u503C\u4E0D\u4E00\u81F4\u3002
- derivation-ok-restriction.2.1.2 = derivation-ok-restriction.2.1.2: \u985E\u578B ''{0}'' \u7684\u932F\u8AA4\u3002\u6B64\u985E\u578B\u4E2D\u4F7F\u7528 ''{1}'' \u7684\u5C6C\u6027\u5177\u6709\u985E\u578B ''{2}''\uFF0C\u9019\u4E0D\u662F\u6709\u6548\u884D\u751F\u81EA ''{3}''\uFF0C\u4EA6\u5373\u57FA\u790E\u985E\u578B\u4E2D\u4F7F\u7528\u7B26\u5408\u5C6C\u6027\u7684\u985E\u578B\u3002
- derivation-ok-restriction.2.1.3.a = derivation-ok-restriction.2.1.3.a: \u985E\u578B ''{0}'' \u7684\u932F\u8AA4\u3002\u6B64\u985E\u578B\u4E2D\u4F7F\u7528 ''{1}'' \u7684\u5C6C\u6027\u5177\u6709\u672A\u56FA\u5B9A\u7684\u6709\u6548\u503C\u9650\u5236\u689D\u4EF6\uFF0C\u800C\u57FA\u790E\u985E\u578B\u4E2D\u4F7F\u7528\u7684\u7B26\u5408\u5C6C\u6027\u6709\u6548\u503C\u9650\u5236\u689D\u4EF6\u70BA\u56FA\u5B9A\u5F0F\u3002
- derivation-ok-restriction.2.1.3.b = derivation-ok-restriction.2.1.3.b: \u985E\u578B ''{0}'' \u7684\u932F\u8AA4\u3002\u6B64\u985E\u578B\u4E2D\u4F7F\u7528 ''{1}'' \u7684\u5C6C\u6027\u5177\u6709 ''{2}'' \u56FA\u5B9A\u503C\u7684\u6709\u6548\u503C\u9650\u5236\u689D\u4EF6\uFF0C\u9019\u8207\u57FA\u790E\u985E\u578B\u4E2D\u4F7F\u7528\u7B26\u5408\u5C6C\u6027\u7684\u56FA\u5B9A\u6709\u6548\u503C\u9650\u5236\u689D\u4EF6 ''{3}'' \u7684\u503C\u4E0D\u4E00\u81F4\u3002
- derivation-ok-restriction.2.2.a = derivation-ok-restriction.2.2.a: \u985E\u578B ''{0}'' \u7684\u932F\u8AA4\u3002\u6B64\u985E\u578B\u4E2D\u4F7F\u7528 ''{1}'' \u7684\u5C6C\u6027\u5728\u57FA\u790E\u985E\u578B\u4E2D\u6C92\u6709\u4F7F\u7528\u7B26\u5408\u7684\u5C6C\u6027\uFF0C\u4E14\u57FA\u790E\u985E\u578B\u6C92\u6709\u842C\u7528\u5B57\u5143\u5C6C\u6027\u3002
- derivation-ok-restriction.2.2.b = derivation-ok-restriction.2.2.b: \u985E\u578B ''{0}'' \u7684\u932F\u8AA4\u3002\u6B64\u985E\u578B\u4E2D\u4F7F\u7528 ''{1}'' \u7684\u5C6C\u6027\u5728\u57FA\u790E\u985E\u578B\u4E2D\u6C92\u6709\u4F7F\u7528\u7B26\u5408\u7684\u5C6C\u6027\uFF0C\u4E14\u57FA\u790E\u985E\u578B\u4E2D\u7684\u842C\u7528\u5B57\u5143\u4E0D\u5141\u8A31\u4F7F\u7528\u6B64\u5C6C\u6027\u7684\u547D\u540D\u7A7A\u9593 ''{2}''\u3002
- derivation-ok-restriction.3 = derivation-ok-restriction.3: \u985E\u578B ''{0}'' \u7684\u932F\u8AA4\u3002\u57FA\u790E\u985E\u578B\u4E2D\u4F7F\u7528 ''{1}'' \u7684\u5C6C\u6027 REQUIRED \u70BA\u771F\uFF0C\u4F46\u662F\u884D\u751F\u985E\u578B\u4E2D\u6C92\u6709\u4F7F\u7528\u7B26\u5408\u7684\u5C6C\u6027\u3002
- derivation-ok-restriction.4.1 = derivation-ok-restriction.4.1: \u985E\u578B ''{0}'' \u7684\u932F\u8AA4\u3002\u884D\u751F\u5177\u6709\u5C6C\u6027\u842C\u7528\u5B57\u5143\uFF0C\u4F46\u662F\u57FA\u790E\u5247\u5426\u3002
- derivation-ok-restriction.4.2 = derivation-ok-restriction.4.2: \u985E\u578B ''{0}'' \u7684\u932F\u8AA4\u3002\u884D\u751F\u4E2D\u7684\u842C\u7528\u5B57\u5143\u4E0D\u662F\u57FA\u790E\u4E2D\u6709\u6548\u7684\u842C\u7528\u5B57\u5143\u5B50\u96C6\u3002
- derivation-ok-restriction.4.3 = derivation-ok-restriction.4.3: \u985E\u578B ''{0}'' \u7684\u932F\u8AA4\u3002\u884D\u751F ({1}) \u4E2D\u842C\u7528\u5B57\u5143\u7684\u8655\u7406\u4F5C\u696D\u5167\u5BB9\u6BD4\u57FA\u790E ({2}) \u4E2D\u7684\u8655\u7406\u4F5C\u696D\u5167\u5BB9\u5F31\u3002
- derivation-ok-restriction.5.2.2.1 = derivation-ok-restriction.5.2.2.1: \u985E\u578B ''{0}'' \u7684\u932F\u8AA4\u3002\u6B64\u985E\u578B\u7684\u7C21\u55AE\u5167\u5BB9\u985E\u578B ''{1}'' \u4E0D\u662F\u57FA\u790E\u7684\u7C21\u55AE\u5167\u5BB9\u985E\u578B (''{2}'') \u7684\u6709\u6548\u9650\u5236\u3002
- derivation-ok-restriction.5.3.2 = derivation-ok-restriction.5.3.2: \u985E\u578B ''{0}'' \u7684\u932F\u8AA4\u3002\u6B64\u985E\u578B\u7684\u5167\u5BB9\u985E\u578B\u70BA\u7A7A\u767D\uFF0C\u4F46\u662F\u57FA\u790E\u7684\u5167\u5BB9\u985E\u578B ''{1}'' \u4E0D\u662F\u7A7A\u767D\u6216\u4E0D\u53EF\u70BA\u7A7A\u767D\u3002
- derivation-ok-restriction.5.4.1.2 = derivation-ok-restriction.5.4.1.2: \u985E\u578B ''{0}'' \u7684\u932F\u8AA4\u3002\u6B64\u985E\u578B\u7684\u5167\u5BB9\u985E\u578B\u70BA\u6DF7\u5408\u985E\u578B\uFF0C\u4F46\u662F\u57FA\u790E\u7684\u5167\u5BB9\u985E\u578B ''{1}'' \u5247\u5426\u3002
- derivation-ok-restriction.5.4.2 = derivation-ok-restriction.5.4.2: \u985E\u578B ''{0}'' \u7684\u932F\u8AA4\u3002\u985E\u578B\u7684\u7269\u4EF6\u4E0D\u662F\u57FA\u790E\u7269\u4EF6\u7684\u6709\u6548\u9650\u5236\u3002
- enumeration-required-notation = enumeration-required-notation: \u7531 {2} ''{1}'' \u4F7F\u7528\u7684 NOTATION \u985E\u578B ''{0}''\uFF0C\u5FC5\u9808\u5177\u6709\u5217\u8209 facet \u503C\uFF0C\u4EE5\u6307\u5B9A\u6B64\u985E\u578B\u4F7F\u7528\u7684\u8868\u793A\u6CD5\u5143\u7D20\u3002
- enumeration-valid-restriction = enumeration-valid-restriction: \u5217\u8209\u503C ''{0}'' \u4E0D\u5728\u57FA\u790E\u985E\u578B {1} \u7684\u503C\u7A7A\u9593\u4E2D\u3002
- e-props-correct.2 = e-props-correct.2: \u5143\u7D20 ''{0}'' \u4E2D\u7684\u503C\u9650\u5236\u689D\u4EF6\u503C ''{1}'' \u7121\u6548\u3002
- e-props-correct.4 = e-props-correct.4: \u5143\u7D20 ''{0}'' \u7684 '{'type definition'}' \u4E0D\u662F\u6709\u6548\u884D\u751F\u81EA substitutionHead ''{1}'' \u7684 '{'type definition'}'\uFF0C\u6216\u662F ''{1}'' \u7684 '{'substitution group exclusions'}' \u5C6C\u6027\u4E0D\u5141\u8A31\u6B64\u884D\u751F\u3002
- e-props-correct.5 = e-props-correct.5: '{'value constraint'}' \u4E0D\u53EF\u51FA\u73FE\u5728\u5143\u7D20 ''{0}'' \u4E0A\uFF0C\u56E0\u70BA\u5143\u7D20\u7684 '{'type definition'}' \u6216 '{'type definition'}' \u7684 '{'content type'}' \u70BA ID\uFF0C\u6216\u884D\u751F\u81EA ID\u3002
- e-props-correct.6 = e-props-correct.6: \u5075\u6E2C\u5230 ''{0}'' \u7684\u5FAA\u74B0\u66FF\u4EE3\u7FA4\u7D44\u3002
- fractionDigits-valid-restriction = fractionDigits-valid-restriction: \u5728 {2} \u7684\u5B9A\u7FA9\u4E2D\uFF0Cfacet ''fractionDigits'' \u7684\u503C ''{0}'' \u7121\u6548\uFF0C\u56E0\u70BA\u5B83\u5FC5\u9808\u5C0F\u65BC\u6216\u7B49\u65BC ''fractionDigits'' \u7684\u503C\uFF0C\u6B64\u503C\u4EE5\u5176\u4E2D\u4E00\u500B\u7956\u7CFB\u985E\u578B\u8A2D\u70BA ''{1}''\u3002
- fractionDigits-totalDigits = fractionDigits-totalDigits: \u5728 {2} \u7684\u5B9A\u7FA9\u4E2D\uFF0Cfacet ''fractionDigits'' \u7684\u503C ''{0}'' \u7121\u6548\uFF0C\u56E0\u70BA\u503C\u5FC5\u9808\u5C0F\u65BC\u6216\u7B49\u65BC ''totalDigits'' \u7684\u503C\uFF0C\u4EA6\u5373 ''{1}''\u3002
- length-minLength-maxLength.1.1 = length-minLength-maxLength.1.1: \u91DD\u5C0D\u985E\u578B {0}\uFF0Clength ''{1}'' \u7684\u503C\u5C0F\u65BC minLength ''{2}'' \u7684\u503C\u662F\u4E00\u9805\u932F\u8AA4\u3002
- length-minLength-maxLength.1.2.a = length-minLength-maxLength.1.2.a: \u91DD\u5C0D\u985E\u578B {0}\uFF0C\u82E5\u76EE\u524D\u9650\u5236\u5177\u6709 minLength facet \u4E14\u76EE\u524D\u7684\u9650\u5236\u6216\u57FA\u790E\u5177\u6709 length facet\uFF0C\u5247\u57FA\u790E\u6C92\u6709 minLength facet \u662F\u4E00\u9805\u932F\u8AA4\u3002
- length-minLength-maxLength.1.2.b = length-minLength-maxLength.1.2.b: \u91DD\u5C0D\u985E\u578B {0}\uFF0C\u76EE\u524D\u7684 minLength ''{1}'' \u4E0D\u7B49\u65BC\u57FA\u790E minLength ''{2}'' \u662F\u4E00\u9805\u932F\u8AA4\u3002
- length-minLength-maxLength.2.1 = length-minLength-maxLength.2.1: \u91DD\u5C0D\u985E\u578B {0}\uFF0Clength ''{1}'' \u7684\u503C\u5927\u65BC maxLength ''{2}'' \u7684\u503C\u662F\u4E00\u9805\u932F\u8AA4\u3002
- length-minLength-maxLength.2.2.a = length-minLength-maxLength.2.2.a: \u91DD\u5C0D\u985E\u578B {0}\uFF0C\u82E5\u76EE\u524D\u7684\u9650\u5236\u5177\u6709 maxLength facet\uFF0C\u4E14\u76EE\u524D\u7684\u9650\u5236\u6216\u57FA\u790E\u5177\u6709 length facet\uFF0C\u5247\u57FA\u790E\u6C92\u6709 maxLength facet \u662F\u4E00\u9805\u932F\u8AA4\u3002
- length-minLength-maxLength.2.2.b = length-minLength-maxLength.2.2.b: \u91DD\u5C0D\u985E\u578B {0}\uFF0C\u76EE\u524D\u7684 maxLength ''{1}'' \u4E0D\u7B49\u65BC\u57FA\u790E maxLength ''{2}'' \u662F\u4E00\u9805\u932F\u8AA4\u3002
- length-valid-restriction = length-valid-restriction: \u985E\u578B ''{2}'' \u7684\u932F\u8AA4\u3002\u7B49\u65BC ''{0}'' \u7684 length \u503C\u5FC5\u9808\u7B49\u65BC\u57FA\u790E\u985E\u578B ''{1}'' \u7684 length \u503C\u3002
- maxExclusive-valid-restriction.1 = maxExclusive-valid-restriction.1: \u985E\u578B ''{2}'' \u7684\u932F\u8AA4\u3002\u7B49\u65BC ''{0}'' \u7684 maxExclusive \u503C\u5FC5\u9808\u5C0F\u65BC\u6216\u7B49\u65BC\u57FA\u790E\u985E\u578B ''{1}'' \u7684 maxExclusive\u3002
- maxExclusive-valid-restriction.2 = maxExclusive-valid-restriction.2: \u985E\u578B ''{2}'' \u7684\u932F\u8AA4\u3002\u7B49\u65BC ''{0}'' \u7684 maxExclusive \u503C\u5FC5\u9808\u5C0F\u65BC\u6216\u7B49\u65BC\u57FA\u790E\u985E\u578B ''{1}'' \u7684 maxInclusive\u3002
- maxExclusive-valid-restriction.3 = maxExclusive-valid-restriction.3: \u985E\u578B ''{2}'' \u7684\u932F\u8AA4\u3002\u7B49\u65BC ''{0}'' \u7684 maxExclusive \u503C\u5FC5\u9808\u5927\u65BC\u57FA\u790E\u985E\u578B ''{1}'' \u7684 minInclusive\u3002
- maxExclusive-valid-restriction.4 = maxExclusive-valid-restriction.4: \u985E\u578B ''{2}'' \u7684\u932F\u8AA4\u3002\u7B49\u65BC ''{0}'' \u7684 maxExclusive \u503C\u5FC5\u9808\u5927\u65BC\u57FA\u790E\u985E\u578B ''{1}'' \u7684 minExclusive\u3002
- maxInclusive-maxExclusive = maxInclusive-maxExclusive: \u70BA\u76F8\u540C\u8CC7\u6599\u985E\u578B\u540C\u6642\u6307\u5B9A maxInclusive \u8207 maxExclusive \u662F\u4E00\u9805\u932F\u8AA4\u3002\u5728 {2} \u4E2D\uFF0CmaxInclusive \u7B49\u65BC ''{0}'' \u4E14 maxExclusive \u7B49\u65BC ''{1}''\u3002
- maxInclusive-valid-restriction.1 = maxInclusive-valid-restriction.1: \u985E\u578B ''{2}'' \u7684\u932F\u8AA4\u3002\u7B49\u65BC ''{0}'' \u7684 maxInclusive \u503C\u5FC5\u9808\u5C0F\u65BC\u6216\u7B49\u65BC\u57FA\u790E\u985E\u578B ''{1}'' \u7684 maxInclusive\u3002
- maxInclusive-valid-restriction.2 = maxInclusive-valid-restriction.2: \u985E\u578B ''{2}'' \u7684\u932F\u8AA4\u3002\u7B49\u65BC ''{0}'' \u7684 maxInclusive \u503C\u5FC5\u9808\u5C0F\u65BC\u57FA\u790E\u985E\u578B ''{1}'' \u7684 maxExclusive\u3002
- maxInclusive-valid-restriction.3 = maxInclusive-valid-restriction.3: \u985E\u578B ''{2}'' \u7684\u932F\u8AA4\u3002\u7B49\u65BC ''{0}'' \u7684 maxInclusive \u503C\u5FC5\u9808\u5927\u65BC\u6216\u7B49\u65BC\u57FA\u790E\u985E\u578B ''{1}'' \u7684 minInclusive\u3002
- maxInclusive-valid-restriction.4 = maxInclusive-valid-restriction.4: \u985E\u578B ''{2}'' \u7684\u932F\u8AA4\u3002\u7B49\u65BC ''{0}'' \u7684 maxInclusive \u503C\u5FC5\u9808\u5927\u65BC\u57FA\u790E\u985E\u578B ''{1}'' \u7684 minExclusive\u3002
- maxLength-valid-restriction = maxLength-valid-restriction: \u5728 {2} \u7684\u5B9A\u7FA9\u4E2D\uFF0C\u7B49\u65BC ''{0}'' \u7684 maxLength \u503C\u5FC5\u9808\u5C0F\u65BC\u6216\u7B49\u65BC\u57FA\u790E\u985E\u578B ''{1}'' \u7684 maxLength \u503C\u3002
- mg-props-correct.2 = mg-props-correct.2: \u5075\u6E2C\u5230\u7FA4\u7D44 ''{0}'' \u7684\u5FAA\u74B0\u5B9A\u7FA9\u3002\u905E\u8FF4\u4F7F\u7528\u7269\u4EF6\u7684 '{'term'}' \u503C\u5C07\u5C0E\u81F3\u5176 '{'term'}' \u70BA\u7FA4\u7D44\u672C\u8EAB\u7684\u7269\u4EF6\u3002
- minExclusive-less-than-equal-to-maxExclusive = minExclusive-less-than-equal-to-maxExclusive: \u5728 {2} \u7684\u5B9A\u7FA9\u4E2D\uFF0C\u7B49\u65BC ''{0}'' \u7684 minExclusive \u503C\u5FC5\u9808\u5C0F\u65BC\u6216\u7B49\u65BC maxExclusive \u503C (\u7B49\u65BC ''{1}'')\u3002
- minExclusive-less-than-maxInclusive = minExclusive-less-than-maxInclusive: \u5728 {2} \u7684\u5B9A\u7FA9\u4E2D\uFF0C\u7B49\u65BC ''{0}'' \u7684 minExclusive \u503C\u5FC5\u9808\u5C0F\u65BC maxInclusive \u503C (\u7B49\u65BC ''{1}'')\u3002
- minExclusive-valid-restriction.1 = minExclusive-valid-restriction.1: \u985E\u578B ''{2}'' \u7684\u932F\u8AA4\u3002\u7B49\u65BC ''{0}'' \u7684 minExclusive \u503C\u5FC5\u9808\u5927\u65BC\u6216\u7B49\u65BC\u57FA\u790E\u985E\u578B ''{1}'' \u7684 minExclusive\u3002
- minExclusive-valid-restriction.2 = minExclusive-valid-restriction.2: \u985E\u578B ''{2}'' \u7684\u932F\u8AA4\u3002\u7B49\u65BC ''{0}'' \u7684 minExclusive \u503C\u5FC5\u9808\u5C0F\u65BC\u6216\u7B49\u65BC\u57FA\u790E\u985E\u578B ''{1}'' \u7684 maxInclusive\u3002
- minExclusive-valid-restriction.3 = minExclusive-valid-restriction.3: \u985E\u578B ''{2}'' \u7684\u932F\u8AA4\u3002\u7B49\u65BC ''{0}'' \u7684 minExclusive \u503C\u5FC5\u9808\u5927\u65BC\u6216\u7B49\u65BC\u57FA\u790E\u985E\u578B ''{1}'' \u7684 minInclusive\u3002
- minExclusive-valid-restriction.4 = minExclusive-valid-restriction.4: \u985E\u578B ''{2}'' \u7684\u932F\u8AA4\u3002\u7B49\u65BC ''{0}'' \u7684 minExclusive \u503C\u5FC5\u9808\u5C0F\u65BC\u57FA\u790E\u985E\u578B ''{1}'' \u7684 maxExclusive\u3002
- minInclusive-less-than-equal-to-maxInclusive = minInclusive-less-than-equal-to-maxInclusive: \u5728 {2} \u7684\u5B9A\u7FA9\u4E2D\uFF0C\u7B49\u65BC ''{0}'' \u7684 minInclusive \u503C\u5FC5\u9808\u5C0F\u65BC\u6216\u7B49\u65BC maxInclusive \u503C (\u7B49\u65BC ''{1}'')\u3002
- minInclusive-less-than-maxExclusive = minInclusive-less-than-maxExclusive: \u5728 {2} \u7684\u5B9A\u7FA9\u4E2D\uFF0C\u7B49\u65BC ''{0}'' \u7684 minInclusive \u503C\u5FC5\u9808\u5C0F\u65BC maxExclusive \u503C (\u7B49\u65BC ''{1}'')\u3002
- minInclusive-minExclusive = minInclusive-minExclusive: \u70BA\u76F8\u540C\u8CC7\u6599\u985E\u578B\u540C\u6642\u6307\u5B9A minInclusive \u8207 minExclusive \u662F\u4E00\u9805\u932F\u8AA4\u3002\u5728 {2} minInclusive \u7B49\u65BC ''{0}'' \u4E14 minExclusive \u7B49\u65BC ''{1}''\u3002
- minInclusive-valid-restriction.1 = minInclusive-valid-restriction.1: \u985E\u578B ''{2}'' \u7684\u932F\u8AA4\u3002\u7B49\u65BC ''{0}'' \u7684 minInclusive \u503C\u5FC5\u9808\u5927\u65BC\u6216\u7B49\u65BC\u57FA\u790E\u985E\u578B ''{1}'' \u7684 minInclusive\u3002
- minInclusive-valid-restriction.2 = minInclusive-valid-restriction.2: \u985E\u578B ''{2}'' \u7684\u932F\u8AA4\u3002\u7B49\u65BC ''{0}'' \u7684 minInclusive \u503C\u5FC5\u9808\u5C0F\u65BC\u6216\u7B49\u65BC\u57FA\u790E\u985E\u578B ''{1}'' \u7684 maxInclusive\u3002
- minInclusive-valid-restriction.3 = minInclusive-valid-restriction.3: \u985E\u578B ''{2}'' \u7684\u932F\u8AA4\u3002\u7B49\u65BC ''{0}'' \u7684 minInclusive \u503C\u5FC5\u9808\u5927\u65BC\u57FA\u790E\u985E\u578B ''{1}'' \u7684 minExclusive\u3002
- minInclusive-valid-restriction.4 = minInclusive-valid-restriction.4: \u985E\u578B ''{2}'' \u7684\u932F\u8AA4\u3002\u7B49\u65BC ''{0}'' \u7684 minInclusive \u503C\u5FC5\u9808\u5C0F\u65BC\u57FA\u790E\u985E\u578B ''{1}'' \u7684 maxExclusive\u3002
- minLength-less-than-equal-to-maxLength = minLength-less-than-equal-to-maxLength: \u5728 {2} \u7684\u5B9A\u7FA9\u4E2D\uFF0C\u7B49\u65BC ''{0}'' \u7684 minLength \u503C\u5FC5\u9808\u5C0F\u65BC maxLength \u503C (\u7B49\u65BC ''{1}'')\u3002
- minLength-valid-restriction = minLength-valid-restriction: \u5728 {2} \u7684\u5B9A\u7FA9\u4E2D\uFF0C\u7B49\u65BC ''{0}'' \u7684 minLength \u5FC5\u9808\u5927\u65BC\u6216\u7B49\u65BC\u57FA\u790E\u985E\u578B ''{1}'' \u7684 minLength\u3002
- no-xmlns = no-xmlns: \u5C6C\u6027\u5BA3\u544A\u7684 {name} \u4E0D\u80FD\u8207 'xmlns' \u76F8\u540C\u3002
- no-xsi = no-xsi: \u5C6C\u6027\u5BA3\u544A\u7684 '{'target namespace'}' \u4E0D\u80FD\u8207 ''{0}'' \u76F8\u540C\u3002
- p-props-correct.2.1 = p-props-correct.2.1: \u5728 ''{0}'' \u7684\u5BA3\u544A\u4E2D\uFF0C''minOccurs'' \u7684\u503C\u70BA ''{1}''\uFF0C\u4F46\u662F\u5B83\u4E0D\u53EF\u5927\u65BC ''maxOccurs'' \u7684\u503C ''{2}''\u3002
- rcase-MapAndSum.1 = rcase-MapAndSum.1: \u7269\u4EF6\u4E4B\u9593\u6C92\u6709\u5B8C\u6574\u7684\u529F\u80FD\u5C0D\u61C9\u3002
- rcase-MapAndSum.2 = rcase-MapAndSum.2: \u7FA4\u7D44\u7684\u767C\u751F\u7BC4\u570D ({0}\uFF0C{1}) \u4E0D\u662F\u57FA\u790E\u7FA4\u7D44\u767C\u751F\u7BC4\u570D ({2}\uFF0C{3}) \u7684\u6709\u6548\u9650\u5236\u3002
- rcase-NameAndTypeOK.1 = rcase-NameAndTypeOK.1: \u5143\u7D20\u5177\u6709\u4E0D\u76F8\u540C\u7684\u540D\u7A31\u8207\u76EE\u6A19\u547D\u540D\u7A7A\u9593: \u547D\u540D\u7A7A\u9593 ''{1}'' \u4E2D\u7684\u5143\u7D20 ''{0}'' \u8207\u547D\u540D\u7A7A\u9593 ''{3}'' \u4E2D\u7684\u5143\u7D20 ''{2}''\u3002
- rcase-NameAndTypeOK.2 = rcase-NameAndTypeOK.2: \u7269\u4EF6\u7684 '{'term'}' \u70BA\u5143\u7D20\u5BA3\u544A ''{0}'' \u7684\u932F\u8AA4\u3002\u5143\u7D20\u5BA3\u544A\u7684 '{'nillable'}' \u70BA\u771F\uFF0C\u4F46\u662F\u57FA\u790E\u985E\u578B\u4E2D\u7684\u5C0D\u61C9\u7269\u4EF6\u5177\u6709 '{'nillable'}' \u70BA\u507D\u7684\u5143\u7D20\u5BA3\u544A\u3002
- rcase-NameAndTypeOK.3 = rcase-NameAndTypeOK.3: \u7269\u4EF6\u7684 '{'term'}' \u70BA\u5143\u7D20\u5BA3\u544A ''{0}'' \u7684\u932F\u8AA4\u3002\u5B83\u7684\u767C\u751F\u7BC4\u570D ({1}\uFF0C{2}) \u4E0D\u662F\u57FA\u790E\u985E\u578B\u4E2D\u5C0D\u61C9\u7269\u4EF6\u7BC4\u570D ({3}\uFF0C{4}) \u7684\u6709\u6548\u9650\u5236\u3002
- rcase-NameAndTypeOK.4.a = rcase-NameAndTypeOK.4.a: \u5143\u7D20 ''{0}'' \u975E\u56FA\u5B9A\u5F0F\uFF0C\u4F46\u662F\u57FA\u790E\u985E\u578B\u4E2D\u5C0D\u61C9\u7684\u5143\u7D20\u5177\u6709\u56FA\u5B9A\u503C ''{1}''\u3002
- rcase-NameAndTypeOK.4.b = rcase-NameAndTypeOK.4.b: \u5143\u7D20 ''{0}'' \u5177\u6709\u56FA\u5B9A\u503C ''{1}''\uFF0C\u4F46\u662F\u57FA\u790E\u985E\u578B\u4E2D\u5C0D\u61C9\u7684\u5143\u7D20\u5177\u6709\u56FA\u5B9A\u503C ''{2}''\u3002
- rcase-NameAndTypeOK.5 = rcase-NameAndTypeOK.5: \u5143\u7D20 ''{0}'' \u7684\u8B58\u5225\u9650\u5236\u689D\u4EF6\u4E0D\u662F\u57FA\u790E\u4E2D\u7684\u5B50\u96C6\u3002
- rcase-NameAndTypeOK.6 = rcase-NameAndTypeOK.6: \u5143\u7D20 ''{0}'' \u4E0D\u5141\u8A31\u7684\u66FF\u4EE3\u4E0D\u662F\u57FA\u790E\u4E2D\u7684\u8D85\u96C6\u3002
- rcase-NameAndTypeOK.7 = rcase-NameAndTypeOK.7: \u5143\u7D20 ''{0}'' \u7684\u985E\u578B ''{1}'' \u4E0D\u662F\u884D\u751F\u81EA\u57FA\u790E\u5143\u7D20 ''{2}'' \u7684\u985E\u578B\u3002
- rcase-NSCompat.1 = rcase-NSCompat.1: \u5143\u7D20 ''{0}'' \u5177\u6709\u57FA\u790E\u4E2D\u842C\u7528\u5B57\u5143\u4E0D\u5141\u8A31\u7684\u547D\u540D\u7A7A\u9593 ''{1}''\u3002
- rcase-NSCompat.2 = rcase-NSCompat.2: \u7269\u4EF6\u7684 '{'term'}' \u70BA\u5143\u7D20\u5BA3\u544A ''{0}'' \u7684\u932F\u8AA4\u3002\u5B83\u7684\u767C\u751F\u7BC4\u570D ({1}\uFF0C{2}) \u4E0D\u662F\u57FA\u790E\u985E\u578B\u4E2D\u5C0D\u61C9\u7269\u4EF6\u7BC4\u570D ({3}\uFF0C{4}) \u7684\u6709\u6548\u9650\u5236\u3002
- rcase-NSRecurseCheckCardinality.1 = rcase-NSRecurseCheckCardinality.1: \u7269\u4EF6\u4E4B\u9593\u6C92\u6709\u5B8C\u6574\u7684\u529F\u80FD\u5C0D\u61C9\u3002
- rcase-NSRecurseCheckCardinality.2 = rcase-NSRecurseCheckCardinality.2: \u7FA4\u7D44\u7684\u767C\u751F\u7BC4\u570D ({0}\uFF0C{1}) \u4E0D\u662F\u57FA\u790E\u842C\u7528\u5B57\u5143\u7BC4\u570D ({2}\uFF0C{3}) \u7684\u6709\u6548\u9650\u5236\u3002
- rcase-NSSubset.1 = rcase-NSSubset.1: \u842C\u7528\u5B57\u5143\u4E0D\u662F\u57FA\u790E\u4E2D\u5C0D\u61C9\u842C\u7528\u5B57\u5143\u7684\u5B50\u96C6\u3002
- rcase-NSSubset.2 = rcase-NSSubset.2: \u842C\u7528\u5B57\u5143\u7684\u767C\u751F\u7BC4\u570D ({0}\uFF0C{1}) \u4E0D\u662F\u57FA\u790E\u842C\u7528\u5B57\u5143\u7BC4\u570D ({2}\uFF0C{3}) \u7684\u6709\u6548\u9650\u5236\u3002
- rcase-NSSubset.3 = rcase-NSSubset.3: \u842C\u7528\u5B57\u5143\u7684\u8655\u7406\u4F5C\u696D\u5167\u5BB9 ''{0}'' \u6BD4\u57FA\u790E ''{1}'' \u4E2D\u7684\u8655\u7406\u4F5C\u696D\u5167\u5BB9\u5F31\u3002
- rcase-Recurse.1 = rcase-Recurse.1: \u7FA4\u7D44\u7684\u767C\u751F\u7BC4\u570D ({0}\uFF0C{1}) \u4E0D\u662F\u57FA\u790E\u7FA4\u7D44\u767C\u751F\u7BC4\u570D ({2}\uFF0C{3}) \u7684\u6709\u6548\u9650\u5236\u3002
- rcase-Recurse.2 = rcase-Recurse.2: \u7269\u4EF6\u4E4B\u9593\u6C92\u6709\u5B8C\u6574\u7684\u529F\u80FD\u5C0D\u61C9\u3002
- rcase-RecurseLax.1 = rcase-RecurseLax.1: \u7FA4\u7D44\u7684\u767C\u751F\u7BC4\u570D ({0}\uFF0C{1}) \u4E0D\u662F\u57FA\u790E\u7FA4\u7D44\u767C\u751F\u7BC4\u570D ({2}\uFF0C{3}) \u7684\u6709\u6548\u9650\u5236\u3002
- rcase-RecurseLax.2 = rcase-RecurseLax.2: \u7269\u4EF6\u4E4B\u9593\u6C92\u6709\u5B8C\u6574\u7684\u529F\u80FD\u5C0D\u61C9\u3002
- rcase-RecurseUnordered.1 = rcase-RecurseUnordered.1: \u7FA4\u7D44\u7684\u767C\u751F\u7BC4\u570D ({0}\uFF0C{1}) \u4E0D\u662F\u57FA\u790E\u7FA4\u7D44\u767C\u751F\u7BC4\u570D ({2}\uFF0C{3}) \u7684\u6709\u6548\u9650\u5236\u3002
- rcase-RecurseUnordered.2 = rcase-RecurseUnordered.2: \u7269\u4EF6\u4E4B\u9593\u6C92\u6709\u5B8C\u6574\u7684\u529F\u80FD\u5C0D\u61C9\u3002
-# We're using sch-props-correct.2 instead of the old src-redefine.1
-# src-redefine.1 = src-redefine.1: The component ''{0}'' is begin redefined, but its corresponding component isn't in the schema document being redefined (with namespace ''{2}''), but in a different document, with namespace ''{1}''.
- sch-props-correct.2 = sch-props-correct.2: \u7DB1\u8981\u7121\u6CD5\u5305\u542B\u76F8\u540C\u540D\u7A31\u7684\u5169\u500B\u5168\u57DF\u5143\u4EF6; \u6B64\u7DB1\u8981\u5305\u542B\u5169\u500B ''{0}''\u3002
- st-props-correct.2 = st-props-correct.2: \u5075\u6E2C\u5230\u7C21\u55AE\u985E\u578B ''{0}'' \u7684\u5FAA\u74B0\u5B9A\u7FA9\u3002\u9019\u4EE3\u8868 ''{0}'' \u5305\u542B\u5728\u81EA\u8EAB\u985E\u578B\u968E\u5C64\u4E2D\uFF0C\u9019\u662F\u4E00\u9805\u932F\u8AA4\u3002
- st-props-correct.3 = st-props-correct.3: \u985E\u578B ''{0}'' \u7684\u932F\u8AA4\u3002'{'base type definition'}' \u7684 '{'final'}' \u503C ''{1}'' \u9650\u5236\u7981\u6B62\u884D\u751F\u3002
- totalDigits-valid-restriction = totalDigits-valid-restriction: \u5728 {2} \u7684\u5B9A\u7FA9\u4E2D\uFF0Cfacet ''totalDigits'' \u7684\u503C ''{0}'' \u7121\u6548\uFF0C\u56E0\u70BA\u5B83\u5FC5\u9808\u5C0F\u65BC\u6216\u7B49\u65BC ''totalDigits'' \u7684\u503C\uFF0C\u6B64\u503C\u4EE5\u5176\u4E2D\u4E00\u500B\u7956\u7CFB\u985E\u578B\u8A2D\u70BA ''{1}''\u3002
- whiteSpace-valid-restriction.1 = whiteSpace-valid-restriction.1: \u5728 {0} \u7684\u5B9A\u7FA9\u4E2D\uFF0Cfacet ''whitespace'' \u7684\u503C ''{1}'' \u7121\u6548\uFF0C\u56E0\u70BA ''whitespace'' \u7684\u503C\u4EE5\u5176\u4E2D\u4E00\u500B\u7956\u7CFB\u985E\u578B\u8A2D\u70BA ''collapse''\u3002
- whiteSpace-valid-restriction.2 = whiteSpace-valid-restriction.2: \u5728 {0} \u7684\u5B9A\u7FA9\u4E2D\uFF0Cfacet ''whitespace'' \u7684\u503C ''preserve'' \u7121\u6548\uFF0C\u56E0\u70BA ''whitespace'' \u7684\u503C\u5728\u5176\u4E2D\u4E00\u500B\u7956\u7CFB\u985E\u578B\u4E2D\u8A2D\u70BA ''replace''\u3002
-
-#schema for Schemas
-
- s4s-att-invalid-value = s4s-att-invalid-value: \u5143\u7D20 ''{0}'' \u4E2D ''{1}'' \u7684\u5C6C\u6027\u503C\u7121\u6548\u3002\u8A18\u9304\u7684\u539F\u56E0: {2}
- s4s-att-must-appear = s4s-att-must-appear: \u5C6C\u6027 ''{1}'' \u5FC5\u9808\u51FA\u73FE\u5728\u5143\u7D20 ''{0}'' \u4E2D\u3002
- s4s-att-not-allowed = s4s-att-not-allowed: \u5C6C\u6027 ''{1}'' \u4E0D\u53EF\u51FA\u73FE\u5728\u5143\u7D20 ''{0}'' \u4E2D\u3002
- s4s-elt-invalid = s4s-elt-invalid: \u5143\u7D20 ''{0}'' \u4E0D\u662F\u7DB1\u8981\u6587\u4EF6\u4E2D\u7684\u6709\u6548\u5143\u7D20\u3002
- s4s-elt-must-match.1 = s4s-elt-must-match.1: ''{0}'' \u7684\u5167\u5BB9\u5FC5\u9808\u7B26\u5408 {1}\u3002\u5F9E {2} \u958B\u59CB\u51FA\u73FE\u554F\u984C\u3002
- s4s-elt-must-match.2 = s4s-elt-must-match.2: ''{0}'' \u7684\u5167\u5BB9\u5FC5\u9808\u7B26\u5408 {1}\u3002\u627E\u4E0D\u5230\u8DB3\u5920\u7684\u5143\u7D20\u3002
- # the "invalid-content" messages provide less information than the "must-match" counterparts above. They're used for complex types when providing a "match" would be an information dump
- s4s-elt-invalid-content.1 = s4s-elt-invalid-content.1: ''{0}'' \u7684\u5167\u5BB9\u7121\u6548\u3002\u5143\u7D20 ''{1}'' \u7121\u6548\u3001\u4F4D\u7F6E\u932F\u8AA4\u6216\u592A\u5E38\u51FA\u73FE\u3002
- s4s-elt-invalid-content.2 = s4s-elt-invalid-content.2: ''{0}'' \u7684\u5167\u5BB9\u7121\u6548\u3002\u5143\u7D20 ''{1}'' \u4E0D\u53EF\u7A7A\u767D\u3002
- s4s-elt-invalid-content.3 = s4s-elt-invalid-content.3: \u985E\u578B ''{0}'' \u7684\u5143\u7D20\u4E0D\u53EF\u51FA\u73FE\u5728\u5BA3\u544A\u4E4B\u5F8C\uFF0C\u4F5C\u70BA <schema> \u5143\u7D20\u7684\u5B50\u9805\u3002
- s4s-elt-schema-ns = s4s-elt-schema-ns: \u5143\u7D20 ''{0}'' \u7684\u547D\u540D\u7A7A\u9593\u5FC5\u9808\u4F86\u81EA\u7DB1\u8981\u547D\u540D\u7A7A\u9593 ''http://www.w3.org/2001/XMLSchema''\u3002
- s4s-elt-character = s4s-elt-character: \u7DB1\u8981\u5143\u7D20\u4E2D\u4E0D\u5141\u8A31\u975E\u7A7A\u767D\u5B57\u5143\uFF0C\u4F46\u662F ''xs:appinfo'' \u8207 ''xs:documentation'' \u9664\u5916\u3002\u767C\u73FE ''{0}''\u3002
-
-# codes not defined by the spec
-
- c-fields-xpaths = c-fields-xpaths: \u7B49\u65BC ''{0}'' \u7684\u6B04\u4F4D\u503C\u7121\u6548\u3002
- c-general-xpath = c-general-xpath: \u8868\u793A\u5F0F ''{0}'' \u5C0D\u65BC XML \u7DB1\u8981\u652F\u63F4\u7684 XPath \u5B50\u96C6\u800C\u8A00\u7121\u6548\u3002
- c-general-xpath-ns = c-general-xpath-ns: XPath \u8868\u793A\u5F0F ''{0}'' \u4E2D\u7684\u547D\u540D\u7A7A\u9593\u524D\u7F6E\u78BC\u672A\u9023\u7D50\u547D\u540D\u7A7A\u9593\u3002
- c-selector-xpath = c-selector-xpath: \u7B49\u65BC ''{0}'' \u7684\u9078\u53D6\u5668\u503C\u7121\u6548; \u9078\u53D6\u5668 xpaths \u4E0D\u80FD\u5305\u542B\u5C6C\u6027\u3002
- EmptyTargetNamespace = EmptyTargetNamespace: \u5728\u7DB1\u8981\u6587\u4EF6 ''{0}'' \u4E2D\uFF0C''targetNamespace'' \u5C6C\u6027\u7684\u503C\u4E0D\u53EF\u70BA\u7A7A\u767D\u5B57\u4E32\u3002
- FacetValueFromBase = FacetValueFromBase: \u5728\u985E\u578B ''{0}'' \u7684\u5BA3\u544A\u4E2D\uFF0Cfacet ''{2}'' \u7684\u503C ''{1}'' \u5FC5\u9808\u4F86\u81EA\u57FA\u790E\u985E\u578B\u7684\u503C\u7A7A\u9593 ''{3}''\u3002
- FixedFacetValue = FixedFacetValue: \u5728 {3} \u7684\u5B9A\u7FA9\u4E2D\uFF0Cfacet ''{0}'' \u7684\u503C ''{1}'' \u7121\u6548\uFF0C\u56E0\u70BA ''{0}'' \u7684\u503C\u4EE5\u5176\u4E2D\u4E00\u500B\u7956\u7CFB\u985E\u578B\u8A2D\u70BA ''{2}''\uFF0C\u4E14 '{'fixed'}' = true\u3002
- InvalidRegex = InvalidRegex: \u6A23\u5F0F\u503C ''{0}'' \u4E0D\u662F\u6709\u6548\u7684\u6B63\u898F\u8868\u793A\u5F0F\u3002\u5831\u544A\u7684\u932F\u8AA4: \u4F4D\u65BC\u8CC7\u6599\u6B04 ''{2}'' \u7684 ''{1}''\u3002
- MaxOccurLimit = \u5256\u6790\u5668\u76EE\u524D\u7684\u7D44\u614B\u4E0D\u5141\u8A31 maxOccurs \u5C6C\u6027\u503C\u8A2D\u70BA\u5927\u65BC\u503C {0}\u3002
- PublicSystemOnNotation = PublicSystemOnNotation: ''public'' \u8207 ''system'' \u81F3\u5C11\u5176\u4E2D\u4E4B\u4E00\u5FC5\u9808\u51FA\u73FE\u5728\u5143\u7D20 ''notation'' \u4E2D\u3002
- SchemaLocation = \u7B49\u65BC ''{0}'' \u7684 SchemaLocation: schemaLocation \u503C\u5FC5\u9808\u5177\u6709\u5076\u6578\u500B URI\u3002
- TargetNamespace.1 = TargetNamespace.1: \u9810\u671F\u547D\u540D\u7A7A\u9593 ''{0}''\uFF0C\u4F46\u662F\u7DB1\u8981\u6587\u4EF6\u7684\u76EE\u6A19\u547D\u540D\u7A7A\u9593\u70BA ''{1}''\u3002
- TargetNamespace.2 = TargetNamespace.2: \u672A\u9810\u671F\u547D\u540D\u7A7A\u9593\uFF0C\u4F46\u662F\u7DB1\u8981\u6587\u4EF6\u5177\u6709\u76EE\u6A19\u547D\u540D\u7A7A\u9593 ''{1}''\u3002
- UndeclaredEntity = UndeclaredEntity: \u672A\u5BA3\u544A\u5BE6\u9AD4 ''{0}''\u3002
- UndeclaredPrefix = UndeclaredPrefix: \u7121\u6CD5\u89E3\u6790 ''{0}'' \u70BA QName: \u672A\u5BA3\u544A\u524D\u7F6E\u78BC ''{1}''\u3002
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages.properties
deleted file mode 100644
index 13874ed..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages.properties
+++ /dev/null
@@ -1,32 +0,0 @@
-# This file stores error messages for the Xerces XML
-# serializer. Many DOM Load/Save error messages also
-# live here, since the serializer largely implements that package.
-#
-# As usual with properties files, the messages are arranged in
-# key/value tuples.
-#
-
- BadMessageKey = The error message corresponding to the message key can not be found.
- FormatFailed = An internal error occurred while formatting the following message:\n
-
- ArgumentIsNull = Argument ''{0}'' is null.
- NoWriterSupplied = No writer supplied for serializer.
- MethodNotSupported = The method ''{0}'' is not supported by this factory.
- ResetInMiddle = The serializer may not be reset in the middle of serialization.
- Internal = Internal error: element state is zero.
- NoName = There is no rawName and localName is null.
- ElementQName = The element name ''{0}'' is not a QName.
- ElementPrefix = Element ''{0}'' does not belong to any namespace: prefix could be undeclared or bound to some namespace.
- AttributeQName = The attribute name ''{0}'' is not a QName.
- AttributePrefix = Attribute ''{0}'' does not belong to any namespace: prefix could be undeclared or bound to some namespace.
- InvalidNSDecl = Namespace declaration syntax is incorrect: {0}.
- EndingCDATA = The character sequence \"]]>\" must not appear in content unless used to mark the end of a CDATA section.
- SplittingCDATA = Splitting a CDATA section containing the CDATA section termination marker \"]]>\".
- ResourceNotFound = The resource ''{0}'' could not be found.
- ResourceNotLoaded = The resource ''{0}'' could not be loaded. {1}
- SerializationStopped = Serialization stopped at user request.
-
- # DOM Level 3 load and save messages
- no-output-specified = no-output-specified: The output destination for data to be written to was null.
- unsupported-encoding = unsupported-encoding: An unsupported encoding is encountered.
- unable-to-serialize-node = unable-to-serialize-node: The node could not be serialized.
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_de.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_de.properties
deleted file mode 100644
index e8fa17e..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_de.properties
+++ /dev/null
@@ -1,32 +0,0 @@
-# This file stores error messages for the Xerces XML
-# serializer. Many DOM Load/Save error messages also
-# live here, since the serializer largely implements that package.
-#
-# As usual with properties files, the messages are arranged in
-# key/value tuples.
-#
-
- BadMessageKey = Die zum Meldungsschl\u00FCssel geh\u00F6rige Fehlermeldung kann nicht gefunden werden.
- FormatFailed = Beim Formatieren der folgenden Meldung ist ein interner Fehler aufgetreten:\n
-
- ArgumentIsNull = Argument "{0}" ist null.
- NoWriterSupplied = Kein Writer f\u00FCr Serializer angegeben.
- MethodNotSupported = Methode "{0}" wird von dieser Factory nicht unterst\u00FCtzt.
- ResetInMiddle = Serializer kann nicht w\u00E4hrend der Serialisierung zur\u00FCckgesetzt werden.
- Internal = Interner Fehler: Elementstatus ist null.
- NoName = Es ist kein rawName vorhanden, und localName ist null.
- ElementQName = Elementname "{0}" ist kein QName.
- ElementPrefix = Element "{0}" geh\u00F6rt zu keinem Namespace: Pr\u00E4fix ist m\u00F6glicherweise nicht deklariert oder an einen Namespace gebunden.
- AttributeQName = Attributname "{0}" ist kein QName.
- AttributePrefix = Attribut "{0}" geh\u00F6rt zu keinem Namespace: Pr\u00E4fix ist m\u00F6glicherweise nicht deklariert oder an einen Namespace gebunden.
- InvalidNSDecl = Namespace-Deklarationssyntax ist falsch: {0}.
- EndingCDATA = Zeichenfolge""]]>" darf nur im Content enthalten sein, wenn sie das Ende eines CDATA-Abschnitts markiert.
- SplittingCDATA = Teilen eines CDATA-Abschnitts mit dem CDATA-Abschnittsabschlusszeichen "]]>".
- ResourceNotFound = Ressource "{0}" konnte nicht gefunden werden.
- ResourceNotLoaded = Ressource "{0}" konnte nicht geladen werden. {1}
- SerializationStopped = Serialisierung auf Benutzeranforderung gestoppt.
-
- # DOM Level 3 load and save messages
- no-output-specified = no-output-specified: Ausgabeziel, in das Daten geschrieben werden sollten, war null.
- unsupported-encoding = unsupported-encoding: Nicht unterst\u00FCtzte Codierung gefunden.
- unable-to-serialize-node = unable-to-serialize-node: Knoten konnte nicht serialisiert werden.
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_es.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_es.properties
deleted file mode 100644
index a9609b9..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_es.properties
+++ /dev/null
@@ -1,32 +0,0 @@
-# This file stores error messages for the Xerces XML
-# serializer. Many DOM Load/Save error messages also
-# live here, since the serializer largely implements that package.
-#
-# As usual with properties files, the messages are arranged in
-# key/value tuples.
-#
-
- BadMessageKey = No se ha encontrado el mensaje de error que corresponde a la clave de mensaje.
- FormatFailed = Se ha producido un error interno al formatear el siguiente mensaje:\n
-
- ArgumentIsNull = El argumento ''{0}'' es nulo.
- NoWriterSupplied = No se ha suministrado ning\u00FAn escritor para el serializador.
- MethodNotSupported = El m\u00E9todo ''{0}'' no est\u00E1 soportado por esta f\u00E1brica.
- ResetInMiddle = No puede reiniciarse el serializador en medio de la serializaci\u00F3n.
- Internal = Error interno: el estado del elemento es cero.
- NoName = No hay ning\u00FAn rawName y localName es nulo.
- ElementQName = El nombre del elemento ''{0}'' no es un QName.
- ElementPrefix = El elemento ''{0}'' no pertenece a ning\u00FAn espacio de nombres: el prefijo puede ser no declarado o estar enlazado a alg\u00FAn espacio de nombres.
- AttributeQName = El nombre del atributo ''{0}'' no es un QName.
- AttributePrefix = El atributo ''{0}'' no pertenece a ning\u00FAn espacio de nombres: el prefijo puede ser no declarado o estar enlazado a alg\u00FAn espacio de nombres.
- InvalidNSDecl = La sintaxis de la declaraci\u00F3n de espacio de nombres no es correcta: {0}.
- EndingCDATA = La secuencia de caracteres "]]>" no debe aparecer en el contenido a menos que se utilice para marcar el final de una secci\u00F3n CDATA.
- SplittingCDATA = Divisi\u00F3n de una secci\u00F3n CDATA que contiene el marcador de terminaci\u00F3n de secci\u00F3n CDATA "]]>".
- ResourceNotFound = No se ha encontrado el recurso ''{0}''.
- ResourceNotLoaded = No se ha podido cargar el recurso ''{0}''. {1}
- SerializationStopped = La serializaci\u00F3n se ha parado a petici\u00F3n del usuario.
-
- # DOM Level 3 load and save messages
- no-output-specified = no-output-specified: El destino de salida en el que se deb\u00EDan escribir los datos era nulo.
- unsupported-encoding = unsupported-encoding: Se ha encontrado una codificaci\u00F3n no soportada.
- unable-to-serialize-node = unable-to-serialize-node: El nodo no se ha podido serializar.
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_fr.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_fr.properties
deleted file mode 100644
index e844267..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_fr.properties
+++ /dev/null
@@ -1,32 +0,0 @@
-# This file stores error messages for the Xerces XML
-# serializer. Many DOM Load/Save error messages also
-# live here, since the serializer largely implements that package.
-#
-# As usual with properties files, the messages are arranged in
-# key/value tuples.
-#
-
- BadMessageKey = Le message d'erreur correspondant \u00E0 la cl\u00E9 de message est introuvable.
- FormatFailed = Une erreur interne est survenue lors de la mise en forme du message suivant :\n
-
- ArgumentIsNull = L''argument ''{0}'' est NULL.
- NoWriterSupplied = Aucun processus d'\u00E9criture n'est fourni pour le serializer.
- MethodNotSupported = La m\u00E9thode ''{0}'' n''est pas prise en charge par cette fabrique.
- ResetInMiddle = Impossible de r\u00E9initialiser le serializer au cours de la s\u00E9rialisation.
- Internal = Erreur interne : l'\u00E9tat de l'\u00E9l\u00E9ment est z\u00E9ro.
- NoName = Il n'existe aucun \u00E9l\u00E9ment rawName et l'\u00E9l\u00E9ment localName est NULL.
- ElementQName = Le nom d''\u00E9l\u00E9ment ''{0}'' n''est pas un QName.
- ElementPrefix = L''\u00E9l\u00E9ment ''{0}'' n''appartient \u00E0 aucun espace de noms : le pr\u00E9fixe est peut-\u00EAtre non d\u00E9clar\u00E9 ou li\u00E9 \u00E0 un espace de noms.
- AttributeQName = Le nom d''attribut ''{0}'' n''est pas un QName.
- AttributePrefix = L''attribut ''{0}'' n''appartient \u00E0 aucun espace de noms : le pr\u00E9fixe est peut-\u00EAtre non d\u00E9clar\u00E9 ou li\u00E9 \u00E0 un espace de noms.
- InvalidNSDecl = La syntaxe de la d\u00E9claration d''espace de noms est incorrecte : {0}.
- EndingCDATA = La s\u00E9quence de caract\u00E8res "]]>" ne peut figurer dans le contenu que pour marquer la fin de la section CDATA.
- SplittingCDATA = Fractionnement d'une section CDATA contenant le marqueur de fin de section CDATA "]]>".
- ResourceNotFound = La ressource ''{0}'' est introuvable.
- ResourceNotLoaded = La ressource ''{0}'' n''a pas pu \u00EAtre charg\u00E9e. {1}
- SerializationStopped = La s\u00E9rialisation a \u00E9t\u00E9 arr\u00EAt\u00E9e \u00E0 la demande de l'utilisateur.
-
- # DOM Level 3 load and save messages
- no-output-specified = pas de sortie indiqu\u00E9e : la destination de sortie dans laquelle \u00E9crire les donn\u00E9es est NULL.
- unsupported-encoding = encodage non pris en charge : un encodage non pris en charge a \u00E9t\u00E9 d\u00E9tect\u00E9.
- unable-to-serialize-node = impossible de s\u00E9rialiser le noeud : le noeud n'a pas pu \u00EAtre s\u00E9rialis\u00E9.
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_it.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_it.properties
deleted file mode 100644
index 4a0a171..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_it.properties
+++ /dev/null
@@ -1,32 +0,0 @@
-# This file stores error messages for the Xerces XML
-# serializer. Many DOM Load/Save error messages also
-# live here, since the serializer largely implements that package.
-#
-# As usual with properties files, the messages are arranged in
-# key/value tuples.
-#
-
- BadMessageKey = Impossibile trovare il messaggio di errore corrispondente alla chiave di messaggio.
- FormatFailed = Si \u00E8 verificato un errore interno durante la formattazione del seguente messaggio:\n
-
- ArgumentIsNull = L''argomento ''{0}'' \u00E8 nullo.
- NoWriterSupplied = Nessun processo di scrittura fornito per il serializzatore.
- MethodNotSupported = Il metodo ''{0}'' non \u00E8 supportato da questo factory.
- ResetInMiddle = Impossibile reimpostare il serializzatore durante una serializzazione.
- Internal = Errore interno: lo stato dell'elemento \u00E8 zero.
- NoName = Non esiste alcun rawName e localName \u00E8 nullo.
- ElementQName = Il nome elemento ''{0}'' non \u00E8 un QName.
- ElementPrefix = L''elemento ''{0}'' non appartiene ad alcuno spazio di nomi: il prefisso deve essere non dichiarato o associato a uno spazio di nomi.
- AttributeQName = Il nome attributo ''{0}'' non \u00E8 un QName.
- AttributePrefix = L''attributo ''{0}'' non appartiene ad alcuno spazio di nomi: il prefisso deve essere non dichiarato o associato a uno spazio di nomi.
- InvalidNSDecl = La sintassi della dichiarazione dello spazio di nomi \u00E8 errata: {0}.
- EndingCDATA = La sequenza di caratteri "]]>" non deve essere presente nel contenuto a meno che non sia utilizzata per contrassegnare la fine di una sezione CDATA.
- SplittingCDATA = Verr\u00E0 suddivisa una sezione CDATA che contiene l'indicatore di fine della sezione CDATA "]]>".
- ResourceNotFound = Impossibile trovare la risorsa ''{0}''.
- ResourceNotLoaded = Impossibile caricare la risorsa ''{0}''. {1}
- SerializationStopped = Serializzazione arrestata su richiesta dell'utente.
-
- # DOM Level 3 load and save messages
- no-output-specified = no-output-specified: la destinazione di output per i dati da scrivere \u00E8 nulla.
- unsupported-encoding = unsupported-encoding: \u00E8 stata rilevata una codifica non supportata.
- unable-to-serialize-node = unable-to-serialize-node: impossibile serializzare il nodo.
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_ja.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_ja.properties
deleted file mode 100644
index 59658c6..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_ja.properties
+++ /dev/null
@@ -1,32 +0,0 @@
-# This file stores error messages for the Xerces XML
-# serializer. Many DOM Load/Save error messages also
-# live here, since the serializer largely implements that package.
-#
-# As usual with properties files, the messages are arranged in
-# key/value tuples.
-#
-
- BadMessageKey = \u30E1\u30C3\u30BB\u30FC\u30B8\u30FB\u30AD\u30FC\u306B\u5BFE\u5FDC\u3059\u308B\u30A8\u30E9\u30FC\u30FB\u30E1\u30C3\u30BB\u30FC\u30B8\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002
- FormatFailed = \u6B21\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\u306E\u66F8\u5F0F\u8A2D\u5B9A\u4E2D\u306B\u5185\u90E8\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F:\n
-
- ArgumentIsNull = \u5F15\u6570''{0}''\u306Fnull\u3067\u3059\u3002
- NoWriterSupplied = \u30B7\u30EA\u30A2\u30E9\u30A4\u30B6\u306B\u30E9\u30A4\u30BF\u30FC\u304C\u63D0\u4F9B\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
- MethodNotSupported = \u3053\u306E\u30D5\u30A1\u30AF\u30C8\u30EA\u3067\u306F\u3001\u30E1\u30BD\u30C3\u30C9''{0}''\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
- ResetInMiddle = \u30B7\u30EA\u30A2\u30E9\u30A4\u30B6\u306F\u3001\u30B7\u30EA\u30A2\u30E9\u30A4\u30BA\u306E\u9014\u4E2D\u3067\u306F\u30EA\u30BB\u30C3\u30C8\u3067\u304D\u307E\u305B\u3093\u3002
- Internal = \u5185\u90E8\u30A8\u30E9\u30FC: \u8981\u7D20\u306E\u72B6\u614B\u304C\u30BC\u30ED\u3067\u3059\u3002
- NoName = rawName\u304C\u5B58\u5728\u305B\u305A\u3001localName\u304Cnull\u3067\u3059\u3002
- ElementQName = \u8981\u7D20\u540D''{0}''\u306FQName\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
- ElementPrefix = \u8981\u7D20''{0}''\u304C\u3069\u306E\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u306B\u3082\u5C5E\u3057\u3066\u3044\u307E\u305B\u3093\u3002\u63A5\u982D\u8F9E\u304C\u5BA3\u8A00\u3055\u308C\u3066\u3044\u306A\u3044\u304B\u3001\u306A\u3093\u3089\u304B\u306E\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u306B\u30D0\u30A4\u30F3\u30C9\u3055\u308C\u3066\u3044\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002
- AttributeQName = \u5C5E\u6027\u540D''{0}''\u306FQName\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
- AttributePrefix = \u5C5E\u6027''{0}''\u304C\u3069\u306E\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u306B\u3082\u5C5E\u3057\u3066\u3044\u307E\u305B\u3093\u3002\u63A5\u982D\u8F9E\u304C\u5BA3\u8A00\u3055\u308C\u3066\u3044\u306A\u3044\u304B\u3001\u306A\u3093\u3089\u304B\u306E\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u306B\u30D0\u30A4\u30F3\u30C9\u3055\u308C\u3066\u3044\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002
- InvalidNSDecl = \u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u5BA3\u8A00\u306E\u69CB\u6587\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093: {0}\u3002
- EndingCDATA = \u6587\u5B57\u30B7\u30FC\u30B1\u30F3\u30B9"]]>"\u306F\u3001CDATA\u30BB\u30AF\u30B7\u30E7\u30F3\u306E\u7D42\u308F\u308A\u3092\u793A\u3059\u76EE\u7684\u4EE5\u5916\u3067\u30B3\u30F3\u30C6\u30F3\u30C4\u306B\u4F7F\u7528\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002
- SplittingCDATA = CDATA\u30BB\u30AF\u30B7\u30E7\u30F3\u7D42\u4E86\u30DE\u30FC\u30AB\u30FC"]]>"\u304C\u542B\u307E\u308C\u3066\u3044\u308BCDATA\u30BB\u30AF\u30B7\u30E7\u30F3\u3092\u5206\u5272\u3057\u3066\u3044\u307E\u3059\u3002
- ResourceNotFound = \u30EA\u30BD\u30FC\u30B9''{0}''\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002
- ResourceNotLoaded = \u30EA\u30BD\u30FC\u30B9''{0}''\u3092\u30ED\u30FC\u30C9\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002 {1}
- SerializationStopped = \u30B7\u30EA\u30A2\u30E9\u30A4\u30BA\u304C\u30E6\u30FC\u30B6\u30FC\u30FB\u30EA\u30AF\u30A8\u30B9\u30C8\u3067\u505C\u6B62\u3055\u308C\u307E\u3057\u305F\u3002
-
- # DOM Level 3 load and save messages
- no-output-specified = no-output-specified: \u66F8\u304D\u8FBC\u307E\u308C\u308B\u30C7\u30FC\u30BF\u306E\u51FA\u529B\u5148\u304Cnull\u306B\u306A\u3063\u3066\u3044\u307E\u3059\u3002
- unsupported-encoding = unsupported-encoding: \u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u306A\u3044\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002
- unable-to-serialize-node = unable-to-serialize-node: \u30CE\u30FC\u30C9\u3092\u30B7\u30EA\u30A2\u30E9\u30A4\u30BA\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_ko.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_ko.properties
deleted file mode 100644
index 0da72ed..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_ko.properties
+++ /dev/null
@@ -1,32 +0,0 @@
-# This file stores error messages for the Xerces XML
-# serializer. Many DOM Load/Save error messages also
-# live here, since the serializer largely implements that package.
-#
-# As usual with properties files, the messages are arranged in
-# key/value tuples.
-#
-
- BadMessageKey = \uBA54\uC2DC\uC9C0 \uD0A4\uC5D0 \uD574\uB2F9\uD558\uB294 \uC624\uB958 \uBA54\uC2DC\uC9C0\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
- FormatFailed = \uB2E4\uC74C \uBA54\uC2DC\uC9C0\uC758 \uD615\uC2DD\uC744 \uC9C0\uC815\uD558\uB294 \uC911 \uB0B4\uBD80 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4.\n
-
- ArgumentIsNull = ''{0}'' \uC778\uC218\uAC00 \uB110\uC785\uB2C8\uB2E4.
- NoWriterSupplied = Serializer\uC5D0 \uB300\uD574 \uC81C\uACF5\uB41C \uAE30\uB85D \uC7A5\uCE58\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.
- MethodNotSupported = \uC774 \uD329\uD1A0\uB9AC\uB294 ''{0}'' \uBA54\uC18C\uB4DC\uB97C \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
- ResetInMiddle = \uC9C1\uB82C\uD654 \uB3C4\uC911\uC5D0\uB294 Serializer\uB97C \uC7AC\uC124\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
- Internal = \uB0B4\uBD80 \uC624\uB958: \uC694\uC18C \uC0C1\uD0DC\uAC00 0\uC785\uB2C8\uB2E4.
- NoName = rawName\uC774 \uC5C6\uC73C\uBA70 localName\uC774 \uB110\uC785\uB2C8\uB2E4.
- ElementQName = \uC694\uC18C \uC774\uB984 ''{0}''\uC740(\uB294) QName\uC774 \uC544\uB2D9\uB2C8\uB2E4.
- ElementPrefix = ''{0}'' \uC694\uC18C\uAC00 \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uC5D0 \uC18D\uD558\uC9C0 \uC54A\uC74C: \uC811\uB450\uC5B4\uC758 \uC120\uC5B8\uC744 \uD574\uC81C\uD558\uAC70\uB098 \uC811\uB450\uC5B4\uB97C \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uC5D0 \uBC14\uC778\uB4DC\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.
- AttributeQName = \uC18D\uC131 \uC774\uB984 ''{0}''\uC740(\uB294) QName\uC774 \uC544\uB2D9\uB2C8\uB2E4.
- AttributePrefix = ''{0}'' \uC18D\uC131\uC774 \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uC5D0 \uC18D\uD558\uC9C0 \uC54A\uC74C: \uC811\uB450\uC5B4\uC758 \uC120\uC5B8\uC744 \uD574\uC81C\uD558\uAC70\uB098 \uC811\uB450\uC5B4\uB97C \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uC5D0 \uBC14\uC778\uB4DC\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.
- InvalidNSDecl = \uB124\uC784\uC2A4\uD398\uC774\uC2A4 \uC120\uC5B8 \uAD6C\uBB38\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC74C: {0}.
- EndingCDATA = \uBB38\uC790 \uC2DC\uD000\uC2A4 "]]>"\uB294 CDATA \uC139\uC158 \uB05D\uC744 \uD45C\uC2DC\uD558\uB294 \uB370 \uC0AC\uC6A9\uB418\uC9C0 \uC54A\uB294 \uACBD\uC6B0 \uCF58\uD150\uCE20\uC5D0 \uB098\uD0C0\uB098\uC9C0 \uC54A\uC544\uC57C \uD569\uB2C8\uB2E4.
- SplittingCDATA = CDATA \uC139\uC158 \uC885\uB8CC \uD45C\uC2DC\uC790 "]]>"\uB97C \uD3EC\uD568\uD558\uB294 CDATA \uC139\uC158\uC744 \uBD84\uD560\uD558\uB294 \uC911\uC785\uB2C8\uB2E4.
- ResourceNotFound = ''{0}'' \uB9AC\uC18C\uC2A4\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
- ResourceNotLoaded = ''{0}'' \uB9AC\uC18C\uC2A4\uB97C \uB85C\uB4DC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. {1}
- SerializationStopped = \uC0AC\uC6A9\uC790 \uC694\uCCAD\uC5D0 \uB530\uB77C \uC9C1\uB82C\uD654\uAC00 \uC815\uC9C0\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
-
- # DOM Level 3 load and save messages
- no-output-specified = no-output-specified: \uB370\uC774\uD130\uB97C \uC4F8 \uCD9C\uB825 \uB300\uC0C1\uC774 \uB110\uC785\uB2C8\uB2E4.
- unsupported-encoding = unsupported-encoding: \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uB294 \uC778\uCF54\uB529\uC774 \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
- unable-to-serialize-node = unable-to-serialize-node: \uB178\uB4DC\uB97C \uC9C1\uB82C\uD654\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_pt_BR.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_pt_BR.properties
deleted file mode 100644
index 773ce38..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_pt_BR.properties
+++ /dev/null
@@ -1,32 +0,0 @@
-# This file stores error messages for the Xerces XML
-# serializer. Many DOM Load/Save error messages also
-# live here, since the serializer largely implements that package.
-#
-# As usual with properties files, the messages are arranged in
-# key/value tuples.
-#
-
- BadMessageKey = N\u00E3o foi poss\u00EDvel encontrar a mensagem de erro correspondente \u00E0 chave da mensagem.
- FormatFailed = Ocorreu um erro interno ao formatar a mensagem a seguir:\n
-
- ArgumentIsNull = O argumento ''{0}'' \u00E9 nulo.
- NoWriterSupplied = Nenhum gravador fornecido para o serializador.
- MethodNotSupported = O m\u00E9todo ''{0}'' n\u00E3o \u00E9 suportado por este factory.
- ResetInMiddle = O serializador n\u00E3o pode ser redefinido no meio da serializa\u00E7\u00E3o.
- Internal = Erro interno: o estado do elemento \u00E9 zero.
- NoName = N\u00E3o h\u00E1 rawName e localName \u00E9 nulo.
- ElementQName = O nome do elemento ''{0}'' n\u00E3o \u00E9 um QName.
- ElementPrefix = O elemento ''{0}'' n\u00E3o pertence a nenhum namespace: o prefixo n\u00E3o pode ser n\u00E3o declarado ou vinculado a algum namespace.
- AttributeQName = O nome do atributo ''{0}'' n\u00E3o \u00E9 QName.
- AttributePrefix = O atributo ''{0}'' n\u00E3o pertence a nenhum namespace: o prefixo n\u00E3o pode ser n\u00E3o declarado ou vinculado a algum namespace.
- InvalidNSDecl = Sintaxe de declara\u00E7\u00E3o de namespace incorreta: {0}.
- EndingCDATA = A sequ\u00EAncia de caracteres "]]>" n\u00E3o deve aparecer no conte\u00FAdo, a menos que seja usada para marcar o fim de uma se\u00E7\u00E3o CDATA.
- SplittingCDATA = Dividir uma se\u00E7\u00E3o CDATA que cont\u00E9m o marcador "]]>" de termina\u00E7\u00E3o de se\u00E7\u00E3o CDATA.
- ResourceNotFound = N\u00E3o foi poss\u00EDvel encontrar o recurso ''{0}''.
- ResourceNotLoaded = N\u00E3o foi poss\u00EDvel carregar o recurso ''{0}''. {1}
- SerializationStopped = Serializa\u00E7\u00E3o interrompida na solicita\u00E7\u00E3o do usu\u00E1rio.
-
- # DOM Level 3 load and save messages
- no-output-specified = nenhuma sa\u00EDda especificada: O destino da sa\u00EDda dos dados a serem gravados era nulo.
- unsupported-encoding = codifica\u00E7\u00E3o n\u00E3o suportada: Uma codifica\u00E7\u00E3o n\u00E3o suportada foi encontrada.
- unable-to-serialize-node = n\u00E3o \u00E9 poss\u00EDvel serializar o n\u00F3: N\u00E3o foi poss\u00EDvel serializar o n\u00F3.
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_sv.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_sv.properties
deleted file mode 100644
index d35c17d..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_sv.properties
+++ /dev/null
@@ -1,32 +0,0 @@
-# This file stores error messages for the Xerces XML
-# serializer. Many DOM Load/Save error messages also
-# live here, since the serializer largely implements that package.
-#
-# As usual with properties files, the messages are arranged in
-# key/value tuples.
-#
-
- BadMessageKey = Hittar inte felmeddelandet som motsvarar meddelandenyckeln.
- FormatFailed = Ett internt fel intr\u00E4ffade vid formatering av f\u00F6ljande meddelande:\n
-
- ArgumentIsNull = Argumentet ''{0}'' \u00E4r null.
- NoWriterSupplied = Det finns ingen skrivare f\u00F6r serializer.
- MethodNotSupported = Metoden ''{0}'' st\u00F6ds inte i denna fabriksinst\u00E4llning.
- ResetInMiddle = Serializer kan inte \u00E5terst\u00E4llas under p\u00E5g\u00E5ende serialisering.
- Internal = Internt fel: elementtillst\u00E5nd \u00E4r noll.
- NoName = Det finns inget rawName och localName \u00E4r null.
- ElementQName = Elementnamnet ''{0}'' \u00E4r inte n\u00E5got QName.
- ElementPrefix = Elementet ''{0}'' tillh\u00F6r inte n\u00E5gon namnrymd: prefixet kanske inte har deklarerats eller \u00E4r bundet till annan namnrymd.
- AttributeQName = Attributnamnet ''{0}'' \u00E4r inte n\u00E5got QName.
- AttributePrefix = Attributet ''{0}'' tillh\u00F6r inte n\u00E5gon namnrymd: prefixet kanske inte har deklarerats eller \u00E4r bundet till annan namnrymd.
- InvalidNSDecl = Felaktig syntax i deklaration av namnrymd: {0}.
- EndingCDATA = Teckensekvensen "]]>" f\u00E5r inte f\u00F6rekomma i inneh\u00E5llet, s\u00E5vida det inte anv\u00E4nds f\u00F6r att markera slut av CDATA-sektion.
- SplittingCDATA = Delar en CDATA-sektion som inneh\u00E5ller CDATA-sektionens avslutningsmark\u00F6r "]]>".
- ResourceNotFound = Resursen ''{0}'' hittades inte.
- ResourceNotLoaded = Resursen ''{0}'' kunde inte laddas. {1}
- SerializationStopped = Serialiseringen stoppades vid anv\u00E4ndarbeg\u00E4ran.
-
- # DOM Level 3 load and save messages
- no-output-specified = no-output-specified: Utdatadestinationen som data ska skrivas till \u00E4r null.
- unsupported-encoding = unsupported-encoding: En kodning som inte st\u00F6ds p\u00E5tr\u00E4ffades.
- unable-to-serialize-node = unable-to-serialize-node: Noden kunde inte serialiseras.
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_zh_CN.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_zh_CN.properties
deleted file mode 100644
index 3a75f66..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_zh_CN.properties
+++ /dev/null
@@ -1,32 +0,0 @@
-# This file stores error messages for the Xerces XML
-# serializer. Many DOM Load/Save error messages also
-# live here, since the serializer largely implements that package.
-#
-# As usual with properties files, the messages are arranged in
-# key/value tuples.
-#
-
- BadMessageKey = \u627E\u4E0D\u5230\u4E0E\u6D88\u606F\u5173\u952E\u5B57\u5BF9\u5E94\u7684\u9519\u8BEF\u6D88\u606F\u3002
- FormatFailed = \u8BBE\u7F6E\u4EE5\u4E0B\u6D88\u606F\u7684\u683C\u5F0F\u65F6\u51FA\u73B0\u5185\u90E8\u9519\u8BEF:\n
-
- ArgumentIsNull = \u53C2\u6570 ''{0}'' \u4E3A\u7A7A\u503C\u3002
- NoWriterSupplied = \u6CA1\u6709\u4E3A\u4E32\u884C\u5668\u63D0\u4F9B\u5199\u8FDB\u7A0B\u3002
- MethodNotSupported = \u6B64\u5DE5\u5382\u4E0D\u652F\u6301\u65B9\u6CD5 ''{0}''\u3002
- ResetInMiddle = \u4E0D\u80FD\u5728\u5E8F\u5217\u5316\u7684\u8FC7\u7A0B\u4E2D\u91CD\u7F6E\u4E32\u884C\u5668\u3002
- Internal = \u5185\u90E8\u9519\u8BEF: \u5143\u7D20\u72B6\u6001\u4E3A\u96F6\u3002
- NoName = \u6CA1\u6709 rawName \u548C localName \u4E3A\u7A7A\u503C\u3002
- ElementQName = \u5143\u7D20\u540D\u79F0 ''{0}'' \u4E0D\u662F\u9650\u5B9A\u540D\u3002
- ElementPrefix = \u5143\u7D20 ''{0}'' \u4E0D\u5C5E\u4E8E\u4EFB\u4F55\u540D\u79F0\u7A7A\u95F4: \u53EF\u80FD\u672A\u58F0\u660E\u524D\u7F00, \u6216\u8005\u5DF2\u7ECF\u5C06\u524D\u7F00\u7ED1\u5B9A\u5230\u67D0\u4E2A\u540D\u79F0\u7A7A\u95F4\u3002
- AttributeQName = \u5C5E\u6027\u540D ''{0}'' \u4E0D\u662F\u9650\u5B9A\u540D\u3002
- AttributePrefix = \u5C5E\u6027 ''{0}'' \u4E0D\u5C5E\u4E8E\u4EFB\u4F55\u540D\u79F0\u7A7A\u95F4: \u53EF\u80FD\u672A\u58F0\u660E\u524D\u7F00, \u6216\u8005\u5DF2\u7ECF\u5C06\u524D\u7F00\u7ED1\u5B9A\u5230\u67D0\u4E2A\u540D\u79F0\u7A7A\u95F4\u3002
- InvalidNSDecl = \u540D\u79F0\u7A7A\u95F4\u58F0\u660E\u8BED\u6CD5\u4E0D\u6B63\u786E: {0}\u3002
- EndingCDATA = \u9664\u975E\u4F7F\u7528\u5B57\u7B26\u5E8F\u5217 "]]>" \u6765\u6807\u8BB0 CDATA \u8282\u7684\u7ED3\u5C3E, \u5426\u5219\u8BE5\u5B57\u7B26\u5E8F\u5217\u4E0D\u80FD\u51FA\u73B0\u5728\u5185\u5BB9\u4E2D\u3002
- SplittingCDATA = \u62C6\u5206\u5305\u542B CDATA \u6BB5\u7EC8\u6B62\u6807\u8BB0 "]]>" \u7684 CDATA \u6BB5\u3002
- ResourceNotFound = \u627E\u4E0D\u5230\u8D44\u6E90 ''{0}''\u3002
- ResourceNotLoaded = \u65E0\u6CD5\u52A0\u8F7D\u8D44\u6E90 ''{0}''\u3002{1}
- SerializationStopped = \u6839\u636E\u7528\u6237\u8BF7\u6C42\u505C\u6B62\u4E86\u5E8F\u5217\u5316\u3002
-
- # DOM Level 3 load and save messages
- no-output-specified = no-output-specified: \u8981\u5C06\u6570\u636E\u5199\u5165\u7684\u8F93\u51FA\u76EE\u6807\u4E3A\u7A7A\u503C\u3002
- unsupported-encoding = unsupported-encoding: \u9047\u5230\u4E0D\u652F\u6301\u7684\u7F16\u7801\u3002
- unable-to-serialize-node = unable-to-serialize-node: \u65E0\u6CD5\u5E8F\u5217\u5316\u8282\u70B9\u3002
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_zh_TW.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_zh_TW.properties
deleted file mode 100644
index 34c1615..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_zh_TW.properties
+++ /dev/null
@@ -1,32 +0,0 @@
-# This file stores error messages for the Xerces XML
-# serializer. Many DOM Load/Save error messages also
-# live here, since the serializer largely implements that package.
-#
-# As usual with properties files, the messages are arranged in
-# key/value tuples.
-#
-
- BadMessageKey = \u627E\u4E0D\u5230\u5C0D\u61C9\u8A0A\u606F\u7D22\u5F15\u9375\u7684\u932F\u8AA4\u8A0A\u606F\u3002
- FormatFailed = \u683C\u5F0F\u5316\u4E0B\u5217\u8A0A\u606F\u6642\u767C\u751F\u5167\u90E8\u932F\u8AA4:\n
-
- ArgumentIsNull = \u5F15\u6578 ''{0}'' \u70BA\u7A7A\u503C\u3002
- NoWriterSupplied = \u672A\u63D0\u4F9B\u5BEB\u5165\u5668\u7D66\u5E8F\u5217\u5316\u7A0B\u5F0F\u3002
- MethodNotSupported = \u6B64\u8655\u7406\u7AD9\u4E0D\u652F\u63F4\u65B9\u6CD5 ''{0}''\u3002
- ResetInMiddle = \u5728\u5E8F\u5217\u5316\u671F\u9593\u53EF\u80FD\u7121\u6CD5\u91CD\u8A2D\u5E8F\u5217\u5316\u7A0B\u5F0F\u3002
- Internal = \u5167\u90E8\u932F\u8AA4: \u5143\u7D20\u72C0\u614B\u70BA\u96F6\u3002
- NoName = \u6C92\u6709 rawName \u4E14 localName \u70BA\u7A7A\u503C\u3002
- ElementQName = \u5143\u7D20\u540D\u7A31 ''{0}'' \u4E0D\u662F QName\u3002
- ElementPrefix = \u5143\u7D20 ''{0}'' \u4E0D\u5C6C\u65BC\u4EFB\u4F55\u547D\u540D\u7A7A\u9593: \u53EF\u80FD\u672A\u5BA3\u544A\u524D\u7F6E\u78BC\u6216\u524D\u7F6E\u78BC\u9023\u7D50\u5176\u4ED6\u547D\u540D\u7A7A\u9593\u3002
- AttributeQName = \u5C6C\u6027\u540D\u7A31 ''{0}'' \u4E0D\u662F QName\u3002
- AttributePrefix = \u5C6C\u6027 ''{0}'' \u4E0D\u5C6C\u65BC\u4EFB\u4F55\u547D\u540D\u7A7A\u9593: \u53EF\u80FD\u672A\u5BA3\u544A\u524D\u7F6E\u78BC\u6216\u524D\u7F6E\u78BC\u9023\u7D50\u5176\u4ED6\u547D\u540D\u7A7A\u9593\u3002
- InvalidNSDecl = \u547D\u540D\u7A7A\u9593\u5BA3\u544A\u8A9E\u6CD5\u4E0D\u6B63\u78BA: {0}\u3002
- EndingCDATA = \u5B57\u5143\u9806\u5E8F "]]>" \u4E0D\u53EF\u51FA\u73FE\u5728\u5167\u5BB9\u4E2D\uFF0C\u9664\u975E\u7528\u65BC\u6A19\u793A CDATA \u6BB5\u843D\u7684\u7D50\u5C3E\u3002
- SplittingCDATA = \u5206\u5272\u5305\u542B CDATA \u6BB5\u843D\u7D42\u6B62\u6A19\u8A18 "]]>" \u7684 CDATA \u6BB5\u843D\u3002
- ResourceNotFound = \u627E\u4E0D\u5230\u8CC7\u6E90 ''{0}''\u3002
- ResourceNotLoaded = \u7121\u6CD5\u8F09\u5165\u8CC7\u6E90 ''{0}''\u3002{1}
- SerializationStopped = \u4F9D\u7167\u4F7F\u7528\u8005\u8981\u6C42\u505C\u6B62\u5E8F\u5217\u5316\u3002
-
- # DOM Level 3 load and save messages
- no-output-specified = no-output-specified: \u8981\u5BEB\u5165\u8CC7\u6599\u7684\u8F38\u51FA\u76EE\u7684\u5730\u70BA\u7A7A\u503C\u3002
- unsupported-encoding = unsupported-encoding: \u51FA\u73FE\u4E0D\u652F\u63F4\u7684\u7DE8\u78BC\u3002
- unable-to-serialize-node = unable-to-serialize-node: \u7BC0\u9EDE\u7121\u6CD5\u5E8F\u5217\u5316\u3002
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages.properties
deleted file mode 100644
index ebe4878..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-# This file stores localized messages for the Xerces XPointer implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-# Messages for message reporting
-BadMessageKey = The error message corresponding to the message key can not be found.
-FormatFailed = An internal error occurred while formatting the following message:\n
-
-# XPointer Framework Error Messages
-XPointerProcessingError = XPointerProcessingError: An error occurred while processing the XPointer expression.
-InvalidXPointerToken = InvalidXPointerToken: The XPointer expression contains the invalid token ''{0}''
-InvalidXPointerExpression = InvalidXPointerExpression: The XPointer expression ''{0}'' is invalid.
-MultipleShortHandPointers = MultipleShortHandPointers: The XPointer expression ''{0}'' is invalid. It has more than one ShortHand Pointer.
-SchemeDataNotFollowedByCloseParenthesis = SchemeDataNotFollowedByCloseParenthesis: The XPointer expression ''{0}'' is invalid. The SchemeData was not followed by a '')'' character.
-SchemeUnsupported = SchemeUnsupported: The XPointer scheme ''{0}'' is not supported.
-InvalidShortHandPointer = InvalidShortHandPointer: The NCName of the ShortHand Pointer ''{0}'' is invalid.
-UnbalancedParenthesisInXPointerExpression = UnbalancedParenthesisInXPointerExpression: The XPointer expression ''{0}'' is invalid. The number of open parenthesis ''{1}'' is not equal to the number of close parenthesis ''{2}''.
-InvalidSchemeDataInXPointer = InvalidSchemeDataInXPointer: The XPointer expression ''{0}'' contains invalid SchemeData.
-
-# XPointer Element Scheme Error Messages
-InvalidElementSchemeToken = InvalidElementSchemeToken: The element() scheme XPointer expression contains the invalid token ''{0}''
-InvalidElementSchemeXPointer = InvalidElementSchemeXPointer: The Element Scheme XPointer expression ''{0}'' is invalid.
-XPointerElementSchemeProcessingError = XPointerElementSchemeProcessingError: An error occurred while processing the XPointer element() Scheme expression.
-InvalidNCNameInElementSchemeData = InvalidNCNameInElementSchemeData: The element() Scheme contains a ShortHand Pointer ''{0}'' with an invalid NCName.
-InvalidChildSequenceCharacter = InvalidChildSequenceCharacter: The element() Scheme contains an invalid child sequence character ''{0}''.
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_de.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_de.properties
deleted file mode 100644
index a56717f..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_de.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-# This file stores localized messages for the Xerces XPointer implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-# Messages for message reporting
-BadMessageKey = Die zum Meldungsschl\u00FCssel geh\u00F6rige Fehlermeldung kann nicht gefunden werden.
-FormatFailed = Beim Formatieren der folgenden Meldung ist ein interner Fehler aufgetreten:\n
-
-# XPointer Framework Error Messages
-XPointerProcessingError = XPointerProcessingError: Beim Verarbeiten des XPointer-Ausdrucks ist ein Fehler aufgetreten.
-InvalidXPointerToken = InvalidXPointerToken: XPointer-Ausdruck enth\u00E4lt das ung\u00FCltige Token "{0}"
-InvalidXPointerExpression = InvalidXPointerExpression: XPointer-Ausdruck "{0}" ist ung\u00FCltig.
-MultipleShortHandPointers = MultipleShortHandPointers: XPointer-Ausdruck "{0}" ist ung\u00FCltig. Mehrere ShortHand-Zeiger vorhanden.
-SchemeDataNotFollowedByCloseParenthesis = SchemeDataNotFollowedByCloseParenthesis: XPointer-Ausdruck "{0}" ist ung\u00FCltig. Auf SchemeData folgte kein ")"-Zeichen.
-SchemeUnsupported = SchemeUnsupported: XPointer-Schema "{0}" wird nicht unterst\u00FCtzt.
-InvalidShortHandPointer = InvalidShortHandPointer: NCName von ShortHand-Zeiger "{0}" ist ung\u00FCltig.
-UnbalancedParenthesisInXPointerExpression = UnbalancedParenthesisInXPointerExpression: XPointer-Ausdruck "{0}" ist ung\u00FCltig. Die Anzahl der \u00F6ffnenden Klammern "{1}" entspricht nicht der Anzahl der schlie\u00DFenden Klammern "{2}".
-InvalidSchemeDataInXPointer = InvalidSchemeDataInXPointer: XPointer-Ausdruck "{0}" enthalt ung\u00FCltige SchemeData.
-
-# XPointer Element Scheme Error Messages
-InvalidElementSchemeToken = InvalidElementSchemeToken: element()-Schema-XPointer-Ausdruck enth\u00E4lt das ung\u00FCltige Token "{0}"
-InvalidElementSchemeXPointer = InvalidElementSchemeXPointer: Elementschema-XPointer-Ausdruck "{0}" ist ung\u00FCltig.
-XPointerElementSchemeProcessingError = XPointerElementSchemeProcessingError: Beim Verarbeiten des XPointer-element()-Schemaausdrucks ist ein Fehler aufgetreten.
-InvalidNCNameInElementSchemeData = InvalidNCNameInElementSchemeData: element()-Schema enth\u00E4lt einen ShortHand-Zeiger "{0}" mit einem ung\u00FCltigen NCName.
-InvalidChildSequenceCharacter = InvalidChildSequenceCharacter: element()-Schema enth\u00E4lt ein untergeordnetes Sequenzzeichen "{0}".
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_es.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_es.properties
deleted file mode 100644
index e770fdc..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_es.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-# This file stores localized messages for the Xerces XPointer implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-# Messages for message reporting
-BadMessageKey = No se ha encontrado el mensaje de error que corresponde a la clave de mensaje.
-FormatFailed = Se ha producido un error interno al formatear el siguiente mensaje:\n
-
-# XPointer Framework Error Messages
-XPointerProcessingError = XPointerProcessingError: Se ha producido un error al procesar la expresi\u00F3n XPointer.
-InvalidXPointerToken = InvalidXPointerToken: La expresi\u00F3n XPointer contiene el token no v\u00E1lido ''{0}''
-InvalidXPointerExpression = InvalidXPointerExpression: La expresi\u00F3n XPointer ''{0}'' no es v\u00E1lida.
-MultipleShortHandPointers = MultipleShortHandPointers: La expresi\u00F3n XPointer ''{0}'' no es v\u00E1lida. Tiene m\u00E1s de un puntero abreviado.
-SchemeDataNotFollowedByCloseParenthesis = SchemeDataNotFollowedByCloseParenthesis: La expresi\u00F3n XPointer ''{0}'' no es v\u00E1lida. SchemeData no viene seguido de un car\u00E1cter '')''.
-SchemeUnsupported = SchemeUnsupported: El esquema XPointer ''{0}'' no est\u00E1 soportado.
-InvalidShortHandPointer = InvalidShortHandPointer: El valor de NCName del puntero abreviado ''{0}'' no es v\u00E1lido.
-UnbalancedParenthesisInXPointerExpression = UnbalancedParenthesisInXPointerExpression: La expresi\u00F3n XPointer ''{0}'' no es v\u00E1lida. El n\u00FAmero de par\u00E9ntesis de apertura ''{1}'' no es igual al n\u00FAmero de par\u00E9ntesis de cierre ''{2}''.
-InvalidSchemeDataInXPointer = InvalidSchemeDataInXPointer: La expresi\u00F3n XPointer ''{0}'' contiene un valor de SchemeData no v\u00E1lido.
-
-# XPointer Element Scheme Error Messages
-InvalidElementSchemeToken = InvalidElementSchemeToken: La expresi\u00F3n XPointer del esquema de element() contiene el token no v\u00E1lido ''{0}''
-InvalidElementSchemeXPointer = InvalidElementSchemeXPointer: La expresi\u00F3n XPointer del esquema de elemento ''{0}'' no es v\u00E1lida.
-XPointerElementSchemeProcessingError = XPointerElementSchemeProcessingError: Se ha producido un error al procesar la expresi\u00F3n de esquema XPointer element().
-InvalidNCNameInElementSchemeData = InvalidNCNameInElementSchemeData: El esquema element() contiene un puntero abreviado ''{0}'' con un valor de NCName no v\u00E1lido.
-InvalidChildSequenceCharacter = InvalidChildSequenceCharacter: El esquema element() contiene un car\u00E1cter de secuencia secundaria no v\u00E1lido ''{0}''.
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_fr.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_fr.properties
deleted file mode 100644
index d2d9338..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_fr.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-# This file stores localized messages for the Xerces XPointer implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-# Messages for message reporting
-BadMessageKey = Le message d'erreur correspondant \u00E0 la cl\u00E9 de message est introuvable.
-FormatFailed = Une erreur interne est survenue lors de la mise en forme du message suivant :\n
-
-# XPointer Framework Error Messages
-XPointerProcessingError = XPointerProcessingError : une erreur est survenue lors du traitement de l'expression XPointer.
-InvalidXPointerToken = InvalidXPointerToken : l''expression XPointer contient le jeton non valide ''{0}''
-InvalidXPointerExpression = InvalidXPointerExpression : l''expression XPointer ''{0}'' n''est pas valide.
-MultipleShortHandPointers = MultipleShortHandPointers : l''expression XPointer ''{0}'' n''est pas valide. Elle contient plusieurs pointeurs ShortHand.
-SchemeDataNotFollowedByCloseParenthesis = SchemeDataNotFollowedByCloseParenthesis : l''expression XPointer ''{0}'' n''est pas valide. L''\u00E9l\u00E9ment SchemeData n''est pas suivi d''un caract\u00E8re '')''.
-SchemeUnsupported = SchemeUnsupported : le processus XPointer ''{0}'' n''est pas pris en charge.
-InvalidShortHandPointer = InvalidShortHandPointer : le NCName du pointeur ShortHand ''{0}'' n''est pas valide.
-UnbalancedParenthesisInXPointerExpression = UnbalancedParenthesisInXPointerExpression : l''expression XPointer ''{0}'' n''est pas valide. Le nombre de parenth\u00E8ses ouvrantes ''{1}'' est diff\u00E9rent du nombre de parenth\u00E8ses fermantes ''{2}''.
-InvalidSchemeDataInXPointer = InvalidSchemeDataInXPointer : l''expression XPointer ''{0}'' contient un \u00E9l\u00E9ment SchemeData non valide.
-
-# XPointer Element Scheme Error Messages
-InvalidElementSchemeToken = InvalidElementSchemeToken : l''expression XPointer du processus element() contient le jeton non valide ''{0}''
-InvalidElementSchemeXPointer = InvalidElementSchemeXPointer : l''expression XPointer de processus d''\u00E9l\u00E9ment ''{0}'' n''est pas valide.
-XPointerElementSchemeProcessingError = XPointerElementSchemeProcessingError : une erreur est survenue lors du traitement de l'expression de processus element() XPointer.
-InvalidNCNameInElementSchemeData = InvalidNCNameInElementSchemeData : le processus element() contient un pointeur ShortHand ''{0}'' avec un NCName non valide.
-InvalidChildSequenceCharacter = InvalidChildSequenceCharacter : le processus element() contient un caract\u00E8re de s\u00E9quence enfant non valide ''{0}''.
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_it.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_it.properties
deleted file mode 100644
index 4b245b7..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_it.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-# This file stores localized messages for the Xerces XPointer implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-# Messages for message reporting
-BadMessageKey = Impossibile trovare il messaggio di errore corrispondente alla chiave di messaggio.
-FormatFailed = Si \u00E8 verificato un errore interno durante la formattazione del seguente messaggio:\n
-
-# XPointer Framework Error Messages
-XPointerProcessingError = XPointerProcessingError: si \u00E8 verificato un errore durante l'elaborazione dell''espressione XPointer.
-InvalidXPointerToken = InvalidXPointerToken: l''espressione XPointer contiene il token non valido ''{0}''.
-InvalidXPointerExpression = InvalidXPointerExpression: l''espressione XPointer ''{0}'' non \u00E8 valida.
-MultipleShortHandPointers = MultipleShortHandPointers: l''espressione XPointer ''{0}'' non \u00E8 valida. Contiene pi\u00F9 puntatori ShortHand.
-SchemeDataNotFollowedByCloseParenthesis = SchemeDataNotFollowedByCloseParenthesis: l''espressione XPointer ''{0}'' non \u00E8 valida. SchemeData non \u00E8 seguito da un carattere '')''.
-SchemeUnsupported = SchemeUnsupported: lo schema XPointer ''{0}'' non \u00E8 supportato.
-InvalidShortHandPointer = InvalidShortHandPointer: NCName del puntatore ShortHand ''{0}'' non valido.
-UnbalancedParenthesisInXPointerExpression = UnbalancedParenthesisInXPointerExpression: l''espressione XPointer ''{0}'' non \u00E8 valida. Il numero di parentesi aperte ''{1}'' non corrisponde al numero di parentesi chiuse ''{2}''.
-InvalidSchemeDataInXPointer = InvalidSchemeDataInXPointer: l''espressione XPointer ''{0}'' contiene SchemeData non validi.
-
-# XPointer Element Scheme Error Messages
-InvalidElementSchemeToken = InvalidElementSchemeToken: l''espressione XPointer dello schema element() contiene il token non valido ''{0}''.
-InvalidElementSchemeXPointer = InvalidElementSchemeXPointer: l''espressione XPointer ''{0}'' dello schema di elemento non \u00E8 valida.
-XPointerElementSchemeProcessingError = XPointerElementSchemeProcessingError: si \u00E8 verificato un errore durante l'elaborazione dell''espressione di schema element() XPointer.
-InvalidNCNameInElementSchemeData = InvalidNCNameInElementSchemeData: lo schema element() contiene un puntatore ShortHand ''{0}'' con NCName non valido.
-InvalidChildSequenceCharacter = InvalidChildSequenceCharacter: lo schema element() contiene un carattere di sequenza secondaria ''{0}'' non valido.
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_ja.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_ja.properties
deleted file mode 100644
index eca7798..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_ja.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-# This file stores localized messages for the Xerces XPointer implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-# Messages for message reporting
-BadMessageKey = \u30E1\u30C3\u30BB\u30FC\u30B8\u30FB\u30AD\u30FC\u306B\u5BFE\u5FDC\u3059\u308B\u30A8\u30E9\u30FC\u30FB\u30E1\u30C3\u30BB\u30FC\u30B8\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002
-FormatFailed = \u6B21\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\u306E\u66F8\u5F0F\u8A2D\u5B9A\u4E2D\u306B\u5185\u90E8\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F:\n
-
-# XPointer Framework Error Messages
-XPointerProcessingError = XPointerProcessingError: XPointer\u5F0F\u306E\u51E6\u7406\u4E2D\u306B\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002
-InvalidXPointerToken = InvalidXPointerToken: XPointer\u5F0F\u306B\u7121\u52B9\u306A\u30C8\u30FC\u30AF\u30F3''{0}''\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059
-InvalidXPointerExpression = InvalidXPointerExpression: XPointer\u5F0F''{0}''\u304C\u7121\u52B9\u3067\u3059\u3002
-MultipleShortHandPointers = MultipleShortHandPointers: XPointer\u5F0F''{0}''\u304C\u7121\u52B9\u3067\u3059\u3002\u8907\u6570\u306EShortHand\u30DD\u30A4\u30F3\u30BF\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u3002
-SchemeDataNotFollowedByCloseParenthesis = SchemeDataNotFollowedByCloseParenthesis: XPointer\u5F0F''{0}''\u304C\u7121\u52B9\u3067\u3059\u3002SchemeData\u306E\u5F8C\u306B'')''\u6587\u5B57\u304C\u3042\u308A\u307E\u305B\u3093\u3002
-SchemeUnsupported = SchemeUnsupported: XPointer\u30B9\u30AD\u30FC\u30E0''{0}''\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
-InvalidShortHandPointer = InvalidShortHandPointer: ShortHand\u30DD\u30A4\u30F3\u30BF''{0}''\u306ENCName\u304C\u7121\u52B9\u3067\u3059\u3002
-UnbalancedParenthesisInXPointerExpression = UnbalancedParenthesisInXPointerExpression: XPointer\u5F0F''{0}''\u304C\u7121\u52B9\u3067\u3059\u3002\u5DE6\u4E38\u30AB\u30C3\u30B3''{1}''\u306E\u6570\u304C\u53F3\u4E38\u30AB\u30C3\u30B3''{2}''\u306E\u6570\u3068\u4E00\u81F4\u3057\u307E\u305B\u3093\u3002
-InvalidSchemeDataInXPointer = InvalidSchemeDataInXPointer: XPointer\u5F0F''{0}''\u306B\u7121\u52B9\u306ASchemeData\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u3002
-
-# XPointer Element Scheme Error Messages
-InvalidElementSchemeToken = InvalidElementSchemeToken: element() Scheme XPointer\u5F0F\u306B\u7121\u52B9\u306A\u30C8\u30FC\u30AF\u30F3''{0}''\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u3002
-InvalidElementSchemeXPointer = InvalidElementSchemeXPointer: Element Scheme XPointer\u5F0F''{0}''\u304C\u7121\u52B9\u3067\u3059\u3002
-XPointerElementSchemeProcessingError = XPointerElementSchemeProcessingError: XPointer element() Scheme\u5F0F\u306E\u51E6\u7406\u4E2D\u306B\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002
-InvalidNCNameInElementSchemeData = InvalidNCNameInElementSchemeData: element() Scheme\u306B\u7121\u52B9\u306ANCName\u3092\u6301\u3064ShortHand\u30DD\u30A4\u30F3\u30BF''{0}''\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u3002
-InvalidChildSequenceCharacter = InvalidChildSequenceCharacter: element() Scheme\u306B\u7121\u52B9\u306A\u5B50\u30B7\u30FC\u30B1\u30F3\u30B9\u6587\u5B57''{0}''\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u3002
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_ko.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_ko.properties
deleted file mode 100644
index 6a4138a..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_ko.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-# This file stores localized messages for the Xerces XPointer implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-# Messages for message reporting
-BadMessageKey = \uBA54\uC2DC\uC9C0 \uD0A4\uC5D0 \uD574\uB2F9\uD558\uB294 \uC624\uB958 \uBA54\uC2DC\uC9C0\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
-FormatFailed = \uB2E4\uC74C \uBA54\uC2DC\uC9C0\uC758 \uD615\uC2DD\uC744 \uC9C0\uC815\uD558\uB294 \uC911 \uB0B4\uBD80 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4.\n
-
-# XPointer Framework Error Messages
-XPointerProcessingError = XPointerProcessingError: XPointer \uD45C\uD604\uC2DD\uC744 \uCC98\uB9AC\uD558\uB294 \uC911 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4.
-InvalidXPointerToken = InvalidXPointerToken: XPointer \uD45C\uD604\uC2DD\uC5D0 \uBD80\uC801\uD569\uD55C \uD1A0\uD070 ''{0}''\uC774(\uAC00) \uD3EC\uD568\uB418\uC5B4 \uC788\uC2B5\uB2C8\uB2E4.
-InvalidXPointerExpression = InvalidXPointerExpression: XPointer \uD45C\uD604\uC2DD ''{0}''\uC774(\uAC00) \uBD80\uC801\uD569\uD569\uB2C8\uB2E4.
-MultipleShortHandPointers = MultipleShortHandPointers: XPointer \uD45C\uD604\uC2DD ''{0}''\uC774(\uAC00) \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. ShortHand Pointer\uAC00 \uB450 \uAC1C \uC774\uC0C1 \uD3EC\uD568\uB418\uC5B4 \uC788\uC2B5\uB2C8\uB2E4.
-SchemeDataNotFollowedByCloseParenthesis = SchemeDataNotFollowedByCloseParenthesis: XPointer \uD45C\uD604\uC2DD ''{0}''\uC774(\uAC00) \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. SchemeData \uB4A4\uC5D0 '')'' \uBB38\uC790\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.
-SchemeUnsupported = SchemeUnsupported: XPointer \uCCB4\uACC4 ''{0}''\uC740(\uB294) \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
-InvalidShortHandPointer = InvalidShortHandPointer: ShortHand Pointer ''{0}''\uC758 NCName\uC774 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4.
-UnbalancedParenthesisInXPointerExpression = UnbalancedParenthesisInXPointerExpression: XPointer \uD45C\uD604\uC2DD ''{0}''\uC774(\uAC00) \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. \uC5EC\uB294 \uAD04\uD638\uC758 \uAC1C\uC218 ''{1}''\uACFC(\uC640) \uB2EB\uB294 \uAD04\uD638\uC758 \uAC1C\uC218 ''{2}''\uC774(\uAC00) \uC77C\uCE58\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
-InvalidSchemeDataInXPointer = InvalidSchemeDataInXPointer: XPointer \uD45C\uD604\uC2DD ''{0}''\uC5D0 \uBD80\uC801\uD569\uD55C SchemeData\uAC00 \uD3EC\uD568\uB418\uC5B4 \uC788\uC2B5\uB2C8\uB2E4.
-
-# XPointer Element Scheme Error Messages
-InvalidElementSchemeToken = InvalidElementSchemeToken: element() \uCCB4\uACC4 XPointer \uD45C\uD604\uC2DD\uC5D0 \uBD80\uC801\uD569\uD55C \uD1A0\uD070 ''{0}''\uC774(\uAC00) \uD3EC\uD568\uB418\uC5B4 \uC788\uC2B5\uB2C8\uB2E4.
-InvalidElementSchemeXPointer = InvalidElementSchemeXPointer: \uC694\uC18C \uCCB4\uACC4 XPointer \uD45C\uD604\uC2DD ''{0}''\uC774(\uAC00) \uBD80\uC801\uD569\uD569\uB2C8\uB2E4.
-XPointerElementSchemeProcessingError = XPointerElementSchemeProcessingError: XPointer element() \uCCB4\uACC4 \uD45C\uD604\uC2DD\uC744 \uCC98\uB9AC\uD558\uB294 \uC911 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4.
-InvalidNCNameInElementSchemeData = InvalidNCNameInElementSchemeData: element() \uCCB4\uACC4\uC5D0 NCName\uC774 \uBD80\uC801\uD569\uD55C ShortHand Pointer ''{0}''\uC774(\uAC00) \uD3EC\uD568\uB418\uC5B4 \uC788\uC2B5\uB2C8\uB2E4.
-InvalidChildSequenceCharacter = InvalidChildSequenceCharacter: element() \uCCB4\uACC4\uC5D0 \uBD80\uC801\uD569\uD55C \uD558\uC704 \uC2DC\uD000\uC2A4 \uBB38\uC790 ''{0}''\uC774(\uAC00) \uD3EC\uD568\uB418\uC5B4 \uC788\uC2B5\uB2C8\uB2E4.
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_pt_BR.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_pt_BR.properties
deleted file mode 100644
index d0da5de..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_pt_BR.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-# This file stores localized messages for the Xerces XPointer implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-# Messages for message reporting
-BadMessageKey = N\u00E3o foi poss\u00EDvel encontrar a mensagem de erro correspondente \u00E0 chave da mensagem.
-FormatFailed = Ocorreu um erro interno ao formatar a mensagem a seguir:\n
-
-# XPointer Framework Error Messages
-XPointerProcessingError = XPointerProcessingError: Ocorreu um erro ao processar a express\u00E3o XPointer.
-InvalidXPointerToken = InvalidXPointerToken: A express\u00E3o XPointer cont\u00E9m o token inv\u00E1lido ''{0}''
-InvalidXPointerExpression = InvalidXPointerExpression: A express\u00E3o XPointer ''{0}'' \u00E9 inv\u00E1lida.
-MultipleShortHandPointers = MultipleShortHandPointers: A express\u00E3o XPointer ''{0}'' \u00E9 inv\u00E1lida. Tem mais de um Ponteiro ShortHand.
-SchemeDataNotFollowedByCloseParenthesis = SchemeDataNotFollowedByCloseParenthesis: A express\u00E3o XPointer ''{0}'' \u00E9 inv\u00E1lida. O SchemeData n\u00E3o foi seguida por um caractere '')".
-SchemeUnsupported = SchemeUnsupported: O esquema XPointer ''{0}'' n\u00E3o \u00E9 suportado.
-InvalidShortHandPointer = InvalidShortHandPointer: O NCName do Ponteiro do ShortHand ''{0}'' \u00E9 inv\u00E1lido.
-UnbalancedParenthesisInXPointerExpression = UnbalancedParenthesisInXPointerExpression: A express\u00E3o XPointer ''{0}'' \u00E9 inv\u00E1lida. O n\u00FAmero de par\u00EAnteses de abertura ''{1}'' n\u00E3o \u00E9 igual ao n\u00FAmero de par\u00EAnteses de fechamento ''{2}''.
-InvalidSchemeDataInXPointer = InvalidSchemeDataInXPointer: A express\u00E3o XPointer ''{0}'' cont\u00E9m SchemeData inv\u00E1lido.
-
-# XPointer Element Scheme Error Messages
-InvalidElementSchemeToken = InvalidElementSchemeToken: A express\u00E3o XPointer do esquema element() cont\u00E9m o token inv\u00E1lido ''{0}''
-InvalidElementSchemeXPointer = InvalidElementSchemeXPointer: A express\u00E3o XPointer do Esquema do Elemento ''{0}'' \u00E9 inv\u00E1lida.
-XPointerElementSchemeProcessingError = XPointerElementSchemeProcessingError: Ocorreu um erro ao processoar a express\u00E3o do Esquema do element() do XPointer.
-InvalidNCNameInElementSchemeData = InvalidNCNameInElementSchemeData: O Esquema do element() cont\u00E9m um Ponteiro de ShortHand ''{0}'' com um NCName inv\u00E1lido.
-InvalidChildSequenceCharacter = InvalidChildSequenceCharacter: O Esquema de element() cont\u00E9m um caractere de sequ\u00EAncia filho inv\u00E1lido ''{0}''.
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_sv.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_sv.properties
deleted file mode 100644
index 62774b1..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_sv.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-# This file stores localized messages for the Xerces XPointer implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-# Messages for message reporting
-BadMessageKey = Hittar inte felmeddelandet som motsvarar meddelandenyckeln.
-FormatFailed = Ett internt fel intr\u00E4ffade vid formatering av f\u00F6ljande meddelande:\n
-
-# XPointer Framework Error Messages
-XPointerProcessingError = XPointerProcessingError: Ett fel intr\u00E4ffade vid bearbetning av XPointer-uttrycket.
-InvalidXPointerToken = InvalidXPointerToken: XPointer-uttrycket inneh\u00E5ller ogiltigt tecken, ''{0}''
-InvalidXPointerExpression = InvalidXPointerExpression: XPointer-uttrycket ''{0}'' \u00E4r ogiltigt.
-MultipleShortHandPointers = MultipleShortHandPointers: XPointer-uttrycket ''{0}'' \u00E4r ogiltigt. Det inneh\u00E5ller fler \u00E4n en ShortHand Pointer.
-SchemeDataNotFollowedByCloseParenthesis = SchemeDataNotFollowedByCloseParenthesis: XPointer-uttrycket ''{0}'' \u00E4r ogiltigt. SchemeData efterf\u00F6ljdes inte av ett '')''-tecken.
-SchemeUnsupported = SchemeUnsupported: XPointer-schemat ''{0}'' st\u00F6ds inte.
-InvalidShortHandPointer = InvalidShortHandPointer: NCName i ShortHand-pekaren ''{0}'' \u00E4r ogiltigt.
-UnbalancedParenthesisInXPointerExpression = UnbalancedParenthesisInXPointerExpression: XPointer-uttrycket ''{0}'' \u00E4r ogiltigt. Antalet v\u00E4nsterparenteser ''{1}'' \u00E4r inte samma som antalet h\u00F6gerparenteser ''{2}''.
-InvalidSchemeDataInXPointer = InvalidSchemeDataInXPointer: XPointer-uttrycket ''{0}'' inneh\u00E5ller ogiltig SchemeData.
-
-# XPointer Element Scheme Error Messages
-InvalidElementSchemeToken = InvalidElementSchemeToken: XPointer-uttrycket i element()-schemat inneh\u00E5ller ogiltigt tecken ''{0}''
-InvalidElementSchemeXPointer = InvalidElementSchemeXPointer: XPointer-uttrycket ''{0}'' i elementschemat \u00E4r ogiltigt.
-XPointerElementSchemeProcessingError = XPointerElementSchemeProcessingError: Ett fel intr\u00E4ffade vid bearbetning av schemauttrycket i XPointer element().
-InvalidNCNameInElementSchemeData = InvalidNCNameInElementSchemeData: element()-schemat inneh\u00E5ller ShortHand-pekaren ''{0}'' med ogiltigt NCName.
-InvalidChildSequenceCharacter = InvalidChildSequenceCharacter: element()-schemat inneh\u00E5ller ett ogiltigt tecken ''{0}'' i underordnad sekvens.
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_zh_CN.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_zh_CN.properties
deleted file mode 100644
index d99a6ec..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_zh_CN.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-# This file stores localized messages for the Xerces XPointer implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-# Messages for message reporting
-BadMessageKey = \u627E\u4E0D\u5230\u4E0E\u6D88\u606F\u5173\u952E\u5B57\u5BF9\u5E94\u7684\u9519\u8BEF\u6D88\u606F\u3002
-FormatFailed = \u8BBE\u7F6E\u4EE5\u4E0B\u6D88\u606F\u7684\u683C\u5F0F\u65F6\u51FA\u73B0\u5185\u90E8\u9519\u8BEF:\n
-
-# XPointer Framework Error Messages
-XPointerProcessingError = XPointerProcessingError: \u5904\u7406 XPointer \u8868\u8FBE\u5F0F\u65F6\u51FA\u9519\u3002
-InvalidXPointerToken = InvalidXPointerToken: XPointer \u8868\u8FBE\u5F0F\u5305\u542B\u65E0\u6548\u7684\u6807\u8BB0 ''{0}''
-InvalidXPointerExpression = InvalidXPointerExpression: XPointer \u8868\u8FBE\u5F0F ''{0}'' \u65E0\u6548\u3002
-MultipleShortHandPointers = MultipleShortHandPointers: XPointer \u8868\u8FBE\u5F0F ''{0}'' \u65E0\u6548\u3002\u5B83\u5177\u6709\u591A\u4E2A ShortHand \u6307\u9488\u3002
-SchemeDataNotFollowedByCloseParenthesis = SchemeDataNotFollowedByCloseParenthesis: XPointer \u8868\u8FBE\u5F0F ''{0}'' \u65E0\u6548\u3002SchemeData \u7684\u540E\u9762\u672A\u8DDF\u968F '')'' \u5B57\u7B26\u3002
-SchemeUnsupported = SchemeUnsupported: \u4E0D\u652F\u6301 XPointer \u65B9\u6848 ''{0}''\u3002
-InvalidShortHandPointer = InvalidShortHandPointer: ShortHand \u6307\u9488 ''{0}'' \u7684 NCName \u65E0\u6548\u3002
-UnbalancedParenthesisInXPointerExpression = UnbalancedParenthesisInXPointerExpression: XPointer \u8868\u8FBE\u5F0F ''{0}'' \u65E0\u6548\u3002\u5DE6\u62EC\u53F7\u7684\u6570\u91CF ''{1}'' \u4E0E\u53F3\u62EC\u53F7\u7684\u6570\u91CF ''{2}'' \u4E0D\u76F8\u7B49\u3002
-InvalidSchemeDataInXPointer = InvalidSchemeDataInXPointer: XPointer \u8868\u8FBE\u5F0F ''{0}'' \u5305\u542B\u65E0\u6548\u7684 SchemeData\u3002
-
-# XPointer Element Scheme Error Messages
-InvalidElementSchemeToken = InvalidElementSchemeToken: element() \u65B9\u6848\u7684 XPointer \u8868\u8FBE\u5F0F\u5305\u542B\u65E0\u6548\u7684\u6807\u8BB0 ''{0}''
-InvalidElementSchemeXPointer = InvalidElementSchemeXPointer: \u5143\u7D20\u65B9\u6848\u7684 XPointer \u8868\u8FBE\u5F0F ''{0}'' \u65E0\u6548\u3002
-XPointerElementSchemeProcessingError = XPointerElementSchemeProcessingError: \u5904\u7406 XPointer element() \u65B9\u6848\u8868\u8FBE\u5F0F\u65F6\u51FA\u9519\u3002
-InvalidNCNameInElementSchemeData = InvalidNCNameInElementSchemeData: element() \u65B9\u6848\u5305\u542B NCName \u65E0\u6548\u7684 ShortHand \u6307\u9488 ''{0}''\u3002
-InvalidChildSequenceCharacter = InvalidChildSequenceCharacter: element() \u65B9\u6848\u5305\u542B\u65E0\u6548\u7684\u5B50\u5E8F\u5217\u5B57\u7B26 ''{0}''\u3002
diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_zh_TW.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_zh_TW.properties
deleted file mode 100644
index bb747dd..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_zh_TW.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-# This file stores localized messages for the Xerces XPointer implementation.
-#
-# The messages are arranged in key and value tuples in a ListResourceBundle.
-#
-
-# Messages for message reporting
-BadMessageKey = \u627E\u4E0D\u5230\u5C0D\u61C9\u8A0A\u606F\u7D22\u5F15\u9375\u7684\u932F\u8AA4\u8A0A\u606F\u3002
-FormatFailed = \u683C\u5F0F\u5316\u4E0B\u5217\u8A0A\u606F\u6642\u767C\u751F\u5167\u90E8\u932F\u8AA4:\n
-
-# XPointer Framework Error Messages
-XPointerProcessingError = XPointerProcessingError: \u8655\u7406 XPointer \u8868\u793A\u5F0F\u6642\u767C\u751F\u932F\u8AA4\u3002
-InvalidXPointerToken = InvalidXPointerToken: XPointer \u8868\u793A\u5F0F\u5305\u542B\u7121\u6548\u8A18\u865F ''{0}''
-InvalidXPointerExpression = InvalidXPointerExpression: XPointer \u8868\u793A\u5F0F ''{0}'' \u7121\u6548\u3002
-MultipleShortHandPointers = MultipleShortHandPointers: XPointer \u8868\u793A\u5F0F ''{0}'' \u7121\u6548\u3002\u5B83\u5177\u6709\u8D85\u904E\u4E00\u500B\u4EE5\u4E0A\u7684 ShortHand \u6307\u6A19\u3002
-SchemeDataNotFollowedByCloseParenthesis = SchemeDataNotFollowedByCloseParenthesis: XPointer \u8868\u793A\u5F0F ''{0}'' \u7121\u6548\u3002\u7DCA\u63A5\u5728 SchemeData \u4E4B\u5F8C\u4E0D\u662F '')'' \u5B57\u5143\u3002
-SchemeUnsupported = SchemeUnsupported: \u4E0D\u652F\u63F4 XPointer \u914D\u7F6E ''{0}''\u3002
-InvalidShortHandPointer = InvalidShortHandPointer: ShortHand \u6307\u6A19 ''{0}'' \u7684 NCName \u7121\u6548\u3002
-UnbalancedParenthesisInXPointerExpression = UnbalancedParenthesisInXPointerExpression: XPointer \u8868\u793A\u5F0F ''{0}'' \u7121\u6548\u3002\u5DE6\u62EC\u865F\u7684\u6578\u76EE ''{1}'' \u4E0D\u7B49\u65BC\u53F3\u62EC\u865F\u7684\u6578\u76EE ''{2}''\u3002
-InvalidSchemeDataInXPointer = InvalidSchemeDataInXPointer: XPointer \u8868\u793A\u5F0F ''{0}'' \u5305\u542B\u7121\u6548\u7684 SchemeData\u3002
-
-# XPointer Element Scheme Error Messages
-InvalidElementSchemeToken = InvalidElementSchemeToken: element() \u914D\u7F6E XPointer \u8868\u793A\u5F0F\u5305\u542B\u7121\u6548\u8A18\u865F ''{0}''
-InvalidElementSchemeXPointer = InvalidElementSchemeXPointer: \u5143\u7D20\u914D\u7F6E XPointer \u8868\u793A\u5F0F ''{0}'' \u7121\u6548\u3002
-XPointerElementSchemeProcessingError = XPointerElementSchemeProcessingError: \u8655\u7406 XPointer element() \u914D\u7F6E\u8868\u793A\u5F0F\u6642\u767C\u751F\u932F\u8AA4\u3002
-InvalidNCNameInElementSchemeData = InvalidNCNameInElementSchemeData: element() \u914D\u7F6E\u5305\u542B\u5177\u6709\u7121\u6548 NCName \u7684 ShortHand \u6307\u6A19 ''{0}''\u3002
-InvalidChildSequenceCharacter = InvalidChildSequenceCharacter: element() \u914D\u7F6E\u5305\u542B\u7121\u6548\u5B50\u9805\u9806\u5E8F\u5B57\u5143 ''{0}''\u3002
diff --git a/src/com/sun/org/apache/xerces/internal/impl/validation/EntityState.java b/src/com/sun/org/apache/xerces/internal/impl/validation/EntityState.java
deleted file mode 100644
index 86a9215..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/validation/EntityState.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.validation;
-
-
-/**
- * The entity state interface defines methods that must be implemented
- * by components that store information about entity declarations, as well as by
- * entity validator that will need to validate attributes of type entity.
- *
- * @xerces.internal
- *
- * @author Elena Litani, IBM
- */
-public interface EntityState {
- /**
- * Query method to check if entity with this name was declared.
- *
- * @param name
- * @return true if name is a declared entity
- */
- public boolean isEntityDeclared (String name);
-
- /**
- * Query method to check if entity is unparsed.
- *
- * @param name
- * @return true if name is an unparsed entity
- */
- public boolean isEntityUnparsed (String name);
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/validation/ValidationManager.java b/src/com/sun/org/apache/xerces/internal/impl/validation/ValidationManager.java
deleted file mode 100644
index 67e9535..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/validation/ValidationManager.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.validation;
-
-import java.util.Vector;
-
-/**
- * ValidationManager is a coordinator property for validators in the
- * pipeline. Each validator must know how to interact with
- * this property. Validators are not required to know what kind of
- * other validators present in the pipeline, but should understand
- * that there are others and that some coordination is required.
- *
- * @xerces.internal
- *
- * @author Elena Litani, IBM
- */
-public class ValidationManager {
-
- protected final Vector fVSs = new Vector();
- protected boolean fGrammarFound = false;
-
- // used by the DTD validator to tell other components that it has a
- // cached DTD in hand so there's no reason to
- // scan external subset or entity decls.
- protected boolean fCachedDTD = false;
-
- /**
- * Each validator should call this method to add its ValidationState into
- * the validation manager.
- */
- public final void addValidationState(ValidationState vs) {
- fVSs.addElement(vs);
- }
-
- /**
- * Set the information required to validate entity values.
- */
- public final void setEntityState(EntityState state) {
- for (int i = fVSs.size()-1; i >= 0; i--) {
- ((ValidationState)fVSs.elementAt(i)).setEntityState(state);
- }
- }
-
- public final void setGrammarFound(boolean grammar){
- fGrammarFound = grammar;
- }
-
- public final boolean isGrammarFound(){
- return fGrammarFound;
- }
-
- public final void setCachedDTD(boolean cachedDTD) {
- fCachedDTD = cachedDTD;
- } // setCachedDTD(boolean)
-
- public final boolean isCachedDTD() {
- return fCachedDTD;
- } // isCachedDTD(): boolean
-
-
- public final void reset (){
- fVSs.removeAllElements();
- fGrammarFound = false;
- fCachedDTD = false;
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/validation/ValidationState.java b/src/com/sun/org/apache/xerces/internal/impl/validation/ValidationState.java
deleted file mode 100644
index a04c57d..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/validation/ValidationState.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.validation;
-
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
-
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-import java.util.ArrayList;
-import java.util.Locale;
-
-/**
- * Implementation of ValidationContext inteface. Used to establish an
- * environment for simple type validation.
- *
- * @xerces.internal
- *
- * @author Elena Litani, IBM
- * @version $Id: ValidationState.java,v 1.7 2010-11-01 04:39:53 joehw Exp $
- */
-public class ValidationState implements ValidationContext {
-
- //
- // private data
- //
- private boolean fExtraChecking = true;
- private boolean fFacetChecking = true;
- private boolean fNormalize = true;
- private boolean fNamespaces = true;
-
- private EntityState fEntityState = null;
- private NamespaceContext fNamespaceContext = null;
- private SymbolTable fSymbolTable = null;
- private Locale fLocale = null;
-
- private ArrayList<String> fIdList;
- private ArrayList<String> fIdRefList;
-
- //
- // public methods
- //
- public void setExtraChecking(boolean newValue) {
- fExtraChecking = newValue;
- }
-
- public void setFacetChecking(boolean newValue) {
- fFacetChecking = newValue;
- }
-
- public void setNormalizationRequired (boolean newValue) {
- fNormalize = newValue;
- }
-
- public void setUsingNamespaces (boolean newValue) {
- fNamespaces = newValue;
- }
-
- public void setEntityState(EntityState state) {
- fEntityState = state;
- }
-
- public void setNamespaceSupport(NamespaceContext namespace) {
- fNamespaceContext = namespace;
- }
-
- public void setSymbolTable(SymbolTable sTable) {
- fSymbolTable = sTable;
- }
-
- /**
- * return null if all IDREF values have a corresponding ID value;
- * otherwise return the first IDREF value without a matching ID value.
- */
- public String checkIDRefID () {
- if (fIdList == null) {
- if (fIdRefList != null) {
- return fIdRefList.get(0);
- }
- }
-
- if (fIdRefList != null) {
- String key;
- for (int i = 0; i < fIdRefList.size(); i++) {
- key = fIdRefList.get(i);
- if (!fIdList.contains(key)) {
- return key;
- }
- }
- }
- return null;
- }
-
- public void reset () {
- fExtraChecking = true;
- fFacetChecking = true;
- fNamespaces = true;
- fIdList = null;
- fIdRefList = null;
- fEntityState = null;
- fNamespaceContext = null;
- fSymbolTable = null;
- }
-
- /**
- * The same validation state can be used to validate more than one (schema)
- * validation roots. Entity/Namespace/Symbol are shared, but each validation
- * root needs its own id/idref tables. So we need this method to reset only
- * the two tables.
- */
- public void resetIDTables() {
- fIdList = null;
- fIdRefList = null;
- }
-
- //
- // implementation of ValidationContext methods
- //
-
- // whether to do extra id/idref/entity checking
- public boolean needExtraChecking() {
- return fExtraChecking;
- }
-
- // whether to validate against facets
- public boolean needFacetChecking() {
- return fFacetChecking;
- }
-
- public boolean needToNormalize (){
- return fNormalize;
- }
-
- public boolean useNamespaces() {
- return fNamespaces;
- }
-
- // entity
- public boolean isEntityDeclared (String name) {
- if (fEntityState !=null) {
- return fEntityState.isEntityDeclared(getSymbol(name));
- }
- return false;
- }
- public boolean isEntityUnparsed (String name) {
- if (fEntityState !=null) {
- return fEntityState.isEntityUnparsed(getSymbol(name));
- }
- return false;
- }
-
- // id
- public boolean isIdDeclared(String name) {
- if (fIdList == null) return false;
- return fIdList.contains(name);
- }
- public void addId(String name) {
- if (fIdList == null) fIdList = new ArrayList();
- fIdList.add(name);
- }
-
- // idref
- public void addIdRef(String name) {
- if (fIdRefList == null) fIdRefList = new ArrayList();
- fIdRefList.add(name);
- }
- // get symbols
-
- public String getSymbol (String symbol) {
- if (fSymbolTable != null)
- return fSymbolTable.addSymbol(symbol);
- // if there is no symbol table, we return java-internalized string,
- // because symbol table strings are also java-internalzied.
- // this guarantees that the returned string from this method can be
- // compared by reference with other symbol table string. -SG
- return symbol.intern();
- }
- // qname, notation
- public String getURI(String prefix) {
- if (fNamespaceContext !=null) {
- return fNamespaceContext.getURI(prefix);
- }
- return null;
- }
-
- // Locale
-
- public void setLocale(Locale locale) {
- fLocale = locale;
- }
-
- public Locale getLocale() {
- return fLocale;
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xpath/XPath.java b/src/com/sun/org/apache/xerces/internal/impl/xpath/XPath.java
deleted file mode 100644
index be2e311..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xpath/XPath.java
+++ /dev/null
@@ -1,2026 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xpath;
-
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.util.XMLChar;
-import com.sun.org.apache.xerces.internal.util.XMLSymbols;
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Vector;
-
-/**
- * Bare minimum XPath parser.
- *
- * @xerces.internal
- *
- * @author Andy Clark, IBM
- * @author Sunitha Reddy, Sun Microsystems
- */
-public class XPath {
-
- //
- // Constants
- //
-
- private static final boolean DEBUG_ALL = false;
-
- private static final boolean DEBUG_XPATH_PARSE = DEBUG_ALL || false;
-
- private static final boolean DEBUG_ANY = DEBUG_XPATH_PARSE;
-
- //
- // Data
- //
-
- /** Expression. */
- protected String fExpression;
-
- /** Symbol table. */
- protected SymbolTable fSymbolTable;
-
- /** Location paths. */
- protected LocationPath[] fLocationPaths;
-
- //
- // Constructors
- //
-
- /** Constructs an XPath object from the specified expression. */
- public XPath(String xpath, SymbolTable symbolTable,
- NamespaceContext context)
- throws XPathException {
- fExpression = xpath;
- fSymbolTable = symbolTable;
- parseExpression(context);
- } // <init>(String,SymbolTable,NamespaceContext)
-
- //
- // Public methods
- //
-
- /**
- * Returns a representation of all location paths for this XPath.
- * XPath = locationPath ( '|' locationPath)
- */
- public LocationPath[] getLocationPaths() {
- LocationPath[] ret=new LocationPath[fLocationPaths.length];
- for (int i=0;i<fLocationPaths.length;i++){
- ret[i]=(LocationPath)fLocationPaths[i].clone();
- }
- return ret;
- } // getLocationPath(LocationPath)
-
- /** Returns a representation of the first location path for this XPath. */
- public LocationPath getLocationPath() {
- return (LocationPath)fLocationPaths[0].clone();
- } // getLocationPath(LocationPath)
-
- //
- // Object methods
- //
-
- /** Returns a string representation of this object. */
- public String toString() {
- StringBuffer buf=new StringBuffer();
- for (int i=0;i<fLocationPaths.length;i++){
- if (i>0){
- buf.append("|");
- }
- buf.append(fLocationPaths[i].toString());
- }
- return buf.toString();
- } // toString():String
-
- //
- // Private methods
- //
-
- /**
- * Used by the {@link #parseExpression(NamespaceContext)} method
- * to verify the assumption.
- *
- * If <tt>b</tt> is false, this method throws XPathException
- * to report the error.
- */
- private static void check( boolean b ) throws XPathException {
- if(!b) throw new XPathException("c-general-xpath");
- }
-
- /**
- * Used by the {@link #parseExpression(NamespaceContext)} method
- * to build a {@link LocationPath} object from the accumulated
- * {@link Step}s.
- */
- private LocationPath buildLocationPath( Vector stepsVector ) throws XPathException {
- int size = stepsVector.size();
- check(size!=0);
- Step[] steps = new Step[size];
- stepsVector.copyInto(steps);
- stepsVector.removeAllElements();
-
- return new LocationPath(steps);
- }
-
- /**
- * This method is implemented by using the XPathExprScanner and
- * examining the list of tokens that it returns.
- */
- private void parseExpression(final NamespaceContext context)
- throws XPathException {
-
- // tokens
- final XPath.Tokens xtokens = new XPath.Tokens(fSymbolTable);
-
- // scanner
- XPath.Scanner scanner = new XPath.Scanner(fSymbolTable) {
- protected void addToken(XPath.Tokens tokens, int token)
- throws XPathException {
- if (
- token == XPath.Tokens.EXPRTOKEN_ATSIGN ||
- token == XPath.Tokens.EXPRTOKEN_AXISNAME_ATTRIBUTE ||
- token == XPath.Tokens.EXPRTOKEN_NAMETEST_QNAME ||
- token == XPath.Tokens.EXPRTOKEN_OPERATOR_SLASH ||
- token == XPath.Tokens.EXPRTOKEN_PERIOD ||
- token == XPath.Tokens.EXPRTOKEN_NAMETEST_ANY ||
- token == XPath.Tokens.EXPRTOKEN_NAMETEST_NAMESPACE ||
- token == XPath.Tokens.EXPRTOKEN_OPERATOR_DOUBLE_SLASH ||
- token == XPath.Tokens.EXPRTOKEN_OPERATOR_UNION ||
- token == XPath.Tokens.EXPRTOKEN_AXISNAME_CHILD ||
- token == XPath.Tokens.EXPRTOKEN_DOUBLE_COLON
- ) {
- super.addToken(tokens, token);
- return;
- }
- throw new XPathException("c-general-xpath");
- }
- };
-
- int length = fExpression.length();
-
- boolean success = scanner.scanExpr(fSymbolTable,
- xtokens, fExpression, 0, length);
- if(!success)
- throw new XPathException("c-general-xpath");
-
- //fTokens.dumpTokens();
- Vector stepsVector = new Vector();
- Vector locationPathsVector= new Vector();
-
- // true when the next token should be 'Step' (as defined in
- // the production rule [3] of XML Schema P1 section 3.11.6
- // if false, we are expecting either '|' or '/'.
- //
- // this is to make sure we can detect a token list like
- // 'abc' '/' '/' 'def' 'ghi'
- boolean expectingStep = true;
- boolean expectingDoubleColon = false;
-
- while(xtokens.hasMore()) {
- final int token = xtokens.nextToken();
-
- switch (token) {
- case XPath.Tokens.EXPRTOKEN_OPERATOR_UNION :{
- check(!expectingStep);
- locationPathsVector.addElement(buildLocationPath(stepsVector));
- expectingStep=true;
- break;
- }
-
- case XPath.Tokens.EXPRTOKEN_ATSIGN: {
- check(expectingStep);
- Step step = new Step(
- new Axis(Axis.ATTRIBUTE),
- parseNodeTest(xtokens.nextToken(),xtokens,context));
- stepsVector.addElement(step);
- expectingStep=false;
- break;
- }
- case XPath.Tokens.EXPRTOKEN_NAMETEST_ANY:
- case XPath.Tokens.EXPRTOKEN_NAMETEST_NAMESPACE:
- case XPath.Tokens.EXPRTOKEN_NAMETEST_QNAME: {
- check(expectingStep);
- Step step = new Step(
- new Axis(Axis.CHILD),
- parseNodeTest(token,xtokens,context));
- stepsVector.addElement(step);
- expectingStep=false;
- break;
- }
-
- case XPath.Tokens.EXPRTOKEN_PERIOD: {
- check(expectingStep);
- expectingStep=false;
-
- // unless this is the first step in this location path,
- // there's really no reason to keep them in LocationPath.
- // This amounts to shorten "a/././b/./c" to "a/b/c".
- // Also, the matcher fails to work correctly if XPath
- // has those redundant dots.
- if (stepsVector.size()==0) {
- // build step
- Axis axis = new Axis(Axis.SELF);
- NodeTest nodeTest = new NodeTest(NodeTest.NODE);
- Step step = new Step(axis, nodeTest);
- stepsVector.addElement(step);
-
- if( xtokens.hasMore()
- && xtokens.peekToken() == XPath.Tokens.EXPRTOKEN_OPERATOR_DOUBLE_SLASH){
- // consume '//'
- xtokens.nextToken();
-
- // build step
- axis = new Axis(Axis.DESCENDANT);
- nodeTest = new NodeTest(NodeTest.NODE);
- step = new Step(axis, nodeTest);
- stepsVector.addElement(step);
- expectingStep=true;
- }
- }
- break;
- }
-
- case XPath.Tokens.EXPRTOKEN_OPERATOR_DOUBLE_SLASH:{
- // this cannot appear in arbitrary position.
- // it is only allowed right after '.' when
- // '.' is the first token of a location path.
- throw new XPathException("c-general-xpath");
- }
- case XPath.Tokens.EXPRTOKEN_OPERATOR_SLASH: {
- check(!expectingStep);
- expectingStep=true;
- break;
- }
- case XPath.Tokens.EXPRTOKEN_AXISNAME_ATTRIBUTE: {
- check(expectingStep);
- expectingDoubleColon = true;
-
- if (xtokens.nextToken() == XPath.Tokens.EXPRTOKEN_DOUBLE_COLON){
- Step step = new Step(
- new Axis(Axis.ATTRIBUTE),
- parseNodeTest(xtokens.nextToken(),xtokens,context));
- stepsVector.addElement(step);
- expectingStep=false;
- expectingDoubleColon = false;
- }
- break;
- }
- case XPath.Tokens.EXPRTOKEN_AXISNAME_CHILD:{
- check(expectingStep);
- expectingDoubleColon = true;
- break;
- }
- case XPath.Tokens.EXPRTOKEN_DOUBLE_COLON :{
- check(expectingStep);
- check(expectingDoubleColon);
- expectingDoubleColon = false;
- break;
- }
- default:
- // we should have covered all the tokens that we can possibly see.
- throw new XPathException("c-general-xpath");
- }
- }
-
- check(!expectingStep);
-
- locationPathsVector.addElement(buildLocationPath(stepsVector));
-
- // save location path
- fLocationPaths=new LocationPath[locationPathsVector.size()];
- locationPathsVector.copyInto(fLocationPaths);
-
-
- if (DEBUG_XPATH_PARSE) {
- System.out.println(">>> "+fLocationPaths);
- }
-
- } // parseExpression(SymbolTable,NamespaceContext)
-
- /**
- * Used by {@link #parseExpression} to parse a node test
- * from the token list.
- */
- private NodeTest parseNodeTest( int typeToken, Tokens xtokens, NamespaceContext context )
- throws XPathException {
- switch(typeToken) {
- case XPath.Tokens.EXPRTOKEN_NAMETEST_ANY:
- return new NodeTest(NodeTest.WILDCARD);
-
- case XPath.Tokens.EXPRTOKEN_NAMETEST_NAMESPACE:
- case XPath.Tokens.EXPRTOKEN_NAMETEST_QNAME:
- // consume QName token
- String prefix = xtokens.nextTokenAsString();
- String uri = null;
- if (context != null && prefix != XMLSymbols.EMPTY_STRING) {
- uri = context.getURI(prefix);
- }
- if (prefix != XMLSymbols.EMPTY_STRING && context != null && uri == null) {
- throw new XPathException("c-general-xpath-ns");
- }
-
- if (typeToken==XPath.Tokens.EXPRTOKEN_NAMETEST_NAMESPACE)
- return new NodeTest(prefix,uri);
-
- String localpart = xtokens.nextTokenAsString();
- String rawname = prefix != XMLSymbols.EMPTY_STRING
- ? fSymbolTable.addSymbol(prefix+':'+localpart)
- : localpart;
-
- return new NodeTest(new QName(prefix, localpart, rawname, uri));
-
- default:
- // assertion error
- throw new XPathException("c-general-xpath");
-
- }
- }
-
-
- //
- // Classes
- //
-
- // location path information
-
- /**
- * A location path representation for an XPath expression.
- *
- * @xerces.internal
- *
- * @author Andy Clark, IBM
- */
- public static class LocationPath
- implements Cloneable {
-
- //
- // Data
- //
-
- /** List of steps. */
- public Step[] steps;
-
- //
- // Constructors
- //
-
- /** Creates a location path from a series of steps. */
- public LocationPath(Step[] steps) {
- this.steps = steps;
- } // <init>(Step[])
-
- /** Copy constructor. */
- protected LocationPath(LocationPath path) {
- steps = new Step[path.steps.length];
- for (int i = 0; i < steps.length; i++) {
- steps[i] = (Step)path.steps[i].clone();
- }
- } // <init>(LocationPath)
-
- //
- // Object methods
- //
-
- /** Returns a string representation of this object. */
- public String toString() {
- StringBuffer str = new StringBuffer();
- for (int i = 0; i < steps.length; i++) {
- if (i > 0 && (steps[i-1].axis.type!=Axis.DESCENDANT
- && steps[i].axis.type!=Axis.DESCENDANT) ){
- str.append('/');
- }
- str.append(steps[i].toString());
- }
- // DEBUG: This code is just for debugging and should *not*
- // be left in because it will mess up hashcodes of
- // serialized versions of this object. -Ac
- if (false) {
- str.append('[');
- String s = super.toString();
- str.append(s.substring(s.indexOf('@')));
- str.append(']');
- }
- return str.toString();
- } // toString():String
-
- /** Returns a clone of this object. */
- public Object clone() {
- return new LocationPath(this);
- } // clone():Object
-
- } // class locationPath
-
- /**
- * A location path step comprised of an axis and node test.
- *
- * @xerces.internal
- *
- * @author Andy Clark, IBM
- */
- public static class Step
- implements Cloneable {
-
- //
- // Data
- //
-
- /** Axis. */
- public Axis axis;
-
- /** Node test. */
- public NodeTest nodeTest;
-
- //
- // Constructors
- //
-
- /** Constructs a step from an axis and node test. */
- public Step(Axis axis, NodeTest nodeTest) {
- this.axis = axis;
- this.nodeTest = nodeTest;
- } // <init>(Axis,NodeTest)
-
- /** Copy constructor. */
- protected Step(Step step) {
- axis = (Axis)step.axis.clone();
- nodeTest = (NodeTest)step.nodeTest.clone();
- } // <init>(Step)
-
- //
- // Object methods
- //
-
- /** Returns a string representation of this object. */
- public String toString() {
- if (axis.type == Axis.SELF) {
- return ".";
- }
- if (axis.type == Axis.ATTRIBUTE) {
- return "@" + nodeTest.toString();
- }
- if (axis.type == Axis.CHILD) {
- return nodeTest.toString();
- }
- if (axis.type == Axis.DESCENDANT) {
- return "//";
- }
- return "??? ("+axis.type+')';
- } // toString():String
-
- /** Returns a clone of this object. */
- public Object clone() {
- return new Step(this);
- } // clone():Object
-
- } // class Step
-
- /**
- * Axis.
- *
- * @xerces.internal
- *
- * @author Andy Clark, IBM
- */
- public static class Axis
- implements Cloneable {
-
- //
- // Constants
- //
-
- /** Type: child. */
- public static final short CHILD = 1;
-
- /** Type: attribute. */
- public static final short ATTRIBUTE = 2;
-
- /** Type: self. */
- public static final short SELF = 3;
-
-
- /** Type: descendant. */
- public static final short DESCENDANT = 4;
- //
- // Data
- //
-
- /** Axis type. */
- public short type;
-
- //
- // Constructors
- //
-
- /** Constructs an axis with the specified type. */
- public Axis(short type) {
- this.type = type;
- } // <init>(short)
-
- /** Copy constructor. */
- protected Axis(Axis axis) {
- type = axis.type;
- } // <init>(Axis)
-
- //
- // Object methods
- //
-
- /** Returns a string representation of this object. */
- public String toString() {
- switch (type) {
- case CHILD: return "child";
- case ATTRIBUTE: return "attribute";
- case SELF: return "self";
- case DESCENDANT: return "descendant";
- }
- return "???";
- } // toString():String
-
- /** Returns a clone of this object. */
- public Object clone() {
- return new Axis(this);
- } // clone():Object
-
- } // class Axis
-
- /**
- * Node test.
- *
- * @xerces.internal
- *
- * @author Andy Clark, IBM
- */
- public static class NodeTest
- implements Cloneable {
-
- //
- // Constants
- //
-
- /** Type: qualified name. */
- public static final short QNAME = 1;
-
- /** Type: wildcard. */
- public static final short WILDCARD = 2;
-
- /** Type: node. */
- public static final short NODE = 3;
-
- /** Type: namespace */
- public static final short NAMESPACE= 4;
-
- //
- // Data
- //
-
- /** Node test type. */
- public short type;
-
- /** Node qualified name. */
- public final QName name = new QName();
-
- //
- // Constructors
- //
-
- /** Constructs a node test of type WILDCARD or NODE. */
- public NodeTest(short type) {
- this.type = type;
- } // <init>(int)
-
- /** Constructs a node test of type QName. */
- public NodeTest(QName name) {
- this.type = QNAME;
- this.name.setValues(name);
- } // <init>(QName)
- /** Constructs a node test of type Namespace. */
- public NodeTest(String prefix, String uri) {
- this.type = NAMESPACE;
- this.name.setValues(prefix, null, null, uri);
- } // <init>(String,String)
-
- /** Copy constructor. */
- public NodeTest(NodeTest nodeTest) {
- type = nodeTest.type;
- name.setValues(nodeTest.name);
- } // <init>(NodeTest)
-
- //
- // Object methods
- //
-
- /** Returns a string representation of this object. */
- public String toString() {
-
- switch (type) {
- case QNAME: {
- if (name.prefix.length() !=0) {
- if (name.uri != null) {
- return name.prefix+':'+name.localpart;
- }
- return "{"+name.uri+'}'+name.prefix+':'+name.localpart;
- }
- return name.localpart;
- }
- case NAMESPACE: {
- if (name.prefix.length() !=0) {
- if (name.uri != null) {
- return name.prefix+":*";
- }
- return "{"+name.uri+'}'+name.prefix+":*";
- }
- return "???:*";
- }
- case WILDCARD: {
- return "*";
- }
- case NODE: {
- return "node()";
- }
- }
- return "???";
-
- } // toString():String
-
- /** Returns a clone of this object. */
- public Object clone() {
- return new NodeTest(this);
- } // clone():Object
-
- } // class NodeTest
-
- // xpath implementation
-
- // NOTE: The XPath implementation classes are kept internal because
- // this implementation is just a temporary hack until a better
- // and/or more appropriate implementation can be written.
- // keeping the code in separate source files would "muddy" the
- // CVS directory when it's not needed. -Ac
-
- /**
- * List of tokens.
- *
- * @xerces.internal
- *
- * @author Glenn Marcy, IBM
- * @author Andy Clark, IBM
- *
- */
- private static final class Tokens {
-
- static final boolean DUMP_TOKENS = false;
-
- /**
- * [28] ExprToken ::= '(' | ')' | '[' | ']' | '.' | '..' | '@' | ',' | '::'
- * | NameTest | NodeType | Operator | FunctionName
- * | AxisName | Literal | Number | VariableReference
- */
- public static final int
- EXPRTOKEN_OPEN_PAREN = 0,
- EXPRTOKEN_CLOSE_PAREN = 1,
- EXPRTOKEN_OPEN_BRACKET = 2,
- EXPRTOKEN_CLOSE_BRACKET = 3,
- EXPRTOKEN_PERIOD = 4,
- EXPRTOKEN_DOUBLE_PERIOD = 5,
- EXPRTOKEN_ATSIGN = 6,
- EXPRTOKEN_COMMA = 7,
- EXPRTOKEN_DOUBLE_COLON = 8,
- //
- // [37] NameTest ::= '*' | NCName ':' '*' | QName
- //
- // followed by symbol handle of NCName or QName
- //
- EXPRTOKEN_NAMETEST_ANY = 9,
- EXPRTOKEN_NAMETEST_NAMESPACE = 10,
- EXPRTOKEN_NAMETEST_QNAME = 11,
- //
- // [38] NodeType ::= 'comment' | 'text' | 'processing-instruction' | 'node'
- //
- EXPRTOKEN_NODETYPE_COMMENT = 12,
- EXPRTOKEN_NODETYPE_TEXT = 13,
- EXPRTOKEN_NODETYPE_PI = 14,
- EXPRTOKEN_NODETYPE_NODE = 15,
- //
- // [32] Operator ::= OperatorName
- // | MultiplyOperator
- // | '/' | '//' | '|' | '+' | '-' | '=' | '!=' | '<' | '<=' | '>' | '>='
- // [33] OperatorName ::= 'and' | 'or' | 'mod' | 'div'
- // [34] MultiplyOperator ::= '*'
- //
- EXPRTOKEN_OPERATOR_AND = 16,
- EXPRTOKEN_OPERATOR_OR = 17,
- EXPRTOKEN_OPERATOR_MOD = 18,
- EXPRTOKEN_OPERATOR_DIV = 19,
- EXPRTOKEN_OPERATOR_MULT = 20,
- EXPRTOKEN_OPERATOR_SLASH = 21,
- EXPRTOKEN_OPERATOR_DOUBLE_SLASH = 22,
- EXPRTOKEN_OPERATOR_UNION = 23,
- EXPRTOKEN_OPERATOR_PLUS = 24,
- EXPRTOKEN_OPERATOR_MINUS = 25,
- EXPRTOKEN_OPERATOR_EQUAL = 26,
- EXPRTOKEN_OPERATOR_NOT_EQUAL = 27,
- EXPRTOKEN_OPERATOR_LESS = 28,
- EXPRTOKEN_OPERATOR_LESS_EQUAL = 29,
- EXPRTOKEN_OPERATOR_GREATER = 30,
- EXPRTOKEN_OPERATOR_GREATER_EQUAL = 31,
-
- //EXPRTOKEN_FIRST_OPERATOR = EXPRTOKEN_OPERATOR_AND,
- //EXPRTOKEN_LAST_OPERATOR = EXPRTOKEN_OPERATOR_GREATER_EQUAL,
-
- //
- // [35] FunctionName ::= QName - NodeType
- //
- // followed by symbol handle
- //
- EXPRTOKEN_FUNCTION_NAME = 32,
- //
- // [6] AxisName ::= 'ancestor' | 'ancestor-or-self'
- // | 'attribute'
- // | 'child'
- // | 'descendant' | 'descendant-or-self'
- // | 'following' | 'following-sibling'
- // | 'namespace'
- // | 'parent'
- // | 'preceding' | 'preceding-sibling'
- // | 'self'
- //
- EXPRTOKEN_AXISNAME_ANCESTOR = 33,
- EXPRTOKEN_AXISNAME_ANCESTOR_OR_SELF = 34,
- EXPRTOKEN_AXISNAME_ATTRIBUTE = 35,
- EXPRTOKEN_AXISNAME_CHILD = 36,
- EXPRTOKEN_AXISNAME_DESCENDANT = 37,
- EXPRTOKEN_AXISNAME_DESCENDANT_OR_SELF = 38,
- EXPRTOKEN_AXISNAME_FOLLOWING = 39,
- EXPRTOKEN_AXISNAME_FOLLOWING_SIBLING = 40,
- EXPRTOKEN_AXISNAME_NAMESPACE = 41,
- EXPRTOKEN_AXISNAME_PARENT = 42,
- EXPRTOKEN_AXISNAME_PRECEDING = 43,
- EXPRTOKEN_AXISNAME_PRECEDING_SIBLING = 44,
- EXPRTOKEN_AXISNAME_SELF = 45,
- //
- // [29] Literal ::= '"' [^"]* '"' | "'" [^']* "'"
- //
- // followed by symbol handle for literal
- //
- EXPRTOKEN_LITERAL = 46,
- //
- // [30] Number ::= Digits ('.' Digits?)? | '.' Digits
- // [31] Digits ::= [0-9]+
- //
- // followed by number handle
- //
- EXPRTOKEN_NUMBER = 47,
- //
- // [36] VariableReference ::= '$' QName
- //
- // followed by symbol handle for QName
- //
- EXPRTOKEN_VARIABLE_REFERENCE = 48;
-
- private static final String[] fgTokenNames = {
- "EXPRTOKEN_OPEN_PAREN",
- "EXPRTOKEN_CLOSE_PAREN",
- "EXPRTOKEN_OPEN_BRACKET",
- "EXPRTOKEN_CLOSE_BRACKET",
- "EXPRTOKEN_PERIOD",
- "EXPRTOKEN_DOUBLE_PERIOD",
- "EXPRTOKEN_ATSIGN",
- "EXPRTOKEN_COMMA",
- "EXPRTOKEN_DOUBLE_COLON",
- "EXPRTOKEN_NAMETEST_ANY",
- "EXPRTOKEN_NAMETEST_NAMESPACE",
- "EXPRTOKEN_NAMETEST_QNAME",
- "EXPRTOKEN_NODETYPE_COMMENT",
- "EXPRTOKEN_NODETYPE_TEXT",
- "EXPRTOKEN_NODETYPE_PI",
- "EXPRTOKEN_NODETYPE_NODE",
- "EXPRTOKEN_OPERATOR_AND",
- "EXPRTOKEN_OPERATOR_OR",
- "EXPRTOKEN_OPERATOR_MOD",
- "EXPRTOKEN_OPERATOR_DIV",
- "EXPRTOKEN_OPERATOR_MULT",
- "EXPRTOKEN_OPERATOR_SLASH",
- "EXPRTOKEN_OPERATOR_DOUBLE_SLASH",
- "EXPRTOKEN_OPERATOR_UNION",
- "EXPRTOKEN_OPERATOR_PLUS",
- "EXPRTOKEN_OPERATOR_MINUS",
- "EXPRTOKEN_OPERATOR_EQUAL",
- "EXPRTOKEN_OPERATOR_NOT_EQUAL",
- "EXPRTOKEN_OPERATOR_LESS",
- "EXPRTOKEN_OPERATOR_LESS_EQUAL",
- "EXPRTOKEN_OPERATOR_GREATER",
- "EXPRTOKEN_OPERATOR_GREATER_EQUAL",
- "EXPRTOKEN_FUNCTION_NAME",
- "EXPRTOKEN_AXISNAME_ANCESTOR",
- "EXPRTOKEN_AXISNAME_ANCESTOR_OR_SELF",
- "EXPRTOKEN_AXISNAME_ATTRIBUTE",
- "EXPRTOKEN_AXISNAME_CHILD",
- "EXPRTOKEN_AXISNAME_DESCENDANT",
- "EXPRTOKEN_AXISNAME_DESCENDANT_OR_SELF",
- "EXPRTOKEN_AXISNAME_FOLLOWING",
- "EXPRTOKEN_AXISNAME_FOLLOWING_SIBLING",
- "EXPRTOKEN_AXISNAME_NAMESPACE",
- "EXPRTOKEN_AXISNAME_PARENT",
- "EXPRTOKEN_AXISNAME_PRECEDING",
- "EXPRTOKEN_AXISNAME_PRECEDING_SIBLING",
- "EXPRTOKEN_AXISNAME_SELF",
- "EXPRTOKEN_LITERAL",
- "EXPRTOKEN_NUMBER",
- "EXPRTOKEN_VARIABLE_REFERENCE"
- };
-
- /**
- *
- */
- private static final int INITIAL_TOKEN_COUNT = 1 << 8;
- private int[] fTokens = new int[INITIAL_TOKEN_COUNT];
- private int fTokenCount = 0; // for writing
-
- private SymbolTable fSymbolTable;
-
- // REVISIT: Code something better here. -Ac
- private Map<String, Integer> fSymbolMapping = new HashMap<>();
-
- // REVISIT: Code something better here. -Ac
- private Map<Integer, String> fTokenNames = new HashMap<>();
-
- /**
- * Current position in the token list.
- */
- private int fCurrentTokenIndex;
-
- //
- // Constructors
- //
-
- public Tokens(SymbolTable symbolTable) {
- fSymbolTable = symbolTable;
- final String[] symbols = {
- "ancestor", "ancestor-or-self", "attribute",
- "child", "descendant", "descendant-or-self",
- "following", "following-sibling", "namespace",
- "parent", "preceding", "preceding-sibling",
- "self",
- };
- for (int i = 0; i < symbols.length; i++) {
- fSymbolMapping.put(fSymbolTable.addSymbol(symbols[i]), i);
- }
- fTokenNames.put(EXPRTOKEN_OPEN_PAREN, "EXPRTOKEN_OPEN_PAREN");
- fTokenNames.put(EXPRTOKEN_CLOSE_PAREN, "EXPRTOKEN_CLOSE_PAREN");
- fTokenNames.put(EXPRTOKEN_OPEN_BRACKET, "EXPRTOKEN_OPEN_BRACKET");
- fTokenNames.put(EXPRTOKEN_CLOSE_BRACKET, "EXPRTOKEN_CLOSE_BRACKET");
- fTokenNames.put(EXPRTOKEN_PERIOD, "EXPRTOKEN_PERIOD");
- fTokenNames.put(EXPRTOKEN_DOUBLE_PERIOD, "EXPRTOKEN_DOUBLE_PERIOD");
- fTokenNames.put(EXPRTOKEN_ATSIGN, "EXPRTOKEN_ATSIGN");
- fTokenNames.put(EXPRTOKEN_COMMA, "EXPRTOKEN_COMMA");
- fTokenNames.put(EXPRTOKEN_DOUBLE_COLON, "EXPRTOKEN_DOUBLE_COLON");
- fTokenNames.put(EXPRTOKEN_NAMETEST_ANY, "EXPRTOKEN_NAMETEST_ANY");
- fTokenNames.put(EXPRTOKEN_NAMETEST_NAMESPACE, "EXPRTOKEN_NAMETEST_NAMESPACE");
- fTokenNames.put(EXPRTOKEN_NAMETEST_QNAME, "EXPRTOKEN_NAMETEST_QNAME");
- fTokenNames.put(EXPRTOKEN_NODETYPE_COMMENT, "EXPRTOKEN_NODETYPE_COMMENT");
- fTokenNames.put(EXPRTOKEN_NODETYPE_TEXT, "EXPRTOKEN_NODETYPE_TEXT");
- fTokenNames.put(EXPRTOKEN_NODETYPE_PI, "EXPRTOKEN_NODETYPE_PI");
- fTokenNames.put(EXPRTOKEN_NODETYPE_NODE, "EXPRTOKEN_NODETYPE_NODE");
- fTokenNames.put(EXPRTOKEN_OPERATOR_AND, "EXPRTOKEN_OPERATOR_AND");
- fTokenNames.put(EXPRTOKEN_OPERATOR_OR, "EXPRTOKEN_OPERATOR_OR");
- fTokenNames.put(EXPRTOKEN_OPERATOR_MOD, "EXPRTOKEN_OPERATOR_MOD");
- fTokenNames.put(EXPRTOKEN_OPERATOR_DIV, "EXPRTOKEN_OPERATOR_DIV");
- fTokenNames.put(EXPRTOKEN_OPERATOR_MULT, "EXPRTOKEN_OPERATOR_MULT");
- fTokenNames.put(EXPRTOKEN_OPERATOR_SLASH, "EXPRTOKEN_OPERATOR_SLASH");
- fTokenNames.put(EXPRTOKEN_OPERATOR_DOUBLE_SLASH, "EXPRTOKEN_OPERATOR_DOUBLE_SLASH");
- fTokenNames.put(EXPRTOKEN_OPERATOR_UNION, "EXPRTOKEN_OPERATOR_UNION");
- fTokenNames.put(EXPRTOKEN_OPERATOR_PLUS, "EXPRTOKEN_OPERATOR_PLUS");
- fTokenNames.put(EXPRTOKEN_OPERATOR_MINUS, "EXPRTOKEN_OPERATOR_MINUS");
- fTokenNames.put(EXPRTOKEN_OPERATOR_EQUAL, "EXPRTOKEN_OPERATOR_EQUAL");
- fTokenNames.put(EXPRTOKEN_OPERATOR_NOT_EQUAL, "EXPRTOKEN_OPERATOR_NOT_EQUAL");
- fTokenNames.put(EXPRTOKEN_OPERATOR_LESS, "EXPRTOKEN_OPERATOR_LESS");
- fTokenNames.put(EXPRTOKEN_OPERATOR_LESS_EQUAL, "EXPRTOKEN_OPERATOR_LESS_EQUAL");
- fTokenNames.put(EXPRTOKEN_OPERATOR_GREATER, "EXPRTOKEN_OPERATOR_GREATER");
- fTokenNames.put(EXPRTOKEN_OPERATOR_GREATER_EQUAL, "EXPRTOKEN_OPERATOR_GREATER_EQUAL");
- fTokenNames.put(EXPRTOKEN_FUNCTION_NAME, "EXPRTOKEN_FUNCTION_NAME");
- fTokenNames.put(EXPRTOKEN_AXISNAME_ANCESTOR, "EXPRTOKEN_AXISNAME_ANCESTOR");
- fTokenNames.put(EXPRTOKEN_AXISNAME_ANCESTOR_OR_SELF, "EXPRTOKEN_AXISNAME_ANCESTOR_OR_SELF");
- fTokenNames.put(EXPRTOKEN_AXISNAME_ATTRIBUTE, "EXPRTOKEN_AXISNAME_ATTRIBUTE");
- fTokenNames.put(EXPRTOKEN_AXISNAME_CHILD, "EXPRTOKEN_AXISNAME_CHILD");
- fTokenNames.put(EXPRTOKEN_AXISNAME_DESCENDANT, "EXPRTOKEN_AXISNAME_DESCENDANT");
- fTokenNames.put(EXPRTOKEN_AXISNAME_DESCENDANT_OR_SELF, "EXPRTOKEN_AXISNAME_DESCENDANT_OR_SELF");
- fTokenNames.put(EXPRTOKEN_AXISNAME_FOLLOWING, "EXPRTOKEN_AXISNAME_FOLLOWING");
- fTokenNames.put(EXPRTOKEN_AXISNAME_FOLLOWING_SIBLING, "EXPRTOKEN_AXISNAME_FOLLOWING_SIBLING");
- fTokenNames.put(EXPRTOKEN_AXISNAME_NAMESPACE, "EXPRTOKEN_AXISNAME_NAMESPACE");
- fTokenNames.put(EXPRTOKEN_AXISNAME_PARENT, "EXPRTOKEN_AXISNAME_PARENT");
- fTokenNames.put(EXPRTOKEN_AXISNAME_PRECEDING, "EXPRTOKEN_AXISNAME_PRECEDING");
- fTokenNames.put(EXPRTOKEN_AXISNAME_PRECEDING_SIBLING, "EXPRTOKEN_AXISNAME_PRECEDING_SIBLING");
- fTokenNames.put(EXPRTOKEN_AXISNAME_SELF, "EXPRTOKEN_AXISNAME_SELF");
- fTokenNames.put(EXPRTOKEN_LITERAL, "EXPRTOKEN_LITERAL");
- fTokenNames.put(EXPRTOKEN_NUMBER, "EXPRTOKEN_NUMBER");
- fTokenNames.put(EXPRTOKEN_VARIABLE_REFERENCE, "EXPRTOKEN_VARIABLE_REFERENCE");
- }
-
- //
- // Public methods
- //
-
-// public String getTokenName(int token) {
-// if (token < 0 || token >= fgTokenNames.length)
-// return null;
-// return fgTokenNames[token];
-// }
-//
- public String getTokenString(int token) {
- return fTokenNames.get(token);
- }
-
- public void addToken(String tokenStr) {
- Integer tokenInt = null;
- for (Map.Entry<Integer, String> entry : fTokenNames.entrySet()) {
- if (entry.getValue().equals(tokenStr)) {
- tokenInt = entry.getKey();
- }
- }
- if (tokenInt == null) {
- tokenInt = fTokenNames.size();
- fTokenNames.put(tokenInt, tokenStr);
- }
- addToken(tokenInt);
- }
-
- public void addToken(int token) {
- try {
- fTokens[fTokenCount] = token;
- } catch (ArrayIndexOutOfBoundsException ex) {
- int[] oldList = fTokens;
- fTokens = new int[fTokenCount << 1];
- System.arraycopy(oldList, 0, fTokens, 0, fTokenCount);
- fTokens[fTokenCount] = token;
- }
- fTokenCount++;
- }
-// public int getTokenCount() {
-// return fTokenCount;
-// }
-// public int getToken(int tokenIndex) {
-// return fTokens[tokenIndex];
-// }
-
- /**
- * Resets the current position to the head of the token list.
- */
- public void rewind() {
- fCurrentTokenIndex=0;
- }
- /**
- * Returns true if the {@link #getNextToken()} method
- * returns a valid token.
- */
- public boolean hasMore() {
- return fCurrentTokenIndex<fTokenCount;
- }
- /**
- * Obtains the token at the current position, then advance
- * the current position by one.
- *
- * If there's no such next token, this method throws
- * <tt>new XPathException("c-general-xpath");</tt>.
- */
- public int nextToken() throws XPathException {
- if( fCurrentTokenIndex==fTokenCount )
- throw new XPathException("c-general-xpath");
- return fTokens[fCurrentTokenIndex++];
- }
- /**
- * Obtains the token at the current position, without advancing
- * the current position.
- *
- * If there's no such next token, this method throws
- * <tt>new XPathException("c-general-xpath");</tt>.
- */
- public int peekToken() throws XPathException {
- if( fCurrentTokenIndex==fTokenCount )
- throw new XPathException("c-general-xpath");
- return fTokens[fCurrentTokenIndex];
- }
- /**
- * Obtains the token at the current position as a String.
- *
- * If there's no current token or if the current token
- * is not a string token, this method throws
- * <tt>new XPathException("c-general-xpath");</tt>.
- */
- public String nextTokenAsString() throws XPathException {
- String s = getTokenString(nextToken());
- if(s==null) throw new XPathException("c-general-xpath");
- return s;
- }
-
- public void dumpTokens() {
- //if (DUMP_TOKENS) {
- for (int i = 0; i < fTokenCount; i++) {
- switch (fTokens[i]) {
- case EXPRTOKEN_OPEN_PAREN:
- System.out.print("<OPEN_PAREN/>");
- break;
- case EXPRTOKEN_CLOSE_PAREN:
- System.out.print("<CLOSE_PAREN/>");
- break;
- case EXPRTOKEN_OPEN_BRACKET:
- System.out.print("<OPEN_BRACKET/>");
- break;
- case EXPRTOKEN_CLOSE_BRACKET:
- System.out.print("<CLOSE_BRACKET/>");
- break;
- case EXPRTOKEN_PERIOD:
- System.out.print("<PERIOD/>");
- break;
- case EXPRTOKEN_DOUBLE_PERIOD:
- System.out.print("<DOUBLE_PERIOD/>");
- break;
- case EXPRTOKEN_ATSIGN:
- System.out.print("<ATSIGN/>");
- break;
- case EXPRTOKEN_COMMA:
- System.out.print("<COMMA/>");
- break;
- case EXPRTOKEN_DOUBLE_COLON:
- System.out.print("<DOUBLE_COLON/>");
- break;
- case EXPRTOKEN_NAMETEST_ANY:
- System.out.print("<NAMETEST_ANY/>");
- break;
- case EXPRTOKEN_NAMETEST_NAMESPACE:
- System.out.print("<NAMETEST_NAMESPACE");
- System.out.print(" prefix=\"" + getTokenString(fTokens[++i]) + "\"");
- System.out.print("/>");
- break;
- case EXPRTOKEN_NAMETEST_QNAME:
- System.out.print("<NAMETEST_QNAME");
- if (fTokens[++i] != -1)
- System.out.print(" prefix=\"" + getTokenString(fTokens[i]) + "\"");
- System.out.print(" localpart=\"" + getTokenString(fTokens[++i]) + "\"");
- System.out.print("/>");
- break;
- case EXPRTOKEN_NODETYPE_COMMENT:
- System.out.print("<NODETYPE_COMMENT/>");
- break;
- case EXPRTOKEN_NODETYPE_TEXT:
- System.out.print("<NODETYPE_TEXT/>");
- break;
- case EXPRTOKEN_NODETYPE_PI:
- System.out.print("<NODETYPE_PI/>");
- break;
- case EXPRTOKEN_NODETYPE_NODE:
- System.out.print("<NODETYPE_NODE/>");
- break;
- case EXPRTOKEN_OPERATOR_AND:
- System.out.print("<OPERATOR_AND/>");
- break;
- case EXPRTOKEN_OPERATOR_OR:
- System.out.print("<OPERATOR_OR/>");
- break;
- case EXPRTOKEN_OPERATOR_MOD:
- System.out.print("<OPERATOR_MOD/>");
- break;
- case EXPRTOKEN_OPERATOR_DIV:
- System.out.print("<OPERATOR_DIV/>");
- break;
- case EXPRTOKEN_OPERATOR_MULT:
- System.out.print("<OPERATOR_MULT/>");
- break;
- case EXPRTOKEN_OPERATOR_SLASH:
- System.out.print("<OPERATOR_SLASH/>");
- if (i + 1 < fTokenCount) {
- System.out.println();
- System.out.print(" ");
- }
- break;
- case EXPRTOKEN_OPERATOR_DOUBLE_SLASH:
- System.out.print("<OPERATOR_DOUBLE_SLASH/>");
- break;
- case EXPRTOKEN_OPERATOR_UNION:
- System.out.print("<OPERATOR_UNION/>");
- break;
- case EXPRTOKEN_OPERATOR_PLUS:
- System.out.print("<OPERATOR_PLUS/>");
- break;
- case EXPRTOKEN_OPERATOR_MINUS:
- System.out.print("<OPERATOR_MINUS/>");
- break;
- case EXPRTOKEN_OPERATOR_EQUAL:
- System.out.print("<OPERATOR_EQUAL/>");
- break;
- case EXPRTOKEN_OPERATOR_NOT_EQUAL:
- System.out.print("<OPERATOR_NOT_EQUAL/>");
- break;
- case EXPRTOKEN_OPERATOR_LESS:
- System.out.print("<OPERATOR_LESS/>");
- break;
- case EXPRTOKEN_OPERATOR_LESS_EQUAL:
- System.out.print("<OPERATOR_LESS_EQUAL/>");
- break;
- case EXPRTOKEN_OPERATOR_GREATER:
- System.out.print("<OPERATOR_GREATER/>");
- break;
- case EXPRTOKEN_OPERATOR_GREATER_EQUAL:
- System.out.print("<OPERATOR_GREATER_EQUAL/>");
- break;
- case EXPRTOKEN_FUNCTION_NAME:
- System.out.print("<FUNCTION_NAME");
- if (fTokens[++i] != -1)
- System.out.print(" prefix=\"" + getTokenString(fTokens[i]) + "\"");
- System.out.print(" localpart=\"" + getTokenString(fTokens[++i]) + "\"");
- System.out.print("/>");
- break;
- case EXPRTOKEN_AXISNAME_ANCESTOR:
- System.out.print("<AXISNAME_ANCESTOR/>");
- break;
- case EXPRTOKEN_AXISNAME_ANCESTOR_OR_SELF:
- System.out.print("<AXISNAME_ANCESTOR_OR_SELF/>");
- break;
- case EXPRTOKEN_AXISNAME_ATTRIBUTE:
- System.out.print("<AXISNAME_ATTRIBUTE/>");
- break;
- case EXPRTOKEN_AXISNAME_CHILD:
- System.out.print("<AXISNAME_CHILD/>");
- break;
- case EXPRTOKEN_AXISNAME_DESCENDANT:
- System.out.print("<AXISNAME_DESCENDANT/>");
- break;
- case EXPRTOKEN_AXISNAME_DESCENDANT_OR_SELF:
- System.out.print("<AXISNAME_DESCENDANT_OR_SELF/>");
- break;
- case EXPRTOKEN_AXISNAME_FOLLOWING:
- System.out.print("<AXISNAME_FOLLOWING/>");
- break;
- case EXPRTOKEN_AXISNAME_FOLLOWING_SIBLING:
- System.out.print("<AXISNAME_FOLLOWING_SIBLING/>");
- break;
- case EXPRTOKEN_AXISNAME_NAMESPACE:
- System.out.print("<AXISNAME_NAMESPACE/>");
- break;
- case EXPRTOKEN_AXISNAME_PARENT:
- System.out.print("<AXISNAME_PARENT/>");
- break;
- case EXPRTOKEN_AXISNAME_PRECEDING:
- System.out.print("<AXISNAME_PRECEDING/>");
- break;
- case EXPRTOKEN_AXISNAME_PRECEDING_SIBLING:
- System.out.print("<AXISNAME_PRECEDING_SIBLING/>");
- break;
- case EXPRTOKEN_AXISNAME_SELF:
- System.out.print("<AXISNAME_SELF/>");
- break;
- case EXPRTOKEN_LITERAL:
- System.out.print("<LITERAL");
- System.out.print(" value=\"" + getTokenString(fTokens[++i]) + "\"");
- System.out.print("/>");
- break;
- case EXPRTOKEN_NUMBER:
- System.out.print("<NUMBER");
- System.out.print(" whole=\"" + getTokenString(fTokens[++i]) + "\"");
- System.out.print(" part=\"" + getTokenString(fTokens[++i]) + "\"");
- System.out.print("/>");
- break;
- case EXPRTOKEN_VARIABLE_REFERENCE:
- System.out.print("<VARIABLE_REFERENCE");
- if (fTokens[++i] != -1)
- System.out.print(" prefix=\"" + getTokenString(fTokens[i]) + "\"");
- System.out.print(" localpart=\"" + getTokenString(fTokens[++i]) + "\"");
- System.out.print("/>");
- break;
- default:
- System.out.println("<???/>");
- }
- }
- System.out.println();
- //}
- }
-
- } // class Tokens
-
- /**
- * @xerces.internal
- *
- * @author Glenn Marcy, IBM
- * @author Andy Clark, IBM
- *
- */
- private static class Scanner {
-
- /**
- * 7-bit ASCII subset
- *
- * 0 1 2 3 4 5 6 7 8 9 A B C D E F
- * 0, 0, 0, 0, 0, 0, 0, 0, 0, HT, LF, 0, 0, CR, 0, 0, // 0
- * 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 1
- * SP, !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, // 2
- * 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, :, ;, <, =, >, ?, // 3
- * @, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, // 4
- * P, Q, R, S, T, U, V, W, X, Y, Z, [, \, ], ^, _, // 5
- * `, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, // 6
- * p, q, r, s, t, u, v, w, x, y, z, {, |, }, ~, DEL // 7
- */
- private static final byte
- CHARTYPE_INVALID = 0, // invalid XML character
- CHARTYPE_OTHER = 1, // not special - one of "#%&;?\^`{}~" or DEL
- CHARTYPE_WHITESPACE = 2, // one of "\t\n\r " (0x09, 0x0A, 0x0D, 0x20)
- CHARTYPE_EXCLAMATION = 3, // '!' (0x21)
- CHARTYPE_QUOTE = 4, // '\"' or '\'' (0x22 and 0x27)
- CHARTYPE_DOLLAR = 5, // '$' (0x24)
- CHARTYPE_OPEN_PAREN = 6, // '(' (0x28)
- CHARTYPE_CLOSE_PAREN = 7, // ')' (0x29)
- CHARTYPE_STAR = 8, // '*' (0x2A)
- CHARTYPE_PLUS = 9, // '+' (0x2B)
- CHARTYPE_COMMA = 10, // ',' (0x2C)
- CHARTYPE_MINUS = 11, // '-' (0x2D)
- CHARTYPE_PERIOD = 12, // '.' (0x2E)
- CHARTYPE_SLASH = 13, // '/' (0x2F)
- CHARTYPE_DIGIT = 14, // '0'-'9' (0x30 to 0x39)
- CHARTYPE_COLON = 15, // ':' (0x3A)
- CHARTYPE_LESS = 16, // '<' (0x3C)
- CHARTYPE_EQUAL = 17, // '=' (0x3D)
- CHARTYPE_GREATER = 18, // '>' (0x3E)
- CHARTYPE_ATSIGN = 19, // '@' (0x40)
- CHARTYPE_LETTER = 20, // 'A'-'Z' or 'a'-'z' (0x41 to 0x5A and 0x61 to 0x7A)
- CHARTYPE_OPEN_BRACKET = 21, // '[' (0x5B)
- CHARTYPE_CLOSE_BRACKET = 22, // ']' (0x5D)
- CHARTYPE_UNDERSCORE = 23, // '_' (0x5F)
- CHARTYPE_UNION = 24, // '|' (0x7C)
- CHARTYPE_NONASCII = 25; // Non-ASCII Unicode codepoint (>= 0x80)
-
- private static final byte[] fASCIICharMap = {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 2, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 2, 3, 4, 1, 5, 1, 1, 4, 6, 7, 8, 9, 10, 11, 12, 13,
- 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 1, 16, 17, 18, 1,
- 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 1, 22, 1, 23,
- 1, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 1, 24, 1, 1, 1
- };
-
- /**
- * Symbol literals
- */
-
- //
- // Data
- //
-
- /** Symbol table. */
- private SymbolTable fSymbolTable;
-
- // symbols
-
- private static final String fAndSymbol = "and".intern();
- private static final String fOrSymbol = "or".intern();
- private static final String fModSymbol = "mod".intern();
- private static final String fDivSymbol = "div".intern();
-
- private static final String fCommentSymbol = "comment".intern();
- private static final String fTextSymbol = "text".intern();
- private static final String fPISymbol = "processing-instruction".intern();
- private static final String fNodeSymbol = "node".intern();
-
- private static final String fAncestorSymbol = "ancestor".intern();
- private static final String fAncestorOrSelfSymbol = "ancestor-or-self".intern();
- private static final String fAttributeSymbol = "attribute".intern();
- private static final String fChildSymbol = "child".intern();
- private static final String fDescendantSymbol = "descendant".intern();
- private static final String fDescendantOrSelfSymbol = "descendant-or-self".intern();
- private static final String fFollowingSymbol = "following".intern();
- private static final String fFollowingSiblingSymbol = "following-sibling".intern();
- private static final String fNamespaceSymbol = "namespace".intern();
- private static final String fParentSymbol = "parent".intern();
- private static final String fPrecedingSymbol = "preceding".intern();
- private static final String fPrecedingSiblingSymbol = "preceding-sibling".intern();
- private static final String fSelfSymbol = "self".intern();
-
- //
- // Constructors
- //
-
- /** Constructs an XPath expression scanner. */
- public Scanner(SymbolTable symbolTable) {
-
- // save pool and tokens
- fSymbolTable = symbolTable;
-
- } // <init>(SymbolTable)
-
- /**
- *
- */
- public boolean scanExpr(SymbolTable symbolTable,
- XPath.Tokens tokens, String data,
- int currentOffset, int endOffset)
- throws XPathException {
-
- int nameOffset;
- String nameHandle, prefixHandle;
- boolean starIsMultiplyOperator = false;
- int ch;
-
- while (true) {
- if (currentOffset == endOffset) {
- break;
- }
- ch = data.charAt(currentOffset);
- //
- // [39] ExprWhitespace ::= S
- //
- while (ch == ' ' || ch == 0x0A || ch == 0x09 || ch == 0x0D) {
- if (++currentOffset == endOffset) {
- break;
- }
- ch = data.charAt(currentOffset);
- }
- if (currentOffset == endOffset) {
- break;
- }
- //
- // [28] ExprToken ::= '(' | ')' | '[' | ']' | '.' | '..' | '@' | ',' | '::'
- // | NameTest | NodeType | Operator | FunctionName
- // | AxisName | Literal | Number | VariableReference
- //
- byte chartype = (ch >= 0x80) ? CHARTYPE_NONASCII : fASCIICharMap[ch];
- switch (chartype) {
- case CHARTYPE_OPEN_PAREN: // '('
- addToken(tokens, XPath.Tokens.EXPRTOKEN_OPEN_PAREN);
- starIsMultiplyOperator = false;
- if (++currentOffset == endOffset) {
- break;
- }
- break;
- case CHARTYPE_CLOSE_PAREN: // ')'
- addToken(tokens, XPath.Tokens.EXPRTOKEN_CLOSE_PAREN);
- starIsMultiplyOperator = true;
- if (++currentOffset == endOffset) {
- break;
- }
- break;
- case CHARTYPE_OPEN_BRACKET: // '['
- addToken(tokens, XPath.Tokens.EXPRTOKEN_OPEN_BRACKET);
- starIsMultiplyOperator = false;
- if (++currentOffset == endOffset) {
- break;
- }
- break;
- case CHARTYPE_CLOSE_BRACKET: // ']'
- addToken(tokens, XPath.Tokens.EXPRTOKEN_CLOSE_BRACKET);
- starIsMultiplyOperator = true;
- if (++currentOffset == endOffset) {
- break;
- }
- break;
- //
- // [30] Number ::= Digits ('.' Digits?)? | '.' Digits
- // ^^^^^^^^^^
- //
- case CHARTYPE_PERIOD: // '.', '..' or '.' Digits
- if (currentOffset + 1 == endOffset) {
- addToken(tokens, XPath.Tokens.EXPRTOKEN_PERIOD);
- starIsMultiplyOperator = true;
- currentOffset++;
- break;
- }
- ch = data.charAt(currentOffset + 1);
- if (ch == '.') { // '..'
- addToken(tokens, XPath.Tokens.EXPRTOKEN_DOUBLE_PERIOD);
- starIsMultiplyOperator = true;
- currentOffset += 2;
- } else if (ch >= '0' && ch <= '9') {
- addToken(tokens, XPath.Tokens.EXPRTOKEN_NUMBER);
- starIsMultiplyOperator = true;
- currentOffset = scanNumber(tokens, data, endOffset, currentOffset/*, encoding*/);
- } else if (ch == '/') {
- addToken(tokens, XPath.Tokens.EXPRTOKEN_PERIOD);
- starIsMultiplyOperator = true;
- currentOffset++;
- } else if (ch == '|') {
- addToken(tokens, XPath.Tokens.EXPRTOKEN_PERIOD);
- starIsMultiplyOperator = true;
- currentOffset++;
- break;
- } else if (ch == ' ' || ch == 0x0A || ch == 0x09 || ch == 0x0D) {
- // this is legal if the next token is non-existent or |
- do {
- if (++currentOffset == endOffset) {
- break;
- }
- ch = data.charAt(currentOffset);
- } while (ch == ' ' || ch == 0x0A || ch == 0x09 || ch == 0x0D);
- if (currentOffset == endOffset || ch == '|' || ch == '/') {
- addToken(tokens, XPath.Tokens.EXPRTOKEN_PERIOD);
- starIsMultiplyOperator = true;
- break;
- }
- throw new XPathException ("c-general-xpath");
- } else { // '.'
- throw new XPathException ("c-general-xpath");
- }
- if (currentOffset == endOffset) {
- break;
- }
- break;
- case CHARTYPE_ATSIGN: // '@'
- addToken(tokens, XPath.Tokens.EXPRTOKEN_ATSIGN);
- starIsMultiplyOperator = false;
- if (++currentOffset == endOffset) {
- break;
- }
- break;
- case CHARTYPE_COMMA: // ','
- addToken(tokens, XPath.Tokens.EXPRTOKEN_COMMA);
- starIsMultiplyOperator = false;
- if (++currentOffset == endOffset) {
- break;
- }
- break;
- case CHARTYPE_COLON: // '::'
- if (++currentOffset == endOffset) {
- // System.out.println("abort 1a");
- return false; // REVISIT
- }
- ch = data.charAt(currentOffset);
- if (ch != ':') {
- // System.out.println("abort 1b");
- return false; // REVISIT
- }
- addToken(tokens, XPath.Tokens.EXPRTOKEN_DOUBLE_COLON);
- starIsMultiplyOperator = false;
- if (++currentOffset == endOffset) {
- break;
- }
- break;
- case CHARTYPE_SLASH: // '/' and '//'
- if (++currentOffset == endOffset) {
- addToken(tokens, XPath.Tokens.EXPRTOKEN_OPERATOR_SLASH);
- starIsMultiplyOperator = false;
- break;
- }
- ch = data.charAt(currentOffset);
- if (ch == '/') { // '//'
- addToken(tokens, XPath.Tokens.EXPRTOKEN_OPERATOR_DOUBLE_SLASH);
- starIsMultiplyOperator = false;
- if (++currentOffset == endOffset) {
- break;
- }
- } else {
- addToken(tokens, XPath.Tokens.EXPRTOKEN_OPERATOR_SLASH);
- starIsMultiplyOperator = false;
- }
- break;
- case CHARTYPE_UNION: // '|'
- addToken(tokens, XPath.Tokens.EXPRTOKEN_OPERATOR_UNION);
- starIsMultiplyOperator = false;
- if (++currentOffset == endOffset) {
- break;
- }
- break;
- case CHARTYPE_PLUS: // '+'
- addToken(tokens, XPath.Tokens.EXPRTOKEN_OPERATOR_PLUS);
- starIsMultiplyOperator = false;
- if (++currentOffset == endOffset) {
- break;
- }
- break;
- case CHARTYPE_MINUS: // '-'
- addToken(tokens, XPath.Tokens.EXPRTOKEN_OPERATOR_MINUS);
- starIsMultiplyOperator = false;
- if (++currentOffset == endOffset) {
- break;
- }
- break;
- case CHARTYPE_EQUAL: // '='
- addToken(tokens, XPath.Tokens.EXPRTOKEN_OPERATOR_EQUAL);
- starIsMultiplyOperator = false;
- if (++currentOffset == endOffset) {
- break;
- }
- break;
- case CHARTYPE_EXCLAMATION: // '!='
- if (++currentOffset == endOffset) {
- // System.out.println("abort 2a");
- return false; // REVISIT
- }
- ch = data.charAt(currentOffset);
- if (ch != '=') {
- // System.out.println("abort 2b");
- return false; // REVISIT
- }
- addToken(tokens, XPath.Tokens.EXPRTOKEN_OPERATOR_NOT_EQUAL);
- starIsMultiplyOperator = false;
- if (++currentOffset == endOffset) {
- break;
- }
- break;
- case CHARTYPE_LESS: // '<' and '<='
- if (++currentOffset == endOffset) {
- addToken(tokens, XPath.Tokens.EXPRTOKEN_OPERATOR_LESS);
- starIsMultiplyOperator = false;
- break;
- }
- ch = data.charAt(currentOffset);
- if (ch == '=') { // '<='
- addToken(tokens, XPath.Tokens.EXPRTOKEN_OPERATOR_LESS_EQUAL);
- starIsMultiplyOperator = false;
- if (++currentOffset == endOffset) {
- break;
- }
- } else {
- addToken(tokens, XPath.Tokens.EXPRTOKEN_OPERATOR_LESS);
- starIsMultiplyOperator = false;
- }
- break;
- case CHARTYPE_GREATER: // '>' and '>='
- if (++currentOffset == endOffset) {
- addToken(tokens, XPath.Tokens.EXPRTOKEN_OPERATOR_GREATER);
- starIsMultiplyOperator = false;
- break;
- }
- ch = data.charAt(currentOffset);
- if (ch == '=') { // '>='
- addToken(tokens, XPath.Tokens.EXPRTOKEN_OPERATOR_GREATER_EQUAL);
- starIsMultiplyOperator = false;
- if (++currentOffset == endOffset) {
- break;
- }
- } else {
- addToken(tokens, XPath.Tokens.EXPRTOKEN_OPERATOR_GREATER);
- starIsMultiplyOperator = false;
- }
- break;
- //
- // [29] Literal ::= '"' [^"]* '"' | "'" [^']* "'"
- //
- case CHARTYPE_QUOTE: // '\"' or '\''
- int qchar = ch;
- if (++currentOffset == endOffset) {
- // System.out.println("abort 2c");
- return false; // REVISIT
- }
- ch = data.charAt(currentOffset);
- int litOffset = currentOffset;
- while (ch != qchar) {
- if (++currentOffset == endOffset) {
- // System.out.println("abort 2d");
- return false; // REVISIT
- }
- ch = data.charAt(currentOffset);
- }
- int litLength = currentOffset - litOffset;
- addToken(tokens, XPath.Tokens.EXPRTOKEN_LITERAL);
- starIsMultiplyOperator = true;
- tokens.addToken(symbolTable.addSymbol(data.substring(litOffset, litOffset + litLength)));
- if (++currentOffset == endOffset) {
- break;
- }
- break;
- //
- // [30] Number ::= Digits ('.' Digits?)? | '.' Digits
- // [31] Digits ::= [0-9]+
- //
- case CHARTYPE_DIGIT:
- addToken(tokens, XPath.Tokens.EXPRTOKEN_NUMBER);
- starIsMultiplyOperator = true;
- currentOffset = scanNumber(tokens, data, endOffset, currentOffset/*, encoding*/);
- break;
- //
- // [36] VariableReference ::= '$' QName
- //
- case CHARTYPE_DOLLAR:
- if (++currentOffset == endOffset) {
- // System.out.println("abort 3a");
- return false; // REVISIT
- }
- nameOffset = currentOffset;
- currentOffset = scanNCName(data, endOffset, currentOffset);
- if (currentOffset == nameOffset) {
- // System.out.println("abort 3b");
- return false; // REVISIT
- }
- if (currentOffset < endOffset) {
- ch = data.charAt(currentOffset);
- }
- else {
- ch = -1;
- }
- nameHandle = symbolTable.addSymbol(data.substring(nameOffset, currentOffset));
- if (ch != ':') {
- prefixHandle = XMLSymbols.EMPTY_STRING;
- } else {
- prefixHandle = nameHandle;
- if (++currentOffset == endOffset) {
- // System.out.println("abort 4a");
- return false; // REVISIT
- }
- nameOffset = currentOffset;
- currentOffset = scanNCName(data, endOffset, currentOffset);
- if (currentOffset == nameOffset) {
- // System.out.println("abort 4b");
- return false; // REVISIT
- }
- if (currentOffset < endOffset) {
- ch = data.charAt(currentOffset);
- }
- else {
- ch = -1;
- }
- nameHandle = symbolTable.addSymbol(data.substring(nameOffset, currentOffset));
- }
- addToken(tokens, XPath.Tokens.EXPRTOKEN_VARIABLE_REFERENCE);
- starIsMultiplyOperator = true;
- tokens.addToken(prefixHandle);
- tokens.addToken(nameHandle);
- break;
- //
- // [37] NameTest ::= '*' | NCName ':' '*' | QName
- // [34] MultiplyOperator ::= '*'
- //
- case CHARTYPE_STAR: // '*'
- //
- // 3.7 Lexical Structure
- //
- // If there is a preceding token and the preceding token is not one of @, ::, (, [, , or
- // an Operator, then a * must be recognized as a MultiplyOperator.
- //
- // Otherwise, the token must not be recognized as a MultiplyOperator.
- //
- if (starIsMultiplyOperator) {
- addToken(tokens, XPath.Tokens.EXPRTOKEN_OPERATOR_MULT);
- starIsMultiplyOperator = false;
- } else {
- addToken(tokens, XPath.Tokens.EXPRTOKEN_NAMETEST_ANY);
- starIsMultiplyOperator = true;
- }
- if (++currentOffset == endOffset) {
- break;
- }
- break;
- //
- // NCName, QName and non-terminals
- //
- case CHARTYPE_NONASCII: // possibly a valid non-ascii 'Letter' (BaseChar | Ideographic)
- case CHARTYPE_LETTER:
- case CHARTYPE_UNDERSCORE:
- //
- // 3.7 Lexical Structure
- //
- // If there is a preceding token and the preceding token is not one of @, ::, (, [, , or
- // an Operator, then an NCName must be recognized as an OperatorName.
- //
- // If the character following an NCName (possibly after intervening ExprWhitespace) is (,
- // then the token must be recognized as a NodeType or a FunctionName.
- //
- // If the two characters following an NCName (possibly after intervening ExprWhitespace)
- // are ::, then the token must be recognized as an AxisName.
- //
- // Otherwise, the token must not be recognized as an OperatorName, a NodeType, a
- // FunctionName, or an AxisName.
- //
- // [33] OperatorName ::= 'and' | 'or' | 'mod' | 'div'
- // [38] NodeType ::= 'comment' | 'text' | 'processing-instruction' | 'node'
- // [35] FunctionName ::= QName - NodeType
- // [6] AxisName ::= (see above)
- //
- // [37] NameTest ::= '*' | NCName ':' '*' | QName
- // [5] NCName ::= (Letter | '_') (NCNameChar)*
- // [?] NCNameChar ::= Letter | Digit | '.' | '-' | '_' (ascii subset of 'NCNameChar')
- // [?] QName ::= (NCName ':')? NCName
- // [?] Letter ::= [A-Za-z] (ascii subset of 'Letter')
- // [?] Digit ::= [0-9] (ascii subset of 'Digit')
- //
- nameOffset = currentOffset;
- currentOffset = scanNCName(data, endOffset, currentOffset);
- if (currentOffset == nameOffset) {
- // System.out.println("abort 4c");
- return false; // REVISIT
- }
- if (currentOffset < endOffset) {
- ch = data.charAt(currentOffset);
- }
- else {
- ch = -1;
- }
- nameHandle = symbolTable.addSymbol(data.substring(nameOffset, currentOffset));
- boolean isNameTestNCName = false;
- boolean isAxisName = false;
- prefixHandle = XMLSymbols.EMPTY_STRING;
- if (ch == ':') {
- if (++currentOffset == endOffset) {
- // System.out.println("abort 5");
- return false; // REVISIT
- }
- ch = data.charAt(currentOffset);
- if (ch == '*') {
- if (++currentOffset < endOffset) {
- ch = data.charAt(currentOffset);
- }
- isNameTestNCName = true;
- } else if (ch == ':') {
- if (++currentOffset < endOffset) {
- ch = data.charAt(currentOffset);
- }
- isAxisName = true;
- } else {
- prefixHandle = nameHandle;
- nameOffset = currentOffset;
- currentOffset = scanNCName(data, endOffset, currentOffset);
- if (currentOffset == nameOffset) {
- // System.out.println("abort 5b");
- return false; // REVISIT
- }
- if (currentOffset < endOffset) {
- ch = data.charAt(currentOffset);
- }
- else {
- ch = -1;
- }
- nameHandle = symbolTable.addSymbol(data.substring(nameOffset, currentOffset));
- }
- }
- //
- // [39] ExprWhitespace ::= S
- //
- while (ch == ' ' || ch == 0x0A || ch == 0x09 || ch == 0x0D) {
- if (++currentOffset == endOffset) {
- break;
- }
- ch = data.charAt(currentOffset);
- }
- //
- // If there is a preceding token and the preceding token is not one of @, ::, (, [, , or
- // an Operator, then an NCName must be recognized as an OperatorName.
- //
- if (starIsMultiplyOperator) {
- if (nameHandle == fAndSymbol) {
- addToken(tokens, XPath.Tokens.EXPRTOKEN_OPERATOR_AND);
- starIsMultiplyOperator = false;
- } else if (nameHandle == fOrSymbol) {
- addToken(tokens, XPath.Tokens.EXPRTOKEN_OPERATOR_OR);
- starIsMultiplyOperator = false;
- } else if (nameHandle == fModSymbol) {
- addToken(tokens, XPath.Tokens.EXPRTOKEN_OPERATOR_MOD);
- starIsMultiplyOperator = false;
- } else if (nameHandle == fDivSymbol) {
- addToken(tokens, XPath.Tokens.EXPRTOKEN_OPERATOR_DIV);
- starIsMultiplyOperator = false;
- } else {
- // System.out.println("abort 6");
- return false; // REVISIT
- }
- if (isNameTestNCName) {
- // System.out.println("abort 7");
- return false; // REVISIT - NCName:* where an OperatorName is required
- } else if (isAxisName) {
- // System.out.println("abort 8");
- return false; // REVISIT - AxisName:: where an OperatorName is required
- }
- break;
- }
- //
- // If the character following an NCName (possibly after intervening ExprWhitespace) is (,
- // then the token must be recognized as a NodeType or a FunctionName.
- //
- if (ch == '(' && !isNameTestNCName && !isAxisName) {
- if (nameHandle == fCommentSymbol) {
- addToken(tokens, XPath.Tokens.EXPRTOKEN_NODETYPE_COMMENT);
- } else if (nameHandle == fTextSymbol) {
- addToken(tokens, XPath.Tokens.EXPRTOKEN_NODETYPE_TEXT);
- } else if (nameHandle == fPISymbol) {
- addToken(tokens, XPath.Tokens.EXPRTOKEN_NODETYPE_PI);
- } else if (nameHandle == fNodeSymbol) {
- addToken(tokens, XPath.Tokens.EXPRTOKEN_NODETYPE_NODE);
- } else {
- addToken(tokens, XPath.Tokens.EXPRTOKEN_FUNCTION_NAME);
- tokens.addToken(prefixHandle);
- tokens.addToken(nameHandle);
- }
- addToken(tokens, XPath.Tokens.EXPRTOKEN_OPEN_PAREN);
- starIsMultiplyOperator = false;
- if (++currentOffset == endOffset) {
- break;
- }
- break;
- }
- //
- // If the two characters following an NCName (possibly after intervening ExprWhitespace)
- // are ::, then the token must be recognized as an AxisName.
- //
- if (isAxisName ||
- (ch == ':' && currentOffset + 1 < endOffset &&
- data.charAt(currentOffset + 1) == ':')) {
- if (nameHandle == fAncestorSymbol) {
- addToken(tokens, XPath.Tokens.EXPRTOKEN_AXISNAME_ANCESTOR);
- } else if (nameHandle == fAncestorOrSelfSymbol) {
- addToken(tokens, XPath.Tokens.EXPRTOKEN_AXISNAME_ANCESTOR_OR_SELF);
- } else if (nameHandle == fAttributeSymbol) {
- addToken(tokens, XPath.Tokens.EXPRTOKEN_AXISNAME_ATTRIBUTE);
- } else if (nameHandle == fChildSymbol) {
- addToken(tokens, XPath.Tokens.EXPRTOKEN_AXISNAME_CHILD);
- } else if (nameHandle == fDescendantSymbol) {
- addToken(tokens, XPath.Tokens.EXPRTOKEN_AXISNAME_DESCENDANT);
- } else if (nameHandle == fDescendantOrSelfSymbol) {
- addToken(tokens, XPath.Tokens.EXPRTOKEN_AXISNAME_DESCENDANT_OR_SELF);
- } else if (nameHandle == fFollowingSymbol) {
- addToken(tokens, XPath.Tokens.EXPRTOKEN_AXISNAME_FOLLOWING);
- } else if (nameHandle == fFollowingSiblingSymbol) {
- addToken(tokens, XPath.Tokens.EXPRTOKEN_AXISNAME_FOLLOWING_SIBLING);
- } else if (nameHandle == fNamespaceSymbol) {
- addToken(tokens, XPath.Tokens.EXPRTOKEN_AXISNAME_NAMESPACE);
- } else if (nameHandle == fParentSymbol) {
- addToken(tokens, XPath.Tokens.EXPRTOKEN_AXISNAME_PARENT);
- } else if (nameHandle == fPrecedingSymbol) {
- addToken(tokens, XPath.Tokens.EXPRTOKEN_AXISNAME_PRECEDING);
- } else if (nameHandle == fPrecedingSiblingSymbol) {
- addToken(tokens, XPath.Tokens.EXPRTOKEN_AXISNAME_PRECEDING_SIBLING);
- } else if (nameHandle == fSelfSymbol) {
- addToken(tokens, XPath.Tokens.EXPRTOKEN_AXISNAME_SELF);
- } else {
- // System.out.println("abort 9");
- return false; // REVISIT
- }
- if (isNameTestNCName) {
- // System.out.println("abort 10");
- return false; // REVISIT - "NCName:* ::" where "AxisName ::" is required
- }
- addToken(tokens, XPath.Tokens.EXPRTOKEN_DOUBLE_COLON);
- starIsMultiplyOperator = false;
- if (!isAxisName) {
- currentOffset++;
- if (++currentOffset == endOffset) {
- break;
- }
- }
- break;
- }
- //
- // Otherwise, the token must not be recognized as an OperatorName, a NodeType, a
- // FunctionName, or an AxisName.
- //
- if (isNameTestNCName) {
- addToken(tokens, XPath.Tokens.EXPRTOKEN_NAMETEST_NAMESPACE);
- starIsMultiplyOperator = true;
- tokens.addToken(nameHandle);
- } else {
- addToken(tokens, XPath.Tokens.EXPRTOKEN_NAMETEST_QNAME);
- starIsMultiplyOperator = true;
- tokens.addToken(prefixHandle);
- tokens.addToken(nameHandle);
- }
- break;
- }
- }
- if (XPath.Tokens.DUMP_TOKENS) {
- tokens.dumpTokens();
- }
- return true;
- }
- //
- // [5] NCName ::= (Letter | '_') (NCNameChar)*
- // [6] NCNameChar ::= Letter | Digit | '.' | '-' | '_' | CombiningChar | Extender
- //
- int scanNCName(String data, int endOffset, int currentOffset) {
- int ch = data.charAt(currentOffset);
- if (ch >= 0x80) {
- if (!XMLChar.isNameStart(ch))
- /*** // REVISIT: Make sure this is a negation. ***
- if ((XMLCharacterProperties.fgCharFlags[ch] &
- XMLCharacterProperties.E_InitialNameCharFlag) == 0)
- /***/
- {
- return currentOffset;
- }
- }
- else {
- byte chartype = fASCIICharMap[ch];
- if (chartype != CHARTYPE_LETTER && chartype != CHARTYPE_UNDERSCORE) {
- return currentOffset;
- }
- }
- while (++currentOffset < endOffset) {
- ch = data.charAt(currentOffset);
- if (ch >= 0x80) {
- if (!XMLChar.isName(ch))
- /*** // REVISIT: Make sure this is a negation. ***
- if ((XMLCharacterProperties.fgCharFlags[ch] &
- XMLCharacterProperties.E_NameCharFlag) == 0)
- /***/
- {
- break;
- }
- }
- else {
- byte chartype = fASCIICharMap[ch];
- if (chartype != CHARTYPE_LETTER && chartype != CHARTYPE_DIGIT &&
- chartype != CHARTYPE_PERIOD && chartype != CHARTYPE_MINUS &&
- chartype != CHARTYPE_UNDERSCORE)
- {
- break;
- }
- }
- }
- return currentOffset;
- }
- //
- // [30] Number ::= Digits ('.' Digits?)? | '.' Digits
- // [31] Digits ::= [0-9]+
- //
- private int scanNumber(XPath.Tokens tokens, String/*byte[]*/ data, int endOffset, int currentOffset/*, EncodingSupport encoding*/) {
- int ch = data.charAt(currentOffset);
- int whole = 0;
- int part = 0;
- while (ch >= '0' && ch <= '9') {
- whole = (whole * 10) + (ch - '0');
- if (++currentOffset == endOffset) {
- break;
- }
- ch = data.charAt(currentOffset);
- }
- if (ch == '.') {
- if (++currentOffset < endOffset) {
- /** int start = currentOffset; **/
- ch = data.charAt(currentOffset);
- while (ch >= '0' && ch <= '9') {
- part = (part * 10) + (ch - '0');
- if (++currentOffset == endOffset) {
- break;
- }
- ch = data.charAt(currentOffset);
- }
- if (part != 0) {
- /***
- part = tokens.addSymbol(data, start, currentOffset - start, encoding);
- /***/
- throw new RuntimeException("find a solution!");
- //part = fStringPool.addSymbol(data.substring(start, currentOffset));
- /***/
- }
- }
- }
- tokens.addToken(whole);
- tokens.addToken(part);
- return currentOffset;
- }
-
- //
- // Protected methods
- //
-
- /**
- * This method adds the specified token to the token list. By
- * default, this method allows all tokens. However, subclasses
- * of the XPathExprScanner can override this method in order
- * to disallow certain tokens from being used in the scanned
- * XPath expression. This is a convenient way of allowing only
- * a subset of XPath.
- */
- protected void addToken(XPath.Tokens tokens, int token)
- throws XPathException {
- tokens.addToken(token);
- } // addToken(int)
-
- } // class Scanner
-
- //
- // MAIN
- //
-
- /** Main program entry. */
- public static void main(String[] argv) throws Exception {
-
- for (int i = 0; i < argv.length; i++) {
- final String expression = argv[i];
- System.out.println("# XPath expression: \""+expression+'"');
- try {
- SymbolTable symbolTable = new SymbolTable();
- XPath xpath = new XPath(expression, symbolTable, null);
- System.out.println("expanded xpath: \""+xpath.toString()+'"');
- }
- catch (XPathException e) {
- System.out.println("error: "+e.getMessage());
- }
- }
-
- } // main(String[])
-
-} // class XPath
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xpath/XPathException.java b/src/com/sun/org/apache/xerces/internal/impl/xpath/XPathException.java
deleted file mode 100644
index 5e68d8b..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xpath/XPathException.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xpath;
-
-/**
- * XPath exception.
- *
- * @xerces.internal
- *
- * @author Andy Clark, IBM
- *
- */
-public class XPathException
- extends Exception {
-
- /** Serialization version. */
- static final long serialVersionUID = -948482312169512085L;
-
- // Data
-
- // hold the value of the key this Exception refers to.
- private String fKey;
- //
- // Constructors
- //
-
- /** Constructs an exception. */
- public XPathException() {
- super();
- fKey = "c-general-xpath";
- } // <init>()
-
- /** Constructs an exception with the specified key. */
- public XPathException(String key) {
- super();
- fKey = key;
- } // <init>(String)
-
- public String getKey() {
- return fKey;
- } // getKey(): String
-
-} // class XPathException
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/BMPattern.java b/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/BMPattern.java
deleted file mode 100644
index 5fd796a..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/BMPattern.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xpath.regex;
-
-import java.text.CharacterIterator;
-
-/**
- * Boyer-Moore searcher.
- *
- * @xerces.internal
- *
- */
-public class BMPattern {
- char[] pattern;
- int[] shiftTable;
- boolean ignoreCase;
-
- public BMPattern(String pat, boolean ignoreCase) {
- this(pat, 256, ignoreCase);
- }
-
- public BMPattern(String pat, int tableSize, boolean ignoreCase) {
- this.pattern = pat.toCharArray();
- this.shiftTable = new int[tableSize];
- this.ignoreCase = ignoreCase;
-
- int length = pattern.length;
- for (int i = 0; i < this.shiftTable.length; i ++)
- this.shiftTable[i] = length;
-
- for (int i = 0; i < length; i ++) {
- char ch = this.pattern[i];
- int diff = length-i-1;
- int index = ch % this.shiftTable.length;
- if (diff < this.shiftTable[index])
- this.shiftTable[index] = diff;
- if (this.ignoreCase) {
- ch = Character.toUpperCase(ch);
- index = ch % this.shiftTable.length;
- if (diff < this.shiftTable[index])
- this.shiftTable[index] = diff;
- ch = Character.toLowerCase(ch);
- index = ch % this.shiftTable.length;
- if (diff < this.shiftTable[index])
- this.shiftTable[index] = diff;
- }
- }
- }
-
- /**
- *
- * @return -1 if <var>iterator</var> does not contain this pattern.
- */
- public int matches(CharacterIterator iterator, int start, int limit) {
- if (this.ignoreCase) return this.matchesIgnoreCase(iterator, start, limit);
- int plength = this.pattern.length;
- if (plength == 0) return start;
- int index = start+plength;
- while (index <= limit) {
- int pindex = plength;
- int nindex = index+1;
- char ch;
- do {
- if ((ch = iterator.setIndex(--index)) != this.pattern[--pindex])
- break;
- if (pindex == 0)
- return index;
- } while (pindex > 0);
- index += this.shiftTable[ch % this.shiftTable.length]+1;
- if (index < nindex) index = nindex;
- }
- return -1;
- }
-
- /**
- *
- * @return -1 if <var>str</var> does not contain this pattern.
- */
- public int matches(String str, int start, int limit) {
- if (this.ignoreCase) return this.matchesIgnoreCase(str, start, limit);
- int plength = this.pattern.length;
- if (plength == 0) return start;
- int index = start+plength;
- while (index <= limit) {
- //System.err.println("Starts at "+index);
- int pindex = plength;
- int nindex = index+1;
- char ch;
- do {
- if ((ch = str.charAt(--index)) != this.pattern[--pindex])
- break;
- if (pindex == 0)
- return index;
- } while (pindex > 0);
- index += this.shiftTable[ch % this.shiftTable.length]+1;
- if (index < nindex) index = nindex;
- }
- return -1;
- }
- /**
- *
- * @return -1 if <var>chars</char> does not contain this pattern.
- */
- public int matches(char[] chars, int start, int limit) {
- if (this.ignoreCase) return this.matchesIgnoreCase(chars, start, limit);
- int plength = this.pattern.length;
- if (plength == 0) return start;
- int index = start+plength;
- while (index <= limit) {
- //System.err.println("Starts at "+index);
- int pindex = plength;
- int nindex = index+1;
- char ch;
- do {
- if ((ch = chars[--index]) != this.pattern[--pindex])
- break;
- if (pindex == 0)
- return index;
- } while (pindex > 0);
- index += this.shiftTable[ch % this.shiftTable.length]+1;
- if (index < nindex) index = nindex;
- }
- return -1;
- }
-
- int matchesIgnoreCase(CharacterIterator iterator, int start, int limit) {
- int plength = this.pattern.length;
- if (plength == 0) return start;
- int index = start+plength;
- while (index <= limit) {
- int pindex = plength;
- int nindex = index+1;
- char ch;
- do {
- char ch1 = ch = iterator.setIndex(--index);
- char ch2 = this.pattern[--pindex];
- if (ch1 != ch2) {
- ch1 = Character.toUpperCase(ch1);
- ch2 = Character.toUpperCase(ch2);
- if (ch1 != ch2 && Character.toLowerCase(ch1) != Character.toLowerCase(ch2))
- break;
- }
- if (pindex == 0)
- return index;
- } while (pindex > 0);
- index += this.shiftTable[ch % this.shiftTable.length]+1;
- if (index < nindex) index = nindex;
- }
- return -1;
- }
-
- int matchesIgnoreCase(String text, int start, int limit) {
- int plength = this.pattern.length;
- if (plength == 0) return start;
- int index = start+plength;
- while (index <= limit) {
- int pindex = plength;
- int nindex = index+1;
- char ch;
- do {
- char ch1 = ch = text.charAt(--index);
- char ch2 = this.pattern[--pindex];
- if (ch1 != ch2) {
- ch1 = Character.toUpperCase(ch1);
- ch2 = Character.toUpperCase(ch2);
- if (ch1 != ch2 && Character.toLowerCase(ch1) != Character.toLowerCase(ch2))
- break;
- }
- if (pindex == 0)
- return index;
- } while (pindex > 0);
- index += this.shiftTable[ch % this.shiftTable.length]+1;
- if (index < nindex) index = nindex;
- }
- return -1;
- }
- int matchesIgnoreCase(char[] chars, int start, int limit) {
- int plength = this.pattern.length;
- if (plength == 0) return start;
- int index = start+plength;
- while (index <= limit) {
- int pindex = plength;
- int nindex = index+1;
- char ch;
- do {
- char ch1 = ch = chars[--index];
- char ch2 = this.pattern[--pindex];
- if (ch1 != ch2) {
- ch1 = Character.toUpperCase(ch1);
- ch2 = Character.toUpperCase(ch2);
- if (ch1 != ch2 && Character.toLowerCase(ch1) != Character.toLowerCase(ch2))
- break;
- }
- if (pindex == 0)
- return index;
- } while (pindex > 0);
- index += this.shiftTable[ch % this.shiftTable.length]+1;
- if (index < nindex) index = nindex;
- }
- return -1;
- }
-
- /*
- public static void main(String[] argv) {
- try {
- int[] shiftTable = new int[256];
- initializeBoyerMoore(argv[0], shiftTable, true);
- int o = -1;
- CharacterIterator ite = new java.text.StringCharacterIterator(argv[1]);
- long start = System.currentTimeMillis();
- //for (int i = 0; i < 10000; i ++)
- o = searchIgnoreCasesWithBoyerMoore(ite, 0, argv[0], shiftTable);
- start = System.currentTimeMillis()-start;
- System.out.println("Result: "+o+", Elapsed: "+start);
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }*/
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/CaseInsensitiveMap.java b/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/CaseInsensitiveMap.java
deleted file mode 100644
index 202f239..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/CaseInsensitiveMap.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xpath.regex;
-
-/**
- * @version $Id: CaseInsensitiveMap.java,v 1.1 2010/07/27 06:29:27 joehw Exp $
- */
-
-public class CaseInsensitiveMap {
-
- private static int CHUNK_SHIFT = 10; /* 2^10 = 1k */
- private static int CHUNK_SIZE = (1<<CHUNK_SHIFT);
- private static int CHUNK_MASK = (CHUNK_SIZE-1);
- private static int INITIAL_CHUNK_COUNT = 64; /* up to 0xFFFF */
-
- private static int[][][] caseInsensitiveMap;
- private static Boolean mapBuilt = Boolean.FALSE;
-
- private static int LOWER_CASE_MATCH = 1;
- private static int UPPER_CASE_MATCH = 2;
-
- /**
- * Return a list of code point characters (not including the input value)
- * that can be substituted in a case insensitive match
- */
- static public int[] get(int codePoint) {
- if (mapBuilt == Boolean.FALSE) {
- synchronized (mapBuilt) {
- if (mapBuilt == Boolean.FALSE) {
- buildCaseInsensitiveMap();
- }
- } // synchronized
- } // if mapBuilt
-
- return (codePoint < 0x10000) ? getMapping(codePoint) : null;
- }
-
- private static int[] getMapping(int codePoint) {
- int chunk = codePoint >>> CHUNK_SHIFT;
- int offset = codePoint & CHUNK_MASK;
-
- return caseInsensitiveMap[chunk][offset];
- }
-
- private static void buildCaseInsensitiveMap() {
- caseInsensitiveMap = new int[INITIAL_CHUNK_COUNT][][];
- for (int i=0; i<INITIAL_CHUNK_COUNT; i++) {
- caseInsensitiveMap[i] = new int[CHUNK_SIZE][];
- }
-
- int lc, uc;
- for (int i=0; i<0x10000; i++) {
- lc = Character.toLowerCase(i);
- uc = Character.toUpperCase(i);
-
- // lower/upper case value is not the same as code point
- if (lc != uc || lc != i) {
- int[] map = new int[2];
- int index = 0;
-
- if (lc != i) {
- map[index++] = lc;
- map[index++] = LOWER_CASE_MATCH;
- int[] lcMap = getMapping(lc);
- if (lcMap != null) {
- map = updateMap(i, map, lc, lcMap, LOWER_CASE_MATCH);
- }
- }
-
- if (uc != i) {
- if (index == map.length) {
- map = expandMap(map, 2);
- }
- map[index++] = uc;
- map[index++] = UPPER_CASE_MATCH;
- int[] ucMap = getMapping(uc);
- if (ucMap != null) {
- map = updateMap(i, map, uc, ucMap, UPPER_CASE_MATCH);
- }
- }
-
- set(i, map);
- }
- }
-
- mapBuilt = Boolean.TRUE;
- }
-
- private static int[] expandMap(int[] srcMap, int expandBy) {
- final int oldLen = srcMap.length;
- int[] newMap = new int[oldLen + expandBy];
-
- System.arraycopy(srcMap, 0, newMap, 0, oldLen);
- return newMap;
- }
-
- private static void set(int codePoint, int[] map) {
- int chunk = codePoint >>> CHUNK_SHIFT;
- int offset = codePoint & CHUNK_MASK;
-
- caseInsensitiveMap[chunk][offset] = map;
- }
-
- private static int[] updateMap(int codePoint, int[] codePointMap,
- int ciCodePoint, int[] ciCodePointMap, int matchType) {
- for (int i=0; i<ciCodePointMap.length; i+=2) {
- int c = ciCodePointMap[i];
- int[] cMap = getMapping(c);
- if (cMap != null) {
- if (contains(cMap, ciCodePoint, matchType)) {
- if (!contains(cMap, codePoint)) {
- cMap = expandAndAdd(cMap, codePoint, matchType);
- set(c, cMap);
- }
- if (!contains(codePointMap, c)) {
- codePointMap = expandAndAdd(codePointMap, c,matchType);
- }
- }
- }
- }
-
- if (!contains(ciCodePointMap, codePoint)) {
- ciCodePointMap = expandAndAdd(ciCodePointMap, codePoint, matchType);
- set(ciCodePoint, ciCodePointMap);
- }
-
- return codePointMap;
- }
-
- private static boolean contains(int[] map, int codePoint) {
- for (int i=0; i<map.length; i += 2) {
- if (map[i] == codePoint) {
- return true;
- }
- }
- return false;
- }
-
- private static boolean contains(int[] map, int codePoint, int matchType) {
- for (int i=0; i<map.length; i += 2) {
- if (map[i] == codePoint && map[i+1] == matchType) {
- return true;
- }
- }
- return false;
- }
-
- private static int[] expandAndAdd(int[] srcMap, int codePoint, int matchType) {
- final int oldLen = srcMap.length;
- int[] newMap = new int[oldLen + 2];
-
- System.arraycopy(srcMap, 0, newMap, 0, oldLen);
- newMap[oldLen] = codePoint;
- newMap[oldLen+1] = matchType;
- return newMap;
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/Match.java b/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/Match.java
deleted file mode 100644
index ece6c83..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/Match.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xpath.regex;
-
-import java.text.CharacterIterator;
-
-/**
- * An instance of this class has ranges captured in matching.
- *
- * @xerces.internal
- *
- * @see RegularExpression#matches(char[], int, int, Match)
- * @see RegularExpression#matches(char[], Match)
- * @see RegularExpression#matches(java.text.CharacterIterator, Match)
- * @see RegularExpression#matches(java.lang.String, int, int, Match)
- * @see RegularExpression#matches(java.lang.String, Match)
- * @author TAMURA Kent &lt;kent@trl.ibm.co.jp&gt;
- */
-public class Match implements Cloneable {
- int[] beginpos = null;
- int[] endpos = null;
- int nofgroups = 0;
-
- CharacterIterator ciSource = null;
- String strSource = null;
- char[] charSource = null;
-
- /**
- * Creates an instance.
- */
- public Match() {
- }
-
- /**
- *
- */
- public synchronized Object clone() {
- Match ma = new Match();
- if (this.nofgroups > 0) {
- ma.setNumberOfGroups(this.nofgroups);
- if (this.ciSource != null) ma.setSource(this.ciSource);
- if (this.strSource != null) ma.setSource(this.strSource);
- for (int i = 0; i < this.nofgroups; i ++) {
- ma.setBeginning(i, this.getBeginning(i));
- ma.setEnd(i, this.getEnd(i));
- }
- }
- return ma;
- }
-
- /**
- *
- */
- protected void setNumberOfGroups(int n) {
- int oldn = this.nofgroups;
- this.nofgroups = n;
- if (oldn <= 0
- || oldn < n || n*2 < oldn) {
- this.beginpos = new int[n];
- this.endpos = new int[n];
- }
- for (int i = 0; i < n; i ++) {
- this.beginpos[i] = -1;
- this.endpos[i] = -1;
- }
- }
-
- /**
- *
- */
- protected void setSource(CharacterIterator ci) {
- this.ciSource = ci;
- this.strSource = null;
- this.charSource = null;
- }
- /**
- *
- */
- protected void setSource(String str) {
- this.ciSource = null;
- this.strSource = str;
- this.charSource = null;
- }
- /**
- *
- */
- protected void setSource(char[] chars) {
- this.ciSource = null;
- this.strSource = null;
- this.charSource = chars;
- }
-
- /**
- *
- */
- protected void setBeginning(int index, int v) {
- this.beginpos[index] = v;
- }
-
- /**
- *
- */
- protected void setEnd(int index, int v) {
- this.endpos[index] = v;
- }
-
- /**
- * Return the number of regular expression groups.
- * This method returns 1 when the regular expression has no capturing-parenthesis.
- */
- public int getNumberOfGroups() {
- if (this.nofgroups <= 0)
- throw new IllegalStateException("A result is not set.");
- return this.nofgroups;
- }
-
- /**
- * Return a start position in the target text matched to specified regular expression group.
- *
- * @param index Less than <code>getNumberOfGroups()</code>.
- */
- public int getBeginning(int index) {
- if (this.beginpos == null)
- throw new IllegalStateException("A result is not set.");
- if (index < 0 || this.nofgroups <= index)
- throw new IllegalArgumentException("The parameter must be less than "
- +this.nofgroups+": "+index);
- return this.beginpos[index];
- }
-
- /**
- * Return an end position in the target text matched to specified regular expression group.
- *
- * @param index Less than <code>getNumberOfGroups()</code>.
- */
- public int getEnd(int index) {
- if (this.endpos == null)
- throw new IllegalStateException("A result is not set.");
- if (index < 0 || this.nofgroups <= index)
- throw new IllegalArgumentException("The parameter must be less than "
- +this.nofgroups+": "+index);
- return this.endpos[index];
- }
-
- /**
- * Return an substring of the target text matched to specified regular expression group.
- *
- * @param index Less than <code>getNumberOfGroups()</code>.
- */
- public String getCapturedText(int index) {
- if (this.beginpos == null)
- throw new IllegalStateException("match() has never been called.");
- if (index < 0 || this.nofgroups <= index)
- throw new IllegalArgumentException("The parameter must be less than "
- +this.nofgroups+": "+index);
- String ret;
- int begin = this.beginpos[index], end = this.endpos[index];
- if (begin < 0 || end < 0) return null;
- if (this.ciSource != null) {
- ret = REUtil.substring(this.ciSource, begin, end);
- } else if (this.strSource != null) {
- ret = this.strSource.substring(begin, end);
- } else {
- ret = new String(this.charSource, begin, end-begin);
- }
- return ret;
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/Op.java b/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/Op.java
deleted file mode 100644
index 372242f..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/Op.java
+++ /dev/null
@@ -1,254 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xpath.regex;
-
-import java.util.Vector;
-
-/**
- * @xerces.internal
- *
- */
-class Op {
- static final int DOT = 0;
- static final int CHAR = 1; // Single character
- static final int RANGE = 3; // [a-zA-Z]
- static final int NRANGE = 4; // [^a-zA-Z]
- static final int ANCHOR = 5; // ^ $ ...
- static final int STRING = 6; // literal String
- static final int CLOSURE = 7; // X*
- static final int NONGREEDYCLOSURE = 8; // X*?
- static final int QUESTION = 9; // X?
- static final int NONGREEDYQUESTION = 10; // X??
- static final int UNION = 11; // X|Y
- static final int CAPTURE = 15; // ( and )
- static final int BACKREFERENCE = 16; // \1 \2 ...
- static final int LOOKAHEAD = 20; // (?=...)
- static final int NEGATIVELOOKAHEAD = 21; // (?!...)
- static final int LOOKBEHIND = 22; // (?<=...)
- static final int NEGATIVELOOKBEHIND = 23; // (?<!...)
- static final int INDEPENDENT = 24; // (?>...)
- static final int MODIFIER = 25; // (?ims-ims:...)
- static final int CONDITION = 26; // (?(..)yes|no)
-
- static int nofinstances = 0;
- static final boolean COUNT = false;
-
- static Op createDot() {
- if (Op.COUNT) Op.nofinstances ++;
- return new Op(Op.DOT);
- }
- static CharOp createChar(int data) {
- if (Op.COUNT) Op.nofinstances ++;
- return new CharOp(Op.CHAR, data);
- }
- static CharOp createAnchor(int data) {
- if (Op.COUNT) Op.nofinstances ++;
- return new CharOp(Op.ANCHOR, data);
- }
- static CharOp createCapture(int number, Op next) {
- if (Op.COUNT) Op.nofinstances ++;
- CharOp op = new CharOp(Op.CAPTURE, number);
- op.next = next;
- return op;
- }
- static UnionOp createUnion(int size) {
- if (Op.COUNT) Op.nofinstances ++;
- //System.err.println("Creates UnionOp");
- return new UnionOp(Op.UNION, size);
- }
- static ChildOp createClosure(int id) {
- if (Op.COUNT) Op.nofinstances ++;
- return new ModifierOp(Op.CLOSURE, id, -1);
- }
- static ChildOp createNonGreedyClosure() {
- if (Op.COUNT) Op.nofinstances ++;
- return new ChildOp(Op.NONGREEDYCLOSURE);
- }
- static ChildOp createQuestion(boolean nongreedy) {
- if (Op.COUNT) Op.nofinstances ++;
- return new ChildOp(nongreedy ? Op.NONGREEDYQUESTION : Op.QUESTION);
- }
- static RangeOp createRange(Token tok) {
- if (Op.COUNT) Op.nofinstances ++;
- return new RangeOp(Op.RANGE, tok);
- }
- static ChildOp createLook(int type, Op next, Op branch) {
- if (Op.COUNT) Op.nofinstances ++;
- ChildOp op = new ChildOp(type);
- op.setChild(branch);
- op.next = next;
- return op;
- }
- static CharOp createBackReference(int refno) {
- if (Op.COUNT) Op.nofinstances ++;
- return new CharOp(Op.BACKREFERENCE, refno);
- }
- static StringOp createString(String literal) {
- if (Op.COUNT) Op.nofinstances ++;
- return new StringOp(Op.STRING, literal);
- }
- static ChildOp createIndependent(Op next, Op branch) {
- if (Op.COUNT) Op.nofinstances ++;
- ChildOp op = new ChildOp(Op.INDEPENDENT);
- op.setChild(branch);
- op.next = next;
- return op;
- }
- static ModifierOp createModifier(Op next, Op branch, int add, int mask) {
- if (Op.COUNT) Op.nofinstances ++;
- ModifierOp op = new ModifierOp(Op.MODIFIER, add, mask);
- op.setChild(branch);
- op.next = next;
- return op;
- }
- static ConditionOp createCondition(Op next, int ref, Op conditionflow, Op yesflow, Op noflow) {
- if (Op.COUNT) Op.nofinstances ++;
- ConditionOp op = new ConditionOp(Op.CONDITION, ref, conditionflow, yesflow, noflow);
- op.next = next;
- return op;
- }
-
- int type;
- Op next = null;
-
- protected Op(int type) {
- this.type = type;
- }
-
- int size() { // for UNION
- return 0;
- }
- Op elementAt(int index) { // for UNIoN
- throw new RuntimeException("Internal Error: type="+this.type);
- }
- Op getChild() { // for CLOSURE, QUESTION
- throw new RuntimeException("Internal Error: type="+this.type);
- }
- // ModifierOp
- int getData() { // CharOp for CHAR, BACKREFERENCE, CAPTURE, ANCHOR,
- throw new RuntimeException("Internal Error: type="+this.type);
- }
- int getData2() { // ModifierOp
- throw new RuntimeException("Internal Error: type="+this.type);
- }
- RangeToken getToken() { // RANGE, NRANGE
- throw new RuntimeException("Internal Error: type="+this.type);
- }
- String getString() { // STRING
- throw new RuntimeException("Internal Error: type="+this.type);
- }
-
- // ================================================================
- static class CharOp extends Op {
- int charData;
- CharOp(int type, int data) {
- super(type);
- this.charData = data;
- }
- int getData() {
- return this.charData;
- }
- }
-
- // ================================================================
- static class UnionOp extends Op {
- Vector branches;
- UnionOp(int type, int size) {
- super(type);
- this.branches = new Vector(size);
- }
- void addElement(Op op) {
- this.branches.addElement(op);
- }
- int size() {
- return this.branches.size();
- }
- Op elementAt(int index) {
- return (Op)this.branches.elementAt(index);
- }
- }
-
- // ================================================================
- static class ChildOp extends Op {
- Op child;
- ChildOp(int type) {
- super(type);
- }
- void setChild(Op child) {
- this.child = child;
- }
- Op getChild() {
- return this.child;
- }
- }
- // ================================================================
- static class ModifierOp extends ChildOp {
- int v1;
- int v2;
- ModifierOp(int type, int v1, int v2) {
- super(type);
- this.v1 = v1;
- this.v2 = v2;
- }
- int getData() {
- return this.v1;
- }
- int getData2() {
- return this.v2;
- }
- }
- // ================================================================
- static class RangeOp extends Op {
- Token tok;
- RangeOp(int type, Token tok) {
- super(type);
- this.tok = tok;
- }
- RangeToken getToken() {
- return (RangeToken)this.tok;
- }
- }
- // ================================================================
- static class StringOp extends Op {
- String string;
- StringOp(int type, String literal) {
- super(type);
- this.string = literal;
- }
- String getString() {
- return this.string;
- }
- }
- // ================================================================
- static class ConditionOp extends Op {
- int refNumber;
- Op condition;
- Op yes;
- Op no;
- ConditionOp(int type, int refno, Op conditionflow, Op yesflow, Op noflow) {
- super(type);
- this.refNumber = refno;
- this.condition = conditionflow;
- this.yes = yesflow;
- this.no = noflow;
- }
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/ParseException.java b/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/ParseException.java
deleted file mode 100644
index ac4041e..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/ParseException.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xpath.regex;
-
-/**
- * @xerces.internal
- *
- * @author TAMURA Kent &lt;kent@trl.ibm.co.jp&gt;
- */
-public class ParseException extends RuntimeException {
-
- /** Serialization version. */
- static final long serialVersionUID = -7012400318097691370L;
-
- int location;
-
- /*
- public ParseException(String mes) {
- this(mes, -1);
- }
- */
- /**
- *
- */
- public ParseException(String mes, int location) {
- super(mes);
- this.location = location;
- }
-
- /**
- *
- * @return -1 if location information is not available.
- */
- public int getLocation() {
- return this.location;
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/ParserForXMLSchema.java b/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/ParserForXMLSchema.java
deleted file mode 100644
index 427069b..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/ParserForXMLSchema.java
+++ /dev/null
@@ -1,513 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xpath.regex;
-
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.Map;
-
-/**
- * A regular expression parser for the XML Schema.
- *
- * @xerces.internal
- *
- * @author TAMURA Kent &lt;kent@trl.ibm.co.jp&gt;
- * @version $Id: ParserForXMLSchema.java,v 1.9 2010-11-12 18:09:45 joehw Exp $
- */
-class ParserForXMLSchema extends RegexParser {
-
- public ParserForXMLSchema() {
- //this.setLocale(Locale.getDefault());
- }
- public ParserForXMLSchema(Locale locale) {
- super(locale);
- }
-
- Token processCaret() throws ParseException {
- this.next();
- return Token.createChar('^');
- }
- Token processDollar() throws ParseException {
- this.next();
- return Token.createChar('$');
- }
- Token processLookahead() throws ParseException {
- throw ex("parser.process.1", this.offset);
- }
- Token processNegativelookahead() throws ParseException {
- throw ex("parser.process.1", this.offset);
- }
- Token processLookbehind() throws ParseException {
- throw ex("parser.process.1", this.offset);
- }
- Token processNegativelookbehind() throws ParseException {
- throw ex("parser.process.1", this.offset);
- }
- Token processBacksolidus_A() throws ParseException {
- throw ex("parser.process.1", this.offset);
- }
- Token processBacksolidus_Z() throws ParseException {
- throw ex("parser.process.1", this.offset);
- }
- Token processBacksolidus_z() throws ParseException {
- throw ex("parser.process.1", this.offset);
- }
- Token processBacksolidus_b() throws ParseException {
- throw ex("parser.process.1", this.offset);
- }
- Token processBacksolidus_B() throws ParseException {
- throw ex("parser.process.1", this.offset);
- }
- Token processBacksolidus_lt() throws ParseException {
- throw ex("parser.process.1", this.offset);
- }
- Token processBacksolidus_gt() throws ParseException {
- throw ex("parser.process.1", this.offset);
- }
- Token processStar(Token tok) throws ParseException {
- this.next();
- return Token.createClosure(tok);
- }
- Token processPlus(Token tok) throws ParseException {
- // X+ -> XX*
- this.next();
- return Token.createConcat(tok, Token.createClosure(tok));
- }
- Token processQuestion(Token tok) throws ParseException {
- // X? -> X|
- this.next();
- Token par = Token.createUnion();
- par.addChild(tok);
- par.addChild(Token.createEmpty());
- return par;
- }
- boolean checkQuestion(int off) {
- return false;
- }
- Token processParen() throws ParseException {
- this.next();
- Token tok = Token.createParen(this.parseRegex(), 0);
- if (this.read() != T_RPAREN) throw ex("parser.factor.1", this.offset-1);
- this.next(); // Skips ')'
- return tok;
- }
- Token processParen2() throws ParseException {
- throw ex("parser.process.1", this.offset);
- }
- Token processCondition() throws ParseException {
- throw ex("parser.process.1", this.offset);
- }
- Token processModifiers() throws ParseException {
- throw ex("parser.process.1", this.offset);
- }
- Token processIndependent() throws ParseException {
- throw ex("parser.process.1", this.offset);
- }
- Token processBacksolidus_c() throws ParseException {
- this.next();
- return this.getTokenForShorthand('c');
- }
- Token processBacksolidus_C() throws ParseException {
- this.next();
- return this.getTokenForShorthand('C');
- }
- Token processBacksolidus_i() throws ParseException {
- this.next();
- return this.getTokenForShorthand('i');
- }
- Token processBacksolidus_I() throws ParseException {
- this.next();
- return this.getTokenForShorthand('I');
- }
- Token processBacksolidus_g() throws ParseException {
- throw this.ex("parser.process.1", this.offset-2);
- }
- Token processBacksolidus_X() throws ParseException {
- throw ex("parser.process.1", this.offset-2);
- }
- Token processBackreference() throws ParseException {
- throw ex("parser.process.1", this.offset-4);
- }
-
- int processCIinCharacterClass(RangeToken tok, int c) {
- tok.mergeRanges(this.getTokenForShorthand(c));
- return -1;
- }
-
-
- /**
- * Parses a character-class-expression, not a character-class-escape.
- *
- * c-c-expression ::= '[' c-group ']'
- * c-group ::= positive-c-group | negative-c-group | c-c-subtraction
- * positive-c-group ::= (c-range | c-c-escape)+
- * negative-c-group ::= '^' positive-c-group
- * c-c-subtraction ::= (positive-c-group | negative-c-group) subtraction
- * subtraction ::= '-' c-c-expression
- * c-range ::= single-range | from-to-range
- * single-range ::= multi-c-escape | category-c-escape | block-c-escape | &lt;any XML char&gt;
- * cc-normal-c ::= &lt;any character except [, ], \&gt;
- * from-to-range ::= cc-normal-c '-' cc-normal-c
- *
- * @param useNrage Ignored.
- * @return This returns no NrageToken.
- */
- protected RangeToken parseCharacterClass(boolean useNrange) throws ParseException {
- this.setContext(S_INBRACKETS);
- this.next(); // '['
- boolean nrange = false;
- boolean wasDecoded = false; // used to detect if the last - was escaped.
- RangeToken base = null;
- RangeToken tok;
- if (this.read() == T_CHAR && this.chardata == '^') {
- nrange = true;
- this.next(); // '^'
- base = Token.createRange();
- base.addRange(0, Token.UTF16_MAX);
- tok = Token.createRange();
- } else {
- tok = Token.createRange();
- }
- int type;
- boolean firstloop = true;
- while ((type = this.read()) != T_EOF) { // Don't use 'cotinue' for this loop.
-
- wasDecoded = false;
- // single-range | from-to-range | subtraction
- if (type == T_CHAR && this.chardata == ']' && !firstloop) {
- if (nrange) {
- base.subtractRanges(tok);
- tok = base;
- }
- break;
- }
- int c = this.chardata;
- boolean end = false;
- if (type == T_BACKSOLIDUS) {
- switch (c) {
- case 'd': case 'D':
- case 'w': case 'W':
- case 's': case 'S':
- tok.mergeRanges(this.getTokenForShorthand(c));
- end = true;
- break;
-
- case 'i': case 'I':
- case 'c': case 'C':
- c = this.processCIinCharacterClass(tok, c);
- if (c < 0) end = true;
- break;
-
- case 'p':
- case 'P':
- int pstart = this.offset;
- RangeToken tok2 = this.processBacksolidus_pP(c);
- if (tok2 == null) throw this.ex("parser.atom.5", pstart);
- tok.mergeRanges(tok2);
- end = true;
- break;
-
- case '-':
- c = this.decodeEscaped();
- wasDecoded = true;
- break;
-
- default:
- c = this.decodeEscaped();
- } // \ + c
- } // backsolidus
- else if (type == T_XMLSCHEMA_CC_SUBTRACTION && !firstloop) {
- // Subraction
- if (nrange) {
- base.subtractRanges(tok);
- tok = base;
- }
- RangeToken range2 = this.parseCharacterClass(false);
- tok.subtractRanges(range2);
- if (this.read() != T_CHAR || this.chardata != ']')
- throw this.ex("parser.cc.5", this.offset);
- break; // Exit this loop
- }
- this.next();
- if (!end) { // if not shorthands...
- if (type == T_CHAR) {
- if (c == '[') throw this.ex("parser.cc.6", this.offset-2);
- if (c == ']') throw this.ex("parser.cc.7", this.offset-2);
- if (c == '-' && this.chardata != ']' && !firstloop) throw this.ex("parser.cc.8", this.offset-2); // if regex = '[-]' then invalid
- }
- if (this.read() != T_CHAR || this.chardata != '-' || c == '-' && firstloop) { // Here is no '-'.
- if (!this.isSet(RegularExpression.IGNORE_CASE) || c > 0xffff) {
- tok.addRange(c, c);
- }
- else {
- addCaseInsensitiveChar(tok, c);
- }
- } else { // Found '-'
- // Is this '-' is a from-to token??
- this.next(); // Skips '-'
- if ((type = this.read()) == T_EOF) throw this.ex("parser.cc.2", this.offset);
- // c '-' ']' -> '-' is a single-range.
- if(type == T_CHAR && this.chardata == ']') { // if - is at the last position of the group
- if (!this.isSet(RegularExpression.IGNORE_CASE) || c > 0xffff) {
- tok.addRange(c, c);
- }
- else {
- addCaseInsensitiveChar(tok, c);
- }
- tok.addRange('-', '-');
- }
- else if (type == T_XMLSCHEMA_CC_SUBTRACTION) {
- throw this.ex("parser.cc.8", this.offset-1);
- } else {
-
- int rangeend = this.chardata;
- if (type == T_CHAR) {
- if (rangeend == '[') throw this.ex("parser.cc.6", this.offset-1);
- if (rangeend == ']') throw this.ex("parser.cc.7", this.offset-1);
- if (rangeend == '-') throw this.ex("parser.cc.8", this.offset-2);
- }
- else if (type == T_BACKSOLIDUS)
- rangeend = this.decodeEscaped();
- this.next();
-
- if (c > rangeend) throw this.ex("parser.ope.3", this.offset-1);
- if (!this.isSet(RegularExpression.IGNORE_CASE) ||
- (c > 0xffff && rangeend > 0xffff)) {
- tok.addRange(c, rangeend);
- }
- else {
- addCaseInsensitiveCharRange(tok, c, rangeend);
- }
- }
- }
- }
- firstloop = false;
- }
- if (this.read() == T_EOF)
- throw this.ex("parser.cc.2", this.offset);
- tok.sortRanges();
- tok.compactRanges();
- //tok.dumpRanges();
- this.setContext(S_NORMAL);
- this.next(); // Skips ']'
-
- return tok;
- }
-
- protected RangeToken parseSetOperations() throws ParseException {
- throw this.ex("parser.process.1", this.offset);
- }
-
- Token getTokenForShorthand(int ch) {
- switch (ch) {
- case 'd':
- return ParserForXMLSchema.getRange("xml:isDigit", true);
- case 'D':
- return ParserForXMLSchema.getRange("xml:isDigit", false);
- case 'w':
- return ParserForXMLSchema.getRange("xml:isWord", true);
- case 'W':
- return ParserForXMLSchema.getRange("xml:isWord", false);
- case 's':
- return ParserForXMLSchema.getRange("xml:isSpace", true);
- case 'S':
- return ParserForXMLSchema.getRange("xml:isSpace", false);
- case 'c':
- return ParserForXMLSchema.getRange("xml:isNameChar", true);
- case 'C':
- return ParserForXMLSchema.getRange("xml:isNameChar", false);
- case 'i':
- return ParserForXMLSchema.getRange("xml:isInitialNameChar", true);
- case 'I':
- return ParserForXMLSchema.getRange("xml:isInitialNameChar", false);
- default:
- throw new RuntimeException("Internal Error: shorthands: \\u"+Integer.toString(ch, 16));
- }
- }
- int decodeEscaped() throws ParseException {
- if (this.read() != T_BACKSOLIDUS) throw ex("parser.next.1", this.offset-1);
- int c = this.chardata;
- switch (c) {
- case 'n': c = '\n'; break; // LINE FEED U+000A
- case 'r': c = '\r'; break; // CRRIAGE RETURN U+000D
- case 't': c = '\t'; break; // HORIZONTAL TABULATION U+0009
- case '\\':
- case '|':
- case '.':
- case '^':
- case '-':
- case '?':
- case '*':
- case '+':
- case '{':
- case '}':
- case '(':
- case ')':
- case '[':
- case ']':
- break; // return actucal char
- default:
- throw ex("parser.process.1", this.offset-2);
- }
- return c;
- }
-
- static private Map<String, Token> ranges = null;
- static private Map<String, Token> ranges2 = null;
- static synchronized protected RangeToken getRange(String name, boolean positive) {
- if (ranges == null) {
- ranges = new HashMap<>();
- ranges2 = new HashMap<>();
-
- Token tok = Token.createRange();
- setupRange(tok, SPACES);
- ranges.put("xml:isSpace", tok);
- ranges2.put("xml:isSpace", Token.complementRanges(tok));
-
- tok = Token.createRange();
- setupRange(tok, DIGITS);
- setupRange(tok, DIGITS_INT);
- ranges.put("xml:isDigit", tok);
- ranges2.put("xml:isDigit", Token.complementRanges(tok));
-
- tok = Token.createRange();
- setupRange(tok, LETTERS);
- setupRange(tok, LETTERS_INT);
- tok.mergeRanges(ranges.get("xml:isDigit"));
- ranges.put("xml:isWord", tok);
- ranges2.put("xml:isWord", Token.complementRanges(tok));
-
- tok = Token.createRange();
- setupRange(tok, NAMECHARS);
- ranges.put("xml:isNameChar", tok);
- ranges2.put("xml:isNameChar", Token.complementRanges(tok));
-
- tok = Token.createRange();
- setupRange(tok, LETTERS);
- tok.addRange('_', '_');
- tok.addRange(':', ':');
- ranges.put("xml:isInitialNameChar", tok);
- ranges2.put("xml:isInitialNameChar", Token.complementRanges(tok));
- }
- RangeToken tok = positive ? (RangeToken)ranges.get(name)
- : (RangeToken)ranges2.get(name);
- return tok;
- }
-
- static void setupRange(Token range, String src) {
- int len = src.length();
- for (int i = 0; i < len; i += 2)
- range.addRange(src.charAt(i), src.charAt(i+1));
- }
-
- static void setupRange(Token range, int[] src) {
- int len = src.length;
- for (int i = 0; i < len; i += 2)
- range.addRange(src[i], src[i+1]);
- }
-
- private static final String SPACES = "\t\n\r\r ";
- private static final String NAMECHARS =
- "\u002d\u002e\u0030\u003a\u0041\u005a\u005f\u005f\u0061\u007a\u00b7\u00b7\u00c0\u00d6"
- +"\u00d8\u00f6\u00f8\u0131\u0134\u013e\u0141\u0148\u014a\u017e\u0180\u01c3\u01cd\u01f0"
- +"\u01f4\u01f5\u01fa\u0217\u0250\u02a8\u02bb\u02c1\u02d0\u02d1\u0300\u0345\u0360\u0361"
- +"\u0386\u038a\u038c\u038c\u038e\u03a1\u03a3\u03ce\u03d0\u03d6\u03da\u03da\u03dc\u03dc"
- +"\u03de\u03de\u03e0\u03e0\u03e2\u03f3\u0401\u040c\u040e\u044f\u0451\u045c\u045e\u0481"
- +"\u0483\u0486\u0490\u04c4\u04c7\u04c8\u04cb\u04cc\u04d0\u04eb\u04ee\u04f5\u04f8\u04f9"
- +"\u0531\u0556\u0559\u0559\u0561\u0586\u0591\u05a1\u05a3\u05b9\u05bb\u05bd\u05bf\u05bf"
- +"\u05c1\u05c2\u05c4\u05c4\u05d0\u05ea\u05f0\u05f2\u0621\u063a\u0640\u0652\u0660\u0669"
- +"\u0670\u06b7\u06ba\u06be\u06c0\u06ce\u06d0\u06d3\u06d5\u06e8\u06ea\u06ed\u06f0\u06f9"
- +"\u0901\u0903\u0905\u0939\u093c\u094d\u0951\u0954\u0958\u0963\u0966\u096f\u0981\u0983"
- +"\u0985\u098c\u098f\u0990\u0993\u09a8\u09aa\u09b0\u09b2\u09b2\u09b6\u09b9\u09bc\u09bc"
- +"\u09be\u09c4\u09c7\u09c8\u09cb\u09cd\u09d7\u09d7\u09dc\u09dd\u09df\u09e3\u09e6\u09f1"
- +"\u0a02\u0a02\u0a05\u0a0a\u0a0f\u0a10\u0a13\u0a28\u0a2a\u0a30\u0a32\u0a33\u0a35\u0a36"
- +"\u0a38\u0a39\u0a3c\u0a3c\u0a3e\u0a42\u0a47\u0a48\u0a4b\u0a4d\u0a59\u0a5c\u0a5e\u0a5e"
- +"\u0a66\u0a74\u0a81\u0a83\u0a85\u0a8b\u0a8d\u0a8d\u0a8f\u0a91\u0a93\u0aa8\u0aaa\u0ab0"
- +"\u0ab2\u0ab3\u0ab5\u0ab9\u0abc\u0ac5\u0ac7\u0ac9\u0acb\u0acd\u0ae0\u0ae0\u0ae6\u0aef"
- +"\u0b01\u0b03\u0b05\u0b0c\u0b0f\u0b10\u0b13\u0b28\u0b2a\u0b30\u0b32\u0b33\u0b36\u0b39"
- +"\u0b3c\u0b43\u0b47\u0b48\u0b4b\u0b4d\u0b56\u0b57\u0b5c\u0b5d\u0b5f\u0b61\u0b66\u0b6f"
- +"\u0b82\u0b83\u0b85\u0b8a\u0b8e\u0b90\u0b92\u0b95\u0b99\u0b9a\u0b9c\u0b9c\u0b9e\u0b9f"
- +"\u0ba3\u0ba4\u0ba8\u0baa\u0bae\u0bb5\u0bb7\u0bb9\u0bbe\u0bc2\u0bc6\u0bc8\u0bca\u0bcd"
- +"\u0bd7\u0bd7\u0be7\u0bef\u0c01\u0c03\u0c05\u0c0c\u0c0e\u0c10\u0c12\u0c28\u0c2a\u0c33"
- +"\u0c35\u0c39\u0c3e\u0c44\u0c46\u0c48\u0c4a\u0c4d\u0c55\u0c56\u0c60\u0c61\u0c66\u0c6f"
- +"\u0c82\u0c83\u0c85\u0c8c\u0c8e\u0c90\u0c92\u0ca8\u0caa\u0cb3\u0cb5\u0cb9\u0cbe\u0cc4"
- +"\u0cc6\u0cc8\u0cca\u0ccd\u0cd5\u0cd6\u0cde\u0cde\u0ce0\u0ce1\u0ce6\u0cef\u0d02\u0d03"
- +"\u0d05\u0d0c\u0d0e\u0d10\u0d12\u0d28\u0d2a\u0d39\u0d3e\u0d43\u0d46\u0d48\u0d4a\u0d4d"
- +"\u0d57\u0d57\u0d60\u0d61\u0d66\u0d6f\u0e01\u0e2e\u0e30\u0e3a\u0e40\u0e4e\u0e50\u0e59"
- +"\u0e81\u0e82\u0e84\u0e84\u0e87\u0e88\u0e8a\u0e8a\u0e8d\u0e8d\u0e94\u0e97\u0e99\u0e9f"
- +"\u0ea1\u0ea3\u0ea5\u0ea5\u0ea7\u0ea7\u0eaa\u0eab\u0ead\u0eae\u0eb0\u0eb9\u0ebb\u0ebd"
- +"\u0ec0\u0ec4\u0ec6\u0ec6\u0ec8\u0ecd\u0ed0\u0ed9\u0f18\u0f19\u0f20\u0f29\u0f35\u0f35"
- +"\u0f37\u0f37\u0f39\u0f39\u0f3e\u0f47\u0f49\u0f69\u0f71\u0f84\u0f86\u0f8b\u0f90\u0f95"
- +"\u0f97\u0f97\u0f99\u0fad\u0fb1\u0fb7\u0fb9\u0fb9\u10a0\u10c5\u10d0\u10f6\u1100\u1100"
- +"\u1102\u1103\u1105\u1107\u1109\u1109\u110b\u110c\u110e\u1112\u113c\u113c\u113e\u113e"
- +"\u1140\u1140\u114c\u114c\u114e\u114e\u1150\u1150\u1154\u1155\u1159\u1159\u115f\u1161"
- +"\u1163\u1163\u1165\u1165\u1167\u1167\u1169\u1169\u116d\u116e\u1172\u1173\u1175\u1175"
- +"\u119e\u119e\u11a8\u11a8\u11ab\u11ab\u11ae\u11af\u11b7\u11b8\u11ba\u11ba\u11bc\u11c2"
- +"\u11eb\u11eb\u11f0\u11f0\u11f9\u11f9\u1e00\u1e9b\u1ea0\u1ef9\u1f00\u1f15\u1f18\u1f1d"
- +"\u1f20\u1f45\u1f48\u1f4d\u1f50\u1f57\u1f59\u1f59\u1f5b\u1f5b\u1f5d\u1f5d\u1f5f\u1f7d"
- +"\u1f80\u1fb4\u1fb6\u1fbc\u1fbe\u1fbe\u1fc2\u1fc4\u1fc6\u1fcc\u1fd0\u1fd3\u1fd6\u1fdb"
- +"\u1fe0\u1fec\u1ff2\u1ff4\u1ff6\u1ffc\u20d0\u20dc\u20e1\u20e1\u2126\u2126\u212a\u212b"
- +"\u212e\u212e\u2180\u2182\u3005\u3005\u3007\u3007\u3021\u302f\u3031\u3035\u3041\u3094"
- +"\u3099\u309a\u309d\u309e\u30a1\u30fa\u30fc\u30fe\u3105\u312c\u4e00\u9fa5\uac00\ud7a3"
- +"";
- private static final String LETTERS =
- "\u0041\u005a\u0061\u007a\u00c0\u00d6\u00d8\u00f6\u00f8\u0131\u0134\u013e\u0141\u0148"
- +"\u014a\u017e\u0180\u01f0\u01f4\u01f5\u01fa\u0217\u0250\u02a8\u02bb\u02c1"
- +"\u02b0\u02d1"
- +"\u0386\u0386\u0388\u038a\u038c\u038c\u038e\u03a1\u03a3\u03ce\u03d0\u03d6\u03da\u03da"
- +"\u03dc\u03dc\u03de\u03de\u03e0\u03e0\u03e2\u03f3\u0401\u040c\u040e\u044f\u0451\u045c"
- +"\u045e\u0481\u0490\u04c4\u04c7\u04c8\u04cb\u04cc\u04d0\u04eb\u04ee\u04f5\u04f8\u04f9"
- +"\u0531\u0556\u0559\u0559\u0561\u0586\u05d0\u05ea\u05f0\u05f2\u0621\u063a\u0641\u064a"
- +"\u0671\u06b7\u06ba\u06be\u06c0\u06ce\u06d0\u06d3\u06d5\u06d5\u06e5\u06e6\u0905\u0939"
- +"\u093d\u093d\u0958\u0961\u0985\u098c\u098f\u0990\u0993\u09a8\u09aa\u09b0\u09b2\u09b2"
- +"\u09b6\u09b9\u09dc\u09dd\u09df\u09e1\u09f0\u09f1\u0a05\u0a0a\u0a0f\u0a10\u0a13\u0a28"
- +"\u0a2a\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59\u0a5c\u0a5e\u0a5e\u0a72\u0a74"
- +"\u0a85\u0a8b\u0a8d\u0a8d\u0a8f\u0a91\u0a93\u0aa8\u0aaa\u0ab0\u0ab2\u0ab3\u0ab5\u0ab9"
- +"\u0abd\u0abd\u0ae0\u0ae0\u0b05\u0b0c\u0b0f\u0b10\u0b13\u0b28\u0b2a\u0b30\u0b32\u0b33"
- +"\u0b36\u0b39\u0b3d\u0b3d\u0b5c\u0b5d\u0b5f\u0b61\u0b85\u0b8a\u0b8e\u0b90\u0b92\u0b95"
- +"\u0b99\u0b9a\u0b9c\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8\u0baa\u0bae\u0bb5\u0bb7\u0bb9"
- +"\u0c05\u0c0c\u0c0e\u0c10\u0c12\u0c28\u0c2a\u0c33\u0c35\u0c39\u0c60\u0c61\u0c85\u0c8c"
- +"\u0c8e\u0c90\u0c92\u0ca8\u0caa\u0cb3\u0cb5\u0cb9\u0cde\u0cde\u0ce0\u0ce1\u0d05\u0d0c"
- +"\u0d0e\u0d10\u0d12\u0d28\u0d2a\u0d39\u0d60\u0d61\u0e01\u0e2e\u0e30\u0e30\u0e32\u0e33"
- +"\u0e40\u0e45\u0e81\u0e82\u0e84\u0e84\u0e87\u0e88\u0e8a\u0e8a\u0e8d\u0e8d\u0e94\u0e97"
- +"\u0e99\u0e9f\u0ea1\u0ea3\u0ea5\u0ea5\u0ea7\u0ea7\u0eaa\u0eab\u0ead\u0eae\u0eb0\u0eb0"
- +"\u0eb2\u0eb3\u0ebd\u0ebd\u0ec0\u0ec4\u0f40\u0f47\u0f49\u0f69\u10a0\u10c5\u10d0\u10f6"
- +"\u1100\u1100\u1102\u1103\u1105\u1107\u1109\u1109\u110b\u110c\u110e\u1112\u113c\u113c"
- +"\u113e\u113e\u1140\u1140\u114c\u114c\u114e\u114e\u1150\u1150\u1154\u1155\u1159\u1159"
- +"\u115f\u1161\u1163\u1163\u1165\u1165\u1167\u1167\u1169\u1169\u116d\u116e\u1172\u1173"
- +"\u1175\u1175\u119e\u119e\u11a8\u11a8\u11ab\u11ab\u11ae\u11af\u11b7\u11b8\u11ba\u11ba"
- +"\u11bc\u11c2\u11eb\u11eb\u11f0\u11f0\u11f9\u11f9\u1e00\u1e9b\u1ea0\u1ef9\u1f00\u1f15"
- +"\u1f18\u1f1d\u1f20\u1f45\u1f48\u1f4d\u1f50\u1f57\u1f59\u1f59\u1f5b\u1f5b\u1f5d\u1f5d"
- +"\u1f5f\u1f7d\u1f80\u1fb4\u1fb6\u1fbc\u1fbe\u1fbe\u1fc2\u1fc4\u1fc6\u1fcc\u1fd0\u1fd3"
- +"\u1fd6\u1fdb\u1fe0\u1fec\u1ff2\u1ff4\u1ff6\u1ffc\u2126\u2126\u212a\u212b\u212e\u212e"
- +"\u2180\u2182\u3007\u3007\u3021\u3029\u3041\u3094\u30a1\u30fa\u3105\u312c\u4e00\u9fa5"
- +"\uac00\ud7a3\uff66\uff9f";
-
- private static final int[] LETTERS_INT = {0x1d790, 0x1d7a8, 0x1d7aa, 0x1d7c9, 0x2fa1b, 0x2fa1d};
-
- private static final String DIGITS =
- "\u0030\u0039\u0660\u0669\u06F0\u06F9\u0966\u096F\u09E6\u09EF\u0A66\u0A6F\u0AE6\u0AEF"
- +"\u0B66\u0B6F\u0BE7\u0BEF\u0C66\u0C6F\u0CE6\u0CEF\u0D66\u0D6F\u0E50\u0E59\u0ED0\u0ED9"
- +"\u0F20\u0F29\u1040\u1049\u1369\u1371\u17E0\u17E9\u1810\u1819\uFF10\uFF19";
-
- private static final int[] DIGITS_INT = {0x1D7CE, 0x1D7FF};
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/REUtil.java b/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/REUtil.java
deleted file mode 100644
index 8f0a7d6..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/REUtil.java
+++ /dev/null
@@ -1,335 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xpath.regex;
-
-import java.text.CharacterIterator;
-
-/**
- * @xerces.internal
- *
- */
-public final class REUtil {
- private REUtil() {
- }
-
- static final int composeFromSurrogates(int high, int low) {
- return 0x10000 + ((high-0xd800)<<10) + low-0xdc00;
- }
-
- static final boolean isLowSurrogate(int ch) {
- return (ch & 0xfc00) == 0xdc00;
- }
-
- static final boolean isHighSurrogate(int ch) {
- return (ch & 0xfc00) == 0xd800;
- }
-
- static final String decomposeToSurrogates(int ch) {
- char[] chs = new char[2];
- ch -= 0x10000;
- chs[0] = (char)((ch>>10)+0xd800);
- chs[1] = (char)((ch&0x3ff)+0xdc00);
- return new String(chs);
- }
-
- static final String substring(CharacterIterator iterator, int begin, int end) {
- char[] src = new char[end-begin];
- for (int i = 0; i < src.length; i ++)
- src[i] = iterator.setIndex(i+begin);
- return new String(src);
- }
-
- // ================================================================
-
- static final int getOptionValue(int ch) {
- int ret = 0;
- switch (ch) {
- case 'i':
- ret = RegularExpression.IGNORE_CASE;
- break;
- case 'm':
- ret = RegularExpression.MULTIPLE_LINES;
- break;
- case 's':
- ret = RegularExpression.SINGLE_LINE;
- break;
- case 'x':
- ret = RegularExpression.EXTENDED_COMMENT;
- break;
- case 'u':
- ret = RegularExpression.USE_UNICODE_CATEGORY;
- break;
- case 'w':
- ret = RegularExpression.UNICODE_WORD_BOUNDARY;
- break;
- case 'F':
- ret = RegularExpression.PROHIBIT_FIXED_STRING_OPTIMIZATION;
- break;
- case 'H':
- ret = RegularExpression.PROHIBIT_HEAD_CHARACTER_OPTIMIZATION;
- break;
- case 'X':
- ret = RegularExpression.XMLSCHEMA_MODE;
- break;
- case ',':
- ret = RegularExpression.SPECIAL_COMMA;
- break;
- default:
- }
- return ret;
- }
-
- static final int parseOptions(String opts) throws ParseException {
- if (opts == null) return 0;
- int options = 0;
- for (int i = 0; i < opts.length(); i ++) {
- int v = getOptionValue(opts.charAt(i));
- if (v == 0)
- throw new ParseException("Unknown Option: "+opts.substring(i), -1);
- options |= v;
- }
- return options;
- }
-
- static final String createOptionString(int options) {
- StringBuffer sb = new StringBuffer(9);
- if ((options & RegularExpression.PROHIBIT_FIXED_STRING_OPTIMIZATION) != 0)
- sb.append((char)'F');
- if ((options & RegularExpression.PROHIBIT_HEAD_CHARACTER_OPTIMIZATION) != 0)
- sb.append((char)'H');
- if ((options & RegularExpression.XMLSCHEMA_MODE) != 0)
- sb.append((char)'X');
- if ((options & RegularExpression.IGNORE_CASE) != 0)
- sb.append((char)'i');
- if ((options & RegularExpression.MULTIPLE_LINES) != 0)
- sb.append((char)'m');
- if ((options & RegularExpression.SINGLE_LINE) != 0)
- sb.append((char)'s');
- if ((options & RegularExpression.USE_UNICODE_CATEGORY) != 0)
- sb.append((char)'u');
- if ((options & RegularExpression.UNICODE_WORD_BOUNDARY) != 0)
- sb.append((char)'w');
- if ((options & RegularExpression.EXTENDED_COMMENT) != 0)
- sb.append((char)'x');
- if ((options & RegularExpression.SPECIAL_COMMA) != 0)
- sb.append((char)',');
- return sb.toString().intern();
- }
-
- // ================================================================
-
- static String stripExtendedComment(String regex) {
- int len = regex.length();
- StringBuffer buffer = new StringBuffer(len);
- int offset = 0;
- while (offset < len) {
- int ch = regex.charAt(offset++);
- // Skips a white space.
- if (ch == '\t' || ch == '\n' || ch == '\f' || ch == '\r' || ch == ' ')
- continue;
-
- if (ch == '#') { // Skips chracters between '#' and a line end.
- while (offset < len) {
- ch = regex.charAt(offset++);
- if (ch == '\r' || ch == '\n')
- break;
- }
- continue;
- }
-
- int next; // Strips an escaped white space.
- if (ch == '\\' && offset < len) {
- if ((next = regex.charAt(offset)) == '#'
- || next == '\t' || next == '\n' || next == '\f'
- || next == '\r' || next == ' ') {
- buffer.append((char)next);
- offset ++;
- } else { // Other escaped character.
- buffer.append((char)'\\');
- buffer.append((char)next);
- offset ++;
- }
- } else // As is.
- buffer.append((char)ch);
- }
- return buffer.toString();
- }
-
- // ================================================================
-
- /**
- * Sample entry.
- * <div>Usage: <KBD>com.sun.org.apache.xerces.internal.utils.regex.REUtil &lt;regex&gt; &lt;string&gt;</KBD></div>
- */
- public static void main(String[] argv) {
- String pattern = null;
- try {
- String options = "";
- String target = null;
- if( argv.length == 0 ) {
- System.out.println( "Error:Usage: java REUtil -i|-m|-s|-u|-w|-X regularExpression String" );
- System.exit( 0 );
- }
- for (int i = 0; i < argv.length; i ++) {
- if (argv[i].length() == 0 || argv[i].charAt(0) != '-') {
- if (pattern == null)
- pattern = argv[i];
- else if (target == null)
- target = argv[i];
- else
- System.err.println("Unnecessary: "+argv[i]);
- } else if (argv[i].equals("-i")) {
- options += "i";
- } else if (argv[i].equals("-m")) {
- options += "m";
- } else if (argv[i].equals("-s")) {
- options += "s";
- } else if (argv[i].equals("-u")) {
- options += "u";
- } else if (argv[i].equals("-w")) {
- options += "w";
- } else if (argv[i].equals("-X")) {
- options += "X";
- } else {
- System.err.println("Unknown option: "+argv[i]);
- }
- }
- RegularExpression reg = new RegularExpression(pattern, options);
- System.out.println("RegularExpression: "+reg);
- Match match = new Match();
- reg.matches(target, match);
- for (int i = 0; i < match.getNumberOfGroups(); i ++) {
- if (i == 0 ) System.out.print("Matched range for the whole pattern: ");
- else System.out.print("["+i+"]: ");
- if (match.getBeginning(i) < 0)
- System.out.println("-1");
- else {
- System.out.print(match.getBeginning(i)+", "+match.getEnd(i)+", ");
- System.out.println("\""+match.getCapturedText(i)+"\"");
- }
- }
- } catch (ParseException pe) {
- if (pattern == null) {
- pe.printStackTrace();
- } else {
- System.err.println("com.sun.org.apache.xerces.internal.utils.regex.ParseException: "+pe.getMessage());
- String indent = " ";
- System.err.println(indent+pattern);
- int loc = pe.getLocation();
- if (loc >= 0) {
- System.err.print(indent);
- for (int i = 0; i < loc; i ++) System.err.print("-");
- System.err.println("^");
- }
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- static final int CACHESIZE = 20;
- static final RegularExpression[] regexCache = new RegularExpression[CACHESIZE];
- /**
- * Creates a RegularExpression instance.
- * This method caches created instances.
- *
- * @see RegularExpression#RegularExpression(java.lang.String, java.lang.String)
- */
- public static RegularExpression createRegex(String pattern, String options)
- throws ParseException {
- RegularExpression re = null;
- int intOptions = REUtil.parseOptions(options);
- synchronized (REUtil.regexCache) {
- int i;
- for (i = 0; i < REUtil.CACHESIZE; i ++) {
- RegularExpression cached = REUtil.regexCache[i];
- if (cached == null) {
- i = -1;
- break;
- }
- if (cached.equals(pattern, intOptions)) {
- re = cached;
- break;
- }
- }
- if (re != null) {
- if (i != 0) {
- System.arraycopy(REUtil.regexCache, 0, REUtil.regexCache, 1, i);
- REUtil.regexCache[0] = re;
- }
- } else {
- re = new RegularExpression(pattern, options);
- System.arraycopy(REUtil.regexCache, 0, REUtil.regexCache, 1, REUtil.CACHESIZE-1);
- REUtil.regexCache[0] = re;
- }
- }
- return re;
- }
-
- /**
- *
- * @see RegularExpression#matches(java.lang.String)
- */
- public static boolean matches(String regex, String target) throws ParseException {
- return REUtil.createRegex(regex, null).matches(target);
- }
-
- /**
- *
- * @see RegularExpression#matches(java.lang.String)
- */
- public static boolean matches(String regex, String options, String target) throws ParseException {
- return REUtil.createRegex(regex, options).matches(target);
- }
-
- // ================================================================
-
- /**
- *
- */
- public static String quoteMeta(String literal) {
- int len = literal.length();
- StringBuffer buffer = null;
- for (int i = 0; i < len; i ++) {
- int ch = literal.charAt(i);
- if (".*+?{[()|\\^$".indexOf(ch) >= 0) {
- if (buffer == null) {
- buffer = new StringBuffer(i+(len-i)*2);
- if (i > 0) buffer.append(literal.substring(0, i));
- }
- buffer.append((char)'\\');
- buffer.append((char)ch);
- } else if (buffer != null)
- buffer.append((char)ch);
- }
- return buffer != null ? buffer.toString() : literal;
- }
-
- // ================================================================
-
- static void dumpString(String v) {
- for (int i = 0; i < v.length(); i ++) {
- System.out.print(Integer.toHexString(v.charAt(i)));
- System.out.print(" ");
- }
- System.out.println();
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/RangeToken.java b/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/RangeToken.java
deleted file mode 100644
index 3a7ac70..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/RangeToken.java
+++ /dev/null
@@ -1,623 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xpath.regex;
-
-/**
- * This class represents a character class such as [a-z] or a period.
- *
- * @xerces.internal
- *
- */
-final class RangeToken extends Token implements java.io.Serializable {
-
- private static final long serialVersionUID = 3257568399592010545L;
-
- int[] ranges;
- boolean sorted;
- boolean compacted;
- RangeToken icaseCache = null;
- int[] map = null;
- int nonMapIndex;
-
- RangeToken(int type) {
- super(type);
- this.setSorted(false);
- }
-
- // for RANGE or NRANGE
- protected void addRange(int start, int end) {
- this.icaseCache = null;
- //System.err.println("Token#addRange(): "+start+" "+end);
- int r1, r2;
- if (start <= end) {
- r1 = start;
- r2 = end;
- } else {
- r1 = end;
- r2 = start;
- }
-
- int pos = 0;
- if (this.ranges == null) {
- this.ranges = new int[2];
- this.ranges[0] = r1;
- this.ranges[1] = r2;
- this.setSorted(true);
- } else {
- pos = this.ranges.length;
- if (this.ranges[pos-1]+1 == r1) {
- this.ranges[pos-1] = r2;
- return;
- }
- int[] temp = new int[pos+2];
- System.arraycopy(this.ranges, 0, temp, 0, pos);
- this.ranges = temp;
- if (this.ranges[pos-1] >= r1)
- this.setSorted(false);
- this.ranges[pos++] = r1;
- this.ranges[pos] = r2;
- if (!this.sorted)
- this.sortRanges();
- }
- }
-
- private final boolean isSorted() {
- return this.sorted;
- }
- private final void setSorted(boolean sort) {
- this.sorted = sort;
- if (!sort) this.compacted = false;
- }
- private final boolean isCompacted() {
- return this.compacted;
- }
- private final void setCompacted() {
- this.compacted = true;
- }
-
- protected void sortRanges() {
- if (this.isSorted())
- return;
- if (this.ranges == null)
- return;
- //System.err.println("Do sorting: "+this.ranges.length);
-
- // Bubble sort
- // Why? -- In many cases,
- // this.ranges has few elements.
- for (int i = this.ranges.length-4; i >= 0; i -= 2) {
- for (int j = 0; j <= i; j += 2) {
- if (this.ranges[j] > this.ranges[j+2]
- || this.ranges[j] == this.ranges[j+2] && this.ranges[j+1] > this.ranges[j+3]) {
- int tmp;
- tmp = this.ranges[j+2];
- this.ranges[j+2] = this.ranges[j];
- this.ranges[j] = tmp;
- tmp = this.ranges[j+3];
- this.ranges[j+3] = this.ranges[j+1];
- this.ranges[j+1] = tmp;
- }
- }
- }
- this.setSorted(true);
- }
-
- /**
- * this.ranges is sorted.
- */
- protected void compactRanges() {
- boolean DEBUG = false;
- if (this.ranges == null || this.ranges.length <= 2)
- return;
- if (this.isCompacted())
- return;
- int base = 0; // Index of writing point
- int target = 0; // Index of processing point
-
- while (target < this.ranges.length) {
- if (base != target) {
- this.ranges[base] = this.ranges[target++];
- this.ranges[base+1] = this.ranges[target++];
- } else
- target += 2;
- int baseend = this.ranges[base+1];
- while (target < this.ranges.length) {
- if (baseend+1 < this.ranges[target])
- break;
- if (baseend+1 == this.ranges[target]) {
- if (DEBUG)
- System.err.println("Token#compactRanges(): Compaction: ["+this.ranges[base]
- +", "+this.ranges[base+1]
- +"], ["+this.ranges[target]
- +", "+this.ranges[target+1]
- +"] -> ["+this.ranges[base]
- +", "+this.ranges[target+1]
- +"]");
- this.ranges[base+1] = this.ranges[target+1];
- baseend = this.ranges[base+1];
- target += 2;
- } else if (baseend >= this.ranges[target+1]) {
- if (DEBUG)
- System.err.println("Token#compactRanges(): Compaction: ["+this.ranges[base]
- +", "+this.ranges[base+1]
- +"], ["+this.ranges[target]
- +", "+this.ranges[target+1]
- +"] -> ["+this.ranges[base]
- +", "+this.ranges[base+1]
- +"]");
- target += 2;
- } else if (baseend < this.ranges[target+1]) {
- if (DEBUG)
- System.err.println("Token#compactRanges(): Compaction: ["+this.ranges[base]
- +", "+this.ranges[base+1]
- +"], ["+this.ranges[target]
- +", "+this.ranges[target+1]
- +"] -> ["+this.ranges[base]
- +", "+this.ranges[target+1]
- +"]");
- this.ranges[base+1] = this.ranges[target+1];
- baseend = this.ranges[base+1];
- target += 2;
- } else {
- throw new RuntimeException("Token#compactRanges(): Internel Error: ["
- +this.ranges[base]
- +","+this.ranges[base+1]
- +"] ["+this.ranges[target]
- +","+this.ranges[target+1]+"]");
- }
- } // while
- base += 2;
- }
-
- if (base != this.ranges.length) {
- int[] result = new int[base];
- System.arraycopy(this.ranges, 0, result, 0, base);
- this.ranges = result;
- }
- this.setCompacted();
- }
-
- protected void mergeRanges(Token token) {
- RangeToken tok = (RangeToken)token;
- this.sortRanges();
- tok.sortRanges();
- if (tok.ranges == null)
- return;
- this.icaseCache = null;
- this.setSorted(true);
- if (this.ranges == null) {
- this.ranges = new int[tok.ranges.length];
- System.arraycopy(tok.ranges, 0, this.ranges, 0, tok.ranges.length);
- return;
- }
- int[] result = new int[this.ranges.length+tok.ranges.length];
- for (int i = 0, j = 0, k = 0; i < this.ranges.length || j < tok.ranges.length;) {
- if (i >= this.ranges.length) {
- result[k++] = tok.ranges[j++];
- result[k++] = tok.ranges[j++];
- } else if (j >= tok.ranges.length) {
- result[k++] = this.ranges[i++];
- result[k++] = this.ranges[i++];
- } else if (tok.ranges[j] < this.ranges[i]
- || tok.ranges[j] == this.ranges[i] && tok.ranges[j+1] < this.ranges[i+1]) {
- result[k++] = tok.ranges[j++];
- result[k++] = tok.ranges[j++];
- } else {
- result[k++] = this.ranges[i++];
- result[k++] = this.ranges[i++];
- }
- }
- this.ranges = result;
- }
-
- protected void subtractRanges(Token token) {
- if (token.type == NRANGE) {
- this.intersectRanges(token);
- return;
- }
- RangeToken tok = (RangeToken)token;
- if (tok.ranges == null || this.ranges == null)
- return;
- this.icaseCache = null;
- this.sortRanges();
- this.compactRanges();
- tok.sortRanges();
- tok.compactRanges();
-
- //System.err.println("Token#substractRanges(): Entry: "+this.ranges.length+", "+tok.ranges.length);
-
- int[] result = new int[this.ranges.length+tok.ranges.length];
- int wp = 0, src = 0, sub = 0;
- while (src < this.ranges.length && sub < tok.ranges.length) {
- int srcbegin = this.ranges[src];
- int srcend = this.ranges[src+1];
- int subbegin = tok.ranges[sub];
- int subend = tok.ranges[sub+1];
- if (srcend < subbegin) { // Not overlapped
- // src: o-----o
- // sub: o-----o
- // res: o-----o
- // Reuse sub
- result[wp++] = this.ranges[src++];
- result[wp++] = this.ranges[src++];
- } else if (srcend >= subbegin
- && srcbegin <= subend) { // Overlapped
- // src: o--------o
- // sub: o----o
- // sub: o----o
- // sub: o----o
- // sub: o------------o
- if (subbegin <= srcbegin && srcend <= subend) {
- // src: o--------o
- // sub: o------------o
- // res: empty
- // Reuse sub
- src += 2;
- } else if (subbegin <= srcbegin) {
- // src: o--------o
- // sub: o----o
- // res: o-----o
- // Reuse src(=res)
- this.ranges[src] = subend+1;
- sub += 2;
- } else if (srcend <= subend) {
- // src: o--------o
- // sub: o----o
- // res: o-----o
- // Reuse sub
- result[wp++] = srcbegin;
- result[wp++] = subbegin-1;
- src += 2;
- } else {
- // src: o--------o
- // sub: o----o
- // res: o-o o-o
- // Reuse src(=right res)
- result[wp++] = srcbegin;
- result[wp++] = subbegin-1;
- this.ranges[src] = subend+1;
- sub += 2;
- }
- } else if (subend < srcbegin) {
- // Not overlapped
- // src: o-----o
- // sub: o----o
- sub += 2;
- } else {
- throw new RuntimeException("Token#subtractRanges(): Internal Error: ["+this.ranges[src]
- +","+this.ranges[src+1]
- +"] - ["+tok.ranges[sub]
- +","+tok.ranges[sub+1]
- +"]");
- }
- }
- while (src < this.ranges.length) {
- result[wp++] = this.ranges[src++];
- result[wp++] = this.ranges[src++];
- }
- this.ranges = new int[wp];
- System.arraycopy(result, 0, this.ranges, 0, wp);
- // this.ranges is sorted and compacted.
- }
-
- /**
- * @param tok Ignore whether it is NRANGE or not.
- */
- protected void intersectRanges(Token token) {
- RangeToken tok = (RangeToken)token;
- if (tok.ranges == null || this.ranges == null)
- return;
- this.icaseCache = null;
- this.sortRanges();
- this.compactRanges();
- tok.sortRanges();
- tok.compactRanges();
-
- int[] result = new int[this.ranges.length+tok.ranges.length];
- int wp = 0, src1 = 0, src2 = 0;
- while (src1 < this.ranges.length && src2 < tok.ranges.length) {
- int src1begin = this.ranges[src1];
- int src1end = this.ranges[src1+1];
- int src2begin = tok.ranges[src2];
- int src2end = tok.ranges[src2+1];
- if (src1end < src2begin) { // Not overlapped
- // src1: o-----o
- // src2: o-----o
- // res: empty
- // Reuse src2
- src1 += 2;
- } else if (src1end >= src2begin
- && src1begin <= src2end) { // Overlapped
- // src1: o--------o
- // src2: o----o
- // src2: o----o
- // src2: o----o
- // src2: o------------o
- if (src2begin <= src2begin && src1end <= src2end) {
- // src1: o--------o
- // src2: o------------o
- // res: o--------o
- // Reuse src2
- result[wp++] = src1begin;
- result[wp++] = src1end;
- src1 += 2;
- } else if (src2begin <= src1begin) {
- // src1: o--------o
- // src2: o----o
- // res: o--o
- // Reuse the rest of src1
- result[wp++] = src1begin;
- result[wp++] = src2end;
- this.ranges[src1] = src2end+1;
- src2 += 2;
- } else if (src1end <= src2end) {
- // src1: o--------o
- // src2: o----o
- // res: o--o
- // Reuse src2
- result[wp++] = src2begin;
- result[wp++] = src1end;
- src1 += 2;
- } else {
- // src1: o--------o
- // src2: o----o
- // res: o----o
- // Reuse the rest of src1
- result[wp++] = src2begin;
- result[wp++] = src2end;
- this.ranges[src1] = src2end+1;
- }
- } else if (src2end < src1begin) {
- // Not overlapped
- // src1: o-----o
- // src2: o----o
- src2 += 2;
- } else {
- throw new RuntimeException("Token#intersectRanges(): Internal Error: ["
- +this.ranges[src1]
- +","+this.ranges[src1+1]
- +"] & ["+tok.ranges[src2]
- +","+tok.ranges[src2+1]
- +"]");
- }
- }
- while (src1 < this.ranges.length) {
- result[wp++] = this.ranges[src1++];
- result[wp++] = this.ranges[src1++];
- }
- this.ranges = new int[wp];
- System.arraycopy(result, 0, this.ranges, 0, wp);
- // this.ranges is sorted and compacted.
- }
-
- /**
- * for RANGE: Creates complement.
- * for NRANGE: Creates the same meaning RANGE.
- */
- static Token complementRanges(Token token) {
- if (token.type != RANGE && token.type != NRANGE)
- throw new IllegalArgumentException("Token#complementRanges(): must be RANGE: "+token.type);
- RangeToken tok = (RangeToken)token;
- tok.sortRanges();
- tok.compactRanges();
- int len = tok.ranges.length+2;
- if (tok.ranges[0] == 0)
- len -= 2;
- int last = tok.ranges[tok.ranges.length-1];
- if (last == UTF16_MAX)
- len -= 2;
- RangeToken ret = Token.createRange();
- ret.ranges = new int[len];
- int wp = 0;
- if (tok.ranges[0] > 0) {
- ret.ranges[wp++] = 0;
- ret.ranges[wp++] = tok.ranges[0]-1;
- }
- for (int i = 1; i < tok.ranges.length-2; i += 2) {
- ret.ranges[wp++] = tok.ranges[i]+1;
- ret.ranges[wp++] = tok.ranges[i+1]-1;
- }
- if (last != UTF16_MAX) {
- ret.ranges[wp++] = last+1;
- ret.ranges[wp] = UTF16_MAX;
- }
- ret.setCompacted();
- return ret;
- }
-
- synchronized RangeToken getCaseInsensitiveToken() {
- if (this.icaseCache != null)
- return this.icaseCache;
-
- RangeToken uppers = this.type == Token.RANGE ? Token.createRange() : Token.createNRange();
- for (int i = 0; i < this.ranges.length; i += 2) {
- for (int ch = this.ranges[i]; ch <= this.ranges[i+1]; ch ++) {
- if (ch > 0xffff)
- uppers.addRange(ch, ch);
- else {
- char uch = Character.toUpperCase((char)ch);
- uppers.addRange(uch, uch);
- }
- }
- }
- RangeToken lowers = this.type == Token.RANGE ? Token.createRange() : Token.createNRange();
- for (int i = 0; i < uppers.ranges.length; i += 2) {
- for (int ch = uppers.ranges[i]; ch <= uppers.ranges[i+1]; ch ++) {
- if (ch > 0xffff)
- lowers.addRange(ch, ch);
- else {
- char uch = Character.toUpperCase((char)ch);
- lowers.addRange(uch, uch);
- }
- }
- }
- lowers.mergeRanges(uppers);
- lowers.mergeRanges(this);
- lowers.compactRanges();
-
- this.icaseCache = lowers;
- return lowers;
- }
-
- void dumpRanges() {
- System.err.print("RANGE: ");
- if (this.ranges == null)
- System.err.println(" NULL");
- for (int i = 0; i < this.ranges.length; i += 2) {
- System.err.print("["+this.ranges[i]+","+this.ranges[i+1]+"] ");
- }
- System.err.println("");
- }
-
- boolean match(int ch) {
- if (this.map == null) this.createMap();
- boolean ret;
- if (this.type == RANGE) {
- if (ch < MAPSIZE)
- return (this.map[ch/32] & (1<<(ch&0x1f))) != 0;
- ret = false;
- for (int i = this.nonMapIndex; i < this.ranges.length; i += 2) {
- if (this.ranges[i] <= ch && ch <= this.ranges[i+1])
- return true;
- }
- } else {
- if (ch < MAPSIZE)
- return (this.map[ch/32] & (1<<(ch&0x1f))) == 0;
- ret = true;
- for (int i = this.nonMapIndex; i < this.ranges.length; i += 2) {
- if (this.ranges[i] <= ch && ch <= this.ranges[i+1])
- return false;
- }
- }
- return ret;
- }
-
- private static final int MAPSIZE = 256;
- private void createMap() {
- int asize = MAPSIZE/32; // 32 is the number of bits in `int'.
- int [] map = new int[asize];
- int nonMapIndex = this.ranges.length;
- for (int i = 0; i < asize; ++i) {
- map[i] = 0;
- }
- for (int i = 0; i < this.ranges.length; i += 2) {
- int s = this.ranges[i];
- int e = this.ranges[i+1];
- if (s < MAPSIZE) {
- for (int j = s; j <= e && j < MAPSIZE; j++) {
- map[j/32] |= 1<<(j&0x1f); // s&0x1f : 0-31
- }
- }
- else {
- nonMapIndex = i;
- break;
- }
- if (e >= MAPSIZE) {
- nonMapIndex = i;
- break;
- }
- }
- this.map = map;
- this.nonMapIndex = nonMapIndex;
- //for (int i = 0; i < asize; i ++) System.err.println("Map: "+Integer.toString(this.map[i], 16));
- }
-
- public String toString(int options) {
- String ret;
- if (this.type == RANGE) {
- if (this == Token.token_dot)
- ret = ".";
- else if (this == Token.token_0to9)
- ret = "\\d";
- else if (this == Token.token_wordchars)
- ret = "\\w";
- else if (this == Token.token_spaces)
- ret = "\\s";
- else {
- StringBuffer sb = new StringBuffer();
- sb.append("[");
- for (int i = 0; i < this.ranges.length; i += 2) {
- if ((options & RegularExpression.SPECIAL_COMMA) != 0 && i > 0) sb.append(",");
- if (this.ranges[i] == this.ranges[i+1]) {
- sb.append(escapeCharInCharClass(this.ranges[i]));
- } else {
- sb.append(escapeCharInCharClass(this.ranges[i]));
- sb.append((char)'-');
- sb.append(escapeCharInCharClass(this.ranges[i+1]));
- }
- }
- sb.append("]");
- ret = sb.toString();
- }
- } else {
- if (this == Token.token_not_0to9)
- ret = "\\D";
- else if (this == Token.token_not_wordchars)
- ret = "\\W";
- else if (this == Token.token_not_spaces)
- ret = "\\S";
- else {
- StringBuffer sb = new StringBuffer();
- sb.append("[^");
- for (int i = 0; i < this.ranges.length; i += 2) {
- if ((options & RegularExpression.SPECIAL_COMMA) != 0 && i > 0) sb.append(",");
- if (this.ranges[i] == this.ranges[i+1]) {
- sb.append(escapeCharInCharClass(this.ranges[i]));
- } else {
- sb.append(escapeCharInCharClass(this.ranges[i]));
- sb.append('-');
- sb.append(escapeCharInCharClass(this.ranges[i+1]));
- }
- }
- sb.append("]");
- ret = sb.toString();
- }
- }
- return ret;
- }
-
- private static String escapeCharInCharClass(int ch) {
- String ret;
- switch (ch) {
- case '[': case ']': case '-': case '^':
- case ',': case '\\':
- ret = "\\"+(char)ch;
- break;
- case '\f': ret = "\\f"; break;
- case '\n': ret = "\\n"; break;
- case '\r': ret = "\\r"; break;
- case '\t': ret = "\\t"; break;
- case 0x1b: ret = "\\e"; break;
- //case 0x0b: ret = "\\v"; break;
- default:
- if (ch < 0x20) {
- String pre = "0"+Integer.toHexString(ch);
- ret = "\\x"+pre.substring(pre.length()-2, pre.length());
- } else if (ch >= 0x10000) {
- String pre = "0"+Integer.toHexString(ch);
- ret = "\\v"+pre.substring(pre.length()-6, pre.length());
- } else
- ret = ""+(char)ch;
- }
- return ret;
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/RegexParser.java b/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/RegexParser.java
deleted file mode 100644
index ed1cda9..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/RegexParser.java
+++ /dev/null
@@ -1,1241 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xpath.regex;
-
-import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-import java.util.Vector;
-
-/**
- * A Regular Expression Parser.
- *
- * @xerces.internal
- *
- * @version $Id: RegexParser.java,v 1.8 2010-11-01 04:39:54 joehw Exp $
- */
-class RegexParser {
- static final int T_CHAR = 0;
- static final int T_EOF = 1;
- static final int T_OR = 2; // '|'
- static final int T_STAR = 3; // '*'
- static final int T_PLUS = 4; // '+'
- static final int T_QUESTION = 5; // '?'
- static final int T_LPAREN = 6; // '('
- static final int T_RPAREN = 7; // ')'
- static final int T_DOT = 8; // '.'
- static final int T_LBRACKET = 9; // '['
- static final int T_BACKSOLIDUS = 10; // '\'
- static final int T_CARET = 11; // '^'
- static final int T_DOLLAR = 12; // '$'
- static final int T_LPAREN2 = 13; // '(?:'
- static final int T_LOOKAHEAD = 14; // '(?='
- static final int T_NEGATIVELOOKAHEAD = 15; // '(?!'
- static final int T_LOOKBEHIND = 16; // '(?<='
- static final int T_NEGATIVELOOKBEHIND = 17; // '(?<!'
- static final int T_INDEPENDENT = 18; // '(?>'
- static final int T_SET_OPERATIONS = 19; // '(?['
- static final int T_POSIX_CHARCLASS_START = 20; // '[:' in a character class
- static final int T_COMMENT = 21; // '(?#'
- static final int T_MODIFIERS = 22; // '(?' [\-,a-z,A-Z]
- static final int T_CONDITION = 23; // '(?('
- static final int T_XMLSCHEMA_CC_SUBTRACTION = 24; // '-[' in a character class
-
- static class ReferencePosition {
- int refNumber;
- int position;
- ReferencePosition(int n, int pos) {
- this.refNumber = n;
- this.position = pos;
- }
- }
-
- int offset;
- String regex;
- int regexlen;
- int options;
- ResourceBundle resources;
- int chardata;
- int nexttoken;
- static protected final int S_NORMAL = 0;
- static protected final int S_INBRACKETS = 1;
- static protected final int S_INXBRACKETS = 2;
- int context = S_NORMAL;
- int parenOpened = 1;
- int parennumber = 1;
- boolean hasBackReferences;
- Vector references = null;
- int parenCount = 0;
-
- public RegexParser() {
- this.setLocale(Locale.getDefault());
- }
- public RegexParser(Locale locale) {
- this.setLocale(locale);
- }
-
- public void setLocale(Locale locale) {
- try {
- if (locale != null) {
- this.resources = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.xpath.regex.message", locale);
- }
- else {
- this.resources = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.xpath.regex.message");
- }
- }
- catch (MissingResourceException mre) {
- throw new RuntimeException("Installation Problem??? Couldn't load messages: "
- + mre.getMessage());
- }
- }
-
- final ParseException ex(String key, int loc) {
- return new ParseException(this.resources.getString(key), loc);
- }
-
- protected final boolean isSet(int flag) {
- return (this.options & flag) == flag;
- }
-
- synchronized Token parse(String regex, int options) throws ParseException {
- this.options = options;
- this.offset = 0;
- this.setContext(S_NORMAL);
- this.parennumber = 1;
- this.parenOpened = 1;
- this.hasBackReferences = false;
- this.regex = regex;
- if (this.isSet(RegularExpression.EXTENDED_COMMENT))
- this.regex = REUtil.stripExtendedComment(this.regex);
- this.regexlen = this.regex.length();
-
-
- this.next();
- Token ret = this.parseRegex();
- if (this.offset != this.regexlen)
- throw ex("parser.parse.1", this.offset);
- if (parenCount < 0)
- throw ex("parser.factor.0", this.offset);
- if (this.references != null) {
- for (int i = 0; i < this.references.size(); i ++) {
- ReferencePosition position = (ReferencePosition)this.references.elementAt(i);
- if (this.parennumber <= position.refNumber)
- throw ex("parser.parse.2", position.position);
- }
- this.references.removeAllElements();
- }
- return ret;
- }
-
- /*
- public RegularExpression createRegex(String regex, int options) throws ParseException {
- Token tok = this.parse(regex, options);
- return new RegularExpression(regex, tok, this.parennumber, this.hasBackReferences, options);
- }
- */
-
- protected final void setContext(int con) {
- this.context = con;
- }
-
- final int read() {
- return this.nexttoken;
- }
-
- final void next() {
- if (this.offset >= this.regexlen) {
- this.chardata = -1;
- this.nexttoken = T_EOF;
- return;
- }
-
- int ret;
- int ch = this.regex.charAt(this.offset++);
- this.chardata = ch;
-
- if (this.context == S_INBRACKETS) {
- // In a character class, this.chardata has one character, that is to say,
- // a pair of surrogates is composed and stored to this.chardata.
- switch (ch) {
- case '\\':
- ret = T_BACKSOLIDUS;
- if (this.offset >= this.regexlen)
- throw ex("parser.next.1", this.offset-1);
- this.chardata = this.regex.charAt(this.offset++);
- break;
-
- case '-':
- // Allow character class subtraction (regardless of whether we are in
- // XML Schema mode or not)
- if (this.offset < this.regexlen && this.regex.charAt(this.offset) == '[') {
- this.offset++;
- ret = T_XMLSCHEMA_CC_SUBTRACTION;
- } else
- ret = T_CHAR;
- break;
-
- case '[':
- if (!this.isSet(RegularExpression.XMLSCHEMA_MODE)
- && this.offset < this.regexlen && this.regex.charAt(this.offset) == ':') {
- this.offset++;
- ret = T_POSIX_CHARCLASS_START;
- break;
- } // Through down
- default:
- if (REUtil.isHighSurrogate(ch) && this.offset < this.regexlen) {
- int low = this.regex.charAt(this.offset);
- if (REUtil.isLowSurrogate(low)) {
- this.chardata = REUtil.composeFromSurrogates(ch, low);
- this.offset ++;
- }
- }
- ret = T_CHAR;
- }
- this.nexttoken = ret;
- return;
- }
-
- switch (ch) {
- case '|': ret = T_OR; break;
- case '*': ret = T_STAR; break;
- case '+': ret = T_PLUS; break;
- case '?': ret = T_QUESTION; break;
- case ')': ret = T_RPAREN; break;
- case '.': ret = T_DOT; break;
- case '[': ret = T_LBRACKET; break;
- case '^':
- if (this.isSet(RegularExpression.XMLSCHEMA_MODE)) {
- ret = T_CHAR;
- }
- else {
- ret = T_CARET;
- }
- break;
- case '$':
- if (this.isSet(RegularExpression.XMLSCHEMA_MODE)) {
- ret = T_CHAR;
- }
- else {
- ret = T_DOLLAR;
- }
- break;
- case '(':
- ret = T_LPAREN;
- parenCount++;
- if (this.offset >= this.regexlen)
- break;
- if (this.regex.charAt(this.offset) != '?')
- break;
- if (++this.offset >= this.regexlen)
- throw ex("parser.next.2", this.offset-1);
- ch = this.regex.charAt(this.offset++);
- switch (ch) {
- case ':': ret = T_LPAREN2; break;
- case '=': ret = T_LOOKAHEAD; break;
- case '!': ret = T_NEGATIVELOOKAHEAD; break;
- case '[': ret = T_SET_OPERATIONS; break;
- case '>': ret = T_INDEPENDENT; break;
- case '<':
- if (this.offset >= this.regexlen)
- throw ex("parser.next.2", this.offset-3);
- ch = this.regex.charAt(this.offset++);
- if (ch == '=') {
- ret = T_LOOKBEHIND;
- } else if (ch == '!') {
- ret = T_NEGATIVELOOKBEHIND;
- } else
- throw ex("parser.next.3", this.offset-3);
- break;
- case '#':
- while (this.offset < this.regexlen) {
- ch = this.regex.charAt(this.offset++);
- if (ch == ')') break;
- }
- if (ch != ')')
- throw ex("parser.next.4", this.offset-1);
- ret = T_COMMENT;
- break;
- default:
- if (ch == '-' || 'a' <= ch && ch <= 'z' || 'A' <= ch && ch <= 'Z') {// Options
- this.offset --;
- ret = T_MODIFIERS;
- break;
- } else if (ch == '(') { // conditional
- ret = T_CONDITION; // this.offsets points the next of '('.
- break;
- }
- throw ex("parser.next.2", this.offset-2);
- }
- break;
-
- case '\\':
- ret = T_BACKSOLIDUS;
- if (this.offset >= this.regexlen)
- throw ex("parser.next.1", this.offset-1);
- this.chardata = this.regex.charAt(this.offset++);
- break;
-
- default:
- ret = T_CHAR;
- }
- this.nexttoken = ret;
- }
-
- /**
- * regex ::= term (`|` term)*
- * term ::= factor+
- * factor ::= ('^' | '$' | '\A' | '\Z' | '\z' | '\b' | '\B' | '\<' | '\>'
- * | atom (('*' | '+' | '?' | minmax ) '?'? )?)
- * | '(?=' regex ')' | '(?!' regex ')' | '(?&lt;=' regex ')' | '(?&lt;!' regex ')'
- * atom ::= char | '.' | range | '(' regex ')' | '(?:' regex ')' | '\' [0-9]
- * | '\w' | '\W' | '\d' | '\D' | '\s' | '\S' | category-block
- */
- Token parseRegex() throws ParseException {
- Token tok = this.parseTerm();
- Token parent = null;
- while (this.read() == T_OR) {
- this.next(); // '|'
- if (parent == null) {
- parent = Token.createUnion();
- parent.addChild(tok);
- tok = parent;
- }
- tok.addChild(this.parseTerm());
- }
- return tok;
- }
-
- /**
- * term ::= factor+
- */
- Token parseTerm() throws ParseException {
- int ch = this.read();
- Token tok = null;
- if (ch == T_OR || ch == T_RPAREN || ch == T_EOF) {
- tok = Token.createEmpty();
- } else {
- tok = this.parseFactor();
- Token concat = null;
- while ((ch = this.read()) != T_OR && ch != T_RPAREN && ch != T_EOF) {
- if (concat == null) {
- concat = Token.createConcat();
- concat.addChild(tok);
- tok = concat;
- }
- concat.addChild(this.parseFactor());
- //tok = Token.createConcat(tok, this.parseFactor());
- }
- }
- if (ch == T_RPAREN) {
- parenCount--;
- }
- return tok;
- }
-
- // ----------------------------------------------------------------
-
- Token processCaret() throws ParseException {
- this.next();
- return Token.token_linebeginning;
- }
- Token processDollar() throws ParseException {
- this.next();
- return Token.token_lineend;
- }
- Token processLookahead() throws ParseException {
- this.next();
- Token tok = Token.createLook(Token.LOOKAHEAD, this.parseRegex());
- if (this.read() != T_RPAREN) throw ex("parser.factor.1", this.offset-1);
- this.next(); // ')'
- return tok;
- }
- Token processNegativelookahead() throws ParseException {
- this.next();
- Token tok = Token.createLook(Token.NEGATIVELOOKAHEAD, this.parseRegex());
- if (this.read() != T_RPAREN) throw ex("parser.factor.1", this.offset-1);
- this.next(); // ')'
- return tok;
- }
- Token processLookbehind() throws ParseException {
- this.next();
- Token tok = Token.createLook(Token.LOOKBEHIND, this.parseRegex());
- if (this.read() != T_RPAREN) throw ex("parser.factor.1", this.offset-1);
- this.next(); // ')'
- return tok;
- }
- Token processNegativelookbehind() throws ParseException {
- this.next();
- Token tok = Token.createLook(Token.NEGATIVELOOKBEHIND, this.parseRegex());
- if (this.read() != T_RPAREN) throw ex("parser.factor.1", this.offset-1);
- this.next(); // ')'
- return tok;
- }
- Token processBacksolidus_A() throws ParseException {
- this.next();
- return Token.token_stringbeginning;
- }
- Token processBacksolidus_Z() throws ParseException {
- this.next();
- return Token.token_stringend2;
- }
- Token processBacksolidus_z() throws ParseException {
- this.next();
- return Token.token_stringend;
- }
- Token processBacksolidus_b() throws ParseException {
- this.next();
- return Token.token_wordedge;
- }
- Token processBacksolidus_B() throws ParseException {
- this.next();
- return Token.token_not_wordedge;
- }
- Token processBacksolidus_lt() throws ParseException {
- this.next();
- return Token.token_wordbeginning;
- }
- Token processBacksolidus_gt() throws ParseException {
- this.next();
- return Token.token_wordend;
- }
- Token processStar(Token tok) throws ParseException {
- this.next();
- if (this.read() == T_QUESTION) {
- this.next();
- return Token.createNGClosure(tok);
- } else
- return Token.createClosure(tok);
- }
- Token processPlus(Token tok) throws ParseException {
- // X+ -> XX*
- this.next();
- if (this.read() == T_QUESTION) {
- this.next();
- return Token.createConcat(tok, Token.createNGClosure(tok));
- } else
- return Token.createConcat(tok, Token.createClosure(tok));
- }
- Token processQuestion(Token tok) throws ParseException {
- // X? -> X|
- this.next();
- Token par = Token.createUnion();
- if (this.read() == T_QUESTION) {
- this.next();
- par.addChild(Token.createEmpty());
- par.addChild(tok);
- } else {
- par.addChild(tok);
- par.addChild(Token.createEmpty());
- }
- return par;
- }
- boolean checkQuestion(int off) {
- return off < this.regexlen && this.regex.charAt(off) == '?';
- }
- Token processParen() throws ParseException {
- this.next();
- int p = this.parenOpened++;
- Token tok = Token.createParen(this.parseRegex(), p);
- if (this.read() != T_RPAREN) throw ex("parser.factor.1", this.offset-1);
- this.parennumber++;
- this.next(); // Skips ')'
- return tok;
- }
- Token processParen2() throws ParseException {
- this.next();
- Token tok = Token.createParen(this.parseRegex(), 0);
- if (this.read() != T_RPAREN) throw ex("parser.factor.1", this.offset-1);
- this.next(); // Skips ')'
- return tok;
- }
- Token processCondition() throws ParseException {
- // this.offset points the next of '('
- if (this.offset+1 >= this.regexlen) throw ex("parser.factor.4", this.offset);
- // Parses a condition.
- int refno = -1;
- Token condition = null;
- int ch = this.regex.charAt(this.offset);
- if ('1' <= ch && ch <= '9') {
- refno = ch-'0';
- int finalRefno = refno;
-
- if (this.parennumber <= refno)
- throw ex("parser.parse.2", this.offset);
-
- while (this.offset + 1 < this.regexlen) {
- ch = this.regex.charAt(this.offset + 1);
- if ('1' <= ch && ch <= '9') {
- refno = (refno * 10) + (ch - '0');
- if (refno < this.parennumber) {
- finalRefno= refno;
- ++this.offset;
- }
- else {
- break;
- }
- }
- else {
- break;
- }
- }
-
- this.hasBackReferences = true;
- if (this.references == null) this.references = new Vector();
- this.references.addElement(new ReferencePosition(finalRefno, this.offset));
- this.offset ++;
- if (this.regex.charAt(this.offset) != ')') throw ex("parser.factor.1", this.offset);
- this.offset ++;
- } else {
- if (ch == '?') this.offset --; // Points '('.
- this.next();
- condition = this.parseFactor();
- switch (condition.type) {
- case Token.LOOKAHEAD:
- case Token.NEGATIVELOOKAHEAD:
- case Token.LOOKBEHIND:
- case Token.NEGATIVELOOKBEHIND:
- break;
- case Token.ANCHOR:
- if (this.read() != T_RPAREN) throw ex("parser.factor.1", this.offset-1);
- break;
- default:
- throw ex("parser.factor.5", this.offset);
- }
- }
- // Parses yes/no-patterns.
- this.next();
- Token yesPattern = this.parseRegex();
- Token noPattern = null;
- if (yesPattern.type == Token.UNION) {
- if (yesPattern.size() != 2) throw ex("parser.factor.6", this.offset);
- noPattern = yesPattern.getChild(1);
- yesPattern = yesPattern.getChild(0);
- }
- if (this.read() != T_RPAREN) throw ex("parser.factor.1", this.offset-1);
- this.next();
- return Token.createCondition(refno, condition, yesPattern, noPattern);
- }
- Token processModifiers() throws ParseException {
- // this.offset points the next of '?'.
- // modifiers ::= [imsw]* ('-' [imsw]*)? ':'
- int add = 0, mask = 0, ch = -1;
- while (this.offset < this.regexlen) {
- ch = this.regex.charAt(this.offset);
- int v = REUtil.getOptionValue(ch);
- if (v == 0) break; // '-' or ':'?
- add |= v;
- this.offset ++;
- }
- if (this.offset >= this.regexlen) throw ex("parser.factor.2", this.offset-1);
- if (ch == '-') {
- this.offset ++;
- while (this.offset < this.regexlen) {
- ch = this.regex.charAt(this.offset);
- int v = REUtil.getOptionValue(ch);
- if (v == 0) break; // ':'?
- mask |= v;
- this.offset ++;
- }
- if (this.offset >= this.regexlen) throw ex("parser.factor.2", this.offset-1);
- }
- Token tok;
- if (ch == ':') {
- this.offset ++;
- this.next();
- tok = Token.createModifierGroup(this.parseRegex(), add, mask);
- if (this.read() != T_RPAREN) throw ex("parser.factor.1", this.offset-1);
- this.next();
- } else if (ch == ')') { // such as (?-i)
- this.offset ++;
- this.next();
- tok = Token.createModifierGroup(this.parseRegex(), add, mask);
- } else
- throw ex("parser.factor.3", this.offset);
-
- return tok;
- }
- Token processIndependent() throws ParseException {
- this.next();
- Token tok = Token.createLook(Token.INDEPENDENT, this.parseRegex());
- if (this.read() != T_RPAREN) throw ex("parser.factor.1", this.offset-1);
- this.next(); // Skips ')'
- return tok;
- }
- Token processBacksolidus_c() throws ParseException {
- int ch2; // Must be in 0x0040-0x005f
- if (this.offset >= this.regexlen
- || ((ch2 = this.regex.charAt(this.offset++)) & 0xffe0) != 0x0040)
- throw ex("parser.atom.1", this.offset-1);
- this.next();
- return Token.createChar(ch2-0x40);
- }
- Token processBacksolidus_C() throws ParseException {
- throw ex("parser.process.1", this.offset);
- }
- Token processBacksolidus_i() throws ParseException {
- Token tok = Token.createChar('i');
- this.next();
- return tok;
- }
- Token processBacksolidus_I() throws ParseException {
- throw ex("parser.process.1", this.offset);
- }
- Token processBacksolidus_g() throws ParseException {
- this.next();
- return Token.getGraphemePattern();
- }
- Token processBacksolidus_X() throws ParseException {
- this.next();
- return Token.getCombiningCharacterSequence();
- }
- Token processBackreference() throws ParseException {
- int refnum = this.chardata-'0';
- int finalRefnum = refnum;
-
- if (this.parennumber <= refnum)
- throw ex("parser.parse.2", this.offset-2);
-
- while (this.offset < this.regexlen) {
- final int ch = this.regex.charAt(this.offset);
- if ('1' <= ch && ch <= '9') {
- refnum = (refnum * 10) + (ch - '0');
- if (refnum < this.parennumber) {
- ++this.offset;
- finalRefnum = refnum;
- this.chardata = ch;
- }
- else {
- break;
- }
- }
- else {
- break;
- }
- }
-
- Token tok = Token.createBackReference(finalRefnum);
- this.hasBackReferences = true;
- if (this.references == null) this.references = new Vector();
- this.references.addElement(new ReferencePosition(finalRefnum, this.offset-2));
- this.next();
- return tok;
- }
-
- // ----------------------------------------------------------------
-
- /**
- * factor ::= ('^' | '$' | '\A' | '\Z' | '\z' | '\b' | '\B' | '\<' | '\>'
- * | atom (('*' | '+' | '?' | minmax ) '?'? )?)
- * | '(?=' regex ')' | '(?!' regex ')' | '(?&lt;=' regex ')' | '(?&lt;!' regex ')'
- * | '(?#' [^)]* ')'
- * minmax ::= '{' min (',' max?)? '}'
- * min ::= [0-9]+
- * max ::= [0-9]+
- */
- Token parseFactor() throws ParseException {
- int ch = this.read();
- Token tok;
- switch (ch) {
- case T_CARET: return this.processCaret();
- case T_DOLLAR: return this.processDollar();
- case T_LOOKAHEAD: return this.processLookahead();
- case T_NEGATIVELOOKAHEAD: return this.processNegativelookahead();
- case T_LOOKBEHIND: return this.processLookbehind();
- case T_NEGATIVELOOKBEHIND: return this.processNegativelookbehind();
-
- case T_COMMENT:
- this.next();
- return Token.createEmpty();
-
- case T_BACKSOLIDUS:
- switch (this.chardata) {
- case 'A': return this.processBacksolidus_A();
- case 'Z': return this.processBacksolidus_Z();
- case 'z': return this.processBacksolidus_z();
- case 'b': return this.processBacksolidus_b();
- case 'B': return this.processBacksolidus_B();
- case '<': return this.processBacksolidus_lt();
- case '>': return this.processBacksolidus_gt();
- }
- // through down
- }
- tok = this.parseAtom();
- ch = this.read();
- switch (ch) {
- case T_STAR: return this.processStar(tok);
- case T_PLUS: return this.processPlus(tok);
- case T_QUESTION: return this.processQuestion(tok);
- case T_CHAR:
- if (this.chardata == '{' && this.offset < this.regexlen) {
-
- int off = this.offset; // this.offset -> next of '{'
- int min = 0, max = -1;
-
- if ((ch = this.regex.charAt(off++)) >= '0' && ch <= '9') {
-
- min = ch -'0';
- while (off < this.regexlen
- && (ch = this.regex.charAt(off++)) >= '0' && ch <= '9') {
- min = min*10 +ch-'0';
- if (min < 0)
- throw ex("parser.quantifier.5", this.offset);
- }
- }
- else {
- throw ex("parser.quantifier.1", this.offset);
- }
-
- max = min;
- if (ch == ',') {
-
- if (off >= this.regexlen) {
- throw ex("parser.quantifier.3", this.offset);
- }
- else if ((ch = this.regex.charAt(off++)) >= '0' && ch <= '9') {
-
- max = ch -'0'; // {min,max}
- while (off < this.regexlen
- && (ch = this.regex.charAt(off++)) >= '0'
- && ch <= '9') {
- max = max*10 +ch-'0';
- if (max < 0)
- throw ex("parser.quantifier.5", this.offset);
- }
-
- if (min > max)
- throw ex("parser.quantifier.4", this.offset);
- }
- else { // assume {min,}
- max = -1;
- }
- }
-
- if (ch != '}')
- throw ex("parser.quantifier.2", this.offset);
-
- if (this.checkQuestion(off)) { // off -> next of '}'
- tok = Token.createNGClosure(tok);
- this.offset = off+1;
- } else {
- tok = Token.createClosure(tok);
- this.offset = off;
- }
-
- tok.setMin(min);
- tok.setMax(max);
- //System.err.println("CLOSURE: "+min+", "+max);
- this.next();
- }
- }
- return tok;
- }
-
- /**
- * atom ::= char | '.' | char-class | '(' regex ')' | '(?:' regex ')' | '\' [0-9]
- * | '\w' | '\W' | '\d' | '\D' | '\s' | '\S' | category-block
- * | '(?>' regex ')'
- * char ::= '\\' | '\' [efnrt] | bmp-code | character-1
- */
- Token parseAtom() throws ParseException {
- int ch = this.read();
- Token tok = null;
- switch (ch) {
- case T_LPAREN: return this.processParen();
- case T_LPAREN2: return this.processParen2(); // '(?:'
- case T_CONDITION: return this.processCondition(); // '(?('
- case T_MODIFIERS: return this.processModifiers(); // (?modifiers ... )
- case T_INDEPENDENT: return this.processIndependent();
- case T_DOT:
- this.next(); // Skips '.'
- tok = Token.token_dot;
- break;
-
- /**
- * char-class ::= '[' ( '^'? range ','?)+ ']'
- * range ::= '\d' | '\w' | '\s' | category-block | range-char
- * | range-char '-' range-char
- * range-char ::= '\[' | '\]' | '\\' | '\' [,-efnrtv] | bmp-code | character-2
- * bmp-char ::= '\' 'u' [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F]
- */
- case T_LBRACKET: return this.parseCharacterClass(true);
- case T_SET_OPERATIONS: return this.parseSetOperations();
-
- case T_BACKSOLIDUS:
- switch (this.chardata) {
- case 'd': case 'D':
- case 'w': case 'W':
- case 's': case 'S':
- tok = this.getTokenForShorthand(this.chardata);
- this.next();
- return tok;
-
- case 'e': case 'f': case 'n': case 'r':
- case 't': case 'u': case 'v': case 'x':
- {
- int ch2 = this.decodeEscaped();
- if (ch2 < 0x10000) {
- tok = Token.createChar(ch2);
- } else {
- tok = Token.createString(REUtil.decomposeToSurrogates(ch2));
- }
- }
- break;
-
- case 'c': return this.processBacksolidus_c();
- case 'C': return this.processBacksolidus_C();
- case 'i': return this.processBacksolidus_i();
- case 'I': return this.processBacksolidus_I();
- case 'g': return this.processBacksolidus_g();
- case 'X': return this.processBacksolidus_X();
- case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- return this.processBackreference();
-
- case 'P':
- case 'p':
- int pstart = this.offset;
- tok = processBacksolidus_pP(this.chardata);
- if (tok == null) throw this.ex("parser.atom.5", pstart);
- break;
-
- default:
- tok = Token.createChar(this.chardata);
- }
- this.next();
- break;
-
- case T_CHAR:
- if (this.chardata == ']' || this.chardata == '{' || this.chardata == '}')
- throw this.ex("parser.atom.4", this.offset-1);
- tok = Token.createChar(this.chardata);
- int high = this.chardata;
- this.next();
- if (REUtil.isHighSurrogate(high)
- && this.read() == T_CHAR && REUtil.isLowSurrogate(this.chardata)) {
- char[] sur = new char[2];
- sur[0] = (char)high;
- sur[1] = (char)this.chardata;
- tok = Token.createParen(Token.createString(new String(sur)), 0);
- this.next();
- }
- break;
-
- default:
- throw this.ex("parser.atom.4", this.offset-1);
- }
- return tok;
- }
-
- protected RangeToken processBacksolidus_pP(int c) throws ParseException {
-
- this.next();
- if (this.read() != T_CHAR || this.chardata != '{')
- throw this.ex("parser.atom.2", this.offset-1);
-
- // handle category escape
- boolean positive = c == 'p';
- int namestart = this.offset;
- int nameend = this.regex.indexOf('}', namestart);
-
- if (nameend < 0)
- throw this.ex("parser.atom.3", this.offset);
-
- String pname = this.regex.substring(namestart, nameend);
- this.offset = nameend+1;
-
- return Token.getRange(pname, positive, this.isSet(RegularExpression.XMLSCHEMA_MODE));
- }
-
- int processCIinCharacterClass(RangeToken tok, int c) {
- return this.decodeEscaped();
- }
-
- /**
- * char-class ::= '[' ( '^'? range ','?)+ ']'
- * range ::= '\d' | '\w' | '\s' | category-block | range-char
- * | range-char '-' range-char
- * range-char ::= '\[' | '\]' | '\\' | '\' [,-efnrtv] | bmp-code | character-2
- * bmp-code ::= '\' 'u' [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F]
- */
- protected RangeToken parseCharacterClass(boolean useNrange) throws ParseException {
- this.setContext(S_INBRACKETS);
- this.next(); // '['
- boolean nrange = false;
- RangeToken base = null;
- RangeToken tok;
- if (this.read() == T_CHAR && this.chardata == '^') {
- nrange = true;
- this.next(); // '^'
- if (useNrange) {
- tok = Token.createNRange();
- } else {
- base = Token.createRange();
- base.addRange(0, Token.UTF16_MAX);
- tok = Token.createRange();
- }
- } else {
- tok = Token.createRange();
- }
- int type;
- boolean firstloop = true;
- while ((type = this.read()) != T_EOF) {
- if (type == T_CHAR && this.chardata == ']' && !firstloop)
- break;
- int c = this.chardata;
- boolean end = false;
- if (type == T_BACKSOLIDUS) {
- switch (c) {
- case 'd': case 'D':
- case 'w': case 'W':
- case 's': case 'S':
- tok.mergeRanges(this.getTokenForShorthand(c));
- end = true;
- break;
-
- case 'i': case 'I':
- case 'c': case 'C':
- c = this.processCIinCharacterClass(tok, c);
- if (c < 0) end = true;
- break;
-
- case 'p':
- case 'P':
- int pstart = this.offset;
- RangeToken tok2 = this.processBacksolidus_pP(c);
- if (tok2 == null) throw this.ex("parser.atom.5", pstart);
- tok.mergeRanges(tok2);
- end = true;
- break;
-
- default:
- c = this.decodeEscaped();
- } // \ + c
- } // backsolidus
- // POSIX Character class such as [:alnum:]
- else if (type == T_POSIX_CHARCLASS_START) {
- int nameend = this.regex.indexOf(':', this.offset);
- if (nameend < 0) throw this.ex("parser.cc.1", this.offset);
- boolean positive = true;
- if (this.regex.charAt(this.offset) == '^') {
- this.offset ++;
- positive = false;
- }
- String name = this.regex.substring(this.offset, nameend);
- RangeToken range = Token.getRange(name, positive,
- this.isSet(RegularExpression.XMLSCHEMA_MODE));
- if (range == null) throw this.ex("parser.cc.3", this.offset);
- tok.mergeRanges(range);
- end = true;
- if (nameend+1 >= this.regexlen || this.regex.charAt(nameend+1) != ']')
- throw this.ex("parser.cc.1", nameend);
- this.offset = nameend+2;
- }
- else if (type == T_XMLSCHEMA_CC_SUBTRACTION && !firstloop) {
- if (nrange) {
- nrange = false;
- if (useNrange) {
- tok = (RangeToken) Token.complementRanges(tok);
- }
- else {
- base.subtractRanges(tok);
- tok = base;
- }
- }
- RangeToken range2 = this.parseCharacterClass(false);
- tok.subtractRanges(range2);
- if (this.read() != T_CHAR || this.chardata != ']') {
- throw this.ex("parser.cc.5", this.offset);
- }
- break; // Exit this loop
- }
- this.next();
- if (!end) { // if not shorthands...
- if (this.read() != T_CHAR || this.chardata != '-') { // Here is no '-'.
- if (!this.isSet(RegularExpression.IGNORE_CASE) || c > 0xffff) {
- tok.addRange(c, c);
- }
- else {
- addCaseInsensitiveChar(tok, c);
- }
- }
- else if (type == T_XMLSCHEMA_CC_SUBTRACTION) {
- throw this.ex("parser.cc.8", this.offset-1);
- }
- else {
- this.next(); // Skips '-'
- if ((type = this.read()) == T_EOF) throw this.ex("parser.cc.2", this.offset);
- if (type == T_CHAR && this.chardata == ']') {
- if (!this.isSet(RegularExpression.IGNORE_CASE) || c > 0xffff) {
- tok.addRange(c, c);
- }
- else {
- addCaseInsensitiveChar(tok, c);
- }
- tok.addRange('-', '-');
- } else {
- int rangeend = this.chardata;
- if (type == T_BACKSOLIDUS) {
- rangeend = this.decodeEscaped();
- }
- this.next();
- if (c > rangeend) {
- throw this.ex("parser.ope.3", this.offset-1);
- }
- if (!this.isSet(RegularExpression.IGNORE_CASE) ||
- (c > 0xffff && rangeend > 0xffff)) {
- tok.addRange(c, rangeend);
- }
- else {
- addCaseInsensitiveCharRange(tok, c, rangeend);
- }
- }
- }
- }
- if (this.isSet(RegularExpression.SPECIAL_COMMA)
- && this.read() == T_CHAR && this.chardata == ',') {
- this.next();
- }
- firstloop = false;
- }
- if (this.read() == T_EOF) {
- throw this.ex("parser.cc.2", this.offset);
- }
-
- if (!useNrange && nrange) {
- base.subtractRanges(tok);
- tok = base;
- }
- tok.sortRanges();
- tok.compactRanges();
- this.setContext(S_NORMAL);
- this.next(); // Skips ']'
-
- return tok;
- }
-
- /**
- * '(?[' ... ']' (('-' | '+' | '&') '[' ... ']')? ')'
- */
- protected RangeToken parseSetOperations() throws ParseException {
- RangeToken tok = this.parseCharacterClass(false);
- int type;
- while ((type = this.read()) != T_RPAREN) {
- int ch = this.chardata;
- if (type == T_CHAR && (ch == '-' || ch == '&')
- || type == T_PLUS) {
- this.next();
- if (this.read() != T_LBRACKET) throw ex("parser.ope.1", this.offset-1);
- RangeToken t2 = this.parseCharacterClass(false);
- if (type == T_PLUS)
- tok.mergeRanges(t2);
- else if (ch == '-')
- tok.subtractRanges(t2);
- else if (ch == '&')
- tok.intersectRanges(t2);
- else
- throw new RuntimeException("ASSERT");
- } else {
- throw ex("parser.ope.2", this.offset-1);
- }
- }
- this.next();
- return tok;
- }
-
- Token getTokenForShorthand(int ch) {
- Token tok;
- switch (ch) {
- case 'd':
- tok = this.isSet(RegularExpression.USE_UNICODE_CATEGORY)
- ? Token.getRange("Nd", true) : Token.token_0to9;
- break;
- case 'D':
- tok = this.isSet(RegularExpression.USE_UNICODE_CATEGORY)
- ? Token.getRange("Nd", false) : Token.token_not_0to9;
- break;
- case 'w':
- tok = this.isSet(RegularExpression.USE_UNICODE_CATEGORY)
- ? Token.getRange("IsWord", true) : Token.token_wordchars;
- break;
- case 'W':
- tok = this.isSet(RegularExpression.USE_UNICODE_CATEGORY)
- ? Token.getRange("IsWord", false) : Token.token_not_wordchars;
- break;
- case 's':
- tok = this.isSet(RegularExpression.USE_UNICODE_CATEGORY)
- ? Token.getRange("IsSpace", true) : Token.token_spaces;
- break;
- case 'S':
- tok = this.isSet(RegularExpression.USE_UNICODE_CATEGORY)
- ? Token.getRange("IsSpace", false) : Token.token_not_spaces;
- break;
-
- default:
- throw new RuntimeException("Internal Error: shorthands: \\u"+Integer.toString(ch, 16));
- }
- return tok;
- }
-
- /**
- */
- int decodeEscaped() throws ParseException {
- if (this.read() != T_BACKSOLIDUS) throw ex("parser.next.1", this.offset-1);
- int c = this.chardata;
- switch (c) {
- case 'e': c = 0x1b; break; // ESCAPE U+001B
- case 'f': c = '\f'; break; // FORM FEED U+000C
- case 'n': c = '\n'; break; // LINE FEED U+000A
- case 'r': c = '\r'; break; // CRRIAGE RETURN U+000D
- case 't': c = '\t'; break; // HORIZONTAL TABULATION U+0009
- //case 'v': c = 0x0b; break; // VERTICAL TABULATION U+000B
- case 'x':
- this.next();
- if (this.read() != T_CHAR) throw ex("parser.descape.1", this.offset-1);
- if (this.chardata == '{') {
- int v1 = 0;
- int uv = 0;
- do {
- this.next();
- if (this.read() != T_CHAR) throw ex("parser.descape.1", this.offset-1);
- if ((v1 = hexChar(this.chardata)) < 0)
- break;
- if (uv > uv*16) throw ex("parser.descape.2", this.offset-1);
- uv = uv*16+v1;
- } while (true);
- if (this.chardata != '}') throw ex("parser.descape.3", this.offset-1);
- if (uv > Token.UTF16_MAX) throw ex("parser.descape.4", this.offset-1);
- c = uv;
- } else {
- int v1 = 0;
- if (this.read() != T_CHAR || (v1 = hexChar(this.chardata)) < 0)
- throw ex("parser.descape.1", this.offset-1);
- int uv = v1;
- this.next();
- if (this.read() != T_CHAR || (v1 = hexChar(this.chardata)) < 0)
- throw ex("parser.descape.1", this.offset-1);
- uv = uv*16+v1;
- c = uv;
- }
- break;
-
- case 'u':
- int v1 = 0;
- this.next();
- if (this.read() != T_CHAR || (v1 = hexChar(this.chardata)) < 0)
- throw ex("parser.descape.1", this.offset-1);
- int uv = v1;
- this.next();
- if (this.read() != T_CHAR || (v1 = hexChar(this.chardata)) < 0)
- throw ex("parser.descape.1", this.offset-1);
- uv = uv*16+v1;
- this.next();
- if (this.read() != T_CHAR || (v1 = hexChar(this.chardata)) < 0)
- throw ex("parser.descape.1", this.offset-1);
- uv = uv*16+v1;
- this.next();
- if (this.read() != T_CHAR || (v1 = hexChar(this.chardata)) < 0)
- throw ex("parser.descape.1", this.offset-1);
- uv = uv*16+v1;
- c = uv;
- break;
-
- case 'v':
- this.next();
- if (this.read() != T_CHAR || (v1 = hexChar(this.chardata)) < 0)
- throw ex("parser.descape.1", this.offset-1);
- uv = v1;
- this.next();
- if (this.read() != T_CHAR || (v1 = hexChar(this.chardata)) < 0)
- throw ex("parser.descape.1", this.offset-1);
- uv = uv*16+v1;
- this.next();
- if (this.read() != T_CHAR || (v1 = hexChar(this.chardata)) < 0)
- throw ex("parser.descape.1", this.offset-1);
- uv = uv*16+v1;
- this.next();
- if (this.read() != T_CHAR || (v1 = hexChar(this.chardata)) < 0)
- throw ex("parser.descape.1", this.offset-1);
- uv = uv*16+v1;
- this.next();
- if (this.read() != T_CHAR || (v1 = hexChar(this.chardata)) < 0)
- throw ex("parser.descape.1", this.offset-1);
- uv = uv*16+v1;
- this.next();
- if (this.read() != T_CHAR || (v1 = hexChar(this.chardata)) < 0)
- throw ex("parser.descape.1", this.offset-1);
- uv = uv*16+v1;
- if (uv > Token.UTF16_MAX) throw ex("parser.descappe.4", this.offset-1);
- c = uv;
- break;
- case 'A':
- case 'Z':
- case 'z':
- throw ex("parser.descape.5", this.offset-2);
- default:
- }
- return c;
- }
-
- static private final int hexChar(int ch) {
- if (ch < '0') return -1;
- if (ch > 'f') return -1;
- if (ch <= '9') return ch-'0';
- if (ch < 'A') return -1;
- if (ch <= 'F') return ch-'A'+10;
- if (ch < 'a') return -1;
- return ch-'a'+10;
- }
-
- static protected final void addCaseInsensitiveChar(RangeToken tok, int c) {
- final int[] caseMap = CaseInsensitiveMap.get(c);
- tok.addRange(c, c);
-
- if (caseMap != null) {
- for (int i=0; i<caseMap.length; i+=2) {
- tok.addRange(caseMap[i], caseMap[i]);
- }
- }
-
- }
-
- static protected final void addCaseInsensitiveCharRange(RangeToken tok, int start, int end) {
- int[] caseMap;
- int r1, r2;
- if (start <= end) {
- r1 = start;
- r2 = end;
- } else {
- r1 = end;
- r2 = start;
- }
-
- tok.addRange(r1, r2);
- for (int ch = r1; ch <= r2; ch++) {
- caseMap = CaseInsensitiveMap.get(ch);
- if (caseMap != null) {
- for (int i=0; i<caseMap.length; i+=2) {
- tok.addRange(caseMap[i], caseMap[i]);
- }
- }
- }
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/RegularExpression.java b/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/RegularExpression.java
deleted file mode 100644
index fa488d6..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/RegularExpression.java
+++ /dev/null
@@ -1,2446 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xpath.regex;
-
-import java.text.CharacterIterator;
-import java.util.Locale;
-import java.util.Stack;
-
-import com.sun.org.apache.xerces.internal.util.IntStack;
-
-/**
- * A regular expression matching engine using Non-deterministic Finite Automaton (NFA).
- * This engine does not conform to the POSIX regular expression.
- *
- * <hr width="50%">
- * <h3>How to use</h3>
- *
- * <dl>
- * <dt>A. Standard way
- * <dd>
- * <pre>
- * RegularExpression re = new RegularExpression(<var>regex</var>);
- * if (re.matches(text)) { ... }
- * </pre>
- *
- * <dt>B. Capturing groups
- * <dd>
- * <pre>
- * RegularExpression re = new RegularExpression(<var>regex</var>);
- * Match match = new Match();
- * if (re.matches(text, match)) {
- * ... // You can refer captured texts with methods of the <code>Match</code> class.
- * }
- * </pre>
- *
- * </dl>
- *
- * <h4>Case-insensitive matching</h4>
- * <pre>
- * RegularExpression re = new RegularExpression(<var>regex</var>, "i");
- * if (re.matches(text) >= 0) { ...}
- * </pre>
- *
- * <h4>Options</h4>
- * <p>You can specify options to <a href="#RegularExpression(java.lang.String, java.lang.String)"><code>RegularExpression(</code><var>regex</var><code>, </code><var>options</var><code>)</code></a>
- * or <a href="#setPattern(java.lang.String, java.lang.String)"><code>setPattern(</code><var>regex</var><code>, </code><var>options</var><code>)</code></a>.
- * This <var>options</var> parameter consists of the following characters.
- * </p>
- * <dl>
- * <dt><a name="I_OPTION"><code>"i"</code></a>
- * <dd>This option indicates case-insensitive matching.
- * <dt><a name="M_OPTION"><code>"m"</code></a>
- * <dd class="REGEX"><kbd>^</kbd> and <kbd>$</kbd> consider the EOL characters within the text.
- * <dt><a name="S_OPTION"><code>"s"</code></a>
- * <dd class="REGEX"><kbd>.</kbd> matches any one character.
- * <dt><a name="U_OPTION"><code>"u"</code></a>
- * <dd class="REGEX">Redefines <Kbd>\d \D \w \W \s \S \b \B \&lt; \></kbd> as becoming to Unicode.
- * <dt><a name="W_OPTION"><code>"w"</code></a>
- * <dd class="REGEX">By this option, <kbd>\b \B \&lt; \></kbd> are processed with the method of
- * 'Unicode Regular Expression Guidelines' Revision 4.
- * When "w" and "u" are specified at the same time,
- * <kbd>\b \B \&lt; \></kbd> are processed for the "w" option.
- * <dt><a name="COMMA_OPTION"><code>","</code></a>
- * <dd>The parser treats a comma in a character class as a range separator.
- * <kbd class="REGEX">[a,b]</kbd> matches <kbd>a</kbd> or <kbd>,</kbd> or <kbd>b</kbd> without this option.
- * <kbd class="REGEX">[a,b]</kbd> matches <kbd>a</kbd> or <kbd>b</kbd> with this option.
- *
- * <dt><a name="X_OPTION"><code>"X"</code></a>
- * <dd class="REGEX">
- * By this option, the engine confoms to <a href="http://www.w3.org/TR/2000/WD-xmlschema-2-20000407/#regexs">XML Schema: Regular Expression</a>.
- * The <code>match()</code> method does not do subsring matching
- * but entire string matching.
- *
- * </dl>
- *
- * <hr width="50%">
- * <h3>Syntax</h3>
- * <table border="1" bgcolor="#ddeeff">
- * <tr>
- * <td>
- * <h4>Differences from the Perl 5 regular expression</h4>
- * <ul>
- * <li>There is 6-digit hexadecimal character representation (<kbd>\u005cv</kbd><var>HHHHHH</var>.)
- * <li>Supports subtraction, union, and intersection operations for character classes.
- * <li>Not supported: <kbd>\</kbd><var>ooo</var> (Octal character representations),
- * <Kbd>\G</kbd>, <kbd>\C</kbd>, <kbd>\l</kbd><var>c</var>,
- * <kbd>\u005c u</kbd><var>c</var>, <kbd>\L</kbd>, <kbd>\U</kbd>,
- * <kbd>\E</kbd>, <kbd>\Q</kbd>, <kbd>\N{</kbd><var>name</var><kbd>}</kbd>,
- * <Kbd>(?{<kbd><var>code</var><kbd>})</kbd>, <Kbd>(??{<kbd><var>code</var><kbd>})</kbd>
- * </ul>
- * </td>
- * </tr>
- * </table>
- *
- * <P>Meta characters are `<KBD>. * + ? { [ ( ) | \ ^ $</KBD>'.</P>
- * <ul>
- * <li>Character
- * <dl>
- * <dt class="REGEX"><kbd>.</kbd> (A period)
- * <dd>Matches any one character except the following characters.
- * <dd>LINE FEED (U+000A), CARRIAGE RETURN (U+000D),
- * PARAGRAPH SEPARATOR (U+2029), LINE SEPARATOR (U+2028)
- * <dd>This expression matches one code point in Unicode. It can match a pair of surrogates.
- * <dd>When <a href="#S_OPTION">the "s" option</a> is specified,
- * it matches any character including the above four characters.
- *
- * <dt class="REGEX"><Kbd>\e \f \n \r \t</kbd>
- * <dd>Matches ESCAPE (U+001B), FORM FEED (U+000C), LINE FEED (U+000A),
- * CARRIAGE RETURN (U+000D), HORIZONTAL TABULATION (U+0009)
- *
- * <dt class="REGEX"><kbd>\c</kbd><var>C</var>
- * <dd>Matches a control character.
- * The <var>C</var> must be one of '<kbd>@</kbd>', '<kbd>A</kbd>'-'<kbd>Z</kbd>',
- * '<kbd>[</kbd>', '<kbd>\u005c</kbd>', '<kbd>]</kbd>', '<kbd>^</kbd>', '<kbd>_</kbd>'.
- * It matches a control character of which the character code is less than
- * the character code of the <var>C</var> by 0x0040.
- * <dd class="REGEX">For example, a <kbd>\cJ</kbd> matches a LINE FEED (U+000A),
- * and a <kbd>\c[</kbd> matches an ESCAPE (U+001B).
- *
- * <dt class="REGEX">a non-meta character
- * <dd>Matches the character.
- *
- * <dt class="REGEX"><KBD>\</KBD> + a meta character
- * <dd>Matches the meta character.
- *
- * <dt class="REGEX"><kbd>\u005cx</kbd><var>HH</var> <kbd>\u005cx{</kbd><var>HHHH</var><kbd>}</kbd>
- * <dd>Matches a character of which code point is <var>HH</var> (Hexadecimal) in Unicode.
- * You can write just 2 digits for <kbd>\u005cx</kbd><var>HH</var>, and
- * variable length digits for <kbd>\u005cx{</kbd><var>HHHH</var><kbd>}</kbd>.
- *
- * <!--
- * <dt class="REGEX"><kbd>\u005c u</kbd><var>HHHH</var>
- * <dd>Matches a character of which code point is <var>HHHH</var> (Hexadecimal) in Unicode.
- * -->
- *
- * <dt class="REGEX"><kbd>\u005cv</kbd><var>HHHHHH</var>
- * <dd>Matches a character of which code point is <var>HHHHHH</var> (Hexadecimal) in Unicode.
- *
- * <dt class="REGEX"><kbd>\g</kbd>
- * <dd>Matches a grapheme.
- * <dd class="REGEX">It is equivalent to <kbd>(?[\p{ASSIGNED}]-[\p{M}\p{C}])?(?:\p{M}|[\x{094D}\x{09CD}\x{0A4D}\x{0ACD}\x{0B3D}\x{0BCD}\x{0C4D}\x{0CCD}\x{0D4D}\x{0E3A}\x{0F84}]\p{L}|[\x{1160}-\x{11A7}]|[\x{11A8}-\x{11FF}]|[\x{FF9E}\x{FF9F}])*</kbd>
- *
- * <dt class="REGEX"><kbd>\X</kbd>
- * <dd class="REGEX">Matches a combining character sequence.
- * It is equivalent to <kbd>(?:\PM\pM*)</kbd>
- * </dl>
- * </li>
- *
- * <li>Character class
- * <dl>
-+ * <dt class="REGEX"><kbd>[</kbd><var>R<sub>1</sub></var><var>R<sub>2</sub></var><var>...</var><var>R<sub>n</sub></var><kbd>]</kbd> (without <a href="#COMMA_OPTION">"," option</a>)
-+ * <dt class="REGEX"><kbd>[</kbd><var>R<sub>1</sub></var><kbd>,</kbd><var>R<sub>2</sub></var><kbd>,</kbd><var>...</var><kbd>,</kbd><var>R<sub>n</sub></var><kbd>]</kbd> (with <a href="#COMMA_OPTION">"," option</a>)
- * <dd>Positive character class. It matches a character in ranges.
- * <dd><var>R<sub>n</sub></var>:
- * <ul>
- * <li class="REGEX">A character (including <Kbd>\e \f \n \r \t</kbd> <kbd>\u005cx</kbd><var>HH</var> <kbd>\u005cx{</kbd><var>HHHH</var><kbd>}</kbd> <!--kbd>\u005c u</kbd><var>HHHH</var--> <kbd>\u005cv</kbd><var>HHHHHH</var>)
- * <p>This range matches the character.
- * <li class="REGEX"><var>C<sub>1</sub></var><kbd>-</kbd><var>C<sub>2</sub></var>
- * <p>This range matches a character which has a code point that is >= <var>C<sub>1</sub></var>'s code point and &lt;= <var>C<sub>2</sub></var>'s code point.
-+ * <li class="REGEX">A POSIX character class: <Kbd>[:alpha:] [:alnum:] [:ascii:] [:cntrl:] [:digit:] [:graph:] [:lower:] [:print:] [:punct:] [:space:] [:upper:] [:xdigit:]</kbd>,
-+ * and negative POSIX character classes in Perl like <kbd>[:^alpha:]</kbd>
- * <p>...
- * <li class="REGEX"><kbd>\d \D \s \S \w \W \p{</kbd><var>name</var><kbd>} \P{</kbd><var>name</var><kbd>}</kbd>
- * <p>These expressions specifies the same ranges as the following expressions.
- * </ul>
- * <p class="REGEX">Enumerated ranges are merged (union operation).
- * <kbd>[a-ec-z]</kbd> is equivalent to <kbd>[a-z]</kbd>
- *
- * <dt class="REGEX"><kbd>[^</kbd><var>R<sub>1</sub></var><var>R<sub>2</sub></var><var>...</var><var>R<sub>n</sub></var><kbd>]</kbd> (without a <a href="#COMMA_OPTION">"," option</a>)
- * <dt class="REGEX"><kbd>[^</kbd><var>R<sub>1</sub></var><kbd>,</kbd><var>R<sub>2</sub></var><kbd>,</kbd><var>...</var><kbd>,</kbd><var>R<sub>n</sub></var><kbd>]</kbd> (with a <a href="#COMMA_OPTION">"," option</a>)
- * <dd>Negative character class. It matches a character not in ranges.
- *
- * <dt class="REGEX"><kbd>(?[</kbd><var>ranges</var><kbd>]</kbd><var>op</var><kbd>[</kbd><var>ranges</var><kbd>]</kbd><var>op</var><kbd>[</kbd><var>ranges</var><kbd>]</kbd> ... <Kbd>)</kbd>
- * (<var>op</var> is <kbd>-</kbd> or <kbd>+</kbd> or <kbd>&</kbd>.)
- * <dd>Subtraction or union or intersection for character classes.
- * <dd class="REGEX">For exmaple, <kbd>(?[A-Z]-[CF])</kbd> is equivalent to <kbd>[A-BD-EG-Z]</kbd>, and <kbd>(?[0x00-0x7f]-[K]&[\p{Lu}])</kbd> is equivalent to <kbd>[A-JL-Z]</kbd>.
- * <dd>The result of this operations is a <u>positive character class</u>
- * even if an expression includes any negative character classes.
- * You have to take care on this in case-insensitive matching.
- * For instance, <kbd>(?[^b])</kbd> is equivalent to <kbd>[\x00-ac-\x{10ffff}]</kbd>,
- * which is equivalent to <kbd>[^b]</kbd> in case-sensitive matching.
- * But, in case-insensitive matching, <kbd>(?[^b])</kbd> matches any character because
- * it includes '<kbd>B</kbd>' and '<kbd>B</kbd>' matches '<kbd>b</kbd>'
- * though <kbd>[^b]</kbd> is processed as <kbd>[^Bb]</kbd>.
- *
- * <dt class="REGEX"><kbd>[</kbd><var>R<sub>1</sub>R<sub>2</sub>...</var><kbd>-[</kbd><var>R<sub>n</sub>R<sub>n+1</sub>...</var><kbd>]]</kbd> (with an <a href="#X_OPTION">"X" option</a>)</dt>
- * <dd>Character class subtraction for the XML Schema.
- * You can use this syntax when you specify an <a href="#X_OPTION">"X" option</a>.
- *
- * <dt class="REGEX"><kbd>\d</kbd>
- * <dd class="REGEX">Equivalent to <kbd>[0-9]</kbd>.
- * <dd>When <a href="#U_OPTION">a "u" option</a> is set, it is equivalent to
- * <span class="REGEX"><kbd>\p{Nd}</kbd></span>.
- *
- * <dt class="REGEX"><kbd>\D</kbd>
- * <dd class="REGEX">Equivalent to <kbd>[^0-9]</kbd>
- * <dd>When <a href="#U_OPTION">a "u" option</a> is set, it is equivalent to
- * <span class="REGEX"><kbd>\P{Nd}</kbd></span>.
- *
- * <dt class="REGEX"><kbd>\s</kbd>
- * <dd class="REGEX">Equivalent to <kbd>[ \f\n\r\t]</kbd>
- * <dd>When <a href="#U_OPTION">a "u" option</a> is set, it is equivalent to
- * <span class="REGEX"><kbd>[ \f\n\r\t\p{Z}]</kbd></span>.
- *
- * <dt class="REGEX"><kbd>\S</kbd>
- * <dd class="REGEX">Equivalent to <kbd>[^ \f\n\r\t]</kbd>
- * <dd>When <a href="#U_OPTION">a "u" option</a> is set, it is equivalent to
- * <span class="REGEX"><kbd>[^ \f\n\r\t\p{Z}]</kbd></span>.
- *
- * <dt class="REGEX"><kbd>\w</kbd>
- * <dd class="REGEX">Equivalent to <kbd>[a-zA-Z0-9_]</kbd>
- * <dd>When <a href="#U_OPTION">a "u" option</a> is set, it is equivalent to
- * <span class="REGEX"><kbd>[\p{Lu}\p{Ll}\p{Lo}\p{Nd}_]</kbd></span>.
- *
- * <dt class="REGEX"><kbd>\W</kbd>
- * <dd class="REGEX">Equivalent to <kbd>[^a-zA-Z0-9_]</kbd>
- * <dd>When <a href="#U_OPTION">a "u" option</a> is set, it is equivalent to
- * <span class="REGEX"><kbd>[^\p{Lu}\p{Ll}\p{Lo}\p{Nd}_]</kbd></span>.
- *
- * <dt class="REGEX"><kbd>\p{</kbd><var>name</var><kbd>}</kbd>
- * <dd>Matches one character in the specified General Category (the second field in <a href="ftp://ftp.unicode.org/Public/UNIDATA/UnicodeData.txt"><kbd>UnicodeData.txt</kbd></a>) or the specified <a href="ftp://ftp.unicode.org/Public/UNIDATA/Blocks.txt">Block</a>.
- * The following names are available:
- * <dl>
- * <dt>Unicode General Categories:
- * <dd><kbd>
- * L, M, N, Z, C, P, S, Lu, Ll, Lt, Lm, Lo, Mn, Me, Mc, Nd, Nl, No, Zs, Zl, Zp,
- * Cc, Cf, Cn, Co, Cs, Pd, Ps, Pe, Pc, Po, Sm, Sc, Sk, So,
- * </kbd>
- * <dd>(Currently the Cn category includes U+10000-U+10FFFF characters)
- * <dt>Unicode Blocks:
- * <dd><kbd>
- * Basic Latin, Latin-1 Supplement, Latin Extended-A, Latin Extended-B,
- * IPA Extensions, Spacing Modifier Letters, Combining Diacritical Marks, Greek,
- * Cyrillic, Armenian, Hebrew, Arabic, Devanagari, Bengali, Gurmukhi, Gujarati,
- * Oriya, Tamil, Telugu, Kannada, Malayalam, Thai, Lao, Tibetan, Georgian,
- * Hangul Jamo, Latin Extended Additional, Greek Extended, General Punctuation,
- * Superscripts and Subscripts, Currency Symbols, Combining Marks for Symbols,
- * Letterlike Symbols, Number Forms, Arrows, Mathematical Operators,
- * Miscellaneous Technical, Control Pictures, Optical Character Recognition,
- * Enclosed Alphanumerics, Box Drawing, Block Elements, Geometric Shapes,
- * Miscellaneous Symbols, Dingbats, CJK Symbols and Punctuation, Hiragana,
- * Katakana, Bopomofo, Hangul Compatibility Jamo, Kanbun,
- * Enclosed CJK Letters and Months, CJK Compatibility, CJK Unified Ideographs,
- * Hangul Syllables, High Surrogates, High Private Use Surrogates, Low Surrogates,
- * Private Use, CJK Compatibility Ideographs, Alphabetic Presentation Forms,
- * Arabic Presentation Forms-A, Combining Half Marks, CJK Compatibility Forms,
- * Small Form Variants, Arabic Presentation Forms-B, Specials,
- * Halfwidth and Fullwidth Forms
- * </kbd>
- * <dt>Others:
- * <dd><kbd>ALL</kbd> (Equivalent to <kbd>[\u005cu0000-\u005cv10FFFF]</kbd>)
- * <dd><kbd>ASSGINED</kbd> (<kbd>\p{ASSIGNED}</kbd> is equivalent to <kbd>\P{Cn}</kbd>)
- * <dd><kbd>UNASSGINED</kbd>
- * (<kbd>\p{UNASSIGNED}</kbd> is equivalent to <kbd>\p{Cn}</kbd>)
- * </dl>
- *
- * <dt class="REGEX"><kbd>\P{</kbd><var>name</var><kbd>}</kbd>
- * <dd>Matches one character not in the specified General Category or the specified Block.
- * </dl>
- * </li>
- *
- * <li>Selection and Quantifier
- * <dl>
- * <dt class="REGEX"><VAR>X</VAR><kbd>|</kbd><VAR>Y</VAR>
- * <dd>...
- *
- * <dt class="REGEX"><VAR>X</VAR><kbd>*</KBD>
- * <dd>Matches 0 or more <var>X</var>.
- *
- * <dt class="REGEX"><VAR>X</VAR><kbd>+</KBD>
- * <dd>Matches 1 or more <var>X</var>.
- *
- * <dt class="REGEX"><VAR>X</VAR><kbd>?</KBD>
- * <dd>Matches 0 or 1 <var>X</var>.
- *
- * <dt class="REGEX"><var>X</var><kbd>{</kbd><var>number</var><kbd>}</kbd>
- * <dd>Matches <var>number</var> times.
- *
- * <dt class="REGEX"><var>X</var><kbd>{</kbd><var>min</var><kbd>,}</kbd>
- * <dd>...
- *
- * <dt class="REGEX"><var>X</var><kbd>{</kbd><var>min</var><kbd>,</kbd><var>max</var><kbd>}</kbd>
- * <dd>...
- *
- * <dt class="REGEX"><VAR>X</VAR><kbd>*?</kbd>
- * <dt class="REGEX"><VAR>X</VAR><kbd>+?</kbd>
- * <dt class="REGEX"><VAR>X</VAR><kbd>??</kbd>
- * <dt class="REGEX"><var>X</var><kbd>{</kbd><var>min</var><kbd>,}?</kbd>
- * <dt class="REGEX"><var>X</var><kbd>{</kbd><var>min</var><kbd>,</kbd><var>max</var><kbd>}?</kbd>
- * <dd>Non-greedy matching.
- * </dl>
- * </li>
- *
- * <li>Grouping, Capturing, and Back-reference
- * <dl>
- * <dt class="REGEX"><KBD>(?:</kbd><VAR>X</VAR><kbd>)</KBD>
- * <dd>Grouping. "<KBD>foo+</KBD>" matches "<KBD>foo</KBD>" or "<KBD>foooo</KBD>".
- * If you want it matches "<KBD>foofoo</KBD>" or "<KBD>foofoofoo</KBD>",
- * you have to write "<KBD>(?:foo)+</KBD>".
- *
- * <dt class="REGEX"><KBD>(</kbd><VAR>X</VAR><kbd>)</KBD>
- * <dd>Grouping with capturing.
- * It make a group and applications can know
- * where in target text a group matched with methods of a <code>Match</code> instance
- * after <code><a href="#matches(java.lang.String, com.sun.org.apache.xerces.internal.utils.regex.Match)">matches(String,Match)</a></code>.
- * The 0th group means whole of this regular expression.
- * The <VAR>N</VAR>th gorup is the inside of the <VAR>N</VAR>th left parenthesis.
- *
- * <p>For instance, a regular expression is
- * "<FONT color=blue><KBD> *([^&lt;:]*) +&lt;([^&gt;]*)&gt; *</KBD></FONT>"
- * and target text is
- * "<FONT color=red><KBD>From: TAMURA Kent &lt;kent@trl.ibm.co.jp&gt;</KBD></FONT>":
- * <ul>
- * <li><code>Match.getCapturedText(0)</code>:
- * "<FONT color=red><KBD> TAMURA Kent &lt;kent@trl.ibm.co.jp&gt;</KBD></FONT>"
- * <li><code>Match.getCapturedText(1)</code>: "<FONT color=red><KBD>TAMURA Kent</KBD></FONT>"
- * <li><code>Match.getCapturedText(2)</code>: "<FONT color=red><KBD>kent@trl.ibm.co.jp</KBD></FONT>"
- * </ul>
- *
- * <dt class="REGEX"><kbd>\1 \2 \3 \4 \5 \6 \7 \8 \9</kbd>
- * <dd>
- *
- * <dt class="REGEX"><kbd>(?></kbd><var>X</var><kbd>)</kbd>
- * <dd>Independent expression group. ................
- *
- * <dt class="REGEX"><kbd>(?</kbd><var>options</var><kbd>:</kbd><var>X</var><kbd>)</kbd>
- * <dt class="REGEX"><kbd>(?</kbd><var>options</var><kbd>-</kbd><var>options2</var><kbd>:</kbd><var>X</var><kbd>)</kbd>
- * <dd>............................
- * <dd>The <var>options</var> or the <var>options2</var> consists of 'i' 'm' 's' 'w'.
- * Note that it can not contain 'u'.
- *
- * <dt class="REGEX"><kbd>(?</kbd><var>options</var><kbd>)</kbd>
- * <dt class="REGEX"><kbd>(?</kbd><var>options</var><kbd>-</kbd><var>options2</var><kbd>)</kbd>
- * <dd>......
- * <dd>These expressions must be at the beginning of a group.
- * </dl>
- * </li>
- *
- * <li>Anchor
- * <dl>
- * <dt class="REGEX"><kbd>\A</kbd>
- * <dd>Matches the beginnig of the text.
- *
- * <dt class="REGEX"><kbd>\Z</kbd>
- * <dd>Matches the end of the text, or before an EOL character at the end of the text,
- * or CARRIAGE RETURN + LINE FEED at the end of the text.
- *
- * <dt class="REGEX"><kbd>\z</kbd>
- * <dd>Matches the end of the text.
- *
- * <dt class="REGEX"><kbd>^</kbd>
- * <dd>Matches the beginning of the text. It is equivalent to <span class="REGEX"><Kbd>\A</kbd></span>.
- * <dd>When <a href="#M_OPTION">a "m" option</a> is set,
- * it matches the beginning of the text, or after one of EOL characters (
- * LINE FEED (U+000A), CARRIAGE RETURN (U+000D), LINE SEPARATOR (U+2028),
- * PARAGRAPH SEPARATOR (U+2029).)
- *
- * <dt class="REGEX"><kbd>$</kbd>
- * <dd>Matches the end of the text, or before an EOL character at the end of the text,
- * or CARRIAGE RETURN + LINE FEED at the end of the text.
- * <dd>When <a href="#M_OPTION">a "m" option</a> is set,
- * it matches the end of the text, or before an EOL character.
- *
- * <dt class="REGEX"><kbd>\b</kbd>
- * <dd>Matches word boundary.
- * (See <a href="#W_OPTION">a "w" option</a>)
- *
- * <dt class="REGEX"><kbd>\B</kbd>
- * <dd>Matches non word boundary.
- * (See <a href="#W_OPTION">a "w" option</a>)
- *
- * <dt class="REGEX"><kbd>\&lt;</kbd>
- * <dd>Matches the beginning of a word.
- * (See <a href="#W_OPTION">a "w" option</a>)
- *
- * <dt class="REGEX"><kbd>\&gt;</kbd>
- * <dd>Matches the end of a word.
- * (See <a href="#W_OPTION">a "w" option</a>)
- * </dl>
- * </li>
- * <li>Lookahead and lookbehind
- * <dl>
- * <dt class="REGEX"><kbd>(?=</kbd><var>X</var><kbd>)</kbd>
- * <dd>Lookahead.
- *
- * <dt class="REGEX"><kbd>(?!</kbd><var>X</var><kbd>)</kbd>
- * <dd>Negative lookahead.
- *
- * <dt class="REGEX"><kbd>(?&lt;=</kbd><var>X</var><kbd>)</kbd>
- * <dd>Lookbehind.
- * <dd>(Note for text capturing......)
- *
- * <dt class="REGEX"><kbd>(?&lt;!</kbd><var>X</var><kbd>)</kbd>
- * <dd>Negative lookbehind.
- * </dl>
- * </li>
- *
- * <li>Misc.
- * <dl>
- * <dt class="REGEX"><kbd>(?(</Kbd><var>condition</var><Kbd>)</kbd><var>yes-pattern</var><kbd>|</kbd><var>no-pattern</var><kbd>)</kbd>,
- * <dt class="REGEX"><kbd>(?(</kbd><var>condition</var><kbd>)</kbd><var>yes-pattern</var><kbd>)</kbd>
- * <dd>......
- * <dt class="REGEX"><kbd>(?#</kbd><var>comment</var><kbd>)</kbd>
- * <dd>Comment. A comment string consists of characters except '<kbd>)</kbd>'.
- * You can not write comments in character classes and before quantifiers.
- * </dl>
- * </li>
- * </ul>
- *
- *
- * <hr width="50%">
- * <h3>BNF for the regular expression</h3>
- * <pre>
- * regex ::= ('(?' options ')')? term ('|' term)*
- * term ::= factor+
- * factor ::= anchors | atom (('*' | '+' | '?' | minmax ) '?'? )?
- * | '(?#' [^)]* ')'
- * minmax ::= '{' ([0-9]+ | [0-9]+ ',' | ',' [0-9]+ | [0-9]+ ',' [0-9]+) '}'
- * atom ::= char | '.' | char-class | '(' regex ')' | '(?:' regex ')' | '\' [0-9]
- * | '\w' | '\W' | '\d' | '\D' | '\s' | '\S' | category-block | '\X'
- * | '(?>' regex ')' | '(?' options ':' regex ')'
- * | '(?' ('(' [0-9] ')' | '(' anchors ')' | looks) term ('|' term)? ')'
- * options ::= [imsw]* ('-' [imsw]+)?
- * anchors ::= '^' | '$' | '\A' | '\Z' | '\z' | '\b' | '\B' | '\&lt;' | '\>'
- * looks ::= '(?=' regex ')' | '(?!' regex ')'
- * | '(?&lt;=' regex ')' | '(?&lt;!' regex ')'
- * char ::= '\\' | '\' [efnrtv] | '\c' [@-_] | code-point | character-1
- * category-block ::= '\' [pP] category-symbol-1
- * | ('\p{' | '\P{') (category-symbol | block-name
- * | other-properties) '}'
- * category-symbol-1 ::= 'L' | 'M' | 'N' | 'Z' | 'C' | 'P' | 'S'
- * category-symbol ::= category-symbol-1 | 'Lu' | 'Ll' | 'Lt' | 'Lm' | Lo'
- * | 'Mn' | 'Me' | 'Mc' | 'Nd' | 'Nl' | 'No'
- * | 'Zs' | 'Zl' | 'Zp' | 'Cc' | 'Cf' | 'Cn' | 'Co' | 'Cs'
- * | 'Pd' | 'Ps' | 'Pe' | 'Pc' | 'Po'
- * | 'Sm' | 'Sc' | 'Sk' | 'So'
- * block-name ::= (See above)
- * other-properties ::= 'ALL' | 'ASSIGNED' | 'UNASSIGNED'
- * character-1 ::= (any character except meta-characters)
- *
- * char-class ::= '[' ranges ']'
- * | '(?[' ranges ']' ([-+&] '[' ranges ']')? ')'
- * ranges ::= '^'? (range <a href="#COMMA_OPTION">','?</a>)+
- * range ::= '\d' | '\w' | '\s' | '\D' | '\W' | '\S' | category-block
- * | range-char | range-char '-' range-char
- * range-char ::= '\[' | '\]' | '\\' | '\' [,-efnrtv] | code-point | character-2
- * code-point ::= '\x' hex-char hex-char
- * | '\x{' hex-char+ '}'
- * <!-- | '\u005c u' hex-char hex-char hex-char hex-char
- * --> | '\v' hex-char hex-char hex-char hex-char hex-char hex-char
- * hex-char ::= [0-9a-fA-F]
- * character-2 ::= (any character except \[]-,)
- * </pre>
- *
- * <hr width="50%">
- * <h3>TODO</h3>
- * <ul>
- * <li><a href="http://www.unicode.org/unicode/reports/tr18/">Unicode Regular Expression Guidelines</a>
- * <ul>
- * <li>2.4 Canonical Equivalents
- * <li>Level 3
- * </ul>
- * <li>Parsing performance
- * </ul>
- *
- * <hr width="50%">
- *
- * @xerces.internal
- *
- * @author TAMURA Kent &lt;kent@trl.ibm.co.jp&gt;
- * @version $Id: RegularExpression.java,v 1.9 2010/07/27 05:02:34 joehw Exp $
- */
-public class RegularExpression implements java.io.Serializable {
-
- private static final long serialVersionUID = 6242499334195006401L;
-
- static final boolean DEBUG = false;
-
- /**
- * Compiles a token tree into an operation flow.
- */
- private synchronized void compile(Token tok) {
- if (this.operations != null)
- return;
- this.numberOfClosures = 0;
- this.operations = this.compile(tok, null, false);
- }
-
- /**
- * Converts a token to an operation.
- */
- private Op compile(Token tok, Op next, boolean reverse) {
- Op ret;
- switch (tok.type) {
- case Token.DOT:
- ret = Op.createDot();
- ret.next = next;
- break;
-
- case Token.CHAR:
- ret = Op.createChar(tok.getChar());
- ret.next = next;
- break;
-
- case Token.ANCHOR:
- ret = Op.createAnchor(tok.getChar());
- ret.next = next;
- break;
-
- case Token.RANGE:
- case Token.NRANGE:
- ret = Op.createRange(tok);
- ret.next = next;
- break;
-
- case Token.CONCAT:
- ret = next;
- if (!reverse) {
- for (int i = tok.size()-1; i >= 0; i --) {
- ret = compile(tok.getChild(i), ret, false);
- }
- } else {
- for (int i = 0; i < tok.size(); i ++) {
- ret = compile(tok.getChild(i), ret, true);
- }
- }
- break;
-
- case Token.UNION:
- Op.UnionOp uni = Op.createUnion(tok.size());
- for (int i = 0; i < tok.size(); i ++) {
- uni.addElement(compile(tok.getChild(i), next, reverse));
- }
- ret = uni; // ret.next is null.
- break;
-
- case Token.CLOSURE:
- case Token.NONGREEDYCLOSURE:
- Token child = tok.getChild(0);
- int min = tok.getMin();
- int max = tok.getMax();
- if (min >= 0 && min == max) { // {n}
- ret = next;
- for (int i = 0; i < min; i ++) {
- ret = compile(child, ret, reverse);
- }
- break;
- }
- if (min > 0 && max > 0)
- max -= min;
- if (max > 0) {
- // X{2,6} -> XX(X(X(XX?)?)?)?
- ret = next;
- for (int i = 0; i < max; i ++) {
- Op.ChildOp q = Op.createQuestion(tok.type == Token.NONGREEDYCLOSURE);
- q.next = next;
- q.setChild(compile(child, ret, reverse));
- ret = q;
- }
- } else {
- Op.ChildOp op;
- if (tok.type == Token.NONGREEDYCLOSURE) {
- op = Op.createNonGreedyClosure();
- } else { // Token.CLOSURE
- op = Op.createClosure(this.numberOfClosures++);
- }
- op.next = next;
- op.setChild(compile(child, op, reverse));
- ret = op;
- }
- if (min > 0) {
- for (int i = 0; i < min; i ++) {
- ret = compile(child, ret, reverse);
- }
- }
- break;
-
- case Token.EMPTY:
- ret = next;
- break;
-
- case Token.STRING:
- ret = Op.createString(tok.getString());
- ret.next = next;
- break;
-
- case Token.BACKREFERENCE:
- ret = Op.createBackReference(tok.getReferenceNumber());
- ret.next = next;
- break;
-
- case Token.PAREN:
- if (tok.getParenNumber() == 0) {
- ret = compile(tok.getChild(0), next, reverse);
- } else if (reverse) {
- next = Op.createCapture(tok.getParenNumber(), next);
- next = compile(tok.getChild(0), next, reverse);
- ret = Op.createCapture(-tok.getParenNumber(), next);
- } else {
- next = Op.createCapture(-tok.getParenNumber(), next);
- next = compile(tok.getChild(0), next, reverse);
- ret = Op.createCapture(tok.getParenNumber(), next);
- }
- break;
-
- case Token.LOOKAHEAD:
- ret = Op.createLook(Op.LOOKAHEAD, next, compile(tok.getChild(0), null, false));
- break;
- case Token.NEGATIVELOOKAHEAD:
- ret = Op.createLook(Op.NEGATIVELOOKAHEAD, next, compile(tok.getChild(0), null, false));
- break;
- case Token.LOOKBEHIND:
- ret = Op.createLook(Op.LOOKBEHIND, next, compile(tok.getChild(0), null, true));
- break;
- case Token.NEGATIVELOOKBEHIND:
- ret = Op.createLook(Op.NEGATIVELOOKBEHIND, next, compile(tok.getChild(0), null, true));
- break;
-
- case Token.INDEPENDENT:
- ret = Op.createIndependent(next, compile(tok.getChild(0), null, reverse));
- break;
-
- case Token.MODIFIERGROUP:
- ret = Op.createModifier(next, compile(tok.getChild(0), null, reverse),
- ((Token.ModifierToken)tok).getOptions(),
- ((Token.ModifierToken)tok).getOptionsMask());
- break;
-
- case Token.CONDITION:
- Token.ConditionToken ctok = (Token.ConditionToken)tok;
- int ref = ctok.refNumber;
- Op condition = ctok.condition == null ? null : compile(ctok.condition, null, reverse);
- Op yes = compile(ctok.yes, next, reverse);
- Op no = ctok.no == null ? null : compile(ctok.no, next, reverse);
- ret = Op.createCondition(next, ref, condition, yes, no);
- break;
-
- default:
- throw new RuntimeException("Unknown token type: "+tok.type);
- } // switch (tok.type)
- return ret;
- }
-
-
-//Public
-
- /**
- * Checks whether the <var>target</var> text <strong>contains</strong> this pattern or not.
- *
- * @return true if the target is matched to this regular expression.
- */
- public boolean matches(char[] target) {
- return this.matches(target, 0, target .length , (Match)null);
- }
-
- /**
- * Checks whether the <var>target</var> text <strong>contains</strong> this pattern
- * in specified range or not.
- *
- * @param start Start offset of the range.
- * @param end End offset +1 of the range.
- * @return true if the target is matched to this regular expression.
- */
- public boolean matches(char[] target, int start, int end) {
- return this.matches(target, start, end, (Match)null);
- }
-
- /**
- * Checks whether the <var>target</var> text <strong>contains</strong> this pattern or not.
- *
- * @param match A Match instance for storing matching result.
- * @return Offset of the start position in <VAR>target</VAR>; or -1 if not match.
- */
- public boolean matches(char[] target, Match match) {
- return this.matches(target, 0, target .length , match);
- }
-
-
- /**
- * Checks whether the <var>target</var> text <strong>contains</strong> this pattern
- * in specified range or not.
- *
- * @param start Start offset of the range.
- * @param end End offset +1 of the range.
- * @param match A Match instance for storing matching result.
- * @return Offset of the start position in <VAR>target</VAR>; or -1 if not match.
- */
- public boolean matches(char[] target, int start, int end, Match match) {
-
- synchronized (this) {
- if (this.operations == null)
- this.prepare();
- if (this.context == null)
- this.context = new Context();
- }
- Context con = null;
- synchronized (this.context) {
- con = this.context.inuse ? new Context() : this.context;
- con.reset(target, start, end, this.numberOfClosures);
- }
- if (match != null) {
- match.setNumberOfGroups(this.nofparen);
- match.setSource(target);
- } else if (this.hasBackReferences) {
- match = new Match();
- match.setNumberOfGroups(this.nofparen);
- // Need not to call setSource() because
- // a caller can not access this match instance.
- }
- con.match = match;
-
- if (RegularExpression.isSet(this.options, XMLSCHEMA_MODE)) {
- int matchEnd = this. match(con, this.operations, con.start, 1, this.options);
- //System.err.println("DEBUG: matchEnd="+matchEnd);
- if (matchEnd == con.limit) {
- if (con.match != null) {
- con.match.setBeginning(0, con.start);
- con.match.setEnd(0, matchEnd);
- }
- con.setInUse(false);
- return true;
- }
- return false;
- }
-
- /*
- * The pattern has only fixed string.
- * The engine uses Boyer-Moore.
- */
- if (this.fixedStringOnly) {
- //System.err.println("DEBUG: fixed-only: "+this.fixedString);
- int o = this.fixedStringTable.matches(target, con.start, con.limit);
- if (o >= 0) {
- if (con.match != null) {
- con.match.setBeginning(0, o);
- con.match.setEnd(0, o+this.fixedString.length());
- }
- con.setInUse(false);
- return true;
- }
- con.setInUse(false);
- return false;
- }
-
- /*
- * The pattern contains a fixed string.
- * The engine checks with Boyer-Moore whether the text contains the fixed string or not.
- * If not, it return with false.
- */
- if (this.fixedString != null) {
- int o = this.fixedStringTable.matches(target, con.start, con.limit);
- if (o < 0) {
- //System.err.println("Non-match in fixed-string search.");
- con.setInUse(false);
- return false;
- }
- }
-
- int limit = con.limit-this.minlength;
- int matchStart;
- int matchEnd = -1;
-
- /*
- * Checks whether the expression starts with ".*".
- */
- if (this.operations != null
- && this.operations.type == Op.CLOSURE && this.operations.getChild().type == Op.DOT) {
- if (isSet(this.options, SINGLE_LINE)) {
- matchStart = con.start;
- matchEnd = this. match(con, this.operations, con.start, 1, this.options);
- } else {
- boolean previousIsEOL = true;
- for (matchStart = con.start; matchStart <= limit; matchStart ++) {
- int ch = target [ matchStart ] ;
- if (isEOLChar(ch)) {
- previousIsEOL = true;
- } else {
- if (previousIsEOL) {
- if (0 <= (matchEnd = this. match(con, this.operations,
- matchStart, 1, this.options)))
- break;
- }
- previousIsEOL = false;
- }
- }
- }
- }
-
- /*
- * Optimization against the first character.
- */
- else if (this.firstChar != null) {
- //System.err.println("DEBUG: with firstchar-matching: "+this.firstChar);
- RangeToken range = this.firstChar;
- for (matchStart = con.start; matchStart <= limit; matchStart ++) {
- int ch = target [matchStart] ;
- if (REUtil.isHighSurrogate(ch) && matchStart+1 < con.limit) {
- ch = REUtil.composeFromSurrogates(ch, target[matchStart+1]);
- }
- if (!range.match(ch)) {
- continue;
- }
- if (0 <= (matchEnd = this. match(con, this.operations,
- matchStart, 1, this.options))) {
- break;
- }
- }
- }
-
- /*
- * Straightforward matching.
- */
- else {
- for (matchStart = con.start; matchStart <= limit; matchStart ++) {
- if (0 <= (matchEnd = this. match(con, this.operations, matchStart, 1, this.options)))
- break;
- }
- }
-
- if (matchEnd >= 0) {
- if (con.match != null) {
- con.match.setBeginning(0, matchStart);
- con.match.setEnd(0, matchEnd);
- }
- con.setInUse(false);
- return true;
- } else {
- con.setInUse(false);
- return false;
- }
- }
-
- /**
- * Checks whether the <var>target</var> text <strong>contains</strong> this pattern or not.
- *
- * @return true if the target is matched to this regular expression.
- */
- public boolean matches(String target) {
- return this.matches(target, 0, target .length() , (Match)null);
- }
-
- /**
- * Checks whether the <var>target</var> text <strong>contains</strong> this pattern
- * in specified range or not.
- *
- * @param start Start offset of the range.
- * @param end End offset +1 of the range.
- * @return true if the target is matched to this regular expression.
- */
- public boolean matches(String target, int start, int end) {
- return this.matches(target, start, end, (Match)null);
- }
-
- /**
- * Checks whether the <var>target</var> text <strong>contains</strong> this pattern or not.
- *
- * @param match A Match instance for storing matching result.
- * @return Offset of the start position in <VAR>target</VAR>; or -1 if not match.
- */
- public boolean matches(String target, Match match) {
- return this.matches(target, 0, target .length() , match);
- }
-
- /**
- * Checks whether the <var>target</var> text <strong>contains</strong> this pattern
- * in specified range or not.
- *
- * @param start Start offset of the range.
- * @param end End offset +1 of the range.
- * @param match A Match instance for storing matching result.
- * @return Offset of the start position in <VAR>target</VAR>; or -1 if not match.
- */
- public boolean matches(String target, int start, int end, Match match) {
-
- synchronized (this) {
- if (this.operations == null)
- this.prepare();
- if (this.context == null)
- this.context = new Context();
- }
- Context con = null;
- synchronized (this.context) {
- con = this.context.inuse ? new Context() : this.context;
- con.reset(target, start, end, this.numberOfClosures);
- }
- if (match != null) {
- match.setNumberOfGroups(this.nofparen);
- match.setSource(target);
- } else if (this.hasBackReferences) {
- match = new Match();
- match.setNumberOfGroups(this.nofparen);
- // Need not to call setSource() because
- // a caller can not access this match instance.
- }
- con.match = match;
-
- if (RegularExpression.isSet(this.options, XMLSCHEMA_MODE)) {
- if (DEBUG) {
- System.err.println("target string="+target);
- }
- int matchEnd = this. match(con, this.operations, con.start, 1, this.options);
- if (DEBUG) {
- System.err.println("matchEnd="+matchEnd);
- System.err.println("con.limit="+con.limit);
- }
- if (matchEnd == con.limit) {
- if (con.match != null) {
- con.match.setBeginning(0, con.start);
- con.match.setEnd(0, matchEnd);
- }
- con.setInUse(false);
- return true;
- }
- return false;
- }
-
- /*
- * The pattern has only fixed string.
- * The engine uses Boyer-Moore.
- */
- if (this.fixedStringOnly) {
- //System.err.println("DEBUG: fixed-only: "+this.fixedString);
- int o = this.fixedStringTable.matches(target, con.start, con.limit);
- if (o >= 0) {
- if (con.match != null) {
- con.match.setBeginning(0, o);
- con.match.setEnd(0, o+this.fixedString.length());
- }
- con.setInUse(false);
- return true;
- }
- con.setInUse(false);
- return false;
- }
-
- /*
- * The pattern contains a fixed string.
- * The engine checks with Boyer-Moore whether the text contains the fixed string or not.
- * If not, it return with false.
- */
- if (this.fixedString != null) {
- int o = this.fixedStringTable.matches(target, con.start, con.limit);
- if (o < 0) {
- //System.err.println("Non-match in fixed-string search.");
- con.setInUse(false);
- return false;
- }
- }
-
- int limit = con.limit-this.minlength;
- int matchStart;
- int matchEnd = -1;
-
- /*
- * Checks whether the expression starts with ".*".
- */
- if (this.operations != null
- && this.operations.type == Op.CLOSURE && this.operations.getChild().type == Op.DOT) {
- if (isSet(this.options, SINGLE_LINE)) {
- matchStart = con.start;
- matchEnd = this.match(con, this.operations, con.start, 1, this.options);
- } else {
- boolean previousIsEOL = true;
- for (matchStart = con.start; matchStart <= limit; matchStart ++) {
- int ch = target .charAt( matchStart ) ;
- if (isEOLChar(ch)) {
- previousIsEOL = true;
- } else {
- if (previousIsEOL) {
- if (0 <= (matchEnd = this.match(con, this.operations,
- matchStart, 1, this.options)))
- break;
- }
- previousIsEOL = false;
- }
- }
- }
- }
-
- /*
- * Optimization against the first character.
- */
- else if (this.firstChar != null) {
- //System.err.println("DEBUG: with firstchar-matching: "+this.firstChar);
- RangeToken range = this.firstChar;
- for (matchStart = con.start; matchStart <= limit; matchStart ++) {
- int ch = target .charAt( matchStart ) ;
- if (REUtil.isHighSurrogate(ch) && matchStart+1 < con.limit) {
- ch = REUtil.composeFromSurrogates(ch, target.charAt(matchStart+1));
- }
- if (!range.match(ch)) {
- continue;
- }
- if (0 <= (matchEnd = this.match(con, this.operations,
- matchStart, 1, this.options))) {
- break;
- }
- }
- }
-
- /*
- * Straightforward matching.
- */
- else {
- for (matchStart = con.start; matchStart <= limit; matchStart ++) {
- if (0 <= (matchEnd = this.match(con, this.operations, matchStart, 1, this.options)))
- break;
- }
- }
-
- if (matchEnd >= 0) {
- if (con.match != null) {
- con.match.setBeginning(0, matchStart);
- con.match.setEnd(0, matchEnd);
- }
- con.setInUse(false);
- return true;
- } else {
- con.setInUse(false);
- return false;
- }
- }
-
- /**
- * @return -1 when not match; offset of the end of matched string when match.
- */
- private int match(Context con, Op op, int offset, int dx, int opts) {
- final ExpressionTarget target = con.target;
- final Stack opStack = new Stack();
- final IntStack dataStack = new IntStack();
- final boolean isSetIgnoreCase = isSet(opts, IGNORE_CASE);
- int retValue = -1;
- boolean returned = false;
-
- for (;;) {
- if (op == null || offset > con.limit || offset < con.start) {
- if (op == null) {
- retValue = isSet(opts, XMLSCHEMA_MODE) && offset != con.limit ? -1 : offset;
- }
- else {
- retValue = -1;
- }
- returned = true;
- }
- else {
- retValue = -1;
- // dx value is either 1 or -1
- switch (op.type) {
- case Op.CHAR:
- {
- final int o1 = (dx > 0) ? offset : offset -1;
- if (o1 >= con.limit || o1 < 0 || !matchChar(op.getData(), target.charAt(o1), isSetIgnoreCase)) {
- returned = true;
- break;
- }
- offset += dx;
- op = op.next;
- }
- break;
-
- case Op.DOT:
- {
- int o1 = (dx > 0) ? offset : offset - 1;
- if (o1 >= con.limit || o1 < 0) {
- returned = true;
- break;
- }
- if (isSet(opts, SINGLE_LINE)) {
- if (REUtil.isHighSurrogate(target.charAt(o1)) && o1+dx >= 0 && o1+dx < con.limit) {
- o1 += dx;
- }
- }
- else {
- int ch = target.charAt(o1);
- if (REUtil.isHighSurrogate(ch) && o1+dx >= 0 && o1+dx < con.limit) {
- o1 += dx;
- ch = REUtil.composeFromSurrogates(ch, target.charAt(o1));
- }
- if (isEOLChar(ch)) {
- returned = true;
- break;
- }
- }
- offset = (dx > 0) ? o1 + 1 : o1;
- op = op.next;
- }
- break;
-
- case Op.RANGE:
- case Op.NRANGE:
- {
- int o1 = (dx > 0) ? offset : offset -1;
- if (o1 >= con.limit || o1 < 0) {
- returned = true;
- break;
- }
- int ch = target.charAt(offset);
- if (REUtil.isHighSurrogate(ch) && o1+dx < con.limit && o1+dx >=0) {
- o1 += dx;
- ch = REUtil.composeFromSurrogates(ch, target.charAt(o1));
- }
- final RangeToken tok = op.getToken();
- if (!tok.match(ch)) {
- returned = true;
- break;
- }
- offset = (dx > 0) ? o1+1 : o1;
- op = op.next;
- }
- break;
-
- case Op.ANCHOR:
- {
- if (!matchAnchor(target, op, con, offset, opts)) {
- returned = true;
- break;
- }
- op = op.next;
- }
- break;
-
- case Op.BACKREFERENCE:
- {
- int refno = op.getData();
- if (refno <= 0 || refno >= this.nofparen) {
- throw new RuntimeException("Internal Error: Reference number must be more than zero: "+refno);
- }
- if (con.match.getBeginning(refno) < 0 || con.match.getEnd(refno) < 0) {
- returned = true;
- break;
- }
- int o2 = con.match.getBeginning(refno);
- int literallen = con.match.getEnd(refno)-o2;
- if (dx > 0) {
- if (!target.regionMatches(isSetIgnoreCase, offset, con.limit, o2, literallen)) {
- returned = true;
- break;
- }
- offset += literallen;
- }
- else {
- if (!target.regionMatches(isSetIgnoreCase, offset-literallen, con.limit, o2, literallen)) {
- returned = true;
- break;
- }
- offset -= literallen;
- }
- op = op.next;
- }
- break;
-
- case Op.STRING:
- {
- String literal = op.getString();
- int literallen = literal.length();
- if (dx > 0) {
- if (!target.regionMatches(isSetIgnoreCase, offset, con.limit, literal, literallen)) {
- returned = true;
- break;
- }
- offset += literallen;
- }
- else {
- if (!target.regionMatches(isSetIgnoreCase, offset-literallen, con.limit, literal, literallen)) {
- returned = true;
- break;
- }
- offset -= literallen;
- }
- op = op.next;
- }
- break;
-
- case Op.CLOSURE:
- {
- // Saves current position to avoid zero-width repeats.
- final int id = op.getData();
- if (con.closureContexts[id].contains(offset)) {
- returned = true;
- break;
- }
-
- con.closureContexts[id].addOffset(offset);
- }
- // fall through
-
- case Op.QUESTION:
- {
- opStack.push(op);
- dataStack.push(offset);
- op = op.getChild();
- }
- break;
-
- case Op.NONGREEDYCLOSURE:
- case Op.NONGREEDYQUESTION:
- {
- opStack.push(op);
- dataStack.push(offset);
- op = op.next;
- }
- break;
-
- case Op.UNION:
- if (op.size() == 0) {
- returned = true;
- }
- else {
- opStack.push(op);
- dataStack.push(0);
- dataStack.push(offset);
- op = op.elementAt(0);
- }
- break;
-
- case Op.CAPTURE:
- {
- final int refno = op.getData();
- if (con.match != null) {
- if (refno > 0) {
- dataStack.push(con.match.getBeginning(refno));
- con.match.setBeginning(refno, offset);
- }
- else {
- final int index = -refno;
- dataStack.push(con.match.getEnd(index));
- con.match.setEnd(index, offset);
- }
- opStack.push(op);
- dataStack.push(offset);
- }
- op = op.next;
- }
- break;
-
- case Op.LOOKAHEAD:
- case Op.NEGATIVELOOKAHEAD:
- case Op.LOOKBEHIND:
- case Op.NEGATIVELOOKBEHIND:
- {
- opStack.push(op);
- dataStack.push(dx);
- dataStack.push(offset);
- dx = (op.type == Op.LOOKAHEAD || op.type == Op.NEGATIVELOOKAHEAD) ? 1 : -1;
- op = op.getChild();
- }
- break;
-
- case Op.INDEPENDENT:
- {
- opStack.push(op);
- dataStack.push(offset);
- op = op.getChild();
- }
- break;
-
- case Op.MODIFIER:
- {
- int localopts = opts;
- localopts |= op.getData();
- localopts &= ~op.getData2();
- opStack.push(op);
- dataStack.push(opts);
- dataStack.push(offset);
- opts = localopts;
- op = op.getChild();
- }
- break;
-
- case Op.CONDITION:
- {
- Op.ConditionOp cop = (Op.ConditionOp)op;
- if (cop.refNumber > 0) {
- if (cop.refNumber >= this.nofparen) {
- throw new RuntimeException("Internal Error: Reference number must be more than zero: "+cop.refNumber);
- }
- if (con.match.getBeginning(cop.refNumber) >= 0
- && con.match.getEnd(cop.refNumber) >= 0) {
- op = cop.yes;
- }
- else if (cop.no != null) {
- op = cop.no;
- }
- else {
- op = cop.next;
- }
- }
- else {
- opStack.push(op);
- dataStack.push(offset);
- op = cop.condition;
- }
- }
- break;
-
- default:
- throw new RuntimeException("Unknown operation type: " + op.type);
- }
- }
-
- // handle recursive operations
- while (returned) {
- // exhausted all the operations
- if (opStack.isEmpty()) {
- return retValue;
- }
-
- op = (Op) opStack.pop();
- offset = dataStack.pop();
-
- switch (op.type) {
- case Op.CLOSURE:
- case Op.QUESTION:
- if (retValue < 0) {
- op = op.next;
- returned = false;
- }
- break;
-
- case Op.NONGREEDYCLOSURE:
- case Op.NONGREEDYQUESTION:
- if (retValue < 0) {
- op = op.getChild();
- returned = false;
- }
- break;
-
- case Op.UNION:
- {
- int unionIndex = dataStack.pop();
- if (DEBUG) {
- System.err.println("UNION: "+unionIndex+", ret="+retValue);
- }
-
- if (retValue < 0) {
- if (++unionIndex < op.size()) {
- opStack.push(op);
- dataStack.push(unionIndex);
- dataStack.push(offset);
- op = op.elementAt(unionIndex);
- returned = false;
- }
- else {
- retValue = -1;
- }
- }
- }
- break;
-
- case Op.CAPTURE:
- final int refno = op.getData();
- final int saved = dataStack.pop();
- if (retValue < 0) {
- if (refno > 0) {
- con.match.setBeginning(refno, saved);
- }
- else {
- con.match.setEnd(-refno, saved);
- }
- }
- break;
-
- case Op.LOOKAHEAD:
- case Op.LOOKBEHIND:
- {
- dx = dataStack.pop();
- if (0 <= retValue) {
- op = op.next;
- returned = false;
- }
- retValue = -1;
- }
- break;
-
- case Op.NEGATIVELOOKAHEAD:
- case Op.NEGATIVELOOKBEHIND:
- {
- dx = dataStack.pop();
- if (0 > retValue) {
- op = op.next;
- returned = false;
- }
- retValue = -1;
- }
- break;
-
- case Op.MODIFIER:
- opts = dataStack.pop();
- // fall through
-
- case Op.INDEPENDENT:
- if (retValue >= 0) {
- offset = retValue;
- op = op.next;
- returned = false;
- }
- break;
-
- case Op.CONDITION:
- {
- final Op.ConditionOp cop = (Op.ConditionOp)op;
- if (0 <= retValue) {
- op = cop.yes;
- }
- else if (cop.no != null) {
- op = cop.no;
- }
- else {
- op = cop.next;
- }
- }
- returned = false;
- break;
-
- default:
- break;
- }
- }
- }
- }
-
- private boolean matchChar(int ch, int other, boolean ignoreCase) {
- return (ignoreCase) ? matchIgnoreCase(ch, other) : ch == other;
- }
-
- boolean matchAnchor(ExpressionTarget target, Op op, Context con, int offset, int opts) {
- boolean go = false;
- switch (op.getData()) {
- case '^':
- if (isSet(opts, MULTIPLE_LINES)) {
- if (!(offset == con.start
- || offset > con.start && offset < con.limit && isEOLChar(target.charAt(offset-1))))
- return false;
- } else {
- if (offset != con.start)
- return false;
- }
- break;
-
- case '@': // Internal use only.
- // The @ always matches line beginnings.
- if (!(offset == con.start
- || offset > con.start && isEOLChar(target.charAt(offset-1))))
- return false;
- break;
-
- case '$':
- if (isSet(opts, MULTIPLE_LINES)) {
- if (!(offset == con.limit
- || offset < con.limit && isEOLChar(target.charAt(offset))))
- return false;
- } else {
- if (!(offset == con.limit
- || offset+1 == con.limit && isEOLChar(target.charAt(offset))
- || offset+2 == con.limit && target.charAt(offset) == CARRIAGE_RETURN
- && target.charAt(offset+1) == LINE_FEED))
- return false;
- }
- break;
-
- case 'A':
- if (offset != con.start) return false;
- break;
-
- case 'Z':
- if (!(offset == con.limit
- || offset+1 == con.limit && isEOLChar(target.charAt(offset))
- || offset+2 == con.limit && target.charAt(offset) == CARRIAGE_RETURN
- && target.charAt(offset+1) == LINE_FEED))
- return false;
- break;
-
- case 'z':
- if (offset != con.limit) return false;
- break;
-
- case 'b':
- if (con.length == 0)
- return false;
- {
- int after = getWordType(target, con.start, con.limit, offset, opts);
- if (after == WT_IGNORE) return false;
- int before = getPreviousWordType(target, con.start, con.limit, offset, opts);
- if (after == before) return false;
- }
- break;
-
- case 'B':
- if (con.length == 0)
- go = true;
- else {
- int after = getWordType(target, con.start, con.limit, offset, opts);
- go = after == WT_IGNORE
- || after == getPreviousWordType(target, con.start, con.limit, offset, opts);
- }
- if (!go) return false;
- break;
-
- case '<':
- if (con.length == 0 || offset == con.limit) return false;
- if (getWordType(target, con.start, con.limit, offset, opts) != WT_LETTER
- || getPreviousWordType(target, con.start, con.limit, offset, opts) != WT_OTHER)
- return false;
- break;
-
- case '>':
- if (con.length == 0 || offset == con.start) return false;
- if (getWordType(target, con.start, con.limit, offset, opts) != WT_OTHER
- || getPreviousWordType(target, con.start, con.limit, offset, opts) != WT_LETTER)
- return false;
- break;
- } // switch anchor type
-
- return true;
- }
-
- private static final int getPreviousWordType(ExpressionTarget target, int begin, int end,
- int offset, int opts) {
- int ret = getWordType(target, begin, end, --offset, opts);
- while (ret == WT_IGNORE)
- ret = getWordType(target, begin, end, --offset, opts);
- return ret;
- }
-
- private static final int getWordType(ExpressionTarget target, int begin, int end,
- int offset, int opts) {
- if (offset < begin || offset >= end) return WT_OTHER;
- return getWordType0(target.charAt(offset) , opts);
- }
-
-
- /**
- * Checks whether the <var>target</var> text <strong>contains</strong> this pattern or not.
- *
- * @return true if the target is matched to this regular expression.
- */
- public boolean matches(CharacterIterator target) {
- return this.matches(target, (Match)null);
- }
-
-
- /**
- * Checks whether the <var>target</var> text <strong>contains</strong> this pattern or not.
- *
- * @param match A Match instance for storing matching result.
- * @return Offset of the start position in <VAR>target</VAR>; or -1 if not match.
- */
- public boolean matches(CharacterIterator target, Match match) {
- int start = target.getBeginIndex();
- int end = target.getEndIndex();
-
-
-
- synchronized (this) {
- if (this.operations == null)
- this.prepare();
- if (this.context == null)
- this.context = new Context();
- }
- Context con = null;
- synchronized (this.context) {
- con = this.context.inuse ? new Context() : this.context;
- con.reset(target, start, end, this.numberOfClosures);
- }
- if (match != null) {
- match.setNumberOfGroups(this.nofparen);
- match.setSource(target);
- } else if (this.hasBackReferences) {
- match = new Match();
- match.setNumberOfGroups(this.nofparen);
- // Need not to call setSource() because
- // a caller can not access this match instance.
- }
- con.match = match;
-
- if (RegularExpression.isSet(this.options, XMLSCHEMA_MODE)) {
- int matchEnd = this.match(con, this.operations, con.start, 1, this.options);
- //System.err.println("DEBUG: matchEnd="+matchEnd);
- if (matchEnd == con.limit) {
- if (con.match != null) {
- con.match.setBeginning(0, con.start);
- con.match.setEnd(0, matchEnd);
- }
- con.setInUse(false);
- return true;
- }
- return false;
- }
-
- /*
- * The pattern has only fixed string.
- * The engine uses Boyer-Moore.
- */
- if (this.fixedStringOnly) {
- //System.err.println("DEBUG: fixed-only: "+this.fixedString);
- int o = this.fixedStringTable.matches(target, con.start, con.limit);
- if (o >= 0) {
- if (con.match != null) {
- con.match.setBeginning(0, o);
- con.match.setEnd(0, o+this.fixedString.length());
- }
- con.setInUse(false);
- return true;
- }
- con.setInUse(false);
- return false;
- }
-
- /*
- * The pattern contains a fixed string.
- * The engine checks with Boyer-Moore whether the text contains the fixed string or not.
- * If not, it return with false.
- */
- if (this.fixedString != null) {
- int o = this.fixedStringTable.matches(target, con.start, con.limit);
- if (o < 0) {
- //System.err.println("Non-match in fixed-string search.");
- con.setInUse(false);
- return false;
- }
- }
-
- int limit = con.limit-this.minlength;
- int matchStart;
- int matchEnd = -1;
-
- /*
- * Checks whether the expression starts with ".*".
- */
- if (this.operations != null
- && this.operations.type == Op.CLOSURE && this.operations.getChild().type == Op.DOT) {
- if (isSet(this.options, SINGLE_LINE)) {
- matchStart = con.start;
- matchEnd = this.match(con, this.operations, con.start, 1, this.options);
- } else {
- boolean previousIsEOL = true;
- for (matchStart = con.start; matchStart <= limit; matchStart ++) {
- int ch = target .setIndex( matchStart ) ;
- if (isEOLChar(ch)) {
- previousIsEOL = true;
- } else {
- if (previousIsEOL) {
- if (0 <= (matchEnd = this.match(con, this.operations,
- matchStart, 1, this.options)))
- break;
- }
- previousIsEOL = false;
- }
- }
- }
- }
-
- /*
- * Optimization against the first character.
- */
- else if (this.firstChar != null) {
- //System.err.println("DEBUG: with firstchar-matching: "+this.firstChar);
- RangeToken range = this.firstChar;
- for (matchStart = con.start; matchStart <= limit; matchStart ++) {
- int ch = target .setIndex( matchStart ) ;
- if (REUtil.isHighSurrogate(ch) && matchStart+1 < con.limit) {
- ch = REUtil.composeFromSurrogates(ch, target.setIndex(matchStart+1));
- }
- if (!range.match(ch)) {
- continue;
- }
- if (0 <= (matchEnd = this.match(con, this.operations,
- matchStart, 1, this.options))) {
- break;
- }
- }
- }
-
- /*
- * Straightforward matching.
- */
- else {
- for (matchStart = con.start; matchStart <= limit; matchStart ++) {
- if (0 <= (matchEnd = this. match(con, this.operations, matchStart, 1, this.options)))
- break;
- }
- }
-
- if (matchEnd >= 0) {
- if (con.match != null) {
- con.match.setBeginning(0, matchStart);
- con.match.setEnd(0, matchEnd);
- }
- con.setInUse(false);
- return true;
- } else {
- con.setInUse(false);
- return false;
- }
- }
-
- // ================================================================
-
- /**
- * A regular expression.
- * @serial
- */
- String regex;
- /**
- * @serial
- */
- int options;
-
- /**
- * The number of parenthesis in the regular expression.
- * @serial
- */
- int nofparen;
- /**
- * Internal representation of the regular expression.
- * @serial
- */
- Token tokentree;
-
- boolean hasBackReferences = false;
-
- transient int minlength;
- transient Op operations = null;
- transient int numberOfClosures;
- transient Context context = null;
- transient RangeToken firstChar = null;
-
- transient String fixedString = null;
- transient int fixedStringOptions;
- transient BMPattern fixedStringTable = null;
- transient boolean fixedStringOnly = false;
-
- static abstract class ExpressionTarget {
- abstract char charAt(int index);
- abstract boolean regionMatches(boolean ignoreCase, int offset, int limit, String part, int partlen);
- abstract boolean regionMatches(boolean ignoreCase, int offset, int limit, int offset2, int partlen);
- }
-
- static final class StringTarget extends ExpressionTarget {
-
- private String target;
-
- StringTarget(String target) {
- this.target = target;
- }
-
- final void resetTarget(String target) {
- this.target = target;
- }
-
- final char charAt(int index) {
- return target.charAt(index);
- }
-
- final boolean regionMatches(boolean ignoreCase, int offset, int limit,
- String part, int partlen) {
- if (limit-offset < partlen) {
- return false;
- }
- return (ignoreCase) ? target.regionMatches(true, offset, part, 0, partlen) : target.regionMatches(offset, part, 0, partlen);
- }
-
- final boolean regionMatches(boolean ignoreCase, int offset, int limit,
- int offset2, int partlen) {
- if (limit-offset < partlen) {
- return false;
- }
- return (ignoreCase) ? target.regionMatches(true, offset, target, offset2, partlen)
- : target.regionMatches(offset, target, offset2, partlen);
- }
- }
-
- static final class CharArrayTarget extends ExpressionTarget {
-
- char[] target;
-
- CharArrayTarget(char[] target) {
- this.target = target;
- }
-
- final void resetTarget(char[] target) {
- this.target = target;
- }
-
- char charAt(int index) {
- return target[index];
- }
-
- final boolean regionMatches(boolean ignoreCase, int offset, int limit,
- String part, int partlen) {
- if (offset < 0 || limit-offset < partlen) {
- return false;
- }
- return (ignoreCase) ? regionMatchesIgnoreCase(offset, limit, part, partlen)
- : regionMatches(offset, limit, part, partlen);
- }
-
- private final boolean regionMatches(int offset, int limit, String part, int partlen) {
- int i = 0;
- while (partlen-- > 0) {
- if (target[offset++] != part.charAt(i++)) {
- return false;
- }
- }
- return true;
- }
-
- private final boolean regionMatchesIgnoreCase(int offset, int limit, String part, int partlen) {
- int i = 0;
- while (partlen-- > 0) {
- final char ch1 = target[offset++] ;
- final char ch2 = part.charAt(i++);
- if (ch1 == ch2) {
- continue;
- }
- final char uch1 = Character.toUpperCase(ch1);
- final char uch2 = Character.toUpperCase(ch2);
- if (uch1 == uch2) {
- continue;
- }
- if (Character.toLowerCase(uch1) != Character.toLowerCase(uch2)) {
- return false;
- }
- }
- return true;
- }
-
- final boolean regionMatches(boolean ignoreCase, int offset, int limit, int offset2, int partlen) {
- if (offset < 0 || limit-offset < partlen) {
- return false;
- }
- return (ignoreCase) ? regionMatchesIgnoreCase(offset, limit, offset2, partlen)
- : regionMatches(offset, limit, offset2, partlen);
- }
-
- private final boolean regionMatches(int offset, int limit, int offset2, int partlen) {
- int i = offset2;
- while (partlen-- > 0) {
- if ( target [ offset++ ] != target [ i++ ] )
- return false;
- }
- return true;
- }
-
- private final boolean regionMatchesIgnoreCase(int offset, int limit, int offset2, int partlen) {
- int i = offset2;
- while (partlen-- > 0) {
- final char ch1 = target[offset++] ;
- final char ch2 = target[i++] ;
- if (ch1 == ch2) {
- continue;
- }
- final char uch1 = Character.toUpperCase(ch1);
- final char uch2 = Character.toUpperCase(ch2);
- if (uch1 == uch2) {
- continue;
- }
- if (Character.toLowerCase(uch1) != Character.toLowerCase(uch2)) {
- return false;
- }
- }
- return true;
- }
- }
-
- static final class CharacterIteratorTarget extends ExpressionTarget {
- CharacterIterator target;
-
- CharacterIteratorTarget(CharacterIterator target) {
- this.target = target;
- }
-
- final void resetTarget(CharacterIterator target) {
- this.target = target;
- }
-
- final char charAt(int index) {
- return target.setIndex(index);
- }
-
- final boolean regionMatches(boolean ignoreCase, int offset, int limit,
- String part, int partlen) {
- if (offset < 0 || limit-offset < partlen) {
- return false;
- }
- return (ignoreCase) ? regionMatchesIgnoreCase(offset, limit, part, partlen)
- : regionMatches(offset, limit, part, partlen);
- }
-
- private final boolean regionMatches(int offset, int limit, String part, int partlen) {
- int i = 0;
- while (partlen-- > 0) {
- if (target.setIndex(offset++) != part.charAt(i++)) {
- return false;
- }
- }
- return true;
- }
-
- private final boolean regionMatchesIgnoreCase(int offset, int limit, String part, int partlen) {
- int i = 0;
- while (partlen-- > 0) {
- final char ch1 = target.setIndex(offset++) ;
- final char ch2 = part.charAt(i++);
- if (ch1 == ch2) {
- continue;
- }
- final char uch1 = Character.toUpperCase(ch1);
- final char uch2 = Character.toUpperCase(ch2);
- if (uch1 == uch2) {
- continue;
- }
- if (Character.toLowerCase(uch1) != Character.toLowerCase(uch2)) {
- return false;
- }
- }
- return true;
- }
-
- final boolean regionMatches(boolean ignoreCase, int offset, int limit, int offset2, int partlen) {
- if (offset < 0 || limit-offset < partlen) {
- return false;
- }
- return (ignoreCase) ? regionMatchesIgnoreCase(offset, limit, offset2, partlen)
- : regionMatches(offset, limit, offset2, partlen);
- }
-
- private final boolean regionMatches(int offset, int limit, int offset2, int partlen) {
- int i = offset2;
- while (partlen-- > 0) {
- if (target.setIndex(offset++) != target.setIndex(i++)) {
- return false;
- }
- }
- return true;
- }
-
- private final boolean regionMatchesIgnoreCase(int offset, int limit, int offset2, int partlen) {
- int i = offset2;
- while (partlen-- > 0) {
- final char ch1 = target.setIndex(offset++) ;
- final char ch2 = target.setIndex(i++) ;
- if (ch1 == ch2) {
- continue;
- }
- final char uch1 = Character.toUpperCase(ch1);
- final char uch2 = Character.toUpperCase(ch2);
- if (uch1 == uch2) {
- continue;
- }
- if (Character.toLowerCase(uch1) != Character.toLowerCase(uch2)) {
- return false;
- }
- }
- return true;
- }
- }
-
- static final class ClosureContext {
-
- int[] offsets = new int[4];
- int currentIndex = 0;
-
- boolean contains(int offset) {
- for (int i=0; i<currentIndex;++i) {
- if (offsets[i] == offset) {
- return true;
- }
- }
- return false;
- }
-
- void reset() {
- currentIndex = 0;
- }
-
- void addOffset(int offset) {
- // We do not check for duplicates, caller is responsible for that
- if (currentIndex == offsets.length) {
- offsets = expandOffsets();
- }
- offsets[currentIndex++] = offset;
- }
-
- private int[] expandOffsets() {
- final int len = offsets.length;
- final int newLen = len << 1;
- int[] newOffsets = new int[newLen];
-
- System.arraycopy(offsets, 0, newOffsets, 0, currentIndex);
- return newOffsets;
- }
- }
-
- static final class Context {
- int start;
- int limit;
- int length;
- Match match;
- boolean inuse = false;
- ClosureContext[] closureContexts;
-
- private StringTarget stringTarget;
- private CharArrayTarget charArrayTarget;
- private CharacterIteratorTarget characterIteratorTarget;
-
- ExpressionTarget target;
-
- Context() {
- }
-
- private void resetCommon(int nofclosures) {
- this.length = this.limit-this.start;
- setInUse(true);
- this.match = null;
- if (this.closureContexts == null || this.closureContexts.length != nofclosures) {
- this.closureContexts = new ClosureContext[nofclosures];
- }
- for (int i = 0; i < nofclosures; i ++) {
- if (this.closureContexts[i] == null) {
- this.closureContexts[i] = new ClosureContext();
- }
- else {
- this.closureContexts[i].reset();
- }
- }
- }
-
- void reset(CharacterIterator target, int start, int limit, int nofclosures) {
- if (characterIteratorTarget == null) {
- characterIteratorTarget = new CharacterIteratorTarget(target);
- }
- else {
- characterIteratorTarget.resetTarget(target);
- }
- this.target = characterIteratorTarget;
- this.start = start;
- this.limit = limit;
- this.resetCommon(nofclosures);
- }
-
- void reset(String target, int start, int limit, int nofclosures) {
- if (stringTarget == null) {
- stringTarget = new StringTarget(target);
- }
- else {
- stringTarget.resetTarget(target);
- }
- this.target = stringTarget;
- this.start = start;
- this.limit = limit;
- this.resetCommon(nofclosures);
- }
-
- void reset(char[] target, int start, int limit, int nofclosures) {
- if (charArrayTarget == null) {
- charArrayTarget = new CharArrayTarget(target);
- }
- else {
- charArrayTarget.resetTarget(target);
- }
- this.target = charArrayTarget;
- this.start = start;
- this.limit = limit;
- this.resetCommon(nofclosures);
- }
- synchronized void setInUse(boolean inUse) {
- this.inuse = inUse;
- }
- }
-
- /**
- * Prepares for matching. This method is called just before starting matching.
- */
- void prepare() {
- if (Op.COUNT) Op.nofinstances = 0;
- this.compile(this.tokentree);
- /*
- if (this.operations.type == Op.CLOSURE && this.operations.getChild().type == Op.DOT) { // .*
- Op anchor = Op.createAnchor(isSet(this.options, SINGLE_LINE) ? 'A' : '@');
- anchor.next = this.operations;
- this.operations = anchor;
- }
- */
- if (Op.COUNT) System.err.println("DEBUG: The number of operations: "+Op.nofinstances);
-
- this.minlength = this.tokentree.getMinLength();
-
- this.firstChar = null;
- if (!isSet(this.options, PROHIBIT_HEAD_CHARACTER_OPTIMIZATION)
- && !isSet(this.options, XMLSCHEMA_MODE)) {
- RangeToken firstChar = Token.createRange();
- int fresult = this.tokentree.analyzeFirstCharacter(firstChar, this.options);
- if (fresult == Token.FC_TERMINAL) {
- firstChar.compactRanges();
- this.firstChar = firstChar;
- if (DEBUG)
- System.err.println("DEBUG: Use the first character optimization: "+firstChar);
- }
- }
-
- if (this.operations != null
- && (this.operations.type == Op.STRING || this.operations.type == Op.CHAR)
- && this.operations.next == null) {
- if (DEBUG)
- System.err.print(" *** Only fixed string! *** ");
- this.fixedStringOnly = true;
- if (this.operations.type == Op.STRING)
- this.fixedString = this.operations.getString();
- else if (this.operations.getData() >= 0x10000) { // Op.CHAR
- this.fixedString = REUtil.decomposeToSurrogates(this.operations.getData());
- } else {
- char[] ac = new char[1];
- ac[0] = (char)this.operations.getData();
- this.fixedString = new String(ac);
- }
- this.fixedStringOptions = this.options;
- this.fixedStringTable = new BMPattern(this.fixedString, 256,
- isSet(this.fixedStringOptions, IGNORE_CASE));
- } else if (!isSet(this.options, PROHIBIT_FIXED_STRING_OPTIMIZATION)
- && !isSet(this.options, XMLSCHEMA_MODE)) {
- Token.FixedStringContainer container = new Token.FixedStringContainer();
- this.tokentree.findFixedString(container, this.options);
- this.fixedString = container.token == null ? null : container.token.getString();
- this.fixedStringOptions = container.options;
- if (this.fixedString != null && this.fixedString.length() < 2)
- this.fixedString = null;
- // This pattern has a fixed string of which length is more than one.
- if (this.fixedString != null) {
- this.fixedStringTable = new BMPattern(this.fixedString, 256,
- isSet(this.fixedStringOptions, IGNORE_CASE));
- if (DEBUG) {
- System.err.println("DEBUG: The longest fixed string: "+this.fixedString.length()
- +"/" //+this.fixedString
- +"/"+REUtil.createOptionString(this.fixedStringOptions));
- System.err.print("String: ");
- REUtil.dumpString(this.fixedString);
- }
- }
- }
- }
-
- /**
- * An option.
- * If you specify this option, <span class="REGEX"><kbd>(</kbd><var>X</var><kbd>)</kbd></span>
- * captures matched text, and <span class="REGEX"><kbd>(:?</kbd><var>X</var><kbd>)</kbd></span>
- * does not capture.
- *
- * @see #RegularExpression(java.lang.String,int)
- * @see #setPattern(java.lang.String,int)
- static final int MARK_PARENS = 1<<0;
- */
-
- /**
- * "i"
- */
- static final int IGNORE_CASE = 1<<1;
-
- /**
- * "s"
- */
- static final int SINGLE_LINE = 1<<2;
-
- /**
- * "m"
- */
- static final int MULTIPLE_LINES = 1<<3;
-
- /**
- * "x"
- */
- static final int EXTENDED_COMMENT = 1<<4;
-
- /**
- * This option redefines <span class="REGEX"><kbd>\d \D \w \W \s \S</kbd></span>.
- *
- * @see #RegularExpression(java.lang.String,int)
- * @see #setPattern(java.lang.String,int)
- * @see #UNICODE_WORD_BOUNDARY
- */
- static final int USE_UNICODE_CATEGORY = 1<<5; // "u"
-
- /**
- * An option.
- * This enables to process locale-independent word boundary for <span class="REGEX"><kbd>\b \B \&lt; \></kbd></span>.
- * <p>By default, the engine considers a position between a word character
- * (<span class="REGEX"><Kbd>\w</kbd></span>) and a non word character
- * is a word boundary.
- * <p>By this option, the engine checks word boundaries with the method of
- * 'Unicode Regular Expression Guidelines' Revision 4.
- *
- * @see #RegularExpression(java.lang.String,int)
- * @see #setPattern(java.lang.String,int)
- */
- static final int UNICODE_WORD_BOUNDARY = 1<<6; // "w"
-
- /**
- * "H"
- */
- static final int PROHIBIT_HEAD_CHARACTER_OPTIMIZATION = 1<<7;
- /**
- * "F"
- */
- static final int PROHIBIT_FIXED_STRING_OPTIMIZATION = 1<<8;
- /**
- * "X". XML Schema mode.
- */
- static final int XMLSCHEMA_MODE = 1<<9;
- /**
- * ",".
- */
- static final int SPECIAL_COMMA = 1<<10;
-
-
- private static final boolean isSet(int options, int flag) {
- return (options & flag) == flag;
- }
-
- /**
- * Creates a new RegularExpression instance.
- *
- * @param regex A regular expression
- * @exception org.apache.xerces.utils.regex.ParseException <VAR>regex</VAR> is not conforming to the syntax.
- */
- public RegularExpression(String regex) throws ParseException {
- this(regex, null);
- }
-
- /**
- * Creates a new RegularExpression instance with options.
- *
- * @param regex A regular expression
- * @param options A String consisted of "i" "m" "s" "u" "w" "," "X"
- * @exception org.apache.xerces.utils.regex.ParseException <VAR>regex</VAR> is not conforming to the syntax.
- */
- public RegularExpression(String regex, String options) throws ParseException {
- this.setPattern(regex, options);
- }
-
- /**
- * Creates a new RegularExpression instance with options.
- *
- * @param regex A regular expression
- * @param options A String consisted of "i" "m" "s" "u" "w" "," "X"
- * @exception org.apache.xerces.utils.regex.ParseException <VAR>regex</VAR> is not conforming to the syntax.
- */
- public RegularExpression(String regex, String options, Locale locale) throws ParseException {
- this.setPattern(regex, options, locale);
- }
-
- RegularExpression(String regex, Token tok, int parens, boolean hasBackReferences, int options) {
- this.regex = regex;
- this.tokentree = tok;
- this.nofparen = parens;
- this.options = options;
- this.hasBackReferences = hasBackReferences;
- }
-
- /**
- *
- */
- public void setPattern(String newPattern) throws ParseException {
- this.setPattern(newPattern, Locale.getDefault());
- }
-
- public void setPattern(String newPattern, Locale locale) throws ParseException {
- this.setPattern(newPattern, this.options, locale);
- }
-
- private void setPattern(String newPattern, int options, Locale locale) throws ParseException {
- this.regex = newPattern;
- this.options = options;
- RegexParser rp = RegularExpression.isSet(this.options, RegularExpression.XMLSCHEMA_MODE)
- ? new ParserForXMLSchema(locale) : new RegexParser(locale);
- this.tokentree = rp.parse(this.regex, this.options);
- this.nofparen = rp.parennumber;
- this.hasBackReferences = rp.hasBackReferences;
-
- this.operations = null;
- this.context = null;
- }
- /**
- *
- */
- public void setPattern(String newPattern, String options) throws ParseException {
- this.setPattern(newPattern, options, Locale.getDefault());
- }
-
- public void setPattern(String newPattern, String options, Locale locale) throws ParseException {
- this.setPattern(newPattern, REUtil.parseOptions(options), locale);
- }
-
- /**
- *
- */
- public String getPattern() {
- return this.regex;
- }
-
- /**
- * Represents this instence in String.
- */
- public String toString() {
- return this.tokentree.toString(this.options);
- }
-
- /**
- * Returns a option string.
- * The order of letters in it may be different from a string specified
- * in a constructor or <code>setPattern()</code>.
- *
- * @see #RegularExpression(java.lang.String,java.lang.String)
- * @see #setPattern(java.lang.String,java.lang.String)
- */
- public String getOptions() {
- return REUtil.createOptionString(this.options);
- }
-
- /**
- * Return true if patterns are the same and the options are equivalent.
- */
- public boolean equals(Object obj) {
- if (obj == null) return false;
- if (!(obj instanceof RegularExpression))
- return false;
- RegularExpression r = (RegularExpression)obj;
- return this.regex.equals(r.regex) && this.options == r.options;
- }
-
- boolean equals(String pattern, int options) {
- return this.regex.equals(pattern) && this.options == options;
- }
-
- /**
- *
- */
- public int hashCode() {
- return (this.regex+"/"+this.getOptions()).hashCode();
- }
-
- /**
- * Return the number of regular expression groups.
- * This method returns 1 when the regular expression has no capturing-parenthesis.
- *
- */
- public int getNumberOfGroups() {
- return this.nofparen;
- }
-
- // ================================================================
-
- private static final int WT_IGNORE = 0;
- private static final int WT_LETTER = 1;
- private static final int WT_OTHER = 2;
- private static final int getWordType0(char ch, int opts) {
- if (!isSet(opts, UNICODE_WORD_BOUNDARY)) {
- if (isSet(opts, USE_UNICODE_CATEGORY)) {
- return (Token.getRange("IsWord", true).match(ch)) ? WT_LETTER : WT_OTHER;
- }
- return isWordChar(ch) ? WT_LETTER : WT_OTHER;
- }
-
- switch (Character.getType(ch)) {
- case Character.UPPERCASE_LETTER: // L
- case Character.LOWERCASE_LETTER: // L
- case Character.TITLECASE_LETTER: // L
- case Character.MODIFIER_LETTER: // L
- case Character.OTHER_LETTER: // L
- case Character.LETTER_NUMBER: // N
- case Character.DECIMAL_DIGIT_NUMBER: // N
- case Character.OTHER_NUMBER: // N
- case Character.COMBINING_SPACING_MARK: // Mc
- return WT_LETTER;
-
- case Character.FORMAT: // Cf
- case Character.NON_SPACING_MARK: // Mn
- case Character.ENCLOSING_MARK: // Mc
- return WT_IGNORE;
-
- case Character.CONTROL: // Cc
- switch (ch) {
- case '\t':
- case '\n':
- case '\u000B':
- case '\f':
- case '\r':
- return WT_OTHER;
- default:
- return WT_IGNORE;
- }
-
- default:
- return WT_OTHER;
- }
- }
-
- // ================================================================
-
- static final int LINE_FEED = 0x000A;
- static final int CARRIAGE_RETURN = 0x000D;
- static final int LINE_SEPARATOR = 0x2028;
- static final int PARAGRAPH_SEPARATOR = 0x2029;
-
- private static final boolean isEOLChar(int ch) {
- return ch == LINE_FEED || ch == CARRIAGE_RETURN || ch == LINE_SEPARATOR
- || ch == PARAGRAPH_SEPARATOR;
- }
-
- private static final boolean isWordChar(int ch) { // Legacy word characters
- if (ch == '_') return true;
- if (ch < '0') return false;
- if (ch > 'z') return false;
- if (ch <= '9') return true;
- if (ch < 'A') return false;
- if (ch <= 'Z') return true;
- if (ch < 'a') return false;
- return true;
- }
-
- private static final boolean matchIgnoreCase(int chardata, int ch) {
- if (chardata == ch) return true;
- if (chardata > 0xffff || ch > 0xffff) return false;
- char uch1 = Character.toUpperCase((char)chardata);
- char uch2 = Character.toUpperCase((char)ch);
- if (uch1 == uch2) return true;
- return Character.toLowerCase(uch1) == Character.toLowerCase(uch2);
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/Token.java b/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/Token.java
deleted file mode 100644
index e364995..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/Token.java
+++ /dev/null
@@ -1,1574 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xpath.regex;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.ObjectStreamField;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.Vector;
-
-/**
- * This class represents a node in parse tree.
- *
- * @xerces.internal
- *
- * @version $Id: Token.java,v 1.7 2010/07/27 05:02:34 joehw Exp $
- */
-class Token implements java.io.Serializable {
-
- private static final long serialVersionUID = 8484976002585487481L;
-
- static final boolean COUNTTOKENS = true;
- static int tokens = 0;
-
- static final int CHAR = 0; // Literal char
- static final int DOT = 11; // .
- static final int CONCAT = 1; // XY
- static final int UNION = 2; // X|Y|Z
- static final int CLOSURE = 3; // X*
- static final int RANGE = 4; // [a-zA-Z] etc.
- static final int NRANGE = 5; // [^a-zA-Z] etc.
- static final int PAREN = 6; // (X) or (?:X)
- static final int EMPTY = 7; //
- static final int ANCHOR = 8; // ^ $ \b \B \< \> \A \Z \z
- static final int NONGREEDYCLOSURE = 9; // *? +?
- static final int STRING = 10; // strings
- static final int BACKREFERENCE = 12; // back references
- static final int LOOKAHEAD = 20; // (?=...)
- static final int NEGATIVELOOKAHEAD = 21; // (?!...)
- static final int LOOKBEHIND = 22; // (?<=...)
- static final int NEGATIVELOOKBEHIND = 23; // (?<!...)
- static final int INDEPENDENT = 24; // (?>...)
- static final int MODIFIERGROUP = 25; // (?ims-ims:...)
- static final int CONDITION = 26; // (?(...)yes|no)
-
- static final int UTF16_MAX = 0x10ffff;
-
- final int type;
-
- static Token token_dot;
- static Token token_0to9;
- static Token token_wordchars;
- static Token token_not_0to9;
- static Token token_not_wordchars;
- static Token token_spaces;
- static Token token_not_spaces;
- static Token token_empty;
- static Token token_linebeginning;
- static Token token_linebeginning2;
- static Token token_lineend;
- static Token token_stringbeginning;
- static Token token_stringend;
- static Token token_stringend2;
- static Token token_wordedge;
- static Token token_not_wordedge;
- static Token token_wordbeginning;
- static Token token_wordend;
- static {
- Token.token_empty = new Token(Token.EMPTY);
-
- Token.token_linebeginning = Token.createAnchor('^');
- Token.token_linebeginning2 = Token.createAnchor('@');
- Token.token_lineend = Token.createAnchor('$');
- Token.token_stringbeginning = Token.createAnchor('A');
- Token.token_stringend = Token.createAnchor('z');
- Token.token_stringend2 = Token.createAnchor('Z');
- Token.token_wordedge = Token.createAnchor('b');
- Token.token_not_wordedge = Token.createAnchor('B');
- Token.token_wordbeginning = Token.createAnchor('<');
- Token.token_wordend = Token.createAnchor('>');
-
- Token.token_dot = new Token(Token.DOT);
-
- Token.token_0to9 = Token.createRange();
- Token.token_0to9.addRange('0', '9');
- Token.token_wordchars = Token.createRange();
- Token.token_wordchars.addRange('0', '9');
- Token.token_wordchars.addRange('A', 'Z');
- Token.token_wordchars.addRange('_', '_');
- Token.token_wordchars.addRange('a', 'z');
- Token.token_spaces = Token.createRange();
- Token.token_spaces.addRange('\t', '\t');
- Token.token_spaces.addRange('\n', '\n');
- Token.token_spaces.addRange('\f', '\f');
- Token.token_spaces.addRange('\r', '\r');
- Token.token_spaces.addRange(' ', ' ');
-
- Token.token_not_0to9 = Token.complementRanges(Token.token_0to9);
- Token.token_not_wordchars = Token.complementRanges(Token.token_wordchars);
- Token.token_not_spaces = Token.complementRanges(Token.token_spaces);
- }
-
- static Token.ParenToken createLook(int type, Token child) {
- if (COUNTTOKENS) Token.tokens ++;
- return new Token.ParenToken(type, child, 0);
- }
- static Token.ParenToken createParen(Token child, int pnumber) {
- if (COUNTTOKENS) Token.tokens ++;
- return new Token.ParenToken(Token.PAREN, child, pnumber);
- }
- static Token.ClosureToken createClosure(Token tok) {
- if (COUNTTOKENS) Token.tokens ++;
- return new Token.ClosureToken(Token.CLOSURE, tok);
- }
- static Token.ClosureToken createNGClosure(Token tok) {
- if (COUNTTOKENS) Token.tokens ++;
- return new Token.ClosureToken(Token.NONGREEDYCLOSURE, tok);
- }
- static Token.ConcatToken createConcat(Token tok1, Token tok2) {
- if (COUNTTOKENS) Token.tokens ++;
- return new Token.ConcatToken(tok1, tok2);
- }
- static Token.UnionToken createConcat() {
- if (COUNTTOKENS) Token.tokens ++;
- return new Token.UnionToken(Token.CONCAT); // *** It is not a bug.
- }
- static Token.UnionToken createUnion() {
- if (COUNTTOKENS) Token.tokens ++;
- return new Token.UnionToken(Token.UNION);
- }
- static Token createEmpty() {
- return Token.token_empty;
- }
- static RangeToken createRange() {
- if (COUNTTOKENS) Token.tokens ++;
- return new RangeToken(Token.RANGE);
- }
- static RangeToken createNRange() {
- if (COUNTTOKENS) Token.tokens ++;
- return new RangeToken(Token.NRANGE);
- }
- static Token.CharToken createChar(int ch) {
- if (COUNTTOKENS) Token.tokens ++;
- return new Token.CharToken(Token.CHAR, ch);
- }
- static private Token.CharToken createAnchor(int ch) {
- if (COUNTTOKENS) Token.tokens ++;
- return new Token.CharToken(Token.ANCHOR, ch);
- }
- static Token.StringToken createBackReference(int refno) {
- if (COUNTTOKENS) Token.tokens ++;
- return new Token.StringToken(Token.BACKREFERENCE, null, refno);
- }
- static Token.StringToken createString(String str) {
- if (COUNTTOKENS) Token.tokens ++;
- return new Token.StringToken(Token.STRING, str, 0);
- }
- static Token.ModifierToken createModifierGroup(Token child, int add, int mask) {
- if (COUNTTOKENS) Token.tokens ++;
- return new Token.ModifierToken(child, add, mask);
- }
- static Token.ConditionToken createCondition(int refno, Token condition,
- Token yespat, Token nopat) {
- if (COUNTTOKENS) Token.tokens ++;
- return new Token.ConditionToken(refno, condition, yespat, nopat);
- }
-
- protected Token(int type) {
- this.type = type;
- }
-
- /**
- * A number of children.
- */
- int size() {
- return 0;
- }
- Token getChild(int index) {
- return null;
- }
- void addChild(Token tok) {
- throw new RuntimeException("Not supported.");
- }
-
- // for RANGE or NRANGE
- protected void addRange(int start, int end) {
- throw new RuntimeException("Not supported.");
- }
- protected void sortRanges() {
- throw new RuntimeException("Not supported.");
- }
- protected void compactRanges() {
- throw new RuntimeException("Not supported.");
- }
- protected void mergeRanges(Token tok) {
- throw new RuntimeException("Not supported.");
- }
- protected void subtractRanges(Token tok) {
- throw new RuntimeException("Not supported.");
- }
- protected void intersectRanges(Token tok) {
- throw new RuntimeException("Not supported.");
- }
- static Token complementRanges(Token tok) {
- return RangeToken.complementRanges(tok);
- }
-
-
- void setMin(int min) { // for CLOSURE
- }
- void setMax(int max) { // for CLOSURE
- }
- int getMin() { // for CLOSURE
- return -1;
- }
- int getMax() { // for CLOSURE
- return -1;
- }
- int getReferenceNumber() { // for STRING
- return 0;
- }
- String getString() { // for STRING
- return null;
- }
-
- int getParenNumber() {
- return 0;
- }
- int getChar() {
- return -1;
- }
-
- public String toString() {
- return this.toString(0);
- }
- public String toString(int options) {
- return this.type == Token.DOT ? "." : "";
- }
-
- /**
- * How many characters are needed?
- */
- final int getMinLength() {
- switch (this.type) {
- case CONCAT:
- int sum = 0;
- for (int i = 0; i < this.size(); i ++)
- sum += this.getChild(i).getMinLength();
- return sum;
-
- case CONDITION:
- case UNION:
- if (this.size() == 0)
- return 0;
- int ret = this.getChild(0).getMinLength();
- for (int i = 1; i < this.size(); i ++) {
- int min = this.getChild(i).getMinLength();
- if (min < ret) ret = min;
- }
- return ret;
-
- case CLOSURE:
- case NONGREEDYCLOSURE:
- if (this.getMin() >= 0)
- return this.getMin() * this.getChild(0).getMinLength();
- return 0;
-
- case EMPTY:
- case ANCHOR:
- return 0;
-
- case DOT:
- case CHAR:
- case RANGE:
- case NRANGE:
- return 1;
-
- case INDEPENDENT:
- case PAREN:
- case MODIFIERGROUP:
- return this.getChild(0).getMinLength();
-
- case BACKREFERENCE:
- return 0; // *******
-
- case STRING:
- return this.getString().length();
-
- case LOOKAHEAD:
- case NEGATIVELOOKAHEAD:
- case LOOKBEHIND:
- case NEGATIVELOOKBEHIND:
- return 0; // ***** Really?
-
- default:
- throw new RuntimeException("Token#getMinLength(): Invalid Type: "+this.type);
- }
- }
-
- final int getMaxLength() {
- switch (this.type) {
- case CONCAT:
- int sum = 0;
- for (int i = 0; i < this.size(); i ++) {
- int d = this.getChild(i).getMaxLength();
- if (d < 0) return -1;
- sum += d;
- }
- return sum;
-
- case CONDITION:
- case UNION:
- if (this.size() == 0)
- return 0;
- int ret = this.getChild(0).getMaxLength();
- for (int i = 1; ret >= 0 && i < this.size(); i ++) {
- int max = this.getChild(i).getMaxLength();
- if (max < 0) { // infinity
- ret = -1;
- break;
- }
- if (max > ret) ret = max;
- }
- return ret;
-
- case CLOSURE:
- case NONGREEDYCLOSURE:
- if (this.getMax() >= 0)
- // When this.child.getMaxLength() < 0,
- // this returns minus value
- return this.getMax() * this.getChild(0).getMaxLength();
- return -1;
-
- case EMPTY:
- case ANCHOR:
- return 0;
-
- case CHAR:
- return 1;
- case DOT:
- case RANGE:
- case NRANGE:
- return 2;
-
- case INDEPENDENT:
- case PAREN:
- case MODIFIERGROUP:
- return this.getChild(0).getMaxLength();
-
- case BACKREFERENCE:
- return -1; // ******
-
- case STRING:
- return this.getString().length();
-
- case LOOKAHEAD:
- case NEGATIVELOOKAHEAD:
- case LOOKBEHIND:
- case NEGATIVELOOKBEHIND:
- return 0; // ***** Really?
-
- default:
- throw new RuntimeException("Token#getMaxLength(): Invalid Type: "+this.type);
- }
- }
-
- static final int FC_CONTINUE = 0;
- static final int FC_TERMINAL = 1;
- static final int FC_ANY = 2;
- private static final boolean isSet(int options, int flag) {
- return (options & flag) == flag;
- }
- final int analyzeFirstCharacter(RangeToken result, int options) {
- switch (this.type) {
- case CONCAT:
- int ret = FC_CONTINUE;
- for (int i = 0; i < this.size(); i ++)
- if ((ret = this.getChild(i).analyzeFirstCharacter(result, options)) != FC_CONTINUE)
- break;
- return ret;
-
- case UNION:
- if (this.size() == 0)
- return FC_CONTINUE;
- /*
- * a|b|c -> FC_TERMINAL
- * a|.|c -> FC_ANY
- * a|b| -> FC_CONTINUE
- */
- int ret2 = FC_CONTINUE;
- boolean hasEmpty = false;
- for (int i = 0; i < this.size(); i ++) {
- ret2 = this.getChild(i).analyzeFirstCharacter(result, options);
- if (ret2 == FC_ANY)
- break;
- else if (ret2 == FC_CONTINUE)
- hasEmpty = true;
- }
- return hasEmpty ? FC_CONTINUE : ret2;
-
- case CONDITION:
- int ret3 = this.getChild(0).analyzeFirstCharacter(result, options);
- if (this.size() == 1) return FC_CONTINUE;
- if (ret3 == FC_ANY) return ret3;
- int ret4 = this.getChild(1).analyzeFirstCharacter(result, options);
- if (ret4 == FC_ANY) return ret4;
- return ret3 == FC_CONTINUE || ret4 == FC_CONTINUE ? FC_CONTINUE : FC_TERMINAL;
-
- case CLOSURE:
- case NONGREEDYCLOSURE:
- this.getChild(0).analyzeFirstCharacter(result, options);
- return FC_CONTINUE;
-
- case EMPTY:
- case ANCHOR:
- return FC_CONTINUE;
-
- case CHAR:
- int ch = this.getChar();
- result.addRange(ch, ch);
- if (ch < 0x10000 && isSet(options, RegularExpression.IGNORE_CASE)) {
- ch = Character.toUpperCase((char)ch);
- result.addRange(ch, ch);
- ch = Character.toLowerCase((char)ch);
- result.addRange(ch, ch);
- }
- return FC_TERMINAL;
-
- case DOT:
- return FC_ANY;
-
- case RANGE:
- result.mergeRanges(this);
- return FC_TERMINAL;
-
- case NRANGE: // ****
- result.mergeRanges(Token.complementRanges(this));
- return FC_TERMINAL;
-
- case INDEPENDENT:
- case PAREN:
- return this.getChild(0).analyzeFirstCharacter(result, options);
-
- case MODIFIERGROUP:
- options |= ((ModifierToken)this).getOptions();
- options &= ~((ModifierToken)this).getOptionsMask();
- return this.getChild(0).analyzeFirstCharacter(result, options);
-
- case BACKREFERENCE:
- result.addRange(0, UTF16_MAX); // **** We can not optimize.
- return FC_ANY;
-
- case STRING:
- int cha = this.getString().charAt(0);
- int ch2;
- if (REUtil.isHighSurrogate(cha)
- && this.getString().length() >= 2
- && REUtil.isLowSurrogate((ch2 = this.getString().charAt(1))))
- cha = REUtil.composeFromSurrogates(cha, ch2);
- result.addRange(cha, cha);
- if (cha < 0x10000 && isSet(options, RegularExpression.IGNORE_CASE)) {
- cha = Character.toUpperCase((char)cha);
- result.addRange(cha, cha);
- cha = Character.toLowerCase((char)cha);
- result.addRange(cha, cha);
- }
- return FC_TERMINAL;
-
- case LOOKAHEAD:
- case NEGATIVELOOKAHEAD:
- case LOOKBEHIND:
- case NEGATIVELOOKBEHIND:
- return FC_CONTINUE;
-
- default:
- throw new RuntimeException("Token#analyzeHeadCharacter(): Invalid Type: "+this.type);
- }
- }
-
- private final boolean isShorterThan(Token tok) {
- if (tok == null) return false;
- /*
- int mylength;
- if (this.type == STRING) mylength = this.getString().length();
- else if (this.type == CHAR) mylength = this.getChar() >= 0x10000 ? 2 : 1;
- else throw new RuntimeException("Internal Error: Illegal type: "+this.type);
- int otherlength;
- if (tok.type == STRING) otherlength = tok.getString().length();
- else if (tok.type == CHAR) otherlength = tok.getChar() >= 0x10000 ? 2 : 1;
- else throw new RuntimeException("Internal Error: Illegal type: "+tok.type);
- */
- int mylength;
- if (this.type == STRING) mylength = this.getString().length();
- else throw new RuntimeException("Internal Error: Illegal type: "+this.type);
- int otherlength;
- if (tok.type == STRING) otherlength = tok.getString().length();
- else throw new RuntimeException("Internal Error: Illegal type: "+tok.type);
- return mylength < otherlength;
- }
-
- static class FixedStringContainer {
- Token token = null;
- int options = 0;
- FixedStringContainer() {
- }
- }
-
- final void findFixedString(FixedStringContainer container, int options) {
- switch (this.type) {
- case CONCAT:
- Token prevToken = null;
- int prevOptions = 0;
- for (int i = 0; i < this.size(); i ++) {
- this.getChild(i).findFixedString(container, options);
- if (prevToken == null || prevToken.isShorterThan(container.token)) {
- prevToken = container.token;
- prevOptions = container.options;
- }
- }
- container.token = prevToken;
- container.options = prevOptions;
- return;
-
- case UNION:
- case CLOSURE:
- case NONGREEDYCLOSURE:
- case EMPTY:
- case ANCHOR:
- case RANGE:
- case DOT:
- case NRANGE:
- case BACKREFERENCE:
- case LOOKAHEAD:
- case NEGATIVELOOKAHEAD:
- case LOOKBEHIND:
- case NEGATIVELOOKBEHIND:
- case CONDITION:
- container.token = null;
- return;
-
- case CHAR: // Ignore CHAR tokens.
- container.token = null; // **
- return; // **
-
- case STRING:
- container.token = this;
- container.options = options;
- return;
-
- case INDEPENDENT:
- case PAREN:
- this.getChild(0).findFixedString(container, options);
- return;
-
- case MODIFIERGROUP:
- options |= ((ModifierToken)this).getOptions();
- options &= ~((ModifierToken)this).getOptionsMask();
- this.getChild(0).findFixedString(container, options);
- return;
-
- default:
- throw new RuntimeException("Token#findFixedString(): Invalid Type: "+this.type);
- }
- }
-
- boolean match(int ch) {
- throw new RuntimeException("NFAArrow#match(): Internal error: "+this.type);
- }
-
- // ------------------------------------------------------
- private final static Map<String, Token> categories = new HashMap<>();
- private final static Map<String, Token> categories2 = new HashMap<>();
- private static final String[] categoryNames = {
- "Cn", "Lu", "Ll", "Lt", "Lm", "Lo", "Mn", "Me", "Mc", "Nd",
- "Nl", "No", "Zs", "Zl", "Zp", "Cc", "Cf", null, "Co", "Cs",
- "Pd", "Ps", "Pe", "Pc", "Po", "Sm", "Sc", "Sk", "So", // 28
- "Pi", "Pf", // 29, 30
- "L", "M", "N", "Z", "C", "P", "S", // 31-37
- };
-
- // Schema Rec. {Datatypes} - Punctuation
- static final int CHAR_INIT_QUOTE = 29; // Pi - initial quote
- static final int CHAR_FINAL_QUOTE = 30; // Pf - final quote
- static final int CHAR_LETTER = 31;
- static final int CHAR_MARK = 32;
- static final int CHAR_NUMBER = 33;
- static final int CHAR_SEPARATOR = 34;
- static final int CHAR_OTHER = 35;
- static final int CHAR_PUNCTUATION = 36;
- static final int CHAR_SYMBOL = 37;
-
- //blockNames in UNICODE 3.1 that supported by XML Schema REC
- private static final String[] blockNames = {
- /*0000..007F;*/ "Basic Latin",
- /*0080..00FF;*/ "Latin-1 Supplement",
- /*0100..017F;*/ "Latin Extended-A",
- /*0180..024F;*/ "Latin Extended-B",
- /*0250..02AF;*/ "IPA Extensions",
- /*02B0..02FF;*/ "Spacing Modifier Letters",
- /*0300..036F;*/ "Combining Diacritical Marks",
- /*0370..03FF;*/ "Greek",
- /*0400..04FF;*/ "Cyrillic",
- /*0530..058F;*/ "Armenian",
- /*0590..05FF;*/ "Hebrew",
- /*0600..06FF;*/ "Arabic",
- /*0700..074F;*/ "Syriac",
- /*0780..07BF;*/ "Thaana",
- /*0900..097F;*/ "Devanagari",
- /*0980..09FF;*/ "Bengali",
- /*0A00..0A7F;*/ "Gurmukhi",
- /*0A80..0AFF;*/ "Gujarati",
- /*0B00..0B7F;*/ "Oriya",
- /*0B80..0BFF;*/ "Tamil",
- /*0C00..0C7F;*/ "Telugu",
- /*0C80..0CFF;*/ "Kannada",
- /*0D00..0D7F;*/ "Malayalam",
- /*0D80..0DFF;*/ "Sinhala",
- /*0E00..0E7F;*/ "Thai",
- /*0E80..0EFF;*/ "Lao",
- /*0F00..0FFF;*/ "Tibetan",
- /*1000..109F;*/ "Myanmar",
- /*10A0..10FF;*/ "Georgian",
- /*1100..11FF;*/ "Hangul Jamo",
- /*1200..137F;*/ "Ethiopic",
- /*13A0..13FF;*/ "Cherokee",
- /*1400..167F;*/ "Unified Canadian Aboriginal Syllabics",
- /*1680..169F;*/ "Ogham",
- /*16A0..16FF;*/ "Runic",
- /*1780..17FF;*/ "Khmer",
- /*1800..18AF;*/ "Mongolian",
- /*1E00..1EFF;*/ "Latin Extended Additional",
- /*1F00..1FFF;*/ "Greek Extended",
- /*2000..206F;*/ "General Punctuation",
- /*2070..209F;*/ "Superscripts and Subscripts",
- /*20A0..20CF;*/ "Currency Symbols",
- /*20D0..20FF;*/ "Combining Marks for Symbols",
- /*2100..214F;*/ "Letterlike Symbols",
- /*2150..218F;*/ "Number Forms",
- /*2190..21FF;*/ "Arrows",
- /*2200..22FF;*/ "Mathematical Operators",
- /*2300..23FF;*/ "Miscellaneous Technical",
- /*2400..243F;*/ "Control Pictures",
- /*2440..245F;*/ "Optical Character Recognition",
- /*2460..24FF;*/ "Enclosed Alphanumerics",
- /*2500..257F;*/ "Box Drawing",
- /*2580..259F;*/ "Block Elements",
- /*25A0..25FF;*/ "Geometric Shapes",
- /*2600..26FF;*/ "Miscellaneous Symbols",
- /*2700..27BF;*/ "Dingbats",
- /*2800..28FF;*/ "Braille Patterns",
- /*2E80..2EFF;*/ "CJK Radicals Supplement",
- /*2F00..2FDF;*/ "Kangxi Radicals",
- /*2FF0..2FFF;*/ "Ideographic Description Characters",
- /*3000..303F;*/ "CJK Symbols and Punctuation",
- /*3040..309F;*/ "Hiragana",
- /*30A0..30FF;*/ "Katakana",
- /*3100..312F;*/ "Bopomofo",
- /*3130..318F;*/ "Hangul Compatibility Jamo",
- /*3190..319F;*/ "Kanbun",
- /*31A0..31BF;*/ "Bopomofo Extended",
- /*3200..32FF;*/ "Enclosed CJK Letters and Months",
- /*3300..33FF;*/ "CJK Compatibility",
- /*3400..4DB5;*/ "CJK Unified Ideographs Extension A",
- /*4E00..9FFF;*/ "CJK Unified Ideographs",
- /*A000..A48F;*/ "Yi Syllables",
- /*A490..A4CF;*/ "Yi Radicals",
- /*AC00..D7A3;*/ "Hangul Syllables",
- /*E000..F8FF;*/ "Private Use",
- /*F900..FAFF;*/ "CJK Compatibility Ideographs",
- /*FB00..FB4F;*/ "Alphabetic Presentation Forms",
- /*FB50..FDFF;*/ "Arabic Presentation Forms-A",
- /*FE20..FE2F;*/ "Combining Half Marks",
- /*FE30..FE4F;*/ "CJK Compatibility Forms",
- /*FE50..FE6F;*/ "Small Form Variants",
- /*FE70..FEFE;*/ "Arabic Presentation Forms-B",
- /*FEFF..FEFF;*/ "Specials",
- /*FF00..FFEF;*/ "Halfwidth and Fullwidth Forms",
- //missing Specials add manually
- /*10300..1032F;*/ "Old Italic", // 84
- /*10330..1034F;*/ "Gothic",
- /*10400..1044F;*/ "Deseret",
- /*1D000..1D0FF;*/ "Byzantine Musical Symbols",
- /*1D100..1D1FF;*/ "Musical Symbols",
- /*1D400..1D7FF;*/ "Mathematical Alphanumeric Symbols",
- /*20000..2A6D6;*/ "CJK Unified Ideographs Extension B",
- /*2F800..2FA1F;*/ "CJK Compatibility Ideographs Supplement",
- /*E0000..E007F;*/ "Tags",
- //missing 2 private use add manually
-
- };
- //ADD THOSE MANUALLY
- //F0000..FFFFD; "Private Use",
- //100000..10FFFD; "Private Use"
- //FFF0..FFFD; "Specials",
- static final String blockRanges =
- "\u0000\u007F\u0080\u00FF\u0100\u017F\u0180\u024F\u0250\u02AF\u02B0\u02FF\u0300\u036F"
- +"\u0370\u03FF\u0400\u04FF\u0530\u058F\u0590\u05FF\u0600\u06FF\u0700\u074F\u0780\u07BF"
- +"\u0900\u097F\u0980\u09FF\u0A00\u0A7F\u0A80\u0AFF\u0B00\u0B7F\u0B80\u0BFF\u0C00\u0C7F\u0C80\u0CFF"
- +"\u0D00\u0D7F\u0D80\u0DFF\u0E00\u0E7F\u0E80\u0EFF\u0F00\u0FFF\u1000\u109F\u10A0\u10FF\u1100\u11FF"
- +"\u1200\u137F\u13A0\u13FF\u1400\u167F\u1680\u169F\u16A0\u16FF\u1780\u17FF\u1800\u18AF\u1E00\u1EFF"
- +"\u1F00\u1FFF\u2000\u206F\u2070\u209F\u20A0\u20CF\u20D0\u20FF\u2100\u214F\u2150\u218F\u2190\u21FF\u2200\u22FF"
- +"\u2300\u23FF\u2400\u243F\u2440\u245F\u2460\u24FF\u2500\u257F\u2580\u259F\u25A0\u25FF\u2600\u26FF\u2700\u27BF"
- +"\u2800\u28FF\u2E80\u2EFF\u2F00\u2FDF\u2FF0\u2FFF\u3000\u303F\u3040\u309F\u30A0\u30FF\u3100\u312F\u3130\u318F"
- +"\u3190\u319F\u31A0\u31BF\u3200\u32FF\u3300\u33FF\u3400\u4DB5\u4E00\u9FFF\uA000\uA48F\uA490\uA4CF"
- +"\uAC00\uD7A3\uE000\uF8FF\uF900\uFAFF\uFB00\uFB4F\uFB50\uFDFF"
- +"\uFE20\uFE2F\uFE30\uFE4F\uFE50\uFE6F\uFE70\uFEFE\uFEFF\uFEFF\uFF00\uFFEF";
- static final int[] nonBMPBlockRanges = {
- 0x10300, 0x1032F, // 84
- 0x10330, 0x1034F,
- 0x10400, 0x1044F,
- 0x1D000, 0x1D0FF,
- 0x1D100, 0x1D1FF,
- 0x1D400, 0x1D7FF,
- 0x20000, 0x2A6D6,
- 0x2F800, 0x2FA1F,
- 0xE0000, 0xE007F
- };
- private static final int NONBMP_BLOCK_START = 84;
-
- static protected RangeToken getRange(String name, boolean positive) {
- if (Token.categories.size() == 0) {
- synchronized (Token.categories) {
- Token[] ranges = new Token[Token.categoryNames.length];
- for (int i = 0; i < ranges.length; i ++) {
- ranges[i] = Token.createRange();
- }
- int type;
- for (int i = 0; i < 0x10000; i ++) {
- type = Character.getType((char)i);
- if (type == Character.START_PUNCTUATION ||
- type == Character.END_PUNCTUATION) {
- //build table of Pi values
- if (i == 0x00AB || i == 0x2018 || i == 0x201B || i == 0x201C ||
- i == 0x201F || i == 0x2039) {
- type = CHAR_INIT_QUOTE;
- }
- //build table of Pf values
- if (i == 0x00BB || i == 0x2019 || i == 0x201D || i == 0x203A ) {
- type = CHAR_FINAL_QUOTE;
- }
- }
- ranges[type].addRange(i, i);
- switch (type) {
- case Character.UPPERCASE_LETTER:
- case Character.LOWERCASE_LETTER:
- case Character.TITLECASE_LETTER:
- case Character.MODIFIER_LETTER:
- case Character.OTHER_LETTER:
- type = CHAR_LETTER;
- break;
- case Character.NON_SPACING_MARK:
- case Character.COMBINING_SPACING_MARK:
- case Character.ENCLOSING_MARK:
- type = CHAR_MARK;
- break;
- case Character.DECIMAL_DIGIT_NUMBER:
- case Character.LETTER_NUMBER:
- case Character.OTHER_NUMBER:
- type = CHAR_NUMBER;
- break;
- case Character.SPACE_SEPARATOR:
- case Character.LINE_SEPARATOR:
- case Character.PARAGRAPH_SEPARATOR:
- type = CHAR_SEPARATOR;
- break;
- case Character.CONTROL:
- case Character.FORMAT:
- case Character.SURROGATE:
- case Character.PRIVATE_USE:
- case Character.UNASSIGNED:
- type = CHAR_OTHER;
- break;
- case Character.CONNECTOR_PUNCTUATION:
- case Character.DASH_PUNCTUATION:
- case Character.START_PUNCTUATION:
- case Character.END_PUNCTUATION:
- case CHAR_INIT_QUOTE:
- case CHAR_FINAL_QUOTE:
- case Character.OTHER_PUNCTUATION:
- type = CHAR_PUNCTUATION;
- break;
- case Character.MATH_SYMBOL:
- case Character.CURRENCY_SYMBOL:
- case Character.MODIFIER_SYMBOL:
- case Character.OTHER_SYMBOL:
- type = CHAR_SYMBOL;
- break;
- default:
- throw new RuntimeException("org.apache.xerces.utils.regex.Token#getRange(): Unknown Unicode category: "+type);
- }
- ranges[type].addRange(i, i);
- } // for all characters
- ranges[Character.UNASSIGNED].addRange(0x10000, Token.UTF16_MAX);
-
- for (int i = 0; i < ranges.length; i ++) {
- if (Token.categoryNames[i] != null) {
- if (i == Character.UNASSIGNED) { // Unassigned
- ranges[i].addRange(0x10000, Token.UTF16_MAX);
- }
- Token.categories.put(Token.categoryNames[i], ranges[i]);
- Token.categories2.put(Token.categoryNames[i],
- Token.complementRanges(ranges[i]));
- }
- }
- //REVISIT: do we really need to support block names as in Unicode 3.1
- // or we can just create all the names in IsBLOCKNAME format (XML Schema REC)?
- //
- StringBuilder buffer = new StringBuilder(50);
- for (int i = 0; i < Token.blockNames.length; i ++) {
- Token r1 = Token.createRange();
- int location;
- if (i < NONBMP_BLOCK_START) {
- location = i*2;
- int rstart = Token.blockRanges.charAt(location);
- int rend = Token.blockRanges.charAt(location+1);
- //DEBUGING
- //System.out.println(n+" " +Integer.toHexString(rstart)
- // +"-"+ Integer.toHexString(rend));
- r1.addRange(rstart, rend);
- } else {
- location = (i - NONBMP_BLOCK_START) * 2;
- r1.addRange(Token.nonBMPBlockRanges[location],
- Token.nonBMPBlockRanges[location + 1]);
- }
- String n = Token.blockNames[i];
- if (n.equals("Specials"))
- r1.addRange(0xfff0, 0xfffd);
- if (n.equals("Private Use")) {
- r1.addRange(0xF0000,0xFFFFD);
- r1.addRange(0x100000,0x10FFFD);
- }
- Token.categories.put(n, r1);
- Token.categories2.put(n, Token.complementRanges(r1));
- buffer.setLength(0);
- buffer.append("Is");
- if (n.indexOf(' ') >= 0) {
- for (int ci = 0; ci < n.length(); ci ++)
- if (n.charAt(ci) != ' ') buffer.append((char)n.charAt(ci));
- }
- else {
- buffer.append(n);
- }
- Token.setAlias(buffer.toString(), n, true);
- }
-
- // TR#18 1.2
- Token.setAlias("ASSIGNED", "Cn", false);
- Token.setAlias("UNASSIGNED", "Cn", true);
- Token all = Token.createRange();
- all.addRange(0, Token.UTF16_MAX);
- Token.categories.put("ALL", all);
- Token.categories2.put("ALL", Token.complementRanges(all));
- Token.registerNonXS("ASSIGNED");
- Token.registerNonXS("UNASSIGNED");
- Token.registerNonXS("ALL");
-
- Token isalpha = Token.createRange();
- isalpha.mergeRanges(ranges[Character.UPPERCASE_LETTER]); // Lu
- isalpha.mergeRanges(ranges[Character.LOWERCASE_LETTER]); // Ll
- isalpha.mergeRanges(ranges[Character.OTHER_LETTER]); // Lo
- Token.categories.put("IsAlpha", isalpha);
- Token.categories2.put("IsAlpha", Token.complementRanges(isalpha));
- Token.registerNonXS("IsAlpha");
-
- Token isalnum = Token.createRange();
- isalnum.mergeRanges(isalpha); // Lu Ll Lo
- isalnum.mergeRanges(ranges[Character.DECIMAL_DIGIT_NUMBER]); // Nd
- Token.categories.put("IsAlnum", isalnum);
- Token.categories2.put("IsAlnum", Token.complementRanges(isalnum));
- Token.registerNonXS("IsAlnum");
-
- Token isspace = Token.createRange();
- isspace.mergeRanges(Token.token_spaces);
- isspace.mergeRanges(ranges[CHAR_SEPARATOR]); // Z
- Token.categories.put("IsSpace", isspace);
- Token.categories2.put("IsSpace", Token.complementRanges(isspace));
- Token.registerNonXS("IsSpace");
-
- Token isword = Token.createRange();
- isword.mergeRanges(isalnum); // Lu Ll Lo Nd
- isword.addRange('_', '_');
- Token.categories.put("IsWord", isword);
- Token.categories2.put("IsWord", Token.complementRanges(isword));
- Token.registerNonXS("IsWord");
-
- Token isascii = Token.createRange();
- isascii.addRange(0, 127);
- Token.categories.put("IsASCII", isascii);
- Token.categories2.put("IsASCII", Token.complementRanges(isascii));
- Token.registerNonXS("IsASCII");
-
- Token isnotgraph = Token.createRange();
- isnotgraph.mergeRanges(ranges[CHAR_OTHER]);
- isnotgraph.addRange(' ', ' ');
- Token.categories.put("IsGraph", Token.complementRanges(isnotgraph));
- Token.categories2.put("IsGraph", isnotgraph);
- Token.registerNonXS("IsGraph");
-
- Token isxdigit = Token.createRange();
- isxdigit.addRange('0', '9');
- isxdigit.addRange('A', 'F');
- isxdigit.addRange('a', 'f');
- Token.categories.put("IsXDigit", Token.complementRanges(isxdigit));
- Token.categories2.put("IsXDigit", isxdigit);
- Token.registerNonXS("IsXDigit");
-
- Token.setAlias("IsDigit", "Nd", true);
- Token.setAlias("IsUpper", "Lu", true);
- Token.setAlias("IsLower", "Ll", true);
- Token.setAlias("IsCntrl", "C", true);
- Token.setAlias("IsPrint", "C", false);
- Token.setAlias("IsPunct", "P", true);
- Token.registerNonXS("IsDigit");
- Token.registerNonXS("IsUpper");
- Token.registerNonXS("IsLower");
- Token.registerNonXS("IsCntrl");
- Token.registerNonXS("IsPrint");
- Token.registerNonXS("IsPunct");
-
- Token.setAlias("alpha", "IsAlpha", true);
- Token.setAlias("alnum", "IsAlnum", true);
- Token.setAlias("ascii", "IsASCII", true);
- Token.setAlias("cntrl", "IsCntrl", true);
- Token.setAlias("digit", "IsDigit", true);
- Token.setAlias("graph", "IsGraph", true);
- Token.setAlias("lower", "IsLower", true);
- Token.setAlias("print", "IsPrint", true);
- Token.setAlias("punct", "IsPunct", true);
- Token.setAlias("space", "IsSpace", true);
- Token.setAlias("upper", "IsUpper", true);
- Token.setAlias("word", "IsWord", true); // Perl extension
- Token.setAlias("xdigit", "IsXDigit", true);
- Token.registerNonXS("alpha");
- Token.registerNonXS("alnum");
- Token.registerNonXS("ascii");
- Token.registerNonXS("cntrl");
- Token.registerNonXS("digit");
- Token.registerNonXS("graph");
- Token.registerNonXS("lower");
- Token.registerNonXS("print");
- Token.registerNonXS("punct");
- Token.registerNonXS("space");
- Token.registerNonXS("upper");
- Token.registerNonXS("word");
- Token.registerNonXS("xdigit");
- } // synchronized
- } // if null
- RangeToken tok = positive ? (RangeToken)Token.categories.get(name)
- : (RangeToken)Token.categories2.get(name);
- //if (tok == null) System.out.println(name);
- return tok;
- }
- static protected RangeToken getRange(String name, boolean positive, boolean xs) {
- RangeToken range = Token.getRange(name, positive);
- if (xs && range != null && Token.isRegisterNonXS(name))
- range = null;
- return range;
- }
-
- static final Set<String> nonxs = Collections.synchronizedSet(new HashSet<>());
- /**
- * This method is called by only getRange().
- * So this method need not MT-safe.
- */
- static protected void registerNonXS(String name) {
- Token.nonxs.add(name);
- }
-
- static protected boolean isRegisterNonXS(String name) {
- return Token.nonxs.contains(name);
- }
-
- private static void setAlias(String newName, String name, boolean positive) {
- Token t1 = (Token)Token.categories.get(name);
- Token t2 = (Token)Token.categories2.get(name);
- if (positive) {
- Token.categories.put(newName, t1);
- Token.categories2.put(newName, t2);
- } else {
- Token.categories2.put(newName, t1);
- Token.categories.put(newName, t2);
- }
- }
-
- // ------------------------------------------------------
-
- static final String viramaString =
- "\u094D"// ;DEVANAGARI SIGN VIRAMA;Mn;9;ON;;;;;N;;;;;
- +"\u09CD"//;BENGALI SIGN VIRAMA;Mn;9;ON;;;;;N;;;;;
- +"\u0A4D"//;GURMUKHI SIGN VIRAMA;Mn;9;ON;;;;;N;;;;;
- +"\u0ACD"//;GUJARATI SIGN VIRAMA;Mn;9;ON;;;;;N;;;;;
- +"\u0B4D"//;ORIYA SIGN VIRAMA;Mn;9;ON;;;;;N;;;;;
- +"\u0BCD"//;TAMIL SIGN VIRAMA;Mn;9;ON;;;;;N;;;;;
- +"\u0C4D"//;TELUGU SIGN VIRAMA;Mn;9;ON;;;;;N;;;;;
- +"\u0CCD"//;KANNADA SIGN VIRAMA;Mn;9;ON;;;;;N;;;;;
- +"\u0D4D"//;MALAYALAM SIGN VIRAMA;Mn;9;ON;;;;;N;;;;;
- +"\u0E3A"//;THAI CHARACTER PHINTHU;Mn;9;ON;;;;;N;THAI VOWEL SIGN PHINTHU;;;;
- +"\u0F84";//;TIBETAN MARK HALANTA;Mn;9;ON;;;;;N;TIBETAN VIRAMA;;;;
-
- static private Token token_grapheme = null;
- static synchronized Token getGraphemePattern() {
- if (Token.token_grapheme != null)
- return Token.token_grapheme;
-
- Token base_char = Token.createRange(); // [{ASSIGNED}]-[{M},{C}]
- base_char.mergeRanges(Token.getRange("ASSIGNED", true));
- base_char.subtractRanges(Token.getRange("M", true));
- base_char.subtractRanges(Token.getRange("C", true));
-
- Token virama = Token.createRange();
- for (int i = 0; i < Token.viramaString.length(); i++) {
- virama.addRange(i, i);
- }
-
- Token combiner_wo_virama = Token.createRange();
- combiner_wo_virama.mergeRanges(Token.getRange("M", true));
- combiner_wo_virama.addRange(0x1160, 0x11ff); // hangul_medial and hangul_final
- combiner_wo_virama.addRange(0xff9e, 0xff9f); // extras
-
- Token left = Token.createUnion(); // base_char?
- left.addChild(base_char);
- left.addChild(Token.token_empty);
-
- Token foo = Token.createUnion();
- foo.addChild(Token.createConcat(virama, Token.getRange("L", true)));
- foo.addChild(combiner_wo_virama);
-
- foo = Token.createClosure(foo);
-
- foo = Token.createConcat(left, foo);
-
- Token.token_grapheme = foo;
- return Token.token_grapheme;
- }
-
- /**
- * Combing Character Sequence in Perl 5.6.
- */
- static private Token token_ccs = null;
- static synchronized Token getCombiningCharacterSequence() {
- if (Token.token_ccs != null)
- return Token.token_ccs;
-
- Token foo = Token.createClosure(Token.getRange("M", true)); // \pM*
- foo = Token.createConcat(Token.getRange("M", false), foo); // \PM + \pM*
- Token.token_ccs = foo;
- return Token.token_ccs;
- }
-
- // ------------------------------------------------------
-
- // ------------------------------------------------------
- /**
- * This class represents a node in parse tree.
- */
- static class StringToken extends Token implements java.io.Serializable {
-
- private static final long serialVersionUID = -4614366944218504172L;
-
- String string;
- final int refNumber;
-
- StringToken(int type, String str, int n) {
- super(type);
- this.string = str;
- this.refNumber = n;
- }
-
- int getReferenceNumber() { // for STRING
- return this.refNumber;
- }
- String getString() { // for STRING
- return this.string;
- }
-
- public String toString(int options) {
- if (this.type == BACKREFERENCE)
- return "\\"+this.refNumber;
- else
- return REUtil.quoteMeta(this.string);
- }
- }
-
- /**
- * This class represents a node in parse tree.
- */
- static class ConcatToken extends Token implements java.io.Serializable {
-
- private static final long serialVersionUID = 8717321425541346381L;
-
- final Token child;
- final Token child2;
-
- ConcatToken(Token t1, Token t2) {
- super(Token.CONCAT);
- this.child = t1;
- this.child2 = t2;
- }
-
- int size() {
- return 2;
- }
- Token getChild(int index) {
- return index == 0 ? this.child : this.child2;
- }
-
- public String toString(int options) {
- String ret;
- if (this.child2.type == CLOSURE && this.child2.getChild(0) == this.child) {
- ret = this.child.toString(options)+"+";
- } else if (this.child2.type == NONGREEDYCLOSURE && this.child2.getChild(0) == this.child) {
- ret = this.child.toString(options)+"+?";
- } else
- ret = this.child.toString(options)+this.child2.toString(options);
- return ret;
- }
- }
-
- /**
- * This class represents a node in parse tree.
- */
- static class CharToken extends Token implements java.io.Serializable {
-
- private static final long serialVersionUID = -4394272816279496989L;
-
- final int chardata;
-
- CharToken(int type, int ch) {
- super(type);
- this.chardata = ch;
- }
-
- int getChar() {
- return this.chardata;
- }
-
- public String toString(int options) {
- String ret;
- switch (this.type) {
- case CHAR:
- switch (this.chardata) {
- case '|': case '*': case '+': case '?':
- case '(': case ')': case '.': case '[':
- case '{': case '\\':
- ret = "\\"+(char)this.chardata;
- break;
- case '\f': ret = "\\f"; break;
- case '\n': ret = "\\n"; break;
- case '\r': ret = "\\r"; break;
- case '\t': ret = "\\t"; break;
- case 0x1b: ret = "\\e"; break;
- //case 0x0b: ret = "\\v"; break;
- default:
- if (this.chardata >= 0x10000) {
- String pre = "0"+Integer.toHexString(this.chardata);
- ret = "\\v"+pre.substring(pre.length()-6, pre.length());
- } else
- ret = ""+(char)this.chardata;
- }
- break;
-
- case ANCHOR:
- if (this == Token.token_linebeginning || this == Token.token_lineend)
- ret = ""+(char)this.chardata;
- else
- ret = "\\"+(char)this.chardata;
- break;
-
- default:
- ret = null;
- }
- return ret;
- }
-
- boolean match(int ch) {
- if (this.type == CHAR) {
- return ch == this.chardata;
- } else
- throw new RuntimeException("NFAArrow#match(): Internal error: "+this.type);
- }
- }
-
- /**
- * This class represents a node in parse tree.
- */
- static class ClosureToken extends Token implements java.io.Serializable {
-
- private static final long serialVersionUID = 1308971930673997452L;
-
- int min;
- int max;
- final Token child;
-
- ClosureToken(int type, Token tok) {
- super(type);
- this.child = tok;
- this.setMin(-1);
- this.setMax(-1);
- }
-
- int size() {
- return 1;
- }
- Token getChild(int index) {
- return this.child;
- }
-
- final void setMin(int min) {
- this.min = min;
- }
- final void setMax(int max) {
- this.max = max;
- }
- final int getMin() {
- return this.min;
- }
- final int getMax() {
- return this.max;
- }
-
- public String toString(int options) {
- String ret;
- if (this.type == CLOSURE) {
- if (this.getMin() < 0 && this.getMax() < 0) {
- ret = this.child.toString(options)+"*";
- } else if (this.getMin() == this.getMax()) {
- ret = this.child.toString(options)+"{"+this.getMin()+"}";
- } else if (this.getMin() >= 0 && this.getMax() >= 0) {
- ret = this.child.toString(options)+"{"+this.getMin()+","+this.getMax()+"}";
- } else if (this.getMin() >= 0 && this.getMax() < 0) {
- ret = this.child.toString(options)+"{"+this.getMin()+",}";
- } else
- throw new RuntimeException("Token#toString(): CLOSURE "
- +this.getMin()+", "+this.getMax());
- } else {
- if (this.getMin() < 0 && this.getMax() < 0) {
- ret = this.child.toString(options)+"*?";
- } else if (this.getMin() == this.getMax()) {
- ret = this.child.toString(options)+"{"+this.getMin()+"}?";
- } else if (this.getMin() >= 0 && this.getMax() >= 0) {
- ret = this.child.toString(options)+"{"+this.getMin()+","+this.getMax()+"}?";
- } else if (this.getMin() >= 0 && this.getMax() < 0) {
- ret = this.child.toString(options)+"{"+this.getMin()+",}?";
- } else
- throw new RuntimeException("Token#toString(): NONGREEDYCLOSURE "
- +this.getMin()+", "+this.getMax());
- }
- return ret;
- }
- }
-
- /**
- * This class represents a node in parse tree.
- */
- static class ParenToken extends Token implements java.io.Serializable {
-
- private static final long serialVersionUID = -5938014719827987704L;
-
- final Token child;
- final int parennumber;
-
- ParenToken(int type, Token tok, int paren) {
- super(type);
- this.child = tok;
- this.parennumber = paren;
- }
-
- int size() {
- return 1;
- }
- Token getChild(int index) {
- return this.child;
- }
-
- int getParenNumber() {
- return this.parennumber;
- }
-
- public String toString(int options) {
- String ret = null;
- switch (this.type) {
- case PAREN:
- if (this.parennumber == 0) {
- ret = "(?:"+this.child.toString(options)+")";
- } else {
- ret = "("+this.child.toString(options)+")";
- }
- break;
-
- case LOOKAHEAD:
- ret = "(?="+this.child.toString(options)+")";
- break;
- case NEGATIVELOOKAHEAD:
- ret = "(?!"+this.child.toString(options)+")";
- break;
- case LOOKBEHIND:
- ret = "(?<="+this.child.toString(options)+")";
- break;
- case NEGATIVELOOKBEHIND:
- ret = "(?<!"+this.child.toString(options)+")";
- break;
- case INDEPENDENT:
- ret = "(?>"+this.child.toString(options)+")";
- break;
- }
- return ret;
- }
- }
-
- /**
- * (?(condition)yes-pattern|no-pattern)
- */
- static class ConditionToken extends Token implements java.io.Serializable {
-
- private static final long serialVersionUID = 4353765277910594411L;
-
- final int refNumber;
- final Token condition;
- final Token yes;
- final Token no;
- ConditionToken(int refno, Token cond, Token yespat, Token nopat) {
- super(Token.CONDITION);
- this.refNumber = refno;
- this.condition = cond;
- this.yes = yespat;
- this.no = nopat;
- }
- int size() {
- return this.no == null ? 1 : 2;
- }
- Token getChild(int index) {
- if (index == 0) return this.yes;
- if (index == 1) return this.no;
- throw new RuntimeException("Internal Error: "+index);
- }
-
- public String toString(int options) {
- String ret;
- if (refNumber > 0) {
- ret = "(?("+refNumber+")";
- } else if (this.condition.type == Token.ANCHOR) {
- ret = "(?("+this.condition+")";
- } else {
- ret = "(?"+this.condition;
- }
-
- if (this.no == null) {
- ret += this.yes+")";
- } else {
- ret += this.yes+"|"+this.no+")";
- }
- return ret;
- }
- }
-
- /**
- * (ims-ims: .... )
- */
- static class ModifierToken extends Token implements java.io.Serializable {
-
- private static final long serialVersionUID = -9114536559696480356L;
-
- final Token child;
- final int add;
- final int mask;
-
- ModifierToken(Token tok, int add, int mask) {
- super(Token.MODIFIERGROUP);
- this.child = tok;
- this.add = add;
- this.mask = mask;
- }
-
- int size() {
- return 1;
- }
- Token getChild(int index) {
- return this.child;
- }
-
- int getOptions() {
- return this.add;
- }
- int getOptionsMask() {
- return this.mask;
- }
-
- public String toString(int options) {
- return "(?"
- +(this.add == 0 ? "" : REUtil.createOptionString(this.add))
- +(this.mask == 0 ? "" : REUtil.createOptionString(this.mask))
- +":"
- +this.child.toString(options)
- +")";
- }
- }
-
- /**
- * This class represents a node in parse tree.
- * for UNION or CONCAT.
- */
- static class UnionToken extends Token implements java.io.Serializable {
-
- private static final long serialVersionUID = -2568843945989489861L;
-
- List<Token> children;
-
- /**
- * @serialField children Vector children
- */
- private static final ObjectStreamField[] serialPersistentFields =
- new ObjectStreamField[] {
- new ObjectStreamField("children", Vector.class),
- };
-
- UnionToken(int type) {
- super(type);
- }
-
- @Override
- void addChild(Token tok) {
- if (tok == null) return;
- if (this.children == null) this.children = new ArrayList<>();
- if (this.type == UNION) {
- this.children.add(tok);
- return;
- }
- // This is CONCAT, and new child is CONCAT.
- if (tok.type == CONCAT) {
- for (int i = 0; i < tok.size(); i ++)
- this.addChild(tok.getChild(i)); // Recursion
- return;
- }
- int size = this.children.size();
- if (size == 0) {
- this.children.add(tok);
- return;
- }
- Token previous = this.children.get(size - 1);
- if (!((previous.type == CHAR || previous.type == STRING)
- && (tok.type == CHAR || tok.type == STRING))) {
- this.children.add(tok);
- return;
- }
-
- //System.err.println("Merge '"+previous+"' and '"+tok+"'.");
-
- StringBuilder buffer;
- int nextMaxLength = (tok.type == CHAR ? 2 : tok.getString().length());
- if (previous.type == CHAR) { // Replace previous token by STRING
- buffer = new StringBuilder(2 + nextMaxLength);
- int ch = previous.getChar();
- if (ch >= 0x10000)
- buffer.append(REUtil.decomposeToSurrogates(ch));
- else
- buffer.append((char)ch);
- previous = Token.createString(null);
- this.children.set(size - 1, previous);
- } else { // STRING
- buffer = new StringBuilder(previous.getString().length() + nextMaxLength);
- buffer.append(previous.getString());
- }
-
- if (tok.type == CHAR) {
- int ch = tok.getChar();
- if (ch >= 0x10000)
- buffer.append(REUtil.decomposeToSurrogates(ch));
- else
- buffer.append((char)ch);
- } else {
- buffer.append(tok.getString());
- }
-
- ((StringToken)previous).string = new String(buffer);
- }
-
- @Override
- int size() {
- return this.children == null ? 0 : this.children.size();
- }
- @Override
- Token getChild(int index) {
- return this.children.get(index);
- }
-
- @Override
- public String toString(int options) {
- String ret;
- if (this.type == CONCAT) {
- if (this.children.size() == 2) {
- Token ch = this.getChild(0);
- Token ch2 = this.getChild(1);
- if (ch2.type == CLOSURE && ch2.getChild(0) == ch) {
- ret = ch.toString(options)+"+";
- } else if (ch2.type == NONGREEDYCLOSURE && ch2.getChild(0) == ch) {
- ret = ch.toString(options)+"+?";
- } else
- ret = ch.toString(options)+ch2.toString(options);
- } else {
- StringBuilder sb = new StringBuilder();
- for (int i = 0; i < this.children.size(); i ++) {
- sb.append(((Token)this.children.get(i)).toString(options));
- }
- ret = new String(sb);
- }
- return ret;
- }
- if (this.children.size() == 2 && this.getChild(1).type == EMPTY) {
- ret = this.getChild(0).toString(options)+"?";
- } else if (this.children.size() == 2
- && this.getChild(0).type == EMPTY) {
- ret = this.getChild(1).toString(options)+"??";
- } else {
- StringBuilder sb = new StringBuilder();
- sb.append((this.children.get(0)).toString(options));
- for (int i = 1; i < this.children.size(); i ++) {
- sb.append((char)'|');
- sb.append((this.children.get(i)).toString(options));
- }
- ret = new String(sb);
- }
- return ret;
- }
-
- /**
- * @serialData Serialized fields. Convert the List to Vector for backward compatibility.
- */
- private void writeObject(ObjectOutputStream out) throws IOException {
- // Convert List to Vector
- Vector<Token> vChildren = (children == null)? null : new Vector<>(children);
-
- // Write serialized fields
- ObjectOutputStream.PutField pf = out.putFields();
- pf.put("children", vChildren);
- out.writeFields();
- }
-
- @SuppressWarnings("unchecked")
- private void readObject(ObjectInputStream in)
- throws IOException, ClassNotFoundException {
- // We have to read serialized fields first.
- ObjectInputStream.GetField gf = in.readFields();
- Vector<Token> vChildren = (Vector<Token>)gf.get("children", null);
-
- //convert Vector back to List
- if (vChildren != null) children = new ArrayList<>(vChildren);
- }
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message.properties b/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message.properties
deleted file mode 100644
index 01f475b..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message.properties
+++ /dev/null
@@ -1,41 +0,0 @@
-parser.parse.1=Wrong character.
-parser.parse.2=Invalid reference number.
-parser.next.1=A character is required after \\.
-parser.next.2='?' is not expected. '(?:' or '(?=' or '(?!' or '(?<' or '(?#' or '(?>'?
-parser.next.3='(?<=' or '(?<!' is expected.
-parser.next.4=A comment is not terminated.
-parser.factor.1=')' is expected.
-parser.factor.2=Unexpected end of the pattern in a modifier group.
-parser.factor.3=':' is expected.
-parser.factor.4=Unexpected end of the pattern in a conditional group.
-parser.factor.5=A back reference or an anchor or a lookahead or a lookbehind is expected in a conditional pattern.
-parser.factor.6=There are more than three choices in a conditional group.
-parser.atom.1=A character in U+0040-U+005f must follow \\c.
-parser.atom.2=A '{' is required before a character category.
-parser.atom.3=A property name is not closed by '}'.
-parser.atom.4=Unexpected meta character.
-parser.atom.5=Unknown property.
-parser.cc.1=A POSIX character class must be closed by ':]'.
-parser.cc.2=Unexpected end of the pattern in a character class.
-parser.cc.3=Unknown name for a POSIX character class.
-parser.cc.4='-' is invalid here.
-parser.cc.5=']' is expected.
-parser.cc.6='[' is invalid in a character class. Write '\\['.
-parser.cc.7=']' is invalid in a character class. Write '\\]'.
-parser.cc.8='-' is an invalid character range. Write '\\-'.
-parser.ope.1='[' is expected.
-parser.ope.2=')' or '-[' or '+[' or '&[' is expected.
-parser.ope.3=The range end code point is less than the start code point.
-parser.descape.1=Invalid Unicode hex notation.
-parser.descape.2=Overflow in a hex notation.
-parser.descape.3='\\x{' must be closed by '}'.
-parser.descape.4=Invalid Unicode code point.
-parser.descape.5=An anchor must not be here.
-parser.process.1=This expression is not supported in the current option setting.
-parser.quantifier.1=Invalid quantifier. A digit is expected.
-parser.quantifier.2=Invalid quantifier. Invalid quantity or a '}' is missing.
-parser.quantifier.3=Invalid quantifier. A digit or '}' is expected.
-parser.quantifier.4=Invalid quantifier. A min quantity must be <= a max quantity.
-parser.quantifier.5=Invalid quantifier. A quantity value overflow.
-null
-null
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_de.properties b/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_de.properties
deleted file mode 100644
index aab4898..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_de.properties
+++ /dev/null
@@ -1,41 +0,0 @@
-parser.parse.1=Falsches Zeichen.
-parser.parse.2=Ung\u00FCltige Referenznummer.
-parser.next.1=Nach \\ ist ein Zeichen erforderlich.
-parser.next.2='?' wird nicht erwartet. '(?:' oder '(?=' oder '(?!' oder '(?<' oder '(?#' oder '(?>'?
-parser.next.3='(?<=' oder '(?<!' wird erwartet.
-parser.next.4=Ein Kommentar ist nicht abgeschlossen.
-parser.factor.1=')' wird erwartet.
-parser.factor.2=Unerwartetes Ende des Musters in einer Modifier-Gruppe.
-parser.factor.3=':' wird erwartet.
-parser.factor.4=Unerwartetes Ende des Musters in einer Bedingungsgruppe.
-parser.factor.5=Eine Back-Referenz, ein Anker, ein Lookahead oder ein Lookbehind wird in einem Bedingungsmuster erwartet
-parser.factor.6=Es gibt mehr als drei Auswahlm\u00F6glichkeiten in einer Bedingungsgruppe.
-parser.atom.1=Ein Zeichen in U+0040-U+005f muss auf \\c folgen.
-parser.atom.2=Ein '{' ist vor einer Zeichenkategorie erforderlich.
-parser.atom.3=Ein Eigenschaftsname nicht wird durch '}' abgeschlossen.
-parser.atom.4=Unerwartetes Metazeichen.
-parser.atom.5=Unbekannte Eigenschaft.
-parser.cc.1=Eine POSIX-Zeichenklasse muss durch ':]' abgeschlossen werden.
-parser.cc.2=Unerwartetes Ende des Musters in einer Zeichenklasse.
-parser.cc.3=Unbekannter Name f\u00FCr eine POSIX-Zeichenklasse.
-parser.cc.4='-' ist hier ung\u00FCltig.
-parser.cc.5=']' wird erwartet.
-parser.cc.6='[' ist in einer Zeichenklasse ung\u00FCltig. Schreiben Sie '\\['.
-parser.cc.7=']' ist in einer Zeichenklasse ung\u00FCltig. Schreiben Sie '\\]'.
-parser.cc.8='-' ist ein ung\u00FCltiger Zeichenbereich. Schreiben Sie '\\-'.
-parser.ope.1='[' wird erwartet.
-parser.ope.2=')' oder '-[' oder '+[' oder '&[' wird erwartet.
-parser.ope.3=Der Endcodepunkt des Bereichs ist kleiner als der Startcodepunkt.
-parser.descape.1=Ung\u00FCltige Unicode-Hex-Notation.
-parser.descape.2=\u00DCberlauf in einer Hex-Notation.
-parser.descape.3='\\x{' muss durch '}' abgeschlossen werden.
-parser.descape.4=Ung\u00FCltiger Unicode-Codepunkt.
-parser.descape.5=Ein Anker darf nicht hier sein.
-parser.process.1=Dieser Ausdruck wird in der aktuellen Optionseinstellung nicht unterst\u00FCtzt.
-parser.quantifier.1=Ung\u00FCltiger Quantifizierer. Eine Ziffer wird erwartet.
-parser.quantifier.2=Ung\u00FCltiger Quantifizierer. Ung\u00FCltige Menge, oder ein '}' fehlt.
-parser.quantifier.3=Ung\u00FCltiger Quantifizierer. Eine Stelle oder '}' wird erwartet.
-parser.quantifier.4=Ung\u00FCltiger Quantifizierer. Mindestmenge muss <= Maximalmenge sein.
-parser.quantifier.5=Ung\u00FCltiger Quantifizierer. Ein Mengenwert\u00FCberlauf.
-null
-null
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_es.properties b/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_es.properties
deleted file mode 100644
index bb6e6bb..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_es.properties
+++ /dev/null
@@ -1,41 +0,0 @@
-parser.parse.1=Car\u00E1cter incorrecto.
-parser.parse.2=N\u00FAmero de referencia no v\u00E1lido.
-parser.next.1=Es necesario un car\u00E1cter despu\u00E9s de \\.
-parser.next.2=No se esperaba '?'. '(?:', '(?=', '(?!', '(?<', '(?#' o '(?>'?
-parser.next.3=Se esperaba '(?<=' o '(?<!'.
-parser.next.4=Un comentario no est\u00E1 terminado.
-parser.factor.1=Se esperaba ')'.
-parser.factor.2=Fin inesperado del patr\u00F3n en un grupo de modificadores.
-parser.factor.3=Se esperaba ':'.
-parser.factor.4=Fin inesperado del patr\u00F3n en un grupo condicional.
-parser.factor.5=Se esperaba una referencia hacia atr\u00E1s, anclaje, lookahead o lookbehind en un patr\u00F3n condicional.
-parser.factor.6=Hay m\u00E1s de tres opciones en un grupo condicional.
-parser.atom.1=Un car\u00E1cter en U+0040-U+005f debe seguir a \\c.
-parser.atom.2=Se necesita '{' antes de una categor\u00EDa de car\u00E1cter.
-parser.atom.3=Un nombre de propiedad no est\u00E1 cerrado por '}'.
-parser.atom.4=Metacar\u00E1cter inesperado.
-parser.atom.5=Propiedad desconocida.
-parser.cc.1=Una clase de car\u00E1cter POSIX debe estar cerrada por ':]'.
-parser.cc.2=Fin inesperado del patr\u00F3n en una clase de car\u00E1cter.
-parser.cc.3=Nombre desconocido para una clase de car\u00E1cter POSIX.
-parser.cc.4='-' no es v\u00E1lido aqu\u00ED.
-parser.cc.5=Se esperaba ']'.
-parser.cc.6='[' no es v\u00E1lido en una clase de car\u00E1cter. Escriba '\\['.
-parser.cc.7=']' no es v\u00E1lido en una clase de car\u00E1cter. Escriba '\\]'.
-parser.cc.8='-' no es un rango de caracteres v\u00E1lido. Escriba '\\-'.
-parser.ope.1=Se esperaba '['.
-parser.ope.2=Se esperaba ')', '-[', '+[' o '&['.
-parser.ope.3=El punto de c\u00F3digo de fin de rango es menor que el punto de c\u00F3digo de inicio.
-parser.descape.1=Notaci\u00F3n hexadecimal Unicode no v\u00E1lida.
-parser.descape.2=Desbordamiento en una notaci\u00F3n hexadecimal.
-parser.descape.3='\\x{' debe estar cerrado por '}'.
-parser.descape.4=Punto de c\u00F3digo Unicode no v\u00E1lido.
-parser.descape.5=No debe haber un anclaje aqu\u00ED.
-parser.process.1=Esta expresi\u00F3n no est\u00E1 soportada en la configuraci\u00F3n de la opci\u00F3n actual.
-parser.quantifier.1=Cuantificador no v\u00E1lido. Se esperaba un d\u00EDgito.
-parser.quantifier.2=Cuantificador no v\u00E1lido. La cantidad no es v\u00E1lida o falta '}'.
-parser.quantifier.3=Cuantificador no v\u00E1lido. Se esperaba un d\u00EDgito o '}'.
-parser.quantifier.4=Cuantificador no v\u00E1lido. Una cantidad m\u00EDnima debe ser <= una cantidad m\u00E1xima.
-parser.quantifier.5=Cuantificador no v\u00E1lido. Desbordamiento de un valor de cantidad.
-null
-null
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_fr.properties b/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_fr.properties
deleted file mode 100644
index e2779fe..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_fr.properties
+++ /dev/null
@@ -1,41 +0,0 @@
-parser.parse.1=Caract\u00E8re incorrect.
-parser.parse.2=Num\u00E9ro de r\u00E9f\u00E9rence non valide.
-parser.next.1=Un caract\u00E8re est obligatoire apr\u00E8s \\.
-parser.next.2='?' n'est pas attendu. '(?:' ou '(?=' ou '(?!' ou '(?<' ou '(?#' ou '(?>'?
-parser.next.3='(?<=' ou '(?<!' est attendu.
-parser.next.4=Un commentaire n'est pas termin\u00E9.
-parser.factor.1=')' est attendu.
-parser.factor.2=Fin de mod\u00E8le inattendue dans un groupe de modificateur.
-parser.factor.3=':' est attendu.
-parser.factor.4=Fin de mod\u00E8le inattendue dans un groupe conditionnel
-parser.factor.5=Une r\u00E9f\u00E9rence auxiliaire (back reference), un ancrage, une recherche vers l'avant ou une recherche vers l'arri\u00E8re est attendu dans un mod\u00E8le conditionnel.
-parser.factor.6=Il existe plus de trois choix dans un groupe conditionnel.
-parser.atom.1=Un caract\u00E8re compris entre U+0040-U+005f doit suivre \\c.
-parser.atom.2=Une accolade ('{') est obligatoire avant une cat\u00E9gorie de caract\u00E8res.
-parser.atom.3=Un nom de propri\u00E9t\u00E9 n'est pas ferm\u00E9 par une accolade ('}').
-parser.atom.4=M\u00E9tacaract\u00E8re inattendu
-parser.atom.5=Propri\u00E9t\u00E9 inconnue.
-parser.cc.1=Une classe de caract\u00E8res POSIX doit \u00EAtre ferm\u00E9e par ':]'.
-parser.cc.2=Fin de mod\u00E8le inattendue dans une classe de caract\u00E8res.
-parser.cc.3=Nom inconnu pour une classe de caract\u00E8res POSIX.
-parser.cc.4='-' n'est pas valide ici.
-parser.cc.5=']' est attendu.
-parser.cc.6='[' n'est pas valide dans une classe de caract\u00E8res. Ecrivez '\\['.
-parser.cc.7=']' n'est pas valide dans une classe de caract\u00E8res. Ecrivez '\\]'.
-parser.cc.8='-' est une plage de caract\u00E8res non valide. Ecrivez '\\-'.
-parser.ope.1='[' est attendu.
-parser.ope.2=')' ou '-[' ou '+[' ou '&[' est attendu.
-parser.ope.3=Le point code de fin de la plage est inf\u00E9rieur au point code de d\u00E9but.
-parser.descape.1=Notation hexad\u00E9cimale Unicode non valide.
-parser.descape.2=D\u00E9bordement de capacit\u00E9 d'une notation hexad\u00E9cimale.
-parser.descape.3='\\x{' doit \u00EAtre ferm\u00E9 par '}'.
-parser.descape.4=Point code Unicode non valide.
-parser.descape.5=Aucun point d'ancrage ne doit se trouver ici.
-parser.process.1=Cette expression n'est pas prise en charge dans le param\u00E8tre d'option en cours.
-parser.quantifier.1=Quantificateur non valide. Un chiffre est attendu.
-parser.quantifier.2=Quantificateur non valide. Quantit\u00E9 non valide ou accolade ('}') manquante.
-parser.quantifier.3=Quantificateur non valide. Un chiffre ou une accolade ('}') est attendu.
-parser.quantifier.4=Quantificateur non valide. Une quantit\u00E9 minimale doit \u00EAtre <= une quantit\u00E9 maximale.
-parser.quantifier.5=Quantificateur non valide. D\u00E9bordement de la valeur de quantit\u00E9.
-null
-null
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_it.properties b/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_it.properties
deleted file mode 100644
index 18df52e..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_it.properties
+++ /dev/null
@@ -1,41 +0,0 @@
-parser.parse.1=Carattere errato.
-parser.parse.2=Numero di riferimento non valido.
-parser.next.1=\u00C8 necessario un carattere dopo \\.
-parser.next.2='?' non previsto. '(?:' o '(?=' o '(?!' o '(?<' o '(?#' o '(?>'?
-parser.next.3='(?<=' o '(?<!' previsto.
-parser.next.4=Un commento non \u00E8 terminato.
-parser.factor.1=\u00E8 previsto ')'.
-parser.factor.2=Fine del pattern imprevista in un gruppo modificatore.
-parser.factor.3=\u00E8 previsto ':'.
-parser.factor.4=Fine del pattern imprevista in un gruppo condizionale.
-parser.factor.5=In un pattern condizionale \u00E8 previsto un riferimento all'indietro, un ancoraggio, un lookahead o un lookbehind.
-parser.factor.6=In un gruppo condizionale sono disponibili pi\u00F9 di tre scelte.
-parser.atom.1=Un carattere in U+0040-U+005f deve seguire \\c.
-parser.atom.2=Un '{' \u00E8 necessario prima di una categoria di carattere.
-parser.atom.3=Un nome di propriet\u00E0 non \u00E8 chiuso da '}'.
-parser.atom.4=Metacarattere imprevisto.
-parser.atom.5=Propriet\u00E0 sconosciuta.
-parser.cc.1=Una classe caratteri POSIX deve essere chiusa da ':]'.
-parser.cc.2=Fine imprevista del pattern in una classe caratteri.
-parser.cc.3=Nome sconosciuto per una classe caratteri POSIX.
-parser.cc.4='-' non \u00E8 valido qui.
-parser.cc.5=\u00E8 previsto ']'.
-parser.cc.6='[' non \u00E8 valido in una classe caratteri. Scrivere '\\['.
-parser.cc.7=']' non \u00E8 valido in una classe caratteri. Scrivere '\\]'.
-parser.cc.8='-' \u00E8 un intervallo di caratteri non valido. Scrivere '\\-'.
-parser.ope.1=\u00E8 previsto '['.
-parser.ope.2=\u00E8 previsto ')' o '-[' o '+[' o '&['.
-parser.ope.3=Il punto di codice finale dell'intervallo \u00E8 minore del punto di codice iniziale.
-parser.descape.1=Notazione esadecimale Unicode non valida.
-parser.descape.2=Overflow in una notazione esadecimale.
-parser.descape.3='\\x{' deve essere chiuso da '}'.
-parser.descape.4=Punto di codice Unicode non valido.
-parser.descape.5=Un ancoraggio non deve essere posizionato qui.
-parser.process.1=Questa espressione non \u00E8 supportata nell'impostazione dell'opzione corrente.
-parser.quantifier.1=Quantificatore non valido. \u00C8 prevista una cifra.
-parser.quantifier.2=Quantificatore non valido. Quantit\u00E0 non valida o '}' mancante.
-parser.quantifier.3=Quantificatore non valido. \u00C8 prevista una cifra o '}'.
-parser.quantifier.4=Quantificatore non valido.Una quantit\u00E0 minima deve essere <= di una quantit\u00E0 massima.
-parser.quantifier.5=Quantificatore non valido. Overflow del valore di quantit\u00E0.
-null
-null
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_ja.properties b/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_ja.properties
deleted file mode 100644
index 79d155b..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_ja.properties
+++ /dev/null
@@ -1,41 +0,0 @@
-parser.parse.1=\u6587\u5B57\u304C\u9055\u3063\u3066\u3044\u307E\u3059\u3002
-parser.parse.2=\u7121\u52B9\u306A\u53C2\u7167\u756A\u53F7\u3067\u3059\u3002
-parser.next.1=\\\u306E\u5F8C\u306B\u6587\u5B57\u304C\u5FC5\u8981\u3067\u3059\u3002
-parser.next.2='?'\u306F\u60F3\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002'(?:'\u3001'(?='\u3001'(?!'\u3001'(?<'\u3001'(?#'\u307E\u305F\u306F'(?>'\u3067\u3059\u304B\u3002
-parser.next.3='(?<='\u307E\u305F\u306F'(?<!'\u304C\u5FC5\u8981\u3067\u3059\u3002
-parser.next.4=\u30B3\u30E1\u30F3\u30C8\u304C\u7D42\u4E86\u3057\u3066\u3044\u307E\u305B\u3093\u3002
-parser.factor.1=')'\u304C\u5FC5\u8981\u3067\u3059\u3002
-parser.factor.2=\u4FEE\u98FE\u5B50\u30B0\u30EB\u30FC\u30D7\u306E\u30D1\u30BF\u30FC\u30F3\u304C\u4E88\u671F\u305B\u305A\u7D42\u4E86\u3057\u307E\u3057\u305F\u3002
-parser.factor.3=':'\u304C\u5FC5\u8981\u3067\u3059\u3002
-parser.factor.4=\u6761\u4EF6\u30B0\u30EB\u30FC\u30D7\u306E\u30D1\u30BF\u30FC\u30F3\u304C\u4E88\u671F\u305B\u305A\u7D42\u4E86\u3057\u307E\u3057\u305F\u3002
-parser.factor.5=\u6761\u4EF6\u30D1\u30BF\u30FC\u30F3\u306B\u5F8C\u65B9\u53C2\u7167\u3001\u30A2\u30F3\u30AB\u30FC\u3001\u5148\u8AAD\u307F\u307E\u305F\u306F\u5F8C\u8AAD\u307F\u304C\u5FC5\u8981\u3067\u3059\u3002
-parser.factor.6=\u6761\u4EF6\u30B0\u30EB\u30FC\u30D7\u306B3\u500B\u8D85\u306E\u9078\u629E\u80A2\u304C\u3042\u308A\u307E\u3059\u3002
-parser.atom.1=\\c\u306E\u5F8C\u306BU+0040\u304B\u3089U+005f\u307E\u3067\u306E\u6587\u5B57\u304C\u5FC5\u8981\u3067\u3059\u3002
-parser.atom.2=\u6587\u5B57\u30AB\u30C6\u30B4\u30EA\u306E\u524D\u306B'{'\u304C\u5FC5\u8981\u3067\u3059\u3002
-parser.atom.3=\u30D7\u30ED\u30D1\u30C6\u30A3\u540D\u304C'}'\u3067\u9589\u3058\u3089\u308C\u3066\u3044\u307E\u305B\u3093\u3002
-parser.atom.4=\u4E88\u671F\u3057\u306A\u3044\u30E1\u30BF\u6587\u5B57\u3067\u3059\u3002
-parser.atom.5=\u4E0D\u660E\u306A\u30D7\u30ED\u30D1\u30C6\u30A3\u3067\u3059\u3002
-parser.cc.1=POSIX\u6587\u5B57\u30AF\u30E9\u30B9\u306F':]'\u3067\u9589\u3058\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
-parser.cc.2=\u6587\u5B57\u30AF\u30E9\u30B9\u306E\u30D1\u30BF\u30FC\u30F3\u304C\u4E88\u671F\u305B\u305A\u7D42\u4E86\u3057\u307E\u3057\u305F\u3002
-parser.cc.3=POSIX\u6587\u5B57\u30AF\u30E9\u30B9\u306B\u5BFE\u3059\u308B\u540D\u524D\u304C\u4E0D\u660E\u3067\u3059\u3002
-parser.cc.4='-'\u306F\u3053\u3053\u3067\u306F\u7121\u52B9\u3067\u3059\u3002
-parser.cc.5=']'\u304C\u5FC5\u8981\u3067\u3059\u3002
-parser.cc.6='['\u306F\u6587\u5B57\u30AF\u30E9\u30B9\u3067\u7121\u52B9\u3067\u3059\u3002'\\['\u3092\u8A18\u8FF0\u3057\u307E\u3059\u3002
-parser.cc.7=']'\u306F\u6587\u5B57\u30AF\u30E9\u30B9\u3067\u7121\u52B9\u3067\u3059\u3002'\\]'\u3092\u8A18\u8FF0\u3057\u307E\u3059\u3002
-parser.cc.8='-'\u306F\u7121\u52B9\u306A\u6587\u5B57\u7BC4\u56F2\u3067\u3059\u3002'\\-'\u3092\u8A18\u8FF0\u3057\u307E\u3059\u3002
-parser.ope.1='['\u304C\u5FC5\u8981\u3067\u3059\u3002
-parser.ope.2=')'\u3001'-['\u3001'+['\u307E\u305F\u306F'&['\u304C\u5FC5\u8981\u3067\u3059\u3002
-parser.ope.3=\u7BC4\u56F2\u306E\u7D42\u4E86\u30B3\u30FC\u30C9\u30FB\u30DD\u30A4\u30F3\u30C8\u304C\u958B\u59CB\u30B3\u30FC\u30C9\u30FB\u30DD\u30A4\u30F3\u30C8\u3088\u308A\u5C0F\u3055\u3044\u3067\u3059\u3002
-parser.descape.1=\u7121\u52B9\u306AUnicode16\u9032\u6CD5\u3067\u3059\u3002
-parser.descape.2=16\u9032\u6CD5\u3067\u30AA\u30FC\u30D0\u30FC\u30D5\u30ED\u30FC\u3057\u3066\u3044\u307E\u3059\u3002
-parser.descape.3='\\x{'\u306F'}'\u3067\u9589\u3058\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
-parser.descape.4=\u7121\u52B9\u306AUnicode\u30B3\u30FC\u30C9\u30FB\u30DD\u30A4\u30F3\u30C8\u3067\u3059\u3002
-parser.descape.5=\u30A2\u30F3\u30AB\u30FC\u306F\u3053\u3053\u3067\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\u3002
-parser.process.1=\u3053\u306E\u5F0F\u306F\u3001\u73FE\u5728\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u8A2D\u5B9A\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
-parser.quantifier.1=\u7121\u52B9\u306A\u6570\u91CF\u8A5E\u3067\u3059\u3002\u6570\u5B57\u304C\u5FC5\u8981\u3067\u3059\u3002
-parser.quantifier.2=\u7121\u52B9\u306A\u6570\u91CF\u8A5E\u3067\u3059\u3002'}'\u304C\u3042\u308A\u307E\u305B\u3093\u3002
-parser.quantifier.3=\u7121\u52B9\u306A\u6570\u91CF\u8A5E\u3067\u3059\u3002\u6570\u5B57\u307E\u305F\u306F'}'\u304C\u5FC5\u8981\u3067\u3059\u3002
-parser.quantifier.4=\u7121\u52B9\u306A\u6570\u91CF\u8A5E\u3067\u3059\u3002\u6700\u5C0F\u6570\u91CF\u306F\u6700\u5927\u6570\u91CF\u4EE5\u4E0B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
-parser.quantifier.5=\u7121\u52B9\u306A\u6570\u91CF\u8A5E\u3067\u3059\u3002\u6570\u91CF\u5024\u304C\u30AA\u30FC\u30D0\u30FC\u30D5\u30ED\u30FC\u3057\u3066\u3044\u307E\u3059\u3002
-null
-null
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_ko.properties b/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_ko.properties
deleted file mode 100644
index 98cf4fc..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_ko.properties
+++ /dev/null
@@ -1,41 +0,0 @@
-parser.parse.1=\uC798\uBABB\uB41C \uBB38\uC790\uC785\uB2C8\uB2E4.
-parser.parse.2=\uBD80\uC801\uD569\uD55C \uCC38\uC870 \uBC88\uD638\uC785\uB2C8\uB2E4.
-parser.next.1=\\ \uB4A4\uC5D0 \uBB38\uC790\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4.
-parser.next.2='?'\uB294 \uD544\uC694\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. '(?:' \uB610\uB294 '(?=' \uB610\uB294 '(?!' \uB610\uB294 '(?<' \uB610\uB294 '(?#' \uB610\uB294 '(?>'?
-parser.next.3='(?<=' \uB610\uB294 '(?<!'\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4.
-parser.next.4=\uC124\uBA85\uC774 \uC885\uB8CC\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4.
-parser.factor.1=')'\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4.
-parser.factor.2=\uC218\uC815\uC790 \uADF8\uB8F9\uC5D0 \uC608\uC0C1\uCE58 \uC54A\uC740 \uD328\uD134 \uB05D\uC774 \uC788\uC2B5\uB2C8\uB2E4.
-parser.factor.3=':'\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.
-parser.factor.4=\uC870\uAC74 \uADF8\uB8F9\uC5D0 \uC608\uC0C1\uCE58 \uC54A\uC740 \uD328\uD134 \uB05D\uC774 \uC788\uC2B5\uB2C8\uB2E4.
-parser.factor.5=\uC870\uAC74 \uD328\uD134\uC5D0 \uC5ED\uCC38\uC870 \uB610\uB294 \uC575\uCEE4 \uB610\uB294 lookahead \uB610\uB294 lookbehind\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4.
-parser.factor.6=\uC870\uAC74 \uADF8\uB8F9\uC5D0 4\uAC1C \uC774\uC0C1\uC758 \uC120\uD0DD \uD56D\uBAA9\uC774 \uC788\uC2B5\uB2C8\uB2E4.
-parser.atom.1=U+0040-U+005f\uC758 \uBB38\uC790\uAC00 \\c \uB4A4\uC5D0 \uC640\uC57C \uD569\uB2C8\uB2E4.
-parser.atom.2=\uBB38\uC790 \uBC94\uC8FC \uC55E\uC5D0 '{'\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4.
-parser.atom.3=\uC18D\uC131 \uC774\uB984\uC774 '}'\uB85C \uB2EB\uD788\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4.
-parser.atom.4=\uC608\uC0C1\uCE58 \uC54A\uC740 \uBA54\uD0C0 \uBB38\uC790\uC785\uB2C8\uB2E4.
-parser.atom.5=\uC54C \uC218 \uC5C6\uB294 \uC18D\uC131\uC785\uB2C8\uB2E4.
-parser.cc.1=POSIX \uBB38\uC790 \uD074\uB798\uC2A4\uB97C ':]'\uB85C \uB2EB\uC544\uC57C \uD569\uB2C8\uB2E4.
-parser.cc.2=\uBB38\uC790 \uD074\uB798\uC2A4\uC5D0 \uC608\uC0C1\uCE58 \uC54A\uC740 \uD328\uD134 \uB05D\uC774 \uC788\uC2B5\uB2C8\uB2E4.
-parser.cc.3=POSIX \uBB38\uC790 \uD074\uB798\uC2A4\uC5D0 \uB300\uD574 \uC54C \uC218 \uC5C6\uB294 \uC774\uB984\uC785\uB2C8\uB2E4.
-parser.cc.4='-'\uB294 \uC5EC\uAE30\uC11C \uBD80\uC801\uD569\uD569\uB2C8\uB2E4.
-parser.cc.5=']'\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4.
-parser.cc.6=\uBB38\uC790 \uD074\uB798\uC2A4\uC5D0\uC11C '['\uAC00 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. '\\['\uB97C \uC4F0\uC2ED\uC2DC\uC624.
-parser.cc.7=\uBB38\uC790 \uD074\uB798\uC2A4\uC5D0\uC11C ']'\uAC00 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. '\\]'\uB97C \uC4F0\uC2ED\uC2DC\uC624.
-parser.cc.8='-'\uC740 \uBD80\uC801\uD569\uD55C \uBB38\uC790 \uBC94\uC704\uC785\uB2C8\uB2E4. '\\-'\uC744 \uC4F0\uC2ED\uC2DC\uC624.
-parser.ope.1='['\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4.
-parser.ope.2=')' \uB610\uB294 '-[' \uB610\uB294 '+[' \uB610\uB294 '&['\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4.
-parser.ope.3=\uBC94\uC704 \uB05D \uCF54\uB4DC \uD3EC\uC778\uD2B8\uAC00 \uC2DC\uC791 \uCF54\uB4DC \uD3EC\uC778\uD2B8\uBCF4\uB2E4 \uC791\uC2B5\uB2C8\uB2E4.
-parser.descape.1=\uBD80\uC801\uD569\uD55C \uC720\uB2C8\uCF54\uB4DC 16\uC9C4\uC218 \uD45C\uAE30\uBC95\uC785\uB2C8\uB2E4.
-parser.descape.2=16\uC9C4\uC218 \uD45C\uAE30\uBC95\uC758 \uC624\uBC84\uD50C\uB85C\uC6B0\uC785\uB2C8\uB2E4.
-parser.descape.3='\\x{'\uB294 '}'\uB85C \uB2EB\uC544\uC57C \uD569\uB2C8\uB2E4.
-parser.descape.4=\uBD80\uC801\uD569\uD55C \uC720\uB2C8\uCF54\uB4DC \uCF54\uB4DC \uD3EC\uC778\uD2B8\uC785\uB2C8\uB2E4.
-parser.descape.5=\uC575\uCEE4\uAC00 \uC5EC\uAE30\uC5D0 \uC788\uC73C\uBA74 \uC548\uB429\uB2C8\uB2E4.
-parser.process.1=\uC774 \uD45C\uD604\uC2DD\uC740 \uD604\uC7AC \uC635\uC158 \uC124\uC815\uC5D0\uC11C \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
-parser.quantifier.1=\uC218\uB7C9\uC0AC\uAC00 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. \uC22B\uC790\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4.
-parser.quantifier.2=\uC218\uB7C9\uC0AC\uAC00 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. \uC218\uB7C9\uC774 \uBD80\uC801\uD569\uD558\uAC70\uB098 '}'\uAC00 \uB204\uB77D\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
-parser.quantifier.3=\uC218\uB7C9\uC0AC\uAC00 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. \uC22B\uC790\uB098 '}'\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4.
-parser.quantifier.4=\uC218\uB7C9\uC0AC\uAC00 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. \uCD5C\uC18C \uC218\uB7C9\uC740 \uCD5C\uB300 \uC218\uB7C9 \uC774\uD558\uC5EC\uC57C \uD569\uB2C8\uB2E4.
-parser.quantifier.5=\uC218\uB7C9\uC0AC\uAC00 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. \uC218\uB7C9 \uAC12 \uC624\uBC84\uD50C\uB85C\uC6B0\uC785\uB2C8\uB2E4.
-null
-null
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_pt_BR.properties b/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_pt_BR.properties
deleted file mode 100644
index 7c4bf9f..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_pt_BR.properties
+++ /dev/null
@@ -1,41 +0,0 @@
-parser.parse.1=Caractere incorreto.
-parser.parse.2=N\u00FAmero de refer\u00EAncia inv\u00E1lido.
-parser.next.1=\u00C9 obrigat\u00F3rio um caractere ap\u00F3s \\.
-parser.next.2='?' n\u00E3o \u00E9 esperado. '(?:' ou '(?=' ou '(?!' ou '(?<' ou '(?#' ou '(?>'?
-parser.next.3='(?<=' ou '(?<!' \u00E9 esperado.
-parser.next.4=Um coment\u00E1rio n\u00E3o foi finalizado.
-parser.factor.1=')' \u00E9 esperado.
-parser.factor.2=Fim inesperado do padr\u00E3o em um grupo de modificadores.
-parser.factor.3=':' \u00E9 esperado.
-parser.factor.4=Fim inesperado do padr\u00E3o em um grupo condicional.
-parser.factor.5=Em um padr\u00E3o condicional, esperava-se uma refer\u00EAncia retroativa, \u00E2ncora, lookahead ou lookbehind.
-parser.factor.6=H\u00E1 mais de tr\u00EAs op\u00E7\u00F5es em um grupo condicional.
-parser.atom.1=Um caractere em U+0040-U+005f vir ap\u00F3s \\c.
-parser.atom.2=Um '{' \u00E9 obrigat\u00F3rio antes de uma categoria de caractere.
-parser.atom.3=Um nome de propriedade n\u00E3o foi fechado por '}'.
-parser.atom.4=Metacaractere inesperado.
-parser.atom.5=Propriedade desconhecida.
-parser.cc.1=Uma classe de caractere POSIX deve ser fechada por ':]'.
-parser.cc.2=Fim inesperado do padr\u00E3o em uma classe de caractere.
-parser.cc.3=Nome desconhecido para uma classe de caractere POSIX.
-parser.cc.4='-' \u00E9 inv\u00E1lido aqui.
-parser.cc.5=']' \u00E9 esperado.
-parser.cc.6='[' \u00E9 inv\u00E1lido em uma classe de caractere. Use '\\['.
-parser.cc.7=']' \u00E9 inv\u00E1lido em uma classe de caractere. Use '\\]'.
-parser.cc.8='-' \u00E9 uma faixa de caracteres inv\u00E1lida. Use '\\-'.
-parser.ope.1='[' \u00E9 esperado.
-parser.ope.2=')' ou '-[' ou '+[' ou '&[' \u00E9 esperado.
-parser.ope.3=O c\u00F3digo de fim da faixa \u00E9 inferior ao de in\u00EDcio.
-parser.descape.1=Nota\u00E7\u00E3o hexadecimal Unicode inv\u00E1lida.
-parser.descape.2=Overflow em uma nota\u00E7\u00E3o hexadecimal.
-parser.descape.3='\\x{' deve ser fechado por '}'.
-parser.descape.4=C\u00F3digo Unicode inv\u00E1lido.
-parser.descape.5=Uma \u00E2ncora n\u00E3o deve estar aqui.
-parser.process.1=Esta express\u00E3o n\u00E3o \u00E9 suportada na defini\u00E7\u00E3o da op\u00E7\u00E3o atual.
-parser.quantifier.1=Quantificador inv\u00E1lido. \u00C9 esperado um d\u00EDgito.
-parser.quantifier.2=Quantificador inv\u00E1lido. A quantidade \u00E9 inv\u00E1lida ou est\u00E1 faltando um '}'.
-parser.quantifier.3=Quantificador inv\u00E1lido. \u00C9 esperado um d\u00EDgito ou '}'.
-parser.quantifier.4=Quantificador inv\u00E1lido. Uma quantidade m\u00EDnima deve ser <= uma quantidade m\u00E1xima.
-parser.quantifier.5=Quantificador inv\u00E1lido. Um overflow do valor de quantidade.
-null
-null
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_sv.properties b/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_sv.properties
deleted file mode 100644
index c5ace36..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_sv.properties
+++ /dev/null
@@ -1,41 +0,0 @@
-parser.parse.1=Fel tecken.
-parser.parse.2=Ogiltigt referensnummer.
-parser.next.1=Ett tecken kr\u00E4vs efter \\.
-parser.next.2='?' f\u00F6rv\u00E4ntas inte. '(?:' eller '(?=' eller '(?!' eller '(?<' eller '(?#' eller '(?>'?
-parser.next.3='(?<=' eller '(?<!' f\u00F6rv\u00E4ntas.
-parser.next.4=En kommentar har inte avslutats.
-parser.factor.1=')' f\u00F6rv\u00E4ntas.
-parser.factor.2=Ov\u00E4ntat avslut p\u00E5 m\u00F6nstret i en modifierargrupp.
-parser.factor.3=':' f\u00F6rv\u00E4ntas.
-parser.factor.4=Ov\u00E4ntat avslut p\u00E5 m\u00F6nstret i en villkorsgrupp.
-parser.factor.5=Bak\u00E5treferens eller ankare eller lookahead eller lookbehind f\u00F6rv\u00E4ntas i ett villkorsm\u00F6nster.
-parser.factor.6=Det finns mer \u00E4n tre val i en villkorsgrupp.
-parser.atom.1=Ett tecken i U+0040-U+005f m\u00E5ste komma efter \\c.
-parser.atom.2=Ett '{' kr\u00E4vs f\u00F6re en teckenkategori.
-parser.atom.3=Ett egenskapsnamn har inte st\u00E4ngts med '}'.
-parser.atom.4=Ov\u00E4ntat metatecken.
-parser.atom.5=Ok\u00E4nd egenskap.
-parser.cc.1=En POSIX-teckenklass m\u00E5ste st\u00E4ngas av ':]'.
-parser.cc.2=Ov\u00E4ntat avslut p\u00E5 m\u00F6nstret i en teckenklass.
-parser.cc.3=Ok\u00E4nt namn p\u00E5 en POSIX-teckenklass.
-parser.cc.4='-' \u00E4r ogiltigt h\u00E4r.
-parser.cc.5=']' f\u00F6rv\u00E4ntas.
-parser.cc.6='[' \u00E4r ogiltigt i en teckenklass. Skriv '\\['.
-parser.cc.7=']' \u00E4r ogiltigt i en teckenklass. Skriv '\\]'.
-parser.cc.8='-' \u00E4r ett ogiltigt teckenintervall. Skriv '\\-'.
-parser.ope.1='[' f\u00F6rv\u00E4ntas.
-parser.ope.2=')' eller '-[' eller '+[' eller '&[' f\u00F6rv\u00E4ntas.
-parser.ope.3=Slutkodspunkten f\u00F6r intervallet \u00E4r mindre \u00E4n startkodspunkten.
-parser.descape.1=Ogiltig Unicode hex-notation.
-parser.descape.2=Spill i en hex-notation.
-parser.descape.3='\\x{' m\u00E5ste st\u00E4ngas av '}'.
-parser.descape.4=Ogiltig Unicode-kodpunkt.
-parser.descape.5=Ett ankare f\u00E5r inte vara h\u00E4r.
-parser.process.1=Det h\u00E4r uttrycket st\u00F6ds inte i aktuell alternativinst\u00E4llning.
-parser.quantifier.1=Ogiltig kvantifierare. En siffra f\u00F6rv\u00E4ntas.
-parser.quantifier.2=Ogiltig kvantifierare. Ogiltig kvantitet eller '}' saknas.
-parser.quantifier.3=Ogiltig kvantifierare. En siffra eller '}' f\u00F6rv\u00E4ntas.
-parser.quantifier.4=Ogiltig kvantifierare. En minkvantitet m\u00E5ste vara <= en maxkvantitet.
-parser.quantifier.5=Ogiltig kvantifierare. Ett kvantitetsv\u00E4rdesspill.
-null
-null
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_zh_CN.properties b/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_zh_CN.properties
deleted file mode 100644
index 8474a5f..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_zh_CN.properties
+++ /dev/null
@@ -1,41 +0,0 @@
-parser.parse.1=\u5B57\u7B26\u9519\u8BEF\u3002
-parser.parse.2=\u5F15\u7528\u53F7\u65E0\u6548\u3002
-parser.next.1=\\ \u540E\u9762\u5FC5\u987B\u6709\u5B57\u7B26\u3002
-parser.next.2=\u4E0D\u5E94\u51FA\u73B0 '?'\u3002'(?:' \u6216 '(?=' \u6216 '(?!' \u6216 '(?<' \u6216 '(?#' \u6216 '(?>'?
-parser.next.3=\u5E94\u4E3A '(?<=' \u6216 '(?<!'\u3002
-parser.next.4=\u6CE8\u91CA\u672A\u7EC8\u6B62\u3002
-parser.factor.1=\u5E94\u4E3A ')'\u3002
-parser.factor.2=\u4FEE\u9970\u7B26\u7EC4\u4E2D\u610F\u5916\u7684\u6A21\u5F0F\u7ED3\u5C3E\u3002
-parser.factor.3=\u5E94\u4E3A ':'\u3002
-parser.factor.4=\u6761\u4EF6\u7EC4\u4E2D\u610F\u5916\u7684\u6A21\u5F0F\u7ED3\u5C3E\u3002
-parser.factor.5=\u5728\u6761\u4EF6\u6A21\u5F0F\u4E2D\u5E94\u4E3A\u5411\u540E\u5F15\u7528\u6216\u951A\u5B9A\u70B9\u6216\u5411\u524D\u67E5\u627E\u6216\u5411\u540E\u67E5\u627E\u3002
-parser.factor.6=\u6761\u4EF6\u7EC4\u4E2D\u7684\u9009\u9879\u591A\u4E8E\u4E09\u4E2A\u3002
-parser.atom.1=\\c \u540E\u9762\u5FC5\u987B\u8DDF\u6709 U+0040-U+005f \u4E2D\u7684\u5B57\u7B26\u3002
-parser.atom.2=\u5B57\u7B26\u7C7B\u522B\u524D\u5FC5\u987B\u6709 '{'\u3002
-parser.atom.3=\u5C5E\u6027\u540D\u672A\u4EE5 '}' \u7ED3\u675F\u3002
-parser.atom.4=\u610F\u5916\u7684\u5143\u5B57\u7B26\u3002
-parser.atom.5=\u672A\u77E5\u5C5E\u6027\u3002
-parser.cc.1=POSIX \u5B57\u7B26\u7C7B\u5FC5\u987B\u4EE5 ':]' \u7ED3\u675F\u3002
-parser.cc.2=\u5B57\u7B26\u7C7B\u4E2D\u610F\u5916\u7684\u6A21\u5F0F\u7ED3\u5C3E\u3002
-parser.cc.3=POSIX \u5B57\u7B26\u7C7B\u7684\u540D\u79F0\u672A\u77E5\u3002
-parser.cc.4=\u6B64\u5904 '-' \u662F\u65E0\u6548\u7684\u3002
-parser.cc.5=\u5E94\u4E3A ']'\u3002
-parser.cc.6='[' \u5728\u5B57\u7B26\u7C7B\u4E2D\u662F\u65E0\u6548\u7684\u3002\u5199\u5165 '\\['\u3002
-parser.cc.7=']' \u5728\u5B57\u7B26\u7C7B\u4E2D\u662F\u65E0\u6548\u7684\u3002\u5199\u5165 '\\]'\u3002
-parser.cc.8='-' \u662F\u65E0\u6548\u7684\u5B57\u7B26\u8303\u56F4\u3002\u5199\u5165 '\\-'\u3002
-parser.ope.1=\u5E94\u4E3A '['\u3002
-parser.ope.2=\u5E94\u4E3A ')' \u6216 '-[' \u6216 '+[' \u6216 '&['\u3002
-parser.ope.3=\u8303\u56F4\u7ED3\u675F\u4EE3\u7801\u70B9\u5C0F\u4E8E\u5F00\u59CB\u4EE3\u7801\u70B9\u3002
-parser.descape.1=Unicode \u5341\u516D\u8FDB\u5236\u8BB0\u53F7\u65E0\u6548\u3002
-parser.descape.2=\u5341\u516D\u8FDB\u5236\u8BB0\u53F7\u6EA2\u51FA\u3002
-parser.descape.3='\\x{' \u5FC5\u987B\u4EE5 '}' \u7ED3\u675F\u3002
-parser.descape.4=Unicode \u4EE3\u7801\u70B9\u65E0\u6548\u3002
-parser.descape.5=\u6B64\u5904\u4E0D\u80FD\u6709\u951A\u5B9A\u70B9\u3002
-parser.process.1=\u5F53\u524D\u7684\u9009\u9879\u8BBE\u7F6E\u4E0D\u652F\u6301\u6B64\u8868\u8FBE\u5F0F\u3002
-parser.quantifier.1=\u9650\u5B9A\u7B26\u65E0\u6548\u3002\u5E94\u4E3A\u6570\u5B57\u3002
-parser.quantifier.2=\u9650\u5B9A\u7B26\u65E0\u6548\u3002\u7F3A\u5C11\u6709\u6548\u7684\u6570\u91CF\u6216 '}'\u3002
-parser.quantifier.3=\u9650\u5B9A\u7B26\u65E0\u6548\u3002\u5E94\u4E3A\u6570\u5B57\u6216 '}'\u3002
-parser.quantifier.4=\u9650\u5B9A\u7B26\u65E0\u6548\u3002\u6700\u5C0F\u6570\u91CF\u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E\u6700\u5927\u6570\u91CF\u3002
-parser.quantifier.5=\u9650\u5B9A\u7B26\u65E0\u6548\u3002\u6570\u91CF\u503C\u6EA2\u51FA\u3002
-null
-null
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_zh_TW.properties b/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_zh_TW.properties
deleted file mode 100644
index 38e751e..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_zh_TW.properties
+++ /dev/null
@@ -1,41 +0,0 @@
-parser.parse.1=\u4E0D\u6B63\u78BA\u7684\u5B57\u5143.
-parser.parse.2=\u7121\u6548\u7684\u53C3\u7167\u865F\u78BC.
-parser.next.1=\\ \u4E4B\u5F8C\u5FC5\u9808\u8981\u6709\u4E00\u500B\u5B57\u5143.
-parser.next.2=\u4E0D\u61C9\u70BA '?'. '(?:' \u6216 '(?=' \u6216 '(?!' \u6216 '(?<' \u6216 '(?#' \u6216 '(?>'?
-parser.next.3=\u9810\u671F\u61C9\u70BA '(?<=' \u6216 '(?<!'.
-parser.next.4=\u8A3B\u89E3\u672A\u7D42\u6B62.
-parser.factor.1=\u9810\u671F\u61C9\u6709 ')'.
-parser.factor.2=\u4FEE\u98FE\u689D\u4EF6\u7FA4\u7D44\u4E2D\u6709\u672A\u9810\u671F\u7684\u6A23\u5F0F\u7D50\u5C3E.
-parser.factor.3=\u9810\u671F\u61C9\u6709 ':'.
-parser.factor.4=\u689D\u4EF6\u6027\u7FA4\u7D44\u4E2D\u6709\u672A\u9810\u671F\u7684\u6A23\u5F0F\u7D50\u5C3E.
-parser.factor.5=\u689D\u4EF6\u6027\u6A23\u5F0F\u4E2D\u61C9\u8A72\u6709\u5F80\u56DE\u53C3\u7167\u3001\u5B9A\u9328\u9EDE\u3001\u5411\u524D\u67E5\u627E\u6216\u5411\u5F8C\u67E5\u627E.
-parser.factor.6=\u689D\u4EF6\u6027\u7FA4\u7D44\u4E2D\u6709\u4E09\u500B\u4EE5\u4E0A\u7684\u9078\u9805.
-parser.atom.1=U+0040-U+005f \u5B57\u5143\u5FC5\u9808\u63A5\u8457 \\c.
-parser.atom.2=\u5B57\u5143\u985E\u5225\u524D\u9762\u5FC5\u9808\u8981\u6709\u4E00\u500B '{'.
-parser.atom.3=\u7279\u6027\u540D\u7A31\u672A\u4EE5 '}' \u7D50\u675F.
-parser.atom.4=\u672A\u9810\u671F\u7684\u63CF\u8FF0\u5B57\u5143.
-parser.atom.5=\u4E0D\u660E\u7684\u7279\u6027.
-parser.cc.1=POSIX \u5B57\u5143\u985E\u5225\u5FC5\u9808\u4EE5 ':]' \u4F5C\u70BA\u7D50\u675F.
-parser.cc.2=\u5B57\u5143\u985E\u5225\u4E2D\u6709\u672A\u9810\u671F\u7684\u6A23\u5F0F\u7D50\u5C3E.
-parser.cc.3=\u4E0D\u660E\u7684 POSIX \u5B57\u5143\u985E\u5225\u540D\u7A31.
-parser.cc.4='-' \u5728\u6B64\u8655\u7121\u6548.
-parser.cc.5=\u9810\u671F\u61C9\u6709 ']'.
-parser.cc.6='[' \u5728\u5B57\u5143\u985E\u5225\u4E2D\u7121\u6548. \u5BEB\u5165 '\\['.
-parser.cc.7=']' \u5728\u5B57\u5143\u985E\u5225\u4E2D\u7121\u6548. \u5BEB\u5165 '\\]'.
-parser.cc.8='-' \u70BA\u7121\u6548\u7684\u5B57\u5143\u7BC4\u570D. \u5BEB\u5165 '\\-'.
-parser.ope.1=\u9810\u671F\u61C9\u6709 '['.
-parser.ope.2=\u9810\u671F\u61C9\u6709 ')'\u3001'-['\u3001'+[' \u6216 '&['.
-parser.ope.3=\u7BC4\u570D\u7D50\u675F\u5B57\u78BC\u6307\u6A19\u5C0F\u65BC\u958B\u59CB\u5B57\u78BC\u6307\u6A19.
-parser.descape.1=\u7121\u6548\u7684 Unicode \u5341\u516D\u9032\u4F4D\u8868\u793A\u6CD5.
-parser.descape.2=\u5341\u516D\u9032\u4F4D\u8868\u793A\u6CD5\u6EA2\u4F4D.
-parser.descape.3='\\x{' \u5FC5\u9808\u4EE5 '}' \u4F5C\u70BA\u7D50\u675F.
-parser.descape.4=\u7121\u6548\u7684 Unicode \u5B57\u78BC\u6307\u6A19.
-parser.descape.5=\u6B64\u8655\u4E0D\u53EF\u6709\u5B9A\u9328\u9EDE.
-parser.process.1=\u76EE\u524D\u7684\u9078\u9805\u8A2D\u5B9A\u4E0D\u652F\u63F4\u6B64\u8868\u793A\u5F0F
-parser.quantifier.1=\u7121\u6548\u7684\u6578\u91CF\u8A5E. \u9810\u671F\u61C9\u70BA\u6578\u5B57.
-parser.quantifier.2=\u7121\u6548\u7684\u6578\u91CF\u8A5E. \u7121\u6548\u7684\u6578\u91CF\u6216\u907A\u6F0F '}'.
-parser.quantifier.3=\u7121\u6548\u7684\u6578\u91CF\u8A5E. \u9810\u671F\u61C9\u70BA\u6578\u5B57\u6216 '}'.
-parser.quantifier.4=\u7121\u6548\u7684\u6578\u91CF\u8A5E. \u6700\u5C0F\u6578\u91CF\u5FC5\u9808\u5C0F\u65BC\u6216\u7B49\u65BC\u6700\u5927\u6578\u91CF.
-parser.quantifier.5=\u7121\u6548\u7684\u6578\u91CF\u8A5E. \u6578\u91CF\u503C\u6EA2\u4F4D.
-null
-null
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/AttributePSVImpl.java b/src/com/sun/org/apache/xerces/internal/impl/xs/AttributePSVImpl.java
deleted file mode 100644
index 14fb075..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/AttributePSVImpl.java
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2000-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs;
-
-import com.sun.org.apache.xerces.internal.xs.ShortList;
-import com.sun.org.apache.xerces.internal.xs.StringList;
-import com.sun.org.apache.xerces.internal.xs.XSAttributeDeclaration;
-import com.sun.org.apache.xerces.internal.xs.XSSimpleTypeDefinition;
-import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
-import com.sun.org.apache.xerces.internal.impl.xs.util.StringListImpl;
-import com.sun.org.apache.xerces.internal.xs.AttributePSVI;
-import com.sun.org.apache.xerces.internal.xs.XSConstants;
-
-/**
- * Attribute PSV infoset augmentations implementation.
- * The PSVI information for attributes will be available at the startElement call.
- *
- * @xerces.internal
- *
- * @author Elena Litani IBM
- */
-public class AttributePSVImpl implements AttributePSVI {
-
- /** attribute declaration */
- protected XSAttributeDeclaration fDeclaration = null;
-
- /** type of attribute, simpleType */
- protected XSTypeDefinition fTypeDecl = null;
-
- /** If this attribute was explicitly given a
- * value in the original document, this is false; otherwise, it is true */
- protected boolean fSpecified = false;
-
- /** schema normalized value property */
- protected String fNormalizedValue = null;
-
- /** schema actual value */
- protected Object fActualValue = null;
-
- /** schema actual value type */
- protected short fActualValueType = XSConstants.UNAVAILABLE_DT;
-
- /** actual value types if the value is a list */
- protected ShortList fItemValueTypes = null;
-
- /** member type definition against which attribute was validated */
- protected XSSimpleTypeDefinition fMemberType = null;
-
- /** validation attempted: none, partial, full */
- protected short fValidationAttempted = AttributePSVI.VALIDATION_NONE;
-
- /** validity: valid, invalid, unknown */
- protected short fValidity = AttributePSVI.VALIDITY_NOTKNOWN;
-
- /** error codes */
- protected String[] fErrorCodes = null;
-
- /** validation context: could be QName or XPath expression*/
- protected String fValidationContext = null;
-
- //
- // AttributePSVI methods
- //
-
- /**
- * [schema default]
- *
- * @return The canonical lexical representation of the declaration's {value constraint} value.
- * @see <a href="http://www.w3.org/TR/xmlschema-1/#e-schema_default>XML Schema Part 1: Structures [schema default]</a>
- */
- public String getSchemaDefault() {
- return fDeclaration == null ? null : fDeclaration.getConstraintValue();
- }
-
- /**
- * [schema normalized value]
- *
- *
- * @see <a href="http://www.w3.org/TR/xmlschema-1/#e-schema_normalized_value>XML Schema Part 1: Structures [schema normalized value]</a>
- * @return the normalized value of this item after validation
- */
- public String getSchemaNormalizedValue() {
- return fNormalizedValue;
- }
-
- /**
- * [schema specified]
- * @see <a href="http://www.w3.org/TR/xmlschema-1/#e-schema_specified">XML Schema Part 1: Structures [schema specified]</a>
- * @return true - value was specified in schema, false - value comes from the infoset
- */
- public boolean getIsSchemaSpecified() {
- return fSpecified;
- }
-
-
- /**
- * Determines the extent to which the document has been validated
- *
- * @return return the [validation attempted] property. The possible values are
- * NO_VALIDATION, PARTIAL_VALIDATION and FULL_VALIDATION
- */
- public short getValidationAttempted() {
- return fValidationAttempted;
- }
-
- /**
- * Determine the validity of the node with respect
- * to the validation being attempted
- *
- * @return return the [validity] property. Possible values are:
- * UNKNOWN_VALIDITY, INVALID_VALIDITY, VALID_VALIDITY
- */
- public short getValidity() {
- return fValidity;
- }
-
- /**
- * A list of error codes generated from validation attempts.
- * Need to find all the possible subclause reports that need reporting
- *
- * @return list of error codes
- */
- public StringList getErrorCodes() {
- if (fErrorCodes == null)
- return null;
- return new StringListImpl(fErrorCodes, fErrorCodes.length);
- }
-
- // This is the only information we can provide in a pipeline.
- public String getValidationContext() {
- return fValidationContext;
- }
-
- /**
- * An item isomorphic to the type definition used to validate this element.
- *
- * @return a type declaration
- */
- public XSTypeDefinition getTypeDefinition() {
- return fTypeDecl;
- }
-
- /**
- * If and only if that type definition is a simple type definition
- * with {variety} union, or a complex type definition whose {content type}
- * is a simple thype definition with {variety} union, then an item isomorphic
- * to that member of the union's {member type definitions} which actually
- * validated the element item's normalized value.
- *
- * @return a simple type declaration
- */
- public XSSimpleTypeDefinition getMemberTypeDefinition() {
- return fMemberType;
- }
-
- /**
- * An item isomorphic to the attribute declaration used to validate
- * this attribute.
- *
- * @return an attribute declaration
- */
- public XSAttributeDeclaration getAttributeDeclaration() {
- return fDeclaration;
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xs.ItemPSVI#getActualNormalizedValue()
- */
- public Object getActualNormalizedValue() {
- return this.fActualValue;
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xs.ItemPSVI#getActualNormalizedValueType()
- */
- public short getActualNormalizedValueType() {
- return this.fActualValueType;
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xs.ItemPSVI#getItemValueTypes()
- */
- public ShortList getItemValueTypes() {
- return this.fItemValueTypes;
- }
-
- /**
- * Reset()
- */
- public void reset() {
- fNormalizedValue = null;
- fActualValue = null;
- fActualValueType = XSConstants.UNAVAILABLE_DT;
- fItemValueTypes = null;
- fDeclaration = null;
- fTypeDecl = null;
- fSpecified = false;
- fMemberType = null;
- fValidationAttempted = AttributePSVI.VALIDATION_NONE;
- fValidity = AttributePSVI.VALIDITY_NOTKNOWN;
- fErrorCodes = null;
- fValidationContext = null;
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/ElementPSVImpl.java b/src/com/sun/org/apache/xerces/internal/impl/xs/ElementPSVImpl.java
deleted file mode 100644
index b5a7706..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/ElementPSVImpl.java
+++ /dev/null
@@ -1,277 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2000-2002,2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs;
-
-import com.sun.org.apache.xerces.internal.xs.ShortList;
-import com.sun.org.apache.xerces.internal.xs.StringList;
-import com.sun.org.apache.xerces.internal.xs.XSElementDeclaration;
-import com.sun.org.apache.xerces.internal.xs.XSModel;
-import com.sun.org.apache.xerces.internal.xs.XSNotationDeclaration;
-import com.sun.org.apache.xerces.internal.xs.XSSimpleTypeDefinition;
-import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
-import com.sun.org.apache.xerces.internal.impl.xs.util.StringListImpl;
-import com.sun.org.apache.xerces.internal.xs.ElementPSVI;
-import com.sun.org.apache.xerces.internal.xs.XSConstants;
-
-/**
- * Element PSV infoset augmentations implementation.
- * The following information will be available at the startElement call:
- * name, namespace, type, notation, validation context
- *
- * The following information will be available at the endElement call:
- * nil, specified, normalized value, member type, validity, error codes,
- * default
- *
- * @xerces.internal
- *
- * @author Elena Litani IBM
- */
-public class ElementPSVImpl implements ElementPSVI {
-
- /** element declaration */
- protected XSElementDeclaration fDeclaration = null;
-
- /** type of element, could be xsi:type */
- protected XSTypeDefinition fTypeDecl = null;
-
- /** true if clause 3.2 of Element Locally Valid (Element) (3.3.4)
- * is satisfied, otherwise false
- */
- protected boolean fNil = false;
-
- /** true if the element value was provided by the schema; false otherwise.
- */
- protected boolean fSpecified = false;
-
- /** schema normalized value property */
- protected String fNormalizedValue = null;
-
- /** schema actual value */
- protected Object fActualValue = null;
-
- /** schema actual value type */
- protected short fActualValueType = XSConstants.UNAVAILABLE_DT;
-
- /** actual value types if the value is a list */
- protected ShortList fItemValueTypes = null;
-
- /** http://www.w3.org/TR/xmlschema-1/#e-notation*/
- protected XSNotationDeclaration fNotation = null;
-
- /** member type definition against which element was validated */
- protected XSSimpleTypeDefinition fMemberType = null;
-
- /** validation attempted: none, partial, full */
- protected short fValidationAttempted = ElementPSVI.VALIDATION_NONE;
-
- /** validity: valid, invalid, unknown */
- protected short fValidity = ElementPSVI.VALIDITY_NOTKNOWN;
-
- /** error codes */
- protected String[] fErrorCodes = null;
-
- /** validation context: could be QName or XPath expression*/
- protected String fValidationContext = null;
-
- /** deferred XSModel **/
- protected SchemaGrammar[] fGrammars = null;
-
- /** the schema information property */
- protected XSModel fSchemaInformation = null;
-
- //
- // ElementPSVI methods
- //
-
- /**
- * [schema default]
- *
- * @return The canonical lexical representation of the declaration's {value constraint} value.
- * @see <a href="http://www.w3.org/TR/xmlschema-1/#e-schema_default>XML Schema Part 1: Structures [schema default]</a>
- */
- public String getSchemaDefault() {
- return fDeclaration == null ? null : fDeclaration.getConstraintValue();
- }
-
- /**
- * [schema normalized value]
- *
- *
- * @see <a href="http://www.w3.org/TR/xmlschema-1/#e-schema_normalized_value>XML Schema Part 1: Structures [schema normalized value]</a>
- * @return the normalized value of this item after validation
- */
- public String getSchemaNormalizedValue() {
- return fNormalizedValue;
- }
-
- /**
- * [schema specified]
- * @see <a href="http://www.w3.org/TR/xmlschema-1/#e-schema_specified">XML Schema Part 1: Structures [schema specified]</a>
- * @return true - value was specified in schema, false - value comes from the infoset
- */
- public boolean getIsSchemaSpecified() {
- return fSpecified;
- }
-
- /**
- * Determines the extent to which the document has been validated
- *
- * @return return the [validation attempted] property. The possible values are
- * NO_VALIDATION, PARTIAL_VALIDATION and FULL_VALIDATION
- */
- public short getValidationAttempted() {
- return fValidationAttempted;
- }
-
- /**
- * Determine the validity of the node with respect
- * to the validation being attempted
- *
- * @return return the [validity] property. Possible values are:
- * UNKNOWN_VALIDITY, INVALID_VALIDITY, VALID_VALIDITY
- */
- public short getValidity() {
- return fValidity;
- }
-
- /**
- * A list of error codes generated from validation attempts.
- * Need to find all the possible subclause reports that need reporting
- *
- * @return Array of error codes
- */
- public StringList getErrorCodes() {
- if (fErrorCodes == null)
- return null;
- return new StringListImpl(fErrorCodes, fErrorCodes.length);
- }
-
-
- // This is the only information we can provide in a pipeline.
- public String getValidationContext() {
- return fValidationContext;
- }
-
- /**
- * [nil]
- * @see <a href="http://www.w3.org/TR/xmlschema-1/#e-nil>XML Schema Part 1: Structures [nil]</a>
- * @return true if clause 3.2 of Element Locally Valid (Element) (3.3.4) above is satisfied, otherwise false
- */
- public boolean getNil() {
- return fNil;
- }
-
- /**
- * [notation]
- * @see <a href="http://www.w3.org/TR/xmlschema-1/#e-notation>XML Schema Part 1: Structures [notation]</a>
- * @return The notation declaration.
- */
- public XSNotationDeclaration getNotation() {
- return fNotation;
- }
-
- /**
- * An item isomorphic to the type definition used to validate this element.
- *
- * @return a type declaration
- */
- public XSTypeDefinition getTypeDefinition() {
- return fTypeDecl;
- }
-
- /**
- * If and only if that type definition is a simple type definition
- * with {variety} union, or a complex type definition whose {content type}
- * is a simple thype definition with {variety} union, then an item isomorphic
- * to that member of the union's {member type definitions} which actually
- * validated the element item's normalized value.
- *
- * @return a simple type declaration
- */
- public XSSimpleTypeDefinition getMemberTypeDefinition() {
- return fMemberType;
- }
-
- /**
- * An item isomorphic to the element declaration used to validate
- * this element.
- *
- * @return an element declaration
- */
- public XSElementDeclaration getElementDeclaration() {
- return fDeclaration;
- }
-
- /**
- * [schema information]
- * @see <a href="http://www.w3.org/TR/xmlschema-1/#e-schema_information">XML Schema Part 1: Structures [schema information]</a>
- * @return The schema information property if it's the validation root,
- * null otherwise.
- */
- public synchronized XSModel getSchemaInformation() {
- if (fSchemaInformation == null && fGrammars != null) {
- fSchemaInformation = new XSModelImpl(fGrammars);
- }
- return fSchemaInformation;
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xs.ItemPSVI#getActualNormalizedValue()
- */
- public Object getActualNormalizedValue() {
- return this.fActualValue;
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xs.ItemPSVI#getActualNormalizedValueType()
- */
- public short getActualNormalizedValueType() {
- return this.fActualValueType;
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xs.ItemPSVI#getItemValueTypes()
- */
- public ShortList getItemValueTypes() {
- return this.fItemValueTypes;
- }
-
- /**
- * Reset() should be called in validator startElement(..) method.
- */
- public void reset() {
- fDeclaration = null;
- fTypeDecl = null;
- fNil = false;
- fSpecified = false;
- fNotation = null;
- fMemberType = null;
- fValidationAttempted = ElementPSVI.VALIDATION_NONE;
- fValidity = ElementPSVI.VALIDITY_NOTKNOWN;
- fErrorCodes = null;
- fValidationContext = null;
- fNormalizedValue = null;
- fActualValue = null;
- fActualValueType = XSConstants.UNAVAILABLE_DT;
- fItemValueTypes = null;
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/SchemaGrammar.java b/src/com/sun/org/apache/xerces/internal/impl/xs/SchemaGrammar.java
deleted file mode 100644
index ea45003..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/SchemaGrammar.java
+++ /dev/null
@@ -1,1688 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs;
-
-import java.lang.ref.SoftReference;
-import java.util.Vector;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.dv.SchemaDVFactory;
-import com.sun.org.apache.xerces.internal.impl.dv.ValidatedInfo;
-import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType;
-import com.sun.org.apache.xerces.internal.impl.dv.xs.XSSimpleTypeDecl;
-import com.sun.org.apache.xerces.internal.impl.xs.identity.IdentityConstraint;
-import com.sun.org.apache.xerces.internal.impl.xs.util.ObjectListImpl;
-import com.sun.org.apache.xerces.internal.impl.xs.util.SimpleLocator;
-import com.sun.org.apache.xerces.internal.impl.xs.util.StringListImpl;
-import com.sun.org.apache.xerces.internal.impl.xs.util.XSNamedMap4Types;
-import com.sun.org.apache.xerces.internal.impl.xs.util.XSNamedMapImpl;
-import com.sun.org.apache.xerces.internal.impl.xs.util.XSObjectListImpl;
-import com.sun.org.apache.xerces.internal.parsers.DOMParser;
-import com.sun.org.apache.xerces.internal.parsers.SAXParser;
-import com.sun.org.apache.xerces.internal.parsers.XML11Configuration;
-import com.sun.org.apache.xerces.internal.util.SymbolHash;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription;
-import com.sun.org.apache.xerces.internal.xni.grammars.XSGrammar;
-import com.sun.org.apache.xerces.internal.xs.StringList;
-import com.sun.org.apache.xerces.internal.xs.XSAnnotation;
-import com.sun.org.apache.xerces.internal.xs.XSAttributeDeclaration;
-import com.sun.org.apache.xerces.internal.xs.XSAttributeGroupDefinition;
-import com.sun.org.apache.xerces.internal.xs.XSConstants;
-import com.sun.org.apache.xerces.internal.xs.XSElementDeclaration;
-import com.sun.org.apache.xerces.internal.xs.XSModel;
-import com.sun.org.apache.xerces.internal.xs.XSModelGroupDefinition;
-import com.sun.org.apache.xerces.internal.xs.XSNamedMap;
-import com.sun.org.apache.xerces.internal.xs.XSNamespaceItem;
-import com.sun.org.apache.xerces.internal.xs.XSNotationDeclaration;
-import com.sun.org.apache.xerces.internal.xs.XSObjectList;
-import com.sun.org.apache.xerces.internal.xs.XSParticle;
-import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
-import com.sun.org.apache.xerces.internal.xs.XSWildcard;
-import com.sun.org.apache.xerces.internal.xs.datatypes.ObjectList;
-import org.xml.sax.SAXException;
-
-/**
- * This class is to hold all schema component declaration that are declared
- * within one namespace.
- *
- * The Grammar class this class extends contains what little
- * commonality there is between XML Schema and DTD grammars. It's
- * useful to distinguish grammar objects from other kinds of object
- * when they exist in pools or caches.
- *
- * @xerces.internal
- *
- * @author Sandy Gao, IBM
- * @author Elena Litani, IBM
- *
- * @version $Id: SchemaGrammar.java,v 1.7 2010-11-01 04:39:55 joehw Exp $
- */
-
-public class SchemaGrammar implements XSGrammar, XSNamespaceItem {
-
- // the target namespace of grammar
- String fTargetNamespace;
-
- // global decls: map from decl name to decl object
- SymbolHash fGlobalAttrDecls;
- SymbolHash fGlobalAttrGrpDecls;
- SymbolHash fGlobalElemDecls;
- SymbolHash fGlobalGroupDecls;
- SymbolHash fGlobalNotationDecls;
- SymbolHash fGlobalIDConstraintDecls;
- SymbolHash fGlobalTypeDecls;
-
- // extended global decls: map from schema location + decl name to decl object
- // key is location,name
- SymbolHash fGlobalAttrDeclsExt;
- SymbolHash fGlobalAttrGrpDeclsExt;
- SymbolHash fGlobalElemDeclsExt;
- SymbolHash fGlobalGroupDeclsExt;
- SymbolHash fGlobalNotationDeclsExt;
- SymbolHash fGlobalIDConstraintDeclsExt;
- SymbolHash fGlobalTypeDeclsExt;
-
- // A global map of all global element declarations - used for substitution group computation
- // (handy when sharing components by reference, since we might end up with duplicate components
- // that are not added to either of the global element declarations above)
- SymbolHash fAllGlobalElemDecls;
-
- // the XMLGrammarDescription member
- XSDDescription fGrammarDescription = null;
-
- // annotations associated with the "root" schema of this targetNamespace
- XSAnnotationImpl [] fAnnotations = null;
-
- // number of annotations declared
- int fNumAnnotations;
-
- // symbol table for constructing parsers (annotation support)
- private SymbolTable fSymbolTable = null;
- // parsers for annotation support
- private SoftReference fSAXParser = null;
- private SoftReference fDOMParser = null;
-
- // is this grammar immutable? (fully constructed and not changeable)
- private boolean fIsImmutable = false;
-
- //
- // Constructors
- //
-
- // needed to make BuiltinSchemaGrammar work.
- protected SchemaGrammar() {}
-
- /**
- * Default constructor.
- *
- * @param targetNamespace
- * @param grammarDesc the XMLGrammarDescription corresponding to this objec
- * at the least a systemId should always be known.
- * @param symbolTable needed for annotation support
- */
- public SchemaGrammar(String targetNamespace, XSDDescription grammarDesc,
- SymbolTable symbolTable) {
- fTargetNamespace = targetNamespace;
- fGrammarDescription = grammarDesc;
- fSymbolTable = symbolTable;
-
- // REVISIT: do we know the numbers of the following global decls
- // when creating this grammar? If so, we can pass the numbers in,
- // and use that number to initialize the following hashtables.
- fGlobalAttrDecls = new SymbolHash();
- fGlobalAttrGrpDecls = new SymbolHash();
- fGlobalElemDecls = new SymbolHash();
- fGlobalGroupDecls = new SymbolHash();
- fGlobalNotationDecls = new SymbolHash();
- fGlobalIDConstraintDecls = new SymbolHash();
-
- // Extended tables
- fGlobalAttrDeclsExt = new SymbolHash();
- fGlobalAttrGrpDeclsExt = new SymbolHash();
- fGlobalElemDeclsExt = new SymbolHash();
- fGlobalGroupDeclsExt = new SymbolHash();
- fGlobalNotationDeclsExt = new SymbolHash();
- fGlobalIDConstraintDeclsExt = new SymbolHash();
- fGlobalTypeDeclsExt = new SymbolHash();
-
- // All global elements table
- fAllGlobalElemDecls = new SymbolHash();
-
- // if we are parsing S4S, put built-in types in first
- // they might get overwritten by the types from S4S, but that's
- // considered what the application wants to do.
- if (fTargetNamespace == SchemaSymbols.URI_SCHEMAFORSCHEMA)
- fGlobalTypeDecls = SG_SchemaNS.fGlobalTypeDecls.makeClone();
- else
- fGlobalTypeDecls = new SymbolHash();
- } // <init>(String, XSDDescription)
-
- // Clone an existing schema grammar
- public SchemaGrammar(SchemaGrammar grammar) {
- fTargetNamespace = grammar.fTargetNamespace;
- fGrammarDescription = grammar.fGrammarDescription.makeClone();
- //fGrammarDescription.fContextType |= XSDDescription.CONTEXT_COLLISION; // REVISIT
- fSymbolTable = grammar.fSymbolTable; // REVISIT
-
- fGlobalAttrDecls = grammar.fGlobalAttrDecls.makeClone();
- fGlobalAttrGrpDecls = grammar.fGlobalAttrGrpDecls.makeClone();
- fGlobalElemDecls = grammar.fGlobalElemDecls.makeClone();
- fGlobalGroupDecls = grammar.fGlobalGroupDecls.makeClone();
- fGlobalNotationDecls = grammar.fGlobalNotationDecls.makeClone();
- fGlobalIDConstraintDecls = grammar.fGlobalIDConstraintDecls.makeClone();
- fGlobalTypeDecls = grammar.fGlobalTypeDecls.makeClone();
-
- // Extended tables
- fGlobalAttrDeclsExt = grammar.fGlobalAttrDeclsExt.makeClone();
- fGlobalAttrGrpDeclsExt = grammar.fGlobalAttrGrpDeclsExt.makeClone();
- fGlobalElemDeclsExt = grammar.fGlobalElemDeclsExt.makeClone();
- fGlobalGroupDeclsExt = grammar.fGlobalGroupDeclsExt.makeClone();
- fGlobalNotationDeclsExt = grammar.fGlobalNotationDeclsExt.makeClone();
- fGlobalIDConstraintDeclsExt = grammar.fGlobalIDConstraintDeclsExt.makeClone();
- fGlobalTypeDeclsExt = grammar.fGlobalTypeDeclsExt.makeClone();
-
- // All global elements table
- fAllGlobalElemDecls = grammar.fAllGlobalElemDecls.makeClone();
-
- // Annotations associated with the "root" schema of this targetNamespace
- fNumAnnotations = grammar.fNumAnnotations;
- if (fNumAnnotations > 0) {
- fAnnotations = new XSAnnotationImpl[grammar.fAnnotations.length];
- System.arraycopy(grammar.fAnnotations, 0, fAnnotations, 0, fNumAnnotations);
- }
-
- // All substitution group information declared in this namespace
- fSubGroupCount = grammar.fSubGroupCount;
- if (fSubGroupCount > 0) {
- fSubGroups = new XSElementDecl[grammar.fSubGroups.length];
- System.arraycopy(grammar.fSubGroups, 0, fSubGroups, 0, fSubGroupCount);
- }
-
- // Array to store complex type decls for constraint checking
- fCTCount = grammar.fCTCount;
- if (fCTCount > 0) {
- fComplexTypeDecls = new XSComplexTypeDecl[grammar.fComplexTypeDecls.length];
- fCTLocators = new SimpleLocator[grammar.fCTLocators.length];
- System.arraycopy(grammar.fComplexTypeDecls, 0, fComplexTypeDecls, 0, fCTCount);
- System.arraycopy(grammar.fCTLocators, 0, fCTLocators, 0, fCTCount);
- }
-
- // Groups being redefined by restriction
- fRGCount = grammar.fRGCount;
- if (fRGCount > 0) {
- fRedefinedGroupDecls = new XSGroupDecl[grammar.fRedefinedGroupDecls.length];
- fRGLocators = new SimpleLocator[grammar.fRGLocators.length];
- System.arraycopy(grammar.fRedefinedGroupDecls, 0, fRedefinedGroupDecls, 0, fRGCount);
- System.arraycopy(grammar.fRGLocators, 0, fRGLocators, 0, fRGCount);
- }
-
- // List of imported grammars
- if (grammar.fImported != null) {
- fImported = new Vector();
- for (int i=0; i<grammar.fImported.size(); i++) {
- fImported.add(grammar.fImported.elementAt(i));
- }
- }
-
- // Locations
- if (grammar.fLocations != null) {
- for (int k=0; k<grammar.fLocations.size(); k++) {
- addDocument(null, (String)grammar.fLocations.elementAt(k));
- }
- }
-
- } // <init>(String, XSDDescription)
-
- // number of built-in XSTypes we need to create for base and full
- // datatype set
- private static final int BASICSET_COUNT = 29;
- private static final int FULLSET_COUNT = 46;
-
- private static final int GRAMMAR_XS = 1;
- private static final int GRAMMAR_XSI = 2;
-
- // this class makes sure the static, built-in schema grammars
- // are immutable.
- public static class BuiltinSchemaGrammar extends SchemaGrammar {
-
- private static final String EXTENDED_SCHEMA_FACTORY_CLASS = "com.sun.org.apache.xerces.internal.impl.dv.xs.ExtendedSchemaDVFactoryImpl";
-
- /**
- * Special constructor to create the grammars for the schema namespaces
- *
- * @param grammar
- */
- public BuiltinSchemaGrammar(int grammar, short schemaVersion) {
- SchemaDVFactory schemaFactory;
- if (schemaVersion == Constants.SCHEMA_VERSION_1_0) {
- schemaFactory = SchemaDVFactory.getInstance();
- }
- else {
- schemaFactory = SchemaDVFactory.getInstance(EXTENDED_SCHEMA_FACTORY_CLASS);
- }
-
- if (grammar == GRAMMAR_XS) {
- // target namespace
- fTargetNamespace = SchemaSymbols.URI_SCHEMAFORSCHEMA;
-
- // grammar description
- fGrammarDescription = new XSDDescription();
- fGrammarDescription.fContextType = XSDDescription.CONTEXT_PREPARSE;
- fGrammarDescription.setNamespace(SchemaSymbols.URI_SCHEMAFORSCHEMA);
-
- // no global decls other than types
- fGlobalAttrDecls = new SymbolHash(1);
- fGlobalAttrGrpDecls = new SymbolHash(1);
- fGlobalElemDecls = new SymbolHash(1);
- fGlobalGroupDecls = new SymbolHash(1);
- fGlobalNotationDecls = new SymbolHash(1);
- fGlobalIDConstraintDecls = new SymbolHash(1);
-
- // no extended global decls
- fGlobalAttrDeclsExt = new SymbolHash(1);
- fGlobalAttrGrpDeclsExt = new SymbolHash(1);
- fGlobalElemDeclsExt = new SymbolHash(1);
- fGlobalGroupDeclsExt = new SymbolHash(1);
- fGlobalNotationDeclsExt = new SymbolHash(1);
- fGlobalIDConstraintDeclsExt = new SymbolHash(1);
- fGlobalTypeDeclsExt = new SymbolHash(1);
-
- // all global element decls table
- fAllGlobalElemDecls = new SymbolHash(1);
-
- // get all built-in types
- fGlobalTypeDecls = schemaFactory.getBuiltInTypes();
-
- // assign the built-in schema grammar as the XSNamespaceItem
- // for each of the built-in simple type definitions.
- int length = fGlobalTypeDecls.getLength();
- XSTypeDefinition [] typeDefinitions = new XSTypeDefinition[length];
- fGlobalTypeDecls.getValues(typeDefinitions, 0);
- for (int i = 0; i < length; ++i) {
- XSTypeDefinition xtd = typeDefinitions[i];
- if (xtd instanceof XSSimpleTypeDecl) {
- ((XSSimpleTypeDecl) xtd).setNamespaceItem(this);
- }
- }
-
- // add anyType
- fGlobalTypeDecls.put(fAnyType.getName(), fAnyType);
- }
- else if (grammar == GRAMMAR_XSI) {
- // target namespace
- fTargetNamespace = SchemaSymbols.URI_XSI;
- // grammar description
- fGrammarDescription = new XSDDescription();
- fGrammarDescription.fContextType = XSDDescription.CONTEXT_PREPARSE;
- fGrammarDescription.setNamespace(SchemaSymbols.URI_XSI);
-
- // no global decls other than attributes
- fGlobalAttrGrpDecls = new SymbolHash(1);
- fGlobalElemDecls = new SymbolHash(1);
- fGlobalGroupDecls = new SymbolHash(1);
- fGlobalNotationDecls = new SymbolHash(1);
- fGlobalIDConstraintDecls = new SymbolHash(1);
- fGlobalTypeDecls = new SymbolHash(1);
-
- // no extended global decls
- fGlobalAttrDeclsExt = new SymbolHash(1);
- fGlobalAttrGrpDeclsExt = new SymbolHash(1);
- fGlobalElemDeclsExt = new SymbolHash(1);
- fGlobalGroupDeclsExt = new SymbolHash(1);
- fGlobalNotationDeclsExt = new SymbolHash(1);
- fGlobalIDConstraintDeclsExt = new SymbolHash(1);
- fGlobalTypeDeclsExt = new SymbolHash(1);
-
- // no all global element decls
- fAllGlobalElemDecls = new SymbolHash(1);
-
- // 4 attributes, so initialize the size as 4*2 = 8
- fGlobalAttrDecls = new SymbolHash(8);
- String name = null;
- String tns = null;
- XSSimpleType type = null;
- short scope = XSConstants.SCOPE_GLOBAL;
-
- // xsi:type
- name = SchemaSymbols.XSI_TYPE;
- tns = SchemaSymbols.URI_XSI;
- type = schemaFactory.getBuiltInType(SchemaSymbols.ATTVAL_QNAME);
- fGlobalAttrDecls.put(name, new BuiltinAttrDecl(name, tns, type, scope));
-
- // xsi:nil
- name = SchemaSymbols.XSI_NIL;
- tns = SchemaSymbols.URI_XSI;
- type = schemaFactory.getBuiltInType(SchemaSymbols.ATTVAL_BOOLEAN);
- fGlobalAttrDecls.put(name, new BuiltinAttrDecl(name, tns, type, scope));
-
- XSSimpleType anyURI = schemaFactory.getBuiltInType(SchemaSymbols.ATTVAL_ANYURI);
-
- // xsi:schemaLocation
- name = SchemaSymbols.XSI_SCHEMALOCATION;
- tns = SchemaSymbols.URI_XSI;
- type = schemaFactory.createTypeList("#AnonType_schemaLocation", SchemaSymbols.URI_XSI, (short)0, anyURI, null);
- if (type instanceof XSSimpleTypeDecl) {
- ((XSSimpleTypeDecl)type).setAnonymous(true);
- }
- fGlobalAttrDecls.put(name, new BuiltinAttrDecl(name, tns, type, scope));
-
- // xsi:noNamespaceSchemaLocation
- name = SchemaSymbols.XSI_NONAMESPACESCHEMALOCATION;
- tns = SchemaSymbols.URI_XSI;
- type = anyURI;
- fGlobalAttrDecls.put(name, new BuiltinAttrDecl(name, tns, type, scope));
- }
- } // <init>(int)
-
- // return the XMLGrammarDescription corresponding to this
- // object
- public XMLGrammarDescription getGrammarDescription() {
- return fGrammarDescription.makeClone();
- } // getGrammarDescription(): XMLGrammarDescription
-
- // override these methods solely so that these
- // objects cannot be modified once they're created.
- public void setImportedGrammars(Vector importedGrammars) {
- // ignore
- }
- public void addGlobalAttributeDecl(XSAttributeDecl decl) {
- // ignore
- }
- public void addGlobalAttributeDecl(XSAttributeDecl decl, String location) {
- // ignore
- }
- public void addGlobalAttributeGroupDecl(XSAttributeGroupDecl decl) {
- // ignore
- }
- public void addGlobalAttributeGroupDecl(XSAttributeGroupDecl decl, String location) {
- // ignore
- }
- public void addGlobalElementDecl(XSElementDecl decl) {
- // ignore
- }
- public void addGlobalElementDecl(XSElementDecl decl, String location) {
- // ignore
- }
- public void addGlobalElementDeclAll(XSElementDecl decl) {
- // ignore
- }
- public void addGlobalGroupDecl(XSGroupDecl decl) {
- // ignore
- }
- public void addGlobalGroupDecl(XSGroupDecl decl, String location) {
- // ignore
- }
- public void addGlobalNotationDecl(XSNotationDecl decl) {
- // ignore
- }
- public void addGlobalNotationDecl(XSNotationDecl decl, String location) {
- // ignore
- }
- public void addGlobalTypeDecl(XSTypeDefinition decl) {
- // ignore
- }
- public void addGlobalTypeDecl(XSTypeDefinition decl, String location) {
- // ignore
- }
- public void addGlobalComplexTypeDecl(XSComplexTypeDecl decl) {
- // ignore
- }
- public void addGlobalComplexTypeDecl(XSComplexTypeDecl decl, String location) {
- // ignore
- }
- public void addGlobalSimpleTypeDecl(XSSimpleType decl) {
- // ignore
- }
- public void addGlobalSimpleTypeDecl(XSSimpleType decl, String location) {
- // ignore
- }
- public void addComplexTypeDecl(XSComplexTypeDecl decl, SimpleLocator locator) {
- // ignore
- }
- public void addRedefinedGroupDecl(XSGroupDecl derived, XSGroupDecl base, SimpleLocator locator) {
- // ignore
- }
- public synchronized void addDocument(Object document, String location) {
- // ignore
- }
-
- // annotation support
- synchronized DOMParser getDOMParser() {
- return null;
- }
- synchronized SAXParser getSAXParser() {
- return null;
- }
- }
-
- /**
- * <p>A partial schema for schemas for validating annotations.</p>
- *
- * @xerces.internal
- *
- * @author Michael Glavassevich, IBM
- */
- public static final class Schema4Annotations extends SchemaGrammar {
-
- /**
- * Singleton instance.
- */
- public static final Schema4Annotations INSTANCE = new Schema4Annotations();
-
- /**
- * Special constructor to create a schema
- * capable of validating annotations.
- */
- private Schema4Annotations() {
-
- // target namespace
- fTargetNamespace = SchemaSymbols.URI_SCHEMAFORSCHEMA;
-
- // grammar description
- fGrammarDescription = new XSDDescription();
- fGrammarDescription.fContextType = XSDDescription.CONTEXT_PREPARSE;
- fGrammarDescription.setNamespace(SchemaSymbols.URI_SCHEMAFORSCHEMA);
-
- // no global decls other than types and
- // element declarations for <annotation>, <documentation> and <appinfo>.
- fGlobalAttrDecls = new SymbolHash(1);
- fGlobalAttrGrpDecls = new SymbolHash(1);
- fGlobalElemDecls = new SymbolHash(6);
- fGlobalGroupDecls = new SymbolHash(1);
- fGlobalNotationDecls = new SymbolHash(1);
- fGlobalIDConstraintDecls = new SymbolHash(1);
-
- // no extended global decls
- fGlobalAttrDeclsExt = new SymbolHash(1);
- fGlobalAttrGrpDeclsExt = new SymbolHash(1);
- fGlobalElemDeclsExt = new SymbolHash(6);
- fGlobalGroupDeclsExt = new SymbolHash(1);
- fGlobalNotationDeclsExt = new SymbolHash(1);
- fGlobalIDConstraintDeclsExt = new SymbolHash(1);
- fGlobalTypeDeclsExt = new SymbolHash(1);
-
- // all global element declarations
- fAllGlobalElemDecls = new SymbolHash(6);
-
- // get all built-in types
- fGlobalTypeDecls = SG_SchemaNS.fGlobalTypeDecls;
-
- // create element declarations for <annotation>, <documentation> and <appinfo>
- XSElementDecl annotationDecl = createAnnotationElementDecl(SchemaSymbols.ELT_ANNOTATION);
- XSElementDecl documentationDecl = createAnnotationElementDecl(SchemaSymbols.ELT_DOCUMENTATION);
- XSElementDecl appinfoDecl = createAnnotationElementDecl(SchemaSymbols.ELT_APPINFO);
-
- // add global element declarations
- fGlobalElemDecls.put(annotationDecl.fName, annotationDecl);
- fGlobalElemDecls.put(documentationDecl.fName, documentationDecl);
- fGlobalElemDecls.put(appinfoDecl.fName, appinfoDecl);
-
- fGlobalElemDeclsExt.put(","+annotationDecl.fName, annotationDecl);
- fGlobalElemDeclsExt.put(","+documentationDecl.fName, documentationDecl);
- fGlobalElemDeclsExt.put(","+appinfoDecl.fName, appinfoDecl);
-
- fAllGlobalElemDecls.put(annotationDecl, annotationDecl);
- fAllGlobalElemDecls.put(documentationDecl, documentationDecl);
- fAllGlobalElemDecls.put(appinfoDecl, appinfoDecl);
-
- // create complex type declarations for <annotation>, <documentation> and <appinfo>
- XSComplexTypeDecl annotationType = new XSComplexTypeDecl();
- XSComplexTypeDecl documentationType = new XSComplexTypeDecl();
- XSComplexTypeDecl appinfoType = new XSComplexTypeDecl();
-
- // set the types on their element declarations
- annotationDecl.fType = annotationType;
- documentationDecl.fType = documentationType;
- appinfoDecl.fType = appinfoType;
-
- // create attribute groups for <annotation>, <documentation> and <appinfo>
- XSAttributeGroupDecl annotationAttrs = new XSAttributeGroupDecl();
- XSAttributeGroupDecl documentationAttrs = new XSAttributeGroupDecl();
- XSAttributeGroupDecl appinfoAttrs = new XSAttributeGroupDecl();
-
- // fill in attribute groups
- {
- // create and fill attribute uses for <annotation>, <documentation> and <appinfo>
- XSAttributeUseImpl annotationIDAttr = new XSAttributeUseImpl();
- annotationIDAttr.fAttrDecl = new XSAttributeDecl();
- annotationIDAttr.fAttrDecl.setValues(SchemaSymbols.ATT_ID, null, (XSSimpleType) fGlobalTypeDecls.get(SchemaSymbols.ATTVAL_ID),
- XSConstants.VC_NONE, XSConstants.SCOPE_LOCAL, null, annotationType, null);
- annotationIDAttr.fUse = SchemaSymbols.USE_OPTIONAL;
- annotationIDAttr.fConstraintType = XSConstants.VC_NONE;
-
- XSAttributeUseImpl documentationSourceAttr = new XSAttributeUseImpl();
- documentationSourceAttr.fAttrDecl = new XSAttributeDecl();
- documentationSourceAttr.fAttrDecl.setValues(SchemaSymbols.ATT_SOURCE, null, (XSSimpleType) fGlobalTypeDecls.get(SchemaSymbols.ATTVAL_ANYURI),
- XSConstants.VC_NONE, XSConstants.SCOPE_LOCAL, null, documentationType, null);
- documentationSourceAttr.fUse = SchemaSymbols.USE_OPTIONAL;
- documentationSourceAttr.fConstraintType = XSConstants.VC_NONE;
-
- XSAttributeUseImpl documentationLangAttr = new XSAttributeUseImpl();
- documentationLangAttr.fAttrDecl = new XSAttributeDecl();
- documentationLangAttr.fAttrDecl.setValues("lang".intern(), NamespaceContext.XML_URI, (XSSimpleType) fGlobalTypeDecls.get(SchemaSymbols.ATTVAL_LANGUAGE),
- XSConstants.VC_NONE, XSConstants.SCOPE_LOCAL, null, documentationType, null);
- documentationLangAttr.fUse = SchemaSymbols.USE_OPTIONAL;
- documentationLangAttr.fConstraintType = XSConstants.VC_NONE;
-
- XSAttributeUseImpl appinfoSourceAttr = new XSAttributeUseImpl();
- appinfoSourceAttr.fAttrDecl = new XSAttributeDecl();
- appinfoSourceAttr.fAttrDecl.setValues(SchemaSymbols.ATT_SOURCE, null, (XSSimpleType) fGlobalTypeDecls.get(SchemaSymbols.ATTVAL_ANYURI),
- XSConstants.VC_NONE, XSConstants.SCOPE_LOCAL, null, appinfoType, null);
- appinfoSourceAttr.fUse = SchemaSymbols.USE_OPTIONAL;
- appinfoSourceAttr.fConstraintType = XSConstants.VC_NONE;
-
- // create lax attribute wildcard for <annotation>, <documentation> and <appinfo>
- XSWildcardDecl otherAttrs = new XSWildcardDecl();
- otherAttrs.fNamespaceList = new String [] {fTargetNamespace, null};
- otherAttrs.fType = XSWildcard.NSCONSTRAINT_NOT;
- otherAttrs.fProcessContents = XSWildcard.PC_LAX;
-
- // add attribute uses and wildcards to attribute groups for <annotation>, <documentation> and <appinfo>
- annotationAttrs.addAttributeUse(annotationIDAttr);
- annotationAttrs.fAttributeWC = otherAttrs;
-
- documentationAttrs.addAttributeUse(documentationSourceAttr);
- documentationAttrs.addAttributeUse(documentationLangAttr);
- documentationAttrs.fAttributeWC = otherAttrs;
-
- appinfoAttrs.addAttributeUse(appinfoSourceAttr);
- appinfoAttrs.fAttributeWC = otherAttrs;
- }
-
- // create particles for <annotation>
- XSParticleDecl annotationParticle = createUnboundedModelGroupParticle();
- {
- XSModelGroupImpl annotationChoice = new XSModelGroupImpl();
- annotationChoice.fCompositor = XSModelGroupImpl.MODELGROUP_CHOICE;
- annotationChoice.fParticleCount = 2;
- annotationChoice.fParticles = new XSParticleDecl[2];
- annotationChoice.fParticles[0] = createChoiceElementParticle(appinfoDecl);
- annotationChoice.fParticles[1] = createChoiceElementParticle(documentationDecl);
- annotationParticle.fValue = annotationChoice;
- }
-
- // create wildcard particle for <documentation> and <appinfo>
- XSParticleDecl anyWCSequenceParticle = createUnboundedAnyWildcardSequenceParticle();
-
- // fill complex types
- annotationType.setValues("#AnonType_" + SchemaSymbols.ELT_ANNOTATION, fTargetNamespace, SchemaGrammar.fAnyType,
- XSConstants.DERIVATION_RESTRICTION, XSConstants.DERIVATION_NONE, (short) (XSConstants.DERIVATION_EXTENSION | XSConstants.DERIVATION_RESTRICTION),
- XSComplexTypeDecl.CONTENTTYPE_ELEMENT, false, annotationAttrs, null, annotationParticle, new XSObjectListImpl(null, 0));
- annotationType.setName("#AnonType_" + SchemaSymbols.ELT_ANNOTATION);
- annotationType.setIsAnonymous();
-
- documentationType.setValues("#AnonType_" + SchemaSymbols.ELT_DOCUMENTATION, fTargetNamespace, SchemaGrammar.fAnyType,
- XSConstants.DERIVATION_RESTRICTION, XSConstants.DERIVATION_NONE, (short) (XSConstants.DERIVATION_EXTENSION | XSConstants.DERIVATION_RESTRICTION),
- XSComplexTypeDecl.CONTENTTYPE_MIXED, false, documentationAttrs, null, anyWCSequenceParticle, new XSObjectListImpl(null, 0));
- documentationType.setName("#AnonType_" + SchemaSymbols.ELT_DOCUMENTATION);
- documentationType.setIsAnonymous();
-
- appinfoType.setValues("#AnonType_" + SchemaSymbols.ELT_APPINFO, fTargetNamespace, SchemaGrammar.fAnyType,
- XSConstants.DERIVATION_RESTRICTION, XSConstants.DERIVATION_NONE, (short) (XSConstants.DERIVATION_EXTENSION | XSConstants.DERIVATION_RESTRICTION),
- XSComplexTypeDecl.CONTENTTYPE_MIXED, false, appinfoAttrs, null, anyWCSequenceParticle, new XSObjectListImpl(null, 0));
- appinfoType.setName("#AnonType_" + SchemaSymbols.ELT_APPINFO);
- appinfoType.setIsAnonymous();
-
- } // <init>(int)
-
- // return the XMLGrammarDescription corresponding to this
- // object
- public XMLGrammarDescription getGrammarDescription() {
- return fGrammarDescription.makeClone();
- } // getGrammarDescription(): XMLGrammarDescription
-
- // override these methods solely so that these
- // objects cannot be modified once they're created.
- public void setImportedGrammars(Vector importedGrammars) {
- // ignore
- }
- public void addGlobalAttributeDecl(XSAttributeDecl decl) {
- // ignore
- }
- public void addGlobalAttributeDecl(XSAttributeGroupDecl decl, String location) {
- // ignore
- }
- public void addGlobalAttributeGroupDecl(XSAttributeGroupDecl decl) {
- // ignore
- }
- public void addGlobalAttributeGroupDecl(XSAttributeGroupDecl decl, String location) {
- // ignore
- }
- public void addGlobalElementDecl(XSElementDecl decl) {
- // ignore
- }
- public void addGlobalElementDecl(XSElementDecl decl, String location) {
- // ignore
- }
- public void addGlobalElementDeclAll(XSElementDecl decl) {
- // ignore
- }
- public void addGlobalGroupDecl(XSGroupDecl decl) {
- // ignore
- }
- public void addGlobalGroupDecl(XSGroupDecl decl, String location) {
- // ignore
- }
- public void addGlobalNotationDecl(XSNotationDecl decl) {
- // ignore
- }
- public void addGlobalNotationDecl(XSNotationDecl decl, String location) {
- // ignore
- }
- public void addGlobalTypeDecl(XSTypeDefinition decl) {
- // ignore
- }
- public void addGlobalTypeDecl(XSTypeDefinition decl, String location) {
- // ignore
- }
- public void addGlobalComplexTypeDecl(XSComplexTypeDecl decl) {
- // ignore
- }
- public void addGlobalComplexTypeDecl(XSComplexTypeDecl decl, String location) {
- // ignore
- }
- public void addGlobalSimpleTypeDecl(XSSimpleType decl) {
- // ignore
- }
- public void addGlobalSimpleTypeDecl(XSSimpleType decl, String location) {
- // ignore
- }
- public void addComplexTypeDecl(XSComplexTypeDecl decl, SimpleLocator locator) {
- // ignore
- }
- public void addRedefinedGroupDecl(XSGroupDecl derived, XSGroupDecl base, SimpleLocator locator) {
- // ignore
- }
- public synchronized void addDocument(Object document, String location) {
- // ignore
- }
-
- // annotation support
- synchronized DOMParser getDOMParser() {
- return null;
- }
- synchronized SAXParser getSAXParser() {
- return null;
- }
-
- //
- // private helper methods
- //
-
- private XSElementDecl createAnnotationElementDecl(String localName) {
- XSElementDecl eDecl = new XSElementDecl();
- eDecl.fName = localName;
- eDecl.fTargetNamespace = fTargetNamespace;
- eDecl.setIsGlobal();
- eDecl.fBlock = (XSConstants.DERIVATION_EXTENSION |
- XSConstants.DERIVATION_RESTRICTION | XSConstants.DERIVATION_SUBSTITUTION);
- eDecl.setConstraintType(XSConstants.VC_NONE);
- return eDecl;
- }
-
- private XSParticleDecl createUnboundedModelGroupParticle() {
- XSParticleDecl particle = new XSParticleDecl();
- particle.fMinOccurs = 0;
- particle.fMaxOccurs = SchemaSymbols.OCCURRENCE_UNBOUNDED;
- particle.fType = XSParticleDecl.PARTICLE_MODELGROUP;
- return particle;
- }
-
- private XSParticleDecl createChoiceElementParticle(XSElementDecl ref) {
- XSParticleDecl particle = new XSParticleDecl();
- particle.fMinOccurs = 1;
- particle.fMaxOccurs = 1;
- particle.fType = XSParticleDecl.PARTICLE_ELEMENT;
- particle.fValue = ref;
- return particle;
- }
-
- private XSParticleDecl createUnboundedAnyWildcardSequenceParticle() {
- XSParticleDecl particle = createUnboundedModelGroupParticle();
- XSModelGroupImpl sequence = new XSModelGroupImpl();
- sequence.fCompositor = XSModelGroupImpl.MODELGROUP_SEQUENCE;
- sequence.fParticleCount = 1;
- sequence.fParticles = new XSParticleDecl[1];
- sequence.fParticles[0] = createAnyLaxWildcardParticle();
- particle.fValue = sequence;
- return particle;
- }
-
- private XSParticleDecl createAnyLaxWildcardParticle() {
- XSParticleDecl particle = new XSParticleDecl();
- particle.fMinOccurs = 1;
- particle.fMaxOccurs = 1;
- particle.fType = XSParticleDecl.PARTICLE_WILDCARD;
-
- XSWildcardDecl anyWC = new XSWildcardDecl();
- anyWC.fNamespaceList = null;
- anyWC.fType = XSWildcard.NSCONSTRAINT_ANY;
- anyWC.fProcessContents = XSWildcard.PC_LAX;
-
- particle.fValue = anyWC;
- return particle;
- }
- }
-
- // Grammar methods
-
- // return the XMLGrammarDescription corresponding to this
- // object
- public XMLGrammarDescription getGrammarDescription() {
- return fGrammarDescription;
- } // getGrammarDescription(): XMLGrammarDescription
-
- // DTDGrammar methods
- public boolean isNamespaceAware () {
- return true;
- } // isNamespaceAware():boolean
-
- Vector fImported = null;
-
- public void setImportedGrammars(Vector importedGrammars) {
- fImported = importedGrammars;
- }
-
- public Vector getImportedGrammars() {
- return fImported;
- }
-
- /**
- * Returns this grammar's target namespace.
- */
- public final String getTargetNamespace() {
- return fTargetNamespace;
- } // getTargetNamespace():String
-
- /**
- * register one global attribute
- */
- public void addGlobalAttributeDecl(XSAttributeDecl decl) {
- fGlobalAttrDecls.put(decl.fName, decl);
- decl.setNamespaceItem(this);
- }
-
- public void addGlobalAttributeDecl(XSAttributeDecl decl, String location) {
- fGlobalAttrDeclsExt.put(((location!=null) ? location : "") + "," + decl.fName, decl);
- if (decl.getNamespaceItem() == null) {
- decl.setNamespaceItem(this);
- }
- }
-
- /**
- * register one global attribute group
- */
- public void addGlobalAttributeGroupDecl(XSAttributeGroupDecl decl) {
- fGlobalAttrGrpDecls.put(decl.fName, decl);
- decl.setNamespaceItem(this);
- }
-
- public void addGlobalAttributeGroupDecl(XSAttributeGroupDecl decl, String location) {
- fGlobalAttrGrpDeclsExt.put(((location!=null) ? location : "") + "," + decl.fName, decl);
- if (decl.getNamespaceItem() == null) {
- decl.setNamespaceItem(this);
- }
- }
-
- /**
- * register one global element
- */
- public void addGlobalElementDeclAll(XSElementDecl decl) {
- if (fAllGlobalElemDecls.get(decl) == null) {
- fAllGlobalElemDecls.put(decl, decl);
- // if there is a substitution group affiliation, store in an array,
- // for further constraint checking: UPA, PD, EDC
- if (decl.fSubGroup != null) {
- if (fSubGroupCount == fSubGroups.length)
- fSubGroups = resize(fSubGroups, fSubGroupCount+INC_SIZE);
- fSubGroups[fSubGroupCount++] = decl;
- }
- }
- }
-
- public void addGlobalElementDecl(XSElementDecl decl) {
- fGlobalElemDecls.put(decl.fName, decl);
- decl.setNamespaceItem(this);
- }
-
- public void addGlobalElementDecl(XSElementDecl decl, String location) {
- fGlobalElemDeclsExt.put(((location != null) ? location : "") + "," + decl.fName, decl);
- if (decl.getNamespaceItem() == null) {
- decl.setNamespaceItem(this);
- }
- }
-
- /**
- * register one global group
- */
- public void addGlobalGroupDecl(XSGroupDecl decl) {
- fGlobalGroupDecls.put(decl.fName, decl);
- decl.setNamespaceItem(this);
- }
-
- public void addGlobalGroupDecl(XSGroupDecl decl, String location) {
- fGlobalGroupDeclsExt.put(((location!=null) ? location : "") + "," + decl.fName, decl);
- if (decl.getNamespaceItem() == null) {
- decl.setNamespaceItem(this);
- }
- }
-
- /**
- * register one global notation
- */
- public void addGlobalNotationDecl(XSNotationDecl decl) {
- fGlobalNotationDecls.put(decl.fName, decl);
- decl.setNamespaceItem(this);
- }
-
- public void addGlobalNotationDecl(XSNotationDecl decl, String location) {
- fGlobalNotationDeclsExt.put(((location!=null) ? location : "") + "," +decl.fName, decl);
- if (decl.getNamespaceItem() == null) {
- decl.setNamespaceItem(this);
- }
- }
-
- /**
- * register one global type
- */
- public void addGlobalTypeDecl(XSTypeDefinition decl) {
- fGlobalTypeDecls.put(decl.getName(), decl);
- if (decl instanceof XSComplexTypeDecl) {
- ((XSComplexTypeDecl) decl).setNamespaceItem(this);
- }
- else if (decl instanceof XSSimpleTypeDecl) {
- ((XSSimpleTypeDecl) decl).setNamespaceItem(this);
- }
- }
-
- public void addGlobalTypeDecl(XSTypeDefinition decl, String location) {
- fGlobalTypeDeclsExt.put(((location!=null) ? location : "") + "," + decl.getName(), decl);
- if (decl.getNamespaceItem() == null) {
- if (decl instanceof XSComplexTypeDecl) {
- ((XSComplexTypeDecl) decl).setNamespaceItem(this);
- }
- else if (decl instanceof XSSimpleTypeDecl) {
- ((XSSimpleTypeDecl) decl).setNamespaceItem(this);
- }
- }
- }
-
- /**
- * register one global complex type
- */
- public void addGlobalComplexTypeDecl(XSComplexTypeDecl decl) {
- fGlobalTypeDecls.put(decl.getName(), decl);
- decl.setNamespaceItem(this);
- }
-
- public void addGlobalComplexTypeDecl(XSComplexTypeDecl decl, String location) {
- fGlobalTypeDeclsExt.put(((location!=null) ? location : "") + "," + decl.getName(), decl);
- if (decl.getNamespaceItem() == null) {
- decl.setNamespaceItem(this);
- }
- }
-
- /**
- * register one global simple type
- */
- public void addGlobalSimpleTypeDecl(XSSimpleType decl) {
- fGlobalTypeDecls.put(decl.getName(), decl);
- if (decl instanceof XSSimpleTypeDecl) {
- ((XSSimpleTypeDecl) decl).setNamespaceItem(this);
- }
- }
-
- public void addGlobalSimpleTypeDecl(XSSimpleType decl, String location) {
- fGlobalTypeDeclsExt.put(((location != null) ? location : "") + "," + decl.getName(), decl);
- if (decl.getNamespaceItem() == null && decl instanceof XSSimpleTypeDecl) {
- ((XSSimpleTypeDecl) decl).setNamespaceItem(this);
- }
- }
-
- /**
- * register one identity constraint
- */
- public final void addIDConstraintDecl(XSElementDecl elmDecl, IdentityConstraint decl) {
- elmDecl.addIDConstraint(decl);
- fGlobalIDConstraintDecls.put(decl.getIdentityConstraintName(), decl);
- }
-
- public final void addIDConstraintDecl(XSElementDecl elmDecl, IdentityConstraint decl, String location) {
- fGlobalIDConstraintDeclsExt.put(((location != null) ? location : "") + "," + decl.getIdentityConstraintName(), decl);
- }
-
- /**
- * get one global attribute
- */
- public final XSAttributeDecl getGlobalAttributeDecl(String declName) {
- return(XSAttributeDecl)fGlobalAttrDecls.get(declName);
- }
-
- public final XSAttributeDecl getGlobalAttributeDecl(String declName, String location) {
- return(XSAttributeDecl)fGlobalAttrDeclsExt.get(((location != null) ? location : "") + "," + declName);
- }
-
- /**
- * get one global attribute group
- */
- public final XSAttributeGroupDecl getGlobalAttributeGroupDecl(String declName) {
- return(XSAttributeGroupDecl)fGlobalAttrGrpDecls.get(declName);
- }
-
- public final XSAttributeGroupDecl getGlobalAttributeGroupDecl(String declName, String location) {
- return(XSAttributeGroupDecl)fGlobalAttrGrpDeclsExt.get(((location != null) ? location : "") + "," + declName);
- }
-
- /**
- * get one global element
- */
- public final XSElementDecl getGlobalElementDecl(String declName) {
- return(XSElementDecl)fGlobalElemDecls.get(declName);
- }
-
- public final XSElementDecl getGlobalElementDecl(String declName, String location) {
- return(XSElementDecl)fGlobalElemDeclsExt.get(((location != null) ? location : "") + "," + declName);
- }
-
- /**
- * get one global group
- */
- public final XSGroupDecl getGlobalGroupDecl(String declName) {
- return(XSGroupDecl)fGlobalGroupDecls.get(declName);
- }
-
- public final XSGroupDecl getGlobalGroupDecl(String declName, String location) {
- return(XSGroupDecl)fGlobalGroupDeclsExt.get(((location != null) ? location : "") + "," + declName);
- }
-
- /**
- * get one global notation
- */
- public final XSNotationDecl getGlobalNotationDecl(String declName) {
- return(XSNotationDecl)fGlobalNotationDecls.get(declName);
- }
-
- public final XSNotationDecl getGlobalNotationDecl(String declName, String location) {
- return(XSNotationDecl)fGlobalNotationDeclsExt.get(((location != null) ? location : "") + "," + declName);
- }
-
- /**
- * get one global type
- */
- public final XSTypeDefinition getGlobalTypeDecl(String declName) {
- return(XSTypeDefinition)fGlobalTypeDecls.get(declName);
- }
-
- public final XSTypeDefinition getGlobalTypeDecl(String declName, String location) {
- return(XSTypeDefinition)fGlobalTypeDeclsExt.get(((location != null) ? location : "") + "," + declName);
- }
-
- /**
- * get one identity constraint
- */
- public final IdentityConstraint getIDConstraintDecl(String declName) {
- return(IdentityConstraint)fGlobalIDConstraintDecls.get(declName);
- }
-
- public final IdentityConstraint getIDConstraintDecl(String declName, String location) {
- return(IdentityConstraint)fGlobalIDConstraintDeclsExt.get(((location != null) ? location : "") + "," + declName);
- }
-
- /**
- * get one identity constraint
- */
- public final boolean hasIDConstraints() {
- return fGlobalIDConstraintDecls.getLength() > 0;
- }
-
- // array to store complex type decls
- private static final int INITIAL_SIZE = 16;
- private static final int INC_SIZE = 16;
-
- private int fCTCount = 0;
- private XSComplexTypeDecl[] fComplexTypeDecls = new XSComplexTypeDecl[INITIAL_SIZE];
- private SimpleLocator[] fCTLocators = new SimpleLocator[INITIAL_SIZE];
-
- // an array to store groups being redefined by restriction
- // even-numbered elements are the derived groups, odd-numbered ones their bases
- private static final int REDEFINED_GROUP_INIT_SIZE = 2;
- private int fRGCount = 0;
- private XSGroupDecl[] fRedefinedGroupDecls = new XSGroupDecl[REDEFINED_GROUP_INIT_SIZE];
- private SimpleLocator[] fRGLocators = new SimpleLocator[REDEFINED_GROUP_INIT_SIZE/2];
-
- // a flag to indicate whether we have checked the 3 constraints on this
- // grammar.
- boolean fFullChecked = false;
-
- /**
- * add one complex type decl: for later constraint checking
- */
- public void addComplexTypeDecl(XSComplexTypeDecl decl, SimpleLocator locator) {
- if (fCTCount == fComplexTypeDecls.length) {
- fComplexTypeDecls = resize(fComplexTypeDecls, fCTCount+INC_SIZE);
- fCTLocators = resize(fCTLocators, fCTCount+INC_SIZE);
- }
- fCTLocators[fCTCount] = locator;
- fComplexTypeDecls[fCTCount++] = decl;
- }
-
- /**
- * add a group redefined by restriction: for later constraint checking
- */
- public void addRedefinedGroupDecl(XSGroupDecl derived, XSGroupDecl base, SimpleLocator locator) {
- if (fRGCount == fRedefinedGroupDecls.length) {
- // double array size each time.
- fRedefinedGroupDecls = resize(fRedefinedGroupDecls, fRGCount << 1);
- fRGLocators = resize(fRGLocators, fRGCount);
- }
- fRGLocators[fRGCount/2] = locator;
- fRedefinedGroupDecls[fRGCount++] = derived;
- fRedefinedGroupDecls[fRGCount++] = base;
- }
-
- /**
- * get all complex type decls: for later constraint checking
- */
- final XSComplexTypeDecl[] getUncheckedComplexTypeDecls() {
- if (fCTCount < fComplexTypeDecls.length) {
- fComplexTypeDecls = resize(fComplexTypeDecls, fCTCount);
- fCTLocators = resize(fCTLocators, fCTCount);
- }
- return fComplexTypeDecls;
- }
-
- /**
- * get the error locator of all complex type decls
- */
- final SimpleLocator[] getUncheckedCTLocators() {
- if (fCTCount < fCTLocators.length) {
- fComplexTypeDecls = resize(fComplexTypeDecls, fCTCount);
- fCTLocators = resize(fCTLocators, fCTCount);
- }
- return fCTLocators;
- }
-
- /**
- * get all redefined groups: for later constraint checking
- */
- final XSGroupDecl[] getRedefinedGroupDecls() {
- if (fRGCount < fRedefinedGroupDecls.length) {
- fRedefinedGroupDecls = resize(fRedefinedGroupDecls, fRGCount);
- fRGLocators = resize(fRGLocators, fRGCount/2);
- }
- return fRedefinedGroupDecls;
- }
-
- /**
- * get the error locator of all redefined groups
- */
- final SimpleLocator[] getRGLocators() {
- if (fRGCount < fRedefinedGroupDecls.length) {
- fRedefinedGroupDecls = resize(fRedefinedGroupDecls, fRGCount);
- fRGLocators = resize(fRGLocators, fRGCount/2);
- }
- return fRGLocators;
- }
-
- /**
- * after the first-round checking, some types don't need to be checked
- * against UPA again. here we trim the array to the proper size.
- */
- final void setUncheckedTypeNum(int newSize) {
- fCTCount = newSize;
- fComplexTypeDecls = resize(fComplexTypeDecls, fCTCount);
- fCTLocators = resize(fCTLocators, fCTCount);
- }
-
- // used to store all substitution group information declared in
- // this namespace
- private int fSubGroupCount = 0;
- private XSElementDecl[] fSubGroups = new XSElementDecl[INITIAL_SIZE];
-
- /**
- * get all substitution group information: for the 3 constraint checking
- */
- final XSElementDecl[] getSubstitutionGroups() {
- if (fSubGroupCount < fSubGroups.length)
- fSubGroups = resize(fSubGroups, fSubGroupCount);
- return fSubGroups;
- }
-
- // anyType and anySimpleType: because there are so many places where
- // we need direct access to these two types
- public final static XSComplexTypeDecl fAnyType = new XSAnyType();
- private static class XSAnyType extends XSComplexTypeDecl {
- public XSAnyType () {
- fName = SchemaSymbols.ATTVAL_ANYTYPE;
- super.fTargetNamespace = SchemaSymbols.URI_SCHEMAFORSCHEMA;
- fBaseType = this;
- fDerivedBy = XSConstants.DERIVATION_RESTRICTION;
- fContentType = XSComplexTypeDecl.CONTENTTYPE_MIXED;
-
- fParticle = null;
- fAttrGrp = null;
- }
-
- // overridden methods
- public void setValues(String name, String targetNamespace,
- XSTypeDefinition baseType, short derivedBy, short schemaFinal,
- short block, short contentType,
- boolean isAbstract, XSAttributeGroupDecl attrGrp,
- XSSimpleType simpleType, XSParticleDecl particle) {
- // don't allow this.
- }
-
- public void setName(String name){
- // don't allow this.
- }
-
- public void setIsAbstractType() {
- // null implementation
- }
-
- public void setContainsTypeID() {
- // null implementation
- }
-
- public void setIsAnonymous() {
- // null implementation
- }
-
- public void reset() {
- // null implementation
- }
-
- public XSObjectList getAttributeUses() {
- return XSObjectListImpl.EMPTY_LIST;
- }
-
- public XSAttributeGroupDecl getAttrGrp() {
- XSWildcardDecl wildcard = new XSWildcardDecl();
- wildcard.fProcessContents = XSWildcardDecl.PC_LAX;
- XSAttributeGroupDecl attrGrp = new XSAttributeGroupDecl();
- attrGrp.fAttributeWC = wildcard;
- return attrGrp;
- }
-
- public XSWildcard getAttributeWildcard() {
- XSWildcardDecl wildcard = new XSWildcardDecl();
- wildcard.fProcessContents = XSWildcardDecl.PC_LAX;
- return wildcard;
- }
-
- public XSParticle getParticle() {
- // the wildcard used in anyType (content and attribute)
- // the spec will change strict to skip for anyType
- XSWildcardDecl wildcard = new XSWildcardDecl();
- wildcard.fProcessContents = XSWildcardDecl.PC_LAX;
- // the particle for the content wildcard
- XSParticleDecl particleW = new XSParticleDecl();
- particleW.fMinOccurs = 0;
- particleW.fMaxOccurs = SchemaSymbols.OCCURRENCE_UNBOUNDED;
- particleW.fType = XSParticleDecl.PARTICLE_WILDCARD;
- particleW.fValue = wildcard;
- // the model group of a sequence of the above particle
- XSModelGroupImpl group = new XSModelGroupImpl();
- group.fCompositor = XSModelGroupImpl.MODELGROUP_SEQUENCE;
- group.fParticleCount = 1;
- group.fParticles = new XSParticleDecl[1];
- group.fParticles[0] = particleW;
- // the content of anyType: particle of the above model group
- XSParticleDecl particleG = new XSParticleDecl();
- particleG.fType = XSParticleDecl.PARTICLE_MODELGROUP;
- particleG.fValue = group;
-
- return particleG;
- }
-
- public XSObjectList getAnnotations() {
- return XSObjectListImpl.EMPTY_LIST;
- }
-
- public XSNamespaceItem getNamespaceItem() {
- return SG_SchemaNS;
- }
- }
- private static class BuiltinAttrDecl extends XSAttributeDecl {
- public BuiltinAttrDecl(String name, String tns,
- XSSimpleType type, short scope) {
- fName = name;
- super.fTargetNamespace = tns;
- fType = type;
- fScope = scope;
- }
-
- public void setValues(String name, String targetNamespace,
- XSSimpleType simpleType, short constraintType, short scope,
- ValidatedInfo valInfo, XSComplexTypeDecl enclosingCT) {
- // ignore this call.
- }
-
- public void reset () {
- // also ignore this call.
- }
-
- public XSAnnotation getAnnotation() {
- return null;
- }
-
- public XSNamespaceItem getNamespaceItem() {
- return SG_XSI;
- }
-
- } // class BuiltinAttrDecl
-
- // the grammars to hold components of the schema namespace
- public final static BuiltinSchemaGrammar SG_SchemaNS = new BuiltinSchemaGrammar(GRAMMAR_XS, Constants.SCHEMA_VERSION_1_0);
- private final static BuiltinSchemaGrammar SG_SchemaNSExtended = new BuiltinSchemaGrammar(GRAMMAR_XS, Constants.SCHEMA_VERSION_1_0_EXTENDED);
-
- public final static XSSimpleType fAnySimpleType = (XSSimpleType)SG_SchemaNS.getGlobalTypeDecl(SchemaSymbols.ATTVAL_ANYSIMPLETYPE);
-
- // the grammars to hold components of the schema-instance namespace
- public final static BuiltinSchemaGrammar SG_XSI = new BuiltinSchemaGrammar(GRAMMAR_XSI, Constants.SCHEMA_VERSION_1_0);
-
- public static SchemaGrammar getS4SGrammar(short schemaVersion) {
- if (schemaVersion == Constants.SCHEMA_VERSION_1_0) {
- return SG_SchemaNS;
- }
- else {
- return SG_SchemaNSExtended;
- }
- }
-
- static final XSComplexTypeDecl[] resize(XSComplexTypeDecl[] oldArray, int newSize) {
- XSComplexTypeDecl[] newArray = new XSComplexTypeDecl[newSize];
- System.arraycopy(oldArray, 0, newArray, 0, Math.min(oldArray.length, newSize));
- return newArray;
- }
-
- static final XSGroupDecl[] resize(XSGroupDecl[] oldArray, int newSize) {
- XSGroupDecl[] newArray = new XSGroupDecl[newSize];
- System.arraycopy(oldArray, 0, newArray, 0, Math.min(oldArray.length, newSize));
- return newArray;
- }
-
- static final XSElementDecl[] resize(XSElementDecl[] oldArray, int newSize) {
- XSElementDecl[] newArray = new XSElementDecl[newSize];
- System.arraycopy(oldArray, 0, newArray, 0, Math.min(oldArray.length, newSize));
- return newArray;
- }
-
- static final SimpleLocator[] resize(SimpleLocator[] oldArray, int newSize) {
- SimpleLocator[] newArray = new SimpleLocator[newSize];
- System.arraycopy(oldArray, 0, newArray, 0, Math.min(oldArray.length, newSize));
- return newArray;
- }
-
- // XSNamespaceItem methods
-
- // the max index / the max value of XSObject type
- private static final short MAX_COMP_IDX = XSTypeDefinition.SIMPLE_TYPE;
- private static final boolean[] GLOBAL_COMP = {false, // null
- true, // attribute
- true, // element
- true, // type
- false, // attribute use
- true, // attribute group
- true, // group
- false, // model group
- false, // particle
- false, // wildcard
- false, // idc
- true, // notation
- false, // annotation
- false, // facet
- false, // multi value facet
- true, // complex type
- true // simple type
- };
-
- // store a certain kind of components from all namespaces
- private XSNamedMap[] fComponents = null;
- private ObjectList[] fComponentsExt = null;
-
- // store the documents and their locations contributing to this namespace
- // REVISIT: use StringList and XSObjectList for there fields.
- private Vector fDocuments = null;
- private Vector fLocations = null;
-
- public synchronized void addDocument(Object document, String location) {
- if (fDocuments == null) {
- fDocuments = new Vector();
- fLocations = new Vector();
- }
- fDocuments.addElement(document);
- fLocations.addElement(location);
- }
-
- public synchronized void removeDocument(int index) {
- if (fDocuments != null &&
- index >= 0 &&
- index < fDocuments.size()) {
- fDocuments.removeElementAt(index);
- fLocations.removeElementAt(index);
- }
- }
-
- /**
- * [schema namespace]
- * @see <a href="http://www.w3.org/TR/xmlschema-1/#nsi-schema_namespace">[schema namespace]</a>
- * @return The target namespace of this item.
- */
- public String getSchemaNamespace() {
- return fTargetNamespace;
- }
-
- // annotation support
- synchronized DOMParser getDOMParser() {
- if (fDOMParser != null) {
- DOMParser parser = (DOMParser) fDOMParser.get();
- if (parser != null) {
- return parser;
- }
- }
- // REVISIT: when schema handles XML 1.1, will need to
- // revisit this (and the practice of not prepending an XML decl to the annotation string
- XML11Configuration config = new XML11Configuration(fSymbolTable);
- // note that this should never produce errors or require
- // entity resolution, so just a barebones configuration with
- // a couple of feature set will do fine
- config.setFeature(Constants.SAX_FEATURE_PREFIX + Constants.NAMESPACES_FEATURE, true);
- config.setFeature(Constants.SAX_FEATURE_PREFIX + Constants.VALIDATION_FEATURE, false);
-
- DOMParser parser = new DOMParser(config);
- try {
- parser.setFeature(Constants.XERCES_FEATURE_PREFIX + Constants.DEFER_NODE_EXPANSION_FEATURE, false);
- }
- catch (SAXException exc) {}
- fDOMParser = new SoftReference(parser);
- return parser;
- }
-
- synchronized SAXParser getSAXParser() {
- if (fSAXParser != null) {
- SAXParser parser = (SAXParser) fSAXParser.get();
- if (parser != null) {
- return parser;
- }
- }
- // REVISIT: when schema handles XML 1.1, will need to
- // revisit this (and the practice of not prepending an XML decl to the annotation string
- XML11Configuration config = new XML11Configuration(fSymbolTable);
- // note that this should never produce errors or require
- // entity resolution, so just a barebones configuration with
- // a couple of feature set will do fine
- config.setFeature(Constants.SAX_FEATURE_PREFIX + Constants.NAMESPACES_FEATURE, true);
- config.setFeature(Constants.SAX_FEATURE_PREFIX + Constants.VALIDATION_FEATURE, false);
- SAXParser parser = new SAXParser(config);
- fSAXParser = new SoftReference(parser);
- return parser;
- }
-
- /**
- * [schema components]: a list of top-level components, i.e. element
- * declarations, attribute declarations, etc.
- * @param objectType The type of the declaration, i.e.
- * <code>ELEMENT_DECLARATION</code>. Note that
- * <code>XSTypeDefinition.SIMPLE_TYPE</code> and
- * <code>XSTypeDefinition.COMPLEX_TYPE</code> can also be used as the
- * <code>objectType</code> to retrieve only complex types or simple
- * types, instead of all types.
- * @return A list of top-level definition of the specified type in
- * <code>objectType</code> or an empty <code>XSNamedMap</code> if no
- * such definitions exist.
- */
- public synchronized XSNamedMap getComponents(short objectType) {
- if (objectType <= 0 || objectType > MAX_COMP_IDX ||
- !GLOBAL_COMP[objectType]) {
- return XSNamedMapImpl.EMPTY_MAP;
- }
-
- if (fComponents == null)
- fComponents = new XSNamedMap[MAX_COMP_IDX+1];
-
- // get the hashtable for this type of components
- if (fComponents[objectType] == null) {
- SymbolHash table = null;
- switch (objectType) {
- case XSConstants.TYPE_DEFINITION:
- case XSTypeDefinition.COMPLEX_TYPE:
- case XSTypeDefinition.SIMPLE_TYPE:
- table = fGlobalTypeDecls;
- break;
- case XSConstants.ATTRIBUTE_DECLARATION:
- table = fGlobalAttrDecls;
- break;
- case XSConstants.ELEMENT_DECLARATION:
- table = fGlobalElemDecls;
- break;
- case XSConstants.ATTRIBUTE_GROUP:
- table = fGlobalAttrGrpDecls;
- break;
- case XSConstants.MODEL_GROUP_DEFINITION:
- table = fGlobalGroupDecls;
- break;
- case XSConstants.NOTATION_DECLARATION:
- table = fGlobalNotationDecls;
- break;
- }
-
- // for complex/simple types, create a special implementation,
- // which take specific types out of the hash table
- if (objectType == XSTypeDefinition.COMPLEX_TYPE ||
- objectType == XSTypeDefinition.SIMPLE_TYPE) {
- fComponents[objectType] = new XSNamedMap4Types(fTargetNamespace, table, objectType);
- }
- else {
- fComponents[objectType] = new XSNamedMapImpl(fTargetNamespace, table);
- }
- }
-
- return fComponents[objectType];
- }
-
- public synchronized ObjectList getComponentsExt(short objectType) {
- if (objectType <= 0 || objectType > MAX_COMP_IDX ||
- !GLOBAL_COMP[objectType]) {
- return ObjectListImpl.EMPTY_LIST;
- }
-
- if (fComponentsExt == null)
- fComponentsExt = new ObjectList[MAX_COMP_IDX+1];
-
- // get the hashtable for this type of components
- if (fComponentsExt[objectType] == null) {
- SymbolHash table = null;
- switch (objectType) {
- case XSConstants.TYPE_DEFINITION:
- case XSTypeDefinition.COMPLEX_TYPE:
- case XSTypeDefinition.SIMPLE_TYPE:
- table = fGlobalTypeDeclsExt;
- break;
- case XSConstants.ATTRIBUTE_DECLARATION:
- table = fGlobalAttrDeclsExt;
- break;
- case XSConstants.ELEMENT_DECLARATION:
- table = fGlobalElemDeclsExt;
- break;
- case XSConstants.ATTRIBUTE_GROUP:
- table = fGlobalAttrGrpDeclsExt;
- break;
- case XSConstants.MODEL_GROUP_DEFINITION:
- table = fGlobalGroupDeclsExt;
- break;
- case XSConstants.NOTATION_DECLARATION:
- table = fGlobalNotationDeclsExt;
- break;
- }
-
- Object[] entries = table.getEntries();
- fComponentsExt[objectType] = new ObjectListImpl(entries, entries.length);
- }
-
- return fComponentsExt[objectType];
- }
-
- public synchronized void resetComponents() {
- fComponents = null;
- fComponentsExt = null;
- }
-
- /**
- * Convenience method. Returns a top-level simple or complex type
- * definition.
- * @param name The name of the definition.
- * @return An <code>XSTypeDefinition</code> or null if such definition
- * does not exist.
- */
- public XSTypeDefinition getTypeDefinition(String name) {
- return getGlobalTypeDecl(name);
- }
-
- /**
- * Convenience method. Returns a top-level attribute declaration.
- * @param name The name of the declaration.
- * @return A top-level attribute declaration or null if such declaration
- * does not exist.
- */
- public XSAttributeDeclaration getAttributeDeclaration(String name) {
- return getGlobalAttributeDecl(name);
- }
-
- /**
- * Convenience method. Returns a top-level element declaration.
- * @param name The name of the declaration.
- * @return A top-level element declaration or null if such declaration
- * does not exist.
- */
- public XSElementDeclaration getElementDeclaration(String name) {
- return getGlobalElementDecl(name);
- }
-
- /**
- * Convenience method. Returns a top-level attribute group definition.
- * @param name The name of the definition.
- * @return A top-level attribute group definition or null if such
- * definition does not exist.
- */
- public XSAttributeGroupDefinition getAttributeGroup(String name) {
- return getGlobalAttributeGroupDecl(name);
- }
-
- /**
- * Convenience method. Returns a top-level model group definition.
- *
- * @param name The name of the definition.
- * @return A top-level model group definition definition or null if such
- * definition does not exist.
- */
- public XSModelGroupDefinition getModelGroupDefinition(String name) {
- return getGlobalGroupDecl(name);
- }
-
- /**
- * Convenience method. Returns a top-level notation declaration.
- *
- * @param name The name of the declaration.
- * @return A top-level notation declaration or null if such declaration
- * does not exist.
- */
- public XSNotationDeclaration getNotationDeclaration(String name) {
- return getGlobalNotationDecl(name);
- }
-
-
- /**
- * [document location]
- * @see <a href="http://www.w3.org/TR/xmlschema-1/#sd-document_location">[document location]</a>
- * @return a list of document information item
- */
- public StringList getDocumentLocations() {
- return new StringListImpl(fLocations);
- }
-
- /**
- * Return an <code>XSModel</code> that represents components in this schema
- * grammar.
- *
- * @return an <code>XSModel</code> representing this schema grammar
- */
- public XSModel toXSModel() {
- return new XSModelImpl(new SchemaGrammar[]{this});
- }
-
- public XSModel toXSModel(XSGrammar[] grammars) {
- if (grammars == null || grammars.length == 0)
- return toXSModel();
-
- int len = grammars.length;
- boolean hasSelf = false;
- for (int i = 0; i < len; i++) {
- if (grammars[i] == this) {
- hasSelf = true;
- break;
- }
- }
-
- SchemaGrammar[] gs = new SchemaGrammar[hasSelf ? len : len+1];
- for (int i = 0; i < len; i++)
- gs[i] = (SchemaGrammar)grammars[i];
- if (!hasSelf)
- gs[len] = this;
- return new XSModelImpl(gs);
- }
-
- /**
- * @see org.apache.xerces.xs.XSNamespaceItem#getAnnotations()
- */
- public XSObjectList getAnnotations() {
- if (fNumAnnotations == 0) {
- return XSObjectListImpl.EMPTY_LIST;
- }
- return new XSObjectListImpl(fAnnotations, fNumAnnotations);
- }
-
- public void addAnnotation(XSAnnotationImpl annotation) {
- if (annotation == null) {
- return;
- }
- if (fAnnotations == null) {
- fAnnotations = new XSAnnotationImpl[2];
- }
- else if (fNumAnnotations == fAnnotations.length) {
- XSAnnotationImpl[] newArray = new XSAnnotationImpl[fNumAnnotations << 1];
- System.arraycopy(fAnnotations, 0, newArray, 0, fNumAnnotations);
- fAnnotations = newArray;
- }
- fAnnotations[fNumAnnotations++] = annotation;
- }
-
- public void setImmutable(boolean isImmutable) {
- fIsImmutable = isImmutable;
- }
-
- public boolean isImmutable() {
- return fIsImmutable;
- }
-
-} // class SchemaGrammar
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/SchemaNamespaceSupport.java b/src/com/sun/org/apache/xerces/internal/impl/xs/SchemaNamespaceSupport.java
deleted file mode 100644
index 5909875..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/SchemaNamespaceSupport.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2000-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs;
-
-import com.sun.org.apache.xerces.internal.util.NamespaceSupport;
-
-/**
- * This class customizes the behaviour of the util.NamespaceSupport
- * class in order to easily implement some features that we need for
- * efficient schema handling. It will not be generally useful.
- *
- * @xerces.internal
- *
- * @author Neil Graham, IBM
- *
- */
-public class SchemaNamespaceSupport
- extends NamespaceSupport {
-
- public SchemaNamespaceSupport () {
- super();
- } // constructor
-
- // more effecient than NamespaceSupport(NamespaceContext)
- public SchemaNamespaceSupport(SchemaNamespaceSupport nSupport) {
- fNamespaceSize = nSupport.fNamespaceSize;
- if (fNamespace.length < fNamespaceSize)
- fNamespace = new String[fNamespaceSize];
- System.arraycopy(nSupport.fNamespace, 0, fNamespace, 0, fNamespaceSize);
- fCurrentContext = nSupport.fCurrentContext;
- if (fContext.length <= fCurrentContext)
- fContext = new int[fCurrentContext+1];
- System.arraycopy(nSupport.fContext, 0, fContext, 0, fCurrentContext+1);
- } // end constructor
-
- /**
- * This method takes a set of Strings, as stored in a
- * NamespaceSupport object, and "fools" the object into thinking
- * that this is one unified context. This is meant to be used in
- * conjunction with things like local elements, whose declarations
- * may be deeply nested but which for all practical purposes may
- * be regarded as being one level below the global <schema>
- * element--at least with regard to namespace declarations.
- * It's worth noting that the context from which the strings are
- * being imported had better be using the same SymbolTable.
- */
- public void setEffectiveContext (String [] namespaceDecls) {
- if(namespaceDecls == null || namespaceDecls.length == 0) return;
- pushContext();
- int newSize = fNamespaceSize + namespaceDecls.length;
- if (fNamespace.length < newSize) {
- // expand namespace's size...
- String[] tempNSArray = new String[newSize];
- System.arraycopy(fNamespace, 0, tempNSArray, 0, fNamespace.length);
- fNamespace = tempNSArray;
- }
- System.arraycopy(namespaceDecls, 0, fNamespace, fNamespaceSize,
- namespaceDecls.length);
- fNamespaceSize = newSize;
- } // setEffectiveContext(String):void
-
- /**
- * This method returns an array of Strings, as would be stored in
- * a NamespaceSupport object. This array contains all
- * declarations except those at the global level.
- */
- public String [] getEffectiveLocalContext() {
- // the trick here is to recognize that all local contexts
- // happen to start at fContext[3].
- // context 1: empty
- // context 2: decls for xml and xmlns;
- // context 3: decls on <xs:schema>: the global ones
- String[] returnVal = null;
- if (fCurrentContext >= 3) {
- int bottomLocalContext = fContext[3];
- int copyCount = fNamespaceSize - bottomLocalContext;
- if (copyCount > 0) {
- returnVal = new String[copyCount];
- System.arraycopy(fNamespace, bottomLocalContext, returnVal, 0,
- copyCount);
- }
- }
- return returnVal;
- } // getEffectiveLocalContext():String
-
- // This method removes from this object all the namespaces
- // returned by getEffectiveLocalContext.
- public void makeGlobal() {
- if (fCurrentContext >= 3) {
- fCurrentContext = 3;
- fNamespaceSize = fContext[3];
- }
- } // makeGlobal
-} // class NamespaceSupport
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/SchemaSymbols.java b/src/com/sun/org/apache/xerces/internal/impl/xs/SchemaSymbols.java
deleted file mode 100644
index 2e8205c..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/SchemaSymbols.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2000-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs;
-
-
-/**
- * Collection of symbols used to parse a Schema Grammar.
- *
- * @xerces.internal
- *
- * @author jeffrey rodriguez
- */
-public final class SchemaSymbols {
-
- // strings that's not added to the schema symbol table, because they
- // are not symbols in the schema document.
- // the validator can choose to add them by itself.
-
- // the following strings (xsi:, xsd) will be added into the
- // symbol table that comes with the parser
-
- // xsi attributes: in validator
- public static final String URI_XSI = "http://www.w3.org/2001/XMLSchema-instance".intern();
- public static final String XSI_SCHEMALOCATION = "schemaLocation".intern();
- public static final String XSI_NONAMESPACESCHEMALOCATION = "noNamespaceSchemaLocation".intern();
- public static final String XSI_TYPE = "type".intern();
- public static final String XSI_NIL = "nil".intern();
-
- // schema namespace
- public static final String URI_SCHEMAFORSCHEMA = "http://www.w3.org/2001/XMLSchema".intern();
-
- // all possible schema element names
- public static final String ELT_ALL = "all".intern();
- public static final String ELT_ANNOTATION = "annotation".intern();
- public static final String ELT_ANY = "any".intern();
- public static final String ELT_ANYATTRIBUTE = "anyAttribute".intern();
- public static final String ELT_APPINFO = "appinfo".intern();
- public static final String ELT_ATTRIBUTE = "attribute".intern();
- public static final String ELT_ATTRIBUTEGROUP = "attributeGroup".intern();
- public static final String ELT_CHOICE = "choice".intern();
- public static final String ELT_COMPLEXCONTENT = "complexContent".intern();
- public static final String ELT_COMPLEXTYPE = "complexType".intern();
- public static final String ELT_DOCUMENTATION = "documentation".intern();
- public static final String ELT_ELEMENT = "element".intern();
- public static final String ELT_ENUMERATION = "enumeration".intern();
- public static final String ELT_EXTENSION = "extension".intern();
- public static final String ELT_FIELD = "field".intern();
- public static final String ELT_FRACTIONDIGITS = "fractionDigits".intern();
- public static final String ELT_GROUP = "group".intern();
- public static final String ELT_IMPORT = "import".intern();
- public static final String ELT_INCLUDE = "include".intern();
- public static final String ELT_KEY = "key".intern();
- public static final String ELT_KEYREF = "keyref".intern();
- public static final String ELT_LENGTH = "length".intern();
- public static final String ELT_LIST = "list".intern();
- public static final String ELT_MAXEXCLUSIVE = "maxExclusive".intern();
- public static final String ELT_MAXINCLUSIVE = "maxInclusive".intern();
- public static final String ELT_MAXLENGTH = "maxLength".intern();
- public static final String ELT_MINEXCLUSIVE = "minExclusive".intern();
- public static final String ELT_MININCLUSIVE = "minInclusive".intern();
- public static final String ELT_MINLENGTH = "minLength".intern();
- public static final String ELT_NOTATION = "notation".intern();
- public static final String ELT_PATTERN = "pattern".intern();
- public static final String ELT_REDEFINE = "redefine".intern();
- public static final String ELT_RESTRICTION = "restriction".intern();
- public static final String ELT_SCHEMA = "schema".intern();
- public static final String ELT_SELECTOR = "selector".intern();
- public static final String ELT_SEQUENCE = "sequence".intern();
- public static final String ELT_SIMPLECONTENT = "simpleContent".intern();
- public static final String ELT_SIMPLETYPE = "simpleType".intern();
- public static final String ELT_TOTALDIGITS = "totalDigits".intern();
- public static final String ELT_UNION = "union".intern();
- public static final String ELT_UNIQUE = "unique".intern();
- public static final String ELT_WHITESPACE = "whiteSpace".intern();
-
- // all possible schema attribute names (and xml:lang defined on <schema> and <documentation>)
- public static final String ATT_ABSTRACT = "abstract".intern();
- public static final String ATT_ATTRIBUTEFORMDEFAULT = "attributeFormDefault".intern();
- public static final String ATT_BASE = "base".intern();
- public static final String ATT_BLOCK = "block".intern();
- public static final String ATT_BLOCKDEFAULT = "blockDefault".intern();
- public static final String ATT_DEFAULT = "default".intern();
- public static final String ATT_ELEMENTFORMDEFAULT = "elementFormDefault".intern();
- public static final String ATT_FINAL = "final".intern();
- public static final String ATT_FINALDEFAULT = "finalDefault".intern();
- public static final String ATT_FIXED = "fixed".intern();
- public static final String ATT_FORM = "form".intern();
- public static final String ATT_ID = "id".intern();
- public static final String ATT_ITEMTYPE = "itemType".intern();
- public static final String ATT_MAXOCCURS = "maxOccurs".intern();
- public static final String ATT_MEMBERTYPES = "memberTypes".intern();
- public static final String ATT_MINOCCURS = "minOccurs".intern();
- public static final String ATT_MIXED = "mixed".intern();
- public static final String ATT_NAME = "name".intern();
- public static final String ATT_NAMESPACE = "namespace".intern();
- public static final String ATT_NILLABLE = "nillable".intern();
- public static final String ATT_PROCESSCONTENTS = "processContents".intern();
- public static final String ATT_REF = "ref".intern();
- public static final String ATT_REFER = "refer".intern();
- public static final String ATT_SCHEMALOCATION = "schemaLocation".intern();
- public static final String ATT_SOURCE = "source".intern();
- public static final String ATT_SUBSTITUTIONGROUP = "substitutionGroup".intern();
- public static final String ATT_SYSTEM = "system".intern();
- public static final String ATT_PUBLIC = "public".intern();
- public static final String ATT_TARGETNAMESPACE = "targetNamespace".intern();
- public static final String ATT_TYPE = "type".intern();
- public static final String ATT_USE = "use".intern();
- public static final String ATT_VALUE = "value".intern();
- public static final String ATT_VERSION = "version".intern();
- public static final String ATT_XML_LANG = "xml:lang".intern();
- public static final String ATT_XPATH = "xpath".intern();
-
- // all possible schema attribute values
- public static final String ATTVAL_TWOPOUNDANY = "##any";
- public static final String ATTVAL_TWOPOUNDLOCAL = "##local";
- public static final String ATTVAL_TWOPOUNDOTHER = "##other";
- public static final String ATTVAL_TWOPOUNDTARGETNS = "##targetNamespace";
- public static final String ATTVAL_POUNDALL = "#all";
- public static final String ATTVAL_FALSE_0 = "0";
- public static final String ATTVAL_TRUE_1 = "1";
- public static final String ATTVAL_ANYSIMPLETYPE = "anySimpleType";
- public static final String ATTVAL_ANYTYPE = "anyType";
- public static final String ATTVAL_ANYURI = "anyURI";
- public static final String ATTVAL_BASE64BINARY = "base64Binary";
- public static final String ATTVAL_BOOLEAN = "boolean";
- public static final String ATTVAL_BYTE = "byte";
- public static final String ATTVAL_COLLAPSE = "collapse";
- public static final String ATTVAL_DATE = "date";
- public static final String ATTVAL_DATETIME = "dateTime";
- public static final String ATTVAL_DAY = "gDay";
- public static final String ATTVAL_DECIMAL = "decimal";
- public static final String ATTVAL_DOUBLE = "double";
- public static final String ATTVAL_DURATION = "duration";
- public static final String ATTVAL_ENTITY = "ENTITY";
- public static final String ATTVAL_ENTITIES = "ENTITIES";
- public static final String ATTVAL_EXTENSION = "extension";
- public static final String ATTVAL_FALSE = "false";
- public static final String ATTVAL_FLOAT = "float";
- public static final String ATTVAL_HEXBINARY = "hexBinary";
- public static final String ATTVAL_ID = "ID";
- public static final String ATTVAL_IDREF = "IDREF";
- public static final String ATTVAL_IDREFS = "IDREFS";
- public static final String ATTVAL_INT = "int";
- public static final String ATTVAL_INTEGER = "integer";
- public static final String ATTVAL_LANGUAGE = "language";
- public static final String ATTVAL_LAX = "lax";
- public static final String ATTVAL_LIST = "list";
- public static final String ATTVAL_LONG = "long";
- public static final String ATTVAL_NAME = "Name";
- public static final String ATTVAL_NEGATIVEINTEGER = "negativeInteger";
- public static final String ATTVAL_MONTH = "gMonth";
- public static final String ATTVAL_MONTHDAY = "gMonthDay";
- public static final String ATTVAL_NCNAME = "NCName";
- public static final String ATTVAL_NMTOKEN = "NMTOKEN";
- public static final String ATTVAL_NMTOKENS = "NMTOKENS";
- public static final String ATTVAL_NONNEGATIVEINTEGER= "nonNegativeInteger";
- public static final String ATTVAL_NONPOSITIVEINTEGER= "nonPositiveInteger";
- public static final String ATTVAL_NORMALIZEDSTRING = "normalizedString";
- public static final String ATTVAL_NOTATION = "NOTATION";
- public static final String ATTVAL_OPTIONAL = "optional";
- public static final String ATTVAL_POSITIVEINTEGER = "positiveInteger";
- public static final String ATTVAL_PRESERVE = "preserve";
- public static final String ATTVAL_PROHIBITED = "prohibited";
- public static final String ATTVAL_QNAME = "QName";
- public static final String ATTVAL_QUALIFIED = "qualified";
- public static final String ATTVAL_REPLACE = "replace";
- public static final String ATTVAL_REQUIRED = "required";
- public static final String ATTVAL_RESTRICTION = "restriction";
- public static final String ATTVAL_SHORT = "short";
- public static final String ATTVAL_SKIP = "skip";
- public static final String ATTVAL_STRICT = "strict";
- public static final String ATTVAL_STRING = "string";
- public static final String ATTVAL_SUBSTITUTION = "substitution";
- public static final String ATTVAL_TIME = "time";
- public static final String ATTVAL_TOKEN = "token";
- public static final String ATTVAL_TRUE = "true";
- public static final String ATTVAL_UNBOUNDED = "unbounded";
- public static final String ATTVAL_UNION = "union";
- public static final String ATTVAL_UNQUALIFIED = "unqualified";
- public static final String ATTVAL_UNSIGNEDBYTE = "unsignedByte";
- public static final String ATTVAL_UNSIGNEDINT = "unsignedInt";
- public static final String ATTVAL_UNSIGNEDLONG = "unsignedLong";
- public static final String ATTVAL_UNSIGNEDSHORT = "unsignedShort";
- public static final String ATTVAL_YEAR = "gYear";
- public static final String ATTVAL_YEARMONTH = "gYearMonth";
-
- // form qualified/unqualified
- public static final short FORM_UNQUALIFIED = 0;
- public static final short FORM_QUALIFIED = 1;
-
- // attribute use
- public static final short USE_OPTIONAL = 0;
- public static final short USE_REQUIRED = 1;
- public static final short USE_PROHIBITED = 2;
-
- // maxOccurs = "unbounded"
- public static final int OCCURRENCE_UNBOUNDED = -1;
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/SubstitutionGroupHandler.java b/src/com/sun/org/apache/xerces/internal/impl/xs/SubstitutionGroupHandler.java
deleted file mode 100644
index bd95b17..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/SubstitutionGroupHandler.java
+++ /dev/null
@@ -1,352 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Copyright 2001-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs;
-
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xs.XSConstants;
-import com.sun.org.apache.xerces.internal.xs.XSObjectList;
-import com.sun.org.apache.xerces.internal.xs.XSSimpleTypeDefinition;
-import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Vector;
-
-/**
- * To store and validate information about substitutionGroup
- *
- * @xerces.internal
- *
- * @author Sandy Gao, IBM
- *
- * @version $Id: SubstitutionGroupHandler.java,v 1.6 2010-11-01 04:39:55 joehw Exp $
- */
-public class SubstitutionGroupHandler {
-
- private static final XSElementDecl[] EMPTY_GROUP = new XSElementDecl[0];
-
- // grammar resolver
- XSGrammarBucket fGrammarBucket;
-
- /**
- * Default constructor
- */
- public SubstitutionGroupHandler(XSGrammarBucket grammarBucket) {
- fGrammarBucket = grammarBucket;
- }
-
- // 3.9.4 Element Sequence Locally Valid (Particle) 2.3.3
- // check whether one element decl matches an element with the given qname
- public XSElementDecl getMatchingElemDecl(QName element, XSElementDecl exemplar) {
- if (element.localpart == exemplar.fName &&
- element.uri == exemplar.fTargetNamespace) {
- return exemplar;
- }
-
- // if the exemplar is not a global element decl, then it's not possible
- // to be substituted by another element.
- if (exemplar.fScope != XSConstants.SCOPE_GLOBAL)
- return null;
-
- // if the decl blocks substitution, return false
- if ((exemplar.fBlock & XSConstants.DERIVATION_SUBSTITUTION) != 0)
- return null;
-
- // get grammar of the element
- SchemaGrammar sGrammar = fGrammarBucket.getGrammar(element.uri);
- if (sGrammar == null)
- return null;
-
- // get the decl for the element
- XSElementDecl eDecl = sGrammar.getGlobalElementDecl(element.localpart);
- if (eDecl == null)
- return null;
-
- // and check by using substitutionGroup information
- if (substitutionGroupOK(eDecl, exemplar, exemplar.fBlock))
- return eDecl;
-
- return null;
- }
-
- // 3.3.6 Substitution Group OK (Transitive)
- // check whether element can substitute exemplar
- protected boolean substitutionGroupOK(XSElementDecl element, XSElementDecl exemplar, short blockingConstraint) {
- // For an element declaration (call it D) to be validly substitutable for another element declaration (call it C) subject to a blocking constraint (a subset of {substitution, extension, restriction}, the value of a {disallowed substitutions}) one of the following must be true:
- // 1. D and C are the same element declaration.
- if (element == exemplar)
- return true;
-
- // 2 All of the following must be true:
- // 2.1 The blocking constraint does not contain substitution.
- if ((blockingConstraint & XSConstants.DERIVATION_SUBSTITUTION) != 0)
- return false;
-
- // 2.2 There is a chain of {substitution group affiliation}s from D to C, that is, either D's {substitution group affiliation} is C, or D's {substitution group affiliation}'s {substitution group affiliation} is C, or . . .
- XSElementDecl subGroup = element.fSubGroup;
- while (subGroup != null && subGroup != exemplar) {
- subGroup = subGroup.fSubGroup;
- }
-
- if (subGroup == null)
- return false;
-
- // 2.3 The set of all {derivation method}s involved in the derivation of D's {type definition} from C's {type definition} does not intersect with the union of the blocking constraint, C's {prohibited substitutions} (if C is complex, otherwise the empty set) and the {prohibited substitutions} (respectively the empty set) of any intermediate {type definition}s in the derivation of D's {type definition} from C's {type definition}.
- // prepare the combination of {derivation method} and
- // {disallowed substitution}
- return typeDerivationOK(element.fType, exemplar.fType, blockingConstraint);
- }
- private boolean typeDerivationOK(XSTypeDefinition derived, XSTypeDefinition base, short blockingConstraint) {
-
- short devMethod = 0, blockConstraint = blockingConstraint;
-
- // "derived" should be derived from "base"
- // add derivation methods of derived types to devMethod;
- // add block of base types to blockConstraint.
- XSTypeDefinition type = derived;
- while (type != base && type != SchemaGrammar.fAnyType) {
- if (type.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE) {
- devMethod |= ((XSComplexTypeDecl)type).fDerivedBy;
- }
- else {
- devMethod |= XSConstants.DERIVATION_RESTRICTION;
- }
- type = type.getBaseType();
- // type == null means the current type is anySimpleType,
- // whose base type should be anyType
- if (type == null) {
- type = SchemaGrammar.fAnyType;
- }
- if (type.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE) {
- blockConstraint |= ((XSComplexTypeDecl)type).fBlock;
- }
- }
- if (type != base) {
- // If the base is a union, check if "derived" is allowed through any of the member types.
- if (base.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE) {
- XSSimpleTypeDefinition st = (XSSimpleTypeDefinition) base;
- if (st.getVariety() == XSSimpleTypeDefinition.VARIETY_UNION) {
- XSObjectList memberTypes = st.getMemberTypes();
- final int length = memberTypes.getLength();
- for (int i = 0; i < length; ++i) {
- if (typeDerivationOK(derived, (XSTypeDefinition) memberTypes.item(i), blockingConstraint)) {
- return true;
- }
- }
- }
- }
- return false;
- }
- if ((devMethod & blockConstraint) != 0) {
- return false;
- }
- return true;
- }
-
- // check whether element is in exemplar's substitution group
- public boolean inSubstitutionGroup(XSElementDecl element, XSElementDecl exemplar) {
- // [Definition:] Every element declaration (call this HEAD) in the {element declarations} of a schema defines a substitution group, a subset of those {element declarations}, as follows:
- // Define PSG, the potential substitution group for HEAD, as follows:
- // 1 The element declaration itself is in PSG;
- // 2 PSG is closed with respect to {substitution group affiliation}, that is, if any element declaration in the {element declarations} has a {substitution group affiliation} in PSG, then it is also in PSG itself.
- // HEAD's actual substitution group is then the set consisting of each member of PSG such that all of the following must be true:
- // 1 Its {abstract} is false.
- // 2 It is validly substitutable for HEAD subject to an empty blocking constraint, as defined in Substitution Group OK (Transitive) (3.3.6).
- return substitutionGroupOK(element, exemplar, exemplar.fBlock);
- }
-
- // to store substitution group information
- // the key to the map is an element decl, and the value is
- // - a Vector, which contains all elements that has this element as their
- // substitution group affilication
- // - an array of OneSubGroup, which contains its substitution group before block.
- Map<XSElementDecl, Object> fSubGroupsB = new HashMap<>();
- private static final OneSubGroup[] EMPTY_VECTOR = new OneSubGroup[0];
- // The real substitution groups (after "block")
- Map<XSElementDecl, XSElementDecl[]> fSubGroups = new HashMap<>();
-
- /**
- * clear the internal registry of substitutionGroup information
- */
- public void reset() {
- fSubGroupsB.clear();
- fSubGroups.clear();
- }
-
- /**
- * add a list of substitution group information.
- */
- public void addSubstitutionGroup(XSElementDecl[] elements) {
- XSElementDecl subHead, element;
- Vector subGroup;
- // for all elements with substitution group affiliation
- for (int i = elements.length-1; i >= 0; i--) {
- element = elements[i];
- subHead = element.fSubGroup;
- // check whether this an entry for this element
- subGroup = (Vector)fSubGroupsB.get(subHead);
- if (subGroup == null) {
- // if not, create a new one
- subGroup = new Vector();
- fSubGroupsB.put(subHead, subGroup);
- }
- // add to the vactor
- subGroup.addElement(element);
- }
- }
-
- /**
- * get all elements that can substitute the given element,
- * according to the spec, we shouldn't consider the {block} constraints.
- *
- * from the spec, substitution group of a given element decl also contains
- * the element itself. but the array returned from this method doesn't
- * containt this element.
- */
- public XSElementDecl[] getSubstitutionGroup(XSElementDecl element) {
- // If we already have sub group for this element, just return it.
- XSElementDecl[] subGroup = fSubGroups.get(element);
- if (subGroup != null)
- return subGroup;
-
- if ((element.fBlock & XSConstants.DERIVATION_SUBSTITUTION) != 0) {
- fSubGroups.put(element, EMPTY_GROUP);
- return EMPTY_GROUP;
- }
-
- // Otherwise, get all potential sub group elements
- // (without considering "block" on this element
- OneSubGroup[] groupB = getSubGroupB(element, new OneSubGroup());
- int len = groupB.length, rlen = 0;
- XSElementDecl[] ret = new XSElementDecl[len];
- // For each of such elements, check whether the derivation methods
- // overlap with "block". If not, add it to the sub group
- for (int i = 0 ; i < len; i++) {
- if ((element.fBlock & groupB[i].dMethod) == 0)
- ret[rlen++] = groupB[i].sub;
- }
- // Resize the array if necessary
- if (rlen < len) {
- XSElementDecl[] ret1 = new XSElementDecl[rlen];
- System.arraycopy(ret, 0, ret1, 0, rlen);
- ret = ret1;
- }
- // Store the subgroup
- fSubGroups.put(element, ret);
-
- return ret;
- }
-
- // Get potential sub group element (without considering "block")
- private OneSubGroup[] getSubGroupB(XSElementDecl element, OneSubGroup methods) {
- Object subGroup = fSubGroupsB.get(element);
-
- // substitution group for this one is empty
- if (subGroup == null) {
- fSubGroupsB.put(element, EMPTY_VECTOR);
- return EMPTY_VECTOR;
- }
-
- // we've already calculated the element, just return.
- if (subGroup instanceof OneSubGroup[])
- return (OneSubGroup[])subGroup;
-
- // we only have the *direct* substitutions
- Vector group = (Vector)subGroup, newGroup = new Vector();
- OneSubGroup[] group1;
- // then for each of the direct substitutions, get its substitution
- // group, and combine the groups together.
- short dMethod, bMethod, dSubMethod, bSubMethod;
- for (int i = group.size()-1, j; i >= 0; i--) {
- // Check whether this element is blocked. If so, ignore it.
- XSElementDecl sub = (XSElementDecl)group.elementAt(i);
- if (!getDBMethods(sub.fType, element.fType, methods))
- continue;
- // Remember derivation methods and blocks from the types
- dMethod = methods.dMethod;
- bMethod = methods.bMethod;
- // Add this one to potential group
- newGroup.addElement(new OneSubGroup(sub, methods.dMethod, methods.bMethod));
- // Get potential group for this element
- group1 = getSubGroupB(sub, methods);
- for (j = group1.length-1; j >= 0; j--) {
- // For each of them, check whether it's blocked (by type)
- dSubMethod = (short)(dMethod | group1[j].dMethod);
- bSubMethod = (short)(bMethod | group1[j].bMethod);
- // Ignore it if it's blocked
- if ((dSubMethod & bSubMethod) != 0)
- continue;
- newGroup.addElement(new OneSubGroup(group1[j].sub, dSubMethod, bSubMethod));
- }
- }
- // Convert to an array
- OneSubGroup[] ret = new OneSubGroup[newGroup.size()];
- for (int i = newGroup.size()-1; i >= 0; i--) {
- ret[i] = (OneSubGroup)newGroup.elementAt(i);
- }
- // Store the potential sub group
- fSubGroupsB.put(element, ret);
-
- return ret;
- }
-
- private boolean getDBMethods(XSTypeDefinition typed, XSTypeDefinition typeb,
- OneSubGroup methods) {
- short dMethod = 0, bMethod = 0;
- while (typed != typeb && typed != SchemaGrammar.fAnyType) {
- if (typed.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE)
- dMethod |= ((XSComplexTypeDecl)typed).fDerivedBy;
- else
- dMethod |= XSConstants.DERIVATION_RESTRICTION;
- typed = typed.getBaseType();
- // type == null means the current type is anySimpleType,
- // whose base type should be anyType
- if (typed == null)
- typed = SchemaGrammar.fAnyType;
- if (typed.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE)
- bMethod |= ((XSComplexTypeDecl)typed).fBlock;
- }
- // No derivation relation, or blocked, return false
- if (typed != typeb || (dMethod & bMethod) != 0)
- return false;
-
- // Remember the derivation methods and blocks, return true.
- methods.dMethod = dMethod;
- methods.bMethod = bMethod;
- return true;
- }
-
- // Record the information about how one element substitute another one
- private static final class OneSubGroup {
- OneSubGroup() {}
- OneSubGroup(XSElementDecl sub, short dMethod, short bMethod) {
- this.sub = sub;
- this.dMethod = dMethod;
- this.bMethod = bMethod;
- }
- // The element that substitutes another one
- XSElementDecl sub;
- // The combination of all derivation methods from sub's type to
- // the head's type
- short dMethod;
- // The combination of {block} of the types in the derivation chain
- // excluding sub's type
- short bMethod;
- }
-} // class SubstitutionGroupHandler
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaException.java b/src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaException.java
deleted file mode 100644
index 48bc733..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaException.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xerces.internal.impl.xs;
-
-/**
- * This exception might be thrown by any constraint checking method.
- *
- * @xerces.internal
- *
- * @author Elena Litani, IBM
- *
- */
-public class XMLSchemaException extends Exception {
-
- /** Serialization version. */
- static final long serialVersionUID = -9096984648537046218L;
-
- // store a datatype error: error code plus the arguments
- String key;
- Object[] args;
-
- // report an error
- public XMLSchemaException(String key, Object[] args) {
- this.key = key;
- this.args = args;
- }
-
- public String getKey() {
- return key;
- }
-
- public Object[] getArgs() {
- return args;
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaLoader.java b/src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaLoader.java
deleted file mode 100644
index 3e3ec63..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaLoader.java
+++ /dev/null
@@ -1,1394 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs;
-
-import com.sun.org.apache.xerces.internal.dom.DOMErrorImpl;
-import com.sun.org.apache.xerces.internal.dom.DOMMessageFormatter;
-import com.sun.org.apache.xerces.internal.dom.DOMStringListImpl;
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.XMLEntityManager;
-import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
-import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException;
-import com.sun.org.apache.xerces.internal.impl.dv.SchemaDVFactory;
-import com.sun.org.apache.xerces.internal.impl.dv.xs.SchemaDVFactoryImpl;
-import com.sun.org.apache.xerces.internal.impl.xs.models.CMBuilder;
-import com.sun.org.apache.xerces.internal.impl.xs.models.CMNodeFactory;
-import com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler;
-import com.sun.org.apache.xerces.internal.util.DOMEntityResolverWrapper;
-import com.sun.org.apache.xerces.internal.util.DOMErrorHandlerWrapper;
-import com.sun.org.apache.xerces.internal.util.DefaultErrorHandler;
-import com.sun.org.apache.xerces.internal.util.ParserConfigurationSettings;
-import com.sun.org.apache.xerces.internal.util.Status;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.util.XMLSymbols;
-import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.grammars.Grammar;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarLoader;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
-import com.sun.org.apache.xerces.internal.xni.grammars.XSGrammar;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponent;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLEntityResolver;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-import com.sun.org.apache.xerces.internal.xs.LSInputList;
-import com.sun.org.apache.xerces.internal.xs.StringList;
-import com.sun.org.apache.xerces.internal.xs.XSLoader;
-import com.sun.org.apache.xerces.internal.xs.XSModel;
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-import java.io.StringReader;
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.Map;
-import java.util.StringTokenizer;
-import java.util.Vector;
-import javax.xml.XMLConstants;
-import org.w3c.dom.DOMConfiguration;
-import org.w3c.dom.DOMError;
-import org.w3c.dom.DOMErrorHandler;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.DOMStringList;
-import org.w3c.dom.ls.LSInput;
-import org.w3c.dom.ls.LSResourceResolver;
-import org.xml.sax.InputSource;
-
-/**
- * This class implements xni.grammars.XMLGrammarLoader.
- * It also serves as implementation of xs.XSLoader interface and DOMConfiguration interface.
- *
- * This class is designed to interact either with a proxy for a user application
- * which wants to preparse schemas, or with our own Schema validator.
- * It is hoped that none of these "external" classes will therefore need to communicate directly
- * with XSDHandler in future.
- * <p>This class only knows how to make XSDHandler do its thing.
- * The caller must ensure that all its properties (schemaLocation, JAXPSchemaSource
- * etc.) have been properly set.
- *
- * @xerces.internal
- *
- * @author Neil Graham, IBM
- * @version $Id: XMLSchemaLoader.java,v 1.10 2010-11-01 04:39:55 joehw Exp $
- */
-
-public class XMLSchemaLoader implements XMLGrammarLoader, XMLComponent,
-// XML Component API
-XSLoader, DOMConfiguration {
-
- // Feature identifiers:
-
- /** Feature identifier: schema full checking*/
- protected static final String SCHEMA_FULL_CHECKING =
- Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_FULL_CHECKING;
-
- /** Feature identifier: continue after fatal error. */
- protected static final String CONTINUE_AFTER_FATAL_ERROR =
- Constants.XERCES_FEATURE_PREFIX + Constants.CONTINUE_AFTER_FATAL_ERROR_FEATURE;
-
- /** Feature identifier: allow java encodings to be recognized when parsing schema docs. */
- protected static final String ALLOW_JAVA_ENCODINGS =
- Constants.XERCES_FEATURE_PREFIX + Constants.ALLOW_JAVA_ENCODINGS_FEATURE;
-
- /** Feature identifier: standard uri conformant feature. */
- protected static final String STANDARD_URI_CONFORMANT_FEATURE =
- Constants.XERCES_FEATURE_PREFIX + Constants.STANDARD_URI_CONFORMANT_FEATURE;
-
- /** Feature identifier: validate annotations. */
- protected static final String VALIDATE_ANNOTATIONS =
- Constants.XERCES_FEATURE_PREFIX + Constants.VALIDATE_ANNOTATIONS_FEATURE;
-
- /** Feature: disallow doctype*/
- protected static final String DISALLOW_DOCTYPE =
- Constants.XERCES_FEATURE_PREFIX + Constants.DISALLOW_DOCTYPE_DECL_FEATURE;
-
- /** Feature: generate synthetic annotations */
- protected static final String GENERATE_SYNTHETIC_ANNOTATIONS =
- Constants.XERCES_FEATURE_PREFIX + Constants.GENERATE_SYNTHETIC_ANNOTATIONS_FEATURE;
-
- /** Feature identifier: honour all schemaLocations */
- protected static final String HONOUR_ALL_SCHEMALOCATIONS =
- Constants.XERCES_FEATURE_PREFIX + Constants.HONOUR_ALL_SCHEMALOCATIONS_FEATURE;
-
- protected static final String AUGMENT_PSVI =
- Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_AUGMENT_PSVI;
-
- protected static final String PARSER_SETTINGS =
- Constants.XERCES_FEATURE_PREFIX + Constants.PARSER_SETTINGS;
-
- /** Feature identifier: namespace growth */
- protected static final String NAMESPACE_GROWTH =
- Constants.XERCES_FEATURE_PREFIX + Constants.NAMESPACE_GROWTH_FEATURE;
-
- /** Feature identifier: tolerate duplicates */
- protected static final String TOLERATE_DUPLICATES =
- Constants.XERCES_FEATURE_PREFIX + Constants.TOLERATE_DUPLICATES_FEATURE;
-
- /** Property identifier: Schema DV Factory */
- protected static final String SCHEMA_DV_FACTORY =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SCHEMA_DV_FACTORY_PROPERTY;
-
- protected static final String USE_SERVICE_MECHANISM = Constants.ORACLE_FEATURE_SERVICE_MECHANISM;
-
- // recognized features:
- private static final String[] RECOGNIZED_FEATURES = {
- SCHEMA_FULL_CHECKING,
- AUGMENT_PSVI,
- CONTINUE_AFTER_FATAL_ERROR,
- ALLOW_JAVA_ENCODINGS,
- STANDARD_URI_CONFORMANT_FEATURE,
- DISALLOW_DOCTYPE,
- GENERATE_SYNTHETIC_ANNOTATIONS,
- VALIDATE_ANNOTATIONS,
- HONOUR_ALL_SCHEMALOCATIONS,
- NAMESPACE_GROWTH,
- TOLERATE_DUPLICATES,
- USE_SERVICE_MECHANISM
- };
-
- // property identifiers
-
- /** Property identifier: symbol table. */
- public static final String SYMBOL_TABLE =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY;
-
- /** Property identifier: error reporter. */
- public static final String ERROR_REPORTER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY;
-
- /** Property identifier: error handler. */
- protected static final String ERROR_HANDLER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_HANDLER_PROPERTY;
-
- /** Property identifier: entity resolver. */
- public static final String ENTITY_RESOLVER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_RESOLVER_PROPERTY;
-
- /** Property identifier: grammar pool. */
- public static final String XMLGRAMMAR_POOL =
- Constants.XERCES_PROPERTY_PREFIX + Constants.XMLGRAMMAR_POOL_PROPERTY;
-
- /** Property identifier: schema location. */
- protected static final String SCHEMA_LOCATION =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SCHEMA_LOCATION;
-
- /** Property identifier: no namespace schema location. */
- protected static final String SCHEMA_NONS_LOCATION =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SCHEMA_NONS_LOCATION;
-
- /** Property identifier: JAXP schema source. */
- protected static final String JAXP_SCHEMA_SOURCE =
- Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_SOURCE;
-
- protected static final String SECURITY_MANAGER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SECURITY_MANAGER_PROPERTY;
-
- /** Property identifier: locale. */
- protected static final String LOCALE =
- Constants.XERCES_PROPERTY_PREFIX + Constants.LOCALE_PROPERTY;
-
- protected static final String ENTITY_MANAGER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_MANAGER_PROPERTY;
-
- /** Property identifier: Security property manager. */
- private static final String XML_SECURITY_PROPERTY_MANAGER =
- Constants.XML_SECURITY_PROPERTY_MANAGER;
-
- /** Property identifier: access to external dtd */
- public static final String ACCESS_EXTERNAL_DTD = XMLConstants.ACCESS_EXTERNAL_DTD;
-
- /** Property identifier: access to external schema */
- public static final String ACCESS_EXTERNAL_SCHEMA = XMLConstants.ACCESS_EXTERNAL_SCHEMA;
-
- // recognized properties
- private static final String [] RECOGNIZED_PROPERTIES = {
- ENTITY_MANAGER,
- SYMBOL_TABLE,
- ERROR_REPORTER,
- ERROR_HANDLER,
- ENTITY_RESOLVER,
- XMLGRAMMAR_POOL,
- SCHEMA_LOCATION,
- SCHEMA_NONS_LOCATION,
- JAXP_SCHEMA_SOURCE,
- SECURITY_MANAGER,
- LOCALE,
- SCHEMA_DV_FACTORY,
- XML_SECURITY_PROPERTY_MANAGER
- };
-
- // Data
-
- // features and properties
- private ParserConfigurationSettings fLoaderConfig = new ParserConfigurationSettings();
- private SymbolTable fSymbolTable = null;
- private XMLErrorReporter fErrorReporter = new XMLErrorReporter ();
- private XMLEntityManager fEntityManager = null;
- private XMLEntityResolver fUserEntityResolver = null;
- private XMLGrammarPool fGrammarPool = null;
- private String fExternalSchemas = null;
- private String fExternalNoNSSchema = null;
- // JAXP property: schema source
- private Object fJAXPSource = null;
- // is Schema Full Checking enabled
- private boolean fIsCheckedFully = false;
- // boolean that tells whether we've tested the JAXP property.
- private boolean fJAXPProcessed = false;
- // if features/properties has not been changed, the value of this attribute is "false"
- private boolean fSettingsChanged = true;
-
- // xml schema parsing
- private XSDHandler fSchemaHandler;
- private XSGrammarBucket fGrammarBucket;
- private XSDeclarationPool fDeclPool = null;
- private SubstitutionGroupHandler fSubGroupHandler;
- private final CMNodeFactory fNodeFactory = new CMNodeFactory(); //component mgr will be set later
- private CMBuilder fCMBuilder;
- private XSDDescription fXSDDescription = new XSDDescription();
- private String faccessExternalSchema = Constants.EXTERNAL_ACCESS_DEFAULT;
-
- private Map fJAXPCache;
- private Locale fLocale = Locale.getDefault();
-
- // XSLoader attributes
- private DOMStringList fRecognizedParameters = null;
-
- /** DOM L3 error handler */
- private DOMErrorHandlerWrapper fErrorHandler = null;
-
- /** DOM L3 resource resolver */
- private DOMEntityResolverWrapper fResourceResolver = null;
-
- // default constructor. Create objects we absolutely need:
- public XMLSchemaLoader() {
- this( new SymbolTable(), null, new XMLEntityManager(), null, null, null);
- }
-
- public XMLSchemaLoader(SymbolTable symbolTable) {
- this( symbolTable, null, new XMLEntityManager(), null, null, null);
- }
-
- /**
- * This constractor is used by the XMLSchemaValidator. Additional properties, i.e. XMLEntityManager,
- * will be passed during reset(XMLComponentManager).
- * @param errorReporter
- * @param grammarBucket
- * @param sHandler
- * @param builder
- */
- XMLSchemaLoader(XMLErrorReporter errorReporter,
- XSGrammarBucket grammarBucket,
- SubstitutionGroupHandler sHandler, CMBuilder builder) {
- this(null, errorReporter, null, grammarBucket, sHandler, builder);
- }
-
- XMLSchemaLoader(SymbolTable symbolTable,
- XMLErrorReporter errorReporter,
- XMLEntityManager entityResolver,
- XSGrammarBucket grammarBucket,
- SubstitutionGroupHandler sHandler,
- CMBuilder builder) {
-
- // store properties and features in configuration
- fLoaderConfig.addRecognizedFeatures(RECOGNIZED_FEATURES);
- fLoaderConfig.addRecognizedProperties(RECOGNIZED_PROPERTIES);
- if (symbolTable != null){
- fLoaderConfig.setProperty(SYMBOL_TABLE, symbolTable);
- }
-
- if(errorReporter == null) {
- errorReporter = new XMLErrorReporter ();
- errorReporter.setLocale(fLocale);
- errorReporter.setProperty(ERROR_HANDLER, new DefaultErrorHandler());
-
- }
- fErrorReporter = errorReporter;
- // make sure error reporter knows about schemas...
- if(fErrorReporter.getMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN) == null) {
- fErrorReporter.putMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN, new XSMessageFormatter());
- }
- fLoaderConfig.setProperty(ERROR_REPORTER, fErrorReporter);
- fEntityManager = entityResolver;
- // entity manager is null if XMLSchemaValidator creates the loader
- if (fEntityManager != null){
- fLoaderConfig.setProperty(ENTITY_MANAGER, fEntityManager);
- }
-
- // by default augment PSVI (i.e. don't use declaration pool)
- fLoaderConfig.setFeature(AUGMENT_PSVI, true);
-
- if(grammarBucket == null ) {
- grammarBucket = new XSGrammarBucket();
- }
- fGrammarBucket = grammarBucket;
- if(sHandler == null) {
- sHandler = new SubstitutionGroupHandler(fGrammarBucket);
- }
- fSubGroupHandler = sHandler;
-
- if(builder == null) {
- builder = new CMBuilder(fNodeFactory);
- }
- fCMBuilder = builder;
- fSchemaHandler = new XSDHandler(fGrammarBucket);
- if (fDeclPool != null) {
- fDeclPool.reset();
- }
- fJAXPCache = new HashMap();
-
- fSettingsChanged = true;
- }
-
- /**
- * Returns a list of feature identifiers that are recognized by
- * this XMLGrammarLoader. This method may return null if no features
- * are recognized.
- */
- public String[] getRecognizedFeatures() {
- return (String[])(RECOGNIZED_FEATURES.clone());
- } // getRecognizedFeatures(): String[]
-
- /**
- * Returns the state of a feature.
- *
- * @param featureId The feature identifier.
- *
- * @throws XMLConfigurationException Thrown on configuration error.
- */
- public boolean getFeature(String featureId)
- throws XMLConfigurationException {
- return fLoaderConfig.getFeature(featureId);
- } // getFeature (String): boolean
-
- /**
- * Sets the state of a feature.
- *
- * @param featureId The feature identifier.
- * @param state The state of the feature.
- *
- * @throws XMLConfigurationException Thrown when a feature is not
- * recognized or cannot be set.
- */
- public void setFeature(String featureId,
- boolean state) throws XMLConfigurationException {
- fSettingsChanged = true;
- if(featureId.equals(CONTINUE_AFTER_FATAL_ERROR)) {
- fErrorReporter.setFeature(CONTINUE_AFTER_FATAL_ERROR, state);
- }
- else if(featureId.equals(GENERATE_SYNTHETIC_ANNOTATIONS)) {
- fSchemaHandler.setGenerateSyntheticAnnotations(state);
- }
- fLoaderConfig.setFeature(featureId, state);
- } // setFeature(String, boolean)
-
- /**
- * Returns a list of property identifiers that are recognized by
- * this XMLGrammarLoader. This method may return null if no properties
- * are recognized.
- */
- public String[] getRecognizedProperties() {
- return (String[])(RECOGNIZED_PROPERTIES.clone());
- } // getRecognizedProperties(): String[]
-
- /**
- * Returns the state of a property.
- *
- * @param propertyId The property identifier.
- *
- * @throws XMLConfigurationException Thrown on configuration error.
- */
- public Object getProperty(String propertyId)
- throws XMLConfigurationException {
- return fLoaderConfig.getProperty(propertyId);
- } // getProperty(String): Object
-
- /**
- * Sets the state of a property.
- *
- * @param propertyId The property identifier.
- * @param state The state of the property.
- *
- * @throws XMLConfigurationException Thrown when a property is not
- * recognized or cannot be set.
- */
- public void setProperty(String propertyId,
- Object state) throws XMLConfigurationException {
- fSettingsChanged = true;
- fLoaderConfig.setProperty(propertyId, state);
- if (propertyId.equals(JAXP_SCHEMA_SOURCE)) {
- fJAXPSource = state;
- fJAXPProcessed = false;
- }
- else if (propertyId.equals(XMLGRAMMAR_POOL)) {
- fGrammarPool = (XMLGrammarPool)state;
- }
- else if (propertyId.equals(SCHEMA_LOCATION)) {
- fExternalSchemas = (String)state;
- }
- else if (propertyId.equals(SCHEMA_NONS_LOCATION)) {
- fExternalNoNSSchema = (String) state;
- }
- else if (propertyId.equals(LOCALE)) {
- setLocale((Locale) state);
- }
- else if (propertyId.equals(ENTITY_RESOLVER)) {
- fEntityManager.setProperty(ENTITY_RESOLVER, state);
- }
- else if (propertyId.equals(ERROR_REPORTER)) {
- fErrorReporter = (XMLErrorReporter)state;
- if (fErrorReporter.getMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN) == null) {
- fErrorReporter.putMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN, new XSMessageFormatter());
- }
- }
- else if (propertyId.equals(XML_SECURITY_PROPERTY_MANAGER)) {
- XMLSecurityPropertyManager spm = (XMLSecurityPropertyManager)state;
- faccessExternalSchema = spm.getValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_SCHEMA);
- }
- } // setProperty(String, Object)
-
- /**
- * Set the locale to use for messages.
- *
- * @param locale The locale object to use for localization of messages.
- *
- * @exception XNIException Thrown if the parser does not support the
- * specified locale.
- */
- public void setLocale(Locale locale) {
- fLocale = locale;
- fErrorReporter.setLocale(locale);
- } // setLocale(Locale)
-
- /** Return the Locale the XMLGrammarLoader is using. */
- public Locale getLocale() {
- return fLocale;
- } // getLocale(): Locale
-
- /**
- * Sets the error handler.
- *
- * @param errorHandler The error handler.
- */
- public void setErrorHandler(XMLErrorHandler errorHandler) {
- fErrorReporter.setProperty(ERROR_HANDLER, errorHandler);
- } // setErrorHandler(XMLErrorHandler)
-
- /** Returns the registered error handler. */
- public XMLErrorHandler getErrorHandler() {
- return fErrorReporter.getErrorHandler();
- } // getErrorHandler(): XMLErrorHandler
-
- /**
- * Sets the entity resolver.
- *
- * @param entityResolver The new entity resolver.
- */
- public void setEntityResolver(XMLEntityResolver entityResolver) {
- fUserEntityResolver = entityResolver;
- fLoaderConfig.setProperty(ENTITY_RESOLVER, entityResolver);
- fEntityManager.setProperty(ENTITY_RESOLVER, entityResolver);
- } // setEntityResolver(XMLEntityResolver)
-
- /** Returns the registered entity resolver. */
- public XMLEntityResolver getEntityResolver() {
- return fUserEntityResolver;
- } // getEntityResolver(): XMLEntityResolver
-
- /**
- * Returns a Grammar object by parsing the contents of the
- * entities pointed to by sources.
- *
- * @param source[] the locations of the entity which forms
- * the staring point of the grammars to be constructed
- * @throws IOException when a problem is encounted reading the entity
- * @throws XNIException when a condition arises (such as a FatalError) that requires parsing
- * of the entity be terminated
- */
- public void loadGrammar(XMLInputSource source[])
- throws IOException, XNIException {
- int numSource = source.length;
- for (int i = 0; i < numSource; ++i) {
- loadGrammar(source[i]);
- }
- }
-
- /**
- * Returns a Grammar object by parsing the contents of the
- * entity pointed to by source.
- *
- * @param source the location of the entity which forms
- * the starting point of the grammar to be constructed.
- * @throws IOException When a problem is encountered reading the entity
- * XNIException When a condition arises (such as a FatalError) that requires parsing
- * of the entity be terminated.
- */
- public Grammar loadGrammar(XMLInputSource source)
- throws IOException, XNIException {
-
- // REVISIT: this method should have a namespace parameter specified by
- // user. In this case we can easily detect if a schema asked to be loaded
- // is already in the local cache.
-
- reset(fLoaderConfig);
- fSettingsChanged = false;
- XSDDescription desc = new XSDDescription();
- desc.fContextType = XSDDescription.CONTEXT_PREPARSE;
- desc.setBaseSystemId(source.getBaseSystemId());
- desc.setLiteralSystemId( source.getSystemId());
- // none of the other fields make sense for preparsing
- Map locationPairs = new HashMap();
- // Process external schema location properties.
- // We don't call tokenizeSchemaLocationStr here, because we also want
- // to check whether the values are valid URI.
- processExternalHints(fExternalSchemas, fExternalNoNSSchema,
- locationPairs, fErrorReporter);
- SchemaGrammar grammar = loadSchema(desc, source, locationPairs);
-
- if(grammar != null && fGrammarPool != null) {
- fGrammarPool.cacheGrammars(XMLGrammarDescription.XML_SCHEMA, fGrammarBucket.getGrammars());
- // NOTE: we only need to verify full checking in case the schema was not provided via JAXP
- // since full checking already verified for all JAXP schemas
- if(fIsCheckedFully && fJAXPCache.get(grammar) != grammar) {
- XSConstraints.fullSchemaChecking(fGrammarBucket, fSubGroupHandler, fCMBuilder, fErrorReporter);
- }
- }
- return grammar;
- } // loadGrammar(XMLInputSource): Grammar
-
- /**
- * This method is called either from XMLGrammarLoader.loadGrammar or from XMLSchemaValidator.
- * Note: in either case, the EntityManager (or EntityResolvers) are not going to be invoked
- * to resolve the location of the schema in XSDDescription
- * @param desc
- * @param source
- * @param locationPairs
- * @return An XML Schema grammar
- * @throws IOException
- * @throws XNIException
- */
- SchemaGrammar loadSchema(XSDDescription desc, XMLInputSource source,
- Map<String, LocationArray> locationPairs) throws IOException, XNIException {
-
- // this should only be done once per invocation of this object;
- // unless application alters JAXPSource in the mean time.
- if(!fJAXPProcessed) {
- processJAXPSchemaSource(locationPairs);
- }
-
- if (desc.isExternal()) {
- String accessError = SecuritySupport.checkAccess(desc.getExpandedSystemId(), faccessExternalSchema, Constants.ACCESS_EXTERNAL_ALL);
- if (accessError != null) {
- throw new XNIException(fErrorReporter.reportError(XSMessageFormatter.SCHEMA_DOMAIN,
- "schema_reference.access",
- new Object[] { SecuritySupport.sanitizePath(desc.getExpandedSystemId()), accessError }, XMLErrorReporter.SEVERITY_ERROR));
- }
- }
- SchemaGrammar grammar = fSchemaHandler.parseSchema(source, desc, locationPairs);
-
- return grammar;
- } // loadSchema(XSDDescription, XMLInputSource): SchemaGrammar
-
- /** This method tries to resolve location of the given schema.
- * The loader stores the namespace/location pairs in a map (use "" as the
- * namespace of absent namespace). When resolving an entity, loader first tries
- * to find in the map whether there is a value for that namespace,
- * if so, pass that location value to the user-defined entity resolver.
- *
- * @param desc
- * @param locationPairs
- * @param entityResolver
- * @return
- * @throws IOException
- */
- public static XMLInputSource resolveDocument(XSDDescription desc,
- Map<String, LocationArray> locationPairs,
- XMLEntityResolver entityResolver) throws IOException {
- String loc = null;
- // we consider the schema location properties for import
- if (desc.getContextType() == XSDDescription.CONTEXT_IMPORT ||
- desc.fromInstance()) {
- // use empty string as the key for absent namespace
- String namespace = desc.getTargetNamespace();
- String ns = namespace == null ? XMLSymbols.EMPTY_STRING : namespace;
- // get the location hint for that namespace
- LocationArray tempLA = locationPairs.get(ns);
- if(tempLA != null)
- loc = tempLA.getFirstLocation();
- }
-
- // if it's not import, or if the target namespace is not set
- // in the schema location properties, use location hint
- if (loc == null) {
- String[] hints = desc.getLocationHints();
- if (hints != null && hints.length > 0)
- loc = hints[0];
- }
-
- String expandedLoc = XMLEntityManager.expandSystemId(loc, desc.getBaseSystemId(), false);
- desc.setLiteralSystemId(loc);
- desc.setExpandedSystemId(expandedLoc);
- return entityResolver.resolveEntity(desc);
- }
-
- // add external schema locations to the location pairs
- public static void processExternalHints(String sl, String nsl,
- Map<String, XMLSchemaLoader.LocationArray> locations,
- XMLErrorReporter er) {
- if (sl != null) {
- try {
- // get the attribute decl for xsi:schemaLocation
- // because external schema location property has the same syntax
- // as xsi:schemaLocation
- XSAttributeDecl attrDecl = SchemaGrammar.SG_XSI.getGlobalAttributeDecl(SchemaSymbols.XSI_SCHEMALOCATION);
- // validation the string value to get the list of URI's
- attrDecl.fType.validate(sl, null, null);
- if (!tokenizeSchemaLocationStr(sl, locations)) {
- // report warning (odd number of items)
- er.reportError(XSMessageFormatter.SCHEMA_DOMAIN,
- "SchemaLocation",
- new Object[]{sl},
- XMLErrorReporter.SEVERITY_WARNING);
- }
- }
- catch (InvalidDatatypeValueException ex) {
- // report warning (not list of URI's)
- er.reportError(XSMessageFormatter.SCHEMA_DOMAIN,
- ex.getKey(), ex.getArgs(),
- XMLErrorReporter.SEVERITY_WARNING);
- }
- }
-
- if (nsl != null) {
- try {
- // similarly for no ns schema location property
- XSAttributeDecl attrDecl = SchemaGrammar.SG_XSI.getGlobalAttributeDecl(SchemaSymbols.XSI_NONAMESPACESCHEMALOCATION);
- attrDecl.fType.validate(nsl, null, null);
- LocationArray la = ((LocationArray)locations.get(XMLSymbols.EMPTY_STRING));
- if(la == null) {
- la = new LocationArray();
- locations.put(XMLSymbols.EMPTY_STRING, la);
- }
- la.addLocation(nsl);
- }
- catch (InvalidDatatypeValueException ex) {
- // report warning (not a URI)
- er.reportError(XSMessageFormatter.SCHEMA_DOMAIN,
- ex.getKey(), ex.getArgs(),
- XMLErrorReporter.SEVERITY_WARNING);
- }
- }
- }
- // this method takes a SchemaLocation string.
- // If an error is encountered, false is returned;
- // otherwise, true is returned. In either case, locations
- // is augmented to include as many tokens as possible.
- // @param schemaStr The schemaLocation string to tokenize
- // @param locations HashMap mapping namespaces to LocationArray objects holding lists of locaitons
- // @return true if no problems; false if string could not be tokenized
- public static boolean tokenizeSchemaLocationStr(String schemaStr,
- Map<String, XMLSchemaLoader.LocationArray> locations) {
- if (schemaStr!= null) {
- StringTokenizer t = new StringTokenizer(schemaStr, " \n\t\r");
- String namespace, location;
- while (t.hasMoreTokens()) {
- namespace = t.nextToken ();
- if (!t.hasMoreTokens()) {
- return false; // error!
- }
- location = t.nextToken();
- LocationArray la = locations.get(namespace);
- if(la == null) {
- la = new LocationArray();
- locations.put(namespace, la);
- }
- la.addLocation(location);
- }
- }
- return true;
- } // tokenizeSchemaLocation(String, HashMap): boolean
-
- /**
- * Translate the various JAXP SchemaSource property types to XNI
- * XMLInputSource. Valid types are: String, org.xml.sax.InputSource,
- * InputStream, File, or Object[] of any of previous types.
- * REVISIT: the JAXP 1.2 spec is less than clear as to whether this property
- * should be available to imported schemas. I have assumed
- * that it should. - NG
- * Note: all JAXP schema files will be checked for full-schema validity if the feature was set up
- *
- */
- private void processJAXPSchemaSource(
- Map<String, LocationArray> locationPairs) throws IOException {
- fJAXPProcessed = true;
- if (fJAXPSource == null) {
- return;
- }
-
- Class componentType = fJAXPSource.getClass().getComponentType();
- XMLInputSource xis = null;
- String sid = null;
- if (componentType == null) {
- // Not an array
- if(fJAXPSource instanceof InputStream ||
- fJAXPSource instanceof InputSource) {
- SchemaGrammar g = (SchemaGrammar)fJAXPCache.get(fJAXPSource);
- if(g != null) {
- fGrammarBucket.putGrammar(g);
- return;
- }
- }
- fXSDDescription.reset();
- xis = xsdToXMLInputSource(fJAXPSource);
- sid = xis.getSystemId();
- fXSDDescription.fContextType = XSDDescription.CONTEXT_PREPARSE;
- if (sid != null) {
- fXSDDescription.setBaseSystemId(xis.getBaseSystemId());
- fXSDDescription.setLiteralSystemId(sid);
- fXSDDescription.setExpandedSystemId(sid);
- fXSDDescription.fLocationHints = new String[]{sid};
- }
- SchemaGrammar g = loadSchema(fXSDDescription, xis, locationPairs);
- // it is possible that we won't be able to resolve JAXP schema-source location
- if (g != null){
- if(fJAXPSource instanceof InputStream ||
- fJAXPSource instanceof InputSource) {
- fJAXPCache.put(fJAXPSource, g);
- if(fIsCheckedFully) {
- XSConstraints.fullSchemaChecking(fGrammarBucket, fSubGroupHandler, fCMBuilder, fErrorReporter);
- }
- }
- fGrammarBucket.putGrammar(g);
- }
- return ;
- } else if ( (componentType != Object.class) &&
- (componentType != String.class) &&
- (componentType != File.class) &&
- (componentType != InputStream.class) &&
- (componentType != InputSource.class)
- ) {
- // Not an Object[], String[], File[], InputStream[], InputSource[]
- throw new XMLConfigurationException(
- Status.NOT_SUPPORTED, "\""+JAXP_SCHEMA_SOURCE+
- "\" property cannot have an array of type {"+componentType.getName()+
- "}. Possible types of the array supported are Object, String, File, "+
- "InputStream, InputSource.");
- }
-
- // JAXP spec. allow []s of type String, File, InputStream,
- // InputSource also, apart from [] of type Object.
- Object[] objArr = (Object[]) fJAXPSource;
- //make local vector for storing targetn namespaces of schemasources specified in object arrays.
- Vector jaxpSchemaSourceNamespaces = new Vector() ;
- for (int i = 0; i < objArr.length; i++) {
- if(objArr[i] instanceof InputStream ||
- objArr[i] instanceof InputSource) {
- SchemaGrammar g = (SchemaGrammar)fJAXPCache.get(objArr[i]);
- if (g != null) {
- fGrammarBucket.putGrammar(g);
- continue;
- }
- }
- fXSDDescription.reset();
- xis = xsdToXMLInputSource(objArr[i]);
- sid = xis.getSystemId();
- fXSDDescription.fContextType = XSDDescription.CONTEXT_PREPARSE;
- if (sid != null) {
- fXSDDescription.setBaseSystemId(xis.getBaseSystemId());
- fXSDDescription.setLiteralSystemId(sid);
- fXSDDescription.setExpandedSystemId(sid);
- fXSDDescription.fLocationHints = new String[]{sid};
- }
- String targetNamespace = null ;
- // load schema
- SchemaGrammar grammar = fSchemaHandler.parseSchema(xis,fXSDDescription, locationPairs);
-
- if(fIsCheckedFully) {
- XSConstraints.fullSchemaChecking(fGrammarBucket, fSubGroupHandler, fCMBuilder, fErrorReporter);
- }
- if(grammar != null){
- targetNamespace = grammar.getTargetNamespace() ;
- if(jaxpSchemaSourceNamespaces.contains(targetNamespace)){
- //when an array of objects is passed it is illegal to have two schemas that share same namespace.
- throw new java.lang.IllegalArgumentException(
- " When using array of Objects as the value of SCHEMA_SOURCE property , " +
- "no two Schemas should share the same targetNamespace. " );
- }
- else{
- jaxpSchemaSourceNamespaces.add(targetNamespace) ;
- }
- if(objArr[i] instanceof InputStream ||
- objArr[i] instanceof InputSource) {
- fJAXPCache.put(objArr[i], grammar);
- }
- fGrammarBucket.putGrammar(grammar);
- }
- else{
- //REVISIT: What should be the acutal behavior if grammar can't be loaded as specified in schema source?
- }
- }
- }//processJAXPSchemaSource
-
- private XMLInputSource xsdToXMLInputSource(
- Object val)
- {
- if (val instanceof String) {
- // String value is treated as a URI that is passed through the
- // EntityResolver
- String loc = (String) val;
- fXSDDescription.reset();
- fXSDDescription.setValues(null, loc, null, null);
- XMLInputSource xis = null;
- try {
- xis = fEntityManager.resolveEntity(fXSDDescription);
- } catch (IOException ex) {
- fErrorReporter.reportError(XSMessageFormatter.SCHEMA_DOMAIN,
- "schema_reference.4",
- new Object[] { loc }, XMLErrorReporter.SEVERITY_ERROR);
- }
- if (xis == null) {
- // REVISIT: can this happen?
- // Treat value as a URI and pass in as systemId
- return new XMLInputSource(null, loc, null);
- }
- return xis;
- } else if (val instanceof InputSource) {
- return saxToXMLInputSource((InputSource) val);
- } else if (val instanceof InputStream) {
- return new XMLInputSource(null, null, null,
- (InputStream) val, null);
- } else if (val instanceof File) {
- File file = (File) val;
- InputStream is = null;
- try {
- is = new BufferedInputStream(new FileInputStream(file));
- } catch (FileNotFoundException ex) {
- fErrorReporter.reportError(XSMessageFormatter.SCHEMA_DOMAIN,
- "schema_reference.4", new Object[] { file.toString() },
- XMLErrorReporter.SEVERITY_ERROR);
- }
- return new XMLInputSource(null, null, null, is, null);
- }
- throw new XMLConfigurationException(
- Status.NOT_SUPPORTED, "\""+JAXP_SCHEMA_SOURCE+
- "\" property cannot have a value of type {"+val.getClass().getName()+
- "}. Possible types of the value supported are String, File, InputStream, "+
- "InputSource OR an array of these types.");
- }
-
-
- //Convert a SAX InputSource to an equivalent XNI XMLInputSource
-
- private static XMLInputSource saxToXMLInputSource(InputSource sis) {
- String publicId = sis.getPublicId();
- String systemId = sis.getSystemId();
-
- Reader charStream = sis.getCharacterStream();
- if (charStream != null) {
- return new XMLInputSource(publicId, systemId, null, charStream,
- null);
- }
-
- InputStream byteStream = sis.getByteStream();
- if (byteStream != null) {
- return new XMLInputSource(publicId, systemId, null, byteStream,
- sis.getEncoding());
- }
-
- return new XMLInputSource(publicId, systemId, null);
- }
-
- public static class LocationArray{
-
- int length ;
- String [] locations = new String[2];
-
- public void resize(int oldLength , int newLength){
- String [] temp = new String[newLength] ;
- System.arraycopy(locations, 0, temp, 0, Math.min(oldLength, newLength));
- locations = temp ;
- length = Math.min(oldLength, newLength);
- }
-
- public void addLocation(String location){
- if(length >= locations.length ){
- resize(length, Math.max(1, length*2));
- }
- locations[length++] = location;
- }//setLocation()
-
- public String [] getLocationArray(){
- if(length < locations.length ){
- resize(locations.length, length);
- }
- return locations;
- }//getLocationArray()
-
- public String getFirstLocation(){
- return length > 0 ? locations[0] : null;
- }
-
- public int getLength(){
- return length ;
- }
-
- } //locationArray
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xni.parser.XMLComponent#getFeatureDefault(java.lang.String)
- */
- public Boolean getFeatureDefault(String featureId) {
- if (featureId.equals(AUGMENT_PSVI)){
- return Boolean.TRUE;
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xni.parser.XMLComponent#getPropertyDefault(java.lang.String)
- */
- public Object getPropertyDefault(String propertyId) {
- // TODO Auto-generated method stub
- return null;
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xni.parser.XMLComponent#reset(com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager)
- */
- public void reset(XMLComponentManager componentManager) throws XMLConfigurationException {
-
- XMLSecurityPropertyManager spm = (XMLSecurityPropertyManager)componentManager.getProperty(XML_SECURITY_PROPERTY_MANAGER);
- if (spm == null) {
- spm = new XMLSecurityPropertyManager();
- setProperty(XML_SECURITY_PROPERTY_MANAGER, spm);
- }
-
- XMLSecurityManager sm = (XMLSecurityManager)componentManager.getProperty(SECURITY_MANAGER);
- if (sm == null)
- setProperty(SECURITY_MANAGER,new XMLSecurityManager(true));
-
- faccessExternalSchema = spm.getValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_SCHEMA);
-
- fGrammarBucket.reset();
-
- fSubGroupHandler.reset();
-
- boolean parser_settings = componentManager.getFeature(PARSER_SETTINGS, true);
-
- if (!parser_settings || !fSettingsChanged){
- // need to reprocess JAXP schema sources
- fJAXPProcessed = false;
- // reinitialize grammar bucket
- initGrammarBucket();
- return;
- }
-
- //pass the component manager to the factory..
- fNodeFactory.reset(componentManager);
-
- // get registered entity manager to be able to resolve JAXP schema-source property:
- // Note: in case XMLSchemaValidator has created the loader,
- // the entity manager property is null
- fEntityManager = (XMLEntityManager)componentManager.getProperty(ENTITY_MANAGER);
-
- // get the error reporter
- fErrorReporter = (XMLErrorReporter)componentManager.getProperty(ERROR_REPORTER);
-
- // Determine schema dv factory to use
- SchemaDVFactory dvFactory = null;
- dvFactory = fSchemaHandler.getDVFactory();
- if (dvFactory == null) {
- dvFactory = SchemaDVFactory.getInstance();
- fSchemaHandler.setDVFactory(dvFactory);
- }
-
- boolean psvi = componentManager.getFeature(AUGMENT_PSVI, false);
-
- if (!psvi) {
- if (fDeclPool != null) {
- fDeclPool.reset();
- }
- else {
- fDeclPool = new XSDeclarationPool();
- }
- fCMBuilder.setDeclPool(fDeclPool);
- fSchemaHandler.setDeclPool(fDeclPool);
- if (dvFactory instanceof SchemaDVFactoryImpl) {
- fDeclPool.setDVFactory((SchemaDVFactoryImpl)dvFactory);
- ((SchemaDVFactoryImpl)dvFactory).setDeclPool(fDeclPool);
- }
- } else {
- fCMBuilder.setDeclPool(null);
- fSchemaHandler.setDeclPool(null);
- }
-
- // get schema location properties
- try {
- fExternalSchemas = (String) componentManager.getProperty(SCHEMA_LOCATION);
- fExternalNoNSSchema = (String) componentManager.getProperty(SCHEMA_NONS_LOCATION);
- } catch (XMLConfigurationException e) {
- fExternalSchemas = null;
- fExternalNoNSSchema = null;
- }
-
- // get JAXP sources if available
- fJAXPSource = componentManager.getProperty(JAXP_SCHEMA_SOURCE, null);
- fJAXPProcessed = false;
-
- // clear grammars, and put the one for schema namespace there
- fGrammarPool = (XMLGrammarPool) componentManager.getProperty(XMLGRAMMAR_POOL, null);
- initGrammarBucket();
- // get continue-after-fatal-error feature
- try {
- boolean fatalError = componentManager.getFeature(CONTINUE_AFTER_FATAL_ERROR, false);
- if (!fatalError) {
- fErrorReporter.setFeature(CONTINUE_AFTER_FATAL_ERROR, fatalError);
- }
- } catch (XMLConfigurationException e) {
- }
- // set full validation to false
- fIsCheckedFully = componentManager.getFeature(SCHEMA_FULL_CHECKING, false);
-
- // get generate-synthetic-annotations feature
- fSchemaHandler.setGenerateSyntheticAnnotations(componentManager.getFeature(GENERATE_SYNTHETIC_ANNOTATIONS, false));
- fSchemaHandler.reset(componentManager);
- }
-
- private void initGrammarBucket(){
- if(fGrammarPool != null) {
- Grammar [] initialGrammars = fGrammarPool.retrieveInitialGrammarSet(XMLGrammarDescription.XML_SCHEMA);
- for (int i = 0; i < initialGrammars.length; i++) {
- // put this grammar into the bucket, along with grammars
- // imported by it (directly or indirectly)
- if (!fGrammarBucket.putGrammar((SchemaGrammar)(initialGrammars[i]), true)) {
- // REVISIT: a conflict between new grammar(s) and grammars
- // in the bucket. What to do? A warning? An exception?
- fErrorReporter.reportError(XSMessageFormatter.SCHEMA_DOMAIN,
- "GrammarConflict", null,
- XMLErrorReporter.SEVERITY_WARNING);
- }
- }
- }
- }
-
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xs.XSLoader#getConfig()
- */
- public DOMConfiguration getConfig() {
- return this;
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xs.XSLoader#load(org.w3c.dom.ls.LSInput)
- */
- public XSModel load(LSInput is) {
- try {
- Grammar g = loadGrammar(dom2xmlInputSource(is));
- return ((XSGrammar) g).toXSModel();
- } catch (Exception e) {
- reportDOMFatalError(e);
- return null;
- }
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xs.XSLoader#loadInputList(com.sun.org.apache.xerces.internal.xs.DOMInputList)
- */
- public XSModel loadInputList(LSInputList is) {
- int length = is.getLength();
- SchemaGrammar[] gs = new SchemaGrammar[length];
- for (int i = 0; i < length; i++) {
- try {
- gs[i] = (SchemaGrammar) loadGrammar(dom2xmlInputSource(is.item(i)));
- } catch (Exception e) {
- reportDOMFatalError(e);
- return null;
- }
- }
- return new XSModelImpl(gs);
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xs.XSLoader#loadURI(java.lang.String)
- */
- public XSModel loadURI(String uri) {
- try {
- Grammar g = loadGrammar(new XMLInputSource(null, uri, null));
- return ((XSGrammar)g).toXSModel();
- }
- catch (Exception e){
- reportDOMFatalError(e);
- return null;
- }
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xs.XSLoader#loadURIList(com.sun.org.apache.xerces.internal.xs.StringList)
- */
- public XSModel loadURIList(StringList uriList) {
- int length = uriList.getLength();
- SchemaGrammar[] gs = new SchemaGrammar[length];
- for (int i = 0; i < length; i++) {
- try {
- gs[i] =
- (SchemaGrammar) loadGrammar(new XMLInputSource(null, uriList.item(i), null));
- } catch (Exception e) {
- reportDOMFatalError(e);
- return null;
- }
- }
- return new XSModelImpl(gs);
- }
-
- void reportDOMFatalError(Exception e) {
- if (fErrorHandler != null) {
- DOMErrorImpl error = new DOMErrorImpl();
- error.fException = e;
- error.fMessage = e.getMessage();
- error.fSeverity = DOMError.SEVERITY_FATAL_ERROR;
- fErrorHandler.getErrorHandler().handleError(error);
- }
- }
-
- /* (non-Javadoc)
- * @see DOMConfiguration#canSetParameter(String, Object)
- */
- public boolean canSetParameter(String name, Object value) {
- if(value instanceof Boolean){
- if (name.equals(Constants.DOM_VALIDATE) ||
- name.equals(SCHEMA_FULL_CHECKING) ||
- name.equals(VALIDATE_ANNOTATIONS) ||
- name.equals(CONTINUE_AFTER_FATAL_ERROR) ||
- name.equals(ALLOW_JAVA_ENCODINGS) ||
- name.equals(STANDARD_URI_CONFORMANT_FEATURE) ||
- name.equals(GENERATE_SYNTHETIC_ANNOTATIONS) ||
- name.equals(HONOUR_ALL_SCHEMALOCATIONS) ||
- name.equals(NAMESPACE_GROWTH) ||
- name.equals(TOLERATE_DUPLICATES) ||
- name.equals(USE_SERVICE_MECHANISM)) {
- return true;
-
- }
- return false;
- }
- if (name.equals(Constants.DOM_ERROR_HANDLER) ||
- name.equals(Constants.DOM_RESOURCE_RESOLVER) ||
- name.equals(SYMBOL_TABLE) ||
- name.equals(ERROR_REPORTER) ||
- name.equals(ERROR_HANDLER) ||
- name.equals(ENTITY_RESOLVER) ||
- name.equals(XMLGRAMMAR_POOL) ||
- name.equals(SCHEMA_LOCATION) ||
- name.equals(SCHEMA_NONS_LOCATION) ||
- name.equals(JAXP_SCHEMA_SOURCE) ||
- name.equals(SCHEMA_DV_FACTORY)) {
- return true;
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see DOMConfiguration#getParameter(String)
- */
- public Object getParameter(String name) throws DOMException {
-
- if (name.equals(Constants.DOM_ERROR_HANDLER)){
- return (fErrorHandler != null) ? fErrorHandler.getErrorHandler() : null;
- }
- else if (name.equals(Constants.DOM_RESOURCE_RESOLVER)) {
- return (fResourceResolver != null) ? fResourceResolver.getEntityResolver() : null;
- }
-
- try {
- boolean feature = getFeature(name);
- return (feature) ? Boolean.TRUE : Boolean.FALSE;
- } catch (Exception e) {
- Object property;
- try {
- property = getProperty(name);
- return property;
- } catch (Exception ex) {
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "FEATURE_NOT_SUPPORTED",
- new Object[] { name });
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see DOMConfiguration#getParameterNames()
- */
- public DOMStringList getParameterNames() {
- if (fRecognizedParameters == null){
- Vector v = new Vector();
- v.add(Constants.DOM_VALIDATE);
- v.add(Constants.DOM_ERROR_HANDLER);
- v.add(Constants.DOM_RESOURCE_RESOLVER);
- v.add(SYMBOL_TABLE);
- v.add(ERROR_REPORTER);
- v.add(ERROR_HANDLER);
- v.add(ENTITY_RESOLVER);
- v.add(XMLGRAMMAR_POOL);
- v.add(SCHEMA_LOCATION);
- v.add(SCHEMA_NONS_LOCATION);
- v.add(JAXP_SCHEMA_SOURCE);
- v.add(SCHEMA_FULL_CHECKING);
- v.add(CONTINUE_AFTER_FATAL_ERROR);
- v.add(ALLOW_JAVA_ENCODINGS);
- v.add(STANDARD_URI_CONFORMANT_FEATURE);
- v.add(VALIDATE_ANNOTATIONS);
- v.add(GENERATE_SYNTHETIC_ANNOTATIONS);
- v.add(HONOUR_ALL_SCHEMALOCATIONS);
- v.add(NAMESPACE_GROWTH);
- v.add(TOLERATE_DUPLICATES);
- v.add(USE_SERVICE_MECHANISM);
- fRecognizedParameters = new DOMStringListImpl(v);
- }
- return fRecognizedParameters;
- }
-
- /* (non-Javadoc)
- * @see DOMConfiguration#setParameter(String, Object)
- */
- public void setParameter(String name, Object value) throws DOMException {
- if (value instanceof Boolean) {
- boolean state = ((Boolean) value).booleanValue();
- if (name.equals("validate") && state) {
- return;
- }
- try {
- setFeature(name, state);
- } catch (Exception e) {
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "FEATURE_NOT_SUPPORTED",
- new Object[] { name });
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
- }
- return;
- }
- if (name.equals(Constants.DOM_ERROR_HANDLER)) {
- if (value instanceof DOMErrorHandler) {
- try {
- fErrorHandler = new DOMErrorHandlerWrapper((DOMErrorHandler) value);
- setErrorHandler(fErrorHandler);
- } catch (XMLConfigurationException e) {
- }
- } else {
- // REVISIT: type mismatch
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "FEATURE_NOT_SUPPORTED",
- new Object[] { name });
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
- }
- return;
-
- }
- if (name.equals(Constants.DOM_RESOURCE_RESOLVER)) {
- if (value instanceof LSResourceResolver) {
- try {
- fResourceResolver = new DOMEntityResolverWrapper((LSResourceResolver) value);
- setEntityResolver(fResourceResolver);
- }
- catch (XMLConfigurationException e) {}
- } else {
- // REVISIT: type mismatch
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "FEATURE_NOT_SUPPORTED",
- new Object[] { name });
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
- }
- return;
- }
-
- try {
- setProperty(name, value);
- } catch (Exception ex) {
-
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "FEATURE_NOT_SUPPORTED",
- new Object[] { name });
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
-
- }
-
- }
-
- XMLInputSource dom2xmlInputSource(LSInput is) {
- // need to wrap the LSInput with an XMLInputSource
- XMLInputSource xis = null;
-
- /**
- * An LSParser looks at inputs specified in LSInput in
- * the following order: characterStream, byteStream,
- * stringData, systemId, publicId. For consistency
- * have the same behaviour for XSLoader.
- */
-
- // check whether there is a Reader
- // according to DOM, we need to treat such reader as "UTF-16".
- if (is.getCharacterStream() != null) {
- xis = new XMLInputSource(is.getPublicId(), is.getSystemId(),
- is.getBaseURI(), is.getCharacterStream(),
- "UTF-16");
- }
- // check whether there is an InputStream
- else if (is.getByteStream() != null) {
- xis = new XMLInputSource(is.getPublicId(), is.getSystemId(),
- is.getBaseURI(), is.getByteStream(),
- is.getEncoding());
- }
- // if there is a string data, use a StringReader
- // according to DOM, we need to treat such data as "UTF-16".
- else if (is.getStringData() != null && is.getStringData().length() != 0) {
- xis = new XMLInputSource(is.getPublicId(), is.getSystemId(),
- is.getBaseURI(), new StringReader(is.getStringData()),
- "UTF-16");
- }
- // otherwise, just use the public/system/base Ids
- else {
- xis = new XMLInputSource(is.getPublicId(), is.getSystemId(),
- is.getBaseURI());
- }
-
- return xis;
- }
-
-} // XMLGrammarLoader
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaValidator.java b/src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaValidator.java
deleted file mode 100644
index c138b7f..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaValidator.java
+++ /dev/null
@@ -1,4307 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.RevalidationHandler;
-import com.sun.org.apache.xerces.internal.impl.XMLEntityManager;
-import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
-import com.sun.org.apache.xerces.internal.impl.dv.DatatypeException;
-import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException;
-import com.sun.org.apache.xerces.internal.impl.dv.ValidatedInfo;
-import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType;
-import com.sun.org.apache.xerces.internal.impl.validation.ValidationManager;
-import com.sun.org.apache.xerces.internal.impl.validation.ValidationState;
-import com.sun.org.apache.xerces.internal.impl.xs.identity.Field;
-import com.sun.org.apache.xerces.internal.impl.xs.identity.FieldActivator;
-import com.sun.org.apache.xerces.internal.impl.xs.identity.IdentityConstraint;
-import com.sun.org.apache.xerces.internal.impl.xs.identity.KeyRef;
-import com.sun.org.apache.xerces.internal.impl.xs.identity.Selector;
-import com.sun.org.apache.xerces.internal.impl.xs.identity.UniqueOrKey;
-import com.sun.org.apache.xerces.internal.impl.xs.identity.ValueStore;
-import com.sun.org.apache.xerces.internal.impl.xs.identity.XPathMatcher;
-import com.sun.org.apache.xerces.internal.impl.xs.models.CMBuilder;
-import com.sun.org.apache.xerces.internal.impl.xs.models.CMNodeFactory;
-import com.sun.org.apache.xerces.internal.impl.xs.models.XSCMValidator;
-import com.sun.org.apache.xerces.internal.parsers.XMLParser;
-import com.sun.org.apache.xerces.internal.util.AugmentationsImpl;
-import com.sun.org.apache.xerces.internal.util.IntStack;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.util.URI.MalformedURIException;
-import com.sun.org.apache.xerces.internal.util.XMLAttributesImpl;
-import com.sun.org.apache.xerces.internal.util.XMLChar;
-import com.sun.org.apache.xerces.internal.util.XMLSymbols;
-import com.sun.org.apache.xerces.internal.xni.Augmentations;
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
-import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLLocator;
-import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
-import com.sun.org.apache.xerces.internal.xni.XMLString;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponent;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentFilter;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLEntityResolver;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-import com.sun.org.apache.xerces.internal.xs.AttributePSVI;
-import com.sun.org.apache.xerces.internal.xs.ElementPSVI;
-import com.sun.org.apache.xerces.internal.xs.ShortList;
-import com.sun.org.apache.xerces.internal.xs.StringList;
-import com.sun.org.apache.xerces.internal.xs.XSConstants;
-import com.sun.org.apache.xerces.internal.xs.XSObjectList;
-import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Stack;
-import java.util.Vector;
-
-/**
- * The XML Schema validator. The validator implements a document
- * filter: receiving document events from the scanner; validating
- * the content and structure; augmenting the InfoSet, if applicable;
- * and notifying the parser of the information resulting from the
- * validation process.
- * <p>
- * This component requires the following features and properties from the
- * component manager that uses it:
- * <ul>
- * <li>http://xml.org/sax/features/validation</li>
- * <li>http://apache.org/xml/properties/internal/symbol-table</li>
- * <li>http://apache.org/xml/properties/internal/error-reporter</li>
- * <li>http://apache.org/xml/properties/internal/entity-resolver</li>
- * </ul>
- *
- * @xerces.internal
- *
- * @author Sandy Gao IBM
- * @author Elena Litani IBM
- * @author Andy Clark IBM
- * @author Neeraj Bajaj, Sun Microsystems, inc.
- * @version $Id: XMLSchemaValidator.java,v 1.16 2010-11-01 04:39:55 joehw Exp $
- */
-public class XMLSchemaValidator
- implements XMLComponent, XMLDocumentFilter, FieldActivator, RevalidationHandler {
-
- //
- // Constants
- //
- private static final boolean DEBUG = false;
-
- // feature identifiers
-
- /** Feature identifier: validation. */
- protected static final String VALIDATION =
- Constants.SAX_FEATURE_PREFIX + Constants.VALIDATION_FEATURE;
-
- /** Feature identifier: validation. */
- protected static final String SCHEMA_VALIDATION =
- Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_VALIDATION_FEATURE;
-
- /** Feature identifier: schema full checking*/
- protected static final String SCHEMA_FULL_CHECKING =
- Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_FULL_CHECKING;
-
- /** Feature identifier: dynamic validation. */
- protected static final String DYNAMIC_VALIDATION =
- Constants.XERCES_FEATURE_PREFIX + Constants.DYNAMIC_VALIDATION_FEATURE;
-
- /** Feature identifier: expose schema normalized value */
- protected static final String NORMALIZE_DATA =
- Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_NORMALIZED_VALUE;
-
- /** Feature identifier: send element default value via characters() */
- protected static final String SCHEMA_ELEMENT_DEFAULT =
- Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_ELEMENT_DEFAULT;
-
- /** Feature identifier: augment PSVI */
- protected static final String SCHEMA_AUGMENT_PSVI =
- Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_AUGMENT_PSVI;
-
- /** Feature identifier: whether to recognize java encoding names */
- protected static final String ALLOW_JAVA_ENCODINGS =
- Constants.XERCES_FEATURE_PREFIX + Constants.ALLOW_JAVA_ENCODINGS_FEATURE;
-
- /** Feature identifier: standard uri conformant feature. */
- protected static final String STANDARD_URI_CONFORMANT_FEATURE =
- Constants.XERCES_FEATURE_PREFIX + Constants.STANDARD_URI_CONFORMANT_FEATURE;
-
- /** Feature: generate synthetic annotations */
- protected static final String GENERATE_SYNTHETIC_ANNOTATIONS =
- Constants.XERCES_FEATURE_PREFIX + Constants.GENERATE_SYNTHETIC_ANNOTATIONS_FEATURE;
-
- /** Feature identifier: validate annotations. */
- protected static final String VALIDATE_ANNOTATIONS =
- Constants.XERCES_FEATURE_PREFIX + Constants.VALIDATE_ANNOTATIONS_FEATURE;
-
- /** Feature identifier: honour all schemaLocations */
- protected static final String HONOUR_ALL_SCHEMALOCATIONS =
- Constants.XERCES_FEATURE_PREFIX + Constants.HONOUR_ALL_SCHEMALOCATIONS_FEATURE;
-
- /** Feature identifier: use grammar pool only */
- protected static final String USE_GRAMMAR_POOL_ONLY =
- Constants.XERCES_FEATURE_PREFIX + Constants.USE_GRAMMAR_POOL_ONLY_FEATURE;
-
- /** Feature identifier: whether to continue parsing a schema after a fatal error is encountered */
- protected static final String CONTINUE_AFTER_FATAL_ERROR =
- Constants.XERCES_FEATURE_PREFIX + Constants.CONTINUE_AFTER_FATAL_ERROR_FEATURE;
-
- protected static final String PARSER_SETTINGS =
- Constants.XERCES_FEATURE_PREFIX + Constants.PARSER_SETTINGS;
-
- /** Feature identifier: namespace growth */
- protected static final String NAMESPACE_GROWTH =
- Constants.XERCES_FEATURE_PREFIX + Constants.NAMESPACE_GROWTH_FEATURE;
-
- /** Feature identifier: tolerate duplicates */
- protected static final String TOLERATE_DUPLICATES =
- Constants.XERCES_FEATURE_PREFIX + Constants.TOLERATE_DUPLICATES_FEATURE;
-
- protected static final String REPORT_WHITESPACE =
- Constants.SUN_SCHEMA_FEATURE_PREFIX + Constants.SUN_REPORT_IGNORED_ELEMENT_CONTENT_WHITESPACE;
-
- // property identifiers
-
- /** Property identifier: symbol table. */
- public static final String SYMBOL_TABLE =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY;
-
- /** Property identifier: error reporter. */
- public static final String ERROR_REPORTER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY;
-
- /** Property identifier: entity resolver. */
- public static final String ENTITY_RESOLVER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_RESOLVER_PROPERTY;
-
- /** Property identifier: grammar pool. */
- public static final String XMLGRAMMAR_POOL =
- Constants.XERCES_PROPERTY_PREFIX + Constants.XMLGRAMMAR_POOL_PROPERTY;
-
- protected static final String VALIDATION_MANAGER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.VALIDATION_MANAGER_PROPERTY;
-
- protected static final String ENTITY_MANAGER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_MANAGER_PROPERTY;
-
- /** Property identifier: schema location. */
- protected static final String SCHEMA_LOCATION =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SCHEMA_LOCATION;
-
- /** Property identifier: no namespace schema location. */
- protected static final String SCHEMA_NONS_LOCATION =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SCHEMA_NONS_LOCATION;
-
- /** Property identifier: JAXP schema source. */
- protected static final String JAXP_SCHEMA_SOURCE =
- Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_SOURCE;
-
- /** Property identifier: JAXP schema language. */
- protected static final String JAXP_SCHEMA_LANGUAGE =
- Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_LANGUAGE;
-
- /** Property identifier: Schema DV Factory */
- protected static final String SCHEMA_DV_FACTORY =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SCHEMA_DV_FACTORY_PROPERTY;
-
- /** Property identifier: Security property manager. */
- private static final String XML_SECURITY_PROPERTY_MANAGER =
- Constants.XML_SECURITY_PROPERTY_MANAGER;
-
- protected static final String USE_SERVICE_MECHANISM = Constants.ORACLE_FEATURE_SERVICE_MECHANISM;
-
- // recognized features and properties
-
- /** Recognized features. */
- private static final String[] RECOGNIZED_FEATURES =
- {
- VALIDATION,
- SCHEMA_VALIDATION,
- DYNAMIC_VALIDATION,
- SCHEMA_FULL_CHECKING,
- ALLOW_JAVA_ENCODINGS,
- CONTINUE_AFTER_FATAL_ERROR,
- STANDARD_URI_CONFORMANT_FEATURE,
- GENERATE_SYNTHETIC_ANNOTATIONS,
- VALIDATE_ANNOTATIONS,
- HONOUR_ALL_SCHEMALOCATIONS,
- USE_GRAMMAR_POOL_ONLY,
- NAMESPACE_GROWTH,
- TOLERATE_DUPLICATES,
- USE_SERVICE_MECHANISM
- };
-
- /** Feature defaults. */
- private static final Boolean[] FEATURE_DEFAULTS = { null,
- // NOTE: The following defaults are nulled out on purpose.
- // If they are set, then when the XML Schema validator
- // is constructed dynamically, these values may override
- // those set by the application. This goes against the
- // whole purpose of XMLComponent#getFeatureDefault but
- // it can't be helped in this case. -Ac
- null, //Boolean.FALSE,
- null, //Boolean.FALSE,
- null, //Boolean.FALSE,
- null, //Boolean.FALSE,
- null, //Boolean.FALSE,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- Boolean.TRUE
- };
-
- /** Recognized properties. */
- private static final String[] RECOGNIZED_PROPERTIES =
- {
- SYMBOL_TABLE,
- ERROR_REPORTER,
- ENTITY_RESOLVER,
- VALIDATION_MANAGER,
- SCHEMA_LOCATION,
- SCHEMA_NONS_LOCATION,
- JAXP_SCHEMA_SOURCE,
- JAXP_SCHEMA_LANGUAGE,
- SCHEMA_DV_FACTORY,
- XML_SECURITY_PROPERTY_MANAGER
- };
-
- /** Property defaults. */
- private static final Object[] PROPERTY_DEFAULTS =
- { null, null, null, null, null, null, null, null, null, null, null, null, null};
-
- // this is the number of valuestores of each kind
- // we expect an element to have. It's almost
- // never > 1; so leave it at that.
- protected static final int ID_CONSTRAINT_NUM = 1;
-
- //
- // Data
- //
-
- /** current PSVI element info */
- protected ElementPSVImpl fCurrentPSVI = new ElementPSVImpl();
-
- // since it is the responsibility of each component to an
- // Augmentations parameter if one is null, to save ourselves from
- // having to create this object continually, it is created here.
- // If it is not present in calls that we're passing on, we *must*
- // clear this before we introduce it into the pipeline.
- protected final AugmentationsImpl fAugmentations = new AugmentationsImpl();
-
- /**
- * Map which is used to catch instance documents that try
- * and match a field several times in the same scope.
- */
- protected final HashMap fMayMatchFieldMap = new HashMap();
-
- // this is included for the convenience of handleEndElement
- protected XMLString fDefaultValue;
-
- // Validation features
- protected boolean fDynamicValidation = false;
- protected boolean fSchemaDynamicValidation = false;
- protected boolean fDoValidation = false;
- protected boolean fFullChecking = false;
- protected boolean fNormalizeData = true;
- protected boolean fSchemaElementDefault = true;
- protected boolean fAugPSVI = true;
- protected boolean fIdConstraint = false;
- protected boolean fUseGrammarPoolOnly = false;
-
- // Namespace growth feature
- protected boolean fNamespaceGrowth = false;
-
- /** Schema type: None, DTD, Schema */
- private String fSchemaType = null;
-
- // to indicate whether we are in the scope of entity reference or CData
- protected boolean fEntityRef = false;
- protected boolean fInCDATA = false;
-
- // Did we see only whitespace in element content?
- protected boolean fSawOnlyWhitespaceInElementContent = false;
-
- // properties
-
- /** Symbol table. */
- protected SymbolTable fSymbolTable;
-
- /**
- * While parsing a document, keep the location of the document.
- */
- private XMLLocator fLocator;
-
- /**
- * A wrapper of the standard error reporter. We'll store all schema errors
- * in this wrapper object, so that we can get all errors (error codes) of
- * a specific element. This is useful for PSVI.
- */
- protected final class XSIErrorReporter {
-
- // the error reporter property
- XMLErrorReporter fErrorReporter;
-
- // store error codes; starting position of the errors for each element;
- // number of element (depth); and whether to record error
- Vector fErrors = new Vector();
- int[] fContext = new int[INITIAL_STACK_SIZE];
- int fContextCount;
-
- // set the external error reporter, clear errors
- public void reset(XMLErrorReporter errorReporter) {
- fErrorReporter = errorReporter;
- fErrors.removeAllElements();
- fContextCount = 0;
- }
-
- // should be called when starting process an element or an attribute.
- // store the starting position for the current context
- public void pushContext() {
- if (!fAugPSVI) {
- return;
- }
- // resize array if necessary
- if (fContextCount == fContext.length) {
- int newSize = fContextCount + INC_STACK_SIZE;
- int[] newArray = new int[newSize];
- System.arraycopy(fContext, 0, newArray, 0, fContextCount);
- fContext = newArray;
- }
-
- fContext[fContextCount++] = fErrors.size();
- }
-
- // should be called on endElement: get all errors of the current element
- public String[] popContext() {
- if (!fAugPSVI) {
- return null;
- }
- // get starting position of the current element
- int contextPos = fContext[--fContextCount];
- // number of errors of the current element
- int size = fErrors.size() - contextPos;
- // if no errors, return null
- if (size == 0)
- return null;
- // copy errors from the list to an string array
- String[] errors = new String[size];
- for (int i = 0; i < size; i++) {
- errors[i] = (String) fErrors.elementAt(contextPos + i);
- }
- // remove errors of the current element
- fErrors.setSize(contextPos);
- return errors;
- }
-
- // should be called when an attribute is done: get all errors of
- // this attribute, but leave the errors to the containing element
- // also called after an element was strictly assessed.
- public String[] mergeContext() {
- if (!fAugPSVI) {
- return null;
- }
- // get starting position of the current element
- int contextPos = fContext[--fContextCount];
- // number of errors of the current element
- int size = fErrors.size() - contextPos;
- // if no errors, return null
- if (size == 0)
- return null;
- // copy errors from the list to an string array
- String[] errors = new String[size];
- for (int i = 0; i < size; i++) {
- errors[i] = (String) fErrors.elementAt(contextPos + i);
- }
- // don't resize the vector: leave the errors for this attribute
- // to the containing element
- return errors;
- }
-
- public void reportError(String domain, String key, Object[] arguments, short severity)
- throws XNIException {
- fErrorReporter.reportError(domain, key, arguments, severity);
- if (fAugPSVI) {
- fErrors.addElement(key);
- }
- } // reportError(String,String,Object[],short)
-
- public void reportError(
- XMLLocator location,
- String domain,
- String key,
- Object[] arguments,
- short severity)
- throws XNIException {
- fErrorReporter.reportError(location, domain, key, arguments, severity);
- if (fAugPSVI) {
- fErrors.addElement(key);
- }
- } // reportError(XMLLocator,String,String,Object[],short)
- }
-
- /** Error reporter. */
- protected final XSIErrorReporter fXSIErrorReporter = new XSIErrorReporter();
-
- /** Entity resolver */
- protected XMLEntityResolver fEntityResolver;
-
- // updated during reset
- protected ValidationManager fValidationManager = null;
- protected ValidationState fValidationState = new ValidationState();
- protected XMLGrammarPool fGrammarPool;
-
- // schema location property values
- protected String fExternalSchemas = null;
- protected String fExternalNoNamespaceSchema = null;
-
- //JAXP Schema Source property
- protected Object fJaxpSchemaSource = null;
-
- /** Schema Grammar Description passed, to give a chance to application to supply the Grammar */
- protected final XSDDescription fXSDDescription = new XSDDescription();
- protected final Map<String, XMLSchemaLoader.LocationArray> fLocationPairs = new HashMap<>();
-
-
- // handlers
-
- /** Document handler. */
- protected XMLDocumentHandler fDocumentHandler;
-
- protected XMLDocumentSource fDocumentSource;
-
- boolean reportWhitespace = false;
-
- //
- // XMLComponent methods
- //
-
- /**
- * Returns a list of feature identifiers that are recognized by
- * this component. This method may return null if no features
- * are recognized by this component.
- */
- public String[] getRecognizedFeatures() {
- return (String[]) (RECOGNIZED_FEATURES.clone());
- } // getRecognizedFeatures():String[]
-
- /**
- * Sets the state of a feature. This method is called by the component
- * manager any time after reset when a feature changes state.
- * <p>
- * <strong>Note:</strong> Components should silently ignore features
- * that do not affect the operation of the component.
- *
- * @param featureId The feature identifier.
- * @param state The state of the feature.
- *
- * @throws SAXNotRecognizedException The component should not throw
- * this exception.
- * @throws SAXNotSupportedException The component should not throw
- * this exception.
- */
- public void setFeature(String featureId, boolean state) throws XMLConfigurationException {
- } // setFeature(String,boolean)
-
- /**
- * Returns a list of property identifiers that are recognized by
- * this component. This method may return null if no properties
- * are recognized by this component.
- */
- public String[] getRecognizedProperties() {
- return (String[]) (RECOGNIZED_PROPERTIES.clone());
- } // getRecognizedProperties():String[]
-
- /**
- * Sets the value of a property. This method is called by the component
- * manager any time after reset when a property changes value.
- * <p>
- * <strong>Note:</strong> Components should silently ignore properties
- * that do not affect the operation of the component.
- *
- * @param propertyId The property identifier.
- * @param value The value of the property.
- *
- * @throws SAXNotRecognizedException The component should not throw
- * this exception.
- * @throws SAXNotSupportedException The component should not throw
- * this exception.
- */
- public void setProperty(String propertyId, Object value) throws XMLConfigurationException {
- } // setProperty(String,Object)
-
- /**
- * Returns the default state for a feature, or null if this
- * component does not want to report a default value for this
- * feature.
- *
- * @param featureId The feature identifier.
- *
- * @since Xerces 2.2.0
- */
- public Boolean getFeatureDefault(String featureId) {
- for (int i = 0; i < RECOGNIZED_FEATURES.length; i++) {
- if (RECOGNIZED_FEATURES[i].equals(featureId)) {
- return FEATURE_DEFAULTS[i];
- }
- }
- return null;
- } // getFeatureDefault(String):Boolean
-
- /**
- * Returns the default state for a property, or null if this
- * component does not want to report a default value for this
- * property.
- *
- * @param propertyId The property identifier.
- *
- * @since Xerces 2.2.0
- */
- public Object getPropertyDefault(String propertyId) {
- for (int i = 0; i < RECOGNIZED_PROPERTIES.length; i++) {
- if (RECOGNIZED_PROPERTIES[i].equals(propertyId)) {
- return PROPERTY_DEFAULTS[i];
- }
- }
- return null;
- } // getPropertyDefault(String):Object
-
- //
- // XMLDocumentSource methods
- //
-
- /** Sets the document handler to receive information about the document. */
- public void setDocumentHandler(XMLDocumentHandler documentHandler) {
- fDocumentHandler = documentHandler;
-
- // Init reportWhitespace for this handler
- if (documentHandler instanceof XMLParser) {
- try {
- reportWhitespace =
- ((XMLParser) documentHandler).getFeature(REPORT_WHITESPACE);
- }
- catch (Exception e) {
- reportWhitespace = false;
- }
- }
- } // setDocumentHandler(XMLDocumentHandler)
-
- /** Returns the document handler */
- public XMLDocumentHandler getDocumentHandler() {
- return fDocumentHandler;
- } // setDocumentHandler(XMLDocumentHandler)
-
- //
- // XMLDocumentHandler methods
- //
-
- /** Sets the document source */
- public void setDocumentSource(XMLDocumentSource source) {
- fDocumentSource = source;
- } // setDocumentSource
-
- /** Returns the document source */
- public XMLDocumentSource getDocumentSource() {
- return fDocumentSource;
- } // getDocumentSource
-
- /**
- * The start of the document.
- *
- * @param locator The system identifier of the entity if the entity
- * is external, null otherwise.
- * @param encoding The auto-detected IANA encoding name of the entity
- * stream. This value will be null in those situations
- * where the entity encoding is not auto-detected (e.g.
- * internal entities or a document entity that is
- * parsed from a java.io.Reader).
- * @param namespaceContext
- * The namespace context in effect at the
- * start of this document.
- * This object represents the current context.
- * Implementors of this class are responsible
- * for copying the namespace bindings from the
- * the current context (and its parent contexts)
- * if that information is important.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startDocument(
- XMLLocator locator,
- String encoding,
- NamespaceContext namespaceContext,
- Augmentations augs)
- throws XNIException {
-
- fValidationState.setNamespaceSupport(namespaceContext);
- fState4XsiType.setNamespaceSupport(namespaceContext);
- fState4ApplyDefault.setNamespaceSupport(namespaceContext);
- fLocator = locator;
-
- handleStartDocument(locator, encoding);
- // call handlers
- if (fDocumentHandler != null) {
- fDocumentHandler.startDocument(locator, encoding, namespaceContext, augs);
- }
-
- } // startDocument(XMLLocator,String)
-
- /**
- * Notifies of the presence of an XMLDecl line in the document. If
- * present, this method will be called immediately following the
- * startDocument call.
- *
- * @param version The XML version.
- * @param encoding The IANA encoding name of the document, or null if
- * not specified.
- * @param standalone The standalone value, or null if not specified.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void xmlDecl(String version, String encoding, String standalone, Augmentations augs)
- throws XNIException {
-
- // call handlers
- if (fDocumentHandler != null) {
- fDocumentHandler.xmlDecl(version, encoding, standalone, augs);
- }
-
- } // xmlDecl(String,String,String)
-
- /**
- * Notifies of the presence of the DOCTYPE line in the document.
- *
- * @param rootElement The name of the root element.
- * @param publicId The public identifier if an external DTD or null
- * if the external DTD is specified using SYSTEM.
- * @param systemId The system identifier if an external DTD, null
- * otherwise.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void doctypeDecl(
- String rootElement,
- String publicId,
- String systemId,
- Augmentations augs)
- throws XNIException {
-
- // call handlers
- if (fDocumentHandler != null) {
- fDocumentHandler.doctypeDecl(rootElement, publicId, systemId, augs);
- }
-
- } // doctypeDecl(String,String,String)
-
- /**
- * The start of an element.
- *
- * @param element The name of the element.
- * @param attributes The element attributes.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startElement(QName element, XMLAttributes attributes, Augmentations augs)
- throws XNIException {
-
- Augmentations modifiedAugs = handleStartElement(element, attributes, augs);
- // call handlers
- if (fDocumentHandler != null) {
- fDocumentHandler.startElement(element, attributes, modifiedAugs);
- }
-
- } // startElement(QName,XMLAttributes, Augmentations)
-
- /**
- * An empty element.
- *
- * @param element The name of the element.
- * @param attributes The element attributes.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void emptyElement(QName element, XMLAttributes attributes, Augmentations augs)
- throws XNIException {
-
- Augmentations modifiedAugs = handleStartElement(element, attributes, augs);
-
- // in the case where there is a {value constraint}, and the element
- // doesn't have any text content, change emptyElement call to
- // start + characters + end
- fDefaultValue = null;
- // fElementDepth == -2 indicates that the schema validator was removed
- // from the pipeline. then we don't need to call handleEndElement.
- if (fElementDepth != -2)
- modifiedAugs = handleEndElement(element, modifiedAugs);
-
- // call handlers
- if (fDocumentHandler != null) {
- if (!fSchemaElementDefault || fDefaultValue == null) {
- fDocumentHandler.emptyElement(element, attributes, modifiedAugs);
- } else {
- fDocumentHandler.startElement(element, attributes, modifiedAugs);
- fDocumentHandler.characters(fDefaultValue, null);
- fDocumentHandler.endElement(element, modifiedAugs);
- }
- }
- } // emptyElement(QName,XMLAttributes, Augmentations)
-
- /**
- * Character content.
- *
- * @param text The content.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void characters(XMLString text, Augmentations augs) throws XNIException {
- text = handleCharacters(text);
-
- if (fSawOnlyWhitespaceInElementContent) {
- fSawOnlyWhitespaceInElementContent = false;
- if (!reportWhitespace) {
- ignorableWhitespace(text, augs);
- return;
- }
- }
-
- // call handlers
- if (fDocumentHandler != null) {
- if (fNormalizeData && fUnionType) {
- // for union types we can't normalize data
- // thus we only need to send augs information if any;
- // the normalized data for union will be send
- // after normalization is performed (at the endElement())
- if (augs != null)
- fDocumentHandler.characters(fEmptyXMLStr, augs);
- } else {
- fDocumentHandler.characters(text, augs);
- }
- }
-
- } // characters(XMLString)
-
- /**
- * Ignorable whitespace. For this method to be called, the document
- * source must have some way of determining that the text containing
- * only whitespace characters should be considered ignorable. For
- * example, the validator can determine if a length of whitespace
- * characters in the document are ignorable based on the element
- * content model.
- *
- * @param text The ignorable whitespace.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void ignorableWhitespace(XMLString text, Augmentations augs) throws XNIException {
- handleIgnorableWhitespace(text);
- // call handlers
- if (fDocumentHandler != null) {
- fDocumentHandler.ignorableWhitespace(text, augs);
- }
-
- } // ignorableWhitespace(XMLString)
-
- /**
- * The end of an element.
- *
- * @param element The name of the element.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endElement(QName element, Augmentations augs) throws XNIException {
-
- // in the case where there is a {value constraint}, and the element
- // doesn't have any text content, add a characters call.
- fDefaultValue = null;
- Augmentations modifiedAugs = handleEndElement(element, augs);
- // call handlers
- if (fDocumentHandler != null) {
- if (!fSchemaElementDefault || fDefaultValue == null) {
- fDocumentHandler.endElement(element, modifiedAugs);
- } else {
- fDocumentHandler.characters(fDefaultValue, null);
- fDocumentHandler.endElement(element, modifiedAugs);
- }
- }
- } // endElement(QName, Augmentations)
-
- /**
- * The start of a CDATA section.
- *
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startCDATA(Augmentations augs) throws XNIException {
-
- // REVISIT: what should we do here if schema normalization is on??
- fInCDATA = true;
- // call handlers
- if (fDocumentHandler != null) {
- fDocumentHandler.startCDATA(augs);
- }
-
- } // startCDATA()
-
- /**
- * The end of a CDATA section.
- *
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endCDATA(Augmentations augs) throws XNIException {
-
- // call handlers
- fInCDATA = false;
- if (fDocumentHandler != null) {
- fDocumentHandler.endCDATA(augs);
- }
-
- } // endCDATA()
-
- /**
- * The end of the document.
- *
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endDocument(Augmentations augs) throws XNIException {
-
- handleEndDocument();
-
- // call handlers
- if (fDocumentHandler != null) {
- fDocumentHandler.endDocument(augs);
- }
- fLocator = null;
-
- } // endDocument(Augmentations)
-
- //
- // DOMRevalidationHandler methods
- //
-
-
-
-
-
- public boolean characterData(String data, Augmentations augs) {
-
- fSawText = fSawText || data.length() > 0;
-
- // REVISIT: this methods basically duplicates implementation of
- // handleCharacters(). We should be able to reuse some code
-
- // if whitespace == -1 skip normalization, because it is a complexType
- // or a union type.
- if (fNormalizeData && fWhiteSpace != -1 && fWhiteSpace != XSSimpleType.WS_PRESERVE) {
- // normalize data
- normalizeWhitespace(data, fWhiteSpace == XSSimpleType.WS_COLLAPSE);
- fBuffer.append(fNormalizedStr.ch, fNormalizedStr.offset, fNormalizedStr.length);
- } else {
- if (fAppendBuffer)
- fBuffer.append(data);
- }
-
- // When it's a complex type with element-only content, we need to
- // find out whether the content contains any non-whitespace character.
- boolean allWhiteSpace = true;
- if (fCurrentType != null
- && fCurrentType.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE) {
- XSComplexTypeDecl ctype = (XSComplexTypeDecl) fCurrentType;
- if (ctype.fContentType == XSComplexTypeDecl.CONTENTTYPE_ELEMENT) {
- // data outside of element content
- for (int i = 0; i < data.length(); i++) {
- if (!XMLChar.isSpace(data.charAt(i))) {
- allWhiteSpace = false;
- fSawCharacters = true;
- break;
- }
- }
- }
- }
-
- return allWhiteSpace;
- }
-
- public void elementDefault(String data) {
- // no-op
- }
-
- //
- // XMLDocumentHandler and XMLDTDHandler methods
- //
-
- /**
- * This method notifies the start of a general entity.
- * <p>
- * <strong>Note:</strong> This method is not called for entity references
- * appearing as part of attribute values.
- *
- * @param name The name of the general entity.
- * @param identifier The resource identifier.
- * @param encoding The auto-detected IANA encoding name of the entity
- * stream. This value will be null in those situations
- * where the entity encoding is not auto-detected (e.g.
- * internal entities or a document entity that is
- * parsed from a java.io.Reader).
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException Thrown by handler to signal an error.
- */
- public void startGeneralEntity(
- String name,
- XMLResourceIdentifier identifier,
- String encoding,
- Augmentations augs)
- throws XNIException {
-
- // REVISIT: what should happen if normalize_data_ is on??
- fEntityRef = true;
- // call handlers
- if (fDocumentHandler != null) {
- fDocumentHandler.startGeneralEntity(name, identifier, encoding, augs);
- }
-
- } // startEntity(String,String,String,String,String)
-
- /**
- * Notifies of the presence of a TextDecl line in an entity. If present,
- * this method will be called immediately following the startEntity call.
- * <p>
- * <strong>Note:</strong> This method will never be called for the
- * document entity; it is only called for external general entities
- * referenced in document content.
- * <p>
- * <strong>Note:</strong> This method is not called for entity references
- * appearing as part of attribute values.
- *
- * @param version The XML version, or null if not specified.
- * @param encoding The IANA encoding name of the entity.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void textDecl(String version, String encoding, Augmentations augs) throws XNIException {
-
- // call handlers
- if (fDocumentHandler != null) {
- fDocumentHandler.textDecl(version, encoding, augs);
- }
-
- } // textDecl(String,String)
-
- /**
- * A comment.
- *
- * @param text The text in the comment.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by application to signal an error.
- */
- public void comment(XMLString text, Augmentations augs) throws XNIException {
-
- // call handlers
- if (fDocumentHandler != null) {
- fDocumentHandler.comment(text, augs);
- }
-
- } // comment(XMLString)
-
- /**
- * A processing instruction. Processing instructions consist of a
- * target name and, optionally, text data. The data is only meaningful
- * to the application.
- * <p>
- * Typically, a processing instruction's data will contain a series
- * of pseudo-attributes. These pseudo-attributes follow the form of
- * element attributes but are <strong>not</strong> parsed or presented
- * to the application as anything other than text. The application is
- * responsible for parsing the data.
- *
- * @param target The target.
- * @param data The data or null if none specified.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void processingInstruction(String target, XMLString data, Augmentations augs)
- throws XNIException {
-
- // call handlers
- if (fDocumentHandler != null) {
- fDocumentHandler.processingInstruction(target, data, augs);
- }
-
- } // processingInstruction(String,XMLString)
-
- /**
- * This method notifies the end of a general entity.
- * <p>
- * <strong>Note:</strong> This method is not called for entity references
- * appearing as part of attribute values.
- *
- * @param name The name of the entity.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void endGeneralEntity(String name, Augmentations augs) throws XNIException {
-
- // call handlers
- fEntityRef = false;
- if (fDocumentHandler != null) {
- fDocumentHandler.endGeneralEntity(name, augs);
- }
-
- } // endEntity(String)
-
- // constants
-
- static final int INITIAL_STACK_SIZE = 8;
- static final int INC_STACK_SIZE = 8;
-
- //
- // Data
- //
-
- // Schema Normalization
-
- private static final boolean DEBUG_NORMALIZATION = false;
- // temporary empty string buffer.
- private final XMLString fEmptyXMLStr = new XMLString(null, 0, -1);
- // temporary character buffer, and empty string buffer.
- private static final int BUFFER_SIZE = 20;
- private final XMLString fNormalizedStr = new XMLString();
- private boolean fFirstChunk = true;
- // got first chunk in characters() (SAX)
- private boolean fTrailing = false; // Previous chunk had a trailing space
- private short fWhiteSpace = -1; //whiteSpace: preserve/replace/collapse
- private boolean fUnionType = false;
-
- /** Schema grammar resolver. */
- private final XSGrammarBucket fGrammarBucket = new XSGrammarBucket();
- private final SubstitutionGroupHandler fSubGroupHandler = new SubstitutionGroupHandler(fGrammarBucket);
-
- /** the DV usd to convert xsi:type to a QName */
- // REVISIT: in new simple type design, make things in DVs static,
- // so that we can QNameDV.getCompiledForm()
- private final XSSimpleType fQNameDV =
- (XSSimpleType) SchemaGrammar.SG_SchemaNS.getGlobalTypeDecl(SchemaSymbols.ATTVAL_QNAME);
-
- private final CMNodeFactory nodeFactory = new CMNodeFactory();
- /** used to build content models */
- // REVISIT: create decl pool, and pass it to each traversers
- private final CMBuilder fCMBuilder = new CMBuilder(nodeFactory);
-
- // Schema grammar loader
- private final XMLSchemaLoader fSchemaLoader =
- new XMLSchemaLoader(
- fXSIErrorReporter.fErrorReporter,
- fGrammarBucket,
- fSubGroupHandler,
- fCMBuilder);
-
- // state
-
- /** String representation of the validation root. */
- // REVISIT: what do we store here? QName, XPATH, some ID? use rawname now.
- private String fValidationRoot;
-
- /** Skip validation: anything below this level should be skipped */
- private int fSkipValidationDepth;
-
- /** anything above this level has validation_attempted != full */
- private int fNFullValidationDepth;
-
- /** anything above this level has validation_attempted != none */
- private int fNNoneValidationDepth;
-
- /** Element depth: -2: validator not in pipeline; >= -1 current depth. */
- private int fElementDepth;
-
- /** Seen sub elements. */
- private boolean fSubElement;
-
- /** Seen sub elements stack. */
- private boolean[] fSubElementStack = new boolean[INITIAL_STACK_SIZE];
-
- /** Current element declaration. */
- private XSElementDecl fCurrentElemDecl;
-
- /** Element decl stack. */
- private XSElementDecl[] fElemDeclStack = new XSElementDecl[INITIAL_STACK_SIZE];
-
- /** nil value of the current element */
- private boolean fNil;
-
- /** nil value stack */
- private boolean[] fNilStack = new boolean[INITIAL_STACK_SIZE];
-
- /** notation value of the current element */
- private XSNotationDecl fNotation;
-
- /** notation stack */
- private XSNotationDecl[] fNotationStack = new XSNotationDecl[INITIAL_STACK_SIZE];
-
- /** Current type. */
- private XSTypeDefinition fCurrentType;
-
- /** type stack. */
- private XSTypeDefinition[] fTypeStack = new XSTypeDefinition[INITIAL_STACK_SIZE];
-
- /** Current content model. */
- private XSCMValidator fCurrentCM;
-
- /** Content model stack. */
- private XSCMValidator[] fCMStack = new XSCMValidator[INITIAL_STACK_SIZE];
-
- /** the current state of the current content model */
- private int[] fCurrCMState;
-
- /** stack to hold content model states */
- private int[][] fCMStateStack = new int[INITIAL_STACK_SIZE][];
-
- /** whether the curret element is strictly assessed */
- private boolean fStrictAssess = true;
-
- /** strict assess stack */
- private boolean[] fStrictAssessStack = new boolean[INITIAL_STACK_SIZE];
-
- /** Temporary string buffers. */
- private final StringBuffer fBuffer = new StringBuffer();
-
- /** Whether need to append characters to fBuffer */
- private boolean fAppendBuffer = true;
-
- /** Did we see any character data? */
- private boolean fSawText = false;
-
- /** stack to record if we saw character data */
- private boolean[] fSawTextStack = new boolean[INITIAL_STACK_SIZE];
-
- /** Did we see non-whitespace character data? */
- private boolean fSawCharacters = false;
-
- /** Stack to record if we saw character data outside of element content*/
- private boolean[] fStringContent = new boolean[INITIAL_STACK_SIZE];
-
- /** temporary qname */
- private final QName fTempQName = new QName();
-
- /** temporary validated info */
- private ValidatedInfo fValidatedInfo = new ValidatedInfo();
-
- // used to validate default/fixed values against xsi:type
- // only need to check facets, so we set extraChecking to false (in reset)
- private ValidationState fState4XsiType = new ValidationState();
-
- // used to apply default/fixed values
- // only need to check id/idref/entity, so we set checkFacets to false
- private ValidationState fState4ApplyDefault = new ValidationState();
-
- // identity constraint information
-
- /**
- * Stack of active XPath matchers for identity constraints. All
- * active XPath matchers are notified of startElement
- * and endElement callbacks in order to perform their matches.
- * <p>
- * For each element with identity constraints, the selector of
- * each identity constraint is activated. When the selector matches
- * its XPath, then all the fields of the identity constraint are
- * activated.
- * <p>
- * <strong>Note:</strong> Once the activation scope is left, the
- * XPath matchers are automatically removed from the stack of
- * active matchers and no longer receive callbacks.
- */
- protected XPathMatcherStack fMatcherStack = new XPathMatcherStack();
-
- /** Cache of value stores for identity constraint fields. */
- protected ValueStoreCache fValueStoreCache = new ValueStoreCache();
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- public XMLSchemaValidator() {
- fState4XsiType.setExtraChecking(false);
- fState4ApplyDefault.setFacetChecking(false);
-
- } // <init>()
-
- /*
- * Resets the component. The component can query the component manager
- * about any features and properties that affect the operation of the
- * component.
- *
- * @param componentManager The component manager.
- *
- * @throws SAXException Thrown by component on finitialization error.
- * For example, if a feature or property is
- * required for the operation of the component, the
- * component manager may throw a
- * SAXNotRecognizedException or a
- * SAXNotSupportedException.
- */
- public void reset(XMLComponentManager componentManager) throws XMLConfigurationException {
-
-
- fIdConstraint = false;
- //reset XSDDescription
- fLocationPairs.clear();
-
- // cleanup id table
- fValidationState.resetIDTables();
-
- //pass the component manager to the factory..
- nodeFactory.reset(componentManager);
-
- // reset schema loader
- fSchemaLoader.reset(componentManager);
-
- // initialize state
- fCurrentElemDecl = null;
- fCurrentCM = null;
- fCurrCMState = null;
- fSkipValidationDepth = -1;
- fNFullValidationDepth = -1;
- fNNoneValidationDepth = -1;
- fElementDepth = -1;
- fSubElement = false;
- fSchemaDynamicValidation = false;
-
- // datatype normalization
- fEntityRef = false;
- fInCDATA = false;
-
- fMatcherStack.clear();
-
- if (!fMayMatchFieldMap.isEmpty()) {
- // should only clear this if the last schema had identity constraints.
- fMayMatchFieldMap.clear();
- }
-
- // get error reporter
- fXSIErrorReporter.reset((XMLErrorReporter) componentManager.getProperty(ERROR_REPORTER));
-
- boolean parser_settings = componentManager.getFeature(PARSER_SETTINGS, true);
-
- if (!parser_settings){
- // parser settings have not been changed
- fValidationManager.addValidationState(fValidationState);
- // Re-parse external schema location properties.
- XMLSchemaLoader.processExternalHints(
- fExternalSchemas,
- fExternalNoNamespaceSchema,
- fLocationPairs,
- fXSIErrorReporter.fErrorReporter);
- return;
- }
-
-
- // get symbol table. if it's a new one, add symbols to it.
- SymbolTable symbolTable = (SymbolTable) componentManager.getProperty(SYMBOL_TABLE);
- if (symbolTable != fSymbolTable) {
- fSymbolTable = symbolTable;
- }
-
- fNamespaceGrowth = componentManager.getFeature(NAMESPACE_GROWTH, false);
- fDynamicValidation = componentManager.getFeature(DYNAMIC_VALIDATION, false);
-
- if (fDynamicValidation) {
- fDoValidation = true;
- } else {
- fDoValidation = componentManager.getFeature(VALIDATION, false);
- }
-
- if (fDoValidation) {
- fDoValidation |= componentManager.getFeature(XMLSchemaValidator.SCHEMA_VALIDATION, false);
- }
-
- fFullChecking = componentManager.getFeature(SCHEMA_FULL_CHECKING, false);
- fNormalizeData = componentManager.getFeature(NORMALIZE_DATA, false);
- fSchemaElementDefault = componentManager.getFeature(SCHEMA_ELEMENT_DEFAULT, false);
-
- fAugPSVI = componentManager.getFeature(SCHEMA_AUGMENT_PSVI, true);
-
- fSchemaType =
- (String) componentManager.getProperty(
- Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_LANGUAGE, null);
-
- fUseGrammarPoolOnly = componentManager.getFeature(USE_GRAMMAR_POOL_ONLY, false);
-
- fEntityResolver = (XMLEntityResolver) componentManager.getProperty(ENTITY_MANAGER);
-
- fValidationManager = (ValidationManager) componentManager.getProperty(VALIDATION_MANAGER);
- fValidationManager.addValidationState(fValidationState);
- fValidationState.setSymbolTable(fSymbolTable);
-
-
- // get schema location properties
- try {
- fExternalSchemas = (String) componentManager.getProperty(SCHEMA_LOCATION);
- fExternalNoNamespaceSchema =
- (String) componentManager.getProperty(SCHEMA_NONS_LOCATION);
- } catch (XMLConfigurationException e) {
- fExternalSchemas = null;
- fExternalNoNamespaceSchema = null;
- }
-
- // store the external schema locations. they are set when reset is called,
- // so any other schemaLocation declaration for the same namespace will be
- // effectively ignored. becuase we choose to take first location hint
- // available for a particular namespace.
- XMLSchemaLoader.processExternalHints(
- fExternalSchemas,
- fExternalNoNamespaceSchema,
- fLocationPairs,
- fXSIErrorReporter.fErrorReporter);
-
- fJaxpSchemaSource = componentManager.getProperty(JAXP_SCHEMA_SOURCE, null);
-
- // clear grammars, and put the one for schema namespace there
- fGrammarPool = (XMLGrammarPool) componentManager.getProperty(XMLGRAMMAR_POOL, null);
-
- fState4XsiType.setSymbolTable(symbolTable);
- fState4ApplyDefault.setSymbolTable(symbolTable);
-
- } // reset(XMLComponentManager)
-
- //
- // FieldActivator methods
- //
-
- /**
- * Start the value scope for the specified identity constraint. This
- * method is called when the selector matches in order to initialize
- * the value store.
- *
- * @param identityConstraint The identity constraint.
- */
- public void startValueScopeFor(IdentityConstraint identityConstraint, int initialDepth) {
-
- ValueStoreBase valueStore =
- fValueStoreCache.getValueStoreFor(identityConstraint, initialDepth);
- valueStore.startValueScope();
-
- } // startValueScopeFor(IdentityConstraint identityConstraint)
-
- /**
- * Request to activate the specified field. This method returns the
- * matcher for the field.
- *
- * @param field The field to activate.
- */
- public XPathMatcher activateField(Field field, int initialDepth) {
- ValueStore valueStore =
- fValueStoreCache.getValueStoreFor(field.getIdentityConstraint(), initialDepth);
- setMayMatch(field, Boolean.TRUE);
- XPathMatcher matcher = field.createMatcher(this, valueStore);
- fMatcherStack.addMatcher(matcher);
- matcher.startDocumentFragment();
- return matcher;
- } // activateField(Field):XPathMatcher
-
- /**
- * Ends the value scope for the specified identity constraint.
- *
- * @param identityConstraint The identity constraint.
- */
- public void endValueScopeFor(IdentityConstraint identityConstraint, int initialDepth) {
-
- ValueStoreBase valueStore =
- fValueStoreCache.getValueStoreFor(identityConstraint, initialDepth);
- valueStore.endValueScope();
-
- } // endValueScopeFor(IdentityConstraint)
-
- /**
- * Sets whether the given field is permitted to match a value.
- * This should be used to catch instance documents that try
- * and match a field several times in the same scope.
- *
- * @param field The field that may be permitted to be matched.
- * @param state Boolean indiciating whether the field may be matched.
- */
- public void setMayMatch(Field field, Boolean state) {
- fMayMatchFieldMap.put(field, state);
- } // setMayMatch(Field, Boolean)
-
- /**
- * Returns whether the given field is permitted to match a value.
- *
- * @param field The field that may be permitted to be matched.
- * @return Boolean indicating whether the field may be matched.
- */
- public Boolean mayMatch(Field field) {
- return (Boolean) fMayMatchFieldMap.get(field);
- } // mayMatch(Field):Boolean
-
- // a utility method for Identity constraints
- private void activateSelectorFor(IdentityConstraint ic) {
- Selector selector = ic.getSelector();
- FieldActivator activator = this;
- if (selector == null)
- return;
- XPathMatcher matcher = selector.createMatcher(activator, fElementDepth);
- fMatcherStack.addMatcher(matcher);
- matcher.startDocumentFragment();
- }
-
- //
- // Protected methods
- //
-
- /** ensure element stack capacity */
- void ensureStackCapacity() {
-
- if (fElementDepth == fElemDeclStack.length) {
- int newSize = fElementDepth + INC_STACK_SIZE;
- boolean[] newArrayB = new boolean[newSize];
- System.arraycopy(fSubElementStack, 0, newArrayB, 0, fElementDepth);
- fSubElementStack = newArrayB;
-
- XSElementDecl[] newArrayE = new XSElementDecl[newSize];
- System.arraycopy(fElemDeclStack, 0, newArrayE, 0, fElementDepth);
- fElemDeclStack = newArrayE;
-
- newArrayB = new boolean[newSize];
- System.arraycopy(fNilStack, 0, newArrayB, 0, fElementDepth);
- fNilStack = newArrayB;
-
- XSNotationDecl[] newArrayN = new XSNotationDecl[newSize];
- System.arraycopy(fNotationStack, 0, newArrayN, 0, fElementDepth);
- fNotationStack = newArrayN;
-
- XSTypeDefinition[] newArrayT = new XSTypeDefinition[newSize];
- System.arraycopy(fTypeStack, 0, newArrayT, 0, fElementDepth);
- fTypeStack = newArrayT;
-
- XSCMValidator[] newArrayC = new XSCMValidator[newSize];
- System.arraycopy(fCMStack, 0, newArrayC, 0, fElementDepth);
- fCMStack = newArrayC;
-
- newArrayB = new boolean[newSize];
- System.arraycopy(fSawTextStack, 0, newArrayB, 0, fElementDepth);
- fSawTextStack = newArrayB;
-
- newArrayB = new boolean[newSize];
- System.arraycopy(fStringContent, 0, newArrayB, 0, fElementDepth);
- fStringContent = newArrayB;
-
- newArrayB = new boolean[newSize];
- System.arraycopy(fStrictAssessStack, 0, newArrayB, 0, fElementDepth);
- fStrictAssessStack = newArrayB;
-
- int[][] newArrayIA = new int[newSize][];
- System.arraycopy(fCMStateStack, 0, newArrayIA, 0, fElementDepth);
- fCMStateStack = newArrayIA;
- }
-
- } // ensureStackCapacity
-
- // handle start document
- void handleStartDocument(XMLLocator locator, String encoding) {
- fValueStoreCache.startDocument();
- if (fAugPSVI) {
- fCurrentPSVI.fGrammars = null;
- fCurrentPSVI.fSchemaInformation = null;
- }
- } // handleStartDocument(XMLLocator,String)
-
- void handleEndDocument() {
- fValueStoreCache.endDocument();
- } // handleEndDocument()
-
- // handle character contents
- // returns the normalized string if possible, otherwise the original string
- XMLString handleCharacters(XMLString text) {
-
- if (fSkipValidationDepth >= 0)
- return text;
-
- fSawText = fSawText || text.length > 0;
-
- // Note: data in EntityRef and CDATA is normalized as well
- // if whitespace == -1 skip normalization, because it is a complexType
- // or a union type.
- if (fNormalizeData && fWhiteSpace != -1 && fWhiteSpace != XSSimpleType.WS_PRESERVE) {
- // normalize data
- normalizeWhitespace(text, fWhiteSpace == XSSimpleType.WS_COLLAPSE);
- text = fNormalizedStr;
- }
- if (fAppendBuffer)
- fBuffer.append(text.ch, text.offset, text.length);
-
- // When it's a complex type with element-only content, we need to
- // find out whether the content contains any non-whitespace character.
- fSawOnlyWhitespaceInElementContent = false;
- if (fCurrentType != null
- && fCurrentType.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE) {
- XSComplexTypeDecl ctype = (XSComplexTypeDecl) fCurrentType;
- if (ctype.fContentType == XSComplexTypeDecl.CONTENTTYPE_ELEMENT) {
- // data outside of element content
- for (int i = text.offset; i < text.offset + text.length; i++) {
- if (!XMLChar.isSpace(text.ch[i])) {
- fSawCharacters = true;
- break;
- }
- fSawOnlyWhitespaceInElementContent = !fSawCharacters;
- }
- }
- }
-
- return text;
- } // handleCharacters(XMLString)
-
- /**
- * Normalize whitespace in an XMLString according to the rules defined
- * in XML Schema specifications.
- * @param value The string to normalize.
- * @param collapse replace or collapse
- */
- private void normalizeWhitespace(XMLString value, boolean collapse) {
- boolean skipSpace = collapse;
- boolean sawNonWS = false;
- boolean leading = false;
- boolean trailing = false;
- char c;
- int size = value.offset + value.length;
-
- // ensure the ch array is big enough
- if (fNormalizedStr.ch == null || fNormalizedStr.ch.length < value.length + 1) {
- fNormalizedStr.ch = new char[value.length + 1];
- }
- // don't include the leading ' ' for now. might include it later.
- fNormalizedStr.offset = 1;
- fNormalizedStr.length = 1;
-
- for (int i = value.offset; i < size; i++) {
- c = value.ch[i];
- if (XMLChar.isSpace(c)) {
- if (!skipSpace) {
- // take the first whitespace as a space and skip the others
- fNormalizedStr.ch[fNormalizedStr.length++] = ' ';
- skipSpace = collapse;
- }
- if (!sawNonWS) {
- // this is a leading whitespace, record it
- leading = true;
- }
- } else {
- fNormalizedStr.ch[fNormalizedStr.length++] = c;
- skipSpace = false;
- sawNonWS = true;
- }
- }
- if (skipSpace) {
- if (fNormalizedStr.length > 1) {
- // if we finished on a space trim it but also record it
- fNormalizedStr.length--;
- trailing = true;
- } else if (leading && !fFirstChunk) {
- // if all we had was whitespace we skipped record it as
- // trailing whitespace as well
- trailing = true;
- }
- }
-
- if (fNormalizedStr.length > 1) {
- if (!fFirstChunk && (fWhiteSpace == XSSimpleType.WS_COLLAPSE)) {
- if (fTrailing) {
- // previous chunk ended on whitespace
- // insert whitespace
- fNormalizedStr.offset = 0;
- fNormalizedStr.ch[0] = ' ';
- } else if (leading) {
- // previous chunk ended on character,
- // this chunk starts with whitespace
- fNormalizedStr.offset = 0;
- fNormalizedStr.ch[0] = ' ';
- }
- }
- }
-
- // The length includes the leading ' '. Now removing it.
- fNormalizedStr.length -= fNormalizedStr.offset;
-
- fTrailing = trailing;
-
- if (trailing || sawNonWS)
- fFirstChunk = false;
- }
-
- private void normalizeWhitespace(String value, boolean collapse) {
- boolean skipSpace = collapse;
- char c;
- int size = value.length();
-
- // ensure the ch array is big enough
- if (fNormalizedStr.ch == null || fNormalizedStr.ch.length < size) {
- fNormalizedStr.ch = new char[size];
- }
- fNormalizedStr.offset = 0;
- fNormalizedStr.length = 0;
-
- for (int i = 0; i < size; i++) {
- c = value.charAt(i);
- if (XMLChar.isSpace(c)) {
- if (!skipSpace) {
- // take the first whitespace as a space and skip the others
- fNormalizedStr.ch[fNormalizedStr.length++] = ' ';
- skipSpace = collapse;
- }
- } else {
- fNormalizedStr.ch[fNormalizedStr.length++] = c;
- skipSpace = false;
- }
- }
- if (skipSpace) {
- if (fNormalizedStr.length != 0)
- // if we finished on a space trim it but also record it
- fNormalizedStr.length--;
- }
- }
-
- // handle ignorable whitespace
- void handleIgnorableWhitespace(XMLString text) {
-
- if (fSkipValidationDepth >= 0)
- return;
-
- // REVISIT: the same process needs to be performed as handleCharacters.
- // only it's simpler here: we know all characters are whitespaces.
-
- } // handleIgnorableWhitespace(XMLString)
-
- /** Handle element. */
- Augmentations handleStartElement(QName element, XMLAttributes attributes, Augmentations augs) {
-
- if (DEBUG) {
- System.out.println("==>handleStartElement: " + element);
- }
-
- // root element
- if (fElementDepth == -1 && fValidationManager.isGrammarFound()) {
- if (fSchemaType == null) {
- // schemaType is not specified
- // if a DTD grammar is found, we do the same thing as Dynamic:
- // if a schema grammar is found, validation is performed;
- // otherwise, skip the whole document.
- fSchemaDynamicValidation = true;
- } else {
- // [1] Either schemaType is DTD, and in this case validate/schema is turned off
- // [2] Validating against XML Schemas only
- // [a] dynamic validation is false: report error if SchemaGrammar is not found
- // [b] dynamic validation is true: if grammar is not found ignore.
- }
-
- }
-
- // get xsi:schemaLocation and xsi:noNamespaceSchemaLocation attributes,
- // parse them to get the grammars
-
- String sLocation =
- attributes.getValue(SchemaSymbols.URI_XSI, SchemaSymbols.XSI_SCHEMALOCATION);
- String nsLocation =
- attributes.getValue(SchemaSymbols.URI_XSI, SchemaSymbols.XSI_NONAMESPACESCHEMALOCATION);
- //store the location hints.. we need to do it so that we can defer the loading of grammar until
- //there is a reference to a component from that namespace. To provide location hints to the
- //application for a namespace
- storeLocations(sLocation, nsLocation);
-
- // if we are in the content of "skip", then just skip this element
- // REVISIT: is this the correct behaviour for ID constraints? -NG
- if (fSkipValidationDepth >= 0) {
- fElementDepth++;
- if (fAugPSVI)
- augs = getEmptyAugs(augs);
- return augs;
- }
-
- //try to find schema grammar by different means..
- SchemaGrammar sGrammar =
- findSchemaGrammar(
- XSDDescription.CONTEXT_ELEMENT,
- element.uri,
- null,
- element,
- attributes);
-
- // if we are not skipping this element, and there is a content model,
- // we try to find the corresponding decl object for this element.
- // the reason we move this part of code here is to make sure the
- // error reported here (if any) is stored within the parent element's
- // context, instead of that of the current element.
- Object decl = null;
- if (fCurrentCM != null) {
- decl = fCurrentCM.oneTransition(element, fCurrCMState, fSubGroupHandler);
- // it could be an element decl or a wildcard decl
- if (fCurrCMState[0] == XSCMValidator.FIRST_ERROR) {
- XSComplexTypeDecl ctype = (XSComplexTypeDecl) fCurrentType;
- //REVISIT: is it the only case we will have particle = null?
- Vector next;
- if (ctype.fParticle != null
- && (next = fCurrentCM.whatCanGoHere(fCurrCMState)).size() > 0) {
- String expected = expectedStr(next);
- reportSchemaError(
- "cvc-complex-type.2.4.a",
- new Object[] { element.rawname, expected });
- } else {
- reportSchemaError("cvc-complex-type.2.4.d", new Object[] { element.rawname });
- }
- }
- }
-
- // if it's not the root element, we push the current states in the stacks
- if (fElementDepth != -1) {
- ensureStackCapacity();
- fSubElementStack[fElementDepth] = true;
- fSubElement = false;
- fElemDeclStack[fElementDepth] = fCurrentElemDecl;
- fNilStack[fElementDepth] = fNil;
- fNotationStack[fElementDepth] = fNotation;
- fTypeStack[fElementDepth] = fCurrentType;
- fStrictAssessStack[fElementDepth] = fStrictAssess;
- fCMStack[fElementDepth] = fCurrentCM;
- fCMStateStack[fElementDepth] = fCurrCMState;
- fSawTextStack[fElementDepth] = fSawText;
- fStringContent[fElementDepth] = fSawCharacters;
- }
-
- // increase the element depth after we've saved
- // all states for the parent element
- fElementDepth++;
- fCurrentElemDecl = null;
- XSWildcardDecl wildcard = null;
- fCurrentType = null;
- fStrictAssess = true;
- fNil = false;
- fNotation = null;
-
- // and the buffer to hold the value of the element
- fBuffer.setLength(0);
- fSawText = false;
- fSawCharacters = false;
-
- // check what kind of declaration the "decl" from
- // oneTransition() maps to
- if (decl != null) {
- if (decl instanceof XSElementDecl) {
- fCurrentElemDecl = (XSElementDecl) decl;
- } else {
- wildcard = (XSWildcardDecl) decl;
- }
- }
-
- // if the wildcard is skip, then return
- if (wildcard != null && wildcard.fProcessContents == XSWildcardDecl.PC_SKIP) {
- fSkipValidationDepth = fElementDepth;
- if (fAugPSVI)
- augs = getEmptyAugs(augs);
- return augs;
- }
-
- // try again to get the element decl:
- // case 1: find declaration for root element
- // case 2: find declaration for element from another namespace
- if (fCurrentElemDecl == null) {
- if (sGrammar != null) {
- fCurrentElemDecl = sGrammar.getGlobalElementDecl(element.localpart);
- }
- }
-
- if (fCurrentElemDecl != null) {
- // then get the type
- fCurrentType = fCurrentElemDecl.fType;
- }
-
- // get type from xsi:type
- String xsiType = attributes.getValue(SchemaSymbols.URI_XSI, SchemaSymbols.XSI_TYPE);
-
- // if no decl/type found for the current element
- if (fCurrentType == null && xsiType == null) {
- // if this is the validation root, report an error, because
- // we can't find eith decl or type for this element
- // REVISIT: should we report error, or warning?
- if (fElementDepth == 0) {
- // for dynamic validation, skip the whole content,
- // because no grammar was found.
- if (fDynamicValidation || fSchemaDynamicValidation) {
- // no schema grammar was found, but it's either dynamic
- // validation, or another kind of grammar was found (DTD,
- // for example). The intended behavior here is to skip
- // the whole document. To improve performance, we try to
- // remove the validator from the pipeline, since it's not
- // supposed to do anything.
- if (fDocumentSource != null) {
- fDocumentSource.setDocumentHandler(fDocumentHandler);
- if (fDocumentHandler != null)
- fDocumentHandler.setDocumentSource(fDocumentSource);
- // indicate that the validator was removed.
- fElementDepth = -2;
- return augs;
- }
-
- fSkipValidationDepth = fElementDepth;
- if (fAugPSVI)
- augs = getEmptyAugs(augs);
- return augs;
- }
- // We don't call reportSchemaError here, because the spec
- // doesn't think it's invalid not to be able to find a
- // declaration or type definition for an element. Xerces is
- // reporting it as an error for historical reasons, but in
- // PSVI, we shouldn't mark this element as invalid because
- // of this. - SG
- fXSIErrorReporter.fErrorReporter.reportError(
- XSMessageFormatter.SCHEMA_DOMAIN,
- "cvc-elt.1",
- new Object[] { element.rawname },
- XMLErrorReporter.SEVERITY_ERROR);
- }
- // if wildcard = strict, report error.
- // needs to be called before fXSIErrorReporter.pushContext()
- // so that the error belongs to the parent element.
- else if (wildcard != null && wildcard.fProcessContents == XSWildcardDecl.PC_STRICT) {
- // report error, because wilcard = strict
- reportSchemaError("cvc-complex-type.2.4.c", new Object[] { element.rawname });
- }
- // no element decl or type found for this element.
- // Allowed by the spec, we can choose to either laxly assess this
- // element, or to skip it. Now we choose lax assessment.
- fCurrentType = SchemaGrammar.fAnyType;
- fStrictAssess = false;
- fNFullValidationDepth = fElementDepth;
- // any type has mixed content, so we don't need to append buffer
- fAppendBuffer = false;
-
- // push error reporter context: record the current position
- // This has to happen after we process skip contents,
- // otherwise push and pop won't be correctly paired.
- fXSIErrorReporter.pushContext();
- } else {
- // push error reporter context: record the current position
- // This has to happen after we process skip contents,
- // otherwise push and pop won't be correctly paired.
- fXSIErrorReporter.pushContext();
-
- // get xsi:type
- if (xsiType != null) {
- XSTypeDefinition oldType = fCurrentType;
- fCurrentType = getAndCheckXsiType(element, xsiType, attributes);
- // If it fails, use the old type. Use anyType if ther is no old type.
- if (fCurrentType == null) {
- if (oldType == null)
- fCurrentType = SchemaGrammar.fAnyType;
- else
- fCurrentType = oldType;
- }
- }
-
- fNNoneValidationDepth = fElementDepth;
- // if the element has a fixed value constraint, we need to append
- if (fCurrentElemDecl != null
- && fCurrentElemDecl.getConstraintType() == XSConstants.VC_FIXED) {
- fAppendBuffer = true;
- }
- // if the type is simple, we need to append
- else if (fCurrentType.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE) {
- fAppendBuffer = true;
- } else {
- // if the type is simple content complex type, we need to append
- XSComplexTypeDecl ctype = (XSComplexTypeDecl) fCurrentType;
- fAppendBuffer = (ctype.fContentType == XSComplexTypeDecl.CONTENTTYPE_SIMPLE);
- }
- }
-
- // Element Locally Valid (Element)
- // 2 Its {abstract} must be false.
- if (fCurrentElemDecl != null && fCurrentElemDecl.getAbstract())
- reportSchemaError("cvc-elt.2", new Object[] { element.rawname });
-
- // make the current element validation root
- if (fElementDepth == 0) {
- fValidationRoot = element.rawname;
- }
-
- // update normalization flags
- if (fNormalizeData) {
- // reset values
- fFirstChunk = true;
- fTrailing = false;
- fUnionType = false;
- fWhiteSpace = -1;
- }
-
- // Element Locally Valid (Type)
- // 2 Its {abstract} must be false.
- if (fCurrentType.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE) {
- XSComplexTypeDecl ctype = (XSComplexTypeDecl) fCurrentType;
- if (ctype.getAbstract()) {
- reportSchemaError("cvc-type.2", new Object[] { element.rawname });
- }
- if (fNormalizeData) {
- // find out if the content type is simple and if variety is union
- // to be able to do character normalization
- if (ctype.fContentType == XSComplexTypeDecl.CONTENTTYPE_SIMPLE) {
- if (ctype.fXSSimpleType.getVariety() == XSSimpleType.VARIETY_UNION) {
- fUnionType = true;
- } else {
- try {
- fWhiteSpace = ctype.fXSSimpleType.getWhitespace();
- } catch (DatatypeException e) {
- // do nothing
- }
- }
- }
- }
- }
- // normalization: simple type
- else if (fNormalizeData) {
- // if !union type
- XSSimpleType dv = (XSSimpleType) fCurrentType;
- if (dv.getVariety() == XSSimpleType.VARIETY_UNION) {
- fUnionType = true;
- } else {
- try {
- fWhiteSpace = dv.getWhitespace();
- } catch (DatatypeException e) {
- // do nothing
- }
- }
- }
-
- // then try to get the content model
- fCurrentCM = null;
- if (fCurrentType.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE) {
- fCurrentCM = ((XSComplexTypeDecl) fCurrentType).getContentModel(fCMBuilder);
- }
-
- // and get the initial content model state
- fCurrCMState = null;
- if (fCurrentCM != null)
- fCurrCMState = fCurrentCM.startContentModel();
-
- // get information about xsi:nil
- String xsiNil = attributes.getValue(SchemaSymbols.URI_XSI, SchemaSymbols.XSI_NIL);
- // only deal with xsi:nil when there is an element declaration
- if (xsiNil != null && fCurrentElemDecl != null)
- fNil = getXsiNil(element, xsiNil);
-
- // now validate everything related with the attributes
- // first, get the attribute group
- XSAttributeGroupDecl attrGrp = null;
- if (fCurrentType.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE) {
- XSComplexTypeDecl ctype = (XSComplexTypeDecl) fCurrentType;
- attrGrp = ctype.getAttrGrp();
- }
- // activate identity constraints
- fValueStoreCache.startElement();
- fMatcherStack.pushContext();
- if (fCurrentElemDecl != null && fCurrentElemDecl.fIDCPos > 0) {
- fIdConstraint = true;
- // initialize when identity constrains are defined for the elem
- fValueStoreCache.initValueStoresFor(fCurrentElemDecl, this);
- }
- processAttributes(element, attributes, attrGrp);
-
- // add default attributes
- if (attrGrp != null) {
- addDefaultAttributes(element, attributes, attrGrp);
- }
-
- // call all active identity constraints
- int count = fMatcherStack.getMatcherCount();
- for (int i = 0; i < count; i++) {
- XPathMatcher matcher = fMatcherStack.getMatcherAt(i);
- matcher.startElement( element, attributes);
- }
-
- if (fAugPSVI) {
- augs = getEmptyAugs(augs);
-
- // PSVI: add validation context
- fCurrentPSVI.fValidationContext = fValidationRoot;
- // PSVI: add element declaration
- fCurrentPSVI.fDeclaration = fCurrentElemDecl;
- // PSVI: add element type
- fCurrentPSVI.fTypeDecl = fCurrentType;
- // PSVI: add notation attribute
- fCurrentPSVI.fNotation = fNotation;
- }
-
- return augs;
-
- } // handleStartElement(QName,XMLAttributes,boolean)
-
- /**
- * Handle end element. If there is not text content, and there is a
- * {value constraint} on the corresponding element decl, then
- * set the fDefaultValue XMLString representing the default value.
- */
- Augmentations handleEndElement(QName element, Augmentations augs) {
-
- if (DEBUG) {
- System.out.println("==>handleEndElement:" + element);
- }
- // if we are skipping, return
- if (fSkipValidationDepth >= 0) {
- // but if this is the top element that we are skipping,
- // restore the states.
- if (fSkipValidationDepth == fElementDepth && fSkipValidationDepth > 0) {
- // set the partial validation depth to the depth of parent
- fNFullValidationDepth = fSkipValidationDepth - 1;
- fSkipValidationDepth = -1;
- fElementDepth--;
- fSubElement = fSubElementStack[fElementDepth];
- fCurrentElemDecl = fElemDeclStack[fElementDepth];
- fNil = fNilStack[fElementDepth];
- fNotation = fNotationStack[fElementDepth];
- fCurrentType = fTypeStack[fElementDepth];
- fCurrentCM = fCMStack[fElementDepth];
- fStrictAssess = fStrictAssessStack[fElementDepth];
- fCurrCMState = fCMStateStack[fElementDepth];
- fSawText = fSawTextStack[fElementDepth];
- fSawCharacters = fStringContent[fElementDepth];
- }
- else {
- fElementDepth--;
- }
-
- // PSVI: validation attempted:
- // use default values in psvi item for
- // validation attempted, validity, and error codes
-
- // check extra schema constraints on root element
- if (fElementDepth == -1 && fFullChecking) {
- XSConstraints.fullSchemaChecking(
- fGrammarBucket,
- fSubGroupHandler,
- fCMBuilder,
- fXSIErrorReporter.fErrorReporter);
- }
-
- if (fAugPSVI)
- augs = getEmptyAugs(augs);
- return augs;
- }
-
- // now validate the content of the element
- processElementContent(element);
-
- // Element Locally Valid (Element)
- // 6 The element information item must be valid with respect to each of the {identity-constraint definitions} as per Identity-constraint Satisfied (3.11.4).
-
- // call matchers and de-activate context
- int oldCount = fMatcherStack.getMatcherCount();
- for (int i = oldCount - 1; i >= 0; i--) {
- XPathMatcher matcher = fMatcherStack.getMatcherAt(i);
- if (fCurrentElemDecl == null)
- matcher.endElement(element, null, false, fValidatedInfo.actualValue, fValidatedInfo.actualValueType, fValidatedInfo.itemValueTypes);
-
- else
- matcher.endElement(
- element,
- fCurrentType,
- fCurrentElemDecl.getNillable(),
- fDefaultValue == null
- ? fValidatedInfo.actualValue
- : fCurrentElemDecl.fDefault.actualValue,
- fDefaultValue == null
- ? fValidatedInfo.actualValueType
- : fCurrentElemDecl.fDefault.actualValueType,
- fDefaultValue == null
- ? fValidatedInfo.itemValueTypes
- : fCurrentElemDecl.fDefault.itemValueTypes);
- }
-
- if (fMatcherStack.size() > 0) {
- fMatcherStack.popContext();
- }
-
- int newCount = fMatcherStack.getMatcherCount();
- // handle everything *but* keyref's.
- for (int i = oldCount - 1; i >= newCount; i--) {
- XPathMatcher matcher = fMatcherStack.getMatcherAt(i);
- if (matcher instanceof Selector.Matcher) {
- Selector.Matcher selMatcher = (Selector.Matcher) matcher;
- IdentityConstraint id;
- if ((id = selMatcher.getIdentityConstraint()) != null
- && id.getCategory() != IdentityConstraint.IC_KEYREF) {
- fValueStoreCache.transplant(id, selMatcher.getInitialDepth());
- }
- }
- }
-
- // now handle keyref's/...
- for (int i = oldCount - 1; i >= newCount; i--) {
- XPathMatcher matcher = fMatcherStack.getMatcherAt(i);
- if (matcher instanceof Selector.Matcher) {
- Selector.Matcher selMatcher = (Selector.Matcher) matcher;
- IdentityConstraint id;
- if ((id = selMatcher.getIdentityConstraint()) != null
- && id.getCategory() == IdentityConstraint.IC_KEYREF) {
- ValueStoreBase values =
- fValueStoreCache.getValueStoreFor(id, selMatcher.getInitialDepth());
- if (values != null) // nothing to do if nothing matched!
- values.endDocumentFragment();
- }
- }
- }
- fValueStoreCache.endElement();
-
- SchemaGrammar[] grammars = null;
- // have we reached the end tag of the validation root?
- if (fElementDepth == 0) {
- // 7 If the element information item is the validation root, it must be valid per Validation Root Valid (ID/IDREF) (3.3.4).
- String invIdRef = fValidationState.checkIDRefID();
- fValidationState.resetIDTables();
- if (invIdRef != null) {
- reportSchemaError("cvc-id.1", new Object[] { invIdRef });
- }
- // check extra schema constraints
- if (fFullChecking) {
- XSConstraints.fullSchemaChecking(
- fGrammarBucket,
- fSubGroupHandler,
- fCMBuilder,
- fXSIErrorReporter.fErrorReporter);
- }
-
- grammars = fGrammarBucket.getGrammars();
- // return the final set of grammars validator ended up with
- if (fGrammarPool != null) {
- // Set grammars as immutable
- for (int k=0; k < grammars.length; k++) {
- grammars[k].setImmutable(true);
- }
- fGrammarPool.cacheGrammars(XMLGrammarDescription.XML_SCHEMA, grammars);
- }
- augs = endElementPSVI(true, grammars, augs);
- } else {
- augs = endElementPSVI(false, grammars, augs);
-
- // decrease element depth and restore states
- fElementDepth--;
-
- // get the states for the parent element.
- fSubElement = fSubElementStack[fElementDepth];
- fCurrentElemDecl = fElemDeclStack[fElementDepth];
- fNil = fNilStack[fElementDepth];
- fNotation = fNotationStack[fElementDepth];
- fCurrentType = fTypeStack[fElementDepth];
- fCurrentCM = fCMStack[fElementDepth];
- fStrictAssess = fStrictAssessStack[fElementDepth];
- fCurrCMState = fCMStateStack[fElementDepth];
- fSawText = fSawTextStack[fElementDepth];
- fSawCharacters = fStringContent[fElementDepth];
-
- // We should have a stack for whitespace value, and pop it up here.
- // But when fWhiteSpace != -1, and we see a sub-element, it must be
- // an error (at least for Schema 1.0). So for valid documents, the
- // only value we are going to push/pop in the stack is -1.
- // Here we just mimic the effect of popping -1. -SG
- fWhiteSpace = -1;
- // Same for append buffer. Simple types and elements with fixed
- // value constraint don't allow sub-elements. -SG
- fAppendBuffer = false;
- // same here.
- fUnionType = false;
- }
-
- return augs;
- } // handleEndElement(QName,boolean)*/
-
- final Augmentations endElementPSVI(
- boolean root,
- SchemaGrammar[] grammars,
- Augmentations augs) {
-
- if (fAugPSVI) {
- augs = getEmptyAugs(augs);
-
- // the 4 properties sent on startElement calls
- fCurrentPSVI.fDeclaration = this.fCurrentElemDecl;
- fCurrentPSVI.fTypeDecl = this.fCurrentType;
- fCurrentPSVI.fNotation = this.fNotation;
- fCurrentPSVI.fValidationContext = this.fValidationRoot;
- // PSVI: validation attempted
- // nothing below or at the same level has none or partial
- // (which means this level is strictly assessed, and all chidren
- // are full), so this one has full
- if (fElementDepth > fNFullValidationDepth) {
- fCurrentPSVI.fValidationAttempted = ElementPSVI.VALIDATION_FULL;
- }
- // nothing below or at the same level has full or partial
- // (which means this level is not strictly assessed, and all chidren
- // are none), so this one has none
- else if (fElementDepth > fNNoneValidationDepth) {
- fCurrentPSVI.fValidationAttempted = ElementPSVI.VALIDATION_NONE;
- }
- // otherwise partial, and anything above this level will be partial
- else {
- fCurrentPSVI.fValidationAttempted = ElementPSVI.VALIDATION_PARTIAL;
- fNFullValidationDepth = fNNoneValidationDepth = fElementDepth - 1;
- }
-
- if (fDefaultValue != null)
- fCurrentPSVI.fSpecified = true;
- fCurrentPSVI.fNil = fNil;
- fCurrentPSVI.fMemberType = fValidatedInfo.memberType;
- fCurrentPSVI.fNormalizedValue = fValidatedInfo.normalizedValue;
- fCurrentPSVI.fActualValue = fValidatedInfo.actualValue;
- fCurrentPSVI.fActualValueType = fValidatedInfo.actualValueType;
- fCurrentPSVI.fItemValueTypes = fValidatedInfo.itemValueTypes;
-
- if (fStrictAssess) {
- // get all errors for the current element, its attribute,
- // and subelements (if they were strictly assessed).
- // any error would make this element invalid.
- // and we merge these errors to the parent element.
- String[] errors = fXSIErrorReporter.mergeContext();
-
- // PSVI: error codes
- fCurrentPSVI.fErrorCodes = errors;
- // PSVI: validity
- fCurrentPSVI.fValidity =
- (errors == null) ? ElementPSVI.VALIDITY_VALID : ElementPSVI.VALIDITY_INVALID;
- } else {
- // PSVI: validity
- fCurrentPSVI.fValidity = ElementPSVI.VALIDITY_NOTKNOWN;
- // Discard the current context: ignore any error happened within
- // the sub-elements/attributes of this element, because those
- // errors won't affect the validity of the parent elements.
- fXSIErrorReporter.popContext();
- }
-
- if (root) {
- // store [schema information] in the PSVI
- fCurrentPSVI.fGrammars = grammars;
- fCurrentPSVI.fSchemaInformation = null;
- }
- }
-
- return augs;
-
- }
-
- Augmentations getEmptyAugs(Augmentations augs) {
- if (augs == null) {
- augs = fAugmentations;
- augs.removeAllItems();
- }
- augs.putItem(Constants.ELEMENT_PSVI, fCurrentPSVI);
- fCurrentPSVI.reset();
-
- return augs;
- }
-
- void storeLocations(String sLocation, String nsLocation) {
- if (sLocation != null) {
- if (!XMLSchemaLoader.tokenizeSchemaLocationStr(sLocation, fLocationPairs)) {
- // error!
- fXSIErrorReporter.reportError(
- XSMessageFormatter.SCHEMA_DOMAIN,
- "SchemaLocation",
- new Object[] { sLocation },
- XMLErrorReporter.SEVERITY_WARNING);
- }
- }
- if (nsLocation != null) {
- XMLSchemaLoader.LocationArray la = fLocationPairs.get(XMLSymbols.EMPTY_STRING);
- if (la == null) {
- la = new XMLSchemaLoader.LocationArray();
- fLocationPairs.put(XMLSymbols.EMPTY_STRING, la);
- }
- la.addLocation(nsLocation);
- }
-
- } //storeLocations
-
- //this is the function where logic of retrieving grammar is written , parser first tries to get the grammar from
- //the local pool, if not in local pool, it gives chance to application to be able to retrieve the grammar, then it
- //tries to parse the grammar using location hints from the give namespace.
- SchemaGrammar findSchemaGrammar(
- short contextType,
- String namespace,
- QName enclosingElement,
- QName triggeringComponet,
- XMLAttributes attributes) {
- SchemaGrammar grammar = null;
- //get the grammar from local pool...
- grammar = fGrammarBucket.getGrammar(namespace);
-
- if (grammar == null) {
- fXSDDescription.setNamespace(namespace);
- // give a chance to application to be able to retreive the grammar.
- if (fGrammarPool != null) {
- grammar = (SchemaGrammar) fGrammarPool.retrieveGrammar(fXSDDescription);
- if (grammar != null) {
- // put this grammar into the bucket, along with grammars
- // imported by it (directly or indirectly)
- if (!fGrammarBucket.putGrammar(grammar, true, fNamespaceGrowth)) {
- // REVISIT: a conflict between new grammar(s) and grammars
- // in the bucket. What to do? A warning? An exception?
- fXSIErrorReporter.fErrorReporter.reportError(
- XSMessageFormatter.SCHEMA_DOMAIN,
- "GrammarConflict",
- null,
- XMLErrorReporter.SEVERITY_WARNING);
- grammar = null;
- }
- }
- }
- }
- if ((grammar == null && !fUseGrammarPoolOnly) || fNamespaceGrowth) {
- fXSDDescription.reset();
- fXSDDescription.fContextType = contextType;
- fXSDDescription.setNamespace(namespace);
- fXSDDescription.fEnclosedElementName = enclosingElement;
- fXSDDescription.fTriggeringComponent = triggeringComponet;
- fXSDDescription.fAttributes = attributes;
- if (fLocator != null) {
- fXSDDescription.setBaseSystemId(fLocator.getExpandedSystemId());
- }
-
- Map<String, XMLSchemaLoader.LocationArray> locationPairs = fLocationPairs;
- XMLSchemaLoader.LocationArray locationArray =
- locationPairs.get(namespace == null ? XMLSymbols.EMPTY_STRING : namespace);
- if (locationArray != null) {
- String[] temp = locationArray.getLocationArray();
- if (temp.length != 0) {
- setLocationHints(fXSDDescription, temp, grammar);
- }
- }
-
- if (grammar == null || fXSDDescription.fLocationHints != null) {
- boolean toParseSchema = true;
- if (grammar != null) {
- // use location hints instead
- locationPairs = Collections.emptyMap();
- }
-
- // try to parse the grammar using location hints from that namespace..
- try {
- XMLInputSource xis =
- XMLSchemaLoader.resolveDocument(
- fXSDDescription,
- locationPairs,
- fEntityResolver);
- if (grammar != null && fNamespaceGrowth) {
- try {
- // if we are dealing with a different schema location, then include the new schema
- // into the existing grammar
- if (grammar.getDocumentLocations().contains(XMLEntityManager.expandSystemId(xis.getSystemId(), xis.getBaseSystemId(), false))) {
- toParseSchema = false;
- }
- }
- catch (MalformedURIException e) {
- }
- }
- if (toParseSchema) {
- grammar = fSchemaLoader.loadSchema(fXSDDescription, xis, fLocationPairs);
- }
- } catch (IOException ex) {
- final String [] locationHints = fXSDDescription.getLocationHints();
- fXSIErrorReporter.fErrorReporter.reportError(
- XSMessageFormatter.SCHEMA_DOMAIN,
- "schema_reference.4",
- new Object[] { locationHints != null ? locationHints[0] : XMLSymbols.EMPTY_STRING },
- XMLErrorReporter.SEVERITY_WARNING);
- }
- }
- }
-
- return grammar;
-
- } //findSchemaGrammar
- private void setLocationHints(XSDDescription desc, String[] locations, SchemaGrammar grammar) {
- int length = locations.length;
- if (grammar == null) {
- fXSDDescription.fLocationHints = new String[length];
- System.arraycopy(locations, 0, fXSDDescription.fLocationHints, 0, length);
- }
- else {
- setLocationHints(desc, locations, grammar.getDocumentLocations());
- }
- }
-
- private void setLocationHints(XSDDescription desc, String[] locations, StringList docLocations) {
- int length = locations.length;
- String[] hints = new String[length];
- int counter = 0;
-
- for (int i=0; i<length; i++) {
- try {
- String id = XMLEntityManager.expandSystemId(locations[i], desc.getBaseSystemId(), false);
- if (!docLocations.contains(id)) {
- hints[counter++] = locations[i];
- }
- }
- catch (MalformedURIException e) {
- }
- }
-
- if (counter > 0) {
- if (counter == length) {
- fXSDDescription.fLocationHints = hints;
- }
- else {
- fXSDDescription.fLocationHints = new String[counter];
- System.arraycopy(hints, 0, fXSDDescription.fLocationHints, 0, counter);
- }
- }
- }
-
-
- XSTypeDefinition getAndCheckXsiType(QName element, String xsiType, XMLAttributes attributes) {
- // This method also deals with clause 1.2.1.2 of the constraint
- // Validation Rule: Schema-Validity Assessment (Element)
-
- // Element Locally Valid (Element)
- // 4 If there is an attribute information item among the element information item's [attributes] whose [namespace name] is identical to http://www.w3.org/2001/XMLSchema-instance and whose [local name] is type, then all of the following must be true:
- // 4.1 The normalized value of that attribute information item must be valid with respect to the built-in QName simple type, as defined by String Valid (3.14.4);
- QName typeName = null;
- try {
- typeName = (QName) fQNameDV.validate(xsiType, fValidationState, null);
- } catch (InvalidDatatypeValueException e) {
- reportSchemaError(e.getKey(), e.getArgs());
- reportSchemaError(
- "cvc-elt.4.1",
- new Object[] {
- element.rawname,
- SchemaSymbols.URI_XSI + "," + SchemaSymbols.XSI_TYPE,
- xsiType });
- return null;
- }
-
- // 4.2 The local name and namespace name (as defined in QName Interpretation (3.15.3)), of the actual value of that attribute information item must resolve to a type definition, as defined in QName resolution (Instance) (3.15.4)
- XSTypeDefinition type = null;
- // if the namespace is schema namespace, first try built-in types
- if (typeName.uri == SchemaSymbols.URI_SCHEMAFORSCHEMA) {
- type = SchemaGrammar.SG_SchemaNS.getGlobalTypeDecl(typeName.localpart);
- }
- // if it's not schema built-in types, then try to get a grammar
- if (type == null) {
- //try to find schema grammar by different means....
- SchemaGrammar grammar =
- findSchemaGrammar(
- XSDDescription.CONTEXT_XSITYPE,
- typeName.uri,
- element,
- typeName,
- attributes);
-
- if (grammar != null)
- type = grammar.getGlobalTypeDecl(typeName.localpart);
- }
- // still couldn't find the type, report an error
- if (type == null) {
- reportSchemaError("cvc-elt.4.2", new Object[] { element.rawname, xsiType });
- return null;
- }
-
- // if there is no current type, set this one as current.
- // and we don't need to do extra checking
- if (fCurrentType != null) {
- // 4.3 The local type definition must be validly derived from the {type definition} given the union of the {disallowed substitutions} and the {type definition}'s {prohibited substitutions}, as defined in Type Derivation OK (Complex) (3.4.6) (if it is a complex type definition), or given {disallowed substitutions} as defined in Type Derivation OK (Simple) (3.14.6) (if it is a simple type definition).
- short block = fCurrentElemDecl.fBlock;
- if (fCurrentType.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE)
- block |= ((XSComplexTypeDecl) fCurrentType).fBlock;
- if (!XSConstraints.checkTypeDerivationOk(type, fCurrentType, block))
- reportSchemaError(
- "cvc-elt.4.3",
- new Object[] { element.rawname, xsiType, fCurrentType.getName()});
- }
-
- return type;
- } //getAndCheckXsiType
-
- boolean getXsiNil(QName element, String xsiNil) {
- // Element Locally Valid (Element)
- // 3 The appropriate case among the following must be true:
- // 3.1 If {nillable} is false, then there must be no attribute information item among the element information item's [attributes] whose [namespace name] is identical to http://www.w3.org/2001/XMLSchema-instance and whose [local name] is nil.
- if (fCurrentElemDecl != null && !fCurrentElemDecl.getNillable()) {
- reportSchemaError(
- "cvc-elt.3.1",
- new Object[] {
- element.rawname,
- SchemaSymbols.URI_XSI + "," + SchemaSymbols.XSI_NIL });
- }
- // 3.2 If {nillable} is true and there is such an attribute information item and its actual value is true , then all of the following must be true:
- // 3.2.2 There must be no fixed {value constraint}.
- else {
- String value = XMLChar.trim(xsiNil);
- if (value.equals(SchemaSymbols.ATTVAL_TRUE)
- || value.equals(SchemaSymbols.ATTVAL_TRUE_1)) {
- if (fCurrentElemDecl != null
- && fCurrentElemDecl.getConstraintType() == XSConstants.VC_FIXED) {
- reportSchemaError(
- "cvc-elt.3.2.2",
- new Object[] {
- element.rawname,
- SchemaSymbols.URI_XSI + "," + SchemaSymbols.XSI_NIL });
- }
- return true;
- }
- }
- return false;
- }
-
- void processAttributes(QName element, XMLAttributes attributes, XSAttributeGroupDecl attrGrp) {
-
- if (DEBUG) {
- System.out.println("==>processAttributes: " + attributes.getLength());
- }
-
- // whether we have seen a Wildcard ID.
- String wildcardIDName = null;
-
- // for each present attribute
- int attCount = attributes.getLength();
-
- Augmentations augs = null;
- AttributePSVImpl attrPSVI = null;
-
- boolean isSimple =
- fCurrentType == null || fCurrentType.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE;
-
- XSObjectList attrUses = null;
- int useCount = 0;
- XSWildcardDecl attrWildcard = null;
- if (!isSimple) {
- attrUses = attrGrp.getAttributeUses();
- useCount = attrUses.getLength();
- attrWildcard = attrGrp.fAttributeWC;
- }
-
- // Element Locally Valid (Complex Type)
- // 3 For each attribute information item in the element information item's [attributes] excepting those whose [namespace name] is identical to http://www.w3.org/2001/XMLSchema-instance and whose [local name] is one of type, nil, schemaLocation or noNamespaceSchemaLocation, the appropriate case among the following must be true:
- // get the corresponding attribute decl
- for (int index = 0; index < attCount; index++) {
-
- attributes.getName(index, fTempQName);
-
- if (DEBUG) {
- System.out.println("==>process attribute: " + fTempQName);
- }
-
- if (fAugPSVI || fIdConstraint) {
- augs = attributes.getAugmentations(index);
- attrPSVI = (AttributePSVImpl) augs.getItem(Constants.ATTRIBUTE_PSVI);
- if (attrPSVI != null) {
- attrPSVI.reset();
- } else {
- attrPSVI = new AttributePSVImpl();
- augs.putItem(Constants.ATTRIBUTE_PSVI, attrPSVI);
- }
- // PSVI attribute: validation context
- attrPSVI.fValidationContext = fValidationRoot;
- }
-
- // Element Locally Valid (Type)
- // 3.1.1 The element information item's [attributes] must be empty, excepting those
- // whose [namespace name] is identical to http://www.w3.org/2001/XMLSchema-instance and
- // whose [local name] is one of type, nil, schemaLocation or noNamespaceSchemaLocation.
-
- // for the 4 xsi attributes, get appropriate decl, and validate
- if (fTempQName.uri == SchemaSymbols.URI_XSI) {
- XSAttributeDecl attrDecl = null;
- if (fTempQName.localpart == SchemaSymbols.XSI_SCHEMALOCATION)
- attrDecl =
- SchemaGrammar.SG_XSI.getGlobalAttributeDecl(
- SchemaSymbols.XSI_SCHEMALOCATION);
- else if (fTempQName.localpart == SchemaSymbols.XSI_NONAMESPACESCHEMALOCATION)
- attrDecl =
- SchemaGrammar.SG_XSI.getGlobalAttributeDecl(
- SchemaSymbols.XSI_NONAMESPACESCHEMALOCATION);
- else if (fTempQName.localpart == SchemaSymbols.XSI_NIL)
- attrDecl = SchemaGrammar.SG_XSI.getGlobalAttributeDecl(SchemaSymbols.XSI_NIL);
- else if (fTempQName.localpart == SchemaSymbols.XSI_TYPE)
- attrDecl = SchemaGrammar.SG_XSI.getGlobalAttributeDecl(SchemaSymbols.XSI_TYPE);
- if (attrDecl != null) {
- processOneAttribute(element, attributes, index, attrDecl, null, attrPSVI);
- continue;
- }
- }
-
- // for namespace attributes, no_validation/unknow_validity
- if (fTempQName.rawname == XMLSymbols.PREFIX_XMLNS
- || fTempQName.rawname.startsWith("xmlns:")) {
- continue;
- }
-
- // simple type doesn't allow any other attributes
- if (isSimple) {
- reportSchemaError(
- "cvc-type.3.1.1",
- new Object[] { element.rawname, fTempQName.rawname });
- continue;
- }
-
- // it's not xmlns, and not xsi, then we need to find a decl for it
- XSAttributeUseImpl currUse = null, oneUse;
- for (int i = 0; i < useCount; i++) {
- oneUse = (XSAttributeUseImpl) attrUses.item(i);
- if (oneUse.fAttrDecl.fName == fTempQName.localpart
- && oneUse.fAttrDecl.fTargetNamespace == fTempQName.uri) {
- currUse = oneUse;
- break;
- }
- }
-
- // 3.2 otherwise all of the following must be true:
- // 3.2.1 There must be an {attribute wildcard}.
- // 3.2.2 The attribute information item must be valid with respect to it as defined in Item Valid (Wildcard) (3.10.4).
-
- // if failed, get it from wildcard
- if (currUse == null) {
- //if (attrWildcard == null)
- // reportSchemaError("cvc-complex-type.3.2.1", new Object[]{element.rawname, fTempQName.rawname});
- if (attrWildcard == null || !attrWildcard.allowNamespace(fTempQName.uri)) {
- // so this attribute is not allowed
- reportSchemaError(
- "cvc-complex-type.3.2.2",
- new Object[] { element.rawname, fTempQName.rawname });
- continue;
- }
- }
-
- XSAttributeDecl currDecl = null;
- if (currUse != null) {
- currDecl = currUse.fAttrDecl;
- } else {
- // which means it matches a wildcard
- // skip it if processContents is skip
- if (attrWildcard.fProcessContents == XSWildcardDecl.PC_SKIP)
- continue;
-
- //try to find grammar by different means...
- SchemaGrammar grammar =
- findSchemaGrammar(
- XSDDescription.CONTEXT_ATTRIBUTE,
- fTempQName.uri,
- element,
- fTempQName,
- attributes);
-
- if (grammar != null) {
- currDecl = grammar.getGlobalAttributeDecl(fTempQName.localpart);
- }
-
- // if can't find
- if (currDecl == null) {
- // if strict, report error
- if (attrWildcard.fProcessContents == XSWildcardDecl.PC_STRICT) {
- reportSchemaError(
- "cvc-complex-type.3.2.2",
- new Object[] { element.rawname, fTempQName.rawname });
- }
-
- // then continue to the next attribute
- continue;
- } else {
- // 5 Let [Definition:] the wild IDs be the set of all attribute information item to which clause 3.2 applied and whose validation resulted in a context-determined declaration of mustFind or no context-determined declaration at all, and whose [local name] and [namespace name] resolve (as defined by QName resolution (Instance) (3.15.4)) to an attribute declaration whose {type definition} is or is derived from ID. Then all of the following must be true:
- // 5.1 There must be no more than one item in wild IDs.
- if (currDecl.fType.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE
- && ((XSSimpleType) currDecl.fType).isIDType()) {
- if (wildcardIDName != null) {
- reportSchemaError(
- "cvc-complex-type.5.1",
- new Object[] { element.rawname, currDecl.fName, wildcardIDName });
- } else
- wildcardIDName = currDecl.fName;
- }
- }
- }
-
- processOneAttribute(element, attributes, index, currDecl, currUse, attrPSVI);
- } // end of for (all attributes)
-
- // 5.2 If wild IDs is non-empty, there must not be any attribute uses among the {attribute uses} whose {attribute declaration}'s {type definition} is or is derived from ID.
- if (!isSimple && attrGrp.fIDAttrName != null && wildcardIDName != null) {
- reportSchemaError(
- "cvc-complex-type.5.2",
- new Object[] { element.rawname, wildcardIDName, attrGrp.fIDAttrName });
- }
-
- } //processAttributes
-
- void processOneAttribute(
- QName element,
- XMLAttributes attributes,
- int index,
- XSAttributeDecl currDecl,
- XSAttributeUseImpl currUse,
- AttributePSVImpl attrPSVI) {
-
- String attrValue = attributes.getValue(index);
- fXSIErrorReporter.pushContext();
-
- // Attribute Locally Valid
- // For an attribute information item to be locally valid with respect to an attribute declaration all of the following must be true:
- // 1 The declaration must not be absent (see Missing Sub-components (5.3) for how this can fail to be the case).
- // 2 Its {type definition} must not be absent.
- // 3 The item's normalized value must be locally valid with respect to that {type definition} as per String Valid (3.14.4).
- // get simple type
- XSSimpleType attDV = currDecl.fType;
-
- Object actualValue = null;
- try {
- actualValue = attDV.validate(attrValue, fValidationState, fValidatedInfo);
- // store the normalized value
- if (fNormalizeData)
- attributes.setValue(index, fValidatedInfo.normalizedValue);
- if (attributes instanceof XMLAttributesImpl) {
- XMLAttributesImpl attrs = (XMLAttributesImpl) attributes;
- boolean schemaId =
- fValidatedInfo.memberType != null
- ? fValidatedInfo.memberType.isIDType()
- : attDV.isIDType();
- attrs.setSchemaId(index, schemaId);
- }
-
- // PSVI: element notation
- if (attDV.getVariety() == XSSimpleType.VARIETY_ATOMIC
- && attDV.getPrimitiveKind() == XSSimpleType.PRIMITIVE_NOTATION) {
- QName qName = (QName) actualValue;
- SchemaGrammar grammar = fGrammarBucket.getGrammar(qName.uri);
-
- //REVISIT: is it possible for the notation to be in different namespace than the attribute
- //with which it is associated, CHECK !! <fof n1:att1 = "n2:notation1" ..>
- // should we give chance to the application to be able to retrieve a grammar - nb
- //REVISIT: what would be the triggering component here.. if it is attribute value that
- // triggered the loading of grammar ?? -nb
-
- if (grammar != null) {
- fNotation = grammar.getGlobalNotationDecl(qName.localpart);
- }
- }
- } catch (InvalidDatatypeValueException idve) {
- reportSchemaError(idve.getKey(), idve.getArgs());
- reportSchemaError(
- "cvc-attribute.3",
- new Object[] { element.rawname, fTempQName.rawname, attrValue, attDV.getName()});
- }
-
- // get the value constraint from use or decl
- // 4 The item's actual value must match the value of the {value constraint}, if it is present and fixed. // now check the value against the simpleType
- if (actualValue != null && currDecl.getConstraintType() == XSConstants.VC_FIXED) {
- if (!isComparable(fValidatedInfo, currDecl.fDefault) || !actualValue.equals(currDecl.fDefault.actualValue)) {
- reportSchemaError(
- "cvc-attribute.4",
- new Object[] {
- element.rawname,
- fTempQName.rawname,
- attrValue,
- currDecl.fDefault.stringValue()});
- }
- }
-
- // 3.1 If there is among the {attribute uses} an attribute use with an {attribute declaration} whose {name} matches the attribute information item's [local name] and whose {target namespace} is identical to the attribute information item's [namespace name] (where an absent {target namespace} is taken to be identical to a [namespace name] with no value), then the attribute information must be valid with respect to that attribute use as per Attribute Locally Valid (Use) (3.5.4). In this case the {attribute declaration} of that attribute use is the context-determined declaration for the attribute information item with respect to Schema-Validity Assessment (Attribute) (3.2.4) and Assessment Outcome (Attribute) (3.2.5).
- if (actualValue != null
- && currUse != null
- && currUse.fConstraintType == XSConstants.VC_FIXED) {
- if (!isComparable(fValidatedInfo, currUse.fDefault) || !actualValue.equals(currUse.fDefault.actualValue)) {
- reportSchemaError(
- "cvc-complex-type.3.1",
- new Object[] {
- element.rawname,
- fTempQName.rawname,
- attrValue,
- currUse.fDefault.stringValue()});
- }
- }
- if (fIdConstraint) {
- attrPSVI.fActualValue = actualValue;
- }
-
- if (fAugPSVI) {
- // PSVI: attribute declaration
- attrPSVI.fDeclaration = currDecl;
- // PSVI: attribute type
- attrPSVI.fTypeDecl = attDV;
-
- // PSVI: attribute memberType
- attrPSVI.fMemberType = fValidatedInfo.memberType;
- // PSVI: attribute normalized value
- // NOTE: we always store the normalized value, even if it's invlid,
- // because it might still be useful to the user. But when the it's
- // not valid, the normalized value is not trustable.
- attrPSVI.fNormalizedValue = fValidatedInfo.normalizedValue;
- attrPSVI.fActualValue = fValidatedInfo.actualValue;
- attrPSVI.fActualValueType = fValidatedInfo.actualValueType;
- attrPSVI.fItemValueTypes = fValidatedInfo.itemValueTypes;
-
-
-
- // PSVI: validation attempted:
- attrPSVI.fValidationAttempted = AttributePSVI.VALIDATION_FULL;
-
- String[] errors = fXSIErrorReporter.mergeContext();
- // PSVI: error codes
- attrPSVI.fErrorCodes = errors;
- // PSVI: validity
- attrPSVI.fValidity =
- (errors == null) ? AttributePSVI.VALIDITY_VALID : AttributePSVI.VALIDITY_INVALID;
- }
- }
-
- void addDefaultAttributes(
- QName element,
- XMLAttributes attributes,
- XSAttributeGroupDecl attrGrp) {
- // Check after all specified attrs are scanned
- // (1) report error for REQUIRED attrs that are missing (V_TAGc)
- // REVISIT: should we check prohibited attributes?
- // (2) report error for PROHIBITED attrs that are present (V_TAGc)
- // (3) add default attrs (FIXED and NOT_FIXED)
- //
- if (DEBUG) {
- System.out.println("==>addDefaultAttributes: " + element);
- }
- XSObjectList attrUses = attrGrp.getAttributeUses();
- int useCount = attrUses.getLength();
- XSAttributeUseImpl currUse;
- XSAttributeDecl currDecl;
- short constType;
- ValidatedInfo defaultValue;
- boolean isSpecified;
- QName attName;
- // for each attribute use
- for (int i = 0; i < useCount; i++) {
-
- currUse = (XSAttributeUseImpl) attrUses.item(i);
- currDecl = currUse.fAttrDecl;
- // get value constraint
- constType = currUse.fConstraintType;
- defaultValue = currUse.fDefault;
- if (constType == XSConstants.VC_NONE) {
- constType = currDecl.getConstraintType();
- defaultValue = currDecl.fDefault;
- }
- // whether this attribute is specified
- isSpecified = attributes.getValue(currDecl.fTargetNamespace, currDecl.fName) != null;
-
- // Element Locally Valid (Complex Type)
- // 4 The {attribute declaration} of each attribute use in the {attribute uses} whose
- // {required} is true matches one of the attribute information items in the element
- // information item's [attributes] as per clause 3.1 above.
- if (currUse.fUse == SchemaSymbols.USE_REQUIRED) {
- if (!isSpecified)
- reportSchemaError(
- "cvc-complex-type.4",
- new Object[] { element.rawname, currDecl.fName });
- }
- // if the attribute is not specified, then apply the value constraint
- if (!isSpecified && constType != XSConstants.VC_NONE) {
- attName =
- new QName(null, currDecl.fName, currDecl.fName, currDecl.fTargetNamespace);
- String normalized = (defaultValue != null) ? defaultValue.stringValue() : "";
- int attrIndex = attributes.addAttribute(attName, "CDATA", normalized);
- if (attributes instanceof XMLAttributesImpl) {
- XMLAttributesImpl attrs = (XMLAttributesImpl) attributes;
- boolean schemaId =
- defaultValue != null
- && defaultValue.memberType != null
- ? defaultValue.memberType.isIDType()
- : currDecl.fType.isIDType();
- attrs.setSchemaId(attrIndex, schemaId);
- }
-
- if (fAugPSVI) {
-
- // PSVI: attribute is "schema" specified
- Augmentations augs = attributes.getAugmentations(attrIndex);
- AttributePSVImpl attrPSVI = new AttributePSVImpl();
- augs.putItem(Constants.ATTRIBUTE_PSVI, attrPSVI);
-
- attrPSVI.fDeclaration = currDecl;
- attrPSVI.fTypeDecl = currDecl.fType;
- attrPSVI.fMemberType = defaultValue.memberType;
- attrPSVI.fNormalizedValue = normalized;
- attrPSVI.fActualValue = defaultValue.actualValue;
- attrPSVI.fActualValueType = defaultValue.actualValueType;
- attrPSVI.fItemValueTypes = defaultValue.itemValueTypes;
- attrPSVI.fValidationContext = fValidationRoot;
- attrPSVI.fValidity = AttributePSVI.VALIDITY_VALID;
- attrPSVI.fValidationAttempted = AttributePSVI.VALIDATION_FULL;
- attrPSVI.fSpecified = true;
- }
- }
-
- } // for
- } // addDefaultAttributes
-
- /**
- * If there is not text content, and there is a
- * {value constraint} on the corresponding element decl, then return
- * an XMLString representing the default value.
- */
- void processElementContent(QName element) {
- // 1 If the item is ?valid? with respect to an element declaration as per Element Locally Valid (Element) (?3.3.4) and the {value constraint} is present, but clause 3.2 of Element Locally Valid (Element) (?3.3.4) above is not satisfied and the item has no element or character information item [children], then schema. Furthermore, the post-schema-validation infoset has the canonical lexical representation of the {value constraint} value as the item's [schema normalized value] property.
- if (fCurrentElemDecl != null
- && fCurrentElemDecl.fDefault != null
- && !fSawText
- && !fSubElement
- && !fNil) {
-
- String strv = fCurrentElemDecl.fDefault.stringValue();
- int bufLen = strv.length();
- if (fNormalizedStr.ch == null || fNormalizedStr.ch.length < bufLen) {
- fNormalizedStr.ch = new char[bufLen];
- }
- strv.getChars(0, bufLen, fNormalizedStr.ch, 0);
- fNormalizedStr.offset = 0;
- fNormalizedStr.length = bufLen;
- fDefaultValue = fNormalizedStr;
- }
- // fixed values are handled later, after xsi:type determined.
-
- fValidatedInfo.normalizedValue = null;
-
- // Element Locally Valid (Element)
- // 3.2.1 The element information item must have no character or element information item [children].
- if (fNil) {
- if (fSubElement || fSawText) {
- reportSchemaError(
- "cvc-elt.3.2.1",
- new Object[] {
- element.rawname,
- SchemaSymbols.URI_XSI + "," + SchemaSymbols.XSI_NIL });
- }
- }
-
- this.fValidatedInfo.reset();
-
- // 5 The appropriate case among the following must be true:
- // 5.1 If the declaration has a {value constraint}, the item has neither element nor character [children] and clause 3.2 has not applied, then all of the following must be true:
- if (fCurrentElemDecl != null
- && fCurrentElemDecl.getConstraintType() != XSConstants.VC_NONE
- && !fSubElement
- && !fSawText
- && !fNil) {
- // 5.1.1 If the actual type definition is a local type definition then the canonical lexical representation of the {value constraint} value must be a valid default for the actual type definition as defined in Element Default Valid (Immediate) (3.3.6).
- if (fCurrentType != fCurrentElemDecl.fType) {
- //REVISIT:we should pass ValidatedInfo here.
- if (XSConstraints
- .ElementDefaultValidImmediate(
- fCurrentType,
- fCurrentElemDecl.fDefault.stringValue(),
- fState4XsiType,
- null)
- == null)
- reportSchemaError(
- "cvc-elt.5.1.1",
- new Object[] {
- element.rawname,
- fCurrentType.getName(),
- fCurrentElemDecl.fDefault.stringValue()});
- }
- // 5.1.2 The element information item with the canonical lexical representation of the {value constraint} value used as its normalized value must be valid with respect to the actual type definition as defined by Element Locally Valid (Type) (3.3.4).
- // REVISIT: don't use toString, but validateActualValue instead
- // use the fState4ApplyDefault
- elementLocallyValidType(element, fCurrentElemDecl.fDefault.stringValue());
- } else {
- // The following method call also deal with clause 1.2.2 of the constraint
- // Validation Rule: Schema-Validity Assessment (Element)
-
- // 5.2 If the declaration has no {value constraint} or the item has either element or character [children] or clause 3.2 has applied, then all of the following must be true:
- // 5.2.1 The element information item must be valid with respect to the actual type definition as defined by Element Locally Valid (Type) (3.3.4).
- Object actualValue = elementLocallyValidType(element, fBuffer);
- // 5.2.2 If there is a fixed {value constraint} and clause 3.2 has not applied, all of the following must be true:
- if (fCurrentElemDecl != null
- && fCurrentElemDecl.getConstraintType() == XSConstants.VC_FIXED
- && !fNil) {
- String content = fBuffer.toString();
- // 5.2.2.1 The element information item must have no element information item [children].
- if (fSubElement)
- reportSchemaError("cvc-elt.5.2.2.1", new Object[] { element.rawname });
- // 5.2.2.2 The appropriate case among the following must be true:
- if (fCurrentType.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE) {
- XSComplexTypeDecl ctype = (XSComplexTypeDecl) fCurrentType;
- // 5.2.2.2.1 If the {content type} of the actual type definition is mixed, then the initial value of the item must match the canonical lexical representation of the {value constraint} value.
- if (ctype.fContentType == XSComplexTypeDecl.CONTENTTYPE_MIXED) {
- // REVISIT: how to get the initial value, does whiteSpace count?
- if (!fCurrentElemDecl.fDefault.normalizedValue.equals(content))
- reportSchemaError(
- "cvc-elt.5.2.2.2.1",
- new Object[] {
- element.rawname,
- content,
- fCurrentElemDecl.fDefault.normalizedValue });
- }
- // 5.2.2.2.2 If the {content type} of the actual type definition is a simple type definition, then the actual value of the item must match the canonical lexical representation of the {value constraint} value.
- else if (ctype.fContentType == XSComplexTypeDecl.CONTENTTYPE_SIMPLE) {
- if (actualValue != null && (!isComparable(fValidatedInfo, fCurrentElemDecl.fDefault)
- || !actualValue.equals(fCurrentElemDecl.fDefault.actualValue))) {
- reportSchemaError(
- "cvc-elt.5.2.2.2.2",
- new Object[] {
- element.rawname,
- content,
- fCurrentElemDecl.fDefault.stringValue()});
- }
- }
- } else if (fCurrentType.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE) {
- if (actualValue != null && (!isComparable(fValidatedInfo, fCurrentElemDecl.fDefault)
- || !actualValue.equals(fCurrentElemDecl.fDefault.actualValue))) {
- // REVISIT: the spec didn't mention this case: fixed
- // value with simple type
- reportSchemaError(
- "cvc-elt.5.2.2.2.2",
- new Object[] {
- element.rawname,
- content,
- fCurrentElemDecl.fDefault.stringValue()});
- }
- }
- }
- }
-
- if (fDefaultValue == null && fNormalizeData && fDocumentHandler != null && fUnionType) {
- // for union types we need to send data because we delayed sending
- // this data when we received it in the characters() call.
- String content = fValidatedInfo.normalizedValue;
- if (content == null)
- content = fBuffer.toString();
-
- int bufLen = content.length();
- if (fNormalizedStr.ch == null || fNormalizedStr.ch.length < bufLen) {
- fNormalizedStr.ch = new char[bufLen];
- }
- content.getChars(0, bufLen, fNormalizedStr.ch, 0);
- fNormalizedStr.offset = 0;
- fNormalizedStr.length = bufLen;
- fDocumentHandler.characters(fNormalizedStr, null);
- }
- } // processElementContent
-
- Object elementLocallyValidType(QName element, Object textContent) {
- if (fCurrentType == null)
- return null;
-
- Object retValue = null;
- // Element Locally Valid (Type)
- // 3 The appropriate case among the following must be true:
- // 3.1 If the type definition is a simple type definition, then all of the following must be true:
- if (fCurrentType.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE) {
- // 3.1.2 The element information item must have no element information item [children].
- if (fSubElement)
- reportSchemaError("cvc-type.3.1.2", new Object[] { element.rawname });
- // 3.1.3 If clause 3.2 of Element Locally Valid (Element) (3.3.4) did not apply, then the normalized value must be valid with respect to the type definition as defined by String Valid (3.14.4).
- if (!fNil) {
- XSSimpleType dv = (XSSimpleType) fCurrentType;
- try {
- if (!fNormalizeData || fUnionType) {
- fValidationState.setNormalizationRequired(true);
- }
- retValue = dv.validate(textContent, fValidationState, fValidatedInfo);
- } catch (InvalidDatatypeValueException e) {
- reportSchemaError(e.getKey(), e.getArgs());
- reportSchemaError(
- "cvc-type.3.1.3",
- new Object[] { element.rawname, textContent });
- }
- }
- } else {
- // 3.2 If the type definition is a complex type definition, then the element information item must be valid with respect to the type definition as per Element Locally Valid (Complex Type) (3.4.4);
- retValue = elementLocallyValidComplexType(element, textContent);
- }
-
- return retValue;
- } // elementLocallyValidType
-
- Object elementLocallyValidComplexType(QName element, Object textContent) {
- Object actualValue = null;
- XSComplexTypeDecl ctype = (XSComplexTypeDecl) fCurrentType;
-
- // Element Locally Valid (Complex Type)
- // For an element information item to be locally valid with respect to a complex type definition all of the following must be true:
- // 1 {abstract} is false.
- // 2 If clause 3.2 of Element Locally Valid (Element) (3.3.4) did not apply, then the appropriate case among the following must be true:
- if (!fNil) {
- // 2.1 If the {content type} is empty, then the element information item has no character or element information item [children].
- if (ctype.fContentType == XSComplexTypeDecl.CONTENTTYPE_EMPTY
- && (fSubElement || fSawText)) {
- reportSchemaError("cvc-complex-type.2.1", new Object[] { element.rawname });
- }
- // 2.2 If the {content type} is a simple type definition, then the element information item has no element information item [children], and the normalized value of the element information item is valid with respect to that simple type definition as defined by String Valid (3.14.4).
- else if (ctype.fContentType == XSComplexTypeDecl.CONTENTTYPE_SIMPLE) {
- if (fSubElement)
- reportSchemaError("cvc-complex-type.2.2", new Object[] { element.rawname });
- XSSimpleType dv = ctype.fXSSimpleType;
- try {
- if (!fNormalizeData || fUnionType) {
- fValidationState.setNormalizationRequired(true);
- }
- actualValue = dv.validate(textContent, fValidationState, fValidatedInfo);
- } catch (InvalidDatatypeValueException e) {
- reportSchemaError(e.getKey(), e.getArgs());
- reportSchemaError("cvc-complex-type.2.2", new Object[] { element.rawname });
- }
- // REVISIT: eventually, this method should return the same actualValue as elementLocallyValidType...
- // obviously it'll return null when the content is complex.
- }
- // 2.3 If the {content type} is element-only, then the element information item has no character information item [children] other than those whose [character code] is defined as a white space in [XML 1.0 (Second Edition)].
- else if (ctype.fContentType == XSComplexTypeDecl.CONTENTTYPE_ELEMENT) {
- if (fSawCharacters) {
- reportSchemaError("cvc-complex-type.2.3", new Object[] { element.rawname });
- }
- }
- // 2.4 If the {content type} is element-only or mixed, then the sequence of the element information item's element information item [children], if any, taken in order, is valid with respect to the {content type}'s particle, as defined in Element Sequence Locally Valid (Particle) (3.9.4).
- if (ctype.fContentType == XSComplexTypeDecl.CONTENTTYPE_ELEMENT
- || ctype.fContentType == XSComplexTypeDecl.CONTENTTYPE_MIXED) {
- // if the current state is a valid state, check whether
- // it's one of the final states.
- if (DEBUG) {
- System.out.println(fCurrCMState);
- }
- if (fCurrCMState[0] >= 0 && !fCurrentCM.endContentModel(fCurrCMState)) {
- String expected = expectedStr(fCurrentCM.whatCanGoHere(fCurrCMState));
- reportSchemaError(
- "cvc-complex-type.2.4.b",
- new Object[] { element.rawname, expected });
- } else {
- // Constant space algorithm for a{n,m} for n > 1 and m <= unbounded
- // After the DFA has completed, check minOccurs and maxOccurs
- // for all elements and wildcards in this content model where
- // a{n,m} is subsumed to a* or a+
- ArrayList errors = fCurrentCM.checkMinMaxBounds();
- if (errors != null) {
- for (int i = 0; i < errors.size(); i += 2) {
- reportSchemaError(
- (String) errors.get(i),
- new Object[] { element.rawname, errors.get(i + 1) });
- }
- }
- }
- }
- }
- return actualValue;
- } // elementLocallyValidComplexType
-
- void reportSchemaError(String key, Object[] arguments) {
- if (fDoValidation)
- fXSIErrorReporter.reportError(
- XSMessageFormatter.SCHEMA_DOMAIN,
- key,
- arguments,
- XMLErrorReporter.SEVERITY_ERROR);
- }
-
- /** Returns true if the two ValidatedInfo objects can be compared in the same value space. **/
- private boolean isComparable(ValidatedInfo info1, ValidatedInfo info2) {
- final short primitiveType1 = convertToPrimitiveKind(info1.actualValueType);
- final short primitiveType2 = convertToPrimitiveKind(info2.actualValueType);
- if (primitiveType1 != primitiveType2) {
- return (primitiveType1 == XSConstants.ANYSIMPLETYPE_DT && primitiveType2 == XSConstants.STRING_DT ||
- primitiveType1 == XSConstants.STRING_DT && primitiveType2 == XSConstants.ANYSIMPLETYPE_DT);
- }
- else if (primitiveType1 == XSConstants.LIST_DT || primitiveType1 == XSConstants.LISTOFUNION_DT) {
- final ShortList typeList1 = info1.itemValueTypes;
- final ShortList typeList2 = info2.itemValueTypes;
- final int typeList1Length = typeList1 != null ? typeList1.getLength() : 0;
- final int typeList2Length = typeList2 != null ? typeList2.getLength() : 0;
- if (typeList1Length != typeList2Length) {
- return false;
- }
- for (int i = 0; i < typeList1Length; ++i) {
- final short primitiveItem1 = convertToPrimitiveKind(typeList1.item(i));
- final short primitiveItem2 = convertToPrimitiveKind(typeList2.item(i));
- if (primitiveItem1 != primitiveItem2) {
- if (primitiveItem1 == XSConstants.ANYSIMPLETYPE_DT && primitiveItem2 == XSConstants.STRING_DT ||
- primitiveItem1 == XSConstants.STRING_DT && primitiveItem2 == XSConstants.ANYSIMPLETYPE_DT) {
- continue;
- }
- return false;
- }
- }
- }
- return true;
- }
-
- private short convertToPrimitiveKind(short valueType) {
- /** Primitive datatypes. */
- if (valueType <= XSConstants.NOTATION_DT) {
- return valueType;
- }
- /** Types derived from string. */
- if (valueType <= XSConstants.ENTITY_DT) {
- return XSConstants.STRING_DT;
- }
- /** Types derived from decimal. */
- if (valueType <= XSConstants.POSITIVEINTEGER_DT) {
- return XSConstants.DECIMAL_DT;
- }
- /** Other types. */
- return valueType;
- }
-
- private String expectedStr(Vector expected) {
- StringBuffer ret = new StringBuffer("{");
- int size = expected.size();
- for (int i = 0; i < size; i++) {
- if (i > 0)
- ret.append(", ");
- ret.append(expected.elementAt(i).toString());
- }
- ret.append('}');
- return ret.toString();
- }
-
- /**********************************/
-
- // xpath matcher information
-
- /**
- * Stack of XPath matchers for identity constraints.
- *
- * @author Andy Clark, IBM
- */
- protected static class XPathMatcherStack {
-
- //
- // Data
- //
-
- /** Active matchers. */
- protected XPathMatcher[] fMatchers = new XPathMatcher[4];
-
- /** Count of active matchers. */
- protected int fMatchersCount;
-
- /** Offset stack for contexts. */
- protected IntStack fContextStack = new IntStack();
-
- //
- // Constructors
- //
-
- public XPathMatcherStack() {
- } // <init>()
-
- //
- // Public methods
- //
-
- /** Resets the XPath matcher stack. */
- public void clear() {
- for (int i = 0; i < fMatchersCount; i++) {
- fMatchers[i] = null;
- }
- fMatchersCount = 0;
- fContextStack.clear();
- } // clear()
-
- /** Returns the size of the stack. */
- public int size() {
- return fContextStack.size();
- } // size():int
-
- /** Returns the count of XPath matchers. */
- public int getMatcherCount() {
- return fMatchersCount;
- } // getMatcherCount():int
-
- /** Adds a matcher. */
- public void addMatcher(XPathMatcher matcher) {
- ensureMatcherCapacity();
- fMatchers[fMatchersCount++] = matcher;
- } // addMatcher(XPathMatcher)
-
- /** Returns the XPath matcher at the specified index. */
- public XPathMatcher getMatcherAt(int index) {
- return fMatchers[index];
- } // getMatcherAt(index):XPathMatcher
-
- /** Pushes a new context onto the stack. */
- public void pushContext() {
- fContextStack.push(fMatchersCount);
- } // pushContext()
-
- /** Pops a context off of the stack. */
- public void popContext() {
- fMatchersCount = fContextStack.pop();
- } // popContext()
-
- //
- // Private methods
- //
-
- /** Ensures the size of the matchers array. */
- private void ensureMatcherCapacity() {
- if (fMatchersCount == fMatchers.length) {
- XPathMatcher[] array = new XPathMatcher[fMatchers.length * 2];
- System.arraycopy(fMatchers, 0, array, 0, fMatchers.length);
- fMatchers = array;
- }
- } // ensureMatcherCapacity()
-
- } // class XPathMatcherStack
-
- // value store implementations
-
- /**
- * Value store implementation base class. There are specific subclasses
- * for handling unique, key, and keyref.
- *
- * @author Andy Clark, IBM
- */
- protected abstract class ValueStoreBase implements ValueStore {
-
- //
- // Data
- //
-
- /** Identity constraint. */
- protected IdentityConstraint fIdentityConstraint;
- protected int fFieldCount = 0;
- protected Field[] fFields = null;
- /** current data */
- protected Object[] fLocalValues = null;
- protected short[] fLocalValueTypes = null;
- protected ShortList[] fLocalItemValueTypes = null;
-
- /** Current data value count. */
- protected int fValuesCount;
-
- /** global data */
- public final Vector fValues = new Vector();
- public ShortVector fValueTypes = null;
- public Vector fItemValueTypes = null;
-
- private boolean fUseValueTypeVector = false;
- private int fValueTypesLength = 0;
- private short fValueType = 0;
-
- private boolean fUseItemValueTypeVector = false;
- private int fItemValueTypesLength = 0;
- private ShortList fItemValueType = null;
-
- /** buffer for error messages */
- final StringBuffer fTempBuffer = new StringBuffer();
-
- //
- // Constructors
- //
-
- /** Constructs a value store for the specified identity constraint. */
- protected ValueStoreBase(IdentityConstraint identityConstraint) {
- fIdentityConstraint = identityConstraint;
- fFieldCount = fIdentityConstraint.getFieldCount();
- fFields = new Field[fFieldCount];
- fLocalValues = new Object[fFieldCount];
- fLocalValueTypes = new short[fFieldCount];
- fLocalItemValueTypes = new ShortList[fFieldCount];
- for (int i = 0; i < fFieldCount; i++) {
- fFields[i] = fIdentityConstraint.getFieldAt(i);
- }
- } // <init>(IdentityConstraint)
-
- //
- // Public methods
- //
-
- // destroys this ValueStore; useful when, for instance, a
- // locally-scoped ID constraint is involved.
- public void clear() {
- fValuesCount = 0;
- fUseValueTypeVector = false;
- fValueTypesLength = 0;
- fValueType = 0;
- fUseItemValueTypeVector = false;
- fItemValueTypesLength = 0;
- fItemValueType = null;
- fValues.setSize(0);
- if (fValueTypes != null) {
- fValueTypes.clear();
- }
- if (fItemValueTypes != null) {
- fItemValueTypes.setSize(0);
- }
- } // end clear():void
-
- // appends the contents of one ValueStore to those of us.
- public void append(ValueStoreBase newVal) {
- for (int i = 0; i < newVal.fValues.size(); i++) {
- fValues.addElement(newVal.fValues.elementAt(i));
- }
- } // append(ValueStoreBase)
-
- /** Start scope for value store. */
- public void startValueScope() {
- fValuesCount = 0;
- for (int i = 0; i < fFieldCount; i++) {
- fLocalValues[i] = null;
- fLocalValueTypes[i] = 0;
- fLocalItemValueTypes[i] = null;
- }
- } // startValueScope()
-
- /** Ends scope for value store. */
- public void endValueScope() {
-
- if (fValuesCount == 0) {
- if (fIdentityConstraint.getCategory() == IdentityConstraint.IC_KEY) {
- String code = "AbsentKeyValue";
- String eName = fIdentityConstraint.getElementName();
- String cName = fIdentityConstraint.getIdentityConstraintName();
- reportSchemaError(code, new Object[] { eName, cName });
- }
- return;
- }
-
- // Validation Rule: Identity-constraint Satisfied
- // 4.2 If the {identity-constraint category} is key, then all of the following must be true:
- // 4.2.1 The target node set and the qualified node set are equal, that is, every member of the
- // target node set is also a member of the qualified node set and vice versa.
- //
- // If the IDC is a key check whether we have all the fields.
- if (fValuesCount != fFieldCount) {
- if (fIdentityConstraint.getCategory() == IdentityConstraint.IC_KEY) {
- String code = "KeyNotEnoughValues";
- UniqueOrKey key = (UniqueOrKey) fIdentityConstraint;
- String eName = fIdentityConstraint.getElementName();
- String cName = key.getIdentityConstraintName();
- reportSchemaError(code, new Object[] { eName, cName });
- }
- return;
- }
-
- } // endValueScope()
-
- // This is needed to allow keyref's to look for matched keys
- // in the correct scope. Unique and Key may also need to
- // override this method for purposes of their own.
- // This method is called whenever the DocumentFragment
- // of an ID Constraint goes out of scope.
- public void endDocumentFragment() {
- } // endDocumentFragment():void
-
- /**
- * Signals the end of the document. This is where the specific
- * instances of value stores can verify the integrity of the
- * identity constraints.
- */
- public void endDocument() {
- } // endDocument()
-
- //
- // ValueStore methods
- //
-
- /* reports an error if an element is matched
- * has nillable true and is matched by a key.
- */
-
- public void reportError(String key, Object[] args) {
- reportSchemaError(key, args);
- } // reportError(String,Object[])
-
- /**
- * Adds the specified value to the value store.
- *
- * @param field The field associated to the value. This reference
- * is used to ensure that each field only adds a value
- * once within a selection scope.
- * @param actualValue The value to add.
- */
- public void addValue(Field field, Object actualValue, short valueType, ShortList itemValueType) {
- int i;
- for (i = fFieldCount - 1; i > -1; i--) {
- if (fFields[i] == field) {
- break;
- }
- }
- // do we even know this field?
- if (i == -1) {
- String code = "UnknownField";
- String eName = fIdentityConstraint.getElementName();
- String cName = fIdentityConstraint.getIdentityConstraintName();
- reportSchemaError(code, new Object[] { field.toString(), eName, cName });
- return;
- }
- if (Boolean.TRUE != mayMatch(field)) {
- String code = "FieldMultipleMatch";
- String cName = fIdentityConstraint.getIdentityConstraintName();
- reportSchemaError(code, new Object[] { field.toString(), cName });
- } else {
- fValuesCount++;
- }
- fLocalValues[i] = actualValue;
- fLocalValueTypes[i] = valueType;
- fLocalItemValueTypes[i] = itemValueType;
- if (fValuesCount == fFieldCount) {
- checkDuplicateValues();
- // store values
- for (i = 0; i < fFieldCount; i++) {
- fValues.addElement(fLocalValues[i]);
- addValueType(fLocalValueTypes[i]);
- addItemValueType(fLocalItemValueTypes[i]);
- }
- }
- } // addValue(String,Field)
-
- /**
- * Returns true if this value store contains the locally scoped value stores
- */
- public boolean contains() {
- // REVISIT: we can improve performance by using hash codes, instead of
- // traversing global vector that could be quite large.
- int next = 0;
- final int size = fValues.size();
- LOOP : for (int i = 0; i < size; i = next) {
- next = i + fFieldCount;
- for (int j = 0; j < fFieldCount; j++) {
- Object value1 = fLocalValues[j];
- Object value2 = fValues.elementAt(i);
- short valueType1 = fLocalValueTypes[j];
- short valueType2 = getValueTypeAt(i);
- if (value1 == null || value2 == null || valueType1 != valueType2 || !(value1.equals(value2))) {
- continue LOOP;
- }
- else if(valueType1 == XSConstants.LIST_DT || valueType1 == XSConstants.LISTOFUNION_DT) {
- ShortList list1 = fLocalItemValueTypes[j];
- ShortList list2 = getItemValueTypeAt(i);
- if(list1 == null || list2 == null || !list1.equals(list2))
- continue LOOP;
- }
- i++;
- }
- // found it
- return true;
- }
- // didn't find it
- return false;
- } // contains():boolean
-
- /**
- * Returns -1 if this value store contains the specified
- * values, otherwise the index of the first field in the
- * key sequence.
- */
- public int contains(ValueStoreBase vsb) {
-
- final Vector values = vsb.fValues;
- final int size1 = values.size();
- if (fFieldCount <= 1) {
- for (int i = 0; i < size1; ++i) {
- short val = vsb.getValueTypeAt(i);
- if (!valueTypeContains(val) || !fValues.contains(values.elementAt(i))) {
- return i;
- }
- else if(val == XSConstants.LIST_DT || val == XSConstants.LISTOFUNION_DT) {
- ShortList list1 = vsb.getItemValueTypeAt(i);
- if (!itemValueTypeContains(list1)) {
- return i;
- }
- }
- }
- }
- /** Handle n-tuples. **/
- else {
- final int size2 = fValues.size();
- /** Iterate over each set of fields. **/
- OUTER: for (int i = 0; i < size1; i += fFieldCount) {
- /** Check whether this set is contained in the value store. **/
- INNER: for (int j = 0; j < size2; j += fFieldCount) {
- for (int k = 0; k < fFieldCount; ++k) {
- final Object value1 = values.elementAt(i+k);
- final Object value2 = fValues.elementAt(j+k);
- final short valueType1 = vsb.getValueTypeAt(i+k);
- final short valueType2 = getValueTypeAt(j+k);
- if (value1 != value2 && (valueType1 != valueType2 || value1 == null || !value1.equals(value2))) {
- continue INNER;
- }
- else if(valueType1 == XSConstants.LIST_DT || valueType1 == XSConstants.LISTOFUNION_DT) {
- ShortList list1 = vsb.getItemValueTypeAt(i+k);
- ShortList list2 = getItemValueTypeAt(j+k);
- if (list1 == null || list2 == null || !list1.equals(list2)) {
- continue INNER;
- }
- }
- }
- continue OUTER;
- }
- return i;
- }
- }
- return -1;
-
- } // contains(Vector):Object
-
- //
- // Protected methods
- //
-
- protected void checkDuplicateValues() {
- // no-op
- } // duplicateValue(Map)
-
- /** Returns a string of the specified values. */
- protected String toString(Object[] values) {
-
- // no values
- int size = values.length;
- if (size == 0) {
- return "";
- }
-
- fTempBuffer.setLength(0);
-
- // construct value string
- for (int i = 0; i < size; i++) {
- if (i > 0) {
- fTempBuffer.append(',');
- }
- fTempBuffer.append(values[i]);
- }
- return fTempBuffer.toString();
-
- } // toString(Object[]):String
-
- /** Returns a string of the specified values. */
- protected String toString(Vector values, int start, int length) {
-
- // no values
- if (length == 0) {
- return "";
- }
-
- // one value
- if (length == 1) {
- return String.valueOf(values.elementAt(start));
- }
-
- // construct value string
- StringBuffer str = new StringBuffer();
- for (int i = 0; i < length; i++) {
- if (i > 0) {
- str.append(',');
- }
- str.append(values.elementAt(start + i));
- }
- return str.toString();
-
- } // toString(Vector,int,int):String
-
- //
- // Object methods
- //
-
- /** Returns a string representation of this object. */
- public String toString() {
- String s = super.toString();
- int index1 = s.lastIndexOf('$');
- if (index1 != -1) {
- s = s.substring(index1 + 1);
- }
- int index2 = s.lastIndexOf('.');
- if (index2 != -1) {
- s = s.substring(index2 + 1);
- }
- return s + '[' + fIdentityConstraint + ']';
- } // toString():String
-
- //
- // Private methods
- //
-
- private void addValueType(short type) {
- if (fUseValueTypeVector) {
- fValueTypes.add(type);
- }
- else if (fValueTypesLength++ == 0) {
- fValueType = type;
- }
- else if (fValueType != type) {
- fUseValueTypeVector = true;
- if (fValueTypes == null) {
- fValueTypes = new ShortVector(fValueTypesLength * 2);
- }
- for (int i = 1; i < fValueTypesLength; ++i) {
- fValueTypes.add(fValueType);
- }
- fValueTypes.add(type);
- }
- }
-
- private short getValueTypeAt(int index) {
- if (fUseValueTypeVector) {
- return fValueTypes.valueAt(index);
- }
- return fValueType;
- }
-
- private boolean valueTypeContains(short value) {
- if (fUseValueTypeVector) {
- return fValueTypes.contains(value);
- }
- return fValueType == value;
- }
-
- private void addItemValueType(ShortList itemValueType) {
- if (fUseItemValueTypeVector) {
- fItemValueTypes.add(itemValueType);
- }
- else if (fItemValueTypesLength++ == 0) {
- fItemValueType = itemValueType;
- }
- else if (!(fItemValueType == itemValueType ||
- (fItemValueType != null && fItemValueType.equals(itemValueType)))) {
- fUseItemValueTypeVector = true;
- if (fItemValueTypes == null) {
- fItemValueTypes = new Vector(fItemValueTypesLength * 2);
- }
- for (int i = 1; i < fItemValueTypesLength; ++i) {
- fItemValueTypes.add(fItemValueType);
- }
- fItemValueTypes.add(itemValueType);
- }
- }
-
- private ShortList getItemValueTypeAt(int index) {
- if (fUseItemValueTypeVector) {
- return (ShortList) fItemValueTypes.elementAt(index);
- }
- return fItemValueType;
- }
-
- private boolean itemValueTypeContains(ShortList value) {
- if (fUseItemValueTypeVector) {
- return fItemValueTypes.contains(value);
- }
- return fItemValueType == value ||
- (fItemValueType != null && fItemValueType.equals(value));
- }
-
- } // class ValueStoreBase
-
- /**
- * Unique value store.
- *
- * @author Andy Clark, IBM
- */
- protected class UniqueValueStore extends ValueStoreBase {
-
- //
- // Constructors
- //
-
- /** Constructs a unique value store. */
- public UniqueValueStore(UniqueOrKey unique) {
- super(unique);
- } // <init>(Unique)
-
- //
- // ValueStoreBase protected methods
- //
-
- /**
- * Called when a duplicate value is added.
- */
- protected void checkDuplicateValues() {
- // is this value as a group duplicated?
- if (contains()) {
- String code = "DuplicateUnique";
- String value = toString(fLocalValues);
- String eName = fIdentityConstraint.getElementName();
- String cName = fIdentityConstraint.getIdentityConstraintName();
- reportSchemaError(code, new Object[] { value, eName, cName });
- }
- } // duplicateValue(Map)
-
- } // class UniqueValueStore
-
- /**
- * Key value store.
- *
- * @author Andy Clark, IBM
- */
- protected class KeyValueStore extends ValueStoreBase {
-
- // REVISIT: Implement a more efficient storage mechanism. -Ac
-
- //
- // Constructors
- //
-
- /** Constructs a key value store. */
- public KeyValueStore(UniqueOrKey key) {
- super(key);
- } // <init>(Key)
-
- //
- // ValueStoreBase protected methods
- //
-
- /**
- * Called when a duplicate value is added.
- */
- protected void checkDuplicateValues() {
- if (contains()) {
- String code = "DuplicateKey";
- String value = toString(fLocalValues);
- String eName = fIdentityConstraint.getElementName();
- String cName = fIdentityConstraint.getIdentityConstraintName();
- reportSchemaError(code, new Object[] { value, eName, cName });
- }
- } // duplicateValue(Map)
-
- } // class KeyValueStore
-
- /**
- * Key reference value store.
- *
- * @author Andy Clark, IBM
- */
- protected class KeyRefValueStore extends ValueStoreBase {
-
- //
- // Data
- //
-
- /** Key value store. */
- protected ValueStoreBase fKeyValueStore;
-
- //
- // Constructors
- //
-
- /** Constructs a key value store. */
- public KeyRefValueStore(KeyRef keyRef, KeyValueStore keyValueStore) {
- super(keyRef);
- fKeyValueStore = keyValueStore;
- } // <init>(KeyRef)
-
- //
- // ValueStoreBase methods
- //
-
- // end the value Scope; here's where we have to tie
- // up keyRef loose ends.
- public void endDocumentFragment() {
-
- // do all the necessary management...
- super.endDocumentFragment();
-
- // verify references
- // get the key store corresponding (if it exists):
- fKeyValueStore =
- (ValueStoreBase) fValueStoreCache.fGlobalIDConstraintMap.get(
- ((KeyRef) fIdentityConstraint).getKey());
-
- if (fKeyValueStore == null) {
- // report error
- String code = "KeyRefOutOfScope";
- String value = fIdentityConstraint.toString();
- reportSchemaError(code, new Object[] { value });
- return;
- }
- int errorIndex = fKeyValueStore.contains(this);
- if (errorIndex != -1) {
- String code = "KeyNotFound";
- String values = toString(fValues, errorIndex, fFieldCount);
- String element = fIdentityConstraint.getElementName();
- String name = fIdentityConstraint.getName();
- reportSchemaError(code, new Object[] { name, values, element });
- }
-
- } // endDocumentFragment()
-
- /** End document. */
- public void endDocument() {
- super.endDocument();
-
- } // endDocument()
-
- } // class KeyRefValueStore
-
- // value store management
-
- /**
- * Value store cache. This class is used to store the values for
- * identity constraints.
- *
- * @author Andy Clark, IBM
- */
- protected class ValueStoreCache {
-
- //
- // Data
- //
- final LocalIDKey fLocalId = new LocalIDKey();
- // values stores
-
- /** stores all global Values stores. */
- protected final Vector fValueStores = new Vector();
-
- /**
- * Values stores associated to specific identity constraints.
- * This map maps IdentityConstraints and
- * the 0-based element on which their selectors first matched to
- * a corresponding ValueStore. This should take care
- * of all cases, including where ID constraints with
- * descendant-or-self axes occur on recursively-defined
- * elements.
- */
- protected final Map<LocalIDKey, ValueStoreBase>
- fIdentityConstraint2ValueStoreMap = new HashMap<>();
-
- // sketch of algorithm:
- // - when a constraint is first encountered, its
- // values are stored in the (local) fIdentityConstraint2ValueStoreMap;
- // - Once it is validated (i.e., when it goes out of scope),
- // its values are merged into the fGlobalIDConstraintMap;
- // - as we encounter keyref's, we look at the global table to
- // validate them.
- //
- // The fGlobalIDMapStack has the following structure:
- // - validation always occurs against the fGlobalIDConstraintMap
- // (which comprises all the "eligible" id constraints);
- // When an endElement is found, this Map is merged with the one
- // below in the stack.
- // When a start tag is encountered, we create a new
- // fGlobalIDConstraintMap.
- // i.e., the top of the fGlobalIDMapStack always contains
- // the preceding siblings' eligible id constraints;
- // the fGlobalIDConstraintMap contains descendants+self.
- // keyrefs can only match descendants+self.
- protected final Stack<Map<IdentityConstraint, ValueStoreBase>>
- fGlobalMapStack = new Stack<>();
- protected final Map<IdentityConstraint, ValueStoreBase>
- fGlobalIDConstraintMap = new HashMap<>();
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- public ValueStoreCache() {
- } // <init>()
-
- //
- // Public methods
- //
-
- /** Resets the identity constraint cache. */
- public void startDocument() {
- fValueStores.removeAllElements();
- fIdentityConstraint2ValueStoreMap.clear();
- fGlobalIDConstraintMap.clear();
- fGlobalMapStack.removeAllElements();
- } // startDocument()
-
- // startElement: pushes the current fGlobalIDConstraintMap
- // onto fGlobalMapStack and clears fGlobalIDConstraint map.
- public void startElement() {
- // only clone the hashtable when there are elements
- if (fGlobalIDConstraintMap.size() > 0)
- fGlobalMapStack.push((Map<IdentityConstraint, ValueStoreBase>)
- ((HashMap)fGlobalIDConstraintMap).clone());
- else
- fGlobalMapStack.push(null);
- fGlobalIDConstraintMap.clear();
- } // startElement(void)
-
- /** endElement(): merges contents of fGlobalIDConstraintMap with the
- * top of fGlobalMapStack into fGlobalIDConstraintMap.
- */
- public void endElement() {
- if (fGlobalMapStack.isEmpty()) {
- return; // must be an invalid doc!
- }
- Map<IdentityConstraint, ValueStoreBase> oldMap = fGlobalMapStack.pop();
- // return if there is no element
- if (oldMap == null) {
- return;
- }
-
- for (Map.Entry<IdentityConstraint, ValueStoreBase> entry : oldMap.entrySet()) {
- IdentityConstraint id = entry.getKey();
- ValueStoreBase oldVal = entry.getValue();
- if (oldVal != null) {
- ValueStoreBase currVal = fGlobalIDConstraintMap.get(id);
- if (currVal == null) {
- fGlobalIDConstraintMap.put(id, oldVal);
- }
- else if (currVal != oldVal) {
- currVal.append(oldVal);
- }
- }
- }
- } // endElement()
-
- /**
- * Initializes the value stores for the specified element
- * declaration.
- */
- public void initValueStoresFor(XSElementDecl eDecl, FieldActivator activator) {
- // initialize value stores for unique fields
- IdentityConstraint[] icArray = eDecl.fIDConstraints;
- int icCount = eDecl.fIDCPos;
- for (int i = 0; i < icCount; i++) {
- switch (icArray[i].getCategory()) {
- case (IdentityConstraint.IC_UNIQUE) :
- // initialize value stores for unique fields
- UniqueOrKey unique = (UniqueOrKey) icArray[i];
- LocalIDKey toHash = new LocalIDKey(unique, fElementDepth);
- UniqueValueStore uniqueValueStore =
- (UniqueValueStore) fIdentityConstraint2ValueStoreMap.get(toHash);
- if (uniqueValueStore == null) {
- uniqueValueStore = new UniqueValueStore(unique);
- fIdentityConstraint2ValueStoreMap.put(toHash, uniqueValueStore);
- } else {
- uniqueValueStore.clear();
- }
- fValueStores.addElement(uniqueValueStore);
- activateSelectorFor(icArray[i]);
- break;
- case (IdentityConstraint.IC_KEY) :
- // initialize value stores for key fields
- UniqueOrKey key = (UniqueOrKey) icArray[i];
- toHash = new LocalIDKey(key, fElementDepth);
- KeyValueStore keyValueStore =
- (KeyValueStore) fIdentityConstraint2ValueStoreMap.get(toHash);
- if (keyValueStore == null) {
- keyValueStore = new KeyValueStore(key);
- fIdentityConstraint2ValueStoreMap.put(toHash, keyValueStore);
- } else {
- keyValueStore.clear();
- }
- fValueStores.addElement(keyValueStore);
- activateSelectorFor(icArray[i]);
- break;
- case (IdentityConstraint.IC_KEYREF) :
- // initialize value stores for keyRef fields
- KeyRef keyRef = (KeyRef) icArray[i];
- toHash = new LocalIDKey(keyRef, fElementDepth);
- KeyRefValueStore keyRefValueStore =
- (KeyRefValueStore) fIdentityConstraint2ValueStoreMap.get(toHash);
- if (keyRefValueStore == null) {
- keyRefValueStore = new KeyRefValueStore(keyRef, null);
- fIdentityConstraint2ValueStoreMap.put(toHash, keyRefValueStore);
- } else {
- keyRefValueStore.clear();
- }
- fValueStores.addElement(keyRefValueStore);
- activateSelectorFor(icArray[i]);
- break;
- }
- }
- } // initValueStoresFor(XSElementDecl)
-
- /** Returns the value store associated to the specified IdentityConstraint. */
- public ValueStoreBase getValueStoreFor(IdentityConstraint id, int initialDepth) {
- fLocalId.fDepth = initialDepth;
- fLocalId.fId = id;
- return fIdentityConstraint2ValueStoreMap.get(fLocalId);
- } // getValueStoreFor(IdentityConstraint, int):ValueStoreBase
-
- /** Returns the global value store associated to the specified IdentityConstraint. */
- public ValueStoreBase getGlobalValueStoreFor(IdentityConstraint id) {
- return fGlobalIDConstraintMap.get(id);
- } // getValueStoreFor(IdentityConstraint):ValueStoreBase
-
- // This method takes the contents of the (local) ValueStore
- // associated with id and moves them into the global
- // map, if id is a <unique> or a <key>.
- // If it's a <keyRef>, then we leave it for later.
- public void transplant(IdentityConstraint id, int initialDepth) {
- fLocalId.fDepth = initialDepth;
- fLocalId.fId = id;
- ValueStoreBase newVals = fIdentityConstraint2ValueStoreMap.get(fLocalId);
- if (id.getCategory() == IdentityConstraint.IC_KEYREF)
- return;
- ValueStoreBase currVals = fGlobalIDConstraintMap.get(id);
- if (currVals != null) {
- currVals.append(newVals);
- fGlobalIDConstraintMap.put(id, currVals);
- } else
- fGlobalIDConstraintMap.put(id, newVals);
-
- } // transplant(id)
-
- /** Check identity constraints. */
- public void endDocument() {
-
- int count = fValueStores.size();
- for (int i = 0; i < count; i++) {
- ValueStoreBase valueStore = (ValueStoreBase) fValueStores.elementAt(i);
- valueStore.endDocument();
- }
-
- } // endDocument()
-
- //
- // Object methods
- //
-
- /** Returns a string representation of this object. */
- public String toString() {
- String s = super.toString();
- int index1 = s.lastIndexOf('$');
- if (index1 != -1) {
- return s.substring(index1 + 1);
- }
- int index2 = s.lastIndexOf('.');
- if (index2 != -1) {
- return s.substring(index2 + 1);
- }
- return s;
- } // toString():String
-
- } // class ValueStoreCache
-
- // the purpose of this class is to enable IdentityConstraint,int
- // pairs to be used easily as keys in Maps.
- protected class LocalIDKey {
-
- public IdentityConstraint fId;
- public int fDepth;
-
- public LocalIDKey() {
- }
-
- public LocalIDKey(IdentityConstraint id, int depth) {
- fId = id;
- fDepth = depth;
- } // init(IdentityConstraint, int)
-
- // object method
- public int hashCode() {
- return fId.hashCode() + fDepth;
- }
-
- public boolean equals(Object localIDKey) {
- if (localIDKey instanceof LocalIDKey) {
- LocalIDKey lIDKey = (LocalIDKey) localIDKey;
- return (lIDKey.fId == fId && lIDKey.fDepth == fDepth);
- }
- return false;
- }
- } // class LocalIDKey
-
- /**
- * A simple vector for <code>short</code>s.
- */
- protected static final class ShortVector {
-
- //
- // Data
- //
-
- /** Current length. */
- private int fLength;
-
- /** Data. */
- private short[] fData;
-
- //
- // Constructors
- //
-
- public ShortVector() {}
-
- public ShortVector(int initialCapacity) {
- fData = new short[initialCapacity];
- }
-
- //
- // Public methods
- //
-
- /** Returns the length of the vector. */
- public int length() {
- return fLength;
- }
-
- /** Adds the value to the vector. */
- public void add(short value) {
- ensureCapacity(fLength + 1);
- fData[fLength++] = value;
- }
-
- /** Returns the short value at the specified position in the vector. */
- public short valueAt(int position) {
- return fData[position];
- }
-
- /** Clears the vector. */
- public void clear() {
- fLength = 0;
- }
-
- /** Returns whether the short is contained in the vector. */
- public boolean contains(short value) {
- for (int i = 0; i < fLength; ++i) {
- if (fData[i] == value) {
- return true;
- }
- }
- return false;
- }
-
- //
- // Private methods
- //
-
- /** Ensures capacity. */
- private void ensureCapacity(int size) {
- if (fData == null) {
- fData = new short[8];
- }
- else if (fData.length <= size) {
- short[] newdata = new short[fData.length * 2];
- System.arraycopy(fData, 0, newdata, 0, fData.length);
- fData = newdata;
- }
- }
- }
-
-} // class SchemaValidator
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/XSAnnotationImpl.java b/src/com/sun/org/apache/xerces/internal/impl/xs/XSAnnotationImpl.java
deleted file mode 100644
index e6e933c..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/XSAnnotationImpl.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xerces.internal.impl.xs;
-
-import java.io.IOException;
-import java.io.StringReader;
-
-import com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl;
-import com.sun.org.apache.xerces.internal.parsers.DOMParser;
-import com.sun.org.apache.xerces.internal.parsers.SAXParser;
-import com.sun.org.apache.xerces.internal.xs.XSAnnotation;
-import com.sun.org.apache.xerces.internal.xs.XSConstants;
-import com.sun.org.apache.xerces.internal.xs.XSNamespaceItem;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-/**
- * This is an implementation of the XSAnnotation schema component.
- *
- * @xerces.internal
- */
-public class XSAnnotationImpl implements XSAnnotation {
-
- // Data
-
- // the content of the annotation node, including all children, along
- // with any non-schema attributes from its parent
- private String fData = null;
-
- // the grammar which owns this annotation; we get parsers
- // from here when we need them
- private SchemaGrammar fGrammar = null;
-
- // constructors
- public XSAnnotationImpl(String contents, SchemaGrammar grammar) {
- fData = contents;
- fGrammar = grammar;
- }
-
- /**
- * Write contents of the annotation to the specified DOM object. If the
- * specified <code>target</code> object is a DOM in-scope namespace
- * declarations for <code>annotation</code> element are added as
- * attributes nodes of the serialized <code>annotation</code>, otherwise
- * the corresponding events for all in-scope namespace declaration are
- * sent via specified document handler.
- * @param target A target pointer to the annotation target object, i.e.
- * <code>org.w3c.dom.Document</code>,
- * <code>org.xml.sax.ContentHandler</code>.
- * @param targetType A target type.
- * @return If the <code>target</code> is recognized type and supported by
- * this implementation return true, otherwise return false.
- */
- public boolean writeAnnotation(Object target,
- short targetType) {
- if(targetType == XSAnnotation.W3C_DOM_ELEMENT || targetType == XSAnnotation.W3C_DOM_DOCUMENT) {
- writeToDOM((Node)target, targetType);
- return true;
- } else if (targetType == SAX_CONTENTHANDLER) {
- writeToSAX((ContentHandler)target);
- return true;
- }
- return false;
- }
-
- /**
- * A text representation of annotation.
- */
- public String getAnnotationString() {
- return fData;
- }
-
- // XSObject methods
-
- /**
- * The <code>type</code> of this object, i.e.
- * <code>ELEMENT_DECLARATION</code>.
- */
- public short getType() {
- return XSConstants.ANNOTATION;
- }
-
- /**
- * The name of type <code>NCName</code> of this declaration as defined in
- * XML Namespaces.
- */
- public String getName() {
- return null;
- }
-
- /**
- * The [target namespace] of this object, or <code>null</code> if it is
- * unspecified.
- */
- public String getNamespace() {
- return null;
- }
-
- /**
- * A namespace schema information item corresponding to the target
- * namespace of the component, if it's globally declared; or null
- * otherwise.
- */
- public XSNamespaceItem getNamespaceItem() {
- return null;
- }
-
- // private methods
- private synchronized void writeToSAX(ContentHandler handler) {
- // nothing must go wrong with this parse...
- SAXParser parser = fGrammar.getSAXParser();
- StringReader aReader = new StringReader(fData);
- InputSource aSource = new InputSource(aReader);
- parser.setContentHandler(handler);
- try {
- parser.parse(aSource);
- }
- catch (SAXException e) {
- // this should never happen!
- // REVISIT: what to do with this?; should really not
- // eat it...
- }
- catch (IOException i) {
- // ditto with above
- }
- // Release the reference to the user's ContentHandler.
- parser.setContentHandler(null);
- }
-
- // this creates the new Annotation element as the first child
- // of the Node
- private synchronized void writeToDOM(Node target, short type) {
- Document futureOwner = (type == XSAnnotation.W3C_DOM_ELEMENT) ?
- target.getOwnerDocument() : (Document)target;
- DOMParser parser = fGrammar.getDOMParser();
- StringReader aReader = new StringReader(fData);
- InputSource aSource = new InputSource(aReader);
- try {
- parser.parse(aSource);
- }
- catch (SAXException e) {
- // this should never happen!
- // REVISIT: what to do with this?; should really not
- // eat it...
- }
- catch (IOException i) {
- // ditto with above
- }
- Document aDocument = parser.getDocument();
- parser.dropDocumentReferences();
- Element annotation = aDocument.getDocumentElement();
- Node newElem = null;
- if (futureOwner instanceof CoreDocumentImpl) {
- newElem = futureOwner.adoptNode(annotation);
- // adoptNode will return null when the DOM implementations are not compatible.
- if (newElem == null) {
- newElem = futureOwner.importNode(annotation, true);
- }
- }
- else {
- newElem = futureOwner.importNode(annotation, true);
- }
- target.insertBefore(newElem, target.getFirstChild());
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/XSAttributeDecl.java b/src/com/sun/org/apache/xerces/internal/impl/xs/XSAttributeDecl.java
deleted file mode 100644
index 183c6f2..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/XSAttributeDecl.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs;
-
-import com.sun.org.apache.xerces.internal.impl.dv.ValidatedInfo;
-import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType;
-import com.sun.org.apache.xerces.internal.impl.xs.util.XSObjectListImpl;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xs.ShortList;
-import com.sun.org.apache.xerces.internal.xs.XSAnnotation;
-import com.sun.org.apache.xerces.internal.xs.XSAttributeDeclaration;
-import com.sun.org.apache.xerces.internal.xs.XSComplexTypeDefinition;
-import com.sun.org.apache.xerces.internal.xs.XSConstants;
-import com.sun.org.apache.xerces.internal.xs.XSNamespaceItem;
-import com.sun.org.apache.xerces.internal.xs.XSObjectList;
-import com.sun.org.apache.xerces.internal.xs.XSSimpleTypeDefinition;
-
-/**
- * The XML representation for an attribute declaration
- * schema component is an <attribute> element information item
- *
- * @xerces.internal
- *
- * @author Elena Litani, IBM
- * @author Sandy Gao, IBM
- * @version $Id: XSAttributeDecl.java,v 1.7 2010-11-01 04:39:55 joehw Exp $
- */
-public class XSAttributeDecl implements XSAttributeDeclaration {
-
- // scopes
- public final static short SCOPE_ABSENT = 0;
- public final static short SCOPE_GLOBAL = 1;
- public final static short SCOPE_LOCAL = 2;
-
- // the name of the attribute
- String fName = null;
- // the target namespace of the attribute
- String fTargetNamespace = null;
- // the simple type of the attribute
- XSSimpleType fType = null;
- public QName fUnresolvedTypeName = null;
- // value constraint type: default, fixed or !specified
- short fConstraintType = XSConstants.VC_NONE;
- // scope
- short fScope = XSConstants.SCOPE_ABSENT;
- // enclosing complex type, when the scope is local
- XSComplexTypeDecl fEnclosingCT = null;
- // optional annotations
- XSObjectList fAnnotations = null;
- // value constraint value
- ValidatedInfo fDefault = null;
- // The namespace schema information item corresponding to the target namespace
- // of the attribute declaration, if it is globally declared; or null otherwise.
- private XSNamespaceItem fNamespaceItem = null;
-
- public void setValues(String name, String targetNamespace,
- XSSimpleType simpleType, short constraintType, short scope,
- ValidatedInfo valInfo, XSComplexTypeDecl enclosingCT,
- XSObjectList annotations) {
- fName = name;
- fTargetNamespace = targetNamespace;
- fType = simpleType;
- fConstraintType = constraintType;
- fScope = scope;
- fDefault = valInfo;
- fEnclosingCT = enclosingCT;
- fAnnotations = annotations;
- }
-
- public void reset(){
- fName = null;
- fTargetNamespace = null;
- fType = null;
- fUnresolvedTypeName = null;
- fConstraintType = XSConstants.VC_NONE;
- fScope = XSConstants.SCOPE_ABSENT;
- fDefault = null;
- fAnnotations = null;
- }
-
- /**
- * Get the type of the object, i.e ELEMENT_DECLARATION.
- */
- public short getType() {
- return XSConstants.ATTRIBUTE_DECLARATION;
- }
-
- /**
- * The <code>name</code> of this <code>XSObject</code> depending on the
- * <code>XSObject</code> type.
- */
- public String getName() {
- return fName;
- }
-
- /**
- * The namespace URI of this node, or <code>null</code> if it is
- * unspecified. defines how a namespace URI is attached to schema
- * components.
- */
- public String getNamespace() {
- return fTargetNamespace;
- }
-
- /**
- * A simple type definition
- */
- public XSSimpleTypeDefinition getTypeDefinition() {
- return fType;
- }
-
- /**
- * Optional. Either global or a complex type definition (
- * <code>ctDefinition</code>). This property is absent in the case of
- * declarations within attribute group definitions: their scope will be
- * determined when they are used in the construction of complex type
- * definitions.
- */
- public short getScope() {
- return fScope;
- }
-
- /**
- * Locally scoped declarations are available for use only within the
- * complex type definition identified by the <code>scope</code>
- * property.
- */
- public XSComplexTypeDefinition getEnclosingCTDefinition() {
- return fEnclosingCT;
- }
-
- /**
- * Value constraint: one of default, fixed.
- */
- public short getConstraintType() {
- return fConstraintType;
- }
-
- /**
- * Value constraint: The actual value (with respect to the {type
- * definition}) Should we return Object instead of DOMString?
- */
- public String getConstraintValue() {
- // REVISIT: SCAPI: what's the proper representation
- return getConstraintType() == XSConstants.VC_NONE ?
- null :
- fDefault.stringValue();
- }
-
- /**
- * Optional. Annotation.
- */
- public XSAnnotation getAnnotation() {
- return (fAnnotations != null) ? (XSAnnotation) fAnnotations.item(0) : null;
- }
-
- /**
- * Optional. Annotations.
- */
- public XSObjectList getAnnotations() {
- return (fAnnotations != null) ? fAnnotations : XSObjectListImpl.EMPTY_LIST;
- }
-
- public ValidatedInfo getValInfo() {
- return fDefault;
- }
-
- /**
- * @see org.apache.xerces.xs.XSObject#getNamespaceItem()
- */
- public XSNamespaceItem getNamespaceItem() {
- return fNamespaceItem;
- }
-
- void setNamespaceItem(XSNamespaceItem namespaceItem) {
- fNamespaceItem = namespaceItem;
- }
-
- public Object getActualVC() {
- return getConstraintType() == XSConstants.VC_NONE ?
- null :
- fDefault.actualValue;
- }
-
- public short getActualVCType() {
- return getConstraintType() == XSConstants.VC_NONE ?
- XSConstants.UNAVAILABLE_DT :
- fDefault.actualValueType;
- }
-
- public ShortList getItemValueTypes() {
- return getConstraintType() == XSConstants.VC_NONE ?
- null :
- fDefault.itemValueTypes;
- }
-
-} // class XSAttributeDecl
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/XSAttributeGroupDecl.java b/src/com/sun/org/apache/xerces/internal/impl/xs/XSAttributeGroupDecl.java
deleted file mode 100644
index 8e90705..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/XSAttributeGroupDecl.java
+++ /dev/null
@@ -1,402 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs;
-
-import com.sun.org.apache.xerces.internal.impl.dv.ValidatedInfo;
-import com.sun.org.apache.xerces.internal.impl.xs.util.XSObjectListImpl;
-import com.sun.org.apache.xerces.internal.xs.XSAnnotation;
-import com.sun.org.apache.xerces.internal.xs.XSAttributeGroupDefinition;
-import com.sun.org.apache.xerces.internal.xs.XSAttributeUse;
-import com.sun.org.apache.xerces.internal.xs.XSConstants;
-import com.sun.org.apache.xerces.internal.xs.XSNamespaceItem;
-import com.sun.org.apache.xerces.internal.xs.XSObjectList;
-import com.sun.org.apache.xerces.internal.xs.XSWildcard;
-
-/**
- * The XML representation for an attribute group declaration
- * schema component is a global <attributeGroup> element information item
- *
- * @xerces.internal
- *
- * @author Sandy Gao, IBM
- * @author Rahul Srivastava, Sun Microsystems Inc.
- *
- * @version $Id: XSAttributeGroupDecl.java,v 1.7 2010-11-01 04:39:55 joehw Exp $
- */
-public class XSAttributeGroupDecl implements XSAttributeGroupDefinition {
-
- // name of the attribute group
- public String fName = null;
- // target namespace of the attribute group
- public String fTargetNamespace = null;
- // number of attribute uses included by this attribute group
- int fAttrUseNum = 0;
- // attribute uses included by this attribute group
- private static final int INITIAL_SIZE = 5;
- XSAttributeUseImpl[] fAttributeUses = new XSAttributeUseImpl[INITIAL_SIZE];
- // attribute wildcard included by this attribute group
- public XSWildcardDecl fAttributeWC = null;
- // whether there is an attribute use whose type is or is derived from ID.
- public String fIDAttrName = null;
-
- // optional annotation
- public XSObjectList fAnnotations;
-
- protected XSObjectListImpl fAttrUses = null;
-
- // The namespace schema information item corresponding to the target namespace
- // of the attribute group definition, if it is globally declared; or null otherwise.
- private XSNamespaceItem fNamespaceItem = null;
-
- // add an attribute use
- // if the type is derived from ID, but there is already another attribute
- // use of type ID, then return the name of the other attribute use;
- // otherwise, return null
- public String addAttributeUse(XSAttributeUseImpl attrUse) {
-
- // if this attribute use is prohibited, then don't check whether it's
- // of type ID
- if (attrUse.fUse != SchemaSymbols.USE_PROHIBITED) {
- if (attrUse.fAttrDecl.fType.isIDType()) {
- // if there is already an attribute use of type ID,
- // return its name (and don't add it to the list, to avoid
- // interruption to instance validation.
- if (fIDAttrName == null)
- fIDAttrName = attrUse.fAttrDecl.fName;
- else
- return fIDAttrName;
- }
- }
-
- if (fAttrUseNum == fAttributeUses.length) {
- fAttributeUses = resize(fAttributeUses, fAttrUseNum*2);
- }
- fAttributeUses[fAttrUseNum++] = attrUse;
-
- return null;
- }
-
- public void replaceAttributeUse(XSAttributeUse oldUse, XSAttributeUseImpl newUse) {
- for (int i=0; i<fAttrUseNum; i++) {
- if (fAttributeUses[i] == oldUse) {
- fAttributeUses[i] = newUse;
- }
- }
- }
-
- public XSAttributeUse getAttributeUse(String namespace, String name) {
- for (int i=0; i<fAttrUseNum; i++) {
- if ( (fAttributeUses[i].fAttrDecl.fTargetNamespace == namespace) &&
- (fAttributeUses[i].fAttrDecl.fName == name) )
- return fAttributeUses[i];
- }
-
- return null;
- }
-
- public XSAttributeUse getAttributeUseNoProhibited(String namespace, String name) {
- for (int i=0; i<fAttrUseNum; i++) {
- if ( (fAttributeUses[i].fAttrDecl.fTargetNamespace == namespace) &&
- (fAttributeUses[i].fAttrDecl.fName == name) &&
- (fAttributeUses[i].fUse != SchemaSymbols.USE_PROHIBITED))
- return fAttributeUses[i];
- }
-
- return null;
- }
-
- public void removeProhibitedAttrs() {
- if (fAttrUseNum == 0) return;
- // Remove all prohibited attributes.
- int count = 0;
- XSAttributeUseImpl[] uses = new XSAttributeUseImpl[fAttrUseNum];
- for (int i = 0; i < fAttrUseNum; i++) {
- if (fAttributeUses[i].fUse != SchemaSymbols.USE_PROHIBITED) {
- uses[count++] = fAttributeUses[i];
- }
- }
- fAttributeUses = uses;
- fAttrUseNum = count;
-
- // Do not remove attributes that have the same name as the prohibited
- // ones, because they are specified at the same level. Prohibited
- // attributes are only to remove attributes from the base type in a
- // restriction.
-// int newCount = 0;
-// if (pCount > 0) {
-// OUTER: for (int i = 0; i < fAttrUseNum; i++) {
-// if (fAttributeUses[i].fUse == SchemaSymbols.USE_PROHIBITED)
-// continue;
-// for (int j = 1; j <= pCount; j++) {
-// if (fAttributeUses[i].fAttrDecl.fName == pUses[fAttrUseNum-pCount].fAttrDecl.fName &&
-// fAttributeUses[i].fAttrDecl.fTargetNamespace == pUses[fAttrUseNum-pCount].fAttrDecl.fTargetNamespace) {
-// continue OUTER;
-// }
-// }
-// pUses[newCount++] = fAttributeUses[i];
-// }
-// fAttributeUses = pUses;
-// fAttrUseNum = newCount;
-// }
- }
-
- /**
- * Check that the attributes in this group validly restrict those from a base group.
- * If an error is found, an Object[] is returned. This contains the arguments for the error message
- * describing the error. The last element in the array (at index arr.length - 1) is the the error code.
- * Returns null if there is no error.
- *
- * REVISIT: is there a better way of returning the appropriate information for the error?
- *
- * @param typeName the name of the type containing this attribute group, used for error reporting purposes
- * @param baseGroup the XSAttributeGroupDecl that is the base we are checking against
- */
- public Object[] validRestrictionOf(String typeName, XSAttributeGroupDecl baseGroup) {
-
- Object[] errorArgs = null;
- XSAttributeUseImpl attrUse = null;
- XSAttributeDecl attrDecl = null;
- XSAttributeUseImpl baseAttrUse = null;
- XSAttributeDecl baseAttrDecl = null;
-
- for (int i=0; i<fAttrUseNum; i++) {
-
- attrUse = fAttributeUses[i];
- attrDecl = attrUse.fAttrDecl;
-
- // Look for a match in the base
- baseAttrUse = (XSAttributeUseImpl)baseGroup.getAttributeUse(attrDecl.fTargetNamespace,attrDecl.fName);
- if (baseAttrUse != null) {
- //
- // derivation-ok-restriction. Constraint 2.1.1
- //
-
- if (baseAttrUse.getRequired() && !attrUse.getRequired()) {
- errorArgs = new Object[]{typeName, attrDecl.fName,
- attrUse.fUse == SchemaSymbols.USE_OPTIONAL ? SchemaSymbols.ATTVAL_OPTIONAL : SchemaSymbols.ATTVAL_PROHIBITED,
- "derivation-ok-restriction.2.1.1"};
- return errorArgs;
- }
-
- // if this attribute is prohibited in the derived type, don't
- // need to check any of the following constraints.
- if (attrUse.fUse == SchemaSymbols.USE_PROHIBITED) {
- continue;
- }
-
- baseAttrDecl = baseAttrUse.fAttrDecl;
- //
- // derivation-ok-restriction. Constraint 2.1.1
- //
- if (! XSConstraints.checkSimpleDerivationOk(attrDecl.fType,
- baseAttrDecl.fType,
- baseAttrDecl.fType.getFinal()) ) {
- errorArgs = new Object[]{typeName, attrDecl.fName, attrDecl.fType.getName(),
- baseAttrDecl.fType.getName(), "derivation-ok-restriction.2.1.2"};
- return errorArgs;
- }
-
-
- //
- // derivation-ok-restriction. Constraint 2.1.3
- //
- int baseConsType=baseAttrUse.fConstraintType!=XSConstants.VC_NONE?
- baseAttrUse.fConstraintType:baseAttrDecl.getConstraintType();
- int thisConstType = attrUse.fConstraintType!=XSConstants.VC_NONE?
- attrUse.fConstraintType:attrDecl.getConstraintType();
-
- if (baseConsType == XSConstants.VC_FIXED) {
-
- if (thisConstType != XSConstants.VC_FIXED) {
- errorArgs = new Object[]{typeName, attrDecl.fName,
- "derivation-ok-restriction.2.1.3.a"};
- return errorArgs;
- } else {
- // check the values are the same.
- ValidatedInfo baseFixedValue=(baseAttrUse.fDefault!=null ?
- baseAttrUse.fDefault: baseAttrDecl.fDefault);
- ValidatedInfo thisFixedValue=(attrUse.fDefault!=null ?
- attrUse.fDefault: attrDecl.fDefault);
- if (!baseFixedValue.actualValue.equals(thisFixedValue.actualValue)) {
- errorArgs = new Object[]{typeName, attrDecl.fName, thisFixedValue.stringValue(),
- baseFixedValue.stringValue(), "derivation-ok-restriction.2.1.3.b"};
- return errorArgs;
- }
-
- }
-
- }
- } else {
- // No matching attribute in base - there should be a matching wildcard
-
- //
- // derivation-ok-restriction. Constraint 2.2
- //
- if (baseGroup.fAttributeWC == null) {
- errorArgs = new Object[]{typeName, attrDecl.fName,
- "derivation-ok-restriction.2.2.a"};
- return errorArgs;
- }
- else if (!baseGroup.fAttributeWC.allowNamespace(attrDecl.fTargetNamespace)) {
- errorArgs = new Object[]{typeName, attrDecl.fName,
- attrDecl.fTargetNamespace==null?"":attrDecl.fTargetNamespace,
- "derivation-ok-restriction.2.2.b"};
- return errorArgs;
- }
- }
- }
-
- //
- // Check that any REQUIRED attributes in the base have matching attributes
- // in this group
- // derivation-ok-restriction. Constraint 3
- //
- for (int i=0; i<baseGroup.fAttrUseNum; i++) {
-
- baseAttrUse = baseGroup.fAttributeUses[i];
-
- if (baseAttrUse.fUse == SchemaSymbols.USE_REQUIRED) {
-
- baseAttrDecl = baseAttrUse.fAttrDecl;
- // Look for a match in this group
- if (getAttributeUse(baseAttrDecl.fTargetNamespace,baseAttrDecl.fName) == null) {
- errorArgs = new Object[]{typeName, baseAttrUse.fAttrDecl.fName,
- "derivation-ok-restriction.3"};
- return errorArgs;
- }
- }
- }
-
-
- // Now, check wildcards
- //
- // derivation-ok-restriction. Constraint 4
- //
- if (fAttributeWC != null) {
- if (baseGroup.fAttributeWC == null) {
- errorArgs = new Object[]{typeName, "derivation-ok-restriction.4.1"};
- return errorArgs;
- }
- if (! fAttributeWC.isSubsetOf(baseGroup.fAttributeWC)) {
- errorArgs = new Object[]{typeName, "derivation-ok-restriction.4.2"};
- return errorArgs;
- }
- if (fAttributeWC.weakerProcessContents(baseGroup.fAttributeWC)) {
- errorArgs = new Object[]{typeName,
- fAttributeWC.getProcessContentsAsString(),
- baseGroup.fAttributeWC.getProcessContentsAsString(),
- "derivation-ok-restriction.4.3"};
- return errorArgs;
- }
- }
-
- return null;
-
- }
-
- static final XSAttributeUseImpl[] resize(XSAttributeUseImpl[] oldArray, int newSize) {
- XSAttributeUseImpl[] newArray = new XSAttributeUseImpl[newSize];
- System.arraycopy(oldArray, 0, newArray, 0, Math.min(oldArray.length, newSize));
- return newArray;
- }
-
- // reset the attribute group declaration
- public void reset(){
- fName = null;
- fTargetNamespace = null;
- // reset attribute uses
- for (int i=0;i<fAttrUseNum;i++) {
- fAttributeUses[i] = null;
- }
- fAttrUseNum = 0;
- fAttributeWC = null;
- fAnnotations = null;
- fIDAttrName = null;
-
- }
-
- /**
- * Get the type of the object, i.e ELEMENT_DECLARATION.
- */
- public short getType() {
- return XSConstants.ATTRIBUTE_GROUP;
- }
-
- /**
- * The <code>name</code> of this <code>XSObject</code> depending on the
- * <code>XSObject</code> type.
- */
- public String getName() {
- return fName;
- }
-
- /**
- * The namespace URI of this node, or <code>null</code> if it is
- * unspecified. defines how a namespace URI is attached to schema
- * components.
- */
- public String getNamespace() {
- return fTargetNamespace;
- }
-
- /**
- * {attribute uses} A set of attribute uses.
- */
- public XSObjectList getAttributeUses() {
- if (fAttrUses == null){
- fAttrUses = new XSObjectListImpl(fAttributeUses, fAttrUseNum);
- }
- return fAttrUses;
- }
-
- /**
- * {attribute wildcard} Optional. A wildcard.
- */
- public XSWildcard getAttributeWildcard() {
- return fAttributeWC;
- }
-
- /**
- * Optional. Annotation.
- */
- public XSAnnotation getAnnotation() {
- return (fAnnotations != null) ? (XSAnnotation) fAnnotations.item(0) : null;
- }
-
- /**
- * Optional. Annotations.
- */
- public XSObjectList getAnnotations() {
- return (fAnnotations != null) ? fAnnotations : XSObjectListImpl.EMPTY_LIST;
- }
-
- /**
- * @see org.apache.xerces.xs.XSObject#getNamespaceItem()
- */
- public XSNamespaceItem getNamespaceItem() {
- return fNamespaceItem;
- }
-
- void setNamespaceItem(XSNamespaceItem namespaceItem) {
- fNamespaceItem = namespaceItem;
- }
-
-} // class XSAttributeGroupDecl
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/XSAttributeUseImpl.java b/src/com/sun/org/apache/xerces/internal/impl/xs/XSAttributeUseImpl.java
deleted file mode 100644
index 174c285..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/XSAttributeUseImpl.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs;
-
-import com.sun.org.apache.xerces.internal.impl.dv.ValidatedInfo;
-import com.sun.org.apache.xerces.internal.impl.xs.util.XSObjectListImpl;
-import com.sun.org.apache.xerces.internal.xs.ShortList;
-import com.sun.org.apache.xerces.internal.xs.XSAttributeDeclaration;
-import com.sun.org.apache.xerces.internal.xs.XSAttributeUse;
-import com.sun.org.apache.xerces.internal.xs.XSConstants;
-import com.sun.org.apache.xerces.internal.xs.XSNamespaceItem;
-import com.sun.org.apache.xerces.internal.xs.XSObjectList;
-
-/**
- * The XML representation for an attribute use
- * schema component is a local <attribute> element information item
- *
- * @xerces.internal
- *
- * @author Sandy Gao, IBM
- * @version $Id: XSAttributeUseImpl.java,v 1.7 2010-11-01 04:39:55 joehw Exp $
- */
-public class XSAttributeUseImpl implements XSAttributeUse {
-
- // the referred attribute decl
- public XSAttributeDecl fAttrDecl = null;
- // use information: SchemaSymbols.USE_OPTIONAL, REQUIRED, PROHIBITED
- public short fUse = SchemaSymbols.USE_OPTIONAL;
- // value constraint type: default, fixed or !specified
- public short fConstraintType = XSConstants.VC_NONE;
- // value constraint value
- public ValidatedInfo fDefault = null;
- // optional annotation
- public XSObjectList fAnnotations = null;
-
- public void reset(){
- fDefault = null;
- fAttrDecl = null;
- fUse = SchemaSymbols.USE_OPTIONAL;
- fConstraintType = XSConstants.VC_NONE;
- fAnnotations = null;
- }
-
- /**
- * Get the type of the object, i.e ELEMENT_DECLARATION.
- */
- public short getType() {
- return XSConstants.ATTRIBUTE_USE;
- }
-
- /**
- * The <code>name</code> of this <code>XSObject</code> depending on the
- * <code>XSObject</code> type.
- */
- public String getName() {
- return null;
- }
-
- /**
- * The namespace URI of this node, or <code>null</code> if it is
- * unspecified. defines how a namespace URI is attached to schema
- * components.
- */
- public String getNamespace() {
- return null;
- }
-
- /**
- * {required} determines whether this use of an attribute declaration
- * requires an appropriate attribute information item to be present, or
- * merely allows it.
- */
- public boolean getRequired() {
- return fUse == SchemaSymbols.USE_REQUIRED;
- }
-
- /**
- * {attribute declaration} provides the attribute declaration itself,
- * which will in turn determine the simple type definition used.
- */
- public XSAttributeDeclaration getAttrDeclaration() {
- return fAttrDecl;
- }
-
- /**
- * Value Constraint: one of default, fixed.
- */
- public short getConstraintType() {
- return fConstraintType;
- }
-
- /**
- * Value Constraint: The actual value (with respect to the {type
- * definition}).
- */
- public String getConstraintValue() {
- // REVISIT: SCAPI: what's the proper representation
- return getConstraintType() == XSConstants.VC_NONE ?
- null :
- fDefault.stringValue();
- }
-
- /**
- * @see org.apache.xerces.xs.XSObject#getNamespaceItem()
- */
- public XSNamespaceItem getNamespaceItem() {
- return null;
- }
-
- public Object getActualVC() {
- return getConstraintType() == XSConstants.VC_NONE ?
- null :
- fDefault.actualValue;
- }
-
- public short getActualVCType() {
- return getConstraintType() == XSConstants.VC_NONE ?
- XSConstants.UNAVAILABLE_DT :
- fDefault.actualValueType;
- }
-
- public ShortList getItemValueTypes() {
- return getConstraintType() == XSConstants.VC_NONE ?
- null :
- fDefault.itemValueTypes;
- }
-
- /**
- * Optional. Annotations.
- */
- public XSObjectList getAnnotations() {
- return (fAnnotations != null) ? fAnnotations : XSObjectListImpl.EMPTY_LIST;
- }
-
-} // class XSAttributeUseImpl
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/XSComplexTypeDecl.java b/src/com/sun/org/apache/xerces/internal/impl/xs/XSComplexTypeDecl.java
deleted file mode 100644
index 79f2500..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/XSComplexTypeDecl.java
+++ /dev/null
@@ -1,719 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs;
-
-import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType;
-import com.sun.org.apache.xerces.internal.xs.*;
-import com.sun.org.apache.xerces.internal.impl.xs.models.XSCMValidator;
-import com.sun.org.apache.xerces.internal.impl.xs.models.CMBuilder;
-import com.sun.org.apache.xerces.internal.impl.xs.util.XSObjectListImpl;
-import com.sun.org.apache.xerces.internal.impl.dv.xs.XSSimpleTypeDecl;
-import org.w3c.dom.TypeInfo;
-
-/**
- * The XML representation for a complexType
- * schema component is a <complexType> element information item
- *
- * @xerces.internal
- *
- * @author Elena Litani, IBM
- * @author Sandy Gao, IBM
- * @version $Id: XSComplexTypeDecl.java,v 1.8 2010-11-01 04:39:55 joehw Exp $
- */
-public class XSComplexTypeDecl implements XSComplexTypeDefinition, TypeInfo {
-
- // name of the complexType
- String fName = null;
-
- // target namespace of the complexType
- String fTargetNamespace = null;
-
- // base type of the complexType
- XSTypeDefinition fBaseType = null;
-
- // derivation method of the complexType
- short fDerivedBy = XSConstants.DERIVATION_RESTRICTION;
-
- // final set of the complexType
- short fFinal = XSConstants.DERIVATION_NONE;
-
- // block set (prohibited substitution) of the complexType
- short fBlock = XSConstants.DERIVATION_NONE;
-
- // flags: whether is abstract; whether contains ID type;
- // whether it's an anonymous tpye
- short fMiscFlags = 0;
-
- // the attribute group that holds the attribute uses and attribute wildcard
- XSAttributeGroupDecl fAttrGrp = null;
-
- // the content type of the complexType
- short fContentType = CONTENTTYPE_EMPTY;
-
- // if the content type is simple, then the corresponding simpleType
- XSSimpleType fXSSimpleType = null;
-
- // if the content type is element or mixed, the particle
- XSParticleDecl fParticle = null;
-
- // if there is a particle, the content model corresponding to that particle
- volatile XSCMValidator fCMValidator = null;
-
- // the content model that's sufficient for computing UPA
- XSCMValidator fUPACMValidator = null;
-
- // list of annotations affiliated with this type
- XSObjectListImpl fAnnotations = null;
-
- // The namespace schema information item corresponding to the target namespace
- // of the complex type definition, if it is globally declared; or null otherwise.
- private XSNamespaceItem fNamespaceItem = null;
-
- // DOM Level 3 TypeInfo Derivation Method constants
- static final int DERIVATION_ANY = 0;
- static final int DERIVATION_RESTRICTION = 1;
- static final int DERIVATION_EXTENSION = 2;
- static final int DERIVATION_UNION = 4;
- static final int DERIVATION_LIST = 8;
-
- public XSComplexTypeDecl() {
- // do-nothing constructor for now.
- }
-
- public void setValues(String name, String targetNamespace,
- XSTypeDefinition baseType, short derivedBy, short schemaFinal,
- short block, short contentType,
- boolean isAbstract, XSAttributeGroupDecl attrGrp,
- XSSimpleType simpleType, XSParticleDecl particle,
- XSObjectListImpl annotations) {
- fTargetNamespace = targetNamespace;
- fBaseType = baseType;
- fDerivedBy = derivedBy;
- fFinal = schemaFinal;
- fBlock = block;
- fContentType = contentType;
- if(isAbstract)
- fMiscFlags |= CT_IS_ABSTRACT;
- fAttrGrp = attrGrp;
- fXSSimpleType = simpleType;
- fParticle = particle;
- fAnnotations = annotations;
- }
-
- public void setName(String name) {
- fName = name;
- }
-
- public short getTypeCategory() {
- return COMPLEX_TYPE;
- }
-
- public String getTypeName() {
- return fName;
- }
-
- public short getFinalSet(){
- return fFinal;
- }
-
- public String getTargetNamespace(){
- return fTargetNamespace;
- }
-
- // flags for the misc flag
- private static final short CT_IS_ABSTRACT = 1;
- private static final short CT_HAS_TYPE_ID = 2;
- private static final short CT_IS_ANONYMOUS = 4;
-
- // methods to get/set misc flag
-
- public boolean containsTypeID () {
- return((fMiscFlags & CT_HAS_TYPE_ID) != 0);
- }
-
- public void setIsAbstractType() {
- fMiscFlags |= CT_IS_ABSTRACT;
- }
- public void setContainsTypeID() {
- fMiscFlags |= CT_HAS_TYPE_ID;
- }
- public void setIsAnonymous() {
- fMiscFlags |= CT_IS_ANONYMOUS;
- }
-
- public XSCMValidator getContentModel(CMBuilder cmBuilder) {
- // for complex type with empty or simple content,
- // there is no content model validator
- if (fContentType == XSComplexTypeDecl.CONTENTTYPE_SIMPLE ||
- fContentType == XSComplexTypeDecl.CONTENTTYPE_EMPTY) {
- return null;
- }
- if (fCMValidator == null)
- synchronized (this) {
- if (fCMValidator == null) {
- fCMValidator = cmBuilder.getContentModel(this);
- }
- }
- return fCMValidator;
- }
-
- // some utility methods:
-
- // return the attribute group for this complex type
- public XSAttributeGroupDecl getAttrGrp() {
- return fAttrGrp;
- }
-
- public String toString() {
- StringBuilder str = new StringBuilder(192);
- appendTypeInfo(str);
- return str.toString();
- }
-
- void appendTypeInfo(StringBuilder str) {
- String contentType[] = {"EMPTY", "SIMPLE", "ELEMENT", "MIXED"};
- String derivedBy[] = {"EMPTY", "EXTENSION", "RESTRICTION"};
-
- str.append("Complex type name='").append(fTargetNamespace).append(',').append(getTypeName()).append("', ");
- if (fBaseType != null) {
- str.append(" base type name='").append(fBaseType.getName()).append("', ");
- }
- str.append(" content type='").append(contentType[fContentType]).append("', ");
- str.append(" isAbstract='").append(getAbstract()).append("', ");
- str.append(" hasTypeId='").append(containsTypeID()).append("', ");
- str.append(" final='").append(fFinal).append("', ");
- str.append(" block='").append(fBlock).append("', ");
- if (fParticle != null) {
- str.append(" particle='").append(fParticle.toString()).append("', ");
- }
- str.append(" derivedBy='").append(derivedBy[fDerivedBy]).append("'. ");
-
- }
-
- public boolean derivedFromType(XSTypeDefinition ancestor, short derivationMethod) {
- // ancestor is null, retur false
- if (ancestor == null)
- return false;
- // ancestor is anyType, return true
- if (ancestor == SchemaGrammar.fAnyType)
- return true;
- // recursively get base, and compare it with ancestor
- XSTypeDefinition type = this;
- while (type != ancestor && // compare with ancestor
- type != SchemaGrammar.fAnySimpleType && // reached anySimpleType
- type != SchemaGrammar.fAnyType) { // reached anyType
- type = type.getBaseType();
- }
-
- return type == ancestor;
- }
-
- public boolean derivedFrom(String ancestorNS, String ancestorName, short derivationMethod) {
- // ancestor is null, retur false
- if (ancestorName == null)
- return false;
- // ancestor is anyType, return true
- if (ancestorNS != null &&
- ancestorNS.equals(SchemaSymbols.URI_SCHEMAFORSCHEMA) &&
- ancestorName.equals(SchemaSymbols.ATTVAL_ANYTYPE)) {
- return true;
- }
-
- // recursively get base, and compare it with ancestor
- XSTypeDefinition type = this;
- while (!(ancestorName.equals(type.getName()) &&
- ((ancestorNS == null && type.getNamespace() == null) ||
- (ancestorNS != null && ancestorNS.equals(type.getNamespace())))) && // compare with ancestor
- type != SchemaGrammar.fAnySimpleType && // reached anySimpleType
- type != SchemaGrammar.fAnyType) { // reached anyType
- type = (XSTypeDefinition)type.getBaseType();
- }
-
- return type != SchemaGrammar.fAnySimpleType &&
- type != SchemaGrammar.fAnyType;
- }
-
- /**
- * Checks if a type is derived from another given the the name, namespace
- * and derivation method. See:
- * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#TypeInfo-isDerivedFrom
- *
- * @param ancestorNS
- * The namspace of the ancestor type declaration
- * @param ancestorName
- * The name of the ancestor type declaration
- * @param derivationMethod
- * The derivation method
- *
- * @return boolean True if the ancestor type is derived from the reference
- * type by the specifiied derivation method.
- */
- public boolean isDOMDerivedFrom(String ancestorNS, String ancestorName,
- int derivationMethod) {
- // ancestor is null, retur false
- if (ancestorName == null)
- return false;
-
- // ancestor is anyType, return true
- if (ancestorNS != null
- && ancestorNS.equals(SchemaSymbols.URI_SCHEMAFORSCHEMA)
- && ancestorName.equals(SchemaSymbols.ATTVAL_ANYTYPE)
- && (derivationMethod == DERIVATION_RESTRICTION
- && derivationMethod == DERIVATION_EXTENSION)) {
- return true;
- }
-
- // restriction
- if ((derivationMethod & DERIVATION_RESTRICTION) != 0) {
- if (isDerivedByRestriction(ancestorNS, ancestorName,
- derivationMethod, this)) {
- return true;
- }
- }
-
- // extension
- if ((derivationMethod & DERIVATION_EXTENSION) != 0) {
- if (isDerivedByExtension(ancestorNS, ancestorName,
- derivationMethod, this)) {
- return true;
- }
- }
-
- // list or union
- if ((((derivationMethod & DERIVATION_LIST) != 0) || ((derivationMethod & DERIVATION_UNION) != 0))
- && ((derivationMethod & DERIVATION_RESTRICTION) == 0)
- && ((derivationMethod & DERIVATION_EXTENSION) == 0)) {
-
- if (ancestorNS.equals(SchemaSymbols.URI_SCHEMAFORSCHEMA)
- && ancestorName.equals(SchemaSymbols.ATTVAL_ANYTYPE)) {
- ancestorName = SchemaSymbols.ATTVAL_ANYSIMPLETYPE;
- }
-
- if(!(fName.equals(SchemaSymbols.ATTVAL_ANYTYPE)
- && fTargetNamespace.equals(SchemaSymbols.URI_SCHEMAFORSCHEMA))){
- if (fBaseType != null && fBaseType instanceof XSSimpleTypeDecl) {
-
- return ((XSSimpleTypeDecl) fBaseType).isDOMDerivedFrom(ancestorNS,
- ancestorName, derivationMethod);
- } else if (fBaseType != null
- && fBaseType instanceof XSComplexTypeDecl) {
- return ((XSComplexTypeDecl) fBaseType).isDOMDerivedFrom(
- ancestorNS, ancestorName, derivationMethod);
- }
- }
- }
-
- // If the value of the parameter is 0 i.e. no bit (corresponding to
- // restriction, list, extension or union) is set to 1 for the
- // derivationMethod parameter.
- if (((derivationMethod & DERIVATION_EXTENSION) == 0)
- && (((derivationMethod & DERIVATION_RESTRICTION) == 0)
- && ((derivationMethod & DERIVATION_LIST) == 0)
- && ((derivationMethod & DERIVATION_UNION) == 0))) {
- return isDerivedByAny(ancestorNS, ancestorName, derivationMethod, this);
- }
-
- return false;
- }
-
- /**
- * Checks if a type is derived from another by any combination of
- * restriction, list ir union. See:
- * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#TypeInfo-isDerivedFrom
- *
- * @param ancestorNS
- * The namspace of the ancestor type declaration
- * @param ancestorName
- * The name of the ancestor type declaration
- * @param derivationMethod
- * A short indication the method of derivation
- * @param type
- * The reference type definition
- *
- * @return boolean True if the type is derived by any method for the
- * reference type
- */
- private boolean isDerivedByAny(String ancestorNS, String ancestorName,
- int derivationMethod, XSTypeDefinition type) {
- XSTypeDefinition oldType = null;
- boolean derivedFrom = false;
- while (type != null && type != oldType) {
-
- // If the ancestor type is reached or is the same as this type.
- if ((ancestorName.equals(type.getName()))
- && ((ancestorNS == null && type.getNamespace() == null)
- || (ancestorNS != null && ancestorNS.equals(type.getNamespace())))) {
- derivedFrom = true;
- break;
- }
-
- // Check if this type is derived from the base by restriction or
- // extension
- if (isDerivedByRestriction(ancestorNS, ancestorName,
- derivationMethod, type)) {
- return true;
- } else if (!isDerivedByExtension(ancestorNS, ancestorName,
- derivationMethod, type)) {
- return true;
- }
- oldType = type;
- type = type.getBaseType();
- }
-
- return derivedFrom;
- }
-
- /**
- * Checks if a type is derived from another by restriction. See:
- * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#TypeInfo-isDerivedFrom
- *
- * @param ancestorNS
- * The namspace of the ancestor type declaration
- * @param ancestorName
- * The name of the ancestor type declaration
- * @param derivationMethod
- * A short indication the method of derivation *
- * @param type
- * The reference type definition
- *
- * @return boolean True if the type is derived by restriciton for the
- * reference type
- */
- private boolean isDerivedByRestriction(String ancestorNS,
- String ancestorName, int derivationMethod, XSTypeDefinition type) {
-
- XSTypeDefinition oldType = null;
- while (type != null && type != oldType) {
-
- // ancestor is anySimpleType, return false
- if (ancestorNS != null
- && ancestorNS.equals(SchemaSymbols.URI_SCHEMAFORSCHEMA)
- && ancestorName.equals(SchemaSymbols.ATTVAL_ANYSIMPLETYPE)) {
- return false;
- }
-
- // if the name and namespace of this type is the same as the
- // ancestor return true
- if ((ancestorName.equals(type.getName()))
- && (ancestorNS != null && ancestorNS.equals(type.getNamespace()))
- || ((type.getNamespace() == null && ancestorNS == null))) {
-
- return true;
- }
-
- // If the base type is a complexType with simpleContent
- if (type instanceof XSSimpleTypeDecl) {
- if (ancestorNS.equals(SchemaSymbols.URI_SCHEMAFORSCHEMA)
- && ancestorName.equals(SchemaSymbols.ATTVAL_ANYTYPE)) {
- ancestorName = SchemaSymbols.ATTVAL_ANYSIMPLETYPE;
- }
- return ((XSSimpleTypeDecl) type).isDOMDerivedFrom(ancestorNS,
- ancestorName, derivationMethod);
- } else {
- // If the base type is a complex type
- // Every derivation step till the base type should be
- // restriction. If not return false
- if (((XSComplexTypeDecl) type).getDerivationMethod() != XSConstants.DERIVATION_RESTRICTION) {
- return false;
- }
- }
- oldType = type;
- type = type.getBaseType();
-
- }
-
- return false;
- }
-
- /**
- * Checks if a type is derived from another by extension. See:
- * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#TypeInfo-isDerivedFrom
- *
- * @param ancestorNS
- * The namspace of the ancestor type declaration
- * @param ancestorName
- * The name of the ancestor type declaration
- * @param derivationMethod
- * A short indication the method of derivation
- * @param type
- * The reference type definition
- *
- * @return boolean True if the type is derived by extension for the
- * reference type
- */
- private boolean isDerivedByExtension(String ancestorNS,
- String ancestorName, int derivationMethod, XSTypeDefinition type) {
-
- boolean extension = false;
- XSTypeDefinition oldType = null;
- while (type != null && type != oldType) {
- // If ancestor is anySimpleType return false.
- if (ancestorNS != null
- && ancestorNS.equals(SchemaSymbols.URI_SCHEMAFORSCHEMA)
- && ancestorName.equals(SchemaSymbols.ATTVAL_ANYSIMPLETYPE)
- && SchemaSymbols.URI_SCHEMAFORSCHEMA.equals(type.getNamespace())
- && SchemaSymbols.ATTVAL_ANYTYPE.equals(type.getName())) {
- break;
- }
-
- if ((ancestorName.equals(type.getName()))
- && ((ancestorNS == null && type.getNamespace() == null)
- || (ancestorNS != null && ancestorNS.equals(type.getNamespace())))) {
- // returns true if atleast one derivation step was extension
- return extension;
- }
-
- // If the base type is a complexType with simpleContent
- if (type instanceof XSSimpleTypeDecl) {
- if (ancestorNS.equals(SchemaSymbols.URI_SCHEMAFORSCHEMA)
- && ancestorName.equals(SchemaSymbols.ATTVAL_ANYTYPE)) {
- ancestorName = SchemaSymbols.ATTVAL_ANYSIMPLETYPE;
- }
-
- // derivationMethod extension will always return false for a
- // simpleType,
- // we treat it like a restriction
- if ((derivationMethod & DERIVATION_EXTENSION) != 0) {
- return extension
- & ((XSSimpleTypeDecl) type).isDOMDerivedFrom(
- ancestorNS, ancestorName,
- (derivationMethod & DERIVATION_RESTRICTION));
- } else {
- return extension
- & ((XSSimpleTypeDecl) type).isDOMDerivedFrom(
- ancestorNS, ancestorName, derivationMethod);
- }
-
- } else {
- // If the base type is a complex type
- // At least one derivation step upto the ancestor type should be
- // extension.
- if (((XSComplexTypeDecl) type).getDerivationMethod() == XSConstants.DERIVATION_EXTENSION) {
- extension = extension | true;
- }
- }
- oldType = type;
- type = type.getBaseType();
- }
-
- return false;
- }
-
-
-
- public void reset(){
- fName = null;
- fTargetNamespace = null;
- fBaseType = null;
- fDerivedBy = XSConstants.DERIVATION_RESTRICTION;
- fFinal = XSConstants.DERIVATION_NONE;
- fBlock = XSConstants.DERIVATION_NONE;
-
- fMiscFlags = 0;
-
- // reset attribute group
- fAttrGrp.reset();
- fContentType = CONTENTTYPE_EMPTY;
- fXSSimpleType = null;
- fParticle = null;
- fCMValidator = null;
- fUPACMValidator = null;
- if(fAnnotations != null) {
- // help out the garbage collector
- fAnnotations.clearXSObjectList();
- }
- fAnnotations = null;
- }
-
- /**
- * Get the type of the object, i.e ELEMENT_DECLARATION.
- */
- public short getType() {
- return XSConstants.TYPE_DEFINITION;
- }
-
- /**
- * The <code>name</code> of this <code>XSObject</code> depending on the
- * <code>XSObject</code> type.
- */
- public String getName() {
- return getAnonymous() ? null : fName;
- }
-
- /**
- * A boolean that specifies if the type definition is anonymous.
- * Convenience attribute. This is a field is not part of
- * XML Schema component model.
- */
- public boolean getAnonymous() {
- return((fMiscFlags & CT_IS_ANONYMOUS) != 0);
- }
-
- /**
- * The namespace URI of this node, or <code>null</code> if it is
- * unspecified. defines how a namespace URI is attached to schema
- * components.
- */
- public String getNamespace() {
- return fTargetNamespace;
- }
-
- /**
- * {base type definition} Either a simple type definition or a complex
- * type definition.
- */
- public XSTypeDefinition getBaseType() {
- return fBaseType;
- }
-
- /**
- * {derivation method} Either extension or restriction. The valid constant
- * value for this <code>XSConstants</code> EXTENTION, RESTRICTION.
- */
- public short getDerivationMethod() {
- return fDerivedBy;
- }
-
- /**
- * {final} For complex type definition it is a subset of {extension,
- * restriction}. For simple type definition it is a subset of
- * {extension, list, restriction, union}.
- * @param derivation Extension, restriction, list, union constants
- * (defined in <code>XSConstants</code>).
- * @return True if derivation is in the final set, otherwise false.
- */
- public boolean isFinal(short derivation) {
- return (fFinal & derivation) != 0;
- }
-
- /**
- * {final} For complex type definition it is a subset of {extension, restriction}.
- *
- * @return A bit flag that represents:
- * {extension, restriction) or none for complexTypes;
- * {extension, list, restriction, union} or none for simpleTypes;
- */
- public short getFinal() {
- return fFinal;
- }
-
- /**
- * {abstract} A boolean. Complex types for which {abstract} is true must
- * not be used as the {type definition} for the validation of element
- * information items.
- */
- public boolean getAbstract() {
- return((fMiscFlags & CT_IS_ABSTRACT) != 0);
- }
-
- /**
- * {attribute uses} A set of attribute uses.
- */
- public XSObjectList getAttributeUses() {
- return fAttrGrp.getAttributeUses();
- }
-
- /**
- * {attribute wildcard} Optional. A wildcard.
- */
- public XSWildcard getAttributeWildcard() {
- return fAttrGrp.getAttributeWildcard();
- }
-
- /**
- * {content type} One of empty, a simple type definition (see
- * <code>simpleType</code>, or mixed, element-only (see
- * <code>cmParticle</code>).
- */
- public short getContentType() {
- return fContentType;
- }
-
- /**
- * A simple type definition corresponding to simple content model,
- * otherwise <code>null</code>
- */
- public XSSimpleTypeDefinition getSimpleType() {
- return fXSSimpleType;
- }
-
- /**
- * A particle for mixed or element-only content model, otherwise
- * <code>null</code>
- */
- public XSParticle getParticle() {
- return fParticle;
- }
-
- /**
- * {prohibited substitutions} A subset of {extension, restriction}.
- * @param prohibited extention or restriction constants (defined in
- * <code>XSConstants</code>).
- * @return True if prohibited is a prohibited substitution, otherwise
- * false.
- */
- public boolean isProhibitedSubstitution(short prohibited) {
- return (fBlock & prohibited) != 0;
- }
-
- /**
- * {prohibited substitutions}
- *
- * @return A bit flag corresponding to prohibited substitutions
- */
- public short getProhibitedSubstitutions() {
- return fBlock;
- }
-
- /**
- * Optional. Annotation.
- */
- public XSObjectList getAnnotations() {
- return (fAnnotations != null) ? fAnnotations : XSObjectListImpl.EMPTY_LIST;
- }
-
- /**
- * @see org.apache.xerces.xs.XSObject#getNamespaceItem()
- */
- public XSNamespaceItem getNamespaceItem() {
- return fNamespaceItem;
- }
-
- void setNamespaceItem(XSNamespaceItem namespaceItem) {
- fNamespaceItem = namespaceItem;
- }
-
- /* (non-Javadoc)
- * @see org.apache.xerces.xs.XSComplexTypeDefinition#getAttributeUse(java.lang.String, java.lang.String)
- */
- public XSAttributeUse getAttributeUse(String namespace, String name) {
- return fAttrGrp.getAttributeUse(namespace, name);
- }
-
- public String getTypeNamespace() {
- return getNamespace();
- }
-
- public boolean isDerivedFrom(String typeNamespaceArg, String typeNameArg, int derivationMethod) {
- return isDOMDerivedFrom(typeNamespaceArg, typeNameArg, derivationMethod);
- }
-
-} // class XSComplexTypeDecl
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/XSConstraints.java b/src/com/sun/org/apache/xerces/internal/impl/xs/XSConstraints.java
deleted file mode 100644
index c56ad0d..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/XSConstraints.java
+++ /dev/null
@@ -1,1533 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs;
-
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Vector;
-
-import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
-import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException;
-import com.sun.org.apache.xerces.internal.impl.dv.ValidatedInfo;
-import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
-import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType;
-import com.sun.org.apache.xerces.internal.impl.xs.models.CMBuilder;
-import com.sun.org.apache.xerces.internal.impl.xs.models.XSCMValidator;
-import com.sun.org.apache.xerces.internal.impl.xs.util.SimpleLocator;
-import com.sun.org.apache.xerces.internal.impl.xs.util.XSObjectListImpl;
-import com.sun.org.apache.xerces.internal.util.SymbolHash;
-import com.sun.org.apache.xerces.internal.xs.XSConstants;
-import com.sun.org.apache.xerces.internal.xs.XSObjectList;
-import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
-
-/**
- * Constaints shared by traversers and validator
- *
- * @xerces.internal
- *
- * @author Sandy Gao, IBM
- *
- * @version $Id: XSConstraints.java,v 1.7 2010-11-01 04:39:55 joehw Exp $
- */
-public class XSConstraints {
-
- // IHR: Visited on 2006-11-17
- // Added a boolean return value to particleValidRestriction (it was a void function)
- // to help the checkRecurseLax to know when expansion has happened and no order is required
- // (IHR@xbrl.org) (Ignacio@Hernandez-Ros.com)
-
- static final int OCCURRENCE_UNKNOWN = SchemaSymbols.OCCURRENCE_UNBOUNDED-1;
- static final XSSimpleType STRING_TYPE = (XSSimpleType)SchemaGrammar.SG_SchemaNS.getGlobalTypeDecl(SchemaSymbols.ATTVAL_STRING);
-
- private static XSParticleDecl fEmptyParticle = null;
- public static XSParticleDecl getEmptySequence() {
- if (fEmptyParticle == null) {
- XSModelGroupImpl group = new XSModelGroupImpl();
- group.fCompositor = XSModelGroupImpl.MODELGROUP_SEQUENCE;
- group.fParticleCount = 0;
- group.fParticles = null;
- group.fAnnotations = XSObjectListImpl.EMPTY_LIST;
- XSParticleDecl particle = new XSParticleDecl();
- particle.fType = XSParticleDecl.PARTICLE_MODELGROUP;
- particle.fValue = group;
- particle.fAnnotations = XSObjectListImpl.EMPTY_LIST;
- fEmptyParticle = particle;
- }
- return fEmptyParticle;
- }
-
- private static final Comparator ELEMENT_PARTICLE_COMPARATOR = new Comparator() {
-
- public int compare(Object o1, Object o2) {
- XSParticleDecl pDecl1 = (XSParticleDecl) o1;
- XSParticleDecl pDecl2 = (XSParticleDecl) o2;
- XSElementDecl decl1 = (XSElementDecl) pDecl1.fValue;
- XSElementDecl decl2 = (XSElementDecl) pDecl2.fValue;
-
- String namespace1 = decl1.getNamespace();
- String namespace2 = decl2.getNamespace();
- String name1 = decl1.getName();
- String name2 = decl2.getName();
-
- boolean sameNamespace = (namespace1 == namespace2);
- int namespaceComparison = 0;
-
- if (!sameNamespace) {
- if (namespace1 != null) {
- if (namespace2 != null){
- namespaceComparison = namespace1.compareTo(namespace2);
- }
- else {
- namespaceComparison = 1;
- }
- }
- else {
- namespaceComparison = -1;
- }
- }
- //This assumes that the names are never null.
- return namespaceComparison != 0 ? namespaceComparison : name1.compareTo(name2);
- }
- };
-
- /**
- * check whether derived is valid derived from base, given a subset
- * of {restriction, extension}.B
- */
- public static boolean checkTypeDerivationOk(XSTypeDefinition derived, XSTypeDefinition base, short block) {
- // if derived is anyType, then it's valid only if base is anyType too
- if (derived == SchemaGrammar.fAnyType)
- return derived == base;
- // if derived is anySimpleType, then it's valid only if the base
- // is ur-type
- if (derived == SchemaGrammar.fAnySimpleType) {
- return (base == SchemaGrammar.fAnyType ||
- base == SchemaGrammar.fAnySimpleType);
- }
-
- // if derived is simple type
- if (derived.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE) {
- // if base is complex type
- if (base.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE) {
- // if base is anyType, change base to anySimpleType,
- // otherwise, not valid
- if (base == SchemaGrammar.fAnyType)
- base = SchemaGrammar.fAnySimpleType;
- else
- return false;
- }
- return checkSimpleDerivation((XSSimpleType)derived,
- (XSSimpleType)base, block);
- }
- else {
- return checkComplexDerivation((XSComplexTypeDecl)derived, base, block);
- }
- }
-
- /**
- * check whether simple type derived is valid derived from base,
- * given a subset of {restriction, extension}.
- */
- public static boolean checkSimpleDerivationOk(XSSimpleType derived, XSTypeDefinition base, short block) {
- // if derived is anySimpleType, then it's valid only if the base
- // is ur-type
- if (derived == SchemaGrammar.fAnySimpleType) {
- return (base == SchemaGrammar.fAnyType ||
- base == SchemaGrammar.fAnySimpleType);
- }
-
- // if base is complex type
- if (base.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE) {
- // if base is anyType, change base to anySimpleType,
- // otherwise, not valid
- if (base == SchemaGrammar.fAnyType)
- base = SchemaGrammar.fAnySimpleType;
- else
- return false;
- }
- return checkSimpleDerivation((XSSimpleType)derived,
- (XSSimpleType)base, block);
- }
-
- /**
- * check whether complex type derived is valid derived from base,
- * given a subset of {restriction, extension}.
- */
- public static boolean checkComplexDerivationOk(XSComplexTypeDecl derived, XSTypeDefinition base, short block) {
- // if derived is anyType, then it's valid only if base is anyType too
- if (derived == SchemaGrammar.fAnyType)
- return derived == base;
- return checkComplexDerivation((XSComplexTypeDecl)derived, base, block);
- }
-
- /**
- * Note: this will be a private method, and it assumes that derived is not
- * anySimpleType, and base is not anyType. Another method will be
- * introduced for public use, which will call this method.
- */
- private static boolean checkSimpleDerivation(XSSimpleType derived, XSSimpleType base, short block) {
- // 1 They are the same type definition.
- if (derived == base)
- return true;
-
- // 2 All of the following must be true:
- // 2.1 restriction is not in the subset, or in the {final} of its own {base type definition};
- if ((block & XSConstants.DERIVATION_RESTRICTION) != 0 ||
- (derived.getBaseType().getFinal() & XSConstants.DERIVATION_RESTRICTION) != 0) {
- return false;
- }
-
- // 2.2 One of the following must be true:
- // 2.2.1 D's base type definition is B.
- XSSimpleType directBase = (XSSimpleType)derived.getBaseType();
- if (directBase == base)
- return true;
-
- // 2.2.2 D's base type definition is not the simple ur-type definition and is validly derived from B given the subset, as defined by this constraint.
- if (directBase != SchemaGrammar.fAnySimpleType &&
- checkSimpleDerivation(directBase, base, block)) {
- return true;
- }
-
- // 2.2.3 D's {variety} is list or union and B is the simple ur-type definition.
- if ((derived.getVariety() == XSSimpleType.VARIETY_LIST ||
- derived.getVariety() == XSSimpleType.VARIETY_UNION) &&
- base == SchemaGrammar.fAnySimpleType) {
- return true;
- }
-
- // 2.2.4 B's {variety} is union and D is validly derived from a type definition in B's {member type definitions} given the subset, as defined by this constraint.
- if (base.getVariety() == XSSimpleType.VARIETY_UNION) {
- XSObjectList subUnionMemberDV = base.getMemberTypes();
- int subUnionSize = subUnionMemberDV.getLength();
- for (int i=0; i<subUnionSize; i++) {
- base = (XSSimpleType)subUnionMemberDV.item(i);
- if (checkSimpleDerivation(derived, base, block))
- return true;
- }
- }
-
- return false;
- }
-
- /**
- * Note: this will be a private method, and it assumes that derived is not
- * anyType. Another method will be introduced for public use,
- * which will call this method.
- */
- private static boolean checkComplexDerivation(XSComplexTypeDecl derived, XSTypeDefinition base, short block) {
- // 2.1 B and D must be the same type definition.
- if (derived == base)
- return true;
-
- // 1 If B and D are not the same type definition, then the {derivation method} of D must not be in the subset.
- if ((derived.fDerivedBy & block) != 0)
- return false;
-
- // 2 One of the following must be true:
- XSTypeDefinition directBase = derived.fBaseType;
- // 2.2 B must be D's {base type definition}.
- if (directBase == base)
- return true;
-
- // 2.3 All of the following must be true:
- // 2.3.1 D's {base type definition} must not be the ur-type definition.
- if (directBase == SchemaGrammar.fAnyType ||
- directBase == SchemaGrammar.fAnySimpleType) {
- return false;
- }
-
- // 2.3.2 The appropriate case among the following must be true:
- // 2.3.2.1 If D's {base type definition} is complex, then it must be validly derived from B given the subset as defined by this constraint.
- if (directBase.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE)
- return checkComplexDerivation((XSComplexTypeDecl)directBase, base, block);
-
- // 2.3.2.2 If D's {base type definition} is simple, then it must be validly derived from B given the subset as defined in Type Derivation OK (Simple) (3.14.6).
- if (directBase.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE) {
- // if base is complex type
- if (base.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE) {
- // if base is anyType, change base to anySimpleType,
- // otherwise, not valid
- if (base == SchemaGrammar.fAnyType)
- base = SchemaGrammar.fAnySimpleType;
- else
- return false;
- }
- return checkSimpleDerivation((XSSimpleType)directBase,
- (XSSimpleType)base, block);
- }
-
- return false;
- }
-
- /**
- * check whether a value is a valid default for some type
- * returns the compiled form of the value
- * The parameter value could be either a String or a ValidatedInfo object
- */
- public static Object ElementDefaultValidImmediate(XSTypeDefinition type, String value, ValidationContext context, ValidatedInfo vinfo) {
-
- XSSimpleType dv = null;
-
- // e-props-correct
- // For a string to be a valid default with respect to a type definition the appropriate case among the following must be true:
- // 1 If the type definition is a simple type definition, then the string must be valid with respect to that definition as defined by String Valid (3.14.4).
- if (type.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE) {
- dv = (XSSimpleType)type;
- }
-
- // 2 If the type definition is a complex type definition, then all of the following must be true:
- else {
- // 2.1 its {content type} must be a simple type definition or mixed.
- XSComplexTypeDecl ctype = (XSComplexTypeDecl)type;
- // 2.2 The appropriate case among the following must be true:
- // 2.2.1 If the {content type} is a simple type definition, then the string must be valid with respect to that simple type definition as defined by String Valid (3.14.4).
- if (ctype.fContentType == XSComplexTypeDecl.CONTENTTYPE_SIMPLE) {
- dv = ctype.fXSSimpleType;
- }
- // 2.2.2 If the {content type} is mixed, then the {content type}'s particle must be emptiable as defined by Particle Emptiable (3.9.6).
- else if (ctype.fContentType == XSComplexTypeDecl.CONTENTTYPE_MIXED) {
- if (!((XSParticleDecl)ctype.getParticle()).emptiable())
- return null;
- }
- else {
- return null;
- }
- }
-
- // get the simple type declaration, and validate
- Object actualValue = null;
- if (dv == null) {
- // complex type with mixed. to make sure that we store correct
- // information in vinfo and return the correct value, we use
- // "string" type for validation
- dv = STRING_TYPE;
- }
- try {
- // validate the original lexical rep, and set the actual value
- actualValue = dv.validate(value, context, vinfo);
- // validate the canonical lexical rep
- if (vinfo != null)
- actualValue = dv.validate(vinfo.stringValue(), context, vinfo);
- } catch (InvalidDatatypeValueException ide) {
- return null;
- }
-
- return actualValue;
- }
-
- static void reportSchemaError(XMLErrorReporter errorReporter,
- SimpleLocator loc,
- String key, Object[] args) {
- if (loc != null) {
- errorReporter.reportError(loc, XSMessageFormatter.SCHEMA_DOMAIN,
- key, args, XMLErrorReporter.SEVERITY_ERROR);
- }
- else {
- errorReporter.reportError(XSMessageFormatter.SCHEMA_DOMAIN,
- key, args, XMLErrorReporter.SEVERITY_ERROR);
- }
- }
-
- /**
- * used to check the 3 constraints against each complex type
- * (should be each model group):
- * Unique Particle Attribution, Particle Derivation (Restriction),
- * Element Declrations Consistent.
- */
- public static void fullSchemaChecking(XSGrammarBucket grammarBucket,
- SubstitutionGroupHandler SGHandler,
- CMBuilder cmBuilder,
- XMLErrorReporter errorReporter) {
- // get all grammars, and put all substitution group information
- // in the substitution group handler
- SchemaGrammar[] grammars = grammarBucket.getGrammars();
- for (int i = grammars.length-1; i >= 0; i--) {
- SGHandler.addSubstitutionGroup(grammars[i].getSubstitutionGroups());
- }
-
- XSParticleDecl fakeDerived = new XSParticleDecl();
- XSParticleDecl fakeBase = new XSParticleDecl();
- fakeDerived.fType = XSParticleDecl.PARTICLE_MODELGROUP;
- fakeBase.fType = XSParticleDecl.PARTICLE_MODELGROUP;
- // before worrying about complexTypes, let's get
- // groups redefined by restriction out of the way.
- for (int g = grammars.length-1; g >= 0; g--) {
- XSGroupDecl [] redefinedGroups = grammars[g].getRedefinedGroupDecls();
- SimpleLocator [] rgLocators = grammars[g].getRGLocators();
- for(int i=0; i<redefinedGroups.length; ) {
- XSGroupDecl derivedGrp = redefinedGroups[i++];
- XSModelGroupImpl derivedMG = derivedGrp.fModelGroup;
- XSGroupDecl baseGrp = redefinedGroups[i++];
- XSModelGroupImpl baseMG = baseGrp.fModelGroup;
- fakeDerived.fValue = derivedMG;
- fakeBase.fValue = baseMG;
- if(baseMG == null) {
- if(derivedMG != null) { // can't be a restriction!
- reportSchemaError(errorReporter, rgLocators[i/2-1],
- "src-redefine.6.2.2",
- new Object[]{derivedGrp.fName, "rcase-Recurse.2"});
- }
- } else if (derivedMG == null) {
- if (!fakeBase.emptiable()) {
- reportSchemaError(errorReporter, rgLocators[i/2-1],
- "src-redefine.6.2.2",
- new Object[]{derivedGrp.fName, "rcase-Recurse.2"});
- }
- } else {
- try {
- particleValidRestriction(fakeDerived, SGHandler, fakeBase, SGHandler);
- } catch (XMLSchemaException e) {
- String key = e.getKey();
- reportSchemaError(errorReporter, rgLocators[i/2-1],
- key,
- e.getArgs());
- reportSchemaError(errorReporter, rgLocators[i/2-1],
- "src-redefine.6.2.2",
- new Object[]{derivedGrp.fName, key});
- }
- }
- }
- }
-
- // for each complex type, check the 3 constraints.
- // types need to be checked
- XSComplexTypeDecl[] types;
- SimpleLocator [] ctLocators;
- // to hold the errors
- // REVISIT: do we want to report all errors? or just one?
- //XMLSchemaError1D errors = new XMLSchemaError1D();
- // whether need to check this type again;
- // whether only do UPA checking
- boolean further, fullChecked;
- // if do all checkings, how many need to be checked again.
- int keepType;
- // i: grammar; j: type; k: error
- // for all grammars
- SymbolHash elemTable = new SymbolHash();
- for (int i = grammars.length-1, j; i >= 0; i--) {
- // get whether to skip EDC, and types need to be checked
- keepType = 0;
- fullChecked = grammars[i].fFullChecked;
- types = grammars[i].getUncheckedComplexTypeDecls();
- ctLocators = grammars[i].getUncheckedCTLocators();
- // for each type
- for (j = 0; j < types.length; j++) {
- // if we've already full-checked this grammar, then
- // skip the EDC constraint
- if (!fullChecked) {
- // 1. Element Decl Consistent
- if (types[j].fParticle!=null) {
- elemTable.clear();
- try {
- checkElementDeclsConsistent(types[j], types[j].fParticle,
- elemTable, SGHandler);
- }
- catch (XMLSchemaException e) {
- reportSchemaError(errorReporter, ctLocators[j],
- e.getKey(),
- e.getArgs());
- }
- }
- }
-
- // 2. Particle Derivation
-
- if (types[j].fBaseType != null &&
- types[j].fBaseType != SchemaGrammar.fAnyType &&
- types[j].fDerivedBy == XSConstants.DERIVATION_RESTRICTION &&
- (types[j].fBaseType instanceof XSComplexTypeDecl)) {
-
- XSParticleDecl derivedParticle=types[j].fParticle;
- XSParticleDecl baseParticle=
- ((XSComplexTypeDecl)(types[j].fBaseType)).fParticle;
- if (derivedParticle==null) {
- if (baseParticle!=null && !baseParticle.emptiable()) {
- reportSchemaError(errorReporter,ctLocators[j],
- "derivation-ok-restriction.5.3.2",
- new Object[]{types[j].fName, types[j].fBaseType.getName()});
- }
- }
- else if (baseParticle!=null) {
- try {
- particleValidRestriction(types[j].fParticle,
- SGHandler,
- ((XSComplexTypeDecl)(types[j].fBaseType)).fParticle,
- SGHandler);
- } catch (XMLSchemaException e) {
- reportSchemaError(errorReporter, ctLocators[j],
- e.getKey(),
- e.getArgs());
- reportSchemaError(errorReporter, ctLocators[j],
- "derivation-ok-restriction.5.4.2",
- new Object[]{types[j].fName});
- }
- }
- else {
- reportSchemaError(errorReporter, ctLocators[j],
- "derivation-ok-restriction.5.4.2",
- new Object[]{types[j].fName});
- }
- }
- // 3. UPA
- // get the content model and check UPA
- XSCMValidator cm = types[j].getContentModel(cmBuilder);
- further = false;
- if (cm != null) {
- try {
- further = cm.checkUniqueParticleAttribution(SGHandler);
- } catch (XMLSchemaException e) {
- reportSchemaError(errorReporter, ctLocators[j],
- e.getKey(),
- e.getArgs());
- }
- }
- // now report all errors
- // REVISIT: do we want to report all errors? or just one?
- /*for (k = errors.getErrorCodeNum()-1; k >= 0; k--) {
- reportSchemaError(errorReporter, ctLocators[j],
- errors.getErrorCode(k),
- errors.getArgs(k));
- }*/
-
- // if we are doing all checkings, and this one needs further
- // checking, store it in the type array.
- if (!fullChecked && further)
- types[keepType++] = types[j];
-
- // clear errors for the next type.
- // REVISIT: do we want to report all errors? or just one?
- //errors.clear();
- }
- // we've done with the types in this grammar. if we are checking
- // all constraints, need to trim type array to a proper size:
- // only contain those need further checking.
- // and mark this grammar that it only needs UPA checking.
- if (!fullChecked) {
- grammars[i].setUncheckedTypeNum(keepType);
- grammars[i].fFullChecked = true;
- }
- }
- }
-
- /*
- Check that a given particle is a valid restriction of a base particle.
- */
-
- public static void checkElementDeclsConsistent(XSComplexTypeDecl type,
- XSParticleDecl particle,
- SymbolHash elemDeclHash,
- SubstitutionGroupHandler sgHandler)
- throws XMLSchemaException {
-
- // check for elements in the tree with the same name and namespace
-
- int pType = particle.fType;
-
- if (pType == XSParticleDecl.PARTICLE_WILDCARD)
- return;
-
- if (pType == XSParticleDecl.PARTICLE_ELEMENT) {
- XSElementDecl elem = (XSElementDecl)(particle.fValue);
- findElemInTable(type, elem, elemDeclHash);
-
- if (elem.fScope == XSConstants.SCOPE_GLOBAL) {
- // Check for subsitution groups.
- XSElementDecl[] subGroup = sgHandler.getSubstitutionGroup(elem);
- for (int i = 0; i < subGroup.length; i++) {
- findElemInTable(type, subGroup[i], elemDeclHash);
- }
- }
- return;
- }
-
- XSModelGroupImpl group = (XSModelGroupImpl)particle.fValue;
- for (int i = 0; i < group.fParticleCount; i++)
- checkElementDeclsConsistent(type, group.fParticles[i], elemDeclHash, sgHandler);
- }
-
- public static void findElemInTable(XSComplexTypeDecl type, XSElementDecl elem,
- SymbolHash elemDeclHash)
- throws XMLSchemaException {
-
- // How can we avoid this concat? LM.
- String name = elem.fName + "," + elem.fTargetNamespace;
-
- XSElementDecl existingElem = null;
- if ((existingElem = (XSElementDecl)(elemDeclHash.get(name))) == null) {
- // just add it in
- elemDeclHash.put(name, elem);
- }
- else {
- // If this is the same check element, we're O.K.
- if (elem == existingElem)
- return;
-
- if (elem.fType != existingElem.fType) {
- // Types are not the same
- throw new XMLSchemaException("cos-element-consistent",
- new Object[] {type.fName, elem.fName});
-
- }
- }
- }
-
- // Check that a given particle is a valid restriction of a base particle.
- //
- // IHR: 2006/11/17
- // Returns a boolean indicating if there has been expansion of substitution group
- // in the bParticle.
- // With this information the checkRecurseLax function knows when is
- // to keep the order and when to ignore it.
- private static boolean particleValidRestriction(XSParticleDecl dParticle,
- SubstitutionGroupHandler dSGHandler,
- XSParticleDecl bParticle,
- SubstitutionGroupHandler bSGHandler)
- throws XMLSchemaException {
- return particleValidRestriction(dParticle, dSGHandler, bParticle, bSGHandler, true);
- }
-
- private static boolean particleValidRestriction(XSParticleDecl dParticle,
- SubstitutionGroupHandler dSGHandler,
- XSParticleDecl bParticle,
- SubstitutionGroupHandler bSGHandler,
- boolean checkWCOccurrence)
- throws XMLSchemaException {
-
- Vector dChildren = null;
- Vector bChildren = null;
- int dMinEffectiveTotalRange=OCCURRENCE_UNKNOWN;
- int dMaxEffectiveTotalRange=OCCURRENCE_UNKNOWN;
-
- // By default there has been no expansion
- boolean bExpansionHappened = false;
-
- // Check for empty particles. If either base or derived particle is empty,
- // (and the other isn't) it's an error.
- if (dParticle.isEmpty() && !bParticle.emptiable()) {
- throw new XMLSchemaException("cos-particle-restrict.a", null);
- }
- else if (!dParticle.isEmpty() && bParticle.isEmpty()) {
- throw new XMLSchemaException("cos-particle-restrict.b", null);
- }
-
- //
- // Do setup prior to invoking the Particle (Restriction) cases.
- // This involves:
- // - removing pointless occurrences for groups, and retrieving a vector of
- // non-pointless children
- // - turning top-level elements with substitution groups into CHOICE groups.
- //
-
- short dType = dParticle.fType;
- //
- // Handle pointless groups for the derived particle
- //
- if (dType == XSParticleDecl.PARTICLE_MODELGROUP) {
- dType = ((XSModelGroupImpl)dParticle.fValue).fCompositor;
-
- // Find a group, starting with this particle, with more than 1 child. There
- // may be none, and the particle of interest trivially becomes an element or
- // wildcard.
- XSParticleDecl dtmp = getNonUnaryGroup(dParticle);
- if (dtmp != dParticle) {
- // Particle has been replaced. Retrieve new type info.
- dParticle = dtmp;
- dType = dParticle.fType;
- if (dType == XSParticleDecl.PARTICLE_MODELGROUP)
- dType = ((XSModelGroupImpl)dParticle.fValue).fCompositor;
- }
-
- // Fill in a vector with the children of the particle, removing any
- // pointless model groups in the process.
- dChildren = removePointlessChildren(dParticle);
- }
-
- int dMinOccurs = dParticle.fMinOccurs;
- int dMaxOccurs = dParticle.fMaxOccurs;
-
- //
- // For elements which are the heads of substitution groups, treat as CHOICE
- //
- if (dSGHandler != null && dType == XSParticleDecl.PARTICLE_ELEMENT) {
- XSElementDecl dElement = (XSElementDecl)dParticle.fValue;
-
- if (dElement.fScope == XSConstants.SCOPE_GLOBAL) {
- // Check for subsitution groups. Treat any element that has a
- // subsitution group as a choice. Fill in the children vector with the
- // members of the substitution group
- XSElementDecl[] subGroup = dSGHandler.getSubstitutionGroup(dElement);
- if (subGroup.length >0 ) {
- // Now, set the type to be CHOICE. The "group" will have the same
- // occurrence information as the original particle.
- dType = XSModelGroupImpl.MODELGROUP_CHOICE;
- dMinEffectiveTotalRange = dMinOccurs;
- dMaxEffectiveTotalRange = dMaxOccurs;
-
- // Fill in the vector of children
- dChildren = new Vector(subGroup.length+1);
- for (int i = 0; i < subGroup.length; i++) {
- addElementToParticleVector(dChildren, subGroup[i]);
- }
- addElementToParticleVector(dChildren, dElement);
- Collections.sort(dChildren, ELEMENT_PARTICLE_COMPARATOR);
-
- // Set the handler to null, to indicate that we've finished handling
- // substitution groups for this particle.
- dSGHandler = null;
- }
- }
- }
-
- short bType = bParticle.fType;
- //
- // Handle pointless groups for the base particle
- //
- if (bType == XSParticleDecl.PARTICLE_MODELGROUP) {
- bType = ((XSModelGroupImpl)bParticle.fValue).fCompositor;
-
- // Find a group, starting with this particle, with more than 1 child. There
- // may be none, and the particle of interest trivially becomes an element or
- // wildcard.
- XSParticleDecl btmp = getNonUnaryGroup(bParticle);
- if (btmp != bParticle) {
- // Particle has been replaced. Retrieve new type info.
- bParticle = btmp;
- bType = bParticle.fType;
- if (bType == XSParticleDecl.PARTICLE_MODELGROUP)
- bType = ((XSModelGroupImpl)bParticle.fValue).fCompositor;
- }
-
- // Fill in a vector with the children of the particle, removing any
- // pointless model groups in the process.
- bChildren = removePointlessChildren(bParticle);
- }
-
- int bMinOccurs = bParticle.fMinOccurs;
- int bMaxOccurs = bParticle.fMaxOccurs;
-
- if (bSGHandler != null && bType == XSParticleDecl.PARTICLE_ELEMENT) {
- XSElementDecl bElement = (XSElementDecl)bParticle.fValue;
-
- if (bElement.fScope == XSConstants.SCOPE_GLOBAL) {
- // Check for subsitution groups. Treat any element that has a
- // subsitution group as a choice. Fill in the children vector with the
- // members of the substitution group
- XSElementDecl[] bsubGroup = bSGHandler.getSubstitutionGroup(bElement);
- if (bsubGroup.length >0 ) {
- // Now, set the type to be CHOICE
- bType = XSModelGroupImpl.MODELGROUP_CHOICE;
-
- bChildren = new Vector(bsubGroup.length+1);
- for (int i = 0; i < bsubGroup.length; i++) {
- addElementToParticleVector(bChildren, bsubGroup[i]);
- }
- addElementToParticleVector(bChildren, bElement);
- Collections.sort(bChildren, ELEMENT_PARTICLE_COMPARATOR);
- // Set the handler to null, to indicate that we've finished handling
- // substitution groups for this particle.
- bSGHandler = null;
-
- // if we are here expansion of bParticle happened
- bExpansionHappened = true;
- }
- }
- }
-
- //
- // O.K. - Figure out which particle derivation rule applies and call it
- //
- switch (dType) {
- case XSParticleDecl.PARTICLE_ELEMENT:
- {
- switch (bType) {
-
- // Elt:Elt NameAndTypeOK
- case XSParticleDecl.PARTICLE_ELEMENT:
- {
- checkNameAndTypeOK((XSElementDecl)dParticle.fValue,dMinOccurs,dMaxOccurs,
- (XSElementDecl)bParticle.fValue,bMinOccurs,bMaxOccurs);
- return bExpansionHappened;
- }
-
- // Elt:Any NSCompat
- case XSParticleDecl.PARTICLE_WILDCARD:
- {
- checkNSCompat((XSElementDecl)dParticle.fValue,dMinOccurs,dMaxOccurs,
- (XSWildcardDecl)bParticle.fValue,bMinOccurs,bMaxOccurs,
- checkWCOccurrence);
- return bExpansionHappened;
- }
-
- // Elt:All RecurseAsIfGroup
- case XSModelGroupImpl.MODELGROUP_CHOICE:
- {
- // Treat the element as if it were in a group of the same type
- // as the base Particle
- dChildren = new Vector();
- dChildren.addElement(dParticle);
-
- checkRecurseLax(dChildren, 1, 1, dSGHandler,
- bChildren, bMinOccurs, bMaxOccurs, bSGHandler);
- return bExpansionHappened;
- }
- case XSModelGroupImpl.MODELGROUP_SEQUENCE:
- case XSModelGroupImpl.MODELGROUP_ALL:
- {
- // Treat the element as if it were in a group of the same type
- // as the base Particle
- dChildren = new Vector();
- dChildren.addElement(dParticle);
-
- checkRecurse(dChildren, 1, 1, dSGHandler,
- bChildren, bMinOccurs, bMaxOccurs, bSGHandler);
- return bExpansionHappened;
- }
-
- default:
- {
- throw new XMLSchemaException("Internal-Error",
- new Object[]{"in particleValidRestriction"});
- }
- }
- }
-
- case XSParticleDecl.PARTICLE_WILDCARD:
- {
- switch (bType) {
-
- // Any:Any NSSubset
- case XSParticleDecl.PARTICLE_WILDCARD:
- {
- checkNSSubset((XSWildcardDecl)dParticle.fValue, dMinOccurs, dMaxOccurs,
- (XSWildcardDecl)bParticle.fValue, bMinOccurs, bMaxOccurs);
- return bExpansionHappened;
- }
-
- case XSModelGroupImpl.MODELGROUP_CHOICE:
- case XSModelGroupImpl.MODELGROUP_SEQUENCE:
- case XSModelGroupImpl.MODELGROUP_ALL:
- case XSParticleDecl.PARTICLE_ELEMENT:
- {
- throw new XMLSchemaException("cos-particle-restrict.2",
- new Object[]{"any:choice,sequence,all,elt"});
- }
-
- default:
- {
- throw new XMLSchemaException("Internal-Error",
- new Object[]{"in particleValidRestriction"});
- }
- }
- }
-
- case XSModelGroupImpl.MODELGROUP_ALL:
- {
- switch (bType) {
-
- // All:Any NSRecurseCheckCardinality
- case XSParticleDecl.PARTICLE_WILDCARD:
- {
- if (dMinEffectiveTotalRange == OCCURRENCE_UNKNOWN)
- dMinEffectiveTotalRange = dParticle.minEffectiveTotalRange();
- if (dMaxEffectiveTotalRange == OCCURRENCE_UNKNOWN)
- dMaxEffectiveTotalRange = dParticle.maxEffectiveTotalRange();
-
- checkNSRecurseCheckCardinality(dChildren, dMinEffectiveTotalRange,
- dMaxEffectiveTotalRange,
- dSGHandler,
- bParticle,bMinOccurs,bMaxOccurs,
- checkWCOccurrence);
-
- return bExpansionHappened;
- }
-
- case XSModelGroupImpl.MODELGROUP_ALL:
- {
- checkRecurse(dChildren, dMinOccurs, dMaxOccurs, dSGHandler,
- bChildren, bMinOccurs, bMaxOccurs, bSGHandler);
- return bExpansionHappened;
- }
-
- case XSModelGroupImpl.MODELGROUP_CHOICE:
- case XSModelGroupImpl.MODELGROUP_SEQUENCE:
- case XSParticleDecl.PARTICLE_ELEMENT:
- {
- throw new XMLSchemaException("cos-particle-restrict.2",
- new Object[]{"all:choice,sequence,elt"});
- }
-
- default:
- {
- throw new XMLSchemaException("Internal-Error",
- new Object[]{"in particleValidRestriction"});
- }
- }
- }
-
- case XSModelGroupImpl.MODELGROUP_CHOICE:
- {
- switch (bType) {
-
- // Choice:Any NSRecurseCheckCardinality
- case XSParticleDecl.PARTICLE_WILDCARD:
- {
- if (dMinEffectiveTotalRange == OCCURRENCE_UNKNOWN)
- dMinEffectiveTotalRange = dParticle.minEffectiveTotalRange();
- if (dMaxEffectiveTotalRange == OCCURRENCE_UNKNOWN)
- dMaxEffectiveTotalRange = dParticle.maxEffectiveTotalRange();
-
- checkNSRecurseCheckCardinality(dChildren, dMinEffectiveTotalRange,
- dMaxEffectiveTotalRange,
- dSGHandler,
- bParticle,bMinOccurs,bMaxOccurs,
- checkWCOccurrence);
- return bExpansionHappened;
- }
-
- case XSModelGroupImpl.MODELGROUP_CHOICE:
- {
- checkRecurseLax(dChildren, dMinOccurs, dMaxOccurs, dSGHandler,
- bChildren, bMinOccurs, bMaxOccurs, bSGHandler);
- return bExpansionHappened;
- }
-
- case XSModelGroupImpl.MODELGROUP_ALL:
- case XSModelGroupImpl.MODELGROUP_SEQUENCE:
- case XSParticleDecl.PARTICLE_ELEMENT:
- {
- throw new XMLSchemaException("cos-particle-restrict.2",
- new Object[]{"choice:all,sequence,elt"});
- }
-
- default:
- {
- throw new XMLSchemaException("Internal-Error",
- new Object[]{"in particleValidRestriction"});
- }
- }
- }
-
-
- case XSModelGroupImpl.MODELGROUP_SEQUENCE:
- {
- switch (bType) {
-
- // Choice:Any NSRecurseCheckCardinality
- case XSParticleDecl.PARTICLE_WILDCARD:
- {
- if (dMinEffectiveTotalRange == OCCURRENCE_UNKNOWN)
- dMinEffectiveTotalRange = dParticle.minEffectiveTotalRange();
- if (dMaxEffectiveTotalRange == OCCURRENCE_UNKNOWN)
- dMaxEffectiveTotalRange = dParticle.maxEffectiveTotalRange();
-
- checkNSRecurseCheckCardinality(dChildren, dMinEffectiveTotalRange,
- dMaxEffectiveTotalRange,
- dSGHandler,
- bParticle,bMinOccurs,bMaxOccurs,
- checkWCOccurrence);
- return bExpansionHappened;
- }
-
- case XSModelGroupImpl.MODELGROUP_ALL:
- {
- checkRecurseUnordered(dChildren, dMinOccurs, dMaxOccurs, dSGHandler,
- bChildren, bMinOccurs, bMaxOccurs, bSGHandler);
- return bExpansionHappened;
- }
-
- case XSModelGroupImpl.MODELGROUP_SEQUENCE:
- {
- checkRecurse(dChildren, dMinOccurs, dMaxOccurs, dSGHandler,
- bChildren, bMinOccurs, bMaxOccurs, bSGHandler);
- return bExpansionHappened;
- }
-
- case XSModelGroupImpl.MODELGROUP_CHOICE:
- {
- int min1 = dMinOccurs * dChildren.size();
- int max1 = (dMaxOccurs == SchemaSymbols.OCCURRENCE_UNBOUNDED)?
- dMaxOccurs : dMaxOccurs * dChildren.size();
- checkMapAndSum(dChildren, min1, max1, dSGHandler,
- bChildren, bMinOccurs, bMaxOccurs, bSGHandler);
- return bExpansionHappened;
- }
-
- case XSParticleDecl.PARTICLE_ELEMENT:
- {
- throw new XMLSchemaException("cos-particle-restrict.2",
- new Object[]{"seq:elt"});
- }
-
- default:
- {
- throw new XMLSchemaException("Internal-Error",
- new Object[]{"in particleValidRestriction"});
- }
- }
- }
-
- }
-
- return bExpansionHappened;
- }
-
- private static void addElementToParticleVector (Vector v, XSElementDecl d) {
-
- XSParticleDecl p = new XSParticleDecl();
- p.fValue = d;
- p.fType = XSParticleDecl.PARTICLE_ELEMENT;
- v.addElement(p);
-
- }
-
- private static XSParticleDecl getNonUnaryGroup(XSParticleDecl p) {
-
- if (p.fType == XSParticleDecl.PARTICLE_ELEMENT ||
- p.fType == XSParticleDecl.PARTICLE_WILDCARD)
- return p;
-
- if (p.fMinOccurs==1 && p.fMaxOccurs==1 &&
- p.fValue!=null && ((XSModelGroupImpl)p.fValue).fParticleCount == 1)
- return getNonUnaryGroup(((XSModelGroupImpl)p.fValue).fParticles[0]);
- else
- return p;
- }
-
- private static Vector removePointlessChildren(XSParticleDecl p) {
-
- if (p.fType == XSParticleDecl.PARTICLE_ELEMENT ||
- p.fType == XSParticleDecl.PARTICLE_WILDCARD)
- return null;
-
- Vector children = new Vector();
-
- XSModelGroupImpl group = (XSModelGroupImpl)p.fValue;
- for (int i = 0; i < group.fParticleCount; i++)
- gatherChildren(group.fCompositor, group.fParticles[i], children);
-
- return children;
- }
-
-
- private static void gatherChildren(int parentType, XSParticleDecl p, Vector children) {
-
- int min = p.fMinOccurs;
- int max = p.fMaxOccurs;
- int type = p.fType;
- if (type == XSParticleDecl.PARTICLE_MODELGROUP)
- type = ((XSModelGroupImpl)p.fValue).fCompositor;
-
- if (type == XSParticleDecl.PARTICLE_ELEMENT ||
- type== XSParticleDecl.PARTICLE_WILDCARD) {
- children.addElement(p);
- return;
- }
-
- if (! (min==1 && max==1)) {
- children.addElement(p);
- }
- else if (parentType == type) {
- XSModelGroupImpl group = (XSModelGroupImpl)p.fValue;
- for (int i = 0; i < group.fParticleCount; i++)
- gatherChildren(type, group.fParticles[i], children);
- }
- else if (!p.isEmpty()) {
- children.addElement(p);
- }
-
- }
-
- private static void checkNameAndTypeOK(XSElementDecl dElement, int dMin, int dMax,
- XSElementDecl bElement, int bMin, int bMax)
- throws XMLSchemaException {
-
-
- //
- // Check that the names are the same
- //
- if (dElement.fName != bElement.fName ||
- dElement.fTargetNamespace != bElement.fTargetNamespace) {
- throw new XMLSchemaException(
- "rcase-NameAndTypeOK.1",new Object[]{dElement.fName,
- dElement.fTargetNamespace, bElement.fName, bElement.fTargetNamespace});
- }
-
- //
- // Check nillable
- //
- if (!bElement.getNillable() && dElement.getNillable()) {
- throw new XMLSchemaException("rcase-NameAndTypeOK.2",
- new Object[]{dElement.fName});
- }
-
- //
- // Check occurrence range
- //
- if (!checkOccurrenceRange(dMin, dMax, bMin, bMax)) {
- throw new XMLSchemaException("rcase-NameAndTypeOK.3",
- new Object[]{
- dElement.fName,
- Integer.toString(dMin),
- dMax==SchemaSymbols.OCCURRENCE_UNBOUNDED?"unbounded":Integer.toString(dMax),
- Integer.toString(bMin),
- bMax==SchemaSymbols.OCCURRENCE_UNBOUNDED?"unbounded":Integer.toString(bMax)});
- }
-
- //
- // Check for consistent fixed values
- //
- if (bElement.getConstraintType() == XSConstants.VC_FIXED) {
- // derived one has to have a fixed value
- if (dElement.getConstraintType() != XSConstants.VC_FIXED) {
- throw new XMLSchemaException("rcase-NameAndTypeOK.4.a",
- new Object[]{dElement.fName, bElement.fDefault.stringValue()});
- }
-
- // get simple type
- boolean isSimple = false;
- if (dElement.fType.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE ||
- ((XSComplexTypeDecl)dElement.fType).fContentType == XSComplexTypeDecl.CONTENTTYPE_SIMPLE) {
- isSimple = true;
- }
-
- // if there is no simple type, then compare based on string
- if (!isSimple && !bElement.fDefault.normalizedValue.equals(dElement.fDefault.normalizedValue) ||
- isSimple && !bElement.fDefault.actualValue.equals(dElement.fDefault.actualValue)) {
- throw new XMLSchemaException("rcase-NameAndTypeOK.4.b",
- new Object[]{dElement.fName,
- dElement.fDefault.stringValue(),
- bElement.fDefault.stringValue()});
- }
- }
-
- //
- // Check identity constraints
- //
- checkIDConstraintRestriction(dElement, bElement);
-
- //
- // Check for disallowed substitutions
- //
- int blockSet1 = dElement.fBlock;
- int blockSet2 = bElement.fBlock;
- if (((blockSet1 & blockSet2)!=blockSet2) ||
- (blockSet1==XSConstants.DERIVATION_NONE && blockSet2!=XSConstants.DERIVATION_NONE))
- throw new XMLSchemaException("rcase-NameAndTypeOK.6",
- new Object[]{dElement.fName});
-
-
- //
- // Check that the derived element's type is derived from the base's.
- //
- if (!checkTypeDerivationOk(dElement.fType, bElement.fType,
- (short)(XSConstants.DERIVATION_EXTENSION|XSConstants.DERIVATION_LIST|XSConstants.DERIVATION_UNION))) {
- throw new XMLSchemaException("rcase-NameAndTypeOK.7",
- new Object[]{dElement.fName, dElement.fType.getName(), bElement.fType.getName()});
- }
-
- }
-
-
- private static void checkIDConstraintRestriction(XSElementDecl derivedElemDecl,
- XSElementDecl baseElemDecl)
- throws XMLSchemaException {
- // TODO
- } // checkIDConstraintRestriction
-
-
- private static boolean checkOccurrenceRange(int min1, int max1, int min2, int max2) {
-
- if ((min1 >= min2) &&
- ((max2==SchemaSymbols.OCCURRENCE_UNBOUNDED) ||
- (max1!=SchemaSymbols.OCCURRENCE_UNBOUNDED && max1<=max2)))
- return true;
- else
- return false;
- }
-
- private static void checkNSCompat(XSElementDecl elem, int min1, int max1,
- XSWildcardDecl wildcard, int min2, int max2,
- boolean checkWCOccurrence)
- throws XMLSchemaException {
-
- // check Occurrence ranges
- if (checkWCOccurrence && !checkOccurrenceRange(min1,max1,min2,max2)) {
- throw new XMLSchemaException("rcase-NSCompat.2",
- new Object[]{
- elem.fName,
- Integer.toString(min1),
- max1==SchemaSymbols.OCCURRENCE_UNBOUNDED?"unbounded":Integer.toString(max1),
- Integer.toString(min2),
- max2==SchemaSymbols.OCCURRENCE_UNBOUNDED?"unbounded":Integer.toString(max2)});
- }
-
- // check wildcard allows namespace of element
- if (!wildcard.allowNamespace(elem.fTargetNamespace)) {
- throw new XMLSchemaException("rcase-NSCompat.1",
- new Object[]{elem.fName,elem.fTargetNamespace});
- }
-
- }
-
- private static void checkNSSubset(XSWildcardDecl dWildcard, int min1, int max1,
- XSWildcardDecl bWildcard, int min2, int max2)
- throws XMLSchemaException {
-
- // check Occurrence ranges
- if (!checkOccurrenceRange(min1,max1,min2,max2)) {
- throw new XMLSchemaException("rcase-NSSubset.2", new Object[]{
- Integer.toString(min1),
- max1==SchemaSymbols.OCCURRENCE_UNBOUNDED?"unbounded":Integer.toString(max1),
- Integer.toString(min2),
- max2==SchemaSymbols.OCCURRENCE_UNBOUNDED?"unbounded":Integer.toString(max2)});
- }
-
- // check wildcard subset
- if (!dWildcard.isSubsetOf(bWildcard)) {
- throw new XMLSchemaException("rcase-NSSubset.1", null);
- }
-
- if (dWildcard.weakerProcessContents(bWildcard)) {
- throw new XMLSchemaException("rcase-NSSubset.3",
- new Object[]{dWildcard.getProcessContentsAsString(),
- bWildcard.getProcessContentsAsString()});
- }
-
- }
-
-
- private static void checkNSRecurseCheckCardinality(Vector children, int min1, int max1,
- SubstitutionGroupHandler dSGHandler,
- XSParticleDecl wildcard, int min2, int max2,
- boolean checkWCOccurrence)
- throws XMLSchemaException {
-
-
- // check Occurrence ranges
- if (checkWCOccurrence && !checkOccurrenceRange(min1,max1,min2,max2)) {
- throw new XMLSchemaException("rcase-NSRecurseCheckCardinality.2", new Object[]{
- Integer.toString(min1),
- max1==SchemaSymbols.OCCURRENCE_UNBOUNDED?"unbounded":Integer.toString(max1),
- Integer.toString(min2),
- max2==SchemaSymbols.OCCURRENCE_UNBOUNDED?"unbounded":Integer.toString(max2)});
- }
-
- // Check that each member of the group is a valid restriction of the wildcard
- int count = children.size();
- try {
- for (int i = 0; i < count; i++) {
- XSParticleDecl particle1 = (XSParticleDecl)children.elementAt(i);
- particleValidRestriction(particle1, dSGHandler, wildcard, null, false);
-
- }
- }
- // REVISIT: should we really just ignore original cause of this error?
- // how can we report it?
- catch (XMLSchemaException e) {
- throw new XMLSchemaException("rcase-NSRecurseCheckCardinality.1", null);
- }
-
- }
-
- private static void checkRecurse(Vector dChildren, int min1, int max1,
- SubstitutionGroupHandler dSGHandler,
- Vector bChildren, int min2, int max2,
- SubstitutionGroupHandler bSGHandler)
- throws XMLSchemaException {
-
- // check Occurrence ranges
- if (!checkOccurrenceRange(min1,max1,min2,max2)) {
- throw new XMLSchemaException("rcase-Recurse.1", new Object[]{
- Integer.toString(min1),
- max1==SchemaSymbols.OCCURRENCE_UNBOUNDED?"unbounded":Integer.toString(max1),
- Integer.toString(min2),
- max2==SchemaSymbols.OCCURRENCE_UNBOUNDED?"unbounded":Integer.toString(max2)});
- }
-
- int count1= dChildren.size();
- int count2= bChildren.size();
-
- int current = 0;
- label: for (int i = 0; i<count1; i++) {
-
- XSParticleDecl particle1 = (XSParticleDecl)dChildren.elementAt(i);
- for (int j = current; j<count2; j++) {
- XSParticleDecl particle2 = (XSParticleDecl)bChildren.elementAt(j);
- current +=1;
- try {
- particleValidRestriction(particle1, dSGHandler, particle2, bSGHandler);
- continue label;
- }
- catch (XMLSchemaException e) {
- if (!particle2.emptiable())
- throw new XMLSchemaException("rcase-Recurse.2", null);
- }
- }
- throw new XMLSchemaException("rcase-Recurse.2", null);
- }
-
- // Now, see if there are some elements in the base we didn't match up
- for (int j=current; j < count2; j++) {
- XSParticleDecl particle2 = (XSParticleDecl)bChildren.elementAt(j);
- if (!particle2.emptiable()) {
- throw new XMLSchemaException("rcase-Recurse.2", null);
- }
- }
-
- }
-
- private static void checkRecurseUnordered(Vector dChildren, int min1, int max1,
- SubstitutionGroupHandler dSGHandler,
- Vector bChildren, int min2, int max2,
- SubstitutionGroupHandler bSGHandler)
- throws XMLSchemaException {
-
-
- // check Occurrence ranges
- if (!checkOccurrenceRange(min1,max1,min2,max2)) {
- throw new XMLSchemaException("rcase-RecurseUnordered.1", new Object[]{
- Integer.toString(min1),
- max1==SchemaSymbols.OCCURRENCE_UNBOUNDED?"unbounded":Integer.toString(max1),
- Integer.toString(min2),
- max2==SchemaSymbols.OCCURRENCE_UNBOUNDED?"unbounded":Integer.toString(max2)});
- }
-
- int count1= dChildren.size();
- int count2 = bChildren.size();
-
- boolean foundIt[] = new boolean[count2];
-
- label: for (int i = 0; i<count1; i++) {
- XSParticleDecl particle1 = (XSParticleDecl)dChildren.elementAt(i);
-
- for (int j = 0; j<count2; j++) {
- XSParticleDecl particle2 = (XSParticleDecl)bChildren.elementAt(j);
- try {
- particleValidRestriction(particle1, dSGHandler, particle2, bSGHandler);
- if (foundIt[j])
- throw new XMLSchemaException("rcase-RecurseUnordered.2", null);
- else
- foundIt[j]=true;
-
- continue label;
- }
- catch (XMLSchemaException e) {
- }
- }
- // didn't find a match. Detect an error
- throw new XMLSchemaException("rcase-RecurseUnordered.2", null);
- }
-
- // Now, see if there are some elements in the base we didn't match up
- for (int j=0; j < count2; j++) {
- XSParticleDecl particle2 = (XSParticleDecl)bChildren.elementAt(j);
- if (!foundIt[j] && !particle2.emptiable()) {
- throw new XMLSchemaException("rcase-RecurseUnordered.2", null);
- }
- }
-
- }
-
- private static void checkRecurseLax(Vector dChildren, int min1, int max1,
- SubstitutionGroupHandler dSGHandler,
- Vector bChildren, int min2, int max2,
- SubstitutionGroupHandler bSGHandler)
- throws XMLSchemaException {
-
- // check Occurrence ranges
- if (!checkOccurrenceRange(min1,max1,min2,max2)) {
- throw new XMLSchemaException("rcase-RecurseLax.1", new Object[]{
- Integer.toString(min1),
- max1==SchemaSymbols.OCCURRENCE_UNBOUNDED?"unbounded":Integer.toString(max1),
- Integer.toString(min2),
- max2==SchemaSymbols.OCCURRENCE_UNBOUNDED?"unbounded":Integer.toString(max2)});
- }
-
- int count1= dChildren.size();
- int count2 = bChildren.size();
-
- int current = 0;
- label: for (int i = 0; i<count1; i++) {
-
- XSParticleDecl particle1 = (XSParticleDecl)dChildren.elementAt(i);
- for (int j = current; j<count2; j++) {
- XSParticleDecl particle2 = (XSParticleDecl)bChildren.elementAt(j);
- current +=1;
- try {
- // IHR: go back one element on b list because the next element may match
- // this as well.
- if (particleValidRestriction(particle1, dSGHandler, particle2, bSGHandler))
- current--;
- continue label;
- }
- catch (XMLSchemaException e) {
- }
- }
- // didn't find a match. Detect an error
- throw new XMLSchemaException("rcase-RecurseLax.2", null);
-
- }
-
- }
-
- private static void checkMapAndSum(Vector dChildren, int min1, int max1,
- SubstitutionGroupHandler dSGHandler,
- Vector bChildren, int min2, int max2,
- SubstitutionGroupHandler bSGHandler)
- throws XMLSchemaException {
-
- // See if the sequence group is a valid restriction of the choice
-
- // Here is an example of a valid restriction:
- // <choice minOccurs="2">
- // <a/>
- // <b/>
- // <c/>
- // </choice>
- //
- // <sequence>
- // <b/>
- // <a/>
- // </sequence>
-
- // check Occurrence ranges
- if (!checkOccurrenceRange(min1,max1,min2,max2)) {
- throw new XMLSchemaException("rcase-MapAndSum.2",
- new Object[]{Integer.toString(min1),
- max1==SchemaSymbols.OCCURRENCE_UNBOUNDED?"unbounded":Integer.toString(max1),
- Integer.toString(min2),
- max2==SchemaSymbols.OCCURRENCE_UNBOUNDED?"unbounded":Integer.toString(max2)});
- }
-
- int count1 = dChildren.size();
- int count2 = bChildren.size();
-
- label: for (int i = 0; i<count1; i++) {
-
- XSParticleDecl particle1 = (XSParticleDecl)dChildren.elementAt(i);
- for (int j = 0; j<count2; j++) {
- XSParticleDecl particle2 = (XSParticleDecl)bChildren.elementAt(j);
- try {
- particleValidRestriction(particle1, dSGHandler, particle2, bSGHandler);
- continue label;
- }
- catch (XMLSchemaException e) {
- }
- }
- // didn't find a match. Detect an error
- throw new XMLSchemaException("rcase-MapAndSum.1", null);
- }
- }
- // to check whether two element overlap, as defined in constraint UPA
- public static boolean overlapUPA(XSElementDecl element1,
- XSElementDecl element2,
- SubstitutionGroupHandler sgHandler) {
- // if the two element have the same name and namespace,
- if (element1.fName == element2.fName &&
- element1.fTargetNamespace == element2.fTargetNamespace) {
- return true;
- }
-
- // or if there is an element decl in element1's substitution group,
- // who has the same name/namespace with element2
- XSElementDecl[] subGroup = sgHandler.getSubstitutionGroup(element1);
- for (int i = subGroup.length-1; i >= 0; i--) {
- if (subGroup[i].fName == element2.fName &&
- subGroup[i].fTargetNamespace == element2.fTargetNamespace) {
- return true;
- }
- }
-
- // or if there is an element decl in element2's substitution group,
- // who has the same name/namespace with element1
- subGroup = sgHandler.getSubstitutionGroup(element2);
- for (int i = subGroup.length-1; i >= 0; i--) {
- if (subGroup[i].fName == element1.fName &&
- subGroup[i].fTargetNamespace == element1.fTargetNamespace) {
- return true;
- }
- }
-
- return false;
- }
-
- // to check whether an element overlaps with a wildcard,
- // as defined in constraint UPA
- public static boolean overlapUPA(XSElementDecl element,
- XSWildcardDecl wildcard,
- SubstitutionGroupHandler sgHandler) {
- // if the wildcard allows the element
- if (wildcard.allowNamespace(element.fTargetNamespace))
- return true;
-
- // or if the wildcard allows any element in the substitution group
- XSElementDecl[] subGroup = sgHandler.getSubstitutionGroup(element);
- for (int i = subGroup.length-1; i >= 0; i--) {
- if (wildcard.allowNamespace(subGroup[i].fTargetNamespace))
- return true;
- }
-
- return false;
- }
-
- public static boolean overlapUPA(XSWildcardDecl wildcard1,
- XSWildcardDecl wildcard2) {
- // if the intersection of the two wildcard is not empty list
- XSWildcardDecl intersect = wildcard1.performIntersectionWith(wildcard2, wildcard1.fProcessContents);
- if (intersect == null ||
- intersect.fType != XSWildcardDecl.NSCONSTRAINT_LIST ||
- intersect.fNamespaceList.length != 0) {
- return true;
- }
-
- return false;
- }
-
- // call one of the above methods according to the type of decls
- public static boolean overlapUPA(Object decl1, Object decl2,
- SubstitutionGroupHandler sgHandler) {
- if (decl1 instanceof XSElementDecl) {
- if (decl2 instanceof XSElementDecl) {
- return overlapUPA((XSElementDecl)decl1,
- (XSElementDecl)decl2,
- sgHandler);
- }
- else {
- return overlapUPA((XSElementDecl)decl1,
- (XSWildcardDecl)decl2,
- sgHandler);
- }
- }
- else {
- if (decl2 instanceof XSElementDecl) {
- return overlapUPA((XSElementDecl)decl2,
- (XSWildcardDecl)decl1,
- sgHandler);
- }
- else {
- return overlapUPA((XSWildcardDecl)decl1,
- (XSWildcardDecl)decl2);
- }
- }
- }
-
-} // class XSContraints
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/XSDDescription.java b/src/com/sun/org/apache/xerces/internal/impl/xs/XSDDescription.java
deleted file mode 100644
index c35baa8..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/XSDDescription.java
+++ /dev/null
@@ -1,274 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2002, 2003,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs;
-
-import com.sun.org.apache.xerces.internal.util.XMLResourceIdentifierImpl;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLSchemaDescription;
-
-/**
- * All information specific to XML Schema grammars.
- *
- * @xerces.internal
- *
- * @author Neil Graham, IBM
- * @author Neeraj Bajaj, SUN Microsystems.
- *
- * @version $Id: XSDDescription.java,v 1.6 2010-11-01 04:39:55 joehw Exp $
- */
-public class XSDDescription extends XMLResourceIdentifierImpl
- implements XMLSchemaDescription {
- // used to indicate what triggered the call
- /**
- * Indicate that this description was just initialized.
- */
- public final static short CONTEXT_INITIALIZE = -1;
- /**
- * Indicate that the current schema document is <include>d by another
- * schema document.
- */
- public final static short CONTEXT_INCLUDE = 0;
- /**
- * Indicate that the current schema document is <redefine>d by another
- * schema document.
- */
- public final static short CONTEXT_REDEFINE = 1;
- /**
- * Indicate that the current schema document is <import>ed by another
- * schema document.
- */
- public final static short CONTEXT_IMPORT = 2;
- /**
- * Indicate that the current schema document is being preparsed.
- */
- public final static short CONTEXT_PREPARSE = 3;
- /**
- * Indicate that the parse of the current schema document is triggered
- * by xsi:schemaLocation/noNamespaceSchemaLocation attribute(s) in the
- * instance document. This value is only used if we don't defer the loading
- * of schema documents.
- */
- public final static short CONTEXT_INSTANCE = 4;
- /**
- * Indicate that the parse of the current schema document is triggered by
- * the occurrence of an element whose namespace is the target namespace
- * of this schema document. This value is only used if we do defer the
- * loading of schema documents until a component from that namespace is
- * referenced from the instance.
- */
- public final static short CONTEXT_ELEMENT = 5;
- /**
- * Indicate that the parse of the current schema document is triggered by
- * the occurrence of an attribute whose namespace is the target namespace
- * of this schema document. This value is only used if we do defer the
- * loading of schema documents until a component from that namespace is
- * referenced from the instance.
- */
- public final static short CONTEXT_ATTRIBUTE = 6;
- /**
- * Indicate that the parse of the current schema document is triggered by
- * the occurrence of an "xsi:type" attribute, whose value (a QName) has
- * the target namespace of this schema document as its namespace.
- * This value is only used if we do defer the loading of schema documents
- * until a component from that namespace is referenced from the instance.
- */
- public final static short CONTEXT_XSITYPE = 7;
-
- // REVISIT: write description of these fields
- protected short fContextType;
- protected String [] fLocationHints ;
- protected QName fTriggeringComponent;
- protected QName fEnclosedElementName;
- protected XMLAttributes fAttributes;
-
- /**
- * the type of the grammar (e.g., DTD or XSD);
- *
- * @see com.sun.org.apache.xerces.internal.xni.grammars.Grammar
- */
- public String getGrammarType() {
- return XMLGrammarDescription.XML_SCHEMA;
- }
-
- /**
- * Get the context. The returned value is one of the pre-defined
- * CONTEXT_xxx constants.
- *
- * @return the value indicating the context
- */
- public short getContextType() {
- return fContextType ;
- }
-
- /**
- * If the context is "include" or "redefine", then return the target
- * namespace of the enclosing schema document; otherwise, the expected
- * target namespace of this document.
- *
- * @return the expected/enclosing target namespace
- */
- public String getTargetNamespace() {
- return fNamespace;
- }
-
- /**
- * For import and references from the instance document, it's possible to
- * have multiple hints for one namespace. So this method returns an array,
- * which contains all location hints.
- *
- * @return an array of all location hints associated to the expected
- * target namespace
- */
- public String[] getLocationHints() {
- return fLocationHints ;
- }
-
- /**
- * If a call is triggered by an element/attribute/xsi:type in the instance,
- * this call returns the name of such triggering component: the name of
- * the element/attribute, or the value of the xsi:type.
- *
- * @return the name of the triggering component
- */
- public QName getTriggeringComponent() {
- return fTriggeringComponent ;
- }
-
- /**
- * If a call is triggered by an attribute or xsi:type, then this mehtod
- * returns the enclosing element of such element.
- *
- * @return the name of the enclosing element
- */
- public QName getEnclosingElementName() {
- return fEnclosedElementName ;
- }
-
- /**
- * If a call is triggered by an element/attribute/xsi:type in the instance,
- * this call returns all attribute of such element (or enclosing element).
- *
- * @return all attributes of the tiggering/enclosing element
- */
- public XMLAttributes getAttributes() {
- return fAttributes;
- }
-
- public boolean fromInstance() {
- return fContextType == CONTEXT_ATTRIBUTE ||
- fContextType == CONTEXT_ELEMENT ||
- fContextType == CONTEXT_INSTANCE ||
- fContextType == CONTEXT_XSITYPE;
- }
-
- /**
- * @return true is the schema is external
- */
- public boolean isExternal() {
- return fContextType == CONTEXT_INCLUDE ||
- fContextType == CONTEXT_REDEFINE ||
- fContextType == CONTEXT_IMPORT ||
- fContextType == CONTEXT_ELEMENT ||
- fContextType == CONTEXT_ATTRIBUTE ||
- fContextType == CONTEXT_XSITYPE;
- }
- /**
- * Compares this grammar with the given grammar. Currently, we compare
- * the target namespaces.
- *
- * @param descObj The description of the grammar to be compared with
- * @return True if they are equal, else false
- */
- public boolean equals(Object descObj) {
- if(!(descObj instanceof XMLSchemaDescription)) return false;
- XMLSchemaDescription desc = (XMLSchemaDescription)descObj;
- if (fNamespace != null)
- return fNamespace.equals(desc.getTargetNamespace());
- else // fNamespace == null
- return desc.getTargetNamespace() == null;
- }
-
- /**
- * Returns the hash code of this grammar
- *
- * @return The hash code
- */
- public int hashCode() {
- return (fNamespace == null) ? 0 : fNamespace.hashCode();
- }
-
- public void setContextType(short contextType){
- fContextType = contextType ;
- }
-
- public void setTargetNamespace(String targetNamespace){
- fNamespace = targetNamespace ;
- }
-
- public void setLocationHints(String [] locationHints){
- int length = locationHints.length ;
- fLocationHints = new String[length];
- System.arraycopy(locationHints, 0, fLocationHints, 0, length);
- //fLocationHints = locationHints ;
- }
-
- public void setTriggeringComponent(QName triggeringComponent){
- fTriggeringComponent = triggeringComponent ;
- }
-
- public void setEnclosingElementName(QName enclosedElementName){
- fEnclosedElementName = enclosedElementName ;
- }
-
- public void setAttributes(XMLAttributes attributes){
- fAttributes = attributes ;
- }
-
- /**
- * resets all the fields
- */
- public void reset(){
- super.clear();
- fContextType = CONTEXT_INITIALIZE;
- fLocationHints = null ;
- fTriggeringComponent = null ;
- fEnclosedElementName = null ;
- fAttributes = null ;
- }
-
- public XSDDescription makeClone() {
- XSDDescription desc = new XSDDescription();
- desc.fAttributes = this.fAttributes;
- desc.fBaseSystemId = this.fBaseSystemId;
- desc.fContextType = this.fContextType;
- desc.fEnclosedElementName = this.fEnclosedElementName;
- desc.fExpandedSystemId = this.fExpandedSystemId;
- desc.fLiteralSystemId = this.fLiteralSystemId;
- desc.fLocationHints = this.fLocationHints;
- desc.fPublicId = this.fPublicId;
- desc.fNamespace = this.fNamespace;
- desc.fTriggeringComponent = this.fTriggeringComponent;
- return desc;
- }
-
-} // XSDDescription
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/XSDeclarationPool.java b/src/com/sun/org/apache/xerces/internal/impl/xs/XSDeclarationPool.java
deleted file mode 100644
index 5578da2..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/XSDeclarationPool.java
+++ /dev/null
@@ -1,318 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs;
-
-import com.sun.org.apache.xerces.internal.impl.dv.xs.SchemaDVFactoryImpl;
-import com.sun.org.apache.xerces.internal.impl.dv.xs.XSSimpleTypeDecl;
-
-/**
- * This class is pool that enables caching of XML Schema declaration objects.
- * Before a compiled grammar object is garbage collected,
- * the implementation will add all XML Schema component
- * declarations to the pool.
- * Note: The cashing mechanism is not implemented yet.
- *
- * @xerces.internal
- *
- * @author Elena Litani, IBM
- * @version $Id: XSDeclarationPool.java,v 1.7 2010-11-01 04:39:55 joehw Exp $
- */
-public final class XSDeclarationPool {
- /** Chunk shift (8). */
- private static final int CHUNK_SHIFT = 8; // 2^8 = 256
-
- /** Chunk size (1 << CHUNK_SHIFT). */
- private static final int CHUNK_SIZE = 1 << CHUNK_SHIFT;
-
- /** Chunk mask (CHUNK_SIZE - 1). */
- private static final int CHUNK_MASK = CHUNK_SIZE - 1;
-
- /** Initial chunk count (). */
- private static final int INITIAL_CHUNK_COUNT = (1 << (10 - CHUNK_SHIFT)); // 2^10 = 1k
-
- /** Element declaration pool*/
- private XSElementDecl fElementDecl[][] = new XSElementDecl[INITIAL_CHUNK_COUNT][];
- private int fElementDeclIndex = 0;
-
- /** Particle declaration pool */
- private XSParticleDecl fParticleDecl[][] = new XSParticleDecl[INITIAL_CHUNK_COUNT][];
- private int fParticleDeclIndex = 0;
-
- /** Particle declaration pool */
- private XSModelGroupImpl fModelGroup[][] = new XSModelGroupImpl[INITIAL_CHUNK_COUNT][];
- private int fModelGroupIndex = 0;
-
- /** Attribute declaration pool */
- private XSAttributeDecl fAttrDecl[][] = new XSAttributeDecl[INITIAL_CHUNK_COUNT][];
- private int fAttrDeclIndex = 0;
-
- /** ComplexType declaration pool */
- private XSComplexTypeDecl fCTDecl[][] = new XSComplexTypeDecl[INITIAL_CHUNK_COUNT][];
- private int fCTDeclIndex = 0;
-
- /** SimpleType declaration pool */
- private XSSimpleTypeDecl fSTDecl[][] = new XSSimpleTypeDecl[INITIAL_CHUNK_COUNT][];
- private int fSTDeclIndex = 0;
-
- /** AttributeUse declaration pool */
- private XSAttributeUseImpl fAttributeUse[][] = new XSAttributeUseImpl[INITIAL_CHUNK_COUNT][];
- private int fAttributeUseIndex = 0;
-
- private SchemaDVFactoryImpl dvFactory;
- public void setDVFactory(SchemaDVFactoryImpl dvFactory) {
- this.dvFactory = dvFactory;
- }
-
- public final XSElementDecl getElementDecl(){
- int chunk = fElementDeclIndex >> CHUNK_SHIFT;
- int index = fElementDeclIndex & CHUNK_MASK;
- ensureElementDeclCapacity(chunk);
- if (fElementDecl[chunk][index] == null) {
- fElementDecl[chunk][index] = new XSElementDecl();
- } else {
- fElementDecl[chunk][index].reset();
- }
- fElementDeclIndex++;
- return fElementDecl[chunk][index];
- }
-
- public final XSAttributeDecl getAttributeDecl(){
- int chunk = fAttrDeclIndex >> CHUNK_SHIFT;
- int index = fAttrDeclIndex & CHUNK_MASK;
- ensureAttrDeclCapacity(chunk);
- if (fAttrDecl[chunk][index] == null) {
- fAttrDecl[chunk][index] = new XSAttributeDecl();
- } else {
- fAttrDecl[chunk][index].reset();
- }
- fAttrDeclIndex++;
- return fAttrDecl[chunk][index];
-
- }
-
- public final XSAttributeUseImpl getAttributeUse(){
- int chunk = fAttributeUseIndex >> CHUNK_SHIFT;
- int index = fAttributeUseIndex & CHUNK_MASK;
- ensureAttributeUseCapacity(chunk);
- if (fAttributeUse[chunk][index] == null) {
- fAttributeUse[chunk][index] = new XSAttributeUseImpl();
- } else {
- fAttributeUse[chunk][index].reset();
- }
- fAttributeUseIndex++;
- return fAttributeUse[chunk][index];
-
- }
-
- public final XSComplexTypeDecl getComplexTypeDecl(){
- int chunk = fCTDeclIndex >> CHUNK_SHIFT;
- int index = fCTDeclIndex & CHUNK_MASK;
- ensureCTDeclCapacity(chunk);
- if (fCTDecl[chunk][index] == null) {
-
- fCTDecl[chunk][index] = new XSComplexTypeDecl();
- } else {
- fCTDecl[chunk][index].reset();
- }
- fCTDeclIndex++;
- return fCTDecl[chunk][index];
- }
-
- public final XSSimpleTypeDecl getSimpleTypeDecl(){
- int chunk = fSTDeclIndex >> CHUNK_SHIFT;
- int index = fSTDeclIndex & CHUNK_MASK;
- ensureSTDeclCapacity(chunk);
- if (fSTDecl[chunk][index] == null) {
- fSTDecl[chunk][index] = dvFactory.newXSSimpleTypeDecl();
- } else {
- fSTDecl[chunk][index].reset();
- }
- fSTDeclIndex++;
- return fSTDecl[chunk][index];
-
- }
-
- public final XSParticleDecl getParticleDecl(){
- int chunk = fParticleDeclIndex >> CHUNK_SHIFT;
- int index = fParticleDeclIndex & CHUNK_MASK;
- ensureParticleDeclCapacity(chunk);
- if (fParticleDecl[chunk][index] == null) {
- fParticleDecl[chunk][index] = new XSParticleDecl();
- } else {
- fParticleDecl[chunk][index].reset();
- }
- fParticleDeclIndex++;
- return fParticleDecl[chunk][index];
- }
-
- public final XSModelGroupImpl getModelGroup(){
- int chunk = fModelGroupIndex >> CHUNK_SHIFT;
- int index = fModelGroupIndex & CHUNK_MASK;
- ensureModelGroupCapacity(chunk);
- if (fModelGroup[chunk][index] == null) {
- fModelGroup[chunk][index] = new XSModelGroupImpl();
- } else {
- fModelGroup[chunk][index].reset();
- }
- fModelGroupIndex++;
- return fModelGroup[chunk][index];
- }
-
- // REVISIT: do we need decl pool for group declarations, attribute group,
- // notations?
- // it seems like each schema would use a small number of those
- // components, so it probably is not worth keeping those components
- // in the pool.
-
- private boolean ensureElementDeclCapacity(int chunk) {
- if (chunk >= fElementDecl.length) {
- fElementDecl = resize(fElementDecl, fElementDecl.length * 2);
- } else if (fElementDecl[chunk] != null) {
- return false;
- }
-
- fElementDecl[chunk] = new XSElementDecl[CHUNK_SIZE];
- return true;
- }
-
- private static XSElementDecl[][] resize(XSElementDecl array[][], int newsize) {
- XSElementDecl newarray[][] = new XSElementDecl[newsize][];
- System.arraycopy(array, 0, newarray, 0, array.length);
- return newarray;
- }
-
- private boolean ensureParticleDeclCapacity(int chunk) {
- if (chunk >= fParticleDecl.length) {
- fParticleDecl = resize(fParticleDecl, fParticleDecl.length * 2);
- } else if (fParticleDecl[chunk] != null) {
- return false;
- }
-
- fParticleDecl[chunk] = new XSParticleDecl[CHUNK_SIZE];
- return true;
- }
-
- private boolean ensureModelGroupCapacity(int chunk) {
- if (chunk >= fModelGroup.length) {
- fModelGroup = resize(fModelGroup, fModelGroup.length * 2);
- } else if (fModelGroup[chunk] != null) {
- return false;
- }
-
- fModelGroup[chunk] = new XSModelGroupImpl[CHUNK_SIZE];
- return true;
- }
-
- private static XSParticleDecl[][] resize(XSParticleDecl array[][], int newsize) {
- XSParticleDecl newarray[][] = new XSParticleDecl[newsize][];
- System.arraycopy(array, 0, newarray, 0, array.length);
- return newarray;
- }
-
- private static XSModelGroupImpl[][] resize(XSModelGroupImpl array[][], int newsize) {
- XSModelGroupImpl newarray[][] = new XSModelGroupImpl[newsize][];
- System.arraycopy(array, 0, newarray, 0, array.length);
- return newarray;
- }
-
- private boolean ensureAttrDeclCapacity(int chunk) {
- if (chunk >= fAttrDecl.length) {
- fAttrDecl = resize(fAttrDecl, fAttrDecl.length * 2);
- } else if (fAttrDecl[chunk] != null) {
- return false;
- }
-
- fAttrDecl[chunk] = new XSAttributeDecl[CHUNK_SIZE];
- return true;
- }
-
- private static XSAttributeDecl[][] resize(XSAttributeDecl array[][], int newsize) {
- XSAttributeDecl newarray[][] = new XSAttributeDecl[newsize][];
- System.arraycopy(array, 0, newarray, 0, array.length);
- return newarray;
- }
-
- private boolean ensureAttributeUseCapacity(int chunk) {
- if (chunk >= fAttributeUse.length) {
- fAttributeUse = resize(fAttributeUse, fAttributeUse.length * 2);
- } else if (fAttributeUse[chunk] != null) {
- return false;
- }
-
- fAttributeUse[chunk] = new XSAttributeUseImpl[CHUNK_SIZE];
- return true;
- }
-
- private static XSAttributeUseImpl[][] resize(XSAttributeUseImpl array[][], int newsize) {
- XSAttributeUseImpl newarray[][] = new XSAttributeUseImpl[newsize][];
- System.arraycopy(array, 0, newarray, 0, array.length);
- return newarray;
- }
-
- private boolean ensureSTDeclCapacity(int chunk) {
- if (chunk >= fSTDecl.length) {
- fSTDecl = resize(fSTDecl, fSTDecl.length * 2);
- } else if (fSTDecl[chunk] != null) {
- return false;
- }
-
- fSTDecl[chunk] = new XSSimpleTypeDecl[CHUNK_SIZE];
- return true;
- }
-
- private static XSSimpleTypeDecl[][] resize(XSSimpleTypeDecl array[][], int newsize) {
- XSSimpleTypeDecl newarray[][] = new XSSimpleTypeDecl[newsize][];
- System.arraycopy(array, 0, newarray, 0, array.length);
- return newarray;
- }
-
- private boolean ensureCTDeclCapacity(int chunk) {
-
- if (chunk >= fCTDecl.length) {
- fCTDecl = resize(fCTDecl, fCTDecl.length * 2);
- } else if (fCTDecl[chunk] != null){
- return false;
- }
-
- fCTDecl[chunk] = new XSComplexTypeDecl[CHUNK_SIZE];
- return true;
- }
-
- private static XSComplexTypeDecl[][] resize(XSComplexTypeDecl array[][], int newsize) {
- XSComplexTypeDecl newarray[][] = new XSComplexTypeDecl[newsize][];
- System.arraycopy(array, 0, newarray, 0, array.length);
- return newarray;
- }
-
-
-
- public void reset(){
- fElementDeclIndex = 0;
- fParticleDeclIndex = 0;
- fModelGroupIndex = 0;
- fSTDeclIndex = 0;
- fCTDeclIndex = 0;
- fAttrDeclIndex = 0;
- fAttributeUseIndex = 0;
- }
-
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/XSElementDecl.java b/src/com/sun/org/apache/xerces/internal/impl/xs/XSElementDecl.java
deleted file mode 100644
index 190daa7..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/XSElementDecl.java
+++ /dev/null
@@ -1,388 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs;
-
-import com.sun.org.apache.xerces.internal.impl.dv.ValidatedInfo;
-import com.sun.org.apache.xerces.internal.impl.xs.identity.IdentityConstraint;
-import com.sun.org.apache.xerces.internal.impl.xs.util.XSNamedMapImpl;
-import com.sun.org.apache.xerces.internal.impl.xs.util.XSObjectListImpl;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xs.ShortList;
-import com.sun.org.apache.xerces.internal.xs.XSAnnotation;
-import com.sun.org.apache.xerces.internal.xs.XSComplexTypeDefinition;
-import com.sun.org.apache.xerces.internal.xs.XSConstants;
-import com.sun.org.apache.xerces.internal.xs.XSElementDeclaration;
-import com.sun.org.apache.xerces.internal.xs.XSNamedMap;
-import com.sun.org.apache.xerces.internal.xs.XSNamespaceItem;
-import com.sun.org.apache.xerces.internal.xs.XSObjectList;
-import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
-
-/**
- * The XML representation for an element declaration
- * schema component is an <element> element information item
- *
- * @xerces.internal
- *
- * @author Elena Litani, IBM
- * @author Sandy Gao, IBM
- * @version $Id: XSElementDecl.java,v 1.7 2010-11-01 04:39:55 joehw Exp $
- */
-public class XSElementDecl implements XSElementDeclaration {
-
- // scopes
- public final static short SCOPE_ABSENT = 0;
- public final static short SCOPE_GLOBAL = 1;
- public final static short SCOPE_LOCAL = 2;
-
- // name of the element
- public String fName = null;
- // target namespace of the element
- public String fTargetNamespace = null;
- // type of the element
- public XSTypeDefinition fType = null;
- public QName fUnresolvedTypeName = null;
- // misc flag of the element: nillable/abstract/fixed
- short fMiscFlags = 0;
- public short fScope = XSConstants.SCOPE_ABSENT;
- // enclosing complex type, when the scope is local
- XSComplexTypeDecl fEnclosingCT = null;
- // block set (disallowed substitutions) of the element
- public short fBlock = XSConstants.DERIVATION_NONE;
- // final set (substitution group exclusions) of the element
- public short fFinal = XSConstants.DERIVATION_NONE;
- // optional annotation
- public XSObjectList fAnnotations = null;
- // value constraint value
- public ValidatedInfo fDefault = null;
- // the substitution group affiliation of the element
- public XSElementDecl fSubGroup = null;
- // identity constraints
- static final int INITIAL_SIZE = 2;
- int fIDCPos = 0;
- IdentityConstraint[] fIDConstraints = new IdentityConstraint[INITIAL_SIZE];
- // The namespace schema information item corresponding to the target namespace
- // of the element declaration, if it is globally declared; or null otherwise.
- private XSNamespaceItem fNamespaceItem = null;
-
- private static final short CONSTRAINT_MASK = 3;
- private static final short NILLABLE = 4;
- private static final short ABSTRACT = 8;
-
- // methods to get/set misc flag
- public void setConstraintType(short constraintType) {
- // first clear the bits
- fMiscFlags ^= (fMiscFlags & CONSTRAINT_MASK);
- // then set the proper one
- fMiscFlags |= (constraintType & CONSTRAINT_MASK);
- }
- public void setIsNillable() {
- fMiscFlags |= NILLABLE;
- }
- public void setIsAbstract() {
- fMiscFlags |= ABSTRACT;
- }
- public void setIsGlobal() {
- fScope = SCOPE_GLOBAL;
- }
- public void setIsLocal(XSComplexTypeDecl enclosingCT) {
- fScope = SCOPE_LOCAL;
- fEnclosingCT = enclosingCT;
- }
-
- public void addIDConstraint(IdentityConstraint idc) {
- if (fIDCPos == fIDConstraints.length) {
- fIDConstraints = resize(fIDConstraints, fIDCPos*2);
- }
- fIDConstraints[fIDCPos++] = idc;
- }
-
- public IdentityConstraint[] getIDConstraints() {
- if (fIDCPos == 0) {
- return null;
- }
- if (fIDCPos < fIDConstraints.length) {
- fIDConstraints = resize(fIDConstraints, fIDCPos);
- }
- return fIDConstraints;
- }
-
- static final IdentityConstraint[] resize(IdentityConstraint[] oldArray, int newSize) {
- IdentityConstraint[] newArray = new IdentityConstraint[newSize];
- System.arraycopy(oldArray, 0, newArray, 0, Math.min(oldArray.length, newSize));
- return newArray;
- }
-
- /**
- * get the string description of this element
- */
- private String fDescription = null;
- public String toString() {
- if (fDescription == null) {
- if (fTargetNamespace != null) {
- StringBuffer buffer = new StringBuffer(
- fTargetNamespace.length() +
- ((fName != null) ? fName.length() : 4) + 3);
- buffer.append('"');
- buffer.append(fTargetNamespace);
- buffer.append('"');
- buffer.append(':');
- buffer.append(fName);
- fDescription = buffer.toString();
- }
- else {
- fDescription = fName;
- }
- }
- return fDescription;
- }
-
- /**
- * get the hash code
- */
- public int hashCode() {
- int code = fName.hashCode();
- if (fTargetNamespace != null)
- code = (code<<16)+fTargetNamespace.hashCode();
- return code;
- }
-
- /**
- * whether two decls are the same
- */
- public boolean equals(Object o) {
- return o == this;
- }
-
- /**
- * Reset current element declaration
- */
- public void reset(){
- fScope = XSConstants.SCOPE_ABSENT;
- fName = null;
- fTargetNamespace = null;
- fType = null;
- fUnresolvedTypeName = null;
- fMiscFlags = 0;
- fBlock = XSConstants.DERIVATION_NONE;
- fFinal = XSConstants.DERIVATION_NONE;
- fDefault = null;
- fAnnotations = null;
- fSubGroup = null;
- // reset identity constraints
- for (int i=0;i<fIDCPos;i++) {
- fIDConstraints[i] = null;
- }
-
- fIDCPos = 0;
- }
-
- /**
- * Get the type of the object, i.e ELEMENT_DECLARATION.
- */
- public short getType() {
- return XSConstants.ELEMENT_DECLARATION;
- }
-
- /**
- * The <code>name</code> of this <code>XSObject</code> depending on the
- * <code>XSObject</code> type.
- */
- public String getName() {
- return fName;
- }
-
- /**
- * The namespace URI of this node, or <code>null</code> if it is
- * unspecified. defines how a namespace URI is attached to schema
- * components.
- */
- public String getNamespace() {
- return fTargetNamespace;
- }
-
- /**
- * Either a simple type definition or a complex type definition.
- */
- public XSTypeDefinition getTypeDefinition() {
- return fType;
- }
-
- /**
- * Optional. Either global or a complex type definition (
- * <code>ctDefinition</code>). This property is absent in the case of
- * declarations within named model groups: their scope will be
- * determined when they are used in the construction of complex type
- * definitions.
- */
- public short getScope() {
- return fScope;
- }
-
- /**
- * Locally scoped declarations are available for use only within the
- * complex type definition identified by the <code>scope</code>
- * property.
- */
- public XSComplexTypeDefinition getEnclosingCTDefinition() {
- return fEnclosingCT;
- }
-
- /**
- * A value constraint: one of default, fixed.
- */
- public short getConstraintType() {
- return (short)(fMiscFlags & CONSTRAINT_MASK);
- }
-
- /**
- * A value constraint: The actual value (with respect to the {type
- * definition})
- */
- public String getConstraintValue() {
- // REVISIT: SCAPI: what's the proper representation
- return getConstraintType() == XSConstants.VC_NONE ?
- null :
- fDefault.stringValue();
- }
-
- /**
- * If {nillable} is true, then an element may also be valid if it carries
- * the namespace qualified attribute with [local name] nil from
- * namespace http://www.w3.org/2001/XMLSchema-instance and value true
- * (see xsi:nil (2.6.2)) even if it has no text or element content
- * despite a {content type} which would otherwise require content.
- */
- public boolean getNillable() {
- return ((fMiscFlags & NILLABLE) != 0);
- }
-
- /**
- * {identity-constraint definitions} A set of constraint definitions.
- */
- public XSNamedMap getIdentityConstraints() {
- return new XSNamedMapImpl(fIDConstraints, fIDCPos);
- }
-
- /**
- * {substitution group affiliation} Optional. A top-level element
- * definition.
- */
- public XSElementDeclaration getSubstitutionGroupAffiliation() {
- return fSubGroup;
- }
-
- /**
- * Convenience method. Check if <code>exclusion</code> is a substitution
- * group exclusion for this element declaration.
- * @param exclusion Extension, restriction or none. Represents final
- * set for the element.
- * @return True if <code>exclusion</code> is a part of the substitution
- * group exclusion subset.
- */
- public boolean isSubstitutionGroupExclusion(short exclusion) {
- return (fFinal & exclusion) != 0;
- }
-
- /**
- * Specifies if this declaration can be nominated as
- * the {substitution group affiliation} of other
- * element declarations having the same {type definition}
- * or types derived therefrom.
- *
- * @return A bit flag representing {extension, restriction} or NONE.
- */
- public short getSubstitutionGroupExclusions() {
- return fFinal;
- }
-
- /**
- * Convenience method. Check if <code>disallowed</code> is a disallowed
- * substitution for this element declaration.
- * @param disallowed Substitution, extension, restriction or none.
- * Represents a block set for the element.
- * @return True if <code>disallowed</code> is a part of the substitution
- * group exclusion subset.
- */
- public boolean isDisallowedSubstitution(short disallowed) {
- return (fBlock & disallowed) != 0;
- }
-
- /**
- * The supplied values for {disallowed substitutions}
- *
- * @return A bit flag representing {substitution, extension, restriction} or NONE.
- */
- public short getDisallowedSubstitutions() {
- return fBlock;
- }
-
- /**
- * {abstract} A boolean.
- */
- public boolean getAbstract() {
- return ((fMiscFlags & ABSTRACT) != 0);
- }
-
- /**
- * Optional. Annotation.
- */
- public XSAnnotation getAnnotation() {
- return (fAnnotations != null) ? (XSAnnotation) fAnnotations.item(0) : null;
- }
-
- /**
- * Optional. Annotations.
- */
- public XSObjectList getAnnotations() {
- return (fAnnotations != null) ? fAnnotations : XSObjectListImpl.EMPTY_LIST;
- }
-
-
- /**
- * @see org.apache.xerces.xs.XSObject#getNamespaceItem()
- */
- public XSNamespaceItem getNamespaceItem() {
- return fNamespaceItem;
- }
-
- void setNamespaceItem(XSNamespaceItem namespaceItem) {
- fNamespaceItem = namespaceItem;
- }
-
- public Object getActualVC() {
- return getConstraintType() == XSConstants.VC_NONE ?
- null :
- fDefault.actualValue;
- }
-
- public short getActualVCType() {
- return getConstraintType() == XSConstants.VC_NONE ?
- XSConstants.UNAVAILABLE_DT :
- fDefault.actualValueType;
- }
-
- public ShortList getItemValueTypes() {
- return getConstraintType() == XSConstants.VC_NONE ?
- null :
- fDefault.itemValueTypes;
- }
-
-} // class XSElementDecl
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/XSGrammarBucket.java b/src/com/sun/org/apache/xerces/internal/impl/xs/XSGrammarBucket.java
deleted file mode 100644
index 525afee..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/XSGrammarBucket.java
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Vector;
-
-/**
- * A class used to hold the internal schema grammar set for the current instance
- *
- * @xerces.internal
- *
- * @author Sandy Gao, IBM
- * @version $Id: XSGrammarBucket.java,v 1.7 2010-11-01 04:39:55 joehw Exp $
- */
-public class XSGrammarBucket {
-
- // Data
-
- /**
- * Map that maps between Namespace and a Grammar
- */
- Map<String, SchemaGrammar> fGrammarRegistry = new HashMap();
- SchemaGrammar fNoNSGrammar = null;
-
- /**
- * Get the schema grammar for the specified namespace
- *
- * @param namespace
- * @return SchemaGrammar associated with the namespace
- */
- public SchemaGrammar getGrammar(String namespace) {
- if (namespace == null)
- return fNoNSGrammar;
- return (SchemaGrammar)fGrammarRegistry.get(namespace);
- }
-
- /**
- * Put a schema grammar into the registry
- * This method is for internal use only: it assumes that a grammar with
- * the same target namespace is not already in the bucket.
- *
- * @param grammar the grammar to put in the registry
- */
- public void putGrammar(SchemaGrammar grammar) {
- if (grammar.getTargetNamespace() == null)
- fNoNSGrammar = grammar;
- else
- fGrammarRegistry.put(grammar.getTargetNamespace(), grammar);
- }
-
- /**
- * put a schema grammar and any grammars imported by it (directly or
- * inderectly) into the registry. when a grammar with the same target
- * namespace is already in the bucket, and different from the one being
- * added, it's an error, and no grammar will be added into the bucket.
- *
- * @param grammar the grammar to put in the registry
- * @param deep whether to add imported grammars
- * @return whether the process succeeded
- */
- public boolean putGrammar(SchemaGrammar grammar, boolean deep) {
- // whether there is one with the same tns
- SchemaGrammar sg = getGrammar(grammar.fTargetNamespace);
- if (sg != null) {
- // if the one we have is different from the one passed, it's an error
- return sg == grammar;
- }
- // not deep import, then just add this one grammar
- if (!deep) {
- putGrammar(grammar);
- return true;
- }
-
- // get all imported grammars, and make a copy of the Vector, so that
- // we can recursively process the grammars, and add distinct ones
- // to the same vector
- Vector currGrammars = (Vector)grammar.getImportedGrammars();
- if (currGrammars == null) {
- putGrammar(grammar);
- return true;
- }
-
- Vector grammars = ((Vector)currGrammars.clone());
- SchemaGrammar sg1, sg2;
- Vector gs;
- // for all (recursively) imported grammars
- for (int i = 0; i < grammars.size(); i++) {
- // get the grammar
- sg1 = (SchemaGrammar)grammars.elementAt(i);
- // check whether the bucket has one with the same tns
- sg2 = getGrammar(sg1.fTargetNamespace);
- if (sg2 == null) {
- // we need to add grammars imported by sg1 too
- gs = sg1.getImportedGrammars();
- // for all grammars imported by sg2, but not in the vector
- // we add them to the vector
- if(gs == null) continue;
- for (int j = gs.size() - 1; j >= 0; j--) {
- sg2 = (SchemaGrammar)gs.elementAt(j);
- if (!grammars.contains(sg2))
- grammars.addElement(sg2);
- }
- }
- // we found one with the same target namespace
- // if the two grammars are not the same object, then it's an error
- else if (sg2 != sg1) {
- return false;
- }
- }
-
- // now we have all imported grammars stored in the vector. add them
- putGrammar(grammar);
- for (int i = grammars.size() - 1; i >= 0; i--)
- putGrammar((SchemaGrammar)grammars.elementAt(i));
-
- return true;
- }
-
- /**
- * put a schema grammar and any grammars imported by it (directly or
- * inderectly) into the registry. when a grammar with the same target
- * namespace is already in the bucket, and different from the one being
- * added, no grammar will be added into the bucket.
- *
- * @param grammar the grammar to put in the registry
- * @param deep whether to add imported grammars
- * @param ignoreConflict whether to ignore grammars that already exist in the grammar
- * bucket or not - including 'grammar' parameter.
- * @return whether the process succeeded
- */
- public boolean putGrammar(SchemaGrammar grammar, boolean deep, boolean ignoreConflict) {
- if (!ignoreConflict) {
- return putGrammar(grammar, deep);
- }
-
- // if grammar already exist in the bucket, we ignore the request
- SchemaGrammar sg = getGrammar(grammar.fTargetNamespace);
- if (sg == null) {
- putGrammar(grammar);
- }
-
- // not adding the imported grammars
- if (!deep) {
- return true;
- }
-
- // get all imported grammars, and make a copy of the Vector, so that
- // we can recursively process the grammars, and add distinct ones
- // to the same vector
- Vector currGrammars = (Vector)grammar.getImportedGrammars();
- if (currGrammars == null) {
- return true;
- }
-
- Vector grammars = ((Vector)currGrammars.clone());
- SchemaGrammar sg1, sg2;
- Vector gs;
- // for all (recursively) imported grammars
- for (int i = 0; i < grammars.size(); i++) {
- // get the grammar
- sg1 = (SchemaGrammar)grammars.elementAt(i);
- // check whether the bucket has one with the same tns
- sg2 = getGrammar(sg1.fTargetNamespace);
- if (sg2 == null) {
- // we need to add grammars imported by sg1 too
- gs = sg1.getImportedGrammars();
- // for all grammars imported by sg2, but not in the vector
- // we add them to the vector
- if(gs == null) continue;
- for (int j = gs.size() - 1; j >= 0; j--) {
- sg2 = (SchemaGrammar)gs.elementAt(j);
- if (!grammars.contains(sg2))
- grammars.addElement(sg2);
- }
- }
- // we found one with the same target namespace, ignore it
- else {
- grammars.remove(sg1);
- }
- }
-
- // now we have all imported grammars stored in the vector. add them
- for (int i = grammars.size() - 1; i >= 0; i--) {
- putGrammar((SchemaGrammar)grammars.elementAt(i));
- }
-
- return true;
- }
-
- /**
- * get all grammars in the registry
- *
- * @return an array of SchemaGrammars.
- */
- public SchemaGrammar[] getGrammars() {
- // get the number of grammars
- int count = fGrammarRegistry.size() + (fNoNSGrammar==null ? 0 : 1);
- SchemaGrammar[] grammars = new SchemaGrammar[count];
- // get grammars with target namespace
- int i = 0;
- for(Map.Entry<String, SchemaGrammar> entry : fGrammarRegistry.entrySet()){
- grammars[i++] = entry.getValue();
- }
-
- // add the grammar without target namespace, if any
- if (fNoNSGrammar != null)
- grammars[count-1] = fNoNSGrammar;
- return grammars;
- }
-
- /**
- * Clear the registry.
- * REVISIT: update to use another XSGrammarBucket
- */
- public void reset() {
- fNoNSGrammar = null;
- fGrammarRegistry.clear();
- }
-
-} // class XSGrammarBucket
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/XSGroupDecl.java b/src/com/sun/org/apache/xerces/internal/impl/xs/XSGroupDecl.java
deleted file mode 100644
index a710e53..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/XSGroupDecl.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs;
-
-
-import com.sun.org.apache.xerces.internal.impl.xs.util.XSObjectListImpl;
-import com.sun.org.apache.xerces.internal.xs.XSAnnotation;
-import com.sun.org.apache.xerces.internal.xs.XSConstants;
-import com.sun.org.apache.xerces.internal.xs.XSModelGroup;
-import com.sun.org.apache.xerces.internal.xs.XSModelGroupDefinition;
-import com.sun.org.apache.xerces.internal.xs.XSNamespaceItem;
-import com.sun.org.apache.xerces.internal.xs.XSObjectList;
-
-/**
- * The XML representation for a group declaration
- * schema component is a global <group> element information item
- *
- * @xerces.internal
- *
- * @author Sandy Gao, IBM
- * @version $Id: XSGroupDecl.java,v 1.7 2010-11-01 04:39:55 joehw Exp $
- */
-public class XSGroupDecl implements XSModelGroupDefinition {
-
- // name of the group
- public String fName = null;
- // target namespace of the group
- public String fTargetNamespace = null;
- // model group of the group
- public XSModelGroupImpl fModelGroup = null;
- // optional annotations
- public XSObjectList fAnnotations = null;
- // The namespace schema information item corresponding to the target namespace
- // of the model group definition, if it is globally declared; or null otherwise.
- private XSNamespaceItem fNamespaceItem = null;
-
- /**
- * Get the type of the object, i.e ELEMENT_DECLARATION.
- */
- public short getType() {
- return XSConstants.MODEL_GROUP_DEFINITION;
- }
-
- /**
- * The <code>name</code> of this <code>XSObject</code> depending on the
- * <code>XSObject</code> type.
- */
- public String getName() {
- return fName;
- }
-
- /**
- * The namespace URI of this node, or <code>null</code> if it is
- * unspecified. defines how a namespace URI is attached to schema
- * components.
- */
- public String getNamespace() {
- return fTargetNamespace;
- }
-
- /**
- * {model group} A model group.
- */
- public XSModelGroup getModelGroup() {
- return fModelGroup;
- }
-
- /**
- * Optional. Annotation.
- */
- public XSAnnotation getAnnotation() {
- return (fAnnotations != null) ? (XSAnnotation) fAnnotations.item(0) : null;
- }
-
- /**
- * Optional. Annotations.
- */
- public XSObjectList getAnnotations() {
- return (fAnnotations != null) ? fAnnotations : XSObjectListImpl.EMPTY_LIST;
- }
-
- /**
- * @see org.apache.xerces.xs.XSObject#getNamespaceItem()
- */
- public XSNamespaceItem getNamespaceItem() {
- return fNamespaceItem;
- }
-
- void setNamespaceItem(XSNamespaceItem namespaceItem) {
- fNamespaceItem = namespaceItem;
- }
-
-} // class XSGroupDecl
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/XSImplementationImpl.java b/src/com/sun/org/apache/xerces/internal/impl/xs/XSImplementationImpl.java
deleted file mode 100644
index 8cf0c4a..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/XSImplementationImpl.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs;
-
-import com.sun.org.apache.xerces.internal.dom.CoreDOMImplementationImpl;
-import com.sun.org.apache.xerces.internal.dom.DOMMessageFormatter;
-import com.sun.org.apache.xerces.internal.impl.xs.util.StringListImpl;
-import com.sun.org.apache.xerces.internal.xs.StringList;
-import com.sun.org.apache.xerces.internal.xs.XSException;
-import com.sun.org.apache.xerces.internal.xs.XSImplementation;
-import com.sun.org.apache.xerces.internal.xs.XSLoader;
-import org.w3c.dom.DOMImplementation;
-
-
-/**
- * Implements XSImplementation interface that allows one to retrieve an instance of <code>XSLoader</code>.
- * This interface should be implemented on the same object that implements
- * DOMImplementation.
- *
- * @xerces.internal
- *
- * @author Elena Litani, IBM
- */
-public class XSImplementationImpl extends CoreDOMImplementationImpl
- implements XSImplementation {
-
- //
- // Data
- //
-
- // static
-
- /** Dom implementation singleton. */
- static XSImplementationImpl singleton = new XSImplementationImpl();
-
- //
- // Public methods
- //
-
- /** NON-DOM: Obtain and return the single shared object */
- public static DOMImplementation getDOMImplementation() {
- return singleton;
- }
-
- //
- // DOMImplementation methods
- //
-
- /**
- * Test if the DOM implementation supports a specific "feature" --
- * currently meaning language and level thereof.
- *
- * @param feature The package name of the feature to test.
- * In Level 1, supported values are "HTML" and "XML" (case-insensitive).
- * At this writing, com.sun.org.apache.xerces.internal.dom supports only XML.
- *
- * @param version The version number of the feature being tested.
- * This is interpreted as "Version of the DOM API supported for the
- * specified Feature", and in Level 1 should be "1.0"
- *
- * @return true iff this implementation is compatable with the specified
- * feature and version.
- */
- public boolean hasFeature(String feature, String version) {
-
- return (feature.equalsIgnoreCase("XS-Loader") && (version == null || version.equals("1.0")) ||
- super.hasFeature(feature, version));
- } // hasFeature(String,String):boolean
-
-
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xs.XSImplementation#createXSLoader(com.sun.org.apache.xerces.internal.xs.StringList)
- */
- public XSLoader createXSLoader(StringList versions) throws XSException {
- XSLoader loader = new XSLoaderImpl();
- if (versions == null){
- return loader;
- }
- for (int i=0; i<versions.getLength();i++){
- if (!versions.item(i).equals("1.0")){
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "FEATURE_NOT_SUPPORTED",
- new Object[] { versions.item(i) });
- throw new XSException(XSException.NOT_SUPPORTED_ERR, msg);
- }
- }
- return loader;
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xs.XSImplementation#getRecognizedVersions()
- */
- public StringList getRecognizedVersions() {
- StringListImpl list = new StringListImpl(new String[]{"1.0"}, 1);
- return list;
- }
-
-} // class XSImplementationImpl
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/XSLoaderImpl.java b/src/com/sun/org/apache/xerces/internal/impl/xs/XSLoaderImpl.java
deleted file mode 100644
index 136d69e..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/XSLoaderImpl.java
+++ /dev/null
@@ -1,322 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs;
-
-import com.sun.org.apache.xerces.internal.impl.xs.util.XSGrammarPool;
-import com.sun.org.apache.xerces.internal.xni.grammars.Grammar;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription;
-import com.sun.org.apache.xerces.internal.xni.grammars.XSGrammar;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-import com.sun.org.apache.xerces.internal.xs.LSInputList;
-import com.sun.org.apache.xerces.internal.xs.StringList;
-import com.sun.org.apache.xerces.internal.xs.XSConstants;
-import com.sun.org.apache.xerces.internal.xs.XSLoader;
-import com.sun.org.apache.xerces.internal.xs.XSModel;
-import com.sun.org.apache.xerces.internal.xs.XSNamedMap;
-import com.sun.org.apache.xerces.internal.xs.XSObjectList;
-import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
-import org.w3c.dom.DOMConfiguration;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.DOMStringList;
-import org.w3c.dom.ls.LSInput;
-
-/**
- * <p>An implementation of XSLoader which wraps XMLSchemaLoader.</p>
- *
- * @xerces.internal
- *
- * @author Michael Glavassevich, IBM
- *
- * @version $Id: XSLoaderImpl.java,v 1.7 2010-11-01 04:39:55 joehw Exp $
- */
-public final class XSLoaderImpl implements XSLoader, DOMConfiguration {
-
- /**
- * Grammar pool. Need this to prevent us from
- * getting two grammars from the same namespace.
- */
- private final XSGrammarPool fGrammarPool = new XSGrammarMerger();
-
- /** Schema loader. **/
- private final XMLSchemaLoader fSchemaLoader = new XMLSchemaLoader();
-
- /**
- * No-args constructor.
- */
- public XSLoaderImpl() {
- fSchemaLoader.setProperty(XMLSchemaLoader.XMLGRAMMAR_POOL, fGrammarPool);
- }
-
- /**
- * The configuration of a document. It maintains a table of recognized
- * parameters. Using the configuration, it is possible to change the
- * behavior of the load methods. The configuration may support the
- * setting of and the retrieval of the following non-boolean parameters
- * defined on the <code>DOMConfiguration</code> interface:
- * <code>error-handler</code> (<code>DOMErrorHandler</code>) and
- * <code>resource-resolver</code> (<code>LSResourceResolver</code>).
- * <br> The following list of boolean parameters is defined:
- * <dl>
- * <dt>
- * <code>"validate"</code></dt>
- * <dd>
- * <dl>
- * <dt><code>true</code></dt>
- * <dd>[required] (default) Validate an XML
- * Schema during loading. If validation errors are found, the error
- * handler is notified. </dd>
- * <dt><code>false</code></dt>
- * <dd>[optional] Do not
- * report errors during the loading of an XML Schema document. </dd>
- * </dl></dd>
- * </dl>
- */
- public DOMConfiguration getConfig() {
- return this;
- }
-
- /**
- * Parses the content of XML Schema documents specified as the list of URI
- * references. If the URI contains a fragment identifier, the behavior
- * is not defined by this specification.
- * @param uriList The list of URI locations.
- * @return An XSModel representing the schema documents.
- */
- public XSModel loadURIList(StringList uriList) {
- int length = uriList.getLength();
- try {
- fGrammarPool.clear();
- for (int i = 0; i < length; ++i) {
- fSchemaLoader.loadGrammar(new XMLInputSource(null, uriList.item(i), null));
- }
- return fGrammarPool.toXSModel();
- }
- catch (Exception e) {
- fSchemaLoader.reportDOMFatalError(e);
- return null;
- }
- }
-
- /**
- * Parses the content of XML Schema documents specified as a list of
- * <code>LSInput</code>s.
- * @param is The list of <code>LSInput</code>s from which the XML
- * Schema documents are to be read.
- * @return An XSModel representing the schema documents.
- */
- public XSModel loadInputList(LSInputList is) {
- final int length = is.getLength();
- try {
- fGrammarPool.clear();
- for (int i = 0; i < length; ++i) {
- fSchemaLoader.loadGrammar(fSchemaLoader.dom2xmlInputSource(is.item(i)));
- }
- return fGrammarPool.toXSModel();
- }
- catch (Exception e) {
- fSchemaLoader.reportDOMFatalError(e);
- return null;
- }
- }
-
- /**
- * Parse an XML Schema document from a location identified by a URI
- * reference. If the URI contains a fragment identifier, the behavior is
- * not defined by this specification.
- * @param uri The location of the XML Schema document to be read.
- * @return An XSModel representing this schema.
- */
- public XSModel loadURI(String uri) {
- try {
- fGrammarPool.clear();
- return ((XSGrammar) fSchemaLoader.loadGrammar(new XMLInputSource(null, uri, null))).toXSModel();
- }
- catch (Exception e){
- fSchemaLoader.reportDOMFatalError(e);
- return null;
- }
- }
-
- /**
- * Parse an XML Schema document from a resource identified by a
- * <code>LSInput</code> .
- * @param is The <code>LSInput</code> from which the source
- * document is to be read.
- * @return An XSModel representing this schema.
- */
- public XSModel load(LSInput is) {
- try {
- fGrammarPool.clear();
- return ((XSGrammar) fSchemaLoader.loadGrammar(fSchemaLoader.dom2xmlInputSource(is))).toXSModel();
- }
- catch (Exception e) {
- fSchemaLoader.reportDOMFatalError(e);
- return null;
- }
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.dom3.DOMConfiguration#setParameter(java.lang.String, java.lang.Object)
- */
- public void setParameter(String name, Object value) throws DOMException {
- fSchemaLoader.setParameter(name, value);
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.dom3.DOMConfiguration#getParameter(java.lang.String)
- */
- public Object getParameter(String name) throws DOMException {
- return fSchemaLoader.getParameter(name);
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.dom3.DOMConfiguration#canSetParameter(java.lang.String, java.lang.Object)
- */
- public boolean canSetParameter(String name, Object value) {
- return fSchemaLoader.canSetParameter(name, value);
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.dom3.DOMConfiguration#getParameterNames()
- */
- public DOMStringList getParameterNames() {
- return fSchemaLoader.getParameterNames();
- }
-
- /**
- * Grammar pool which merges grammars from the same namespace into one. This eliminates
- * duplicate named components. It doesn't ensure that the grammar is consistent, however
- * this no worse than than the behaviour of XMLSchemaLoader alone when used as an XSLoader.
- */
- private static final class XSGrammarMerger extends XSGrammarPool {
-
- public XSGrammarMerger () {}
-
- public void putGrammar(Grammar grammar) {
- SchemaGrammar cachedGrammar =
- toSchemaGrammar(super.getGrammar(grammar.getGrammarDescription()));
- if (cachedGrammar != null) {
- SchemaGrammar newGrammar = toSchemaGrammar(grammar);
- if (newGrammar != null) {
- mergeSchemaGrammars(cachedGrammar, newGrammar);
- }
- }
- else {
- super.putGrammar(grammar);
- }
- }
-
- private SchemaGrammar toSchemaGrammar (Grammar grammar) {
- return (grammar instanceof SchemaGrammar) ? (SchemaGrammar) grammar : null;
- }
-
- private void mergeSchemaGrammars(SchemaGrammar cachedGrammar, SchemaGrammar newGrammar) {
-
- /** Add new top-level element declarations. **/
- XSNamedMap map = newGrammar.getComponents(XSConstants.ELEMENT_DECLARATION);
- int length = map.getLength();
- for (int i = 0; i < length; ++i) {
- XSElementDecl decl = (XSElementDecl) map.item(i);
- if (cachedGrammar.getGlobalElementDecl(decl.getName()) == null) {
- cachedGrammar.addGlobalElementDecl(decl);
- }
- }
-
- /** Add new top-level attribute declarations. **/
- map = newGrammar.getComponents(XSConstants.ATTRIBUTE_DECLARATION);
- length = map.getLength();
- for (int i = 0; i < length; ++i) {
- XSAttributeDecl decl = (XSAttributeDecl) map.item(i);
- if (cachedGrammar.getGlobalAttributeDecl(decl.getName()) == null) {
- cachedGrammar.addGlobalAttributeDecl(decl);
- }
- }
-
- /** Add new top-level type definitions. **/
- map = newGrammar.getComponents(XSConstants.TYPE_DEFINITION);
- length = map.getLength();
- for (int i = 0; i < length; ++i) {
- XSTypeDefinition decl = (XSTypeDefinition) map.item(i);
- if (cachedGrammar.getGlobalTypeDecl(decl.getName()) == null) {
- cachedGrammar.addGlobalTypeDecl(decl);
- }
- }
-
- /** Add new top-level attribute group definitions. **/
- map = newGrammar.getComponents(XSConstants.ATTRIBUTE_GROUP);
- length = map.getLength();
- for (int i = 0; i < length; ++i) {
- XSAttributeGroupDecl decl = (XSAttributeGroupDecl) map.item(i);
- if (cachedGrammar.getGlobalAttributeGroupDecl(decl.getName()) == null) {
- cachedGrammar.addGlobalAttributeGroupDecl(decl);
- }
- }
-
- /** Add new top-level model group definitions. **/
- map = newGrammar.getComponents(XSConstants.MODEL_GROUP);
- length = map.getLength();
- for (int i = 0; i < length; ++i) {
- XSGroupDecl decl = (XSGroupDecl) map.item(i);
- if (cachedGrammar.getGlobalGroupDecl(decl.getName()) == null) {
- cachedGrammar.addGlobalGroupDecl(decl);
- }
- }
-
- /** Add new top-level notation declarations. **/
- map = newGrammar.getComponents(XSConstants.NOTATION_DECLARATION);
- length = map.getLength();
- for (int i = 0; i < length; ++i) {
- XSNotationDecl decl = (XSNotationDecl) map.item(i);
- if (cachedGrammar.getGlobalNotationDecl(decl.getName()) == null) {
- cachedGrammar.addGlobalNotationDecl(decl);
- }
- }
-
- /**
- * Add all annotations. Since these components are not named it's
- * possible we'll add duplicate components. There isn't much we can
- * do. It's no worse than XMLSchemaLoader when used as an XSLoader.
- */
- XSObjectList annotations = newGrammar.getAnnotations();
- length = annotations.getLength();
- for (int i = 0; i < length; ++i) {
- cachedGrammar.addAnnotation((XSAnnotationImpl) annotations.item(i));
- }
-
- }
-
- public boolean containsGrammar(XMLGrammarDescription desc) {
- return false;
- }
-
- public Grammar getGrammar(XMLGrammarDescription desc) {
- return null;
- }
-
- public Grammar retrieveGrammar(XMLGrammarDescription desc) {
- return null;
- }
-
- public Grammar [] retrieveInitialGrammarSet (String grammarType) {
- return new Grammar[0];
- }
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/XSMessageFormatter.java b/src/com/sun/org/apache/xerces/internal/impl/xs/XSMessageFormatter.java
deleted file mode 100644
index 0a51a3c..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/XSMessageFormatter.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs;
-
-import com.sun.org.apache.xerces.internal.util.MessageFormatter;
-import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-
-/**
- * SchemaMessageProvider implements an XMLMessageProvider that
- * provides localizable error messages for the W3C XML Schema Language
- *
- * @xerces.internal
- *
- * @author Elena Litani, IBM
- * @version $Id: XSMessageFormatter.java,v 1.6 2010-11-01 04:39:55 joehw Exp $
- */
-public class XSMessageFormatter implements MessageFormatter {
- /**
- * The domain of messages concerning the XML Schema: Structures specification.
- */
- public static final String SCHEMA_DOMAIN = "http://www.w3.org/TR/xml-schema-1";
-
-
- // private objects to cache the locale and resource bundle
- private Locale fLocale = null;
- private ResourceBundle fResourceBundle = null;
-
- /**
- * Formats a message with the specified arguments using the given
- * locale information.
- *
- * @param locale The locale of the message.
- * @param key The message key.
- * @param arguments The message replacement text arguments. The order
- * of the arguments must match that of the placeholders
- * in the actual message.
- *
- * @return Returns the formatted message.
- *
- * @throws MissingResourceException Thrown if the message with the
- * specified key cannot be found.
- */
- public String formatMessage(Locale locale, String key, Object[] arguments)
- throws MissingResourceException {
-
- if (fResourceBundle == null || locale != fLocale) {
- if (locale != null) {
- fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLSchemaMessages", locale);
- // memorize the most-recent locale
- fLocale = locale;
- }
- if (fResourceBundle == null)
- fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XMLSchemaMessages");
- }
-
- String msg = fResourceBundle.getString(key);
- if (arguments != null) {
- try {
- msg = java.text.MessageFormat.format(msg, arguments);
- } catch (Exception e) {
- msg = fResourceBundle.getString("FormatFailed");
- msg += " " + fResourceBundle.getString(key);
- }
- }
-
- if (msg == null) {
- msg = fResourceBundle.getString("BadMessageKey");
- throw new MissingResourceException(msg, "com.sun.org.apache.xerces.internal.impl.msg.SchemaMessages", key);
- }
-
- return msg;
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/XSModelGroupImpl.java b/src/com/sun/org/apache/xerces/internal/impl/xs/XSModelGroupImpl.java
deleted file mode 100644
index 4414003..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/XSModelGroupImpl.java
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2002,2003-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs;
-
-import com.sun.org.apache.xerces.internal.impl.xs.util.XSObjectListImpl;
-import com.sun.org.apache.xerces.internal.xs.XSAnnotation;
-import com.sun.org.apache.xerces.internal.xs.XSConstants;
-import com.sun.org.apache.xerces.internal.xs.XSModelGroup;
-import com.sun.org.apache.xerces.internal.xs.XSNamespaceItem;
-import com.sun.org.apache.xerces.internal.xs.XSObjectList;
-
-/**
- * Store schema model group declaration.
- *
- * @xerces.internal
- *
- * @author Sandy Gao, IBM
- *
- * @version $Id: XSModelGroupImpl.java,v 1.7 2010-11-01 04:39:55 joehw Exp $
- */
-public class XSModelGroupImpl implements XSModelGroup {
-
- // types of model groups
- // REVISIT: can't use same constants as those for particles, because
- // there are place where the constants are used together. For example,
- // to check whether the content is an element or a sequence.
- public static final short MODELGROUP_CHOICE = 101;
- public static final short MODELGROUP_SEQUENCE = 102;
- public static final short MODELGROUP_ALL = 103;
-
- // compositor of the model group
- public short fCompositor;
-
- // particles
- public XSParticleDecl[] fParticles = null;
- public int fParticleCount = 0;
-
- // this particle's optional annotations
- public XSObjectList fAnnotations = null;
-
- // whether this model group contains nothing
- public boolean isEmpty() {
- for (int i = 0; i < fParticleCount; i++) {
- if (!fParticles[i].isEmpty())
- return false;
- }
- return true;
- }
-
- /**
- * 3.8.6 Effective Total Range (all and sequence) and
- * Effective Total Range (choice)
- * The following methods are used to return min/max range for a particle.
- * They are not exactly the same as it's described in the spec, but all the
- * values from the spec are retrievable by these methods.
- */
- public int minEffectiveTotalRange() {
- if (fCompositor == MODELGROUP_CHOICE)
- return minEffectiveTotalRangeChoice();
- else
- return minEffectiveTotalRangeAllSeq();
- }
-
- // return the sum of all min values of the particles
- private int minEffectiveTotalRangeAllSeq() {
- int total = 0;
- for (int i = 0; i < fParticleCount; i++)
- total += fParticles[i].minEffectiveTotalRange();
- return total;
- }
-
- // return the min of all min values of the particles
- private int minEffectiveTotalRangeChoice() {
- int min = 0, one;
- if (fParticleCount > 0)
- min = fParticles[0].minEffectiveTotalRange();
-
- for (int i = 1; i < fParticleCount; i++) {
- one = fParticles[i].minEffectiveTotalRange();
- if (one < min)
- min = one;
- }
-
- return min;
- }
-
- public int maxEffectiveTotalRange() {
- if (fCompositor == MODELGROUP_CHOICE)
- return maxEffectiveTotalRangeChoice();
- else
- return maxEffectiveTotalRangeAllSeq();
- }
-
- // if one of the max value of the particles is unbounded, return unbounded;
- // otherwise return the sum of all max values
- private int maxEffectiveTotalRangeAllSeq() {
- int total = 0, one;
- for (int i = 0; i < fParticleCount; i++) {
- one = fParticles[i].maxEffectiveTotalRange();
- if (one == SchemaSymbols.OCCURRENCE_UNBOUNDED)
- return SchemaSymbols.OCCURRENCE_UNBOUNDED;
- total += one;
- }
- return total;
- }
-
- // if one of the max value of the particles is unbounded, return unbounded;
- // otherwise return the max of all max values
- private int maxEffectiveTotalRangeChoice() {
- int max = 0, one;
- if (fParticleCount > 0) {
- max = fParticles[0].maxEffectiveTotalRange();
- if (max == SchemaSymbols.OCCURRENCE_UNBOUNDED)
- return SchemaSymbols.OCCURRENCE_UNBOUNDED;
- }
-
- for (int i = 1; i < fParticleCount; i++) {
- one = fParticles[i].maxEffectiveTotalRange();
- if (one == SchemaSymbols.OCCURRENCE_UNBOUNDED)
- return SchemaSymbols.OCCURRENCE_UNBOUNDED;
- if (one > max)
- max = one;
- }
- return max;
- }
-
- /**
- * get the string description of this particle
- */
- private String fDescription = null;
- public String toString() {
- // REVISIT: Commented code may help to eliminate redundant parentheses (test first before committing)
- if (fDescription == null) {
- StringBuffer buffer = new StringBuffer();
- if (fCompositor == MODELGROUP_ALL)
- buffer.append("all(");
- else //if (fMinOccurs != 1 || fMaxOccurs != 1)
- buffer.append('(');
- if (fParticleCount > 0)
- buffer.append(fParticles[0].toString());
- for (int i = 1; i < fParticleCount; i++) {
- if (fCompositor == MODELGROUP_CHOICE)
- buffer.append('|');
- else
- buffer.append(',');
- buffer.append(fParticles[i].toString());
- }
- //if (fCompositor == MODELGROUP_ALL || fMinOccurs != 1 || fMaxOccurs != 1)
- buffer.append(')');
- fDescription = buffer.toString();
- }
- return fDescription;
- }
-
- public void reset(){
- fCompositor = MODELGROUP_SEQUENCE;
- fParticles = null;
- fParticleCount = 0;
- fDescription = null;
- fAnnotations = null;
- }
-
- /**
- * Get the type of the object, i.e ELEMENT_DECLARATION.
- */
- public short getType() {
- return XSConstants.MODEL_GROUP;
- }
-
- /**
- * The <code>name</code> of this <code>XSObject</code> depending on the
- * <code>XSObject</code> type.
- */
- public String getName() {
- return null;
- }
-
- /**
- * The namespace URI of this node, or <code>null</code> if it is
- * unspecified. defines how a namespace URI is attached to schema
- * components.
- */
- public String getNamespace() {
- return null;
- }
-
- /**
- * {compositor} One of all, choice or sequence. The valid constants values
- * are: ALL, CHOICE, SEQUENCE.
- */
- public short getCompositor() {
- if (fCompositor == MODELGROUP_CHOICE)
- return XSModelGroup.COMPOSITOR_CHOICE;
- else if (fCompositor == MODELGROUP_SEQUENCE)
- return XSModelGroup.COMPOSITOR_SEQUENCE;
- else
- return XSModelGroup.COMPOSITOR_ALL;
- }
-
- /**
- * {particles} A list of particles
- */
- public XSObjectList getParticles() {
- return new XSObjectListImpl(fParticles, fParticleCount);
- }
-
- /**
- * Optional. Annotation.
- */
- public XSAnnotation getAnnotation() {
- return (fAnnotations != null) ? (XSAnnotation) fAnnotations.item(0) : null;
- }
-
- /**
- * Optional. Annotations.
- */
- public XSObjectList getAnnotations() {
- return (fAnnotations != null) ? fAnnotations : XSObjectListImpl.EMPTY_LIST;
- }
-
- /**
- * @see org.apache.xerces.xs.XSObject#getNamespaceItem()
- */
- public XSNamespaceItem getNamespaceItem() {
- return null;
- }
-
-} // class XSModelGroupImpl
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/XSModelImpl.java b/src/com/sun/org/apache/xerces/internal/impl/xs/XSModelImpl.java
deleted file mode 100644
index bded295..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/XSModelImpl.java
+++ /dev/null
@@ -1,809 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2002-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs;
-
-import java.lang.reflect.Array;
-import java.util.AbstractList;
-import java.util.Iterator;
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-import java.util.Vector;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.xs.util.StringListImpl;
-import com.sun.org.apache.xerces.internal.impl.xs.util.XSNamedMap4Types;
-import com.sun.org.apache.xerces.internal.impl.xs.util.XSNamedMapImpl;
-import com.sun.org.apache.xerces.internal.impl.xs.util.XSObjectListImpl;
-import com.sun.org.apache.xerces.internal.util.SymbolHash;
-import com.sun.org.apache.xerces.internal.util.XMLSymbols;
-import com.sun.org.apache.xerces.internal.xs.StringList;
-import com.sun.org.apache.xerces.internal.xs.XSAttributeDeclaration;
-import com.sun.org.apache.xerces.internal.xs.XSAttributeGroupDefinition;
-import com.sun.org.apache.xerces.internal.xs.XSConstants;
-import com.sun.org.apache.xerces.internal.xs.XSElementDeclaration;
-import com.sun.org.apache.xerces.internal.xs.XSModel;
-import com.sun.org.apache.xerces.internal.xs.XSModelGroupDefinition;
-import com.sun.org.apache.xerces.internal.xs.XSNamedMap;
-import com.sun.org.apache.xerces.internal.xs.XSNamespaceItem;
-import com.sun.org.apache.xerces.internal.xs.XSNamespaceItemList;
-import com.sun.org.apache.xerces.internal.xs.XSNotationDeclaration;
-import com.sun.org.apache.xerces.internal.xs.XSObject;
-import com.sun.org.apache.xerces.internal.xs.XSObjectList;
-import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
-
-/**
- * Implements XSModel: a read-only interface that represents an XML Schema,
- * which could be components from different namespaces.
- *
- * @xerces.internal
- *
- * @author Sandy Gao, IBM
- *
- * @version $Id: XSModelImpl.java,v 1.7 2010-11-01 04:39:55 joehw Exp $
- */
-public final class XSModelImpl extends AbstractList implements XSModel, XSNamespaceItemList {
-
- // the max index / the max value of XSObject type
- private static final short MAX_COMP_IDX = XSTypeDefinition.SIMPLE_TYPE;
- private static final boolean[] GLOBAL_COMP = {false, // null
- true, // attribute
- true, // element
- true, // type
- false, // attribute use
- true, // attribute group
- true, // group
- false, // model group
- false, // particle
- false, // wildcard
- false, // idc
- true, // notation
- false, // annotation
- false, // facet
- false, // multi value facet
- true, // complex type
- true // simple type
- };
-
- // number of grammars/namespaces stored here
- private final int fGrammarCount;
- // all target namespaces
- private final String[] fNamespaces;
- // all schema grammar objects (for each namespace)
- private final SchemaGrammar[] fGrammarList;
- // a map from namespace to schema grammar
- private final SymbolHash fGrammarMap;
- // a map from element declaration to its substitution group
- private final SymbolHash fSubGroupMap;
-
- // store a certain kind of components from all namespaces
- private final XSNamedMap[] fGlobalComponents;
- // store a certain kind of components from one namespace
- private final XSNamedMap[][] fNSComponents;
-
- // a string list of all the target namespaces.
- private final StringList fNamespacesList;
- // store all annotations
- private XSObjectList fAnnotations = null;
-
- // whether there is any IDC in this XSModel
- private final boolean fHasIDC;
-
- /**
- * Construct an XSModelImpl, by storing some grammars and grammars imported
- * by them to this object.
- *
- * @param grammars the array of schema grammars
- */
- public XSModelImpl(SchemaGrammar[] grammars) {
- this(grammars, Constants.SCHEMA_VERSION_1_0);
- }
-
- public XSModelImpl(SchemaGrammar[] grammars, short s4sVersion) {
- // copy namespaces/grammars from the array to our arrays
- int len = grammars.length;
- final int initialSize = Math.max(len+1, 5);
- String[] namespaces = new String[initialSize];
- SchemaGrammar[] grammarList = new SchemaGrammar[initialSize];
- boolean hasS4S = false;
- for (int i = 0; i < len; i++) {
- final SchemaGrammar sg = grammars[i];
- final String tns = sg.getTargetNamespace();
- namespaces[i] = tns;
- grammarList[i] = sg;
- if (tns == SchemaSymbols.URI_SCHEMAFORSCHEMA) {
- hasS4S = true;
- }
- }
- // If a schema for the schema namespace isn't included, include it here.
- if (!hasS4S) {
- namespaces[len] = SchemaSymbols.URI_SCHEMAFORSCHEMA;
- grammarList[len++] = SchemaGrammar.getS4SGrammar(s4sVersion);
- }
-
- SchemaGrammar sg1, sg2;
- Vector gs;
- int i, j, k;
- // and recursively get all imported grammars, add them to our arrays
- for (i = 0; i < len; i++) {
- // get the grammar
- sg1 = grammarList[i];
- gs = sg1.getImportedGrammars();
- // for each imported grammar
- for (j = gs == null ? -1 : gs.size() - 1; j >= 0; j--) {
- sg2 = (SchemaGrammar)gs.elementAt(j);
- // check whether this grammar is already in the list
- for (k = 0; k < len; k++) {
- if (sg2 == grammarList[k]) {
- break;
- }
- }
- // if it's not, add it to the list
- if (k == len) {
- // ensure the capacity of the arrays
- if (len == grammarList.length) {
- String[] newSA = new String[len*2];
- System.arraycopy(namespaces, 0, newSA, 0, len);
- namespaces = newSA;
- SchemaGrammar[] newGA = new SchemaGrammar[len*2];
- System.arraycopy(grammarList, 0, newGA, 0, len);
- grammarList = newGA;
- }
- namespaces[len] = sg2.getTargetNamespace();
- grammarList[len] = sg2;
- len++;
- }
- }
- }
-
- fNamespaces = namespaces;
- fGrammarList = grammarList;
-
- boolean hasIDC = false;
- // establish the mapping from namespace to grammars
- fGrammarMap = new SymbolHash(len*2);
- for (i = 0; i < len; i++) {
- fGrammarMap.put(null2EmptyString(fNamespaces[i]), fGrammarList[i]);
- // update the idc field
- if (fGrammarList[i].hasIDConstraints()) {
- hasIDC = true;
- }
- }
-
- fHasIDC = hasIDC;
- fGrammarCount = len;
- fGlobalComponents = new XSNamedMap[MAX_COMP_IDX+1];
- fNSComponents = new XSNamedMap[len][MAX_COMP_IDX+1];
- fNamespacesList = new StringListImpl(fNamespaces, fGrammarCount);
-
- // build substitution groups
- fSubGroupMap = buildSubGroups();
- }
-
- private SymbolHash buildSubGroups_Org() {
- SubstitutionGroupHandler sgHandler = new SubstitutionGroupHandler(null);
- for (int i = 0 ; i < fGrammarCount; i++) {
- sgHandler.addSubstitutionGroup(fGrammarList[i].getSubstitutionGroups());
- }
-
- final XSNamedMap elements = getComponents(XSConstants.ELEMENT_DECLARATION);
- final int len = elements.getLength();
- final SymbolHash subGroupMap = new SymbolHash(len*2);
- XSElementDecl head;
- XSElementDeclaration[] subGroup;
- for (int i = 0; i < len; i++) {
- head = (XSElementDecl)elements.item(i);
- subGroup = sgHandler.getSubstitutionGroup(head);
- subGroupMap.put(head, subGroup.length > 0 ?
- new XSObjectListImpl(subGroup, subGroup.length) : XSObjectListImpl.EMPTY_LIST);
- }
- return subGroupMap;
- }
-
- private SymbolHash buildSubGroups() {
- SubstitutionGroupHandler sgHandler = new SubstitutionGroupHandler(null);
- for (int i = 0 ; i < fGrammarCount; i++) {
- sgHandler.addSubstitutionGroup(fGrammarList[i].getSubstitutionGroups());
- }
-
- final XSObjectListImpl elements = getGlobalElements();
- final int len = elements.getLength();
- final SymbolHash subGroupMap = new SymbolHash(len*2);
- XSElementDecl head;
- XSElementDeclaration[] subGroup;
- for (int i = 0; i < len; i++) {
- head = (XSElementDecl)elements.item(i);
- subGroup = sgHandler.getSubstitutionGroup(head);
- subGroupMap.put(head, subGroup.length > 0 ?
- new XSObjectListImpl(subGroup, subGroup.length) : XSObjectListImpl.EMPTY_LIST);
- }
- return subGroupMap;
- }
-
- private XSObjectListImpl getGlobalElements() {
- final SymbolHash[] tables = new SymbolHash[fGrammarCount];
- int length = 0;
-
- for (int i = 0; i < fGrammarCount; i++) {
- tables[i] = fGrammarList[i].fAllGlobalElemDecls;
- length += tables[i].getLength();
- }
-
- if (length == 0) {
- return XSObjectListImpl.EMPTY_LIST;
- }
-
- final XSObject[] components = new XSObject[length];
-
- int start = 0;
- for (int i = 0; i < fGrammarCount; i++) {
- tables[i].getValues(components, start);
- start += tables[i].getLength();
- }
-
- return new XSObjectListImpl(components, length);
- }
-
- /**
- * Convenience method. Returns a list of all namespaces that belong to
- * this schema.
- * @return A list of all namespaces that belong to this schema or
- * <code>null</code> if all components don't have a targetNamespace.
- */
- public StringList getNamespaces() {
- return fNamespacesList;
- }
-
- /**
- * A set of namespace schema information information items (of type
- * <code>XSNamespaceItem</code>), one for each namespace name which
- * appears as the target namespace of any schema component in the schema
- * used for that assessment, and one for absent if any schema component
- * in the schema had no target namespace. For more information see
- * schema information.
- */
- public XSNamespaceItemList getNamespaceItems() {
- return this;
- }
-
- /**
- * Returns a list of top-level components, i.e. element declarations,
- * attribute declarations, etc.
- * @param objectType The type of the declaration, i.e.
- * <code>ELEMENT_DECLARATION</code>. Note that
- * <code>XSTypeDefinition.SIMPLE_TYPE</code> and
- * <code>XSTypeDefinition.COMPLEX_TYPE</code> can also be used as the
- * <code>objectType</code> to retrieve only complex types or simple
- * types, instead of all types.
- * @return A list of top-level definitions of the specified type in
- * <code>objectType</code> or an empty <code>XSNamedMap</code> if no
- * such definitions exist.
- */
- public synchronized XSNamedMap getComponents(short objectType) {
- if (objectType <= 0 || objectType > MAX_COMP_IDX ||
- !GLOBAL_COMP[objectType]) {
- return XSNamedMapImpl.EMPTY_MAP;
- }
-
- SymbolHash[] tables = new SymbolHash[fGrammarCount];
- // get all hashtables from all namespaces for this type of components
- if (fGlobalComponents[objectType] == null) {
- for (int i = 0; i < fGrammarCount; i++) {
- switch (objectType) {
- case XSConstants.TYPE_DEFINITION:
- case XSTypeDefinition.COMPLEX_TYPE:
- case XSTypeDefinition.SIMPLE_TYPE:
- tables[i] = fGrammarList[i].fGlobalTypeDecls;
- break;
- case XSConstants.ATTRIBUTE_DECLARATION:
- tables[i] = fGrammarList[i].fGlobalAttrDecls;
- break;
- case XSConstants.ELEMENT_DECLARATION:
- tables[i] = fGrammarList[i].fGlobalElemDecls;
- break;
- case XSConstants.ATTRIBUTE_GROUP:
- tables[i] = fGrammarList[i].fGlobalAttrGrpDecls;
- break;
- case XSConstants.MODEL_GROUP_DEFINITION:
- tables[i] = fGrammarList[i].fGlobalGroupDecls;
- break;
- case XSConstants.NOTATION_DECLARATION:
- tables[i] = fGrammarList[i].fGlobalNotationDecls;
- break;
- }
- }
- // for complex/simple types, create a special implementation,
- // which take specific types out of the hash table
- if (objectType == XSTypeDefinition.COMPLEX_TYPE ||
- objectType == XSTypeDefinition.SIMPLE_TYPE) {
- fGlobalComponents[objectType] = new XSNamedMap4Types(fNamespaces, tables, fGrammarCount, objectType);
- }
- else {
- fGlobalComponents[objectType] = new XSNamedMapImpl(fNamespaces, tables, fGrammarCount);
- }
- }
-
- return fGlobalComponents[objectType];
- }
-
- /**
- * Convenience method. Returns a list of top-level component declarations
- * that are defined within the specified namespace, i.e. element
- * declarations, attribute declarations, etc.
- * @param objectType The type of the declaration, i.e.
- * <code>ELEMENT_DECLARATION</code>.
- * @param namespace The namespace to which the declaration belongs or
- * <code>null</code> (for components with no target namespace).
- * @return A list of top-level definitions of the specified type in
- * <code>objectType</code> and defined in the specified
- * <code>namespace</code> or an empty <code>XSNamedMap</code>.
- */
- public synchronized XSNamedMap getComponentsByNamespace(short objectType,
- String namespace) {
- if (objectType <= 0 || objectType > MAX_COMP_IDX ||
- !GLOBAL_COMP[objectType]) {
- return XSNamedMapImpl.EMPTY_MAP;
- }
-
- // try to find the grammar
- int i = 0;
- if (namespace != null) {
- for (; i < fGrammarCount; ++i) {
- if (namespace.equals(fNamespaces[i])) {
- break;
- }
- }
- }
- else {
- for (; i < fGrammarCount; ++i) {
- if (fNamespaces[i] == null) {
- break;
- }
- }
- }
- if (i == fGrammarCount) {
- return XSNamedMapImpl.EMPTY_MAP;
- }
-
- // get the hashtable for this type of components
- if (fNSComponents[i][objectType] == null) {
- SymbolHash table = null;
- switch (objectType) {
- case XSConstants.TYPE_DEFINITION:
- case XSTypeDefinition.COMPLEX_TYPE:
- case XSTypeDefinition.SIMPLE_TYPE:
- table = fGrammarList[i].fGlobalTypeDecls;
- break;
- case XSConstants.ATTRIBUTE_DECLARATION:
- table = fGrammarList[i].fGlobalAttrDecls;
- break;
- case XSConstants.ELEMENT_DECLARATION:
- table = fGrammarList[i].fGlobalElemDecls;
- break;
- case XSConstants.ATTRIBUTE_GROUP:
- table = fGrammarList[i].fGlobalAttrGrpDecls;
- break;
- case XSConstants.MODEL_GROUP_DEFINITION:
- table = fGrammarList[i].fGlobalGroupDecls;
- break;
- case XSConstants.NOTATION_DECLARATION:
- table = fGrammarList[i].fGlobalNotationDecls;
- break;
- }
-
- // for complex/simple types, create a special implementation,
- // which take specific types out of the hash table
- if (objectType == XSTypeDefinition.COMPLEX_TYPE ||
- objectType == XSTypeDefinition.SIMPLE_TYPE) {
- fNSComponents[i][objectType] = new XSNamedMap4Types(namespace, table, objectType);
- }
- else {
- fNSComponents[i][objectType] = new XSNamedMapImpl(namespace, table);
- }
- }
-
- return fNSComponents[i][objectType];
- }
-
- /**
- * Convenience method. Returns a top-level simple or complex type
- * definition.
- * @param name The name of the definition.
- * @param namespace The namespace of the definition, otherwise null.
- * @return An <code>XSTypeDefinition</code> or null if such definition
- * does not exist.
- */
- public XSTypeDefinition getTypeDefinition(String name,
- String namespace) {
- SchemaGrammar sg = (SchemaGrammar)fGrammarMap.get(null2EmptyString(namespace));
- if (sg == null) {
- return null;
- }
- return (XSTypeDefinition)sg.fGlobalTypeDecls.get(name);
- }
-
- /**
- * Convenience method. Returns a top-level simple or complex type
- * definition.
- * @param name The name of the definition.
- * @param namespace The namespace of the definition, otherwise null.
- * @param loc The schema location where the component was defined
- * @return An <code>XSTypeDefinition</code> or null if such definition
- * does not exist.
- */
- public XSTypeDefinition getTypeDefinition(String name,
- String namespace,
- String loc) {
- SchemaGrammar sg = (SchemaGrammar)fGrammarMap.get(null2EmptyString(namespace));
- if (sg == null) {
- return null;
- }
- return sg.getGlobalTypeDecl(name, loc);
- }
-
- /**
- * Convenience method. Returns a top-level attribute declaration.
- * @param name The name of the declaration.
- * @param namespace The namespace of the definition, otherwise null.
- * @return A top-level attribute declaration or null if such declaration
- * does not exist.
- */
- public XSAttributeDeclaration getAttributeDeclaration(String name,
- String namespace) {
- SchemaGrammar sg = (SchemaGrammar)fGrammarMap.get(null2EmptyString(namespace));
- if (sg == null) {
- return null;
- }
- return (XSAttributeDeclaration)sg.fGlobalAttrDecls.get(name);
- }
-
- /**
- * Convenience method. Returns a top-level attribute declaration.
- * @param name The name of the declaration.
- * @param namespace The namespace of the definition, otherwise null.
- * @param loc The schema location where the component was defined
- * @return A top-level attribute declaration or null if such declaration
- * does not exist.
- */
- public XSAttributeDeclaration getAttributeDeclaration(String name,
- String namespace,
- String loc) {
- SchemaGrammar sg = (SchemaGrammar)fGrammarMap.get(null2EmptyString(namespace));
- if (sg == null) {
- return null;
- }
- return sg.getGlobalAttributeDecl(name, loc);
- }
-
- /**
- * Convenience method. Returns a top-level element declaration.
- * @param name The name of the declaration.
- * @param namespace The namespace of the definition, otherwise null.
- * @return A top-level element declaration or null if such declaration
- * does not exist.
- */
- public XSElementDeclaration getElementDeclaration(String name,
- String namespace) {
- SchemaGrammar sg = (SchemaGrammar)fGrammarMap.get(null2EmptyString(namespace));
- if (sg == null) {
- return null;
- }
- return (XSElementDeclaration)sg.fGlobalElemDecls.get(name);
- }
-
- /**
- * Convenience method. Returns a top-level element declaration.
- * @param name The name of the declaration.
- * @param namespace The namespace of the definition, otherwise null.
- * @param loc The schema location where the component was defined
- * @return A top-level element declaration or null if such declaration
- * does not exist.
- */
- public XSElementDeclaration getElementDeclaration(String name,
- String namespace,
- String loc) {
- SchemaGrammar sg = (SchemaGrammar)fGrammarMap.get(null2EmptyString(namespace));
- if (sg == null) {
- return null;
- }
- return sg.getGlobalElementDecl(name, loc);
- }
-
- /**
- * Convenience method. Returns a top-level attribute group definition.
- * @param name The name of the definition.
- * @param namespace The namespace of the definition, otherwise null.
- * @return A top-level attribute group definition or null if such
- * definition does not exist.
- */
- public XSAttributeGroupDefinition getAttributeGroup(String name,
- String namespace) {
- SchemaGrammar sg = (SchemaGrammar)fGrammarMap.get(null2EmptyString(namespace));
- if (sg == null) {
- return null;
- }
- return (XSAttributeGroupDefinition)sg.fGlobalAttrGrpDecls.get(name);
- }
-
- /**
- * Convenience method. Returns a top-level attribute group definition.
- * @param name The name of the definition.
- * @param namespace The namespace of the definition, otherwise null.
- * @param loc The schema location where the component was defined
- * @return A top-level attribute group definition or null if such
- * definition does not exist.
- */
- public XSAttributeGroupDefinition getAttributeGroup(String name,
- String namespace,
- String loc) {
- SchemaGrammar sg = (SchemaGrammar)fGrammarMap.get(null2EmptyString(namespace));
- if (sg == null) {
- return null;
- }
- return sg.getGlobalAttributeGroupDecl(name, loc);
- }
-
- /**
- * Convenience method. Returns a top-level model group definition.
- *
- * @param name The name of the definition.
- * @param namespace The namespace of the definition, otherwise null.
- * @return A top-level model group definition definition or null if such
- * definition does not exist.
- */
- public XSModelGroupDefinition getModelGroupDefinition(String name,
- String namespace) {
- SchemaGrammar sg = (SchemaGrammar)fGrammarMap.get(null2EmptyString(namespace));
- if (sg == null) {
- return null;
- }
- return (XSModelGroupDefinition)sg.fGlobalGroupDecls.get(name);
- }
-
- /**
- * Convenience method. Returns a top-level model group definition.
- *
- * @param name The name of the definition.
- * @param namespace The namespace of the definition, otherwise null.
- * @param loc The schema location where the component was defined
- * @return A top-level model group definition definition or null if such
- * definition does not exist.
- */
- public XSModelGroupDefinition getModelGroupDefinition(String name,
- String namespace,
- String loc) {
- SchemaGrammar sg = (SchemaGrammar)fGrammarMap.get(null2EmptyString(namespace));
- if (sg == null) {
- return null;
- }
- return sg.getGlobalGroupDecl(name, loc);
- }
-
-
- /**
- * @see org.apache.xerces.xs.XSModel#getNotationDeclaration(String, String)
- */
- public XSNotationDeclaration getNotationDeclaration(String name,
- String namespace) {
- SchemaGrammar sg = (SchemaGrammar)fGrammarMap.get(null2EmptyString(namespace));
- if (sg == null) {
- return null;
- }
- return (XSNotationDeclaration)sg.fGlobalNotationDecls.get(name);
- }
-
- public XSNotationDeclaration getNotationDeclaration(String name,
- String namespace,
- String loc) {
- SchemaGrammar sg = (SchemaGrammar)fGrammarMap.get(null2EmptyString(namespace));
- if (sg == null) {
- return null;
- }
- return sg.getGlobalNotationDecl(name, loc);
- }
-
- /**
- * [annotations]: a set of annotations if it exists, otherwise an empty
- * <code>XSObjectList</code>.
- */
- public synchronized XSObjectList getAnnotations() {
- if (fAnnotations != null) {
- return fAnnotations;
- }
-
- // do this in two passes to avoid inaccurate array size
- int totalAnnotations = 0;
- for (int i = 0; i < fGrammarCount; i++) {
- totalAnnotations += fGrammarList[i].fNumAnnotations;
- }
- if (totalAnnotations == 0) {
- fAnnotations = XSObjectListImpl.EMPTY_LIST;
- return fAnnotations;
- }
- XSAnnotationImpl [] annotations = new XSAnnotationImpl [totalAnnotations];
- int currPos = 0;
- for (int i = 0; i < fGrammarCount; i++) {
- SchemaGrammar currGrammar = fGrammarList[i];
- if (currGrammar.fNumAnnotations > 0) {
- System.arraycopy(currGrammar.fAnnotations, 0, annotations, currPos, currGrammar.fNumAnnotations);
- currPos += currGrammar.fNumAnnotations;
- }
- }
- fAnnotations = new XSObjectListImpl(annotations, annotations.length);
- return fAnnotations;
- }
-
- private static final String null2EmptyString(String str) {
- return str == null ? XMLSymbols.EMPTY_STRING : str;
- }
-
- /**
- * REVISIT: to expose identity constraints from XSModel.
- * For now, we only expose whether there are any IDCs.
- * We also need to add these methods to the public
- * XSModel interface.
- */
- public boolean hasIDConstraints() {
- return fHasIDC;
- }
-
- /**
- * Convenience method. Returns a list containing the members of the
- * substitution group for the given <code>XSElementDeclaration</code>
- * or an empty <code>XSObjectList</code> if the substitution group
- * contains no members.
- * @param head The substitution group head.
- * @return A list containing the members of the substitution group
- * for the given <code>XSElementDeclaration</code> or an empty
- * <code>XSObjectList</code> if the substitution group contains
- * no members.
- */
- public XSObjectList getSubstitutionGroup(XSElementDeclaration head) {
- return (XSObjectList)fSubGroupMap.get(head);
- }
-
- //
- // XSNamespaceItemList methods
- //
-
- /**
- * The number of <code>XSNamespaceItem</code>s in the list. The range of
- * valid child object indices is 0 to <code>length-1</code> inclusive.
- */
- public int getLength() {
- return fGrammarCount;
- }
-
- /**
- * Returns the <code>index</code>th item in the collection or
- * <code>null</code> if <code>index</code> is greater than or equal to
- * the number of objects in the list. The index starts at 0.
- * @param index index into the collection.
- * @return The <code>XSNamespaceItem</code> at the <code>index</code>th
- * position in the <code>XSNamespaceItemList</code>, or
- * <code>null</code> if the index specified is not valid.
- */
- public XSNamespaceItem item(int index) {
- if (index < 0 || index >= fGrammarCount) {
- return null;
- }
- return fGrammarList[index];
- }
-
- //
- // java.util.List methods
- //
-
- public Object get(int index) {
- if (index >= 0 && index < fGrammarCount) {
- return fGrammarList[index];
- }
- throw new IndexOutOfBoundsException("Index: " + index);
- }
-
- public int size() {
- return getLength();
- }
-
- public Iterator iterator() {
- return listIterator0(0);
- }
-
- public ListIterator listIterator() {
- return listIterator0(0);
- }
-
- public ListIterator listIterator(int index) {
- if (index >= 0 && index < fGrammarCount) {
- return listIterator0(index);
- }
- throw new IndexOutOfBoundsException("Index: " + index);
- }
-
- private ListIterator listIterator0(int index) {
- return new XSNamespaceItemListIterator(index);
- }
-
- public Object[] toArray() {
- Object[] a = new Object[fGrammarCount];
- toArray0(a);
- return a;
- }
-
- public Object[] toArray(Object[] a) {
- if (a.length < fGrammarCount) {
- Class arrayClass = a.getClass();
- Class componentType = arrayClass.getComponentType();
- a = (Object[]) Array.newInstance(componentType, fGrammarCount);
- }
- toArray0(a);
- if (a.length > fGrammarCount) {
- a[fGrammarCount] = null;
- }
- return a;
- }
-
- private void toArray0(Object[] a) {
- if (fGrammarCount > 0) {
- System.arraycopy(fGrammarList, 0, a, 0, fGrammarCount);
- }
- }
-
- private final class XSNamespaceItemListIterator implements ListIterator {
- private int index;
- public XSNamespaceItemListIterator(int index) {
- this.index = index;
- }
- public boolean hasNext() {
- return (index < fGrammarCount);
- }
- public Object next() {
- if (index < fGrammarCount) {
- return fGrammarList[index++];
- }
- throw new NoSuchElementException();
- }
- public boolean hasPrevious() {
- return (index > 0);
- }
- public Object previous() {
- if (index > 0) {
- return fGrammarList[--index];
- }
- throw new NoSuchElementException();
- }
- public int nextIndex() {
- return index;
- }
- public int previousIndex() {
- return index - 1;
- }
- public void remove() {
- throw new UnsupportedOperationException();
- }
- public void set(Object o) {
- throw new UnsupportedOperationException();
- }
- public void add(Object o) {
- throw new UnsupportedOperationException();
- }
- }
-
-} // class XSModelImpl
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/XSNotationDecl.java b/src/com/sun/org/apache/xerces/internal/impl/xs/XSNotationDecl.java
deleted file mode 100644
index 94505f9..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/XSNotationDecl.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs;
-
-import com.sun.org.apache.xerces.internal.impl.xs.util.XSObjectListImpl;
-import com.sun.org.apache.xerces.internal.xs.XSAnnotation;
-import com.sun.org.apache.xerces.internal.xs.XSConstants;
-import com.sun.org.apache.xerces.internal.xs.XSNamespaceItem;
-import com.sun.org.apache.xerces.internal.xs.XSNotationDeclaration;
-import com.sun.org.apache.xerces.internal.xs.XSObjectList;
-
-/**
- * The XML representation for a NOTATION declaration
- * schema component is a global <notation> element information item
- *
- * @xerces.internal
- *
- * @author Rahul Srivastava, Sun Microsystems Inc.
- * @version $Id: XSNotationDecl.java,v 1.7 2010-11-01 04:39:55 joehw Exp $
- */
-public class XSNotationDecl implements XSNotationDeclaration {
-
- // name of the group
- public String fName = null;
- // target namespace of the group
- public String fTargetNamespace = null;
- // public id of the notation
- public String fPublicId = null;
- // system id of the notation
- public String fSystemId = null;
-
- // optional annotation
- public XSObjectList fAnnotations = null;
-
- // The namespace schema information item corresponding to the target namespace
- // of the notation declaration, if it is globally declared; or null otherwise.
- private XSNamespaceItem fNamespaceItem = null;
-
- /**
- * Get the type of the object, i.e ELEMENT_DECLARATION.
- */
- public short getType() {
- return XSConstants.NOTATION_DECLARATION;
- }
-
- /**
- * The <code>name</code> of this <code>XSObject</code> depending on the
- * <code>XSObject</code> type.
- */
- public String getName() {
- return fName;
- }
-
- /**
- * The namespace URI of this node, or <code>null</code> if it is
- * unspecified. defines how a namespace URI is attached to schema
- * components.
- */
- public String getNamespace() {
- return fTargetNamespace;
- }
-
- /**
- * Optional if {public identifier} is present. A URI reference.
- */
- public String getSystemId() {
- return fSystemId;
- }
-
- /**
- * Optional if {system identifier} is present. A public identifier,
- * as defined in [XML 1.0 (Second Edition)].
- */
- public String getPublicId() {
- return fPublicId;
- }
-
- /**
- * Optional. Annotation.
- */
- public XSAnnotation getAnnotation() {
- return (fAnnotations != null) ? (XSAnnotation) fAnnotations.item(0) : null;
- }
-
- /**
- * Optional. Annotations.
- */
- public XSObjectList getAnnotations() {
- return (fAnnotations != null) ? fAnnotations : XSObjectListImpl.EMPTY_LIST;
- }
-
- /**
- * @see org.apache.xerces.xs.XSObject#getNamespaceItem()
- */
- public XSNamespaceItem getNamespaceItem() {
- return fNamespaceItem;
- }
-
- void setNamespaceItem(XSNamespaceItem namespaceItem) {
- fNamespaceItem = namespaceItem;
- }
-
-} // class XSNotationDecl
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/XSParticleDecl.java b/src/com/sun/org/apache/xerces/internal/impl/xs/XSParticleDecl.java
deleted file mode 100644
index 468f652..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/XSParticleDecl.java
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs;
-
-import com.sun.org.apache.xerces.internal.impl.xs.util.XSObjectListImpl;
-import com.sun.org.apache.xerces.internal.xs.XSConstants;
-import com.sun.org.apache.xerces.internal.xs.XSNamespaceItem;
-import com.sun.org.apache.xerces.internal.xs.XSObjectList;
-import com.sun.org.apache.xerces.internal.xs.XSParticle;
-import com.sun.org.apache.xerces.internal.xs.XSTerm;
-
-/**
- * Store schema particle declaration.
- *
- * @xerces.internal
- *
- * @author Sandy Gao, IBM
- *
- * @version $Id: XSParticleDecl.java,v 1.7 2010-11-01 04:39:55 joehw Exp $
- */
-public class XSParticleDecl implements XSParticle {
-
- // types of particles
- public static final short PARTICLE_EMPTY = 0;
- public static final short PARTICLE_ELEMENT = 1;
- public static final short PARTICLE_WILDCARD = 2;
- public static final short PARTICLE_MODELGROUP = 3;
- public static final short PARTICLE_ZERO_OR_MORE = 4;
- public static final short PARTICLE_ZERO_OR_ONE = 5;
- public static final short PARTICLE_ONE_OR_MORE = 6;
-
- // type of the particle
- public short fType = PARTICLE_EMPTY;
-
- // term of the particle
- // for PARTICLE_ELEMENT : the element decl
- // for PARTICLE_WILDCARD: the wildcard decl
- // for PARTICLE_MODELGROUP: the model group
- public XSTerm fValue = null;
-
- // minimum occurrence of this particle
- public int fMinOccurs = 1;
- // maximum occurrence of this particle
- public int fMaxOccurs = 1;
- // optional annotation
- public XSObjectList fAnnotations = null;
-
- // clone this decl
- public XSParticleDecl makeClone() {
- XSParticleDecl particle = new XSParticleDecl();
- particle.fType = fType;
- particle.fMinOccurs = fMinOccurs;
- particle.fMaxOccurs = fMaxOccurs;
- particle.fDescription = fDescription;
- particle.fValue = fValue;
- particle.fAnnotations = fAnnotations;
- return particle;
- }
-
- /**
- * 3.9.6 Schema Component Constraint: Particle Emptiable
- * whether this particle is emptible
- */
- public boolean emptiable() {
- return minEffectiveTotalRange() == 0;
- }
-
- // whether this particle contains nothing
- public boolean isEmpty() {
- if (fType == PARTICLE_EMPTY)
- return true;
- if (fType == PARTICLE_ELEMENT || fType == PARTICLE_WILDCARD)
- return false;
-
- return ((XSModelGroupImpl)fValue).isEmpty();
- }
-
- /**
- * 3.8.6 Effective Total Range (all and sequence) and
- * Effective Total Range (choice)
- * The following methods are used to return min/max range for a particle.
- * They are not exactly the same as it's described in the spec, but all the
- * values from the spec are retrievable by these methods.
- */
- public int minEffectiveTotalRange() {
- if (fType == XSParticleDecl.PARTICLE_EMPTY) {
- return 0;
- }
- if (fType == PARTICLE_MODELGROUP) {
- return ((XSModelGroupImpl)fValue).minEffectiveTotalRange() * fMinOccurs;
- }
- return fMinOccurs;
- }
-
- public int maxEffectiveTotalRange() {
- if (fType == XSParticleDecl.PARTICLE_EMPTY) {
- return 0;
- }
- if (fType == PARTICLE_MODELGROUP) {
- int max = ((XSModelGroupImpl)fValue).maxEffectiveTotalRange();
- if (max == SchemaSymbols.OCCURRENCE_UNBOUNDED)
- return SchemaSymbols.OCCURRENCE_UNBOUNDED;
- if (max != 0 && fMaxOccurs == SchemaSymbols.OCCURRENCE_UNBOUNDED)
- return SchemaSymbols.OCCURRENCE_UNBOUNDED;
- return max * fMaxOccurs;
- }
- return fMaxOccurs;
- }
-
- /**
- * get the string description of this particle
- */
- private String fDescription = null;
- public String toString() {
- if (fDescription == null) {
- StringBuffer buffer = new StringBuffer();
- appendParticle(buffer);
- if (!(fMinOccurs == 0 && fMaxOccurs == 0 ||
- fMinOccurs == 1 && fMaxOccurs == 1)) {
- buffer.append('{').append(fMinOccurs);
- if (fMaxOccurs == SchemaSymbols.OCCURRENCE_UNBOUNDED)
- buffer.append("-UNBOUNDED");
- else if (fMinOccurs != fMaxOccurs)
- buffer.append('-').append(fMaxOccurs);
- buffer.append('}');
- }
- fDescription = buffer.toString();
- }
- return fDescription;
- }
-
- /**
- * append the string description of this particle to the string buffer
- * this is for error message.
- */
- void appendParticle(StringBuffer buffer) {
- switch (fType) {
- case PARTICLE_EMPTY:
- buffer.append("EMPTY");
- break;
- case PARTICLE_ELEMENT:
- buffer.append(fValue.toString());
- break;
- case PARTICLE_WILDCARD:
- buffer.append('(');
- buffer.append(fValue.toString());
- buffer.append(')');
- break;
- case PARTICLE_MODELGROUP:
- buffer.append(fValue.toString());
- break;
- }
- }
-
- public void reset(){
- fType = PARTICLE_EMPTY;
- fValue = null;
- fMinOccurs = 1;
- fMaxOccurs = 1;
- fDescription = null;
- fAnnotations = null;
- }
-
- /**
- * Get the type of the object, i.e ELEMENT_DECLARATION.
- */
- public short getType() {
- return XSConstants.PARTICLE;
- }
-
- /**
- * The <code>name</code> of this <code>XSObject</code> depending on the
- * <code>XSObject</code> type.
- */
- public String getName() {
- return null;
- }
-
- /**
- * The namespace URI of this node, or <code>null</code> if it is
- * unspecified. defines how a namespace URI is attached to schema
- * components.
- */
- public String getNamespace() {
- return null;
- }
-
- /**
- * {min occurs} determines the minimum number of terms that can occur.
- */
- public int getMinOccurs() {
- return fMinOccurs;
- }
-
- /**
- * {max occurs} whether the maxOccurs value is unbounded.
- */
- public boolean getMaxOccursUnbounded() {
- return fMaxOccurs == SchemaSymbols.OCCURRENCE_UNBOUNDED;
- }
-
- /**
- * {max occurs} determines the maximum number of terms that can occur.
- */
- public int getMaxOccurs() {
- return fMaxOccurs;
- }
-
- /**
- * {term} One of a model group, a wildcard, or an element declaration.
- */
- public XSTerm getTerm() {
- return fValue;
- }
-
- /**
- * @see org.apache.xerces.xs.XSObject#getNamespaceItem()
- */
- public XSNamespaceItem getNamespaceItem() {
- return null;
- }
-
- /**
- * Optional. Annotations.
- */
- public XSObjectList getAnnotations() {
- return (fAnnotations != null) ? fAnnotations : XSObjectListImpl.EMPTY_LIST;
- }
-
-} // class XSParticleDecl
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/XSWildcardDecl.java b/src/com/sun/org/apache/xerces/internal/impl/xs/XSWildcardDecl.java
deleted file mode 100644
index ac3a00e..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/XSWildcardDecl.java
+++ /dev/null
@@ -1,599 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs;
-
-import com.sun.org.apache.xerces.internal.impl.xs.util.StringListImpl;
-import com.sun.org.apache.xerces.internal.impl.xs.util.XSObjectListImpl;
-import com.sun.org.apache.xerces.internal.xs.StringList;
-import com.sun.org.apache.xerces.internal.xs.XSAnnotation;
-import com.sun.org.apache.xerces.internal.xs.XSConstants;
-import com.sun.org.apache.xerces.internal.xs.XSNamespaceItem;
-import com.sun.org.apache.xerces.internal.xs.XSWildcard;
-import com.sun.org.apache.xerces.internal.xs.XSObjectList;
-
-/**
- * The XML representation for a wildcard declaration
- * schema component is an <any> or <anyAttribute> element information item
- *
- * @xerces.internal
- *
- * @author Sandy Gao, IBM
- * @author Rahul Srivastava, Sun Microsystems Inc.
- *
- * @version $Id: XSWildcardDecl.java,v 1.7 2010-11-01 04:39:55 joehw Exp $
- */
-public class XSWildcardDecl implements XSWildcard {
-
- public static final String ABSENT = null;
-
- // the type of wildcard: any, other, or list
- public short fType = NSCONSTRAINT_ANY;
- // the type of process contents: strict, lax, or skip
- public short fProcessContents = PC_STRICT;
- // the namespace list:
- // for NSCONSTRAINT_LIST, it means one of the namespaces in the list
- // for NSCONSTRAINT_NOT, it means not any of the namespaces in the list
- public String[] fNamespaceList;
-
- // optional annotation
- public XSObjectList fAnnotations = null;
-
- // I'm trying to implement the following constraint exactly as what the
- // spec describes. Sometimes it seems redundant, and sometimes there seems
- // to be much easier solutions. But it makes it easy to understand,
- // easy to maintain, and easy to find a bug (either in the code, or in the
- // spec). -SG
- //
- // NOTE: Schema spec only requires that ##other not(tNS,absent).
- // The way we store ##other is not(NS1,NS2,...,NSN), which covers
- // what's required by Schema, and allows future enhanced features.
- //
- // In the following in-line comments:
- // - Bullet removed from w3c specification.
- // + Bullet added as proposed by Sandy Gao, IBM.
- // / Since we store ##other as not(NS1,NS2,...,NSN), we need to put some
- // comments on where we didn't follow the spec exactly.
- // * When we really support not(NS1,NS2,...,NSN), we need to revisit these items.
-
- /**
- * Validation Rule: Wildcard allows Namespace Name
- */
- public boolean allowNamespace(String namespace) {
- // For a value which is either a namespace name or absent to be valid with respect to a wildcard constraint (the value of a {namespace constraint}) one of the following must be true:
-
- // 1 The constraint must be any.
- if (fType == NSCONSTRAINT_ANY)
- return true;
-
- // 2 All of the following must be true:
- // 2.1 The constraint is a pair of not and a namespace name or absent ([Definition:] call this the namespace test).
- // 2.2 The value must not be identical to the namespace test.
- // 2.3 The value must not be absent.
- // / we store ##other as not(list), so our actual rule is
- // / 2 The constraint is a pair of not and a set, and the value is not in such set.
- if (fType == NSCONSTRAINT_NOT) {
- boolean found = false;
- int listNum = fNamespaceList.length;
- for (int i = 0; i < listNum && !found; i++) {
- if (namespace == fNamespaceList[i])
- found = true;
- }
-
- if (!found)
- return true;
- }
-
- // 3 The constraint is a set, and the value is identical to one of the members of the set.
- if (fType == NSCONSTRAINT_LIST) {
- int listNum = fNamespaceList.length;
- for (int i = 0; i < listNum; i++) {
- if (namespace == fNamespaceList[i])
- return true;
- }
- }
-
- // none of the above conditions applied, so return false.
- return false;
- }
-
- /**
- * Schema Component Constraint: Wildcard Subset
- */
- public boolean isSubsetOf(XSWildcardDecl superWildcard) {
- // if the super is null (not expressible), return false
- if (superWildcard == null)
- return false;
-
- // For a namespace constraint (call it sub) to be an intensional subset of another
- // namespace constraint (call it super) one of the following must be true:
-
- // 1 super must be any.
- if (superWildcard.fType == NSCONSTRAINT_ANY) {
- return true;
- }
-
- // 2 All of the following must be true:
- // 2.1 sub must be a pair of not and a namespace name or absent.
- // 2.2 super must be a pair of not and the same value.
- // * we can't just compare whether the namespace are the same value
- // since we store other as not(list)
- if (fType == NSCONSTRAINT_NOT) {
- if (superWildcard.fType == NSCONSTRAINT_NOT &&
- fNamespaceList[0] == superWildcard.fNamespaceList[0]) {
- return true;
- }
- }
-
- // 3 All of the following must be true:
- // 3.1 sub must be a set whose members are either namespace names or absent.
- // 3.2 One of the following must be true:
- // 3.2.1 super must be the same set or a superset thereof.
- // -3.2.2 super must be a pair of not and a namespace name or absent and
- // that value must not be in sub's set.
- // +3.2.2 super must be a pair of not and a namespace name or absent and
- // either that value or absent must not be in sub's set.
- // * since we store ##other as not(list), we acturally need to make sure
- // that none of the namespaces in super.list is in sub.list.
- if (fType == NSCONSTRAINT_LIST) {
- if (superWildcard.fType == NSCONSTRAINT_LIST &&
- subset2sets(fNamespaceList, superWildcard.fNamespaceList)) {
- return true;
- }
-
- if (superWildcard.fType == NSCONSTRAINT_NOT &&
- !elementInSet(superWildcard.fNamespaceList[0], fNamespaceList) &&
- !elementInSet(ABSENT, fNamespaceList)) {
- return true;
- }
- }
-
- // none of the above conditions applied, so return false.
- return false;
-
- } // isSubsetOf
-
- /**
- * Check whether this wildcard has a weaker process contents than the super.
- */
- public boolean weakerProcessContents(XSWildcardDecl superWildcard) {
- return fProcessContents == XSWildcardDecl.PC_LAX &&
- superWildcard.fProcessContents == XSWildcardDecl.PC_STRICT ||
- fProcessContents == XSWildcardDecl.PC_SKIP &&
- superWildcard.fProcessContents != XSWildcardDecl.PC_SKIP;
- }
-
- /**
- * Schema Component Constraint: Attribute Wildcard Union
- */
- public XSWildcardDecl performUnionWith(XSWildcardDecl wildcard,
- short processContents) {
- // if the other wildcard is not expressible, the result is still not expressible
- if (wildcard == null)
- return null;
-
- // For a wildcard's {namespace constraint} value to be the intensional union of two
- // other such values (call them O1 and O2): the appropriate case among the following
- // must be true:
-
- XSWildcardDecl unionWildcard = new XSWildcardDecl();
- unionWildcard.fProcessContents = processContents;
-
- // 1 If O1 and O2 are the same value, then that value must be the value.
- if (areSame(wildcard)) {
- unionWildcard.fType = fType;
- unionWildcard.fNamespaceList = fNamespaceList;
- }
-
- // 2 If either O1 or O2 is any, then any must be the value.
- else if ( (fType == NSCONSTRAINT_ANY) || (wildcard.fType == NSCONSTRAINT_ANY) ) {
- unionWildcard.fType = NSCONSTRAINT_ANY;
- }
-
- // 3 If both O1 and O2 are sets of (namespace names or absent), then the union of
- // those sets must be the value.
- else if ( (fType == NSCONSTRAINT_LIST) && (wildcard.fType == NSCONSTRAINT_LIST) ) {
- unionWildcard.fType = NSCONSTRAINT_LIST;
- unionWildcard.fNamespaceList = union2sets(fNamespaceList, wildcard.fNamespaceList);
- }
-
- // -4 If the two are negations of different namespace names, then the intersection
- // is not expressible.
- // +4 If the two are negations of different namespace names or absent, then
- // a pair of not and absent must be the value.
- // * now we store ##other as not(list), the result should be
- // not(intersection of two lists).
- else if (fType == NSCONSTRAINT_NOT && wildcard.fType == NSCONSTRAINT_NOT) {
- unionWildcard.fType = NSCONSTRAINT_NOT;
- unionWildcard.fNamespaceList = new String[2];
- unionWildcard.fNamespaceList[0] = ABSENT;
- unionWildcard.fNamespaceList[1] = ABSENT;
- }
-
- // 5 If either O1 or O2 is a pair of not and a namespace name and the other is a set of
- // (namespace names or absent), then The appropriate case among the following must be true:
- // -5.1 If the set includes the negated namespace name, then any must be the value.
- // -5.2 If the set does not include the negated namespace name, then whichever of O1 or O2
- // is a pair of not and a namespace name must be the value.
- // +5.1 If the negated value is a namespace name, then The appropriate case
- // among the following must be true:
- // +5.1.1 If the set includes both the namespace name and absent, then any
- // must be the value.
- // +5.1.2 If the set includes the namespace name but does not include
- // absent, then a pair of not and absent must be the value.
- // +5.1.3 If the set does not include the namespace name but includes
- // absent, then the union is not expressible.
- // +5.1.4 If the set does not include either the namespace name or absent,
- // then whichever of O1 or O2 is a pair of not and a namespace name must be
- // the value.
- // +5.2 If the negated value is absent, then The appropriate case among the
- // following must be true:
- // +5.2.1 If the set includes absent, then any must be the value.
- // +5.2.2 If the set does not include absent, then whichever of O1 or O2 is
- // a pair of not and a namespace name must be the value.
- // * when we have not(list), the operation is just not(otherlist-list)
- else if ( ((fType == NSCONSTRAINT_NOT) && (wildcard.fType == NSCONSTRAINT_LIST)) ||
- ((fType == NSCONSTRAINT_LIST) && (wildcard.fType == NSCONSTRAINT_NOT)) ) {
- String[] other = null;
- String[] list = null;
-
- if (fType == NSCONSTRAINT_NOT) {
- other = fNamespaceList;
- list = wildcard.fNamespaceList;
- }
- else {
- other = wildcard.fNamespaceList;
- list = fNamespaceList;
- }
-
- boolean foundAbsent = elementInSet(ABSENT, list);
-
- if (other[0] != ABSENT) {
- boolean foundNS = elementInSet(other[0], list);
- if (foundNS && foundAbsent) {
- unionWildcard.fType = NSCONSTRAINT_ANY;
- } else if (foundNS && !foundAbsent) {
- unionWildcard.fType = NSCONSTRAINT_NOT;
- unionWildcard.fNamespaceList = new String[2];
- unionWildcard.fNamespaceList[0] = ABSENT;
- unionWildcard.fNamespaceList[1] = ABSENT;
- } else if (!foundNS && foundAbsent) {
- return null;
- } else { // !foundNS && !foundAbsent
- unionWildcard.fType = NSCONSTRAINT_NOT;
- unionWildcard.fNamespaceList = other;
- }
- } else { // other[0] == ABSENT
- if (foundAbsent) {
- unionWildcard.fType = NSCONSTRAINT_ANY;
- } else { // !foundAbsent
- unionWildcard.fType = NSCONSTRAINT_NOT;
- unionWildcard.fNamespaceList = other;
- }
- }
- }
-
- return unionWildcard;
-
- } // performUnionWith
-
- /**
- * Schema Component Constraint: Attribute Wildcard Intersection
- */
- public XSWildcardDecl performIntersectionWith(XSWildcardDecl wildcard,
- short processContents) {
- // if the other wildcard is not expressible, the result is still not expressible
- if (wildcard == null)
- return null;
-
- // For a wildcard's {namespace constraint} value to be the intensional intersection of
- // two other such values (call them O1 and O2): the appropriate case among the following
- // must be true:
-
- XSWildcardDecl intersectWildcard = new XSWildcardDecl();
- intersectWildcard.fProcessContents = processContents;
-
- // 1 If O1 and O2 are the same value, then that value must be the value.
- if (areSame(wildcard)) {
- intersectWildcard.fType = fType;
- intersectWildcard.fNamespaceList = fNamespaceList;
- }
-
- // 2 If either O1 or O2 is any, then the other must be the value.
- else if ( (fType == NSCONSTRAINT_ANY) || (wildcard.fType == NSCONSTRAINT_ANY) ) {
- // both cannot be ANY, if we have reached here.
- XSWildcardDecl other = this;
-
- if (fType == NSCONSTRAINT_ANY)
- other = wildcard;
-
- intersectWildcard.fType = other.fType;
- intersectWildcard.fNamespaceList = other.fNamespaceList;
- }
-
- // -3 If either O1 or O2 is a pair of not and a namespace name and the other is a set of
- // (namespace names or absent), then that set, minus the negated namespace name if
- // it was in the set, must be the value.
- // +3 If either O1 or O2 is a pair of not and a namespace name and the other
- // is a set of (namespace names or absent), then that set, minus the negated
- // namespace name if it was in the set, then minus absent if it was in the
- // set, must be the value.
- // * when we have not(list), the operation is just list-otherlist
- else if ( ((fType == NSCONSTRAINT_NOT) && (wildcard.fType == NSCONSTRAINT_LIST)) ||
- ((fType == NSCONSTRAINT_LIST) && (wildcard.fType == NSCONSTRAINT_NOT)) ) {
- String[] list = null;
- String[] other = null;
-
- if (fType == NSCONSTRAINT_NOT) {
- other = fNamespaceList;
- list = wildcard.fNamespaceList;
- }
- else {
- other = wildcard.fNamespaceList;
- list = fNamespaceList;
- }
-
- int listSize = list.length;
- String[] intersect = new String[listSize];
- int newSize = 0;
- for (int i = 0; i < listSize; i++) {
- if (list[i] != other[0] && list[i] != ABSENT)
- intersect[newSize++] = list[i];
- }
-
- intersectWildcard.fType = NSCONSTRAINT_LIST;
- intersectWildcard.fNamespaceList = new String[newSize];
- System.arraycopy(intersect, 0, intersectWildcard.fNamespaceList, 0, newSize);
- }
-
- // 4 If both O1 and O2 are sets of (namespace names or absent), then the intersection of those
- // sets must be the value.
- else if ( (fType == NSCONSTRAINT_LIST) && (wildcard.fType == NSCONSTRAINT_LIST) ) {
- intersectWildcard.fType = NSCONSTRAINT_LIST;
- intersectWildcard.fNamespaceList = intersect2sets(fNamespaceList, wildcard.fNamespaceList);
- }
-
- // -5 If the two are negations of different namespace names, then the intersection is not expressible.
- // +5 If the two are negations of namespace names or absent, then The
- // appropriate case among the following must be true:
- // +5.1 If the two are negations of different namespace names, then the
- // intersection is not expressible.
- // +5.2 If one of the two is a pair of not and absent, the other must be
- // the value.
- // * when we have not(list), the operation is just not(onelist+otherlist)
- else if (fType == NSCONSTRAINT_NOT && wildcard.fType == NSCONSTRAINT_NOT) {
- if (fNamespaceList[0] != ABSENT && wildcard.fNamespaceList[0] != ABSENT)
- return null;
-
- XSWildcardDecl other = this;
- if (fNamespaceList[0] == ABSENT)
- other = wildcard;
-
- intersectWildcard.fType = other.fType;
- intersectWildcard.fNamespaceList = other.fNamespaceList;
- }
-
- return intersectWildcard;
-
- } // performIntersectionWith
-
- private boolean areSame(XSWildcardDecl wildcard) {
- if (fType == wildcard.fType) {
- // ##any, true
- if (fType == NSCONSTRAINT_ANY)
- return true;
-
- // ##other, only check the negated value
- // * when we support not(list), we need to check in the same way
- // as for NSCONSTRAINT_LIST.
- if (fType == NSCONSTRAINT_NOT)
- return fNamespaceList[0] == wildcard.fNamespaceList[0];
-
- // ## list, must have the same length,
- // and each item in one list must appear in the other one
- // (we are assuming that there are no duplicate items in a list)
- if (fNamespaceList.length == wildcard.fNamespaceList.length) {
- for (int i=0; i<fNamespaceList.length; i++) {
- if (!elementInSet(fNamespaceList[i], wildcard.fNamespaceList))
- return false;
- }
- return true;
- }
- }
-
- return false;
- } // areSame
-
- String[] intersect2sets(String[] one, String[] theOther){
- String[] result = new String[Math.min(one.length,theOther.length)];
-
- // simple implemention,
- int count = 0;
- for (int i=0; i<one.length; i++) {
- if (elementInSet(one[i], theOther))
- result[count++] = one[i];
- }
-
- String[] result2 = new String[count];
- System.arraycopy(result, 0, result2, 0, count);
-
- return result2;
- }
-
- String[] union2sets(String[] one, String[] theOther){
- String[] result1 = new String[one.length];
-
- // simple implemention,
- int count = 0;
- for (int i=0; i<one.length; i++) {
- if (!elementInSet(one[i], theOther))
- result1[count++] = one[i];
- }
-
- String[] result2 = new String[count+theOther.length];
- System.arraycopy(result1, 0, result2, 0, count);
- System.arraycopy(theOther, 0, result2, count, theOther.length);
-
- return result2;
- }
-
- boolean subset2sets(String[] subSet, String[] superSet){
- for (int i=0; i<subSet.length; i++) {
- if (!elementInSet(subSet[i], superSet))
- return false;
- }
-
- return true;
- }
-
- boolean elementInSet(String ele, String[] set){
- boolean found = false;
- for (int i=0; i<set.length && !found; i++) {
- if (ele==set[i])
- found = true;
- }
-
- return found;
- }
-
- /**
- * get the string description of this wildcard
- */
- private String fDescription = null;
- public String toString() {
- if (fDescription == null) {
- StringBuffer buffer = new StringBuffer();
- buffer.append("WC[");
- switch (fType) {
- case NSCONSTRAINT_ANY:
- buffer.append(SchemaSymbols.ATTVAL_TWOPOUNDANY);
- break;
- case NSCONSTRAINT_NOT:
- buffer.append(SchemaSymbols.ATTVAL_TWOPOUNDOTHER);
- buffer.append(":\"");
- if (fNamespaceList[0] != null)
- buffer.append(fNamespaceList[0]);
- buffer.append("\"");
- break;
- case NSCONSTRAINT_LIST:
- if (fNamespaceList.length == 0)
- break;
- buffer.append("\"");
- if (fNamespaceList[0] != null)
- buffer.append(fNamespaceList[0]);
- buffer.append("\"");
- for (int i = 1; i < fNamespaceList.length; i++) {
- buffer.append(",\"");
- if (fNamespaceList[i] != null)
- buffer.append(fNamespaceList[i]);
- buffer.append("\"");
- }
- break;
- }
- buffer.append(']');
- fDescription = buffer.toString();
- }
-
- return fDescription;
- }
-
- /**
- * Get the type of the object, i.e ELEMENT_DECLARATION.
- */
- public short getType() {
- return XSConstants.WILDCARD;
- }
-
- /**
- * The <code>name</code> of this <code>XSObject</code> depending on the
- * <code>XSObject</code> type.
- */
- public String getName() {
- return null;
- }
-
- /**
- * The namespace URI of this node, or <code>null</code> if it is
- * unspecified. defines how a namespace URI is attached to schema
- * components.
- */
- public String getNamespace() {
- return null;
- }
-
- /**
- * Namespace constraint: A constraint type: any, not, list.
- */
- public short getConstraintType() {
- return fType;
- }
-
- /**
- * Namespace constraint. For <code>constraintType</code>
- * LIST_NSCONSTRAINT, the list contains allowed namespaces. For
- * <code>constraintType</code> NOT_NSCONSTRAINT, the list contains
- * disallowed namespaces.
- */
- public StringList getNsConstraintList() {
- return new StringListImpl(fNamespaceList, fNamespaceList == null ? 0 : fNamespaceList.length);
- }
-
- /**
- * {process contents} One of skip, lax or strict. Valid constants values
- * are: PC_SKIP, PC_LAX, PC_STRICT.
- */
- public short getProcessContents() {
- return fProcessContents;
- }
-
- /**
- * String valid of {process contents}. One of "skip", "lax" or "strict".
- */
- public String getProcessContentsAsString() {
- switch (fProcessContents) {
- case XSWildcardDecl.PC_SKIP: return "skip";
- case XSWildcardDecl.PC_LAX: return "lax";
- case XSWildcardDecl.PC_STRICT: return "strict";
- default: return "invalid value";
- }
- }
-
- /**
- * Optional. Annotation.
- */
- public XSAnnotation getAnnotation() {
- return (fAnnotations != null) ? (XSAnnotation) fAnnotations.item(0) : null;
- }
-
- /**
- * Optional. Annotations.
- */
- public XSObjectList getAnnotations() {
- return (fAnnotations != null) ? fAnnotations : XSObjectListImpl.EMPTY_LIST;
- }
-
- /**
- * @see org.apache.xerces.xs.XSObject#getNamespaceItem()
- */
- public XSNamespaceItem getNamespaceItem() {
- return null;
- }
-
-} // class XSWildcardDecl
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/identity/Field.java b/src/com/sun/org/apache/xerces/internal/impl/xs/identity/Field.java
deleted file mode 100644
index ca968f8..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/identity/Field.java
+++ /dev/null
@@ -1,249 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.identity;
-
-import com.sun.org.apache.xerces.internal.impl.xpath.XPathException;
-import com.sun.org.apache.xerces.internal.impl.xs.util.ShortListImpl;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-import com.sun.org.apache.xerces.internal.xs.ShortList;
-import com.sun.org.apache.xerces.internal.xs.XSComplexTypeDefinition;
-import com.sun.org.apache.xerces.internal.xs.XSConstants;
-import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
-
-/**
- * Schema identity constraint field.
- *
- * @xerces.internal
- *
- * @author Andy Clark, IBM
- * @version $Id: Field.java,v 1.6 2010-11-01 04:39:57 joehw Exp $
- */
-public class Field {
-
- //
- // Data
- //
-
- /** Field XPath. */
- protected Field.XPath fXPath;
-
-
- /** Identity constraint. */
- protected IdentityConstraint fIdentityConstraint;
-
- //
- // Constructors
- //
-
- /** Constructs a field. */
- public Field(Field.XPath xpath,
- IdentityConstraint identityConstraint) {
- fXPath = xpath;
- fIdentityConstraint = identityConstraint;
- } // <init>(Field.XPath,IdentityConstraint)
-
- //
- // Public methods
- //
-
- /** Returns the field XPath. */
- public com.sun.org.apache.xerces.internal.impl.xpath.XPath getXPath() {
- return fXPath;
- } // getXPath():com.sun.org.apache.xerces.internal.impl.v1.schema.identity.XPath
-
- /** Returns the identity constraint. */
- public IdentityConstraint getIdentityConstraint() {
- return fIdentityConstraint;
- } // getIdentityConstraint():IdentityConstraint
-
- // factory method
-
- /** Creates a field matcher. */
- public XPathMatcher createMatcher(FieldActivator activator, ValueStore store) {
- return new Field.Matcher(fXPath, activator, store);
- } // createMatcher(ValueStore):XPathMatcher
-
- //
- // Object methods
- //
-
- /** Returns a string representation of this object. */
- public String toString() {
- return fXPath.toString();
- } // toString():String
-
- //
- // Classes
- //
-
- /**
- * Field XPath.
- *
- * @author Andy Clark, IBM
- */
- public static class XPath
- extends com.sun.org.apache.xerces.internal.impl.xpath.XPath {
-
- //
- // Constructors
- //
-
- /** Constructs a field XPath expression. */
- public XPath(String xpath,
- SymbolTable symbolTable,
- NamespaceContext context) throws XPathException {
- // NOTE: We have to prefix the field XPath with "./" in
- // order to handle selectors such as "@attr" that
- // select the attribute because the fields could be
- // relative to the selector element. -Ac
- // Unless xpath starts with a descendant node -Achille Fokoue
- // ... or a / or a . - NG
- super(((xpath.trim().startsWith("/") ||xpath.trim().startsWith("."))?
- xpath:"./"+xpath),
- symbolTable, context);
-
- // verify that only one attribute is selected per branch
- for (int i=0;i<fLocationPaths.length;i++) {
- for(int j=0; j<fLocationPaths[i].steps.length; j++) {
- com.sun.org.apache.xerces.internal.impl.xpath.XPath.Axis axis =
- fLocationPaths[i].steps[j].axis;
- if (axis.type == XPath.Axis.ATTRIBUTE &&
- (j < fLocationPaths[i].steps.length-1)) {
- throw new XPathException("c-fields-xpaths");
- }
- }
- }
- } // <init>(String,SymbolTable,NamespacesContext)
-
- } // class XPath
-
- /**
- * Field matcher.
- *
- * @author Andy Clark, IBM
- */
- protected class Matcher
- extends XPathMatcher {
-
- //
- // Data
- //
-
- /** Field activator. */
- protected FieldActivator fFieldActivator;
-
- /** Value store for data values. */
- protected ValueStore fStore;
-
- //
- // Constructors
- //
-
- /** Constructs a field matcher. */
- public Matcher(Field.XPath xpath, FieldActivator activator, ValueStore store) {
- super(xpath);
- fFieldActivator = activator;
- fStore = store;
- } // <init>(Field.XPath,ValueStore)
-
- //
- // XPathHandler methods
- //
-
- /**
- * This method is called when the XPath handler matches the
- * XPath expression.
- */
- protected void matched(Object actualValue, short valueType, ShortList itemValueType, boolean isNil) {
- super.matched(actualValue, valueType, itemValueType, isNil);
- if(isNil && (fIdentityConstraint.getCategory() == IdentityConstraint.IC_KEY)) {
- String code = "KeyMatchesNillable";
- fStore.reportError(code,
- new Object[]{fIdentityConstraint.getElementName(), fIdentityConstraint.getIdentityConstraintName()});
- }
- fStore.addValue(Field.this, actualValue, convertToPrimitiveKind(valueType), convertToPrimitiveKind(itemValueType));
- // once we've stored the value for this field, we set the mayMatch
- // member to false so that, in the same scope, we don't match any more
- // values (and throw an error instead).
- fFieldActivator.setMayMatch(Field.this, Boolean.FALSE);
- } // matched(String)
-
- private short convertToPrimitiveKind(short valueType) {
- /** Primitive datatypes. */
- if (valueType <= XSConstants.NOTATION_DT) {
- return valueType;
- }
- /** Types derived from string. */
- if (valueType <= XSConstants.ENTITY_DT) {
- return XSConstants.STRING_DT;
- }
- /** Types derived from decimal. */
- if (valueType <= XSConstants.POSITIVEINTEGER_DT) {
- return XSConstants.DECIMAL_DT;
- }
- /** Other types. */
- return valueType;
- }
-
- private ShortList convertToPrimitiveKind(ShortList itemValueType) {
- if (itemValueType != null) {
- int i;
- final int length = itemValueType.getLength();
- for (i = 0; i < length; ++i) {
- short type = itemValueType.item(i);
- if (type != convertToPrimitiveKind(type)) {
- break;
- }
- }
- if (i != length) {
- final short [] arr = new short[length];
- for (int j = 0; j < i; ++j) {
- arr[j] = itemValueType.item(j);
- }
- for(; i < length; ++i) {
- arr[i] = convertToPrimitiveKind(itemValueType.item(i));
- }
- return new ShortListImpl(arr, arr.length);
- }
- }
- return itemValueType;
- }
-
- protected void handleContent(XSTypeDefinition type, boolean nillable, Object actualValue, short valueType, ShortList itemValueType) {
- if (type == null ||
- type.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE &&
- ((XSComplexTypeDefinition) type).getContentType()
- != XSComplexTypeDefinition.CONTENTTYPE_SIMPLE) {
-
- // the content must be simpleType content
- fStore.reportError( "cvc-id.3", new Object[] {
- fIdentityConstraint.getName(),
- fIdentityConstraint.getElementName()});
-
- }
- fMatchedString = actualValue;
- matched(fMatchedString, valueType, itemValueType, nillable);
- } // handleContent(XSElementDecl, String)
-
- } // class Matcher
-
-} // class Field
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/identity/FieldActivator.java b/src/com/sun/org/apache/xerces/internal/impl/xs/identity/FieldActivator.java
deleted file mode 100644
index fa5bd05..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/identity/FieldActivator.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001,2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.identity;
-
-
-/**
- * Interface for a field activator. The field activator is responsible
- * for activating fields within a specific scope; the caller merely
- * requests the fields to be activated.
- *
- * @xerces.internal
- *
- * @author Andy Clark, IBM
- *
- */
-public interface FieldActivator {
-
- //
- // FieldActivator methods
- //
-
- /**
- * Start the value scope for the specified identity constraint. This
- * method is called when the selector matches in order to initialize
- * the value store.
- *
- * @param identityConstraint The identity constraint.
- * @param initialDepth the depth at which the selector began matching
- */
- public void startValueScopeFor(IdentityConstraint identityConstraint,
- int initialDepth);
-
- /**
- * Request to activate the specified field. This method returns the
- * matcher for the field.
- * It's also important for the implementor to ensure that it marks whether a Field
- * is permitted to match a value--that is, to call the setMayMatch(Field, Boolean) method.
- *
- * @param field The field to activate.
- * @param initialDepth the 0-indexed depth in the instance document at which the Selector began to match.
- */
- public XPathMatcher activateField(Field field, int initialDepth);
-
- /**
- * Sets whether the given field is permitted to match a value.
- * This should be used to catch instance documents that try
- * and match a field several times in the same scope.
- *
- * @param field The field that may be permitted to be matched.
- * @param state Boolean indiciating whether the field may be matched.
- */
- public void setMayMatch(Field field, Boolean state);
-
- /**
- * Returns whether the given field is permitted to match a value.
- *
- * @param field The field that may be permitted to be matched.
- * @return Boolean indicating whether the field may be matched.
- */
- public Boolean mayMatch(Field field);
-
- /**
- * Ends the value scope for the specified identity constraint.
- *
- * @param identityConstraint The identity constraint.
- * @param initialDepth the 0-indexed depth where the Selector began to match.
- */
- public void endValueScopeFor(IdentityConstraint identityConstraint, int initialDepth);
-
-} // interface FieldActivator
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/identity/IdentityConstraint.java b/src/com/sun/org/apache/xerces/internal/impl/xs/identity/IdentityConstraint.java
deleted file mode 100644
index d62dc05..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/identity/IdentityConstraint.java
+++ /dev/null
@@ -1,250 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.identity;
-
-import com.sun.org.apache.xerces.internal.xs.XSIDCDefinition;
-import com.sun.org.apache.xerces.internal.xs.StringList;
-import com.sun.org.apache.xerces.internal.xs.XSNamespaceItem;
-import com.sun.org.apache.xerces.internal.xs.XSObjectList;
-import com.sun.org.apache.xerces.internal.xs.XSConstants;
-import com.sun.org.apache.xerces.internal.impl.xs.util.StringListImpl;
-import com.sun.org.apache.xerces.internal.impl.xs.util.XSObjectListImpl;
-import com.sun.org.apache.xerces.internal.impl.xs.XSAnnotationImpl;
-
-/**
- * Base class of Schema identity constraint.
- *
- * @xerces.internal
- *
- * @author Andy Clark, IBM
- */
-public abstract class IdentityConstraint implements XSIDCDefinition {
-
- //
- // Data
- //
-
- /** type */
- protected short type;
-
- /** target namespace */
- protected String fNamespace;
-
- /** Identity constraint name. */
- protected String fIdentityConstraintName;
-
- /** name of owning element */
- protected String fElementName;
-
- /** Selector. */
- protected Selector fSelector;
-
- /** Field count. */
- protected int fFieldCount;
-
- /** Fields. */
- protected Field[] fFields;
-
- // optional annotations
- protected XSAnnotationImpl [] fAnnotations = null;
-
- // number of annotations in this identity constraint
- protected int fNumAnnotations;
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- protected IdentityConstraint(String namespace, String identityConstraintName, String elemName) {
- fNamespace = namespace;
- fIdentityConstraintName = identityConstraintName;
- fElementName = elemName;
- } // <init>(String,String)
-
- //
- // Public methods
- //
-
- /** Returns the identity constraint name. */
- public String getIdentityConstraintName() {
- return fIdentityConstraintName;
- } // getIdentityConstraintName():String
-
- /** Sets the selector. */
- public void setSelector(Selector selector) {
- fSelector = selector;
- } // setSelector(Selector)
-
- /** Returns the selector. */
- public Selector getSelector() {
- return fSelector;
- } // getSelector():Selector
-
- /** Adds a field. */
- public void addField(Field field) {
- if (fFields == null)
- fFields = new Field[4];
- else if (fFieldCount == fFields.length)
- fFields = resize(fFields, fFieldCount*2);
- fFields[fFieldCount++] = field;
- } // addField(Field)
-
- /** Returns the field count. */
- public int getFieldCount() {
- return fFieldCount;
- } // getFieldCount():int
-
- /** Returns the field at the specified index. */
- public Field getFieldAt(int index) {
- return fFields[index];
- } // getFieldAt(int):Field
-
- // get the name of the owning element
- public String getElementName () {
- return fElementName;
- } // getElementName(): String
-
- //
- // Object methods
- //
-
- /** Returns a string representation of this object. */
- public String toString() {
- String s = super.toString();
- int index1 = s.lastIndexOf('$');
- if (index1 != -1) {
- return s.substring(index1 + 1);
- }
- int index2 = s.lastIndexOf('.');
- if (index2 != -1) {
- return s.substring(index2 + 1);
- }
- return s;
- } // toString():String
-
- // equals: returns true if and only if the String
- // representations of all members of both objects (except for
- // the elenemtName field) are equal.
- public boolean equals(IdentityConstraint id) {
- boolean areEqual = fIdentityConstraintName.equals(id.fIdentityConstraintName);
- if(!areEqual) return false;
- areEqual = fSelector.toString().equals(id.fSelector.toString());
- if(!areEqual) return false;
- areEqual = (fFieldCount == id.fFieldCount);
- if(!areEqual) return false;
- for(int i=0; i<fFieldCount; i++)
- if(!fFields[i].toString().equals(id.fFields[i].toString())) return false;
- return true;
- } // equals
-
- static final Field[] resize(Field[] oldArray, int newSize) {
- Field[] newArray = new Field[newSize];
- System.arraycopy(oldArray, 0, newArray, 0, oldArray.length);
- return newArray;
- }
-
- /**
- * Get the type of the object, i.e ELEMENT_DECLARATION.
- */
- public short getType() {
- return XSConstants.IDENTITY_CONSTRAINT;
- }
-
- /**
- * The <code>name</code> of this <code>XSObject</code> depending on the
- * <code>XSObject</code> type.
- */
- public String getName() {
- return fIdentityConstraintName;
- }
-
- /**
- * The namespace URI of this node, or <code>null</code> if it is
- * unspecified. defines how a namespace URI is attached to schema
- * components.
- */
- public String getNamespace() {
- return fNamespace;
- }
-
- /**
- * {identity-constraint category} One of key, keyref or unique.
- */
- public short getCategory() {
- return type;
- }
-
- /**
- * {selector} A restricted XPath ([XPath]) expression
- */
- public String getSelectorStr() {
- return (fSelector != null) ? fSelector.toString() : null;
- }
-
- /**
- * {fields} A non-empty list of restricted XPath ([XPath]) expressions.
- */
- public StringList getFieldStrs() {
- String[] strs = new String[fFieldCount];
- for (int i = 0; i < fFieldCount; i++)
- strs[i] = fFields[i].toString();
- return new StringListImpl(strs, fFieldCount);
- }
-
- /**
- * {referenced key} Required if {identity-constraint category} is keyref,
- * forbidden otherwise. An identity-constraint definition with
- * {identity-constraint category} equal to key or unique.
- */
- public XSIDCDefinition getRefKey() {
- return null;
- }
-
- /**
- * Optional. Annotation.
- */
- public XSObjectList getAnnotations() {
- return new XSObjectListImpl(fAnnotations, fNumAnnotations);
- }
-
- /**
- * @see com.sun.org.apache.xerces.internal.xs.XSObject#getNamespaceItem()
- */
- public XSNamespaceItem getNamespaceItem() {
- // REVISIT: implement
- return null;
- }
-
- public void addAnnotation(XSAnnotationImpl annotation) {
- if(annotation == null)
- return;
- if(fAnnotations == null) {
- fAnnotations = new XSAnnotationImpl[2];
- } else if(fNumAnnotations == fAnnotations.length) {
- XSAnnotationImpl[] newArray = new XSAnnotationImpl[fNumAnnotations << 1];
- System.arraycopy(fAnnotations, 0, newArray, 0, fNumAnnotations);
- fAnnotations = newArray;
- }
- fAnnotations[fNumAnnotations++] = annotation;
- }
-
-} // class IdentityConstraint
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/identity/KeyRef.java b/src/com/sun/org/apache/xerces/internal/impl/xs/identity/KeyRef.java
deleted file mode 100644
index 4058b50..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/identity/KeyRef.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.identity;
-
-import com.sun.org.apache.xerces.internal.xs.XSIDCDefinition;
-
-/**
- * Schema key reference identity constraint.
- *
- * @xerces.internal
- *
- * @author Andy Clark, IBM
- */
-public class KeyRef
- extends IdentityConstraint {
-
- //
- // Data
- //
-
- /** The key (or unique) being referred to. */
- protected UniqueOrKey fKey;
-
- //
- // Constructors
- //
-
- /** Constructs a keyref with the specified name. */
- public KeyRef(String namespace, String identityConstraintName,
- String elemName, UniqueOrKey key) {
- super(namespace, identityConstraintName, elemName);
- fKey = key;
- type = IC_KEYREF;
- } // <init>(String,String,String)
-
- //
- // Public methods
- //
-
- /** Returns the key being referred to. */
- public UniqueOrKey getKey() {
- return fKey;
- } // getKey(): int
-
- /**
- * {referenced key} Required if {identity-constraint category} is keyref,
- * forbidden otherwise. An identity-constraint definition with
- * {identity-constraint category} equal to key or unique.
- */
- public XSIDCDefinition getRefKey() {
- return fKey;
- }
-
-} // class KeyRef
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/identity/Selector.java b/src/com/sun/org/apache/xerces/internal/impl/xs/identity/Selector.java
deleted file mode 100644
index f36e5ee..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/identity/Selector.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.identity;
-
-import com.sun.org.apache.xerces.internal.impl.xpath.XPathException;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.util.XMLChar;
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
-import com.sun.org.apache.xerces.internal.xs.ShortList;
-import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
-
-/**
- * Schema identity constraint selector.
- *
- * @xerces.internal
- *
- * @author Andy Clark, IBM
- * @version $Id: Selector.java,v 1.7 2010-11-01 04:39:57 joehw Exp $
- */
-public class Selector {
-
- //
- // Data
- //
-
- /** XPath. */
- protected final Selector.XPath fXPath;
-
- /** Identity constraint. */
- protected final IdentityConstraint fIdentityConstraint;
-
- // the Identity constraint we're the matcher for. Only
- // used for selectors!
- protected IdentityConstraint fIDConstraint;
-
- //
- // Constructors
- //
-
- /** Constructs a selector. */
- public Selector(Selector.XPath xpath,
- IdentityConstraint identityConstraint) {
- fXPath = xpath;
- fIdentityConstraint = identityConstraint;
- } // <init>(Selector.XPath,IdentityConstraint)
-
- //
- // Public methods
- //
-
- /** Returns the selector XPath. */
- public com.sun.org.apache.xerces.internal.impl.xpath.XPath getXPath() {
- return fXPath;
- } // getXPath():com.sun.org.apache.xerces.internal.v1.schema.identity.XPath
-
- /** Returns the identity constraint. */
- public IdentityConstraint getIDConstraint() {
- return fIdentityConstraint;
- } // getIDConstraint():IdentityConstraint
-
- // factory method
-
- /** Creates a selector matcher.
- * @param activator The activator for this selector's fields.
- * @param initialDepth The depth in the document at which this matcher began its life;
- * used in correctly handling recursive elements.
- */
- public XPathMatcher createMatcher(FieldActivator activator, int initialDepth) {
- return new Selector.Matcher(fXPath, activator, initialDepth);
- } // createMatcher(FieldActivator):XPathMatcher
-
- //
- // Object methods
- //
-
- /** Returns a string representation of this object. */
- public String toString() {
- return fXPath.toString();
- } // toString():String
-
- //
- // Classes
- //
-
- /**
- * Schema identity constraint selector XPath expression.
- *
- * @author Andy Clark, IBM
- * @version $Id: Selector.java,v 1.7 2010-11-01 04:39:57 joehw Exp $
- */
- public static class XPath
- extends com.sun.org.apache.xerces.internal.impl.xpath.XPath {
-
- //
- // Constructors
- //
-
- /** Constructs a selector XPath expression. */
- public XPath(String xpath, SymbolTable symbolTable,
- NamespaceContext context) throws XPathException {
- super(normalize(xpath), symbolTable, context);
- // verify that an attribute is not selected
- for (int i=0;i<fLocationPaths.length;i++) {
- com.sun.org.apache.xerces.internal.impl.xpath.XPath.Axis axis =
- fLocationPaths[i].steps[fLocationPaths[i].steps.length-1].axis;
- if (axis.type == XPath.Axis.ATTRIBUTE) {
- throw new XPathException("c-selector-xpath");
- }
- }
-
- } // <init>(String,SymbolTable,NamespacesScope)
-
- private static String normalize(String xpath) {
- // NOTE: We have to prefix the selector XPath with "./" in
- // order to handle selectors such as "." that select
- // the element container because the fields could be
- // relative to that element. -Ac
- // Unless xpath starts with a descendant node -Achille Fokoue
- // ... or a '.' or a '/' - NG
- // And we also need to prefix exprs to the right of | with ./ - NG
- StringBuffer modifiedXPath = new StringBuffer(xpath.length()+5);
- int unionIndex = -1;
- do {
- if(!(XMLChar.trim(xpath).startsWith("/") || XMLChar.trim(xpath).startsWith("."))) {
- modifiedXPath.append("./");
- }
- unionIndex = xpath.indexOf('|');
- if(unionIndex == -1) {
- modifiedXPath.append(xpath);
- break;
- }
- modifiedXPath.append(xpath.substring(0,unionIndex+1));
- xpath = xpath.substring(unionIndex+1, xpath.length());
- } while(true);
- return modifiedXPath.toString();
- }
-
- } // class Selector.XPath
-
- /**
- * Selector matcher.
- *
- * @author Andy Clark, IBM
- */
- public class Matcher
- extends XPathMatcher {
-
- //
- // Data
- //
-
- /** Field activator. */
- protected final FieldActivator fFieldActivator;
-
- /** Initial depth in the document at which this matcher was created. */
- protected final int fInitialDepth;
-
- /** Element depth. */
- protected int fElementDepth;
-
- /** Depth at match. */
- protected int fMatchedDepth;
-
- //
- // Constructors
- //
-
- /** Constructs a selector matcher. */
- public Matcher(Selector.XPath xpath, FieldActivator activator,
- int initialDepth) {
- super(xpath);
- fFieldActivator = activator;
- fInitialDepth = initialDepth;
- } // <init>(Selector.XPath,FieldActivator)
-
- //
- // XMLDocumentFragmentHandler methods
- //
-
- public void startDocumentFragment(){
- super.startDocumentFragment();
- fElementDepth = 0;
- fMatchedDepth = -1;
- } // startDocumentFragment()
-
- /**
- * The start of an element. If the document specifies the start element
- * by using an empty tag, then the startElement method will immediately
- * be followed by the endElement method, with no intervening methods.
- *
- * @param element The name of the element.
- * @param attributes The element attributes.
- *
- */
- public void startElement(QName element, XMLAttributes attributes) {
- super.startElement(element, attributes);
- fElementDepth++;
- // activate the fields, if selector is matched
- //int matched = isMatched();
-
- if (isMatched()) {
-/* (fMatchedDepth == -1 && ((matched & MATCHED) == MATCHED)) ||
- ((matched & MATCHED_DESCENDANT) == MATCHED_DESCENDANT)) { */
- fMatchedDepth = fElementDepth;
- fFieldActivator.startValueScopeFor(fIdentityConstraint, fInitialDepth);
- int count = fIdentityConstraint.getFieldCount();
- for (int i = 0; i < count; i++) {
- Field field = fIdentityConstraint.getFieldAt(i);
- XPathMatcher matcher = fFieldActivator.activateField(field, fInitialDepth);
- matcher.startElement(element, attributes);
- }
- }
-
- } // startElement(QName,XMLAttrList,int)
-
- public void endElement(QName element, XSTypeDefinition type, boolean nillable, Object actualValue, short valueType, ShortList itemValueType) {
- super.endElement(element, type, nillable, actualValue, valueType, itemValueType);
- if (fElementDepth-- == fMatchedDepth) {
- fMatchedDepth = -1;
- fFieldActivator.endValueScopeFor(fIdentityConstraint, fInitialDepth);
- }
- }
-
- /** Returns the identity constraint. */
- public IdentityConstraint getIdentityConstraint() {
- return fIdentityConstraint;
- } // getIdentityConstraint():IdentityConstraint
-
- /** get the initial depth at which this selector matched. */
- public int getInitialDepth() {
- return fInitialDepth;
- } // getInitialDepth(): int
-
-
- } // class Matcher
-
-} // class Selector
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/identity/UniqueOrKey.java b/src/com/sun/org/apache/xerces/internal/impl/xs/identity/UniqueOrKey.java
deleted file mode 100644
index a86c664..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/identity/UniqueOrKey.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.identity;
-
-/**
- * Schema unique or key identity constraint.
- * These two kinds of identity constraint have been combined to save
- * the creation of a separate Vector object for any element that
- * has both. A short int is used to distinguish which this object is.
- *
- * @xerces.internal
- *
- * @author Andy Clark, IBM
- */
-public class UniqueOrKey
- extends IdentityConstraint {
-
- //
- // Constructors
- //
-
- /** Constructs a unique or a key identity constraint. */
- public UniqueOrKey(String namespace, String identityConstraintName,
- String elemName, short type) {
- super(namespace, identityConstraintName, elemName);
- this.type = type;
- } // <init>(String,String)
-
- //
- // Public methods
- //
-
-} // class Unique
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/identity/ValueStore.java b/src/com/sun/org/apache/xerces/internal/impl/xs/identity/ValueStore.java
deleted file mode 100644
index 4347719..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/identity/ValueStore.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.identity;
-
-import com.sun.org.apache.xerces.internal.xs.ShortList;
-
-
-/**
- * Interface for storing values associated to an identity constraint.
- * Each value stored corresponds to a field declared for the identity
- * constraint. One instance of an object implementing this interface
- * is created for each identity constraint per element declaration in
- * the instance document to store the information for this identity
- * constraint.
- * <p>
- * <strong>Note:</strong> The component performing identity constraint
- * collection and validation is responsible for providing an
- * implementation of this interface. The component is also responsible
- * for performing the necessary checks required by each type of identity
- * constraint.
- *
- * @xerces.internal
- *
- * @author Andy Clark, IBM
- *
- */
-public interface ValueStore {
-
- //
- // ValueStore methods
- //
-
- /**
- * Adds the specified value to the value store.
- *
- * @param field The field associated to the value. This reference
- * is used to ensure that each field only adds a value
- * once within a selection scope.
- * @param actualValue The value to add.
- */
- public void addValue(Field field, Object actualValue, short valueType, ShortList itemValueType);
-
- /**
- * Since the valueStore will have access to an error reporter, this
- * allows it to be called appropriately.
- * @param key the key of the localized error message
- * @param args the list of arguments for substitution.
- */
- public void reportError(String key, Object[] args);
-
-
-} // interface ValueStore
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/identity/XPathMatcher.java b/src/com/sun/org/apache/xerces/internal/impl/xs/identity/XPathMatcher.java
deleted file mode 100644
index d878932..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/identity/XPathMatcher.java
+++ /dev/null
@@ -1,522 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.identity;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.xpath.XPath;
-import com.sun.org.apache.xerces.internal.util.IntStack;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
-import com.sun.org.apache.xerces.internal.xs.AttributePSVI;
-import com.sun.org.apache.xerces.internal.xs.ShortList;
-import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
-import org.xml.sax.SAXException;
-
-
-/**
- * XPath matcher.
- *
- * @xerces.internal
- *
- * @author Andy Clark, IBM
- *
- */
-public class XPathMatcher {
-
- //
- // Constants
- //
-
- // debugging
-
- /** Compile to true to debug everything. */
- protected static final boolean DEBUG_ALL = false;
-
- /** Compile to true to debug method callbacks. */
- protected static final boolean DEBUG_METHODS = false || DEBUG_ALL;
-
- /** Compile to true to debug important method callbacks. */
- protected static final boolean DEBUG_METHODS2 = false || DEBUG_METHODS || DEBUG_ALL;
-
- /** Compile to true to debug the <em>really</em> important methods. */
- protected static final boolean DEBUG_METHODS3 = false || DEBUG_METHODS || DEBUG_ALL;
-
- /** Compile to true to debug match. */
- protected static final boolean DEBUG_MATCH = false || DEBUG_ALL;
-
- /** Compile to true to debug step index stack. */
- protected static final boolean DEBUG_STACK = false || DEBUG_ALL;
-
- /** Don't touch this value unless you add more debug constants. */
- protected static final boolean DEBUG_ANY = DEBUG_METHODS ||
- DEBUG_METHODS2 ||
- DEBUG_METHODS3 ||
- DEBUG_MATCH ||
- DEBUG_STACK;
-
- // constants describing whether a match was made,
- // and if so how.
- // matched any way
- protected static final int MATCHED = 1;
- // matched on the attribute axis
- protected static final int MATCHED_ATTRIBUTE = 3;
- // matched on the descendant-or-self axixs
- protected static final int MATCHED_DESCENDANT = 5;
- // matched some previous (ancestor) node on the descendant-or-self-axis, but not this node
- protected static final int MATCHED_DESCENDANT_PREVIOUS = 13;
-
- //
- // Data
- //
-
- /** XPath location path. */
- private XPath.LocationPath[] fLocationPaths;
-
- /** True if XPath has been matched. */
- private int[] fMatched;
-
- /** The matching string. */
- protected Object fMatchedString;
-
- /** Integer stack of step indexes. */
- private IntStack[] fStepIndexes;
-
- /** Current step. */
- private int[] fCurrentStep;
-
- /**
- * No match depth. The value of this field will be zero while
- * matching is successful for the given xpath expression.
- */
- private int [] fNoMatchDepth;
-
- final QName fQName = new QName();
-
-
- //
- // Constructors
- //
-
- /**
- * Constructs an XPath matcher that implements a document fragment
- * handler.
- *
- * @param xpath The xpath.
- */
- public XPathMatcher(XPath xpath) {
- fLocationPaths = xpath.getLocationPaths();
- fStepIndexes = new IntStack[fLocationPaths.length];
- for(int i=0; i<fStepIndexes.length; i++) fStepIndexes[i] = new IntStack();
- fCurrentStep = new int[fLocationPaths.length];
- fNoMatchDepth = new int[fLocationPaths.length];
- fMatched = new int[fLocationPaths.length];
- } // <init>(XPath)
-
- //
- // Public methods
- //
-
- /**
- * Returns value of first member of fMatched that
- * is nonzero.
- */
- public boolean isMatched() {
- // xpath has been matched if any one of the members of the union have matched.
- for (int i=0; i < fLocationPaths.length; i++)
- if (((fMatched[i] & MATCHED) == MATCHED)
- && ((fMatched[i] & MATCHED_DESCENDANT_PREVIOUS) != MATCHED_DESCENDANT_PREVIOUS)
- && ((fNoMatchDepth[i] == 0)
- || ((fMatched[i] & MATCHED_DESCENDANT) == MATCHED_DESCENDANT)))
- return true;
-
- return false;
- } // isMatched():int
-
- //
- // Protected methods
- //
-
- // a place-holder method; to be overridden by subclasses
- // that care about matching element content.
- protected void handleContent(XSTypeDefinition type, boolean nillable, Object value, short valueType, ShortList itemValueType) {
- }
-
- /**
- * This method is called when the XPath handler matches the
- * XPath expression. Subclasses can override this method to
- * provide default handling upon a match.
- */
- protected void matched(Object actualValue, short valueType, ShortList itemValueType, boolean isNil) {
- if (DEBUG_METHODS3) {
- System.out.println(toString()+"#matched(\""+actualValue+"\")");
- }
- } // matched(String content, XSSimpleType val)
-
- //
- // ~XMLDocumentFragmentHandler methods
- //
-
- /**
- * The start of the document fragment.
- */
- public void startDocumentFragment(){
- if (DEBUG_METHODS) {
- System.out.println(toString()+"#startDocumentFragment("+
- ")");
- }
-
- // reset state
- fMatchedString = null;
- for(int i = 0; i < fLocationPaths.length; i++) {
- fStepIndexes[i].clear();
- fCurrentStep[i] = 0;
- fNoMatchDepth[i] = 0;
- fMatched[i] = 0;
- }
-
-
- } // startDocumentFragment()
-
- /**
- * The start of an element. If the document specifies the start element
- * by using an empty tag, then the startElement method will immediately
- * be followed by the endElement method, with no intervening methods.
- *
- * @param element The name of the element.
- * @param attributes The element attributes.
- *
- * @throws SAXException Thrown by handler to signal an error.
- */
- public void startElement(QName element, XMLAttributes attributes){
- if (DEBUG_METHODS2) {
- System.out.println(toString()+"#startElement("+
- "element={"+element+"},"+
- "attributes=..."+attributes+
- ")");
- }
-
- for(int i = 0; i < fLocationPaths.length; i++) {
- // push context
- int startStep = fCurrentStep[i];
- fStepIndexes[i].push(startStep);
-
- // try next xpath, if not matching
- if ((fMatched[i] & MATCHED_DESCENDANT) == MATCHED || fNoMatchDepth[i] > 0) {
- fNoMatchDepth[i]++;
- continue;
- }
- if((fMatched[i] & MATCHED_DESCENDANT) == MATCHED_DESCENDANT) {
- fMatched[i] = MATCHED_DESCENDANT_PREVIOUS;
- }
-
- if (DEBUG_STACK) {
- System.out.println(toString()+": "+fStepIndexes[i]);
- }
-
- // consume self::node() steps
- XPath.Step[] steps = fLocationPaths[i].steps;
- while (fCurrentStep[i] < steps.length &&
- steps[fCurrentStep[i]].axis.type == XPath.Axis.SELF) {
- if (DEBUG_MATCH) {
- XPath.Step step = steps[fCurrentStep[i]];
- System.out.println(toString()+" [SELF] MATCHED!");
- }
- fCurrentStep[i]++;
- }
- if (fCurrentStep[i] == steps.length) {
- if (DEBUG_MATCH) {
- System.out.println(toString()+" XPath MATCHED!");
- }
- fMatched[i] = MATCHED;
- continue;
- }
-
- // now if the current step is a descendant step, we let the next
- // step do its thing; if it fails, we reset ourselves
- // to look at this step for next time we're called.
- // so first consume all descendants:
- int descendantStep = fCurrentStep[i];
- while(fCurrentStep[i] < steps.length && steps[fCurrentStep[i]].axis.type == XPath.Axis.DESCENDANT) {
- if (DEBUG_MATCH) {
- XPath.Step step = steps[fCurrentStep[i]];
- System.out.println(toString()+" [DESCENDANT] MATCHED!");
- }
- fCurrentStep[i]++;
- }
- boolean sawDescendant = fCurrentStep[i] > descendantStep;
- if (fCurrentStep[i] == steps.length) {
- if (DEBUG_MATCH) {
- System.out.println(toString()+" XPath DIDN'T MATCH!");
- }
- fNoMatchDepth[i]++;
- if (DEBUG_MATCH) {
- System.out.println(toString()+" [CHILD] after NO MATCH");
- }
- continue;
- }
-
- // match child::... step, if haven't consumed any self::node()
- if ((fCurrentStep[i] == startStep || fCurrentStep[i] > descendantStep) &&
- steps[fCurrentStep[i]].axis.type == XPath.Axis.CHILD) {
- XPath.Step step = steps[fCurrentStep[i]];
- XPath.NodeTest nodeTest = step.nodeTest;
- if (DEBUG_MATCH) {
- System.out.println(toString()+" [CHILD] before");
- }
- if (nodeTest.type == XPath.NodeTest.QNAME) {
- if (!nodeTest.name.equals(element)) {
- if(fCurrentStep[i] > descendantStep) {
- fCurrentStep[i] = descendantStep;
- continue;
- }
- fNoMatchDepth[i]++;
- if (DEBUG_MATCH) {
- System.out.println(toString()+" [CHILD] after NO MATCH");
- }
- continue;
- }
- }
- fCurrentStep[i]++;
- if (DEBUG_MATCH) {
- System.out.println(toString()+" [CHILD] after MATCHED!");
- }
- }
- if (fCurrentStep[i] == steps.length) {
- if(sawDescendant) {
- fCurrentStep[i] = descendantStep;
- fMatched[i] = MATCHED_DESCENDANT;
- } else {
- fMatched[i] = MATCHED;
- }
- continue;
- }
-
- // match attribute::... step
- if (fCurrentStep[i] < steps.length &&
- steps[fCurrentStep[i]].axis.type == XPath.Axis.ATTRIBUTE) {
- if (DEBUG_MATCH) {
- System.out.println(toString()+" [ATTRIBUTE] before");
- }
- int attrCount = attributes.getLength();
- if (attrCount > 0) {
- XPath.NodeTest nodeTest = steps[fCurrentStep[i]].nodeTest;
-
- for (int aIndex = 0; aIndex < attrCount; aIndex++) {
- attributes.getName(aIndex, fQName);
- if (nodeTest.type != XPath.NodeTest.QNAME ||
- nodeTest.name.equals(fQName)) {
- fCurrentStep[i]++;
- if (fCurrentStep[i] == steps.length) {
- fMatched[i] = MATCHED_ATTRIBUTE;
- int j=0;
- for(; j<i && ((fMatched[j] & MATCHED) != MATCHED); j++);
- if(j==i) {
- AttributePSVI attrPSVI = (AttributePSVI)attributes.getAugmentations(aIndex).getItem(Constants.ATTRIBUTE_PSVI);
- fMatchedString = attrPSVI.getActualNormalizedValue();
- matched(fMatchedString, attrPSVI.getActualNormalizedValueType(), attrPSVI.getItemValueTypes(), false);
- }
- }
- break;
- }
- }
- }
- if ((fMatched[i] & MATCHED) != MATCHED) {
- if(fCurrentStep[i] > descendantStep) {
- fCurrentStep[i] = descendantStep;
- continue;
- }
- fNoMatchDepth[i]++;
- if (DEBUG_MATCH) {
- System.out.println(toString()+" [ATTRIBUTE] after");
- }
- continue;
- }
- if (DEBUG_MATCH) {
- System.out.println(toString()+" [ATTRIBUTE] after MATCHED!");
- }
- }
- }
-
- }
- // startElement(QName,XMLAttrList,int)
-
- /**
- * @param element
- * name of the element.
- * @param type
- * content type of this element. IOW, the XML schema type
- * of the <tt>value</tt>. Note that this may not be the type declared
- * in the element declaration, but it is "the actual type". For example,
- * if the XML is &lt;foo xsi:type="xs:string">aaa&lt;/foo>, this
- * parameter will be "xs:string".
- * @param nillable - nillable
- * true if the element declaration is nillable.
- * @param value - actual value
- * the typed value of the content of this element.
- */
- public void endElement(QName element, XSTypeDefinition type, boolean nillable, Object value, short valueType, ShortList itemValueType) {
- if (DEBUG_METHODS2) {
- System.out.println(toString()+"#endElement("+
- "element={"+element+"},"+
- ")");
- }
- for(int i = 0; i<fLocationPaths.length; i++) {
- // go back a step
- fCurrentStep[i] = fStepIndexes[i].pop();
-
- // don't do anything, if not matching
- if (fNoMatchDepth[i] > 0) {
- fNoMatchDepth[i]--;
- }
-
- // signal match, if appropriate
- else {
- int j=0;
- for(; j<i && ((fMatched[j] & MATCHED) != MATCHED); j++);
- if ((j<i) || (fMatched[j] == 0) ||
- ((fMatched[j] & MATCHED_ATTRIBUTE) == MATCHED_ATTRIBUTE)) {
- continue;
- }
- // only certain kinds of matchers actually
- // match element content. This permits
- // them a way to override this to do nothing
- // and hopefully save a few operations.
- handleContent(type, nillable, value, valueType, itemValueType);
- fMatched[i] = 0;
- }
-
- if (DEBUG_STACK) {
- System.out.println(toString()+": "+fStepIndexes[i]);
- }
- }
-
- } // endElement(QName)
-
- //
- // Object methods
- //
-
- /** Returns a string representation of this object. */
- public String toString() {
- /***
- return fLocationPath.toString();
- /***/
- StringBuffer str = new StringBuffer();
- String s = super.toString();
- int index2 = s.lastIndexOf('.');
- if (index2 != -1) {
- s = s.substring(index2 + 1);
- }
- str.append(s);
- for(int i =0;i<fLocationPaths.length; i++) {
- str.append('[');
- XPath.Step[] steps = fLocationPaths[i].steps;
- for (int j = 0; j < steps.length; j++) {
- if (j == fCurrentStep[i]) {
- str.append('^');
- }
- str.append(steps[j].toString());
- if (j < steps.length - 1) {
- str.append('/');
- }
- }
- if (fCurrentStep[i] == steps.length) {
- str.append('^');
- }
- str.append(']');
- str.append(',');
- }
- return str.toString();
- } // toString():String
-
- //
- // Private methods
- //
-
- /** Normalizes text. */
- private String normalize(String s) {
- StringBuffer str = new StringBuffer();
- int length = s.length();
- for (int i = 0; i < length; i++) {
- char c = s.charAt(i);
- switch (c) {
- case '\n': {
- str.append("\\n");
- break;
- }
- default: {
- str.append(c);
- }
- }
- }
- return str.toString();
- } // normalize(String):String
-
- //
- // MAIN
- //
-
- // NOTE: The main of this class is here for debugging purposes.
- // However, javac (JDK 1.1.8) has an internal compiler
- // error when compiling. Jikes has no problem, though.
- //
- // If you want to use this main, use Jikes to compile but
- // *never* check in this code to CVS without commenting it
- // out. -Ac
-
- /** Main program. */
- /***
- public static void main(String[] argv) throws XNIException {
-
- if (DEBUG_ANY) {
- for (int i = 0; i < argv.length; i++) {
- final String expr = argv[i];
- final XPath xpath = new XPath(expr, symbols, null);
- final XPathMatcher matcher = new XPathMatcher(xpath, true);
- com.sun.org.apache.xerces.internal.parsers.SAXParser parser =
- new com.sun.org.apache.xerces.internal.parsers.SAXParser(symbols) {
- public void startDocument() throws XNIException {
- matcher.startDocumentFragment(symbols, null);
- }
- public void startElement(QName element, XMLAttrList attributes, int handle) throws XNIException {
- matcher.startElement(element, attributes, handle);
- }
- public void characters(char[] ch, int offset, int length) throws XNIException {
- matcher.characters(ch, offset, length);
- }
- public void endElement(QName element) throws XNIException {
- matcher.endElement(element);
- }
- public void endDocument() throws XNIException {
- matcher.endDocumentFragment();
- }
- };
- System.out.println("#### argv["+i+"]: \""+expr+"\" -> \""+xpath.toString()+'"');
- final String uri = argv[++i];
- System.out.println("#### argv["+i+"]: "+uri);
- parser.parse(uri);
- }
- }
-
- } // main(String[])
- /***/
-
-} // class XPathMatcher
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/models/CMBuilder.java b/src/com/sun/org/apache/xerces/internal/impl/xs/models/CMBuilder.java
deleted file mode 100644
index ca88154..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/models/CMBuilder.java
+++ /dev/null
@@ -1,450 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.models;
-
-import com.sun.org.apache.xerces.internal.impl.dtd.models.CMNode;
-import com.sun.org.apache.xerces.internal.impl.xs.SchemaSymbols;
-import com.sun.org.apache.xerces.internal.impl.xs.XSComplexTypeDecl;
-import com.sun.org.apache.xerces.internal.impl.xs.XSDeclarationPool;
-import com.sun.org.apache.xerces.internal.impl.xs.XSElementDecl;
-import com.sun.org.apache.xerces.internal.impl.xs.XSModelGroupImpl;
-import com.sun.org.apache.xerces.internal.impl.xs.XSParticleDecl;
-
-/**
- * This class constructs content models for a given grammar.
- *
- * @xerces.internal
- *
- * @author Elena Litani, IBM
- * @author Sandy Gao, IBM
- *
- * @version $Id: CMBuilder.java,v 1.11 2010/08/06 23:49:43 joehw Exp $
- */
-public class CMBuilder {
-
- // REVISIT: should update the decl pool to cache XSCM objects too
- private XSDeclarationPool fDeclPool = null;
-
- // It never changes, so a static member is good enough
- private static XSEmptyCM fEmptyCM = new XSEmptyCM();
-
- // needed for DFA construction
- private int fLeafCount;
- // needed for UPA
- private int fParticleCount;
- //Factory to create Bin, Uni, Leaf nodes
- private CMNodeFactory fNodeFactory ;
-
- public CMBuilder(CMNodeFactory nodeFactory) {
- fDeclPool = null;
- fNodeFactory = nodeFactory ;
- }
-
- public void setDeclPool(XSDeclarationPool declPool) {
- fDeclPool = declPool;
- }
-
- /**
- * Get content model for the a given type
- *
- * @param typeDecl get content model for which complex type
- * @return a content model validator
- */
- public XSCMValidator getContentModel(XSComplexTypeDecl typeDecl) {
-
- // for complex type with empty or simple content,
- // there is no content model validator
- short contentType = typeDecl.getContentType();
- if (contentType == XSComplexTypeDecl.CONTENTTYPE_SIMPLE ||
- contentType == XSComplexTypeDecl.CONTENTTYPE_EMPTY) {
- return null;
- }
-
- XSParticleDecl particle = (XSParticleDecl)typeDecl.getParticle();
-
- // if the content is element only or mixed, but no particle
- // is defined, return the empty content model
- if (particle == null)
- return fEmptyCM;
-
- // if the content model contains "all" model group,
- // we create an "all" content model, otherwise a DFA content model
- XSCMValidator cmValidator = null;
- if (particle.fType == XSParticleDecl.PARTICLE_MODELGROUP &&
- ((XSModelGroupImpl)particle.fValue).fCompositor == XSModelGroupImpl.MODELGROUP_ALL) {
- cmValidator = createAllCM(particle);
- }
- else {
- cmValidator = createDFACM(particle);
- }
-
- //now we are throught building content model and have passed sucessfully of the nodecount check
- //if set by the application
- fNodeFactory.resetNodeCount() ;
-
- // if the validator returned is null, it means there is nothing in
- // the content model, so we return the empty content model.
- if (cmValidator == null)
- cmValidator = fEmptyCM;
-
- return cmValidator;
- }
-
- XSCMValidator createAllCM(XSParticleDecl particle) {
- if (particle.fMaxOccurs == 0)
- return null;
-
- // get the model group, and add all children of it to the content model
- XSModelGroupImpl group = (XSModelGroupImpl)particle.fValue;
- // create an all content model. the parameter indicates whether
- // the <all> itself is optional
- XSAllCM allContent = new XSAllCM(particle.fMinOccurs == 0, group.fParticleCount);
- for (int i = 0; i < group.fParticleCount; i++) {
- // add the element decl to the all content model
- allContent.addElement((XSElementDecl)group.fParticles[i].fValue,
- group.fParticles[i].fMinOccurs == 0);
- }
- return allContent;
- }
-
- XSCMValidator createDFACM(XSParticleDecl particle) {
- fLeafCount = 0;
- fParticleCount = 0;
- // convert particle tree to CM tree
- CMNode node = useRepeatingLeafNodes(particle) ? buildCompactSyntaxTree(particle) : buildSyntaxTree(particle, true);
- if (node == null)
- return null;
- // build DFA content model from the CM tree
- return new XSDFACM(node, fLeafCount);
- }
-
- // 1. convert particle tree to CM tree:
- // 2. expand all occurrence values: a{n, unbounded} -> a, a, ..., a+
- // a{n, m} -> a, a, ..., a?, a?, ...
- // 3. convert model groups (a, b, c, ...) or (a | b | c | ...) to
- // binary tree: (((a,b),c),...) or (((a|b)|c)|...)
- // 4. make sure each leaf node (XSCMLeaf) has a distinct position
- private CMNode buildSyntaxTree(XSParticleDecl particle, boolean optimize) {
-
- int maxOccurs = particle.fMaxOccurs;
- int minOccurs = particle.fMinOccurs;
- short type = particle.fType;
- CMNode nodeRet = null;
-
- if ((type == XSParticleDecl.PARTICLE_WILDCARD) ||
- (type == XSParticleDecl.PARTICLE_ELEMENT)) {
- // (task 1) element and wildcard particles should be converted to
- // leaf nodes
- // REVISIT: Make a clone of the leaf particle, so that if there
- // are two references to the same group, we have two different
- // leaf particles for the same element or wildcard decl.
- // This is useful for checking UPA.
- nodeRet = fNodeFactory.getCMLeafNode(particle.fType, particle.fValue, fParticleCount++, fLeafCount++);
- // (task 2) expand occurrence values
- nodeRet = expandContentModel(nodeRet, minOccurs, maxOccurs, optimize);
- }
- else if (type == XSParticleDecl.PARTICLE_MODELGROUP) {
- // (task 1,3) convert model groups to binary trees
- XSModelGroupImpl group = (XSModelGroupImpl)particle.fValue;
- CMNode temp = null;
- // when the model group is a choice of more than one particles, but
- // only one of the particle is not empty, (for example
- // <choice>
- // <sequence/>
- // <element name="e"/>
- // </choice>
- // ) we can't not return that one particle ("e"). instead, we should
- // treat such particle as optional ("e?").
- // the following boolean variable is true when there are at least
- // 2 non-empty children.
- boolean twoChildren = false;
- for (int i = 0; i < group.fParticleCount; i++) {
- // first convert each child to a CM tree
- temp = buildSyntaxTree(group.fParticles[i],
- optimize &&
- minOccurs == 1 && maxOccurs == 1 &&
- (group.fCompositor == XSModelGroupImpl.MODELGROUP_SEQUENCE ||
- group.fParticleCount == 1));
- // then combine them using binary operation
- if (temp != null) {
- if (nodeRet == null) {
- nodeRet = temp;
- }
- else {
- nodeRet = fNodeFactory.getCMBinOpNode(group.fCompositor, nodeRet, temp);
- // record the fact that there are at least 2 children
- twoChildren = true;
- }
- }
- }
- // (task 2) expand occurrence values
- if (nodeRet != null) {
- // when the group is "choice", there is only one non-empty
- // child, and the group had more than one children, we need
- // to create a zero-or-one (optional) node for the non-empty
- // particle.
- if (group.fCompositor == XSModelGroupImpl.MODELGROUP_CHOICE &&
- !twoChildren && group.fParticleCount > 1) {
- nodeRet = fNodeFactory.getCMUniOpNode(XSParticleDecl.PARTICLE_ZERO_OR_ONE, nodeRet);
- }
- nodeRet = expandContentModel(nodeRet, minOccurs, maxOccurs, false);
- }
- }
-
- return nodeRet;
- }
-
- // 2. expand all occurrence values: a{n, unbounded} -> a, a, ..., a+
- // a{n, m} -> a, a, ..., a?, a?, ...
- // 4. make sure each leaf node (XSCMLeaf) has a distinct position
- private CMNode expandContentModel(CMNode node,
- int minOccurs, int maxOccurs, boolean optimize) {
-
- CMNode nodeRet = null;
-
- if (minOccurs==1 && maxOccurs==1) {
- nodeRet = node;
- }
- else if (minOccurs==0 && maxOccurs==1) {
- //zero or one
- nodeRet = fNodeFactory.getCMUniOpNode(XSParticleDecl.PARTICLE_ZERO_OR_ONE, node);
- }
- else if (minOccurs == 0 && maxOccurs==SchemaSymbols.OCCURRENCE_UNBOUNDED) {
- //zero or more
- nodeRet = fNodeFactory.getCMUniOpNode(XSParticleDecl.PARTICLE_ZERO_OR_MORE, node);
- }
- else if (minOccurs == 1 && maxOccurs==SchemaSymbols.OCCURRENCE_UNBOUNDED) {
- //one or more
- nodeRet = fNodeFactory.getCMUniOpNode(XSParticleDecl.PARTICLE_ONE_OR_MORE, node);
- }
- else if (optimize && node.type() == XSParticleDecl.PARTICLE_ELEMENT ||
- node.type() == XSParticleDecl.PARTICLE_WILDCARD) {
- // Only for elements and wildcards, subsume e{n,m} and e{n,unbounded} to e*
- // or e+ and, once the DFA reaches a final state, check if the actual number
- // of elements is between minOccurs and maxOccurs. This new algorithm runs
- // in constant space.
-
- // TODO: What is the impact of this optimization on the PSVI?
- nodeRet = fNodeFactory.getCMUniOpNode(
- minOccurs == 0 ? XSParticleDecl.PARTICLE_ZERO_OR_MORE
- : XSParticleDecl.PARTICLE_ONE_OR_MORE, node);
- nodeRet.setUserData(new int[] { minOccurs, maxOccurs });
- }
- else if (maxOccurs == SchemaSymbols.OCCURRENCE_UNBOUNDED) {
- // => a,a,..,a+
- // create a+ node first, then put minOccurs-1 a's in front of it
- // for the first time "node" is used, we don't need to make a copy
- // and for other references to node, we make copies
- nodeRet = fNodeFactory.getCMUniOpNode(XSParticleDecl.PARTICLE_ONE_OR_MORE, node);
- // (task 4) we need to call copyNode here, so that we append
- // an entire new copy of the node (a subtree). this is to ensure
- // all leaf nodes have distinct position
- // we know that minOccurs > 1
- nodeRet = fNodeFactory.getCMBinOpNode(XSModelGroupImpl.MODELGROUP_SEQUENCE,
- multiNodes(node, minOccurs-1, true), nodeRet);
- }
- else {
- // {n,m} => a,a,a,...(a),(a),...
- // first n a's, then m-n a?'s.
- // copyNode is called, for the same reason as above
- if (minOccurs > 0) {
- nodeRet = multiNodes(node, minOccurs, false);
- }
- if (maxOccurs > minOccurs) {
- node = fNodeFactory.getCMUniOpNode(XSParticleDecl.PARTICLE_ZERO_OR_ONE, node);
- if (nodeRet == null) {
- nodeRet = multiNodes(node, maxOccurs-minOccurs, false);
- }
- else {
- nodeRet = fNodeFactory.getCMBinOpNode(XSModelGroupImpl.MODELGROUP_SEQUENCE,
- nodeRet, multiNodes(node, maxOccurs-minOccurs, true));
- }
- }
- }
-
- return nodeRet;
- }
-
- private CMNode multiNodes(CMNode node, int num, boolean copyFirst) {
- if (num == 0) {
- return null;
- }
- if (num == 1) {
- return copyFirst ? copyNode(node) : node;
- }
- int num1 = num/2;
- return fNodeFactory.getCMBinOpNode(XSModelGroupImpl.MODELGROUP_SEQUENCE,
- multiNodes(node, num1, copyFirst),
- multiNodes(node, num-num1, true));
- }
-
- // 4. make sure each leaf node (XSCMLeaf) has a distinct position
- private CMNode copyNode(CMNode node) {
- int type = node.type();
- // for choice or sequence, copy the two subtrees, and combine them
- if (type == XSModelGroupImpl.MODELGROUP_CHOICE ||
- type == XSModelGroupImpl.MODELGROUP_SEQUENCE) {
- XSCMBinOp bin = (XSCMBinOp)node;
- node = fNodeFactory.getCMBinOpNode(type, copyNode(bin.getLeft()),
- copyNode(bin.getRight()));
- }
- // for ?+*, copy the subtree, and put it in a new ?+* node
- else if (type == XSParticleDecl.PARTICLE_ZERO_OR_MORE ||
- type == XSParticleDecl.PARTICLE_ONE_OR_MORE ||
- type == XSParticleDecl.PARTICLE_ZERO_OR_ONE) {
- XSCMUniOp uni = (XSCMUniOp)node;
- node = fNodeFactory.getCMUniOpNode(type, copyNode(uni.getChild()));
- }
- // for element/wildcard (leaf), make a new leaf node,
- // with a distinct position
- else if (type == XSParticleDecl.PARTICLE_ELEMENT ||
- type == XSParticleDecl.PARTICLE_WILDCARD) {
- XSCMLeaf leaf = (XSCMLeaf)node;
- node = fNodeFactory.getCMLeafNode(leaf.type(), leaf.getLeaf(), leaf.getParticleId(), fLeafCount++);
- }
-
- return node;
- }
-
- // A special version of buildSyntaxTree() which builds a compact syntax tree
- // containing compound leaf nodes which carry occurence information. This method
- // for building the syntax tree is chosen over buildSyntaxTree() when
- // useRepeatingLeafNodes() returns true.
- private CMNode buildCompactSyntaxTree(XSParticleDecl particle) {
- int maxOccurs = particle.fMaxOccurs;
- int minOccurs = particle.fMinOccurs;
- short type = particle.fType;
- CMNode nodeRet = null;
-
- if ((type == XSParticleDecl.PARTICLE_WILDCARD) ||
- (type == XSParticleDecl.PARTICLE_ELEMENT)) {
- return buildCompactSyntaxTree2(particle, minOccurs, maxOccurs);
- }
- else if (type == XSParticleDecl.PARTICLE_MODELGROUP) {
- XSModelGroupImpl group = (XSModelGroupImpl)particle.fValue;
- if (group.fParticleCount == 1 && (minOccurs != 1 || maxOccurs != 1)) {
- return buildCompactSyntaxTree2(group.fParticles[0], minOccurs, maxOccurs);
- }
- else {
- CMNode temp = null;
-
- // when the model group is a choice of more than one particles, but
- // only one of the particle is not empty, (for example
- // <choice>
- // <sequence/>
- // <element name="e"/>
- // </choice>
- // ) we can't not return that one particle ("e"). instead, we should
- // treat such particle as optional ("e?").
- // the following int variable keeps track of the number of non-empty children
- int count = 0;
- for (int i = 0; i < group.fParticleCount; i++) {
- // first convert each child to a CM tree
- temp = buildCompactSyntaxTree(group.fParticles[i]);
- // then combine them using binary operation
- if (temp != null) {
- ++count;
- if (nodeRet == null) {
- nodeRet = temp;
- }
- else {
- nodeRet = fNodeFactory.getCMBinOpNode(group.fCompositor, nodeRet, temp);
- }
- }
- }
- if (nodeRet != null) {
- // when the group is "choice" and the group has one or more empty children,
- // we need to create a zero-or-one (optional) node for the non-empty particles.
- if (group.fCompositor == XSModelGroupImpl.MODELGROUP_CHOICE && count < group.fParticleCount) {
- nodeRet = fNodeFactory.getCMUniOpNode(XSParticleDecl.PARTICLE_ZERO_OR_ONE, nodeRet);
- }
- }
- }
- }
- return nodeRet;
- }
-
- private CMNode buildCompactSyntaxTree2(XSParticleDecl particle, int minOccurs, int maxOccurs) {
- // Convert element and wildcard particles to leaf nodes. Wrap repeating particles in a CMUniOpNode.
- CMNode nodeRet = null;
- if (minOccurs == 1 && maxOccurs == 1) {
- nodeRet = fNodeFactory.getCMLeafNode(particle.fType, particle.fValue, fParticleCount++, fLeafCount++);
- }
- else if (minOccurs == 0 && maxOccurs == 1) {
- // zero or one
- nodeRet = fNodeFactory.getCMLeafNode(particle.fType, particle.fValue, fParticleCount++, fLeafCount++);
- nodeRet = fNodeFactory.getCMUniOpNode(XSParticleDecl.PARTICLE_ZERO_OR_ONE, nodeRet);
- }
- else if (minOccurs == 0 && maxOccurs==SchemaSymbols.OCCURRENCE_UNBOUNDED) {
- // zero or more
- nodeRet = fNodeFactory.getCMLeafNode(particle.fType, particle.fValue, fParticleCount++, fLeafCount++);
- nodeRet = fNodeFactory.getCMUniOpNode(XSParticleDecl.PARTICLE_ZERO_OR_MORE, nodeRet);
- }
- else if (minOccurs == 1 && maxOccurs==SchemaSymbols.OCCURRENCE_UNBOUNDED) {
- // one or more
- nodeRet = fNodeFactory.getCMLeafNode(particle.fType, particle.fValue, fParticleCount++, fLeafCount++);
- nodeRet = fNodeFactory.getCMUniOpNode(XSParticleDecl.PARTICLE_ONE_OR_MORE, nodeRet);
- }
- else {
- // {n,m}: Instead of expanding this out, create a compound leaf node which carries the
- // occurence information and wrap it in the appropriate CMUniOpNode.
- nodeRet = fNodeFactory.getCMRepeatingLeafNode(particle.fType, particle.fValue, minOccurs, maxOccurs, fParticleCount++, fLeafCount++);
- if (minOccurs == 0) {
- nodeRet = fNodeFactory.getCMUniOpNode(XSParticleDecl.PARTICLE_ZERO_OR_MORE, nodeRet);
- }
- else {
- nodeRet = fNodeFactory.getCMUniOpNode(XSParticleDecl.PARTICLE_ONE_OR_MORE, nodeRet);
- }
- }
- return nodeRet;
- }
-
- // This method checks if this particle can be transformed into a compact syntax
- // tree containing compound leaf nodes which carry occurence information. Currently
- // it returns true if each model group has minOccurs/maxOccurs == 1 or
- // contains only one element/wildcard particle with minOccurs/maxOccurs == 1.
- private boolean useRepeatingLeafNodes(XSParticleDecl particle) {
- int maxOccurs = particle.fMaxOccurs;
- int minOccurs = particle.fMinOccurs;
- short type = particle.fType;
-
- if (type == XSParticleDecl.PARTICLE_MODELGROUP) {
- XSModelGroupImpl group = (XSModelGroupImpl) particle.fValue;
- if (minOccurs != 1 || maxOccurs != 1) {
- if (group.fParticleCount == 1) {
- XSParticleDecl particle2 = (XSParticleDecl) group.fParticles[0];
- short type2 = particle2.fType;
- return ((type2 == XSParticleDecl.PARTICLE_ELEMENT ||
- type2 == XSParticleDecl.PARTICLE_WILDCARD) &&
- particle2.fMinOccurs == 1 &&
- particle2.fMaxOccurs == 1);
- }
- return (group.fParticleCount == 0);
- }
- for (int i = 0; i < group.fParticleCount; ++i) {
- if (!useRepeatingLeafNodes(group.fParticles[i])) {
- return false;
- }
- }
- }
- return true;
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/models/CMNodeFactory.java b/src/com/sun/org/apache/xerces/internal/impl/xs/models/CMNodeFactory.java
deleted file mode 100644
index d094a5b..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/models/CMNodeFactory.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package com.sun.org.apache.xerces.internal.impl.xs.models;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
-import com.sun.org.apache.xerces.internal.impl.dtd.models.CMNode;
-import com.sun.org.apache.xerces.internal.impl.xs.XSMessageFormatter;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-
-/**
- *
- * @xerces.internal
- *
- * @author Neeraj Bajaj
- *
- * @version $Id: CMNodeFactory.java,v 1.7 2010-11-01 04:39:58 joehw Exp $
- */
-public class CMNodeFactory {
-
-
- /** Property identifier: error reporter. */
- private static final String ERROR_REPORTER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY;
-
- /** property identifier: security manager. */
- private static final String SECURITY_MANAGER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SECURITY_MANAGER_PROPERTY;
-
- private static final boolean DEBUG = false ;
-
- //
- private static final int MULTIPLICITY = 1 ;
-
- //count of number of nodes created
- private int nodeCount = 0;
-
- //No. of nodes allowed.
- private int maxNodeLimit ;
-
-
- /**
- * Error reporter. This property identifier is:
- * http://apache.org/xml/properties/internal/error-reporter
- */
- private XMLErrorReporter fErrorReporter;
-
- // stores defaults for different security holes (maxOccurLimit in current context) if it has
- // been set on the configuration.
- private XMLSecurityManager fSecurityManager = null;
-
- /** default constructor */
- public CMNodeFactory() {
- }
-
- public void reset(XMLComponentManager componentManager){
- fErrorReporter = (XMLErrorReporter)componentManager.getProperty(ERROR_REPORTER);
- try {
- fSecurityManager = (XMLSecurityManager)componentManager.getProperty(SECURITY_MANAGER);
- //we are setting the limit of number of nodes to 3times the maxOccur value..
- if(fSecurityManager != null){
- maxNodeLimit = fSecurityManager.getLimit(XMLSecurityManager.Limit.MAX_OCCUR_NODE_LIMIT) * MULTIPLICITY ;
- }
- }
- catch (XMLConfigurationException e) {
- fSecurityManager = null;
- }
-
- }//reset()
-
- public CMNode getCMLeafNode(int type, Object leaf, int id, int position) {
- return new XSCMLeaf(type, leaf, id, position) ;
- }
-
- public CMNode getCMRepeatingLeafNode(int type, Object leaf,
- int minOccurs, int maxOccurs, int id, int position) {
- nodeCountCheck();
- return new XSCMRepeatingLeaf(type, leaf, minOccurs, maxOccurs, id, position);
- }
-
- public CMNode getCMUniOpNode(int type, CMNode childNode) {
- nodeCountCheck();
- return new XSCMUniOp(type, childNode) ;
- }
-
- public CMNode getCMBinOpNode(int type, CMNode leftNode, CMNode rightNode) {
- return new XSCMBinOp(type, leftNode, rightNode) ;
- }
-
- public void nodeCountCheck(){
- if( fSecurityManager != null && !fSecurityManager.isNoLimit(maxNodeLimit) &&
- nodeCount++ > maxNodeLimit){
- if(DEBUG){
- System.out.println("nodeCount = " + nodeCount ) ;
- System.out.println("nodeLimit = " + maxNodeLimit ) ;
- }
- fErrorReporter.reportError(XSMessageFormatter.SCHEMA_DOMAIN, "MaxOccurLimit", new Object[]{ new Integer(maxNodeLimit) }, XMLErrorReporter.SEVERITY_FATAL_ERROR);
- // similarly to entity manager behaviour, take into accont
- // behaviour if continue-after-fatal-error is set.
- nodeCount = 0;
- }
-
- }//nodeCountCheck()
-
- //reset the node count
- public void resetNodeCount(){
- nodeCount = 0 ;
- }
- /**
- * Sets the value of a property. This method is called by the component
- * manager any time after reset when a property changes value.
- * <p>
- * <strong>Note:</strong> Components should silently ignore properties
- * that do not affect the operation of the component.
- *
- * @param propertyId The property identifier.
- * @param value The value of the property.
- *
- * @throws SAXNotRecognizedException The component should not throw
- * this exception.
- * @throws SAXNotSupportedException The component should not throw
- * this exception.
- */
- public void setProperty(String propertyId, Object value)
- throws XMLConfigurationException {
-
- // Xerces properties
- if (propertyId.startsWith(Constants.XERCES_PROPERTY_PREFIX)) {
- final int suffixLength = propertyId.length() - Constants.XERCES_PROPERTY_PREFIX.length();
-
- if (suffixLength == Constants.SECURITY_MANAGER_PROPERTY.length() &&
- propertyId.endsWith(Constants.SECURITY_MANAGER_PROPERTY)) {
- fSecurityManager = (XMLSecurityManager)value;
- maxNodeLimit = (fSecurityManager != null) ?
- fSecurityManager.getLimit(XMLSecurityManager.Limit.MAX_OCCUR_NODE_LIMIT) * MULTIPLICITY : 0 ;
- return;
- }
- if (suffixLength == Constants.ERROR_REPORTER_PROPERTY.length() &&
- propertyId.endsWith(Constants.ERROR_REPORTER_PROPERTY)) {
- fErrorReporter = (XMLErrorReporter)value;
- return;
- }
- }
-
- } // setProperty(String,Object)
-
-}//CMNodeFactory()
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSAllCM.java b/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSAllCM.java
deleted file mode 100644
index f2cf0a7..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSAllCM.java
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.models;
-
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.impl.xs.XSElementDecl;
-import com.sun.org.apache.xerces.internal.impl.xs.SubstitutionGroupHandler;
-import com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaException;
-import com.sun.org.apache.xerces.internal.impl.xs.XSConstraints;
-
-import java.util.Vector;
-import java.util.ArrayList;
-
-/**
- * XSAllCM implements XSCMValidator and handles &lt;all&gt;.
- *
- * @xerces.internal
- *
- * @author Pavani Mukthipudi, Sun Microsystems Inc.
- * @version $Id: XSAllCM.java,v 1.10 2010-11-01 04:39:58 joehw Exp $
- */
-public class XSAllCM implements XSCMValidator {
-
- //
- // Constants
- //
-
- // start the content model: did not see any children
- private static final short STATE_START = 0;
- private static final short STATE_VALID = 1;
- private static final short STATE_CHILD = 1;
-
-
- //
- // Data
- //
-
- private XSElementDecl fAllElements[];
- private boolean fIsOptionalElement[];
- private boolean fHasOptionalContent = false;
- private int fNumElements = 0;
-
- //
- // Constructors
- //
-
- public XSAllCM (boolean hasOptionalContent, int size) {
- fHasOptionalContent = hasOptionalContent;
- fAllElements = new XSElementDecl[size];
- fIsOptionalElement = new boolean[size];
- }
-
- public void addElement (XSElementDecl element, boolean isOptional) {
- fAllElements[fNumElements] = element;
- fIsOptionalElement[fNumElements] = isOptional;
- fNumElements++;
- }
-
-
- //
- // XSCMValidator methods
- //
-
- /**
- * This methods to be called on entering a first element whose type
- * has this content model. It will return the initial state of the
- * content model
- *
- * @return Start state of the content model
- */
- public int[] startContentModel() {
-
- int[] state = new int[fNumElements + 1];
-
- for (int i = 0; i <= fNumElements; i++) {
- state[i] = STATE_START;
- }
- return state;
- }
-
- // convinient method: when error occurs, to find a matching decl
- // from the candidate elements.
- Object findMatchingDecl(QName elementName, SubstitutionGroupHandler subGroupHandler) {
- Object matchingDecl = null;
- for (int i = 0; i < fNumElements; i++) {
- matchingDecl = subGroupHandler.getMatchingElemDecl(elementName, fAllElements[i]);
- if (matchingDecl != null)
- break;
- }
- return matchingDecl;
- }
-
- /**
- * The method corresponds to one transition in the content model.
- *
- * @param elementName
- * @param currentState Current state
- * @return an element decl object
- */
- public Object oneTransition (QName elementName, int[] currentState, SubstitutionGroupHandler subGroupHandler) {
-
- // error state
- if (currentState[0] < 0) {
- currentState[0] = XSCMValidator.SUBSEQUENT_ERROR;
- return findMatchingDecl(elementName, subGroupHandler);
- }
-
- // seen child
- currentState[0] = STATE_CHILD;
-
- Object matchingDecl = null;
-
- for (int i = 0; i < fNumElements; i++) {
- // we only try to look for a matching decl if we have not seen
- // this element yet.
- if (currentState[i+1] != STATE_START)
- continue;
- matchingDecl = subGroupHandler.getMatchingElemDecl(elementName, fAllElements[i]);
- if (matchingDecl != null) {
- // found the decl, mark this element as "seen".
- currentState[i+1] = STATE_VALID;
- return matchingDecl;
- }
- }
-
- // couldn't find the decl, change to error state.
- currentState[0] = XSCMValidator.FIRST_ERROR;
- return findMatchingDecl(elementName, subGroupHandler);
- }
-
-
- /**
- * The method indicates the end of list of children
- *
- * @param currentState Current state of the content model
- * @return true if the last state was a valid final state
- */
- public boolean endContentModel (int[] currentState) {
-
- int state = currentState[0];
-
- if (state == XSCMValidator.FIRST_ERROR || state == XSCMValidator.SUBSEQUENT_ERROR) {
- return false;
- }
-
- // If <all> has minOccurs of zero and there are
- // no children to validate, it is trivially valid
- if (fHasOptionalContent && state == STATE_START) {
- return true;
- }
-
- for (int i = 0; i < fNumElements; i++) {
- // if one element is required, but not present, then error
- if (!fIsOptionalElement[i] && currentState[i+1] == STATE_START)
- return false;
- }
-
- return true;
- }
-
- /**
- * check whether this content violates UPA constraint.
- *
- * @param subGroupHandler the substitution group handler
- * @return true if this content model contains other or list wildcard
- */
- public boolean checkUniqueParticleAttribution(SubstitutionGroupHandler subGroupHandler) throws XMLSchemaException {
- // check whether there is conflict between any two leaves
- for (int i = 0; i < fNumElements; i++) {
- for (int j = i+1; j < fNumElements; j++) {
- if (XSConstraints.overlapUPA(fAllElements[i], fAllElements[j], subGroupHandler)) {
- // REVISIT: do we want to report all errors? or just one?
- throw new XMLSchemaException("cos-nonambig", new Object[]{fAllElements[i].toString(),
- fAllElements[j].toString()});
- }
- }
- }
-
- return false;
- }
-
- /**
- * Check which elements are valid to appear at this point. This method also
- * works if the state is in error, in which case it returns what should
- * have been seen.
- *
- * @param state the current state
- * @return a Vector whose entries are instances of
- * either XSWildcardDecl or XSElementDecl.
- */
- public Vector whatCanGoHere(int[] state) {
- Vector ret = new Vector();
- for (int i = 0; i < fNumElements; i++) {
- // we only try to look for a matching decl if we have not seen
- // this element yet.
- if (state[i+1] == STATE_START)
- ret.addElement(fAllElements[i]);
- }
- return ret;
- }
-
- public ArrayList checkMinMaxBounds() {
- return null;
- }
-
-} // class XSAllCM
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMBinOp.java b/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMBinOp.java
deleted file mode 100644
index be62f38..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMBinOp.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.models;
-
-import com.sun.org.apache.xerces.internal.impl.dtd.models.CMNode;
-import com.sun.org.apache.xerces.internal.impl.dtd.models.CMStateSet;
-import com.sun.org.apache.xerces.internal.impl.xs.XSModelGroupImpl;
-
-/**
- *
- * Content model Bin-Op node.
- *
- * @xerces.internal
- *
- * @author Neil Graham, IBM
- */
-public class XSCMBinOp extends CMNode {
- // -------------------------------------------------------------------
- // Constructors
- // -------------------------------------------------------------------
- public XSCMBinOp(int type, CMNode leftNode, CMNode rightNode)
- {
- super(type);
-
- // Insure that its one of the types we require
- if ((type() != XSModelGroupImpl.MODELGROUP_CHOICE)
- && (type() != XSModelGroupImpl.MODELGROUP_SEQUENCE)) {
- throw new RuntimeException("ImplementationMessages.VAL_BST");
- }
-
- // Store the nodes and init any data that needs it
- fLeftChild = leftNode;
- fRightChild = rightNode;
- }
-
-
- // -------------------------------------------------------------------
- // Package, final methods
- // -------------------------------------------------------------------
- final CMNode getLeft() {
- return fLeftChild;
- }
-
- final CMNode getRight() {
- return fRightChild;
- }
-
-
- // -------------------------------------------------------------------
- // Package, inherited methods
- // -------------------------------------------------------------------
- public boolean isNullable() {
- //
- // If its an alternation, then if either child is nullable then
- // this node is nullable. If its a concatenation, then both of
- // them have to be nullable.
- //
- if (type() == XSModelGroupImpl.MODELGROUP_CHOICE)
- return (fLeftChild.isNullable() || fRightChild.isNullable());
- else if (type() == XSModelGroupImpl.MODELGROUP_SEQUENCE)
- return (fLeftChild.isNullable() && fRightChild.isNullable());
- else
- throw new RuntimeException("ImplementationMessages.VAL_BST");
- }
-
-
- // -------------------------------------------------------------------
- // Protected, inherited methods
- // -------------------------------------------------------------------
- protected void calcFirstPos(CMStateSet toSet) {
- if (type() == XSModelGroupImpl.MODELGROUP_CHOICE) {
- // Its the the union of the first positions of our children.
- toSet.setTo(fLeftChild.firstPos());
- toSet.union(fRightChild.firstPos());
- }
- else if (type() == XSModelGroupImpl.MODELGROUP_SEQUENCE) {
- //
- // If our left child is nullable, then its the union of our
- // children's first positions. Else is our left child's first
- // positions.
- //
- toSet.setTo(fLeftChild.firstPos());
- if (fLeftChild.isNullable())
- toSet.union(fRightChild.firstPos());
- }
- else {
- throw new RuntimeException("ImplementationMessages.VAL_BST");
- }
- }
-
- protected void calcLastPos(CMStateSet toSet) {
- if (type() == XSModelGroupImpl.MODELGROUP_CHOICE) {
- // Its the the union of the first positions of our children.
- toSet.setTo(fLeftChild.lastPos());
- toSet.union(fRightChild.lastPos());
- }
- else if (type() == XSModelGroupImpl.MODELGROUP_SEQUENCE) {
- //
- // If our right child is nullable, then its the union of our
- // children's last positions. Else is our right child's last
- // positions.
- //
- toSet.setTo(fRightChild.lastPos());
- if (fRightChild.isNullable())
- toSet.union(fLeftChild.lastPos());
- }
- else {
- throw new RuntimeException("ImplementationMessages.VAL_BST");
- }
- }
-
-
- // -------------------------------------------------------------------
- // Private data members
- //
- // fLeftChild
- // fRightChild
- // These are the references to the two nodes that are on either
- // side of this binary operation.
- // -------------------------------------------------------------------
- private CMNode fLeftChild;
- private CMNode fRightChild;
-} // XSCMBinOp
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMLeaf.java b/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMLeaf.java
deleted file mode 100644
index 9359d21..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMLeaf.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.models;
-
-import com.sun.org.apache.xerces.internal.impl.dtd.models.CMNode;
-import com.sun.org.apache.xerces.internal.impl.dtd.models.CMStateSet;
-
-/**
- * Content model leaf node.
- *
- * @xerces.internal
- *
- * @author Neil Graham, IBM
- */
-public class XSCMLeaf
- extends CMNode {
-
- //
- // Data
- //
-
- /** This is the leaf: element decl or wildcard decl. */
- private Object fLeaf = null;
-
- /**
- * Identify the particle: for UPA checking
- */
- private int fParticleId = -1;
-
- /**
- * Part of the algorithm to convert a regex directly to a DFA
- * numbers each leaf sequentially. If its -1, that means its an
- * epsilon node. Zero and greater are non-epsilon positions.
- */
- private int fPosition = -1;
-
- //
- // Constructors
- //
-
- /** Constructs a content model leaf. */
- public XSCMLeaf(int type, Object leaf, int id, int position) {
- super(type);
-
- // Store the element index and position
- fLeaf = leaf;
- fParticleId = id;
- fPosition = position;
- }
-
- //
- // Package methods
- //
-
- final Object getLeaf() {
- return fLeaf;
- }
-
- final int getParticleId() {
- return fParticleId;
- }
-
- final int getPosition() {
- return fPosition;
- }
-
- final void setPosition(int newPosition) {
- fPosition = newPosition;
- }
-
- //
- // CMNode methods
- //
-
- // package
-
- public boolean isNullable() {
- // Leaf nodes are never nullable unless its an epsilon node
- return (fPosition == -1);
- }
-
- public String toString() {
- StringBuffer strRet = new StringBuffer(fLeaf.toString());
- if (fPosition >= 0) {
- strRet.append
- (
- " (Pos:"
- + Integer.toString(fPosition)
- + ")"
- );
- }
- return strRet.toString();
- }
-
- // protected
-
- protected void calcFirstPos(CMStateSet toSet) {
- // If we are an epsilon node, then the first pos is an empty set
- if (fPosition == -1)
- toSet.zeroBits();
-
- // Otherwise, its just the one bit of our position
- else
- toSet.setBit(fPosition);
- }
-
- protected void calcLastPos(CMStateSet toSet) {
- // If we are an epsilon node, then the last pos is an empty set
- if (fPosition == -1)
- toSet.zeroBits();
-
- // Otherwise, its just the one bit of our position
- else
- toSet.setBit(fPosition);
- }
-
-} // class XSCMLeaf
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMRepeatingLeaf.java b/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMRepeatingLeaf.java
deleted file mode 100644
index 4678896..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMRepeatingLeaf.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.models;
-
-/**
- * A compound content model leaf node which carries occurence information.
- *
- * @xerces.internal
- *
- * @author Michael Glavassevich, IBM
- * @version $Id: XSCMRepeatingLeaf.java,v 1.1 2010/08/06 23:49:43 joehw Exp $
- */
-public final class XSCMRepeatingLeaf extends XSCMLeaf {
-
- private final int fMinOccurs;
- private final int fMaxOccurs;
-
- public XSCMRepeatingLeaf(int type, Object leaf,
- int minOccurs, int maxOccurs, int id, int position) {
- super(type, leaf, id, position);
- fMinOccurs = minOccurs;
- fMaxOccurs = maxOccurs;
- }
-
- final int getMinOccurs() {
- return fMinOccurs;
- }
-
- final int getMaxOccurs() {
- return fMaxOccurs;
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMUniOp.java b/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMUniOp.java
deleted file mode 100644
index 87b0596..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMUniOp.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.models;
-
-import com.sun.org.apache.xerces.internal.impl.dtd.models.CMNode;
-import com.sun.org.apache.xerces.internal.impl.dtd.models.CMStateSet;
-import com.sun.org.apache.xerces.internal.impl.xs.XSParticleDecl;
-
-/**
- *
- * Content model Uni-Op node.
- *
- * @xerces.internal
- *
- * @author Neil Graham, IBM
- * @version $$
- */
-public class XSCMUniOp extends CMNode {
- // -------------------------------------------------------------------
- // Constructors
- // -------------------------------------------------------------------
- public XSCMUniOp(int type, CMNode childNode) {
- super(type);
-
- // Insure that its one of the types we require
- if ((type() != XSParticleDecl.PARTICLE_ZERO_OR_ONE)
- && (type() != XSParticleDecl.PARTICLE_ZERO_OR_MORE)
- && (type() != XSParticleDecl.PARTICLE_ONE_OR_MORE)) {
- throw new RuntimeException("ImplementationMessages.VAL_UST");
- }
-
- // Store the node and init any data that needs it
- fChild = childNode;
- }
-
-
- // -------------------------------------------------------------------
- // Package, final methods
- // -------------------------------------------------------------------
- final CMNode getChild() {
- return fChild;
- }
-
-
- // -------------------------------------------------------------------
- // Package, inherited methods
- // -------------------------------------------------------------------
- public boolean isNullable() {
- //
- // For debugging purposes, make sure we got rid of all non '*'
- // repetitions. Otherwise, '*' style nodes are always nullable.
- //
- if (type() == XSParticleDecl.PARTICLE_ONE_OR_MORE)
- return fChild.isNullable();
- else
- return true;
- }
-
-
- // -------------------------------------------------------------------
- // Protected, inherited methods
- // -------------------------------------------------------------------
- protected void calcFirstPos(CMStateSet toSet) {
- // Its just based on our child node's first pos
- toSet.setTo(fChild.firstPos());
- }
-
- protected void calcLastPos(CMStateSet toSet) {
- // Its just based on our child node's last pos
- toSet.setTo(fChild.lastPos());
- }
-
- /**
- * Allows the user to set arbitrary data on this content model
- * node. This is used by the a{n,m} optimization that runs
- * in constant space. For convenience, set user data in
- * children node too.
- */
- @Override
- public void setUserData(Object userData) {
- super.setUserData(userData);
- fChild.setUserData(userData);
- }
-
-
- // -------------------------------------------------------------------
- // Private data members
- //
- // fChild
- // This is the reference to the one child that we have for this
- // unary operation.
- // -------------------------------------------------------------------
- private CMNode fChild;
-} // XSCMUniOp
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMValidator.java b/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMValidator.java
deleted file mode 100644
index 341d88b..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMValidator.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.models;
-
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.impl.xs.SubstitutionGroupHandler;
-import com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaException;
-
-import java.util.Vector;
-import java.util.ArrayList;
-
-/**
- * Note: State of the content model is stored in the validator
- *
- * @xerces.internal
- *
- * @author Sandy Gao, IBM
- * @author Elena Litani, IBM
- * @version $Id: XSCMValidator.java,v 1.6 2009/07/28 15:18:12 spericas Exp $
- */
-public interface XSCMValidator {
-
-
- public static final short FIRST_ERROR = -1;
-
- // on subsequent errors the validator should not report
- // an error
- //
- public static final short SUBSEQUENT_ERROR = -2;
-
- /**
- * This methods to be called on entering a first element whose type
- * has this content model. It will return the initial state of the content model
- *
- * @return Start state of the content model
- */
- public int[] startContentModel();
-
-
- /**
- * The method corresponds to one transaction in the content model.
- *
- * @param elementName
- * @param state Current state
- * @return element decl or wildcard decl that
- * corresponds to the element from the Schema grammar
- */
- public Object oneTransition (QName elementName, int[] state, SubstitutionGroupHandler subGroupHandler);
-
-
- /**
- * The method indicates the end of list of children
- *
- * @param state Current state of the content model
- * @return true if the last state was a valid final state
- */
- public boolean endContentModel (int[] state);
-
- /**
- * check whether this content violates UPA constraint.
- *
- * @param subGroupHandler the substitution group handler
- * @return true if this content model contains other or list wildcard
- */
- public boolean checkUniqueParticleAttribution(SubstitutionGroupHandler subGroupHandler) throws XMLSchemaException;
-
- /**
- * Check which elements are valid to appear at this point. This method also
- * works if the state is in error, in which case it returns what should
- * have been seen.
- *
- * @param state the current state
- * @return a Vector whose entries are instances of
- * either XSWildcardDecl or XSElementDecl.
- */
- public Vector whatCanGoHere(int[] state);
-
- /**
- * Used by constant space algorithm for a{n,m} for n > 1 and
- * m <= unbounded. Called by a validator if validation of
- * countent model succeeds after subsuming a{n,m} to a*
- * (or a+) to check the n and m bounds.
- * Returns <code>null</code> if validation of bounds is
- * successful. Returns a list of strings with error info
- * if not. Even entries in list returned are error codes
- * (used to look up properties) and odd entries are parameters
- * to be passed when formatting error message. Each parameter
- * is associated with the error code that preceeds it in
- * the list.
- */
- public ArrayList checkMinMaxBounds();
-
-} // XSCMValidator
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSDFACM.java b/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSDFACM.java
deleted file mode 100644
index e4b5ee2..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSDFACM.java
+++ /dev/null
@@ -1,1242 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.models;
-
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.impl.dtd.models.CMNode;
-import com.sun.org.apache.xerces.internal.impl.dtd.models.CMStateSet;
-import com.sun.org.apache.xerces.internal.impl.xs.SchemaSymbols;
-import com.sun.org.apache.xerces.internal.impl.xs.SubstitutionGroupHandler;
-import com.sun.org.apache.xerces.internal.impl.xs.XSElementDecl;
-import com.sun.org.apache.xerces.internal.impl.xs.XSParticleDecl;
-import com.sun.org.apache.xerces.internal.impl.xs.XSModelGroupImpl;
-import com.sun.org.apache.xerces.internal.impl.xs.XSWildcardDecl;
-import com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaException;
-import com.sun.org.apache.xerces.internal.impl.xs.XSConstraints;
-
-import java.util.Vector;
-import java.util.ArrayList;
-import java.util.HashMap;
-
-/**
- * DFAContentModel is the implementation of XSCMValidator that does
- * all of the non-trivial element content validation. This class does
- * the conversion from the regular expression to the DFA that
- * it then uses in its validation algorithm.
- *
- * @xerces.internal
- *
- * @author Neil Graham, IBM
- * @version $Id: XSDFACM.java,v 1.9 2010/08/06 23:49:43 joehw Exp $
- */
-public class XSDFACM
- implements XSCMValidator {
-
- //
- // Constants
- //
- private static final boolean DEBUG = false;
-
- // special strings
-
- // debugging
-
- /** Set to true to debug content model validation. */
- private static final boolean DEBUG_VALIDATE_CONTENT = false;
-
- //
- // Data
- //
-
- /**
- * This is the map of unique input symbol elements to indices into
- * each state's per-input symbol transition table entry. This is part
- * of the built DFA information that must be kept around to do the
- * actual validation. Note tat since either XSElementDecl or XSParticleDecl object
- * can live here, we've got to use an Object.
- */
- private Object fElemMap[] = null;
-
- /**
- * This is a map of whether the element map contains information
- * related to ANY models.
- */
- private int fElemMapType[] = null;
-
- /**
- * id of the unique input symbol
- */
- private int fElemMapId[] = null;
-
- /** The element map size. */
- private int fElemMapSize = 0;
-
- /**
- * This is an array of booleans, one per state (there are
- * fTransTableSize states in the DFA) that indicates whether that
- * state is a final state.
- */
- private boolean fFinalStateFlags[] = null;
-
- /**
- * The list of follow positions for each NFA position (i.e. for each
- * non-epsilon leaf node.) This is only used during the building of
- * the DFA, and is let go afterwards.
- */
- private CMStateSet fFollowList[] = null;
-
- /**
- * This is the head node of our intermediate representation. It is
- * only non-null during the building of the DFA (just so that it
- * does not have to be passed all around.) Once the DFA is built,
- * this is no longer required so its nulled out.
- */
- private CMNode fHeadNode = null;
-
- /**
- * The count of leaf nodes. This is an important number that set some
- * limits on the sizes of data structures in the DFA process.
- */
- private int fLeafCount = 0;
-
- /**
- * An array of non-epsilon leaf nodes, which is used during the DFA
- * build operation, then dropped.
- */
- private XSCMLeaf fLeafList[] = null;
-
- /** Array mapping ANY types to the leaf list. */
- private int fLeafListType[] = null;
-
- /**
- * This is the transition table that is the main by product of all
- * of the effort here. It is an array of arrays of ints. The first
- * dimension is the number of states we end up with in the DFA. The
- * second dimensions is the number of unique elements in the content
- * model (fElemMapSize). Each entry in the second dimension indicates
- * the new state given that input for the first dimension's start
- * state.
- * <p>
- * The fElemMap array handles mapping from element indexes to
- * positions in the second dimension of the transition table.
- */
- private int fTransTable[][] = null;
- /**
- * Array containing occurence information for looping states
- * which use counters to check minOccurs/maxOccurs.
- */
- private Occurence [] fCountingStates = null;
- static final class Occurence {
- final int minOccurs;
- final int maxOccurs;
- final int elemIndex;
- public Occurence (XSCMRepeatingLeaf leaf, int elemIndex) {
- minOccurs = leaf.getMinOccurs();
- maxOccurs = leaf.getMaxOccurs();
- this.elemIndex = elemIndex;
- }
- public String toString() {
- return "minOccurs=" + minOccurs
- + ";maxOccurs=" +
- ((maxOccurs != SchemaSymbols.OCCURRENCE_UNBOUNDED)
- ? Integer.toString(maxOccurs) : "unbounded");
- }
- }
-
- /**
- * The number of valid entries in the transition table, and in the other
- * related tables such as fFinalStateFlags.
- */
- private int fTransTableSize = 0;
-
- /**
- * Array of counters for all the for elements (or wildcards)
- * of the form a{n,m} where n > 1 and m <= unbounded. Used
- * to count the a's to later check against n and m. Counter
- * set to -1 if element (or wildcard) not optimized by
- * constant space algorithm.
- */
- private int fElemMapCounter[];
-
- /**
- * Array of lower bounds for all the for elements (or wildcards)
- * of the form a{n,m} where n > 1 and m <= unbounded. This array
- * stores the n's for those elements (or wildcards) for which
- * the constant space algorithm applies (or -1 otherwise).
- */
- private int fElemMapCounterLowerBound[];
-
- /**
- * Array of upper bounds for all the for elements (or wildcards)
- * of the form a{n,m} where n > 1 and m <= unbounded. This array
- * stores the n's for those elements (or wildcards) for which
- * the constant space algorithm applies, or -1 if algorithm does
- * not apply or m = unbounded.
- */
- private int fElemMapCounterUpperBound[]; // -1 if no upper bound
-
- // temp variables
-
- //
- // Constructors
- //
-
- /**
- * Constructs a DFA content model.
- *
- * @param syntaxTree The syntax tree of the content model.
- * @param leafCount The number of leaves.
- *
- * @exception RuntimeException Thrown if DFA can't be built.
- */
-
- public XSDFACM(CMNode syntaxTree, int leafCount) {
-
- // Store away our index and pools in members
- fLeafCount = leafCount;
-
- //
- // Create some string pool indexes that represent the names of some
- // magical nodes in the syntax tree.
- // (already done in static initialization...
- //
-
- //
- // Ok, so lets grind through the building of the DFA. This method
- // handles the high level logic of the algorithm, but it uses a
- // number of helper classes to do its thing.
- //
- // In order to avoid having hundreds of references to the error and
- // string handlers around, this guy and all of his helper classes
- // just throw a simple exception and we then pass it along.
- //
-
- if(DEBUG_VALIDATE_CONTENT) {
- XSDFACM.time -= System.currentTimeMillis();
- }
-
- buildDFA(syntaxTree);
-
- if(DEBUG_VALIDATE_CONTENT) {
- XSDFACM.time += System.currentTimeMillis();
- System.out.println("DFA build: " + XSDFACM.time + "ms");
- }
- }
-
- private static long time = 0;
-
- //
- // XSCMValidator methods
- //
-
- /**
- * check whether the given state is one of the final states
- *
- * @param state the state to check
- *
- * @return whether it's a final state
- */
- public boolean isFinalState (int state) {
- return (state < 0)? false :
- fFinalStateFlags[state];
- }
-
- /**
- * one transition only
- *
- * @param curElem The current element's QName
- * @param state stack to store the previous state
- * @param subGroupHandler the substitution group handler
- *
- * @return null if transition is invalid; otherwise the Object corresponding to the
- * XSElementDecl or XSWildcardDecl identified. Also, the
- * state array will be modified to include the new state; this so that the validator can
- * store it away.
- *
- * @exception RuntimeException thrown on error
- */
- public Object oneTransition(QName curElem, int[] state, SubstitutionGroupHandler subGroupHandler) {
- int curState = state[0];
-
- if(curState == XSCMValidator.FIRST_ERROR || curState == XSCMValidator.SUBSEQUENT_ERROR) {
- // there was an error last time; so just go find correct Object in fElemmMap.
- // ... after resetting state[0].
- if(curState == XSCMValidator.FIRST_ERROR)
- state[0] = XSCMValidator.SUBSEQUENT_ERROR;
-
- return findMatchingDecl(curElem, subGroupHandler);
- }
-
- int nextState = 0;
- int elemIndex = 0;
- Object matchingDecl = null;
-
- for (; elemIndex < fElemMapSize; elemIndex++) {
- nextState = fTransTable[curState][elemIndex];
- if (nextState == -1)
- continue;
- int type = fElemMapType[elemIndex] ;
- if (type == XSParticleDecl.PARTICLE_ELEMENT) {
- matchingDecl = subGroupHandler.getMatchingElemDecl(curElem, (XSElementDecl)fElemMap[elemIndex]);
- if (matchingDecl != null) {
- // Increment counter if constant space algorithm applies
- if (fElemMapCounter[elemIndex] >= 0) {
- fElemMapCounter[elemIndex]++;
- }
- break;
- }
- }
- else if (type == XSParticleDecl.PARTICLE_WILDCARD) {
- if (((XSWildcardDecl)fElemMap[elemIndex]).allowNamespace(curElem.uri)) {
- matchingDecl = fElemMap[elemIndex];
- // Increment counter if constant space algorithm applies
- if (fElemMapCounter[elemIndex] >= 0) {
- fElemMapCounter[elemIndex]++;
- }
- break;
- }
- }
- }
-
- // if we still can't find a match, set the state to first_error
- // and return null
- if (elemIndex == fElemMapSize) {
- state[1] = state[0];
- state[0] = XSCMValidator.FIRST_ERROR;
- return findMatchingDecl(curElem, subGroupHandler);
- }
-
- if (fCountingStates != null) {
- Occurence o = fCountingStates[curState];
- if (o != null) {
- if (curState == nextState) {
- if (++state[2] > o.maxOccurs &&
- o.maxOccurs != SchemaSymbols.OCCURRENCE_UNBOUNDED) {
- // It's likely that we looped too many times on the current state
- // however it's possible that we actually matched another particle
- // which allows the same name.
- //
- // Consider:
- //
- // <xs:sequence>
- // <xs:element name="foo" type="xs:string" minOccurs="3" maxOccurs="3"/>
- // <xs:element name="foo" type="xs:string" fixed="bar"/>
- // </xs:sequence>
- //
- // and
- //
- // <xs:sequence>
- // <xs:element name="foo" type="xs:string" minOccurs="3" maxOccurs="3"/>
- // <xs:any namespace="##any" processContents="skip"/>
- // </xs:sequence>
- //
- // In the DFA there will be two transitions from the current state which
- // allow "foo". Note that this is not a UPA violation. The ambiguity of which
- // transition to take is resolved by the current value of the counter. Since
- // we've already seen enough instances of the first "foo" perhaps there is
- // another element declaration or wildcard deeper in the element map which
- // matches.
- return findMatchingDecl(curElem, state, subGroupHandler, elemIndex);
- }
- }
- else if (state[2] < o.minOccurs) {
- // not enough loops on the current state.
- state[1] = state[0];
- state[0] = XSCMValidator.FIRST_ERROR;
- return findMatchingDecl(curElem, subGroupHandler);
- }
- else {
- // Exiting a counting state. If we're entering a new
- // counting state, reset the counter.
- o = fCountingStates[nextState];
- if (o != null) {
- state[2] = (elemIndex == o.elemIndex) ? 1 : 0;
- }
- }
- }
- else {
- o = fCountingStates[nextState];
- if (o != null) {
- // Entering a new counting state. Reset the counter.
- // If we've already seen one instance of the looping
- // particle set the counter to 1, otherwise set it
- // to 0.
- state[2] = (elemIndex == o.elemIndex) ? 1 : 0;
- }
- }
- }
-
- state[0] = nextState;
- return matchingDecl;
- } // oneTransition(QName, int[], SubstitutionGroupHandler): Object
-
- Object findMatchingDecl(QName curElem, SubstitutionGroupHandler subGroupHandler) {
- Object matchingDecl = null;
-
- for (int elemIndex = 0; elemIndex < fElemMapSize; elemIndex++) {
- int type = fElemMapType[elemIndex] ;
- if (type == XSParticleDecl.PARTICLE_ELEMENT) {
- matchingDecl = subGroupHandler.getMatchingElemDecl(curElem, (XSElementDecl)fElemMap[elemIndex]);
- if (matchingDecl != null) {
- return matchingDecl;
- }
- }
- else if (type == XSParticleDecl.PARTICLE_WILDCARD) {
- if(((XSWildcardDecl)fElemMap[elemIndex]).allowNamespace(curElem.uri))
- return fElemMap[elemIndex];
- }
- }
-
- return null;
- } // findMatchingDecl(QName, SubstitutionGroupHandler): Object
-
- Object findMatchingDecl(QName curElem, int[] state, SubstitutionGroupHandler subGroupHandler, int elemIndex) {
-
- int curState = state[0];
- int nextState = 0;
- Object matchingDecl = null;
-
- while (++elemIndex < fElemMapSize) {
- nextState = fTransTable[curState][elemIndex];
- if (nextState == -1)
- continue;
- int type = fElemMapType[elemIndex] ;
- if (type == XSParticleDecl.PARTICLE_ELEMENT) {
- matchingDecl = subGroupHandler.getMatchingElemDecl(curElem, (XSElementDecl)fElemMap[elemIndex]);
- if (matchingDecl != null) {
- break;
- }
- }
- else if (type == XSParticleDecl.PARTICLE_WILDCARD) {
- if (((XSWildcardDecl)fElemMap[elemIndex]).allowNamespace(curElem.uri)) {
- matchingDecl = fElemMap[elemIndex];
- break;
- }
- }
- }
-
- // if we still can't find a match, set the state to FIRST_ERROR and return null
- if (elemIndex == fElemMapSize) {
- state[1] = state[0];
- state[0] = XSCMValidator.FIRST_ERROR;
- return findMatchingDecl(curElem, subGroupHandler);
- }
-
- // if we found a match, set the next state and reset the
- // counter if the next state is a counting state.
- state[0] = nextState;
- final Occurence o = fCountingStates[nextState];
- if (o != null) {
- state[2] = (elemIndex == o.elemIndex) ? 1 : 0;
- }
- return matchingDecl;
- } // findMatchingDecl(QName, int[], SubstitutionGroupHandler, int): Object
-
- // This method returns the start states of the content model.
- public int[] startContentModel() {
- // Clear all constant space algorithm counters in use
- for (int elemIndex = 0; elemIndex < fElemMapSize; elemIndex++) {
- if (fElemMapCounter[elemIndex] != -1) {
- fElemMapCounter[elemIndex] = 0;
- }
- }
- // [0] : the current state
- // [1] : if [0] is an error state then the
- // last valid state before the error
- // [2] : occurence counter for counting states
- return new int [3];
- } // startContentModel():int[]
-
- // this method returns whether the last state was a valid final state
- public boolean endContentModel(int[] state) {
- final int curState = state[0];
- if (fFinalStateFlags[curState]) {
- if (fCountingStates != null) {
- Occurence o = fCountingStates[curState];
- if (o != null && state[2] < o.minOccurs) {
- // not enough loops on the current state to be considered final.
- return false;
- }
- }
- return true;
- }
- return false;
- } // endContentModel(int[]): boolean
-
- // Killed off whatCanGoHere; we may need it for DOM canInsert(...) etc.,
- // but we can put it back later.
-
- //
- // Private methods
- //
-
- /**
- * Builds the internal DFA transition table from the given syntax tree.
- *
- * @param syntaxTree The syntax tree.
- *
- * @exception RuntimeException Thrown if DFA cannot be built.
- */
- private void buildDFA(CMNode syntaxTree) {
- //
- // The first step we need to take is to rewrite the content model
- // using our CMNode objects, and in the process get rid of any
- // repetition short cuts, converting them into '*' style repetitions
- // or getting rid of repetitions altogether.
- //
- // The conversions done are:
- //
- // x+ -> (x|x*)
- // x? -> (x|epsilon)
- //
- // This is a relatively complex scenario. What is happening is that
- // we create a top level binary node of which the special EOC value
- // is set as the right side node. The the left side is set to the
- // rewritten syntax tree. The source is the original content model
- // info from the decl pool. The rewrite is done by buildSyntaxTree()
- // which recurses the decl pool's content of the element and builds
- // a new tree in the process.
- //
- // Note that, during this operation, we set each non-epsilon leaf
- // node's DFA state position and count the number of such leafs, which
- // is left in the fLeafCount member.
- //
- // The nodeTmp object is passed in just as a temp node to use during
- // the recursion. Otherwise, we'd have to create a new node on every
- // level of recursion, which would be piggy in Java (as is everything
- // for that matter.)
- //
-
- /* MODIFIED (Jan, 2001)
- *
- * Use following rules.
- * nullable(x+) := nullable(x), first(x+) := first(x), last(x+) := last(x)
- * nullable(x?) := true, first(x?) := first(x), last(x?) := last(x)
- *
- * The same computation of follow as x* is applied to x+
- *
- * The modification drastically reduces computation time of
- * "(a, (b, a+, (c, (b, a+)+, a+, (d, (c, (b, a+)+, a+)+, (b, a+)+, a+)+)+)+)+"
- */
-
- //
- // And handle specially the EOC node, which also must be numbered
- // and counted as a non-epsilon leaf node. It could not be handled
- // in the above tree build because it was created before all that
- // started. We save the EOC position since its used during the DFA
- // building loop.
- //
- int EOCPos = fLeafCount;
- XSCMLeaf nodeEOC = new XSCMLeaf(XSParticleDecl.PARTICLE_ELEMENT, null, -1, fLeafCount++);
- fHeadNode = new XSCMBinOp(
- XSModelGroupImpl.MODELGROUP_SEQUENCE,
- syntaxTree,
- nodeEOC
- );
-
- //
- // Ok, so now we have to iterate the new tree and do a little more
- // work now that we know the leaf count. One thing we need to do is
- // to calculate the first and last position sets of each node. This
- // is cached away in each of the nodes.
- //
- // Along the way we also set the leaf count in each node as the
- // maximum state count. They must know this in order to create their
- // first/last pos sets.
- //
- // We also need to build an array of references to the non-epsilon
- // leaf nodes. Since we iterate it in the same way as before, this
- // will put them in the array according to their position values.
- //
- fLeafList = new XSCMLeaf[fLeafCount];
- fLeafListType = new int[fLeafCount];
- postTreeBuildInit(fHeadNode);
-
- //
- // And, moving onward... We now need to build the follow position
- // sets for all the nodes. So we allocate an array of state sets,
- // one for each leaf node (i.e. each DFA position.)
- //
- fFollowList = new CMStateSet[fLeafCount];
- for (int index = 0; index < fLeafCount; index++)
- fFollowList[index] = new CMStateSet(fLeafCount);
- calcFollowList(fHeadNode);
- //
- // And finally the big push... Now we build the DFA using all the
- // states and the tree we've built up. First we set up the various
- // data structures we are going to use while we do this.
- //
- // First of all we need an array of unique element names in our
- // content model. For each transition table entry, we need a set of
- // contiguous indices to represent the transitions for a particular
- // input element. So we need to a zero based range of indexes that
- // map to element types. This element map provides that mapping.
- //
- fElemMap = new Object[fLeafCount];
- fElemMapType = new int[fLeafCount];
- fElemMapId = new int[fLeafCount];
-
- fElemMapCounter = new int[fLeafCount];
- fElemMapCounterLowerBound = new int[fLeafCount];
- fElemMapCounterUpperBound = new int[fLeafCount];
-
- fElemMapSize = 0;
- Occurence [] elemOccurenceMap = null;
-
- for (int outIndex = 0; outIndex < fLeafCount; outIndex++) {
- // optimization from Henry Zongaro:
- //fElemMap[outIndex] = new Object ();
- fElemMap[outIndex] = null;
-
- int inIndex = 0;
- final int id = fLeafList[outIndex].getParticleId();
- for (; inIndex < fElemMapSize; inIndex++) {
- if (id == fElemMapId[inIndex])
- break;
- }
-
- // If it was not in the list, then add it, if not the EOC node
- if (inIndex == fElemMapSize) {
- XSCMLeaf leaf = fLeafList[outIndex];
- fElemMap[fElemMapSize] = leaf.getLeaf();
- if (leaf instanceof XSCMRepeatingLeaf) {
- if (elemOccurenceMap == null) {
- elemOccurenceMap = new Occurence[fLeafCount];
- }
- elemOccurenceMap[fElemMapSize] = new Occurence((XSCMRepeatingLeaf) leaf, fElemMapSize);
- }
-
- fElemMapType[fElemMapSize] = fLeafListType[outIndex];
- fElemMapId[fElemMapSize] = id;
-
- // Init counters and bounds for a{n,m} algorithm
- int[] bounds = (int[]) leaf.getUserData();
- if (bounds != null) {
- fElemMapCounter[fElemMapSize] = 0;
- fElemMapCounterLowerBound[fElemMapSize] = bounds[0];
- fElemMapCounterUpperBound[fElemMapSize] = bounds[1];
- } else {
- fElemMapCounter[fElemMapSize] = -1;
- fElemMapCounterLowerBound[fElemMapSize] = -1;
- fElemMapCounterUpperBound[fElemMapSize] = -1;
- }
-
- fElemMapSize++;
- }
- }
-
- // the last entry in the element map must be the EOC element.
- // remove it from the map.
- if (DEBUG) {
- if (fElemMapId[fElemMapSize-1] != -1)
- System.err.println("interal error in DFA: last element is not EOC.");
- }
- fElemMapSize--;
-
- /***
- * Optimization(Jan, 2001); We sort fLeafList according to
- * elemIndex which is *uniquely* associated to each leaf.
- * We are *assuming* that each element appears in at least one leaf.
- **/
-
- int[] fLeafSorter = new int[fLeafCount + fElemMapSize];
- int fSortCount = 0;
-
- for (int elemIndex = 0; elemIndex < fElemMapSize; elemIndex++) {
- final int id = fElemMapId[elemIndex];
- for (int leafIndex = 0; leafIndex < fLeafCount; leafIndex++) {
- if (id == fLeafList[leafIndex].getParticleId())
- fLeafSorter[fSortCount++] = leafIndex;
- }
- fLeafSorter[fSortCount++] = -1;
- }
-
- /* Optimization(Jan, 2001) */
-
- //
- // Next lets create some arrays, some that hold transient
- // information during the DFA build and some that are permament.
- // These are kind of sticky since we cannot know how big they will
- // get, but we don't want to use any Java collections because of
- // performance.
- //
- // Basically they will probably be about fLeafCount*2 on average,
- // but can be as large as 2^(fLeafCount*2), worst case. So we start
- // with fLeafCount*4 as a middle ground. This will be very unlikely
- // to ever have to expand, though it if does, the overhead will be
- // somewhat ugly.
- //
- int curArraySize = fLeafCount * 4;
- CMStateSet[] statesToDo = new CMStateSet[curArraySize];
- fFinalStateFlags = new boolean[curArraySize];
- fTransTable = new int[curArraySize][];
-
- //
- // Ok we start with the initial set as the first pos set of the
- // head node (which is the seq node that holds the content model
- // and the EOC node.)
- //
- CMStateSet setT = fHeadNode.firstPos();
-
- //
- // Init our two state flags. Basically the unmarked state counter
- // is always chasing the current state counter. When it catches up,
- // that means we made a pass through that did not add any new states
- // to the lists, at which time we are done. We could have used a
- // expanding array of flags which we used to mark off states as we
- // complete them, but this is easier though less readable maybe.
- //
- int unmarkedState = 0;
- int curState = 0;
-
- //
- // Init the first transition table entry, and put the initial state
- // into the states to do list, then bump the current state.
- //
- fTransTable[curState] = makeDefStateList();
- statesToDo[curState] = setT;
- curState++;
-
- /* Optimization(Jan, 2001); This is faster for
- * a large content model such as, "(t001+|t002+|.... |t500+)".
- */
-
- HashMap stateTable = new HashMap();
-
- /* Optimization(Jan, 2001) */
-
- //
- // Ok, almost done with the algorithm... We now enter the
- // loop where we go until the states done counter catches up with
- // the states to do counter.
- //
- while (unmarkedState < curState) {
- //
- // Get the first unmarked state out of the list of states to do.
- // And get the associated transition table entry.
- //
- setT = statesToDo[unmarkedState];
- int[] transEntry = fTransTable[unmarkedState];
-
- // Mark this one final if it contains the EOC state
- fFinalStateFlags[unmarkedState] = setT.getBit(EOCPos);
-
- // Bump up the unmarked state count, marking this state done
- unmarkedState++;
-
- // Loop through each possible input symbol in the element map
- CMStateSet newSet = null;
- /* Optimization(Jan, 2001) */
- int sorterIndex = 0;
- /* Optimization(Jan, 2001) */
- for (int elemIndex = 0; elemIndex < fElemMapSize; elemIndex++) {
- //
- // Build up a set of states which is the union of all of
- // the follow sets of DFA positions that are in the current
- // state. If we gave away the new set last time through then
- // create a new one. Otherwise, zero out the existing one.
- //
- if (newSet == null)
- newSet = new CMStateSet(fLeafCount);
- else
- newSet.zeroBits();
-
- /* Optimization(Jan, 2001) */
- int leafIndex = fLeafSorter[sorterIndex++];
-
- while (leafIndex != -1) {
- // If this leaf index (DFA position) is in the current set...
- if (setT.getBit(leafIndex)) {
- //
- // If this leaf is the current input symbol, then we
- // want to add its follow list to the set of states to
- // transition to from the current state.
- //
- newSet.union(fFollowList[leafIndex]);
- }
-
- leafIndex = fLeafSorter[sorterIndex++];
- }
- /* Optimization(Jan, 2001) */
-
- //
- // If this new set is not empty, then see if its in the list
- // of states to do. If not, then add it.
- //
- if (!newSet.isEmpty()) {
- //
- // Search the 'states to do' list to see if this new
- // state set is already in there.
- //
-
- /* Optimization(Jan, 2001) */
- Integer stateObj = (Integer)stateTable.get(newSet);
- int stateIndex = (stateObj == null ? curState : stateObj.intValue());
- /* Optimization(Jan, 2001) */
-
- // If we did not find it, then add it
- if (stateIndex == curState) {
- //
- // Put this new state into the states to do and init
- // a new entry at the same index in the transition
- // table.
- //
- statesToDo[curState] = newSet;
- fTransTable[curState] = makeDefStateList();
-
- /* Optimization(Jan, 2001) */
- stateTable.put(newSet, new Integer(curState));
- /* Optimization(Jan, 2001) */
-
- // We now have a new state to do so bump the count
- curState++;
-
- //
- // Null out the new set to indicate we adopted it.
- // This will cause the creation of a new set on the
- // next time around the loop.
- //
- newSet = null;
- }
-
- //
- // Now set this state in the transition table's entry
- // for this element (using its index), with the DFA
- // state we will move to from the current state when we
- // see this input element.
- //
- transEntry[elemIndex] = stateIndex;
-
- // Expand the arrays if we're full
- if (curState == curArraySize) {
- //
- // Yikes, we overflowed the initial array size, so
- // we've got to expand all of these arrays. So adjust
- // up the size by 50% and allocate new arrays.
- //
- final int newSize = (int)(curArraySize * 1.5);
- CMStateSet[] newToDo = new CMStateSet[newSize];
- boolean[] newFinalFlags = new boolean[newSize];
- int[][] newTransTable = new int[newSize][];
-
- // Copy over all of the existing content
- System.arraycopy(statesToDo, 0, newToDo, 0, curArraySize);
- System.arraycopy(fFinalStateFlags, 0, newFinalFlags, 0, curArraySize);
- System.arraycopy(fTransTable, 0, newTransTable, 0, curArraySize);
-
- // Store the new array size
- curArraySize = newSize;
- statesToDo = newToDo;
- fFinalStateFlags = newFinalFlags;
- fTransTable = newTransTable;
- }
- }
- }
- }
-
- //
- // Fill in the occurence information for each looping state
- // if we're using counters.
- //
- if (elemOccurenceMap != null) {
- fCountingStates = new Occurence[curState];
- for (int i = 0; i < curState; ++i) {
- int [] transitions = fTransTable[i];
- for (int j = 0; j < transitions.length; ++j) {
- if (i == transitions[j]) {
- fCountingStates[i] = elemOccurenceMap[j];
- break;
- }
- }
- }
- }
-
- //
- // And now we can say bye bye to the temp representation since we've
- // built the DFA.
- //
- if (DEBUG_VALIDATE_CONTENT)
- dumpTree(fHeadNode, 0);
- fHeadNode = null;
- fLeafList = null;
- fFollowList = null;
- fLeafListType = null;
- fElemMapId = null;
- }
-
- /**
- * Calculates the follow list of the current node.
- *
- * @param nodeCur The curent node.
- *
- * @exception RuntimeException Thrown if follow list cannot be calculated.
- */
- private void calcFollowList(CMNode nodeCur) {
- // Recurse as required
- if (nodeCur.type() == XSModelGroupImpl.MODELGROUP_CHOICE) {
- // Recurse only
- calcFollowList(((XSCMBinOp)nodeCur).getLeft());
- calcFollowList(((XSCMBinOp)nodeCur).getRight());
- }
- else if (nodeCur.type() == XSModelGroupImpl.MODELGROUP_SEQUENCE) {
- // Recurse first
- calcFollowList(((XSCMBinOp)nodeCur).getLeft());
- calcFollowList(((XSCMBinOp)nodeCur).getRight());
-
- //
- // Now handle our level. We use our left child's last pos
- // set and our right child's first pos set, so go ahead and
- // get them ahead of time.
- //
- final CMStateSet last = ((XSCMBinOp)nodeCur).getLeft().lastPos();
- final CMStateSet first = ((XSCMBinOp)nodeCur).getRight().firstPos();
-
- //
- // Now, for every position which is in our left child's last set
- // add all of the states in our right child's first set to the
- // follow set for that position.
- //
- for (int index = 0; index < fLeafCount; index++) {
- if (last.getBit(index))
- fFollowList[index].union(first);
- }
- }
- else if (nodeCur.type() == XSParticleDecl.PARTICLE_ZERO_OR_MORE
- || nodeCur.type() == XSParticleDecl.PARTICLE_ONE_OR_MORE) {
- // Recurse first
- calcFollowList(((XSCMUniOp)nodeCur).getChild());
-
- //
- // Now handle our level. We use our own first and last position
- // sets, so get them up front.
- //
- final CMStateSet first = nodeCur.firstPos();
- final CMStateSet last = nodeCur.lastPos();
-
- //
- // For every position which is in our last position set, add all
- // of our first position states to the follow set for that
- // position.
- //
- for (int index = 0; index < fLeafCount; index++) {
- if (last.getBit(index))
- fFollowList[index].union(first);
- }
- }
-
- else if (nodeCur.type() == XSParticleDecl.PARTICLE_ZERO_OR_ONE) {
- // Recurse only
- calcFollowList(((XSCMUniOp)nodeCur).getChild());
- }
-
- }
-
- /**
- * Dumps the tree of the current node to standard output.
- *
- * @param nodeCur The current node.
- * @param level The maximum levels to output.
- *
- * @exception RuntimeException Thrown on error.
- */
- private void dumpTree(CMNode nodeCur, int level) {
- for (int index = 0; index < level; index++)
- System.out.print(" ");
-
- int type = nodeCur.type();
-
- switch(type ) {
-
- case XSModelGroupImpl.MODELGROUP_CHOICE:
- case XSModelGroupImpl.MODELGROUP_SEQUENCE: {
- if (type == XSModelGroupImpl.MODELGROUP_CHOICE)
- System.out.print("Choice Node ");
- else
- System.out.print("Seq Node ");
-
- if (nodeCur.isNullable())
- System.out.print("Nullable ");
-
- System.out.print("firstPos=");
- System.out.print(nodeCur.firstPos().toString());
- System.out.print(" lastPos=");
- System.out.println(nodeCur.lastPos().toString());
-
- dumpTree(((XSCMBinOp)nodeCur).getLeft(), level+1);
- dumpTree(((XSCMBinOp)nodeCur).getRight(), level+1);
- break;
- }
- case XSParticleDecl.PARTICLE_ZERO_OR_MORE:
- case XSParticleDecl.PARTICLE_ONE_OR_MORE:
- case XSParticleDecl.PARTICLE_ZERO_OR_ONE: {
- System.out.print("Rep Node ");
-
- if (nodeCur.isNullable())
- System.out.print("Nullable ");
-
- System.out.print("firstPos=");
- System.out.print(nodeCur.firstPos().toString());
- System.out.print(" lastPos=");
- System.out.println(nodeCur.lastPos().toString());
-
- dumpTree(((XSCMUniOp)nodeCur).getChild(), level+1);
- break;
- }
- case XSParticleDecl.PARTICLE_ELEMENT: {
- System.out.print
- (
- "Leaf: (pos="
- + ((XSCMLeaf)nodeCur).getPosition()
- + "), "
- + "(elemIndex="
- + ((XSCMLeaf)nodeCur).getLeaf()
- + ") "
- );
-
- if (nodeCur.isNullable())
- System.out.print(" Nullable ");
-
- System.out.print("firstPos=");
- System.out.print(nodeCur.firstPos().toString());
- System.out.print(" lastPos=");
- System.out.println(nodeCur.lastPos().toString());
- break;
- }
- case XSParticleDecl.PARTICLE_WILDCARD:
- System.out.print("Any Node: ");
-
- System.out.print("firstPos=");
- System.out.print(nodeCur.firstPos().toString());
- System.out.print(" lastPos=");
- System.out.println(nodeCur.lastPos().toString());
- break;
- default: {
- throw new RuntimeException("ImplementationMessages.VAL_NIICM");
- }
- }
-
- }
-
-
- /**
- * -1 is used to represent bad transitions in the transition table
- * entry for each state. So each entry is initialized to an all -1
- * array. This method creates a new entry and initializes it.
- */
- private int[] makeDefStateList()
- {
- int[] retArray = new int[fElemMapSize];
- for (int index = 0; index < fElemMapSize; index++)
- retArray[index] = -1;
- return retArray;
- }
-
- /** Post tree build initialization. */
- private void postTreeBuildInit(CMNode nodeCur) throws RuntimeException {
- // Set the maximum states on this node
- nodeCur.setMaxStates(fLeafCount);
-
- XSCMLeaf leaf = null;
- int pos = 0;
- // Recurse as required
- if (nodeCur.type() == XSParticleDecl.PARTICLE_WILDCARD) {
- leaf = (XSCMLeaf)nodeCur;
- pos = leaf.getPosition();
- fLeafList[pos] = leaf;
- fLeafListType[pos] = XSParticleDecl.PARTICLE_WILDCARD;
- }
- else if ((nodeCur.type() == XSModelGroupImpl.MODELGROUP_CHOICE) ||
- (nodeCur.type() == XSModelGroupImpl.MODELGROUP_SEQUENCE)) {
- postTreeBuildInit(((XSCMBinOp)nodeCur).getLeft());
- postTreeBuildInit(((XSCMBinOp)nodeCur).getRight());
- }
- else if (nodeCur.type() == XSParticleDecl.PARTICLE_ZERO_OR_MORE ||
- nodeCur.type() == XSParticleDecl.PARTICLE_ONE_OR_MORE ||
- nodeCur.type() == XSParticleDecl.PARTICLE_ZERO_OR_ONE) {
- postTreeBuildInit(((XSCMUniOp)nodeCur).getChild());
- }
- else if (nodeCur.type() == XSParticleDecl.PARTICLE_ELEMENT) {
- // Put this node in the leaf list at the current index if its
- // a non-epsilon leaf.
- leaf = (XSCMLeaf)nodeCur;
- pos = leaf.getPosition();
- fLeafList[pos] = leaf;
- fLeafListType[pos] = XSParticleDecl.PARTICLE_ELEMENT;
- }
- else {
- throw new RuntimeException("ImplementationMessages.VAL_NIICM");
- }
- }
-
- /**
- * check whether this content violates UPA constraint.
- *
- * @param subGroupHandler the substitution group handler
- * @return true if this content model contains other or list wildcard
- */
- public boolean checkUniqueParticleAttribution(SubstitutionGroupHandler subGroupHandler) throws XMLSchemaException {
- // Unique Particle Attribution
- // store the conflict results between any two elements in fElemMap
- // 0: not compared; -1: no conflict; 1: conflict
- // initialize the conflict table (all 0 initially)
- byte conflictTable[][] = new byte[fElemMapSize][fElemMapSize];
-
- // for each state, check whether it has overlap transitions
- for (int i = 0; i < fTransTable.length && fTransTable[i] != null; i++) {
- for (int j = 0; j < fElemMapSize; j++) {
- for (int k = j+1; k < fElemMapSize; k++) {
- if (fTransTable[i][j] != -1 &&
- fTransTable[i][k] != -1) {
- if (conflictTable[j][k] == 0) {
- if (XSConstraints.overlapUPA
- (fElemMap[j], fElemMap[k],
- subGroupHandler)) {
- if (fCountingStates != null) {
- Occurence o = fCountingStates[i];
- // If "i" is a counting state and exactly one of the transitions
- // loops back to "i" then the two particles do not overlap if
- // minOccurs == maxOccurs.
- if (o != null &&
- fTransTable[i][j] == i ^ fTransTable[i][k] == i &&
- o.minOccurs == o.maxOccurs) {
- conflictTable[j][k] = (byte) -1;
- continue;
- }
- }
- conflictTable[j][k] = (byte) 1;
- }
- else {
- conflictTable[j][k] = (byte) -1;
- }
- }
- }
- }
- }
- }
-
- // report all errors
- for (int i = 0; i < fElemMapSize; i++) {
- for (int j = 0; j < fElemMapSize; j++) {
- if (conflictTable[i][j] == 1) {
- //errors.newError("cos-nonambig", new Object[]{fElemMap[i].toString(),
- // fElemMap[j].toString()});
- // REVISIT: do we want to report all errors? or just one?
- throw new XMLSchemaException("cos-nonambig", new Object[]{fElemMap[i].toString(),
- fElemMap[j].toString()});
- }
- }
- }
-
- // if there is a other or list wildcard, we need to check this CM
- // again, if this grammar is cached.
- for (int i = 0; i < fElemMapSize; i++) {
- if (fElemMapType[i] == XSParticleDecl.PARTICLE_WILDCARD) {
- XSWildcardDecl wildcard = (XSWildcardDecl)fElemMap[i];
- if (wildcard.fType == XSWildcardDecl.NSCONSTRAINT_LIST ||
- wildcard.fType == XSWildcardDecl.NSCONSTRAINT_NOT) {
- return true;
- }
- }
- }
-
- return false;
- }
-
- /**
- * Check which elements are valid to appear at this point. This method also
- * works if the state is in error, in which case it returns what should
- * have been seen.
- *
- * @param state the current state
- * @return a Vector whose entries are instances of
- * either XSWildcardDecl or XSElementDecl.
- */
- public Vector whatCanGoHere(int[] state) {
- int curState = state[0];
- if (curState < 0)
- curState = state[1];
- Occurence o = (fCountingStates != null) ?
- fCountingStates[curState] : null;
- int count = state[2];
-
- Vector ret = new Vector();
- for (int elemIndex = 0; elemIndex < fElemMapSize; elemIndex++) {
- int nextState = fTransTable[curState][elemIndex];
- if (nextState != -1) {
- if (o != null) {
- if (curState == nextState) {
- // Do not include transitions which loop back to the
- // current state if we've looped the maximum number
- // of times or greater.
- if (count >= o.maxOccurs &&
- o.maxOccurs != SchemaSymbols.OCCURRENCE_UNBOUNDED) {
- continue;
- }
- }
- // Do not include transitions which advance past the
- // current state if we have not looped enough times.
- else if (count < o.minOccurs) {
- continue;
- }
- }
- ret.addElement(fElemMap[elemIndex]);
- }
- }
- return ret;
- }
-
- /**
- * Used by constant space algorithm for a{n,m} for n > 1 and
- * m <= unbounded. Called by a validator if validation of
- * countent model succeeds after subsuming a{n,m} to a*
- * (or a+) to check the n and m bounds.
- * Returns <code>null</code> if validation of bounds is
- * successful. Returns a list of strings with error info
- * if not. Even entries in list returned are error codes
- * (used to look up properties) and odd entries are parameters
- * to be passed when formatting error message. Each parameter
- * is associated with the error code that preceeds it in
- * the list.
- */
- public ArrayList checkMinMaxBounds() {
- ArrayList result = null;
- for (int elemIndex = 0; elemIndex < fElemMapSize; elemIndex++) {
- int count = fElemMapCounter[elemIndex];
- if (count == -1) {
- continue;
- }
- final int minOccurs = fElemMapCounterLowerBound[elemIndex];
- final int maxOccurs = fElemMapCounterUpperBound[elemIndex];
- if (count < minOccurs) {
- if (result == null) result = new ArrayList();
- result.add("cvc-complex-type.2.4.b");
- result.add("{" + fElemMap[elemIndex] + "}");
- }
- if (maxOccurs != -1 && count > maxOccurs) {
- if (result == null) result = new ArrayList();
- result.add("cvc-complex-type.2.4.e");
- result.add("{" + fElemMap[elemIndex] + "}");
- }
- }
- return result;
- }
-
-} // class DFAContentModel
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSEmptyCM.java b/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSEmptyCM.java
deleted file mode 100644
index 673211f..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSEmptyCM.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.models;
-
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.impl.xs.SubstitutionGroupHandler;
-import com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaException;
-
-import java.util.Vector;
-import java.util.ArrayList;
-
-/**
- * XSEmptyCM is a derivative of the abstract content model base class that
- * handles a content model with no chilren (elements).
- *
- * This model validated on the way in.
- *
- * @xerces.internal
- *
- * @author Elena Litani, Lisa Martin
- * @author IBM
- * @version $Id: XSEmptyCM.java,v 1.7 2009/07/28 15:18:11 spericas Exp $
- */
-public class XSEmptyCM implements XSCMValidator {
-
- //
- // Constants
- //
-
- // start the content model: did not see any children
- private static final short STATE_START = 0;
-
- private static final Vector EMPTY = new Vector(0);
-
- //
- // Data
- //
-
- //
- // XSCMValidator methods
- //
-
- /**
- * This methods to be called on entering a first element whose type
- * has this content model. It will return the initial state of the content model
- *
- * @return Start state of the content model
- */
- public int[] startContentModel(){
- return (new int[] {STATE_START});
- }
-
-
- /**
- * The method corresponds to one transaction in the content model.
- *
- * @param elementName the qualified name of the element
- * @param currentState Current state
- * @param subGroupHandler the substitution group handler
- * @return element index corresponding to the element from the Schema grammar
- */
- public Object oneTransition (QName elementName, int[] currentState, SubstitutionGroupHandler subGroupHandler){
-
- // error state
- if (currentState[0] < 0) {
- currentState[0] = XSCMValidator.SUBSEQUENT_ERROR;
- return null;
- }
-
- currentState[0] = XSCMValidator.FIRST_ERROR;
- return null;
- }
-
-
- /**
- * The method indicates the end of list of children
- *
- * @param currentState Current state of the content model
- * @return true if the last state was a valid final state
- */
- public boolean endContentModel (int[] currentState){
- boolean isFinal = false;
- int state = currentState[0];
-
- // restore content model state:
-
- // error
- if (state < 0) {
- return false;
- }
-
-
- return true;
- }
-
- /**
- * check whether this content violates UPA constraint.
- *
- * @param subGroupHandler the substitution group handler
- * @return true if this content model contains other or list wildcard
- */
- public boolean checkUniqueParticleAttribution(SubstitutionGroupHandler subGroupHandler) throws XMLSchemaException {
- return false;
- }
-
- /**
- * Check which elements are valid to appear at this point. This method also
- * works if the state is in error, in which case it returns what should
- * have been seen.
- *
- * @param state the current state
- * @return a Vector whose entries are instances of
- * either XSWildcardDecl or XSElementDecl.
- */
- public Vector whatCanGoHere(int[] state) {
- return EMPTY;
- }
-
- public ArrayList checkMinMaxBounds() {
- return null;
- }
-
-} // class XSEmptyCM
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/opti/AttrImpl.java b/src/com/sun/org/apache/xerces/internal/impl/xs/opti/AttrImpl.java
deleted file mode 100644
index 331fc26..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/opti/AttrImpl.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001, 2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 2001, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.opti;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.TypeInfo;
-
-/**
- * This class represents a single attribute.
- *
- * @author Rahul Srivastava, Sun Microsystems Inc.
- *
- * @version $Id: AttrImpl.java,v 1.5 2010-11-01 04:40:01 joehw Exp $
- */
-public class AttrImpl extends NodeImpl
- implements Attr {
-
- Element element;
- String value;
-
- /** Default Constructor */
- public AttrImpl() {
- nodeType = Node.ATTRIBUTE_NODE;
- }
-
- /**
- * Constructs an attribute.
- *
- * @param element Element which owns this attribute
- * @param prefix The QName prefix.
- * @param localpart The QName localpart.
- * @param rawname The QName rawname.
- * @param uri The uri binding for the associated prefix.
- * @param value The value of the attribute.
- */
- public AttrImpl(Element element, String prefix, String localpart, String rawname, String uri, String value) {
- super(prefix, localpart, rawname, uri, Node.ATTRIBUTE_NODE);
- this.element = element;
- this.value = value;
- }
-
- public String getName() {
- return rawname;
- }
-
- public boolean getSpecified() {
- return true;
- }
-
- public String getValue() {
- return value;
- }
-
- public String getNodeValue() {
- return getValue();
- }
-
- public Element getOwnerElement() {
- return element;
- }
-
- public Document getOwnerDocument() {
- return element.getOwnerDocument();
- }
-
- public void setValue(String value) throws DOMException {
- this.value = value;
- }
-
- /**
- * @since DOM Level 3
- */
- public boolean isId(){
- return false;
- }
-
- /**
- * Method getSchemaTypeInfo.
- * @return TypeInfo
- */
- public TypeInfo getSchemaTypeInfo(){
- return null;
- }
-
- /** NON-DOM method for debugging convenience */
- public String toString() {
- return getName() + "=" + "\"" + getValue() + "\"";
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/opti/DefaultDocument.java b/src/com/sun/org/apache/xerces/internal/impl/xs/opti/DefaultDocument.java
deleted file mode 100644
index 8322e87..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/opti/DefaultDocument.java
+++ /dev/null
@@ -1,291 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.opti;
-
-import org.w3c.dom.DOMConfiguration;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-import org.w3c.dom.Element;
-import org.w3c.dom.Comment;
-import org.w3c.dom.Document;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.CDATASection;
-import org.w3c.dom.EntityReference;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.ProcessingInstruction;
-
-import org.w3c.dom.DOMException;
-
-
-/**
- * @xerces.internal
- *
- * @author Rahul Srivastava, Sun Microsystems Inc.
- *
- */
-public class DefaultDocument extends NodeImpl
- implements Document {
-
- private String fDocumentURI = null;
-
- // default constructor
- public DefaultDocument() {
- }
-
- //
- // org.w3c.dom.Document methods
- //
-
- public DocumentType getDoctype() {
- return null;
- }
-
-
- public DOMImplementation getImplementation() {
- return null;
- }
-
-
- public Element getDocumentElement() {
- return null;
- }
-
-
- public NodeList getElementsByTagName(String tagname) {
- return null;
- }
-
-
- public NodeList getElementsByTagNameNS(String namespaceURI, String localName) {
- return null;
- }
-
-
- public Element getElementById(String elementId) {
- return null;
- }
-
-
- public Node importNode(Node importedNode, boolean deep) throws DOMException {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
-
- public Element createElement(String tagName) throws DOMException {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
-
- public DocumentFragment createDocumentFragment() {
- return null;
- }
-
-
- public Text createTextNode(String data) {
- return null;
- }
-
- public Comment createComment(String data) {
- return null;
- }
-
-
- public CDATASection createCDATASection(String data) throws DOMException {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
-
- public ProcessingInstruction createProcessingInstruction(String target, String data) throws DOMException {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
-
- public Attr createAttribute(String name) throws DOMException {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
-
- public EntityReference createEntityReference(String name) throws DOMException {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
-
- public Element createElementNS(String namespaceURI, String qualifiedName) throws DOMException {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
-
- public Attr createAttributeNS(String namespaceURI, String qualifiedName) throws DOMException {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
- // DOM Level 3 methods.
-
- public String getInputEncoding(){
- return null;
- }
-
- /**
- public void setInputEncoding(String actualEncoding){
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
- */
-
- public String getXmlEncoding(){
- return null;
- }
-
-
- /**
- * An attribute specifying, as part of the XML declaration, the encoding
- * of this document. This is <code>null</code> when unspecified.
- * @since DOM Level 3
- public void setXmlEncoding(String encoding){
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
- */
-
- /**
- * An attribute specifying, as part of the XML declaration, whether this
- * document is standalone.
- * <br> This attribute represents the property [standalone] defined in .
- * @since DOM Level 3
- */
- public boolean getXmlStandalone(){
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
- /**
- * An attribute specifying, as part of the XML declaration, whether this
- * document is standalone.
- * <br> This attribute represents the property [standalone] defined in .
- * @since DOM Level 3
- */
- public void setXmlStandalone(boolean standalone){
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
- /**
- * An attribute specifying, as part of the XML declaration, the version
- * number of this document. This is <code>null</code> when unspecified.
- * <br> This attribute represents the property [version] defined in .
- * @exception DOMException
- * NOT_SUPPORTED_ERR: Raised if the version is set to a value that is
- * not supported by this <code>Document</code>.
- * @since DOM Level 3
- */
- public String getXmlVersion(){
- return null;
- }
- /**
- * An attribute specifying, as part of the XML declaration, the version
- * number of this document. This is <code>null</code> when unspecified.
- * <br> This attribute represents the property [version] defined in .
- * @exception DOMException
- * NOT_SUPPORTED_ERR: Raised if the version is set to a value that is
- * not supported by this <code>Document</code>.
- * @since DOM Level 3
- */
- public void setXmlVersion(String version) throws DOMException{
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
- /**
- * An attribute specifying whether errors checking is enforced or not.
- * When set to <code>false</code>, the implementation is free to not
- * test every possible error case normally defined on DOM operations,
- * and not raise any <code>DOMException</code>. In case of error, the
- * behavior is undefined. This attribute is <code>true</code> by
- * defaults.
- * @since DOM Level 3
- */
- public boolean getStrictErrorChecking(){
- return false;
- }
- /**
- * An attribute specifying whether errors checking is enforced or not.
- * When set to <code>false</code>, the implementation is free to not
- * test every possible error case normally defined on DOM operations,
- * and not raise any <code>DOMException</code>. In case of error, the
- * behavior is undefined. This attribute is <code>true</code> by
- * defaults.
- * @since DOM Level 3
- */
- public void setStrictErrorChecking(boolean strictErrorChecking){
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
- /**
- * The location of the document or <code>null</code> if undefined.
- * <br>Beware that when the <code>Document</code> supports the feature
- * "HTML" , the href attribute of the HTML BASE element takes precedence
- * over this attribute.
- * @since DOM Level 3
- */
- public String getDocumentURI() {
- return fDocumentURI;
- }
-
- /**
- * The location of the document or <code>null</code> if undefined.
- * <br>Beware that when the <code>Document</code> supports the feature
- * "HTML" , the href attribute of the HTML BASE element takes precedence
- * over this attribute.
- * @since DOM Level 3
- */
- public void setDocumentURI(String documentURI) {
- fDocumentURI = documentURI;
- }
-
- /** DOM Level 3*/
- public Node adoptNode(Node source) throws DOMException{
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
- /** DOM Level 3*/
- public void normalizeDocument(){
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
- /**
- * The configuration used when <code>Document.normalizeDocument</code> is
- * invoked.
- * @since DOM Level 3
- */
- public DOMConfiguration getDomConfig(){
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
- /** DOM Level 3*/
- public Node renameNode(Node n,String namespaceURI, String name) throws DOMException{
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
-
-
-
-
-
-
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/opti/DefaultElement.java b/src/com/sun/org/apache/xerces/internal/impl/xs/opti/DefaultElement.java
deleted file mode 100644
index c4db6d8..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/opti/DefaultElement.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.opti;
-
-import org.w3c.dom.TypeInfo;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-
-import org.w3c.dom.DOMException;
-
-
-/**
- * @xerces.internal
- *
- * @author Rahul Srivastava, Sun Microsystems Inc.
- *
- */
-public class DefaultElement extends NodeImpl
- implements Element {
-
- // default constructor
- public DefaultElement() {
- }
-
-
- public DefaultElement(String prefix, String localpart, String rawname, String uri, short nodeType) {
- super(prefix, localpart, rawname, uri, nodeType);
- }
-
-
- //
- // org.w3c.dom.Element methods
- //
-
- // getter methods
- public String getTagName() {
- return null;
- }
-
-
- public String getAttribute(String name) {
- return null;
- }
-
-
- public Attr getAttributeNode(String name) {
- return null;
- }
-
-
- public NodeList getElementsByTagName(String name) {
- return null;
- }
-
-
- public String getAttributeNS(String namespaceURI, String localName) {
- return null;
- }
-
-
- public Attr getAttributeNodeNS(String namespaceURI, String localName) {
- return null;
- }
-
-
- public NodeList getElementsByTagNameNS(String namespaceURI, String localName) {
- return null;
- }
-
-
- public boolean hasAttribute(String name) {
- return false;
- }
-
-
- public boolean hasAttributeNS(String namespaceURI, String localName) {
- return false;
- }
-
- public TypeInfo getSchemaTypeInfo(){
- return null;
- }
-
-
- // setter methods
- public void setAttribute(String name, String value) throws DOMException {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
-
- public void removeAttribute(String name) throws DOMException {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
-
- public Attr removeAttributeNode(Attr oldAttr) throws DOMException {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
-
- public Attr setAttributeNode(Attr newAttr) throws DOMException {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
-
- public void setAttributeNS(String namespaceURI, String qualifiedName, String value) throws DOMException {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
-
- public void removeAttributeNS(String namespaceURI, String localName) throws DOMException {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
-
- public Attr setAttributeNodeNS(Attr newAttr) throws DOMException {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
- public void setIdAttributeNode(Attr at, boolean makeId) throws DOMException{
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
- public void setIdAttribute(String name, boolean makeId) throws DOMException{
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
- public void setIdAttributeNS(String namespaceURI, String localName,
- boolean makeId) throws DOMException{
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/opti/DefaultNode.java b/src/com/sun/org/apache/xerces/internal/impl/xs/opti/DefaultNode.java
deleted file mode 100644
index 1509663..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/opti/DefaultNode.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.opti;
-
-import org.w3c.dom.UserDataHandler;
-import org.w3c.dom.Node;
-import org.w3c.dom.Document;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.NamedNodeMap;
-
-import org.w3c.dom.DOMException;
-
-
-/**
- * @xerces.internal
- *
- * @author Rahul Srivastava, Sun Microsystems Inc.
- *
- */
-public class DefaultNode implements Node {
-
- // default constructor
- public DefaultNode() {
- }
-
- //
- // org.w3c.dom.Node methods
- //
-
- // getter methods
- public String getNodeName() {
- return null;
- }
-
-
- public String getNodeValue() throws DOMException {
- return null;
- }
-
-
- public short getNodeType() {
- return -1;
- }
-
-
- public Node getParentNode() {
- return null;
- }
-
-
- public NodeList getChildNodes() {
- return null;
- }
-
-
- public Node getFirstChild() {
- return null;
- }
-
-
- public Node getLastChild() {
- return null;
- }
-
-
- public Node getPreviousSibling() {
- return null;
- }
-
-
- public Node getNextSibling() {
- return null;
- }
-
-
- public NamedNodeMap getAttributes() {
- return null;
- }
-
-
- public Document getOwnerDocument() {
- return null;
- }
-
-
- public boolean hasChildNodes() {
- return false;
- }
-
-
- public Node cloneNode(boolean deep) {
- return null;
- }
-
-
- public void normalize() {
- }
-
-
- public boolean isSupported(String feature, String version) {
- return false;
- }
-
-
- public String getNamespaceURI() {
- return null;
- }
-
-
- public String getPrefix() {
- return null;
- }
-
-
- public String getLocalName() {
- return null;
- }
- /** DOM Level 3*/
- public String getBaseURI(){
- return null;
- }
-
-
-
- public boolean hasAttributes() {
- return false;
- }
-
- // setter methods
- public void setNodeValue(String nodeValue) throws DOMException {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
-
- public Node insertBefore(Node newChild, Node refChild) throws DOMException {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
-
- public Node replaceChild(Node newChild, Node oldChild) throws DOMException {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
-
- public Node removeChild(Node oldChild) throws DOMException {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
-
- public Node appendChild(Node newChild) throws DOMException {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
-
- public void setPrefix(String prefix) throws DOMException {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
- public short compareDocumentPosition(Node other){
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
- public String getTextContent() throws DOMException{
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
- public void setTextContent(String textContent)throws DOMException{
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
- public boolean isSameNode(Node other){
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
-
- }
- public String lookupPrefix(String namespaceURI){
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
- public boolean isDefaultNamespace(String namespaceURI){
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
- public String lookupNamespaceURI(String prefix){
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
- public boolean isEqualNode(Node arg){
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
-
- }
-
- public Object getFeature(String feature, String version){
- return null;
- }
- public Object setUserData(String key, Object data, UserDataHandler handler){
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
- public Object getUserData(String key){
- return null;
- }
-
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/opti/DefaultText.java b/src/com/sun/org/apache/xerces/internal/impl/xs/opti/DefaultText.java
deleted file mode 100644
index 4f750b1..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/opti/DefaultText.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.opti;
-
-import org.w3c.dom.Text;
-import org.w3c.dom.DOMException;
-
-/*
- * @author Neil Graham, IBM
- */
-/**
- * The <code>Text</code> interface inherits from <code>CharacterData</code>
- * and represents the textual content (termed character data in XML) of an
- * <code>Element</code> or <code>Attr</code>. If there is no markup inside
- * an element's content, the text is contained in a single object
- * implementing the <code>Text</code> interface that is the only child of
- * the element. If there is markup, it is parsed into the information items
- * (elements, comments, etc.) and <code>Text</code> nodes that form the list
- * of children of the element.
- * <p>When a document is first made available via the DOM, there is only one
- * <code>Text</code> node for each block of text. Users may create adjacent
- * <code>Text</code> nodes that represent the contents of a given element
- * without any intervening markup, but should be aware that there is no way
- * to represent the separations between these nodes in XML or HTML, so they
- * will not (in general) persist between DOM editing sessions. The
- * <code>normalize()</code> method on <code>Node</code> merges any such
- * adjacent <code>Text</code> objects into a single node for each block of
- * text.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113'>Document Object Model (DOM) Level 2 Core Specification</a>.
- *
- * This is an empty implementation.
- *
- * @xerces.internal
- */
-public class DefaultText extends NodeImpl implements Text {
-
- // CharacterData methods
-
- /**
- * The character data of the node that implements this interface. The DOM
- * implementation may not put arbitrary limits on the amount of data
- * that may be stored in a <code>CharacterData</code> node. However,
- * implementation limits may mean that the entirety of a node's data may
- * not fit into a single <code>DOMString</code>. In such cases, the user
- * may call <code>substringData</code> to retrieve the data in
- * appropriately sized pieces.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
- * @exception DOMException
- * DOMSTRING_SIZE_ERR: Raised when it would return more characters than
- * fit in a <code>DOMString</code> variable on the implementation
- * platform.
- */
- public String getData()
- throws DOMException {
- return null;
- }
-
- /**
- * The character data of the node that implements this interface. The DOM
- * implementation may not put arbitrary limits on the amount of data
- * that may be stored in a <code>CharacterData</code> node. However,
- * implementation limits may mean that the entirety of a node's data may
- * not fit into a single <code>DOMString</code>. In such cases, the user
- * may call <code>substringData</code> to retrieve the data in
- * appropriately sized pieces.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
- * @exception DOMException
- * DOMSTRING_SIZE_ERR: Raised when it would return more characters than
- * fit in a <code>DOMString</code> variable on the implementation
- * platform.
- */
- public void setData(String data)
- throws DOMException {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
- /**
- * The number of 16-bit units that are available through <code>data</code>
- * and the <code>substringData</code> method below. This may have the
- * value zero, i.e., <code>CharacterData</code> nodes may be empty.
- */
- public int getLength() {
- return 0;
- }
-
- /**
- * Extracts a range of data from the node.
- * @param offset Start offset of substring to extract.
- * @param count The number of 16-bit units to extract.
- * @return The specified substring. If the sum of <code>offset</code> and
- * <code>count</code> exceeds the <code>length</code>, then all 16-bit
- * units to the end of the data are returned.
- * @exception DOMException
- * INDEX_SIZE_ERR: Raised if the specified <code>offset</code> is
- * negative or greater than the number of 16-bit units in
- * <code>data</code>, or if the specified <code>count</code> is
- * negative.
- * <br>DOMSTRING_SIZE_ERR: Raised if the specified range of text does
- * not fit into a <code>DOMString</code>.
- */
- public String substringData(int offset,
- int count)
- throws DOMException {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
- /**
- * Append the string to the end of the character data of the node. Upon
- * success, <code>data</code> provides access to the concatenation of
- * <code>data</code> and the <code>DOMString</code> specified.
- * @param arg The <code>DOMString</code> to append.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- */
- public void appendData(String arg)
- throws DOMException {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
- /**
- * Insert a string at the specified 16-bit unit offset.
- * @param offset The character offset at which to insert.
- * @param arg The <code>DOMString</code> to insert.
- * @exception DOMException
- * INDEX_SIZE_ERR: Raised if the specified <code>offset</code> is
- * negative or greater than the number of 16-bit units in
- * <code>data</code>.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- */
- public void insertData(int offset,
- String arg)
- throws DOMException {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
- /**
- * Remove a range of 16-bit units from the node. Upon success,
- * <code>data</code> and <code>length</code> reflect the change.
- * @param offset The offset from which to start removing.
- * @param count The number of 16-bit units to delete. If the sum of
- * <code>offset</code> and <code>count</code> exceeds
- * <code>length</code> then all 16-bit units from <code>offset</code>
- * to the end of the data are deleted.
- * @exception DOMException
- * INDEX_SIZE_ERR: Raised if the specified <code>offset</code> is
- * negative or greater than the number of 16-bit units in
- * <code>data</code>, or if the specified <code>count</code> is
- * negative.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- */
- public void deleteData(int offset,
- int count)
- throws DOMException {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
- /**
- * Replace the characters starting at the specified 16-bit unit offset
- * with the specified string.
- * @param offset The offset from which to start replacing.
- * @param count The number of 16-bit units to replace. If the sum of
- * <code>offset</code> and <code>count</code> exceeds
- * <code>length</code>, then all 16-bit units to the end of the data
- * are replaced; (i.e., the effect is the same as a <code>remove</code>
- * method call with the same range, followed by an <code>append</code>
- * method invocation).
- * @param arg The <code>DOMString</code> with which the range must be
- * replaced.
- * @exception DOMException
- * INDEX_SIZE_ERR: Raised if the specified <code>offset</code> is
- * negative or greater than the number of 16-bit units in
- * <code>data</code>, or if the specified <code>count</code> is
- * negative.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- */
- public void replaceData(int offset,
- int count,
- String arg)
- throws DOMException {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
- // Text node methods
- /**
- * Breaks this node into two nodes at the specified <code>offset</code>,
- * keeping both in the tree as siblings. After being split, this node
- * will contain all the content up to the <code>offset</code> point. A
- * new node of the same type, which contains all the content at and
- * after the <code>offset</code> point, is returned. If the original
- * node had a parent node, the new node is inserted as the next sibling
- * of the original node. When the <code>offset</code> is equal to the
- * length of this node, the new node has no data.
- * @param offset The 16-bit unit offset at which to split, starting from
- * <code>0</code>.
- * @return The new node, of the same type as this node.
- * @exception DOMException
- * INDEX_SIZE_ERR: Raised if the specified offset is negative or greater
- * than the number of 16-bit units in <code>data</code>.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- */
- public Text splitText(int offset)
- throws DOMException {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
- /** DOM Level 3 CR */
- public boolean isElementContentWhitespace(){
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
- public String getWholeText(){
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
- public Text replaceWholeText(String content) throws DOMException {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/opti/DefaultXMLDocumentHandler.java b/src/com/sun/org/apache/xerces/internal/impl/xs/opti/DefaultXMLDocumentHandler.java
deleted file mode 100644
index dd0ac9b..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/opti/DefaultXMLDocumentHandler.java
+++ /dev/null
@@ -1,871 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.opti;
-
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xni.XMLString;
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-import com.sun.org.apache.xerces.internal.xni.XMLLocator;
-import com.sun.org.apache.xerces.internal.xni.Augmentations;
-import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
-import com.sun.org.apache.xerces.internal.xni.XMLDTDHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDSource;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDContentModelSource;
-
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-
-/**
- * @xerces.internal
- *
- * @author Rahul Srivastava, Sun Microsystems Inc.
- * @author Sandy Gao, IBM
- *
- */
-public class DefaultXMLDocumentHandler implements XMLDocumentHandler,
- XMLDTDHandler,
- XMLDTDContentModelHandler {
-
- /** Default Constructor */
- public DefaultXMLDocumentHandler() {
- }
-
- //
- // XMLDocumentHandler methods
- //
-
- /**
- * The start of the document.
- *
- * @param locator The document locator, or null if the document
- * location cannot be reported during the parsing
- * of this document. However, it is <em>strongly</em>
- * recommended that a locator be supplied that can
- * at least report the system identifier of the
- * document.
- * @param encoding The auto-detected IANA encoding name of the entity
- * stream. This value will be null in those situations
- * where the entity encoding is not auto-detected (e.g.
- * internal entities or a document entity that is
- * parsed from a java.io.Reader).
- * @param augs Additional information that may include infoset augmentations
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void startDocument(XMLLocator locator, String encoding,
- NamespaceContext context, Augmentations augs)
- throws XNIException {
- }
-
- /**
- * Notifies of the presence of an XMLDecl line in the document. If
- * present, this method will be called immediately following the
- * startDocument call.
- *
- * @param version The XML version.
- * @param encoding The IANA encoding name of the document, or null if
- * not specified.
- * @param standalone The standalone value, or null if not specified.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void xmlDecl(String version, String encoding, String standalone, Augmentations augs)
- throws XNIException {
- }
-
- /**
- * Notifies of the presence of the DOCTYPE line in the document.
- *
- * @param rootElement
- * The name of the root element.
- * @param publicId The public identifier if an external DTD or null
- * if the external DTD is specified using SYSTEM.
- * @param systemId The system identifier if an external DTD, null
- * otherwise.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void doctypeDecl(String rootElement, String publicId, String systemId, Augmentations augs)
- throws XNIException {
- }
-
- /**
- * A comment.
- *
- * @param text The text in the comment.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by application to signal an error.
- */
- public void comment(XMLString text, Augmentations augs) throws XNIException {
- }
-
- /**
- * A processing instruction. Processing instructions consist of a
- * target name and, optionally, text data. The data is only meaningful
- * to the application.
- * <p>
- * Typically, a processing instruction's data will contain a series
- * of pseudo-attributes. These pseudo-attributes follow the form of
- * element attributes but are <strong>not</strong> parsed or presented
- * to the application as anything other than text. The application is
- * responsible for parsing the data.
- *
- * @param target The target.
- * @param data The data or null if none specified.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void processingInstruction(String target, XMLString data, Augmentations augs)
- throws XNIException {
- }
-
- /**
- * The start of a namespace prefix mapping. This method will only be
- * called when namespace processing is enabled.
- *
- * @param prefix The namespace prefix.
- * @param uri The URI bound to the prefix.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void startPrefixMapping(String prefix, String uri, Augmentations augs)
- throws XNIException {
- }
-
- /**
- * The start of an element.
- *
- * @param element The name of the element.
- * @param attributes The element attributes.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void startElement(QName element, XMLAttributes attributes, Augmentations augs)
- throws XNIException {
- }
-
- /**
- * An empty element.
- *
- * @param element The name of the element.
- * @param attributes The element attributes.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void emptyElement(QName element, XMLAttributes attributes, Augmentations augs)
- throws XNIException {
- }
-
- /**
- * This method notifies the start of a general entity.
- * <p>
- * <strong>Note:</strong> This method is not called for entity references
- * appearing as part of attribute values.
- *
- * @param name The name of the general entity.
- * @param identifier The resource identifier.
- * @param encoding The auto-detected IANA encoding name of the entity
- * stream. This value will be null in those situations
- * where the entity encoding is not auto-detected (e.g.
- * internal entities or a document entity that is
- * parsed from a java.io.Reader).
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException Thrown by handler to signal an error.
- */
- public void startGeneralEntity(String name,
- XMLResourceIdentifier identifier,
- String encoding,
- Augmentations augs) throws XNIException {
- }
-
- /**
- * Notifies of the presence of a TextDecl line in an entity. If present,
- * this method will be called immediately following the startEntity call.
- * <p>
- * <strong>Note:</strong> This method will never be called for the
- * document entity; it is only called for external general entities
- * referenced in document content.
- * <p>
- * <strong>Note:</strong> This method is not called for entity references
- * appearing as part of attribute values.
- *
- * @param version The XML version, or null if not specified.
- * @param encoding The IANA encoding name of the entity.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void textDecl(String version, String encoding, Augmentations augs) throws XNIException {
- }
-
- /**
- * This method notifies the end of a general entity.
- * <p>
- * <strong>Note:</strong> This method is not called for entity references
- * appearing as part of attribute values.
- *
- * @param name The name of the entity.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void endGeneralEntity(String name, Augmentations augs) throws XNIException {
- }
-
- /**
- * Character content.
- *
- * @param text The content.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void characters(XMLString text, Augmentations augs) throws XNIException {
- }
-
- /**
- * Ignorable whitespace. For this method to be called, the document
- * source must have some way of determining that the text containing
- * only whitespace characters should be considered ignorable. For
- * example, the validator can determine if a length of whitespace
- * characters in the document are ignorable based on the element
- * content model.
- *
- * @param text The ignorable whitespace.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void ignorableWhitespace(XMLString text, Augmentations augs) throws XNIException {
- }
-
- /**
- * The end of an element.
- *
- * @param element The name of the element.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void endElement(QName element, Augmentations augs) throws XNIException {
- }
-
- /**
- * The end of a namespace prefix mapping. This method will only be
- * called when namespace processing is enabled.
- *
- * @param prefix The namespace prefix.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void endPrefixMapping(String prefix, Augmentations augs) throws XNIException {
- }
-
- /**
- * The start of a CDATA section.
- *
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void startCDATA(Augmentations augs) throws XNIException {
- }
-
- /**
- * The end of a CDATA section.
- *
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void endCDATA(Augmentations augs) throws XNIException {
- }
-
- /**
- * The end of the document.
- *
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void endDocument(Augmentations augs) throws XNIException {
- }
-
-
- //
- // XMLDTDHandler methods
- //
-
- /**
- * The start of the DTD.
- *
- * @param locator The document locator, or null if the document
- * location cannot be reported during the parsing of
- * the document DTD. However, it is <em>strongly</em>
- * recommended that a locator be supplied that can
- * at least report the base system identifier of the
- * DTD.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startDTD(XMLLocator locator, Augmentations augmentations)
- throws XNIException {
- }
-
- /**
- * This method notifies of the start of a parameter entity. The parameter
- * entity name start with a '%' character.
- *
- * @param name The name of the parameter entity.
- * @param identifier The resource identifier.
- * @param encoding The auto-detected IANA encoding name of the entity
- * stream. This value will be null in those situations
- * where the entity encoding is not auto-detected (e.g.
- * internal parameter entities).
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startParameterEntity(String name,
- XMLResourceIdentifier identifier,
- String encoding,
- Augmentations augmentations) throws XNIException {
- }
-
- /**
- * Notifies of the presence of a TextDecl line in an entity. If present,
- * this method will be called immediately following the startEntity call.
- * <p>
- * <strong>Note:</strong> This method is only called for external
- * parameter entities referenced in the DTD.
- *
- * @param version The XML version, or null if not specified.
- * @param encoding The IANA encoding name of the entity.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
-/*
- public void textDecl(String version, String encoding,
- Augmentations augmentations) throws XNIException {
- }
-*/
-
- /**
- * This method notifies the end of a parameter entity. Parameter entity
- * names begin with a '%' character.
- *
- * @param name The name of the parameter entity.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endParameterEntity(String name, Augmentations augmentations)
- throws XNIException {
- }
-
- /**
- * The start of the DTD external subset.
- *
- * @param identifier The resource identifier.
- * @param augmentations
- * Additional information that may include infoset
- * augmentations.
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void startExternalSubset(XMLResourceIdentifier identifier,
- Augmentations augmentations)
- throws XNIException {
- }
-
- /**
- * The end of the DTD external subset.
- *
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endExternalSubset(Augmentations augmentations)
- throws XNIException {
- }
-
- /**
- * A comment.
- *
- * @param text The text in the comment.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by application to signal an error.
- */
-/*
- public void comment(XMLString text, Augmentations augmentations)
- throws XNIException {
- }
-*/
-
- /**
- * A processing instruction. Processing instructions consist of a
- * target name and, optionally, text data. The data is only meaningful
- * to the application.
- * <p>
- * Typically, a processing instruction's data will contain a series
- * of pseudo-attributes. These pseudo-attributes follow the form of
- * element attributes but are <strong>not</strong> parsed or presented
- * to the application as anything other than text. The application is
- * responsible for parsing the data.
- *
- * @param target The target.
- * @param data The data or null if none specified.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
-/*
- public void processingInstruction(String target, XMLString data,
- Augmentations augmentations)
- throws XNIException {
- }
-*/
-
-
- /**
- * An element declaration.
- *
- * @param name The name of the element.
- * @param contentModel The element content model.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void elementDecl(String name, String contentModel,
- Augmentations augmentations)
- throws XNIException {
- }
-
- /**
- * The start of an attribute list.
- *
- * @param elementName The name of the element that this attribute
- * list is associated with.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startAttlist(String elementName,
- Augmentations augmentations) throws XNIException {
- }
-
- /**
- * An attribute declaration.
- *
- * @param elementName The name of the element that this attribute
- * is associated with.
- * @param attributeName The name of the attribute.
- * @param type The attribute type. This value will be one of
- * the following: "CDATA", "ENTITY", "ENTITIES",
- * "ENUMERATION", "ID", "IDREF", "IDREFS",
- * "NMTOKEN", "NMTOKENS", or "NOTATION".
- * @param enumeration If the type has the value "ENUMERATION" or
- * "NOTATION", this array holds the allowed attribute
- * values; otherwise, this array is null.
- * @param defaultType The attribute default type. This value will be
- * one of the following: "#FIXED", "#IMPLIED",
- * "#REQUIRED", or null.
- * @param defaultValue The attribute default value, or null if no
- * default value is specified.
- * @param nonNormalizedDefaultValue The attribute default value with no normalization
- * performed, or null if no default value is specified.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void attributeDecl(String elementName, String attributeName,
- String type, String[] enumeration,
- String defaultType, XMLString defaultValue,
- XMLString nonNormalizedDefaultValue, Augmentations augmentations)
- throws XNIException {
- }
-
- /**
- * The end of an attribute list.
- *
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endAttlist(Augmentations augmentations) throws XNIException {
- }
-
- /**
- * An internal entity declaration.
- *
- * @param name The name of the entity. Parameter entity names start with
- * '%', whereas the name of a general entity is just the
- * entity name.
- * @param text The value of the entity.
- * @param nonNormalizedText The non-normalized value of the entity. This
- * value contains the same sequence of characters that was in
- * the internal entity declaration, without any entity
- * references expanded.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void internalEntityDecl(String name, XMLString text,
- XMLString nonNormalizedText,
- Augmentations augmentations)
- throws XNIException {
- }
-
- /**
- * An external entity declaration.
- *
- * @param name The name of the entity. Parameter entity names start
- * with '%', whereas the name of a general entity is just
- * the entity name.
- * @param identifier An object containing all location information
- * pertinent to this external entity.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void externalEntityDecl(String name,
- XMLResourceIdentifier identifier,
- Augmentations augmentations)
- throws XNIException {
- }
-
- /**
- * An unparsed entity declaration.
- *
- * @param name The name of the entity.
- * @param identifier An object containing all location information
- * pertinent to this unparsed entity declaration.
- * @param notation The name of the notation.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void unparsedEntityDecl(String name,
- XMLResourceIdentifier identifier,
- String notation, Augmentations augmentations)
- throws XNIException {
- }
-
- /**
- * A notation declaration
- *
- * @param name The name of the notation.
- * @param identifier An object containing all location information
- * pertinent to this notation.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void notationDecl(String name, XMLResourceIdentifier identifier,
- Augmentations augmentations) throws XNIException {
- }
-
- /**
- * The start of a conditional section.
- *
- * @param type The type of the conditional section. This value will
- * either be CONDITIONAL_INCLUDE or CONDITIONAL_IGNORE.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see #CONDITIONAL_INCLUDE
- * @see #CONDITIONAL_IGNORE
- */
- public void startConditional(short type, Augmentations augmentations)
- throws XNIException {
- }
-
- /**
- * Characters within an IGNORE conditional section.
- *
- * @param text The ignored text.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void ignoredCharacters(XMLString text, Augmentations augmentations)
- throws XNIException {
- }
-
- /**
- * The end of a conditional section.
- *
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endConditional(Augmentations augmentations) throws XNIException {
- }
-
- /**
- * The end of the DTD.
- *
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endDTD(Augmentations augmentations) throws XNIException {
- }
-
-
- //
- // XMLDTDContentModelHandler methods
- //
-
- /**
- * The start of a content model. Depending on the type of the content
- * model, specific methods may be called between the call to the
- * startContentModel method and the call to the endContentModel method.
- *
- * @param elementName The name of the element.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startContentModel(String elementName, Augmentations augmentations)
- throws XNIException {
- }
-
- /**
- * A content model of ANY.
- *
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see #empty
- * @see #startGroup
- */
- public void any(Augmentations augmentations) throws XNIException {
- }
-
- /**
- * A content model of EMPTY.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @see #any
- * @see #startGroup
- */
- public void empty(Augmentations augmentations) throws XNIException {
- }
-
- /**
- * A start of either a mixed or children content model. A mixed
- * content model will immediately be followed by a call to the
- * <code>pcdata()</code> method. A children content model will
- * contain additional groups and/or elements.
- *
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see #any
- * @see #empty
- */
- public void startGroup(Augmentations augmentations) throws XNIException {
- }
-
- /**
- * The appearance of "#PCDATA" within a group signifying a
- * mixed content model. This method will be the first called
- * following the content model's <code>startGroup()</code>.
- *
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see #startGroup
- */
- public void pcdata(Augmentations augmentations) throws XNIException {
- }
-
- /**
- * A referenced element in a mixed or children content model.
- *
- * @param elementName The name of the referenced element.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void element(String elementName, Augmentations augmentations)
- throws XNIException {
- }
-
- /**
- * The separator between choices or sequences of a mixed or children
- * content model.
- *
- * @param separator The type of children separator.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see #SEPARATOR_CHOICE
- * @see #SEPARATOR_SEQUENCE
- */
- public void separator(short separator, Augmentations augmentations)
- throws XNIException {
- }
-
- /**
- * The occurrence count for a child in a children content model or
- * for the mixed content model group.
- *
- * @param occurrence The occurrence count for the last element
- * or group.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see #OCCURS_ZERO_OR_ONE
- * @see #OCCURS_ZERO_OR_MORE
- * @see #OCCURS_ONE_OR_MORE
- */
- public void occurrence(short occurrence, Augmentations augmentations)
- throws XNIException {
- }
-
- /**
- * The end of a group for mixed or children content models.
- *
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endGroup(Augmentations augmentations) throws XNIException {
- }
-
- /**
- * The end of a content model.
- *
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endContentModel(Augmentations augmentations) throws XNIException {
- }
-
- private XMLDocumentSource fDocumentSource;
-
- /** Sets the document source. */
- public void setDocumentSource(XMLDocumentSource source) {
- fDocumentSource = source;
- }
-
- /** Returns the document source. */
- public XMLDocumentSource getDocumentSource() {
- return fDocumentSource;
- }
-
- private XMLDTDSource fDTDSource;
-
- // set the source of this handler
- public void setDTDSource(XMLDTDSource source) {
- fDTDSource = source;
- }
-
- // return the source from which this handler derives its events
- public XMLDTDSource getDTDSource() {
- return fDTDSource;
- }
-
- private XMLDTDContentModelSource fCMSource;
-
- // set content model source
- public void setDTDContentModelSource(XMLDTDContentModelSource source) {
- fCMSource = source;
- }
-
- // get content model source
- public XMLDTDContentModelSource getDTDContentModelSource() {
- return fCMSource;
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/opti/ElementImpl.java b/src/com/sun/org/apache/xerces/internal/impl/xs/opti/ElementImpl.java
deleted file mode 100644
index 24eebf7..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/opti/ElementImpl.java
+++ /dev/null
@@ -1,274 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.opti;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
- * @xerces.internal
- *
- * @author Rahul Srivastava, Sun Microsystems Inc.
- * @author Sandy Gao, IBM
- *
- * @version $Id: ElementImpl.java,v 1.7 2010-11-01 04:40:01 joehw Exp $
- */
-public class ElementImpl extends DefaultElement {
-
- SchemaDOM schemaDOM;
- Attr[] attrs;
- int row;
- int col;
- int parentRow;
-
- int line;
- int column;
- int charOffset;
- String fAnnotation;
- String fSyntheticAnnotation;
-
- public ElementImpl(int line, int column, int offset) {
- row = -1;
- col = -1;
- parentRow = -1;
- nodeType = Node.ELEMENT_NODE;
-
- this.line = line;
- this.column = column;
- charOffset = offset;
- }
-
- public ElementImpl(int line, int column) {
- this(line, column, -1);
- }
-
-
- public ElementImpl(String prefix, String localpart, String rawname,
- String uri, int line, int column, int offset) {
- super(prefix, localpart, rawname, uri, Node.ELEMENT_NODE);
- row = -1;
- col = -1;
- parentRow = -1;
-
- this.line = line;
- this.column = column;
- charOffset = offset;
- }
-
- public ElementImpl(String prefix, String localpart, String rawname,
- String uri, int line, int column) {
- this(prefix, localpart, rawname, uri, line, column, -1);
- }
-
-
- //
- // org.w3c.dom.Node methods
- //
-
- public Document getOwnerDocument() {
- return schemaDOM;
- }
-
-
- public Node getParentNode() {
- return schemaDOM.relations[row][0];
- }
-
-
- public boolean hasChildNodes() {
- if (parentRow == -1) {
- return false;
- }
- else {
- return true;
- }
- }
-
-
- public Node getFirstChild() {
- if (parentRow == -1) {
- return null;
- }
- return schemaDOM.relations[parentRow][1];
- }
-
-
- public Node getLastChild() {
- if (parentRow == -1) {
- return null;
- }
- int i=1;
- for (; i<schemaDOM.relations[parentRow].length; i++) {
- if (schemaDOM.relations[parentRow][i] == null) {
- return schemaDOM.relations[parentRow][i-1];
- }
- }
- if (i ==1) {
- i++;
- }
- return schemaDOM.relations[parentRow][i-1];
- }
-
-
- public Node getPreviousSibling() {
- if (col == 1) {
- return null;
- }
- return schemaDOM.relations[row][col-1];
- }
-
-
- public Node getNextSibling() {
- if (col == schemaDOM.relations[row].length-1) {
- return null;
- }
- return schemaDOM.relations[row][col+1];
- }
-
-
- public NamedNodeMap getAttributes() {
- return new NamedNodeMapImpl(attrs);
- }
-
-
- public boolean hasAttributes() {
- return (attrs.length == 0 ? false : true);
- }
-
-
-
- //
- // org.w3c.dom.Element methods
- //
-
- public String getTagName() {
- return rawname;
- }
-
-
- public String getAttribute(String name) {
-
- for (int i=0; i<attrs.length; i++) {
- if (attrs[i].getName().equals(name)) {
- return attrs[i].getValue();
- }
- }
- return "";
- }
-
-
- public Attr getAttributeNode(String name) {
- for (int i=0; i<attrs.length; i++) {
- if (attrs[i].getName().equals(name)) {
- return attrs[i];
- }
- }
- return null;
- }
-
-
- public String getAttributeNS(String namespaceURI, String localName) {
- for (int i=0; i<attrs.length; i++) {
- if (attrs[i].getLocalName().equals(localName) && nsEquals(attrs[i].getNamespaceURI(), namespaceURI)) {
- return attrs[i].getValue();
- }
- }
- return "";
- }
-
-
- public Attr getAttributeNodeNS(String namespaceURI, String localName) {
- for (int i=0; i<attrs.length; i++) {
- if (attrs[i].getName().equals(localName) && nsEquals(attrs[i].getNamespaceURI(), namespaceURI)) {
- return attrs[i];
- }
- }
- return null;
- }
-
-
- public boolean hasAttribute(String name) {
- for (int i=0; i<attrs.length; i++) {
- if (attrs[i].getName().equals(name)) {
- return true;
- }
- }
- return false;
- }
-
-
- public boolean hasAttributeNS(String namespaceURI, String localName) {
- for (int i=0; i<attrs.length; i++) {
- if (attrs[i].getName().equals(localName) && nsEquals(attrs[i].getNamespaceURI(), namespaceURI)) {
- return true;
- }
- }
- return false;
- }
-
-
- public void setAttribute(String name, String value) {
- for (int i=0; i<attrs.length; i++) {
- if (attrs[i].getName().equals(name)) {
- attrs[i].setValue(value);
- return;
- }
- }
- }
-
- /** Returns the line number. */
- public int getLineNumber() {
- return line;
- }
-
- /** Returns the column number. */
- public int getColumnNumber() {
- return column;
- }
-
- /** Returns the character offset. */
- public int getCharacterOffset() {
- return charOffset;
- }
-
- public String getAnnotation() {
- return fAnnotation;
- }
-
- public String getSyntheticAnnotation() {
- return fSyntheticAnnotation;
- }
-
- /**
- * Compares two namespace URIs with an extra case for null entries
- */
- private static boolean nsEquals(String nsURI_1, String nsURI_2) {
- if (nsURI_1 == null) {
- return (nsURI_2 == null);
- }
- else {
- return nsURI_1.equals(nsURI_2);
- }
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/opti/NamedNodeMapImpl.java b/src/com/sun/org/apache/xerces/internal/impl/xs/opti/NamedNodeMapImpl.java
deleted file mode 100644
index d332999..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/opti/NamedNodeMapImpl.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.opti;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.Attr;
-import org.w3c.dom.NamedNodeMap;
-
-import org.w3c.dom.DOMException;
-
-
-/**
- * @xerces.internal
- *
- * @author Rahul Srivastava, Sun Microsystems Inc.
- *
- */
-public class NamedNodeMapImpl implements NamedNodeMap {
-
- Attr[] attrs;
-
- public NamedNodeMapImpl(Attr[] attrs) {
- this.attrs = attrs;
- }
-
- public Node getNamedItem(String name) {
- for (int i=0; i<attrs.length; i++) {
- if (attrs[i].getName().equals(name)) {
- return attrs[i];
- }
- }
- return null;
- }
-
- public Node item(int index) {
- if (index < 0 && index > getLength()) {
- return null;
- }
- return attrs[index];
- }
-
- public int getLength() {
- return attrs.length;
- }
-
- public Node getNamedItemNS(String namespaceURI, String localName) {
- for (int i=0; i<attrs.length; i++) {
- if (attrs[i].getName().equals(localName) && attrs[i].getNamespaceURI().equals(namespaceURI)) {
- return attrs[i];
- }
- }
- return null;
- }
-
- public Node setNamedItemNS(Node arg) throws DOMException {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
- public Node setNamedItem(Node arg) throws DOMException {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
- public Node removeNamedItem(String name) throws DOMException {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
- public Node removeNamedItemNS(String namespaceURI, String localName) throws DOMException {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/opti/NodeImpl.java b/src/com/sun/org/apache/xerces/internal/impl/xs/opti/NodeImpl.java
deleted file mode 100644
index 5562c9f..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/opti/NodeImpl.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.opti;
-
-/**
- * @xerces.internal
- *
- * @author Rahul Srivastava, Sun Microsystems Inc.
- *
- */
-public class NodeImpl extends DefaultNode {
-
- String prefix;
- String localpart;
- String rawname;
- String uri;
- short nodeType;
- boolean hidden;
-
-
- public NodeImpl() {
- }
-
-
- public NodeImpl(String prefix, String localpart, String rawname, String uri, short nodeType) {
- this.prefix = prefix;
- this.localpart = localpart;
- this.rawname = rawname;
- this.uri = uri;
- this.nodeType = nodeType;
- }
-
-
- public String getNodeName() {
- return rawname;
- }
-
-
- public String getNamespaceURI() {
- return uri;
- }
-
-
- public String getPrefix() {
- return prefix;
- }
-
-
- public String getLocalName() {
- return localpart;
- }
-
-
- public short getNodeType() {
- return nodeType;
- }
-
-
- // other methods
-
- public void setReadOnly(boolean hide, boolean deep) {
- hidden = hide;
- }
-
-
- public boolean getReadOnly() {
- return hidden;
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaDOM.java b/src/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaDOM.java
deleted file mode 100644
index 48d6f12..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaDOM.java
+++ /dev/null
@@ -1,461 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.opti;
-
-import java.util.ArrayList;
-import java.util.Enumeration;
-
-import com.sun.org.apache.xerces.internal.util.XMLSymbols;
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
-import com.sun.org.apache.xerces.internal.xni.XMLString;
-import org.w3c.dom.Attr;
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
- * @xerces.internal
- *
- * @author Rahul Srivastava, Sun Microsystems Inc.
- * @author Sandy Gao, IBM
- *
- * @version $Id: SchemaDOM.java,v 1.7 2010-11-01 04:40:01 joehw Exp $
- */
-public class SchemaDOM extends DefaultDocument {
-
- static final int relationsRowResizeFactor = 15;
- static final int relationsColResizeFactor = 10;
-
- NodeImpl[][] relations;
- // parent must be an element in this scheme
- ElementImpl parent;
- int currLoc;
- int nextFreeLoc;
- boolean hidden;
- boolean inCDATA;
-
- // for annotation support:
- private StringBuffer fAnnotationBuffer = null;
-
- public SchemaDOM() {
- reset();
- }
-
-
- public ElementImpl startElement(QName element, XMLAttributes attributes,
- int line, int column, int offset) {
- ElementImpl node = new ElementImpl(line, column, offset);
- processElement(element, attributes, node);
- // now the current node added, becomes the parent
- parent = node;
- return node;
- }
-
- public ElementImpl emptyElement(QName element, XMLAttributes attributes,
- int line, int column, int offset) {
- ElementImpl node = new ElementImpl(line, column, offset);
- processElement(element, attributes, node);
- return node;
- }
-
- public ElementImpl startElement(QName element, XMLAttributes attributes,
- int line, int column) {
- return startElement(element, attributes, line, column, -1);
- }
-
- public ElementImpl emptyElement(QName element, XMLAttributes attributes,
- int line, int column) {
- return emptyElement(element, attributes, line, column, -1);
- }
-
- private void processElement(QName element, XMLAttributes attributes, ElementImpl node) {
-
- // populate node
- node.prefix = element.prefix;
- node.localpart = element.localpart;
- node.rawname = element.rawname;
- node.uri = element.uri;
- node.schemaDOM = this;
-
- // set the attributes
- Attr[] attrs = new Attr[attributes.getLength()];
- for (int i=0; i<attributes.getLength(); i++) {
- attrs[i] = new AttrImpl(node,
- attributes.getPrefix(i),
- attributes.getLocalName(i),
- attributes.getQName(i),
- attributes.getURI(i),
- attributes.getValue(i));
- }
- node.attrs = attrs;
-
- // check if array needs to be resized
- if (nextFreeLoc == relations.length) {
- resizeRelations();
- }
-
- // store the current parent
- //if (relations[currLoc][0] == null || relations[currLoc][0] != parent) {
- if (relations[currLoc][0] != parent) {
- relations[nextFreeLoc][0] = parent;
- currLoc = nextFreeLoc++;
- }
-
- // add the current node as child of parent
- boolean foundPlace = false;
- int i = 1;
- for (i = 1; i<relations[currLoc].length; i++) {
- if (relations[currLoc][i] == null) {
- foundPlace = true;
- break;
- }
- }
-
- if (!foundPlace) {
- resizeRelations(currLoc);
- }
- relations[currLoc][i] = node;
-
- parent.parentRow = currLoc;
- node.row = currLoc;
- node.col = i;
- }
-
-
- public void endElement() {
- // the parent of current parent node becomes the parent
- // for the next node.
- currLoc = parent.row;
- parent = (ElementImpl)relations[currLoc][0];
- }
-
- // note that this will only be called within appinfo/documentation
- void comment(XMLString text) {
- fAnnotationBuffer.append("<!--");
- if (text.length > 0) {
- fAnnotationBuffer.append(text.ch, text.offset, text.length);
- }
- fAnnotationBuffer.append("-->");
- }
-
- // note that this will only be called within appinfo/documentation
- void processingInstruction(String target, XMLString data) {
- fAnnotationBuffer.append("<?").append(target);
- if (data.length > 0) {
- fAnnotationBuffer.append(' ').append(data.ch, data.offset, data.length);
- }
- fAnnotationBuffer.append("?>");
- }
-
- // note that this will only be called within appinfo/documentation
- void characters(XMLString text) {
-
- // escape characters if necessary
- if (!inCDATA) {
- final StringBuffer annotationBuffer = fAnnotationBuffer;
- for (int i = text.offset; i < text.offset+text.length; ++i) {
- char ch = text.ch[i];
- if (ch == '&') {
- annotationBuffer.append("&amp;");
- }
- else if (ch == '<') {
- annotationBuffer.append("&lt;");
- }
- // character sequence "]]>" cannot appear in content,
- // therefore we should escape '>'.
- else if (ch == '>') {
- annotationBuffer.append("&gt;");
- }
- // If CR is part of the document's content, it
- // must not be printed as a literal otherwise
- // it would be normalized to LF when the document
- // is reparsed.
- else if (ch == '\r') {
- annotationBuffer.append("&#xD;");
- }
- else {
- annotationBuffer.append(ch);
- }
- }
- }
- else {
- fAnnotationBuffer.append(text.ch, text.offset, text.length);
- }
- }
-
- // note that this will only be called within appinfo/documentation
- void charactersRaw(String text) {
- fAnnotationBuffer.append(text);
- }
-
- void endAnnotation(QName elemName, ElementImpl annotation) {
- fAnnotationBuffer.append("\n</").append(elemName.rawname).append(">");
- annotation.fAnnotation = fAnnotationBuffer.toString();
- // apparently, there is no sensible way of resetting these things
- fAnnotationBuffer = null;
- }
-
- void endAnnotationElement(QName elemName) {
- endAnnotationElement(elemName.rawname);
- }
-
- void endAnnotationElement(String elemRawName) {
- fAnnotationBuffer.append("</").append(elemRawName).append(">");
- }
-
- void endSyntheticAnnotationElement(QName elemName, boolean complete) {
- endSyntheticAnnotationElement(elemName.rawname, complete);
- }
-
- void endSyntheticAnnotationElement(String elemRawName, boolean complete) {
- if(complete) {
- fAnnotationBuffer.append("\n</").append(elemRawName).append(">");
- // note that this is always called after endElement on <annotation>'s
- // child and before endElement on annotation.
- // hence, we must make this the child of the current
- // parent's only child.
- parent.fSyntheticAnnotation = fAnnotationBuffer.toString();
-
- // apparently, there is no sensible way of resetting
- // these things
- fAnnotationBuffer = null;
- } else //capturing character calls
- fAnnotationBuffer.append("</").append(elemRawName).append(">");
- }
-
- void startAnnotationCDATA() {
- inCDATA = true;
- fAnnotationBuffer.append("<![CDATA[");
- }
-
- void endAnnotationCDATA() {
- fAnnotationBuffer.append("]]>");
- inCDATA = false;
- }
-
- private void resizeRelations() {
- NodeImpl[][] temp = new NodeImpl[relations.length+relationsRowResizeFactor][];
- System.arraycopy(relations, 0, temp, 0, relations.length);
- for (int i = relations.length ; i < temp.length ; i++) {
- temp[i] = new NodeImpl[relationsColResizeFactor];
- }
- relations = temp;
- }
-
- private void resizeRelations(int i) {
- NodeImpl[] temp = new NodeImpl[relations[i].length+relationsColResizeFactor];
- System.arraycopy(relations[i], 0, temp, 0, relations[i].length);
- relations[i] = temp;
- }
-
-
- public void reset() {
-
- // help out the garbage collector
- if(relations != null)
- for(int i=0; i<relations.length; i++)
- for(int j=0; j<relations[i].length; j++)
- relations[i][j] = null;
- relations = new NodeImpl[relationsRowResizeFactor][];
- parent = new ElementImpl(0, 0, 0);
- parent.rawname = "DOCUMENT_NODE";
- currLoc = 0;
- nextFreeLoc = 1;
- inCDATA = false;
- for (int i=0; i<relationsRowResizeFactor; i++) {
- relations[i] = new NodeImpl[relationsColResizeFactor];
- }
- relations[currLoc][0] = parent;
- }
-
-
- public void printDOM() {
- /*
- for (int i=0; i<relations.length; i++) {
- if (relations[i][0] != null) {
- for (int j=0; j<relations[i].length; j++) {
- if (relations[i][j] != null) {
- System.out.print(relations[i][j].nodeType+"-"+relations[i][j].parentRow+" ");
- }
- }
- System.out.println("");
- }
- }
- */
- //traverse(getDocumentElement(), 0);
- }
-
-
- // debug methods
-
- public static void traverse(Node node, int depth) {
- indent(depth);
- System.out.print("<"+node.getNodeName());
-
- if (node.hasAttributes()) {
- NamedNodeMap attrs = node.getAttributes();
- for (int i=0; i<attrs.getLength(); i++) {
- System.out.print(" "+((Attr)attrs.item(i)).getName()+"=\""+((Attr)attrs.item(i)).getValue()+"\"");
- }
- }
-
- if (node.hasChildNodes()) {
- System.out.println(">");
- depth+=4;
- for (Node child = node.getFirstChild(); child != null; child = child.getNextSibling()) {
- traverse(child, depth);
- }
- depth-=4;
- indent(depth);
- System.out.println("</"+node.getNodeName()+">");
- }
- else {
- System.out.println("/>");
- }
- }
-
- public static void indent(int amount) {
- for (int i = 0; i < amount; i++) {
- System.out.print(' ');
- }
- }
-
- // org.w3c.dom methods
- public Element getDocumentElement() {
- // this returns a parent node, known to be an ElementImpl
- return (ElementImpl)relations[0][1];
- }
-
- public DOMImplementation getImplementation() {
- return SchemaDOMImplementation.getDOMImplementation();
- }
-
- // commence the serialization of an annotation
- void startAnnotation(QName elemName, XMLAttributes attributes,
- NamespaceContext namespaceContext) {
- startAnnotation(elemName.rawname, attributes, namespaceContext);
- }
- void startAnnotation(String elemRawName, XMLAttributes attributes,
- NamespaceContext namespaceContext) {
- if(fAnnotationBuffer == null) fAnnotationBuffer = new StringBuffer(256);
- fAnnotationBuffer.append("<").append(elemRawName).append(" ");
-
- // attributes are a bit of a pain. To get this right, we have to keep track
- // of the namespaces we've seen declared, then examine the namespace context
- // for other namespaces so that we can also include them.
- // optimized for simplicity and the case that not many
- // namespaces are declared on this annotation...
- ArrayList namespaces = new ArrayList();
- for (int i = 0; i < attributes.getLength(); ++i) {
- String aValue = attributes.getValue(i);
- String aPrefix = attributes.getPrefix(i);
- String aQName = attributes.getQName(i);
- // if it's xmlns:* or xmlns, must be a namespace decl
- if (aPrefix == XMLSymbols.PREFIX_XMLNS || aQName == XMLSymbols.PREFIX_XMLNS) {
- namespaces.add(aPrefix == XMLSymbols.PREFIX_XMLNS ?
- attributes.getLocalName(i) : XMLSymbols.EMPTY_STRING);
- }
- fAnnotationBuffer.append(aQName).append("=\"").append(processAttValue(aValue)).append("\" ");
- }
- // now we have to look through currently in-scope namespaces to see what
- // wasn't declared here
- Enumeration currPrefixes = namespaceContext.getAllPrefixes();
- while(currPrefixes.hasMoreElements()) {
- String prefix = (String)currPrefixes.nextElement();
- String uri = namespaceContext.getURI(prefix);
- if (uri == null) {
- uri = XMLSymbols.EMPTY_STRING;
- }
- if (!namespaces.contains(prefix)) {
- // have to declare this one
- if(prefix == XMLSymbols.EMPTY_STRING) {
- fAnnotationBuffer.append("xmlns").append("=\"").append(processAttValue(uri)).append("\" ");
- }
- else {
- fAnnotationBuffer.append("xmlns:").append(prefix).append("=\"").append(processAttValue(uri)).append("\" ");
- }
- }
- }
- fAnnotationBuffer.append(">\n");
- }
- void startAnnotationElement(QName elemName, XMLAttributes attributes) {
- startAnnotationElement(elemName.rawname, attributes);
- }
- void startAnnotationElement(String elemRawName, XMLAttributes attributes) {
- fAnnotationBuffer.append("<").append(elemRawName);
- for(int i=0; i<attributes.getLength(); i++) {
- String aValue = attributes.getValue(i);
- fAnnotationBuffer.append(" ").append(attributes.getQName(i)).append("=\"").append(processAttValue(aValue)).append("\"");
- }
- fAnnotationBuffer.append(">");
- }
-
- private static String processAttValue(String original) {
- final int length = original.length();
- // normally, nothing will happen
- for (int i = 0; i < length; ++i) {
- char currChar = original.charAt(i);
- if (currChar == '"' || currChar == '<' || currChar == '&' ||
- currChar == 0x09 || currChar == 0x0A || currChar == 0x0D) {
- return escapeAttValue(original, i);
- }
- }
- return original;
- }
-
- private static String escapeAttValue(String original, int from) {
- int i;
- final int length = original.length();
- StringBuffer newVal = new StringBuffer(length);
- newVal.append(original.substring(0, from));
- for (i = from; i < length; ++i) {
- char currChar = original.charAt(i);
- if (currChar == '"') {
- newVal.append("&quot;");
- }
- else if (currChar == '<') {
- newVal.append("&lt;");
- }
- else if (currChar == '&') {
- newVal.append("&amp;");
- }
- // Must escape 0x09, 0x0A and 0x0D if they appear in attribute
- // value so that they may be round-tripped. They would otherwise
- // be transformed to a 0x20 during attribute value normalization.
- else if (currChar == 0x09) {
- newVal.append("&#x9;");
- }
- else if (currChar == 0x0A) {
- newVal.append("&#xA;");
- }
- else if (currChar == 0x0D) {
- newVal.append("&#xD;");
- }
- else {
- newVal.append(currChar);
- }
- }
- return newVal.toString();
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaDOMImplementation.java b/src/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaDOMImplementation.java
deleted file mode 100644
index 105e636..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaDOMImplementation.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.opti;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-
-/**
- * @xerces.internal
- *
- * @version $Id: SchemaDOMImplementation.java,v 1.2 2010-10-26 23:01:18 joehw Exp $
- */
-final class SchemaDOMImplementation implements DOMImplementation {
-
- private static final SchemaDOMImplementation singleton = new SchemaDOMImplementation();
-
- /** NON-DOM: Obtain and return the single shared object */
- public static DOMImplementation getDOMImplementation() {
- return singleton;
- }
-
- private SchemaDOMImplementation() {}
-
- public Document createDocument(String namespaceURI, String qualifiedName, DocumentType doctype)
- throws DOMException {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
- public DocumentType createDocumentType(String qualifiedName, String publicId, String systemId)
- throws DOMException {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
- }
-
- public Object getFeature(String feature, String version) {
- if (singleton.hasFeature(feature, version)) {
- return singleton;
- }
- return null;
- }
-
- public boolean hasFeature(String feature, String version) {
- final boolean anyVersion = version == null || version.length() == 0;
- return (feature.equalsIgnoreCase("Core") || feature.equalsIgnoreCase("XML")) &&
- (anyVersion || version.equals("1.0") || version.equals("2.0") || version.equals("3.0"));
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaDOMParser.java b/src/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaDOMParser.java
deleted file mode 100644
index be28c8c..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaDOMParser.java
+++ /dev/null
@@ -1,611 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.opti;
-
-import java.io.IOException;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
-import com.sun.org.apache.xerces.internal.impl.xs.SchemaSymbols;
-import com.sun.org.apache.xerces.internal.impl.xs.XSMessageFormatter;
-import com.sun.org.apache.xerces.internal.util.XMLAttributesImpl;
-import com.sun.org.apache.xerces.internal.util.XMLChar;
-import com.sun.org.apache.xerces.internal.xni.Augmentations;
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
-import com.sun.org.apache.xerces.internal.xni.XMLLocator;
-import com.sun.org.apache.xerces.internal.xni.XMLString;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLEntityResolver;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration;
-import org.w3c.dom.Document;
-
-/**
- * @xerces.internal
- *
- * @author Rahul Srivastava, Sun Microsystems Inc.
- * @author Sandy Gao, IBM
- *
- * @version $Id: SchemaDOMParser.java,v 1.8 2010-11-01 04:40:01 joehw Exp $
- */
-public class SchemaDOMParser extends DefaultXMLDocumentHandler {
-
- //
- // Data
- //
-
- /** Property identifier: error reporter. */
- public static final String ERROR_REPORTER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY;
-
- /** Feature identifier: generate synthetic annotations. */
- public static final String GENERATE_SYNTHETIC_ANNOTATION =
- Constants.XERCES_FEATURE_PREFIX + Constants.GENERATE_SYNTHETIC_ANNOTATIONS_FEATURE;
-
- // the locator containing line/column information
- protected XMLLocator fLocator;
-
- // namespace context, needed for producing
- // representations of annotations
- protected NamespaceContext fNamespaceContext = null;
-
- SchemaDOM schemaDOM;
-
- XMLParserConfiguration config;
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- public SchemaDOMParser(XMLParserConfiguration config) {
- this.config = config;
- config.setDocumentHandler(this);
- config.setDTDHandler(this);
- config.setDTDContentModelHandler(this);
- }
-
- // Reference to the current annotation element.
- private ElementImpl fCurrentAnnotationElement;
- // where an annotation element itself begins
- // -1 means not in an annotation's scope
- private int fAnnotationDepth = -1;
- // Where xs:appinfo or xs:documentation starts;
- // -1 means not in the scope of either of the two elements.
- private int fInnerAnnotationDepth = -1;
- // The current element depth
- private int fDepth = -1;
- // Use to report the error when characters are not allowed.
- XMLErrorReporter fErrorReporter;
-
- // fields for generate-synthetic annotations feature
- private boolean fGenerateSyntheticAnnotation = false;
- private BooleanStack fHasNonSchemaAttributes = new BooleanStack();
- private BooleanStack fSawAnnotation = new BooleanStack();
- private XMLAttributes fEmptyAttr = new XMLAttributesImpl();
-
- //
- // XMLDocumentHandler methods
- //
-
- public void startDocument(XMLLocator locator, String encoding,
- NamespaceContext namespaceContext, Augmentations augs)
- throws XNIException {
- fErrorReporter = (XMLErrorReporter)config.getProperty(ERROR_REPORTER);
- fGenerateSyntheticAnnotation = config.getFeature(GENERATE_SYNTHETIC_ANNOTATION);
- fHasNonSchemaAttributes.clear();
- fSawAnnotation.clear();
- schemaDOM = new SchemaDOM();
- fCurrentAnnotationElement = null;
- fAnnotationDepth = -1;
- fInnerAnnotationDepth = -1;
- fDepth = -1;
- fLocator = locator;
- fNamespaceContext = namespaceContext;
- schemaDOM.setDocumentURI(locator.getExpandedSystemId());
- } // startDocument(XMLLocator,String,NamespaceContext, Augmentations)
-
- /**
- * The end of the document.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endDocument(Augmentations augs) throws XNIException {
- // To debug the DOM created uncomment the line below
- // schemaDOM.printDOM();
- } // endDocument()
-
-
- /**
- * A comment.
- *
- * @param text The text in the comment.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by application to signal an error.
- */
- public void comment(XMLString text, Augmentations augs) throws XNIException {
- if(fAnnotationDepth > -1) {
- schemaDOM.comment(text);
- }
- }
-
- /**
- * A processing instruction. Processing instructions consist of a
- * target name and, optionally, text data. The data is only meaningful
- * to the application.
- * <p>
- * Typically, a processing instruction's data will contain a series
- * of pseudo-attributes. These pseudo-attributes follow the form of
- * element attributes but are <strong>not</strong> parsed or presented
- * to the application as anything other than text. The application is
- * responsible for parsing the data.
- *
- * @param target The target.
- * @param data The data or null if none specified.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void processingInstruction(String target, XMLString data, Augmentations augs)
- throws XNIException {
- if (fAnnotationDepth > -1) {
- schemaDOM.processingInstruction(target, data);
- }
- }
-
- /**
- * Character content.
- *
- * @param text The content.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void characters(XMLString text, Augmentations augs) throws XNIException {
- // when it's not within xs:appinfo or xs:documentation
- if (fInnerAnnotationDepth == -1 ) {
- for (int i=text.offset; i<text.offset+text.length; i++) {
- // and there is a non-whitespace character
- if (!XMLChar.isSpace(text.ch[i])) {
- // the string we saw: starting from the first non-whitespace character.
- String txt = new String(text.ch, i, text.length+text.offset-i);
- // report an error
- fErrorReporter.reportError(fLocator,
- XSMessageFormatter.SCHEMA_DOMAIN,
- "s4s-elt-character",
- new Object[]{txt},
- XMLErrorReporter.SEVERITY_ERROR);
- break;
- }
- }
- // don't call super.characters() when it's not within one of the 2
- // annotation elements: the traversers ignore them anyway. We can
- // save time/memory creating the text nodes.
- }
- // when it's within either of the 2 elements, characters are allowed
- // and we need to store them.
- else {
- schemaDOM.characters(text);
- }
-
- }
-
-
- /**
- * The start of an element.
- *
- * @param element The name of the element.
- * @param attributes The element attributes.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void startElement(QName element, XMLAttributes attributes, Augmentations augs)
- throws XNIException {
-
- fDepth++;
- // while it is true that non-whitespace character data
- // may only occur in appInfo or documentation
- // elements, it's certainly legal for comments and PI's to
- // occur as children of annotation; we need
- // to account for these here.
- if (fAnnotationDepth == -1) {
- if (element.uri == SchemaSymbols.URI_SCHEMAFORSCHEMA &&
- element.localpart == SchemaSymbols.ELT_ANNOTATION) {
- if (fGenerateSyntheticAnnotation) {
- if (fSawAnnotation.size() > 0) {
- fSawAnnotation.pop();
- }
- fSawAnnotation.push(true);
- }
- fAnnotationDepth = fDepth;
- schemaDOM.startAnnotation(element, attributes, fNamespaceContext);
- fCurrentAnnotationElement = schemaDOM.startElement(element, attributes,
- fLocator.getLineNumber(),
- fLocator.getColumnNumber(),
- fLocator.getCharacterOffset());
- return;
- }
- else if (element.uri == SchemaSymbols.URI_SCHEMAFORSCHEMA && fGenerateSyntheticAnnotation) {
- fSawAnnotation.push(false);
- fHasNonSchemaAttributes.push(hasNonSchemaAttributes(element, attributes));
- }
- }
- else if (fDepth == fAnnotationDepth + 1) {
- fInnerAnnotationDepth = fDepth;
- schemaDOM.startAnnotationElement(element, attributes);
- }
- else {
- schemaDOM.startAnnotationElement(element, attributes);
- // avoid falling through; don't call startElement in this case
- return;
- }
- schemaDOM.startElement(element, attributes,
- fLocator.getLineNumber(),
- fLocator.getColumnNumber(),
- fLocator.getCharacterOffset());
-
- }
-
-
- /**
- * An empty element.
- *
- * @param element The name of the element.
- * @param attributes The element attributes.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void emptyElement(QName element, XMLAttributes attributes, Augmentations augs)
- throws XNIException {
-
- if (fGenerateSyntheticAnnotation && fAnnotationDepth == -1 &&
- element.uri == SchemaSymbols.URI_SCHEMAFORSCHEMA && element.localpart != SchemaSymbols.ELT_ANNOTATION && hasNonSchemaAttributes(element, attributes)) {
-
- schemaDOM.startElement(element, attributes,
- fLocator.getLineNumber(),
- fLocator.getColumnNumber(),
- fLocator.getCharacterOffset());
-
- attributes.removeAllAttributes();
- String schemaPrefix = fNamespaceContext.getPrefix(SchemaSymbols.URI_SCHEMAFORSCHEMA);
- final String annRawName = (schemaPrefix.length() == 0) ? SchemaSymbols.ELT_ANNOTATION : (schemaPrefix + ':' + SchemaSymbols.ELT_ANNOTATION);
- schemaDOM.startAnnotation(annRawName, attributes, fNamespaceContext);
- final String elemRawName = (schemaPrefix.length() == 0) ? SchemaSymbols.ELT_DOCUMENTATION : (schemaPrefix + ':' + SchemaSymbols.ELT_DOCUMENTATION);
- schemaDOM.startAnnotationElement(elemRawName, attributes);
- schemaDOM.charactersRaw("SYNTHETIC_ANNOTATION");
- schemaDOM.endSyntheticAnnotationElement(elemRawName, false);
- schemaDOM.endSyntheticAnnotationElement(annRawName, true);
-
- schemaDOM.endElement();
-
- return;
- }
- // the order of events that occurs here is:
- // schemaDOM.startAnnotation/startAnnotationElement (if applicable)
- // schemaDOM.emptyElement (basically the same as startElement then endElement)
- // schemaDOM.endAnnotationElement (if applicable)
- // the order of events that would occur if this was <element></element>:
- // schemaDOM.startAnnotation/startAnnotationElement (if applicable)
- // schemaDOM.startElement
- // schemaDOM.endAnnotationElement (if applicable)
- // schemaDOM.endElementElement
- // Thus, we can see that the order of events isn't the same. However, it doesn't
- // seem to matter. -- PJM
- if (fAnnotationDepth == -1) {
- // this is messed up, but a case to consider:
- if (element.uri == SchemaSymbols.URI_SCHEMAFORSCHEMA &&
- element.localpart == SchemaSymbols.ELT_ANNOTATION) {
- schemaDOM.startAnnotation(element, attributes, fNamespaceContext);
- }
- }
- else {
- schemaDOM.startAnnotationElement(element, attributes);
- }
-
- ElementImpl newElem = schemaDOM.emptyElement(element, attributes,
- fLocator.getLineNumber(),
- fLocator.getColumnNumber(),
- fLocator.getCharacterOffset());
-
- if (fAnnotationDepth == -1) {
- // this is messed up, but a case to consider:
- if (element.uri == SchemaSymbols.URI_SCHEMAFORSCHEMA &&
- element.localpart == SchemaSymbols.ELT_ANNOTATION) {
- schemaDOM.endAnnotation(element, newElem);
- }
- }
- else {
- schemaDOM.endAnnotationElement(element);
- }
- }
-
-
- /**
- * The end of an element.
- *
- * @param element The name of the element.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void endElement(QName element, Augmentations augs) throws XNIException {
-
- // when we reach the endElement of xs:appinfo or xs:documentation,
- // change fInnerAnnotationDepth to -1
- if(fAnnotationDepth > -1) {
- if (fInnerAnnotationDepth == fDepth) {
- fInnerAnnotationDepth = -1;
- schemaDOM.endAnnotationElement(element);
- schemaDOM.endElement();
- } else if (fAnnotationDepth == fDepth) {
- fAnnotationDepth = -1;
- schemaDOM.endAnnotation(element, fCurrentAnnotationElement);
- schemaDOM.endElement();
- } else { // inside a child of annotation
- schemaDOM.endAnnotationElement(element);
- }
- } else { // not in an annotation at all
- if(element.uri == SchemaSymbols.URI_SCHEMAFORSCHEMA && fGenerateSyntheticAnnotation) {
- boolean value = fHasNonSchemaAttributes.pop();
- boolean sawann = fSawAnnotation.pop();
- if (value && !sawann) {
- String schemaPrefix = fNamespaceContext.getPrefix(SchemaSymbols.URI_SCHEMAFORSCHEMA);
- final String annRawName = (schemaPrefix.length() == 0) ? SchemaSymbols.ELT_ANNOTATION : (schemaPrefix + ':' + SchemaSymbols.ELT_ANNOTATION);
- schemaDOM.startAnnotation(annRawName, fEmptyAttr, fNamespaceContext);
- final String elemRawName = (schemaPrefix.length() == 0) ? SchemaSymbols.ELT_DOCUMENTATION : (schemaPrefix + ':' + SchemaSymbols.ELT_DOCUMENTATION);
- schemaDOM.startAnnotationElement(elemRawName, fEmptyAttr);
- schemaDOM.charactersRaw("SYNTHETIC_ANNOTATION");
- schemaDOM.endSyntheticAnnotationElement(elemRawName, false);
- schemaDOM.endSyntheticAnnotationElement(annRawName, true);
- }
- }
- schemaDOM.endElement();
- }
- fDepth--;
-
- }
-
- /**
- * @param attributes
- * @return
- */
- private boolean hasNonSchemaAttributes(QName element, XMLAttributes attributes) {
- final int length = attributes.getLength();
- for (int i = 0; i < length; ++i) {
- String uri = attributes.getURI(i);
- if (uri != null && uri != SchemaSymbols.URI_SCHEMAFORSCHEMA &&
- uri != NamespaceContext.XMLNS_URI &&
- !(uri == NamespaceContext.XML_URI &&
- attributes.getQName(i) == SchemaSymbols.ATT_XML_LANG && element.localpart == SchemaSymbols.ELT_SCHEMA)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Ignorable whitespace. For this method to be called, the document
- * source must have some way of determining that the text containing
- * only whitespace characters should be considered ignorable. For
- * example, the validator can determine if a length of whitespace
- * characters in the document are ignorable based on the element
- * content model.
- *
- * @param text The ignorable whitespace.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void ignorableWhitespace(XMLString text, Augmentations augs) throws XNIException {
- // unlikely to be called, but you never know...
- if (fAnnotationDepth != -1 ) {
- schemaDOM.characters(text);
- }
- }
-
- /**
- * The start of a CDATA section.
- *
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void startCDATA(Augmentations augs) throws XNIException {
- // only deal with CDATA boundaries within an annotation.
- if (fAnnotationDepth != -1) {
- schemaDOM.startAnnotationCDATA();
- }
- }
-
- /**
- * The end of a CDATA section.
- *
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void endCDATA(Augmentations augs) throws XNIException {
- // only deal with CDATA boundaries within an annotation.
- if (fAnnotationDepth != -1) {
- schemaDOM.endAnnotationCDATA();
- }
- }
-
-
- //
- // other methods
- //
-
- /**
- * Returns the DOM document object.
- */
- public Document getDocument() {
- return schemaDOM;
- }
-
- /**
- * Delegates to SchemaParsingConfig.setFeature
- * @param featureId
- * @param state
- */
- public void setFeature(String featureId, boolean state){
- config.setFeature(featureId, state);
- }
-
- /**
- * Delegates to SchemaParsingConfig.getFeature
- * @param featureId
- * @return boolean
- */
- public boolean getFeature(String featureId){
- return config.getFeature(featureId);
- }
-
- /**
- * Delegates to SchemaParsingConfig.setProperty.
- * @param propertyId
- * @param value
- */
- public void setProperty(String propertyId, Object value){
- config.setProperty(propertyId, value);
- }
-
- /**
- * Delegates to SchemaParsingConfig.getProperty.
- * @param propertyId
- * @return Object
- */
- public Object getProperty(String propertyId){
- return config.getProperty(propertyId);
- }
-
- /**
- * Delegates to SchemaParsingConfig.setEntityResolver.
- * @param er XMLEntityResolver
- */
- public void setEntityResolver(XMLEntityResolver er) {
- config.setEntityResolver(er);
- }
-
- /**
- * Delegates parsing to SchemaParsingConfig
- *
- * @param inputSource
- * @throws IOException
- */
- public void parse(XMLInputSource inputSource) throws IOException {
- config.parse(inputSource);
- }
-
- /**
- * Reset SchemaParsingConfig
- */
- public void reset() {
- ((SchemaParsingConfig)config).reset();
- }
-
- /**
- * ResetNodePool on SchemaParsingConfig
- */
- public void resetNodePool() {
- ((SchemaParsingConfig)config).resetNodePool();
- }
-
- /**
- * A simple boolean based stack.
- *
- * @xerces.internal
- */
- private static final class BooleanStack {
-
- //
- // Data
- //
-
- /** Stack depth. */
- private int fDepth;
-
- /** Stack data. */
- private boolean[] fData;
-
- //
- // Constructor
- //
-
- public BooleanStack () {}
-
- //
- // Public methods
- //
-
- /** Returns the size of the stack. */
- public int size() {
- return fDepth;
- }
-
- /** Pushes a value onto the stack. */
- public void push(boolean value) {
- ensureCapacity(fDepth + 1);
- fData[fDepth++] = value;
- }
-
- /** Pops a value off of the stack. */
- public boolean pop() {
- return fData[--fDepth];
- }
-
- /** Clears the stack. */
- public void clear() {
- fDepth = 0;
- }
-
- //
- // Private methods
- //
-
- /** Ensures capacity. */
- private void ensureCapacity(int size) {
- if (fData == null) {
- fData = new boolean[32];
- }
- else if (fData.length <= size) {
- boolean[] newdata = new boolean[fData.length * 2];
- System.arraycopy(fData, 0, newdata, 0, fData.length);
- fData = newdata;
- }
- }
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaParsingConfig.java b/src/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaParsingConfig.java
deleted file mode 100644
index a9b251e..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaParsingConfig.java
+++ /dev/null
@@ -1,1031 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.opti;
-
-import java.io.IOException;
-import java.util.Locale;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.XML11DTDScannerImpl;
-import com.sun.org.apache.xerces.internal.impl.XML11NSDocumentScannerImpl;
-import com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl;
-import com.sun.org.apache.xerces.internal.impl.XMLEntityHandler;
-import com.sun.org.apache.xerces.internal.impl.XMLEntityManager;
-import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
-import com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl;
-import com.sun.org.apache.xerces.internal.impl.XMLVersionDetector;
-import com.sun.org.apache.xerces.internal.impl.dv.DTDDVFactory;
-import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter;
-import com.sun.org.apache.xerces.internal.impl.validation.ValidationManager;
-import com.sun.org.apache.xerces.internal.impl.xs.XSMessageFormatter;
-import com.sun.org.apache.xerces.internal.parsers.BasicParserConfiguration;
-import com.sun.org.apache.xerces.internal.util.FeatureState;
-import com.sun.org.apache.xerces.internal.util.PropertyState;
-import com.sun.org.apache.xerces.internal.util.Status;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.xni.XMLLocator;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponent;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDScanner;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentScanner;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLPullParserConfiguration;
-
-/**
- * @xerces.internal
- *
- * @author Rahul Srivastava, Sun Microsystems Inc.
- *
- * @version $Id: SchemaParsingConfig.java,v 1.8 2010-11-01 04:40:01 joehw Exp $
- */
-public class SchemaParsingConfig extends BasicParserConfiguration
- implements XMLPullParserConfiguration {
-
- //
- // Constants
- //
-
- protected final static String XML11_DATATYPE_VALIDATOR_FACTORY =
- "com.sun.org.apache.xerces.internal.impl.dv.dtd.XML11DTDDVFactoryImpl";
-
- // feature identifiers
-
- /** Feature identifier: warn on duplicate attribute definition. */
- protected static final String WARN_ON_DUPLICATE_ATTDEF =
- Constants.XERCES_FEATURE_PREFIX + Constants.WARN_ON_DUPLICATE_ATTDEF_FEATURE;
-
- /** Feature identifier: warn on duplicate entity definition. */
- // protected static final String WARN_ON_DUPLICATE_ENTITYDEF = Constants.XERCES_FEATURE_PREFIX + Constants.WARN_ON_DUPLICATE_ENTITYDEF_FEATURE;
-
- /** Feature identifier: warn on undeclared element definition. */
- protected static final String WARN_ON_UNDECLARED_ELEMDEF =
- Constants.XERCES_FEATURE_PREFIX + Constants.WARN_ON_UNDECLARED_ELEMDEF_FEATURE;
-
- /** Feature identifier: allow Java encodings. */
- protected static final String ALLOW_JAVA_ENCODINGS =
- Constants.XERCES_FEATURE_PREFIX + Constants.ALLOW_JAVA_ENCODINGS_FEATURE;
-
- /** Feature identifier: continue after fatal error. */
- protected static final String CONTINUE_AFTER_FATAL_ERROR =
- Constants.XERCES_FEATURE_PREFIX + Constants.CONTINUE_AFTER_FATAL_ERROR_FEATURE;
-
- /** Feature identifier: load external DTD. */
- protected static final String LOAD_EXTERNAL_DTD =
- Constants.XERCES_FEATURE_PREFIX + Constants.LOAD_EXTERNAL_DTD_FEATURE;
-
- /** Feature identifier: notify built-in refereces. */
- protected static final String NOTIFY_BUILTIN_REFS =
- Constants.XERCES_FEATURE_PREFIX + Constants.NOTIFY_BUILTIN_REFS_FEATURE;
-
- /** Feature identifier: notify character refereces. */
- protected static final String NOTIFY_CHAR_REFS =
- Constants.XERCES_FEATURE_PREFIX + Constants.NOTIFY_CHAR_REFS_FEATURE;
-
- /** Feature identifier: expose schema normalized value */
- protected static final String NORMALIZE_DATA =
- Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_NORMALIZED_VALUE;
-
- /** Feature identifier: send element default value via characters() */
- protected static final String SCHEMA_ELEMENT_DEFAULT =
- Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_ELEMENT_DEFAULT;
-
- /** Feature identifier: generate synthetic annotations. */
- protected static final String GENERATE_SYNTHETIC_ANNOTATIONS =
- Constants.XERCES_FEATURE_PREFIX + Constants.GENERATE_SYNTHETIC_ANNOTATIONS_FEATURE;
-
-
- // property identifiers
-
- /** Property identifier: error reporter. */
- protected static final String ERROR_REPORTER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY;
-
- /** Property identifier: entity manager. */
- protected static final String ENTITY_MANAGER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_MANAGER_PROPERTY;
-
- /** Property identifier document scanner: */
- protected static final String DOCUMENT_SCANNER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.DOCUMENT_SCANNER_PROPERTY;
-
- /** Property identifier: DTD scanner. */
- protected static final String DTD_SCANNER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.DTD_SCANNER_PROPERTY;
-
- /** Property identifier: grammar pool. */
- protected static final String XMLGRAMMAR_POOL =
- Constants.XERCES_PROPERTY_PREFIX + Constants.XMLGRAMMAR_POOL_PROPERTY;
-
- /** Property identifier: DTD validator. */
- protected static final String DTD_VALIDATOR =
- Constants.XERCES_PROPERTY_PREFIX + Constants.DTD_VALIDATOR_PROPERTY;
-
- /** Property identifier: namespace binder. */
- protected static final String NAMESPACE_BINDER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.NAMESPACE_BINDER_PROPERTY;
-
- /** Property identifier: datatype validator factory. */
- protected static final String DATATYPE_VALIDATOR_FACTORY =
- Constants.XERCES_PROPERTY_PREFIX + Constants.DATATYPE_VALIDATOR_FACTORY_PROPERTY;
-
- protected static final String VALIDATION_MANAGER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.VALIDATION_MANAGER_PROPERTY;
-
- /** Property identifier: XML Schema validator. */
- protected static final String SCHEMA_VALIDATOR =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SCHEMA_VALIDATOR_PROPERTY;
-
- /** Property identifier: locale. */
- protected static final String LOCALE =
- Constants.XERCES_PROPERTY_PREFIX + Constants.LOCALE_PROPERTY;
-
-
- // debugging
-
- /** Set to true and recompile to print exception stack trace. */
- private static final boolean PRINT_EXCEPTION_STACK_TRACE = false;
-
- //
- // Data
- //
-
- //
- // XML 1.0 components
- //
-
- /** The XML 1.0 Datatype validator factory. */
- protected final DTDDVFactory fDatatypeValidatorFactory;
-
- /** The XML 1.0 Document scanner. */
- protected final XMLNSDocumentScannerImpl fNamespaceScanner;
-
- /** The XML 1.0 DTD scanner. */
- protected final XMLDTDScannerImpl fDTDScanner;
-
- //
- // XML 1.1 components
- //
-
- /** The XML 1.1 Datatype validator factory. */
- protected DTDDVFactory fXML11DatatypeFactory = null;
-
- /** The XML 1.1 Document scanner. */
- protected XML11NSDocumentScannerImpl fXML11NSDocScanner = null;
-
- /** The XML 1.1 DTD scanner. **/
- protected XML11DTDScannerImpl fXML11DTDScanner = null;
-
- // common components (non-configurable)
-
- /** Current Datatype validator factory. */
- protected DTDDVFactory fCurrentDVFactory;
-
- /** Current scanner */
- protected XMLDocumentScanner fCurrentScanner;
-
- /** Current DTD scanner. */
- protected XMLDTDScanner fCurrentDTDScanner;
-
- /** Grammar pool. */
- protected XMLGrammarPool fGrammarPool;
-
- /** XML version detector. */
- protected final XMLVersionDetector fVersionDetector;
-
- // common components (configurable)
-
- /** Error reporter. */
- protected final XMLErrorReporter fErrorReporter;
-
- /** Entity manager. */
- protected final XMLEntityManager fEntityManager;
-
- /** Input Source */
- protected XMLInputSource fInputSource;
-
- protected final ValidationManager fValidationManager;
- // state
-
- /** Locator */
- protected XMLLocator fLocator;
-
- /**
- * True if a parse is in progress. This state is needed because
- * some features/properties cannot be set while parsing (e.g.
- * validation and namespaces).
- */
- protected boolean fParseInProgress = false;
-
- /**
- * fConfigUpdated is set to true if there has been any change to the configuration settings,
- * i.e a feature or a property was changed.
- */
- protected boolean fConfigUpdated = false;
-
- /** Flag indiciating whether XML11 components have been initialized. */
- private boolean f11Initialized = false;
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- public SchemaParsingConfig() {
- this(null, null, null);
- } // <init>()
-
- /**
- * Constructs a parser configuration using the specified symbol table.
- *
- * @param symbolTable The symbol table to use.
- */
- public SchemaParsingConfig(SymbolTable symbolTable) {
- this(symbolTable, null, null);
- } // <init>(SymbolTable)
-
- /**
- * Constructs a parser configuration using the specified symbol table and
- * grammar pool.
- * <p>
- * <strong>REVISIT:</strong>
- * Grammar pool will be updated when the new validation engine is
- * implemented.
- *
- * @param symbolTable The symbol table to use.
- * @param grammarPool The grammar pool to use.
- */
- public SchemaParsingConfig(SymbolTable symbolTable,
- XMLGrammarPool grammarPool) {
- this(symbolTable, grammarPool, null);
- } // <init>(SymbolTable,XMLGrammarPool)
-
- /**
- * Constructs a parser configuration using the specified symbol table,
- * grammar pool, and parent settings.
- * <p>
- * <strong>REVISIT:</strong>
- * Grammar pool will be updated when the new validation engine is
- * implemented.
- *
- * @param symbolTable The symbol table to use.
- * @param grammarPool The grammar pool to use.
- * @param parentSettings The parent settings.
- */
- public SchemaParsingConfig(SymbolTable symbolTable,
- XMLGrammarPool grammarPool,
- XMLComponentManager parentSettings) {
- super(symbolTable, parentSettings);
-
- // add default recognized features
- final String[] recognizedFeatures = {
- PARSER_SETTINGS, WARN_ON_DUPLICATE_ATTDEF, WARN_ON_UNDECLARED_ELEMDEF,
- ALLOW_JAVA_ENCODINGS, CONTINUE_AFTER_FATAL_ERROR,
- LOAD_EXTERNAL_DTD, NOTIFY_BUILTIN_REFS,
- NOTIFY_CHAR_REFS, GENERATE_SYNTHETIC_ANNOTATIONS
- };
- addRecognizedFeatures(recognizedFeatures);
- fFeatures.put(PARSER_SETTINGS, Boolean.TRUE);
- // set state for default features
- fFeatures.put(WARN_ON_DUPLICATE_ATTDEF, Boolean.FALSE);
- //setFeature(WARN_ON_DUPLICATE_ENTITYDEF, false);
- fFeatures.put(WARN_ON_UNDECLARED_ELEMDEF, Boolean.FALSE);
- fFeatures.put(ALLOW_JAVA_ENCODINGS, Boolean.FALSE);
- fFeatures.put(CONTINUE_AFTER_FATAL_ERROR, Boolean.FALSE);
- fFeatures.put(LOAD_EXTERNAL_DTD, Boolean.TRUE);
- fFeatures.put(NOTIFY_BUILTIN_REFS, Boolean.FALSE);
- fFeatures.put(NOTIFY_CHAR_REFS, Boolean.FALSE);
- fFeatures.put(GENERATE_SYNTHETIC_ANNOTATIONS, Boolean.FALSE);
-
- // add default recognized properties
- final String[] recognizedProperties = {
- ERROR_REPORTER,
- ENTITY_MANAGER,
- DOCUMENT_SCANNER,
- DTD_SCANNER,
- DTD_VALIDATOR,
- NAMESPACE_BINDER,
- XMLGRAMMAR_POOL,
- DATATYPE_VALIDATOR_FACTORY,
- VALIDATION_MANAGER,
- GENERATE_SYNTHETIC_ANNOTATIONS,
- LOCALE
- };
- addRecognizedProperties(recognizedProperties);
-
- fGrammarPool = grammarPool;
- if (fGrammarPool != null) {
- setProperty(XMLGRAMMAR_POOL, fGrammarPool);
- }
-
- fEntityManager = new XMLEntityManager();
- fProperties.put(ENTITY_MANAGER, fEntityManager);
- addComponent(fEntityManager);
-
- fErrorReporter = new XMLErrorReporter();
- fErrorReporter.setDocumentLocator(fEntityManager.getEntityScanner());
- fProperties.put(ERROR_REPORTER, fErrorReporter);
- addComponent(fErrorReporter);
-
- fNamespaceScanner = new XMLNSDocumentScannerImpl();
- fProperties.put(DOCUMENT_SCANNER, fNamespaceScanner);
- addRecognizedParamsAndSetDefaults(fNamespaceScanner);
-
- fDTDScanner = new XMLDTDScannerImpl();
- fProperties.put(DTD_SCANNER, fDTDScanner);
- addRecognizedParamsAndSetDefaults(fDTDScanner);
-
- fDatatypeValidatorFactory = DTDDVFactory.getInstance();
- fProperties.put(DATATYPE_VALIDATOR_FACTORY,
- fDatatypeValidatorFactory);
-
- fValidationManager = new ValidationManager();
- fProperties.put(VALIDATION_MANAGER, fValidationManager);
-
- fVersionDetector = new XMLVersionDetector();
-
- // add message formatters
- if (fErrorReporter.getMessageFormatter(XMLMessageFormatter.XML_DOMAIN) == null) {
- XMLMessageFormatter xmft = new XMLMessageFormatter();
- fErrorReporter.putMessageFormatter(XMLMessageFormatter.XML_DOMAIN, xmft);
- fErrorReporter.putMessageFormatter(XMLMessageFormatter.XMLNS_DOMAIN, xmft);
- }
-
- if (fErrorReporter.getMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN) == null) {
- XSMessageFormatter xmft = new XSMessageFormatter();
- fErrorReporter.putMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN, xmft);
- }
-
- // set locale
- try {
- setLocale(Locale.getDefault());
- }
- catch (XNIException e) {
- // do nothing
- // REVISIT: What is the right thing to do? -Ac
- }
-
- } // <init>(SymbolTable,XMLGrammarPool)
-
- //
- // Public methods
- //
-
- /**
- * Returns the state of a feature.
- *
- * @param featureId The feature identifier.
- * @return true if the feature is supported
- *
- * @throws XMLConfigurationException Thrown for configuration error.
- * In general, components should
- * only throw this exception if
- * it is <strong>really</strong>
- * a critical error.
- */
- public FeatureState getFeatureState(String featureId)
- throws XMLConfigurationException {
- // make this feature special
- if (featureId.equals(PARSER_SETTINGS)) {
- return FeatureState.is(fConfigUpdated);
- }
- return super.getFeatureState(featureId);
-
- } // getFeature(String):boolean
-
- /**
- * Set the state of a feature.
- *
- * Set the state of any feature in a SAX2 parser. The parser
- * might not recognize the feature, and if it does recognize
- * it, it might not be able to fulfill the request.
- *
- * @param featureId The unique identifier (URI) of the feature.
- * @param state The requested state of the feature (true or false).
- *
- * @exception com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException If the
- * requested feature is not known.
- */
- public void setFeature(String featureId, boolean state)
- throws XMLConfigurationException {
-
- fConfigUpdated = true;
-
- // forward to every XML 1.0 component
- fNamespaceScanner.setFeature(featureId, state);
- fDTDScanner.setFeature(featureId, state);
-
- // forward to every XML 1.1 component
- if (f11Initialized) {
- try {
- fXML11DTDScanner.setFeature(featureId, state);
- }
- // ignore the exception.
- catch (Exception e) {}
- try {
- fXML11NSDocScanner.setFeature(featureId, state);
- }
- // ignore the exception
- catch (Exception e) {}
- }
-
- // save state if noone "objects"
- super.setFeature(featureId, state);
-
- } // setFeature(String,boolean)
-
- /**
- * Returns the value of a property.
- *
- * @param propertyId The property identifier.
- * @return the value of the property
- *
- * @throws XMLConfigurationException Thrown for configuration error.
- * In general, components should
- * only throw this exception if
- * it is <strong>really</strong>
- * a critical error.
- */
- public PropertyState getPropertyState(String propertyId)
- throws XMLConfigurationException {
- if (LOCALE.equals(propertyId)) {
- return PropertyState.is(getLocale());
- }
- return super.getPropertyState(propertyId);
- }
-
- /**
- * setProperty
- *
- * @param propertyId
- * @param value
- */
- public void setProperty(String propertyId, Object value)
- throws XMLConfigurationException {
-
- fConfigUpdated = true;
- if (LOCALE.equals(propertyId)) {
- setLocale((Locale) value);
- }
-
- // forward to every XML 1.0 component
- fNamespaceScanner.setProperty(propertyId, value);
- fDTDScanner.setProperty(propertyId, value);
-
- // forward to every XML 1.1 component
- if (f11Initialized) {
- try {
- fXML11DTDScanner.setProperty(propertyId, value);
- }
- // ignore the exception.
- catch (Exception e) {}
- try {
- fXML11NSDocScanner.setProperty(propertyId, value);
- }
- // ignore the exception
- catch (Exception e) {}
- }
-
- // store value if noone "objects"
- super.setProperty(propertyId, value);
-
- } // setProperty(String,Object)
-
- /**
- * Set the locale to use for messages.
- *
- * @param locale The locale object to use for localization of messages.
- *
- * @exception XNIException Thrown if the parser does not support the
- * specified locale.
- */
- public void setLocale(Locale locale) throws XNIException {
- super.setLocale(locale);
- fErrorReporter.setLocale(locale);
- } // setLocale(Locale)
-
- //
- // XMLPullParserConfiguration methods
- //
-
- // parsing
-
- /**
- * Sets the input source for the document to parse.
- *
- * @param inputSource The document's input source.
- *
- * @exception XMLConfigurationException Thrown if there is a
- * configuration error when initializing the
- * parser.
- * @exception IOException Thrown on I/O error.
- *
- * @see #parse(boolean)
- */
- public void setInputSource(XMLInputSource inputSource)
- throws XMLConfigurationException, IOException {
-
- // REVISIT: this method used to reset all the components and
- // construct the pipeline. Now reset() is called
- // in parse (boolean) just before we parse the document
- // Should this method still throw exceptions..?
-
- fInputSource = inputSource;
-
- } // setInputSource(XMLInputSource)
-
- /**
- * Parses the document in a pull parsing fashion.
- *
- * @param complete True if the pull parser should parse the
- * remaining document completely.
- *
- * @return True if there is more document to parse.
- *
- * @exception XNIException Any XNI exception, possibly wrapping
- * another exception.
- * @exception IOException An IO exception from the parser, possibly
- * from a byte stream or character stream
- * supplied by the parser.
- *
- * @see #setInputSource
- */
- public boolean parse(boolean complete) throws XNIException, IOException {
- //
- // reset and configure pipeline and set InputSource.
- if (fInputSource != null) {
- try {
- fValidationManager.reset();
- fVersionDetector.reset(this);
- reset();
-
- short version = fVersionDetector.determineDocVersion(fInputSource);
- // XML 1.0
- if (version == Constants.XML_VERSION_1_0) {
- configurePipeline();
- resetXML10();
- }
- // XML 1.1
- else if (version == Constants.XML_VERSION_1_1) {
- initXML11Components();
- configureXML11Pipeline();
- resetXML11();
- }
- // Unrecoverable error reported during version detection
- else {
- return false;
- }
-
- // mark configuration as fixed
- fConfigUpdated = false;
-
- // resets and sets the pipeline.
- fVersionDetector.startDocumentParsing((XMLEntityHandler) fCurrentScanner, version);
- fInputSource = null;
- }
- catch (XNIException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- }
- catch (IOException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- }
- catch (RuntimeException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- }
- catch (Exception ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw new XNIException(ex);
- }
- }
-
- try {
- return fCurrentScanner.scanDocument(complete);
- }
- catch (XNIException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- }
- catch (IOException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- }
- catch (RuntimeException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- }
- catch (Exception ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw new XNIException(ex);
- }
-
- } // parse(boolean):boolean
-
- /**
- * If the application decides to terminate parsing before the xml document
- * is fully parsed, the application should call this method to free any
- * resource allocated during parsing. For example, close all opened streams.
- */
- public void cleanup() {
- fEntityManager.closeReaders();
- }
-
- //
- // XMLParserConfiguration methods
- //
-
- /**
- * Parses the specified input source.
- *
- * @param source The input source.
- *
- * @exception XNIException Throws exception on XNI error.
- * @exception java.io.IOException Throws exception on i/o error.
- */
- public void parse(XMLInputSource source) throws XNIException, IOException {
-
- if (fParseInProgress) {
- // REVISIT - need to add new error message
- throw new XNIException("FWK005 parse may not be called while parsing.");
- }
- fParseInProgress = true;
-
- try {
- setInputSource(source);
- parse(true);
- }
- catch (XNIException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- }
- catch (IOException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- }
- catch (RuntimeException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- }
- catch (Exception ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw new XNIException(ex);
- }
- finally {
- fParseInProgress = false;
- // close all streams opened by xerces
- this.cleanup();
- }
-
- } // parse(InputSource)
-
- //
- // Protected methods
- //
-
- /**
- * Reset all components before parsing.
- *
- * @throws XNIException Thrown if an error occurs during initialization.
- */
- public void reset() throws XNIException {
-
- // initialize the common components
- super.reset();
-
- } // reset()
-
- /** Configures the XML 1.0 pipeline. */
- protected void configurePipeline() {
-
- if (fCurrentDVFactory != fDatatypeValidatorFactory) {
- fCurrentDVFactory = fDatatypeValidatorFactory;
- // use XML 1.0 datatype library
- setProperty(DATATYPE_VALIDATOR_FACTORY, fCurrentDVFactory);
- }
-
- // setup document pipeline
- if (fCurrentScanner != fNamespaceScanner) {
- fCurrentScanner = fNamespaceScanner;
- setProperty(DOCUMENT_SCANNER, fCurrentScanner);
- }
- fNamespaceScanner.setDocumentHandler(fDocumentHandler);
- if (fDocumentHandler != null) {
- fDocumentHandler.setDocumentSource(fNamespaceScanner);
- }
- fLastComponent = fNamespaceScanner;
-
- // setup dtd pipeline
- if (fCurrentDTDScanner != fDTDScanner) {
- fCurrentDTDScanner = fDTDScanner;
- setProperty(DTD_SCANNER, fCurrentDTDScanner);
- }
- fDTDScanner.setDTDHandler(fDTDHandler);
- if (fDTDHandler != null) {
- fDTDHandler.setDTDSource(fDTDScanner);
- }
- fDTDScanner.setDTDContentModelHandler(fDTDContentModelHandler);
- if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.setDTDContentModelSource(fDTDScanner);
- }
-
- } // configurePipeline()
-
- /** Configures the XML 1.1 pipeline. */
- protected void configureXML11Pipeline() {
-
- if (fCurrentDVFactory != fXML11DatatypeFactory) {
- fCurrentDVFactory = fXML11DatatypeFactory;
- // use XML 1.1 datatype library
- setProperty(DATATYPE_VALIDATOR_FACTORY, fCurrentDVFactory);
- }
-
- // setup document pipeline
- if (fCurrentScanner != fXML11NSDocScanner) {
- fCurrentScanner = fXML11NSDocScanner;
- setProperty(DOCUMENT_SCANNER, fCurrentScanner);
- }
- fXML11NSDocScanner.setDocumentHandler(fDocumentHandler);
- if (fDocumentHandler != null) {
- fDocumentHandler.setDocumentSource(fXML11NSDocScanner);
- }
- fLastComponent = fXML11NSDocScanner;
-
- // setup dtd pipeline
- if (fCurrentDTDScanner != fXML11DTDScanner) {
- fCurrentDTDScanner = fXML11DTDScanner;
- setProperty(DTD_SCANNER, fCurrentDTDScanner);
- }
- fXML11DTDScanner.setDTDHandler(fDTDHandler);
- if (fDTDHandler != null) {
- fDTDHandler.setDTDSource(fXML11DTDScanner);
- }
- fXML11DTDScanner.setDTDContentModelHandler(fDTDContentModelHandler);
- if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.setDTDContentModelSource(fXML11DTDScanner);
- }
-
- } // configureXML11Pipeline()
-
- // features and properties
-
- /**
- * Check a feature. If feature is know and supported, this method simply
- * returns. Otherwise, the appropriate exception is thrown.
- *
- * @param featureId The unique identifier (URI) of the feature.
- *
- * @throws XMLConfigurationException Thrown for configuration error.
- * In general, components should
- * only throw this exception if
- * it is <strong>really</strong>
- * a critical error.
- */
- protected FeatureState checkFeature(String featureId)
- throws XMLConfigurationException {
-
- //
- // Xerces Features
- //
-
- if (featureId.startsWith(Constants.XERCES_FEATURE_PREFIX)) {
- final int suffixLength = featureId.length() - Constants.XERCES_FEATURE_PREFIX.length();
-
- //
- // http://apache.org/xml/features/validation/dynamic
- // Allows the parser to validate a document only when it
- // contains a grammar. Validation is turned on/off based
- // on each document instance, automatically.
- //
- if (suffixLength == Constants.DYNAMIC_VALIDATION_FEATURE.length() &&
- featureId.endsWith(Constants.DYNAMIC_VALIDATION_FEATURE)) {
- return FeatureState.RECOGNIZED;
- }
- //
- // http://apache.org/xml/features/validation/default-attribute-values
- //
- if (suffixLength == Constants.DEFAULT_ATTRIBUTE_VALUES_FEATURE.length() &&
- featureId.endsWith(Constants.DEFAULT_ATTRIBUTE_VALUES_FEATURE)) {
- // REVISIT
- return FeatureState.NOT_SUPPORTED;
- }
- //
- // http://apache.org/xml/features/validation/default-attribute-values
- //
- if (suffixLength == Constants.VALIDATE_CONTENT_MODELS_FEATURE.length() &&
- featureId.endsWith(Constants.VALIDATE_CONTENT_MODELS_FEATURE)) {
- // REVISIT
- return FeatureState.NOT_SUPPORTED;
- }
- //
- // http://apache.org/xml/features/validation/nonvalidating/load-dtd-grammar
- //
- if (suffixLength == Constants.LOAD_DTD_GRAMMAR_FEATURE.length() &&
- featureId.endsWith(Constants.LOAD_DTD_GRAMMAR_FEATURE)) {
- return FeatureState.RECOGNIZED;
- }
- //
- // http://apache.org/xml/features/validation/nonvalidating/load-external-dtd
- //
- if (suffixLength == Constants.LOAD_EXTERNAL_DTD_FEATURE.length() &&
- featureId.endsWith(Constants.LOAD_EXTERNAL_DTD_FEATURE)) {
- return FeatureState.RECOGNIZED;
- }
-
- //
- // http://apache.org/xml/features/validation/default-attribute-values
- //
- if (suffixLength == Constants.VALIDATE_DATATYPES_FEATURE.length() &&
- featureId.endsWith(Constants.VALIDATE_DATATYPES_FEATURE)) {
- return FeatureState.NOT_SUPPORTED;
- }
- }
-
- //
- // Not recognized
- //
-
- return super.checkFeature(featureId);
-
- } // checkFeature(String)
-
- /**
- * Check a property. If the property is know and supported, this method
- * simply returns. Otherwise, the appropriate exception is thrown.
- *
- * @param propertyId The unique identifier (URI) of the property
- * being set.
- *
- * @throws XMLConfigurationException Thrown for configuration error.
- * In general, components should
- * only throw this exception if
- * it is <strong>really</strong>
- * a critical error.
- */
- protected PropertyState checkProperty(String propertyId)
- throws XMLConfigurationException {
-
- //
- // Xerces Properties
- //
-
- if (propertyId.startsWith(Constants.XERCES_PROPERTY_PREFIX)) {
- final int suffixLength = propertyId.length() - Constants.XERCES_PROPERTY_PREFIX.length();
-
- if (suffixLength == Constants.DTD_SCANNER_PROPERTY.length() &&
- propertyId.endsWith(Constants.DTD_SCANNER_PROPERTY)) {
- return PropertyState.RECOGNIZED;
- }
- }
-
- if (propertyId.startsWith(Constants.JAXP_PROPERTY_PREFIX)) {
- final int suffixLength = propertyId.length() - Constants.JAXP_PROPERTY_PREFIX.length();
-
- if (suffixLength == Constants.SCHEMA_SOURCE.length() &&
- propertyId.endsWith(Constants.SCHEMA_SOURCE)) {
- return PropertyState.RECOGNIZED;
- }
- }
-
- //
- // Not recognized
- //
-
- return super.checkProperty(propertyId);
-
- } // checkProperty(String)
-
- /**
- * Adds all of the component's recognized features and properties
- * to the list of default recognized features and properties, and
- * sets default values on the configuration for features and
- * properties which were previously absent from the configuration.
- *
- * @param component The component whose recognized features
- * and properties will be added to the configuration
- */
- private void addRecognizedParamsAndSetDefaults(XMLComponent component) {
-
- // register component's recognized features
- String[] recognizedFeatures = component.getRecognizedFeatures();
- addRecognizedFeatures(recognizedFeatures);
-
- // register component's recognized properties
- String[] recognizedProperties = component.getRecognizedProperties();
- addRecognizedProperties(recognizedProperties);
-
- // set default values
- if (recognizedFeatures != null) {
- for (int i = 0; i < recognizedFeatures.length; ++i) {
- String featureId = recognizedFeatures[i];
- Boolean state = component.getFeatureDefault(featureId);
- if (state != null) {
- // Do not overwrite values already set on the configuration.
- if (!fFeatures.containsKey(featureId)) {
- fFeatures.put(featureId, state);
- // For newly added components who recognize this feature
- // but did not offer a default value, we need to make
- // sure these components will get an opportunity to read
- // the value before parsing begins.
- fConfigUpdated = true;
- }
- }
- }
- }
- if (recognizedProperties != null) {
- for (int i = 0; i < recognizedProperties.length; ++i) {
- String propertyId = recognizedProperties[i];
- Object value = component.getPropertyDefault(propertyId);
- if (value != null) {
- // Do not overwrite values already set on the configuration.
- if (!fProperties.containsKey(propertyId)) {
- fProperties.put(propertyId, value);
- // For newly added components who recognize this property
- // but did not offer a default value, we need to make
- // sure these components will get an opportunity to read
- // the value before parsing begins.
- fConfigUpdated = true;
- }
- }
- }
- }
- }
-
- /**
- * Reset all XML 1.0 components before parsing
- */
- protected final void resetXML10() throws XNIException {
- // Reset XML 1.0 components
- fNamespaceScanner.reset(this);
- fDTDScanner.reset(this);
- } // resetXML10()
-
- /**
- * Reset all XML 1.1 components before parsing
- */
- protected final void resetXML11() throws XNIException {
- // Reset XML 1.1 components
- fXML11NSDocScanner.reset(this);
- fXML11DTDScanner.reset(this);
- } // resetXML11()
-
- //
- // other methods
- //
-
- /** */
- public void resetNodePool() {
- // REVISIT: to implement: introduce a node pool to reuse DTM nodes.
- // reset this pool here.
- }
-
- private void initXML11Components() {
- if (!f11Initialized) {
- // create datatype factory
- fXML11DatatypeFactory = DTDDVFactory.getInstance(XML11_DATATYPE_VALIDATOR_FACTORY);
-
- // setup XML 1.1 DTD pipeline
- fXML11DTDScanner = new XML11DTDScannerImpl();
- addRecognizedParamsAndSetDefaults(fXML11DTDScanner);
-
- // setup XML 1.1. document pipeline - namespace aware
- fXML11NSDocScanner = new XML11NSDocumentScannerImpl();
- addRecognizedParamsAndSetDefaults(fXML11NSDocScanner);
-
- f11Initialized = true;
- }
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/opti/TextImpl.java b/src/com/sun/org/apache/xerces/internal/impl/xs/opti/TextImpl.java
deleted file mode 100644
index 3476e64..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/opti/TextImpl.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.opti;
-
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Node;
-
-/**
- * @xerces.internal
- *
- * @author Neil Graham, IBM
- */
-
-public class TextImpl extends DefaultText {
-
- // Data
- String fData = null;
- SchemaDOM fSchemaDOM = null;
- int fRow;
- int fCol;
-
- public TextImpl(StringBuffer str, SchemaDOM sDOM, int row, int col) {
- fData = str.toString();
- fSchemaDOM = sDOM;
- fRow = row;
- fCol = col;
- rawname = prefix = localpart = uri = null;
- nodeType = Node.TEXT_NODE;
- }
-
- //
- // org.w3c.dom.Node methods
- //
-
- public Node getParentNode() {
- return fSchemaDOM.relations[fRow][0];
- }
-
- public Node getPreviousSibling() {
- if (fCol == 1) {
- return null;
- }
- return fSchemaDOM.relations[fRow][fCol-1];
- }
-
-
- public Node getNextSibling() {
- if (fCol == fSchemaDOM.relations[fRow].length-1) {
- return null;
- }
- return fSchemaDOM.relations[fRow][fCol+1];
- }
-
- // CharacterData methods
-
- /**
- * The character data of the node that implements this interface. The DOM
- * implementation may not put arbitrary limits on the amount of data
- * that may be stored in a <code>CharacterData</code> node. However,
- * implementation limits may mean that the entirety of a node's data may
- * not fit into a single <code>DOMString</code>. In such cases, the user
- * may call <code>substringData</code> to retrieve the data in
- * appropriately sized pieces.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
- * @exception DOMException
- * DOMSTRING_SIZE_ERR: Raised when it would return more characters than
- * fit in a <code>DOMString</code> variable on the implementation
- * platform.
- */
- public String getData()
- throws DOMException {
- return fData;
- }
-
- /**
- * The number of 16-bit units that are available through <code>data</code>
- * and the <code>substringData</code> method below. This may have the
- * value zero, i.e., <code>CharacterData</code> nodes may be empty.
- */
- public int getLength() {
- if(fData == null) return 0;
- return fData.length();
- }
-
- /**
- * Extracts a range of data from the node.
- * @param offset Start offset of substring to extract.
- * @param count The number of 16-bit units to extract.
- * @return The specified substring. If the sum of <code>offset</code> and
- * <code>count</code> exceeds the <code>length</code>, then all 16-bit
- * units to the end of the data are returned.
- * @exception DOMException
- * INDEX_SIZE_ERR: Raised if the specified <code>offset</code> is
- * negative or greater than the number of 16-bit units in
- * <code>data</code>, or if the specified <code>count</code> is
- * negative.
- * <br>DOMSTRING_SIZE_ERR: Raised if the specified range of text does
- * not fit into a <code>DOMString</code>.
- */
- public String substringData(int offset,
- int count)
- throws DOMException {
- if(fData == null) return null;
- if(count < 0 || offset < 0 || offset > fData.length())
- throw new DOMException(DOMException.INDEX_SIZE_ERR, "parameter error");
- if(offset+count >= fData.length())
- return fData.substring(offset);
- return fData.substring(offset, offset+count);
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/SchemaContentHandler.java b/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/SchemaContentHandler.java
deleted file mode 100644
index 1a7ca14..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/SchemaContentHandler.java
+++ /dev/null
@@ -1,382 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.traversers;
-
-import com.sun.org.apache.xerces.internal.impl.xs.opti.SchemaDOMParser;
-import com.sun.org.apache.xerces.internal.util.NamespaceSupport;
-import com.sun.org.apache.xerces.internal.util.SAXLocatorWrapper;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.util.XMLAttributesImpl;
-import com.sun.org.apache.xerces.internal.util.XMLSymbols;
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xni.XMLString;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLParseException;
-import org.w3c.dom.Document;
-import org.xml.sax.Attributes;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.helpers.LocatorImpl;
-
-/**
- * <p>SchemaContentHandler converts SAX events into XNI
- * and passes them directly to the SchemaDOMParser.</p>
- *
- * @xerces.internal
- *
- * @author Michael Glavassevich, IBM
- * @author Jack Z. Wang, IBM
- *
- */
-final class SchemaContentHandler implements ContentHandler {
-
- /** Symbol table **/
- private SymbolTable fSymbolTable;
-
- /** SchemaDOMParser, events will be delegated to SchemaDOMParser to pass */
- private SchemaDOMParser fSchemaDOMParser;
-
- /** XML Locator wrapper for SAX. **/
- private final SAXLocatorWrapper fSAXLocatorWrapper = new SAXLocatorWrapper();
-
- /** The namespace context of this document: stores namespaces in scope */
- private NamespaceSupport fNamespaceContext = new NamespaceSupport();
-
- /** Indicate if push NamespaceContest is needed */
- private boolean fNeedPushNSContext;
-
- /** Flag used to track whether namespace declarations are reported as attributes. */
- private boolean fNamespacePrefixes = false;
-
- /** Flag used to track whether XML names and Namespace URIs have been internalized. */
- private boolean fStringsInternalized = false;
-
- /** Fields for start element, end element and characters. */
- private final QName fElementQName = new QName();
- private final QName fAttributeQName = new QName();
- private final XMLAttributesImpl fAttributes = new XMLAttributesImpl();
- private final XMLString fTempString = new XMLString();
-
- /**
- * <p>Constructs an SchemaContentHandler.</p>
- */
- public SchemaContentHandler() {}
-
- /*
- * @see org.xml.sax.ContentHandler#setDocumentLocator(org.xml.sax.Locator)
- */
- public Document getDocument() {
- return fSchemaDOMParser.getDocument();
- }
-
- /*
- * @see org.xml.sax.ContentHandler#setDocumentLocator(org.xml.sax.Locator)
- */
- public void setDocumentLocator(Locator locator) {
- fSAXLocatorWrapper.setLocator(locator);
- }
-
- /*
- * @see org.xml.sax.ContentHandler#startDocument()
- */
- public void startDocument() throws SAXException {
- fNeedPushNSContext = true;
- try {
- fSchemaDOMParser.startDocument(fSAXLocatorWrapper, null, fNamespaceContext, null);
- }
- catch (XMLParseException e) {
- convertToSAXParseException(e);
- }
- catch (XNIException e) {
- convertToSAXException(e);
- }
- }
-
- /*
- * @see org.xml.sax.ContentHandler#endDocument()
- */
- public void endDocument() throws SAXException {
- fSAXLocatorWrapper.setLocator(null);
- try {
- fSchemaDOMParser.endDocument(null);
- }
- catch (XMLParseException e) {
- convertToSAXParseException(e);
- }
- catch (XNIException e) {
- convertToSAXException(e);
- }
- }
-
- /*
- * @see org.xml.sax.ContentHandler#startPrefixMapping(java.lang.String, java.lang.String)
- */
- public void startPrefixMapping(String prefix, String uri) throws SAXException {
- if (fNeedPushNSContext) {
- fNeedPushNSContext = false;
- fNamespaceContext.pushContext();
- }
- if (!fStringsInternalized) {
- prefix = (prefix != null) ? fSymbolTable.addSymbol(prefix) : XMLSymbols.EMPTY_STRING;
- uri = (uri != null && uri.length() > 0) ? fSymbolTable.addSymbol(uri) : null;
- }
- else {
- if (prefix == null) {
- prefix = XMLSymbols.EMPTY_STRING;
- }
- if (uri != null && uri.length() == 0) {
- uri = null;
- }
- }
- fNamespaceContext.declarePrefix(prefix, uri);
- }
-
- /*
- * @see org.xml.sax.ContentHandler#endPrefixMapping(java.lang.String)
- */
- public void endPrefixMapping(String prefix) throws SAXException {
- // do nothing
- }
-
- /*
- * @see org.xml.sax.ContentHandler#startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
- */
- public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException {
- if (fNeedPushNSContext) {
- fNamespaceContext.pushContext();
- }
- fNeedPushNSContext = true;
-
- // Fill element QName and XMLAttributes
- fillQName(fElementQName, uri, localName, qName);
- fillXMLAttributes(atts);
-
- // Add namespace declarations if necessary
- if (!fNamespacePrefixes) {
- final int prefixCount = fNamespaceContext.getDeclaredPrefixCount();
- if (prefixCount > 0) {
- addNamespaceDeclarations(prefixCount);
- }
- }
-
- try {
- fSchemaDOMParser.startElement(fElementQName, fAttributes, null);
- }
- catch (XMLParseException e) {
- convertToSAXParseException(e);
- }
- catch (XNIException e) {
- convertToSAXException(e);
- }
- }
-
- /*
- * @see org.xml.sax.ContentHandler#endElement(java.lang.String, java.lang.String, java.lang.String)
- */
- public void endElement(String uri, String localName, String qName) throws SAXException {
- fillQName(fElementQName, uri, localName, qName);
- try {
- fSchemaDOMParser.endElement(fElementQName, null);
- }
- catch (XMLParseException e) {
- convertToSAXParseException(e);
- }
- catch (XNIException e) {
- convertToSAXException(e);
- }
- finally {
- fNamespaceContext.popContext();
- }
- }
-
- /*
- * @see org.xml.sax.ContentHandler#characters(char[], int, int)
- */
- public void characters(char[] ch, int start, int length) throws SAXException {
- try {
- fTempString.setValues(ch, start, length);
- fSchemaDOMParser.characters(fTempString, null);
- }
- catch (XMLParseException e) {
- convertToSAXParseException(e);
- }
- catch (XNIException e) {
- convertToSAXException(e);
- }
- }
-
- /*
- * @see org.xml.sax.ContentHandler#ignorableWhitespace(char[], int, int)
- */
- public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException {
- try {
- fTempString.setValues(ch, start, length);
- fSchemaDOMParser.ignorableWhitespace(fTempString, null);
- }
- catch (XMLParseException e) {
- convertToSAXParseException(e);
- }
- catch (XNIException e) {
- convertToSAXException(e);
- }
- }
-
- /*
- * @see org.xml.sax.ContentHandler#processingInstruction(java.lang.String, java.lang.String)
- */
- public void processingInstruction(String target, String data) throws SAXException {
- try {
- fTempString.setValues(data.toCharArray(), 0, data.length());
- fSchemaDOMParser.processingInstruction(target, fTempString, null);
- }
- catch (XMLParseException e) {
- convertToSAXParseException(e);
- }
- catch (XNIException e) {
- convertToSAXException(e);
- }
- }
-
- /*
- * @see org.xml.sax.ContentHandler#skippedEntity(java.lang.String)
- */
- public void skippedEntity(String arg) throws SAXException {
- // do-nothing
- }
-
- /*
- * Other methods
- */
-
- private void fillQName(QName toFill, String uri, String localpart, String rawname) {
- if (!fStringsInternalized) {
- uri = (uri != null && uri.length() > 0) ? fSymbolTable.addSymbol(uri) : null;
- localpart = (localpart != null) ? fSymbolTable.addSymbol(localpart) : XMLSymbols.EMPTY_STRING;
- rawname = (rawname != null) ? fSymbolTable.addSymbol(rawname) : XMLSymbols.EMPTY_STRING;
- }
- else {
- if (uri != null && uri.length() == 0) {
- uri = null;
- }
- if (localpart == null) {
- localpart = XMLSymbols.EMPTY_STRING;
- }
- if (rawname == null) {
- rawname = XMLSymbols.EMPTY_STRING;
- }
- }
- String prefix = XMLSymbols.EMPTY_STRING;
- int prefixIdx = rawname.indexOf(':');
- if (prefixIdx != -1) {
- prefix = fSymbolTable.addSymbol(rawname.substring(0, prefixIdx));
- // local part may be an empty string if this is a namespace declaration
- if (localpart == XMLSymbols.EMPTY_STRING) {
- localpart = fSymbolTable.addSymbol(rawname.substring(prefixIdx + 1));
- }
- }
- // local part may be an empty string if this is a namespace declaration
- else if (localpart == XMLSymbols.EMPTY_STRING) {
- localpart = rawname;
- }
- toFill.setValues(prefix, localpart, rawname, uri);
- }
-
- private void fillXMLAttributes(Attributes atts) {
- fAttributes.removeAllAttributes();
- final int attrCount = atts.getLength();
- for (int i = 0; i < attrCount; ++i) {
- fillQName(fAttributeQName, atts.getURI(i), atts.getLocalName(i), atts.getQName(i));
- String type = atts.getType(i);
- fAttributes.addAttributeNS(fAttributeQName, (type != null) ? type : XMLSymbols.fCDATASymbol, atts.getValue(i));
- fAttributes.setSpecified(i, true);
- }
- }
-
- private void addNamespaceDeclarations(final int prefixCount) {
- String prefix = null;
- String localpart = null;
- String rawname = null;
- String nsPrefix = null;
- String nsURI = null;
- for (int i = 0; i < prefixCount; ++i) {
- nsPrefix = fNamespaceContext.getDeclaredPrefixAt(i);
- nsURI = fNamespaceContext.getURI(nsPrefix);
- if (nsPrefix.length() > 0) {
- prefix = XMLSymbols.PREFIX_XMLNS;
- localpart = nsPrefix;
- rawname = fSymbolTable.addSymbol(prefix + ":" + localpart);
- }
- else {
- prefix = XMLSymbols.EMPTY_STRING;
- localpart = XMLSymbols.PREFIX_XMLNS;
- rawname = XMLSymbols.PREFIX_XMLNS;
- }
- fAttributeQName.setValues(prefix, localpart, rawname, NamespaceContext.XMLNS_URI);
- fAttributes.addAttribute(fAttributeQName, XMLSymbols.fCDATASymbol, nsURI);
- }
- }
-
- public void reset(SchemaDOMParser schemaDOMParser, SymbolTable symbolTable,
- boolean namespacePrefixes, boolean stringsInternalized) {
- fSchemaDOMParser = schemaDOMParser;
- fSymbolTable = symbolTable;
- fNamespacePrefixes = namespacePrefixes;
- fStringsInternalized = stringsInternalized;
- }
-
- /*
- * Static methods
- */
-
- static void convertToSAXParseException(XMLParseException e) throws SAXException {
- Exception ex = e.getException();
- if (ex == null) {
- // must be a parser exception; mine it for locator info and throw
- // a SAXParseException
- LocatorImpl locatorImpl = new LocatorImpl();
- locatorImpl.setPublicId(e.getPublicId());
- locatorImpl.setSystemId(e.getExpandedSystemId());
- locatorImpl.setLineNumber(e.getLineNumber());
- locatorImpl.setColumnNumber(e.getColumnNumber());
- throw new SAXParseException(e.getMessage(), locatorImpl);
- }
- if (ex instanceof SAXException) {
- // why did we create an XMLParseException?
- throw (SAXException) ex;
- }
- throw new SAXException(ex);
- }
-
- static void convertToSAXException(XNIException e) throws SAXException {
- Exception ex = e.getException();
- if (ex == null) {
- throw new SAXException(e.getMessage());
- }
- if (ex instanceof SAXException) {
- throw (SAXException) ex;
- }
- throw new SAXException(ex);
- }
-
-} // SchemaContentHandler
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/StAXSchemaParser.java b/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/StAXSchemaParser.java
deleted file mode 100644
index 3d7e3af..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/StAXSchemaParser.java
+++ /dev/null
@@ -1,425 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.traversers;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import javax.xml.stream.XMLEventReader;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.events.Attribute;
-import javax.xml.stream.events.EndElement;
-import javax.xml.stream.events.Namespace;
-import javax.xml.stream.events.ProcessingInstruction;
-import javax.xml.stream.events.StartElement;
-import javax.xml.stream.events.XMLEvent;
-
-import com.sun.org.apache.xerces.internal.impl.xs.opti.SchemaDOMParser;
-import com.sun.org.apache.xerces.internal.util.JAXPNamespaceContextWrapper;
-import com.sun.org.apache.xerces.internal.util.StAXLocationWrapper;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.util.XMLAttributesImpl;
-import com.sun.org.apache.xerces.internal.util.XMLStringBuffer;
-import com.sun.org.apache.xerces.internal.util.XMLSymbols;
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xni.XMLString;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import org.w3c.dom.Document;
-
-/**
- * <p>StAXSchemaParser reads StAX events, converts them into XNI events
- * and passes them directly to the SchemaDOMParser.</p>
- *
- * @xerces.internal
- *
- * @version $Id: StAXSchemaParser.java,v 1.2 2010-10-26 23:01:12 joehw Exp $
- */
-final class StAXSchemaParser {
-
- /** Chunk size (1024). */
- private static final int CHUNK_SIZE = (1 << 10);
-
- /** Chunk mask (CHUNK_SIZE - 1). */
- private static final int CHUNK_MASK = CHUNK_SIZE - 1;
-
- /** Array for holding character data. **/
- private final char [] fCharBuffer = new char[CHUNK_SIZE];
-
- /** Symbol table **/
- private SymbolTable fSymbolTable;
-
- /** SchemaDOMParser, events will be delegated to SchemaDOMParser to pass */
- private SchemaDOMParser fSchemaDOMParser;
-
- /** XML Locator wrapper for SAX. **/
- private final StAXLocationWrapper fLocationWrapper = new StAXLocationWrapper();
-
- /** The namespace context of this document: stores namespaces in scope */
- private final JAXPNamespaceContextWrapper fNamespaceContext = new JAXPNamespaceContextWrapper(fSymbolTable);
-
- /** Fields for start element, end element and characters. */
- private final QName fElementQName = new QName();
- private final QName fAttributeQName = new QName();
- private final XMLAttributesImpl fAttributes = new XMLAttributesImpl();
- private final XMLString fTempString = new XMLString();
- private final ArrayList fDeclaredPrefixes = new ArrayList();
- private final XMLStringBuffer fStringBuffer = new XMLStringBuffer();
- private int fDepth;
-
- public StAXSchemaParser() {
- fNamespaceContext.setDeclaredPrefixes(fDeclaredPrefixes);
- }
-
- public void reset(SchemaDOMParser schemaDOMParser, SymbolTable symbolTable) {
- fSchemaDOMParser = schemaDOMParser;
- fSymbolTable = symbolTable;
- fNamespaceContext.setSymbolTable(fSymbolTable);
- fNamespaceContext.reset();
- }
-
- public Document getDocument() {
- return fSchemaDOMParser.getDocument();
- }
-
- public void parse(XMLEventReader input) throws XMLStreamException, XNIException {
- XMLEvent currentEvent = input.peek();
- if (currentEvent != null) {
- int eventType = currentEvent.getEventType();
- if (eventType != XMLStreamConstants.START_DOCUMENT &&
- eventType != XMLStreamConstants.START_ELEMENT) {
- throw new XMLStreamException();
- }
- fLocationWrapper.setLocation(currentEvent.getLocation());
- fSchemaDOMParser.startDocument(fLocationWrapper, null, fNamespaceContext, null);
- loop: while (input.hasNext()) {
- currentEvent = input.nextEvent();
- eventType = currentEvent.getEventType();
- switch (eventType) {
- case XMLStreamConstants.START_ELEMENT:
- ++fDepth;
- StartElement start = currentEvent.asStartElement();
- fillQName(fElementQName, start.getName());
- fLocationWrapper.setLocation(start.getLocation());
- fNamespaceContext.setNamespaceContext(start.getNamespaceContext());
- fillXMLAttributes(start);
- fillDeclaredPrefixes(start);
- addNamespaceDeclarations();
- fNamespaceContext.pushContext();
- fSchemaDOMParser.startElement(fElementQName, fAttributes, null);
- break;
- case XMLStreamConstants.END_ELEMENT:
- EndElement end = currentEvent.asEndElement();
- fillQName(fElementQName, end.getName());
- fillDeclaredPrefixes(end);
- fLocationWrapper.setLocation(end.getLocation());
- fSchemaDOMParser.endElement(fElementQName, null);
- fNamespaceContext.popContext();
- --fDepth;
- if (fDepth <= 0) {
- break loop;
- }
- break;
- case XMLStreamConstants.CHARACTERS:
- sendCharactersToSchemaParser(currentEvent.asCharacters().getData(), false);
- break;
- case XMLStreamConstants.SPACE:
- sendCharactersToSchemaParser(currentEvent.asCharacters().getData(), true);
- break;
- case XMLStreamConstants.CDATA:
- fSchemaDOMParser.startCDATA(null);
- sendCharactersToSchemaParser(currentEvent.asCharacters().getData(), false);
- fSchemaDOMParser.endCDATA(null);
- break;
- case XMLStreamConstants.PROCESSING_INSTRUCTION:
- ProcessingInstruction pi = (ProcessingInstruction)currentEvent;
- fillProcessingInstruction(pi.getData());
- fSchemaDOMParser.processingInstruction(pi.getTarget(), fTempString, null);
- break;
- case XMLStreamConstants.DTD:
- /* There shouldn't be a DTD in the schema */
- break;
- case XMLStreamConstants.ENTITY_REFERENCE:
- /* Not needed for schemas */
- break;
- case XMLStreamConstants.COMMENT:
- /* No point in sending comments */
- break;
- case XMLStreamConstants.START_DOCUMENT:
- fDepth++;
- /* We automatically call startDocument before the loop */
- break;
- case XMLStreamConstants.END_DOCUMENT:
- /* We automatically call endDocument after the loop */
- break;
- }
- }
- fLocationWrapper.setLocation(null);
- fNamespaceContext.setNamespaceContext(null);
- fSchemaDOMParser.endDocument(null);
- }
- }
-
- public void parse(XMLStreamReader input) throws XMLStreamException, XNIException {
- if (input.hasNext()) {
- int eventType = input.getEventType();
- if (eventType != XMLStreamConstants.START_DOCUMENT &&
- eventType != XMLStreamConstants.START_ELEMENT) {
- throw new XMLStreamException();
- }
- fLocationWrapper.setLocation(input.getLocation());
- fSchemaDOMParser.startDocument(fLocationWrapper, null, fNamespaceContext, null);
- boolean first = true;
- loop: while (input.hasNext()) {
- if (!first) {
- eventType = input.next();
- }
- else {
- first = false;
- }
- switch (eventType) {
- case XMLStreamConstants.START_ELEMENT:
- ++fDepth;
- fLocationWrapper.setLocation(input.getLocation());
- fNamespaceContext.setNamespaceContext(input.getNamespaceContext());
- fillQName(fElementQName, input.getNamespaceURI(),
- input.getLocalName(), input.getPrefix());
- fillXMLAttributes(input);
- fillDeclaredPrefixes(input);
- addNamespaceDeclarations();
- fNamespaceContext.pushContext();
- fSchemaDOMParser.startElement(fElementQName, fAttributes, null);
- break;
- case XMLStreamConstants.END_ELEMENT:
- fLocationWrapper.setLocation(input.getLocation());
- fNamespaceContext.setNamespaceContext(input.getNamespaceContext());
- fillQName(fElementQName, input.getNamespaceURI(),
- input.getLocalName(), input.getPrefix());
- fillDeclaredPrefixes(input);
- fSchemaDOMParser.endElement(fElementQName, null);
- fNamespaceContext.popContext();
- --fDepth;
- if (fDepth <= 0) {
- break loop;
- }
- break;
- case XMLStreamConstants.CHARACTERS:
- fTempString.setValues(input.getTextCharacters(),
- input.getTextStart(), input.getTextLength());
- fSchemaDOMParser.characters(fTempString, null);
- break;
- case XMLStreamConstants.SPACE:
- fTempString.setValues(input.getTextCharacters(),
- input.getTextStart(), input.getTextLength());
- fSchemaDOMParser.ignorableWhitespace(fTempString, null);
- break;
- case XMLStreamConstants.CDATA:
- fSchemaDOMParser.startCDATA(null);
- fTempString.setValues(input.getTextCharacters(),
- input.getTextStart(), input.getTextLength());
- fSchemaDOMParser.characters(fTempString, null);
- fSchemaDOMParser.endCDATA(null);
- break;
- case XMLStreamConstants.PROCESSING_INSTRUCTION:
- fillProcessingInstruction(input.getPIData());
- fSchemaDOMParser.processingInstruction(input.getPITarget(), fTempString, null);
- break;
- case XMLStreamConstants.DTD:
- /* There shouldn't be a DTD in the schema */
- break;
- case XMLStreamConstants.ENTITY_REFERENCE:
- /* Not needed for schemas */
- break;
- case XMLStreamConstants.COMMENT:
- /* No point in sending comments */
- break;
- case XMLStreamConstants.START_DOCUMENT:
- ++fDepth;
- /* We automatically call startDocument before the loop */
- break;
- case XMLStreamConstants.END_DOCUMENT:
- /* We automatically call endDocument after the loop */
- break;
- }
- }
- fLocationWrapper.setLocation(null);
- fNamespaceContext.setNamespaceContext(null);
- fSchemaDOMParser.endDocument(null);
- }
- }
-
- /** Send characters to the validator in CHUNK_SIZE character chunks. */
- private void sendCharactersToSchemaParser(String str, boolean whitespace) {
- if (str != null) {
- final int length = str.length();
- final int remainder = length & CHUNK_MASK;
- if (remainder > 0) {
- str.getChars(0, remainder, fCharBuffer, 0);
- fTempString.setValues(fCharBuffer, 0, remainder);
- if (whitespace) {
- fSchemaDOMParser.ignorableWhitespace(fTempString, null);
- }
- else {
- fSchemaDOMParser.characters(fTempString, null);
- }
- }
- int i = remainder;
- while (i < length) {
- str.getChars(i, i += CHUNK_SIZE, fCharBuffer, 0);
- fTempString.setValues(fCharBuffer, 0, CHUNK_SIZE);
- if (whitespace) {
- fSchemaDOMParser.ignorableWhitespace(fTempString, null);
- }
- else {
- fSchemaDOMParser.characters(fTempString, null);
- }
- }
- }
- }
-
- // processing instructions must be sent all in one chunk
- private void fillProcessingInstruction(String data) {
- final int dataLength = data.length();
- char [] charBuffer = fCharBuffer;
- if (charBuffer.length < dataLength) {
- // toCharArray() creates a newly allocated array, so it's okay
- // to keep a reference to it.
- charBuffer = data.toCharArray();
- }
- else {
- data.getChars(0, dataLength, charBuffer, 0);
- }
- fTempString.setValues(charBuffer, 0, dataLength);
- }
-
- private void fillXMLAttributes(StartElement event) {
- fAttributes.removeAllAttributes();
- final Iterator attrs = event.getAttributes();
- while (attrs.hasNext()) {
- Attribute attr = (Attribute) attrs.next();
- fillQName(fAttributeQName, attr.getName());
- String type = attr.getDTDType();
- int idx = fAttributes.getLength();
- fAttributes.addAttributeNS(fAttributeQName,
- (type != null) ? type : XMLSymbols.fCDATASymbol, attr.getValue());
- fAttributes.setSpecified(idx, attr.isSpecified());
- }
- }
-
- private void fillXMLAttributes(XMLStreamReader input) {
- fAttributes.removeAllAttributes();
- final int len = input.getAttributeCount();
- for (int i = 0; i < len; ++i) {
- fillQName(fAttributeQName, input.getAttributeNamespace(i),
- input.getAttributeLocalName(i), input.getAttributePrefix(i));
- String type = input.getAttributeType(i);
- fAttributes.addAttributeNS(fAttributeQName,
- (type != null) ? type : XMLSymbols.fCDATASymbol, input.getAttributeValue(i));
- fAttributes.setSpecified(i, input.isAttributeSpecified(i));
- }
- }
-
- private void addNamespaceDeclarations() {
- String prefix = null;
- String localpart = null;
- String rawname = null;
- String nsPrefix = null;
- String nsURI = null;
-
- final Iterator iter = fDeclaredPrefixes.iterator();
- while (iter.hasNext()) {
- nsPrefix = (String) iter.next();
- nsURI = fNamespaceContext.getURI(nsPrefix);
- if (nsPrefix.length() > 0) {
- prefix = XMLSymbols.PREFIX_XMLNS;
- localpart = nsPrefix;
- fStringBuffer.clear();
- fStringBuffer.append(prefix);
- fStringBuffer.append(':');
- fStringBuffer.append(localpart);
- rawname = fSymbolTable.addSymbol(fStringBuffer.ch, fStringBuffer.offset, fStringBuffer.length);
- }
- else {
- prefix = XMLSymbols.EMPTY_STRING;
- localpart = XMLSymbols.PREFIX_XMLNS;
- rawname = XMLSymbols.PREFIX_XMLNS;
- }
- fAttributeQName.setValues(prefix, localpart, rawname, NamespaceContext.XMLNS_URI);
- fAttributes.addAttribute(fAttributeQName, XMLSymbols.fCDATASymbol,
- (nsURI != null) ? nsURI : XMLSymbols.EMPTY_STRING);
- }
- }
-
- /** Fills in the list of declared prefixes. */
- private void fillDeclaredPrefixes(StartElement event) {
- fillDeclaredPrefixes(event.getNamespaces());
- }
-
- /** Fills in the list of declared prefixes. */
- private void fillDeclaredPrefixes(EndElement event) {
- fillDeclaredPrefixes(event.getNamespaces());
- }
-
- /** Fills in the list of declared prefixes. */
- private void fillDeclaredPrefixes(Iterator namespaces) {
- fDeclaredPrefixes.clear();
- while (namespaces.hasNext()) {
- Namespace ns = (Namespace) namespaces.next();
- String prefix = ns.getPrefix();
- fDeclaredPrefixes.add(prefix != null ? prefix : "");
- }
- }
-
- /** Fills in the list of declared prefixes. */
- private void fillDeclaredPrefixes(XMLStreamReader reader) {
- fDeclaredPrefixes.clear();
- final int len = reader.getNamespaceCount();
- for (int i = 0; i < len; ++i) {
- String prefix = reader.getNamespacePrefix(i);
- fDeclaredPrefixes.add(prefix != null ? prefix : "");
- }
- }
-
- /** Fills in a QName object. */
- private void fillQName(QName toFill, javax.xml.namespace.QName toCopy) {
- fillQName(toFill, toCopy.getNamespaceURI(), toCopy.getLocalPart(), toCopy.getPrefix());
- }
-
- /** Fills in a QName object. */
- final void fillQName(QName toFill, String uri, String localpart, String prefix) {
- uri = (uri != null && uri.length() > 0) ? fSymbolTable.addSymbol(uri) : null;
- localpart = (localpart != null) ? fSymbolTable.addSymbol(localpart) : XMLSymbols.EMPTY_STRING;
- prefix = (prefix != null && prefix.length() > 0) ? fSymbolTable.addSymbol(prefix) : XMLSymbols.EMPTY_STRING;
- String raw = localpart;
- if (prefix != XMLSymbols.EMPTY_STRING) {
- fStringBuffer.clear();
- fStringBuffer.append(prefix);
- fStringBuffer.append(':');
- fStringBuffer.append(localpart);
- raw = fSymbolTable.addSymbol(fStringBuffer.ch, fStringBuffer.offset, fStringBuffer.length);
- }
- toFill.setValues(prefix, localpart, raw, uri);
- }
-
-} // StAXSchemaParser
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAnnotationInfo.java b/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAnnotationInfo.java
deleted file mode 100644
index 1ec7741..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAnnotationInfo.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xerces.internal.impl.xs.traversers;
-
-import org.w3c.dom.Element;
-import com.sun.org.apache.xerces.internal.impl.xs.opti.ElementImpl;
-
-/**
- * Objects of this class contain the textual representation of
- * an XML schema annotation as well as information on the location
- * of the annotation in the document it originated from.
- *
- * @xerces.internal
- *
- * @author Michael Glavassevich, IBM
- */
-final class XSAnnotationInfo {
-
- /** Textual representation of annotation. **/
- String fAnnotation;
-
- /** Line number of &lt;annotation&gt; element. **/
- int fLine;
-
- /** Column number of &lt;annotation&gt; element. **/
- int fColumn;
-
- /** Character offset of &lt;annotation&gt; element. **/
- int fCharOffset;
-
- /** Next annotation. **/
- XSAnnotationInfo next;
-
- XSAnnotationInfo(String annotation, int line, int column, int charOffset) {
- fAnnotation = annotation;
- fLine = line;
- fColumn = column;
- fCharOffset = charOffset;
- }
-
- XSAnnotationInfo(String annotation, Element annotationDecl) {
- fAnnotation = annotation;
- if (annotationDecl instanceof ElementImpl) {
- final ElementImpl annotationDeclImpl = (ElementImpl) annotationDecl;
- fLine = annotationDeclImpl.getLineNumber();
- fColumn = annotationDeclImpl.getColumnNumber();
- fCharOffset = annotationDeclImpl.getCharacterOffset();
- }
- else {
- fLine = -1;
- fColumn = -1;
- fCharOffset = -1;
- }
- }
-} // XSAnnotationInfo
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAttributeChecker.java b/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAttributeChecker.java
deleted file mode 100644
index 5677971..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAttributeChecker.java
+++ /dev/null
@@ -1,1822 +0,0 @@
-/*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.traversers;
-
-import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException;
-import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType;
-import com.sun.org.apache.xerces.internal.impl.xs.SchemaGrammar;
-import com.sun.org.apache.xerces.internal.impl.xs.SchemaNamespaceSupport;
-import com.sun.org.apache.xerces.internal.impl.xs.SchemaSymbols;
-import com.sun.org.apache.xerces.internal.impl.xs.XSAttributeDecl;
-import com.sun.org.apache.xerces.internal.impl.xs.XSGrammarBucket;
-import com.sun.org.apache.xerces.internal.impl.xs.XSWildcardDecl;
-import com.sun.org.apache.xerces.internal.impl.xs.util.XInt;
-import com.sun.org.apache.xerces.internal.impl.xs.util.XIntPool;
-import com.sun.org.apache.xerces.internal.util.DOMUtil;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.util.XMLChar;
-import com.sun.org.apache.xerces.internal.util.XMLSymbols;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xs.XSConstants;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.StringTokenizer;
-import java.util.Vector;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-
-/**
- * Class <code>XSAttributeCheck</code> is used to check the validity of attributes
- * appearing in the schema document. It
- * - reports an error for invalid element (invalid namespace, invalid name)
- * - reports an error for invalid attribute (invalid namespace, invalid name)
- * - reports an error for invalid attribute value
- * - return compiled values for attriute values
- * - provide default value for missing optional attributes
- * - provide default value for incorrect attribute values
- *
- * But it's the caller's responsibility to check whether a required attribute
- * is present.
- *
- * Things need revisiting:
- * - Whether to return non-schema attributes/values
- * - Do we need to update NamespaceScope and ErrorReporter when reset()?
- * - Should have the datatype validators return compiled value
- * - use symbol table instead of many maps
- *
- * @xerces.internal
- *
- * @author Sandy Gao, IBM
- * @version $Id: XSAttributeChecker.java,v 1.12 2010-11-01 04:40:02 joehw Exp $
- */
-
-public class XSAttributeChecker {
-
- // REVISIT: only local element and attribute are different from others.
- // it's possible to have either name or ref. all the others
- // are only allowed to have one of name or ref, or neither of them.
- // we'd better move such checking to the traverser.
- private static final String ELEMENT_N = "element_n";
- private static final String ELEMENT_R = "element_r";
- private static final String ATTRIBUTE_N = "attribute_n";
- private static final String ATTRIBUTE_R = "attribute_r";
-
- private static int ATTIDX_COUNT = 0;
- public static final int ATTIDX_ABSTRACT = ATTIDX_COUNT++;
- public static final int ATTIDX_AFORMDEFAULT = ATTIDX_COUNT++;
- public static final int ATTIDX_BASE = ATTIDX_COUNT++;
- public static final int ATTIDX_BLOCK = ATTIDX_COUNT++;
- public static final int ATTIDX_BLOCKDEFAULT = ATTIDX_COUNT++;
- public static final int ATTIDX_DEFAULT = ATTIDX_COUNT++;
- public static final int ATTIDX_EFORMDEFAULT = ATTIDX_COUNT++;
- public static final int ATTIDX_FINAL = ATTIDX_COUNT++;
- public static final int ATTIDX_FINALDEFAULT = ATTIDX_COUNT++;
- public static final int ATTIDX_FIXED = ATTIDX_COUNT++;
- public static final int ATTIDX_FORM = ATTIDX_COUNT++;
- public static final int ATTIDX_ID = ATTIDX_COUNT++;
- public static final int ATTIDX_ITEMTYPE = ATTIDX_COUNT++;
- public static final int ATTIDX_MAXOCCURS = ATTIDX_COUNT++;
- public static final int ATTIDX_MEMBERTYPES = ATTIDX_COUNT++;
- public static final int ATTIDX_MINOCCURS = ATTIDX_COUNT++;
- public static final int ATTIDX_MIXED = ATTIDX_COUNT++;
- public static final int ATTIDX_NAME = ATTIDX_COUNT++;
- public static final int ATTIDX_NAMESPACE = ATTIDX_COUNT++;
- public static final int ATTIDX_NAMESPACE_LIST = ATTIDX_COUNT++;
- public static final int ATTIDX_NILLABLE = ATTIDX_COUNT++;
- public static final int ATTIDX_NONSCHEMA = ATTIDX_COUNT++;
- public static final int ATTIDX_PROCESSCONTENTS = ATTIDX_COUNT++;
- public static final int ATTIDX_PUBLIC = ATTIDX_COUNT++;
- public static final int ATTIDX_REF = ATTIDX_COUNT++;
- public static final int ATTIDX_REFER = ATTIDX_COUNT++;
- public static final int ATTIDX_SCHEMALOCATION = ATTIDX_COUNT++;
- public static final int ATTIDX_SOURCE = ATTIDX_COUNT++;
- public static final int ATTIDX_SUBSGROUP = ATTIDX_COUNT++;
- public static final int ATTIDX_SYSTEM = ATTIDX_COUNT++;
- public static final int ATTIDX_TARGETNAMESPACE = ATTIDX_COUNT++;
- public static final int ATTIDX_TYPE = ATTIDX_COUNT++;
- public static final int ATTIDX_USE = ATTIDX_COUNT++;
- public static final int ATTIDX_VALUE = ATTIDX_COUNT++;
- public static final int ATTIDX_ENUMNSDECLS = ATTIDX_COUNT++;
- public static final int ATTIDX_VERSION = ATTIDX_COUNT++;
- public static final int ATTIDX_XML_LANG = ATTIDX_COUNT++;
- public static final int ATTIDX_XPATH = ATTIDX_COUNT++;
- public static final int ATTIDX_FROMDEFAULT = ATTIDX_COUNT++;
- //public static final int ATTIDX_OTHERVALUES = ATTIDX_COUNT++;
- public static final int ATTIDX_ISRETURNED = ATTIDX_COUNT++;
-
- private static final XIntPool fXIntPool = new XIntPool();
- // constants to return
- private static final XInt INT_QUALIFIED = fXIntPool.getXInt(SchemaSymbols.FORM_QUALIFIED);
- private static final XInt INT_UNQUALIFIED = fXIntPool.getXInt(SchemaSymbols.FORM_UNQUALIFIED);
- private static final XInt INT_EMPTY_SET = fXIntPool.getXInt(XSConstants.DERIVATION_NONE);
- private static final XInt INT_ANY_STRICT = fXIntPool.getXInt(XSWildcardDecl.PC_STRICT);
- private static final XInt INT_ANY_LAX = fXIntPool.getXInt(XSWildcardDecl.PC_LAX);
- private static final XInt INT_ANY_SKIP = fXIntPool.getXInt(XSWildcardDecl.PC_SKIP);
- private static final XInt INT_ANY_ANY = fXIntPool.getXInt(XSWildcardDecl.NSCONSTRAINT_ANY);
- private static final XInt INT_ANY_LIST = fXIntPool.getXInt(XSWildcardDecl.NSCONSTRAINT_LIST);
- private static final XInt INT_ANY_NOT = fXIntPool.getXInt(XSWildcardDecl.NSCONSTRAINT_NOT);
- private static final XInt INT_USE_OPTIONAL = fXIntPool.getXInt(SchemaSymbols.USE_OPTIONAL);
- private static final XInt INT_USE_REQUIRED = fXIntPool.getXInt(SchemaSymbols.USE_REQUIRED);
- private static final XInt INT_USE_PROHIBITED = fXIntPool.getXInt(SchemaSymbols.USE_PROHIBITED);
- private static final XInt INT_WS_PRESERVE = fXIntPool.getXInt(XSSimpleType.WS_PRESERVE);
- private static final XInt INT_WS_REPLACE = fXIntPool.getXInt(XSSimpleType.WS_REPLACE);
- private static final XInt INT_WS_COLLAPSE = fXIntPool.getXInt(XSSimpleType.WS_COLLAPSE);
- private static final XInt INT_UNBOUNDED = fXIntPool.getXInt(SchemaSymbols.OCCURRENCE_UNBOUNDED);
-
- // used to store the map from element name to attribute list
- // for 14 global elements
- private static final Map fEleAttrsMapG = new HashMap(29);
- // for 39 local elememnts
- private static final Map fEleAttrsMapL = new HashMap(79);
-
- // used to initialize fEleAttrsMap
- // step 1: all possible data types
- // DT_??? >= 0 : validate using a validator, which is initialized staticly
- // DT_??? < 0 : validate directly, which is done in "validate()"
-
- protected static final int DT_ANYURI = 0;
- protected static final int DT_ID = 1;
- protected static final int DT_QNAME = 2;
- protected static final int DT_STRING = 3;
- protected static final int DT_TOKEN = 4;
- protected static final int DT_NCNAME = 5;
- protected static final int DT_XPATH = 6;
- protected static final int DT_XPATH1 = 7;
- protected static final int DT_LANGUAGE = 8;
-
- // used to store extra datatype validators
- protected static final int DT_COUNT = DT_LANGUAGE + 1;
- private static final XSSimpleType[] fExtraDVs = new XSSimpleType[DT_COUNT];
- static {
- // step 5: register all datatype validators for new types
- SchemaGrammar grammar = SchemaGrammar.SG_SchemaNS;
- // anyURI
- fExtraDVs[DT_ANYURI] = (XSSimpleType)grammar.getGlobalTypeDecl(SchemaSymbols.ATTVAL_ANYURI);
- // ID
- fExtraDVs[DT_ID] = (XSSimpleType)grammar.getGlobalTypeDecl(SchemaSymbols.ATTVAL_ID);
- // QName
- fExtraDVs[DT_QNAME] = (XSSimpleType)grammar.getGlobalTypeDecl(SchemaSymbols.ATTVAL_QNAME);
- // string
- fExtraDVs[DT_STRING] = (XSSimpleType)grammar.getGlobalTypeDecl(SchemaSymbols.ATTVAL_STRING);
- // token
- fExtraDVs[DT_TOKEN] = (XSSimpleType)grammar.getGlobalTypeDecl(SchemaSymbols.ATTVAL_TOKEN);
- // NCName
- fExtraDVs[DT_NCNAME] = (XSSimpleType)grammar.getGlobalTypeDecl(SchemaSymbols.ATTVAL_NCNAME);
- // xpath = a subset of XPath expression
- fExtraDVs[DT_XPATH] = fExtraDVs[DT_STRING];
- // xpath = a subset of XPath expression
- fExtraDVs[DT_XPATH] = fExtraDVs[DT_STRING];
- // language
- fExtraDVs[DT_LANGUAGE] = (XSSimpleType)grammar.getGlobalTypeDecl(SchemaSymbols.ATTVAL_LANGUAGE);
- }
-
- protected static final int DT_BLOCK = -1;
- protected static final int DT_BLOCK1 = -2;
- protected static final int DT_FINAL = -3;
- protected static final int DT_FINAL1 = -4;
- protected static final int DT_FINAL2 = -5;
- protected static final int DT_FORM = -6;
- protected static final int DT_MAXOCCURS = -7;
- protected static final int DT_MAXOCCURS1 = -8;
- protected static final int DT_MEMBERTYPES = -9;
- protected static final int DT_MINOCCURS1 = -10;
- protected static final int DT_NAMESPACE = -11;
- protected static final int DT_PROCESSCONTENTS = -12;
- protected static final int DT_USE = -13;
- protected static final int DT_WHITESPACE = -14;
- protected static final int DT_BOOLEAN = -15;
- protected static final int DT_NONNEGINT = -16;
- protected static final int DT_POSINT = -17;
-
- static {
- // step 2: all possible attributes for all elements
- int attCount = 0;
- int ATT_ABSTRACT_D = attCount++;
- int ATT_ATTRIBUTE_FD_D = attCount++;
- int ATT_BASE_R = attCount++;
- int ATT_BASE_N = attCount++;
- int ATT_BLOCK_N = attCount++;
- int ATT_BLOCK1_N = attCount++;
- int ATT_BLOCK_D_D = attCount++;
- int ATT_DEFAULT_N = attCount++;
- int ATT_ELEMENT_FD_D = attCount++;
- int ATT_FINAL_N = attCount++;
- int ATT_FINAL1_N = attCount++;
- int ATT_FINAL_D_D = attCount++;
- int ATT_FIXED_N = attCount++;
- int ATT_FIXED_D = attCount++;
- int ATT_FORM_N = attCount++;
- int ATT_ID_N = attCount++;
- int ATT_ITEMTYPE_N = attCount++;
- int ATT_MAXOCCURS_D = attCount++;
- int ATT_MAXOCCURS1_D = attCount++;
- int ATT_MEMBER_T_N = attCount++;
- int ATT_MINOCCURS_D = attCount++;
- int ATT_MINOCCURS1_D = attCount++;
- int ATT_MIXED_D = attCount++;
- int ATT_MIXED_N = attCount++;
- int ATT_NAME_R = attCount++;
- int ATT_NAMESPACE_D = attCount++;
- int ATT_NAMESPACE_N = attCount++;
- int ATT_NILLABLE_D = attCount++;
- int ATT_PROCESS_C_D = attCount++;
- int ATT_PUBLIC_R = attCount++;
- int ATT_REF_R = attCount++;
- int ATT_REFER_R = attCount++;
- int ATT_SCHEMA_L_R = attCount++;
- int ATT_SCHEMA_L_N = attCount++;
- int ATT_SOURCE_N = attCount++;
- int ATT_SUBSTITUTION_G_N = attCount++;
- int ATT_SYSTEM_N = attCount++;
- int ATT_TARGET_N_N = attCount++;
- int ATT_TYPE_N = attCount++;
- int ATT_USE_D = attCount++;
- int ATT_VALUE_NNI_N = attCount++;
- int ATT_VALUE_PI_N = attCount++;
- int ATT_VALUE_STR_N = attCount++;
- int ATT_VALUE_WS_N = attCount++;
- int ATT_VERSION_N = attCount++;
- int ATT_XML_LANG = attCount++;
- int ATT_XPATH_R = attCount++;
- int ATT_XPATH1_R = attCount++;
-
- // step 3: store all these attributes in an array
- OneAttr[] allAttrs = new OneAttr[attCount];
- allAttrs[ATT_ABSTRACT_D] = new OneAttr(SchemaSymbols.ATT_ABSTRACT,
- DT_BOOLEAN,
- ATTIDX_ABSTRACT,
- Boolean.FALSE);
- allAttrs[ATT_ATTRIBUTE_FD_D] = new OneAttr(SchemaSymbols.ATT_ATTRIBUTEFORMDEFAULT,
- DT_FORM,
- ATTIDX_AFORMDEFAULT,
- INT_UNQUALIFIED);
- allAttrs[ATT_BASE_R] = new OneAttr(SchemaSymbols.ATT_BASE,
- DT_QNAME,
- ATTIDX_BASE,
- null);
- allAttrs[ATT_BASE_N] = new OneAttr(SchemaSymbols.ATT_BASE,
- DT_QNAME,
- ATTIDX_BASE,
- null);
- allAttrs[ATT_BLOCK_N] = new OneAttr(SchemaSymbols.ATT_BLOCK,
- DT_BLOCK,
- ATTIDX_BLOCK,
- null);
- allAttrs[ATT_BLOCK1_N] = new OneAttr(SchemaSymbols.ATT_BLOCK,
- DT_BLOCK1,
- ATTIDX_BLOCK,
- null);
- allAttrs[ATT_BLOCK_D_D] = new OneAttr(SchemaSymbols.ATT_BLOCKDEFAULT,
- DT_BLOCK,
- ATTIDX_BLOCKDEFAULT,
- INT_EMPTY_SET);
- allAttrs[ATT_DEFAULT_N] = new OneAttr(SchemaSymbols.ATT_DEFAULT,
- DT_STRING,
- ATTIDX_DEFAULT,
- null);
- allAttrs[ATT_ELEMENT_FD_D] = new OneAttr(SchemaSymbols.ATT_ELEMENTFORMDEFAULT,
- DT_FORM,
- ATTIDX_EFORMDEFAULT,
- INT_UNQUALIFIED);
- allAttrs[ATT_FINAL_N] = new OneAttr(SchemaSymbols.ATT_FINAL,
- DT_FINAL,
- ATTIDX_FINAL,
- null);
- allAttrs[ATT_FINAL1_N] = new OneAttr(SchemaSymbols.ATT_FINAL,
- DT_FINAL1,
- ATTIDX_FINAL,
- null);
- allAttrs[ATT_FINAL_D_D] = new OneAttr(SchemaSymbols.ATT_FINALDEFAULT,
- DT_FINAL2,
- ATTIDX_FINALDEFAULT,
- INT_EMPTY_SET);
- allAttrs[ATT_FIXED_N] = new OneAttr(SchemaSymbols.ATT_FIXED,
- DT_STRING,
- ATTIDX_FIXED,
- null);
- allAttrs[ATT_FIXED_D] = new OneAttr(SchemaSymbols.ATT_FIXED,
- DT_BOOLEAN,
- ATTIDX_FIXED,
- Boolean.FALSE);
- allAttrs[ATT_FORM_N] = new OneAttr(SchemaSymbols.ATT_FORM,
- DT_FORM,
- ATTIDX_FORM,
- null);
- allAttrs[ATT_ID_N] = new OneAttr(SchemaSymbols.ATT_ID,
- DT_ID,
- ATTIDX_ID,
- null);
- allAttrs[ATT_ITEMTYPE_N] = new OneAttr(SchemaSymbols.ATT_ITEMTYPE,
- DT_QNAME,
- ATTIDX_ITEMTYPE,
- null);
- allAttrs[ATT_MAXOCCURS_D] = new OneAttr(SchemaSymbols.ATT_MAXOCCURS,
- DT_MAXOCCURS,
- ATTIDX_MAXOCCURS,
- fXIntPool.getXInt(1));
- allAttrs[ATT_MAXOCCURS1_D] = new OneAttr(SchemaSymbols.ATT_MAXOCCURS,
- DT_MAXOCCURS1,
- ATTIDX_MAXOCCURS,
- fXIntPool.getXInt(1));
- allAttrs[ATT_MEMBER_T_N] = new OneAttr(SchemaSymbols.ATT_MEMBERTYPES,
- DT_MEMBERTYPES,
- ATTIDX_MEMBERTYPES,
- null);
- allAttrs[ATT_MINOCCURS_D] = new OneAttr(SchemaSymbols.ATT_MINOCCURS,
- DT_NONNEGINT,
- ATTIDX_MINOCCURS,
- fXIntPool.getXInt(1));
- allAttrs[ATT_MINOCCURS1_D] = new OneAttr(SchemaSymbols.ATT_MINOCCURS,
- DT_MINOCCURS1,
- ATTIDX_MINOCCURS,
- fXIntPool.getXInt(1));
- allAttrs[ATT_MIXED_D] = new OneAttr(SchemaSymbols.ATT_MIXED,
- DT_BOOLEAN,
- ATTIDX_MIXED,
- Boolean.FALSE);
- allAttrs[ATT_MIXED_N] = new OneAttr(SchemaSymbols.ATT_MIXED,
- DT_BOOLEAN,
- ATTIDX_MIXED,
- null);
- allAttrs[ATT_NAME_R] = new OneAttr(SchemaSymbols.ATT_NAME,
- DT_NCNAME,
- ATTIDX_NAME,
- null);
- allAttrs[ATT_NAMESPACE_D] = new OneAttr(SchemaSymbols.ATT_NAMESPACE,
- DT_NAMESPACE,
- ATTIDX_NAMESPACE,
- INT_ANY_ANY);
- allAttrs[ATT_NAMESPACE_N] = new OneAttr(SchemaSymbols.ATT_NAMESPACE,
- DT_ANYURI,
- ATTIDX_NAMESPACE,
- null);
- allAttrs[ATT_NILLABLE_D] = new OneAttr(SchemaSymbols.ATT_NILLABLE,
- DT_BOOLEAN,
- ATTIDX_NILLABLE,
- Boolean.FALSE);
- allAttrs[ATT_PROCESS_C_D] = new OneAttr(SchemaSymbols.ATT_PROCESSCONTENTS,
- DT_PROCESSCONTENTS,
- ATTIDX_PROCESSCONTENTS,
- INT_ANY_STRICT);
- allAttrs[ATT_PUBLIC_R] = new OneAttr(SchemaSymbols.ATT_PUBLIC,
- DT_TOKEN,
- ATTIDX_PUBLIC,
- null);
- allAttrs[ATT_REF_R] = new OneAttr(SchemaSymbols.ATT_REF,
- DT_QNAME,
- ATTIDX_REF,
- null);
- allAttrs[ATT_REFER_R] = new OneAttr(SchemaSymbols.ATT_REFER,
- DT_QNAME,
- ATTIDX_REFER,
- null);
- allAttrs[ATT_SCHEMA_L_R] = new OneAttr(SchemaSymbols.ATT_SCHEMALOCATION,
- DT_ANYURI,
- ATTIDX_SCHEMALOCATION,
- null);
- allAttrs[ATT_SCHEMA_L_N] = new OneAttr(SchemaSymbols.ATT_SCHEMALOCATION,
- DT_ANYURI,
- ATTIDX_SCHEMALOCATION,
- null);
- allAttrs[ATT_SOURCE_N] = new OneAttr(SchemaSymbols.ATT_SOURCE,
- DT_ANYURI,
- ATTIDX_SOURCE,
- null);
- allAttrs[ATT_SUBSTITUTION_G_N] = new OneAttr(SchemaSymbols.ATT_SUBSTITUTIONGROUP,
- DT_QNAME,
- ATTIDX_SUBSGROUP,
- null);
- allAttrs[ATT_SYSTEM_N] = new OneAttr(SchemaSymbols.ATT_SYSTEM,
- DT_ANYURI,
- ATTIDX_SYSTEM,
- null);
- allAttrs[ATT_TARGET_N_N] = new OneAttr(SchemaSymbols.ATT_TARGETNAMESPACE,
- DT_ANYURI,
- ATTIDX_TARGETNAMESPACE,
- null);
- allAttrs[ATT_TYPE_N] = new OneAttr(SchemaSymbols.ATT_TYPE,
- DT_QNAME,
- ATTIDX_TYPE,
- null);
- allAttrs[ATT_USE_D] = new OneAttr(SchemaSymbols.ATT_USE,
- DT_USE,
- ATTIDX_USE,
- INT_USE_OPTIONAL);
- allAttrs[ATT_VALUE_NNI_N] = new OneAttr(SchemaSymbols.ATT_VALUE,
- DT_NONNEGINT,
- ATTIDX_VALUE,
- null);
- allAttrs[ATT_VALUE_PI_N] = new OneAttr(SchemaSymbols.ATT_VALUE,
- DT_POSINT,
- ATTIDX_VALUE,
- null);
- allAttrs[ATT_VALUE_STR_N] = new OneAttr(SchemaSymbols.ATT_VALUE,
- DT_STRING,
- ATTIDX_VALUE,
- null);
- allAttrs[ATT_VALUE_WS_N] = new OneAttr(SchemaSymbols.ATT_VALUE,
- DT_WHITESPACE,
- ATTIDX_VALUE,
- null);
- allAttrs[ATT_VERSION_N] = new OneAttr(SchemaSymbols.ATT_VERSION,
- DT_TOKEN,
- ATTIDX_VERSION,
- null);
- allAttrs[ATT_XML_LANG] = new OneAttr(SchemaSymbols.ATT_XML_LANG,
- DT_LANGUAGE,
- ATTIDX_XML_LANG,
- null);
- allAttrs[ATT_XPATH_R] = new OneAttr(SchemaSymbols.ATT_XPATH,
- DT_XPATH,
- ATTIDX_XPATH,
- null);
- allAttrs[ATT_XPATH1_R] = new OneAttr(SchemaSymbols.ATT_XPATH,
- DT_XPATH1,
- ATTIDX_XPATH,
- null);
-
- // step 4: for each element, make a list of possible attributes
- Container attrList;
-
- // for element "attribute" - global
- attrList = Container.getContainer(5);
- // default = string
- attrList.put(SchemaSymbols.ATT_DEFAULT, allAttrs[ATT_DEFAULT_N]);
- // fixed = string
- attrList.put(SchemaSymbols.ATT_FIXED, allAttrs[ATT_FIXED_N]);
- // id = ID
- attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
- // name = NCName
- attrList.put(SchemaSymbols.ATT_NAME, allAttrs[ATT_NAME_R]);
- // type = QName
- attrList.put(SchemaSymbols.ATT_TYPE, allAttrs[ATT_TYPE_N]);
- fEleAttrsMapG.put(SchemaSymbols.ELT_ATTRIBUTE, attrList);
-
- // for element "attribute" - local name
- attrList = Container.getContainer(7);
- // default = string
- attrList.put(SchemaSymbols.ATT_DEFAULT, allAttrs[ATT_DEFAULT_N]);
- // fixed = string
- attrList.put(SchemaSymbols.ATT_FIXED, allAttrs[ATT_FIXED_N]);
- // form = (qualified | unqualified)
- attrList.put(SchemaSymbols.ATT_FORM, allAttrs[ATT_FORM_N]);
- // id = ID
- attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
- // name = NCName
- attrList.put(SchemaSymbols.ATT_NAME, allAttrs[ATT_NAME_R]);
- // type = QName
- attrList.put(SchemaSymbols.ATT_TYPE, allAttrs[ATT_TYPE_N]);
- // use = (optional | prohibited | required) : optional
- attrList.put(SchemaSymbols.ATT_USE, allAttrs[ATT_USE_D]);
- fEleAttrsMapL.put(ATTRIBUTE_N, attrList);
-
- // for element "attribute" - local ref
- attrList = Container.getContainer(5);
- // default = string
- attrList.put(SchemaSymbols.ATT_DEFAULT, allAttrs[ATT_DEFAULT_N]);
- // fixed = string
- attrList.put(SchemaSymbols.ATT_FIXED, allAttrs[ATT_FIXED_N]);
- // id = ID
- attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
- // ref = QName
- attrList.put(SchemaSymbols.ATT_REF, allAttrs[ATT_REF_R]);
- // use = (optional | prohibited | required) : optional
- attrList.put(SchemaSymbols.ATT_USE, allAttrs[ATT_USE_D]);
- fEleAttrsMapL.put(ATTRIBUTE_R, attrList);
-
- // for element "element" - global
- attrList = Container.getContainer(10);
- // abstract = boolean : false
- attrList.put(SchemaSymbols.ATT_ABSTRACT, allAttrs[ATT_ABSTRACT_D]);
- // block = (#all | List of (extension | restriction | substitution))
- attrList.put(SchemaSymbols.ATT_BLOCK, allAttrs[ATT_BLOCK_N]);
- // default = string
- attrList.put(SchemaSymbols.ATT_DEFAULT, allAttrs[ATT_DEFAULT_N]);
- // final = (#all | List of (extension | restriction))
- attrList.put(SchemaSymbols.ATT_FINAL, allAttrs[ATT_FINAL_N]);
- // fixed = string
- attrList.put(SchemaSymbols.ATT_FIXED, allAttrs[ATT_FIXED_N]);
- // id = ID
- attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
- // name = NCName
- attrList.put(SchemaSymbols.ATT_NAME, allAttrs[ATT_NAME_R]);
- // nillable = boolean : false
- attrList.put(SchemaSymbols.ATT_NILLABLE, allAttrs[ATT_NILLABLE_D]);
- // substitutionGroup = QName
- attrList.put(SchemaSymbols.ATT_SUBSTITUTIONGROUP, allAttrs[ATT_SUBSTITUTION_G_N]);
- // type = QName
- attrList.put(SchemaSymbols.ATT_TYPE, allAttrs[ATT_TYPE_N]);
- fEleAttrsMapG.put(SchemaSymbols.ELT_ELEMENT, attrList);
-
- // for element "element" - local name
- attrList = Container.getContainer(10);
- // block = (#all | List of (extension | restriction | substitution))
- attrList.put(SchemaSymbols.ATT_BLOCK, allAttrs[ATT_BLOCK_N]);
- // default = string
- attrList.put(SchemaSymbols.ATT_DEFAULT, allAttrs[ATT_DEFAULT_N]);
- // fixed = string
- attrList.put(SchemaSymbols.ATT_FIXED, allAttrs[ATT_FIXED_N]);
- // form = (qualified | unqualified)
- attrList.put(SchemaSymbols.ATT_FORM, allAttrs[ATT_FORM_N]);
- // id = ID
- attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
- // maxOccurs = (nonNegativeInteger | unbounded) : 1
- attrList.put(SchemaSymbols.ATT_MAXOCCURS, allAttrs[ATT_MAXOCCURS_D]);
- // minOccurs = nonNegativeInteger : 1
- attrList.put(SchemaSymbols.ATT_MINOCCURS, allAttrs[ATT_MINOCCURS_D]);
- // name = NCName
- attrList.put(SchemaSymbols.ATT_NAME, allAttrs[ATT_NAME_R]);
- // nillable = boolean : false
- attrList.put(SchemaSymbols.ATT_NILLABLE, allAttrs[ATT_NILLABLE_D]);
- // type = QName
- attrList.put(SchemaSymbols.ATT_TYPE, allAttrs[ATT_TYPE_N]);
- fEleAttrsMapL.put(ELEMENT_N, attrList);
-
- // for element "element" - local ref
- attrList = Container.getContainer(4);
- // id = ID
- attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
- // maxOccurs = (nonNegativeInteger | unbounded) : 1
- attrList.put(SchemaSymbols.ATT_MAXOCCURS, allAttrs[ATT_MAXOCCURS_D]);
- // minOccurs = nonNegativeInteger : 1
- attrList.put(SchemaSymbols.ATT_MINOCCURS, allAttrs[ATT_MINOCCURS_D]);
- // ref = QName
- attrList.put(SchemaSymbols.ATT_REF, allAttrs[ATT_REF_R]);
- fEleAttrsMapL.put(ELEMENT_R, attrList);
-
- // for element "complexType" - global
- attrList = Container.getContainer(6);
- // abstract = boolean : false
- attrList.put(SchemaSymbols.ATT_ABSTRACT, allAttrs[ATT_ABSTRACT_D]);
- // block = (#all | List of (extension | restriction))
- attrList.put(SchemaSymbols.ATT_BLOCK, allAttrs[ATT_BLOCK1_N]);
- // final = (#all | List of (extension | restriction))
- attrList.put(SchemaSymbols.ATT_FINAL, allAttrs[ATT_FINAL_N]);
- // id = ID
- attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
- // mixed = boolean : false
- attrList.put(SchemaSymbols.ATT_MIXED, allAttrs[ATT_MIXED_D]);
- // name = NCName
- attrList.put(SchemaSymbols.ATT_NAME, allAttrs[ATT_NAME_R]);
- fEleAttrsMapG.put(SchemaSymbols.ELT_COMPLEXTYPE, attrList);
-
- // for element "notation" - global
- attrList = Container.getContainer(4);
- // id = ID
- attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
- // name = NCName
- attrList.put(SchemaSymbols.ATT_NAME, allAttrs[ATT_NAME_R]);
- // public = A public identifier, per ISO 8879
- attrList.put(SchemaSymbols.ATT_PUBLIC, allAttrs[ATT_PUBLIC_R]);
- // system = anyURI
- attrList.put(SchemaSymbols.ATT_SYSTEM, allAttrs[ATT_SYSTEM_N]);
- fEleAttrsMapG.put(SchemaSymbols.ELT_NOTATION, attrList);
-
-
- // for element "complexType" - local
- attrList = Container.getContainer(2);
- // id = ID
- attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
- // mixed = boolean : false
- attrList.put(SchemaSymbols.ATT_MIXED, allAttrs[ATT_MIXED_D]);
- fEleAttrsMapL.put(SchemaSymbols.ELT_COMPLEXTYPE, attrList);
-
- // for element "simpleContent" - local
- attrList = Container.getContainer(1);
- // id = ID
- attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
- fEleAttrsMapL.put(SchemaSymbols.ELT_SIMPLECONTENT, attrList);
-
- // for element "restriction" - local
- attrList = Container.getContainer(2);
- // base = QName
- attrList.put(SchemaSymbols.ATT_BASE, allAttrs[ATT_BASE_N]);
- // id = ID
- attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
- fEleAttrsMapL.put(SchemaSymbols.ELT_RESTRICTION, attrList);
-
- // for element "extension" - local
- attrList = Container.getContainer(2);
- // base = QName
- attrList.put(SchemaSymbols.ATT_BASE, allAttrs[ATT_BASE_R]);
- // id = ID
- attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
- fEleAttrsMapL.put(SchemaSymbols.ELT_EXTENSION, attrList);
-
- // for element "attributeGroup" - local ref
- attrList = Container.getContainer(2);
- // id = ID
- attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
- // ref = QName
- attrList.put(SchemaSymbols.ATT_REF, allAttrs[ATT_REF_R]);
- fEleAttrsMapL.put(SchemaSymbols.ELT_ATTRIBUTEGROUP, attrList);
-
- // for element "anyAttribute" - local
- attrList = Container.getContainer(3);
- // id = ID
- attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
- // namespace = ((##any | ##other) | List of (anyURI | (##targetNamespace | ##local)) ) : ##any
- attrList.put(SchemaSymbols.ATT_NAMESPACE, allAttrs[ATT_NAMESPACE_D]);
- // processContents = (lax | skip | strict) : strict
- attrList.put(SchemaSymbols.ATT_PROCESSCONTENTS, allAttrs[ATT_PROCESS_C_D]);
- fEleAttrsMapL.put(SchemaSymbols.ELT_ANYATTRIBUTE, attrList);
-
- // for element "complexContent" - local
- attrList = Container.getContainer(2);
- // id = ID
- attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
- // mixed = boolean
- attrList.put(SchemaSymbols.ATT_MIXED, allAttrs[ATT_MIXED_N]);
- fEleAttrsMapL.put(SchemaSymbols.ELT_COMPLEXCONTENT, attrList);
-
- // for element "attributeGroup" - global
- attrList = Container.getContainer(2);
- // id = ID
- attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
- // name = NCName
- attrList.put(SchemaSymbols.ATT_NAME, allAttrs[ATT_NAME_R]);
- fEleAttrsMapG.put(SchemaSymbols.ELT_ATTRIBUTEGROUP, attrList);
-
- // for element "group" - global
- attrList = Container.getContainer(2);
- // id = ID
- attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
- // name = NCName
- attrList.put(SchemaSymbols.ATT_NAME, allAttrs[ATT_NAME_R]);
- fEleAttrsMapG.put(SchemaSymbols.ELT_GROUP, attrList);
-
- // for element "group" - local ref
- attrList = Container.getContainer(4);
- // id = ID
- attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
- // maxOccurs = (nonNegativeInteger | unbounded) : 1
- attrList.put(SchemaSymbols.ATT_MAXOCCURS, allAttrs[ATT_MAXOCCURS_D]);
- // minOccurs = nonNegativeInteger : 1
- attrList.put(SchemaSymbols.ATT_MINOCCURS, allAttrs[ATT_MINOCCURS_D]);
- // ref = QName
- attrList.put(SchemaSymbols.ATT_REF, allAttrs[ATT_REF_R]);
- fEleAttrsMapL.put(SchemaSymbols.ELT_GROUP, attrList);
-
- // for element "all" - local
- attrList = Container.getContainer(3);
- // id = ID
- attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
- // maxOccurs = 1 : 1
- attrList.put(SchemaSymbols.ATT_MAXOCCURS, allAttrs[ATT_MAXOCCURS1_D]);
- // minOccurs = (0 | 1) : 1
- attrList.put(SchemaSymbols.ATT_MINOCCURS, allAttrs[ATT_MINOCCURS1_D]);
- fEleAttrsMapL.put(SchemaSymbols.ELT_ALL, attrList);
-
- // for element "choice" - local
- attrList = Container.getContainer(3);
- // id = ID
- attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
- // maxOccurs = (nonNegativeInteger | unbounded) : 1
- attrList.put(SchemaSymbols.ATT_MAXOCCURS, allAttrs[ATT_MAXOCCURS_D]);
- // minOccurs = nonNegativeInteger : 1
- attrList.put(SchemaSymbols.ATT_MINOCCURS, allAttrs[ATT_MINOCCURS_D]);
- fEleAttrsMapL.put(SchemaSymbols.ELT_CHOICE, attrList);
- // for element "sequence" - local
- fEleAttrsMapL.put(SchemaSymbols.ELT_SEQUENCE, attrList);
-
- // for element "any" - local
- attrList = Container.getContainer(5);
- // id = ID
- attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
- // maxOccurs = (nonNegativeInteger | unbounded) : 1
- attrList.put(SchemaSymbols.ATT_MAXOCCURS, allAttrs[ATT_MAXOCCURS_D]);
- // minOccurs = nonNegativeInteger : 1
- attrList.put(SchemaSymbols.ATT_MINOCCURS, allAttrs[ATT_MINOCCURS_D]);
- // namespace = ((##any | ##other) | List of (anyURI | (##targetNamespace | ##local)) ) : ##any
- attrList.put(SchemaSymbols.ATT_NAMESPACE, allAttrs[ATT_NAMESPACE_D]);
- // processContents = (lax | skip | strict) : strict
- attrList.put(SchemaSymbols.ATT_PROCESSCONTENTS, allAttrs[ATT_PROCESS_C_D]);
- fEleAttrsMapL.put(SchemaSymbols.ELT_ANY, attrList);
-
- // for element "unique" - local
- attrList = Container.getContainer(2);
- // id = ID
- attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
- // name = NCName
- attrList.put(SchemaSymbols.ATT_NAME, allAttrs[ATT_NAME_R]);
- fEleAttrsMapL.put(SchemaSymbols.ELT_UNIQUE, attrList);
- // for element "key" - local
- fEleAttrsMapL.put(SchemaSymbols.ELT_KEY, attrList);
-
- // for element "keyref" - local
- attrList = Container.getContainer(3);
- // id = ID
- attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
- // name = NCName
- attrList.put(SchemaSymbols.ATT_NAME, allAttrs[ATT_NAME_R]);
- // refer = QName
- attrList.put(SchemaSymbols.ATT_REFER, allAttrs[ATT_REFER_R]);
- fEleAttrsMapL.put(SchemaSymbols.ELT_KEYREF, attrList);
-
- // for element "selector" - local
- attrList = Container.getContainer(2);
- // id = ID
- attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
- // xpath = a subset of XPath expression
- attrList.put(SchemaSymbols.ATT_XPATH, allAttrs[ATT_XPATH_R]);
- fEleAttrsMapL.put(SchemaSymbols.ELT_SELECTOR, attrList);
-
- // for element "field" - local
- attrList = Container.getContainer(2);
- // id = ID
- attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
- // xpath = a subset of XPath expression
- attrList.put(SchemaSymbols.ATT_XPATH, allAttrs[ATT_XPATH1_R]);
- fEleAttrsMapL.put(SchemaSymbols.ELT_FIELD, attrList);
-
- // for element "annotation" - global
- attrList = Container.getContainer(1);
- // id = ID
- attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
- fEleAttrsMapG.put(SchemaSymbols.ELT_ANNOTATION, attrList);
- // for element "annotation" - local
- fEleAttrsMapL.put(SchemaSymbols.ELT_ANNOTATION, attrList);
-
- // for element "appinfo" - local
- attrList = Container.getContainer(1);
- // source = anyURI
- attrList.put(SchemaSymbols.ATT_SOURCE, allAttrs[ATT_SOURCE_N]);
- fEleAttrsMapG.put(SchemaSymbols.ELT_APPINFO, attrList);
- fEleAttrsMapL.put(SchemaSymbols.ELT_APPINFO, attrList);
-
- // for element "documentation" - local
- attrList = Container.getContainer(2);
- // source = anyURI
- attrList.put(SchemaSymbols.ATT_SOURCE, allAttrs[ATT_SOURCE_N]);
- // xml:lang = language
- attrList.put(SchemaSymbols.ATT_XML_LANG, allAttrs[ATT_XML_LANG]);
- fEleAttrsMapG.put(SchemaSymbols.ELT_DOCUMENTATION, attrList);
- fEleAttrsMapL.put(SchemaSymbols.ELT_DOCUMENTATION, attrList);
-
- // for element "simpleType" - global
- attrList = Container.getContainer(3);
- // final = (#all | List of (list | union | restriction))
- attrList.put(SchemaSymbols.ATT_FINAL, allAttrs[ATT_FINAL1_N]);
- // id = ID
- attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
- // name = NCName
- attrList.put(SchemaSymbols.ATT_NAME, allAttrs[ATT_NAME_R]);
- fEleAttrsMapG.put(SchemaSymbols.ELT_SIMPLETYPE, attrList);
-
- // for element "simpleType" - local
- attrList = Container.getContainer(2);
- // final = (#all | List of (list | union | restriction))
- attrList.put(SchemaSymbols.ATT_FINAL, allAttrs[ATT_FINAL1_N]);
- // id = ID
- attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
- fEleAttrsMapL.put(SchemaSymbols.ELT_SIMPLETYPE, attrList);
-
- // for element "restriction" - local
- // already registered for complexType
-
- // for element "list" - local
- attrList = Container.getContainer(2);
- // id = ID
- attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
- // itemType = QName
- attrList.put(SchemaSymbols.ATT_ITEMTYPE, allAttrs[ATT_ITEMTYPE_N]);
- fEleAttrsMapL.put(SchemaSymbols.ELT_LIST, attrList);
-
- // for element "union" - local
- attrList = Container.getContainer(2);
- // id = ID
- attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
- // memberTypes = List of QName
- attrList.put(SchemaSymbols.ATT_MEMBERTYPES, allAttrs[ATT_MEMBER_T_N]);
- fEleAttrsMapL.put(SchemaSymbols.ELT_UNION, attrList);
-
- // for element "schema" - global
- attrList = Container.getContainer(8);
- // attributeFormDefault = (qualified | unqualified) : unqualified
- attrList.put(SchemaSymbols.ATT_ATTRIBUTEFORMDEFAULT, allAttrs[ATT_ATTRIBUTE_FD_D]);
- // blockDefault = (#all | List of (extension | restriction | substitution)) : ''
- attrList.put(SchemaSymbols.ATT_BLOCKDEFAULT, allAttrs[ATT_BLOCK_D_D]);
- // elementFormDefault = (qualified | unqualified) : unqualified
- attrList.put(SchemaSymbols.ATT_ELEMENTFORMDEFAULT, allAttrs[ATT_ELEMENT_FD_D]);
- // finalDefault = (#all | List of (extension | restriction | list | union)) : ''
- attrList.put(SchemaSymbols.ATT_FINALDEFAULT, allAttrs[ATT_FINAL_D_D]);
- // id = ID
- attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
- // targetNamespace = anyURI
- attrList.put(SchemaSymbols.ATT_TARGETNAMESPACE, allAttrs[ATT_TARGET_N_N]);
- // version = token
- attrList.put(SchemaSymbols.ATT_VERSION, allAttrs[ATT_VERSION_N]);
- // xml:lang = language
- attrList.put(SchemaSymbols.ATT_XML_LANG, allAttrs[ATT_XML_LANG]);
- fEleAttrsMapG.put(SchemaSymbols.ELT_SCHEMA, attrList);
-
- // for element "include" - global
- attrList = Container.getContainer(2);
- // id = ID
- attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
- // schemaLocation = anyURI
- attrList.put(SchemaSymbols.ATT_SCHEMALOCATION, allAttrs[ATT_SCHEMA_L_R]);
- fEleAttrsMapG.put(SchemaSymbols.ELT_INCLUDE, attrList);
- // for element "redefine" - global
- fEleAttrsMapG.put(SchemaSymbols.ELT_REDEFINE, attrList);
-
- // for element "import" - global
- attrList = Container.getContainer(3);
- // id = ID
- attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
- // namespace = anyURI
- attrList.put(SchemaSymbols.ATT_NAMESPACE, allAttrs[ATT_NAMESPACE_N]);
- // schemaLocation = anyURI
- attrList.put(SchemaSymbols.ATT_SCHEMALOCATION, allAttrs[ATT_SCHEMA_L_N]);
- fEleAttrsMapG.put(SchemaSymbols.ELT_IMPORT, attrList);
-
- // for element "length" - local
- attrList = Container.getContainer(3);
- // id = ID
- attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
- // value = nonNegativeInteger
- attrList.put(SchemaSymbols.ATT_VALUE, allAttrs[ATT_VALUE_NNI_N]);
- // fixed = boolean : false
- attrList.put(SchemaSymbols.ATT_FIXED, allAttrs[ATT_FIXED_D]);
- fEleAttrsMapL.put(SchemaSymbols.ELT_LENGTH, attrList);
- // for element "minLength" - local
- fEleAttrsMapL.put(SchemaSymbols.ELT_MINLENGTH, attrList);
- // for element "maxLength" - local
- fEleAttrsMapL.put(SchemaSymbols.ELT_MAXLENGTH, attrList);
- // for element "fractionDigits" - local
- fEleAttrsMapL.put(SchemaSymbols.ELT_FRACTIONDIGITS, attrList);
-
- // for element "totalDigits" - local
- attrList = Container.getContainer(3);
- // id = ID
- attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
- // value = positiveInteger
- attrList.put(SchemaSymbols.ATT_VALUE, allAttrs[ATT_VALUE_PI_N]);
- // fixed = boolean : false
- attrList.put(SchemaSymbols.ATT_FIXED, allAttrs[ATT_FIXED_D]);
- fEleAttrsMapL.put(SchemaSymbols.ELT_TOTALDIGITS, attrList);
-
- // for element "pattern" - local
- attrList = Container.getContainer(2);
- // id = ID
- attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
- // value = string
- attrList.put(SchemaSymbols.ATT_VALUE, allAttrs[ATT_VALUE_STR_N]);
- fEleAttrsMapL.put(SchemaSymbols.ELT_PATTERN, attrList);
-
- // for element "enumeration" - local
- attrList = Container.getContainer(2);
- // id = ID
- attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
- // value = anySimpleType
- attrList.put(SchemaSymbols.ATT_VALUE, allAttrs[ATT_VALUE_STR_N]);
- fEleAttrsMapL.put(SchemaSymbols.ELT_ENUMERATION, attrList);
-
- // for element "whiteSpace" - local
- attrList = Container.getContainer(3);
- // id = ID
- attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
- // value = preserve | replace | collapse
- attrList.put(SchemaSymbols.ATT_VALUE, allAttrs[ATT_VALUE_WS_N]);
- // fixed = boolean : false
- attrList.put(SchemaSymbols.ATT_FIXED, allAttrs[ATT_FIXED_D]);
- fEleAttrsMapL.put(SchemaSymbols.ELT_WHITESPACE, attrList);
-
- // for element "maxInclusive" - local
- attrList = Container.getContainer(3);
- // id = ID
- attrList.put(SchemaSymbols.ATT_ID, allAttrs[ATT_ID_N]);
- // value = anySimpleType
- attrList.put(SchemaSymbols.ATT_VALUE, allAttrs[ATT_VALUE_STR_N]);
- // fixed = boolean : false
- attrList.put(SchemaSymbols.ATT_FIXED, allAttrs[ATT_FIXED_D]);
- fEleAttrsMapL.put(SchemaSymbols.ELT_MAXINCLUSIVE, attrList);
- // for element "maxExclusive" - local
- fEleAttrsMapL.put(SchemaSymbols.ELT_MAXEXCLUSIVE, attrList);
- // for element "minInclusive" - local
- fEleAttrsMapL.put(SchemaSymbols.ELT_MININCLUSIVE, attrList);
- // for element "minExclusive" - local
- fEleAttrsMapL.put(SchemaSymbols.ELT_MINEXCLUSIVE, attrList);
- }
-
- // used to resolver namespace prefixes
- protected XSDHandler fSchemaHandler = null;
-
- // used to store symbols.
- protected SymbolTable fSymbolTable = null;
-
- // used to store the mapping from processed element to attributes
- protected Map fNonSchemaAttrs = new HashMap();
-
- // temprory vector, used to hold the namespace list
- protected Vector fNamespaceList = new Vector();
-
- // whether this attribute appeared in the current element
- protected boolean[] fSeen = new boolean[ATTIDX_COUNT];
- private static boolean[] fSeenTemp = new boolean[ATTIDX_COUNT];
-
- // constructor. Sets fErrorReproter and get datatype validators
- public XSAttributeChecker(XSDHandler schemaHandler) {
- fSchemaHandler = schemaHandler;
- }
-
- public void reset(SymbolTable symbolTable) {
- fSymbolTable = symbolTable;
- fNonSchemaAttrs.clear();
- }
-
- /**
- * Check whether the specified element conforms to the attributes restriction
- * an array of attribute values is returned. the caller must call
- * <code>returnAttrArray</code> to return that array.
- *
- * @param element which element to check
- * @param isGlobal whether a child of &lt;schema&gt; or &lt;redefine&gt;
- * @param schemaDoc the document where the element lives in
- * @return an array containing attribute values
- */
- public Object[] checkAttributes(Element element, boolean isGlobal,
- XSDocumentInfo schemaDoc) {
- return checkAttributes(element, isGlobal, schemaDoc, false);
- }
-
- /**
- * Check whether the specified element conforms to the attributes restriction
- * an array of attribute values is returned. the caller must call
- * <code>returnAttrArray</code> to return that array. This method also takes
- * an extra parameter: if the element is "enumeration", whether to make a
- * copy of the namespace context, so that the value can be resolved as a
- * QName later.
- *
- * @param element which element to check
- * @param isGlobal whether a child of &lt;schema&gt; or &lt;redefine&gt;
- * @param schemaDoc the document where the element lives in
- * @param enumAsQName whether to tread enumeration value as QName
- * @return an array containing attribute values
- */
- public Object[] checkAttributes(Element element, boolean isGlobal,
- XSDocumentInfo schemaDoc, boolean enumAsQName) {
- if (element == null)
- return null;
-
- // get all attributes
- Attr[] attrs = DOMUtil.getAttrs(element);
-
- // update NamespaceSupport
- resolveNamespace(element, attrs, schemaDoc.fNamespaceSupport);
-
- String uri = DOMUtil.getNamespaceURI(element);
- String elName = DOMUtil.getLocalName(element);
-
- if (!SchemaSymbols.URI_SCHEMAFORSCHEMA.equals(uri)) {
- reportSchemaError("s4s-elt-schema-ns", new Object[] {elName}, element);
- }
-
- Map eleAttrsMap = fEleAttrsMapG;
- String lookupName = elName;
-
- // REVISIT: only local element and attribute are different from others.
- // it's possible to have either name or ref. all the others
- // are only allowed to have one of name or ref, or neither of them.
- // we'd better move such checking to the traverser.
- if (!isGlobal) {
- eleAttrsMap = fEleAttrsMapL;
- if (elName.equals(SchemaSymbols.ELT_ELEMENT)) {
- if (DOMUtil.getAttr(element, SchemaSymbols.ATT_REF) != null)
- lookupName = ELEMENT_R;
- else
- lookupName = ELEMENT_N;
- } else if (elName.equals(SchemaSymbols.ELT_ATTRIBUTE)) {
- if (DOMUtil.getAttr(element, SchemaSymbols.ATT_REF) != null)
- lookupName = ATTRIBUTE_R;
- else
- lookupName = ATTRIBUTE_N;
- }
- }
-
- // get desired attribute list of this element
- Container attrList = (Container)eleAttrsMap.get(lookupName);
- if (attrList == null) {
- // should never gets here.
- // when this method is called, the call already knows that
- // the element can appear.
- reportSchemaError ("s4s-elt-invalid", new Object[] {elName}, element);
- return null;
- }
-
- Object[] attrValues = getAvailableArray();
- long fromDefault = 0;
-
- // clear the "seen" flag.
- System.arraycopy(fSeenTemp, 0, fSeen, 0, ATTIDX_COUNT);
-
- // traverse all attributes
- int length = attrs.length;
- Attr sattr = null;
- for (int i = 0; i < length; i++) {
- sattr = attrs[i];
- // get the attribute name/value
- //String attrName = DOMUtil.getLocalName(sattr);
- String attrName = sattr.getName();
- String attrURI = DOMUtil.getNamespaceURI(sattr);
- String attrVal = DOMUtil.getValue(sattr);
-
- if (attrName.startsWith("xml")) {
- String attrPrefix = DOMUtil.getPrefix(sattr);
- // we don't want to add namespace declarations to the non-schema attributes
- if ("xmlns".equals(attrPrefix) || "xmlns".equals(attrName)) {
- continue;
- }
- // Both <schema> and <documentation> may have an xml:lang attribute.
- // Set the URI for this attribute to null so that we process it
- // like any other schema attribute.
- else if (SchemaSymbols.ATT_XML_LANG.equals(attrName) &&
- (SchemaSymbols.ELT_SCHEMA.equals(elName) ||
- SchemaSymbols.ELT_DOCUMENTATION.equals(elName))) {
- attrURI = null;
- }
- }
-
- // for attributes with namespace prefix
- //
- if (attrURI != null && attrURI.length() != 0) {
- // attributes with schema namespace are not allowed
- // and not allowed on "document" and "appInfo"
- if (attrURI.equals(SchemaSymbols.URI_SCHEMAFORSCHEMA)) {
- reportSchemaError ("s4s-att-not-allowed", new Object[] {elName, attrName}, element);
- }
- else {
- if(attrValues[ATTIDX_NONSCHEMA] == null) {
- // these are usually small
- attrValues[ATTIDX_NONSCHEMA] = new Vector(4,2);
- }
- ((Vector)attrValues[ATTIDX_NONSCHEMA]).addElement(attrName);
- ((Vector)attrValues[ATTIDX_NONSCHEMA]).addElement(attrVal);
- // for attributes from other namespace
- // store them in a list, and TRY to validate them after
- // schema traversal (because it's "lax")
- //otherValues.put(attrName, attrVal);
- // REVISIT: actually use this some day...
- // String attrRName = attrURI + "," + attrName;
- // Vector values = (Vector)fNonSchemaAttrs.get(attrRName);
- // if (values == null) {
- // values = new Vector();
- // values.addElement(attrName);
- // values.addElement(elName);
- // values.addElement(attrVal);
- // fNonSchemaAttrs.put(attrRName, values);
- // }
- // else {
- // values.addElement(elName);
- // values.addElement(attrVal);
- // }
- }
- continue;
- }
-
- // check whether this attribute is allowed
- OneAttr oneAttr = attrList.get(attrName);
- if (oneAttr == null) {
- reportSchemaError ("s4s-att-not-allowed",
- new Object[] {elName, attrName},
- element);
- continue;
- }
-
- // we've seen this attribute
- fSeen[oneAttr.valueIndex] = true;
-
- // check the value against the datatype
- try {
- // no checking on string needs to be done here.
- // no checking on xpath needs to be done here.
- // xpath values are validated in xpath parser
- if (oneAttr.dvIndex >= 0) {
- if (oneAttr.dvIndex != DT_STRING &&
- oneAttr.dvIndex != DT_XPATH &&
- oneAttr.dvIndex != DT_XPATH1) {
- XSSimpleType dv = fExtraDVs[oneAttr.dvIndex];
- Object avalue = dv.validate(attrVal, schemaDoc.fValidationContext, null);
- // kludge to handle chameleon includes/redefines...
- if (oneAttr.dvIndex == DT_QNAME) {
- QName qname = (QName)avalue;
- if(qname.prefix == XMLSymbols.EMPTY_STRING && qname.uri == null && schemaDoc.fIsChameleonSchema)
- qname.uri = schemaDoc.fTargetNamespace;
- }
- attrValues[oneAttr.valueIndex] = avalue;
- } else {
- attrValues[oneAttr.valueIndex] = attrVal;
- }
- }
- else {
- attrValues[oneAttr.valueIndex] = validate(attrValues, attrName, attrVal, oneAttr.dvIndex, schemaDoc);
- }
- } catch (InvalidDatatypeValueException ide) {
- reportSchemaError ("s4s-att-invalid-value",
- new Object[] {elName, attrName, ide.getMessage()},
- element);
- if (oneAttr.dfltValue != null)
- //attrValues.put(attrName, oneAttr.dfltValue);
- attrValues[oneAttr.valueIndex] = oneAttr.dfltValue;
- }
-
- // For "enumeration", and type is possible to be a QName, we need
- // to return namespace context for later QName resolution.
- if (elName.equals(SchemaSymbols.ELT_ENUMERATION) && enumAsQName) {
- attrValues[ATTIDX_ENUMNSDECLS] = new SchemaNamespaceSupport(schemaDoc.fNamespaceSupport);
- }
- }
-
- // apply default values
- OneAttr[] reqAttrs = attrList.values;
- for (int i = 0; i < reqAttrs.length; i++) {
- OneAttr oneAttr = reqAttrs[i];
-
- // if the attribute didn't apprear, and
- // if the attribute is optional with default value, apply it
- if (oneAttr.dfltValue != null && !fSeen[oneAttr.valueIndex]) {
- //attrValues.put(oneAttr.name, oneAttr.dfltValue);
- attrValues[oneAttr.valueIndex] = oneAttr.dfltValue;
- fromDefault |= (1<<oneAttr.valueIndex);
- }
- }
-
- attrValues[ATTIDX_FROMDEFAULT] = new Long(fromDefault);
- //attrValues[ATTIDX_OTHERVALUES] = otherValues;
-
- // Check that minOccurs isn't greater than maxOccurs.
- // p-props-correct 2.1
- if (attrValues[ATTIDX_MAXOCCURS] != null) {
- int min = ((XInt)attrValues[ATTIDX_MINOCCURS]).intValue();
- int max = ((XInt)attrValues[ATTIDX_MAXOCCURS]).intValue();
- if (max != SchemaSymbols.OCCURRENCE_UNBOUNDED) {
-
- // maxOccurLimit is only check in secure mode
- if (fSchemaHandler.fSecurityManager != null) {
- String localName = element.getLocalName();
-
- // The maxOccurs restriction no longer applies to elements
- // and wildcards in a sequence in which they are the only
- // particle. These are now validated using a constant
- // space algorithm. The restriction still applies to all
- // other cases.
-
- // Determine if constant-space algorithm can be applied
- final boolean optimize =
- (localName.equals("element") || localName.equals("any")) &&
- (element.getNextSibling() == null) &&
- (element.getPreviousSibling() == null) &&
- (element.getParentNode().getLocalName().equals("sequence"));
-
- if (!optimize) {
- //Revisit :: IMO this is not right place to check
- // maxOccurNodeLimit.
- int maxOccurNodeLimit = fSchemaHandler.fSecurityManager.getLimit(XMLSecurityManager.Limit.MAX_OCCUR_NODE_LIMIT);
- if (max > maxOccurNodeLimit && !fSchemaHandler.fSecurityManager.isNoLimit(maxOccurNodeLimit)) {
- reportSchemaFatalError("MaxOccurLimit", new Object[] {new Integer(maxOccurNodeLimit)}, element);
-
- // reset max values in case processing continues on error
- attrValues[ATTIDX_MAXOCCURS] = fXIntPool.getXInt(maxOccurNodeLimit);
- //new Integer(maxOccurNodeLimit);
- max = maxOccurNodeLimit;
- }
- }
- }
-
- if (min > max) {
- reportSchemaError ("p-props-correct.2.1",
- new Object[] {elName, attrValues[ATTIDX_MINOCCURS], attrValues[ATTIDX_MAXOCCURS]},
- element);
- attrValues[ATTIDX_MINOCCURS] = attrValues[ATTIDX_MAXOCCURS];
- }
- }
- }
-
- return attrValues;
- }
-
- private Object validate(Object[] attrValues, String attr, String ivalue, int dvIndex,
- XSDocumentInfo schemaDoc) throws InvalidDatatypeValueException {
- if (ivalue == null)
- return null;
-
- // To validate these types, we don't actually need to normalize the
- // strings. We only need to remove the whitespace from both ends.
- // In some special cases (list types), StringTokenizer can correctly
- // process the un-normalized whitespace.
-
- String value = XMLChar.trim(ivalue);
- Object retValue = null;
- Vector memberType;
- int choice;
-
- switch (dvIndex) {
- case DT_BOOLEAN:
- if (value.equals(SchemaSymbols.ATTVAL_FALSE) ||
- value.equals(SchemaSymbols.ATTVAL_FALSE_0)) {
- retValue = Boolean.FALSE;
- } else if (value.equals(SchemaSymbols.ATTVAL_TRUE) ||
- value.equals(SchemaSymbols.ATTVAL_TRUE_1)) {
- retValue = Boolean.TRUE;
- } else {
- throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{value, "boolean"});
- }
- break;
- case DT_NONNEGINT:
- try {
- if (value.length() > 0 && value.charAt(0) == '+')
- value = value.substring(1);
- retValue = fXIntPool.getXInt(Integer.parseInt(value));
- } catch (NumberFormatException e) {
- throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{value, "nonNegativeInteger"});
- }
- if (((XInt)retValue).intValue() < 0)
- throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{value, "nonNegativeInteger"});
- break;
- case DT_POSINT:
- try {
- if (value.length() > 0 && value.charAt(0) == '+')
- value = value.substring(1);
- retValue = fXIntPool.getXInt(Integer.parseInt(value));
- } catch (NumberFormatException e) {
- throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{value, "positiveInteger"});
- }
- if (((XInt)retValue).intValue() <= 0)
- throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{value, "positiveInteger"});
- break;
- case DT_BLOCK:
- // block = (#all | List of (extension | restriction | substitution))
- choice = 0;
- if (value.equals (SchemaSymbols.ATTVAL_POUNDALL)) {
- choice = XSConstants.DERIVATION_SUBSTITUTION|XSConstants.DERIVATION_EXTENSION|
- XSConstants.DERIVATION_RESTRICTION;
- }
- else {
- StringTokenizer t = new StringTokenizer(value, " \n\t\r");
- while (t.hasMoreTokens()) {
- String token = t.nextToken ();
-
- if (token.equals (SchemaSymbols.ATTVAL_EXTENSION)) {
- choice |= XSConstants.DERIVATION_EXTENSION;
- }
- else if (token.equals (SchemaSymbols.ATTVAL_RESTRICTION)) {
- choice |= XSConstants.DERIVATION_RESTRICTION;
- }
- else if (token.equals (SchemaSymbols.ATTVAL_SUBSTITUTION)) {
- choice |= XSConstants.DERIVATION_SUBSTITUTION;
- }
- else {
- throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.3", new Object[]{value, "(#all | List of (extension | restriction | substitution))"});
- }
- }
- }
- retValue = fXIntPool.getXInt(choice);
- break;
- case DT_BLOCK1:
- case DT_FINAL:
- // block = (#all | List of (extension | restriction))
- // final = (#all | List of (extension | restriction))
- choice = 0;
- if (value.equals (SchemaSymbols.ATTVAL_POUNDALL)) {
- //choice = SchemaSymbols.EXTENSION|SchemaSymbols.RESTRICTION;
- // REVISIT: if #all, then make the result the combination of
- // everything: substitution/externsion/restriction/list/union.
- // would this be a problem?
- // the reason doing so is that when final/blockFinal on <schema>
- // is #all, it's not always the same as the conbination of those
- // values allowed by final/blockFinal.
- // for example, finalDefault="#all" is not always the same as
- // finalDefault="extension restriction".
- // if finalDefault="#all", final on any simple type would be
- // "extension restriction list union".
- choice = XSConstants.DERIVATION_SUBSTITUTION|XSConstants.DERIVATION_EXTENSION|
- XSConstants.DERIVATION_RESTRICTION|XSConstants.DERIVATION_LIST|
- XSConstants.DERIVATION_UNION;
- }
- else {
- StringTokenizer t = new StringTokenizer(value, " \n\t\r");
- while (t.hasMoreTokens()) {
- String token = t.nextToken ();
-
- if (token.equals (SchemaSymbols.ATTVAL_EXTENSION)) {
- choice |= XSConstants.DERIVATION_EXTENSION;
- }
- else if (token.equals (SchemaSymbols.ATTVAL_RESTRICTION)) {
- choice |= XSConstants.DERIVATION_RESTRICTION;
- }
- else {
- throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.3", new Object[]{value, "(#all | List of (extension | restriction))"});
- }
- }
- }
- retValue = fXIntPool.getXInt(choice);
- break;
- case DT_FINAL1:
- // final = (#all | List of (list | union | restriction))
- choice = 0;
- if (value.equals (SchemaSymbols.ATTVAL_POUNDALL)) {
- //choice = SchemaSymbols.RESTRICTION|SchemaSymbols.LIST|
- // SchemaSymbols.UNION;
- // REVISIT: if #all, then make the result the combination of
- // everything: substitution/externsion/restriction/list/union.
- // would this be a problem?
- // same reason as above DT_BLOCK1/DT_FINAL
- choice = XSConstants.DERIVATION_SUBSTITUTION|XSConstants.DERIVATION_EXTENSION|
- XSConstants.DERIVATION_RESTRICTION|XSConstants.DERIVATION_LIST|
- XSConstants.DERIVATION_UNION;
- }
- else {
- StringTokenizer t = new StringTokenizer(value, " \n\t\r");
- while (t.hasMoreTokens()) {
- String token = t.nextToken ();
-
- if (token.equals (SchemaSymbols.ATTVAL_LIST)) {
- choice |= XSConstants.DERIVATION_LIST;
- }
- else if (token.equals (SchemaSymbols.ATTVAL_UNION)) {
- choice |= XSConstants.DERIVATION_UNION;
- }
- else if (token.equals (SchemaSymbols.ATTVAL_RESTRICTION)) {
- choice |= XSConstants.DERIVATION_RESTRICTION;
- }
- else {
- throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.3", new Object[]{value, "(#all | List of (list | union | restriction))"});
- }
- }
- }
- retValue = fXIntPool.getXInt(choice);
- break;
- case DT_FINAL2:
- // finalDefault = (#all | List of (extension | restriction | list | union))
- choice = 0;
- if (value.equals (SchemaSymbols.ATTVAL_POUNDALL)) {
- //choice = SchemaSymbols.RESTRICTION|SchemaSymbols.LIST|
- // SchemaSymbols.UNION;
- // REVISIT: if #all, then make the result the combination of
- // everything: substitution/externsion/restriction/list/union.
- // would this be a problem?
- // same reason as above DT_BLOCK1/DT_FINAL
- choice = XSConstants.DERIVATION_SUBSTITUTION|XSConstants.DERIVATION_EXTENSION|
- XSConstants.DERIVATION_RESTRICTION|XSConstants.DERIVATION_LIST|
- XSConstants.DERIVATION_UNION;
- }
- else {
- StringTokenizer t = new StringTokenizer(value, " \n\t\r");
- while (t.hasMoreTokens()) {
- String token = t.nextToken ();
-
- if (token.equals (SchemaSymbols.ATTVAL_EXTENSION)) {
- choice |= XSConstants.DERIVATION_EXTENSION;
- }
- else if (token.equals (SchemaSymbols.ATTVAL_RESTRICTION)) {
- choice |= XSConstants.DERIVATION_RESTRICTION;
- }
- else if (token.equals (SchemaSymbols.ATTVAL_LIST)) {
- choice |= XSConstants.DERIVATION_LIST;
- }
- else if (token.equals (SchemaSymbols.ATTVAL_UNION)) {
- choice |= XSConstants.DERIVATION_UNION;
- }
- else {
- throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.3", new Object[]{value, "(#all | List of (extension | restriction | list | union))"});
- }
- }
- }
- retValue = fXIntPool.getXInt(choice);
- break;
- case DT_FORM:
- // form = (qualified | unqualified)
- if (value.equals (SchemaSymbols.ATTVAL_QUALIFIED))
- retValue = INT_QUALIFIED;
- else if (value.equals (SchemaSymbols.ATTVAL_UNQUALIFIED))
- retValue = INT_UNQUALIFIED;
- else
- throw new InvalidDatatypeValueException("cvc-enumeration-valid",
- new Object[]{value, "(qualified | unqualified)"});
- break;
- case DT_MAXOCCURS:
- // maxOccurs = (nonNegativeInteger | unbounded)
- if (value.equals(SchemaSymbols.ATTVAL_UNBOUNDED)) {
- retValue = INT_UNBOUNDED;
- } else {
- try {
- retValue = validate(attrValues, attr, value, DT_NONNEGINT, schemaDoc);
- } catch (NumberFormatException e) {
- throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.3", new Object[]{value, "(nonNegativeInteger | unbounded)"});
- }
- }
- break;
- case DT_MAXOCCURS1:
- // maxOccurs = 1
- if (value.equals("1"))
- retValue = fXIntPool.getXInt(1);
- else
- throw new InvalidDatatypeValueException("cvc-enumeration-valid",
- new Object[]{value, "(1)"});
- break;
- case DT_MEMBERTYPES:
- // memberTypes = List of QName
- memberType = new Vector();
- try {
- StringTokenizer t = new StringTokenizer(value, " \n\t\r");
- while (t.hasMoreTokens()) {
- String token = t.nextToken ();
- QName qname = (QName)fExtraDVs[DT_QNAME].validate(token, schemaDoc.fValidationContext, null);
- // kludge to handle chameleon includes/redefines...
- if(qname.prefix == XMLSymbols.EMPTY_STRING && qname.uri == null && schemaDoc.fIsChameleonSchema)
- qname.uri = schemaDoc.fTargetNamespace;
- memberType.addElement(qname);
- }
- retValue = memberType;
- }
- catch (InvalidDatatypeValueException ide) {
- throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.2", new Object[]{value, "(List of QName)"});
- }
- break;
- case DT_MINOCCURS1:
- // minOccurs = (0 | 1)
- if (value.equals("0"))
- retValue = fXIntPool.getXInt(0);
- else if (value.equals("1"))
- retValue = fXIntPool.getXInt(1);
- else
- throw new InvalidDatatypeValueException("cvc-enumeration-valid",
- new Object[]{value, "(0 | 1)"});
- break;
- case DT_NAMESPACE:
- // namespace = ((##any | ##other) | List of (anyURI | (##targetNamespace | ##local)) )
- if (value.equals(SchemaSymbols.ATTVAL_TWOPOUNDANY)) {
- // ##any
- retValue = INT_ANY_ANY;
- } else if (value.equals(SchemaSymbols.ATTVAL_TWOPOUNDOTHER)) {
- // ##other
- retValue = INT_ANY_NOT;
- String[] list = new String[2];
- list[0] = schemaDoc.fTargetNamespace;
- list[1] = null;
- attrValues[ATTIDX_NAMESPACE_LIST] = list;
- } else {
- // list
- retValue = INT_ANY_LIST;
-
- fNamespaceList.removeAllElements();
-
- // tokenize
- StringTokenizer tokens = new StringTokenizer(value, " \n\t\r");
- String token;
- String tempNamespace;
- try {
- while (tokens.hasMoreTokens()) {
- token = tokens.nextToken();
- if (token.equals(SchemaSymbols.ATTVAL_TWOPOUNDLOCAL)) {
- tempNamespace = null;
- } else if (token.equals(SchemaSymbols.ATTVAL_TWOPOUNDTARGETNS)) {
- tempNamespace = schemaDoc.fTargetNamespace;
- } else {
- // we have found namespace URI here
- // need to add it to the symbol table
- fExtraDVs[DT_ANYURI].validate(token, schemaDoc.fValidationContext, null);
- tempNamespace = fSymbolTable.addSymbol(token);
- }
-
- //check for duplicate namespaces in the list
- if (!fNamespaceList.contains(tempNamespace)) {
- fNamespaceList.addElement(tempNamespace);
- }
- }
- } catch (InvalidDatatypeValueException ide) {
- throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.3", new Object[]{value, "((##any | ##other) | List of (anyURI | (##targetNamespace | ##local)) )"});
- }
-
- // convert the vector to an array
- int num = fNamespaceList.size();
- String[] list = new String[num];
- fNamespaceList.copyInto(list);
- attrValues[ATTIDX_NAMESPACE_LIST] = list;
- }
- break;
- case DT_PROCESSCONTENTS:
- // processContents = (lax | skip | strict)
- if (value.equals (SchemaSymbols.ATTVAL_STRICT))
- retValue = INT_ANY_STRICT;
- else if (value.equals (SchemaSymbols.ATTVAL_LAX))
- retValue = INT_ANY_LAX;
- else if (value.equals (SchemaSymbols.ATTVAL_SKIP))
- retValue = INT_ANY_SKIP;
- else
- throw new InvalidDatatypeValueException("cvc-enumeration-valid",
- new Object[]{value, "(lax | skip | strict)"});
- break;
- case DT_USE:
- // use = (optional | prohibited | required)
- if (value.equals (SchemaSymbols.ATTVAL_OPTIONAL))
- retValue = INT_USE_OPTIONAL;
- else if (value.equals (SchemaSymbols.ATTVAL_REQUIRED))
- retValue = INT_USE_REQUIRED;
- else if (value.equals (SchemaSymbols.ATTVAL_PROHIBITED))
- retValue = INT_USE_PROHIBITED;
- else
- throw new InvalidDatatypeValueException("cvc-enumeration-valid",
- new Object[]{value, "(optional | prohibited | required)"});
- break;
- case DT_WHITESPACE:
- // value = preserve | replace | collapse
- if (value.equals (SchemaSymbols.ATTVAL_PRESERVE))
- retValue = INT_WS_PRESERVE;
- else if (value.equals (SchemaSymbols.ATTVAL_REPLACE))
- retValue = INT_WS_REPLACE;
- else if (value.equals (SchemaSymbols.ATTVAL_COLLAPSE))
- retValue = INT_WS_COLLAPSE;
- else
- throw new InvalidDatatypeValueException("cvc-enumeration-valid",
- new Object[]{value, "(preserve | replace | collapse)"});
- break;
- }
-
- return retValue;
- }
-
- void reportSchemaFatalError (String key, Object[] args, Element ele) {
- fSchemaHandler.reportSchemaFatalError(key, args, ele);
- }
-
- void reportSchemaError (String key, Object[] args, Element ele) {
- fSchemaHandler.reportSchemaError(key, args, ele);
- }
-
- // validate attriubtes from non-schema namespaces
- // REVISIT: why we store the attributes in this way? why not just a list
- // of structure {element node, attr name/qname, attr value)?
- // REVISIT: pass the proper element node to reportSchemaError
- public void checkNonSchemaAttributes(XSGrammarBucket grammarBucket) {
- // for all attributes
- Iterator entries = fNonSchemaAttrs.entrySet().iterator();
- XSAttributeDecl attrDecl;
- while (entries.hasNext()) {
- Map.Entry entry = (Map.Entry) entries.next();
- // get name, uri, localpart
- String attrRName = (String) entry.getKey();
- String attrURI = attrRName.substring(0,attrRName.indexOf(','));
- String attrLocal = attrRName.substring(attrRName.indexOf(',')+1);
- // find associated grammar
- SchemaGrammar sGrammar = grammarBucket.getGrammar(attrURI);
- if (sGrammar == null) {
- continue;
- }
- // and get the datatype validator, if there is one
- attrDecl = sGrammar.getGlobalAttributeDecl(attrLocal);
- if (attrDecl == null) {
- continue;
- }
- XSSimpleType dv = (XSSimpleType)attrDecl.getTypeDefinition();
- if (dv == null) {
- continue;
- }
-
- // get all values appeared with this attribute name
- Vector values = (Vector) entry.getValue();
- String elName;
- String attrName = (String)values.elementAt(0);
- // for each of the values
- int count = values.size();
- for (int i = 1; i < count; i += 2) {
- elName = (String)values.elementAt(i);
- try {
- // and validate it using the XSSimpleType
- // REVISIT: what would be the proper validation context?
- // guess we need to save that in the vectors too.
- dv.validate((String)values.elementAt(i+1), null, null);
- } catch(InvalidDatatypeValueException ide) {
- reportSchemaError ("s4s-att-invalid-value",
- new Object[] {elName, attrName, ide.getMessage()},
- null);
- }
- }
- }
- }
-
- // normalize the string according to the whiteSpace facet
- public static String normalize(String content, short ws) {
- int len = content == null ? 0 : content.length();
- if (len == 0 || ws == XSSimpleType.WS_PRESERVE)
- return content;
-
- StringBuffer sb = new StringBuffer();
- if (ws == XSSimpleType.WS_REPLACE) {
- char ch;
- // when it's replace, just replace #x9, #xa, #xd by #x20
- for (int i = 0; i < len; i++) {
- ch = content.charAt(i);
- if (ch != 0x9 && ch != 0xa && ch != 0xd)
- sb.append(ch);
- else
- sb.append((char)0x20);
- }
- } else {
- char ch;
- int i;
- boolean isLeading = true;
- // when it's collapse
- for (i = 0; i < len; i++) {
- ch = content.charAt(i);
- // append real characters, so we passed leading ws
- if (ch != 0x9 && ch != 0xa && ch != 0xd && ch != 0x20) {
- sb.append(ch);
- isLeading = false;
- }
- else {
- // for whitespaces, we skip all following ws
- for (; i < len-1; i++) {
- ch = content.charAt(i+1);
- if (ch != 0x9 && ch != 0xa && ch != 0xd && ch != 0x20)
- break;
- }
- // if it's not a leading or tailing ws, then append a space
- if (i < len - 1 && !isLeading)
- sb.append((char)0x20);
- }
- }
- }
-
- return sb.toString();
- }
-
- // the following part implements an attribute-value-array pool.
- // when checkAttribute is called, it calls getAvailableArray to get
- // an array from the pool; when the caller is done with the array,
- // it calls returnAttrArray to return that array to the pool.
-
- // initial size of the array pool. 10 is big enough
- static final int INIT_POOL_SIZE = 10;
- // the incremental size of the array pool
- static final int INC_POOL_SIZE = 10;
- // the array pool
- Object[][] fArrayPool = new Object[INIT_POOL_SIZE][ATTIDX_COUNT];
- // used to clear the returned array
- // I think System.arrayCopy is more efficient than setting 35 fields to null
- private static Object[] fTempArray = new Object[ATTIDX_COUNT];
- // current position of the array pool (# of arrays not returned)
- int fPoolPos = 0;
-
- // get the next available array
- protected Object[] getAvailableArray() {
- // if no array left in the pool, increase the pool size
- if (fArrayPool.length == fPoolPos) {
- // increase size
- fArrayPool = new Object[fPoolPos+INC_POOL_SIZE][];
- // initialize each *new* array
- for (int i = fPoolPos; i < fArrayPool.length; i++)
- fArrayPool[i] = new Object[ATTIDX_COUNT];
- }
- // get the next available one
- Object[] retArray = fArrayPool[fPoolPos];
- // clear it from the pool. this is for GC: if a caller forget to
- // return the array, we want that array to be GCed.
- fArrayPool[fPoolPos++] = null;
- // to make sure that one array is not returned twice, we use
- // the last entry to indicate whether an array is already returned
- // now set it to false.
- System.arraycopy(fTempArray, 0, retArray, 0, ATTIDX_COUNT-1);
- retArray[ATTIDX_ISRETURNED] = Boolean.FALSE;
-
- return retArray;
- }
-
- // return an array back to the pool
- public void returnAttrArray(Object[] attrArray, XSDocumentInfo schemaDoc) {
- // pop the namespace context
- if (schemaDoc != null)
- schemaDoc.fNamespaceSupport.popContext();
-
- // if 1. the pool is full; 2. the array is null;
- // 3. the array is of wrong size; 4. the array is already returned
- // then we can't accept this array to be returned
- if (fPoolPos == 0 ||
- attrArray == null ||
- attrArray.length != ATTIDX_COUNT ||
- ((Boolean)attrArray[ATTIDX_ISRETURNED]).booleanValue()) {
- return;
- }
-
- // mark this array as returned
- attrArray[ATTIDX_ISRETURNED] = Boolean.TRUE;
- // better clear nonschema vector
- if(attrArray[ATTIDX_NONSCHEMA] != null)
- ((Vector)attrArray[ATTIDX_NONSCHEMA]).clear();
- // and put it into the pool
- fArrayPool[--fPoolPos] = attrArray;
- }
-
- public void resolveNamespace(Element element, Attr[] attrs,
- SchemaNamespaceSupport nsSupport) {
- // push the namespace context
- nsSupport.pushContext();
-
- // search for new namespace bindings
- int length = attrs.length;
- Attr sattr = null;
- String rawname, prefix, uri;
- for (int i = 0; i < length; i++) {
- sattr = attrs[i];
- rawname = DOMUtil.getName(sattr);
- prefix = null;
- if (rawname.equals(XMLSymbols.PREFIX_XMLNS))
- prefix = XMLSymbols.EMPTY_STRING;
- else if (rawname.startsWith("xmlns:"))
- prefix = fSymbolTable.addSymbol(DOMUtil.getLocalName(sattr));
- if (prefix != null) {
- uri = fSymbolTable.addSymbol(DOMUtil.getValue(sattr));
- nsSupport.declarePrefix(prefix, uri.length()!=0 ? uri : null);
- }
- }
- }
-}
-
-class OneAttr {
- // name of the attribute
- public String name;
- // index of the datatype validator
- public int dvIndex;
- // whether it's optional, and has default value
- public int valueIndex;
- // the default value of this attribute
- public Object dfltValue;
-
- public OneAttr(String name, int dvIndex, int valueIndex, Object dfltValue) {
- this.name = name;
- this.dvIndex = dvIndex;
- this.valueIndex = valueIndex;
- this.dfltValue = dfltValue;
- }
-}
-
-abstract class Container {
- static final int THRESHOLD = 5;
- static Container getContainer(int size) {
- if (size > THRESHOLD)
- return new LargeContainer(size);
- else
- return new SmallContainer(size);
- }
- abstract void put(String key, OneAttr value);
- abstract OneAttr get(String key);
-
- OneAttr[] values;
- int pos = 0;
-}
-
-class SmallContainer extends Container {
- String[] keys;
- SmallContainer(int size) {
- keys = new String[size];
- values = new OneAttr[size];
- }
- void put(String key, OneAttr value) {
- keys[pos] = key;
- values[pos++] = value;
- }
- OneAttr get(String key) {
- for (int i = 0; i < pos; i++) {
- if (keys[i].equals(key)) {
- return values[i];
- }
- }
- return null;
- }
-}
-
-class LargeContainer extends Container {
- Map items;
- LargeContainer(int size) {
- items = new HashMap(size*2+1);
- values = new OneAttr[size];
- }
- void put(String key, OneAttr value) {
- items.put(key, value);
- values[pos++] = value;
- }
- OneAttr get(String key) {
- OneAttr ret = (OneAttr)items.get(key);
- return ret;
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAbstractIDConstraintTraverser.java b/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAbstractIDConstraintTraverser.java
deleted file mode 100644
index c645523..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAbstractIDConstraintTraverser.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.traversers;
-
-import com.sun.org.apache.xerces.internal.impl.xpath.XPathException;
-import com.sun.org.apache.xerces.internal.impl.xs.SchemaSymbols;
-import com.sun.org.apache.xerces.internal.impl.xs.identity.Field;
-import com.sun.org.apache.xerces.internal.impl.xs.identity.IdentityConstraint;
-import com.sun.org.apache.xerces.internal.impl.xs.identity.Selector;
-import com.sun.org.apache.xerces.internal.util.DOMUtil;
-import com.sun.org.apache.xerces.internal.util.XMLChar;
-import org.w3c.dom.Element;
-
-/**
- * This class contains code that all three IdentityConstraint
- * traversers (the XSDUniqueTraverser, XSDKeyTraverser and
- * XSDKeyrefTraverser) rely upon.
- *
- * @xerces.internal
- *
- * @version $Id: XSDAbstractIDConstraintTraverser.java,v 1.7 2010-11-01 04:40:02 joehw Exp $
- */
-class XSDAbstractIDConstraintTraverser extends XSDAbstractTraverser {
-
- public XSDAbstractIDConstraintTraverser (XSDHandler handler,
- XSAttributeChecker gAttrCheck) {
- super(handler, gAttrCheck);
- }
-
- boolean traverseIdentityConstraint(IdentityConstraint ic,
- Element icElem, XSDocumentInfo schemaDoc, Object [] icElemAttrs) {
-
- // General Attribute Checking will have been done on icElem by caller
-
- // check for <annotation> and get selector
- Element sElem = DOMUtil.getFirstChildElement(icElem);
- if(sElem == null) {
- reportSchemaError("s4s-elt-must-match.2",
- new Object[]{"identity constraint", "(annotation?, selector, field+)"},
- icElem);
- return false;
- }
-
- // General Attribute Checking on sElem
- // first child could be an annotation
- if (DOMUtil.getLocalName(sElem).equals(SchemaSymbols.ELT_ANNOTATION)) {
- ic.addAnnotation(traverseAnnotationDecl(sElem, icElemAttrs, false, schemaDoc));
- sElem = DOMUtil.getNextSiblingElement(sElem);
- // if no more children report an error
- if(sElem == null) {
- reportSchemaError("s4s-elt-must-match.2", new Object[]{"identity constraint", "(annotation?, selector, field+)"}, icElem);
- return false;
- }
- }
- else {
- String text = DOMUtil.getSyntheticAnnotation(icElem);
- if (text != null) {
- ic.addAnnotation(traverseSyntheticAnnotation(icElem, text, icElemAttrs, false, schemaDoc));
- }
- }
-
- // must be <selector>
- if(!DOMUtil.getLocalName(sElem).equals(SchemaSymbols.ELT_SELECTOR)) {
- reportSchemaError("s4s-elt-must-match.1", new Object[]{"identity constraint", "(annotation?, selector, field+)", SchemaSymbols.ELT_SELECTOR}, sElem);
- return false;
- }
- Object [] attrValues = fAttrChecker.checkAttributes(sElem, false, schemaDoc);
-
- // make sure <selector>'s content is fine:
- Element selChild = DOMUtil.getFirstChildElement(sElem);
-
- if (selChild !=null) {
- // traverse annotation if any
- if (DOMUtil.getLocalName(selChild).equals(SchemaSymbols.ELT_ANNOTATION)) {
- ic.addAnnotation(traverseAnnotationDecl(selChild, attrValues, false, schemaDoc));
- selChild = DOMUtil.getNextSiblingElement(selChild);
- }
- else {
- reportSchemaError("s4s-elt-must-match.1", new Object[]{SchemaSymbols.ELT_SELECTOR, "(annotation?)", DOMUtil.getLocalName(selChild)}, selChild);
- }
- if (selChild != null) {
- reportSchemaError("s4s-elt-must-match.1", new Object [] {SchemaSymbols.ELT_SELECTOR, "(annotation?)", DOMUtil.getLocalName(selChild)}, selChild);
- }
- }
- else {
- String text = DOMUtil.getSyntheticAnnotation(sElem);
- if (text != null) {
- ic.addAnnotation(traverseSyntheticAnnotation(icElem, text, attrValues, false, schemaDoc));
- }
- }
-
- String sText = ((String)attrValues[XSAttributeChecker.ATTIDX_XPATH]);
- if(sText == null) {
- reportSchemaError("s4s-att-must-appear", new Object [] {SchemaSymbols.ELT_SELECTOR, SchemaSymbols.ATT_XPATH}, sElem);
- return false;
- }
- sText = XMLChar.trim(sText);
-
- Selector.XPath sXpath = null;
- try {
- sXpath = new Selector.XPath(sText, fSymbolTable,
- schemaDoc.fNamespaceSupport);
- Selector selector = new Selector(sXpath, ic);
- ic.setSelector(selector);
- }
- catch (XPathException e) {
- reportSchemaError(e.getKey(), new Object[]{sText}, sElem);
- // put back attr values...
- fAttrChecker.returnAttrArray(attrValues, schemaDoc);
- return false;
- }
-
- // put back attr values...
- fAttrChecker.returnAttrArray(attrValues, schemaDoc);
-
- // get fields
- Element fElem = DOMUtil.getNextSiblingElement(sElem);
- if(fElem == null) {
- reportSchemaError("s4s-elt-must-match.2", new Object[]{"identity constraint", "(annotation?, selector, field+)"}, sElem);
- return false;
- }
- while (fElem != null) {
- if(!DOMUtil.getLocalName(fElem).equals(SchemaSymbols.ELT_FIELD)) {
- reportSchemaError("s4s-elt-must-match.1", new Object[]{"identity constraint", "(annotation?, selector, field+)", SchemaSymbols.ELT_FIELD}, fElem);
- fElem = DOMUtil.getNextSiblingElement(fElem);
- continue;
- }
-
- // General Attribute Checking
- attrValues = fAttrChecker.checkAttributes(fElem, false, schemaDoc);
-
- // and make sure <field>'s content is fine:
- Element fieldChild = DOMUtil.getFirstChildElement(fElem);
- if (fieldChild != null) {
- // traverse annotation
- if (DOMUtil.getLocalName(fieldChild).equals(SchemaSymbols.ELT_ANNOTATION)) {
- ic.addAnnotation(traverseAnnotationDecl(fieldChild, attrValues, false, schemaDoc));
- fieldChild = DOMUtil.getNextSiblingElement(fieldChild);
- }
- }
- if (fieldChild != null) {
- reportSchemaError("s4s-elt-must-match.1", new Object [] {SchemaSymbols.ELT_FIELD, "(annotation?)", DOMUtil.getLocalName(fieldChild)}, fieldChild);
- }
- else {
- String text = DOMUtil.getSyntheticAnnotation(fElem);
- if (text != null) {
- ic.addAnnotation(traverseSyntheticAnnotation(icElem, text, attrValues, false, schemaDoc));
- }
- }
- String fText = ((String)attrValues[XSAttributeChecker.ATTIDX_XPATH]);
- if (fText == null) {
- reportSchemaError("s4s-att-must-appear", new Object [] {SchemaSymbols.ELT_FIELD, SchemaSymbols.ATT_XPATH}, fElem);
- fAttrChecker.returnAttrArray(attrValues, schemaDoc);
- return false;
- }
- fText = XMLChar.trim(fText);
- try {
- Field.XPath fXpath = new Field.XPath(fText, fSymbolTable,
- schemaDoc.fNamespaceSupport);
- Field field = new Field(fXpath, ic);
- ic.addField(field);
- }
- catch (XPathException e) {
- reportSchemaError(e.getKey(), new Object[]{fText}, fElem);
- // put back attr values...
- fAttrChecker.returnAttrArray(attrValues, schemaDoc);
- return false;
- }
- fElem = DOMUtil.getNextSiblingElement(fElem);
- // put back attr values...
- fAttrChecker.returnAttrArray(attrValues, schemaDoc);
- }
-
- return ic.getFieldCount() > 0;
- } // traverseIdentityConstraint(IdentityConstraint,Element, XSDocumentInfo)
-} // XSDAbstractIDConstraintTraverser
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAbstractParticleTraverser.java b/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAbstractParticleTraverser.java
deleted file mode 100644
index 364a94a..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAbstractParticleTraverser.java
+++ /dev/null
@@ -1,385 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.traversers;
-
-import com.sun.org.apache.xerces.internal.impl.xs.SchemaGrammar;
-import com.sun.org.apache.xerces.internal.impl.xs.SchemaSymbols;
-import com.sun.org.apache.xerces.internal.impl.xs.XSAnnotationImpl;
-import com.sun.org.apache.xerces.internal.impl.xs.XSModelGroupImpl;
-import com.sun.org.apache.xerces.internal.impl.xs.XSParticleDecl;
-import com.sun.org.apache.xerces.internal.impl.xs.util.XInt;
-import com.sun.org.apache.xerces.internal.impl.xs.util.XSObjectListImpl;
-import com.sun.org.apache.xerces.internal.util.DOMUtil;
-import com.sun.org.apache.xerces.internal.xs.XSObject;
-import com.sun.org.apache.xerces.internal.xs.XSObjectList;
-import org.w3c.dom.Element;
-
-/**
- * @xerces.internal
- *
- * @author Elena Litani, IBM
- * @author Sandy Gao, IBM
- * @version $Id: XSDAbstractParticleTraverser.java,v 1.7 2010-11-01 04:40:02 joehw Exp $
- */
-abstract class XSDAbstractParticleTraverser extends XSDAbstractTraverser {
-
- XSDAbstractParticleTraverser (XSDHandler handler,
- XSAttributeChecker gAttrCheck) {
- super(handler, gAttrCheck);
- }
-
- /**
- *
- * Traverse the "All" declaration
- *
- * &lt;all
- * id = ID
- * maxOccurs = 1 : 1
- * minOccurs = (0 | 1) : 1&gt;
- * Content: (annotation? , element*)
- * &lt;/all&gt;
- **/
- XSParticleDecl traverseAll(Element allDecl,
- XSDocumentInfo schemaDoc,
- SchemaGrammar grammar,
- int allContextFlags,
- XSObject parent) {
-
- // General Attribute Checking
-
- Object[] attrValues = fAttrChecker.checkAttributes(allDecl, false, schemaDoc);
-
- Element child = DOMUtil.getFirstChildElement(allDecl);
-
- XSAnnotationImpl annotation = null;
- if (child !=null && DOMUtil.getLocalName(child).equals(SchemaSymbols.ELT_ANNOTATION)) {
- annotation = traverseAnnotationDecl(child, attrValues, false, schemaDoc);
- child = DOMUtil.getNextSiblingElement(child);
- }
- else {
- String text = DOMUtil.getSyntheticAnnotation(allDecl);
- if (text != null) {
- annotation = traverseSyntheticAnnotation(allDecl, text, attrValues, false, schemaDoc);
- }
- }
- String childName = null;
- XSParticleDecl particle;
- fPArray.pushContext();
-
- for (; child != null; child = DOMUtil.getNextSiblingElement(child)) {
-
- particle = null;
- childName = DOMUtil.getLocalName(child);
-
- // Only elements are allowed in <all>
- if (childName.equals(SchemaSymbols.ELT_ELEMENT)) {
- particle = fSchemaHandler.fElementTraverser.traverseLocal(child, schemaDoc, grammar, PROCESSING_ALL_EL, parent);
- }
- else {
- Object[] args = {"all", "(annotation?, element*)", DOMUtil.getLocalName(child)};
- reportSchemaError("s4s-elt-must-match.1", args, child);
- }
-
- if (particle != null)
- fPArray.addParticle(particle);
- }
-
- particle = null;
- XInt minAtt = (XInt)attrValues[XSAttributeChecker.ATTIDX_MINOCCURS];
- XInt maxAtt = (XInt)attrValues[XSAttributeChecker.ATTIDX_MAXOCCURS];
- Long defaultVals = (Long)attrValues[XSAttributeChecker.ATTIDX_FROMDEFAULT];
-
- XSModelGroupImpl group = new XSModelGroupImpl();
- group.fCompositor = XSModelGroupImpl.MODELGROUP_ALL;
- group.fParticleCount = fPArray.getParticleCount();
- group.fParticles = fPArray.popContext();
- XSObjectList annotations;
- if (annotation != null) {
- annotations = new XSObjectListImpl();
- ((XSObjectListImpl)annotations).addXSObject (annotation);
- } else {
- annotations = XSObjectListImpl.EMPTY_LIST;
- }
- group.fAnnotations = annotations;
- particle = new XSParticleDecl();
- particle.fType = XSParticleDecl.PARTICLE_MODELGROUP;
- particle.fMinOccurs = minAtt.intValue();
- particle.fMaxOccurs = maxAtt.intValue();
- particle.fValue = group;
- particle.fAnnotations = annotations;
-
- particle = checkOccurrences(particle,
- SchemaSymbols.ELT_ALL,
- (Element)allDecl.getParentNode(),
- allContextFlags,
- defaultVals.longValue());
- fAttrChecker.returnAttrArray(attrValues, schemaDoc);
-
- return particle;
- }
-
- /**
- * Traverse the Sequence declaration
- *
- * <sequence
- * id = ID
- * maxOccurs = string
- * minOccurs = nonNegativeInteger>
- * Content: (annotation? , (element | group | choice | sequence | any)*)
- * </sequence>
- *
- * @param seqDecl
- * @param schemaDoc
- * @param grammar
- * @return
- */
- XSParticleDecl traverseSequence(Element seqDecl,
- XSDocumentInfo schemaDoc,
- SchemaGrammar grammar,
- int allContextFlags,
- XSObject parent) {
-
- return traverseSeqChoice(seqDecl, schemaDoc, grammar, allContextFlags, false, parent);
- }
-
- /**
- * Traverse the Choice declaration
- *
- * <choice
- * id = ID
- * maxOccurs = string
- * minOccurs = nonNegativeInteger>
- * Content: (annotation? , (element | group | choice | sequence | any)*)
- * </choice>
- *
- * @param choiceDecl
- * @param schemaDoc
- * @param grammar
- * @return
- */
- XSParticleDecl traverseChoice(Element choiceDecl,
- XSDocumentInfo schemaDoc,
- SchemaGrammar grammar,
- int allContextFlags,
- XSObject parent) {
-
- return traverseSeqChoice (choiceDecl, schemaDoc, grammar, allContextFlags, true, parent);
- }
-
- /**
- * Common traversal for <choice> and <sequence>
- *
- * @param decl
- * @param schemaDoc
- * @param grammar
- * @param choice If traversing <choice> this parameter is true.
- * @return
- */
- private XSParticleDecl traverseSeqChoice(Element decl,
- XSDocumentInfo schemaDoc,
- SchemaGrammar grammar,
- int allContextFlags,
- boolean choice,
- XSObject parent) {
-
- // General Attribute Checking
- Object[] attrValues = fAttrChecker.checkAttributes(decl, false, schemaDoc);
-
- Element child = DOMUtil.getFirstChildElement(decl);
- XSAnnotationImpl annotation = null;
- if (child !=null && DOMUtil.getLocalName(child).equals(SchemaSymbols.ELT_ANNOTATION)) {
- annotation = traverseAnnotationDecl(child, attrValues, false, schemaDoc);
- child = DOMUtil.getNextSiblingElement(child);
- }
- else {
- String text = DOMUtil.getSyntheticAnnotation(decl);
- if (text != null) {
- annotation = traverseSyntheticAnnotation(decl, text, attrValues, false, schemaDoc);
- }
- }
-
- String childName = null;
- XSParticleDecl particle;
- fPArray.pushContext();
-
- for (;child != null;child = DOMUtil.getNextSiblingElement(child)) {
-
- particle = null;
-
- childName = DOMUtil.getLocalName(child);
- if (childName.equals(SchemaSymbols.ELT_ELEMENT)) {
- particle = fSchemaHandler.fElementTraverser.traverseLocal(child, schemaDoc, grammar, NOT_ALL_CONTEXT, parent);
- }
- else if (childName.equals(SchemaSymbols.ELT_GROUP)) {
- particle = fSchemaHandler.fGroupTraverser.traverseLocal(child, schemaDoc, grammar);
-
- // A content type of all can only appear
- // as the content type of a complex type definition.
- if (hasAllContent(particle)) {
- // don't insert the "all" particle, otherwise we won't be
- // able to create DFA from this content model
- particle = null;
- reportSchemaError("cos-all-limited.1.2", null, child);
- }
-
- }
- else if (childName.equals(SchemaSymbols.ELT_CHOICE)) {
- particle = traverseChoice(child, schemaDoc, grammar, NOT_ALL_CONTEXT, parent);
- }
- else if (childName.equals(SchemaSymbols.ELT_SEQUENCE)) {
- particle = traverseSequence(child, schemaDoc, grammar, NOT_ALL_CONTEXT, parent);
- }
- else if (childName.equals(SchemaSymbols.ELT_ANY)) {
- particle = fSchemaHandler.fWildCardTraverser.traverseAny(child, schemaDoc, grammar);
- }
- else {
- Object [] args;
- if (choice) {
- args = new Object[]{"choice", "(annotation?, (element | group | choice | sequence | any)*)", DOMUtil.getLocalName(child)};
- }
- else {
- args = new Object[]{"sequence", "(annotation?, (element | group | choice | sequence | any)*)", DOMUtil.getLocalName(child)};
- }
- reportSchemaError("s4s-elt-must-match.1", args, child);
- }
-
- if (particle != null)
- fPArray.addParticle(particle);
- }
-
- particle = null;
-
- XInt minAtt = (XInt)attrValues[XSAttributeChecker.ATTIDX_MINOCCURS];
- XInt maxAtt = (XInt)attrValues[XSAttributeChecker.ATTIDX_MAXOCCURS];
- Long defaultVals = (Long)attrValues[XSAttributeChecker.ATTIDX_FROMDEFAULT];
-
- XSModelGroupImpl group = new XSModelGroupImpl();
- group.fCompositor = choice ? XSModelGroupImpl.MODELGROUP_CHOICE : XSModelGroupImpl.MODELGROUP_SEQUENCE;
- group.fParticleCount = fPArray.getParticleCount();
- group.fParticles = fPArray.popContext();
- XSObjectList annotations;
- if (annotation != null) {
- annotations = new XSObjectListImpl();
- ((XSObjectListImpl)annotations).addXSObject (annotation);
- } else {
- annotations = XSObjectListImpl.EMPTY_LIST;
- }
- group.fAnnotations = annotations;
- particle = new XSParticleDecl();
- particle.fType = XSParticleDecl.PARTICLE_MODELGROUP;
- particle.fMinOccurs = minAtt.intValue();
- particle.fMaxOccurs = maxAtt.intValue();
- particle.fValue = group;
- particle.fAnnotations = annotations;
-
- particle = checkOccurrences(particle,
- choice ? SchemaSymbols.ELT_CHOICE : SchemaSymbols.ELT_SEQUENCE,
- (Element)decl.getParentNode(),
- allContextFlags,
- defaultVals.longValue());
- fAttrChecker.returnAttrArray(attrValues, schemaDoc);
-
- return particle;
- }
-
- // Determines whether a content spec tree represents an "all" content model
- protected boolean hasAllContent(XSParticleDecl particle) {
- // If the content is not empty, is the top node ALL?
- if (particle != null && particle.fType == XSParticleDecl.PARTICLE_MODELGROUP) {
- return ((XSModelGroupImpl)particle.fValue).fCompositor == XSModelGroupImpl.MODELGROUP_ALL;
- }
-
- return false;
- }
-
- // the inner class: used to store particles for model groups
- // to avoid creating a new Vector in each model group, or when traversing
- // each model group, we use this one big array to store all particles
- // for model groups. when the traversal finishes, this class returns an
- // XSParticleDecl[] containing all particles for the current model group.
- // it's possible that we need to traverse another model group while
- // traversing one (one inside another one; referring to a global group,
- // etc.), so we have push/pos context methods to save the same of the
- // current traversal before starting the traversal of another model group.
- protected static class ParticleArray {
- // big array to contain all particles
- XSParticleDecl[] fParticles = new XSParticleDecl[10];
- // the ending position of particles in the array for each context
- // index 0 is reserved, with value 0. index 1 is used for the fist
- // context. so that the number of particles for context 'i' can be
- // computed simply by fPos[i] - fPos[i-1].
- int[] fPos = new int[5];
- // number of contexts
- int fContextCount = 0;
-
- // start a new context (start traversing a new model group)
- void pushContext() {
- fContextCount++;
- // resize position array if necessary
- if (fContextCount == fPos.length) {
- int newSize = fContextCount * 2;
- int[] newArray = new int[newSize];
- System.arraycopy(fPos, 0, newArray, 0, fContextCount);
- fPos = newArray;
- }
- // the initial ending position of the current context is the
- // ending position of the previsous context. which means there is
- // no particle for the current context yet.
- fPos[fContextCount] = fPos[fContextCount-1];
- }
-
- // get the number of particles of this context (model group)
- int getParticleCount() {
- return fPos[fContextCount] - fPos[fContextCount-1];
- }
-
- // add a particle to the current context
- void addParticle(XSParticleDecl particle) {
- // resize the particle array if necessary
- if (fPos[fContextCount] == fParticles.length) {
- int newSize = fPos[fContextCount] * 2;
- XSParticleDecl[] newArray = new XSParticleDecl[newSize];
- System.arraycopy(fParticles, 0, newArray, 0, fPos[fContextCount]);
- fParticles = newArray;
- }
- fParticles[fPos[fContextCount]++] = particle;
- }
-
- // end the current context, and return an array of particles
- XSParticleDecl[] popContext() {
- int count = fPos[fContextCount] - fPos[fContextCount-1];
- XSParticleDecl[] array = null;
- if (count != 0) {
- array = new XSParticleDecl[count];
- System.arraycopy(fParticles, fPos[fContextCount-1], array, 0, count);
- // clear the particle array, to release memory
- for (int i = fPos[fContextCount-1]; i < fPos[fContextCount]; i++)
- fParticles[i] = null;
- }
- fContextCount--;
- return array;
- }
-
- }
-
- // the big particle array to hold all particles in model groups
- ParticleArray fPArray = new ParticleArray();
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAbstractTraverser.java b/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAbstractTraverser.java
deleted file mode 100644
index a5e97f0..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAbstractTraverser.java
+++ /dev/null
@@ -1,853 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.traversers;
-
-import java.util.Locale;
-import java.util.Vector;
-
-import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException;
-import com.sun.org.apache.xerces.internal.impl.dv.XSFacets;
-import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType;
-import com.sun.org.apache.xerces.internal.impl.validation.ValidationState;
-import com.sun.org.apache.xerces.internal.impl.xs.SchemaGrammar;
-import com.sun.org.apache.xerces.internal.impl.xs.SchemaSymbols;
-import com.sun.org.apache.xerces.internal.impl.xs.XSAnnotationImpl;
-import com.sun.org.apache.xerces.internal.impl.xs.XSAttributeGroupDecl;
-import com.sun.org.apache.xerces.internal.impl.xs.XSAttributeUseImpl;
-import com.sun.org.apache.xerces.internal.impl.xs.XSComplexTypeDecl;
-import com.sun.org.apache.xerces.internal.impl.xs.XSElementDecl;
-import com.sun.org.apache.xerces.internal.impl.xs.XSParticleDecl;
-import com.sun.org.apache.xerces.internal.impl.xs.XSWildcardDecl;
-import com.sun.org.apache.xerces.internal.impl.xs.util.XInt;
-import com.sun.org.apache.xerces.internal.impl.xs.util.XSObjectListImpl;
-import com.sun.org.apache.xerces.internal.util.DOMUtil;
-import com.sun.org.apache.xerces.internal.util.NamespaceSupport;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xs.XSAttributeUse;
-import com.sun.org.apache.xerces.internal.xs.XSObjectList;
-import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
-import org.w3c.dom.Element;
-
-/**
- * Class <code>XSDAbstractTraverser</code> serves as the base class for all
- * other <code>XSD???Traverser</code>s. It holds the common data and provide
- * a unified way to initialize these data.
- *
- * @xerces.internal
- *
- * @author Elena Litani, IBM
- * @author Rahul Srivastava, Sun Microsystems Inc.
- * @author Neeraj Bajaj, Sun Microsystems Inc.
- *
- * @version $Id: XSDAbstractTraverser.java,v 1.8 2010-11-01 04:40:02 joehw Exp $
- */
-abstract class XSDAbstractTraverser {
-
- protected static final String NO_NAME = "(no name)";
-
- // Flags for checkOccurrences to indicate any special
- // restrictions on minOccurs and maxOccurs relating to "all".
- // NOT_ALL_CONTEXT - not processing an <all>
- // PROCESSING_ALL_EL - processing an <element> in an <all>
- // GROUP_REF_WITH_ALL - processing <group> reference that contained <all>
- // CHILD_OF_GROUP - processing a child of a model group definition
- // PROCESSING_ALL_GP - processing an <all> group itself
-
- protected static final int NOT_ALL_CONTEXT = 0;
- protected static final int PROCESSING_ALL_EL = 1;
- protected static final int GROUP_REF_WITH_ALL = 2;
- protected static final int CHILD_OF_GROUP = 4;
- protected static final int PROCESSING_ALL_GP = 8;
-
- //Shared data
- protected XSDHandler fSchemaHandler = null;
- protected SymbolTable fSymbolTable = null;
- protected XSAttributeChecker fAttrChecker = null;
- protected boolean fValidateAnnotations = false;
-
- // used to validate default/fixed attribute values
- ValidationState fValidationState = new ValidationState();
-
- XSDAbstractTraverser (XSDHandler handler,
- XSAttributeChecker attrChecker) {
- fSchemaHandler = handler;
- fAttrChecker = attrChecker;
- }
-
- void reset(SymbolTable symbolTable, boolean validateAnnotations, Locale locale) {
- fSymbolTable = symbolTable;
- fValidateAnnotations = validateAnnotations;
- fValidationState.setExtraChecking(false);
- fValidationState.setSymbolTable(symbolTable);
- fValidationState.setLocale(locale);
- }
-
- // traverse the annotation declaration
- // REVISIT: how to pass the parentAttrs? as DOM attributes?
- // as name/value pairs (string)? in parsed form?
- // @return XSAnnotationImpl object
- XSAnnotationImpl traverseAnnotationDecl(Element annotationDecl, Object[] parentAttrs,
- boolean isGlobal, XSDocumentInfo schemaDoc) {
- // General Attribute Checking
- Object[] attrValues = fAttrChecker.checkAttributes(annotationDecl, isGlobal, schemaDoc);
- fAttrChecker.returnAttrArray(attrValues, schemaDoc);
-
- String contents = DOMUtil.getAnnotation(annotationDecl);
- Element child = DOMUtil.getFirstChildElement(annotationDecl);
- if (child != null) {
- do {
- String name = DOMUtil.getLocalName(child);
-
- // the only valid children of "annotation" are
- // "appinfo" and "documentation"
- if (!((name.equals(SchemaSymbols.ELT_APPINFO)) ||
- (name.equals(SchemaSymbols.ELT_DOCUMENTATION)))) {
- reportSchemaError("src-annotation", new Object[]{name}, child);
- }
- else {
- // General Attribute Checking
- // There is no difference between global or local appinfo/documentation,
- // so we assume it's always global.
- attrValues = fAttrChecker.checkAttributes(child, true, schemaDoc);
- fAttrChecker.returnAttrArray(attrValues, schemaDoc);
- }
-
- child = DOMUtil.getNextSiblingElement(child);
- }
- while (child != null);
- }
- // if contents was null, must have been some kind of error;
- // nothing to contribute to PSVI
- if (contents == null) return null;
-
- // find the grammar; fSchemaHandler must be known!
- SchemaGrammar grammar = fSchemaHandler.getGrammar(schemaDoc.fTargetNamespace);
- // fish out local attributes passed from parent
- Vector annotationLocalAttrs = (Vector)parentAttrs[XSAttributeChecker.ATTIDX_NONSCHEMA];
- // optimize for case where there are no local attributes
- if(annotationLocalAttrs != null && !annotationLocalAttrs.isEmpty()) {
- StringBuffer localStrBuffer = new StringBuffer(64);
- localStrBuffer.append(" ");
- // Vector should contain rawname value pairs
- int i = 0;
- while (i < annotationLocalAttrs.size()) {
- String rawname = (String)annotationLocalAttrs.elementAt(i++);
- int colonIndex = rawname.indexOf(':');
- String prefix, localpart;
- if (colonIndex == -1) {
- prefix = "";
- localpart = rawname;
- }
- else {
- prefix = rawname.substring(0,colonIndex);
- localpart = rawname.substring(colonIndex+1);
- }
- String uri = schemaDoc.fNamespaceSupport.getURI(fSymbolTable.addSymbol(prefix));
- if (annotationDecl.getAttributeNS(uri, localpart).length() != 0) {
- i++; // skip the next value, too
- continue;
- }
- localStrBuffer.append(rawname)
- .append("=\"");
- String value = (String)annotationLocalAttrs.elementAt(i++);
- // search for pesky "s and <s within attr value:
- value = processAttValue(value);
- localStrBuffer.append(value)
- .append("\" ");
- }
- // and now splice it into place; immediately after the annotation token, for simplicity's sake
- StringBuffer contentBuffer = new StringBuffer(contents.length() + localStrBuffer.length());
- int annotationTokenEnd = contents.indexOf(SchemaSymbols.ELT_ANNOTATION);
- // annotation must occur somewhere or we're in big trouble...
- if(annotationTokenEnd == -1) return null;
- annotationTokenEnd += SchemaSymbols.ELT_ANNOTATION.length();
- contentBuffer.append(contents.substring(0,annotationTokenEnd));
- contentBuffer.append(localStrBuffer.toString());
- contentBuffer.append(contents.substring(annotationTokenEnd, contents.length()));
- final String annotation = contentBuffer.toString();
- if (fValidateAnnotations) {
- schemaDoc.addAnnotation(new XSAnnotationInfo(annotation, annotationDecl));
- }
- return new XSAnnotationImpl(annotation, grammar);
- } else {
- if (fValidateAnnotations) {
- schemaDoc.addAnnotation(new XSAnnotationInfo(contents, annotationDecl));
- }
- return new XSAnnotationImpl(contents, grammar);
- }
-
- }
-
- XSAnnotationImpl traverseSyntheticAnnotation(Element annotationParent, String initialContent,
- Object[] parentAttrs, boolean isGlobal, XSDocumentInfo schemaDoc) {
-
- String contents = initialContent;
-
- // find the grammar; fSchemaHandler must be known!
- SchemaGrammar grammar = fSchemaHandler.getGrammar(schemaDoc.fTargetNamespace);
- // fish out local attributes passed from parent
- Vector annotationLocalAttrs = (Vector)parentAttrs[XSAttributeChecker.ATTIDX_NONSCHEMA];
- // optimize for case where there are no local attributes
- if (annotationLocalAttrs != null && !annotationLocalAttrs.isEmpty()) {
- StringBuffer localStrBuffer = new StringBuffer(64);
- localStrBuffer.append(" ");
- // Vector should contain rawname value pairs
- int i = 0;
- while (i < annotationLocalAttrs.size()) {
- String rawname = (String)annotationLocalAttrs.elementAt(i++);
- int colonIndex = rawname.indexOf(':');
- String prefix, localpart;
- if (colonIndex == -1) {
- prefix = "";
- localpart = rawname;
- }
- else {
- prefix = rawname.substring(0,colonIndex);
- localpart = rawname.substring(colonIndex+1);
- }
- String uri = schemaDoc.fNamespaceSupport.getURI(fSymbolTable.addSymbol(prefix));
- localStrBuffer.append(rawname)
- .append("=\"");
- String value = (String)annotationLocalAttrs.elementAt(i++);
- // search for pesky "s and <s within attr value:
- value = processAttValue(value);
- localStrBuffer.append(value)
- .append("\" ");
- }
- // and now splice it into place; immediately after the annotation token, for simplicity's sake
- StringBuffer contentBuffer = new StringBuffer(contents.length() + localStrBuffer.length());
- int annotationTokenEnd = contents.indexOf(SchemaSymbols.ELT_ANNOTATION);
- // annotation must occur somewhere or we're in big trouble...
- if(annotationTokenEnd == -1) return null;
- annotationTokenEnd += SchemaSymbols.ELT_ANNOTATION.length();
- contentBuffer.append(contents.substring(0,annotationTokenEnd));
- contentBuffer.append(localStrBuffer.toString());
- contentBuffer.append(contents.substring(annotationTokenEnd, contents.length()));
- final String annotation = contentBuffer.toString();
- if (fValidateAnnotations) {
- schemaDoc.addAnnotation(new XSAnnotationInfo(annotation, annotationParent));
- }
- return new XSAnnotationImpl(annotation, grammar);
- } else {
- if (fValidateAnnotations) {
- schemaDoc.addAnnotation(new XSAnnotationInfo(contents, annotationParent));
- }
- return new XSAnnotationImpl(contents, grammar);
- }
- }
-
- // the QName simple type used to resolve qnames
- private static final XSSimpleType fQNameDV = (XSSimpleType)SchemaGrammar.SG_SchemaNS.getGlobalTypeDecl(SchemaSymbols.ATTVAL_QNAME);
- // Temp data structures to be re-used in traversing facets
- private StringBuffer fPattern = new StringBuffer();
- private final XSFacets xsFacets = new XSFacets();
-
- static final class FacetInfo {
-
- final XSFacets facetdata;
- final Element nodeAfterFacets;
- final short fPresentFacets;
- final short fFixedFacets;
-
- FacetInfo(XSFacets facets, Element nodeAfterFacets, short presentFacets, short fixedFacets) {
- facetdata = facets;
- this.nodeAfterFacets = nodeAfterFacets;
- fPresentFacets = presentFacets;
- fFixedFacets = fixedFacets;
- }
- }
-
- FacetInfo traverseFacets(Element content,
- XSSimpleType baseValidator,
- XSDocumentInfo schemaDoc) {
-
- short facetsPresent = 0 ;
- short facetsFixed = 0; // facets that have fixed="true"
- String facet;
- boolean hasQName = containsQName(baseValidator);
- Vector enumData = null;
- XSObjectListImpl enumAnnotations = null;
- XSObjectListImpl patternAnnotations = null;
- Vector enumNSDecls = hasQName ? new Vector() : null;
- int currentFacet = 0;
- xsFacets.reset();
- while (content != null) {
- // General Attribute Checking
- Object[] attrs = null;
- facet = DOMUtil.getLocalName(content);
- if (facet.equals(SchemaSymbols.ELT_ENUMERATION)) {
- attrs = fAttrChecker.checkAttributes(content, false, schemaDoc, hasQName);
- String enumVal = (String)attrs[XSAttributeChecker.ATTIDX_VALUE];
- // The facet can't be used if the value is missing. Ignore
- // this facet element.
- if (enumVal == null) {
- reportSchemaError("s4s-att-must-appear", new Object[]{SchemaSymbols.ELT_ENUMERATION, SchemaSymbols.ATT_VALUE}, content);
- fAttrChecker.returnAttrArray (attrs, schemaDoc);
- content = DOMUtil.getNextSiblingElement(content);
- continue;
- }
-
- NamespaceSupport nsDecls = (NamespaceSupport)attrs[XSAttributeChecker.ATTIDX_ENUMNSDECLS];
-
- // for NOTATION types, need to check whether there is a notation
- // declared with the same name as the enumeration value.
- if (baseValidator.getVariety() == XSSimpleType.VARIETY_ATOMIC &&
- baseValidator.getPrimitiveKind() == XSSimpleType.PRIMITIVE_NOTATION) {
- // need to use the namespace context returned from checkAttributes
- schemaDoc.fValidationContext.setNamespaceSupport(nsDecls);
- Object notation = null;
- try{
- QName temp = (QName)fQNameDV.validate(enumVal, schemaDoc.fValidationContext, null);
- // try to get the notation decl. if failed, getGlobalDecl
- // reports an error, so we don't need to report one again.
- notation = fSchemaHandler.getGlobalDecl(schemaDoc, XSDHandler.NOTATION_TYPE, temp, content);
- }catch(InvalidDatatypeValueException ex){
- reportSchemaError(ex.getKey(), ex.getArgs(), content);
- }
- if (notation == null) {
- // Either the QName value is invalid, or it doens't
- // resolve to a notation declaration.
- // Ignore this facet, to avoid instance validation problems
- fAttrChecker.returnAttrArray (attrs, schemaDoc);
- content = DOMUtil.getNextSiblingElement(content);
- continue;
- }
- // restore to the normal namespace context
- schemaDoc.fValidationContext.setNamespaceSupport(schemaDoc.fNamespaceSupport);
- }
- if (enumData == null){
- enumData = new Vector();
- enumAnnotations = new XSObjectListImpl();
- }
- enumData.addElement(enumVal);
- enumAnnotations.addXSObject(null);
- if (hasQName)
- enumNSDecls.addElement(nsDecls);
- Element child = DOMUtil.getFirstChildElement( content );
-
- if (child != null &&
- DOMUtil.getLocalName(child).equals(SchemaSymbols.ELT_ANNOTATION)) {
- // traverse annotation if any
- enumAnnotations.addXSObject(enumAnnotations.getLength()-1,traverseAnnotationDecl(child, attrs, false, schemaDoc));
- child = DOMUtil.getNextSiblingElement(child);
- }
- else {
- String text = DOMUtil.getSyntheticAnnotation(content);
- if (text != null) {
- enumAnnotations.addXSObject(enumAnnotations.getLength()-1, traverseSyntheticAnnotation(content, text, attrs, false, schemaDoc));
- }
- }
- if (child !=null) {
- reportSchemaError("s4s-elt-must-match.1", new Object[]{"enumeration", "(annotation?)", DOMUtil.getLocalName(child)}, child);
- }
- }
- else if (facet.equals(SchemaSymbols.ELT_PATTERN)) {
- facetsPresent |= XSSimpleType.FACET_PATTERN;
- attrs = fAttrChecker.checkAttributes(content, false, schemaDoc);
- String patternVal = (String)attrs[XSAttributeChecker.ATTIDX_VALUE];
- // The facet can't be used if the value is missing. Ignore
- // this facet element.
- if (patternVal == null) {
- reportSchemaError("s4s-att-must-appear", new Object[]{SchemaSymbols.ELT_PATTERN, SchemaSymbols.ATT_VALUE}, content);
- fAttrChecker.returnAttrArray (attrs, schemaDoc);
- content = DOMUtil.getNextSiblingElement(content);
- continue;
- }
-
- if (fPattern.length() == 0) {
- fPattern.append(patternVal);
- } else {
- // ---------------------------------------------
- //datatypes: 5.2.4 pattern: src-multiple-pattern
- // ---------------------------------------------
- fPattern.append("|");
- fPattern.append(patternVal);
- }
- Element child = DOMUtil.getFirstChildElement( content );
- if (child != null &&
- DOMUtil.getLocalName(child).equals(SchemaSymbols.ELT_ANNOTATION)) {
- // traverse annotation if any
- if (patternAnnotations == null){
- patternAnnotations = new XSObjectListImpl();
- }
- patternAnnotations.addXSObject(traverseAnnotationDecl(child, attrs, false, schemaDoc));
- child = DOMUtil.getNextSiblingElement(child);
- }
- else {
- String text = DOMUtil.getSyntheticAnnotation(content);
- if (text != null) {
- if (patternAnnotations == null){
- patternAnnotations = new XSObjectListImpl();
- }
- patternAnnotations.addXSObject(traverseSyntheticAnnotation(content, text, attrs, false, schemaDoc));
- }
- }
- if (child !=null) {
- reportSchemaError("s4s-elt-must-match.1", new Object[]{"pattern", "(annotation?)", DOMUtil.getLocalName(child)}, child);
- }
- }
- else {
- if (facet.equals(SchemaSymbols.ELT_MINLENGTH)) {
- currentFacet = XSSimpleType.FACET_MINLENGTH;
- }
- else if (facet.equals(SchemaSymbols.ELT_MAXLENGTH)) {
- currentFacet = XSSimpleType.FACET_MAXLENGTH;
- }
- else if (facet.equals(SchemaSymbols.ELT_MAXEXCLUSIVE)) {
- currentFacet = XSSimpleType.FACET_MAXEXCLUSIVE;
- }
- else if (facet.equals(SchemaSymbols.ELT_MAXINCLUSIVE)) {
- currentFacet = XSSimpleType.FACET_MAXINCLUSIVE;
- }
- else if (facet.equals(SchemaSymbols.ELT_MINEXCLUSIVE)) {
- currentFacet = XSSimpleType.FACET_MINEXCLUSIVE;
- }
- else if (facet.equals(SchemaSymbols.ELT_MININCLUSIVE)) {
- currentFacet = XSSimpleType.FACET_MININCLUSIVE;
- }
- else if (facet.equals(SchemaSymbols.ELT_TOTALDIGITS)) {
- currentFacet = XSSimpleType.FACET_TOTALDIGITS;
- }
- else if (facet.equals(SchemaSymbols.ELT_FRACTIONDIGITS)) {
- currentFacet = XSSimpleType.FACET_FRACTIONDIGITS;
- }
- else if (facet.equals(SchemaSymbols.ELT_WHITESPACE)) {
- currentFacet = XSSimpleType.FACET_WHITESPACE;
- }
- else if (facet.equals(SchemaSymbols.ELT_LENGTH)) {
- currentFacet = XSSimpleType.FACET_LENGTH;
- }
- else {
- break; // a non-facet
- }
-
- attrs = fAttrChecker.checkAttributes(content, false, schemaDoc);
-
- // check for duplicate facets
- if ((facetsPresent & currentFacet) != 0) {
- // Ignore this facet, to avoid corrupting the previous facet
- reportSchemaError("src-single-facet-value", new Object[]{facet}, content);
- fAttrChecker.returnAttrArray (attrs, schemaDoc);
- content = DOMUtil.getNextSiblingElement(content);
- continue;
- }
-
- // The facet can't be used if the value is missing. Ignore
- // this facet element.
- if (attrs[XSAttributeChecker.ATTIDX_VALUE] == null) {
- // Report an error if the "value" attribute is missing.
- // If it's not missing, then its value is invalid, and an
- // error should have already been reported by the
- // attribute checker.
- if (content.getAttributeNodeNS(null, "value") == null) {
- reportSchemaError("s4s-att-must-appear", new Object[]{content.getLocalName(), SchemaSymbols.ATT_VALUE}, content);
- }
- fAttrChecker.returnAttrArray (attrs, schemaDoc);
- content = DOMUtil.getNextSiblingElement(content);
- continue;
- }
-
- facetsPresent |= currentFacet;
- // check for fixed facet
- if (((Boolean)attrs[XSAttributeChecker.ATTIDX_FIXED]).booleanValue()) {
- facetsFixed |= currentFacet;
- }
- switch (currentFacet) {
- case XSSimpleType.FACET_MINLENGTH:
- xsFacets.minLength = ((XInt)attrs[XSAttributeChecker.ATTIDX_VALUE]).intValue();
- break;
- case XSSimpleType.FACET_MAXLENGTH:
- xsFacets.maxLength = ((XInt)attrs[XSAttributeChecker.ATTIDX_VALUE]).intValue();
- break;
- case XSSimpleType.FACET_MAXEXCLUSIVE:
- xsFacets.maxExclusive = (String)attrs[XSAttributeChecker.ATTIDX_VALUE];
- break;
- case XSSimpleType.FACET_MAXINCLUSIVE:
- xsFacets.maxInclusive = (String)attrs[XSAttributeChecker.ATTIDX_VALUE];
- break;
- case XSSimpleType.FACET_MINEXCLUSIVE:
- xsFacets.minExclusive = (String)attrs[XSAttributeChecker.ATTIDX_VALUE];
- break;
- case XSSimpleType.FACET_MININCLUSIVE:
- xsFacets.minInclusive = (String)attrs[XSAttributeChecker.ATTIDX_VALUE];
- break;
- case XSSimpleType.FACET_TOTALDIGITS:
- xsFacets.totalDigits = ((XInt)attrs[XSAttributeChecker.ATTIDX_VALUE]).intValue();
- break;
- case XSSimpleType.FACET_FRACTIONDIGITS:
- xsFacets.fractionDigits = ((XInt)attrs[XSAttributeChecker.ATTIDX_VALUE]).intValue();
- break;
- case XSSimpleType.FACET_WHITESPACE:
- xsFacets.whiteSpace = ((XInt)attrs[XSAttributeChecker.ATTIDX_VALUE]).shortValue();
- break;
- case XSSimpleType.FACET_LENGTH:
- xsFacets.length = ((XInt)attrs[XSAttributeChecker.ATTIDX_VALUE]).intValue();
- break;
- }
-
- Element child = DOMUtil.getFirstChildElement( content );
- XSAnnotationImpl annotation = null;
- if (child != null &&
- DOMUtil.getLocalName(child).equals(SchemaSymbols.ELT_ANNOTATION)) {
- // traverse annotation if any
- annotation = traverseAnnotationDecl(child, attrs, false, schemaDoc);
- child = DOMUtil.getNextSiblingElement(child);
- }
- else {
- String text = DOMUtil.getSyntheticAnnotation(content);
- if (text != null) {
- annotation = traverseSyntheticAnnotation(content, text, attrs, false, schemaDoc);
- }
- }
- switch (currentFacet) {
- case XSSimpleType.FACET_MINLENGTH:
- xsFacets.minLengthAnnotation = annotation;
- break;
- case XSSimpleType.FACET_MAXLENGTH:
- xsFacets.maxLengthAnnotation = annotation;
- break;
- case XSSimpleType.FACET_MAXEXCLUSIVE:
- xsFacets.maxExclusiveAnnotation = annotation;
- break;
- case XSSimpleType.FACET_MAXINCLUSIVE:
- xsFacets.maxInclusiveAnnotation = annotation;
- break;
- case XSSimpleType.FACET_MINEXCLUSIVE:
- xsFacets.minExclusiveAnnotation = annotation;
- break;
- case XSSimpleType.FACET_MININCLUSIVE:
- xsFacets.minInclusiveAnnotation = annotation;
- break;
- case XSSimpleType.FACET_TOTALDIGITS:
- xsFacets.totalDigitsAnnotation = annotation;
- break;
- case XSSimpleType.FACET_FRACTIONDIGITS:
- xsFacets.fractionDigitsAnnotation = annotation;
- break;
- case XSSimpleType.FACET_WHITESPACE:
- xsFacets.whiteSpaceAnnotation = annotation;
- break;
- case XSSimpleType.FACET_LENGTH:
- xsFacets.lengthAnnotation = annotation;
- break;
- }
- if (child != null) {
- reportSchemaError("s4s-elt-must-match.1", new Object[]{facet, "(annotation?)", DOMUtil.getLocalName(child)}, child);
- }
- }
- fAttrChecker.returnAttrArray (attrs, schemaDoc);
- content = DOMUtil.getNextSiblingElement(content);
- }
- if (enumData !=null) {
- facetsPresent |= XSSimpleType.FACET_ENUMERATION;
- xsFacets.enumeration = enumData;
- xsFacets.enumNSDecls = enumNSDecls;
- xsFacets.enumAnnotations = enumAnnotations;
- }
- if ((facetsPresent & XSSimpleType.FACET_PATTERN) != 0) {
- xsFacets.pattern = fPattern.toString();
- xsFacets.patternAnnotations = patternAnnotations;
- }
-
- fPattern.setLength(0);
-
- return new FacetInfo(xsFacets, content, facetsPresent, facetsFixed);
- }
-
-
- // return whether QName/NOTATION is part of the given type
- private boolean containsQName(XSSimpleType type) {
- if (type.getVariety() == XSSimpleType.VARIETY_ATOMIC) {
- short primitive = type.getPrimitiveKind();
- return (primitive == XSSimpleType.PRIMITIVE_QNAME ||
- primitive == XSSimpleType.PRIMITIVE_NOTATION);
- }
- else if (type.getVariety() == XSSimpleType.VARIETY_LIST) {
- return containsQName((XSSimpleType)type.getItemType());
- }
- else if (type.getVariety() == XSSimpleType.VARIETY_UNION) {
- XSObjectList members = type.getMemberTypes();
- for (int i = 0; i < members.getLength(); i++) {
- if (containsQName((XSSimpleType)members.item(i)))
- return true;
- }
- }
- return false;
- }
-
- //
- // Traverse a set of attribute and attribute group elements
- // Needed by complexType and attributeGroup traversal
- // This method will return the first non-attribute/attrgrp found
- //
- Element traverseAttrsAndAttrGrps(Element firstAttr, XSAttributeGroupDecl attrGrp,
- XSDocumentInfo schemaDoc, SchemaGrammar grammar,
- XSComplexTypeDecl enclosingCT) {
-
- Element child=null;
- XSAttributeGroupDecl tempAttrGrp = null;
- XSAttributeUseImpl tempAttrUse = null;
- XSAttributeUse otherUse = null;
- String childName;
-
- for (child=firstAttr; child!=null; child=DOMUtil.getNextSiblingElement(child)) {
- childName = DOMUtil.getLocalName(child);
- if (childName.equals(SchemaSymbols.ELT_ATTRIBUTE)) {
- tempAttrUse = fSchemaHandler.fAttributeTraverser.traverseLocal(child,
- schemaDoc,
- grammar,
- enclosingCT);
- if (tempAttrUse == null) continue;
- if (tempAttrUse.fUse == SchemaSymbols.USE_PROHIBITED) {
- attrGrp.addAttributeUse(tempAttrUse);
- continue;
- }
- otherUse = attrGrp.getAttributeUseNoProhibited(
- tempAttrUse.fAttrDecl.getNamespace(),
- tempAttrUse.fAttrDecl.getName());
- if (otherUse==null) {
- String idName = attrGrp.addAttributeUse(tempAttrUse);
- if (idName != null) {
- String code = (enclosingCT == null) ? "ag-props-correct.3" : "ct-props-correct.5";
- String name = (enclosingCT == null) ? attrGrp.fName : enclosingCT.getName();
- reportSchemaError(code, new Object[]{name, tempAttrUse.fAttrDecl.getName(), idName}, child);
- }
- }
- else if (otherUse != tempAttrUse) {
- String code = (enclosingCT == null) ? "ag-props-correct.2" : "ct-props-correct.4";
- String name = (enclosingCT == null) ? attrGrp.fName : enclosingCT.getName();
- reportSchemaError(code, new Object[]{name, tempAttrUse.fAttrDecl.getName()}, child);
- }
- }
- else if (childName.equals(SchemaSymbols.ELT_ATTRIBUTEGROUP)) {
- //REVISIT: do we need to save some state at this point??
- tempAttrGrp = fSchemaHandler.fAttributeGroupTraverser.traverseLocal(
- child, schemaDoc, grammar);
- if(tempAttrGrp == null ) continue;
- XSObjectList attrUseS = tempAttrGrp.getAttributeUses();
- XSAttributeUseImpl oneAttrUse;
- int attrCount = attrUseS.getLength();
- for (int i=0; i<attrCount; i++) {
- oneAttrUse = (XSAttributeUseImpl)attrUseS.item(i);
- if (oneAttrUse.fUse == SchemaSymbols.USE_PROHIBITED) {
- attrGrp.addAttributeUse(oneAttrUse);
- continue;
- }
- otherUse = attrGrp.getAttributeUseNoProhibited(
- oneAttrUse.fAttrDecl.getNamespace(),
- oneAttrUse.fAttrDecl.getName());
- if (otherUse==null) {
- String idName = attrGrp.addAttributeUse(oneAttrUse);
- if (idName != null) {
- String code = (enclosingCT == null) ? "ag-props-correct.3" : "ct-props-correct.5";
- String name = (enclosingCT == null) ? attrGrp.fName : enclosingCT.getName();
- reportSchemaError(code, new Object[]{name, oneAttrUse.fAttrDecl.getName(), idName}, child);
- }
- }
- else if (oneAttrUse != otherUse) {
- String code = (enclosingCT == null) ? "ag-props-correct.2" : "ct-props-correct.4";
- String name = (enclosingCT == null) ? attrGrp.fName : enclosingCT.getName();
- reportSchemaError(code, new Object[]{name, oneAttrUse.fAttrDecl.getName()}, child);
- }
- }
-
- if (tempAttrGrp.fAttributeWC != null) {
- if (attrGrp.fAttributeWC == null) {
- attrGrp.fAttributeWC = tempAttrGrp.fAttributeWC;
- }
- // perform intersection of attribute wildcard
- else {
- attrGrp.fAttributeWC = attrGrp.fAttributeWC.
- performIntersectionWith(tempAttrGrp.fAttributeWC, attrGrp.fAttributeWC.fProcessContents);
- if (attrGrp.fAttributeWC == null) {
- String code = (enclosingCT == null) ? "src-attribute_group.2" : "src-ct.4";
- String name = (enclosingCT == null) ? attrGrp.fName : enclosingCT.getName();
- reportSchemaError(code, new Object[]{name}, child);
- }
- }
- }
- }
- else
- break;
- } // for
-
- if (child != null) {
- childName = DOMUtil.getLocalName(child);
- if (childName.equals(SchemaSymbols.ELT_ANYATTRIBUTE)) {
- XSWildcardDecl tempAttrWC = fSchemaHandler.fWildCardTraverser.
- traverseAnyAttribute(child, schemaDoc, grammar);
- if (attrGrp.fAttributeWC == null) {
- attrGrp.fAttributeWC = tempAttrWC;
- }
- // perform intersection of attribute wildcard
- else {
- attrGrp.fAttributeWC = tempAttrWC.
- performIntersectionWith(attrGrp.fAttributeWC, tempAttrWC.fProcessContents);
- if (attrGrp.fAttributeWC == null) {
- String code = (enclosingCT == null) ? "src-attribute_group.2" : "src-ct.4";
- String name = (enclosingCT == null) ? attrGrp.fName : enclosingCT.getName();
- reportSchemaError(code, new Object[]{name}, child);
- }
- }
- child = DOMUtil.getNextSiblingElement(child);
- }
- }
-
- // Success
- return child;
-
- }
-
- void reportSchemaError (String key, Object[] args, Element ele) {
- fSchemaHandler.reportSchemaError(key, args, ele);
- }
-
- /**
- * Element/Attribute traversers call this method to check whether
- * the type is NOTATION without enumeration facet
- */
- void checkNotationType(String refName, XSTypeDefinition typeDecl, Element elem) {
- if (typeDecl.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE &&
- ((XSSimpleType)typeDecl).getVariety() == XSSimpleType.VARIETY_ATOMIC &&
- ((XSSimpleType)typeDecl).getPrimitiveKind() == XSSimpleType.PRIMITIVE_NOTATION) {
- if ((((XSSimpleType)typeDecl).getDefinedFacets() & XSSimpleType.FACET_ENUMERATION) == 0) {
- reportSchemaError("enumeration-required-notation", new Object[]{typeDecl.getName(), refName, DOMUtil.getLocalName(elem)}, elem);
- }
- }
- }
-
- // Checks constraints for minOccurs, maxOccurs
- protected XSParticleDecl checkOccurrences(XSParticleDecl particle,
- String particleName, Element parent,
- int allContextFlags,
- long defaultVals) {
-
- int min = particle.fMinOccurs;
- int max = particle.fMaxOccurs;
- boolean defaultMin = (defaultVals & (1 << XSAttributeChecker.ATTIDX_MINOCCURS)) != 0;
- boolean defaultMax = (defaultVals & (1 << XSAttributeChecker.ATTIDX_MAXOCCURS)) != 0;
-
- boolean processingAllEl = ((allContextFlags & PROCESSING_ALL_EL) != 0);
- boolean processingAllGP = ((allContextFlags & PROCESSING_ALL_GP) != 0);
- boolean groupRefWithAll = ((allContextFlags & GROUP_REF_WITH_ALL) != 0);
- boolean isGroupChild = ((allContextFlags & CHILD_OF_GROUP) != 0);
-
- // Neither minOccurs nor maxOccurs may be specified
- // for the child of a model group definition.
- if (isGroupChild) {
- if (!defaultMin) {
- Object[] args = new Object[]{particleName, "minOccurs"};
- reportSchemaError("s4s-att-not-allowed", args, parent);
- min = 1;
- }
- if (!defaultMax) {
- Object[] args = new Object[]{particleName, "maxOccurs"};
- reportSchemaError("s4s-att-not-allowed", args, parent);
- max = 1;
- }
- }
-
- // If minOccurs=maxOccurs=0, no component is specified
- if (min == 0 && max== 0) {
- particle.fType = XSParticleDecl.PARTICLE_EMPTY;
- return null;
- }
-
- // For the elements referenced in an <all>, minOccurs attribute
- // must be zero or one, and maxOccurs attribute must be one.
- // For a complex type definition that contains an <all> or a
- // reference a <group> whose model group is an all model group,
- // minOccurs and maxOccurs must be one.
- if (processingAllEl) {
- if (max != 1) {
- reportSchemaError("cos-all-limited.2", new Object[]{
- (max == SchemaSymbols.OCCURRENCE_UNBOUNDED) ? SchemaSymbols.ATTVAL_UNBOUNDED : Integer.toString(max),
- ((XSElementDecl)particle.fValue).getName()}, parent);
- max = 1;
- if (min > 1)
- min = 1;
- }
- }
- else if (processingAllGP || groupRefWithAll) {
- if (max != 1) {
- reportSchemaError("cos-all-limited.1.2", null, parent);
- if (min > 1)
- min = 1;
- max = 1;
- }
- }
-
- particle.fMinOccurs = min;
- particle.fMaxOccurs = max;
-
- return particle;
- }
-
- private static String processAttValue(String original) {
- final int length = original.length();
- // normally, nothing will happen
- for (int i = 0; i < length; ++i) {
- char currChar = original.charAt(i);
- if (currChar == '"' || currChar == '<' || currChar == '&' ||
- currChar == 0x09 || currChar == 0x0A || currChar == 0x0D) {
- return escapeAttValue(original, i);
- }
- }
- return original;
- }
-
- // this is not terribly performant!
- private static String escapeAttValue(String original, int from) {
- int i;
- final int length = original.length();
- StringBuffer newVal = new StringBuffer(length);
- newVal.append(original.substring(0, from));
- for (i = from; i < length; ++i) {
- char currChar = original.charAt(i);
- if (currChar == '"') {
- newVal.append("&quot;");
- }
- else if (currChar == '<') {
- newVal.append("&lt;");
- }
- else if (currChar == '&') {
- newVal.append("&amp;");
- }
- // Must escape 0x09, 0x0A and 0x0D if they appear in attribute
- // value so that they may be round-tripped. They would otherwise
- // be transformed to a 0x20 during attribute value normalization.
- else if (currChar == 0x09) {
- newVal.append("&#x9;");
- }
- else if (currChar == 0x0A) {
- newVal.append("&#xA;");
- }
- else if (currChar == 0x0D) {
- newVal.append("&#xD;");
- }
- else {
- newVal.append(currChar);
- }
- }
- return newVal.toString();
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAttributeGroupTraverser.java b/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAttributeGroupTraverser.java
deleted file mode 100644
index 0e12670..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAttributeGroupTraverser.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xerces.internal.impl.xs.traversers;
-
-import com.sun.org.apache.xerces.internal.impl.xs.SchemaGrammar;
-import com.sun.org.apache.xerces.internal.impl.xs.SchemaSymbols;
-import com.sun.org.apache.xerces.internal.impl.xs.XSAnnotationImpl;
-import com.sun.org.apache.xerces.internal.impl.xs.XSAttributeGroupDecl;
-import com.sun.org.apache.xerces.internal.impl.xs.util.XSObjectListImpl;
-import com.sun.org.apache.xerces.internal.util.DOMUtil;
-import com.sun.org.apache.xerces.internal.util.XMLSymbols;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xs.XSObjectList;
-import org.w3c.dom.Element;
-
-/**
- * The attribute group definition schema component traverser.
- *
- * <attributeGroup
- * id = ID
- * name = NCName
- * ref = QName
- * {any attributes with non-schema namespace . . .}>
- * Content: (annotation?, ((attribute | attributeGroup)*, anyAttribute?))
- * </attributeGroup>
- *
- * @xerces.internal
- *
- * @author Rahul Srivastava, Sun Microsystems Inc.
- * @author Sandy Gao, IBM
- *
- * @version $Id: XSDAttributeGroupTraverser.java,v 1.7 2010-11-01 04:40:02 joehw Exp $
- */
-class XSDAttributeGroupTraverser extends XSDAbstractTraverser {
-
- XSDAttributeGroupTraverser (XSDHandler handler,
- XSAttributeChecker gAttrCheck) {
-
- super(handler, gAttrCheck);
- }
-
-
- XSAttributeGroupDecl traverseLocal(Element elmNode,
- XSDocumentInfo schemaDoc,
- SchemaGrammar grammar) {
-
- // General Attribute Checking for elmNode declared locally
- Object[] attrValues = fAttrChecker.checkAttributes(elmNode, false, schemaDoc);
-
- // get attribute
- QName refAttr = (QName) attrValues[XSAttributeChecker.ATTIDX_REF];
-
- XSAttributeGroupDecl attrGrp = null;
-
- // ref should be here.
- if (refAttr == null) {
- reportSchemaError("s4s-att-must-appear", new Object[]{"attributeGroup (local)", "ref"}, elmNode);
- fAttrChecker.returnAttrArray(attrValues, schemaDoc);
- return null;
- }
-
- // get global decl
- attrGrp = (XSAttributeGroupDecl)fSchemaHandler.getGlobalDecl(schemaDoc, XSDHandler.ATTRIBUTEGROUP_TYPE, refAttr, elmNode);
-
- // no children are allowed here except annotation, which is optional.
- Element child = DOMUtil.getFirstChildElement(elmNode);
- if (child != null) {
- String childName = DOMUtil.getLocalName(child);
- if (childName.equals(SchemaSymbols.ELT_ANNOTATION)) {
- traverseAnnotationDecl(child, attrValues, false, schemaDoc);
- child = DOMUtil.getNextSiblingElement(child);
- } else {
- String text = DOMUtil.getSyntheticAnnotation(child);
- if (text != null) {
- traverseSyntheticAnnotation(child, text, attrValues, false, schemaDoc);
- }
- }
-
- if (child != null) {
- Object[] args = new Object [] {refAttr.rawname, "(annotation?)", DOMUtil.getLocalName(child)};
- reportSchemaError("s4s-elt-must-match.1", args, child);
- }
- } // if
-
- fAttrChecker.returnAttrArray(attrValues, schemaDoc);
- return attrGrp;
-
- } // traverseLocal
-
- XSAttributeGroupDecl traverseGlobal(Element elmNode,
- XSDocumentInfo schemaDoc,
- SchemaGrammar grammar) {
-
- XSAttributeGroupDecl attrGrp = new XSAttributeGroupDecl();
-
- // General Attribute Checking for elmNode declared globally
- Object[] attrValues = fAttrChecker.checkAttributes(elmNode, true, schemaDoc);
-
- String nameAttr = (String) attrValues[XSAttributeChecker.ATTIDX_NAME];
-
- // global declaration must have a name
- if (nameAttr == null) {
- reportSchemaError("s4s-att-must-appear", new Object[]{"attributeGroup (global)", "name"}, elmNode);
- nameAttr = NO_NAME;
- }
-
- attrGrp.fName = nameAttr;
- attrGrp.fTargetNamespace = schemaDoc.fTargetNamespace;
-
- // check the content
- Element child = DOMUtil.getFirstChildElement(elmNode);
- XSAnnotationImpl annotation = null;
-
- if (child!=null && DOMUtil.getLocalName(child).equals(SchemaSymbols.ELT_ANNOTATION)) {
- annotation = traverseAnnotationDecl(child, attrValues, false, schemaDoc);
- child = DOMUtil.getNextSiblingElement(child);
- }
- else {
- String text = DOMUtil.getSyntheticAnnotation(elmNode);
- if (text != null) {
- annotation = traverseSyntheticAnnotation(elmNode, text, attrValues, false, schemaDoc);
- }
- }
-
- // Traverse the attribute and attribute group elements and fill in the
- // attributeGroup structure
-
- Element nextNode = traverseAttrsAndAttrGrps(child, attrGrp, schemaDoc, grammar, null);
- if (nextNode!=null) {
- // An invalid element was found...
- Object[] args = new Object [] {nameAttr, "(annotation?, ((attribute | attributeGroup)*, anyAttribute?))", DOMUtil.getLocalName(nextNode)};
- reportSchemaError("s4s-elt-must-match.1", args, nextNode);
- }
-
- if (nameAttr.equals(NO_NAME)) {
- // if a global group doesn't have a name, then don't add it.
- fAttrChecker.returnAttrArray(attrValues, schemaDoc);
- return null;
- }
-
- // Remove prohibited attributes from the set
- attrGrp.removeProhibitedAttrs();
-
- // check for restricted redefine:
- XSAttributeGroupDecl redefinedAttrGrp = (XSAttributeGroupDecl)fSchemaHandler.getGrpOrAttrGrpRedefinedByRestriction(
- XSDHandler.ATTRIBUTEGROUP_TYPE,
- new QName(XMLSymbols.EMPTY_STRING, nameAttr, nameAttr, schemaDoc.fTargetNamespace),
- schemaDoc, elmNode);
- if(redefinedAttrGrp != null) {
- Object[] errArgs = attrGrp.validRestrictionOf(nameAttr, redefinedAttrGrp);
- if (errArgs != null) {
- reportSchemaError((String)errArgs[errArgs.length-1], errArgs, child);
- reportSchemaError("src-redefine.7.2.2", new Object [] {nameAttr, errArgs[errArgs.length-1]}, child);
- }
- }
-
- XSObjectList annotations;
- if (annotation != null) {
- annotations = new XSObjectListImpl();
- ((XSObjectListImpl)annotations).addXSObject (annotation);
- } else {
- annotations = XSObjectListImpl.EMPTY_LIST;
- }
-
- attrGrp.fAnnotations = annotations;
-
- // make an entry in global declarations.
- if (grammar.getGlobalAttributeGroupDecl(attrGrp.fName) == null) {
- grammar.addGlobalAttributeGroupDecl(attrGrp);
- }
-
- // also add it to extended map
- final String loc = fSchemaHandler.schemaDocument2SystemId(schemaDoc);
- final XSAttributeGroupDecl attrGrp2 = grammar.getGlobalAttributeGroupDecl(attrGrp.fName, loc);
- if (attrGrp2 == null) {
- grammar.addGlobalAttributeGroupDecl(attrGrp, loc);
- }
-
- // handle duplicates
- if (fSchemaHandler.fTolerateDuplicates) {
- if (attrGrp2 != null) {
- attrGrp = attrGrp2;
- }
- fSchemaHandler.addGlobalAttributeGroupDecl(attrGrp);
- }
-
- fAttrChecker.returnAttrArray(attrValues, schemaDoc);
- return attrGrp;
-
- } // traverseGlobal
-
-} // XSDAttributeGroupTraverser
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAttributeTraverser.java b/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAttributeTraverser.java
deleted file mode 100644
index 0aa0b32..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAttributeTraverser.java
+++ /dev/null
@@ -1,488 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.traversers;
-
-import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException;
-import com.sun.org.apache.xerces.internal.impl.dv.ValidatedInfo;
-import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType;
-import com.sun.org.apache.xerces.internal.impl.xs.SchemaGrammar;
-import com.sun.org.apache.xerces.internal.impl.xs.SchemaSymbols;
-import com.sun.org.apache.xerces.internal.impl.xs.XSAnnotationImpl;
-import com.sun.org.apache.xerces.internal.impl.xs.XSAttributeDecl;
-import com.sun.org.apache.xerces.internal.impl.xs.XSAttributeUseImpl;
-import com.sun.org.apache.xerces.internal.impl.xs.XSComplexTypeDecl;
-import com.sun.org.apache.xerces.internal.impl.xs.util.XInt;
-import com.sun.org.apache.xerces.internal.impl.xs.util.XSObjectListImpl;
-import com.sun.org.apache.xerces.internal.util.DOMUtil;
-import com.sun.org.apache.xerces.internal.util.XMLSymbols;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xs.XSConstants;
-import com.sun.org.apache.xerces.internal.xs.XSObjectList;
-import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
-import org.w3c.dom.Element;
-
-/**
- * The attribute declaration schema component traverser.
- *
- * <attribute
- * default = string
- * fixed = string
- * form = (qualified | unqualified)
- * id = ID
- * name = NCName
- * ref = QName
- * type = QName
- * use = (optional | prohibited | required) : optional
- * {any attributes with non-schema namespace . . .}>
- * Content: (annotation?, (simpleType?))
- * </attribute>
- *
- * @xerces.internal
- *
- * @author Sandy Gao, IBM
- * @author Neeraj Bajaj, Sun Microsystems, inc.
- * @version $Id: XSDAttributeTraverser.java,v 1.7 2010-11-01 04:40:02 joehw Exp $
- */
-class XSDAttributeTraverser extends XSDAbstractTraverser {
-
- public XSDAttributeTraverser (XSDHandler handler,
- XSAttributeChecker gAttrCheck) {
- super(handler, gAttrCheck);
- }
-
- protected XSAttributeUseImpl traverseLocal(Element attrDecl,
- XSDocumentInfo schemaDoc,
- SchemaGrammar grammar,
- XSComplexTypeDecl enclosingCT) {
-
- // General Attribute Checking
- Object[] attrValues = fAttrChecker.checkAttributes(attrDecl, false, schemaDoc);
-
- String defaultAtt = (String) attrValues[XSAttributeChecker.ATTIDX_DEFAULT];
- String fixedAtt = (String) attrValues[XSAttributeChecker.ATTIDX_FIXED];
- String nameAtt = (String) attrValues[XSAttributeChecker.ATTIDX_NAME];
- QName refAtt = (QName) attrValues[XSAttributeChecker.ATTIDX_REF];
- XInt useAtt = (XInt) attrValues[XSAttributeChecker.ATTIDX_USE];
-
- // get 'attribute declaration'
- XSAttributeDecl attribute = null;
- XSAnnotationImpl annotation = null;
- if (attrDecl.getAttributeNode(SchemaSymbols.ATT_REF) != null) {
- if (refAtt != null) {
- attribute = (XSAttributeDecl)fSchemaHandler.getGlobalDecl(schemaDoc, XSDHandler.ATTRIBUTE_TYPE, refAtt, attrDecl);
-
- Element child = DOMUtil.getFirstChildElement(attrDecl);
- if (child != null && DOMUtil.getLocalName(child).equals(SchemaSymbols.ELT_ANNOTATION)) {
- annotation = traverseAnnotationDecl(child, attrValues, false, schemaDoc);
- child = DOMUtil.getNextSiblingElement(child);
- }
- else {
- String text = DOMUtil.getSyntheticAnnotation(attrDecl);
- if (text != null) {
- annotation = traverseSyntheticAnnotation(attrDecl, text, attrValues, false, schemaDoc);
- }
- }
-
- if (child != null) {
- reportSchemaError("src-attribute.3.2", new Object[]{refAtt.rawname}, child);
- }
- // for error reporting
- nameAtt = refAtt.localpart;
- } else {
- attribute = null;
- }
- } else {
- attribute = traverseNamedAttr(attrDecl, attrValues, schemaDoc, grammar, false, enclosingCT);
- }
-
- // get 'value constraint'
- short consType = XSConstants.VC_NONE;
- if (defaultAtt != null) {
- consType = XSConstants.VC_DEFAULT;
- } else if (fixedAtt != null) {
- consType = XSConstants.VC_FIXED;
- defaultAtt = fixedAtt;
- fixedAtt = null;
- }
-
- XSAttributeUseImpl attrUse = null;
- if (attribute != null) {
- if (fSchemaHandler.fDeclPool !=null) {
- attrUse = fSchemaHandler.fDeclPool.getAttributeUse();
- } else {
- attrUse = new XSAttributeUseImpl();
- }
- attrUse.fAttrDecl = attribute;
- attrUse.fUse = useAtt.shortValue();
- attrUse.fConstraintType = consType;
- if (defaultAtt != null) {
- attrUse.fDefault = new ValidatedInfo();
- attrUse.fDefault.normalizedValue = defaultAtt;
- }
- // Get the annotation associated witht the local attr decl
- if (attrDecl.getAttributeNode(SchemaSymbols.ATT_REF) == null) {
- attrUse.fAnnotations = attribute.getAnnotations();
- } else {
- XSObjectList annotations;
- if (annotation != null) {
- annotations = new XSObjectListImpl();
- ((XSObjectListImpl) annotations).addXSObject(annotation);
- } else {
- annotations = XSObjectListImpl.EMPTY_LIST;
- }
- attrUse.fAnnotations = annotations;
- }
- }
-
- //src-attribute
-
- // 1 default and fixed must not both be present.
- if (defaultAtt != null && fixedAtt != null) {
- reportSchemaError("src-attribute.1", new Object[]{nameAtt}, attrDecl);
- }
-
- // 2 If default and use are both present, use must have the actual value optional.
- if (consType == XSConstants.VC_DEFAULT &&
- useAtt != null && useAtt.intValue() != SchemaSymbols.USE_OPTIONAL) {
- reportSchemaError("src-attribute.2", new Object[]{nameAtt}, attrDecl);
- // Recover by honouring the default value
- attrUse.fUse = SchemaSymbols.USE_OPTIONAL;
- }
-
- // a-props-correct
-
- if (defaultAtt != null && attrUse != null) {
- // 2 if there is a {value constraint}, the canonical lexical representation of its value must be valid with respect to the {type definition} as defined in String Valid (3.14.4).
- fValidationState.setNamespaceSupport(schemaDoc.fNamespaceSupport);
- try {
- checkDefaultValid(attrUse);
- }
- catch (InvalidDatatypeValueException ide) {
- reportSchemaError (ide.getKey(), ide.getArgs(), attrDecl);
- reportSchemaError ("a-props-correct.2", new Object[]{nameAtt, defaultAtt}, attrDecl);
- // Recover by removing the default value
- attrUse.fDefault = null;
- attrUse.fConstraintType = XSConstants.VC_NONE;
- }
-
- // 3 If the {type definition} is or is derived from ID then there must not be a {value constraint}.
- if (((XSSimpleType)attribute.getTypeDefinition()).isIDType() ) {
- reportSchemaError ("a-props-correct.3", new Object[]{nameAtt}, attrDecl);
- // Recover by removing the default value
- attrUse.fDefault = null;
- attrUse.fConstraintType = XSConstants.VC_NONE;
- }
-
- // check 3.5.6 constraint
- // Attribute Use Correct
- // 2 If the {attribute declaration} has a fixed {value constraint}, then if the attribute use itself has a {value constraint}, it must also be fixed and its value must match that of the {attribute declaration}'s {value constraint}.
- if (attrUse.fAttrDecl.getConstraintType() == XSConstants.VC_FIXED &&
- attrUse.fConstraintType != XSConstants.VC_NONE) {
- if (attrUse.fConstraintType != XSConstants.VC_FIXED ||
- !attrUse.fAttrDecl.getValInfo().actualValue.equals(attrUse.fDefault.actualValue)) {
- reportSchemaError ("au-props-correct.2", new Object[]{nameAtt, attrUse.fAttrDecl.getValInfo().stringValue()}, attrDecl);
- // Recover by using the decl's {value constraint}
- attrUse.fDefault = attrUse.fAttrDecl.getValInfo();
- attrUse.fConstraintType = XSConstants.VC_FIXED;
- }
- }
- }
-
- fAttrChecker.returnAttrArray(attrValues, schemaDoc);
- return attrUse;
- }
-
- protected XSAttributeDecl traverseGlobal(Element attrDecl,
- XSDocumentInfo schemaDoc,
- SchemaGrammar grammar) {
-
- // General Attribute Checking
- Object[] attrValues = fAttrChecker.checkAttributes(attrDecl, true, schemaDoc);
- XSAttributeDecl attribute = traverseNamedAttr(attrDecl, attrValues, schemaDoc, grammar, true, null);
- fAttrChecker.returnAttrArray(attrValues, schemaDoc);
- return attribute;
-
- }
-
- /**
- * Traverse a globally declared attribute.
- *
- * @param attrDecl
- * @param attrValues
- * @param schemaDoc
- * @param grammar
- * @param isGlobal
- * @return the attribute declaration index
- */
- XSAttributeDecl traverseNamedAttr(Element attrDecl,
- Object[] attrValues,
- XSDocumentInfo schemaDoc,
- SchemaGrammar grammar,
- boolean isGlobal,
- XSComplexTypeDecl enclosingCT) {
-
- String defaultAtt = (String) attrValues[XSAttributeChecker.ATTIDX_DEFAULT];
- String fixedAtt = (String) attrValues[XSAttributeChecker.ATTIDX_FIXED];
- XInt formAtt = (XInt) attrValues[XSAttributeChecker.ATTIDX_FORM];
- String nameAtt = (String) attrValues[XSAttributeChecker.ATTIDX_NAME];
- QName typeAtt = (QName) attrValues[XSAttributeChecker.ATTIDX_TYPE];
-
- // Step 1: get declaration information
- XSAttributeDecl attribute = null;
- if (fSchemaHandler.fDeclPool !=null) {
- attribute = fSchemaHandler.fDeclPool.getAttributeDecl();
- } else {
- attribute = new XSAttributeDecl();
- }
-
- // get 'name'
- if (nameAtt != null)
- nameAtt = fSymbolTable.addSymbol(nameAtt);
-
- // get 'target namespace'
- String tnsAtt = null;
- XSComplexTypeDecl enclCT = null;
- short scope = XSAttributeDecl.SCOPE_ABSENT;
- if (isGlobal) {
- tnsAtt = schemaDoc.fTargetNamespace;
- scope = XSAttributeDecl.SCOPE_GLOBAL;
- }
- else {
- if (enclosingCT != null) {
- enclCT = enclosingCT;
- scope = XSAttributeDecl.SCOPE_LOCAL;
- }
- if (formAtt != null) {
- if (formAtt.intValue() == SchemaSymbols.FORM_QUALIFIED)
- tnsAtt = schemaDoc.fTargetNamespace;
- } else if (schemaDoc.fAreLocalAttributesQualified) {
- tnsAtt = schemaDoc.fTargetNamespace;
- }
- }
- // get 'value constraint'
- // for local named attribute, value constraint is absent
- ValidatedInfo attDefault = null;
- short constraintType = XSConstants.VC_NONE;
- if (isGlobal) {
- if (fixedAtt != null) {
- attDefault = new ValidatedInfo();
- attDefault.normalizedValue = fixedAtt;
- constraintType = XSConstants.VC_FIXED;
- } else if (defaultAtt != null) {
- attDefault = new ValidatedInfo();
- attDefault.normalizedValue = defaultAtt;
- constraintType = XSConstants.VC_DEFAULT;
- }
- }
-
- // get 'annotation'
- Element child = DOMUtil.getFirstChildElement(attrDecl);
- XSAnnotationImpl annotation = null;
- if (child != null && DOMUtil.getLocalName(child).equals(SchemaSymbols.ELT_ANNOTATION)) {
- annotation = traverseAnnotationDecl(child, attrValues, false, schemaDoc);
- child = DOMUtil.getNextSiblingElement(child);
- }
- else {
- String text = DOMUtil.getSyntheticAnnotation(attrDecl);
- if (text != null) {
- annotation = traverseSyntheticAnnotation(attrDecl, text, attrValues, false, schemaDoc);
- }
- }
-
- // get 'type definition'
- XSSimpleType attrType = null;
- boolean haveAnonType = false;
-
- // Handle Anonymous type if there is one
- if (child != null) {
- String childName = DOMUtil.getLocalName(child);
-
- if (childName.equals(SchemaSymbols.ELT_SIMPLETYPE)) {
- attrType = fSchemaHandler.fSimpleTypeTraverser.traverseLocal(child, schemaDoc, grammar);
- haveAnonType = true;
- child = DOMUtil.getNextSiblingElement(child);
- }
- }
-
- // Handle type attribute
- if (attrType == null && typeAtt != null) {
- XSTypeDefinition type = (XSTypeDefinition)fSchemaHandler.getGlobalDecl(schemaDoc, XSDHandler.TYPEDECL_TYPE, typeAtt, attrDecl);
- if (type != null && type.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE) {
- attrType = (XSSimpleType)type;
- }
- else {
- reportSchemaError("src-resolve", new Object[]{typeAtt.rawname, "simpleType definition"}, attrDecl);
- if (type == null) {
- attribute.fUnresolvedTypeName = typeAtt;
- }
- }
- }
-
- if (attrType == null) {
- attrType = SchemaGrammar.fAnySimpleType;
- }
-
- XSObjectList annotations;
- if (annotation != null) {
- annotations = new XSObjectListImpl();
- ((XSObjectListImpl)annotations).addXSObject(annotation);
- } else {
- annotations = XSObjectListImpl.EMPTY_LIST;
- }
- attribute.setValues(nameAtt, tnsAtt, attrType, constraintType, scope,
- attDefault, enclCT, annotations);
-
- // Step 3: check against schema for schemas
-
- // required attributes
- if (nameAtt == null) {
- if (isGlobal)
- reportSchemaError("s4s-att-must-appear", new Object[]{SchemaSymbols.ELT_ATTRIBUTE, SchemaSymbols.ATT_NAME}, attrDecl);
- else
- reportSchemaError("src-attribute.3.1", null, attrDecl);
- nameAtt = NO_NAME;
- }
-
- // element
- if (child != null) {
- reportSchemaError("s4s-elt-must-match.1", new Object[]{nameAtt, "(annotation?, (simpleType?))", DOMUtil.getLocalName(child)}, child);
- }
-
- // Step 4: check 3.2.3 constraints
-
- // src-attribute
-
- // 1 default and fixed must not both be present.
- if (defaultAtt != null && fixedAtt != null) {
- reportSchemaError("src-attribute.1", new Object[]{nameAtt}, attrDecl);
- }
-
- // 2 If default and use are both present, use must have the actual value optional.
- // This is checked in "traverse" method
-
- // 3 If the item's parent is not <schema>, then all of the following must be true:
- // 3.1 One of ref or name must be present, but not both.
- // This is checked in XSAttributeChecker
-
- // 3.2 If ref is present, then all of <simpleType>, form and type must be absent.
- // Attributes are checked in XSAttributeChecker, elements are checked in "traverse" method
-
- // 4 type and <simpleType> must not both be present.
- if (haveAnonType && (typeAtt != null)) {
- reportSchemaError( "src-attribute.4", new Object[]{nameAtt}, attrDecl);
- }
-
- // Step 5: check 3.2.6 constraints
- // check for NOTATION type
- checkNotationType(nameAtt, attrType, attrDecl);
-
- // a-props-correct
-
- // 2 if there is a {value constraint}, the canonical lexical representation of its value must be valid with respect to the {type definition} as defined in String Valid (3.14.4).
- if (attDefault != null) {
- fValidationState.setNamespaceSupport(schemaDoc.fNamespaceSupport);
- try {
- checkDefaultValid(attribute);
- }
- catch (InvalidDatatypeValueException ide) {
- reportSchemaError (ide.getKey(), ide.getArgs(), attrDecl);
- reportSchemaError ("a-props-correct.2", new Object[]{nameAtt, attDefault.normalizedValue}, attrDecl);
- // Recover by removing the default value
- attDefault = null;
- constraintType = XSConstants.VC_NONE;
- attribute.setValues(nameAtt, tnsAtt, attrType, constraintType, scope,
- attDefault, enclCT, annotations);
- }
- }
-
- // 3 If the {type definition} is or is derived from ID then there must not be a {value constraint}.
- if (attDefault != null) {
- if (attrType.isIDType() ) {
- reportSchemaError ("a-props-correct.3", new Object[]{nameAtt}, attrDecl);
- // Recover by removing the default value
- attDefault = null;
- constraintType = XSConstants.VC_NONE;
- attribute.setValues(nameAtt, tnsAtt, attrType, constraintType, scope,
- attDefault, enclCT, annotations);
- }
- }
-
- // no-xmlns
-
- // The {name} of an attribute declaration must not match xmlns.
- if (nameAtt != null && nameAtt.equals(XMLSymbols.PREFIX_XMLNS)) {
- reportSchemaError("no-xmlns", null, attrDecl);
- return null;
- }
-
- // no-xsi
-
- // The {target namespace} of an attribute declaration, whether local or top-level, must not match http://www.w3.org/2001/XMLSchema-instance (unless it is one of the four built-in declarations given in the next section).
- if (tnsAtt != null && tnsAtt.equals(SchemaSymbols.URI_XSI)) {
- reportSchemaError("no-xsi", new Object[]{SchemaSymbols.URI_XSI}, attrDecl);
- return null;
- }
-
- // Attribute without a name. Return null.
- if (nameAtt.equals(NO_NAME))
- return null;
-
- // Step 2: register attribute decl to the grammar
- if (isGlobal) {
- if (grammar.getGlobalAttributeDecl(nameAtt) == null) {
- grammar.addGlobalAttributeDecl(attribute);
- }
-
- // also add it to extended map
- final String loc = fSchemaHandler.schemaDocument2SystemId(schemaDoc);
- final XSAttributeDecl attribute2 = grammar.getGlobalAttributeDecl(nameAtt, loc);
- if (attribute2 == null) {
- grammar.addGlobalAttributeDecl(attribute, loc);
- }
-
- if (fSchemaHandler.fTolerateDuplicates) {
- if (attribute2 != null) {
- attribute = attribute2;
- }
- fSchemaHandler.addGlobalAttributeDecl(attribute);
- }
- }
-
- return attribute;
- }
-
- // throws an error if the constraint value is invalid for the given type
- void checkDefaultValid(XSAttributeDecl attribute) throws InvalidDatatypeValueException {
- // validate the original lexical rep, and set the actual value
- ((XSSimpleType)attribute.getTypeDefinition()).validate(attribute.getValInfo().normalizedValue, fValidationState, attribute.getValInfo());
- // validate the canonical lexical rep
- ((XSSimpleType)attribute.getTypeDefinition()).validate(attribute.getValInfo().stringValue(), fValidationState, attribute.getValInfo());
- }
-
- // throws an error if the constraint value is invalid for the given type
- void checkDefaultValid(XSAttributeUseImpl attrUse) throws InvalidDatatypeValueException {
- // validate the original lexical rep, and set the actual value
- ((XSSimpleType)attrUse.fAttrDecl.getTypeDefinition()).validate(attrUse.fDefault.normalizedValue, fValidationState, attrUse.fDefault);
- // validate the canonical lexical rep
- ((XSSimpleType)attrUse.fAttrDecl.getTypeDefinition()).validate(attrUse.fDefault.stringValue(), fValidationState, attrUse.fDefault);
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDComplexTypeTraverser.java b/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDComplexTypeTraverser.java
deleted file mode 100644
index cfc98b8..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDComplexTypeTraverser.java
+++ /dev/null
@@ -1,1259 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xerces.internal.impl.xs.traversers;
-
-import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeFacetException;
-import com.sun.org.apache.xerces.internal.impl.dv.SchemaDVFactory;
-import com.sun.org.apache.xerces.internal.impl.dv.XSFacets;
-import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType;
-import com.sun.org.apache.xerces.internal.impl.dv.xs.XSSimpleTypeDecl;
-import com.sun.org.apache.xerces.internal.impl.xs.SchemaGrammar;
-import com.sun.org.apache.xerces.internal.impl.xs.SchemaSymbols;
-import com.sun.org.apache.xerces.internal.impl.xs.XSAnnotationImpl;
-import com.sun.org.apache.xerces.internal.impl.xs.XSAttributeGroupDecl;
-import com.sun.org.apache.xerces.internal.impl.xs.XSAttributeUseImpl;
-import com.sun.org.apache.xerces.internal.impl.xs.XSComplexTypeDecl;
-import com.sun.org.apache.xerces.internal.impl.xs.XSConstraints;
-import com.sun.org.apache.xerces.internal.impl.xs.XSModelGroupImpl;
-import com.sun.org.apache.xerces.internal.impl.xs.XSParticleDecl;
-import com.sun.org.apache.xerces.internal.impl.xs.XSWildcardDecl;
-import com.sun.org.apache.xerces.internal.impl.xs.util.XInt;
-import com.sun.org.apache.xerces.internal.impl.xs.util.XSObjectListImpl;
-import com.sun.org.apache.xerces.internal.util.DOMUtil;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xs.XSAttributeUse;
-import com.sun.org.apache.xerces.internal.xs.XSConstants;
-import com.sun.org.apache.xerces.internal.xs.XSObjectList;
-import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
-import org.w3c.dom.Element;
-
-/**
- * A complex type definition schema component traverser.
- *
- * <complexType
- * abstract = boolean : false
- * block = (#all | List of (extension | restriction))
- * final = (#all | List of (extension | restriction))
- * id = ID
- * mixed = boolean : false
- * name = NCName
- * {any attributes with non-schema namespace . . .}>
- * Content: (annotation?, (simpleContent | complexContent |
- * ((group | all | choice | sequence)?,
- * ((attribute | attributeGroup)*, anyAttribute?))))
- * </complexType>
- *
- * @xerces.internal
- *
- * @version $Id: XSDComplexTypeTraverser.java,v 1.8 2010-11-01 04:40:02 joehw Exp $
- */
-
-class XSDComplexTypeTraverser extends XSDAbstractParticleTraverser {
-
- // size of stack to hold globals:
- private final static int GLOBAL_NUM = 11;
-
- private static XSParticleDecl fErrorContent = null;
- private static XSWildcardDecl fErrorWildcard = null;
- private static XSParticleDecl getErrorContent() {
- if (fErrorContent == null) {
- XSParticleDecl particle = new XSParticleDecl();
- particle.fType = XSParticleDecl.PARTICLE_WILDCARD;
- particle.fValue = getErrorWildcard();
- particle.fMinOccurs = 0;
- particle.fMaxOccurs = SchemaSymbols.OCCURRENCE_UNBOUNDED;
- XSModelGroupImpl group = new XSModelGroupImpl();
- group.fCompositor = XSModelGroupImpl.MODELGROUP_SEQUENCE;
- group.fParticleCount = 1;
- group.fParticles = new XSParticleDecl[1];
- group.fParticles[0] = particle;
- XSParticleDecl errorContent = new XSParticleDecl();
- errorContent.fType = XSParticleDecl.PARTICLE_MODELGROUP;
- errorContent.fValue = group;
- fErrorContent = errorContent;
- }
- return fErrorContent;
- }
- private static XSWildcardDecl getErrorWildcard() {
- if (fErrorWildcard == null) {
- XSWildcardDecl wildcard = new XSWildcardDecl();
- wildcard.fProcessContents = XSWildcardDecl.PC_SKIP;
- fErrorWildcard = wildcard;
- }
- return fErrorWildcard;
- }
-
- // globals for building XSComplexTypeDecls
- private String fName = null;
- private String fTargetNamespace = null;
- private short fDerivedBy = XSConstants.DERIVATION_RESTRICTION;
- private short fFinal = XSConstants.DERIVATION_NONE;
- private short fBlock = XSConstants.DERIVATION_NONE;
- private short fContentType = XSComplexTypeDecl.CONTENTTYPE_EMPTY;
- private XSTypeDefinition fBaseType = null;
- private XSAttributeGroupDecl fAttrGrp = null;
- private XSSimpleType fXSSimpleType = null;
- private XSParticleDecl fParticle = null;
- private boolean fIsAbstract = false;
- private XSComplexTypeDecl fComplexTypeDecl = null;
- private XSAnnotationImpl [] fAnnotations = null;
-
- // our own little stack to retain state when getGlobalDecls is called:
- private Object [] fGlobalStore = null;
- private int fGlobalStorePos = 0;
-
- XSDComplexTypeTraverser (XSDHandler handler,
- XSAttributeChecker gAttrCheck) {
- super(handler, gAttrCheck);
- }
-
-
- private static final boolean DEBUG=false;
-
- private static final class ComplexTypeRecoverableError extends Exception {
-
- private static final long serialVersionUID = 6802729912091130335L;
-
- Object[] errorSubstText=null;
- Element errorElem = null;
- ComplexTypeRecoverableError() {
- super();
- }
- ComplexTypeRecoverableError(String msgKey, Object[] args, Element e) {
- super(msgKey);
- errorSubstText=args;
- errorElem = e;
- }
-
- }
-
- /**
- * Traverse local complexType declarations
- *
- * @param Element
- * @param XSDocumentInfo
- * @param SchemaGrammar
- * @return XSComplexTypeDecl
- */
- XSComplexTypeDecl traverseLocal(Element complexTypeNode,
- XSDocumentInfo schemaDoc,
- SchemaGrammar grammar) {
-
-
- Object[] attrValues = fAttrChecker.checkAttributes(complexTypeNode, false,
- schemaDoc);
- String complexTypeName = genAnonTypeName(complexTypeNode);
- contentBackup();
- XSComplexTypeDecl type = traverseComplexTypeDecl (complexTypeNode,
- complexTypeName, attrValues, schemaDoc, grammar);
- contentRestore();
- // need to add the type to the grammar for later constraint checking
- grammar.addComplexTypeDecl(type, fSchemaHandler.element2Locator(complexTypeNode));
- type.setIsAnonymous();
- fAttrChecker.returnAttrArray(attrValues, schemaDoc);
-
- return type;
- }
-
- /**
- * Traverse global complexType declarations
- *
- * @param Element
- * @param XSDocumentInfo
- * @param SchemaGrammar
- * @return XSComplexTypeDecXSComplexTypeDecl
- */
- XSComplexTypeDecl traverseGlobal (Element complexTypeNode,
- XSDocumentInfo schemaDoc,
- SchemaGrammar grammar) {
-
- Object[] attrValues = fAttrChecker.checkAttributes(complexTypeNode, true,
- schemaDoc);
- String complexTypeName = (String) attrValues[XSAttributeChecker.ATTIDX_NAME];
- contentBackup();
- XSComplexTypeDecl type = traverseComplexTypeDecl (complexTypeNode,
- complexTypeName, attrValues, schemaDoc, grammar);
- contentRestore();
- // need to add the type to the grammar for later constraint checking
- grammar.addComplexTypeDecl(type, fSchemaHandler.element2Locator(complexTypeNode));
-
- if (complexTypeName == null) {
- reportSchemaError("s4s-att-must-appear", new Object[]{SchemaSymbols.ELT_COMPLEXTYPE, SchemaSymbols.ATT_NAME}, complexTypeNode);
- type = null;
- } else {
- if (grammar.getGlobalTypeDecl(type.getName()) == null) {
- grammar.addGlobalComplexTypeDecl(type);
- }
-
- // also add it to extended map
- final String loc = fSchemaHandler.schemaDocument2SystemId(schemaDoc);
- final XSTypeDefinition type2 = grammar.getGlobalTypeDecl(type.getName(), loc);
- if (type2 == null) {
- grammar.addGlobalComplexTypeDecl(type, loc);
- }
-
- // handle duplicates
- if (fSchemaHandler.fTolerateDuplicates) {
- if (type2 != null) {
- if (type2 instanceof XSComplexTypeDecl) {
- type = (XSComplexTypeDecl) type2;
- }
- }
- fSchemaHandler.addGlobalTypeDecl(type);
- }
- }
-
- fAttrChecker.returnAttrArray(attrValues, schemaDoc);
-
- return type;
- }
-
-
- private XSComplexTypeDecl traverseComplexTypeDecl(Element complexTypeDecl,
- String complexTypeName,
- Object[] attrValues,
- XSDocumentInfo schemaDoc,
- SchemaGrammar grammar) {
-
- fComplexTypeDecl = new XSComplexTypeDecl();
- fAttrGrp = new XSAttributeGroupDecl();
- Boolean abstractAtt = (Boolean) attrValues[XSAttributeChecker.ATTIDX_ABSTRACT];
- XInt blockAtt = (XInt) attrValues[XSAttributeChecker.ATTIDX_BLOCK];
- Boolean mixedAtt = (Boolean) attrValues[XSAttributeChecker.ATTIDX_MIXED];
- XInt finalAtt = (XInt) attrValues[XSAttributeChecker.ATTIDX_FINAL];
-
- fName = complexTypeName;
- fComplexTypeDecl.setName(fName);
- fTargetNamespace = schemaDoc.fTargetNamespace;
-
- fBlock = blockAtt == null ? schemaDoc.fBlockDefault : blockAtt.shortValue();
- fFinal = finalAtt == null ? schemaDoc.fFinalDefault : finalAtt.shortValue();
- //discard valid Block/Final 'Default' values that are invalid for Block/Final
- fBlock &= (XSConstants.DERIVATION_EXTENSION | XSConstants.DERIVATION_RESTRICTION);
- fFinal &= (XSConstants.DERIVATION_EXTENSION | XSConstants.DERIVATION_RESTRICTION);
-
- fIsAbstract = (abstractAtt != null && abstractAtt.booleanValue());
- fAnnotations = null;
-
- Element child = null;
-
- try {
- // ---------------------------------------------------------------
- // First, handle any ANNOTATION declaration and get next child
- // ---------------------------------------------------------------
- child = DOMUtil.getFirstChildElement(complexTypeDecl);
- if(child != null) {
- if (DOMUtil.getLocalName(child).equals(SchemaSymbols.ELT_ANNOTATION)) {
- addAnnotation(traverseAnnotationDecl(child, attrValues, false, schemaDoc));
- child = DOMUtil.getNextSiblingElement(child);
- }
- else {
- String text = DOMUtil.getSyntheticAnnotation(complexTypeDecl);
- if (text != null) {
- addAnnotation(traverseSyntheticAnnotation(complexTypeDecl, text, attrValues, false, schemaDoc));
- }
- }
- if (child !=null && DOMUtil.getLocalName(child).equals(SchemaSymbols.ELT_ANNOTATION)) {
- throw new ComplexTypeRecoverableError("s4s-elt-invalid-content.1",
- new Object[]{fName,SchemaSymbols.ELT_ANNOTATION},
- child);
- }
- }
- else {
- String text = DOMUtil.getSyntheticAnnotation(complexTypeDecl);
- if (text != null) {
- addAnnotation(traverseSyntheticAnnotation(complexTypeDecl, text, attrValues, false, schemaDoc));
- }
- }
- // ---------------------------------------------------------------
- // Process the content of the complex type definition
- // ---------------------------------------------------------------
- if (child==null) {
- //
- // EMPTY complexType with complexContent
- //
-
- // set the base to the anyType
- fBaseType = SchemaGrammar.fAnyType;
- fDerivedBy = XSConstants.DERIVATION_RESTRICTION;
- processComplexContent(child, mixedAtt.booleanValue(), false,
- schemaDoc, grammar);
- }
- else if (DOMUtil.getLocalName(child).equals
- (SchemaSymbols.ELT_SIMPLECONTENT)) {
- //
- // SIMPLE CONTENT
- //
- traverseSimpleContent(child, schemaDoc, grammar);
- Element elemTmp = DOMUtil.getNextSiblingElement(child);
- if (elemTmp != null) {
- String siblingName = DOMUtil.getLocalName(elemTmp);
- throw new ComplexTypeRecoverableError("s4s-elt-invalid-content.1",
- new Object[]{fName,siblingName},
- elemTmp);
- }
- }
- else if (DOMUtil.getLocalName(child).equals
- (SchemaSymbols.ELT_COMPLEXCONTENT)) {
- traverseComplexContent(child, mixedAtt.booleanValue(),
- schemaDoc, grammar);
- Element elemTmp = DOMUtil.getNextSiblingElement(child);
- if (elemTmp != null) {
- String siblingName = DOMUtil.getLocalName(elemTmp);
- throw new ComplexTypeRecoverableError("s4s-elt-invalid-content.1",
- new Object[]{fName,siblingName},
- elemTmp);
- }
- }
- else {
- //
- // We must have ....
- // GROUP, ALL, SEQUENCE or CHOICE, followed by optional attributes
- // Note that it's possible that only attributes are specified.
- //
-
- // set the base to the anyType
- fBaseType = SchemaGrammar.fAnyType;
- fDerivedBy = XSConstants.DERIVATION_RESTRICTION;
- processComplexContent(child, mixedAtt.booleanValue(), false,
- schemaDoc, grammar);
- }
-
- }
- catch (ComplexTypeRecoverableError e) {
- handleComplexTypeError(e.getMessage(), e.errorSubstText,
- e.errorElem);
- }
-
- if (DEBUG) {
- System.out.println(fName);
- }
- fComplexTypeDecl.setValues(fName, fTargetNamespace, fBaseType,
- fDerivedBy, fFinal, fBlock, fContentType, fIsAbstract,
- fAttrGrp, fXSSimpleType, fParticle, new XSObjectListImpl(fAnnotations,
- fAnnotations == null? 0 : fAnnotations.length));
- return fComplexTypeDecl;
- }
-
-
- private void traverseSimpleContent(Element simpleContentElement,
- XSDocumentInfo schemaDoc,
- SchemaGrammar grammar)
- throws ComplexTypeRecoverableError {
-
-
- Object[] simpleContentAttrValues = fAttrChecker.checkAttributes(simpleContentElement, false,
- schemaDoc);
-
- // -----------------------------------------------------------------------
- // Set content type
- // -----------------------------------------------------------------------
- fContentType = XSComplexTypeDecl.CONTENTTYPE_SIMPLE;
- fParticle = null;
-
- Element simpleContent = DOMUtil.getFirstChildElement(simpleContentElement);
- if (simpleContent != null && DOMUtil.getLocalName(simpleContent).equals(SchemaSymbols.ELT_ANNOTATION)) {
- addAnnotation(traverseAnnotationDecl(simpleContent, simpleContentAttrValues, false, schemaDoc));
- simpleContent = DOMUtil.getNextSiblingElement(simpleContent);
- }
- else {
- String text = DOMUtil.getSyntheticAnnotation(simpleContentElement);
- if (text != null) {
- addAnnotation(traverseSyntheticAnnotation(simpleContentElement, text, simpleContentAttrValues, false, schemaDoc));
- }
- }
-
- // If there are no children, return
- if (simpleContent==null) {
- fAttrChecker.returnAttrArray(simpleContentAttrValues, schemaDoc);
- throw new ComplexTypeRecoverableError("s4s-elt-invalid-content.2",
- new Object[]{fName,SchemaSymbols.ELT_SIMPLECONTENT},
- simpleContentElement);
- }
-
- // -----------------------------------------------------------------------
- // The content should be either "restriction" or "extension"
- // -----------------------------------------------------------------------
- String simpleContentName = DOMUtil.getLocalName(simpleContent);
- if (simpleContentName.equals(SchemaSymbols.ELT_RESTRICTION))
- fDerivedBy = XSConstants.DERIVATION_RESTRICTION;
- else if (simpleContentName.equals(SchemaSymbols.ELT_EXTENSION))
- fDerivedBy = XSConstants.DERIVATION_EXTENSION;
- else {
- fAttrChecker.returnAttrArray(simpleContentAttrValues, schemaDoc);
- throw new ComplexTypeRecoverableError("s4s-elt-invalid-content.1",
- new Object[]{fName,simpleContentName},
- simpleContent);
- }
- Element elemTmp = DOMUtil.getNextSiblingElement(simpleContent);
- if (elemTmp != null) {
- fAttrChecker.returnAttrArray(simpleContentAttrValues, schemaDoc);
- String siblingName = DOMUtil.getLocalName(elemTmp);
- throw new ComplexTypeRecoverableError("s4s-elt-invalid-content.1",
- new Object[]{fName,siblingName},
- elemTmp);
- }
-
- Object [] derivationTypeAttrValues = fAttrChecker.checkAttributes(simpleContent, false,
- schemaDoc);
- QName baseTypeName = (QName) derivationTypeAttrValues[XSAttributeChecker.ATTIDX_BASE];
-
-
- // -----------------------------------------------------------------------
- // Need a base type.
- // -----------------------------------------------------------------------
- if (baseTypeName==null) {
- fAttrChecker.returnAttrArray(simpleContentAttrValues, schemaDoc);
- fAttrChecker.returnAttrArray(derivationTypeAttrValues, schemaDoc);
- throw new ComplexTypeRecoverableError("s4s-att-must-appear",
- new Object[]{simpleContentName, "base"}, simpleContent);
- }
-
- XSTypeDefinition type = (XSTypeDefinition)fSchemaHandler.getGlobalDecl(schemaDoc,
- XSDHandler.TYPEDECL_TYPE, baseTypeName,
- simpleContent);
- if (type==null) {
- fAttrChecker.returnAttrArray(simpleContentAttrValues, schemaDoc);
- fAttrChecker.returnAttrArray(derivationTypeAttrValues, schemaDoc);
- throw new ComplexTypeRecoverableError();
- }
-
- fBaseType = type;
-
- XSSimpleType baseValidator = null;
- XSComplexTypeDecl baseComplexType = null;
- int baseFinalSet = 0;
-
- // If the base type is complex, it must have simpleContent
- if ((type.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE)) {
-
- baseComplexType = (XSComplexTypeDecl)type;
- baseFinalSet = baseComplexType.getFinal();
- // base is a CT with simple content (both restriction and extension are OK)
- if (baseComplexType.getContentType() == XSComplexTypeDecl.CONTENTTYPE_SIMPLE) {
- baseValidator = (XSSimpleType)baseComplexType.getSimpleType();
- }
- // base is a CT with mixed/emptiable content (only restriction is OK)
- else if (fDerivedBy == XSConstants.DERIVATION_RESTRICTION &&
- baseComplexType.getContentType() == XSComplexTypeDecl.CONTENTTYPE_MIXED &&
- ((XSParticleDecl)baseComplexType.getParticle()).emptiable()) {
- }
- else {
- fAttrChecker.returnAttrArray(simpleContentAttrValues, schemaDoc);
- fAttrChecker.returnAttrArray(derivationTypeAttrValues, schemaDoc);
- throw new ComplexTypeRecoverableError("src-ct.2.1",
- new Object[]{fName, baseComplexType.getName()}, simpleContent);
- }
- }
- else {
- baseValidator = (XSSimpleType)type;
- // base is a ST (only extension is OK)
- if (fDerivedBy == XSConstants.DERIVATION_RESTRICTION) {
- fAttrChecker.returnAttrArray(simpleContentAttrValues, schemaDoc);
- fAttrChecker.returnAttrArray(derivationTypeAttrValues, schemaDoc);
- throw new ComplexTypeRecoverableError("src-ct.2.1",
- new Object[]{fName, baseValidator.getName()}, simpleContent);
- }
- baseFinalSet=baseValidator.getFinal();
- }
-
- // -----------------------------------------------------------------------
- // Check that the base permits the derivation
- // -----------------------------------------------------------------------
- if ((baseFinalSet & fDerivedBy)!=0) {
- fAttrChecker.returnAttrArray(simpleContentAttrValues, schemaDoc);
- fAttrChecker.returnAttrArray(derivationTypeAttrValues, schemaDoc);
- String errorKey = (fDerivedBy==XSConstants.DERIVATION_EXTENSION) ?
- "cos-ct-extends.1.1" : "derivation-ok-restriction.1";
- throw new ComplexTypeRecoverableError(errorKey,
- new Object[]{fName, fBaseType.getName()}, simpleContent);
- }
-
- // -----------------------------------------------------------------------
- // Skip over any potential annotations
- // -----------------------------------------------------------------------
- Element scElement = simpleContent;
- simpleContent = DOMUtil.getFirstChildElement(simpleContent);
- if (simpleContent != null) {
- // traverse annotation if any
-
- if (DOMUtil.getLocalName(simpleContent).equals(SchemaSymbols.ELT_ANNOTATION)) {
- addAnnotation(traverseAnnotationDecl(simpleContent, derivationTypeAttrValues, false, schemaDoc));
- simpleContent = DOMUtil.getNextSiblingElement(simpleContent);
- }
- else {
- String text = DOMUtil.getSyntheticAnnotation(scElement);
- if (text != null) {
- addAnnotation(traverseSyntheticAnnotation(scElement, text, derivationTypeAttrValues, false, schemaDoc));
- }
- }
-
- if (simpleContent !=null &&
- DOMUtil.getLocalName(simpleContent).equals(SchemaSymbols.ELT_ANNOTATION)){
- fAttrChecker.returnAttrArray(simpleContentAttrValues, schemaDoc);
- fAttrChecker.returnAttrArray(derivationTypeAttrValues, schemaDoc);
- throw new ComplexTypeRecoverableError("s4s-elt-invalid-content.1",
- new Object[]{fName,SchemaSymbols.ELT_ANNOTATION},
- simpleContent);
- }
- }
- else {
- String text = DOMUtil.getSyntheticAnnotation(scElement);
- if (text != null) {
- addAnnotation(traverseSyntheticAnnotation(scElement, text, derivationTypeAttrValues, false, schemaDoc));
- }
- }
-
- // -----------------------------------------------------------------------
- // Process a RESTRICTION
- // -----------------------------------------------------------------------
- if (fDerivedBy == XSConstants.DERIVATION_RESTRICTION) {
-
- // -----------------------------------------------------------------------
- // There may be a simple type definition in the restriction element
- // The data type validator will be based on it, if specified
- // -----------------------------------------------------------------------
- if (simpleContent !=null &&
- DOMUtil.getLocalName(simpleContent).equals(SchemaSymbols.ELT_SIMPLETYPE )) {
-
- XSSimpleType dv = fSchemaHandler.fSimpleTypeTraverser.traverseLocal(
- simpleContent, schemaDoc, grammar);
- if (dv == null) {
- fAttrChecker.returnAttrArray(simpleContentAttrValues, schemaDoc);
- fAttrChecker.returnAttrArray(derivationTypeAttrValues, schemaDoc);
- throw new ComplexTypeRecoverableError();
- }
- //check that this datatype validator is validly derived from the base
- //according to derivation-ok-restriction 5.1.2.1
-
- if (baseValidator != null &&
- !XSConstraints.checkSimpleDerivationOk(dv, baseValidator,
- baseValidator.getFinal())) {
- fAttrChecker.returnAttrArray(simpleContentAttrValues, schemaDoc);
- fAttrChecker.returnAttrArray(derivationTypeAttrValues, schemaDoc);
- throw new ComplexTypeRecoverableError("derivation-ok-restriction.5.2.2.1",
- new Object[]{fName, dv.getName(), baseValidator.getName()},
- simpleContent);
- }
- baseValidator = dv;
- simpleContent = DOMUtil.getNextSiblingElement(simpleContent);
- }
-
- // this only happens when restricting a mixed/emptiable CT
- // but there is no <simpleType>, which is required
- if (baseValidator == null) {
- fAttrChecker.returnAttrArray(simpleContentAttrValues, schemaDoc);
- fAttrChecker.returnAttrArray(derivationTypeAttrValues, schemaDoc);
- throw new ComplexTypeRecoverableError("src-ct.2.2",
- new Object[]{fName}, simpleContent);
- }
-
- // -----------------------------------------------------------------------
- // Traverse any facets
- // -----------------------------------------------------------------------
- Element attrNode = null;
- XSFacets facetData = null;
- short presentFacets = 0 ;
- short fixedFacets = 0 ;
-
- if (simpleContent!=null) {
- FacetInfo fi = traverseFacets(simpleContent, baseValidator, schemaDoc);
- attrNode = fi.nodeAfterFacets;
- facetData = fi.facetdata;
- presentFacets = fi.fPresentFacets;
- fixedFacets = fi.fFixedFacets;
- }
-
- String name = genAnonTypeName(simpleContentElement);
- fXSSimpleType = fSchemaHandler.fDVFactory.createTypeRestriction(name,schemaDoc.fTargetNamespace,(short)0,baseValidator,null);
- try{
- fValidationState.setNamespaceSupport(schemaDoc.fNamespaceSupport);
- fXSSimpleType.applyFacets(facetData, presentFacets, fixedFacets, fValidationState);
- }catch(InvalidDatatypeFacetException ex){
- reportSchemaError(ex.getKey(), ex.getArgs(), simpleContent);
- // Recreate the type, ignoring the facets
- fXSSimpleType = fSchemaHandler.fDVFactory.createTypeRestriction(name,schemaDoc.fTargetNamespace,(short)0,baseValidator,null);
- }
- if (fXSSimpleType instanceof XSSimpleTypeDecl) {
- ((XSSimpleTypeDecl)fXSSimpleType).setAnonymous(true);
- }
-
- // -----------------------------------------------------------------------
- // Traverse any attributes
- // -----------------------------------------------------------------------
- if (attrNode != null) {
- if (!isAttrOrAttrGroup(attrNode)) {
- fAttrChecker.returnAttrArray(simpleContentAttrValues, schemaDoc);
- fAttrChecker.returnAttrArray(derivationTypeAttrValues, schemaDoc);
- throw new ComplexTypeRecoverableError("s4s-elt-invalid-content.1",
- new Object[]{fName,DOMUtil.getLocalName(attrNode)},
- attrNode);
- }
- Element node=traverseAttrsAndAttrGrps(attrNode,fAttrGrp,
- schemaDoc,grammar,fComplexTypeDecl);
- if (node!=null) {
- fAttrChecker.returnAttrArray(simpleContentAttrValues, schemaDoc);
- fAttrChecker.returnAttrArray(derivationTypeAttrValues, schemaDoc);
- throw new ComplexTypeRecoverableError("s4s-elt-invalid-content.1",
- new Object[]{fName,DOMUtil.getLocalName(node)},
- node);
- }
- }
-
- try {
- mergeAttributes(baseComplexType.getAttrGrp(), fAttrGrp, fName, false, simpleContentElement);
- } catch (ComplexTypeRecoverableError e) {
- fAttrChecker.returnAttrArray(simpleContentAttrValues, schemaDoc);
- fAttrChecker.returnAttrArray(derivationTypeAttrValues, schemaDoc);
- throw e;
- }
- // Prohibited uses must be removed after merge for RESTRICTION
- fAttrGrp.removeProhibitedAttrs();
-
- Object[] errArgs=fAttrGrp.validRestrictionOf(fName, baseComplexType.getAttrGrp());
- if (errArgs != null) {
- fAttrChecker.returnAttrArray(simpleContentAttrValues, schemaDoc);
- fAttrChecker.returnAttrArray(derivationTypeAttrValues, schemaDoc);
- throw new ComplexTypeRecoverableError((String)errArgs[errArgs.length-1],
- errArgs, attrNode);
- }
-
- }
- // -----------------------------------------------------------------------
- // Process a EXTENSION
- // -----------------------------------------------------------------------
- else {
- fXSSimpleType = baseValidator;
- if (simpleContent != null) {
- // -----------------------------------------------------------------------
- // Traverse any attributes
- // -----------------------------------------------------------------------
- Element attrNode = simpleContent;
- if (!isAttrOrAttrGroup(attrNode)) {
- fAttrChecker.returnAttrArray(simpleContentAttrValues, schemaDoc);
- fAttrChecker.returnAttrArray(derivationTypeAttrValues, schemaDoc);
- throw new ComplexTypeRecoverableError("s4s-elt-invalid-content.1",
- new Object[]{fName,DOMUtil.getLocalName(attrNode)},
- attrNode);
- }
- Element node=traverseAttrsAndAttrGrps(attrNode,fAttrGrp,
- schemaDoc,grammar,fComplexTypeDecl);
-
- if (node!=null) {
- fAttrChecker.returnAttrArray(simpleContentAttrValues, schemaDoc);
- fAttrChecker.returnAttrArray(derivationTypeAttrValues, schemaDoc);
- throw new ComplexTypeRecoverableError("s4s-elt-invalid-content.1",
- new Object[]{fName,DOMUtil.getLocalName(node)},
- node);
- }
- // Remove prohibited uses. Should be done prior to any merge.
- fAttrGrp.removeProhibitedAttrs();
- }
-
- if (baseComplexType != null) {
- try {
- mergeAttributes(baseComplexType.getAttrGrp(), fAttrGrp, fName, true, simpleContentElement);
- } catch (ComplexTypeRecoverableError e) {
- fAttrChecker.returnAttrArray(simpleContentAttrValues, schemaDoc);
- fAttrChecker.returnAttrArray(derivationTypeAttrValues, schemaDoc);
- throw e;
- }
- }
- }
- // and finally, since we've nothing more to traverse, we can
- // return the attributes (and thereby reset the namespace support)
- fAttrChecker.returnAttrArray(simpleContentAttrValues, schemaDoc);
- fAttrChecker.returnAttrArray(derivationTypeAttrValues, schemaDoc);
- }
-
- private void traverseComplexContent(Element complexContentElement,
- boolean mixedOnType, XSDocumentInfo schemaDoc,
- SchemaGrammar grammar)
- throws ComplexTypeRecoverableError {
-
-
- Object[] complexContentAttrValues = fAttrChecker.checkAttributes(complexContentElement, false,
- schemaDoc);
-
-
- // -----------------------------------------------------------------------
- // Determine if this is mixed content
- // -----------------------------------------------------------------------
- boolean mixedContent = mixedOnType;
- Boolean mixedAtt = (Boolean) complexContentAttrValues[XSAttributeChecker.ATTIDX_MIXED];
- if (mixedAtt != null) {
- mixedContent = mixedAtt.booleanValue();
- }
-
-
- // -----------------------------------------------------------------------
- // Since the type must have complex content, set the simple type validators
- // to null
- // -----------------------------------------------------------------------
- fXSSimpleType = null;
-
- Element complexContent = DOMUtil.getFirstChildElement(complexContentElement);
- if (complexContent != null && DOMUtil.getLocalName(complexContent).equals(SchemaSymbols.ELT_ANNOTATION)) {
- addAnnotation(traverseAnnotationDecl(complexContent, complexContentAttrValues, false, schemaDoc));
- complexContent = DOMUtil.getNextSiblingElement(complexContent);
- }
- else {
- String text = DOMUtil.getSyntheticAnnotation(complexContentElement);
- if (text != null) {
- addAnnotation(traverseSyntheticAnnotation(complexContentElement, text, complexContentAttrValues, false, schemaDoc));
- }
- }
-
- // If there are no children, return
- if (complexContent==null) {
- fAttrChecker.returnAttrArray(complexContentAttrValues, schemaDoc);
- throw new ComplexTypeRecoverableError("s4s-elt-invalid-content.2",
- new Object[]{fName,SchemaSymbols.ELT_COMPLEXCONTENT},
- complexContentElement);
- }
-
- // -----------------------------------------------------------------------
- // The content should be either "restriction" or "extension"
- // -----------------------------------------------------------------------
- String complexContentName = DOMUtil.getLocalName(complexContent);
- if (complexContentName.equals(SchemaSymbols.ELT_RESTRICTION))
- fDerivedBy = XSConstants.DERIVATION_RESTRICTION;
- else if (complexContentName.equals(SchemaSymbols.ELT_EXTENSION))
- fDerivedBy = XSConstants.DERIVATION_EXTENSION;
- else {
- fAttrChecker.returnAttrArray(complexContentAttrValues, schemaDoc);
- throw new ComplexTypeRecoverableError("s4s-elt-invalid-content.1",
- new Object[]{fName, complexContentName}, complexContent);
- }
- Element elemTmp = DOMUtil.getNextSiblingElement(complexContent);
- if (elemTmp != null) {
- fAttrChecker.returnAttrArray(complexContentAttrValues, schemaDoc);
- String siblingName = DOMUtil.getLocalName(elemTmp);
- throw new ComplexTypeRecoverableError("s4s-elt-invalid-content.1",
- new Object[]{fName, siblingName}, elemTmp);
- }
-
- Object[] derivationTypeAttrValues = fAttrChecker.checkAttributes(complexContent, false,
- schemaDoc);
- QName baseTypeName = (QName) derivationTypeAttrValues[XSAttributeChecker.ATTIDX_BASE];
-
-
- // -----------------------------------------------------------------------
- // Need a base type. Check that it's a complex type
- // -----------------------------------------------------------------------
- if (baseTypeName==null) {
- fAttrChecker.returnAttrArray(complexContentAttrValues, schemaDoc);
- fAttrChecker.returnAttrArray(derivationTypeAttrValues, schemaDoc);
- throw new ComplexTypeRecoverableError("s4s-att-must-appear",
- new Object[]{complexContentName, "base"}, complexContent);
- }
-
- XSTypeDefinition type = (XSTypeDefinition)fSchemaHandler.getGlobalDecl(schemaDoc,
- XSDHandler.TYPEDECL_TYPE,
- baseTypeName,
- complexContent);
-
- if (type==null) {
- fAttrChecker.returnAttrArray(complexContentAttrValues, schemaDoc);
- fAttrChecker.returnAttrArray(derivationTypeAttrValues, schemaDoc);
- throw new ComplexTypeRecoverableError();
- }
-
- if (! (type instanceof XSComplexTypeDecl)) {
- fAttrChecker.returnAttrArray(complexContentAttrValues, schemaDoc);
- fAttrChecker.returnAttrArray(derivationTypeAttrValues, schemaDoc);
- throw new ComplexTypeRecoverableError("src-ct.1",
- new Object[]{fName, type.getName()}, complexContent);
- }
- XSComplexTypeDecl baseType = (XSComplexTypeDecl)type;
- fBaseType = baseType;
-
- // -----------------------------------------------------------------------
- // Check that the base permits the derivation
- // -----------------------------------------------------------------------
- if ((baseType.getFinal() & fDerivedBy)!=0) {
- fAttrChecker.returnAttrArray(complexContentAttrValues, schemaDoc);
- fAttrChecker.returnAttrArray(derivationTypeAttrValues, schemaDoc);
- String errorKey = (fDerivedBy==XSConstants.DERIVATION_EXTENSION) ?
- "cos-ct-extends.1.1" : "derivation-ok-restriction.1";
- throw new ComplexTypeRecoverableError(errorKey,
- new Object[]{fName, fBaseType.getName()}, complexContent);
- }
-
- // -----------------------------------------------------------------------
- // Skip over any potential annotations
- // -----------------------------------------------------------------------
- complexContent = DOMUtil.getFirstChildElement(complexContent);
-
- if (complexContent != null) {
- // traverse annotation if any
- if (DOMUtil.getLocalName(complexContent).equals(SchemaSymbols.ELT_ANNOTATION)) {
- addAnnotation(traverseAnnotationDecl(complexContent, derivationTypeAttrValues, false, schemaDoc));
- complexContent = DOMUtil.getNextSiblingElement(complexContent);
- }
- else {
- String text = DOMUtil.getSyntheticAnnotation(complexContent);
- if (text != null) {
- addAnnotation(traverseSyntheticAnnotation(complexContent, text, derivationTypeAttrValues, false, schemaDoc));
- }
- }
- if (complexContent !=null &&
- DOMUtil.getLocalName(complexContent).equals(SchemaSymbols.ELT_ANNOTATION)){
- fAttrChecker.returnAttrArray(complexContentAttrValues, schemaDoc);
- fAttrChecker.returnAttrArray(derivationTypeAttrValues, schemaDoc);
- throw new ComplexTypeRecoverableError("s4s-elt-invalid-content.1",
- new Object[]{fName,SchemaSymbols.ELT_ANNOTATION}, complexContent);
- }
- }
- else {
- String text = DOMUtil.getSyntheticAnnotation(complexContent);
- if (text != null) {
- addAnnotation(traverseSyntheticAnnotation(complexContent, text, derivationTypeAttrValues, false, schemaDoc));
- }
- }
- // -----------------------------------------------------------------------
- // Process the content. Note: should I try to catch any complexType errors
- // here in order to return the attr array?
- // -----------------------------------------------------------------------
- try {
- processComplexContent(complexContent, mixedContent, true, schemaDoc,
- grammar);
- } catch (ComplexTypeRecoverableError e) {
- fAttrChecker.returnAttrArray(complexContentAttrValues, schemaDoc);
- fAttrChecker.returnAttrArray(derivationTypeAttrValues, schemaDoc);
- throw e;
- }
-
- // -----------------------------------------------------------------------
- // Compose the final content and attribute uses
- // -----------------------------------------------------------------------
- XSParticleDecl baseContent = (XSParticleDecl)baseType.getParticle();
- if (fDerivedBy==XSConstants.DERIVATION_RESTRICTION) {
-
- // This is an RESTRICTION
-
- // N.B. derivation-ok-restriction.5.3 is checked under schema
- // full checking. That's because we need to wait until locals are
- // traversed so that occurrence information is correct.
-
-
- if (fContentType == XSComplexTypeDecl.CONTENTTYPE_MIXED &&
- baseType.getContentType() != XSComplexTypeDecl.CONTENTTYPE_MIXED) {
- fAttrChecker.returnAttrArray(complexContentAttrValues, schemaDoc);
- fAttrChecker.returnAttrArray(derivationTypeAttrValues, schemaDoc);
- throw new ComplexTypeRecoverableError("derivation-ok-restriction.5.4.1.2",
- new Object[]{fName, baseType.getName()},
- complexContent);
- }
-
- try {
- mergeAttributes(baseType.getAttrGrp(), fAttrGrp, fName, false, complexContent);
- } catch (ComplexTypeRecoverableError e) {
- fAttrChecker.returnAttrArray(complexContentAttrValues, schemaDoc);
- fAttrChecker.returnAttrArray(derivationTypeAttrValues, schemaDoc);
- throw e;
- }
- // Remove prohibited uses. Must be done after merge for RESTRICTION.
- fAttrGrp.removeProhibitedAttrs();
-
- if (baseType != SchemaGrammar.fAnyType) {
- Object[] errArgs = fAttrGrp.validRestrictionOf(fName, baseType.getAttrGrp());
- if (errArgs != null) {
- fAttrChecker.returnAttrArray(complexContentAttrValues, schemaDoc);
- fAttrChecker.returnAttrArray(derivationTypeAttrValues, schemaDoc);
- throw new ComplexTypeRecoverableError((String)errArgs[errArgs.length-1],
- errArgs, complexContent);
- }
- }
- }
- else {
-
- // This is an EXTENSION
-
- // Create the particle
- if (fParticle == null) {
- fContentType = baseType.getContentType();
- fXSSimpleType = (XSSimpleType)baseType.getSimpleType();
- fParticle = baseContent;
- }
- else if (baseType.getContentType() == XSComplexTypeDecl.CONTENTTYPE_EMPTY) {
- }
- else {
- //
- // Check if the contentType of the base is consistent with the new type
- // cos-ct-extends.1.4.3.2
- if (fContentType == XSComplexTypeDecl.CONTENTTYPE_ELEMENT &&
- baseType.getContentType() != XSComplexTypeDecl.CONTENTTYPE_ELEMENT) {
- fAttrChecker.returnAttrArray(complexContentAttrValues, schemaDoc);
- fAttrChecker.returnAttrArray(derivationTypeAttrValues, schemaDoc);
- throw new ComplexTypeRecoverableError("cos-ct-extends.1.4.3.2.2.1.a",
- new Object[]{fName}, complexContent);
- }
- else if (fContentType == XSComplexTypeDecl.CONTENTTYPE_MIXED &&
- baseType.getContentType() != XSComplexTypeDecl.CONTENTTYPE_MIXED) {
- fAttrChecker.returnAttrArray(complexContentAttrValues, schemaDoc);
- fAttrChecker.returnAttrArray(derivationTypeAttrValues, schemaDoc);
- throw new ComplexTypeRecoverableError("cos-ct-extends.1.4.3.2.2.1.b",
- new Object[]{fName}, complexContent);
- }
-
- // if the content of either type is an "all" model group, error.
- if (fParticle.fType == XSParticleDecl.PARTICLE_MODELGROUP &&
- ((XSModelGroupImpl)fParticle.fValue).fCompositor == XSModelGroupImpl.MODELGROUP_ALL ||
- ((XSParticleDecl)baseType.getParticle()).fType == XSParticleDecl.PARTICLE_MODELGROUP &&
- ((XSModelGroupImpl)(((XSParticleDecl)baseType.getParticle())).fValue).fCompositor == XSModelGroupImpl.MODELGROUP_ALL) {
- fAttrChecker.returnAttrArray(complexContentAttrValues, schemaDoc);
- fAttrChecker.returnAttrArray(derivationTypeAttrValues, schemaDoc);
- throw new ComplexTypeRecoverableError("cos-all-limited.1.2",
- new Object[]{}, complexContent);
- }
- // the "sequence" model group to contain both particles
- XSModelGroupImpl group = new XSModelGroupImpl();
- group.fCompositor = XSModelGroupImpl.MODELGROUP_SEQUENCE;
- group.fParticleCount = 2;
- group.fParticles = new XSParticleDecl[2];
- group.fParticles[0] = (XSParticleDecl)baseType.getParticle();
- group.fParticles[1] = fParticle;
- group.fAnnotations = XSObjectListImpl.EMPTY_LIST;
- // the particle to contain the above sequence
- XSParticleDecl particle = new XSParticleDecl();
- particle.fType = XSParticleDecl.PARTICLE_MODELGROUP;
- particle.fValue = group;
- particle.fAnnotations = XSObjectListImpl.EMPTY_LIST;
-
- fParticle = particle;
- }
-
- // Remove prohibited uses. Must be done before merge for EXTENSION.
- fAttrGrp.removeProhibitedAttrs();
- try {
- mergeAttributes(baseType.getAttrGrp(), fAttrGrp, fName, true, complexContent);
- } catch (ComplexTypeRecoverableError e) {
- fAttrChecker.returnAttrArray(complexContentAttrValues, schemaDoc);
- fAttrChecker.returnAttrArray(derivationTypeAttrValues, schemaDoc);
- throw e;
- }
-
- }
-
- // and *finally* we can legitimately return the attributes!
- fAttrChecker.returnAttrArray(complexContentAttrValues, schemaDoc);
- fAttrChecker.returnAttrArray(derivationTypeAttrValues, schemaDoc);
-
- } // end of traverseComplexContent
-
-
- // This method merges attribute uses from the base, into the derived set.
- // LM: may want to merge with attributeGroup processing.
- private void mergeAttributes(XSAttributeGroupDecl fromAttrGrp,
- XSAttributeGroupDecl toAttrGrp,
- String typeName,
- boolean extension,
- Element elem)
- throws ComplexTypeRecoverableError {
-
- XSObjectList attrUseS = fromAttrGrp.getAttributeUses();
- XSAttributeUseImpl oneAttrUse = null;
- int attrCount = attrUseS.getLength();
- for (int i=0; i<attrCount; i++) {
- oneAttrUse = (XSAttributeUseImpl)attrUseS.item(i);
- XSAttributeUse existingAttrUse = toAttrGrp.getAttributeUse(oneAttrUse.fAttrDecl.getNamespace(),
- oneAttrUse.fAttrDecl.getName());
- if (existingAttrUse == null) {
-
- String idName = toAttrGrp.addAttributeUse(oneAttrUse);
- if (idName != null) {
- throw new ComplexTypeRecoverableError("ct-props-correct.5",
- new Object[]{typeName, idName, oneAttrUse.fAttrDecl.getName()},
- elem);
- }
- }
- else if (existingAttrUse != oneAttrUse) {
- if (extension) {
- reportSchemaError("ct-props-correct.4",
- new Object[]{typeName, oneAttrUse.fAttrDecl.getName()},
- elem);
- // Recover by using the attribute use from the base type,
- // to make the resulting schema "more valid".
- toAttrGrp.replaceAttributeUse(existingAttrUse, oneAttrUse);
- }
- }
- }
- // For extension, the wildcard must be formed by doing a union of the wildcards
- if (extension) {
- if (toAttrGrp.fAttributeWC==null) {
- toAttrGrp.fAttributeWC = fromAttrGrp.fAttributeWC;
- }
- else if (fromAttrGrp.fAttributeWC != null) {
- toAttrGrp.fAttributeWC = toAttrGrp.fAttributeWC.performUnionWith(fromAttrGrp.fAttributeWC, toAttrGrp.fAttributeWC.fProcessContents);
- if (toAttrGrp.fAttributeWC == null) {
- // REVISIT: XML Schema 1.0 2nd edition doesn't actually specify this constraint. It's a bug in the spec
- // which will eventually be fixed. We're just guessing what the error code will be. If it turns out to be
- // something else we'll need to change it. -- mrglavas
- throw new ComplexTypeRecoverableError("src-ct.5", new Object[]{typeName}, elem);
- }
- }
-
- }
- }
-
- private void processComplexContent(Element complexContentChild,
- boolean isMixed, boolean isDerivation,
- XSDocumentInfo schemaDoc, SchemaGrammar grammar)
- throws ComplexTypeRecoverableError {
-
- Element attrNode = null;
- XSParticleDecl particle = null;
-
- // whether there is a particle with empty model group
- boolean emptyParticle = false;
- if (complexContentChild != null) {
- // -------------------------------------------------------------
- // GROUP, ALL, SEQUENCE or CHOICE, followed by attributes, if specified.
- // Note that it's possible that only attributes are specified.
- // -------------------------------------------------------------
-
-
- String childName = DOMUtil.getLocalName(complexContentChild);
-
- if (childName.equals(SchemaSymbols.ELT_GROUP)) {
-
- particle = fSchemaHandler.fGroupTraverser.traverseLocal(complexContentChild,
- schemaDoc, grammar);
- attrNode = DOMUtil.getNextSiblingElement(complexContentChild);
- }
- else if (childName.equals(SchemaSymbols.ELT_SEQUENCE)) {
- particle = traverseSequence(complexContentChild,schemaDoc,grammar,
- NOT_ALL_CONTEXT,fComplexTypeDecl);
- if (particle != null) {
- XSModelGroupImpl group = (XSModelGroupImpl)particle.fValue;
- if (group.fParticleCount == 0)
- emptyParticle = true;
- }
- attrNode = DOMUtil.getNextSiblingElement(complexContentChild);
- }
- else if (childName.equals(SchemaSymbols.ELT_CHOICE)) {
- particle = traverseChoice(complexContentChild,schemaDoc,grammar,
- NOT_ALL_CONTEXT,fComplexTypeDecl);
- if (particle != null && particle.fMinOccurs == 0) {
- XSModelGroupImpl group = (XSModelGroupImpl)particle.fValue;
- if (group.fParticleCount == 0)
- emptyParticle = true;
- }
- attrNode = DOMUtil.getNextSiblingElement(complexContentChild);
- }
- else if (childName.equals(SchemaSymbols.ELT_ALL)) {
- particle = traverseAll(complexContentChild,schemaDoc,grammar,
- PROCESSING_ALL_GP,fComplexTypeDecl);
- if (particle != null) {
- XSModelGroupImpl group = (XSModelGroupImpl)particle.fValue;
- if (group.fParticleCount == 0)
- emptyParticle = true;
- }
- attrNode = DOMUtil.getNextSiblingElement(complexContentChild);
- }
- else {
- // Should be attributes here - will check below...
- attrNode = complexContentChild;
- }
- }
-
- // if the particle is empty because there is no non-annotation chidren,
- // we need to make the particle itself null (so that the effective
- // content is empty).
- if (emptyParticle) {
- // get the first child
- Element child = DOMUtil.getFirstChildElement(complexContentChild);
- // if it's annotation, get the next one
- if (child != null) {
- if (DOMUtil.getLocalName(child).equals(SchemaSymbols.ELT_ANNOTATION)) {
- child = DOMUtil.getNextSiblingElement(child);
- }
- }
- // if there is no (non-annotation) children, mark particle empty
- if (child == null)
- particle = null;
- // child != null means we might have seen an element with
- // minOccurs == maxOccurs == 0
- }
-
- if (particle == null && isMixed) {
- particle = XSConstraints.getEmptySequence();
- }
- fParticle = particle;
-
- // -----------------------------------------------------------------------
- // Set the content type
- // -----------------------------------------------------------------------
- if (fParticle == null)
- fContentType = XSComplexTypeDecl.CONTENTTYPE_EMPTY;
- else if (isMixed)
- fContentType = XSComplexTypeDecl.CONTENTTYPE_MIXED;
- else
- fContentType = XSComplexTypeDecl.CONTENTTYPE_ELEMENT;
-
-
- // -------------------------------------------------------------
- // Now, process attributes
- // -------------------------------------------------------------
- if (attrNode != null) {
- if (!isAttrOrAttrGroup(attrNode)) {
- throw new ComplexTypeRecoverableError("s4s-elt-invalid-content.1",
- new Object[]{fName,DOMUtil.getLocalName(attrNode)},
- attrNode);
- }
- Element node =
- traverseAttrsAndAttrGrps(attrNode,fAttrGrp,schemaDoc,grammar,fComplexTypeDecl);
- if (node!=null) {
- throw new ComplexTypeRecoverableError("s4s-elt-invalid-content.1",
- new Object[]{fName,DOMUtil.getLocalName(node)},
- node);
- }
- // Only remove prohibited attribute uses if this isn't a derived type
- // Derivation-specific code worries about this elsewhere
- if (!isDerivation) {
- fAttrGrp.removeProhibitedAttrs();
- }
- }
-
-
-
- } // end processComplexContent
-
-
- private boolean isAttrOrAttrGroup(Element e) {
- String elementName = DOMUtil.getLocalName(e);
-
- if (elementName.equals(SchemaSymbols.ELT_ATTRIBUTE) ||
- elementName.equals(SchemaSymbols.ELT_ATTRIBUTEGROUP) ||
- elementName.equals(SchemaSymbols.ELT_ANYATTRIBUTE))
- return true;
- else
- return false;
- }
-
- private void traverseSimpleContentDecl(Element simpleContentDecl) {
- }
-
- private void traverseComplexContentDecl(Element complexContentDecl,
- boolean mixedOnComplexTypeDecl) {
- }
-
- /*
- * Generate a name for an anonymous type
- */
- private String genAnonTypeName(Element complexTypeDecl) {
-
- // Generate a unique name for the anonymous type by concatenating together the
- // names of parent nodes
- // The name is quite good for debugging/error purposes, but we may want to
- // revisit how this is done for performance reasons (LM).
- StringBuffer typeName = new StringBuffer("#AnonType_");
- Element node = DOMUtil.getParent(complexTypeDecl);
- while (node != null && (node != DOMUtil.getRoot(DOMUtil.getDocument(node)))) {
- typeName.append(node.getAttribute(SchemaSymbols.ATT_NAME));
- node = DOMUtil.getParent(node);
- }
- return typeName.toString();
- }
-
-
- private void handleComplexTypeError(String messageId,Object[] args,
- Element e) {
-
- if (messageId!=null) {
- reportSchemaError(messageId, args, e);
- }
-
- //
- // Mock up the typeInfo structure so that there won't be problems during
- // validation
- //
- fBaseType = SchemaGrammar.fAnyType;
- fContentType = XSComplexTypeDecl.CONTENTTYPE_MIXED;
- fXSSimpleType = null;
- fParticle = getErrorContent();
- // REVISIT: do we need to remove all attribute uses already added into
- // the attribute group? maybe it's ok to leave them there. -SG
- fAttrGrp.fAttributeWC = getErrorWildcard();
-
- return;
-
- }
-
- private void contentBackup() {
- if(fGlobalStore == null) {
- fGlobalStore = new Object [GLOBAL_NUM];
- fGlobalStorePos = 0;
- }
- if(fGlobalStorePos == fGlobalStore.length) {
- Object [] newArray = new Object[fGlobalStorePos+GLOBAL_NUM];
- System.arraycopy(fGlobalStore, 0, newArray, 0, fGlobalStorePos);
- fGlobalStore = newArray;
- }
- fGlobalStore[fGlobalStorePos++] = fComplexTypeDecl;
- fGlobalStore[fGlobalStorePos++] = fIsAbstract?Boolean.TRUE:Boolean.FALSE;
- fGlobalStore[fGlobalStorePos++] = fName ;
- fGlobalStore[fGlobalStorePos++] = fTargetNamespace;
- // let's save ourselves a couple of objects...
- fGlobalStore[fGlobalStorePos++] = new Integer((fDerivedBy << 16) + fFinal);
- fGlobalStore[fGlobalStorePos++] = new Integer((fBlock << 16) + fContentType);
- fGlobalStore[fGlobalStorePos++] = fBaseType;
- fGlobalStore[fGlobalStorePos++] = fAttrGrp;
- fGlobalStore[fGlobalStorePos++] = fParticle;
- fGlobalStore[fGlobalStorePos++] = fXSSimpleType;
- fGlobalStore[fGlobalStorePos++] = fAnnotations;
- }
-
- private void contentRestore() {
- fAnnotations = (XSAnnotationImpl [])fGlobalStore[--fGlobalStorePos];
- fXSSimpleType = (XSSimpleType)fGlobalStore[--fGlobalStorePos];
- fParticle = (XSParticleDecl)fGlobalStore[--fGlobalStorePos];
- fAttrGrp = (XSAttributeGroupDecl)fGlobalStore[--fGlobalStorePos];
- fBaseType = (XSTypeDefinition)fGlobalStore[--fGlobalStorePos];
- int i = ((Integer)(fGlobalStore[--fGlobalStorePos])).intValue();
- fBlock = (short)(i >> 16);
- fContentType = (short)i;
- i = ((Integer)(fGlobalStore[--fGlobalStorePos])).intValue();
- fDerivedBy = (short)(i >> 16);
- fFinal = (short)i;
- fTargetNamespace = (String)fGlobalStore[--fGlobalStorePos];
- fName = (String)fGlobalStore[--fGlobalStorePos];
- fIsAbstract = ((Boolean)fGlobalStore[--fGlobalStorePos]).booleanValue();
- fComplexTypeDecl = (XSComplexTypeDecl)fGlobalStore[--fGlobalStorePos];
- }
-
- private void addAnnotation(XSAnnotationImpl annotation) {
- if(annotation == null)
- return;
- // it isn't very likely that there will be more than one annotation
- // in a complexType decl. This saves us fromhaving to push/pop
- // one more object from the fGlobalStore, and that's bound
- // to be a savings for most applications
- if(fAnnotations == null) {
- fAnnotations = new XSAnnotationImpl[1];
- } else {
- XSAnnotationImpl [] tempArray = new XSAnnotationImpl[fAnnotations.length + 1];
- System.arraycopy(fAnnotations, 0, tempArray, 0, fAnnotations.length);
- fAnnotations = tempArray;
- }
- fAnnotations[fAnnotations.length-1] = annotation;
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDElementTraverser.java b/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDElementTraverser.java
deleted file mode 100644
index 0d48058..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDElementTraverser.java
+++ /dev/null
@@ -1,565 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.traversers;
-
-import java.util.Locale;
-
-import com.sun.org.apache.xerces.internal.impl.dv.ValidatedInfo;
-import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType;
-import com.sun.org.apache.xerces.internal.impl.xs.SchemaGrammar;
-import com.sun.org.apache.xerces.internal.impl.xs.SchemaSymbols;
-import com.sun.org.apache.xerces.internal.impl.xs.XSAnnotationImpl;
-import com.sun.org.apache.xerces.internal.impl.xs.XSComplexTypeDecl;
-import com.sun.org.apache.xerces.internal.impl.xs.XSConstraints;
-import com.sun.org.apache.xerces.internal.impl.xs.XSElementDecl;
-import com.sun.org.apache.xerces.internal.impl.xs.XSParticleDecl;
-import com.sun.org.apache.xerces.internal.impl.xs.util.XInt;
-import com.sun.org.apache.xerces.internal.impl.xs.util.XSObjectListImpl;
-import com.sun.org.apache.xerces.internal.util.DOMUtil;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.util.XMLChar;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xs.XSConstants;
-import com.sun.org.apache.xerces.internal.xs.XSObject;
-import com.sun.org.apache.xerces.internal.xs.XSObjectList;
-import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-
-/**
- * The element declaration schema component traverser.
- * <element
- * abstract = boolean : false
- * block = (#all | List of (extension | restriction | substitution))
- * default = string
- * final = (#all | List of (extension | restriction))
- * fixed = string
- * form = (qualified | unqualified)
- * id = ID
- * maxOccurs = (nonNegativeInteger | unbounded) : 1
- * minOccurs = nonNegativeInteger : 1
- * name = NCName
- * nillable = boolean : false
- * ref = QName
- * substitutionGroup = QName
- * type = QName
- * {any attributes with non-schema namespace . . .}>
- * Content: (annotation?, ((simpleType | complexType)?, (unique | key | keyref)*))
- * </element>
- *
- * @xerces.internal
- *
- * @author Sandy Gao, IBM
- *
- * @version $Id: XSDElementTraverser.java,v 1.9 2010-11-01 04:40:02 joehw Exp $
- */
-class XSDElementTraverser extends XSDAbstractTraverser {
-
- protected final XSElementDecl fTempElementDecl = new XSElementDecl();
-
- // this controls what happens when a local element is encountered.
- // We may not encounter all local elements when first parsing.
- boolean fDeferTraversingLocalElements;
-
- XSDElementTraverser (XSDHandler handler,
- XSAttributeChecker gAttrCheck) {
- super(handler, gAttrCheck);
- }
-
- /**
- * Traverse a locally declared element (or an element reference).
- *
- * To handle the recursive cases efficiently, we delay the traversal
- * and return an empty particle node. We'll fill in this particle node
- * later after we've done with all the global declarations.
- * This method causes a number of data structures in the schema handler to be filled in.
- *
- * @param elmDecl
- * @param schemaDoc
- * @param grammar
- * @return the particle
- */
- XSParticleDecl traverseLocal(Element elmDecl,
- XSDocumentInfo schemaDoc,
- SchemaGrammar grammar,
- int allContextFlags,
- XSObject parent) {
-
- XSParticleDecl particle = null;
- if (fSchemaHandler.fDeclPool !=null) {
- particle = fSchemaHandler.fDeclPool.getParticleDecl();
- } else {
- particle = new XSParticleDecl();
- }
- if (fDeferTraversingLocalElements) {
- // The only thing we care about now is whether this element has
- // minOccurs=0. This affects (if the element appears in a complex
- // type) whether a type has emptiable content.
- particle.fType = XSParticleDecl.PARTICLE_ELEMENT;
- Attr attr = elmDecl.getAttributeNode(SchemaSymbols.ATT_MINOCCURS);
- if (attr != null) {
- String min = attr.getValue();
- try {
- int m = Integer.parseInt(XMLChar.trim(min));
- if (m >= 0)
- particle.fMinOccurs = m;
- }
- catch (NumberFormatException ex) {
- }
- }
- fSchemaHandler.fillInLocalElemInfo(elmDecl, schemaDoc, allContextFlags, parent, particle);
- } else {
- traverseLocal(particle, elmDecl, schemaDoc, grammar, allContextFlags, parent, null);
- // If it's an empty particle, return null.
- if (particle.fType == XSParticleDecl.PARTICLE_EMPTY)
- particle = null;
- }
-
- return particle;
- }
-
- /**
- * Traverse a locally declared element (or an element reference).
- *
- * This is the real traversal method. It's called after we've done with
- * all the global declarations.
- *
- * @param index
- */
- protected void traverseLocal(XSParticleDecl particle,
- Element elmDecl,
- XSDocumentInfo schemaDoc,
- SchemaGrammar grammar,
- int allContextFlags,
- XSObject parent,
- String[] localNSDecls) {
-
- if (localNSDecls != null) {
- schemaDoc.fNamespaceSupport.setEffectiveContext(localNSDecls);
- }
-
- // General Attribute Checking
- Object[] attrValues = fAttrChecker.checkAttributes(elmDecl, false, schemaDoc);
-
- QName refAtt = (QName) attrValues[XSAttributeChecker.ATTIDX_REF];
- XInt minAtt = (XInt) attrValues[XSAttributeChecker.ATTIDX_MINOCCURS];
- XInt maxAtt = (XInt) attrValues[XSAttributeChecker.ATTIDX_MAXOCCURS];
-
- XSElementDecl element = null;
- XSAnnotationImpl annotation = null;
- if (elmDecl.getAttributeNode(SchemaSymbols.ATT_REF) != null) {
- if (refAtt != null) {
- element = (XSElementDecl)fSchemaHandler.getGlobalDecl(schemaDoc, XSDHandler.ELEMENT_TYPE, refAtt, elmDecl);
-
- Element child = DOMUtil.getFirstChildElement(elmDecl);
- if (child != null && DOMUtil.getLocalName(child).equals(SchemaSymbols.ELT_ANNOTATION)) {
- annotation = traverseAnnotationDecl(child, attrValues, false, schemaDoc);
- child = DOMUtil.getNextSiblingElement(child);
- }
- else {
- String text = DOMUtil.getSyntheticAnnotation(elmDecl);
- if (text != null) {
- annotation = traverseSyntheticAnnotation(elmDecl, text, attrValues, false, schemaDoc);
- }
- }
- // Element Declaration Representation OK
- // 2 If the item's parent is not <schema>, then all of the following must be true:
- // 2.1 One of ref or name must be present, but not both.
- // 2.2 If ref is present, then all of <complexType>, <simpleType>, <key>, <keyref>, <unique>, nillable, default, fixed, form, block and type must be absent, i.e. only minOccurs, maxOccurs, id are allowed in addition to ref, along with <annotation>.
- if (child != null) {
- reportSchemaError("src-element.2.2", new Object[]{refAtt.rawname, DOMUtil.getLocalName(child)}, child);
- }
- } else {
- element = null;
- }
- } else {
- element = traverseNamedElement(elmDecl, attrValues, schemaDoc, grammar, false, parent);
- }
-
- particle.fMinOccurs = minAtt.intValue();
- particle.fMaxOccurs = maxAtt.intValue();
- if (element != null) {
- particle.fType = XSParticleDecl.PARTICLE_ELEMENT;
- particle.fValue = element;
- }
- else {
- particle.fType = XSParticleDecl.PARTICLE_EMPTY;
- }
- if (refAtt != null) {
- XSObjectList annotations;
- if (annotation != null) {
- annotations = new XSObjectListImpl();
- ((XSObjectListImpl) annotations).addXSObject(annotation);
- } else {
- annotations = XSObjectListImpl.EMPTY_LIST;
- }
- particle.fAnnotations = annotations;
- } else {
- particle.fAnnotations = ((element != null) ? element.fAnnotations
- : XSObjectListImpl.EMPTY_LIST);
- }
- Long defaultVals = (Long)attrValues[XSAttributeChecker.ATTIDX_FROMDEFAULT];
- checkOccurrences(particle, SchemaSymbols.ELT_ELEMENT,
- (Element)elmDecl.getParentNode(), allContextFlags,
- defaultVals.longValue());
-
- fAttrChecker.returnAttrArray(attrValues, schemaDoc);
- }
-
- /**
- * Traverse a globally declared element.
- *
- * @param elmDecl
- * @param schemaDoc
- * @param grammar
- * @return the element declaration
- */
- XSElementDecl traverseGlobal(Element elmDecl,
- XSDocumentInfo schemaDoc,
- SchemaGrammar grammar) {
-
- // General Attribute Checking'
-
- Object[] attrValues = fAttrChecker.checkAttributes(elmDecl, true, schemaDoc);
- XSElementDecl element = traverseNamedElement(elmDecl, attrValues, schemaDoc, grammar, true, null);
- fAttrChecker.returnAttrArray(attrValues, schemaDoc);
- return element;
-
- }
-
- /**
- * Traverse a globally declared element.
- *
- * @param elmDecl
- * @param attrValues
- * @param schemaDoc
- * @param grammar
- * @param isGlobal
- * @return the element declaration
- */
- XSElementDecl traverseNamedElement(Element elmDecl,
- Object[] attrValues,
- XSDocumentInfo schemaDoc,
- SchemaGrammar grammar,
- boolean isGlobal,
- XSObject parent) {
-
- Boolean abstractAtt = (Boolean) attrValues[XSAttributeChecker.ATTIDX_ABSTRACT];
- XInt blockAtt = (XInt) attrValues[XSAttributeChecker.ATTIDX_BLOCK];
- String defaultAtt = (String) attrValues[XSAttributeChecker.ATTIDX_DEFAULT];
- XInt finalAtt = (XInt) attrValues[XSAttributeChecker.ATTIDX_FINAL];
- String fixedAtt = (String) attrValues[XSAttributeChecker.ATTIDX_FIXED];
- XInt formAtt = (XInt) attrValues[XSAttributeChecker.ATTIDX_FORM];
- String nameAtt = (String) attrValues[XSAttributeChecker.ATTIDX_NAME];
- Boolean nillableAtt = (Boolean) attrValues[XSAttributeChecker.ATTIDX_NILLABLE];
- QName subGroupAtt = (QName) attrValues[XSAttributeChecker.ATTIDX_SUBSGROUP];
- QName typeAtt = (QName) attrValues[XSAttributeChecker.ATTIDX_TYPE];
-
- // Step 1: get declaration information
-
- XSElementDecl element = null;
- if (fSchemaHandler.fDeclPool !=null) {
- element = fSchemaHandler.fDeclPool.getElementDecl();
- } else {
- element = new XSElementDecl();
- }
- // get 'name'
- if (nameAtt != null)
- element.fName = fSymbolTable.addSymbol(nameAtt);
-
- // get 'target namespace'
- if (isGlobal) {
- element.fTargetNamespace = schemaDoc.fTargetNamespace;
- element.setIsGlobal();
- }
- else {
- if (parent instanceof XSComplexTypeDecl)
- element.setIsLocal((XSComplexTypeDecl)parent);
-
- if (formAtt != null) {
- if (formAtt.intValue() == SchemaSymbols.FORM_QUALIFIED)
- element.fTargetNamespace = schemaDoc.fTargetNamespace;
- else
- element.fTargetNamespace = null;
- } else if (schemaDoc.fAreLocalElementsQualified) {
- element.fTargetNamespace = schemaDoc.fTargetNamespace;
- } else {
- element.fTargetNamespace = null;
- }
- }
-
- // get 'block', 'final', 'nillable', 'abstract'
- if (blockAtt == null) {
- // use defaults
- element.fBlock = schemaDoc.fBlockDefault;
- // discard valid Block 'Default' values that are invalid for Block
- // respect #all
- if (element.fBlock != XSConstants.DERIVATION_ALL) {
- element.fBlock &= (XSConstants.DERIVATION_EXTENSION | XSConstants.DERIVATION_RESTRICTION | XSConstants.DERIVATION_SUBSTITUTION);
- }
- } else {
- // use specified values
- element.fBlock = blockAtt.shortValue();
- // check for valid values
- if ((element.fBlock != XSConstants.DERIVATION_ALL)
- &&
- ((element.fBlock | XSConstants.DERIVATION_EXTENSION_RESTRICTION_SUBSTITION)
- != XSConstants.DERIVATION_EXTENSION_RESTRICTION_SUBSTITION)) {
- reportSchemaError(
- "s4s-att-invalid-value",
- new Object[]{element.fName, "block", "must be (#all | List of (extension | restriction | substitution))"},
- elmDecl);
- }
- }
-
- element.fFinal = finalAtt == null ? schemaDoc.fFinalDefault : finalAtt.shortValue();
- // discard valid Final 'Default' values that are invalid for Final
- element.fFinal &= (XSConstants.DERIVATION_EXTENSION | XSConstants.DERIVATION_RESTRICTION);
-
- if (nillableAtt.booleanValue())
- element.setIsNillable();
- if (abstractAtt != null && abstractAtt.booleanValue())
- element.setIsAbstract();
-
- // get 'value constraint'
- if (fixedAtt != null) {
- element.fDefault = new ValidatedInfo();
- element.fDefault.normalizedValue = fixedAtt;
- element.setConstraintType(XSConstants.VC_FIXED);
- } else if (defaultAtt != null) {
- element.fDefault = new ValidatedInfo();
- element.fDefault.normalizedValue = defaultAtt;
- element.setConstraintType(XSConstants.VC_DEFAULT);
- } else {
- element.setConstraintType(XSConstants.VC_NONE);
- }
-
- // get 'substitutionGroup affiliation'
- if (subGroupAtt != null) {
- element.fSubGroup = (XSElementDecl)fSchemaHandler.getGlobalDecl(schemaDoc, XSDHandler.ELEMENT_TYPE, subGroupAtt, elmDecl);
- }
-
- // get 'annotation'
- Element child = DOMUtil.getFirstChildElement(elmDecl);
- XSAnnotationImpl annotation = null;
- if(child != null && DOMUtil.getLocalName(child).equals(SchemaSymbols.ELT_ANNOTATION)) {
- annotation = traverseAnnotationDecl(child, attrValues, false, schemaDoc);
- child = DOMUtil.getNextSiblingElement(child);
- }
- else {
- String text = DOMUtil.getSyntheticAnnotation(elmDecl);
- if (text != null) {
- annotation = traverseSyntheticAnnotation(elmDecl, text, attrValues, false, schemaDoc);
- }
- }
-
- XSObjectList annotations;
- if (annotation != null) {
- annotations = new XSObjectListImpl();
- ((XSObjectListImpl)annotations).addXSObject (annotation);
- } else {
- annotations = XSObjectListImpl.EMPTY_LIST;
- }
- element.fAnnotations = annotations;
-
- // get 'type definition'
- XSTypeDefinition elementType = null;
- boolean haveAnonType = false;
-
- // Handle Anonymous type if there is one
- if (child != null) {
- String childName = DOMUtil.getLocalName(child);
-
- if (childName.equals(SchemaSymbols.ELT_COMPLEXTYPE)) {
- elementType = fSchemaHandler.fComplexTypeTraverser.traverseLocal(child, schemaDoc, grammar);
- haveAnonType = true;
- child = DOMUtil.getNextSiblingElement(child);
- }
- else if (childName.equals(SchemaSymbols.ELT_SIMPLETYPE)) {
- elementType = fSchemaHandler.fSimpleTypeTraverser.traverseLocal(child, schemaDoc, grammar);
- haveAnonType = true;
- child = DOMUtil.getNextSiblingElement(child);
- }
- }
-
- // Handler type attribute
- if (elementType == null && typeAtt != null) {
- elementType = (XSTypeDefinition)fSchemaHandler.getGlobalDecl(schemaDoc, XSDHandler.TYPEDECL_TYPE, typeAtt, elmDecl);
- if (elementType == null) {
- element.fUnresolvedTypeName = typeAtt;
- }
- }
-
- // Get it from the substitutionGroup declaration
- if (elementType == null && element.fSubGroup != null) {
- elementType = element.fSubGroup.fType;
- }
-
- if (elementType == null) {
- elementType = SchemaGrammar.fAnyType;
- }
-
- element.fType = elementType;
-
- // get 'identity constraint'
-
- // see if there's something here; it had better be key, keyref or unique.
- if (child != null) {
- String childName = DOMUtil.getLocalName(child);
- while (child != null &&
- (childName.equals(SchemaSymbols.ELT_KEY) ||
- childName.equals(SchemaSymbols.ELT_KEYREF) ||
- childName.equals(SchemaSymbols.ELT_UNIQUE))) {
-
- if (childName.equals(SchemaSymbols.ELT_KEY) ||
- childName.equals(SchemaSymbols.ELT_UNIQUE)) {
- // need to set <key>/<unique> to hidden before traversing it,
- // because it has global scope
- DOMUtil.setHidden(child, fSchemaHandler.fHiddenNodes);
- fSchemaHandler.fUniqueOrKeyTraverser.traverse(child, element, schemaDoc, grammar);
- if(DOMUtil.getAttrValue(child, SchemaSymbols.ATT_NAME).length() != 0 ) {
- fSchemaHandler.checkForDuplicateNames(
- (schemaDoc.fTargetNamespace == null) ? ","+DOMUtil.getAttrValue(child, SchemaSymbols.ATT_NAME)
- : schemaDoc.fTargetNamespace+","+ DOMUtil.getAttrValue(child, SchemaSymbols.ATT_NAME),
- fSchemaHandler.ATTRIBUTE_TYPE, fSchemaHandler.getIDRegistry(), fSchemaHandler.getIDRegistry_sub(),
- child, schemaDoc);
- }
- } else if (childName.equals(SchemaSymbols.ELT_KEYREF)) {
- fSchemaHandler.storeKeyRef(child, schemaDoc, element);
- }
- child = DOMUtil.getNextSiblingElement(child);
- if (child != null) {
- childName = DOMUtil.getLocalName(child);
- }
- }
- }
-
- // Step 3: check against schema for schemas
-
- // required attributes
- if (nameAtt == null) {
- if (isGlobal)
- reportSchemaError("s4s-att-must-appear", new Object[]{SchemaSymbols.ELT_ELEMENT, SchemaSymbols.ATT_NAME}, elmDecl);
- else
- reportSchemaError("src-element.2.1", null, elmDecl);
- nameAtt = NO_NAME;
- }
-
- // element
- if (child != null) {
- reportSchemaError("s4s-elt-must-match.1", new Object[]{nameAtt, "(annotation?, (simpleType | complexType)?, (unique | key | keyref)*))", DOMUtil.getLocalName(child)}, child);
- }
-
- // Step 4: check 3.3.3 constraints
-
- // src-element
-
- // 1 default and fixed must not both be present.
- if (defaultAtt != null && fixedAtt != null) {
- reportSchemaError("src-element.1", new Object[]{nameAtt}, elmDecl);
- }
-
- // 2 If the item's parent is not <schema>, then all of the following must be true:
- // 2.1 One of ref or name must be present, but not both.
- // This is checked in XSAttributeChecker
-
- // 2.2 If ref is present, then all of <complexType>, <simpleType>, <key>, <keyref>, <unique>, nillable, default, fixed, form, block and type must be absent, i.e. only minOccurs, maxOccurs, id are allowed in addition to ref, along with <annotation>.
- // Attributes are checked in XSAttributeChecker, elements are checked in "traverse" method
-
- // 3 type and either <simpleType> or <complexType> are mutually exclusive.
- if (haveAnonType && (typeAtt != null)) {
- reportSchemaError("src-element.3", new Object[]{nameAtt}, elmDecl);
- }
-
- // Step 5: check 3.3.6 constraints
- // check for NOTATION type
- checkNotationType(nameAtt, elementType, elmDecl);
-
- // e-props-correct
-
- // 2 If there is a {value constraint}, the canonical lexical representation of its value must be valid with respect to the {type definition} as defined in Element Default Valid (Immediate) (3.3.6).
- if (element.fDefault != null) {
- fValidationState.setNamespaceSupport(schemaDoc.fNamespaceSupport);
- if (XSConstraints.ElementDefaultValidImmediate(element.fType, element.fDefault.normalizedValue, fValidationState, element.fDefault) == null) {
- reportSchemaError ("e-props-correct.2", new Object[]{nameAtt, element.fDefault.normalizedValue}, elmDecl);
- element.fDefault = null;
- element.setConstraintType(XSConstants.VC_NONE);
- }
- }
-
- // 4 If there is an {substitution group affiliation}, the {type definition} of the element declaration must be validly derived from the {type definition} of the {substitution group affiliation}, given the value of the {substitution group exclusions} of the {substitution group affiliation}, as defined in Type Derivation OK (Complex) (3.4.6) (if the {type definition} is complex) or as defined in Type Derivation OK (Simple) (3.14.6) (if the {type definition} is simple).
- if (element.fSubGroup != null) {
- if (!XSConstraints.checkTypeDerivationOk(element.fType, element.fSubGroup.fType, element.fSubGroup.fFinal)) {
- reportSchemaError ("e-props-correct.4", new Object[]{nameAtt, subGroupAtt.prefix+":"+subGroupAtt.localpart}, elmDecl);
- element.fSubGroup = null;
- }
- }
-
- // 5 If the {type definition} or {type definition}'s {content type} is or is derived from ID then there must not be a {value constraint}.
- if (element.fDefault != null) {
- if ((elementType.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE &&
- ((XSSimpleType)elementType).isIDType()) ||
- (elementType.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE &&
- ((XSComplexTypeDecl)elementType).containsTypeID())) {
- reportSchemaError ("e-props-correct.5", new Object[]{element.fName}, elmDecl);
- element.fDefault = null;
- element.setConstraintType(XSConstants.VC_NONE);
- }
- }
-
- // Element without a name. Return null.
- if (element.fName == null)
- return null;
-
- // Step 5: register the element decl to the grammar
- if (isGlobal) {
- grammar.addGlobalElementDeclAll(element);
-
- if (grammar.getGlobalElementDecl(element.fName) == null) {
- grammar.addGlobalElementDecl(element);
- }
-
- // we also add the element to the tolerate duplicates list as well
- final String loc = fSchemaHandler.schemaDocument2SystemId(schemaDoc);
- final XSElementDecl element2 = grammar.getGlobalElementDecl(element.fName, loc);
- if (element2 == null) {
- grammar.addGlobalElementDecl(element, loc);
- }
-
- // if we are tolerating duplicates, and we found a duplicate declaration
- // use the duplicate one instead
- if (fSchemaHandler.fTolerateDuplicates) {
- if (element2 != null) {
- element = element2;
- }
- fSchemaHandler.addGlobalElementDecl(element);
- }
- }
-
- return element;
- }
-
- void reset(SymbolTable symbolTable, boolean validateAnnotations, Locale locale) {
- super.reset(symbolTable, validateAnnotations, locale);
- fDeferTraversingLocalElements = true;
- } // reset()
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDGroupTraverser.java b/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDGroupTraverser.java
deleted file mode 100644
index 915f482..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDGroupTraverser.java
+++ /dev/null
@@ -1,269 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xerces.internal.impl.xs.traversers;
-
-import com.sun.org.apache.xerces.internal.impl.xs.SchemaGrammar;
-import com.sun.org.apache.xerces.internal.impl.xs.SchemaSymbols;
-import com.sun.org.apache.xerces.internal.impl.xs.XSAnnotationImpl;
-import com.sun.org.apache.xerces.internal.impl.xs.XSConstraints;
-import com.sun.org.apache.xerces.internal.impl.xs.XSGroupDecl;
-import com.sun.org.apache.xerces.internal.impl.xs.XSModelGroupImpl;
-import com.sun.org.apache.xerces.internal.impl.xs.XSParticleDecl;
-import com.sun.org.apache.xerces.internal.impl.xs.util.XInt;
-import com.sun.org.apache.xerces.internal.impl.xs.util.XSObjectListImpl;
-import com.sun.org.apache.xerces.internal.util.DOMUtil;
-import com.sun.org.apache.xerces.internal.util.XMLSymbols;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xs.XSObjectList;
-import org.w3c.dom.Element;
-
-/**
- * The model group schema component traverser.
- *
- * <group
- * name = NCName>
- * Content: (annotation?, (all | choice | sequence))
- * </group>
- *
- * @xerces.internal
- *
- * @author Rahul Srivastava, Sun Microsystems Inc.
- * @author Elena Litani, IBM
- * @author Lisa Martin, IBM
- * @version $Id: XSDGroupTraverser.java,v 1.7 2010-11-01 04:40:02 joehw Exp $
- */
-class XSDGroupTraverser extends XSDAbstractParticleTraverser {
-
- XSDGroupTraverser (XSDHandler handler,
- XSAttributeChecker gAttrCheck) {
-
- super(handler, gAttrCheck);
- }
-
- XSParticleDecl traverseLocal(Element elmNode,
- XSDocumentInfo schemaDoc,
- SchemaGrammar grammar) {
-
- // General Attribute Checking for elmNode declared locally
- Object[] attrValues = fAttrChecker.checkAttributes(elmNode, false,
- schemaDoc);
- QName refAttr = (QName) attrValues[XSAttributeChecker.ATTIDX_REF];
- XInt minAttr = (XInt) attrValues[XSAttributeChecker.ATTIDX_MINOCCURS];
- XInt maxAttr = (XInt) attrValues[XSAttributeChecker.ATTIDX_MAXOCCURS];
-
- XSGroupDecl group = null;
-
- // ref should be here.
- if (refAttr == null) {
- reportSchemaError("s4s-att-must-appear", new Object[]{"group (local)", "ref"}, elmNode);
- } else {
- // get global decl
- // index is a particle index.
- group = (XSGroupDecl)fSchemaHandler.getGlobalDecl(schemaDoc, XSDHandler.GROUP_TYPE, refAttr, elmNode);
- }
-
- XSAnnotationImpl annotation = null;
- // no children other than "annotation?" are allowed
- Element child = DOMUtil.getFirstChildElement(elmNode);
- if (child != null && DOMUtil.getLocalName(child).equals(SchemaSymbols.ELT_ANNOTATION)) {
- annotation = traverseAnnotationDecl(child, attrValues, false, schemaDoc);
- child = DOMUtil.getNextSiblingElement(child);
- }
- else {
- String text = DOMUtil.getSyntheticAnnotation(elmNode);
- if (text != null) {
- annotation = traverseSyntheticAnnotation(elmNode, text, attrValues, false, schemaDoc);
- }
- }
-
- if (child != null) {
- reportSchemaError("s4s-elt-must-match.1", new Object[]{"group (local)", "(annotation?)", DOMUtil.getLocalName(elmNode)}, elmNode);
- }
-
- int minOccurs = minAttr.intValue();
- int maxOccurs = maxAttr.intValue();
-
- XSParticleDecl particle = null;
-
- // not empty group, not empty particle
- if (group != null && group.fModelGroup != null &&
- !(minOccurs == 0 && maxOccurs == 0)) {
- // create a particle to contain this model group
- if (fSchemaHandler.fDeclPool != null) {
- particle = fSchemaHandler.fDeclPool.getParticleDecl();
- } else {
- particle = new XSParticleDecl();
- }
- particle.fType = XSParticleDecl.PARTICLE_MODELGROUP;
- particle.fValue = group.fModelGroup;
- particle.fMinOccurs = minOccurs;
- particle.fMaxOccurs = maxOccurs;
- if (group.fModelGroup.fCompositor == XSModelGroupImpl.MODELGROUP_ALL) {
- Long defaultVals = (Long)attrValues[XSAttributeChecker.ATTIDX_FROMDEFAULT];
- particle = checkOccurrences(particle, SchemaSymbols.ELT_GROUP,
- (Element)elmNode.getParentNode(), GROUP_REF_WITH_ALL,
- defaultVals.longValue());
- }
- if (refAttr != null) {
- XSObjectList annotations;
- if (annotation != null) {
- annotations = new XSObjectListImpl();
- ((XSObjectListImpl) annotations).addXSObject(annotation);
- } else {
- annotations = XSObjectListImpl.EMPTY_LIST;
- }
- particle.fAnnotations = annotations;
- } else {
- particle.fAnnotations = group.fAnnotations;
- }
- }
-
- fAttrChecker.returnAttrArray(attrValues, schemaDoc);
-
- return particle;
-
- } // traverseLocal
-
- XSGroupDecl traverseGlobal(Element elmNode,
- XSDocumentInfo schemaDoc,
- SchemaGrammar grammar) {
-
- // General Attribute Checking for elmNode declared globally
- Object[] attrValues = fAttrChecker.checkAttributes(elmNode, true,
- schemaDoc);
- String strNameAttr = (String) attrValues[XSAttributeChecker.ATTIDX_NAME];
-
- // must have a name
- if (strNameAttr == null) {
- reportSchemaError("s4s-att-must-appear", new Object[]{"group (global)", "name"}, elmNode);
- }
-
- // Create the group defi up-front, so it can be passed
- // to the traversal methods
- XSGroupDecl group = new XSGroupDecl();
- XSParticleDecl particle = null;
-
- // must have at least one child
- Element l_elmChild = DOMUtil.getFirstChildElement(elmNode);
- XSAnnotationImpl annotation = null;
- if (l_elmChild == null) {
- reportSchemaError("s4s-elt-must-match.2",
- new Object[]{"group (global)", "(annotation?, (all | choice | sequence))"},
- elmNode);
- } else {
- String childName = l_elmChild.getLocalName();
- if (childName.equals(SchemaSymbols.ELT_ANNOTATION)) {
- annotation = traverseAnnotationDecl(l_elmChild, attrValues, true, schemaDoc);
- l_elmChild = DOMUtil.getNextSiblingElement(l_elmChild);
- if (l_elmChild != null)
- childName = l_elmChild.getLocalName();
- }
- else {
- String text = DOMUtil.getSyntheticAnnotation(elmNode);
- if (text != null) {
- annotation = traverseSyntheticAnnotation(elmNode, text, attrValues, false, schemaDoc);
- }
- }
-
- if (l_elmChild == null) {
- reportSchemaError("s4s-elt-must-match.2",
- new Object[]{"group (global)", "(annotation?, (all | choice | sequence))"},
- elmNode);
- } else if (childName.equals(SchemaSymbols.ELT_ALL)) {
- particle = traverseAll(l_elmChild, schemaDoc, grammar, CHILD_OF_GROUP, group);
- } else if (childName.equals(SchemaSymbols.ELT_CHOICE)) {
- particle = traverseChoice(l_elmChild, schemaDoc, grammar, CHILD_OF_GROUP, group);
- } else if (childName.equals(SchemaSymbols.ELT_SEQUENCE)) {
- particle = traverseSequence(l_elmChild, schemaDoc, grammar, CHILD_OF_GROUP, group);
- } else {
- reportSchemaError("s4s-elt-must-match.1",
- new Object[]{"group (global)", "(annotation?, (all | choice | sequence))", DOMUtil.getLocalName(l_elmChild)},
- l_elmChild);
- }
-
- if (l_elmChild != null &&
- DOMUtil.getNextSiblingElement(l_elmChild) != null) {
- reportSchemaError("s4s-elt-must-match.1",
- new Object[]{"group (global)", "(annotation?, (all | choice | sequence))",
- DOMUtil.getLocalName(DOMUtil.getNextSiblingElement(l_elmChild))},
- DOMUtil.getNextSiblingElement(l_elmChild));
- }
- }
-
- // add global group declaration to the grammar
- if (strNameAttr != null) {
- group.fName = strNameAttr;
- group.fTargetNamespace = schemaDoc.fTargetNamespace;
- if (particle == null) {
- particle = XSConstraints.getEmptySequence();
- }
- group.fModelGroup = (XSModelGroupImpl)particle.fValue;
- XSObjectList annotations;
- if (annotation != null) {
- annotations = new XSObjectListImpl();
- ((XSObjectListImpl) annotations).addXSObject(annotation);
- } else {
- annotations = XSObjectListImpl.EMPTY_LIST;
- }
- group.fAnnotations = annotations;
- // Add group declaration to grammar
- if (grammar.getGlobalGroupDecl(group.fName) == null) {
- grammar.addGlobalGroupDecl(group);
- }
-
- // also add it to extended map
- final String loc = fSchemaHandler.schemaDocument2SystemId(schemaDoc);
- final XSGroupDecl group2 = grammar.getGlobalGroupDecl(group.fName, loc);
- if (group2 == null) {
- grammar.addGlobalGroupDecl(group, loc);
- }
-
- // handle duplicates
- if (fSchemaHandler.fTolerateDuplicates) {
- if (group2 != null) {
- group = group2;
- }
- fSchemaHandler.addGlobalGroupDecl(group);
- }
- }
- else {
- // name attribute is not there, don't return this group.
- group = null;
- }
-
- if (group != null) {
- // store groups redefined by restriction in the grammar so
- // that we can get at them at full-schema-checking time.
- Object redefinedGrp = fSchemaHandler.getGrpOrAttrGrpRedefinedByRestriction(XSDHandler.GROUP_TYPE,
- new QName(XMLSymbols.EMPTY_STRING, strNameAttr, strNameAttr, schemaDoc.fTargetNamespace),
- schemaDoc, elmNode);
- if (redefinedGrp != null) {
- // store in grammar
- grammar.addRedefinedGroupDecl(group, (XSGroupDecl)redefinedGrp,
- fSchemaHandler.element2Locator(elmNode));
- }
- }
-
- fAttrChecker.returnAttrArray(attrValues, schemaDoc);
-
- return group;
-
- } // traverseGlobal
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java b/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java
deleted file mode 100644
index e29554d..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java
+++ /dev/null
@@ -1,4336 +0,0 @@
-/*
- * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.traversers;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.XMLEntityManager;
-import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
-import com.sun.org.apache.xerces.internal.impl.dv.SchemaDVFactory;
-import com.sun.org.apache.xerces.internal.impl.dv.xs.XSSimpleTypeDecl;
-import com.sun.org.apache.xerces.internal.impl.xs.SchemaGrammar;
-import com.sun.org.apache.xerces.internal.impl.xs.SchemaNamespaceSupport;
-import com.sun.org.apache.xerces.internal.impl.xs.SchemaSymbols;
-import com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaException;
-import com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader;
-import com.sun.org.apache.xerces.internal.impl.xs.XSAttributeDecl;
-import com.sun.org.apache.xerces.internal.impl.xs.XSAttributeGroupDecl;
-import com.sun.org.apache.xerces.internal.impl.xs.XSComplexTypeDecl;
-import com.sun.org.apache.xerces.internal.impl.xs.XSDDescription;
-import com.sun.org.apache.xerces.internal.impl.xs.XSDeclarationPool;
-import com.sun.org.apache.xerces.internal.impl.xs.XSElementDecl;
-import com.sun.org.apache.xerces.internal.impl.xs.XSGrammarBucket;
-import com.sun.org.apache.xerces.internal.impl.xs.XSGroupDecl;
-import com.sun.org.apache.xerces.internal.impl.xs.XSMessageFormatter;
-import com.sun.org.apache.xerces.internal.impl.xs.XSModelGroupImpl;
-import com.sun.org.apache.xerces.internal.impl.xs.XSNotationDecl;
-import com.sun.org.apache.xerces.internal.impl.xs.XSParticleDecl;
-import com.sun.org.apache.xerces.internal.impl.xs.identity.IdentityConstraint;
-import com.sun.org.apache.xerces.internal.impl.xs.opti.ElementImpl;
-import com.sun.org.apache.xerces.internal.impl.xs.opti.SchemaDOMParser;
-import com.sun.org.apache.xerces.internal.impl.xs.opti.SchemaParsingConfig;
-import com.sun.org.apache.xerces.internal.impl.xs.util.SimpleLocator;
-import com.sun.org.apache.xerces.internal.impl.xs.util.XSInputSource;
-import com.sun.org.apache.xerces.internal.parsers.SAXParser;
-import com.sun.org.apache.xerces.internal.parsers.XML11Configuration;
-import com.sun.org.apache.xerces.internal.util.DOMInputSource;
-import com.sun.org.apache.xerces.internal.util.DOMUtil;
-import com.sun.org.apache.xerces.internal.util.DefaultErrorHandler;
-import com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper;
-import com.sun.org.apache.xerces.internal.util.SAXInputSource;
-import com.sun.org.apache.xerces.internal.util.StAXInputSource;
-import com.sun.org.apache.xerces.internal.util.StAXLocationWrapper;
-import com.sun.org.apache.xerces.internal.util.SymbolHash;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.util.URI.MalformedURIException;
-import com.sun.org.apache.xerces.internal.util.XMLSymbols;
-import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.grammars.Grammar;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLSchemaDescription;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLEntityResolver;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLParseException;
-import com.sun.org.apache.xerces.internal.xs.StringList;
-import com.sun.org.apache.xerces.internal.xs.XSAttributeDeclaration;
-import com.sun.org.apache.xerces.internal.xs.XSAttributeGroupDefinition;
-import com.sun.org.apache.xerces.internal.xs.XSAttributeUse;
-import com.sun.org.apache.xerces.internal.xs.XSConstants;
-import com.sun.org.apache.xerces.internal.xs.XSElementDeclaration;
-import com.sun.org.apache.xerces.internal.xs.XSModelGroup;
-import com.sun.org.apache.xerces.internal.xs.XSModelGroupDefinition;
-import com.sun.org.apache.xerces.internal.xs.XSNamedMap;
-import com.sun.org.apache.xerces.internal.xs.XSObject;
-import com.sun.org.apache.xerces.internal.xs.XSObjectList;
-import com.sun.org.apache.xerces.internal.xs.XSParticle;
-import com.sun.org.apache.xerces.internal.xs.XSSimpleTypeDefinition;
-import com.sun.org.apache.xerces.internal.xs.XSTerm;
-import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
-import com.sun.org.apache.xerces.internal.xs.datatypes.ObjectList;
-import java.io.IOException;
-import java.io.StringReader;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Stack;
-import java.util.Vector;
-import javax.xml.XMLConstants;
-import javax.xml.stream.XMLEventReader;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.helpers.XMLReaderFactory;
-
-/**
- * The purpose of this class is to co-ordinate the construction of a
- * grammar object corresponding to a schema. To do this, it must be
- * prepared to parse several schema documents (for instance if the
- * schema document originally referred to contains <include> or
- * <redefined> information items). If any of the schemas imports a
- * schema, other grammars may be constructed as a side-effect.
- *
- * @xerces.internal
- *
- * @author Neil Graham, IBM
- * @author Pavani Mukthipudi, Sun Microsystems
- *
- * @version $Id: XSDHandler.java,v 1.9 2010-11-01 04:40:02 joehw Exp $
- */
-public class XSDHandler {
-
- /** Feature identifier: validation. */
- protected static final String VALIDATION =
- Constants.SAX_FEATURE_PREFIX + Constants.VALIDATION_FEATURE;
-
- /** feature identifier: XML Schema validation */
- protected static final String XMLSCHEMA_VALIDATION =
- Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_VALIDATION_FEATURE;
-
- /** Feature identifier: allow java encodings */
- protected static final String ALLOW_JAVA_ENCODINGS =
- Constants.XERCES_FEATURE_PREFIX + Constants.ALLOW_JAVA_ENCODINGS_FEATURE;
-
- /** Feature identifier: continue after fatal error */
- protected static final String CONTINUE_AFTER_FATAL_ERROR =
- Constants.XERCES_FEATURE_PREFIX + Constants.CONTINUE_AFTER_FATAL_ERROR_FEATURE;
-
- /** Feature identifier: allow java encodings */
- protected static final String STANDARD_URI_CONFORMANT_FEATURE =
- Constants.XERCES_FEATURE_PREFIX + Constants.STANDARD_URI_CONFORMANT_FEATURE;
-
- /** Feature: disallow doctype*/
- protected static final String DISALLOW_DOCTYPE =
- Constants.XERCES_FEATURE_PREFIX + Constants.DISALLOW_DOCTYPE_DECL_FEATURE;
-
- /** Feature: generate synthetic annotations */
- protected static final String GENERATE_SYNTHETIC_ANNOTATIONS =
- Constants.XERCES_FEATURE_PREFIX + Constants.GENERATE_SYNTHETIC_ANNOTATIONS_FEATURE;
-
- /** Feature identifier: validate annotations. */
- protected static final String VALIDATE_ANNOTATIONS =
- Constants.XERCES_FEATURE_PREFIX + Constants.VALIDATE_ANNOTATIONS_FEATURE;
-
- /** Feature identifier: honour all schemaLocations */
- protected static final String HONOUR_ALL_SCHEMALOCATIONS =
- Constants.XERCES_FEATURE_PREFIX + Constants.HONOUR_ALL_SCHEMALOCATIONS_FEATURE;
-
- /** Feature identifier: namespace growth */
- protected static final String NAMESPACE_GROWTH =
- Constants.XERCES_FEATURE_PREFIX + Constants.NAMESPACE_GROWTH_FEATURE;
-
- /** Feature identifier: tolerate duplicates */
- protected static final String TOLERATE_DUPLICATES =
- Constants.XERCES_FEATURE_PREFIX + Constants.TOLERATE_DUPLICATES_FEATURE;
-
- /** Feature identifier: namespace prefixes. */
- private static final String NAMESPACE_PREFIXES =
- Constants.SAX_FEATURE_PREFIX + Constants.NAMESPACE_PREFIXES_FEATURE;
-
- /** Feature identifier: string interning. */
- protected static final String STRING_INTERNING =
- Constants.SAX_FEATURE_PREFIX + Constants.STRING_INTERNING_FEATURE;
-
- /** Property identifier: error handler. */
- protected static final String ERROR_HANDLER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_HANDLER_PROPERTY;
-
- /** Property identifier: JAXP schema source. */
- protected static final String JAXP_SCHEMA_SOURCE =
- Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_SOURCE;
-
- /** Property identifier: entity resolver. */
- public static final String ENTITY_RESOLVER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_RESOLVER_PROPERTY;
-
- /** Property identifier: entity manager. */
- protected static final String ENTITY_MANAGER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_MANAGER_PROPERTY;
-
- /** Property identifier: error reporter. */
- public static final String ERROR_REPORTER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY;
-
- /** Property identifier: grammar pool. */
- public static final String XMLGRAMMAR_POOL =
- Constants.XERCES_PROPERTY_PREFIX + Constants.XMLGRAMMAR_POOL_PROPERTY;
-
- /** Property identifier: symbol table. */
- public static final String SYMBOL_TABLE =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY;
-
- /** Property identifier: security manager. */
- protected static final String SECURITY_MANAGER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SECURITY_MANAGER_PROPERTY;
-
- /** Property identifier: locale. */
- protected static final String LOCALE =
- Constants.XERCES_PROPERTY_PREFIX + Constants.LOCALE_PROPERTY;
-
- /** Property identifier: Security property manager. */
- private static final String XML_SECURITY_PROPERTY_MANAGER =
- Constants.XML_SECURITY_PROPERTY_MANAGER;
-
- protected static final boolean DEBUG_NODE_POOL = false;
-
- // Data
-
- // different sorts of declarations; should make lookup and
- // traverser calling more efficient/less bulky.
- final static int ATTRIBUTE_TYPE = 1;
- final static int ATTRIBUTEGROUP_TYPE = 2;
- final static int ELEMENT_TYPE = 3;
- final static int GROUP_TYPE = 4;
- final static int IDENTITYCONSTRAINT_TYPE = 5;
- final static int NOTATION_TYPE = 6;
- final static int TYPEDECL_TYPE = 7;
-
- // this string gets appended to redefined names; it's purpose is to be
- // as unlikely as possible to cause collisions.
- public final static String REDEF_IDENTIFIER = "_fn3dktizrknc9pi";
-
- //protected data that can be accessible by any traverser
-
- protected XSDeclarationPool fDeclPool = null;
-
- // the Security manager in effect.
- protected XMLSecurityManager fSecurityManager = null;
-
- private String fAccessExternalSchema;
- private String fAccessExternalDTD;
-
- // These tables correspond to the symbol spaces defined in the
- // spec.
- // They are keyed with a QName (that is, String("URI,localpart) and
- // their values are nodes corresponding to the given name's decl.
- // By asking the node for its ownerDocument and looking in
- // XSDocumentInfoRegistry we can easily get the corresponding
- // XSDocumentInfo object.
- private boolean registryEmpty = true;
- private Map<String, Element> fUnparsedAttributeRegistry = new HashMap<>();
- private Map<String, Element> fUnparsedAttributeGroupRegistry = new HashMap<>();
- private Map<String, Element> fUnparsedElementRegistry = new HashMap<>();
- private Map<String, Element> fUnparsedGroupRegistry = new HashMap<>();
- private Map<String, Element> fUnparsedIdentityConstraintRegistry = new HashMap<>();
- private Map<String, Element> fUnparsedNotationRegistry = new HashMap<>();
- private Map<String, Element> fUnparsedTypeRegistry = new HashMap<>();
- // Compensation for the above maps to locate XSDocumentInfo,
- // Since we may take Schema Element directly, so can not get the
- // corresponding XSDocumentInfo object just using above maps.
- private Map<String, XSDocumentInfo> fUnparsedAttributeRegistrySub = new HashMap<>();
- private Map<String, XSDocumentInfo> fUnparsedAttributeGroupRegistrySub = new HashMap<>();
- private Map<String, XSDocumentInfo> fUnparsedElementRegistrySub = new HashMap<>();
- private Map<String, XSDocumentInfo> fUnparsedGroupRegistrySub = new HashMap<>();
- private Map<String, XSDocumentInfo> fUnparsedIdentityConstraintRegistrySub = new HashMap<>();
- private Map<String, XSDocumentInfo> fUnparsedNotationRegistrySub = new HashMap<>();
- private Map<String, XSDocumentInfo> fUnparsedTypeRegistrySub = new HashMap<>();
-
- // Stores XSDocumentInfo (keyed by component name), to check for duplicate
- // components declared within the same xsd document
- @SuppressWarnings("unchecked")
- private Map<String, XSDocumentInfo> fUnparsedRegistriesExt[] = new HashMap[] {
- null,
- null, // ATTRIBUTE_TYPE
- null, // ATTRIBUTEGROUP_TYPE
- null, // ELEMENT_TYPE
- null, // GROUP_TYPE
- null, // IDENTITYCONSTRAINT_TYPE
- null, // NOTATION_TYPE
- null, // TYPEDECL_TYPE
- };
-
- // this map is keyed on by XSDocumentInfo objects. Its values
- // are Vectors containing the XSDocumentInfo objects <include>d,
- // <import>ed or <redefine>d by the key XSDocumentInfo.
- private Map<XSDocumentInfo, Vector<XSDocumentInfo>> fDependencyMap = new HashMap<>();
-
- // this map is keyed on by a target namespace. Its values
- // are Vectors containing namespaces imported by schema documents
- // with the key target namespace.
- // if an imported schema has absent namespace, the value "null" is stored.
- private Map<String, Vector> fImportMap = new HashMap<> ();
-
- // all namespaces that imports other namespaces
- // if the importing schema has absent namespace, empty string is stored.
- // (because the key of a map can't be null.)
- private Vector<String> fAllTNSs = new Vector<>();
-
- // stores instance document mappings between namespaces and schema hints
- private Map<String, XMLSchemaLoader.LocationArray> fLocationPairs = null;
-
- // Records which nodes are hidden when the input is a DOMInputSource.
- Map<Node, String> fHiddenNodes = null;
-
- // convenience methods
- private String null2EmptyString(String ns) {
- return ns == null ? XMLSymbols.EMPTY_STRING : ns;
- }
- private String emptyString2Null(String ns) {
- return ns == XMLSymbols.EMPTY_STRING ? null : ns;
- }
- // use Schema Element to lookup the SystemId.
- private String doc2SystemId(Element ele) {
- String documentURI = null;
- /**
- * REVISIT: Casting until DOM Level 3 interfaces are available. -- mrglavas
- */
- if(ele.getOwnerDocument() instanceof com.sun.org.apache.xerces.internal.impl.xs.opti.SchemaDOM){
- documentURI = ((com.sun.org.apache.xerces.internal.impl.xs.opti.SchemaDOM) ele.getOwnerDocument()).getDocumentURI();
- }
- return documentURI != null ? documentURI : fDoc2SystemId.get(ele);
- }
-
- // This vector stores strings which are combinations of the
- // publicId and systemId of the inputSource corresponding to a
- // schema document. This combination is used so that the user's
- // EntityResolver can provide a consistent way of identifying a
- // schema document that is included in multiple other schemas.
- private Map<XSDKey, Element> fTraversed = new HashMap<>();
-
- // this map contains a mapping from Schema Element to its systemId
- // this is useful to resolve a uri relative to the referring document
- private Map<Element, String> fDoc2SystemId = new HashMap<>();
-
- // the primary XSDocumentInfo we were called to parse
- private XSDocumentInfo fRoot = null;
-
- // This map's job is to act as a link between the Schema Element and its
- // XSDocumentInfo object.
- private Map fDoc2XSDocumentMap = new HashMap();
-
- // map between <redefine> elements and the XSDocumentInfo
- // objects that correspond to the documents being redefined.
- private Map fRedefine2XSDMap = null;
-
- // map between <redefine> elements and the namespace support
- private Map fRedefine2NSSupport = null;
-
- // these objects store a mapping between the names of redefining
- // groups/attributeGroups and the groups/AttributeGroups which
- // they redefine by restriction (implicitly). It is up to the
- // Group and AttributeGroup traversers to check these restrictions for
- // validity.
- private Map fRedefinedRestrictedAttributeGroupRegistry = new HashMap();
- private Map fRedefinedRestrictedGroupRegistry = new HashMap();
-
- // a variable storing whether the last schema document
- // processed (by getSchema) was a duplicate.
- private boolean fLastSchemaWasDuplicate;
-
- // validate annotations feature
- private boolean fValidateAnnotations = false;
-
- //handle multiple import feature
- private boolean fHonourAllSchemaLocations = false;
-
- //handle namespace growth feature
- boolean fNamespaceGrowth = false;
-
- // handle tolerate duplicates feature
- boolean fTolerateDuplicates = false;
-
- // the XMLErrorReporter
- private XMLErrorReporter fErrorReporter;
-
- // the XMLErrorHandler
- private XMLErrorHandler fErrorHandler;
-
- // the Locale
- private Locale fLocale;
-
- // the XMLEntityManager
- private XMLEntityResolver fEntityManager;
-
- // the XSAttributeChecker
- private XSAttributeChecker fAttributeChecker;
-
- // the symbol table
- private SymbolTable fSymbolTable;
-
- // the GrammarResolver
- private XSGrammarBucket fGrammarBucket;
-
- // the Grammar description
- private XSDDescription fSchemaGrammarDescription;
-
- // the Grammar Pool
- private XMLGrammarPool fGrammarPool;
-
- // the security property manager
- private XMLSecurityPropertyManager fSecurityPropertyMgr = null;
-
- //************ Traversers **********
- XSDAttributeGroupTraverser fAttributeGroupTraverser;
- XSDAttributeTraverser fAttributeTraverser;
- XSDComplexTypeTraverser fComplexTypeTraverser;
- XSDElementTraverser fElementTraverser;
- XSDGroupTraverser fGroupTraverser;
- XSDKeyrefTraverser fKeyrefTraverser;
- XSDNotationTraverser fNotationTraverser;
- XSDSimpleTypeTraverser fSimpleTypeTraverser;
- XSDUniqueOrKeyTraverser fUniqueOrKeyTraverser;
- XSDWildcardTraverser fWildCardTraverser;
-
- SchemaDVFactory fDVFactory;
- SchemaDOMParser fSchemaParser;
- SchemaContentHandler fXSContentHandler;
- StAXSchemaParser fStAXSchemaParser;
- XML11Configuration fAnnotationValidator;
- XSAnnotationGrammarPool fGrammarBucketAdapter;
-
- // these data members are needed for the deferred traversal
- // of local elements.
-
- // the initial size of the array to store deferred local elements
- private static final int INIT_STACK_SIZE = 30;
- // the incremental size of the array to store deferred local elements
- private static final int INC_STACK_SIZE = 10;
- // current position of the array (# of deferred local elements)
- private int fLocalElemStackPos = 0;
-
- private XSParticleDecl[] fParticle = new XSParticleDecl[INIT_STACK_SIZE];
- private Element[] fLocalElementDecl = new Element[INIT_STACK_SIZE];
- private XSDocumentInfo[] fLocalElementDecl_schema = new XSDocumentInfo[INIT_STACK_SIZE]; //JACK
- private int[] fAllContext = new int[INIT_STACK_SIZE];
- private XSObject[] fParent = new XSObject[INIT_STACK_SIZE];
- private String [][] fLocalElemNamespaceContext = new String [INIT_STACK_SIZE][1];
-
- // these data members are needed for the deferred traversal
- // of keyrefs.
-
- // the initial size of the array to store deferred keyrefs
- private static final int INIT_KEYREF_STACK = 2;
- // the incremental size of the array to store deferred keyrefs
- private static final int INC_KEYREF_STACK_AMOUNT = 2;
- // current position of the array (# of deferred keyrefs)
- private int fKeyrefStackPos = 0;
-
- private Element [] fKeyrefs = new Element[INIT_KEYREF_STACK];
- private XSDocumentInfo [] fKeyrefsMapXSDocumentInfo = new XSDocumentInfo[INIT_KEYREF_STACK];
- private XSElementDecl [] fKeyrefElems = new XSElementDecl [INIT_KEYREF_STACK];
- private String [][] fKeyrefNamespaceContext = new String[INIT_KEYREF_STACK][1];
-
- // global decls: map from decl name to decl object
- SymbolHash fGlobalAttrDecls = new SymbolHash(12);
- SymbolHash fGlobalAttrGrpDecls = new SymbolHash(5);
- SymbolHash fGlobalElemDecls = new SymbolHash(25);
- SymbolHash fGlobalGroupDecls = new SymbolHash(5);
- SymbolHash fGlobalNotationDecls = new SymbolHash(1);
- SymbolHash fGlobalIDConstraintDecls = new SymbolHash(3);
- SymbolHash fGlobalTypeDecls = new SymbolHash(25);
-
- // Constructors
- public XSDHandler(){
- fHiddenNodes = new HashMap<>();
- fSchemaParser = new SchemaDOMParser(new SchemaParsingConfig());
- }
-
- // it should be possible to use the same XSDHandler to parse
- // multiple schema documents; this will allow one to be
- // constructed.
- public XSDHandler (XSGrammarBucket gBucket) {
- this();
- fGrammarBucket = gBucket;
-
- // Note: don't use SchemaConfiguration internally
- // we will get stack overflaw because
- // XMLSchemaValidator will be instantiating XSDHandler...
- fSchemaGrammarDescription = new XSDDescription();
- } // end constructor
-
- /**
- * This method initiates the parse of a schema. It will likely be
- * called from the Validator and it will make the
- * resulting grammar available; it returns a reference to this object just
- * in case. A reset(XMLComponentManager) must be called before this methods is called.
- * @param is
- * @param desc
- * @param locationPairs
- * @return the SchemaGrammar
- * @throws IOException
- */
- public SchemaGrammar parseSchema(XMLInputSource is, XSDDescription desc,
- Map<String, XMLSchemaLoader.LocationArray> locationPairs)
- throws IOException {
- fLocationPairs = locationPairs;
- fSchemaParser.resetNodePool();
- SchemaGrammar grammar = null;
- String schemaNamespace = null;
- short referType = desc.getContextType();
-
- // if loading using JAXP schemaSource property, or using grammar caching loadGrammar
- // the desc.targetNamespace is always null.
- // Therefore we should not attempt to find out if
- // the schema is already in the bucket, since in the case we have
- // no namespace schema in the bucket, findGrammar will always return the
- // no namespace schema.
- if (referType != XSDDescription.CONTEXT_PREPARSE){
- // first try to find it in the bucket/pool, return if one is found
- if (fHonourAllSchemaLocations && referType == XSDDescription.CONTEXT_IMPORT && isExistingGrammar(desc, fNamespaceGrowth)) {
- grammar = fGrammarBucket.getGrammar(desc.getTargetNamespace());
- }
- else {
- grammar = findGrammar(desc, fNamespaceGrowth);
- }
- if (grammar != null) {
- if (!fNamespaceGrowth) {
- return grammar;
- }
- else {
- try {
- if (grammar.getDocumentLocations().contains(XMLEntityManager.expandSystemId(is.getSystemId(), is.getBaseSystemId(), false))) {
- return grammar;
- }
- }
- catch (MalformedURIException e) {
- //REVISIT: return the grammar?
- }
- }
- }
-
- schemaNamespace = desc.getTargetNamespace();
- // handle empty string URI as null
- if (schemaNamespace != null) {
- schemaNamespace = fSymbolTable.addSymbol(schemaNamespace);
- }
- }
-
- // before parsing a schema, need to clear registries associated with
- // parsing schemas
- prepareForParse();
-
- Element schemaRoot = null;
- // first phase: construct trees.
- if (is instanceof DOMInputSource) {
- schemaRoot = getSchemaDocument(schemaNamespace, (DOMInputSource) is,
- referType == XSDDescription.CONTEXT_PREPARSE,
- referType, null);
- } // DOMInputSource
- else if (is instanceof SAXInputSource) {
- schemaRoot = getSchemaDocument(schemaNamespace, (SAXInputSource) is,
- referType == XSDDescription.CONTEXT_PREPARSE,
- referType, null);
- } // SAXInputSource
- else if (is instanceof StAXInputSource) {
- schemaRoot = getSchemaDocument(schemaNamespace, (StAXInputSource) is,
- referType == XSDDescription.CONTEXT_PREPARSE,
- referType, null);
- } // StAXInputSource
- else if (is instanceof XSInputSource) {
- schemaRoot = getSchemaDocument((XSInputSource) is, desc);
- } // XSInputSource
- else {
- schemaRoot = getSchemaDocument(schemaNamespace, is,
- referType == XSDDescription.CONTEXT_PREPARSE,
- referType, null);
-
- } //is instanceof XMLInputSource
-
- if (schemaRoot == null) {
- // something went wrong right off the hop
- if (is instanceof XSInputSource) {
- return fGrammarBucket.getGrammar(desc.getTargetNamespace());
- }
- return grammar;
- }
-
- if (referType == XSDDescription.CONTEXT_PREPARSE) {
- Element schemaElem = schemaRoot;
- schemaNamespace = DOMUtil.getAttrValue(schemaElem, SchemaSymbols.ATT_TARGETNAMESPACE);
- if(schemaNamespace != null && schemaNamespace.length() > 0) {
- // Since now we've discovered a namespace, we need to update xsd key
- // and store this schema in traversed schemas bucket
- schemaNamespace = fSymbolTable.addSymbol(schemaNamespace);
- desc.setTargetNamespace(schemaNamespace);
- }
- else {
- schemaNamespace = null;
- }
- grammar = findGrammar(desc, fNamespaceGrowth);
- String schemaId = XMLEntityManager.expandSystemId(is.getSystemId(), is.getBaseSystemId(), false);
- if (grammar != null) {
- // When namespace growth is enabled and a null location is provided we cannot tell
- // whether we've loaded this schema document before so we must assume that we haven't.
- if (!fNamespaceGrowth || (schemaId != null && grammar.getDocumentLocations().contains(schemaId))) {
- return grammar;
- }
- }
-
- XSDKey key = new XSDKey(schemaId, referType, schemaNamespace);
- fTraversed.put(key, schemaRoot);
- if (schemaId != null) {
- fDoc2SystemId.put(schemaRoot, schemaId);
- }
- }
-
- // before constructing trees and traversing a schema, need to reset
- // all traversers and clear all registries
- prepareForTraverse();
-
- fRoot = constructTrees(schemaRoot, is.getSystemId(), desc, grammar != null);
- if (fRoot == null) {
- return null;
- }
-
- // second phase: fill global registries.
- buildGlobalNameRegistries();
-
- // third phase: call traversers
- ArrayList annotationInfo = fValidateAnnotations ? new ArrayList() : null;
- traverseSchemas(annotationInfo);
-
- // fourth phase: handle local element decls
- traverseLocalElements();
-
- // fifth phase: handle Keyrefs
- resolveKeyRefs();
-
- // sixth phase: validate attribute of non-schema namespaces
- // REVISIT: skip this for now. we really don't want to do it.
- //fAttributeChecker.checkNonSchemaAttributes(fGrammarBucket);
-
- // seventh phase: store imported grammars
- // for all grammars with <import>s
- for (int i = fAllTNSs.size() - 1; i >= 0; i--) {
- // get its target namespace
- String tns = fAllTNSs.elementAt(i);
- // get all namespaces it imports
- Vector ins = (Vector)fImportMap.get(tns);
- // get the grammar
- SchemaGrammar sg = fGrammarBucket.getGrammar(emptyString2Null(tns));
- if (sg == null)
- continue;
- SchemaGrammar isg;
- // for imported namespace
- int count = 0;
- for (int j = 0; j < ins.size(); j++) {
- // get imported grammar
- isg = fGrammarBucket.getGrammar((String)ins.elementAt(j));
- // reuse the same vector
- if (isg != null)
- ins.setElementAt(isg, count++);
- }
- ins.setSize(count);
- // set the imported grammars
- sg.setImportedGrammars(ins);
- }
-
- /** validate annotations **/
- if (fValidateAnnotations && annotationInfo.size() > 0) {
- validateAnnotations(annotationInfo);
- }
-
- // and return.
- return fGrammarBucket.getGrammar(fRoot.fTargetNamespace);
- } // end parseSchema
-
- private void validateAnnotations(ArrayList annotationInfo) {
- if (fAnnotationValidator == null) {
- createAnnotationValidator();
- }
- final int size = annotationInfo.size();
- final XMLInputSource src = new XMLInputSource(null, null, null);
- fGrammarBucketAdapter.refreshGrammars(fGrammarBucket);
- for (int i = 0; i < size; i += 2) {
- src.setSystemId((String) annotationInfo.get(i));
- XSAnnotationInfo annotation = (XSAnnotationInfo) annotationInfo.get(i+1);
- while (annotation != null) {
- src.setCharacterStream(new StringReader(annotation.fAnnotation));
- try {
- fAnnotationValidator.parse(src);
- }
- catch (IOException exc) {}
- annotation = annotation.next;
- }
- }
- }
-
- private void createAnnotationValidator() {
- fAnnotationValidator = new XML11Configuration();
- fGrammarBucketAdapter = new XSAnnotationGrammarPool();
- fAnnotationValidator.setFeature(VALIDATION, true);
- fAnnotationValidator.setFeature(XMLSCHEMA_VALIDATION, true);
- fAnnotationValidator.setProperty(XMLGRAMMAR_POOL, fGrammarBucketAdapter);
- /** set security manager and XML Security Property Manager **/
- fAnnotationValidator.setProperty(SECURITY_MANAGER, (fSecurityManager != null) ? fSecurityManager : new XMLSecurityManager(true));
- fAnnotationValidator.setProperty(XML_SECURITY_PROPERTY_MANAGER, fSecurityPropertyMgr);
- /** Set error handler. **/
- fAnnotationValidator.setProperty(ERROR_HANDLER, (fErrorHandler != null) ? fErrorHandler : new DefaultErrorHandler());
- /** Set locale. **/
- fAnnotationValidator.setProperty(LOCALE, fLocale);
- }
-
- /**
- * Pull the grammar out of the bucket simply using
- * its TNS as a key
- */
- SchemaGrammar getGrammar(String tns) {
- return fGrammarBucket.getGrammar(tns);
- }
-
- /**
- * First try to find a grammar in the bucket, if failed, consult the
- * grammar pool. If a grammar is found in the pool, then add it (and all
- * imported ones) into the bucket.
- */
- protected SchemaGrammar findGrammar(XSDDescription desc, boolean ignoreConflict) {
- SchemaGrammar sg = fGrammarBucket.getGrammar(desc.getTargetNamespace());
- if (sg == null) {
- if (fGrammarPool != null) {
- sg = (SchemaGrammar)fGrammarPool.retrieveGrammar(desc);
- if (sg != null) {
- // put this grammar into the bucket, along with grammars
- // imported by it (directly or indirectly)
- if (!fGrammarBucket.putGrammar(sg, true, ignoreConflict)) {
- // REVISIT: a conflict between new grammar(s) and grammars
- // in the bucket. What to do? A warning? An exception?
- reportSchemaWarning("GrammarConflict", null, null);
- sg = null;
- }
- }
- }
- }
- return sg;
- }
-
- // may wish to have setter methods for ErrorHandler,
- // EntityResolver...
-
- private static final String[][] NS_ERROR_CODES = {
- {"src-include.2.1", "src-include.2.1"},
- {"src-redefine.3.1", "src-redefine.3.1"},
- {"src-import.3.1", "src-import.3.2"},
- null,
- {"TargetNamespace.1", "TargetNamespace.2"},
- {"TargetNamespace.1", "TargetNamespace.2"},
- {"TargetNamespace.1", "TargetNamespace.2"},
- {"TargetNamespace.1", "TargetNamespace.2"}
- };
-
- private static final String[] ELE_ERROR_CODES = {
- "src-include.1", "src-redefine.2", "src-import.2", "schema_reference.4",
- "schema_reference.4", "schema_reference.4", "schema_reference.4", "schema_reference.4"
- };
-
- // This method does several things:
- // It constructs an instance of an XSDocumentInfo object using the
- // schemaRoot node. Then, for each <include>,
- // <redefine>, and <import> children, it attempts to resolve the
- // requested schema document, initiates a DOM parse, and calls
- // itself recursively on that document's root. It also records in
- // the DependencyMap object what XSDocumentInfo objects its XSDocumentInfo
- // depends on.
- // It also makes sure the targetNamespace of the schema it was
- // called to parse is correct.
- protected XSDocumentInfo constructTrees(Element schemaRoot, String locationHint, XSDDescription desc, boolean nsCollision) {
- if (schemaRoot == null) return null;
- String callerTNS = desc.getTargetNamespace();
- short referType = desc.getContextType();
-
- XSDocumentInfo currSchemaInfo = null;
- try {
- // note that attributes are freed at end of traverseSchemas()
- currSchemaInfo = new XSDocumentInfo(schemaRoot, fAttributeChecker, fSymbolTable);
- } catch (XMLSchemaException se) {
- reportSchemaError(ELE_ERROR_CODES[referType],
- new Object[]{locationHint},
- schemaRoot);
- return null;
- }
- // targetNamespace="" is not valid, issue a warning, and ignore it
- if (currSchemaInfo.fTargetNamespace != null &&
- currSchemaInfo.fTargetNamespace.length() == 0) {
- reportSchemaWarning("EmptyTargetNamespace",
- new Object[]{locationHint},
- schemaRoot);
- currSchemaInfo.fTargetNamespace = null;
- }
-
- if (callerTNS != null) {
- // the second index to the NS_ERROR_CODES array
- // if the caller/expected NS is not absent, we use the first column
- int secondIdx = 0;
- // for include and redefine
- if (referType == XSDDescription.CONTEXT_INCLUDE ||
- referType == XSDDescription.CONTEXT_REDEFINE) {
- // if the referred document has no targetNamespace,
- // it's a chameleon schema
- if (currSchemaInfo.fTargetNamespace == null) {
- currSchemaInfo.fTargetNamespace = callerTNS;
- currSchemaInfo.fIsChameleonSchema = true;
- }
- // if the referred document has a target namespace differing
- // from the caller, it's an error
- else if (callerTNS != currSchemaInfo.fTargetNamespace) {
- reportSchemaError(NS_ERROR_CODES[referType][secondIdx],
- new Object [] {callerTNS, currSchemaInfo.fTargetNamespace},
- schemaRoot);
- return null;
- }
- }
- // for instance and import, the two NS's must be the same
- else if (referType != XSDDescription.CONTEXT_PREPARSE && callerTNS != currSchemaInfo.fTargetNamespace) {
- reportSchemaError(NS_ERROR_CODES[referType][secondIdx],
- new Object [] {callerTNS, currSchemaInfo.fTargetNamespace},
- schemaRoot);
- return null;
- }
- }
- // now there is no caller/expected NS, it's an error for the referred
- // document to have a target namespace, unless we are preparsing a schema
- else if (currSchemaInfo.fTargetNamespace != null) {
- // set the target namespace of the description
- if (referType == XSDDescription.CONTEXT_PREPARSE) {
- desc.setTargetNamespace(currSchemaInfo.fTargetNamespace);
- callerTNS = currSchemaInfo.fTargetNamespace;
- }
- else {
- // the second index to the NS_ERROR_CODES array
- // if the caller/expected NS is absent, we use the second column
- int secondIdx = 1;
- reportSchemaError(NS_ERROR_CODES[referType][secondIdx],
- new Object [] {callerTNS, currSchemaInfo.fTargetNamespace},
- schemaRoot);
- return null;
- }
- }
- // the other cases (callerTNS == currSchemaInfo.fTargetNamespce == null)
- // are valid
-
- // a schema document can always access it's own target namespace
- currSchemaInfo.addAllowedNS(currSchemaInfo.fTargetNamespace);
-
- SchemaGrammar sg = null;
-
- // we have a namespace collision
- if (nsCollision) {
- SchemaGrammar sg2 = fGrammarBucket.getGrammar(currSchemaInfo.fTargetNamespace);
- if (sg2.isImmutable()) {
- sg = new SchemaGrammar(sg2);
- fGrammarBucket.putGrammar(sg);
- // update all the grammars in the bucket to point to the new grammar.
- updateImportListWith(sg);
- }
- else {
- sg = sg2;
- }
-
- // update import list of the new grammar
- updateImportListFor(sg);
- }
- else if (referType == XSDDescription.CONTEXT_INCLUDE ||
- referType == XSDDescription.CONTEXT_REDEFINE) {
- sg = fGrammarBucket.getGrammar(currSchemaInfo.fTargetNamespace);
- }
- else if(fHonourAllSchemaLocations && referType == XSDDescription.CONTEXT_IMPORT) {
- sg = findGrammar(desc, false);
- if(sg == null) {
- sg = new SchemaGrammar(currSchemaInfo.fTargetNamespace, desc.makeClone(), fSymbolTable);
- fGrammarBucket.putGrammar(sg);
- }
- }
- else {
- sg = new SchemaGrammar(currSchemaInfo.fTargetNamespace, desc.makeClone(), fSymbolTable);
- fGrammarBucket.putGrammar(sg);
- }
-
- // store the document and its location
- // REVISIT: don't expose the DOM tree
- sg.addDocument(null, fDoc2SystemId.get(currSchemaInfo.fSchemaElement));
-
- fDoc2XSDocumentMap.put(schemaRoot, currSchemaInfo);
- Vector<XSDocumentInfo> dependencies = new Vector<>();
- Element rootNode = schemaRoot;
-
- Element newSchemaRoot = null;
- for (Element child = DOMUtil.getFirstChildElement(rootNode);
- child != null;
- child = DOMUtil.getNextSiblingElement(child)) {
- String schemaNamespace=null;
- String schemaHint=null;
- String localName = DOMUtil.getLocalName(child);
-
- short refType = -1;
- boolean importCollision = false;
-
- if (localName.equals(SchemaSymbols.ELT_ANNOTATION))
- continue;
- else if (localName.equals(SchemaSymbols.ELT_IMPORT)) {
- refType = XSDDescription.CONTEXT_IMPORT;
- // have to handle some validation here too!
- // call XSAttributeChecker to fill in attrs
- Object[] importAttrs = fAttributeChecker.checkAttributes(child, true, currSchemaInfo);
- schemaHint = (String)importAttrs[XSAttributeChecker.ATTIDX_SCHEMALOCATION];
- schemaNamespace = (String)importAttrs[XSAttributeChecker.ATTIDX_NAMESPACE];
- if (schemaNamespace != null)
- schemaNamespace = fSymbolTable.addSymbol(schemaNamespace);
-
- // check contents and process optional annotations
- Element importChild = DOMUtil.getFirstChildElement(child);
- if(importChild != null ) {
- String importComponentType = DOMUtil.getLocalName(importChild);
- if (importComponentType.equals(SchemaSymbols.ELT_ANNOTATION)) {
- // promoting annotations to parent component
- sg.addAnnotation(
- fElementTraverser.traverseAnnotationDecl(importChild, importAttrs, true, currSchemaInfo));
- } else {
- reportSchemaError("s4s-elt-must-match.1", new Object [] {localName, "annotation?", importComponentType}, child);
- }
- if(DOMUtil.getNextSiblingElement(importChild) != null) {
- reportSchemaError("s4s-elt-must-match.1", new Object [] {localName, "annotation?", DOMUtil.getLocalName(DOMUtil.getNextSiblingElement(importChild))}, child);
- }
- }
- else {
- String text = DOMUtil.getSyntheticAnnotation(child);
- if (text != null) {
- sg.addAnnotation(fElementTraverser.traverseSyntheticAnnotation(child, text, importAttrs, true, currSchemaInfo));
- }
- }
- fAttributeChecker.returnAttrArray(importAttrs, currSchemaInfo);
-
- // a document can't import another document with the same namespace
- if (schemaNamespace == currSchemaInfo.fTargetNamespace) {
- reportSchemaError(schemaNamespace != null ?
- "src-import.1.1" : "src-import.1.2", new Object [] {schemaNamespace}, child);
- continue;
- }
-
- // if this namespace has not been imported by this document,
- // then import if multiple imports support is enabled.
- if(currSchemaInfo.isAllowedNS(schemaNamespace)) {
- if(!fHonourAllSchemaLocations && !fNamespaceGrowth)
- continue;
- }
- else {
- currSchemaInfo.addAllowedNS(schemaNamespace);
- }
- // also record the fact that one namespace imports another one
- // convert null to ""
- String tns = null2EmptyString(currSchemaInfo.fTargetNamespace);
- // get all namespaces imported by this one
- Vector ins = (Vector)fImportMap.get(tns);
- // if no namespace was imported, create new Vector
- if (ins == null) {
- // record that this one imports other(s)
- fAllTNSs.addElement(tns);
- ins = new Vector();
- fImportMap.put(tns, ins);
- ins.addElement(schemaNamespace);
- }
- else if (!ins.contains(schemaNamespace)){
- ins.addElement(schemaNamespace);
- }
-
- fSchemaGrammarDescription.reset();
- fSchemaGrammarDescription.setContextType(XSDDescription.CONTEXT_IMPORT);
- fSchemaGrammarDescription.setBaseSystemId(doc2SystemId(schemaRoot));
- fSchemaGrammarDescription.setLiteralSystemId(schemaHint);
- fSchemaGrammarDescription.setLocationHints(new String[]{schemaHint});
- fSchemaGrammarDescription.setTargetNamespace(schemaNamespace);
-
- // if a grammar with the same namespace and location exists (or being
- // built), ignore this one (don't traverse it).
- SchemaGrammar isg = findGrammar(fSchemaGrammarDescription, fNamespaceGrowth);
- if (isg != null) {
- if (fNamespaceGrowth) {
- try {
- if (isg.getDocumentLocations().contains(XMLEntityManager.expandSystemId(schemaHint, fSchemaGrammarDescription.getBaseSystemId(), false))) {
- continue;
- }
- else {
- importCollision = true;
- }
- }
- catch (MalformedURIException e) {
- }
- }
- else if (!fHonourAllSchemaLocations || isExistingGrammar(fSchemaGrammarDescription, false)) {
- continue;
- }
- }
- //if ((!fHonourAllSchemaLocations && findGrammar(fSchemaGrammarDescription) != null) || isExistingGrammar(fSchemaGrammarDescription))
- // continue;
-
- // If "findGrammar" returns a grammar, then this is not the
- // the first time we see a location for a given namespace.
- // Don't consult the location pair map in this case,
- // otherwise the location will be ignored because it'll get
- // resolved to the same location as the first hint.
- newSchemaRoot = resolveSchema(fSchemaGrammarDescription, false, child, isg == null);
- }
- else if ((localName.equals(SchemaSymbols.ELT_INCLUDE)) ||
- (localName.equals(SchemaSymbols.ELT_REDEFINE))) {
- // validation for redefine/include will be the same here; just
- // make sure TNS is right (don't care about redef contents
- // yet).
- Object[] includeAttrs = fAttributeChecker.checkAttributes(child, true, currSchemaInfo);
- schemaHint = (String)includeAttrs[XSAttributeChecker.ATTIDX_SCHEMALOCATION];
- // store the namespace decls of the redefine element
- if (localName.equals(SchemaSymbols.ELT_REDEFINE)) {
- if (fRedefine2NSSupport == null) fRedefine2NSSupport = new HashMap();
- fRedefine2NSSupport.put(child, new SchemaNamespaceSupport(currSchemaInfo.fNamespaceSupport));
- }
-
- // check annotations. Must do this here to avoid having to
- // re-parse attributes later
- if(localName.equals(SchemaSymbols.ELT_INCLUDE)) {
- Element includeChild = DOMUtil.getFirstChildElement(child);
- if(includeChild != null ) {
- String includeComponentType = DOMUtil.getLocalName(includeChild);
- if (includeComponentType.equals(SchemaSymbols.ELT_ANNOTATION)) {
- // promoting annotations to parent component
- sg.addAnnotation(
- fElementTraverser.traverseAnnotationDecl(includeChild, includeAttrs, true, currSchemaInfo));
- } else {
- reportSchemaError("s4s-elt-must-match.1", new Object [] {localName, "annotation?", includeComponentType}, child);
- }
- if(DOMUtil.getNextSiblingElement(includeChild) != null) {
- reportSchemaError("s4s-elt-must-match.1", new Object [] {localName, "annotation?", DOMUtil.getLocalName(DOMUtil.getNextSiblingElement(includeChild))}, child);
- }
- }
- else {
- String text = DOMUtil.getSyntheticAnnotation(child);
- if (text != null) {
- sg.addAnnotation(fElementTraverser.traverseSyntheticAnnotation(child, text, includeAttrs, true, currSchemaInfo));
- }
- }
- }
- else {
- for (Element redefinedChild = DOMUtil.getFirstChildElement(child);
- redefinedChild != null;
- redefinedChild = DOMUtil.getNextSiblingElement(redefinedChild)) {
- String redefinedComponentType = DOMUtil.getLocalName(redefinedChild);
- if (redefinedComponentType.equals(SchemaSymbols.ELT_ANNOTATION)) {
- // promoting annotations to parent component
- sg.addAnnotation(
- fElementTraverser.traverseAnnotationDecl(redefinedChild, includeAttrs, true, currSchemaInfo));
- DOMUtil.setHidden(redefinedChild, fHiddenNodes);
- }
- else {
- String text = DOMUtil.getSyntheticAnnotation(child);
- if (text != null) {
- sg.addAnnotation(fElementTraverser.traverseSyntheticAnnotation(child, text, includeAttrs, true, currSchemaInfo));
- }
- }
- // catch all other content errors later
- }
- }
- fAttributeChecker.returnAttrArray(includeAttrs, currSchemaInfo);
- // schemaLocation is required on <include> and <redefine>
- if (schemaHint == null) {
- reportSchemaError("s4s-att-must-appear", new Object [] {
- "<include> or <redefine>", "schemaLocation"},
- child);
- }
- // pass the systemId of the current document as the base systemId
- boolean mustResolve = false;
- refType = XSDDescription.CONTEXT_INCLUDE;
- if(localName.equals(SchemaSymbols.ELT_REDEFINE)) {
- mustResolve = nonAnnotationContent(child);
- refType = XSDDescription.CONTEXT_REDEFINE;
- }
- fSchemaGrammarDescription.reset();
- fSchemaGrammarDescription.setContextType(refType);
- fSchemaGrammarDescription.setBaseSystemId(doc2SystemId(schemaRoot));
- fSchemaGrammarDescription.setLocationHints(new String[]{schemaHint});
- fSchemaGrammarDescription.setTargetNamespace(callerTNS);
-
- boolean alreadyTraversed = false;
- XMLInputSource schemaSource = resolveSchemaSource(fSchemaGrammarDescription, mustResolve, child, true);
- if (fNamespaceGrowth && refType == XSDDescription.CONTEXT_INCLUDE) {
- try {
- final String schemaId = XMLEntityManager.expandSystemId(schemaSource.getSystemId(), schemaSource.getBaseSystemId(), false);
- alreadyTraversed = sg.getDocumentLocations().contains(schemaId);
- }
- catch(MalformedURIException e) {
-
- }
- }
-
- if (!alreadyTraversed) {
- newSchemaRoot = resolveSchema(schemaSource, fSchemaGrammarDescription, mustResolve, child);
- schemaNamespace = currSchemaInfo.fTargetNamespace;
- }
- else {
- fLastSchemaWasDuplicate = true;
- }
- }
- else {
- // no more possibility of schema references in well-formed
- // schema...
- break;
- }
-
- // If the schema is duplicate, we needn't call constructTrees() again.
- // To handle mutual <include>s
- XSDocumentInfo newSchemaInfo = null;
- if (fLastSchemaWasDuplicate) {
- newSchemaInfo = newSchemaRoot == null ? null : (XSDocumentInfo)fDoc2XSDocumentMap.get(newSchemaRoot);
- }
- else {
- newSchemaInfo = constructTrees(newSchemaRoot, schemaHint, fSchemaGrammarDescription, importCollision);
- }
-
- if (localName.equals(SchemaSymbols.ELT_REDEFINE) &&
- newSchemaInfo != null) {
- // must record which schema we're redefining so that we can
- // rename the right things later!
- if (fRedefine2XSDMap == null) fRedefine2XSDMap = new HashMap();
- fRedefine2XSDMap.put(child, newSchemaInfo);
- }
- if (newSchemaRoot != null) {
- if (newSchemaInfo != null)
- dependencies.addElement(newSchemaInfo);
- newSchemaRoot = null;
- }
- }
-
- fDependencyMap.put(currSchemaInfo, dependencies);
- return currSchemaInfo;
- } // end constructTrees
-
- private boolean isExistingGrammar(XSDDescription desc, boolean ignoreConflict) {
- SchemaGrammar sg = fGrammarBucket.getGrammar(desc.getTargetNamespace());
- if (sg == null) {
- return findGrammar(desc, ignoreConflict) != null;
- }
- else if (sg.isImmutable()) {
- return true;
- }
- else {
- try {
- return sg.getDocumentLocations().contains(XMLEntityManager.expandSystemId(desc.getLiteralSystemId(), desc.getBaseSystemId(), false));
- }
- catch (MalformedURIException e) {
- return false;
- }
- }
- }
-
- /**
- * Namespace growth
- *
- * Go through the import list of a given grammar and for each imported
- * grammar, check to see if the grammar bucket has a newer version.
- * If a new instance is found, we update the import list with the
- * newer version.
- */
- private void updateImportListFor(SchemaGrammar grammar) {
- Vector importedGrammars = grammar.getImportedGrammars();
- if (importedGrammars != null) {
- for (int i=0; i<importedGrammars.size(); i++) {
- SchemaGrammar isg1 = (SchemaGrammar) importedGrammars.elementAt(i);
- SchemaGrammar isg2 = fGrammarBucket.getGrammar(isg1.getTargetNamespace());
- if (isg2 != null && isg1 != isg2) {
- importedGrammars.set(i, isg2);
- }
- }
- }
- }
-
- /**
- * Namespace growth
- *
- * Go throuth the grammar bucket, and for each grammar in the bucket
- * check the import list. If there exists a grammar in import list
- * that has the same namespace as newGrammar, but a different instance,
- * then update the import list and replace the old grammar instance with
- * the new one
- */
- private void updateImportListWith(SchemaGrammar newGrammar) {
- SchemaGrammar[] schemaGrammars = fGrammarBucket.getGrammars();
- for (int i = 0; i < schemaGrammars.length; ++i) {
- SchemaGrammar sg = schemaGrammars[i];
- if (sg != newGrammar) {
- Vector importedGrammars = sg.getImportedGrammars();
- if (importedGrammars != null) {
- for (int j=0; j<importedGrammars.size(); j++) {
- SchemaGrammar isg = (SchemaGrammar) importedGrammars.elementAt(j);
- if (null2EmptyString(isg.getTargetNamespace()).equals(null2EmptyString(newGrammar.getTargetNamespace()))) {
- if (isg != newGrammar) {
- importedGrammars.set(j, newGrammar);
- }
- break;
- }
- }
- }
- }
- }
- }
-
- // This method builds registries for all globally-referenceable
- // names. A registry will be built for each symbol space defined
- // by the spec. It is also this method's job to rename redefined
- // components, and to record which components redefine others (so
- // that implicit redefinitions of groups and attributeGroups can be handled).
- protected void buildGlobalNameRegistries() {
-
- registryEmpty = false;
- // Starting with fRoot, we examine each child of the schema
- // element. Skipping all imports and includes, we record the names
- // of all other global components (and children of <redefine>). We
- // also put <redefine> names in a registry that we look through in
- // case something needs renaming. Once we're done with a schema we
- // set its Document node to hidden so that we don't try to traverse
- // it again; then we look to its Dependency map entry. We keep a
- // stack of schemas that we haven't yet finished processing; this
- // is a depth-first traversal.
-
- Stack schemasToProcess = new Stack();
- schemasToProcess.push(fRoot);
-
- while (!schemasToProcess.empty()) {
- XSDocumentInfo currSchemaDoc =
- (XSDocumentInfo)schemasToProcess.pop();
- Element currDoc = currSchemaDoc.fSchemaElement;
- if(DOMUtil.isHidden(currDoc, fHiddenNodes)){
- // must have processed this already!
- continue;
- }
-
- Element currRoot = currDoc;
- // process this schema's global decls
- boolean dependenciesCanOccur = true;
- for (Element globalComp =
- DOMUtil.getFirstChildElement(currRoot);
- globalComp != null;
- globalComp = DOMUtil.getNextSiblingElement(globalComp)) {
- // this loop makes sure the <schema> element ordering is
- // also valid.
- if (DOMUtil.getLocalName(globalComp).equals(SchemaSymbols.ELT_ANNOTATION)) {
- //skip it; traverse it later
- continue;
- }
- else if (DOMUtil.getLocalName(globalComp).equals(SchemaSymbols.ELT_INCLUDE) ||
- DOMUtil.getLocalName(globalComp).equals(SchemaSymbols.ELT_IMPORT)) {
- if (!dependenciesCanOccur) {
- reportSchemaError("s4s-elt-invalid-content.3", new Object [] {DOMUtil.getLocalName(globalComp)}, globalComp);
- }
- DOMUtil.setHidden(globalComp, fHiddenNodes);
- }
- else if (DOMUtil.getLocalName(globalComp).equals(SchemaSymbols.ELT_REDEFINE)) {
- if (!dependenciesCanOccur) {
- reportSchemaError("s4s-elt-invalid-content.3", new Object [] {DOMUtil.getLocalName(globalComp)}, globalComp);
- }
- for (Element redefineComp = DOMUtil.getFirstChildElement(globalComp);
- redefineComp != null;
- redefineComp = DOMUtil.getNextSiblingElement(redefineComp)) {
- String lName = DOMUtil.getAttrValue(redefineComp, SchemaSymbols.ATT_NAME);
- if (lName.length() == 0) // an error we'll catch later
- continue;
- String qName = currSchemaDoc.fTargetNamespace == null ?
- ","+lName:
- currSchemaDoc.fTargetNamespace +","+lName;
- String componentType = DOMUtil.getLocalName(redefineComp);
- if (componentType.equals(SchemaSymbols.ELT_ATTRIBUTEGROUP)) {
- checkForDuplicateNames(qName, ATTRIBUTEGROUP_TYPE, fUnparsedAttributeGroupRegistry, fUnparsedAttributeGroupRegistrySub, redefineComp, currSchemaDoc);
- // the check will have changed our name;
- String targetLName = DOMUtil.getAttrValue(redefineComp, SchemaSymbols.ATT_NAME)+REDEF_IDENTIFIER;
- // and all we need to do is error-check+rename our kkids:
- renameRedefiningComponents(currSchemaDoc, redefineComp, SchemaSymbols.ELT_ATTRIBUTEGROUP,
- lName, targetLName);
- }
- else if ((componentType.equals(SchemaSymbols.ELT_COMPLEXTYPE)) ||
- (componentType.equals(SchemaSymbols.ELT_SIMPLETYPE))) {
- checkForDuplicateNames(qName, TYPEDECL_TYPE, fUnparsedTypeRegistry, fUnparsedTypeRegistrySub, redefineComp, currSchemaDoc);
- // the check will have changed our name;
- String targetLName = DOMUtil.getAttrValue(redefineComp, SchemaSymbols.ATT_NAME) + REDEF_IDENTIFIER;
- // and all we need to do is error-check+rename our kkids:
- if (componentType.equals(SchemaSymbols.ELT_COMPLEXTYPE)) {
- renameRedefiningComponents(currSchemaDoc, redefineComp, SchemaSymbols.ELT_COMPLEXTYPE,
- lName, targetLName);
- }
- else { // must be simpleType
- renameRedefiningComponents(currSchemaDoc, redefineComp, SchemaSymbols.ELT_SIMPLETYPE,
- lName, targetLName);
- }
- }
- else if (componentType.equals(SchemaSymbols.ELT_GROUP)) {
- checkForDuplicateNames(qName, GROUP_TYPE, fUnparsedGroupRegistry, fUnparsedGroupRegistrySub, redefineComp, currSchemaDoc);
- // the check will have changed our name;
- String targetLName = DOMUtil.getAttrValue(redefineComp, SchemaSymbols.ATT_NAME)+REDEF_IDENTIFIER;
- // and all we need to do is error-check+rename our kids:
- renameRedefiningComponents(currSchemaDoc, redefineComp, SchemaSymbols.ELT_GROUP,
- lName, targetLName);
- }
- } // end march through <redefine> children
- // and now set as traversed
- //DOMUtil.setHidden(globalComp);
- }
- else {
- dependenciesCanOccur = false;
- String lName = DOMUtil.getAttrValue(globalComp, SchemaSymbols.ATT_NAME);
- if (lName.length() == 0) // an error we'll catch later
- continue;
- String qName = currSchemaDoc.fTargetNamespace == null?
- ","+lName:
- currSchemaDoc.fTargetNamespace +","+lName;
- String componentType = DOMUtil.getLocalName(globalComp);
-
- if (componentType.equals(SchemaSymbols.ELT_ATTRIBUTE)) {
- checkForDuplicateNames(qName, ATTRIBUTE_TYPE, fUnparsedAttributeRegistry, fUnparsedAttributeRegistrySub, globalComp, currSchemaDoc);
- }
- else if (componentType.equals(SchemaSymbols.ELT_ATTRIBUTEGROUP)) {
- checkForDuplicateNames(qName, ATTRIBUTEGROUP_TYPE, fUnparsedAttributeGroupRegistry, fUnparsedAttributeGroupRegistrySub, globalComp, currSchemaDoc);
- }
- else if ((componentType.equals(SchemaSymbols.ELT_COMPLEXTYPE)) ||
- (componentType.equals(SchemaSymbols.ELT_SIMPLETYPE))) {
- checkForDuplicateNames(qName, TYPEDECL_TYPE, fUnparsedTypeRegistry, fUnparsedTypeRegistrySub, globalComp, currSchemaDoc);
- }
- else if (componentType.equals(SchemaSymbols.ELT_ELEMENT)) {
- checkForDuplicateNames(qName, ELEMENT_TYPE, fUnparsedElementRegistry, fUnparsedElementRegistrySub, globalComp, currSchemaDoc);
- }
- else if (componentType.equals(SchemaSymbols.ELT_GROUP)) {
- checkForDuplicateNames(qName, GROUP_TYPE, fUnparsedGroupRegistry, fUnparsedGroupRegistrySub, globalComp, currSchemaDoc);
- }
- else if (componentType.equals(SchemaSymbols.ELT_NOTATION)) {
- checkForDuplicateNames(qName, NOTATION_TYPE, fUnparsedNotationRegistry, fUnparsedNotationRegistrySub, globalComp, currSchemaDoc);
- }
- }
- } // end for
-
- // now we're done with this one!
- DOMUtil.setHidden(currDoc, fHiddenNodes);
- // now add the schemas this guy depends on
- Vector<XSDocumentInfo> currSchemaDepends = fDependencyMap.get(currSchemaDoc);
- for (int i = 0; i < currSchemaDepends.size(); i++) {
- schemasToProcess.push(currSchemaDepends.elementAt(i));
- }
- } // while
-
- } // end buildGlobalNameRegistries
-
- // Beginning at the first schema processing was requested for
- // (fRoot), this method
- // examines each child (global schema information item) of each
- // schema document (and of each <redefine> element)
- // corresponding to an XSDocumentInfo object. If the
- // readOnly field on that node has not been set, it calls an
- // appropriate traverser to traverse it. Once all global decls in
- // an XSDocumentInfo object have been traversed, it marks that object
- // as traversed (or hidden) in order to avoid infinite loops. It completes
- // when it has visited all XSDocumentInfo objects in the
- // DependencyMap and marked them as traversed.
- protected void traverseSchemas(ArrayList annotationInfo) {
- // the process here is very similar to that in
- // buildGlobalRegistries, except we can't set our schemas as
- // hidden for a second time; so make them all visible again
- // first!
- setSchemasVisible(fRoot);
- Stack schemasToProcess = new Stack();
- schemasToProcess.push(fRoot);
- while (!schemasToProcess.empty()) {
- XSDocumentInfo currSchemaDoc =
- (XSDocumentInfo)schemasToProcess.pop();
- Element currDoc = currSchemaDoc.fSchemaElement;
-
- SchemaGrammar currSG = fGrammarBucket.getGrammar(currSchemaDoc.fTargetNamespace);
-
- if(DOMUtil.isHidden(currDoc, fHiddenNodes)) {
- // must have processed this already!
- continue;
- }
- Element currRoot = currDoc;
- boolean sawAnnotation = false;
- // traverse this schema's global decls
- for (Element globalComp =
- DOMUtil.getFirstVisibleChildElement(currRoot, fHiddenNodes);
- globalComp != null;
- globalComp = DOMUtil.getNextVisibleSiblingElement(globalComp, fHiddenNodes)) {
- DOMUtil.setHidden(globalComp, fHiddenNodes);
- String componentType = DOMUtil.getLocalName(globalComp);
- // includes and imports will not show up here!
- if (DOMUtil.getLocalName(globalComp).equals(SchemaSymbols.ELT_REDEFINE)) {
- // use the namespace decls for the redefine, instead of for the parent <schema>
- currSchemaDoc.backupNSSupport((fRedefine2NSSupport!=null)?(SchemaNamespaceSupport)fRedefine2NSSupport.get(globalComp):null);
- for (Element redefinedComp = DOMUtil.getFirstVisibleChildElement(globalComp, fHiddenNodes);
- redefinedComp != null;
- redefinedComp = DOMUtil.getNextVisibleSiblingElement(redefinedComp, fHiddenNodes)) {
- String redefinedComponentType = DOMUtil.getLocalName(redefinedComp);
- DOMUtil.setHidden(redefinedComp, fHiddenNodes);
- if (redefinedComponentType.equals(SchemaSymbols.ELT_ATTRIBUTEGROUP)) {
- fAttributeGroupTraverser.traverseGlobal(redefinedComp, currSchemaDoc, currSG);
- }
- else if (redefinedComponentType.equals(SchemaSymbols.ELT_COMPLEXTYPE)) {
- fComplexTypeTraverser.traverseGlobal(redefinedComp, currSchemaDoc, currSG);
- }
- else if (redefinedComponentType.equals(SchemaSymbols.ELT_GROUP)) {
- fGroupTraverser.traverseGlobal(redefinedComp, currSchemaDoc, currSG);
- }
- else if (redefinedComponentType.equals(SchemaSymbols.ELT_SIMPLETYPE)) {
- fSimpleTypeTraverser.traverseGlobal(redefinedComp, currSchemaDoc, currSG);
- }
- // annotations will have been processed already; this is now
- // unnecessary
- //else if (redefinedComponentType.equals(SchemaSymbols.ELT_ANNOTATION)) {
- // fElementTraverser.traverseAnnotationDecl(redefinedComp, null, true, currSchemaDoc);
- //}
- else {
- reportSchemaError("s4s-elt-must-match.1", new Object [] {DOMUtil.getLocalName(globalComp), "(annotation | (simpleType | complexType | group | attributeGroup))*", redefinedComponentType}, redefinedComp);
- }
- } // end march through <redefine> children
- currSchemaDoc.restoreNSSupport();
- }
- else if (componentType.equals(SchemaSymbols.ELT_ATTRIBUTE)) {
- fAttributeTraverser.traverseGlobal(globalComp, currSchemaDoc, currSG);
- }
- else if (componentType.equals(SchemaSymbols.ELT_ATTRIBUTEGROUP)) {
- fAttributeGroupTraverser.traverseGlobal(globalComp, currSchemaDoc, currSG);
- }
- else if (componentType.equals(SchemaSymbols.ELT_COMPLEXTYPE)) {
- fComplexTypeTraverser.traverseGlobal(globalComp, currSchemaDoc, currSG);
- }
- else if (componentType.equals(SchemaSymbols.ELT_ELEMENT)) {
- fElementTraverser.traverseGlobal(globalComp, currSchemaDoc, currSG);
- }
- else if (componentType.equals(SchemaSymbols.ELT_GROUP)) {
- fGroupTraverser.traverseGlobal(globalComp, currSchemaDoc, currSG);
- }
- else if (componentType.equals(SchemaSymbols.ELT_NOTATION)) {
- fNotationTraverser.traverse(globalComp, currSchemaDoc, currSG);
- }
- else if (componentType.equals(SchemaSymbols.ELT_SIMPLETYPE)) {
- fSimpleTypeTraverser.traverseGlobal(globalComp, currSchemaDoc, currSG);
- }
- else if (componentType.equals(SchemaSymbols.ELT_ANNOTATION)) {
- currSG.addAnnotation(fElementTraverser.traverseAnnotationDecl(globalComp, currSchemaDoc.getSchemaAttrs(), true, currSchemaDoc));
- sawAnnotation = true;
- }
- else {
- reportSchemaError("s4s-elt-invalid-content.1", new Object [] {SchemaSymbols.ELT_SCHEMA, DOMUtil.getLocalName(globalComp)}, globalComp);
- }
- } // end for
-
- if (!sawAnnotation) {
- String text = DOMUtil.getSyntheticAnnotation(currRoot);
- if (text != null) {
- currSG.addAnnotation(fElementTraverser.traverseSyntheticAnnotation(currRoot, text, currSchemaDoc.getSchemaAttrs(), true, currSchemaDoc));
- }
- }
-
- /** Collect annotation information for validation. **/
- if (annotationInfo != null) {
- XSAnnotationInfo info = currSchemaDoc.getAnnotations();
- /** Only add annotations to the list if there were any in this document. **/
- if (info != null) {
- annotationInfo.add(doc2SystemId(currDoc));
- annotationInfo.add(info);
- }
- }
- // now we're done with this one!
- currSchemaDoc.returnSchemaAttrs();
- DOMUtil.setHidden(currDoc, fHiddenNodes);
-
- // now add the schemas this guy depends on
- Vector<XSDocumentInfo> currSchemaDepends = fDependencyMap.get(currSchemaDoc);
- for (int i = 0; i < currSchemaDepends.size(); i++) {
- schemasToProcess.push(currSchemaDepends.elementAt(i));
- }
- } // while
- } // end traverseSchemas
-
- // store whether we have reported an error about that no grammar
- // is found for the given namespace uri
- private Vector fReportedTNS = null;
- // check whether we need to report an error against the given uri.
- // if we have reported an error, then we don't need to report again;
- // otherwise we reported the error, and remember this fact.
- private final boolean needReportTNSError(String uri) {
- if (fReportedTNS == null)
- fReportedTNS = new Vector();
- else if (fReportedTNS.contains(uri))
- return false;
- fReportedTNS.addElement(uri);
- return true;
- }
-
- private static final String[] COMP_TYPE = {
- null, // index 0
- "attribute declaration",
- "attribute group",
- "element declaration",
- "group",
- "identity constraint",
- "notation",
- "type definition",
- };
-
- private static final String[] CIRCULAR_CODES = {
- "Internal-Error",
- "Internal-Error",
- "src-attribute_group.3",
- "e-props-correct.6",
- "mg-props-correct.2",
- "Internal-Error",
- "Internal-Error",
- "st-props-correct.2", //or ct-props-correct.3
- };
-
- // add a global attribute decl from a current schema load (only if no existing decl is found)
- void addGlobalAttributeDecl(XSAttributeDecl decl) {
- final String namespace = decl.getNamespace();
- final String declKey = (namespace == null || namespace.length() == 0)
- ? "," + decl.getName() : namespace + "," + decl.getName();
-
- if (fGlobalAttrDecls.get(declKey) == null) {
- fGlobalAttrDecls.put(declKey, decl);
- }
- }
-
- // add a global attribute group decl from a current schema load (only if no existing decl is found)
- void addGlobalAttributeGroupDecl(XSAttributeGroupDecl decl) {
- final String namespace = decl.getNamespace();
- final String declKey = (namespace == null || namespace.length() == 0)
- ? "," + decl.getName() : namespace + "," + decl.getName();
-
- if (fGlobalAttrGrpDecls.get(declKey) == null) {
- fGlobalAttrGrpDecls.put(declKey, decl);
- }
- }
-
- // add a global element decl from a current schema load (only if no existing decl is found)
- void addGlobalElementDecl(XSElementDecl decl) {
- final String namespace = decl.getNamespace();
- final String declKey = (namespace == null || namespace.length() == 0)
- ? "," + decl.getName() : namespace + "," + decl.getName();
-
- if (fGlobalElemDecls.get(declKey) == null) {
- fGlobalElemDecls.put(declKey, decl);
- }
- }
-
- // add a global group decl from a current schema load (only if no existing decl is found)
- void addGlobalGroupDecl(XSGroupDecl decl) {
- final String namespace = decl.getNamespace();
- final String declKey = (namespace == null || namespace.length() == 0)
- ? "," + decl.getName() : namespace + "," + decl.getName();
-
- if (fGlobalGroupDecls.get(declKey) == null) {
- fGlobalGroupDecls.put(declKey, decl);
- }
- }
-
- // add a global notation decl from a current schema load (only if no existing decl is found)
- void addGlobalNotationDecl(XSNotationDecl decl) {
- final String namespace = decl.getNamespace();
- final String declKey = (namespace == null || namespace.length() == 0)
- ? "," + decl.getName() : namespace + "," + decl.getName();
-
- if (fGlobalNotationDecls.get(declKey) == null) {
- fGlobalNotationDecls.put(declKey, decl);
- }
- }
-
- // add a global type decl from a current schema load (only if no existing decl is found)
- void addGlobalTypeDecl(XSTypeDefinition decl) {
- final String namespace = decl.getNamespace();
- final String declKey = (namespace == null || namespace.length() == 0)
- ? "," + decl.getName() : namespace + "," + decl.getName();
-
- if (fGlobalTypeDecls.get(declKey) == null) {
- fGlobalTypeDecls.put(declKey, decl);
- }
- }
-
- // add a identity constraint decl from a current schema load (only if no existing decl is found)
- void addIDConstraintDecl(IdentityConstraint decl) {
- final String namespace = decl.getNamespace();
- final String declKey = (namespace == null || namespace.length() == 0)
- ? "," + decl.getIdentityConstraintName() : namespace + "," + decl.getIdentityConstraintName();
-
- if (fGlobalIDConstraintDecls.get(declKey) == null) {
- fGlobalIDConstraintDecls.put(declKey, decl);
- }
- }
-
- private XSAttributeDecl getGlobalAttributeDecl(String declKey) {
- return (XSAttributeDecl)fGlobalAttrDecls.get(declKey);
- }
-
- private XSAttributeGroupDecl getGlobalAttributeGroupDecl(String declKey) {
- return (XSAttributeGroupDecl)fGlobalAttrGrpDecls.get(declKey);
- }
-
- private XSElementDecl getGlobalElementDecl(String declKey) {
- return (XSElementDecl)fGlobalElemDecls.get(declKey);
- }
-
- private XSGroupDecl getGlobalGroupDecl(String declKey) {
- return (XSGroupDecl)fGlobalGroupDecls.get(declKey);
- }
-
- private XSNotationDecl getGlobalNotationDecl(String declKey) {
- return (XSNotationDecl)fGlobalNotationDecls.get(declKey);
- }
-
- private XSTypeDefinition getGlobalTypeDecl(String declKey) {
- return (XSTypeDefinition)fGlobalTypeDecls.get(declKey);
- }
-
- private IdentityConstraint getIDConstraintDecl(String declKey) {
- return (IdentityConstraint)fGlobalIDConstraintDecls.get(declKey);
- }
-
- // since it is forbidden for traversers to talk to each other
- // directly (except wen a traverser encounters a local declaration),
- // this provides a generic means for a traverser to call
- // for the traversal of some declaration. An XSDocumentInfo is
- // required because the XSDocumentInfo that the traverser is traversing
- // may bear no relation to the one the handler is operating on.
- // This method will:
- // 1. See if a global definition matching declToTraverse exists;
- // 2. if so, determine if there is a path from currSchema to the
- // schema document where declToTraverse lives (i.e., do a lookup
- // in DependencyMap);
- // 3. depending on declType (which will be relevant to step 1 as
- // well), call the appropriate traverser with the appropriate
- // XSDocumentInfo object.
- // This method returns whatever the traverser it called returned;
- // this will be an Object of some kind
- // that lives in the Grammar.
- protected Object getGlobalDecl(XSDocumentInfo currSchema,
- int declType,
- QName declToTraverse,
- Element elmNode) {
-
- if (DEBUG_NODE_POOL) {
- System.out.println("TRAVERSE_GL: "+declToTraverse.toString());
- }
-
- // from the schema spec, all built-in types are present in all schemas,
- // so if the requested component is a type, and could be found in the
- // default schema grammar, we should return that type.
- // otherwise (since we would support user-defined schema grammar) we'll
- // use the normal way to get the decl
- if (declToTraverse.uri != null &&
- declToTraverse.uri == SchemaSymbols.URI_SCHEMAFORSCHEMA) {
- if (declType == TYPEDECL_TYPE) {
- Object retObj = SchemaGrammar.SG_SchemaNS.getGlobalTypeDecl(declToTraverse.localpart);
- if (retObj != null)
- return retObj;
- }
- }
-
- // now check whether this document can access the requsted namespace
- if (!currSchema.isAllowedNS(declToTraverse.uri)) {
- // cannot get to this schema from the one containing the requesting decl
- if (currSchema.needReportTNSError(declToTraverse.uri)) {
- String code = declToTraverse.uri == null ? "src-resolve.4.1" : "src-resolve.4.2";
- reportSchemaError(code, new Object[]{fDoc2SystemId.get(currSchema.fSchemaElement), declToTraverse.uri, declToTraverse.rawname}, elmNode);
- }
- // Recover and continue to look for the component.
- // return null;
- }
-
- // check whether there is grammar for the requested namespace
- SchemaGrammar sGrammar = fGrammarBucket.getGrammar(declToTraverse.uri);
- if (sGrammar == null) {
- if (needReportTNSError(declToTraverse.uri))
- reportSchemaError("src-resolve", new Object[]{declToTraverse.rawname, COMP_TYPE[declType]}, elmNode);
- return null;
- }
-
- // if there is such grammar, check whether the requested component is in the grammar
- Object retObj = getGlobalDeclFromGrammar(sGrammar, declType, declToTraverse.localpart);
- String declKey = declToTraverse.uri == null? ","+declToTraverse.localpart:
- declToTraverse.uri+","+declToTraverse.localpart;
-
- // if the component is parsed, return it
- if (!fTolerateDuplicates) {
- if (retObj != null) {
- return retObj;
- }
- }
- else {
- Object retObj2 = getGlobalDecl(declKey, declType);
- if (retObj2 != null) {
- return retObj2;
- }
- }
-
- XSDocumentInfo schemaWithDecl = null;
- Element decl = null;
- XSDocumentInfo declDoc = null;
-
- // the component is not parsed, try to find a DOM element for it
- switch (declType) {
- case ATTRIBUTE_TYPE :
- decl = getElementFromMap(fUnparsedAttributeRegistry, declKey);
- declDoc = getDocInfoFromMap(fUnparsedAttributeRegistrySub, declKey);
- break;
- case ATTRIBUTEGROUP_TYPE :
- decl = getElementFromMap(fUnparsedAttributeGroupRegistry, declKey);
- declDoc = getDocInfoFromMap(fUnparsedAttributeGroupRegistrySub, declKey);
- break;
- case ELEMENT_TYPE :
- decl = getElementFromMap(fUnparsedElementRegistry, declKey);
- declDoc = getDocInfoFromMap(fUnparsedElementRegistrySub, declKey);
- break;
- case GROUP_TYPE :
- decl = getElementFromMap(fUnparsedGroupRegistry, declKey);
- declDoc = getDocInfoFromMap(fUnparsedGroupRegistrySub, declKey);
- break;
- case IDENTITYCONSTRAINT_TYPE :
- decl = getElementFromMap(fUnparsedIdentityConstraintRegistry, declKey);
- declDoc = getDocInfoFromMap(fUnparsedIdentityConstraintRegistrySub, declKey);
- break;
- case NOTATION_TYPE :
- decl = getElementFromMap(fUnparsedNotationRegistry, declKey);
- declDoc = getDocInfoFromMap(fUnparsedNotationRegistrySub, declKey);
- break;
- case TYPEDECL_TYPE :
- decl = getElementFromMap(fUnparsedTypeRegistry, declKey);
- declDoc = getDocInfoFromMap(fUnparsedTypeRegistrySub, declKey);
- break;
- default:
- reportSchemaError("Internal-Error", new Object [] {"XSDHandler asked to locate component of type " + declType + "; it does not recognize this type!"}, elmNode);
- }
-
- // no DOM element found, so the component can't be located
- if (decl == null) {
- if (retObj == null) {
- reportSchemaError("src-resolve", new Object[]{declToTraverse.rawname, COMP_TYPE[declType]}, elmNode);
- }
- return retObj;
- }
-
- // get the schema doc containing the component to be parsed
- // it should always return non-null value, but since null-checking
- // comes for free, let's be safe and check again
- schemaWithDecl = findXSDocumentForDecl(currSchema, decl, declDoc);
- if (schemaWithDecl == null) {
- // cannot get to this schema from the one containing the requesting decl
- if (retObj == null) {
- String code = declToTraverse.uri == null ? "src-resolve.4.1" : "src-resolve.4.2";
- reportSchemaError(code, new Object[]{fDoc2SystemId.get(currSchema.fSchemaElement), declToTraverse.uri, declToTraverse.rawname}, elmNode);
- }
- return retObj;
- }
-
- // a component is hidden, meaning either it's traversed, or being traversed.
- // but we didn't find it in the grammar, so it's the latter case, and
- // a circular reference. error!
- if (DOMUtil.isHidden(decl, fHiddenNodes)) {
- if (retObj == null) {
- String code = CIRCULAR_CODES[declType];
- if (declType == TYPEDECL_TYPE) {
- if (SchemaSymbols.ELT_COMPLEXTYPE.equals(DOMUtil.getLocalName(decl))) {
- code = "ct-props-correct.3";
- }
- }
- // decl must not be null if we're here...
- reportSchemaError(code, new Object [] {declToTraverse.prefix+":"+declToTraverse.localpart}, elmNode);
- }
- return retObj;
- }
-
- return traverseGlobalDecl(declType, decl, schemaWithDecl, sGrammar);
- } // getGlobalDecl(XSDocumentInfo, int, QName): Object
-
- // If we are tolerating duplicate declarations and allowing namespace growth
- // use the declaration from the current schema load (if it exists)
- protected Object getGlobalDecl(String declKey, int declType) {
- Object retObj = null;
-
- switch (declType) {
- case ATTRIBUTE_TYPE :
- retObj = getGlobalAttributeDecl(declKey);
- break;
- case ATTRIBUTEGROUP_TYPE :
- retObj = getGlobalAttributeGroupDecl(declKey);
- break;
- case ELEMENT_TYPE :
- retObj = getGlobalElementDecl(declKey);
- break;
- case GROUP_TYPE :
- retObj = getGlobalGroupDecl(declKey);
- break;
- case IDENTITYCONSTRAINT_TYPE :
- retObj = getIDConstraintDecl(declKey);
- break;
- case NOTATION_TYPE :
- retObj = getGlobalNotationDecl(declKey);
- break;
- case TYPEDECL_TYPE :
- retObj = getGlobalTypeDecl(declKey);
- break;
- }
-
- return retObj;
- }
-
- protected Object getGlobalDeclFromGrammar(SchemaGrammar sGrammar, int declType, String localpart) {
- Object retObj = null;
-
- switch (declType) {
- case ATTRIBUTE_TYPE :
- retObj = sGrammar.getGlobalAttributeDecl(localpart);
- break;
- case ATTRIBUTEGROUP_TYPE :
- retObj = sGrammar.getGlobalAttributeGroupDecl(localpart);
- break;
- case ELEMENT_TYPE :
- retObj = sGrammar.getGlobalElementDecl(localpart);
- break;
- case GROUP_TYPE :
- retObj = sGrammar.getGlobalGroupDecl(localpart);
- break;
- case IDENTITYCONSTRAINT_TYPE :
- retObj = sGrammar.getIDConstraintDecl(localpart);
- break;
- case NOTATION_TYPE :
- retObj = sGrammar.getGlobalNotationDecl(localpart);
- break;
- case TYPEDECL_TYPE :
- retObj = sGrammar.getGlobalTypeDecl(localpart);
- break;
- }
-
- return retObj;
- }
-
- protected Object getGlobalDeclFromGrammar(SchemaGrammar sGrammar, int declType, String localpart, String schemaLoc) {
- Object retObj = null;
-
- switch (declType) {
- case ATTRIBUTE_TYPE :
- retObj = sGrammar.getGlobalAttributeDecl(localpart, schemaLoc);
- break;
- case ATTRIBUTEGROUP_TYPE :
- retObj = sGrammar.getGlobalAttributeGroupDecl(localpart, schemaLoc);
- break;
- case ELEMENT_TYPE :
- retObj = sGrammar.getGlobalElementDecl(localpart, schemaLoc);
- break;
- case GROUP_TYPE :
- retObj = sGrammar.getGlobalGroupDecl(localpart, schemaLoc);
- break;
- case IDENTITYCONSTRAINT_TYPE :
- retObj = sGrammar.getIDConstraintDecl(localpart, schemaLoc);
- break;
- case NOTATION_TYPE :
- retObj = sGrammar.getGlobalNotationDecl(localpart, schemaLoc);
- break;
- case TYPEDECL_TYPE :
- retObj = sGrammar.getGlobalTypeDecl(localpart, schemaLoc);
- break;
- }
-
- return retObj;
- }
-
- protected Object traverseGlobalDecl(int declType, Element decl, XSDocumentInfo schemaDoc, SchemaGrammar grammar) {
- Object retObj = null;
-
- DOMUtil.setHidden(decl, fHiddenNodes);
- SchemaNamespaceSupport nsSupport = null;
- // if the parent is <redefine> use the namespace delcs for it.
- Element parent = DOMUtil.getParent(decl);
- if (DOMUtil.getLocalName(parent).equals(SchemaSymbols.ELT_REDEFINE))
- nsSupport = (fRedefine2NSSupport!=null)?(SchemaNamespaceSupport)fRedefine2NSSupport.get(parent):null;
- // back up the current SchemaNamespaceSupport, because we need to provide
- // a fresh one to the traverseGlobal methods.
- schemaDoc.backupNSSupport(nsSupport);
-
- // traverse the referenced global component
- switch (declType) {
- case TYPEDECL_TYPE :
- if (DOMUtil.getLocalName(decl).equals(SchemaSymbols.ELT_COMPLEXTYPE)) {
- retObj = fComplexTypeTraverser.traverseGlobal(decl, schemaDoc, grammar);
- }
- else {
- retObj = fSimpleTypeTraverser.traverseGlobal(decl, schemaDoc, grammar);
- }
- break;
- case ATTRIBUTE_TYPE :
- retObj = fAttributeTraverser.traverseGlobal(decl, schemaDoc, grammar);
- break;
- case ELEMENT_TYPE :
- retObj = fElementTraverser.traverseGlobal(decl, schemaDoc, grammar);
- break;
- case ATTRIBUTEGROUP_TYPE :
- retObj = fAttributeGroupTraverser.traverseGlobal(decl, schemaDoc, grammar);
- break;
- case GROUP_TYPE :
- retObj = fGroupTraverser.traverseGlobal(decl, schemaDoc, grammar);
- break;
- case NOTATION_TYPE :
- retObj = fNotationTraverser.traverse(decl, schemaDoc, grammar);
- break;
- case IDENTITYCONSTRAINT_TYPE :
- // identity constraints should have been parsed already...
- // we should never get here
- break;
- }
-
- // restore the previous SchemaNamespaceSupport, so that the caller can get
- // proper namespace binding.
- schemaDoc.restoreNSSupport();
-
- return retObj;
- }
-
- public String schemaDocument2SystemId(XSDocumentInfo schemaDoc) {
- return fDoc2SystemId.get(schemaDoc.fSchemaElement);
- }
-
- // This method determines whether there is a group
- // (attributeGroup) which the given one has redefined by
- // restriction. If so, it returns it; else it returns null.
- // @param type: whether what's been redefined is an
- // attributeGroup or a group;
- // @param name: the QName of the component doing the redefining.
- // @param currSchema: schema doc in which the redefining component lives.
- // @return: Object representing decl redefined if present, null
- // otherwise.
- Object getGrpOrAttrGrpRedefinedByRestriction(int type, QName name, XSDocumentInfo currSchema, Element elmNode) {
- String realName = name.uri != null?name.uri+","+name.localpart:
- ","+name.localpart;
- String nameToFind = null;
- switch (type) {
- case ATTRIBUTEGROUP_TYPE:
- nameToFind = (String)fRedefinedRestrictedAttributeGroupRegistry.get(realName);
- break;
- case GROUP_TYPE:
- nameToFind = (String)fRedefinedRestrictedGroupRegistry.get(realName);
- break;
- default:
- return null;
- }
- if (nameToFind == null) return null;
- int commaPos = nameToFind.indexOf(",");
- QName qNameToFind = new QName(XMLSymbols.EMPTY_STRING, nameToFind.substring(commaPos+1),
- nameToFind.substring(commaPos), (commaPos == 0)? null : nameToFind.substring(0, commaPos));
- Object retObj = getGlobalDecl(currSchema, type, qNameToFind, elmNode);
- if(retObj == null) {
- switch (type) {
- case ATTRIBUTEGROUP_TYPE:
- reportSchemaError("src-redefine.7.2.1", new Object []{name.localpart}, elmNode);
- break;
- case GROUP_TYPE:
- reportSchemaError("src-redefine.6.2.1", new Object []{name.localpart}, elmNode);
- break;
- }
- return null;
- }
- return retObj;
- } // getGrpOrAttrGrpRedefinedByRestriction(int, QName, XSDocumentInfo): Object
-
- // Since ID constraints can occur in local elements, unless we
- // wish to completely traverse all our DOM trees looking for ID
- // constraints while we're building our global name registries,
- // which seems terribly inefficient, we need to resolve keyrefs
- // after all parsing is complete. This we can simply do by running through
- // fIdentityConstraintRegistry and calling traverseKeyRef on all
- // of the KeyRef nodes. This unfortunately removes this knowledge
- // from the elementTraverser class (which must ignore keyrefs),
- // but there seems to be no efficient way around this...
- protected void resolveKeyRefs() {
- for (int i=0; i<fKeyrefStackPos; i++) {
- XSDocumentInfo keyrefSchemaDoc = fKeyrefsMapXSDocumentInfo[i];
- keyrefSchemaDoc.fNamespaceSupport.makeGlobal();
- keyrefSchemaDoc.fNamespaceSupport.setEffectiveContext( fKeyrefNamespaceContext[i] );
- SchemaGrammar keyrefGrammar = fGrammarBucket.getGrammar(keyrefSchemaDoc.fTargetNamespace);
- // need to set <keyref> to hidden before traversing it,
- // because it has global scope
- DOMUtil.setHidden(fKeyrefs[i], fHiddenNodes);
- fKeyrefTraverser.traverse(fKeyrefs[i], fKeyrefElems[i], keyrefSchemaDoc, keyrefGrammar);
- }
- } // end resolveKeyRefs
-
- // an accessor method. Just makes sure callers
- // who want the Identity constraint registry vaguely know what they're about.
- protected Map getIDRegistry() {
- return fUnparsedIdentityConstraintRegistry;
- }
- // an accessor method.
- protected Map getIDRegistry_sub() {
- return fUnparsedIdentityConstraintRegistrySub;
- }
-
-
-
- // This method squirrels away <keyref> declarations--along with the element
- // decls and namespace bindings they might find handy.
- protected void storeKeyRef (Element keyrefToStore, XSDocumentInfo schemaDoc,
- XSElementDecl currElemDecl) {
- String keyrefName = DOMUtil.getAttrValue(keyrefToStore, SchemaSymbols.ATT_NAME);
- if (keyrefName.length() != 0) {
- String keyrefQName = schemaDoc.fTargetNamespace == null?
- "," + keyrefName: schemaDoc.fTargetNamespace+","+keyrefName;
- checkForDuplicateNames(keyrefQName, IDENTITYCONSTRAINT_TYPE, fUnparsedIdentityConstraintRegistry, fUnparsedIdentityConstraintRegistrySub, keyrefToStore, schemaDoc);
- }
- // now set up all the registries we'll need...
-
- // check array sizes
- if (fKeyrefStackPos == fKeyrefs.length) {
- Element [] elemArray = new Element [fKeyrefStackPos + INC_KEYREF_STACK_AMOUNT];
- System.arraycopy(fKeyrefs, 0, elemArray, 0, fKeyrefStackPos);
- fKeyrefs = elemArray;
- XSElementDecl [] declArray = new XSElementDecl [fKeyrefStackPos + INC_KEYREF_STACK_AMOUNT];
- System.arraycopy(fKeyrefElems, 0, declArray, 0, fKeyrefStackPos);
- fKeyrefElems = declArray;
- String[][] stringArray = new String [fKeyrefStackPos + INC_KEYREF_STACK_AMOUNT][];
- System.arraycopy(fKeyrefNamespaceContext, 0, stringArray, 0, fKeyrefStackPos);
- fKeyrefNamespaceContext = stringArray;
-
- XSDocumentInfo [] xsDocumentInfo = new XSDocumentInfo [fKeyrefStackPos + INC_KEYREF_STACK_AMOUNT];
- System.arraycopy(fKeyrefsMapXSDocumentInfo, 0, xsDocumentInfo, 0, fKeyrefStackPos);
- fKeyrefsMapXSDocumentInfo = xsDocumentInfo;
-
- }
- fKeyrefs[fKeyrefStackPos] = keyrefToStore;
- fKeyrefElems[fKeyrefStackPos] = currElemDecl;
- fKeyrefNamespaceContext[fKeyrefStackPos] = schemaDoc.fNamespaceSupport.getEffectiveLocalContext();
-
- fKeyrefsMapXSDocumentInfo[fKeyrefStackPos++] = schemaDoc;
- } // storeKeyref (Element, XSDocumentInfo, XSElementDecl): void
-
-
- /**
- * resolveSchema method is responsible for resolving location of the schema (using XMLEntityResolver),
- * and if it was succefully resolved getting the schema Document.
- * @param desc
- * @param mustResolve
- * @param referElement
- * @return A schema Element or null.
- */
- private Element resolveSchema(XSDDescription desc, boolean mustResolve,
- Element referElement, boolean usePairs) {
- XMLInputSource schemaSource = null;
- try {
- Map<String, XMLSchemaLoader.LocationArray> pairs = usePairs ? fLocationPairs : Collections.emptyMap();
- schemaSource = XMLSchemaLoader.resolveDocument(desc, pairs, fEntityManager);
- }
- catch (IOException ex) {
- if (mustResolve) {
- reportSchemaError("schema_reference.4",
- new Object[]{desc.getLocationHints()[0]},
- referElement);
- }
- else {
- reportSchemaWarning("schema_reference.4",
- new Object[]{desc.getLocationHints()[0]},
- referElement);
- }
- }
- if (schemaSource instanceof DOMInputSource) {
- return getSchemaDocument(desc.getTargetNamespace(), (DOMInputSource) schemaSource, mustResolve, desc.getContextType(), referElement);
- } // DOMInputSource
- else if (schemaSource instanceof SAXInputSource) {
- return getSchemaDocument(desc.getTargetNamespace(), (SAXInputSource) schemaSource, mustResolve, desc.getContextType(), referElement);
- } // SAXInputSource
- else if (schemaSource instanceof StAXInputSource) {
- return getSchemaDocument(desc.getTargetNamespace(), (StAXInputSource) schemaSource, mustResolve, desc.getContextType(), referElement);
- } // StAXInputSource
- else if (schemaSource instanceof XSInputSource) {
- return getSchemaDocument((XSInputSource) schemaSource, desc);
- } // XSInputSource
- return getSchemaDocument(desc.getTargetNamespace(), schemaSource, mustResolve, desc.getContextType(), referElement);
- } // getSchema(String, String, String, boolean, short): Document
-
- private Element resolveSchema(XMLInputSource schemaSource, XSDDescription desc,
- boolean mustResolve, Element referElement) {
-
- if (schemaSource instanceof DOMInputSource) {
- return getSchemaDocument(desc.getTargetNamespace(), (DOMInputSource) schemaSource, mustResolve, desc.getContextType(), referElement);
- } // DOMInputSource
- else if (schemaSource instanceof SAXInputSource) {
- return getSchemaDocument(desc.getTargetNamespace(), (SAXInputSource) schemaSource, mustResolve, desc.getContextType(), referElement);
- } // SAXInputSource
- else if (schemaSource instanceof StAXInputSource) {
- return getSchemaDocument(desc.getTargetNamespace(), (StAXInputSource) schemaSource, mustResolve, desc.getContextType(), referElement);
- } // StAXInputSource
- else if (schemaSource instanceof XSInputSource) {
- return getSchemaDocument((XSInputSource) schemaSource, desc);
- } // XSInputSource
- return getSchemaDocument(desc.getTargetNamespace(), schemaSource, mustResolve, desc.getContextType(), referElement);
- }
-
- private XMLInputSource resolveSchemaSource(XSDDescription desc, boolean mustResolve,
- Element referElement, boolean usePairs) {
-
- XMLInputSource schemaSource = null;
- try {
- Map<String, XMLSchemaLoader.LocationArray> pairs = usePairs ? fLocationPairs : Collections.emptyMap();
- schemaSource = XMLSchemaLoader.resolveDocument(desc, pairs, fEntityManager);
- }
- catch (IOException ex) {
- if (mustResolve) {
- reportSchemaError("schema_reference.4",
- new Object[]{desc.getLocationHints()[0]},
- referElement);
- }
- else {
- reportSchemaWarning("schema_reference.4",
- new Object[]{desc.getLocationHints()[0]},
- referElement);
- }
- }
-
- return schemaSource;
- }
-
- /**
- * getSchemaDocument method uses XMLInputSource to parse a schema document.
- * @param schemaNamespace
- * @param schemaSource
- * @param mustResolve
- * @param referType
- * @param referElement
- * @return A schema Element.
- */
- private Element getSchemaDocument(String schemaNamespace, XMLInputSource schemaSource,
- boolean mustResolve, short referType, Element referElement) {
-
- boolean hasInput = true;
- IOException exception = null;
- // contents of this method will depend on the system we adopt for entity resolution--i.e., XMLEntityHandler, EntityHandler, etc.
- Element schemaElement = null;
- try {
- // when the system id and byte stream and character stream
- // of the input source are all null, it's
- // impossible to find the schema document. so we skip in
- // this case. otherwise we'll receive some NPE or
- // file not found errors. but schemaHint=="" is perfectly
- // legal for import.
- if (schemaSource != null &&
- (schemaSource.getSystemId() != null ||
- schemaSource.getByteStream() != null ||
- schemaSource.getCharacterStream() != null)) {
-
- // When the system id of the input source is used, first try to
- // expand it, and check whether the same document has been
- // parsed before. If so, return the document corresponding to
- // that system id.
- XSDKey key = null;
- String schemaId = null;
- if (referType != XSDDescription.CONTEXT_PREPARSE){
- schemaId = XMLEntityManager.expandSystemId(schemaSource.getSystemId(), schemaSource.getBaseSystemId(), false);
- key = new XSDKey(schemaId, referType, schemaNamespace);
- if((schemaElement = fTraversed.get(key)) != null) {
- fLastSchemaWasDuplicate = true;
- return schemaElement;
- }
- if (referType == XSDDescription.CONTEXT_IMPORT || referType == XSDDescription.CONTEXT_INCLUDE
- || referType == XSDDescription.CONTEXT_REDEFINE) {
- String accessError = SecuritySupport.checkAccess(schemaId, fAccessExternalSchema, Constants.ACCESS_EXTERNAL_ALL);
- if (accessError != null) {
- reportSchemaFatalError("schema_reference.access",
- new Object[] { SecuritySupport.sanitizePath(schemaId), accessError },
- referElement);
- }
- }
- }
-
- fSchemaParser.parse(schemaSource);
- Document schemaDocument = fSchemaParser.getDocument();
- schemaElement = schemaDocument != null ? DOMUtil.getRoot(schemaDocument) : null;
- return getSchemaDocument0(key, schemaId, schemaElement);
- }
- else {
- hasInput = false;
- }
- }
- catch (IOException ex) {
- exception = ex;
- }
- return getSchemaDocument1(mustResolve, hasInput, schemaSource, referElement, exception);
- } // getSchemaDocument(String, XMLInputSource, boolean, short, Element): Element
-
- /**
- * getSchemaDocument method uses SAXInputSource to parse a schema document.
- * @param schemaNamespace
- * @param schemaSource
- * @param mustResolve
- * @param referType
- * @param referElement
- * @return A schema Element.
- */
- private Element getSchemaDocument(String schemaNamespace, SAXInputSource schemaSource,
- boolean mustResolve, short referType, Element referElement) {
- XMLReader parser = schemaSource.getXMLReader();
- InputSource inputSource = schemaSource.getInputSource();
- boolean hasInput = true;
- IOException exception = null;
- Element schemaElement = null;
- try {
- if (inputSource != null &&
- (inputSource.getSystemId() != null ||
- inputSource.getByteStream() != null ||
- inputSource.getCharacterStream() != null)) {
-
- // check whether the same document has been parsed before.
- // If so, return the document corresponding to that system id.
- XSDKey key = null;
- String schemaId = null;
- if (referType != XSDDescription.CONTEXT_PREPARSE) {
- schemaId = XMLEntityManager.expandSystemId(inputSource.getSystemId(), schemaSource.getBaseSystemId(), false);
- key = new XSDKey(schemaId, referType, schemaNamespace);
- if ((schemaElement = fTraversed.get(key)) != null) {
- fLastSchemaWasDuplicate = true;
- return schemaElement;
- }
- }
-
- boolean namespacePrefixes = false;
- if (parser != null) {
- try {
- namespacePrefixes = parser.getFeature(NAMESPACE_PREFIXES);
- }
- catch (SAXException se) {}
- }
- else {
- try {
- parser = XMLReaderFactory.createXMLReader();
- }
- // If something went wrong with the factory
- // just use our own SAX parser.
- catch (SAXException se) {
- parser = new SAXParser();
- }
- try {
- parser.setFeature(NAMESPACE_PREFIXES, true);
- namespacePrefixes = true;
- // If this is a Xerces SAX parser set the security manager if there is one
- if (parser instanceof SAXParser) {
- if (fSecurityManager != null) {
- parser.setProperty(SECURITY_MANAGER, fSecurityManager);
- }
- }
- }
- catch (SAXException se) {}
-
- try {
- parser.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, fAccessExternalDTD);
- } catch (SAXNotRecognizedException exc) {
- XMLSecurityManager.printWarning(parser.getClass().getName(),
- XMLConstants.ACCESS_EXTERNAL_DTD, exc);
- }
- }
- // If XML names and Namespace URIs are already internalized we
- // can avoid running them through the SymbolTable.
- boolean stringsInternalized = false;
- try {
- stringsInternalized = parser.getFeature(STRING_INTERNING);
- }
- catch (SAXException exc) {
- // The feature isn't recognized or getting it is not supported.
- // In either case, assume that strings are not internalized.
- }
- if (fXSContentHandler == null) {
- fXSContentHandler = new SchemaContentHandler();
- }
- fXSContentHandler.reset(fSchemaParser, fSymbolTable,
- namespacePrefixes, stringsInternalized);
- parser.setContentHandler(fXSContentHandler);
- parser.setErrorHandler(fErrorReporter.getSAXErrorHandler());
-
- parser.parse(inputSource);
- // Disconnect the schema loader and other objects from the XMLReader
- try {
- parser.setContentHandler(null);
- parser.setErrorHandler(null);
- }
- // Ignore any exceptions thrown by the XMLReader. Old versions of SAX
- // required an XMLReader to throw a NullPointerException if an attempt
- // to set a handler to null was made.
- catch (Exception e) {}
-
- Document schemaDocument = fXSContentHandler.getDocument();
- schemaElement = schemaDocument != null ? DOMUtil.getRoot(schemaDocument) : null;
- return getSchemaDocument0(key, schemaId, schemaElement);
- }
- else {
- hasInput = false;
- }
- }
- catch (SAXParseException spe) {
- throw SAX2XNIUtil.createXMLParseException0(spe);
- }
- catch (SAXException se) {
- throw SAX2XNIUtil.createXNIException0(se);
- }
- catch (IOException ioe) {
- exception = ioe;
- }
- return getSchemaDocument1(mustResolve, hasInput, schemaSource, referElement, exception);
- } // getSchemaDocument(String, SAXInputSource, boolean, short, Element): Element
-
- /**
- * getSchemaDocument method uses DOMInputSource to parse a schema document.
- * @param schemaNamespace
- * @param schemaSource
- * @param mustResolve
- * @param referType
- * @param referElement
- * @return A schema Element.
- */
- private Element getSchemaDocument(String schemaNamespace, DOMInputSource schemaSource,
- boolean mustResolve, short referType, Element referElement) {
- boolean hasInput = true;
- IOException exception = null;
- Element schemaElement = null;
- Element schemaRootElement = null;
-
- final Node node = schemaSource.getNode();
- short nodeType = -1;
- if (node != null) {
- nodeType = node.getNodeType();
- if (nodeType == Node.DOCUMENT_NODE) {
- schemaRootElement = DOMUtil.getRoot((Document) node);
- }
- else if (nodeType == Node.ELEMENT_NODE) {
- schemaRootElement = (Element) node;
- }
- }
-
- try {
- if (schemaRootElement != null) {
- // check whether the same document has been parsed before.
- // If so, return the document corresponding to that system id.
- XSDKey key = null;
- String schemaId = null;
- if (referType != XSDDescription.CONTEXT_PREPARSE) {
- schemaId = XMLEntityManager.expandSystemId(schemaSource.getSystemId(), schemaSource.getBaseSystemId(), false);
- boolean isDocument = (nodeType == Node.DOCUMENT_NODE);
- if (!isDocument) {
- Node parent = schemaRootElement.getParentNode();
- if (parent != null) {
- isDocument = (parent.getNodeType() == Node.DOCUMENT_NODE);
- }
- }
- if (isDocument) {
- key = new XSDKey(schemaId, referType, schemaNamespace);
- if ((schemaElement = fTraversed.get(key)) != null) {
- fLastSchemaWasDuplicate = true;
- return schemaElement;
- }
- }
- }
-
- schemaElement = schemaRootElement;
- return getSchemaDocument0(key, schemaId, schemaElement);
- }
- else {
- hasInput = false;
- }
- }
- catch (IOException ioe) {
- exception = ioe;
- }
- return getSchemaDocument1(mustResolve, hasInput, schemaSource, referElement, exception);
- } // getSchemaDocument(String, DOMInputSource, boolean, short, Element): Element
-
- /**
- * getSchemaDocument method uses StAXInputSource to parse a schema document.
- * @param schemaNamespace
- * @param schemaSource
- * @param mustResolve
- * @param referType
- * @param referElement
- * @return A schema Element.
- */
- private Element getSchemaDocument(String schemaNamespace, StAXInputSource schemaSource,
- boolean mustResolve, short referType, Element referElement) {
- IOException exception = null;
- Element schemaElement = null;
- try {
- final boolean consumeRemainingContent = schemaSource.shouldConsumeRemainingContent();
- final XMLStreamReader streamReader = schemaSource.getXMLStreamReader();
- final XMLEventReader eventReader = schemaSource.getXMLEventReader();
-
- // check whether the same document has been parsed before.
- // If so, return the document corresponding to that system id.
- XSDKey key = null;
- String schemaId = null;
- if (referType != XSDDescription.CONTEXT_PREPARSE) {
- schemaId = XMLEntityManager.expandSystemId(schemaSource.getSystemId(), schemaSource.getBaseSystemId(), false);
- boolean isDocument = consumeRemainingContent;
- if (!isDocument) {
- if (streamReader != null) {
- isDocument = (streamReader.getEventType() == XMLStreamReader.START_DOCUMENT);
- }
- else {
- isDocument = eventReader.peek().isStartDocument();
- }
- }
- if (isDocument) {
- key = new XSDKey(schemaId, referType, schemaNamespace);
- if ((schemaElement = fTraversed.get(key)) != null) {
- fLastSchemaWasDuplicate = true;
- return schemaElement;
- }
- }
- }
-
- if (fStAXSchemaParser == null) {
- fStAXSchemaParser = new StAXSchemaParser();
- }
- fStAXSchemaParser.reset(fSchemaParser, fSymbolTable);
-
- if (streamReader != null) {
- fStAXSchemaParser.parse(streamReader);
- if (consumeRemainingContent) {
- while (streamReader.hasNext()) {
- streamReader.next();
- }
- }
- }
- else {
- fStAXSchemaParser.parse(eventReader);
- if (consumeRemainingContent) {
- while (eventReader.hasNext()) {
- eventReader.nextEvent();
- }
- }
- }
- Document schemaDocument = fStAXSchemaParser.getDocument();
- schemaElement = schemaDocument != null ? DOMUtil.getRoot(schemaDocument) : null;
- return getSchemaDocument0(key, schemaId, schemaElement);
- }
- catch (XMLStreamException e) {
- StAXLocationWrapper slw = new StAXLocationWrapper();
- slw.setLocation(e.getLocation());
- throw new XMLParseException(slw, e.getMessage(), e);
- }
- catch (IOException e) {
- exception = e;
- }
- return getSchemaDocument1(mustResolve, true, schemaSource, referElement, exception);
- } // getSchemaDocument(String, StAXInputSource, boolean, short, Element): Element
-
- /**
- * Code shared between the various getSchemaDocument() methods which
- * stores mapping information for the document.
- */
- private Element getSchemaDocument0(XSDKey key, String schemaId, Element schemaElement) {
- // now we need to store the mapping information from system id
- // to the document. also from the document to the system id.
- if (key != null) {
- fTraversed.put(key, schemaElement);
- }
- if (schemaId != null) {
- fDoc2SystemId.put(schemaElement, schemaId);
- }
- fLastSchemaWasDuplicate = false;
- return schemaElement;
- } // getSchemaDocument0(XSDKey, String, Element): Element
-
- /**
- * Error handling code shared between the various getSchemaDocument() methods.
- */
- private Element getSchemaDocument1(boolean mustResolve, boolean hasInput,
- XMLInputSource schemaSource, Element referElement, IOException ioe) {
- // either an error occured (exception), or empty input source was
- // returned, we need to report an error or a warning
- if (mustResolve) {
- if (hasInput) {
- reportSchemaError("schema_reference.4",
- new Object[]{schemaSource.getSystemId()},
- referElement, ioe);
- }
- else {
- reportSchemaError("schema_reference.4",
- new Object[]{schemaSource == null ? "" : schemaSource.getSystemId()},
- referElement, ioe);
- }
- }
- else if (hasInput) {
- reportSchemaWarning("schema_reference.4",
- new Object[]{schemaSource.getSystemId()},
- referElement, ioe);
- }
-
- fLastSchemaWasDuplicate = false;
- return null;
- } // getSchemaDocument1(boolean, boolean, XMLInputSource, Element): Element
-
- /**
- * getSchemaDocument method uses XMLInputSource to parse a schema document.
- * @param schemaNamespace
- * @param schemaSource
- * @param mustResolve
- * @param referType
- * @param referElement
- * @return A schema Element.
- */
- private Element getSchemaDocument(XSInputSource schemaSource, XSDDescription desc) {
-
- SchemaGrammar[] grammars = schemaSource.getGrammars();
- short referType = desc.getContextType();
-
- if (grammars != null && grammars.length > 0) {
- Vector expandedGrammars = expandGrammars(grammars);
- // check for existing grammars in our bucket
- // and if there exist any, and namespace growth is
- // not enabled - we do nothing
- if (fNamespaceGrowth || !existingGrammars(expandedGrammars)) {
- addGrammars(expandedGrammars);
- if (referType == XSDDescription.CONTEXT_PREPARSE) {
- desc.setTargetNamespace(grammars[0].getTargetNamespace());
- }
- }
- }
- else {
- XSObject[] components = schemaSource.getComponents();
- if (components != null && components.length > 0) {
- Map<String, Vector> importDependencies = new HashMap();
- Vector expandedComponents = expandComponents(components, importDependencies);
- if (fNamespaceGrowth || canAddComponents(expandedComponents)) {
- addGlobalComponents(expandedComponents, importDependencies);
- if (referType == XSDDescription.CONTEXT_PREPARSE) {
- desc.setTargetNamespace(components[0].getNamespace());
- }
- }
- }
- }
- return null;
- } // getSchemaDocument(String, XSInputSource, boolean, short, Element): Element
-
- private Vector expandGrammars(SchemaGrammar[] grammars) {
- Vector currGrammars = new Vector();
-
- for (int i=0; i<grammars.length; i++) {
- if (!currGrammars.contains(grammars[i])) {
- currGrammars.add(grammars[i]);
- }
- }
-
- // for all (recursively) imported grammars
- SchemaGrammar sg1, sg2;
- Vector gs;
- for (int i = 0; i < currGrammars.size(); i++) {
- // get the grammar
- sg1 = (SchemaGrammar)currGrammars.elementAt(i);
- // we need to add grammars imported by sg1 too
- gs = sg1.getImportedGrammars();
- // for all grammars imported by sg2, but not in the vector
- // we add them to the vector
- if (gs == null) {
- continue;
- }
-
- for (int j = gs.size() - 1; j >= 0; j--) {
- sg2 = (SchemaGrammar)gs.elementAt(j);
- if (!currGrammars.contains(sg2)) {
- currGrammars.addElement(sg2);
- }
- }
- }
-
- return currGrammars;
- }
-
- private boolean existingGrammars(Vector grammars) {
- int length = grammars.size();
- final XSDDescription desc = new XSDDescription();
-
- for (int i=0; i < length; i++) {
- final SchemaGrammar sg1 = (SchemaGrammar)grammars.elementAt(i);
- desc.setNamespace(sg1.getTargetNamespace());
-
- final SchemaGrammar sg2 = findGrammar(desc, false);
- if (sg2 != null) {
- return true;
- }
- }
-
- return false;
- }
-
- private boolean canAddComponents(Vector components) {
- final int size = components.size();
- final XSDDescription desc = new XSDDescription();
- for (int i=0; i<size; i++) {
- XSObject component = (XSObject) components.elementAt(i);
- if (!canAddComponent(component, desc)) {
- return false;
- }
- }
- return true;
- }
-
- private boolean canAddComponent(XSObject component, XSDDescription desc) {
- desc.setNamespace(component.getNamespace());
-
- final SchemaGrammar sg = findGrammar(desc, false);
- if (sg == null) {
- return true;
- }
- else if (sg.isImmutable()) {
- return false;
- }
-
- short componentType = component.getType();
- final String name = component.getName();
-
- switch (componentType) {
- case XSConstants.TYPE_DEFINITION :
- if (sg.getGlobalTypeDecl(name) == component) {
- return true;
- }
- break;
- case XSConstants.ATTRIBUTE_DECLARATION :
- if (sg.getGlobalAttributeDecl(name) == component) {
- return true;
- }
- break;
- case XSConstants.ATTRIBUTE_GROUP :
- if (sg.getGlobalAttributeDecl(name) == component) {
- return true;
- }
- break;
- case XSConstants.ELEMENT_DECLARATION :
- if (sg.getGlobalElementDecl(name) == component) {
- return true;
- }
- break;
- case XSConstants.MODEL_GROUP_DEFINITION :
- if (sg.getGlobalGroupDecl(name) == component) {
- return true;
- }
- break;
- case XSConstants.NOTATION_DECLARATION :
- if (sg.getGlobalNotationDecl(name) == component) {
- return true;
- }
- break;
- case XSConstants.IDENTITY_CONSTRAINT :
- case XSConstants.ATTRIBUTE_USE :
- default :
- return true;
- }
- return false;
- }
-
- private void addGrammars(Vector grammars) {
- int length = grammars.size();
- XSDDescription desc = new XSDDescription();
-
- for (int i=0; i < length; i++) {
- final SchemaGrammar sg1 = (SchemaGrammar)grammars.elementAt(i);
- desc.setNamespace(sg1.getTargetNamespace());
-
- final SchemaGrammar sg2 = findGrammar(desc, fNamespaceGrowth);
- if (sg1 != sg2) {
- addGrammarComponents(sg1, sg2);
- }
- }
- }
-
- private void addGrammarComponents(SchemaGrammar srcGrammar, SchemaGrammar dstGrammar) {
- if (dstGrammar == null) {
- createGrammarFrom(srcGrammar);
- return;
- }
-
- SchemaGrammar tmpGrammar = dstGrammar;
- if (tmpGrammar.isImmutable()) {
- tmpGrammar = createGrammarFrom(dstGrammar);
- }
-
- // add any new locations
- addNewGrammarLocations(srcGrammar, tmpGrammar);
-
- // add any new imported grammars
- addNewImportedGrammars(srcGrammar, tmpGrammar);
-
- // add any new global components
- addNewGrammarComponents(srcGrammar, tmpGrammar);
- }
-
- private SchemaGrammar createGrammarFrom(SchemaGrammar grammar) {
- SchemaGrammar newGrammar = new SchemaGrammar(grammar);
- fGrammarBucket.putGrammar(newGrammar);
- // update all the grammars in the bucket to point to the new grammar.
- updateImportListWith(newGrammar);
- // update import list of the new grammar
- updateImportListFor(newGrammar);
- return newGrammar;
- }
-
- private void addNewGrammarLocations(SchemaGrammar srcGrammar, SchemaGrammar dstGrammar) {
- final StringList locations = srcGrammar.getDocumentLocations();
- final int locSize = locations.size();
- final StringList locations2 = dstGrammar.getDocumentLocations();
-
- for (int i=0; i<locSize; i++) {
- String loc = locations.item(i);
- if (!locations2.contains(loc)) {
- dstGrammar.addDocument(null, loc);
- }
- }
- }
-
- private void addNewImportedGrammars(SchemaGrammar srcGrammar, SchemaGrammar dstGrammar) {
- final Vector igs1 = srcGrammar.getImportedGrammars();
- if (igs1 != null) {
- Vector igs2 = dstGrammar.getImportedGrammars();
-
- if (igs2 == null) {
- igs2 = ((Vector) igs1.clone());
- dstGrammar.setImportedGrammars(igs2);
- }
- else {
- updateImportList(igs1, igs2);
- }
- }
- }
-
- private void updateImportList(Vector importedSrc, Vector importedDst)
- {
- final int size = importedSrc.size();
-
- for (int i=0; i<size; i++) {
- final SchemaGrammar sg = (SchemaGrammar) importedSrc.elementAt(i);
- if (!containedImportedGrammar(importedDst, sg)) {
- importedDst.add(sg);
- }
- }
- }
-
- private void addNewGrammarComponents(SchemaGrammar srcGrammar, SchemaGrammar dstGrammar) {
- dstGrammar.resetComponents();
- addGlobalElementDecls(srcGrammar, dstGrammar);
- addGlobalAttributeDecls(srcGrammar, dstGrammar);
- addGlobalAttributeGroupDecls(srcGrammar, dstGrammar);
- addGlobalGroupDecls(srcGrammar, dstGrammar);
- addGlobalTypeDecls(srcGrammar, dstGrammar);
- addGlobalNotationDecls(srcGrammar, dstGrammar);
- }
-
- private void addGlobalElementDecls(SchemaGrammar srcGrammar, SchemaGrammar dstGrammar) {
- XSNamedMap components = srcGrammar.getComponents(XSConstants.ELEMENT_DECLARATION);
- int len = components.getLength();
- XSElementDecl srcDecl, dstDecl;
-
- // add global components
- for (int i=0; i<len; i++) {
- srcDecl = (XSElementDecl) components.item(i);
- dstDecl = dstGrammar.getGlobalElementDecl(srcDecl.getName());
- if (dstDecl == null) {
- dstGrammar.addGlobalElementDecl(srcDecl);
- }
- else if (dstDecl != srcDecl){
- // TODO: if not tolerating duplicate, generate an error message
- }
- }
-
- // add any extended (duplicate) global components
- ObjectList componentsExt = srcGrammar.getComponentsExt(XSConstants.ELEMENT_DECLARATION);
- len = componentsExt.getLength();
-
- for (int i=0; i<len; i+= 2) {
- final String key = (String) componentsExt.item(i);
- final int index = key.indexOf(',');
- final String location = key.substring(0, index);
- final String name = key.substring(index + 1, key.length());
-
- srcDecl = (XSElementDecl)componentsExt.item(i+1);
- dstDecl = dstGrammar.getGlobalElementDecl(name, location);
- if ( dstDecl == null) {
- dstGrammar.addGlobalElementDecl(srcDecl, location);
- }
- else if (dstDecl != srcDecl){
- // TODO: if not tolerating duplicate, generate an error message
- }
- }
- }
-
- private void addGlobalAttributeDecls(SchemaGrammar srcGrammar, SchemaGrammar dstGrammar) {
- XSNamedMap components = srcGrammar.getComponents(XSConstants.ATTRIBUTE_DECLARATION);
- int len = components.getLength();
- XSAttributeDecl srcDecl, dstDecl;
-
- // add global components
- for (int i=0; i<len; i++) {
- srcDecl = (XSAttributeDecl) components.item(i);
- dstDecl = dstGrammar.getGlobalAttributeDecl(srcDecl.getName());
- if (dstDecl == null) {
- dstGrammar.addGlobalAttributeDecl(srcDecl);
- }
- else if (dstDecl != srcDecl && !fTolerateDuplicates) {
- reportSharingError(srcDecl.getNamespace(), srcDecl.getName());
- }
- }
-
- // add any extended (duplicate) global components
- ObjectList componentsExt = srcGrammar.getComponentsExt(XSConstants.ATTRIBUTE_DECLARATION);
- len = componentsExt.getLength();
-
- for (int i=0; i<len; i+= 2) {
- final String key = (String) componentsExt.item(i);
- final int index = key.indexOf(',');
- final String location = key.substring(0, index);
- final String name = key.substring(index + 1, key.length());
-
- srcDecl = (XSAttributeDecl)componentsExt.item(i+1);
- dstDecl = dstGrammar.getGlobalAttributeDecl(name, location);
- if (dstDecl == null) {
- dstGrammar.addGlobalAttributeDecl(srcDecl, location);
- }
- // REVISIT - do we report an error?
- else if (dstDecl != srcDecl) {
- }
- }
- }
-
- private void addGlobalAttributeGroupDecls(SchemaGrammar srcGrammar, SchemaGrammar dstGrammar) {
- XSNamedMap components = srcGrammar.getComponents(XSConstants.ATTRIBUTE_GROUP);
- int len = components.getLength();
- XSAttributeGroupDecl srcDecl, dstDecl;
-
- // add global components
- for (int i=0; i<len; i++) {
- srcDecl = (XSAttributeGroupDecl) components.item(i);
- dstDecl = dstGrammar.getGlobalAttributeGroupDecl(srcDecl.getName());
- if (dstDecl == null) {
- dstGrammar.addGlobalAttributeGroupDecl(srcDecl);
- }
- else if (dstDecl != srcDecl && !fTolerateDuplicates) {
- reportSharingError(srcDecl.getNamespace(), srcDecl.getName());
- }
- }
-
- // add any extended (duplicate) global components
- ObjectList componentsExt = srcGrammar.getComponentsExt(XSConstants.ATTRIBUTE_GROUP);
- len = componentsExt.getLength();
-
- for (int i=0; i<len; i+= 2) {
- final String key = (String) componentsExt.item(i);
- final int index = key.indexOf(',');
- final String location = key.substring(0, index);
- final String name = key.substring(index + 1, key.length());
-
- srcDecl = (XSAttributeGroupDecl)componentsExt.item(i+1);
- dstDecl = dstGrammar.getGlobalAttributeGroupDecl(name, location);
- if (dstDecl == null) {
- dstGrammar.addGlobalAttributeGroupDecl(srcDecl, location);
- }
- // REVISIT - do we report an error?
- else if (dstDecl != srcDecl) {
- }
- }
- }
-
- private void addGlobalNotationDecls(SchemaGrammar srcGrammar, SchemaGrammar dstGrammar) {
- XSNamedMap components = srcGrammar.getComponents(XSConstants.NOTATION_DECLARATION);
- int len = components.getLength();
- XSNotationDecl srcDecl, dstDecl;
-
- // add global components
- for (int i=0; i<len; i++) {
- srcDecl = (XSNotationDecl) components.item(i);
- dstDecl = dstGrammar.getGlobalNotationDecl(srcDecl.getName());
- if (dstDecl == null) {
- dstGrammar.addGlobalNotationDecl(srcDecl);
- }
- else if (dstDecl != srcDecl && !fTolerateDuplicates) {
- reportSharingError(srcDecl.getNamespace(), srcDecl.getName());
- }
- }
-
- // add any extended (duplicate) global components
- ObjectList componentsExt = srcGrammar.getComponentsExt(XSConstants.NOTATION_DECLARATION);
- len = componentsExt.getLength();
-
- for (int i=0; i<len; i+= 2) {
- final String key = (String) componentsExt.item(i);
- final int index = key.indexOf(',');
- final String location = key.substring(0, index);
- final String name = key.substring(index + 1, key.length());
-
- srcDecl = (XSNotationDecl)componentsExt.item(i+1);
- dstDecl = dstGrammar.getGlobalNotationDecl(name, location);
- if (dstDecl == null) {
- dstGrammar.addGlobalNotationDecl(srcDecl, location);
- }
- // REVISIT - do we report an error?
- else if (dstDecl != srcDecl) {
- }
- }
- }
-
- private void addGlobalGroupDecls(SchemaGrammar srcGrammar, SchemaGrammar dstGrammar) {
- XSNamedMap components = srcGrammar.getComponents(XSConstants.MODEL_GROUP_DEFINITION);
- int len = components.getLength();
- XSGroupDecl srcDecl, dstDecl;
-
- // add global components
- for (int i=0; i<len; i++) {
- srcDecl = (XSGroupDecl) components.item(i);
- dstDecl = dstGrammar.getGlobalGroupDecl(srcDecl.getName());
- if (dstDecl == null) {
- dstGrammar.addGlobalGroupDecl(srcDecl);
- }
- else if (srcDecl != dstDecl && !fTolerateDuplicates) {
- reportSharingError(srcDecl.getNamespace(), srcDecl.getName());
- }
- }
-
- // add any extended (duplicate) global components
- ObjectList componentsExt = srcGrammar.getComponentsExt(XSConstants.MODEL_GROUP_DEFINITION);
- len = componentsExt.getLength();
-
- for (int i=0; i<len; i+= 2) {
- final String key = (String) componentsExt.item(i);
- final int index = key.indexOf(',');
- final String location = key.substring(0, index);
- final String name = key.substring(index + 1, key.length());
-
- srcDecl = (XSGroupDecl)componentsExt.item(i+1);
- dstDecl = dstGrammar.getGlobalGroupDecl(name, location);
- if (dstDecl == null) {
- dstGrammar.addGlobalGroupDecl(srcDecl, location);
- }
- // REVIST - do we report an error?
- else if (dstDecl != srcDecl) {
- }
- }
- }
-
- private void addGlobalTypeDecls(SchemaGrammar srcGrammar, SchemaGrammar dstGrammar) {
- XSNamedMap components = srcGrammar.getComponents(XSConstants.TYPE_DEFINITION);
- int len = components.getLength();
- XSTypeDefinition srcDecl, dstDecl;
-
- // add global components
- for (int i=0; i<len; i++) {
- srcDecl = (XSTypeDefinition) components.item(i);
- dstDecl = dstGrammar.getGlobalTypeDecl(srcDecl.getName());
- if (dstDecl == null) {
- dstGrammar.addGlobalTypeDecl(srcDecl);
- }
- else if (dstDecl != srcDecl && !fTolerateDuplicates) {
- reportSharingError(srcDecl.getNamespace(), srcDecl.getName());
- }
- }
-
- // add any extended (duplicate) global components
- ObjectList componentsExt = srcGrammar.getComponentsExt(XSConstants.TYPE_DEFINITION);
- len = componentsExt.getLength();
-
- for (int i=0; i<len; i+= 2) {
- final String key = (String) componentsExt.item(i);
- final int index = key.indexOf(',');
- final String location = key.substring(0, index);
- final String name = key.substring(index + 1, key.length());
-
- srcDecl = (XSTypeDefinition)componentsExt.item(i+1);
- dstDecl = dstGrammar.getGlobalTypeDecl(name, location);
- if (dstDecl == null) {
- dstGrammar.addGlobalTypeDecl(srcDecl, location);
- }
- // REVISIT - do we report an error?
- else if (dstDecl != srcDecl) {
- }
- }
- }
-
- private Vector expandComponents(XSObject[] components, Map<String, Vector> dependencies) {
- Vector newComponents = new Vector();
-
- for (int i=0; i<components.length; i++) {
- if (!newComponents.contains(components[i])) {
- newComponents.add(components[i]);
- }
- }
-
- for (int i=0; i<newComponents.size(); i++) {
- final XSObject component = (XSObject) newComponents.elementAt(i);
- expandRelatedComponents(component, newComponents, dependencies);
- }
-
- return newComponents;
- }
-
- private void expandRelatedComponents(XSObject component, Vector componentList, Map<String, Vector> dependencies) {
- short componentType = component.getType();
- switch (componentType) {
- case XSConstants.TYPE_DEFINITION :
- expandRelatedTypeComponents((XSTypeDefinition) component, componentList, component.getNamespace(), dependencies);
- break;
- case XSConstants.ATTRIBUTE_DECLARATION :
- expandRelatedAttributeComponents((XSAttributeDeclaration) component, componentList, component.getNamespace(), dependencies);
- break;
- case XSConstants.ATTRIBUTE_GROUP :
- expandRelatedAttributeGroupComponents((XSAttributeGroupDefinition) component, componentList, component.getNamespace(), dependencies);
- case XSConstants.ELEMENT_DECLARATION :
- expandRelatedElementComponents((XSElementDeclaration) component, componentList, component.getNamespace(), dependencies);
- break;
- case XSConstants.MODEL_GROUP_DEFINITION :
- expandRelatedModelGroupDefinitionComponents((XSModelGroupDefinition) component, componentList, component.getNamespace(), dependencies);
- case XSConstants.ATTRIBUTE_USE :
- //expandRelatedAttributeUseComponents((XSAttributeUse)component, componentList, dependencies);
- case XSConstants.NOTATION_DECLARATION :
- case XSConstants.IDENTITY_CONSTRAINT :
- default :
- break;
- }
- }
-
- private void expandRelatedAttributeComponents(XSAttributeDeclaration decl, Vector componentList, String namespace, Map<String, Vector> dependencies) {
- addRelatedType(decl.getTypeDefinition(), componentList, namespace, dependencies);
-
- /*final XSComplexTypeDefinition enclosingType = decl.getEnclosingCTDefinition();
- if (enclosingType != null) {
- addRelatedType(enclosingType, componentList, namespace, dependencies);
- }*/
- }
-
- private void expandRelatedElementComponents(XSElementDeclaration decl, Vector componentList, String namespace, Map<String, Vector> dependencies) {
- addRelatedType(decl.getTypeDefinition(), componentList, namespace, dependencies);
-
- /*final XSTypeDefinition enclosingType = decl.getEnclosingCTDefinition();
- if (enclosingType != null) {
- addRelatedType(enclosingType, componentList, namespace, dependencies);
- }*/
-
- final XSElementDeclaration subElemDecl = decl.getSubstitutionGroupAffiliation();
- if (subElemDecl != null) {
- addRelatedElement(subElemDecl, componentList, namespace, dependencies);
- }
- }
-
- private void expandRelatedTypeComponents(XSTypeDefinition type, Vector componentList, String namespace, Map<String, Vector> dependencies) {
- if (type instanceof XSComplexTypeDecl) {
- expandRelatedComplexTypeComponents((XSComplexTypeDecl) type, componentList, namespace, dependencies);
- }
- else if (type instanceof XSSimpleTypeDecl) {
- expandRelatedSimpleTypeComponents((XSSimpleTypeDefinition) type, componentList, namespace, dependencies);
- }
- }
-
- private void expandRelatedModelGroupDefinitionComponents(XSModelGroupDefinition modelGroupDef, Vector componentList,
- String namespace, Map<String, Vector> dependencies) {
- expandRelatedModelGroupComponents(modelGroupDef.getModelGroup(), componentList, namespace, dependencies);
- }
-
- private void expandRelatedAttributeGroupComponents(XSAttributeGroupDefinition attrGroup, Vector componentList
- , String namespace, Map<String, Vector> dependencies) {
- expandRelatedAttributeUsesComponents(attrGroup.getAttributeUses(), componentList, namespace, dependencies);
- }
-
- private void expandRelatedComplexTypeComponents(XSComplexTypeDecl type, Vector componentList, String namespace, Map<String, Vector> dependencies) {
- addRelatedType(type.getBaseType(), componentList, namespace, dependencies);
- expandRelatedAttributeUsesComponents(type.getAttributeUses(), componentList, namespace, dependencies);
- final XSParticle particle = type.getParticle();
- if (particle != null) {
- expandRelatedParticleComponents(particle, componentList, namespace, dependencies);
- }
- }
-
- private void expandRelatedSimpleTypeComponents(XSSimpleTypeDefinition type, Vector componentList, String namespace, Map<String, Vector> dependencies) {
- final XSTypeDefinition baseType = type.getBaseType();
- if (baseType != null) {
- addRelatedType(baseType, componentList, namespace, dependencies);
- }
-
- final XSTypeDefinition itemType = type.getItemType();
- if (itemType != null) {
- addRelatedType(itemType, componentList, namespace, dependencies);
- }
-
- final XSTypeDefinition primitiveType = type.getPrimitiveType();
- if (primitiveType != null) {
- addRelatedType(primitiveType, componentList, namespace, dependencies);
- }
-
- final XSObjectList memberTypes = type.getMemberTypes();
- if (memberTypes.size() > 0) {
- for (int i=0; i<memberTypes.size(); i++) {
- addRelatedType((XSTypeDefinition)memberTypes.item(i), componentList, namespace, dependencies);
- }
- }
- }
-
- private void expandRelatedAttributeUsesComponents(XSObjectList attrUses, Vector componentList,
- String namespace, Map<String, Vector> dependencies) {
- final int attrUseSize = (attrUses == null) ? 0 : attrUses.size();
- for (int i=0; i<attrUseSize; i++) {
- expandRelatedAttributeUseComponents((XSAttributeUse)attrUses.item(i), componentList, namespace, dependencies);
- }
- }
-
- private void expandRelatedAttributeUseComponents(XSAttributeUse component, Vector componentList,
- String namespace, Map<String, Vector> dependencies) {
- addRelatedAttribute(component.getAttrDeclaration(), componentList, namespace, dependencies);
- }
-
- private void expandRelatedParticleComponents(XSParticle component, Vector componentList,
- String namespace, Map<String, Vector> dependencies) {
- XSTerm term = component.getTerm();
- switch (term.getType()) {
- case XSConstants.ELEMENT_DECLARATION :
- addRelatedElement((XSElementDeclaration) term, componentList, namespace, dependencies);
- break;
- case XSConstants.MODEL_GROUP :
- expandRelatedModelGroupComponents((XSModelGroup) term, componentList, namespace, dependencies);
- break;
- default:
- break;
- }
- }
-
- private void expandRelatedModelGroupComponents(XSModelGroup modelGroup, Vector componentList,
- String namespace, Map<String, Vector> dependencies) {
- XSObjectList particles = modelGroup.getParticles();
- final int length = (particles == null) ? 0 : particles.getLength();
- for (int i=0; i<length; i++) {
- expandRelatedParticleComponents((XSParticle)particles.item(i), componentList, namespace, dependencies);
- }
- }
-
- private void addRelatedType(XSTypeDefinition type, Vector componentList, String namespace, Map<String, Vector> dependencies) {
- if (!type.getAnonymous()) {
- if (!type.getNamespace().equals(SchemaSymbols.URI_SCHEMAFORSCHEMA)) { //REVISIT - do we use == instead
- if (!componentList.contains(type)) {
- final Vector importedNamespaces = findDependentNamespaces(namespace, dependencies);
- addNamespaceDependency(namespace, type.getNamespace(), importedNamespaces);
- componentList.add(type);
- }
- }
- }
- else {
- expandRelatedTypeComponents(type, componentList, namespace, dependencies);
- }
- }
-
- private void addRelatedElement(XSElementDeclaration decl, Vector componentList, String namespace, Map<String, Vector> dependencies) {
- if (decl.getScope() == XSConstants.SCOPE_GLOBAL) {
- if (!componentList.contains(decl)) {
- Vector importedNamespaces = findDependentNamespaces(namespace, dependencies);
- addNamespaceDependency(namespace, decl.getNamespace(), importedNamespaces);
- componentList.add(decl);
- }
- }
- else {
- expandRelatedElementComponents(decl, componentList, namespace, dependencies);
- }
- }
-
- private void addRelatedAttribute(XSAttributeDeclaration decl, Vector componentList, String namespace, Map<String, Vector> dependencies) {
- if (decl.getScope() == XSConstants.SCOPE_GLOBAL) {
- if (!componentList.contains(decl)) {
- Vector importedNamespaces = findDependentNamespaces(namespace, dependencies);
- addNamespaceDependency(namespace, decl.getNamespace(), importedNamespaces);
- componentList.add(decl);
- }
- }
- else {
- expandRelatedAttributeComponents(decl, componentList, namespace, dependencies);
- }
- }
-
- private void addGlobalComponents(Vector components, Map<String, Vector> importDependencies) {
- final XSDDescription desc = new XSDDescription();
- final int size = components.size();
-
- for (int i=0; i<size; i++) {
- addGlobalComponent((XSObject) components.elementAt(i), desc);
- }
- updateImportDependencies(importDependencies);
- }
-
- private void addGlobalComponent(XSObject component, XSDDescription desc) {
- final String namespace = component.getNamespace();
-
- desc.setNamespace(namespace);
- final SchemaGrammar sg = getSchemaGrammar(desc);
-
- short componentType = component.getType();
- final String name = component.getName();
-
- switch (componentType) {
- case XSConstants.TYPE_DEFINITION :
- if (!((XSTypeDefinition) component).getAnonymous()) {
- if (sg.getGlobalTypeDecl(name) == null) {
- sg.addGlobalTypeDecl((XSTypeDefinition) component);
- }
- // store the declaration in the extended map, using an empty location
- if (sg.getGlobalTypeDecl(name, "") == null) {
- sg.addGlobalTypeDecl((XSTypeDefinition) component, "");
- }
- }
- break;
- case XSConstants.ATTRIBUTE_DECLARATION :
- if (((XSAttributeDecl) component).getScope() == XSAttributeDecl.SCOPE_GLOBAL) {
- if (sg.getGlobalAttributeDecl(name) == null) {
- sg.addGlobalAttributeDecl((XSAttributeDecl) component);
- }
- // store the declaration in the extended map, using an empty location
- if (sg.getGlobalAttributeDecl(name, "") == null) {
- sg.addGlobalAttributeDecl((XSAttributeDecl) component, "");
- }
- }
- break;
- case XSConstants.ATTRIBUTE_GROUP :
- if (sg.getGlobalAttributeDecl(name) == null) {
- sg.addGlobalAttributeGroupDecl((XSAttributeGroupDecl) component);
- }
- // store the declaration in the extended map, using an empty location
- if (sg.getGlobalAttributeDecl(name, "") == null) {
- sg.addGlobalAttributeGroupDecl((XSAttributeGroupDecl) component, "");
- }
- break;
- case XSConstants.ELEMENT_DECLARATION :
- if (((XSElementDecl) component).getScope() == XSElementDecl.SCOPE_GLOBAL) {
- sg.addGlobalElementDeclAll((XSElementDecl) component);
-
- if (sg.getGlobalElementDecl(name) == null) {
- sg.addGlobalElementDecl((XSElementDecl) component);
- }
- // store the declaration in the extended map, using an empty location
- if (sg.getGlobalElementDecl(name, "") == null) {
- sg.addGlobalElementDecl((XSElementDecl) component, "");
- }
- }
- break;
- case XSConstants.MODEL_GROUP_DEFINITION :
- if (sg.getGlobalGroupDecl(name) == null) {
- sg.addGlobalGroupDecl((XSGroupDecl) component);
- }
- // store the declaration in the extended map, using an empty location
- if (sg.getGlobalGroupDecl(name, "") == null) {
- sg.addGlobalGroupDecl((XSGroupDecl) component, "");
- }
- break;
- case XSConstants.NOTATION_DECLARATION :
- if (sg.getGlobalNotationDecl(name) == null) {
- sg.addGlobalNotationDecl((XSNotationDecl) component);
- }
- // store the declaration in the extended map, using an empty location
- if (sg.getGlobalNotationDecl(name, "") == null) {
- sg.addGlobalNotationDecl((XSNotationDecl) component, "");
- }
- break;
- case XSConstants.IDENTITY_CONSTRAINT :
- case XSConstants.ATTRIBUTE_USE :
- default :
- break;
- }
- }
-
- private void updateImportDependencies(Map<String, Vector> table) {
- if (table == null) return;
- String namespace;
- Vector importList;
-
- for(Map.Entry<String, Vector> entry : table.entrySet()){
- namespace = entry.getKey();
- importList = entry.getValue();
- if (importList.size() > 0) {
- expandImportList(namespace, importList);
- }
- }
- }
-
- private void expandImportList(String namespace, Vector namespaceList) {
- SchemaGrammar sg = fGrammarBucket.getGrammar(namespace);
- // shouldn't be null
- if (sg != null) {
- Vector isgs = sg.getImportedGrammars();
- if (isgs == null) {
- isgs = new Vector();
- addImportList(sg, isgs, namespaceList);
- sg.setImportedGrammars(isgs);
- }
- else {
- updateImportList(sg, isgs, namespaceList);
- }
- }
- }
-
- private void addImportList(SchemaGrammar sg, Vector importedGrammars, Vector namespaceList) {
- final int size = namespaceList.size();
- SchemaGrammar isg;
-
- for (int i=0; i<size; i++) {
- isg = fGrammarBucket.getGrammar((String)namespaceList.elementAt(i));
- if (isg != null) {
- importedGrammars.add(isg);
- }
- else {
- //REVIST: report an error message
- }
- }
- }
-
- private void updateImportList(SchemaGrammar sg, Vector importedGrammars, Vector namespaceList) {
- final int size = namespaceList.size();
- SchemaGrammar isg;
-
- for (int i=0; i<size; i++) {
- isg = fGrammarBucket.getGrammar((String)namespaceList.elementAt(i));
- if (isg != null) {
- if (!containedImportedGrammar(importedGrammars, isg)) {
- importedGrammars.add(isg);
- }
- }
- else {
- //REVIST: report an error message
- }
- }
- }
-
- private boolean containedImportedGrammar(Vector importedGrammar, SchemaGrammar grammar) {
- final int size = importedGrammar.size();
- SchemaGrammar sg;
-
- for (int i=0; i<size; i++) {
- sg = (SchemaGrammar) importedGrammar.elementAt(i);
- if (null2EmptyString(sg.getTargetNamespace()).equals(null2EmptyString(grammar.getTargetNamespace()))) {
- return true;
- }
- }
- return false;
- }
-
- // NOTE: always assuming that fNamespaceGrowth is enabled
- // otherwise the grammar should have existed
- private SchemaGrammar getSchemaGrammar(XSDDescription desc) {
- SchemaGrammar sg = findGrammar(desc, fNamespaceGrowth);
-
- if (sg == null) {
- sg = new SchemaGrammar(desc.getNamespace(), desc.makeClone(), fSymbolTable);
- fGrammarBucket.putGrammar(sg);
- }
- else if (sg.isImmutable()){
- sg = createGrammarFrom(sg);
- }
-
- return sg;
- }
-
- private Vector findDependentNamespaces(String namespace, Map table) {
- final String ns = null2EmptyString(namespace);
- Vector namespaceList = (Vector) getFromMap(table, ns);
-
- if (namespaceList == null) {
- namespaceList = new Vector();
- table.put(ns, namespaceList);
- }
-
- return namespaceList;
- }
-
- private void addNamespaceDependency(String namespace1, String namespace2, Vector list) {
- final String ns1 = null2EmptyString(namespace1);
- final String ns2 = null2EmptyString(namespace2);
- if (!ns1.equals(ns2)) {
- if (!list.contains(ns2)) {
- list.add(ns2);
- }
- }
- }
-
- private void reportSharingError(String namespace, String name) {
- final String qName = (namespace == null)
- ? "," + name : namespace + "," + name;
-
- reportSchemaError("sch-props-correct.2", new Object [] {qName}, null);
- }
-
- // initialize all the traversers.
- // this should only need to be called once during the construction
- // of this object; it creates the traversers that will be used to
-
- // construct schemaGrammars.
- private void createTraversers() {
- fAttributeChecker = new XSAttributeChecker(this);
- fAttributeGroupTraverser = new XSDAttributeGroupTraverser(this, fAttributeChecker);
- fAttributeTraverser = new XSDAttributeTraverser(this, fAttributeChecker);
- fComplexTypeTraverser = new XSDComplexTypeTraverser(this, fAttributeChecker);
- fElementTraverser = new XSDElementTraverser(this, fAttributeChecker);
- fGroupTraverser = new XSDGroupTraverser(this, fAttributeChecker);
- fKeyrefTraverser = new XSDKeyrefTraverser(this, fAttributeChecker);
- fNotationTraverser = new XSDNotationTraverser(this, fAttributeChecker);
- fSimpleTypeTraverser = new XSDSimpleTypeTraverser(this, fAttributeChecker);
- fUniqueOrKeyTraverser = new XSDUniqueOrKeyTraverser(this, fAttributeChecker);
- fWildCardTraverser = new XSDWildcardTraverser(this, fAttributeChecker);
- } // createTraversers()
-
- // before parsing a schema, need to clear registries associated with
- // parsing schemas
- void prepareForParse() {
- fTraversed.clear();
- fDoc2SystemId.clear();
- fHiddenNodes.clear();
- fLastSchemaWasDuplicate = false;
- }
-
- // before traversing a schema's parse tree, need to reset all traversers and
- // clear all registries
- void prepareForTraverse() {
- if (!registryEmpty) {
- fUnparsedAttributeRegistry.clear();
- fUnparsedAttributeGroupRegistry.clear();
- fUnparsedElementRegistry.clear();
- fUnparsedGroupRegistry.clear();
- fUnparsedIdentityConstraintRegistry.clear();
- fUnparsedNotationRegistry.clear();
- fUnparsedTypeRegistry.clear();
-
- fUnparsedAttributeRegistrySub.clear();
- fUnparsedAttributeGroupRegistrySub.clear();
- fUnparsedElementRegistrySub.clear();
- fUnparsedGroupRegistrySub.clear();
- fUnparsedIdentityConstraintRegistrySub.clear();
- fUnparsedNotationRegistrySub.clear();
- fUnparsedTypeRegistrySub.clear();
- }
-
- for (int i=1; i<= TYPEDECL_TYPE; i++) {
- if (fUnparsedRegistriesExt[i] != null)
- fUnparsedRegistriesExt[i].clear();
- }
-
- fDependencyMap.clear();
- fDoc2XSDocumentMap.clear();
- if (fRedefine2XSDMap != null) fRedefine2XSDMap.clear();
- if (fRedefine2NSSupport != null) fRedefine2NSSupport.clear();
- fAllTNSs.removeAllElements();
- fImportMap.clear();
- fRoot = null;
-
- // clear local element stack
- for (int i = 0; i < fLocalElemStackPos; i++) {
- fParticle[i] = null;
- fLocalElementDecl[i] = null;
- fLocalElementDecl_schema[i] = null;
- fLocalElemNamespaceContext[i] = null;
- }
- fLocalElemStackPos = 0;
-
- // and do same for keyrefs.
- for (int i = 0; i < fKeyrefStackPos; i++) {
- fKeyrefs[i] = null;
- fKeyrefElems[i] = null;
- fKeyrefNamespaceContext[i] = null;
- fKeyrefsMapXSDocumentInfo[i] = null;
- }
- fKeyrefStackPos = 0;
-
- // create traversers if necessary
- if (fAttributeChecker == null) {
- createTraversers();
- }
-
- // reset traversers
- Locale locale = fErrorReporter.getLocale();
- fAttributeChecker.reset(fSymbolTable);
- fAttributeGroupTraverser.reset(fSymbolTable, fValidateAnnotations, locale);
- fAttributeTraverser.reset(fSymbolTable, fValidateAnnotations, locale);
- fComplexTypeTraverser.reset(fSymbolTable, fValidateAnnotations, locale);
- fElementTraverser.reset(fSymbolTable, fValidateAnnotations, locale);
- fGroupTraverser.reset(fSymbolTable, fValidateAnnotations, locale);
- fKeyrefTraverser.reset(fSymbolTable, fValidateAnnotations, locale);
- fNotationTraverser.reset(fSymbolTable, fValidateAnnotations, locale);
- fSimpleTypeTraverser.reset(fSymbolTable, fValidateAnnotations, locale);
- fUniqueOrKeyTraverser.reset(fSymbolTable, fValidateAnnotations, locale);
- fWildCardTraverser.reset(fSymbolTable, fValidateAnnotations, locale);
-
- fRedefinedRestrictedAttributeGroupRegistry.clear();
- fRedefinedRestrictedGroupRegistry.clear();
-
- fGlobalAttrDecls.clear();
- fGlobalAttrGrpDecls.clear();
- fGlobalElemDecls.clear();
- fGlobalGroupDecls.clear();
- fGlobalNotationDecls.clear();
- fGlobalIDConstraintDecls.clear();
- fGlobalTypeDecls.clear();
- }
- public void setDeclPool (XSDeclarationPool declPool){
- fDeclPool = declPool;
- }
- public void setDVFactory(SchemaDVFactory dvFactory){
- fDVFactory = dvFactory;
- }
- public SchemaDVFactory getDVFactory(){
- return fDVFactory;
- }
-
- public void reset(XMLComponentManager componentManager) {
-
- // set symbol table
- fSymbolTable = (SymbolTable) componentManager.getProperty(SYMBOL_TABLE);
-
- // set security manager
- fSecurityManager = (XMLSecurityManager) componentManager.getProperty(SECURITY_MANAGER, null);
-
- //set entity manager
- fEntityManager = (XMLEntityResolver) componentManager.getProperty(ENTITY_MANAGER);
-
- //set entity resolver
- XMLEntityResolver er = (XMLEntityResolver)componentManager.getProperty(ENTITY_RESOLVER);
- if (er != null)
- fSchemaParser.setEntityResolver(er);
-
- // set error reporter
- fErrorReporter = (XMLErrorReporter) componentManager.getProperty(ERROR_REPORTER);
- fErrorHandler = fErrorReporter.getErrorHandler();
- fLocale = fErrorReporter.getLocale();
-
- fValidateAnnotations = componentManager.getFeature(VALIDATE_ANNOTATIONS, false);
- fHonourAllSchemaLocations = componentManager.getFeature(HONOUR_ALL_SCHEMALOCATIONS, false);
- fNamespaceGrowth = componentManager.getFeature(NAMESPACE_GROWTH, false);
- fTolerateDuplicates = componentManager.getFeature(TOLERATE_DUPLICATES, false);
-
- try {
- // Setting a parser property can be much more expensive
- // than checking its value. Don't set the ERROR_HANDLER
- // or LOCALE properties unless they've actually changed.
- if (fErrorHandler != fSchemaParser.getProperty(ERROR_HANDLER)) {
- fSchemaParser.setProperty(ERROR_HANDLER, (fErrorHandler != null) ? fErrorHandler : new DefaultErrorHandler());
- if (fAnnotationValidator != null) {
- fAnnotationValidator.setProperty(ERROR_HANDLER, (fErrorHandler != null) ? fErrorHandler : new DefaultErrorHandler());
- }
- }
- if (fLocale != fSchemaParser.getProperty(LOCALE)) {
- fSchemaParser.setProperty(LOCALE, fLocale);
- if (fAnnotationValidator != null) {
- fAnnotationValidator.setProperty(LOCALE, fLocale);
- }
- }
- }
- catch (XMLConfigurationException e) {}
-
- try {
- fSchemaParser.setFeature(CONTINUE_AFTER_FATAL_ERROR, fErrorReporter.getFeature(CONTINUE_AFTER_FATAL_ERROR));
- } catch (XMLConfigurationException e) {}
-
- try {
- if (componentManager.getFeature(ALLOW_JAVA_ENCODINGS, false)) {
- fSchemaParser.setFeature(ALLOW_JAVA_ENCODINGS, true);
- }
- } catch (XMLConfigurationException e) {}
-
- try {
- if (componentManager.getFeature(STANDARD_URI_CONFORMANT_FEATURE, false)) {
- fSchemaParser.setFeature(STANDARD_URI_CONFORMANT_FEATURE, true);
- }
- } catch (XMLConfigurationException e) {}
-
- try {
- fGrammarPool = (XMLGrammarPool) componentManager.getProperty(XMLGRAMMAR_POOL);
- } catch (XMLConfigurationException e) {
- fGrammarPool = null;
- }
-
- // security features
- try {
- if (componentManager.getFeature(DISALLOW_DOCTYPE, false)) {
- fSchemaParser.setFeature(DISALLOW_DOCTYPE, true);
- }
- } catch (XMLConfigurationException e) {}
-
- try {
- if (fSecurityManager != null) {
- fSchemaParser.setProperty(SECURITY_MANAGER, fSecurityManager);
- }
- } catch (XMLConfigurationException e) {}
-
- fSecurityPropertyMgr = (XMLSecurityPropertyManager) componentManager.getProperty(XML_SECURITY_PROPERTY_MANAGER);
-
- //Passing on the setting to the parser
- fSchemaParser.setProperty(XML_SECURITY_PROPERTY_MANAGER, fSecurityPropertyMgr);
-
- fAccessExternalDTD = fSecurityPropertyMgr.getValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD);
- fAccessExternalSchema = fSecurityPropertyMgr.getValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_SCHEMA);
-
- } // reset(XMLComponentManager)
-
-
- /**
- * Traverse all the deferred local elements. This method should be called
- * by traverseSchemas after we've done with all the global declarations.
- */
- void traverseLocalElements() {
- fElementTraverser.fDeferTraversingLocalElements = false;
-
- for (int i = 0; i < fLocalElemStackPos; i++) {
- Element currElem = fLocalElementDecl[i];
- //XSDocumentInfo currSchema = (XSDocumentInfo)fDoc2XSDocumentMap.get(DOMUtil.getDocument(currElem));
- //XSDocumentInfo currSchema = (XSDocumentInfo)fDoc2XSDocumentMap.get(DOMUtil.getRoot(DOMUtil.getDocument(currElem)));
- XSDocumentInfo currSchema = fLocalElementDecl_schema[i];
- SchemaGrammar currGrammar = fGrammarBucket.getGrammar(currSchema.fTargetNamespace);
- fElementTraverser.traverseLocal (fParticle[i], currElem, currSchema, currGrammar, fAllContext[i], fParent[i], fLocalElemNamespaceContext[i]);
- // If it's an empty particle, remove it from the containing component.
- if (fParticle[i].fType == XSParticleDecl.PARTICLE_EMPTY) {
- XSModelGroupImpl group = null;
- if (fParent[i] instanceof XSComplexTypeDecl) {
- XSParticle p = ((XSComplexTypeDecl)fParent[i]).getParticle();
- if (p != null)
- group = (XSModelGroupImpl)p.getTerm();
- }
- else {
- group = ((XSGroupDecl)fParent[i]).fModelGroup;
- }
- if (group != null)
- removeParticle(group, fParticle[i]);
- }
- }
- }
-
- private boolean removeParticle(XSModelGroupImpl group, XSParticleDecl particle) {
- XSParticleDecl member;
- for (int i = 0; i < group.fParticleCount; i++) {
- member = group.fParticles[i];
- if (member == particle) {
- for (int j = i; j < group.fParticleCount-1; j++)
- group.fParticles[j] = group.fParticles[j+1];
- group.fParticleCount--;
- return true;
- }
- if (member.fType == XSParticleDecl.PARTICLE_MODELGROUP) {
- if (removeParticle((XSModelGroupImpl)member.fValue, particle))
- return true;
- }
- }
- return false;
- }
-
- // the purpose of this method is to keep up-to-date structures
- // we'll need for the feferred traversal of local elements.
- void fillInLocalElemInfo(Element elmDecl,
- XSDocumentInfo schemaDoc,
- int allContextFlags,
- XSObject parent,
- XSParticleDecl particle) {
-
- // if the stack is full, increase the size
- if (fParticle.length == fLocalElemStackPos) {
- // increase size
- XSParticleDecl[] newStackP = new XSParticleDecl[fLocalElemStackPos+INC_STACK_SIZE];
- System.arraycopy(fParticle, 0, newStackP, 0, fLocalElemStackPos);
- fParticle = newStackP;
- Element[] newStackE = new Element[fLocalElemStackPos+INC_STACK_SIZE];
- System.arraycopy(fLocalElementDecl, 0, newStackE, 0, fLocalElemStackPos);
- fLocalElementDecl = newStackE;
- XSDocumentInfo [] newStackE_schema = new XSDocumentInfo[fLocalElemStackPos+INC_STACK_SIZE];
- System.arraycopy(fLocalElementDecl_schema, 0, newStackE_schema, 0, fLocalElemStackPos);
- fLocalElementDecl_schema = newStackE_schema;
- int[] newStackI = new int[fLocalElemStackPos+INC_STACK_SIZE];
- System.arraycopy(fAllContext, 0, newStackI, 0, fLocalElemStackPos);
- fAllContext = newStackI;
- XSObject[] newStackC = new XSObject[fLocalElemStackPos+INC_STACK_SIZE];
- System.arraycopy(fParent, 0, newStackC, 0, fLocalElemStackPos);
- fParent = newStackC;
- String [][] newStackN = new String [fLocalElemStackPos+INC_STACK_SIZE][];
- System.arraycopy(fLocalElemNamespaceContext, 0, newStackN, 0, fLocalElemStackPos);
- fLocalElemNamespaceContext = newStackN;
- }
-
- fParticle[fLocalElemStackPos] = particle;
- fLocalElementDecl[fLocalElemStackPos] = elmDecl;
- fLocalElementDecl_schema[fLocalElemStackPos] = schemaDoc;
- fAllContext[fLocalElemStackPos] = allContextFlags;
- fParent[fLocalElemStackPos] = parent;
- fLocalElemNamespaceContext[fLocalElemStackPos++] = schemaDoc.fNamespaceSupport.getEffectiveLocalContext();
- } // end fillInLocalElemInfo(...)
-
- /** This method makes sure that
- * if this component is being redefined that it lives in the
- * right schema. It then renames the component correctly. If it
- * detects a collision--a duplicate definition--then it complains.
- * Note that redefines must be handled carefully: if there
- * is a collision, it may be because we're redefining something we know about
- * or because we've found the thing we're redefining.
- */
- void checkForDuplicateNames(String qName, int declType,
- Map<String,Element> registry, Map<String,XSDocumentInfo> registry_sub, Element currComp,
- XSDocumentInfo currSchema) {
- Object objElem = null;
- // REVISIT: when we add derivation checking, we'll have to make
- // sure that ID constraint collisions don't necessarily result in error messages.
- if ((objElem = registry.get(qName)) == null) {
- // need to check whether we have a global declaration in the corresponding
- // grammar
- if (fNamespaceGrowth && !fTolerateDuplicates) {
- checkForDuplicateNames(qName, declType, currComp);
- }
- // just add it in!
- registry.put(qName, currComp);
- registry_sub.put(qName, currSchema);
- }
- else {
- Element collidingElem = (Element)objElem;
- XSDocumentInfo collidingElemSchema = (XSDocumentInfo)registry_sub.get(qName);
- if (collidingElem == currComp) return;
- Element elemParent = null;
- XSDocumentInfo redefinedSchema = null;
- // case where we've collided with a redefining element
- // (the parent of the colliding element is a redefine)
- boolean collidedWithRedefine = true;
- if ((DOMUtil.getLocalName((elemParent = DOMUtil.getParent(collidingElem))).equals(SchemaSymbols.ELT_REDEFINE))) {
- redefinedSchema = (fRedefine2XSDMap != null)?(XSDocumentInfo) (fRedefine2XSDMap.get(elemParent)): null;
- // case where we're a redefining element.
- }
- else if ((DOMUtil.getLocalName(DOMUtil.getParent(currComp)).equals(SchemaSymbols.ELT_REDEFINE))) {
- redefinedSchema = collidingElemSchema;
- collidedWithRedefine = false;
- }
- if (redefinedSchema != null) { //redefinition involved somehow
- // If both components belong to the same document then
- // report an error and return.
- if(collidingElemSchema == currSchema){
- reportSchemaError("sch-props-correct.2", new Object[]{qName}, currComp);
- return;
- }
-
- String newName = qName.substring(qName.lastIndexOf(',')+1)+REDEF_IDENTIFIER;
- if (redefinedSchema == currSchema) { // object comp. okay here
- // now have to do some renaming...
- currComp.setAttribute(SchemaSymbols.ATT_NAME, newName);
- if (currSchema.fTargetNamespace == null){
- registry.put(","+newName, currComp);
- registry_sub.put(","+newName, currSchema);
- }
- else{
- registry.put(currSchema.fTargetNamespace+","+newName, currComp);
- registry_sub.put(currSchema.fTargetNamespace+","+newName, currSchema);
- }
- // and take care of nested redefines by calling recursively:
- if (currSchema.fTargetNamespace == null)
- checkForDuplicateNames(","+newName, declType, registry, registry_sub, currComp, currSchema);
- else
- checkForDuplicateNames(currSchema.fTargetNamespace+","+newName, declType, registry, registry_sub, currComp, currSchema);
- }
- else { // we may be redefining the wrong schema
- if (collidedWithRedefine) {
- if (currSchema.fTargetNamespace == null)
- checkForDuplicateNames(","+newName, declType, registry, registry_sub, currComp, currSchema);
- else
- checkForDuplicateNames(currSchema.fTargetNamespace+","+newName, declType, registry, registry_sub, currComp, currSchema);
- }
- else {
- // error that redefined element in wrong schema
- reportSchemaError("sch-props-correct.2", new Object [] {qName}, currComp);
- }
- }
- }
- else {
- // we've just got a flat-out collision (we tolerate duplicate
- // declarations, only if they are defined in different schema
- // documents)
- if (!fTolerateDuplicates) {
- reportSchemaError("sch-props-correct.2", new Object []{qName}, currComp);
- } else if (fUnparsedRegistriesExt[declType] != null) {
- if (fUnparsedRegistriesExt[declType].get(qName) == currSchema) {
- reportSchemaError("sch-props-correct.2", new Object []{qName}, currComp);
- }
- }
- }
- }
-
- // store the lastest current document info
- if (fTolerateDuplicates) {
- if (fUnparsedRegistriesExt[declType] == null)
- fUnparsedRegistriesExt[declType] = new HashMap();
- fUnparsedRegistriesExt[declType].put(qName, currSchema);
- }
-
- } // checkForDuplicateNames(String, Map, Element, XSDocumentInfo):void
-
- void checkForDuplicateNames(String qName, int declType, Element currComp) {
- int namespaceEnd = qName.indexOf(',');
- String namespace = qName.substring(0, namespaceEnd);
- SchemaGrammar grammar = fGrammarBucket.getGrammar(emptyString2Null(namespace));
-
- if (grammar != null) {
- Object obj = getGlobalDeclFromGrammar(grammar, declType, qName.substring(namespaceEnd + 1));
- if (obj != null) {
- reportSchemaError("sch-props-correct.2", new Object []{qName}, currComp);
- }
- }
- }
-
- // the purpose of this method is to take the component of the
- // specified type and rename references to itself so that they
- // refer to the object being redefined. It takes special care of
- // <group>s and <attributeGroup>s to ensure that information
- // relating to implicit restrictions is preserved for those
- // traversers.
- private void renameRedefiningComponents(XSDocumentInfo currSchema,
- Element child, String componentType,
- String oldName, String newName) {
- if (componentType.equals(SchemaSymbols.ELT_SIMPLETYPE)) {
- Element grandKid = DOMUtil.getFirstChildElement(child);
- if (grandKid == null) {
- reportSchemaError("src-redefine.5.a.a", null, child);
- }
- else {
- String grandKidName = DOMUtil.getLocalName(grandKid);
- if (grandKidName.equals(SchemaSymbols.ELT_ANNOTATION)) {
- grandKid = DOMUtil.getNextSiblingElement(grandKid);
- }
- if (grandKid == null) {
- reportSchemaError("src-redefine.5.a.a", null, child);
- }
- else {
- grandKidName = DOMUtil.getLocalName(grandKid);
- if (!grandKidName.equals(SchemaSymbols.ELT_RESTRICTION)) {
- reportSchemaError("src-redefine.5.a.b", new Object[]{grandKidName}, child);
- }
- else {
- Object[] attrs = fAttributeChecker.checkAttributes(grandKid, false, currSchema);
- QName derivedBase = (QName)attrs[XSAttributeChecker.ATTIDX_BASE];
- if (derivedBase == null ||
- derivedBase.uri != currSchema.fTargetNamespace ||
- !derivedBase.localpart.equals(oldName)) {
- reportSchemaError("src-redefine.5.a.c",
- new Object[]{grandKidName,
- (currSchema.fTargetNamespace==null?"":currSchema.fTargetNamespace)
- + "," + oldName},
- child);
- }
- else {
- // now we have to do the renaming...
- if (derivedBase.prefix != null && derivedBase.prefix.length() > 0)
- grandKid.setAttribute( SchemaSymbols.ATT_BASE,
- derivedBase.prefix + ":" + newName );
- else
- grandKid.setAttribute( SchemaSymbols.ATT_BASE, newName );
- // return true;
- }
- fAttributeChecker.returnAttrArray(attrs, currSchema);
- }
- }
- }
- }
- else if (componentType.equals(SchemaSymbols.ELT_COMPLEXTYPE)) {
- Element grandKid = DOMUtil.getFirstChildElement(child);
- if (grandKid == null) {
- reportSchemaError("src-redefine.5.b.a", null, child);
- }
- else {
- if (DOMUtil.getLocalName(grandKid).equals(SchemaSymbols.ELT_ANNOTATION)) {
- grandKid = DOMUtil.getNextSiblingElement(grandKid);
- }
- if (grandKid == null) {
- reportSchemaError("src-redefine.5.b.a", null, child);
- }
- else {
- // have to go one more level down; let another pass worry whether complexType is valid.
- Element greatGrandKid = DOMUtil.getFirstChildElement(grandKid);
- if (greatGrandKid == null) {
- reportSchemaError("src-redefine.5.b.b", null, grandKid);
- }
- else {
- String greatGrandKidName = DOMUtil.getLocalName(greatGrandKid);
- if (greatGrandKidName.equals(SchemaSymbols.ELT_ANNOTATION)) {
- greatGrandKid = DOMUtil.getNextSiblingElement(greatGrandKid);
- }
- if (greatGrandKid == null) {
- reportSchemaError("src-redefine.5.b.b", null, grandKid);
- }
- else {
- greatGrandKidName = DOMUtil.getLocalName(greatGrandKid);
- if (!greatGrandKidName.equals(SchemaSymbols.ELT_RESTRICTION) &&
- !greatGrandKidName.equals(SchemaSymbols.ELT_EXTENSION)) {
- reportSchemaError("src-redefine.5.b.c", new Object[]{greatGrandKidName}, greatGrandKid);
- }
- else {
- Object[] attrs = fAttributeChecker.checkAttributes(greatGrandKid, false, currSchema);
- QName derivedBase = (QName)attrs[XSAttributeChecker.ATTIDX_BASE];
- if (derivedBase == null ||
- derivedBase.uri != currSchema.fTargetNamespace ||
- !derivedBase.localpart.equals(oldName)) {
- reportSchemaError("src-redefine.5.b.d",
- new Object[]{greatGrandKidName,
- (currSchema.fTargetNamespace==null?"":currSchema.fTargetNamespace)
- + "," + oldName},
- greatGrandKid);
- }
- else {
- // now we have to do the renaming...
- if (derivedBase.prefix != null && derivedBase.prefix.length() > 0)
- greatGrandKid.setAttribute( SchemaSymbols.ATT_BASE,
- derivedBase.prefix + ":" + newName );
- else
- greatGrandKid.setAttribute( SchemaSymbols.ATT_BASE,
- newName );
- // return true;
- }
- }
- }
- }
- }
- }
- }
- else if (componentType.equals(SchemaSymbols.ELT_ATTRIBUTEGROUP)) {
- String processedBaseName = (currSchema.fTargetNamespace == null)?
- ","+oldName:currSchema.fTargetNamespace+","+oldName;
- int attGroupRefsCount = changeRedefineGroup(processedBaseName, componentType, newName, child, currSchema);
- if (attGroupRefsCount > 1) {
- reportSchemaError("src-redefine.7.1", new Object []{new Integer(attGroupRefsCount)}, child);
- }
- else if (attGroupRefsCount == 1) {
- // return true;
- }
- else
- if (currSchema.fTargetNamespace == null)
- fRedefinedRestrictedAttributeGroupRegistry.put(processedBaseName, ","+newName);
- else
- fRedefinedRestrictedAttributeGroupRegistry.put(processedBaseName, currSchema.fTargetNamespace+","+newName);
- }
- else if (componentType.equals(SchemaSymbols.ELT_GROUP)) {
- String processedBaseName = (currSchema.fTargetNamespace == null)?
- ","+oldName:currSchema.fTargetNamespace+","+oldName;
- int groupRefsCount = changeRedefineGroup(processedBaseName, componentType, newName, child, currSchema);
- if (groupRefsCount > 1) {
- reportSchemaError("src-redefine.6.1.1", new Object []{new Integer(groupRefsCount)}, child);
- }
- else if (groupRefsCount == 1) {
- // return true;
- }
- else {
- if (currSchema.fTargetNamespace == null)
- fRedefinedRestrictedGroupRegistry.put(processedBaseName, ","+newName);
- else
- fRedefinedRestrictedGroupRegistry.put(processedBaseName, currSchema.fTargetNamespace+","+newName);
- }
- }
- else {
- reportSchemaError("Internal-Error", new Object [] {"could not handle this particular <redefine>; please submit your schemas and instance document in a bug report!"}, child);
- }
- // if we get here then we must have reported an error and failed somewhere...
- // return false;
- } // renameRedefiningComponents(XSDocumentInfo, Element, String, String, String):void
-
- // this method takes a name of the form a:b, determines the URI mapped
- // to by a in the current SchemaNamespaceSupport object, and returns this
- // information in the form (nsURI,b) suitable for lookups in the global
- // decl maps.
- // REVISIT: should have it return QName, instead of String. this would
- // save lots of string concatenation time. we can use
- // QName#equals() to compare two QNames, and use QName directly
- // as a key to the SymbolHash.
- // And when the DV's are ready to return compiled values from
- // validate() method, we should just call QNameDV.validate()
- // in this method.
- private String findQName(String name, XSDocumentInfo schemaDoc) {
- SchemaNamespaceSupport currNSMap = schemaDoc.fNamespaceSupport;
- int colonPtr = name.indexOf(':');
- String prefix = XMLSymbols.EMPTY_STRING;
- if (colonPtr > 0)
- prefix = name.substring(0, colonPtr);
- String uri = currNSMap.getURI(fSymbolTable.addSymbol(prefix));
- String localpart = (colonPtr == 0)?name:name.substring(colonPtr+1);
- if (prefix == XMLSymbols.EMPTY_STRING && uri == null && schemaDoc.fIsChameleonSchema)
- uri = schemaDoc.fTargetNamespace;
- if (uri == null)
- return ","+localpart;
- return uri+","+localpart;
- } // findQName(String, XSDocumentInfo): String
-
- // This function looks among the children of curr for an element of type elementSought.
- // If it finds one, it evaluates whether its ref attribute contains a reference
- // to originalQName. If it does, it returns 1 + the value returned by
- // calls to itself on all other children. In all other cases it returns 0 plus
- // the sum of the values returned by calls to itself on curr's children.
- // It also resets the value of ref so that it will refer to the renamed type from the schema
- // being redefined.
- private int changeRedefineGroup(String originalQName, String elementSought,
- String newName, Element curr, XSDocumentInfo schemaDoc) {
- int result = 0;
- for (Element child = DOMUtil.getFirstChildElement(curr);
- child != null; child = DOMUtil.getNextSiblingElement(child)) {
- String name = DOMUtil.getLocalName(child);
- if (!name.equals(elementSought))
- result += changeRedefineGroup(originalQName, elementSought, newName, child, schemaDoc);
- else {
- String ref = child.getAttribute( SchemaSymbols.ATT_REF );
- if (ref.length() != 0) {
- String processedRef = findQName(ref, schemaDoc);
- if (originalQName.equals(processedRef)) {
- String prefix = XMLSymbols.EMPTY_STRING;
- int colonptr = ref.indexOf(":");
- if (colonptr > 0) {
- prefix = ref.substring(0,colonptr);
- child.setAttribute(SchemaSymbols.ATT_REF, prefix + ":" + newName);
- }
- else
- child.setAttribute(SchemaSymbols.ATT_REF, newName);
- result++;
- if (elementSought.equals(SchemaSymbols.ELT_GROUP)) {
- String minOccurs = child.getAttribute( SchemaSymbols.ATT_MINOCCURS );
- String maxOccurs = child.getAttribute( SchemaSymbols.ATT_MAXOCCURS );
- if (!((maxOccurs.length() == 0 || maxOccurs.equals("1"))
- && (minOccurs.length() == 0 || minOccurs.equals("1")))) {
- reportSchemaError("src-redefine.6.1.2", new Object [] {ref}, child);
- }
- }
- }
- } // if ref was null some other stage of processing will flag the error
- }
- }
- return result;
- } // changeRedefineGroup
-
- // this method returns the XSDocumentInfo object that contains the
- // component corresponding to decl. If components from this
- // document cannot be referred to from those of currSchema, this
- // method returns null; it's up to the caller to throw an error.
- // @param: currSchema: the XSDocumentInfo object containing the
- // decl ref'ing us.
- // @param: decl: the declaration being ref'd.
- // this method is superficial now. ---Jack
- private XSDocumentInfo findXSDocumentForDecl(XSDocumentInfo currSchema,
- Element decl, XSDocumentInfo decl_Doc) {
-
- if (DEBUG_NODE_POOL) {
- System.out.println("DOCUMENT NS:"+ currSchema.fTargetNamespace+" hashcode:"+ ((Object)currSchema.fSchemaElement).hashCode());
- }
- Object temp = decl_Doc;
- if (temp == null) {
- // something went badly wrong; we don't know this doc?
- return null;
- }
- XSDocumentInfo declDocInfo = (XSDocumentInfo)temp;
- return declDocInfo;
- /*********
- Logic here is unnecessary after schema WG's recent decision to allow
- schema components from one document to refer to components of any other,
- so long as there's some include/import/redefine path amongst them.
- If they rver reverse this decision the code's right here though... - neilg
- // now look in fDependencyMap to see if this is reachable
- if((fDependencyMap.get(currSchema)).contains(declDocInfo)) {
- return declDocInfo;
- }
- // obviously the requesting doc didn't include, redefine or
- // import the one containing decl...
- return null;
- **********/
- } // findXSDocumentForDecl(XSDocumentInfo, Element): XSDocumentInfo
-
- // returns whether more than <annotation>s occur in children of elem
- private boolean nonAnnotationContent(Element elem) {
- for(Element child = DOMUtil.getFirstChildElement(elem); child != null; child = DOMUtil.getNextSiblingElement(child)) {
- if(!(DOMUtil.getLocalName(child).equals(SchemaSymbols.ELT_ANNOTATION))) return true;
- }
- return false;
- } // nonAnnotationContent(Element): boolean
-
- private void setSchemasVisible(XSDocumentInfo startSchema) {
- if (DOMUtil.isHidden(startSchema.fSchemaElement, fHiddenNodes)) {
- // make it visible
- DOMUtil.setVisible(startSchema.fSchemaElement, fHiddenNodes);
- Vector<XSDocumentInfo> dependingSchemas = fDependencyMap.get(startSchema);
- for (int i = 0; i < dependingSchemas.size(); i++) {
- setSchemasVisible(dependingSchemas.elementAt(i));
- }
- }
- // if it's visible already than so must be its children
- } // setSchemasVisible(XSDocumentInfo): void
-
- private SimpleLocator xl = new SimpleLocator();
-
- /**
- * Extract location information from an Element node, and create a
- * new SimpleLocator object from such information. Returning null means
- * no information can be retrieved from the element.
- */
- public SimpleLocator element2Locator(Element e) {
- if (!( e instanceof ElementImpl))
- return null;
-
- SimpleLocator l = new SimpleLocator();
- return element2Locator(e, l) ? l : null;
- }
-
- /**
- * Extract location information from an Element node, store such
- * information in the passed-in SimpleLocator object, then return
- * true. Returning false means can't extract or store such information.
- */
- public boolean element2Locator(Element e, SimpleLocator l) {
- if (l == null)
- return false;
- if (e instanceof ElementImpl) {
- ElementImpl ele = (ElementImpl)e;
- // get system id from document object
- Document doc = ele.getOwnerDocument();
- String sid = fDoc2SystemId.get(DOMUtil.getRoot(doc));
- // line/column numbers are stored in the element node
- int line = ele.getLineNumber();
- int column = ele.getColumnNumber();
- l.setValues(sid, sid, line, column, ele.getCharacterOffset());
- return true;
- }
- return false;
- }
-
- private Element getElementFromMap(Map<String, Element> registry, String declKey) {
- if (registry == null) return null;
- return registry.get(declKey);
- }
-
- private XSDocumentInfo getDocInfoFromMap(Map<String, XSDocumentInfo> registry, String declKey) {
- if (registry == null) return null;
- return registry.get(declKey);
- }
-
- private Object getFromMap(Map registry, String key) {
- if (registry == null) return null;
- return registry.get(key);
- }
-
- void reportSchemaFatalError(String key, Object[] args, Element ele) {
- reportSchemaErr(key, args, ele, XMLErrorReporter.SEVERITY_FATAL_ERROR, null);
- }
-
- void reportSchemaError(String key, Object[] args, Element ele) {
- reportSchemaErr(key, args, ele, XMLErrorReporter.SEVERITY_ERROR, null);
- }
-
- void reportSchemaError(String key, Object[] args, Element ele, Exception exception) {
- reportSchemaErr(key, args, ele, XMLErrorReporter.SEVERITY_ERROR, exception);
- }
-
- void reportSchemaWarning(String key, Object[] args, Element ele) {
- reportSchemaErr(key, args, ele, XMLErrorReporter.SEVERITY_WARNING, null);
- }
-
- void reportSchemaWarning(String key, Object[] args, Element ele, Exception exception) {
- reportSchemaErr(key, args, ele, XMLErrorReporter.SEVERITY_WARNING, exception);
- }
-
- void reportSchemaErr(String key, Object[] args, Element ele, short type, Exception exception) {
- if (element2Locator(ele, xl)) {
- fErrorReporter.reportError(xl, XSMessageFormatter.SCHEMA_DOMAIN,
- key, args, type, exception);
- }
- else {
- fErrorReporter.reportError(XSMessageFormatter.SCHEMA_DOMAIN,
- key, args, type, exception);
- }
- }
-
- /**
- * Grammar pool used for validating annotations. This will return all of the
- * grammars from the grammar bucket. It will also return an object for the
- * schema for schemas which will contain at least the relevant declarations
- * for annotations.
- */
- private static class XSAnnotationGrammarPool implements XMLGrammarPool {
-
- private XSGrammarBucket fGrammarBucket;
- private Grammar [] fInitialGrammarSet;
-
- public Grammar[] retrieveInitialGrammarSet(String grammarType) {
- if (grammarType == XMLGrammarDescription.XML_SCHEMA) {
- if (fInitialGrammarSet == null) {
- if (fGrammarBucket == null) {
- fInitialGrammarSet = new Grammar [] {SchemaGrammar.Schema4Annotations.INSTANCE};
- }
- else {
- SchemaGrammar [] schemaGrammars = fGrammarBucket.getGrammars();
- /**
- * If the grammar bucket already contains the schema for schemas
- * then we already have the definitions for the parts relevant
- * to annotations.
- */
- for (int i = 0; i < schemaGrammars.length; ++i) {
- if (SchemaSymbols.URI_SCHEMAFORSCHEMA.equals(schemaGrammars[i].getTargetNamespace())) {
- fInitialGrammarSet = schemaGrammars;
- return fInitialGrammarSet;
- }
- }
- Grammar [] grammars = new Grammar[schemaGrammars.length + 1];
- System.arraycopy(schemaGrammars, 0, grammars, 0, schemaGrammars.length);
- grammars[grammars.length - 1] = SchemaGrammar.Schema4Annotations.INSTANCE;
- fInitialGrammarSet = grammars;
- }
- }
- return fInitialGrammarSet;
- }
- return new Grammar[0];
- }
-
- public void cacheGrammars(String grammarType, Grammar[] grammars) {
-
- }
-
- public Grammar retrieveGrammar(XMLGrammarDescription desc) {
- if (desc.getGrammarType() == XMLGrammarDescription.XML_SCHEMA) {
- final String tns = ((XMLSchemaDescription) desc).getTargetNamespace();
- if (fGrammarBucket != null) {
- Grammar grammar = fGrammarBucket.getGrammar(tns);
- if (grammar != null) {
- return grammar;
- }
- }
- if (SchemaSymbols.URI_SCHEMAFORSCHEMA.equals(tns)) {
- return SchemaGrammar.Schema4Annotations.INSTANCE;
- }
- }
- return null;
- }
-
- public void refreshGrammars(XSGrammarBucket gBucket) {
- fGrammarBucket = gBucket;
- fInitialGrammarSet = null;
- }
-
- public void lockPool() {}
-
- public void unlockPool() {}
-
- public void clear() {}
- }
-
- /**
- * used to identify a reference to a schema document
- * if the same document is referenced twice with the same key, then
- * we only need to parse it once.
- *
- * When 2 XSDKey's are compared, the following table can be used to
- * determine whether they are equal:
- * inc red imp pre ins
- * inc N/L ? N/L N/L N/L
- * red ? N/L ? ? ?
- * imp N/L ? N/P N/P N/P
- * pre N/L ? N/P N/P N/P
- * ins N/L ? N/P N/P N/P
- *
- * Where: N/L: duplicate when they have the same namespace and location.
- * ? : not clear from the spec.
- * REVISIT: to simplify the process, also considering
- * it's very rare, we treat them as not duplicate.
- * N/P: not possible. imp/pre/ins are referenced by namespace.
- * when the first time we encounter a schema document for a
- * namespace, we create a grammar and store it in the grammar
- * bucket. when we see another reference to the same namespace,
- * we first check whether a grammar with the same namespace is
- * already in the bucket, which is true in this case, so we
- * won't create another XSDKey.
- *
- * Conclusion from the table: two XSDKey's are duplicate only when all of
- * the following are true:
- * 1. They are both "redefine", or neither is "redefine";
- * 2. They have the same namespace;
- * 3. They have the same non-null location.
- *
- * About 3: if neither has a non-null location, then it's the case where
- * 2 input streams are provided, but no system ID is provided. We can't tell
- * whether the 2 streams have the same content, so we treat them as not
- * duplicate.
- */
- private static class XSDKey {
- String systemId;
- short referType;
- // for inclue/redefine, this is the enclosing namespace
- // for import/preparse/instance, this is the target namespace
- String referNS;
-
- XSDKey(String systemId, short referType, String referNS) {
- this.systemId = systemId;
- this.referType = referType;
- this.referNS = referNS;
- }
-
- public int hashCode() {
- // according to the description at the beginning of this class,
- // we use the hashcode of the namespace as the hashcoe of this key.
- return referNS == null ? 0 : referNS.hashCode();
- }
-
- public boolean equals(Object obj) {
- if (!(obj instanceof XSDKey)) {
- return false;
- }
- XSDKey key = (XSDKey)obj;
-
- // condition 1: both are redefine
- /** if (referType == XSDDescription.CONTEXT_REDEFINE ||
- key.referType == XSDDescription.CONTEXT_REDEFINE) {
- if (referType != key.referType)
- return false;
- }**/
-
- // condition 2: same namespace
- if (referNS != key.referNS)
- return false;
-
- // condition 3: same non-null location
- if (systemId == null || !systemId.equals(key.systemId)) {
- return false;
- }
-
- return true;
- }
- }
-
- private static final class SAX2XNIUtil extends ErrorHandlerWrapper {
- public static XMLParseException createXMLParseException0(SAXParseException exception) {
- return createXMLParseException(exception);
- }
- public static XNIException createXNIException0(SAXException exception) {
- return createXNIException(exception);
- }
- }
-
- /**
- * @param state
- */
- public void setGenerateSyntheticAnnotations(boolean state) {
- fSchemaParser.setFeature(GENERATE_SYNTHETIC_ANNOTATIONS, state);
- }
-
-} // XSDHandler
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDKeyrefTraverser.java b/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDKeyrefTraverser.java
deleted file mode 100644
index 07d160e..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDKeyrefTraverser.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.traversers;
-
-import com.sun.org.apache.xerces.internal.impl.xs.SchemaGrammar;
-import com.sun.org.apache.xerces.internal.impl.xs.SchemaSymbols;
-import com.sun.org.apache.xerces.internal.impl.xs.XSElementDecl;
-import com.sun.org.apache.xerces.internal.impl.xs.identity.IdentityConstraint;
-import com.sun.org.apache.xerces.internal.impl.xs.identity.KeyRef;
-import com.sun.org.apache.xerces.internal.impl.xs.identity.UniqueOrKey;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import org.w3c.dom.Element;
-
-/**
- * This class contains code that is used to traverse <keyref>s.
- *
- * @xerces.internal
- *
- * @author Neil Graham, IBM
- * @version $Id: XSDKeyrefTraverser.java,v 1.7 2010-11-01 04:40:02 joehw Exp $
- */
-class XSDKeyrefTraverser extends XSDAbstractIDConstraintTraverser {
-
- public XSDKeyrefTraverser (XSDHandler handler,
- XSAttributeChecker gAttrCheck) {
- super(handler, gAttrCheck);
- }
-
- void traverse(Element krElem, XSElementDecl element,
- XSDocumentInfo schemaDoc, SchemaGrammar grammar) {
-
- // General Attribute Checking
- Object[] attrValues = fAttrChecker.checkAttributes(krElem, false, schemaDoc);
-
- // create identity constraint
- String krName = (String)attrValues[XSAttributeChecker.ATTIDX_NAME];
- if(krName == null){
- reportSchemaError("s4s-att-must-appear", new Object [] {SchemaSymbols.ELT_KEYREF , SchemaSymbols.ATT_NAME }, krElem);
- //return this array back to pool
- fAttrChecker.returnAttrArray(attrValues, schemaDoc);
- return;
- }
- QName kName = (QName)attrValues[XSAttributeChecker.ATTIDX_REFER];
- if(kName == null){
- reportSchemaError("s4s-att-must-appear", new Object [] {SchemaSymbols.ELT_KEYREF , SchemaSymbols.ATT_REFER }, krElem);
- //return this array back to pool
- fAttrChecker.returnAttrArray(attrValues, schemaDoc);
- return;
- }
-
- UniqueOrKey key = null;
- IdentityConstraint ret = (IdentityConstraint)fSchemaHandler.getGlobalDecl(schemaDoc, XSDHandler.IDENTITYCONSTRAINT_TYPE, kName, krElem);
- // if ret == null, we've already reported an error in getGlobalDecl
- // we report an error only when ret != null, and the return type keyref
- if (ret != null) {
- if (ret.getCategory() == IdentityConstraint.IC_KEY ||
- ret.getCategory() == IdentityConstraint.IC_UNIQUE) {
- key = (UniqueOrKey)ret;
- } else {
- reportSchemaError("src-resolve", new Object[]{kName.rawname, "identity constraint key/unique"}, krElem);
- }
- }
-
- if(key == null) {
- fAttrChecker.returnAttrArray(attrValues, schemaDoc);
- return;
- }
-
- KeyRef keyRef = new KeyRef(schemaDoc.fTargetNamespace, krName, element.fName, key);
-
- // If errors occurred in traversing the identity constraint, then don't
- // add it to the schema, to avoid errors when processing the instance.
- if (traverseIdentityConstraint(keyRef, krElem, schemaDoc, attrValues)) {
- //Schema Component Constraint: Identity-constraint Definition Properties Correct
- //2 If the {identity-constraint category} is keyref, the cardinality of the {fields} must equal that of the {fields} of the {referenced key}.
- if(key.getFieldCount() != keyRef.getFieldCount()) {
- reportSchemaError("c-props-correct.2" , new Object [] {krName,key.getIdentityConstraintName()}, krElem);
- } else {
- // add key reference to element decl
- // and stuff this in the grammar
- if (grammar.getIDConstraintDecl(keyRef.getIdentityConstraintName()) == null) {
- grammar.addIDConstraintDecl(element, keyRef);
- }
-
- // also add it to extended map
- final String loc = fSchemaHandler.schemaDocument2SystemId(schemaDoc);
- final IdentityConstraint idc = grammar.getIDConstraintDecl(keyRef.getIdentityConstraintName(), loc);
- if (idc == null) {
- grammar.addIDConstraintDecl(element, keyRef, loc);
- }
-
- // handle duplicates
- if (fSchemaHandler.fTolerateDuplicates) {
- if (idc != null) {
- if (idc instanceof KeyRef) {
- keyRef = (KeyRef) idc;
- }
- }
- fSchemaHandler.addIDConstraintDecl(keyRef);
- }
- }
- }
-
- // and put back attributes
- fAttrChecker.returnAttrArray(attrValues, schemaDoc);
- } // traverse(Element,int,XSDocumentInfo, SchemaGrammar)
-} // XSDKeyrefTraverser
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDNotationTraverser.java b/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDNotationTraverser.java
deleted file mode 100644
index 846c9b9..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDNotationTraverser.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.traversers;
-
-import com.sun.org.apache.xerces.internal.impl.xs.SchemaGrammar;
-import com.sun.org.apache.xerces.internal.impl.xs.SchemaSymbols;
-import com.sun.org.apache.xerces.internal.impl.xs.XSAnnotationImpl;
-import com.sun.org.apache.xerces.internal.impl.xs.XSNotationDecl;
-import com.sun.org.apache.xerces.internal.impl.xs.util.XSObjectListImpl;
-import com.sun.org.apache.xerces.internal.util.DOMUtil;
-import com.sun.org.apache.xerces.internal.xs.XSObjectList;
-import org.w3c.dom.Element;
-
-/**
- * The notation declaration schema component traverser.
- *
- * <notation
- * id = ID
- * name = NCName
- * public = anyURI
- * system = anyURI
- * {any attributes with non-schema namespace . . .}>
- * Content: (annotation?)
- * </notation>
- *
- * @xerces.internal
- *
- * @author Rahul Srivastava, Sun Microsystems Inc.
- * @author Elena Litani, IBM
- * @version $Id: XSDNotationTraverser.java,v 1.7 2010-11-01 04:40:02 joehw Exp $
- */
-class XSDNotationTraverser extends XSDAbstractTraverser {
-
- XSDNotationTraverser (XSDHandler handler,
- XSAttributeChecker gAttrCheck) {
- super(handler, gAttrCheck);
- }
-
- XSNotationDecl traverse(Element elmNode,
- XSDocumentInfo schemaDoc,
- SchemaGrammar grammar) {
-
- // General Attribute Checking for elmNode
- Object[] attrValues = fAttrChecker.checkAttributes(elmNode, true, schemaDoc);
- //get attributes
- String nameAttr = (String) attrValues[XSAttributeChecker.ATTIDX_NAME];
-
- String publicAttr = (String) attrValues[XSAttributeChecker.ATTIDX_PUBLIC];
- String systemAttr = (String) attrValues[XSAttributeChecker.ATTIDX_SYSTEM];
- if (nameAttr == null) {
- reportSchemaError("s4s-att-must-appear", new Object[]{SchemaSymbols.ELT_NOTATION, SchemaSymbols.ATT_NAME}, elmNode);
- fAttrChecker.returnAttrArray(attrValues, schemaDoc);
- return null;
- }
-
- if (systemAttr == null && publicAttr == null) {
- reportSchemaError("PublicSystemOnNotation", null, elmNode);
- publicAttr = "missing";
- }
-
- XSNotationDecl notation = new XSNotationDecl();
- notation.fName = nameAttr;
- notation.fTargetNamespace = schemaDoc.fTargetNamespace;
- notation.fPublicId = publicAttr;
- notation.fSystemId = systemAttr;
-
- //check content
- Element content = DOMUtil.getFirstChildElement(elmNode);
- XSAnnotationImpl annotation = null;
-
- if (content != null && DOMUtil.getLocalName(content).equals(SchemaSymbols.ELT_ANNOTATION)) {
- annotation = traverseAnnotationDecl(content, attrValues, false, schemaDoc);
- content = DOMUtil.getNextSiblingElement(content);
- }
- else {
- String text = DOMUtil.getSyntheticAnnotation(elmNode);
- if (text != null) {
- annotation = traverseSyntheticAnnotation(elmNode, text, attrValues, false, schemaDoc);
- }
- }
- XSObjectList annotations;
- if (annotation != null) {
- annotations = new XSObjectListImpl();
- ((XSObjectListImpl) annotations).addXSObject(annotation);
- } else {
- annotations = XSObjectListImpl.EMPTY_LIST;
- }
- notation.fAnnotations = annotations;
- if (content!=null){
- Object[] args = new Object [] {SchemaSymbols.ELT_NOTATION, "(annotation?)", DOMUtil.getLocalName(content)};
- reportSchemaError("s4s-elt-must-match.1", args, content);
-
- }
- if (grammar.getGlobalNotationDecl(notation.fName) == null) {
- grammar.addGlobalNotationDecl(notation);
- }
-
- // also add it to extended map
- final String loc = fSchemaHandler.schemaDocument2SystemId(schemaDoc);
- final XSNotationDecl notation2 = grammar.getGlobalNotationDecl(notation.fName, loc);
- if (notation2 == null) {
- grammar.addGlobalNotationDecl(notation, loc);
- }
-
- // handle duplicates
- if (fSchemaHandler.fTolerateDuplicates) {
- if (notation2 != null) {
- notation = notation2;
- }
- fSchemaHandler.addGlobalNotationDecl(notation);
- }
- fAttrChecker.returnAttrArray(attrValues, schemaDoc);
-
- return notation;
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDSimpleTypeTraverser.java b/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDSimpleTypeTraverser.java
deleted file mode 100644
index 355881e..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDSimpleTypeTraverser.java
+++ /dev/null
@@ -1,522 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.traversers;
-
-import java.util.ArrayList;
-import java.util.Vector;
-
-import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeFacetException;
-import com.sun.org.apache.xerces.internal.impl.dv.SchemaDVFactory;
-import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType;
-import com.sun.org.apache.xerces.internal.impl.dv.xs.SchemaDVFactoryImpl;
-import com.sun.org.apache.xerces.internal.impl.dv.xs.XSSimpleTypeDecl;
-import com.sun.org.apache.xerces.internal.impl.xs.SchemaGrammar;
-import com.sun.org.apache.xerces.internal.impl.xs.SchemaSymbols;
-import com.sun.org.apache.xerces.internal.impl.xs.XSAnnotationImpl;
-import com.sun.org.apache.xerces.internal.impl.xs.util.XInt;
-import com.sun.org.apache.xerces.internal.impl.xs.util.XSObjectListImpl;
-import com.sun.org.apache.xerces.internal.util.DOMUtil;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xs.XSConstants;
-import com.sun.org.apache.xerces.internal.xs.XSObjectList;
-import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
-import org.w3c.dom.Element;
-
-/**
- * The simple type definition schema component traverser.
- *
- * <simpleType
- * final = (#all | (list | union | restriction))
- * id = ID
- * name = NCName
- * {any attributes with non-schema namespace . . .}>
- * Content: (annotation?, (restriction | list | union))
- * </simpleType>
- *
- * <restriction
- * base = QName
- * id = ID
- * {any attributes with non-schema namespace . . .}>
- * Content: (annotation?, (simpleType?, (minExclusive | minInclusive | maxExclusive | maxInclusive | totalDigits | fractionDigits | length | minLength | maxLength | enumeration | whiteSpace | pattern)*))
- * </restriction>
- *
- * <list
- * id = ID
- * itemType = QName
- * {any attributes with non-schema namespace . . .}>
- * Content: (annotation?, (simpleType?))
- * </list>
- *
- * <union
- * id = ID
- * memberTypes = List of QName
- * {any attributes with non-schema namespace . . .}>
- * Content: (annotation?, (simpleType*))
- * </union>
- *
- * @xerces.internal
- *
- * @author Elena Litani, IBM
- * @author Neeraj Bajaj, Sun Microsystems, Inc.
- * @author Sandy Gao, IBM
- *
- * @version $Id: XSDSimpleTypeTraverser.java,v 1.7 2010-11-01 04:40:02 joehw Exp $
- */
-class XSDSimpleTypeTraverser extends XSDAbstractTraverser {
-
- // whether the type being parsed is a S4S built-in type.
- private boolean fIsBuiltIn = false;
-
- XSDSimpleTypeTraverser (XSDHandler handler,
- XSAttributeChecker gAttrCheck) {
- super(handler, gAttrCheck);
- }
-
- //return qualified name of simpleType or empty string if error occured
- XSSimpleType traverseGlobal(Element elmNode,
- XSDocumentInfo schemaDoc,
- SchemaGrammar grammar) {
-
- // General Attribute Checking
- Object[] attrValues = fAttrChecker.checkAttributes(elmNode, true, schemaDoc);
- String nameAtt = (String)attrValues[XSAttributeChecker.ATTIDX_NAME];
- if (nameAtt == null) {
- attrValues[XSAttributeChecker.ATTIDX_NAME] = NO_NAME;
- }
- XSSimpleType type = traverseSimpleTypeDecl(elmNode, attrValues, schemaDoc, grammar);
- fAttrChecker.returnAttrArray(attrValues, schemaDoc);
-
- // if it's a global type without a name, return null
- if (nameAtt == null) {
- reportSchemaError("s4s-att-must-appear", new Object[]{SchemaSymbols.ELT_SIMPLETYPE, SchemaSymbols.ATT_NAME}, elmNode);
- type = null;
- }
-
- // don't add global components without name to the grammar
- if (type != null) {
- if (grammar.getGlobalTypeDecl(type.getName()) == null) {
- grammar.addGlobalSimpleTypeDecl(type);
- }
-
- // also add it to extended map
- final String loc = fSchemaHandler.schemaDocument2SystemId(schemaDoc);
- final XSTypeDefinition type2 = grammar.getGlobalTypeDecl(type.getName(), loc);
- if (type2 == null) {
- grammar.addGlobalSimpleTypeDecl(type, loc);
- }
-
- // handle duplicates
- if (fSchemaHandler.fTolerateDuplicates) {
- if (type2 != null) {
- if (type2 instanceof XSSimpleType) {
- type = (XSSimpleType) type2;
- }
- }
- fSchemaHandler.addGlobalTypeDecl(type);
- }
- }
-
- return type;
- }
-
- XSSimpleType traverseLocal(Element elmNode,
- XSDocumentInfo schemaDoc,
- SchemaGrammar grammar) {
-
- // General Attribute Checking
- Object[] attrValues = fAttrChecker.checkAttributes(elmNode, false, schemaDoc);
- String name = genAnonTypeName(elmNode);
- XSSimpleType type = getSimpleType (name, elmNode, attrValues, schemaDoc, grammar);
- if (type instanceof XSSimpleTypeDecl) {
- ((XSSimpleTypeDecl)type).setAnonymous(true);
- }
- fAttrChecker.returnAttrArray(attrValues, schemaDoc);
-
- return type;
- }
-
- private XSSimpleType traverseSimpleTypeDecl(Element simpleTypeDecl,
- Object[] attrValues,
- XSDocumentInfo schemaDoc,
- SchemaGrammar grammar) {
-
- // get name and final values
- String name = (String)attrValues[XSAttributeChecker.ATTIDX_NAME];
- return getSimpleType(name, simpleTypeDecl, attrValues, schemaDoc, grammar);
- }
-
- /*
- * Generate a name for an anonymous type
- */
- private String genAnonTypeName(Element simpleTypeDecl) {
-
- // Generate a unique name for the anonymous type by concatenating together the
- // names of parent nodes
- // The name is quite good for debugging/error purposes, but we may want to
- // revisit how this is done for performance reasons (LM).
- StringBuffer typeName = new StringBuffer("#AnonType_");
- Element node = DOMUtil.getParent(simpleTypeDecl);
- while (node != null && (node != DOMUtil.getRoot(DOMUtil.getDocument(node)))) {
- typeName.append(node.getAttribute(SchemaSymbols.ATT_NAME));
- node = DOMUtil.getParent(node);
- }
- return typeName.toString();
- }
-
- /**
- * @param name
- * @param simpleTypeDecl
- * @param attrValues
- * @param schemaDoc
- * @param grammar
- * @return
- */
- private XSSimpleType getSimpleType(String name, Element simpleTypeDecl, Object[] attrValues, XSDocumentInfo schemaDoc, SchemaGrammar grammar) {
- XInt finalAttr = (XInt)attrValues[XSAttributeChecker.ATTIDX_FINAL];
- int finalProperty = finalAttr == null ? schemaDoc.fFinalDefault : finalAttr.intValue();
- // annotation?,(list|restriction|union)
- Element child = DOMUtil.getFirstChildElement(simpleTypeDecl);
- XSAnnotationImpl [] annotations = null;
- if (child != null && DOMUtil.getLocalName(child).equals(SchemaSymbols.ELT_ANNOTATION)) {
- XSAnnotationImpl annotation = traverseAnnotationDecl(child, attrValues, false, schemaDoc);
- if (annotation != null)
- annotations = new XSAnnotationImpl [] {annotation};
- child = DOMUtil.getNextSiblingElement(child);
- }
- else {
- String text = DOMUtil.getSyntheticAnnotation(simpleTypeDecl);
- if (text != null) {
- XSAnnotationImpl annotation = traverseSyntheticAnnotation(simpleTypeDecl, text, attrValues, false, schemaDoc);
- annotations = new XSAnnotationImpl[] {annotation};
- }
- }
- // (list|restriction|union)
- if (child == null) {
- reportSchemaError("s4s-elt-must-match.2", new Object[]{SchemaSymbols.ELT_SIMPLETYPE, "(annotation?, (restriction | list | union))"}, simpleTypeDecl);
- return errorType(name, schemaDoc.fTargetNamespace, XSConstants.DERIVATION_RESTRICTION);
- }
- // derivation type: restriction/list/union
- String varietyProperty = DOMUtil.getLocalName(child);
- short refType = XSConstants.DERIVATION_RESTRICTION;
- boolean restriction = false, list = false, union = false;
- if (varietyProperty.equals(SchemaSymbols.ELT_RESTRICTION)) {
- refType = XSConstants.DERIVATION_RESTRICTION;
- restriction = true;
- }
- else if (varietyProperty.equals(SchemaSymbols.ELT_LIST)) {
- refType = XSConstants.DERIVATION_LIST;
- list = true;
- }
- else if (varietyProperty.equals(SchemaSymbols.ELT_UNION)) {
- refType = XSConstants.DERIVATION_UNION;
- union = true;
- }
- else {
- reportSchemaError("s4s-elt-must-match.1", new Object[]{SchemaSymbols.ELT_SIMPLETYPE, "(annotation?, (restriction | list | union))", varietyProperty}, simpleTypeDecl);
- return errorType(name, schemaDoc.fTargetNamespace, XSConstants.DERIVATION_RESTRICTION);
- }
- // nothing should follow this element
- Element nextChild = DOMUtil.getNextSiblingElement(child);
- if (nextChild != null) {
- reportSchemaError("s4s-elt-must-match.1", new Object[]{SchemaSymbols.ELT_SIMPLETYPE, "(annotation?, (restriction | list | union))", DOMUtil.getLocalName(nextChild)}, nextChild);
- }
- // General Attribute Checking: get base/item/member types
- Object[] contentAttrs = fAttrChecker.checkAttributes(child, false, schemaDoc);
- QName baseTypeName = (QName)contentAttrs[restriction ?
- XSAttributeChecker.ATTIDX_BASE :
- XSAttributeChecker.ATTIDX_ITEMTYPE];
- Vector memberTypes = (Vector)contentAttrs[XSAttributeChecker.ATTIDX_MEMBERTYPES];
- //content = {annotation?,simpleType?...}
- Element content = DOMUtil.getFirstChildElement(child);
- //check content (annotation?, ...)
- if (content != null && DOMUtil.getLocalName(content).equals(SchemaSymbols.ELT_ANNOTATION)) {
- XSAnnotationImpl annotation = traverseAnnotationDecl(content, contentAttrs, false, schemaDoc);
- if (annotation != null ) {
- if(annotations == null) {
- annotations = new XSAnnotationImpl [] {annotation};
- }
- else {
- XSAnnotationImpl [] tempArray = new XSAnnotationImpl[2];
- tempArray[0] = annotations[0];
- annotations = tempArray;
- annotations[1] = annotation;
- }
- }
- content = DOMUtil.getNextSiblingElement(content);
- }
- else {
- String text = DOMUtil.getSyntheticAnnotation(child);
- if (text != null) {
- XSAnnotationImpl annotation = traverseSyntheticAnnotation(child, text, contentAttrs, false, schemaDoc);
- if (annotations == null) {
- annotations = new XSAnnotationImpl [] {annotation};
- }
- else {
- XSAnnotationImpl [] tempArray = new XSAnnotationImpl[2];
- tempArray[0] = annotations[0];
- annotations = tempArray;
- annotations[1] = annotation;
- }
- }
- }
- // get base type from "base" attribute
- XSSimpleType baseValidator = null;
- if ((restriction || list) && baseTypeName != null) {
- baseValidator = findDTValidator(child, name, baseTypeName, refType, schemaDoc);
- // if its the built-in type, return null from here
- if (baseValidator == null && fIsBuiltIn) {
- fIsBuiltIn = false;
- return null;
- }
- }
- // get types from "memberTypes" attribute
- ArrayList dTValidators = null;
- XSSimpleType dv = null;
- XSObjectList dvs;
- if (union && memberTypes != null && memberTypes.size() > 0) {
- int size = memberTypes.size();
- dTValidators = new ArrayList(size);
- // for each qname in the list
- for (int i = 0; i < size; i++) {
- // get the type decl
- dv = findDTValidator(child, name, (QName)memberTypes.elementAt(i),
- XSConstants.DERIVATION_UNION, schemaDoc);
- if (dv != null) {
- // if it's a union, expand it
- if (dv.getVariety() == XSSimpleType.VARIETY_UNION) {
- dvs = dv.getMemberTypes();
- for (int j = 0; j < dvs.getLength(); j++)
- dTValidators.add(dvs.item(j));
- } else {
- dTValidators.add(dv);
- }
- }
- }
- }
-
- // check if there is a child "simpleType"
- if (content != null && DOMUtil.getLocalName(content).equals(SchemaSymbols.ELT_SIMPLETYPE)) {
- if (restriction || list) {
- // it's an error for both "base" and "simpleType" to appear
- if (baseTypeName != null) {
- reportSchemaError(list ? "src-simple-type.3.a" : "src-simple-type.2.a", null, content);
- }
- if (baseValidator == null) {
- // traverse this child to get the base type
- baseValidator = traverseLocal(content, schemaDoc, grammar);
- }
- // get the next element
- content = DOMUtil.getNextSiblingElement(content);
- }
- else if (union) {
- if (dTValidators == null) {
- dTValidators = new ArrayList(2);
- }
- do {
- // traverse this child to get the member type
- dv = traverseLocal(content, schemaDoc, grammar);
- if (dv != null) {
- // if it's a union, expand it
- if (dv.getVariety() == XSSimpleType.VARIETY_UNION) {
- dvs = dv.getMemberTypes();
- for (int j = 0; j < dvs.getLength(); j++) {
- dTValidators.add(dvs.item(j));
- }
- }
- else {
- dTValidators.add(dv);
- }
- }
- // get the next element
- content = DOMUtil.getNextSiblingElement(content);
- } while (content != null && DOMUtil.getLocalName(content).equals(SchemaSymbols.ELT_SIMPLETYPE));
- }
- }
- else if ((restriction || list) && baseTypeName == null) {
- // it's an error if neither "base/itemType" nor "simpleType" appears
- reportSchemaError(list ? "src-simple-type.3.b" : "src-simple-type.2.b", null, child);
- }
- else if (union && (memberTypes == null || memberTypes.size() == 0)) {
- // it's an error if "memberTypes" is empty and no "simpleType" appears
- reportSchemaError("src-union-memberTypes-or-simpleTypes", null, child);
- }
- // error finding "base" or error traversing "simpleType".
- // don't need to report an error, since some error has been reported.
- if ((restriction || list) && baseValidator == null) {
- fAttrChecker.returnAttrArray(contentAttrs, schemaDoc);
- return errorType(name, schemaDoc.fTargetNamespace,
- restriction ? XSConstants.DERIVATION_RESTRICTION : XSConstants.DERIVATION_LIST);
- }
- // error finding "memberTypes" or error traversing "simpleType".
- // don't need to report an error, since some error has been reported.
- if (union && (dTValidators == null || dTValidators.size() == 0)) {
- fAttrChecker.returnAttrArray(contentAttrs, schemaDoc);
- return errorType(name, schemaDoc.fTargetNamespace,
- XSConstants.DERIVATION_UNION);
- }
- // item type of list types can't have list content
- if (list && isListDatatype(baseValidator)) {
- reportSchemaError("cos-st-restricts.2.1", new Object[]{name, baseValidator.getName()}, child);
- fAttrChecker.returnAttrArray(contentAttrs, schemaDoc);
- return errorType(name, schemaDoc.fTargetNamespace,
- XSConstants.DERIVATION_LIST);
- }
- // create the simple type based on the "base" type
- XSSimpleType newDecl = null;
- if (restriction) {
- newDecl = fSchemaHandler.fDVFactory.createTypeRestriction(name, schemaDoc.fTargetNamespace, (short)finalProperty, baseValidator,
- annotations == null? null : new XSObjectListImpl(annotations, annotations.length));
- }
- else if (list) {
- newDecl = fSchemaHandler.fDVFactory.createTypeList(name, schemaDoc.fTargetNamespace, (short)finalProperty, baseValidator,
- annotations == null? null : new XSObjectListImpl(annotations, annotations.length));
- }
- else if (union) {
- XSSimpleType[] memberDecls = (XSSimpleType[]) dTValidators.toArray(new XSSimpleType[dTValidators.size()]);
- newDecl = fSchemaHandler.fDVFactory.createTypeUnion(name, schemaDoc.fTargetNamespace, (short)finalProperty, memberDecls,
- annotations == null? null : new XSObjectListImpl(annotations, annotations.length));
- }
- // now traverse facets, if it's derived by restriction
- if (restriction && content != null) {
- FacetInfo fi = traverseFacets(content, baseValidator, schemaDoc);
- content = fi.nodeAfterFacets;
-
- try {
- fValidationState.setNamespaceSupport(schemaDoc.fNamespaceSupport);
- newDecl.applyFacets(fi.facetdata, fi.fPresentFacets, fi.fFixedFacets, fValidationState);
- } catch (InvalidDatatypeFacetException ex) {
- reportSchemaError(ex.getKey(), ex.getArgs(), child);
- // Recreate the type, ignoring the facets
- newDecl = fSchemaHandler.fDVFactory.createTypeRestriction(name, schemaDoc.fTargetNamespace, (short)finalProperty, baseValidator,
- annotations == null? null : new XSObjectListImpl(annotations, annotations.length));
- }
- }
- // no element should appear after this point
- if (content != null) {
- if (restriction) {
- reportSchemaError("s4s-elt-must-match.1", new Object[]{SchemaSymbols.ELT_RESTRICTION, "(annotation?, (simpleType?, (minExclusive | minInclusive | maxExclusive | maxInclusive | totalDigits | fractionDigits | length | minLength | maxLength | enumeration | whiteSpace | pattern)*))", DOMUtil.getLocalName(content)}, content);
- }
- else if (list) {
- reportSchemaError("s4s-elt-must-match.1", new Object[]{SchemaSymbols.ELT_LIST, "(annotation?, (simpleType?))", DOMUtil.getLocalName(content)}, content);
- }
- else if (union) {
- reportSchemaError("s4s-elt-must-match.1", new Object[]{SchemaSymbols.ELT_UNION, "(annotation?, (simpleType*))", DOMUtil.getLocalName(content)}, content);
- }
- }
- fAttrChecker.returnAttrArray(contentAttrs, schemaDoc);
- // return the new type
- return newDecl;
- }
-
- //@param: elm - top element
- //@param: baseTypeStr - type (base/itemType/memberTypes)
- //@param: baseRefContext: whether the caller is using this type as a base for restriction, union or list
- //return XSSimpleType available for the baseTypeStr, null if not found or disallowed.
- // also throws an error if the base type won't allow itself to be used in this context.
- // REVISIT: can this code be re-used?
- private XSSimpleType findDTValidator(Element elm, String refName,
- QName baseTypeStr, short baseRefContext,
- XSDocumentInfo schemaDoc) {
- if (baseTypeStr == null)
- return null;
-
- XSTypeDefinition baseType = (XSTypeDefinition)fSchemaHandler.getGlobalDecl(schemaDoc, XSDHandler.TYPEDECL_TYPE, baseTypeStr, elm);
- if (baseType == null) {
- return null;
- }
- if (baseType.getTypeCategory() != XSTypeDefinition.SIMPLE_TYPE) {
- reportSchemaError("cos-st-restricts.1.1", new Object[]{baseTypeStr.rawname, refName}, elm);
- return null;
- }
-
- // if it's a complex type, or if its restriction of anySimpleType
- if (baseType == SchemaGrammar.fAnySimpleType &&
- baseRefContext == XSConstants.DERIVATION_RESTRICTION) {
- // if the base type is anySimpleType and the current type is
- // a S4S built-in type, return null. (not an error).
- if (checkBuiltIn(refName, schemaDoc.fTargetNamespace)) {
- return null;
- }
- reportSchemaError("cos-st-restricts.1.1", new Object[]{baseTypeStr.rawname, refName}, elm);
- return null;
- }
-
- if ((baseType.getFinal() & baseRefContext) != 0) {
- if (baseRefContext == XSConstants.DERIVATION_RESTRICTION) {
- reportSchemaError("st-props-correct.3", new Object[]{refName, baseTypeStr.rawname}, elm);
- }
- else if (baseRefContext == XSConstants.DERIVATION_LIST) {
- reportSchemaError("cos-st-restricts.2.3.1.1", new Object[]{baseTypeStr.rawname, refName}, elm);
- }
- else if (baseRefContext == XSConstants.DERIVATION_UNION) {
- reportSchemaError("cos-st-restricts.3.3.1.1", new Object[]{baseTypeStr.rawname, refName}, elm);
- }
- return null;
- }
-
- return (XSSimpleType)baseType;
- }
-
- // check whethe the type denoted by the name and namespace is a S4S
- // built-in type. update fIsBuiltIn at the same time.
- private final boolean checkBuiltIn(String name, String namespace) {
- if (namespace != SchemaSymbols.URI_SCHEMAFORSCHEMA)
- return false;
- if (SchemaGrammar.SG_SchemaNS.getGlobalTypeDecl(name) != null)
- fIsBuiltIn = true;
- return fIsBuiltIn;
- }
-
- // find if a datatype validator is a list or has list datatype member.
- private boolean isListDatatype(XSSimpleType validator) {
- if (validator.getVariety() == XSSimpleType.VARIETY_LIST)
- return true;
-
- if (validator.getVariety() == XSSimpleType.VARIETY_UNION) {
- XSObjectList temp = validator.getMemberTypes();
- for (int i = 0; i < temp.getLength(); i++) {
- if (((XSSimpleType)temp.item(i)).getVariety() == XSSimpleType.VARIETY_LIST) {
- return true;
- }
- }
- }
-
- return false;
- }//isListDatatype(XSSimpleTypeDecl):boolean
-
- private XSSimpleType errorType(String name, String namespace, short refType) {
- XSSimpleType stringType = (XSSimpleType)SchemaGrammar.SG_SchemaNS.getTypeDefinition("string");
- switch (refType) {
- case XSConstants.DERIVATION_RESTRICTION:
- return fSchemaHandler.fDVFactory.createTypeRestriction(name, namespace, (short)0,
- stringType, null);
- case XSConstants.DERIVATION_LIST:
- return fSchemaHandler.fDVFactory.createTypeList(name, namespace, (short)0,
- stringType, null);
- case XSConstants.DERIVATION_UNION:
- return fSchemaHandler.fDVFactory.createTypeUnion(name, namespace, (short)0,
- new XSSimpleType[]{stringType}, null);
- }
-
- return null;
- }
-
-}//class XSDSimpleTypeTraverser
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDUniqueOrKeyTraverser.java b/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDUniqueOrKeyTraverser.java
deleted file mode 100644
index 054dd9d..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDUniqueOrKeyTraverser.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.traversers;
-
-import com.sun.org.apache.xerces.internal.impl.xs.SchemaGrammar;
-import com.sun.org.apache.xerces.internal.impl.xs.SchemaSymbols;
-import com.sun.org.apache.xerces.internal.impl.xs.XSElementDecl;
-import com.sun.org.apache.xerces.internal.impl.xs.identity.IdentityConstraint;
-import com.sun.org.apache.xerces.internal.impl.xs.identity.UniqueOrKey;
-import com.sun.org.apache.xerces.internal.util.DOMUtil;
-import org.w3c.dom.Element;
-
-/**
- * This class contains code that is used to traverse both <key>s and
- * <unique>s.
- *
- * @xerces.internal
- *
- * @author Neil Graham, IBM
- * @version $Id: XSDUniqueOrKeyTraverser.java,v 1.7 2010-11-01 04:40:02 joehw Exp $
- */
-class XSDUniqueOrKeyTraverser extends XSDAbstractIDConstraintTraverser {
-
- public XSDUniqueOrKeyTraverser (XSDHandler handler,
- XSAttributeChecker gAttrCheck) {
- super(handler, gAttrCheck);
- }
-
-
- void traverse(Element uElem, XSElementDecl element,
- XSDocumentInfo schemaDoc, SchemaGrammar grammar) {
-
- // General Attribute Checking
- Object[] attrValues = fAttrChecker.checkAttributes(uElem, false, schemaDoc);
-
- // create identity constraint
- String uName = (String)attrValues[XSAttributeChecker.ATTIDX_NAME];
-
- if(uName == null){
- reportSchemaError("s4s-att-must-appear", new Object [] {DOMUtil.getLocalName(uElem) , SchemaSymbols.ATT_NAME }, uElem);
- //return this array back to pool
- fAttrChecker.returnAttrArray(attrValues, schemaDoc);
- return;
- }
-
- UniqueOrKey uniqueOrKey = null;
- if(DOMUtil.getLocalName(uElem).equals(SchemaSymbols.ELT_UNIQUE)) {
- uniqueOrKey = new UniqueOrKey(schemaDoc.fTargetNamespace, uName, element.fName, IdentityConstraint.IC_UNIQUE);
- } else {
- uniqueOrKey = new UniqueOrKey(schemaDoc.fTargetNamespace, uName, element.fName, IdentityConstraint.IC_KEY);
- }
- // it's XSDElementTraverser's job to ensure that there's no
- // duplication (or if there is that restriction is involved
- // and there's identity).
-
- // If errors occurred in traversing the identity constraint, then don't
- // add it to the schema, to avoid errors when processing the instance.
- if (traverseIdentityConstraint(uniqueOrKey, uElem, schemaDoc, attrValues)) {
- // and stuff this in the grammar
- if (grammar.getIDConstraintDecl(uniqueOrKey.getIdentityConstraintName()) == null) {
- grammar.addIDConstraintDecl(element, uniqueOrKey);
- }
-
- final String loc = fSchemaHandler.schemaDocument2SystemId(schemaDoc);
- final IdentityConstraint idc = grammar.getIDConstraintDecl(uniqueOrKey.getIdentityConstraintName(), loc);
- if (idc == null) {
- grammar.addIDConstraintDecl(element, uniqueOrKey, loc);
- }
-
- // handle duplicates
- if (fSchemaHandler.fTolerateDuplicates) {
- if (idc != null) {
- if (idc instanceof UniqueOrKey) {
- uniqueOrKey = (UniqueOrKey) uniqueOrKey;
- }
- }
- fSchemaHandler.addIDConstraintDecl(uniqueOrKey);
- }
- }
-
- // and fix up attributeChecker
- fAttrChecker.returnAttrArray(attrValues, schemaDoc);
- } // traverse(Element,XSDElementDecl,XSDocumentInfo, SchemaGrammar)
-} // XSDUniqueOrKeyTraverser
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDWildcardTraverser.java b/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDWildcardTraverser.java
deleted file mode 100644
index 60bfb54..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDWildcardTraverser.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.traversers;
-
-import com.sun.org.apache.xerces.internal.impl.xs.SchemaGrammar;
-import com.sun.org.apache.xerces.internal.impl.xs.SchemaSymbols;
-import com.sun.org.apache.xerces.internal.impl.xs.XSAnnotationImpl;
-import com.sun.org.apache.xerces.internal.impl.xs.XSParticleDecl;
-import com.sun.org.apache.xerces.internal.impl.xs.XSWildcardDecl;
-import com.sun.org.apache.xerces.internal.impl.xs.util.XInt;
-import com.sun.org.apache.xerces.internal.impl.xs.util.XSObjectListImpl;
-import com.sun.org.apache.xerces.internal.util.DOMUtil;
-import com.sun.org.apache.xerces.internal.xs.XSObjectList;
-import org.w3c.dom.Element;
-
-/**
- * The wildcard schema component traverser.
- *
- * &lt;any
- * id = ID
- * maxOccurs = (nonNegativeInteger | unbounded) : 1
- * minOccurs = nonNegativeInteger : 1
- * namespace = ((##any | ##other) | List of (anyURI | (##targetNamespace | ##local)) ) : ##any
- * processContents = (lax | skip | strict) : strict
- * {any attributes with non-schema namespace . . .}&gt;
- * Content: (annotation?)
- * &lt;/any&gt;
- *
- * &lt;anyAttribute
- * id = ID
- * namespace = ((##any | ##other) | List of (anyURI | (##targetNamespace | ##local)) ) : ##any
- * processContents = (lax | skip | strict) : strict
- * {any attributes with non-schema namespace . . .}&gt;
- * Content: (annotation?)
- * &lt;/anyAttribute&gt;
- *
- * @xerces.internal
- *
- * @author Rahul Srivastava, Sun Microsystems Inc.
- * @author Sandy Gao, IBM
- *
- * @version $Id: XSDWildcardTraverser.java,v 1.7 2010-11-01 04:40:02 joehw Exp $
- */
-class XSDWildcardTraverser extends XSDAbstractTraverser {
-
- /**
- * constructor
- *
- * @param handler
- * @param errorReporter
- * @param gAttrCheck
- */
- XSDWildcardTraverser (XSDHandler handler,
- XSAttributeChecker gAttrCheck) {
- super(handler, gAttrCheck);
- }
-
-
- /**
- * Traverse &lt;any&gt;
- *
- * @param elmNode
- * @param schemaDoc
- * @param grammar
- * @return the wildcard node index
- */
- XSParticleDecl traverseAny(Element elmNode,
- XSDocumentInfo schemaDoc,
- SchemaGrammar grammar) {
-
- // General Attribute Checking for elmNode
- Object[] attrValues = fAttrChecker.checkAttributes(elmNode, false, schemaDoc);
- XSWildcardDecl wildcard = traverseWildcardDecl(elmNode, attrValues, schemaDoc, grammar);
-
- // for <any>, need to create a new particle to reflect the min/max values
- XSParticleDecl particle = null;
- if (wildcard != null) {
- int min = ((XInt)attrValues[XSAttributeChecker.ATTIDX_MINOCCURS]).intValue();
- int max = ((XInt)attrValues[XSAttributeChecker.ATTIDX_MAXOCCURS]).intValue();
- if (max != 0) {
- if (fSchemaHandler.fDeclPool !=null) {
- particle = fSchemaHandler.fDeclPool.getParticleDecl();
- } else {
- particle = new XSParticleDecl();
- }
- particle.fType = XSParticleDecl.PARTICLE_WILDCARD;
- particle.fValue = wildcard;
- particle.fMinOccurs = min;
- particle.fMaxOccurs = max;
- particle.fAnnotations = wildcard.fAnnotations;
- }
- }
-
- fAttrChecker.returnAttrArray(attrValues, schemaDoc);
-
- return particle;
- }
-
-
- /**
- * Traverse &lt;anyAttribute&gt;
- *
- * @param elmNode
- * @param schemaDoc
- * @param grammar
- * @return the wildcard node index
- */
- XSWildcardDecl traverseAnyAttribute(Element elmNode,
- XSDocumentInfo schemaDoc,
- SchemaGrammar grammar) {
-
- // General Attribute Checking for elmNode
- Object[] attrValues = fAttrChecker.checkAttributes(elmNode, false, schemaDoc);
- XSWildcardDecl wildcard = traverseWildcardDecl(elmNode, attrValues, schemaDoc, grammar);
- fAttrChecker.returnAttrArray(attrValues, schemaDoc);
-
- return wildcard;
- }
-
-
- /**
- *
- * @param elmNode
- * @param attrValues
- * @param schemaDoc
- * @param grammar
- * @return the wildcard node index
- */
- XSWildcardDecl traverseWildcardDecl(Element elmNode,
- Object[] attrValues,
- XSDocumentInfo schemaDoc,
- SchemaGrammar grammar) {
-
- //get all attributes
- XSWildcardDecl wildcard = new XSWildcardDecl();
- // namespace type
- XInt namespaceTypeAttr = (XInt) attrValues[XSAttributeChecker.ATTIDX_NAMESPACE];
- wildcard.fType = namespaceTypeAttr.shortValue();
- // namespace list
- wildcard.fNamespaceList = (String[])attrValues[XSAttributeChecker.ATTIDX_NAMESPACE_LIST];
- // process contents
- XInt processContentsAttr = (XInt) attrValues[XSAttributeChecker.ATTIDX_PROCESSCONTENTS];
- wildcard.fProcessContents = processContentsAttr.shortValue();
-
- //check content
- Element child = DOMUtil.getFirstChildElement(elmNode);
- XSAnnotationImpl annotation = null;
- if (child != null)
- {
- if (DOMUtil.getLocalName(child).equals(SchemaSymbols.ELT_ANNOTATION)) {
- annotation = traverseAnnotationDecl(child, attrValues, false, schemaDoc);
- child = DOMUtil.getNextSiblingElement(child);
- }
- else {
- String text = DOMUtil.getSyntheticAnnotation(elmNode);
- if (text != null) {
- annotation = traverseSyntheticAnnotation(elmNode, text, attrValues, false, schemaDoc);
- }
- }
-
- if (child != null) {
- reportSchemaError("s4s-elt-must-match.1", new Object[]{"wildcard", "(annotation?)", DOMUtil.getLocalName(child)}, elmNode);
- }
- }
- else {
- String text = DOMUtil.getSyntheticAnnotation(elmNode);
- if (text != null) {
- annotation = traverseSyntheticAnnotation(elmNode, text, attrValues, false, schemaDoc);
- }
- }
- XSObjectList annotations;
- if (annotation != null) {
- annotations = new XSObjectListImpl();
- ((XSObjectListImpl) annotations).addXSObject(annotation);
- } else {
- annotations = XSObjectListImpl.EMPTY_LIST;
- }
- wildcard.fAnnotations = annotations;
-
- return wildcard;
-
- } // traverseWildcardDecl
-
-} // XSDWildcardTraverser
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDocumentInfo.java b/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDocumentInfo.java
deleted file mode 100644
index b75639f..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDocumentInfo.java
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.traversers;
-
-import java.util.Stack;
-import java.util.Vector;
-
-import com.sun.org.apache.xerces.internal.impl.validation.ValidationState;
-import com.sun.org.apache.xerces.internal.impl.xs.SchemaNamespaceSupport;
-import com.sun.org.apache.xerces.internal.impl.xs.SchemaSymbols;
-import com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaException;
-import com.sun.org.apache.xerces.internal.impl.xs.util.XInt;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.Attr;
-import org.w3c.dom.NamedNodeMap;
-
-/**
- * Objects of this class hold all information pecular to a
- * particular XML Schema document. This is needed because
- * namespace bindings and other settings on the <schema/> element
- * affect the contents of that schema document alone.
- *
- * @xerces.internal
- *
- * @author Neil Graham, IBM
- * @version $Id: XSDocumentInfo.java,v 1.5 2007/10/15 22:27:48 spericas Exp $
- */
-class XSDocumentInfo {
-
- // Data
- protected SchemaNamespaceSupport fNamespaceSupport;
- protected SchemaNamespaceSupport fNamespaceSupportRoot;
- protected Stack SchemaNamespaceSupportStack = new Stack();
-
- // schema's attributeFormDefault
- protected boolean fAreLocalAttributesQualified;
-
- // elementFormDefault
- protected boolean fAreLocalElementsQualified;
-
- // [block | final]Default
- protected short fBlockDefault;
- protected short fFinalDefault;
-
- // targetNamespace
- String fTargetNamespace;
-
- // represents whether this is a chameleon schema (i.e., whether its TNS is natural or comes from without)
- protected boolean fIsChameleonSchema;
-
- // the root of the schema Document tree itself
- protected Element fSchemaElement;
-
- // all namespaces that this document can refer to
- Vector fImportedNS = new Vector();
-
- protected ValidationState fValidationContext = new ValidationState();
-
- SymbolTable fSymbolTable = null;
-
- // attribute checker to which we'll return the attributes
- // once we've been told that we're done with them
- protected XSAttributeChecker fAttrChecker;
-
- // array of objects on the schema's root element. This is null
- // once returnSchemaAttrs has been called.
- protected Object [] fSchemaAttrs;
-
- // list of annotations contained in the schema document. This is null
- // once removeAnnotations has been called.
- protected XSAnnotationInfo fAnnotations = null;
-
- // note that the caller must ensure to call returnSchemaAttrs()
- // to avoid memory leaks!
- XSDocumentInfo (Element schemaRoot, XSAttributeChecker attrChecker, SymbolTable symbolTable)
- throws XMLSchemaException {
- fSchemaElement = schemaRoot;
- initNamespaceSupport(schemaRoot);
- fIsChameleonSchema = false;
-
- fSymbolTable = symbolTable;
- fAttrChecker = attrChecker;
-
- if (schemaRoot != null) {
- Element root = schemaRoot;
- fSchemaAttrs = attrChecker.checkAttributes(root, true, this);
- // schemaAttrs == null means it's not an <xsd:schema> element
- // throw an exception, but we don't know the document systemId,
- // so we leave that to the caller.
- if (fSchemaAttrs == null) {
- throw new XMLSchemaException(null, null);
- }
- fAreLocalAttributesQualified =
- ((XInt)fSchemaAttrs[XSAttributeChecker.ATTIDX_AFORMDEFAULT]).intValue() == SchemaSymbols.FORM_QUALIFIED;
- fAreLocalElementsQualified =
- ((XInt)fSchemaAttrs[XSAttributeChecker.ATTIDX_EFORMDEFAULT]).intValue() == SchemaSymbols.FORM_QUALIFIED;
- fBlockDefault =
- ((XInt)fSchemaAttrs[XSAttributeChecker.ATTIDX_BLOCKDEFAULT]).shortValue();
- fFinalDefault =
- ((XInt)fSchemaAttrs[XSAttributeChecker.ATTIDX_FINALDEFAULT]).shortValue();
- fTargetNamespace =
- (String)fSchemaAttrs[XSAttributeChecker.ATTIDX_TARGETNAMESPACE];
- if (fTargetNamespace != null)
- fTargetNamespace = symbolTable.addSymbol(fTargetNamespace);
-
- fNamespaceSupportRoot = new SchemaNamespaceSupport(fNamespaceSupport);
-
- //set namespace support
- fValidationContext.setNamespaceSupport(fNamespaceSupport);
- fValidationContext.setSymbolTable(symbolTable);
- // pass null as the schema document, so that the namespace
- // context is not popped.
-
- // don't return the attribute array yet!
- //attrChecker.returnAttrArray(schemaAttrs, null);
- }
- }
-
- /**
- * Initialize namespace support by collecting all of the namespace
- * declarations in the root's ancestors. This is necessary to
- * support schemas fragments, i.e. schemas embedded in other
- * documents. See,
- *
- * https://jaxp.dev.java.net/issues/show_bug.cgi?id=43
- *
- * Requires the DOM to be created with namespace support enabled.
- */
- private void initNamespaceSupport(Element schemaRoot) {
- fNamespaceSupport = new SchemaNamespaceSupport();
- fNamespaceSupport.reset();
-
- Node parent = schemaRoot.getParentNode();
- while (parent != null && parent.getNodeType() == Node.ELEMENT_NODE
- && !parent.getNodeName().equals("DOCUMENT_NODE"))
- {
- Element eparent = (Element) parent;
- NamedNodeMap map = eparent.getAttributes();
- int length = (map != null) ? map.getLength() : 0;
- for (int i = 0; i < length; i++) {
- Attr attr = (Attr) map.item(i);
- String uri = attr.getNamespaceURI();
-
- // Check if attribute is an ns decl -- requires ns support
- if (uri != null && uri.equals("http://www.w3.org/2000/xmlns/")) {
- String prefix = attr.getLocalName().intern();
- if (prefix == "xmlns") prefix = "";
- // Declare prefix if not set -- moving upwards
- if (fNamespaceSupport.getURI(prefix) == null) {
- fNamespaceSupport.declarePrefix(prefix,
- attr.getValue().intern());
- }
- }
- }
- parent = parent.getParentNode();
- }
- }
-
- // backup the current ns support, and use the one passed-in.
- // if no ns support is passed-in, use the one for <schema> element
- void backupNSSupport(SchemaNamespaceSupport nsSupport) {
- SchemaNamespaceSupportStack.push(fNamespaceSupport);
- if (nsSupport == null)
- nsSupport = fNamespaceSupportRoot;
- fNamespaceSupport = new SchemaNamespaceSupport(nsSupport);
-
- fValidationContext.setNamespaceSupport(fNamespaceSupport);
- }
-
- void restoreNSSupport() {
- fNamespaceSupport = (SchemaNamespaceSupport)SchemaNamespaceSupportStack.pop();
- fValidationContext.setNamespaceSupport(fNamespaceSupport);
- }
-
- // some Object methods
- public String toString() {
- return fTargetNamespace == null?"no targetNamspace":"targetNamespace is " + fTargetNamespace;
- }
-
- public void addAllowedNS(String namespace) {
- fImportedNS.addElement(namespace == null ? "" : namespace);
- }
-
- public boolean isAllowedNS(String namespace) {
- return fImportedNS.contains(namespace == null ? "" : namespace);
- }
-
- // store whether we have reported an error about that this document
- // can't access components from the given namespace
- private Vector fReportedTNS = null;
- // check whether we need to report an error against the given uri.
- // if we have reported an error, then we don't need to report again;
- // otherwise we reported the error, and remember this fact.
- final boolean needReportTNSError(String uri) {
- if (fReportedTNS == null)
- fReportedTNS = new Vector();
- else if (fReportedTNS.contains(uri))
- return false;
- fReportedTNS.addElement(uri);
- return true;
- }
-
- // return the attributes on the schema element itself:
- Object [] getSchemaAttrs () {
- return fSchemaAttrs;
- }
-
- // deallocate the storage set aside for the schema element's
- // attributes
- void returnSchemaAttrs () {
- fAttrChecker.returnAttrArray (fSchemaAttrs, null);
- fSchemaAttrs = null;
- }
-
- // adds an annotation to the list of annotations
- void addAnnotation(XSAnnotationInfo info) {
- info.next = fAnnotations;
- fAnnotations = info;
- }
-
- // returns the list of annotations conatined in the
- // schema document or null if the document contained no annotations.
- XSAnnotationInfo getAnnotations() {
- return fAnnotations;
- }
-
- // removes reference to annotation list
- void removeAnnotations() {
- fAnnotations = null;
- }
-
-} // XSDocumentInfo
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/util/LSInputListImpl.java b/src/com/sun/org/apache/xerces/internal/impl/xs/util/LSInputListImpl.java
deleted file mode 100644
index c8a9329..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/util/LSInputListImpl.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.util;
-
-import java.lang.reflect.Array;
-import java.util.AbstractList;
-
-import com.sun.org.apache.xerces.internal.xs.LSInputList;
-import org.w3c.dom.ls.LSInput;
-
-/**
- * Contains a list of LSInputs.
- *
- * @xerces.internal
- *
- * @author Michael Glavassevich, IBM
- *
- * @version $Id: LSInputListImpl.java,v 1.2 2010-10-26 23:01:04 joehw Exp $
- */
-public final class LSInputListImpl extends AbstractList implements LSInputList {
-
- /**
- * An immutable empty list.
- */
- public static final LSInputListImpl EMPTY_LIST = new LSInputListImpl(new LSInput[0], 0);
-
- // The array to hold all data
- private final LSInput[] fArray;
- // Number of elements in this list
- private final int fLength;
-
- /**
- * Construct an LSInputList implementation
- *
- * @param array the data array
- * @param length the number of elements
- */
- public LSInputListImpl(LSInput[] array, int length) {
- fArray = array;
- fLength = length;
- }
-
- /**
- * The number of <code>LSInput</code>s in the list. The range of valid
- * child object indices is 0 to <code>length-1</code> inclusive.
- */
- public int getLength() {
- return fLength;
- }
-
- /**
- * Returns the <code>index</code>th item in the collection or
- * <code>null</code> if <code>index</code> is greater than or equal to
- * the number of objects in the list. The index starts at 0.
- * @param index index into the collection.
- * @return The <code>LSInput</code> at the <code>index</code>th
- * position in the <code>LSInputList</code>, or <code>null</code> if
- * the index specified is not valid.
- */
- public LSInput item(int index) {
- if (index < 0 || index >= fLength) {
- return null;
- }
- return fArray[index];
- }
-
- /*
- * List methods
- */
-
- public Object get(int index) {
- if (index >= 0 && index < fLength) {
- return fArray[index];
- }
- throw new IndexOutOfBoundsException("Index: " + index);
- }
-
- public int size() {
- return getLength();
- }
-
- public Object[] toArray() {
- Object[] a = new Object[fLength];
- toArray0(a);
- return a;
- }
-
- public Object[] toArray(Object[] a) {
- if (a.length < fLength) {
- Class arrayClass = a.getClass();
- Class componentType = arrayClass.getComponentType();
- a = (Object[]) Array.newInstance(componentType, fLength);
- }
- toArray0(a);
- if (a.length > fLength) {
- a[fLength] = null;
- }
- return a;
- }
-
- private void toArray0(Object[] a) {
- if (fLength > 0) {
- System.arraycopy(fArray, 0, a, 0, fLength);
- }
- }
-
-} // LSInputListImpl
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/util/ObjectListImpl.java b/src/com/sun/org/apache/xerces/internal/impl/xs/util/ObjectListImpl.java
deleted file mode 100644
index 9f0a196..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/util/ObjectListImpl.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.util;
-
-import java.lang.reflect.Array;
-import java.util.AbstractList;
-
-import com.sun.org.apache.xerces.internal.xs.datatypes.ObjectList;
-
-/**
- * Contains a list of Objects.
- *
- * @xerces.internal
- *
- * @version $Id: ObjectListImpl.java,v 1.2 2010-10-26 23:01:04 joehw Exp $
- */
-public final class ObjectListImpl extends AbstractList implements ObjectList {
-
- /**
- * An immutable empty list.
- */
- public static final ObjectListImpl EMPTY_LIST = new ObjectListImpl(new Object[0], 0);
-
- // The array to hold all data
- private final Object[] fArray;
-
- // Number of elements in this list
- private final int fLength;
-
- public ObjectListImpl(Object[] array, int length) {
- fArray = array;
- fLength = length;
- }
-
- public int getLength() {
- return fLength;
- }
-
- public boolean contains(Object item) {
- if (item == null) {
- for (int i = 0; i < fLength; i++) {
- if (fArray[i] == null)
- return true;
- }
- }
- else {
- for (int i = 0; i < fLength; i++) {
- if (item.equals(fArray[i]))
- return true;
- }
- }
- return false;
- }
-
- public Object item(int index) {
- if (index < 0 || index >= fLength) {
- return null;
- }
- return fArray[index];
- }
-
- /*
- * List methods
- */
- public Object get(int index) {
- if (index >= 0 && index < fLength) {
- return fArray[index];
- }
- throw new IndexOutOfBoundsException("Index: " + index);
- }
-
- public int size() {
- return getLength();
- }
-
- public Object[] toArray() {
- Object[] a = new Object[fLength];
- toArray0(a);
- return a;
- }
-
- public Object[] toArray(Object[] a) {
- if (a.length < fLength) {
- Class arrayClass = a.getClass();
- Class componentType = arrayClass.getComponentType();
- a = (Object[]) Array.newInstance(componentType, fLength);
- }
- toArray0(a);
- if (a.length > fLength) {
- a[fLength] = null;
- }
- return a;
- }
-
- private void toArray0(Object[] a) {
- if (fLength > 0) {
- System.arraycopy(fArray, 0, a, 0, fLength);
- }
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/util/ShortListImpl.java b/src/com/sun/org/apache/xerces/internal/impl/xs/util/ShortListImpl.java
deleted file mode 100644
index 9a3ba38..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/util/ShortListImpl.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2002,2003-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.util;
-
-import java.util.AbstractList;
-
-import com.sun.org.apache.xerces.internal.xs.ShortList;
-import com.sun.org.apache.xerces.internal.xs.XSException;
-
-/**
- * Containts a list of Object's.
- *
- * @xerces.internal
- *
- * @author Sandy Gao, IBM
- *
- * @version $Id: ShortListImpl.java,v 1.7 2010-11-01 04:40:06 joehw Exp $
- */
-public final class ShortListImpl extends AbstractList implements ShortList {
-
- /**
- * An immutable empty list.
- */
- public static final ShortListImpl EMPTY_LIST = new ShortListImpl(new short[0], 0);
-
- // The array to hold all data
- private final short[] fArray;
- // Number of elements in this list
- private final int fLength;
-
- /**
- * Construct an XSObjectList implementation
- *
- * @param array the data array
- * @param length the number of elements
- */
- public ShortListImpl(short[] array, int length) {
- fArray = array;
- fLength = length;
- }
-
- /**
- * The number of <code>Objects</code> in the list. The range of valid
- * child node indices is 0 to <code>length-1</code> inclusive.
- */
- public int getLength() {
- return fLength;
- }
-
- /**
- * Checks if the <code>unsigned short</code> <code>item</code> is a
- * member of this list.
- * @param item <code>unsigned short</code> whose presence in this list
- * is to be tested.
- * @return True if this list contains the <code>unsigned short</code>
- * <code>item</code>.
- */
- public boolean contains(short item) {
- for (int i = 0; i < fLength; i++) {
- if (fArray[i] == item) {
- return true;
- }
- }
- return false;
- }
-
- public short item(int index) throws XSException {
- if (index < 0 || index >= fLength) {
- throw new XSException(XSException.INDEX_SIZE_ERR, null);
- }
- return fArray[index];
- }
-
- public boolean equals(Object obj) {
- if (obj == null || !(obj instanceof ShortList)) {
- return false;
- }
- ShortList rhs = (ShortList)obj;
-
- if (fLength != rhs.getLength()) {
- return false;
- }
- for (int i = 0;i < fLength; ++i) {
- if (fArray[i] != rhs.item(i)) {
- return false;
- }
- }
- return true;
- }
-
- /*
- * List methods
- */
-
- public Object get(int index) {
- if (index >= 0 && index < fLength) {
- return new Short(fArray[index]);
- }
- throw new IndexOutOfBoundsException("Index: " + index);
- }
-
- public int size() {
- return getLength();
- }
-
-} // class ShortListImpl
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/util/SimpleLocator.java b/src/com/sun/org/apache/xerces/internal/impl/xs/util/SimpleLocator.java
deleted file mode 100644
index a38405e..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/util/SimpleLocator.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2002, 2003,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.util;
-
-import com.sun.org.apache.xerces.internal.xni.XMLLocator;
-
-/**
- * An XMLLocator implementation used for schema error reporting.
- *
- * @xerces.internal
- *
- * @author Sandy Gao, IBM
- */
-public class SimpleLocator implements XMLLocator {
-
- String lsid, esid;
- int line, column;
- int charOffset;
-
- public SimpleLocator() {
- }
-
- public SimpleLocator(String lsid, String esid, int line, int column) {
- this(lsid, esid, line, column, -1);
- }
-
- public void setValues(String lsid, String esid, int line, int column) {
- setValues(lsid, esid, line, column, -1);
- }
-
- public SimpleLocator(String lsid, String esid, int line, int column, int offset) {
- this.line = line;
- this.column = column;
- this.lsid = lsid;
- this.esid = esid;
- charOffset = offset;
- }
-
- public void setValues(String lsid, String esid, int line, int column, int offset) {
- this.line = line;
- this.column = column;
- this.lsid = lsid;
- this.esid = esid;
- charOffset = offset;
- }
-
- public int getLineNumber() {
- return line;
- }
-
- public int getColumnNumber() {
- return column;
- }
-
- public int getCharacterOffset() {
- return charOffset;
- }
-
- public String getPublicId() {
- return null;
- }
-
- public String getExpandedSystemId() {
- return esid;
- }
-
- public String getLiteralSystemId() {
- return lsid;
- }
-
- public String getBaseSystemId() {
- return null;
- }
- /**
- * @see com.sun.org.apache.xerces.internal.xni.XMLLocator#setColumnNumber(int)
- */
- public void setColumnNumber(int col) {
- this.column = col;
- }
-
- /**
- * @see com.sun.org.apache.xerces.internal.xni.XMLLocator#setLineNumber(int)
- */
- public void setLineNumber(int line) {
- this.line = line;
- }
-
- public void setCharacterOffset(int offset) {
- charOffset = offset;
- }
-
- /**
- * @see com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier#setBaseSystemId(String)
- */
- public void setBaseSystemId(String systemId) {}
-
- /**
- * @see com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier#setExpandedSystemId(String)
- */
- public void setExpandedSystemId(String systemId) {
- esid = systemId;
- }
-
- /**
- * @see com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier#setLiteralSystemId(String)
- */
- public void setLiteralSystemId(String systemId) {
- lsid = systemId;
- }
-
- /**
- * @see com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier#setPublicId(String)
- */
- public void setPublicId(String publicId) {}
-
- /** Returns the encoding of the current entity.
- * Since these locators are used in the construction of
- * XMLParseExceptions, which know nothing about encodings, there is
- * no point in having this object deal intelligently
- * with encoding information.
- */
- public String getEncoding() {
- return null;
- }
-
- public String getXMLVersion() {
- return null;
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/util/StringListImpl.java b/src/com/sun/org/apache/xerces/internal/impl/xs/util/StringListImpl.java
deleted file mode 100644
index 5f22628..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/util/StringListImpl.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2002,2003-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.util;
-
-import java.lang.reflect.Array;
-import java.util.AbstractList;
-import java.util.Vector;
-
-import com.sun.org.apache.xerces.internal.xs.StringList;
-
-/**
- * Containts a list of Object's.
- *
- * @xerces.internal
- *
- * @author Sandy Gao, IBM
- *
- * @version $Id: StringListImpl.java,v 1.7 2010-11-01 04:40:06 joehw Exp $
- */
-public final class StringListImpl extends AbstractList implements StringList {
-
- /**
- * An immutable empty list.
- */
- public static final StringListImpl EMPTY_LIST = new StringListImpl(new String[0], 0);
-
- // The array to hold all data
- private final String[] fArray;
- // Number of elements in this list
- private final int fLength;
-
- // REVISIT: this is temp solution. In general we need to use this class
- // instead of the Vector.
- private final Vector fVector;
-
- public StringListImpl(Vector v) {
- fVector = v;
- fLength = (v == null) ? 0 : v.size();
- fArray = null;
- }
-
- /**
- * Construct an XSObjectList implementation
- *
- * @param array the data array
- * @param length the number of elements
- */
- public StringListImpl(String[] array, int length) {
- fArray = array;
- fLength = length;
- fVector = null;
- }
-
- /**
- * The number of <code>Objects</code> in the list. The range of valid
- * child node indices is 0 to <code>length-1</code> inclusive.
- */
- public int getLength() {
- return fLength;
- }
-
- /**
- * Checks if the <code>GenericString</code> <code>item</code> is a member
- * of this list.
- * @param item <code>GenericString</code> whose presence in this list is
- * to be tested.
- * @return True if this list contains the <code>GenericString</code>
- * <code>item</code>.
- */
- public boolean contains(String item) {
- if (fVector != null) {
- return fVector.contains(item);
- }
- if (item == null) {
- for (int i = 0; i < fLength; i++) {
- if (fArray[i] == null)
- return true;
- }
- }
- else {
- for (int i = 0; i < fLength; i++) {
- if (item.equals(fArray[i]))
- return true;
- }
- }
- return false;
- }
-
- public String item(int index) {
- if (index < 0 || index >= fLength) {
- return null;
- }
- if (fVector != null) {
- return (String)fVector.elementAt(index);
- }
- return fArray[index];
- }
-
- /*
- * List methods
- */
-
- public Object get(int index) {
- if (index >= 0 && index < fLength) {
- if (fVector != null) {
- return fVector.elementAt(index);
- }
- return fArray[index];
- }
- throw new IndexOutOfBoundsException("Index: " + index);
- }
-
- public int size() {
- return getLength();
- }
-
- public Object[] toArray() {
- if (fVector != null) {
- return fVector.toArray();
- }
- Object[] a = new Object[fLength];
- toArray0(a);
- return a;
- }
-
- public Object[] toArray(Object[] a) {
- if (fVector != null) {
- return fVector.toArray(a);
- }
- if (a.length < fLength) {
- Class arrayClass = a.getClass();
- Class componentType = arrayClass.getComponentType();
- a = (Object[]) Array.newInstance(componentType, fLength);
- }
- toArray0(a);
- if (a.length > fLength) {
- a[fLength] = null;
- }
- return a;
- }
-
- private void toArray0(Object[] a) {
- if (fLength > 0) {
- System.arraycopy(fArray, 0, a, 0, fLength);
- }
- }
-
-} // class StringListImpl
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/util/XInt.java b/src/com/sun/org/apache/xerces/internal/impl/xs/util/XInt.java
deleted file mode 100644
index 68aa63c..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/util/XInt.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.util;
-
-/**
- * @xerces.internal
- *
- * @author Henry Zongaro, IBM
- */
-
-public final class XInt {
-
- private int fValue;
-
- XInt(int value) {
- fValue = value;
- }
-
- public final int intValue() {
- return fValue;
- }
-
- public final short shortValue() {
- return (short)fValue;
- }
-
- public final boolean equals(XInt compareVal) {
- return (this.fValue == compareVal.fValue);
- }
-
- public String toString() {
- return Integer.toString(fValue);
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/util/XIntPool.java b/src/com/sun/org/apache/xerces/internal/impl/xs/util/XIntPool.java
deleted file mode 100644
index 821f399..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/util/XIntPool.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.util;
-
-/**
- * @xerces.internal
- *
- * @author Henry Zongaro, IBM
- */
-public final class XIntPool {
- private static final short POOL_SIZE = 10;
- private static final XInt[] fXIntPool = new XInt[POOL_SIZE];
-
- static {
- for (int i = 0; i < POOL_SIZE; i++)
- fXIntPool[i] = new XInt(i);
- }
-
- public final XInt getXInt(int value) {
- if (value >= 0 && value < fXIntPool.length)
- return fXIntPool[value];
- else
- return new XInt(value);
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/util/XSGrammarPool.java b/src/com/sun/org/apache/xerces/internal/impl/xs/util/XSGrammarPool.java
deleted file mode 100644
index 3f83e83..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/util/XSGrammarPool.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.util;
-
-import java.util.ArrayList;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.xs.SchemaGrammar;
-import com.sun.org.apache.xerces.internal.impl.xs.XSModelImpl;
-import com.sun.org.apache.xerces.internal.util.XMLGrammarPoolImpl;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription;
-import com.sun.org.apache.xerces.internal.xs.XSModel;
-
-
-/**
- * Add a method that return an <code>XSModel</code> that represents components in
- * the schema grammars in this pool implementation.
- *
- * @xerces.internal
- *
- * @version $Id: XSGrammarPool.java,v 1.7 2010-11-01 04:40:06 joehw Exp $
- */
-public class XSGrammarPool extends XMLGrammarPoolImpl {
-
- /**
- * Return an <code>XSModel</code> that represents components in
- * the schema grammars in this pool implementation.
- *
- * @return an <code>XSModel</code> representing this schema grammar
- */
- public XSModel toXSModel() {
- return toXSModel(Constants.SCHEMA_VERSION_1_0);
- }
-
- public XSModel toXSModel(short schemaVersion) {
- ArrayList list = new ArrayList();
- for (int i = 0; i < fGrammars.length; i++) {
- for (Entry entry = fGrammars[i] ; entry != null ; entry = entry.next) {
- if (entry.desc.getGrammarType().equals(XMLGrammarDescription.XML_SCHEMA)) {
- list.add(entry.grammar);
- }
- }
- }
- int size = list.size();
- if (size == 0) {
- return toXSModel(new SchemaGrammar[0], schemaVersion);
- }
- SchemaGrammar[] gs = (SchemaGrammar[])list.toArray(new SchemaGrammar[size]);
- return toXSModel(gs, schemaVersion);
- }
-
- protected XSModel toXSModel(SchemaGrammar[] grammars, short schemaVersion) {
- return new XSModelImpl(grammars, schemaVersion);
- }
-
-} // class XSGrammarPool
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/util/XSInputSource.java b/src/com/sun/org/apache/xerces/internal/impl/xs/util/XSInputSource.java
deleted file mode 100644
index 4ca114b..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/util/XSInputSource.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.util;
-
-
-import com.sun.org.apache.xerces.internal.impl.xs.SchemaGrammar;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-import com.sun.org.apache.xerces.internal.xs.XSObject;
-
-/**
- * @xerces.internal
- *
- * @version $Id: XSInputSource.java,v 1.2 2010-10-26 23:01:05 joehw Exp $
- */
-public final class XSInputSource extends XMLInputSource {
-
- private SchemaGrammar[] fGrammars;
- private XSObject[] fComponents;
-
- public XSInputSource(SchemaGrammar[] grammars) {
- super(null, null, null);
- fGrammars = grammars;
- fComponents = null;
- }
-
- public XSInputSource(XSObject[] component) {
- super(null, null, null);
- fGrammars = null;
- fComponents = component;
- }
-
- public SchemaGrammar[] getGrammars() {
- return fGrammars;
- }
-
- public void setGrammars(SchemaGrammar[] grammars) {
- fGrammars = grammars;
- }
-
- public XSObject[] getComponents() {
- return fComponents;
- }
-
- public void setComponents(XSObject[] components) {
- fComponents = components;
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/util/XSNamedMap4Types.java b/src/com/sun/org/apache/xerces/internal/impl/xs/util/XSNamedMap4Types.java
deleted file mode 100644
index 63f6f47..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/util/XSNamedMap4Types.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.util;
-
-import com.sun.org.apache.xerces.internal.util.SymbolHash;
-import com.sun.org.apache.xerces.internal.xs.XSObject;
-import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
-
-
-/**
- * Containts the map between qnames and XSObject's.
- *
- * @xerces.internal
- *
- * @author Sandy Gao, IBM
- *
- * @version $Id: XSNamedMap4Types.java,v 1.7 2010-11-01 04:40:06 joehw Exp $
- */
-public final class XSNamedMap4Types extends XSNamedMapImpl {
-
- // the type of component stored here: complex or simple type
- private final short fType;
-
- /**
- * Construct an XSNamedMap implementation for one namespace
- *
- * @param namespace the namespace to which the components belong
- * @param map the map from local names to components
- * @param type the type of components
- */
- public XSNamedMap4Types(String namespace, SymbolHash map, short type) {
- super(namespace, map);
- fType = type;
- }
-
- /**
- * Construct an XSNamedMap implementation for a list of namespaces
- *
- * @param namespaces the namespaces to which the components belong
- * @param maps the maps from local names to components
- * @param num the number of namespaces
- * @param type the type of components
- */
- public XSNamedMap4Types(String[] namespaces, SymbolHash[] maps, int num, short type) {
- super(namespaces, maps, num);
- fType = type;
- }
-
- /**
- * The number of <code>XSObjects</code> in the <code>XSObjectList</code>. The
- * range of valid child node indices is 0 to <code>length-1</code>
- * inclusive.
- */
- public synchronized int getLength() {
- if (fLength == -1) {
- // first get the number of components for all types
- int length = 0;
- for (int i = 0; i < fNSNum; i++) {
- length += fMaps[i].getLength();
- }
- // then copy all types to an temporary array
- int pos = 0;
- XSObject[] array = new XSObject[length];
- for (int i = 0; i < fNSNum; i++) {
- pos += fMaps[i].getValues(array, pos);
- }
- // then copy either simple or complex types to fArray,
- // depending on which kind is required
- fLength = 0;
- fArray = new XSObject[length];
- XSTypeDefinition type;
- for (int i = 0; i < length; i++) {
- type = (XSTypeDefinition)array[i];
- if (type.getTypeCategory() == fType) {
- fArray[fLength++] = type;
- }
- }
- }
- return fLength;
- }
-
- /**
- * Retrieves an <code>XSObject</code> specified by local name and namespace
- * URI.
- * @param namespace The namespace URI of the <code>XSObject</code> to
- * retrieve.
- * @param localName The local name of the <code>XSObject</code> to retrieve.
- * @return A <code>XSObject</code> (of any type) with the specified local
- * name and namespace URI, or <code>null</code> if they do not
- * identify any <code>XSObject</code> in this map.
- */
- public XSObject itemByName(String namespace, String localName) {
- for (int i = 0; i < fNSNum; i++) {
- if (isEqual(namespace, fNamespaces[i])) {
- XSTypeDefinition type = (XSTypeDefinition)fMaps[i].get(localName);
- // only return it if it matches the required type
- if (type != null && type.getTypeCategory() == fType) {
- return type;
- }
- return null;
- }
- }
- return null;
- }
-
- /**
- * Returns the <code>index</code>th item in the map. The index starts at
- * 0. If <code>index</code> is greater than or equal to the number of
- * nodes in the list, this returns <code>null</code>.
- * @param index The position in the map from which the item is to be
- * retrieved.
- * @return The <code>XSObject</code> at the <code>index</code>th position
- * in the <code>XSNamedMap</code>, or <code>null</code> if that is
- * not a valid index.
- */
- public synchronized XSObject item(int index) {
- if (fArray == null) {
- getLength();
- }
- if (index < 0 || index >= fLength) {
- return null;
- }
- return fArray[index];
- }
-
-} // class XSNamedMapImpl
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/util/XSNamedMapImpl.java b/src/com/sun/org/apache/xerces/internal/impl/xs/util/XSNamedMapImpl.java
deleted file mode 100644
index 1740656..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/util/XSNamedMapImpl.java
+++ /dev/null
@@ -1,302 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.util;
-
-import java.util.AbstractMap;
-import java.util.AbstractSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.NoSuchElementException;
-import java.util.Set;
-
-import javax.xml.XMLConstants;
-import javax.xml.namespace.QName;
-
-import com.sun.org.apache.xerces.internal.util.SymbolHash;
-import com.sun.org.apache.xerces.internal.xs.XSNamedMap;
-import com.sun.org.apache.xerces.internal.xs.XSObject;
-
-/**
- * Containts the map between qnames and XSObject's.
- *
- * @xerces.internal
- *
- * @author Sandy Gao, IBM
- *
- * @version $Id: XSNamedMapImpl.java,v 1.7 2010-11-01 04:40:06 joehw Exp $
- */
-public class XSNamedMapImpl extends AbstractMap implements XSNamedMap {
-
- /**
- * An immutable empty map.
- */
- public static final XSNamedMapImpl EMPTY_MAP = new XSNamedMapImpl(new XSObject[0], 0);
-
- // components of these namespaces are stored in this map
- final String[] fNamespaces;
- // number of namespaces
- final int fNSNum;
- // each entry contains components in one namespace
- final SymbolHash[] fMaps;
- // store all components from all namespace.
- // used when this map is accessed as a list.
- XSObject[] fArray = null;
- // store the number of components.
- // used when this map is accessed as a list.
- int fLength = -1;
- // Set of Map.Entry<QName,XSObject> for the java.util.Map methods
- private Set fEntrySet = null;
-
- /**
- * Construct an XSNamedMap implementation for one namespace
- *
- * @param namespace the namespace to which the components belong
- * @param map the map from local names to components
- */
- public XSNamedMapImpl(String namespace, SymbolHash map) {
- fNamespaces = new String[] {namespace};
- fMaps = new SymbolHash[] {map};
- fNSNum = 1;
- }
-
- /**
- * Construct an XSNamedMap implementation for a list of namespaces
- *
- * @param namespaces the namespaces to which the components belong
- * @param maps the maps from local names to components
- * @param num the number of namespaces
- */
- public XSNamedMapImpl(String[] namespaces, SymbolHash[] maps, int num) {
- fNamespaces = namespaces;
- fMaps = maps;
- fNSNum = num;
- }
-
- /**
- * Construct an XSNamedMap implementation one namespace from an array
- *
- * @param array containing all components
- * @param length number of components
- */
- public XSNamedMapImpl(XSObject[] array, int length) {
- if (length == 0) {
- fNamespaces = null;
- fMaps = null;
- fNSNum = 0;
- fArray = array;
- fLength = 0;
- return;
- }
- // because all components are from the same target namesapce,
- // get the namespace from the first one.
- fNamespaces = new String[]{array[0].getNamespace()};
- fMaps = null;
- fNSNum = 1;
- // copy elements to the Vector
- fArray = array;
- fLength = length;
- }
-
- /**
- * The number of <code>XSObjects</code> in the <code>XSObjectList</code>.
- * The range of valid child object indices is 0 to <code>length-1</code>
- * inclusive.
- */
- public synchronized int getLength() {
- if (fLength == -1) {
- fLength = 0;
- for (int i = 0; i < fNSNum; i++) {
- fLength += fMaps[i].getLength();
- }
- }
- return fLength;
- }
-
- /**
- * Retrieves an <code>XSObject</code> specified by local name and
- * namespace URI.
- * <br>Per XML Namespaces, applications must use the value <code>null</code> as the
- * <code>namespace</code> parameter for methods if they wish to specify
- * no namespace.
- * @param namespace The namespace URI of the <code>XSObject</code> to
- * retrieve, or <code>null</code> if the <code>XSObject</code> has no
- * namespace.
- * @param localName The local name of the <code>XSObject</code> to
- * retrieve.
- * @return A <code>XSObject</code> (of any type) with the specified local
- * name and namespace URI, or <code>null</code> if they do not
- * identify any object in this map.
- */
- public XSObject itemByName(String namespace, String localName) {
- for (int i = 0; i < fNSNum; i++) {
- if (isEqual(namespace, fNamespaces[i])) {
- // when this map is created from SymbolHash's
- // get the component from SymbolHash
- if (fMaps != null) {
- return (XSObject)fMaps[i].get(localName);
- }
- // Otherwise (it's created from an array)
- // go through the array to find a matching name
- XSObject ret;
- for (int j = 0; j < fLength; j++) {
- ret = fArray[j];
- if (ret.getName().equals(localName)) {
- return ret;
- }
- }
- return null;
- }
- }
- return null;
- }
-
- /**
- * Returns the <code>index</code>th item in the collection or
- * <code>null</code> if <code>index</code> is greater than or equal to
- * the number of objects in the list. The index starts at 0.
- * @param index index into the collection.
- * @return The <code>XSObject</code> at the <code>index</code>th
- * position in the <code>XSObjectList</code>, or <code>null</code> if
- * the index specified is not valid.
- */
- public synchronized XSObject item(int index) {
- if (fArray == null) {
- // calculate the total number of elements
- getLength();
- fArray = new XSObject[fLength];
- int pos = 0;
- // get components from all SymbolHashes
- for (int i = 0; i < fNSNum; i++) {
- pos += fMaps[i].getValues(fArray, pos);
- }
- }
- if (index < 0 || index >= fLength) {
- return null;
- }
- return fArray[index];
- }
-
- static boolean isEqual(String one, String two) {
- return (one != null) ? one.equals(two) : (two == null);
- }
-
- /*
- * java.util.Map methods
- */
-
- public boolean containsKey(Object key) {
- return (get(key) != null);
- }
-
- public Object get(Object key) {
- if (key instanceof QName) {
- final QName name = (QName) key;
- String namespaceURI = name.getNamespaceURI();
- if (XMLConstants.NULL_NS_URI.equals(namespaceURI)) {
- namespaceURI = null;
- }
- String localPart = name.getLocalPart();
- return itemByName(namespaceURI, localPart);
- }
- return null;
- }
-
- public int size() {
- return getLength();
- }
-
- public synchronized Set entrySet() {
- // Defer creation of the entry set until it is actually needed.
- if (fEntrySet == null) {
- final int length = getLength();
- final XSNamedMapEntry[] entries = new XSNamedMapEntry[length];
- for (int i = 0; i < length; ++i) {
- XSObject xso = item(i);
- entries[i] = new XSNamedMapEntry(new QName(xso.getNamespace(), xso.getName()), xso);
- }
- // Create a view of this immutable map.
- fEntrySet = new AbstractSet() {
- public Iterator iterator() {
- return new Iterator() {
- private int index = 0;
- public boolean hasNext() {
- return (index < length);
- }
- public Object next() {
- if (index < length) {
- return entries[index++];
- }
- throw new NoSuchElementException();
- }
- public void remove() {
- throw new UnsupportedOperationException();
- }
- };
- }
- public int size() {
- return length;
- }
- };
- }
- return fEntrySet;
- }
-
- /** An entry in the XSNamedMap. **/
- private static final class XSNamedMapEntry implements Map.Entry {
- private final QName key;
- private final XSObject value;
- public XSNamedMapEntry(QName key, XSObject value) {
- this.key = key;
- this.value = value;
- }
- public Object getKey() {
- return key;
- }
- public Object getValue() {
- return value;
- }
- public Object setValue(Object value) {
- throw new UnsupportedOperationException();
- }
- public boolean equals(Object o) {
- if (o instanceof Map.Entry) {
- Map.Entry e = (Map.Entry) o;
- Object otherKey = e.getKey();
- Object otherValue = e.getValue();
- return (key == null ? otherKey == null : key.equals(otherKey)) &&
- (value == null ? otherValue == null : value.equals(otherValue));
- }
- return false;
- }
- public int hashCode() {
- return (key == null ? 0 : key.hashCode())
- ^ (value == null ? 0 : value.hashCode());
- }
- public String toString() {
- StringBuffer buffer = new StringBuffer();
- buffer.append(String.valueOf(key));
- buffer.append('=');
- buffer.append(String.valueOf(value));
- return buffer.toString();
- }
- }
-
-} // class XSNamedMapImpl
diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/util/XSObjectListImpl.java b/src/com/sun/org/apache/xerces/internal/impl/xs/util/XSObjectListImpl.java
deleted file mode 100644
index b5e0de2..0000000
--- a/src/com/sun/org/apache/xerces/internal/impl/xs/util/XSObjectListImpl.java
+++ /dev/null
@@ -1,267 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2002,2003-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.impl.xs.util;
-
-import java.lang.reflect.Array;
-import java.util.AbstractList;
-import java.util.Iterator;
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-
-import com.sun.org.apache.xerces.internal.xs.XSObject;
-import com.sun.org.apache.xerces.internal.xs.XSObjectList;
-
-/**
- * Containts a list of XSObject's.
- *
- * @xerces.internal
- *
- * @author Sandy Gao, IBM
- *
- * @version $Id: XSObjectListImpl.java,v 1.7 2010-11-01 04:40:06 joehw Exp $
- */
-public class XSObjectListImpl extends AbstractList implements XSObjectList {
-
- /**
- * An immutable empty list.
- */
- public static final XSObjectListImpl EMPTY_LIST = new XSObjectListImpl(new XSObject[0], 0);
- private static final ListIterator EMPTY_ITERATOR = new ListIterator() {
- public boolean hasNext() {
- return false;
- }
- public Object next() {
- throw new NoSuchElementException();
- }
- public boolean hasPrevious() {
- return false;
- }
- public Object previous() {
- throw new NoSuchElementException();
- }
- public int nextIndex() {
- return 0;
- }
- public int previousIndex() {
- return -1;
- }
- public void remove() {
- throw new UnsupportedOperationException();
- }
- public void set(Object object) {
- throw new UnsupportedOperationException();
- }
- public void add(Object object) {
- throw new UnsupportedOperationException();
- }
- };
-
- private static final int DEFAULT_SIZE = 4;
-
- // The array to hold all data
- private XSObject[] fArray = null;
- // Number of elements in this list
- private int fLength = 0;
-
- public XSObjectListImpl() {
- fArray = new XSObject[DEFAULT_SIZE];
- fLength = 0;
- }
-
- /**
- * Construct an XSObjectList implementation
- *
- * @param array the data array
- * @param length the number of elements
- */
- public XSObjectListImpl(XSObject[] array, int length) {
- fArray = array;
- fLength = length;
- }
-
- /**
- * The number of <code>XSObjects</code> in the list. The range of valid
- * child node indices is 0 to <code>length-1</code> inclusive.
- */
- public int getLength() {
- return fLength;
- }
-
- /**
- * Returns the <code>index</code>th item in the collection. The index
- * starts at 0. If <code>index</code> is greater than or equal to the
- * number of nodes in the list, this returns <code>null</code>.
- * @param index index into the collection.
- * @return The XSObject at the <code>index</code>th position in the
- * <code>XSObjectList</code>, or <code>null</code> if that is not a
- * valid index.
- */
- public XSObject item(int index) {
- if (index < 0 || index >= fLength) {
- return null;
- }
- return fArray[index];
- }
-
- // clear this object
- public void clearXSObjectList() {
- for (int i=0; i<fLength; i++) {
- fArray[i] = null;
- }
- fArray = null;
- fLength = 0;
- }
-
- public void addXSObject(XSObject object) {
- if (fLength == fArray.length) {
- XSObject[] temp = new XSObject[fLength + 4];
- System.arraycopy(fArray, 0, temp, 0, fLength);
- fArray = temp;
- }
- fArray[fLength++] = object;
- }
-
- public void addXSObject(int index, XSObject object) {
- fArray[index] = object;
- }
-
- /*
- * List methods
- */
-
- public boolean contains(Object value) {
- return (value == null) ? containsNull() : containsObject(value);
- }
-
- public Object get(int index) {
- if (index >= 0 && index < fLength) {
- return fArray[index];
- }
- throw new IndexOutOfBoundsException("Index: " + index);
- }
-
- public int size() {
- return getLength();
- }
-
- public Iterator iterator() {
- return listIterator0(0);
- }
-
- public ListIterator listIterator() {
- return listIterator0(0);
- }
-
- public ListIterator listIterator(int index) {
- if (index >= 0 && index < fLength) {
- return listIterator0(index);
- }
- throw new IndexOutOfBoundsException("Index: " + index);
- }
-
- private ListIterator listIterator0(int index) {
- return fLength == 0 ? EMPTY_ITERATOR : new XSObjectListIterator(index);
- }
-
- private boolean containsObject(Object value) {
- for (int i = fLength - 1; i >= 0; --i) {
- if (value.equals(fArray[i])) {
- return true;
- }
- }
- return false;
- }
-
- private boolean containsNull() {
- for (int i = fLength - 1; i >= 0; --i) {
- if (fArray[i] == null) {
- return true;
- }
- }
- return false;
- }
-
- public Object[] toArray() {
- Object[] a = new Object[fLength];
- toArray0(a);
- return a;
- }
-
- public Object[] toArray(Object[] a) {
- if (a.length < fLength) {
- Class arrayClass = a.getClass();
- Class componentType = arrayClass.getComponentType();
- a = (Object[]) Array.newInstance(componentType, fLength);
- }
- toArray0(a);
- if (a.length > fLength) {
- a[fLength] = null;
- }
- return a;
- }
-
- private void toArray0(Object[] a) {
- if (fLength > 0) {
- System.arraycopy(fArray, 0, a, 0, fLength);
- }
- }
-
- private final class XSObjectListIterator implements ListIterator {
- private int index;
- public XSObjectListIterator(int index) {
- this.index = index;
- }
- public boolean hasNext() {
- return (index < fLength);
- }
- public Object next() {
- if (index < fLength) {
- return fArray[index++];
- }
- throw new NoSuchElementException();
- }
- public boolean hasPrevious() {
- return (index > 0);
- }
- public Object previous() {
- if (index > 0) {
- return fArray[--index];
- }
- throw new NoSuchElementException();
- }
- public int nextIndex() {
- return index;
- }
- public int previousIndex() {
- return index - 1;
- }
- public void remove() {
- throw new UnsupportedOperationException();
- }
- public void set(Object o) {
- throw new UnsupportedOperationException();
- }
- public void add(Object o) {
- throw new UnsupportedOperationException();
- }
- }
-
-} // class XSObjectListImpl
diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/DefaultValidationErrorHandler.java b/src/com/sun/org/apache/xerces/internal/jaxp/DefaultValidationErrorHandler.java
deleted file mode 100644
index 0c8d0a8..0000000
--- a/src/com/sun/org/apache/xerces/internal/jaxp/DefaultValidationErrorHandler.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2000-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.jaxp;
-
-import com.sun.org.apache.xerces.internal.util.SAXMessageFormatter;
-import java.util.Locale;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.helpers.DefaultHandler;
-
-/**
- */
-
-class DefaultValidationErrorHandler extends DefaultHandler {
- static private int ERROR_COUNT_LIMIT = 10;
- private int errorCount = 0;
- private Locale locale = Locale.getDefault();
-
- public DefaultValidationErrorHandler(Locale locale) {
- this.locale = locale;
- }
-
- // XXX Fix message i18n
- public void error(SAXParseException e) throws SAXException {
- if (errorCount >= ERROR_COUNT_LIMIT) {
- // Ignore all errors after reaching the limit
- return;
- } else if (errorCount == 0) {
- // Print a warning before the first error
- System.err.println(SAXMessageFormatter.formatMessage(locale,
- "errorHandlerNotSet", new Object [] {errorCount}));
- }
-
- String systemId = e.getSystemId();
- if (systemId == null) {
- systemId = "null";
- }
- String message = "Error: URI=" + systemId +
- " Line=" + e.getLineNumber() +
- ": " + e.getMessage();
- System.err.println(message);
- errorCount++;
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/DocumentBuilderFactoryImpl.java b/src/com/sun/org/apache/xerces/internal/jaxp/DocumentBuilderFactoryImpl.java
deleted file mode 100644
index fd9298f..0000000
--- a/src/com/sun/org/apache/xerces/internal/jaxp/DocumentBuilderFactoryImpl.java
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.jaxp;
-
-import com.sun.org.apache.xerces.internal.parsers.DOMParser;
-import com.sun.org.apache.xerces.internal.util.SAXMessageFormatter;
-import java.util.HashMap;
-import java.util.Map;
-import javax.xml.XMLConstants;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.validation.Schema;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
-
-/**
- * @author Rajiv Mordani
- * @author Edwin Goei
- * @version $Id: DocumentBuilderFactoryImpl.java,v 1.8 2010-11-01 04:40:06 joehw Exp $
- */
-public class DocumentBuilderFactoryImpl extends DocumentBuilderFactory {
- /** These are DocumentBuilderFactory attributes not DOM attributes */
- private Map<String, Object> attributes;
- private Map<String, Boolean> features;
- private Schema grammar;
- private boolean isXIncludeAware;
-
- /**
- * State of the secure processing feature, initially <code>false</code>
- */
- private boolean fSecureProcess = true;
-
- /**
- * Creates a new instance of a {@link javax.xml.parsers.DocumentBuilder}
- * using the currently configured parameters.
- */
- public DocumentBuilder newDocumentBuilder()
- throws ParserConfigurationException
- {
- /** Check that if a Schema has been specified that neither of the schema properties have been set. */
- if (grammar != null && attributes != null) {
- if (attributes.containsKey(JAXPConstants.JAXP_SCHEMA_LANGUAGE)) {
- throw new ParserConfigurationException(
- SAXMessageFormatter.formatMessage(null,
- "schema-already-specified", new Object[] {JAXPConstants.JAXP_SCHEMA_LANGUAGE}));
- }
- else if (attributes.containsKey(JAXPConstants.JAXP_SCHEMA_SOURCE)) {
- throw new ParserConfigurationException(
- SAXMessageFormatter.formatMessage(null,
- "schema-already-specified", new Object[] {JAXPConstants.JAXP_SCHEMA_SOURCE}));
- }
- }
-
- try {
- return new DocumentBuilderImpl(this, attributes, features, fSecureProcess);
- } catch (SAXException se) {
- // Handles both SAXNotSupportedException, SAXNotRecognizedException
- throw new ParserConfigurationException(se.getMessage());
- }
- }
-
- /**
- * Allows the user to set specific attributes on the underlying
- * implementation.
- * @param name name of attribute
- * @param value null means to remove attribute
- */
- public void setAttribute(String name, Object value)
- throws IllegalArgumentException
- {
- // This handles removal of attributes
- if (value == null) {
- if (attributes != null) {
- attributes.remove(name);
- }
- // Unrecognized attributes do not cause an exception
- return;
- }
-
- // This is ugly. We have to collect the attributes and then
- // later create a DocumentBuilderImpl to verify the attributes.
-
- // Create the Map if none existed before
- if (attributes == null) {
- attributes = new HashMap<>();
- }
-
- attributes.put(name, value);
-
- // Test the attribute name by possibly throwing an exception
- try {
- new DocumentBuilderImpl(this, attributes, features);
- } catch (Exception e) {
- attributes.remove(name);
- throw new IllegalArgumentException(e.getMessage());
- }
- }
-
- /**
- * Allows the user to retrieve specific attributes on the underlying
- * implementation.
- */
- public Object getAttribute(String name)
- throws IllegalArgumentException
- {
- // See if it's in the attributes Map
- if (attributes != null) {
- Object val = attributes.get(name);
- if (val != null) {
- return val;
- }
- }
-
- DOMParser domParser = null;
- try {
- // We create a dummy DocumentBuilderImpl in case the attribute
- // name is not one that is in the attributes map.
- domParser =
- new DocumentBuilderImpl(this, attributes, features).getDOMParser();
- return domParser.getProperty(name);
- } catch (SAXException se1) {
- // assert(name is not recognized or not supported), try feature
- try {
- boolean result = domParser.getFeature(name);
- // Must have been a feature
- return result ? Boolean.TRUE : Boolean.FALSE;
- } catch (SAXException se2) {
- // Not a property or a feature
- throw new IllegalArgumentException(se1.getMessage());
- }
- }
- }
-
- public Schema getSchema() {
- return grammar;
- }
-
- public void setSchema(Schema grammar) {
- this.grammar = grammar;
- }
-
- public boolean isXIncludeAware() {
- return this.isXIncludeAware;
- }
-
- public void setXIncludeAware(boolean state) {
- this.isXIncludeAware = state;
- }
-
- public boolean getFeature(String name)
- throws ParserConfigurationException {
- if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
- return fSecureProcess;
- }
- // See if it's in the features map
- if (features != null) {
- Boolean val = features.get(name);
- if (val != null) {
- return val;
- }
- }
- try {
- DOMParser domParser = new DocumentBuilderImpl(this, attributes, features).getDOMParser();
- return domParser.getFeature(name);
- }
- catch (SAXException e) {
- throw new ParserConfigurationException(e.getMessage());
- }
- }
-
- public void setFeature(String name, boolean value)
- throws ParserConfigurationException {
- if (features == null) {
- features = new HashMap<>();
- }
- // If this is the secure processing feature, save it then return.
- if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
- if (System.getSecurityManager() != null && (!value)) {
- throw new ParserConfigurationException(
- SAXMessageFormatter.formatMessage(null,
- "jaxp-secureprocessing-feature", null));
- }
- fSecureProcess = value;
- features.put(name, value ? Boolean.TRUE : Boolean.FALSE);
- return;
- }
-
- features.put(name, value ? Boolean.TRUE : Boolean.FALSE);
- // Test the feature by possibly throwing SAX exceptions
- try {
- new DocumentBuilderImpl(this, attributes, features);
- }
- catch (SAXNotSupportedException e) {
- features.remove(name);
- throw new ParserConfigurationException(e.getMessage());
- }
- catch (SAXNotRecognizedException e) {
- features.remove(name);
- throw new ParserConfigurationException(e.getMessage());
- }
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/DocumentBuilderImpl.java b/src/com/sun/org/apache/xerces/internal/jaxp/DocumentBuilderImpl.java
deleted file mode 100644
index b523866..0000000
--- a/src/com/sun/org/apache/xerces/internal/jaxp/DocumentBuilderImpl.java
+++ /dev/null
@@ -1,413 +0,0 @@
-/*
- * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.jaxp;
-
-import com.sun.org.apache.xerces.internal.dom.DOMImplementationImpl;
-import com.sun.org.apache.xerces.internal.dom.DOMMessageFormatter;
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.validation.ValidationManager;
-import com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator;
-import com.sun.org.apache.xerces.internal.jaxp.validation.XSGrammarPoolContainer;
-import com.sun.org.apache.xerces.internal.parsers.DOMParser;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager.Property;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager.State;
-import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponent;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration;
-import java.io.IOException;
-import java.util.Map;
-import javax.xml.XMLConstants;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.validation.Schema;
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.Document;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
-
-/**
- * @author Rajiv Mordani
- * @author Edwin Goei
- * @version $Id: DocumentBuilderImpl.java,v 1.8 2010-11-01 04:40:06 joehw Exp $
- */
-public class DocumentBuilderImpl extends DocumentBuilder
- implements JAXPConstants
-{
- /** Feature identifier: namespaces. */
- private static final String NAMESPACES_FEATURE =
- Constants.SAX_FEATURE_PREFIX + Constants.NAMESPACES_FEATURE;
-
- /** Feature identifier: include ignorable white space. */
- private static final String INCLUDE_IGNORABLE_WHITESPACE =
- Constants.XERCES_FEATURE_PREFIX + Constants.INCLUDE_IGNORABLE_WHITESPACE;
-
- /** Feature identifier: create entiry ref nodes feature. */
- private static final String CREATE_ENTITY_REF_NODES_FEATURE =
- Constants.XERCES_FEATURE_PREFIX + Constants.CREATE_ENTITY_REF_NODES_FEATURE;
-
- /** Feature identifier: include comments feature. */
- private static final String INCLUDE_COMMENTS_FEATURE =
- Constants.XERCES_FEATURE_PREFIX + Constants.INCLUDE_COMMENTS_FEATURE;
-
- /** Feature identifier: create cdata nodes feature. */
- private static final String CREATE_CDATA_NODES_FEATURE =
- Constants.XERCES_FEATURE_PREFIX + Constants.CREATE_CDATA_NODES_FEATURE;
-
- /** Feature identifier: XInclude processing */
- private static final String XINCLUDE_FEATURE =
- Constants.XERCES_FEATURE_PREFIX + Constants.XINCLUDE_FEATURE;
-
- /** feature identifier: XML Schema validation */
- private static final String XMLSCHEMA_VALIDATION_FEATURE =
- Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_VALIDATION_FEATURE;
-
- /** Feature identifier: validation */
- private static final String VALIDATION_FEATURE =
- Constants.SAX_FEATURE_PREFIX + Constants.VALIDATION_FEATURE;
-
- /** Property identifier: security manager. */
- private static final String SECURITY_MANAGER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SECURITY_MANAGER_PROPERTY;
-
- /** Property identifier: Security property manager. */
- private static final String XML_SECURITY_PROPERTY_MANAGER =
- Constants.XML_SECURITY_PROPERTY_MANAGER;
-
- /** property identifier: access external dtd. */
- public static final String ACCESS_EXTERNAL_DTD = XMLConstants.ACCESS_EXTERNAL_DTD;
-
- /** Property identifier: access to external schema */
- public static final String ACCESS_EXTERNAL_SCHEMA = XMLConstants.ACCESS_EXTERNAL_SCHEMA;
-
-
- private final DOMParser domParser;
- private final Schema grammar;
-
- private final XMLComponent fSchemaValidator;
- private final XMLComponentManager fSchemaValidatorComponentManager;
- private final ValidationManager fSchemaValidationManager;
- private final UnparsedEntityHandler fUnparsedEntityHandler;
-
- /** Initial ErrorHandler */
- private final ErrorHandler fInitErrorHandler;
-
- /** Initial EntityResolver */
- private final EntityResolver fInitEntityResolver;
-
- private XMLSecurityManager fSecurityManager;
- private XMLSecurityPropertyManager fSecurityPropertyMgr;
-
- DocumentBuilderImpl(DocumentBuilderFactoryImpl dbf, Map<String, Object> dbfAttrs,
- Map<String, Boolean> features)
- throws SAXNotRecognizedException, SAXNotSupportedException {
- this(dbf, dbfAttrs, features, false);
- }
-
- DocumentBuilderImpl(DocumentBuilderFactoryImpl dbf, Map<String, Object> dbfAttrs,
- Map<String, Boolean> features, boolean secureProcessing)
- throws SAXNotRecognizedException, SAXNotSupportedException
- {
- domParser = new DOMParser();
-
- // If validating, provide a default ErrorHandler that prints
- // validation errors with a warning telling the user to set an
- // ErrorHandler
- if (dbf.isValidating()) {
- fInitErrorHandler = new DefaultValidationErrorHandler(domParser.getXMLParserConfiguration().getLocale());
- setErrorHandler(fInitErrorHandler);
- }
- else {
- fInitErrorHandler = domParser.getErrorHandler();
- }
-
- domParser.setFeature(VALIDATION_FEATURE, dbf.isValidating());
-
- // "namespaceAware" == SAX Namespaces feature
- domParser.setFeature(NAMESPACES_FEATURE, dbf.isNamespaceAware());
-
- // Set various parameters obtained from DocumentBuilderFactory
- domParser.setFeature(INCLUDE_IGNORABLE_WHITESPACE,
- !dbf.isIgnoringElementContentWhitespace());
- domParser.setFeature(CREATE_ENTITY_REF_NODES_FEATURE,
- !dbf.isExpandEntityReferences());
- domParser.setFeature(INCLUDE_COMMENTS_FEATURE,
- !dbf.isIgnoringComments());
- domParser.setFeature(CREATE_CDATA_NODES_FEATURE,
- !dbf.isCoalescing());
-
- // Avoid setting the XInclude processing feature if the value is false.
- // This will keep the configuration from throwing an exception if it
- // does not support XInclude.
- if (dbf.isXIncludeAware()) {
- domParser.setFeature(XINCLUDE_FEATURE, true);
- }
-
- fSecurityPropertyMgr = new XMLSecurityPropertyManager();
- domParser.setProperty(XML_SECURITY_PROPERTY_MANAGER, fSecurityPropertyMgr);
-
- fSecurityManager = new XMLSecurityManager(secureProcessing);
- domParser.setProperty(SECURITY_MANAGER, fSecurityManager);
-
- if (secureProcessing) {
- /**
- * If secure processing is explicitly set on the factory, the
- * access properties will be set unless the corresponding
- * System Properties or jaxp.properties are set
- */
- if (features != null) {
- Boolean temp = features.get(XMLConstants.FEATURE_SECURE_PROCESSING);
- if (temp != null) {
- if (temp && Constants.IS_JDK8_OR_ABOVE) {
- fSecurityPropertyMgr.setValue(Property.ACCESS_EXTERNAL_DTD,
- State.FSP, Constants.EXTERNAL_ACCESS_DEFAULT_FSP);
- fSecurityPropertyMgr.setValue(Property.ACCESS_EXTERNAL_SCHEMA,
- State.FSP, Constants.EXTERNAL_ACCESS_DEFAULT_FSP);
- }
- }
- }
- }
-
- this.grammar = dbf.getSchema();
- if (grammar != null) {
- XMLParserConfiguration config = domParser.getXMLParserConfiguration();
- XMLComponent validatorComponent = null;
- /** For Xerces grammars, use built-in schema validator. **/
- if (grammar instanceof XSGrammarPoolContainer) {
- validatorComponent = new XMLSchemaValidator();
- fSchemaValidationManager = new ValidationManager();
- fUnparsedEntityHandler = new UnparsedEntityHandler(fSchemaValidationManager);
- config.setDTDHandler(fUnparsedEntityHandler);
- fUnparsedEntityHandler.setDTDHandler(domParser);
- domParser.setDTDSource(fUnparsedEntityHandler);
- fSchemaValidatorComponentManager = new SchemaValidatorConfiguration(config,
- (XSGrammarPoolContainer) grammar, fSchemaValidationManager);
- }
- /** For third party grammars, use the JAXP validator component. **/
- else {
- validatorComponent = new JAXPValidatorComponent(grammar.newValidatorHandler());
- fSchemaValidationManager = null;
- fUnparsedEntityHandler = null;
- fSchemaValidatorComponentManager = config;
- }
- config.addRecognizedFeatures(validatorComponent.getRecognizedFeatures());
- config.addRecognizedProperties(validatorComponent.getRecognizedProperties());
- setFeatures(features); // Must set before calling setDocumentHandler()
- config.setDocumentHandler((XMLDocumentHandler) validatorComponent);
- ((XMLDocumentSource)validatorComponent).setDocumentHandler(domParser);
- domParser.setDocumentSource((XMLDocumentSource) validatorComponent);
- fSchemaValidator = validatorComponent;
- }
- else {
- fSchemaValidationManager = null;
- fUnparsedEntityHandler = null;
- fSchemaValidatorComponentManager = null;
- fSchemaValidator = null;
- setFeatures(features);
- }
-
- //setAttribute override those that may be set by other means
- setDocumentBuilderFactoryAttributes(dbfAttrs);
-
- // Initial EntityResolver
- fInitEntityResolver = domParser.getEntityResolver();
- }
-
- private void setFeatures( Map<String, Boolean> features)
- throws SAXNotSupportedException, SAXNotRecognizedException {
- if (features != null) {
- for (Map.Entry<String, Boolean> entry : features.entrySet()) {
- domParser.setFeature(entry.getKey(), entry.getValue());
- }
- }
- }
-
- /**
- * Set any DocumentBuilderFactory attributes of our underlying DOMParser
- *
- * Note: code does not handle possible conflicts between DOMParser
- * attribute names and JAXP specific attribute names,
- * eg. DocumentBuilderFactory.setValidating()
- */
- private void setDocumentBuilderFactoryAttributes( Map<String, Object> dbfAttrs)
- throws SAXNotSupportedException, SAXNotRecognizedException
- {
- if (dbfAttrs == null) {
- // Nothing to do
- return;
- }
-
- for (Map.Entry<String, Object> entry : dbfAttrs.entrySet()) {
- String name = entry.getKey();
- Object val = entry.getValue();
- if (val instanceof Boolean) {
- // Assume feature
- domParser.setFeature(name, (Boolean)val);
- } else {
- // Assume property
- if (JAXP_SCHEMA_LANGUAGE.equals(name)) {
- // JAXP 1.2 support
- //None of the properties will take effect till the setValidating(true) has been called
- if ( W3C_XML_SCHEMA.equals(val) ) {
- if( isValidating() ) {
- domParser.setFeature(XMLSCHEMA_VALIDATION_FEATURE, true);
- // this should allow us not to emit DTD errors, as expected by the
- // spec when schema validation is enabled
- domParser.setProperty(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
- }
- }
- } else if(JAXP_SCHEMA_SOURCE.equals(name)){
- if( isValidating() ) {
- String value=(String)dbfAttrs.get(JAXP_SCHEMA_LANGUAGE);
- if(value !=null && W3C_XML_SCHEMA.equals(value)){
- domParser.setProperty(name, val);
- }else{
- throw new IllegalArgumentException(
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN,
- "jaxp-order-not-supported",
- new Object[] {JAXP_SCHEMA_LANGUAGE, JAXP_SCHEMA_SOURCE}));
- }
- }
- } else {
- //check if the property is managed by security manager
- if (fSecurityManager == null ||
- !fSecurityManager.setLimit(name, XMLSecurityManager.State.APIPROPERTY, val)) {
- //check if the property is managed by security property manager
- if (fSecurityPropertyMgr == null ||
- !fSecurityPropertyMgr.setValue(name, XMLSecurityPropertyManager.State.APIPROPERTY, val)) {
- //fall back to the existing property manager
- domParser.setProperty(name, val);
- }
- }
-
- }
- }
- }
- }
-
- /**
- * Non-preferred: use the getDOMImplementation() method instead of this
- * one to get a DOM Level 2 DOMImplementation object and then use DOM
- * Level 2 methods to create a DOM Document object.
- */
- public Document newDocument() {
- return new com.sun.org.apache.xerces.internal.dom.DocumentImpl();
- }
-
- public DOMImplementation getDOMImplementation() {
- return DOMImplementationImpl.getDOMImplementation();
- }
-
- public Document parse(InputSource is) throws SAXException, IOException {
- if (is == null) {
- throw new IllegalArgumentException(
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN,
- "jaxp-null-input-source", null));
- }
- if (fSchemaValidator != null) {
- if (fSchemaValidationManager != null) {
- fSchemaValidationManager.reset();
- fUnparsedEntityHandler.reset();
- }
- resetSchemaValidator();
- }
- domParser.parse(is);
- Document doc = domParser.getDocument();
- domParser.dropDocumentReferences();
- return doc;
- }
-
- public boolean isNamespaceAware() {
- try {
- return domParser.getFeature(NAMESPACES_FEATURE);
- }
- catch (SAXException x) {
- throw new IllegalStateException(x.getMessage());
- }
- }
-
- public boolean isValidating() {
- try {
- return domParser.getFeature(VALIDATION_FEATURE);
- }
- catch (SAXException x) {
- throw new IllegalStateException(x.getMessage());
- }
- }
-
- /**
- * Gets the XInclude processing mode for this parser
- * @return the state of XInclude processing mode
- */
- public boolean isXIncludeAware() {
- try {
- return domParser.getFeature(XINCLUDE_FEATURE);
- }
- catch (SAXException exc) {
- return false;
- }
- }
-
- public void setEntityResolver(EntityResolver er) {
- domParser.setEntityResolver(er);
- }
-
- public void setErrorHandler(ErrorHandler eh) {
- domParser.setErrorHandler(eh);
- }
-
- public Schema getSchema() {
- return grammar;
- }
-
- public void reset() {
- /** Restore the initial error handler. **/
- if (domParser.getErrorHandler() != fInitErrorHandler) {
- domParser.setErrorHandler(fInitErrorHandler);
- }
- /** Restore the initial entity resolver. **/
- if (domParser.getEntityResolver() != fInitEntityResolver) {
- domParser.setEntityResolver(fInitEntityResolver);
- }
- }
-
- // package private
- DOMParser getDOMParser() {
- return domParser;
- }
-
- private void resetSchemaValidator() throws SAXException {
- try {
- fSchemaValidator.reset(fSchemaValidatorComponentManager);
- }
- // This should never be thrown from the schema validator.
- catch (XMLConfigurationException e) {
- throw new SAXException(e);
- }
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/JAXPConstants.java b/src/com/sun/org/apache/xerces/internal/jaxp/JAXPConstants.java
deleted file mode 100644
index 5f2c563..0000000
--- a/src/com/sun/org/apache/xerces/internal/jaxp/JAXPConstants.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2000-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package com.sun.org.apache.xerces.internal.jaxp;
-
-/**
- * This interface holds JAXP constant property/attribute names and values.
- * Since JAXP 1.2 is a maintenance release of JAXP 1.1, no public
- * signatures are allowed so these values cannot be exposed in the
- * javax.xml.parsers package. Once equivalent constants have been defined
- * in future JAXP spec versions, this interface can be removed.
- *
- * @author Edwin Goei
- */
-public interface JAXPConstants {
- static final String JAXP_SCHEMA_LANGUAGE =
- "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
- static final String W3C_XML_SCHEMA =
- "http://www.w3.org/2001/XMLSchema";
-
- static final String JAXP_SCHEMA_SOURCE =
- "http://java.sun.com/xml/jaxp/properties/schemaSource";
-}
diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/JAXPValidatorComponent.java b/src/com/sun/org/apache/xerces/internal/jaxp/JAXPValidatorComponent.java
deleted file mode 100644
index d447574..0000000
--- a/src/com/sun/org/apache/xerces/internal/jaxp/JAXPValidatorComponent.java
+++ /dev/null
@@ -1,599 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.jaxp;
-
-import java.io.IOException;
-
-import javax.xml.validation.TypeInfoProvider;
-import javax.xml.validation.ValidatorHandler;
-
-import com.sun.org.apache.xerces.internal.dom.DOMInputImpl;
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
-import com.sun.org.apache.xerces.internal.impl.xs.opti.DefaultXMLDocumentHandler;
-import com.sun.org.apache.xerces.internal.util.AttributesProxy;
-import com.sun.org.apache.xerces.internal.util.AugmentationsImpl;
-import com.sun.org.apache.xerces.internal.util.ErrorHandlerProxy;
-import com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper;
-import com.sun.org.apache.xerces.internal.util.LocatorProxy;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.util.XMLResourceIdentifierImpl;
-import com.sun.org.apache.xerces.internal.xni.Augmentations;
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
-import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLLocator;
-import com.sun.org.apache.xerces.internal.xni.XMLString;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponent;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLEntityResolver;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-import org.w3c.dom.TypeInfo;
-import org.w3c.dom.ls.LSInput;
-import org.w3c.dom.ls.LSResourceResolver;
-import org.xml.sax.Attributes;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.helpers.DefaultHandler;
-
-/**
- * Runs events through a {@link javax.xml.validation.ValidatorHandler}
- * and performs validation/infoset-augmentation by an external validator.
- *
- * <p>
- * This component sets up the pipeline as follows:
- *
- * <!-- this picture may look teribble on your IDE but it is correct. -->
- * <pre>
- * __ __
- * / |==> XNI2SAX --> Validator --> SAX2XNI ==>|
- * / | |
- * ==>| Tee| | next
- * \ | | component
- * \ |============other XNI events============>|
- * ~~ ~~
- * </pre>
- * <p>
- * only those events that need to go through Validator will go the 1st route,
- * and other events go the 2nd direct route.
- *
- * @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
- */
-final class JAXPValidatorComponent
- extends TeeXMLDocumentFilterImpl implements XMLComponent {
-
- /** Property identifier: entity manager. */
- private static final String ENTITY_MANAGER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_MANAGER_PROPERTY;
-
- /** Property identifier: error reporter. */
- private static final String ERROR_REPORTER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY;
-
- /** Property identifier: symbol table. */
- private static final String SYMBOL_TABLE =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY;
-
- // pipeline parts
- private final ValidatorHandler validator;
- private final XNI2SAX xni2sax = new XNI2SAX();
- private final SAX2XNI sax2xni = new SAX2XNI();
-
- // never be null
- private final TypeInfoProvider typeInfoProvider;
-
- /**
- * Used to store the {@link Augmentations} associated with the
- * current event, so that we can pick it up again
- * when the event is forwarded by the {@link ValidatorHandler}.
- *
- * UGLY HACK.
- */
- private Augmentations fCurrentAug;
-
- /**
- * {@link XMLAttributes} version of {@link #fCurrentAug}.
- */
- private XMLAttributes fCurrentAttributes;
-
- // components obtained from a manager / property
-
- private SymbolTable fSymbolTable;
- private XMLErrorReporter fErrorReporter;
- private XMLEntityResolver fEntityResolver;
-
- /**
- * @param validatorHandler may not be null.
- */
- public JAXPValidatorComponent( ValidatorHandler validatorHandler ) {
- this.validator = validatorHandler;
- TypeInfoProvider tip = validatorHandler.getTypeInfoProvider();
- if(tip==null) tip = noInfoProvider;
- this.typeInfoProvider = tip;
-
- // configure wiring between internal components.
- xni2sax.setContentHandler(validator);
- validator.setContentHandler(sax2xni);
- this.setSide(xni2sax);
-
- // configure validator with proper EntityResolver/ErrorHandler.
- validator.setErrorHandler(new ErrorHandlerProxy() {
- protected XMLErrorHandler getErrorHandler() {
- XMLErrorHandler handler = fErrorReporter.getErrorHandler();
- if(handler!=null) return handler;
- return new ErrorHandlerWrapper(DraconianErrorHandler.getInstance());
- }
- });
- validator.setResourceResolver(new LSResourceResolver() {
- public LSInput resolveResource(String type,String ns, String publicId, String systemId, String baseUri) {
- if(fEntityResolver==null) return null;
- try {
- XMLInputSource is = fEntityResolver.resolveEntity(
- new XMLResourceIdentifierImpl(publicId,systemId,baseUri,null));
- if(is==null) return null;
-
- LSInput di = new DOMInputImpl();
- di.setBaseURI(is.getBaseSystemId());
- di.setByteStream(is.getByteStream());
- di.setCharacterStream(is.getCharacterStream());
- di.setEncoding(is.getEncoding());
- di.setPublicId(is.getPublicId());
- di.setSystemId(is.getSystemId());
-
- return di;
- } catch( IOException e ) {
- // erors thrown by the callback is not supposed to be
- // reported to users.
- throw new XNIException(e);
- }
- }
- });
- }
-
-
- public void startElement(QName element, XMLAttributes attributes, Augmentations augs) throws XNIException {
- fCurrentAttributes = attributes;
- fCurrentAug = augs;
- xni2sax.startElement(element,attributes,null);
- fCurrentAttributes = null; // mostly to make it easy to find any bug.
- }
-
- public void endElement(QName element, Augmentations augs) throws XNIException {
- fCurrentAug = augs;
- xni2sax.endElement(element,null);
- }
-
- public void emptyElement(QName element, XMLAttributes attributes, Augmentations augs) throws XNIException {
- startElement(element,attributes,augs);
- endElement(element,augs);
- }
-
-
- public void characters(XMLString text, Augmentations augs) throws XNIException {
- // since a validator may change the contents,
- // let this one go through a validator
- fCurrentAug = augs;
- xni2sax.characters(text,null);
- }
-
- public void ignorableWhitespace(XMLString text, Augmentations augs) throws XNIException {
- // since a validator may change the contents,
- // let this one go through a validator
- fCurrentAug = augs;
- xni2sax.ignorableWhitespace(text,null);
- }
-
- public void reset(XMLComponentManager componentManager) throws XMLConfigurationException {
- // obtain references from the manager
- fSymbolTable = (SymbolTable)componentManager.getProperty(SYMBOL_TABLE);
- fErrorReporter = (XMLErrorReporter)componentManager.getProperty(ERROR_REPORTER);
- try {
- fEntityResolver = (XMLEntityResolver) componentManager.getProperty(ENTITY_MANAGER);
- }
- catch (XMLConfigurationException e) {
- fEntityResolver = null;
- }
- }
-
- /**
- *
- * Uses {@link DefaultHandler} as a default implementation of
- * {@link ContentHandler}.
- *
- * <p>
- * We only forward certain events from a {@link ValidatorHandler}.
- * Other events should go "the 2nd direct route".
- */
- private final class SAX2XNI extends DefaultHandler {
-
- /**
- * {@link Augmentations} to send along with events.
- * We reuse one object for efficiency.
- */
- private final Augmentations fAugmentations = new AugmentationsImpl();
-
- /**
- * {@link QName} to send along events.
- * we reuse one QName for efficiency.
- */
- private final QName fQName = new QName();
-
- public void characters(char[] ch, int start, int len) throws SAXException {
- try {
- handler().characters(new XMLString(ch,start,len),aug());
- } catch( XNIException e ) {
- throw toSAXException(e);
- }
- }
-
- public void ignorableWhitespace(char[] ch, int start, int len) throws SAXException {
- try {
- handler().ignorableWhitespace(new XMLString(ch,start,len),aug());
- } catch( XNIException e ) {
- throw toSAXException(e);
- }
- }
-
- public void startElement(String uri, String localName, String qname, Attributes atts) throws SAXException {
- try {
- updateAttributes(atts);
- handler().startElement(toQName(uri,localName,qname), fCurrentAttributes, elementAug());
- } catch( XNIException e ) {
- throw toSAXException(e);
- }
- }
-
- public void endElement(String uri, String localName, String qname) throws SAXException {
- try {
- handler().endElement(toQName(uri,localName,qname),aug());
- } catch( XNIException e ) {
- throw toSAXException(e);
- }
- }
-
- private Augmentations elementAug() {
- Augmentations aug = aug();
- /** aug.putItem(Constants.TYPEINFO,typeInfoProvider.getElementTypeInfo()); **/
- return aug;
- }
-
-
- /**
- * Gets the {@link Augmentations} that should be associated with
- * the current event.
- */
- private Augmentations aug() {
- if( fCurrentAug!=null ) {
- Augmentations r = fCurrentAug;
- fCurrentAug = null; // we "consumed" this augmentation.
- return r;
- }
- fAugmentations.removeAllItems();
- return fAugmentations;
- }
-
- /**
- * Get the handler to which we should send events.
- */
- private XMLDocumentHandler handler() {
- return JAXPValidatorComponent.this.getDocumentHandler();
- }
-
- /**
- * Converts the {@link XNIException} received from a downstream
- * component to a {@link SAXException}.
- */
- private SAXException toSAXException( XNIException xe ) {
- Exception e = xe.getException();
- if( e==null ) e = xe;
- if( e instanceof SAXException ) return (SAXException)e;
- return new SAXException(e);
- }
-
- /**
- * Creates a proper {@link QName} object from 3 parts.
- * <p>
- * This method does the symbolization.
- */
- private QName toQName( String uri, String localName, String qname ) {
- String prefix = null;
- int idx = qname.indexOf(':');
- if( idx>0 )
- prefix = symbolize(qname.substring(0,idx));
-
- localName = symbolize(localName);
- qname = symbolize(qname);
- uri = symbolize(uri);
-
- // notify handlers
- fQName.setValues(prefix, localName, qname, uri);
- return fQName;
- }
- }
-
- /**
- * Converts {@link XNI} events to {@link ContentHandler} events.
- *
- * <p>
- * Deriving from {@link DefaultXMLDocumentHandler}
- * to reuse its default {@link com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler}
- * implementation.
- *
- * @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
- */
- private final class XNI2SAX extends DefaultXMLDocumentHandler {
-
- private ContentHandler fContentHandler;
-
- private String fVersion;
-
- /** Namespace context */
- protected NamespaceContext fNamespaceContext;
-
- /**
- * For efficiency, we reuse one instance.
- */
- private final AttributesProxy fAttributesProxy = new AttributesProxy(null);
-
- public void setContentHandler( ContentHandler handler ) {
- this.fContentHandler = handler;
- }
-
- public ContentHandler getContentHandler() {
- return fContentHandler;
- }
-
-
- public void xmlDecl(String version, String encoding, String standalone, Augmentations augs) throws XNIException {
- this.fVersion = version;
- }
-
- public void startDocument(XMLLocator locator, String encoding, NamespaceContext namespaceContext, Augmentations augs) throws XNIException {
- fNamespaceContext = namespaceContext;
- fContentHandler.setDocumentLocator(new LocatorProxy(locator));
- try {
- fContentHandler.startDocument();
- } catch (SAXException e) {
- throw new XNIException(e);
- }
- }
-
- public void endDocument(Augmentations augs) throws XNIException {
- try {
- fContentHandler.endDocument();
- } catch (SAXException e) {
- throw new XNIException(e);
- }
- }
-
- public void processingInstruction(String target, XMLString data, Augmentations augs) throws XNIException {
- try {
- fContentHandler.processingInstruction(target,data.toString());
- } catch (SAXException e) {
- throw new XNIException(e);
- }
- }
-
- public void startElement(QName element, XMLAttributes attributes, Augmentations augs) throws XNIException {
- try {
- // start namespace prefix mappings
- int count = fNamespaceContext.getDeclaredPrefixCount();
- if (count > 0) {
- String prefix = null;
- String uri = null;
- for (int i = 0; i < count; i++) {
- prefix = fNamespaceContext.getDeclaredPrefixAt(i);
- uri = fNamespaceContext.getURI(prefix);
- fContentHandler.startPrefixMapping(prefix, (uri == null)?"":uri);
- }
- }
-
- String uri = element.uri != null ? element.uri : "";
- String localpart = element.localpart;
- fAttributesProxy.setAttributes(attributes);
- fContentHandler.startElement(uri, localpart, element.rawname, fAttributesProxy);
- } catch( SAXException e ) {
- throw new XNIException(e);
- }
- }
-
- public void endElement(QName element, Augmentations augs) throws XNIException {
- try {
- String uri = element.uri != null ? element.uri : "";
- String localpart = element.localpart;
- fContentHandler.endElement(uri, localpart, element.rawname);
-
- // send endPrefixMapping events
- int count = fNamespaceContext.getDeclaredPrefixCount();
- if (count > 0) {
- for (int i = 0; i < count; i++) {
- fContentHandler.endPrefixMapping(fNamespaceContext.getDeclaredPrefixAt(i));
- }
- }
- } catch( SAXException e ) {
- throw new XNIException(e);
- }
- }
-
- public void emptyElement(QName element, XMLAttributes attributes, Augmentations augs) throws XNIException {
- startElement(element,attributes,augs);
- endElement(element,augs);
- }
-
- public void characters(XMLString text, Augmentations augs) throws XNIException {
- try {
- fContentHandler.characters(text.ch,text.offset,text.length);
- } catch (SAXException e) {
- throw new XNIException(e);
- }
- }
-
- public void ignorableWhitespace(XMLString text, Augmentations augs) throws XNIException {
- try {
- fContentHandler.ignorableWhitespace(text.ch,text.offset,text.length);
- } catch (SAXException e) {
- throw new XNIException(e);
- }
- }
- }
-
- private static final class DraconianErrorHandler implements ErrorHandler {
-
- /**
- * Singleton instance.
- */
- private static final DraconianErrorHandler ERROR_HANDLER_INSTANCE
- = new DraconianErrorHandler();
-
- private DraconianErrorHandler() {}
-
- /** Returns the one and only instance of this error handler. */
- public static DraconianErrorHandler getInstance() {
- return ERROR_HANDLER_INSTANCE;
- }
-
- /** Warning: Ignore. */
- public void warning(SAXParseException e) throws SAXException {
- // noop
- }
-
- /** Error: Throws back SAXParseException. */
- public void error(SAXParseException e) throws SAXException {
- throw e;
- }
-
- /** Fatal Error: Throws back SAXParseException. */
- public void fatalError(SAXParseException e) throws SAXException {
- throw e;
- }
-
- } // DraconianErrorHandler
-
-
- /**
- * Compares the given {@link Attributes} with {@link #fCurrentAttributes}
- * and update the latter accordingly.
- */
- private void updateAttributes( Attributes atts ) {
- int len = atts.getLength();
- for( int i=0; i<len; i++ ) {
- String aqn = atts.getQName(i);
- int j = fCurrentAttributes.getIndex(aqn);
- String av = atts.getValue(i);
- if(j==-1) {
- // newly added attribute. add to the current attribute list.
-
- String prefix;
- int idx = aqn.indexOf(':');
- if( idx<0 ) {
- prefix = null;
- } else {
- prefix = symbolize(aqn.substring(0,idx));
- }
-
- j = fCurrentAttributes.addAttribute(
- new QName(
- prefix,
- symbolize(atts.getLocalName(i)),
- symbolize(aqn),
- symbolize(atts.getURI(i))),
- atts.getType(i),av);
- } else {
- // the attribute is present.
- if( !av.equals(fCurrentAttributes.getValue(j)) ) {
- // but the value was changed.
- fCurrentAttributes.setValue(j,av);
- }
- }
-
- /** Augmentations augs = fCurrentAttributes.getAugmentations(j);
- augs.putItem( Constants.TYPEINFO,
- typeInfoProvider.getAttributeTypeInfo(i) );
- augs.putItem( Constants.ID_ATTRIBUTE,
- typeInfoProvider.isIdAttribute(i)?Boolean.TRUE:Boolean.FALSE ); **/
- }
- }
-
- private String symbolize( String s ) {
- return fSymbolTable.addSymbol(s);
- }
-
-
- /**
- * {@link TypeInfoProvider} that returns no info.
- */
- private static final TypeInfoProvider noInfoProvider = new TypeInfoProvider() {
- public TypeInfo getElementTypeInfo() {
- return null;
- }
- public TypeInfo getAttributeTypeInfo(int index) {
- return null;
- }
- public TypeInfo getAttributeTypeInfo(String attributeQName) {
- return null;
- }
- public TypeInfo getAttributeTypeInfo(String attributeUri, String attributeLocalName) {
- return null;
- }
- public boolean isIdAttribute(int index) {
- return false;
- }
- public boolean isSpecified(int index) {
- return false;
- }
- };
-
- //
- //
- // XMLComponent implementation.
- //
- //
-
- // no property/feature supported
- public String[] getRecognizedFeatures() {
- return null;
- }
-
- public void setFeature(String featureId, boolean state) throws XMLConfigurationException {
- }
-
- public String[] getRecognizedProperties() {
- return new String[]{ENTITY_MANAGER, ERROR_REPORTER, SYMBOL_TABLE};
- }
-
- public void setProperty(String propertyId, Object value) throws XMLConfigurationException {
- }
-
- public Boolean getFeatureDefault(String featureId) {
- return null;
- }
-
- public Object getPropertyDefault(String propertyId) {
- return null;
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserFactoryImpl.java b/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserFactoryImpl.java
deleted file mode 100644
index 5559310..0000000
--- a/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserFactoryImpl.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.jaxp;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.util.SAXMessageFormatter;
-import java.util.HashMap;
-import java.util.Map;
-import javax.xml.XMLConstants;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-import javax.xml.validation.Schema;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
-
-/**
- * This is the implementation specific class for the
- * <code>javax.xml.parsers.SAXParserFactory</code>. This is the platform
- * default implementation for the platform.
- *
- * @author Rajiv Mordani
- * @author Edwin Goei
- *
- * @version $Id: SAXParserFactoryImpl.java,v 1.9 2010-11-01 04:40:06 joehw Exp $
- */
-public class SAXParserFactoryImpl extends SAXParserFactory {
-
- /** Feature identifier: validation. */
- private static final String VALIDATION_FEATURE =
- Constants.SAX_FEATURE_PREFIX + Constants.VALIDATION_FEATURE;
-
- /** Feature identifier: namespaces. */
- private static final String NAMESPACES_FEATURE =
- Constants.SAX_FEATURE_PREFIX + Constants.NAMESPACES_FEATURE;
-
- /** Feature identifier: XInclude processing */
- private static final String XINCLUDE_FEATURE =
- Constants.XERCES_FEATURE_PREFIX + Constants.XINCLUDE_FEATURE;
-
- private Map<String, Boolean> features;
- private Schema grammar;
- private boolean isXIncludeAware;
-
- /**
- * State of the secure processing feature, initially <code>false</code>
- */
- private boolean fSecureProcess = true;
-
- /**
- * Creates a new instance of <code>SAXParser</code> using the currently
- * configured factory parameters.
- * @return javax.xml.parsers.SAXParser
- */
- public SAXParser newSAXParser()
- throws ParserConfigurationException
- {
- SAXParser saxParserImpl;
- try {
- saxParserImpl = new SAXParserImpl(this, features, fSecureProcess);
- } catch (SAXException se) {
- // Translate to ParserConfigurationException
- throw new ParserConfigurationException(se.getMessage());
- }
- return saxParserImpl;
- }
-
- /**
- * Common code for translating exceptions
- */
- private SAXParserImpl newSAXParserImpl()
- throws ParserConfigurationException, SAXNotRecognizedException,
- SAXNotSupportedException
- {
- SAXParserImpl saxParserImpl;
- try {
- saxParserImpl = new SAXParserImpl(this, features);
- } catch (SAXNotSupportedException e) {
- throw e;
- } catch (SAXNotRecognizedException e) {
- throw e;
- } catch (SAXException se) {
- throw new ParserConfigurationException(se.getMessage());
- }
- return saxParserImpl;
- }
-
- /**
- * Sets the particular feature in the underlying implementation of
- * org.xml.sax.XMLReader.
- */
- public void setFeature(String name, boolean value)
- throws ParserConfigurationException, SAXNotRecognizedException,
- SAXNotSupportedException {
- if (name == null) {
- throw new NullPointerException();
- }
- // If this is the secure processing feature, save it then return.
- if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
- if (System.getSecurityManager() != null && (!value)) {
- throw new ParserConfigurationException(
- SAXMessageFormatter.formatMessage(null,
- "jaxp-secureprocessing-feature", null));
- }
- fSecureProcess = value;
- putInFeatures(name, value);
- return;
- }
-
- // XXX This is ugly. We have to collect the features and then
- // later create an XMLReader to verify the features.
- putInFeatures(name, value);
- // Test the feature by possibly throwing SAX exceptions
- try {
- newSAXParserImpl();
- } catch (SAXNotSupportedException e) {
- features.remove(name);
- throw e;
- } catch (SAXNotRecognizedException e) {
- features.remove(name);
- throw e;
- }
- }
-
- /**
- * returns the particular property requested for in the underlying
- * implementation of org.xml.sax.XMLReader.
- */
- public boolean getFeature(String name)
- throws ParserConfigurationException, SAXNotRecognizedException,
- SAXNotSupportedException {
- if (name == null) {
- throw new NullPointerException();
- }
- if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
- return fSecureProcess;
- }
- // Check for valid name by creating a dummy XMLReader to get
- // feature value
- return newSAXParserImpl().getXMLReader().getFeature(name);
- }
-
- public Schema getSchema() {
- return grammar;
- }
-
- public void setSchema(Schema grammar) {
- this.grammar = grammar;
- }
-
- public boolean isXIncludeAware() {
- return getFromFeatures(XINCLUDE_FEATURE);
- }
-
- public void setXIncludeAware(boolean state) {
- putInFeatures(XINCLUDE_FEATURE, state);
- }
-
-
- public void setValidating(boolean validating) {
- putInFeatures(VALIDATION_FEATURE, validating);
- }
-
- public boolean isValidating() {
- return getFromFeatures(VALIDATION_FEATURE);
- }
-
- private void putInFeatures(String name, boolean value){
- if (features == null) {
- features = new HashMap<>();
- }
- features.put(name, value ? Boolean.TRUE : Boolean.FALSE);
- }
-
- private boolean getFromFeatures(String name){
- if (features == null){
- return false;
- }
- else {
- Boolean value = features.get(name);
- return (value == null) ? false : value;
- }
- }
-
- public boolean isNamespaceAware() {
- return getFromFeatures(NAMESPACES_FEATURE);
- }
-
- public void setNamespaceAware(boolean awareness) {
- putInFeatures(NAMESPACES_FEATURE, awareness);
- }
-
- }
diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java b/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java
deleted file mode 100644
index 19f82d5..0000000
--- a/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java
+++ /dev/null
@@ -1,738 +0,0 @@
-/*
- * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.jaxp;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.validation.ValidationManager;
-import com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator;
-import com.sun.org.apache.xerces.internal.jaxp.validation.XSGrammarPoolContainer;
-import com.sun.org.apache.xerces.internal.util.SAXMessageFormatter;
-import com.sun.org.apache.xerces.internal.util.Status;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager;
-import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponent;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration;
-import com.sun.org.apache.xerces.internal.xs.AttributePSVI;
-import com.sun.org.apache.xerces.internal.xs.ElementPSVI;
-import com.sun.org.apache.xerces.internal.xs.PSVIProvider;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Locale;
-import java.util.Map;
-import javax.xml.XMLConstants;
-import javax.xml.validation.Schema;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.HandlerBase;
-import org.xml.sax.InputSource;
-import org.xml.sax.Parser;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.helpers.DefaultHandler;
-
-/**
- * This is the implementation specific class for the
- * <code>javax.xml.parsers.SAXParser</code>.
- *
- * @author Rajiv Mordani
- * @author Edwin Goei
- *
- * @version $Id: SAXParserImpl.java,v 1.7 2010-11-01 04:40:06 joehw Exp $
- */
-public class SAXParserImpl extends javax.xml.parsers.SAXParser
- implements JAXPConstants, PSVIProvider {
-
- /** Feature identifier: namespaces. */
- private static final String NAMESPACES_FEATURE =
- Constants.SAX_FEATURE_PREFIX + Constants.NAMESPACES_FEATURE;
-
- /** Feature identifier: namespace prefixes. */
- private static final String NAMESPACE_PREFIXES_FEATURE =
- Constants.SAX_FEATURE_PREFIX + Constants.NAMESPACE_PREFIXES_FEATURE;
-
- /** Feature identifier: validation. */
- private static final String VALIDATION_FEATURE =
- Constants.SAX_FEATURE_PREFIX + Constants.VALIDATION_FEATURE;
-
- /** Feature identifier: XML Schema validation */
- private static final String XMLSCHEMA_VALIDATION_FEATURE =
- Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_VALIDATION_FEATURE;
-
- /** Feature identifier: XInclude processing */
- private static final String XINCLUDE_FEATURE =
- Constants.XERCES_FEATURE_PREFIX + Constants.XINCLUDE_FEATURE;
-
- /** Property identifier: security manager. */
- private static final String SECURITY_MANAGER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SECURITY_MANAGER_PROPERTY;
-
- /** Property identifier: Security property manager. */
- private static final String XML_SECURITY_PROPERTY_MANAGER =
- Constants.XML_SECURITY_PROPERTY_MANAGER;
-
- private final JAXPSAXParser xmlReader;
- private String schemaLanguage = null; // null means DTD
- private final Schema grammar;
-
- private final XMLComponent fSchemaValidator;
- private final XMLComponentManager fSchemaValidatorComponentManager;
- private final ValidationManager fSchemaValidationManager;
- private final UnparsedEntityHandler fUnparsedEntityHandler;
-
- /** Initial ErrorHandler */
- private final ErrorHandler fInitErrorHandler;
-
- /** Initial EntityResolver */
- private final EntityResolver fInitEntityResolver;
-
- private final XMLSecurityManager fSecurityManager;
- private final XMLSecurityPropertyManager fSecurityPropertyMgr;
-
- /**
- * Create a SAX parser with the associated features
- * @param features Map of SAX features, may be null
- */
- SAXParserImpl(SAXParserFactoryImpl spf, Map<String, Boolean> features)
- throws SAXException {
- this(spf, features, false);
- }
-
- /**
- * Create a SAX parser with the associated features
- * @param features Map of SAX features, may be null
- */
- SAXParserImpl(SAXParserFactoryImpl spf, Map<String, Boolean> features, boolean secureProcessing)
- throws SAXException
- {
- fSecurityManager = new XMLSecurityManager(secureProcessing);
- fSecurityPropertyMgr = new XMLSecurityPropertyManager();
- // Instantiate a SAXParser directly and not through SAX so that we use the right ClassLoader
- xmlReader = new JAXPSAXParser(this, fSecurityPropertyMgr, fSecurityManager);
-
- // JAXP "namespaceAware" == SAX Namespaces feature
- // Note: there is a compatibility problem here with default values:
- // JAXP default is false while SAX 2 default is true!
- xmlReader.setFeature0(NAMESPACES_FEATURE, spf.isNamespaceAware());
-
- // SAX "namespaces" and "namespace-prefixes" features should not
- // both be false. We make them opposite for backward compatibility
- // since JAXP 1.0 apps may want to receive xmlns* attributes.
- xmlReader.setFeature0(NAMESPACE_PREFIXES_FEATURE, !spf.isNamespaceAware());
-
- // Avoid setting the XInclude processing feature if the value is false.
- // This will keep the configuration from throwing an exception if it
- // does not support XInclude.
- if (spf.isXIncludeAware()) {
- xmlReader.setFeature0(XINCLUDE_FEATURE, true);
- }
-
- xmlReader.setProperty0(XML_SECURITY_PROPERTY_MANAGER, fSecurityPropertyMgr);
-
- xmlReader.setProperty0(SECURITY_MANAGER, fSecurityManager);
-
- if (secureProcessing) {
- /**
- * By default, secure processing is set, no external access is allowed.
- * However, we need to check if it is actively set on the factory since we
- * allow the use of the System Property or jaxp.properties to override
- * the default value
- */
- if (features != null) {
-
- Boolean temp = features.get(XMLConstants.FEATURE_SECURE_PROCESSING);
- if (temp != null) {
- if (temp && Constants.IS_JDK8_OR_ABOVE) {
- fSecurityPropertyMgr.setValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD,
- XMLSecurityPropertyManager.State.FSP, Constants.EXTERNAL_ACCESS_DEFAULT_FSP);
- fSecurityPropertyMgr.setValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_SCHEMA,
- XMLSecurityPropertyManager.State.FSP, Constants.EXTERNAL_ACCESS_DEFAULT_FSP);
-
- }
- }
- }
- }
-
- // Set application's features, followed by validation features.
- setFeatures(features);
-
- // If validating, provide a default ErrorHandler that prints
- // validation errors with a warning telling the user to set an
- // ErrorHandler.
- if (spf.isValidating()) {
- fInitErrorHandler = new DefaultValidationErrorHandler(xmlReader.getLocale());
- xmlReader.setErrorHandler(fInitErrorHandler);
- }
- else {
- fInitErrorHandler = xmlReader.getErrorHandler();
- }
- xmlReader.setFeature0(VALIDATION_FEATURE, spf.isValidating());
-
- // Get the Schema object from the factory
- this.grammar = spf.getSchema();
- if (grammar != null) {
- XMLParserConfiguration config = xmlReader.getXMLParserConfiguration();
- XMLComponent validatorComponent = null;
- /** For Xerces grammars, use built-in schema validator. **/
- if (grammar instanceof XSGrammarPoolContainer) {
- validatorComponent = new XMLSchemaValidator();
- fSchemaValidationManager = new ValidationManager();
- fUnparsedEntityHandler = new UnparsedEntityHandler(fSchemaValidationManager);
- config.setDTDHandler(fUnparsedEntityHandler);
- fUnparsedEntityHandler.setDTDHandler(xmlReader);
- xmlReader.setDTDSource(fUnparsedEntityHandler);
- fSchemaValidatorComponentManager = new SchemaValidatorConfiguration(config,
- (XSGrammarPoolContainer) grammar, fSchemaValidationManager);
- }
- /** For third party grammars, use the JAXP validator component. **/
- else {
- validatorComponent = new JAXPValidatorComponent(grammar.newValidatorHandler());
- fSchemaValidationManager = null;
- fUnparsedEntityHandler = null;
- fSchemaValidatorComponentManager = config;
- }
- config.addRecognizedFeatures(validatorComponent.getRecognizedFeatures());
- config.addRecognizedProperties(validatorComponent.getRecognizedProperties());
- config.setDocumentHandler((XMLDocumentHandler) validatorComponent);
- ((XMLDocumentSource)validatorComponent).setDocumentHandler(xmlReader);
- xmlReader.setDocumentSource((XMLDocumentSource) validatorComponent);
- fSchemaValidator = validatorComponent;
- }
- else {
- fSchemaValidationManager = null;
- fUnparsedEntityHandler = null;
- fSchemaValidatorComponentManager = null;
- fSchemaValidator = null;
- }
-
- // Initial EntityResolver
- fInitEntityResolver = xmlReader.getEntityResolver();
- }
-
- /**
- * Set any features of our XMLReader based on any features set on the
- * SAXParserFactory.
- *
- * XXX Does not handle possible conflicts between SAX feature names and
- * JAXP specific feature names, eg. SAXParserFactory.isValidating()
- */
- private void setFeatures(Map<String, Boolean> features)
- throws SAXNotSupportedException, SAXNotRecognizedException {
- if (features != null) {
- for (Map.Entry<String, Boolean> entry : features.entrySet()) {
- xmlReader.setFeature0(entry.getKey(), entry.getValue());
- }
- }
- }
-
- public Parser getParser() throws SAXException {
- // Xerces2 AbstractSAXParser implements SAX1 Parser
- // assert(xmlReader instanceof Parser);
- return (Parser) xmlReader;
- }
-
- /**
- * Returns the XMLReader that is encapsulated by the implementation of
- * this class.
- */
- public XMLReader getXMLReader() {
- return xmlReader;
- }
-
- public boolean isNamespaceAware() {
- try {
- return xmlReader.getFeature(NAMESPACES_FEATURE);
- }
- catch (SAXException x) {
- throw new IllegalStateException(x.getMessage());
- }
- }
-
- public boolean isValidating() {
- try {
- return xmlReader.getFeature(VALIDATION_FEATURE);
- }
- catch (SAXException x) {
- throw new IllegalStateException(x.getMessage());
- }
- }
-
- /**
- * Gets the XInclude processing mode for this parser
- * @return the state of XInclude processing mode
- */
- public boolean isXIncludeAware() {
- try {
- return xmlReader.getFeature(XINCLUDE_FEATURE);
- }
- catch (SAXException exc) {
- return false;
- }
- }
-
- /**
- * Sets the particular property in the underlying implementation of
- * org.xml.sax.XMLReader.
- */
- public void setProperty(String name, Object value)
- throws SAXNotRecognizedException, SAXNotSupportedException {
- xmlReader.setProperty(name, value);
- }
-
- /**
- * returns the particular property requested for in the underlying
- * implementation of org.xml.sax.XMLReader.
- */
- public Object getProperty(String name)
- throws SAXNotRecognizedException, SAXNotSupportedException {
- return xmlReader.getProperty(name);
- }
-
- public void parse(InputSource is, DefaultHandler dh)
- throws SAXException, IOException {
- if (is == null) {
- throw new IllegalArgumentException();
- }
- if (dh != null) {
- xmlReader.setContentHandler(dh);
- xmlReader.setEntityResolver(dh);
- xmlReader.setErrorHandler(dh);
- xmlReader.setDTDHandler(dh);
- xmlReader.setDocumentHandler(null);
- }
- xmlReader.parse(is);
- }
-
- public void parse(InputSource is, HandlerBase hb)
- throws SAXException, IOException {
- if (is == null) {
- throw new IllegalArgumentException();
- }
- if (hb != null) {
- xmlReader.setDocumentHandler(hb);
- xmlReader.setEntityResolver(hb);
- xmlReader.setErrorHandler(hb);
- xmlReader.setDTDHandler(hb);
- xmlReader.setContentHandler(null);
- }
- xmlReader.parse(is);
- }
-
- public Schema getSchema() {
- return grammar;
- }
-
- public void reset() {
- try {
- /** Restore initial values of features and properties. **/
- xmlReader.restoreInitState();
- }
- catch (SAXException exc) {
- // This should never happen. We only store recognized
- // features and properties in the hash maps. For now
- // just ignore it.
- }
- /** Restore various handlers. **/
- xmlReader.setContentHandler(null);
- xmlReader.setDTDHandler(null);
- if (xmlReader.getErrorHandler() != fInitErrorHandler) {
- xmlReader.setErrorHandler(fInitErrorHandler);
- }
- if (xmlReader.getEntityResolver() != fInitEntityResolver) {
- xmlReader.setEntityResolver(fInitEntityResolver);
- }
- }
-
- /*
- * PSVIProvider methods
- */
-
- public ElementPSVI getElementPSVI() {
- return ((PSVIProvider)xmlReader).getElementPSVI();
- }
-
- public AttributePSVI getAttributePSVI(int index) {
- return ((PSVIProvider)xmlReader).getAttributePSVI(index);
- }
-
- public AttributePSVI getAttributePSVIByName(String uri, String localname) {
- return ((PSVIProvider)xmlReader).getAttributePSVIByName(uri, localname);
- }
-
- /**
- * Extension of SAXParser. This class tracks changes to
- * features and properties to allow the parser to be reset to
- * its initial state.
- */
- public static class JAXPSAXParser extends com.sun.org.apache.xerces.internal.parsers.SAXParser {
-
- private final HashMap fInitFeatures = new HashMap();
- private final HashMap fInitProperties = new HashMap();
- private final SAXParserImpl fSAXParser;
- private XMLSecurityManager fSecurityManager;
- private XMLSecurityPropertyManager fSecurityPropertyMgr;
-
-
- public JAXPSAXParser() {
- this(null, null, null);
- }
-
- JAXPSAXParser(SAXParserImpl saxParser, XMLSecurityPropertyManager securityPropertyMgr,
- XMLSecurityManager securityManager) {
- super();
- fSAXParser = saxParser;
- fSecurityManager = securityManager;
- fSecurityPropertyMgr = securityPropertyMgr;
- /**
- * This class may be used directly. So initialize the security manager if
- * it is null.
- */
- if (fSecurityManager == null) {
- fSecurityManager = new XMLSecurityManager(true);
- try {
- super.setProperty(SECURITY_MANAGER, fSecurityManager);
- } catch (SAXException e) {
- throw new UnsupportedOperationException(
- SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
- "property-not-recognized", new Object [] {SECURITY_MANAGER}), e);
- }
- }
- if (fSecurityPropertyMgr == null) {
- fSecurityPropertyMgr = new XMLSecurityPropertyManager();
- try {
- super.setProperty(XML_SECURITY_PROPERTY_MANAGER, fSecurityPropertyMgr);
- } catch (SAXException e) {
- throw new UnsupportedOperationException(
- SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
- "property-not-recognized", new Object [] {SECURITY_MANAGER}), e);
- }
- }
- }
-
- /**
- * Override SAXParser's setFeature method to track the initial state
- * of features. This keeps us from affecting the performance of the
- * SAXParser when it is created with XMLReaderFactory.
- */
- public synchronized void setFeature(String name, boolean value)
- throws SAXNotRecognizedException, SAXNotSupportedException {
- if (name == null) {
- // TODO: Add localized error message.
- throw new NullPointerException();
- }
- if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
- try {
- fSecurityManager.setSecureProcessing(value);
- setProperty(SECURITY_MANAGER, fSecurityManager);
- }
- catch (SAXNotRecognizedException exc) {
- // If the property is not supported
- // re-throw the exception if the value is true.
- if (value) {
- throw exc;
- }
- }
- catch (SAXNotSupportedException exc) {
- // If the property is not supported
- // re-throw the exception if the value is true.
- if (value) {
- throw exc;
- }
- }
- return;
- }
- if (!fInitFeatures.containsKey(name)) {
- boolean current = super.getFeature(name);
- fInitFeatures.put(name, current ? Boolean.TRUE : Boolean.FALSE);
- }
- /** Forward feature to the schema validator if there is one. **/
- if (fSAXParser != null && fSAXParser.fSchemaValidator != null) {
- setSchemaValidatorFeature(name, value);
- }
- super.setFeature(name, value);
- }
-
- public synchronized boolean getFeature(String name)
- throws SAXNotRecognizedException, SAXNotSupportedException {
- if (name == null) {
- // TODO: Add localized error message.
- throw new NullPointerException();
- }
- if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
- return fSecurityManager.isSecureProcessing();
- }
- return super.getFeature(name);
- }
-
- /**
- * Override SAXParser's setProperty method to track the initial state
- * of properties. This keeps us from affecting the performance of the
- * SAXParser when it is created with XMLReaderFactory.
- */
- public synchronized void setProperty(String name, Object value)
- throws SAXNotRecognizedException, SAXNotSupportedException {
- if (name == null) {
- // TODO: Add localized error message.
- throw new NullPointerException();
- }
- if (fSAXParser != null) {
- // JAXP 1.2 support
- if (JAXP_SCHEMA_LANGUAGE.equals(name)) {
- // The spec says if a schema is given via SAXParserFactory
- // the JAXP 1.2 properties shouldn't be allowed.
- if (fSAXParser.grammar != null) {
- throw new SAXNotSupportedException(
- SAXMessageFormatter.formatMessage(fConfiguration.getLocale(), "schema-already-specified", new Object[] {name}));
- }
- if ( W3C_XML_SCHEMA.equals(value) ) {
- //None of the properties will take effect till the setValidating(true) has been called
- if( fSAXParser.isValidating() ) {
- fSAXParser.schemaLanguage = W3C_XML_SCHEMA;
- setFeature(XMLSCHEMA_VALIDATION_FEATURE, true);
- // this will allow the parser not to emit DTD-related
- // errors, as the spec demands
- if (!fInitProperties.containsKey(JAXP_SCHEMA_LANGUAGE)) {
- fInitProperties.put(JAXP_SCHEMA_LANGUAGE, super.getProperty(JAXP_SCHEMA_LANGUAGE));
- }
- super.setProperty(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
- }
-
- }
- else if (value == null) {
- fSAXParser.schemaLanguage = null;
- setFeature(XMLSCHEMA_VALIDATION_FEATURE, false);
- }
- else {
- // REVISIT: It would be nice if we could format this message
- // using a user specified locale as we do in the underlying
- // XMLReader -- mrglavas
- throw new SAXNotSupportedException(
- SAXMessageFormatter.formatMessage(fConfiguration.getLocale(), "schema-not-supported", null));
- }
- return;
- }
- else if (JAXP_SCHEMA_SOURCE.equals(name)) {
- // The spec says if a schema is given via SAXParserFactory
- // the JAXP 1.2 properties shouldn't be allowed.
- if (fSAXParser.grammar != null) {
- throw new SAXNotSupportedException(
- SAXMessageFormatter.formatMessage(fConfiguration.getLocale(), "schema-already-specified", new Object[] {name}));
- }
- String val = (String)getProperty(JAXP_SCHEMA_LANGUAGE);
- if ( val != null && W3C_XML_SCHEMA.equals(val) ) {
- if (!fInitProperties.containsKey(JAXP_SCHEMA_SOURCE)) {
- fInitProperties.put(JAXP_SCHEMA_SOURCE, super.getProperty(JAXP_SCHEMA_SOURCE));
- }
- super.setProperty(name, value);
- }
- else {
- throw new SAXNotSupportedException(
- SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
- "jaxp-order-not-supported",
- new Object[] {JAXP_SCHEMA_LANGUAGE, JAXP_SCHEMA_SOURCE}));
- }
- return;
- }
- }
- /** Forward property to the schema validator if there is one. **/
- if (fSAXParser != null && fSAXParser.fSchemaValidator != null) {
- setSchemaValidatorProperty(name, value);
- }
-
- //check if the property is managed by security manager
- if (fSecurityManager == null ||
- !fSecurityManager.setLimit(name, XMLSecurityManager.State.APIPROPERTY, value)) {
- //check if the property is managed by security property manager
- if (fSecurityPropertyMgr == null ||
- !fSecurityPropertyMgr.setValue(name, XMLSecurityPropertyManager.State.APIPROPERTY, value)) {
- //fall back to the existing property manager
- if (!fInitProperties.containsKey(name)) {
- fInitProperties.put(name, super.getProperty(name));
- }
- super.setProperty(name, value);
- }
- }
-
- }
-
- public synchronized Object getProperty(String name)
- throws SAXNotRecognizedException, SAXNotSupportedException {
- if (name == null) {
- // TODO: Add localized error message.
- throw new NullPointerException();
- }
- if (fSAXParser != null && JAXP_SCHEMA_LANGUAGE.equals(name)) {
- // JAXP 1.2 support
- return fSAXParser.schemaLanguage;
- }
-
- /** Check to see if the property is managed by the security manager **/
- String propertyValue = (fSecurityManager != null) ?
- fSecurityManager.getLimitAsString(name) : null;
- if (propertyValue != null) {
- return propertyValue;
- } else {
- propertyValue = (fSecurityPropertyMgr != null) ?
- fSecurityPropertyMgr.getValue(name) : null;
- if (propertyValue != null) {
- return propertyValue;
- }
- }
-
- return super.getProperty(name);
- }
-
- synchronized void restoreInitState()
- throws SAXNotRecognizedException, SAXNotSupportedException {
- Iterator iter;
- if (!fInitFeatures.isEmpty()) {
- iter = fInitFeatures.entrySet().iterator();
- while (iter.hasNext()) {
- Map.Entry entry = (Map.Entry) iter.next();
- String name = (String) entry.getKey();
- boolean value = ((Boolean) entry.getValue()).booleanValue();
- super.setFeature(name, value);
- }
- fInitFeatures.clear();
- }
- if (!fInitProperties.isEmpty()) {
- iter = fInitProperties.entrySet().iterator();
- while (iter.hasNext()) {
- Map.Entry entry = (Map.Entry) iter.next();
- String name = (String) entry.getKey();
- Object value = entry.getValue();
- super.setProperty(name, value);
- }
- fInitProperties.clear();
- }
- }
-
- public void parse(InputSource inputSource)
- throws SAXException, IOException {
- if (fSAXParser != null && fSAXParser.fSchemaValidator != null) {
- if (fSAXParser.fSchemaValidationManager != null) {
- fSAXParser.fSchemaValidationManager.reset();
- fSAXParser.fUnparsedEntityHandler.reset();
- }
- resetSchemaValidator();
- }
- super.parse(inputSource);
- }
-
- public void parse(String systemId)
- throws SAXException, IOException {
- if (fSAXParser != null && fSAXParser.fSchemaValidator != null) {
- if (fSAXParser.fSchemaValidationManager != null) {
- fSAXParser.fSchemaValidationManager.reset();
- fSAXParser.fUnparsedEntityHandler.reset();
- }
- resetSchemaValidator();
- }
- super.parse(systemId);
- }
-
- XMLParserConfiguration getXMLParserConfiguration() {
- return fConfiguration;
- }
-
- void setFeature0(String name, boolean value)
- throws SAXNotRecognizedException, SAXNotSupportedException {
- super.setFeature(name, value);
- }
-
- boolean getFeature0(String name)
- throws SAXNotRecognizedException, SAXNotSupportedException {
- return super.getFeature(name);
- }
-
- void setProperty0(String name, Object value)
- throws SAXNotRecognizedException, SAXNotSupportedException {
- super.setProperty(name, value);
- }
-
- Object getProperty0(String name)
- throws SAXNotRecognizedException, SAXNotSupportedException {
- return super.getProperty(name);
- }
-
- Locale getLocale() {
- return fConfiguration.getLocale();
- }
-
- private void setSchemaValidatorFeature(String name, boolean value)
- throws SAXNotRecognizedException, SAXNotSupportedException {
- try {
- fSAXParser.fSchemaValidator.setFeature(name, value);
- }
- // This should never be thrown from the schema validator.
- catch (XMLConfigurationException e) {
- String identifier = e.getIdentifier();
- if (e.getType() == Status.NOT_RECOGNIZED) {
- throw new SAXNotRecognizedException(
- SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
- "feature-not-recognized", new Object [] {identifier}));
- }
- else {
- throw new SAXNotSupportedException(
- SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
- "feature-not-supported", new Object [] {identifier}));
- }
- }
- }
-
- private void setSchemaValidatorProperty(String name, Object value)
- throws SAXNotRecognizedException, SAXNotSupportedException {
- try {
- fSAXParser.fSchemaValidator.setProperty(name, value);
- }
- // This should never be thrown from the schema validator.
- catch (XMLConfigurationException e) {
- String identifier = e.getIdentifier();
- if (e.getType() == Status.NOT_RECOGNIZED) {
- throw new SAXNotRecognizedException(
- SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
- "property-not-recognized", new Object [] {identifier}));
- }
- else {
- throw new SAXNotSupportedException(
- SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
- "property-not-supported", new Object [] {identifier}));
- }
- }
- }
-
- private void resetSchemaValidator() throws SAXException {
- try {
- fSAXParser.fSchemaValidator.reset(fSAXParser.fSchemaValidatorComponentManager);
- }
- // This should never be thrown from the schema validator.
- catch (XMLConfigurationException e) {
- throw new SAXException(e);
- }
- }
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/SchemaValidatorConfiguration.java b/src/com/sun/org/apache/xerces/internal/jaxp/SchemaValidatorConfiguration.java
deleted file mode 100644
index 9ef80be..0000000
--- a/src/com/sun/org/apache/xerces/internal/jaxp/SchemaValidatorConfiguration.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.jaxp;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
-import com.sun.org.apache.xerces.internal.impl.validation.ValidationManager;
-import com.sun.org.apache.xerces.internal.impl.xs.XSMessageFormatter;
-import com.sun.org.apache.xerces.internal.jaxp.validation.XSGrammarPoolContainer;
-import com.sun.org.apache.xerces.internal.util.FeatureState;
-import com.sun.org.apache.xerces.internal.util.PropertyState;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-
-/**
- * <p>Parser configuration for Xerces' XMLSchemaValidator.</p>
- *
- * @version $Id: SchemaValidatorConfiguration.java,v 1.5 2010-11-01 04:40:06 joehw Exp $
- */
-final class SchemaValidatorConfiguration implements XMLComponentManager {
-
- // feature identifiers
-
- /** Feature identifier: schema validation. */
- private static final String SCHEMA_VALIDATION =
- Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_VALIDATION_FEATURE;
-
- /** Feature identifier: validation. */
- private static final String VALIDATION =
- Constants.SAX_FEATURE_PREFIX + Constants.VALIDATION_FEATURE;
-
- /** Feature identifier: use grammar pool only. */
- private static final String USE_GRAMMAR_POOL_ONLY =
- Constants.XERCES_FEATURE_PREFIX + Constants.USE_GRAMMAR_POOL_ONLY_FEATURE;
-
- /** Feature identifier: parser settings. */
- private static final String PARSER_SETTINGS =
- Constants.XERCES_FEATURE_PREFIX + Constants.PARSER_SETTINGS;
-
- // property identifiers
-
- /** Property identifier: error reporter. */
- private static final String ERROR_REPORTER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY;
-
- /** Property identifier: validation manager. */
- private static final String VALIDATION_MANAGER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.VALIDATION_MANAGER_PROPERTY;
-
- /** Property identifier: grammar pool. */
- private static final String XMLGRAMMAR_POOL =
- Constants.XERCES_PROPERTY_PREFIX + Constants.XMLGRAMMAR_POOL_PROPERTY;
-
- //
- // Data
- //
-
- /** Parent component manager. **/
- private final XMLComponentManager fParentComponentManager;
-
- /** The Schema's grammar pool. **/
- private final XMLGrammarPool fGrammarPool;
-
- /**
- * Tracks whether the validator should use components from
- * the grammar pool to the exclusion of all others.
- */
- private final boolean fUseGrammarPoolOnly;
-
- /** Validation manager. */
- private final ValidationManager fValidationManager;
-
- public SchemaValidatorConfiguration(XMLComponentManager parentManager,
- XSGrammarPoolContainer grammarContainer, ValidationManager validationManager) {
- fParentComponentManager = parentManager;
- fGrammarPool = grammarContainer.getGrammarPool();
- fUseGrammarPoolOnly = grammarContainer.isFullyComposed();
- fValidationManager = validationManager;
- // add schema message formatter to error reporter
- try {
- XMLErrorReporter errorReporter = (XMLErrorReporter) fParentComponentManager.getProperty(ERROR_REPORTER);
- if (errorReporter != null) {
- errorReporter.putMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN, new XSMessageFormatter());
- }
- }
- // Ignore exception.
- catch (XMLConfigurationException exc) {}
- }
-
- /**
- * Returns the state of a feature.
- *
- * @param featureId The feature identifier.
- * @return true if the feature is supported
- *
- * @throws XMLConfigurationException Thrown for configuration error.
- * In general, components should
- * only throw this exception if
- * it is <strong>really</strong>
- * a critical error.
- */
- public boolean getFeature(String featureId)
- throws XMLConfigurationException {
- FeatureState state = getFeatureState(featureId);
- if (state.isExceptional()) {
- throw new XMLConfigurationException(state.status, featureId);
- }
- return state.state;
- }
-
- public FeatureState getFeatureState(String featureId) {
- if (PARSER_SETTINGS.equals(featureId)) {
- return fParentComponentManager.getFeatureState(featureId);
- }
- else if (VALIDATION.equals(featureId) || SCHEMA_VALIDATION.equals(featureId)) {
- return FeatureState.is(true);
- }
- else if (USE_GRAMMAR_POOL_ONLY.equals(featureId)) {
- return FeatureState.is(fUseGrammarPoolOnly);
- }
- return fParentComponentManager.getFeatureState(featureId);
- }
-
- public PropertyState getPropertyState(String propertyId) {
- if (XMLGRAMMAR_POOL.equals(propertyId)) {
- return PropertyState.is(fGrammarPool);
- }
- else if (VALIDATION_MANAGER.equals(propertyId)) {
- return PropertyState.is(fValidationManager);
- }
- return fParentComponentManager.getPropertyState(propertyId);
- }
-
- /**
- * Returns the value of a property.
- *
- * @param propertyId The property identifier.
- * @return the value of the property
- *
- * @throws XMLConfigurationException Thrown for configuration error.
- * In general, components should
- * only throw this exception if
- * it is <strong>really</strong>
- * a critical error.
- */
- public Object getProperty(String propertyId)
- throws XMLConfigurationException {
- PropertyState state = getPropertyState(propertyId);
- if (state.isExceptional()) {
- throw new XMLConfigurationException(state.status, propertyId);
- }
- return state.state;
- }
-
- public boolean getFeature(String featureId, boolean defaultValue) {
- FeatureState state = getFeatureState(featureId);
- if (state.isExceptional()) {
- return defaultValue;
- }
- return state.state;
- }
-
- public Object getProperty(String propertyId, Object defaultValue) {
- PropertyState state = getPropertyState(propertyId);
- if (state.isExceptional()) {
- return defaultValue;
- }
- return state.state;
- }
-
-
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/TeeXMLDocumentFilterImpl.java b/src/com/sun/org/apache/xerces/internal/jaxp/TeeXMLDocumentFilterImpl.java
deleted file mode 100644
index 696717a..0000000
--- a/src/com/sun/org/apache/xerces/internal/jaxp/TeeXMLDocumentFilterImpl.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.jaxp;
-
-import com.sun.org.apache.xerces.internal.xni.Augmentations;
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
-import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLLocator;
-import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
-import com.sun.org.apache.xerces.internal.xni.XMLString;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentFilter;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource;
-
-/**
- * <p>XMLDocumentHandler which forks the pipeline to two other components.</p>
- *
- * @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
- */
-class TeeXMLDocumentFilterImpl implements XMLDocumentFilter {
-
- /**
- * The next component in the pipeline who receives the event.
- * This component receives events after the "side" handler
- * receives them.
- */
- private XMLDocumentHandler next;
-
- /**
- * The component who intercepts events.
- */
- private XMLDocumentHandler side;
-
- /**
- * The source of the event.
- */
- private XMLDocumentSource source;
-
- public XMLDocumentHandler getSide() {
- return side;
- }
-
- public void setSide(XMLDocumentHandler side) {
- this.side = side;
- }
-
- public XMLDocumentSource getDocumentSource() {
- return source;
- }
-
- public void setDocumentSource(XMLDocumentSource source) {
- this.source = source;
- }
-
- public XMLDocumentHandler getDocumentHandler() {
- return next;
- }
-
- public void setDocumentHandler(XMLDocumentHandler handler) {
- next = handler;
- }
-
- //
- //
- // XMLDocumentHandler implementation
- //
- //
-
- public void characters(XMLString text, Augmentations augs) throws XNIException {
- side.characters(text, augs);
- next.characters(text, augs);
- }
-
- public void comment(XMLString text, Augmentations augs) throws XNIException {
- side.comment(text, augs);
- next.comment(text, augs);
- }
-
- public void doctypeDecl(String rootElement, String publicId, String systemId, Augmentations augs)
- throws XNIException {
- side.doctypeDecl(rootElement, publicId, systemId, augs);
- next.doctypeDecl(rootElement, publicId, systemId, augs);
- }
-
- public void emptyElement(QName element, XMLAttributes attributes, Augmentations augs) throws XNIException {
- side.emptyElement(element, attributes, augs);
- next.emptyElement(element, attributes, augs);
- }
-
- public void endCDATA(Augmentations augs) throws XNIException {
- side.endCDATA(augs);
- next.endCDATA(augs);
- }
-
- public void endDocument(Augmentations augs) throws XNIException {
- side.endDocument(augs);
- next.endDocument(augs);
- }
-
- public void endElement(QName element, Augmentations augs) throws XNIException {
- side.endElement(element, augs);
- next.endElement(element, augs);
- }
-
- public void endGeneralEntity(String name, Augmentations augs) throws XNIException {
- side.endGeneralEntity(name, augs);
- next.endGeneralEntity(name, augs);
- }
-
- public void ignorableWhitespace(XMLString text, Augmentations augs) throws XNIException {
- side.ignorableWhitespace(text, augs);
- next.ignorableWhitespace(text, augs);
- }
-
- public void processingInstruction(String target, XMLString data, Augmentations augs) throws XNIException {
- side.processingInstruction(target, data, augs);
- next.processingInstruction(target, data, augs);
- }
-
- public void startCDATA(Augmentations augs) throws XNIException {
- side.startCDATA(augs);
- next.startCDATA(augs);
- }
-
- public void startDocument(
- XMLLocator locator,
- String encoding,
- NamespaceContext namespaceContext,
- Augmentations augs)
- throws XNIException {
- side.startDocument(locator, encoding, namespaceContext, augs);
- next.startDocument(locator, encoding, namespaceContext, augs);
- }
-
- public void startElement(QName element, XMLAttributes attributes, Augmentations augs) throws XNIException {
- side.startElement(element, attributes, augs);
- next.startElement(element, attributes, augs);
- }
-
- public void startGeneralEntity(String name, XMLResourceIdentifier identifier, String encoding, Augmentations augs)
- throws XNIException {
- side.startGeneralEntity(name, identifier, encoding, augs);
- next.startGeneralEntity(name, identifier, encoding, augs);
- }
-
- public void textDecl(String version, String encoding, Augmentations augs) throws XNIException {
- side.textDecl(version, encoding, augs);
- next.textDecl(version, encoding, augs);
- }
-
- public void xmlDecl(String version, String encoding, String standalone, Augmentations augs) throws XNIException {
- side.xmlDecl(version, encoding, standalone, augs);
- next.xmlDecl(version, encoding, standalone, augs);
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/UnparsedEntityHandler.java b/src/com/sun/org/apache/xerces/internal/jaxp/UnparsedEntityHandler.java
deleted file mode 100644
index 5714da3..0000000
--- a/src/com/sun/org/apache/xerces/internal/jaxp/UnparsedEntityHandler.java
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.jaxp;
-
-import java.util.HashMap;
-
-import com.sun.org.apache.xerces.internal.impl.validation.EntityState;
-import com.sun.org.apache.xerces.internal.impl.validation.ValidationManager;
-import com.sun.org.apache.xerces.internal.xni.Augmentations;
-import com.sun.org.apache.xerces.internal.xni.XMLDTDHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLLocator;
-import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
-import com.sun.org.apache.xerces.internal.xni.XMLString;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDFilter;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDSource;
-
-/**
- * <p>This filter records which unparsed entities have been
- * declared in the DTD and provides this information to a ValidationManager.
- * Events are forwarded to the registered XMLDTDHandler without modification.</p>
- *
- * @author Michael Glavassevich, IBM
- * @version $Id: UnparsedEntityHandler.java,v 1.6 2010-11-01 04:40:07 joehw Exp $
- */
-final class UnparsedEntityHandler implements XMLDTDFilter, EntityState {
-
- /** DTD source and handler. **/
- private XMLDTDSource fDTDSource;
- private XMLDTDHandler fDTDHandler;
-
- /** Validation manager. */
- private final ValidationManager fValidationManager;
-
- /** Map for tracking unparsed entities. */
- private HashMap fUnparsedEntities = null;
-
- UnparsedEntityHandler(ValidationManager manager) {
- fValidationManager = manager;
- }
-
- /*
- * XMLDTDHandler methods
- */
-
- public void startDTD(XMLLocator locator, Augmentations augmentations)
- throws XNIException {
- fValidationManager.setEntityState(this);
- if (fDTDHandler != null) {
- fDTDHandler.startDTD(locator, augmentations);
- }
- }
-
- public void startParameterEntity(String name,
- XMLResourceIdentifier identifier, String encoding,
- Augmentations augmentations) throws XNIException {
- if (fDTDHandler != null) {
- fDTDHandler.startParameterEntity(name, identifier, encoding, augmentations);
- }
- }
-
- public void textDecl(String version, String encoding,
- Augmentations augmentations) throws XNIException {
- if (fDTDHandler != null) {
- fDTDHandler.textDecl(version, encoding, augmentations);
- }
- }
-
- public void endParameterEntity(String name, Augmentations augmentations)
- throws XNIException {
- if (fDTDHandler != null) {
- fDTDHandler.endParameterEntity(name, augmentations);
- }
- }
-
- public void startExternalSubset(XMLResourceIdentifier identifier,
- Augmentations augmentations) throws XNIException {
- if (fDTDHandler != null) {
- fDTDHandler.startExternalSubset(identifier, augmentations);
- }
- }
-
- public void endExternalSubset(Augmentations augmentations)
- throws XNIException {
- if (fDTDHandler != null) {
- fDTDHandler.endExternalSubset(augmentations);
- }
- }
-
- public void comment(XMLString text, Augmentations augmentations)
- throws XNIException {
- if (fDTDHandler != null) {
- fDTDHandler.comment(text, augmentations);
- }
- }
-
- public void processingInstruction(String target, XMLString data,
- Augmentations augmentations) throws XNIException {
- if (fDTDHandler != null) {
- fDTDHandler.processingInstruction(target, data, augmentations);
- }
- }
-
- public void elementDecl(String name, String contentModel,
- Augmentations augmentations) throws XNIException {
- if (fDTDHandler != null) {
- fDTDHandler.elementDecl(name, contentModel, augmentations);
- }
- }
-
- public void startAttlist(String elementName, Augmentations augmentations)
- throws XNIException {
- if (fDTDHandler != null) {
- fDTDHandler.startAttlist(elementName, augmentations);
- }
- }
-
- public void attributeDecl(String elementName, String attributeName,
- String type, String[] enumeration, String defaultType,
- XMLString defaultValue, XMLString nonNormalizedDefaultValue,
- Augmentations augmentations) throws XNIException {
- if (fDTDHandler != null) {
- fDTDHandler.attributeDecl(elementName, attributeName,
- type, enumeration, defaultType,
- defaultValue, nonNormalizedDefaultValue,
- augmentations);
- }
- }
-
- public void endAttlist(Augmentations augmentations) throws XNIException {
- if (fDTDHandler != null) {
- fDTDHandler.endAttlist(augmentations);
- }
- }
-
- public void internalEntityDecl(String name, XMLString text,
- XMLString nonNormalizedText, Augmentations augmentations)
- throws XNIException {
- if (fDTDHandler != null) {
- fDTDHandler.internalEntityDecl(name, text,
- nonNormalizedText, augmentations);
- }
- }
-
- public void externalEntityDecl(String name,
- XMLResourceIdentifier identifier, Augmentations augmentations)
- throws XNIException {
- if (fDTDHandler != null) {
- fDTDHandler.externalEntityDecl(name, identifier, augmentations);
- }
- }
-
- public void unparsedEntityDecl(String name,
- XMLResourceIdentifier identifier, String notation,
- Augmentations augmentations) throws XNIException {
- if (fUnparsedEntities == null) {
- fUnparsedEntities = new HashMap();
- }
- fUnparsedEntities.put(name, name);
- if (fDTDHandler != null) {
- fDTDHandler.unparsedEntityDecl(name, identifier, notation, augmentations);
- }
- }
-
- public void notationDecl(String name, XMLResourceIdentifier identifier,
- Augmentations augmentations) throws XNIException {
- if (fDTDHandler != null) {
- fDTDHandler.notationDecl(name, identifier, augmentations);
- }
- }
-
- public void startConditional(short type, Augmentations augmentations)
- throws XNIException {
- if (fDTDHandler != null) {
- fDTDHandler.startConditional(type, augmentations);
- }
- }
-
- public void ignoredCharacters(XMLString text, Augmentations augmentations)
- throws XNIException {
- if (fDTDHandler != null) {
- fDTDHandler.ignoredCharacters(text, augmentations);
- }
-
- }
-
- public void endConditional(Augmentations augmentations) throws XNIException {
- if (fDTDHandler != null) {
- fDTDHandler.endConditional(augmentations);
- }
- }
-
- public void endDTD(Augmentations augmentations) throws XNIException {
- if (fDTDHandler != null) {
- fDTDHandler.endDTD(augmentations);
- }
- }
-
- public void setDTDSource(XMLDTDSource source) {
- fDTDSource = source;
- }
-
- public XMLDTDSource getDTDSource() {
- return fDTDSource;
- }
-
- /*
- * XMLDTDSource methods
- */
-
- public void setDTDHandler(XMLDTDHandler handler) {
- fDTDHandler = handler;
- }
-
- public XMLDTDHandler getDTDHandler() {
- return fDTDHandler;
- }
-
- /*
- * EntityState methods
- */
-
- public boolean isEntityDeclared(String name) {
- return false;
- }
-
- public boolean isEntityUnparsed(String name) {
- if (fUnparsedEntities != null) {
- return fUnparsedEntities.containsKey(name);
- }
- return false;
- }
-
- /*
- * Other methods
- */
-
- public void reset() {
- if (fUnparsedEntities != null && !fUnparsedEntities.isEmpty()) {
- // should only clear this if the last document contained unparsed entities
- fUnparsedEntities.clear();
- }
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/datatype/DatatypeFactoryImpl.java b/src/com/sun/org/apache/xerces/internal/jaxp/datatype/DatatypeFactoryImpl.java
deleted file mode 100644
index 59497a4..0000000
--- a/src/com/sun/org/apache/xerces/internal/jaxp/datatype/DatatypeFactoryImpl.java
+++ /dev/null
@@ -1,652 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.jaxp.datatype;
-
-import java.math.BigInteger;
-import java.math.BigDecimal;
-import java.util.GregorianCalendar;
-
-import javax.xml.datatype.DatatypeConstants;
-import javax.xml.datatype.DatatypeFactory;
-import javax.xml.datatype.Duration;
-import javax.xml.datatype.XMLGregorianCalendar;
-
-/**
- * <p>Factory that creates new <code>javax.xml.datatype</code> <code>Object</code>s that map XML to/from Java <code>Object</code>s.</p>
- *
- * <p id="DatatypeFactory.newInstance">{@link #newInstance()} is used to create a new <code>DatatypeFactory</code>.
- * The following implementation resolution mechanisms are used in the following order:</p>
- * <ol>
- * <li>
- * If the system property specified by {@link #DATATYPEFACTORY_PROPERTY}, "<code>javax.xml.datatype.DatatypeFactory</code>",
- * exists, a class with the name of the property's value is instantiated.
- * Any Exception thrown during the instantiation process is wrapped as a {@link DatatypeConfigurationException}.
- * </li>
- * <li>
- * If the file ${JAVA_HOME}/lib/jaxp.properties exists, it is loaded in a {@link java.util.Properties} <code>Object</code>.
- * The <code>Properties</code> <code>Object </code> is then queried for the property as documented in the prior step
- * and processed as documented in the prior step.
- * </li>
- * <li>
- * The services resolution mechanism is used, e.g. <code>META-INF/services/java.xml.datatype.DatatypeFactory</code>.
- * Any Exception thrown during the instantiation process is wrapped as a {@link DatatypeConfigurationException}.
- * </li>
- * <li>
- * The final mechanism is to attempt to instantiate the <code>Class</code> specified by
- * {@link #DATATYPEFACTORY_IMPLEMENTATION_CLASS}, "<code>javax.xml.datatype.DatatypeFactoryImpl</code>".
- * Any Exception thrown during the instantiation process is wrapped as a {@link DatatypeConfigurationException}.
- * </li>
- * </ol>
- *
- * @author <a href="mailto:Joseph.Fialli@Sun.COM">Joseph Fialli</a>
- * @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a>
- * @version $Id: DatatypeFactoryImpl.java,v 1.6 2010/05/19 05:02:55 joehw Exp $
- */
-public class DatatypeFactoryImpl
- extends DatatypeFactory {
-
- /**
- * <p>Public constructor is empty..</p>
- *
- * <p>Use {@link DatatypeFactory#newInstance()} to create a <code>DatatypeFactory</code>.</p>
- */
- public DatatypeFactoryImpl() {
- }
-
- /**
- * <p>Obtain a new instance of a <code>Duration</code>
- * specifying the <code>Duration</code> as its string representation, "PnYnMnDTnHnMnS",
- * as defined in XML Schema 1.0 section 3.2.6.1.</p>
- *
- * <p>XML Schema Part 2: Datatypes, 3.2.6 duration, defines <code>duration</code> as:</p>
- * <blockquote>
- * duration represents a duration of time.
- * The value space of duration is a six-dimensional space where the coordinates designate the
- * Gregorian year, month, day, hour, minute, and second components defined in Section 5.5.3.2 of [ISO 8601], respectively.
- * These components are ordered in their significance by their order of appearance i.e. as
- * year, month, day, hour, minute, and second.
- * </blockquote>
- * <p>All six values are set and availabe from the created {@link Duration}</p>
- *
- * <p>The XML Schema specification states that values can be of an arbitrary size.
- * Implementations may chose not to or be incapable of supporting arbitrarily large and/or small values.
- * An {@link UnsupportedOperationException} will be thrown with a message indicating implementation limits
- * if implementation capacities are exceeded.</p>
- *
- * @param lexicalRepresentation <code>String</code> representation of a <code>Duration</code>.
- *
- * @return New <code>Duration</code> created from parsing the <code>lexicalRepresentation</code>.
- *
- * @throws IllegalArgumentException If <code>lexicalRepresentation</code> is not a valid representation of a <code>Duration</code>.
- * @throws UnsupportedOperationException If implementation cannot support requested values.
- * @throws NullPointerException if <code>lexicalRepresentation</code> is <code>null</code>.
- */
- public Duration newDuration(final String lexicalRepresentation) {
-
- return new DurationImpl(lexicalRepresentation);
- }
-
- /**
- * <p>Obtain a new instance of a <code>Duration</code>
- * specifying the <code>Duration</code> as milliseconds.</p>
- *
- * <p>XML Schema Part 2: Datatypes, 3.2.6 duration, defines <code>duration</code> as:</p>
- * <blockquote>
- * duration represents a duration of time.
- * The value space of duration is a six-dimensional space where the coordinates designate the
- * Gregorian year, month, day, hour, minute, and second components defined in Section 5.5.3.2 of [ISO 8601], respectively.
- * These components are ordered in their significance by their order of appearance i.e. as
- * year, month, day, hour, minute, and second.
- * </blockquote>
- * <p>All six values are set by computing their values from the specified milliseconds
- * and are availabe using the <code>get</code> methods of the created {@link Duration}.
- * The values conform to and are defined by:</p>
- * <ul>
- * <li>ISO 8601:2000(E) Section 5.5.3.2 Alternative format</li>
- * <li><a href="http://www.w3.org/TR/xmlschema-2/#isoformats">
- * W3C XML Schema 1.0 Part 2, Appendix D, ISO 8601 Date and Time Formats</a>
- * </li>
- * <li>{@link XMLGregorianCalendar} Date/Time Datatype Field Mapping Between XML Schema 1.0 and Java Representation</li>
- * </ul>
- *
- * <p>The default start instance is defined by {@link GregorianCalendar}'s use of the start of the epoch: i.e.,
- * {@link java.util.Calendar#YEAR} = 1970,
- * {@link java.util.Calendar#MONTH} = {@link java.util.Calendar#JANUARY},
- * {@link java.util.Calendar#DATE} = 1, etc.
- * This is important as there are variations in the Gregorian Calendar,
- * e.g. leap years have different days in the month = {@link java.util.Calendar#FEBRUARY}
- * so the result of {@link Duration#getMonths()} and {@link Duration#getDays()} can be influenced.</p>
- *
- * @param durationInMilliseconds Duration in milliseconds to create.
- *
- * @return New <code>Duration</code> representing <code>durationInMilliseconds</code>.
- */
- public Duration newDuration(final long durationInMilliseconds) {
-
- return new DurationImpl(durationInMilliseconds);
- }
-
- /**
- * <p>Obtain a new instance of a <code>Duration</code>
- * specifying the <code>Duration</code> as isPositive, years, months, days, hours, minutes, seconds.</p>
- *
- * <p>The XML Schema specification states that values can be of an arbitrary size.
- * Implementations may chose not to or be incapable of supporting arbitrarily large and/or small values.
- * An {@link UnsupportedOperationException} will be thrown with a message indicating implementation limits
- * if implementation capacities are exceeded.</p>
- *
- * @param isPositive Set to <code>false</code> to create a negative duration. When the length
- * of the duration is zero, this parameter will be ignored.
- * @param years of this <code>Duration</code>
- * @param months of this <code>Duration</code>
- * @param days of this <code>Duration</code>
- * @param hours of this <code>Duration</code>
- * @param minutes of this <code>Duration</code>
- * @param seconds of this <code>Duration</code>
- *
- * @return New <code>Duration</code> created from the specified values.
- *
- * @throws IllegalArgumentException If values are not a valid representation of a <code>Duration</code>.
- * @throws UnsupportedOperationException If implementation cannot support requested values.
- * @throws NullPointerException If any values are <code>null</code>.
- *
- * @see #newDuration(boolean isPositive, BigInteger years, BigInteger months, BigInteger days,
- * BigInteger hours, BigInteger minutes, BigDecimal seconds)
- */
- public Duration newDuration(
- final boolean isPositive,
- final BigInteger years,
- final BigInteger months,
- final BigInteger days,
- final BigInteger hours,
- final BigInteger minutes,
- final BigDecimal seconds) {
-
- return new DurationImpl(
- isPositive,
- years,
- months,
- days,
- hours,
- minutes,
- seconds
- );
- }
- /**
- * <p>Create a <code>Duration</code> of type <code>xdt:yearMonthDuration</code> using the specified
- * <code>year</code> and <code>month</code> as defined in
- * <a href="http://www.w3.org/TR/xpath-datamodel#yearMonthDuration">
- * XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration</a>.</p>
- *
- * <p>The XML Schema specification states that values can be of an arbitrary size.
- * Implementations may chose not to or be incapable of supporting arbitrarily large and/or small values.
- * An {@link UnsupportedOperationException} will be thrown with a message indicating implementation limits
- * if implementation capacities are exceeded.</p>
- *
- * <p>A <code>null</code> value indicates that field is not set.</p>
- *
- * @param isPositive Set to <code>false</code> to create a negative duration. When the length
- * of the duration is zero, this parameter will be ignored.
- * @param year Year of <code>Duration</code>.
- * @param month Month of <code>Duration</code>.
- *
- * @return New <code>Duration</code> created using the specified <code>year</code> and <code>month</code>.
- *
- * @throws IllegalArgumentException If the values are not a valid representation of a
- * <code>Duration</code>: if all of the fields (year, month) are null or
- * if any of the fields is negative.
- * @throws UnsupportedOperationException If implementation cannot support requested values.
- */
- public Duration newDurationYearMonth(
- final boolean isPositive,
- final BigInteger year,
- final BigInteger month) {
-
- return new DurationYearMonthImpl(
- isPositive,
- year,
- month
- );
-
- }
- /**
- * <p>Create a <code>Duration</code> of type <code>xdt:yearMonthDuration</code> using the specified
- * <code>year</code> and <code>month</code> as defined in
- * <a href="http://www.w3.org/TR/xpath-datamodel#yearMonthDuration">
- * XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration</a>.</p>
- *
- * <p>A {@link DatatypeConstants#FIELD_UNDEFINED} value indicates that field is not set.</p>
- *
- * @param isPositive Set to <code>false</code> to create a negative duration. When the length
- * of the duration is zero, this parameter will be ignored.
- * @param year Year of <code>Duration</code>.
- * @param month Month of <code>Duration</code>.
- *
- * @return New <code>Duration</code> created using the specified <code>year</code> and <code>month</code>.
- *
- * @throws IllegalArgumentException If the values are not a valid representation of a
- * <code>Duration</code>: if any of the fields (year, month) is negative.
- */
- @Override
- public Duration newDurationYearMonth(
- final boolean isPositive,
- final int year,
- final int month) {
-
- return new DurationYearMonthImpl(
- isPositive,
- year,
- month);
- }
-
- /**
- * <p>Create a <code>Duration</code> of type <code>xdt:yearMonthDuration</code> by parsing its <code>String</code> representation,
- * "<em>PnYnM</em>", <a href="http://www.w3.org/TR/xpath-datamodel#yearMonthDuration">
- * XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration</a>.</p>
- *
- * <p>The datatype <code>xdt:yearMonthDuration</code> is a subtype of <code>xs:duration</code>
- * whose lexical representation contains only year and month components.
- * This datatype resides in the namespace {@link javax.xml.XMLConstants#W3C_XPATH_DATATYPE_NS_URI}.</p>
- *
- * <p>Both values are set and availabe from the created {@link Duration}</p>
- *
- * <p>The XML Schema specification states that values can be of an arbitrary size.
- * Implementations may chose not to or be incapable of supporting arbitrarily large and/or small values.
- * An {@link UnsupportedOperationException} will be thrown with a message indicating implementation limits
- * if implementation capacities are exceeded.</p>
- *
- * @param lexicalRepresentation Lexical representation of a duration.
- *
- * @return New <code>Duration</code> created using the specified <code>lexicalRepresentation</code>.
- *
- * @throws IllegalArgumentException If <code>lexicalRepresentation</code> is not a valid representation of a <code>Duration</code> expressed only in terms of years and months.
- * @throws UnsupportedOperationException If implementation cannot support requested values.
- * @throws NullPointerException If <code>lexicalRepresentation</code> is <code>null</code>.
- */
- public Duration newDurationYearMonth(
- final String lexicalRepresentation) {
-
- return new DurationYearMonthImpl(lexicalRepresentation);
-
- }
- /**
- * <p>Create a <code>Duration</code> of type <code>xdt:yearMonthDuration</code> using the specified milliseconds as defined in
- * <a href="http://www.w3.org/TR/xpath-datamodel#yearMonthDuration">
- * XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration</a>.</p>
- *
- * <p>The datatype <code>xdt:yearMonthDuration</code> is a subtype of <code>xs:duration</code>
- * whose lexical representation contains only year and month components.
- * This datatype resides in the namespace {@link javax.xml.XMLConstants#W3C_XPATH_DATATYPE_NS_URI}.</p>
- *
- * <p>Both values are set by computing their values from the specified milliseconds
- * and are availabe using the <code>get</code> methods of the created {@link Duration}.
- * The values conform to and are defined by:</p>
- * <ul>
- * <li>ISO 8601:2000(E) Section 5.5.3.2 Alternative format</li>
- * <li><a href="http://www.w3.org/TR/xmlschema-2/#isoformats">
- * W3C XML Schema 1.0 Part 2, Appendix D, ISO 8601 Date and Time Formats</a>
- * </li>
- * <li>{@link XMLGregorianCalendar} Date/Time Datatype Field Mapping Between XML Schema 1.0 and Java Representation</li>
- * </ul>
- *
- * <p>The default start instance is defined by {@link GregorianCalendar}'s use of the start of the epoch: i.e.,
- * {@link java.util.Calendar#YEAR} = 1970,
- * {@link java.util.Calendar#MONTH} = {@link java.util.Calendar#JANUARY},
- * {@link java.util.Calendar#DATE} = 1, etc.
- * This is important as there are variations in the Gregorian Calendar,
- * e.g. leap years have different days in the month = {@link java.util.Calendar#FEBRUARY}
- * so the result of {@link Duration#getMonths()} can be influenced.</p>
- *
- * <p>Any remaining milliseconds after determining the year and month are discarded.</p>
- *
- * @param durationInMilliseconds Milliseconds of <code>Duration</code> to create.
- *
- * @return New <code>Duration</code> created using the specified <code>durationInMilliseconds</code>.
- */
- public Duration newDurationYearMonth(
- final long durationInMilliseconds) {
-
- return new DurationYearMonthImpl(durationInMilliseconds);
- }
-
- /**
- * <p>Create a <code>Duration</code> of type <code>xdt:dayTimeDuration</code> by parsing its <code>String</code> representation,
- * "<em>PnDTnHnMnS</em>", <a href="http://www.w3.org/TR/xpath-datamodel#dayTimeDuration">
- * XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration</a>.</p>
- *
- * <p>The datatype <code>xdt:dayTimeDuration</code> is a subtype of <code>xs:duration</code>
- * whose lexical representation contains only day, hour, minute, and second components.
- * This datatype resides in the namespace <code>http://www.w3.org/2003/11/xpath-datatypes</code>.</p>
- *
- * <p>All four values are set and availabe from the created {@link Duration}</p>
- *
- * <p>The XML Schema specification states that values can be of an arbitrary size.
- * Implementations may chose not to or be incapable of supporting arbitrarily large and/or small values.
- * An {@link UnsupportedOperationException} will be thrown with a message indicating implementation limits
- * if implementation capacities are exceeded.</p>
- *
- * @param lexicalRepresentation Lexical representation of a duration.
- *
- * @return New <code>Duration</code> created using the specified <code>lexicalRepresentation</code>.
- *
- * @throws IllegalArgumentException If <code>lexicalRepresentation</code> is not a valid representation of a <code>Duration</code> expressed only in terms of days and time.
- * @throws UnsupportedOperationException If implementation cannot support requested values.
- * @throws NullPointerException If <code>lexicalRepresentation</code> is <code>null</code>.
- */
- public Duration newDurationDayTime(final String lexicalRepresentation) {
- // lexicalRepresentation must be non-null
- if (lexicalRepresentation == null) {
- throw new NullPointerException(
- "Trying to create an xdt:dayTimeDuration with an invalid"
- + " lexical representation of \"null\"");
- }
-
- return new DurationDayTimeImpl(lexicalRepresentation);
- }
-
- /**
- * <p>Create a <code>Duration</code> of type <code>xdt:dayTimeDuration</code> using the specified milliseconds as defined in
- * <a href="http://www.w3.org/TR/xpath-datamodel#dayTimeDuration">
- * XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration</a>.</p>
- *
- * <p>The datatype <code>xdt:dayTimeDuration</code> is a subtype of <code>xs:duration</code>
- * whose lexical representation contains only day, hour, minute, and second components.
- * This datatype resides in the namespace <code>http://www.w3.org/2003/11/xpath-datatypes</code>.</p>
- *
- * <p>All four values are set by computing their values from the specified milliseconds
- * and are availabe using the <code>get</code> methods of the created {@link Duration}.
- * The values conform to and are defined by:</p>
- * <ul>
- * <li>ISO 8601:2000(E) Section 5.5.3.2 Alternative format</li>
- * <li><a href="http://www.w3.org/TR/xmlschema-2/#isoformats">
- * W3C XML Schema 1.0 Part 2, Appendix D, ISO 8601 Date and Time Formats</a>
- * </li>
- * <li>{@link XMLGregorianCalendar} Date/Time Datatype Field Mapping Between XML Schema 1.0 and Java Representation</li>
- * </ul>
- *
- * <p>The default start instance is defined by {@link GregorianCalendar}'s use of the start of the epoch: i.e.,
- * {@link java.util.Calendar#YEAR} = 1970,
- * {@link java.util.Calendar#MONTH} = {@link java.util.Calendar#JANUARY},
- * {@link java.util.Calendar#DATE} = 1, etc.
- * This is important as there are variations in the Gregorian Calendar,
- * e.g. leap years have different days in the month = {@link java.util.Calendar#FEBRUARY}
- * so the result of {@link Duration#getDays()} can be influenced.</p>
- *
- * <p>Any remaining milliseconds after determining the day, hour, minute and second are discarded.</p>
- *
- * @param durationInMilliseconds Milliseconds of <code>Duration</code> to create.
- *
- * @return New <code>Duration</code> created with the specified <code>durationInMilliseconds</code>.
- *
- * @see <a href="http://www.w3.org/TR/xpath-datamodel#dayTimeDuration">
- * XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration</a>
- */
- public Duration newDurationDayTime(final long durationInMilliseconds) {
-
- return new DurationDayTimeImpl(durationInMilliseconds);
- }
-
- /**
- * <p>Create a <code>Duration</code> of type <code>xdt:dayTimeDuration</code> using the specified
- * <code>day</code>, <code>hour</code>, <code>minute</code> and <code>second</code> as defined in
- * <a href="http://www.w3.org/TR/xpath-datamodel#dayTimeDuration">
- * XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration</a>.</p>
- *
- * <p>The datatype <code>xdt:dayTimeDuration</code> is a subtype of <code>xs:duration</code>
- * whose lexical representation contains only day, hour, minute, and second components.
- * This datatype resides in the namespace <code>http://www.w3.org/2003/11/xpath-datatypes</code>.</p>
- *
- * <p>The XML Schema specification states that values can be of an arbitrary size.
- * Implementations may chose not to or be incapable of supporting arbitrarily large and/or small values.
- * An {@link UnsupportedOperationException} will be thrown with a message indicating implementation limits
- * if implementation capacities are exceeded.</p>
- *
- * <p>A <code>null</code> value indicates that field is not set.</p>
- *
- * @param isPositive Set to <code>false</code> to create a negative duration. When the length
- * of the duration is zero, this parameter will be ignored.
- * @param day Day of <code>Duration</code>.
- * @param hour Hour of <code>Duration</code>.
- * @param minute Minute of <code>Duration</code>.
- * @param second Second of <code>Duration</code>.
- *
- * @return New <code>Duration</code> created with the specified <code>day</code>, <code>hour</code>, <code>minute</code>
- * and <code>second</code>.
- *
- * @throws IllegalArgumentException If the values are not a valid representation of a
- * <code>Duration</code>: if all the fields (day, hour, ...) are null or
- * if any of the fields is negative.
- * @throws UnsupportedOperationException If implementation cannot support requested values.
- */
- public Duration newDurationDayTime(
- final boolean isPositive,
- final BigInteger day,
- final BigInteger hour,
- final BigInteger minute,
- final BigInteger second) {
-
- return new DurationDayTimeImpl(
- isPositive,
- day,
- hour,
- minute,
- (second != null)? new BigDecimal(second):null
- );
- }
-
- /**
- * <p>Create a <code>Duration</code> of type <code>xdt:dayTimeDuration</code> using the specified
- * <code>day</code>, <code>hour</code>, <code>minute</code> and <code>second</code> as defined in
- * <a href="http://www.w3.org/TR/xpath-datamodel#dayTimeDuration">
- * XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration</a>.</p>
- *
- * <p>The datatype <code>xdt:dayTimeDuration</code> is a subtype of <code>xs:duration</code>
- * whose lexical representation contains only day, hour, minute, and second components.
- * This datatype resides in the namespace <code>http://www.w3.org/2003/11/xpath-datatypes</code>.</p>
- *
- * <p>A {@link DatatypeConstants#FIELD_UNDEFINED} value indicates that field is not set.</p>
- *
- * @param isPositive Set to <code>false</code> to create a negative duration. When the length
- * of the duration is zero, this parameter will be ignored.
- * @param day Day of <code>Duration</code>.
- * @param hour Hour of <code>Duration</code>.
- * @param minute Minute of <code>Duration</code>.
- * @param second Second of <code>Duration</code>.
- *
- * @return New <code>Duration</code> created with the specified <code>day</code>, <code>hour</code>, <code>minute</code>
- * and <code>second</code>.
- *
- * @throws IllegalArgumentException If the values are not a valid representation of a
- * <code>Duration</code>: if any of the fields (day, hour, ...) is negative.
- */
- public Duration newDurationDayTime(
- final boolean isPositive,
- final int day,
- final int hour,
- final int minute,
- final int second) {
-
- return new DurationDayTimeImpl(
- isPositive,
- day,
- hour,
- minute,
- second
- );
- }
-
- /**
- * <p>Create a new instance of an <code>XMLGregorianCalendar</code>.</p>
- *
- * <p>All date/time datatype fields set to {@link DatatypeConstants#FIELD_UNDEFINED} or null.</p>
- *
- * @return New <code>XMLGregorianCalendar</code> with all date/time datatype fields set to
- * {@link DatatypeConstants#FIELD_UNDEFINED} or null.
- */
- public XMLGregorianCalendar newXMLGregorianCalendar() {
-
- return new XMLGregorianCalendarImpl();
- }
-
- /**
- * <p>Create a new XMLGregorianCalendar by parsing the String as a lexical representation.</p>
- *
- * <p>Parsing the lexical string representation is defined in
- * <a href="http://www.w3.org/TR/xmlschema-2/#dateTime-order">XML Schema 1.0 Part 2, Section 3.2.[7-14].1,
- * <em>Lexical Representation</em>.</a></p>
- *
- * <p>The string representation may not have any leading and trailing whitespaces.</p>
- *
- * <p>The parsing is done field by field so that
- * the following holds for any lexically correct String x:</p>
- * <pre>
- * newXMLGregorianCalendar(x).toXMLFormat().equals(x)
- * </pre>
- * <p>Except for the noted lexical/canonical representation mismatches
- * listed in <a href="http://www.w3.org/2001/05/xmlschema-errata#e2-45">
- * XML Schema 1.0 errata, Section 3.2.7.2</a>.</p>
- *
- * @param lexicalRepresentation Lexical representation of one the eight XML Schema date/time datatypes.
- *
- * @return <code>XMLGregorianCalendar</code> created from the <code>lexicalRepresentation</code>.
- *
- * @throws IllegalArgumentException If the <code>lexicalRepresentation</code> is not a valid <code>XMLGregorianCalendar</code>.
- * @throws NullPointerException If <code>lexicalRepresentation</code> is <code>null</code>.
- */
- public XMLGregorianCalendar newXMLGregorianCalendar(final String lexicalRepresentation) {
-
- return new XMLGregorianCalendarImpl(lexicalRepresentation);
- }
-
- /**
- * <p>Create an <code>XMLGregorianCalendar</code> from a {@link GregorianCalendar}.</p>
- *
- * <table border="2" rules="all" cellpadding="2">
- * <thead>
- * <tr>
- * <th align="center" colspan="2">
- * Field by Field Conversion from
- * {@link GregorianCalendar} to an {@link XMLGregorianCalendar}
- * </th>
- * </tr>
- * <tr>
- * <th><code>java.util.GregorianCalendar</code> field</th>
- * <th><code>javax.xml.datatype.XMLGregorianCalendar</code> field</th>
- * </tr>
- * </thead>
- * <tbody>
- * <tr>
- * <td><code>ERA == GregorianCalendar.BC ? -YEAR : YEAR</code></td>
- * <td>{@link XMLGregorianCalendar#setYear(int year)}</td>
- * </tr>
- * <tr>
- * <td><code>MONTH + 1</code></td>
- * <td>{@link XMLGregorianCalendar#setMonth(int month)}</td>
- * </tr>
- * <tr>
- * <td><code>DAY_OF_MONTH</code></td>
- * <td>{@link XMLGregorianCalendar#setDay(int day)}</td>
- * </tr>
- * <tr>
- * <td><code>HOUR_OF_DAY, MINUTE, SECOND, MILLISECOND</code></td>
- * <td>{@link XMLGregorianCalendar#setTime(int hour, int minute, int second, BigDecimal fractional)}</td>
- * </tr>
- * <tr>
- * <td>
- * <code>(ZONE_OFFSET + DST_OFFSET) / (60*1000)</code><br/>
- * <em>(in minutes)</em>
- * </td>
- * <td>{@link XMLGregorianCalendar#setTimezone(int offset)}<sup><em>*</em></sup>
- * </td>
- * </tr>
- * </tbody>
- * </table>
- * <p><em>*</em>conversion loss of information. It is not possible to represent
- * a <code>java.util.GregorianCalendar</code> daylight savings timezone id in the
- * XML Schema 1.0 date/time datatype representation.</p>
- *
- * <p>To compute the return value's <code>TimeZone</code> field,
- * <ul>
- * <li>when <code>this.getTimezone() != FIELD_UNDEFINED</code>,
- * create a <code>java.util.TimeZone</code> with a custom timezone id
- * using the <code>this.getTimezone()</code>.</li>
- * <li>else use the <code>GregorianCalendar</code> default timezone value
- * for the host is defined as specified by
- * <code>java.util.TimeZone.getDefault()</code>.</li></p>
- *
- * @param cal <code>java.util.GregorianCalendar</code> used to create <code>XMLGregorianCalendar</code>
- *
- * @return <code>XMLGregorianCalendar</code> created from <code>java.util.GregorianCalendar</code>
- *
- * @throws NullPointerException If <code>cal</code> is <code>null</code>.
- */
- public XMLGregorianCalendar newXMLGregorianCalendar(final GregorianCalendar cal) {
-
- return new XMLGregorianCalendarImpl(cal);
- }
-
- /**
- * <p>Constructor allowing for complete value spaces allowed by
- * W3C XML Schema 1.0 recommendation for xsd:dateTime and related
- * builtin datatypes. Note that <code>year</code> parameter supports
- * arbitrarily large numbers and fractionalSecond has infinite
- * precision.</p>
- *
- * @param year of <code>XMLGregorianCalendar</code> to be created.
- * @param month of <code>XMLGregorianCalendar</code> to be created.
- * @param day of <code>XMLGregorianCalendar</code> to be created.
- * @param hour of <code>XMLGregorianCalendar</code> to be created.
- * @param minute of <code>XMLGregorianCalendar</code> to be created.
- * @param second of <code>XMLGregorianCalendar</code> to be created.
- * @param fractionalSecond of <code>XMLGregorianCalendar</code> to be created.
- * @param timezone of <code>XMLGregorianCalendar</code> to be created.
- *
- * @return <code>XMLGregorianCalendar</code> created from specified values.
- *
- * @throws IllegalArgumentException If any individual parameter's value is outside the maximum value constraint for the field
- * as determined by the Date/Time Data Mapping table in {@link XMLGregorianCalendar}
- * or if the composite values constitute an invalid <code>XMLGregorianCalendar</code> instance
- * as determined by {@link XMLGregorianCalendar#isValid()}.
- * @throws NullPointerException If any parameters are <code>null</code>.
- *
- */
- public XMLGregorianCalendar newXMLGregorianCalendar(
- final BigInteger year,
- final int month,
- final int day,
- final int hour,
- final int minute,
- final int second,
- final BigDecimal fractionalSecond,
- final int timezone) {
-
- return new XMLGregorianCalendarImpl(
- year,
- month,
- day,
- hour,
- minute,
- second,
- fractionalSecond,
- timezone
- );
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/datatype/DurationDayTimeImpl.java b/src/com/sun/org/apache/xerces/internal/jaxp/datatype/DurationDayTimeImpl.java
deleted file mode 100644
index 9e5cafd..0000000
--- a/src/com/sun/org/apache/xerces/internal/jaxp/datatype/DurationDayTimeImpl.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- */
-
-package com.sun.org.apache.xerces.internal.jaxp.datatype;
-
-
-import java.math.BigInteger;
-import java.math.BigDecimal;
-import javax.xml.datatype.DatatypeConstants;
-
-/**
- * <p>Represent a subtype <code>xdt:dayTimeDuration</code> of a <code>Duration</code>
- * as specified in <a href="http://www.w3.org/TR/xpath-datamodel#dayTimeDuration">
- * XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration</a>.</p>
- *
- *
- * <p>The DurationYearMonth object represents a period of Gregorian time,
- * with a lexical representation, "<em>PnDTnHnMnS</em>" that contains only year and month components.
- * </p>
- *
- *
- * @author <a href="mailto:Vikram.Aroskar@Sun.COM">Vikram Aroskar</a>
- * @author <a href="mailto:Huizhe.wang@oracle.com">Joe Wang</a>
- * @version $Revision: 1.2 $, $Date: 2010/05/19 23:20:06 $
-
- * @see XMLGregorianCalendar#add(Duration)
- */
-
-class DurationDayTimeImpl
- extends DurationImpl {
-
- public DurationDayTimeImpl(
- boolean isPositive,
- BigInteger days,
- BigInteger hours,
- BigInteger minutes,
- BigDecimal seconds) {
-
- super(isPositive, null, null, days, hours, minutes, seconds);
- convertToCanonicalDayTime();
- }
-
- public DurationDayTimeImpl(
- boolean isPositive,
- int days,
- int hours,
- int minutes,
- int seconds) {
-
- this(
- isPositive,
- wrap(days),
- wrap(hours),
- wrap(minutes),
- (seconds != DatatypeConstants.FIELD_UNDEFINED ? new BigDecimal(String.valueOf(seconds)) : null));
- }
-
- /**
- * <p>Construct a <code>Duration</code> of type <code>xdt:dayTimeDuration</code> by parsing its <code>String</code> representation,
- * "<em>PnDTnHnMnS</em>", <a href="http://www.w3.org/TR/xpath-datamodel#dayTimeDuration">
- * XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration</a>.</p>
- *
- * <p>The datatype <code>xdt:dayTimeDuration</code> is a subtype of <code>xs:duration</code>
- * whose lexical representation contains only day, hour, minute, and second components.
- * This datatype resides in the namespace <code>http://www.w3.org/2003/11/xpath-datatypes</code>.</p>
- *
- * <p>All four values are set and availabe from the created {@link Duration}</p>
- *
- * <p>The XML Schema specification states that values can be of an arbitrary size.
- * Implementations may chose not to or be incapable of supporting arbitrarily large and/or small values.
- * An {@link UnsupportedOperationException} will be thrown with a message indicating implementation limits
- * if implementation capacities are exceeded.</p>
- *
- * @param lexicalRepresentation Lexical representation of a duration.
- *
- * @throws IllegalArgumentException If <code>lexicalRepresentation</code> is not a valid representation of a <code>Duration</code> expressed only in terms of days and time.
- * @throws UnsupportedOperationException If implementation cannot support requested values.
- * @throws NullPointerException If <code>lexicalRepresentation</code> is <code>null</code>.
- */
- protected DurationDayTimeImpl(String lexicalRepresentation) {
- super(lexicalRepresentation);
-
- if (getYears() > 0 || getMonths() > 0) {
- throw new IllegalArgumentException(
- "Trying to create an xdt:dayTimeDuration with an invalid"
- + " lexical representation of \"" + lexicalRepresentation
- + "\", data model requires a format PnDTnHnMnS.");
- }
-
- convertToCanonicalDayTime();
- }
- /**
- * <p>Create a <code>Duration</code> of type <code>xdt:dayTimeDuration</code> using the specified milliseconds as defined in
- * <a href="http://www.w3.org/TR/xpath-datamodel#dayTimeDuration">
- * XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration</a>.</p>
- *
- * <p>The datatype <code>xdt:dayTimeDuration</code> is a subtype of <code>xs:duration</code>
- * whose lexical representation contains only day, hour, minute, and second components.
- * This datatype resides in the namespace <code>http://www.w3.org/2003/11/xpath-datatypes</code>.</p>
- *
- * <p>All four values are set by computing their values from the specified milliseconds
- * and are availabe using the <code>get</code> methods of the created {@link Duration}.
- * The values conform to and are defined by:</p>
- * <ul>
- * <li>ISO 8601:2000(E) Section 5.5.3.2 Alternative format</li>
- * <li><a href="http://www.w3.org/TR/xmlschema-2/#isoformats">
- * W3C XML Schema 1.0 Part 2, Appendix D, ISO 8601 Date and Time Formats</a>
- * </li>
- * <li>{@link XMLGregorianCalendar} Date/Time Datatype Field Mapping Between XML Schema 1.0 and Java Representation</li>
- * </ul>
- *
- * <p>The default start instance is defined by {@link GregorianCalendar}'s use of the start of the epoch: i.e.,
- * {@link java.util.Calendar#YEAR} = 1970,
- * {@link java.util.Calendar#MONTH} = {@link java.util.Calendar#JANUARY},
- * {@link java.util.Calendar#DATE} = 1, etc.
- * This is important as there are variations in the Gregorian Calendar,
- * e.g. leap years have different days in the month = {@link java.util.Calendar#FEBRUARY}
- * so the result of {@link Duration#getDays()} can be influenced.</p>
- *
- * <p>Any remaining milliseconds after determining the day, hour, minute and second are discarded.</p>
- *
- * @param durationInMilliseconds Milliseconds of <code>Duration</code> to create.
- *
- * @return New <code>Duration</code> created with the specified <code>durationInMilliseconds</code>.
- *
- * @see <a href="http://www.w3.org/TR/xpath-datamodel#dayTimeDuration">
- * XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration</a>
- */
- protected DurationDayTimeImpl(final long durationInMilliseconds) {
- super(durationInMilliseconds);
- convertToCanonicalDayTime();
- // only day, hour, minute, and second should have values
- years = null;
- months = null;
- }
-
-
- /**
- * The value space of xs:dayTimeDuration is the set of fractional second values.
- * @return fractional second values
- */
- public float getValue() {
- float sec = (seconds==null)?0:seconds.floatValue();
- return (((((getDays() * 24) +
- getHours()) * 60) +
- getMinutes())*60) +
- sec;
- }
-
- private void convertToCanonicalDayTime() {
-
- while (getSeconds() >= 60)
- {
- seconds = seconds.subtract(BigDecimal.valueOf(60));
- minutes = BigInteger.valueOf((long) getMinutes()).add(BigInteger.ONE);
- }
-
- while (getMinutes() >= 60)
- {
- minutes = minutes.subtract(BigInteger.valueOf(60));
- hours = BigInteger.valueOf((long) getHours()).add(BigInteger.ONE);
- }
-
- while (getHours() >= 24)
- {
- hours = hours.subtract(BigInteger.valueOf(24));
- days = BigInteger.valueOf((long) getDays()).add(BigInteger.ONE);
- }
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/datatype/DurationImpl.java b/src/com/sun/org/apache/xerces/internal/jaxp/datatype/DurationImpl.java
deleted file mode 100644
index 4e4f7d4..0000000
--- a/src/com/sun/org/apache/xerces/internal/jaxp/datatype/DurationImpl.java
+++ /dev/null
@@ -1,2020 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.jaxp.datatype;
-
-import java.io.IOException;
-import java.io.ObjectStreamException;
-import java.io.Serializable;
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.GregorianCalendar;
-import java.util.TimeZone;
-
-import javax.xml.datatype.DatatypeConstants;
-import javax.xml.datatype.Duration;
-import javax.xml.datatype.XMLGregorianCalendar;
-
-import com.sun.org.apache.xerces.internal.util.DatatypeMessageFormatter;
-
-/**
- * <p>Immutable representation of a time span as defined in
- * the W3C XML Schema 1.0 specification.</p>
- *
- * <p>A Duration object represents a period of Gregorian time,
- * which consists of six fields (years, months, days, hours,
- * minutes, and seconds) plus a sign (+/-) field.</p>
- *
- * <p>The first five fields have non-negative (>=0) integers or null
- * (which represents that the field is not set),
- * and the seconds field has a non-negative decimal or null.
- * A negative sign indicates a negative duration.</p>
- *
- * <p>This class provides a number of methods that make it easy
- * to use for the duration datatype of XML Schema 1.0 with
- * the errata.</p>
- *
- * <h2>Order relationship</h2>
- * <p>Duration objects only have partial order, where two values A and B
- * maybe either:</p>
- * <ol>
- * <li>A&lt;B (A is shorter than B)
- * <li>A&gt;B (A is longer than B)
- * <li>A==B (A and B are of the same duration)
- * <li>A&lt;>B (Comparison between A and B is indeterminate)
- * </ol>
- * <p>For example, 30 days cannot be meaningfully compared to one month.
- * The {@link #compare(Duration)} method implements this
- * relationship.</p>
- *
- * <p>See the {@link #isLongerThan(Duration)} method for details about
- * the order relationship among {@link Duration} objects.</p>
- *
- *
- *
- * <h2>Operations over Duration</h2>
- * <p>This class provides a set of basic arithmetic operations, such
- * as addition, subtraction and multiplication.
- * Because durations don't have total order, an operation could
- * fail for some combinations of operations. For example, you cannot
- * subtract 15 days from 1 month. See the javadoc of those methods
- * for detailed conditions where this could happen.</p>
- *
- * <p>Also, division of a duration by a number is not provided because
- * the {@link Duration} class can only deal with finite precision
- * decimal numbers. For example, one cannot represent 1 sec divided by 3.</p>
- *
- * <p>However, you could substitute a division by 3 with multiplying
- * by numbers such as 0.3 or 0.333.</p>
- *
- *
- *
- * <h2>Range of allowed values</h2>
- * <p>
- * Because some operations of {@link Duration} rely on {@link Calendar}
- * even though {@link Duration} can hold very large or very small values,
- * some of the methods may not work correctly on such {@link Duration}s.
- * The impacted methods document their dependency on {@link Calendar}.
- *
- *
- * @author <a href="mailto:Kohsuke.Kawaguchi@Sun.com">Kohsuke Kawaguchi</a>
- * @author <a href="mailto:Joseph.Fialli@Sun.com">Joseph Fialli</a>
- * @version $Revision: 1.8 $, $Date: 2010/05/19 23:20:06 $
-
- * @see XMLGregorianCalendar#add(Duration)
- */
-class DurationImpl
- extends Duration
- implements Serializable {
-
- /**
- * <p>Number of Fields.</p>
- */
- private static final int FIELD_NUM = 6;
-
- /**
- * <p>Internal array of value Fields.</p>
- */
- private static final DatatypeConstants.Field[] FIELDS = new DatatypeConstants.Field[]{
- DatatypeConstants.YEARS,
- DatatypeConstants.MONTHS,
- DatatypeConstants.DAYS,
- DatatypeConstants.HOURS,
- DatatypeConstants.MINUTES,
- DatatypeConstants.SECONDS
- };
-
- /**
- * <p>Internal array of value Field ids.</p>
- */
- private static final int[] FIELD_IDS = {
- DatatypeConstants.YEARS.getId(),
- DatatypeConstants.MONTHS.getId(),
- DatatypeConstants.DAYS.getId(),
- DatatypeConstants.HOURS.getId(),
- DatatypeConstants.MINUTES.getId(),
- DatatypeConstants.SECONDS.getId()
- };
-
- /**
- * TimeZone for GMT.
- */
- private static final TimeZone GMT = TimeZone.getTimeZone("GMT");
-
- /**
- * <p>BigDecimal value of 0.</p>
- */
- private static final BigDecimal ZERO = BigDecimal.valueOf((long) 0);
-
- /**
- * <p>Indicates the sign. -1, 0 or 1 if the duration is negative,
- * zero, or positive.</p>
- */
- protected int signum;
-
- /**
- * <p>Years of this <code>Duration</code>.</p>
- */
- /**
- * These were final since Duration is immutable. But new subclasses need
- * to be able to set after conversion. It won't break the immutable nature
- * of them since there's no other way to set new values to them
- */
- protected BigInteger years;
-
- /**
- * <p>Months of this <code>Duration</code>.</p>
- */
- protected BigInteger months;
-
- /**
- * <p>Days of this <code>Duration</code>.</p>
- */
- protected BigInteger days;
-
- /**
- * <p>Hours of this <code>Duration</code>.</p>
- */
- protected BigInteger hours;
-
- /**
- * <p>Minutes of this <code>Duration</code>.</p>
- */
- protected BigInteger minutes;
-
- /**
- * <p>Seconds of this <code>Duration</code>.</p>
- */
- protected BigDecimal seconds;
-
- /**
- * Returns the sign of this duration in -1,0, or 1.
- *
- * @return
- * -1 if this duration is negative, 0 if the duration is zero,
- * and 1 if the duration is postive.
- */
- public int getSign() {
-
- return signum;
- }
-
- /**
- * TODO: Javadoc
- * @param isPositive Sign.
- *
- * @return 1 if positive, else -1.
- */
- protected int calcSignum(boolean isPositive) {
- if ((years == null || years.signum() == 0)
- && (months == null || months.signum() == 0)
- && (days == null || days.signum() == 0)
- && (hours == null || hours.signum() == 0)
- && (minutes == null || minutes.signum() == 0)
- && (seconds == null || seconds.signum() == 0)) {
- return 0;
- }
-
- if (isPositive) {
- return 1;
- } else {
- return -1;
- }
-
- }
-
- /**
- * <p>Constructs a new Duration object by specifying each field individually.</p>
- *
- * <p>All the parameters are optional as long as at least one field is present.
- * If specified, parameters have to be zero or positive.</p>
- *
- * @param isPositive Set to <code>false</code> to create a negative duration. When the length
- * of the duration is zero, this parameter will be ignored.
- * @param years of this <code>Duration</code>
- * @param months of this <code>Duration</code>
- * @param days of this <code>Duration</code>
- * @param hours of this <code>Duration</code>
- * @param minutes of this <code>Duration</code>
- * @param seconds of this <code>Duration</code>
- *
- * @throws IllegalArgumentException
- * If years, months, days, hours, minutes and
- * seconds parameters are all <code>null</code>. Or if any
- * of those parameters are negative.
- */
- protected DurationImpl(
- boolean isPositive,
- BigInteger years,
- BigInteger months,
- BigInteger days,
- BigInteger hours,
- BigInteger minutes,
- BigDecimal seconds) {
-
- this.years = years;
- this.months = months;
- this.days = days;
- this.hours = hours;
- this.minutes = minutes;
- this.seconds = seconds;
-
- this.signum = calcSignum(isPositive);
-
- // sanity check
- if (years == null
- && months == null
- && days == null
- && hours == null
- && minutes == null
- && seconds == null) {
- throw new IllegalArgumentException(
- //"all the fields are null"
- DatatypeMessageFormatter.formatMessage(null, "AllFieldsNull", null)
- );
- }
- testNonNegative(years, DatatypeConstants.YEARS);
- testNonNegative(months, DatatypeConstants.MONTHS);
- testNonNegative(days, DatatypeConstants.DAYS);
- testNonNegative(hours, DatatypeConstants.HOURS);
- testNonNegative(minutes, DatatypeConstants.MINUTES);
- testNonNegative(seconds, DatatypeConstants.SECONDS);
- }
-
- /**
- * <p>Makes sure that the given number is non-negative. If it is not,
- * throw {@link IllegalArgumentException}.</p>
- *
- * @param n Number to test.
- * @param f Field to test.
- */
- protected static void testNonNegative(BigInteger n, DatatypeConstants.Field f) {
- if (n != null && n.signum() < 0) {
- throw new IllegalArgumentException(
- DatatypeMessageFormatter.formatMessage(null, "NegativeField", new Object[]{f.toString()})
- );
- }
- }
-
- /**
- * <p>Makes sure that the given number is non-negative. If it is not,
- * throw {@link IllegalArgumentException}.</p>
- *
- * @param n Number to test.
- * @param f Field to test.
- */
- protected static void testNonNegative(BigDecimal n, DatatypeConstants.Field f) {
- if (n != null && n.signum() < 0) {
-
- throw new IllegalArgumentException(
- DatatypeMessageFormatter.formatMessage(null, "NegativeField", new Object[]{f.toString()})
- );
- }
- }
-
- /**
- * <p>Constructs a new Duration object by specifying each field
- * individually.</p>
- *
- * <p>This method is functionally equivalent to
- * invoking another constructor by wrapping
- * all non-zero parameters into {@link BigInteger} and {@link BigDecimal}.
- * Zero value of int parameter is equivalent of null value of
- * the corresponding field.</p>
- *
- * @see #DurationImpl(boolean, BigInteger, BigInteger, BigInteger, BigInteger,
- * BigInteger, BigDecimal)
- */
- protected DurationImpl(
- final boolean isPositive,
- final int years,
- final int months,
- final int days,
- final int hours,
- final int minutes,
- final int seconds) {
- this(
- isPositive,
- wrap(years),
- wrap(months),
- wrap(days),
- wrap(hours),
- wrap(minutes),
- seconds != DatatypeConstants.FIELD_UNDEFINED ? new BigDecimal(String.valueOf(seconds)) : null);
- }
-
- /**
- * TODO: Javadoc
- *
- * @param i int to convert to BigInteger.
- *
- * @return BigInteger representation of int.
- */
- protected static BigInteger wrap(final int i) {
-
- // field may not be set
- if (i == DatatypeConstants.FIELD_UNDEFINED) {
- return null;
- }
-
- // int -> BigInteger
- return new BigInteger(String.valueOf(i));
- }
-
- /**
- * <p>Constructs a new Duration object by specifying the duration
- * in milliseconds.</p>
- *
- * @param durationInMilliSeconds
- * The length of the duration in milliseconds.
- */
- protected DurationImpl(final long durationInMilliSeconds) {
-
- long l = durationInMilliSeconds;
-
- if (l > 0) {
- signum = 1;
- } else if (l < 0) {
- signum = -1;
- if (l == 0x8000000000000000L) {
- // negating 0x8000000000000000L causes an overflow
- l++;
- }
- l *= -1;
- } else {
- signum = 0;
- }
-
- // let GregorianCalendar do the heavy lifting
- GregorianCalendar gregorianCalendar = new GregorianCalendar(GMT);
-
- // duration is the offset from the Epoch
- gregorianCalendar.setTimeInMillis(l);
-
- // now find out how much each field has changed
- long int2long = 0L;
-
- // years
- int2long = gregorianCalendar.get(Calendar.YEAR) - 1970;
- this.years = BigInteger.valueOf(int2long);
-
- // months
- int2long = gregorianCalendar.get(Calendar.MONTH);
- this.months = BigInteger.valueOf(int2long);
-
- // days
- int2long = gregorianCalendar.get(Calendar.DAY_OF_MONTH) - 1;
- this.days = BigInteger.valueOf(int2long);
-
- // hours
- int2long = gregorianCalendar.get(Calendar.HOUR_OF_DAY);
- this.hours = BigInteger.valueOf(int2long);
-
- // minutes
- int2long = gregorianCalendar.get(Calendar.MINUTE);
- this.minutes = BigInteger.valueOf(int2long);
-
- // seconds & milliseconds
- int2long = (gregorianCalendar.get(Calendar.SECOND) * 1000)
- + gregorianCalendar.get(Calendar.MILLISECOND);
- this.seconds = BigDecimal.valueOf(int2long, 3);
- }
-
- /**
- * Constructs a new Duration object by
- * parsing its string representation
- * "PnYnMnDTnHnMnS" as defined in XML Schema 1.0 section 3.2.6.1.
- *
- * <p>
- * The string representation may not have any leading
- * and trailing whitespaces.
- *
- * <p>
- * For example, this method parses strings like
- * "P1D" (1 day), "-PT100S" (-100 sec.), "P1DT12H" (1 days and 12 hours).
- *
- * <p>
- * The parsing is done field by field so that
- * the following holds for any lexically correct string x:
- * <pre>
- * new Duration(x).toString().equals(x)
- * </pre>
- *
- * Returns a non-null valid duration object that holds the value
- * indicated by the lexicalRepresentation parameter.
- *
- * @param lexicalRepresentation
- * Lexical representation of a duration.
- * @throws IllegalArgumentException
- * If the given string does not conform to the aforementioned
- * specification.
- * @throws NullPointerException
- * If the given string is null.
- */
- protected DurationImpl(String lexicalRepresentation)
- throws IllegalArgumentException {
- // only if I could use the JDK1.4 regular expression ....
-
- final String s = lexicalRepresentation;
- boolean positive;
- int[] idx = new int[1];
- int length = s.length();
- boolean timeRequired = false;
-
- if (lexicalRepresentation == null) {
- throw new NullPointerException();
- }
-
- idx[0] = 0;
- if (length != idx[0] && s.charAt(idx[0]) == '-') {
- idx[0]++;
- positive = false;
- } else {
- positive = true;
- }
-
- if (length != idx[0] && s.charAt(idx[0]++) != 'P') {
- throw new IllegalArgumentException(s); //,idx[0]-1);
- }
-
-
- // phase 1: chop the string into chunks
- // (where a chunk is '<number><a symbol>'
- //--------------------------------------
- int dateLen = 0;
- String[] dateParts = new String[3];
- int[] datePartsIndex = new int[3];
- while (length != idx[0]
- && isDigit(s.charAt(idx[0]))
- && dateLen < 3) {
- datePartsIndex[dateLen] = idx[0];
- dateParts[dateLen++] = parsePiece(s, idx);
- }
-
- if (length != idx[0]) {
- if (s.charAt(idx[0]++) == 'T') {
- timeRequired = true;
- } else {
- throw new IllegalArgumentException(s); // ,idx[0]-1);
- }
- }
-
- int timeLen = 0;
- String[] timeParts = new String[3];
- int[] timePartsIndex = new int[3];
- while (length != idx[0]
- && isDigitOrPeriod(s.charAt(idx[0]))
- && timeLen < 3) {
- timePartsIndex[timeLen] = idx[0];
- timeParts[timeLen++] = parsePiece(s, idx);
- }
-
- if (timeRequired && timeLen == 0) {
- throw new IllegalArgumentException(s); // ,idx[0]);
- }
-
- if (length != idx[0]) {
- throw new IllegalArgumentException(s); // ,idx[0]);
- }
- if (dateLen == 0 && timeLen == 0) {
- throw new IllegalArgumentException(s); // ,idx[0]);
- }
-
- // phase 2: check the ordering of chunks
- //--------------------------------------
- organizeParts(s, dateParts, datePartsIndex, dateLen, "YMD");
- organizeParts(s, timeParts, timePartsIndex, timeLen, "HMS");
-
- // parse into numbers
- years = parseBigInteger(s, dateParts[0], datePartsIndex[0]);
- months = parseBigInteger(s, dateParts[1], datePartsIndex[1]);
- days = parseBigInteger(s, dateParts[2], datePartsIndex[2]);
- hours = parseBigInteger(s, timeParts[0], timePartsIndex[0]);
- minutes = parseBigInteger(s, timeParts[1], timePartsIndex[1]);
- seconds = parseBigDecimal(s, timeParts[2], timePartsIndex[2]);
- signum = calcSignum(positive);
- }
-
-
- /**
- * TODO: Javadoc
- *
- * @param ch char to test.
- *
- * @return true if ch is a digit, else false.
- */
- private static boolean isDigit(char ch) {
- return '0' <= ch && ch <= '9';
- }
-
- /**
- * TODO: Javadoc
- *
- * @param ch to test.
- *
- * @return true if ch is a digit or a period, else false.
- */
- private static boolean isDigitOrPeriod(char ch) {
- return isDigit(ch) || ch == '.';
- }
-
- /**
- * TODO: Javadoc
- *
- * @param whole String to parse.
- * @param idx TODO: ???
- *
- * @return Result of parsing.
- *
- * @throws IllegalArgumentException If whole cannot be parsed.
- */
- private static String parsePiece(String whole, int[] idx)
- throws IllegalArgumentException {
- int start = idx[0];
- while (idx[0] < whole.length()
- && isDigitOrPeriod(whole.charAt(idx[0]))) {
- idx[0]++;
- }
- if (idx[0] == whole.length()) {
- throw new IllegalArgumentException(whole); // ,idx[0]);
- }
-
- idx[0]++;
-
- return whole.substring(start, idx[0]);
- }
-
- /**
- * TODO: Javadoc.
- *
- * @param whole TODO: ???
- * @param parts TODO: ???
- * @param partsIndex TODO: ???
- * @param len TODO: ???
- * @param tokens TODO: ???
- *
- * @throws IllegalArgumentException TODO: ???
- */
- private static void organizeParts(
- String whole,
- String[] parts,
- int[] partsIndex,
- int len,
- String tokens)
- throws IllegalArgumentException {
-
- int idx = tokens.length();
- for (int i = len - 1; i >= 0; i--) {
- int nidx =
- tokens.lastIndexOf(
- parts[i].charAt(parts[i].length() - 1),
- idx - 1);
- if (nidx == -1) {
- throw new IllegalArgumentException(whole);
- // ,partsIndex[i]+parts[i].length()-1);
- }
-
- for (int j = nidx + 1; j < idx; j++) {
- parts[j] = null;
- }
- idx = nidx;
- parts[idx] = parts[i];
- partsIndex[idx] = partsIndex[i];
- }
- for (idx--; idx >= 0; idx--) {
- parts[idx] = null;
- }
- }
-
- /**
- * TODO: Javadoc
- *
- * @param whole TODO: ???.
- * @param part TODO: ???.
- * @param index TODO: ???.
- *
- * @return TODO: ???.
- *
- * @throws IllegalArgumentException TODO: ???.
- */
- private static BigInteger parseBigInteger(
- String whole,
- String part,
- int index)
- throws IllegalArgumentException {
- if (part == null) {
- return null;
- }
- part = part.substring(0, part.length() - 1);
- // try {
- return new BigInteger(part);
- // } catch( NumberFormatException e ) {
- // throw new ParseException( whole, index );
- // }
- }
-
- /**
- * TODO: Javadoc.
- *
- * @param whole TODO: ???.
- * @param part TODO: ???.
- * @param index TODO: ???.
- *
- * @return TODO: ???.
- *
- * @throws IllegalArgumentException TODO: ???.
- */
- private static BigDecimal parseBigDecimal(
- String whole,
- String part,
- int index)
- throws IllegalArgumentException {
- if (part == null) {
- return null;
- }
- part = part.substring(0, part.length() - 1);
- // NumberFormatException is IllegalArgumentException
- // try {
- return new BigDecimal(part);
- // } catch( NumberFormatException e ) {
- // throw new ParseException( whole, index );
- // }
- }
-
- /**
- * <p>Four constants defined for the comparison of durations.</p>
- */
- private static final XMLGregorianCalendar[] TEST_POINTS = new XMLGregorianCalendar[] {
- XMLGregorianCalendarImpl.parse("1696-09-01T00:00:00Z"),
- XMLGregorianCalendarImpl.parse("1697-02-01T00:00:00Z"),
- XMLGregorianCalendarImpl.parse("1903-03-01T00:00:00Z"),
- XMLGregorianCalendarImpl.parse("1903-07-01T00:00:00Z")
- };
-
- /**
- * <p>Partial order relation comparison with this <code>Duration</code> instance.</p>
- *
- * <p>Comparison result must be in accordance with
- * <a href="http://www.w3.org/TR/xmlschema-2/#duration-order">W3C XML Schema 1.0 Part 2, Section 3.2.7.6.2,
- * <i>Order relation on duration</i></a>.</p>
- *
- * <p>Return:</p>
- * <ul>
- * <li>{@link DatatypeConstants#LESSER} if this <code>Duration</code> is shorter than <code>duration</code> parameter</li>
- * <li>{@link DatatypeConstants#EQUAL} if this <code>Duration</code> is equal to <code>duration</code> parameter</li>
- * <li>{@link DatatypeConstants#GREATER} if this <code>Duration</code> is longer than <code>duration</code> parameter</li>
- * <li>{@link DatatypeConstants#INDETERMINATE} if a conclusive partial order relation cannot be determined</li>
- * </ul>
- *
- * @param duration to compare
- *
- * @return the relationship between <code>this</code> <code>Duration</code>and <code>duration</code> parameter as
- * {@link DatatypeConstants#LESSER}, {@link DatatypeConstants#EQUAL}, {@link DatatypeConstants#GREATER}
- * or {@link DatatypeConstants#INDETERMINATE}.
- *
- * @throws UnsupportedOperationException If the underlying implementation
- * cannot reasonably process the request, e.g. W3C XML Schema allows for
- * arbitrarily large/small/precise values, the request may be beyond the
- * implementations capability.
- * @throws NullPointerException if <code>duration</code> is <code>null</code>.
- *
- * @see #isShorterThan(Duration)
- * @see #isLongerThan(Duration)
- */
- public int compare(Duration rhs) {
-
- BigInteger maxintAsBigInteger = BigInteger.valueOf((long) Integer.MAX_VALUE);
- BigInteger minintAsBigInteger = BigInteger.valueOf((long) Integer.MIN_VALUE);
-
- // check for fields that are too large in this Duration
- if (years != null && years.compareTo(maxintAsBigInteger) == 1) {
- throw new UnsupportedOperationException(
- DatatypeMessageFormatter.formatMessage(null, "TooLarge",
- new Object[]{this.getClass().getName() + "#compare(Duration duration)" + DatatypeConstants.YEARS.toString(), years.toString()})
- //this.getClass().getName() + "#compare(Duration duration)"
- //+ " years too large to be supported by this implementation "
- //+ years.toString()
- );
- }
- if (months != null && months.compareTo(maxintAsBigInteger) == 1) {
- throw new UnsupportedOperationException(
- DatatypeMessageFormatter.formatMessage(null, "TooLarge",
- new Object[]{this.getClass().getName() + "#compare(Duration duration)" + DatatypeConstants.MONTHS.toString(), months.toString()})
-
- //this.getClass().getName() + "#compare(Duration duration)"
- //+ " months too large to be supported by this implementation "
- //+ months.toString()
- );
- }
- if (days != null && days.compareTo(maxintAsBigInteger) == 1) {
- throw new UnsupportedOperationException(
- DatatypeMessageFormatter.formatMessage(null, "TooLarge",
- new Object[]{this.getClass().getName() + "#compare(Duration duration)" + DatatypeConstants.DAYS.toString(), days.toString()})
-
- //this.getClass().getName() + "#compare(Duration duration)"
- //+ " days too large to be supported by this implementation "
- //+ days.toString()
- );
- }
- if (hours != null && hours.compareTo(maxintAsBigInteger) == 1) {
- throw new UnsupportedOperationException(
- DatatypeMessageFormatter.formatMessage(null, "TooLarge",
- new Object[]{this.getClass().getName() + "#compare(Duration duration)" + DatatypeConstants.HOURS.toString(), hours.toString()})
-
- //this.getClass().getName() + "#compare(Duration duration)"
- //+ " hours too large to be supported by this implementation "
- //+ hours.toString()
- );
- }
- if (minutes != null && minutes.compareTo(maxintAsBigInteger) == 1) {
- throw new UnsupportedOperationException(
- DatatypeMessageFormatter.formatMessage(null, "TooLarge",
- new Object[]{this.getClass().getName() + "#compare(Duration duration)" + DatatypeConstants.MINUTES.toString(), minutes.toString()})
-
- //this.getClass().getName() + "#compare(Duration duration)"
- //+ " minutes too large to be supported by this implementation "
- //+ minutes.toString()
- );
- }
- if (seconds != null && seconds.toBigInteger().compareTo(maxintAsBigInteger) == 1) {
- throw new UnsupportedOperationException(
- DatatypeMessageFormatter.formatMessage(null, "TooLarge",
- new Object[]{this.getClass().getName() + "#compare(Duration duration)" + DatatypeConstants.SECONDS.toString(), seconds.toString()})
-
- //this.getClass().getName() + "#compare(Duration duration)"
- //+ " seconds too large to be supported by this implementation "
- //+ seconds.toString()
- );
- }
-
- // check for fields that are too large in rhs Duration
- BigInteger rhsYears = (BigInteger) rhs.getField(DatatypeConstants.YEARS);
- if (rhsYears != null && rhsYears.compareTo(maxintAsBigInteger) == 1) {
- throw new UnsupportedOperationException(
- DatatypeMessageFormatter.formatMessage(null, "TooLarge",
- new Object[]{this.getClass().getName() + "#compare(Duration duration)" + DatatypeConstants.YEARS.toString(), rhsYears.toString()})
-
- //this.getClass().getName() + "#compare(Duration duration)"
- //+ " years too large to be supported by this implementation "
- //+ rhsYears.toString()
- );
- }
- BigInteger rhsMonths = (BigInteger) rhs.getField(DatatypeConstants.MONTHS);
- if (rhsMonths != null && rhsMonths.compareTo(maxintAsBigInteger) == 1) {
- throw new UnsupportedOperationException(
- DatatypeMessageFormatter.formatMessage(null, "TooLarge",
- new Object[]{this.getClass().getName() + "#compare(Duration duration)" + DatatypeConstants.MONTHS.toString(), rhsMonths.toString()})
-
- //this.getClass().getName() + "#compare(Duration duration)"
- //+ " months too large to be supported by this implementation "
- //+ rhsMonths.toString()
- );
- }
- BigInteger rhsDays = (BigInteger) rhs.getField(DatatypeConstants.DAYS);
- if (rhsDays != null && rhsDays.compareTo(maxintAsBigInteger) == 1) {
- throw new UnsupportedOperationException(
- DatatypeMessageFormatter.formatMessage(null, "TooLarge",
- new Object[]{this.getClass().getName() + "#compare(Duration duration)" + DatatypeConstants.DAYS.toString(), rhsDays.toString()})
-
- //this.getClass().getName() + "#compare(Duration duration)"
- //+ " days too large to be supported by this implementation "
- //+ rhsDays.toString()
- );
- }
- BigInteger rhsHours = (BigInteger) rhs.getField(DatatypeConstants.HOURS);
- if (rhsHours != null && rhsHours.compareTo(maxintAsBigInteger) == 1) {
- throw new UnsupportedOperationException(
- DatatypeMessageFormatter.formatMessage(null, "TooLarge",
- new Object[]{this.getClass().getName() + "#compare(Duration duration)" + DatatypeConstants.HOURS.toString(), rhsHours.toString()})
-
- //this.getClass().getName() + "#compare(Duration duration)"
- //+ " hours too large to be supported by this implementation "
- //+ rhsHours.toString()
- );
- }
- BigInteger rhsMinutes = (BigInteger) rhs.getField(DatatypeConstants.MINUTES);
- if (rhsMinutes != null && rhsMinutes.compareTo(maxintAsBigInteger) == 1) {
- throw new UnsupportedOperationException(
- DatatypeMessageFormatter.formatMessage(null, "TooLarge",
- new Object[]{this.getClass().getName() + "#compare(Duration duration)" + DatatypeConstants.MINUTES.toString(), rhsMinutes.toString()})
-
- //this.getClass().getName() + "#compare(Duration duration)"
- //+ " minutes too large to be supported by this implementation "
- //+ rhsMinutes.toString()
- );
- }
- BigDecimal rhsSecondsAsBigDecimal = (BigDecimal) rhs.getField(DatatypeConstants.SECONDS);
- BigInteger rhsSeconds = null;
- if ( rhsSecondsAsBigDecimal != null ) {
- rhsSeconds = rhsSecondsAsBigDecimal.toBigInteger();
- }
- if (rhsSeconds != null && rhsSeconds.compareTo(maxintAsBigInteger) == 1) {
- throw new UnsupportedOperationException(
- DatatypeMessageFormatter.formatMessage(null, "TooLarge",
- new Object[]{this.getClass().getName() + "#compare(Duration duration)" + DatatypeConstants.SECONDS.toString(), rhsSeconds.toString()})
-
- //this.getClass().getName() + "#compare(Duration duration)"
- //+ " seconds too large to be supported by this implementation "
- //+ rhsSeconds.toString()
- );
- }
-
- // turn this Duration into a GregorianCalendar
- GregorianCalendar lhsCalendar = new GregorianCalendar(
- 1970,
- 1,
- 1,
- 0,
- 0,
- 0);
- lhsCalendar.add(GregorianCalendar.YEAR, getYears() * getSign());
- lhsCalendar.add(GregorianCalendar.MONTH, getMonths() * getSign());
- lhsCalendar.add(GregorianCalendar.DAY_OF_YEAR, getDays() * getSign());
- lhsCalendar.add(GregorianCalendar.HOUR_OF_DAY, getHours() * getSign());
- lhsCalendar.add(GregorianCalendar.MINUTE, getMinutes() * getSign());
- lhsCalendar.add(GregorianCalendar.SECOND, getSeconds() * getSign());
-
- // turn compare Duration into a GregorianCalendar
- GregorianCalendar rhsCalendar = new GregorianCalendar(
- 1970,
- 1,
- 1,
- 0,
- 0,
- 0);
- rhsCalendar.add(GregorianCalendar.YEAR, rhs.getYears() * rhs.getSign());
- rhsCalendar.add(GregorianCalendar.MONTH, rhs.getMonths() * rhs.getSign());
- rhsCalendar.add(GregorianCalendar.DAY_OF_YEAR, rhs.getDays() * rhs.getSign());
- rhsCalendar.add(GregorianCalendar.HOUR_OF_DAY, rhs.getHours() * rhs.getSign());
- rhsCalendar.add(GregorianCalendar.MINUTE, rhs.getMinutes() * rhs.getSign());
- rhsCalendar.add(GregorianCalendar.SECOND, rhs.getSeconds() * rhs.getSign());
-
-
- if (lhsCalendar.equals(rhsCalendar)) {
- return DatatypeConstants.EQUAL;
- }
-
- return compareDates(this, rhs);
- }
-
- /**
- * Compares 2 given durations. (refer to W3C Schema Datatypes "3.2.6 duration")
- *
- * @param duration1 Unnormalized duration
- * @param duration2 Unnormalized duration
- * @return INDETERMINATE if the order relationship between date1 and date2 is indeterminate.
- * EQUAL if the order relation between date1 and date2 is EQUAL.
- * If the strict parameter is true, return LESS_THAN if date1 is less than date2 and
- * return GREATER_THAN if date1 is greater than date2.
- * If the strict parameter is false, return LESS_THAN if date1 is less than OR equal to date2 and
- * return GREATER_THAN if date1 is greater than OR equal to date2
- */
- private int compareDates(Duration duration1, Duration duration2) {
-
- int resultA = DatatypeConstants.INDETERMINATE;
- int resultB = DatatypeConstants.INDETERMINATE;
-
- XMLGregorianCalendar tempA = (XMLGregorianCalendar)TEST_POINTS[0].clone();
- XMLGregorianCalendar tempB = (XMLGregorianCalendar)TEST_POINTS[0].clone();
-
- //long comparison algorithm is required
- tempA.add(duration1);
- tempB.add(duration2);
- resultA = tempA.compare(tempB);
- if ( resultA == DatatypeConstants.INDETERMINATE ) {
- return DatatypeConstants.INDETERMINATE;
- }
-
- tempA = (XMLGregorianCalendar)TEST_POINTS[1].clone();
- tempB = (XMLGregorianCalendar)TEST_POINTS[1].clone();
-
- tempA.add(duration1);
- tempB.add(duration2);
- resultB = tempA.compare(tempB);
- resultA = compareResults(resultA, resultB);
- if (resultA == DatatypeConstants.INDETERMINATE) {
- return DatatypeConstants.INDETERMINATE;
- }
-
- tempA = (XMLGregorianCalendar)TEST_POINTS[2].clone();
- tempB = (XMLGregorianCalendar)TEST_POINTS[2].clone();
-
- tempA.add(duration1);
- tempB.add(duration2);
- resultB = tempA.compare(tempB);
- resultA = compareResults(resultA, resultB);
- if (resultA == DatatypeConstants.INDETERMINATE) {
- return DatatypeConstants.INDETERMINATE;
- }
-
- tempA = (XMLGregorianCalendar)TEST_POINTS[3].clone();
- tempB = (XMLGregorianCalendar)TEST_POINTS[3].clone();
-
- tempA.add(duration1);
- tempB.add(duration2);
- resultB = tempA.compare(tempB);
- resultA = compareResults(resultA, resultB);
-
- return resultA;
- }
-
- private int compareResults(int resultA, int resultB){
-
- if ( resultB == DatatypeConstants.INDETERMINATE ) {
- return DatatypeConstants.INDETERMINATE;
- }
- else if ( resultA!=resultB) {
- return DatatypeConstants.INDETERMINATE;
- }
- return resultA;
- }
-
- /**
- * Returns a hash code consistent with the definition of the equals method.
- *
- * @see Object#hashCode()
- */
- public int hashCode() {
- // component wise hash is not correct because 1day = 24hours
- Calendar cal = TEST_POINTS[0].toGregorianCalendar();
- this.addTo(cal);
- return (int) getCalendarTimeInMillis(cal);
- }
-
- /**
- * Returns a string representation of this duration object.
- *
- * <p>
- * The result is formatter according to the XML Schema 1.0
- * spec and can be always parsed back later into the
- * equivalent duration object by
- * the {@link #DurationImpl(String)} constructor.
- *
- * <p>
- * Formally, the following holds for any {@link Duration}
- * object x.
- * <pre>
- * new Duration(x.toString()).equals(x)
- * </pre>
- *
- * @return
- * Always return a non-null valid String object.
- */
- public String toString() {
- StringBuffer buf = new StringBuffer();
- if (signum < 0) {
- buf.append('-');
- }
- buf.append('P');
-
- if (years != null) {
- buf.append(years + "Y");
- }
- if (months != null) {
- buf.append(months + "M");
- }
- if (days != null) {
- buf.append(days + "D");
- }
-
- if (hours != null || minutes != null || seconds != null) {
- buf.append('T');
- if (hours != null) {
- buf.append(hours + "H");
- }
- if (minutes != null) {
- buf.append(minutes + "M");
- }
- if (seconds != null) {
- buf.append(toString(seconds) + "S");
- }
- }
-
- return buf.toString();
- }
-
- /**
- * <p>Turns {@link BigDecimal} to a string representation.</p>
- *
- * <p>Due to a behavior change in the {@link BigDecimal#toString()}
- * method in JDK1.5, this had to be implemented here.</p>
- *
- * @param bd <code>BigDecimal</code> to format as a <code>String</code>
- *
- * @return <code>String</code> representation of <code>BigDecimal</code>
- */
- private String toString(BigDecimal bd) {
- String intString = bd.unscaledValue().toString();
- int scale = bd.scale();
-
- if (scale == 0) {
- return intString;
- }
-
- /* Insert decimal point */
- StringBuffer buf;
- int insertionPoint = intString.length() - scale;
- if (insertionPoint == 0) { /* Point goes right before intVal */
- return "0." + intString;
- } else if (insertionPoint > 0) { /* Point goes inside intVal */
- buf = new StringBuffer(intString);
- buf.insert(insertionPoint, '.');
- } else { /* We must insert zeros between point and intVal */
- buf = new StringBuffer(3 - insertionPoint + intString.length());
- buf.append("0.");
- for (int i = 0; i < -insertionPoint; i++) {
- buf.append('0');
- }
- buf.append(intString);
- }
- return buf.toString();
- }
-
- /**
- * Checks if a field is set.
- *
- * A field of a duration object may or may not be present.
- * This method can be used to test if a field is present.
- *
- * @param field
- * one of the six Field constants (YEARS,MONTHS,DAYS,HOURS,
- * MINUTES, or SECONDS.)
- * @return
- * true if the field is present. false if not.
- *
- * @throws NullPointerException
- * If the field parameter is null.
- */
- public boolean isSet(DatatypeConstants.Field field) {
-
- if (field == null) {
- String methodName = "javax.xml.datatype.Duration" + "#isSet(DatatypeConstants.Field field)" ;
- throw new NullPointerException(
- //"cannot be called with field == null"
- DatatypeMessageFormatter.formatMessage(null, "FieldCannotBeNull", new Object[]{methodName})
- );
- }
-
- if (field == DatatypeConstants.YEARS) {
- return years != null;
- }
-
- if (field == DatatypeConstants.MONTHS) {
- return months != null;
- }
-
- if (field == DatatypeConstants.DAYS) {
- return days != null;
- }
-
- if (field == DatatypeConstants.HOURS) {
- return hours != null;
- }
-
- if (field == DatatypeConstants.MINUTES) {
- return minutes != null;
- }
-
- if (field == DatatypeConstants.SECONDS) {
- return seconds != null;
- }
- String methodName = "javax.xml.datatype.Duration" + "#isSet(DatatypeConstants.Field field)";
-
- throw new IllegalArgumentException(
- DatatypeMessageFormatter.formatMessage(null,"UnknownField", new Object[]{methodName, field.toString()})
- );
-
- }
-
- /**
- * Gets the value of a field.
- *
- * Fields of a duration object may contain arbitrary large value.
- * Therefore this method is designed to return a {@link Number} object.
- *
- * In case of YEARS, MONTHS, DAYS, HOURS, and MINUTES, the returned
- * number will be a non-negative integer. In case of seconds,
- * the returned number may be a non-negative decimal value.
- *
- * @param field
- * one of the six Field constants (YEARS,MONTHS,DAYS,HOURS,
- * MINUTES, or SECONDS.)
- * @return
- * If the specified field is present, this method returns
- * a non-null non-negative {@link Number} object that
- * represents its value. If it is not present, return null.
- * For YEARS, MONTHS, DAYS, HOURS, and MINUTES, this method
- * returns a {@link BigInteger} object. For SECONDS, this
- * method returns a {@link BigDecimal}.
- *
- * @throws NullPointerException
- * If the field parameter is null.
- */
- public Number getField(DatatypeConstants.Field field) {
-
- if (field == null) {
- String methodName = "javax.xml.datatype.Duration" + "#isSet(DatatypeConstants.Field field) " ;
-
- throw new NullPointerException(
- DatatypeMessageFormatter.formatMessage(null,"FieldCannotBeNull", new Object[]{methodName})
- );
- }
-
- if (field == DatatypeConstants.YEARS) {
- return years;
- }
-
- if (field == DatatypeConstants.MONTHS) {
- return months;
- }
-
- if (field == DatatypeConstants.DAYS) {
- return days;
- }
-
- if (field == DatatypeConstants.HOURS) {
- return hours;
- }
-
- if (field == DatatypeConstants.MINUTES) {
- return minutes;
- }
-
- if (field == DatatypeConstants.SECONDS) {
- return seconds;
- }
- /**
- throw new IllegalArgumentException(
- "javax.xml.datatype.Duration"
- + "#(getSet(DatatypeConstants.Field field) called with an unknown field: "
- + field.toString()
- );
- */
- String methodName = "javax.xml.datatype.Duration" + "#(getSet(DatatypeConstants.Field field)";
-
- throw new IllegalArgumentException(
- DatatypeMessageFormatter.formatMessage(null,"UnknownField", new Object[]{methodName, field.toString()})
- );
-
- }
-
- /**
- * Obtains the value of the YEARS field as an integer value,
- * or 0 if not present.
- *
- * <p>
- * This method is a convenience method around the
- * {@link #getField(DatatypeConstants.Field)} method.
- *
- * <p>
- * Note that since this method returns <tt>int</tt>, this
- * method will return an incorrect value for {@link Duration}s
- * with the year field that goes beyond the range of <tt>int</tt>.
- * Use <code>getField(YEARS)</code> to avoid possible loss of precision.</p>
- *
- * @return
- * If the YEARS field is present, return
- * its value as an integer by using the {@link Number#intValue()}
- * method. If the YEARS field is not present, return 0.
- */
- public int getYears() {
- return getInt(DatatypeConstants.YEARS);
- }
-
- /**
- * Obtains the value of the MONTHS field as an integer value,
- * or 0 if not present.
- *
- * This method works just like {@link #getYears()} except
- * that this method works on the MONTHS field.
- *
- * @return Months of this <code>Duration</code>.
- */
- public int getMonths() {
- return getInt(DatatypeConstants.MONTHS);
- }
-
- /**
- * Obtains the value of the DAYS field as an integer value,
- * or 0 if not present.
- *
- * This method works just like {@link #getYears()} except
- * that this method works on the DAYS field.
- *
- * @return Days of this <code>Duration</code>.
- */
- public int getDays() {
- return getInt(DatatypeConstants.DAYS);
- }
-
- /**
- * Obtains the value of the HOURS field as an integer value,
- * or 0 if not present.
- *
- * This method works just like {@link #getYears()} except
- * that this method works on the HOURS field.
- *
- * @return Hours of this <code>Duration</code>.
- *
- */
- public int getHours() {
- return getInt(DatatypeConstants.HOURS);
- }
-
- /**
- * Obtains the value of the MINUTES field as an integer value,
- * or 0 if not present.
- *
- * This method works just like {@link #getYears()} except
- * that this method works on the MINUTES field.
- *
- * @return Minutes of this <code>Duration</code>.
- *
- */
- public int getMinutes() {
- return getInt(DatatypeConstants.MINUTES);
- }
-
- /**
- * Obtains the value of the SECONDS field as an integer value,
- * or 0 if not present.
- *
- * This method works just like {@link #getYears()} except
- * that this method works on the SECONDS field.
- *
- * @return seconds in the integer value. The fraction of seconds
- * will be discarded (for example, if the actual value is 2.5,
- * this method returns 2)
- */
- public int getSeconds() {
- return getInt(DatatypeConstants.SECONDS);
- }
-
- /**
- * <p>Return the requested field value as an int.</p>
- *
- * <p>If field is not set, i.e. == null, 0 is returned.</p>
- *
- * @param field To get value for.
- *
- * @return int value of field or 0 if field is not set.
- */
- private int getInt(DatatypeConstants.Field field) {
- Number n = getField(field);
- if (n == null) {
- return 0;
- } else {
- return n.intValue();
- }
- }
-
- /**
- * <p>Returns the length of the duration in milli-seconds.</p>
- *
- * <p>If the seconds field carries more digits than milli-second order,
- * those will be simply discarded (or in other words, rounded to zero.)
- * For example, for any Calendar value <code>x<code>,</p>
- * <pre>
- * <code>new Duration("PT10.00099S").getTimeInMills(x) == 10000</code>.
- * <code>new Duration("-PT10.00099S").getTimeInMills(x) == -10000</code>.
- * </pre>
- *
- * <p>
- * Note that this method uses the {@link #addTo(Calendar)} method,
- * which may work incorectly with {@link Duration} objects with
- * very large values in its fields. See the {@link #addTo(Calendar)}
- * method for details.
- *
- * @param startInstant
- * The length of a month/year varies. The <code>startInstant</code> is
- * used to disambiguate this variance. Specifically, this method
- * returns the difference between <code>startInstant</code> and
- * <code>startInstant+duration</code>
- *
- * @return milliseconds between <code>startInstant</code> and
- * <code>startInstant</code> plus this <code>Duration</code>
- *
- * @throws NullPointerException if <code>startInstant</code> parameter
- * is null.
- *
- */
- public long getTimeInMillis(final Calendar startInstant) {
- Calendar cal = (Calendar) startInstant.clone();
- addTo(cal);
- return getCalendarTimeInMillis(cal)
- - getCalendarTimeInMillis(startInstant);
- }
-
- /**
- * <p>Returns the length of the duration in milli-seconds.</p>
- *
- * <p>If the seconds field carries more digits than milli-second order,
- * those will be simply discarded (or in other words, rounded to zero.)
- * For example, for any <code>Date</code> value <code>x<code>,</p>
- * <pre>
- * <code>new Duration("PT10.00099S").getTimeInMills(x) == 10000</code>.
- * <code>new Duration("-PT10.00099S").getTimeInMills(x) == -10000</code>.
- * </pre>
- *
- * <p>
- * Note that this method uses the {@link #addTo(Date)} method,
- * which may work incorectly with {@link Duration} objects with
- * very large values in its fields. See the {@link #addTo(Date)}
- * method for details.
- *
- * @param startInstant
- * The length of a month/year varies. The <code>startInstant</code> is
- * used to disambiguate this variance. Specifically, this method
- * returns the difference between <code>startInstant</code> and
- * <code>startInstant+duration</code>.
- *
- * @throws NullPointerException
- * If the startInstant parameter is null.
- *
- * @return milliseconds between <code>startInstant</code> and
- * <code>startInstant</code> plus this <code>Duration</code>
- *
- * @see #getTimeInMillis(Calendar)
- */
- public long getTimeInMillis(final Date startInstant) {
- Calendar cal = new GregorianCalendar();
- cal.setTime(startInstant);
- this.addTo(cal);
- return getCalendarTimeInMillis(cal) - startInstant.getTime();
- }
-
-// /**
-// * Returns an equivalent but "normalized" duration value.
-// *
-// * Intuitively, the normalization moves YEARS into
-// * MONTHS (by x12) and moves DAYS, HOURS, and MINUTES fields
-// * into SECONDS (by x86400, x3600, and x60 respectively.)
-// *
-// *
-// * Formally, this method satisfies the following conditions:
-// * <ul>
-// * <li>x.normalize().equals(x)
-// * <li>!x.normalize().isSet(Duration.YEARS)
-// * <li>!x.normalize().isSet(Duration.DAYS)
-// * <li>!x.normalize().isSet(Duration.HOURS)
-// * <li>!x.normalize().isSet(Duration.MINUTES)
-// * </ul>
-// *
-// * @return
-// * always return a non-null valid value.
-// */
-// public Duration normalize() {
-// return null;
-// }
-
- /**
- * <p>Converts the years and months fields into the days field
- * by using a specific time instant as the reference point.</p>
- *
- * <p>For example, duration of one month normalizes to 31 days
- * given the start time instance "July 8th 2003, 17:40:32".</p>
- *
- * <p>Formally, the computation is done as follows:</p>
- * <ol>
- * <li>The given Calendar object is cloned.
- * <li>The years, months and days fields will be added to
- * the {@link Calendar} object
- * by using the {@link Calendar#add(int,int)} method.
- * <li>The difference between two Calendars are computed in terms of days.
- * <li>The computed days, along with the hours, minutes and seconds
- * fields of this duration object is used to construct a new
- * Duration object.
- * </ol>
- *
- * <p>Note that since the Calendar class uses <code>int</code> to
- * hold the value of year and month, this method may produce
- * an unexpected result if this duration object holds
- * a very large value in the years or months fields.</p>
- *
- * @param startTimeInstant <code>Calendar</code> reference point.
- *
- * @return <code>Duration</code> of years and months of this <code>Duration</code> as days.
- *
- * @throws NullPointerException If the startTimeInstant parameter is null.
- */
- public Duration normalizeWith(Calendar startTimeInstant) {
-
- Calendar c = (Calendar) startTimeInstant.clone();
-
- // using int may cause overflow, but
- // Calendar internally treats value as int anyways.
- c.add(Calendar.YEAR, getYears() * signum);
- c.add(Calendar.MONTH, getMonths() * signum);
- c.add(Calendar.DAY_OF_MONTH, getDays() * signum);
-
- // obtain the difference in terms of days
- long diff = getCalendarTimeInMillis(c) - getCalendarTimeInMillis(startTimeInstant);
- int days = (int) (diff / (1000L * 60L * 60L * 24L));
-
- return new DurationImpl(
- days >= 0,
- null,
- null,
- wrap(Math.abs(days)),
- (BigInteger) getField(DatatypeConstants.HOURS),
- (BigInteger) getField(DatatypeConstants.MINUTES),
- (BigDecimal) getField(DatatypeConstants.SECONDS));
- }
-
- /**
- * <p>Computes a new duration whose value is <code>factor</code> times
- * longer than the value of this duration.</p>
- *
- * <p>This method is provided for the convenience.
- * It is functionally equivalent to the following code:</p>
- * <pre>
- * multiply(new BigDecimal(String.valueOf(factor)))
- * </pre>
- *
- * @param factor Factor times longer of new <code>Duration</code> to create.
- *
- * @return New <code>Duration</code> that is <code>factor</code>times longer than this <code>Duration</code>.
- *
- * @see #multiply(BigDecimal)
- */
- public Duration multiply(int factor) {
- return multiply(BigDecimal.valueOf(factor));
- }
-
- /**
- * Computes a new duration whose value is <code>factor</code> times
- * longer than the value of this duration.
- *
- * <p>
- * For example,
- * <pre>
- * "P1M" (1 month) * "12" = "P12M" (12 months)
- * "PT1M" (1 min) * "0.3" = "PT18S" (18 seconds)
- * "P1M" (1 month) * "1.5" = IllegalStateException
- * </pre>
- *
- * <p>
- * Since the {@link Duration} class is immutable, this method
- * doesn't change the value of this object. It simply computes
- * a new Duration object and returns it.
- *
- * <p>
- * The operation will be performed field by field with the precision
- * of {@link BigDecimal}. Since all the fields except seconds are
- * restricted to hold integers,
- * any fraction produced by the computation will be
- * carried down toward the next lower unit. For example,
- * if you multiply "P1D" (1 day) with "0.5", then it will be 0.5 day,
- * which will be carried down to "PT12H" (12 hours).
- * When fractions of month cannot be meaningfully carried down
- * to days, or year to months, this will cause an
- * {@link IllegalStateException} to be thrown.
- * For example if you multiple one month by 0.5.</p>
- *
- * <p>
- * To avoid {@link IllegalStateException}, use
- * the {@link #normalizeWith(Calendar)} method to remove the years
- * and months fields.
- *
- * @param factor to multiply by
- *
- * @return
- * returns a non-null valid {@link Duration} object
- *
- * @throws IllegalStateException if operation produces fraction in
- * the months field.
- *
- * @throws NullPointerException if the <code>factor</code> parameter is
- * <code>null</code>.
- *
- */
- public Duration multiply(BigDecimal factor) {
- BigDecimal carry = ZERO;
- int factorSign = factor.signum();
- factor = factor.abs();
-
- BigDecimal[] buf = new BigDecimal[6];
-
- for (int i = 0; i < 5; i++) {
- BigDecimal bd = getFieldAsBigDecimal(FIELDS[i]);
- bd = bd.multiply(factor).add(carry);
-
- buf[i] = bd.setScale(0, BigDecimal.ROUND_DOWN);
-
- bd = bd.subtract(buf[i]);
- if (i == 1) {
- if (bd.signum() != 0) {
- throw new IllegalStateException(); // illegal carry-down
- } else {
- carry = ZERO;
- }
- } else {
- carry = bd.multiply(FACTORS[i]);
- }
- }
-
- if (seconds != null) {
- buf[5] = seconds.multiply(factor).add(carry);
- } else {
- buf[5] = carry;
- }
-
- return new DurationImpl(
- this.signum * factorSign >= 0,
- toBigInteger(buf[0], null == years),
- toBigInteger(buf[1], null == months),
- toBigInteger(buf[2], null == days),
- toBigInteger(buf[3], null == hours),
- toBigInteger(buf[4], null == minutes),
- (buf[5].signum() == 0 && seconds == null) ? null : buf[5]);
- }
-
- /**
- * <p>Gets the value of the field as a {@link BigDecimal}.</p>
- *
- * <p>If the field is unset, return 0.</p>
- *
- * @param f Field to get value for.
- *
- * @return non-null valid {@link BigDecimal}.
- */
- private BigDecimal getFieldAsBigDecimal(DatatypeConstants.Field f) {
- if (f == DatatypeConstants.SECONDS) {
- if (seconds != null) {
- return seconds;
- } else {
- return ZERO;
- }
- } else {
- BigInteger bi = (BigInteger) getField(f);
- if (bi == null) {
- return ZERO;
- } else {
- return new BigDecimal(bi);
- }
- }
- }
-
- /**
- * <p>BigInteger value of BigDecimal value.</p>
- *
- * @param value Value to convert.
- * @param canBeNull Can returned value be null?
- *
- * @return BigInteger value of BigDecimal, possibly null.
- */
- private static BigInteger toBigInteger(
- BigDecimal value,
- boolean canBeNull) {
- if (canBeNull && value.signum() == 0) {
- return null;
- } else {
- return value.unscaledValue();
- }
- }
-
- /**
- * 1 unit of FIELDS[i] is equivalent to <code>FACTORS[i]</code> unit of
- * FIELDS[i+1].
- */
- private static final BigDecimal[] FACTORS = new BigDecimal[]{
- BigDecimal.valueOf(12),
- null/*undefined*/,
- BigDecimal.valueOf(24),
- BigDecimal.valueOf(60),
- BigDecimal.valueOf(60)
- };
-
- /**
- * <p>Computes a new duration whose value is <code>this+rhs</code>.</p>
- *
- * <p>For example,</p>
- * <pre>
- * "1 day" + "-3 days" = "-2 days"
- * "1 year" + "1 day" = "1 year and 1 day"
- * "-(1 hour,50 minutes)" + "-20 minutes" = "-(1 hours,70 minutes)"
- * "15 hours" + "-3 days" = "-(2 days,9 hours)"
- * "1 year" + "-1 day" = IllegalStateException
- * </pre>
- *
- * <p>Since there's no way to meaningfully subtract 1 day from 1 month,
- * there are cases where the operation fails in
- * {@link IllegalStateException}.</p>
- *
- * <p>
- * Formally, the computation is defined as follows.</p>
- * <p>
- * Firstly, we can assume that two {@link Duration}s to be added
- * are both positive without losing generality (i.e.,
- * <code>(-X)+Y=Y-X</code>, <code>X+(-Y)=X-Y</code>,
- * <code>(-X)+(-Y)=-(X+Y)</code>)
- *
- * <p>
- * Addition of two positive {@link Duration}s are simply defined as
- * field by field addition where missing fields are treated as 0.
- * <p>
- * A field of the resulting {@link Duration} will be unset if and
- * only if respective fields of two input {@link Duration}s are unset.
- * <p>
- * Note that <code>lhs.add(rhs)</code> will be always successful if
- * <code>lhs.signum()*rhs.signum()!=-1</code> or both of them are
- * normalized.</p>
- *
- * @param rhs <code>Duration</code> to add to this <code>Duration</code>
- *
- * @return
- * non-null valid Duration object.
- *
- * @throws NullPointerException
- * If the rhs parameter is null.
- * @throws IllegalStateException
- * If two durations cannot be meaningfully added. For
- * example, adding negative one day to one month causes
- * this exception.
- *
- *
- * @see #subtract(Duration)
- */
- public Duration add(final Duration rhs) {
- Duration lhs = this;
- BigDecimal[] buf = new BigDecimal[6];
-
- buf[0] = sanitize((BigInteger) lhs.getField(DatatypeConstants.YEARS),
- lhs.getSign()).add(sanitize((BigInteger) rhs.getField(DatatypeConstants.YEARS), rhs.getSign()));
- buf[1] = sanitize((BigInteger) lhs.getField(DatatypeConstants.MONTHS),
- lhs.getSign()).add(sanitize((BigInteger) rhs.getField(DatatypeConstants.MONTHS), rhs.getSign()));
- buf[2] = sanitize((BigInteger) lhs.getField(DatatypeConstants.DAYS),
- lhs.getSign()).add(sanitize((BigInteger) rhs.getField(DatatypeConstants.DAYS), rhs.getSign()));
- buf[3] = sanitize((BigInteger) lhs.getField(DatatypeConstants.HOURS),
- lhs.getSign()).add(sanitize((BigInteger) rhs.getField(DatatypeConstants.HOURS), rhs.getSign()));
- buf[4] = sanitize((BigInteger) lhs.getField(DatatypeConstants.MINUTES),
- lhs.getSign()).add(sanitize((BigInteger) rhs.getField(DatatypeConstants.MINUTES), rhs.getSign()));
- buf[5] = sanitize((BigDecimal) lhs.getField(DatatypeConstants.SECONDS),
- lhs.getSign()).add(sanitize((BigDecimal) rhs.getField(DatatypeConstants.SECONDS), rhs.getSign()));
-
- // align sign
- alignSigns(buf, 0, 2); // Y,M
- alignSigns(buf, 2, 6); // D,h,m,s
-
- // make sure that the sign bit is consistent across all 6 fields.
- int s = 0;
- for (int i = 0; i < 6; i++) {
- if (s * buf[i].signum() < 0) {
- throw new IllegalStateException();
- }
- if (s == 0) {
- s = buf[i].signum();
- }
- }
-
- return new DurationImpl(
- s >= 0,
- toBigInteger(sanitize(buf[0], s),
- lhs.getField(DatatypeConstants.YEARS) == null && rhs.getField(DatatypeConstants.YEARS) == null),
- toBigInteger(sanitize(buf[1], s),
- lhs.getField(DatatypeConstants.MONTHS) == null && rhs.getField(DatatypeConstants.MONTHS) == null),
- toBigInteger(sanitize(buf[2], s),
- lhs.getField(DatatypeConstants.DAYS) == null && rhs.getField(DatatypeConstants.DAYS) == null),
- toBigInteger(sanitize(buf[3], s),
- lhs.getField(DatatypeConstants.HOURS) == null && rhs.getField(DatatypeConstants.HOURS) == null),
- toBigInteger(sanitize(buf[4], s),
- lhs.getField(DatatypeConstants.MINUTES) == null && rhs.getField(DatatypeConstants.MINUTES) == null),
- (buf[5].signum() == 0
- && lhs.getField(DatatypeConstants.SECONDS) == null
- && rhs.getField(DatatypeConstants.SECONDS) == null) ? null : sanitize(buf[5], s));
- }
-
- private static void alignSigns(BigDecimal[] buf, int start, int end) {
- // align sign
- boolean touched;
-
- do { // repeat until all the sign bits become consistent
- touched = false;
- int s = 0; // sign of the left fields
-
- for (int i = start; i < end; i++) {
- if (s * buf[i].signum() < 0) {
- // this field has different sign than its left field.
- touched = true;
-
- // compute the number of unit that needs to be borrowed.
- BigDecimal borrow =
- buf[i].abs().divide(
- FACTORS[i - 1],
- BigDecimal.ROUND_UP);
- if (buf[i].signum() > 0) {
- borrow = borrow.negate();
- }
-
- // update values
- buf[i - 1] = buf[i - 1].subtract(borrow);
- buf[i] = buf[i].add(borrow.multiply(FACTORS[i - 1]));
- }
- if (buf[i].signum() != 0) {
- s = buf[i].signum();
- }
- }
- } while (touched);
- }
-
- /**
- * Compute <code>value*signum</code> where value==null is treated as
- * value==0.
- * @param value Value to sanitize.
- * @param signum 0 to sanitize to 0, > 0 to sanitize to <code>value</code>, < 0 to sanitize to negative <code>value</code>.
- *
- * @return non-null {@link BigDecimal}.
- */
- private static BigDecimal sanitize(BigInteger value, int signum) {
- if (signum == 0 || value == null) {
- return ZERO;
- }
- if (signum > 0) {
- return new BigDecimal(value);
- }
- return new BigDecimal(value.negate());
- }
-
- /**
- * <p>Compute <code>value*signum</code> where <code>value==null</code> is treated as <code>value==0</code></p>.
- *
- * @param value Value to sanitize.
- * @param signum 0 to sanitize to 0, > 0 to sanitize to <code>value</code>, < 0 to sanitize to negative <code>value</code>.
- *
- * @return non-null {@link BigDecimal}.
- */
- static BigDecimal sanitize(BigDecimal value, int signum) {
- if (signum == 0 || value == null) {
- return ZERO;
- }
- if (signum > 0) {
- return value;
- }
- return value.negate();
- }
-
- /**
- * <p>Computes a new duration whose value is <code>this-rhs</code>.</p>
- *
- * <p>For example:</p>
- * <pre>
- * "1 day" - "-3 days" = "4 days"
- * "1 year" - "1 day" = IllegalStateException
- * "-(1 hour,50 minutes)" - "-20 minutes" = "-(1hours,30 minutes)"
- * "15 hours" - "-3 days" = "3 days and 15 hours"
- * "1 year" - "-1 day" = "1 year and 1 day"
- * </pre>
- *
- * <p>Since there's no way to meaningfully subtract 1 day from 1 month,
- * there are cases where the operation fails in {@link IllegalStateException}.</p>
- *
- * <p>Formally the computation is defined as follows.
- * First, we can assume that two {@link Duration}s are both positive
- * without losing generality. (i.e.,
- * <code>(-X)-Y=-(X+Y)</code>, <code>X-(-Y)=X+Y</code>,
- * <code>(-X)-(-Y)=-(X-Y)</code>)</p>
- *
- * <p>Then two durations are subtracted field by field.
- * If the sign of any non-zero field <tt>F</tt> is different from
- * the sign of the most significant field,
- * 1 (if <tt>F</tt> is negative) or -1 (otherwise)
- * will be borrowed from the next bigger unit of <tt>F</tt>.</p>
- *
- * <p>This process is repeated until all the non-zero fields have
- * the same sign.</p>
- *
- * <p>If a borrow occurs in the days field (in other words, if
- * the computation needs to borrow 1 or -1 month to compensate
- * days), then the computation fails by throwing an
- * {@link IllegalStateException}.</p>
- *
- * @param rhs <code>Duration</code> to substract from this <code>Duration</code>.
- *
- * @return New <code>Duration</code> created from subtracting <code>rhs</code> from this <code>Duration</code>.
- *
- * @throws IllegalStateException
- * If two durations cannot be meaningfully subtracted. For
- * example, subtracting one day from one month causes
- * this exception.
- *
- * @throws NullPointerException
- * If the rhs parameter is null.
- *
- * @see #add(Duration)
- */
- public Duration subtract(final Duration rhs) {
- return add(rhs.negate());
- }
-
- /**
- * Returns a new {@link Duration} object whose
- * value is <code>-this</code>.
- *
- * <p>
- * Since the {@link Duration} class is immutable, this method
- * doesn't change the value of this object. It simply computes
- * a new Duration object and returns it.
- *
- * @return
- * always return a non-null valid {@link Duration} object.
- */
- public Duration negate() {
- return new DurationImpl(
- signum <= 0,
- years,
- months,
- days,
- hours,
- minutes,
- seconds);
- }
-
- /**
- * Returns the sign of this duration in -1,0, or 1.
- *
- * @return
- * -1 if this duration is negative, 0 if the duration is zero,
- * and 1 if the duration is postive.
- */
- public int signum() {
- return signum;
- }
-
-
- /**
- * Adds this duration to a {@link Calendar} object.
- *
- * <p>
- * Calls {@link java.util.Calendar#add(int,int)} in the
- * order of YEARS, MONTHS, DAYS, HOURS, MINUTES, SECONDS, and MILLISECONDS
- * if those fields are present. Because the {@link Calendar} class
- * uses int to hold values, there are cases where this method
- * won't work correctly (for example if values of fields
- * exceed the range of int.)
- * </p>
- *
- * <p>
- * Also, since this duration class is a Gregorian duration, this
- * method will not work correctly if the given {@link Calendar}
- * object is based on some other calendar systems.
- * </p>
- *
- * <p>
- * Any fractional parts of this {@link Duration} object
- * beyond milliseconds will be simply ignored. For example, if
- * this duration is "P1.23456S", then 1 is added to SECONDS,
- * 234 is added to MILLISECONDS, and the rest will be unused.
- * </p>
- *
- * <p>
- * Note that because {@link Calendar#add(int, int)} is using
- * <tt>int</tt>, {@link Duration} with values beyond the
- * range of <tt>int</tt> in its fields
- * will cause overflow/underflow to the given {@link Calendar}.
- * {@link XMLGregorianCalendar#add(Duration)} provides the same
- * basic operation as this method while avoiding
- * the overflow/underflow issues.
- *
- * @param calendar
- * A calendar object whose value will be modified.
- * @throws NullPointerException
- * if the calendar parameter is null.
- */
- public void addTo(Calendar calendar) {
- calendar.add(Calendar.YEAR, getYears() * signum);
- calendar.add(Calendar.MONTH, getMonths() * signum);
- calendar.add(Calendar.DAY_OF_MONTH, getDays() * signum);
- calendar.add(Calendar.HOUR, getHours() * signum);
- calendar.add(Calendar.MINUTE, getMinutes() * signum);
- calendar.add(Calendar.SECOND, getSeconds() * signum);
-
- if (seconds != null) {
- BigDecimal fraction =
- seconds.subtract(seconds.setScale(0, BigDecimal.ROUND_DOWN));
- int millisec = fraction.movePointRight(3).intValue();
- calendar.add(Calendar.MILLISECOND, millisec * signum);
- }
- }
-
- /**
- * Adds this duration to a {@link Date} object.
- *
- * <p>
- * The given date is first converted into
- * a {@link java.util.GregorianCalendar}, then the duration
- * is added exactly like the {@link #addTo(Calendar)} method.
- *
- * <p>
- * The updated time instant is then converted back into a
- * {@link Date} object and used to update the given {@link Date} object.
- *
- * <p>
- * This somewhat redundant computation is necessary to unambiguously
- * determine the duration of months and years.
- *
- * @param date
- * A date object whose value will be modified.
- * @throws NullPointerException
- * if the date parameter is null.
- */
- public void addTo(Date date) {
- Calendar cal = new GregorianCalendar();
- cal.setTime(date); // this will throw NPE if date==null
- this.addTo(cal);
- date.setTime(getCalendarTimeInMillis(cal));
- }
-
- /**
- * <p>Stream Unique Identifier.</p>
- *
- * <p>TODO: Serialization should use the XML string representation as
- * the serialization format to ensure future compatibility.</p>
- */
- private static final long serialVersionUID = 1L;
-
- /**
- * Writes {@link Duration} as a lexical representation
- * for maximum future compatibility.
- *
- * @return
- * An object that encapsulates the string
- * returned by <code>this.toString()</code>.
- */
- private Object writeReplace() throws IOException {
- return new DurationStream(this.toString());
- }
-
- /**
- * Representation of {@link Duration} in the object stream.
- *
- * @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
- */
- private static class DurationStream implements Serializable {
- private final String lexical;
-
- private DurationStream(String _lexical) {
- this.lexical = _lexical;
- }
-
- private Object readResolve() throws ObjectStreamException {
- // try {
- return new DurationImpl(lexical);
- // } catch( ParseException e ) {
- // throw new StreamCorruptedException("unable to parse "+lexical+" as duration");
- // }
- }
-
- private static final long serialVersionUID = 1L;
- }
-
- /**
- * Calls the {@link Calendar#getTimeInMillis} method.
- * Prior to JDK1.4, this method was protected and therefore
- * cannot be invoked directly.
- *
- * In future, this should be replaced by
- * <code>cal.getTimeInMillis()</code>
- */
- private static long getCalendarTimeInMillis(Calendar cal) {
- return cal.getTime().getTime();
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/datatype/DurationYearMonthImpl.java b/src/com/sun/org/apache/xerces/internal/jaxp/datatype/DurationYearMonthImpl.java
deleted file mode 100644
index abf8c53..0000000
--- a/src/com/sun/org/apache/xerces/internal/jaxp/datatype/DurationYearMonthImpl.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.org.apache.xerces.internal.jaxp.datatype;
-
-import java.math.BigInteger;
-import javax.xml.datatype.DatatypeConstants;
-
-
-/**
- * <p>Represent a subtype <code>xdt:yearMonthDuration</code> of a <code>Duration</code>
- * as specified in <a href="http://www.w3.org/TR/xpath-datamodel#yearMonthDuration">
- * XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration</a>.</p>
- *
- *
- * <p>The DurationYearMonth object represents a period of Gregorian time,
- * with a lexical representation, "<em>PnYnM</em>" that contains only year and month components.
- * </p>
- *
- *
- * @author <a href="mailto:Vikram.Aroskar@Sun.COM">Vikram Aroskar</a>
- * @author <a href="mailto:Huizhe.wang@oracle.com">Joe Wang</a>
- * @version $Revision: 1.1 $, $Date: 2010/05/19 05:02:55 $
-
- * @see XMLGregorianCalendar#add(Duration)
- */
-
-class DurationYearMonthImpl
- extends DurationImpl {
-
-
- /**
- * <p>Constructs a new Duration object by specifying each field individually.</p>
- *
- * <p>All the parameters are optional as long as at least one field is present.
- * If specified, parameters have to be zero or positive.</p>
- *
- * @param isPositive Set to <code>false</code> to create a negative duration. When the length
- * of the duration is zero, this parameter will be ignored.
- * @param years of this <code>Duration</code>
- * @param months of this <code>Duration</code>
- *
- * @throws IllegalArgumentException
- * If years, months parameters are all <code>null</code>. Or if any
- * of those parameters are negative.
- */
- public DurationYearMonthImpl(
- boolean isPositive,
- BigInteger years,
- BigInteger months) {
-
- super(isPositive, years, months, null, null, null, null);
- convertToCanonicalYearMonth();
- }
- /**
- * <p>Construct a <code>Duration</code> of type <code>xdt:yearMonthDuration</code> using the specified
- * <code>year</code> and <code>month</code> as defined in
- * <a href="http://www.w3.org/TR/xpath-datamodel#yearMonthDuration">
- * XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration</a>.</p>
- *
- * <p>A {@link DatatypeConstants#FIELD_UNDEFINED} value indicates that field is not set.</p>
- *
- * @param isPositive Set to <code>false</code> to create a negative duration. When the length
- * of the duration is zero, this parameter will be ignored.
- * @param year Year of <code>Duration</code>.
- * @param month Month of <code>Duration</code>.
- *
- * @throws IllegalArgumentException If the values are not a valid representation of a
- * <code>Duration</code>: if any of the fields (year, month) is negative.
- */
- protected DurationYearMonthImpl(
- final boolean isPositive,
- final int years,
- final int months) {
-
- this(isPositive,
- wrap(years),
- wrap(months));
-
-
- }
-
-
- /**
- * <p>Construct a <code>Duration</code> of type <code>xdt:yearMonthDuration</code> using the specified milliseconds as defined in
- * <a href="http://www.w3.org/TR/xpath-datamodel#yearMonthDuration">
- * XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration</a>.</p>
- *
- * <p>The datatype <code>xdt:yearMonthDuration</code> is a subtype of <code>xs:duration</code>
- * whose lexical representation contains only year and month components.
- * This datatype resides in the namespace {@link javax.xml.XMLConstants#W3C_XPATH_DATATYPE_NS_URI}.</p>
- *
- * <p>Both values are set by computing their values from the specified milliseconds
- * and are availabe using the <code>get</code> methods of the created {@link Duration}.
- * The values conform to and are defined by:</p>
- * <ul>
- * <li>ISO 8601:2000(E) Section 5.5.3.2 Alternative format</li>
- * <li><a href="http://www.w3.org/TR/xmlschema-2/#isoformats">
- * W3C XML Schema 1.0 Part 2, Appendix D, ISO 8601 Date and Time Formats</a>
- * </li>
- * <li>{@link XMLGregorianCalendar} Date/Time Datatype Field Mapping Between XML Schema 1.0 and Java Representation</li>
- * </ul>
- *
- * <p>The default start instance is defined by {@link GregorianCalendar}'s use of the start of the epoch: i.e.,
- * {@link java.util.Calendar#YEAR} = 1970,
- * {@link java.util.Calendar#MONTH} = {@link java.util.Calendar#JANUARY},
- * {@link java.util.Calendar#DATE} = 1, etc.
- * This is important as there are variations in the Gregorian Calendar,
- * e.g. leap years have different days in the month = {@link java.util.Calendar#FEBRUARY}
- * so the result of {@link Duration#getMonths()} can be influenced.</p>
- *
- * <p>Any remaining milliseconds after determining the year and month are discarded.</p>
- *
- * @param durationInMilliseconds Milliseconds of <code>Duration</code> to create.
- */
- protected DurationYearMonthImpl(long durationInMilliseconds) {
-
- super(durationInMilliseconds);
- convertToCanonicalYearMonth();
- //Any remaining milliseconds after determining the year and month are discarded.
- days = null;
- hours = null;
- minutes = null;
- seconds = null;
- signum = calcSignum((signum<0)?false:true);
- }
-
-
- /**
- * <p>Construct a <code>Duration</code> of type <code>xdt:yearMonthDuration</code> by parsing its <code>String</code> representation,
- * "<em>PnYnM</em>", <a href="http://www.w3.org/TR/xpath-datamodel#yearMonthDuration">
- * XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration</a>.</p>
- *
- * <p>The datatype <code>xdt:yearMonthDuration</code> is a subtype of <code>xs:duration</code>
- * whose lexical representation contains only year and month components.
- * This datatype resides in the namespace {@link javax.xml.XMLConstants#W3C_XPATH_DATATYPE_NS_URI}.</p>
- *
- * <p>Both values are set and availabe from the created {@link Duration}</p>
- *
- * <p>The XML Schema specification states that values can be of an arbitrary size.
- * Implementations may chose not to or be incapable of supporting arbitrarily large and/or small values.
- * An {@link UnsupportedOperationException} will be thrown with a message indicating implementation limits
- * if implementation capacities are exceeded.</p>
- *
- * @param lexicalRepresentation Lexical representation of a duration.
- *
- * @throws IllegalArgumentException If <code>lexicalRepresentation</code> is not a valid representation of a <code>Duration</code> expressed only in terms of years and months.
- * @throws UnsupportedOperationException If implementation cannot support requested values.
- * @throws NullPointerException If <code>lexicalRepresentation</code> is <code>null</code>.
- */
- protected DurationYearMonthImpl(String lexicalRepresentation) {
- super(lexicalRepresentation);
- if (getDays() > 0 || getHours() > 0
- || getMinutes() > 0 || getSeconds() > 0) {
- throw new IllegalArgumentException(
- "Trying to create an xdt:yearMonthDuration with an invalid"
- + " lexical representation of \"" + lexicalRepresentation
- + "\", data model requires PnYnM.");
- }
- convertToCanonicalYearMonth();
- }
-
- /**
- * The value space of xs:yearMonthDuration is the set of xs:integer month values.
- * @return the value of yearMonthDuration
- */
- public int getValue() {
- return getYears() * 12 + getMonths();
- }
-
- private void convertToCanonicalYearMonth() {
- while (getMonths() >= 12)
- {
- months = months.subtract(BigInteger.valueOf(12));
- years = BigInteger.valueOf((long) getYears()).add(BigInteger.ONE);
- }
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/datatype/XMLGregorianCalendarImpl.java b/src/com/sun/org/apache/xerces/internal/jaxp/datatype/XMLGregorianCalendarImpl.java
deleted file mode 100644
index 84543ec..0000000
--- a/src/com/sun/org/apache/xerces/internal/jaxp/datatype/XMLGregorianCalendarImpl.java
+++ /dev/null
@@ -1,3093 +0,0 @@
-/*
- * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.org.apache.xerces.internal.jaxp.datatype;
-
-import java.io.Serializable;
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.util.TimeZone;
-import java.util.Calendar;
-import java.util.GregorianCalendar;
-import java.util.Date;
-import java.util.Locale;
-
-import javax.xml.datatype.DatatypeConstants;
-import javax.xml.datatype.Duration;
-import javax.xml.datatype.XMLGregorianCalendar;
-import javax.xml.namespace.QName;
-import com.sun.org.apache.xerces.internal.util.DatatypeMessageFormatter;
-import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
-
-/**
- * <p>Representation for W3C XML Schema 1.0 date/time datatypes.
- * Specifically, these date/time datatypes are
- * {@link DatatypeConstants#DATETIME dateTime},
- * {@link DatatypeConstants#TIME time},
- * {@link DatatypeConstants#DATE date},
- * {@link DatatypeConstants#GYEARMONTH gYearMonth},
- * {@link DatatypeConstants#GMONTHDAY gMonthDay},
- * {@link DatatypeConstants#GYEAR gYear},
- * {@link DatatypeConstants#GMONTH gMonth} and
- * {@link DatatypeConstants#GDAY gDay}
- * defined in the XML Namespace
- * <code>"http://www.w3.org/2001/XMLSchema"</code>.
- * These datatypes are normatively defined in
- * <a href="http://www.w3.org/TR/xmlschema-2/#dateTime">W3C XML Schema 1.0 Part 2, Section 3.2.7-14</a>.</p>
- *
- * <p>The table below defines the mapping between XML Schema 1.0
- * date/time datatype fields and this class' fields. It also summarizes
- * the value constraints for the date and time fields defined in
- * <a href="http://www.w3.org/TR/xmlschema-2/#isoformats">W3C XML Schema 1.0 Part 2, Appendix D,
- * <i>ISO 8601 Date and Time Formats</i></a>.</p>
- *
- * <a name="datetimefieldsmapping"/>
- * <table border="2" rules="all" cellpadding="2">
- * <thead>
- * <tr>
- * <th align="center" colspan="3">
- * Date/time datatype field mapping between XML Schema 1.0 and Java representation
- * </th>
- * </tr>
- * </thead>
- * <tbody>
- * <tr>
- * <th>XML Schema 1.0<br/>
- * datatype<br/>
- * field</th>
- * <th>Related<br/>XMLGregorianCalendar<br/>Accessor(s)</th>
- * <th>Value Range</th>
- * </tr>
- * <a name="datetimefield-year"/>
- * <tr>
- * <td> year </td>
- * <td> {@link #getYear()} + {@link #getEon()} or<br/>
- * {@link #getEonAndYear}
- * </td>
- * <td> <code>getYear()</code> is a value between -(10^9-1) to (10^9)-1
- * or {@link DatatypeConstants#FIELD_UNDEFINED}.<br/>
- * {@link #getEon()} is high order year value in billion of years.<br/>
- * <code>getEon()</code> has values greater than or equal to (10^9) or less than or equal to -(10^9).
- * A value of null indicates field is undefined.</br>
- * Given that <a href="http://www.w3.org/2001/05/xmlschema-errata#e2-63">XML Schema 1.0 errata</a> states that the year zero
- * will be a valid lexical value in a future version of XML Schema,
- * this class allows the year field to be set to zero. Otherwise,
- * the year field value is handled exactly as described
- * in the errata and [ISO-8601-1988]. Note that W3C XML Schema 1.0
- * validation does not allow for the year field to have a value of zero.
- * </td>
- * </tr>
- * <a name="datetimefield-month"/>
- * <tr>
- * <td> month </td>
- * <td> {@link #getMonth()} </td>
- * <td> 1 to 12 or {@link DatatypeConstants#FIELD_UNDEFINED} </td>
- * </tr>
- * <a name="datetimefield-day"/>
- * <tr>
- * <td> day </td>
- * <td> {@link #getDay()} </td>
- * <td> Independent of month, max range is 1 to 31 or {@link DatatypeConstants#FIELD_UNDEFINED}.<br/>
- * The normative value constraint stated relative to month
- * field's value is in <a href="http://www.w3.org/TR/xmlschema-2/#isoformats">W3C XML Schema 1.0 Part 2, Appendix D</a>.
- * </td>
- * </tr>
- * <a name="datetimefield-hour"/>
- * <tr>
- * <td> hour </td>
- * <td> {@link #getHour()} </td>
- * <td>
- * 0 to 23 or {@link DatatypeConstants#FIELD_UNDEFINED}.
- * An hour value of 24 is allowed to be set in the lexical space provided the minute and second
- * field values are zero. However, an hour value of 24 is not allowed in value space and will be
- * transformed to represent the value of the first instance of the following day as per
- * <a href="http://www.w3.org/TR/xmlschema-2/#built-in-primitive-datatypes">
- * XML Schema Part 2: Datatypes Second Edition, 3.2 Primitive datatypes</a>.
- * </td>
- * </tr>
- * <a name="datetimefield-minute"/>
- * <tr>
- * <td> minute </td>
- * <td> {@link #getMinute()} </td>
- * <td> 0 to 59 or {@link DatatypeConstants#FIELD_UNDEFINED} </td>
- * </tr>
- * <a name="datetimefield-second"/>
- * <tr>
- * <td>second</td>
- * <td>
- * {@link #getSecond()} + {@link #getMillisecond()}/1000 or<br/>
- * {@link #getSecond()} + {@link #getFractionalSecond()}
- * </td>
- * <td>
- * {@link #getSecond()} from 0 to 60 or {@link DatatypeConstants#FIELD_UNDEFINED}.<br/>
- * <i>(Note: 60 only allowable for leap second.)</i><br/>
- * {@link #getFractionalSecond()} allows for infinite precision over the range from 0.0 to 1.0 when
- * the {@link #getSecond()} is defined.<br/>
- * <code>FractionalSecond</code> is optional and has a value of <code>null</code> when it is undefined.<br />
- * {@link #getMillisecond()} is the convenience
- * millisecond precision of value of {@link #getFractionalSecond()}.
- * </td>
- * </tr>
- * <tr id="datetimefield-timezone">
- * <td> timezone </td>
- * <td> {@link #getTimezone()} </td>
- * <td> Number of minutes or {@link DatatypeConstants#FIELD_UNDEFINED}.
- * Value range from -14 hours (-14 * 60 minutes) to 14 hours (14 * 60 minutes).
- * </td>
- * </tr>
- * </tbody>
- * </table>
- *
- * <p>All maximum value space constraints listed for the fields in the table
- * above are checked by factory methods, setter methods and parse methods of
- * this class. <code>IllegalArgumentException</code> is thrown when
- * parameter's value is outside the maximum value constraint for the field.
- * Validation checks, for example, whether days in month should be
- * limited to 29, 30 or 31 days, that are dependent on the values of other
- * fields are not checked by these methods.
- * </p>
- *
- * <p>The following operations are defined for this class:
- * <ul>
- * <li>factory methods to create instances</li>
- * <li>accessors/mutators for independent date/time fields</li>
- * <li>conversion between this class and W3C XML Schema 1.0 lexical representation</li>
- * <li>conversion between this class and <code>java.util.GregorianCalendar</code></li>
- * <li>partial order relation comparator method, {@link #compare(XMLGregorianCalendar)}</li>
- * <li>{@link #equals(Object)} defined relative to {@link #compare(XMLGregorianCalendar)}.</li>
- * <li> addition operation with {@link javax.xml.datatype.Duration}.
- * instance as defined in <a href="http://www.w3.org/TR/xmlschema-2/#adding-durations-to-dateTimes">
- * W3C XML Schema 1.0 Part 2, Appendix E, <i>Adding durations to dateTimes</i></a>.</li>
- * </ul>
- * </p>
- *
- * @author <a href="mailto:Kohsuke.Kawaguchi@Sun.com">Kohsuke Kawaguchi</a>
- * @author <a href="mailto:Joseph.Fialli@Sun.com">Joseph Fialli</a>
- * @author <a href="mailto:Sunitha.Reddy@Sun.com">Sunitha Reddy</a>
- * @version $Revision: 1.14 $, $Date: 2010-11-10 07:41:41 $
- * @see javax.xml.datatype.Duration
- * @since 1.5
- */
-
-public class XMLGregorianCalendarImpl
- extends XMLGregorianCalendar
- implements Serializable, Cloneable {
-
- /**
- * <p>Eon of this <code>XMLGregorianCalendar</code>.</p>
- */
- private BigInteger eon = null;
-
- /**
- * <p>Year of this <code>XMLGregorianCalendar</code>.</p>
- */
- private int year = DatatypeConstants.FIELD_UNDEFINED;
-
- /**
- * <p>Month of this <code>XMLGregorianCalendar</code>.</p>
- */
- private int month = DatatypeConstants.FIELD_UNDEFINED;
-
- /**
- * <p>Day of this <code>XMLGregorianCalendar</code>.</p>
- */
- private int day = DatatypeConstants.FIELD_UNDEFINED;
-
- /**
- * <p>Timezone of this <code>XMLGregorianCalendar</code> in minutes.</p>
- */
- private int timezone = DatatypeConstants.FIELD_UNDEFINED;
-
- /**
- * <p>Hour of this <code>XMLGregorianCalendar</code>.</p>
- */
- private int hour = DatatypeConstants.FIELD_UNDEFINED;
-
- /**
- * <p>Minute of this <code>XMLGregorianCalendar</code>.</p>
- */
- private int minute = DatatypeConstants.FIELD_UNDEFINED;
-
- /**
- * <p>Second of this <code>XMLGregorianCalendar</code>.</p>
- */
- private int second = DatatypeConstants.FIELD_UNDEFINED ;
-
- /**
- * <p>Fractional second of this <code>XMLGregorianCalendar</code>.</p>
- */
- private BigDecimal fractionalSecond = null;
-
- /**
- * <p>Constant to represent a billion.</p>
- */
- private static final BigInteger BILLION = new BigInteger("1000000000");
-
- /**
- * <p>Obtain a pure Gregorian Calendar by calling
- * GregorianCalendar.setChange(PURE_GREGORIAN_CHANGE). </p>
- */
- private static final Date PURE_GREGORIAN_CHANGE =
- new Date(Long.MIN_VALUE);
-
- /**
- * Year index for MIN_ and MAX_FIELD_VALUES.
- */
- private static final int YEAR = 0;
-
- /**
- * Month index for MIN_ and MAX_FIELD_VALUES.
- */
- private static final int MONTH = 1;
-
- /**
- * Day index for MIN_ and MAX_FIELD_VALUES.
- */
- private static final int DAY = 2;
-
- /**
- * Hour index for MIN_ and MAX_FIELD_VALUES.
- */
- private static final int HOUR = 3;
-
- /**
- * Minute index for MIN_ and MAX_FIELD_VALUES.
- */
- private static final int MINUTE = 4;
-
- /**
- * Second index for MIN_ and MAX_FIELD_VALUES.
- */
- private static final int SECOND = 5;
-
- /**
- * Second index for MIN_ and MAX_FIELD_VALUES.
- */
- private static final int MILLISECOND = 6;
-
- /**
- * Timezone index for MIN_ and MAX_FIELD_VALUES
- */
- private static final int TIMEZONE = 7;
-
-
- /**
- * field names indexed by YEAR..TIMEZONE.
- */
- private static final String FIELD_NAME[] = {
- "Year",
- "Month",
- "Day",
- "Hour",
- "Minute",
- "Second",
- "Millisecond",
- "Timezone"
- };
-
- /**
- * <p>Stream Unique Identifier.</p>
- *
- * <p>TODO: Serialization should use the XML string representation as
- * the serialization format to ensure future compatibility.</p>
- */
- private static final long serialVersionUID = 1L;
-
- /**
- * <p>Use as a template for default field values when
- * converting to a {@link GregorianCalendar}, set to a leap
- * year date of January 1, 0400 at midnight.</p>
- *
- * <p>Fields that are optional for an <code>xsd:dateTime</code> instances are defaulted to not being set to any value.
- * <code>XMLGregorianCalendar</code> fields millisecond, fractional second and timezone return the value indicating
- * that the field is not set, {@link DatatypeConstants#FIELD_UNDEFINED} for millisecond and timezone
- * and <code>null</code> for fractional second.</p>
- *
- * @see #toGregorianCalendar(TimeZone, Locale, XMLGregorianCalendar)
- */
- public static final XMLGregorianCalendar LEAP_YEAR_DEFAULT =
- createDateTime(
- 400, //year
- DatatypeConstants.JANUARY, //month
- 1, // day
- 0, // hour
- 0, // minute
- 0, // second
- DatatypeConstants.FIELD_UNDEFINED, // milliseconds
- DatatypeConstants.FIELD_UNDEFINED // timezone
- );
-
- // Constructors
-
- /**
- * Constructs a new XMLGregorianCalendar object.
- *
- * String parsing documented by {@link #parse(String)}.
- *
- * Returns a non-null valid XMLGregorianCalendar object that holds the
- * value indicated by the lexicalRepresentation parameter.
- *
- * @param lexicalRepresentation
- * Lexical representation of one the eight
- * XML Schema date/time datatypes.
- * @throws IllegalArgumentException
- * If the given string does not conform as documented in
- * {@link #parse(String)}.
- * @throws NullPointerException
- * If the given string is null.
- */
- protected XMLGregorianCalendarImpl(String lexicalRepresentation)
- throws IllegalArgumentException {
-
- // compute format string for this lexical representation.
- String format = null;
- String lexRep = lexicalRepresentation;
- final int NOT_FOUND = -1;
- int lexRepLength = lexRep.length();
-
- // current parser needs a format string,
- // use following heuristics to figure out what xml schema date/time
- // datatype this lexical string could represent.
- // Fix 4971612: invalid SCCS macro substitution in data string,
- // no %{alpha}% to avoid SCCS maco substitution
- if (lexRep.indexOf('T') != NOT_FOUND) {
- // found Date Time separater, must be xsd:DateTime
- format = "%Y-%M-%DT%h:%m:%s" + "%z";
- } else if (lexRepLength >= 3 && lexRep.charAt(2) == ':') {
- // found ":", must be xsd:Time
- format = "%h:%m:%s" + "%z";
- } else if (lexRep.startsWith("--")) {
- // check for gDay || gMonth || gMonthDay
- if (lexRepLength >= 3 && lexRep.charAt(2) == '-') {
- // gDay, ---DD(z?)
- format = "---%D" + "%z";
- } else if (lexRepLength == 4 // --MM
- || lexRepLength == 5 // --MMZ
- || lexRepLength == 10) { // --MMSHH:MM
- // gMonth, --MM(z?),
- // per XML Schema Errata, used to be --MM--(z?)
- format = "--%M" + "%z";
- } else {
- // gMonthDay, --MM-DD(z?), (or invalid lexicalRepresentation)
- // length should be:
- // 7: --MM-DD
- // 8: --MM-DDZ
- // 13: --MM-DDSHH:MM
- format = "--%M-%D" + "%z";
- }
- } else {
- // check for Date || GYear | GYearMonth
- int countSeparator = 0;
-
- // start at index 1 to skip potential negative sign for year.
-
-
- int timezoneOffset = lexRep.indexOf(':');
- if (timezoneOffset != NOT_FOUND) {
-
- // found timezone, strip it off for distinguishing
- // between Date, GYear and GYearMonth so possible
- // negative sign in timezone is not mistaken as
- // a separator.
- lexRepLength -= 6;
- }
-
- for (int i = 1; i < lexRepLength; i++) {
- if (lexRep.charAt(i) == '-') {
- countSeparator++;
- }
- }
- if (countSeparator == 0) {
- // GYear
- format = "%Y" + "%z";
- } else if (countSeparator == 1) {
- // GYearMonth
- format = "%Y-%M" + "%z";
- } else {
- // Date or invalid lexicalRepresentation
- // Fix 4971612: invalid SCCS macro substitution in data string
- format = "%Y-%M-%D" + "%z";
- }
- }
- Parser p = new Parser(format, lexRep);
- p.parse();
-
- // check for validity
- if (!isValid()) {
- throw new IllegalArgumentException(
- DatatypeMessageFormatter.formatMessage(null, "InvalidXGCRepresentation", new Object[]{lexicalRepresentation})
- //"\"" + lexicalRepresentation + "\" is not a valid representation of an XML Gregorian Calendar value."
- );
- }
- }
-
- /**
- * <p>Create an instance with all date/time datatype fields set to
- * {@link DatatypeConstants#FIELD_UNDEFINED} or null respectively.</p>
- */
- public XMLGregorianCalendarImpl() {
-
- // field initializers already do the correct initialization.
- }
-
- /**
- * <p>Private constructor allowing for complete value spaces allowed by
- * W3C XML Schema 1.0 recommendation for xsd:dateTime and related
- * builtin datatypes. Note that <code>year</code> parameter supports
- * arbitrarily large numbers and fractionalSecond has infinite
- * precision.</p>
- *
- * @param year of <code>XMLGregorianCalendar</code> to be created.
- * @param month of <code>XMLGregorianCalendar</code> to be created.
- * @param day of <code>XMLGregorianCalendar</code> to be created.
- * @param hour of <code>XMLGregorianCalendar</code> to be created.
- * @param minute of <code>XMLGregorianCalendar</code> to be created.
- * @param second of <code>XMLGregorianCalendar</code> to be created.
- * @param fractionalSecond of <code>XMLGregorianCalendar</code> to be created.
- * @param timezone of <code>XMLGregorianCalendar</code> to be created.
- *
- */
- protected XMLGregorianCalendarImpl(
- BigInteger year,
- int month,
- int day,
- int hour,
- int minute,
- int second,
- BigDecimal fractionalSecond,
- int timezone) {
-
- setYear(year);
- setMonth(month);
- setDay(day);
- setTime(hour, minute, second, fractionalSecond);
- setTimezone(timezone);
-
- // check for validity
- if (!isValid()) {
-
- throw new IllegalArgumentException(
- DatatypeMessageFormatter.formatMessage(null,
- "InvalidXGCValue-fractional",
- new Object[] { year, new Integer(month), new Integer(day),
- new Integer(hour), new Integer(minute), new Integer(second),
- fractionalSecond, new Integer(timezone)})
- );
-
- /**
- String yearString = "null";
- if (year != null) {
- yearString = year.toString();
- }
- String fractionalSecondString = "null";
- if (fractionalSecond != null) {
- fractionalSecondString = fractionalSecond.toString();
- }
-
- throw new IllegalArgumentException(
- "year = " + yearString
- + ", month = " + month
- + ", day = " + day
- + ", hour = " + hour
- + ", minute = " + minute
- + ", second = " + second
- + ", fractionalSecond = " + fractionalSecondString
- + ", timezone = " + timezone
- + ", is not a valid representation of an XML Gregorian Calendar value."
- );
- */
-
- }
-
- }
-
- /**
- * <p>Private constructor of value spaces that a
- * <code>java.util.GregorianCalendar</code> instance would need to convert to an
- * <code>XMLGregorianCalendar</code> instance.</p>
- *
- * <p><code>XMLGregorianCalendar eon</code> and
- * <code>fractionalSecond</code> are set to <code>null</code></p>
- *
- * @param year of <code>XMLGregorianCalendar</code> to be created.
- * @param month of <code>XMLGregorianCalendar</code> to be created.
- * @param day of <code>XMLGregorianCalendar</code> to be created.
- * @param hour of <code>XMLGregorianCalendar</code> to be created.
- * @param minute of <code>XMLGregorianCalendar</code> to be created.
- * @param second of <code>XMLGregorianCalendar</code> to be created.
- * @param millisecond of <code>XMLGregorianCalendar</code> to be created.
- * @param timezone of <code>XMLGregorianCalendar</code> to be created.
- */
- private XMLGregorianCalendarImpl(
- int year,
- int month,
- int day,
- int hour,
- int minute,
- int second,
- int millisecond,
- int timezone) {
-
- setYear(year);
- setMonth(month);
- setDay(day);
- setTime(hour, minute, second);
- setTimezone(timezone);
- setMillisecond(millisecond);
-
- if (!isValid()) {
-
- throw new IllegalArgumentException(
- DatatypeMessageFormatter.formatMessage(null,
- "InvalidXGCValue-milli",
- new Object[] { new Integer(year), new Integer(month), new Integer(day),
- new Integer(hour), new Integer(minute), new Integer(second),
- new Integer(millisecond), new Integer(timezone)})
- );
- /*
- throw new IllegalArgumentException(
- "year = " + year
- + ", month = " + month
- + ", day = " + day
- + ", hour = " + hour
- + ", minute = " + minute
- + ", second = " + second
- + ", millisecond = " + millisecond
- + ", timezone = " + timezone
- + ", is not a valid representation of an XML Gregorian Calendar value."
- );
- */
-
- }
- }
-
- /**
- * <p>Convert a <code>java.util.GregorianCalendar</code> to XML Schema 1.0
- * representation.</p>
- *
- * <table border="2" rules="all" cellpadding="2">
- * <thead>
- * <tr>
- * <th align="center" colspan="2">
- * Field by Field Conversion from
- * <code>java.util.GregorianCalendar</code> to this class
- * </th>
- * </tr>
- * </thead>
- * <tbody>
- * <tr>
- * <th><code>javax.xml.datatype.XMLGregorianCalendar</code> field</th>
- * <th><code>java.util.GregorianCalendar</code> field</th>
- * </tr>
- * <tr>
- * <th>{@link #setYear(int)}</th>
- * <th><code>ERA == GregorianCalendar.BC ? -YEAR : YEAR</code></th>
- * </tr>
- * <tr>
- * <th>{@link #setMonth(int)}</th>
- * <th><code>MONTH + 1</code></th>
- * </tr>
- * <tr>
- * <th>{@link #setDay(int)}</th>
- * <th><code>DAY_OF_MONTH</code></th>
- * </tr>
- * <tr>
- * <th>{@link #setTime(int,int,int, BigDecimal)}</th>
- * <th><code>HOUR_OF_DAY, MINUTE, SECOND, MILLISECOND</code></th>
- * </tr>
- * <tr>
- * <th>{@link #setTimezone(int)}<i>*</i></th>
- * <th><code>(ZONE_OFFSET + DST_OFFSET) / (60*1000)</code><br/>
- * <i>(in minutes)</i>
- * </th>
- * </tr>
- * </tbody>
- * </table>
- * <p><i>*</i>conversion loss of information. It is not possible to represent
- * a <code>java.util.GregorianCalendar</code> daylight savings timezone id in the
- * XML Schema 1.0 date/time datatype representation.</p>
- *
- * <p>To compute the return value's <code>TimeZone</code> field,
- * <ul>
- * <li>when <code>this.getTimezone() != DatatypeConstants.FIELD_UNDEFINED</code>,
- * create a <code>java.util.TimeZone</code> with a custom timezone id
- * using the <code>this.getTimezone()</code>.</li>
- * <li>else use the <code>GregorianCalendar</code> default timezone value
- * for the host is defined as specified by
- * <code>java.util.TimeZone.getDefault()</code>.</li></p>
- *
- * @param cal <code>java.util.GregorianCalendar</code> used to create <code>XMLGregorianCalendar</code>
- */
- public XMLGregorianCalendarImpl(GregorianCalendar cal) {
-
- int year = cal.get(Calendar.YEAR);
- if (cal.get(Calendar.ERA) == GregorianCalendar.BC) {
- year = -year;
- }
- this.setYear(year);
-
- // Calendar.MONTH is zero based, XSD Date datatype's month field starts
- // with JANUARY as 1.
- this.setMonth(cal.get(Calendar.MONTH) + 1);
- this.setDay(cal.get(Calendar.DAY_OF_MONTH));
- this.setTime(
- cal.get(Calendar.HOUR_OF_DAY),
- cal.get(Calendar.MINUTE),
- cal.get(Calendar.SECOND),
- cal.get(Calendar.MILLISECOND));
-
- // Calendar ZONE_OFFSET and DST_OFFSET fields are in milliseconds.
- int offsetInMinutes = (cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET)) / (60 * 1000);
- this.setTimezone(offsetInMinutes);
- }
-
- // Factories
-
- /**
- * <p>Create a Java representation of XML Schema builtin datatype <code>dateTime</code>.
- * All possible fields are specified for this factory method.</p>
- *
- * @param year represents both high-order eons and low-order year.
- * @param month of <code>dateTime</code>
- * @param day of <code>dateTime</code>
- * @param hours of <code>dateTime</code>
- * @param minutes of <code>dateTime</code>
- * @param seconds of <code>dateTime</code>
- * @param fractionalSecond value of null indicates optional field is absent.
- * @param timezone offset in minutes. {@link DatatypeConstants#FIELD_UNDEFINED} indicates optional field is not set.
- *
- * @return <code>XMLGregorianCalendar</code> created from parameter values.
- *
- * @see DatatypeConstants#FIELD_UNDEFINED
- *
- * @throws IllegalArgumentException if any parameter is outside value
- * constraints for the field as specified in
- * <a href="#datetimefieldmapping">date/time field mapping table</a>.
- */
- public static XMLGregorianCalendar createDateTime(
- BigInteger year,
- int month,
- int day,
- int hours,
- int minutes,
- int seconds,
- BigDecimal fractionalSecond,
- int timezone) {
-
- return new XMLGregorianCalendarImpl(
- year,
- month,
- day,
- hours,
- minutes,
- seconds,
- fractionalSecond,
- timezone);
- }
-
- /**
- * <p>Create a Java instance of XML Schema builtin datatype dateTime.</p>
- *
- * @param year represents both high-order eons and low-order year.
- * @param month of <code>dateTime</code>
- * @param day of <code>dateTime</code>
- * @param hour of <code>dateTime</code>
- * @param minute of <code>dateTime</code>
- * @param second of <code>dateTime</code>
- *
- * @return <code>XMLGregorianCalendar</code> created from parameter values.
- *
- * @throws IllegalArgumentException if any parameter is outside value constraints for the field as specified in
- * <a href="#datetimefieldmapping">date/time field mapping table</a>.
- *
- * @see DatatypeConstants#FIELD_UNDEFINED
- */
- public static XMLGregorianCalendar createDateTime(
- int year,
- int month,
- int day,
- int hour,
- int minute,
- int second) {
-
- return new XMLGregorianCalendarImpl(
- year,
- month,
- day,
- hour,
- minute,
- second,
- DatatypeConstants.FIELD_UNDEFINED, //millisecond
- DatatypeConstants.FIELD_UNDEFINED //timezone
- );
- }
-
- /**
- * <p>Create a Java representation of XML Schema builtin datatype <code>dateTime</code>.
- * All possible fields are specified for this factory method.</p>
- *
- * @param year represents low-order year.
- * @param month of <code>dateTime</code>
- * @param day of <code>dateTime</code>
- * @param hours of <code>dateTime</code>
- * @param minutes of <code>dateTime</code>
- * @param seconds of <code>dateTime</code>
- * @param milliseconds of <code>dateTime</code>. {@link DatatypeConstants#FIELD_UNDEFINED} indicates optional field is not set.
- * @param timezone offset in minutes. {@link DatatypeConstants#FIELD_UNDEFINED} indicates optional field is not set.
- *
- * @return <code>XMLGregorianCalendar</code> created from parameter values.
- *
- * @throws IllegalArgumentException if any parameter is outside value constraints for the field as specified in
- * <a href="#datetimefieldmapping">date/time field mapping table</a>.
- *
- * @see DatatypeConstants#FIELD_UNDEFINED
- */
- public static XMLGregorianCalendar createDateTime(
- int year,
- int month,
- int day,
- int hours,
- int minutes,
- int seconds,
- int milliseconds,
- int timezone) {
-
- return new XMLGregorianCalendarImpl(
- year,
- month,
- day,
- hours,
- minutes,
- seconds,
- milliseconds,
- timezone);
- }
-
- /**
- * <p>Create a Java representation of XML Schema builtin datatype <code>date</code> or <code>g*</code>.</p>
- *
- * <p>For example, an instance of <code>gYear</code> can be created invoking this factory
- * with <code>month</code> and <code>day</code> parameters set to
- * {@link DatatypeConstants#FIELD_UNDEFINED}.</p>
- *
- * @param year of <code>XMLGregorianCalendar</code> to be created.
- * @param month of <code>XMLGregorianCalendar</code> to be created.
- * @param day of <code>XMLGregorianCalendar</code> to be created.
- * @param timezone offset in minutes. {@link DatatypeConstants#FIELD_UNDEFINED} indicates optional field is not set.
- *
- * @return <code>XMLGregorianCalendar</code> created from parameter values.
- *
- * @see DatatypeConstants#FIELD_UNDEFINED
- *
- * @throws IllegalArgumentException if any parameter is outside value
- * constraints for the field as specified in
- * <a href="#datetimefieldmapping">date/time field mapping table</a>.
- */
- public static XMLGregorianCalendar createDate(
- int year,
- int month,
- int day,
- int timezone) {
-
- return new XMLGregorianCalendarImpl(
- year,
- month,
- day,
- DatatypeConstants.FIELD_UNDEFINED, // hour
- DatatypeConstants.FIELD_UNDEFINED, // minute
- DatatypeConstants.FIELD_UNDEFINED, // second
- DatatypeConstants.FIELD_UNDEFINED, // millisecond
- timezone);
- }
-
- /**
- * Create a Java instance of XML Schema builtin datatype <code>time</code>.
- * @param hours number of hours
- * @param minutes number of minutes
- * @param seconds number of seconds
- * @param timezone offset in minutes. {@link DatatypeConstants#FIELD_UNDEFINED} indicates optional field is not set.
- *
- * @return <code>XMLGregorianCalendar</code> created from parameter values.
- *
- * @see DatatypeConstants#FIELD_UNDEFINED
- *
- * @throws IllegalArgumentException if any parameter is outside value
- * constraints for the field as specified in
- * <a href="#datetimefieldmapping">date/time field mapping table</a>.
- */
- public static XMLGregorianCalendar createTime(
- int hours,
- int minutes,
- int seconds,
- int timezone) {
-
- return new XMLGregorianCalendarImpl(
- DatatypeConstants.FIELD_UNDEFINED, // Year
- DatatypeConstants.FIELD_UNDEFINED, // Month
- DatatypeConstants.FIELD_UNDEFINED, // Day
- hours,
- minutes,
- seconds,
- DatatypeConstants.FIELD_UNDEFINED, //Millisecond
- timezone);
- }
-
- /**
- * <p>Create a Java instance of XML Schema builtin datatype time.</p>
- *
- * @param hours number of hours
- * @param minutes number of minutes
- * @param seconds number of seconds
- * @param fractionalSecond value of <code>null</code> indicates that this optional field is not set.
- * @param timezone offset in minutes. {@link DatatypeConstants#FIELD_UNDEFINED} indicates optional field is not set.
- *
- * @return <code>XMLGregorianCalendar</code> created from parameter values.
- *
- * @see DatatypeConstants#FIELD_UNDEFINED
- *
- * @throws IllegalArgumentException if any parameter is outside value
- * constraints for the field as specified in
- * <a href="#datetimefieldmapping">date/time field mapping table</a>.
- */
- public static XMLGregorianCalendar createTime(
- int hours,
- int minutes,
- int seconds,
- BigDecimal fractionalSecond,
- int timezone) {
-
- return new XMLGregorianCalendarImpl(
- null, // Year
- DatatypeConstants.FIELD_UNDEFINED, // month
- DatatypeConstants.FIELD_UNDEFINED, // day
- hours,
- minutes,
- seconds,
- fractionalSecond,
- timezone);
- }
-
- /**
- * <p>Create a Java instance of XML Schema builtin datatype time.</p>
- *
- * @param hours number of hours
- * @param minutes number of minutes
- * @param seconds number of seconds
- * @param milliseconds number of milliseconds
- * @param timezone offset in minutes. {@link DatatypeConstants#FIELD_UNDEFINED} indicates optional field is not set.
- *
- * @return <code>XMLGregorianCalendar</code> created from parameter values.
- *
- * @see DatatypeConstants#FIELD_UNDEFINED
- *
- * @throws IllegalArgumentException if any parameter is outside value
- * constraints for the field as specified in
- * <a href="#datetimefieldmapping">date/time field mapping table</a>.
- */
- public static XMLGregorianCalendar createTime(
- int hours,
- int minutes,
- int seconds,
- int milliseconds,
- int timezone) {
-
- return new XMLGregorianCalendarImpl(
- DatatypeConstants.FIELD_UNDEFINED, // year
- DatatypeConstants.FIELD_UNDEFINED, // month
- DatatypeConstants.FIELD_UNDEFINED, // day
- hours,
- minutes,
- seconds,
- milliseconds,
- timezone);
- }
-
- // Accessors
-
- /**
- * <p>Return high order component for XML Schema 1.0 dateTime datatype field for
- * <code>year</code>.
- * <code>null</code> if this optional part of the year field is not defined.</p>
- *
- * <p>Value constraints for this value are summarized in
- * <a href="#datetimefield-year">year field of date/time field mapping table</a>.</p>
- * @return eon of this <code>XMLGregorianCalendar</code>. The value
- * returned is an integer multiple of 10^9.
- *
- * @see #getYear()
- * @see #getEonAndYear()
- */
- public BigInteger getEon() {
- return eon;
- }
-
- /**
- * <p>Return low order component for XML Schema 1.0 dateTime datatype field for
- * <code>year</code> or {@link DatatypeConstants#FIELD_UNDEFINED}.</p>
- *
- * <p>Value constraints for this value are summarized in
- * <a href="#datetimefield-year">year field of date/time field mapping table</a>.</p>
- *
- * @return year of this <code>XMLGregorianCalendar</code>.
- *
- * @see #getEon()
- * @see #getEonAndYear()
- */
- public int getYear() {
- return year;
- }
-
- /**
- * <p>Return XML Schema 1.0 dateTime datatype field for
- * <code>year</code>.</p>
- *
- * <p>Value constraints for this value are summarized in
- * <a href="#datetimefield-year">year field of date/time field mapping table</a>.</p>
- *
- * @return sum of <code>eon</code> and <code>BigInteger.valueOf(year)</code>
- * when both fields are defined. When only <code>year</code> is defined,
- * return it. When both <code>eon</code> and <code>year</code> are not
- * defined, return <code>null</code>.
- *
- * @see #getEon()
- * @see #getYear()
- */
- public BigInteger getEonAndYear() {
-
- // both are defined
- if (year != DatatypeConstants.FIELD_UNDEFINED
- && eon != null) {
-
- return eon.add(BigInteger.valueOf((long) year));
- }
-
- // only year is defined
- if (year != DatatypeConstants.FIELD_UNDEFINED
- && eon == null) {
-
- return BigInteger.valueOf((long) year);
- }
-
- // neither are defined
- // or only eon is defined which is not valid without a year
- return null;
- }
-
- /**
- * <p>Return number of month or {@link DatatypeConstants#FIELD_UNDEFINED}.</p>
- *
- * <p>Value constraints for this value are summarized in
- * <a href="#datetimefield-month">month field of date/time field mapping table</a>.</p>
- *
- * @return year of this <code>XMLGregorianCalendar</code>.
- *
- */
- public int getMonth() {
- return month;
- }
-
- /**
- * Return day in month or {@link DatatypeConstants#FIELD_UNDEFINED}.</p>
- *
- * <p>Value constraints for this value are summarized in
- * <a href="#datetimefield-day">day field of date/time field mapping table</a>.</p>
- *
- * @see #setDay(int)
- */
- public int getDay() {
- return day;
- }
-
- /**
- * Return timezone offset in minutes or
- * {@link DatatypeConstants#FIELD_UNDEFINED} if this optional field is not defined.
- *
- * <p>Value constraints for this value are summarized in
- * <a href="#datetimefield-timezone">timezone field of date/time field mapping table</a>.</p>
- *
- * @see #setTimezone(int)
- */
- public int getTimezone() {
- return timezone;
- }
-
- /**
- * Return hours or {@link DatatypeConstants#FIELD_UNDEFINED}.
- * Returns {@link DatatypeConstants#FIELD_UNDEFINED} if this field is not defined.
- *
- * <p>Value constraints for this value are summarized in
- * <a href="#datetimefield-hour">hour field of date/time field mapping table</a>.</p>
- * @see #setTime(int, int, int)
- */
- public int getHour() {
- return hour;
- }
-
- /**
- * Return minutes or {@link DatatypeConstants#FIELD_UNDEFINED}.<\p>
- * Returns {@link DatatypeConstants#FIELD_UNDEFINED} if this field is not defined.
- *
- * <p>Value constraints for this value are summarized in
- * <a href="#datetimefield-minute">minute field of date/time field mapping table</a>.</p>
- * @see #setTime(int, int, int)
- */
- public int getMinute() {
- return minute;
- }
-
- /**
- * <p>Return seconds or {@link DatatypeConstants#FIELD_UNDEFINED}.<\p>
- *
- * <p>Returns {@link DatatypeConstants#FIELD_UNDEFINED} if this field is not defined.
- * When this field is not defined, the optional xs:dateTime
- * fractional seconds field, represented by
- * {@link #getFractionalSecond()} and {@link #getMillisecond()},
- * must not be defined.</p>
- *
- * <p>Value constraints for this value are summarized in
- * <a href="#datetimefield-second">second field of date/time field mapping table</a>.</p>
- *
- * @return Second of this <code>XMLGregorianCalendar</code>.
- *
- * @see #getFractionalSecond()
- * @see #getMillisecond()
- * @see #setTime(int, int, int)
- */
- public int getSecond() {
- return second;
- }
-
- /**
- * @return result of adding second and fractional second field
- */
- private BigDecimal getSeconds() {
- if (second == DatatypeConstants.FIELD_UNDEFINED) {
- return DECIMAL_ZERO;
- }
- BigDecimal result = BigDecimal.valueOf((long) second);
- if (fractionalSecond != null) {
- return result.add(fractionalSecond);
- } else {
- return result;
- }
- }
-
-
- /**
- * <p>Return millisecond precision of {@link #getFractionalSecond()}.<\p>
- *
- * <p>This method represents a convenience accessor to infinite
- * precision fractional second value returned by
- * {@link #getFractionalSecond()}. The returned value is the rounded
- * down to milliseconds value of
- * {@link #getFractionalSecond()}. When {@link #getFractionalSecond()}
- * returns <code>null</code>, this method must return
- * {@link DatatypeConstants#FIELD_UNDEFINED}.</p>
- *
- * <p>Value constraints for this value are summarized in
- * <a href="#datetimefield-second">second field of date/time field mapping table</a>.</p>
- *
- * @return Millisecond of this <code>XMLGregorianCalendar</code>.
- *
- * @see #getFractionalSecond()
- * @see #setTime(int, int, int)
- */
- public int getMillisecond() {
- if (fractionalSecond == null) {
- return DatatypeConstants.FIELD_UNDEFINED;
- } else {
- // TODO: Non-optimal solution for now.
- // Efficient implementation would only store as BigDecimal
- // when needed and millisecond otherwise.
- return fractionalSecond.movePointRight(3).intValue();
- }
- }
-
- /**
- * <p>Return fractional seconds.</p>
- *
- * <p><code>null</code> is returned when this optional field is not defined.</p>
- *
- * <p>Value constraints are detailed in
- * <a href="#datetimefield-second">second field of date/time field mapping table</a>.</p>
- *
- * <p>This optional field can only have a defined value when the
- * xs:dateTime second field, represented by ({@link #getSecond()},
- * does not return {@link DatatypeConstants#FIELD_UNDEFINED}).</p>
- *
- * @return fractional seconds of this <code>XMLGregorianCalendar</code>.
- *
- * @see #getSecond()
- * @see #setTime(int, int, int, BigDecimal)
- */
- public BigDecimal getFractionalSecond() {
- return fractionalSecond;
- }
-
- // setters
-
- /**
- * <p>Set low and high order component of XSD <code>dateTime</code> year field.</p>
- *
- * <p>Unset this field by invoking the setter with a parameter value of <code>null</code>.</p>
- *
- * @param year value constraints summarized in <a href="#datetimefield-year">year field of date/time field mapping table</a>.
- *
- * @throws IllegalArgumentException if <code>year</code> parameter is
- * outside value constraints for the field as specified in
- * <a href="#datetimefieldmapping">date/time field mapping table</a>.
- */
- public void setYear(BigInteger year) {
- if (year == null) {
- this.eon = null;
- this.year = DatatypeConstants.FIELD_UNDEFINED;
- } else {
- BigInteger temp = year.remainder(BILLION);
- this.year = temp.intValue();
- setEon(year.subtract(temp));
- }
- }
-
- /**
- * <p>Set year of XSD <code>dateTime</code> year field.</p>
- *
- * <p>Unset this field by invoking the setter with a parameter value of
- * {@link DatatypeConstants#FIELD_UNDEFINED}.</p>
- *
- * <p>Note: if the absolute value of the <code>year</code> parameter
- * is less than 10^9, the eon component of the XSD year field is set to
- * <code>null</code> by this method.</p>
- *
- * @param year value constraints are summarized in <a href="#datetimefield-year">year field of date/time field mapping table</a>.
- * If year is {@link DatatypeConstants#FIELD_UNDEFINED}, then eon is set to <code>null</code>.
- */
- public void setYear(int year) {
- if (year == DatatypeConstants.FIELD_UNDEFINED) {
- this.year = DatatypeConstants.FIELD_UNDEFINED;
- this.eon = null;
- } else if (Math.abs(year) < BILLION.intValue()) {
- this.year = year;
- this.eon = null;
- } else {
- BigInteger theYear = BigInteger.valueOf((long) year);
- BigInteger remainder = theYear.remainder(BILLION);
- this.year = remainder.intValue();
- setEon(theYear.subtract(remainder));
- }
- }
-
- /**
- * <p>Set high order part of XSD <code>dateTime</code> year field.</p>
- *
- * <p>Unset this field by invoking the setter with a parameter value of
- * <code>null</code>.</p>
- *
- * @param eon value constraints summarized in <a href="#datetimefield-year">year field of date/time field mapping table</a>.
- */
- private void setEon(BigInteger eon) {
- if (eon != null && eon.compareTo(BigInteger.ZERO) == 0) {
- // Treat ZERO as field being undefined.
- this.eon = null;
- } else {
- this.eon = eon;
- }
- }
-
- /**
- * <p>Set month.</p>
- *
- * <p>Unset this field by invoking the setter with a parameter value of {@link DatatypeConstants#FIELD_UNDEFINED}.</p>
- *
- * @param month value constraints summarized in <a href="#datetimefield-month">month field of date/time field mapping table</a>.
- *
- * @throws IllegalArgumentException if <code>month</code> parameter is
- * outside value constraints for the field as specified in
- * <a href="#datetimefieldmapping">date/time field mapping table</a>.
- */
- public void setMonth(int month) {
- if(month<DatatypeConstants.JANUARY || DatatypeConstants.DECEMBER<month)
- if(month!=DatatypeConstants.FIELD_UNDEFINED)
- invalidFieldValue(MONTH, month);
- this.month = month;
- }
-
- /**
- * <p>Set days in month.</p>
- *
- * <p>Unset this field by invoking the setter with a parameter value of {@link DatatypeConstants#FIELD_UNDEFINED}.</p>
- *
- * @param day value constraints summarized in <a href="#datetimefield-day">day field of date/time field mapping table</a>.
- *
- * @throws IllegalArgumentException if <code>day</code> parameter is
- * outside value constraints for the field as specified in
- * <a href="#datetimefieldmapping">date/time field mapping table</a>.
- */
- public void setDay(int day) {
- if(day<1 || 31<day)
- if(day!=DatatypeConstants.FIELD_UNDEFINED)
- invalidFieldValue(DAY,day);
- this.day = day;
- }
-
- /**
- * <p>Set the number of minutes in the timezone offset.</p>
- *
- * <p>Unset this field by invoking the setter with a parameter value of {@link DatatypeConstants#FIELD_UNDEFINED}.</p>
- *
- * @param offset value constraints summarized in <a href="#datetimefield-timezone">
- * timezone field of date/time field mapping table</a>.
- *
- * @throws IllegalArgumentException if <code>offset</code> parameter is
- * outside value constraints for the field as specified in
- * <a href="#datetimefieldmapping">date/time field mapping table</a>.
- */
- public void setTimezone(int offset) {
- if(offset<-14*60 || 14*60<offset)
- if(offset!=DatatypeConstants.FIELD_UNDEFINED)
- invalidFieldValue(TIMEZONE,offset);
- this.timezone = offset;
- }
-
- /**
- * <p>Set time as one unit.</p>
- *
- * @param hour value constraints are summarized in
- * <a href="#datetimefield-hour">hour field of date/time field mapping table</a>.
- * @param minute value constraints are summarized in
- * <a href="#datetimefield-minute">minute field of date/time field mapping table</a>.
- * @param second value constraints are summarized in
- * <a href="#datetimefield-second">second field of date/time field mapping table</a>.
- *
- * @see #setTime(int, int, int, BigDecimal)
- *
- * @throws IllegalArgumentException if any parameter is
- * outside value constraints for the field as specified in
- * <a href="#datetimefieldmapping">date/time field mapping table</a>.
- */
- public void setTime(int hour, int minute, int second) {
- setTime(hour, minute, second, null);
- }
-
- private void invalidFieldValue(int field, int value) {
- throw new IllegalArgumentException(
- DatatypeMessageFormatter.formatMessage(null, "InvalidFieldValue",
- new Object[]{ new Integer(value), FIELD_NAME[field]})
- );
- }
-
- private void testHour() {
-
- // http://www.w3.org/2001/05/xmlschema-errata#e2-45
- if (getHour() == 24) {
- if (getMinute() != 0
- || getSecond() != 0) {
- invalidFieldValue(HOUR, getHour());
- }
- // while 0-24 is acceptable in the lexical space, 24 is not valid in value space
- // W3C XML Schema Part 2, Section 3.2.7.1
- setHour(0, false);
- add(new DurationImpl(true, 0, 0, 1, 0, 0, 0));
- }
- }
-
- public void setHour(int hour) {
-
- setHour(hour, true);
- }
-
- private void setHour(int hour, boolean validate) {
-
- if (hour < 0 || hour > 24) {
- if (hour != DatatypeConstants.FIELD_UNDEFINED) {
- invalidFieldValue(HOUR, hour);
- }
- }
-
- this.hour = hour;
-
- if (validate) {
- testHour();
- }
- }
-
- public void setMinute(int minute) {
- if(minute<0 || 59<minute)
- if(minute!=DatatypeConstants.FIELD_UNDEFINED)
- invalidFieldValue(MINUTE, minute);
- this.minute = minute;
- }
-
- public void setSecond(int second) {
- if(second<0 || 60<second) // leap second allows for 60
- if(second!=DatatypeConstants.FIELD_UNDEFINED)
- invalidFieldValue(SECOND, second);
- this.second = second;
- }
-
- /**
- * <p>Set time as one unit, including the optional infinite precison
- * fractional seconds.</p>
- *
- * @param hour value constraints are summarized in
- * <a href="#datetimefield-hour">hour field of date/time field mapping table</a>.
- * @param minute value constraints are summarized in
- * <a href="#datetimefield-minute">minute field of date/time field mapping table</a>.
- * @param second value constraints are summarized in
- * <a href="#datetimefield-second">second field of date/time field mapping table</a>.
- * @param fractional value of <code>null</code> indicates this optional
- * field is not set.
- *
- * @throws IllegalArgumentException if any parameter is
- * outside value constraints for the field as specified in
- * <a href="#datetimefieldmapping">date/time field mapping table</a>.
- */
- public void setTime(
- int hour,
- int minute,
- int second,
- BigDecimal fractional) {
-
- setHour(hour, false);
-
- setMinute(minute);
- if (second != 60) {
- setSecond(second);
- } else if ((hour == 23 && minute == 59) || (hour == 0 && minute == 0)) {
- setSecond(second);
- } else {
- invalidFieldValue(SECOND, second);
- }
-
- setFractionalSecond(fractional);
-
- // must test hour after setting seconds
- testHour();
- }
-
-
- /**
- * <p>Set time as one unit, including optional milliseconds.</p>
- *
- * @param hour value constraints are summarized in
- * <a href="#datetimefield-hour">hour field of date/time field mapping table</a>.
- * @param minute value constraints are summarized in
- * <a href="#datetimefield-minute">minute field of date/time field mapping table</a>.
- * @param second value constraints are summarized in
- * <a href="#datetimefield-second">second field of date/time field mapping table</a>.
- * @param millisecond value of {@link DatatypeConstants#FIELD_UNDEFINED} indicates this
- * optional field is not set.
- *
- * @throws IllegalArgumentException if any parameter is
- * outside value constraints for the field as specified in
- * <a href="#datetimefieldmapping">date/time field mapping table</a>.
- */
- public void setTime(int hour, int minute, int second, int millisecond) {
-
- setHour(hour, false);
-
- setMinute(minute);
- if (second != 60) {
- setSecond(second);
- } else if ((hour == 23 && minute == 59) || (hour == 0 && minute == 0)) {
- setSecond(second);
- } else {
- invalidFieldValue(SECOND, second);
- }
- setMillisecond(millisecond);
-
- // must test hour after setting seconds
- testHour();
- }
-
- // comparisons
- /**
- * <p>Compare two instances of W3C XML Schema 1.0 date/time datatypes
- * according to partial order relation defined in
- * <a href="http://www.w3.org/TR/xmlschema-2/#dateTime-order">W3C XML Schema 1.0 Part 2, Section 3.2.7.3,
- * <i>Order relation on dateTime</i></a>.</p>
- *
- * <p><code>xsd:dateTime</code> datatype field mapping to accessors of
- * this class are defined in
- * <a href="#datetimefieldmapping">date/time field mapping table</a>.</p>
- *
- * @param rhs instance of <code>XMLGregorianCalendar</code> to compare
- *
- * @return the relationship between <code>lhs</code> and <code>rhs</code> as
- * {@link DatatypeConstants#LESSER},
- * {@link DatatypeConstants#EQUAL},
- * {@link DatatypeConstants#GREATER} or
- * {@link DatatypeConstants#INDETERMINATE}.
- *
- * @throws NullPointerException if <code>lhs</code> or <code>rhs</code>
- * parameters are null.
- */
- public int compare(XMLGregorianCalendar rhs) {
-
- XMLGregorianCalendar lhs = this;
-
- int result = DatatypeConstants.INDETERMINATE;
- XMLGregorianCalendarImpl P = (XMLGregorianCalendarImpl) lhs;
- XMLGregorianCalendarImpl Q = (XMLGregorianCalendarImpl) rhs;
-
- if (P.getTimezone() == Q.getTimezone()) {
- // Optimization:
- // both instances are in same timezone or
- // both are FIELD_UNDEFINED.
- // Avoid costly normalization of timezone to 'Z' time.
- return internalCompare(P, Q);
-
- } else if (P.getTimezone() != DatatypeConstants.FIELD_UNDEFINED &&
- Q.getTimezone() != DatatypeConstants.FIELD_UNDEFINED) {
-
- // Both instances have different timezones.
- // Normalize to UTC time and compare.
- P = (XMLGregorianCalendarImpl) P.normalize();
- Q = (XMLGregorianCalendarImpl) Q.normalize();
- return internalCompare(P, Q);
- } else if (P.getTimezone() != DatatypeConstants.FIELD_UNDEFINED) {
-
- if (P.getTimezone() != 0) {
- P = (XMLGregorianCalendarImpl) P.normalize();
- }
-
- // C. step 1
- XMLGregorianCalendar MinQ = Q.normalizeToTimezone(DatatypeConstants.MIN_TIMEZONE_OFFSET);
- result = internalCompare(P, MinQ);
- if (result == DatatypeConstants.LESSER) {
- return result;
- }
-
- // C. step 2
- XMLGregorianCalendar MaxQ = Q.normalizeToTimezone(DatatypeConstants.MAX_TIMEZONE_OFFSET);
- result = internalCompare(P, MaxQ);
- if (result == DatatypeConstants.GREATER) {
- return result;
- } else {
- // C. step 3
- return DatatypeConstants.INDETERMINATE;
- }
- } else { // Q.getTimezone() != DatatypeConstants.FIELD_UNDEFINED
- // P has no timezone and Q does.
- if (Q.getTimezone() != 0) {
- Q = (XMLGregorianCalendarImpl) Q.normalizeToTimezone(Q.getTimezone());
- }
-
- // D. step 1
- XMLGregorianCalendar MaxP = P.normalizeToTimezone(DatatypeConstants.MAX_TIMEZONE_OFFSET);
- result = internalCompare(MaxP, Q);
- if (result == DatatypeConstants.LESSER) {
- return result;
- }
-
- // D. step 2
- XMLGregorianCalendar MinP = P.normalizeToTimezone(DatatypeConstants.MIN_TIMEZONE_OFFSET);
- result = internalCompare(MinP, Q);
- if (result == DatatypeConstants.GREATER) {
- return result;
- } else {
- // D. step 3
- return DatatypeConstants.INDETERMINATE;
- }
- }
- }
-
- /**
- * <p>Normalize this instance to UTC.</p>
- *
- * <p>2000-03-04T23:00:00+03:00 normalizes to 2000-03-04T20:00:00Z</p>
- * <p>Implements W3C XML Schema Part 2, Section 3.2.7.3 (A).</p>
- */
- public XMLGregorianCalendar normalize() {
-
- XMLGregorianCalendar normalized = normalizeToTimezone(timezone);
-
- // if timezone was undefined, leave it undefined
- if (getTimezone() == DatatypeConstants.FIELD_UNDEFINED) {
- normalized.setTimezone(DatatypeConstants.FIELD_UNDEFINED);
- }
-
- // if milliseconds was undefined, leave it undefined
- if (getMillisecond() == DatatypeConstants.FIELD_UNDEFINED) {
- normalized.setMillisecond(DatatypeConstants.FIELD_UNDEFINED);
- }
-
- return normalized;
- }
-
- /**
- * <p>Normalize this instance to UTC.</p>
- *
- * <p>2000-03-04T23:00:00+03:00 normalizes to 2000-03-04T20:00:00Z</p>
- * <p>Implements W3C XML Schema Part 2, Section 3.2.7.3 (A).</p>
- */
- private XMLGregorianCalendar normalizeToTimezone(int timezone) {
-
- int minutes = timezone;
- XMLGregorianCalendar result = (XMLGregorianCalendar) this.clone();
-
- // normalizing to UTC time negates the timezone offset before
- // addition.
- minutes = -minutes;
- Duration d = new DurationImpl(minutes >= 0, // isPositive
- 0, //years
- 0, //months
- 0, //days
- 0, //hours
- minutes < 0 ? -minutes : minutes, // absolute
- 0 //seconds
- );
- result.add(d);
-
- // set to zulu UTC time.
- result.setTimezone(0);
- return result;
- }
-
- /**
- *
- * <p>Implements Step B from http://www.w3.org/TR/xmlschema-2/#dateTime-order </p>
- * @param P calendar instance with normalized timezone offset or
- * having same timezone as Q
- * @param Q calendar instance with normalized timezone offset or
- * having same timezone as P
- *
- * @return result of comparing P and Q, value of
- * {@link DatatypeConstants#EQUAL},
- * {@link DatatypeConstants#LESSER},
- * {@link DatatypeConstants#GREATER} or
- * {@link DatatypeConstants#INDETERMINATE}.
- */
- private static int internalCompare(XMLGregorianCalendar P,
- XMLGregorianCalendar Q) {
-
- int result;
-
- // compare Year.
- if (P.getEon() == Q.getEon()) {
-
- // Eon field is only equal when null.
- // optimized case for comparing year not requiring eon field.
- result = compareField(P.getYear(), Q.getYear());
- if (result != DatatypeConstants.EQUAL) {
- return result;
- }
- } else {
- result = compareField(P.getEonAndYear(), Q.getEonAndYear());
- if (result != DatatypeConstants.EQUAL) {
- return result;
- }
- }
-
- result = compareField(P.getMonth(), Q.getMonth());
- if (result != DatatypeConstants.EQUAL) {
- return result;
- }
-
- result = compareField(P.getDay(), Q.getDay());
- if (result != DatatypeConstants.EQUAL) {
- return result;
- }
-
- result = compareField(P.getHour(), Q.getHour());
- if (result != DatatypeConstants.EQUAL) {
- return result;
- }
-
- result = compareField(P.getMinute(), Q.getMinute());
- if (result != DatatypeConstants.EQUAL) {
- return result;
- }
- result = compareField(P.getSecond(), Q.getSecond());
- if (result != DatatypeConstants.EQUAL) {
- return result;
- }
-
- result = compareField(P.getFractionalSecond(), Q.getFractionalSecond());
- return result;
- }
-
- /**
- * <p>Implement Step B from
- * http://www.w3.org/TR/xmlschema-2/#dateTime-order.</p>
- */
- private static int compareField(int Pfield, int Qfield) {
- if (Pfield == Qfield) {
-
- //fields are either equal in value or both undefined.
- // Step B. 1.1 AND optimized result of performing 1.1-1.4.
- return DatatypeConstants.EQUAL;
- } else {
- if (Pfield == DatatypeConstants.FIELD_UNDEFINED || Qfield == DatatypeConstants.FIELD_UNDEFINED) {
- // Step B. 1.2
- return DatatypeConstants.INDETERMINATE;
- } else {
- // Step B. 1.3-4.
- return (Pfield < Qfield ? DatatypeConstants.LESSER : DatatypeConstants.GREATER);
- }
- }
- }
-
- private static int compareField(BigInteger Pfield, BigInteger Qfield) {
- if (Pfield == null) {
- return (Qfield == null ? DatatypeConstants.EQUAL : DatatypeConstants.INDETERMINATE);
- }
- if (Qfield == null) {
- return DatatypeConstants.INDETERMINATE;
- }
- return Pfield.compareTo(Qfield);
- }
-
- private static int compareField(BigDecimal Pfield, BigDecimal Qfield) {
- // optimization. especially when both arguments are null.
- if (Pfield == Qfield) {
- return DatatypeConstants.EQUAL;
- }
-
- if (Pfield == null) {
- Pfield = DECIMAL_ZERO;
- }
-
- if (Qfield == null) {
- Qfield = DECIMAL_ZERO;
- }
-
- return Pfield.compareTo(Qfield);
- }
-
- /**
- * <p>Indicates whether parameter <code>obj</code> is "equal to" this one.</p>
- *
- * @param obj to compare.
- *
- * @return <code>true</code> when <code>compare(this,(XMLGregorianCalendar)obj) == EQUAL.</code>.
- */
- public boolean equals(Object obj) {
-
- if (obj == null || !(obj instanceof XMLGregorianCalendar)) {
- return false;
- }
- return compare((XMLGregorianCalendar) obj) == DatatypeConstants.EQUAL;
- }
-
- /**
- * <p>Returns a hash code consistent with the definition of the equals method.</p>
- *
- * @return hash code of this object.
- */
- public int hashCode() {
-
- // Following two dates compare to EQUALS since in different timezones.
- // 2000-01-15T12:00:00-05:00 == 2000-01-15T13:00:00-04:00
- //
- // Must ensure both instances generate same hashcode by normalizing
- // this to UTC timezone.
- int timezone = getTimezone();
- if (timezone == DatatypeConstants.FIELD_UNDEFINED) {
- timezone = 0;
- }
- XMLGregorianCalendar gc = this;
- if (timezone != 0) {
- gc = this.normalizeToTimezone(getTimezone());
- }
- return gc.getYear() + gc.getMonth() + gc.getDay() +
- gc.getHour() + gc.getMinute() + gc.getSecond();
- }
-
-
- /**
- * <p>Constructs a new XMLGregorianCalendar object by
- * parsing its lexical string representation as defined in
- * <a href="http://www.w3.org/TR/xmlschema-2/#dateTime-order">XML Schema 1.0 Part 2, Section 3.2.[7-14].1,
- * <i>Lexical Representation</i>.</a></p>
- *
- * <p>The string representation may not have any leading and trailing whitespaces.</p>
- *
- * <p>The parsing is done field by field so that
- * the following holds for any lexically correct string x:</p>
- * <pre>
- * new XMLGregorianCalendar(x).toXMLFormat().equals(x)
- * </pre>
- * Except for the noted lexical/canonical representation mismatches
- * listed in <a href="http://www.w3.org/2001/05/xmlschema-errata#e2-45">
- * XML Schema 1.0 errata, Section 3.2.7.2</a>.
- *
- * <p>Returns a non-null valid XMLGregorianCalendar object that holds the value
- * indicated by the lexicalRepresentation parameter.</p>
- *
- * @param lexicalRepresentation Lexical representation of one the 8 XML Schema calendar datatypes.
- *
- * @return <code>XMLGregorianCalendar</code> created from parsing <code>lexicalRepresentation</code> parameter.
- *
- * @throws IllegalArgumentException
- * If the given string does not conform to the aforementioned
- * specification.
- * @throws NullPointerException
- * If the given string is null.
- */
- public static XMLGregorianCalendar parse(String lexicalRepresentation) {
-
- return new XMLGregorianCalendarImpl(lexicalRepresentation);
- }
-
- /**
- * <p>Return the lexical representation of <code>this</code> instance.
- * The format is specified in
- * <a href="http://www.w3.org/TR/xmlschema-2/#dateTime-order">XML Schema 1.0 Part 2, Section 3.2.[7-14].1,
- * <i>Lexical Representation</i>".</a></p>
- *
- * <p>Specific target lexical representation format is determined by
- * {@link #getXMLSchemaType()}.</p>
- *
- * @return XML, as <code>String</code>, representation of this <code>XMLGregorianCalendar</code>
- *
- * @throws java.lang.IllegalStateException if the combination of set fields
- * does not match one of the eight defined XML Schema builtin date/time datatypes.
- */
- public String toXMLFormat() {
-
- QName typekind = getXMLSchemaType();
-
- String formatString = null;
- // Fix 4971612: invalid SCCS macro substitution in data string
- // no %{alpha}% to avoid SCCS macro substitution
- if (typekind == DatatypeConstants.DATETIME) {
- formatString = "%Y-%M-%DT%h:%m:%s" + "%z";
- } else if (typekind == DatatypeConstants.DATE) {
- formatString = "%Y-%M-%D" + "%z";
- } else if (typekind == DatatypeConstants.TIME) {
- formatString = "%h:%m:%s" + "%z";
- } else if (typekind == DatatypeConstants.GMONTH) {
- formatString = "--%M" + "%z";
- } else if (typekind == DatatypeConstants.GDAY) {
- formatString = "---%D" + "%z";
- } else if (typekind == DatatypeConstants.GYEAR) {
- formatString = "%Y" + "%z";
- } else if (typekind == DatatypeConstants.GYEARMONTH) {
- formatString = "%Y-%M" + "%z";
- } else if (typekind == DatatypeConstants.GMONTHDAY) {
- formatString = "--%M-%D" + "%z";
- }
- return format(formatString);
- }
-
- /**
- * <p>Return the name of the XML Schema date/time type that this instance
- * maps to. Type is computed based on fields that are set.</p>
- *
- * <table border="2" rules="all" cellpadding="2">
- * <thead>
- * <tr>
- * <th align="center" colspan="7">
- * Required fields for XML Schema 1.0 Date/Time Datatypes.<br/>
- * <i>(timezone is optional for all date/time datatypes)</i>
- * </th>
- * </tr>
- * </thead>
- * <tbody>
- * <tr>
- * <td>Datatype</td>
- * <td>year</td>
- * <td>month</td>
- * <td>day</td>
- * <td>hour</td>
- * <td>minute</td>
- * <td>second</td>
- * </tr>
- * <tr>
- * <td>{@link DatatypeConstants#DATETIME}</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * </tr>
- * <tr>
- * <td>{@link DatatypeConstants#DATE}</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * <td></td>
- * <td></td>
- * <td></td>
- * </tr>
- * <tr>
- * <td>{@link DatatypeConstants#TIME}</td>
- * <td></td>
- * <td></td>
- * <td></td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * </tr>
- * <tr>
- * <td>{@link DatatypeConstants#GYEARMONTH}</td>
- * <td>X</td>
- * <td>X</td>
- * <td></td>
- * <td></td>
- * <td></td>
- * <td></td>
- * </tr>
- * <tr>
- * <td>{@link DatatypeConstants#GMONTHDAY}</td>
- * <td></td>
- * <td>X</td>
- * <td>X</td>
- * <td></td>
- * <td></td>
- * <td></td>
- * </tr>
- * <tr>
- * <td>{@link DatatypeConstants#GYEAR}</td>
- * <td>X</td>
- * <td></td>
- * <td></td>
- * <td></td>
- * <td></td>
- * <td></td>
- * </tr>
- * <tr>
- * <td>{@link DatatypeConstants#GMONTH}</td>
- * <td></td>
- * <td>X</td>
- * <td></td>
- * <td></td>
- * <td></td>
- * <td></td>
- * </tr>
- * <tr>
- * <td>{@link DatatypeConstants#GDAY}</td>
- * <td></td>
- * <td></td>
- * <td>X</td>
- * <td></td>
- * <td></td>
- * <td></td>
- * </tr>
- * </tbody>
- * </table>
- *
- * @throws java.lang.IllegalStateException if the combination of set fields
- * does not match one of the eight defined XML Schema builtin
- * date/time datatypes.
- * @return One of the following class constants:
- * {@link DatatypeConstants#DATETIME},
- * {@link DatatypeConstants#TIME},
- * {@link DatatypeConstants#DATE},
- * {@link DatatypeConstants#GYEARMONTH},
- * {@link DatatypeConstants#GMONTHDAY},
- * {@link DatatypeConstants#GYEAR},
- * {@link DatatypeConstants#GMONTH} or
- * {@link DatatypeConstants#GDAY}.
- */
- public QName getXMLSchemaType() {
-
- int mask =
- (year != DatatypeConstants.FIELD_UNDEFINED ? 0x20 : 0 )|
- (month != DatatypeConstants.FIELD_UNDEFINED ? 0x10 : 0 )|
- (day != DatatypeConstants.FIELD_UNDEFINED ? 0x08 : 0 )|
- (hour != DatatypeConstants.FIELD_UNDEFINED ? 0x04 : 0 )|
- (minute != DatatypeConstants.FIELD_UNDEFINED ? 0x02 : 0 )|
- (second != DatatypeConstants.FIELD_UNDEFINED ? 0x01 : 0 );
-
- switch(mask) {
- case 0x3F:
- return DatatypeConstants.DATETIME;
- case 0x38:
- return DatatypeConstants.DATE;
- case 0x07:
- return DatatypeConstants.TIME;
- case 0x30:
- return DatatypeConstants.GYEARMONTH;
- case 0x18:
- return DatatypeConstants.GMONTHDAY;
- case 0x20:
- return DatatypeConstants.GYEAR;
- case 0x10:
- return DatatypeConstants.GMONTH;
- case 0x08:
- return DatatypeConstants.GDAY;
- default:
- throw new IllegalStateException(
- this.getClass().getName()
- + "#getXMLSchemaType() :"
- + DatatypeMessageFormatter.formatMessage(null, "InvalidXGCFields", null)
- );
- }
- }
-
-
- /**
- * Validate instance by <code>getXMLSchemaType()</code> constraints.
- * @return true if data values are valid.
- */
- public boolean isValid() {
- // since setters do not allow for invalid values,
- // (except for exceptional case of year field of zero),
- // no need to check for anything except for constraints
- // between fields.
-
- //check if days in month is valid. Can be dependent on leap year.
- if (getMonth() == DatatypeConstants.FEBRUARY) {
- // years could not be set
- int maxDays = 29;
-
- if (eon == null) {
- if(year!=DatatypeConstants.FIELD_UNDEFINED)
- maxDays = maximumDayInMonthFor(year,getMonth());
- } else {
- BigInteger years = getEonAndYear();
- if (years != null) {
- maxDays = maximumDayInMonthFor(getEonAndYear(), DatatypeConstants.FEBRUARY);
- }
- }
- if (getDay() > maxDays) {
- return false;
- }
- }
-
- // http://www.w3.org/2001/05/xmlschema-errata#e2-45
- if (getHour() == 24) {
- if(getMinute() != 0) {
- return false;
- } else if (getSecond() != 0) {
- return false;
- }
- }
-
- // XML Schema 1.0 specification defines year value of zero as
- // invalid. Allow this class to set year field to zero
- // since XML Schema 1.0 errata states that lexical zero will
- // be allowed in next version and treated as 1 B.C.E.
- if (eon == null) {
- // optimize check.
- if (year == 0) {
- return false;
- }
- } else {
- BigInteger yearField = getEonAndYear();
- if (yearField != null) {
- int result = compareField(yearField, BigInteger.ZERO);
- if (result == DatatypeConstants.EQUAL) {
- return false;
- }
- }
- }
- return true;
- }
-
- /**
- * <p>Add <code>duration</code> to this instance.<\p>
- *
- * <p>The computation is specified in
- * <a href="http://www.w3.org/TR/xmlschema-2/#adding-durations-to-dateTimes">XML Schema 1.0 Part 2, Appendix E,
- * <i>Adding durations to dateTimes</i>></a>.
- * <a href="#datetimefieldsmapping">date/time field mapping table</a>
- * defines the mapping from XML Schema 1.0 <code>dateTime</code> fields
- * to this class' representation of those fields.</p>
- *
- * @param duration Duration to add to this <code>XMLGregorianCalendar</code>.
- *
- * @throws NullPointerException when <code>duration</code> parameter is <code>null</code>.
- */
- public void add(Duration duration) {
-
- /*
- * Extracted from
- * http://www.w3.org/TR/xmlschema-2/#adding-durations-to-dateTimes
- * to ensure implemented properly. See spec for definitions of methods
- * used in algorithm.
- *
- * Given a dateTime S and a duration D, specifies how to compute a
- * dateTime E where E is the end of the time period with start S and
- * duration D i.e. E = S + D.
- *
- * The following is the precise specification.
- * These steps must be followed in the same order.
- * If a field in D is not specified, it is treated as if it were zero.
- * If a field in S is not specified, it is treated in the calculation
- * as if it were the minimum allowed value in that field, however,
- * after the calculation is concluded, the corresponding field in
- * E is removed (set to unspecified).
- *
- * Months (may be modified additionally below)
- * temp := S[month] + D[month]
- * E[month] := modulo(temp, 1, 13)
- * carry := fQuotient(temp, 1, 13)
- */
-
- boolean fieldUndefined[] = {
- false,
- false,
- false,
- false,
- false,
- false
- };
-
- int signum = duration.getSign();
-
- int startMonth = getMonth();
- if (startMonth == DatatypeConstants.FIELD_UNDEFINED) {
- startMonth = DatatypeConstants.JANUARY;
- fieldUndefined[MONTH] = true;
- }
-
- BigInteger dMonths = sanitize(duration.getField(DatatypeConstants.MONTHS), signum);
- BigInteger temp = BigInteger.valueOf((long) startMonth).add(dMonths);
- setMonth(temp.subtract(BigInteger.ONE).mod(TWELVE).intValue() + 1);
- BigInteger carry =
- new BigDecimal(temp.subtract(BigInteger.ONE)).divide(new BigDecimal(TWELVE), BigDecimal.ROUND_FLOOR).toBigInteger();
-
- /* Years (may be modified additionally below)
- * E[year] := S[year] + D[year] + carry
- */
- BigInteger startYear = getEonAndYear();
- if (startYear == null) {
- fieldUndefined[YEAR] = true;
- startYear = BigInteger.ZERO;
- }
- BigInteger dYears = sanitize(duration.getField(DatatypeConstants.YEARS), signum);
- BigInteger endYear = startYear.add(dYears).add(carry);
- setYear(endYear);
-
- /* Zone
- * E[zone] := S[zone]
- *
- * no-op since adding to this, not to a new end point.
- */
-
- /* Seconds
- * temp := S[second] + D[second]
- * E[second] := modulo(temp, 60)
- * carry := fQuotient(temp, 60)
- */
- BigDecimal startSeconds;
- if (getSecond() == DatatypeConstants.FIELD_UNDEFINED) {
- fieldUndefined[SECOND] = true;
- startSeconds = DECIMAL_ZERO;
- } else {
- // seconds + fractionalSeconds
- startSeconds = getSeconds();
- }
-
- // Duration seconds is SECONDS + FRACTIONALSECONDS.
- BigDecimal dSeconds = DurationImpl.sanitize((BigDecimal) duration.getField(DatatypeConstants.SECONDS), signum);
- BigDecimal tempBD = startSeconds.add(dSeconds);
- BigDecimal fQuotient =
- new BigDecimal(new BigDecimal(tempBD.toBigInteger()).divide(DECIMAL_SIXTY, BigDecimal.ROUND_FLOOR).toBigInteger());
- BigDecimal endSeconds = tempBD.subtract(fQuotient.multiply(DECIMAL_SIXTY));
-
- carry = fQuotient.toBigInteger();
- setSecond(endSeconds.intValue());
- BigDecimal tempFracSeconds = endSeconds.subtract(new BigDecimal(BigInteger.valueOf((long) getSecond())));
- if (tempFracSeconds.compareTo(DECIMAL_ZERO) < 0) {
- setFractionalSecond(DECIMAL_ONE.add(tempFracSeconds));
- if (getSecond() == 0) {
- setSecond(59);
- carry = carry.subtract(BigInteger.ONE);
- } else {
- setSecond(getSecond() - 1);
- }
- } else {
- setFractionalSecond(tempFracSeconds);
- }
-
- /* Minutes
- * temp := S[minute] + D[minute] + carry
- * E[minute] := modulo(temp, 60)
- * carry := fQuotient(temp, 60)
- */
- int startMinutes = getMinute();
- if (startMinutes == DatatypeConstants.FIELD_UNDEFINED) {
- fieldUndefined[MINUTE] = true;
- startMinutes = 0;
- }
- BigInteger dMinutes = sanitize(duration.getField(DatatypeConstants.MINUTES), signum);
-
- temp = BigInteger.valueOf(startMinutes).add(dMinutes).add(carry);
- setMinute(temp.mod(SIXTY).intValue());
- carry = new BigDecimal(temp).divide(DECIMAL_SIXTY, BigDecimal.ROUND_FLOOR).toBigInteger();
-
- /* Hours
- * temp := S[hour] + D[hour] + carry
- * E[hour] := modulo(temp, 24)
- * carry := fQuotient(temp, 24)
- */
- int startHours = getHour();
- if (startHours == DatatypeConstants.FIELD_UNDEFINED) {
- fieldUndefined[HOUR] = true;
- startHours = 0;
- }
- BigInteger dHours = sanitize(duration.getField(DatatypeConstants.HOURS), signum);
-
- temp = BigInteger.valueOf(startHours).add(dHours).add(carry);
- setHour(temp.mod(TWENTY_FOUR).intValue(), false);
- carry = new BigDecimal(temp).divide(new BigDecimal(TWENTY_FOUR), BigDecimal.ROUND_FLOOR).toBigInteger();
-
- /* Days
- * if S[day] > maximumDayInMonthFor(E[year], E[month])
- * + tempDays := maximumDayInMonthFor(E[year], E[month])
- * else if S[day] < 1
- * + tempDays := 1
- * else
- * + tempDays := S[day]
- * E[day] := tempDays + D[day] + carry
- * START LOOP
- * + IF E[day] < 1
- * # E[day] := E[day] +
- * maximumDayInMonthFor(E[year], E[month] - 1)
- * # carry := -1
- * + ELSE IF E[day] > maximumDayInMonthFor(E[year], E[month])
- * # E[day] :=
- * E[day] - maximumDayInMonthFor(E[year], E[month])
- * # carry := 1
- * + ELSE EXIT LOOP
- * + temp := E[month] + carry
- * + E[month] := modulo(temp, 1, 13)
- * + E[year] := E[year] + fQuotient(temp, 1, 13)
- * + GOTO START LOOP
- */
- BigInteger tempDays;
- int startDay = getDay();
- if (startDay == DatatypeConstants.FIELD_UNDEFINED) {
- fieldUndefined[DAY] = true;
- startDay = 1;
- }
- BigInteger dDays = sanitize(duration.getField(DatatypeConstants.DAYS), signum);
- int maxDayInMonth = maximumDayInMonthFor(getEonAndYear(), getMonth());
- if (startDay > maxDayInMonth) {
- tempDays = BigInteger.valueOf(maxDayInMonth);
- } else if (startDay < 1) {
- tempDays = BigInteger.ONE;
- } else {
- tempDays = BigInteger.valueOf(startDay);
- }
- BigInteger endDays = tempDays.add(dDays).add(carry);
- int monthCarry;
- int intTemp;
- while (true) {
- if (endDays.compareTo(BigInteger.ONE) < 0) {
- // calculate days in previous month, watch for month roll over
- BigInteger mdimf = null;
- if (month >= 2) {
- mdimf = BigInteger.valueOf(maximumDayInMonthFor(getEonAndYear(), getMonth() - 1));
- } else {
- // roll over to December of previous year
- mdimf = BigInteger.valueOf(maximumDayInMonthFor(getEonAndYear().subtract(BigInteger.valueOf((long) 1)), 12));
- }
- endDays = endDays.add(mdimf);
- monthCarry = -1;
- } else if (endDays.compareTo(BigInteger.valueOf(maximumDayInMonthFor(getEonAndYear(), getMonth()))) > 0) {
- endDays = endDays.add(BigInteger.valueOf(-maximumDayInMonthFor(getEonAndYear(), getMonth())));
- monthCarry = 1;
- } else {
- break;
- }
-
- intTemp = getMonth() + monthCarry;
- int endMonth = (intTemp - 1) % (13 - 1);
- int quotient;
- if (endMonth < 0) {
- endMonth = (13 - 1) + endMonth + 1;
- quotient = new BigDecimal(intTemp - 1).divide(new BigDecimal(TWELVE), BigDecimal.ROUND_UP).intValue();
- } else {
- quotient = (intTemp - 1) / (13 - 1);
- endMonth += 1;
- }
- setMonth(endMonth);
- if (quotient != 0) {
- setYear(getEonAndYear().add(BigInteger.valueOf(quotient)));
- }
- }
- setDay(endDays.intValue());
-
- // set fields that where undefined before this addition, back to undefined.
- for (int i = YEAR; i <= SECOND; i++) {
- if (fieldUndefined[i]) {
- switch (i) {
- case YEAR:
- setYear(DatatypeConstants.FIELD_UNDEFINED);
- break;
- case MONTH:
- setMonth(DatatypeConstants.FIELD_UNDEFINED);
- break;
- case DAY:
- setDay(DatatypeConstants.FIELD_UNDEFINED);
- break;
- case HOUR:
- setHour(DatatypeConstants.FIELD_UNDEFINED, false);
- break;
- case MINUTE:
- setMinute(DatatypeConstants.FIELD_UNDEFINED);
- break;
- case SECOND:
- setSecond(DatatypeConstants.FIELD_UNDEFINED);
- setFractionalSecond(null);
- break;
- }
- }
- }
- }
-
- private static final BigInteger FOUR = BigInteger.valueOf(4);
- private static final BigInteger HUNDRED = BigInteger.valueOf(100);
- private static final BigInteger FOUR_HUNDRED = BigInteger.valueOf(400);
- private static final BigInteger SIXTY = BigInteger.valueOf(60);
- private static final BigInteger TWENTY_FOUR = BigInteger.valueOf(24);
- private static final BigInteger TWELVE = BigInteger.valueOf(12);
- private static final BigDecimal DECIMAL_ZERO = new BigDecimal("0");
- private static final BigDecimal DECIMAL_ONE = new BigDecimal("1");
- private static final BigDecimal DECIMAL_SIXTY = new BigDecimal("60");
-
-
- private static int daysInMonth[] = { 0, // XML Schema months start at 1.
- 31, 28, 31, 30, 31, 30,
- 31, 31, 30, 31, 30, 31};
-
- private static int maximumDayInMonthFor(BigInteger year, int month) {
- if (month != DatatypeConstants.FEBRUARY) {
- return daysInMonth[month];
- } else {
- if (year.mod(FOUR_HUNDRED).equals(BigInteger.ZERO) ||
- (!year.mod(HUNDRED).equals(BigInteger.ZERO) &&
- year.mod(FOUR).equals(BigInteger.ZERO))) {
- // is a leap year.
- return 29;
- } else {
- return daysInMonth[month];
- }
- }
- }
-
- private static int maximumDayInMonthFor(int year, int month) {
- if (month != DatatypeConstants.FEBRUARY) {
- return daysInMonth[month];
- } else {
- if (((year % 400) == 0) ||
- (((year % 100) != 0) && ((year % 4) == 0))) {
- // is a leap year.
- return 29;
- } else {
- return daysInMonth[DatatypeConstants.FEBRUARY];
- }
- }
- }
-
- /**
- * <p>Convert <code>this</code> to <code>java.util.GregorianCalendar</code>.</p>
- *
- * <p>When <code>this</code> instance has an undefined field, this
- * conversion relies on the <code>java.util.GregorianCalendar</code> default
- * for its corresponding field. A notable difference between
- * XML Schema 1.0 date/time datatypes and <code>java.util.GregorianCalendar</code>
- * is that Timezone value is optional for date/time datatypes and it is
- * a required field for <code>java.util.GregorianCalendar</code>. See javadoc
- * for <code>java.util.TimeZone.getDefault()</code> on how the default
- * is determined. To explicitly specify the <code>TimeZone</code>
- * instance, see
- * {@link #toGregorianCalendar(TimeZone, Locale, XMLGregorianCalendar)}.</p>
- *
- * <table border="2" rules="all" cellpadding="2">
- * <thead>
- * <tr>
- * <th align="center" colspan="2">
- * Field by Field Conversion from this class to
- * <code>java.util.GregorianCalendar</code>
- * </th>
- * </tr>
- * </thead>
- * <tbody>
- * <tr>
- * <th><code>java.util.GregorianCalendar</code> field</th>
- * <th><code>javax.xml.datatype.XMLGregorianCalendar</code> field</th>
- * </tr>
- * <tr>
- * <th><code>ERA</code></th>
- * <th>{@link #getEonAndYear()}<code>.signum() < 0 ? GregorianCalendar.BC : GregorianCalendar.AD</code></th>
- * </tr>
- * <tr>
- * <th><code>YEAR</code></th>
- * <th>{@link #getEonAndYear()}<code>.abs().intValue()</code><i>*</i></th>
- * </tr>
- * <tr>
- * <th><code>MONTH</code></th>
- * <th>{@link #getMonth()}<code> - 1</code></th>
- * </tr>
- * <tr>
- * <th><code>DAY_OF_MONTH</code></th>
- * <th>{@link #getDay()}</th>
- * </tr>
- * <tr>
- * <th><code>AM_PM</code></th>
- * <th>{@link #getHour()} < 12 : Calendar.AM : Calendar.PM</th>
- * </tr>
- * <tr>
- * <th><code>HOUR_OF_DAY</code></th>
- * <th>{@link #getHour()}</th>
- * </tr>
- * <tr>
- * <th><code>MINUTE</code></th>
- * <th>{@link #getMinute()}</th>
- * </tr>
- * <tr>
- * <th><code>SECOND</code></th>
- * <th>{@link #getSecond()}</th>
- * </tr>
- * <tr>
- * <th><code>MILLISECOND</code></th>
- * <th>get millisecond order from {@link #getFractionalSecond()}<i>*</i> </th>
- * </tr>
- * <tr>
- * <th><code>GregorianCalendar.setTimeZone(TimeZone)</code></th>
- * <th>{@link #getTimezone()} formatted into Custom timezone id</th>
- * </tr>
- * </tbody>
- * </table>
- * <i>*</i> designates possible loss of precision during the conversion due
- * to source datatype having higer precison than target datatype.
- *
- * <p>To ensure consistency in conversion implementations, the new
- * <code>GregorianCalendar</code> should be instantiated in following
- * manner.
- * <ul>
- * <li>Using <code>timeZone</code> value as defined above, create a new
- * <code>java.util.GregorianCalendar(timeZone,Locale.getDefault())</code>.
- * </li>
- * <li>Initialize all GregorianCalendar fields by calling {(@link GegorianCalendar#clear()}.</li>
- * <li>Obtain a pure Gregorian Calendar by invoking
- * <code>GregorianCalendar.setGregorianChange(
- * new Date(Long.MIN_VALUE))</code>.</li>
- * <li>Its fields ERA, YEAR, MONTH, DAY_OF_MONTH, HOUR_OF_DAY,
- * MINUTE, SECOND and MILLISECOND are set using the method
- * <code>Calendar.set(int,int)</code></li>
- * </ul>
- * </p>
- *
- * @see #toGregorianCalendar(java.util.TimeZone, java.util.Locale, XMLGregorianCalendar)
- */
- public java.util.GregorianCalendar toGregorianCalendar() {
-
- GregorianCalendar result = null;
- final int DEFAULT_TIMEZONE_OFFSET = DatatypeConstants.FIELD_UNDEFINED;
- TimeZone tz = getTimeZone(DEFAULT_TIMEZONE_OFFSET);
- /** Use the following instead for JDK7 only:
- * Locale locale = Locale.getDefault(Locale.Category.FORMAT);
- */
- Locale locale = getDefaultLocale();
-
- result = new GregorianCalendar(tz, locale);
- result.clear();
- result.setGregorianChange(PURE_GREGORIAN_CHANGE);
-
- // if year( and eon) are undefined, leave default Calendar values
- BigInteger year = getEonAndYear();
- if (year != null) {
- result.set(Calendar.ERA, year.signum() == -1 ? GregorianCalendar.BC : GregorianCalendar.AD);
- result.set(Calendar.YEAR, year.abs().intValue());
- }
-
- // only set month if it is set
- if (month != DatatypeConstants.FIELD_UNDEFINED) {
- // Calendar.MONTH is zero based while XMLGregorianCalendar month field is not.
- result.set(Calendar.MONTH, month - 1);
- }
-
- // only set day if it is set
- if (day != DatatypeConstants.FIELD_UNDEFINED) {
- result.set(Calendar.DAY_OF_MONTH, day);
- }
-
- // only set hour if it is set
- if (hour != DatatypeConstants.FIELD_UNDEFINED) {
- result.set(Calendar.HOUR_OF_DAY, hour);
- }
-
- // only set minute if it is set
- if (minute != DatatypeConstants.FIELD_UNDEFINED) {
- result.set(Calendar.MINUTE, minute);
- }
-
- // only set second if it is set
- if (second != DatatypeConstants.FIELD_UNDEFINED) {
- result.set(Calendar.SECOND, second);
- }
-
- // only set millisend if it is set
- if (fractionalSecond != null) {
- result.set(Calendar.MILLISECOND, getMillisecond());
- }
-
- return result;
- }
-
- /**
- *
- * @return default locale
- */
- private Locale getDefaultLocale() {
-
- String lang = SecuritySupport.getSystemProperty("user.language.format");
- String country = SecuritySupport.getSystemProperty("user.country.format");
- String variant = SecuritySupport.getSystemProperty("user.variant.format");
- Locale locale = null;
- if (lang != null) {
- if (country != null) {
- if (variant != null) {
- locale = new Locale(lang, country, variant);
- } else {
- locale = new Locale(lang, country);
- }
- } else {
- locale = new Locale(lang);
- }
- }
- if (locale == null) {
- locale = Locale.getDefault();
- }
- return locale;
- }
-
- /**
- * <p>Convert <code>this</code> along with provided parameters
- * to <code>java.util.GregorianCalendar</code> instance.</p>
- *
- * <p> Since XML Schema 1.0 date/time datetypes has no concept of
- * timezone ids or daylight savings timezone ids, this conversion operation
- * allows the user to explicitly specify one with
- * <code>timezone</code> parameter.</p>
- *
- * <p>To compute the return value's <code>TimeZone</code> field,
- * <ul>
- * <li>when parameter <code>timeZone</code> is non-null,
- * it is the timezone field.</li>
- * <li>else when <code>this.getTimezone() != DatatypeConstants.FIELD_UNDEFINED</code>,
- * create a <code>java.util.TimeZone</code> with a custom timezone id
- * using the <code>this.getTimezone()</code>.</li>
- * <li>else when <code>defaults.getTimezone() != DatatypeConstants.FIELD_UNDEFINED</code>,
- * create a <code>java.util.TimeZone</code> with a custom timezone id
- * using <code>defaults.getTimezone()</code>.</li>
- * <li>else use the <code>GregorianCalendar</code> default timezone value
- * for the host is definedas specified by
- * <code>java.util.TimeZone.getDefault()</code>.</li></p>
- *
- * <p>To ensure consistency in conversion implementations, the new
- * <code>GregorianCalendar</code> should be instantiated in following
- * manner.
- * <ul>
- * <li>Create a new <code>java.util.GregorianCalendar(TimeZone,
- * Locale)</code> with TimeZone set as specified above and the
- * <code>Locale</code> parameter.
- * </li>
- * <li>Initialize all GregorianCalendar fields by calling {(@link GegorianCalendar#clear()}.</li>
- * <li>Obtain a pure Gregorian Calendar by invoking
- * <code>GregorianCalendar.setGregorianChange(
- * new Date(Long.MIN_VALUE))</code>.</li>
- * <li>Its fields ERA, YEAR, MONTH, DAY_OF_MONTH, HOUR_OF_DAY,
- * MINUTE, SECOND and MILLISECOND are set using the method
- * <code>Calendar.set(int,int)</code></li>
- * </ul>
- *
- * @param timezone provide Timezone. <code>null</code> is a legal value.
- * @param aLocale provide explicit Locale. Use default GregorianCalendar locale if
- * value is <code>null</code>.
- * @param defaults provide default field values to use when corresponding
- * field for this instance is DatatypeConstants.FIELD_UNDEFINED or null.
- * If <code>defaults</code>is <code>null</code> or a field
- * within the specified <code>defaults</code> is undefined,
- * just use <code>java.util.GregorianCalendar</code> defaults.
- * @return a java.util.GregorianCalendar conversion of this instance.
- *
- * @see #LEAP_YEAR_DEFAULT
- */
- public GregorianCalendar toGregorianCalendar(TimeZone timezone,
- Locale aLocale,
- XMLGregorianCalendar defaults) {
- GregorianCalendar result = null;
- TimeZone tz = timezone;
- if (tz == null) {
- int defaultZoneoffset = DatatypeConstants.FIELD_UNDEFINED;
- if (defaults != null) {
- defaultZoneoffset = defaults.getTimezone();
- }
- tz = getTimeZone(defaultZoneoffset);
- }
- if (aLocale == null) {
- aLocale = Locale.getDefault();
- }
- result = new GregorianCalendar(tz, aLocale);
- result.clear();
- result.setGregorianChange(PURE_GREGORIAN_CHANGE);
-
- // if year( and eon) are undefined, leave default Calendar values
- BigInteger year = getEonAndYear();
- if (year != null) {
- result.set(Calendar.ERA, year.signum() == -1 ? GregorianCalendar.BC : GregorianCalendar.AD);
- result.set(Calendar.YEAR, year.abs().intValue());
- } else {
- // use default if set
- BigInteger defaultYear = (defaults != null) ? defaults.getEonAndYear() : null;
- if (defaultYear != null) {
- result.set(Calendar.ERA, defaultYear.signum() == -1 ? GregorianCalendar.BC : GregorianCalendar.AD);
- result.set(Calendar.YEAR, defaultYear.abs().intValue());
- }
- }
-
- // only set month if it is set
- if (month != DatatypeConstants.FIELD_UNDEFINED) {
- // Calendar.MONTH is zero based while XMLGregorianCalendar month field is not.
- result.set(Calendar.MONTH, month - 1);
- } else {
- // use default if set
- int defaultMonth = (defaults != null) ? defaults.getMonth() : DatatypeConstants.FIELD_UNDEFINED;
- if (defaultMonth != DatatypeConstants.FIELD_UNDEFINED) {
- // Calendar.MONTH is zero based while XMLGregorianCalendar month field is not.
- result.set(Calendar.MONTH, defaultMonth - 1);
- }
- }
-
- // only set day if it is set
- if (day != DatatypeConstants.FIELD_UNDEFINED) {
- result.set(Calendar.DAY_OF_MONTH, day);
- } else {
- // use default if set
- int defaultDay = (defaults != null) ? defaults.getDay() : DatatypeConstants.FIELD_UNDEFINED;
- if (defaultDay != DatatypeConstants.FIELD_UNDEFINED) {
- result.set(Calendar.DAY_OF_MONTH, defaultDay);
- }
- }
-
- // only set hour if it is set
- if (hour != DatatypeConstants.FIELD_UNDEFINED) {
- result.set(Calendar.HOUR_OF_DAY, hour);
- } else {
- // use default if set
- int defaultHour = (defaults != null) ? defaults.getHour() : DatatypeConstants.FIELD_UNDEFINED;
- if (defaultHour != DatatypeConstants.FIELD_UNDEFINED) {
- result.set(Calendar.HOUR_OF_DAY, defaultHour);
- }
- }
-
- // only set minute if it is set
- if (minute != DatatypeConstants.FIELD_UNDEFINED) {
- result.set(Calendar.MINUTE, minute);
- } else {
- // use default if set
- int defaultMinute = (defaults != null) ? defaults.getMinute() : DatatypeConstants.FIELD_UNDEFINED;
- if (defaultMinute != DatatypeConstants.FIELD_UNDEFINED) {
- result.set(Calendar.MINUTE, defaultMinute);
- }
- }
-
- // only set second if it is set
- if (second != DatatypeConstants.FIELD_UNDEFINED) {
- result.set(Calendar.SECOND, second);
- } else {
- // use default if set
- int defaultSecond = (defaults != null) ? defaults.getSecond() : DatatypeConstants.FIELD_UNDEFINED;
- if (defaultSecond != DatatypeConstants.FIELD_UNDEFINED) {
- result.set(Calendar.SECOND, defaultSecond);
- }
- }
-
- // only set millisend if it is set
- if (fractionalSecond != null) {
- result.set(Calendar.MILLISECOND, getMillisecond());
- } else {
- // use default if set
- BigDecimal defaultFractionalSecond = (defaults != null) ? defaults.getFractionalSecond() : null;
- if (defaultFractionalSecond != null) {
- result.set(Calendar.MILLISECOND, defaults.getMillisecond());
- }
- }
-
- return result;
- }
-
- /**
- * <p>Returns a <code>java.util.TimeZone</code> for this class.</p>
- *
- * <p>If timezone field is defined for this instance,
- * returns TimeZone initialized with custom timezone id
- * of zoneoffset. If timezone field is undefined,
- * try the defaultZoneoffset that was passed in.
- * If defaultZoneoffset is DatatypeConstants.FIELD_UNDEFINED, return
- * default timezone for this host.
- * (Same default as java.util.GregorianCalendar).</p>
- *
- * @param defaultZoneoffset default zoneoffset if this zoneoffset is
- * {@link DatatypeConstants#FIELD_UNDEFINED}.
- *
- * @return TimeZone for this.
- */
- public TimeZone getTimeZone(int defaultZoneoffset) {
- TimeZone result = null;
- int zoneoffset = getTimezone();
-
- if (zoneoffset == DatatypeConstants.FIELD_UNDEFINED) {
- zoneoffset = defaultZoneoffset;
- }
- if (zoneoffset == DatatypeConstants.FIELD_UNDEFINED) {
- result = TimeZone.getDefault();
- } else {
- // zoneoffset is in minutes. Convert to custom timezone id format.
- char sign = zoneoffset < 0 ? '-' : '+';
- if (sign == '-') {
- zoneoffset = -zoneoffset;
- }
- int hour = zoneoffset / 60;
- int minutes = zoneoffset - (hour * 60);
-
- // Javadoc for java.util.TimeZone documents max length
- // for customTimezoneId is 8 when optional ':' is not used.
- // Format is
- // "GMT" ('-'|''+') (digit digit?) (digit digit)?
- // hour minutes
- StringBuffer customTimezoneId = new StringBuffer(8);
- customTimezoneId.append("GMT");
- customTimezoneId.append(sign);
- customTimezoneId.append(hour);
- if (minutes != 0) {
- if (minutes < 10) {
- customTimezoneId.append('0');
- }
- customTimezoneId.append(minutes);
- }
- result = TimeZone.getTimeZone(customTimezoneId.toString());
- }
- return result;
- }
-
- /**
- * <p>Creates and returns a copy of this object.</p>
- *
- * @return copy of this <code>Object</code>
- */
- public Object clone() {
- // Both this.eon and this.fractionalSecond are instances
- // of immutable classes, so they do not need to be cloned.
- return new XMLGregorianCalendarImpl(getEonAndYear(),
- this.month, this.day,
- this.hour, this.minute, this.second,
- this.fractionalSecond,
- this.timezone);
- }
-
- /**
- * <p>Unset all fields to undefined.</p>
- *
- * <p>Set all int fields to {@link DatatypeConstants#FIELD_UNDEFINED} and reference fields
- * to null.</p>
- */
- public void clear() {
- eon = null;
- year = DatatypeConstants.FIELD_UNDEFINED;
- month = DatatypeConstants.FIELD_UNDEFINED;
- day = DatatypeConstants.FIELD_UNDEFINED;
- timezone = DatatypeConstants.FIELD_UNDEFINED; // in minutes
- hour = DatatypeConstants.FIELD_UNDEFINED;
- minute = DatatypeConstants.FIELD_UNDEFINED;
- second = DatatypeConstants.FIELD_UNDEFINED;
- fractionalSecond = null;
- }
-
- public void setMillisecond(int millisecond) {
- if (millisecond == DatatypeConstants.FIELD_UNDEFINED) {
- fractionalSecond = null;
- } else {
- if(millisecond<0 || 999<millisecond)
- if(millisecond!=DatatypeConstants.FIELD_UNDEFINED)
- invalidFieldValue(MILLISECOND, millisecond);
- fractionalSecond = new BigDecimal((long) millisecond).movePointLeft(3);
- }
- }
-
- public void setFractionalSecond(BigDecimal fractional) {
- if (fractional != null) {
- if ((fractional.compareTo(DECIMAL_ZERO) < 0) ||
- (fractional.compareTo(DECIMAL_ONE) > 0)) {
- throw new IllegalArgumentException(DatatypeMessageFormatter.formatMessage(null,
- "InvalidFractional", new Object[]{fractional}));
- }
- }
- this.fractionalSecond = fractional;
- }
-
- private final class Parser {
- private final String format;
- private final String value;
-
- private final int flen;
- private final int vlen;
-
- private int fidx;
- private int vidx;
-
- private Parser(String format, String value) {
- this.format = format;
- this.value = value;
- this.flen = format.length();
- this.vlen = value.length();
- }
-
- /**
- * <p>Parse a formated <code>String</code> into an <code>XMLGregorianCalendar</code>.</p>
- *
- * <p>If <code>String</code> is not formated as a legal <code>XMLGregorianCalendar</code> value,
- * an <code>IllegalArgumentException</code> is thrown.</p>
- *
- * @throws IllegalArgumentException If <code>String</code> is not formated as a legal <code>XMLGregorianCalendar</code> value.
- */
- public void parse() throws IllegalArgumentException {
- while (fidx < flen) {
- char fch = format.charAt(fidx++);
-
- if (fch != '%') { // not a meta character
- skip(fch);
- continue;
- }
-
- // seen meta character. we don't do error check against the format
- switch (format.charAt(fidx++)) {
- case 'Y' : // year
- parseAndSetYear(4);
- break;
-
- case 'M' : // month
- setMonth(parseInt(2, 2));
- break;
-
- case 'D' : // days
- setDay(parseInt(2, 2));
- break;
-
- case 'h' : // hours
- setHour(parseInt(2, 2), false);
- break;
-
- case 'm' : // minutes
- setMinute(parseInt(2, 2));
- break;
-
- case 's' : // parse seconds.
- setSecond(parseInt(2, 2));
-
- if (peek() == '.') {
- setFractionalSecond(parseBigDecimal());
- }
- break;
-
- case 'z' : // time zone. missing, 'Z', or [+-]nn:nn
- char vch = peek();
- if (vch == 'Z') {
- vidx++;
- setTimezone(0);
- } else if (vch == '+' || vch == '-') {
- vidx++;
- int h = parseInt(2, 2);
- skip(':');
- int m = parseInt(2, 2);
- setTimezone((h * 60 + m) * (vch == '+' ? 1 : -1));
- }
-
- break;
-
- default :
- // illegal meta character. impossible.
- throw new InternalError();
- }
- }
-
- if (vidx != vlen) {
- // some tokens are left in the input
- throw new IllegalArgumentException(value); //,vidx);
- }
- testHour();
- }
-
- private char peek() throws IllegalArgumentException {
- if (vidx == vlen) {
- return (char) -1;
- }
- return value.charAt(vidx);
- }
-
- private char read() throws IllegalArgumentException {
- if (vidx == vlen) {
- throw new IllegalArgumentException(value); //,vidx);
- }
- return value.charAt(vidx++);
- }
-
- private void skip(char ch) throws IllegalArgumentException {
- if (read() != ch) {
- throw new IllegalArgumentException(value); //,vidx-1);
- }
- }
-
- private int parseInt(int minDigits, int maxDigits)
- throws IllegalArgumentException {
-
- int n = 0;
- char ch;
- int vstart = vidx;
- while (isDigit(ch=peek()) && (vidx - vstart) <= maxDigits) {
- vidx++;
- n = n*10 + ch-'0';
- }
- if ((vidx - vstart) < minDigits) {
- // we are expecting more digits
- throw new IllegalArgumentException(value); //,vidx);
- }
-
- return n;
- }
-
- private void parseAndSetYear(int minDigits)
- throws IllegalArgumentException {
- int vstart = vidx;
- int n = 0;
- boolean neg = false;
-
- // skip leading negative, if it exists
- if (peek() == '-') {
- vidx++;
- neg = true;
- }
- while(true) {
- char ch = peek();
- if(!isDigit(ch))
- break;
- vidx++;
- n = n*10 + ch-'0';
- }
-
- if ((vidx - vstart) < minDigits) {
- // we are expecting more digits
- throw new IllegalArgumentException(value); //,vidx);
- }
-
- if(vidx-vstart<7) {
- // definitely int only. I don't know the exact # of digits that can be in int,
- // but as long as we can catch (0-9999) range, that should be enough.
- if(neg) n = -n;
- year = n;
- eon = null;
- } else {
- setYear(new BigInteger(value.substring(vstart, vidx)));
- }
- }
-
- private BigDecimal parseBigDecimal()
- throws IllegalArgumentException {
- int vstart = vidx;
-
- if (peek() == '.') {
- vidx++;
- } else {
- throw new IllegalArgumentException(value);
- }
- while (isDigit(peek())) {
- vidx++;
- }
- return new BigDecimal(value.substring(vstart, vidx));
- }
- }
-
- private static boolean isDigit(char ch) {
- return '0' <= ch && ch <= '9';
- }
-
- /**
- * Prints this object according to the format specification.
- *
- * <p>
- * I wrote a custom format method for a particular format string to
- * see if it improves the performance, but it didn't. So this interpreting
- * approach isn't too bad.
- *
- * <p>
- * StringBuffer -> StringBuilder change had a very visible impact.
- * It almost cut the execution time to half, but unfortunately we can't use it
- * because we need to run on JDK 1.3
- */
- private String format( String format ) {
- char[] buf = new char[32];
- int bufPtr = 0;
-
- int fidx=0,flen=format.length();
-
- while(fidx<flen) {
- char fch = format.charAt(fidx++);
- if(fch!='%') {// not a meta char
- buf[bufPtr++] = fch;
- continue;
- }
-
- switch(format.charAt(fidx++)) {
- case 'Y':
- if(eon==null) {
- // optimized path
- int y = getYear();
- if(y<0) {
- buf[bufPtr++] = '-';
- y = -y;
- }
- bufPtr = print4Number(buf,bufPtr,y);
- } else {
- String s = getEonAndYear().toString();
- // reallocate the buffer now so that it has enough space
- char[] n = new char[buf.length+s.length()];
- System.arraycopy(buf,0,n,0,bufPtr);
- buf = n;
- for(int i=s.length();i<4;i++)
- buf[bufPtr++] = '0';
- s.getChars(0,s.length(),buf,bufPtr);
- bufPtr += s.length();
- }
- break;
- case 'M':
- bufPtr = print2Number(buf,bufPtr,getMonth());
- break;
- case 'D':
- bufPtr = print2Number(buf,bufPtr,getDay());
- break;
- case 'h':
- bufPtr = print2Number(buf,bufPtr,getHour());
- break;
- case 'm':
- bufPtr = print2Number(buf,bufPtr,getMinute());
- break;
- case 's':
- bufPtr = print2Number(buf,bufPtr,getSecond());
- if (getFractionalSecond() != null) {
- // Note: toPlainString() isn't available before Java 1.5
- String frac = getFractionalSecond().toString();
-
- int pos = frac.indexOf("E-");
- if (pos >= 0) {
- String zeros = frac.substring(pos+2);
- frac = frac.substring(0,pos);
- pos = frac.indexOf(".");
- if (pos >= 0) {
- frac = frac.substring(0,pos) + frac.substring(pos+1);
- }
- int count = Integer.parseInt(zeros);
- if (count < 40) {
- frac = "00000000000000000000000000000000000000000".substring(0,count-1) + frac;
- } else {
- // do it the hard way
- while (count > 1) {
- frac = "0" + frac;
- count--;
- }
- }
- frac = "0." + frac;
- }
-
- // reallocate the buffer now so that it has enough space
- char[] n = new char[buf.length+frac.length()];
- System.arraycopy(buf,0,n,0,bufPtr);
- buf = n;
- //skip leading zero.
- frac.getChars(1, frac.length(), buf, bufPtr);
- bufPtr += frac.length()-1;
- }
- break;
- case 'z':
- int offset = getTimezone();
- if (offset == 0) {
- buf[bufPtr++] = 'Z';
- } else
- if (offset != DatatypeConstants.FIELD_UNDEFINED) {
- if (offset < 0) {
- buf[bufPtr++] = '-';
- offset *= -1;
- } else {
- buf[bufPtr++] = '+';
- }
- bufPtr = print2Number(buf, bufPtr, offset / 60);
- buf[bufPtr++] = ':';
- bufPtr = print2Number(buf, bufPtr, offset % 60);
- }
- break;
- default:
- throw new InternalError(); // impossible
- }
- }
-
- return new String(buf,0,bufPtr);
- }
-
- /**
- * Prints an int as two digits into the buffer.
- *
- * @param number
- * Number to be printed. Must be positive.
- */
- private int print2Number( char[] out, int bufptr, int number ) {
- out[bufptr++] = (char) ('0'+(number/10));
- out[bufptr++] = (char) ('0'+(number%10));
- return bufptr;
- }
-
- /**
- * Prints an int as four digits into the buffer.
- *
- * @param number
- * Number to be printed. Must be positive.
- */
- private int print4Number( char[] out, int bufptr, int number ) {
- out[bufptr+3] = (char) ('0'+(number%10));
- number /= 10;
- out[bufptr+2] = (char) ('0'+(number%10));
- number /= 10;
- out[bufptr+1] = (char) ('0'+(number%10));
- number /= 10;
- out[bufptr ] = (char) ('0'+(number%10));
- return bufptr+4;
- }
-
- /**
- * Compute <code>value*signum</code> where value==null is treated as
- * value==0.
- * @return non-null {@link BigInteger}.
- */
- static BigInteger sanitize(Number value, int signum) {
- if (signum == 0 || value == null) {
- return BigInteger.ZERO;
- }
- return (signum < 0)? ((BigInteger)value).negate() : (BigInteger)value;
- }
-
- /** <p><code>reset()</code> is designed to allow the reuse of existing
- * <code>XMLGregorianCalendar</code>s thus saving resources associated
- * with the creation of new <code>XMLGregorianCalendar</code>s.</p>
- */
- public void reset() {
- //PENDING : Implementation of reset method
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/datatype/javax.xml.datatype.DatatypeFactory b/src/com/sun/org/apache/xerces/internal/jaxp/datatype/javax.xml.datatype.DatatypeFactory
deleted file mode 100644
index 4a5c282..0000000
--- a/src/com/sun/org/apache/xerces/internal/jaxp/datatype/javax.xml.datatype.DatatypeFactory
+++ /dev/null
@@ -1 +0,0 @@
-com.sun.org.apache.xerces.internal.jaxp.datatype.DatatypeFactoryImpl
diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/javax.xml.parsers.DocumentBuilderFactory b/src/com/sun/org/apache/xerces/internal/jaxp/javax.xml.parsers.DocumentBuilderFactory
deleted file mode 100644
index dc39440..0000000
--- a/src/com/sun/org/apache/xerces/internal/jaxp/javax.xml.parsers.DocumentBuilderFactory
+++ /dev/null
@@ -1 +0,0 @@
-com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/javax.xml.parsers.SAXParserFactory b/src/com/sun/org/apache/xerces/internal/jaxp/javax.xml.parsers.SAXParserFactory
deleted file mode 100644
index cd84069..0000000
--- a/src/com/sun/org/apache/xerces/internal/jaxp/javax.xml.parsers.SAXParserFactory
+++ /dev/null
@@ -1 +0,0 @@
-com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/validation/AbstractXMLSchema.java b/src/com/sun/org/apache/xerces/internal/jaxp/validation/AbstractXMLSchema.java
deleted file mode 100644
index 25e13a7..0000000
--- a/src/com/sun/org/apache/xerces/internal/jaxp/validation/AbstractXMLSchema.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.jaxp.validation;
-
-import java.util.HashMap;
-
-import javax.xml.validation.Schema;
-import javax.xml.validation.Validator;
-import javax.xml.validation.ValidatorHandler;
-
-/**
- * <p>Abstract implementation of Schema for W3C XML Schemas.</p>
- *
- * @author Michael Glavassevich, IBM
- * @version $Id: AbstractXMLSchema.java,v 1.6 2010-11-01 04:40:07 joehw Exp $
- */
-abstract class AbstractXMLSchema extends Schema implements
- XSGrammarPoolContainer {
-
- /**
- * Map containing the initial values of features for
- * validators created using this grammar pool container.
- */
- private final HashMap fFeatures;
-
- /**
- * Map containing the initial values of properties for
- * validators created using this grammar pool container.
- */
- private final HashMap fProperties;
-
- public AbstractXMLSchema() {
- fFeatures = new HashMap();
- fProperties = new HashMap();
- }
-
- /*
- * Schema methods
- */
-
- /*
- * @see javax.xml.validation.Schema#newValidator()
- */
- public final Validator newValidator() {
- return new ValidatorImpl(this);
- }
-
- /*
- * @see javax.xml.validation.Schema#newValidatorHandler()
- */
- public final ValidatorHandler newValidatorHandler() {
- return new ValidatorHandlerImpl(this);
- }
-
- /*
- * XSGrammarPoolContainer methods
- */
-
- /**
- * Returns the initial value of a feature for validators created
- * using this grammar pool container or null if the validators
- * should use the default value.
- */
- public final Boolean getFeature(String featureId) {
- return (Boolean) fFeatures.get(featureId);
- }
-
- /*
- * Set a feature on the schema
- */
- public final void setFeature(String featureId, boolean state) {
- fFeatures.put(featureId, state ? Boolean.TRUE : Boolean.FALSE);
- }
-
- /**
- * Returns the initial value of a property for validators created
- * using this grammar pool container or null if the validators
- * should use the default value.
- */
- public final Object getProperty(String propertyId) {
- return fProperties.get(propertyId);
- }
-
- /*
- * Set a property on the schema
- */
- public final void setProperty(String propertyId, Object state) {
- fProperties.put(propertyId, state);
- }
-
-} // AbstractXMLSchema
diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/validation/DOMDocumentHandler.java b/src/com/sun/org/apache/xerces/internal/jaxp/validation/DOMDocumentHandler.java
deleted file mode 100644
index 9f514a9..0000000
--- a/src/com/sun/org/apache/xerces/internal/jaxp/validation/DOMDocumentHandler.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.jaxp.validation;
-
-import javax.xml.transform.dom.DOMResult;
-
-import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-
-import org.w3c.dom.CDATASection;
-import org.w3c.dom.Comment;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.ProcessingInstruction;
-import org.w3c.dom.Text;
-
-/**
- * <p>An extension to XMLDocumentHandler for building DOM structures.</p>
- *
- * @author Michael Glavassevich, IBM
- */
-interface DOMDocumentHandler extends XMLDocumentHandler {
-
- /**
- * <p>Sets the <code>DOMResult</code> object which
- * receives the constructed DOM nodes.</p>
- *
- * @param result the object which receives the constructed DOM nodes
- */
- public void setDOMResult(DOMResult result);
-
- /**
- * A document type declaration.
- *
- * @param node a DocumentType node
- *
- * @exception XNIException Thrown by handler to signal an error.
- */
- public void doctypeDecl(DocumentType node) throws XNIException;
-
- public void characters(Text node) throws XNIException;
-
- public void cdata(CDATASection node) throws XNIException;
-
- /**
- * A comment.
- *
- * @param node a Comment node
- *
- * @exception XNIException Thrown by application to signal an error.
- */
- public void comment(Comment node) throws XNIException;
-
- /**
- * A processing instruction. Processing instructions consist of a
- * target name and, optionally, text data. The data is only meaningful
- * to the application.
- * <p>
- * Typically, a processing instruction's data will contain a series
- * of pseudo-attributes. These pseudo-attributes follow the form of
- * element attributes but are <strong>not</strong> parsed or presented
- * to the application as anything other than text. The application is
- * responsible for parsing the data.
- *
- * @param node a ProcessingInstruction node
- *
- * @exception XNIException Thrown by handler to signal an error.
- */
- public void processingInstruction(ProcessingInstruction node) throws XNIException;
-
- public void setIgnoringCharacters(boolean ignore);
-}
diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/validation/DOMResultAugmentor.java b/src/com/sun/org/apache/xerces/internal/jaxp/validation/DOMResultAugmentor.java
deleted file mode 100644
index 06d75eb..0000000
--- a/src/com/sun/org/apache/xerces/internal/jaxp/validation/DOMResultAugmentor.java
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.jaxp.validation;
-
-import javax.xml.transform.dom.DOMResult;
-
-import com.sun.org.apache.xerces.internal.dom.AttrImpl;
-import com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl;
-import com.sun.org.apache.xerces.internal.dom.ElementImpl;
-import com.sun.org.apache.xerces.internal.dom.ElementNSImpl;
-import com.sun.org.apache.xerces.internal.dom.PSVIAttrNSImpl;
-import com.sun.org.apache.xerces.internal.dom.PSVIDocumentImpl;
-import com.sun.org.apache.xerces.internal.dom.PSVIElementNSImpl;
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType;
-import com.sun.org.apache.xerces.internal.xni.Augmentations;
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
-import com.sun.org.apache.xerces.internal.xni.XMLLocator;
-import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
-import com.sun.org.apache.xerces.internal.xni.XMLString;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource;
-import com.sun.org.apache.xerces.internal.xs.AttributePSVI;
-import com.sun.org.apache.xerces.internal.xs.ElementPSVI;
-import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
-import org.w3c.dom.CDATASection;
-import org.w3c.dom.Comment;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.ProcessingInstruction;
-import org.w3c.dom.Text;
-
-/**
- * <p>DOM result augmentor.</p>
- *
- * @author Michael Glavassevich, IBM
- */
-final class DOMResultAugmentor implements DOMDocumentHandler {
-
- //
- // Data
- //
-
- private DOMValidatorHelper fDOMValidatorHelper;
-
- private Document fDocument;
- private CoreDocumentImpl fDocumentImpl;
- private boolean fStorePSVI;
-
- private boolean fIgnoreChars;
-
- private final QName fAttributeQName = new QName();
-
- public DOMResultAugmentor(DOMValidatorHelper helper) {
- fDOMValidatorHelper = helper;
- }
-
- public void setDOMResult(DOMResult result) {
- fIgnoreChars = false;
- if (result != null) {
- final Node target = result.getNode();
- fDocument = (target.getNodeType() == Node.DOCUMENT_NODE) ? (Document) target : target.getOwnerDocument();
- fDocumentImpl = (fDocument instanceof CoreDocumentImpl) ? (CoreDocumentImpl) fDocument : null;
- fStorePSVI = (fDocument instanceof PSVIDocumentImpl);
- return;
- }
- fDocument = null;
- fDocumentImpl = null;
- fStorePSVI = false;
- }
-
- public void doctypeDecl(DocumentType node) throws XNIException {}
-
- public void characters(Text node) throws XNIException {}
-
- public void cdata(CDATASection node) throws XNIException {}
-
- public void comment(Comment node) throws XNIException {}
-
- public void processingInstruction(ProcessingInstruction node)
- throws XNIException {}
-
- public void setIgnoringCharacters(boolean ignore) {
- fIgnoreChars = ignore;
- }
-
- public void startDocument(XMLLocator locator, String encoding,
- NamespaceContext namespaceContext, Augmentations augs)
- throws XNIException {}
-
- public void xmlDecl(String version, String encoding, String standalone,
- Augmentations augs) throws XNIException {}
-
- public void doctypeDecl(String rootElement, String publicId,
- String systemId, Augmentations augs) throws XNIException {}
-
- public void comment(XMLString text, Augmentations augs) throws XNIException {}
-
- public void processingInstruction(String target, XMLString data,
- Augmentations augs) throws XNIException {}
-
- public void startElement(QName element, XMLAttributes attributes,
- Augmentations augs) throws XNIException {
- final Element currentElement = (Element) fDOMValidatorHelper.getCurrentElement();
- final NamedNodeMap attrMap = currentElement.getAttributes();
-
- final int oldLength = attrMap.getLength();
- // If it's a Xerces DOM store type information for attributes, set idness, etc..
- if (fDocumentImpl != null) {
- AttrImpl attr;
- for (int i = 0; i < oldLength; ++i) {
- attr = (AttrImpl) attrMap.item(i);
-
- // write type information to this attribute
- AttributePSVI attrPSVI = (AttributePSVI) attributes.getAugmentations(i).getItem (Constants.ATTRIBUTE_PSVI);
- if (attrPSVI != null) {
- if (processAttributePSVI(attr, attrPSVI)) {
- ((ElementImpl) currentElement).setIdAttributeNode (attr, true);
- }
- }
- }
- }
-
- final int newLength = attributes.getLength();
- // Add default/fixed attributes
- if (newLength > oldLength) {
- if (fDocumentImpl == null) {
- for (int i = oldLength; i < newLength; ++i) {
- attributes.getName(i, fAttributeQName);
- currentElement.setAttributeNS(fAttributeQName.uri, fAttributeQName.rawname, attributes.getValue(i));
- }
- }
- // If it's a Xerces DOM store type information for attributes, set idness, etc..
- else {
- for (int i = oldLength; i < newLength; ++i) {
- attributes.getName(i, fAttributeQName);
- AttrImpl attr = (AttrImpl) fDocumentImpl.createAttributeNS(fAttributeQName.uri,
- fAttributeQName.rawname, fAttributeQName.localpart);
- attr.setValue(attributes.getValue(i));
-
- // write type information to this attribute
- AttributePSVI attrPSVI = (AttributePSVI) attributes.getAugmentations(i).getItem (Constants.ATTRIBUTE_PSVI);
- if (attrPSVI != null) {
- if (processAttributePSVI(attr, attrPSVI)) {
- ((ElementImpl) currentElement).setIdAttributeNode (attr, true);
- }
- }
- attr.setSpecified(false);
- currentElement.setAttributeNode(attr);
- }
- }
- }
- }
-
- public void emptyElement(QName element, XMLAttributes attributes,
- Augmentations augs) throws XNIException {
- startElement(element, attributes, augs);
- endElement(element, augs);
- }
-
- public void startGeneralEntity(String name,
- XMLResourceIdentifier identifier, String encoding,
- Augmentations augs) throws XNIException {}
-
- public void textDecl(String version, String encoding, Augmentations augs)
- throws XNIException {}
-
- public void endGeneralEntity(String name, Augmentations augs)
- throws XNIException {}
-
- public void characters(XMLString text, Augmentations augs)
- throws XNIException {
- if (!fIgnoreChars) {
- final Element currentElement = (Element) fDOMValidatorHelper.getCurrentElement();
- currentElement.appendChild(fDocument.createTextNode(text.toString()));
- }
- }
-
- public void ignorableWhitespace(XMLString text, Augmentations augs)
- throws XNIException {
- characters(text, augs);
- }
-
- public void endElement(QName element, Augmentations augs)
- throws XNIException {
- final Node currentElement = fDOMValidatorHelper.getCurrentElement();
- // Write type information to this element
- if (augs != null && fDocumentImpl != null) {
- ElementPSVI elementPSVI = (ElementPSVI)augs.getItem(Constants.ELEMENT_PSVI);
- if (elementPSVI != null) {
- if (fStorePSVI) {
- ((PSVIElementNSImpl) currentElement).setPSVI(elementPSVI);
- }
- XSTypeDefinition type = elementPSVI.getMemberTypeDefinition();
- if (type == null) {
- type = elementPSVI.getTypeDefinition();
- }
- ((ElementNSImpl) currentElement).setType(type);
- }
- }
- }
-
- public void startCDATA(Augmentations augs) throws XNIException {}
-
- public void endCDATA(Augmentations augs) throws XNIException {}
-
- public void endDocument(Augmentations augs) throws XNIException {}
-
- public void setDocumentSource(XMLDocumentSource source) {}
-
- public XMLDocumentSource getDocumentSource() {
- return null;
- }
-
- /** Returns whether the given attribute is an ID type. **/
- private boolean processAttributePSVI(AttrImpl attr, AttributePSVI attrPSVI) {
- if (fStorePSVI) {
- ((PSVIAttrNSImpl) attr).setPSVI (attrPSVI);
- }
- Object type = attrPSVI.getMemberTypeDefinition ();
- if (type == null) {
- type = attrPSVI.getTypeDefinition ();
- if (type != null) {
- attr.setType(type);
- return ((XSSimpleType) type).isIDType();
- }
- }
- else {
- attr.setType(type);
- return ((XSSimpleType) type).isIDType();
- }
- return false;
- }
-
-} // DOMResultAugmentor
diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/validation/DOMResultBuilder.java b/src/com/sun/org/apache/xerces/internal/jaxp/validation/DOMResultBuilder.java
deleted file mode 100644
index f78f1f4..0000000
--- a/src/com/sun/org/apache/xerces/internal/jaxp/validation/DOMResultBuilder.java
+++ /dev/null
@@ -1,373 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.jaxp.validation;
-
-import java.util.ArrayList;
-
-import javax.xml.transform.dom.DOMResult;
-
-import com.sun.org.apache.xerces.internal.dom.AttrImpl;
-import com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl;
-import com.sun.org.apache.xerces.internal.dom.DOMMessageFormatter;
-import com.sun.org.apache.xerces.internal.dom.DocumentTypeImpl;
-import com.sun.org.apache.xerces.internal.dom.ElementImpl;
-import com.sun.org.apache.xerces.internal.dom.ElementNSImpl;
-import com.sun.org.apache.xerces.internal.dom.EntityImpl;
-import com.sun.org.apache.xerces.internal.dom.NotationImpl;
-import com.sun.org.apache.xerces.internal.dom.PSVIAttrNSImpl;
-import com.sun.org.apache.xerces.internal.dom.PSVIDocumentImpl;
-import com.sun.org.apache.xerces.internal.dom.PSVIElementNSImpl;
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType;
-import com.sun.org.apache.xerces.internal.xni.Augmentations;
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
-import com.sun.org.apache.xerces.internal.xni.XMLLocator;
-import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
-import com.sun.org.apache.xerces.internal.xni.XMLString;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource;
-import com.sun.org.apache.xerces.internal.xs.AttributePSVI;
-import com.sun.org.apache.xerces.internal.xs.ElementPSVI;
-import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
-
-import org.w3c.dom.CDATASection;
-import org.w3c.dom.Comment;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.Entity;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.Notation;
-import org.w3c.dom.ProcessingInstruction;
-import org.w3c.dom.Text;
-
-
-/**
- * <p>DOM result builder.</p>
- *
- * @author Michael Glavassevich, IBM
- */
-final class DOMResultBuilder implements DOMDocumentHandler {
-
- /** Table for quick check of child insertion. */
- private final static int[] kidOK;
-
- static {
- kidOK = new int[13];
- kidOK[Node.DOCUMENT_NODE] =
- 1 << Node.ELEMENT_NODE | 1 << Node.PROCESSING_INSTRUCTION_NODE |
- 1 << Node.COMMENT_NODE | 1 << Node.DOCUMENT_TYPE_NODE;
- kidOK[Node.DOCUMENT_FRAGMENT_NODE] =
- kidOK[Node.ENTITY_NODE] =
- kidOK[Node.ENTITY_REFERENCE_NODE] =
- kidOK[Node.ELEMENT_NODE] =
- 1 << Node.ELEMENT_NODE | 1 << Node.PROCESSING_INSTRUCTION_NODE |
- 1 << Node.COMMENT_NODE | 1 << Node.TEXT_NODE |
- 1 << Node.CDATA_SECTION_NODE | 1 << Node.ENTITY_REFERENCE_NODE ;
- kidOK[Node.ATTRIBUTE_NODE] = 1 << Node.TEXT_NODE | 1 << Node.ENTITY_REFERENCE_NODE;
- kidOK[Node.DOCUMENT_TYPE_NODE] = 0;
- kidOK[Node.PROCESSING_INSTRUCTION_NODE] = 0;
- kidOK[Node.COMMENT_NODE] = 0;
- kidOK[Node.TEXT_NODE] = 0;
- kidOK[Node.CDATA_SECTION_NODE] = 0;
- kidOK[Node.NOTATION_NODE] = 0;
- } // static
-
- //
- // Data
- //
-
- private Document fDocument;
- private CoreDocumentImpl fDocumentImpl;
- private boolean fStorePSVI;
-
- private Node fTarget;
- private Node fNextSibling;
-
- private Node fCurrentNode;
- private Node fFragmentRoot;
-
- private final ArrayList fTargetChildren = new ArrayList();
-
- private boolean fIgnoreChars;
-
- private final QName fAttributeQName = new QName();
-
- public DOMResultBuilder() {}
-
- /*
- * DOMDocumentHandler methods
- */
-
- public void setDOMResult(DOMResult result) {
- fCurrentNode = null;
- fFragmentRoot = null;
- fIgnoreChars = false;
- fTargetChildren.clear();
- if (result != null) {
- fTarget = result.getNode();
- fNextSibling = result.getNextSibling();
- fDocument = (fTarget.getNodeType() == Node.DOCUMENT_NODE) ? (Document) fTarget : fTarget.getOwnerDocument();
- fDocumentImpl = (fDocument instanceof CoreDocumentImpl) ? (CoreDocumentImpl) fDocument : null;
- fStorePSVI = (fDocument instanceof PSVIDocumentImpl);
- return;
- }
- fTarget = null;
- fNextSibling = null;
- fDocument = null;
- fDocumentImpl = null;
- fStorePSVI = false;
- }
-
- public void doctypeDecl(DocumentType node) throws XNIException {
- /** Create new DocumentType node for the target. */
- if (fDocumentImpl != null) {
- DocumentType docType = fDocumentImpl.createDocumentType(node.getName(), node.getPublicId(), node.getSystemId());
- final String internalSubset = node.getInternalSubset();
- /** Copy internal subset. */
- if (internalSubset != null) {
- ((DocumentTypeImpl) docType).setInternalSubset(internalSubset);
- }
- /** Copy entities. */
- NamedNodeMap oldMap = node.getEntities();
- NamedNodeMap newMap = docType.getEntities();
- int length = oldMap.getLength();
- for (int i = 0; i < length; ++i) {
- Entity oldEntity = (Entity) oldMap.item(i);
- EntityImpl newEntity = (EntityImpl) fDocumentImpl.createEntity(oldEntity.getNodeName());
- newEntity.setPublicId(oldEntity.getPublicId());
- newEntity.setSystemId(oldEntity.getSystemId());
- newEntity.setNotationName(oldEntity.getNotationName());
- newMap.setNamedItem(newEntity);
- }
- /** Copy notations. */
- oldMap = node.getNotations();
- newMap = docType.getNotations();
- length = oldMap.getLength();
- for (int i = 0; i < length; ++i) {
- Notation oldNotation = (Notation) oldMap.item(i);
- NotationImpl newNotation = (NotationImpl) fDocumentImpl.createNotation(oldNotation.getNodeName());
- newNotation.setPublicId(oldNotation.getPublicId());
- newNotation.setSystemId(oldNotation.getSystemId());
- newMap.setNamedItem(newNotation);
- }
- append(docType);
- }
- }
-
- public void characters(Text node) throws XNIException {
- /** Create new Text node for the target. */
- append(fDocument.createTextNode(node.getNodeValue()));
- }
-
- public void cdata(CDATASection node) throws XNIException {
- /** Create new CDATASection node for the target. */
- append(fDocument.createCDATASection(node.getNodeValue()));
- }
-
- public void comment(Comment node) throws XNIException {
- /** Create new Comment node for the target. */
- append(fDocument.createComment(node.getNodeValue()));
- }
-
- public void processingInstruction(ProcessingInstruction node)
- throws XNIException {
- /** Create new ProcessingInstruction node for the target. */
- append(fDocument.createProcessingInstruction(node.getTarget(), node.getData()));
- }
-
- public void setIgnoringCharacters(boolean ignore) {
- fIgnoreChars = ignore;
- }
-
- /*
- * XMLDocumentHandler methods
- */
-
- public void startDocument(XMLLocator locator, String encoding,
- NamespaceContext namespaceContext, Augmentations augs)
- throws XNIException {}
-
- public void xmlDecl(String version, String encoding, String standalone,
- Augmentations augs) throws XNIException {}
-
- public void doctypeDecl(String rootElement, String publicId,
- String systemId, Augmentations augs) throws XNIException {}
-
- public void comment(XMLString text, Augmentations augs) throws XNIException {}
-
- public void processingInstruction(String target, XMLString data,
- Augmentations augs) throws XNIException {}
-
- public void startElement(QName element, XMLAttributes attributes,
- Augmentations augs) throws XNIException {
- Element elem;
- int attrCount = attributes.getLength();
- if (fDocumentImpl == null) {
- elem = fDocument.createElementNS(element.uri, element.rawname);
- for (int i = 0; i < attrCount; ++i) {
- attributes.getName(i, fAttributeQName);
- elem.setAttributeNS(fAttributeQName.uri, fAttributeQName.rawname, attributes.getValue(i));
- }
- }
- // If it's a Xerces DOM store type information for attributes, set idness, etc..
- else {
- elem = fDocumentImpl.createElementNS(element.uri, element.rawname, element.localpart);
- for (int i = 0; i < attrCount; ++i) {
- attributes.getName(i, fAttributeQName);
- AttrImpl attr = (AttrImpl) fDocumentImpl.createAttributeNS(fAttributeQName.uri,
- fAttributeQName.rawname, fAttributeQName.localpart);
- attr.setValue(attributes.getValue(i));
-
- // write type information to this attribute
- AttributePSVI attrPSVI = (AttributePSVI) attributes.getAugmentations(i).getItem (Constants.ATTRIBUTE_PSVI);
- if (attrPSVI != null) {
- if (fStorePSVI) {
- ((PSVIAttrNSImpl) attr).setPSVI(attrPSVI);
- }
- Object type = attrPSVI.getMemberTypeDefinition();
- if (type == null) {
- type = attrPSVI.getTypeDefinition();
- if (type != null) {
- attr.setType (type);
- if (((XSSimpleType) type).isIDType()) {
- ((ElementImpl) elem).setIdAttributeNode (attr, true);
- }
- }
- }
- else {
- attr.setType (type);
- if (((XSSimpleType) type).isIDType()) {
- ((ElementImpl) elem).setIdAttributeNode (attr, true);
- }
- }
- }
- attr.setSpecified(attributes.isSpecified(i));
- elem.setAttributeNode(attr);
- }
- }
- append(elem);
- fCurrentNode = elem;
- if (fFragmentRoot == null) {
- fFragmentRoot = elem;
- }
- }
-
- public void emptyElement(QName element, XMLAttributes attributes,
- Augmentations augs) throws XNIException {
- startElement(element, attributes, augs);
- endElement(element, augs);
- }
-
- public void startGeneralEntity(String name,
- XMLResourceIdentifier identifier, String encoding,
- Augmentations augs) throws XNIException {}
-
- public void textDecl(String version, String encoding, Augmentations augs)
- throws XNIException {}
-
- public void endGeneralEntity(String name, Augmentations augs)
- throws XNIException {}
-
- public void characters(XMLString text, Augmentations augs)
- throws XNIException {
- if (!fIgnoreChars) {
- append(fDocument.createTextNode(text.toString()));
- }
- }
-
- public void ignorableWhitespace(XMLString text, Augmentations augs)
- throws XNIException {
- characters(text, augs);
- }
-
- public void endElement(QName element, Augmentations augs)
- throws XNIException {
- // write type information to this element
- if (augs != null && fDocumentImpl != null) {
- ElementPSVI elementPSVI = (ElementPSVI)augs.getItem(Constants.ELEMENT_PSVI);
- if (elementPSVI != null) {
- if (fStorePSVI) {
- ((PSVIElementNSImpl)fCurrentNode).setPSVI(elementPSVI);
- }
- XSTypeDefinition type = elementPSVI.getMemberTypeDefinition();
- if (type == null) {
- type = elementPSVI.getTypeDefinition();
- }
- ((ElementNSImpl)fCurrentNode).setType(type);
- }
- }
-
- // adjust current node reference
- if (fCurrentNode == fFragmentRoot) {
- fCurrentNode = null;
- fFragmentRoot = null;
- return;
- }
- fCurrentNode = fCurrentNode.getParentNode();
- }
-
- public void startCDATA(Augmentations augs) throws XNIException {}
-
- public void endCDATA(Augmentations augs) throws XNIException {}
-
- public void endDocument(Augmentations augs) throws XNIException {
- final int length = fTargetChildren.size();
- if (fNextSibling == null) {
- for (int i = 0; i < length; ++i) {
- fTarget.appendChild((Node) fTargetChildren.get(i));
- }
- }
- else {
- for (int i = 0; i < length; ++i) {
- fTarget.insertBefore((Node) fTargetChildren.get(i), fNextSibling);
- }
- }
- }
-
- public void setDocumentSource(XMLDocumentSource source) {}
-
- public XMLDocumentSource getDocumentSource() {
- return null;
- }
-
- /*
- * Other methods
- */
-
- private void append(Node node) throws XNIException {
- if (fCurrentNode != null) {
- fCurrentNode.appendChild(node);
- }
- else {
- /** Check if this node can be attached to the target. */
- if ((kidOK[fTarget.getNodeType()] & (1 << node.getNodeType())) == 0) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "HIERARCHY_REQUEST_ERR", null);
- throw new XNIException(msg);
- }
- fTargetChildren.add(node);
- }
- }
-
-} // DOMResultBuilder
diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/validation/DOMValidatorHelper.java b/src/com/sun/org/apache/xerces/internal/jaxp/validation/DOMValidatorHelper.java
deleted file mode 100644
index 4c69e70..0000000
--- a/src/com/sun/org/apache/xerces/internal/jaxp/validation/DOMValidatorHelper.java
+++ /dev/null
@@ -1,613 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.jaxp.validation;
-
-import java.io.IOException;
-import java.util.Enumeration;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-import javax.xml.transform.dom.DOMResult;
-import javax.xml.transform.dom.DOMSource;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
-import com.sun.org.apache.xerces.internal.impl.validation.EntityState;
-import com.sun.org.apache.xerces.internal.impl.validation.ValidationManager;
-import com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator;
-import com.sun.org.apache.xerces.internal.impl.xs.util.SimpleLocator;
-import com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl;
-import com.sun.org.apache.xerces.internal.util.NamespaceSupport;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.util.XMLAttributesImpl;
-import com.sun.org.apache.xerces.internal.util.XMLSymbols;
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xni.XMLString;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLParseException;
-import org.w3c.dom.Attr;
-import org.w3c.dom.CDATASection;
-import org.w3c.dom.Comment;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Entity;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.ProcessingInstruction;
-import org.w3c.dom.Text;
-import org.xml.sax.SAXException;
-
-/**
- * <p>A validator helper for <code>DOMSource</code>s.</p>
- *
- * @author Michael Glavassevich, IBM
- * @version $Id: DOMValidatorHelper.java,v 1.9 2010-11-01 04:40:08 joehw Exp $
- */
-final class DOMValidatorHelper implements ValidatorHelper, EntityState {
-
- //
- // Constants
- //
-
- /** Chunk size (1024). */
- private static final int CHUNK_SIZE = (1 << 10);
-
- /** Chunk mask (CHUNK_SIZE - 1). */
- private static final int CHUNK_MASK = CHUNK_SIZE - 1;
-
- // property identifiers
-
- /** Property identifier: error reporter. */
- private static final String ERROR_REPORTER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY;
-
- /** Property identifier: namespace context. */
- private static final String NAMESPACE_CONTEXT =
- Constants.XERCES_PROPERTY_PREFIX + Constants.NAMESPACE_CONTEXT_PROPERTY;
-
- /** Property identifier: XML Schema validator. */
- private static final String SCHEMA_VALIDATOR =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SCHEMA_VALIDATOR_PROPERTY;
-
- /** Property identifier: symbol table. */
- private static final String SYMBOL_TABLE =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY;
-
- /** Property identifier: validation manager. */
- private static final String VALIDATION_MANAGER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.VALIDATION_MANAGER_PROPERTY;
-
- //
- // Data
- //
-
- /** Error reporter. */
- private XMLErrorReporter fErrorReporter;
-
- /** The namespace context of this document: stores namespaces in scope. **/
- private NamespaceSupport fNamespaceContext;
-
- /** The namespace context of the DOMSource, includes context from ancestor nodes. **/
- private DOMNamespaceContext fDOMNamespaceContext = new DOMNamespaceContext();
-
- /** Schema validator. **/
- private XMLSchemaValidator fSchemaValidator;
-
- /** Symbol table **/
- private SymbolTable fSymbolTable;
-
- /** Validation manager. **/
- private ValidationManager fValidationManager;
-
- /** Component manager. **/
- private XMLSchemaValidatorComponentManager fComponentManager;
-
- /** Simple Locator. **/
- private final SimpleLocator fXMLLocator = new SimpleLocator(null, null, -1, -1, -1);
-
- /** DOM document handler. **/
- private DOMDocumentHandler fDOMValidatorHandler;
-
- /** DOM result augmentor. **/
- private final DOMResultAugmentor fDOMResultAugmentor = new DOMResultAugmentor(this);
-
- /** DOM result builder. **/
- private final DOMResultBuilder fDOMResultBuilder = new DOMResultBuilder();
-
- /** Map for tracking unparsed entities. **/
- private NamedNodeMap fEntities = null;
-
- /** Array for holding character data. **/
- private char [] fCharBuffer = new char[CHUNK_SIZE];
-
- /** Root node. **/
- private Node fRoot;
-
- /** Current element. **/
- private Node fCurrentElement;
-
- /** Fields for start element, end element and characters. **/
- final QName fElementQName = new QName();
- final QName fAttributeQName = new QName();
- final XMLAttributesImpl fAttributes = new XMLAttributesImpl();
- final XMLString fTempString = new XMLString();
-
- public DOMValidatorHelper(XMLSchemaValidatorComponentManager componentManager) {
- fComponentManager = componentManager;
- fErrorReporter = (XMLErrorReporter) fComponentManager.getProperty(ERROR_REPORTER);
- fNamespaceContext = (NamespaceSupport) fComponentManager.getProperty(NAMESPACE_CONTEXT);
- fSchemaValidator = (XMLSchemaValidator) fComponentManager.getProperty(SCHEMA_VALIDATOR);
- fSymbolTable = (SymbolTable) fComponentManager.getProperty(SYMBOL_TABLE);
- fValidationManager = (ValidationManager) fComponentManager.getProperty(VALIDATION_MANAGER);
- }
-
- /*
- * ValidatorHelper methods
- */
-
- public void validate(Source source, Result result)
- throws SAXException, IOException {
- if (result instanceof DOMResult || result == null) {
- final DOMSource domSource = (DOMSource) source;
- final DOMResult domResult = (DOMResult) result;
- Node node = domSource.getNode();
- fRoot = node;
- if (node != null) {
- fComponentManager.reset();
- fValidationManager.setEntityState(this);
- fDOMNamespaceContext.reset();
- String systemId = domSource.getSystemId();
- fXMLLocator.setLiteralSystemId(systemId);
- fXMLLocator.setExpandedSystemId(systemId);
- fErrorReporter.setDocumentLocator(fXMLLocator);
- try {
- // regardless of what type of node this is, fire start and end document events
- setupEntityMap((node.getNodeType() == Node.DOCUMENT_NODE) ? (Document) node : node.getOwnerDocument());
- setupDOMResultHandler(domSource, domResult);
- fSchemaValidator.startDocument(fXMLLocator, null, fDOMNamespaceContext, null);
- validate(node);
- fSchemaValidator.endDocument(null);
- }
- catch (XMLParseException e) {
- throw Util.toSAXParseException(e);
- }
- catch (XNIException e) {
- throw Util.toSAXException(e);
- }
- finally {
- // Release references to application objects
- fRoot = null;
- //fCurrentElement = null; -- keep the reference to support current-element-node property
- fEntities = null;
- if (fDOMValidatorHandler != null) {
- fDOMValidatorHandler.setDOMResult(null);
- }
- }
- }
- return;
- }
- throw new IllegalArgumentException(JAXPValidationMessageFormatter.formatMessage(fComponentManager.getLocale(),
- "SourceResultMismatch",
- new Object [] {source.getClass().getName(), result.getClass().getName()}));
- }
-
- /*
- * EntityState methods
- */
-
- public boolean isEntityDeclared(String name) {
- return false;
- }
-
- public boolean isEntityUnparsed(String name) {
- if (fEntities != null) {
- Entity entity = (Entity) fEntities.getNamedItem(name);
- if (entity != null) {
- return (entity.getNotationName() != null);
- }
- }
- return false;
- }
-
- /*
- * Other methods
- */
-
- /** Traverse the DOM and fire events to the schema validator. */
- private void validate(Node node) {
- final Node top = node;
- // Performs a non-recursive traversal of the DOM. This
- // will avoid a stack overflow for DOMs with high depth.
- while (node != null) {
- beginNode(node);
- Node next = node.getFirstChild();
- while (next == null) {
- finishNode(node);
- if (top == node) {
- break;
- }
- next = node.getNextSibling();
- if (next == null) {
- node = node.getParentNode();
- if (node == null || top == node) {
- if (node != null) {
- finishNode(node);
- }
- next = null;
- break;
- }
- }
- }
- node = next;
- }
- }
-
- /** Do processing for the start of a node. */
- private void beginNode(Node node) {
- switch (node.getNodeType()) {
- case Node.ELEMENT_NODE:
- fCurrentElement = node;
- // push namespace context
- fNamespaceContext.pushContext();
- // start element
- fillQName(fElementQName, node);
- processAttributes(node.getAttributes());
- fSchemaValidator.startElement(fElementQName, fAttributes, null);
- break;
- case Node.TEXT_NODE:
- if (fDOMValidatorHandler != null) {
- fDOMValidatorHandler.setIgnoringCharacters(true);
- sendCharactersToValidator(node.getNodeValue());
- fDOMValidatorHandler.setIgnoringCharacters(false);
- fDOMValidatorHandler.characters((Text) node);
- }
- else {
- sendCharactersToValidator(node.getNodeValue());
- }
- break;
- case Node.CDATA_SECTION_NODE:
- if (fDOMValidatorHandler != null) {
- fDOMValidatorHandler.setIgnoringCharacters(true);
- fSchemaValidator.startCDATA(null);
- sendCharactersToValidator(node.getNodeValue());
- fSchemaValidator.endCDATA(null);
- fDOMValidatorHandler.setIgnoringCharacters(false);
- fDOMValidatorHandler.cdata((CDATASection) node);
- }
- else {
- fSchemaValidator.startCDATA(null);
- sendCharactersToValidator(node.getNodeValue());
- fSchemaValidator.endCDATA(null);
- }
- break;
- case Node.PROCESSING_INSTRUCTION_NODE:
- /**
- * The validator does nothing with processing instructions so bypass it.
- * Send the ProcessingInstruction node directly to the result builder.
- */
- if (fDOMValidatorHandler != null) {
- fDOMValidatorHandler.processingInstruction((ProcessingInstruction) node);
- }
- break;
- case Node.COMMENT_NODE:
- /**
- * The validator does nothing with comments so bypass it.
- * Send the Comment node directly to the result builder.
- */
- if (fDOMValidatorHandler != null) {
- fDOMValidatorHandler.comment((Comment) node);
- }
- break;
- case Node.DOCUMENT_TYPE_NODE:
- /**
- * Send the DocumentType node directly to the result builder.
- */
- if (fDOMValidatorHandler != null) {
- fDOMValidatorHandler.doctypeDecl((DocumentType) node);
- }
- break;
- default: // Ignore other node types.
- break;
- }
- }
-
- /** Do processing for the end of a node. */
- private void finishNode(Node node) {
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- fCurrentElement = node;
- // end element
- fillQName(fElementQName, node);
- fSchemaValidator.endElement(fElementQName, null);
- // pop namespace context
- fNamespaceContext.popContext();
- }
- }
-
- /**
- * Extracts NamedNodeMap of entities. We need this to validate
- * elements and attributes of type xs:ENTITY, xs:ENTITIES or
- * types dervied from them.
- */
- private void setupEntityMap(Document doc) {
- if (doc != null) {
- DocumentType docType = doc.getDoctype();
- if (docType != null) {
- fEntities = docType.getEntities();
- return;
- }
- }
- fEntities = null;
- }
-
- /**
- * Sets up handler for <code>DOMResult</code>.
- */
- private void setupDOMResultHandler(DOMSource source, DOMResult result) throws SAXException {
- // If there's no DOMResult, unset the validator handler
- if (result == null) {
- fDOMValidatorHandler = null;
- fSchemaValidator.setDocumentHandler(null);
- return;
- }
- final Node nodeResult = result.getNode();
- // If the source node and result node are the same use the DOMResultAugmentor.
- // Otherwise use the DOMResultBuilder.
- if (source.getNode() == nodeResult) {
- fDOMValidatorHandler = fDOMResultAugmentor;
- fDOMResultAugmentor.setDOMResult(result);
- fSchemaValidator.setDocumentHandler(fDOMResultAugmentor);
- return;
- }
- if (result.getNode() == null) {
- try {
- DocumentBuilderFactory factory = fComponentManager.getFeature(Constants.ORACLE_FEATURE_SERVICE_MECHANISM) ?
- DocumentBuilderFactory.newInstance() : new DocumentBuilderFactoryImpl();
- factory.setNamespaceAware(true);
- DocumentBuilder builder = factory.newDocumentBuilder();
- result.setNode(builder.newDocument());
- }
- catch (ParserConfigurationException e) {
- throw new SAXException(e);
- }
- }
- fDOMValidatorHandler = fDOMResultBuilder;
- fDOMResultBuilder.setDOMResult(result);
- fSchemaValidator.setDocumentHandler(fDOMResultBuilder);
- }
-
- private void fillQName(QName toFill, Node node) {
- final String prefix = node.getPrefix();
- final String localName = node.getLocalName();
- final String rawName = node.getNodeName();
- final String namespace = node.getNamespaceURI();
-
- toFill.uri = (namespace != null && namespace.length() > 0) ? fSymbolTable.addSymbol(namespace) : null;
- toFill.rawname = (rawName != null) ? fSymbolTable.addSymbol(rawName) : XMLSymbols.EMPTY_STRING;
-
- // Is this a DOM level1 document?
- if (localName == null) {
- int k = rawName.indexOf(':');
- if (k > 0) {
- toFill.prefix = fSymbolTable.addSymbol(rawName.substring(0, k));
- toFill.localpart = fSymbolTable.addSymbol(rawName.substring(k + 1));
- }
- else {
- toFill.prefix = XMLSymbols.EMPTY_STRING;
- toFill.localpart = toFill.rawname;
- }
- }
- else {
- toFill.prefix = (prefix != null) ? fSymbolTable.addSymbol(prefix) : XMLSymbols.EMPTY_STRING;
- toFill.localpart = (localName != null) ? fSymbolTable.addSymbol(localName) : XMLSymbols.EMPTY_STRING;
- }
- }
-
- private void processAttributes(NamedNodeMap attrMap) {
- final int attrCount = attrMap.getLength();
- fAttributes.removeAllAttributes();
- for (int i = 0; i < attrCount; ++i) {
- Attr attr = (Attr) attrMap.item(i);
- String value = attr.getValue();
- if (value == null) {
- value = XMLSymbols.EMPTY_STRING;
- }
- fillQName(fAttributeQName, attr);
- // REVISIT: Assuming all attributes are of type CDATA. The actual type may not matter. -- mrglavas
- fAttributes.addAttributeNS(fAttributeQName, XMLSymbols.fCDATASymbol, value);
- fAttributes.setSpecified(i, attr.getSpecified());
- // REVISIT: Should we be looking at non-namespace attributes
- // for additional mappings? Should we detect illegal namespace
- // declarations and exclude them from the context? -- mrglavas
- if (fAttributeQName.uri == NamespaceContext.XMLNS_URI) {
- // process namespace attribute
- if (fAttributeQName.prefix == XMLSymbols.PREFIX_XMLNS) {
- fNamespaceContext.declarePrefix(fAttributeQName.localpart, value.length() != 0 ? fSymbolTable.addSymbol(value) : null);
- }
- else {
- fNamespaceContext.declarePrefix(XMLSymbols.EMPTY_STRING, value.length() != 0 ? fSymbolTable.addSymbol(value) : null);
- }
- }
- }
- }
-
- private void sendCharactersToValidator(String str) {
- if (str != null) {
- final int length = str.length();
- final int remainder = length & CHUNK_MASK;
- if (remainder > 0) {
- str.getChars(0, remainder, fCharBuffer, 0);
- fTempString.setValues(fCharBuffer, 0, remainder);
- fSchemaValidator.characters(fTempString, null);
- }
- int i = remainder;
- while (i < length) {
- str.getChars(i, i += CHUNK_SIZE, fCharBuffer, 0);
- fTempString.setValues(fCharBuffer, 0, CHUNK_SIZE);
- fSchemaValidator.characters(fTempString, null);
- }
- }
- }
-
- Node getCurrentElement() {
- return fCurrentElement;
- }
-
- /**
- * NamespaceContext for the DOMSource, includes context for ancestor nodes.
- */
- final class DOMNamespaceContext implements NamespaceContext {
-
- //
- // Data
- //
-
- /**
- * Namespace binding information. This array is composed of a
- * series of tuples containing the namespace binding information:
- * &lt;prefix, uri&gt;.
- */
- protected String[] fNamespace = new String[16 * 2];
-
- /** The size of the namespace information array. */
- protected int fNamespaceSize = 0;
-
- /**
- * Flag indicating whether the namespace context
- * has been from the root node's ancestors.
- */
- protected boolean fDOMContextBuilt = false;
-
- //
- // Methods
- //
-
- public void pushContext() {
- fNamespaceContext.pushContext();
- }
-
- public void popContext() {
- fNamespaceContext.popContext();
- }
-
- public boolean declarePrefix(String prefix, String uri) {
- return fNamespaceContext.declarePrefix(prefix, uri);
- }
-
- public String getURI(String prefix) {
- String uri = fNamespaceContext.getURI(prefix);
- if (uri == null) {
- if (!fDOMContextBuilt) {
- fillNamespaceContext();
- fDOMContextBuilt = true;
- }
- if (fNamespaceSize > 0 &&
- !fNamespaceContext.containsPrefix(prefix)) {
- uri = getURI0(prefix);
- }
- }
- return uri;
- }
-
- public String getPrefix(String uri) {
- return fNamespaceContext.getPrefix(uri);
- }
-
- public int getDeclaredPrefixCount() {
- return fNamespaceContext.getDeclaredPrefixCount();
- }
-
- public String getDeclaredPrefixAt(int index) {
- return fNamespaceContext.getDeclaredPrefixAt(index);
- }
-
- public Enumeration getAllPrefixes() {
- return fNamespaceContext.getAllPrefixes();
- }
-
- public void reset() {
- fDOMContextBuilt = false;
- fNamespaceSize = 0;
- }
-
- private void fillNamespaceContext() {
- if (fRoot != null) {
- Node currentNode = fRoot.getParentNode();
- while (currentNode != null) {
- if (Node.ELEMENT_NODE == currentNode.getNodeType()) {
- NamedNodeMap attributes = currentNode.getAttributes();
- final int attrCount = attributes.getLength();
- for (int i = 0; i < attrCount; ++i) {
- Attr attr = (Attr) attributes.item(i);
- String value = attr.getValue();
- if (value == null) {
- value = XMLSymbols.EMPTY_STRING;
- }
- fillQName(fAttributeQName, attr);
- // REVISIT: Should we be looking at non-namespace attributes
- // for additional mappings? Should we detect illegal namespace
- // declarations and exclude them from the context? -- mrglavas
- if (fAttributeQName.uri == NamespaceContext.XMLNS_URI) {
- // process namespace attribute
- if (fAttributeQName.prefix == XMLSymbols.PREFIX_XMLNS) {
- declarePrefix0(fAttributeQName.localpart, value.length() != 0 ? fSymbolTable.addSymbol(value) : null);
- }
- else {
- declarePrefix0(XMLSymbols.EMPTY_STRING, value.length() != 0 ? fSymbolTable.addSymbol(value) : null);
- }
- }
- }
-
- }
- currentNode = currentNode.getParentNode();
- }
- }
- }
-
- private void declarePrefix0(String prefix, String uri) {
- // resize array, if needed
- if (fNamespaceSize == fNamespace.length) {
- String[] namespacearray = new String[fNamespaceSize * 2];
- System.arraycopy(fNamespace, 0, namespacearray, 0, fNamespaceSize);
- fNamespace = namespacearray;
- }
-
- // bind prefix to uri in current context
- fNamespace[fNamespaceSize++] = prefix;
- fNamespace[fNamespaceSize++] = uri;
- }
-
- private String getURI0(String prefix) {
- // find prefix in the DOM context
- for (int i = 0; i < fNamespaceSize; i += 2) {
- if (fNamespace[i] == prefix) {
- return fNamespace[i + 1];
- }
- }
- // prefix not found
- return null;
- }
- }
-
-} // DOMValidatorHelper
diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/validation/DraconianErrorHandler.java b/src/com/sun/org/apache/xerces/internal/jaxp/validation/DraconianErrorHandler.java
deleted file mode 100644
index 171a4b5..0000000
--- a/src/com/sun/org/apache/xerces/internal/jaxp/validation/DraconianErrorHandler.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.jaxp.validation;
-
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-/**
- * {@link ErrorHandler} that throws all errors and fatal errors.
- *
- * @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
- */
-final class DraconianErrorHandler implements ErrorHandler {
-
- /**
- * Singleton instance.
- */
- private static final DraconianErrorHandler ERROR_HANDLER_INSTANCE
- = new DraconianErrorHandler();
-
- private DraconianErrorHandler() {}
-
- /** Returns the one and only instance of this error handler. */
- public static DraconianErrorHandler getInstance() {
- return ERROR_HANDLER_INSTANCE;
- }
-
- /** Warning: Ignore. */
- public void warning(SAXParseException e) throws SAXException {
- // noop
- }
-
- /** Error: Throws back SAXParseException. */
- public void error(SAXParseException e) throws SAXException {
- throw e;
- }
-
- /** Fatal Error: Throws back SAXParseException. */
- public void fatalError(SAXParseException e) throws SAXException {
- throw e;
- }
-
-} // DraconianErrorHandler
diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/validation/EmptyXMLSchema.java b/src/com/sun/org/apache/xerces/internal/jaxp/validation/EmptyXMLSchema.java
deleted file mode 100644
index eca00e8..0000000
--- a/src/com/sun/org/apache/xerces/internal/jaxp/validation/EmptyXMLSchema.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.jaxp.validation;
-
-import com.sun.org.apache.xerces.internal.xni.grammars.Grammar;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
-
-/**
- * <p>Implementation of Schema for W3C XML Schemas
- * which contains no schema components.</p>
- *
- * @author Michael Glavassevich, IBM
- * @version $Id: EmptyXMLSchema.java,v 1.6 2010-11-01 04:40:08 joehw Exp $
- */
-final class EmptyXMLSchema extends AbstractXMLSchema implements XMLGrammarPool {
-
- /** Zero length grammar array. */
- private static final Grammar [] ZERO_LENGTH_GRAMMAR_ARRAY = new Grammar [0];
-
- public EmptyXMLSchema() {}
-
- /*
- * XMLGrammarPool methods
- */
-
- public Grammar[] retrieveInitialGrammarSet(String grammarType) {
- return ZERO_LENGTH_GRAMMAR_ARRAY;
- }
-
- public void cacheGrammars(String grammarType, Grammar[] grammars) {}
-
- public Grammar retrieveGrammar(XMLGrammarDescription desc) {
- return null;
- }
-
- public void lockPool() {}
-
- public void unlockPool() {}
-
- public void clear() {}
-
- /*
- * XSGrammarPoolContainer methods
- */
-
- public XMLGrammarPool getGrammarPool() {
- return this;
- }
-
- public boolean isFullyComposed() {
- return true;
- }
-
-} // EmptyXMLSchema
diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/validation/ErrorHandlerAdaptor.java b/src/com/sun/org/apache/xerces/internal/jaxp/validation/ErrorHandlerAdaptor.java
deleted file mode 100644
index 124bcbc..0000000
--- a/src/com/sun/org/apache/xerces/internal/jaxp/validation/ErrorHandlerAdaptor.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2000-2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package com.sun.org.apache.xerces.internal.jaxp.validation;
-
-import com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLParseException;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.SAXException;
-
-/**
- * Receives errors through Xerces {@link XMLErrorHandler}
- * and pass them down to SAX {@link ErrorHandler}.
- *
- * @author
- * Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
- */
-public abstract class ErrorHandlerAdaptor implements XMLErrorHandler
-{
- /** set to true if there was any error. */
- private boolean hadError = false;
-
- /**
- * returns if there was an error since the last invocation of
- * the resetError method.
- */
- public boolean hadError() { return hadError; }
- /** resets the error flag. */
- public void reset() { hadError = false; }
-
- /**
- * Implemented by the derived class to return the actual
- * {@link ErrorHandler} to which errors are sent.
- *
- * @return always return non-null valid object.
- */
- protected abstract ErrorHandler getErrorHandler();
-
- public void fatalError( String domain, String key, XMLParseException e ) {
- try {
- hadError = true;
- getErrorHandler().fatalError( Util.toSAXParseException(e) );
- } catch( SAXException se ) {
- throw new WrappedSAXException(se);
- }
- }
-
- public void error( String domain, String key, XMLParseException e ) {
- try {
- hadError = true;
- getErrorHandler().error( Util.toSAXParseException(e) );
- } catch( SAXException se ) {
- throw new WrappedSAXException(se);
- }
- }
-
- public void warning( String domain, String key, XMLParseException e ) {
- try {
- getErrorHandler().warning( Util.toSAXParseException(e) );
- } catch( SAXException se ) {
- throw new WrappedSAXException(se);
- }
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/validation/JAXPValidationMessageFormatter.java b/src/com/sun/org/apache/xerces/internal/jaxp/validation/JAXPValidationMessageFormatter.java
deleted file mode 100644
index 5c51053..0000000
--- a/src/com/sun/org/apache/xerces/internal/jaxp/validation/JAXPValidationMessageFormatter.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.jaxp.validation;
-
-import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * <p>Used to format JAXP Validation API error messages using a specified locale.</p>
- *
- * @author Michael Glavassevich, IBM
- * @version $Id: JAXPValidationMessageFormatter.java,v 1.5 2010-11-01 04:40:08 joehw Exp $
- */
-final class JAXPValidationMessageFormatter {
-
- /**
- * Formats a message with the specified arguments using the given
- * locale information.
- *
- * @param locale The locale of the message.
- * @param key The message key.
- * @param arguments The message replacement text arguments. The order
- * of the arguments must match that of the placeholders
- * in the actual message.
- *
- * @return the formatted message.
- *
- * @throws MissingResourceException Thrown if the message with the
- * specified key cannot be found.
- */
- public static String formatMessage(Locale locale,
- String key, Object[] arguments)
- throws MissingResourceException {
-
- ResourceBundle resourceBundle = null;
- if (locale != null) {
- resourceBundle =
- SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.JAXPValidationMessages", locale);
- }
- else {
- resourceBundle =
- SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.JAXPValidationMessages");
- }
-
- // format message
- String msg;
- try {
- msg = resourceBundle.getString(key);
- if (arguments != null) {
- try {
- msg = java.text.MessageFormat.format(msg, arguments);
- }
- catch (Exception e) {
- msg = resourceBundle.getString("FormatFailed");
- msg += " " + resourceBundle.getString(key);
- }
- }
- }
-
- // error
- catch (MissingResourceException e) {
- msg = resourceBundle.getString("BadMessageKey");
- throw new MissingResourceException(key, msg, key);
- }
-
- // no message
- if (msg == null) {
- msg = key;
- if (arguments.length > 0) {
- StringBuffer str = new StringBuffer(msg);
- str.append('?');
- for (int i = 0; i < arguments.length; i++) {
- if (i > 0) {
- str.append('&');
- }
- str.append(String.valueOf(arguments[i]));
- }
- }
- }
- return msg;
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/validation/ReadOnlyGrammarPool.java b/src/com/sun/org/apache/xerces/internal/jaxp/validation/ReadOnlyGrammarPool.java
deleted file mode 100644
index f177a11..0000000
--- a/src/com/sun/org/apache/xerces/internal/jaxp/validation/ReadOnlyGrammarPool.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.jaxp.validation;
-
-import com.sun.org.apache.xerces.internal.xni.grammars.Grammar;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
-
-/**
- * <p>Filter {@link XMLGrammarPool} that exposes a
- * read-only view of the underlying pool.</p>
- *
- * @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
- */
-final class ReadOnlyGrammarPool implements XMLGrammarPool {
-
- private final XMLGrammarPool core;
-
- public ReadOnlyGrammarPool( XMLGrammarPool pool ) {
- this.core = pool;
- }
-
- public void cacheGrammars(String grammarType, Grammar[] grammars) {
- // noop. don't let caching to happen
- }
-
- public void clear() {
- // noop. cache is read-only.
- }
-
- public void lockPool() {
- // noop. this pool is always read-only
- }
-
- public Grammar retrieveGrammar(XMLGrammarDescription desc) {
- return core.retrieveGrammar(desc);
- }
-
- public Grammar[] retrieveInitialGrammarSet(String grammarType) {
- return core.retrieveInitialGrammarSet(grammarType);
- }
-
- public void unlockPool() {
- // noop. this pool is always read-only.
- }
-
-} // ReadOnlyGrammarPool
diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/validation/SimpleXMLSchema.java b/src/com/sun/org/apache/xerces/internal/jaxp/validation/SimpleXMLSchema.java
deleted file mode 100644
index 9b7b67d..0000000
--- a/src/com/sun/org/apache/xerces/internal/jaxp/validation/SimpleXMLSchema.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.jaxp.validation;
-
-import com.sun.org.apache.xerces.internal.xni.grammars.Grammar;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
-
-/**
- * <p>Implementation of Schema for W3C XML Schemas which
- * contains schema components from one target namespace.</p>
- *
- * @author Michael Glavassevich, IBM
- */
-final class SimpleXMLSchema extends AbstractXMLSchema implements XMLGrammarPool {
-
- /** Zero length grammar array. */
- private static final Grammar [] ZERO_LENGTH_GRAMMAR_ARRAY = new Grammar [0];
-
- private Grammar fGrammar;
- private Grammar[] fGrammars;
- private XMLGrammarDescription fGrammarDescription;
-
- public SimpleXMLSchema(Grammar grammar) {
- fGrammar = grammar;
- fGrammars = new Grammar[] {grammar};
- fGrammarDescription = grammar.getGrammarDescription();
- }
-
- /*
- * XMLGrammarPool methods
- */
-
- public Grammar[] retrieveInitialGrammarSet(String grammarType) {
- return XMLGrammarDescription.XML_SCHEMA.equals(grammarType) ?
- (Grammar[]) fGrammars.clone() : ZERO_LENGTH_GRAMMAR_ARRAY;
- }
-
- public void cacheGrammars(String grammarType, Grammar[] grammars) {}
-
- public Grammar retrieveGrammar(XMLGrammarDescription desc) {
- return fGrammarDescription.equals(desc) ? fGrammar : null;
- }
-
- public void lockPool() {}
-
- public void unlockPool() {}
-
- public void clear() {}
-
- /*
- * XSGrammarPoolContainer methods
- */
-
- public XMLGrammarPool getGrammarPool() {
- return this;
- }
-
- public boolean isFullyComposed() {
- return true;
- }
-
-} // SimpleXMLSchema
diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/validation/SoftReferenceGrammarPool.java b/src/com/sun/org/apache/xerces/internal/jaxp/validation/SoftReferenceGrammarPool.java
deleted file mode 100644
index 2eeb553..0000000
--- a/src/com/sun/org/apache/xerces/internal/jaxp/validation/SoftReferenceGrammarPool.java
+++ /dev/null
@@ -1,435 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.jaxp.validation;
-
-import java.lang.ref.Reference;
-import java.lang.ref.ReferenceQueue;
-import java.lang.ref.SoftReference;
-
-import com.sun.org.apache.xerces.internal.xni.grammars.Grammar;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLSchemaDescription;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
-
-/**
- * <p>This grammar pool is a memory sensitive cache. The grammars
- * stored in the pool are softly reachable and may be cleared by
- * the garbage collector in response to memory demand. Equality
- * of <code>XMLSchemaDescription</code>s is determined using both
- * the target namespace for the schema and schema location.</p>
- *
- * @author Michael Glavassevich, IBM
- */
-final class SoftReferenceGrammarPool implements XMLGrammarPool {
-
- //
- // Constants
- //
-
- /** Default size. */
- protected static final int TABLE_SIZE = 11;
-
- /** Zero length grammar array. */
- protected static final Grammar [] ZERO_LENGTH_GRAMMAR_ARRAY = new Grammar [0];
-
- //
- // Data
- //
-
- /** Grammars. */
- protected Entry [] fGrammars = null;
-
- /** Flag indicating whether this pool is locked */
- protected boolean fPoolIsLocked;
-
- /** The number of grammars in the pool */
- protected int fGrammarCount = 0;
-
- /** Reference queue for cleared grammar references */
- protected final ReferenceQueue fReferenceQueue = new ReferenceQueue();
-
- //
- // Constructors
- //
-
- /** Constructs a grammar pool with a default number of buckets. */
- public SoftReferenceGrammarPool() {
- fGrammars = new Entry[TABLE_SIZE];
- fPoolIsLocked = false;
- } // <init>()
-
- /** Constructs a grammar pool with a specified number of buckets. */
- public SoftReferenceGrammarPool(int initialCapacity) {
- fGrammars = new Entry[initialCapacity];
- fPoolIsLocked = false;
- }
-
- //
- // XMLGrammarPool methods
- //
-
- /* <p> Retrieve the initial known set of grammars. This method is
- * called by a validator before the validation starts. The application
- * can provide an initial set of grammars available to the current
- * validation attempt. </p>
- *
- * @param grammarType The type of the grammar, from the
- * <code>com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription</code>
- * interface.
- * @return The set of grammars the validator may put in its "bucket"
- */
- public Grammar [] retrieveInitialGrammarSet (String grammarType) {
- synchronized (fGrammars) {
- clean();
- // Return no grammars. This allows the garbage collector to sift
- // out grammars which are not in use when memory demand is high.
- // It also allows the pool to return the "right" schema grammar
- // based on schema locations.
- return ZERO_LENGTH_GRAMMAR_ARRAY;
- }
- } // retrieveInitialGrammarSet (String): Grammar[]
-
- /* <p> Return the final set of grammars that the validator ended up
- * with. This method is called after the validation finishes. The
- * application may then choose to cache some of the returned grammars.</p>
- * <p>In this implementation, we make our choice based on whether this object
- * is "locked"--that is, whether the application has instructed
- * us not to accept any new grammars.</p>
- *
- * @param grammarType The type of the grammars being returned;
- * @param grammars An array containing the set of grammars being
- * returned; order is not significant.
- */
- public void cacheGrammars(String grammarType, Grammar[] grammars) {
- if (!fPoolIsLocked) {
- for (int i = 0; i < grammars.length; ++i) {
- putGrammar(grammars[i]);
- }
- }
- } // cacheGrammars(String, Grammar[]);
-
- /* <p> This method requests that the application retrieve a grammar
- * corresponding to the given GrammarIdentifier from its cache.
- * If it cannot do so it must return null; the parser will then
- * call the EntityResolver. </p>
- * <strong>An application must not call its EntityResolver itself
- * from this method; this may result in infinite recursions.</strong>
- *
- * This implementation chooses to use the root element name to identify a DTD grammar
- * and the target namespace to identify a Schema grammar.
- *
- * @param desc The description of the Grammar being requested.
- * @return The Grammar corresponding to this description or null if
- * no such Grammar is known.
- */
- public Grammar retrieveGrammar(XMLGrammarDescription desc) {
- return getGrammar(desc);
- } // retrieveGrammar(XMLGrammarDescription): Grammar
-
- //
- // Public methods
- //
-
- /**
- * Puts the specified grammar into the grammar pool and associates it to
- * its root element name or its target namespace.
- *
- * @param grammar The Grammar.
- */
- public void putGrammar(Grammar grammar) {
- if (!fPoolIsLocked) {
- synchronized (fGrammars) {
- clean();
- XMLGrammarDescription desc = grammar.getGrammarDescription();
- int hash = hashCode(desc);
- int index = (hash & 0x7FFFFFFF) % fGrammars.length;
- for (Entry entry = fGrammars[index]; entry != null; entry = entry.next) {
- if (entry.hash == hash && equals(entry.desc, desc)) {
- if (entry.grammar.get() != grammar) {
- entry.grammar = new SoftGrammarReference(entry, grammar, fReferenceQueue);
- }
- return;
- }
- }
- // create a new entry
- Entry entry = new Entry(hash, index, desc, grammar, fGrammars[index], fReferenceQueue);
- fGrammars[index] = entry;
- fGrammarCount++;
- }
- }
- } // putGrammar(Grammar)
-
- /**
- * Returns the grammar associated to the specified grammar description.
- * Currently, the root element name is used as the key for DTD grammars
- * and the target namespace is used as the key for Schema grammars.
- *
- * @param desc The Grammar Description.
- */
- public Grammar getGrammar(XMLGrammarDescription desc) {
- synchronized (fGrammars) {
- clean();
- int hash = hashCode(desc);
- int index = (hash & 0x7FFFFFFF) % fGrammars.length;
- for (Entry entry = fGrammars[index]; entry != null; entry = entry.next) {
- Grammar tempGrammar = (Grammar) entry.grammar.get();
- /** If the soft reference has been cleared, remove this entry from the pool. */
- if (tempGrammar == null) {
- removeEntry(entry);
- }
- else if ((entry.hash == hash) && equals(entry.desc, desc)) {
- return tempGrammar;
- }
- }
- return null;
- }
- } // getGrammar(XMLGrammarDescription):Grammar
-
- /**
- * Removes the grammar associated to the specified grammar description from the
- * grammar pool and returns the removed grammar. Currently, the root element name
- * is used as the key for DTD grammars and the target namespace is used
- * as the key for Schema grammars.
- *
- * @param desc The Grammar Description.
- * @return The removed grammar.
- */
- public Grammar removeGrammar(XMLGrammarDescription desc) {
- synchronized (fGrammars) {
- clean();
- int hash = hashCode(desc);
- int index = (hash & 0x7FFFFFFF) % fGrammars.length;
- for (Entry entry = fGrammars[index]; entry != null; entry = entry.next) {
- if ((entry.hash == hash) && equals(entry.desc, desc)) {
- return removeEntry(entry);
- }
- }
- return null;
- }
- } // removeGrammar(XMLGrammarDescription):Grammar
-
- /**
- * Returns true if the grammar pool contains a grammar associated
- * to the specified grammar description. Currently, the root element name
- * is used as the key for DTD grammars and the target namespace is used
- * as the key for Schema grammars.
- *
- * @param desc The Grammar Description.
- */
- public boolean containsGrammar(XMLGrammarDescription desc) {
- synchronized (fGrammars) {
- clean();
- int hash = hashCode(desc);
- int index = (hash & 0x7FFFFFFF) % fGrammars.length;
- for (Entry entry = fGrammars[index]; entry != null ; entry = entry.next) {
- Grammar tempGrammar = (Grammar) entry.grammar.get();
- /** If the soft reference has been cleared, remove this entry from the pool. */
- if (tempGrammar == null) {
- removeEntry(entry);
- }
- else if ((entry.hash == hash) && equals(entry.desc, desc)) {
- return true;
- }
- }
- return false;
- }
- } // containsGrammar(XMLGrammarDescription):boolean
-
- /* <p> Sets this grammar pool to a "locked" state--i.e.,
- * no new grammars will be added until it is "unlocked".
- */
- public void lockPool() {
- fPoolIsLocked = true;
- } // lockPool()
-
- /* <p> Sets this grammar pool to an "unlocked" state--i.e.,
- * new grammars will be added when putGrammar or cacheGrammars
- * are called.
- */
- public void unlockPool() {
- fPoolIsLocked = false;
- } // unlockPool()
-
- /*
- * <p>This method clears the pool-i.e., removes references
- * to all the grammars in it.</p>
- */
- public void clear() {
- for (int i=0; i<fGrammars.length; i++) {
- if(fGrammars[i] != null) {
- fGrammars[i].clear();
- fGrammars[i] = null;
- }
- }
- fGrammarCount = 0;
- } // clear()
-
- /**
- * This method checks whether two grammars are the same. Currently, we compare
- * the root element names for DTD grammars and the target namespaces for Schema grammars.
- * The application can override this behaviour and add its own logic.
- *
- * @param desc1 The grammar description
- * @param desc2 The grammar description of the grammar to be compared to
- * @return True if the grammars are equal, otherwise false
- */
- public boolean equals(XMLGrammarDescription desc1, XMLGrammarDescription desc2) {
- if (desc1 instanceof XMLSchemaDescription) {
- if (!(desc2 instanceof XMLSchemaDescription)) {
- return false;
- }
- final XMLSchemaDescription sd1 = (XMLSchemaDescription) desc1;
- final XMLSchemaDescription sd2 = (XMLSchemaDescription) desc2;
- final String targetNamespace = sd1.getTargetNamespace();
- if (targetNamespace != null) {
- if (!targetNamespace.equals(sd2.getTargetNamespace())) {
- return false;
- }
- }
- else if (sd2.getTargetNamespace() != null) {
- return false;
- }
- // The JAXP 1.3 spec says that the implementation can assume that
- // if two schema location hints are the same they always resolve
- // to the same document. In the default grammar pool implementation
- // we only look at the target namespaces. Here we also compare
- // location hints.
- final String expandedSystemId = sd1.getExpandedSystemId();
- if (expandedSystemId != null) {
- if (!expandedSystemId.equals(sd2.getExpandedSystemId())) {
- return false;
- }
- }
- else if (sd2.getExpandedSystemId() != null) {
- return false;
- }
- return true;
- }
- return desc1.equals(desc2);
- }
-
- /**
- * Returns the hash code value for the given grammar description.
- *
- * @param desc The grammar description
- * @return The hash code value
- */
- public int hashCode(XMLGrammarDescription desc) {
- if (desc instanceof XMLSchemaDescription) {
- final XMLSchemaDescription sd = (XMLSchemaDescription) desc;
- final String targetNamespace = sd.getTargetNamespace();
- final String expandedSystemId = sd.getExpandedSystemId();
- int hash = (targetNamespace != null) ? targetNamespace.hashCode() : 0;
- hash ^= (expandedSystemId != null) ? expandedSystemId.hashCode() : 0;
- return hash;
- }
- return desc.hashCode();
- }
-
- /**
- * Removes the given entry from the pool
- *
- * @param entry the entry to remove
- * @return The grammar attached to this entry
- */
- private Grammar removeEntry(Entry entry) {
- if (entry.prev != null) {
- entry.prev.next = entry.next;
- }
- else {
- fGrammars[entry.bucket] = entry.next;
- }
- if (entry.next != null) {
- entry.next.prev = entry.prev;
- }
- --fGrammarCount;
- entry.grammar.entry = null;
- return (Grammar) entry.grammar.get();
- }
-
- /**
- * Removes stale entries from the pool.
- */
- private void clean() {
- Reference ref = fReferenceQueue.poll();
- while (ref != null) {
- Entry entry = ((SoftGrammarReference) ref).entry;
- if (entry != null) {
- removeEntry(entry);
- }
- ref = fReferenceQueue.poll();
- }
- }
-
- /**
- * This class is a grammar pool entry. Each entry acts as a node
- * in a doubly linked list.
- */
- static final class Entry {
-
- public int hash;
- public int bucket;
- public Entry prev;
- public Entry next;
- public XMLGrammarDescription desc;
- public SoftGrammarReference grammar;
-
- protected Entry(int hash, int bucket, XMLGrammarDescription desc, Grammar grammar, Entry next, ReferenceQueue queue) {
- this.hash = hash;
- this.bucket = bucket;
- this.prev = null;
- this.next = next;
- if (next != null) {
- next.prev = this;
- }
- this.desc = desc;
- this.grammar = new SoftGrammarReference(this, grammar, queue);
- }
-
- // clear this entry; useful to promote garbage collection
- // since reduces reference count of objects to be destroyed
- protected void clear () {
- desc = null;
- grammar = null;
- if(next != null) {
- next.clear();
- next = null;
- }
- } // clear()
-
- } // class Entry
-
- /**
- * This class stores a soft reference to a grammar object. It keeps a reference
- * to its associated entry, so that it can be easily removed from the pool.
- */
- static final class SoftGrammarReference extends SoftReference {
-
- public Entry entry;
-
- protected SoftGrammarReference(Entry entry, Grammar grammar, ReferenceQueue queue) {
- super(grammar, queue);
- this.entry = entry;
- }
-
- } // class SoftGrammarReference
-
-} // class SoftReferenceGrammarPool
diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/validation/StAXValidatorHelper.java b/src/com/sun/org/apache/xerces/internal/jaxp/validation/StAXValidatorHelper.java
deleted file mode 100644
index 16b1c97..0000000
--- a/src/com/sun/org/apache/xerces/internal/jaxp/validation/StAXValidatorHelper.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.org.apache.xerces.internal.jaxp.validation;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager;
-import java.io.IOException;
-
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.TransformerFactoryConfigurationError;
-import javax.xml.transform.sax.SAXResult;
-import javax.xml.transform.sax.SAXTransformerFactory;
-import javax.xml.transform.sax.TransformerHandler;
-import javax.xml.transform.stax.StAXResult;
-import javax.xml.transform.stax.StAXSource;
-
-import org.xml.sax.SAXException;
-
-/**
- * <p>A validator helper for <code>StAXSource</code>s.</p>
- *
- * @author <a href="mailto:Sunitha.Reddy@Sun.com">Sunitha Reddy</a>
- */
-public final class StAXValidatorHelper implements ValidatorHelper {
- private static final String DEFAULT_TRANSFORMER_IMPL = "com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl";
-
- /** Component manager. **/
- private XMLSchemaValidatorComponentManager fComponentManager;
-
- private Transformer identityTransformer1 = null;
- private TransformerHandler identityTransformer2 = null;
- private ValidatorHandlerImpl handler = null;
-
- /** Creates a new instance of StaxValidatorHelper */
- public StAXValidatorHelper(XMLSchemaValidatorComponentManager componentManager) {
- fComponentManager = componentManager;
- }
-
- public void validate(Source source, Result result)
- throws SAXException, IOException {
-
- if (result == null || result instanceof StAXResult) {
-
- if( identityTransformer1==null ) {
- try {
- SAXTransformerFactory tf = fComponentManager.getFeature(Constants.ORACLE_FEATURE_SERVICE_MECHANISM) ?
- (SAXTransformerFactory)SAXTransformerFactory.newInstance()
- : (SAXTransformerFactory) TransformerFactory.newInstance(DEFAULT_TRANSFORMER_IMPL, StAXValidatorHelper.class.getClassLoader());
- XMLSecurityManager securityManager = (XMLSecurityManager)fComponentManager.getProperty(Constants.SECURITY_MANAGER);
- if (securityManager != null) {
- for (XMLSecurityManager.Limit limit : XMLSecurityManager.Limit.values()) {
- if (securityManager.isSet(limit.ordinal())){
- tf.setAttribute(limit.apiProperty(),
- securityManager.getLimitValueAsString(limit));
- }
- }
- if (securityManager.printEntityCountInfo()) {
- tf.setAttribute(Constants.JDK_ENTITY_COUNT_INFO, "yes");
- }
- }
-
- identityTransformer1 = tf.newTransformer();
- identityTransformer2 = tf.newTransformerHandler();
- } catch (TransformerConfigurationException e) {
- // this is impossible, but again better safe than sorry
- throw new TransformerFactoryConfigurationError(e);
- }
- }
-
- handler = new ValidatorHandlerImpl(fComponentManager);
- if( result!=null ) {
- handler.setContentHandler(identityTransformer2);
- identityTransformer2.setResult(result);
- }
-
- try {
- identityTransformer1.transform( source, new SAXResult(handler) );
- } catch (TransformerException e) {
- if( e.getException() instanceof SAXException )
- throw (SAXException)e.getException();
- throw new SAXException(e);
- } finally {
- handler.setContentHandler(null);
- }
- return;
- }
- throw new IllegalArgumentException(JAXPValidationMessageFormatter.formatMessage(fComponentManager.getLocale(),
- "SourceResultMismatch",
- new Object [] {source.getClass().getName(), result.getClass().getName()}));
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/validation/StreamValidatorHelper.java b/src/com/sun/org/apache/xerces/internal/jaxp/validation/StreamValidatorHelper.java
deleted file mode 100644
index d6c04fd..0000000
--- a/src/com/sun/org/apache/xerces/internal/jaxp/validation/StreamValidatorHelper.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.jaxp.validation;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
-import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter;
-import com.sun.org.apache.xerces.internal.parsers.XML11Configuration;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLParseException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration;
-import java.io.IOException;
-import java.lang.ref.SoftReference;
-import javax.xml.XMLConstants;
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.TransformerFactoryConfigurationError;
-import javax.xml.transform.sax.SAXTransformerFactory;
-import javax.xml.transform.sax.TransformerHandler;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.stream.StreamSource;
-import org.xml.sax.SAXException;
-
-/**
- * <p>A validator helper for <code>StreamSource</code>s.</p>
- *
- * @author Michael Glavassevich, IBM
- * @author <a href="mailto:Sunitha.Reddy@Sun.com">Sunitha Reddy</a>
- * @version $Id: StreamValidatorHelper.java,v 1.7 2010-11-01 04:40:08 joehw Exp $
- */
-final class StreamValidatorHelper implements ValidatorHelper {
-
- // feature identifiers
-
- /** Feature identifier: parser settings. */
- private static final String PARSER_SETTINGS =
- Constants.XERCES_FEATURE_PREFIX + Constants.PARSER_SETTINGS;
-
- // property identifiers
-
- /** Property identifier: entity resolver. */
- private static final String ENTITY_RESOLVER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_RESOLVER_PROPERTY;
-
- /** Property identifier: error handler. */
- private static final String ERROR_HANDLER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_HANDLER_PROPERTY;
-
- /** Property identifier: error reporter. */
- private static final String ERROR_REPORTER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY;
-
- /** Property identifier: XML Schema validator. */
- private static final String SCHEMA_VALIDATOR =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SCHEMA_VALIDATOR_PROPERTY;
-
- /** Property identifier: symbol table. */
- private static final String SYMBOL_TABLE =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY;
-
- /** Property identifier: validation manager. */
- private static final String VALIDATION_MANAGER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.VALIDATION_MANAGER_PROPERTY;
-
- private static final String DEFAULT_TRANSFORMER_IMPL = "com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl";
-
- /** Property id: security manager. */
- private static final String SECURITY_MANAGER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SECURITY_MANAGER_PROPERTY;
-
- //
- // Data
- //
-
- /** SoftReference to parser configuration. **/
- private SoftReference fConfiguration = new SoftReference(null);
-
- /** Schema validator. **/
- private com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator fSchemaValidator;
-
- /** Component manager. **/
- private XMLSchemaValidatorComponentManager fComponentManager;
-
- private ValidatorHandlerImpl handler = null;
-
- public StreamValidatorHelper(XMLSchemaValidatorComponentManager componentManager) {
- fComponentManager = componentManager;
- fSchemaValidator = (com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator) fComponentManager.getProperty(SCHEMA_VALIDATOR);
- }
-
- public void validate(Source source, Result result)
- throws SAXException, IOException {
- if (result == null || result instanceof StreamResult) {
- final StreamSource streamSource = (StreamSource) source;
- TransformerHandler identityTransformerHandler ;
-
- if( result!=null ) {
- try {
- SAXTransformerFactory tf = fComponentManager.getFeature(Constants.ORACLE_FEATURE_SERVICE_MECHANISM) ?
- (SAXTransformerFactory)SAXTransformerFactory.newInstance()
- : (SAXTransformerFactory) TransformerFactory.newInstance(DEFAULT_TRANSFORMER_IMPL, StreamValidatorHelper.class.getClassLoader());
- identityTransformerHandler = tf.newTransformerHandler();
- } catch (TransformerConfigurationException e) {
- throw new TransformerFactoryConfigurationError(e);
- }
-
- handler = new ValidatorHandlerImpl(fComponentManager);
- handler.setContentHandler(identityTransformerHandler);
- identityTransformerHandler.setResult(result);
- }
-
- XMLInputSource input = new XMLInputSource(streamSource.getPublicId(), streamSource.getSystemId(), null);
- input.setByteStream(streamSource.getInputStream());
- input.setCharacterStream(streamSource.getReader());
-
- // Gets the parser configuration. We'll create and initialize a new one, if we
- // haven't created one before or if the previous one was garbage collected.
- XMLParserConfiguration config = (XMLParserConfiguration) fConfiguration.get();
- if (config == null) {
- config = initialize();
- }
- // If settings have changed on the component manager, refresh the error handler and entity resolver.
- else if (fComponentManager.getFeature(PARSER_SETTINGS)) {
- config.setProperty(ENTITY_RESOLVER, fComponentManager.getProperty(ENTITY_RESOLVER));
- config.setProperty(ERROR_HANDLER, fComponentManager.getProperty(ERROR_HANDLER));
- }
-
- // prepare for parse
- fComponentManager.reset();
- fSchemaValidator.setDocumentHandler(handler);
-
- try {
- config.parse(input);
- }
- catch (XMLParseException e) {
- throw Util.toSAXParseException(e);
- }
- catch (XNIException e) {
- throw Util.toSAXException(e);
- }
- return;
- }
- throw new IllegalArgumentException(JAXPValidationMessageFormatter.formatMessage(fComponentManager.getLocale(),
- "SourceResultMismatch",
- new Object [] {source.getClass().getName(), result.getClass().getName()}));
- }
-
- private XMLParserConfiguration initialize() {
- XML11Configuration config = new XML11Configuration();
- if (fComponentManager.getFeature(XMLConstants.FEATURE_SECURE_PROCESSING)) {
- config.setProperty(SECURITY_MANAGER, new XMLSecurityManager());
- }
- config.setProperty(ENTITY_RESOLVER, fComponentManager.getProperty(ENTITY_RESOLVER));
- config.setProperty(ERROR_HANDLER, fComponentManager.getProperty(ERROR_HANDLER));
- XMLErrorReporter errorReporter = (XMLErrorReporter) fComponentManager.getProperty(ERROR_REPORTER);
- config.setProperty(ERROR_REPORTER, errorReporter);
- // add message formatters
- if (errorReporter.getMessageFormatter(XMLMessageFormatter.XML_DOMAIN) == null) {
- XMLMessageFormatter xmft = new XMLMessageFormatter();
- errorReporter.putMessageFormatter(XMLMessageFormatter.XML_DOMAIN, xmft);
- errorReporter.putMessageFormatter(XMLMessageFormatter.XMLNS_DOMAIN, xmft);
- }
- config.setProperty(SYMBOL_TABLE, fComponentManager.getProperty(SYMBOL_TABLE));
- config.setProperty(VALIDATION_MANAGER, fComponentManager.getProperty(VALIDATION_MANAGER));
- config.setDocumentHandler(fSchemaValidator);
- config.setDTDHandler(null);
- config.setDTDContentModelHandler(null);
- config.setProperty(Constants.XML_SECURITY_PROPERTY_MANAGER,
- fComponentManager.getProperty(Constants.XML_SECURITY_PROPERTY_MANAGER));
- config.setProperty(Constants.SECURITY_MANAGER,
- fComponentManager.getProperty(Constants.SECURITY_MANAGER));
- fConfiguration = new SoftReference(config);
- return config;
- }
-
-} // StreamValidatorHelper
diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/validation/Util.java b/src/com/sun/org/apache/xerces/internal/jaxp/validation/Util.java
deleted file mode 100644
index 5076e60..0000000
--- a/src/com/sun/org/apache/xerces/internal/jaxp/validation/Util.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.jaxp.validation;
-
-import javax.xml.transform.stream.StreamSource;
-
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLParseException;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-/**
- * <p>Static utility methods for the Validation API implementation.</p>
- *
- * @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
- */
-final class Util {
-
- /**
- * Creates a proper {@link XMLInputSource} from a {@link StreamSource}.
- *
- * @return always return non-null valid object.
- */
- public static final XMLInputSource toXMLInputSource( StreamSource in ) {
- if( in.getReader()!=null )
- return new XMLInputSource(
- in.getPublicId(), in.getSystemId(), in.getSystemId(),
- in.getReader(), null );
- if( in.getInputStream()!=null )
- return new XMLInputSource(
- in.getPublicId(), in.getSystemId(), in.getSystemId(),
- in.getInputStream(), null );
-
- return new XMLInputSource(
- in.getPublicId(), in.getSystemId(), in.getSystemId() );
- }
-
- /**
- * Reconstructs {@link SAXException} from XNIException.
- */
- public static SAXException toSAXException(XNIException e) {
- if(e instanceof XMLParseException)
- return toSAXParseException((XMLParseException)e);
- if( e.getException() instanceof SAXException )
- return (SAXException)e.getException();
- return new SAXException(e.getMessage(),e.getException());
- }
-
- public static SAXParseException toSAXParseException( XMLParseException e ) {
- if( e.getException() instanceof SAXParseException )
- return (SAXParseException)e.getException();
- return new SAXParseException( e.getMessage(),
- e.getPublicId(), e.getExpandedSystemId(),
- e.getLineNumber(), e.getColumnNumber(),
- e.getException() );
- }
-
-} // Util
diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/validation/ValidatorHandlerImpl.java b/src/com/sun/org/apache/xerces/internal/jaxp/validation/ValidatorHandlerImpl.java
deleted file mode 100644
index 2a62405..0000000
--- a/src/com/sun/org/apache/xerces/internal/jaxp/validation/ValidatorHandlerImpl.java
+++ /dev/null
@@ -1,1087 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.jaxp.validation;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-import java.io.StringReader;
-import java.util.HashMap;
-
-import javax.xml.XMLConstants;
-import javax.xml.parsers.FactoryConfigurationError;
-import javax.xml.parsers.SAXParserFactory;
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-import javax.xml.transform.sax.SAXResult;
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.validation.TypeInfoProvider;
-import javax.xml.validation.ValidatorHandler;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.XMLEntityManager;
-import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
-import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType;
-import com.sun.org.apache.xerces.internal.impl.validation.EntityState;
-import com.sun.org.apache.xerces.internal.impl.validation.ValidationManager;
-import com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator;
-import com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl;
-import com.sun.org.apache.xerces.internal.util.AttributesProxy;
-import com.sun.org.apache.xerces.internal.util.SAXLocatorWrapper;
-import com.sun.org.apache.xerces.internal.util.SAXMessageFormatter;
-import com.sun.org.apache.xerces.internal.util.Status;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.util.URI;
-import com.sun.org.apache.xerces.internal.util.XMLAttributesImpl;
-import com.sun.org.apache.xerces.internal.util.XMLSymbols;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager;
-import com.sun.org.apache.xerces.internal.xni.Augmentations;
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
-import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLLocator;
-import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
-import com.sun.org.apache.xerces.internal.xni.XMLString;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLParseException;
-import com.sun.org.apache.xerces.internal.xs.AttributePSVI;
-import com.sun.org.apache.xerces.internal.xs.ElementPSVI;
-import com.sun.org.apache.xerces.internal.xs.ItemPSVI;
-import com.sun.org.apache.xerces.internal.xs.PSVIProvider;
-import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
-import org.w3c.dom.TypeInfo;
-import org.w3c.dom.ls.LSInput;
-import org.w3c.dom.ls.LSResourceResolver;
-import org.xml.sax.Attributes;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.DTDHandler;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.ext.Attributes2;
-import org.xml.sax.ext.EntityResolver2;
-
-/**
- * <p>Implementation of ValidatorHandler for W3C XML Schemas and
- * also a validator helper for <code>SAXSource</code>s.</p>
- *
- * @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
- * @author Michael Glavassevich, IBM
- *
- * @version $Id: ValidatorHandlerImpl.java,v 1.10 2010-11-01 04:40:08 joehw Exp $
- */
-final class ValidatorHandlerImpl extends ValidatorHandler implements
- DTDHandler, EntityState, PSVIProvider, ValidatorHelper, XMLDocumentHandler {
-
- // feature identifiers
-
- /** Feature identifier: namespace prefixes. */
- private static final String NAMESPACE_PREFIXES =
- Constants.SAX_FEATURE_PREFIX + Constants.NAMESPACE_PREFIXES_FEATURE;
-
- /** Feature identifier: string interning. */
- protected static final String STRING_INTERNING =
- Constants.SAX_FEATURE_PREFIX + Constants.STRING_INTERNING_FEATURE;
-
- // property identifiers
-
- /** Property identifier: error reporter. */
- private static final String ERROR_REPORTER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY;
-
- /** Property identifier: namespace context. */
- private static final String NAMESPACE_CONTEXT =
- Constants.XERCES_PROPERTY_PREFIX + Constants.NAMESPACE_CONTEXT_PROPERTY;
-
- /** Property identifier: XML Schema validator. */
- private static final String SCHEMA_VALIDATOR =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SCHEMA_VALIDATOR_PROPERTY;
-
- /** Property identifier: security manager. */
- private static final String SECURITY_MANAGER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SECURITY_MANAGER_PROPERTY;
-
- /** Property identifier: symbol table. */
- private static final String SYMBOL_TABLE =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY;
-
- /** Property identifier: validation manager. */
- private static final String VALIDATION_MANAGER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.VALIDATION_MANAGER_PROPERTY;
-
- /** Property identifier: Security property manager. */
- private static final String XML_SECURITY_PROPERTY_MANAGER =
- Constants.XML_SECURITY_PROPERTY_MANAGER;
-
- //
- // Data
- //
-
- /** Error reporter. */
- private XMLErrorReporter fErrorReporter;
-
- /** The namespace context of this document: stores namespaces in scope */
- private NamespaceContext fNamespaceContext;
-
- /** Schema validator. **/
- private XMLSchemaValidator fSchemaValidator;
-
- /** Symbol table **/
- private SymbolTable fSymbolTable;
-
- /** Validation manager. */
- private ValidationManager fValidationManager;
-
- /** Component manager. **/
- private XMLSchemaValidatorComponentManager fComponentManager;
-
- /** XML Locator wrapper for SAX. **/
- private final SAXLocatorWrapper fSAXLocatorWrapper = new SAXLocatorWrapper();
-
- /** Flag used to track whether the namespace context needs to be pushed. */
- private boolean fNeedPushNSContext = true;
-
- /** Map for tracking unparsed entities. */
- private HashMap fUnparsedEntities = null;
-
- /** Flag used to track whether XML names and Namespace URIs have been internalized. */
- private boolean fStringsInternalized = false;
-
- /** Fields for start element, end element and characters. */
- private final QName fElementQName = new QName();
- private final QName fAttributeQName = new QName();
- private final XMLAttributesImpl fAttributes = new XMLAttributesImpl();
- private final AttributesProxy fAttrAdapter = new AttributesProxy(fAttributes);
- private final XMLString fTempString = new XMLString();
-
- //
- // User Objects
- //
-
- private ContentHandler fContentHandler = null;
-
- /*
- * Constructors
- */
-
- public ValidatorHandlerImpl(XSGrammarPoolContainer grammarContainer) {
- this(new XMLSchemaValidatorComponentManager(grammarContainer));
- fComponentManager.addRecognizedFeatures(new String [] {NAMESPACE_PREFIXES});
- fComponentManager.setFeature(NAMESPACE_PREFIXES, false);
- setErrorHandler(null);
- setResourceResolver(null);
- }
-
- public ValidatorHandlerImpl(XMLSchemaValidatorComponentManager componentManager) {
- fComponentManager = componentManager;
- fErrorReporter = (XMLErrorReporter) fComponentManager.getProperty(ERROR_REPORTER);
- fNamespaceContext = (NamespaceContext) fComponentManager.getProperty(NAMESPACE_CONTEXT);
- fSchemaValidator = (XMLSchemaValidator) fComponentManager.getProperty(SCHEMA_VALIDATOR);
- fSymbolTable = (SymbolTable) fComponentManager.getProperty(SYMBOL_TABLE);
- fValidationManager = (ValidationManager) fComponentManager.getProperty(VALIDATION_MANAGER);
- }
-
- /*
- * ValidatorHandler methods
- */
-
- public void setContentHandler(ContentHandler receiver) {
- fContentHandler = receiver;
- }
-
- public ContentHandler getContentHandler() {
- return fContentHandler;
- }
-
- public void setErrorHandler(ErrorHandler errorHandler) {
- fComponentManager.setErrorHandler(errorHandler);
- }
-
- public ErrorHandler getErrorHandler() {
- return fComponentManager.getErrorHandler();
- }
-
- public void setResourceResolver(LSResourceResolver resourceResolver) {
- fComponentManager.setResourceResolver(resourceResolver);
- }
-
- public LSResourceResolver getResourceResolver() {
- return fComponentManager.getResourceResolver();
- }
-
- public TypeInfoProvider getTypeInfoProvider() {
- return fTypeInfoProvider;
- }
-
- public boolean getFeature(String name)
- throws SAXNotRecognizedException, SAXNotSupportedException {
- if (name == null) {
- throw new NullPointerException();
- }
- try {
- return fComponentManager.getFeature(name);
- }
- catch (XMLConfigurationException e) {
- final String identifier = e.getIdentifier();
- final String key = e.getType() == Status.NOT_RECOGNIZED ?
- "feature-not-recognized" : "feature-not-supported";
- throw new SAXNotRecognizedException(
- SAXMessageFormatter.formatMessage(fComponentManager.getLocale(),
- key, new Object [] {identifier}));
- }
- }
-
- public void setFeature(String name, boolean value)
- throws SAXNotRecognizedException, SAXNotSupportedException {
- if (name == null) {
- throw new NullPointerException();
- }
- try {
- fComponentManager.setFeature(name, value);
- }
- catch (XMLConfigurationException e) {
- final String identifier = e.getIdentifier();
- final String key;
- if (e.getType() == Status.NOT_ALLOWED) {
- //for now, the identifier can only be (XMLConstants.FEATURE_SECURE_PROCESSING)
- throw new SAXNotSupportedException(
- SAXMessageFormatter.formatMessage(fComponentManager.getLocale(),
- "jaxp-secureprocessing-feature", null));
- } else if (e.getType() == Status.NOT_RECOGNIZED) {
- key = "feature-not-recognized";
- } else {
- key = "feature-not-supported";
- }
- throw new SAXNotRecognizedException(
- SAXMessageFormatter.formatMessage(fComponentManager.getLocale(),
- key, new Object [] {identifier}));
- }
- }
-
- public Object getProperty(String name)
- throws SAXNotRecognizedException, SAXNotSupportedException {
- if (name == null) {
- throw new NullPointerException();
- }
- try {
- return fComponentManager.getProperty(name);
- }
- catch (XMLConfigurationException e) {
- final String identifier = e.getIdentifier();
- final String key = e.getType() == Status.NOT_RECOGNIZED ?
- "property-not-recognized" : "property-not-supported";
- throw new SAXNotRecognizedException(
- SAXMessageFormatter.formatMessage(fComponentManager.getLocale(),
- key, new Object [] {identifier}));
- }
- }
-
- public void setProperty(String name, Object object)
- throws SAXNotRecognizedException, SAXNotSupportedException {
- if (name == null) {
- throw new NullPointerException();
- }
- try {
- fComponentManager.setProperty(name, object);
- }
- catch (XMLConfigurationException e) {
- final String identifier = e.getIdentifier();
- final String key = e.getType() == Status.NOT_RECOGNIZED ?
- "property-not-recognized" : "property-not-supported";
- throw new SAXNotRecognizedException(
- SAXMessageFormatter.formatMessage(fComponentManager.getLocale(),
- key, new Object [] {identifier}));
- }
- }
-
- /*
- * EntityState methods
- */
-
- public boolean isEntityDeclared(String name) {
- return false;
- }
-
- public boolean isEntityUnparsed(String name) {
- if (fUnparsedEntities != null) {
- return fUnparsedEntities.containsKey(name);
- }
- return false;
- }
-
- /*
- * XMLDocumentHandler methods
- */
-
- public void startDocument(XMLLocator locator, String encoding,
- NamespaceContext namespaceContext, Augmentations augs)
- throws XNIException {
- if (fContentHandler != null) {
- try {
- fContentHandler.startDocument();
- }
- catch (SAXException e) {
- throw new XNIException(e);
- }
- }
- }
-
- public void xmlDecl(String version, String encoding, String standalone,
- Augmentations augs) throws XNIException {}
-
- public void doctypeDecl(String rootElement, String publicId,
- String systemId, Augmentations augs) throws XNIException {}
-
- public void comment(XMLString text, Augmentations augs) throws XNIException {}
-
- public void processingInstruction(String target, XMLString data,
- Augmentations augs) throws XNIException {
- if (fContentHandler != null) {
- try {
- fContentHandler.processingInstruction(target, data.toString());
- }
- catch (SAXException e) {
- throw new XNIException(e);
- }
- }
- }
-
- public void startElement(QName element, XMLAttributes attributes,
- Augmentations augs) throws XNIException {
- if (fContentHandler != null) {
- try {
- fTypeInfoProvider.beginStartElement(augs, attributes);
- fContentHandler.startElement((element.uri != null) ? element.uri : XMLSymbols.EMPTY_STRING,
- element.localpart, element.rawname, fAttrAdapter);
- }
- catch (SAXException e) {
- throw new XNIException(e);
- }
- finally {
- fTypeInfoProvider.finishStartElement();
- }
- }
- }
-
- public void emptyElement(QName element, XMLAttributes attributes,
- Augmentations augs) throws XNIException {
- /** Split empty element event. **/
- startElement(element, attributes, augs);
- endElement(element, augs);
- }
-
- public void startGeneralEntity(String name,
- XMLResourceIdentifier identifier, String encoding,
- Augmentations augs) throws XNIException {}
-
- public void textDecl(String version, String encoding, Augmentations augs)
- throws XNIException {}
-
- public void endGeneralEntity(String name, Augmentations augs)
- throws XNIException {}
-
- public void characters(XMLString text, Augmentations augs)
- throws XNIException {
- if (fContentHandler != null) {
- // if the type is union it is possible that we receive
- // a character call with empty data
- if (text.length == 0) {
- return;
- }
- try {
- fContentHandler.characters(text.ch, text.offset, text.length);
- }
- catch (SAXException e) {
- throw new XNIException(e);
- }
- }
- }
-
- public void ignorableWhitespace(XMLString text, Augmentations augs)
- throws XNIException {
- if (fContentHandler != null) {
- try {
- fContentHandler.ignorableWhitespace(text.ch, text.offset, text.length);
- }
- catch (SAXException e) {
- throw new XNIException(e);
- }
- }
- }
-
- public void endElement(QName element, Augmentations augs)
- throws XNIException {
- if (fContentHandler != null) {
- try {
- fTypeInfoProvider.beginEndElement(augs);
- fContentHandler.endElement((element.uri != null) ? element.uri : XMLSymbols.EMPTY_STRING,
- element.localpart, element.rawname);
- }
- catch (SAXException e) {
- throw new XNIException(e);
- }
- finally {
- fTypeInfoProvider.finishEndElement();
- }
- }
- }
-
- public void startCDATA(Augmentations augs) throws XNIException {}
-
- public void endCDATA(Augmentations augs) throws XNIException {}
-
- public void endDocument(Augmentations augs) throws XNIException {
- if (fContentHandler != null) {
- try {
- fContentHandler.endDocument();
- }
- catch (SAXException e) {
- throw new XNIException(e);
- }
- }
- }
-
- // NO-OP
- public void setDocumentSource(XMLDocumentSource source) {}
-
- public XMLDocumentSource getDocumentSource() {
- return fSchemaValidator;
- }
-
- /*
- * ContentHandler methods
- */
-
- public void setDocumentLocator(Locator locator) {
- fSAXLocatorWrapper.setLocator(locator);
- if (fContentHandler != null) {
- fContentHandler.setDocumentLocator(locator);
- }
- }
-
- public void startDocument() throws SAXException {
- fComponentManager.reset();
- fSchemaValidator.setDocumentHandler(this);
- fValidationManager.setEntityState(this);
- fTypeInfoProvider.finishStartElement(); // cleans up TypeInfoProvider
- fNeedPushNSContext = true;
- if (fUnparsedEntities != null && !fUnparsedEntities.isEmpty()) {
- // should only clear this if the last document contained unparsed entities
- fUnparsedEntities.clear();
- }
- fErrorReporter.setDocumentLocator(fSAXLocatorWrapper);
- try {
- fSchemaValidator.startDocument(fSAXLocatorWrapper, fSAXLocatorWrapper.getEncoding(), fNamespaceContext, null);
- }
- catch (XMLParseException e) {
- throw Util.toSAXParseException(e);
- }
- catch (XNIException e) {
- throw Util.toSAXException(e);
- }
- }
-
- public void endDocument() throws SAXException {
- fSAXLocatorWrapper.setLocator(null);
- try {
- fSchemaValidator.endDocument(null);
- }
- catch (XMLParseException e) {
- throw Util.toSAXParseException(e);
- }
- catch (XNIException e) {
- throw Util.toSAXException(e);
- }
- }
-
- public void startPrefixMapping(String prefix, String uri)
- throws SAXException {
- String prefixSymbol;
- String uriSymbol;
- if (!fStringsInternalized) {
- prefixSymbol = (prefix != null) ? fSymbolTable.addSymbol(prefix) : XMLSymbols.EMPTY_STRING;
- uriSymbol = (uri != null && uri.length() > 0) ? fSymbolTable.addSymbol(uri) : null;
- }
- else {
- prefixSymbol = (prefix != null) ? prefix : XMLSymbols.EMPTY_STRING;
- uriSymbol = (uri != null && uri.length() > 0) ? uri : null;
- }
- if (fNeedPushNSContext) {
- fNeedPushNSContext = false;
- fNamespaceContext.pushContext();
- }
- fNamespaceContext.declarePrefix(prefixSymbol, uriSymbol);
- if (fContentHandler != null) {
- fContentHandler.startPrefixMapping(prefix, uri);
- }
- }
-
- public void endPrefixMapping(String prefix) throws SAXException {
- if (fContentHandler != null) {
- fContentHandler.endPrefixMapping(prefix);
- }
- }
-
- public void startElement(String uri, String localName, String qName,
- Attributes atts) throws SAXException {
- if (fNeedPushNSContext) {
- fNamespaceContext.pushContext();
- }
- fNeedPushNSContext = true;
-
- // Fill element QName
- fillQName(fElementQName, uri, localName, qName);
-
- // Fill XMLAttributes
- if (atts instanceof Attributes2) {
- fillXMLAttributes2((Attributes2) atts);
- }
- else {
- fillXMLAttributes(atts);
- }
-
- try {
- fSchemaValidator.startElement(fElementQName, fAttributes, null);
- }
- catch (XMLParseException e) {
- throw Util.toSAXParseException(e);
- }
- catch (XNIException e) {
- throw Util.toSAXException(e);
- }
- }
-
- public void endElement(String uri, String localName, String qName)
- throws SAXException {
- fillQName(fElementQName, uri, localName, qName);
- try {
- fSchemaValidator.endElement(fElementQName, null);
- }
- catch (XMLParseException e) {
- throw Util.toSAXParseException(e);
- }
- catch (XNIException e) {
- throw Util.toSAXException(e);
- }
- finally {
- fNamespaceContext.popContext();
- }
- }
-
- public void characters(char[] ch, int start, int length)
- throws SAXException {
- try {
- fTempString.setValues(ch, start, length);
- fSchemaValidator.characters(fTempString, null);
- }
- catch (XMLParseException e) {
- throw Util.toSAXParseException(e);
- }
- catch (XNIException e) {
- throw Util.toSAXException(e);
- }
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length)
- throws SAXException {
- try {
- fTempString.setValues(ch, start, length);
- fSchemaValidator.ignorableWhitespace(fTempString, null);
- }
- catch (XMLParseException e) {
- throw Util.toSAXParseException(e);
- }
- catch (XNIException e) {
- throw Util.toSAXException(e);
- }
- }
-
- public void processingInstruction(String target, String data)
- throws SAXException {
- /**
- * Processing instructions do not participate in schema validation,
- * so just forward the event to the application's content
- * handler.
- */
- if (fContentHandler != null) {
- fContentHandler.processingInstruction(target, data);
- }
- }
-
- public void skippedEntity(String name) throws SAXException {
- // there seems to be no corresponding method on XMLDocumentFilter.
- // just pass it down to the output, if any.
- if (fContentHandler != null) {
- fContentHandler.skippedEntity(name);
- }
- }
-
- /*
- * DTDHandler methods
- */
-
- public void notationDecl(String name, String publicId,
- String systemId) throws SAXException {}
-
- public void unparsedEntityDecl(String name, String publicId,
- String systemId, String notationName) throws SAXException {
- if (fUnparsedEntities == null) {
- fUnparsedEntities = new HashMap();
- }
- fUnparsedEntities.put(name, name);
- }
-
- /*
- * ValidatorHelper methods
- */
-
- public void validate(Source source, Result result)
- throws SAXException, IOException {
- if (result instanceof SAXResult || result == null) {
- final SAXSource saxSource = (SAXSource) source;
- final SAXResult saxResult = (SAXResult) result;
-
- if (result != null) {
- setContentHandler(saxResult.getHandler());
- }
-
- try {
- XMLReader reader = saxSource.getXMLReader();
- if( reader==null ) {
- // create one now
- SAXParserFactory spf = fComponentManager.getFeature(Constants.ORACLE_FEATURE_SERVICE_MECHANISM) ?
- SAXParserFactory.newInstance() : new SAXParserFactoryImpl();
- spf.setNamespaceAware(true);
- try {
- spf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING,
- fComponentManager.getFeature(XMLConstants.FEATURE_SECURE_PROCESSING));
- reader = spf.newSAXParser().getXMLReader();
- // If this is a Xerces SAX parser, set the security manager if there is one
- if (reader instanceof com.sun.org.apache.xerces.internal.parsers.SAXParser) {
- XMLSecurityManager securityManager = (XMLSecurityManager) fComponentManager.getProperty(SECURITY_MANAGER);
- if (securityManager != null) {
- try {
- reader.setProperty(SECURITY_MANAGER, securityManager);
- }
- // Ignore the exception if the security manager cannot be set.
- catch (SAXException exc) {}
- }
- try {
- XMLSecurityPropertyManager spm = (XMLSecurityPropertyManager)
- fComponentManager.getProperty(XML_SECURITY_PROPERTY_MANAGER);
- reader.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD,
- spm.getValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD));
- } catch (SAXException exc) {
- XMLSecurityManager.printWarning(reader.getClass().getName(),
- XMLConstants.ACCESS_EXTERNAL_DTD, exc);
- }
- }
- } catch( Exception e ) {
- // this is impossible, but better safe than sorry
- throw new FactoryConfigurationError(e);
- }
- }
-
- // If XML names and Namespace URIs are already internalized we
- // can avoid running them through the SymbolTable.
- try {
- fStringsInternalized = reader.getFeature(STRING_INTERNING);
- }
- catch (SAXException exc) {
- // The feature isn't recognized or getting it is not supported.
- // In either case, assume that strings are not internalized.
- fStringsInternalized = false;
- }
-
- ErrorHandler errorHandler = fComponentManager.getErrorHandler();
- reader.setErrorHandler(errorHandler != null ? errorHandler : DraconianErrorHandler.getInstance());
- reader.setEntityResolver(fResolutionForwarder);
- fResolutionForwarder.setEntityResolver(fComponentManager.getResourceResolver());
- reader.setContentHandler(this);
- reader.setDTDHandler(this);
-
- InputSource is = saxSource.getInputSource();
- reader.parse(is);
- }
- finally {
- // release the reference to user's handler ASAP
- setContentHandler(null);
- }
- return;
- }
- throw new IllegalArgumentException(JAXPValidationMessageFormatter.formatMessage(fComponentManager.getLocale(),
- "SourceResultMismatch",
- new Object [] {source.getClass().getName(), result.getClass().getName()}));
- }
-
- /*
- * PSVIProvider methods
- */
-
- public ElementPSVI getElementPSVI() {
- return fTypeInfoProvider.getElementPSVI();
- }
-
- public AttributePSVI getAttributePSVI(int index) {
- return fTypeInfoProvider.getAttributePSVI(index);
- }
-
- public AttributePSVI getAttributePSVIByName(String uri, String localname) {
- return fTypeInfoProvider.getAttributePSVIByName(uri, localname);
- }
-
- //
- //
- // helper methods
- //
- //
-
- /** Fills in a QName object. */
- private void fillQName(QName toFill, String uri, String localpart, String raw) {
- if (!fStringsInternalized) {
- uri = (uri != null && uri.length() > 0) ? fSymbolTable.addSymbol(uri) : null;
- localpart = (localpart != null) ? fSymbolTable.addSymbol(localpart) : XMLSymbols.EMPTY_STRING;
- raw = (raw != null) ? fSymbolTable.addSymbol(raw) : XMLSymbols.EMPTY_STRING;
- }
- else {
- if (uri != null && uri.length() == 0) {
- uri = null;
- }
- if (localpart == null) {
- localpart = XMLSymbols.EMPTY_STRING;
- }
- if (raw == null) {
- raw = XMLSymbols.EMPTY_STRING;
- }
- }
- String prefix = XMLSymbols.EMPTY_STRING;
- int prefixIdx = raw.indexOf(':');
- if (prefixIdx != -1) {
- prefix = fSymbolTable.addSymbol(raw.substring(0, prefixIdx));
- }
- toFill.setValues(prefix, localpart, raw, uri);
- }
-
- /** Fills in the XMLAttributes object. */
- private void fillXMLAttributes(Attributes att) {
- fAttributes.removeAllAttributes();
- final int len = att.getLength();
- for (int i = 0; i < len; ++i) {
- fillXMLAttribute(att, i);
- fAttributes.setSpecified(i, true);
- }
- }
-
- /** Fills in the XMLAttributes object. */
- private void fillXMLAttributes2(Attributes2 att) {
- fAttributes.removeAllAttributes();
- final int len = att.getLength();
- for (int i = 0; i < len; ++i) {
- fillXMLAttribute(att, i);
- fAttributes.setSpecified(i, att.isSpecified(i));
- if (att.isDeclared(i)) {
- fAttributes.getAugmentations(i).putItem(Constants.ATTRIBUTE_DECLARED, Boolean.TRUE);
- }
- }
- }
-
- /** Adds an attribute to the XMLAttributes object. */
- private void fillXMLAttribute(Attributes att, int index) {
- fillQName(fAttributeQName, att.getURI(index), att.getLocalName(index), att.getQName(index));
- String type = att.getType(index);
- fAttributes.addAttributeNS(fAttributeQName, (type != null) ? type : XMLSymbols.fCDATASymbol, att.getValue(index));
- }
-
- /**
- * {@link TypeInfoProvider} implementation.
- *
- * REVISIT: I'm not sure if this code should belong here.
- */
- private final XMLSchemaTypeInfoProvider fTypeInfoProvider = new XMLSchemaTypeInfoProvider();
- private class XMLSchemaTypeInfoProvider extends TypeInfoProvider {
-
- /** Element augmentations: contains ElementPSVI. **/
- private Augmentations fElementAugs;
-
- /** Attributes: augmentations for each attribute contain AttributePSVI. **/
- private XMLAttributes fAttributes;
-
- /** In start element. **/
- private boolean fInStartElement = false;
-
- /** In end element. **/
- private boolean fInEndElement = false;
-
- /** Initializes the TypeInfoProvider with type information for the current element. **/
- void beginStartElement(Augmentations elementAugs, XMLAttributes attributes) {
- fInStartElement = true;
- fElementAugs = elementAugs;
- fAttributes = attributes;
- }
-
- /** Cleanup at the end of start element. **/
- void finishStartElement() {
- fInStartElement = false;
- fElementAugs = null;
- fAttributes = null;
- }
-
- /** Initializes the TypeInfoProvider with type information for the current element. **/
- void beginEndElement(Augmentations elementAugs) {
- fInEndElement = true;
- fElementAugs = elementAugs;
- }
-
- /** Cleanup at the end of end element. **/
- void finishEndElement() {
- fInEndElement = false;
- fElementAugs = null;
- }
-
- /**
- * Throws a {@link IllegalStateException} if we are not in
- * the startElement callback. the JAXP API requires this
- * for most of the public methods.
- */
- private void checkState(boolean forElementInfo) {
- if (! (fInStartElement || (fInEndElement && forElementInfo))) {
- throw new IllegalStateException(JAXPValidationMessageFormatter.formatMessage(fComponentManager.getLocale(),
- "TypeInfoProviderIllegalState", null));
- }
- }
-
- public TypeInfo getAttributeTypeInfo(int index) {
- checkState(false);
- return getAttributeType(index);
- }
-
- private TypeInfo getAttributeType( int index ) {
- checkState(false);
- if( index<0 || fAttributes.getLength()<=index )
- throw new IndexOutOfBoundsException(Integer.toString(index));
- Augmentations augs = fAttributes.getAugmentations(index);
- if (augs == null) return null;
- AttributePSVI psvi = (AttributePSVI)augs.getItem(Constants.ATTRIBUTE_PSVI);
- return getTypeInfoFromPSVI(psvi);
- }
-
- public TypeInfo getAttributeTypeInfo(String attributeUri, String attributeLocalName) {
- checkState(false);
- return getAttributeTypeInfo(fAttributes.getIndex(attributeUri,attributeLocalName));
- }
-
- public TypeInfo getAttributeTypeInfo(String attributeQName) {
- checkState(false);
- return getAttributeTypeInfo(fAttributes.getIndex(attributeQName));
- }
-
- public TypeInfo getElementTypeInfo() {
- checkState(true);
- if (fElementAugs == null) return null;
- ElementPSVI psvi = (ElementPSVI)fElementAugs.getItem(Constants.ELEMENT_PSVI);
- return getTypeInfoFromPSVI(psvi);
- }
-
- private TypeInfo getTypeInfoFromPSVI( ItemPSVI psvi ) {
- if(psvi==null) return null;
-
- // TODO: make sure if this is correct.
- // TODO: since the number of types in a schema is quite limited,
- // TypeInfoImpl should be pooled. Even better, it should be a part
- // of the element decl.
- if( psvi.getValidity()== ElementPSVI.VALIDITY_VALID ) {
- XSTypeDefinition t = psvi.getMemberTypeDefinition();
- if (t != null) {
- return (t instanceof TypeInfo) ? (TypeInfo) t : null;
- }
- }
-
- XSTypeDefinition t = psvi.getTypeDefinition();
- // TODO: can t be null?
- if (t != null) {
- return (t instanceof TypeInfo) ? (TypeInfo) t : null;
- }
- return null;
- }
-
- public boolean isIdAttribute(int index) {
- checkState(false);
- XSSimpleType type = (XSSimpleType)getAttributeType(index);
- if(type==null) return false;
- return type.isIDType();
- }
-
- public boolean isSpecified(int index) {
- checkState(false);
- return fAttributes.isSpecified(index);
- }
-
- /*
- * Other methods
- */
-
- // PSVIProvider support
- ElementPSVI getElementPSVI() {
- return (fElementAugs != null) ? (ElementPSVI) fElementAugs.getItem(Constants.ELEMENT_PSVI) : null;
- }
-
- AttributePSVI getAttributePSVI(int index) {
- if (fAttributes != null) {
- Augmentations augs = fAttributes.getAugmentations(index);
- if (augs != null) {
- return (AttributePSVI) augs.getItem(Constants.ATTRIBUTE_PSVI);
- }
- }
- return null;
- }
-
- AttributePSVI getAttributePSVIByName(String uri, String localname) {
- if (fAttributes != null) {
- Augmentations augs = fAttributes.getAugmentations(uri, localname);
- if (augs != null) {
- return (AttributePSVI) augs.getItem(Constants.ATTRIBUTE_PSVI);
- }
- }
- return null;
- }
- }
-
- /** SAX adapter for an LSResourceResolver. */
- private final ResolutionForwarder fResolutionForwarder = new ResolutionForwarder(null);
- static final class ResolutionForwarder
- implements EntityResolver2 {
-
- //
- // Data
- //
-
- /** XML 1.0 type constant according to DOM L3 LS REC spec "http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/" */
- private static final String XML_TYPE = "http://www.w3.org/TR/REC-xml";
-
- /** The DOM entity resolver. */
- protected LSResourceResolver fEntityResolver;
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- public ResolutionForwarder() {}
-
- /** Wraps the specified DOM entity resolver. */
- public ResolutionForwarder(LSResourceResolver entityResolver) {
- setEntityResolver(entityResolver);
- }
-
- //
- // Public methods
- //
-
- /** Sets the DOM entity resolver. */
- public void setEntityResolver(LSResourceResolver entityResolver) {
- fEntityResolver = entityResolver;
- } // setEntityResolver(LSResourceResolver)
-
- /** Returns the DOM entity resolver. */
- public LSResourceResolver getEntityResolver() {
- return fEntityResolver;
- } // getEntityResolver():LSResourceResolver
-
- /**
- * Always returns <code>null</code>. An LSResourceResolver has no corresponding method.
- */
- public InputSource getExternalSubset(String name, String baseURI)
- throws SAXException, IOException {
- return null;
- }
-
- /**
- * Resolves the given resource and adapts the <code>LSInput</code>
- * returned into an <code>InputSource</code>.
- */
- public InputSource resolveEntity(String name, String publicId,
- String baseURI, String systemId) throws SAXException, IOException {
- if (fEntityResolver != null) {
- LSInput lsInput = fEntityResolver.resolveResource(XML_TYPE, null, publicId, systemId, baseURI);
- if (lsInput != null) {
- final String pubId = lsInput.getPublicId();
- final String sysId = lsInput.getSystemId();
- final String baseSystemId = lsInput.getBaseURI();
- final Reader charStream = lsInput.getCharacterStream();
- final InputStream byteStream = lsInput.getByteStream();
- final String data = lsInput.getStringData();
- final String encoding = lsInput.getEncoding();
-
- /**
- * An LSParser looks at inputs specified in LSInput in
- * the following order: characterStream, byteStream,
- * stringData, systemId, publicId. For consistency
- * with the DOM Level 3 Load and Save Recommendation
- * use the same lookup order here.
- */
- InputSource inputSource = new InputSource();
- inputSource.setPublicId(pubId);
- inputSource.setSystemId((baseSystemId != null) ? resolveSystemId(systemId, baseSystemId) : systemId);
-
- if (charStream != null) {
- inputSource.setCharacterStream(charStream);
- }
- else if (byteStream != null) {
- inputSource.setByteStream(byteStream);
- }
- else if (data != null && data.length() != 0) {
- inputSource.setCharacterStream(new StringReader(data));
- }
- inputSource.setEncoding(encoding);
- return inputSource;
- }
- }
- return null;
- }
-
- /** Delegates to EntityResolver2.resolveEntity(String, String, String, String). */
- public InputSource resolveEntity(String publicId, String systemId)
- throws SAXException, IOException {
- return resolveEntity(null, publicId, null, systemId);
- }
-
- /** Resolves a system identifier against a base URI. */
- private String resolveSystemId(String systemId, String baseURI) {
- try {
- return XMLEntityManager.expandSystemId(systemId, baseURI, false);
- }
- // In the event that resolution failed against the
- // base URI, just return the system id as is. There's not
- // much else we can do.
- catch (URI.MalformedURIException ex) {
- return systemId;
- }
- }
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/validation/ValidatorHelper.java b/src/com/sun/org/apache/xerces/internal/jaxp/validation/ValidatorHelper.java
deleted file mode 100644
index aac3c6d..0000000
--- a/src/com/sun/org/apache/xerces/internal/jaxp/validation/ValidatorHelper.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.jaxp.validation;
-
-import java.io.IOException;
-
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-
-import org.xml.sax.SAXException;
-
-/**
- * <p>Instances of ValidatorHelper are able to validate
- * specific source and result types.</p>
- *
- * @author Michael Glavassevich, IBM
- */
-interface ValidatorHelper {
-
- public void validate(Source source, Result result)
- throws SAXException, IOException;
-}
diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/validation/ValidatorImpl.java b/src/com/sun/org/apache/xerces/internal/jaxp/validation/ValidatorImpl.java
deleted file mode 100644
index f0d18dd..0000000
--- a/src/com/sun/org/apache/xerces/internal/jaxp/validation/ValidatorImpl.java
+++ /dev/null
@@ -1,281 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.jaxp.validation;
-
-import java.io.IOException;
-
-import javax.xml.XMLConstants;
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.transform.stax.StAXResult;
-import javax.xml.transform.stax.StAXSource;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.validation.Validator;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.util.SAXMessageFormatter;
-import com.sun.org.apache.xerces.internal.util.Status;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-import com.sun.org.apache.xerces.internal.xs.AttributePSVI;
-import com.sun.org.apache.xerces.internal.xs.ElementPSVI;
-import com.sun.org.apache.xerces.internal.xs.PSVIProvider;
-import org.w3c.dom.ls.LSResourceResolver;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
-
-/**
- * <p>Implementation of Validator for W3C XML Schemas.</p>
- *
- * @author <a href="mailto:Kohsuke.Kawaguchi@Sun.com">Kohsuke Kawaguchi</a>
- * @author Michael Glavassevich, IBM
- * @author <a href="mailto:Sunitha.Reddy@Sun.com">Sunitha Reddy</a>
- * @version $Id: ValidatorImpl.java,v 1.10 2010-11-01 04:40:08 joehw Exp $
- */
-final class ValidatorImpl extends Validator implements PSVIProvider {
-
- //
- // Data
- //
-
- /** Component manager. **/
- private XMLSchemaValidatorComponentManager fComponentManager;
-
- /** SAX validator helper. **/
- private ValidatorHandlerImpl fSAXValidatorHelper;
-
- /** DOM validator helper. **/
- private DOMValidatorHelper fDOMValidatorHelper;
-
- /** Stream validator helper. **/
- private StreamValidatorHelper fStreamValidatorHelper;
-
- /** StAX validator helper. **/
- private StAXValidatorHelper fStaxValidatorHelper;
-
- /** Flag for tracking whether features/properties changed since last reset. */
- private boolean fConfigurationChanged = false;
-
- /** Flag for tracking whether the error handler changed since last reset. */
- private boolean fErrorHandlerChanged = false;
-
- /** Flag for tracking whether the resource resolver changed since last reset. */
- private boolean fResourceResolverChanged = false;
-
- /** Support current-element-node property */
- private static final String CURRENT_ELEMENT_NODE = Constants.XERCES_PROPERTY_PREFIX + Constants.CURRENT_ELEMENT_NODE_PROPERTY;
-
- public ValidatorImpl(XSGrammarPoolContainer grammarContainer) {
- fComponentManager = new XMLSchemaValidatorComponentManager(grammarContainer);
- setErrorHandler(null);
- setResourceResolver(null);
- }
-
- public void validate(Source source, Result result)
- throws SAXException, IOException {
- if (source instanceof SAXSource) {
- // Hand off to SAX validator helper.
- if (fSAXValidatorHelper == null) {
- fSAXValidatorHelper = new ValidatorHandlerImpl(fComponentManager);
- }
- fSAXValidatorHelper.validate(source, result);
- }
- else if (source instanceof DOMSource) {
- // Hand off to DOM validator helper.
- if (fDOMValidatorHelper == null) {
- fDOMValidatorHelper = new DOMValidatorHelper(fComponentManager);
- }
- fDOMValidatorHelper.validate(source, result);
- }
- else if (source instanceof StreamSource) {
- // Hand off to stream validator helper.
- if (fStreamValidatorHelper == null) {
- fStreamValidatorHelper = new StreamValidatorHelper(fComponentManager);
- }
- fStreamValidatorHelper.validate(source, result);
- }
- else if (source instanceof StAXSource) {
- // Hand off to stax validator helper.
- if (fStaxValidatorHelper == null) {
- fStaxValidatorHelper = new StAXValidatorHelper(fComponentManager);
- }
- fStaxValidatorHelper.validate(source, result);
- }
- // Source parameter cannot be null.
- else if (source == null) {
- throw new NullPointerException(JAXPValidationMessageFormatter.formatMessage(fComponentManager.getLocale(),
- "SourceParameterNull", null));
- }
- // Source parameter must be a SAXSource, DOMSource or StreamSource
- else {
- throw new IllegalArgumentException(JAXPValidationMessageFormatter.formatMessage(fComponentManager.getLocale(),
- "SourceNotAccepted", new Object [] {source.getClass().getName()}));
- }
- }
-
- public void setErrorHandler(ErrorHandler errorHandler) {
- fErrorHandlerChanged = (errorHandler != null);
- fComponentManager.setErrorHandler(errorHandler);
- }
-
- public ErrorHandler getErrorHandler() {
- return fComponentManager.getErrorHandler();
- }
-
- public void setResourceResolver(LSResourceResolver resourceResolver) {
- fResourceResolverChanged = (resourceResolver != null);
- fComponentManager.setResourceResolver(resourceResolver);
- }
-
- public LSResourceResolver getResourceResolver() {
- return fComponentManager.getResourceResolver();
- }
-
- public boolean getFeature(String name)
- throws SAXNotRecognizedException, SAXNotSupportedException {
- if (name == null) {
- throw new NullPointerException();
- }
- try {
- return fComponentManager.getFeature(name);
- }
- catch (XMLConfigurationException e) {
- final String identifier = e.getIdentifier();
- final String key = e.getType() == Status.NOT_RECOGNIZED ?
- "feature-not-recognized" : "feature-not-supported";
- throw new SAXNotRecognizedException(
- SAXMessageFormatter.formatMessage(fComponentManager.getLocale(),
- key, new Object [] {identifier}));
- }
- }
-
- public void setFeature(String name, boolean value)
- throws SAXNotRecognizedException, SAXNotSupportedException {
- if (name == null) {
- throw new NullPointerException();
- }
- try {
- fComponentManager.setFeature(name, value);
- }
- catch (XMLConfigurationException e) {
- final String identifier = e.getIdentifier();
- final String key;
- if (e.getType() == Status.NOT_ALLOWED) {
- //for now, the identifier can only be (XMLConstants.FEATURE_SECURE_PROCESSING)
- throw new SAXNotSupportedException(
- SAXMessageFormatter.formatMessage(fComponentManager.getLocale(),
- "jaxp-secureprocessing-feature", null));
- } else if (e.getType() == Status.NOT_RECOGNIZED) {
- key = "feature-not-recognized";
- } else {
- key = "feature-not-supported";
- }
- throw new SAXNotRecognizedException(
- SAXMessageFormatter.formatMessage(fComponentManager.getLocale(),
- key, new Object [] {identifier}));
- }
- fConfigurationChanged = true;
- }
-
- public Object getProperty(String name)
- throws SAXNotRecognizedException, SAXNotSupportedException {
- if (name == null) {
- throw new NullPointerException();
- }
- //Support current-element-node; return current node if DOMSource is used.
- if (CURRENT_ELEMENT_NODE.equals(name)) {
- return (fDOMValidatorHelper != null) ? fDOMValidatorHelper.getCurrentElement() : null;
- }
- try {
- return fComponentManager.getProperty(name);
- }
- catch (XMLConfigurationException e) {
- final String identifier = e.getIdentifier();
- final String key = e.getType() == Status.NOT_RECOGNIZED ?
- "property-not-recognized" : "property-not-supported";
- throw new SAXNotRecognizedException(
- SAXMessageFormatter.formatMessage(fComponentManager.getLocale(),
- key, new Object [] {identifier}));
- }
- }
-
- public void setProperty(String name, Object object)
- throws SAXNotRecognizedException, SAXNotSupportedException {
- if (name == null) {
- throw new NullPointerException();
- }
- try {
- fComponentManager.setProperty(name, object);
- }
- catch (XMLConfigurationException e) {
- final String identifier = e.getIdentifier();
- final String key = e.getType() == Status.NOT_RECOGNIZED ?
- "property-not-recognized" : "property-not-supported";
- throw new SAXNotRecognizedException(
- SAXMessageFormatter.formatMessage(fComponentManager.getLocale(),
- key, new Object [] {identifier}));
- }
- fConfigurationChanged = true;
- }
-
- public void reset() {
- // avoid resetting features and properties if the state the validator
- // is currently in, is the same as it will be after reset.
- if (fConfigurationChanged) {
- fComponentManager.restoreInitialState();
- setErrorHandler(null);
- setResourceResolver(null);
- fConfigurationChanged = false;
- fErrorHandlerChanged = false;
- fResourceResolverChanged = false;
- }
- else {
- if (fErrorHandlerChanged) {
- setErrorHandler(null);
- fErrorHandlerChanged = false;
- }
- if (fResourceResolverChanged) {
- setResourceResolver(null);
- fResourceResolverChanged = false;
- }
- }
- }
-
- /*
- * PSVIProvider methods
- */
-
- public ElementPSVI getElementPSVI() {
- return (fSAXValidatorHelper != null) ? fSAXValidatorHelper.getElementPSVI() : null;
- }
-
- public AttributePSVI getAttributePSVI(int index) {
- return (fSAXValidatorHelper != null) ? fSAXValidatorHelper.getAttributePSVI(index) : null;
- }
-
- public AttributePSVI getAttributePSVIByName(String uri, String localname) {
- return (fSAXValidatorHelper != null) ? fSAXValidatorHelper.getAttributePSVIByName(uri, localname) : null;
- }
-
-} // ValidatorImpl
diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/validation/WeakReferenceXMLSchema.java b/src/com/sun/org/apache/xerces/internal/jaxp/validation/WeakReferenceXMLSchema.java
deleted file mode 100644
index 8399c9f..0000000
--- a/src/com/sun/org/apache/xerces/internal/jaxp/validation/WeakReferenceXMLSchema.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.jaxp.validation;
-
-import java.lang.ref.WeakReference;
-
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
-
-/**
- * <p>An implementation of Schema for W3C XML Schemas
- * that keeps a weak reference to its grammar pool. If
- * no validators currently have a reference to the
- * grammar pool, the garbage collector is free to reclaim
- * its memory.</p>
- *
- * @author Michael Glavassevich, IBM
- */
-final class WeakReferenceXMLSchema extends AbstractXMLSchema {
-
- /** Weak reference to grammar pool. */
- private WeakReference fGrammarPool = new WeakReference(null);
-
- public WeakReferenceXMLSchema() {}
-
- /*
- * XSGrammarPoolContainer methods
- */
-
- public synchronized XMLGrammarPool getGrammarPool() {
- XMLGrammarPool grammarPool = (XMLGrammarPool) fGrammarPool.get();
- // If there's no grammar pool then either we haven't created one
- // yet or the garbage collector has already cleaned out the previous one.
- if (grammarPool == null) {
- grammarPool = new SoftReferenceGrammarPool();
- fGrammarPool = new WeakReference(grammarPool);
- }
- return grammarPool;
- }
-
- public boolean isFullyComposed() {
- return false;
- }
-
-} // WeakReferenceXMLSchema
diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/validation/WrappedSAXException.java b/src/com/sun/org/apache/xerces/internal/jaxp/validation/WrappedSAXException.java
deleted file mode 100644
index 106117c..0000000
--- a/src/com/sun/org/apache/xerces/internal/jaxp/validation/WrappedSAXException.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2000-2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package com.sun.org.apache.xerces.internal.jaxp.validation;
-
-import org.xml.sax.SAXException;
-
-/**
- * Wraps {@link SAXException} and make it an unchecked exception.
- * <p>
- * Xerces XNI doesn't allow {@link SAXException} to be thrown.
- * So when the user-supplied error handler throws it,
- * it needs to be tunneled through Xerces.
- *
- * <p>
- * It is a bug if this exception "leaks" to the application.
- *
- * FIXME: use XNIException for this purpose. It's already doing this
- * kind of SAXException tunneling.
- *
- * @author
- * Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
- */
-public class WrappedSAXException extends RuntimeException {
- public final SAXException exception;
-
- WrappedSAXException( SAXException e ) {
- this.exception = e;
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchema.java b/src/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchema.java
deleted file mode 100644
index 070086a..0000000
--- a/src/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchema.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.jaxp.validation;
-
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
-
-/**
- * <p>Implementation of Schema for W3C XML Schemas.</p>
- *
- * @author Michael Glavassevich, IBM
- */
-final class XMLSchema extends AbstractXMLSchema {
-
- /** The grammar pool is immutable */
- private final XMLGrammarPool fGrammarPool;
-
- /** Constructor */
- public XMLSchema(XMLGrammarPool grammarPool) {
- fGrammarPool = grammarPool;
- }
-
- /*
- * XSGrammarPoolContainer methods
- */
-
- /**
- * <p>Returns the grammar pool contained inside the container.</p>
- *
- * @return the grammar pool contained inside the container
- */
- public XMLGrammarPool getGrammarPool() {
- return fGrammarPool;
- }
-
- /**
- * <p>Returns whether the schema components contained in this object
- * can be considered to be a fully composed schema and should be
- * used to exclusion of other schema components which may be
- * present elsewhere.</p>
- *
- * @return whether the schema components contained in this object
- * can be considered to be a fully composed schema
- */
- public boolean isFullyComposed() {
- return true;
- }
-
-} // XMLSchema
diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaFactory.java b/src/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaFactory.java
deleted file mode 100644
index 4e57170..0000000
--- a/src/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaFactory.java
+++ /dev/null
@@ -1,547 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.jaxp.validation;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-
-import javax.xml.XMLConstants;
-import javax.xml.stream.XMLEventReader;
-import javax.xml.transform.Source;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.transform.stax.StAXSource;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.validation.Schema;
-import javax.xml.validation.SchemaFactory;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader;
-import com.sun.org.apache.xerces.internal.util.DOMEntityResolverWrapper;
-import com.sun.org.apache.xerces.internal.util.DOMInputSource;
-import com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper;
-import com.sun.org.apache.xerces.internal.util.SAXInputSource;
-import com.sun.org.apache.xerces.internal.util.SAXMessageFormatter;
-import com.sun.org.apache.xerces.internal.util.StAXInputSource;
-import com.sun.org.apache.xerces.internal.util.Status;
-import com.sun.org.apache.xerces.internal.util.XMLGrammarPoolImpl;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.grammars.Grammar;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-import org.w3c.dom.Node;
-import org.w3c.dom.ls.LSResourceResolver;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
-import org.xml.sax.SAXParseException;
-
-/**
- * {@link SchemaFactory} for XML Schema.
- *
- * @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
- * @version $Id: XMLSchemaFactory.java,v 1.11 2010-11-01 04:40:08 joehw Exp $
- */
-public final class XMLSchemaFactory extends SchemaFactory {
-
- // property identifiers
-
- /** Feature identifier: schema full checking. */
- private static final String SCHEMA_FULL_CHECKING =
- Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_FULL_CHECKING;
-
- /** Property identifier: grammar pool. */
- private static final String XMLGRAMMAR_POOL =
- Constants.XERCES_PROPERTY_PREFIX + Constants.XMLGRAMMAR_POOL_PROPERTY;
-
- /** Property identifier: XMLSecurityManager. */
- private static final String SECURITY_MANAGER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SECURITY_MANAGER_PROPERTY;
-
- /** Property identifier: Security property manager. */
- private static final String XML_SECURITY_PROPERTY_MANAGER =
- Constants.XML_SECURITY_PROPERTY_MANAGER;
-
-
- //
- // Data
- //
-
- /** The XMLSchemaLoader */
- private final XMLSchemaLoader fXMLSchemaLoader = new XMLSchemaLoader();
-
- /** User-specified ErrorHandler; can be null. */
- private ErrorHandler fErrorHandler;
-
- /** The LSResrouceResolver */
- private LSResourceResolver fLSResourceResolver;
-
- /** The DOMEntityResolverWrapper */
- private final DOMEntityResolverWrapper fDOMEntityResolverWrapper;
-
- /** The ErrorHandlerWrapper */
- private ErrorHandlerWrapper fErrorHandlerWrapper;
-
- /** The SecurityManager. */
- private XMLSecurityManager fSecurityManager;
-
- /** The Security property manager. */
- private XMLSecurityPropertyManager fSecurityPropertyMgr;
-
- /** The container for the real grammar pool. */
- private XMLGrammarPoolWrapper fXMLGrammarPoolWrapper;
-
- /**
- * Indicates whether implementation parts should use
- * service loader (or similar).
- * Note the default value (false) is the safe option..
- */
- private final boolean fUseServicesMechanism;
-
-
- public XMLSchemaFactory() {
- this(true);
- }
- public static XMLSchemaFactory newXMLSchemaFactoryNoServiceLoader() {
- return new XMLSchemaFactory(false);
- }
- private XMLSchemaFactory(boolean useServicesMechanism) {
- fUseServicesMechanism = useServicesMechanism;
- fErrorHandlerWrapper = new ErrorHandlerWrapper(DraconianErrorHandler.getInstance());
- fDOMEntityResolverWrapper = new DOMEntityResolverWrapper();
- fXMLGrammarPoolWrapper = new XMLGrammarPoolWrapper();
- fXMLSchemaLoader.setFeature(SCHEMA_FULL_CHECKING, true);
- fXMLSchemaLoader.setProperty(XMLGRAMMAR_POOL, fXMLGrammarPoolWrapper);
- fXMLSchemaLoader.setEntityResolver(fDOMEntityResolverWrapper);
- fXMLSchemaLoader.setErrorHandler(fErrorHandlerWrapper);
-
- // Enable secure processing feature by default
- fSecurityManager = new XMLSecurityManager(true);
- fXMLSchemaLoader.setProperty(SECURITY_MANAGER, fSecurityManager);
-
- fSecurityPropertyMgr = new XMLSecurityPropertyManager();
- fXMLSchemaLoader.setProperty(XML_SECURITY_PROPERTY_MANAGER,
- fSecurityPropertyMgr);
- }
-
- /**
- * <p>Is specified schema supported by this <code>SchemaFactory</code>?</p>
- *
- * @param schemaLanguage Specifies the schema language which the returned <code>SchemaFactory</code> will understand.
- * <code>schemaLanguage</code> must specify a <a href="#schemaLanguage">valid</a> schema language.
- *
- * @return <code>true</code> if <code>SchemaFactory</code> supports <code>schemaLanguage</code>, else <code>false</code>.
- *
- * @throws NullPointerException If <code>schemaLanguage</code> is <code>null</code>.
- * @throws IllegalArgumentException If <code>schemaLanguage.length() == 0</code>
- * or <code>schemaLanguage</code> does not specify a <a href="#schemaLanguage">valid</a> schema language.
- */
- public boolean isSchemaLanguageSupported(String schemaLanguage) {
- if (schemaLanguage == null) {
- throw new NullPointerException(JAXPValidationMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
- "SchemaLanguageNull", null));
- }
- if (schemaLanguage.length() == 0) {
- throw new IllegalArgumentException(JAXPValidationMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
- "SchemaLanguageLengthZero", null));
- }
- // only W3C XML Schema 1.0 is supported
- return schemaLanguage.equals(XMLConstants.W3C_XML_SCHEMA_NS_URI);
- }
-
- public LSResourceResolver getResourceResolver() {
- return fLSResourceResolver;
- }
-
- public void setResourceResolver(LSResourceResolver resourceResolver) {
- fLSResourceResolver = resourceResolver;
- fDOMEntityResolverWrapper.setEntityResolver(resourceResolver);
- fXMLSchemaLoader.setEntityResolver(fDOMEntityResolverWrapper);
- }
-
- public ErrorHandler getErrorHandler() {
- return fErrorHandler;
- }
-
- public void setErrorHandler(ErrorHandler errorHandler) {
- fErrorHandler = errorHandler;
- fErrorHandlerWrapper.setErrorHandler(errorHandler != null ? errorHandler : DraconianErrorHandler.getInstance());
- fXMLSchemaLoader.setErrorHandler(fErrorHandlerWrapper);
- }
-
- public Schema newSchema( Source[] schemas ) throws SAXException {
-
- // this will let the loader store parsed Grammars into the pool.
- XMLGrammarPoolImplExtension pool = new XMLGrammarPoolImplExtension();
- fXMLGrammarPoolWrapper.setGrammarPool(pool);
-
- XMLInputSource[] xmlInputSources = new XMLInputSource[schemas.length];
- InputStream inputStream;
- Reader reader;
- for( int i=0; i<schemas.length; i++ ) {
- Source source = schemas[i];
- if (source instanceof StreamSource) {
- StreamSource streamSource = (StreamSource) source;
- String publicId = streamSource.getPublicId();
- String systemId = streamSource.getSystemId();
- inputStream = streamSource.getInputStream();
- reader = streamSource.getReader();
- xmlInputSources[i] = new XMLInputSource(publicId, systemId, null);
- xmlInputSources[i].setByteStream(inputStream);
- xmlInputSources[i].setCharacterStream(reader);
- }
- else if (source instanceof SAXSource) {
- SAXSource saxSource = (SAXSource) source;
- InputSource inputSource = saxSource.getInputSource();
- if (inputSource == null) {
- throw new SAXException(JAXPValidationMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
- "SAXSourceNullInputSource", null));
- }
- xmlInputSources[i] = new SAXInputSource(saxSource.getXMLReader(), inputSource);
- }
- else if (source instanceof DOMSource) {
- DOMSource domSource = (DOMSource) source;
- Node node = domSource.getNode();
- String systemID = domSource.getSystemId();
- xmlInputSources[i] = new DOMInputSource(node, systemID);
- }
- else if (source instanceof StAXSource) {
- StAXSource staxSource = (StAXSource) source;
- XMLEventReader eventReader = staxSource.getXMLEventReader();
- if (eventReader != null) {
- xmlInputSources[i] = new StAXInputSource(eventReader);
- }
- else {
- xmlInputSources[i] = new StAXInputSource(staxSource.getXMLStreamReader());
- }
- }
- else if (source == null) {
- throw new NullPointerException(JAXPValidationMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
- "SchemaSourceArrayMemberNull", null));
- }
- else {
- throw new IllegalArgumentException(JAXPValidationMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
- "SchemaFactorySourceUnrecognized",
- new Object [] {source.getClass().getName()}));
- }
- }
-
- try {
- fXMLSchemaLoader.loadGrammar(xmlInputSources);
- }
- catch (XNIException e) {
- // this should have been reported to users already.
- throw Util.toSAXException(e);
- }
- catch (IOException e) {
- // this hasn't been reported, so do so now.
- SAXParseException se = new SAXParseException(e.getMessage(),null,e);
- fErrorHandler.error(se);
- throw se; // and we must throw it.
- }
-
- // Clear reference to grammar pool.
- fXMLGrammarPoolWrapper.setGrammarPool(null);
-
- // Select Schema implementation based on grammar count.
- final int grammarCount = pool.getGrammarCount();
- AbstractXMLSchema schema = null;
- if (grammarCount > 1) {
- schema = new XMLSchema(new ReadOnlyGrammarPool(pool));
- }
- else if (grammarCount == 1) {
- Grammar[] grammars = pool.retrieveInitialGrammarSet(XMLGrammarDescription.XML_SCHEMA);
- schema = new SimpleXMLSchema(grammars[0]);
- }
- else {
- schema = new EmptyXMLSchema();
- }
- propagateFeatures(schema);
- propagateProperties(schema);
- return schema;
- }
-
- public Schema newSchema() throws SAXException {
- // Use a Schema that uses the system id as the equality source.
- AbstractXMLSchema schema = new WeakReferenceXMLSchema();
- propagateFeatures(schema);
- propagateProperties(schema);
- return schema;
- }
-
- public boolean getFeature(String name)
- throws SAXNotRecognizedException, SAXNotSupportedException {
- if (name == null) {
- throw new NullPointerException(JAXPValidationMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
- "FeatureNameNull", null));
- }
- if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
- return (fSecurityManager != null && fSecurityManager.isSecureProcessing());
- }
- try {
- return fXMLSchemaLoader.getFeature(name);
- }
- catch (XMLConfigurationException e) {
- String identifier = e.getIdentifier();
- if (e.getType() == Status.NOT_RECOGNIZED) {
- throw new SAXNotRecognizedException(
- SAXMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
- "feature-not-recognized", new Object [] {identifier}));
- }
- else {
- throw new SAXNotSupportedException(
- SAXMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
- "feature-not-supported", new Object [] {identifier}));
- }
- }
- }
-
- public Object getProperty(String name)
- throws SAXNotRecognizedException, SAXNotSupportedException {
- if (name == null) {
- throw new NullPointerException(JAXPValidationMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
- "ProperyNameNull", null));
- }
- if (name.equals(SECURITY_MANAGER)) {
- return fSecurityManager;
- }
- else if (name.equals(XMLGRAMMAR_POOL)) {
- throw new SAXNotSupportedException(
- SAXMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
- "property-not-supported", new Object [] {name}));
- }
- try {
- return fXMLSchemaLoader.getProperty(name);
- }
- catch (XMLConfigurationException e) {
- String identifier = e.getIdentifier();
- if (e.getType() == Status.NOT_RECOGNIZED) {
- throw new SAXNotRecognizedException(
- SAXMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
- "property-not-recognized", new Object [] {identifier}));
- }
- else {
- throw new SAXNotSupportedException(
- SAXMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
- "property-not-supported", new Object [] {identifier}));
- }
- }
- }
-
- public void setFeature(String name, boolean value)
- throws SAXNotRecognizedException, SAXNotSupportedException {
- if (name == null) {
- throw new NullPointerException(JAXPValidationMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
- "FeatureNameNull", null));
- }
- if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
- if (System.getSecurityManager() != null && (!value)) {
- throw new SAXNotSupportedException(
- SAXMessageFormatter.formatMessage(null,
- "jaxp-secureprocessing-feature", null));
- }
-
- fSecurityManager.setSecureProcessing(value);
- if (value) {
- if (Constants.IS_JDK8_OR_ABOVE) {
- fSecurityPropertyMgr.setValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD,
- XMLSecurityPropertyManager.State.FSP, Constants.EXTERNAL_ACCESS_DEFAULT_FSP);
- fSecurityPropertyMgr.setValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_SCHEMA,
- XMLSecurityPropertyManager.State.FSP, Constants.EXTERNAL_ACCESS_DEFAULT_FSP);
- }
- }
-
- fXMLSchemaLoader.setProperty(SECURITY_MANAGER, fSecurityManager);
- return;
- } else if (name.equals(Constants.ORACLE_FEATURE_SERVICE_MECHANISM)) {
- //in secure mode, let _useServicesMechanism be determined by the constructor
- if (System.getSecurityManager() != null)
- return;
- }
- try {
- fXMLSchemaLoader.setFeature(name, value);
- }
- catch (XMLConfigurationException e) {
- String identifier = e.getIdentifier();
- if (e.getType() == Status.NOT_RECOGNIZED) {
- throw new SAXNotRecognizedException(
- SAXMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
- "feature-not-recognized", new Object [] {identifier}));
- }
- else {
- throw new SAXNotSupportedException(
- SAXMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
- "feature-not-supported", new Object [] {identifier}));
- }
- }
- }
-
- public void setProperty(String name, Object object)
- throws SAXNotRecognizedException, SAXNotSupportedException {
- if (name == null) {
- throw new NullPointerException(JAXPValidationMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
- "ProperyNameNull", null));
- }
- if (name.equals(SECURITY_MANAGER)) {
- fSecurityManager = XMLSecurityManager.convert(object, fSecurityManager);
- fXMLSchemaLoader.setProperty(SECURITY_MANAGER, fSecurityManager);
- return;
- } else if (name.equals(Constants.XML_SECURITY_PROPERTY_MANAGER)) {
- if (object == null) {
- fSecurityPropertyMgr = new XMLSecurityPropertyManager();
- } else {
- fSecurityPropertyMgr = (XMLSecurityPropertyManager)object;
- }
- fXMLSchemaLoader.setProperty(Constants.XML_SECURITY_PROPERTY_MANAGER, fSecurityPropertyMgr);
- return;
- }
- else if (name.equals(XMLGRAMMAR_POOL)) {
- throw new SAXNotSupportedException(
- SAXMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
- "property-not-supported", new Object [] {name}));
- }
- try {
- //check if the property is managed by security manager
- if (fSecurityManager == null ||
- !fSecurityManager.setLimit(name, XMLSecurityManager.State.APIPROPERTY, object)) {
- //check if the property is managed by security property manager
- if (fSecurityPropertyMgr == null ||
- !fSecurityPropertyMgr.setValue(name, XMLSecurityPropertyManager.State.APIPROPERTY, object)) {
- //fall back to the existing property manager
- fXMLSchemaLoader.setProperty(name, object);
- }
- }
- }
- catch (XMLConfigurationException e) {
- String identifier = e.getIdentifier();
- if (e.getType() == Status.NOT_RECOGNIZED) {
- throw new SAXNotRecognizedException(
- SAXMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
- "property-not-recognized", new Object [] {identifier}));
- }
- else {
- throw new SAXNotSupportedException(
- SAXMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
- "property-not-supported", new Object [] {identifier}));
- }
- }
- }
-
- private void propagateFeatures(AbstractXMLSchema schema) {
- schema.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING,
- (fSecurityManager != null && fSecurityManager.isSecureProcessing()));
- schema.setFeature(Constants.ORACLE_FEATURE_SERVICE_MECHANISM, fUseServicesMechanism);
- String[] features = fXMLSchemaLoader.getRecognizedFeatures();
- for (int i = 0; i < features.length; ++i) {
- boolean state = fXMLSchemaLoader.getFeature(features[i]);
- schema.setFeature(features[i], state);
- }
- }
-
- private void propagateProperties(AbstractXMLSchema schema) {
- String[] properties = fXMLSchemaLoader.getRecognizedProperties();
- for (int i = 0; i < properties.length; ++i) {
- Object state = fXMLSchemaLoader.getProperty(properties[i]);
- schema.setProperty(properties[i], state);
- }
- }
-
-
- /**
- * Extension of XMLGrammarPoolImpl which exposes the number of
- * grammars stored in the grammar pool.
- */
- static class XMLGrammarPoolImplExtension extends XMLGrammarPoolImpl {
-
- /** Constructs a grammar pool with a default number of buckets. */
- public XMLGrammarPoolImplExtension() {
- super();
- }
-
- /** Constructs a grammar pool with a specified number of buckets. */
- public XMLGrammarPoolImplExtension(int initialCapacity) {
- super(initialCapacity);
- }
-
- /** Returns the number of grammars contained in this pool. */
- int getGrammarCount() {
- return fGrammarCount;
- }
-
- } // XMLSchemaFactory.XMLGrammarPoolImplExtension
-
- /**
- * A grammar pool which wraps another.
- */
- static class XMLGrammarPoolWrapper implements XMLGrammarPool {
-
- private XMLGrammarPool fGrammarPool;
-
- /*
- * XMLGrammarPool methods
- */
-
- public Grammar[] retrieveInitialGrammarSet(String grammarType) {
- return fGrammarPool.retrieveInitialGrammarSet(grammarType);
- }
-
- public void cacheGrammars(String grammarType, Grammar[] grammars) {
- fGrammarPool.cacheGrammars(grammarType, grammars);
- }
-
- public Grammar retrieveGrammar(XMLGrammarDescription desc) {
- return fGrammarPool.retrieveGrammar(desc);
- }
-
- public void lockPool() {
- fGrammarPool.lockPool();
- }
-
- public void unlockPool() {
- fGrammarPool.unlockPool();
- }
-
- public void clear() {
- fGrammarPool.clear();
- }
-
- /*
- * Other methods
- */
-
- void setGrammarPool(XMLGrammarPool grammarPool) {
- fGrammarPool = grammarPool;
- }
-
- XMLGrammarPool getGrammarPool() {
- return fGrammarPool;
- }
-
- } // XMLSchemaFactory.XMLGrammarPoolWrapper
-
-} // XMLSchemaFactory
diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaValidatorComponentManager.java b/src/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaValidatorComponentManager.java
deleted file mode 100644
index dcbbabd..0000000
--- a/src/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaValidatorComponentManager.java
+++ /dev/null
@@ -1,561 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.jaxp.validation;
-
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.Iterator;
-import java.util.Map;
-
-import javax.xml.XMLConstants;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.XMLEntityManager;
-import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
-import com.sun.org.apache.xerces.internal.impl.validation.ValidationManager;
-import com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator;
-import com.sun.org.apache.xerces.internal.impl.xs.XSMessageFormatter;
-import com.sun.org.apache.xerces.internal.util.DOMEntityResolverWrapper;
-import com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper;
-import com.sun.org.apache.xerces.internal.util.FeatureState;
-import com.sun.org.apache.xerces.internal.util.NamespaceSupport;
-import com.sun.org.apache.xerces.internal.util.ParserConfigurationSettings;
-import com.sun.org.apache.xerces.internal.util.PropertyState;
-import com.sun.org.apache.xerces.internal.util.Status;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager;
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponent;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-import org.w3c.dom.ls.LSResourceResolver;
-import org.xml.sax.ErrorHandler;
-
-/**
- * <p>An implementation of XMLComponentManager for a schema validator.</p>
- *
- * @author Michael Glavassevich, IBM
- * @version $Id: XMLSchemaValidatorComponentManager.java,v 1.9 2010-11-01 04:40:08 joehw Exp $
- */
-final class XMLSchemaValidatorComponentManager extends ParserConfigurationSettings implements
- XMLComponentManager {
-
- // feature identifiers
-
- /** Feature identifier: schema validation. */
- private static final String SCHEMA_VALIDATION =
- Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_VALIDATION_FEATURE;
-
- /** Feature identifier: validation. */
- private static final String VALIDATION =
- Constants.SAX_FEATURE_PREFIX + Constants.VALIDATION_FEATURE;
-
- /** Feature identifier: send element default value via characters() */
- private static final String SCHEMA_ELEMENT_DEFAULT =
- Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_ELEMENT_DEFAULT;
-
- /** Feature identifier: use grammar pool only. */
- private static final String USE_GRAMMAR_POOL_ONLY =
- Constants.XERCES_FEATURE_PREFIX + Constants.USE_GRAMMAR_POOL_ONLY_FEATURE;
-
- // property identifiers
-
- /** Property identifier: entity manager. */
- private static final String ENTITY_MANAGER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_MANAGER_PROPERTY;
-
- /** Property identifier: entity resolver. */
- private static final String ENTITY_RESOLVER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_RESOLVER_PROPERTY;
-
- /** Property identifier: error handler. */
- private static final String ERROR_HANDLER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_HANDLER_PROPERTY;
-
- /** Property identifier: error reporter. */
- private static final String ERROR_REPORTER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY;
-
- /** Property identifier: namespace context. */
- private static final String NAMESPACE_CONTEXT =
- Constants.XERCES_PROPERTY_PREFIX + Constants.NAMESPACE_CONTEXT_PROPERTY;
-
- /** Property identifier: XML Schema validator. */
- private static final String SCHEMA_VALIDATOR =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SCHEMA_VALIDATOR_PROPERTY;
-
- /** Property identifier: security manager. */
- private static final String SECURITY_MANAGER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SECURITY_MANAGER_PROPERTY;
-
- /** Property identifier: security property manager. */
- private static final String XML_SECURITY_PROPERTY_MANAGER =
- Constants.XML_SECURITY_PROPERTY_MANAGER;
-
- /** Property identifier: symbol table. */
- private static final String SYMBOL_TABLE =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY;
-
- /** Property identifier: validation manager. */
- private static final String VALIDATION_MANAGER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.VALIDATION_MANAGER_PROPERTY;
-
- /** Property identifier: grammar pool. */
- private static final String XMLGRAMMAR_POOL =
- Constants.XERCES_PROPERTY_PREFIX + Constants.XMLGRAMMAR_POOL_PROPERTY;
-
- /** Property identifier: locale. */
- private static final String LOCALE =
- Constants.XERCES_PROPERTY_PREFIX + Constants.LOCALE_PROPERTY;
-
- //
- // Data
- //
- /**
- * <p>State of secure mode.</p>
- */
- private boolean _isSecureMode = false;
-
- /**
- * fConfigUpdated is set to true if there has been any change to the configuration settings,
- * i.e a feature or a property was changed.
- */
- private boolean fConfigUpdated = true;
-
- /**
- * Tracks whether the validator should use components from
- * the grammar pool to the exclusion of all others.
- */
- private boolean fUseGrammarPoolOnly;
-
- /** Lookup map for components required for validation. **/
- private final HashMap fComponents = new HashMap();
-
- //
- // Components
- //
-
- /** Entity manager. */
- private XMLEntityManager fEntityManager;
-
- /** Error reporter. */
- private XMLErrorReporter fErrorReporter;
-
- /** Namespace context. */
- private NamespaceContext fNamespaceContext;
-
- /** XML Schema validator. */
- private XMLSchemaValidator fSchemaValidator;
-
- /** Validation manager. */
- private ValidationManager fValidationManager;
-
- //
- // Configuration
- //
-
- /** Stores initial feature values for validator reset. */
- private final HashMap fInitFeatures = new HashMap();
-
- /** Stores initial property values for validator reset. */
- private final HashMap fInitProperties = new HashMap();
-
- /** Stores the initial security manager. */
- private XMLSecurityManager fInitSecurityManager;
-
- /** Stores the initial security property manager. */
- private final XMLSecurityPropertyManager fSecurityPropertyMgr;
-
- //
- // User Objects
- //
-
- /** Application's ErrorHandler. **/
- private ErrorHandler fErrorHandler = null;
-
- /** Application's LSResourceResolver. */
- private LSResourceResolver fResourceResolver = null;
-
- /** Locale chosen by the application. */
- private Locale fLocale = null;
-
- /** Constructs a component manager suitable for Xerces' schema validator. */
- public XMLSchemaValidatorComponentManager(XSGrammarPoolContainer grammarContainer) {
- // setup components
- fEntityManager = new XMLEntityManager();
- fComponents.put(ENTITY_MANAGER, fEntityManager);
-
- fErrorReporter = new XMLErrorReporter();
- fComponents.put(ERROR_REPORTER, fErrorReporter);
-
- fNamespaceContext = new NamespaceSupport();
- fComponents.put(NAMESPACE_CONTEXT, fNamespaceContext);
-
- fSchemaValidator = new XMLSchemaValidator();
- fComponents.put(SCHEMA_VALIDATOR, fSchemaValidator);
-
- fValidationManager = new ValidationManager();
- fComponents.put(VALIDATION_MANAGER, fValidationManager);
-
- // setup other properties
- fComponents.put(ENTITY_RESOLVER, null);
- fComponents.put(ERROR_HANDLER, null);
-
- fComponents.put(SYMBOL_TABLE, new SymbolTable());
-
- // setup grammar pool
- fComponents.put(XMLGRAMMAR_POOL, grammarContainer.getGrammarPool());
- fUseGrammarPoolOnly = grammarContainer.isFullyComposed();
-
- // add schema message formatter to error reporter
- fErrorReporter.putMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN, new XSMessageFormatter());
-
- // add all recognized features and properties and apply their defaults
- addRecognizedParamsAndSetDefaults(fEntityManager, grammarContainer);
- addRecognizedParamsAndSetDefaults(fErrorReporter, grammarContainer);
- addRecognizedParamsAndSetDefaults(fSchemaValidator, grammarContainer);
-
- boolean secureProcessing = grammarContainer.getFeature(XMLConstants.FEATURE_SECURE_PROCESSING);
- if (System.getSecurityManager() != null) {
- _isSecureMode = true;
- secureProcessing = true;
- }
-
- fInitSecurityManager = (XMLSecurityManager)
- grammarContainer.getProperty(SECURITY_MANAGER);
- if (fInitSecurityManager != null ) {
- fInitSecurityManager.setSecureProcessing(secureProcessing);
- } else {
- fInitSecurityManager = new XMLSecurityManager(secureProcessing);
- }
-
- setProperty(SECURITY_MANAGER, fInitSecurityManager);
-
- //pass on properties set on SchemaFactory
- fSecurityPropertyMgr = (XMLSecurityPropertyManager)
- grammarContainer.getProperty(Constants.XML_SECURITY_PROPERTY_MANAGER);
- setProperty(XML_SECURITY_PROPERTY_MANAGER, fSecurityPropertyMgr);
- }
-
- /**
- * Returns the state of a feature.
- *
- * @param featureId The feature identifier.
- * @return true if the feature is supported
- *
- * @throws XMLConfigurationException Thrown for configuration error.
- * In general, components should
- * only throw this exception if
- * it is <strong>really</strong>
- * a critical error.
- */
- public FeatureState getFeatureState(String featureId)
- throws XMLConfigurationException {
- if (PARSER_SETTINGS.equals(featureId)) {
- return FeatureState.is(fConfigUpdated);
- }
- else if (VALIDATION.equals(featureId) || SCHEMA_VALIDATION.equals(featureId)) {
- return FeatureState.is(true);
- }
- else if (USE_GRAMMAR_POOL_ONLY.equals(featureId)) {
- return FeatureState.is(fUseGrammarPoolOnly);
- }
- else if (XMLConstants.FEATURE_SECURE_PROCESSING.equals(featureId)) {
- return FeatureState.is(fInitSecurityManager.isSecureProcessing());
- }
- else if (SCHEMA_ELEMENT_DEFAULT.equals(featureId)) {
- return FeatureState.is(true); //pre-condition: VALIDATION and SCHEMA_VALIDATION are always true
- }
- return super.getFeatureState(featureId);
- }
-
- /**
- * Set the state of a feature.
- *
- * @param featureId The unique identifier (URI) of the feature.
- * @param state The requested state of the feature (true or false).
- *
- * @exception XMLConfigurationException If the requested feature is not known.
- */
- public void setFeature(String featureId, boolean value) throws XMLConfigurationException {
- if (PARSER_SETTINGS.equals(featureId)) {
- throw new XMLConfigurationException(Status.NOT_SUPPORTED, featureId);
- }
- else if (value == false && (VALIDATION.equals(featureId) || SCHEMA_VALIDATION.equals(featureId))) {
- throw new XMLConfigurationException(Status.NOT_SUPPORTED, featureId);
- }
- else if (USE_GRAMMAR_POOL_ONLY.equals(featureId) && value != fUseGrammarPoolOnly) {
- throw new XMLConfigurationException(Status.NOT_SUPPORTED, featureId);
- }
- if (XMLConstants.FEATURE_SECURE_PROCESSING.equals(featureId)) {
- if (_isSecureMode && !value) {
- throw new XMLConfigurationException(Status.NOT_ALLOWED, XMLConstants.FEATURE_SECURE_PROCESSING);
- }
-
- fInitSecurityManager.setSecureProcessing(value);
- setProperty(SECURITY_MANAGER, fInitSecurityManager);
-
- if (value && Constants.IS_JDK8_OR_ABOVE) {
- fSecurityPropertyMgr.setValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD,
- XMLSecurityPropertyManager.State.FSP, Constants.EXTERNAL_ACCESS_DEFAULT_FSP);
- fSecurityPropertyMgr.setValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_SCHEMA,
- XMLSecurityPropertyManager.State.FSP, Constants.EXTERNAL_ACCESS_DEFAULT_FSP);
- setProperty(XML_SECURITY_PROPERTY_MANAGER, fSecurityPropertyMgr);
- }
-
- return;
- }
- fConfigUpdated = true;
- fEntityManager.setFeature(featureId, value);
- fErrorReporter.setFeature(featureId, value);
- fSchemaValidator.setFeature(featureId, value);
- if (!fInitFeatures.containsKey(featureId)) {
- boolean current = super.getFeature(featureId);
- fInitFeatures.put(featureId, current ? Boolean.TRUE : Boolean.FALSE);
- }
- super.setFeature(featureId, value);
- }
-
- /**
- * Returns the value of a property.
- *
- * @param propertyId The property identifier.
- * @return the value of the property
- *
- * @throws XMLConfigurationException Thrown for configuration error.
- * In general, components should
- * only throw this exception if
- * it is <strong>really</strong>
- * a critical error.
- */
- public PropertyState getPropertyState(String propertyId)
- throws XMLConfigurationException {
- if (LOCALE.equals(propertyId)) {
- return PropertyState.is(getLocale());
- }
- final Object component = fComponents.get(propertyId);
- if (component != null) {
- return PropertyState.is(component);
- }
- else if (fComponents.containsKey(propertyId)) {
- return PropertyState.is(null);
- }
- return super.getPropertyState(propertyId);
- }
-
- /**
- * Sets the state of a property.
- *
- * @param propertyId The unique identifier (URI) of the property.
- * @param value The requested state of the property.
- *
- * @exception XMLConfigurationException If the requested property is not known.
- */
- public void setProperty(String propertyId, Object value) throws XMLConfigurationException {
- if ( ENTITY_MANAGER.equals(propertyId) || ERROR_REPORTER.equals(propertyId) ||
- NAMESPACE_CONTEXT.equals(propertyId) || SCHEMA_VALIDATOR.equals(propertyId) ||
- SYMBOL_TABLE.equals(propertyId) || VALIDATION_MANAGER.equals(propertyId) ||
- XMLGRAMMAR_POOL.equals(propertyId)) {
- throw new XMLConfigurationException(Status.NOT_SUPPORTED, propertyId);
- }
- fConfigUpdated = true;
- fEntityManager.setProperty(propertyId, value);
- fErrorReporter.setProperty(propertyId, value);
- fSchemaValidator.setProperty(propertyId, value);
- if (ENTITY_RESOLVER.equals(propertyId) || ERROR_HANDLER.equals(propertyId) ||
- SECURITY_MANAGER.equals(propertyId)) {
- fComponents.put(propertyId, value);
- return;
- }
- else if (LOCALE.equals(propertyId)) {
- setLocale((Locale) value);
- fComponents.put(propertyId, value);
- return;
- }
- //check if the property is managed by security manager
- if (fInitSecurityManager == null ||
- !fInitSecurityManager.setLimit(propertyId, XMLSecurityManager.State.APIPROPERTY, value)) {
- //check if the property is managed by security property manager
- if (fSecurityPropertyMgr == null ||
- !fSecurityPropertyMgr.setValue(propertyId, XMLSecurityPropertyManager.State.APIPROPERTY, value)) {
- //fall back to the existing property manager
- if (!fInitProperties.containsKey(propertyId)) {
- fInitProperties.put(propertyId, super.getProperty(propertyId));
- }
- super.setProperty(propertyId, value);
- }
- }
- }
-
- /**
- * Adds all of the component's recognized features and properties
- * to the list of default recognized features and properties, and
- * sets default values on the configuration for features and
- * properties which were previously absent from the configuration.
- *
- * @param component The component whose recognized features
- * and properties will be added to the configuration
- */
- public void addRecognizedParamsAndSetDefaults(XMLComponent component, XSGrammarPoolContainer grammarContainer) {
-
- // register component's recognized features
- final String[] recognizedFeatures = component.getRecognizedFeatures();
- addRecognizedFeatures(recognizedFeatures);
-
- // register component's recognized properties
- final String[] recognizedProperties = component.getRecognizedProperties();
- addRecognizedProperties(recognizedProperties);
-
- // set default values
- setFeatureDefaults(component, recognizedFeatures, grammarContainer);
- setPropertyDefaults(component, recognizedProperties);
- }
-
- /** Calls reset on each of the components owned by this component manager. **/
- public void reset() throws XNIException {
- fNamespaceContext.reset();
- fValidationManager.reset();
- fEntityManager.reset(this);
- fErrorReporter.reset(this);
- fSchemaValidator.reset(this);
- // Mark configuration as fixed.
- fConfigUpdated = false;
- }
-
- void setErrorHandler(ErrorHandler errorHandler) {
- fErrorHandler = errorHandler;
- setProperty(ERROR_HANDLER, (errorHandler != null) ? new ErrorHandlerWrapper(errorHandler) :
- new ErrorHandlerWrapper(DraconianErrorHandler.getInstance()));
- }
-
- ErrorHandler getErrorHandler() {
- return fErrorHandler;
- }
-
- void setResourceResolver(LSResourceResolver resourceResolver) {
- fResourceResolver = resourceResolver;
- setProperty(ENTITY_RESOLVER, new DOMEntityResolverWrapper(resourceResolver));
- }
-
- LSResourceResolver getResourceResolver() {
- return fResourceResolver;
- }
-
- void setLocale(Locale locale) {
- fLocale = locale;
- fErrorReporter.setLocale(locale);
- }
-
- Locale getLocale() {
- return fLocale;
- }
-
- /** Cleans out configuration, restoring it to its initial state. */
- void restoreInitialState() {
- fConfigUpdated = true;
-
- // Remove error resolver and error handler
- fComponents.put(ENTITY_RESOLVER, null);
- fComponents.put(ERROR_HANDLER, null);
-
- // Set the Locale back to null.
- setLocale(null);
- fComponents.put(LOCALE, null);
-
- // Restore initial security manager
- fComponents.put(SECURITY_MANAGER, fInitSecurityManager);
-
- // Set the Locale back to null.
- setLocale(null);
- fComponents.put(LOCALE, null);
-
- // Reset feature and property values to their initial values
- if (!fInitFeatures.isEmpty()) {
- Iterator iter = fInitFeatures.entrySet().iterator();
- while (iter.hasNext()) {
- Map.Entry entry = (Map.Entry) iter.next();
- String name = (String) entry.getKey();
- boolean value = ((Boolean) entry.getValue()).booleanValue();
- super.setFeature(name, value);
- }
- fInitFeatures.clear();
- }
- if (!fInitProperties.isEmpty()) {
- Iterator iter = fInitProperties.entrySet().iterator();
- while (iter.hasNext()) {
- Map.Entry entry = (Map.Entry) iter.next();
- String name = (String) entry.getKey();
- Object value = entry.getValue();
- super.setProperty(name, value);
- }
- fInitProperties.clear();
- }
- }
-
- /** Sets feature defaults for the given component on this configuration. */
- private void setFeatureDefaults(final XMLComponent component,
- final String [] recognizedFeatures, XSGrammarPoolContainer grammarContainer) {
- if (recognizedFeatures != null) {
- for (int i = 0; i < recognizedFeatures.length; ++i) {
- String featureId = recognizedFeatures[i];
- Boolean state = grammarContainer.getFeature(featureId);
- if (state == null) {
- state = component.getFeatureDefault(featureId);
- }
- if (state != null) {
- // Do not overwrite values already set on the configuration.
- if (!fFeatures.containsKey(featureId)) {
- fFeatures.put(featureId, state);
- // For newly added components who recognize this feature
- // but did not offer a default value, we need to make
- // sure these components will get an opportunity to read
- // the value before parsing begins.
- fConfigUpdated = true;
- }
- }
- }
- }
- }
-
- /** Sets property defaults for the given component on this configuration. */
- private void setPropertyDefaults(final XMLComponent component, final String [] recognizedProperties) {
- if (recognizedProperties != null) {
- for (int i = 0; i < recognizedProperties.length; ++i) {
- String propertyId = recognizedProperties[i];
- Object value = component.getPropertyDefault(propertyId);
- if (value != null) {
- // Do not overwrite values already set on the configuration.
- if (!fProperties.containsKey(propertyId)) {
- fProperties.put(propertyId, value);
- // For newly added components who recognize this property
- // but did not offer a default value, we need to make
- // sure these components will get an opportunity to read
- // the value before parsing begins.
- fConfigUpdated = true;
- }
- }
- }
- }
- }
-
-} // XMLSchemaValidatorComponentManager
diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/validation/XSGrammarPoolContainer.java b/src/com/sun/org/apache/xerces/internal/jaxp/validation/XSGrammarPoolContainer.java
deleted file mode 100644
index 79ef559..0000000
--- a/src/com/sun/org/apache/xerces/internal/jaxp/validation/XSGrammarPoolContainer.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.jaxp.validation;
-
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
-
-/**
- * <p>A container for grammar pools which only contain schema grammars.</p>
- *
- * @author Michael Glavassevich, IBM
- * @version $Id: XSGrammarPoolContainer.java,v 1.6 2010-11-01 04:40:08 joehw Exp $
- */
-public interface XSGrammarPoolContainer {
-
- /**
- * <p>Returns the grammar pool contained inside the container.</p>
- *
- * @return the grammar pool contained inside the container
- */
- public XMLGrammarPool getGrammarPool();
-
- /**
- * <p>Returns whether the schema components contained in this object
- * can be considered to be a fully composed schema and should be
- * used to the exclusion of other schema components which may be
- * present elsewhere.</p>
- *
- * @return whether the schema components contained in this object
- * can be considered to be a fully composed schema
- */
- public boolean isFullyComposed();
-
- /**
- * Returns the initial value of a feature for validators created
- * using this grammar pool container or null if the validators
- * should use the default value.
- */
- public Boolean getFeature(String featureId);
-
- /*
- * Set a feature on the schema
- */
- public void setFeature(String featureId, boolean state);
-
- /**
- * Returns the initial value of a property for validators created
- * using this grammar pool container or null if the validators
- * should use the default value.
- */
- public Object getProperty(String propertyId);
-
- /*
- * Set a property on the schema
- */
- public void setProperty(String propertyId, Object state);
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/validation/javax.xml.validation.SchemaFactory b/src/com/sun/org/apache/xerces/internal/jaxp/validation/javax.xml.validation.SchemaFactory
deleted file mode 100644
index 51d33a6..0000000
--- a/src/com/sun/org/apache/xerces/internal/jaxp/validation/javax.xml.validation.SchemaFactory
+++ /dev/null
@@ -1 +0,0 @@
-com.sun.org.apache.xerces.internal.jaxp.validation.XMLSchemaFactory
diff --git a/src/com/sun/org/apache/xerces/internal/parsers/AbstractDOMParser.java b/src/com/sun/org/apache/xerces/internal/parsers/AbstractDOMParser.java
deleted file mode 100644
index 88ea951..0000000
--- a/src/com/sun/org/apache/xerces/internal/parsers/AbstractDOMParser.java
+++ /dev/null
@@ -1,2657 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.parsers;
-
-import java.util.Locale;
-import java.util.Stack;
-
-import com.sun.org.apache.xerces.internal.dom.AttrImpl;
-import com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl;
-import com.sun.org.apache.xerces.internal.dom.DOMErrorImpl;
-import com.sun.org.apache.xerces.internal.dom.DOMMessageFormatter;
-import com.sun.org.apache.xerces.internal.dom.DeferredDocumentImpl;
-import com.sun.org.apache.xerces.internal.dom.DocumentImpl;
-import com.sun.org.apache.xerces.internal.dom.DocumentTypeImpl;
-import com.sun.org.apache.xerces.internal.dom.ElementDefinitionImpl;
-import com.sun.org.apache.xerces.internal.dom.ElementImpl;
-import com.sun.org.apache.xerces.internal.dom.ElementNSImpl;
-import com.sun.org.apache.xerces.internal.dom.EntityImpl;
-import com.sun.org.apache.xerces.internal.dom.EntityReferenceImpl;
-import com.sun.org.apache.xerces.internal.dom.NodeImpl;
-import com.sun.org.apache.xerces.internal.dom.NotationImpl;
-import com.sun.org.apache.xerces.internal.dom.PSVIAttrNSImpl;
-import com.sun.org.apache.xerces.internal.dom.PSVIDocumentImpl;
-import com.sun.org.apache.xerces.internal.dom.PSVIElementNSImpl;
-import com.sun.org.apache.xerces.internal.dom.TextImpl;
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType;
-import com.sun.org.apache.xerces.internal.util.DOMErrorHandlerWrapper;
-import com.sun.org.apache.xerces.internal.xni.Augmentations;
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
-import com.sun.org.apache.xerces.internal.xni.XMLLocator;
-import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
-import com.sun.org.apache.xerces.internal.xni.XMLString;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration;
-import com.sun.org.apache.xerces.internal.xs.AttributePSVI;
-import com.sun.org.apache.xerces.internal.xs.ElementPSVI;
-import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
-import com.sun.org.apache.xerces.internal.utils.ObjectFactory;
-import org.w3c.dom.Attr;
-import org.w3c.dom.CDATASection;
-import org.w3c.dom.Comment;
-import org.w3c.dom.DOMError;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.EntityReference;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.ProcessingInstruction;
-import org.w3c.dom.Text;
-import org.w3c.dom.ls.LSParserFilter;
-import org.w3c.dom.traversal.NodeFilter;
-import org.xml.sax.SAXException;
-
-/**
- * This is the base class of all DOM parsers. It implements the XNI
- * callback methods to create the DOM tree. After a successful parse of
- * an XML document, the DOM Document object can be queried using the
- * <code>getDocument</code> method. The actual pipeline is defined in
- * parser configuration.
- *
- * @author Arnaud Le Hors, IBM
- * @author Andy Clark, IBM
- * @author Elena Litani, IBM
- *
- * @version $Id: AbstractDOMParser.java,v 1.10 2010-11-01 04:40:09 joehw Exp $
- */
-public class AbstractDOMParser extends AbstractXMLDocumentParser {
-
- //
- // Constants
- //
-
- // feature ids
-
- /** Feature id: namespace. */
- protected static final String NAMESPACES =
- Constants.SAX_FEATURE_PREFIX+Constants.NAMESPACES_FEATURE;
-
- /** Feature id: create entity ref nodes. */
- protected static final String CREATE_ENTITY_REF_NODES =
- Constants.XERCES_FEATURE_PREFIX + Constants.CREATE_ENTITY_REF_NODES_FEATURE;
-
- /** Feature id: include comments. */
- protected static final String INCLUDE_COMMENTS_FEATURE =
- Constants.XERCES_FEATURE_PREFIX + Constants.INCLUDE_COMMENTS_FEATURE;
-
- /** Feature id: create cdata nodes. */
- protected static final String CREATE_CDATA_NODES_FEATURE =
- Constants.XERCES_FEATURE_PREFIX + Constants.CREATE_CDATA_NODES_FEATURE;
-
- /** Feature id: include ignorable whitespace. */
- protected static final String INCLUDE_IGNORABLE_WHITESPACE =
- Constants.XERCES_FEATURE_PREFIX + Constants.INCLUDE_IGNORABLE_WHITESPACE;
-
- /** Feature id: defer node expansion. */
- protected static final String DEFER_NODE_EXPANSION =
- Constants.XERCES_FEATURE_PREFIX + Constants.DEFER_NODE_EXPANSION_FEATURE;
-
-
- /** Recognized features. */
- private static final String[] RECOGNIZED_FEATURES = {
- NAMESPACES,
- CREATE_ENTITY_REF_NODES,
- INCLUDE_COMMENTS_FEATURE,
- CREATE_CDATA_NODES_FEATURE,
- INCLUDE_IGNORABLE_WHITESPACE,
- DEFER_NODE_EXPANSION
- };
-
- // property ids
-
- /** Property id: document class name. */
- protected static final String DOCUMENT_CLASS_NAME =
- Constants.XERCES_PROPERTY_PREFIX + Constants.DOCUMENT_CLASS_NAME_PROPERTY;
-
- protected static final String CURRENT_ELEMENT_NODE=
- Constants.XERCES_PROPERTY_PREFIX + Constants.CURRENT_ELEMENT_NODE_PROPERTY;
-
- // protected static final String GRAMMAR_POOL =
- // Constants.XERCES_PROPERTY_PREFIX + Constants.XMLGRAMMAR_POOL_PROPERTY;
-
- /** Recognized properties. */
- private static final String[] RECOGNIZED_PROPERTIES = {
- DOCUMENT_CLASS_NAME,
- CURRENT_ELEMENT_NODE,
- };
-
- // other
-
- /** Default document class name. */
- protected static final String DEFAULT_DOCUMENT_CLASS_NAME =
- "com.sun.org.apache.xerces.internal.dom.DocumentImpl";
-
- protected static final String CORE_DOCUMENT_CLASS_NAME =
- "com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl";
-
- protected static final String PSVI_DOCUMENT_CLASS_NAME =
- "com.sun.org.apache.xerces.internal.dom.PSVIDocumentImpl";
-
- /**
- * If the user stops the process, this exception will be thrown.
- */
- static final class Abort extends RuntimeException {
- private static final long serialVersionUID = 1687848994976808490L;
- static final Abort INSTANCE = new Abort();
- private Abort() {}
- public Throwable fillInStackTrace() {
- return this;
- }
- }
-
- // debugging
-
- private static final boolean DEBUG_EVENTS = false;
- private static final boolean DEBUG_BASEURI = false;
-
- //
- // Data
- //
-
- /** DOM L3 error handler */
- protected DOMErrorHandlerWrapper fErrorHandler = null;
-
- /** True if inside DTD. */
- protected boolean fInDTD;
-
- // features
-
- /** Create entity reference nodes. */
- protected boolean fCreateEntityRefNodes;
-
- /** Include ignorable whitespace. */
- protected boolean fIncludeIgnorableWhitespace;
-
- /** Include Comments. */
- protected boolean fIncludeComments;
-
- /** Create cdata nodes. */
- protected boolean fCreateCDATANodes;
-
- // dom information
-
- /** The document. */
- protected Document fDocument;
-
- /** The default Xerces document implementation, if used. */
- protected CoreDocumentImpl fDocumentImpl;
-
- /** Whether to store PSVI information in DOM tree. */
- protected boolean fStorePSVI;
-
- /** The document class name to use. */
- protected String fDocumentClassName;
-
- /** The document type node. */
- protected DocumentType fDocumentType;
-
- /** Current node. */
- protected Node fCurrentNode;
- protected CDATASection fCurrentCDATASection;
- protected EntityImpl fCurrentEntityDecl;
- protected int fDeferredEntityDecl;
-
- /** Character buffer */
- protected final StringBuilder fStringBuilder = new StringBuilder (50);
-
- // internal subset
-
- /** Internal subset buffer. */
- protected StringBuilder fInternalSubset;
-
- // deferred expansion data
-
- protected boolean fDeferNodeExpansion;
- protected boolean fNamespaceAware;
- protected DeferredDocumentImpl fDeferredDocumentImpl;
- protected int fDocumentIndex;
- protected int fDocumentTypeIndex;
- protected int fCurrentNodeIndex;
- protected int fCurrentCDATASectionIndex;
-
- // state
-
- /** True if inside DTD external subset. */
- protected boolean fInDTDExternalSubset;
-
- /** Root element node. */
- protected Node fRoot;
-
- /** True if inside CDATA section. */
- protected boolean fInCDATASection;
-
- /** True if saw the first chunk of characters*/
- protected boolean fFirstChunk = false;
-
-
- /** LSParserFilter: specifies that element with given QNAME and all its children
- * must be rejected */
- protected boolean fFilterReject = false;
-
- // data
-
- /** Base uri stack*/
- protected final Stack fBaseURIStack = new Stack ();
-
- /** LSParserFilter: tracks the element depth within a rejected subtree. */
- protected int fRejectedElementDepth = 0;
-
- /** LSParserFilter: store depth of skipped elements */
- protected Stack fSkippedElemStack = null;
-
- /** LSParserFilter: true if inside entity reference */
- protected boolean fInEntityRef = false;
-
- /** Attribute QName. */
- private final QName fAttrQName = new QName();
-
- /** Document locator. */
- private XMLLocator fLocator;
-
- // handlers
-
- protected LSParserFilter fDOMFilter = null;
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- protected AbstractDOMParser (XMLParserConfiguration config) {
-
- super (config);
-
-
- // add recognized features
- fConfiguration.addRecognizedFeatures (RECOGNIZED_FEATURES);
-
- // set default values
- fConfiguration.setFeature (CREATE_ENTITY_REF_NODES, true);
- fConfiguration.setFeature (INCLUDE_IGNORABLE_WHITESPACE, true);
- fConfiguration.setFeature (DEFER_NODE_EXPANSION, true);
- fConfiguration.setFeature (INCLUDE_COMMENTS_FEATURE, true);
- fConfiguration.setFeature (CREATE_CDATA_NODES_FEATURE, true);
-
- // add recognized properties
- fConfiguration.addRecognizedProperties (RECOGNIZED_PROPERTIES);
-
- // set default values
- fConfiguration.setProperty (DOCUMENT_CLASS_NAME,
- DEFAULT_DOCUMENT_CLASS_NAME);
-
- } // <init>(XMLParserConfiguration)
-
- /**
- * This method retrieves the name of current document class.
- */
- protected String getDocumentClassName () {
- return fDocumentClassName;
- }
-
- /**
- * This method allows the programmer to decide which document
- * factory to use when constructing the DOM tree. However, doing
- * so will lose the functionality of the default factory. Also,
- * a document class other than the default will lose the ability
- * to defer node expansion on the DOM tree produced.
- *
- * @param documentClassName The fully qualified class name of the
- * document factory to use when constructing
- * the DOM tree.
- *
- * @see #getDocumentClassName
- * @see #DEFAULT_DOCUMENT_CLASS_NAME
- */
- protected void setDocumentClassName (String documentClassName) {
-
- // normalize class name
- if (documentClassName == null) {
- documentClassName = DEFAULT_DOCUMENT_CLASS_NAME;
- }
-
- if (!documentClassName.equals(DEFAULT_DOCUMENT_CLASS_NAME) &&
- !documentClassName.equals(PSVI_DOCUMENT_CLASS_NAME)) {
- // verify that this class exists and is of the right type
- try {
- Class _class = ObjectFactory.findProviderClass (documentClassName, true);
- //if (!_class.isAssignableFrom(Document.class)) {
- if (!Document.class.isAssignableFrom (_class)) {
- throw new IllegalArgumentException (
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "InvalidDocumentClassName", new Object [] {documentClassName}));
- }
- }
- catch (ClassNotFoundException e) {
- throw new IllegalArgumentException (
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "MissingDocumentClassName", new Object [] {documentClassName}));
- }
- }
-
- // set document class name
- fDocumentClassName = documentClassName;
- if (!documentClassName.equals (DEFAULT_DOCUMENT_CLASS_NAME)) {
- fDeferNodeExpansion = false;
- }
-
- } // setDocumentClassName(String)
-
- //
- // Public methods
- //
-
- /** Returns the DOM document object. */
- public Document getDocument () {
- return fDocument;
- } // getDocument():Document
-
- /**
- * Drops all references to the last DOM which was built by this parser.
- */
- public final void dropDocumentReferences() {
- fDocument = null;
- fDocumentImpl = null;
- fDeferredDocumentImpl = null;
- fDocumentType = null;
- fCurrentNode = null;
- fCurrentCDATASection = null;
- fCurrentEntityDecl = null;
- fRoot = null;
- } // dropDocumentReferences()
-
- //
- // XMLDocumentParser methods
- //
-
- /**
- * Resets the parser state.
- *
- * @throws SAXException Thrown on initialization error.
- */
- public void reset () throws XNIException {
- super.reset ();
-
-
- // get feature state
- fCreateEntityRefNodes =
- fConfiguration.getFeature (CREATE_ENTITY_REF_NODES);
-
- fIncludeIgnorableWhitespace =
- fConfiguration.getFeature (INCLUDE_IGNORABLE_WHITESPACE);
-
- fDeferNodeExpansion =
- fConfiguration.getFeature (DEFER_NODE_EXPANSION);
-
- fNamespaceAware = fConfiguration.getFeature (NAMESPACES);
-
- fIncludeComments = fConfiguration.getFeature (INCLUDE_COMMENTS_FEATURE);
-
- fCreateCDATANodes = fConfiguration.getFeature (CREATE_CDATA_NODES_FEATURE);
-
- // get property
- setDocumentClassName ((String)
- fConfiguration.getProperty (DOCUMENT_CLASS_NAME));
-
- // reset dom information
- fDocument = null;
- fDocumentImpl = null;
- fStorePSVI = false;
- fDocumentType = null;
- fDocumentTypeIndex = -1;
- fDeferredDocumentImpl = null;
- fCurrentNode = null;
-
- // reset string buffer
- fStringBuilder.setLength (0);
-
- // reset state information
- fRoot = null;
- fInDTD = false;
- fInDTDExternalSubset = false;
- fInCDATASection = false;
- fFirstChunk = false;
- fCurrentCDATASection = null;
- fCurrentCDATASectionIndex = -1;
-
- fBaseURIStack.removeAllElements ();
-
-
- } // reset()
-
- /**
- * Set the locale to use for messages.
- *
- * @param locale The locale object to use for localization of messages.
- *
- */
- public void setLocale (Locale locale) {
- fConfiguration.setLocale (locale);
-
- } // setLocale(Locale)
-
- //
- // XMLDocumentHandler methods
- //
-
- /**
- * This method notifies the start of a general entity.
- * <p>
- * <strong>Note:</strong> This method is not called for entity references
- * appearing as part of attribute values.
- *
- * @param name The name of the general entity.
- * @param identifier The resource identifier.
- * @param encoding The auto-detected IANA encoding name of the entity
- * stream. This value will be null in those situations
- * where the entity encoding is not auto-detected (e.g.
- * internal entities or a document entity that is
- * parsed from a java.io.Reader).
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException Thrown by handler to signal an error.
- */
- public void startGeneralEntity (String name,
- XMLResourceIdentifier identifier,
- String encoding, Augmentations augs)
- throws XNIException {
- if (DEBUG_EVENTS) {
- System.out.println ("==>startGeneralEntity ("+name+")");
- if (DEBUG_BASEURI) {
- System.out.println (" expandedSystemId( **baseURI): "+identifier.getExpandedSystemId ());
- System.out.println (" baseURI:"+ identifier.getBaseSystemId ());
- }
- }
-
- // Always create entity reference nodes to be able to recreate
- // entity as a part of doctype
- if (!fDeferNodeExpansion) {
- if (fFilterReject) {
- return;
- }
- setCharacterData (true);
- EntityReference er = fDocument.createEntityReference (name);
- if (fDocumentImpl != null) {
- // REVISIT: baseURI/actualEncoding
- // remove dependency on our implementation when DOM L3 is REC
- //
-
- EntityReferenceImpl erImpl =(EntityReferenceImpl)er;
-
- // set base uri
- erImpl.setBaseURI (identifier.getExpandedSystemId ());
- if (fDocumentType != null) {
- // set actual encoding
- NamedNodeMap entities = fDocumentType.getEntities ();
- fCurrentEntityDecl = (EntityImpl) entities.getNamedItem (name);
- if (fCurrentEntityDecl != null) {
- fCurrentEntityDecl.setInputEncoding (encoding);
- }
-
- }
- // we don't need synchronization now, because entity ref will be
- // expanded anyway. Synch only needed when user creates entityRef node
- erImpl.needsSyncChildren (false);
- }
- fInEntityRef = true;
- fCurrentNode.appendChild (er);
- fCurrentNode = er;
- }
- else {
-
- int er =
- fDeferredDocumentImpl.createDeferredEntityReference (name, identifier.getExpandedSystemId ());
- if (fDocumentTypeIndex != -1) {
- // find corresponding Entity decl
- int node = fDeferredDocumentImpl.getLastChild (fDocumentTypeIndex, false);
- while (node != -1) {
- short nodeType = fDeferredDocumentImpl.getNodeType (node, false);
- if (nodeType == Node.ENTITY_NODE) {
- String nodeName =
- fDeferredDocumentImpl.getNodeName (node, false);
- if (nodeName.equals (name)) {
- fDeferredEntityDecl = node;
- fDeferredDocumentImpl.setInputEncoding (node, encoding);
- break;
- }
- }
- node = fDeferredDocumentImpl.getRealPrevSibling (node, false);
- }
- }
- fDeferredDocumentImpl.appendChild (fCurrentNodeIndex, er);
- fCurrentNodeIndex = er;
- }
-
- } // startGeneralEntity(String,XMLResourceIdentifier, Augmentations)
-
- /**
- * Notifies of the presence of a TextDecl line in an entity. If present,
- * this method will be called immediately following the startEntity call.
- * <p>
- * <strong>Note:</strong> This method will never be called for the
- * document entity; it is only called for external general entities
- * referenced in document content.
- * <p>
- * <strong>Note:</strong> This method is not called for entity references
- * appearing as part of attribute values.
- *
- * @param version The XML version, or null if not specified.
- * @param encoding The IANA encoding name of the entity.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void textDecl (String version, String encoding, Augmentations augs) throws XNIException {
- if (fInDTD){
- return;
- }
- if (!fDeferNodeExpansion) {
- if (fCurrentEntityDecl != null && !fFilterReject) {
- fCurrentEntityDecl.setXmlEncoding (encoding);
- if (version != null)
- fCurrentEntityDecl.setXmlVersion (version);
- }
- }
- else {
- if (fDeferredEntityDecl !=-1) {
- fDeferredDocumentImpl.setEntityInfo (fDeferredEntityDecl, version, encoding);
- }
- }
- } // textDecl(String,String)
-
- /**
- * A comment.
- *
- * @param text The text in the comment.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by application to signal an error.
- */
- public void comment (XMLString text, Augmentations augs) throws XNIException {
- if (fInDTD) {
- if (fInternalSubset != null && !fInDTDExternalSubset) {
- fInternalSubset.append ("<!--");
- if (text.length > 0) {
- fInternalSubset.append (text.ch, text.offset, text.length);
- }
- fInternalSubset.append ("-->");
- }
- return;
- }
- if (!fIncludeComments || fFilterReject) {
- return;
- }
- if (!fDeferNodeExpansion) {
- Comment comment = fDocument.createComment (text.toString ());
-
- setCharacterData (false);
- fCurrentNode.appendChild (comment);
- if (fDOMFilter !=null && !fInEntityRef &&
- (fDOMFilter.getWhatToShow () & NodeFilter.SHOW_COMMENT)!= 0) {
- short code = fDOMFilter.acceptNode (comment);
- switch (code) {
- case LSParserFilter.FILTER_INTERRUPT:{
- throw Abort.INSTANCE;
- }
- case LSParserFilter.FILTER_REJECT:{
- // REVISIT: the constant FILTER_REJECT should be changed when new
- // DOM LS specs gets published
-
- // fall through to SKIP since comment has no children.
- }
- case LSParserFilter.FILTER_SKIP: {
- // REVISIT: the constant FILTER_SKIP should be changed when new
- // DOM LS specs gets published
- fCurrentNode.removeChild (comment);
- // make sure we don't loose chars if next event is characters()
- fFirstChunk = true;
- return;
- }
-
- default: {
- // accept node
- }
- }
- }
-
- }
- else {
- int comment =
- fDeferredDocumentImpl.createDeferredComment (text.toString ());
- fDeferredDocumentImpl.appendChild (fCurrentNodeIndex, comment);
- }
-
- } // comment(XMLString)
-
- /**
- * A processing instruction. Processing instructions consist of a
- * target name and, optionally, text data. The data is only meaningful
- * to the application.
- * <p>
- * Typically, a processing instruction's data will contain a series
- * of pseudo-attributes. These pseudo-attributes follow the form of
- * element attributes but are <strong>not</strong> parsed or presented
- * to the application as anything other than text. The application is
- * responsible for parsing the data.
- *
- * @param target The target.
- * @param data The data or null if none specified.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void processingInstruction (String target, XMLString data, Augmentations augs)
- throws XNIException {
-
- if (fInDTD) {
- if (fInternalSubset != null && !fInDTDExternalSubset) {
- fInternalSubset.append ("<?");
- fInternalSubset.append (target);
- if (data.length > 0) {
- fInternalSubset.append (' ').append (data.ch, data.offset, data.length);
- }
- fInternalSubset.append ("?>");
- }
- return;
- }
-
- if (DEBUG_EVENTS) {
- System.out.println ("==>processingInstruction ("+target+")");
- }
- if (!fDeferNodeExpansion) {
- if (fFilterReject) {
- return;
- }
- ProcessingInstruction pi =
- fDocument.createProcessingInstruction (target, data.toString ());
-
-
- setCharacterData (false);
- fCurrentNode.appendChild (pi);
- if (fDOMFilter !=null && !fInEntityRef &&
- (fDOMFilter.getWhatToShow () & NodeFilter.SHOW_PROCESSING_INSTRUCTION)!= 0) {
- short code = fDOMFilter.acceptNode (pi);
- switch (code) {
- case LSParserFilter.FILTER_INTERRUPT:{
- throw Abort.INSTANCE;
- }
- case LSParserFilter.FILTER_REJECT:{
- // fall through to SKIP since PI has no children.
- }
- case LSParserFilter.FILTER_SKIP: {
- fCurrentNode.removeChild (pi);
- // fFirstChunk must be set to true so that data
- // won't be lost in the case where the child before PI is
- // a text node and the next event is characters.
- fFirstChunk = true;
- return;
- }
- default: {
- }
- }
- }
- }
- else {
- int pi = fDeferredDocumentImpl.
- createDeferredProcessingInstruction (target, data.toString ());
- fDeferredDocumentImpl.appendChild (fCurrentNodeIndex, pi);
- }
-
- } // processingInstruction(String,XMLString)
-
- /**
- * The start of the document.
- *
- * @param locator The system identifier of the entity if the entity
- * is external, null otherwise.
- * @param encoding The auto-detected IANA encoding name of the entity
- * stream. This value will be null in those situations
- * where the entity encoding is not auto-detected (e.g.
- * internal entities or a document entity that is
- * parsed from a java.io.Reader).
- * @param namespaceContext
- * The namespace context in effect at the
- * start of this document.
- * This object represents the current context.
- * Implementors of this class are responsible
- * for copying the namespace bindings from the
- * the current context (and its parent contexts)
- * if that information is important.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startDocument (XMLLocator locator, String encoding,
- NamespaceContext namespaceContext, Augmentations augs)
- throws XNIException {
-
- fLocator = locator;
- if (!fDeferNodeExpansion) {
- if (fDocumentClassName.equals (DEFAULT_DOCUMENT_CLASS_NAME)) {
- fDocument = new DocumentImpl ();
- fDocumentImpl = (CoreDocumentImpl)fDocument;
- // REVISIT: when DOM Level 3 is REC rely on Document.support
- // instead of specific class
- // set DOM error checking off
- fDocumentImpl.setStrictErrorChecking (false);
- // set actual encoding
- fDocumentImpl.setInputEncoding (encoding);
- // set documentURI
- fDocumentImpl.setDocumentURI (locator.getExpandedSystemId ());
- }
- else if (fDocumentClassName.equals (PSVI_DOCUMENT_CLASS_NAME)) {
- fDocument = new PSVIDocumentImpl();
- fDocumentImpl = (CoreDocumentImpl)fDocument;
- fStorePSVI = true;
- // REVISIT: when DOM Level 3 is REC rely on Document.support
- // instead of specific class
- // set DOM error checking off
- fDocumentImpl.setStrictErrorChecking (false);
- // set actual encoding
- fDocumentImpl.setInputEncoding (encoding);
- // set documentURI
- fDocumentImpl.setDocumentURI (locator.getExpandedSystemId ());
- }
- else {
- // use specified document class
- try {
- Class documentClass = ObjectFactory.findProviderClass (fDocumentClassName, true);
- fDocument = (Document)documentClass.newInstance ();
-
- // if subclass of our own class that's cool too
- Class defaultDocClass =
- ObjectFactory.findProviderClass (CORE_DOCUMENT_CLASS_NAME, true);
- if (defaultDocClass.isAssignableFrom (documentClass)) {
- fDocumentImpl = (CoreDocumentImpl)fDocument;
-
- Class psviDocClass = ObjectFactory.findProviderClass (PSVI_DOCUMENT_CLASS_NAME, true);
- if (psviDocClass.isAssignableFrom (documentClass)) {
- fStorePSVI = true;
- }
-
- // REVISIT: when DOM Level 3 is REC rely on
- // Document.support instead of specific class
- // set DOM error checking off
- fDocumentImpl.setStrictErrorChecking (false);
- // set actual encoding
- fDocumentImpl.setInputEncoding (encoding);
- // set documentURI
- if (locator != null) {
- fDocumentImpl.setDocumentURI (locator.getExpandedSystemId ());
- }
- }
- }
- catch (ClassNotFoundException e) {
- // won't happen we already checked that earlier
- }
- catch (Exception e) {
- throw new RuntimeException (
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "CannotCreateDocumentClass",
- new Object [] {fDocumentClassName}));
- }
- }
- fCurrentNode = fDocument;
- }
- else {
- fDeferredDocumentImpl = new DeferredDocumentImpl (fNamespaceAware);
- fDocument = fDeferredDocumentImpl;
- fDocumentIndex = fDeferredDocumentImpl.createDeferredDocument ();
- // REVISIT: strict error checking is not implemented in deferred dom.
- // Document.support instead of specific class
-
- // set actual encoding
- fDeferredDocumentImpl.setInputEncoding (encoding);
- // set documentURI
- fDeferredDocumentImpl.setDocumentURI (locator.getExpandedSystemId ());
- fCurrentNodeIndex = fDocumentIndex;
-
- }
-
- } // startDocument(String,String)
-
- /**
- * Notifies of the presence of an XMLDecl line in the document. If
- * present, this method will be called immediately following the
- * startDocument call.
- *
- * @param version The XML version.
- * @param encoding The IANA encoding name of the document, or null if
- * not specified.
- * @param standalone The standalone value, or null if not specified.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void xmlDecl (String version, String encoding, String standalone,
- Augmentations augs)
- throws XNIException {
- if (!fDeferNodeExpansion) {
- // REVISIT: when DOM Level 3 is REC rely on Document.support
- // instead of specific class
- if (fDocumentImpl != null) {
- if (version != null)
- fDocumentImpl.setXmlVersion (version);
- fDocumentImpl.setXmlEncoding (encoding);
- fDocumentImpl.setXmlStandalone ("yes".equals (standalone));
- }
- }
- else {
- if (version != null)
- fDeferredDocumentImpl.setXmlVersion (version);
- fDeferredDocumentImpl.setXmlEncoding (encoding);
- fDeferredDocumentImpl.setXmlStandalone ("yes".equals (standalone));
- }
- } // xmlDecl(String,String,String)
-
- /**
- * Notifies of the presence of the DOCTYPE line in the document.
- *
- * @param rootElement The name of the root element.
- * @param publicId The public identifier if an external DTD or null
- * if the external DTD is specified using SYSTEM.
- * @param systemId The system identifier if an external DTD, null
- * otherwise.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void doctypeDecl (String rootElement,
- String publicId, String systemId, Augmentations augs)
- throws XNIException {
-
- if (!fDeferNodeExpansion) {
- if (fDocumentImpl != null) {
- fDocumentType = fDocumentImpl.createDocumentType (
- rootElement, publicId, systemId);
- fCurrentNode.appendChild (fDocumentType);
- }
- }
- else {
- fDocumentTypeIndex = fDeferredDocumentImpl.
- createDeferredDocumentType (rootElement, publicId, systemId);
- fDeferredDocumentImpl.appendChild (fCurrentNodeIndex, fDocumentTypeIndex);
- }
-
- } // doctypeDecl(String,String,String)
-
- /**
- * The start of an element. If the document specifies the start element
- * by using an empty tag, then the startElement method will immediately
- * be followed by the endElement method, with no intervening methods.
- *
- * @param element The name of the element.
- * @param attributes The element attributes.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startElement (QName element, XMLAttributes attributes, Augmentations augs)
- throws XNIException {
- if (DEBUG_EVENTS) {
- System.out.println ("==>startElement ("+element.rawname+")");
- }
- if (!fDeferNodeExpansion) {
- if (fFilterReject) {
- ++fRejectedElementDepth;
- return;
- }
- Element el = createElementNode (element);
- int attrCount = attributes.getLength ();
- boolean seenSchemaDefault = false;
- for (int i = 0; i < attrCount; i++) {
- attributes.getName (i, fAttrQName);
- Attr attr = createAttrNode (fAttrQName);
-
- String attrValue = attributes.getValue (i);
-
- AttributePSVI attrPSVI =(AttributePSVI) attributes.getAugmentations (i).getItem (Constants.ATTRIBUTE_PSVI);
- if (fStorePSVI && attrPSVI != null){
- ((PSVIAttrNSImpl) attr).setPSVI (attrPSVI);
- }
-
- attr.setValue (attrValue);
- boolean specified = attributes.isSpecified(i);
- // Take special care of schema defaulted attributes. Calling the
- // non-namespace aware setAttributeNode() method could overwrite
- // another attribute with the same local name.
- if (!specified && (seenSchemaDefault || (fAttrQName.uri != null &&
- fAttrQName.uri != NamespaceContext.XMLNS_URI && fAttrQName.prefix == null))) {
- el.setAttributeNodeNS(attr);
- seenSchemaDefault = true;
- }
- else {
- el.setAttributeNode(attr);
- }
- // NOTE: The specified value MUST be set after you set
- // the node value because that turns the "specified"
- // flag to "true" which may overwrite a "false"
- // value from the attribute list. -Ac
- if (fDocumentImpl != null) {
- AttrImpl attrImpl = (AttrImpl) attr;
- Object type = null;
- boolean id = false;
-
- // REVISIT: currently it is possible that someone turns off
- // namespaces and turns on xml schema validation
- // To avoid classcast exception in AttrImpl check for namespaces
- // however the correct solution should probably disallow setting
- // namespaces to false when schema processing is turned on.
- if (attrPSVI != null && fNamespaceAware) {
- // XML Schema
- type = attrPSVI.getMemberTypeDefinition ();
- if (type == null) {
- type = attrPSVI.getTypeDefinition ();
- if (type != null) {
- id = ((XSSimpleType) type).isIDType ();
- attrImpl.setType (type);
- }
- }
- else {
- id = ((XSSimpleType) type).isIDType ();
- attrImpl.setType (type);
- }
- }
- else {
- // DTD
- boolean isDeclared = Boolean.TRUE.equals (attributes.getAugmentations (i).getItem (Constants.ATTRIBUTE_DECLARED));
- // For DOM Level 3 TypeInfo, the type name must
- // be null if this attribute has not been declared
- // in the DTD.
- if (isDeclared) {
- type = attributes.getType (i);
- id = "ID".equals (type);
- }
- attrImpl.setType (type);
- }
-
- if (id) {
- ((ElementImpl) el).setIdAttributeNode (attr, true);
- }
-
- attrImpl.setSpecified (specified);
- // REVISIT: Handle entities in attribute value.
- }
- }
- setCharacterData (false);
-
- if (augs != null) {
- ElementPSVI elementPSVI = (ElementPSVI)augs.getItem (Constants.ELEMENT_PSVI);
- if (elementPSVI != null && fNamespaceAware) {
- XSTypeDefinition type = elementPSVI.getMemberTypeDefinition ();
- if (type == null) {
- type = elementPSVI.getTypeDefinition ();
- }
- ((ElementNSImpl)el).setType (type);
- }
- }
-
-
- // filter nodes
- if (fDOMFilter != null && !fInEntityRef) {
- if (fRoot == null) {
- // fill value of the root element
- fRoot = el;
- } else {
- short code = fDOMFilter.startElement(el);
- switch (code) {
- case LSParserFilter.FILTER_INTERRUPT :
- {
- throw Abort.INSTANCE;
- }
- case LSParserFilter.FILTER_REJECT :
- {
- fFilterReject = true;
- fRejectedElementDepth = 0;
- return;
- }
- case LSParserFilter.FILTER_SKIP :
- {
- // make sure that if any char data is available
- // the fFirstChunk is true, so that if the next event
- // is characters(), and the last node is text, we will copy
- // the value already in the text node to fStringBuffer
- // (not to lose it).
- fFirstChunk = true;
- fSkippedElemStack.push(Boolean.TRUE);
- return;
- }
- default :
- {
- if (!fSkippedElemStack.isEmpty()) {
- fSkippedElemStack.push(Boolean.FALSE);
- }
- }
- }
- }
- }
- fCurrentNode.appendChild (el);
- fCurrentNode = el;
- }
- else {
- int el = fDeferredDocumentImpl.createDeferredElement (fNamespaceAware ?
- element.uri : null, element.rawname);
- Object type = null;
- int attrCount = attributes.getLength ();
- // Need to loop in reverse order so that the attributes
- // are processed in document order when the DOM is expanded.
- for (int i = attrCount - 1; i >= 0; --i) {
-
- // set type information
- AttributePSVI attrPSVI = (AttributePSVI)attributes.getAugmentations (i).getItem (Constants.ATTRIBUTE_PSVI);
- boolean id = false;
-
- // REVISIT: currently it is possible that someone turns off
- // namespaces and turns on xml schema validation
- // To avoid classcast exception in AttrImpl check for namespaces
- // however the correct solution should probably disallow setting
- // namespaces to false when schema processing is turned on.
- if (attrPSVI != null && fNamespaceAware) {
- // XML Schema
- type = attrPSVI.getMemberTypeDefinition ();
- if (type == null) {
- type = attrPSVI.getTypeDefinition ();
- if (type != null){
- id = ((XSSimpleType) type).isIDType ();
- }
- }
- else {
- id = ((XSSimpleType) type).isIDType ();
- }
- }
- else {
- // DTD
- boolean isDeclared = Boolean.TRUE.equals (attributes.getAugmentations (i).getItem (Constants.ATTRIBUTE_DECLARED));
- // For DOM Level 3 TypeInfo, the type name must
- // be null if this attribute has not been declared
- // in the DTD.
- if (isDeclared) {
- type = attributes.getType (i);
- id = "ID".equals (type);
- }
- }
-
- // create attribute
- fDeferredDocumentImpl.setDeferredAttribute (
- el,
- attributes.getQName (i),
- attributes.getURI (i),
- attributes.getValue (i),
- attributes.isSpecified (i),
- id,
- type);
- }
-
- fDeferredDocumentImpl.appendChild (fCurrentNodeIndex, el);
- fCurrentNodeIndex = el;
- }
- } // startElement(QName,XMLAttributes)
-
-
- /**
- * An empty element.
- *
- * @param element The name of the element.
- * @param attributes The element attributes.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void emptyElement (QName element, XMLAttributes attributes, Augmentations augs)
- throws XNIException {
-
- startElement (element, attributes, augs);
- endElement (element, augs);
-
- } // emptyElement(QName,XMLAttributes)
-
- /**
- * Character content.
- *
- * @param text The content.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void characters (XMLString text, Augmentations augs) throws XNIException {
-
- if (DEBUG_EVENTS) {
- System.out.println ("==>characters(): "+text.toString ());
- }
-
- if (!fDeferNodeExpansion) {
-
- if (fFilterReject) {
- return;
- }
- if (fInCDATASection && fCreateCDATANodes) {
- if (fCurrentCDATASection == null) {
- fCurrentCDATASection =
- fDocument.createCDATASection (text.toString ());
- fCurrentNode.appendChild (fCurrentCDATASection);
- fCurrentNode = fCurrentCDATASection;
- }
- else {
- fCurrentCDATASection.appendData (text.toString ());
- }
- }
- else if (!fInDTD) {
- // if type is union (XML Schema) it is possible that we receive
- // character call with empty data
- if (text.length == 0) {
- return;
- }
-
- Node child = fCurrentNode.getLastChild ();
- if (child != null && child.getNodeType () == Node.TEXT_NODE) {
- // collect all the data into the string buffer.
- if (fFirstChunk) {
- if (fDocumentImpl != null) {
- fStringBuilder.append (((TextImpl)child).removeData ());
- } else {
- fStringBuilder.append (((Text)child).getData ());
- ((Text)child).setNodeValue (null);
- }
- fFirstChunk = false;
- }
- if (text.length > 0) {
- fStringBuilder.append (text.ch, text.offset, text.length);
- }
- }
- else {
- fFirstChunk = true;
- Text textNode = fDocument.createTextNode (text.toString());
- fCurrentNode.appendChild (textNode);
- }
-
- }
- }
- else {
- // The Text and CDATASection normalization is taken care of within
- // the DOM in the deferred case.
- if (fInCDATASection && fCreateCDATANodes) {
- if (fCurrentCDATASectionIndex == -1) {
- int cs = fDeferredDocumentImpl.
- createDeferredCDATASection (text.toString ());
-
- fDeferredDocumentImpl.appendChild (fCurrentNodeIndex, cs);
- fCurrentCDATASectionIndex = cs;
- fCurrentNodeIndex = cs;
- }
- else {
- int txt = fDeferredDocumentImpl.
- createDeferredTextNode (text.toString (), false);
- fDeferredDocumentImpl.appendChild (fCurrentNodeIndex, txt);
- }
- } else if (!fInDTD) {
- // if type is union (XML Schema) it is possible that we receive
- // character call with empty data
- if (text.length == 0) {
- return;
- }
-
- String value = text.toString ();
- int txt = fDeferredDocumentImpl.
- createDeferredTextNode (value, false);
- fDeferredDocumentImpl.appendChild (fCurrentNodeIndex, txt);
-
- }
- }
- } // characters(XMLString)
-
- /**
- * Ignorable whitespace. For this method to be called, the document
- * source must have some way of determining that the text containing
- * only whitespace characters should be considered ignorable. For
- * example, the validator can determine if a length of whitespace
- * characters in the document are ignorable based on the element
- * content model.
- *
- * @param text The ignorable whitespace.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void ignorableWhitespace (XMLString text, Augmentations augs) throws XNIException {
-
- if (!fIncludeIgnorableWhitespace || fFilterReject) {
- return;
- }
- if (!fDeferNodeExpansion) {
- Node child = fCurrentNode.getLastChild ();
- if (child != null && child.getNodeType () == Node.TEXT_NODE) {
- Text textNode = (Text)child;
- textNode.appendData (text.toString ());
- }
- else {
- Text textNode = fDocument.createTextNode (text.toString ());
- if (fDocumentImpl != null) {
- TextImpl textNodeImpl = (TextImpl)textNode;
- textNodeImpl.setIgnorableWhitespace (true);
- }
- fCurrentNode.appendChild (textNode);
- }
- }
- else {
- // The Text normalization is taken care of within the DOM in the
- // deferred case.
- int txt = fDeferredDocumentImpl.
- createDeferredTextNode (text.toString (), true);
- fDeferredDocumentImpl.appendChild (fCurrentNodeIndex, txt);
- }
-
- } // ignorableWhitespace(XMLString)
-
- /**
- * The end of an element.
- *
- * @param element The name of the element.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endElement (QName element, Augmentations augs) throws XNIException {
- if (DEBUG_EVENTS) {
- System.out.println ("==>endElement ("+element.rawname+")");
- }
- if (!fDeferNodeExpansion) {
-
- // REVISIT: Should this happen after we call the filter?
- if (augs != null && fDocumentImpl != null && (fNamespaceAware || fStorePSVI)) {
- ElementPSVI elementPSVI = (ElementPSVI) augs.getItem(Constants.ELEMENT_PSVI);
- if (elementPSVI != null) {
- // Updating TypeInfo. If the declared type is a union the
- // [member type definition] will only be available at the
- // end of an element.
- if (fNamespaceAware) {
- XSTypeDefinition type = elementPSVI.getMemberTypeDefinition();
- if (type == null) {
- type = elementPSVI.getTypeDefinition();
- }
- ((ElementNSImpl)fCurrentNode).setType(type);
- }
- if (fStorePSVI) {
- ((PSVIElementNSImpl)fCurrentNode).setPSVI (elementPSVI);
- }
- }
- }
-
- if (fDOMFilter != null) {
- if (fFilterReject) {
- if (fRejectedElementDepth-- == 0) {
- fFilterReject = false;
- }
- return;
- }
- if (!fSkippedElemStack.isEmpty()) {
- if (fSkippedElemStack.pop() == Boolean.TRUE) {
- return;
- }
- }
- setCharacterData (false);
- if ((fCurrentNode != fRoot) && !fInEntityRef && (fDOMFilter.getWhatToShow () & NodeFilter.SHOW_ELEMENT)!=0) {
- short code = fDOMFilter.acceptNode (fCurrentNode);
- switch (code) {
- case LSParserFilter.FILTER_INTERRUPT:{
- throw Abort.INSTANCE;
- }
- case LSParserFilter.FILTER_REJECT:{
- Node parent = fCurrentNode.getParentNode ();
- parent.removeChild (fCurrentNode);
- fCurrentNode = parent;
- return;
- }
- case LSParserFilter.FILTER_SKIP: {
- // make sure that if any char data is available
- // the fFirstChunk is true, so that if the next event
- // is characters(), and the last node is text, we will copy
- // the value already in the text node to fStringBuffer
- // (not to lose it).
- fFirstChunk = true;
-
- // replace children
- Node parent = fCurrentNode.getParentNode ();
- NodeList ls = fCurrentNode.getChildNodes ();
- int length = ls.getLength ();
-
- for (int i=0;i<length;i++) {
- parent.appendChild (ls.item (0));
- }
- parent.removeChild (fCurrentNode);
- fCurrentNode = parent;
-
- return;
- }
-
- default: { }
- }
- }
- fCurrentNode = fCurrentNode.getParentNode ();
-
- } // end-if DOMFilter
- else {
- setCharacterData (false);
- fCurrentNode = fCurrentNode.getParentNode ();
- }
-
- }
- else {
- if (augs != null) {
- ElementPSVI elementPSVI = (ElementPSVI) augs.getItem(Constants.ELEMENT_PSVI);
- if (elementPSVI != null) {
- // Setting TypeInfo. If the declared type is a union the
- // [member type definition] will only be available at the
- // end of an element.
- XSTypeDefinition type = elementPSVI.getMemberTypeDefinition();
- if (type == null) {
- type = elementPSVI.getTypeDefinition();
- }
- fDeferredDocumentImpl.setTypeInfo(fCurrentNodeIndex, type);
- }
- }
- fCurrentNodeIndex =
- fDeferredDocumentImpl.getParentNode (fCurrentNodeIndex, false);
- }
-
-
- } // endElement(QName)
-
-
- /**
- * The start of a CDATA section.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startCDATA (Augmentations augs) throws XNIException {
-
- fInCDATASection = true;
- if (!fDeferNodeExpansion) {
- if (fFilterReject) {
- return;
- }
- if (fCreateCDATANodes) {
- setCharacterData (false);
- }
- }
- } // startCDATA()
-
- /**
- * The end of a CDATA section.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endCDATA (Augmentations augs) throws XNIException {
-
- fInCDATASection = false;
- if (!fDeferNodeExpansion) {
-
- if (fFilterReject) {
- return;
- }
-
- if (fCurrentCDATASection !=null) {
-
- if (fDOMFilter !=null && !fInEntityRef &&
- (fDOMFilter.getWhatToShow () & NodeFilter.SHOW_CDATA_SECTION)!= 0) {
- short code = fDOMFilter.acceptNode (fCurrentCDATASection);
- switch (code) {
- case LSParserFilter.FILTER_INTERRUPT:{
- throw Abort.INSTANCE;
- }
- case LSParserFilter.FILTER_REJECT:{
- // fall through to SKIP since CDATA section has no children.
- }
- case LSParserFilter.FILTER_SKIP: {
- Node parent = fCurrentNode.getParentNode ();
- parent.removeChild (fCurrentCDATASection);
- fCurrentNode = parent;
- return;
- }
-
- default: {
- // accept node
- }
- }
- }
-
- fCurrentNode = fCurrentNode.getParentNode ();
- fCurrentCDATASection = null;
- }
- }
- else {
- if (fCurrentCDATASectionIndex !=-1) {
- fCurrentNodeIndex =
- fDeferredDocumentImpl.getParentNode (fCurrentNodeIndex, false);
- fCurrentCDATASectionIndex = -1;
- }
- }
-
- } // endCDATA()
-
- /**
- * The end of the document.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endDocument (Augmentations augs) throws XNIException {
-
- if (!fDeferNodeExpansion) {
- // REVISIT: when DOM Level 3 is REC rely on Document.support
- // instead of specific class
- // set the actual encoding and set DOM error checking back on
- if (fDocumentImpl != null) {
- if (fLocator != null) {
- if (fLocator.getEncoding() != null)
- fDocumentImpl.setInputEncoding (fLocator.getEncoding());
- }
- fDocumentImpl.setStrictErrorChecking (true);
- }
- fCurrentNode = null;
- }
- else {
- // set the actual encoding
- if (fLocator != null) {
- if (fLocator.getEncoding() != null)
- fDeferredDocumentImpl.setInputEncoding (fLocator.getEncoding());
- }
- fCurrentNodeIndex = -1;
- }
-
- } // endDocument()
-
- /**
- * This method notifies the end of a general entity.
- * <p>
- * <strong>Note:</strong> This method is not called for entity references
- * appearing as part of attribute values.
- *
- * @param name The name of the entity.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void endGeneralEntity (String name, Augmentations augs) throws XNIException {
- if (DEBUG_EVENTS) {
- System.out.println ("==>endGeneralEntity: ("+name+")");
- }
- if (!fDeferNodeExpansion) {
-
- if (fFilterReject) {
- return;
- }
- setCharacterData (true);
-
- if (fDocumentType != null) {
- // get current entity declaration
- NamedNodeMap entities = fDocumentType.getEntities ();
- fCurrentEntityDecl = (EntityImpl) entities.getNamedItem (name);
- if (fCurrentEntityDecl != null) {
- if (fCurrentEntityDecl != null && fCurrentEntityDecl.getFirstChild () == null) {
- fCurrentEntityDecl.setReadOnly (false, true);
- Node child = fCurrentNode.getFirstChild ();
- while (child != null) {
- Node copy = child.cloneNode (true);
- fCurrentEntityDecl.appendChild (copy);
- child = child.getNextSibling ();
- }
- fCurrentEntityDecl.setReadOnly (true, true);
-
- //entities.setNamedItem(fCurrentEntityDecl);
- }
- fCurrentEntityDecl = null;
- }
-
- }
- fInEntityRef = false;
- boolean removeEntityRef = false;
- if (fCreateEntityRefNodes) {
- if (fDocumentImpl != null) {
- // Make entity ref node read only
- ((NodeImpl)fCurrentNode).setReadOnly (true, true);
- }
-
- if (fDOMFilter !=null &&
- (fDOMFilter.getWhatToShow () & NodeFilter.SHOW_ENTITY_REFERENCE)!= 0) {
- short code = fDOMFilter.acceptNode (fCurrentNode);
- switch (code) {
- case LSParserFilter.FILTER_INTERRUPT:{
- throw Abort.INSTANCE;
- }
- case LSParserFilter.FILTER_REJECT:{
- Node parent = fCurrentNode.getParentNode ();
- parent.removeChild (fCurrentNode);
- fCurrentNode = parent;
- return;
-
- }
- case LSParserFilter.FILTER_SKIP: {
- // make sure we don't loose chars if next event is characters()
- fFirstChunk = true;
- removeEntityRef = true;
- break;
- }
-
- default: {
- fCurrentNode = fCurrentNode.getParentNode ();
- }
- }
- } else {
- fCurrentNode = fCurrentNode.getParentNode ();
- }
- }
-
- if (!fCreateEntityRefNodes || removeEntityRef) {
- // move entity reference children to the list of
- // siblings of its parent and remove entity reference
- NodeList children = fCurrentNode.getChildNodes ();
- Node parent = fCurrentNode.getParentNode ();
- int length = children.getLength ();
- if (length > 0) {
-
- // get previous sibling of the entity reference
- Node node = fCurrentNode.getPreviousSibling ();
- // normalize text nodes
- Node child = children.item (0);
- if (node != null && node.getNodeType () == Node.TEXT_NODE &&
- child.getNodeType () == Node.TEXT_NODE) {
- ((Text)node).appendData (child.getNodeValue ());
- fCurrentNode.removeChild (child);
-
- } else {
- node = parent.insertBefore (child, fCurrentNode);
- handleBaseURI (node);
- }
-
- for (int i=1;i <length;i++) {
- node = parent.insertBefore (children.item (0), fCurrentNode);
- handleBaseURI (node);
- }
- } // length > 0
- parent.removeChild (fCurrentNode);
- fCurrentNode = parent;
- }
- }
- else {
-
- if (fDocumentTypeIndex != -1) {
- // find corresponding Entity decl
- int node = fDeferredDocumentImpl.getLastChild (fDocumentTypeIndex, false);
- while (node != -1) {
- short nodeType = fDeferredDocumentImpl.getNodeType (node, false);
- if (nodeType == Node.ENTITY_NODE) {
- String nodeName =
- fDeferredDocumentImpl.getNodeName (node, false);
- if (nodeName.equals (name)) {
- fDeferredEntityDecl = node;
- break;
- }
- }
- node = fDeferredDocumentImpl.getRealPrevSibling (node, false);
- }
- }
-
- if (fDeferredEntityDecl != -1 &&
- fDeferredDocumentImpl.getLastChild (fDeferredEntityDecl, false) == -1) {
- // entity definition exists and it does not have any children
- int prevIndex = -1;
- int childIndex = fDeferredDocumentImpl.getLastChild (fCurrentNodeIndex, false);
- while (childIndex != -1) {
- int cloneIndex = fDeferredDocumentImpl.cloneNode (childIndex, true);
- fDeferredDocumentImpl.insertBefore (fDeferredEntityDecl, cloneIndex, prevIndex);
- prevIndex = cloneIndex;
- childIndex = fDeferredDocumentImpl.getRealPrevSibling (childIndex, false);
- }
- }
- if (fCreateEntityRefNodes) {
- fCurrentNodeIndex =
- fDeferredDocumentImpl.getParentNode (fCurrentNodeIndex,
- false);
- } else { //!fCreateEntityRefNodes
- // move children of entity ref before the entity ref.
- // remove entity ref.
-
- // holds a child of entity ref
- int childIndex = fDeferredDocumentImpl.getLastChild (fCurrentNodeIndex, false);
- int parentIndex =
- fDeferredDocumentImpl.getParentNode (fCurrentNodeIndex,
- false);
-
- int prevIndex = fCurrentNodeIndex;
- int lastChild = childIndex;
- int sibling = -1;
- while (childIndex != -1) {
- handleBaseURI (childIndex);
- sibling = fDeferredDocumentImpl.getRealPrevSibling (childIndex, false);
- fDeferredDocumentImpl.insertBefore (parentIndex, childIndex, prevIndex);
- prevIndex = childIndex;
- childIndex = sibling;
- }
- if(lastChild != -1)
- fDeferredDocumentImpl.setAsLastChild (parentIndex, lastChild);
- else{
- sibling = fDeferredDocumentImpl.getRealPrevSibling (prevIndex, false);
- fDeferredDocumentImpl.setAsLastChild (parentIndex, sibling);
- }
- fCurrentNodeIndex = parentIndex;
- }
- fDeferredEntityDecl = -1;
- }
-
-
- } // endGeneralEntity(String, Augmentations)
-
-
- /**
- * Record baseURI information for the Element (by adding xml:base attribute)
- * or for the ProcessingInstruction (by setting a baseURI field)
- * Non deferred DOM.
- *
- * @param node
- */
- protected final void handleBaseURI (Node node){
- if (fDocumentImpl != null) {
- // REVISIT: remove dependency on our implementation when
- // DOM L3 becomes REC
-
- String baseURI = null;
- short nodeType = node.getNodeType ();
-
- if (nodeType == Node.ELEMENT_NODE) {
- // if an element already has xml:base attribute
- // do nothing
- if (fNamespaceAware) {
- if (((Element)node).getAttributeNodeNS ("http://www.w3.org/XML/1998/namespace","base")!=null) {
- return;
- }
- } else if (((Element)node).getAttributeNode ("xml:base") != null) {
- return;
- }
- // retrive the baseURI from the entity reference
- baseURI = ((EntityReferenceImpl)fCurrentNode).getBaseURI ();
- if (baseURI !=null && !baseURI.equals (fDocumentImpl.getDocumentURI ())) {
- if (fNamespaceAware) {
- ((Element)node).setAttributeNS ("http://www.w3.org/XML/1998/namespace", "xml:base", baseURI);
- } else {
- ((Element)node).setAttribute ("xml:base", baseURI);
- }
- }
- }
- else if (nodeType == Node.PROCESSING_INSTRUCTION_NODE) {
-
- baseURI = ((EntityReferenceImpl)fCurrentNode).getBaseURI ();
- if (baseURI !=null && fErrorHandler != null) {
- DOMErrorImpl error = new DOMErrorImpl ();
- error.fType = "pi-base-uri-not-preserved";
- error.fRelatedData = baseURI;
- error.fSeverity = DOMError.SEVERITY_WARNING;
- fErrorHandler.getErrorHandler ().handleError (error);
- }
- }
- }
- }
-
- /**
- *
- * Record baseURI information for the Element (by adding xml:base attribute)
- * or for the ProcessingInstruction (by setting a baseURI field)
- * Deferred DOM.
- *
- * @param node
- */
- protected final void handleBaseURI (int node){
- short nodeType = fDeferredDocumentImpl.getNodeType (node, false);
-
- if (nodeType == Node.ELEMENT_NODE) {
- String baseURI = fDeferredDocumentImpl.getNodeValueString (fCurrentNodeIndex, false);
- if (baseURI == null) {
- baseURI = fDeferredDocumentImpl.getDeferredEntityBaseURI (fDeferredEntityDecl);
- }
- if (baseURI !=null && !baseURI.equals (fDeferredDocumentImpl.getDocumentURI ())) {
- fDeferredDocumentImpl.setDeferredAttribute (node,
- "xml:base",
- "http://www.w3.org/XML/1998/namespace",
- baseURI,
- true);
- }
- }
- else if (nodeType == Node.PROCESSING_INSTRUCTION_NODE) {
-
-
- // retrieve baseURI from the entity reference
- String baseURI = fDeferredDocumentImpl.getNodeValueString (fCurrentNodeIndex, false);
-
- if (baseURI == null) {
- // try baseURI of the entity declaration
- baseURI = fDeferredDocumentImpl.getDeferredEntityBaseURI (fDeferredEntityDecl);
- }
-
- if (baseURI != null && fErrorHandler != null) {
- DOMErrorImpl error = new DOMErrorImpl ();
- error.fType = "pi-base-uri-not-preserved";
- error.fRelatedData = baseURI;
- error.fSeverity = DOMError.SEVERITY_WARNING;
- fErrorHandler.getErrorHandler ().handleError (error);
- }
- }
- }
-
-
- //
- // XMLDTDHandler methods
- //
-
- /**
- * The start of the DTD.
- *
- * @param locator The document locator, or null if the document
- * location cannot be reported during the parsing of
- * the document DTD. However, it is <em>strongly</em>
- * recommended that a locator be supplied that can
- * at least report the base system identifier of the
- * DTD.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startDTD (XMLLocator locator, Augmentations augs) throws XNIException {
- if (DEBUG_EVENTS) {
- System.out.println ("==>startDTD");
- if (DEBUG_BASEURI) {
- System.out.println (" expandedSystemId: "+locator.getExpandedSystemId ());
- System.out.println (" baseURI:"+ locator.getBaseSystemId ());
- }
- }
-
- fInDTD = true;
- if (locator != null) {
- fBaseURIStack.push (locator.getBaseSystemId ());
- }
- if (fDeferNodeExpansion || fDocumentImpl != null) {
- fInternalSubset = new StringBuilder (1024);
- }
- } // startDTD(XMLLocator)
-
-
- /**
- * The end of the DTD.
- *
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endDTD (Augmentations augs) throws XNIException {
- if (DEBUG_EVENTS) {
- System.out.println ("==>endDTD()");
- }
- fInDTD = false;
- if (!fBaseURIStack.isEmpty ()) {
- fBaseURIStack.pop ();
- }
- String internalSubset = fInternalSubset != null && fInternalSubset.length () > 0
- ? fInternalSubset.toString () : null;
- if (fDeferNodeExpansion) {
- if (internalSubset != null) {
- fDeferredDocumentImpl.setInternalSubset (fDocumentTypeIndex, internalSubset);
- }
- }
- else if (fDocumentImpl != null) {
- if (internalSubset != null) {
- ((DocumentTypeImpl)fDocumentType).setInternalSubset (internalSubset);
- }
- }
- } // endDTD()
-
- /**
- * The start of a conditional section.
- *
- * @param type The type of the conditional section. This value will
- * either be CONDITIONAL_INCLUDE or CONDITIONAL_IGNORE.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see #CONDITIONAL_INCLUDE
- * @see #CONDITIONAL_IGNORE
- */
- public void startConditional (short type, Augmentations augs) throws XNIException {
- } // startConditional(short)
-
- /**
- * The end of a conditional section.
- *
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endConditional (Augmentations augs) throws XNIException {
- } // endConditional()
-
-
- /**
- * The start of the DTD external subset.
- *
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startExternalSubset (XMLResourceIdentifier identifier,
- Augmentations augs) throws XNIException {
- if (DEBUG_EVENTS) {
- System.out.println ("==>startExternalSubset");
- if (DEBUG_BASEURI) {
- System.out.println (" expandedSystemId: "+identifier.getExpandedSystemId ());
- System.out.println (" baseURI:"+ identifier.getBaseSystemId ());
- }
- }
- fBaseURIStack.push (identifier.getBaseSystemId ());
- fInDTDExternalSubset = true;
- } // startExternalSubset(Augmentations)
-
- /**
- * The end of the DTD external subset.
- *
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endExternalSubset (Augmentations augs) throws XNIException {
- fInDTDExternalSubset = false;
- fBaseURIStack.pop ();
- } // endExternalSubset(Augmentations)
-
- /**
- * An internal entity declaration.
- *
- * @param name The name of the entity. Parameter entity names start with
- * '%', whereas the name of a general entity is just the
- * entity name.
- * @param text The value of the entity.
- * @param nonNormalizedText The non-normalized value of the entity. This
- * value contains the same sequence of characters that was in
- * the internal entity declaration, without any entity
- * references expanded.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void internalEntityDecl (String name, XMLString text,
- XMLString nonNormalizedText,
- Augmentations augs) throws XNIException {
-
- if (DEBUG_EVENTS) {
- System.out.println ("==>internalEntityDecl: "+name);
- if (DEBUG_BASEURI) {
- System.out.println (" baseURI:"+ (String)fBaseURIStack.peek ());
- }
- }
- // internal subset string
- if (fInternalSubset != null && !fInDTDExternalSubset) {
- fInternalSubset.append ("<!ENTITY ");
- if (name.startsWith ("%")) {
- fInternalSubset.append ("% ");
- fInternalSubset.append (name.substring (1));
- }
- else {
- fInternalSubset.append (name);
- }
- fInternalSubset.append (' ');
- String value = nonNormalizedText.toString ();
- boolean singleQuote = value.indexOf ('\'') == -1;
- fInternalSubset.append (singleQuote ? '\'' : '"');
- fInternalSubset.append (value);
- fInternalSubset.append (singleQuote ? '\'' : '"');
- fInternalSubset.append (">\n");
- }
-
- // NOTE: We only know how to create these nodes for the Xerces
- // DOM implementation because DOM Level 2 does not specify
- // that functionality. -Ac
-
- // create full node
- // don't add parameter entities!
- if(name.startsWith ("%"))
- return;
- if (fDocumentType != null) {
- NamedNodeMap entities = fDocumentType.getEntities ();
- EntityImpl entity = (EntityImpl)entities.getNamedItem (name);
- if (entity == null) {
- entity = (EntityImpl)fDocumentImpl.createEntity (name);
- entity.setBaseURI ((String)fBaseURIStack.peek ());
- entities.setNamedItem (entity);
- }
- }
-
- // create deferred node
- if (fDocumentTypeIndex != -1) {
- boolean found = false;
- int node = fDeferredDocumentImpl.getLastChild (fDocumentTypeIndex, false);
- while (node != -1) {
- short nodeType = fDeferredDocumentImpl.getNodeType (node, false);
- if (nodeType == Node.ENTITY_NODE) {
- String nodeName = fDeferredDocumentImpl.getNodeName (node, false);
- if (nodeName.equals (name)) {
- found = true;
- break;
- }
- }
- node = fDeferredDocumentImpl.getRealPrevSibling (node, false);
- }
- if (!found) {
- int entityIndex =
- fDeferredDocumentImpl.createDeferredEntity (name, null, null, null, (String)fBaseURIStack.peek ());
- fDeferredDocumentImpl.appendChild (fDocumentTypeIndex, entityIndex);
- }
- }
-
- } // internalEntityDecl(String,XMLString,XMLString)
-
- /**
- * An external entity declaration.
- *
- * @param name The name of the entity. Parameter entity names start
- * with '%', whereas the name of a general entity is just
- * the entity name.
- * @param identifier An object containing all location information
- * pertinent to this notation.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void externalEntityDecl (String name, XMLResourceIdentifier identifier,
- Augmentations augs) throws XNIException {
-
-
- if (DEBUG_EVENTS) {
- System.out.println ("==>externalEntityDecl: "+name);
- if (DEBUG_BASEURI) {
- System.out.println (" expandedSystemId:"+ identifier.getExpandedSystemId ());
- System.out.println (" baseURI:"+ identifier.getBaseSystemId ());
- }
- }
- // internal subset string
- String publicId = identifier.getPublicId ();
- String literalSystemId = identifier.getLiteralSystemId ();
- if (fInternalSubset != null && !fInDTDExternalSubset) {
- fInternalSubset.append ("<!ENTITY ");
- if (name.startsWith ("%")) {
- fInternalSubset.append ("% ");
- fInternalSubset.append (name.substring (1));
- }
- else {
- fInternalSubset.append (name);
- }
- fInternalSubset.append (' ');
- if (publicId != null) {
- fInternalSubset.append ("PUBLIC '");
- fInternalSubset.append (publicId);
- fInternalSubset.append ("' '");
- }
- else {
- fInternalSubset.append ("SYSTEM '");
- }
- fInternalSubset.append (literalSystemId);
- fInternalSubset.append ("'>\n");
- }
-
- // NOTE: We only know how to create these nodes for the Xerces
- // DOM implementation because DOM Level 2 does not specify
- // that functionality. -Ac
-
- // create full node
- // don't add parameter entities!
- if(name.startsWith ("%"))
- return;
- if (fDocumentType != null) {
- NamedNodeMap entities = fDocumentType.getEntities ();
- EntityImpl entity = (EntityImpl)entities.getNamedItem (name);
- if (entity == null) {
- entity = (EntityImpl)fDocumentImpl.createEntity (name);
- entity.setPublicId (publicId);
- entity.setSystemId (literalSystemId);
- entity.setBaseURI (identifier.getBaseSystemId ());
- entities.setNamedItem (entity);
- }
- }
-
- // create deferred node
- if (fDocumentTypeIndex != -1) {
- boolean found = false;
- int nodeIndex = fDeferredDocumentImpl.getLastChild (fDocumentTypeIndex, false);
- while (nodeIndex != -1) {
- short nodeType = fDeferredDocumentImpl.getNodeType (nodeIndex, false);
- if (nodeType == Node.ENTITY_NODE) {
- String nodeName = fDeferredDocumentImpl.getNodeName (nodeIndex, false);
- if (nodeName.equals (name)) {
- found = true;
- break;
- }
- }
- nodeIndex = fDeferredDocumentImpl.getRealPrevSibling (nodeIndex, false);
- }
- if (!found) {
- int entityIndex = fDeferredDocumentImpl.createDeferredEntity (
- name, publicId, literalSystemId, null, identifier.getBaseSystemId ());
- fDeferredDocumentImpl.appendChild (fDocumentTypeIndex, entityIndex);
- }
- }
-
- } // externalEntityDecl(String,XMLResourceIdentifier, Augmentations)
-
-
- /**
- * This method notifies of the start of a parameter entity. The parameter
- * entity name start with a '%' character.
- *
- * @param name The name of the parameter entity.
- * @param identifier The resource identifier.
- * @param encoding The auto-detected IANA encoding name of the entity
- * stream. This value will be null in those situations
- * where the entity encoding is not auto-detected (e.g.
- * internal parameter entities).
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startParameterEntity (String name,
- XMLResourceIdentifier identifier,
- String encoding,
- Augmentations augs) throws XNIException {
- if (DEBUG_EVENTS) {
- System.out.println ("==>startParameterEntity: "+name);
- if (DEBUG_BASEURI) {
- System.out.println (" expandedSystemId: "+identifier.getExpandedSystemId ());
- System.out.println (" baseURI:"+ identifier.getBaseSystemId ());
- }
- }
- if (augs != null && fInternalSubset != null &&
- !fInDTDExternalSubset &&
- Boolean.TRUE.equals(augs.getItem(Constants.ENTITY_SKIPPED))) {
- fInternalSubset.append(name).append(";\n");
- }
- fBaseURIStack.push (identifier.getExpandedSystemId ());
- }
-
-
- /**
- * This method notifies the end of a parameter entity. Parameter entity
- * names begin with a '%' character.
- *
- * @param name The name of the parameter entity.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endParameterEntity (String name, Augmentations augs) throws XNIException {
-
- if (DEBUG_EVENTS) {
- System.out.println ("==>endParameterEntity: "+name);
- }
- fBaseURIStack.pop ();
- }
-
- /**
- * An unparsed entity declaration.
- *
- * @param name The name of the entity.
- * @param identifier An object containing all location information
- * pertinent to this entity.
- * @param notation The name of the notation.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void unparsedEntityDecl (String name, XMLResourceIdentifier identifier,
- String notation, Augmentations augs)
- throws XNIException {
-
- if (DEBUG_EVENTS) {
- System.out.println ("==>unparsedEntityDecl: "+name);
- if (DEBUG_BASEURI) {
- System.out.println (" expandedSystemId:"+ identifier.getExpandedSystemId ());
- System.out.println (" baseURI:"+ identifier.getBaseSystemId ());
- }
- }
- // internal subset string
- String publicId = identifier.getPublicId ();
- String literalSystemId = identifier.getLiteralSystemId ();
- if (fInternalSubset != null && !fInDTDExternalSubset) {
- fInternalSubset.append ("<!ENTITY ");
- fInternalSubset.append (name);
- fInternalSubset.append (' ');
- if (publicId != null) {
- fInternalSubset.append ("PUBLIC '");
- fInternalSubset.append (publicId);
- if (literalSystemId != null) {
- fInternalSubset.append ("' '");
- fInternalSubset.append (literalSystemId);
- }
- }
- else {
- fInternalSubset.append ("SYSTEM '");
- fInternalSubset.append (literalSystemId);
- }
- fInternalSubset.append ("' NDATA ");
- fInternalSubset.append (notation);
- fInternalSubset.append (">\n");
- }
-
- // NOTE: We only know how to create these nodes for the Xerces
- // DOM implementation because DOM Level 2 does not specify
- // that functionality. -Ac
-
- // create full node
- if (fDocumentType != null) {
- NamedNodeMap entities = fDocumentType.getEntities ();
- EntityImpl entity = (EntityImpl)entities.getNamedItem (name);
- if (entity == null) {
- entity = (EntityImpl)fDocumentImpl.createEntity (name);
- entity.setPublicId (publicId);
- entity.setSystemId (literalSystemId);
- entity.setNotationName (notation);
- entity.setBaseURI (identifier.getBaseSystemId ());
- entities.setNamedItem (entity);
- }
- }
-
- // create deferred node
- if (fDocumentTypeIndex != -1) {
- boolean found = false;
- int nodeIndex = fDeferredDocumentImpl.getLastChild (fDocumentTypeIndex, false);
- while (nodeIndex != -1) {
- short nodeType = fDeferredDocumentImpl.getNodeType (nodeIndex, false);
- if (nodeType == Node.ENTITY_NODE) {
- String nodeName = fDeferredDocumentImpl.getNodeName (nodeIndex, false);
- if (nodeName.equals (name)) {
- found = true;
- break;
- }
- }
- nodeIndex = fDeferredDocumentImpl.getRealPrevSibling (nodeIndex, false);
- }
- if (!found) {
- int entityIndex = fDeferredDocumentImpl.createDeferredEntity (
- name, publicId, literalSystemId, notation, identifier.getBaseSystemId ());
- fDeferredDocumentImpl.appendChild (fDocumentTypeIndex, entityIndex);
- }
- }
-
- } // unparsedEntityDecl(String,XMLResourceIdentifier, String, Augmentations)
-
- /**
- * A notation declaration
- *
- * @param name The name of the notation.
- * @param identifier An object containing all location information
- * pertinent to this notation.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void notationDecl (String name, XMLResourceIdentifier identifier,
- Augmentations augs) throws XNIException {
-
- // internal subset string
- String publicId = identifier.getPublicId ();
- String literalSystemId = identifier.getLiteralSystemId ();
- if (fInternalSubset != null && !fInDTDExternalSubset) {
- fInternalSubset.append ("<!NOTATION ");
- fInternalSubset.append (name);
- if (publicId != null) {
- fInternalSubset.append (" PUBLIC '");
- fInternalSubset.append (publicId);
- if (literalSystemId != null) {
- fInternalSubset.append ("' '");
- fInternalSubset.append (literalSystemId);
- }
- }
- else {
- fInternalSubset.append (" SYSTEM '");
- fInternalSubset.append (literalSystemId);
- }
- fInternalSubset.append ("'>\n");
- }
-
- // NOTE: We only know how to create these nodes for the Xerces
- // DOM implementation because DOM Level 2 does not specify
- // that functionality. -Ac
-
- // create full node
- if (fDocumentImpl !=null && fDocumentType != null) {
- NamedNodeMap notations = fDocumentType.getNotations ();
- if (notations.getNamedItem (name) == null) {
- NotationImpl notation = (NotationImpl)fDocumentImpl.createNotation (name);
- notation.setPublicId (publicId);
- notation.setSystemId (literalSystemId);
- notation.setBaseURI (identifier.getBaseSystemId ());
- notations.setNamedItem (notation);
- }
- }
-
- // create deferred node
- if (fDocumentTypeIndex != -1) {
- boolean found = false;
- int nodeIndex = fDeferredDocumentImpl.getLastChild (fDocumentTypeIndex, false);
- while (nodeIndex != -1) {
- short nodeType = fDeferredDocumentImpl.getNodeType (nodeIndex, false);
- if (nodeType == Node.NOTATION_NODE) {
- String nodeName = fDeferredDocumentImpl.getNodeName (nodeIndex, false);
- if (nodeName.equals (name)) {
- found = true;
- break;
- }
- }
- nodeIndex = fDeferredDocumentImpl.getPrevSibling (nodeIndex, false);
- }
- if (!found) {
- int notationIndex = fDeferredDocumentImpl.createDeferredNotation (
- name, publicId, literalSystemId, identifier.getBaseSystemId ());
- fDeferredDocumentImpl.appendChild (fDocumentTypeIndex, notationIndex);
- }
- }
-
- } // notationDecl(String,XMLResourceIdentifier, Augmentations)
-
- /**
- * Characters within an IGNORE conditional section.
- *
- * @param text The ignored text.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void ignoredCharacters (XMLString text, Augmentations augs) throws XNIException {
- } // ignoredCharacters(XMLString, Augmentations)
-
-
- /**
- * An element declaration.
- *
- * @param name The name of the element.
- * @param contentModel The element content model.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void elementDecl (String name, String contentModel, Augmentations augs)
- throws XNIException {
-
- // internal subset string
- if (fInternalSubset != null && !fInDTDExternalSubset) {
- fInternalSubset.append ("<!ELEMENT ");
- fInternalSubset.append (name);
- fInternalSubset.append (' ');
- fInternalSubset.append (contentModel);
- fInternalSubset.append (">\n");
- }
-
- } // elementDecl(String,String)
-
- /**
- * An attribute declaration.
- *
- * @param elementName The name of the element that this attribute
- * is associated with.
- * @param attributeName The name of the attribute.
- * @param type The attribute type. This value will be one of
- * the following: "CDATA", "ENTITY", "ENTITIES",
- * "ENUMERATION", "ID", "IDREF", "IDREFS",
- * "NMTOKEN", "NMTOKENS", or "NOTATION".
- * @param enumeration If the type has the value "ENUMERATION" or
- * "NOTATION", this array holds the allowed attribute
- * values; otherwise, this array is null.
- * @param defaultType The attribute default type. This value will be
- * one of the following: "#FIXED", "#IMPLIED",
- * "#REQUIRED", or null.
- * @param defaultValue The attribute default value, or null if no
- * default value is specified.
- * @param nonNormalizedDefaultValue The attribute default value with no normalization
- * performed, or null if no default value is specified.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void attributeDecl (String elementName, String attributeName,
- String type, String[] enumeration,
- String defaultType, XMLString defaultValue,
- XMLString nonNormalizedDefaultValue, Augmentations augs) throws XNIException {
-
- // internal subset string
- if (fInternalSubset != null && !fInDTDExternalSubset) {
- fInternalSubset.append ("<!ATTLIST ");
- fInternalSubset.append (elementName);
- fInternalSubset.append (' ');
- fInternalSubset.append (attributeName);
- fInternalSubset.append (' ');
- if (type.equals ("ENUMERATION")) {
- fInternalSubset.append ('(');
- for (int i = 0; i < enumeration.length; i++) {
- if (i > 0) {
- fInternalSubset.append ('|');
- }
- fInternalSubset.append (enumeration[i]);
- }
- fInternalSubset.append (')');
- }
- else {
- fInternalSubset.append (type);
- }
- if (defaultType != null) {
- fInternalSubset.append (' ');
- fInternalSubset.append (defaultType);
- }
- if (defaultValue != null) {
- fInternalSubset.append (" '");
- for (int i = 0; i < defaultValue.length; i++) {
- char c = defaultValue.ch[defaultValue.offset + i];
- if (c == '\'') {
- fInternalSubset.append ("&apos;");
- }
- else {
- fInternalSubset.append (c);
- }
- }
- fInternalSubset.append ('\'');
- }
- fInternalSubset.append (">\n");
- }
- // REVISIT: This code applies to the support of domx/grammar-access
- // feature in Xerces 1
-
- // deferred expansion
- if (fDeferredDocumentImpl != null) {
-
- // get the default value
- if (defaultValue != null) {
-
- // get element definition
- int elementDefIndex = fDeferredDocumentImpl.lookupElementDefinition (elementName);
-
- // create element definition if not already there
- if (elementDefIndex == -1) {
- elementDefIndex = fDeferredDocumentImpl.createDeferredElementDefinition (elementName);
- fDeferredDocumentImpl.appendChild (fDocumentTypeIndex, elementDefIndex);
- }
- // add default attribute
- boolean nsEnabled = fNamespaceAware;
- String namespaceURI = null;
- if (nsEnabled) {
- // DOM Level 2 wants all namespace declaration attributes
- // to be bound to "http://www.w3.org/2000/xmlns/"
- // So as long as the XML parser doesn't do it, it needs to
- // done here.
- if (attributeName.startsWith("xmlns:") ||
- attributeName.equals("xmlns")) {
- namespaceURI = NamespaceContext.XMLNS_URI;
- }
- else if (attributeName.startsWith("xml:")) {
- namespaceURI = NamespaceContext.XML_URI;
- }
- }
- int attrIndex = fDeferredDocumentImpl.createDeferredAttribute (
- attributeName, namespaceURI, defaultValue.toString(), false);
- if ("ID".equals (type)) {
- fDeferredDocumentImpl.setIdAttribute (attrIndex);
- }
- // REVISIT: set ID type correctly
- fDeferredDocumentImpl.appendChild (elementDefIndex, attrIndex);
- }
-
- } // if deferred
-
- // full expansion
- else if (fDocumentImpl != null) {
-
- // get the default value
- if (defaultValue != null) {
-
- // get element definition node
- NamedNodeMap elements = ((DocumentTypeImpl)fDocumentType).getElements ();
- ElementDefinitionImpl elementDef = (ElementDefinitionImpl)elements.getNamedItem (elementName);
- if (elementDef == null) {
- elementDef = fDocumentImpl.createElementDefinition (elementName);
- ((DocumentTypeImpl)fDocumentType).getElements ().setNamedItem (elementDef);
- }
-
- // REVISIT: Check for uniqueness of element name? -Ac
-
- // create attribute and set properties
- boolean nsEnabled = fNamespaceAware;
- AttrImpl attr;
- if (nsEnabled) {
- String namespaceURI = null;
- // DOM Level 2 wants all namespace declaration attributes
- // to be bound to "http://www.w3.org/2000/xmlns/"
- // So as long as the XML parser doesn't do it, it needs to
- // done here.
- if (attributeName.startsWith("xmlns:") ||
- attributeName.equals("xmlns")) {
- namespaceURI = NamespaceContext.XMLNS_URI;
- }
- else if (attributeName.startsWith("xml:")) {
- namespaceURI = NamespaceContext.XML_URI;
- }
- attr = (AttrImpl)fDocumentImpl.createAttributeNS (namespaceURI,
- attributeName);
- }
- else {
- attr = (AttrImpl)fDocumentImpl.createAttribute (attributeName);
- }
- attr.setValue (defaultValue.toString ());
- attr.setSpecified (false);
- attr.setIdAttribute ("ID".equals (type));
-
- // add default attribute to element definition
- if (nsEnabled){
- elementDef.getAttributes ().setNamedItemNS (attr);
- }
- else {
- elementDef.getAttributes ().setNamedItem (attr);
- }
- }
-
- } // if NOT defer-node-expansion
-
- } // attributeDecl(String,String,String,String[],String,XMLString, XMLString, Augmentations)
-
-
- /**
- * The start of an attribute list.
- *
- * @param elementName The name of the element that this attribute
- * list is associated with.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startAttlist (String elementName, Augmentations augs) throws XNIException {
- } // startAttlist(String)
-
-
- /**
- * The end of an attribute list.
- *
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endAttlist (Augmentations augs) throws XNIException {
- } // endAttlist()
-
-
- // method to create an element node.
- // subclasses can override this method to create element nodes in other ways.
- protected Element createElementNode (QName element) {
- Element el = null;
-
- if (fNamespaceAware) {
- // if we are using xerces DOM implementation, call our
- // own constructor to reuse the strings we have here.
- if (fDocumentImpl != null) {
- el = fDocumentImpl.createElementNS (element.uri, element.rawname,
- element.localpart);
- }
- else {
- el = fDocument.createElementNS (element.uri, element.rawname);
- }
- }
- else {
- el = fDocument.createElement (element.rawname);
- }
-
- return el;
- }
-
- // method to create an attribute node.
- // subclasses can override this method to create attribute nodes in other ways.
- protected Attr createAttrNode (QName attrQName) {
- Attr attr = null;
-
- if (fNamespaceAware) {
- if (fDocumentImpl != null) {
- // if we are using xerces DOM implementation, call our
- // own constructor to reuse the strings we have here.
- attr = fDocumentImpl.createAttributeNS (attrQName.uri,
- attrQName.rawname,
- attrQName.localpart);
- }
- else {
- attr = fDocument.createAttributeNS (attrQName.uri,
- attrQName.rawname);
- }
- }
- else {
- attr = fDocument.createAttribute (attrQName.rawname);
- }
-
- return attr;
- }
-
- /*
- * When the first characters() call is received, the data is stored in
- * a new Text node. If right after the first characters() we receive another chunk of data,
- * the data from the Text node, following the new characters are appended
- * to the fStringBuffer and the text node data is set to empty.
- *
- * This function is called when the state is changed and the
- * data must be appended to the current node.
- *
- * Note: if DOMFilter is set, you must make sure that if Node is skipped,
- * or removed fFistChunk must be set to true, otherwise some data can be lost.
- *
- */
- protected void setCharacterData (boolean sawChars){
-
- // handle character data
- fFirstChunk = sawChars;
-
-
- // if we have data in the buffer we must have created
- // a text node already.
-
- Node child = fCurrentNode.getLastChild ();
- if (child != null) {
- if (fStringBuilder.length () > 0) {
- // REVISIT: should this check be performed?
- if (child.getNodeType () == Node.TEXT_NODE) {
- if (fDocumentImpl != null) {
- ((TextImpl)child).replaceData (fStringBuilder.toString ());
- }
- else {
- ((Text)child).setData (fStringBuilder.toString ());
- }
- }
- // reset string buffer
- fStringBuilder.setLength (0);
- }
-
- if (fDOMFilter !=null && !fInEntityRef) {
- if ( (child.getNodeType () == Node.TEXT_NODE ) &&
- ((fDOMFilter.getWhatToShow () & NodeFilter.SHOW_TEXT)!= 0) ) {
- short code = fDOMFilter.acceptNode (child);
- switch (code) {
- case LSParserFilter.FILTER_INTERRUPT:{
- throw Abort.INSTANCE;
- }
- case LSParserFilter.FILTER_REJECT:{
- // fall through to SKIP since Comment has no children.
- }
- case LSParserFilter.FILTER_SKIP: {
- fCurrentNode.removeChild (child);
- return;
- }
- default: {
- // accept node -- do nothing
- }
- }
- }
- } // end-if fDOMFilter !=null
-
- } // end-if child !=null
- }
-
-
- /**
- * @see org.w3c.dom.ls.LSParser#abort()
- */
- public void abort () {
- throw Abort.INSTANCE;
- }
-
-
-} // class AbstractDOMParser
diff --git a/src/com/sun/org/apache/xerces/internal/parsers/AbstractSAXParser.java b/src/com/sun/org/apache/xerces/internal/parsers/AbstractSAXParser.java
deleted file mode 100644
index eea7057..0000000
--- a/src/com/sun/org/apache/xerces/internal/parsers/AbstractSAXParser.java
+++ /dev/null
@@ -1,2417 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.parsers;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.util.EntityResolver2Wrapper;
-import com.sun.org.apache.xerces.internal.util.EntityResolverWrapper;
-import com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper;
-import com.sun.org.apache.xerces.internal.util.SAXMessageFormatter;
-import com.sun.org.apache.xerces.internal.util.Status;
-import com.sun.org.apache.xerces.internal.util.SymbolHash;
-import com.sun.org.apache.xerces.internal.util.XMLSymbols;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager;
-import com.sun.org.apache.xerces.internal.xni.Augmentations;
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
-import com.sun.org.apache.xerces.internal.xni.XMLLocator;
-import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
-import com.sun.org.apache.xerces.internal.xni.XMLString;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLEntityResolver;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLParseException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration;
-import com.sun.org.apache.xerces.internal.xs.AttributePSVI;
-import com.sun.org.apache.xerces.internal.xs.ElementPSVI;
-import com.sun.org.apache.xerces.internal.xs.PSVIProvider;
-import java.io.IOException;
-import java.util.Locale;
-import javax.xml.XMLConstants;
-import org.xml.sax.AttributeList;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.DTDHandler;
-import org.xml.sax.DocumentHandler;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.Parser;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.ext.Attributes2;
-import org.xml.sax.ext.DeclHandler;
-import org.xml.sax.ext.EntityResolver2;
-import org.xml.sax.ext.LexicalHandler;
-import org.xml.sax.ext.Locator2;
-import org.xml.sax.helpers.LocatorImpl;
-
-/**
- * This is the base class of all SAX parsers. It implements both the
- * SAX1 and SAX2 parser functionality, while the actual pipeline is
- * defined in the parser configuration.
- *
- * @author Arnaud Le Hors, IBM
- * @author Andy Clark, IBM
- *
- * @version $Id: AbstractSAXParser.java,v 1.6 2010-11-01 04:40:09 joehw Exp $
- */
-public abstract class AbstractSAXParser
- extends AbstractXMLDocumentParser
- implements PSVIProvider, // PSVI
- Parser, XMLReader // SAX1, SAX2
-{
-
- //
- // Constants
- //
-
- // features
-
- /** Feature identifier: namespaces. */
- protected static final String NAMESPACES =
- Constants.SAX_FEATURE_PREFIX + Constants.NAMESPACES_FEATURE;
-
- /** Feature identifier: namespace prefixes. */
- protected static final String NAMESPACE_PREFIXES =
- Constants.SAX_FEATURE_PREFIX + Constants.NAMESPACE_PREFIXES_FEATURE;
-
- /** Feature id: string interning. */
- protected static final String STRING_INTERNING =
- Constants.SAX_FEATURE_PREFIX + Constants.STRING_INTERNING_FEATURE;
-
- /** Feature identifier: allow notation and unparsed entity events to be sent out of order. */
- // this is not meant to be a recognized feature, but we need it here to use
- // if it is already a recognized feature for the pipeline
- protected static final String ALLOW_UE_AND_NOTATION_EVENTS =
- Constants.SAX_FEATURE_PREFIX + Constants.ALLOW_DTD_EVENTS_AFTER_ENDDTD_FEATURE;
-
- /** Recognized features. */
- private static final String[] RECOGNIZED_FEATURES = {
- NAMESPACES,
- NAMESPACE_PREFIXES,
- STRING_INTERNING,
- };
-
- // properties
-
- /** Property id: lexical handler. */
- protected static final String LEXICAL_HANDLER =
- Constants.SAX_PROPERTY_PREFIX + Constants.LEXICAL_HANDLER_PROPERTY;
-
- /** Property id: declaration handler. */
- protected static final String DECLARATION_HANDLER =
- Constants.SAX_PROPERTY_PREFIX + Constants.DECLARATION_HANDLER_PROPERTY;
-
- /** Property id: DOM node. */
- protected static final String DOM_NODE =
- Constants.SAX_PROPERTY_PREFIX + Constants.DOM_NODE_PROPERTY;
-
- /** Property id: security manager. */
- private static final String SECURITY_MANAGER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SECURITY_MANAGER_PROPERTY;
-
- /** Recognized properties. */
- private static final String[] RECOGNIZED_PROPERTIES = {
- LEXICAL_HANDLER,
- DECLARATION_HANDLER,
- DOM_NODE,
- };
-
- //
- // Data
- //
-
- // features
-
- /** Namespaces. */
- protected boolean fNamespaces;
-
- /** Namespace prefixes. */
- protected boolean fNamespacePrefixes = false;
-
- /** Lexical handler parameter entities. */
- protected boolean fLexicalHandlerParameterEntities = true;
-
- /** Standalone document declaration. */
- protected boolean fStandalone;
-
- /** Resolve DTD URIs. */
- protected boolean fResolveDTDURIs = true;
-
- /** Use EntityResolver2. */
- protected boolean fUseEntityResolver2 = true;
-
- /**
- * XMLNS URIs: Namespace declarations in the
- * http://www.w3.org/2000/xmlns/ namespace.
- */
- protected boolean fXMLNSURIs = false;
-
- // parser handlers
-
- /** Content handler. */
- protected ContentHandler fContentHandler;
-
- /** Document handler. */
- protected DocumentHandler fDocumentHandler;
-
- /** Namespace context */
- protected NamespaceContext fNamespaceContext;
-
- /** DTD handler. */
- protected org.xml.sax.DTDHandler fDTDHandler;
-
- /** Decl handler. */
- protected DeclHandler fDeclHandler;
-
- /** Lexical handler. */
- protected LexicalHandler fLexicalHandler;
-
- protected QName fQName = new QName();
-
- // state
-
- /**
- * True if a parse is in progress. This state is needed because
- * some features/properties cannot be set while parsing (e.g.
- * validation and namespaces).
- */
- protected boolean fParseInProgress = false;
-
- // track the version of the document being parsed
- protected String fVersion;
-
- // temp vars
- private final AttributesProxy fAttributesProxy = new AttributesProxy();
- private Augmentations fAugmentations = null;
-
-
- // temporary buffer for sending normalized values
- // REVISIT: what should be the size of the buffer?
- private static final int BUFFER_SIZE = 20;
- private char[] fCharBuffer = new char[BUFFER_SIZE];
-
- // allows us to keep track of whether an attribute has
- // been declared twice, so that we can avoid exposing the
- // second declaration to any registered DeclHandler
- protected SymbolHash fDeclaredAttrs = null;
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- protected AbstractSAXParser(XMLParserConfiguration config) {
- super(config);
-
- config.addRecognizedFeatures(RECOGNIZED_FEATURES);
- config.addRecognizedProperties(RECOGNIZED_PROPERTIES);
-
- try {
- config.setFeature(ALLOW_UE_AND_NOTATION_EVENTS, false);
- }
- catch (XMLConfigurationException e) {
- // it wasn't a recognized feature, so we don't worry about it
- }
- } // <init>(XMLParserConfiguration)
-
- //
- // XMLDocumentHandler methods
- //
-
- /**
- * The start of the document.
- *
- * @param locator The document locator, or null if the document
- * location cannot be reported during the parsing
- * of this document. However, it is <em>strongly</em>
- * recommended that a locator be supplied that can
- * at least report the system identifier of the
- * document.
- * @param encoding The auto-detected IANA encoding name of the entity
- * stream. This value will be null in those situations
- * where the entity encoding is not auto-detected (e.g.
- * internal entities or a document entity that is
- * parsed from a java.io.Reader).
- * @param namespaceContext
- * The namespace context in effect at the
- * start of this document.
- * This object represents the current context.
- * Implementors of this class are responsible
- * for copying the namespace bindings from the
- * the current context (and its parent contexts)
- * if that information is important.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startDocument(XMLLocator locator, String encoding,
- NamespaceContext namespaceContext, Augmentations augs)
- throws XNIException {
-
- fNamespaceContext = namespaceContext;
-
- try {
- // SAX1
- if (fDocumentHandler != null) {
- if (locator != null) {
- fDocumentHandler.setDocumentLocator(new LocatorProxy(locator));
- }
- fDocumentHandler.startDocument();
- }
-
- // SAX2
- if (fContentHandler != null) {
- if (locator != null) {
- fContentHandler.setDocumentLocator(new LocatorProxy(locator));
- }
- fContentHandler.startDocument();
- }
- }
- catch (SAXException e) {
- throw new XNIException(e);
- }
-
- } // startDocument(locator,encoding,augs)
-
- /**
- * Notifies of the presence of an XMLDecl line in the document. If
- * present, this method will be called immediately following the
- * startDocument call.
- *
- * @param version The XML version.
- * @param encoding The IANA encoding name of the document, or null if
- * not specified.
- * @param standalone The standalone value, or null if not specified.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void xmlDecl(String version, String encoding, String standalone, Augmentations augs)
- throws XNIException {
- // the version need only be set once; if
- // document's XML 1.0|1.1, that's how it'll stay
- fVersion = version;
- fStandalone = "yes".equals(standalone);
- } // xmlDecl(String,String,String)
-
- /**
- * Notifies of the presence of the DOCTYPE line in the document.
- *
- * @param rootElement The name of the root element.
- * @param publicId The public identifier if an external DTD or null
- * if the external DTD is specified using SYSTEM.
- * @param systemId The system identifier if an external DTD, null
- * otherwise.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void doctypeDecl(String rootElement,
- String publicId, String systemId, Augmentations augs)
- throws XNIException {
- fInDTD = true;
-
- try {
- // SAX2 extension
- if (fLexicalHandler != null) {
- fLexicalHandler.startDTD(rootElement, publicId, systemId);
- }
- }
- catch (SAXException e) {
- throw new XNIException(e);
- }
-
- // is there a DeclHandler?
- if(fDeclHandler != null) {
- fDeclaredAttrs = new SymbolHash();
- }
-
- } // doctypeDecl(String,String,String)
-
- /**
- * This method notifies of the start of an entity. The DTD has the
- * pseudo-name of "[dtd]" parameter entity names start with '%'; and
- * general entity names are just the entity name.
- * <p>
- * <strong>Note:</strong> Since the document is an entity, the handler
- * will be notified of the start of the document entity by calling the
- * startEntity method with the entity name "[xml]" <em>before</em> calling
- * the startDocument method. When exposing entity boundaries through the
- * SAX API, the document entity is never reported, however.
- * <p>
- * <strong>Note:</strong> This method is not called for entity references
- * appearing as part of attribute values.
- *
- * @param name The name of the entity.
- * @param identifier The resource identifier.
- * @param encoding The auto-detected IANA encoding name of the entity
- * stream. This value will be null in those situations
- * where the entity encoding is not auto-detected (e.g.
- * internal parameter entities).
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startGeneralEntity(String name, XMLResourceIdentifier identifier,
- String encoding, Augmentations augs)
- throws XNIException {
-
- try {
- // Only report startEntity if this entity was actually read.
- if (augs != null && Boolean.TRUE.equals(augs.getItem(Constants.ENTITY_SKIPPED))) {
- // report skipped entity to content handler
- if (fContentHandler != null) {
- fContentHandler.skippedEntity(name);
- }
- }
- else {
- // SAX2 extension
- if (fLexicalHandler != null) {
- fLexicalHandler.startEntity(name);
- }
- }
- }
- catch (SAXException e) {
- throw new XNIException(e);
- }
-
- } // startGeneralEntity(String,String,String,String,String)
-
- /**
- * This method notifies the end of an entity. The DTD has the pseudo-name
- * of "[dtd]" parameter entity names start with '%'; and general entity
- * names are just the entity name.
- * <p>
- * <strong>Note:</strong> Since the document is an entity, the handler
- * will be notified of the end of the document entity by calling the
- * endEntity method with the entity name "[xml]" <em>after</em> calling
- * the endDocument method. When exposing entity boundaries through the
- * SAX API, the document entity is never reported, however.
- * <p>
- * <strong>Note:</strong> This method is not called for entity references
- * appearing as part of attribute values.
- *
- * @param name The name of the entity.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endGeneralEntity(String name, Augmentations augs) throws XNIException {
-
- try {
- // Only report endEntity if this entity was actually read.
- if (augs == null || !Boolean.TRUE.equals(augs.getItem(Constants.ENTITY_SKIPPED))) {
- // SAX2 extension
- if (fLexicalHandler != null) {
- fLexicalHandler.endEntity(name);
- }
- }
- }
- catch (SAXException e) {
- throw new XNIException(e);
- }
-
- } // endEntity(String)
-
- /**
- * The start of an element. If the document specifies the start element
- * by using an empty tag, then the startElement method will immediately
- * be followed by the endElement method, with no intervening methods.
- *
- * @param element The name of the element.
- * @param attributes The element attributes.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startElement(QName element, XMLAttributes attributes, Augmentations augs)
- throws XNIException {
-
- try {
- // SAX1
- if (fDocumentHandler != null) {
- // REVISIT: should we support schema-normalized-value for SAX1 events
- //
- fAttributesProxy.setAttributes(attributes);
- fDocumentHandler.startElement(element.rawname, fAttributesProxy);
- }
-
- // SAX2
- if (fContentHandler != null) {
-
- if (fNamespaces) {
- // send prefix mapping events
- startNamespaceMapping();
-
- // REVISIT: It should not be necessary to iterate over the attribute
- // list when the set of [namespace attributes] is empty for this
- // element. This should be computable from the NamespaceContext, but
- // since we currently don't report the mappings for the xml prefix
- // we cannot use the declared prefix count for the current context
- // to skip this section. -- mrglavas
- int len = attributes.getLength();
- if (!fNamespacePrefixes) {
- for (int i = len - 1; i >= 0; --i) {
- attributes.getName(i, fQName);
- if ((fQName.prefix == XMLSymbols.PREFIX_XMLNS) ||
- (fQName.rawname == XMLSymbols.PREFIX_XMLNS)) {
- // remove namespace declaration attributes
- attributes.removeAttributeAt(i);
- }
- }
- }
- else if (!fXMLNSURIs) {
- for (int i = len - 1; i >= 0; --i) {
- attributes.getName(i, fQName);
- if ((fQName.prefix == XMLSymbols.PREFIX_XMLNS) ||
- (fQName.rawname == XMLSymbols.PREFIX_XMLNS)) {
- // localpart should be empty string as per SAX documentation:
- // http://www.saxproject.org/?selected=namespaces
- fQName.prefix = "";
- fQName.uri = "";
- fQName.localpart = "";
- attributes.setName(i, fQName);
- }
- }
- }
- }
-
- fAugmentations = augs;
-
- String uri = element.uri != null ? element.uri : "";
- String localpart = fNamespaces ? element.localpart : "";
- fAttributesProxy.setAttributes(attributes);
- fContentHandler.startElement(uri, localpart, element.rawname,
- fAttributesProxy);
- }
- }
- catch (SAXException e) {
- throw new XNIException(e);
- }
-
- } // startElement(QName,XMLAttributes)
-
- /**
- * Character content.
- *
- * @param text The content.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void characters(XMLString text, Augmentations augs) throws XNIException {
-
- // if type is union (XML Schema) it is possible that we receive
- // character call with empty data
- if (text.length == 0) {
- return;
- }
-
-
- try {
- // SAX1
- if (fDocumentHandler != null) {
- // REVISIT: should we support schema-normalized-value for SAX1 events
- //
- fDocumentHandler.characters(text.ch, text.offset, text.length);
- }
-
- // SAX2
- if (fContentHandler != null) {
- fContentHandler.characters(text.ch, text.offset, text.length);
- }
- }
- catch (SAXException e) {
- throw new XNIException(e);
- }
-
- } // characters(XMLString)
-
- /**
- * Ignorable whitespace. For this method to be called, the document
- * source must have some way of determining that the text containing
- * only whitespace characters should be considered ignorable. For
- * example, the validator can determine if a length of whitespace
- * characters in the document are ignorable based on the element
- * content model.
- *
- * @param text The ignorable whitespace.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void ignorableWhitespace(XMLString text, Augmentations augs) throws XNIException {
-
- try {
- // SAX1
- if (fDocumentHandler != null) {
- fDocumentHandler.ignorableWhitespace(text.ch, text.offset, text.length);
- }
-
- // SAX2
- if (fContentHandler != null) {
- fContentHandler.ignorableWhitespace(text.ch, text.offset, text.length);
- }
- }
- catch (SAXException e) {
- throw new XNIException(e);
- }
-
- } // ignorableWhitespace(XMLString)
-
- /**
- * The end of an element.
- *
- * @param element The name of the element.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endElement(QName element, Augmentations augs) throws XNIException {
-
-
- try {
- // SAX1
- if (fDocumentHandler != null) {
- fDocumentHandler.endElement(element.rawname);
- }
-
- // SAX2
- if (fContentHandler != null) {
- fAugmentations = augs;
- String uri = element.uri != null ? element.uri : "";
- String localpart = fNamespaces ? element.localpart : "";
- fContentHandler.endElement(uri, localpart,
- element.rawname);
- if (fNamespaces) {
- endNamespaceMapping();
- }
- }
- }
- catch (SAXException e) {
- throw new XNIException(e);
- }
-
- } // endElement(QName)
-
- /**
- * The start of a CDATA section.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startCDATA(Augmentations augs) throws XNIException {
-
- try {
- // SAX2 extension
- if (fLexicalHandler != null) {
- fLexicalHandler.startCDATA();
- }
- }
- catch (SAXException e) {
- throw new XNIException(e);
- }
-
- } // startCDATA()
-
- /**
- * The end of a CDATA section.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endCDATA(Augmentations augs) throws XNIException {
-
- try {
- // SAX2 extension
- if (fLexicalHandler != null) {
- fLexicalHandler.endCDATA();
- }
- }
- catch (SAXException e) {
- throw new XNIException(e);
- }
-
- } // endCDATA()
-
- /**
- * A comment.
- *
- * @param text The text in the comment.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by application to signal an error.
- */
- public void comment(XMLString text, Augmentations augs) throws XNIException {
-
- try {
- // SAX2 extension
- if (fLexicalHandler != null) {
- fLexicalHandler.comment(text.ch, 0, text.length);
- }
- }
- catch (SAXException e) {
- throw new XNIException(e);
- }
-
- } // comment(XMLString)
-
- /**
- * A processing instruction. Processing instructions consist of a
- * target name and, optionally, text data. The data is only meaningful
- * to the application.
- * <p>
- * Typically, a processing instruction's data will contain a series
- * of pseudo-attributes. These pseudo-attributes follow the form of
- * element attributes but are <strong>not</strong> parsed or presented
- * to the application as anything other than text. The application is
- * responsible for parsing the data.
- *
- * @param target The target.
- * @param data The data or null if none specified.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void processingInstruction(String target, XMLString data, Augmentations augs)
- throws XNIException {
-
- //
- // REVISIT - I keep running into SAX apps that expect
- // null data to be an empty string, which is contrary
- // to the comment for this method in the SAX API.
- //
-
- try {
- // SAX1
- if (fDocumentHandler != null) {
- fDocumentHandler.processingInstruction(target,
- data.toString());
- }
-
- // SAX2
- if (fContentHandler != null) {
- fContentHandler.processingInstruction(target, data.toString());
- }
- }
- catch (SAXException e) {
- throw new XNIException(e);
- }
-
- } // processingInstruction(String,XMLString)
-
-
- /**
- * The end of the document.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endDocument(Augmentations augs) throws XNIException {
-
- try {
- // SAX1
- if (fDocumentHandler != null) {
- fDocumentHandler.endDocument();
- }
-
- // SAX2
- if (fContentHandler != null) {
- fContentHandler.endDocument();
- }
- }
- catch (SAXException e) {
- throw new XNIException(e);
- }
-
- } // endDocument()
-
- //
- // XMLDTDHandler methods
- //
-
- /**
- * The start of the DTD external subset.
- *
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startExternalSubset(XMLResourceIdentifier identifier,
- Augmentations augs) throws XNIException {
- startParameterEntity("[dtd]", null, null, augs);
- }
-
- /**
- * The end of the DTD external subset.
- *
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endExternalSubset(Augmentations augs) throws XNIException {
- endParameterEntity("[dtd]", augs);
- }
-
- /**
- * This method notifies of the start of parameter entity. The DTD has the
- * pseudo-name of "[dtd]" parameter entity names start with '%'; and
- * general entity names are just the entity name.
- * <p>
- * <strong>Note:</strong> Since the document is an entity, the handler
- * will be notified of the start of the document entity by calling the
- * startEntity method with the entity name "[xml]" <em>before</em> calling
- * the startDocument method. When exposing entity boundaries through the
- * SAX API, the document entity is never reported, however.
- * <p>
- * <strong>Note:</strong> This method is not called for entity references
- * appearing as part of attribute values.
- *
- * @param name The name of the parameter entity.
- * @param identifier The resource identifier.
- * @param encoding The auto-detected IANA encoding name of the entity
- * stream. This value will be null in those situations
- * where the entity encoding is not auto-detected (e.g.
- * internal parameter entities).
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startParameterEntity(String name,
- XMLResourceIdentifier identifier,
- String encoding, Augmentations augs)
- throws XNIException {
-
- try {
- // Only report startEntity if this entity was actually read.
- if (augs != null && Boolean.TRUE.equals(augs.getItem(Constants.ENTITY_SKIPPED))) {
- // report skipped entity to content handler
- if (fContentHandler != null) {
- fContentHandler.skippedEntity(name);
- }
- }
- else {
- // SAX2 extension
- if (fLexicalHandler != null && fLexicalHandlerParameterEntities) {
- fLexicalHandler.startEntity(name);
- }
- }
- }
- catch (SAXException e) {
- throw new XNIException(e);
- }
-
- } // startParameterEntity(String,identifier,String,Augmentation)
-
- /**
- * This method notifies the end of an entity. The DTD has the pseudo-name
- * of "[dtd]" parameter entity names start with '%'; and general entity
- * names are just the entity name.
- * <p>
- * <strong>Note:</strong> Since the document is an entity, the handler
- * will be notified of the end of the document entity by calling the
- * endEntity method with the entity name "[xml]" <em>after</em> calling
- * the endDocument method. When exposing entity boundaries through the
- * SAX API, the document entity is never reported, however.
- * <p>
- * <strong>Note:</strong> This method is not called for entity references
- * appearing as part of attribute values.
- *
- * @param name The name of the parameter entity.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endParameterEntity(String name, Augmentations augs) throws XNIException {
-
- try {
- // Only report endEntity if this entity was actually read.
- if (augs == null || !Boolean.TRUE.equals(augs.getItem(Constants.ENTITY_SKIPPED))) {
- // SAX2 extension
- if (fLexicalHandler != null && fLexicalHandlerParameterEntities) {
- fLexicalHandler.endEntity(name);
- }
- }
- }
- catch (SAXException e) {
- throw new XNIException(e);
- }
-
- } // endEntity(String)
-
- /**
- * An element declaration.
- *
- * @param name The name of the element.
- * @param contentModel The element content model.
- *
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void elementDecl(String name, String contentModel, Augmentations augs)
- throws XNIException {
-
- try {
- // SAX2 extension
- if (fDeclHandler != null) {
- fDeclHandler.elementDecl(name, contentModel);
- }
- }
- catch (SAXException e) {
- throw new XNIException(e);
- }
-
- } // elementDecl(String,String, Augmentations)
-
- /**
- * An attribute declaration.
- *
- * @param elementName The name of the element that this attribute
- * is associated with.
- * @param attributeName The name of the attribute.
- * @param type The attribute type. This value will be one of
- * the following: "CDATA", "ENTITY", "ENTITIES",
- * "ENUMERATION", "ID", "IDREF", "IDREFS",
- * "NMTOKEN", "NMTOKENS", or "NOTATION".
- * @param enumeration If the type has the value "ENUMERATION" or
- * "NOTATION", this array holds the allowed attribute
- * values; otherwise, this array is null.
- * @param defaultType The attribute default type. This value will be
- * one of the following: "#FIXED", "#IMPLIED",
- * "#REQUIRED", or null.
- * @param defaultValue The attribute default value, or null if no
- * default value is specified.
- *
- * @param nonNormalizedDefaultValue The attribute default value with no normalization
- * performed, or null if no default value is specified.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void attributeDecl(String elementName, String attributeName,
- String type, String[] enumeration,
- String defaultType, XMLString defaultValue,
- XMLString nonNormalizedDefaultValue, Augmentations augs) throws XNIException {
-
- try {
- // SAX2 extension
- if (fDeclHandler != null) {
- // used as a key to detect duplicate attribute definitions.
- String elemAttr = new StringBuffer(elementName).append("<").append(attributeName).toString();
- if(fDeclaredAttrs.get(elemAttr) != null) {
- // we aren't permitted to return duplicate attribute definitions
- return;
- }
- fDeclaredAttrs.put(elemAttr, Boolean.TRUE);
- if (type.equals("NOTATION") ||
- type.equals("ENUMERATION")) {
-
- StringBuffer str = new StringBuffer();
- if (type.equals("NOTATION")) {
- str.append(type);
- str.append(" (");
- }
- else {
- str.append("(");
- }
- for (int i = 0; i < enumeration.length; i++) {
- str.append(enumeration[i]);
- if (i < enumeration.length - 1) {
- str.append('|');
- }
- }
- str.append(')');
- type = str.toString();
- }
- String value = (defaultValue==null) ? null : defaultValue.toString();
- fDeclHandler.attributeDecl(elementName, attributeName,
- type, defaultType, value);
- }
- }
- catch (SAXException e) {
- throw new XNIException(e);
- }
-
- } // attributeDecl(String,String,String,String[],String,XMLString, XMLString, Augmentations)
-
- /**
- * An internal entity declaration.
- *
- * @param name The name of the entity. Parameter entity names start with
- * '%', whereas the name of a general entity is just the
- * entity name.
- * @param text The value of the entity.
- * @param nonNormalizedText The non-normalized value of the entity. This
- * value contains the same sequence of characters that was in
- * the internal entity declaration, without any entity
- * references expanded.
- *
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void internalEntityDecl(String name, XMLString text,
- XMLString nonNormalizedText,
- Augmentations augs) throws XNIException {
-
- try {
- // SAX2 extensions
- if (fDeclHandler != null) {
- fDeclHandler.internalEntityDecl(name, text.toString());
- }
- }
- catch (SAXException e) {
- throw new XNIException(e);
- }
-
- } // internalEntityDecl(String,XMLString,XMLString)
-
- /**
- * An external entity declaration.
- *
- * @param name The name of the entity. Parameter entity names start
- * with '%', whereas the name of a general entity is just
- * the entity name.
- * @param identifier An object containing all location information
- * pertinent to this entity.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void externalEntityDecl(String name, XMLResourceIdentifier identifier,
- Augmentations augs) throws XNIException {
- try {
- // SAX2 extension
- if (fDeclHandler != null) {
- String publicId = identifier.getPublicId();
- String systemId = fResolveDTDURIs ?
- identifier.getExpandedSystemId() : identifier.getLiteralSystemId();
- fDeclHandler.externalEntityDecl(name, publicId, systemId);
- }
- }
- catch (SAXException e) {
- throw new XNIException(e);
- }
-
- } // externalEntityDecl(String,,XMLResourceIdentifier, Augmentations)
-
- /**
- * An unparsed entity declaration.
- *
- * @param name The name of the entity.
- * @param identifier An object containing all location information
- * pertinent to this entity.
- * @param notation The name of the notation.
- *
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void unparsedEntityDecl(String name, XMLResourceIdentifier identifier,
- String notation,
- Augmentations augs) throws XNIException {
- try {
- // SAX2 extension
- if (fDTDHandler != null) {
- String publicId = identifier.getPublicId();
- String systemId = fResolveDTDURIs ?
- identifier.getExpandedSystemId() : identifier.getLiteralSystemId();
- fDTDHandler.unparsedEntityDecl(name, publicId, systemId, notation);
- }
- }
- catch (SAXException e) {
- throw new XNIException(e);
- }
-
- } // unparsedEntityDecl(String,XMLResourceIdentifier, String, Augmentations)
-
- /**
- * A notation declaration
- *
- * @param name The name of the notation.
- * @param identifier An object containing all location information
- * pertinent to this notation.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void notationDecl(String name, XMLResourceIdentifier identifier,
- Augmentations augs) throws XNIException {
- try {
- // SAX1 and SAX2
- if (fDTDHandler != null) {
- String publicId = identifier.getPublicId();
- String systemId = fResolveDTDURIs ?
- identifier.getExpandedSystemId() : identifier.getLiteralSystemId();
- fDTDHandler.notationDecl(name, publicId, systemId);
- }
- }
- catch (SAXException e) {
- throw new XNIException(e);
- }
-
- } // notationDecl(String,XMLResourceIdentifier, Augmentations)
-
- /**
- * The end of the DTD.
- *
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endDTD(Augmentations augs) throws XNIException {
- fInDTD = false;
-
- try {
- // SAX2 extension
- if (fLexicalHandler != null) {
- fLexicalHandler.endDTD();
- }
- }
- catch (SAXException e) {
- throw new XNIException(e);
- }
- if(fDeclaredAttrs != null) {
- // help out the GC
- fDeclaredAttrs.clear();
- }
-
- } // endDTD()
-
- //
- // Parser and XMLReader methods
- //
-
- /**
- * Parses the input source specified by the given system identifier.
- * <p>
- * This method is equivalent to the following:
- * <pre>
- * parse(new InputSource(systemId));
- * </pre>
- *
- * @param systemId The system identifier (URI).
- *
- * @exception org.xml.sax.SAXException Throws exception on SAX error.
- * @exception java.io.IOException Throws exception on i/o error.
- */
- public void parse(String systemId) throws SAXException, IOException {
-
- // parse document
- XMLInputSource source = new XMLInputSource(null, systemId, null);
- try {
- parse(source);
- }
-
- // wrap XNI exceptions as SAX exceptions
- catch (XMLParseException e) {
- Exception ex = e.getException();
- if (ex == null) {
- // must be a parser exception; mine it for locator info and throw
- // a SAXParseException
- LocatorImpl locatorImpl = new LocatorImpl(){
- public String getXMLVersion() {
- return fVersion;
- }
- // since XMLParseExceptions know nothing about encoding,
- // we cannot return anything meaningful in this context.
- // We *could* consult the LocatorProxy, but the
- // application can do this itself if it wishes to possibly
- // be mislead.
- public String getEncoding() {
- return null;
- }
- };
- locatorImpl.setPublicId(e.getPublicId());
- locatorImpl.setSystemId(e.getExpandedSystemId());
- locatorImpl.setLineNumber(e.getLineNumber());
- locatorImpl.setColumnNumber(e.getColumnNumber());
- throw new SAXParseException(e.getMessage(), locatorImpl);
- }
- if (ex instanceof SAXException) {
- // why did we create an XMLParseException?
- throw (SAXException)ex;
- }
- if (ex instanceof IOException) {
- throw (IOException)ex;
- }
- throw new SAXException(ex);
- }
- catch (XNIException e) {
- Exception ex = e.getException();
- if (ex == null) {
- throw new SAXException(e.getMessage());
- }
- if (ex instanceof SAXException) {
- throw (SAXException)ex;
- }
- if (ex instanceof IOException) {
- throw (IOException)ex;
- }
- throw new SAXException(ex);
- }
-
- } // parse(String)
-
- /**
- * parse
- *
- * @param inputSource
- *
- * @exception org.xml.sax.SAXException
- * @exception java.io.IOException
- */
- public void parse(InputSource inputSource)
- throws SAXException, IOException {
-
- // parse document
- try {
- XMLInputSource xmlInputSource =
- new XMLInputSource(inputSource.getPublicId(),
- inputSource.getSystemId(),
- null);
- xmlInputSource.setByteStream(inputSource.getByteStream());
- xmlInputSource.setCharacterStream(inputSource.getCharacterStream());
- xmlInputSource.setEncoding(inputSource.getEncoding());
- parse(xmlInputSource);
- }
-
- // wrap XNI exceptions as SAX exceptions
- catch (XMLParseException e) {
- Exception ex = e.getException();
- if (ex == null) {
- // must be a parser exception; mine it for locator info and throw
- // a SAXParseException
- LocatorImpl locatorImpl = new LocatorImpl() {
- public String getXMLVersion() {
- return fVersion;
- }
- // since XMLParseExceptions know nothing about encoding,
- // we cannot return anything meaningful in this context.
- // We *could* consult the LocatorProxy, but the
- // application can do this itself if it wishes to possibly
- // be mislead.
- public String getEncoding() {
- return null;
- }
- };
- locatorImpl.setPublicId(e.getPublicId());
- locatorImpl.setSystemId(e.getExpandedSystemId());
- locatorImpl.setLineNumber(e.getLineNumber());
- locatorImpl.setColumnNumber(e.getColumnNumber());
- throw new SAXParseException(e.getMessage(), locatorImpl);
- }
- if (ex instanceof SAXException) {
- // why did we create an XMLParseException?
- throw (SAXException)ex;
- }
- if (ex instanceof IOException) {
- throw (IOException)ex;
- }
- throw new SAXException(ex);
- }
- catch (XNIException e) {
- Exception ex = e.getException();
- if (ex == null) {
- throw new SAXException(e.getMessage());
- }
- if (ex instanceof SAXException) {
- throw (SAXException)ex;
- }
- if (ex instanceof IOException) {
- throw (IOException)ex;
- }
- throw new SAXException(ex);
- }
-
- } // parse(InputSource)
-
- /**
- * Sets the resolver used to resolve external entities. The EntityResolver
- * interface supports resolution of public and system identifiers.
- *
- * @param resolver The new entity resolver. Passing a null value will
- * uninstall the currently installed resolver.
- */
- public void setEntityResolver(EntityResolver resolver) {
-
- try {
- XMLEntityResolver xer = (XMLEntityResolver) fConfiguration.getProperty(ENTITY_RESOLVER);
- if (fUseEntityResolver2 && resolver instanceof EntityResolver2) {
- if (xer instanceof EntityResolver2Wrapper) {
- EntityResolver2Wrapper er2w = (EntityResolver2Wrapper) xer;
- er2w.setEntityResolver((EntityResolver2) resolver);
- }
- else {
- fConfiguration.setProperty(ENTITY_RESOLVER,
- new EntityResolver2Wrapper((EntityResolver2) resolver));
- }
- }
- else {
- if (xer instanceof EntityResolverWrapper) {
- EntityResolverWrapper erw = (EntityResolverWrapper) xer;
- erw.setEntityResolver(resolver);
- }
- else {
- fConfiguration.setProperty(ENTITY_RESOLVER,
- new EntityResolverWrapper(resolver));
- }
- }
- }
- catch (XMLConfigurationException e) {
- // do nothing
- }
-
- } // setEntityResolver(EntityResolver)
-
- /**
- * Return the current entity resolver.
- *
- * @return The current entity resolver, or null if none
- * has been registered.
- * @see #setEntityResolver
- */
- public EntityResolver getEntityResolver() {
-
- EntityResolver entityResolver = null;
- try {
- XMLEntityResolver xmlEntityResolver =
- (XMLEntityResolver)fConfiguration.getProperty(ENTITY_RESOLVER);
- if (xmlEntityResolver != null) {
- if (xmlEntityResolver instanceof EntityResolverWrapper) {
- entityResolver =
- ((EntityResolverWrapper) xmlEntityResolver).getEntityResolver();
- }
- else if (xmlEntityResolver instanceof EntityResolver2Wrapper) {
- entityResolver =
- ((EntityResolver2Wrapper) xmlEntityResolver).getEntityResolver();
- }
- }
- }
- catch (XMLConfigurationException e) {
- // do nothing
- }
- return entityResolver;
-
- } // getEntityResolver():EntityResolver
-
- /**
- * Allow an application to register an error event handler.
- *
- * <p>If the application does not register an error handler, all
- * error events reported by the SAX parser will be silently
- * ignored; however, normal processing may not continue. It is
- * highly recommended that all SAX applications implement an
- * error handler to avoid unexpected bugs.</p>
- *
- * <p>Applications may register a new or different handler in the
- * middle of a parse, and the SAX parser must begin using the new
- * handler immediately.</p>
- *
- * @param errorHandler The error handler.
- * @see #getErrorHandler
- */
- public void setErrorHandler(ErrorHandler errorHandler) {
-
- try {
- XMLErrorHandler xeh = (XMLErrorHandler) fConfiguration.getProperty(ERROR_HANDLER);
- if (xeh instanceof ErrorHandlerWrapper) {
- ErrorHandlerWrapper ehw = (ErrorHandlerWrapper) xeh;
- ehw.setErrorHandler(errorHandler);
- }
- else {
- fConfiguration.setProperty(ERROR_HANDLER,
- new ErrorHandlerWrapper(errorHandler));
- }
- }
- catch (XMLConfigurationException e) {
- // do nothing
- }
-
- } // setErrorHandler(ErrorHandler)
-
- /**
- * Return the current error handler.
- *
- * @return The current error handler, or null if none
- * has been registered.
- * @see #setErrorHandler
- */
- public ErrorHandler getErrorHandler() {
-
- ErrorHandler errorHandler = null;
- try {
- XMLErrorHandler xmlErrorHandler =
- (XMLErrorHandler)fConfiguration.getProperty(ERROR_HANDLER);
- if (xmlErrorHandler != null &&
- xmlErrorHandler instanceof ErrorHandlerWrapper) {
- errorHandler = ((ErrorHandlerWrapper)xmlErrorHandler).getErrorHandler();
- }
- }
- catch (XMLConfigurationException e) {
- // do nothing
- }
- return errorHandler;
-
- } // getErrorHandler():ErrorHandler
-
- /**
- * Set the locale to use for messages.
- *
- * @param locale The locale object to use for localization of messages.
- *
- * @exception SAXException An exception thrown if the parser does not
- * support the specified locale.
- *
- * @see org.xml.sax.Parser
- */
- public void setLocale(Locale locale) throws SAXException {
- //REVISIT:this methods is not part of SAX2 interfaces, we should throw exception
- //if any application uses SAX2 and sets locale also. -nb
- fConfiguration.setLocale(locale);
-
- } // setLocale(Locale)
-
- /**
- * Allow an application to register a DTD event handler.
- * <p>
- * If the application does not register a DTD handler, all DTD
- * events reported by the SAX parser will be silently ignored.
- * <p>
- * Applications may register a new or different handler in the
- * middle of a parse, and the SAX parser must begin using the new
- * handler immediately.
- *
- * @param dtdHandler The DTD handler.
- *
-
- * @see #getDTDHandler
- */
- public void setDTDHandler(DTDHandler dtdHandler) {
- fDTDHandler = dtdHandler;
- } // setDTDHandler(DTDHandler)
-
- //
- // Parser methods
- //
-
- /**
- * Allow an application to register a document event handler.
- * <p>
- * If the application does not register a document handler, all
- * document events reported by the SAX parser will be silently
- * ignored (this is the default behaviour implemented by
- * HandlerBase).
- * <p>
- * Applications may register a new or different handler in the
- * middle of a parse, and the SAX parser must begin using the new
- * handler immediately.
- *
- * @param documentHandler The document handler.
- */
- public void setDocumentHandler(DocumentHandler documentHandler) {
- fDocumentHandler = documentHandler;
- } // setDocumentHandler(DocumentHandler)
-
- //
- // XMLReader methods
- //
-
- /**
- * Allow an application to register a content event handler.
- * <p>
- * If the application does not register a content handler, all
- * content events reported by the SAX parser will be silently
- * ignored.
- * <p>
- * Applications may register a new or different handler in the
- * middle of a parse, and the SAX parser must begin using the new
- * handler immediately.
- *
- * @param contentHandler The content handler.
- *
- * @see #getContentHandler
- */
- public void setContentHandler(ContentHandler contentHandler) {
- fContentHandler = contentHandler;
- } // setContentHandler(ContentHandler)
-
- /**
- * Return the current content handler.
- *
- * @return The current content handler, or null if none
- * has been registered.
- *
- * @see #setContentHandler
- */
- public ContentHandler getContentHandler() {
- return fContentHandler;
- } // getContentHandler():ContentHandler
-
- /**
- * Return the current DTD handler.
- *
- * @return The current DTD handler, or null if none
- * has been registered.
- * @see #setDTDHandler
- */
- public DTDHandler getDTDHandler() {
- return fDTDHandler;
- } // getDTDHandler():DTDHandler
-
- /**
- * Set the state of any feature in a SAX2 parser. The parser
- * might not recognize the feature, and if it does recognize
- * it, it might not be able to fulfill the request.
- *
- * @param featureId The unique identifier (URI) of the feature.
- * @param state The requested state of the feature (true or false).
- *
- * @exception SAXNotRecognizedException If the
- * requested feature is not known.
- * @exception SAXNotSupportedException If the
- * requested feature is known, but the requested
- * state is not supported.
- */
- public void setFeature(String featureId, boolean state)
- throws SAXNotRecognizedException, SAXNotSupportedException {
-
- try {
- //
- // SAX2 Features
- //
-
- if (featureId.startsWith(Constants.SAX_FEATURE_PREFIX)) {
- final int suffixLength = featureId.length() - Constants.SAX_FEATURE_PREFIX.length();
-
- // http://xml.org/sax/features/namespaces
- if (suffixLength == Constants.NAMESPACES_FEATURE.length() &&
- featureId.endsWith(Constants.NAMESPACES_FEATURE)) {
- fConfiguration.setFeature(featureId, state);
- fNamespaces = state;
- return;
- }
-
- // http://xml.org/sax/features/namespace-prefixes
- // controls the reporting of raw prefixed names and Namespace
- // declarations (xmlns* attributes): when this feature is false
- // (the default), raw prefixed names may optionally be reported,
- // and xmlns* attributes must not be reported.
- //
- if (suffixLength == Constants.NAMESPACE_PREFIXES_FEATURE.length() &&
- featureId.endsWith(Constants.NAMESPACE_PREFIXES_FEATURE)) {
- fConfiguration.setFeature(featureId, state);
- fNamespacePrefixes = state;
- return;
- }
-
- // http://xml.org/sax/features/string-interning
- // controls the use of java.lang.String#intern() for strings
- // passed to SAX handlers.
- //
- if (suffixLength == Constants.STRING_INTERNING_FEATURE.length() &&
- featureId.endsWith(Constants.STRING_INTERNING_FEATURE)) {
- if (!state) {
- throw new SAXNotSupportedException(
- SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
- "false-not-supported", new Object [] {featureId}));
- }
- return;
- }
-
- // http://xml.org/sax/features/lexical-handler/parameter-entities
- // controls whether the beginning and end of parameter entities
- // will be reported to the LexicalHandler.
- //
- if (suffixLength == Constants.LEXICAL_HANDLER_PARAMETER_ENTITIES_FEATURE.length() &&
- featureId.endsWith(Constants.LEXICAL_HANDLER_PARAMETER_ENTITIES_FEATURE)) {
- fLexicalHandlerParameterEntities = state;
- return;
- }
-
- // http://xml.org/sax/features/resolve-dtd-uris
- // controls whether system identifiers will be absolutized relative to
- // their base URIs before reporting.
- //
- if (suffixLength == Constants.RESOLVE_DTD_URIS_FEATURE.length() &&
- featureId.endsWith(Constants.RESOLVE_DTD_URIS_FEATURE)) {
- fResolveDTDURIs = state;
- return;
- }
-
- // http://xml.org/sax/features/unicode-normalization-checking
- // controls whether Unicode normalization checking is performed
- // as per Appendix B of the XML 1.1 specification
- //
- if (suffixLength == Constants.UNICODE_NORMALIZATION_CHECKING_FEATURE.length() &&
- featureId.endsWith(Constants.UNICODE_NORMALIZATION_CHECKING_FEATURE)) {
- // REVISIT: Allow this feature to be set once Unicode normalization
- // checking is supported -- mrglavas.
- if (state) {
- throw new SAXNotSupportedException(
- SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
- "true-not-supported", new Object [] {featureId}));
- }
- return;
- }
-
- // http://xml.org/sax/features/xmlns-uris
- // controls whether the parser reports that namespace declaration
- // attributes as being in the namespace: http://www.w3.org/2000/xmlns/
- //
- if (suffixLength == Constants.XMLNS_URIS_FEATURE.length() &&
- featureId.endsWith(Constants.XMLNS_URIS_FEATURE)) {
- fXMLNSURIs = state;
- return;
- }
-
- // http://xml.org/sax/features/use-entity-resolver2
- // controls whether the methods of an object implementing
- // org.xml.sax.ext.EntityResolver2 will be used by the parser.
- //
- if (suffixLength == Constants.USE_ENTITY_RESOLVER2_FEATURE.length() &&
- featureId.endsWith(Constants.USE_ENTITY_RESOLVER2_FEATURE)) {
- if (state != fUseEntityResolver2) {
- fUseEntityResolver2 = state;
- // Refresh EntityResolver wrapper.
- setEntityResolver(getEntityResolver());
- }
- return;
- }
-
- //
- // Read only features.
- //
-
- // http://xml.org/sax/features/is-standalone
- // reports whether the document specified a standalone document declaration.
- // http://xml.org/sax/features/use-attributes2
- // reports whether Attributes objects passed to startElement also implement
- // the org.xml.sax.ext.Attributes2 interface.
- // http://xml.org/sax/features/use-locator2
- // reports whether Locator objects passed to setDocumentLocator also implement
- // the org.xml.sax.ext.Locator2 interface.
- // http://xml.org/sax/features/xml-1.1
- // reports whether the parser supports both XML 1.1 and XML 1.0.
- if ((suffixLength == Constants.IS_STANDALONE_FEATURE.length() &&
- featureId.endsWith(Constants.IS_STANDALONE_FEATURE)) ||
- (suffixLength == Constants.USE_ATTRIBUTES2_FEATURE.length() &&
- featureId.endsWith(Constants.USE_ATTRIBUTES2_FEATURE)) ||
- (suffixLength == Constants.USE_LOCATOR2_FEATURE.length() &&
- featureId.endsWith(Constants.USE_LOCATOR2_FEATURE)) ||
- (suffixLength == Constants.XML_11_FEATURE.length() &&
- featureId.endsWith(Constants.XML_11_FEATURE))) {
- throw new SAXNotSupportedException(
- SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
- "feature-read-only", new Object [] {featureId}));
- }
-
-
- //
- // Drop through and perform default processing
- //
- }
- else if (featureId.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
- if (state) {
- if (fConfiguration.getProperty(SECURITY_MANAGER )==null) {
- fConfiguration.setProperty(SECURITY_MANAGER, new XMLSecurityManager());
- }
- }
- }
-
- //
- // Default handling
- //
-
- fConfiguration.setFeature(featureId, state);
- }
- catch (XMLConfigurationException e) {
- String identifier = e.getIdentifier();
- if (e.getType() == Status.NOT_RECOGNIZED) {
- throw new SAXNotRecognizedException(
- SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
- "feature-not-recognized", new Object [] {identifier}));
- }
- else {
- throw new SAXNotSupportedException(
- SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
- "feature-not-supported", new Object [] {identifier}));
- }
- }
-
- } // setFeature(String,boolean)
-
- /**
- * Query the state of a feature.
- *
- * Query the current state of any feature in a SAX2 parser. The
- * parser might not recognize the feature.
- *
- * @param featureId The unique identifier (URI) of the feature
- * being set.
- * @return The current state of the feature.
- * @exception org.xml.sax.SAXNotRecognizedException If the
- * requested feature is not known.
- * @exception SAXNotSupportedException If the
- * requested feature is known but not supported.
- */
- public boolean getFeature(String featureId)
- throws SAXNotRecognizedException, SAXNotSupportedException {
-
- try {
- //
- // SAX2 Features
- //
-
- if (featureId.startsWith(Constants.SAX_FEATURE_PREFIX)) {
- final int suffixLength = featureId.length() - Constants.SAX_FEATURE_PREFIX.length();
-
- // http://xml.org/sax/features/namespace-prefixes
- // controls the reporting of raw prefixed names and Namespace
- // declarations (xmlns* attributes): when this feature is false
- // (the default), raw prefixed names may optionally be reported,
- // and xmlns* attributes must not be reported.
- //
- if (suffixLength == Constants.NAMESPACE_PREFIXES_FEATURE.length() &&
- featureId.endsWith(Constants.NAMESPACE_PREFIXES_FEATURE)) {
- boolean state = fConfiguration.getFeature(featureId);
- return state;
- }
- // http://xml.org/sax/features/string-interning
- // controls the use of java.lang.String#intern() for strings
- // passed to SAX handlers.
- //
- if (suffixLength == Constants.STRING_INTERNING_FEATURE.length() &&
- featureId.endsWith(Constants.STRING_INTERNING_FEATURE)) {
- return true;
- }
-
- // http://xml.org/sax/features/is-standalone
- // reports whether the document specified a standalone document declaration.
- //
- if (suffixLength == Constants.IS_STANDALONE_FEATURE.length() &&
- featureId.endsWith(Constants.IS_STANDALONE_FEATURE)) {
- return fStandalone;
- }
-
- // http://xml.org/sax/features/xml-1.1
- // reports whether the parser supports both XML 1.1 and XML 1.0.
- //
- if (suffixLength == Constants.XML_11_FEATURE.length() &&
- featureId.endsWith(Constants.XML_11_FEATURE)) {
- return (fConfiguration instanceof XML11Configurable);
- }
-
- // http://xml.org/sax/features/lexical-handler/parameter-entities
- // controls whether the beginning and end of parameter entities
- // will be reported to the LexicalHandler.
- //
- if (suffixLength == Constants.LEXICAL_HANDLER_PARAMETER_ENTITIES_FEATURE.length() &&
- featureId.endsWith(Constants.LEXICAL_HANDLER_PARAMETER_ENTITIES_FEATURE)) {
- return fLexicalHandlerParameterEntities;
- }
-
- // http://xml.org/sax/features/resolve-dtd-uris
- // controls whether system identifiers will be absolutized relative to
- // their base URIs before reporting.
- if (suffixLength == Constants.RESOLVE_DTD_URIS_FEATURE.length() &&
- featureId.endsWith(Constants.RESOLVE_DTD_URIS_FEATURE)) {
- return fResolveDTDURIs;
- }
-
- // http://xml.org/sax/features/xmlns-uris
- // controls whether the parser reports that namespace declaration
- // attributes as being in the namespace: http://www.w3.org/2000/xmlns/
- //
- if (suffixLength == Constants.XMLNS_URIS_FEATURE.length() &&
- featureId.endsWith(Constants.XMLNS_URIS_FEATURE)) {
- return fXMLNSURIs;
- }
-
- // http://xml.org/sax/features/unicode-normalization-checking
- // controls whether Unicode normalization checking is performed
- // as per Appendix B of the XML 1.1 specification
- //
- if (suffixLength == Constants.UNICODE_NORMALIZATION_CHECKING_FEATURE.length() &&
- featureId.endsWith(Constants.UNICODE_NORMALIZATION_CHECKING_FEATURE)) {
- // REVISIT: Allow this feature to be set once Unicode normalization
- // checking is supported -- mrglavas.
- return false;
- }
-
- // http://xml.org/sax/features/use-entity-resolver2
- // controls whether the methods of an object implementing
- // org.xml.sax.ext.EntityResolver2 will be used by the parser.
- //
- if (suffixLength == Constants.USE_ENTITY_RESOLVER2_FEATURE.length() &&
- featureId.endsWith(Constants.USE_ENTITY_RESOLVER2_FEATURE)) {
- return fUseEntityResolver2;
- }
-
- // http://xml.org/sax/features/use-attributes2
- // reports whether Attributes objects passed to startElement also implement
- // the org.xml.sax.ext.Attributes2 interface.
- // http://xml.org/sax/features/use-locator2
- // reports whether Locator objects passed to setDocumentLocator also implement
- // the org.xml.sax.ext.Locator2 interface.
- //
- if ((suffixLength == Constants.USE_ATTRIBUTES2_FEATURE.length() &&
- featureId.endsWith(Constants.USE_ATTRIBUTES2_FEATURE)) ||
- (suffixLength == Constants.USE_LOCATOR2_FEATURE.length() &&
- featureId.endsWith(Constants.USE_LOCATOR2_FEATURE))) {
- return true;
- }
-
-
- //
- // Drop through and perform default processing
- //
- }
-
- //
- // Xerces Features
- //
-
- /*
- else if (featureId.startsWith(XERCES_FEATURES_PREFIX)) {
- //
- // Drop through and perform default processing
- //
- }
- */
-
- return fConfiguration.getFeature(featureId);
- }
- catch (XMLConfigurationException e) {
- String identifier = e.getIdentifier();
- if (e.getType() == Status.NOT_RECOGNIZED) {
- throw new SAXNotRecognizedException(
- SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
- "feature-not-recognized", new Object [] {identifier}));
- }
- else {
- throw new SAXNotSupportedException(
- SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
- "feature-not-supported", new Object [] {identifier}));
- }
- }
-
- } // getFeature(String):boolean
-
- /**
- * Set the value of any property in a SAX2 parser. The parser
- * might not recognize the property, and if it does recognize
- * it, it might not support the requested value.
- *
- * @param propertyId The unique identifier (URI) of the property
- * being set.
- * @param value The value to which the property is being set.
- *
- * @exception SAXNotRecognizedException If the
- * requested property is not known.
- * @exception SAXNotSupportedException If the
- * requested property is known, but the requested
- * value is not supported.
- */
- public void setProperty(String propertyId, Object value)
- throws SAXNotRecognizedException, SAXNotSupportedException {
-
- try {
- //
- // SAX2 core properties
- //
-
- if (propertyId.startsWith(Constants.SAX_PROPERTY_PREFIX)) {
- final int suffixLength = propertyId.length() - Constants.SAX_PROPERTY_PREFIX.length();
-
- //
- // http://xml.org/sax/properties/lexical-handler
- // Value type: org.xml.sax.ext.LexicalHandler
- // Access: read/write, pre-parse only
- // Set the lexical event handler.
- //
- if (suffixLength == Constants.LEXICAL_HANDLER_PROPERTY.length() &&
- propertyId.endsWith(Constants.LEXICAL_HANDLER_PROPERTY)) {
- try {
- setLexicalHandler((LexicalHandler)value);
- }
- catch (ClassCastException e) {
- throw new SAXNotSupportedException(
- SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
- "incompatible-class", new Object [] {propertyId, "org.xml.sax.ext.LexicalHandler"}));
- }
- return;
- }
- //
- // http://xml.org/sax/properties/declaration-handler
- // Value type: org.xml.sax.ext.DeclHandler
- // Access: read/write, pre-parse only
- // Set the DTD declaration event handler.
- //
- if (suffixLength == Constants.DECLARATION_HANDLER_PROPERTY.length() &&
- propertyId.endsWith(Constants.DECLARATION_HANDLER_PROPERTY)) {
- try {
- setDeclHandler((DeclHandler)value);
- }
- catch (ClassCastException e) {
- throw new SAXNotSupportedException(
- SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
- "incompatible-class", new Object [] {propertyId, "org.xml.sax.ext.DeclHandler"}));
- }
- return;
- }
- //
- // http://xml.org/sax/properties/dom-node
- // Value type: DOM Node
- // Access: read-only
- // Get the DOM node currently being visited, if the SAX parser is
- // iterating over a DOM tree. If the parser recognises and
- // supports this property but is not currently visiting a DOM
- // node, it should return null (this is a good way to check for
- // availability before the parse begins).
- // http://xml.org/sax/properties/document-xml-version
- // Value type: java.lang.String
- // Access: read-only
- // The literal string describing the actual XML version of the document.
- //
- if ((suffixLength == Constants.DOM_NODE_PROPERTY.length() &&
- propertyId.endsWith(Constants.DOM_NODE_PROPERTY)) ||
- (suffixLength == Constants.DOCUMENT_XML_VERSION_PROPERTY.length() &&
- propertyId.endsWith(Constants.DOCUMENT_XML_VERSION_PROPERTY))) {
- throw new SAXNotSupportedException(
- SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
- "property-read-only", new Object [] {propertyId}));
- }
- //
- // Drop through and perform default processing
- //
- }
-
- //
- // Xerces Properties
- //
-
- /*
- else if (propertyId.startsWith(XERCES_PROPERTIES_PREFIX)) {
- //
- // Drop through and perform default processing
- //
- }
- */
-
- //
- // Perform default processing
- //
-
- fConfiguration.setProperty(propertyId, value);
- }
- catch (XMLConfigurationException e) {
- String identifier = e.getIdentifier();
- if (e.getType() == Status.NOT_RECOGNIZED) {
- throw new SAXNotRecognizedException(
- SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
- "property-not-recognized", new Object [] {identifier}));
- }
- else {
- throw new SAXNotSupportedException(
- SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
- "property-not-supported", new Object [] {identifier}));
- }
- }
-
- } // setProperty(String,Object)
-
- /**
- * Query the value of a property.
- *
- * Return the current value of a property in a SAX2 parser.
- * The parser might not recognize the property.
- *
- * @param propertyId The unique identifier (URI) of the property
- * being set.
- * @return The current value of the property.
- * @exception org.xml.sax.SAXNotRecognizedException If the
- * requested property is not known.
- * @exception SAXNotSupportedException If the
- * requested property is known but not supported.
- */
- public Object getProperty(String propertyId)
- throws SAXNotRecognizedException, SAXNotSupportedException {
-
- try {
- //
- // SAX2 core properties
- //
-
- if (propertyId.startsWith(Constants.SAX_PROPERTY_PREFIX)) {
- final int suffixLength = propertyId.length() - Constants.SAX_PROPERTY_PREFIX.length();
-
- //
- // http://xml.org/sax/properties/document-xml-version
- // Value type: java.lang.String
- // Access: read-only
- // The literal string describing the actual XML version of the document.
- //
- if (suffixLength == Constants.DOCUMENT_XML_VERSION_PROPERTY.length() &&
- propertyId.endsWith(Constants.DOCUMENT_XML_VERSION_PROPERTY)) {
- return fVersion;
- }
-
- //
- // http://xml.org/sax/properties/lexical-handler
- // Value type: org.xml.sax.ext.LexicalHandler
- // Access: read/write, pre-parse only
- // Set the lexical event handler.
- //
- if (suffixLength == Constants.LEXICAL_HANDLER_PROPERTY.length() &&
- propertyId.endsWith(Constants.LEXICAL_HANDLER_PROPERTY)) {
- return getLexicalHandler();
- }
- //
- // http://xml.org/sax/properties/declaration-handler
- // Value type: org.xml.sax.ext.DeclHandler
- // Access: read/write, pre-parse only
- // Set the DTD declaration event handler.
- //
- if (suffixLength == Constants.DECLARATION_HANDLER_PROPERTY.length() &&
- propertyId.endsWith(Constants.DECLARATION_HANDLER_PROPERTY)) {
- return getDeclHandler();
- }
-
- //
- // http://xml.org/sax/properties/dom-node
- // Value type: DOM Node
- // Access: read-only
- // Get the DOM node currently being visited, if the SAX parser is
- // iterating over a DOM tree. If the parser recognises and
- // supports this property but is not currently visiting a DOM
- // node, it should return null (this is a good way to check for
- // availability before the parse begins).
- //
- if (suffixLength == Constants.DOM_NODE_PROPERTY.length() &&
- propertyId.endsWith(Constants.DOM_NODE_PROPERTY)) {
- // we are not iterating a DOM tree
- throw new SAXNotSupportedException(
- SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
- "dom-node-read-not-supported", null));
- }
-
- //
- // Drop through and perform default processing
- //
- }
-
- //
- // Xerces properties
- //
-
- /*
- else if (propertyId.startsWith(XERCES_PROPERTIES_PREFIX)) {
- //
- // Drop through and perform default processing
- //
- }
- */
-
- //
- // Perform default processing
- //
-
- return fConfiguration.getProperty(propertyId);
- }
- catch (XMLConfigurationException e) {
- String identifier = e.getIdentifier();
- if (e.getType() == Status.NOT_RECOGNIZED) {
- throw new SAXNotRecognizedException(
- SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
- "property-not-recognized", new Object [] {identifier}));
- }
- else {
- throw new SAXNotSupportedException(
- SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
- "property-not-supported", new Object [] {identifier}));
- }
- }
-
- } // getProperty(String):Object
-
- //
- // Protected methods
- //
-
- // SAX2 core properties
-
- /**
- * Set the DTD declaration event handler.
- * <p>
- * This method is the equivalent to the property:
- * <pre>
- * http://xml.org/sax/properties/declaration-handler
- * </pre>
- *
- * @param handler The new handler.
- *
- * @see #getDeclHandler
- * @see #setProperty
- */
- protected void setDeclHandler(DeclHandler handler)
- throws SAXNotRecognizedException, SAXNotSupportedException {
-
- if (fParseInProgress) {
- throw new SAXNotSupportedException(
- SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
- "property-not-parsing-supported",
- new Object [] {"http://xml.org/sax/properties/declaration-handler"}));
- }
- fDeclHandler = handler;
-
- } // setDeclHandler(DeclHandler)
-
- /**
- * Returns the DTD declaration event handler.
- *
- * @see #setDeclHandler
- */
- protected DeclHandler getDeclHandler()
- throws SAXNotRecognizedException, SAXNotSupportedException {
- return fDeclHandler;
- } // getDeclHandler():DeclHandler
-
- /**
- * Set the lexical event handler.
- * <p>
- * This method is the equivalent to the property:
- * <pre>
- * http://xml.org/sax/properties/lexical-handler
- * </pre>
- *
- * @param handler lexical event handler
- *
- * @see #getLexicalHandler
- * @see #setProperty
- */
- protected void setLexicalHandler(LexicalHandler handler)
- throws SAXNotRecognizedException, SAXNotSupportedException {
-
- if (fParseInProgress) {
- throw new SAXNotSupportedException(
- SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
- "property-not-parsing-supported",
- new Object [] {"http://xml.org/sax/properties/lexical-handler"}));
- }
- fLexicalHandler = handler;
-
- } // setLexicalHandler(LexicalHandler)
-
- /**
- * Returns the lexical handler.
- *
- * @see #setLexicalHandler
- */
- protected LexicalHandler getLexicalHandler()
- throws SAXNotRecognizedException, SAXNotSupportedException {
- return fLexicalHandler;
- } // getLexicalHandler():LexicalHandler
-
- /**
- * Send startPrefixMapping events
- */
- protected final void startNamespaceMapping() throws SAXException{
- int count = fNamespaceContext.getDeclaredPrefixCount();
- if (count > 0) {
- String prefix = null;
- String uri = null;
- for (int i = 0; i < count; i++) {
- prefix = fNamespaceContext.getDeclaredPrefixAt(i);
- uri = fNamespaceContext.getURI(prefix);
- fContentHandler.startPrefixMapping(prefix,
- (uri == null) ? "" : uri);
- }
- }
- }
-
- /**
- * Send endPrefixMapping events
- */
- protected final void endNamespaceMapping() throws SAXException {
- int count = fNamespaceContext.getDeclaredPrefixCount();
- if (count > 0) {
- for (int i = 0; i < count; i++) {
- fContentHandler.endPrefixMapping(fNamespaceContext.getDeclaredPrefixAt(i));
- }
- }
- }
-
- //
- // XMLDocumentParser methods
- //
-
- /**
- * Reset all components before parsing.
- *
- * @throws XNIException Thrown if an error occurs during initialization.
- */
- public void reset() throws XNIException {
- super.reset();
-
- // reset state
- fInDTD = false;
- fVersion = "1.0";
- fStandalone = false;
-
- // features
- fNamespaces = fConfiguration.getFeature(NAMESPACES);
- fNamespacePrefixes = fConfiguration.getFeature(NAMESPACE_PREFIXES);
- fAugmentations = null;
- fDeclaredAttrs = null;
-
- } // reset()
-
- //
- // Classes
- //
-
- protected class LocatorProxy
- implements Locator2 {
-
- //
- // Data
- //
-
- /** XML locator. */
- protected XMLLocator fLocator;
-
- //
- // Constructors
- //
-
- /** Constructs an XML locator proxy. */
- public LocatorProxy(XMLLocator locator) {
- fLocator = locator;
- }
-
- //
- // Locator methods
- //
-
- /** Public identifier. */
- public String getPublicId() {
- return fLocator.getPublicId();
- }
-
- /** System identifier. */
- public String getSystemId() {
- return fLocator.getExpandedSystemId();
- }
- /** Line number. */
- public int getLineNumber() {
- return fLocator.getLineNumber();
- }
-
- /** Column number. */
- public int getColumnNumber() {
- return fLocator.getColumnNumber();
- }
-
- // Locator2 methods
- public String getXMLVersion() {
- return fLocator.getXMLVersion();
- }
-
- public String getEncoding() {
- return fLocator.getEncoding();
- }
-
- } // class LocatorProxy
-
- protected static final class AttributesProxy
- implements AttributeList, Attributes2 {
-
- //
- // Data
- //
-
- /** XML attributes. */
- protected XMLAttributes fAttributes;
-
- //
- // Public methods
- //
-
- /** Sets the XML attributes. */
- public void setAttributes(XMLAttributes attributes) {
- fAttributes = attributes;
- } // setAttributes(XMLAttributes)
-
- public int getLength() {
- return fAttributes.getLength();
- }
-
- public String getName(int i) {
- return fAttributes.getQName(i);
- }
-
- public String getQName(int index) {
- return fAttributes.getQName(index);
- }
-
- public String getURI(int index) {
- // REVISIT: this hides the fact that internally we use
- // null instead of empty string
- // SAX requires URI to be a string or an empty string
- String uri= fAttributes.getURI(index);
- return uri != null ? uri : "";
- }
-
- public String getLocalName(int index) {
- return fAttributes.getLocalName(index);
- }
-
- public String getType(int i) {
- return fAttributes.getType(i);
- }
-
- public String getType(String name) {
- return fAttributes.getType(name);
- }
-
- public String getType(String uri, String localName) {
- return uri.equals("") ? fAttributes.getType(null, localName) :
- fAttributes.getType(uri, localName);
- }
-
- public String getValue(int i) {
- return fAttributes.getValue(i);
- }
-
- public String getValue(String name) {
- return fAttributes.getValue(name);
- }
-
- public String getValue(String uri, String localName) {
- return uri.equals("") ? fAttributes.getValue(null, localName) :
- fAttributes.getValue(uri, localName);
- }
-
- public int getIndex(String qName) {
- return fAttributes.getIndex(qName);
- }
-
- public int getIndex(String uri, String localPart) {
- return uri.equals("") ? fAttributes.getIndex(null, localPart) :
- fAttributes.getIndex(uri, localPart);
- }
-
- // Attributes2 methods
- // REVISIT: Localize exception messages. -- mrglavas
- public boolean isDeclared(int index) {
- if (index < 0 || index >= fAttributes.getLength()) {
- throw new ArrayIndexOutOfBoundsException(index);
- }
- return Boolean.TRUE.equals(
- fAttributes.getAugmentations(index).getItem(
- Constants.ATTRIBUTE_DECLARED));
- }
-
- public boolean isDeclared(String qName) {
- int index = getIndex(qName);
- if (index == -1) {
- throw new IllegalArgumentException(qName);
- }
- return Boolean.TRUE.equals(
- fAttributes.getAugmentations(index).getItem(
- Constants.ATTRIBUTE_DECLARED));
- }
-
- public boolean isDeclared(String uri, String localName) {
- int index = getIndex(uri, localName);
- if (index == -1) {
- throw new IllegalArgumentException(localName);
- }
- return Boolean.TRUE.equals(
- fAttributes.getAugmentations(index).getItem(
- Constants.ATTRIBUTE_DECLARED));
- }
-
- public boolean isSpecified(int index) {
- if (index < 0 || index >= fAttributes.getLength()) {
- throw new ArrayIndexOutOfBoundsException(index);
- }
- return fAttributes.isSpecified(index);
- }
-
- public boolean isSpecified(String qName) {
- int index = getIndex(qName);
- if (index == -1) {
- throw new IllegalArgumentException(qName);
- }
- return fAttributes.isSpecified(index);
- }
-
- public boolean isSpecified(String uri, String localName) {
- int index = getIndex(uri, localName);
- if (index == -1) {
- throw new IllegalArgumentException(localName);
- }
- return fAttributes.isSpecified(index);
- }
-
- } // class AttributesProxy
-
-
- // PSVIProvider methods
-
- public ElementPSVI getElementPSVI(){
- return (fAugmentations != null)?(ElementPSVI)fAugmentations.getItem(Constants.ELEMENT_PSVI):null;
- }
-
-
- public AttributePSVI getAttributePSVI(int index){
-
- return (AttributePSVI)fAttributesProxy.fAttributes.getAugmentations(index).getItem(Constants.ATTRIBUTE_PSVI);
- }
-
-
- public AttributePSVI getAttributePSVIByName(String uri,
- String localname){
- return (AttributePSVI)fAttributesProxy.fAttributes.getAugmentations(uri, localname).getItem(Constants.ATTRIBUTE_PSVI);
- }
-
-} // class AbstractSAXParser
diff --git a/src/com/sun/org/apache/xerces/internal/parsers/AbstractXMLDocumentParser.java b/src/com/sun/org/apache/xerces/internal/parsers/AbstractXMLDocumentParser.java
deleted file mode 100644
index 545997c..0000000
--- a/src/com/sun/org/apache/xerces/internal/parsers/AbstractXMLDocumentParser.java
+++ /dev/null
@@ -1,812 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.parsers;
-
-import com.sun.org.apache.xerces.internal.xni.Augmentations;
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
-import com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLDTDHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLLocator;
-import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
-import com.sun.org.apache.xerces.internal.xni.XMLString;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDContentModelSource;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDSource;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration;
-
-/**
- * This is the base class for all XML document parsers. XMLDocumentParser
- * provides a common implementation shared by the various document parsers
- * in the Xerces package. While this class is provided for convenience, it
- * does not prevent other kinds of parsers to be constructed using the XNI
- * interfaces.
- *
- * @author Arnaud Le Hors, IBM
- * @author Andy Clark, IBM
- *
- */
-public abstract class AbstractXMLDocumentParser
- extends XMLParser
- implements XMLDocumentHandler, XMLDTDHandler, XMLDTDContentModelHandler {
-
- //
- // Data
- //
-
- // state
-
- /** True if inside DTD. */
- protected boolean fInDTD;
-
- /** Document source*/
- protected XMLDocumentSource fDocumentSource;
-
- /** DTD source*/
- protected XMLDTDSource fDTDSource;
-
- /** DTD content model source*/
- protected XMLDTDContentModelSource fDTDContentModelSource;
-
- //
- // Constructors
- //
-
- /**
- * Constructs a document parser using the default symbol table
- * and grammar pool.
- */
- protected AbstractXMLDocumentParser(XMLParserConfiguration config) {
- super(config);
-
- // set handlers
- config.setDocumentHandler(this);
- config.setDTDHandler(this);
- config.setDTDContentModelHandler(this);
-
- } // <init>(XMLParserConfiguration)
-
- //
- // XMLDocumentHandler methods
- //
-
- /**
- * The start of the document.
- *
- * @param locator The system identifier of the entity if the entity
- * is external, null otherwise.
- * @param encoding The auto-detected IANA encoding name of the entity
- * stream. This value will be null in those situations
- * where the entity encoding is not auto-detected (e.g.
- * internal entities or a document entity that is
- * parsed from a java.io.Reader).
- * @param namespaceContext
- * The namespace context in effect at the
- * start of this document.
- * This object represents the current context.
- * Implementors of this class are responsible
- * for copying the namespace bindings from the
- * the current context (and its parent contexts)
- * if that information is important.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
-
- public void startDocument(XMLLocator locator, String encoding,
- NamespaceContext namespaceContext, Augmentations augs)
- throws XNIException {
- } // startDocument(XMLLocator,String)
-
- /**
- * Notifies of the presence of an XMLDecl line in the document. If
- * present, this method will be called immediately following the
- * startDocument call.
- *
- * @param version The XML version.
- * @param encoding The IANA encoding name of the document, or null if
- * not specified.
- * @param standalone The standalone value, or null if not specified.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void xmlDecl(String version, String encoding, String standalone, Augmentations augs)
- throws XNIException {
- } // xmlDecl(String,String,String)
-
- /**
- * Notifies of the presence of the DOCTYPE line in the document.
- *
- * @param rootElement The name of the root element.
- * @param publicId The public identifier if an external DTD or null
- * if the external DTD is specified using SYSTEM.
- * @param systemId The system identifier if an external DTD, null
- * @param augs Additional information that may include infoset augmentations
- * otherwise.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void doctypeDecl(String rootElement, String publicId, String systemId, Augmentations augs)
- throws XNIException {
- } // doctypeDecl(String,String,String)
-
- /**
- * The start of an element. If the document specifies the start element
- * by using an empty tag, then the startElement method will immediately
- * be followed by the endElement method, with no intervening methods.
- *
- * @param element The name of the element.
- * @param attributes The element attributes.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startElement(QName element, XMLAttributes attributes, Augmentations augs)
- throws XNIException {
- } // startElement(QName,XMLAttributes)
-
- /**
- * An empty element.
- *
- * @param element The name of the element.
- * @param attributes The element attributes.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void emptyElement(QName element, XMLAttributes attributes, Augmentations augs)
- throws XNIException {
-
- startElement(element, attributes, augs);
- endElement(element, augs);
-
- } // emptyElement(QName,XMLAttributes)
-
- /**
- * Character content.
- *
- * @param text The content.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void characters(XMLString text, Augmentations augs) throws XNIException {
- } // characters(XMLString)
-
- /**
- * Ignorable whitespace. For this method to be called, the document
- * source must have some way of determining that the text containing
- * only whitespace characters should be considered ignorable. For
- * example, the validator can determine if a length of whitespace
- * characters in the document are ignorable based on the element
- * content model.
- *
- * @param text The ignorable whitespace.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void ignorableWhitespace(XMLString text, Augmentations augs) throws XNIException {
- } // ignorableWhitespace(XMLString)
-
- /**
- * The end of an element.
- *
- * @param element The name of the element.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endElement(QName element, Augmentations augs) throws XNIException {
- } // endElement(QName)
-
- /**
- * The start of a CDATA section.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startCDATA(Augmentations augs) throws XNIException {
- } // startCDATA()
-
- /**
- * The end of a CDATA section.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endCDATA(Augmentations augs) throws XNIException {
- } // endCDATA()
-
- /**
- * The end of the document.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endDocument(Augmentations augs) throws XNIException {
- } // endDocument()
-
-
- /**
- * This method notifies the start of an entity.
- * <p>
- * <strong>Note:</strong> This method is not called for entity references
- * appearing as part of attribute values.
- *
- * @param name The name of the entity.
- * @param identifier The resource identifier.
- * @param encoding The auto-detected IANA encoding name of the entity
- * stream. This value will be null in those situations
- * where the entity encoding is not auto-detected (e.g.
- * internal entities or a document entity that is
- * parsed from a java.io.Reader).
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException Thrown by handler to signal an error.
- */
- public void startGeneralEntity(String name,
- XMLResourceIdentifier identifier,
- String encoding,
- Augmentations augs) throws XNIException {
- } // startGeneralEntity(String,XMLResourceIdentifier,String,Augmentations)
-
- /**
- * Notifies of the presence of a TextDecl line in an entity. If present,
- * this method will be called immediately following the startEntity call.
- * <p>
- * <strong>Note:</strong> This method will never be called for the
- * document entity; it is only called for external general entities
- * referenced in document content.
- * <p>
- * <strong>Note:</strong> This method is not called for entity references
- * appearing as part of attribute values.
- *
- * @param version The XML version, or null if not specified.
- * @param encoding The IANA encoding name of the entity.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void textDecl(String version, String encoding, Augmentations augs) throws XNIException {
- } // textDecl(String, String, Augmentations)
-
- /**
- * This method notifies the end of an entity.
- * <p>
- * <strong>Note:</strong> This method is not called for entity references
- * appearing as part of attribute values.
- *
- * @param name The name of the entity.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void endGeneralEntity(String name, Augmentations augs)
- throws XNIException {
- } // endGeneralEntity(String,Augmentations)
-
- /**
- * A comment.
- *
- * @param text The text in the comment.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by application to signal an error.
- */
- public void comment(XMLString text, Augmentations augs) throws XNIException {
- } // comment (XMLString, Augmentations)
-
- /**
- * A processing instruction. Processing instructions consist of a
- * target name and, optionally, text data. The data is only meaningful
- * to the application.
- * <p>
- * Typically, a processing instruction's data will contain a series
- * of pseudo-attributes. These pseudo-attributes follow the form of
- * element attributes but are <strong>not</strong> parsed or presented
- * to the application as anything other than text. The application is
- * responsible for parsing the data.
- *
- * @param target The target.
- * @param data The data or null if none specified.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void processingInstruction(String target, XMLString data, Augmentations augs)
- throws XNIException {
- } // processingInstruction(String, XMLString, Augmentations)
-
-
- /** Sets the document source */
- public void setDocumentSource(XMLDocumentSource source){
- fDocumentSource = source;
- } // setDocumentSource
-
- /** Returns the document source */
- public XMLDocumentSource getDocumentSource (){
- return fDocumentSource;
- } // getDocumentSource
- //
- // XMLDTDHandler methods
- //
-
- /**
- * The start of the DTD.
- *
- * @param locator The document locator, or null if the document
- * location cannot be reported during the parsing of
- * the document DTD. However, it is <em>strongly</em>
- * recommended that a locator be supplied that can
- * at least report the base system identifier of the
- * DTD.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startDTD(XMLLocator locator, Augmentations augs) throws XNIException {
- fInDTD = true;
- } // startDTD(XMLLocator)
-
-
- /**
- * The start of the DTD external subset.
- *
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startExternalSubset(XMLResourceIdentifier identifier, Augmentations augmentations)
- throws XNIException {
- } // startExternalSubset(Augmentations)
-
- /**
- * The end of the DTD external subset.
- *
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endExternalSubset(Augmentations augmentations)
- throws XNIException {
- } // endExternalSubset(Augmentations)
-
- /**
- * This method notifies the start of an entity.
- * <p>
- * <strong>Note:</strong> This method is not called for entity references
- * appearing as part of attribute values.
- *
- * @param name The name of the entity.
- * @param identifier The resource identifier.
- * @param encoding The auto-detected IANA encoding name of the entity
- * stream. This value will be null in those situations
- * where the entity encoding is not auto-detected (e.g.
- * internal entities or a document entity that is
- * parsed from a java.io.Reader).
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException Thrown by handler to signal an error.
- */
- public void startParameterEntity(String name,
- XMLResourceIdentifier identifier,
- String encoding,
- Augmentations augs) throws XNIException {
- } // startParameterEntity(String,XMLResourceIdentifier,String,Augmentations)
-
- /**
- * This method notifies the end of an entity.
- * <p>
- * <strong>Note:</strong> This method is not called for entity references
- * appearing as part of attribute values.
- *
- * @param name The name of the entity.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void endParameterEntity(String name, Augmentations augs)
- throws XNIException {
- } // endParameterEntity(String,Augmentations)
-
- /**
- * Characters within an IGNORE conditional section.
- *
- * @param text The ignored text.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void ignoredCharacters(XMLString text, Augmentations augs) throws XNIException {
- } // ignoredCharacters(XMLString, Augmentations)
-
- /**
- * An element declaration.
- *
- * @param name The name of the element.
- * @param contentModel The element content model.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void elementDecl(String name, String contentModel, Augmentations augs)
- throws XNIException {
- } // elementDecl(String,String)
-
- /**
- * The start of an attribute list.
- *
- * @param elementName The name of the element that this attribute
- * list is associated with.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startAttlist(String elementName, Augmentations augs) throws XNIException {
- } // startAttlist(String)
-
- /**
- * An attribute declaration.
- *
- * @param elementName The name of the element that this attribute
- * is associated with.
- * @param attributeName The name of the attribute.
- * @param type The attribute type. This value will be one of
- * the following: "CDATA", "ENTITY", "ENTITIES",
- * "ENUMERATION", "ID", "IDREF", "IDREFS",
- * "NMTOKEN", "NMTOKENS", or "NOTATION".
- * @param enumeration If the type has the value "ENUMERATION" or
- * "NOTATION", this array holds the allowed attribute
- * values; otherwise, this array is null.
- * @param defaultType The attribute default type. This value will be
- * one of the following: "#FIXED", "#IMPLIED",
- * "#REQUIRED", or null.
- * @param defaultValue The attribute default value, or null if no
- * default value is specified.
- * @param nonNormalizedDefaultValue The attribute default value with no normalization
- * performed, or null if no default value is specified.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void attributeDecl(String elementName, String attributeName,
- String type, String[] enumeration,
- String defaultType, XMLString defaultValue,
- XMLString nonNormalizedDefaultValue, Augmentations augs)
- throws XNIException {
- } // attributeDecl(String,String,String,String[],String,XMLString, XMLString, Augmentations)
-
- /**
- * The end of an attribute list.
- *
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endAttlist(Augmentations augs) throws XNIException {
- } // endAttlist()
-
- /**
- * An internal entity declaration.
- *
- * @param name The name of the entity. Parameter entity names start with
- * '%', whereas the name of a general entity is just the
- * entity name.
- * @param text The value of the entity.
- * @param nonNormalizedText The non-normalized value of the entity. This
- * value contains the same sequence of characters that was in
- * the internal entity declaration, without any entity
- * references expanded.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void internalEntityDecl(String name, XMLString text,
- XMLString nonNormalizedText, Augmentations augs)
- throws XNIException {
- } // internalEntityDecl(String,XMLString,XMLString)
-
- /**
- * An external entity declaration.
- *
- * @param name The name of the entity. Parameter entity names start
- * with '%', whereas the name of a general entity is just
- * the entity name.
- * @param identifier An object containing all location information
- * pertinent to this entity.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void externalEntityDecl(String name, XMLResourceIdentifier identifier,
- Augmentations augs) throws XNIException {
- } // externalEntityDecl(String,XMLResourceIdentifier, Augmentations)
-
- /**
- * An unparsed entity declaration.
- *
- * @param name The name of the entity.
- * @param identifier An object containing all location information
- * pertinent to this entity.
- * @param notation The name of the notation.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void unparsedEntityDecl(String name, XMLResourceIdentifier identifier,
- String notation, Augmentations augs) throws XNIException {
- } // unparsedEntityDecl(String,XMLResourceIdentifier, String, Augmentations)
-
- /**
- * A notation declaration
- *
- * @param name The name of the notation.
- * @param identifier An object containing all location information
- * pertinent to this notation.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void notationDecl(String name, XMLResourceIdentifier identifier,
- Augmentations augs)
- throws XNIException {
- } // notationDecl(String,XMLResourceIdentifier, Augmentations)
-
- /**
- * The start of a conditional section.
- *
- * @param type The type of the conditional section. This value will
- * either be CONDITIONAL_INCLUDE or CONDITIONAL_IGNORE.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see #CONDITIONAL_INCLUDE
- * @see #CONDITIONAL_IGNORE
- */
- public void startConditional(short type, Augmentations augs) throws XNIException {
- } // startConditional(short)
-
- /**
- * The end of a conditional section.
- *
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endConditional(Augmentations augs) throws XNIException {
- } // endConditional()
-
- /**
- * The end of the DTD.
- *
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endDTD(Augmentations augs) throws XNIException {
- fInDTD = false;
- } // endDTD()
-
- // set the source of this handler
- public void setDTDSource(XMLDTDSource source) {
- fDTDSource = source;
- }
-
- // return the source from which this handler derives its events
- public XMLDTDSource getDTDSource() {
- return fDTDSource;
- }
-
- //
- // XMLDTDContentModelHandler methods
- //
-
- /**
- * The start of a content model. Depending on the type of the content
- * model, specific methods may be called between the call to the
- * startContentModel method and the call to the endContentModel method.
- *
- * @param elementName The name of the element.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startContentModel(String elementName, Augmentations augs) throws XNIException {
- } // startContentModel(String, Augmentations)
-
- /**
- * A content model of ANY.
- *
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see #empty
- * @see #startGroup
- */
- public void any(Augmentations augs) throws XNIException {
- } // any(Augmentations)
-
- /**
- * A content model of EMPTY.
- *
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see #any
- * @see #startGroup
- */
- public void empty(Augmentations augs) throws XNIException {
- } // empty(Augmentations)
-
- /**
- * A start of either a mixed or children content model. A mixed
- * content model will immediately be followed by a call to the
- * <code>pcdata()</code> method. A children content model will
- * contain additional groups and/or elements.
- *
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see #any
- * @see #empty
- */
- public void startGroup(Augmentations augs) throws XNIException {
- } // stargGroup(Augmentations)
-
- /**
- * The appearance of "#PCDATA" within a group signifying a
- * mixed content model. This method will be the first called
- * following the content model's <code>startGroup()</code>.
- *
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see #startGroup
- */
- public void pcdata(Augmentations augs) throws XNIException {
- } // pcdata(Augmentations)
-
- /**
- * A referenced element in a mixed or children content model.
- *
- * @param elementName The name of the referenced element.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void element(String elementName, Augmentations augs) throws XNIException {
- } // element(String, Augmentations)
-
- /**
- * The separator between choices or sequences of a mixed or children
- * content model.
- *
- * @param separator The type of children separator.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see #SEPARATOR_CHOICE
- * @see #SEPARATOR_SEQUENCE
- */
- public void separator(short separator, Augmentations augs) throws XNIException {
- } // separator(short, Augmentations)
-
- /**
- * The occurrence count for a child in a children content model or
- * for the mixed content model group.
- *
- * @param occurrence The occurrence count for the last element
- * or group.
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see #OCCURS_ZERO_OR_ONE
- * @see #OCCURS_ZERO_OR_MORE
- * @see #OCCURS_ONE_OR_MORE
- */
- public void occurrence(short occurrence, Augmentations augs) throws XNIException {
- } // occurence(short, Augmentations)
-
- /**
- * The end of a group for mixed or children content models.
- *
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endGroup(Augmentations augs) throws XNIException {
- } // endGroup(Augmentations)
-
- /**
- * The end of a content model.
- *
- * @param augs Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endContentModel(Augmentations augs) throws XNIException {
- } // endContentModel(Augmentations)
-
- // set content model source
- public void setDTDContentModelSource(XMLDTDContentModelSource source) {
- fDTDContentModelSource = source;
- }
-
- // get content model source
- public XMLDTDContentModelSource getDTDContentModelSource() {
- return fDTDContentModelSource;
- }
-
- //
- // Protected methods
- //
-
- /**
- * reset all components before parsing
- */
- protected void reset() throws XNIException {
- super.reset();
- fInDTD = false;
- } // reset()
-
-} // class AbstractXMLDocumentParser
diff --git a/src/com/sun/org/apache/xerces/internal/parsers/BasicParserConfiguration.java b/src/com/sun/org/apache/xerces/internal/parsers/BasicParserConfiguration.java
deleted file mode 100644
index 3b35296..0000000
--- a/src/com/sun/org/apache/xerces/internal/parsers/BasicParserConfiguration.java
+++ /dev/null
@@ -1,586 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.parsers;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Locale;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.util.FeatureState;
-import com.sun.org.apache.xerces.internal.util.ParserConfigurationSettings;
-import com.sun.org.apache.xerces.internal.util.PropertyState;
-import com.sun.org.apache.xerces.internal.util.Status;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLDTDHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponent;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLEntityResolver;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration;
-
-/**
- * A very basic parser configuration. This configuration class can
- * be used as a base class for custom parser configurations. The
- * basic parser configuration creates the symbol table (if not
- * specified at construction time) and manages all of the recognized
- * features and properties.
- * <p>
- * The basic parser configuration does <strong>not</strong> mandate
- * any particular pipeline configuration or the use of specific
- * components except for the symbol table. If even this is too much
- * for a basic parser configuration, the programmer can create a new
- * configuration class that implements the
- * <code>XMLParserConfiguration</code> interface.
- * <p>
- * Subclasses of the basic parser configuration can add their own
- * recognized features and properties by calling the
- * <code>addRecognizedFeature</code> and
- * <code>addRecognizedProperty</code> methods, respectively.
- * <p>
- * The basic parser configuration assumes that the configuration
- * will be made up of various parser components that implement the
- * <code>XMLComponent</code> interface. If subclasses of this
- * configuration create their own components for use in the
- * parser configuration, then each component should be added to
- * the list of components by calling the <code>addComponent</code>
- * method. The basic parser configuration will make sure to call
- * the <code>reset</code> method of each registered component
- * before parsing an instance document.
- * <p>
- * This class recognizes the following features and properties:
- * <ul>
- * <li>Features
- * <ul>
- * <li>http://xml.org/sax/features/validation</li>
- * <li>http://xml.org/sax/features/namespaces</li>
- * <li>http://xml.org/sax/features/external-general-entities</li>
- * <li>http://xml.org/sax/features/external-parameter-entities</li>
- * </ul>
- * <li>Properties
- * <ul>
- * <li>http://xml.org/sax/properties/xml-string</li>
- * <li>http://apache.org/xml/properties/internal/symbol-table</li>
- * <li>http://apache.org/xml/properties/internal/error-handler</li>
- * <li>http://apache.org/xml/properties/internal/entity-resolver</li>
- * </ul>
- * </ul>
- *
- * @author Arnaud Le Hors, IBM
- * @author Andy Clark, IBM
- *
- * @version $Id: BasicParserConfiguration.java,v 1.6 2010-11-01 04:40:09 joehw Exp $
- */
-public abstract class BasicParserConfiguration
- extends ParserConfigurationSettings
- implements XMLParserConfiguration {
-
- //
- // Constants
- //
-
- // feature identifiers
-
- /** Feature identifier: validation. */
- protected static final String VALIDATION =
- Constants.SAX_FEATURE_PREFIX + Constants.VALIDATION_FEATURE;
-
- /** Feature identifier: namespaces. */
- protected static final String NAMESPACES =
- Constants.SAX_FEATURE_PREFIX + Constants.NAMESPACES_FEATURE;
-
- /** Feature identifier: external general entities. */
- protected static final String EXTERNAL_GENERAL_ENTITIES =
- Constants.SAX_FEATURE_PREFIX + Constants.EXTERNAL_GENERAL_ENTITIES_FEATURE;
-
- /** Feature identifier: external parameter entities. */
- protected static final String EXTERNAL_PARAMETER_ENTITIES =
- Constants.SAX_FEATURE_PREFIX + Constants.EXTERNAL_PARAMETER_ENTITIES_FEATURE;
-
- // property identifiers
-
- /** Property identifier: xml string. */
- protected static final String XML_STRING =
- Constants.SAX_PROPERTY_PREFIX + Constants.XML_STRING_PROPERTY;
-
- /** Property identifier: symbol table. */
- protected static final String SYMBOL_TABLE =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY;
-
- /** Property identifier: error handler. */
- protected static final String ERROR_HANDLER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_HANDLER_PROPERTY;
-
- /** Property identifier: entity resolver. */
- protected static final String ENTITY_RESOLVER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_RESOLVER_PROPERTY;
-
- //
- // Data
- //
-
- // components (non-configurable)
-
- /** Symbol table. */
- protected SymbolTable fSymbolTable;
-
-
- // data
-
- /** Locale. */
- protected Locale fLocale;
-
- /** Components. */
- protected ArrayList fComponents;
-
- // handlers
-
- /** The document handler. */
- protected XMLDocumentHandler fDocumentHandler;
-
- /** The DTD handler. */
- protected XMLDTDHandler fDTDHandler;
-
- /** The DTD content model handler. */
- protected XMLDTDContentModelHandler fDTDContentModelHandler;
-
- /** Last component in the document pipeline */
- protected XMLDocumentSource fLastComponent;
-
- //
- // Constructors
- //
-
- /** Default Constructor. */
- protected BasicParserConfiguration() {
- this(null, null);
- } // <init>()
-
- /**
- * Constructs a parser configuration using the specified symbol table.
- *
- * @param symbolTable The symbol table to use.
- */
- protected BasicParserConfiguration(SymbolTable symbolTable) {
- this(symbolTable, null);
- } // <init>(SymbolTable)
-
- /**
- * Constructs a parser configuration using the specified symbol table
- * and parent settings.
- *
- * @param symbolTable The symbol table to use.
- * @param parentSettings The parent settings.
- */
- protected BasicParserConfiguration(SymbolTable symbolTable,
- XMLComponentManager parentSettings) {
- super(parentSettings);
-
- // create a vector to hold all the components in use
- fComponents = new ArrayList();
-
- // create table for features and properties
- fFeatures = new HashMap();
- fProperties = new HashMap();
-
- // add default recognized features
- final String[] recognizedFeatures = {
- PARSER_SETTINGS,
- VALIDATION,
- NAMESPACES,
- EXTERNAL_GENERAL_ENTITIES,
- EXTERNAL_PARAMETER_ENTITIES,
- };
- addRecognizedFeatures(recognizedFeatures);
- fFeatures.put(PARSER_SETTINGS, Boolean.TRUE);
- // set state for default features
- fFeatures.put(VALIDATION, Boolean.FALSE);
- fFeatures.put(NAMESPACES, Boolean.TRUE);
- fFeatures.put(EXTERNAL_GENERAL_ENTITIES, Boolean.TRUE);
- fFeatures.put(EXTERNAL_PARAMETER_ENTITIES, Boolean.TRUE);
-
- // add default recognized properties
- final String[] recognizedProperties = {
- XML_STRING,
- SYMBOL_TABLE,
- ERROR_HANDLER,
- ENTITY_RESOLVER,
- };
- addRecognizedProperties(recognizedProperties);
-
- if (symbolTable == null) {
- symbolTable = new SymbolTable();
- }
- fSymbolTable = symbolTable;
- fProperties.put(SYMBOL_TABLE, fSymbolTable);
-
- } // <init>(SymbolTable)
-
- /**
- * Adds a component to the parser configuration. This method will
- * also add all of the component's recognized features and properties
- * to the list of default recognized features and properties.
- *
- * @param component The component to add.
- */
- protected void addComponent(XMLComponent component) {
-
- // don't add a component more than once
- if (fComponents.contains(component)) {
- return;
- }
- fComponents.add(component);
-
- // register component's recognized features
- String[] recognizedFeatures = component.getRecognizedFeatures();
- addRecognizedFeatures(recognizedFeatures);
-
- // register component's recognized properties
- String[] recognizedProperties = component.getRecognizedProperties();
- addRecognizedProperties(recognizedProperties);
-
- // set default values
- if (recognizedFeatures != null) {
- for (int i = 0; i < recognizedFeatures.length; i++) {
- String featureId = recognizedFeatures[i];
- Boolean state = component.getFeatureDefault(featureId);
- if (state != null) {
- super.setFeature(featureId, state.booleanValue());
- }
- }
- }
- if (recognizedProperties != null) {
- for (int i = 0; i < recognizedProperties.length; i++) {
- String propertyId = recognizedProperties[i];
- Object value = component.getPropertyDefault(propertyId);
- if (value != null) {
- super.setProperty(propertyId, value);
- }
- }
- }
-
- } // addComponent(XMLComponent)
-
- //
- // XMLParserConfiguration methods
- //
-
- /**
- * Parse an XML document.
- * <p>
- * The parser can use this method to instruct this configuration
- * to begin parsing an XML document from any valid input source
- * (a character stream, a byte stream, or a URI).
- * <p>
- * Parsers may not invoke this method while a parse is in progress.
- * Once a parse is complete, the parser may then parse another XML
- * document.
- * <p>
- * This method is synchronous: it will not return until parsing
- * has ended. If a client application wants to terminate
- * parsing early, it should throw an exception.
- *
- * @param inputSource The input source for the top-level of the
- * XML document.
- *
- * @exception XNIException Any XNI exception, possibly wrapping
- * another exception.
- * @exception IOException An IO exception from the parser, possibly
- * from a byte stream or character stream
- * supplied by the parser.
- */
- public abstract void parse(XMLInputSource inputSource)
- throws XNIException, IOException;
-
- /**
- * Sets the document handler on the last component in the pipeline
- * to receive information about the document.
- *
- * @param documentHandler The document handler.
- */
- public void setDocumentHandler(XMLDocumentHandler documentHandler) {
- fDocumentHandler = documentHandler;
- if (fLastComponent != null) {
- fLastComponent.setDocumentHandler(fDocumentHandler);
- if (fDocumentHandler !=null){
- fDocumentHandler.setDocumentSource(fLastComponent);
- }
- }
- } // setDocumentHandler(XMLDocumentHandler)
-
- /** Returns the registered document handler. */
- public XMLDocumentHandler getDocumentHandler() {
- return fDocumentHandler;
- } // getDocumentHandler():XMLDocumentHandler
-
- /**
- * Sets the DTD handler.
- *
- * @param dtdHandler The DTD handler.
- */
- public void setDTDHandler(XMLDTDHandler dtdHandler) {
- fDTDHandler = dtdHandler;
- } // setDTDHandler(XMLDTDHandler)
-
- /** Returns the registered DTD handler. */
- public XMLDTDHandler getDTDHandler() {
- return fDTDHandler;
- } // getDTDHandler():XMLDTDHandler
-
- /**
- * Sets the DTD content model handler.
- *
- * @param handler The DTD content model handler.
- */
- public void setDTDContentModelHandler(XMLDTDContentModelHandler handler) {
- fDTDContentModelHandler = handler;
- } // setDTDContentModelHandler(XMLDTDContentModelHandler)
-
- /** Returns the registered DTD content model handler. */
- public XMLDTDContentModelHandler getDTDContentModelHandler() {
- return fDTDContentModelHandler;
- } // getDTDContentModelHandler():XMLDTDContentModelHandler
-
- /**
- * Sets the resolver used to resolve external entities. The EntityResolver
- * interface supports resolution of public and system identifiers.
- *
- * @param resolver The new entity resolver. Passing a null value will
- * uninstall the currently installed resolver.
- */
- public void setEntityResolver(XMLEntityResolver resolver) {
- // REVISIT: Should this be a property?
- fProperties.put(ENTITY_RESOLVER, resolver);
- } // setEntityResolver(XMLEntityResolver)
-
- /**
- * Return the current entity resolver.
- *
- * @return The current entity resolver, or null if none
- * has been registered.
- * @see #setEntityResolver
- */
- public XMLEntityResolver getEntityResolver() {
- // REVISIT: Should this be a property?
- return (XMLEntityResolver)fProperties.get(ENTITY_RESOLVER);
- } // getEntityResolver():XMLEntityResolver
-
- /**
- * Allow an application to register an error event handler.
- *
- * <p>If the application does not register an error handler, all
- * error events reported by the SAX parser will be silently
- * ignored; however, normal processing may not continue. It is
- * highly recommended that all SAX applications implement an
- * error handler to avoid unexpected bugs.</p>
- *
- * <p>Applications may register a new or different handler in the
- * middle of a parse, and the SAX parser must begin using the new
- * handler immediately.</p>
- *
- * @param errorHandler The error handler.
- * @exception java.lang.NullPointerException If the handler
- * argument is null.
- * @see #getErrorHandler
- */
- public void setErrorHandler(XMLErrorHandler errorHandler) {
- // REVISIT: Should this be a property?
- fProperties.put(ERROR_HANDLER, errorHandler);
- } // setErrorHandler(XMLErrorHandler)
-
- /**
- * Return the current error handler.
- *
- * @return The current error handler, or null if none
- * has been registered.
- * @see #setErrorHandler
- */
- public XMLErrorHandler getErrorHandler() {
- // REVISIT: Should this be a property?
- return (XMLErrorHandler)fProperties.get(ERROR_HANDLER);
- } // getErrorHandler():XMLErrorHandler
-
- /**
- * Set the state of a feature.
- *
- * Set the state of any feature in a SAX2 parser. The parser
- * might not recognize the feature, and if it does recognize
- * it, it might not be able to fulfill the request.
- *
- * @param featureId The unique identifier (URI) of the feature.
- * @param state The requested state of the feature (true or false).
- *
- * @exception com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException If the
- * requested feature is not known.
- */
- public void setFeature(String featureId, boolean state)
- throws XMLConfigurationException {
-
- // forward to every component
- int count = fComponents.size();
- for (int i = 0; i < count; i++) {
- XMLComponent c = (XMLComponent) fComponents.get(i);
- c.setFeature(featureId, state);
- }
- // save state if noone "objects"
- super.setFeature(featureId, state);
-
- } // setFeature(String,boolean)
-
- /**
- * setProperty
- *
- * @param propertyId
- * @param value
- */
- public void setProperty(String propertyId, Object value)
- throws XMLConfigurationException {
-
- // forward to every component
- int count = fComponents.size();
- for (int i = 0; i < count; i++) {
- XMLComponent c = (XMLComponent) fComponents.get(i);
- c.setProperty(propertyId, value);
- }
-
- // store value if noone "objects"
- super.setProperty(propertyId, value);
-
- } // setProperty(String,Object)
-
- /**
- * Set the locale to use for messages.
- *
- * @param locale The locale object to use for localization of messages.
- *
- * @exception XNIException Thrown if the parser does not support the
- * specified locale.
- */
- public void setLocale(Locale locale) throws XNIException {
- fLocale = locale;
- } // setLocale(Locale)
-
- /** Returns the locale. */
- public Locale getLocale() {
- return fLocale;
- } // getLocale():Locale
-
- //
- // Protected methods
- //
-
- /**
- * reset all components before parsing and namespace context
- */
- protected void reset() throws XNIException {
-
- // reset every component
- int count = fComponents.size();
- for (int i = 0; i < count; i++) {
- XMLComponent c = (XMLComponent) fComponents.get(i);
- c.reset(this);
- }
-
- } // reset()
-
- /**
- * Check a property. If the property is known and supported, this method
- * simply returns. Otherwise, the appropriate exception is thrown.
- *
- * @param propertyId The unique identifier (URI) of the property
- * being set.
- * @exception com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException If the
- * requested feature is not known or supported.
- */
- protected PropertyState checkProperty(String propertyId)
- throws XMLConfigurationException {
-
- // special cases
- if (propertyId.startsWith(Constants.SAX_PROPERTY_PREFIX)) {
- final int suffixLength = propertyId.length() - Constants.SAX_PROPERTY_PREFIX.length();
-
- //
- // http://xml.org/sax/properties/xml-string
- // Value type: String
- // Access: read-only
- // Get the literal string of characters associated with the
- // current event. If the parser recognises and supports this
- // property but is not currently parsing text, it should return
- // null (this is a good way to check for availability before the
- // parse begins).
- //
- if (suffixLength == Constants.XML_STRING_PROPERTY.length() &&
- propertyId.endsWith(Constants.XML_STRING_PROPERTY)) {
- // REVISIT - we should probably ask xml-dev for a precise
- // definition of what this is actually supposed to return, and
- // in exactly which circumstances.
- return PropertyState.NOT_SUPPORTED;
- }
- }
-
- // check property
- return super.checkProperty(propertyId);
-
- } // checkProperty(String)
-
-
- /**
- * Check a feature. If feature is know and supported, this method simply
- * returns. Otherwise, the appropriate exception is thrown.
- *
- * @param featureId The unique identifier (URI) of the feature.
- *
- * @throws XMLConfigurationException Thrown for configuration error.
- * In general, components should
- * only throw this exception if
- * it is <strong>really</strong>
- * a critical error.
- */
- protected FeatureState checkFeature(String featureId)
- throws XMLConfigurationException {
-
- //
- // Xerces Features
- //
- if (featureId.startsWith(Constants.XERCES_FEATURE_PREFIX)) {
- final int suffixLength = featureId.length() - Constants.XERCES_FEATURE_PREFIX.length();
-
- //
- // special performance feature: no one by component manager is allowed to set it
- //
- if (suffixLength == Constants.PARSER_SETTINGS.length() &&
- featureId.endsWith(Constants.PARSER_SETTINGS)) {
- return FeatureState.NOT_SUPPORTED;
- }
- }
-
- return super.checkFeature(featureId);
- } // checkFeature(String)
-
-
-} // class BasicParserConfiguration
diff --git a/src/com/sun/org/apache/xerces/internal/parsers/CachingParserPool.java b/src/com/sun/org/apache/xerces/internal/parsers/CachingParserPool.java
deleted file mode 100644
index a9f5229..0000000
--- a/src/com/sun/org/apache/xerces/internal/parsers/CachingParserPool.java
+++ /dev/null
@@ -1,430 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.parsers;
-
-import com.sun.org.apache.xerces.internal.xni.grammars.Grammar;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription;
-import com.sun.org.apache.xerces.internal.util.XMLGrammarPoolImpl;
-
-import com.sun.org.apache.xerces.internal.util.ShadowedSymbolTable;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.util.SynchronizedSymbolTable;
-
-/**
- * A parser pool that enables caching of grammars. The caching parser
- * pool is constructed with a specific symbol table and grammar pool
- * that has already been populated with the grammars used by the
- * application.
- * <p>
- * Once the caching parser pool is constructed, specific parser
- * instances are created by calling the appropriate factory method
- * on the parser pool.
- * <p>
- * <strong>Note:</strong> There is a performance penalty for using
- * a caching parser pool due to thread safety. Access to the symbol
- * table and grammar pool must be synchronized to ensure the safe
- * operation of the symbol table and grammar pool.
- * <p>
- * <strong>Note:</strong> If performance is critical, then another
- * mechanism needs to be used instead of the caching parser pool.
- * One approach would be to create parser instances that do not
- * share these structures. Instead, each instance would get its
- * own copy to use while parsing. This avoids the synchronization
- * overhead at the expense of more memory and the time required
- * to copy the structures for each new parser instance. And even
- * when a parser instance is re-used, there is a potential for a
- * memory leak due to new symbols being added to the symbol table
- * over time. In other words, always take caution to make sure
- * that your application is thread-safe and avoids leaking memory.
- *
- * @author Andy Clark, IBM
- *
- */
-public class CachingParserPool {
-
- //
- // Constants
- //
-
- /** Default shadow symbol table (false). */
- public static final boolean DEFAULT_SHADOW_SYMBOL_TABLE = false;
-
- /** Default shadow grammar pool (false). */
- public static final boolean DEFAULT_SHADOW_GRAMMAR_POOL = false;
-
- //
- // Data
- //
-
- /**
- * Symbol table. The symbol table that the caching parser pool is
- * constructed with is automatically wrapped in a synchronized
- * version for thread-safety.
- */
- protected SymbolTable fSynchronizedSymbolTable;
-
- /**
- * Grammar pool. The grammar pool that the caching parser pool is
- * constructed with is automatically wrapped in a synchronized
- * version for thread-safety.
- */
- protected XMLGrammarPool fSynchronizedGrammarPool;
-
- /**
- * Shadow the symbol table for new parser instances. If true,
- * new parser instances use shadow copies of the main symbol
- * table and are not allowed to add new symbols to the main
- * symbol table. New symbols are added to the shadow symbol
- * table and are local to the parser instance.
- */
- protected boolean fShadowSymbolTable = DEFAULT_SHADOW_SYMBOL_TABLE;
-
- /**
- * Shadow the grammar pool for new parser instances. If true,
- * new parser instances use shadow copies of the main grammar
- * pool and are not allowed to add new grammars to the main
- * grammar pool. New grammars are added to the shadow grammar
- * pool and are local to the parser instance.
- */
- protected boolean fShadowGrammarPool = DEFAULT_SHADOW_GRAMMAR_POOL;
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- public CachingParserPool() {
- this(new SymbolTable(), new XMLGrammarPoolImpl());
- } // <init>()
-
- /**
- * Constructs a caching parser pool with the specified symbol table
- * and grammar pool.
- *
- * @param symbolTable The symbol table.
- * @param grammarPool The grammar pool.
- */
- public CachingParserPool(SymbolTable symbolTable, XMLGrammarPool grammarPool) {
- fSynchronizedSymbolTable = new SynchronizedSymbolTable(symbolTable);
- fSynchronizedGrammarPool = new SynchronizedGrammarPool(grammarPool);
- } // <init>(SymbolTable,XMLGrammarPool)
-
- //
- // Public methods
- //
-
- /** Returns the symbol table. */
- public SymbolTable getSymbolTable() {
- return fSynchronizedSymbolTable;
- } // getSymbolTable():SymbolTable
-
- /** Returns the grammar pool. */
- public XMLGrammarPool getXMLGrammarPool() {
- return fSynchronizedGrammarPool;
- } // getXMLGrammarPool():XMLGrammarPool
-
- // setters and getters
-
- /**
- * Sets whether new parser instance receive shadow copies of the
- * main symbol table.
- *
- * @param shadow If true, new parser instances use shadow copies
- * of the main symbol table and are not allowed to
- * add new symbols to the main symbol table. New
- * symbols are added to the shadow symbol table and
- * are local to the parser instance. If false, new
- * parser instances are allowed to add new symbols
- * to the main symbol table.
- */
- public void setShadowSymbolTable(boolean shadow) {
- fShadowSymbolTable = shadow;
- } // setShadowSymbolTable(boolean)
-
- // factory methods
-
- /** Creates a new DOM parser. */
- public DOMParser createDOMParser() {
- SymbolTable symbolTable = fShadowSymbolTable
- ? new ShadowedSymbolTable(fSynchronizedSymbolTable)
- : fSynchronizedSymbolTable;
- XMLGrammarPool grammarPool = fShadowGrammarPool
- ? new ShadowedGrammarPool(fSynchronizedGrammarPool)
- : fSynchronizedGrammarPool;
- return new DOMParser(symbolTable, grammarPool);
- } // createDOMParser():DOMParser
-
- /** Creates a new SAX parser. */
- public SAXParser createSAXParser() {
- SymbolTable symbolTable = fShadowSymbolTable
- ? new ShadowedSymbolTable(fSynchronizedSymbolTable)
- : fSynchronizedSymbolTable;
- XMLGrammarPool grammarPool = fShadowGrammarPool
- ? new ShadowedGrammarPool(fSynchronizedGrammarPool)
- : fSynchronizedGrammarPool;
- return new SAXParser(symbolTable, grammarPool);
- } // createSAXParser():SAXParser
-
- //
- // Classes
- //
-
- /**
- * Synchronized grammar pool.
- *
- * @author Andy Clark, IBM
- */
- public static final class SynchronizedGrammarPool
- implements XMLGrammarPool {
-
- //
- // Data
- //
-
- /** Main grammar pool. */
- private XMLGrammarPool fGrammarPool;
-
- //
- // Constructors
- //
-
- /** Constructs a synchronized grammar pool. */
- public SynchronizedGrammarPool(XMLGrammarPool grammarPool) {
- fGrammarPool = grammarPool;
- } // <init>(XMLGrammarPool)
-
- //
- // GrammarPool methods
- //
-
- // retrieve the initial set of grammars for the validator
- // to work with.
- // REVISIT: does this need to be synchronized since it's just reading?
- // @param grammarType type of the grammars to be retrieved.
- // @return the initial grammar set the validator may place in its "bucket"
- public Grammar [] retrieveInitialGrammarSet(String grammarType ) {
- synchronized (fGrammarPool) {
- return fGrammarPool.retrieveInitialGrammarSet(grammarType);
- }
- } // retrieveInitialGrammarSet(String): Grammar[]
-
- // retrieve a particular grammar.
- // REVISIT: does this need to be synchronized since it's just reading?
- // @param gDesc description of the grammar to be retrieved
- // @return Grammar corresponding to gDesc, or null if none exists.
- public Grammar retrieveGrammar(XMLGrammarDescription gDesc) {
- synchronized (fGrammarPool) {
- return fGrammarPool.retrieveGrammar(gDesc);
- }
- } // retrieveGrammar(XMLGrammarDesc): Grammar
-
- // give the grammarPool the option of caching these grammars.
- // This certainly must be synchronized.
- // @param grammarType The type of the grammars to be cached.
- // @param grammars the Grammars that may be cached (unordered, Grammars previously
- // given to the validator may be included).
- public void cacheGrammars(String grammarType, Grammar[] grammars) {
- synchronized (fGrammarPool) {
- fGrammarPool.cacheGrammars(grammarType, grammars);
- }
- } // cacheGrammars(String, Grammar[]);
-
- /** lock the grammar pool */
- public void lockPool() {
- synchronized (fGrammarPool) {
- fGrammarPool.lockPool();
- }
- } // lockPool()
-
- /** clear the grammar pool */
- public void clear() {
- synchronized (fGrammarPool) {
- fGrammarPool.clear();
- }
- } // lockPool()
-
- /** unlock the grammar pool */
- public void unlockPool() {
- synchronized (fGrammarPool) {
- fGrammarPool.unlockPool();
- }
- } // unlockPool()
-
- /***
- * Methods corresponding to original (pre Xerces2.0.0final)
- * grammarPool have been commented out.
- */
- /**
- * Puts the specified grammar into the grammar pool.
- *
- * @param key Key to associate with grammar.
- * @param grammar Grammar object.
- */
- /******
- public void putGrammar(String key, Grammar grammar) {
- synchronized (fGrammarPool) {
- fGrammarPool.putGrammar(key, grammar);
- }
- } // putGrammar(String,Grammar)
- *******/
-
- /**
- * Returns the grammar associated to the specified key.
- *
- * @param key The key of the grammar.
- */
- /**********
- public Grammar getGrammar(String key) {
- synchronized (fGrammarPool) {
- return fGrammarPool.getGrammar(key);
- }
- } // getGrammar(String):Grammar
- ***********/
-
- /**
- * Removes the grammar associated to the specified key from the
- * grammar pool and returns the removed grammar.
- *
- * @param key The key of the grammar.
- */
- /**********
- public Grammar removeGrammar(String key) {
- synchronized (fGrammarPool) {
- return fGrammarPool.removeGrammar(key);
- }
- } // removeGrammar(String):Grammar
- ******/
-
- /**
- * Returns true if the grammar pool contains a grammar associated
- * to the specified key.
- *
- * @param key The key of the grammar.
- */
- /**********
- public boolean containsGrammar(String key) {
- synchronized (fGrammarPool) {
- return fGrammarPool.containsGrammar(key);
- }
- } // containsGrammar(String):boolean
- ********/
-
- } // class SynchronizedGrammarPool
-
- /**
- * Shadowed grammar pool.
- * This class is predicated on the existence of a concrete implementation;
- * so using our own doesn't seem to bad an idea.
- *
- * @author Andy Clark, IBM
- * @author Neil Graham, IBM
- */
- public static final class ShadowedGrammarPool
- extends XMLGrammarPoolImpl {
-
- //
- // Data
- //
-
- /** Main grammar pool. */
- private XMLGrammarPool fGrammarPool;
-
- //
- // Constructors
- //
-
- /** Constructs a shadowed grammar pool. */
- public ShadowedGrammarPool(XMLGrammarPool grammarPool) {
- fGrammarPool = grammarPool;
- } // <init>(GrammarPool)
-
- //
- // GrammarPool methods
- //
-
- /**
- * Retrieve the initial set of grammars for the validator to work with.
- * REVISIT: does this need to be synchronized since it's just reading?
- *
- * @param grammarType Type of the grammars to be retrieved.
- * @return The initial grammar set the validator may place in its "bucket"
- */
- public Grammar [] retrieveInitialGrammarSet(String grammarType ) {
- Grammar [] grammars = super.retrieveInitialGrammarSet(grammarType);
- if (grammars != null) return grammars;
- return fGrammarPool.retrieveInitialGrammarSet(grammarType);
- } // retrieveInitialGrammarSet(String): Grammar[]
-
- /**
- * Retrieve a particular grammar.
- * REVISIT: does this need to be synchronized since it's just reading?
- *
- * @param gDesc Description of the grammar to be retrieved
- * @return Grammar corresponding to gDesc, or null if none exists.
- */
- public Grammar retrieveGrammar(XMLGrammarDescription gDesc) {
- Grammar g = super.retrieveGrammar(gDesc);
- if(g != null) return g;
- return fGrammarPool.retrieveGrammar(gDesc);
- } // retrieveGrammar(XMLGrammarDesc): Grammar
-
- /**
- * Give the grammarPool the option of caching these grammars.
- * This certainly must be synchronized.
- *
- * @param grammarType The type of the grammars to be cached.
- * @param grammars The Grammars that may be cached (unordered, Grammars previously
- * given to the validator may be included).
- */
- public void cacheGrammars(String grammarType, Grammar[] grammars) {
- // better give both grammars a shot...
- super.cacheGrammars(grammarType, grammars);
- fGrammarPool.cacheGrammars(grammarType, grammars);
- } // cacheGrammars(grammarType, Grammar[]);
-
- /**
- * Returns the grammar associated to the specified description.
- *
- * @param desc The description of the grammar.
- */
- public Grammar getGrammar(XMLGrammarDescription desc) {
-
- if (super.containsGrammar(desc)) {
- return super.getGrammar(desc);
- }
- return null;
-
- } // getGrammar(XMLGrammarDescription):Grammar
-
- /**
- * Returns true if the grammar pool contains a grammar associated
- * to the specified description.
- *
- * @param desc The description of the grammar.
- */
- public boolean containsGrammar(XMLGrammarDescription desc) {
- return super.containsGrammar(desc);
- } // containsGrammar(XMLGrammarDescription):boolean
-
- } // class ShadowedGrammarPool
-
-} // class CachingParserPool
diff --git a/src/com/sun/org/apache/xerces/internal/parsers/DOMParser.java b/src/com/sun/org/apache/xerces/internal/parsers/DOMParser.java
deleted file mode 100644
index f2020ef..0000000
--- a/src/com/sun/org/apache/xerces/internal/parsers/DOMParser.java
+++ /dev/null
@@ -1,667 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2000-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.parsers;
-
-import java.io.IOException;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.util.EntityResolverWrapper;
-import com.sun.org.apache.xerces.internal.util.EntityResolver2Wrapper;
-import com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper;
-import com.sun.org.apache.xerces.internal.util.SAXMessageFormatter;
-import com.sun.org.apache.xerces.internal.util.Status;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLEntityResolver;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLParseException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration;
-import org.w3c.dom.Node;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.ext.EntityResolver2;
-import org.xml.sax.helpers.LocatorImpl;
-
-/**
- * This is the main Xerces DOM parser class. It uses the abstract DOM
- * parser with a document scanner, a dtd scanner, and a validator, as
- * well as a grammar pool.
- *
- * @author Arnaud Le Hors, IBM
- * @author Andy Clark, IBM
- *
- * @version $Id: DOMParser.java,v 1.7 2010-11-01 04:40:09 joehw Exp $
- */
-public class DOMParser
- extends AbstractDOMParser {
-
- //
- // Constants
- //
-
- // features
-
- /** Feature identifier: EntityResolver2. */
- protected static final String USE_ENTITY_RESOLVER2 =
- Constants.SAX_FEATURE_PREFIX + Constants.USE_ENTITY_RESOLVER2_FEATURE;
-
- protected static final String REPORT_WHITESPACE =
- Constants.SUN_SCHEMA_FEATURE_PREFIX + Constants.SUN_REPORT_IGNORED_ELEMENT_CONTENT_WHITESPACE;
-
- /** Property identifier: Security property manager. */
- private static final String XML_SECURITY_PROPERTY_MANAGER =
- Constants.XML_SECURITY_PROPERTY_MANAGER;
-
- // recognized features:
- private static final String[] RECOGNIZED_FEATURES = {
- REPORT_WHITESPACE
- };
-
- // properties
-
- /** Property identifier: symbol table. */
- protected static final String SYMBOL_TABLE =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY;
-
- /** Property identifier: XML grammar pool. */
- protected static final String XMLGRAMMAR_POOL =
- Constants.XERCES_PROPERTY_PREFIX+Constants.XMLGRAMMAR_POOL_PROPERTY;
-
- /** Recognized properties. */
- private static final String[] RECOGNIZED_PROPERTIES = {
- SYMBOL_TABLE,
- XMLGRAMMAR_POOL,
- };
-
- //
- // Data
- //
-
- // features
-
- /** Use EntityResolver2. */
- protected boolean fUseEntityResolver2 = true;
-
- //
- // Constructors
- //
-
- /**
- * Constructs a DOM parser using the specified parser configuration.
- */
- public DOMParser(XMLParserConfiguration config) {
- super(config);
- } // <init>(XMLParserConfiguration)
-
- /**
- * Constructs a DOM parser using the dtd/xml schema parser configuration.
- */
- public DOMParser() {
- this(null, null);
- } // <init>()
-
- /**
- * Constructs a DOM parser using the specified symbol table.
- */
- public DOMParser(SymbolTable symbolTable) {
- this(symbolTable, null);
- } // <init>(SymbolTable)
-
-
- /**
- * Constructs a DOM parser using the specified symbol table and
- * grammar pool.
- */
- public DOMParser(SymbolTable symbolTable, XMLGrammarPool grammarPool) {
- super(new XIncludeAwareParserConfiguration());
-
- // set properties
- fConfiguration.addRecognizedProperties(RECOGNIZED_PROPERTIES);
- if (symbolTable != null) {
- fConfiguration.setProperty(SYMBOL_TABLE, symbolTable);
- }
- if (grammarPool != null) {
- fConfiguration.setProperty(XMLGRAMMAR_POOL, grammarPool);
- }
-
- fConfiguration.addRecognizedFeatures(RECOGNIZED_FEATURES);
-
- } // <init>(SymbolTable,XMLGrammarPool)
-
- //
- // XMLReader methods
- //
-
- /**
- * Parses the input source specified by the given system identifier.
- * <p>
- * This method is equivalent to the following:
- * <pre>
- * parse(new InputSource(systemId));
- * </pre>
- *
- * @param systemId The system identifier (URI).
- *
- * @exception org.xml.sax.SAXException Throws exception on SAX error.
- * @exception java.io.IOException Throws exception on i/o error.
- */
- public void parse(String systemId) throws SAXException, IOException {
-
- // parse document
- XMLInputSource source = new XMLInputSource(null, systemId, null);
- try {
- parse(source);
- }
-
- // wrap XNI exceptions as SAX exceptions
- catch (XMLParseException e) {
- Exception ex = e.getException();
- if (ex == null) {
- // must be a parser exception; mine it for locator info and throw
- // a SAXParseException
- LocatorImpl locatorImpl = new LocatorImpl();
- locatorImpl.setPublicId(e.getPublicId());
- locatorImpl.setSystemId(e.getExpandedSystemId());
- locatorImpl.setLineNumber(e.getLineNumber());
- locatorImpl.setColumnNumber(e.getColumnNumber());
- throw new SAXParseException(e.getMessage(), locatorImpl);
- }
- if (ex instanceof SAXException) {
- // why did we create an XMLParseException?
- throw (SAXException)ex;
- }
- if (ex instanceof IOException) {
- throw (IOException)ex;
- }
- throw new SAXException(ex);
- }
- catch (XNIException e) {
- e.printStackTrace();
- Exception ex = e.getException();
- if (ex == null) {
- throw new SAXException(e.getMessage());
- }
- if (ex instanceof SAXException) {
- throw (SAXException)ex;
- }
- if (ex instanceof IOException) {
- throw (IOException)ex;
- }
- throw new SAXException(ex);
- }
-
- } // parse(String)
-
- /**
- * parse
- *
- * @param inputSource
- *
- * @exception org.xml.sax.SAXException
- * @exception java.io.IOException
- */
- public void parse(InputSource inputSource)
- throws SAXException, IOException {
-
- // parse document
- try {
- XMLInputSource xmlInputSource =
- new XMLInputSource(inputSource.getPublicId(),
- inputSource.getSystemId(),
- null);
- xmlInputSource.setByteStream(inputSource.getByteStream());
- xmlInputSource.setCharacterStream(inputSource.getCharacterStream());
- xmlInputSource.setEncoding(inputSource.getEncoding());
- parse(xmlInputSource);
- }
-
- // wrap XNI exceptions as SAX exceptions
- catch (XMLParseException e) {
- Exception ex = e.getException();
- if (ex == null) {
- // must be a parser exception; mine it for locator info and throw
- // a SAXParseException
- LocatorImpl locatorImpl = new LocatorImpl();
- locatorImpl.setPublicId(e.getPublicId());
- locatorImpl.setSystemId(e.getExpandedSystemId());
- locatorImpl.setLineNumber(e.getLineNumber());
- locatorImpl.setColumnNumber(e.getColumnNumber());
- throw new SAXParseException(e.getMessage(), locatorImpl);
- }
- if (ex instanceof SAXException) {
- // why did we create an XMLParseException?
- throw (SAXException)ex;
- }
- if (ex instanceof IOException) {
- throw (IOException)ex;
- }
- throw new SAXException(ex);
- }
- catch (XNIException e) {
- Exception ex = e.getException();
- if (ex == null) {
- throw new SAXException(e.getMessage());
- }
- if (ex instanceof SAXException) {
- throw (SAXException)ex;
- }
- if (ex instanceof IOException) {
- throw (IOException)ex;
- }
- throw new SAXException(ex);
- }
-
- } // parse(InputSource)
-
- /**
- * Sets the resolver used to resolve external entities. The EntityResolver
- * interface supports resolution of public and system identifiers.
- *
- * @param resolver The new entity resolver. Passing a null value will
- * uninstall the currently installed resolver.
- */
- public void setEntityResolver(EntityResolver resolver) {
-
- try {
- XMLEntityResolver xer = (XMLEntityResolver) fConfiguration.getProperty(ENTITY_RESOLVER);
- if (fUseEntityResolver2 && resolver instanceof EntityResolver2) {
- if (xer instanceof EntityResolver2Wrapper) {
- EntityResolver2Wrapper er2w = (EntityResolver2Wrapper) xer;
- er2w.setEntityResolver((EntityResolver2) resolver);
- }
- else {
- fConfiguration.setProperty(ENTITY_RESOLVER,
- new EntityResolver2Wrapper((EntityResolver2) resolver));
- }
- }
- else {
- if (xer instanceof EntityResolverWrapper) {
- EntityResolverWrapper erw = (EntityResolverWrapper) xer;
- erw.setEntityResolver(resolver);
- }
- else {
- fConfiguration.setProperty(ENTITY_RESOLVER,
- new EntityResolverWrapper(resolver));
- }
- }
- }
- catch (XMLConfigurationException e) {
- // do nothing
- }
-
- } // setEntityResolver(EntityResolver)
-
- /**
- * Return the current entity resolver.
- *
- * @return The current entity resolver, or null if none
- * has been registered.
- * @see #setEntityResolver
- */
- public EntityResolver getEntityResolver() {
-
- EntityResolver entityResolver = null;
- try {
- XMLEntityResolver xmlEntityResolver =
- (XMLEntityResolver)fConfiguration.getProperty(ENTITY_RESOLVER);
- if (xmlEntityResolver != null) {
- if (xmlEntityResolver instanceof EntityResolverWrapper) {
- entityResolver =
- ((EntityResolverWrapper) xmlEntityResolver).getEntityResolver();
- }
- else if (xmlEntityResolver instanceof EntityResolver2Wrapper) {
- entityResolver =
- ((EntityResolver2Wrapper) xmlEntityResolver).getEntityResolver();
- }
- }
- }
- catch (XMLConfigurationException e) {
- // do nothing
- }
- return entityResolver;
-
- } // getEntityResolver():EntityResolver
-
- /**
- * Allow an application to register an error event handler.
- *
- * <p>If the application does not register an error handler, all
- * error events reported by the SAX parser will be silently
- * ignored; however, normal processing may not continue. It is
- * highly recommended that all SAX applications implement an
- * error handler to avoid unexpected bugs.</p>
- *
- * <p>Applications may register a new or different handler in the
- * middle of a parse, and the SAX parser must begin using the new
- * handler immediately.</p>
- *
- * @param errorHandler The error handler.
- * @exception java.lang.NullPointerException If the handler
- * argument is null.
- * @see #getErrorHandler
- */
- public void setErrorHandler(ErrorHandler errorHandler) {
-
- try {
- XMLErrorHandler xeh = (XMLErrorHandler) fConfiguration.getProperty(ERROR_HANDLER);
- if (xeh instanceof ErrorHandlerWrapper) {
- ErrorHandlerWrapper ehw = (ErrorHandlerWrapper) xeh;
- ehw.setErrorHandler(errorHandler);
- }
- else {
- fConfiguration.setProperty(ERROR_HANDLER,
- new ErrorHandlerWrapper(errorHandler));
- }
- }
- catch (XMLConfigurationException e) {
- // do nothing
- }
-
- } // setErrorHandler(ErrorHandler)
-
- /**
- * Return the current error handler.
- *
- * @return The current error handler, or null if none
- * has been registered.
- * @see #setErrorHandler
- */
- public ErrorHandler getErrorHandler() {
-
- ErrorHandler errorHandler = null;
- try {
- XMLErrorHandler xmlErrorHandler =
- (XMLErrorHandler)fConfiguration.getProperty(ERROR_HANDLER);
- if (xmlErrorHandler != null &&
- xmlErrorHandler instanceof ErrorHandlerWrapper) {
- errorHandler = ((ErrorHandlerWrapper)xmlErrorHandler).getErrorHandler();
- }
- }
- catch (XMLConfigurationException e) {
- // do nothing
- }
- return errorHandler;
-
- } // getErrorHandler():ErrorHandler
-
- /**
- * Set the state of any feature in a SAX2 parser. The parser
- * might not recognize the feature, and if it does recognize
- * it, it might not be able to fulfill the request.
- *
- * @param featureId The unique identifier (URI) of the feature.
- * @param state The requested state of the feature (true or false).
- *
- * @exception SAXNotRecognizedException If the
- * requested feature is not known.
- * @exception SAXNotSupportedException If the
- * requested feature is known, but the requested
- * state is not supported.
- */
- public void setFeature(String featureId, boolean state)
- throws SAXNotRecognizedException, SAXNotSupportedException {
-
- try {
-
- // http://xml.org/sax/features/use-entity-resolver2
- // controls whether the methods of an object implementing
- // org.xml.sax.ext.EntityResolver2 will be used by the parser.
- //
- if (featureId.equals(USE_ENTITY_RESOLVER2)) {
- if (state != fUseEntityResolver2) {
- fUseEntityResolver2 = state;
- // Refresh EntityResolver wrapper.
- setEntityResolver(getEntityResolver());
- }
- return;
- }
-
- //
- // Default handling
- //
-
- fConfiguration.setFeature(featureId, state);
- }
- catch (XMLConfigurationException e) {
- String identifier = e.getIdentifier();
- if (e.getType() == Status.NOT_RECOGNIZED) {
- throw new SAXNotRecognizedException(
- SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
- "feature-not-recognized", new Object [] {identifier}));
- }
- else {
- throw new SAXNotSupportedException(
- SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
- "feature-not-supported", new Object [] {identifier}));
- }
- }
-
- } // setFeature(String,boolean)
-
- /**
- * Query the state of a feature.
- *
- * Query the current state of any feature in a SAX2 parser. The
- * parser might not recognize the feature.
- *
- * @param featureId The unique identifier (URI) of the feature
- * being set.
- * @return The current state of the feature.
- * @exception org.xml.sax.SAXNotRecognizedException If the
- * requested feature is not known.
- * @exception SAXNotSupportedException If the
- * requested feature is known but not supported.
- */
- public boolean getFeature(String featureId)
- throws SAXNotRecognizedException, SAXNotSupportedException {
-
- try {
-
- // http://xml.org/sax/features/use-entity-resolver2
- // controls whether the methods of an object implementing
- // org.xml.sax.ext.EntityResolver2 will be used by the parser.
- //
- if (featureId.equals(USE_ENTITY_RESOLVER2)) {
- return fUseEntityResolver2;
- }
-
- //
- // Default handling
- //
-
- return fConfiguration.getFeature(featureId);
- }
- catch (XMLConfigurationException e) {
- String identifier = e.getIdentifier();
- if (e.getType() == Status.NOT_RECOGNIZED) {
- throw new SAXNotRecognizedException(
- SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
- "feature-not-recognized", new Object [] {identifier}));
- }
- else {
- throw new SAXNotSupportedException(
- SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
- "feature-not-supported", new Object [] {identifier}));
- }
- }
-
- } // getFeature(String):boolean
-
- /**
- * Set the value of any property in a SAX2 parser. The parser
- * might not recognize the property, and if it does recognize
- * it, it might not support the requested value.
- *
- * @param propertyId The unique identifier (URI) of the property
- * being set.
- * @param value The value to which the property is being set.
- *
- * @exception SAXNotRecognizedException If the
- * requested property is not known.
- * @exception SAXNotSupportedException If the
- * requested property is known, but the requested
- * value is not supported.
- */
- public void setProperty(String propertyId, Object value)
- throws SAXNotRecognizedException, SAXNotSupportedException {
- /**
- * It's possible for users to set a security manager through the interface.
- * If it's the old SecurityManager, convert it to the new XMLSecurityManager
- */
- if (propertyId.equals(Constants.SECURITY_MANAGER)) {
- securityManager = XMLSecurityManager.convert(value, securityManager);
- setProperty0(Constants.SECURITY_MANAGER, securityManager);
- return;
- }
- if (propertyId.equals(Constants.XML_SECURITY_PROPERTY_MANAGER)) {
- if (value == null) {
- securityPropertyManager = new XMLSecurityPropertyManager();
- } else {
- securityPropertyManager = (XMLSecurityPropertyManager)value;
- }
- setProperty0(Constants.XML_SECURITY_PROPERTY_MANAGER, securityPropertyManager);
- return;
- }
-
- if (securityManager == null) {
- securityManager = new XMLSecurityManager(true);
- setProperty0(Constants.SECURITY_MANAGER, securityManager);
- }
-
- if (securityPropertyManager == null) {
- securityPropertyManager = new XMLSecurityPropertyManager();
- setProperty0(Constants.XML_SECURITY_PROPERTY_MANAGER, securityPropertyManager);
- }
- int index = securityPropertyManager.getIndex(propertyId);
-
- if (index > -1) {
- /**
- * this is a direct call to this parser, not a subclass since
- * internally the support of this property is done through
- * XMLSecurityPropertyManager
- */
- securityPropertyManager.setValue(index, XMLSecurityPropertyManager.State.APIPROPERTY, (String)value);
- } else {
- //check if the property is managed by security manager
- if (!securityManager.setLimit(propertyId, XMLSecurityManager.State.APIPROPERTY, value)) {
- //fall back to the default configuration to handle the property
- setProperty0(propertyId, value);
- }
- }
- }
-
- public void setProperty0(String propertyId, Object value)
- throws SAXNotRecognizedException, SAXNotSupportedException {
- try {
- fConfiguration.setProperty(propertyId, value);
- }
- catch (XMLConfigurationException e) {
- String identifier = e.getIdentifier();
- if (e.getType() == Status.NOT_RECOGNIZED) {
- throw new SAXNotRecognizedException(
- SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
- "property-not-recognized", new Object [] {identifier}));
- }
- else {
- throw new SAXNotSupportedException(
- SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
- "property-not-supported", new Object [] {identifier}));
- }
- }
-
- } // setProperty(String,Object)
-
- /**
- * Query the value of a property.
- *
- * Return the current value of a property in a SAX2 parser.
- * The parser might not recognize the property.
- *
- * @param propertyId The unique identifier (URI) of the property
- * being set.
- * @return The current value of the property.
- * @exception org.xml.sax.SAXNotRecognizedException If the
- * requested property is not known.
- * @exception SAXNotSupportedException If the
- * requested property is known but not supported.
- */
- public Object getProperty(String propertyId)
- throws SAXNotRecognizedException, SAXNotSupportedException {
-
- if (propertyId.equals(CURRENT_ELEMENT_NODE)) {
- boolean deferred = false;
- try {
- deferred = getFeature(DEFER_NODE_EXPANSION);
- }
- catch (XMLConfigurationException e){
- // ignore
- }
- if (deferred) {
- throw new SAXNotSupportedException("Current element node cannot be queried when node expansion is deferred.");
- }
- return (fCurrentNode!=null &&
- fCurrentNode.getNodeType() == Node.ELEMENT_NODE)? fCurrentNode:null;
- }
-
- try {
- XMLSecurityPropertyManager spm = (XMLSecurityPropertyManager)
- fConfiguration.getProperty(XML_SECURITY_PROPERTY_MANAGER);
- int index = spm.getIndex(propertyId);
- if (index > -1) {
- return spm.getValueByIndex(index);
- }
-
- return fConfiguration.getProperty(propertyId);
- }
- catch (XMLConfigurationException e) {
- String identifier = e.getIdentifier();
- if (e.getType() == Status.NOT_RECOGNIZED) {
- throw new SAXNotRecognizedException(
- SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
- "property-not-recognized", new Object [] {identifier}));
- }
- else {
- throw new SAXNotSupportedException(
- SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
- "property-not-supported", new Object [] {identifier}));
- }
- }
-
- } // getProperty(String):Object
-
- /**
- * Returns this parser's XMLParserConfiguration.
- */
- public XMLParserConfiguration getXMLParserConfiguration() {
- return fConfiguration;
- } // getXMLParserConfiguration():XMLParserConfiguration
-
-} // class DOMParser
diff --git a/src/com/sun/org/apache/xerces/internal/parsers/DOMParserImpl.java b/src/com/sun/org/apache/xerces/internal/parsers/DOMParserImpl.java
deleted file mode 100644
index 614c826..0000000
--- a/src/com/sun/org/apache/xerces/internal/parsers/DOMParserImpl.java
+++ /dev/null
@@ -1,1392 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2000-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.parsers;
-
-import java.io.StringReader;
-import java.util.Locale;
-import java.util.Stack;
-import java.util.StringTokenizer;
-import java.util.Vector;
-
-import com.sun.org.apache.xerces.internal.dom.DOMErrorImpl;
-import com.sun.org.apache.xerces.internal.dom.DOMMessageFormatter;
-import com.sun.org.apache.xerces.internal.dom.DOMStringListImpl;
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.util.DOMEntityResolverWrapper;
-import com.sun.org.apache.xerces.internal.util.DOMErrorHandlerWrapper;
-import com.sun.org.apache.xerces.internal.util.DOMUtil;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.util.XMLSymbols;
-import com.sun.org.apache.xerces.internal.xni.Augmentations;
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
-import com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLDTDHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLLocator;
-import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
-import com.sun.org.apache.xerces.internal.xni.XMLString;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDContentModelSource;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDSource;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLEntityResolver;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLParseException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration;
-import com.sun.org.apache.xerces.internal.parsers.XIncludeAwareParserConfiguration;
-import org.w3c.dom.DOMConfiguration;
-import org.w3c.dom.DOMError;
-import org.w3c.dom.DOMErrorHandler;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.DOMStringList;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.ls.LSException;
-import org.w3c.dom.ls.LSInput;
-import org.w3c.dom.ls.LSParser;
-import org.w3c.dom.ls.LSParserFilter;
-import org.w3c.dom.ls.LSResourceResolver;
-import org.xml.sax.SAXException;
-
-
-/**
- * This is Xerces DOM Builder class. It uses the abstract DOM
- * parser with a document scanner, a dtd scanner, and a validator, as
- * well as a grammar pool.
- *
- * @author Pavani Mukthipudi, Sun Microsystems Inc.
- * @author Elena Litani, IBM
- * @author Rahul Srivastava, Sun Microsystems Inc.
- * @version $Id: DOMParserImpl.java,v 1.8 2010-11-01 04:40:09 joehw Exp $
- */
-
-
-public class DOMParserImpl
-extends AbstractDOMParser implements LSParser, DOMConfiguration {
-
-
-
- // SAX & Xerces feature ids
-
- /** Feature identifier: namespaces. */
- protected static final String NAMESPACES =
- Constants.SAX_FEATURE_PREFIX + Constants.NAMESPACES_FEATURE;
-
- /** Feature id: validation. */
- protected static final String VALIDATION_FEATURE =
- Constants.SAX_FEATURE_PREFIX+Constants.VALIDATION_FEATURE;
-
- /** XML Schema validation */
- protected static final String XMLSCHEMA =
- Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_VALIDATION_FEATURE;
-
- /** XML Schema full checking */
- protected static final String XMLSCHEMA_FULL_CHECKING =
- Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_FULL_CHECKING;
-
- /** Dynamic validation */
- protected static final String DYNAMIC_VALIDATION =
- Constants.XERCES_FEATURE_PREFIX + Constants.DYNAMIC_VALIDATION_FEATURE;
-
- /** Feature identifier: expose schema normalized value */
- protected static final String NORMALIZE_DATA =
- Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_NORMALIZED_VALUE;
-
- /** Feature identifier: disallow docType Decls. */
- protected static final String DISALLOW_DOCTYPE_DECL_FEATURE =
- Constants.XERCES_FEATURE_PREFIX + Constants.DISALLOW_DOCTYPE_DECL_FEATURE;
-
- /** Feature identifier: namespace growth */
- protected static final String NAMESPACE_GROWTH =
- Constants.XERCES_FEATURE_PREFIX + Constants.NAMESPACE_GROWTH_FEATURE;
-
- /** Feature identifier: tolerate duplicates */
- protected static final String TOLERATE_DUPLICATES =
- Constants.XERCES_FEATURE_PREFIX + Constants.TOLERATE_DUPLICATES_FEATURE;
-
- // internal properties
- protected static final String SYMBOL_TABLE =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY;
-
- protected static final String PSVI_AUGMENT =
- Constants.XERCES_FEATURE_PREFIX +Constants.SCHEMA_AUGMENT_PSVI;
-
-
- //
- // Data
- //
-
- /** Include namespace declaration attributes in the document. **/
- protected boolean fNamespaceDeclarations = true;
-
- // REVISIT: this value should be null by default and should be set during creation of
- // LSParser
- protected String fSchemaType = null;
-
- protected boolean fBusy = false;
-
- private boolean abortNow = false;
-
- private Thread currentThread;
-
- protected final static boolean DEBUG = false;
-
- private Vector fSchemaLocations = new Vector ();
- private String fSchemaLocation = null;
- private DOMStringList fRecognizedParameters;
-
- private AbortHandler abortHandler = null;
-
- //
- // Constructors
- //
-
- /**
- * Constructs a DOM Builder using the standard parser configuration.
- */
- public DOMParserImpl (XMLParserConfiguration config, String schemaType) {
- this (config);
- if (schemaType != null) {
- if (schemaType.equals (Constants.NS_DTD)) {
- //Schema validation is false by default and hence there is no
- //need to set it to false here. Also, schema validation is
- //not a recognized feature for DTDConfiguration's and so
- //setting this feature here would result in a Configuration
- //Exception.
- fConfiguration.setProperty (
- Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_LANGUAGE,
- Constants.NS_DTD);
- fSchemaType = Constants.NS_DTD;
- }
- else if (schemaType.equals (Constants.NS_XMLSCHEMA)) {
- // XML Schem validation
- fConfiguration.setProperty (
- Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_LANGUAGE,
- Constants.NS_XMLSCHEMA);
- }
- }
-
- }
-
- /**
- * Constructs a DOM Builder using the specified parser configuration.
- */
- public DOMParserImpl (XMLParserConfiguration config) {
- super (config);
-
- // add recognized features
- final String[] domRecognizedFeatures = {
- Constants.DOM_CANONICAL_FORM,
- Constants.DOM_CDATA_SECTIONS,
- Constants.DOM_CHARSET_OVERRIDES_XML_ENCODING,
- Constants.DOM_INFOSET,
- Constants.DOM_NAMESPACE_DECLARATIONS,
- Constants.DOM_SPLIT_CDATA,
- Constants.DOM_SUPPORTED_MEDIATYPES_ONLY,
- Constants.DOM_CERTIFIED,
- Constants.DOM_WELLFORMED,
- Constants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS,
- };
-
- fConfiguration.addRecognizedFeatures (domRecognizedFeatures);
-
- // turn off deferred DOM
- fConfiguration.setFeature (DEFER_NODE_EXPANSION, false);
-
- // Set values so that the value of the
- // infoset parameter is true (its default value).
- //
- // true: namespace-declarations, well-formed,
- // element-content-whitespace, comments, namespaces
- //
- // false: validate-if-schema, entities,
- // datatype-normalization, cdata-sections
-
- fConfiguration.setFeature(Constants.DOM_NAMESPACE_DECLARATIONS, true);
- fConfiguration.setFeature(Constants.DOM_WELLFORMED, true);
- fConfiguration.setFeature(INCLUDE_COMMENTS_FEATURE, true);
- fConfiguration.setFeature(INCLUDE_IGNORABLE_WHITESPACE, true);
- fConfiguration.setFeature(NAMESPACES, true);
-
- fConfiguration.setFeature(DYNAMIC_VALIDATION, false);
- fConfiguration.setFeature(CREATE_ENTITY_REF_NODES, false);
- fConfiguration.setFeature(CREATE_CDATA_NODES_FEATURE, false);
-
- // set other default values
- fConfiguration.setFeature (Constants.DOM_CANONICAL_FORM, false);
- fConfiguration.setFeature (Constants.DOM_CHARSET_OVERRIDES_XML_ENCODING, true);
- fConfiguration.setFeature (Constants.DOM_SPLIT_CDATA, true);
- fConfiguration.setFeature (Constants.DOM_SUPPORTED_MEDIATYPES_ONLY, false);
- fConfiguration.setFeature (Constants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS, true);
-
- // REVISIT: by default Xerces assumes that input is certified.
- // default is different from the one specified in the DOM spec
- fConfiguration.setFeature (Constants.DOM_CERTIFIED, true);
-
- // Xerces datatype-normalization feature is on by default
- // This is a recognized feature only for XML Schemas. If the
- // configuration doesn't support this feature, ignore it.
- try {
- fConfiguration.setFeature ( NORMALIZE_DATA, false );
- }
- catch (XMLConfigurationException exc) {}
-
- } // <init>(XMLParserConfiguration)
-
- /**
- * Constructs a DOM Builder using the specified symbol table.
- */
- public DOMParserImpl (SymbolTable symbolTable) {
- this (new XIncludeAwareParserConfiguration());
- fConfiguration.setProperty (
- Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY,
- symbolTable);
- } // <init>(SymbolTable)
-
-
- /**
- * Constructs a DOM Builder using the specified symbol table and
- * grammar pool.
- */
- public DOMParserImpl (SymbolTable symbolTable, XMLGrammarPool grammarPool) {
- this (new XIncludeAwareParserConfiguration());
- fConfiguration.setProperty (
- Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY,
- symbolTable);
- fConfiguration.setProperty (
- Constants.XERCES_PROPERTY_PREFIX
- + Constants.XMLGRAMMAR_POOL_PROPERTY,
- grammarPool);
- }
-
- /**
- * Resets the parser state.
- *
- * @throws SAXException Thrown on initialization error.
- */
- public void reset () {
- super.reset ();
-
- // get state of namespace-declarations parameter.
- fNamespaceDeclarations =
- fConfiguration.getFeature(Constants.DOM_NAMESPACE_DECLARATIONS);
-
- // DOM Filter
- if (fSkippedElemStack!=null) {
- fSkippedElemStack.removeAllElements ();
- }
- fSchemaLocations.clear ();
- fRejectedElementDepth = 0;
- fFilterReject = false;
- fSchemaType = null;
-
- } // reset()
-
- //
- // DOMParser methods
- //
-
- public DOMConfiguration getDomConfig (){
- return this;
- }
-
-
- /**
- * When the application provides a filter, the parser will call out to
- * the filter at the completion of the construction of each
- * <code>Element</code> node. The filter implementation can choose to
- * remove the element from the document being constructed (unless the
- * element is the document element) or to terminate the parse early. If
- * the document is being validated when it's loaded the validation
- * happens before the filter is called.
- */
- public LSParserFilter getFilter () {
- return fDOMFilter;
- }
-
- /**
- * When the application provides a filter, the parser will call out to
- * the filter at the completion of the construction of each
- * <code>Element</code> node. The filter implementation can choose to
- * remove the element from the document being constructed (unless the
- * element is the document element) or to terminate the parse early. If
- * the document is being validated when it's loaded the validation
- * happens before the filter is called.
- */
- public void setFilter (LSParserFilter filter) {
- fDOMFilter = filter;
- if (fSkippedElemStack == null) {
- fSkippedElemStack = new Stack ();
- }
- }
-
- /**
- * Set parameters and properties
- */
- public void setParameter (String name, Object value) throws DOMException {
- // set features
-
- if(value instanceof Boolean){
- boolean state = ((Boolean)value).booleanValue ();
- try {
- if (name.equalsIgnoreCase (Constants.DOM_COMMENTS)) {
- fConfiguration.setFeature (INCLUDE_COMMENTS_FEATURE, state);
- }
- else if (name.equalsIgnoreCase (Constants.DOM_DATATYPE_NORMALIZATION)) {
- fConfiguration.setFeature (NORMALIZE_DATA, state);
- }
- else if (name.equalsIgnoreCase (Constants.DOM_ENTITIES)) {
- fConfiguration.setFeature (CREATE_ENTITY_REF_NODES, state);
- }
- else if (name.equalsIgnoreCase (Constants.DOM_DISALLOW_DOCTYPE)) {
- fConfiguration.setFeature (DISALLOW_DOCTYPE_DECL_FEATURE, state);
- }
- else if (name.equalsIgnoreCase (Constants.DOM_SUPPORTED_MEDIATYPES_ONLY)
- || name.equalsIgnoreCase(Constants.DOM_NORMALIZE_CHARACTERS)
- || name.equalsIgnoreCase (Constants.DOM_CHECK_CHAR_NORMALIZATION)
- || name.equalsIgnoreCase (Constants.DOM_CANONICAL_FORM)) {
- if (state) { // true is not supported
- String msg =
- DOMMessageFormatter.formatMessage (
- DOMMessageFormatter.DOM_DOMAIN,
- "FEATURE_NOT_SUPPORTED",
- new Object[] { name });
- throw new DOMException (DOMException.NOT_SUPPORTED_ERR, msg);
- }
- // setting those features to false is no-op
- }
- else if (name.equalsIgnoreCase (Constants.DOM_NAMESPACES)) {
- fConfiguration.setFeature (NAMESPACES, state);
- }
- else if (name.equalsIgnoreCase (Constants.DOM_INFOSET)) {
- // Setting false has no effect.
- if (state) {
- // true: namespaces, namespace-declarations,
- // comments, element-content-whitespace
- fConfiguration.setFeature(NAMESPACES, true);
- fConfiguration.setFeature(Constants.DOM_NAMESPACE_DECLARATIONS, true);
- fConfiguration.setFeature(INCLUDE_COMMENTS_FEATURE, true);
- fConfiguration.setFeature(INCLUDE_IGNORABLE_WHITESPACE, true);
-
- // false: validate-if-schema, entities,
- // datatype-normalization, cdata-sections
- fConfiguration.setFeature(DYNAMIC_VALIDATION, false);
- fConfiguration.setFeature(CREATE_ENTITY_REF_NODES, false);
- fConfiguration.setFeature(NORMALIZE_DATA, false);
- fConfiguration.setFeature(CREATE_CDATA_NODES_FEATURE, false);
- }
- }
- else if (name.equalsIgnoreCase(Constants.DOM_CDATA_SECTIONS)) {
- fConfiguration.setFeature(CREATE_CDATA_NODES_FEATURE, state);
- }
- else if (name.equalsIgnoreCase (Constants.DOM_NAMESPACE_DECLARATIONS)) {
- fConfiguration.setFeature(Constants.DOM_NAMESPACE_DECLARATIONS, state);
- }
- else if (name.equalsIgnoreCase (Constants.DOM_WELLFORMED)
- || name.equalsIgnoreCase (Constants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS)) {
- if (!state) { // false is not supported
- String msg =
- DOMMessageFormatter.formatMessage (
- DOMMessageFormatter.DOM_DOMAIN,
- "FEATURE_NOT_SUPPORTED",
- new Object[] { name });
- throw new DOMException (DOMException.NOT_SUPPORTED_ERR, msg);
- }
- // setting these features to true is no-op
- // REVISIT: implement "namespace-declaration" feature
- }
- else if (name.equalsIgnoreCase (Constants.DOM_VALIDATE)) {
- fConfiguration.setFeature (VALIDATION_FEATURE, state);
- if (fSchemaType != Constants.NS_DTD) {
- fConfiguration.setFeature (XMLSCHEMA, state);
- fConfiguration.setFeature (XMLSCHEMA_FULL_CHECKING, state);
- }
- if (state){
- fConfiguration.setFeature (DYNAMIC_VALIDATION, false);
- }
- }
- else if (name.equalsIgnoreCase (Constants.DOM_VALIDATE_IF_SCHEMA)) {
- fConfiguration.setFeature (DYNAMIC_VALIDATION, state);
- // Note: validation and dynamic validation are mutually exclusive
- if (state){
- fConfiguration.setFeature (VALIDATION_FEATURE, false);
- }
- }
- else if (name.equalsIgnoreCase (Constants.DOM_ELEMENT_CONTENT_WHITESPACE)) {
- fConfiguration.setFeature (INCLUDE_IGNORABLE_WHITESPACE, state);
- }
- else if (name.equalsIgnoreCase (Constants.DOM_PSVI)){
- //XSModel - turn on PSVI augmentation
- fConfiguration.setFeature (PSVI_AUGMENT, true);
- fConfiguration.setProperty (DOCUMENT_CLASS_NAME,
- "com.sun.org.apache.xerces.internal.dom.PSVIDocumentImpl");
- }
- else {
- // Constants.DOM_CHARSET_OVERRIDES_XML_ENCODING feature,
- // Constants.DOM_SPLIT_CDATA feature,
- // or any Xerces feature
- String normalizedName;
- if (name.equals(NAMESPACE_GROWTH)) {
- normalizedName = NAMESPACE_GROWTH;
- }
- else if (name.equals(TOLERATE_DUPLICATES)) {
- normalizedName = TOLERATE_DUPLICATES;
- }
- else {
- normalizedName = name.toLowerCase(Locale.ENGLISH);
- }
- fConfiguration.setFeature (normalizedName, state);
- }
-
- }
- catch (XMLConfigurationException e) {
- String msg =
- DOMMessageFormatter.formatMessage (
- DOMMessageFormatter.DOM_DOMAIN,
- "FEATURE_NOT_FOUND",
- new Object[] { name });
- throw new DOMException (DOMException.NOT_FOUND_ERR, msg);
- }
- }
- else { // set properties
- if (name.equalsIgnoreCase (Constants.DOM_ERROR_HANDLER)) {
- if (value instanceof DOMErrorHandler || value == null) {
- try {
- fErrorHandler = new DOMErrorHandlerWrapper ((DOMErrorHandler) value);
- fConfiguration.setProperty (ERROR_HANDLER, fErrorHandler);
- }
- catch (XMLConfigurationException e) {}
- }
- else {
- // REVISIT: type mismatch
- String msg =
- DOMMessageFormatter.formatMessage (
- DOMMessageFormatter.DOM_DOMAIN,
- "TYPE_MISMATCH_ERR",
- new Object[] { name });
- throw new DOMException (DOMException.TYPE_MISMATCH_ERR, msg);
- }
-
- }
- else if (name.equalsIgnoreCase (Constants.DOM_RESOURCE_RESOLVER)) {
- if (value instanceof LSResourceResolver || value == null) {
- try {
- fConfiguration.setProperty (ENTITY_RESOLVER, new DOMEntityResolverWrapper ((LSResourceResolver) value));
- }
- catch (XMLConfigurationException e) {}
- }
- else {
- // REVISIT: type mismatch
- String msg =
- DOMMessageFormatter.formatMessage (
- DOMMessageFormatter.DOM_DOMAIN,
- "TYPE_MISMATCH_ERR",
- new Object[] { name });
- throw new DOMException (DOMException.TYPE_MISMATCH_ERR, msg);
- }
-
- }
- else if (name.equalsIgnoreCase (Constants.DOM_SCHEMA_LOCATION)) {
- if (value instanceof String || value == null) {
- try {
- if (value == null) {
- fSchemaLocation = null;
- fConfiguration.setProperty (
- Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_SOURCE,
- null);
- }
- else {
- fSchemaLocation = (String)value;
- // map DOM schema-location to JAXP schemaSource property
- // tokenize location string
- StringTokenizer t = new StringTokenizer (fSchemaLocation, " \n\t\r");
- if (t.hasMoreTokens ()){
- fSchemaLocations.clear ();
- fSchemaLocations.add (t.nextToken ());
- while (t.hasMoreTokens ()) {
- fSchemaLocations.add (t.nextToken ());
- }
- fConfiguration.setProperty (
- Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_SOURCE,
- fSchemaLocations.toArray ());
- }
- else {
- fConfiguration.setProperty (
- Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_SOURCE,
- value);
- }
- }
- }
- catch (XMLConfigurationException e) {}
- }
- else {
- // REVISIT: type mismatch
- String msg =
- DOMMessageFormatter.formatMessage (
- DOMMessageFormatter.DOM_DOMAIN,
- "TYPE_MISMATCH_ERR",
- new Object[] { name });
- throw new DOMException (DOMException.TYPE_MISMATCH_ERR, msg);
- }
-
- }
- else if (name.equalsIgnoreCase (Constants.DOM_SCHEMA_TYPE)) {
- if (value instanceof String || value == null) {
- try {
- if (value == null) {
- // turn off schema features
- fConfiguration.setFeature (XMLSCHEMA, false);
- fConfiguration.setFeature (XMLSCHEMA_FULL_CHECKING, false);
- // map to JAXP schemaLanguage
- fConfiguration.setProperty ( Constants.JAXP_PROPERTY_PREFIX
- + Constants.SCHEMA_LANGUAGE,
- null);
- fSchemaType = null;
- }
- else if (value.equals (Constants.NS_XMLSCHEMA)) {
- // turn on schema features
- fConfiguration.setFeature (XMLSCHEMA, true);
- fConfiguration.setFeature (XMLSCHEMA_FULL_CHECKING, true);
- // map to JAXP schemaLanguage
- fConfiguration.setProperty ( Constants.JAXP_PROPERTY_PREFIX
- + Constants.SCHEMA_LANGUAGE,
- Constants.NS_XMLSCHEMA);
- fSchemaType = Constants.NS_XMLSCHEMA;
- }
- else if (value.equals (Constants.NS_DTD)) {
- // turn off schema features
- fConfiguration.setFeature (XMLSCHEMA, false);
- fConfiguration.setFeature (XMLSCHEMA_FULL_CHECKING, false);
- // map to JAXP schemaLanguage
- fConfiguration.setProperty ( Constants.JAXP_PROPERTY_PREFIX
- + Constants.SCHEMA_LANGUAGE,
- Constants.NS_DTD);
- fSchemaType = Constants.NS_DTD;
- }
- }
- catch (XMLConfigurationException e) {}
- }
- else {
- String msg =
- DOMMessageFormatter.formatMessage (
- DOMMessageFormatter.DOM_DOMAIN,
- "TYPE_MISMATCH_ERR",
- new Object[] { name });
- throw new DOMException (DOMException.TYPE_MISMATCH_ERR, msg);
- }
-
- }
- else if (name.equalsIgnoreCase (DOCUMENT_CLASS_NAME)) {
- fConfiguration.setProperty (DOCUMENT_CLASS_NAME, value);
- }
- else {
- // Try to set the property.
- String normalizedName = name.toLowerCase(Locale.ENGLISH);
- try {
- fConfiguration.setProperty(normalizedName, value);
- return;
- }
- catch (XMLConfigurationException e) {}
-
- // If this is a boolean parameter a type mismatch should be thrown.
- try {
- if (name.equals(NAMESPACE_GROWTH)) {
- normalizedName = NAMESPACE_GROWTH;
- }
- else if (name.equals(TOLERATE_DUPLICATES)) {
- normalizedName = TOLERATE_DUPLICATES;
- }
- fConfiguration.getFeature(normalizedName);
- throw newTypeMismatchError(name);
-
- }
- catch (XMLConfigurationException e) {}
-
- // Parameter is not recognized
- throw newFeatureNotFoundError(name);
- }
- }
- }
-
- /**
- * Look up the value of a feature or a property.
- */
- public Object getParameter (String name) throws DOMException {
- if (name.equalsIgnoreCase (Constants.DOM_COMMENTS)) {
- return (fConfiguration.getFeature (INCLUDE_COMMENTS_FEATURE))
- ? Boolean.TRUE
- : Boolean.FALSE;
- }
- else if (name.equalsIgnoreCase (Constants.DOM_DATATYPE_NORMALIZATION)) {
- return (fConfiguration.getFeature (NORMALIZE_DATA))
- ? Boolean.TRUE
- : Boolean.FALSE;
- }
- else if (name.equalsIgnoreCase (Constants.DOM_ENTITIES)) {
- return (fConfiguration.getFeature (CREATE_ENTITY_REF_NODES))
- ? Boolean.TRUE
- : Boolean.FALSE;
- }
- else if (name.equalsIgnoreCase (Constants.DOM_NAMESPACES)) {
- return (fConfiguration.getFeature (NAMESPACES))
- ? Boolean.TRUE
- : Boolean.FALSE;
- }
- else if (name.equalsIgnoreCase (Constants.DOM_VALIDATE)) {
- return (fConfiguration.getFeature (VALIDATION_FEATURE))
- ? Boolean.TRUE
- : Boolean.FALSE;
- }
- else if (name.equalsIgnoreCase (Constants.DOM_VALIDATE_IF_SCHEMA)) {
- return (fConfiguration.getFeature (DYNAMIC_VALIDATION))
- ? Boolean.TRUE
- : Boolean.FALSE;
- }
- else if (name.equalsIgnoreCase (Constants.DOM_ELEMENT_CONTENT_WHITESPACE)) {
- return (fConfiguration.getFeature (INCLUDE_IGNORABLE_WHITESPACE))
- ? Boolean.TRUE
- : Boolean.FALSE;
- }
- else if (name.equalsIgnoreCase (Constants.DOM_DISALLOW_DOCTYPE)) {
- return (fConfiguration.getFeature (DISALLOW_DOCTYPE_DECL_FEATURE))
- ? Boolean.TRUE
- : Boolean.FALSE;
- }
- else if (name.equalsIgnoreCase (Constants.DOM_INFOSET)) {
- // REVISIT: This is somewhat expensive to compute
- // but it's possible that the user has a reference
- // to the configuration and is changing the values
- // of these features directly on it.
- boolean infoset = fConfiguration.getFeature(NAMESPACES) &&
- fConfiguration.getFeature(Constants.DOM_NAMESPACE_DECLARATIONS) &&
- fConfiguration.getFeature(INCLUDE_COMMENTS_FEATURE) &&
- fConfiguration.getFeature(INCLUDE_IGNORABLE_WHITESPACE) &&
- !fConfiguration.getFeature(DYNAMIC_VALIDATION) &&
- !fConfiguration.getFeature(CREATE_ENTITY_REF_NODES) &&
- !fConfiguration.getFeature(NORMALIZE_DATA) &&
- !fConfiguration.getFeature(CREATE_CDATA_NODES_FEATURE);
- return (infoset) ? Boolean.TRUE : Boolean.FALSE;
- }
- else if (name.equalsIgnoreCase(Constants.DOM_CDATA_SECTIONS)) {
- return (fConfiguration.getFeature(CREATE_CDATA_NODES_FEATURE))
- ? Boolean.TRUE : Boolean.FALSE;
- }
- else if (name.equalsIgnoreCase(Constants.DOM_CHECK_CHAR_NORMALIZATION ) ||
- name.equalsIgnoreCase(Constants.DOM_NORMALIZE_CHARACTERS)){
- return Boolean.FALSE;
- }
- else if (name.equalsIgnoreCase(Constants.DOM_NAMESPACE_DECLARATIONS)
- || name.equalsIgnoreCase (Constants.DOM_WELLFORMED)
- || name.equalsIgnoreCase (Constants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS)
- || name.equalsIgnoreCase (Constants.DOM_CANONICAL_FORM)
- || name.equalsIgnoreCase (Constants.DOM_SUPPORTED_MEDIATYPES_ONLY)
- || name.equalsIgnoreCase (Constants.DOM_SPLIT_CDATA)
- || name.equalsIgnoreCase (Constants.DOM_CHARSET_OVERRIDES_XML_ENCODING)) {
- return (fConfiguration.getFeature (name.toLowerCase(Locale.ENGLISH)))
- ? Boolean.TRUE
- : Boolean.FALSE;
- }
- else if (name.equalsIgnoreCase (Constants.DOM_ERROR_HANDLER)) {
- if (fErrorHandler != null) {
- return fErrorHandler.getErrorHandler ();
- }
- return null;
- }
- else if (name.equalsIgnoreCase (Constants.DOM_RESOURCE_RESOLVER)) {
- try {
- XMLEntityResolver entityResolver =
- (XMLEntityResolver) fConfiguration.getProperty (ENTITY_RESOLVER);
- if (entityResolver != null
- && entityResolver instanceof DOMEntityResolverWrapper) {
- return ((DOMEntityResolverWrapper) entityResolver).getEntityResolver ();
- }
- return null;
- }
- catch (XMLConfigurationException e) {}
- }
- else if (name.equalsIgnoreCase (Constants.DOM_SCHEMA_TYPE)) {
- return fConfiguration.getProperty (
- Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_LANGUAGE);
- }
- else if (name.equalsIgnoreCase (Constants.DOM_SCHEMA_LOCATION)) {
- return fSchemaLocation;
- }
- else if (name.equalsIgnoreCase (SYMBOL_TABLE)){
- return fConfiguration.getProperty (SYMBOL_TABLE);
- }
- else if (name.equalsIgnoreCase (DOCUMENT_CLASS_NAME)) {
- return fConfiguration.getProperty (DOCUMENT_CLASS_NAME);
- }
- else {
- // This could be a recognized feature or property.
- String normalizedName;
-
- if (name.equals(NAMESPACE_GROWTH)) {
- normalizedName = NAMESPACE_GROWTH;
- }
- else if (name.equals(TOLERATE_DUPLICATES)) {
- normalizedName = TOLERATE_DUPLICATES;
- }
- else {
- normalizedName = name.toLowerCase(Locale.ENGLISH);
- }
- try {
- return fConfiguration.getFeature(normalizedName)
- ? Boolean.TRUE : Boolean.FALSE;
- }
- catch (XMLConfigurationException e) {}
-
- // This isn't a feature; perhaps it's a property
- try {
- return fConfiguration.getProperty(normalizedName);
- }
- catch (XMLConfigurationException e) {}
-
- throw newFeatureNotFoundError(name);
- }
- return null;
- }
-
- public boolean canSetParameter (String name, Object value) {
- if (value == null){
- return true;
- }
-
- if(value instanceof Boolean){
- boolean state = ((Boolean)value).booleanValue ();
- if ( name.equalsIgnoreCase (Constants.DOM_SUPPORTED_MEDIATYPES_ONLY)
- || name.equalsIgnoreCase(Constants.DOM_NORMALIZE_CHARACTERS)
- || name.equalsIgnoreCase(Constants.DOM_CHECK_CHAR_NORMALIZATION )
- || name.equalsIgnoreCase (Constants.DOM_CANONICAL_FORM) ) {
- // true is not supported
- return (state) ? false : true;
- }
- else if (name.equalsIgnoreCase (Constants.DOM_WELLFORMED)
- || name.equalsIgnoreCase (Constants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS)) {
- // false is not supported
- return (state) ? true : false;
- }
- else if (name.equalsIgnoreCase (Constants.DOM_CDATA_SECTIONS)
- || name.equalsIgnoreCase (Constants.DOM_CHARSET_OVERRIDES_XML_ENCODING)
- || name.equalsIgnoreCase (Constants.DOM_COMMENTS)
- || name.equalsIgnoreCase (Constants.DOM_DATATYPE_NORMALIZATION)
- || name.equalsIgnoreCase (Constants.DOM_DISALLOW_DOCTYPE)
- || name.equalsIgnoreCase (Constants.DOM_ENTITIES)
- || name.equalsIgnoreCase (Constants.DOM_INFOSET)
- || name.equalsIgnoreCase (Constants.DOM_NAMESPACES)
- || name.equalsIgnoreCase (Constants.DOM_NAMESPACE_DECLARATIONS)
- || name.equalsIgnoreCase (Constants.DOM_VALIDATE)
- || name.equalsIgnoreCase (Constants.DOM_VALIDATE_IF_SCHEMA)
- || name.equalsIgnoreCase (Constants.DOM_ELEMENT_CONTENT_WHITESPACE)
- || name.equalsIgnoreCase (Constants.DOM_XMLDECL)) {
- return true;
- }
-
- // Recognize Xerces features.
- try {
- String normalizedName;
- if (name.equalsIgnoreCase(NAMESPACE_GROWTH)) {
- normalizedName = NAMESPACE_GROWTH;
- }
- else if (name.equalsIgnoreCase(TOLERATE_DUPLICATES)) {
- normalizedName = TOLERATE_DUPLICATES;
- }
- else {
- normalizedName = name.toLowerCase(Locale.ENGLISH);
- }
- fConfiguration.getFeature(normalizedName);
- return true;
- }
- catch (XMLConfigurationException e) {
- return false;
- }
- }
- else { // check properties
- if (name.equalsIgnoreCase (Constants.DOM_ERROR_HANDLER)) {
- if (value instanceof DOMErrorHandler || value == null) {
- return true;
- }
- return false;
- }
- else if (name.equalsIgnoreCase (Constants.DOM_RESOURCE_RESOLVER)) {
- if (value instanceof LSResourceResolver || value == null) {
- return true;
- }
- return false;
- }
- else if (name.equalsIgnoreCase (Constants.DOM_SCHEMA_TYPE)) {
- if ((value instanceof String
- && (value.equals (Constants.NS_XMLSCHEMA)
- || value.equals (Constants.NS_DTD))) || value == null) {
- return true;
- }
- return false;
- }
- else if (name.equalsIgnoreCase (Constants.DOM_SCHEMA_LOCATION)) {
- if (value instanceof String || value == null)
- return true;
- return false;
- }
- else if (name.equalsIgnoreCase (DOCUMENT_CLASS_NAME)){
- return true;
- }
- return false;
- }
- }
-
- /**
- * DOM Level 3 CR - Experimental.
- *
- * The list of the parameters supported by this
- * <code>DOMConfiguration</code> object and for which at least one value
- * can be set by the application. Note that this list can also contain
- * parameter names defined outside this specification.
- */
- public DOMStringList getParameterNames () {
- if (fRecognizedParameters == null){
- Vector parameters = new Vector();
-
- // REVISIT: add Xerces recognized properties/features
- parameters.add(Constants.DOM_NAMESPACES);
- parameters.add(Constants.DOM_CDATA_SECTIONS);
- parameters.add(Constants.DOM_CANONICAL_FORM);
- parameters.add(Constants.DOM_NAMESPACE_DECLARATIONS);
- parameters.add(Constants.DOM_SPLIT_CDATA);
-
- parameters.add(Constants.DOM_ENTITIES);
- parameters.add(Constants.DOM_VALIDATE_IF_SCHEMA);
- parameters.add(Constants.DOM_VALIDATE);
- parameters.add(Constants.DOM_DATATYPE_NORMALIZATION);
-
- parameters.add(Constants.DOM_CHARSET_OVERRIDES_XML_ENCODING);
- parameters.add(Constants.DOM_CHECK_CHAR_NORMALIZATION);
- parameters.add(Constants.DOM_SUPPORTED_MEDIATYPES_ONLY);
- parameters.add(Constants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS);
-
- parameters.add(Constants.DOM_NORMALIZE_CHARACTERS);
- parameters.add(Constants.DOM_WELLFORMED);
- parameters.add(Constants.DOM_INFOSET);
- parameters.add(Constants.DOM_DISALLOW_DOCTYPE);
- parameters.add(Constants.DOM_ELEMENT_CONTENT_WHITESPACE);
- parameters.add(Constants.DOM_COMMENTS);
-
- parameters.add(Constants.DOM_ERROR_HANDLER);
- parameters.add(Constants.DOM_RESOURCE_RESOLVER);
- parameters.add(Constants.DOM_SCHEMA_LOCATION);
- parameters.add(Constants.DOM_SCHEMA_TYPE);
-
- fRecognizedParameters = new DOMStringListImpl(parameters);
-
- }
-
- return fRecognizedParameters;
- }
-
- /**
- * Parse an XML document from a location identified by an URI reference.
- * If the URI contains a fragment identifier (see section 4.1 in ), the
- * behavior is not defined by this specification.
- *
- */
- public Document parseURI (String uri) throws LSException {
-
- //If DOMParser insstance is already busy parsing another document when this
- // method is called, then raise INVALID_STATE_ERR according to DOM L3 LS spec
- if ( fBusy ) {
- String msg = DOMMessageFormatter.formatMessage (
- DOMMessageFormatter.DOM_DOMAIN,
- "INVALID_STATE_ERR",null);
- throw new DOMException ( DOMException.INVALID_STATE_ERR,msg);
- }
-
- XMLInputSource source = new XMLInputSource (null, uri, null);
- try {
- currentThread = Thread.currentThread();
- fBusy = true;
- parse (source);
- fBusy = false;
- if (abortNow && currentThread.isInterrupted()) {
- //reset interrupt state
- abortNow = false;
- Thread.interrupted();
- }
- } catch (Exception e){
- fBusy = false;
- if (abortNow && currentThread.isInterrupted()) {
- Thread.interrupted();
- }
- if (abortNow) {
- abortNow = false;
- restoreHandlers();
- return null;
- }
- // Consume this exception if the user
- // issued an interrupt or an abort.
- if (e != Abort.INSTANCE) {
- if (!(e instanceof XMLParseException) && fErrorHandler != null) {
- DOMErrorImpl error = new DOMErrorImpl ();
- error.fException = e;
- error.fMessage = e.getMessage ();
- error.fSeverity = DOMError.SEVERITY_FATAL_ERROR;
- fErrorHandler.getErrorHandler ().handleError (error);
- }
- if (DEBUG) {
- e.printStackTrace ();
- }
- throw (LSException) DOMUtil.createLSException(LSException.PARSE_ERR, e).fillInStackTrace();
- }
- }
- Document doc = getDocument();
- dropDocumentReferences();
- return doc;
- }
-
- /**
- * Parse an XML document from a resource identified by an
- * <code>LSInput</code>.
- *
- */
- public Document parse (LSInput is) throws LSException {
-
- // need to wrap the LSInput with an XMLInputSource
- XMLInputSource xmlInputSource = dom2xmlInputSource (is);
- if ( fBusy ) {
- String msg = DOMMessageFormatter.formatMessage (
- DOMMessageFormatter.DOM_DOMAIN,
- "INVALID_STATE_ERR",null);
- throw new DOMException ( DOMException.INVALID_STATE_ERR,msg);
- }
-
- try {
- currentThread = Thread.currentThread();
- fBusy = true;
- parse (xmlInputSource);
- fBusy = false;
- if (abortNow && currentThread.isInterrupted()) {
- //reset interrupt state
- abortNow = false;
- Thread.interrupted();
- }
- } catch (Exception e) {
- fBusy = false;
- if (abortNow && currentThread.isInterrupted()) {
- Thread.interrupted();
- }
- if (abortNow) {
- abortNow = false;
- restoreHandlers();
- return null;
- }
- // Consume this exception if the user
- // issued an interrupt or an abort.
- if (e != Abort.INSTANCE) {
- if (!(e instanceof XMLParseException) && fErrorHandler != null) {
- DOMErrorImpl error = new DOMErrorImpl ();
- error.fException = e;
- error.fMessage = e.getMessage ();
- error.fSeverity = DOMError.SEVERITY_FATAL_ERROR;
- fErrorHandler.getErrorHandler().handleError (error);
- }
- if (DEBUG) {
- e.printStackTrace ();
- }
- throw (LSException) DOMUtil.createLSException(LSException.PARSE_ERR, e).fillInStackTrace();
- }
- }
- Document doc = getDocument();
- dropDocumentReferences();
- return doc;
- }
-
-
- private void restoreHandlers() {
- fConfiguration.setDocumentHandler(this);
- fConfiguration.setDTDHandler(this);
- fConfiguration.setDTDContentModelHandler(this);
- }
-
- /**
- * Parse an XML document or fragment from a resource identified by an
- * <code>LSInput</code> and insert the content into an existing
- * document at the position epcified with the <code>contextNode</code>
- * and <code>action</code> arguments. When parsing the input stream the
- * context node is used for resolving unbound namespace prefixes.
- *
- * @param is The <code>LSInput</code> from which the source
- * document is to be read.
- * @param cnode The <code>Node</code> that is used as the context for
- * the data that is being parsed.
- * @param action This parameter describes which action should be taken
- * between the new set of node being inserted and the existing
- * children of the context node. The set of possible actions is
- * defined above.
- * @exception DOMException
- * HIERARCHY_REQUEST_ERR: Thrown if this action results in an invalid
- * hierarchy (i.e. a Document with more than one document element).
- */
- public Node parseWithContext (LSInput is, Node cnode,
- short action) throws DOMException, LSException {
- // REVISIT: need to implement.
- throw new DOMException (DOMException.NOT_SUPPORTED_ERR, "Not supported");
- }
-
-
- /**
- * NON-DOM: convert LSInput to XNIInputSource
- *
- * @param is
- * @return
- */
- XMLInputSource dom2xmlInputSource (LSInput is) {
- // need to wrap the LSInput with an XMLInputSource
- XMLInputSource xis = null;
- // check whether there is a Reader
- // according to DOM, we need to treat such reader as "UTF-16".
- if (is.getCharacterStream () != null) {
- xis = new XMLInputSource (is.getPublicId (), is.getSystemId (),
- is.getBaseURI (), is.getCharacterStream (),
- "UTF-16");
- }
- // check whether there is an InputStream
- else if (is.getByteStream () != null) {
- xis = new XMLInputSource (is.getPublicId (), is.getSystemId (),
- is.getBaseURI (), is.getByteStream (),
- is.getEncoding ());
- }
- // if there is a string data, use a StringReader
- // according to DOM, we need to treat such data as "UTF-16".
- else if (is.getStringData () != null && is.getStringData().length() > 0) {
- xis = new XMLInputSource (is.getPublicId (), is.getSystemId (),
- is.getBaseURI (), new StringReader (is.getStringData ()),
- "UTF-16");
- }
- // otherwise, just use the public/system/base Ids
- else if ((is.getSystemId() != null && is.getSystemId().length() > 0) ||
- (is.getPublicId() != null && is.getPublicId().length() > 0)) {
- xis = new XMLInputSource (is.getPublicId (), is.getSystemId (),
- is.getBaseURI ());
- }
- else {
- // all inputs are null
- if (fErrorHandler != null) {
- DOMErrorImpl error = new DOMErrorImpl();
- error.fType = "no-input-specified";
- error.fMessage = "no-input-specified";
- error.fSeverity = DOMError.SEVERITY_FATAL_ERROR;
- fErrorHandler.getErrorHandler().handleError(error);
- }
- throw new LSException(LSException.PARSE_ERR, "no-input-specified");
- }
- return xis;
- }
-
- /**
- * @see org.w3c.dom.ls.LSParser#getAsync()
- */
- public boolean getAsync () {
- return false;
- }
-
- /**
- * @see org.w3c.dom.ls.LSParser#getBusy()
- */
- public boolean getBusy () {
- return fBusy;
- }
-
- /**
- * @see org.w3c.dom.ls.DOMParser#abort()
- */
- public void abort () {
- // If parse operation is in progress then reset it
- if ( fBusy ) {
- fBusy = false;
- if(currentThread != null) {
- abortNow = true;
- if (abortHandler == null) {
- abortHandler = new AbortHandler();
- }
- fConfiguration.setDocumentHandler(abortHandler);
- fConfiguration.setDTDHandler(abortHandler);
- fConfiguration.setDTDContentModelHandler(abortHandler);
-
- if(currentThread == Thread.currentThread())
- throw Abort.INSTANCE;
-
- currentThread.interrupt();
- }
- }
- return; // If not busy then this is noop
- }
-
- /**
- * The start of an element. If the document specifies the start element
- * by using an empty tag, then the startElement method will immediately
- * be followed by the endElement method, with no intervening methods.
- * Overriding the parent to handle DOM_NAMESPACE_DECLARATIONS=false.
- *
- * @param element The name of the element.
- * @param attributes The element attributes.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startElement (QName element, XMLAttributes attributes, Augmentations augs) {
- // namespace declarations parameter has no effect if namespaces is false.
- if (!fNamespaceDeclarations && fNamespaceAware) {
- int len = attributes.getLength();
- for (int i = len - 1; i >= 0; --i) {
- if (XMLSymbols.PREFIX_XMLNS == attributes.getPrefix(i) ||
- XMLSymbols.PREFIX_XMLNS == attributes.getQName(i)) {
- attributes.removeAttributeAt(i);
- }
- }
- }
- super.startElement(element, attributes, augs);
- }
-
- private class AbortHandler implements XMLDocumentHandler, XMLDTDHandler, XMLDTDContentModelHandler {
-
- private XMLDocumentSource documentSource;
- private XMLDTDContentModelSource dtdContentSource;
- private XMLDTDSource dtdSource;
-
- public void startDocument(XMLLocator locator, String encoding, NamespaceContext namespaceContext, Augmentations augs) throws XNIException {
- throw Abort.INSTANCE;
- }
-
- public void xmlDecl(String version, String encoding, String standalone, Augmentations augs) throws XNIException {
- throw Abort.INSTANCE;
- }
-
- public void doctypeDecl(String rootElement, String publicId, String systemId, Augmentations augs) throws XNIException {
- throw Abort.INSTANCE;
- }
-
- public void comment(XMLString text, Augmentations augs) throws XNIException {
- throw Abort.INSTANCE;
- }
-
- public void processingInstruction(String target, XMLString data, Augmentations augs) throws XNIException {
- throw Abort.INSTANCE;
- }
-
- public void startElement(QName element, XMLAttributes attributes, Augmentations augs) throws XNIException {
- throw Abort.INSTANCE;
- }
-
- public void emptyElement(QName element, XMLAttributes attributes, Augmentations augs) throws XNIException {
- throw Abort.INSTANCE;
- }
-
- public void startGeneralEntity(String name, XMLResourceIdentifier identifier, String encoding, Augmentations augs) throws XNIException {
- throw Abort.INSTANCE;
- }
-
- public void textDecl(String version, String encoding, Augmentations augs) throws XNIException {
- throw Abort.INSTANCE;
- }
-
- public void endGeneralEntity(String name, Augmentations augs) throws XNIException {
- throw Abort.INSTANCE;
- }
-
- public void characters(XMLString text, Augmentations augs) throws XNIException {
- throw Abort.INSTANCE;
- }
-
- public void ignorableWhitespace(XMLString text, Augmentations augs) throws XNIException {
- throw Abort.INSTANCE;
- }
-
- public void endElement(QName element, Augmentations augs) throws XNIException {
- throw Abort.INSTANCE;
- }
-
- public void startCDATA(Augmentations augs) throws XNIException {
- throw Abort.INSTANCE;
- }
-
- public void endCDATA(Augmentations augs) throws XNIException {
- throw Abort.INSTANCE;
- }
-
- public void endDocument(Augmentations augs) throws XNIException {
- throw Abort.INSTANCE;
- }
-
- public void setDocumentSource(XMLDocumentSource source) {
- documentSource = source;
- }
-
- public XMLDocumentSource getDocumentSource() {
- return documentSource;
- }
-
- public void startDTD(XMLLocator locator, Augmentations augmentations) throws XNIException {
- throw Abort.INSTANCE;
- }
-
- public void startParameterEntity(String name, XMLResourceIdentifier identifier, String encoding, Augmentations augmentations) throws XNIException {
- throw Abort.INSTANCE;
- }
-
- public void endParameterEntity(String name, Augmentations augmentations) throws XNIException {
- throw Abort.INSTANCE;
- }
-
- public void startExternalSubset(XMLResourceIdentifier identifier, Augmentations augmentations) throws XNIException {
- throw Abort.INSTANCE;
- }
-
- public void endExternalSubset(Augmentations augmentations) throws XNIException {
- throw Abort.INSTANCE;
- }
-
- public void elementDecl(String name, String contentModel, Augmentations augmentations) throws XNIException {
- throw Abort.INSTANCE;
- }
-
- public void startAttlist(String elementName, Augmentations augmentations) throws XNIException {
- throw Abort.INSTANCE;
- }
-
- public void attributeDecl(String elementName, String attributeName, String type, String[] enumeration, String defaultType, XMLString defaultValue, XMLString nonNormalizedDefaultValue, Augmentations augmentations) throws XNIException {
- throw Abort.INSTANCE;
- }
-
- public void endAttlist(Augmentations augmentations) throws XNIException {
- throw Abort.INSTANCE;
- }
-
- public void internalEntityDecl(String name, XMLString text, XMLString nonNormalizedText, Augmentations augmentations) throws XNIException {
- throw Abort.INSTANCE;
- }
-
- public void externalEntityDecl(String name, XMLResourceIdentifier identifier, Augmentations augmentations) throws XNIException {
- throw Abort.INSTANCE;
- }
-
- public void unparsedEntityDecl(String name, XMLResourceIdentifier identifier, String notation, Augmentations augmentations) throws XNIException {
- throw Abort.INSTANCE;
- }
-
- public void notationDecl(String name, XMLResourceIdentifier identifier, Augmentations augmentations) throws XNIException {
- throw Abort.INSTANCE;
- }
-
- public void startConditional(short type, Augmentations augmentations) throws XNIException {
- throw Abort.INSTANCE;
- }
-
- public void ignoredCharacters(XMLString text, Augmentations augmentations) throws XNIException {
- throw Abort.INSTANCE;
- }
-
- public void endConditional(Augmentations augmentations) throws XNIException {
- throw Abort.INSTANCE;
- }
-
- public void endDTD(Augmentations augmentations) throws XNIException {
- throw Abort.INSTANCE;
- }
-
- public void setDTDSource(XMLDTDSource source) {
- dtdSource = source;
- }
-
- public XMLDTDSource getDTDSource() {
- return dtdSource;
- }
-
- public void startContentModel(String elementName, Augmentations augmentations) throws XNIException {
- throw Abort.INSTANCE;
- }
-
- public void any(Augmentations augmentations) throws XNIException {
- throw Abort.INSTANCE;
- }
-
- public void empty(Augmentations augmentations) throws XNIException {
- throw Abort.INSTANCE;
- }
-
- public void startGroup(Augmentations augmentations) throws XNIException {
- throw Abort.INSTANCE;
- }
-
- public void pcdata(Augmentations augmentations) throws XNIException {
- throw Abort.INSTANCE;
- }
-
- public void element(String elementName, Augmentations augmentations) throws XNIException {
- throw Abort.INSTANCE;
- }
-
- public void separator(short separator, Augmentations augmentations) throws XNIException {
- throw Abort.INSTANCE;
- }
-
- public void occurrence(short occurrence, Augmentations augmentations) throws XNIException {
- throw Abort.INSTANCE;
- }
-
- public void endGroup(Augmentations augmentations) throws XNIException {
- throw Abort.INSTANCE;
- }
-
- public void endContentModel(Augmentations augmentations) throws XNIException {
- throw Abort.INSTANCE;
- }
-
- public void setDTDContentModelSource(XMLDTDContentModelSource source) {
- dtdContentSource = source;
- }
-
- public XMLDTDContentModelSource getDTDContentModelSource() {
- return dtdContentSource;
- }
-
- }
-
- private static DOMException newFeatureNotFoundError(String name) {
- String msg =
- DOMMessageFormatter.formatMessage (
- DOMMessageFormatter.DOM_DOMAIN,
- "FEATURE_NOT_FOUND",
- new Object[] { name });
- return new DOMException (DOMException.NOT_FOUND_ERR, msg);
- }
-
- private static DOMException newTypeMismatchError(String name) {
- String msg =
- DOMMessageFormatter.formatMessage (
- DOMMessageFormatter.DOM_DOMAIN,
- "TYPE_MISMATCH_ERR",
- new Object[] { name });
- return new DOMException (DOMException.TYPE_MISMATCH_ERR, msg);
- }
-
-} // class DOMParserImpl
diff --git a/src/com/sun/org/apache/xerces/internal/parsers/DTDConfiguration.java b/src/com/sun/org/apache/xerces/internal/parsers/DTDConfiguration.java
deleted file mode 100644
index 0f37f7c..0000000
--- a/src/com/sun/org/apache/xerces/internal/parsers/DTDConfiguration.java
+++ /dev/null
@@ -1,883 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.parsers;
-
-import java.io.IOException;
-import java.util.Locale;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl;
-import com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl;
-import com.sun.org.apache.xerces.internal.impl.XMLEntityManager;
-import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
-import com.sun.org.apache.xerces.internal.impl.XMLNamespaceBinder;
-import com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDProcessor;
-import com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator;
-import com.sun.org.apache.xerces.internal.impl.dv.DTDDVFactory;
-import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter;
-import com.sun.org.apache.xerces.internal.impl.validation.ValidationManager;
-import com.sun.org.apache.xerces.internal.util.FeatureState;
-import com.sun.org.apache.xerces.internal.util.PropertyState;
-import com.sun.org.apache.xerces.internal.util.Status;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager;
-import com.sun.org.apache.xerces.internal.xni.XMLLocator;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponent;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDScanner;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentScanner;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLPullParserConfiguration;
-
-/**
- * This is the DTD-only parser configuration. It extends the basic
- * configuration with a standard set of parser components appropriate
- * to DTD-centric validation. Since
- * the Xerces2 reference implementation document and DTD scanner
- * implementations are capable of acting as pull parsers, this
- * configuration implements the
- * <code>XMLPullParserConfiguration</code> interface.
- * <p>
- * In addition to the features and properties recognized by the base
- * parser configuration, this class recognizes these additional
- * features and properties:
- * <ul>
- * <li>Features
- * <ul>
- * <li>http://apache.org/xml/features/validation/warn-on-duplicate-attdef</li>
- * <li>http://apache.org/xml/features/validation/warn-on-undeclared-elemdef</li>
- * <li>http://apache.org/xml/features/allow-java-encodings</li>
- * <li>http://apache.org/xml/features/continue-after-fatal-error</li>
- * <li>http://apache.org/xml/features/load-external-dtd</li>
- * </ul>
- * <li>Properties
- * <ul>
- * <li>http://apache.org/xml/properties/internal/error-reporter</li>
- * <li>http://apache.org/xml/properties/internal/entity-manager</li>
- * <li>http://apache.org/xml/properties/internal/document-scanner</li>
- * <li>http://apache.org/xml/properties/internal/dtd-scanner</li>
- * <li>http://apache.org/xml/properties/internal/grammar-pool</li>
- * <li>http://apache.org/xml/properties/internal/validator/dtd</li>
- * <li>http://apache.org/xml/properties/internal/datatype-validator-factory</li>
- * </ul>
- * </ul>
- *
- * @author Arnaud Le Hors, IBM
- * @author Andy Clark, IBM
- * @author Neil Graham, IBM
- *
- * @version $Id: DTDConfiguration.java,v 1.7 2010-11-01 04:40:09 joehw Exp $
- */
-public class DTDConfiguration
- extends BasicParserConfiguration
- implements XMLPullParserConfiguration {
-
- //
- // Constants
- //
-
- // feature identifiers
-
- /** Feature identifier: warn on duplicate attribute definition. */
- protected static final String WARN_ON_DUPLICATE_ATTDEF =
- Constants.XERCES_FEATURE_PREFIX + Constants.WARN_ON_DUPLICATE_ATTDEF_FEATURE;
-
- /** Feature identifier: warn on duplicate entity definition. */
- protected static final String WARN_ON_DUPLICATE_ENTITYDEF =
- Constants.XERCES_FEATURE_PREFIX + Constants.WARN_ON_DUPLICATE_ENTITYDEF_FEATURE;
-
- /** Feature identifier: warn on undeclared element definition. */
- protected static final String WARN_ON_UNDECLARED_ELEMDEF =
- Constants.XERCES_FEATURE_PREFIX + Constants.WARN_ON_UNDECLARED_ELEMDEF_FEATURE;
-
- /** Feature identifier: allow Java encodings. */
- protected static final String ALLOW_JAVA_ENCODINGS =
- Constants.XERCES_FEATURE_PREFIX + Constants.ALLOW_JAVA_ENCODINGS_FEATURE;
-
- /** Feature identifier: continue after fatal error. */
- protected static final String CONTINUE_AFTER_FATAL_ERROR =
- Constants.XERCES_FEATURE_PREFIX + Constants.CONTINUE_AFTER_FATAL_ERROR_FEATURE;
-
- /** Feature identifier: load external DTD. */
- protected static final String LOAD_EXTERNAL_DTD =
- Constants.XERCES_FEATURE_PREFIX + Constants.LOAD_EXTERNAL_DTD_FEATURE;
-
- /** Feature identifier: notify built-in refereces. */
- protected static final String NOTIFY_BUILTIN_REFS =
- Constants.XERCES_FEATURE_PREFIX + Constants.NOTIFY_BUILTIN_REFS_FEATURE;
-
- /** Feature identifier: notify character refereces. */
- protected static final String NOTIFY_CHAR_REFS =
- Constants.XERCES_FEATURE_PREFIX + Constants.NOTIFY_CHAR_REFS_FEATURE;
-
-
- // property identifiers
-
- /** Property identifier: error reporter. */
- protected static final String ERROR_REPORTER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY;
-
- /** Property identifier: entity manager. */
- protected static final String ENTITY_MANAGER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_MANAGER_PROPERTY;
-
- /** Property identifier document scanner: */
- protected static final String DOCUMENT_SCANNER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.DOCUMENT_SCANNER_PROPERTY;
-
- /** Property identifier: DTD scanner. */
- protected static final String DTD_SCANNER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.DTD_SCANNER_PROPERTY;
-
- /** Property identifier: grammar pool. */
- protected static final String XMLGRAMMAR_POOL =
- Constants.XERCES_PROPERTY_PREFIX + Constants.XMLGRAMMAR_POOL_PROPERTY;
-
- /** Property identifier: DTD loader. */
- protected static final String DTD_PROCESSOR =
- Constants.XERCES_PROPERTY_PREFIX + Constants.DTD_PROCESSOR_PROPERTY;
-
- /** Property identifier: DTD validator. */
- protected static final String DTD_VALIDATOR =
- Constants.XERCES_PROPERTY_PREFIX + Constants.DTD_VALIDATOR_PROPERTY;
-
- /** Property identifier: namespace binder. */
- protected static final String NAMESPACE_BINDER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.NAMESPACE_BINDER_PROPERTY;
-
- /** Property identifier: datatype validator factory. */
- protected static final String DATATYPE_VALIDATOR_FACTORY =
- Constants.XERCES_PROPERTY_PREFIX + Constants.DATATYPE_VALIDATOR_FACTORY_PROPERTY;
-
- protected static final String VALIDATION_MANAGER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.VALIDATION_MANAGER_PROPERTY;
-
- /** Property identifier: JAXP schema language / DOM schema-type. */
- protected static final String JAXP_SCHEMA_LANGUAGE =
- Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_LANGUAGE;
-
- /** Property identifier: JAXP schema source/ DOM schema-location. */
- protected static final String JAXP_SCHEMA_SOURCE =
- Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_SOURCE;
-
- /** Property identifier: locale. */
- protected static final String LOCALE =
- Constants.XERCES_PROPERTY_PREFIX + Constants.LOCALE_PROPERTY;
-
- /** Property identifier: Security property manager. */
- protected static final String XML_SECURITY_PROPERTY_MANAGER =
- Constants.XML_SECURITY_PROPERTY_MANAGER;
-
- /** Property identifier: Security manager. */
- private static final String SECURITY_MANAGER = Constants.SECURITY_MANAGER;
-
- // debugging
-
- /** Set to true and recompile to print exception stack trace. */
- protected static final boolean PRINT_EXCEPTION_STACK_TRACE = false;
-
- //
- // Data
- //
-
- // components (non-configurable)
-
- /** Grammar pool. */
- protected XMLGrammarPool fGrammarPool;
-
- /** Datatype validator factory. */
- protected DTDDVFactory fDatatypeValidatorFactory;
-
- // components (configurable)
-
- /** Error reporter. */
- protected XMLErrorReporter fErrorReporter;
-
- /** Entity manager. */
- protected XMLEntityManager fEntityManager;
-
- /** Document scanner. */
- protected XMLDocumentScanner fScanner;
-
- /** Input Source */
- protected XMLInputSource fInputSource;
-
- /** DTD scanner. */
- protected XMLDTDScanner fDTDScanner;
-
- /** DTD Processor . */
- protected XMLDTDProcessor fDTDProcessor;
-
- /** DTD Validator. */
- protected XMLDTDValidator fDTDValidator;
-
- /** Namespace binder. */
- protected XMLNamespaceBinder fNamespaceBinder;
-
- protected ValidationManager fValidationManager;
- // state
-
- /** Locator */
- protected XMLLocator fLocator;
-
- /**
- * True if a parse is in progress. This state is needed because
- * some features/properties cannot be set while parsing (e.g.
- * validation and namespaces).
- */
- protected boolean fParseInProgress = false;
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- public DTDConfiguration() {
- this(null, null, null);
- } // <init>()
-
- /**
- * Constructs a parser configuration using the specified symbol table.
- *
- * @param symbolTable The symbol table to use.
- */
- public DTDConfiguration(SymbolTable symbolTable) {
- this(symbolTable, null, null);
- } // <init>(SymbolTable)
-
- /**
- * Constructs a parser configuration using the specified symbol table and
- * grammar pool.
- * <p>
- * <strong>REVISIT:</strong>
- * Grammar pool will be updated when the new validation engine is
- * implemented.
- *
- * @param symbolTable The symbol table to use.
- * @param grammarPool The grammar pool to use.
- */
- public DTDConfiguration(SymbolTable symbolTable,
- XMLGrammarPool grammarPool) {
- this(symbolTable, grammarPool, null);
- } // <init>(SymbolTable,XMLGrammarPool)
-
- /**
- * Constructs a parser configuration using the specified symbol table,
- * grammar pool, and parent settings.
- * <p>
- * <strong>REVISIT:</strong>
- * Grammar pool will be updated when the new validation engine is
- * implemented.
- *
- * @param symbolTable The symbol table to use.
- * @param grammarPool The grammar pool to use.
- * @param parentSettings The parent settings.
- */
- public DTDConfiguration(SymbolTable symbolTable,
- XMLGrammarPool grammarPool,
- XMLComponentManager parentSettings) {
- super(symbolTable, parentSettings);
-
- // add default recognized features
- final String[] recognizedFeatures = {
- //WARN_ON_DUPLICATE_ATTDEF, // from XMLDTDScannerImpl
- //WARN_ON_UNDECLARED_ELEMDEF, // from XMLDTDScannerImpl
- //ALLOW_JAVA_ENCODINGS, // from XMLEntityManager
- CONTINUE_AFTER_FATAL_ERROR,
- LOAD_EXTERNAL_DTD, // from XMLDTDScannerImpl
- //NOTIFY_BUILTIN_REFS, // from XMLDocumentFragmentScannerImpl
- //NOTIFY_CHAR_REFS, // from XMLDocumentFragmentScannerImpl
- //WARN_ON_DUPLICATE_ENTITYDEF, // from XMLEntityManager
- };
- addRecognizedFeatures(recognizedFeatures);
-
- // set state for default features
- //setFeature(WARN_ON_DUPLICATE_ATTDEF, false); // from XMLDTDScannerImpl
- //setFeature(WARN_ON_UNDECLARED_ELEMDEF, false); // from XMLDTDScannerImpl
- //setFeature(ALLOW_JAVA_ENCODINGS, false); // from XMLEntityManager
- setFeature(CONTINUE_AFTER_FATAL_ERROR, false);
- setFeature(LOAD_EXTERNAL_DTD, true); // from XMLDTDScannerImpl
- //setFeature(NOTIFY_BUILTIN_REFS, false); // from XMLDocumentFragmentScannerImpl
- //setFeature(NOTIFY_CHAR_REFS, false); // from XMLDocumentFragmentScannerImpl
- //setFeature(WARN_ON_DUPLICATE_ENTITYDEF, false); // from XMLEntityManager
-
- // add default recognized properties
- final String[] recognizedProperties = {
- ERROR_REPORTER,
- ENTITY_MANAGER,
- DOCUMENT_SCANNER,
- DTD_SCANNER,
- DTD_PROCESSOR,
- DTD_VALIDATOR,
- NAMESPACE_BINDER,
- XMLGRAMMAR_POOL,
- DATATYPE_VALIDATOR_FACTORY,
- VALIDATION_MANAGER,
- JAXP_SCHEMA_SOURCE,
- JAXP_SCHEMA_LANGUAGE,
- LOCALE,
- SECURITY_MANAGER,
- XML_SECURITY_PROPERTY_MANAGER
- };
- addRecognizedProperties(recognizedProperties);
-
- fGrammarPool = grammarPool;
- if(fGrammarPool != null){
- setProperty(XMLGRAMMAR_POOL, fGrammarPool);
- }
-
- fEntityManager = createEntityManager();
- setProperty(ENTITY_MANAGER, fEntityManager);
- addComponent(fEntityManager);
-
- fErrorReporter = createErrorReporter();
- fErrorReporter.setDocumentLocator(fEntityManager.getEntityScanner());
- setProperty(ERROR_REPORTER, fErrorReporter);
- addComponent(fErrorReporter);
-
- fScanner = createDocumentScanner();
- setProperty(DOCUMENT_SCANNER, fScanner);
- if (fScanner instanceof XMLComponent) {
- addComponent((XMLComponent)fScanner);
- }
-
- fDTDScanner = createDTDScanner();
- if (fDTDScanner != null) {
- setProperty(DTD_SCANNER, fDTDScanner);
- if (fDTDScanner instanceof XMLComponent) {
- addComponent((XMLComponent)fDTDScanner);
- }
- }
-
- fDTDProcessor = createDTDProcessor();
- if (fDTDProcessor != null) {
- setProperty(DTD_PROCESSOR, fDTDProcessor);
- if (fDTDProcessor instanceof XMLComponent) {
- addComponent((XMLComponent)fDTDProcessor);
- }
- }
-
- fDTDValidator = createDTDValidator();
- if (fDTDValidator != null) {
- setProperty(DTD_VALIDATOR, fDTDValidator);
- addComponent(fDTDValidator);
- }
-
- fNamespaceBinder = createNamespaceBinder();
- if (fNamespaceBinder != null) {
- setProperty(NAMESPACE_BINDER, fNamespaceBinder);
- addComponent(fNamespaceBinder);
- }
-
- fDatatypeValidatorFactory = createDatatypeValidatorFactory();
- if (fDatatypeValidatorFactory != null) {
- setProperty(DATATYPE_VALIDATOR_FACTORY,
- fDatatypeValidatorFactory);
- }
- fValidationManager = createValidationManager();
-
- if (fValidationManager != null) {
- setProperty (VALIDATION_MANAGER, fValidationManager);
- }
- // add message formatters
- if (fErrorReporter.getMessageFormatter(XMLMessageFormatter.XML_DOMAIN) == null) {
- XMLMessageFormatter xmft = new XMLMessageFormatter();
- fErrorReporter.putMessageFormatter(XMLMessageFormatter.XML_DOMAIN, xmft);
- fErrorReporter.putMessageFormatter(XMLMessageFormatter.XMLNS_DOMAIN, xmft);
- }
-
- // set locale
- try {
- setLocale(Locale.getDefault());
- }
- catch (XNIException e) {
- // do nothing
- // REVISIT: What is the right thing to do? -Ac
- }
-
- setProperty(XML_SECURITY_PROPERTY_MANAGER, new XMLSecurityPropertyManager());
- } // <init>(SymbolTable,XMLGrammarPool)
-
- //
- // Public methods
- //
-
- public PropertyState getPropertyState(String propertyId)
- throws XMLConfigurationException {
- if (LOCALE.equals(propertyId)) {
- return PropertyState.is(getLocale());
- }
- return super.getPropertyState(propertyId);
- }
-
- public void setProperty(String propertyId, Object value)
- throws XMLConfigurationException {
- if (LOCALE.equals(propertyId)) {
- setLocale((Locale) value);
- }
- super.setProperty(propertyId, value);
- }
-
- /**
- * Set the locale to use for messages.
- *
- * @param locale The locale object to use for localization of messages.
- *
- * @exception XNIException Thrown if the parser does not support the
- * specified locale.
- */
- public void setLocale(Locale locale) throws XNIException {
- super.setLocale(locale);
- fErrorReporter.setLocale(locale);
- } // setLocale(Locale)
-
- //
- // XMLPullParserConfiguration methods
- //
-
- // parsing
-
- /**
- * Sets the input source for the document to parse.
- *
- * @param inputSource The document's input source.
- *
- * @exception XMLConfigurationException Thrown if there is a
- * configuration error when initializing the
- * parser.
- * @exception IOException Thrown on I/O error.
- *
- * @see #parse(boolean)
- */
- public void setInputSource(XMLInputSource inputSource)
- throws XMLConfigurationException, IOException {
-
- // REVISIT: this method used to reset all the components and
- // construct the pipeline. Now reset() is called
- // in parse (boolean) just before we parse the document
- // Should this method still throw exceptions..?
-
- fInputSource = inputSource;
-
- } // setInputSource(XMLInputSource)
-
- /**
- * Parses the document in a pull parsing fashion.
- *
- * @param complete True if the pull parser should parse the
- * remaining document completely.
- *
- * @return True if there is more document to parse.
- *
- * @exception XNIException Any XNI exception, possibly wrapping
- * another exception.
- * @exception IOException An IO exception from the parser, possibly
- * from a byte stream or character stream
- * supplied by the parser.
- *
- * @see #setInputSource
- */
- public boolean parse(boolean complete) throws XNIException, IOException {
- //
- // reset and configure pipeline and set InputSource.
- if (fInputSource !=null) {
- try {
- // resets and sets the pipeline.
- reset();
- fScanner.setInputSource(fInputSource);
- fInputSource = null;
- }
- catch (XNIException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- }
- catch (IOException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- }
- catch (RuntimeException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- }
- catch (Exception ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw new XNIException(ex);
- }
- }
-
- try {
- return fScanner.scanDocument(complete);
- }
- catch (XNIException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- }
- catch (IOException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- }
- catch (RuntimeException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- }
- catch (Exception ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw new XNIException(ex);
- }
-
- } // parse(boolean):boolean
-
- /**
- * If the application decides to terminate parsing before the xml document
- * is fully parsed, the application should call this method to free any
- * resource allocated during parsing. For example, close all opened streams.
- */
- public void cleanup() {
- fEntityManager.closeReaders();
- }
-
- //
- // XMLParserConfiguration methods
- //
-
- /**
- * Parses the specified input source.
- *
- * @param source The input source.
- *
- * @exception XNIException Throws exception on XNI error.
- * @exception java.io.IOException Throws exception on i/o error.
- */
- public void parse(XMLInputSource source) throws XNIException, IOException {
-
- if (fParseInProgress) {
- // REVISIT - need to add new error message
- throw new XNIException("FWK005 parse may not be called while parsing.");
- }
- fParseInProgress = true;
-
- try {
- setInputSource(source);
- parse(true);
- }
- catch (XNIException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- }
- catch (IOException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- }
- catch (RuntimeException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- }
- catch (Exception ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw new XNIException(ex);
- }
- finally {
- fParseInProgress = false;
- // close all streams opened by xerces
- this.cleanup();
- }
-
- } // parse(InputSource)
-
- //
- // Protected methods
- //
-
- /**
- * Reset all components before parsing.
- *
- * @throws XNIException Thrown if an error occurs during initialization.
- */
- protected void reset() throws XNIException {
-
- if (fValidationManager != null)
- fValidationManager.reset();
- // configure the pipeline and initialize the components
- configurePipeline();
- super.reset();
- } // reset()
-
- /** Configures the pipeline. */
- protected void configurePipeline() {
-
- // REVISIT: This should be better designed. In other words, we
- // need to figure out what is the best way for people to
- // re-use *most* of the standard configuration but do
- // things common things such as remove a component (e.g.
- // the validator), insert a new component (e.g. XInclude),
- // etc... -Ac
-
- // setup document pipeline
- if (fDTDValidator != null) {
- fScanner.setDocumentHandler(fDTDValidator);
- if (fFeatures.get(NAMESPACES) == Boolean.TRUE) {
-
- // filters
- fDTDValidator.setDocumentHandler(fNamespaceBinder);
- fDTDValidator.setDocumentSource(fScanner);
- fNamespaceBinder.setDocumentHandler(fDocumentHandler);
- fNamespaceBinder.setDocumentSource(fDTDValidator);
- fLastComponent = fNamespaceBinder;
- }
- else {
- fDTDValidator.setDocumentHandler(fDocumentHandler);
- fDTDValidator.setDocumentSource(fScanner);
- fLastComponent = fDTDValidator;
- }
- }
- else {
- if (fFeatures.get(NAMESPACES) == Boolean.TRUE) {
- fScanner.setDocumentHandler(fNamespaceBinder);
- fNamespaceBinder.setDocumentHandler(fDocumentHandler);
- fNamespaceBinder.setDocumentSource(fScanner);
- fLastComponent = fNamespaceBinder;
- }
- else {
- fScanner.setDocumentHandler(fDocumentHandler);
- fLastComponent = fScanner;
- }
- }
-
- configureDTDPipeline();
- } // configurePipeline()
-
- protected void configureDTDPipeline (){
-
- // setup dtd pipeline
- if (fDTDScanner != null) {
- fProperties.put(DTD_SCANNER, fDTDScanner);
- if (fDTDProcessor != null) {
- fProperties.put(DTD_PROCESSOR, fDTDProcessor);
- fDTDScanner.setDTDHandler(fDTDProcessor);
- fDTDProcessor.setDTDSource(fDTDScanner);
- fDTDProcessor.setDTDHandler(fDTDHandler);
- if (fDTDHandler != null) {
- fDTDHandler.setDTDSource(fDTDProcessor);
- }
-
- fDTDScanner.setDTDContentModelHandler(fDTDProcessor);
- fDTDProcessor.setDTDContentModelSource(fDTDScanner);
- fDTDProcessor.setDTDContentModelHandler(fDTDContentModelHandler);
- if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.setDTDContentModelSource(fDTDProcessor);
- }
- }
- else {
- fDTDScanner.setDTDHandler(fDTDHandler);
- if (fDTDHandler != null) {
- fDTDHandler.setDTDSource(fDTDScanner);
- }
- fDTDScanner.setDTDContentModelHandler(fDTDContentModelHandler);
- if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.setDTDContentModelSource(fDTDScanner);
- }
- }
- }
-
-
- }
-
- // features and properties
-
- /**
- * Check a feature. If feature is know and supported, this method simply
- * returns. Otherwise, the appropriate exception is thrown.
- *
- * @param featureId The unique identifier (URI) of the feature.
- *
- * @throws XMLConfigurationException Thrown for configuration error.
- * In general, components should
- * only throw this exception if
- * it is <strong>really</strong>
- * a critical error.
- */
- protected FeatureState checkFeature(String featureId)
- throws XMLConfigurationException {
-
- //
- // Xerces Features
- //
-
- if (featureId.startsWith(Constants.XERCES_FEATURE_PREFIX)) {
- final int suffixLength = featureId.length() - Constants.XERCES_FEATURE_PREFIX.length();
-
- //
- // http://apache.org/xml/features/validation/dynamic
- // Allows the parser to validate a document only when it
- // contains a grammar. Validation is turned on/off based
- // on each document instance, automatically.
- //
- if (suffixLength == Constants.DYNAMIC_VALIDATION_FEATURE.length() &&
- featureId.endsWith(Constants.DYNAMIC_VALIDATION_FEATURE)) {
- return FeatureState.RECOGNIZED;
- }
-
- //
- // http://apache.org/xml/features/validation/default-attribute-values
- //
- if (suffixLength == Constants.DEFAULT_ATTRIBUTE_VALUES_FEATURE.length() &&
- featureId.endsWith(Constants.DEFAULT_ATTRIBUTE_VALUES_FEATURE)) {
- // REVISIT
- return FeatureState.NOT_SUPPORTED;
- }
- //
- // http://apache.org/xml/features/validation/default-attribute-values
- //
- if (suffixLength == Constants.VALIDATE_CONTENT_MODELS_FEATURE.length() &&
- featureId.endsWith(Constants.VALIDATE_CONTENT_MODELS_FEATURE)) {
- // REVISIT
- return FeatureState.NOT_SUPPORTED;
- }
- //
- // http://apache.org/xml/features/validation/nonvalidating/load-dtd-grammar
- //
- if (suffixLength == Constants.LOAD_DTD_GRAMMAR_FEATURE.length() &&
- featureId.endsWith(Constants.LOAD_DTD_GRAMMAR_FEATURE)) {
- return FeatureState.RECOGNIZED;
- }
- //
- // http://apache.org/xml/features/validation/nonvalidating/load-external-dtd
- //
- if (suffixLength == Constants.LOAD_EXTERNAL_DTD_FEATURE.length() &&
- featureId.endsWith(Constants.LOAD_EXTERNAL_DTD_FEATURE)) {
- return FeatureState.RECOGNIZED;
- }
-
- //
- // http://apache.org/xml/features/validation/default-attribute-values
- //
- if (suffixLength == Constants.VALIDATE_DATATYPES_FEATURE.length() &&
- featureId.endsWith(Constants.VALIDATE_DATATYPES_FEATURE)) {
- return FeatureState.NOT_SUPPORTED;
- }
- }
-
- //
- // Not recognized
- //
-
- return super.checkFeature(featureId);
-
- } // checkFeature(String)
-
- /**
- * Check a property. If the property is know and supported, this method
- * simply returns. Otherwise, the appropriate exception is thrown.
- *
- * @param propertyId The unique identifier (URI) of the property
- * being set.
- *
- * @throws XMLConfigurationException Thrown for configuration error.
- * In general, components should
- * only throw this exception if
- * it is <strong>really</strong>
- * a critical error.
- */
- protected PropertyState checkProperty(String propertyId)
- throws XMLConfigurationException {
-
- //
- // Xerces Properties
- //
-
- if (propertyId.startsWith(Constants.XERCES_PROPERTY_PREFIX)) {
- final int suffixLength = propertyId.length() - Constants.XERCES_PROPERTY_PREFIX.length();
-
- if (suffixLength == Constants.DTD_SCANNER_PROPERTY.length() &&
- propertyId.endsWith(Constants.DTD_SCANNER_PROPERTY)) {
- return PropertyState.RECOGNIZED;
- }
- }
-
- //
- // Not recognized
- //
-
- return super.checkProperty(propertyId);
-
- } // checkProperty(String)
-
- // factory methods
-
- /** Creates an entity manager. */
- protected XMLEntityManager createEntityManager() {
- return new XMLEntityManager();
- } // createEntityManager():XMLEntityManager
-
- /** Creates an error reporter. */
- protected XMLErrorReporter createErrorReporter() {
- return new XMLErrorReporter();
- } // createErrorReporter():XMLErrorReporter
-
- /** Create a document scanner. */
- protected XMLDocumentScanner createDocumentScanner() {
- return new XMLDocumentScannerImpl();
- } // createDocumentScanner():XMLDocumentScanner
-
- /** Create a DTD scanner. */
- protected XMLDTDScanner createDTDScanner() {
- return new XMLDTDScannerImpl();
- } // createDTDScanner():XMLDTDScanner
-
- /** Create a DTD loader . */
- protected XMLDTDProcessor createDTDProcessor() {
- return new XMLDTDProcessor();
- } // createDTDProcessor():XMLDTDProcessor
-
- /** Create a DTD validator. */
- protected XMLDTDValidator createDTDValidator() {
- return new XMLDTDValidator();
- } // createDTDValidator():XMLDTDValidator
-
- /** Create a namespace binder. */
- protected XMLNamespaceBinder createNamespaceBinder() {
- return new XMLNamespaceBinder();
- } // createNamespaceBinder():XMLNamespaceBinder
-
- /** Create a datatype validator factory. */
- protected DTDDVFactory createDatatypeValidatorFactory() {
- return DTDDVFactory.getInstance();
- } // createDatatypeValidatorFactory():DatatypeValidatorFactory
- protected ValidationManager createValidationManager(){
- return new ValidationManager();
- }
-
-} // class DTDConfiguration
diff --git a/src/com/sun/org/apache/xerces/internal/parsers/DTDParser.java b/src/com/sun/org/apache/xerces/internal/parsers/DTDParser.java
deleted file mode 100644
index 3c7624c..0000000
--- a/src/com/sun/org/apache/xerces/internal/parsers/DTDParser.java
+++ /dev/null
@@ -1,481 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.parsers;
-
-import com.sun.org.apache.xerces.internal.impl.dtd.DTDGrammar;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-
-import com.sun.org.apache.xerces.internal.xni.Augmentations;
-import com.sun.org.apache.xerces.internal.xni.XMLString;
-import com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLDTDHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLLocator;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDScanner;
-import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
-
-/**
- */
-public abstract class DTDParser
- extends XMLGrammarParser
- implements XMLDTDHandler, XMLDTDContentModelHandler {
-
- //
- // Data
- //
-
- /** fDTDScanner */
- protected XMLDTDScanner fDTDScanner;
-
- //
- // Constructors
- //
-
- /**
- *
- *
- * @param symbolTable
- */
- public DTDParser(SymbolTable symbolTable) {
- super(symbolTable);
- }
-
- //
- // Methods
- //
-
- /**
- * getDTDGrammar
- *
- * @return the grammar created by this parser
- */
- public DTDGrammar getDTDGrammar() {
- return null;
- } // getDTDGrammar
-
- //
- // XMLDTDHandler methods
- //
-
- /**
- * This method notifies of the start of an entity. The DTD has the
- * pseudo-name of "[dtd]" and parameter entity names start with '%'.
- * <p>
- * <strong>Note:</strong> Since the DTD is an entity, the handler
- * will be notified of the start of the DTD entity by calling the
- * startEntity method with the entity name "[dtd]" <em>before</em> calling
- * the startDTD method.
- *
- * @param name The name of the entity.
- * @param publicId The public identifier of the entity if the entity
- * is external, null otherwise.
- * @param systemId The system identifier of the entity if the entity
- * is external, null otherwise.
- * @param encoding The auto-detected IANA encoding name of the entity
- * stream. This value will be null in those situations
- * where the entity encoding is not auto-detected (e.g.
- * internal parameter entities).
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startEntity(String name, String publicId, String systemId,
- String encoding) throws XNIException {
- }
-
- /**
- * Notifies of the presence of a TextDecl line in an entity. If present,
- * this method will be called immediately following the startEntity call.
- * <p>
- * <strong>Note:</strong> This method is only called for external
- * parameter entities referenced in the DTD.
- *
- * @param version The XML version, or null if not specified.
- * @param encoding The IANA encoding name of the entity.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void textDecl(String version, String encoding) throws XNIException {
- }
-
- /**
- * The start of the DTD.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startDTD(XMLLocator locator, Augmentations augmentations)
- throws XNIException {
- }
-
- /**
- * A comment.
- *
- * @param text The text in the comment.
- *
- * @throws XNIException Thrown by application to signal an error.
- */
- public void comment(XMLString text, Augmentations augmentations) throws XNIException {
- } // comment
-
- /**
- * A processing instruction. Processing instructions consist of a
- * target name and, optionally, text data. The data is only meaningful
- * to the application.
- * <p>
- * Typically, a processing instruction's data will contain a series
- * of pseudo-attributes. These pseudo-attributes follow the form of
- * element attributes but are <strong>not</strong> parsed or presented
- * to the application as anything other than text. The application is
- * responsible for parsing the data.
- *
- * @param target The target.
- * @param data The data or null if none specified.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void processingInstruction(String target, XMLString data,
- Augmentations augmentations)
- throws XNIException {
- } // processingInstruction
-
- /**
- * The start of the external subset.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startExternalSubset(XMLResourceIdentifier identifier,
- Augmentations augmentations) throws XNIException {
- } // startExternalSubset
-
- /**
- * The end of the external subset.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endExternalSubset(Augmentations augmentations) throws XNIException {
- } // endExternalSubset
-
- /**
- * An element declaration.
- *
- * @param name The name of the element.
- * @param contentModel The element content model.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void elementDecl(String name, String contentModel,
- Augmentations augmentations)
- throws XNIException {
- } // elementDecl
-
- /**
- * The start of an attribute list.
- *
- * @param elementName The name of the element that this attribute
- * list is associated with.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startAttlist(String elementName,
- Augmentations augmentations) throws XNIException {
- } // startAttlist
-
- /**
- * An attribute declaration.
- *
- * @param elementName The name of the element that this attribute
- * is associated with.
- * @param attributeName The name of the attribute.
- * @param type The attribute type. This value will be one of
- * the following: "CDATA", "ENTITY", "ENTITIES",
- * "ENUMERATION", "ID", "IDREF", "IDREFS",
- * "NMTOKEN", "NMTOKENS", or "NOTATION".
- * @param enumeration If the type has the value "ENUMERATION", this
- * array holds the allowed attribute values;
- * otherwise, this array is null.
- * @param defaultType The attribute default type. This value will be
- * one of the following: "#FIXED", "#IMPLIED",
- * "#REQUIRED", or null.
- * @param defaultValue The attribute default value, or null if no
- * default value is specified.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void attributeDecl(String elementName, String attributeName,
- String type, String[] enumeration,
- String defaultType, XMLString defaultValue,
- XMLString nonNormalizedDefaultValue, Augmentations augmentations)
- throws XNIException {
- } // attributeDecl
-
- /**
- * The end of an attribute list.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endAttlist(Augmentations augmentations) throws XNIException {
- } // endAttlist
-
- /**
- * An internal entity declaration.
- *
- * @param name The name of the entity. Parameter entity names start with
- * '%', whereas the name of a general entity is just the
- * entity name.
- * @param text The value of the entity.
- * @param nonNormalizedText The non-normalized value of the entity. This
- * value contains the same sequence of characters that was in
- * the internal entity declaration, without any entity
- * references expanded.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void internalEntityDecl(String name, XMLString text,
- XMLString nonNormalizedText,
- Augmentations augmentations)
- throws XNIException {
- } // internalEntityDecl(String,XMLString,XMLString)
-
- /**
- * An external entity declaration.
- *
- * @param name The name of the entity. Parameter entity names start
- * with '%', whereas the name of a general entity is just
- * the entity name.
- * @param identifier An object containing all location information
- * pertinent to this entity.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void externalEntityDecl(String name,
- XMLResourceIdentifier identifier,
- Augmentations augmentations)
- throws XNIException {
- } // externalEntityDecl
-
- /**
- * An unparsed entity declaration.
- *
- * @param name The name of the entity.
- * @param identifier An object containing all location information
- * pertinent to this entity.
- * @param notation The name of the notation.
- *
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void unparsedEntityDecl(String name,
- XMLResourceIdentifier identifier,
- String notation, Augmentations augmentations)
- throws XNIException {
- } // unparsedEntityDecl
-
- /**
- * A notation declaration
- *
- * @param name The name of the notation.
- * @param identifier An object containing all location information
- * pertinent to this notation.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void notationDecl(String name, XMLResourceIdentifier identifier,
- Augmentations augmentations)
- throws XNIException {
- } // notationDecl
-
- /**
- * The start of a conditional section.
- *
- * @param type The type of the conditional section. This value will
- * either be CONDITIONAL_INCLUDE or CONDITIONAL_IGNORE.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see XMLDTDHandler#CONDITIONAL_INCLUDE
- * @see XMLDTDHandler#CONDITIONAL_IGNORE
- */
- public void startConditional(short type, Augmentations augmentations) throws XNIException {
- } // startConditional
-
- /**
- * The end of a conditional section.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endConditional(Augmentations augmentations) throws XNIException {
- } // endConditional
-
- /**
- * The end of the DTD.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endDTD(Augmentations augmentations) throws XNIException {
- } // endDTD
-
- /**
- * This method notifies the end of an entity. The DTD has the pseudo-name
- * of "[dtd]" and parameter entity names start with '%'.
- * <p>
- * <strong>Note:</strong> Since the DTD is an entity, the handler
- * will be notified of the end of the DTD entity by calling the
- * endEntity method with the entity name "[dtd]" <em>after</em> calling
- * the endDTD method.
- *
- * @param name The name of the entity.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endEntity(String name, Augmentations augmentations) throws XNIException {
- }
-
- //
- // XMLDTDContentModelHandler methods
- //
-
- /**
- * The start of a content model. Depending on the type of the content
- * model, specific methods may be called between the call to the
- * startContentModel method and the call to the endContentModel method.
- *
- * @param elementName The name of the element.
- * @param type The content model type.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see com.sun.org.apache.xerces.internal.impl.dtd.XMLElementDecl#TYPE_EMPTY
- * @see com.sun.org.apache.xerces.internal.impl.dtd.XMLElementDecl#TYPE_ANY
- * @see com.sun.org.apache.xerces.internal.impl.dtd.XMLElementDecl#TYPE_MIXED
- * @see com.sun.org.apache.xerces.internal.impl.dtd.XMLElementDecl#TYPE_CHILDREN
- */
- public void startContentModel(String elementName, short type)
- throws XNIException {
- } // startContentModel
-
- /**
- * A referenced element in a mixed content model. If the mixed content
- * model only allows text content, then this method will not be called
- * for that model. However, if this method is called for a mixed
- * content model, then the zero or more occurrence count is implied.
- * <p>
- * <strong>Note:</strong> This method is only called after a call to
- * the startContentModel method where the type is TYPE_MIXED.
- *
- * @param elementName The name of the referenced element.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see com.sun.org.apache.xerces.internal.impl.dtd.XMLElementDecl#TYPE_MIXED
- */
- public void mixedElement(String elementName) throws XNIException {
- } // mixedElement
-
- /**
- * The start of a children group.
- * <p>
- * <strong>Note:</strong> This method is only called after a call to
- * the startContentModel method where the type is TYPE_CHILDREN.
- * <p>
- * <strong>Note:</strong> Children groups can be nested and have
- * associated occurrence counts.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see com.sun.org.apache.xerces.internal.impl.dtd.XMLElementDecl#TYPE_CHILDREN
- */
- public void childrenStartGroup() throws XNIException {
- } // childrenStartGroup
-
- /**
- * A referenced element in a children content model.
- *
- * @param elementName The name of the referenced element.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see com.sun.org.apache.xerces.internal.impl.dtd.XMLElementDecl#TYPE_CHILDREN
- */
- public void childrenElement(String elementName) throws XNIException {
- } // childrenElement
-
- /**
- * The separator between choices or sequences of a children content
- * model.
- * <p>
- * <strong>Note:</strong> This method is only called after a call to
- * the startContentModel method where the type is TYPE_CHILDREN.
- *
- * @param separator The type of children separator.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see XMLDTDContentModelHandler#SEPARATOR_CHOICE
- * @see XMLDTDContentModelHandler#SEPARATOR_SEQUENCE
- * @see com.sun.org.apache.xerces.internal.impl.dtd.XMLElementDecl#TYPE_CHILDREN
- */
- public void childrenSeparator(short separator) throws XNIException {
- } // childrenSeparator
-
- /**
- * The occurrence count for a child in a children content model.
- * <p>
- * <strong>Note:</strong> This method is only called after a call to
- * the startContentModel method where the type is TYPE_CHILDREN.
- *
- * @param occurrence The occurrence count for the last children element
- * or children group.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see XMLDTDContentModelHandler#OCCURS_ZERO_OR_ONE
- * @see XMLDTDContentModelHandler#OCCURS_ZERO_OR_MORE
- * @see XMLDTDContentModelHandler#OCCURS_ONE_OR_MORE
- * @see com.sun.org.apache.xerces.internal.impl.dtd.XMLElementDecl#TYPE_CHILDREN
- */
- public void childrenOccurrence(short occurrence) throws XNIException {
- } // childrenOccurrence
-
- /**
- * The end of a children group.
- * <p>
- * <strong>Note:</strong> This method is only called after a call to
- * the startContentModel method where the type is TYPE_CHILDREN.
- *
- * @see com.sun.org.apache.xerces.internal.impl.dtd.XMLElementDecl#TYPE_CHILDREN
- */
- public void childrenEndGroup() throws XNIException {
- } // childrenEndGroup
-
- /**
- * The end of a content model.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endContentModel() throws XNIException {
- } // endContentModel
-
-} // class DTDParser
diff --git a/src/com/sun/org/apache/xerces/internal/parsers/IntegratedParserConfiguration.java b/src/com/sun/org/apache/xerces/internal/parsers/IntegratedParserConfiguration.java
deleted file mode 100644
index f90598c..0000000
--- a/src/com/sun/org/apache/xerces/internal/parsers/IntegratedParserConfiguration.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.parsers;
-
-import com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl;
-import com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl;
-import com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator;
-import com.sun.org.apache.xerces.internal.impl.dtd.XMLNSDTDValidator;
-import com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator;
-import com.sun.org.apache.xerces.internal.impl.xs.XSMessageFormatter;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponent;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentScanner;
-
-/**
- * This is configuration uses a scanner that integrates both scanning of the document
- * and binding namespaces.
- *
- * If namespace feature is turned on, the pipeline is constructured with the
- * following components:
- * XMLNSDocumentScannerImpl -> XMLNSDTDValidator -> (optional) XMLSchemaValidator
- *
- * If the namespace feature is turned off the default document scanner implementation
- * is used (XMLDocumentScannerImpl).
- * <p>
- * In addition to the features and properties recognized by the base
- * parser configuration, this class recognizes these additional
- * features and properties:
- * <ul>
- * <li>Features
- * <ul>
- * <li>http://apache.org/xml/features/validation/schema</li>
- * <li>http://apache.org/xml/features/validation/schema-full-checking</li>
- * <li>http://apache.org/xml/features/validation/schema/normalized-value</li>
- * <li>http://apache.org/xml/features/validation/schema/element-default</li>
- * </ul>
- * <li>Properties
- * <ul>
- * <li>http://apache.org/xml/properties/internal/error-reporter</li>
- * <li>http://apache.org/xml/properties/internal/entity-manager</li>
- * <li>http://apache.org/xml/properties/internal/document-scanner</li>
- * <li>http://apache.org/xml/properties/internal/dtd-scanner</li>
- * <li>http://apache.org/xml/properties/internal/grammar-pool</li>
- * <li>http://apache.org/xml/properties/internal/validator/dtd</li>
- * <li>http://apache.org/xml/properties/internal/datatype-validator-factory</li>
- * </ul>
- * </ul>
- *
- * @author Elena Litani, IBM
- *
- */
-public class IntegratedParserConfiguration
-extends StandardParserConfiguration {
-
-
- //
- // REVISIT: should this configuration depend on the others
- // like DTD/Standard one?
- //
-
- /** Document scanner that does namespace binding. */
- protected XMLNSDocumentScannerImpl fNamespaceScanner;
-
- /** Default Xerces implementation of scanner */
- protected XMLDocumentScannerImpl fNonNSScanner;
-
- /** DTD Validator that does not bind namespaces */
- protected XMLDTDValidator fNonNSDTDValidator;
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- public IntegratedParserConfiguration() {
- this(null, null, null);
- } // <init>()
-
- /**
- * Constructs a parser configuration using the specified symbol table.
- *
- * @param symbolTable The symbol table to use.
- */
- public IntegratedParserConfiguration(SymbolTable symbolTable) {
- this(symbolTable, null, null);
- } // <init>(SymbolTable)
-
- /**
- * Constructs a parser configuration using the specified symbol table and
- * grammar pool.
- * <p>
- * <strong>REVISIT:</strong>
- * Grammar pool will be updated when the new validation engine is
- * implemented.
- *
- * @param symbolTable The symbol table to use.
- * @param grammarPool The grammar pool to use.
- */
- public IntegratedParserConfiguration(SymbolTable symbolTable,
- XMLGrammarPool grammarPool) {
- this(symbolTable, grammarPool, null);
- } // <init>(SymbolTable,XMLGrammarPool)
-
- /**
- * Constructs a parser configuration using the specified symbol table,
- * grammar pool, and parent settings.
- * <p>
- * <strong>REVISIT:</strong>
- * Grammar pool will be updated when the new validation engine is
- * implemented.
- *
- * @param symbolTable The symbol table to use.
- * @param grammarPool The grammar pool to use.
- * @param parentSettings The parent settings.
- */
- public IntegratedParserConfiguration(SymbolTable symbolTable,
- XMLGrammarPool grammarPool,
- XMLComponentManager parentSettings) {
- super(symbolTable, grammarPool, parentSettings);
-
- // create components
- fNonNSScanner = new XMLDocumentScannerImpl();
- fNonNSDTDValidator = new XMLDTDValidator();
-
- // add components
- addComponent((XMLComponent)fNonNSScanner);
- addComponent((XMLComponent)fNonNSDTDValidator);
-
- } // <init>(SymbolTable,XMLGrammarPool)
-
-
- /** Configures the pipeline. */
- protected void configurePipeline() {
-
- // use XML 1.0 datatype library
- setProperty(DATATYPE_VALIDATOR_FACTORY, fDatatypeValidatorFactory);
-
- // setup DTD pipeline
- configureDTDPipeline();
-
- // setup document pipeline
- if (fFeatures.get(NAMESPACES) == Boolean.TRUE) {
- fProperties.put(NAMESPACE_BINDER, fNamespaceBinder);
- fScanner = fNamespaceScanner;
- fProperties.put(DOCUMENT_SCANNER, fNamespaceScanner);
- if (fDTDValidator != null) {
- fProperties.put(DTD_VALIDATOR, fDTDValidator);
- fNamespaceScanner.setDTDValidator(fDTDValidator);
- fNamespaceScanner.setDocumentHandler(fDTDValidator);
- fDTDValidator.setDocumentSource(fNamespaceScanner);
- fDTDValidator.setDocumentHandler(fDocumentHandler);
- if (fDocumentHandler != null) {
- fDocumentHandler.setDocumentSource(fDTDValidator);
- }
- fLastComponent = fDTDValidator;
- }
- else {
- fNamespaceScanner.setDocumentHandler(fDocumentHandler);
- fNamespaceScanner.setDTDValidator(null);
- if (fDocumentHandler != null) {
- fDocumentHandler.setDocumentSource(fNamespaceScanner);
- }
- fLastComponent = fNamespaceScanner;
- }
- }
- else {
- fScanner = fNonNSScanner;
- fProperties.put(DOCUMENT_SCANNER, fNonNSScanner);
- if (fNonNSDTDValidator != null) {
- fProperties.put(DTD_VALIDATOR, fNonNSDTDValidator);
- fNonNSScanner.setDocumentHandler(fNonNSDTDValidator);
- fNonNSDTDValidator.setDocumentSource(fNonNSScanner);
- fNonNSDTDValidator.setDocumentHandler(fDocumentHandler);
- if (fDocumentHandler != null) {
- fDocumentHandler.setDocumentSource(fNonNSDTDValidator);
- }
- fLastComponent = fNonNSDTDValidator;
- }
- else {
- fScanner.setDocumentHandler(fDocumentHandler);
- if (fDocumentHandler != null) {
- fDocumentHandler.setDocumentSource(fScanner);
- }
- fLastComponent = fScanner;
- }
- }
-
- // setup document pipeline
- if (fFeatures.get(XMLSCHEMA_VALIDATION) == Boolean.TRUE) {
- // If schema validator was not in the pipeline insert it.
- if (fSchemaValidator == null) {
- fSchemaValidator = new XMLSchemaValidator();
-
- // add schema component
- fProperties.put(SCHEMA_VALIDATOR, fSchemaValidator);
- addComponent(fSchemaValidator);
- // add schema message formatter
- if (fErrorReporter.getMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN) == null) {
- XSMessageFormatter xmft = new XSMessageFormatter();
- fErrorReporter.putMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN, xmft);
- }
-
- }
-
- fLastComponent.setDocumentHandler(fSchemaValidator);
- fSchemaValidator.setDocumentSource(fLastComponent);
- fSchemaValidator.setDocumentHandler(fDocumentHandler);
- if (fDocumentHandler != null) {
- fDocumentHandler.setDocumentSource(fSchemaValidator);
- }
- fLastComponent = fSchemaValidator;
- }
- } // configurePipeline()
-
-
-
- /** Create a document scanner: this scanner performs namespace binding
- */
- protected XMLDocumentScanner createDocumentScanner() {
- fNamespaceScanner = new XMLNSDocumentScannerImpl();
- return fNamespaceScanner;
- } // createDocumentScanner():XMLDocumentScanner
-
-
- /** Create a DTD validator: this validator performs namespace binding.
- */
- protected XMLDTDValidator createDTDValidator() {
- return new XMLNSDTDValidator();
- } // createDTDValidator():XMLDTDValidator
-
-} // class IntegratedParserConfiguration
diff --git a/src/com/sun/org/apache/xerces/internal/parsers/NonValidatingConfiguration.java b/src/com/sun/org/apache/xerces/internal/parsers/NonValidatingConfiguration.java
deleted file mode 100644
index 4697801..0000000
--- a/src/com/sun/org/apache/xerces/internal/parsers/NonValidatingConfiguration.java
+++ /dev/null
@@ -1,806 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.parsers;
-
-import java.io.IOException;
-import java.util.Locale;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl;
-import com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl;
-import com.sun.org.apache.xerces.internal.impl.XMLEntityManager;
-import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
-import com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl;
-import com.sun.org.apache.xerces.internal.impl.dv.DTDDVFactory;
-import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter;
-import com.sun.org.apache.xerces.internal.impl.validation.ValidationManager;
-import com.sun.org.apache.xerces.internal.util.FeatureState;
-import com.sun.org.apache.xerces.internal.util.PropertyState;
-import com.sun.org.apache.xerces.internal.util.Status;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager;
-import com.sun.org.apache.xerces.internal.xni.XMLLocator;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponent;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDScanner;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentScanner;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLPullParserConfiguration;
-
-/**
- * This is the non validating parser configuration. It extends the basic
- * configuration with the set of following parser components:
- * Document scanner, DTD scanner, namespace binder, document handler.
- * <p>
- * Xerces parser that uses this configuration is <strong>not</strong> <a href="http://www.w3.org/TR/REC-xml#sec-conformance">conformant</a>
- * non-validating XML processor, since conformant non-validating processor is required
- * to process "all the declarations they read in the internal DTD subset ... must use the information in those declarations to normalize attribute values,
- * include the replacement text of internal entities, and supply default attribute values".
- *
- * @author Elena Litani, IBM
- * @version $Id: NonValidatingConfiguration.java,v 1.7 2010-11-01 04:40:09 joehw Exp $
- */
-public class NonValidatingConfiguration
- extends BasicParserConfiguration
- implements XMLPullParserConfiguration {
-
- //
- // Constants
- //
-
- // feature identifiers
-
- /** Feature identifier: warn on duplicate attribute definition. */
- protected static final String WARN_ON_DUPLICATE_ATTDEF =
- Constants.XERCES_FEATURE_PREFIX + Constants.WARN_ON_DUPLICATE_ATTDEF_FEATURE;
-
- /** Feature identifier: warn on duplicate entity definition. */
- protected static final String WARN_ON_DUPLICATE_ENTITYDEF =
- Constants.XERCES_FEATURE_PREFIX + Constants.WARN_ON_DUPLICATE_ENTITYDEF_FEATURE;
-
- /** Feature identifier: warn on undeclared element definition. */
- protected static final String WARN_ON_UNDECLARED_ELEMDEF =
- Constants.XERCES_FEATURE_PREFIX + Constants.WARN_ON_UNDECLARED_ELEMDEF_FEATURE;
-
- /** Feature identifier: allow Java encodings. */
- protected static final String ALLOW_JAVA_ENCODINGS =
- Constants.XERCES_FEATURE_PREFIX + Constants.ALLOW_JAVA_ENCODINGS_FEATURE;
-
- /** Feature identifier: continue after fatal error. */
- protected static final String CONTINUE_AFTER_FATAL_ERROR =
- Constants.XERCES_FEATURE_PREFIX + Constants.CONTINUE_AFTER_FATAL_ERROR_FEATURE;
-
- /** Feature identifier: load external DTD. */
- protected static final String LOAD_EXTERNAL_DTD =
- Constants.XERCES_FEATURE_PREFIX + Constants.LOAD_EXTERNAL_DTD_FEATURE;
-
- /** Feature identifier: notify built-in refereces. */
- protected static final String NOTIFY_BUILTIN_REFS =
- Constants.XERCES_FEATURE_PREFIX + Constants.NOTIFY_BUILTIN_REFS_FEATURE;
-
- /** Feature identifier: notify character refereces. */
- protected static final String NOTIFY_CHAR_REFS =
- Constants.XERCES_FEATURE_PREFIX + Constants.NOTIFY_CHAR_REFS_FEATURE;
-
-
- /** Feature identifier: expose schema normalized value */
- protected static final String NORMALIZE_DATA =
- Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_NORMALIZED_VALUE;
-
-
- /** Feature identifier: send element default value via characters() */
- protected static final String SCHEMA_ELEMENT_DEFAULT =
- Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_ELEMENT_DEFAULT;
-
- // property identifiers
-
- /** Property identifier: error reporter. */
- protected static final String ERROR_REPORTER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY;
-
- /** Property identifier: entity manager. */
- protected static final String ENTITY_MANAGER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_MANAGER_PROPERTY;
-
- /** Property identifier document scanner: */
- protected static final String DOCUMENT_SCANNER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.DOCUMENT_SCANNER_PROPERTY;
-
- /** Property identifier: DTD scanner. */
- protected static final String DTD_SCANNER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.DTD_SCANNER_PROPERTY;
-
- /** Property identifier: grammar pool. */
- protected static final String XMLGRAMMAR_POOL =
- Constants.XERCES_PROPERTY_PREFIX + Constants.XMLGRAMMAR_POOL_PROPERTY;
-
- /** Property identifier: DTD validator. */
- protected static final String DTD_VALIDATOR =
- Constants.XERCES_PROPERTY_PREFIX + Constants.DTD_VALIDATOR_PROPERTY;
-
- /** Property identifier: namespace binder. */
- protected static final String NAMESPACE_BINDER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.NAMESPACE_BINDER_PROPERTY;
-
- /** Property identifier: datatype validator factory. */
- protected static final String DATATYPE_VALIDATOR_FACTORY =
- Constants.XERCES_PROPERTY_PREFIX + Constants.DATATYPE_VALIDATOR_FACTORY_PROPERTY;
-
- protected static final String VALIDATION_MANAGER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.VALIDATION_MANAGER_PROPERTY;
-
- /** Property identifier: XML Schema validator. */
- protected static final String SCHEMA_VALIDATOR =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SCHEMA_VALIDATOR_PROPERTY;
-
- /** Property identifier: locale. */
- protected static final String LOCALE =
- Constants.XERCES_PROPERTY_PREFIX + Constants.LOCALE_PROPERTY;
-
- /** Property identifier: Security property manager. */
- protected static final String XML_SECURITY_PROPERTY_MANAGER =
- Constants.XML_SECURITY_PROPERTY_MANAGER;
-
- /** Property identifier: Security manager. */
- private static final String SECURITY_MANAGER = Constants.SECURITY_MANAGER;
-
- // debugging
-
- /** Set to true and recompile to print exception stack trace. */
- private static final boolean PRINT_EXCEPTION_STACK_TRACE = false;
-
- //
- // Data
- //
-
- // components (non-configurable)
-
- /** Grammar pool. */
- protected XMLGrammarPool fGrammarPool;
-
- /** Datatype validator factory. */
- protected DTDDVFactory fDatatypeValidatorFactory;
-
- // components (configurable)
-
- /** Error reporter. */
- protected XMLErrorReporter fErrorReporter;
-
- /** Entity manager. */
- protected XMLEntityManager fEntityManager;
-
- /** Document scanner. */
- protected XMLDocumentScanner fScanner;
-
- /** Input Source */
- protected XMLInputSource fInputSource;
-
- /** DTD scanner. */
- protected XMLDTDScanner fDTDScanner;
-
-
- protected ValidationManager fValidationManager;
-
- // private data
-
- /** Document scanner that does namespace binding. */
- private XMLNSDocumentScannerImpl fNamespaceScanner;
-
- /** Default Xerces implementation of scanner*/
- private XMLDocumentScannerImpl fNonNSScanner;
-
-
- /** fConfigUpdated is set to true if there has been any change to the configuration settings,
- * i.e a feature or a property was changed.
- */
- protected boolean fConfigUpdated = false;
-
-
- // state
-
- /** Locator */
- protected XMLLocator fLocator;
-
- /**
- * True if a parse is in progress. This state is needed because
- * some features/properties cannot be set while parsing (e.g.
- * validation and namespaces).
- */
- protected boolean fParseInProgress = false;
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- public NonValidatingConfiguration() {
- this(null, null, null);
- } // <init>()
-
- /**
- * Constructs a parser configuration using the specified symbol table.
- *
- * @param symbolTable The symbol table to use.
- */
- public NonValidatingConfiguration(SymbolTable symbolTable) {
- this(symbolTable, null, null);
- } // <init>(SymbolTable)
-
- /**
- * Constructs a parser configuration using the specified symbol table and
- * grammar pool.
- * <p>
- * <strong>REVISIT:</strong>
- * Grammar pool will be updated when the new validation engine is
- * implemented.
- *
- * @param symbolTable The symbol table to use.
- * @param grammarPool The grammar pool to use.
- */
- public NonValidatingConfiguration(SymbolTable symbolTable,
- XMLGrammarPool grammarPool) {
- this(symbolTable, grammarPool, null);
- } // <init>(SymbolTable,XMLGrammarPool)
-
- /**
- * Constructs a parser configuration using the specified symbol table,
- * grammar pool, and parent settings.
- * <p>
- * <strong>REVISIT:</strong>
- * Grammar pool will be updated when the new validation engine is
- * implemented.
- *
- * @param symbolTable The symbol table to use.
- * @param grammarPool The grammar pool to use.
- * @param parentSettings The parent settings.
- */
- public NonValidatingConfiguration(SymbolTable symbolTable,
- XMLGrammarPool grammarPool,
- XMLComponentManager parentSettings) {
- super(symbolTable, parentSettings);
-
- // add default recognized features
- final String[] recognizedFeatures = {
- PARSER_SETTINGS,
- NAMESPACES,
- //WARN_ON_DUPLICATE_ATTDEF, // from XMLDTDScannerImpl
- //WARN_ON_UNDECLARED_ELEMDEF, // from XMLDTDScannerImpl
- //ALLOW_JAVA_ENCODINGS, // from XMLEntityManager
- CONTINUE_AFTER_FATAL_ERROR,
- //LOAD_EXTERNAL_DTD, // from XMLDTDScannerImpl
- //NOTIFY_BUILTIN_REFS, // from XMLDocumentFragmentScannerImpl
- //NOTIFY_CHAR_REFS, // from XMLDocumentFragmentScannerImpl
- //WARN_ON_DUPLICATE_ENTITYDEF // from XMLEntityManager
- };
- addRecognizedFeatures(recognizedFeatures);
-
- // set state for default features
- //setFeature(WARN_ON_DUPLICATE_ATTDEF, false); // from XMLDTDScannerImpl
- //setFeature(WARN_ON_UNDECLARED_ELEMDEF, false); // from XMLDTDScannerImpl
- //setFeature(ALLOW_JAVA_ENCODINGS, false); // from XMLEntityManager
- fFeatures.put(CONTINUE_AFTER_FATAL_ERROR, Boolean.FALSE);
- fFeatures.put(PARSER_SETTINGS, Boolean.TRUE);
- fFeatures.put(NAMESPACES, Boolean.TRUE);
- //setFeature(LOAD_EXTERNAL_DTD, true); // from XMLDTDScannerImpl
- //setFeature(NOTIFY_BUILTIN_REFS, false); // from XMLDocumentFragmentScannerImpl
- //setFeature(NOTIFY_CHAR_REFS, false); // from XMLDocumentFragmentScannerImpl
- //setFeature(WARN_ON_DUPLICATE_ENTITYDEF, false); // from XMLEntityManager
-
- // add default recognized properties
- final String[] recognizedProperties = {
- ERROR_REPORTER,
- ENTITY_MANAGER,
- DOCUMENT_SCANNER,
- DTD_SCANNER,
- DTD_VALIDATOR,
- NAMESPACE_BINDER,
- XMLGRAMMAR_POOL,
- DATATYPE_VALIDATOR_FACTORY,
- VALIDATION_MANAGER,
- LOCALE,
- SECURITY_MANAGER,
- XML_SECURITY_PROPERTY_MANAGER
- };
- addRecognizedProperties(recognizedProperties);
-
- fGrammarPool = grammarPool;
- if(fGrammarPool != null){
- fProperties.put(XMLGRAMMAR_POOL, fGrammarPool);
- }
-
- fEntityManager = createEntityManager();
- fProperties.put(ENTITY_MANAGER, fEntityManager);
- addComponent(fEntityManager);
-
- fErrorReporter = createErrorReporter();
- fErrorReporter.setDocumentLocator(fEntityManager.getEntityScanner());
- fProperties.put(ERROR_REPORTER, fErrorReporter);
- addComponent(fErrorReporter);
-
- // this configuration delays creation of the scanner
- // till it is known if namespace processing should be performed
-
- fDTDScanner = createDTDScanner();
- if (fDTDScanner != null) {
- fProperties.put(DTD_SCANNER, fDTDScanner);
- if (fDTDScanner instanceof XMLComponent) {
- addComponent((XMLComponent)fDTDScanner);
- }
- }
-
- fDatatypeValidatorFactory = createDatatypeValidatorFactory();
- if (fDatatypeValidatorFactory != null) {
- fProperties.put(DATATYPE_VALIDATOR_FACTORY,
- fDatatypeValidatorFactory);
- }
- fValidationManager = createValidationManager();
-
- if (fValidationManager != null) {
- fProperties.put(VALIDATION_MANAGER, fValidationManager);
- }
- // add message formatters
- if (fErrorReporter.getMessageFormatter(XMLMessageFormatter.XML_DOMAIN) == null) {
- XMLMessageFormatter xmft = new XMLMessageFormatter();
- fErrorReporter.putMessageFormatter(XMLMessageFormatter.XML_DOMAIN, xmft);
- fErrorReporter.putMessageFormatter(XMLMessageFormatter.XMLNS_DOMAIN, xmft);
- }
-
- fConfigUpdated = false;
-
- // set locale
- try {
- setLocale(Locale.getDefault());
- }
- catch (XNIException e) {
- // do nothing
- // REVISIT: What is the right thing to do? -Ac
- }
-
- setProperty(XML_SECURITY_PROPERTY_MANAGER, new XMLSecurityPropertyManager());
- } // <init>(SymbolTable,XMLGrammarPool)
-
- //
- // Public methods
- //
- public void setFeature(String featureId, boolean state)
- throws XMLConfigurationException {
- fConfigUpdated = true;
- super.setFeature(featureId, state);
- }
-
- public PropertyState getPropertyState(String propertyId)
- throws XMLConfigurationException {
- if (LOCALE.equals(propertyId)) {
- return PropertyState.is(getLocale());
- }
- return super.getPropertyState(propertyId);
- }
-
- public void setProperty(String propertyId, Object value)
- throws XMLConfigurationException {
- fConfigUpdated = true;
- if (LOCALE.equals(propertyId)) {
- setLocale((Locale) value);
- }
- super.setProperty(propertyId, value);
- }
-
- /**
- * Set the locale to use for messages.
- *
- * @param locale The locale object to use for localization of messages.
- *
- * @exception XNIException Thrown if the parser does not support the
- * specified locale.
- */
- public void setLocale(Locale locale) throws XNIException {
- super.setLocale(locale);
- fErrorReporter.setLocale(locale);
- } // setLocale(Locale)
-
- public FeatureState getFeatureState(String featureId)
- throws XMLConfigurationException {
- // make this feature special
- if (featureId.equals(PARSER_SETTINGS)){
- return FeatureState.is(fConfigUpdated);
- }
- return super.getFeatureState(featureId);
-
- } // getFeature(String):boolean
- //
- // XMLPullParserConfiguration methods
- //
-
- // parsing
-
- /**
- * Sets the input source for the document to parse.
- *
- * @param inputSource The document's input source.
- *
- * @exception XMLConfigurationException Thrown if there is a
- * configuration error when initializing the
- * parser.
- * @exception IOException Thrown on I/O error.
- *
- * @see #parse(boolean)
- */
- public void setInputSource(XMLInputSource inputSource)
- throws XMLConfigurationException, IOException {
-
- // REVISIT: this method used to reset all the components and
- // construct the pipeline. Now reset() is called
- // in parse (boolean) just before we parse the document
- // Should this method still throw exceptions..?
-
- fInputSource = inputSource;
-
- } // setInputSource(XMLInputSource)
-
- /**
- * Parses the document in a pull parsing fashion.
- *
- * @param complete True if the pull parser should parse the
- * remaining document completely.
- *
- * @return True if there is more document to parse.
- *
- * @exception XNIException Any XNI exception, possibly wrapping
- * another exception.
- * @exception IOException An IO exception from the parser, possibly
- * from a byte stream or character stream
- * supplied by the parser.
- *
- * @see #setInputSource
- */
- public boolean parse(boolean complete) throws XNIException, IOException {
- //
- // reset and configure pipeline and set InputSource.
- if (fInputSource !=null) {
- try {
- // resets and sets the pipeline.
- reset();
- fScanner.setInputSource(fInputSource);
- fInputSource = null;
- }
- catch (XNIException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- }
- catch (IOException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- }
- catch (RuntimeException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- }
- catch (Exception ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw new XNIException(ex);
- }
- }
-
- try {
- return fScanner.scanDocument(complete);
- }
- catch (XNIException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- }
- catch (IOException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- }
- catch (RuntimeException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- }
- catch (Exception ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw new XNIException(ex);
- }
-
- } // parse(boolean):boolean
-
- /**
- * If the application decides to terminate parsing before the xml document
- * is fully parsed, the application should call this method to free any
- * resource allocated during parsing. For example, close all opened streams.
- */
- public void cleanup() {
- fEntityManager.closeReaders();
- }
-
- //
- // XMLParserConfiguration methods
- //
-
- /**
- * Parses the specified input source.
- *
- * @param source The input source.
- *
- * @exception XNIException Throws exception on XNI error.
- * @exception java.io.IOException Throws exception on i/o error.
- */
- public void parse(XMLInputSource source) throws XNIException, IOException {
-
- if (fParseInProgress) {
- // REVISIT - need to add new error message
- throw new XNIException("FWK005 parse may not be called while parsing.");
- }
- fParseInProgress = true;
-
- try {
- setInputSource(source);
- parse(true);
- }
- catch (XNIException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- }
- catch (IOException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- }
- catch (RuntimeException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- }
- catch (Exception ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw new XNIException(ex);
- }
- finally {
- fParseInProgress = false;
- // close all streams opened by xerces
- this.cleanup();
- }
-
- } // parse(InputSource)
-
- //
- // Protected methods
- //
-
- /**
- * Reset all components before parsing.
- *
- * @throws XNIException Thrown if an error occurs during initialization.
- */
- protected void reset() throws XNIException {
-
- if (fValidationManager != null)
- fValidationManager.reset();
- // configure the pipeline and initialize the components
- configurePipeline();
- super.reset();
-
- } // reset()
-
- /** Configures the pipeline. */
- protected void configurePipeline() {
- // create appropriate scanner
- // and register it as one of the components.
- if (fFeatures.get(NAMESPACES) == Boolean.TRUE) {
- if (fNamespaceScanner == null) {
- fNamespaceScanner = new XMLNSDocumentScannerImpl();
- addComponent((XMLComponent)fNamespaceScanner);
- }
- fProperties.put(DOCUMENT_SCANNER, fNamespaceScanner);
- fNamespaceScanner.setDTDValidator(null);
- fScanner = fNamespaceScanner;
- }
- else {
- if (fNonNSScanner == null) {
- fNonNSScanner = new XMLDocumentScannerImpl();
- addComponent((XMLComponent)fNonNSScanner);
- }
- fProperties.put(DOCUMENT_SCANNER, fNonNSScanner);
- fScanner = fNonNSScanner;
- }
-
- fScanner.setDocumentHandler(fDocumentHandler);
- fLastComponent = fScanner;
- // setup dtd pipeline
- if (fDTDScanner != null) {
- fDTDScanner.setDTDHandler(fDTDHandler);
- fDTDScanner.setDTDContentModelHandler(fDTDContentModelHandler);
- }
-
-
- } // configurePipeline()
-
- // features and properties
-
- /**
- * Check a feature. If feature is know and supported, this method simply
- * returns. Otherwise, the appropriate exception is thrown.
- *
- * @param featureId The unique identifier (URI) of the feature.
- *
- * @throws XMLConfigurationException Thrown for configuration error.
- * In general, components should
- * only throw this exception if
- * it is <strong>really</strong>
- * a critical error.
- */
- protected FeatureState checkFeature(String featureId)
- throws XMLConfigurationException {
-
- //
- // Xerces Features
- //
-
- if (featureId.startsWith(Constants.XERCES_FEATURE_PREFIX)) {
- final int suffixLength = featureId.length() - Constants.XERCES_FEATURE_PREFIX.length();
-
- //
- // http://apache.org/xml/features/validation/dynamic
- // Allows the parser to validate a document only when it
- // contains a grammar. Validation is turned on/off based
- // on each document instance, automatically.
- //
- if (suffixLength == Constants.DYNAMIC_VALIDATION_FEATURE.length() &&
- featureId.endsWith(Constants.DYNAMIC_VALIDATION_FEATURE)) {
- return FeatureState.RECOGNIZED;
- }
- //
- // http://apache.org/xml/features/validation/default-attribute-values
- //
- if (suffixLength == Constants.DEFAULT_ATTRIBUTE_VALUES_FEATURE.length() &&
- featureId.endsWith(Constants.DEFAULT_ATTRIBUTE_VALUES_FEATURE)) {
- // REVISIT
- return FeatureState.NOT_SUPPORTED;
- }
- //
- // http://apache.org/xml/features/validation/default-attribute-values
- //
- if (suffixLength == Constants.VALIDATE_CONTENT_MODELS_FEATURE.length() &&
- featureId.endsWith(Constants.VALIDATE_CONTENT_MODELS_FEATURE)) {
- // REVISIT
- return FeatureState.NOT_SUPPORTED;
- }
- //
- // http://apache.org/xml/features/validation/nonvalidating/load-dtd-grammar
- //
- if (suffixLength == Constants.LOAD_DTD_GRAMMAR_FEATURE.length() &&
- featureId.endsWith(Constants.LOAD_DTD_GRAMMAR_FEATURE)) {
- return FeatureState.RECOGNIZED;
- }
- //
- // http://apache.org/xml/features/validation/nonvalidating/load-external-dtd
- //
- if (suffixLength == Constants.LOAD_EXTERNAL_DTD_FEATURE.length() &&
- featureId.endsWith(Constants.LOAD_EXTERNAL_DTD_FEATURE)) {
- return FeatureState.RECOGNIZED;
- }
-
- //
- // http://apache.org/xml/features/validation/default-attribute-values
- //
- if (suffixLength == Constants.VALIDATE_DATATYPES_FEATURE.length() &&
- featureId.endsWith(Constants.VALIDATE_DATATYPES_FEATURE)) {
- return FeatureState.NOT_SUPPORTED;
- }
- }
-
- //
- // Not recognized
- //
-
- return super.checkFeature(featureId);
-
- } // checkFeature(String)
-
- /**
- * Check a property. If the property is know and supported, this method
- * simply returns. Otherwise, the appropriate exception is thrown.
- *
- * @param propertyId The unique identifier (URI) of the property
- * being set.
- *
- * @throws XMLConfigurationException Thrown for configuration error.
- * In general, components should
- * only throw this exception if
- * it is <strong>really</strong>
- * a critical error.
- */
- protected PropertyState checkProperty(String propertyId)
- throws XMLConfigurationException {
-
- //
- // Xerces Properties
- //
-
- if (propertyId.startsWith(Constants.XERCES_PROPERTY_PREFIX)) {
- final int suffixLength = propertyId.length() - Constants.XERCES_PROPERTY_PREFIX.length();
-
- if (suffixLength == Constants.DTD_SCANNER_PROPERTY.length() &&
- propertyId.endsWith(Constants.DTD_SCANNER_PROPERTY)) {
- return PropertyState.RECOGNIZED;
- }
- }
-
- if (propertyId.startsWith(Constants.JAXP_PROPERTY_PREFIX)) {
- final int suffixLength = propertyId.length() - Constants.JAXP_PROPERTY_PREFIX.length();
-
- if (suffixLength == Constants.SCHEMA_SOURCE.length() &&
- propertyId.endsWith(Constants.SCHEMA_SOURCE)) {
- return PropertyState.RECOGNIZED;
- }
- }
-
- //
- // Not recognized
- //
-
- return super.checkProperty(propertyId);
-
- } // checkProperty(String)
-
- // factory methods
-
- /** Creates an entity manager. */
- protected XMLEntityManager createEntityManager() {
- return new XMLEntityManager();
- } // createEntityManager():XMLEntityManager
-
- /** Creates an error reporter. */
- protected XMLErrorReporter createErrorReporter() {
- return new XMLErrorReporter();
- } // createErrorReporter():XMLErrorReporter
-
- /** Create a document scanner. */
- protected XMLDocumentScanner createDocumentScanner() {
- return null;
- } // createDocumentScanner():XMLDocumentScanner
-
- /** Create a DTD scanner. */
- protected XMLDTDScanner createDTDScanner() {
- return new XMLDTDScannerImpl();
- } // createDTDScanner():XMLDTDScanner
-
- /** Create a datatype validator factory. */
- protected DTDDVFactory createDatatypeValidatorFactory() {
- return DTDDVFactory.getInstance();
- } // createDatatypeValidatorFactory():DatatypeValidatorFactory
- protected ValidationManager createValidationManager(){
- return new ValidationManager();
- }
-
-} // class NonValidatingConfiguration
diff --git a/src/com/sun/org/apache/xerces/internal/parsers/SAXParser.java b/src/com/sun/org/apache/xerces/internal/parsers/SAXParser.java
deleted file mode 100644
index 48b8a1e..0000000
--- a/src/com/sun/org/apache/xerces/internal/parsers/SAXParser.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2000-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.parsers;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
-
-/**
- * This is the main Xerces SAX parser class. It uses the abstract SAX
- * parser with a document scanner, a dtd scanner, and a validator, as
- * well as a grammar pool.
- *
- * @author Arnaud Le Hors, IBM
- * @author Andy Clark, IBM
- *
- * @version $Id: SAXParser.java,v 1.7 2010-11-01 04:40:09 joehw Exp $
- */
-public class SAXParser
- extends AbstractSAXParser {
-
- //
- // Constants
- //
-
- // features
-
- /** Feature identifier: notify built-in refereces. */
- protected static final String NOTIFY_BUILTIN_REFS =
- Constants.XERCES_FEATURE_PREFIX + Constants.NOTIFY_BUILTIN_REFS_FEATURE;
-
- protected static final String REPORT_WHITESPACE =
- Constants.SUN_SCHEMA_FEATURE_PREFIX + Constants.SUN_REPORT_IGNORED_ELEMENT_CONTENT_WHITESPACE;
-
- /** Recognized features. */
- private static final String[] RECOGNIZED_FEATURES = {
- NOTIFY_BUILTIN_REFS,
- REPORT_WHITESPACE
- };
-
- // properties
-
- /** Property identifier: symbol table. */
- protected static final String SYMBOL_TABLE =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY;
-
- /** Property identifier: XML grammar pool. */
- protected static final String XMLGRAMMAR_POOL =
- Constants.XERCES_PROPERTY_PREFIX+Constants.XMLGRAMMAR_POOL_PROPERTY;
-
- /** Recognized properties. */
- private static final String[] RECOGNIZED_PROPERTIES = {
- SYMBOL_TABLE,
- XMLGRAMMAR_POOL,
- };
-
-
- //
- // Constructors
- //
-
- /**
- * Constructs a SAX parser using the specified parser configuration.
- */
- public SAXParser(XMLParserConfiguration config) {
- super(config);
- } // <init>(XMLParserConfiguration)
-
- /**
- * Constructs a SAX parser using the dtd/xml schema parser configuration.
- */
- public SAXParser() {
- this(null, null);
- } // <init>()
-
- /**
- * Constructs a SAX parser using the specified symbol table.
- */
- public SAXParser(SymbolTable symbolTable) {
- this(symbolTable, null);
- } // <init>(SymbolTable)
-
- /**
- * Constructs a SAX parser using the specified symbol table and
- * grammar pool.
- */
- public SAXParser(SymbolTable symbolTable, XMLGrammarPool grammarPool) {
- super(new XIncludeAwareParserConfiguration());
-
- // set features
- fConfiguration.addRecognizedFeatures(RECOGNIZED_FEATURES);
- fConfiguration.setFeature(NOTIFY_BUILTIN_REFS, true);
-
- // set properties
- fConfiguration.addRecognizedProperties(RECOGNIZED_PROPERTIES);
- if (symbolTable != null) {
- fConfiguration.setProperty(SYMBOL_TABLE, symbolTable);
- }
- if (grammarPool != null) {
- fConfiguration.setProperty(XMLGRAMMAR_POOL, grammarPool);
- }
-
- } // <init>(SymbolTable,XMLGrammarPool)
-
- /**
- * Sets the particular property in the underlying implementation of
- * org.xml.sax.XMLReader.
- */
- public void setProperty(String name, Object value)
- throws SAXNotRecognizedException, SAXNotSupportedException {
- /**
- * It's possible for users to set a security manager through the interface.
- * If it's the old SecurityManager, convert it to the new XMLSecurityManager
- */
- if (name.equals(Constants.SECURITY_MANAGER)) {
- securityManager = XMLSecurityManager.convert(value, securityManager);
- super.setProperty(Constants.SECURITY_MANAGER, securityManager);
- return;
- }
- if (name.equals(Constants.XML_SECURITY_PROPERTY_MANAGER)) {
- if (value == null) {
- securityPropertyManager = new XMLSecurityPropertyManager();
- } else {
- securityPropertyManager = (XMLSecurityPropertyManager)value;
- }
- super.setProperty(Constants.XML_SECURITY_PROPERTY_MANAGER, securityPropertyManager);
- return;
- }
-
- if (securityManager == null) {
- securityManager = new XMLSecurityManager(true);
- super.setProperty(Constants.SECURITY_MANAGER, securityManager);
- }
-
- if (securityPropertyManager == null) {
- securityPropertyManager = new XMLSecurityPropertyManager();
- super.setProperty(Constants.XML_SECURITY_PROPERTY_MANAGER, securityPropertyManager);
- }
-
- int index = securityPropertyManager.getIndex(name);
- if (index > -1) {
- /**
- * this is a direct call to this parser, not a subclass since
- * internally the support of this property is done through
- * XMLSecurityPropertyManager
- */
- securityPropertyManager.setValue(index, XMLSecurityPropertyManager.State.APIPROPERTY, (String)value);
- } else {
- //check if the property is managed by security manager
- if (!securityManager.setLimit(name, XMLSecurityManager.State.APIPROPERTY, value)) {
- //fall back to the default configuration to handle the property
- super.setProperty(name, value);
- }
- }
- }
-} // class SAXParser
diff --git a/src/com/sun/org/apache/xerces/internal/parsers/SecurityConfiguration.java b/src/com/sun/org/apache/xerces/internal/parsers/SecurityConfiguration.java
deleted file mode 100644
index 65c85d1..0000000
--- a/src/com/sun/org/apache/xerces/internal/parsers/SecurityConfiguration.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.parsers;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager;
-
-/**
- * This configuration allows Xerces to behave in a security-conscious manner; that is,
- * it permits applications to instruct Xerces to limit certain
- * operations that could be exploited by malicious document authors to cause a denail-of-service
- * attack when the document is parsed.
- *
- * In addition to the features and properties recognized by the base
- * parser configuration, this class recognizes these additional
- * features and properties:
- * <ul>
- * <li>Properties
- * <ul>
- * <li>http://apache.org/xml/properties/security-manager</li>
- * </ul>
- * </ul>
- *
- * @author Neil Graham, IBM
- *
- * @version $Id: SecurityConfiguration.java,v 1.6 2010-11-01 04:40:09 joehw Exp $
- */
-public class SecurityConfiguration extends XIncludeAwareParserConfiguration
-{
-
- //
- // Constants
- //
-
- protected static final String SECURITY_MANAGER_PROPERTY =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SECURITY_MANAGER_PROPERTY;
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- public SecurityConfiguration () {
- this(null, null, null);
- } // <init>()
-
- /**
- * Constructs a parser configuration using the specified symbol table.
- *
- * @param symbolTable The symbol table to use.
- */
- public SecurityConfiguration (SymbolTable symbolTable) {
- this(symbolTable, null, null);
- } // <init>(SymbolTable)
-
- /**
- * Constructs a parser configuration using the specified symbol table and
- * grammar pool.
- * <p>
- * <strong>REVISIT:</strong>
- * Grammar pool will be updated when the new validation engine is
- * implemented.
- *
- * @param symbolTable The symbol table to use.
- * @param grammarPool The grammar pool to use.
- */
- public SecurityConfiguration (SymbolTable symbolTable,
- XMLGrammarPool grammarPool) {
- this(symbolTable, grammarPool, null);
- } // <init>(SymbolTable,XMLGrammarPool)
-
- /**
- * Constructs a parser configuration using the specified symbol table,
- * grammar pool, and parent settings.
- * <p>
- * <strong>REVISIT:</strong>
- * Grammar pool will be updated when the new validation engine is
- * implemented.
- *
- * @param symbolTable The symbol table to use.
- * @param grammarPool The grammar pool to use.
- * @param parentSettings The parent settings.
- */
- public SecurityConfiguration (SymbolTable symbolTable,
- XMLGrammarPool grammarPool,
- XMLComponentManager parentSettings) {
- super(symbolTable, grammarPool, parentSettings);
-
- // create the SecurityManager property:
- setProperty(SECURITY_MANAGER_PROPERTY, new XMLSecurityManager(true));
- } // <init>(SymbolTable,XMLGrammarPool)
-
-} // class SecurityConfiguration
diff --git a/src/com/sun/org/apache/xerces/internal/parsers/StandardParserConfiguration.java b/src/com/sun/org/apache/xerces/internal/parsers/StandardParserConfiguration.java
deleted file mode 100644
index 7caad5b..0000000
--- a/src/com/sun/org/apache/xerces/internal/parsers/StandardParserConfiguration.java
+++ /dev/null
@@ -1,385 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.parsers;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator;
-import com.sun.org.apache.xerces.internal.impl.xs.XSMessageFormatter;
-import com.sun.org.apache.xerces.internal.util.FeatureState;
-import com.sun.org.apache.xerces.internal.util.PropertyState;
-import com.sun.org.apache.xerces.internal.util.Status;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-
-/**
- * This is the "standard" parser configuration. It extends the DTD
- * configuration with the standard set of parser components.
- * The standard set of parser components include those needed
- * to parse and validate with DTD's, and those needed for XML
- * Schema.</p>
- * <p>
- * In addition to the features and properties recognized by the base
- * parser configuration, this class recognizes these additional
- * features and properties:
- * <ul>
- * <li>Features
- * <ul>
- * <li>http://apache.org/xml/features/validation/schema</li>
- * <li>http://apache.org/xml/features/validation/schema-full-checking</li>
- * <li>http://apache.org/xml/features/validation/schema/normalized-value</li>
- * <li>http://apache.org/xml/features/validation/schema/element-default</li>
- * </ul>
- * <li>Properties
- * <ul>
- * <li>http://apache.org/xml/properties/internal/error-reporter</li>
- * <li>http://apache.org/xml/properties/internal/entity-manager</li>
- * <li>http://apache.org/xml/properties/internal/document-scanner</li>
- * <li>http://apache.org/xml/properties/internal/dtd-scanner</li>
- * <li>http://apache.org/xml/properties/internal/grammar-pool</li>
- * <li>http://apache.org/xml/properties/internal/validator/dtd</li>
- * <li>http://apache.org/xml/properties/internal/datatype-validator-factory</li>
- * </ul>
- * </ul>
- *
- * @author Arnaud Le Hors, IBM
- * @author Andy Clark, IBM
- *
- * @version $Id: StandardParserConfiguration.java,v 1.7 2010-11-01 04:40:10 joehw Exp $
- */
-public class StandardParserConfiguration
- extends DTDConfiguration {
-
- //
- // Constants
- //
-
- // feature identifiers
-
- /** Feature identifier: expose schema normalized value */
- protected static final String NORMALIZE_DATA =
- Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_NORMALIZED_VALUE;
-
-
- /** Feature identifier: send element default value via characters() */
- protected static final String SCHEMA_ELEMENT_DEFAULT =
- Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_ELEMENT_DEFAULT;
-
-
- /** Feature identifier: augment PSVI */
- protected static final String SCHEMA_AUGMENT_PSVI =
- Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_AUGMENT_PSVI;
-
-
- /** feature identifier: XML Schema validation */
- protected static final String XMLSCHEMA_VALIDATION =
- Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_VALIDATION_FEATURE;
-
- /** feature identifier: XML Schema validation -- full checking */
- protected static final String XMLSCHEMA_FULL_CHECKING =
- Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_FULL_CHECKING;
-
- /** Feature: generate synthetic annotations */
- protected static final String GENERATE_SYNTHETIC_ANNOTATIONS =
- Constants.XERCES_FEATURE_PREFIX + Constants.GENERATE_SYNTHETIC_ANNOTATIONS_FEATURE;
-
- /** Feature identifier: validate annotations */
- protected static final String VALIDATE_ANNOTATIONS =
- Constants.XERCES_FEATURE_PREFIX + Constants.VALIDATE_ANNOTATIONS_FEATURE;
-
- /** Feature identifier: honour all schemaLocations */
- protected static final String HONOUR_ALL_SCHEMALOCATIONS =
- Constants.XERCES_FEATURE_PREFIX + Constants.HONOUR_ALL_SCHEMALOCATIONS_FEATURE;
-
- /** Feature identifier: namespace growth */
- protected static final String NAMESPACE_GROWTH =
- Constants.XERCES_FEATURE_PREFIX + Constants.NAMESPACE_GROWTH_FEATURE;
-
- /** Feature identifier: tolerate duplicates */
- protected static final String TOLERATE_DUPLICATES =
- Constants.XERCES_FEATURE_PREFIX + Constants.TOLERATE_DUPLICATES_FEATURE;
-
- // property identifiers
-
- /** Property identifier: XML Schema validator. */
- protected static final String SCHEMA_VALIDATOR =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SCHEMA_VALIDATOR_PROPERTY;
-
- /** Property identifier: schema location. */
- protected static final String SCHEMA_LOCATION =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SCHEMA_LOCATION;
-
- /** Property identifier: no namespace schema location. */
- protected static final String SCHEMA_NONS_LOCATION =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SCHEMA_NONS_LOCATION;
-
- /** Property identifier: Schema DV Factory */
- protected static final String SCHEMA_DV_FACTORY =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SCHEMA_DV_FACTORY_PROPERTY;
-
- //
- // Data
- //
-
- // components (non-configurable)
-
- /** XML Schema Validator. */
- protected XMLSchemaValidator fSchemaValidator;
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- public StandardParserConfiguration() {
- this(null, null, null);
- } // <init>()
-
- /**
- * Constructs a parser configuration using the specified symbol table.
- *
- * @param symbolTable The symbol table to use.
- */
- public StandardParserConfiguration(SymbolTable symbolTable) {
- this(symbolTable, null, null);
- } // <init>(SymbolTable)
-
- /**
- * Constructs a parser configuration using the specified symbol table and
- * grammar pool.
- * <p>
- * <strong>REVISIT:</strong>
- * Grammar pool will be updated when the new validation engine is
- * implemented.
- *
- * @param symbolTable The symbol table to use.
- * @param grammarPool The grammar pool to use.
- */
- public StandardParserConfiguration(SymbolTable symbolTable,
- XMLGrammarPool grammarPool) {
- this(symbolTable, grammarPool, null);
- } // <init>(SymbolTable,XMLGrammarPool)
-
- /**
- * Constructs a parser configuration using the specified symbol table,
- * grammar pool, and parent settings.
- * <p>
- * <strong>REVISIT:</strong>
- * Grammar pool will be updated when the new validation engine is
- * implemented.
- *
- * @param symbolTable The symbol table to use.
- * @param grammarPool The grammar pool to use.
- * @param parentSettings The parent settings.
- */
- public StandardParserConfiguration(SymbolTable symbolTable,
- XMLGrammarPool grammarPool,
- XMLComponentManager parentSettings) {
- super(symbolTable, grammarPool, parentSettings);
-
- // add default recognized features
- final String[] recognizedFeatures = {
- NORMALIZE_DATA,
- SCHEMA_ELEMENT_DEFAULT,
- SCHEMA_AUGMENT_PSVI,
- GENERATE_SYNTHETIC_ANNOTATIONS,
- VALIDATE_ANNOTATIONS,
- HONOUR_ALL_SCHEMALOCATIONS,
- NAMESPACE_GROWTH,
- TOLERATE_DUPLICATES,
- // NOTE: These shouldn't really be here but since the XML Schema
- // validator is constructed dynamically, its recognized
- // features might not have been set and it would cause a
- // not-recognized exception to be thrown. -Ac
- XMLSCHEMA_VALIDATION,
- XMLSCHEMA_FULL_CHECKING,
- };
- addRecognizedFeatures(recognizedFeatures);
-
- // set state for default features
- setFeature(SCHEMA_ELEMENT_DEFAULT, true);
- setFeature(NORMALIZE_DATA, true);
- setFeature(SCHEMA_AUGMENT_PSVI, true);
- setFeature(GENERATE_SYNTHETIC_ANNOTATIONS, false);
- setFeature(VALIDATE_ANNOTATIONS, false);
- setFeature(HONOUR_ALL_SCHEMALOCATIONS, false);
- setFeature(NAMESPACE_GROWTH, false);
- setFeature(TOLERATE_DUPLICATES, false);
-
- // add default recognized properties
-
- final String[] recognizedProperties = {
- // NOTE: These shouldn't really be here but since the XML Schema
- // validator is constructed dynamically, its recognized
- // properties might not have been set and it would cause a
- // not-recognized exception to be thrown. -Ac
- SCHEMA_LOCATION,
- SCHEMA_NONS_LOCATION,
- SCHEMA_DV_FACTORY,
- };
-
- addRecognizedProperties(recognizedProperties);
-
- } // <init>(SymbolTable,XMLGrammarPool)
-
- //
- // Public methods
- //
-
- /** Configures the pipeline. */
- protected void configurePipeline() {
- super.configurePipeline();
- if ( getFeature(XMLSCHEMA_VALIDATION )) {
- // If schema validator was not in the pipeline insert it.
- if (fSchemaValidator == null) {
- fSchemaValidator = new XMLSchemaValidator();
-
- // add schema component
- fProperties.put(SCHEMA_VALIDATOR, fSchemaValidator);
- addComponent(fSchemaValidator);
- // add schema message formatter
- if (fErrorReporter.getMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN) == null) {
- XSMessageFormatter xmft = new XSMessageFormatter();
- fErrorReporter.putMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN, xmft);
- }
-
- }
- fLastComponent = fSchemaValidator;
- fNamespaceBinder.setDocumentHandler(fSchemaValidator);
-
- fSchemaValidator.setDocumentHandler(fDocumentHandler);
- fSchemaValidator.setDocumentSource(fNamespaceBinder);
- }
-
-
- } // configurePipeline()
-
- // features and properties
-
- /**
- * Check a feature. If feature is know and supported, this method simply
- * returns. Otherwise, the appropriate exception is thrown.
- *
- * @param featureId The unique identifier (URI) of the feature.
- *
- * @throws XMLConfigurationException Thrown for configuration error.
- * In general, components should
- * only throw this exception if
- * it is <strong>really</strong>
- * a critical error.
- */
- protected FeatureState checkFeature(String featureId)
- throws XMLConfigurationException {
-
- //
- // Xerces Features
- //
-
- if (featureId.startsWith(Constants.XERCES_FEATURE_PREFIX)) {
- final int suffixLength = featureId.length() - Constants.XERCES_FEATURE_PREFIX.length();
-
- //
- // http://apache.org/xml/features/validation/schema
- // Lets the user turn Schema validation support on/off.
- //
- if (suffixLength == Constants.SCHEMA_VALIDATION_FEATURE.length() &&
- featureId.endsWith(Constants.SCHEMA_VALIDATION_FEATURE)) {
- return FeatureState.RECOGNIZED;
- }
- // activate full schema checking
- if (suffixLength == Constants.SCHEMA_FULL_CHECKING.length() &&
- featureId.endsWith(Constants.SCHEMA_FULL_CHECKING)) {
- return FeatureState.RECOGNIZED;
- }
- // Feature identifier: expose schema normalized value
- // http://apache.org/xml/features/validation/schema/normalized-value
- if (suffixLength == Constants.SCHEMA_NORMALIZED_VALUE.length() &&
- featureId.endsWith(Constants.SCHEMA_NORMALIZED_VALUE)) {
- return FeatureState.RECOGNIZED;
- }
- // Feature identifier: send element default value via characters()
- // http://apache.org/xml/features/validation/schema/element-default
- if (suffixLength == Constants.SCHEMA_ELEMENT_DEFAULT.length() &&
- featureId.endsWith(Constants.SCHEMA_ELEMENT_DEFAULT)) {
- return FeatureState.RECOGNIZED;
- }
- }
-
- //
- // Not recognized
- //
-
- return super.checkFeature(featureId);
-
- } // checkFeature(String)
-
- /**
- * Check a property. If the property is know and supported, this method
- * simply returns. Otherwise, the appropriate exception is thrown.
- *
- * @param propertyId The unique identifier (URI) of the property
- * being set.
- *
- * @throws XMLConfigurationException Thrown for configuration error.
- * In general, components should
- * only throw this exception if
- * it is <strong>really</strong>
- * a critical error.
- */
- protected PropertyState checkProperty(String propertyId)
- throws XMLConfigurationException {
-
- //
- // Xerces Properties
- //
-
- if (propertyId.startsWith(Constants.XERCES_PROPERTY_PREFIX)) {
- final int suffixLength = propertyId.length() - Constants.XERCES_PROPERTY_PREFIX.length();
-
- if (suffixLength == Constants.SCHEMA_LOCATION.length() &&
- propertyId.endsWith(Constants.SCHEMA_LOCATION)) {
- return PropertyState.RECOGNIZED;
- }
- if (suffixLength == Constants.SCHEMA_NONS_LOCATION.length() &&
- propertyId.endsWith(Constants.SCHEMA_NONS_LOCATION)) {
- return PropertyState.RECOGNIZED;
- }
- }
-
- if (propertyId.startsWith(Constants.JAXP_PROPERTY_PREFIX)) {
- final int suffixLength = propertyId.length() - Constants.JAXP_PROPERTY_PREFIX.length();
-
- if (suffixLength == Constants.SCHEMA_SOURCE.length() &&
- propertyId.endsWith(Constants.SCHEMA_SOURCE)) {
- return PropertyState.RECOGNIZED;
- }
- }
-
- //
- // Not recognized
- //
-
- return super.checkProperty(propertyId);
-
- } // checkProperty(String)
-
-} // class StandardParserConfiguration
diff --git a/src/com/sun/org/apache/xerces/internal/parsers/XIncludeAwareParserConfiguration.java b/src/com/sun/org/apache/xerces/internal/parsers/XIncludeAwareParserConfiguration.java
deleted file mode 100644
index 5b795e5..0000000
--- a/src/com/sun/org/apache/xerces/internal/parsers/XIncludeAwareParserConfiguration.java
+++ /dev/null
@@ -1,297 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.parsers;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.util.FeatureState;
-import com.sun.org.apache.xerces.internal.util.NamespaceSupport;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.xinclude.XIncludeHandler;
-import com.sun.org.apache.xerces.internal.xinclude.XIncludeNamespaceSupport;
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource;
-
-/**
- * This class is the configuration used to parse XML 1.0 and XML 1.1 documents
- * and provides support for XInclude. This is the default Xerces configuration.
- *
- * @author Michael Glavassevich, IBM
- *
- * @version $Id: XIncludeAwareParserConfiguration.java,v 1.5 2010-11-01 04:40:10 joehw Exp $
- */
-public class XIncludeAwareParserConfiguration extends XML11Configuration {
-
- /** Feature identifier: allow notation and unparsed entity events to be sent out of order. */
- protected static final String ALLOW_UE_AND_NOTATION_EVENTS =
- Constants.SAX_FEATURE_PREFIX + Constants.ALLOW_DTD_EVENTS_AFTER_ENDDTD_FEATURE;
-
- /** Feature identifier: fixup base URIs. */
- protected static final String XINCLUDE_FIXUP_BASE_URIS =
- Constants.XERCES_FEATURE_PREFIX + Constants.XINCLUDE_FIXUP_BASE_URIS_FEATURE;
-
- /** Feature identifier: fixup language. */
- protected static final String XINCLUDE_FIXUP_LANGUAGE =
- Constants.XERCES_FEATURE_PREFIX + Constants.XINCLUDE_FIXUP_LANGUAGE_FEATURE;
-
- /** Feature identifier: XInclude processing */
- protected static final String XINCLUDE_FEATURE =
- Constants.XERCES_FEATURE_PREFIX + Constants.XINCLUDE_FEATURE;
-
- /** Property identifier: error reporter. */
- protected static final String XINCLUDE_HANDLER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.XINCLUDE_HANDLER_PROPERTY;
-
- /** Property identifier: error reporter. */
- protected static final String NAMESPACE_CONTEXT =
- Constants.XERCES_PROPERTY_PREFIX + Constants.NAMESPACE_CONTEXT_PROPERTY;
-
- //
- // Components
- //
-
- /** XInclude handler. */
- protected XIncludeHandler fXIncludeHandler;
-
- /** Non-XInclude NamespaceContext. */
- protected NamespaceSupport fNonXIncludeNSContext;
-
- /** XInclude NamespaceContext. */
- protected XIncludeNamespaceSupport fXIncludeNSContext;
-
- /** Current NamespaceContext. */
- protected NamespaceContext fCurrentNSContext;
-
- /** Flag indicating whether XInclude processsing is enabled. */
- protected boolean fXIncludeEnabled = false;
-
- /** Default constructor. */
- public XIncludeAwareParserConfiguration() {
- this(null, null, null);
- } // <init>()
-
- /**
- * Constructs a parser configuration using the specified symbol table.
- *
- * @param symbolTable The symbol table to use.
- */
- public XIncludeAwareParserConfiguration(SymbolTable symbolTable) {
- this(symbolTable, null, null);
- } // <init>(SymbolTable)
-
- /**
- * Constructs a parser configuration using the specified symbol table and
- * grammar pool.
- * <p>
- *
- * @param symbolTable The symbol table to use.
- * @param grammarPool The grammar pool to use.
- */
- public XIncludeAwareParserConfiguration(
- SymbolTable symbolTable,
- XMLGrammarPool grammarPool) {
- this(symbolTable, grammarPool, null);
- } // <init>(SymbolTable,XMLGrammarPool)
-
- /**
- * Constructs a parser configuration using the specified symbol table,
- * grammar pool, and parent settings.
- * <p>
- *
- * @param symbolTable The symbol table to use.
- * @param grammarPool The grammar pool to use.
- * @param parentSettings The parent settings.
- */
- public XIncludeAwareParserConfiguration(
- SymbolTable symbolTable,
- XMLGrammarPool grammarPool,
- XMLComponentManager parentSettings) {
- super(symbolTable, grammarPool, parentSettings);
-
- final String[] recognizedFeatures = {
- ALLOW_UE_AND_NOTATION_EVENTS,
- XINCLUDE_FIXUP_BASE_URIS,
- XINCLUDE_FIXUP_LANGUAGE
- };
- addRecognizedFeatures(recognizedFeatures);
-
- // add default recognized properties
- final String[] recognizedProperties =
- { XINCLUDE_HANDLER, NAMESPACE_CONTEXT };
- addRecognizedProperties(recognizedProperties);
-
- setFeature(ALLOW_UE_AND_NOTATION_EVENTS, true);
- setFeature(XINCLUDE_FIXUP_BASE_URIS, true);
- setFeature(XINCLUDE_FIXUP_LANGUAGE, true);
-
- fNonXIncludeNSContext = new NamespaceSupport();
- fCurrentNSContext = fNonXIncludeNSContext;
- setProperty(NAMESPACE_CONTEXT, fNonXIncludeNSContext);
- }
-
-
- /** Configures the pipeline. */
- protected void configurePipeline() {
- super.configurePipeline();
- if (fXIncludeEnabled) {
- // If the XInclude handler was not in the pipeline insert it.
- if (fXIncludeHandler == null) {
- fXIncludeHandler = new XIncludeHandler();
- // add XInclude component
- setProperty(XINCLUDE_HANDLER, fXIncludeHandler);
- addCommonComponent(fXIncludeHandler);
- fXIncludeHandler.reset(this);
- }
- // Setup NamespaceContext
- if (fCurrentNSContext != fXIncludeNSContext) {
- if (fXIncludeNSContext == null) {
- fXIncludeNSContext = new XIncludeNamespaceSupport();
- }
- fCurrentNSContext = fXIncludeNSContext;
- setProperty(NAMESPACE_CONTEXT, fXIncludeNSContext);
- }
- //configure DTD pipeline
- fDTDScanner.setDTDHandler(fDTDProcessor);
- fDTDProcessor.setDTDSource(fDTDScanner);
- fDTDProcessor.setDTDHandler(fXIncludeHandler);
- fXIncludeHandler.setDTDSource(fDTDProcessor);
- fXIncludeHandler.setDTDHandler(fDTDHandler);
- if (fDTDHandler != null) {
- fDTDHandler.setDTDSource(fXIncludeHandler);
- }
-
- // configure XML document pipeline: insert after DTDValidator and
- // before XML Schema validator
- XMLDocumentSource prev = null;
- if (fFeatures.get(XMLSCHEMA_VALIDATION) == Boolean.TRUE) {
- // we don't have to worry about fSchemaValidator being null, since
- // super.configurePipeline() instantiated it if the feature was set
- prev = fSchemaValidator.getDocumentSource();
- }
- // Otherwise, insert after the last component in the pipeline
- else {
- prev = fLastComponent;
- fLastComponent = fXIncludeHandler;
- }
-
- XMLDocumentHandler next = prev.getDocumentHandler();
- prev.setDocumentHandler(fXIncludeHandler);
- fXIncludeHandler.setDocumentSource(prev);
- if (next != null) {
- fXIncludeHandler.setDocumentHandler(next);
- next.setDocumentSource(fXIncludeHandler);
- }
- }
- else {
- // Setup NamespaceContext
- if (fCurrentNSContext != fNonXIncludeNSContext) {
- fCurrentNSContext = fNonXIncludeNSContext;
- setProperty(NAMESPACE_CONTEXT, fNonXIncludeNSContext);
- }
- }
- } // configurePipeline()
-
- protected void configureXML11Pipeline() {
- super.configureXML11Pipeline();
- if (fXIncludeEnabled) {
- // If the XInclude handler was not in the pipeline insert it.
- if (fXIncludeHandler == null) {
- fXIncludeHandler = new XIncludeHandler();
- // add XInclude component
- setProperty(XINCLUDE_HANDLER, fXIncludeHandler);
- addCommonComponent(fXIncludeHandler);
- fXIncludeHandler.reset(this);
- }
- // Setup NamespaceContext
- if (fCurrentNSContext != fXIncludeNSContext) {
- if (fXIncludeNSContext == null) {
- fXIncludeNSContext = new XIncludeNamespaceSupport();
- }
- fCurrentNSContext = fXIncludeNSContext;
- setProperty(NAMESPACE_CONTEXT, fXIncludeNSContext);
- }
- // configure XML 1.1. DTD pipeline
- fXML11DTDScanner.setDTDHandler(fXML11DTDProcessor);
- fXML11DTDProcessor.setDTDSource(fXML11DTDScanner);
- fXML11DTDProcessor.setDTDHandler(fXIncludeHandler);
- fXIncludeHandler.setDTDSource(fXML11DTDProcessor);
- fXIncludeHandler.setDTDHandler(fDTDHandler);
- if (fDTDHandler != null) {
- fDTDHandler.setDTDSource(fXIncludeHandler);
- }
-
- // configure XML document pipeline: insert after DTDValidator and
- // before XML Schema validator
- XMLDocumentSource prev = null;
- if (fFeatures.get(XMLSCHEMA_VALIDATION) == Boolean.TRUE) {
- // we don't have to worry about fSchemaValidator being null, since
- // super.configurePipeline() instantiated it if the feature was set
- prev = fSchemaValidator.getDocumentSource();
- }
- // Otherwise, insert after the last component in the pipeline
- else {
- prev = fLastComponent;
- fLastComponent = fXIncludeHandler;
- }
-
- XMLDocumentHandler next = prev.getDocumentHandler();
- prev.setDocumentHandler(fXIncludeHandler);
- fXIncludeHandler.setDocumentSource(prev);
- if (next != null) {
- fXIncludeHandler.setDocumentHandler(next);
- next.setDocumentSource(fXIncludeHandler);
- }
- }
- else {
- // Setup NamespaceContext
- if (fCurrentNSContext != fNonXIncludeNSContext) {
- fCurrentNSContext = fNonXIncludeNSContext;
- setProperty(NAMESPACE_CONTEXT, fNonXIncludeNSContext);
- }
- }
- } // configureXML11Pipeline()
-
- public FeatureState getFeatureState(String featureId)
- throws XMLConfigurationException {
- if (featureId.equals(PARSER_SETTINGS)) {
- return FeatureState.is(fConfigUpdated);
- }
- else if (featureId.equals(XINCLUDE_FEATURE)) {
- return FeatureState.is(fXIncludeEnabled);
- }
- return super.getFeatureState0(featureId);
-
- } // getFeature(String):boolean
-
- public void setFeature(String featureId, boolean state)
- throws XMLConfigurationException {
- if (featureId.equals(XINCLUDE_FEATURE)) {
- fXIncludeEnabled = state;
- fConfigUpdated = true;
- return;
- }
- super.setFeature(featureId,state);
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/parsers/XIncludeParserConfiguration.java b/src/com/sun/org/apache/xerces/internal/parsers/XIncludeParserConfiguration.java
deleted file mode 100644
index 29c18fa..0000000
--- a/src/com/sun/org/apache/xerces/internal/parsers/XIncludeParserConfiguration.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xerces.internal.parsers;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.xinclude.XIncludeHandler;
-import com.sun.org.apache.xerces.internal.xinclude.XIncludeNamespaceSupport;
-import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource;
-
-/**
- * This parser configuration includes an <code>XIncludeHandler</code> in the pipeline
- * before the schema validator, or as the last component in the pipeline if there is
- * no schema validator. Using this pipeline will enable processing according to the
- * XML Inclusions specification, to the conformance level described in
- * <code>XIncludeHandler</code>.
- *
- * @author Peter McCracken, IBM
- * @see com.sun.org.apache.xerces.internal.xinclude.XIncludeHandler
- */
-public class XIncludeParserConfiguration extends XML11Configuration {
-
- private XIncludeHandler fXIncludeHandler;
-
- /** Feature identifier: allow notation and unparsed entity events to be sent out of order. */
- protected static final String ALLOW_UE_AND_NOTATION_EVENTS =
- Constants.SAX_FEATURE_PREFIX + Constants.ALLOW_DTD_EVENTS_AFTER_ENDDTD_FEATURE;
-
- /** Feature identifier: fixup base URIs. */
- protected static final String XINCLUDE_FIXUP_BASE_URIS =
- Constants.XERCES_FEATURE_PREFIX + Constants.XINCLUDE_FIXUP_BASE_URIS_FEATURE;
-
- /** Feature identifier: fixup language. */
- protected static final String XINCLUDE_FIXUP_LANGUAGE =
- Constants.XERCES_FEATURE_PREFIX + Constants.XINCLUDE_FIXUP_LANGUAGE_FEATURE;
-
- /** Property identifier: error reporter. */
- protected static final String XINCLUDE_HANDLER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.XINCLUDE_HANDLER_PROPERTY;
-
- /** Property identifier: error reporter. */
- protected static final String NAMESPACE_CONTEXT =
- Constants.XERCES_PROPERTY_PREFIX + Constants.NAMESPACE_CONTEXT_PROPERTY;
-
- /** Default constructor. */
- public XIncludeParserConfiguration() {
- this(null, null, null);
- } // <init>()
-
- /**
- * Constructs a parser configuration using the specified symbol table.
- *
- * @param symbolTable The symbol table to use.
- */
- public XIncludeParserConfiguration(SymbolTable symbolTable) {
- this(symbolTable, null, null);
- } // <init>(SymbolTable)
-
- /**
- * Constructs a parser configuration using the specified symbol table and
- * grammar pool.
- * <p>
- *
- * @param symbolTable The symbol table to use.
- * @param grammarPool The grammar pool to use.
- */
- public XIncludeParserConfiguration(
- SymbolTable symbolTable,
- XMLGrammarPool grammarPool) {
- this(symbolTable, grammarPool, null);
- } // <init>(SymbolTable,XMLGrammarPool)
-
- /**
- * Constructs a parser configuration using the specified symbol table,
- * grammar pool, and parent settings.
- * <p>
- *
- * @param symbolTable The symbol table to use.
- * @param grammarPool The grammar pool to use.
- * @param parentSettings The parent settings.
- */
- public XIncludeParserConfiguration(
- SymbolTable symbolTable,
- XMLGrammarPool grammarPool,
- XMLComponentManager parentSettings) {
- super(symbolTable, grammarPool, parentSettings);
-
- fXIncludeHandler = new XIncludeHandler();
- addCommonComponent(fXIncludeHandler);
-
- final String[] recognizedFeatures = {
- ALLOW_UE_AND_NOTATION_EVENTS,
- XINCLUDE_FIXUP_BASE_URIS,
- XINCLUDE_FIXUP_LANGUAGE
- };
- addRecognizedFeatures(recognizedFeatures);
-
- // add default recognized properties
- final String[] recognizedProperties =
- { XINCLUDE_HANDLER, NAMESPACE_CONTEXT };
- addRecognizedProperties(recognizedProperties);
-
- setFeature(ALLOW_UE_AND_NOTATION_EVENTS, true);
- setFeature(XINCLUDE_FIXUP_BASE_URIS, true);
- setFeature(XINCLUDE_FIXUP_LANGUAGE, true);
-
- setProperty(XINCLUDE_HANDLER, fXIncludeHandler);
- setProperty(NAMESPACE_CONTEXT, new XIncludeNamespaceSupport());
- } // <init>(SymbolTable,XMLGrammarPool)}
-
-
- /** Configures the pipeline. */
- protected void configurePipeline() {
- super.configurePipeline();
-
- //configure DTD pipeline
- fDTDScanner.setDTDHandler(fDTDProcessor);
- fDTDProcessor.setDTDSource(fDTDScanner);
- fDTDProcessor.setDTDHandler(fXIncludeHandler);
- fXIncludeHandler.setDTDSource(fDTDProcessor);
- fXIncludeHandler.setDTDHandler(fDTDHandler);
- if (fDTDHandler != null) {
- fDTDHandler.setDTDSource(fXIncludeHandler);
- }
-
- // configure XML document pipeline: insert after DTDValidator and
- // before XML Schema validator
- XMLDocumentSource prev = null;
- if (fFeatures.get(XMLSCHEMA_VALIDATION) == Boolean.TRUE) {
- // we don't have to worry about fSchemaValidator being null, since
- // super.configurePipeline() instantiated it if the feature was set
- prev = fSchemaValidator.getDocumentSource();
- }
- // Otherwise, insert after the last component in the pipeline
- else {
- prev = fLastComponent;
- fLastComponent = fXIncludeHandler;
- }
-
- if (prev != null) {
- XMLDocumentHandler next = prev.getDocumentHandler();
- prev.setDocumentHandler(fXIncludeHandler);
- fXIncludeHandler.setDocumentSource(prev);
- if (next != null) {
- fXIncludeHandler.setDocumentHandler(next);
- next.setDocumentSource(fXIncludeHandler);
- }
- }
- else {
- setDocumentHandler(fXIncludeHandler);
- }
-
- } // configurePipeline()
-
- protected void configureXML11Pipeline() {
- super.configureXML11Pipeline();
-
- // configure XML 1.1. DTD pipeline
- fXML11DTDScanner.setDTDHandler(fXML11DTDProcessor);
- fXML11DTDProcessor.setDTDSource(fXML11DTDScanner);
- fXML11DTDProcessor.setDTDHandler(fXIncludeHandler);
- fXIncludeHandler.setDTDSource(fXML11DTDProcessor);
- fXIncludeHandler.setDTDHandler(fDTDHandler);
- if (fDTDHandler != null) {
- fDTDHandler.setDTDSource(fXIncludeHandler);
- }
-
- // configure XML document pipeline: insert after DTDValidator and
- // before XML Schema validator
- XMLDocumentSource prev = null;
- if (fFeatures.get(XMLSCHEMA_VALIDATION) == Boolean.TRUE) {
- // we don't have to worry about fSchemaValidator being null, since
- // super.configurePipeline() instantiated it if the feature was set
- prev = fSchemaValidator.getDocumentSource();
- }
- // Otherwise, insert after the last component in the pipeline
- else {
- prev = fLastComponent;
- fLastComponent = fXIncludeHandler;
- }
-
- XMLDocumentHandler next = prev.getDocumentHandler();
- prev.setDocumentHandler(fXIncludeHandler);
- fXIncludeHandler.setDocumentSource(prev);
- if (next != null) {
- fXIncludeHandler.setDocumentHandler(next);
- next.setDocumentSource(fXIncludeHandler);
- }
-
- } // configureXML11Pipeline()
-
- public void setProperty(String propertyId, Object value)
- throws XMLConfigurationException {
-
- if (propertyId.equals(XINCLUDE_HANDLER)) {
- }
-
- super.setProperty(propertyId, value);
- } // setProperty(String,Object)
-}
diff --git a/src/com/sun/org/apache/xerces/internal/parsers/XML11Configurable.java b/src/com/sun/org/apache/xerces/internal/parsers/XML11Configurable.java
deleted file mode 100644
index 7b5387a..0000000
--- a/src/com/sun/org/apache/xerces/internal/parsers/XML11Configurable.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.parsers;
-
-/**
- * <p>An <code>XMLParserConfiguration</code> implements this interface
- * in order to indicate that it provides support for XML 1.1.</p>
- *
- * @author Michael Glavassevich, IBM
- *
- */
-public interface XML11Configurable {}
diff --git a/src/com/sun/org/apache/xerces/internal/parsers/XML11Configuration.java b/src/com/sun/org/apache/xerces/internal/parsers/XML11Configuration.java
deleted file mode 100644
index ac84e1e..0000000
--- a/src/com/sun/org/apache/xerces/internal/parsers/XML11Configuration.java
+++ /dev/null
@@ -1,1562 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.parsers;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Locale;
-import javax.xml.XMLConstants;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.XML11DTDScannerImpl;
-import com.sun.org.apache.xerces.internal.impl.XML11DocumentScannerImpl;
-import com.sun.org.apache.xerces.internal.impl.XML11NSDocumentScannerImpl;
-import com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl;
-import com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl;
-import com.sun.org.apache.xerces.internal.impl.XMLEntityHandler;
-import com.sun.org.apache.xerces.internal.impl.XMLEntityManager;
-import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
-import com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl;
-import com.sun.org.apache.xerces.internal.impl.XMLVersionDetector;
-import com.sun.org.apache.xerces.internal.impl.dtd.XML11DTDProcessor;
-import com.sun.org.apache.xerces.internal.impl.dtd.XML11DTDValidator;
-import com.sun.org.apache.xerces.internal.impl.dtd.XML11NSDTDValidator;
-import com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDProcessor;
-import com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator;
-import com.sun.org.apache.xerces.internal.impl.dtd.XMLNSDTDValidator;
-import com.sun.org.apache.xerces.internal.impl.dv.DTDDVFactory;
-import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter;
-import com.sun.org.apache.xerces.internal.impl.validation.ValidationManager;
-import com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator;
-import com.sun.org.apache.xerces.internal.impl.xs.XSMessageFormatter;
-import com.sun.org.apache.xerces.internal.util.FeatureState;
-import com.sun.org.apache.xerces.internal.util.ParserConfigurationSettings;
-import com.sun.org.apache.xerces.internal.util.PropertyState;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager;
-import com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLDTDHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLLocator;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponent;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDScanner;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentScanner;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLEntityResolver;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLPullParserConfiguration;
-
-/**
- * This class is the configuration used to parse XML 1.0 and XML 1.1 documents.
- *
- * @author Elena Litani, IBM
- * @author Neil Graham, IBM
- * @author Michael Glavassevich, IBM
- *
- * @version $Id: XML11Configuration.java,v 1.9 2010-11-01 04:40:10 joehw Exp $
- */
-public class XML11Configuration extends ParserConfigurationSettings
- implements XMLPullParserConfiguration, XML11Configurable {
-
- //
- // Constants
- //
- protected final static String XML11_DATATYPE_VALIDATOR_FACTORY =
- "com.sun.org.apache.xerces.internal.impl.dv.dtd.XML11DTDDVFactoryImpl";
-
- // feature identifiers
-
- /** Feature identifier: warn on duplicate attribute definition. */
- protected static final String WARN_ON_DUPLICATE_ATTDEF =
- Constants.XERCES_FEATURE_PREFIX + Constants.WARN_ON_DUPLICATE_ATTDEF_FEATURE;
-
- /** Feature identifier: warn on duplicate entity definition. */
- protected static final String WARN_ON_DUPLICATE_ENTITYDEF =
- Constants.XERCES_FEATURE_PREFIX + Constants.WARN_ON_DUPLICATE_ENTITYDEF_FEATURE;
-
- /** Feature identifier: warn on undeclared element definition. */
- protected static final String WARN_ON_UNDECLARED_ELEMDEF =
- Constants.XERCES_FEATURE_PREFIX + Constants.WARN_ON_UNDECLARED_ELEMDEF_FEATURE;
-
- /** Feature identifier: allow Java encodings. */
- protected static final String ALLOW_JAVA_ENCODINGS =
- Constants.XERCES_FEATURE_PREFIX + Constants.ALLOW_JAVA_ENCODINGS_FEATURE;
-
- /** Feature identifier: continue after fatal error. */
- protected static final String CONTINUE_AFTER_FATAL_ERROR =
- Constants.XERCES_FEATURE_PREFIX + Constants.CONTINUE_AFTER_FATAL_ERROR_FEATURE;
-
- /** Feature identifier: load external DTD. */
- protected static final String LOAD_EXTERNAL_DTD =
- Constants.XERCES_FEATURE_PREFIX + Constants.LOAD_EXTERNAL_DTD_FEATURE;
-
- /** Feature identifier: notify built-in refereces. */
- protected static final String NOTIFY_BUILTIN_REFS =
- Constants.XERCES_FEATURE_PREFIX + Constants.NOTIFY_BUILTIN_REFS_FEATURE;
-
- /** Feature identifier: notify character refereces. */
- protected static final String NOTIFY_CHAR_REFS =
- Constants.XERCES_FEATURE_PREFIX + Constants.NOTIFY_CHAR_REFS_FEATURE;
-
- /** Feature identifier: expose schema normalized value */
- protected static final String NORMALIZE_DATA =
- Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_NORMALIZED_VALUE;
-
- /** Feature identifier: send element default value via characters() */
- protected static final String SCHEMA_ELEMENT_DEFAULT =
- Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_ELEMENT_DEFAULT;
-
- /** Feature identifier: augment PSVI */
- protected static final String SCHEMA_AUGMENT_PSVI =
- Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_AUGMENT_PSVI;
-
- /** feature identifier: XML Schema validation */
- protected static final String XMLSCHEMA_VALIDATION =
- Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_VALIDATION_FEATURE;
-
- /** feature identifier: XML Schema validation -- full checking */
- protected static final String XMLSCHEMA_FULL_CHECKING =
- Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_FULL_CHECKING;
-
- /** Feature: generate synthetic annotations */
- protected static final String GENERATE_SYNTHETIC_ANNOTATIONS =
- Constants.XERCES_FEATURE_PREFIX + Constants.GENERATE_SYNTHETIC_ANNOTATIONS_FEATURE;
-
- /** Feature identifier: validate annotations */
- protected static final String VALIDATE_ANNOTATIONS =
- Constants.XERCES_FEATURE_PREFIX + Constants.VALIDATE_ANNOTATIONS_FEATURE;
-
- /** Feature identifier: honour all schemaLocations */
- protected static final String HONOUR_ALL_SCHEMALOCATIONS =
- Constants.XERCES_FEATURE_PREFIX + Constants.HONOUR_ALL_SCHEMALOCATIONS_FEATURE;
-
- /** Feature identifier: namespace growth */
- protected static final String NAMESPACE_GROWTH =
- Constants.XERCES_FEATURE_PREFIX + Constants.NAMESPACE_GROWTH_FEATURE;
-
- /** Feature identifier: tolerate duplicates */
- protected static final String TOLERATE_DUPLICATES =
- Constants.XERCES_FEATURE_PREFIX + Constants.TOLERATE_DUPLICATES_FEATURE;
-
- /** Feature identifier: use grammar pool only */
- protected static final String USE_GRAMMAR_POOL_ONLY =
- Constants.XERCES_FEATURE_PREFIX + Constants.USE_GRAMMAR_POOL_ONLY_FEATURE;
-
- // feature identifiers
-
- /** Feature identifier: validation. */
- protected static final String VALIDATION =
- Constants.SAX_FEATURE_PREFIX + Constants.VALIDATION_FEATURE;
-
- /** Feature identifier: namespaces. */
- protected static final String NAMESPACES =
- Constants.SAX_FEATURE_PREFIX + Constants.NAMESPACES_FEATURE;
-
- /** Feature identifier: external general entities. */
- protected static final String EXTERNAL_GENERAL_ENTITIES =
- Constants.SAX_FEATURE_PREFIX + Constants.EXTERNAL_GENERAL_ENTITIES_FEATURE;
-
- /** Feature identifier: external parameter entities. */
- protected static final String EXTERNAL_PARAMETER_ENTITIES =
- Constants.SAX_FEATURE_PREFIX + Constants.EXTERNAL_PARAMETER_ENTITIES_FEATURE;
-
- // property identifiers
-
- /** Property identifier: xml string. */
- protected static final String XML_STRING =
- Constants.SAX_PROPERTY_PREFIX + Constants.XML_STRING_PROPERTY;
-
- /** Property identifier: symbol table. */
- protected static final String SYMBOL_TABLE =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY;
-
- /** Property identifier: error handler. */
- protected static final String ERROR_HANDLER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_HANDLER_PROPERTY;
-
- /** Property identifier: entity resolver. */
- protected static final String ENTITY_RESOLVER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_RESOLVER_PROPERTY;
-
- /** Property identifier: XML Schema validator. */
- protected static final String SCHEMA_VALIDATOR =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SCHEMA_VALIDATOR_PROPERTY;
-
- /** Property identifier: schema location. */
- protected static final String SCHEMA_LOCATION =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SCHEMA_LOCATION;
-
- /** Property identifier: no namespace schema location. */
- protected static final String SCHEMA_NONS_LOCATION =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SCHEMA_NONS_LOCATION;
-
- /** Property identifier: error reporter. */
- protected static final String ERROR_REPORTER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY;
-
- /** Property identifier: entity manager. */
- protected static final String ENTITY_MANAGER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_MANAGER_PROPERTY;
-
- /** Property identifier document scanner: */
- protected static final String DOCUMENT_SCANNER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.DOCUMENT_SCANNER_PROPERTY;
-
- /** Property identifier: DTD scanner. */
- protected static final String DTD_SCANNER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.DTD_SCANNER_PROPERTY;
-
- /** Property identifier: grammar pool. */
- protected static final String XMLGRAMMAR_POOL =
- Constants.XERCES_PROPERTY_PREFIX + Constants.XMLGRAMMAR_POOL_PROPERTY;
-
- /** Property identifier: DTD loader. */
- protected static final String DTD_PROCESSOR =
- Constants.XERCES_PROPERTY_PREFIX + Constants.DTD_PROCESSOR_PROPERTY;
-
- /** Property identifier: DTD validator. */
- protected static final String DTD_VALIDATOR =
- Constants.XERCES_PROPERTY_PREFIX + Constants.DTD_VALIDATOR_PROPERTY;
-
- /** Property identifier: namespace binder. */
- protected static final String NAMESPACE_BINDER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.NAMESPACE_BINDER_PROPERTY;
-
- /** Property identifier: datatype validator factory. */
- protected static final String DATATYPE_VALIDATOR_FACTORY =
- Constants.XERCES_PROPERTY_PREFIX + Constants.DATATYPE_VALIDATOR_FACTORY_PROPERTY;
-
- protected static final String VALIDATION_MANAGER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.VALIDATION_MANAGER_PROPERTY;
-
- /** Property identifier: JAXP schema language / DOM schema-type. */
- protected static final String JAXP_SCHEMA_LANGUAGE =
- Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_LANGUAGE;
-
- /** Property identifier: JAXP schema source/ DOM schema-location. */
- protected static final String JAXP_SCHEMA_SOURCE =
- Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_SOURCE;
-
- /** Property identifier: locale. */
- protected static final String LOCALE =
- Constants.XERCES_PROPERTY_PREFIX + Constants.LOCALE_PROPERTY;
-
- /** Property identifier: Schema DV Factory */
- protected static final String SCHEMA_DV_FACTORY =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SCHEMA_DV_FACTORY_PROPERTY;
-
- /** Property identifier: Security property manager. */
- private static final String XML_SECURITY_PROPERTY_MANAGER =
- Constants.XML_SECURITY_PROPERTY_MANAGER;
-
- /** Property identifier: Security manager. */
- private static final String SECURITY_MANAGER = Constants.SECURITY_MANAGER;
-
- // debugging
-
- /** Set to true and recompile to print exception stack trace. */
- protected static final boolean PRINT_EXCEPTION_STACK_TRACE = false;
-
- //
- // Data
- //
-
- protected SymbolTable fSymbolTable;
- protected XMLInputSource fInputSource;
- protected ValidationManager fValidationManager;
- protected XMLVersionDetector fVersionDetector;
- protected XMLLocator fLocator;
- protected Locale fLocale;
-
- /** XML 1.0 Components. */
- protected ArrayList<XMLComponent> fComponents;
-
- /** XML 1.1. Components. */
- protected ArrayList<XMLComponent> fXML11Components = null;
-
- /** Common components: XMLEntityManager, XMLErrorReporter, XMLSchemaValidator */
- protected ArrayList<XMLComponent> fCommonComponents = null;
-
- /** The document handler. */
- protected XMLDocumentHandler fDocumentHandler;
-
- /** The DTD handler. */
- protected XMLDTDHandler fDTDHandler;
-
- /** The DTD content model handler. */
- protected XMLDTDContentModelHandler fDTDContentModelHandler;
-
- /** Last component in the document pipeline */
- protected XMLDocumentSource fLastComponent;
-
- /**
- * True if a parse is in progress. This state is needed because
- * some features/properties cannot be set while parsing (e.g.
- * validation and namespaces).
- */
- protected boolean fParseInProgress = false;
-
- /** fConfigUpdated is set to true if there has been any change to the configuration settings,
- * i.e a feature or a property was changed.
- */
- protected boolean fConfigUpdated = false;
-
- //
- // XML 1.0 components
- //
-
- /** The XML 1.0 Datatype validator factory. */
- protected DTDDVFactory fDatatypeValidatorFactory;
-
- /** The XML 1.0 Document scanner that does namespace binding. */
- protected XMLNSDocumentScannerImpl fNamespaceScanner;
- /** The XML 1.0 Non-namespace implementation of scanner */
- protected XMLDocumentScannerImpl fNonNSScanner;
- /** The XML 1.0 DTD Validator: binds namespaces */
- protected XMLDTDValidator fDTDValidator;
- /** The XML 1.0 DTD Validator that does not bind namespaces */
- protected XMLDTDValidator fNonNSDTDValidator;
- /** The XML 1.0 DTD scanner. */
- protected XMLDTDScanner fDTDScanner;
- /** The XML 1.0 DTD Processor . */
- protected XMLDTDProcessor fDTDProcessor;
-
- //
- // XML 1.1 components
- //
-
- /** The XML 1.1 datatype factory. **/
- protected DTDDVFactory fXML11DatatypeFactory = null;
-
- /** The XML 1.1 document scanner that does namespace binding. **/
- protected XML11NSDocumentScannerImpl fXML11NSDocScanner = null;
-
- /** The XML 1.1 document scanner that does not do namespace binding. **/
- protected XML11DocumentScannerImpl fXML11DocScanner = null;
-
- /** The XML 1.1 DTD validator that does namespace binding. **/
- protected XML11NSDTDValidator fXML11NSDTDValidator = null;
-
- /** The XML 1.1 DTD validator that does not do namespace binding. **/
- protected XML11DTDValidator fXML11DTDValidator = null;
-
- /** The XML 1.1 DTD scanner. **/
- protected XML11DTDScannerImpl fXML11DTDScanner = null;
- /** The XML 1.1 DTD processor. **/
- protected XML11DTDProcessor fXML11DTDProcessor = null;
-
- //
- // Common components
- //
-
- /** Grammar pool. */
- protected XMLGrammarPool fGrammarPool;
-
- /** Error reporter. */
- protected XMLErrorReporter fErrorReporter;
-
- /** Entity manager. */
- protected XMLEntityManager fEntityManager;
-
- /** XML Schema Validator. */
- protected XMLSchemaValidator fSchemaValidator;
-
- /** Current scanner */
- protected XMLDocumentScanner fCurrentScanner;
- /** Current Datatype validator factory. */
- protected DTDDVFactory fCurrentDVFactory;
- /** Current DTD scanner. */
- protected XMLDTDScanner fCurrentDTDScanner;
-
- /** Flag indiciating whether XML11 components have been initialized. */
- private boolean f11Initialized = false;
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- public XML11Configuration() {
- this(null, null, null);
- } // <init>()
-
- /**
- * Constructs a parser configuration using the specified symbol table.
- *
- * @param symbolTable The symbol table to use.
- */
- public XML11Configuration(SymbolTable symbolTable) {
- this(symbolTable, null, null);
- } // <init>(SymbolTable)
-
- /**
- * Constructs a parser configuration using the specified symbol table and
- * grammar pool.
- * <p>
- * <strong>REVISIT:</strong>
- * Grammar pool will be updated when the new validation engine is
- * implemented.
- *
- * @param symbolTable The symbol table to use.
- * @param grammarPool The grammar pool to use.
- */
- public XML11Configuration(SymbolTable symbolTable, XMLGrammarPool grammarPool) {
- this(symbolTable, grammarPool, null);
- } // <init>(SymbolTable,XMLGrammarPool)
-
- /**
- * Constructs a parser configuration using the specified symbol table,
- * grammar pool, and parent settings.
- * <p>
- * <strong>REVISIT:</strong>
- * Grammar pool will be updated when the new validation engine is
- * implemented.
- *
- * @param symbolTable The symbol table to use.
- * @param grammarPool The grammar pool to use.
- * @param parentSettings The parent settings.
- */
- public XML11Configuration(
- SymbolTable symbolTable,
- XMLGrammarPool grammarPool,
- XMLComponentManager parentSettings) {
-
- super(parentSettings);
-
- // create a vector to hold all the components in use
- // XML 1.0 specialized components
- fComponents = new ArrayList<>();
- // XML 1.1 specialized components
- fXML11Components = new ArrayList<>();
- // Common components for XML 1.1. and XML 1.0
- fCommonComponents = new ArrayList<>();
-
- // create table for features and properties
- fFeatures = new HashMap<>();
- fProperties = new HashMap<>();
-
- // add default recognized features
- final String[] recognizedFeatures =
- {
- CONTINUE_AFTER_FATAL_ERROR, LOAD_EXTERNAL_DTD, // from XMLDTDScannerImpl
- VALIDATION,
- NAMESPACES,
- NORMALIZE_DATA, SCHEMA_ELEMENT_DEFAULT, SCHEMA_AUGMENT_PSVI,
- GENERATE_SYNTHETIC_ANNOTATIONS, VALIDATE_ANNOTATIONS,
- HONOUR_ALL_SCHEMALOCATIONS, NAMESPACE_GROWTH,
- TOLERATE_DUPLICATES,
- USE_GRAMMAR_POOL_ONLY,
- // NOTE: These shouldn't really be here but since the XML Schema
- // validator is constructed dynamically, its recognized
- // features might not have been set and it would cause a
- // not-recognized exception to be thrown. -Ac
- XMLSCHEMA_VALIDATION, XMLSCHEMA_FULL_CHECKING,
- EXTERNAL_GENERAL_ENTITIES,
- EXTERNAL_PARAMETER_ENTITIES,
- PARSER_SETTINGS,
- XMLConstants.FEATURE_SECURE_PROCESSING
- };
- addRecognizedFeatures(recognizedFeatures);
- // set state for default features
- fFeatures.put(VALIDATION, Boolean.FALSE);
- fFeatures.put(NAMESPACES, Boolean.TRUE);
- fFeatures.put(EXTERNAL_GENERAL_ENTITIES, Boolean.TRUE);
- fFeatures.put(EXTERNAL_PARAMETER_ENTITIES, Boolean.TRUE);
- fFeatures.put(CONTINUE_AFTER_FATAL_ERROR, Boolean.FALSE);
- fFeatures.put(LOAD_EXTERNAL_DTD, Boolean.TRUE);
- fFeatures.put(SCHEMA_ELEMENT_DEFAULT, Boolean.TRUE);
- fFeatures.put(NORMALIZE_DATA, Boolean.TRUE);
- fFeatures.put(SCHEMA_AUGMENT_PSVI, Boolean.TRUE);
- fFeatures.put(GENERATE_SYNTHETIC_ANNOTATIONS, Boolean.FALSE);
- fFeatures.put(VALIDATE_ANNOTATIONS, Boolean.FALSE);
- fFeatures.put(HONOUR_ALL_SCHEMALOCATIONS, Boolean.FALSE);
- fFeatures.put(NAMESPACE_GROWTH, Boolean.FALSE);
- fFeatures.put(TOLERATE_DUPLICATES, Boolean.FALSE);
- fFeatures.put(USE_GRAMMAR_POOL_ONLY, Boolean.FALSE);
- fFeatures.put(PARSER_SETTINGS, Boolean.TRUE);
- fFeatures.put(XMLConstants.FEATURE_SECURE_PROCESSING, Boolean.TRUE);
-
- // add default recognized properties
- final String[] recognizedProperties =
- {
- SYMBOL_TABLE,
- ERROR_HANDLER,
- ENTITY_RESOLVER,
- ERROR_REPORTER,
- ENTITY_MANAGER,
- DOCUMENT_SCANNER,
- DTD_SCANNER,
- DTD_PROCESSOR,
- DTD_VALIDATOR,
- DATATYPE_VALIDATOR_FACTORY,
- VALIDATION_MANAGER,
- SCHEMA_VALIDATOR,
- XML_STRING,
- XMLGRAMMAR_POOL,
- JAXP_SCHEMA_SOURCE,
- JAXP_SCHEMA_LANGUAGE,
- // NOTE: These shouldn't really be here but since the XML Schema
- // validator is constructed dynamically, its recognized
- // properties might not have been set and it would cause a
- // not-recognized exception to be thrown. -Ac
- SCHEMA_LOCATION,
- SCHEMA_NONS_LOCATION,
- LOCALE,
- SCHEMA_DV_FACTORY,
- SECURITY_MANAGER,
- XML_SECURITY_PROPERTY_MANAGER
- };
- addRecognizedProperties(recognizedProperties);
-
- if (symbolTable == null) {
- symbolTable = new SymbolTable();
- }
- fSymbolTable = symbolTable;
- fProperties.put(SYMBOL_TABLE, fSymbolTable);
-
- fGrammarPool = grammarPool;
- if (fGrammarPool != null) {
- fProperties.put(XMLGRAMMAR_POOL, fGrammarPool);
- }
-
- fEntityManager = new XMLEntityManager();
- fProperties.put(ENTITY_MANAGER, fEntityManager);
- addCommonComponent(fEntityManager);
-
- fErrorReporter = new XMLErrorReporter();
- fErrorReporter.setDocumentLocator(fEntityManager.getEntityScanner());
- fProperties.put(ERROR_REPORTER, fErrorReporter);
- addCommonComponent(fErrorReporter);
-
- fNamespaceScanner = new XMLNSDocumentScannerImpl();
- fProperties.put(DOCUMENT_SCANNER, fNamespaceScanner);
- addComponent((XMLComponent) fNamespaceScanner);
-
- fDTDScanner = new XMLDTDScannerImpl();
- fProperties.put(DTD_SCANNER, fDTDScanner);
- addComponent((XMLComponent) fDTDScanner);
-
- fDTDProcessor = new XMLDTDProcessor();
- fProperties.put(DTD_PROCESSOR, fDTDProcessor);
- addComponent((XMLComponent) fDTDProcessor);
-
- fDTDValidator = new XMLNSDTDValidator();
- fProperties.put(DTD_VALIDATOR, fDTDValidator);
- addComponent(fDTDValidator);
-
- fDatatypeValidatorFactory = DTDDVFactory.getInstance();
- fProperties.put(DATATYPE_VALIDATOR_FACTORY, fDatatypeValidatorFactory);
-
- fValidationManager = new ValidationManager();
- fProperties.put(VALIDATION_MANAGER, fValidationManager);
-
- fVersionDetector = new XMLVersionDetector();
-
- // add message formatters
- if (fErrorReporter.getMessageFormatter(XMLMessageFormatter.XML_DOMAIN) == null) {
- XMLMessageFormatter xmft = new XMLMessageFormatter();
- fErrorReporter.putMessageFormatter(XMLMessageFormatter.XML_DOMAIN, xmft);
- fErrorReporter.putMessageFormatter(XMLMessageFormatter.XMLNS_DOMAIN, xmft);
- }
-
- // set locale
- try {
- setLocale(Locale.getDefault());
- } catch (XNIException e) {
- // do nothing
- // REVISIT: What is the right thing to do? -Ac
- }
-
- fConfigUpdated = false;
-
- } // <init>(SymbolTable,XMLGrammarPool)
-
- //
- // Public methods
- //
- /**
- * Sets the input source for the document to parse.
- *
- * @param inputSource The document's input source.
- *
- * @exception XMLConfigurationException Thrown if there is a
- * configuration error when initializing the
- * parser.
- * @exception IOException Thrown on I/O error.
- *
- * @see #parse(boolean)
- */
- public void setInputSource(XMLInputSource inputSource)
- throws XMLConfigurationException, IOException {
-
- // REVISIT: this method used to reset all the components and
- // construct the pipeline. Now reset() is called
- // in parse (boolean) just before we parse the document
- // Should this method still throw exceptions..?
-
- fInputSource = inputSource;
-
- } // setInputSource(XMLInputSource)
-
- /**
- * Set the locale to use for messages.
- *
- * @param locale The locale object to use for localization of messages.
- *
- * @exception XNIException Thrown if the parser does not support the
- * specified locale.
- */
- public void setLocale(Locale locale) throws XNIException {
- fLocale = locale;
- fErrorReporter.setLocale(locale);
- } // setLocale(Locale)
- /**
- * Sets the document handler on the last component in the pipeline
- * to receive information about the document.
- *
- * @param documentHandler The document handler.
- */
- public void setDocumentHandler(XMLDocumentHandler documentHandler) {
- fDocumentHandler = documentHandler;
- if (fLastComponent != null) {
- fLastComponent.setDocumentHandler(fDocumentHandler);
- if (fDocumentHandler !=null){
- fDocumentHandler.setDocumentSource(fLastComponent);
- }
- }
- } // setDocumentHandler(XMLDocumentHandler)
-
- /** Returns the registered document handler. */
- public XMLDocumentHandler getDocumentHandler() {
- return fDocumentHandler;
- } // getDocumentHandler():XMLDocumentHandler
-
- /**
- * Sets the DTD handler.
- *
- * @param dtdHandler The DTD handler.
- */
- public void setDTDHandler(XMLDTDHandler dtdHandler) {
- fDTDHandler = dtdHandler;
- } // setDTDHandler(XMLDTDHandler)
-
- /** Returns the registered DTD handler. */
- public XMLDTDHandler getDTDHandler() {
- return fDTDHandler;
- } // getDTDHandler():XMLDTDHandler
-
- /**
- * Sets the DTD content model handler.
- *
- * @param handler The DTD content model handler.
- */
- public void setDTDContentModelHandler(XMLDTDContentModelHandler handler) {
- fDTDContentModelHandler = handler;
- } // setDTDContentModelHandler(XMLDTDContentModelHandler)
-
- /** Returns the registered DTD content model handler. */
- public XMLDTDContentModelHandler getDTDContentModelHandler() {
- return fDTDContentModelHandler;
- } // getDTDContentModelHandler():XMLDTDContentModelHandler
-
- /**
- * Sets the resolver used to resolve external entities. The EntityResolver
- * interface supports resolution of public and system identifiers.
- *
- * @param resolver The new entity resolver. Passing a null value will
- * uninstall the currently installed resolver.
- */
- public void setEntityResolver(XMLEntityResolver resolver) {
- fProperties.put(ENTITY_RESOLVER, resolver);
- } // setEntityResolver(XMLEntityResolver)
-
- /**
- * Return the current entity resolver.
- *
- * @return The current entity resolver, or null if none
- * has been registered.
- * @see #setEntityResolver
- */
- public XMLEntityResolver getEntityResolver() {
- return (XMLEntityResolver)fProperties.get(ENTITY_RESOLVER);
- } // getEntityResolver():XMLEntityResolver
-
- /**
- * Allow an application to register an error event handler.
- *
- * <p>If the application does not register an error handler, all
- * error events reported by the SAX parser will be silently
- * ignored; however, normal processing may not continue. It is
- * highly recommended that all SAX applications implement an
- * error handler to avoid unexpected bugs.</p>
- *
- * <p>Applications may register a new or different handler in the
- * middle of a parse, and the SAX parser must begin using the new
- * handler immediately.</p>
- *
- * @param errorHandler The error handler.
- * @exception java.lang.NullPointerException If the handler
- * argument is null.
- * @see #getErrorHandler
- */
- public void setErrorHandler(XMLErrorHandler errorHandler) {
- fProperties.put(ERROR_HANDLER, errorHandler);
- } // setErrorHandler(XMLErrorHandler)
-
- /**
- * Return the current error handler.
- *
- * @return The current error handler, or null if none
- * has been registered.
- * @see #setErrorHandler
- */
- public XMLErrorHandler getErrorHandler() {
- // REVISIT: Should this be a property?
- return (XMLErrorHandler)fProperties.get(ERROR_HANDLER);
- } // getErrorHandler():XMLErrorHandler
-
-
- /**
- * If the application decides to terminate parsing before the xml document
- * is fully parsed, the application should call this method to free any
- * resource allocated during parsing. For example, close all opened streams.
- */
- public void cleanup() {
- fEntityManager.closeReaders();
- }
-
- /**
- * Parses the specified input source.
- *
- * @param source The input source.
- *
- * @exception XNIException Throws exception on XNI error.
- * @exception java.io.IOException Throws exception on i/o error.
- */
- public void parse(XMLInputSource source) throws XNIException, IOException {
-
- if (fParseInProgress) {
- // REVISIT - need to add new error message
- throw new XNIException("FWK005 parse may not be called while parsing.");
- }
- fParseInProgress = true;
-
- try {
- setInputSource(source);
- parse(true);
- } catch (XNIException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- } catch (IOException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- } catch (RuntimeException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- } catch (Exception ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw new XNIException(ex);
- } finally {
- fParseInProgress = false;
- // close all streams opened by xerces
- this.cleanup();
- }
-
- } // parse(InputSource)
-
- public boolean parse(boolean complete) throws XNIException, IOException {
- //
- // reset and configure pipeline and set InputSource.
- if (fInputSource != null) {
- try {
- fValidationManager.reset();
- fVersionDetector.reset(this);
- fConfigUpdated = true;
- resetCommon();
-
- short version = fVersionDetector.determineDocVersion(fInputSource);
- if (version == Constants.XML_VERSION_1_1) {
- initXML11Components();
- configureXML11Pipeline();
- resetXML11();
- } else {
- configurePipeline();
- reset();
- }
-
- // mark configuration as fixed
- fConfigUpdated = false;
-
- // resets and sets the pipeline.
- fVersionDetector.startDocumentParsing((XMLEntityHandler) fCurrentScanner, version);
- fInputSource = null;
- } catch (XNIException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- } catch (IOException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- } catch (RuntimeException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- } catch (Exception ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw new XNIException(ex);
- }
- }
-
- try {
- return fCurrentScanner.scanDocument(complete);
- } catch (XNIException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- } catch (IOException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- } catch (RuntimeException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- } catch (Exception ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw new XNIException(ex);
- }
-
- } // parse(boolean):boolean
-
- /**
- * Returns the state of a feature.
- *
- * @param featureId The feature identifier.
- * @return true if the feature is supported
- *
- * @throws XMLConfigurationException Thrown for configuration error.
- * In general, components should
- * only throw this exception if
- * it is <strong>really</strong>
- * a critical error.
- */
- public FeatureState getFeatureState(String featureId)
- throws XMLConfigurationException {
- // make this feature special
- if (featureId.equals(PARSER_SETTINGS)){
- return FeatureState.is(fConfigUpdated);
- }
- return super.getFeatureState(featureId);
-
- } // getFeature(String):boolean
-
- /**
- * Set the state of a feature.
- *
- * Set the state of any feature in a SAX2 parser. The parser
- * might not recognize the feature, and if it does recognize
- * it, it might not be able to fulfill the request.
- *
- * @param featureId The unique identifier (URI) of the feature.
- * @param state The requested state of the feature (true or false).
- *
- * @exception com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException If the
- * requested feature is not known.
- */
- public void setFeature(String featureId, boolean state)
- throws XMLConfigurationException {
- fConfigUpdated = true;
- // forward to every XML 1.0 component
- int count = fComponents.size();
- for (int i = 0; i < count; i++) {
- XMLComponent c = fComponents.get(i);
- c.setFeature(featureId, state);
- }
- // forward it to common components
- count = fCommonComponents.size();
- for (int i = 0; i < count; i++) {
- XMLComponent c = fCommonComponents.get(i);
- c.setFeature(featureId, state);
- }
-
- // forward to every XML 1.1 component
- count = fXML11Components.size();
- for (int i = 0; i < count; i++) {
- XMLComponent c = fXML11Components.get(i);
- try{
- c.setFeature(featureId, state);
- }
- catch (Exception e){
- // no op
- }
- }
- // save state if noone "objects"
- super.setFeature(featureId, state);
-
- } // setFeature(String,boolean)
-
- /**
- * Returns the value of a property.
- *
- * @param propertyId The property identifier.
- * @return the value of the property
- *
- * @throws XMLConfigurationException Thrown for configuration error.
- * In general, components should
- * only throw this exception if
- * it is <strong>really</strong>
- * a critical error.
- */
- public PropertyState getPropertyState(String propertyId)
- throws XMLConfigurationException {
- if (LOCALE.equals(propertyId)) {
- return PropertyState.is(getLocale());
- }
- return super.getPropertyState(propertyId);
- }
-
- /**
- * setProperty
- *
- * @param propertyId
- * @param value
- */
- public void setProperty(String propertyId, Object value)
- throws XMLConfigurationException {
- fConfigUpdated = true;
- if (LOCALE.equals(propertyId)) {
- setLocale((Locale) value);
- }
- // forward to every XML 1.0 component
- int count = fComponents.size();
- for (int i = 0; i < count; i++) {
- XMLComponent c = fComponents.get(i);
- c.setProperty(propertyId, value);
- }
- // forward it to every common Component
- count = fCommonComponents.size();
- for (int i = 0; i < count; i++) {
- XMLComponent c = fCommonComponents.get(i);
- c.setProperty(propertyId, value);
- }
- // forward it to every XML 1.1 component
- count = fXML11Components.size();
- for (int i = 0; i < count; i++) {
- XMLComponent c = fXML11Components.get(i);
- try{
- c.setProperty(propertyId, value);
- }
- catch (Exception e){
- // ignore it
- }
- }
-
- // store value if noone "objects"
- super.setProperty(propertyId, value);
-
- } // setProperty(String,Object)
-
-
- /** Returns the locale. */
- public Locale getLocale() {
- return fLocale;
- } // getLocale():Locale
-
- /**
- * reset all XML 1.0 components before parsing and namespace context
- */
- protected void reset() throws XNIException {
- int count = fComponents.size();
- for (int i = 0; i < count; i++) {
- XMLComponent c = fComponents.get(i);
- c.reset(this);
- }
-
- } // reset()
-
- /**
- * reset all common components before parsing
- */
- protected void resetCommon() throws XNIException {
- // reset common components
- int count = fCommonComponents.size();
- for (int i = 0; i < count; i++) {
- XMLComponent c = fCommonComponents.get(i);
- c.reset(this);
- }
-
- } // resetCommon()
-
-
- /**
- * reset all components before parsing and namespace context
- */
- protected void resetXML11() throws XNIException {
- // reset every component
- int count = fXML11Components.size();
- for (int i = 0; i < count; i++) {
- XMLComponent c = fXML11Components.get(i);
- c.reset(this);
- }
-
- } // resetXML11()
-
-
- /**
- * Configures the XML 1.1 pipeline.
- * Note: this method also resets the new XML11 components.
- */
- protected void configureXML11Pipeline() {
- if (fCurrentDVFactory != fXML11DatatypeFactory) {
- fCurrentDVFactory = fXML11DatatypeFactory;
- setProperty(DATATYPE_VALIDATOR_FACTORY, fCurrentDVFactory);
- }
- if (fCurrentDTDScanner != fXML11DTDScanner) {
- fCurrentDTDScanner = fXML11DTDScanner;
- setProperty(DTD_SCANNER, fCurrentDTDScanner);
- setProperty(DTD_PROCESSOR, fXML11DTDProcessor);
- }
-
- fXML11DTDScanner.setDTDHandler(fXML11DTDProcessor);
- fXML11DTDProcessor.setDTDSource(fXML11DTDScanner);
- fXML11DTDProcessor.setDTDHandler(fDTDHandler);
- if (fDTDHandler != null) {
- fDTDHandler.setDTDSource(fXML11DTDProcessor);
- }
-
- fXML11DTDScanner.setDTDContentModelHandler(fXML11DTDProcessor);
- fXML11DTDProcessor.setDTDContentModelSource(fXML11DTDScanner);
- fXML11DTDProcessor.setDTDContentModelHandler(fDTDContentModelHandler);
- if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.setDTDContentModelSource(fXML11DTDProcessor);
- }
-
- // setup XML 1.1 document pipeline
- if (fFeatures.get(NAMESPACES) == Boolean.TRUE) {
- if (fCurrentScanner != fXML11NSDocScanner) {
- fCurrentScanner = fXML11NSDocScanner;
- setProperty(DOCUMENT_SCANNER, fXML11NSDocScanner);
- setProperty(DTD_VALIDATOR, fXML11NSDTDValidator);
- }
-
- fXML11NSDocScanner.setDTDValidator(fXML11NSDTDValidator);
- fXML11NSDocScanner.setDocumentHandler(fXML11NSDTDValidator);
- fXML11NSDTDValidator.setDocumentSource(fXML11NSDocScanner);
- fXML11NSDTDValidator.setDocumentHandler(fDocumentHandler);
-
- if (fDocumentHandler != null) {
- fDocumentHandler.setDocumentSource(fXML11NSDTDValidator);
- }
- fLastComponent = fXML11NSDTDValidator;
-
- } else {
- // create components
- if (fXML11DocScanner == null) {
- // non namespace document pipeline
- fXML11DocScanner = new XML11DocumentScannerImpl();
- addXML11Component(fXML11DocScanner);
- fXML11DTDValidator = new XML11DTDValidator();
- addXML11Component(fXML11DTDValidator);
- }
- if (fCurrentScanner != fXML11DocScanner) {
- fCurrentScanner = fXML11DocScanner;
- setProperty(DOCUMENT_SCANNER, fXML11DocScanner);
- setProperty(DTD_VALIDATOR, fXML11DTDValidator);
- }
- fXML11DocScanner.setDocumentHandler(fXML11DTDValidator);
- fXML11DTDValidator.setDocumentSource(fXML11DocScanner);
- fXML11DTDValidator.setDocumentHandler(fDocumentHandler);
-
- if (fDocumentHandler != null) {
- fDocumentHandler.setDocumentSource(fXML11DTDValidator);
- }
- fLastComponent = fXML11DTDValidator;
- }
-
- // setup document pipeline
- if (fFeatures.get(XMLSCHEMA_VALIDATION) == Boolean.TRUE) {
- // If schema validator was not in the pipeline insert it.
- if (fSchemaValidator == null) {
- fSchemaValidator = new XMLSchemaValidator();
- // add schema component
- setProperty(SCHEMA_VALIDATOR, fSchemaValidator);
- addCommonComponent(fSchemaValidator);
- fSchemaValidator.reset(this);
- // add schema message formatter
- if (fErrorReporter.getMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN) == null) {
- XSMessageFormatter xmft = new XSMessageFormatter();
- fErrorReporter.putMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN, xmft);
- }
- }
-
- fLastComponent.setDocumentHandler(fSchemaValidator);
- fSchemaValidator.setDocumentSource(fLastComponent);
- fSchemaValidator.setDocumentHandler(fDocumentHandler);
- if (fDocumentHandler != null) {
- fDocumentHandler.setDocumentSource(fSchemaValidator);
- }
- fLastComponent = fSchemaValidator;
- }
-
- } // configureXML11Pipeline()
-
- /** Configures the pipeline. */
- protected void configurePipeline() {
- if (fCurrentDVFactory != fDatatypeValidatorFactory) {
- fCurrentDVFactory = fDatatypeValidatorFactory;
- // use XML 1.0 datatype library
- setProperty(DATATYPE_VALIDATOR_FACTORY, fCurrentDVFactory);
- }
-
- // setup DTD pipeline
- if (fCurrentDTDScanner != fDTDScanner) {
- fCurrentDTDScanner = fDTDScanner;
- setProperty(DTD_SCANNER, fCurrentDTDScanner);
- setProperty(DTD_PROCESSOR, fDTDProcessor);
- }
- fDTDScanner.setDTDHandler(fDTDProcessor);
- fDTDProcessor.setDTDSource(fDTDScanner);
- fDTDProcessor.setDTDHandler(fDTDHandler);
- if (fDTDHandler != null) {
- fDTDHandler.setDTDSource(fDTDProcessor);
- }
-
- fDTDScanner.setDTDContentModelHandler(fDTDProcessor);
- fDTDProcessor.setDTDContentModelSource(fDTDScanner);
- fDTDProcessor.setDTDContentModelHandler(fDTDContentModelHandler);
- if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.setDTDContentModelSource(fDTDProcessor);
- }
-
- // setup document pipeline
- if (fFeatures.get(NAMESPACES) == Boolean.TRUE) {
- if (fCurrentScanner != fNamespaceScanner) {
- fCurrentScanner = fNamespaceScanner;
- setProperty(DOCUMENT_SCANNER, fNamespaceScanner);
- setProperty(DTD_VALIDATOR, fDTDValidator);
- }
- fNamespaceScanner.setDTDValidator(fDTDValidator);
- fNamespaceScanner.setDocumentHandler(fDTDValidator);
- fDTDValidator.setDocumentSource(fNamespaceScanner);
- fDTDValidator.setDocumentHandler(fDocumentHandler);
- if (fDocumentHandler != null) {
- fDocumentHandler.setDocumentSource(fDTDValidator);
- }
- fLastComponent = fDTDValidator;
- } else {
- // create components
- if (fNonNSScanner == null) {
- fNonNSScanner = new XMLDocumentScannerImpl();
- fNonNSDTDValidator = new XMLDTDValidator();
- // add components
- addComponent((XMLComponent) fNonNSScanner);
- addComponent((XMLComponent) fNonNSDTDValidator);
- }
- if (fCurrentScanner != fNonNSScanner) {
- fCurrentScanner = fNonNSScanner;
- setProperty(DOCUMENT_SCANNER, fNonNSScanner);
- setProperty(DTD_VALIDATOR, fNonNSDTDValidator);
- }
-
- fNonNSScanner.setDocumentHandler(fNonNSDTDValidator);
- fNonNSDTDValidator.setDocumentSource(fNonNSScanner);
- fNonNSDTDValidator.setDocumentHandler(fDocumentHandler);
- if (fDocumentHandler != null) {
- fDocumentHandler.setDocumentSource(fNonNSDTDValidator);
- }
- fLastComponent = fNonNSDTDValidator;
- }
-
- // add XML Schema validator if needed
- if (fFeatures.get(XMLSCHEMA_VALIDATION) == Boolean.TRUE) {
- // If schema validator was not in the pipeline insert it.
- if (fSchemaValidator == null) {
- fSchemaValidator = new XMLSchemaValidator();
- // add schema component
- setProperty(SCHEMA_VALIDATOR, fSchemaValidator);
- addCommonComponent(fSchemaValidator);
- fSchemaValidator.reset(this);
- // add schema message formatter
- if (fErrorReporter.getMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN) == null) {
- XSMessageFormatter xmft = new XSMessageFormatter();
- fErrorReporter.putMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN, xmft);
- }
-
- }
- fLastComponent.setDocumentHandler(fSchemaValidator);
- fSchemaValidator.setDocumentSource(fLastComponent);
- fSchemaValidator.setDocumentHandler(fDocumentHandler);
- if (fDocumentHandler != null) {
- fDocumentHandler.setDocumentSource(fSchemaValidator);
- }
- fLastComponent = fSchemaValidator;
- }
- } // configurePipeline()
-
-
- // features and properties
-
- /**
- * Check a feature. If feature is know and supported, this method simply
- * returns. Otherwise, the appropriate exception is thrown.
- *
- * @param featureId The unique identifier (URI) of the feature.
- *
- * @throws XMLConfigurationException Thrown for configuration error.
- * In general, components should
- * only throw this exception if
- * it is <strong>really</strong>
- * a critical error.
- */
- protected FeatureState checkFeature(String featureId) throws XMLConfigurationException {
-
- //
- // Xerces Features
- //
-
- if (featureId.startsWith(Constants.XERCES_FEATURE_PREFIX)) {
- final int suffixLength = featureId.length() - Constants.XERCES_FEATURE_PREFIX.length();
-
- //
- // http://apache.org/xml/features/validation/dynamic
- // Allows the parser to validate a document only when it
- // contains a grammar. Validation is turned on/off based
- // on each document instance, automatically.
- //
- if (suffixLength == Constants.DYNAMIC_VALIDATION_FEATURE.length() &&
- featureId.endsWith(Constants.DYNAMIC_VALIDATION_FEATURE)) {
- return FeatureState.RECOGNIZED;
- }
-
- //
- // http://apache.org/xml/features/validation/default-attribute-values
- //
- if (suffixLength == Constants.DEFAULT_ATTRIBUTE_VALUES_FEATURE.length() &&
- featureId.endsWith(Constants.DEFAULT_ATTRIBUTE_VALUES_FEATURE)) {
- // REVISIT
- return FeatureState.NOT_SUPPORTED;
- }
- //
- // http://apache.org/xml/features/validation/default-attribute-values
- //
- if (suffixLength == Constants.VALIDATE_CONTENT_MODELS_FEATURE.length() &&
- featureId.endsWith(Constants.VALIDATE_CONTENT_MODELS_FEATURE)) {
- // REVISIT
- return FeatureState.NOT_SUPPORTED;
- }
- //
- // http://apache.org/xml/features/validation/nonvalidating/load-dtd-grammar
- //
- if (suffixLength == Constants.LOAD_DTD_GRAMMAR_FEATURE.length() &&
- featureId.endsWith(Constants.LOAD_DTD_GRAMMAR_FEATURE)) {
- return FeatureState.RECOGNIZED;
- }
- //
- // http://apache.org/xml/features/validation/nonvalidating/load-external-dtd
- //
- if (suffixLength == Constants.LOAD_EXTERNAL_DTD_FEATURE.length() &&
- featureId.endsWith(Constants.LOAD_EXTERNAL_DTD_FEATURE)) {
- return FeatureState.RECOGNIZED;
- }
-
- //
- // http://apache.org/xml/features/validation/default-attribute-values
- //
- if (suffixLength == Constants.VALIDATE_DATATYPES_FEATURE.length() &&
- featureId.endsWith(Constants.VALIDATE_DATATYPES_FEATURE)) {
- return FeatureState.NOT_SUPPORTED;
- }
-
- //
- // http://apache.org/xml/features/validation/schema
- // Lets the user turn Schema validation support on/off.
- //
- if (suffixLength == Constants.SCHEMA_VALIDATION_FEATURE.length() &&
- featureId.endsWith(Constants.SCHEMA_VALIDATION_FEATURE)) {
- return FeatureState.RECOGNIZED;
- }
- // activate full schema checking
- if (suffixLength == Constants.SCHEMA_FULL_CHECKING.length() &&
- featureId.endsWith(Constants.SCHEMA_FULL_CHECKING)) {
- return FeatureState.RECOGNIZED;
- }
- // Feature identifier: expose schema normalized value
- // http://apache.org/xml/features/validation/schema/normalized-value
- if (suffixLength == Constants.SCHEMA_NORMALIZED_VALUE.length() &&
- featureId.endsWith(Constants.SCHEMA_NORMALIZED_VALUE)) {
- return FeatureState.RECOGNIZED;
- }
- // Feature identifier: send element default value via characters()
- // http://apache.org/xml/features/validation/schema/element-default
- if (suffixLength == Constants.SCHEMA_ELEMENT_DEFAULT.length() &&
- featureId.endsWith(Constants.SCHEMA_ELEMENT_DEFAULT)) {
- return FeatureState.RECOGNIZED;
- }
-
- // special performance feature: only component manager is allowed to set it.
- if (suffixLength == Constants.PARSER_SETTINGS.length() &&
- featureId.endsWith(Constants.PARSER_SETTINGS)) {
- return FeatureState.NOT_SUPPORTED;
- }
-
- }
-
- //
- // Not recognized
- //
-
- return super.checkFeature(featureId);
-
- } // checkFeature(String)
-
- /**
- * Check a property. If the property is know and supported, this method
- * simply returns. Otherwise, the appropriate exception is thrown.
- *
- * @param propertyId The unique identifier (URI) of the property
- * being set.
- *
- * @throws XMLConfigurationException Thrown for configuration error.
- * In general, components should
- * only throw this exception if
- * it is <strong>really</strong>
- * a critical error.
- */
- protected PropertyState checkProperty(String propertyId) throws XMLConfigurationException {
-
- //
- // Xerces Properties
- //
-
- if (propertyId.startsWith(Constants.XERCES_PROPERTY_PREFIX)) {
- final int suffixLength = propertyId.length() - Constants.XERCES_PROPERTY_PREFIX.length();
-
- if (suffixLength == Constants.DTD_SCANNER_PROPERTY.length() &&
- propertyId.endsWith(Constants.DTD_SCANNER_PROPERTY)) {
- return PropertyState.RECOGNIZED;
- }
- if (suffixLength == Constants.SCHEMA_LOCATION.length() &&
- propertyId.endsWith(Constants.SCHEMA_LOCATION)) {
- return PropertyState.RECOGNIZED;
- }
- if (suffixLength == Constants.SCHEMA_NONS_LOCATION.length() &&
- propertyId.endsWith(Constants.SCHEMA_NONS_LOCATION)) {
- return PropertyState.RECOGNIZED;
- }
- }
-
- if (propertyId.startsWith(Constants.JAXP_PROPERTY_PREFIX)) {
- final int suffixLength = propertyId.length() - Constants.JAXP_PROPERTY_PREFIX.length();
-
- if (suffixLength == Constants.SCHEMA_SOURCE.length() &&
- propertyId.endsWith(Constants.SCHEMA_SOURCE)) {
- return PropertyState.RECOGNIZED;
- }
- }
-
- // special cases
- if (propertyId.startsWith(Constants.SAX_PROPERTY_PREFIX)) {
- final int suffixLength = propertyId.length() - Constants.SAX_PROPERTY_PREFIX.length();
-
- //
- // http://xml.org/sax/properties/xml-string
- // Value type: String
- // Access: read-only
- // Get the literal string of characters associated with the
- // current event. If the parser recognises and supports this
- // property but is not currently parsing text, it should return
- // null (this is a good way to check for availability before the
- // parse begins).
- //
- if (suffixLength == Constants.XML_STRING_PROPERTY.length() &&
- propertyId.endsWith(Constants.XML_STRING_PROPERTY)) {
- // REVISIT - we should probably ask xml-dev for a precise
- // definition of what this is actually supposed to return, and
- // in exactly which circumstances.
- return PropertyState.NOT_SUPPORTED;
- }
- }
-
- //
- // Not recognized
- //
-
- return super.checkProperty(propertyId);
-
- } // checkProperty(String)
-
-
- /**
- * Adds a component to the parser configuration. This method will
- * also add all of the component's recognized features and properties
- * to the list of default recognized features and properties.
- *
- * @param component The component to add.
- */
- protected void addComponent(XMLComponent component) {
-
- // don't add a component more than once
- if (fComponents.contains(component)) {
- return;
- }
- fComponents.add(component);
- addRecognizedParamsAndSetDefaults(component);
-
- } // addComponent(XMLComponent)
-
- /**
- * Adds common component to the parser configuration. This method will
- * also add all of the component's recognized features and properties
- * to the list of default recognized features and properties.
- *
- * @param component The component to add.
- */
- protected void addCommonComponent(XMLComponent component) {
-
- // don't add a component more than once
- if (fCommonComponents.contains(component)) {
- return;
- }
- fCommonComponents.add(component);
- addRecognizedParamsAndSetDefaults(component);
-
- } // addCommonComponent(XMLComponent)
-
- /**
- * Adds an XML 1.1 component to the parser configuration. This method will
- * also add all of the component's recognized features and properties
- * to the list of default recognized features and properties.
- *
- * @param component The component to add.
- */
- protected void addXML11Component(XMLComponent component) {
-
- // don't add a component more than once
- if (fXML11Components.contains(component)) {
- return;
- }
- fXML11Components.add(component);
- addRecognizedParamsAndSetDefaults(component);
-
- } // addXML11Component(XMLComponent)
-
- /**
- * Adds all of the component's recognized features and properties
- * to the list of default recognized features and properties, and
- * sets default values on the configuration for features and
- * properties which were previously absent from the configuration.
- *
- * @param component The component whose recognized features
- * and properties will be added to the configuration
- */
- protected void addRecognizedParamsAndSetDefaults(XMLComponent component) {
-
- // register component's recognized features
- String[] recognizedFeatures = component.getRecognizedFeatures();
- addRecognizedFeatures(recognizedFeatures);
-
- // register component's recognized properties
- String[] recognizedProperties = component.getRecognizedProperties();
- addRecognizedProperties(recognizedProperties);
-
- // set default values
- if (recognizedFeatures != null) {
- for (int i = 0; i < recognizedFeatures.length; ++i) {
- String featureId = recognizedFeatures[i];
- Boolean state = component.getFeatureDefault(featureId);
- if (state != null) {
- // Do not overwrite values already set on the configuration.
- if (!fFeatures.containsKey(featureId)) {
- fFeatures.put(featureId, state);
- // For newly added components who recognize this feature
- // but did not offer a default value, we need to make
- // sure these components will get an opportunity to read
- // the value before parsing begins.
- fConfigUpdated = true;
- }
- }
- }
- }
- if (recognizedProperties != null) {
- for (int i = 0; i < recognizedProperties.length; ++i) {
- String propertyId = recognizedProperties[i];
- Object value = component.getPropertyDefault(propertyId);
- if (value != null) {
- // Do not overwrite values already set on the configuration.
- if (!fProperties.containsKey(propertyId)) {
- fProperties.put(propertyId, value);
- // For newly added components who recognize this property
- // but did not offer a default value, we need to make
- // sure these components will get an opportunity to read
- // the value before parsing begins.
- fConfigUpdated = true;
- }
- }
- }
- }
- }
-
- private void initXML11Components() {
- if (!f11Initialized) {
-
- // create datatype factory
- fXML11DatatypeFactory = DTDDVFactory.getInstance(XML11_DATATYPE_VALIDATOR_FACTORY);
-
- // setup XML 1.1 DTD pipeline
- fXML11DTDScanner = new XML11DTDScannerImpl();
- addXML11Component(fXML11DTDScanner);
- fXML11DTDProcessor = new XML11DTDProcessor();
- addXML11Component(fXML11DTDProcessor);
-
- // setup XML 1.1. document pipeline - namespace aware
- fXML11NSDocScanner = new XML11NSDocumentScannerImpl();
- addXML11Component(fXML11NSDocScanner);
- fXML11NSDTDValidator = new XML11NSDTDValidator();
- addXML11Component(fXML11NSDTDValidator);
-
- f11Initialized = true;
- }
- }
-
- /**
- * Returns the state of a feature. This method calls getFeature()
- * on ParserConfigurationSettings, bypassing getFeature() on this
- * class.
- */
- FeatureState getFeatureState0(String featureId)
- throws XMLConfigurationException {
- return super.getFeatureState(featureId);
- }
-
-} // class XML11Configuration
diff --git a/src/com/sun/org/apache/xerces/internal/parsers/XML11DTDConfiguration.java b/src/com/sun/org/apache/xerces/internal/parsers/XML11DTDConfiguration.java
deleted file mode 100644
index 3dfa85e..0000000
--- a/src/com/sun/org/apache/xerces/internal/parsers/XML11DTDConfiguration.java
+++ /dev/null
@@ -1,1335 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.parsers;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Locale;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.XML11DTDScannerImpl;
-import com.sun.org.apache.xerces.internal.impl.XML11DocumentScannerImpl;
-import com.sun.org.apache.xerces.internal.impl.XML11NSDocumentScannerImpl;
-import com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl;
-import com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl;
-import com.sun.org.apache.xerces.internal.impl.XMLEntityHandler;
-import com.sun.org.apache.xerces.internal.impl.XMLEntityManager;
-import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
-import com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl;
-import com.sun.org.apache.xerces.internal.impl.XMLVersionDetector;
-import com.sun.org.apache.xerces.internal.impl.dtd.XML11DTDProcessor;
-import com.sun.org.apache.xerces.internal.impl.dtd.XML11DTDValidator;
-import com.sun.org.apache.xerces.internal.impl.dtd.XML11NSDTDValidator;
-import com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDProcessor;
-import com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator;
-import com.sun.org.apache.xerces.internal.impl.dtd.XMLNSDTDValidator;
-import com.sun.org.apache.xerces.internal.impl.dv.DTDDVFactory;
-import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter;
-import com.sun.org.apache.xerces.internal.impl.validation.ValidationManager;
-import com.sun.org.apache.xerces.internal.util.FeatureState;
-import com.sun.org.apache.xerces.internal.util.ParserConfigurationSettings;
-import com.sun.org.apache.xerces.internal.util.PropertyState;
-import com.sun.org.apache.xerces.internal.util.Status;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLDTDHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLLocator;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponent;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDScanner;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentScanner;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLEntityResolver;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLPullParserConfiguration;
-
-/**
- * This class is the DTD-only parser configuration
- * used to parse XML 1.0 and XML 1.1 documents.
- *
- * <p>
- * This class recognizes the following features and properties:
- * <ul>
- * <li>Features
- * <ul>
- * <li>http://xml.org/sax/features/validation</li>
- * <li>http://xml.org/sax/features/namespaces</li>
- * <li>http://xml.org/sax/features/external-general-entities</li>
- * <li>http://xml.org/sax/features/external-parameter-entities</li>
- * <li>http://apache.org/xml/features/continue-after-fatal-error</li>
- * <li>http://apache.org/xml/features/load-external-dtd</li>
- * </ul>
- * <li>Properties
- * <ul>
- * <li>http://xml.org/sax/properties/xml-string</li>
- * <li>http://apache.org/xml/properties/internal/symbol-table</li>
- * <li>http://apache.org/xml/properties/internal/error-handler</li>
- * <li>http://apache.org/xml/properties/internal/entity-resolver</li>
- * <li>http://apache.org/xml/properties/internal/error-reporter</li>
- * <li>http://apache.org/xml/properties/internal/entity-manager</li>
- * <li>http://apache.org/xml/properties/internal/document-scanner</li>
- * <li>http://apache.org/xml/properties/internal/dtd-scanner</li>
- * <li>http://apache.org/xml/properties/internal/grammar-pool</li>
- * <li>http://apache.org/xml/properties/internal/validator/dtd</li>
- * <li>http://apache.org/xml/properties/internal/datatype-validator-factory</li>
- * </ul>
- * </ul>
- * @author Elena Litani, IBM
- * @author Neil Graham, IBM
- * @author Michael Glavassevich, IBM
- * @author John Kim, IBM
- *
- * @version $Id: XML11DTDConfiguration.java,v 1.5 2010-11-01 04:40:10 joehw Exp $
- */
-public class XML11DTDConfiguration extends ParserConfigurationSettings
- implements XMLPullParserConfiguration, XML11Configurable {
-
- //
- // Constants
- //
- protected final static String XML11_DATATYPE_VALIDATOR_FACTORY =
- "com.sun.org.apache.xerces.internal.impl.dv.dtd.XML11DTDDVFactoryImpl";
-
- // feature identifiers
-
- /** Feature identifier: validation. */
- protected static final String VALIDATION =
- Constants.SAX_FEATURE_PREFIX + Constants.VALIDATION_FEATURE;
-
- /** Feature identifier: namespaces. */
- protected static final String NAMESPACES =
- Constants.SAX_FEATURE_PREFIX + Constants.NAMESPACES_FEATURE;
-
- /** Feature identifier: external general entities. */
- protected static final String EXTERNAL_GENERAL_ENTITIES =
- Constants.SAX_FEATURE_PREFIX + Constants.EXTERNAL_GENERAL_ENTITIES_FEATURE;
-
- /** Feature identifier: external parameter entities. */
- protected static final String EXTERNAL_PARAMETER_ENTITIES =
- Constants.SAX_FEATURE_PREFIX + Constants.EXTERNAL_PARAMETER_ENTITIES_FEATURE;
-
- /** Feature identifier: continue after fatal error. */
- protected static final String CONTINUE_AFTER_FATAL_ERROR =
- Constants.XERCES_FEATURE_PREFIX + Constants.CONTINUE_AFTER_FATAL_ERROR_FEATURE;
-
- /** Feature identifier: load external DTD. */
- protected static final String LOAD_EXTERNAL_DTD =
- Constants.XERCES_FEATURE_PREFIX + Constants.LOAD_EXTERNAL_DTD_FEATURE;
-
- // property identifiers
-
- /** Property identifier: xml string. */
- protected static final String XML_STRING =
- Constants.SAX_PROPERTY_PREFIX + Constants.XML_STRING_PROPERTY;
-
- /** Property identifier: symbol table. */
- protected static final String SYMBOL_TABLE =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY;
-
- /** Property identifier: error handler. */
- protected static final String ERROR_HANDLER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_HANDLER_PROPERTY;
-
- /** Property identifier: entity resolver. */
- protected static final String ENTITY_RESOLVER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_RESOLVER_PROPERTY;
-
- /** Property identifier: error reporter. */
- protected static final String ERROR_REPORTER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY;
-
- /** Property identifier: entity manager. */
- protected static final String ENTITY_MANAGER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_MANAGER_PROPERTY;
-
- /** Property identifier document scanner: */
- protected static final String DOCUMENT_SCANNER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.DOCUMENT_SCANNER_PROPERTY;
-
- /** Property identifier: DTD scanner. */
- protected static final String DTD_SCANNER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.DTD_SCANNER_PROPERTY;
-
- /** Property identifier: grammar pool. */
- protected static final String XMLGRAMMAR_POOL =
- Constants.XERCES_PROPERTY_PREFIX + Constants.XMLGRAMMAR_POOL_PROPERTY;
-
- /** Property identifier: DTD loader. */
- protected static final String DTD_PROCESSOR =
- Constants.XERCES_PROPERTY_PREFIX + Constants.DTD_PROCESSOR_PROPERTY;
-
- /** Property identifier: DTD validator. */
- protected static final String DTD_VALIDATOR =
- Constants.XERCES_PROPERTY_PREFIX + Constants.DTD_VALIDATOR_PROPERTY;
-
- /** Property identifier: namespace binder. */
- protected static final String NAMESPACE_BINDER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.NAMESPACE_BINDER_PROPERTY;
-
- /** Property identifier: datatype validator factory. */
- protected static final String DATATYPE_VALIDATOR_FACTORY =
- Constants.XERCES_PROPERTY_PREFIX + Constants.DATATYPE_VALIDATOR_FACTORY_PROPERTY;
-
- protected static final String VALIDATION_MANAGER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.VALIDATION_MANAGER_PROPERTY;
-
- /** Property identifier: JAXP schema language / DOM schema-type. */
- protected static final String JAXP_SCHEMA_LANGUAGE =
- Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_LANGUAGE;
-
- /** Property identifier: JAXP schema source/ DOM schema-location. */
- protected static final String JAXP_SCHEMA_SOURCE =
- Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_SOURCE;
-
- // debugging
-
- /** Set to true and recompile to print exception stack trace. */
- protected static final boolean PRINT_EXCEPTION_STACK_TRACE = false;
-
- //
- // Data
- //
- protected SymbolTable fSymbolTable;
- protected XMLInputSource fInputSource;
- protected ValidationManager fValidationManager;
- protected XMLVersionDetector fVersionDetector;
- protected XMLLocator fLocator;
- protected Locale fLocale;
-
- /** XML 1.0 Components. */
- protected ArrayList fComponents;
-
- /** XML 1.1. Components. */
- protected ArrayList fXML11Components = null;
-
- /** Common components: XMLEntityManager, XMLErrorReporter */
- protected ArrayList fCommonComponents = null;
-
- /** The document handler. */
- protected XMLDocumentHandler fDocumentHandler;
-
- /** The DTD handler. */
- protected XMLDTDHandler fDTDHandler;
-
- /** The DTD content model handler. */
- protected XMLDTDContentModelHandler fDTDContentModelHandler;
-
- /** Last component in the document pipeline */
- protected XMLDocumentSource fLastComponent;
-
- /**
- * True if a parse is in progress. This state is needed because
- * some features/properties cannot be set while parsing (e.g.
- * validation and namespaces).
- */
- protected boolean fParseInProgress = false;
-
- /**
- * fConfigUpdated is set to true if there has been any change to the configuration settings,
- * i.e a feature or a property was changed.
- */
- protected boolean fConfigUpdated = false;
-
- //
- // XML 1.0 components
- //
-
- /** The XML 1.0 Datatype validator factory. */
- protected DTDDVFactory fDatatypeValidatorFactory;
-
- /** The XML 1.0 Document scanner that does namespace binding. */
- protected XMLNSDocumentScannerImpl fNamespaceScanner;
-
- /** The XML 1.0 Non-namespace implementation of scanner */
- protected XMLDocumentScannerImpl fNonNSScanner;
-
- /** The XML 1.0 DTD Validator: binds namespaces */
- protected XMLDTDValidator fDTDValidator;
-
- /** The XML 1.0 DTD Validator that does not bind namespaces */
- protected XMLDTDValidator fNonNSDTDValidator;
-
- /** The XML 1.0 DTD scanner. */
- protected XMLDTDScanner fDTDScanner;
-
- /** The XML 1.0 DTD Processor . */
- protected XMLDTDProcessor fDTDProcessor;
-
- //
- // XML 1.1 components
- //
-
- /** The XML 1.1 datatype factory. **/
- protected DTDDVFactory fXML11DatatypeFactory = null;
-
- /** The XML 1.1 document scanner that does namespace binding. **/
- protected XML11NSDocumentScannerImpl fXML11NSDocScanner = null;
-
- /** The XML 1.1 document scanner that does not do namespace binding. **/
- protected XML11DocumentScannerImpl fXML11DocScanner = null;
-
- /** The XML 1.1 DTD validator that does namespace binding. **/
- protected XML11NSDTDValidator fXML11NSDTDValidator = null;
-
- /** The XML 1.1 DTD validator that does not do namespace binding. **/
- protected XML11DTDValidator fXML11DTDValidator = null;
-
- /** The XML 1.1 DTD scanner. **/
- protected XML11DTDScannerImpl fXML11DTDScanner = null;
-
- /** The XML 1.1 DTD processor. **/
- protected XML11DTDProcessor fXML11DTDProcessor = null;
-
- //
- // Common components
- //
-
- /** Grammar pool. */
- protected XMLGrammarPool fGrammarPool;
-
- /** Error reporter. */
- protected XMLErrorReporter fErrorReporter;
-
- /** Entity manager. */
- protected XMLEntityManager fEntityManager;
-
- /** Current scanner */
- protected XMLDocumentScanner fCurrentScanner;
-
- /** Current Datatype validator factory. */
- protected DTDDVFactory fCurrentDVFactory;
-
- /** Current DTD scanner. */
- protected XMLDTDScanner fCurrentDTDScanner;
-
- /** Flag indiciating whether XML11 components have been initialized. */
- private boolean f11Initialized = false;
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- public XML11DTDConfiguration() {
- this(null, null, null);
- } // <init>()
-
- /**
- * Constructs a parser configuration using the specified symbol table.
- *
- * @param symbolTable The symbol table to use.
- */
- public XML11DTDConfiguration(SymbolTable symbolTable) {
- this(symbolTable, null, null);
- } // <init>(SymbolTable)
-
- /**
- * Constructs a parser configuration using the specified symbol table and
- * grammar pool.
- * <p>
- * <strong>REVISIT:</strong>
- * Grammar pool will be updated when the new validation engine is
- * implemented.
- *
- * @param symbolTable The symbol table to use.
- * @param grammarPool The grammar pool to use.
- */
- public XML11DTDConfiguration(SymbolTable symbolTable, XMLGrammarPool grammarPool) {
- this(symbolTable, grammarPool, null);
- } // <init>(SymbolTable,XMLGrammarPool)
-
- /**
- * Constructs a parser configuration using the specified symbol table,
- * grammar pool, and parent settings.
- * <p>
- * <strong>REVISIT:</strong>
- * Grammar pool will be updated when the new validation engine is
- * implemented.
- *
- * @param symbolTable The symbol table to use.
- * @param grammarPool The grammar pool to use.
- * @param parentSettings The parent settings.
- */
- public XML11DTDConfiguration(
- SymbolTable symbolTable,
- XMLGrammarPool grammarPool,
- XMLComponentManager parentSettings) {
-
- super(parentSettings);
-
- // create a vector to hold all the components in use
- // XML 1.0 specialized components
- fComponents = new ArrayList();
- // XML 1.1 specialized components
- fXML11Components = new ArrayList();
- // Common components for XML 1.1. and XML 1.0
- fCommonComponents = new ArrayList();
-
- // create table for features and properties
- fFeatures = new HashMap();
- fProperties = new HashMap();
-
- // add default recognized features
- final String[] recognizedFeatures =
- {
- CONTINUE_AFTER_FATAL_ERROR, LOAD_EXTERNAL_DTD, // from XMLDTDScannerImpl
- VALIDATION,
- NAMESPACES,
- EXTERNAL_GENERAL_ENTITIES,
- EXTERNAL_PARAMETER_ENTITIES,
- PARSER_SETTINGS
- };
- addRecognizedFeatures(recognizedFeatures);
- // set state for default features
- fFeatures.put(VALIDATION, Boolean.FALSE);
- fFeatures.put(NAMESPACES, Boolean.TRUE);
- fFeatures.put(EXTERNAL_GENERAL_ENTITIES, Boolean.TRUE);
- fFeatures.put(EXTERNAL_PARAMETER_ENTITIES, Boolean.TRUE);
- fFeatures.put(CONTINUE_AFTER_FATAL_ERROR, Boolean.FALSE);
- fFeatures.put(LOAD_EXTERNAL_DTD, Boolean.TRUE);
- fFeatures.put(PARSER_SETTINGS, Boolean.TRUE);
-
- // add default recognized properties
- final String[] recognizedProperties =
- {
- SYMBOL_TABLE,
- ERROR_HANDLER,
- ENTITY_RESOLVER,
- ERROR_REPORTER,
- ENTITY_MANAGER,
- DOCUMENT_SCANNER,
- DTD_SCANNER,
- DTD_PROCESSOR,
- DTD_VALIDATOR,
- DATATYPE_VALIDATOR_FACTORY,
- VALIDATION_MANAGER,
- XML_STRING,
- XMLGRAMMAR_POOL,
- JAXP_SCHEMA_SOURCE,
- JAXP_SCHEMA_LANGUAGE};
- addRecognizedProperties(recognizedProperties);
-
- if (symbolTable == null) {
- symbolTable = new SymbolTable();
- }
- fSymbolTable = symbolTable;
- fProperties.put(SYMBOL_TABLE, fSymbolTable);
-
- fGrammarPool = grammarPool;
- if (fGrammarPool != null) {
- fProperties.put(XMLGRAMMAR_POOL, fGrammarPool);
- }
-
- fEntityManager = new XMLEntityManager();
- fProperties.put(ENTITY_MANAGER, fEntityManager);
- addCommonComponent(fEntityManager);
-
- fErrorReporter = new XMLErrorReporter();
- fErrorReporter.setDocumentLocator(fEntityManager.getEntityScanner());
- fProperties.put(ERROR_REPORTER, fErrorReporter);
- addCommonComponent(fErrorReporter);
-
- fNamespaceScanner = new XMLNSDocumentScannerImpl();
- fProperties.put(DOCUMENT_SCANNER, fNamespaceScanner);
- addComponent((XMLComponent) fNamespaceScanner);
-
- fDTDScanner = new XMLDTDScannerImpl();
- fProperties.put(DTD_SCANNER, fDTDScanner);
- addComponent((XMLComponent) fDTDScanner);
-
- fDTDProcessor = new XMLDTDProcessor();
- fProperties.put(DTD_PROCESSOR, fDTDProcessor);
- addComponent((XMLComponent) fDTDProcessor);
-
- fDTDValidator = new XMLNSDTDValidator();
- fProperties.put(DTD_VALIDATOR, fDTDValidator);
- addComponent(fDTDValidator);
-
- fDatatypeValidatorFactory = DTDDVFactory.getInstance();
- fProperties.put(DATATYPE_VALIDATOR_FACTORY, fDatatypeValidatorFactory);
-
- fValidationManager = new ValidationManager();
- fProperties.put(VALIDATION_MANAGER, fValidationManager);
-
- fVersionDetector = new XMLVersionDetector();
-
- // add message formatters
- if (fErrorReporter.getMessageFormatter(XMLMessageFormatter.XML_DOMAIN) == null) {
- XMLMessageFormatter xmft = new XMLMessageFormatter();
- fErrorReporter.putMessageFormatter(XMLMessageFormatter.XML_DOMAIN, xmft);
- fErrorReporter.putMessageFormatter(XMLMessageFormatter.XMLNS_DOMAIN, xmft);
- }
-
- // set locale
- try {
- setLocale(Locale.getDefault());
- } catch (XNIException e) {
- // do nothing
- // REVISIT: What is the right thing to do? -Ac
- }
-
- fConfigUpdated = false;
-
- } // <init>(SymbolTable,XMLGrammarPool)
-
- //
- // Public methods
- //
- /**
- * Sets the input source for the document to parse.
- *
- * @param inputSource The document's input source.
- *
- * @exception XMLConfigurationException Thrown if there is a
- * configuration error when initializing the
- * parser.
- * @exception IOException Thrown on I/O error.
- *
- * @see #parse(boolean)
- */
- public void setInputSource(XMLInputSource inputSource)
- throws XMLConfigurationException, IOException {
-
- // REVISIT: this method used to reset all the components and
- // construct the pipeline. Now reset() is called
- // in parse (boolean) just before we parse the document
- // Should this method still throw exceptions..?
-
- fInputSource = inputSource;
-
- } // setInputSource(XMLInputSource)
-
- /**
- * Set the locale to use for messages.
- *
- * @param locale The locale object to use for localization of messages.
- *
- * @exception XNIException Thrown if the parser does not support the
- * specified locale.
- */
- public void setLocale(Locale locale) throws XNIException {
- fLocale = locale;
- fErrorReporter.setLocale(locale);
- } // setLocale(Locale)
-
- /**
- * Sets the document handler on the last component in the pipeline
- * to receive information about the document.
- *
- * @param documentHandler The document handler.
- */
- public void setDocumentHandler(XMLDocumentHandler documentHandler) {
- fDocumentHandler = documentHandler;
- if (fLastComponent != null) {
- fLastComponent.setDocumentHandler(fDocumentHandler);
- if (fDocumentHandler !=null){
- fDocumentHandler.setDocumentSource(fLastComponent);
- }
- }
- } // setDocumentHandler(XMLDocumentHandler)
-
- /** Returns the registered document handler. */
- public XMLDocumentHandler getDocumentHandler() {
- return fDocumentHandler;
- } // getDocumentHandler():XMLDocumentHandler
-
- /**
- * Sets the DTD handler.
- *
- * @param dtdHandler The DTD handler.
- */
- public void setDTDHandler(XMLDTDHandler dtdHandler) {
- fDTDHandler = dtdHandler;
- } // setDTDHandler(XMLDTDHandler)
-
- /** Returns the registered DTD handler. */
- public XMLDTDHandler getDTDHandler() {
- return fDTDHandler;
- } // getDTDHandler():XMLDTDHandler
-
- /**
- * Sets the DTD content model handler.
- *
- * @param handler The DTD content model handler.
- */
- public void setDTDContentModelHandler(XMLDTDContentModelHandler handler) {
- fDTDContentModelHandler = handler;
- } // setDTDContentModelHandler(XMLDTDContentModelHandler)
-
- /** Returns the registered DTD content model handler. */
- public XMLDTDContentModelHandler getDTDContentModelHandler() {
- return fDTDContentModelHandler;
- } // getDTDContentModelHandler():XMLDTDContentModelHandler
-
- /**
- * Sets the resolver used to resolve external entities. The EntityResolver
- * interface supports resolution of public and system identifiers.
- *
- * @param resolver The new entity resolver. Passing a null value will
- * uninstall the currently installed resolver.
- */
- public void setEntityResolver(XMLEntityResolver resolver) {
- fProperties.put(ENTITY_RESOLVER, resolver);
- } // setEntityResolver(XMLEntityResolver)
-
- /**
- * Return the current entity resolver.
- *
- * @return The current entity resolver, or null if none
- * has been registered.
- * @see #setEntityResolver
- */
- public XMLEntityResolver getEntityResolver() {
- return (XMLEntityResolver)fProperties.get(ENTITY_RESOLVER);
- } // getEntityResolver():XMLEntityResolver
-
- /**
- * Allow an application to register an error event handler.
- *
- * <p>If the application does not register an error handler, all
- * error events reported by the SAX parser will be silently
- * ignored; however, normal processing may not continue. It is
- * highly recommended that all SAX applications implement an
- * error handler to avoid unexpected bugs.</p>
- *
- * <p>Applications may register a new or different handler in the
- * middle of a parse, and the SAX parser must begin using the new
- * handler immediately.</p>
- *
- * @param errorHandler The error handler.
- * @exception java.lang.NullPointerException If the handler
- * argument is null.
- * @see #getErrorHandler
- */
- public void setErrorHandler(XMLErrorHandler errorHandler) {
- fProperties.put(ERROR_HANDLER, errorHandler);
- } // setErrorHandler(XMLErrorHandler)
-
- /**
- * Return the current error handler.
- *
- * @return The current error handler, or null if none
- * has been registered.
- * @see #setErrorHandler
- */
- public XMLErrorHandler getErrorHandler() {
- // REVISIT: Should this be a property?
- return (XMLErrorHandler)fProperties.get(ERROR_HANDLER);
- } // getErrorHandler():XMLErrorHandler
-
-
- /**
- * If the application decides to terminate parsing before the xml document
- * is fully parsed, the application should call this method to free any
- * resource allocated during parsing. For example, close all opened streams.
- */
- public void cleanup() {
- fEntityManager.closeReaders();
- }
-
- /**
- * Parses the specified input source.
- *
- * @param source The input source.
- *
- * @exception XNIException Throws exception on XNI error.
- * @exception java.io.IOException Throws exception on i/o error.
- */
- public void parse(XMLInputSource source) throws XNIException, IOException {
-
- if (fParseInProgress) {
- // REVISIT - need to add new error message
- throw new XNIException("FWK005 parse may not be called while parsing.");
- }
- fParseInProgress = true;
-
- try {
- setInputSource(source);
- parse(true);
- } catch (XNIException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- } catch (IOException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- } catch (RuntimeException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- } catch (Exception ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw new XNIException(ex);
- } finally {
- fParseInProgress = false;
- // close all streams opened by xerces
- this.cleanup();
- }
-
- } // parse(InputSource)
-
- public boolean parse(boolean complete) throws XNIException, IOException {
- //
- // reset and configure pipeline and set InputSource.
- if (fInputSource != null) {
- try {
- fValidationManager.reset();
- fVersionDetector.reset(this);
- resetCommon();
-
- short version = fVersionDetector.determineDocVersion(fInputSource);
- if (version == Constants.XML_VERSION_1_1) {
- initXML11Components();
- configureXML11Pipeline();
- resetXML11();
- } else {
- configurePipeline();
- reset();
- }
-
- // mark configuration as fixed
- fConfigUpdated = false;
-
- // resets and sets the pipeline.
- fVersionDetector.startDocumentParsing((XMLEntityHandler) fCurrentScanner, version);
- fInputSource = null;
- } catch (XNIException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- } catch (IOException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- } catch (RuntimeException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- } catch (Exception ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw new XNIException(ex);
- }
- }
-
- try {
- return fCurrentScanner.scanDocument(complete);
- } catch (XNIException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- } catch (IOException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- } catch (RuntimeException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- } catch (Exception ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw new XNIException(ex);
- }
-
- } // parse(boolean):boolean
-
- /**
- * Returns the state of a feature.
- *
- * @param featureId The feature identifier.
- * @return true if the feature is supported
- *
- * @throws XMLConfigurationException Thrown for configuration error.
- * In general, components should
- * only throw this exception if
- * it is <strong>really</strong>
- * a critical error.
- */
- public FeatureState getFeatureState(String featureId)
- throws XMLConfigurationException {
- // make this feature special
- if (featureId.equals(PARSER_SETTINGS)){
- return FeatureState.is(fConfigUpdated);
- }
- return super.getFeatureState(featureId);
-
- } // getFeature(String):boolean
-
- /**
- * Set the state of a feature.
- *
- * Set the state of any feature in a SAX2 parser. The parser
- * might not recognize the feature, and if it does recognize
- * it, it might not be able to fulfill the request.
- *
- * @param featureId The unique identifier (URI) of the feature.
- * @param state The requested state of the feature (true or false).
- *
- * @exception com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException If the
- * requested feature is not known.
- */
- public void setFeature(String featureId, boolean state)
- throws XMLConfigurationException {
- fConfigUpdated = true;
- // forward to every XML 1.0 component
- int count = fComponents.size();
- for (int i = 0; i < count; i++) {
- XMLComponent c = (XMLComponent) fComponents.get(i);
- c.setFeature(featureId, state);
- }
- // forward it to common components
- count = fCommonComponents.size();
- for (int i = 0; i < count; i++) {
- XMLComponent c = (XMLComponent) fCommonComponents.get(i);
- c.setFeature(featureId, state);
- }
-
- // forward to every XML 1.1 component
- count = fXML11Components.size();
- for (int i = 0; i < count; i++) {
- XMLComponent c = (XMLComponent) fXML11Components.get(i);
- try{
- c.setFeature(featureId, state);
- }
- catch (Exception e){
- // no op
- }
- }
- // save state if noone "objects"
- super.setFeature(featureId, state);
-
- } // setFeature(String,boolean)
-
- /**
- * setProperty
- *
- * @param propertyId
- * @param value
- */
- public void setProperty(String propertyId, Object value)
- throws XMLConfigurationException {
- fConfigUpdated = true;
- // forward to every XML 1.0 component
- int count = fComponents.size();
- for (int i = 0; i < count; i++) {
- XMLComponent c = (XMLComponent) fComponents.get(i);
- c.setProperty(propertyId, value);
- }
- // forward it to every common Component
- count = fCommonComponents.size();
- for (int i = 0; i < count; i++) {
- XMLComponent c = (XMLComponent) fCommonComponents.get(i);
- c.setProperty(propertyId, value);
- }
- // forward it to every XML 1.1 component
- count = fXML11Components.size();
- for (int i = 0; i < count; i++) {
- XMLComponent c = (XMLComponent) fXML11Components.get(i);
- try{
- c.setProperty(propertyId, value);
- }
- catch (Exception e){
- // ignore it
- }
- }
-
- // store value if noone "objects"
- super.setProperty(propertyId, value);
-
- } // setProperty(String,Object)
-
-
- /** Returns the locale. */
- public Locale getLocale() {
- return fLocale;
- } // getLocale():Locale
-
- /**
- * reset all XML 1.0 components before parsing and namespace context
- */
- protected void reset() throws XNIException {
- int count = fComponents.size();
- for (int i = 0; i < count; i++) {
- XMLComponent c = (XMLComponent) fComponents.get(i);
- c.reset(this);
- }
-
- } // reset()
-
- /**
- * reset all common components before parsing
- */
- protected void resetCommon() throws XNIException {
- // reset common components
- int count = fCommonComponents.size();
- for (int i = 0; i < count; i++) {
- XMLComponent c = (XMLComponent) fCommonComponents.get(i);
- c.reset(this);
- }
-
- } // resetCommon()
-
- /**
- * reset all components before parsing and namespace context
- */
- protected void resetXML11() throws XNIException {
- // reset every component
- int count = fXML11Components.size();
- for (int i = 0; i < count; i++) {
- XMLComponent c = (XMLComponent) fXML11Components.get(i);
- c.reset(this);
- }
-
- } // resetXML11()
-
- /**
- * Configures the XML 1.1 pipeline.
- * Note: this method also resets the new XML11 components.
- */
- protected void configureXML11Pipeline() {
- if (fCurrentDVFactory != fXML11DatatypeFactory) {
- fCurrentDVFactory = fXML11DatatypeFactory;
- setProperty(DATATYPE_VALIDATOR_FACTORY, fCurrentDVFactory);
- }
- if (fCurrentDTDScanner != fXML11DTDScanner) {
- fCurrentDTDScanner = fXML11DTDScanner;
- setProperty(DTD_SCANNER, fCurrentDTDScanner);
- setProperty(DTD_PROCESSOR, fXML11DTDProcessor);
- }
-
- fXML11DTDScanner.setDTDHandler(fXML11DTDProcessor);
- fXML11DTDProcessor.setDTDSource(fXML11DTDScanner);
- fXML11DTDProcessor.setDTDHandler(fDTDHandler);
- if (fDTDHandler != null) {
- fDTDHandler.setDTDSource(fXML11DTDProcessor);
- }
-
- fXML11DTDScanner.setDTDContentModelHandler(fXML11DTDProcessor);
- fXML11DTDProcessor.setDTDContentModelSource(fXML11DTDScanner);
- fXML11DTDProcessor.setDTDContentModelHandler(fDTDContentModelHandler);
- if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.setDTDContentModelSource(fXML11DTDProcessor);
- }
-
- // setup XML 1.1 document pipeline
- if (fFeatures.get(NAMESPACES) == Boolean.TRUE) {
- if (fCurrentScanner != fXML11NSDocScanner) {
- fCurrentScanner = fXML11NSDocScanner;
- setProperty(DOCUMENT_SCANNER, fXML11NSDocScanner);
- setProperty(DTD_VALIDATOR, fXML11NSDTDValidator);
- }
-
- fXML11NSDocScanner.setDTDValidator(fXML11NSDTDValidator);
- fXML11NSDocScanner.setDocumentHandler(fXML11NSDTDValidator);
- fXML11NSDTDValidator.setDocumentSource(fXML11NSDocScanner);
- fXML11NSDTDValidator.setDocumentHandler(fDocumentHandler);
-
- if (fDocumentHandler != null) {
- fDocumentHandler.setDocumentSource(fXML11NSDTDValidator);
- }
- fLastComponent = fXML11NSDTDValidator;
-
- } else {
- // create components
- if (fXML11DocScanner == null) {
- // non namespace document pipeline
- fXML11DocScanner = new XML11DocumentScannerImpl();
- addXML11Component(fXML11DocScanner);
- fXML11DTDValidator = new XML11DTDValidator();
- addXML11Component(fXML11DTDValidator);
- }
- if (fCurrentScanner != fXML11DocScanner) {
- fCurrentScanner = fXML11DocScanner;
- setProperty(DOCUMENT_SCANNER, fXML11DocScanner);
- setProperty(DTD_VALIDATOR, fXML11DTDValidator);
- }
- fXML11DocScanner.setDocumentHandler(fXML11DTDValidator);
- fXML11DTDValidator.setDocumentSource(fXML11DocScanner);
- fXML11DTDValidator.setDocumentHandler(fDocumentHandler);
-
- if (fDocumentHandler != null) {
- fDocumentHandler.setDocumentSource(fXML11DTDValidator);
- }
- fLastComponent = fXML11DTDValidator;
- }
-
- } // configureXML11Pipeline()
-
- /** Configures the pipeline. */
- protected void configurePipeline() {
- if (fCurrentDVFactory != fDatatypeValidatorFactory) {
- fCurrentDVFactory = fDatatypeValidatorFactory;
- // use XML 1.0 datatype library
- setProperty(DATATYPE_VALIDATOR_FACTORY, fCurrentDVFactory);
- }
-
- // setup DTD pipeline
- if (fCurrentDTDScanner != fDTDScanner) {
- fCurrentDTDScanner = fDTDScanner;
- setProperty(DTD_SCANNER, fCurrentDTDScanner);
- setProperty(DTD_PROCESSOR, fDTDProcessor);
- }
- fDTDScanner.setDTDHandler(fDTDProcessor);
- fDTDProcessor.setDTDSource(fDTDScanner);
- fDTDProcessor.setDTDHandler(fDTDHandler);
- if (fDTDHandler != null) {
- fDTDHandler.setDTDSource(fDTDProcessor);
- }
-
- fDTDScanner.setDTDContentModelHandler(fDTDProcessor);
- fDTDProcessor.setDTDContentModelSource(fDTDScanner);
- fDTDProcessor.setDTDContentModelHandler(fDTDContentModelHandler);
- if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.setDTDContentModelSource(fDTDProcessor);
- }
-
- // setup document pipeline
- if (fFeatures.get(NAMESPACES) == Boolean.TRUE) {
- if (fCurrentScanner != fNamespaceScanner) {
- fCurrentScanner = fNamespaceScanner;
- setProperty(DOCUMENT_SCANNER, fNamespaceScanner);
- setProperty(DTD_VALIDATOR, fDTDValidator);
- }
- fNamespaceScanner.setDTDValidator(fDTDValidator);
- fNamespaceScanner.setDocumentHandler(fDTDValidator);
- fDTDValidator.setDocumentSource(fNamespaceScanner);
- fDTDValidator.setDocumentHandler(fDocumentHandler);
- if (fDocumentHandler != null) {
- fDocumentHandler.setDocumentSource(fDTDValidator);
- }
- fLastComponent = fDTDValidator;
- } else {
- // create components
- if (fNonNSScanner == null) {
- fNonNSScanner = new XMLDocumentScannerImpl();
- fNonNSDTDValidator = new XMLDTDValidator();
- // add components
- addComponent((XMLComponent) fNonNSScanner);
- addComponent((XMLComponent) fNonNSDTDValidator);
- }
- if (fCurrentScanner != fNonNSScanner) {
- fCurrentScanner = fNonNSScanner;
- setProperty(DOCUMENT_SCANNER, fNonNSScanner);
- setProperty(DTD_VALIDATOR, fNonNSDTDValidator);
- }
-
- fNonNSScanner.setDocumentHandler(fNonNSDTDValidator);
- fNonNSDTDValidator.setDocumentSource(fNonNSScanner);
- fNonNSDTDValidator.setDocumentHandler(fDocumentHandler);
- if (fDocumentHandler != null) {
- fDocumentHandler.setDocumentSource(fNonNSDTDValidator);
- }
- fLastComponent = fNonNSDTDValidator;
- }
-
- } // configurePipeline()
-
-
- // features and properties
-
- /**
- * Check a feature. If feature is know and supported, this method simply
- * returns. Otherwise, the appropriate exception is thrown.
- *
- * @param featureId The unique identifier (URI) of the feature.
- *
- * @throws XMLConfigurationException Thrown for configuration error.
- * In general, components should
- * only throw this exception if
- * it is <strong>really</strong>
- * a critical error.
- */
- protected FeatureState checkFeature(String featureId) throws XMLConfigurationException {
-
- //
- // Xerces Features
- //
-
- if (featureId.startsWith(Constants.XERCES_FEATURE_PREFIX)) {
- final int suffixLength = featureId.length() - Constants.XERCES_FEATURE_PREFIX.length();
-
- //
- // http://apache.org/xml/features/validation/dynamic
- // Allows the parser to validate a document only when it
- // contains a grammar. Validation is turned on/off based
- // on each document instance, automatically.
- //
- if (suffixLength == Constants.DYNAMIC_VALIDATION_FEATURE.length() &&
- featureId.endsWith(Constants.DYNAMIC_VALIDATION_FEATURE)) {
- return FeatureState.RECOGNIZED;
- }
-
- //
- // http://apache.org/xml/features/validation/default-attribute-values
- //
- if (suffixLength == Constants.DEFAULT_ATTRIBUTE_VALUES_FEATURE.length() &&
- featureId.endsWith(Constants.DEFAULT_ATTRIBUTE_VALUES_FEATURE)) {
- // REVISIT
- return FeatureState.NOT_SUPPORTED;
- }
- //
- // http://apache.org/xml/features/validation/default-attribute-values
- //
- if (suffixLength == Constants.VALIDATE_CONTENT_MODELS_FEATURE.length() &&
- featureId.endsWith(Constants.VALIDATE_CONTENT_MODELS_FEATURE)) {
- // REVISIT
- return FeatureState.NOT_SUPPORTED;
- }
- //
- // http://apache.org/xml/features/validation/nonvalidating/load-dtd-grammar
- //
- if (suffixLength == Constants.LOAD_DTD_GRAMMAR_FEATURE.length() &&
- featureId.endsWith(Constants.LOAD_DTD_GRAMMAR_FEATURE)) {
- return FeatureState.RECOGNIZED;
- }
- //
- // http://apache.org/xml/features/validation/nonvalidating/load-external-dtd
- //
- if (suffixLength == Constants.LOAD_EXTERNAL_DTD_FEATURE.length() &&
- featureId.endsWith(Constants.LOAD_EXTERNAL_DTD_FEATURE)) {
- return FeatureState.RECOGNIZED;
- }
-
- //
- // http://apache.org/xml/features/validation/default-attribute-values
- //
- if (suffixLength == Constants.VALIDATE_DATATYPES_FEATURE.length() &&
- featureId.endsWith(Constants.VALIDATE_DATATYPES_FEATURE)) {
- return FeatureState.NOT_SUPPORTED;
- }
-
- // special performance feature: only component manager is allowed to set it.
- if (suffixLength == Constants.PARSER_SETTINGS.length() &&
- featureId.endsWith(Constants.PARSER_SETTINGS)) {
- return FeatureState.NOT_SUPPORTED;
- }
- }
-
- //
- // Not recognized
- //
-
- return super.checkFeature(featureId);
-
- } // checkFeature(String)
-
- /**
- * Check a property. If the property is know and supported, this method
- * simply returns. Otherwise, the appropriate exception is thrown.
- *
- * @param propertyId The unique identifier (URI) of the property
- * being set.
- *
- * @throws XMLConfigurationException Thrown for configuration error.
- * In general, components should
- * only throw this exception if
- * it is <strong>really</strong>
- * a critical error.
- */
- protected PropertyState checkProperty(String propertyId) throws XMLConfigurationException {
-
- //
- // Xerces Properties
- //
-
- if (propertyId.startsWith(Constants.XERCES_PROPERTY_PREFIX)) {
- final int suffixLength = propertyId.length() - Constants.XERCES_PROPERTY_PREFIX.length();
-
- if (suffixLength == Constants.DTD_SCANNER_PROPERTY.length() &&
- propertyId.endsWith(Constants.DTD_SCANNER_PROPERTY)) {
- return PropertyState.RECOGNIZED;
- }
- }
-
- // special cases
- if (propertyId.startsWith(Constants.SAX_PROPERTY_PREFIX)) {
- final int suffixLength = propertyId.length() - Constants.SAX_PROPERTY_PREFIX.length();
-
- //
- // http://xml.org/sax/properties/xml-string
- // Value type: String
- // Access: read-only
- // Get the literal string of characters associated with the
- // current event. If the parser recognises and supports this
- // property but is not currently parsing text, it should return
- // null (this is a good way to check for availability before the
- // parse begins).
- //
- if (suffixLength == Constants.XML_STRING_PROPERTY.length() &&
- propertyId.endsWith(Constants.XML_STRING_PROPERTY)) {
- // REVISIT - we should probably ask xml-dev for a precise
- // definition of what this is actually supposed to return, and
- // in exactly which circumstances.
- return PropertyState.NOT_SUPPORTED;
- }
- }
-
- //
- // Not recognized
- //
-
- return super.checkProperty(propertyId);
-
- } // checkProperty(String)
-
-
- /**
- * Adds a component to the parser configuration. This method will
- * also add all of the component's recognized features and properties
- * to the list of default recognized features and properties.
- *
- * @param component The component to add.
- */
- protected void addComponent(XMLComponent component) {
-
- // don't add a component more than once
- if (fComponents.contains(component)) {
- return;
- }
- fComponents.add(component);
- addRecognizedParamsAndSetDefaults(component);
-
- } // addComponent(XMLComponent)
-
- /**
- * Adds common component to the parser configuration. This method will
- * also add all of the component's recognized features and properties
- * to the list of default recognized features and properties.
- *
- * @param component The component to add.
- */
- protected void addCommonComponent(XMLComponent component) {
-
- // don't add a component more than once
- if (fCommonComponents.contains(component)) {
- return;
- }
- fCommonComponents.add(component);
- addRecognizedParamsAndSetDefaults(component);
-
- } // addCommonComponent(XMLComponent)
-
- /**
- * Adds an XML 1.1 component to the parser configuration. This method will
- * also add all of the component's recognized features and properties
- * to the list of default recognized features and properties.
- *
- * @param component The component to add.
- */
- protected void addXML11Component(XMLComponent component) {
-
- // don't add a component more than once
- if (fXML11Components.contains(component)) {
- return;
- }
- fXML11Components.add(component);
- addRecognizedParamsAndSetDefaults(component);
-
- } // addXML11Component(XMLComponent)
-
- /**
- * Adds all of the component's recognized features and properties
- * to the list of default recognized features and properties, and
- * sets default values on the configuration for features and
- * properties which were previously absent from the configuration.
- *
- * @param component The component whose recognized features
- * and properties will be added to the configuration
- */
- protected void addRecognizedParamsAndSetDefaults(XMLComponent component) {
-
- // register component's recognized features
- String[] recognizedFeatures = component.getRecognizedFeatures();
- addRecognizedFeatures(recognizedFeatures);
-
- // register component's recognized properties
- String[] recognizedProperties = component.getRecognizedProperties();
- addRecognizedProperties(recognizedProperties);
-
- // set default values
- if (recognizedFeatures != null) {
- for (int i = 0; i < recognizedFeatures.length; ++i) {
- String featureId = recognizedFeatures[i];
- Boolean state = component.getFeatureDefault(featureId);
- if (state != null) {
- // Do not overwrite values already set on the configuration.
- if (!fFeatures.containsKey(featureId)) {
- fFeatures.put(featureId, state);
- // For newly added components who recognize this feature
- // but did not offer a default value, we need to make
- // sure these components will get an opportunity to read
- // the value before parsing begins.
- fConfigUpdated = true;
- }
- }
- }
- }
- if (recognizedProperties != null) {
- for (int i = 0; i < recognizedProperties.length; ++i) {
- String propertyId = recognizedProperties[i];
- Object value = component.getPropertyDefault(propertyId);
- if (value != null) {
- // Do not overwrite values already set on the configuration.
- if (!fProperties.containsKey(propertyId)) {
- fProperties.put(propertyId, value);
- // For newly added components who recognize this property
- // but did not offer a default value, we need to make
- // sure these components will get an opportunity to read
- // the value before parsing begins.
- fConfigUpdated = true;
- }
- }
- }
- }
- }
-
- private void initXML11Components() {
- if (!f11Initialized) {
-
- // create datatype factory
- fXML11DatatypeFactory = DTDDVFactory.getInstance(XML11_DATATYPE_VALIDATOR_FACTORY);
-
- // setup XML 1.1 DTD pipeline
- fXML11DTDScanner = new XML11DTDScannerImpl();
- addXML11Component(fXML11DTDScanner);
- fXML11DTDProcessor = new XML11DTDProcessor();
- addXML11Component(fXML11DTDProcessor);
-
- // setup XML 1.1. document pipeline - namespace aware
- fXML11NSDocScanner = new XML11NSDocumentScannerImpl();
- addXML11Component(fXML11NSDocScanner);
- fXML11NSDTDValidator = new XML11NSDTDValidator();
- addXML11Component(fXML11NSDTDValidator);
-
- f11Initialized = true;
- }
- }
-
-} // class XML11DTDConfiguration
diff --git a/src/com/sun/org/apache/xerces/internal/parsers/XML11NonValidatingConfiguration.java b/src/com/sun/org/apache/xerces/internal/parsers/XML11NonValidatingConfiguration.java
deleted file mode 100644
index 43f8730..0000000
--- a/src/com/sun/org/apache/xerces/internal/parsers/XML11NonValidatingConfiguration.java
+++ /dev/null
@@ -1,1230 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.parsers;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Locale;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.XML11DTDScannerImpl;
-import com.sun.org.apache.xerces.internal.impl.XML11DocumentScannerImpl;
-import com.sun.org.apache.xerces.internal.impl.XML11NSDocumentScannerImpl;
-import com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl;
-import com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl;
-import com.sun.org.apache.xerces.internal.impl.XMLEntityHandler;
-import com.sun.org.apache.xerces.internal.impl.XMLEntityManager;
-import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
-import com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl;
-import com.sun.org.apache.xerces.internal.impl.XMLVersionDetector;
-import com.sun.org.apache.xerces.internal.impl.dv.DTDDVFactory;
-import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter;
-import com.sun.org.apache.xerces.internal.impl.validation.ValidationManager;
-import com.sun.org.apache.xerces.internal.util.FeatureState;
-import com.sun.org.apache.xerces.internal.util.ParserConfigurationSettings;
-import com.sun.org.apache.xerces.internal.util.PropertyState;
-import com.sun.org.apache.xerces.internal.util.Status;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLDTDHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLLocator;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponent;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDScanner;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentScanner;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLEntityResolver;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLPullParserConfiguration;
-
-/**
- * This class is the non vlaidating parser configuration
- * used to parse XML 1.0 and XML 1.1 documents.
- *
- * Xerces parser that uses this configuration is <strong>not</strong> <a href="http://www.w3.org/TR/REC-xml#sec-conformance">conformant</a>
- * non-validating XML processor, since conformant non-validating processor is required
- * to process "all the declarations they read in the internal DTD subset ... must use the information in those declarations to normalize attribute values,
- * include the replacement text of internal entities, and supply default attribute values".
-
- * @author Elena Litani, IBM
- * @author John Kim, IBM
- * @author Michael Glavassevich, IBM
- *
- * @version $Id: XML11NonValidatingConfiguration.java,v 1.5 2010-11-01 04:40:10 joehw Exp $
- */
-public class XML11NonValidatingConfiguration extends ParserConfigurationSettings
- implements XMLPullParserConfiguration, XML11Configurable {
-
- //
- // Constants
- //
- protected final static String XML11_DATATYPE_VALIDATOR_FACTORY =
- "com.sun.org.apache.xerces.internal.impl.dv.dtd.XML11DTDDVFactoryImpl";
-
- // feature identifiers
-
- /** Feature identifier: validation. */
- protected static final String VALIDATION =
- Constants.SAX_FEATURE_PREFIX + Constants.VALIDATION_FEATURE;
-
- /** Feature identifier: namespaces. */
- protected static final String NAMESPACES =
- Constants.SAX_FEATURE_PREFIX + Constants.NAMESPACES_FEATURE;
-
- /** Feature identifier: external general entities. */
- protected static final String EXTERNAL_GENERAL_ENTITIES =
- Constants.SAX_FEATURE_PREFIX + Constants.EXTERNAL_GENERAL_ENTITIES_FEATURE;
-
- /** Feature identifier: external parameter entities. */
- protected static final String EXTERNAL_PARAMETER_ENTITIES =
- Constants.SAX_FEATURE_PREFIX + Constants.EXTERNAL_PARAMETER_ENTITIES_FEATURE;
-
-
- /** Feature identifier: continue after fatal error. */
- protected static final String CONTINUE_AFTER_FATAL_ERROR =
- Constants.XERCES_FEATURE_PREFIX + Constants.CONTINUE_AFTER_FATAL_ERROR_FEATURE;
-
-
- // property identifiers
-
- /** Property identifier: xml string. */
- protected static final String XML_STRING =
- Constants.SAX_PROPERTY_PREFIX + Constants.XML_STRING_PROPERTY;
-
- /** Property identifier: symbol table. */
- protected static final String SYMBOL_TABLE =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY;
-
- /** Property identifier: error handler. */
- protected static final String ERROR_HANDLER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_HANDLER_PROPERTY;
-
- /** Property identifier: entity resolver. */
- protected static final String ENTITY_RESOLVER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_RESOLVER_PROPERTY;
-
- /** Property identifier: error reporter. */
- protected static final String ERROR_REPORTER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY;
-
- /** Property identifier: entity manager. */
- protected static final String ENTITY_MANAGER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_MANAGER_PROPERTY;
-
- /** Property identifier document scanner: */
- protected static final String DOCUMENT_SCANNER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.DOCUMENT_SCANNER_PROPERTY;
-
- /** Property identifier: DTD scanner. */
- protected static final String DTD_SCANNER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.DTD_SCANNER_PROPERTY;
-
- /** Property identifier: grammar pool. */
- protected static final String XMLGRAMMAR_POOL =
- Constants.XERCES_PROPERTY_PREFIX + Constants.XMLGRAMMAR_POOL_PROPERTY;
-
- /** Property identifier: DTD validator. */
- protected static final String DTD_VALIDATOR =
- Constants.XERCES_PROPERTY_PREFIX + Constants.DTD_VALIDATOR_PROPERTY;
-
- /** Property identifier: namespace binder. */
- protected static final String NAMESPACE_BINDER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.NAMESPACE_BINDER_PROPERTY;
-
- /** Property identifier: datatype validator factory. */
- protected static final String DATATYPE_VALIDATOR_FACTORY =
- Constants.XERCES_PROPERTY_PREFIX + Constants.DATATYPE_VALIDATOR_FACTORY_PROPERTY;
-
- protected static final String VALIDATION_MANAGER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.VALIDATION_MANAGER_PROPERTY;
-
- // debugging
-
- /** Set to true and recompile to print exception stack trace. */
- protected static final boolean PRINT_EXCEPTION_STACK_TRACE = false;
-
- //
- // Data
- //
- protected SymbolTable fSymbolTable;
- protected XMLInputSource fInputSource;
- protected ValidationManager fValidationManager;
- protected XMLVersionDetector fVersionDetector;
- protected XMLLocator fLocator;
- protected Locale fLocale;
-
- /** XML 1.0 Components. */
- protected ArrayList fComponents;
-
- /** XML 1.1. Components. */
- protected ArrayList fXML11Components = null;
-
- /** Common components: XMLEntityManager, XMLErrorReporter */
- protected ArrayList fCommonComponents = null;
-
- /** The document handler. */
- protected XMLDocumentHandler fDocumentHandler;
-
- /** The DTD handler. */
- protected XMLDTDHandler fDTDHandler;
-
- /** The DTD content model handler. */
- protected XMLDTDContentModelHandler fDTDContentModelHandler;
-
- /** Last component in the document pipeline */
- protected XMLDocumentSource fLastComponent;
-
- /**
- * True if a parse is in progress. This state is needed because
- * some features/properties cannot be set while parsing (e.g.
- * namespaces).
- */
- protected boolean fParseInProgress = false;
-
- /** fConfigUpdated is set to true if there has been any change to the configuration settings,
- * i.e a feature or a property was changed.
- */
- protected boolean fConfigUpdated = false;
-
- //
- // XML 1.0 components
- //
-
- /** The XML 1.0 Datatype validator factory. */
- protected DTDDVFactory fDatatypeValidatorFactory;
-
- /** The XML 1.0 Document scanner that does namespace binding. */
- protected XMLNSDocumentScannerImpl fNamespaceScanner;
-
- /** The XML 1.0 Non-namespace implementation of scanner */
- protected XMLDocumentScannerImpl fNonNSScanner;
-
- /** The XML 1.0 DTD scanner. */
- protected XMLDTDScanner fDTDScanner;
-
- //
- // XML 1.1 components
- //
-
- /** The XML 1.1 datatype factory. **/
- protected DTDDVFactory fXML11DatatypeFactory = null;
-
- /** The XML 1.1 document scanner that does namespace binding. **/
- protected XML11NSDocumentScannerImpl fXML11NSDocScanner = null;
-
- /** The XML 1.1 document scanner that does not do namespace binding. **/
- protected XML11DocumentScannerImpl fXML11DocScanner = null;
-
- /** The XML 1.1 DTD scanner. **/
- protected XML11DTDScannerImpl fXML11DTDScanner = null;
-
- //
- // Common components
- //
-
- /** Grammar pool. */
- protected XMLGrammarPool fGrammarPool;
-
- /** Error reporter. */
- protected XMLErrorReporter fErrorReporter;
-
- /** Entity manager. */
- protected XMLEntityManager fEntityManager;
-
- /** Current scanner */
- protected XMLDocumentScanner fCurrentScanner;
-
- /** Current Datatype validator factory. */
- protected DTDDVFactory fCurrentDVFactory;
-
- /** Current DTD scanner. */
- protected XMLDTDScanner fCurrentDTDScanner;
-
-
- /** Flag indiciating whether XML11 components have been initialized. */
- private boolean f11Initialized = false;
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- public XML11NonValidatingConfiguration() {
- this(null, null, null);
- } // <init>()
-
- /**
- * Constructs a parser configuration using the specified symbol table.
- *
- * @param symbolTable The symbol table to use.
- */
- public XML11NonValidatingConfiguration(SymbolTable symbolTable) {
- this(symbolTable, null, null);
- } // <init>(SymbolTable)
-
- /**
- * Constructs a parser configuration using the specified symbol table and
- * grammar pool.
- * <p>
- * <strong>REVISIT:</strong>
- * Grammar pool will be updated when the new validation engine is
- * implemented.
- *
- * @param symbolTable The symbol table to use.
- * @param grammarPool The grammar pool to use.
- */
- public XML11NonValidatingConfiguration(SymbolTable symbolTable, XMLGrammarPool grammarPool) {
- this(symbolTable, grammarPool, null);
- } // <init>(SymbolTable,XMLGrammarPool)
-
- /**
- * Constructs a parser configuration using the specified symbol table,
- * grammar pool, and parent settings.
- * <p>
- * <strong>REVISIT:</strong>
- * Grammar pool will be updated when the new validation engine is
- * implemented.
- *
- * @param symbolTable The symbol table to use.
- * @param grammarPool The grammar pool to use.
- * @param parentSettings The parent settings.
- */
- public XML11NonValidatingConfiguration(
- SymbolTable symbolTable,
- XMLGrammarPool grammarPool,
- XMLComponentManager parentSettings) {
-
- super(parentSettings);
-
- // create a vector to hold all the components in use
- // XML 1.0 specialized components
- fComponents = new ArrayList();
- // XML 1.1 specialized components
- fXML11Components = new ArrayList();
- // Common components for XML 1.1. and XML 1.0
- fCommonComponents = new ArrayList();
-
- // create table for features and properties
- fFeatures = new HashMap();
- fProperties = new HashMap();
-
- // add default recognized features
- final String[] recognizedFeatures =
- {
- CONTINUE_AFTER_FATAL_ERROR, // from XMLDTDScannerImpl
- VALIDATION,
- NAMESPACES,
- EXTERNAL_GENERAL_ENTITIES,
- EXTERNAL_PARAMETER_ENTITIES,
- PARSER_SETTINGS
- };
- addRecognizedFeatures(recognizedFeatures);
-
- // set state for default features
- fFeatures.put(VALIDATION, Boolean.FALSE);
- fFeatures.put(NAMESPACES, Boolean.TRUE);
- fFeatures.put(EXTERNAL_GENERAL_ENTITIES, Boolean.TRUE);
- fFeatures.put(EXTERNAL_PARAMETER_ENTITIES, Boolean.TRUE);
- fFeatures.put(CONTINUE_AFTER_FATAL_ERROR, Boolean.FALSE);
- fFeatures.put(PARSER_SETTINGS, Boolean.TRUE);
-
- // add default recognized properties
- final String[] recognizedProperties =
- {
- XML_STRING,
- SYMBOL_TABLE,
- ERROR_HANDLER,
- ENTITY_RESOLVER,
- ERROR_REPORTER,
- ENTITY_MANAGER,
- DOCUMENT_SCANNER,
- DTD_SCANNER,
- DTD_VALIDATOR,
- DATATYPE_VALIDATOR_FACTORY,
- VALIDATION_MANAGER,
- XML_STRING,
- XMLGRAMMAR_POOL, };
- addRecognizedProperties(recognizedProperties);
-
- if (symbolTable == null) {
- symbolTable = new SymbolTable();
- }
- fSymbolTable = symbolTable;
- fProperties.put(SYMBOL_TABLE, fSymbolTable);
-
- fGrammarPool = grammarPool;
- if (fGrammarPool != null) {
- fProperties.put(XMLGRAMMAR_POOL, fGrammarPool);
- }
-
- fEntityManager = new XMLEntityManager();
- fProperties.put(ENTITY_MANAGER, fEntityManager);
- addCommonComponent(fEntityManager);
-
- fErrorReporter = new XMLErrorReporter();
- fErrorReporter.setDocumentLocator(fEntityManager.getEntityScanner());
- fProperties.put(ERROR_REPORTER, fErrorReporter);
- addCommonComponent(fErrorReporter);
-
- fNamespaceScanner = new XMLNSDocumentScannerImpl();
- fProperties.put(DOCUMENT_SCANNER, fNamespaceScanner);
- addComponent((XMLComponent) fNamespaceScanner);
-
- fDTDScanner = new XMLDTDScannerImpl();
- fProperties.put(DTD_SCANNER, fDTDScanner);
- addComponent((XMLComponent) fDTDScanner);
-
- fDatatypeValidatorFactory = DTDDVFactory.getInstance();
- fProperties.put(DATATYPE_VALIDATOR_FACTORY, fDatatypeValidatorFactory);
-
- fValidationManager = new ValidationManager();
- fProperties.put(VALIDATION_MANAGER, fValidationManager);
-
- fVersionDetector = new XMLVersionDetector();
-
- // add message formatters
- if (fErrorReporter.getMessageFormatter(XMLMessageFormatter.XML_DOMAIN) == null) {
- XMLMessageFormatter xmft = new XMLMessageFormatter();
- fErrorReporter.putMessageFormatter(XMLMessageFormatter.XML_DOMAIN, xmft);
- fErrorReporter.putMessageFormatter(XMLMessageFormatter.XMLNS_DOMAIN, xmft);
- }
-
- // set locale
- try {
- setLocale(Locale.getDefault());
- } catch (XNIException e) {
- // do nothing
- // REVISIT: What is the right thing to do? -Ac
- }
-
- fConfigUpdated = false;
-
- } // <init>(SymbolTable,XMLGrammarPool)
-
- /**
- * Sets the input source for the document to parse.
- *
- * @param inputSource The document's input source.
- *
- * @exception XMLConfigurationException Thrown if there is a
- * configuration error when initializing the
- * parser.
- * @exception IOException Thrown on I/O error.
- *
- * @see #parse(boolean)
- */
- public void setInputSource(XMLInputSource inputSource)
- throws XMLConfigurationException, IOException {
-
- // REVISIT: this method used to reset all the components and
- // construct the pipeline. Now reset() is called
- // in parse (boolean) just before we parse the document
- // Should this method still throw exceptions..?
-
- fInputSource = inputSource;
-
- } // setInputSource(XMLInputSource)
-
- /**
- * Set the locale to use for messages.
- *
- * @param locale The locale object to use for localization of messages.
- *
- * @exception XNIException Thrown if the parser does not support the
- * specified locale.
- */
- public void setLocale(Locale locale) throws XNIException {
- fLocale = locale;
- fErrorReporter.setLocale(locale);
- } // setLocale(Locale)
-
- /**
- * Sets the document handler on the last component in the pipeline
- * to receive information about the document.
- *
- * @param documentHandler The document handler.
- */
- public void setDocumentHandler(XMLDocumentHandler documentHandler) {
- fDocumentHandler = documentHandler;
- if (fLastComponent != null) {
- fLastComponent.setDocumentHandler(fDocumentHandler);
- if (fDocumentHandler !=null){
- fDocumentHandler.setDocumentSource(fLastComponent);
- }
- }
- } // setDocumentHandler(XMLDocumentHandler)
-
- /** Returns the registered document handler. */
- public XMLDocumentHandler getDocumentHandler() {
- return fDocumentHandler;
- } // getDocumentHandler():XMLDocumentHandler
-
- /**
- * Sets the DTD handler.
- *
- * @param dtdHandler The DTD handler.
- */
- public void setDTDHandler(XMLDTDHandler dtdHandler) {
- fDTDHandler = dtdHandler;
- } // setDTDHandler(XMLDTDHandler)
-
- /** Returns the registered DTD handler. */
- public XMLDTDHandler getDTDHandler() {
- return fDTDHandler;
- } // getDTDHandler():XMLDTDHandler
-
- /**
- * Sets the DTD content model handler.
- *
- * @param handler The DTD content model handler.
- */
- public void setDTDContentModelHandler(XMLDTDContentModelHandler handler) {
- fDTDContentModelHandler = handler;
- } // setDTDContentModelHandler(XMLDTDContentModelHandler)
-
- /** Returns the registered DTD content model handler. */
- public XMLDTDContentModelHandler getDTDContentModelHandler() {
- return fDTDContentModelHandler;
- } // getDTDContentModelHandler():XMLDTDContentModelHandler
-
- /**
- * Sets the resolver used to resolve external entities. The EntityResolver
- * interface supports resolution of public and system identifiers.
- *
- * @param resolver The new entity resolver. Passing a null value will
- * uninstall the currently installed resolver.
- */
- public void setEntityResolver(XMLEntityResolver resolver) {
- fProperties.put(ENTITY_RESOLVER, resolver);
- } // setEntityResolver(XMLEntityResolver)
-
- /**
- * Return the current entity resolver.
- *
- * @return The current entity resolver, or null if none
- * has been registered.
- * @see #setEntityResolver
- */
- public XMLEntityResolver getEntityResolver() {
- return (XMLEntityResolver)fProperties.get(ENTITY_RESOLVER);
- } // getEntityResolver():XMLEntityResolver
-
- /**
- * Allow an application to register an error event handler.
- *
- * <p>If the application does not register an error handler, all
- * error events reported by the SAX parser will be silently
- * ignored; however, normal processing may not continue. It is
- * highly recommended that all SAX applications implement an
- * error handler to avoid unexpected bugs.</p>
- *
- * <p>Applications may register a new or different handler in the
- * middle of a parse, and the SAX parser must begin using the new
- * handler immediately.</p>
- *
- * @param errorHandler The error handler.
- * @exception java.lang.NullPointerException If the handler
- * argument is null.
- * @see #getErrorHandler
- */
- public void setErrorHandler(XMLErrorHandler errorHandler) {
- fProperties.put(ERROR_HANDLER, errorHandler);
- } // setErrorHandler(XMLErrorHandler)
-
- /**
- * Return the current error handler.
- *
- * @return The current error handler, or null if none
- * has been registered.
- * @see #setErrorHandler
- */
- public XMLErrorHandler getErrorHandler() {
- // REVISIT: Should this be a property?
- return (XMLErrorHandler)fProperties.get(ERROR_HANDLER);
- } // getErrorHandler():XMLErrorHandler
-
-
- /**
- * If the application decides to terminate parsing before the xml document
- * is fully parsed, the application should call this method to free any
- * resource allocated during parsing. For example, close all opened streams.
- */
- public void cleanup() {
- fEntityManager.closeReaders();
- }
-
- /**
- * Parses the specified input source.
- *
- * @param source The input source.
- *
- * @exception XNIException Throws exception on XNI error.
- * @exception java.io.IOException Throws exception on i/o error.
- */
- public void parse(XMLInputSource source) throws XNIException, IOException {
-
- if (fParseInProgress) {
- // REVISIT - need to add new error message
- throw new XNIException("FWK005 parse may not be called while parsing.");
- }
- fParseInProgress = true;
-
- try {
- setInputSource(source);
- parse(true);
- } catch (XNIException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- } catch (IOException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- } catch (RuntimeException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- } catch (Exception ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw new XNIException(ex);
- } finally {
- fParseInProgress = false;
- // close all streams opened by xerces
- this.cleanup();
- }
-
- } // parse(InputSource)
-
- public boolean parse(boolean complete) throws XNIException, IOException {
- //
- // reset and configure pipeline and set InputSource.
- if (fInputSource != null) {
- try {
- fValidationManager.reset();
- fVersionDetector.reset(this);
- resetCommon();
-
- short version = fVersionDetector.determineDocVersion(fInputSource);
- if (version == Constants.XML_VERSION_1_1) {
- initXML11Components();
- configureXML11Pipeline();
- resetXML11();
- } else {
- configurePipeline();
- reset();
- }
-
- // mark configuration as fixed
- fConfigUpdated = false;
-
- // resets and sets the pipeline.
- fVersionDetector.startDocumentParsing((XMLEntityHandler) fCurrentScanner, version);
- fInputSource = null;
- } catch (XNIException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- } catch (IOException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- } catch (RuntimeException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- } catch (Exception ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw new XNIException(ex);
- }
- }
-
- try {
- return fCurrentScanner.scanDocument(complete);
- } catch (XNIException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- } catch (IOException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- } catch (RuntimeException ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw ex;
- } catch (Exception ex) {
- if (PRINT_EXCEPTION_STACK_TRACE)
- ex.printStackTrace();
- throw new XNIException(ex);
- }
-
- } // parse(boolean):boolean
-
- /**
- * Returns the state of a feature.
- *
- * @param featureId The feature identifier.
- * @return true if the feature is supported
- *
- * @throws XMLConfigurationException Thrown for configuration error.
- * In general, components should
- * only throw this exception if
- * it is <strong>really</strong>
- * a critical error.
- */
- public FeatureState getFeatureState(String featureId)
- throws XMLConfigurationException {
- // make this feature special
- if (featureId.equals(PARSER_SETTINGS)){
- return FeatureState.is(fConfigUpdated);
- }
- return super.getFeatureState(featureId);
-
- } // getFeature(String):boolean
-
- /**
- * Set the state of a feature.
- *
- * Set the state of any feature in a SAX2 parser. The parser
- * might not recognize the feature, and if it does recognize
- * it, it might not be able to fulfill the request.
- *
- * @param featureId The unique identifier (URI) of the feature.
- * @param state The requested state of the feature (true or false).
- *
- * @exception com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException If the
- * requested feature is not known.
- */
- public void setFeature(String featureId, boolean state)
- throws XMLConfigurationException {
- fConfigUpdated = true;
- // forward to every XML 1.0 component
- int count = fComponents.size();
- for (int i = 0; i < count; i++) {
- XMLComponent c = (XMLComponent) fComponents.get(i);
- c.setFeature(featureId, state);
- }
- // forward it to common components
- count = fCommonComponents.size();
- for (int i = 0; i < count; i++) {
- XMLComponent c = (XMLComponent) fCommonComponents.get(i);
- c.setFeature(featureId, state);
- }
-
- // forward to every XML 1.1 component
- count = fXML11Components.size();
- for (int i = 0; i < count; i++) {
- XMLComponent c = (XMLComponent) fXML11Components.get(i);
- try{
- c.setFeature(featureId, state);
- }
- catch (Exception e){
- // no op
- }
- }
- // save state if noone "objects"
- super.setFeature(featureId, state);
-
- } // setFeature(String,boolean)
-
- /**
- * setProperty
- *
- * @param propertyId
- * @param value
- */
- public void setProperty(String propertyId, Object value)
- throws XMLConfigurationException {
- fConfigUpdated = true;
- // forward to every XML 1.0 component
- int count = fComponents.size();
- for (int i = 0; i < count; i++) {
- XMLComponent c = (XMLComponent) fComponents.get(i);
- c.setProperty(propertyId, value);
- }
- // forward it to every common Component
- count = fCommonComponents.size();
- for (int i = 0; i < count; i++) {
- XMLComponent c = (XMLComponent) fCommonComponents.get(i);
- c.setProperty(propertyId, value);
- }
- // forward it to every XML 1.1 component
- count = fXML11Components.size();
- for (int i = 0; i < count; i++) {
- XMLComponent c = (XMLComponent) fXML11Components.get(i);
- try{
- c.setProperty(propertyId, value);
- }
- catch (Exception e){
- // ignore it
- }
- }
-
- // store value if noone "objects"
- super.setProperty(propertyId, value);
-
- } // setProperty(String,Object)
-
-
- /** Returns the locale. */
- public Locale getLocale() {
- return fLocale;
- } // getLocale():Locale
-
- /**
- * reset all XML 1.0 components before parsing and namespace context
- */
- protected void reset() throws XNIException {
- int count = fComponents.size();
- for (int i = 0; i < count; i++) {
- XMLComponent c = (XMLComponent) fComponents.get(i);
- c.reset(this);
- }
-
- } // reset()
-
- /**
- * reset all common components before parsing
- */
- protected void resetCommon() throws XNIException {
- // reset common components
- int count = fCommonComponents.size();
- for (int i = 0; i < count; i++) {
- XMLComponent c = (XMLComponent) fCommonComponents.get(i);
- c.reset(this);
- }
-
- } // resetCommon()
-
-
- /**
- * reset all components before parsing and namespace context
- */
- protected void resetXML11() throws XNIException {
- // reset every component
- int count = fXML11Components.size();
- for (int i = 0; i < count; i++) {
- XMLComponent c = (XMLComponent) fXML11Components.get(i);
- c.reset(this);
- }
-
- } // resetXML11()
-
-
- /**
- * Configures the XML 1.1 pipeline.
- * Note: this method also resets the new XML11 components.
- */
- protected void configureXML11Pipeline() {
- if (fCurrentDVFactory != fXML11DatatypeFactory) {
- fCurrentDVFactory = fXML11DatatypeFactory;
- setProperty(DATATYPE_VALIDATOR_FACTORY, fCurrentDVFactory);
- }
-
- // setup DTD pipeline
- if (fCurrentDTDScanner != fXML11DTDScanner) {
- fCurrentDTDScanner = fXML11DTDScanner;
- setProperty(DTD_SCANNER, fCurrentDTDScanner);
- }
- fXML11DTDScanner.setDTDHandler(fDTDHandler);
- fXML11DTDScanner.setDTDContentModelHandler(fDTDContentModelHandler);
-
- // setup XML 1.1 document pipeline
- if (fFeatures.get(NAMESPACES) == Boolean.TRUE) {
- if (fCurrentScanner != fXML11NSDocScanner) {
- fCurrentScanner = fXML11NSDocScanner;
- setProperty(DOCUMENT_SCANNER, fXML11NSDocScanner);
- }
-
- fXML11NSDocScanner.setDTDValidator(null);
- fXML11NSDocScanner.setDocumentHandler(fDocumentHandler);
- if (fDocumentHandler != null) {
- fDocumentHandler.setDocumentSource(fXML11NSDocScanner);
- }
- fLastComponent = fXML11NSDocScanner;
-
- } else {
- // create components
- if (fXML11DocScanner == null) {
- // non namespace document pipeline
- fXML11DocScanner = new XML11DocumentScannerImpl();
- addXML11Component(fXML11DocScanner);
- }
- if (fCurrentScanner != fXML11DocScanner) {
- fCurrentScanner = fXML11DocScanner;
- setProperty(DOCUMENT_SCANNER, fXML11DocScanner);
- }
- fXML11DocScanner.setDocumentHandler(fDocumentHandler);
-
- if (fDocumentHandler != null) {
- fDocumentHandler.setDocumentSource(fXML11DocScanner);
- }
- fLastComponent = fXML11DocScanner;
- }
-
- } // configureXML11Pipeline()
-
- /** Configures the pipeline. */
- protected void configurePipeline() {
- if (fCurrentDVFactory != fDatatypeValidatorFactory) {
- fCurrentDVFactory = fDatatypeValidatorFactory;
- // use XML 1.0 datatype library
- setProperty(DATATYPE_VALIDATOR_FACTORY, fCurrentDVFactory);
- }
-
- // setup DTD pipeline
- if (fCurrentDTDScanner != fDTDScanner) {
- fCurrentDTDScanner = fDTDScanner;
- setProperty(DTD_SCANNER, fCurrentDTDScanner);
- }
- fDTDScanner.setDTDHandler(fDTDHandler);
- fDTDScanner.setDTDContentModelHandler(fDTDContentModelHandler);
-
- // setup document pipeline
- if (fFeatures.get(NAMESPACES) == Boolean.TRUE) {
- if (fCurrentScanner != fNamespaceScanner) {
- fCurrentScanner = fNamespaceScanner;
- setProperty(DOCUMENT_SCANNER, fNamespaceScanner);
- }
- fNamespaceScanner.setDTDValidator(null);
- fNamespaceScanner.setDocumentHandler(fDocumentHandler);
- if (fDocumentHandler != null) {
- fDocumentHandler.setDocumentSource(fNamespaceScanner);
- }
- fLastComponent = fNamespaceScanner;
- } else {
- // create components
- if (fNonNSScanner == null) {
- fNonNSScanner = new XMLDocumentScannerImpl();
- // add components
- addComponent((XMLComponent) fNonNSScanner);
-
- }
- if (fCurrentScanner != fNonNSScanner) {
- fCurrentScanner = fNonNSScanner;
- setProperty(DOCUMENT_SCANNER, fNonNSScanner);
-
- }
-
- fNonNSScanner.setDocumentHandler(fDocumentHandler);
- if (fDocumentHandler != null) {
- fDocumentHandler.setDocumentSource(fNonNSScanner);
- }
- fLastComponent = fNonNSScanner;
- }
-
- } // configurePipeline()
-
-
- // features and properties
-
- /**
- * Check a feature. If feature is know and supported, this method simply
- * returns. Otherwise, the appropriate exception is thrown.
- *
- * @param featureId The unique identifier (URI) of the feature.
- *
- * @throws XMLConfigurationException Thrown for configuration error.
- * In general, components should
- * only throw this exception if
- * it is <strong>really</strong>
- * a critical error.
- */
- protected FeatureState checkFeature(String featureId) throws XMLConfigurationException {
-
- //
- // Xerces Features
- //
-
- if (featureId.startsWith(Constants.XERCES_FEATURE_PREFIX)) {
- final int suffixLength = featureId.length() - Constants.XERCES_FEATURE_PREFIX.length();
-
- //
- // http://apache.org/xml/features/validation/dynamic
- // Allows the parser to validate a document only when it
- // contains a grammar. Validation is turned on/off based
- // on each document instance, automatically.
- //
- if (suffixLength == Constants.DYNAMIC_VALIDATION_FEATURE.length() &&
- featureId.endsWith(Constants.DYNAMIC_VALIDATION_FEATURE)) {
- return FeatureState.RECOGNIZED;
- }
-
- //
- // http://apache.org/xml/features/validation/default-attribute-values
- //
- if (suffixLength == Constants.DEFAULT_ATTRIBUTE_VALUES_FEATURE.length() &&
- featureId.endsWith(Constants.DEFAULT_ATTRIBUTE_VALUES_FEATURE)) {
- // REVISIT
- return FeatureState.NOT_SUPPORTED;
- }
- //
- // http://apache.org/xml/features/validation/default-attribute-values
- //
- if (suffixLength == Constants.VALIDATE_CONTENT_MODELS_FEATURE.length() &&
- featureId.endsWith(Constants.VALIDATE_CONTENT_MODELS_FEATURE)) {
- // REVISIT
- return FeatureState.NOT_SUPPORTED;
- }
- //
- // http://apache.org/xml/features/validation/nonvalidating/load-dtd-grammar
- //
- if (suffixLength == Constants.LOAD_DTD_GRAMMAR_FEATURE.length() &&
- featureId.endsWith(Constants.LOAD_DTD_GRAMMAR_FEATURE)) {
- return FeatureState.RECOGNIZED;
- }
- //
- // http://apache.org/xml/features/validation/nonvalidating/load-external-dtd
- //
- if (suffixLength == Constants.LOAD_EXTERNAL_DTD_FEATURE.length() &&
- featureId.endsWith(Constants.LOAD_EXTERNAL_DTD_FEATURE)) {
- return FeatureState.RECOGNIZED;
- }
-
- //
- // http://apache.org/xml/features/validation/default-attribute-values
- //
- if (suffixLength == Constants.VALIDATE_DATATYPES_FEATURE.length() &&
- featureId.endsWith(Constants.VALIDATE_DATATYPES_FEATURE)) {
- return FeatureState.NOT_SUPPORTED;
- }
-
- // special performance feature: only component manager is allowed to set it.
- if (suffixLength == Constants.PARSER_SETTINGS.length() &&
- featureId.endsWith(Constants.PARSER_SETTINGS)) {
- return FeatureState.NOT_SUPPORTED;
- }
- }
-
- //
- // Not recognized
- //
-
- return super.checkFeature(featureId);
-
- } // checkFeature(String)
-
- /**
- * Check a property. If the property is know and supported, this method
- * simply returns. Otherwise, the appropriate exception is thrown.
- *
- * @param propertyId The unique identifier (URI) of the property
- * being set.
- *
- * @throws XMLConfigurationException Thrown for configuration error.
- * In general, components should
- * only throw this exception if
- * it is <strong>really</strong>
- * a critical error.
- */
- protected PropertyState checkProperty(String propertyId) throws XMLConfigurationException {
-
- //
- // Xerces Properties
- //
-
- if (propertyId.startsWith(Constants.XERCES_PROPERTY_PREFIX)) {
- final int suffixLength = propertyId.length() - Constants.XERCES_PROPERTY_PREFIX.length();
-
- if (suffixLength == Constants.DTD_SCANNER_PROPERTY.length() &&
- propertyId.endsWith(Constants.DTD_SCANNER_PROPERTY)) {
- return PropertyState.RECOGNIZED;
- }
- }
-
- if (propertyId.startsWith(Constants.JAXP_PROPERTY_PREFIX)) {
- final int suffixLength = propertyId.length() - Constants.JAXP_PROPERTY_PREFIX.length();
-
- if (suffixLength == Constants.SCHEMA_SOURCE.length() &&
- propertyId.endsWith(Constants.SCHEMA_SOURCE)) {
- return PropertyState.RECOGNIZED;
- }
- }
-
- // special cases
- if (propertyId.startsWith(Constants.SAX_PROPERTY_PREFIX)) {
- final int suffixLength = propertyId.length() - Constants.SAX_PROPERTY_PREFIX.length();
-
- //
- // http://xml.org/sax/properties/xml-string
- // Value type: String
- // Access: read-only
- // Get the literal string of characters associated with the
- // current event. If the parser recognises and supports this
- // property but is not currently parsing text, it should return
- // null (this is a good way to check for availability before the
- // parse begins).
- //
- if (suffixLength == Constants.XML_STRING_PROPERTY.length() &&
- propertyId.endsWith(Constants.XML_STRING_PROPERTY)) {
- // REVISIT - we should probably ask xml-dev for a precise
- // definition of what this is actually supposed to return, and
- // in exactly which circumstances.
- return PropertyState.NOT_SUPPORTED;
- }
- }
-
- //
- // Not recognized
- //
-
- return super.checkProperty(propertyId);
-
- } // checkProperty(String)
-
-
- /**
- * Adds a component to the parser configuration. This method will
- * also add all of the component's recognized features and properties
- * to the list of default recognized features and properties.
- *
- * @param component The component to add.
- */
- protected void addComponent(XMLComponent component) {
-
- // don't add a component more than once
- if (fComponents.contains(component)) {
- return;
- }
- fComponents.add(component);
- addRecognizedParamsAndSetDefaults(component);
-
- } // addComponent(XMLComponent)
-
- /**
- * Adds common component to the parser configuration. This method will
- * also add all of the component's recognized features and properties
- * to the list of default recognized features and properties.
- *
- * @param component The component to add.
- */
- protected void addCommonComponent(XMLComponent component) {
-
- // don't add a component more than once
- if (fCommonComponents.contains(component)) {
- return;
- }
- fCommonComponents.add(component);
- addRecognizedParamsAndSetDefaults(component);
-
- } // addCommonComponent(XMLComponent)
-
- /**
- * Adds an XML 1.1 component to the parser configuration. This method will
- * also add all of the component's recognized features and properties
- * to the list of default recognized features and properties.
- *
- * @param component The component to add.
- */
- protected void addXML11Component(XMLComponent component) {
-
- // don't add a component more than once
- if (fXML11Components.contains(component)) {
- return;
- }
- fXML11Components.add(component);
- addRecognizedParamsAndSetDefaults(component);
-
- } // addXML11Component(XMLComponent)
-
- /**
- * Adds all of the component's recognized features and properties
- * to the list of default recognized features and properties, and
- * sets default values on the configuration for features and
- * properties which were previously absent from the configuration.
- *
- * @param component The component whose recognized features
- * and properties will be added to the configuration
- */
- protected void addRecognizedParamsAndSetDefaults(XMLComponent component) {
-
- // register component's recognized features
- String[] recognizedFeatures = component.getRecognizedFeatures();
- addRecognizedFeatures(recognizedFeatures);
-
- // register component's recognized properties
- String[] recognizedProperties = component.getRecognizedProperties();
- addRecognizedProperties(recognizedProperties);
-
- // set default values
- if (recognizedFeatures != null) {
- for (int i = 0; i < recognizedFeatures.length; ++i) {
- String featureId = recognizedFeatures[i];
- Boolean state = component.getFeatureDefault(featureId);
- if (state != null) {
- // Do not overwrite values already set on the configuration.
- if (!fFeatures.containsKey(featureId)) {
- fFeatures.put(featureId, state);
- // For newly added components who recognize this feature
- // but did not offer a default value, we need to make
- // sure these components will get an opportunity to read
- // the value before parsing begins.
- fConfigUpdated = true;
- }
- }
- }
- }
- if (recognizedProperties != null) {
- for (int i = 0; i < recognizedProperties.length; ++i) {
- String propertyId = recognizedProperties[i];
- Object value = component.getPropertyDefault(propertyId);
- if (value != null) {
- // Do not overwrite values already set on the configuration.
- if (!fProperties.containsKey(propertyId)) {
- fProperties.put(propertyId, value);
- // For newly added components who recognize this property
- // but did not offer a default value, we need to make
- // sure these components will get an opportunity to read
- // the value before parsing begins.
- fConfigUpdated = true;
- }
- }
- }
- }
- }
-
- private void initXML11Components() {
- if (!f11Initialized) {
-
- // create datatype factory
- fXML11DatatypeFactory = DTDDVFactory.getInstance(XML11_DATATYPE_VALIDATOR_FACTORY);
-
- // setup XML 1.1 DTD pipeline
- fXML11DTDScanner = new XML11DTDScannerImpl();
- addXML11Component(fXML11DTDScanner);
-
- // setup XML 1.1. document pipeline - namespace aware
- fXML11NSDocScanner = new XML11NSDocumentScannerImpl();
- addXML11Component(fXML11NSDocScanner);
-
- f11Initialized = true;
- }
- }
-
-} // class XML11NonValidatingConfiguration
diff --git a/src/com/sun/org/apache/xerces/internal/parsers/XMLDocumentParser.java b/src/com/sun/org/apache/xerces/internal/parsers/XMLDocumentParser.java
deleted file mode 100644
index 8a89e98..0000000
--- a/src/com/sun/org/apache/xerces/internal/parsers/XMLDocumentParser.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.parsers;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration;
-
-/**
- * This is a concrete vanilla XML parser class. It uses the abstract parser
- * with either a BasicConfiguration object or the one specified by the
- * application.
- *
- * @author Arnaud Le Hors, IBM
- * @author Andy Clark, IBM
- *
- * @version $Id: XMLDocumentParser.java,v 1.6 2010-11-01 04:40:10 joehw Exp $
- */
-public class XMLDocumentParser
- extends AbstractXMLDocumentParser {
-
- //
- // Constructors
- //
-
- /**
- * Constructs a document parser using the default basic parser
- * configuration.
- */
- public XMLDocumentParser() {
- super(new XIncludeAwareParserConfiguration());
- } // <init>()
-
- /**
- * Constructs a document parser using the specified parser configuration.
- */
- public XMLDocumentParser(XMLParserConfiguration config) {
- super(config);
- } // <init>(ParserConfiguration)
-
- /**
- * Constructs a document parser using the specified symbol table.
- */
- public XMLDocumentParser(SymbolTable symbolTable) {
- super(new XIncludeAwareParserConfiguration());
- fConfiguration.setProperty(Constants.XERCES_PROPERTY_PREFIX+Constants.SYMBOL_TABLE_PROPERTY, symbolTable);
- } // <init>(SymbolTable)
-
- /**
- * Constructs a document parser using the specified symbol table and
- * grammar pool.
- */
- public XMLDocumentParser(SymbolTable symbolTable,
- XMLGrammarPool grammarPool) {
- super(new XIncludeAwareParserConfiguration());
- fConfiguration.setProperty(Constants.XERCES_PROPERTY_PREFIX+Constants.SYMBOL_TABLE_PROPERTY, symbolTable);
- fConfiguration.setProperty(Constants.XERCES_PROPERTY_PREFIX+Constants.XMLGRAMMAR_POOL_PROPERTY, grammarPool);
- }
-
-} // class XMLDocumentParser
diff --git a/src/com/sun/org/apache/xerces/internal/parsers/XMLGrammarCachingConfiguration.java b/src/com/sun/org/apache/xerces/internal/parsers/XMLGrammarCachingConfiguration.java
deleted file mode 100644
index 897b754..0000000
--- a/src/com/sun/org/apache/xerces/internal/parsers/XMLGrammarCachingConfiguration.java
+++ /dev/null
@@ -1,312 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.parsers;
-
-import java.io.IOException;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.dtd.DTDGrammar;
-import com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDLoader;
-import com.sun.org.apache.xerces.internal.impl.xs.SchemaGrammar;
-import com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader;
-import com.sun.org.apache.xerces.internal.impl.xs.XSMessageFormatter;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.util.SynchronizedSymbolTable;
-import com.sun.org.apache.xerces.internal.util.XMLGrammarPoolImpl;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.grammars.Grammar;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLEntityResolver;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-
-/**
- * <p> This configuration provides a generic way of using
- * Xerces's grammar caching facilities. It extends the
- * XIncludeAwareParserConfiguration and thus may validate documents
- * according to XML schemas or DTD's. It also allows the user to
- * preparse a grammar, and to lock the grammar pool
- * implementation such that no more grammars will be added.</p>
- * <p> Using the com.sun.org.apache.xerces.internal.xni.parser property, an
- * application may instantiate a Xerces SAX or DOM parser with
- * this configuration. When invoked in this manner, the default
- * behaviour will be elicited; to use this configuration's
- * specific facilities, the user will need to reference it
- * directly.</p>
- * <p>
- * In addition to the features and properties recognized by the base
- * parser configuration, this class recognizes these additional
- * features and properties:
- * <ul>
- * </ul>
- *
- * @author Neil Graham, IBM
- *
- * @version $Id: XMLGrammarCachingConfiguration.java,v 1.6 2010-11-01 04:40:10 joehw Exp $
- */
-public class XMLGrammarCachingConfiguration
- extends XIncludeAwareParserConfiguration {
-
- //
- // Constants
- //
-
- // a larg(ish) prime to use for a symbol table to be shared
- // among
- // potentially man parsers. Start one as close to 2K (20
- // times larger than normal) and see what happens...
- public static final int BIG_PRIME = 2039;
-
- // the static symbol table to be shared amongst parsers
- protected static final SynchronizedSymbolTable fStaticSymbolTable =
- new SynchronizedSymbolTable(BIG_PRIME);
-
- // the Grammar Pool to be shared similarly
- protected static final XMLGrammarPoolImpl fStaticGrammarPool =
- new XMLGrammarPoolImpl();
-
- // schema full checking constant
- protected static final String SCHEMA_FULL_CHECKING =
- Constants.XERCES_FEATURE_PREFIX+Constants.SCHEMA_FULL_CHECKING;
-
- // Data
-
- // variables needed for caching schema grammars.
- protected XMLSchemaLoader fSchemaLoader;
-
- // the DTD grammar loader
- protected XMLDTDLoader fDTDLoader;
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- public XMLGrammarCachingConfiguration() {
- this(fStaticSymbolTable, fStaticGrammarPool, null);
- } // <init>()
-
- /**
- * Constructs a parser configuration using the specified symbol table.
- *
- * @param symbolTable The symbol table to use.
- */
- public XMLGrammarCachingConfiguration(SymbolTable symbolTable) {
- this(symbolTable, fStaticGrammarPool, null);
- } // <init>(SymbolTable)
-
- /**
- * Constructs a parser configuration using the specified symbol table and
- * grammar pool.
- * <p>
- * <strong>REVISIT:</strong>
- * Grammar pool will be updated when the new validation engine is
- * implemented.
- *
- * @param symbolTable The symbol table to use.
- * @param grammarPool The grammar pool to use.
- */
- public XMLGrammarCachingConfiguration(SymbolTable symbolTable,
- XMLGrammarPool grammarPool) {
- this(symbolTable, grammarPool, null);
- } // <init>(SymbolTable,XMLGrammarPool)
-
- /**
- * Constructs a parser configuration using the specified symbol table,
- * grammar pool, and parent settings.
- * <p>
- * <strong>REVISIT:</strong>
- * Grammar pool will be updated when the new validation engine is
- * implemented.
- *
- * @param symbolTable The symbol table to use.
- * @param grammarPool The grammar pool to use.
- * @param parentSettings The parent settings.
- */
- public XMLGrammarCachingConfiguration(SymbolTable symbolTable,
- XMLGrammarPool grammarPool,
- XMLComponentManager parentSettings) {
- super(symbolTable, grammarPool, parentSettings);
-
- // REVISIT: may need to add some features/properties
- // specific to this configuration at some point...
-
- // add default recognized features
- // set state for default features
- // add default recognized properties
- // create and register missing components
- fSchemaLoader = new XMLSchemaLoader(fSymbolTable);
- fSchemaLoader.setProperty(XMLGRAMMAR_POOL, fGrammarPool);
-
- // and set up the DTD loader too:
- fDTDLoader = new XMLDTDLoader(fSymbolTable, fGrammarPool);
- } // <init>(SymbolTable,XMLGrammarPool, XMLComponentManager)
-
- //
- // Public methods
- //
-
- /*
- * lock the XMLGrammarPoolImpl object so that it does not
- * accept any more grammars from the validators.
- */
- public void lockGrammarPool() {
- fGrammarPool.lockPool();
- } // lockGrammarPool()
-
- /*
- * clear the XMLGrammarPoolImpl object so that it does not
- * contain any more grammars.
- */
- public void clearGrammarPool() {
- fGrammarPool.clear();
- } // clearGrammarPool()
-
- /*
- * unlock the XMLGrammarPoolImpl object so that it
- * accepts more grammars from the validators.
- */
- public void unlockGrammarPool() {
- fGrammarPool.unlockPool();
- } // unlockGrammarPool()
-
- /**
- * Parse a grammar from a location identified by an URI.
- * This method also adds this grammar to the XMLGrammarPool
- *
- * @param type The type of the grammar to be constructed
- * @param uri The location of the grammar to be constructed.
- * <strong>The parser will not expand this URI or make it
- * available to the EntityResolver</strong>
- * @return The newly created <code>Grammar</code>.
- * @exception XNIException thrown on an error in grammar
- * construction
- * @exception IOException thrown if an error is encountered
- * in reading the file
- */
- public Grammar parseGrammar(String type, String uri)
- throws XNIException, IOException {
- XMLInputSource source = new XMLInputSource(null, uri, null);
- return parseGrammar(type, source);
-
- }
-
- /**
- * Parse a grammar from a location identified by an
- * XMLInputSource.
- * This method also adds this grammar to the XMLGrammarPool
- *
- * @param type The type of the grammar to be constructed
- * @param is The XMLInputSource containing this grammar's
- * information
- * <strong>If a URI is included in the systemId field, the parser will not expand this URI or make it
- * available to the EntityResolver</strong>
- * @return The newly created <code>Grammar</code>.
- * @exception XNIException thrown on an error in grammar
- * construction
- * @exception IOException thrown if an error is encountered
- * in reading the file
- */
- public Grammar parseGrammar(String type, XMLInputSource
- is) throws XNIException, IOException {
- if(type.equals(XMLGrammarDescription.XML_SCHEMA)) {
- // by default, make all XMLGrammarPoolImpl's schema grammars available to fSchemaHandler
- return parseXMLSchema(is);
- } else if(type.equals(XMLGrammarDescription.XML_DTD)) {
- return parseDTD(is);
- }
- // don't know this grammar...
- return null;
- } // parseGrammar(String, XMLInputSource): Grammar
-
- //
- // Protected methods
- //
-
- // package-protected methods
-
- /* This method parses an XML Schema document.
- * It requires a GrammarBucket parameter so that DOMASBuilder can
- * extract the info it needs.
- * Therefore, bucket must not be null!
- */
- SchemaGrammar parseXMLSchema(XMLInputSource is)
- throws IOException {
- XMLEntityResolver resolver = getEntityResolver();
- if(resolver != null) {
- fSchemaLoader.setEntityResolver(resolver);
- }
- if (fErrorReporter.getMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN) == null) {
- fErrorReporter.putMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN, new XSMessageFormatter());
- }
- fSchemaLoader.setProperty(ERROR_REPORTER, fErrorReporter);
-
- String propPrefix = Constants.XERCES_PROPERTY_PREFIX;
- String propName = propPrefix + Constants.SCHEMA_LOCATION;
- fSchemaLoader.setProperty(propName, getProperty(propName));
- propName = propPrefix + Constants.SCHEMA_NONS_LOCATION;
- fSchemaLoader.setProperty(propName, getProperty(propName));
- propName = Constants.JAXP_PROPERTY_PREFIX+Constants.SCHEMA_SOURCE;
- fSchemaLoader.setProperty(propName, getProperty(propName));
- fSchemaLoader.setFeature(SCHEMA_FULL_CHECKING, getFeature(SCHEMA_FULL_CHECKING));
-
- // Should check whether the grammar with this namespace is already in
- // the grammar resolver. But since we don't know the target namespace
- // of the document here, we leave such check to XSDHandler
- SchemaGrammar grammar = (SchemaGrammar)fSchemaLoader.loadGrammar(is);
- // by default, hand it off to the grammar pool
- if (grammar != null) {
- fGrammarPool.cacheGrammars(XMLGrammarDescription.XML_SCHEMA,
- new Grammar[]{grammar});
- }
-
- return grammar;
-
- } // parseXMLSchema(XMLInputSource) : SchemaGrammar
-
- /* This method parses an external DTD entity.
- */
- DTDGrammar parseDTD(XMLInputSource is)
- throws IOException {
- XMLEntityResolver resolver = getEntityResolver();
- if(resolver != null) {
- fDTDLoader.setEntityResolver(resolver);
- }
- fDTDLoader.setProperty(ERROR_REPORTER, fErrorReporter);
-
- // Should check whether the grammar with this namespace is already in
- // the grammar resolver. But since we don't know the target namespace
- // of the document here, we leave such check to the application...
- DTDGrammar grammar = (DTDGrammar)fDTDLoader.loadGrammar(is);
- // by default, hand it off to the grammar pool
- if (grammar != null) {
- fGrammarPool.cacheGrammars(XMLGrammarDescription.XML_DTD,
- new Grammar[]{grammar});
- }
-
- return grammar;
-
- } // parseXMLDTD(XMLInputSource) : DTDGrammar
-
-
-} // class XMLGrammarCachingConfiguration
diff --git a/src/com/sun/org/apache/xerces/internal/parsers/XMLGrammarParser.java b/src/com/sun/org/apache/xerces/internal/parsers/XMLGrammarParser.java
deleted file mode 100644
index 7d88781..0000000
--- a/src/com/sun/org/apache/xerces/internal/parsers/XMLGrammarParser.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.parsers;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.dv.DTDDVFactory;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-
-/**
- * @version $Id: XMLGrammarParser.java,v 1.6 2010-11-01 04:40:10 joehw Exp $
- */
-public abstract class XMLGrammarParser
- extends XMLParser {
-
- //
- // Data
- //
-
- /** fDatatypeValidatorFactory */
- protected DTDDVFactory fDatatypeValidatorFactory;
-
- //
- // Constructors
- //
-
- /**
- * Construct an XMLGrammarParser with the specified symbol table
- *
- * @param symbolTable
- */
- protected XMLGrammarParser(SymbolTable symbolTable) {
- super(new XIncludeAwareParserConfiguration());
- fConfiguration.setProperty(Constants.XERCES_PROPERTY_PREFIX+Constants.SYMBOL_TABLE_PROPERTY, symbolTable);
- }
-
-} // class XMLGrammarParser
diff --git a/src/com/sun/org/apache/xerces/internal/parsers/XMLGrammarPreparser.java b/src/com/sun/org/apache/xerces/internal/parsers/XMLGrammarPreparser.java
deleted file mode 100644
index 9fd66e5..0000000
--- a/src/com/sun/org/apache/xerces/internal/parsers/XMLGrammarPreparser.java
+++ /dev/null
@@ -1,341 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.parsers;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.XMLEntityManager;
-import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.utils.ObjectFactory;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.grammars.Grammar;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarLoader;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLEntityResolver;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-import java.io.IOException;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.Map;
-
-/**
- * <p> This class provides an easy way for a user to preparse grammars
- * of various types. By default, it knows how to preparse external
- * DTD's and schemas; it provides an easy way for user applications to
- * register classes that know how to parse additional grammar types.
- * By default, it does no grammar caching; but it provides ways for
- * user applications to do so.
- *
- * @author Neil Graham, IBM
- *
- * @version $Id: XMLGrammarPreparser.java,v 1.7 2010-11-01 04:40:10 joehw Exp $
- */
-public class XMLGrammarPreparser {
-
- //
- // Constants
- //
-
- // feature: continue-after-fatal-error
- private final static String CONTINUE_AFTER_FATAL_ERROR =
- Constants.XERCES_FEATURE_PREFIX + Constants.CONTINUE_AFTER_FATAL_ERROR_FEATURE;
-
- /** Property identifier: symbol table. */
- protected static final String SYMBOL_TABLE =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY;
-
- /** Property identifier: error reporter. */
- protected static final String ERROR_REPORTER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY;
-
- /** Property identifier: error handler. */
- protected static final String ERROR_HANDLER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_HANDLER_PROPERTY;
-
- /** Property identifier: entity resolver. */
- protected static final String ENTITY_RESOLVER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_RESOLVER_PROPERTY;
-
- /** Property identifier: grammar pool . */
- protected static final String GRAMMAR_POOL =
- Constants.XERCES_PROPERTY_PREFIX + Constants.XMLGRAMMAR_POOL_PROPERTY;
-
- // the "built-in" grammar loaders
- private static final Map<String, String> KNOWN_LOADERS;
-
- static {
- Map<String, String> loaders = new HashMap<>();
- loaders.put(XMLGrammarDescription.XML_SCHEMA,
- "com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader");
- loaders.put(XMLGrammarDescription.XML_DTD,
- "com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDLoader");
- KNOWN_LOADERS = Collections.unmodifiableMap(loaders);
- }
-
- /** Recognized properties. */
- private static final String[] RECOGNIZED_PROPERTIES = {
- SYMBOL_TABLE,
- ERROR_REPORTER,
- ERROR_HANDLER,
- ENTITY_RESOLVER,
- GRAMMAR_POOL,
- };
-
- // Data
- protected SymbolTable fSymbolTable;
- protected XMLErrorReporter fErrorReporter;
- protected XMLEntityResolver fEntityResolver;
- protected XMLGrammarPool fGrammarPool;
-
- protected Locale fLocale;
-
- // Map holding our loaders
- private Map<String, XMLGrammarLoader> fLoaders;
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- public XMLGrammarPreparser() {
- this(new SymbolTable());
- } // <init>()
-
- /**
- * Constructs a preparser using the specified symbol table.
- *
- * @param symbolTable The symbol table to use.
- */
- public XMLGrammarPreparser (SymbolTable symbolTable) {
- fSymbolTable = symbolTable;
-
- fLoaders = new HashMap<>();
- fErrorReporter = new XMLErrorReporter();
- setLocale(Locale.getDefault());
- fEntityResolver = new XMLEntityManager();
- // those are all the basic properties...
- } // <init>(SymbolTable)
-
- //
- // Public methods
- //
-
- /*
- * Register a type of grammar to make it preparsable. If
- * the second parameter is null, the parser will use its built-in
- * facilities for that grammar type.
- * This should be called by the application immediately
- * after creating this object and before initializing any properties/features.
- * @param type URI identifying the type of the grammar
- * @param loader an object capable of preparsing that type; null if the ppreparser should use built-in knowledge.
- * @return true if successful; false if no built-in knowledge of
- * the type or if unable to instantiate the string we know about
- */
- public boolean registerPreparser(String grammarType, XMLGrammarLoader loader) {
- if(loader == null) { // none specified!
- if(KNOWN_LOADERS.containsKey(grammarType)) {
- // got one; just instantiate it...
- String loaderName = (String)KNOWN_LOADERS.get(grammarType);
- try {
- XMLGrammarLoader gl = (XMLGrammarLoader)(ObjectFactory.newInstance(loaderName, true));
- fLoaders.put(grammarType, gl);
- } catch (Exception e) {
- return false;
- }
- return true;
- }
- return false;
- }
- // were given one
- fLoaders.put(grammarType, loader);
- return true;
- } // registerPreparser(String, XMLGrammarLoader): boolean
-
- /**
- * Parse a grammar from a location identified by an
- * XMLInputSource.
- * This method also adds this grammar to the XMLGrammarPool
- *
- * @param type The type of the grammar to be constructed
- * @param is The XMLInputSource containing this grammar's
- * information
- * <strong>If a URI is included in the systemId field, the parser will not expand this URI or make it
- * available to the EntityResolver</strong>
- * @return The newly created <code>Grammar</code>.
- * @exception XNIException thrown on an error in grammar
- * construction
- * @exception IOException thrown if an error is encountered
- * in reading the file
- */
- public Grammar preparseGrammar(String type, XMLInputSource
- is) throws XNIException, IOException {
- if(fLoaders.containsKey(type)) {
- XMLGrammarLoader gl = fLoaders.get(type);
- // make sure gl's been set up with all the "basic" properties:
- gl.setProperty(SYMBOL_TABLE, fSymbolTable);
- gl.setProperty(ENTITY_RESOLVER, fEntityResolver);
- gl.setProperty(ERROR_REPORTER, fErrorReporter);
- // potentially, not all will support this one...
- if(fGrammarPool != null) {
- try {
- gl.setProperty(GRAMMAR_POOL, fGrammarPool);
- } catch(Exception e) {
- // too bad...
- }
- }
- return gl.loadGrammar(is);
- }
- return null;
- } // preparseGrammar(String, XMLInputSource): Grammar
-
- /**
- * Set the locale to use for messages.
- *
- * @param locale The locale object to use for localization of messages.
- *
- * @exception XNIException Thrown if the parser does not support the
- * specified locale.
- */
- public void setLocale(Locale locale) {
- fLocale = locale;
- fErrorReporter.setLocale(locale);
- } // setLocale(Locale)
-
- /** Return the Locale the XMLGrammarLoader is using. */
- public Locale getLocale() {
- return fLocale;
- } // getLocale(): Locale
-
-
- /**
- * Sets the error handler.
- *
- * @param errorHandler The error handler.
- */
- public void setErrorHandler(XMLErrorHandler errorHandler) {
- fErrorReporter.setProperty(ERROR_HANDLER, errorHandler);
- } // setErrorHandler(XMLErrorHandler)
-
- /** Returns the registered error handler. */
- public XMLErrorHandler getErrorHandler() {
- return fErrorReporter.getErrorHandler();
- } // getErrorHandler(): XMLErrorHandler
-
- /**
- * Sets the entity resolver.
- *
- * @param entityResolver The new entity resolver.
- */
- public void setEntityResolver(XMLEntityResolver entityResolver) {
- fEntityResolver = entityResolver;
- } // setEntityResolver(XMLEntityResolver)
-
- /** Returns the registered entity resolver. */
- public XMLEntityResolver getEntityResolver() {
- return fEntityResolver;
- } // getEntityResolver(): XMLEntityResolver
-
- /**
- * Sets the grammar pool.
- *
- * @param grammarPool The new grammar pool.
- */
- public void setGrammarPool(XMLGrammarPool grammarPool) {
- fGrammarPool = grammarPool;
- } // setGrammarPool(XMLGrammarPool)
-
- /** Returns the registered grammar pool. */
- public XMLGrammarPool getGrammarPool() {
- return fGrammarPool;
- } // getGrammarPool(): XMLGrammarPool
-
- // it's possible the application may want access to a certain loader to do
- // some custom work.
- public XMLGrammarLoader getLoader(String type) {
- return fLoaders.get(type);
- } // getLoader(String): XMLGrammarLoader
-
- // set a feature. This method tries to set it on all
- // registered loaders; it eats any resulting exceptions. If
- // an app needs to know if a particular feature is supported
- // by a grammar loader of a particular type, it will have
- // to retrieve that loader and use the loader's setFeature method.
- public void setFeature(String featureId, boolean value) {
- for (Map.Entry<String, XMLGrammarLoader> entry : fLoaders.entrySet()) {
- try {
- XMLGrammarLoader gl = entry.getValue();
- gl.setFeature(featureId, value);
- } catch(Exception e) {
- // eat it up...
- }
- }
- // since our error reporter is a property we set later,
- // make sure features it understands are also set.
- if(featureId.equals(CONTINUE_AFTER_FATAL_ERROR)) {
- fErrorReporter.setFeature(CONTINUE_AFTER_FATAL_ERROR, value);
- }
- } //setFeature(String, boolean)
-
- // set a property. This method tries to set it on all
- // registered loaders; it eats any resulting exceptions. If
- // an app needs to know if a particular property is supported
- // by a grammar loader of a particular type, it will have
- // to retrieve that loader and use the loader's setProperty method.
- // <p> <strong>An application should use the explicit method
- // in this class to set "standard" properties like error handler etc.</strong>
- public void setProperty(String propId, Object value) {
- for (Map.Entry<String, XMLGrammarLoader> entry : fLoaders.entrySet()) {
- try {
- XMLGrammarLoader gl = entry.getValue();
- gl.setProperty(propId, value);
- } catch(Exception e) {
- // eat it up...
- }
- }
- } //setProperty(String, Object)
-
- // get status of feature in a particular loader. This
- // catches no exceptions--including NPE's--so the application had
- // better make sure the loader exists and knows about this feature.
- // @param type type of grammar to look for the feature in.
- // @param featureId the feature string to query.
- // @return the value of the feature.
- public boolean getFeature(String type, String featureId) {
- XMLGrammarLoader gl = fLoaders.get(type);
- return gl.getFeature(featureId);
- } // getFeature (String, String): boolean
-
- // get status of property in a particular loader. This
- // catches no exceptions--including NPE's--so the application had
- // better make sure the loader exists and knows about this property.
- // <strong>For standard properties--that will be supported
- // by all loaders--the specific methods should be queried!</strong>
- // @param type type of grammar to look for the property in.
- // @param propertyId the property string to query.
- // @return the value of the property.
- public Object getProperty(String type, String propertyId) {
- XMLGrammarLoader gl = fLoaders.get(type);
- return gl.getProperty(propertyId);
- } // getProperty(String, String): Object
-} // class XMLGrammarPreparser
diff --git a/src/com/sun/org/apache/xerces/internal/parsers/XMLParser.java b/src/com/sun/org/apache/xerces/internal/parsers/XMLParser.java
deleted file mode 100644
index 970cc51..0000000
--- a/src/com/sun/org/apache/xerces/internal/parsers/XMLParser.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.parsers;
-
-import java.io.IOException;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration;
-
-import org.xml.sax.SAXNotSupportedException;
-import org.xml.sax.SAXNotRecognizedException;
-
-/**
- * Base class of all XML-related parsers.
- * <p>
- * In addition to the features and properties recognized by the parser
- * configuration, this parser recognizes these additional features and
- * properties:
- * <ul>
- * <li>Properties
- * <ul>
- * <li>http://apache.org/xml/properties/internal/error-handler</li>
- * <li>http://apache.org/xml/properties/internal/entity-resolver</li>
- * </ul>
- * </ul>
- *
- * @author Arnaud Le Hors, IBM
- * @author Andy Clark, IBM
- *
- * @version $Id: XMLParser.java,v 1.5 2007/07/20 14:11:21 spericas Exp $
- */
-public abstract class XMLParser {
-
- //
- // Constants
- //
-
- // properties
-
- /** Property identifier: entity resolver. */
- protected static final String ENTITY_RESOLVER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_RESOLVER_PROPERTY;
-
- /** Property identifier: error handler. */
- protected static final String ERROR_HANDLER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_HANDLER_PROPERTY;
-
- /** Recognized properties. */
- private static final String[] RECOGNIZED_PROPERTIES = {
- ENTITY_RESOLVER,
- ERROR_HANDLER,
- };
-
- //
- // Data
- //
-
- /** The parser configuration. */
- protected XMLParserConfiguration fConfiguration;
-
- /** The XML Security Manager. */
- XMLSecurityManager securityManager;
-
- /** The XML Security Property Manager. */
- XMLSecurityPropertyManager securityPropertyManager;
-
-
- //
- // Constructors
- //
-
- /**
- * Query the state of a feature.
- */
- public boolean getFeature(String featureId)
- throws SAXNotSupportedException, SAXNotRecognizedException {
- return fConfiguration.getFeature(featureId);
-
- }
-
- /**
- * Default Constructor.
- */
- protected XMLParser(XMLParserConfiguration config) {
-
- // save configuration
- fConfiguration = config;
-
- // add default recognized properties
- fConfiguration.addRecognizedProperties(RECOGNIZED_PROPERTIES);
-
- } // <init>(XMLParserConfiguration)
-
- //
- // Public methods
- //
-
- /**
- * parse
- *
- * @param inputSource
- *
- * @exception XNIException
- * @exception java.io.IOException
- */
- public void parse(XMLInputSource inputSource)
- throws XNIException, IOException {
- // null indicates that the parser is called directly, initialize them
- if (securityManager == null) {
- securityManager = new XMLSecurityManager(true);
- fConfiguration.setProperty(Constants.SECURITY_MANAGER, securityManager);
- }
- if (securityPropertyManager == null) {
- securityPropertyManager = new XMLSecurityPropertyManager();
- fConfiguration.setProperty(Constants.XML_SECURITY_PROPERTY_MANAGER, securityPropertyManager);
- }
-
- reset();
- fConfiguration.parse(inputSource);
-
- } // parse(XMLInputSource)
-
- //
- // Protected methods
- //
-
- /**
- * reset all components before parsing
- */
- protected void reset() throws XNIException {
- } // reset()
-
-} // class XMLParser
diff --git a/src/com/sun/org/apache/xerces/internal/parsers/XPointerParserConfiguration.java b/src/com/sun/org/apache/xerces/internal/parsers/XPointerParserConfiguration.java
deleted file mode 100644
index cacd68c..0000000
--- a/src/com/sun/org/apache/xerces/internal/parsers/XPointerParserConfiguration.java
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xerces.internal.parsers;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.xpointer.XPointerHandler;
-import com.sun.org.apache.xerces.internal.xinclude.XIncludeHandler;
-import com.sun.org.apache.xerces.internal.xinclude.XIncludeNamespaceSupport;
-import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource;
-
-/**
- * This parser configuration includes an <code>XPointerHandler</code> in the pipeline
- * before the schema validator, or as the last component in the pipeline if there is
- * no schema validator. Using this pipeline will enable processing according to the
- * XML Inclusions specification with XPointers, to the conformance level described in
- * <code>XPointerHandler.</code>.
- *
- * @see com.sun.org.apache.xerces.internal.xpointer.XPointerHandler
- */
-public class XPointerParserConfiguration extends XML11Configuration {
-
- private XPointerHandler fXPointerHandler;
-
- private XIncludeHandler fXIncludeHandler;
-
- /** Feature identifier: allow notation and unparsed entity events to be sent out of order. */
- protected static final String ALLOW_UE_AND_NOTATION_EVENTS =
- Constants.SAX_FEATURE_PREFIX + Constants.ALLOW_DTD_EVENTS_AFTER_ENDDTD_FEATURE;
-
- /** Feature identifier: fixup base URIs. */
- protected static final String XINCLUDE_FIXUP_BASE_URIS =
- Constants.XERCES_FEATURE_PREFIX + Constants.XINCLUDE_FIXUP_BASE_URIS_FEATURE;
-
- /** Feature identifier: fixup language. */
- protected static final String XINCLUDE_FIXUP_LANGUAGE =
- Constants.XERCES_FEATURE_PREFIX + Constants.XINCLUDE_FIXUP_LANGUAGE_FEATURE;
-
- /** Property identifier: error reporter. */
- protected static final String XPOINTER_HANDLER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.XPOINTER_HANDLER_PROPERTY;
-
- /** Property identifier: error reporter. */
- protected static final String XINCLUDE_HANDLER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.XINCLUDE_HANDLER_PROPERTY;
-
- /** Property identifier: error reporter. */
- protected static final String NAMESPACE_CONTEXT =
- Constants.XERCES_PROPERTY_PREFIX + Constants.NAMESPACE_CONTEXT_PROPERTY;
-
- /** Default constructor. */
- public XPointerParserConfiguration() {
- this(null, null, null);
- } // <init>()
-
- /**
- * Constructs a parser configuration using the specified symbol table.
- *
- * @param symbolTable The symbol table to use.
- */
- public XPointerParserConfiguration(SymbolTable symbolTable) {
- this(symbolTable, null, null);
- } // <init>(SymbolTable)
-
- /**
- * Constructs a parser configuration using the specified symbol table and
- * grammar pool.
- * <p>
- *
- * @param symbolTable The symbol table to use.
- * @param grammarPool The grammar pool to use.
- */
- public XPointerParserConfiguration(
- SymbolTable symbolTable,
- XMLGrammarPool grammarPool) {
- this(symbolTable, grammarPool, null);
- } // <init>(SymbolTable,XMLGrammarPool)
-
- /**
- * Constructs a parser configuration using the specified symbol table,
- * grammar pool, and parent settings.
- * <p>
- *
- * @param symbolTable The symbol table to use.
- * @param grammarPool The grammar pool to use.
- * @param parentSettings The parent settings.
- */
- public XPointerParserConfiguration(
- SymbolTable symbolTable,
- XMLGrammarPool grammarPool,
- XMLComponentManager parentSettings) {
- super(symbolTable, grammarPool, parentSettings);
-
- fXIncludeHandler = new XIncludeHandler();
- addCommonComponent(fXIncludeHandler);
-
- fXPointerHandler = new XPointerHandler();
- addCommonComponent(fXPointerHandler);
-
- final String[] recognizedFeatures = {
- ALLOW_UE_AND_NOTATION_EVENTS,
- XINCLUDE_FIXUP_BASE_URIS,
- XINCLUDE_FIXUP_LANGUAGE
- };
- addRecognizedFeatures(recognizedFeatures);
-
- // add default recognized properties
- final String[] recognizedProperties =
- { XINCLUDE_HANDLER, XPOINTER_HANDLER, NAMESPACE_CONTEXT };
- addRecognizedProperties(recognizedProperties);
-
- setFeature(ALLOW_UE_AND_NOTATION_EVENTS, true);
- setFeature(XINCLUDE_FIXUP_BASE_URIS, true);
- setFeature(XINCLUDE_FIXUP_LANGUAGE, true);
-
- setProperty(XINCLUDE_HANDLER, fXIncludeHandler);
- setProperty(XPOINTER_HANDLER, fXPointerHandler);
- setProperty(NAMESPACE_CONTEXT, new XIncludeNamespaceSupport());
-
-
- } // <init>(SymbolTable,XMLGrammarPool)}
-
-
- /** Configures the pipeline. */
- protected void configurePipeline() {
- super.configurePipeline();
-
- //configure DTD pipeline
- fDTDScanner.setDTDHandler(fDTDProcessor);
- fDTDProcessor.setDTDSource(fDTDScanner);
-
- fDTDProcessor.setDTDHandler(fXIncludeHandler);
- fXIncludeHandler.setDTDSource(fDTDProcessor);
- fXIncludeHandler.setDTDHandler(fXPointerHandler);
- fXPointerHandler.setDTDSource(fXIncludeHandler);
- fXPointerHandler.setDTDHandler(fDTDHandler);
- if (fDTDHandler != null) {
- fDTDHandler.setDTDSource(fXPointerHandler);
- }
-
- // configure XML document pipeline: insert after DTDValidator and
- // before XML Schema validator
- XMLDocumentSource prev = null;
- if (fFeatures.get(XMLSCHEMA_VALIDATION) == Boolean.TRUE) {
- // we don't have to worry about fSchemaValidator being null, since
- // super.configurePipeline() instantiated it if the feature was set
- prev = fSchemaValidator.getDocumentSource();
- }
- // Otherwise, insert after the last component in the pipeline
- else {
- prev = fLastComponent;
- fLastComponent = fXPointerHandler;
- }
-
- XMLDocumentHandler next = prev.getDocumentHandler();
- prev.setDocumentHandler(fXIncludeHandler);
- fXIncludeHandler.setDocumentSource(prev);
-
- if (next != null) {
- fXIncludeHandler.setDocumentHandler(next);
- next.setDocumentSource(fXIncludeHandler);
- }
-
- fXIncludeHandler.setDocumentHandler(fXPointerHandler);
- fXPointerHandler.setDocumentSource(fXIncludeHandler);
- } // configurePipeline()
-
- protected void configureXML11Pipeline() {
- super.configureXML11Pipeline();
-
- // configure XML 1.1. DTD pipeline
- fXML11DTDScanner.setDTDHandler(fXML11DTDProcessor);
- fXML11DTDProcessor.setDTDSource(fXML11DTDScanner);
-
- fDTDProcessor.setDTDHandler(fXIncludeHandler);
- fXIncludeHandler.setDTDSource(fXML11DTDProcessor);
- fXIncludeHandler.setDTDHandler(fXPointerHandler);
- fXPointerHandler.setDTDSource(fXIncludeHandler);
- fXPointerHandler.setDTDHandler(fDTDHandler);
- if (fDTDHandler != null) {
- fDTDHandler.setDTDSource(fXPointerHandler);
- }
-
-
- // configure XML document pipeline: insert after DTDValidator and
- // before XML Schema validator
- XMLDocumentSource prev = null;
- if (fFeatures.get(XMLSCHEMA_VALIDATION) == Boolean.TRUE) {
- // we don't have to worry about fSchemaValidator being null, since
- // super.configurePipeline() instantiated it if the feature was set
- prev = fSchemaValidator.getDocumentSource();
- }
- // Otherwise, insert after the last component in the pipeline
- else {
- prev = fLastComponent;
- fLastComponent = fXPointerHandler;
- }
-
- XMLDocumentHandler next = prev.getDocumentHandler();
- prev.setDocumentHandler(fXIncludeHandler);
- fXIncludeHandler.setDocumentSource(prev);
-
- if (next != null) {
- fXIncludeHandler.setDocumentHandler(next);
- next.setDocumentSource(fXIncludeHandler);
- }
-
- fXIncludeHandler.setDocumentHandler(fXPointerHandler);
- fXPointerHandler.setDocumentSource(fXIncludeHandler);
-
-
- } // configureXML11Pipeline()
-
- public void setProperty(String propertyId, Object value)
- throws XMLConfigurationException {
-
- //if (propertyId.equals(XINCLUDE_HANDLER)) {
- //}
-
- super.setProperty(propertyId, value);
- } // setProperty(String,Object)
-}
diff --git a/src/com/sun/org/apache/xerces/internal/parsers/org.apache.xerces.xni.parser.DTDConfiguration b/src/com/sun/org/apache/xerces/internal/parsers/org.apache.xerces.xni.parser.DTDConfiguration
deleted file mode 100644
index 8f6ac8b..0000000
--- a/src/com/sun/org/apache/xerces/internal/parsers/org.apache.xerces.xni.parser.DTDConfiguration
+++ /dev/null
@@ -1 +0,0 @@
-com.sun.org.apache.xerces.internal.parsers.DTDConfiguration
diff --git a/src/com/sun/org/apache/xerces/internal/parsers/org.apache.xerces.xni.parser.XML11Configuration b/src/com/sun/org/apache/xerces/internal/parsers/org.apache.xerces.xni.parser.XML11Configuration
deleted file mode 100644
index af19264..0000000
--- a/src/com/sun/org/apache/xerces/internal/parsers/org.apache.xerces.xni.parser.XML11Configuration
+++ /dev/null
@@ -1 +0,0 @@
-com.sun.org.apache.xerces.internal.parsers.XML11Configuration
diff --git a/src/com/sun/org/apache/xerces/internal/parsers/org.apache.xerces.xni.parser.XMLParserConfiguration b/src/com/sun/org/apache/xerces/internal/parsers/org.apache.xerces.xni.parser.XMLParserConfiguration
deleted file mode 100644
index ca8bc3e..0000000
--- a/src/com/sun/org/apache/xerces/internal/parsers/org.apache.xerces.xni.parser.XMLParserConfiguration
+++ /dev/null
@@ -1 +0,0 @@
-com.sun.org.apache.xerces.internal.parsers.XIncludeAwareParserConfiguration
diff --git a/src/com/sun/org/apache/xerces/internal/parsers/org.xml.sax.driver b/src/com/sun/org/apache/xerces/internal/parsers/org.xml.sax.driver
deleted file mode 100644
index e1a3874..0000000
--- a/src/com/sun/org/apache/xerces/internal/parsers/org.xml.sax.driver
+++ /dev/null
@@ -1,2 +0,0 @@
-com.sun.org.apache.xerces.internal.parsers.SAXParser
-
diff --git a/src/com/sun/org/apache/xerces/internal/util/AttributesProxy.java b/src/com/sun/org/apache/xerces/internal/util/AttributesProxy.java
deleted file mode 100644
index 2c7b827..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/AttributesProxy.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.util;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
-import org.xml.sax.AttributeList;
-import org.xml.sax.ext.Attributes2;
-
-/**
- * Wraps {@link XMLAttributes} and makes it look like
- * {@link AttributeList} and {@link Attributes}.
- *
- * @author Arnaud Le Hors, IBM
- * @author Andy Clark, IBM
- *
- */
-public final class AttributesProxy
- implements AttributeList, Attributes2 {
-
- //
- // Data
- //
-
- /** XML attributes. */
- private XMLAttributes fAttributes;
-
- //
- // Constructors
- //
-
- public AttributesProxy(XMLAttributes attributes) {
- fAttributes = attributes;
- }
-
- //
- // Public methods
- //
-
- /** Sets the XML attributes to be wrapped. */
- public void setAttributes(XMLAttributes attributes) {
- fAttributes = attributes;
- } // setAttributes(XMLAttributes)
-
- public XMLAttributes getAttributes() {
- return fAttributes;
- }
-
- /*
- * Attributes methods
- */
-
- public int getLength() {
- return fAttributes.getLength();
- }
-
- public String getQName(int index) {
- return fAttributes.getQName(index);
- }
-
- public String getURI(int index) {
- // This hides the fact that internally we use null instead of empty string
- // SAX requires the URI to be a string or an empty string
- String uri = fAttributes.getURI(index);
- return uri != null ? uri : XMLSymbols.EMPTY_STRING;
- }
-
- public String getLocalName(int index) {
- return fAttributes.getLocalName(index);
- }
-
- public String getType(int i) {
- return fAttributes.getType(i);
- }
-
- public String getType(String name) {
- return fAttributes.getType(name);
- }
-
- public String getType(String uri, String localName) {
- return uri.equals(XMLSymbols.EMPTY_STRING) ?
- fAttributes.getType(null, localName) :
- fAttributes.getType(uri, localName);
- }
-
- public String getValue(int i) {
- return fAttributes.getValue(i);
- }
-
- public String getValue(String name) {
- return fAttributes.getValue(name);
- }
-
- public String getValue(String uri, String localName) {
- return uri.equals(XMLSymbols.EMPTY_STRING) ?
- fAttributes.getValue(null, localName) :
- fAttributes.getValue(uri, localName);
- }
-
- public int getIndex(String qName) {
- return fAttributes.getIndex(qName);
- }
-
- public int getIndex(String uri, String localPart) {
- return uri.equals(XMLSymbols.EMPTY_STRING) ?
- fAttributes.getIndex(null, localPart) :
- fAttributes.getIndex(uri, localPart);
- }
-
- /*
- * Attributes2 methods
- */
-
- public boolean isDeclared(int index) {
- if (index < 0 || index >= fAttributes.getLength()) {
- throw new ArrayIndexOutOfBoundsException(index);
- }
- return Boolean.TRUE.equals(
- fAttributes.getAugmentations(index).getItem(
- Constants.ATTRIBUTE_DECLARED));
- }
-
- public boolean isDeclared(String qName) {
- int index = getIndex(qName);
- if (index == -1) {
- throw new IllegalArgumentException(qName);
- }
- return Boolean.TRUE.equals(
- fAttributes.getAugmentations(index).getItem(
- Constants.ATTRIBUTE_DECLARED));
- }
-
- public boolean isDeclared(String uri, String localName) {
- int index = getIndex(uri, localName);
- if (index == -1) {
- throw new IllegalArgumentException(localName);
- }
- return Boolean.TRUE.equals(
- fAttributes.getAugmentations(index).getItem(
- Constants.ATTRIBUTE_DECLARED));
- }
-
- public boolean isSpecified(int index) {
- if (index < 0 || index >= fAttributes.getLength()) {
- throw new ArrayIndexOutOfBoundsException(index);
- }
- return fAttributes.isSpecified(index);
- }
-
- public boolean isSpecified(String qName) {
- int index = getIndex(qName);
- if (index == -1) {
- throw new IllegalArgumentException(qName);
- }
- return fAttributes.isSpecified(index);
- }
-
- public boolean isSpecified(String uri, String localName) {
- int index = getIndex(uri, localName);
- if (index == -1) {
- throw new IllegalArgumentException(localName);
- }
- return fAttributes.isSpecified(index);
- }
-
- /*
- * AttributeList methods
- */
-
- public String getName(int i) {
- return fAttributes.getQName(i);
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/util/AugmentationsImpl.java b/src/com/sun/org/apache/xerces/internal/util/AugmentationsImpl.java
deleted file mode 100644
index 425a415..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/AugmentationsImpl.java
+++ /dev/null
@@ -1,286 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.util;
-
-import com.sun.org.apache.xerces.internal.xni.Augmentations;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * This class provides an implementation for Augmentations interface.
- * Augmentations interface defines a map of additional data that could
- * be passed along the document pipeline. The information can contain extra
- * arguments or infoset augmentations, for example PSVI. This additional
- * information is identified by a String key.
- * <p>
- *
- * @author Elena Litani, IBM
- */
-public class AugmentationsImpl implements Augmentations{
-
- private AugmentationsItemsContainer fAugmentationsContainer =
- new SmallContainer();
-
- /**
- * Add additional information identified by a key to the Augmentations structure.
- *
- * @param key Identifier, can't be <code>null</code>
- * @param item Additional information
- *
- * @return the previous value of the specified key in the Augmentations strucutre,
- * or <code>null</code> if it did not have one.
- */
- public Object putItem (String key, Object item){
- Object oldValue = fAugmentationsContainer.putItem(key, item);
-
- if (oldValue == null && fAugmentationsContainer.isFull()) {
- fAugmentationsContainer = fAugmentationsContainer.expand();
- }
-
- return oldValue;
- }
-
-
- /**
- * Get information identified by a key from the Augmentations structure
- *
- * @param key Identifier, can't be <code>null</code>
- *
- * @return the value to which the key is mapped in the Augmentations structure;
- * <code>null</code> if the key is not mapped to any value.
- */
- public Object getItem(String key){
- return fAugmentationsContainer.getItem(key);
- }
-
-
- /**
- * Remove additional info from the Augmentations structure
- *
- * @param key Identifier, can't be <code>null</code>
- */
- public Object removeItem (String key){
- return fAugmentationsContainer.removeItem(key);
- }
-
- /**
- * Returns an enumeration of the keys in the Augmentations structure
- *
- */
- public Enumeration keys (){
- return fAugmentationsContainer.keys();
- }
-
- /**
- * Remove all objects from the Augmentations structure.
- */
- public void removeAllItems() {
- fAugmentationsContainer.clear();
- }
-
- public String toString() {
- return fAugmentationsContainer.toString();
- }
-
- abstract class AugmentationsItemsContainer {
- abstract public Object putItem(Object key, Object item);
- abstract public Object getItem(Object key);
- abstract public Object removeItem(Object key);
- abstract public Enumeration keys();
- abstract public void clear();
- abstract public boolean isFull();
- abstract public AugmentationsItemsContainer expand();
- }
-
- class SmallContainer extends AugmentationsItemsContainer {
- final static int SIZE_LIMIT = 10;
- final Object[] fAugmentations = new Object[SIZE_LIMIT*2];
- int fNumEntries = 0;
-
- public Enumeration keys() {
- return new SmallContainerKeyEnumeration();
- }
-
- public Object getItem(Object key) {
- for (int i = 0; i < fNumEntries*2; i = i + 2) {
- if (fAugmentations[i].equals(key)) {
- return fAugmentations[i+1];
- }
- }
-
- return null;
- }
-
- public Object putItem(Object key, Object item) {
- for (int i = 0; i < fNumEntries*2; i = i + 2) {
- if (fAugmentations[i].equals(key)) {
- Object oldValue = fAugmentations[i+1];
- fAugmentations[i+1] = item;
-
- return oldValue;
- }
- }
-
- fAugmentations[fNumEntries*2] = key;
- fAugmentations[fNumEntries*2+1] = item;
- fNumEntries++;
-
- return null;
- }
-
-
- public Object removeItem(Object key) {
- for (int i = 0; i < fNumEntries*2; i = i + 2) {
- if (fAugmentations[i].equals(key)) {
- Object oldValue = fAugmentations[i+1];
-
- for (int j = i; j < fNumEntries*2 - 2; j = j + 2) {
- fAugmentations[j] = fAugmentations[j+2];
- fAugmentations[j+1] = fAugmentations[j+3];
- }
-
- fAugmentations[fNumEntries*2-2] = null;
- fAugmentations[fNumEntries*2-1] = null;
- fNumEntries--;
-
- return oldValue;
- }
- }
-
- return null;
- }
-
- public void clear() {
- for (int i = 0; i < fNumEntries*2; i = i + 2) {
- fAugmentations[i] = null;
- fAugmentations[i+1] = null;
- }
-
- fNumEntries = 0;
- }
-
- public boolean isFull() {
- return (fNumEntries == SIZE_LIMIT);
- }
-
- public AugmentationsItemsContainer expand() {
- LargeContainer expandedContainer = new LargeContainer();
-
- for (int i = 0; i < fNumEntries*2; i = i + 2) {
- expandedContainer.putItem(fAugmentations[i],
- fAugmentations[i+1]);
- }
-
- return expandedContainer;
- }
-
- public String toString() {
- StringBuilder buff = new StringBuilder();
- buff.append("SmallContainer - fNumEntries == ").append(fNumEntries);
-
- for (int i = 0; i < SIZE_LIMIT*2; i=i+2) {
- buff.append("\nfAugmentations[")
- .append(i)
- .append("] == ")
- .append(fAugmentations[i])
- .append("; fAugmentations[")
- .append(i+1)
- .append("] == ")
- .append(fAugmentations[i+1]);
- }
-
- return buff.toString();
- }
-
- class SmallContainerKeyEnumeration implements Enumeration {
- Object [] enumArray = new Object[fNumEntries];
- int next = 0;
-
- SmallContainerKeyEnumeration() {
- for (int i = 0; i < fNumEntries; i++) {
- enumArray[i] = fAugmentations[i*2];
- }
- }
-
- public boolean hasMoreElements() {
- return next < enumArray.length;
- }
-
- public Object nextElement() {
- if (next >= enumArray.length) {
- throw new java.util.NoSuchElementException();
- }
-
- Object nextVal = enumArray[next];
- enumArray[next] = null;
- next++;
-
- return nextVal;
- }
- }
- }
-
- class LargeContainer extends AugmentationsItemsContainer {
- final Map<Object, Object> fAugmentations = new HashMap<>();
-
- public Object getItem(Object key) {
- return fAugmentations.get(key);
- }
-
- public Object putItem(Object key, Object item) {
- return fAugmentations.put(key, item);
- }
-
- public Object removeItem(Object key) {
- return fAugmentations.remove(key);
- }
-
- public Enumeration keys() {
- return Collections.enumeration(fAugmentations.keySet());
- }
-
- public void clear() {
- fAugmentations.clear();
- }
-
- public boolean isFull() {
- return false;
- }
-
- public AugmentationsItemsContainer expand() {
- return this;
- }
-
- public String toString() {
- StringBuilder buff = new StringBuilder();
- buff.append("LargeContainer");
- for(Object key : fAugmentations.keySet()) {
- buff.append("\nkey == ");
- buff.append(key);
- buff.append("; value == ");
- buff.append(fAugmentations.get(key));
- }
- return buff.toString();
- }
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/util/DOMEntityResolverWrapper.java b/src/com/sun/org/apache/xerces/internal/util/DOMEntityResolverWrapper.java
deleted file mode 100644
index fdfd9f4..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/DOMEntityResolverWrapper.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.util;
-
-
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLEntityResolver;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-
-import org.w3c.dom.ls.LSResourceResolver;
-import org.w3c.dom.ls.LSInput;
-
-import java.io.InputStream;
-import java.io.IOException;
-import java.io.Reader;
-import java.io.StringReader;
-
-
-/**
- * This class wraps DOM entity resolver to XNI entity resolver.
- *
- * @see LSResourceResolver
- *
- * @author Gopal Sharma, SUN MicroSystems Inc.
- * @author Elena Litani, IBM
- * @author Ramesh Mandava, Sun Microsystems
- */
-public class DOMEntityResolverWrapper
- implements XMLEntityResolver {
-
- //
- // Data
- //
-
- /** XML 1.0 type constant according to DOM L3 LS CR spec "http://www.w3.org/TR/2003/CR-DOM-Level-3-LS-20031107" */
- private static final String XML_TYPE = "http://www.w3.org/TR/REC-xml";
-
- /** XML Schema constant according to DOM L3 LS CR spec "http://www.w3.org/TR/2003/CR-DOM-Level-3-LS-20031107" */
- private static final String XSD_TYPE = "http://www.w3.org/2001/XMLSchema";
-
- /** The DOM entity resolver. */
- protected LSResourceResolver fEntityResolver;
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- public DOMEntityResolverWrapper() {}
-
- /** Wraps the specified DOM entity resolver. */
- public DOMEntityResolverWrapper(LSResourceResolver entityResolver) {
- setEntityResolver(entityResolver);
- } // LSResourceResolver
-
- //
- // Public methods
- //
-
- /** Sets the DOM entity resolver. */
- public void setEntityResolver(LSResourceResolver entityResolver) {
- fEntityResolver = entityResolver;
- } // setEntityResolver(LSResourceResolver)
-
- /** Returns the DOM entity resolver. */
- public LSResourceResolver getEntityResolver() {
- return fEntityResolver;
- } // getEntityResolver():LSResourceResolver
-
- //
- // XMLEntityResolver methods
- //
-
- /**
- * Resolves an external parsed entity. If the entity cannot be
- * resolved, this method should return null.
- *
- * @param resourceIdentifier description of the resource to be revsoved
- * @throws XNIException Thrown on general error.
- * @throws IOException Thrown if resolved entity stream cannot be
- * opened or some other i/o error occurs.
- */
- public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier)
- throws XNIException, IOException {
- // resolve entity using DOM entity resolver
- if (fEntityResolver != null) {
- // For entity resolution the type of the resource would be XML TYPE
- // DOM L3 LS spec mention only the XML 1.0 recommendation right now
- LSInput inputSource =
- resourceIdentifier == null
- ? fEntityResolver.resolveResource(
- null,
- null,
- null,
- null,
- null)
- : fEntityResolver.resolveResource(
- getType(resourceIdentifier),
- resourceIdentifier.getNamespace(),
- resourceIdentifier.getPublicId(),
- resourceIdentifier.getLiteralSystemId(),
- resourceIdentifier.getBaseSystemId());
- if (inputSource != null) {
- String publicId = inputSource.getPublicId();
- String systemId = inputSource.getSystemId();
- String baseSystemId = inputSource.getBaseURI();
- InputStream byteStream = inputSource.getByteStream();
- Reader charStream = inputSource.getCharacterStream();
- String encoding = inputSource.getEncoding();
- String data = inputSource.getStringData();
-
- /**
- * An LSParser looks at inputs specified in LSInput in
- * the following order: characterStream, byteStream,
- * stringData, systemId, publicId.
- */
- XMLInputSource xmlInputSource =
- new XMLInputSource(publicId, systemId, baseSystemId);
-
- if (charStream != null) {
- xmlInputSource.setCharacterStream(charStream);
- }
- else if (byteStream != null) {
- xmlInputSource.setByteStream((InputStream) byteStream);
- }
- else if (data != null && data.length() != 0) {
- xmlInputSource.setCharacterStream(new StringReader(data));
- }
- xmlInputSource.setEncoding(encoding);
- return xmlInputSource;
- }
- }
-
- // unable to resolve entity
- return null;
-
- } // resolveEntity(String,String,String):XMLInputSource
-
- /** Determines the type of resource being resolved **/
- private String getType(XMLResourceIdentifier resourceIdentifier) {
- if (resourceIdentifier instanceof XMLGrammarDescription) {
- XMLGrammarDescription desc = (XMLGrammarDescription) resourceIdentifier;
- if (XMLGrammarDescription.XML_SCHEMA.equals(desc.getGrammarType())) {
- return XSD_TYPE;
- }
- }
- return XML_TYPE;
- } // getType(XMLResourceIdentifier):String
-
-} // DOMEntityResolverWrapper
diff --git a/src/com/sun/org/apache/xerces/internal/util/DOMErrorHandlerWrapper.java b/src/com/sun/org/apache/xerces/internal/util/DOMErrorHandlerWrapper.java
deleted file mode 100644
index 83c59c3..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/DOMErrorHandlerWrapper.java
+++ /dev/null
@@ -1,422 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.util;
-
-import com.sun.org.apache.xerces.internal.dom.DOMErrorImpl;
-import com.sun.org.apache.xerces.internal.dom.DOMLocatorImpl;
-import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLParseException;
-import java.io.PrintWriter;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import org.w3c.dom.DOMError;
-import org.w3c.dom.DOMErrorHandler;
-import org.w3c.dom.DOMLocator;
-import org.w3c.dom.Node;
-
-/**
- * This class handles DOM errors .
- *
- * @see DOMErrorHandler
- *
- * @author Gopal Sharma, SUN Microsystems Inc.
- */
-
-// REVISIT: current implementations wraps error several times:
-// XMLErrorReport.reportError creates XMLParserException (by wrapping all info)
-// and goes via switch to send errors.
-// DOMErrorHandlerWrapper catches calls, copies info from XMLParserException and
-// sends one call back to the application
-// I think we can avoid this indirection if we modify XMLErrorReporter. --el
-
-public class DOMErrorHandlerWrapper
- implements XMLErrorHandler, DOMErrorHandler {
-
-
-
- // It keeps the reference of DOMErrorHandler of application
- protected DOMErrorHandler fDomErrorHandler;
-
- // Error Status
- boolean eStatus = true ;
-
- // Print writer
- protected PrintWriter fOut;
-
- // some components may set error node
- // @see DOMNormalizer.
- public Node fCurrentNode;
-
- /** Error code for comparisons. **/
- protected final XMLErrorCode fErrorCode = new XMLErrorCode(null, null);
-
- protected final DOMErrorImpl fDOMError = new DOMErrorImpl();
-
-
-
- //
- // Constructors
- //
-
- // Default constructor /
-
- public DOMErrorHandlerWrapper() {
- fOut = new PrintWriter(System.err);
- }
-
-
- public DOMErrorHandlerWrapper(DOMErrorHandler domErrorHandler) {
- fDomErrorHandler = domErrorHandler;
- } // DOMErrorHandlerWrapper(DOMErrorHandler domErrorHandler)
-
-
- //
- // Public methods
- //
-
- /** Sets the DOM error handler. */
- public void setErrorHandler(DOMErrorHandler errorHandler) {
- fDomErrorHandler = errorHandler;
- } // setErrorHandler(ErrorHandler)
-
-
- public DOMErrorHandler getErrorHandler(){
- return fDomErrorHandler;
- } //getErrorHandler()
-
- //
- // XMLErrorHandler methods
- //
-
- /**
- * Reports a warning. Warnings are non-fatal and can be safely ignored
- * by most applications.
- *
- * @param domain The domain of the warning. The domain can be any
- * string but is suggested to be a valid URI. The
- * domain can be used to conveniently specify a web
- * site location of the relevent specification or
- * document pertaining to this warning.
- * @param key The warning key. This key can be any string and
- * is implementation dependent.
- * @param exception Exception.
- *
- * @throws XNIException Thrown to signal that the parser should stop
- * parsing the document.
- */
-
- public void warning(String domain, String key,
- XMLParseException exception) throws XNIException {
- fDOMError.fSeverity = DOMError.SEVERITY_WARNING;
- fDOMError.fException = exception;
- // REVISIT: May need to lookup from DOMErrorTypeMap in the future.
- fDOMError.fType = key;
- fDOMError.fRelatedData = fDOMError.fMessage = exception.getMessage();
- DOMLocatorImpl locator = fDOMError.fLocator;
- if (locator != null) {
- locator.fColumnNumber = exception.getColumnNumber();
- locator.fLineNumber = exception.getLineNumber();
- locator.fUtf16Offset = exception.getCharacterOffset();
- locator.fUri = exception.getExpandedSystemId();
- locator.fRelatedNode = fCurrentNode;
- }
- if (fDomErrorHandler != null) {
- fDomErrorHandler.handleError(fDOMError);
- }
- } // warning(String,String,XMLParseException)
-
- /**
- * Reports an error. Errors are non-fatal and usually signify that the
- * document is invalid with respect to its grammar(s).
- *
- * @param domain The domain of the error. The domain can be any
- * string but is suggested to be a valid URI. The
- * domain can be used to conveniently specify a web
- * site location of the relevent specification or
- * document pertaining to this error.
- * @param key The error key. This key can be any string and
- * is implementation dependent.
- * @param exception Exception.
- *
- * @throws XNIException Thrown to signal that the parser should stop
- * parsing the document.
- */
- public void error(String domain, String key,
- XMLParseException exception) throws XNIException {
- fDOMError.fSeverity = DOMError.SEVERITY_ERROR;
- fDOMError.fException = exception;
- // REVISIT: May need to lookup from DOMErrorTypeMap in the future.
- fDOMError.fType = key;
- fDOMError.fRelatedData = fDOMError.fMessage = exception.getMessage();
- DOMLocatorImpl locator = fDOMError.fLocator;
- if (locator != null) {
- locator.fColumnNumber = exception.getColumnNumber();
- locator.fLineNumber = exception.getLineNumber();
- locator.fUtf16Offset = exception.getCharacterOffset();
- locator.fUri = exception.getExpandedSystemId();
- locator.fRelatedNode= fCurrentNode;
- }
- if (fDomErrorHandler != null) {
- fDomErrorHandler.handleError(fDOMError);
- }
- } // error(String,String,XMLParseException)
-
- /**
- * Report a fatal error. Fatal errors usually occur when the document
- * is not well-formed and signifies that the parser cannot continue
- * normal operation.
- * <p>
- * <strong>Note:</strong> The error handler should <em>always</em>
- * throw an <code>XNIException</code> from this method. This exception
- * can either be the same exception that is passed as a parameter to
- * the method or a new XNI exception object. If the registered error
- * handler fails to throw an exception, the continuing operation of
- * the parser is undetermined.
- *
- * @param domain The domain of the fatal error. The domain can be
- * any string but is suggested to be a valid URI. The
- * domain can be used to conveniently specify a web
- * site location of the relevent specification or
- * document pertaining to this fatal error.
- * @param key The fatal error key. This key can be any string
- * and is implementation dependent.
- * @param exception Exception.
- *
- * @throws XNIException Thrown to signal that the parser should stop
- * parsing the document.
- */
- public void fatalError(String domain, String key,
- XMLParseException exception) throws XNIException {
- fDOMError.fSeverity = DOMError.SEVERITY_FATAL_ERROR;
- fDOMError.fException = exception;
- fErrorCode.setValues(domain, key);
- String domErrorType = DOMErrorTypeMap.getDOMErrorType(fErrorCode);
- fDOMError.fType = (domErrorType != null) ? domErrorType : key;
- fDOMError.fRelatedData = fDOMError.fMessage = exception.getMessage();
- DOMLocatorImpl locator = fDOMError.fLocator;
- if (locator != null) {
- locator.fColumnNumber = exception.getColumnNumber();
- locator.fLineNumber = exception.getLineNumber();
- locator.fUtf16Offset = exception.getCharacterOffset();
- locator.fUri = exception.getExpandedSystemId();
- locator.fRelatedNode = fCurrentNode;
- }
- if (fDomErrorHandler != null) {
- fDomErrorHandler.handleError(fDOMError);
- }
- } // fatalError(String,String,XMLParseException)
-
-
- public boolean handleError(DOMError error) {
- printError(error);
- return eStatus;
- }
-
- /** Prints the error message. */
-
- private void printError(DOMError error) {
- int severity = error.getSeverity();
- fOut.print("[");
- if ( severity == DOMError.SEVERITY_WARNING) {
- fOut.print("Warning");
- } else if ( severity == DOMError.SEVERITY_ERROR) {
- fOut.print("Error");
- } else {
- fOut.print("FatalError");
- eStatus = false ; //REVISIT: Abort processing if fatal error, do we need to??
- }
- fOut.print("] ");
- DOMLocator locator = error.getLocation();
- if (locator != null) {
- fOut.print(locator.getLineNumber());
- fOut.print(":");
- fOut.print(locator.getColumnNumber());
- fOut.print(":");
- fOut.print(locator.getByteOffset());
- fOut.print(",");
- fOut.print(locator.getUtf16Offset());
- Node node = locator.getRelatedNode();
- if (node != null) {
- fOut.print("[");
- fOut.print(node.getNodeName());
- fOut.print("]");
- }
- String systemId = locator.getUri();
- if (systemId != null) {
- int index = systemId.lastIndexOf('/');
- if (index != -1)
- systemId = systemId.substring(index + 1);
- fOut.print(": ");
- fOut.print(systemId);
- }
-
- }
-
- fOut.print(":");
- fOut.print(error.getMessage());
- fOut.println();
- fOut.flush();
-
- } // printError(DOMError)
-
- /**
- * A convenience class for converting between internal
- * error codes and DOM error types.
- */
- private static class DOMErrorTypeMap {
-
- /** Map for converting internal error codes to DOM error types. **/
- private static final Map<XMLErrorCode, String> fgDOMErrorTypeTable;
-
- static {
- // initialize error type table: internal error codes (represented by domain and key) need to be mapped to a DOM error type.
-
- // REVISIT: do well-formedness issues involving XML declaration <?xml ... ?> need to be added to hash table (no XML declaration node in DOM, but Document includes xmlEncoding, xmlStandalone, xmlVersion, etc.
-
- Map<XMLErrorCode, String> aDOMErrorTypeTable = new HashMap<>();
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "InvalidCharInCDSect"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "InvalidCharInContent"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "TwoColonsInQName"), "wf-invalid-character-in-node-name");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ColonNotLegalWithNS"), "wf-invalid-character-in-node-name");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "InvalidCharInProlog"), "wf-invalid-character"); // e.g. in Processing Instruction
-
- // InvalidCharInXMLDecl omitted because XML declaration is not a DOM Node
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "CDEndInContent"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "CDSectUnterminated"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "DoctypeNotAllowed"), "doctype-not-allowed");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ETagRequired"), "wf-invalid-character-in-node-name");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ElementUnterminated"), "wf-invalid-character-in-node-name");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "EqRequiredInAttribute"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "OpenQuoteExpected"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "CloseQuoteExpected"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ETagUnterminated"), "wf-invalid-character-in-node-name");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MarkupNotRecognizedInContent"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "DoctypeIllegalInContent"), "doctype-not-allowed");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "InvalidCharInAttValue"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "InvalidCharInPI"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "InvalidCharInInternalSubset"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "QuoteRequiredInAttValue"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "LessthanInAttValue"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "AttributeValueUnterminated"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "PITargetRequired"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "SpaceRequiredInPI"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "PIUnterminated"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ReservedPITarget"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "PI_NOT_IN_ONE_ENTITY"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "PINotInOneEntity"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "EncodingDeclInvalid"), "unsupported-encoding");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "EncodingByteOrderUnsupported"), "unsupported-encoding");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "InvalidCharInEntityValue"), "wf-invalid-character-in-node-name");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "InvalidCharInExternalSubset"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "InvalidCharInIgnoreSect"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "InvalidCharInPublicID"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "InvalidCharInSystemID"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "SpaceRequiredAfterSYSTEM"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "QuoteRequiredInSystemID"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "SystemIDUnterminated"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "SpaceRequiredAfterPUBLIC"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "QuoteRequiredInPublicID"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "PublicIDUnterminated"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "PubidCharIllegal"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "SpaceRequiredBetweenPublicAndSystem"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_ROOT_ELEMENT_TYPE_IN_DOCTYPEDECL"), "wf-invalid-character-in-node-name"); // considered error in name of node (which follows !DOCTYPE)
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_ROOT_ELEMENT_TYPE_REQUIRED"), "wf-invalid-character-in-node-name");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "DoctypedeclUnterminated"), "wf-invalid-character-in-node-name");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "PEReferenceWithinMarkup"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_MARKUP_NOT_RECOGNIZED_IN_DTD"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ELEMENTDECL"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_ELEMENT_TYPE_REQUIRED_IN_ELEMENTDECL"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_CONTENTSPEC_IN_ELEMENTDECL"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_CONTENTSPEC_REQUIRED_IN_ELEMENTDECL"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ElementDeclUnterminated"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_OPEN_PAREN_OR_ELEMENT_TYPE_REQUIRED_IN_CHILDREN"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_CLOSE_PAREN_REQUIRED_IN_CHILDREN"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_ELEMENT_TYPE_REQUIRED_IN_MIXED_CONTENT"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_CLOSE_PAREN_REQUIRED_IN_MIXED"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MixedContentUnterminated"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ATTLISTDECL"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_ELEMENT_TYPE_REQUIRED_IN_ATTLISTDECL"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_ATTRIBUTE_NAME_IN_ATTDEF"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "AttNameRequiredInAttDef"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_ATTTYPE_IN_ATTDEF"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "AttTypeRequiredInAttDef"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_DEFAULTDECL_IN_ATTDEF"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_DUPLICATE_ATTRIBUTE_DEFINITION"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_AFTER_NOTATION_IN_NOTATIONTYPE"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_OPEN_PAREN_REQUIRED_IN_NOTATIONTYPE"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_NAME_REQUIRED_IN_NOTATIONTYPE"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "NotationTypeUnterminated"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_NMTOKEN_REQUIRED_IN_ENUMERATION"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "EnumerationUnterminated"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_DISTINCT_TOKENS_IN_ENUMERATION"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_DISTINCT_NOTATION_IN_ENUMERATION"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_AFTER_FIXED_IN_DEFAULTDECL"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "IncludeSectUnterminated"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "IgnoreSectUnterminated"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "NameRequiredInPEReference"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "SemicolonRequiredInPEReference"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_ENTITY_NAME_IN_ENTITYDECL"), "wf-invalid-character-in-node-name"); // considered error in name of node (which follows !ENTITY)
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_PERCENT_IN_PEDECL"), "wf-invalid-character-in-node-name"); // considered error in name of node (which follows !ENTITY %)
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_ENTITY_NAME_IN_PEDECL"), "wf-invalid-character-in-node-name"); // considered error in name of node (which follows !ENTITY %)
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_ENTITY_NAME_REQUIRED_IN_ENTITYDECL"), "wf-invalid-character-in-node-name"); // considered error in name of node (which follows !ENTITY)
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_AFTER_ENTITY_NAME_IN_ENTITYDECL"), "wf-invalid-character-in-node-name"); // considered error in name of node
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_UNPARSED_ENTITYDECL"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_NDATA_IN_UNPARSED_ENTITYDECL"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_NOTATION_NAME_REQUIRED_FOR_UNPARSED_ENTITYDECL"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "EntityDeclUnterminated"), "wf-invalid-character-in-node-name");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_DUPLICATE_ENTITY_DEFINITION"), "wf-invalid-character-in-node-name");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ExternalIDRequired"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_PUBIDLITERAL_IN_EXTERNALID"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_AFTER_PUBIDLITERAL_IN_EXTERNALID"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_SYSTEMLITERAL_IN_EXTERNALID"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_URI_FRAGMENT_IN_SYSTEMID"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_NOTATIONDECL"), "wf-invalid-character-in-node-name"); // considered error in name of node, which follows !NOTATION
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_NOTATION_NAME_REQUIRED_IN_NOTATIONDECL"), "wf-invalid-character-in-node-name"); // considered error in name of node, which follows !NOTATION
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_AFTER_NOTATION_NAME_IN_NOTATIONDECL"), "wf-invalid-character-in-node-name"); // considered error in name of node, which follows !NOTATION
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ExternalIDorPublicIDRequired"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "NotationDeclUnterminated"), "wf-invalid-character-in-node-name");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ReferenceToExternalEntity"), "wf-invalid-character");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ReferenceToUnparsedEntity"), "wf-invalid-character");
-
- // REVISIT: do EntityNotDeclared, RecursiveReference, RecursiveGeneralReference, RecursivePEReference belong here?
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "EncodingNotSupported"), "unsupported-encoding");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "EncodingRequired"), "unsupported-encoding");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "IllegalQName"), "wf-invalid-character-in-node-name");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ElementXMLNSPrefix"), "wf-invalid-character-in-node-name");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ElementPrefixUnbound"), "wf-invalid-character-in-node-name");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "AttributePrefixUnbound"), "wf-invalid-character-in-node-name");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "EmptyPrefixedAttName"), "wf-invalid-character-in-node-name");
- aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "PrefixDeclared"), "wf-invalid-character-in-node-name");
-
- fgDOMErrorTypeTable = Collections.unmodifiableMap(aDOMErrorTypeTable);
- }
-
- public static String getDOMErrorType (XMLErrorCode error) {
- return fgDOMErrorTypeTable.get(error);
- }
-
- private DOMErrorTypeMap () {}
- }
-
-} // class DOMErrorHandlerWrapper
diff --git a/src/com/sun/org/apache/xerces/internal/util/DOMInputSource.java b/src/com/sun/org/apache/xerces/internal/util/DOMInputSource.java
deleted file mode 100644
index 621dd7d..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/DOMInputSource.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.util;
-
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-import org.w3c.dom.Node;
-
-/**
- * <p>An <code>XMLInputSource</code> analogue to <code>javax.xml.transform.dom.DOMSource</code>.</p>
- *
- */
-public final class DOMInputSource extends XMLInputSource {
-
- private Node fNode;
-
- public DOMInputSource() {
- this(null);
- }
-
- public DOMInputSource(Node node) {
- super(null, getSystemIdFromNode(node), null);
- fNode = node;
- }
-
- public DOMInputSource(Node node, String systemId) {
- super(null, systemId, null);
- fNode = node;
- }
-
- public Node getNode() {
- return fNode;
- }
-
- public void setNode(Node node) {
- fNode = node;
- }
-
- private static String getSystemIdFromNode(Node node) {
- if (node != null) {
- try {
- return node.getBaseURI();
- }
- // If the DOM implementation is DOM Level 2
- // then a NoSuchMethodError will be thrown.
- // Just ignore it.
- catch (NoSuchMethodError e) {
- return null;
- }
- // There was a failure for some other reason
- // Ignore it as well.
- catch (Exception e) {
- return null;
- }
- }
- return null;
- }
-
-} // DOMInputSource
diff --git a/src/com/sun/org/apache/xerces/internal/util/DOMUtil.java b/src/com/sun/org/apache/xerces/internal/util/DOMUtil.java
deleted file mode 100644
index 5e0bc24..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/DOMUtil.java
+++ /dev/null
@@ -1,901 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.util;
-
-import com.sun.org.apache.xerces.internal.dom.AttrImpl;
-import com.sun.org.apache.xerces.internal.dom.DocumentImpl;
-import com.sun.org.apache.xerces.internal.impl.xs.opti.ElementImpl;
-import java.util.Map;
-import org.w3c.dom.Attr;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.ls.LSException;
-
-/**
- * Some useful utility methods.
- * This class was modified in Xerces2 with a view to abstracting as
- * much as possible away from the representation of the underlying
- * parsed structure (i.e., the DOM). This was done so that, if Xerces
- * ever adopts an in-memory representation more efficient than the DOM
- * (such as a DTM), we should easily be able to convert our schema
- * parsing to utilize it.
- *
- * @version $Id: DOMUtil.java,v 1.7 2010-11-01 04:40:14 joehw Exp $
- */
-public class DOMUtil {
-
- //
- // Constructors
- //
-
- /** This class cannot be instantiated. */
- protected DOMUtil() {}
-
- //
- // Public static methods
- //
-
- /**
- * Copies the source tree into the specified place in a destination
- * tree. The source node and its children are appended as children
- * of the destination node.
- * <p>
- * <em>Note:</em> This is an iterative implementation.
- */
- public static void copyInto(Node src, Node dest) throws DOMException {
-
- // get node factory
- Document factory = dest.getOwnerDocument();
- boolean domimpl = factory instanceof DocumentImpl;
-
- // placement variables
- Node start = src;
- Node parent = src;
- Node place = src;
-
- // traverse source tree
- while (place != null) {
-
- // copy this node
- Node node = null;
- int type = place.getNodeType();
- switch (type) {
- case Node.CDATA_SECTION_NODE: {
- node = factory.createCDATASection(place.getNodeValue());
- break;
- }
- case Node.COMMENT_NODE: {
- node = factory.createComment(place.getNodeValue());
- break;
- }
- case Node.ELEMENT_NODE: {
- Element element = factory.createElement(place.getNodeName());
- node = element;
- NamedNodeMap attrs = place.getAttributes();
- int attrCount = attrs.getLength();
- for (int i = 0; i < attrCount; i++) {
- Attr attr = (Attr)attrs.item(i);
- String attrName = attr.getNodeName();
- String attrValue = attr.getNodeValue();
- element.setAttribute(attrName, attrValue);
- if (domimpl && !attr.getSpecified()) {
- ((AttrImpl)element.getAttributeNode(attrName)).setSpecified(false);
- }
- }
- break;
- }
- case Node.ENTITY_REFERENCE_NODE: {
- node = factory.createEntityReference(place.getNodeName());
- break;
- }
- case Node.PROCESSING_INSTRUCTION_NODE: {
- node = factory.createProcessingInstruction(place.getNodeName(),
- place.getNodeValue());
- break;
- }
- case Node.TEXT_NODE: {
- node = factory.createTextNode(place.getNodeValue());
- break;
- }
- default: {
- throw new IllegalArgumentException("can't copy node type, "+
- type+" ("+
- place.getNodeName()+')');
- }
- }
- dest.appendChild(node);
-
- // iterate over children
- if (place.hasChildNodes()) {
- parent = place;
- place = place.getFirstChild();
- dest = node;
- }
-
- // advance
- else {
- place = place.getNextSibling();
- while (place == null && parent != start) {
- place = parent.getNextSibling();
- parent = parent.getParentNode();
- dest = dest.getParentNode();
- }
- }
-
- }
-
- } // copyInto(Node,Node)
-
- /** Finds and returns the first child element node. */
- public static Element getFirstChildElement(Node parent) {
-
- // search for node
- Node child = parent.getFirstChild();
- while (child != null) {
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- return (Element)child;
- }
- child = child.getNextSibling();
- }
-
- // not found
- return null;
-
- } // getFirstChildElement(Node):Element
-
- /** Finds and returns the first visible child element node. */
- public static Element getFirstVisibleChildElement(Node parent) {
-
- // search for node
- Node child = parent.getFirstChild();
- while (child != null) {
- if (child.getNodeType() == Node.ELEMENT_NODE &&
- !isHidden(child)) {
- return (Element)child;
- }
- child = child.getNextSibling();
- }
-
- // not found
- return null;
-
- } // getFirstChildElement(Node):Element
-
- /** Finds and returns the first visible child element node. */
- public static Element getFirstVisibleChildElement(Node parent, Map<Node, String> hiddenNodes) {
-
- // search for node
- Node child = parent.getFirstChild();
- while (child != null) {
- if (child.getNodeType() == Node.ELEMENT_NODE &&
- !isHidden(child, hiddenNodes)) {
- return (Element)child;
- }
- child = child.getNextSibling();
- }
-
- // not found
- return null;
-
- } // getFirstChildElement(Node):Element
-
- /** Finds and returns the last child element node.
- * Overload previous method for non-Xerces node impl.
- */
- public static Element getLastChildElement(Node parent) {
-
- // search for node
- Node child = parent.getLastChild();
- while (child != null) {
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- return (Element)child;
- }
- child = child.getPreviousSibling();
- }
-
- // not found
- return null;
-
- } // getLastChildElement(Node):Element
-
- /** Finds and returns the last visible child element node. */
- public static Element getLastVisibleChildElement(Node parent) {
-
- // search for node
- Node child = parent.getLastChild();
- while (child != null) {
- if (child.getNodeType() == Node.ELEMENT_NODE &&
- !isHidden(child)) {
- return (Element)child;
- }
- child = child.getPreviousSibling();
- }
-
- // not found
- return null;
-
- } // getLastChildElement(Node):Element
-
- /** Finds and returns the last visible child element node.
- * Overload previous method for non-Xerces node impl
- */
- public static Element getLastVisibleChildElement(Node parent, Map<Node, String> hiddenNodes) {
-
- // search for node
- Node child = parent.getLastChild();
- while (child != null) {
- if (child.getNodeType() == Node.ELEMENT_NODE &&
- !isHidden(child, hiddenNodes)) {
- return (Element)child;
- }
- child = child.getPreviousSibling();
- }
-
- // not found
- return null;
-
- } // getLastChildElement(Node):Element
- /** Finds and returns the next sibling element node. */
- public static Element getNextSiblingElement(Node node) {
-
- // search for node
- Node sibling = node.getNextSibling();
- while (sibling != null) {
- if (sibling.getNodeType() == Node.ELEMENT_NODE) {
- return (Element)sibling;
- }
- sibling = sibling.getNextSibling();
- }
-
- // not found
- return null;
-
- } // getNextSiblingElement(Node):Element
-
- // get next visible (un-hidden) node.
- public static Element getNextVisibleSiblingElement(Node node) {
-
- // search for node
- Node sibling = node.getNextSibling();
- while (sibling != null) {
- if (sibling.getNodeType() == Node.ELEMENT_NODE &&
- !isHidden(sibling)) {
- return (Element)sibling;
- }
- sibling = sibling.getNextSibling();
- }
-
- // not found
- return null;
-
- } // getNextSiblingdElement(Node):Element
-
- // get next visible (un-hidden) node, overload previous method for non Xerces node impl
- public static Element getNextVisibleSiblingElement(Node node, Map<Node, String> hiddenNodes) {
-
- // search for node
- Node sibling = node.getNextSibling();
- while (sibling != null) {
- if (sibling.getNodeType() == Node.ELEMENT_NODE &&
- !isHidden(sibling, hiddenNodes)) {
- return (Element)sibling;
- }
- sibling = sibling.getNextSibling();
- }
-
- // not found
- return null;
-
- } // getNextSiblingdElement(Node):Element
-
- // set this Node as being hidden
- public static void setHidden(Node node) {
- if (node instanceof com.sun.org.apache.xerces.internal.impl.xs.opti.NodeImpl)
- ((com.sun.org.apache.xerces.internal.impl.xs.opti.NodeImpl)node).setReadOnly(true, false);
- else if (node instanceof com.sun.org.apache.xerces.internal.dom.NodeImpl)
- ((com.sun.org.apache.xerces.internal.dom.NodeImpl)node).setReadOnly(true, false);
- } // setHidden(node):void
-
- // set this Node as being hidden, overloaded method
- public static void setHidden(Node node, Map<Node, String> hiddenNodes) {
- if (node instanceof com.sun.org.apache.xerces.internal.impl.xs.opti.NodeImpl) {
- ((com.sun.org.apache.xerces.internal.impl.xs.opti.NodeImpl)node).setReadOnly(true, false);
- }
- else {
- hiddenNodes.put(node, "");
- }
- } // setHidden(node):void
-
- // set this Node as being visible
- public static void setVisible(Node node) {
- if (node instanceof com.sun.org.apache.xerces.internal.impl.xs.opti.NodeImpl)
- ((com.sun.org.apache.xerces.internal.impl.xs.opti.NodeImpl)node).setReadOnly(false, false);
- else if (node instanceof com.sun.org.apache.xerces.internal.dom.NodeImpl)
- ((com.sun.org.apache.xerces.internal.dom.NodeImpl)node).setReadOnly(false, false);
- } // setVisible(node):void
-
- // set this Node as being visible, overloaded method
- public static void setVisible(Node node, Map<Node, String> hiddenNodes) {
- if (node instanceof com.sun.org.apache.xerces.internal.impl.xs.opti.NodeImpl) {
- ((com.sun.org.apache.xerces.internal.impl.xs.opti.NodeImpl)node).setReadOnly(false, false);
- }
- else {
- hiddenNodes.remove(node);
- }
- } // setVisible(node):void
-
- // is this node hidden?
- public static boolean isHidden(Node node) {
- if (node instanceof com.sun.org.apache.xerces.internal.impl.xs.opti.NodeImpl)
- return ((com.sun.org.apache.xerces.internal.impl.xs.opti.NodeImpl)node).getReadOnly();
- else if (node instanceof com.sun.org.apache.xerces.internal.dom.NodeImpl)
- return ((com.sun.org.apache.xerces.internal.dom.NodeImpl)node).getReadOnly();
- return false;
- } // isHidden(Node):boolean
-
- // is this node hidden? overloaded method
- public static boolean isHidden(Node node, Map<Node, String> hiddenNodes) {
- if (node instanceof com.sun.org.apache.xerces.internal.impl.xs.opti.NodeImpl) {
- return ((com.sun.org.apache.xerces.internal.impl.xs.opti.NodeImpl)node).getReadOnly();
- }
- else {
- return hiddenNodes.containsKey(node);
- }
- } // isHidden(Node):boolean
-
- /** Finds and returns the first child node with the given name. */
- public static Element getFirstChildElement(Node parent, String elemName) {
-
- // search for node
- Node child = parent.getFirstChild();
- while (child != null) {
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- if (child.getNodeName().equals(elemName)) {
- return (Element)child;
- }
- }
- child = child.getNextSibling();
- }
-
- // not found
- return null;
-
- } // getFirstChildElement(Node,String):Element
-
- /** Finds and returns the last child node with the given name. */
- public static Element getLastChildElement(Node parent, String elemName) {
-
- // search for node
- Node child = parent.getLastChild();
- while (child != null) {
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- if (child.getNodeName().equals(elemName)) {
- return (Element)child;
- }
- }
- child = child.getPreviousSibling();
- }
-
- // not found
- return null;
-
- } // getLastChildElement(Node,String):Element
-
- /** Finds and returns the next sibling node with the given name. */
- public static Element getNextSiblingElement(Node node, String elemName) {
-
- // search for node
- Node sibling = node.getNextSibling();
- while (sibling != null) {
- if (sibling.getNodeType() == Node.ELEMENT_NODE) {
- if (sibling.getNodeName().equals(elemName)) {
- return (Element)sibling;
- }
- }
- sibling = sibling.getNextSibling();
- }
-
- // not found
- return null;
-
- } // getNextSiblingdElement(Node,String):Element
-
- /** Finds and returns the first child node with the given qualified name. */
- public static Element getFirstChildElementNS(Node parent,
- String uri, String localpart) {
-
- // search for node
- Node child = parent.getFirstChild();
- while (child != null) {
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- String childURI = child.getNamespaceURI();
- if (childURI != null && childURI.equals(uri) &&
- child.getLocalName().equals(localpart)) {
- return (Element)child;
- }
- }
- child = child.getNextSibling();
- }
-
- // not found
- return null;
-
- } // getFirstChildElementNS(Node,String,String):Element
-
- /** Finds and returns the last child node with the given qualified name. */
- public static Element getLastChildElementNS(Node parent,
- String uri, String localpart) {
-
- // search for node
- Node child = parent.getLastChild();
- while (child != null) {
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- String childURI = child.getNamespaceURI();
- if (childURI != null && childURI.equals(uri) &&
- child.getLocalName().equals(localpart)) {
- return (Element)child;
- }
- }
- child = child.getPreviousSibling();
- }
-
- // not found
- return null;
-
- } // getLastChildElementNS(Node,String,String):Element
-
- /** Finds and returns the next sibling node with the given qualified name. */
- public static Element getNextSiblingElementNS(Node node,
- String uri, String localpart) {
-
- // search for node
- Node sibling = node.getNextSibling();
- while (sibling != null) {
- if (sibling.getNodeType() == Node.ELEMENT_NODE) {
- String siblingURI = sibling.getNamespaceURI();
- if (siblingURI != null && siblingURI.equals(uri) &&
- sibling.getLocalName().equals(localpart)) {
- return (Element)sibling;
- }
- }
- sibling = sibling.getNextSibling();
- }
-
- // not found
- return null;
-
- } // getNextSiblingdElementNS(Node,String,String):Element
-
- /** Finds and returns the first child node with the given name. */
- public static Element getFirstChildElement(Node parent, String elemNames[]) {
-
- // search for node
- Node child = parent.getFirstChild();
- while (child != null) {
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- for (int i = 0; i < elemNames.length; i++) {
- if (child.getNodeName().equals(elemNames[i])) {
- return (Element)child;
- }
- }
- }
- child = child.getNextSibling();
- }
-
- // not found
- return null;
-
- } // getFirstChildElement(Node,String[]):Element
-
- /** Finds and returns the last child node with the given name. */
- public static Element getLastChildElement(Node parent, String elemNames[]) {
-
- // search for node
- Node child = parent.getLastChild();
- while (child != null) {
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- for (int i = 0; i < elemNames.length; i++) {
- if (child.getNodeName().equals(elemNames[i])) {
- return (Element)child;
- }
- }
- }
- child = child.getPreviousSibling();
- }
-
- // not found
- return null;
-
- } // getLastChildElement(Node,String[]):Element
-
- /** Finds and returns the next sibling node with the given name. */
- public static Element getNextSiblingElement(Node node, String elemNames[]) {
-
- // search for node
- Node sibling = node.getNextSibling();
- while (sibling != null) {
- if (sibling.getNodeType() == Node.ELEMENT_NODE) {
- for (int i = 0; i < elemNames.length; i++) {
- if (sibling.getNodeName().equals(elemNames[i])) {
- return (Element)sibling;
- }
- }
- }
- sibling = sibling.getNextSibling();
- }
-
- // not found
- return null;
-
- } // getNextSiblingdElement(Node,String[]):Element
-
- /** Finds and returns the first child node with the given qualified name. */
- public static Element getFirstChildElementNS(Node parent,
- String[][] elemNames) {
-
- // search for node
- Node child = parent.getFirstChild();
- while (child != null) {
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- for (int i = 0; i < elemNames.length; i++) {
- String uri = child.getNamespaceURI();
- if (uri != null && uri.equals(elemNames[i][0]) &&
- child.getLocalName().equals(elemNames[i][1])) {
- return (Element)child;
- }
- }
- }
- child = child.getNextSibling();
- }
-
- // not found
- return null;
-
- } // getFirstChildElementNS(Node,String[][]):Element
-
- /** Finds and returns the last child node with the given qualified name. */
- public static Element getLastChildElementNS(Node parent,
- String[][] elemNames) {
-
- // search for node
- Node child = parent.getLastChild();
- while (child != null) {
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- for (int i = 0; i < elemNames.length; i++) {
- String uri = child.getNamespaceURI();
- if (uri != null && uri.equals(elemNames[i][0]) &&
- child.getLocalName().equals(elemNames[i][1])) {
- return (Element)child;
- }
- }
- }
- child = child.getPreviousSibling();
- }
-
- // not found
- return null;
-
- } // getLastChildElementNS(Node,String[][]):Element
-
- /** Finds and returns the next sibling node with the given qualified name. */
- public static Element getNextSiblingElementNS(Node node,
- String[][] elemNames) {
-
- // search for node
- Node sibling = node.getNextSibling();
- while (sibling != null) {
- if (sibling.getNodeType() == Node.ELEMENT_NODE) {
- for (int i = 0; i < elemNames.length; i++) {
- String uri = sibling.getNamespaceURI();
- if (uri != null && uri.equals(elemNames[i][0]) &&
- sibling.getLocalName().equals(elemNames[i][1])) {
- return (Element)sibling;
- }
- }
- }
- sibling = sibling.getNextSibling();
- }
-
- // not found
- return null;
-
- } // getNextSiblingdElementNS(Node,String[][]):Element
-
- /**
- * Finds and returns the first child node with the given name and
- * attribute name, value pair.
- */
- public static Element getFirstChildElement(Node parent,
- String elemName,
- String attrName,
- String attrValue) {
-
- // search for node
- Node child = parent.getFirstChild();
- while (child != null) {
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- Element element = (Element)child;
- if (element.getNodeName().equals(elemName) &&
- element.getAttribute(attrName).equals(attrValue)) {
- return element;
- }
- }
- child = child.getNextSibling();
- }
-
- // not found
- return null;
-
- } // getFirstChildElement(Node,String,String,String):Element
-
- /**
- * Finds and returns the last child node with the given name and
- * attribute name, value pair.
- */
- public static Element getLastChildElement(Node parent,
- String elemName,
- String attrName,
- String attrValue) {
-
- // search for node
- Node child = parent.getLastChild();
- while (child != null) {
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- Element element = (Element)child;
- if (element.getNodeName().equals(elemName) &&
- element.getAttribute(attrName).equals(attrValue)) {
- return element;
- }
- }
- child = child.getPreviousSibling();
- }
-
- // not found
- return null;
-
- } // getLastChildElement(Node,String,String,String):Element
-
- /**
- * Finds and returns the next sibling node with the given name and
- * attribute name, value pair. Since only elements have attributes,
- * the node returned will be of type Node.ELEMENT_NODE.
- */
- public static Element getNextSiblingElement(Node node,
- String elemName,
- String attrName,
- String attrValue) {
-
- // search for node
- Node sibling = node.getNextSibling();
- while (sibling != null) {
- if (sibling.getNodeType() == Node.ELEMENT_NODE) {
- Element element = (Element)sibling;
- if (element.getNodeName().equals(elemName) &&
- element.getAttribute(attrName).equals(attrValue)) {
- return element;
- }
- }
- sibling = sibling.getNextSibling();
- }
-
- // not found
- return null;
-
- } // getNextSiblingElement(Node,String,String,String):Element
-
- /**
- * Returns the concatenated child text of the specified node.
- * This method only looks at the immediate children of type
- * <code>Node.TEXT_NODE</code> or the children of any child
- * node that is of type <code>Node.CDATA_SECTION_NODE</code>
- * for the concatenation.
- *
- * @param node The node to look at.
- */
- public static String getChildText(Node node) {
-
- // is there anything to do?
- if (node == null) {
- return null;
- }
-
- // concatenate children text
- StringBuffer str = new StringBuffer();
- Node child = node.getFirstChild();
- while (child != null) {
- short type = child.getNodeType();
- if (type == Node.TEXT_NODE) {
- str.append(child.getNodeValue());
- }
- else if (type == Node.CDATA_SECTION_NODE) {
- str.append(getChildText(child));
- }
- child = child.getNextSibling();
- }
-
- // return text value
- return str.toString();
-
- } // getChildText(Node):String
-
- // return the name of this element
- public static String getName(Node node) {
- return node.getNodeName();
- } // getLocalName(Element): String
-
- /** returns local name of this element if not null, otherwise
- returns the name of the node
- */
- public static String getLocalName(Node node) {
- String name = node.getLocalName();
- return (name!=null)? name:node.getNodeName();
- } // getLocalName(Element): String
-
- public static Element getParent(Element elem) {
- Node parent = elem.getParentNode();
- if (parent instanceof Element)
- return (Element)parent;
- return null;
- } // getParent(Element):Element
-
- // get the Document of which this Node is a part
- public static Document getDocument(Node node) {
- return node.getOwnerDocument();
- } // getDocument(Node):Document
-
- // return this Document's root node
- public static Element getRoot(Document doc) {
- return doc.getDocumentElement();
- } // getRoot(Document(: Element
-
- // some methods for handling attributes:
-
- // return the right attribute node
- public static Attr getAttr(Element elem, String name) {
- return elem.getAttributeNode(name);
- } // getAttr(Element, String):Attr
-
- // return the right attribute node
- public static Attr getAttrNS(Element elem, String nsUri,
- String localName) {
- return elem.getAttributeNodeNS(nsUri, localName);
- } // getAttrNS(Element, String):Attr
-
- // get all the attributes for an Element
- public static Attr[] getAttrs(Element elem) {
- NamedNodeMap attrMap = elem.getAttributes();
- Attr [] attrArray = new Attr[attrMap.getLength()];
- for (int i=0; i<attrMap.getLength(); i++)
- attrArray[i] = (Attr)attrMap.item(i);
- return attrArray;
- } // getAttrs(Element): Attr[]
-
- // get attribute's value
- public static String getValue(Attr attribute) {
- return attribute.getValue();
- } // getValue(Attr):String
-
- // It is noteworthy that, because of the way the DOM specs
- // work, the next two methods return the empty string (not
- // null!) when the attribute with the specified name does not
- // exist on an element. Beware!
-
- // return the value of the attribute of the given element
- // with the given name
- public static String getAttrValue(Element elem, String name) {
- return elem.getAttribute(name);
- } // getAttr(Element, String):Attr
-
- // return the value of the attribute of the given element
- // with the given name
- public static String getAttrValueNS(Element elem, String nsUri,
- String localName) {
- return elem.getAttributeNS(nsUri, localName);
- } // getAttrValueNS(Element, String):Attr
-
- // return the prefix
- public static String getPrefix(Node node) {
- return node.getPrefix();
- }
-
- // return the namespace URI
- public static String getNamespaceURI(Node node) {
- return node.getNamespaceURI();
- }
-
- // return annotation
- public static String getAnnotation(Node node) {
- if (node instanceof ElementImpl) {
- return ((ElementImpl)node).getAnnotation();
- }
- return null;
- }
-
- // return synthetic annotation
- public static String getSyntheticAnnotation(Node node) {
- if (node instanceof ElementImpl) {
- return ((ElementImpl)node).getSyntheticAnnotation();
- }
- return null;
- }
-
- /**
- * Creates a DOMException. On J2SE 1.4 and above the cause for the exception will be set.
- */
- public static DOMException createDOMException(short code, Throwable cause) {
- DOMException de = new DOMException(code, cause != null ? cause.getMessage() : null);
- if (cause != null && ThrowableMethods.fgThrowableMethodsAvailable) {
- try {
- ThrowableMethods.fgThrowableInitCauseMethod.invoke(de, new Object [] {cause});
- }
- // Something went wrong. There's not much we can do about it.
- catch (Exception e) {}
- }
- return de;
- }
-
- /**
- * Creates an LSException. On J2SE 1.4 and above the cause for the exception will be set.
- */
- public static LSException createLSException(short code, Throwable cause) {
- LSException lse = new LSException(code, cause != null ? cause.getMessage() : null);
- if (cause != null && ThrowableMethods.fgThrowableMethodsAvailable) {
- try {
- ThrowableMethods.fgThrowableInitCauseMethod.invoke(lse, new Object [] {cause});
- }
- // Something went wrong. There's not much we can do about it.
- catch (Exception e) {}
- }
- return lse;
- }
-
- /**
- * Holder of methods from java.lang.Throwable.
- */
- static class ThrowableMethods {
-
- // Method: java.lang.Throwable.initCause(java.lang.Throwable)
- private static java.lang.reflect.Method fgThrowableInitCauseMethod = null;
-
- // Flag indicating whether or not Throwable methods available.
- private static boolean fgThrowableMethodsAvailable = false;
-
- private ThrowableMethods() {}
-
- // Attempt to get methods for java.lang.Throwable on class initialization.
- static {
- try {
- fgThrowableInitCauseMethod = Throwable.class.getMethod("initCause", new Class [] {Throwable.class});
- fgThrowableMethodsAvailable = true;
- }
- // ClassNotFoundException, NoSuchMethodException or SecurityException
- // Whatever the case, we cannot use java.lang.Throwable.initCause(java.lang.Throwable).
- catch (Exception exc) {
- fgThrowableInitCauseMethod = null;
- fgThrowableMethodsAvailable = false;
- }
- }
- }
-
-} // class DOMUtil
diff --git a/src/com/sun/org/apache/xerces/internal/util/DatatypeMessageFormatter.java b/src/com/sun/org/apache/xerces/internal/util/DatatypeMessageFormatter.java
deleted file mode 100644
index b964a8f..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/DatatypeMessageFormatter.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.util;
-
-import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * <p>Used to format JAXP 1.3 Datatype API error messages using a specified locale.</p>
- *
- * @author Neeraj Bajaj, Sun Microsystems
- * @version $Id: DatatypeMessageFormatter.java,v 1.6 2010-11-01 04:40:14 joehw Exp $
- */
-public class DatatypeMessageFormatter {
-
- private static final String BASE_NAME = "com.sun.org.apache.xerces.internal.impl.msg.DatatypeMessages";
-
- /**
- * Formats a message with the specified arguments using the given
- * locale information.
- *
- * @param locale The locale of the message.
- * @param key The message key.
- * @param arguments The message replacement text arguments. The order
- * of the arguments must match that of the placeholders
- * in the actual message.
- *
- * @return the formatted message.
- *
- * @throws MissingResourceException Thrown if the message with the
- * specified key cannot be found.
- */
- public static String formatMessage(Locale locale,
- String key, Object[] arguments)
- throws MissingResourceException {
-
- ResourceBundle resourceBundle = null;
- if (locale != null) {
- resourceBundle =
- SecuritySupport.getResourceBundle(BASE_NAME, locale);
- }
- else {
- resourceBundle =
- SecuritySupport.getResourceBundle(BASE_NAME);
- }
-
- // format message
- String msg;
- try {
- msg = resourceBundle.getString(key);
- if (arguments != null) {
- try {
- msg = java.text.MessageFormat.format(msg, arguments);
- }
- catch (Exception e) {
- msg = resourceBundle.getString("FormatFailed");
- msg += " " + resourceBundle.getString(key);
- }
- }
- }
-
- // error
- catch (MissingResourceException e) {
- msg = resourceBundle.getString("BadMessageKey");
- throw new MissingResourceException(key, msg, key);
- }
-
- // no message
- if (msg == null) {
- msg = key;
- if (arguments.length > 0) {
- StringBuffer str = new StringBuffer(msg);
- str.append('?');
- for (int i = 0; i < arguments.length; i++) {
- if (i > 0) {
- str.append('&');
- }
- str.append(String.valueOf(arguments[i]));
- }
- }
- }
- return msg;
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/util/DefaultErrorHandler.java b/src/com/sun/org/apache/xerces/internal/util/DefaultErrorHandler.java
deleted file mode 100644
index ca5e039..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/DefaultErrorHandler.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2000-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.util;
-
-import java.io.PrintWriter;
-
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLParseException;
-
-/**
- * Default error handler.
- *
- * @author Andy Clark, IBM
- *
- */
-public class DefaultErrorHandler
- implements XMLErrorHandler {
-
- //
- // Data
- //
-
- /** Print writer. */
- protected PrintWriter fOut;
-
- //
- // Constructors
- //
-
- /**
- * Constructs an error handler that prints error messages to
- * <code>System.err</code>.
- */
- public DefaultErrorHandler() {
- this(new PrintWriter(System.err));
- } // <init>()
-
- /**
- * Constructs an error handler that prints error messages to the
- * specified <code>PrintWriter</code.
- */
- public DefaultErrorHandler(PrintWriter out) {
- fOut = out;
- } // <init>(PrintWriter)
-
- //
- // ErrorHandler methods
- //
-
- /** Warning. */
- public void warning(String domain, String key, XMLParseException ex)
- throws XNIException {
- printError("Warning", ex);
- } // warning(XMLParseException)
-
- /** Error. */
- public void error(String domain, String key, XMLParseException ex)
- throws XNIException {
- printError("Error", ex);
- } // error(XMLParseException)
-
- /** Fatal error. */
- public void fatalError(String domain, String key, XMLParseException ex)
- throws XNIException {
- printError("Fatal Error", ex);
- throw ex;
- } // fatalError(XMLParseException)
-
- //
- // Private methods
- //
-
- /** Prints the error message. */
- private void printError(String type, XMLParseException ex) {
-
- fOut.print("[");
- fOut.print(type);
- fOut.print("] ");
- String systemId = ex.getExpandedSystemId();
- if (systemId != null) {
- int index = systemId.lastIndexOf('/');
- if (index != -1)
- systemId = systemId.substring(index + 1);
- fOut.print(systemId);
- }
- fOut.print(':');
- fOut.print(ex.getLineNumber());
- fOut.print(':');
- fOut.print(ex.getColumnNumber());
- fOut.print(": ");
- fOut.print(ex.getMessage());
- fOut.println();
- fOut.flush();
-
- } // printError(String,SAXParseException)
-
-} // class DefaultErrorHandler
diff --git a/src/com/sun/org/apache/xerces/internal/util/DraconianErrorHandler.java b/src/com/sun/org/apache/xerces/internal/util/DraconianErrorHandler.java
deleted file mode 100644
index 89b38a5..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/DraconianErrorHandler.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2000-2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package com.sun.org.apache.xerces.internal.util;
-
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-/**
- * {@link ErrorHandler} that throws all errors and fatal errors.
- *
- * @author
- * Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
- */
-public class DraconianErrorHandler implements ErrorHandler {
- /**
- * Use this singleton instance.
- */
- public static final ErrorHandler theInstance = new DraconianErrorHandler();
-
- private DraconianErrorHandler() {}
-
- public void error(SAXParseException e) throws SAXException {
- throw e;
- }
- public void fatalError(SAXParseException e) throws SAXException {
- throw e;
- }
- public void warning(SAXParseException e) throws SAXException {
- ; // noop
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/util/EncodingMap.java b/src/com/sun/org/apache/xerces/internal/util/EncodingMap.java
deleted file mode 100644
index ef34410..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/EncodingMap.java
+++ /dev/null
@@ -1,981 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.util;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * EncodingMap is a convenience class which handles conversions between
- * IANA encoding names and Java encoding names, and vice versa. The
- * encoding names used in XML instance documents <strong>must</strong>
- * be the IANA encoding names specified or one of the aliases for those names
- * which IANA defines.
- * <p>
- * <TABLE BORDER="0" WIDTH="100%">
- * <TR>
- * <TD WIDTH="33%">
- * <P ALIGN="CENTER"><B>Common Name</B>
- * </TD>
- * <TD WIDTH="15%">
- * <P ALIGN="CENTER"><B>Use this name in XML files</B>
- * </TD>
- * <TD WIDTH="12%">
- * <P ALIGN="CENTER"><B>Name Type</B>
- * </TD>
- * <TD WIDTH="31%">
- * <P ALIGN="CENTER"><B>Xerces converts to this Java Encoder Name</B>
- * </TD>
- * </TR>
- * <TR>
- * <TD WIDTH="33%">8 bit Unicode</TD>
- * <TD WIDTH="15%">
- * <P ALIGN="CENTER">UTF-8
- * </TD>
- * <TD WIDTH="12%">
- * <P ALIGN="CENTER">IANA
- * </TD>
- * <TD WIDTH="31%">
- * <P ALIGN="CENTER">UTF8
- * </TD>
- * </TR>
- * <TR>
- * <TD WIDTH="33%">ISO Latin 1</TD>
- * <TD WIDTH="15%">
- * <P ALIGN="CENTER">ISO-8859-1
- * </TD>
- * <TD WIDTH="12%">
- * <P ALIGN="CENTER">MIME
- * </TD>
- * <TD WIDTH="31%">
- * <P ALIGN="CENTER">ISO-8859-1
- * </TD>
- * </TR>
- * <TR>
- * <TD WIDTH="33%">ISO Latin 2</TD>
- * <TD WIDTH="15%">
- * <P ALIGN="CENTER">ISO-8859-2
- * </TD>
- * <TD WIDTH="12%">
- * <P ALIGN="CENTER">MIME
- * </TD>
- * <TD WIDTH="31%">
- * <P ALIGN="CENTER">ISO-8859-2
- * </TD>
- * </TR>
- * <TR>
- * <TD WIDTH="33%">ISO Latin 3</TD>
- * <TD WIDTH="15%">
- * <P ALIGN="CENTER">ISO-8859-3
- * </TD>
- * <TD WIDTH="12%">
- * <P ALIGN="CENTER">MIME
- * </TD>
- * <TD WIDTH="31%">
- * <P ALIGN="CENTER">ISO-8859-3
- * </TD>
- * </TR>
- * <TR>
- * <TD WIDTH="33%">ISO Latin 4</TD>
- * <TD WIDTH="15%">
- * <P ALIGN="CENTER">ISO-8859-4
- * </TD>
- * <TD WIDTH="12%">
- * <P ALIGN="CENTER">MIME
- * </TD>
- * <TD WIDTH="31%">
- * <P ALIGN="CENTER">ISO-8859-4
- * </TD>
- * </TR>
- * <TR>
- * <TD WIDTH="33%">ISO Latin Cyrillic</TD>
- * <TD WIDTH="15%">
- * <P ALIGN="CENTER">ISO-8859-5
- * </TD>
- * <TD WIDTH="12%">
- * <P ALIGN="CENTER">MIME
- * </TD>
- * <TD WIDTH="31%">
- * <P ALIGN="CENTER">ISO-8859-5
- * </TD>
- * </TR>
- * <TR>
- * <TD WIDTH="33%">ISO Latin Arabic</TD>
- * <TD WIDTH="15%">
- * <P ALIGN="CENTER">ISO-8859-6
- * </TD>
- * <TD WIDTH="12%">
- * <P ALIGN="CENTER">MIME
- * </TD>
- * <TD WIDTH="31%">
- * <P ALIGN="CENTER">ISO-8859-6
- * </TD>
- * </TR>
- * <TR>
- * <TD WIDTH="33%">ISO Latin Greek</TD>
- * <TD WIDTH="15%">
- * <P ALIGN="CENTER">ISO-8859-7
- * </TD>
- * <TD WIDTH="12%">
- * <P ALIGN="CENTER">MIME
- * </TD>
- * <TD WIDTH="31%">
- * <P ALIGN="CENTER">ISO-8859-7
- * </TD>
- * </TR>
- * <TR>
- * <TD WIDTH="33%">ISO Latin Hebrew</TD>
- * <TD WIDTH="15%">
- * <P ALIGN="CENTER">ISO-8859-8
- * </TD>
- * <TD WIDTH="12%">
- * <P ALIGN="CENTER">MIME
- * </TD>
- * <TD WIDTH="31%">
- * <P ALIGN="CENTER">ISO-8859-8
- * </TD>
- * </TR>
- * <TR>
- * <TD WIDTH="33%">ISO Latin 5</TD>
- * <TD WIDTH="15%">
- * <P ALIGN="CENTER">ISO-8859-9
- * </TD>
- * <TD WIDTH="12%">
- * <P ALIGN="CENTER">MIME
- * </TD>
- * <TD WIDTH="31%">
- * <P ALIGN="CENTER">ISO-8859-9
- * </TD>
- * </TR>
- * <TR>
- * <TD WIDTH="33%">EBCDIC: US</TD>
- * <TD WIDTH="15%">
- * <P ALIGN="CENTER">ebcdic-cp-us
- * </TD>
- * <TD WIDTH="12%">
- * <P ALIGN="CENTER">IANA
- * </TD>
- * <TD WIDTH="31%">
- * <P ALIGN="CENTER">cp037
- * </TD>
- * </TR>
- * <TR>
- * <TD WIDTH="33%">EBCDIC: Canada</TD>
- * <TD WIDTH="15%">
- * <P ALIGN="CENTER">ebcdic-cp-ca
- * </TD>
- * <TD WIDTH="12%">
- * <P ALIGN="CENTER">IANA
- * </TD>
- * <TD WIDTH="31%">
- * <P ALIGN="CENTER">cp037
- * </TD>
- * </TR>
- * <TR>
- * <TD WIDTH="33%">EBCDIC: Netherlands</TD>
- * <TD WIDTH="15%">
- * <P ALIGN="CENTER">ebcdic-cp-nl
- * </TD>
- * <TD WIDTH="12%">
- * <P ALIGN="CENTER">IANA
- * </TD>
- * <TD WIDTH="31%">
- * <P ALIGN="CENTER">cp037
- * </TD>
- * </TR>
- * <TR>
- * <TD WIDTH="33%">EBCDIC: Denmark</TD>
- * <TD WIDTH="15%">
- * <P ALIGN="CENTER">ebcdic-cp-dk
- * </TD>
- * <TD WIDTH="12%">
- * <P ALIGN="CENTER">IANA
- * </TD>
- * <TD WIDTH="31%">
- * <P ALIGN="CENTER">cp277
- * </TD>
- * </TR>
- * <TR>
- * <TD WIDTH="33%">EBCDIC: Norway</TD>
- * <TD WIDTH="15%">
- * <P ALIGN="CENTER">ebcdic-cp-no
- * </TD>
- * <TD WIDTH="12%">
- * <P ALIGN="CENTER">IANA
- * </TD>
- * <TD WIDTH="31%">
- * <P ALIGN="CENTER">cp277
- * </TD>
- * </TR>
- * <TR>
- * <TD WIDTH="33%">EBCDIC: Finland</TD>
- * <TD WIDTH="15%">
- * <P ALIGN="CENTER">ebcdic-cp-fi
- * </TD>
- * <TD WIDTH="12%">
- * <P ALIGN="CENTER">IANA
- * </TD>
- * <TD WIDTH="31%">
- * <P ALIGN="CENTER">cp278
- * </TD>
- * </TR>
- * <TR>
- * <TD WIDTH="33%">EBCDIC: Sweden</TD>
- * <TD WIDTH="15%">
- * <P ALIGN="CENTER">ebcdic-cp-se
- * </TD>
- * <TD WIDTH="12%">
- * <P ALIGN="CENTER">IANA
- * </TD>
- * <TD WIDTH="31%">
- * <P ALIGN="CENTER">cp278
- * </TD>
- * </TR>
- * <TR>
- * <TD WIDTH="33%">EBCDIC: Italy</TD>
- * <TD WIDTH="15%">
- * <P ALIGN="CENTER">ebcdic-cp-it
- * </TD>
- * <TD WIDTH="12%">
- * <P ALIGN="CENTER">IANA
- * </TD>
- * <TD WIDTH="31%">
- * <P ALIGN="CENTER">cp280
- * </TD>
- * </TR>
- * <TR>
- * <TD WIDTH="33%">EBCDIC: Spain, Latin America</TD>
- * <TD WIDTH="15%">
- * <P ALIGN="CENTER">ebcdic-cp-es
- * </TD>
- * <TD WIDTH="12%">
- * <P ALIGN="CENTER">IANA
- * </TD>
- * <TD WIDTH="31%">
- * <P ALIGN="CENTER">cp284
- * </TD>
- * </TR>
- * <TR>
- * <TD WIDTH="33%">EBCDIC: Great Britain</TD>
- * <TD WIDTH="15%">
- * <P ALIGN="CENTER">ebcdic-cp-gb
- * </TD>
- * <TD WIDTH="12%">
- * <P ALIGN="CENTER">IANA
- * </TD>
- * <TD WIDTH="31%">
- * <P ALIGN="CENTER">cp285
- * </TD>
- * </TR>
- * <TR>
- * <TD WIDTH="33%">EBCDIC: France</TD>
- * <TD WIDTH="15%">
- * <P ALIGN="CENTER">ebcdic-cp-fr
- * </TD>
- * <TD WIDTH="12%">
- * <P ALIGN="CENTER">IANA
- * </TD>
- * <TD WIDTH="31%">
- * <P ALIGN="CENTER">cp297
- * </TD>
- * </TR>
- * <TR>
- * <TD WIDTH="33%">EBCDIC: Arabic</TD>
- * <TD WIDTH="15%">
- * <P ALIGN="CENTER">ebcdic-cp-ar1
- * </TD>
- * <TD WIDTH="12%">
- * <P ALIGN="CENTER">IANA
- * </TD>
- * <TD WIDTH="31%">
- * <P ALIGN="CENTER">cp420
- * </TD>
- * </TR>
- * <TR>
- * <TD WIDTH="33%">EBCDIC: Hebrew</TD>
- * <TD WIDTH="15%">
- * <P ALIGN="CENTER">ebcdic-cp-he
- * </TD>
- * <TD WIDTH="12%">
- * <P ALIGN="CENTER">IANA
- * </TD>
- * <TD WIDTH="31%">
- * <P ALIGN="CENTER">cp424
- * </TD>
- * </TR>
- * <TR>
- * <TD WIDTH="33%">EBCDIC: Switzerland</TD>
- * <TD WIDTH="15%">
- * <P ALIGN="CENTER">ebcdic-cp-ch
- * </TD>
- * <TD WIDTH="12%">
- * <P ALIGN="CENTER">IANA
- * </TD>
- * <TD WIDTH="31%">
- * <P ALIGN="CENTER">cp500
- * </TD>
- * </TR>
- * <TR>
- * <TD WIDTH="33%">EBCDIC: Roece</TD>
- * <TD WIDTH="15%">
- * <P ALIGN="CENTER">ebcdic-cp-roece
- * </TD>
- * <TD WIDTH="12%">
- * <P ALIGN="CENTER">IANA
- * </TD>
- * <TD WIDTH="31%">
- * <P ALIGN="CENTER">cp870
- * </TD>
- * </TR>
- * <TR>
- * <TD WIDTH="33%">EBCDIC: Yugoslavia</TD>
- * <TD WIDTH="15%">
- * <P ALIGN="CENTER">ebcdic-cp-yu
- * </TD>
- * <TD WIDTH="12%">
- * <P ALIGN="CENTER">IANA
- * </TD>
- * <TD WIDTH="31%">
- * <P ALIGN="CENTER">cp870
- * </TD>
- * </TR>
- * <TR>
- * <TD WIDTH="33%">EBCDIC: Iceland</TD>
- * <TD WIDTH="15%">
- * <P ALIGN="CENTER">ebcdic-cp-is
- * </TD>
- * <TD WIDTH="12%">
- * <P ALIGN="CENTER">IANA
- * </TD>
- * <TD WIDTH="31%">
- * <P ALIGN="CENTER">cp871
- * </TD>
- * </TR>
- * <TR>
- * <TD WIDTH="33%">EBCDIC: Urdu</TD>
- * <TD WIDTH="15%">
- * <P ALIGN="CENTER">ebcdic-cp-ar2
- * </TD>
- * <TD WIDTH="12%">
- * <P ALIGN="CENTER">IANA
- * </TD>
- * <TD WIDTH="31%">
- * <P ALIGN="CENTER">cp918
- * </TD>
- * </TR>
- * <TR>
- * <TD WIDTH="33%">Chinese for PRC, mixed 1/2 byte</TD>
- * <TD WIDTH="15%">
- * <P ALIGN="CENTER">gb2312
- * </TD>
- * <TD WIDTH="12%">
- * <P ALIGN="CENTER">MIME
- * </TD>
- * <TD WIDTH="31%">
- * <P ALIGN="CENTER">GB2312
- * </TD>
- * </TR>
- * <TR>
- * <TD WIDTH="33%">Extended Unix Code, packed for Japanese</TD>
- * <TD WIDTH="15%">
- * <P ALIGN="CENTER">euc-jp
- * </TD>
- * <TD WIDTH="12%">
- * <P ALIGN="CENTER">MIME
- * </TD>
- * <TD WIDTH="31%">
- * <P ALIGN="CENTER">eucjis
- * </TD>
- * </TR>
- * <TR>
- * <TD WIDTH="33%">Japanese: iso-2022-jp</TD>
- * <TD WIDTH="15%">
- * <P ALIGN="CENTER">iso-2020-jp
- * </TD>
- * <TD WIDTH="12%">
- * <P ALIGN="CENTER">MIME
- * </TD>
- * <TD WIDTH="31%">
- * <P ALIGN="CENTER">JIS
- * </TD>
- * </TR>
- * <TR>
- * <TD WIDTH="33%">Japanese: Shift JIS</TD>
- * <TD WIDTH="15%">
- * <P ALIGN="CENTER">Shift_JIS
- * </TD>
- * <TD WIDTH="12%">
- * <P ALIGN="CENTER">MIME
- * </TD>
- * <TD WIDTH="31%">
- * <P ALIGN="CENTER">SJIS
- * </TD>
- * </TR>
- * <TR>
- * <TD WIDTH="33%">Chinese: Big5</TD>
- * <TD WIDTH="15%">
- * <P ALIGN="CENTER">Big5
- * </TD>
- * <TD WIDTH="12%">
- * <P ALIGN="CENTER">MIME
- * </TD>
- * <TD WIDTH="31%">
- * <P ALIGN="CENTER">Big5
- * </TD>
- * </TR>
- * <TR>
- * <TD WIDTH="33%">Extended Unix Code, packed for Korean</TD>
- * <TD WIDTH="15%">
- * <P ALIGN="CENTER">euc-kr
- * </TD>
- * <TD WIDTH="12%">
- * <P ALIGN="CENTER">MIME
- * </TD>
- * <TD WIDTH="31%">
- * <P ALIGN="CENTER">iso2022kr
- * </TD>
- * </TR>
- * <TR>
- * <TD WIDTH="33%">Cyrillic</TD>
- * <TD WIDTH="15%">
- * <P ALIGN="CENTER">koi8-r
- * </TD>
- * <TD WIDTH="12%">
- * <P ALIGN="CENTER">MIME
- * </TD>
- * <TD WIDTH="31%">
- * <P ALIGN="CENTER">koi8-r
- * </TD>
- * </TR>
- * </TABLE>
- *
- * @author TAMURA Kent, IBM
- * @author Andy Clark, IBM
- *
- */
-public class EncodingMap {
-
- //
- // Data
- //
-
- /** fIANA2JavaMap */
- protected final static Map<String, String> fIANA2JavaMap;
-
- /** fJava2IANAMap */
- protected final static Map<String, String> fJava2IANAMap;
-
- //
- // Static initialization
- //
-
- static {
- Map<String, String> aIANA2JavaMap = new HashMap<>();
- Map<String, String> aJava2IANAMap = new HashMap<>();
-
- // add IANA to Java encoding mappings.
- aIANA2JavaMap.put("BIG5", "Big5");
- aIANA2JavaMap.put("CSBIG5", "Big5");
- aIANA2JavaMap.put("CP037", "CP037");
- aIANA2JavaMap.put("IBM037", "CP037");
- aIANA2JavaMap.put("CSIBM037", "CP037");
- aIANA2JavaMap.put("EBCDIC-CP-US", "CP037");
- aIANA2JavaMap.put("EBCDIC-CP-CA", "CP037");
- aIANA2JavaMap.put("EBCDIC-CP-NL", "CP037");
- aIANA2JavaMap.put("EBCDIC-CP-WT", "CP037");
- aIANA2JavaMap.put("IBM273", "CP273");
- aIANA2JavaMap.put("CP273", "CP273");
- aIANA2JavaMap.put("CSIBM273", "CP273");
- aIANA2JavaMap.put("IBM277", "CP277");
- aIANA2JavaMap.put("CP277", "CP277");
- aIANA2JavaMap.put("CSIBM277", "CP277");
- aIANA2JavaMap.put("EBCDIC-CP-DK", "CP277");
- aIANA2JavaMap.put("EBCDIC-CP-NO", "CP277");
- aIANA2JavaMap.put("IBM278", "CP278");
- aIANA2JavaMap.put("CP278", "CP278");
- aIANA2JavaMap.put("CSIBM278", "CP278");
- aIANA2JavaMap.put("EBCDIC-CP-FI", "CP278");
- aIANA2JavaMap.put("EBCDIC-CP-SE", "CP278");
- aIANA2JavaMap.put("IBM280", "CP280");
- aIANA2JavaMap.put("CP280", "CP280");
- aIANA2JavaMap.put("CSIBM280", "CP280");
- aIANA2JavaMap.put("EBCDIC-CP-IT", "CP280");
- aIANA2JavaMap.put("IBM284", "CP284");
- aIANA2JavaMap.put("CP284", "CP284");
- aIANA2JavaMap.put("CSIBM284", "CP284");
- aIANA2JavaMap.put("EBCDIC-CP-ES", "CP284");
- aIANA2JavaMap.put("EBCDIC-CP-GB", "CP285");
- aIANA2JavaMap.put("IBM285", "CP285");
- aIANA2JavaMap.put("CP285", "CP285");
- aIANA2JavaMap.put("CSIBM285", "CP285");
- aIANA2JavaMap.put("EBCDIC-JP-KANA", "CP290");
- aIANA2JavaMap.put("IBM290", "CP290");
- aIANA2JavaMap.put("CP290", "CP290");
- aIANA2JavaMap.put("CSIBM290", "CP290");
- aIANA2JavaMap.put("EBCDIC-CP-FR", "CP297");
- aIANA2JavaMap.put("IBM297", "CP297");
- aIANA2JavaMap.put("CP297", "CP297");
- aIANA2JavaMap.put("CSIBM297", "CP297");
- aIANA2JavaMap.put("EBCDIC-CP-AR1", "CP420");
- aIANA2JavaMap.put("IBM420", "CP420");
- aIANA2JavaMap.put("CP420", "CP420");
- aIANA2JavaMap.put("CSIBM420", "CP420");
- aIANA2JavaMap.put("EBCDIC-CP-HE", "CP424");
- aIANA2JavaMap.put("IBM424", "CP424");
- aIANA2JavaMap.put("CP424", "CP424");
- aIANA2JavaMap.put("CSIBM424", "CP424");
- aIANA2JavaMap.put("IBM437", "CP437");
- aIANA2JavaMap.put("437", "CP437");
- aIANA2JavaMap.put("CP437", "CP437");
- aIANA2JavaMap.put("CSPC8CODEPAGE437", "CP437");
- aIANA2JavaMap.put("EBCDIC-CP-CH", "CP500");
- aIANA2JavaMap.put("IBM500", "CP500");
- aIANA2JavaMap.put("CP500", "CP500");
- aIANA2JavaMap.put("CSIBM500", "CP500");
- aIANA2JavaMap.put("EBCDIC-CP-CH", "CP500");
- aIANA2JavaMap.put("EBCDIC-CP-BE", "CP500");
- aIANA2JavaMap.put("IBM775", "CP775");
- aIANA2JavaMap.put("CP775", "CP775");
- aIANA2JavaMap.put("CSPC775BALTIC", "CP775");
- aIANA2JavaMap.put("IBM850", "CP850");
- aIANA2JavaMap.put("850", "CP850");
- aIANA2JavaMap.put("CP850", "CP850");
- aIANA2JavaMap.put("CSPC850MULTILINGUAL", "CP850");
- aIANA2JavaMap.put("IBM852", "CP852");
- aIANA2JavaMap.put("852", "CP852");
- aIANA2JavaMap.put("CP852", "CP852");
- aIANA2JavaMap.put("CSPCP852", "CP852");
- aIANA2JavaMap.put("IBM855", "CP855");
- aIANA2JavaMap.put("855", "CP855");
- aIANA2JavaMap.put("CP855", "CP855");
- aIANA2JavaMap.put("CSIBM855", "CP855");
- aIANA2JavaMap.put("IBM857", "CP857");
- aIANA2JavaMap.put("857", "CP857");
- aIANA2JavaMap.put("CP857", "CP857");
- aIANA2JavaMap.put("CSIBM857", "CP857");
- aIANA2JavaMap.put("IBM00858", "CP858");
- aIANA2JavaMap.put("CP00858", "CP858");
- aIANA2JavaMap.put("CCSID00858", "CP858");
- aIANA2JavaMap.put("IBM860", "CP860");
- aIANA2JavaMap.put("860", "CP860");
- aIANA2JavaMap.put("CP860", "CP860");
- aIANA2JavaMap.put("CSIBM860", "CP860");
- aIANA2JavaMap.put("IBM861", "CP861");
- aIANA2JavaMap.put("861", "CP861");
- aIANA2JavaMap.put("CP861", "CP861");
- aIANA2JavaMap.put("CP-IS", "CP861");
- aIANA2JavaMap.put("CSIBM861", "CP861");
- aIANA2JavaMap.put("IBM862", "CP862");
- aIANA2JavaMap.put("862", "CP862");
- aIANA2JavaMap.put("CP862", "CP862");
- aIANA2JavaMap.put("CSPC862LATINHEBREW", "CP862");
- aIANA2JavaMap.put("IBM863", "CP863");
- aIANA2JavaMap.put("863", "CP863");
- aIANA2JavaMap.put("CP863", "CP863");
- aIANA2JavaMap.put("CSIBM863", "CP863");
- aIANA2JavaMap.put("IBM864", "CP864");
- aIANA2JavaMap.put("CP864", "CP864");
- aIANA2JavaMap.put("CSIBM864", "CP864");
- aIANA2JavaMap.put("IBM865", "CP865");
- aIANA2JavaMap.put("865", "CP865");
- aIANA2JavaMap.put("CP865", "CP865");
- aIANA2JavaMap.put("CSIBM865", "CP865");
- aIANA2JavaMap.put("IBM866", "CP866");
- aIANA2JavaMap.put("866", "CP866");
- aIANA2JavaMap.put("CP866", "CP866");
- aIANA2JavaMap.put("CSIBM866", "CP866");
- aIANA2JavaMap.put("IBM868", "CP868");
- aIANA2JavaMap.put("CP868", "CP868");
- aIANA2JavaMap.put("CSIBM868", "CP868");
- aIANA2JavaMap.put("CP-AR", "CP868");
- aIANA2JavaMap.put("IBM869", "CP869");
- aIANA2JavaMap.put("CP869", "CP869");
- aIANA2JavaMap.put("CSIBM869", "CP869");
- aIANA2JavaMap.put("CP-GR", "CP869");
- aIANA2JavaMap.put("IBM870", "CP870");
- aIANA2JavaMap.put("CP870", "CP870");
- aIANA2JavaMap.put("CSIBM870", "CP870");
- aIANA2JavaMap.put("EBCDIC-CP-ROECE", "CP870");
- aIANA2JavaMap.put("EBCDIC-CP-YU", "CP870");
- aIANA2JavaMap.put("IBM871", "CP871");
- aIANA2JavaMap.put("CP871", "CP871");
- aIANA2JavaMap.put("CSIBM871", "CP871");
- aIANA2JavaMap.put("EBCDIC-CP-IS", "CP871");
- aIANA2JavaMap.put("IBM918", "CP918");
- aIANA2JavaMap.put("CP918", "CP918");
- aIANA2JavaMap.put("CSIBM918", "CP918");
- aIANA2JavaMap.put("EBCDIC-CP-AR2", "CP918");
- aIANA2JavaMap.put("IBM00924", "CP924");
- aIANA2JavaMap.put("CP00924", "CP924");
- aIANA2JavaMap.put("CCSID00924", "CP924");
- // is this an error???
- aIANA2JavaMap.put("EBCDIC-LATIN9--EURO", "CP924");
- aIANA2JavaMap.put("IBM1026", "CP1026");
- aIANA2JavaMap.put("CP1026", "CP1026");
- aIANA2JavaMap.put("CSIBM1026", "CP1026");
- aIANA2JavaMap.put("IBM01140", "Cp1140");
- aIANA2JavaMap.put("CP01140", "Cp1140");
- aIANA2JavaMap.put("CCSID01140", "Cp1140");
- aIANA2JavaMap.put("IBM01141", "Cp1141");
- aIANA2JavaMap.put("CP01141", "Cp1141");
- aIANA2JavaMap.put("CCSID01141", "Cp1141");
- aIANA2JavaMap.put("IBM01142", "Cp1142");
- aIANA2JavaMap.put("CP01142", "Cp1142");
- aIANA2JavaMap.put("CCSID01142", "Cp1142");
- aIANA2JavaMap.put("IBM01143", "Cp1143");
- aIANA2JavaMap.put("CP01143", "Cp1143");
- aIANA2JavaMap.put("CCSID01143", "Cp1143");
- aIANA2JavaMap.put("IBM01144", "Cp1144");
- aIANA2JavaMap.put("CP01144", "Cp1144");
- aIANA2JavaMap.put("CCSID01144", "Cp1144");
- aIANA2JavaMap.put("IBM01145", "Cp1145");
- aIANA2JavaMap.put("CP01145", "Cp1145");
- aIANA2JavaMap.put("CCSID01145", "Cp1145");
- aIANA2JavaMap.put("IBM01146", "Cp1146");
- aIANA2JavaMap.put("CP01146", "Cp1146");
- aIANA2JavaMap.put("CCSID01146", "Cp1146");
- aIANA2JavaMap.put("IBM01147", "Cp1147");
- aIANA2JavaMap.put("CP01147", "Cp1147");
- aIANA2JavaMap.put("CCSID01147", "Cp1147");
- aIANA2JavaMap.put("IBM01148", "Cp1148");
- aIANA2JavaMap.put("CP01148", "Cp1148");
- aIANA2JavaMap.put("CCSID01148", "Cp1148");
- aIANA2JavaMap.put("IBM01149", "Cp1149");
- aIANA2JavaMap.put("CP01149", "Cp1149");
- aIANA2JavaMap.put("CCSID01149", "Cp1149");
- aIANA2JavaMap.put("EUC-JP", "EUCJIS");
- aIANA2JavaMap.put("CSEUCPKDFMTJAPANESE", "EUCJIS");
- aIANA2JavaMap.put("EXTENDED_UNIX_CODE_PACKED_FORMAT_FOR_JAPANESE", "EUCJIS");
- aIANA2JavaMap.put("EUC-KR", "KSC5601");
- aIANA2JavaMap.put("CSEUCKR", "KSC5601");
- aIANA2JavaMap.put("KS_C_5601-1987", "KS_C_5601-1987");
- aIANA2JavaMap.put("ISO-IR-149", "KS_C_5601-1987");
- aIANA2JavaMap.put("KS_C_5601-1989", "KS_C_5601-1987");
- aIANA2JavaMap.put("KSC_5601", "KS_C_5601-1987");
- aIANA2JavaMap.put("KOREAN", "KS_C_5601-1987");
- aIANA2JavaMap.put("CSKSC56011987", "KS_C_5601-1987");
- aIANA2JavaMap.put("GB2312", "GB2312");
- aIANA2JavaMap.put("CSGB2312", "GB2312");
- aIANA2JavaMap.put("ISO-2022-JP", "JIS");
- aIANA2JavaMap.put("CSISO2022JP", "JIS");
- aIANA2JavaMap.put("ISO-2022-KR", "ISO2022KR");
- aIANA2JavaMap.put("CSISO2022KR", "ISO2022KR");
- aIANA2JavaMap.put("ISO-2022-CN", "ISO2022CN");
-
- aIANA2JavaMap.put("X0201", "JIS0201");
- aIANA2JavaMap.put("CSISO13JISC6220JP", "JIS0201");
- aIANA2JavaMap.put("X0208", "JIS0208");
- aIANA2JavaMap.put("ISO-IR-87", "JIS0208");
- aIANA2JavaMap.put("X0208dbiJIS_X0208-1983", "JIS0208");
- aIANA2JavaMap.put("CSISO87JISX0208", "JIS0208");
- aIANA2JavaMap.put("X0212", "JIS0212");
- aIANA2JavaMap.put("ISO-IR-159", "JIS0212");
- aIANA2JavaMap.put("CSISO159JISX02121990", "JIS0212");
- aIANA2JavaMap.put("GB18030", "GB18030");
- aIANA2JavaMap.put("GBK", "GBK");
- aIANA2JavaMap.put("CP936", "GBK");
- aIANA2JavaMap.put("MS936", "GBK");
- aIANA2JavaMap.put("WINDOWS-936", "GBK");
- aIANA2JavaMap.put("SHIFT_JIS", "SJIS");
- aIANA2JavaMap.put("CSSHIFTJIS", "SJIS");
- aIANA2JavaMap.put("MS_KANJI", "SJIS");
- aIANA2JavaMap.put("WINDOWS-31J", "MS932");
- aIANA2JavaMap.put("CSWINDOWS31J", "MS932");
-
- // Add support for Cp1252 and its friends
- aIANA2JavaMap.put("WINDOWS-1250", "Cp1250");
- aIANA2JavaMap.put("WINDOWS-1251", "Cp1251");
- aIANA2JavaMap.put("WINDOWS-1252", "Cp1252");
- aIANA2JavaMap.put("WINDOWS-1253", "Cp1253");
- aIANA2JavaMap.put("WINDOWS-1254", "Cp1254");
- aIANA2JavaMap.put("WINDOWS-1255", "Cp1255");
- aIANA2JavaMap.put("WINDOWS-1256", "Cp1256");
- aIANA2JavaMap.put("WINDOWS-1257", "Cp1257");
- aIANA2JavaMap.put("WINDOWS-1258", "Cp1258");
- aIANA2JavaMap.put("TIS-620", "TIS620");
-
- aIANA2JavaMap.put("ISO-8859-1", "ISO8859_1");
- aIANA2JavaMap.put("ISO-IR-100", "ISO8859_1");
- aIANA2JavaMap.put("ISO_8859-1", "ISO8859_1");
- aIANA2JavaMap.put("LATIN1", "ISO8859_1");
- aIANA2JavaMap.put("CSISOLATIN1", "ISO8859_1");
- aIANA2JavaMap.put("L1", "ISO8859_1");
- aIANA2JavaMap.put("IBM819", "ISO8859_1");
- aIANA2JavaMap.put("CP819", "ISO8859_1");
-
- aIANA2JavaMap.put("ISO-8859-2", "ISO8859_2");
- aIANA2JavaMap.put("ISO-IR-101", "ISO8859_2");
- aIANA2JavaMap.put("ISO_8859-2", "ISO8859_2");
- aIANA2JavaMap.put("LATIN2", "ISO8859_2");
- aIANA2JavaMap.put("CSISOLATIN2", "ISO8859_2");
- aIANA2JavaMap.put("L2", "ISO8859_2");
-
- aIANA2JavaMap.put("ISO-8859-3", "ISO8859_3");
- aIANA2JavaMap.put("ISO-IR-109", "ISO8859_3");
- aIANA2JavaMap.put("ISO_8859-3", "ISO8859_3");
- aIANA2JavaMap.put("LATIN3", "ISO8859_3");
- aIANA2JavaMap.put("CSISOLATIN3", "ISO8859_3");
- aIANA2JavaMap.put("L3", "ISO8859_3");
-
- aIANA2JavaMap.put("ISO-8859-4", "ISO8859_4");
- aIANA2JavaMap.put("ISO-IR-110", "ISO8859_4");
- aIANA2JavaMap.put("ISO_8859-4", "ISO8859_4");
- aIANA2JavaMap.put("LATIN4", "ISO8859_4");
- aIANA2JavaMap.put("CSISOLATIN4", "ISO8859_4");
- aIANA2JavaMap.put("L4", "ISO8859_4");
-
- aIANA2JavaMap.put("ISO-8859-5", "ISO8859_5");
- aIANA2JavaMap.put("ISO-IR-144", "ISO8859_5");
- aIANA2JavaMap.put("ISO_8859-5", "ISO8859_5");
- aIANA2JavaMap.put("CYRILLIC", "ISO8859_5");
- aIANA2JavaMap.put("CSISOLATINCYRILLIC", "ISO8859_5");
-
- aIANA2JavaMap.put("ISO-8859-6", "ISO8859_6");
- aIANA2JavaMap.put("ISO-IR-127", "ISO8859_6");
- aIANA2JavaMap.put("ISO_8859-6", "ISO8859_6");
- aIANA2JavaMap.put("ECMA-114", "ISO8859_6");
- aIANA2JavaMap.put("ASMO-708", "ISO8859_6");
- aIANA2JavaMap.put("ARABIC", "ISO8859_6");
- aIANA2JavaMap.put("CSISOLATINARABIC", "ISO8859_6");
-
- aIANA2JavaMap.put("ISO-8859-7", "ISO8859_7");
- aIANA2JavaMap.put("ISO-IR-126", "ISO8859_7");
- aIANA2JavaMap.put("ISO_8859-7", "ISO8859_7");
- aIANA2JavaMap.put("ELOT_928", "ISO8859_7");
- aIANA2JavaMap.put("ECMA-118", "ISO8859_7");
- aIANA2JavaMap.put("GREEK", "ISO8859_7");
- aIANA2JavaMap.put("CSISOLATINGREEK", "ISO8859_7");
- aIANA2JavaMap.put("GREEK8", "ISO8859_7");
-
- aIANA2JavaMap.put("ISO-8859-8", "ISO8859_8");
- aIANA2JavaMap.put("ISO-8859-8-I", "ISO8859_8"); // added since this encoding only differs w.r.t. presentation
- aIANA2JavaMap.put("ISO-IR-138", "ISO8859_8");
- aIANA2JavaMap.put("ISO_8859-8", "ISO8859_8");
- aIANA2JavaMap.put("HEBREW", "ISO8859_8");
- aIANA2JavaMap.put("CSISOLATINHEBREW", "ISO8859_8");
-
- aIANA2JavaMap.put("ISO-8859-9", "ISO8859_9");
- aIANA2JavaMap.put("ISO-IR-148", "ISO8859_9");
- aIANA2JavaMap.put("ISO_8859-9", "ISO8859_9");
- aIANA2JavaMap.put("LATIN5", "ISO8859_9");
- aIANA2JavaMap.put("CSISOLATIN5", "ISO8859_9");
- aIANA2JavaMap.put("L5", "ISO8859_9");
-
- aIANA2JavaMap.put("ISO-8859-13", "ISO8859_13");
-
- aIANA2JavaMap.put("ISO-8859-15", "ISO8859_15_FDIS");
- aIANA2JavaMap.put("ISO_8859-15", "ISO8859_15_FDIS");
- aIANA2JavaMap.put("LATIN-9", "ISO8859_15_FDIS");
-
- aIANA2JavaMap.put("KOI8-R", "KOI8_R");
- aIANA2JavaMap.put("CSKOI8R", "KOI8_R");
- aIANA2JavaMap.put("US-ASCII", "ASCII");
- aIANA2JavaMap.put("ISO-IR-6", "ASCII");
- aIANA2JavaMap.put("ANSI_X3.4-1968", "ASCII");
- aIANA2JavaMap.put("ANSI_X3.4-1986", "ASCII");
- aIANA2JavaMap.put("ISO_646.IRV:1991", "ASCII");
- aIANA2JavaMap.put("ASCII", "ASCII");
- aIANA2JavaMap.put("CSASCII", "ASCII");
- aIANA2JavaMap.put("ISO646-US", "ASCII");
- aIANA2JavaMap.put("US", "ASCII");
- aIANA2JavaMap.put("IBM367", "ASCII");
- aIANA2JavaMap.put("CP367", "ASCII");
- aIANA2JavaMap.put("UTF-8", "UTF8");
- aIANA2JavaMap.put("UTF-16", "UTF-16");
- aIANA2JavaMap.put("UTF-16BE", "UnicodeBig");
- aIANA2JavaMap.put("UTF-16LE", "UnicodeLittle");
-
- // support for 1047, as proposed to be added to the
- // IANA registry in
- // http://lists.w3.org/Archives/Public/ietf-charset/2002JulSep/0049.html
- aIANA2JavaMap.put("IBM-1047", "Cp1047");
- aIANA2JavaMap.put("IBM1047", "Cp1047");
- aIANA2JavaMap.put("CP1047", "Cp1047");
-
- // Adding new aliases as proposed in
- // http://lists.w3.org/Archives/Public/ietf-charset/2002JulSep/0058.html
- aIANA2JavaMap.put("IBM-37", "CP037");
- aIANA2JavaMap.put("IBM-273", "CP273");
- aIANA2JavaMap.put("IBM-277", "CP277");
- aIANA2JavaMap.put("IBM-278", "CP278");
- aIANA2JavaMap.put("IBM-280", "CP280");
- aIANA2JavaMap.put("IBM-284", "CP284");
- aIANA2JavaMap.put("IBM-285", "CP285");
- aIANA2JavaMap.put("IBM-290", "CP290");
- aIANA2JavaMap.put("IBM-297", "CP297");
- aIANA2JavaMap.put("IBM-420", "CP420");
- aIANA2JavaMap.put("IBM-424", "CP424");
- aIANA2JavaMap.put("IBM-437", "CP437");
- aIANA2JavaMap.put("IBM-500", "CP500");
- aIANA2JavaMap.put("IBM-775", "CP775");
- aIANA2JavaMap.put("IBM-850", "CP850");
- aIANA2JavaMap.put("IBM-852", "CP852");
- aIANA2JavaMap.put("IBM-855", "CP855");
- aIANA2JavaMap.put("IBM-857", "CP857");
- aIANA2JavaMap.put("IBM-858", "CP858");
- aIANA2JavaMap.put("IBM-860", "CP860");
- aIANA2JavaMap.put("IBM-861", "CP861");
- aIANA2JavaMap.put("IBM-862", "CP862");
- aIANA2JavaMap.put("IBM-863", "CP863");
- aIANA2JavaMap.put("IBM-864", "CP864");
- aIANA2JavaMap.put("IBM-865", "CP865");
- aIANA2JavaMap.put("IBM-866", "CP866");
- aIANA2JavaMap.put("IBM-868", "CP868");
- aIANA2JavaMap.put("IBM-869", "CP869");
- aIANA2JavaMap.put("IBM-870", "CP870");
- aIANA2JavaMap.put("IBM-871", "CP871");
- aIANA2JavaMap.put("IBM-918", "CP918");
- aIANA2JavaMap.put("IBM-924", "CP924");
- aIANA2JavaMap.put("IBM-1026", "CP1026");
- aIANA2JavaMap.put("IBM-1140", "Cp1140");
- aIANA2JavaMap.put("IBM-1141", "Cp1141");
- aIANA2JavaMap.put("IBM-1142", "Cp1142");
- aIANA2JavaMap.put("IBM-1143", "Cp1143");
- aIANA2JavaMap.put("IBM-1144", "Cp1144");
- aIANA2JavaMap.put("IBM-1145", "Cp1145");
- aIANA2JavaMap.put("IBM-1146", "Cp1146");
- aIANA2JavaMap.put("IBM-1147", "Cp1147");
- aIANA2JavaMap.put("IBM-1148", "Cp1148");
- aIANA2JavaMap.put("IBM-1149", "Cp1149");
- aIANA2JavaMap.put("IBM-819", "ISO8859_1");
- aIANA2JavaMap.put("IBM-367", "ASCII");
-
- fIANA2JavaMap = Collections.unmodifiableMap(aIANA2JavaMap);
- // REVISIT:
- // j:CNS11643 -> EUC-TW?
- // ISO-2022-CN? ISO-2022-CN-EXT?
-
- // add Java to IANA encoding mappings
- //aJava2IANAMap.put("8859_1", "US-ASCII"); // ?
- aJava2IANAMap.put("ISO8859_1", "ISO-8859-1");
- aJava2IANAMap.put("ISO8859_2", "ISO-8859-2");
- aJava2IANAMap.put("ISO8859_3", "ISO-8859-3");
- aJava2IANAMap.put("ISO8859_4", "ISO-8859-4");
- aJava2IANAMap.put("ISO8859_5", "ISO-8859-5");
- aJava2IANAMap.put("ISO8859_6", "ISO-8859-6");
- aJava2IANAMap.put("ISO8859_7", "ISO-8859-7");
- aJava2IANAMap.put("ISO8859_8", "ISO-8859-8");
- aJava2IANAMap.put("ISO8859_9", "ISO-8859-9");
- aJava2IANAMap.put("ISO8859_13", "ISO-8859-13");
- aJava2IANAMap.put("ISO8859_15", "ISO-8859-15");
- aJava2IANAMap.put("ISO8859_15_FDIS", "ISO-8859-15");
- aJava2IANAMap.put("Big5", "BIG5");
- aJava2IANAMap.put("CP037", "EBCDIC-CP-US");
- aJava2IANAMap.put("CP273", "IBM273");
- aJava2IANAMap.put("CP277", "EBCDIC-CP-DK");
- aJava2IANAMap.put("CP278", "EBCDIC-CP-FI");
- aJava2IANAMap.put("CP280", "EBCDIC-CP-IT");
- aJava2IANAMap.put("CP284", "EBCDIC-CP-ES");
- aJava2IANAMap.put("CP285", "EBCDIC-CP-GB");
- aJava2IANAMap.put("CP290", "EBCDIC-JP-KANA");
- aJava2IANAMap.put("CP297", "EBCDIC-CP-FR");
- aJava2IANAMap.put("CP420", "EBCDIC-CP-AR1");
- aJava2IANAMap.put("CP424", "EBCDIC-CP-HE");
- aJava2IANAMap.put("CP437", "IBM437");
- aJava2IANAMap.put("CP500", "EBCDIC-CP-CH");
- aJava2IANAMap.put("CP775", "IBM775");
- aJava2IANAMap.put("CP850", "IBM850");
- aJava2IANAMap.put("CP852", "IBM852");
- aJava2IANAMap.put("CP855", "IBM855");
- aJava2IANAMap.put("CP857", "IBM857");
- aJava2IANAMap.put("CP858", "IBM00858");
- aJava2IANAMap.put("CP860", "IBM860");
- aJava2IANAMap.put("CP861", "IBM861");
- aJava2IANAMap.put("CP862", "IBM862");
- aJava2IANAMap.put("CP863", "IBM863");
- aJava2IANAMap.put("CP864", "IBM864");
- aJava2IANAMap.put("CP865", "IBM865");
- aJava2IANAMap.put("CP866", "IBM866");
- aJava2IANAMap.put("CP868", "IBM868");
- aJava2IANAMap.put("CP869", "IBM869");
- aJava2IANAMap.put("CP870", "EBCDIC-CP-ROECE");
- aJava2IANAMap.put("CP871", "EBCDIC-CP-IS");
- aJava2IANAMap.put("CP918", "EBCDIC-CP-AR2");
- aJava2IANAMap.put("CP924", "IBM00924");
- aJava2IANAMap.put("CP1026", "IBM1026");
- aJava2IANAMap.put("CP1140", "IBM01140");
- aJava2IANAMap.put("CP1141", "IBM01141");
- aJava2IANAMap.put("CP1142", "IBM01142");
- aJava2IANAMap.put("CP1143", "IBM01143");
- aJava2IANAMap.put("CP1144", "IBM01144");
- aJava2IANAMap.put("CP1145", "IBM01145");
- aJava2IANAMap.put("CP1146", "IBM01146");
- aJava2IANAMap.put("CP1147", "IBM01147");
- aJava2IANAMap.put("CP1148", "IBM01148");
- aJava2IANAMap.put("CP1149", "IBM01149");
- aJava2IANAMap.put("EUCJIS", "EUC-JP");
- aJava2IANAMap.put("KS_C_5601-1987", "KS_C_5601-1987");
- aJava2IANAMap.put("GB2312", "GB2312");
- aJava2IANAMap.put("ISO2022KR", "ISO-2022-KR");
- aJava2IANAMap.put("ISO2022CN", "ISO-2022-CN");
- aJava2IANAMap.put("JIS", "ISO-2022-JP");
- aJava2IANAMap.put("KOI8_R", "KOI8-R");
- aJava2IANAMap.put("KSC5601", "EUC-KR");
- aJava2IANAMap.put("GB18030", "GB18030");
- aJava2IANAMap.put("GBK", "GBK");
- aJava2IANAMap.put("SJIS", "SHIFT_JIS");
- aJava2IANAMap.put("MS932", "WINDOWS-31J");
- aJava2IANAMap.put("UTF8", "UTF-8");
- aJava2IANAMap.put("Unicode", "UTF-16");
- aJava2IANAMap.put("UnicodeBig", "UTF-16BE");
- aJava2IANAMap.put("UnicodeLittle", "UTF-16LE");
- aJava2IANAMap.put("JIS0201", "X0201");
- aJava2IANAMap.put("JIS0208", "X0208");
- aJava2IANAMap.put("JIS0212", "ISO-IR-159");
-
- // proposed addition (see above for details):
- aJava2IANAMap.put("CP1047", "IBM1047");
-
- fJava2IANAMap = Collections.unmodifiableMap(aIANA2JavaMap);
- } // <clinit>()
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- public EncodingMap() {}
-
- //
- // Public static methods
- //
-
- /**
- * Returns the Java encoding name for the specified IANA encoding name.
- *
- * @param ianaEncoding The IANA encoding name.
- */
- public static String getIANA2JavaMapping(String ianaEncoding) {
- return fIANA2JavaMap.get(ianaEncoding);
- } // getIANA2JavaMapping(String):String
-
- /**
- * Returns the IANA encoding name for the specified Java encoding name.
- *
- * @param javaEncoding The Java encoding name.
- */
- public static String getJava2IANAMapping(String javaEncoding) {
- return fJava2IANAMap.get(javaEncoding);
- } // getJava2IANAMapping(String):String
-
-
-} // class EncodingMap
diff --git a/src/com/sun/org/apache/xerces/internal/util/EntityResolver2Wrapper.java b/src/com/sun/org/apache/xerces/internal/util/EntityResolver2Wrapper.java
deleted file mode 100644
index 0572de1..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/EntityResolver2Wrapper.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.util;
-
-import java.io.InputStream;
-import java.io.IOException;
-import java.io.Reader;
-
-import com.sun.org.apache.xerces.internal.impl.ExternalSubsetResolver;
-import com.sun.org.apache.xerces.internal.impl.XMLEntityDescription;
-import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLDTDDescription;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-
-import org.xml.sax.ext.EntityResolver2;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
-/**
- * <p>This class wraps a SAX entity resolver (EntityResolver2) in an XNI entity resolver.</p>
- *
- * @author Michael Glavassevich, IBM
- *
- */
-public class EntityResolver2Wrapper
- implements ExternalSubsetResolver {
-
- //
- // Data
- //
-
- /** An instance of SAX2 Extensions 1.1's EntityResolver2. */
- protected EntityResolver2 fEntityResolver;
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- public EntityResolver2Wrapper() {}
-
- /**
- * <p>Creates a new instance wrapping the given SAX entity resolver.</p>
- *
- * @param entityResolver the SAX entity resolver to wrap
- */
- public EntityResolver2Wrapper(EntityResolver2 entityResolver) {
- setEntityResolver(entityResolver);
- } // <init>(EntityResolver2)
-
- //
- // Public methods
- //
-
- /**
- * <p>Sets the SAX entity resolver wrapped by this object.</p>
- *
- * @param entityResolver the SAX entity resolver to wrap
- */
- public void setEntityResolver(EntityResolver2 entityResolver) {
- fEntityResolver = entityResolver;
- } // setEntityResolver(EntityResolver2)
-
- /**
- * <p>Returns the SAX entity resolver wrapped by this object.</p>
- *
- * @return the SAX entity resolver wrapped by this object
- */
- public EntityResolver2 getEntityResolver() {
- return fEntityResolver;
- } // getEntityResolver():EntityResolver2
-
- //
- // ExternalSubsetResolver methods
- //
-
- /**
- * <p>Locates an external subset for documents which do not explicitly
- * provide one. If no external subset is provided, this method should
- * return <code>null</code>.</p>
- *
- * @param grammarDescription a description of the DTD
- *
- * @throws XNIException Thrown on general error.
- * @throws IOException Thrown if resolved entity stream cannot be
- * opened or some other i/o error occurs.
- */
- public XMLInputSource getExternalSubset(XMLDTDDescription grammarDescription)
- throws XNIException, IOException {
-
- if (fEntityResolver != null) {
-
- String name = grammarDescription.getRootName();
- String baseURI = grammarDescription.getBaseSystemId();
-
- // Resolve using EntityResolver2
- try {
- InputSource inputSource = fEntityResolver.getExternalSubset(name, baseURI);
- return (inputSource != null) ? createXMLInputSource(inputSource, baseURI) : null;
- }
- // error resolving external subset
- catch (SAXException e) {
- Exception ex = e.getException();
- if (ex == null) {
- ex = e;
- }
- throw new XNIException(ex);
- }
- }
-
- // unable to resolve external subset
- return null;
-
- } // getExternalSubset(XMLDTDDescription):XMLInputSource
-
- //
- // XMLEntityResolver methods
- //
-
- /**
- * Resolves an external parsed entity. If the entity cannot be
- * resolved, this method should return null.
- *
- * @param resourceIdentifier contains the physical co-ordinates of the resource to be resolved
- *
- * @throws XNIException Thrown on general error.
- * @throws IOException Thrown if resolved entity stream cannot be
- * opened or some other i/o error occurs.
- */
- public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier)
- throws XNIException, IOException {
-
- if (fEntityResolver != null) {
-
- String pubId = resourceIdentifier.getPublicId();
- String sysId = resourceIdentifier.getLiteralSystemId();
- String baseURI = resourceIdentifier.getBaseSystemId();
- String name = null;
- if (resourceIdentifier instanceof XMLDTDDescription) {
- name = "[dtd]";
- }
- else if (resourceIdentifier instanceof XMLEntityDescription) {
- name = ((XMLEntityDescription) resourceIdentifier).getEntityName();
- }
-
- // When both pubId and sysId are null, the user's entity resolver
- // can do nothing about it. We'd better not bother calling it.
- // This happens when the resourceIdentifier is a GrammarDescription,
- // which describes a schema grammar of some namespace, but without
- // any schema location hint. -Sg
- if (pubId == null && sysId == null) {
- return null;
- }
-
- // Resolve using EntityResolver2
- try {
- InputSource inputSource =
- fEntityResolver.resolveEntity(name, pubId, baseURI, sysId);
- return (inputSource != null) ? createXMLInputSource(inputSource, baseURI) : null;
- }
- // error resolving entity
- catch (SAXException e) {
- Exception ex = e.getException();
- if (ex == null) {
- ex = e;
- }
- throw new XNIException(ex);
- }
- }
-
- // unable to resolve entity
- return null;
-
- } // resolveEntity(XMLResourceIdentifier):XMLInputSource
-
- /**
- * Creates an XMLInputSource from a SAX InputSource.
- */
- private XMLInputSource createXMLInputSource(InputSource source, String baseURI) {
-
- String publicId = source.getPublicId();
- String systemId = source.getSystemId();
- String baseSystemId = baseURI;
- InputStream byteStream = source.getByteStream();
- Reader charStream = source.getCharacterStream();
- String encoding = source.getEncoding();
- XMLInputSource xmlInputSource =
- new XMLInputSource(publicId, systemId, baseSystemId);
- xmlInputSource.setByteStream(byteStream);
- xmlInputSource.setCharacterStream(charStream);
- xmlInputSource.setEncoding(encoding);
- return xmlInputSource;
-
- } // createXMLInputSource(InputSource,String):XMLInputSource
-
-} // class EntityResolver2Wrapper
diff --git a/src/com/sun/org/apache/xerces/internal/util/EntityResolverWrapper.java b/src/com/sun/org/apache/xerces/internal/util/EntityResolverWrapper.java
deleted file mode 100644
index 460047b..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/EntityResolverWrapper.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.util;
-
-import java.io.InputStream;
-import java.io.IOException;
-import java.io.Reader;
-
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLEntityResolver;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-
-import org.xml.sax.EntityResolver;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
-/**
- * This class wraps a SAX entity resolver in an XNI entity resolver.
- *
- * @see EntityResolver
- *
- * @author Andy Clark, IBM
- *
- */
-public class EntityResolverWrapper
- implements XMLEntityResolver {
-
- //
- // Data
- //
-
- /** The SAX entity resolver. */
- protected EntityResolver fEntityResolver;
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- public EntityResolverWrapper() {}
-
- /** Wraps the specified SAX entity resolver. */
- public EntityResolverWrapper(EntityResolver entityResolver) {
- setEntityResolver(entityResolver);
- } // <init>(EntityResolver)
-
- //
- // Public methods
- //
-
- /** Sets the SAX entity resolver. */
- public void setEntityResolver(EntityResolver entityResolver) {
- fEntityResolver = entityResolver;
- } // setEntityResolver(EntityResolver)
-
- /** Returns the SAX entity resolver. */
- public EntityResolver getEntityResolver() {
- return fEntityResolver;
- } // getEntityResolver():EntityResolver
-
- //
- // XMLEntityResolver methods
- //
-
- /**
- * Resolves an external parsed entity. If the entity cannot be
- * resolved, this method should return null.
- *
- * @param resourceIdentifier contains the physical co-ordinates of the resource to be resolved
- *
- * @throws XNIException Thrown on general error.
- * @throws IOException Thrown if resolved entity stream cannot be
- * opened or some other i/o error occurs.
- */
- public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier)
- throws XNIException, IOException {
-
- // When both pubId and sysId are null, the user's entity resolver
- // can do nothing about it. We'd better not bother calling it.
- // This happens when the resourceIdentifier is a GrammarDescription,
- // which describes a schema grammar of some namespace, but without
- // any schema location hint. -Sg
- String pubId = resourceIdentifier.getPublicId();
- String sysId = resourceIdentifier.getExpandedSystemId();
- if (pubId == null && sysId == null)
- return null;
-
- // resolve entity using SAX entity resolver
- if (fEntityResolver != null && resourceIdentifier != null) {
- try {
- InputSource inputSource = fEntityResolver.resolveEntity(pubId, sysId);
- if (inputSource != null) {
- String publicId = inputSource.getPublicId();
- String systemId = inputSource.getSystemId();
- String baseSystemId = resourceIdentifier.getBaseSystemId();
- InputStream byteStream = inputSource.getByteStream();
- Reader charStream = inputSource.getCharacterStream();
- String encoding = inputSource.getEncoding();
- XMLInputSource xmlInputSource =
- new XMLInputSource(publicId, systemId, baseSystemId);
- xmlInputSource.setByteStream(byteStream);
- xmlInputSource.setCharacterStream(charStream);
- xmlInputSource.setEncoding(encoding);
- return xmlInputSource;
- }
- }
-
- // error resolving entity
- catch (SAXException e) {
- Exception ex = e.getException();
- if (ex == null) {
- ex = e;
- }
- throw new XNIException(ex);
- }
- }
-
- // unable to resolve entity
- return null;
-
- } // resolveEntity(String,String,String):XMLInputSource
-}
diff --git a/src/com/sun/org/apache/xerces/internal/util/ErrorHandlerProxy.java b/src/com/sun/org/apache/xerces/internal/util/ErrorHandlerProxy.java
deleted file mode 100644
index 8b3ae9b..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/ErrorHandlerProxy.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.util;
-
-import com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-/**
- * Wraps {@link XMLErrorHandler} and make it look like a SAX {@link ErrorHandler}.
- *
- * <p>
- * The derived class should override the {@link #getErrorHandler()} method
- * so that it will return the correct {@link XMLErrorHandler} instance.
- * This method will be called whenever an error/warning is found.
- *
- * <p>
- * Experience shows that it is better to store the actual
- * {@link XMLErrorHandler} in one place and looks up that variable,
- * rather than copying it into every component that needs an error handler
- * and update all of them whenever it is changed, IMO.
- *
- * @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
- *
- */
-public abstract class ErrorHandlerProxy implements ErrorHandler {
-
- public void error(SAXParseException e) throws SAXException {
- XMLErrorHandler eh = getErrorHandler();
- if (eh instanceof ErrorHandlerWrapper) {
- ((ErrorHandlerWrapper)eh).fErrorHandler.error(e);
- }
- else {
- eh.error("","",ErrorHandlerWrapper.createXMLParseException(e));
- }
- // if an XNIException is thrown, just let it go.
- // REVISIT: is this OK? or should we try to wrap it into SAXException?
- }
-
- public void fatalError(SAXParseException e) throws SAXException {
- XMLErrorHandler eh = getErrorHandler();
- if (eh instanceof ErrorHandlerWrapper) {
- ((ErrorHandlerWrapper)eh).fErrorHandler.fatalError(e);
- }
- else {
- eh.fatalError("","",ErrorHandlerWrapper.createXMLParseException(e));
- }
- }
-
- public void warning(SAXParseException e) throws SAXException {
- XMLErrorHandler eh = getErrorHandler();
- if (eh instanceof ErrorHandlerWrapper) {
- ((ErrorHandlerWrapper)eh).fErrorHandler.warning(e);
- }
- else {
- eh.warning("","",ErrorHandlerWrapper.createXMLParseException(e));
- }
- }
-
- protected abstract XMLErrorHandler getErrorHandler();
-}
diff --git a/src/com/sun/org/apache/xerces/internal/util/ErrorHandlerWrapper.java b/src/com/sun/org/apache/xerces/internal/util/ErrorHandlerWrapper.java
deleted file mode 100644
index 2455fe3..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/ErrorHandlerWrapper.java
+++ /dev/null
@@ -1,232 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.util;
-
-import com.sun.org.apache.xerces.internal.xni.XMLLocator;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLParseException;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-/**
- * This class wraps a SAX error handler in an XNI error handler.
- *
- * @see ErrorHandler
- *
- * @author Andy Clark, IBM
- *
- */
-public class ErrorHandlerWrapper
- implements XMLErrorHandler {
-
- //
- // Data
- //
-
- /** The SAX error handler. */
- protected ErrorHandler fErrorHandler;
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- public ErrorHandlerWrapper() {}
-
- /** Wraps the specified SAX error handler. */
- public ErrorHandlerWrapper(ErrorHandler errorHandler) {
- setErrorHandler(errorHandler);
- } // <init>(ErrorHandler)
-
- //
- // Public methods
- //
-
- /** Sets the SAX error handler. */
- public void setErrorHandler(ErrorHandler errorHandler) {
- fErrorHandler = errorHandler;
- } // setErrorHandler(ErrorHandler)
-
- /** Returns the SAX error handler. */
- public ErrorHandler getErrorHandler() {
- return fErrorHandler;
- } // getErrorHandler():ErrorHandler
-
- //
- // XMLErrorHandler methods
- //
-
- /**
- * Reports a warning. Warnings are non-fatal and can be safely ignored
- * by most applications.
- *
- * @param domain The domain of the warning. The domain can be any
- * string but is suggested to be a valid URI. The
- * domain can be used to conveniently specify a web
- * site location of the relevent specification or
- * document pertaining to this warning.
- * @param key The warning key. This key can be any string and
- * is implementation dependent.
- * @param exception Exception.
- *
- * @throws XNIException Thrown to signal that the parser should stop
- * parsing the document.
- */
- public void warning(String domain, String key,
- XMLParseException exception) throws XNIException {
-
- if (fErrorHandler != null) {
- SAXParseException saxException = createSAXParseException(exception);
-
- try {
- fErrorHandler.warning(saxException);
- }
- catch (SAXParseException e) {
- throw createXMLParseException(e);
- }
- catch (SAXException e) {
- throw createXNIException(e);
- }
- }
-
- } // warning(String,String,XMLParseException)
-
- /**
- * Reports an error. Errors are non-fatal and usually signify that the
- * document is invalid with respect to its grammar(s).
- *
- * @param domain The domain of the error. The domain can be any
- * string but is suggested to be a valid URI. The
- * domain can be used to conveniently specify a web
- * site location of the relevent specification or
- * document pertaining to this error.
- * @param key The error key. This key can be any string and
- * is implementation dependent.
- * @param exception Exception.
- *
- * @throws XNIException Thrown to signal that the parser should stop
- * parsing the document.
- */
- public void error(String domain, String key,
- XMLParseException exception) throws XNIException {
-
- if (fErrorHandler != null) {
- SAXParseException saxException = createSAXParseException(exception);
-
- try {
- fErrorHandler.error(saxException);
- }
- catch (SAXParseException e) {
- throw createXMLParseException(e);
- }
- catch (SAXException e) {
- throw createXNIException(e);
- }
- }
-
- } // error(String,String,XMLParseException)
-
- /**
- * Report a fatal error. Fatal errors usually occur when the document
- * is not well-formed and signifies that the parser cannot continue
- * normal operation.
- * <p>
- * <strong>Note:</strong> The error handler should <em>always</em>
- * throw an <code>XNIException</code> from this method. This exception
- * can either be the same exception that is passed as a parameter to
- * the method or a new XNI exception object. If the registered error
- * handler fails to throw an exception, the continuing operation of
- * the parser is undetermined.
- *
- * @param domain The domain of the fatal error. The domain can be
- * any string but is suggested to be a valid URI. The
- * domain can be used to conveniently specify a web
- * site location of the relevent specification or
- * document pertaining to this fatal error.
- * @param key The fatal error key. This key can be any string
- * and is implementation dependent.
- * @param exception Exception.
- *
- * @throws XNIException Thrown to signal that the parser should stop
- * parsing the document.
- */
- public void fatalError(String domain, String key,
- XMLParseException exception) throws XNIException {
-
- if (fErrorHandler != null) {
- SAXParseException saxException = createSAXParseException(exception);
-
- try {
- fErrorHandler.fatalError(saxException);
- }
- catch (SAXParseException e) {
- throw createXMLParseException(e);
- }
- catch (SAXException e) {
- throw createXNIException(e);
- }
- }
-
- } // fatalError(String,String,XMLParseException)
-
- //
- // Protected methods
- //
-
- /** Creates a SAXParseException from an XMLParseException. */
- protected static SAXParseException createSAXParseException(XMLParseException exception) {
- return new SAXParseException(exception.getMessage(),
- exception.getPublicId(),
- exception.getExpandedSystemId(),
- exception.getLineNumber(),
- exception.getColumnNumber(),
- exception.getException());
- } // createSAXParseException(XMLParseException):SAXParseException
-
- /** Creates an XMLParseException from a SAXParseException. */
- protected static XMLParseException createXMLParseException(SAXParseException exception) {
- final String fPublicId = exception.getPublicId();
- final String fExpandedSystemId = exception.getSystemId();
- final int fLineNumber = exception.getLineNumber();
- final int fColumnNumber = exception.getColumnNumber();
- XMLLocator location = new XMLLocator() {
- public String getPublicId() { return fPublicId; }
- public String getExpandedSystemId() { return fExpandedSystemId; }
- public String getBaseSystemId() { return null; }
- public String getLiteralSystemId() { return null; }
- public int getColumnNumber() { return fColumnNumber; }
- public int getLineNumber() { return fLineNumber; }
- public int getCharacterOffset() { return -1; }
- public String getEncoding() { return null; }
- public String getXMLVersion() { return null; }
- };
- return new XMLParseException(location, exception.getMessage(),exception);
- } // createXMLParseException(SAXParseException):XMLParseException
-
- /** Creates an XNIException from a SAXException.
- NOTE: care should be taken *not* to call this with a SAXParseException; this will
- lose information!!! */
- protected static XNIException createXNIException(SAXException exception) {
- return new XNIException(exception.getMessage(),exception);
- } // createXNIException(SAXException):XMLParseException
-} // class ErrorHandlerWrapper
diff --git a/src/com/sun/org/apache/xerces/internal/util/FeatureState.java b/src/com/sun/org/apache/xerces/internal/util/FeatureState.java
deleted file mode 100644
index e78b30c..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/FeatureState.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- */
-
-/*
- * $Id: FeatureState.java 3024 2011-03-01 03:46:13Z joehw $
- */
-
-package com.sun.org.apache.xerces.internal.util;
-
-public class FeatureState {
-
- public final Status status;
- public final boolean state;
-
- public static final FeatureState SET_ENABLED = new FeatureState(Status.SET, true);
- public static final FeatureState SET_DISABLED = new FeatureState(Status.SET, false);
- public static final FeatureState UNKNOWN = new FeatureState(Status.UNKNOWN, false);
- public static final FeatureState RECOGNIZED = new FeatureState(Status.RECOGNIZED, false);
- public static final FeatureState NOT_SUPPORTED = new FeatureState(Status.NOT_SUPPORTED, false);
- public static final FeatureState NOT_RECOGNIZED = new FeatureState(Status.NOT_RECOGNIZED, false);
- public static final FeatureState NOT_ALLOWED = new FeatureState(Status.NOT_ALLOWED, false);
-
- public FeatureState(Status status, boolean state) {
- this.status = status;
- this.state = state;
- }
-
- public static FeatureState of(Status status) {
- return new FeatureState(status, false);
- }
-
- public static FeatureState is(boolean value) {
- return new FeatureState(Status.SET, value);
- }
-
- public boolean isExceptional() {
- return this.status.isExceptional();
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/util/HTTPInputSource.java b/src/com/sun/org/apache/xerces/internal/util/HTTPInputSource.java
deleted file mode 100644
index c9bbed9..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/HTTPInputSource.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
- */
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.util;
-
-import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-import java.io.InputStream;
-import java.io.Reader;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-/**
- * This class represents an input source for an XML resource
- * retrievable over HTTP. In addition to the properties
- * provided by an <code>XMLInputSource</code> an HTTP input
- * source also has HTTP request properties and a preference
- * whether HTTP redirects will be followed. Note that these
- * properties will only be used if reading this input source
- * will induce an HTTP connection.
- *
- * @author Michael Glavassevich, IBM
- *
- */
-public final class HTTPInputSource extends XMLInputSource {
-
- //
- // Data
- //
-
- /** Preference for whether HTTP redirects should be followed. **/
- protected boolean fFollowRedirects = true;
-
- /** HTTP request properties. **/
- protected Map<String, String> fHTTPRequestProperties = new HashMap<>();
-
- //
- // Constructors
- //
-
- /**
- * Constructs an input source from just the public and system
- * identifiers, leaving resolution of the entity and opening of
- * the input stream up to the caller.
- *
- * @param publicId The public identifier, if known.
- * @param systemId The system identifier. This value should
- * always be set, if possible, and can be
- * relative or absolute. If the system identifier
- * is relative, then the base system identifier
- * should be set.
- * @param baseSystemId The base system identifier. This value should
- * always be set to the fully expanded URI of the
- * base system identifier, if possible.
- */
- public HTTPInputSource(String publicId, String systemId, String baseSystemId) {
- super(publicId, systemId, baseSystemId);
- } // <init>(String,String,String)
-
- /**
- * Constructs an input source from a XMLResourceIdentifier
- * object, leaving resolution of the entity and opening of
- * the input stream up to the caller.
- *
- * @param resourceIdentifier the XMLResourceIdentifier containing the information
- */
- public HTTPInputSource(XMLResourceIdentifier resourceIdentifier) {
- super(resourceIdentifier);
- } // <init>(XMLResourceIdentifier)
-
- /**
- * Constructs an input source from a byte stream.
- *
- * @param publicId The public identifier, if known.
- * @param systemId The system identifier. This value should
- * always be set, if possible, and can be
- * relative or absolute. If the system identifier
- * is relative, then the base system identifier
- * should be set.
- * @param baseSystemId The base system identifier. This value should
- * always be set to the fully expanded URI of the
- * base system identifier, if possible.
- * @param byteStream The byte stream.
- * @param encoding The encoding of the byte stream, if known.
- */
- public HTTPInputSource(String publicId, String systemId,
- String baseSystemId, InputStream byteStream, String encoding) {
- super(publicId, systemId, baseSystemId, byteStream, encoding);
- } // <init>(String,String,String,InputStream,String)
-
- /**
- * Constructs an input source from a character stream.
- *
- * @param publicId The public identifier, if known.
- * @param systemId The system identifier. This value should
- * always be set, if possible, and can be
- * relative or absolute. If the system identifier
- * is relative, then the base system identifier
- * should be set.
- * @param baseSystemId The base system identifier. This value should
- * always be set to the fully expanded URI of the
- * base system identifier, if possible.
- * @param charStream The character stream.
- * @param encoding The original encoding of the byte stream
- * used by the reader, if known.
- */
- public HTTPInputSource(String publicId, String systemId,
- String baseSystemId, Reader charStream, String encoding) {
- super(publicId, systemId, baseSystemId, charStream, encoding);
- } // <init>(String,String,String,Reader,String)
-
- //
- // Public methods
- //
-
- /**
- * Returns the preference whether HTTP redirects should
- * be followed. By default HTTP redirects will be followed.
- */
- public boolean getFollowHTTPRedirects() {
- return fFollowRedirects;
- } // getFollowHTTPRedirects():boolean
-
-
- /**
- * Sets the preference whether HTTP redirects should
- * be followed. By default HTTP redirects will be followed.
- */
- public void setFollowHTTPRedirects(boolean followRedirects) {
- fFollowRedirects = followRedirects;
- } // setFollowHTTPRedirects(boolean)
-
- /**
- * Returns the value of the request property
- * associated with the given property name.
- *
- * @param key the name of the request property
- * @return the value of the request property or
- * <code>null</code> if this property has not
- * been set
- */
- public String getHTTPRequestProperty(String key) {
- return fHTTPRequestProperties.get(key);
- } // getHTTPRequestProperty(String):String
-
- /**
- * Returns an iterator for the request properties this
- * input source contains. Each object returned by the
- * iterator is an instance of <code>java.util.Map.Entry</code>
- * where each key and value are a pair of strings corresponding
- * to the name and value of a request property.
- *
- * @return an iterator for the request properties this
- * input source contains
- */
- public Iterator<Map.Entry<String, String>> getHTTPRequestProperties() {
- return fHTTPRequestProperties.entrySet().iterator();
- } // getHTTPRequestProperties():Iterator
-
- /**
- * Sets the value of the request property
- * associated with the given property name.
- *
- * @param key the name of the request property
- * @param value the value of the request property
- */
- public void setHTTPRequestProperty(String key, String value) {
- if (value != null) {
- fHTTPRequestProperties.put(key, value);
- }
- else {
- fHTTPRequestProperties.remove(key);
- }
- } // setHTTPRequestProperty(String,String)
-
-} // class HTTPInputSource
diff --git a/src/com/sun/org/apache/xerces/internal/util/IntStack.java b/src/com/sun/org/apache/xerces/internal/util/IntStack.java
deleted file mode 100644
index 541d17a..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/IntStack.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2000-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.util;
-
-/**
- * A simple integer based stack.
- *
- * moved to com.sun.org.apache.xerces.internal.util by neilg to support the
- * XPathMatcher.
- * @author Andy Clark, IBM
- *
- */
-public final class IntStack {
-
- //
- // Data
- //
-
- /** Stack depth. */
- private int fDepth;
-
- /** Stack data. */
- private int[] fData;
-
- //
- // Public methods
- //
-
- /** Returns the size of the stack. */
- public int size() {
- return fDepth;
- }
-
- /** Pushes a value onto the stack. */
- public void push(int value) {
- ensureCapacity(fDepth + 1);
- fData[fDepth++] = value;
- }
-
- /** Peeks at the top of the stack. */
- public int peek() {
- return fData[fDepth - 1];
- }
-
- /** Returns the element at the specified depth in the stack. */
- public int elementAt(int depth) {
- return fData[depth];
- }
-
- /** Pops a value off of the stack. */
- public int pop() {
- return fData[--fDepth];
- }
-
- /** Clears the stack. */
- public void clear() {
- fDepth = 0;
- }
-
- // debugging
-
- /** Prints the stack. */
- public void print() {
- System.out.print('(');
- System.out.print(fDepth);
- System.out.print(") {");
- for (int i = 0; i < fDepth; i++) {
- if (i == 3) {
- System.out.print(" ...");
- break;
- }
- System.out.print(' ');
- System.out.print(fData[i]);
- if (i < fDepth - 1) {
- System.out.print(',');
- }
- }
- System.out.print(" }");
- System.out.println();
- }
-
- //
- // Private methods
- //
-
- /** Ensures capacity. */
- private void ensureCapacity(int size) {
- if (fData == null) {
- fData = new int[32];
- }
- else if (fData.length <= size) {
- int[] newdata = new int[fData.length * 2];
- System.arraycopy(fData, 0, newdata, 0, fData.length);
- fData = newdata;
- }
- }
-
-} // class IntStack
diff --git a/src/com/sun/org/apache/xerces/internal/util/JAXPNamespaceContextWrapper.java b/src/com/sun/org/apache/xerces/internal/util/JAXPNamespaceContextWrapper.java
deleted file mode 100644
index cdf62d0..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/JAXPNamespaceContextWrapper.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.util;
-
-
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.List;
-import java.util.TreeSet;
-import java.util.Vector;
-
-import javax.xml.XMLConstants;
-
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-
-/**
- * <p>A read-only XNI wrapper around a JAXP NamespaceContext.</p>
- *
- * @author Michael Glavassevich, IBM
- *
- * @version $Id: JAXPNamespaceContextWrapper.java,v 1.2 2010-10-26 23:01:13 joehw Exp $
- */
-public final class JAXPNamespaceContextWrapper implements NamespaceContext {
-
- private javax.xml.namespace.NamespaceContext fNamespaceContext;
- private SymbolTable fSymbolTable;
- private List fPrefixes;
- private final Vector fAllPrefixes = new Vector();
-
- private int[] fContext = new int[8];
- private int fCurrentContext;
-
- public JAXPNamespaceContextWrapper(SymbolTable symbolTable) {
- setSymbolTable(symbolTable);
- }
-
- public void setNamespaceContext(javax.xml.namespace.NamespaceContext context) {
- fNamespaceContext = context;
- }
-
- public javax.xml.namespace.NamespaceContext getNamespaceContext() {
- return fNamespaceContext;
- }
-
- public void setSymbolTable(SymbolTable symbolTable) {
- fSymbolTable = symbolTable;
- }
-
- public SymbolTable getSymbolTable() {
- return fSymbolTable;
- }
-
- public void setDeclaredPrefixes(List prefixes) {
- fPrefixes = prefixes;
- }
-
- public List getDeclaredPrefixes() {
- return fPrefixes;
- }
-
- /*
- * NamespaceContext methods
- */
-
- public String getURI(String prefix) {
- if (fNamespaceContext != null) {
- String uri = fNamespaceContext.getNamespaceURI(prefix);
- if (uri != null && !XMLConstants.NULL_NS_URI.equals(uri)) {
- return (fSymbolTable != null) ? fSymbolTable.addSymbol(uri) : uri.intern();
- }
- }
- return null;
- }
-
- public String getPrefix(String uri) {
- if (fNamespaceContext != null) {
- if (uri == null) {
- uri = XMLConstants.NULL_NS_URI;
- }
- String prefix = fNamespaceContext.getPrefix(uri);
- if (prefix == null) {
- prefix = XMLConstants.DEFAULT_NS_PREFIX;
- }
- return (fSymbolTable != null) ? fSymbolTable.addSymbol(prefix) : prefix.intern();
- }
- return null;
- }
-
- public Enumeration getAllPrefixes() {
- // There may be duplicate prefixes in the list so we
- // first transfer them to a set to ensure uniqueness.
- return Collections.enumeration(new TreeSet(fAllPrefixes));
- }
-
- public void pushContext() {
- // extend the array, if necessary
- if (fCurrentContext + 1 == fContext.length) {
- int[] contextarray = new int[fContext.length * 2];
- System.arraycopy(fContext, 0, contextarray, 0, fContext.length);
- fContext = contextarray;
- }
- // push context
- fContext[++fCurrentContext] = fAllPrefixes.size();
- if (fPrefixes != null) {
- fAllPrefixes.addAll(fPrefixes);
- }
- }
-
- public void popContext() {
- fAllPrefixes.setSize(fContext[fCurrentContext--]);
- }
-
- public boolean declarePrefix(String prefix, String uri) {
- return true;
- }
-
- public int getDeclaredPrefixCount() {
- return (fPrefixes != null) ? fPrefixes.size() : 0;
- }
-
- public String getDeclaredPrefixAt(int index) {
- return (String) fPrefixes.get(index);
- }
-
- public void reset() {
- fCurrentContext = 0;
- fContext[fCurrentContext] = 0;
- fAllPrefixes.clear();
- }
-
-} // JAXPNamespaceContextWrapper
diff --git a/src/com/sun/org/apache/xerces/internal/util/LocatorProxy.java b/src/com/sun/org/apache/xerces/internal/util/LocatorProxy.java
deleted file mode 100644
index 69c78a1..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/LocatorProxy.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.util;
-
-import com.sun.org.apache.xerces.internal.xni.XMLLocator;
-import org.xml.sax.Locator;
-import org.xml.sax.ext.Locator2;
-
-/**
- * Wraps {@link XMLLocator} and make it look like a SAX {@link Locator}.
- *
- * @author Arnaud Le Hors, IBM
- * @author Andy Clark, IBM
- *
- */
-public class LocatorProxy implements Locator2 {
-
- //
- // Data
- //
-
- /** XML locator. */
- private final XMLLocator fLocator;
-
- //
- // Constructors
- //
-
- /** Constructs an XML locator proxy. */
- public LocatorProxy(XMLLocator locator) {
- fLocator = locator;
- }
-
- //
- // Locator methods
- //
-
- /** Public identifier. */
- public String getPublicId() {
- return fLocator.getPublicId();
- }
-
- /** System identifier. */
- public String getSystemId() {
- return fLocator.getExpandedSystemId();
- }
-
- /** Line number. */
- public int getLineNumber() {
- return fLocator.getLineNumber();
- }
-
- /** Column number. */
- public int getColumnNumber() {
- return fLocator.getColumnNumber();
- }
-
- //
- // Locator2 methods
- //
-
- public String getXMLVersion() {
- return fLocator.getXMLVersion();
- }
-
- public String getEncoding() {
- return fLocator.getEncoding();
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/util/LocatorWrapper.java b/src/com/sun/org/apache/xerces/internal/util/LocatorWrapper.java
deleted file mode 100644
index d4445e6..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/LocatorWrapper.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2000-2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package com.sun.org.apache.xerces.internal.util;
-
-import com.sun.org.apache.xerces.internal.xni.XMLLocator;
-import org.xml.sax.Locator;
-
-/**
- * Wraps SAX {@link Locator} into Xerces {@link XMLLocator}.
- *
- * @author
- * Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
- */
-public class LocatorWrapper implements XMLLocator {
-
- private final Locator locator;
-
- public LocatorWrapper( Locator _loc ) { this.locator=_loc; }
-
- public int getColumnNumber() { return locator.getColumnNumber(); }
- public int getLineNumber() { return locator.getLineNumber(); }
- public String getBaseSystemId() { return null; }
- public String getExpandedSystemId() { return locator.getSystemId(); }
- public String getLiteralSystemId() { return locator.getSystemId(); }
- public String getPublicId() { return locator.getPublicId(); }
- public String getEncoding() { return null; }
-
- /**
- * <p>Returns the character offset,
- * or <code>-1</code>,
- * if no character offset is available.<p>
- *
- * <p>As this information is not available from
- * {@link org.xml.sax.Locator},
- * always return <code>-1</code>.</p>
- */
- public int getCharacterOffset() {
- return -1;
- }
-
- /**
- * <p>Returns the XML version of the current entity.</p>
- *
- * <p>As this information is not available from
- * {@link org.xml.sax.Locator},
- * always return <code>null</code>.</p>
- */
- public String getXMLVersion() {
- return null;
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/util/MessageFormatter.java b/src/com/sun/org/apache/xerces/internal/util/MessageFormatter.java
deleted file mode 100644
index f55ba5e..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/MessageFormatter.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.util;
-
-import java.util.Locale;
-import java.util.MissingResourceException;
-
-/**
- * This interface provides a generic message formatting mechanism and
- * is useful for producing messages that must be localed and/or formatted
- * with replacement text.
- *
- * @see com.sun.org.apache.xerces.internal.impl.XMLErrorReporter
- *
- * @author Andy Clark
- *
- */
-public interface MessageFormatter {
-
- //
- // MessageFormatter methods
- //
-
- /**
- * Formats a message with the specified arguments using the given
- * locale information.
- *
- * @param locale The locale of the message.
- * @param key The message key.
- * @param arguments The message replacement text arguments. The order
- * of the arguments must match that of the placeholders
- * in the actual message.
- *
- * @return Returns the formatted message.
- *
- * @throws MissingResourceException Thrown if the message with the
- * specified key cannot be found.
- */
- public String formatMessage(Locale locale, String key, Object[] arguments)
- throws MissingResourceException;
-
-} // interface MessageFormatter
diff --git a/src/com/sun/org/apache/xerces/internal/util/NamespaceContextWrapper.java b/src/com/sun/org/apache/xerces/internal/util/NamespaceContextWrapper.java
deleted file mode 100644
index 2143159..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/NamespaceContextWrapper.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.org.apache.xerces.internal.util;
-
-import java.util.Enumeration;
-import java.util.Vector;
-import javax.xml.namespace.NamespaceContext;
-
-/**
- * Writing a wrapper to re-use most of the namespace functionality
- * already provided by NamespaceSupport, which implements NamespaceContext
- * from XNI. It would be good if we can change the XNI NamespaceContext
- * interface to implement the JAXP NamespaceContext interface.
- *
- * Note that NamespaceSupport assumes the use of symbols. Since this class
- * can be exposed to the application, we must intern all Strings before
- * calling NamespaceSupport methods.
- *
- * @author Neeraj Bajaj, Sun Microsystems, inc.
- * @author Santiago.PericasGeertsen@sun.com
- *
- */
-public class NamespaceContextWrapper implements NamespaceContext {
-
- private com.sun.org.apache.xerces.internal.xni.NamespaceContext fNamespaceContext;
-
- public NamespaceContextWrapper(NamespaceSupport namespaceContext) {
- fNamespaceContext = namespaceContext ;
- }
-
- public String getNamespaceURI(String prefix) {
- if (prefix == null) {
- throw new IllegalArgumentException("Prefix can't be null");
- }
- return fNamespaceContext.getURI(prefix.intern());
- }
-
- public String getPrefix(String namespaceURI) {
- if (namespaceURI == null) {
- throw new IllegalArgumentException("URI can't be null.");
- }
- return fNamespaceContext.getPrefix(namespaceURI.intern());
- }
-
- /**
- * TODO: Namespace doesn't give information giving multiple prefixes for
- * the same namespaceURI.
- */
- public java.util.Iterator getPrefixes(String namespaceURI) {
- if (namespaceURI == null) {
- throw new IllegalArgumentException("URI can't be null.");
- }
- else {
- Vector vector =
- ((NamespaceSupport) fNamespaceContext).getPrefixes(namespaceURI.intern());
- return vector.iterator();
- }
- }
-
- /**
- * This method supports all functions in the NamespaceContext utility class
- */
- public com.sun.org.apache.xerces.internal.xni.NamespaceContext getNamespaceContext() {
- return fNamespaceContext;
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/util/NamespaceSupport.java b/src/com/sun/org/apache/xerces/internal/util/NamespaceSupport.java
deleted file mode 100644
index 2cd632c..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/NamespaceSupport.java
+++ /dev/null
@@ -1,484 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2000-2002 The Apache Software Foundation.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package com.sun.org.apache.xerces.internal.util;
-
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import java.util.Vector;
-
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-
-/**
- * Namespace support for XML document handlers. This class doesn't
- * perform any error checking and assumes that all strings passed
- * as arguments to methods are unique symbols. The SymbolTable class
- * can be used for this purpose.
- *
- * @author Andy Clark, IBM
- *
- */
-public class NamespaceSupport implements NamespaceContext {
-
- //
- // Data
- //
-
- /**
- * Namespace binding information. This array is composed of a
- * series of tuples containing the namespace binding information:
- * &lt;prefix, uri&gt;. The default size can be set to anything
- * as long as it is a power of 2 greater than 1.
- *
- * @see #fNamespaceSize
- * @see #fContext
- */
- protected String[] fNamespace = new String[16 * 2];
-
- /** The top of the namespace information array. */
- protected int fNamespaceSize;
-
- // NOTE: The constructor depends on the initial context size
- // being at least 1. -Ac
-
- /**
- * Context indexes. This array contains indexes into the namespace
- * information array. The index at the current context is the start
- * index of declared namespace bindings and runs to the size of the
- * namespace information array.
- *
- * @see #fNamespaceSize
- */
- protected int[] fContext = new int[8];
-
- /** The current context. */
- protected int fCurrentContext;
-
- protected String[] fPrefixes = new String[16];
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- public NamespaceSupport() {
- } // <init>()
-
- /**
- * Constructs a namespace context object and initializes it with
- * the prefixes declared in the specified context.
- */
- public NamespaceSupport(NamespaceContext context) {
- pushContext();
- // copy declaration in the context
- Enumeration prefixes = context.getAllPrefixes();
- while (prefixes.hasMoreElements()){
- String prefix = (String)prefixes.nextElement();
- String uri = context.getURI(prefix);
- declarePrefix(prefix, uri);
- }
- } // <init>(NamespaceContext)
-
-
- //
- // Public methods
- //
-
- /**
- * @see com.sun.org.apache.xerces.internal.xni.NamespaceContext#reset()
- */
- public void reset() {
-
- // reset namespace and context info
- fNamespaceSize = 0;
- fCurrentContext = 0;
-
-
- // bind "xml" prefix to the XML uri
- fNamespace[fNamespaceSize++] = XMLSymbols.PREFIX_XML;
- fNamespace[fNamespaceSize++] = NamespaceContext.XML_URI;
- // bind "xmlns" prefix to the XMLNS uri
- fNamespace[fNamespaceSize++] = XMLSymbols.PREFIX_XMLNS;
- fNamespace[fNamespaceSize++] = NamespaceContext.XMLNS_URI;
-
- fContext[fCurrentContext] = fNamespaceSize;
- //++fCurrentContext;
-
- } // reset(SymbolTable)
-
-
- /**
- * @see com.sun.org.apache.xerces.internal.xni.NamespaceContext#pushContext()
- */
- public void pushContext() {
-
- // extend the array, if necessary
- if (fCurrentContext + 1 == fContext.length) {
- int[] contextarray = new int[fContext.length * 2];
- System.arraycopy(fContext, 0, contextarray, 0, fContext.length);
- fContext = contextarray;
- }
-
- // push context
- fContext[++fCurrentContext] = fNamespaceSize;
- //System.out.println("calling push context, current context = " + fCurrentContext);
- } // pushContext()
-
-
- /**
- * @see com.sun.org.apache.xerces.internal.xni.NamespaceContext#popContext()
- */
- public void popContext() {
- fNamespaceSize = fContext[fCurrentContext--];
- //System.out.println("Calling popContext, fCurrentContext = " + fCurrentContext);
- } // popContext()
-
- /**
- * @see com.sun.org.apache.xerces.internal.xni.NamespaceContext#declarePrefix(String, String)
- */
- public boolean declarePrefix(String prefix, String uri) {
- // ignore "xml" and "xmlns" prefixes
- if (prefix == XMLSymbols.PREFIX_XML || prefix == XMLSymbols.PREFIX_XMLNS) {
- return false;
- }
-
- // see if prefix already exists in current context
- for (int i = fNamespaceSize; i > fContext[fCurrentContext]; i -= 2) {
- if (fNamespace[i - 2] == prefix) {
- // REVISIT: [Q] Should the new binding override the
- // previously declared binding or should it
- // it be ignored? -Ac
- // NOTE: The SAX2 "NamespaceSupport" helper allows
- // re-bindings with the new binding overwriting
- // the previous binding. -Ac
- fNamespace[i - 1] = uri;
- return true;
- }
- }
-
- // resize array, if needed
- if (fNamespaceSize == fNamespace.length) {
- String[] namespacearray = new String[fNamespaceSize * 2];
- System.arraycopy(fNamespace, 0, namespacearray, 0, fNamespaceSize);
- fNamespace = namespacearray;
- }
-
- // bind prefix to uri in current context
- fNamespace[fNamespaceSize++] = prefix;
- fNamespace[fNamespaceSize++] = uri;
-
- return true;
-
- } // declarePrefix(String,String):boolean
-
- /**
- * @see com.sun.org.apache.xerces.internal.xni.NamespaceContext#getURI(String)
- */
- public String getURI(String prefix) {
-
- // find prefix in current context
- for (int i = fNamespaceSize; i > 0; i -= 2) {
- if (fNamespace[i - 2] == prefix) {
- return fNamespace[i - 1];
- }
- }
-
- // prefix not found
- return null;
-
- } // getURI(String):String
-
-
- /**
- * @see com.sun.org.apache.xerces.internal.xni.NamespaceContext#getPrefix(String)
- */
- public String getPrefix(String uri) {
-
- // find uri in current context
- for (int i = fNamespaceSize; i > 0; i -= 2) {
- if (fNamespace[i - 1] == uri) {
- if (getURI(fNamespace[i - 2]) == uri)
- return fNamespace[i - 2];
- }
- }
-
- // uri not found
- return null;
-
- } // getPrefix(String):String
-
- /**
- * @see com.sun.org.apache.xerces.internal.xni.NamespaceContext#getDeclaredPrefixCount()
- */
- public int getDeclaredPrefixCount() {
- return (fNamespaceSize - fContext[fCurrentContext]) / 2;
- } // getDeclaredPrefixCount():int
-
- /**
- * @see com.sun.org.apache.xerces.internal.xni.NamespaceContext#getDeclaredPrefixAt(int)
- */
- public String getDeclaredPrefixAt(int index) {
- return fNamespace[fContext[fCurrentContext] + index * 2];
- } // getDeclaredPrefixAt(int):String
-
- public Iterator getPrefixes(){
- int count = 0;
- if (fPrefixes.length < (fNamespace.length/2)) {
- // resize prefix array
- String[] prefixes = new String[fNamespaceSize];
- fPrefixes = prefixes;
- }
- String prefix = null;
- boolean unique = true;
- for (int i = 2; i < (fNamespaceSize-2); i += 2) {
- prefix = fNamespace[i + 2];
- for (int k=0;k<count;k++){
- if (fPrefixes[k]==prefix){
- unique = false;
- break;
- }
- }
- if (unique){
- fPrefixes[count++] = prefix;
- }
- unique = true;
- }
- return new IteratorPrefixes(fPrefixes, count);
- }//getPrefixes
- /**
- * @see com.sun.org.apache.xerces.internal.xni.NamespaceContext#getAllPrefixes()
- */
- public Enumeration getAllPrefixes() {
- int count = 0;
- if (fPrefixes.length < (fNamespace.length/2)) {
- // resize prefix array
- String[] prefixes = new String[fNamespaceSize];
- fPrefixes = prefixes;
- }
- String prefix = null;
- boolean unique = true;
- for (int i = 2; i < (fNamespaceSize-2); i += 2) {
- prefix = fNamespace[i + 2];
- for (int k=0;k<count;k++){
- if (fPrefixes[k]==prefix){
- unique = false;
- break;
- }
- }
- if (unique){
- fPrefixes[count++] = prefix;
- }
- unique = true;
- }
- return new Prefixes(fPrefixes, count);
- }
-
- public Vector getPrefixes(String uri){
- int count = 0;
- String prefix = null;
- boolean unique = true;
- Vector prefixList = new Vector();
- for (int i = fNamespaceSize; i >0 ; i -= 2) {
- if(fNamespace[i-1] == uri){
- if(!prefixList.contains(fNamespace[i-2]))
- prefixList.add(fNamespace[i-2]);
- }
- }
- return prefixList;
- }
-
- /*
- * non-NamespaceContext methods
- */
-
- /**
- * Checks whether a binding or unbinding for
- * the given prefix exists in the context.
- *
- * @param prefix The prefix to look up.
- *
- * @return true if the given prefix exists in the context
- */
- public boolean containsPrefix(String prefix) {
-
- // find prefix in context
- for (int i = fNamespaceSize; i > 0; i -= 2) {
- if (fNamespace[i - 2] == prefix) {
- return true;
- }
- }
-
- // prefix not found
- return false;
- }
-
- /**
- * Checks whether a binding or unbinding for
- * the given prefix exists in the current context.
- *
- * @param prefix The prefix to look up.
- *
- * @return true if the given prefix exists in the current context
- */
- public boolean containsPrefixInCurrentContext(String prefix) {
-
- // find prefix in current context
- for (int i = fContext[fCurrentContext]; i < fNamespaceSize; i += 2) {
- if (fNamespace[i] == prefix) {
- return true;
- }
- }
-
- // prefix not found
- return false;
- }
-
- protected final class IteratorPrefixes implements Iterator {
- private String[] prefixes;
- private int counter = 0;
- private int size = 0;
-
- /**
- * Constructor for Prefixes.
- */
- public IteratorPrefixes(String [] prefixes, int size) {
- this.prefixes = prefixes;
- this.size = size;
- }
-
- /**
- * @see java.util.Enumeration#hasMoreElements()
- */
- public boolean hasNext() {
- return (counter < size);
- }
-
- /**
- * @see java.util.Enumeration#nextElement()
- */
- public Object next() {
- if (counter< size){
- return fPrefixes[counter++];
- }
- throw new NoSuchElementException("Illegal access to Namespace prefixes enumeration.");
- }
-
- public String toString(){
- StringBuffer buf = new StringBuffer();
- for (int i=0;i<size;i++){
- buf.append(prefixes[i]);
- buf.append(" ");
- }
-
- return buf.toString();
- }
-
- public void remove(){
- throw new UnsupportedOperationException();
- }
- }
-
-
- protected final class Prefixes implements Enumeration {
- private String[] prefixes;
- private int counter = 0;
- private int size = 0;
-
- /**
- * Constructor for Prefixes.
- */
- public Prefixes(String [] prefixes, int size) {
- this.prefixes = prefixes;
- this.size = size;
- }
-
- /**
- * @see java.util.Enumeration#hasMoreElements()
- */
- public boolean hasMoreElements() {
- return (counter< size);
- }
-
- /**
- * @see java.util.Enumeration#nextElement()
- */
- public Object nextElement() {
- if (counter< size){
- return fPrefixes[counter++];
- }
- throw new NoSuchElementException("Illegal access to Namespace prefixes enumeration.");
- }
-
- public String toString(){
- StringBuffer buf = new StringBuffer();
- for (int i=0;i<size;i++){
- buf.append(prefixes[i]);
- buf.append(" ");
- }
-
- return buf.toString();
- }
-
-
- }
-
-} // class NamespaceSupport
diff --git a/src/com/sun/org/apache/xerces/internal/util/ParserConfigurationSettings.java b/src/com/sun/org/apache/xerces/internal/util/ParserConfigurationSettings.java
deleted file mode 100644
index a13d815..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/ParserConfigurationSettings.java
+++ /dev/null
@@ -1,332 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.util;
-
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-
-/**
- * This class implements the basic operations for managing parser
- * configuration features and properties. This utility class can
- * be used as a base class for parser configurations or separately
- * to encapsulate a number of parser settings as a component
- * manager.
- * <p>
- * This class can be constructed with a "parent" settings object
- * (in the form of an <code>XMLComponentManager</code>) that allows
- * parser configuration settings to be "chained" together.
- *
- * @author Andy Clark, IBM
- *
- * @version $Id: ParserConfigurationSettings.java,v 1.6 2010-11-01 04:40:14 joehw Exp $
- */
-public class ParserConfigurationSettings
- implements XMLComponentManager {
-
- protected static final String PARSER_SETTINGS =
- Constants.XERCES_FEATURE_PREFIX + Constants.PARSER_SETTINGS;
-
- //
- // Data
- //
-
- // data
-
- /** Recognized properties. */
- protected Set<String> fRecognizedProperties;
-
- /** Properties. */
- protected Map<String, Object> fProperties;
-
- /** Recognized features. */
- protected Set<String> fRecognizedFeatures;
-
- /** Features. */
- protected Map<String, Boolean> fFeatures;
-
- /** Parent parser configuration settings. */
- protected XMLComponentManager fParentSettings;
-
- //
- // Constructors
- //
-
- /** Default Constructor. */
- public ParserConfigurationSettings() {
- this(null);
- } // <init>()
-
- /**
- * Constructs a parser configuration settings object with a
- * parent settings object.
- */
- public ParserConfigurationSettings(XMLComponentManager parent) {
-
- // create storage for recognized features and properties
- fRecognizedFeatures = new HashSet<String>();
- fRecognizedProperties = new HashSet<String>();
-
- // create table for features and properties
- fFeatures = new HashMap<String, Boolean>();
- fProperties = new HashMap<String, Object>();
-
- // save parent
- fParentSettings = parent;
-
- } // <init>(XMLComponentManager)
-
- //
- // XMLParserConfiguration methods
- //
-
- /**
- * Allows a parser to add parser specific features to be recognized
- * and managed by the parser configuration.
- *
- * @param featureIds An array of the additional feature identifiers
- * to be recognized.
- */
- public void addRecognizedFeatures(String[] featureIds) {
-
- // add recognized features
- int featureIdsCount = featureIds != null ? featureIds.length : 0;
- for (int i = 0; i < featureIdsCount; i++) {
- String featureId = featureIds[i];
- if (!fRecognizedFeatures.contains(featureId)) {
- fRecognizedFeatures.add(featureId);
- }
- }
-
- } // addRecognizedFeatures(String[])
-
- /**
- * Set the state of a feature.
- *
- * Set the state of any feature in a SAX2 parser. The parser
- * might not recognize the feature, and if it does recognize
- * it, it might not be able to fulfill the request.
- *
- * @param featureId The unique identifier (URI) of the feature.
- * @param state The requested state of the feature (true or false).
- *
- * @exception com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException If the
- * requested feature is not known.
- */
- public void setFeature(String featureId, boolean state)
- throws XMLConfigurationException {
-
- // check and store
- FeatureState checkState = checkFeature(featureId);
- if (checkState.isExceptional()) {
- throw new XMLConfigurationException(checkState.status, featureId);
- }
-
- fFeatures.put(featureId, state);
- } // setFeature(String,boolean)
-
- /**
- * Allows a parser to add parser specific properties to be recognized
- * and managed by the parser configuration.
- *
- * @param propertyIds An array of the additional property identifiers
- * to be recognized.
- */
- public void addRecognizedProperties(String[] propertyIds) {
- fRecognizedProperties.addAll(Arrays.asList(propertyIds));
- } // addRecognizedProperties(String[])
-
- /**
- * setProperty
- *
- * @param propertyId
- * @param value
- * @exception com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException If the
- * requested feature is not known.
- */
- public void setProperty(String propertyId, Object value)
- throws XMLConfigurationException {
-
- // check and store
- PropertyState checkState = checkProperty(propertyId);
- if (checkState.isExceptional()) {
- throw new XMLConfigurationException(checkState.status, propertyId);
- }
- fProperties.put(propertyId, value);
-
- } // setProperty(String,Object)
-
- //
- // XMLComponentManager methods
- //
-
- /**
- * Returns the state of a feature.
- *
- * @param featureId The feature identifier.
- * @return true if the feature is supported
- *
- * @throws XMLConfigurationException Thrown for configuration error.
- * In general, components should
- * only throw this exception if
- * it is <strong>really</strong>
- * a critical error.
- */
- public final boolean getFeature(String featureId)
- throws XMLConfigurationException {
-
- FeatureState state = getFeatureState(featureId);
- if (state.isExceptional()) {
- throw new XMLConfigurationException(state.status, featureId);
- }
- return state.state;
- } // getFeature(String):boolean
-
- public final boolean getFeature(String featureId, boolean defaultValue) {
- FeatureState state = getFeatureState(featureId);
- if (state.isExceptional()) {
- return defaultValue;
- }
- return state.state;
- }
-
- public FeatureState getFeatureState(String featureId) {
- Boolean state = (Boolean) fFeatures.get(featureId);
-
- if (state == null) {
- FeatureState checkState = checkFeature(featureId);
- if (checkState.isExceptional()) {
- return checkState;
- }
- return FeatureState.is(false);
- }
- return FeatureState.is(state);
- }
-
- /**
- * Returns the value of a property.
- *
- * @param propertyId The property identifier.
- * @return the value of the property
- *
- * @throws XMLConfigurationException Thrown for configuration error.
- * In general, components should
- * only throw this exception if
- * it is <strong>really</strong>
- * a critical error.
- */
- public final Object getProperty(String propertyId)
- throws XMLConfigurationException {
-
- PropertyState state = getPropertyState(propertyId);
- if (state.isExceptional()) {
- throw new XMLConfigurationException(state.status, propertyId);
- }
-
- return state.state;
- } // getProperty(String):Object
-
- public final Object getProperty(String propertyId, Object defaultValue) {
- PropertyState state = getPropertyState(propertyId);
- if (state.isExceptional()) {
- return defaultValue;
- }
-
- return state.state;
- }
-
- public PropertyState getPropertyState(String propertyId) {
- Object propertyValue = fProperties.get(propertyId);
-
- if (propertyValue == null) {
- PropertyState state = checkProperty(propertyId);
- if (state.isExceptional()) {
- return state;
- }
- }
-
- return PropertyState.is(propertyValue);
- }
-
- //
- // Protected methods
- //
-
- /**
- * Check a feature. If feature is known and supported, this method simply
- * returns. Otherwise, the appropriate exception is thrown.
- *
- * @param featureId The unique identifier (URI) of the feature.
- *
- * @exception com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException If the
- * requested feature is not known.
- */
- protected FeatureState checkFeature(String featureId)
- throws XMLConfigurationException {
-
- // check feature
- if (!fRecognizedFeatures.contains(featureId)) {
- if (fParentSettings != null) {
- return fParentSettings.getFeatureState(featureId);
- }
- else {
- return FeatureState.NOT_RECOGNIZED;
- }
- }
-
- // TODO: reasonable default?
- return FeatureState.RECOGNIZED;
- } // checkFeature(String)
-
- /**
- * Check a property. If the property is known and supported, this method
- * simply returns. Otherwise, the appropriate exception is thrown.
- *
- * @param propertyId The unique identifier (URI) of the property
- * being set.
- * @exception com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException If the
- * requested feature is not known.
- */
- protected PropertyState checkProperty(String propertyId)
- throws XMLConfigurationException {
-
- // check property
- if (!fRecognizedProperties.contains(propertyId)) {
- if (fParentSettings != null) {
- PropertyState state = fParentSettings.getPropertyState(propertyId);
- if (state.isExceptional()) {
- return state;
- }
- }
- else {
- return PropertyState.NOT_RECOGNIZED;
- }
- }
- return PropertyState.RECOGNIZED;
- } // checkProperty(String)
-
-} // class ParserConfigurationSettings
diff --git a/src/com/sun/org/apache/xerces/internal/util/PrimeNumberSequenceGenerator.java b/src/com/sun/org/apache/xerces/internal/util/PrimeNumberSequenceGenerator.java
deleted file mode 100644
index 2dd9548..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/PrimeNumberSequenceGenerator.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xerces.internal.util;
-
-import java.util.Random;
-
- /**
- * Fills an array with a random sequence of prime numbers.
- */
-final class PrimeNumberSequenceGenerator {
-
- private static final int [] PRIMES = {
- 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59,
- 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137,
- 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227,
- 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313,
- 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419,
- 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509,
- 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617,
- 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727};
-
- static void generateSequence(int[] arrayToFill) {
- Random r = new Random();
- for (int i = 0; i < arrayToFill.length; i++) {
- arrayToFill[i] = PRIMES[r.nextInt(PRIMES.length)];
- }
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/util/PropertyState.java b/src/com/sun/org/apache/xerces/internal/util/PropertyState.java
deleted file mode 100644
index 5e133ca..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/PropertyState.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- */
-
-/*
- * $Id: PropertyState.java 3024 2011-03-01 03:46:13Z joehw $
- */
-package com.sun.org.apache.xerces.internal.util;
-
-public class PropertyState {
-
- public final Status status;
- public final Object state;
-
- public static final PropertyState UNKNOWN = new PropertyState(Status.UNKNOWN, null);
- public static final PropertyState RECOGNIZED = new PropertyState(Status.RECOGNIZED, null);
- public static final PropertyState NOT_SUPPORTED = new PropertyState(Status.NOT_SUPPORTED, null);
- public static final PropertyState NOT_RECOGNIZED = new PropertyState(Status.NOT_RECOGNIZED, null);
- public static final PropertyState NOT_ALLOWED = new PropertyState(Status.NOT_ALLOWED, null);
-
-
- public PropertyState(Status status, Object state) {
- this.status = status;
- this.state = state;
- }
-
- public static PropertyState of(Status status) {
- return new PropertyState(status, null);
- }
-
- public static PropertyState is(Object value) {
- return new PropertyState(Status.SET, value);
- }
-
- public boolean isExceptional() {
- return this.status.isExceptional();
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/util/SAX2XNI.java b/src/com/sun/org/apache/xerces/internal/util/SAX2XNI.java
deleted file mode 100644
index b0017e6..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/SAX2XNI.java
+++ /dev/null
@@ -1,256 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2000-2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package com.sun.org.apache.xerces.internal.util;
-
-import com.sun.org.apache.xerces.internal.impl.xs.util.SimpleLocator;
-import com.sun.org.apache.xerces.internal.jaxp.validation.WrappedSAXException;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
-import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLLocator;
-import com.sun.org.apache.xerces.internal.xni.XMLString;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource;
-import org.xml.sax.Attributes;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-/**
- * Receves SAX {@link ContentHandler} events
- * and produces the equivalent {@link XMLDocumentHandler} events.
- *
- * @author
- * Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
- */
-public class SAX2XNI implements ContentHandler, XMLDocumentSource {
- public SAX2XNI( XMLDocumentHandler core ) {
- this.fCore = core;
- }
-
- private XMLDocumentHandler fCore;
-
- private final NamespaceSupport nsContext = new NamespaceSupport();
- private final SymbolTable symbolTable = new SymbolTable();
-
-
- public void setDocumentHandler(XMLDocumentHandler handler) {
- fCore = handler;
- }
-
- public XMLDocumentHandler getDocumentHandler() {
- return fCore;
- }
-
-
- //
- //
- // ContentHandler implementation
- //
- //
- public void startDocument() throws SAXException {
- try {
- nsContext.reset();
-
- XMLLocator xmlLocator;
- if(locator==null)
- // some SAX source doesn't provide a locator,
- // in which case we assume no line information is available
- // and use a dummy locator. With this, downstream components
- // can always assume that they will get a non-null Locator.
- xmlLocator=new SimpleLocator(null,null,-1,-1);
- else
- xmlLocator=new LocatorWrapper(locator);
-
- fCore.startDocument(
- xmlLocator,
- null,
- nsContext,
- null);
- } catch( WrappedSAXException e ) {
- throw e.exception;
- }
- }
-
- public void endDocument() throws SAXException {
- try {
- fCore.endDocument(null);
- } catch( WrappedSAXException e ) {
- throw e.exception;
- }
- }
-
- public void startElement( String uri, String local, String qname, Attributes att ) throws SAXException {
- try {
- fCore.startElement(createQName(uri,local,qname),createAttributes(att),null);
- } catch( WrappedSAXException e ) {
- throw e.exception;
- }
- }
-
- public void endElement( String uri, String local, String qname ) throws SAXException {
- try {
- fCore.endElement(createQName(uri,local,qname),null);
- } catch( WrappedSAXException e ) {
- throw e.exception;
- }
- }
-
- public void characters( char[] buf, int offset, int len ) throws SAXException {
- try {
- fCore.characters(new XMLString(buf,offset,len),null);
- } catch( WrappedSAXException e ) {
- throw e.exception;
- }
- }
-
- public void ignorableWhitespace( char[] buf, int offset, int len ) throws SAXException {
- try {
- fCore.ignorableWhitespace(new XMLString(buf,offset,len),null);
- } catch( WrappedSAXException e ) {
- throw e.exception;
- }
- }
-
- public void startPrefixMapping( String prefix, String uri ) {
- nsContext.pushContext();
- nsContext.declarePrefix(prefix,uri);
- }
-
- public void endPrefixMapping( String prefix ) {
- nsContext.popContext();
- }
-
- public void processingInstruction( String target, String data ) throws SAXException {
- try {
- fCore.processingInstruction(
- symbolize(target),createXMLString(data),null);
- } catch( WrappedSAXException e ) {
- throw e.exception;
- }
- }
-
- public void skippedEntity( String name ) {
- }
-
- private Locator locator;
- public void setDocumentLocator( Locator _loc ) {
- this.locator = _loc;
- }
-
- /** Creates a QName object. */
- private QName createQName(String uri, String local, String raw) {
-
- int idx = raw.indexOf(':');
-
- if( local.length()==0 ) {
- // if naemspace processing is turned off, local could be "".
- // in that case, treat everything to be in the no namespace.
- uri = "";
- if(idx<0)
- local = raw;
- else
- local = raw.substring(idx+1);
- }
-
- String prefix;
- if (idx < 0)
- prefix = null;
- else
- prefix = raw.substring(0, idx);
-
- if (uri != null && uri.length() == 0)
- uri = null; // XNI uses null whereas SAX uses the empty string
-
- return new QName(symbolize(prefix), symbolize(local), symbolize(raw), symbolize(uri));
- }
-
- /** Symbolizes the specified string. */
- private String symbolize(String s) {
- if (s == null)
- return null;
- else
- return symbolTable.addSymbol(s);
- }
-
- private XMLString createXMLString(String str) {
- // with my patch
- // return new XMLString(str);
-
- // for now
- return new XMLString(str.toCharArray(), 0, str.length());
- }
-
-
- /** only one instance of XMLAttributes is used. */
- private final XMLAttributes xa = new XMLAttributesImpl();
-
- /** Creates an XMLAttributes object. */
- private XMLAttributes createAttributes(Attributes att) {
- xa.removeAllAttributes();
- int len = att.getLength();
- for (int i = 0; i < len; i++)
- xa.addAttribute(
- createQName(att.getURI(i), att.getLocalName(i), att.getQName(i)),
- att.getType(i),
- att.getValue(i));
- return xa;
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/util/SAXInputSource.java b/src/com/sun/org/apache/xerces/internal/util/SAXInputSource.java
deleted file mode 100644
index 540440a..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/SAXInputSource.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.util;
-
-import java.io.InputStream;
-import java.io.Reader;
-
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-import org.xml.sax.InputSource;
-import org.xml.sax.XMLReader;
-
-/**
- * <p>An <code>XMLInputSource</code> analogue to <code>javax.xml.transform.sax.SAXSource</code>.</p>
- *
- */
-public final class SAXInputSource extends XMLInputSource {
-
- private XMLReader fXMLReader;
- private InputSource fInputSource;
-
- public SAXInputSource() {
- this(null);
- }
-
- public SAXInputSource(InputSource inputSource) {
- this(null, inputSource);
- }
-
- public SAXInputSource(XMLReader reader, InputSource inputSource) {
- super(inputSource != null ? inputSource.getPublicId() : null,
- inputSource != null ? inputSource.getSystemId() : null, null);
- if (inputSource != null) {
- setByteStream(inputSource.getByteStream());
- setCharacterStream(inputSource.getCharacterStream());
- setEncoding(inputSource.getEncoding());
- }
- fInputSource = inputSource;
- fXMLReader = reader;
- }
-
- public void setXMLReader(XMLReader reader) {
- fXMLReader = reader;
- }
-
- public XMLReader getXMLReader() {
- return fXMLReader;
- }
-
- public void setInputSource(InputSource inputSource) {
- if (inputSource != null) {
- setPublicId(inputSource.getPublicId());
- setSystemId(inputSource.getSystemId());
- setByteStream(inputSource.getByteStream());
- setCharacterStream(inputSource.getCharacterStream());
- setEncoding(inputSource.getEncoding());
- }
- else {
- setPublicId(null);
- setSystemId(null);
- setByteStream(null);
- setCharacterStream(null);
- setEncoding(null);
- }
- fInputSource = inputSource;
- }
-
- public InputSource getInputSource() {
- return fInputSource;
- }
-
- /**
- * Sets the public identifier.
- *
- * @param publicId The new public identifier.
- */
- public void setPublicId(String publicId) {
- super.setPublicId(publicId);
- if (fInputSource == null) {
- fInputSource = new InputSource();
- }
- fInputSource.setPublicId(publicId);
- } // setPublicId(String)
-
- /**
- * Sets the system identifier.
- *
- * @param systemId The new system identifier.
- */
- public void setSystemId(String systemId) {
- super.setSystemId(systemId);
- if (fInputSource == null) {
- fInputSource = new InputSource();
- }
- fInputSource.setSystemId(systemId);
- } // setSystemId(String)
-
- /**
- * Sets the byte stream. If the byte stream is not already opened
- * when this object is instantiated, then the code that opens the
- * stream should also set the byte stream on this object. Also, if
- * the encoding is auto-detected, then the encoding should also be
- * set on this object.
- *
- * @param byteStream The new byte stream.
- */
- public void setByteStream(InputStream byteStream) {
- super.setByteStream(byteStream);
- if (fInputSource == null) {
- fInputSource = new InputSource();
- }
- fInputSource.setByteStream(byteStream);
- } // setByteStream(InputStream)
-
- /**
- * Sets the character stream. If the character stream is not already
- * opened when this object is instantiated, then the code that opens
- * the stream should also set the character stream on this object.
- * Also, the encoding of the byte stream used by the reader should
- * also be set on this object, if known.
- *
- * @param charStream The new character stream.
- *
- * @see #setEncoding
- */
- public void setCharacterStream(Reader charStream) {
- super.setCharacterStream(charStream);
- if (fInputSource == null) {
- fInputSource = new InputSource();
- }
- fInputSource.setCharacterStream(charStream);
- } // setCharacterStream(Reader)
-
- /**
- * Sets the encoding of the stream.
- *
- * @param encoding The new encoding.
- */
- public void setEncoding(String encoding) {
- super.setEncoding(encoding);
- if (fInputSource == null) {
- fInputSource = new InputSource();
- }
- fInputSource.setEncoding(encoding);
- } // setEncoding(String)
-
-} // SAXInputSource
diff --git a/src/com/sun/org/apache/xerces/internal/util/SAXLocatorWrapper.java b/src/com/sun/org/apache/xerces/internal/util/SAXLocatorWrapper.java
deleted file mode 100644
index 5733845..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/SAXLocatorWrapper.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.util;
-
-import org.xml.sax.Locator;
-import org.xml.sax.ext.Locator2;
-
-import com.sun.org.apache.xerces.internal.xni.XMLLocator;
-
-/**
- * <p>A light wrapper around a SAX locator. This is useful
- * when bridging between SAX and XNI components.</p>
- *
- * @author Michael Glavassevich, IBM
- *
- */
-public final class SAXLocatorWrapper implements XMLLocator {
-
- private Locator fLocator = null;
- private Locator2 fLocator2 = null;
-
- public SAXLocatorWrapper() {}
-
- public void setLocator(Locator locator) {
- fLocator = locator;
- if (locator instanceof Locator2 || locator == null) {
- fLocator2 = (Locator2) locator;
- }
- }
-
- public Locator getLocator() {
- return fLocator;
- }
-
- /*
- * XMLLocator methods
- */
-
- public String getPublicId() {
- if (fLocator != null) {
- return fLocator.getPublicId();
- }
- return null;
- }
-
- public String getLiteralSystemId() {
- if (fLocator != null) {
- return fLocator.getSystemId();
- }
- return null;
- }
-
- public String getBaseSystemId() {
- return null;
- }
-
- public String getExpandedSystemId() {
- return getLiteralSystemId();
- }
-
- public int getLineNumber() {
- if (fLocator != null) {
- return fLocator.getLineNumber();
- }
- return -1;
- }
-
- public int getColumnNumber() {
- if (fLocator != null) {
- return fLocator.getColumnNumber();
- }
- return -1;
- }
-
- public int getCharacterOffset() {
- return -1;
- }
-
- public String getEncoding() {
- if (fLocator2 != null) {
- return fLocator2.getEncoding();
- }
- return null;
- }
-
- public String getXMLVersion() {
- if (fLocator2 != null) {
- return fLocator2.getXMLVersion();
- }
- return null;
- }
-
-} // SAXLocatorWrapper
diff --git a/src/com/sun/org/apache/xerces/internal/util/SAXMessageFormatter.java b/src/com/sun/org/apache/xerces/internal/util/SAXMessageFormatter.java
deleted file mode 100644
index 29648a6..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/SAXMessageFormatter.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xerces.internal.util;
-
-import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * Used to format SAX error messages using a specified locale.
- *
- * @author Michael Glavassevich, IBM
- *
- * @version $Id: SAXMessageFormatter.java,v 1.6 2010-11-01 04:40:14 joehw Exp $
- */
-public class SAXMessageFormatter {
-
- /**
- * Formats a message with the specified arguments using the given
- * locale information.
- *
- * @param locale The locale of the message.
- * @param key The message key.
- * @param arguments The message replacement text arguments. The order
- * of the arguments must match that of the placeholders
- * in the actual message.
- *
- * @return the formatted message.
- *
- * @throws MissingResourceException Thrown if the message with the
- * specified key cannot be found.
- */
- public static String formatMessage(Locale locale,
- String key, Object[] arguments)
- throws MissingResourceException {
-
- ResourceBundle resourceBundle = null;
- if (locale != null) {
- resourceBundle =
- SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.SAXMessages", locale);
- }
- else {
- resourceBundle =
- SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.SAXMessages");
- }
-
- // format message
- String msg;
- try {
- msg = resourceBundle.getString(key);
- if (arguments != null) {
- try {
- msg = java.text.MessageFormat.format(msg, arguments);
- }
- catch (Exception e) {
- msg = resourceBundle.getString("FormatFailed");
- msg += " " + resourceBundle.getString(key);
- }
- }
- }
-
- // error
- catch (MissingResourceException e) {
- msg = resourceBundle.getString("BadMessageKey");
- throw new MissingResourceException(key, msg, key);
- }
-
- // no message
- if (msg == null) {
- msg = key;
- if (arguments.length > 0) {
- StringBuffer str = new StringBuffer(msg);
- str.append('?');
- for (int i = 0; i < arguments.length; i++) {
- if (i > 0) {
- str.append('&');
- }
- str.append(String.valueOf(arguments[i]));
- }
- }
- }
- return msg;
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/util/SecurityManager.java b/src/com/sun/org/apache/xerces/internal/util/SecurityManager.java
deleted file mode 100644
index d916f5b..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/SecurityManager.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2003 The Apache Software Foundation.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package com.sun.org.apache.xerces.internal.util;
-import com.sun.org.apache.xerces.internal.impl.Constants;
-/**
- * This class is a container for parser settings that relate to
- * security, or more specifically, it is intended to be used to prevent denial-of-service
- * attacks from being launched against a system running Xerces.
- * Any component that is aware of a denial-of-service attack that can arise
- * from its processing of a certain kind of document may query its Component Manager
- * for the property (http://apache.org/xml/properties/security-manager)
- * whose value will be an instance of this class.
- * If no value has been set for the property, the component should proceed in the "usual" (spec-compliant)
- * manner. If a value has been set, then it must be the case that the component in
- * question needs to know what method of this class to query. This class
- * will provide defaults for all known security issues, but will also provide
- * setters so that those values can be tailored by applications that care.
- *
- * @author Neil Graham, IBM
- *
- */
-public final class SecurityManager {
-
- //
- // Constants
- //
-
- // default value for entity expansion limit
- private final static int DEFAULT_ENTITY_EXPANSION_LIMIT = 64000;
-
- /** Default value of number of nodes created. **/
- private final static int DEFAULT_MAX_OCCUR_NODE_LIMIT = 5000;
-
- //
- // Data
- //
-
- private final static int DEFAULT_ELEMENT_ATTRIBUTE_LIMIT = 10000;
-
- /** Entity expansion limit. **/
- private int entityExpansionLimit;
-
- /** W3C XML Schema maxOccurs limit. **/
- private int maxOccurLimit;
-
- private int fElementAttributeLimit;
- // default constructor. Establishes default values for
- // all known security holes.
- /**
- * Default constructor. Establishes default values
- * for known security vulnerabilities.
- */
- public SecurityManager() {
- entityExpansionLimit = DEFAULT_ENTITY_EXPANSION_LIMIT;
- maxOccurLimit = DEFAULT_MAX_OCCUR_NODE_LIMIT ;
- fElementAttributeLimit = DEFAULT_ELEMENT_ATTRIBUTE_LIMIT;
- //We are reading system properties only once ,
- //at the time of creation of this object ,
- readSystemProperties();
- }
-
- /**
- * <p>Sets the number of entity expansions that the
- * parser should permit in a document.</p>
- *
- * @param limit the number of entity expansions
- * permitted in a document
- */
- public void setEntityExpansionLimit(int limit) {
- entityExpansionLimit = limit;
- }
-
- /**
- * <p>Returns the number of entity expansions
- * that the parser permits in a document.</p>
- *
- * @return the number of entity expansions
- * permitted in a document
- */
- public int getEntityExpansionLimit() {
- return entityExpansionLimit;
- }
-
- /**
- * <p>Sets the limit of the number of content model nodes
- * that may be created when building a grammar for a W3C
- * XML Schema that contains maxOccurs attributes with values
- * other than "unbounded".</p>
- *
- * @param limit the maximum value for maxOccurs other
- * than "unbounded"
- */
- public void setMaxOccurNodeLimit(int limit){
- maxOccurLimit = limit;
- }
-
- /**
- * <p>Returns the limit of the number of content model nodes
- * that may be created when building a grammar for a W3C
- * XML Schema that contains maxOccurs attributes with values
- * other than "unbounded".</p>
- *
- * @return the maximum value for maxOccurs other
- * than "unbounded"
- */
- public int getMaxOccurNodeLimit(){
- return maxOccurLimit;
- }
-
- public int getElementAttrLimit(){
- return fElementAttributeLimit;
- }
-
- public void setElementAttrLimit(int limit){
- fElementAttributeLimit = limit;
- }
-
- private void readSystemProperties(){
-
- try {
- String value = System.getProperty(Constants.ENTITY_EXPANSION_LIMIT);
- if(value != null && !value.equals("")){
- entityExpansionLimit = Integer.parseInt(value);
- if (entityExpansionLimit < 0)
- entityExpansionLimit = DEFAULT_ENTITY_EXPANSION_LIMIT;
- }
- else
- entityExpansionLimit = DEFAULT_ENTITY_EXPANSION_LIMIT;
- }catch(Exception ex){}
-
- try {
- String value = System.getProperty(Constants.MAX_OCCUR_LIMIT);
- if(value != null && !value.equals("")){
- maxOccurLimit = Integer.parseInt(value);
- if (maxOccurLimit < 0)
- maxOccurLimit = DEFAULT_MAX_OCCUR_NODE_LIMIT;
- }
- else
- maxOccurLimit = DEFAULT_MAX_OCCUR_NODE_LIMIT;
- }catch(Exception ex){}
-
- try {
- String value = System.getProperty(Constants.ELEMENT_ATTRIBUTE_LIMIT);
- if(value != null && !value.equals("")){
- fElementAttributeLimit = Integer.parseInt(value);
- if ( fElementAttributeLimit < 0)
- fElementAttributeLimit = DEFAULT_ELEMENT_ATTRIBUTE_LIMIT;
- }
- else
- fElementAttributeLimit = DEFAULT_ELEMENT_ATTRIBUTE_LIMIT;
-
- }catch(Exception ex){}
-
- }
-
-} // class SecurityManager
diff --git a/src/com/sun/org/apache/xerces/internal/util/ShadowedSymbolTable.java b/src/com/sun/org/apache/xerces/internal/util/ShadowedSymbolTable.java
deleted file mode 100644
index 0550c50..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/ShadowedSymbolTable.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.util;
-
-
-/**
- * Shadowed symbol table.
- *
- * The table has a reference to the main symbol table and is
- * not allowed to add new symbols to the main symbol table.
- * New symbols are added to the shadow symbol table and are local
- * to the component using this table.
- *
- * @author Andy Clark IBM
- */
-
-public final class ShadowedSymbolTable
-extends SymbolTable {
-
- //
- // Data
- //
-
- /** Main symbol table. */
- protected SymbolTable fSymbolTable;
-
- //
- // Constructors
- //
-
- /** Constructs a shadow of the specified symbol table. */
- public ShadowedSymbolTable(SymbolTable symbolTable) {
- fSymbolTable = symbolTable;
- } // <init>(SymbolTable)
-
- //
- // SymbolTable methods
- //
-
- /**
- * Adds the specified symbol to the symbol table and returns a
- * reference to the unique symbol. If the symbol already exists,
- * the previous symbol reference is returned instead, in order
- * guarantee that symbol references remain unique.
- *
- * @param symbol The new symbol.
- */
- public String addSymbol(String symbol) {
-
- if (fSymbolTable.containsSymbol(symbol)) {
- return fSymbolTable.addSymbol(symbol);
- }
- return super.addSymbol(symbol);
-
- } // addSymbol(String)
-
- /**
- * Adds the specified symbol to the symbol table and returns a
- * reference to the unique symbol. If the symbol already exists,
- * the previous symbol reference is returned instead, in order
- * guarantee that symbol references remain unique.
- *
- * @param buffer The buffer containing the new symbol.
- * @param offset The offset into the buffer of the new symbol.
- * @param length The length of the new symbol in the buffer.
- */
- public String addSymbol(char[] buffer, int offset, int length) {
-
- if (fSymbolTable.containsSymbol(buffer, offset, length)) {
- return fSymbolTable.addSymbol(buffer, offset, length);
- }
- return super.addSymbol(buffer, offset, length);
-
- } // addSymbol(char[],int,int):String
-
- /**
- * Returns a hashcode value for the specified symbol. The value
- * returned by this method must be identical to the value returned
- * by the <code>hash(char[],int,int)</code> method when called
- * with the character array that comprises the symbol string.
- *
- * @param symbol The symbol to hash.
- */
- public int hash(String symbol) {
- return fSymbolTable.hash(symbol);
- } // hash(String):int
-
- /**
- * Returns a hashcode value for the specified symbol information.
- * The value returned by this method must be identical to the value
- * returned by the <code>hash(String)</code> method when called
- * with the string object created from the symbol information.
- *
- * @param buffer The character buffer containing the symbol.
- * @param offset The offset into the character buffer of the start
- * of the symbol.
- * @param length The length of the symbol.
- */
- public int hash(char[] buffer, int offset, int length) {
- return fSymbolTable.hash(buffer, offset, length);
- } // hash(char[],int,int):int
-
-} // class ShadowedSymbolTable
diff --git a/src/com/sun/org/apache/xerces/internal/util/StAXInputSource.java b/src/com/sun/org/apache/xerces/internal/util/StAXInputSource.java
deleted file mode 100644
index 24def72..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/StAXInputSource.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.util;
-
-import javax.xml.stream.XMLEventReader;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-
-/**
- * <p>An <code>XMLInputSource</code> analogue to <code>javax.xml.transform.stax.StAXSource</code>.</p>
- *
- * @version $Id: StAXInputSource.java,v 1.2 2010-10-26 23:01:17 joehw Exp $
- */
-public final class StAXInputSource extends XMLInputSource {
-
- private final XMLStreamReader fStreamReader;
- private final XMLEventReader fEventReader;
- private final boolean fConsumeRemainingContent;
-
- public StAXInputSource(XMLStreamReader source) {
- this(source, false);
- }
-
- public StAXInputSource(XMLStreamReader source, boolean consumeRemainingContent) {
- super(null, source.getLocation().getSystemId(), null);
- if (source == null) {
- throw new IllegalArgumentException("XMLStreamReader parameter cannot be null.");
- }
- fStreamReader = source;
- fEventReader = null;
- fConsumeRemainingContent = consumeRemainingContent;
- }
-
- public StAXInputSource(XMLEventReader source) {
- this(source, false);
- }
-
- public StAXInputSource(XMLEventReader source, boolean consumeRemainingContent) {
- super(null, getEventReaderSystemId(source), null);
- if (source == null) {
- throw new IllegalArgumentException("XMLEventReader parameter cannot be null.");
- }
- fStreamReader = null;
- fEventReader = source;
- fConsumeRemainingContent = consumeRemainingContent;
- }
-
- public XMLStreamReader getXMLStreamReader() {
- return fStreamReader;
- }
-
- public XMLEventReader getXMLEventReader() {
- return fEventReader;
- }
-
- public boolean shouldConsumeRemainingContent() {
- return fConsumeRemainingContent;
- }
-
- public void setSystemId(String systemId){
- throw new UnsupportedOperationException("Cannot set the system ID on a StAXInputSource");
- }
-
- private static String getEventReaderSystemId(XMLEventReader reader) {
- try {
- if (reader != null) {
- return reader.peek().getLocation().getSystemId();
- }
- }
- catch (XMLStreamException e) {}
- return null;
- }
-
-} // StAXInputSource
diff --git a/src/com/sun/org/apache/xerces/internal/util/StAXLocationWrapper.java b/src/com/sun/org/apache/xerces/internal/util/StAXLocationWrapper.java
deleted file mode 100644
index 566533d..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/StAXLocationWrapper.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.util;
-
-
-import javax.xml.stream.Location;
-
-import com.sun.org.apache.xerces.internal.xni.XMLLocator;
-
-/**
- * <p>A light wrapper around a StAX location. This is useful
- * when bridging between StAX and XNI components.</p>
- *
- * @author Michael Glavassevich, IBM
- *
- * @version $Id: StAXLocationWrapper.java,v 1.2 2010-10-26 23:01:13 joehw Exp $
- */
-public final class StAXLocationWrapper implements XMLLocator {
-
- private Location fLocation = null;
-
- public StAXLocationWrapper() {}
-
- public void setLocation(Location location) {
- fLocation = location;
- }
-
- public Location getLocation() {
- return fLocation;
- }
-
- /*
- * XMLLocator methods
- */
-
- public String getPublicId() {
- if (fLocation != null) {
- return fLocation.getPublicId();
- }
- return null;
- }
-
- public String getLiteralSystemId() {
- if (fLocation != null) {
- return fLocation.getSystemId();
- }
- return null;
- }
-
- public String getBaseSystemId() {
- return null;
- }
-
- public String getExpandedSystemId() {
- return getLiteralSystemId();
- }
-
- public int getLineNumber() {
- if (fLocation != null) {
- return fLocation.getLineNumber();
- }
- return -1;
- }
-
- public int getColumnNumber() {
- if (fLocation != null) {
- return fLocation.getColumnNumber();
- }
- return -1;
- }
-
- public int getCharacterOffset() {
- if (fLocation != null) {
- return fLocation.getCharacterOffset();
- }
- return -1;
- }
-
- public String getEncoding() {
- return null;
- }
-
- public String getXMLVersion() {
- return null;
- }
-
-} // StAXLocationWrapper
diff --git a/src/com/sun/org/apache/xerces/internal/util/Status.java b/src/com/sun/org/apache/xerces/internal/util/Status.java
deleted file mode 100644
index 5fdcc5e..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/Status.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- */
-
-/*
- * $Id: Status.java 3024 2011-03-01 03:46:13Z joehw $
- */
-package com.sun.org.apache.xerces.internal.util;
-
-public enum Status {
- SET((short)-3, false),
- UNKNOWN((short)-2, false),
- RECOGNIZED((short)-1, false),
- NOT_SUPPORTED((short)0, true),
- NOT_RECOGNIZED((short)1, true),
- NOT_ALLOWED((short)2, true),
- ;
-
- private final short type;
-
- private boolean isExceptional;
-
- Status(short type, boolean isExceptional) {
- this.type = type;
- this.isExceptional = isExceptional;
- }
-
- public short getType() {
- return type;
- }
-
- public boolean isExceptional() {
- return isExceptional;
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/util/SymbolHash.java b/src/com/sun/org/apache/xerces/internal/util/SymbolHash.java
deleted file mode 100644
index 2f16b36..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/SymbolHash.java
+++ /dev/null
@@ -1,329 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.util;
-
-
-/**
- * This class is an unsynchronized hash table primary used for String
- * to Object mapping.
- * <p>
- * The hash code uses the same algorithm as SymbolTable class.
- *
- * @author Elena Litani
- * @version $Id: SymbolHash.java,v 1.7 2010-11-01 04:40:14 joehw Exp $
- */
-public class SymbolHash {
-
- //
- // Constants
- //
-
- /** Default table size. */
- protected static final int TABLE_SIZE = 101;
-
- /** Maximum hash collisions per bucket. */
- protected static final int MAX_HASH_COLLISIONS = 40;
-
- protected static final int MULTIPLIERS_SIZE = 1 << 5;
- protected static final int MULTIPLIERS_MASK = MULTIPLIERS_SIZE - 1;
-
- //
- // Data
- //
-
- /** Actual table size **/
- protected int fTableSize;
-
- /** Buckets. */
- protected Entry[] fBuckets;
-
- /** Number of elements. */
- protected int fNum = 0;
-
- /**
- * Array of randomly selected hash function multipliers or <code>null</code>
- * if the default String.hashCode() function should be used.
- */
- protected int[] fHashMultipliers;
-
- //
- // Constructors
- //
-
- /** Constructs a key table with the default size. */
- public SymbolHash() {
- this(TABLE_SIZE);
- }
-
- /**
- * Constructs a key table with a given size.
- *
- * @param size the size of the key table.
- */
- public SymbolHash(int size) {
- fTableSize = size;
- fBuckets = new Entry[fTableSize];
- }
-
- //
- // Public methods
- //
-
- /**
- * Adds the key/value mapping to the key table. If the key already exists,
- * the previous value associated with this key is overwritten by the new
- * value.
- *
- * @param key
- * @param value
- */
- public void put(Object key, Object value) {
-
- // search for identical key
- int collisionCount = 0;
- final int hash = hash(key);
- int bucket = hash % fTableSize;
- for (Entry entry = fBuckets[bucket]; entry != null; entry = entry.next) {
- if (key.equals(entry.key)) {
- // replace old value
- entry.value = value;
- return;
- }
- ++collisionCount;
- }
-
- if (fNum >= fTableSize) {
- // Rehash the table if the number of entries
- // would exceed the number of buckets.
- rehash();
- bucket = hash % fTableSize;
- }
- else if (collisionCount >= MAX_HASH_COLLISIONS && key instanceof String) {
- // Select a new hash function and rehash the table if
- // MAX_HASH_COLLISIONS is exceeded.
- rebalance();
- bucket = hash(key) % fTableSize;
- }
-
- // create new entry
- Entry entry = new Entry(key, value, fBuckets[bucket]);
- fBuckets[bucket] = entry;
- ++fNum;
- }
-
- /**
- * Get the value associated with the given key.
- *
- * @param key
- * @return the value associated with the given key.
- */
- public Object get(Object key) {
- int bucket = hash(key) % fTableSize;
- Entry entry = search(key, bucket);
- if (entry != null) {
- return entry.value;
- }
- return null;
- }
-
- /**
- * Get the number of key/value pairs stored in this table.
- *
- * @return the number of key/value pairs stored in this table.
- */
- public int getLength() {
- return fNum;
- }
-
- /**
- * Add all values to the given array. The array must have enough entry.
- *
- * @param elements the array to store the elements
- * @param from where to start store element in the array
- * @return number of elements copied to the array
- */
- public int getValues(Object[] elements, int from) {
- for (int i=0, j=0; i<fTableSize && j<fNum; i++) {
- for (Entry entry = fBuckets[i]; entry != null; entry = entry.next) {
- elements[from+j] = entry.value;
- j++;
- }
- }
- return fNum;
- }
-
- /**
- * Return key/value pairs of all entries in the map
- */
- public Object[] getEntries() {
- Object[] entries = new Object[fNum << 1];
- for (int i=0, j=0; i<fTableSize && j<fNum << 1; i++) {
- for (Entry entry = fBuckets[i]; entry != null; entry = entry.next) {
- entries[j] = entry.key;
- entries[++j] = entry.value;
- j++;
- }
- }
- return entries;
- }
-
- /**
- * Make a clone of this object.
- */
- public SymbolHash makeClone() {
- SymbolHash newTable = new SymbolHash(fTableSize);
- newTable.fNum = fNum;
- newTable.fHashMultipliers = fHashMultipliers != null ? (int[]) fHashMultipliers.clone() : null;
- for (int i = 0; i < fTableSize; i++) {
- if (fBuckets[i] != null) {
- newTable.fBuckets[i] = fBuckets[i].makeClone();
- }
- }
- return newTable;
- }
-
- /**
- * Remove all key/value association. This tries to save a bit of GC'ing
- * by at least keeping the fBuckets array around.
- */
- public void clear() {
- for (int i=0; i<fTableSize; i++) {
- fBuckets[i] = null;
- }
- fNum = 0;
- fHashMultipliers = null;
- } // clear(): void
-
- protected Entry search(Object key, int bucket) {
- // search for identical key
- for (Entry entry = fBuckets[bucket]; entry != null; entry = entry.next) {
- if (key.equals(entry.key))
- return entry;
- }
- return null;
- }
-
- /**
- * Returns a hashcode value for the specified key.
- *
- * @param key The key to hash.
- */
- protected int hash(Object key) {
- if (fHashMultipliers == null || !(key instanceof String)) {
- return key.hashCode() & 0x7FFFFFFF;
- }
- return hash0((String) key);
- } // hash(Object):int
-
- private int hash0(String symbol) {
- int code = 0;
- final int length = symbol.length();
- final int[] multipliers = fHashMultipliers;
- for (int i = 0; i < length; ++i) {
- code = code * multipliers[i & MULTIPLIERS_MASK] + symbol.charAt(i);
- }
- return code & 0x7FFFFFFF;
- } // hash0(String):int
-
- /**
- * Increases the capacity of and internally reorganizes this
- * SymbolHash, in order to accommodate and access its entries more
- * efficiently. This method is called automatically when the
- * number of keys in the SymbolHash exceeds its number of buckets.
- */
- protected void rehash() {
- rehashCommon((fBuckets.length << 1) + 1);
- }
-
- /**
- * Randomly selects a new hash function and reorganizes this SymbolHash
- * in order to more evenly distribute its entries across the table. This
- * method is called automatically when the number keys in one of the
- * SymbolHash's buckets exceeds MAX_HASH_COLLISIONS.
- */
- protected void rebalance() {
- if (fHashMultipliers == null) {
- fHashMultipliers = new int[MULTIPLIERS_SIZE];
- }
- PrimeNumberSequenceGenerator.generateSequence(fHashMultipliers);
- rehashCommon(fBuckets.length);
- }
-
- private void rehashCommon(final int newCapacity) {
-
- final int oldCapacity = fBuckets.length;
- final Entry[] oldTable = fBuckets;
-
- final Entry[] newTable = new Entry[newCapacity];
-
- fBuckets = newTable;
- fTableSize = fBuckets.length;
-
- for (int i = oldCapacity; i-- > 0;) {
- for (Entry old = oldTable[i]; old != null; ) {
- Entry e = old;
- old = old.next;
-
- int index = hash(e.key) % newCapacity;
- e.next = newTable[index];
- newTable[index] = e;
- }
- }
- }
-
- //
- // Classes
- //
-
- /**
- * This class is a key table entry. Each entry acts as a node
- * in a linked list.
- */
- protected static final class Entry {
- // key/value
- public Object key;
- public Object value;
- /** The next entry. */
- public Entry next;
-
- public Entry() {
- key = null;
- value = null;
- next = null;
- }
-
- public Entry(Object key, Object value, Entry next) {
- this.key = key;
- this.value = value;
- this.next = next;
- }
-
- public Entry makeClone() {
- Entry entry = new Entry();
- entry.key = key;
- entry.value = value;
- if (next != null)
- entry.next = next.makeClone();
- return entry;
- }
- } // entry
-
-} // class SymbolHash
diff --git a/src/com/sun/org/apache/xerces/internal/util/SymbolTable.java b/src/com/sun/org/apache/xerces/internal/util/SymbolTable.java
deleted file mode 100644
index 9eeef66..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/SymbolTable.java
+++ /dev/null
@@ -1,467 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.util;
-
-/**
- * This class is a symbol table implementation that guarantees that
- * strings used as identifiers are unique references. Multiple calls
- * to <code>addSymbol</code> will always return the same string
- * reference.
- * <p>
- * The symbol table performs the same task as <code>String.intern()</code>
- * with the following differences:
- * <ul>
- * <li>
- * A new string object does not need to be created in order to
- * retrieve a unique reference. Symbols can be added by using
- * a series of characters in a character array.
- * </li>
- * <li>
- * Users of the symbol table can provide their own symbol hashing
- * implementation. For example, a simple string hashing algorithm
- * may fail to produce a balanced set of hashcodes for symbols
- * that are <em>mostly</em> unique. Strings with similar leading
- * characters are especially prone to this poor hashing behavior.
- * </li>
- * </ul>
- *
- * @see SymbolHash
- *
- * @author Andy Clark
- *
- */
-public class SymbolTable {
-
- //
- // Constants
- //
-
- /** Default table size. */
- protected static final int TABLE_SIZE = 101;
-
- /** Maximum hash collisions per bucket for a table with load factor == 1. */
- protected static final int MAX_HASH_COLLISIONS = 40;
-
- protected static final int MULTIPLIERS_SIZE = 1 << 5;
- protected static final int MULTIPLIERS_MASK = MULTIPLIERS_SIZE - 1;
-
- //
- // Data
- //
-
- /** Buckets. */
- protected Entry[] fBuckets = null;
-
- /** actual table size */
- protected int fTableSize;
-
- /** The total number of entries in the hash table. */
- protected transient int fCount;
-
- /** The table is rehashed when its size exceeds this threshold. (The
- * value of this field is (int)(capacity * loadFactor).) */
- protected int fThreshold;
-
- /** The load factor for the SymbolTable. */
- protected float fLoadFactor;
-
- /**
- * A new hash function is selected and the table is rehashed when
- * the number of keys in the bucket exceeds this threshold.
- */
- protected final int fCollisionThreshold;
-
- /**
- * Array of randomly selected hash function multipliers or <code>null</code>
- * if the default String.hashCode() function should be used.
- */
- protected int[] fHashMultipliers;
-
- //
- // Constructors
- //
-
- /**
- * Constructs a new, empty SymbolTable with the specified initial
- * capacity and the specified load factor.
- *
- * @param initialCapacity the initial capacity of the SymbolTable.
- * @param loadFactor the load factor of the SymbolTable.
- * @throws IllegalArgumentException if the initial capacity is less
- * than zero, or if the load factor is nonpositive.
- */
- public SymbolTable(int initialCapacity, float loadFactor) {
-
- if (initialCapacity < 0) {
- throw new IllegalArgumentException("Illegal Capacity: " + initialCapacity);
- }
-
- if (loadFactor <= 0 || Float.isNaN(loadFactor)) {
- throw new IllegalArgumentException("Illegal Load: " + loadFactor);
- }
-
- if (initialCapacity == 0) {
- initialCapacity = 1;
- }
-
- fLoadFactor = loadFactor;
- fTableSize = initialCapacity;
- fBuckets = new Entry[fTableSize];
- fThreshold = (int)(fTableSize * loadFactor);
- fCollisionThreshold = (int)(MAX_HASH_COLLISIONS * loadFactor);
- fCount = 0;
- }
-
- /**
- * Constructs a new, empty SymbolTable with the specified initial capacity
- * and default load factor, which is <tt>0.75</tt>.
- *
- * @param initialCapacity the initial capacity of the hashtable.
- * @throws IllegalArgumentException if the initial capacity is less
- * than zero.
- */
- public SymbolTable(int initialCapacity) {
- this(initialCapacity, 0.75f);
- }
-
- /**
- * Constructs a new, empty SymbolTable with a default initial capacity (101)
- * and load factor, which is <tt>0.75</tt>.
- */
- public SymbolTable() {
- this(TABLE_SIZE, 0.75f);
- }
-
- //
- // Public methods
- //
-
- /**
- * Adds the specified symbol to the symbol table and returns a
- * reference to the unique symbol. If the symbol already exists,
- * the previous symbol reference is returned instead, in order
- * guarantee that symbol references remain unique.
- *
- * @param symbol The new symbol.
- */
- public String addSymbol(String symbol) {
-
- // search for identical symbol
- int collisionCount = 0;
- int bucket = hash(symbol) % fTableSize;
- for (Entry entry = fBuckets[bucket]; entry != null; entry = entry.next) {
- if (entry.symbol.equals(symbol)) {
- return entry.symbol;
- }
- ++collisionCount;
- }
- return addSymbol0(symbol, bucket, collisionCount);
-
- } // addSymbol(String):String
-
- private String addSymbol0(String symbol, int bucket, int collisionCount) {
-
- if (fCount >= fThreshold) {
- // Rehash the table if the threshold is exceeded
- rehash();
- bucket = hash(symbol) % fTableSize;
- }
- else if (collisionCount >= fCollisionThreshold) {
- // Select a new hash function and rehash the table if
- // the collision threshold is exceeded.
- rebalance();
- bucket = hash(symbol) % fTableSize;
- }
-
- // create new entry
- Entry entry = new Entry(symbol, fBuckets[bucket]);
- fBuckets[bucket] = entry;
- ++fCount;
- return entry.symbol;
-
- } // addSymbol0(String,int,int):String
-
- /**
- * Adds the specified symbol to the symbol table and returns a
- * reference to the unique symbol. If the symbol already exists,
- * the previous symbol reference is returned instead, in order
- * guarantee that symbol references remain unique.
- *
- * @param buffer The buffer containing the new symbol.
- * @param offset The offset into the buffer of the new symbol.
- * @param length The length of the new symbol in the buffer.
- */
- public String addSymbol(char[] buffer, int offset, int length) {
-
- // search for identical symbol
- int collisionCount = 0;
- int bucket = hash(buffer, offset, length) % fTableSize;
- OUTER: for (Entry entry = fBuckets[bucket]; entry != null; entry = entry.next) {
- if (length == entry.characters.length) {
- for (int i = 0; i < length; i++) {
- if (buffer[offset + i] != entry.characters[i]) {
- ++collisionCount;
- continue OUTER;
- }
- }
- return entry.symbol;
- }
- ++collisionCount;
- }
- return addSymbol0(buffer, offset, length, bucket, collisionCount);
-
- } // addSymbol(char[],int,int):String
-
- private String addSymbol0(char[] buffer, int offset, int length, int bucket, int collisionCount) {
-
- if (fCount >= fThreshold) {
- // Rehash the table if the threshold is exceeded
- rehash();
- bucket = hash(buffer, offset, length) % fTableSize;
- }
- else if (collisionCount >= fCollisionThreshold) {
- // Select a new hash function and rehash the table if
- // the collision threshold is exceeded.
- rebalance();
- bucket = hash(buffer, offset, length) % fTableSize;
- }
-
- // add new entry
- Entry entry = new Entry(buffer, offset, length, fBuckets[bucket]);
- fBuckets[bucket] = entry;
- ++fCount;
- return entry.symbol;
-
- } // addSymbol0(char[],int,int,int,int):String
-
- /**
- * Returns a hashcode value for the specified symbol. The value
- * returned by this method must be identical to the value returned
- * by the <code>hash(char[],int,int)</code> method when called
- * with the character array that comprises the symbol string.
- *
- * @param symbol The symbol to hash.
- */
- public int hash(String symbol) {
- if (fHashMultipliers == null) {
- return symbol.hashCode() & 0x7FFFFFFF;
- }
- return hash0(symbol);
- } // hash(String):int
-
- private int hash0(String symbol) {
- int code = 0;
- final int length = symbol.length();
- final int[] multipliers = fHashMultipliers;
- for (int i = 0; i < length; ++i) {
- code = code * multipliers[i & MULTIPLIERS_MASK] + symbol.charAt(i);
- }
- return code & 0x7FFFFFFF;
- } // hash0(String):int
-
- /**
- * Returns a hashcode value for the specified symbol information.
- * The value returned by this method must be identical to the value
- * returned by the <code>hash(String)</code> method when called
- * with the string object created from the symbol information.
- *
- * @param buffer The character buffer containing the symbol.
- * @param offset The offset into the character buffer of the start
- * of the symbol.
- * @param length The length of the symbol.
- */
- public int hash(char[] buffer, int offset, int length) {
- if (fHashMultipliers == null) {
- int code = 0;
- for (int i = 0; i < length; ++i) {
- code = code * 31 + buffer[offset + i];
- }
- return code & 0x7FFFFFFF;
- }
- return hash0(buffer, offset, length);
-
- } // hash(char[],int,int):int
-
- private int hash0(char[] buffer, int offset, int length) {
- int code = 0;
- final int[] multipliers = fHashMultipliers;
- for (int i = 0; i < length; ++i) {
- code = code * multipliers[i & MULTIPLIERS_MASK] + buffer[offset + i];
- }
- return code & 0x7FFFFFFF;
- } // hash0(char[],int,int):int
-
- /**
- * Increases the capacity of and internally reorganizes this
- * SymbolTable, in order to accommodate and access its entries more
- * efficiently. This method is called automatically when the
- * number of keys in the SymbolTable exceeds this hashtable's capacity
- * and load factor.
- */
- protected void rehash() {
- rehashCommon(fBuckets.length * 2 + 1);
- }
-
- /**
- * Randomly selects a new hash function and reorganizes this SymbolTable
- * in order to more evenly distribute its entries across the table. This
- * method is called automatically when the number keys in one of the
- * SymbolTable's buckets exceeds the given collision threshold.
- */
- protected void rebalance() {
- if (fHashMultipliers == null) {
- fHashMultipliers = new int[MULTIPLIERS_SIZE];
- }
- PrimeNumberSequenceGenerator.generateSequence(fHashMultipliers);
- rehashCommon(fBuckets.length);
- }
-
- private void rehashCommon(final int newCapacity) {
-
- int oldCapacity = fBuckets.length;
- Entry[] oldTable = fBuckets;
-
- Entry[] newTable = new Entry[newCapacity];
-
- fThreshold = (int)(newCapacity * fLoadFactor);
- fBuckets = newTable;
- fTableSize = fBuckets.length;
-
- for (int i = oldCapacity ; i-- > 0 ;) {
- for (Entry old = oldTable[i] ; old != null ; ) {
- Entry e = old;
- old = old.next;
-
- int index = hash(e.symbol) % newCapacity;
- e.next = newTable[index];
- newTable[index] = e;
- }
- }
- }
-
- /**
- * Returns true if the symbol table already contains the specified
- * symbol.
- *
- * @param symbol The symbol to look for.
- */
- public boolean containsSymbol(String symbol) {
-
- // search for identical symbol
- int bucket = hash(symbol) % fTableSize;
- int length = symbol.length();
- OUTER: for (Entry entry = fBuckets[bucket]; entry != null; entry = entry.next) {
- if (length == entry.characters.length) {
- for (int i = 0; i < length; i++) {
- if (symbol.charAt(i) != entry.characters[i]) {
- continue OUTER;
- }
- }
- return true;
- }
- }
-
- return false;
-
- } // containsSymbol(String):boolean
-
- /**
- * Returns true if the symbol table already contains the specified
- * symbol.
- *
- * @param buffer The buffer containing the symbol to look for.
- * @param offset The offset into the buffer.
- * @param length The length of the symbol in the buffer.
- */
- public boolean containsSymbol(char[] buffer, int offset, int length) {
-
- // search for identical symbol
- int bucket = hash(buffer, offset, length) % fTableSize;
- OUTER: for (Entry entry = fBuckets[bucket]; entry != null; entry = entry.next) {
- if (length == entry.characters.length) {
- for (int i = 0; i < length; i++) {
- if (buffer[offset + i] != entry.characters[i]) {
- continue OUTER;
- }
- }
- return true;
- }
- }
-
- return false;
-
- } // containsSymbol(char[],int,int):boolean
-
- //
- // Classes
- //
-
- /**
- * This class is a symbol table entry. Each entry acts as a node
- * in a linked list.
- */
- protected static final class Entry {
-
- //
- // Data
- //
-
- /** Symbol. */
- public final String symbol;
-
- /**
- * Symbol characters. This information is duplicated here for
- * comparison performance.
- */
- public final char[] characters;
-
- /** The next entry. */
- public Entry next;
-
- //
- // Constructors
- //
-
- /**
- * Constructs a new entry from the specified symbol and next entry
- * reference.
- */
- public Entry(String symbol, Entry next) {
- this.symbol = symbol.intern();
- characters = new char[symbol.length()];
- symbol.getChars(0, characters.length, characters, 0);
- this.next = next;
- }
-
- /**
- * Constructs a new entry from the specified symbol information and
- * next entry reference.
- */
- public Entry(char[] ch, int offset, int length, Entry next) {
- characters = new char[length];
- System.arraycopy(ch, offset, characters, 0, length);
- symbol = new String(characters).intern();
- this.next = next;
- }
-
- } // class Entry
-
-} // class SymbolTable
diff --git a/src/com/sun/org/apache/xerces/internal/util/SynchronizedSymbolTable.java b/src/com/sun/org/apache/xerces/internal/util/SynchronizedSymbolTable.java
deleted file mode 100644
index 02086ef..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/SynchronizedSymbolTable.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2000-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.util;
-
-/**
- * Synchronized symbol table.
- *
- * This class moved into the util package since it's needed by multiple
- * other classes (CachingParserPool, XMLGrammarCachingConfiguration).
- *
- * @author Andy Clark, IBM
- */
-
-public final class SynchronizedSymbolTable
- extends SymbolTable {
-
- //
- // Data
- //
-
- /** Main symbol table. */
- protected SymbolTable fSymbolTable;
-
- //
- // Constructors
- //
-
- /** Constructs a synchronized symbol table. */
- public SynchronizedSymbolTable(SymbolTable symbolTable) {
- fSymbolTable = symbolTable;
- } // <init>(SymbolTable)
-
- // construct synchronized symbol table of default size
- public SynchronizedSymbolTable() {
- fSymbolTable = new SymbolTable();
- } // init()
-
- // construct synchronized symbol table of given size
- public SynchronizedSymbolTable(int size) {
- fSymbolTable = new SymbolTable(size);
- } // init(int)
-
- //
- // SymbolTable methods
- //
-
- /**
- * Adds the specified symbol to the symbol table and returns a
- * reference to the unique symbol. If the symbol already exists,
- * the previous symbol reference is returned instead, in order
- * guarantee that symbol references remain unique.
- *
- * @param symbol The new symbol.
- */
- public String addSymbol(String symbol) {
-
- synchronized (fSymbolTable) {
- return fSymbolTable.addSymbol(symbol);
- }
-
- } // addSymbol(String)
-
- /**
- * Adds the specified symbol to the symbol table and returns a
- * reference to the unique symbol. If the symbol already exists,
- * the previous symbol reference is returned instead, in order
- * guarantee that symbol references remain unique.
- *
- * @param buffer The buffer containing the new symbol.
- * @param offset The offset into the buffer of the new symbol.
- * @param length The length of the new symbol in the buffer.
- */
- public String addSymbol(char[] buffer, int offset, int length) {
-
- synchronized (fSymbolTable) {
- return fSymbolTable.addSymbol(buffer, offset, length);
- }
-
- } // addSymbol(char[],int,int):String
-
- /**
- * Returns true if the symbol table already contains the specified
- * symbol.
- *
- * @param symbol The symbol to look for.
- */
- public boolean containsSymbol(String symbol) {
-
- synchronized (fSymbolTable) {
- return fSymbolTable.containsSymbol(symbol);
- }
-
- } // containsSymbol(String):boolean
-
- /**
- * Returns true if the symbol table already contains the specified
- * symbol.
- *
- * @param buffer The buffer containing the symbol to look for.
- * @param offset The offset into the buffer.
- * @param length The length of the symbol in the buffer.
- */
- public boolean containsSymbol(char[] buffer, int offset, int length) {
-
- synchronized (fSymbolTable) {
- return fSymbolTable.containsSymbol(buffer, offset, length);
- }
-
- } // containsSymbol(char[],int,int):boolean
-
-} // class SynchronizedSymbolTable
diff --git a/src/com/sun/org/apache/xerces/internal/util/TeeXMLDocumentFilterImpl.java b/src/com/sun/org/apache/xerces/internal/util/TeeXMLDocumentFilterImpl.java
deleted file mode 100644
index a7da706..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/TeeXMLDocumentFilterImpl.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2000-2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package com.sun.org.apache.xerces.internal.util;
-
-import com.sun.org.apache.xerces.internal.xni.Augmentations;
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
-import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLLocator;
-import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
-import com.sun.org.apache.xerces.internal.xni.XMLString;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentFilter;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource;
-
-/**
- *
- *
- * @author
- * Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
- */
-public class TeeXMLDocumentFilterImpl implements XMLDocumentFilter {
- /**
- * The next component in the pipeline who receives the event.
- * This component receives events after the "side" handler
- * receives them.
- */
- private XMLDocumentHandler next;
-
- /**
- * The component who intercepts events.
- */
- private XMLDocumentHandler side;
-
- /**
- * The source of the event.
- */
- private XMLDocumentSource source;
-
-
-
- public XMLDocumentHandler getSide() {
- return side;
- }
-
- public void setSide(XMLDocumentHandler side) {
- this.side = side;
- }
-
- public XMLDocumentSource getDocumentSource() {
- return source;
- }
-
- public void setDocumentSource(XMLDocumentSource source) {
- this.source = source;
- }
-
- public XMLDocumentHandler getDocumentHandler() {
- return next;
- }
-
- public void setDocumentHandler(XMLDocumentHandler handler) {
- next = handler;
- }
-
-//
-//
-// XMLDocumentHandler implementation
-//
-//
- public void characters(XMLString text, Augmentations augs) throws XNIException {
- side.characters(text, augs);
- next.characters(text, augs);
- }
-
- public void comment(XMLString text, Augmentations augs) throws XNIException {
- side.comment(text, augs);
- next.comment(text, augs);
- }
-
- public void doctypeDecl(String rootElement, String publicId, String systemId, Augmentations augs)
- throws XNIException {
- side.doctypeDecl(rootElement, publicId, systemId, augs);
- next.doctypeDecl(rootElement, publicId, systemId, augs);
- }
-
- public void emptyElement(QName element, XMLAttributes attributes, Augmentations augs) throws XNIException {
- side.emptyElement(element, attributes, augs);
- next.emptyElement(element, attributes, augs);
- }
-
- public void endCDATA(Augmentations augs) throws XNIException {
- side.endCDATA(augs);
- next.endCDATA(augs);
- }
-
- public void endDocument(Augmentations augs) throws XNIException {
- side.endDocument(augs);
- next.endDocument(augs);
- }
-
- public void endElement(QName element, Augmentations augs) throws XNIException {
- side.endElement(element, augs);
- next.endElement(element, augs);
- }
-
- public void endGeneralEntity(String name, Augmentations augs) throws XNIException {
- side.endGeneralEntity(name, augs);
- next.endGeneralEntity(name, augs);
- }
-
- public void ignorableWhitespace(XMLString text, Augmentations augs) throws XNIException {
- side.ignorableWhitespace(text, augs);
- next.ignorableWhitespace(text, augs);
- }
-
- public void processingInstruction(String target, XMLString data, Augmentations augs) throws XNIException {
- side.processingInstruction(target, data, augs);
- next.processingInstruction(target, data, augs);
- }
-
- public void startCDATA(Augmentations augs) throws XNIException {
- side.startCDATA(augs);
- next.startCDATA(augs);
- }
-
- public void startDocument(
- XMLLocator locator,
- String encoding,
- NamespaceContext namespaceContext,
- Augmentations augs)
- throws XNIException {
- side.startDocument(locator, encoding, namespaceContext, augs);
- next.startDocument(locator, encoding, namespaceContext, augs);
- }
-
- public void startElement(QName element, XMLAttributes attributes, Augmentations augs) throws XNIException {
- side.startElement(element, attributes, augs);
- next.startElement(element, attributes, augs);
- }
-
- public void startGeneralEntity(String name, XMLResourceIdentifier identifier, String encoding, Augmentations augs)
- throws XNIException {
- side.startGeneralEntity(name, identifier, encoding, augs);
- next.startGeneralEntity(name, identifier, encoding, augs);
- }
-
- public void textDecl(String version, String encoding, Augmentations augs) throws XNIException {
- side.textDecl(version, encoding, augs);
- next.textDecl(version, encoding, augs);
- }
-
- public void xmlDecl(String version, String encoding, String standalone, Augmentations augs) throws XNIException {
- side.xmlDecl(version, encoding, standalone, augs);
- next.xmlDecl(version, encoding, standalone, augs);
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/util/URI.java b/src/com/sun/org/apache/xerces/internal/util/URI.java
deleted file mode 100644
index a92cd20..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/URI.java
+++ /dev/null
@@ -1,2210 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.util;
-
-import java.io.IOException;
-import java.io.Serializable;
-import java.util.Objects;
-
-/**********************************************************************
-* A class to represent a Uniform Resource Identifier (URI). This class
-* is designed to handle the parsing of URIs and provide access to
-* the various components (scheme, host, port, userinfo, path, query
-* string and fragment) that may constitute a URI.
-* <p>
-* Parsing of a URI specification is done according to the URI
-* syntax described in
-* <a href="http://www.ietf.org/rfc/rfc2396.txt?number=2396">RFC 2396</a>,
-* and amended by
-* <a href="http://www.ietf.org/rfc/rfc2732.txt?number=2732">RFC 2732</a>.
-* <p>
-* Every absolute URI consists of a scheme, followed by a colon (':'),
-* followed by a scheme-specific part. For URIs that follow the
-* "generic URI" syntax, the scheme-specific part begins with two
-* slashes ("//") and may be followed by an authority segment (comprised
-* of user information, host, and port), path segment, query segment
-* and fragment. Note that RFC 2396 no longer specifies the use of the
-* parameters segment and excludes the "user:password" syntax as part of
-* the authority segment. If "user:password" appears in a URI, the entire
-* user/password string is stored as userinfo.
-* <p>
-* For URIs that do not follow the "generic URI" syntax (e.g. mailto),
-* the entire scheme-specific part is treated as the "path" portion
-* of the URI.
-* <p>
-* Note that, unlike the java.net.URL class, this class does not provide
-* any built-in network access functionality nor does it provide any
-* scheme-specific functionality (for example, it does not know a
-* default port for a specific scheme). Rather, it only knows the
-* grammar and basic set of operations that can be applied to a URI.
-*
-*
-**********************************************************************/
- public class URI implements Serializable {
-
- /*******************************************************************
- * MalformedURIExceptions are thrown in the process of building a URI
- * or setting fields on a URI when an operation would result in an
- * invalid URI specification.
- *
- ********************************************************************/
- public static class MalformedURIException extends IOException {
-
- /** Serialization version. */
- static final long serialVersionUID = -6695054834342951930L;
-
- /******************************************************************
- * Constructs a <code>MalformedURIException</code> with no specified
- * detail message.
- ******************************************************************/
- public MalformedURIException() {
- super();
- }
-
- /*****************************************************************
- * Constructs a <code>MalformedURIException</code> with the
- * specified detail message.
- *
- * @param p_msg the detail message.
- ******************************************************************/
- public MalformedURIException(String p_msg) {
- super(p_msg);
- }
- }
-
- /** Serialization version. */
- static final long serialVersionUID = 1601921774685357214L;
-
- private static final byte [] fgLookupTable = new byte[128];
-
- /**
- * Character Classes
- */
-
- /** reserved characters ;/?:@&=+$,[] */
- //RFC 2732 added '[' and ']' as reserved characters
- private static final int RESERVED_CHARACTERS = 0x01;
-
- /** URI punctuation mark characters: -_.!~*'() - these, combined with
- alphanumerics, constitute the "unreserved" characters */
- private static final int MARK_CHARACTERS = 0x02;
-
- /** scheme can be composed of alphanumerics and these characters: +-. */
- private static final int SCHEME_CHARACTERS = 0x04;
-
- /** userinfo can be composed of unreserved, escaped and these
- characters: ;:&=+$, */
- private static final int USERINFO_CHARACTERS = 0x08;
-
- /** ASCII letter characters */
- private static final int ASCII_ALPHA_CHARACTERS = 0x10;
-
- /** ASCII digit characters */
- private static final int ASCII_DIGIT_CHARACTERS = 0x20;
-
- /** ASCII hex characters */
- private static final int ASCII_HEX_CHARACTERS = 0x40;
-
- /** Path characters */
- private static final int PATH_CHARACTERS = 0x80;
-
- /** Mask for alpha-numeric characters */
- private static final int MASK_ALPHA_NUMERIC = ASCII_ALPHA_CHARACTERS | ASCII_DIGIT_CHARACTERS;
-
- /** Mask for unreserved characters */
- private static final int MASK_UNRESERVED_MASK = MASK_ALPHA_NUMERIC | MARK_CHARACTERS;
-
- /** Mask for URI allowable characters except for % */
- private static final int MASK_URI_CHARACTER = MASK_UNRESERVED_MASK | RESERVED_CHARACTERS;
-
- /** Mask for scheme characters */
- private static final int MASK_SCHEME_CHARACTER = MASK_ALPHA_NUMERIC | SCHEME_CHARACTERS;
-
- /** Mask for userinfo characters */
- private static final int MASK_USERINFO_CHARACTER = MASK_UNRESERVED_MASK | USERINFO_CHARACTERS;
-
- /** Mask for path characters */
- private static final int MASK_PATH_CHARACTER = MASK_UNRESERVED_MASK | PATH_CHARACTERS;
-
- static {
- // Add ASCII Digits and ASCII Hex Numbers
- for (int i = '0'; i <= '9'; ++i) {
- fgLookupTable[i] |= ASCII_DIGIT_CHARACTERS | ASCII_HEX_CHARACTERS;
- }
-
- // Add ASCII Letters and ASCII Hex Numbers
- for (int i = 'A'; i <= 'F'; ++i) {
- fgLookupTable[i] |= ASCII_ALPHA_CHARACTERS | ASCII_HEX_CHARACTERS;
- fgLookupTable[i+0x00000020] |= ASCII_ALPHA_CHARACTERS | ASCII_HEX_CHARACTERS;
- }
-
- // Add ASCII Letters
- for (int i = 'G'; i <= 'Z'; ++i) {
- fgLookupTable[i] |= ASCII_ALPHA_CHARACTERS;
- fgLookupTable[i+0x00000020] |= ASCII_ALPHA_CHARACTERS;
- }
-
- // Add Reserved Characters
- fgLookupTable[';'] |= RESERVED_CHARACTERS;
- fgLookupTable['/'] |= RESERVED_CHARACTERS;
- fgLookupTable['?'] |= RESERVED_CHARACTERS;
- fgLookupTable[':'] |= RESERVED_CHARACTERS;
- fgLookupTable['@'] |= RESERVED_CHARACTERS;
- fgLookupTable['&'] |= RESERVED_CHARACTERS;
- fgLookupTable['='] |= RESERVED_CHARACTERS;
- fgLookupTable['+'] |= RESERVED_CHARACTERS;
- fgLookupTable['$'] |= RESERVED_CHARACTERS;
- fgLookupTable[','] |= RESERVED_CHARACTERS;
- fgLookupTable['['] |= RESERVED_CHARACTERS;
- fgLookupTable[']'] |= RESERVED_CHARACTERS;
-
- // Add Mark Characters
- fgLookupTable['-'] |= MARK_CHARACTERS;
- fgLookupTable['_'] |= MARK_CHARACTERS;
- fgLookupTable['.'] |= MARK_CHARACTERS;
- fgLookupTable['!'] |= MARK_CHARACTERS;
- fgLookupTable['~'] |= MARK_CHARACTERS;
- fgLookupTable['*'] |= MARK_CHARACTERS;
- fgLookupTable['\''] |= MARK_CHARACTERS;
- fgLookupTable['('] |= MARK_CHARACTERS;
- fgLookupTable[')'] |= MARK_CHARACTERS;
-
- // Add Scheme Characters
- fgLookupTable['+'] |= SCHEME_CHARACTERS;
- fgLookupTable['-'] |= SCHEME_CHARACTERS;
- fgLookupTable['.'] |= SCHEME_CHARACTERS;
-
- // Add Userinfo Characters
- fgLookupTable[';'] |= USERINFO_CHARACTERS;
- fgLookupTable[':'] |= USERINFO_CHARACTERS;
- fgLookupTable['&'] |= USERINFO_CHARACTERS;
- fgLookupTable['='] |= USERINFO_CHARACTERS;
- fgLookupTable['+'] |= USERINFO_CHARACTERS;
- fgLookupTable['$'] |= USERINFO_CHARACTERS;
- fgLookupTable[','] |= USERINFO_CHARACTERS;
-
- // Add Path Characters
- fgLookupTable[';'] |= PATH_CHARACTERS;
- fgLookupTable['/'] |= PATH_CHARACTERS;
- fgLookupTable[':'] |= PATH_CHARACTERS;
- fgLookupTable['@'] |= PATH_CHARACTERS;
- fgLookupTable['&'] |= PATH_CHARACTERS;
- fgLookupTable['='] |= PATH_CHARACTERS;
- fgLookupTable['+'] |= PATH_CHARACTERS;
- fgLookupTable['$'] |= PATH_CHARACTERS;
- fgLookupTable[','] |= PATH_CHARACTERS;
- }
-
- /** Stores the scheme (usually the protocol) for this URI. */
- private String m_scheme = null;
-
- /** If specified, stores the userinfo for this URI; otherwise null */
- private String m_userinfo = null;
-
- /** If specified, stores the host for this URI; otherwise null */
- private String m_host = null;
-
- /** If specified, stores the port for this URI; otherwise -1 */
- private int m_port = -1;
-
- /** If specified, stores the registry based authority for this URI; otherwise -1 */
- private String m_regAuthority = null;
-
- /** If specified, stores the path for this URI; otherwise null */
- private String m_path = null;
-
- /** If specified, stores the query string for this URI; otherwise
- null. */
- private String m_queryString = null;
-
- /** If specified, stores the fragment for this URI; otherwise null */
- private String m_fragment = null;
-
- private static boolean DEBUG = false;
-
- /**
- * Construct a new and uninitialized URI.
- */
- public URI() {
- }
-
- /**
- * Construct a new URI from another URI. All fields for this URI are
- * set equal to the fields of the URI passed in.
- *
- * @param p_other the URI to copy (cannot be null)
- */
- public URI(URI p_other) {
- initialize(p_other);
- }
-
- /**
- * Construct a new URI from a URI specification string. If the
- * specification follows the "generic URI" syntax, (two slashes
- * following the first colon), the specification will be parsed
- * accordingly - setting the scheme, userinfo, host,port, path, query
- * string and fragment fields as necessary. If the specification does
- * not follow the "generic URI" syntax, the specification is parsed
- * into a scheme and scheme-specific part (stored as the path) only.
- *
- * @param p_uriSpec the URI specification string (cannot be null or
- * empty)
- *
- * @exception MalformedURIException if p_uriSpec violates any syntax
- * rules
- */
- public URI(String p_uriSpec) throws MalformedURIException {
- this((URI)null, p_uriSpec);
- }
-
- /**
- * Construct a new URI from a URI specification string. If the
- * specification follows the "generic URI" syntax, (two slashes
- * following the first colon), the specification will be parsed
- * accordingly - setting the scheme, userinfo, host,port, path, query
- * string and fragment fields as necessary. If the specification does
- * not follow the "generic URI" syntax, the specification is parsed
- * into a scheme and scheme-specific part (stored as the path) only.
- * Construct a relative URI if boolean is assigned to "true"
- * and p_uriSpec is not valid absolute URI, instead of throwing an exception.
- *
- * @param p_uriSpec the URI specification string (cannot be null or
- * empty)
- * @param allowNonAbsoluteURI true to permit non-absolute URIs,
- * false otherwise.
- *
- * @exception MalformedURIException if p_uriSpec violates any syntax
- * rules
- */
- public URI(String p_uriSpec, boolean allowNonAbsoluteURI) throws MalformedURIException {
- this((URI)null, p_uriSpec, allowNonAbsoluteURI);
- }
-
- /**
- * Construct a new URI from a base URI and a URI specification string.
- * The URI specification string may be a relative URI.
- *
- * @param p_base the base URI (cannot be null if p_uriSpec is null or
- * empty)
- * @param p_uriSpec the URI specification string (cannot be null or
- * empty if p_base is null)
- *
- * @exception MalformedURIException if p_uriSpec violates any syntax
- * rules
- */
- public URI(URI p_base, String p_uriSpec) throws MalformedURIException {
- initialize(p_base, p_uriSpec);
- }
-
- /**
- * Construct a new URI from a base URI and a URI specification string.
- * The URI specification string may be a relative URI.
- * Construct a relative URI if boolean is assigned to "true"
- * and p_uriSpec is not valid absolute URI and p_base is null
- * instead of throwing an exception.
- *
- * @param p_base the base URI (cannot be null if p_uriSpec is null or
- * empty)
- * @param p_uriSpec the URI specification string (cannot be null or
- * empty if p_base is null)
- * @param allowNonAbsoluteURI true to permit non-absolute URIs,
- * false otherwise.
- *
- * @exception MalformedURIException if p_uriSpec violates any syntax
- * rules
- */
- public URI(URI p_base, String p_uriSpec, boolean allowNonAbsoluteURI) throws MalformedURIException {
- initialize(p_base, p_uriSpec, allowNonAbsoluteURI);
- }
-
- /**
- * Construct a new URI that does not follow the generic URI syntax.
- * Only the scheme and scheme-specific part (stored as the path) are
- * initialized.
- *
- * @param p_scheme the URI scheme (cannot be null or empty)
- * @param p_schemeSpecificPart the scheme-specific part (cannot be
- * null or empty)
- *
- * @exception MalformedURIException if p_scheme violates any
- * syntax rules
- */
- public URI(String p_scheme, String p_schemeSpecificPart)
- throws MalformedURIException {
- if (p_scheme == null || p_scheme.trim().length() == 0) {
- throw new MalformedURIException(
- "Cannot construct URI with null/empty scheme!");
- }
- if (p_schemeSpecificPart == null ||
- p_schemeSpecificPart.trim().length() == 0) {
- throw new MalformedURIException(
- "Cannot construct URI with null/empty scheme-specific part!");
- }
- setScheme(p_scheme);
- setPath(p_schemeSpecificPart);
- }
-
- /**
- * Construct a new URI that follows the generic URI syntax from its
- * component parts. Each component is validated for syntax and some
- * basic semantic checks are performed as well. See the individual
- * setter methods for specifics.
- *
- * @param p_scheme the URI scheme (cannot be null or empty)
- * @param p_host the hostname, IPv4 address or IPv6 reference for the URI
- * @param p_path the URI path - if the path contains '?' or '#',
- * then the query string and/or fragment will be
- * set from the path; however, if the query and
- * fragment are specified both in the path and as
- * separate parameters, an exception is thrown
- * @param p_queryString the URI query string (cannot be specified
- * if path is null)
- * @param p_fragment the URI fragment (cannot be specified if path
- * is null)
- *
- * @exception MalformedURIException if any of the parameters violates
- * syntax rules or semantic rules
- */
- public URI(String p_scheme, String p_host, String p_path,
- String p_queryString, String p_fragment)
- throws MalformedURIException {
- this(p_scheme, null, p_host, -1, p_path, p_queryString, p_fragment);
- }
-
- /**
- * Construct a new URI that follows the generic URI syntax from its
- * component parts. Each component is validated for syntax and some
- * basic semantic checks are performed as well. See the individual
- * setter methods for specifics.
- *
- * @param p_scheme the URI scheme (cannot be null or empty)
- * @param p_userinfo the URI userinfo (cannot be specified if host
- * is null)
- * @param p_host the hostname, IPv4 address or IPv6 reference for the URI
- * @param p_port the URI port (may be -1 for "unspecified"; cannot
- * be specified if host is null)
- * @param p_path the URI path - if the path contains '?' or '#',
- * then the query string and/or fragment will be
- * set from the path; however, if the query and
- * fragment are specified both in the path and as
- * separate parameters, an exception is thrown
- * @param p_queryString the URI query string (cannot be specified
- * if path is null)
- * @param p_fragment the URI fragment (cannot be specified if path
- * is null)
- *
- * @exception MalformedURIException if any of the parameters violates
- * syntax rules or semantic rules
- */
- public URI(String p_scheme, String p_userinfo,
- String p_host, int p_port, String p_path,
- String p_queryString, String p_fragment)
- throws MalformedURIException {
- if (p_scheme == null || p_scheme.trim().length() == 0) {
- throw new MalformedURIException("Scheme is required!");
- }
-
- if (p_host == null) {
- if (p_userinfo != null) {
- throw new MalformedURIException(
- "Userinfo may not be specified if host is not specified!");
- }
- if (p_port != -1) {
- throw new MalformedURIException(
- "Port may not be specified if host is not specified!");
- }
- }
-
- if (p_path != null) {
- if (p_path.indexOf('?') != -1 && p_queryString != null) {
- throw new MalformedURIException(
- "Query string cannot be specified in path and query string!");
- }
-
- if (p_path.indexOf('#') != -1 && p_fragment != null) {
- throw new MalformedURIException(
- "Fragment cannot be specified in both the path and fragment!");
- }
- }
-
- setScheme(p_scheme);
- setHost(p_host);
- setPort(p_port);
- setUserinfo(p_userinfo);
- setPath(p_path);
- setQueryString(p_queryString);
- setFragment(p_fragment);
- }
-
- /**
- * Initialize all fields of this URI from another URI.
- *
- * @param p_other the URI to copy (cannot be null)
- */
- private void initialize(URI p_other) {
- m_scheme = p_other.getScheme();
- m_userinfo = p_other.getUserinfo();
- m_host = p_other.getHost();
- m_port = p_other.getPort();
- m_regAuthority = p_other.getRegBasedAuthority();
- m_path = p_other.getPath();
- m_queryString = p_other.getQueryString();
- m_fragment = p_other.getFragment();
- }
-
- /**
- * Initializes this URI from a base URI and a URI specification string.
- * See RFC 2396 Section 4 and Appendix B for specifications on parsing
- * the URI and Section 5 for specifications on resolving relative URIs
- * and relative paths.
- *
- * @param p_base the base URI (may be null if p_uriSpec is an absolute
- * URI)
- * @param p_uriSpec the URI spec string which may be an absolute or
- * relative URI (can only be null/empty if p_base
- * is not null)
- * @param allowNonAbsoluteURI true to permit non-absolute URIs,
- * in case of relative URI, false otherwise.
- *
- * @exception MalformedURIException if p_base is null and p_uriSpec
- * is not an absolute URI or if
- * p_uriSpec violates syntax rules
- */
- private void initialize(URI p_base, String p_uriSpec, boolean allowNonAbsoluteURI)
- throws MalformedURIException {
-
- String uriSpec = p_uriSpec;
- int uriSpecLen = (uriSpec != null) ? uriSpec.length() : 0;
-
- if (p_base == null && uriSpecLen == 0) {
- if (allowNonAbsoluteURI) {
- m_path = "";
- return;
- }
- throw new MalformedURIException("Cannot initialize URI with empty parameters.");
- }
-
- // just make a copy of the base if spec is empty
- if (uriSpecLen == 0) {
- initialize(p_base);
- return;
- }
-
- int index = 0;
-
- // Check for scheme, which must be before '/', '?' or '#'.
- int colonIdx = uriSpec.indexOf(':');
- if (colonIdx != -1) {
- final int searchFrom = colonIdx - 1;
- // search backwards starting from character before ':'.
- int slashIdx = uriSpec.lastIndexOf('/', searchFrom);
- int queryIdx = uriSpec.lastIndexOf('?', searchFrom);
- int fragmentIdx = uriSpec.lastIndexOf('#', searchFrom);
-
- if (colonIdx == 0 || slashIdx != -1 ||
- queryIdx != -1 || fragmentIdx != -1) {
- // A standalone base is a valid URI according to spec
- if (colonIdx == 0 || (p_base == null && fragmentIdx != 0 && !allowNonAbsoluteURI)) {
- throw new MalformedURIException("No scheme found in URI.");
- }
- }
- else {
- initializeScheme(uriSpec);
- index = m_scheme.length()+1;
-
- // Neither 'scheme:' or 'scheme:#fragment' are valid URIs.
- if (colonIdx == uriSpecLen - 1 || uriSpec.charAt(colonIdx+1) == '#') {
- throw new MalformedURIException("Scheme specific part cannot be empty.");
- }
- }
- }
- else if (p_base == null && uriSpec.indexOf('#') != 0 && !allowNonAbsoluteURI) {
- throw new MalformedURIException("No scheme found in URI.");
- }
-
- // Two slashes means we may have authority, but definitely means we're either
- // matching net_path or abs_path. These two productions are ambiguous in that
- // every net_path (except those containing an IPv6Reference) is an abs_path.
- // RFC 2396 resolves this ambiguity by applying a greedy left most matching rule.
- // Try matching net_path first, and if that fails we don't have authority so
- // then attempt to match abs_path.
- //
- // net_path = "//" authority [ abs_path ]
- // abs_path = "/" path_segments
- if (((index+1) < uriSpecLen) &&
- (uriSpec.charAt(index) == '/' && uriSpec.charAt(index+1) == '/')) {
- index += 2;
- int startPos = index;
-
- // Authority will be everything up to path, query or fragment
- char testChar = '\0';
- while (index < uriSpecLen) {
- testChar = uriSpec.charAt(index);
- if (testChar == '/' || testChar == '?' || testChar == '#') {
- break;
- }
- index++;
- }
-
- // Attempt to parse authority. If the section is an empty string
- // this is a valid server based authority, so set the host to this
- // value.
- if (index > startPos) {
- // If we didn't find authority we need to back up. Attempt to
- // match against abs_path next.
- if (!initializeAuthority(uriSpec.substring(startPos, index))) {
- index = startPos - 2;
- }
- }
- else {
- m_host = "";
- }
- }
-
- initializePath(uriSpec, index);
-
- // Resolve relative URI to base URI - see RFC 2396 Section 5.2
- // In some cases, it might make more sense to throw an exception
- // (when scheme is specified is the string spec and the base URI
- // is also specified, for example), but we're just following the
- // RFC specifications
- if (p_base != null) {
- absolutize(p_base);
- }
- }
-
- /**
- * Initializes this URI from a base URI and a URI specification string.
- * See RFC 2396 Section 4 and Appendix B for specifications on parsing
- * the URI and Section 5 for specifications on resolving relative URIs
- * and relative paths.
- *
- * @param p_base the base URI (may be null if p_uriSpec is an absolute
- * URI)
- * @param p_uriSpec the URI spec string which may be an absolute or
- * relative URI (can only be null/empty if p_base
- * is not null)
- *
- * @exception MalformedURIException if p_base is null and p_uriSpec
- * is not an absolute URI or if
- * p_uriSpec violates syntax rules
- */
- private void initialize(URI p_base, String p_uriSpec)
- throws MalformedURIException {
-
- String uriSpec = p_uriSpec;
- int uriSpecLen = (uriSpec != null) ? uriSpec.length() : 0;
-
- if (p_base == null && uriSpecLen == 0) {
- throw new MalformedURIException(
- "Cannot initialize URI with empty parameters.");
- }
-
- // just make a copy of the base if spec is empty
- if (uriSpecLen == 0) {
- initialize(p_base);
- return;
- }
-
- int index = 0;
-
- // Check for scheme, which must be before '/', '?' or '#'.
- int colonIdx = uriSpec.indexOf(':');
- if (colonIdx != -1) {
- final int searchFrom = colonIdx - 1;
- // search backwards starting from character before ':'.
- int slashIdx = uriSpec.lastIndexOf('/', searchFrom);
- int queryIdx = uriSpec.lastIndexOf('?', searchFrom);
- int fragmentIdx = uriSpec.lastIndexOf('#', searchFrom);
-
- if (colonIdx == 0 || slashIdx != -1 ||
- queryIdx != -1 || fragmentIdx != -1) {
- // A standalone base is a valid URI according to spec
- if (colonIdx == 0 || (p_base == null && fragmentIdx != 0)) {
- throw new MalformedURIException("No scheme found in URI.");
- }
- }
- else {
- initializeScheme(uriSpec);
- index = m_scheme.length()+1;
-
- // Neither 'scheme:' or 'scheme:#fragment' are valid URIs.
- if (colonIdx == uriSpecLen - 1 || uriSpec.charAt(colonIdx+1) == '#') {
- throw new MalformedURIException("Scheme specific part cannot be empty.");
- }
- }
- }
- else if (p_base == null && uriSpec.indexOf('#') != 0) {
- throw new MalformedURIException("No scheme found in URI.");
- }
-
- // Two slashes means we may have authority, but definitely means we're either
- // matching net_path or abs_path. These two productions are ambiguous in that
- // every net_path (except those containing an IPv6Reference) is an abs_path.
- // RFC 2396 resolves this ambiguity by applying a greedy left most matching rule.
- // Try matching net_path first, and if that fails we don't have authority so
- // then attempt to match abs_path.
- //
- // net_path = "//" authority [ abs_path ]
- // abs_path = "/" path_segments
- if (((index+1) < uriSpecLen) &&
- (uriSpec.charAt(index) == '/' && uriSpec.charAt(index+1) == '/')) {
- index += 2;
- int startPos = index;
-
- // Authority will be everything up to path, query or fragment
- char testChar = '\0';
- while (index < uriSpecLen) {
- testChar = uriSpec.charAt(index);
- if (testChar == '/' || testChar == '?' || testChar == '#') {
- break;
- }
- index++;
- }
-
- // Attempt to parse authority. If the section is an empty string
- // this is a valid server based authority, so set the host to this
- // value.
- if (index > startPos) {
- // If we didn't find authority we need to back up. Attempt to
- // match against abs_path next.
- if (!initializeAuthority(uriSpec.substring(startPos, index))) {
- index = startPos - 2;
- }
- } else if (index < uriSpecLen) {
- //Same as java.net.URI:
- // DEVIATION: Allow empty authority prior to non-empty
- // path, query component or fragment identifier
- m_host = "";
- } else {
- throw new MalformedURIException("Expected authority.");
- }
- }
-
- initializePath(uriSpec, index);
-
- // Resolve relative URI to base URI - see RFC 2396 Section 5.2
- // In some cases, it might make more sense to throw an exception
- // (when scheme is specified is the string spec and the base URI
- // is also specified, for example), but we're just following the
- // RFC specifications
- if (p_base != null) {
- absolutize(p_base);
- }
- }
-
- /**
- * Absolutize URI with given base URI.
- *
- * @param p_base base URI for absolutization
- */
- public void absolutize(URI p_base) {
-
- // check to see if this is the current doc - RFC 2396 5.2 #2
- // note that this is slightly different from the RFC spec in that
- // we don't include the check for query string being null
- // - this handles cases where the urispec is just a query
- // string or a fragment (e.g. "?y" or "#s") -
- // see <http://www.ics.uci.edu/~fielding/url/test1.html> which
- // identified this as a bug in the RFC
- if (m_path.length() == 0 && m_scheme == null &&
- m_host == null && m_regAuthority == null) {
- m_scheme = p_base.getScheme();
- m_userinfo = p_base.getUserinfo();
- m_host = p_base.getHost();
- m_port = p_base.getPort();
- m_regAuthority = p_base.getRegBasedAuthority();
- m_path = p_base.getPath();
-
- if (m_queryString == null) {
- m_queryString = p_base.getQueryString();
-
- if (m_fragment == null) {
- m_fragment = p_base.getFragment();
- }
- }
- return;
- }
-
- // check for scheme - RFC 2396 5.2 #3
- // if we found a scheme, it means absolute URI, so we're done
- if (m_scheme == null) {
- m_scheme = p_base.getScheme();
- }
- else {
- return;
- }
-
- // check for authority - RFC 2396 5.2 #4
- // if we found a host, then we've got a network path, so we're done
- if (m_host == null && m_regAuthority == null) {
- m_userinfo = p_base.getUserinfo();
- m_host = p_base.getHost();
- m_port = p_base.getPort();
- m_regAuthority = p_base.getRegBasedAuthority();
- }
- else {
- return;
- }
-
- // check for absolute path - RFC 2396 5.2 #5
- if (m_path.length() > 0 &&
- m_path.startsWith("/")) {
- return;
- }
-
- // if we get to this point, we need to resolve relative path
- // RFC 2396 5.2 #6
- String path = "";
- String basePath = p_base.getPath();
-
- // 6a - get all but the last segment of the base URI path
- if (basePath != null && basePath.length() > 0) {
- int lastSlash = basePath.lastIndexOf('/');
- if (lastSlash != -1) {
- path = basePath.substring(0, lastSlash+1);
- }
- }
- else if (m_path.length() > 0) {
- path = "/";
- }
-
- // 6b - append the relative URI path
- path = path.concat(m_path);
-
- // 6c - remove all "./" where "." is a complete path segment
- int index = -1;
- while ((index = path.indexOf("/./")) != -1) {
- path = path.substring(0, index+1).concat(path.substring(index+3));
- }
-
- // 6d - remove "." if path ends with "." as a complete path segment
- if (path.endsWith("/.")) {
- path = path.substring(0, path.length()-1);
- }
-
- // 6e - remove all "<segment>/../" where "<segment>" is a complete
- // path segment not equal to ".."
- index = 1;
- int segIndex = -1;
- String tempString = null;
-
- while ((index = path.indexOf("/../", index)) > 0) {
- tempString = path.substring(0, path.indexOf("/../"));
- segIndex = tempString.lastIndexOf('/');
- if (segIndex != -1) {
- if (!tempString.substring(segIndex).equals("..")) {
- path = path.substring(0, segIndex+1).concat(path.substring(index+4));
- index = segIndex;
- }
- else {
- index += 4;
- }
- }
- else {
- index += 4;
- }
- }
-
- // 6f - remove ending "<segment>/.." where "<segment>" is a
- // complete path segment
- if (path.endsWith("/..")) {
- tempString = path.substring(0, path.length()-3);
- segIndex = tempString.lastIndexOf('/');
- if (segIndex != -1) {
- path = path.substring(0, segIndex+1);
- }
- }
- m_path = path;
- }
-
- /**
- * Initialize the scheme for this URI from a URI string spec.
- *
- * @param p_uriSpec the URI specification (cannot be null)
- *
- * @exception MalformedURIException if URI does not have a conformant
- * scheme
- */
- private void initializeScheme(String p_uriSpec)
- throws MalformedURIException {
- int uriSpecLen = p_uriSpec.length();
- int index = 0;
- String scheme = null;
- char testChar = '\0';
-
- while (index < uriSpecLen) {
- testChar = p_uriSpec.charAt(index);
- if (testChar == ':' || testChar == '/' ||
- testChar == '?' || testChar == '#') {
- break;
- }
- index++;
- }
- scheme = p_uriSpec.substring(0, index);
-
- if (scheme.length() == 0) {
- throw new MalformedURIException("No scheme found in URI.");
- }
- else {
- setScheme(scheme);
- }
- }
-
- /**
- * Initialize the authority (either server or registry based)
- * for this URI from a URI string spec.
- *
- * @param p_uriSpec the URI specification (cannot be null)
- *
- * @return true if the given string matched server or registry
- * based authority
- */
- private boolean initializeAuthority(String p_uriSpec) {
-
- int index = 0;
- int start = 0;
- int end = p_uriSpec.length();
-
- char testChar = '\0';
- String userinfo = null;
-
- // userinfo is everything up to @
- if (p_uriSpec.indexOf('@', start) != -1) {
- while (index < end) {
- testChar = p_uriSpec.charAt(index);
- if (testChar == '@') {
- break;
- }
- index++;
- }
- userinfo = p_uriSpec.substring(start, index);
- index++;
- }
-
- // host is everything up to last ':', or up to
- // and including ']' if followed by ':'.
- String host = null;
- start = index;
- boolean hasPort = false;
- if (index < end) {
- if (p_uriSpec.charAt(start) == '[') {
- int bracketIndex = p_uriSpec.indexOf(']', start);
- index = (bracketIndex != -1) ? bracketIndex : end;
- if (index+1 < end && p_uriSpec.charAt(index+1) == ':') {
- ++index;
- hasPort = true;
- }
- else {
- index = end;
- }
- }
- else {
- int colonIndex = p_uriSpec.lastIndexOf(':', end);
- index = (colonIndex > start) ? colonIndex : end;
- hasPort = (index != end);
- }
- }
- host = p_uriSpec.substring(start, index);
- int port = -1;
- if (host.length() > 0) {
- // port
- if (hasPort) {
- index++;
- start = index;
- while (index < end) {
- index++;
- }
- String portStr = p_uriSpec.substring(start, index);
- if (portStr.length() > 0) {
- // REVISIT: Remove this code.
- /** for (int i = 0; i < portStr.length(); i++) {
- if (!isDigit(portStr.charAt(i))) {
- throw new MalformedURIException(
- portStr +
- " is invalid. Port should only contain digits!");
- }
- }**/
- // REVISIT: Remove this code.
- // Store port value as string instead of integer.
- try {
- port = Integer.parseInt(portStr);
- if (port == -1) --port;
- }
- catch (NumberFormatException nfe) {
- port = -2;
- }
- }
- }
- }
-
- if (isValidServerBasedAuthority(host, port, userinfo)) {
- m_host = host;
- m_port = port;
- m_userinfo = userinfo;
- return true;
- }
- // Note: Registry based authority is being removed from a
- // new spec for URI which would obsolete RFC 2396. If the
- // spec is added to XML errata, processing of reg_name
- // needs to be removed. - mrglavas.
- else if (isValidRegistryBasedAuthority(p_uriSpec)) {
- m_regAuthority = p_uriSpec;
- return true;
- }
- return false;
- }
-
- /**
- * Determines whether the components host, port, and user info
- * are valid as a server authority.
- *
- * @param host the host component of authority
- * @param port the port number component of authority
- * @param userinfo the user info component of authority
- *
- * @return true if the given host, port, and userinfo compose
- * a valid server authority
- */
- private boolean isValidServerBasedAuthority(String host, int port, String userinfo) {
-
- // Check if the host is well formed.
- if (!isWellFormedAddress(host)) {
- return false;
- }
-
- // Check that port is well formed if it exists.
- // REVISIT: There's no restriction on port value ranges, but
- // perform the same check as in setPort to be consistent. Pass
- // in a string to this method instead of an integer.
- if (port < -1 || port > 65535) {
- return false;
- }
-
- // Check that userinfo is well formed if it exists.
- if (userinfo != null) {
- // Userinfo can contain alphanumerics, mark characters, escaped
- // and ';',':','&','=','+','$',','
- int index = 0;
- int end = userinfo.length();
- char testChar = '\0';
- while (index < end) {
- testChar = userinfo.charAt(index);
- if (testChar == '%') {
- if (index+2 >= end ||
- !isHex(userinfo.charAt(index+1)) ||
- !isHex(userinfo.charAt(index+2))) {
- return false;
- }
- index += 2;
- }
- else if (!isUserinfoCharacter(testChar)) {
- return false;
- }
- ++index;
- }
- }
- return true;
- }
-
- /**
- * Determines whether the given string is a registry based authority.
- *
- * @param authority the authority component of a URI
- *
- * @return true if the given string is a registry based authority
- */
- private boolean isValidRegistryBasedAuthority(String authority) {
- int index = 0;
- int end = authority.length();
- char testChar;
-
- while (index < end) {
- testChar = authority.charAt(index);
-
- // check for valid escape sequence
- if (testChar == '%') {
- if (index+2 >= end ||
- !isHex(authority.charAt(index+1)) ||
- !isHex(authority.charAt(index+2))) {
- return false;
- }
- index += 2;
- }
- // can check against path characters because the set
- // is the same except for '/' which we've already excluded.
- else if (!isPathCharacter(testChar)) {
- return false;
- }
- ++index;
- }
- return true;
- }
-
- /**
- * Initialize the path for this URI from a URI string spec.
- *
- * @param p_uriSpec the URI specification (cannot be null)
- * @param p_nStartIndex the index to begin scanning from
- *
- * @exception MalformedURIException if p_uriSpec violates syntax rules
- */
- private void initializePath(String p_uriSpec, int p_nStartIndex)
- throws MalformedURIException {
- if (p_uriSpec == null) {
- throw new MalformedURIException(
- "Cannot initialize path from null string!");
- }
-
- int index = p_nStartIndex;
- int start = p_nStartIndex;
- int end = p_uriSpec.length();
- char testChar = '\0';
-
- // path - everything up to query string or fragment
- if (start < end) {
- // RFC 2732 only allows '[' and ']' to appear in the opaque part.
- if (getScheme() == null || p_uriSpec.charAt(start) == '/') {
-
- // Scan path.
- // abs_path = "/" path_segments
- // rel_path = rel_segment [ abs_path ]
- while (index < end) {
- testChar = p_uriSpec.charAt(index);
-
- // check for valid escape sequence
- if (testChar == '%') {
- if (index+2 >= end ||
- !isHex(p_uriSpec.charAt(index+1)) ||
- !isHex(p_uriSpec.charAt(index+2))) {
- throw new MalformedURIException(
- "Path contains invalid escape sequence!");
- }
- index += 2;
- }
- // Path segments cannot contain '[' or ']' since pchar
- // production was not changed by RFC 2732.
- else if (!isPathCharacter(testChar)) {
- if (testChar == '?' || testChar == '#') {
- break;
- }
- throw new MalformedURIException(
- "Path contains invalid character: " + testChar);
- }
- ++index;
- }
- }
- else {
-
- // Scan opaque part.
- // opaque_part = uric_no_slash *uric
- while (index < end) {
- testChar = p_uriSpec.charAt(index);
-
- if (testChar == '?' || testChar == '#') {
- break;
- }
-
- // check for valid escape sequence
- if (testChar == '%') {
- if (index+2 >= end ||
- !isHex(p_uriSpec.charAt(index+1)) ||
- !isHex(p_uriSpec.charAt(index+2))) {
- throw new MalformedURIException(
- "Opaque part contains invalid escape sequence!");
- }
- index += 2;
- }
- // If the scheme specific part is opaque, it can contain '['
- // and ']'. uric_no_slash wasn't modified by RFC 2732, which
- // I've interpreted as an error in the spec, since the
- // production should be equivalent to (uric - '/'), and uric
- // contains '[' and ']'. - mrglavas
- else if (!isURICharacter(testChar)) {
- throw new MalformedURIException(
- "Opaque part contains invalid character: " + testChar);
- }
- ++index;
- }
- }
- }
- m_path = p_uriSpec.substring(start, index);
-
- // query - starts with ? and up to fragment or end
- if (testChar == '?') {
- index++;
- start = index;
- while (index < end) {
- testChar = p_uriSpec.charAt(index);
- if (testChar == '#') {
- break;
- }
- if (testChar == '%') {
- if (index+2 >= end ||
- !isHex(p_uriSpec.charAt(index+1)) ||
- !isHex(p_uriSpec.charAt(index+2))) {
- throw new MalformedURIException(
- "Query string contains invalid escape sequence!");
- }
- index += 2;
- }
- else if (!isURICharacter(testChar)) {
- throw new MalformedURIException(
- "Query string contains invalid character: " + testChar);
- }
- index++;
- }
- m_queryString = p_uriSpec.substring(start, index);
- }
-
- // fragment - starts with #
- if (testChar == '#') {
- index++;
- start = index;
- while (index < end) {
- testChar = p_uriSpec.charAt(index);
-
- if (testChar == '%') {
- if (index+2 >= end ||
- !isHex(p_uriSpec.charAt(index+1)) ||
- !isHex(p_uriSpec.charAt(index+2))) {
- throw new MalformedURIException(
- "Fragment contains invalid escape sequence!");
- }
- index += 2;
- }
- else if (!isURICharacter(testChar)) {
- throw new MalformedURIException(
- "Fragment contains invalid character: "+testChar);
- }
- index++;
- }
- m_fragment = p_uriSpec.substring(start, index);
- }
- }
-
- /**
- * Get the scheme for this URI.
- *
- * @return the scheme for this URI
- */
- public String getScheme() {
- return m_scheme;
- }
-
- /**
- * Get the scheme-specific part for this URI (everything following the
- * scheme and the first colon). See RFC 2396 Section 5.2 for spec.
- *
- * @return the scheme-specific part for this URI
- */
- public String getSchemeSpecificPart() {
- final StringBuilder schemespec = new StringBuilder();
-
- if (m_host != null || m_regAuthority != null) {
- schemespec.append("//");
-
- // Server based authority.
- if (m_host != null) {
-
- if (m_userinfo != null) {
- schemespec.append(m_userinfo);
- schemespec.append('@');
- }
-
- schemespec.append(m_host);
-
- if (m_port != -1) {
- schemespec.append(':');
- schemespec.append(m_port);
- }
- }
- // Registry based authority.
- else {
- schemespec.append(m_regAuthority);
- }
- }
-
- if (m_path != null) {
- schemespec.append((m_path));
- }
-
- if (m_queryString != null) {
- schemespec.append('?');
- schemespec.append(m_queryString);
- }
-
- if (m_fragment != null) {
- schemespec.append('#');
- schemespec.append(m_fragment);
- }
-
- return schemespec.toString();
- }
-
- /**
- * Get the userinfo for this URI.
- *
- * @return the userinfo for this URI (null if not specified).
- */
- public String getUserinfo() {
- return m_userinfo;
- }
-
- /**
- * Get the host for this URI.
- *
- * @return the host for this URI (null if not specified).
- */
- public String getHost() {
- return m_host;
- }
-
- /**
- * Get the port for this URI.
- *
- * @return the port for this URI (-1 if not specified).
- */
- public int getPort() {
- return m_port;
- }
-
- /**
- * Get the registry based authority for this URI.
- *
- * @return the registry based authority (null if not specified).
- */
- public String getRegBasedAuthority() {
- return m_regAuthority;
- }
-
- /**
- * Get the authority for this URI.
- *
- * @return the authority
- */
- public String getAuthority() {
- final StringBuilder authority = new StringBuilder();
- if (m_host != null || m_regAuthority != null) {
- authority.append("//");
-
- // Server based authority.
- if (m_host != null) {
-
- if (m_userinfo != null) {
- authority.append(m_userinfo);
- authority.append('@');
- }
-
- authority.append(m_host);
-
- if (m_port != -1) {
- authority.append(':');
- authority.append(m_port);
- }
- }
- // Registry based authority.
- else {
- authority.append(m_regAuthority);
- }
- }
- return authority.toString();
- }
-
- /**
- * Get the path for this URI (optionally with the query string and
- * fragment).
- *
- * @param p_includeQueryString if true (and query string is not null),
- * then a "?" followed by the query string
- * will be appended
- * @param p_includeFragment if true (and fragment is not null),
- * then a "#" followed by the fragment
- * will be appended
- *
- * @return the path for this URI possibly including the query string
- * and fragment
- */
- public String getPath(boolean p_includeQueryString,
- boolean p_includeFragment) {
- final StringBuilder pathString = new StringBuilder(m_path);
-
- if (p_includeQueryString && m_queryString != null) {
- pathString.append('?');
- pathString.append(m_queryString);
- }
-
- if (p_includeFragment && m_fragment != null) {
- pathString.append('#');
- pathString.append(m_fragment);
- }
- return pathString.toString();
- }
-
- /**
- * Get the path for this URI. Note that the value returned is the path
- * only and does not include the query string or fragment.
- *
- * @return the path for this URI.
- */
- public String getPath() {
- return m_path;
- }
-
- /**
- * Get the query string for this URI.
- *
- * @return the query string for this URI. Null is returned if there
- * was no "?" in the URI spec, empty string if there was a
- * "?" but no query string following it.
- */
- public String getQueryString() {
- return m_queryString;
- }
-
- /**
- * Get the fragment for this URI.
- *
- * @return the fragment for this URI. Null is returned if there
- * was no "#" in the URI spec, empty string if there was a
- * "#" but no fragment following it.
- */
- public String getFragment() {
- return m_fragment;
- }
-
- /**
- * Set the scheme for this URI. The scheme is converted to lowercase
- * before it is set.
- *
- * @param p_scheme the scheme for this URI (cannot be null)
- *
- * @exception MalformedURIException if p_scheme is not a conformant
- * scheme name
- */
- public void setScheme(String p_scheme) throws MalformedURIException {
- if (p_scheme == null) {
- throw new MalformedURIException(
- "Cannot set scheme from null string!");
- }
- if (!isConformantSchemeName(p_scheme)) {
- throw new MalformedURIException("The scheme is not conformant.");
- }
-
- m_scheme = p_scheme.toLowerCase();
- }
-
- /**
- * Set the userinfo for this URI. If a non-null value is passed in and
- * the host value is null, then an exception is thrown.
- *
- * @param p_userinfo the userinfo for this URI
- *
- * @exception MalformedURIException if p_userinfo contains invalid
- * characters
- */
- public void setUserinfo(String p_userinfo) throws MalformedURIException {
- if (p_userinfo == null) {
- m_userinfo = null;
- return;
- }
- else {
- if (m_host == null) {
- throw new MalformedURIException(
- "Userinfo cannot be set when host is null!");
- }
-
- // userinfo can contain alphanumerics, mark characters, escaped
- // and ';',':','&','=','+','$',','
- int index = 0;
- int end = p_userinfo.length();
- char testChar = '\0';
- while (index < end) {
- testChar = p_userinfo.charAt(index);
- if (testChar == '%') {
- if (index+2 >= end ||
- !isHex(p_userinfo.charAt(index+1)) ||
- !isHex(p_userinfo.charAt(index+2))) {
- throw new MalformedURIException(
- "Userinfo contains invalid escape sequence!");
- }
- }
- else if (!isUserinfoCharacter(testChar)) {
- throw new MalformedURIException(
- "Userinfo contains invalid character:"+testChar);
- }
- index++;
- }
- }
- m_userinfo = p_userinfo;
- }
-
- /**
- * <p>Set the host for this URI. If null is passed in, the userinfo
- * field is also set to null and the port is set to -1.</p>
- *
- * <p>Note: This method overwrites registry based authority if it
- * previously existed in this URI.</p>
- *
- * @param p_host the host for this URI
- *
- * @exception MalformedURIException if p_host is not a valid IP
- * address or DNS hostname.
- */
- public void setHost(String p_host) throws MalformedURIException {
- if (p_host == null || p_host.length() == 0) {
- if (p_host != null) {
- m_regAuthority = null;
- }
- m_host = p_host;
- m_userinfo = null;
- m_port = -1;
- return;
- }
- else if (!isWellFormedAddress(p_host)) {
- throw new MalformedURIException("Host is not a well formed address!");
- }
- m_host = p_host;
- m_regAuthority = null;
- }
-
- /**
- * Set the port for this URI. -1 is used to indicate that the port is
- * not specified, otherwise valid port numbers are between 0 and 65535.
- * If a valid port number is passed in and the host field is null,
- * an exception is thrown.
- *
- * @param p_port the port number for this URI
- *
- * @exception MalformedURIException if p_port is not -1 and not a
- * valid port number
- */
- public void setPort(int p_port) throws MalformedURIException {
- if (p_port >= 0 && p_port <= 65535) {
- if (m_host == null) {
- throw new MalformedURIException(
- "Port cannot be set when host is null!");
- }
- }
- else if (p_port != -1) {
- throw new MalformedURIException("Invalid port number!");
- }
- m_port = p_port;
- }
-
- /**
- * <p>Sets the registry based authority for this URI.</p>
- *
- * <p>Note: This method overwrites server based authority
- * if it previously existed in this URI.</p>
- *
- * @param authority the registry based authority for this URI
- *
- * @exception MalformedURIException it authority is not a
- * well formed registry based authority
- */
- public void setRegBasedAuthority(String authority)
- throws MalformedURIException {
-
- if (authority == null) {
- m_regAuthority = null;
- return;
- }
- // reg_name = 1*( unreserved | escaped | "$" | "," |
- // ";" | ":" | "@" | "&" | "=" | "+" )
- else if (authority.length() < 1 ||
- !isValidRegistryBasedAuthority(authority) ||
- authority.indexOf('/') != -1) {
- throw new MalformedURIException("Registry based authority is not well formed.");
- }
- m_regAuthority = authority;
- m_host = null;
- m_userinfo = null;
- m_port = -1;
- }
-
- /**
- * Set the path for this URI. If the supplied path is null, then the
- * query string and fragment are set to null as well. If the supplied
- * path includes a query string and/or fragment, these fields will be
- * parsed and set as well. Note that, for URIs following the "generic
- * URI" syntax, the path specified should start with a slash.
- * For URIs that do not follow the generic URI syntax, this method
- * sets the scheme-specific part.
- *
- * @param p_path the path for this URI (may be null)
- *
- * @exception MalformedURIException if p_path contains invalid
- * characters
- */
- public void setPath(String p_path) throws MalformedURIException {
- if (p_path == null) {
- m_path = null;
- m_queryString = null;
- m_fragment = null;
- }
- else {
- initializePath(p_path, 0);
- }
- }
-
- /**
- * Append to the end of the path of this URI. If the current path does
- * not end in a slash and the path to be appended does not begin with
- * a slash, a slash will be appended to the current path before the
- * new segment is added. Also, if the current path ends in a slash
- * and the new segment begins with a slash, the extra slash will be
- * removed before the new segment is appended.
- *
- * @param p_addToPath the new segment to be added to the current path
- *
- * @exception MalformedURIException if p_addToPath contains syntax
- * errors
- */
- public void appendPath(String p_addToPath)
- throws MalformedURIException {
- if (p_addToPath == null || p_addToPath.trim().length() == 0) {
- return;
- }
-
- if (!isURIString(p_addToPath)) {
- throw new MalformedURIException(
- "Path contains invalid character!");
- }
-
- if (m_path == null || m_path.trim().length() == 0) {
- if (p_addToPath.startsWith("/")) {
- m_path = p_addToPath;
- }
- else {
- m_path = "/" + p_addToPath;
- }
- }
- else if (m_path.endsWith("/")) {
- if (p_addToPath.startsWith("/")) {
- m_path = m_path.concat(p_addToPath.substring(1));
- }
- else {
- m_path = m_path.concat(p_addToPath);
- }
- }
- else {
- if (p_addToPath.startsWith("/")) {
- m_path = m_path.concat(p_addToPath);
- }
- else {
- m_path = m_path.concat("/" + p_addToPath);
- }
- }
- }
-
- /**
- * Set the query string for this URI. A non-null value is valid only
- * if this is an URI conforming to the generic URI syntax and
- * the path value is not null.
- *
- * @param p_queryString the query string for this URI
- *
- * @exception MalformedURIException if p_queryString is not null and this
- * URI does not conform to the generic
- * URI syntax or if the path is null
- */
- public void setQueryString(String p_queryString) throws MalformedURIException {
- if (p_queryString == null) {
- m_queryString = null;
- }
- else if (!isGenericURI()) {
- throw new MalformedURIException(
- "Query string can only be set for a generic URI!");
- }
- else if (getPath() == null) {
- throw new MalformedURIException(
- "Query string cannot be set when path is null!");
- }
- else if (!isURIString(p_queryString)) {
- throw new MalformedURIException(
- "Query string contains invalid character!");
- }
- else {
- m_queryString = p_queryString;
- }
- }
-
- /**
- * Set the fragment for this URI. A non-null value is valid only
- * if this is a URI conforming to the generic URI syntax and
- * the path value is not null.
- *
- * @param p_fragment the fragment for this URI
- *
- * @exception MalformedURIException if p_fragment is not null and this
- * URI does not conform to the generic
- * URI syntax or if the path is null
- */
- public void setFragment(String p_fragment) throws MalformedURIException {
- if (p_fragment == null) {
- m_fragment = null;
- }
- else if (!isGenericURI()) {
- throw new MalformedURIException(
- "Fragment can only be set for a generic URI!");
- }
- else if (getPath() == null) {
- throw new MalformedURIException(
- "Fragment cannot be set when path is null!");
- }
- else if (!isURIString(p_fragment)) {
- throw new MalformedURIException(
- "Fragment contains invalid character!");
- }
- else {
- m_fragment = p_fragment;
- }
- }
-
- /**
- * Determines if the passed-in Object is equivalent to this URI.
- *
- * @param p_test the Object to test for equality.
- *
- * @return true if p_test is a URI with all values equal to this
- * URI, false otherwise
- */
- @Override
- public boolean equals(Object p_test) {
- if (p_test instanceof URI) {
- URI testURI = (URI) p_test;
- if (((m_scheme == null && testURI.m_scheme == null) ||
- (m_scheme != null && testURI.m_scheme != null &&
- m_scheme.equals(testURI.m_scheme))) &&
- ((m_userinfo == null && testURI.m_userinfo == null) ||
- (m_userinfo != null && testURI.m_userinfo != null &&
- m_userinfo.equals(testURI.m_userinfo))) &&
- ((m_host == null && testURI.m_host == null) ||
- (m_host != null && testURI.m_host != null &&
- m_host.equals(testURI.m_host))) &&
- m_port == testURI.m_port &&
- ((m_path == null && testURI.m_path == null) ||
- (m_path != null && testURI.m_path != null &&
- m_path.equals(testURI.m_path))) &&
- ((m_queryString == null && testURI.m_queryString == null) ||
- (m_queryString != null && testURI.m_queryString != null &&
- m_queryString.equals(testURI.m_queryString))) &&
- ((m_fragment == null && testURI.m_fragment == null) ||
- (m_fragment != null && testURI.m_fragment != null &&
- m_fragment.equals(testURI.m_fragment)))) {
- return true;
- }
- }
- return false;
- }
-
- @Override
- public int hashCode() {
- int hash = 5;
- hash = 47 * hash + Objects.hashCode(this.m_scheme);
- hash = 47 * hash + Objects.hashCode(this.m_userinfo);
- hash = 47 * hash + Objects.hashCode(this.m_host);
- hash = 47 * hash + this.m_port;
- hash = 47 * hash + Objects.hashCode(this.m_path);
- hash = 47 * hash + Objects.hashCode(this.m_queryString);
- hash = 47 * hash + Objects.hashCode(this.m_fragment);
- return hash;
- }
-
- /**
- * Get the URI as a string specification. See RFC 2396 Section 5.2.
- *
- * @return the URI string specification
- */
- @Override
- public String toString() {
- final StringBuilder uriSpecString = new StringBuilder();
-
- if (m_scheme != null) {
- uriSpecString.append(m_scheme);
- uriSpecString.append(':');
- }
- uriSpecString.append(getSchemeSpecificPart());
- return uriSpecString.toString();
- }
-
- /**
- * Get the indicator as to whether this URI uses the "generic URI"
- * syntax.
- *
- * @return true if this URI uses the "generic URI" syntax, false
- * otherwise
- */
- public boolean isGenericURI() {
- // presence of the host (whether valid or empty) means
- // double-slashes which means generic uri
- return (m_host != null);
- }
-
- /**
- * Returns whether this URI represents an absolute URI.
- *
- * @return true if this URI represents an absolute URI, false
- * otherwise
- */
- public boolean isAbsoluteURI() {
- // presence of the scheme means absolute uri
- return (m_scheme != null);
- }
-
- /**
- * Determine whether a scheme conforms to the rules for a scheme name.
- * A scheme is conformant if it starts with an alphanumeric, and
- * contains only alphanumerics, '+','-' and '.'.
- *
- * @return true if the scheme is conformant, false otherwise
- */
- public static boolean isConformantSchemeName(String p_scheme) {
- if (p_scheme == null || p_scheme.trim().length() == 0) {
- return false;
- }
-
- if (!isAlpha(p_scheme.charAt(0))) {
- return false;
- }
-
- char testChar;
- int schemeLength = p_scheme.length();
- for (int i = 1; i < schemeLength; ++i) {
- testChar = p_scheme.charAt(i);
- if (!isSchemeCharacter(testChar)) {
- return false;
- }
- }
-
- return true;
- }
-
- /**
- * Determine whether a string is syntactically capable of representing
- * a valid IPv4 address, IPv6 reference or the domain name of a network host.
- * A valid IPv4 address consists of four decimal digit groups separated by a
- * '.'. Each group must consist of one to three digits. See RFC 2732 Section 3,
- * and RFC 2373 Section 2.2, for the definition of IPv6 references. A hostname
- * consists of domain labels (each of which must begin and end with an alphanumeric
- * but may contain '-') separated & by a '.'. See RFC 2396 Section 3.2.2.
- *
- * @return true if the string is a syntactically valid IPv4 address,
- * IPv6 reference or hostname
- */
- public static boolean isWellFormedAddress(String address) {
- if (address == null) {
- return false;
- }
-
- int addrLength = address.length();
- if (addrLength == 0) {
- return false;
- }
-
- // Check if the host is a valid IPv6reference.
- if (address.startsWith("[")) {
- return isWellFormedIPv6Reference(address);
- }
-
- // Cannot start with a '.', '-', or end with a '-'.
- if (address.startsWith(".") ||
- address.startsWith("-") ||
- address.endsWith("-")) {
- return false;
- }
-
- // rightmost domain label starting with digit indicates IP address
- // since top level domain label can only start with an alpha
- // see RFC 2396 Section 3.2.2
- int index = address.lastIndexOf('.');
- if (address.endsWith(".")) {
- index = address.substring(0, index).lastIndexOf('.');
- }
-
- if (index+1 < addrLength && isDigit(address.charAt(index+1))) {
- return isWellFormedIPv4Address(address);
- }
- else {
- // hostname = *( domainlabel "." ) toplabel [ "." ]
- // domainlabel = alphanum | alphanum *( alphanum | "-" ) alphanum
- // toplabel = alpha | alpha *( alphanum | "-" ) alphanum
-
- // RFC 2396 states that hostnames take the form described in
- // RFC 1034 (Section 3) and RFC 1123 (Section 2.1). According
- // to RFC 1034, hostnames are limited to 255 characters.
- if (addrLength > 255) {
- return false;
- }
-
- // domain labels can contain alphanumerics and '-"
- // but must start and end with an alphanumeric
- char testChar;
- int labelCharCount = 0;
-
- for (int i = 0; i < addrLength; i++) {
- testChar = address.charAt(i);
- if (testChar == '.') {
- if (!isAlphanum(address.charAt(i-1))) {
- return false;
- }
- if (i+1 < addrLength && !isAlphanum(address.charAt(i+1))) {
- return false;
- }
- labelCharCount = 0;
- }
- else if (!isAlphanum(testChar) && testChar != '-') {
- return false;
- }
- // RFC 1034: Labels must be 63 characters or less.
- else if (++labelCharCount > 63) {
- return false;
- }
- }
- }
- return true;
- }
-
- /**
- * <p>Determines whether a string is an IPv4 address as defined by
- * RFC 2373, and under the further constraint that it must be a 32-bit
- * address. Though not expressed in the grammar, in order to satisfy
- * the 32-bit address constraint, each segment of the address cannot
- * be greater than 255 (8 bits of information).</p>
- *
- * <p><code>IPv4address = 1*3DIGIT "." 1*3DIGIT "." 1*3DIGIT "." 1*3DIGIT</code></p>
- *
- * @return true if the string is a syntactically valid IPv4 address
- */
- public static boolean isWellFormedIPv4Address(String address) {
-
- int addrLength = address.length();
- char testChar;
- int numDots = 0;
- int numDigits = 0;
-
- // make sure that 1) we see only digits and dot separators, 2) that
- // any dot separator is preceded and followed by a digit and
- // 3) that we find 3 dots
- //
- // RFC 2732 amended RFC 2396 by replacing the definition
- // of IPv4address with the one defined by RFC 2373. - mrglavas
- //
- // IPv4address = 1*3DIGIT "." 1*3DIGIT "." 1*3DIGIT "." 1*3DIGIT
- //
- // One to three digits must be in each segment.
- for (int i = 0; i < addrLength; i++) {
- testChar = address.charAt(i);
- if (testChar == '.') {
- if ((i > 0 && !isDigit(address.charAt(i-1))) ||
- (i+1 < addrLength && !isDigit(address.charAt(i+1)))) {
- return false;
- }
- numDigits = 0;
- if (++numDots > 3) {
- return false;
- }
- }
- else if (!isDigit(testChar)) {
- return false;
- }
- // Check that that there are no more than three digits
- // in this segment.
- else if (++numDigits > 3) {
- return false;
- }
- // Check that this segment is not greater than 255.
- else if (numDigits == 3) {
- char first = address.charAt(i-2);
- char second = address.charAt(i-1);
- if (!(first < '2' ||
- (first == '2' &&
- (second < '5' ||
- (second == '5' && testChar <= '5'))))) {
- return false;
- }
- }
- }
- return (numDots == 3);
- }
-
- /**
- * <p>Determines whether a string is an IPv6 reference as defined
- * by RFC 2732, where IPv6address is defined in RFC 2373. The
- * IPv6 address is parsed according to Section 2.2 of RFC 2373,
- * with the additional constraint that the address be composed of
- * 128 bits of information.</p>
- *
- * <p><code>IPv6reference = "[" IPv6address "]"</code></p>
- *
- * <p>Note: The BNF expressed in RFC 2373 Appendix B does not
- * accurately describe section 2.2, and was in fact removed from
- * RFC 3513, the successor of RFC 2373.</p>
- *
- * @return true if the string is a syntactically valid IPv6 reference
- */
- public static boolean isWellFormedIPv6Reference(String address) {
-
- int addrLength = address.length();
- int index = 1;
- int end = addrLength-1;
-
- // Check if string is a potential match for IPv6reference.
- if (!(addrLength > 2 && address.charAt(0) == '['
- && address.charAt(end) == ']')) {
- return false;
- }
-
- // Counter for the number of 16-bit sections read in the address.
- int [] counter = new int[1];
-
- // Scan hex sequence before possible '::' or IPv4 address.
- index = scanHexSequence(address, index, end, counter);
- if (index == -1) {
- return false;
- }
- // Address must contain 128-bits of information.
- else if (index == end) {
- return (counter[0] == 8);
- }
-
- if (index+1 < end && address.charAt(index) == ':') {
- if (address.charAt(index+1) == ':') {
- // '::' represents at least one 16-bit group of zeros.
- if (++counter[0] > 8) {
- return false;
- }
- index += 2;
- // Trailing zeros will fill out the rest of the address.
- if (index == end) {
- return true;
- }
- }
- // If the second character wasn't ':', in order to be valid,
- // the remainder of the string must match IPv4Address,
- // and we must have read exactly 6 16-bit groups.
- else {
- return (counter[0] == 6) &&
- isWellFormedIPv4Address(address.substring(index+1, end));
- }
- }
- else {
- return false;
- }
-
- // 3. Scan hex sequence after '::'.
- int prevCount = counter[0];
- index = scanHexSequence(address, index, end, counter);
-
- // We've either reached the end of the string, the address ends in
- // an IPv4 address, or it is invalid. scanHexSequence has already
- // made sure that we have the right number of bits.
- return (index == end) ||
- (index != -1 && isWellFormedIPv4Address(
- address.substring((counter[0] > prevCount) ? index+1 : index, end)));
- }
-
- /**
- * Helper method for isWellFormedIPv6Reference which scans the
- * hex sequences of an IPv6 address. It returns the index of the
- * next character to scan in the address, or -1 if the string
- * cannot match a valid IPv6 address.
- *
- * @param address the string to be scanned
- * @param index the beginning index (inclusive)
- * @param end the ending index (exclusive)
- * @param counter a counter for the number of 16-bit sections read
- * in the address
- *
- * @return the index of the next character to scan, or -1 if the
- * string cannot match a valid IPv6 address
- */
- private static int scanHexSequence (String address, int index, int end, int [] counter) {
-
- char testChar;
- int numDigits = 0;
- int start = index;
-
- // Trying to match the following productions:
- // hexseq = hex4 *( ":" hex4)
- // hex4 = 1*4HEXDIG
- for (; index < end; ++index) {
- testChar = address.charAt(index);
- if (testChar == ':') {
- // IPv6 addresses are 128-bit, so there can be at most eight sections.
- if (numDigits > 0 && ++counter[0] > 8) {
- return -1;
- }
- // This could be '::'.
- if (numDigits == 0 || ((index+1 < end) && address.charAt(index+1) == ':')) {
- return index;
- }
- numDigits = 0;
- }
- // This might be invalid or an IPv4address. If it's potentially an IPv4address,
- // backup to just after the last valid character that matches hexseq.
- else if (!isHex(testChar)) {
- if (testChar == '.' && numDigits < 4 && numDigits > 0 && counter[0] <= 6) {
- int back = index - numDigits - 1;
- return (back >= start) ? back : (back+1);
- }
- return -1;
- }
- // There can be at most 4 hex digits per group.
- else if (++numDigits > 4) {
- return -1;
- }
- }
- return (numDigits > 0 && ++counter[0] <= 8) ? end : -1;
- }
-
-
- /**
- * Determine whether a char is a digit.
- *
- * @return true if the char is betweeen '0' and '9', false otherwise
- */
- private static boolean isDigit(char p_char) {
- return p_char >= '0' && p_char <= '9';
- }
-
- /**
- * Determine whether a character is a hexadecimal character.
- *
- * @return true if the char is betweeen '0' and '9', 'a' and 'f'
- * or 'A' and 'F', false otherwise
- */
- private static boolean isHex(char p_char) {
- return (p_char <= 'f' && (fgLookupTable[p_char] & ASCII_HEX_CHARACTERS) != 0);
- }
-
- /**
- * Determine whether a char is an alphabetic character: a-z or A-Z
- *
- * @return true if the char is alphabetic, false otherwise
- */
- private static boolean isAlpha(char p_char) {
- return ((p_char >= 'a' && p_char <= 'z') || (p_char >= 'A' && p_char <= 'Z' ));
- }
-
- /**
- * Determine whether a char is an alphanumeric: 0-9, a-z or A-Z
- *
- * @return true if the char is alphanumeric, false otherwise
- */
- private static boolean isAlphanum(char p_char) {
- return (p_char <= 'z' && (fgLookupTable[p_char] & MASK_ALPHA_NUMERIC) != 0);
- }
-
- /**
- * Determine whether a character is a reserved character:
- * ';', '/', '?', ':', '@', '&', '=', '+', '$', ',', '[', or ']'
- *
- * @return true if the string contains any reserved characters
- */
- private static boolean isReservedCharacter(char p_char) {
- return (p_char <= ']' && (fgLookupTable[p_char] & RESERVED_CHARACTERS) != 0);
- }
-
- /**
- * Determine whether a char is an unreserved character.
- *
- * @return true if the char is unreserved, false otherwise
- */
- private static boolean isUnreservedCharacter(char p_char) {
- return (p_char <= '~' && (fgLookupTable[p_char] & MASK_UNRESERVED_MASK) != 0);
- }
-
- /**
- * Determine whether a char is a URI character (reserved or
- * unreserved, not including '%' for escaped octets).
- *
- * @return true if the char is a URI character, false otherwise
- */
- private static boolean isURICharacter (char p_char) {
- return (p_char <= '~' && (fgLookupTable[p_char] & MASK_URI_CHARACTER) != 0);
- }
-
- /**
- * Determine whether a char is a scheme character.
- *
- * @return true if the char is a scheme character, false otherwise
- */
- private static boolean isSchemeCharacter (char p_char) {
- return (p_char <= 'z' && (fgLookupTable[p_char] & MASK_SCHEME_CHARACTER) != 0);
- }
-
- /**
- * Determine whether a char is a userinfo character.
- *
- * @return true if the char is a userinfo character, false otherwise
- */
- private static boolean isUserinfoCharacter (char p_char) {
- return (p_char <= 'z' && (fgLookupTable[p_char] & MASK_USERINFO_CHARACTER) != 0);
- }
-
- /**
- * Determine whether a char is a path character.
- *
- * @return true if the char is a path character, false otherwise
- */
- private static boolean isPathCharacter (char p_char) {
- return (p_char <= '~' && (fgLookupTable[p_char] & MASK_PATH_CHARACTER) != 0);
- }
-
-
- /**
- * Determine whether a given string contains only URI characters (also
- * called "uric" in RFC 2396). uric consist of all reserved
- * characters, unreserved characters and escaped characters.
- *
- * @return true if the string is comprised of uric, false otherwise
- */
- private static boolean isURIString(String p_uric) {
- if (p_uric == null) {
- return false;
- }
- int end = p_uric.length();
- char testChar = '\0';
- for (int i = 0; i < end; i++) {
- testChar = p_uric.charAt(i);
- if (testChar == '%') {
- if (i+2 >= end ||
- !isHex(p_uric.charAt(i+1)) ||
- !isHex(p_uric.charAt(i+2))) {
- return false;
- }
- else {
- i += 2;
- continue;
- }
- }
- if (isURICharacter(testChar)) {
- continue;
- }
- else {
- return false;
- }
- }
- return true;
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/util/XML11Char.java b/src/com/sun/org/apache/xerces/internal/util/XML11Char.java
deleted file mode 100644
index d19518e..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/XML11Char.java
+++ /dev/null
@@ -1,415 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.util;
-
-import java.util.Arrays;
-
-/**
- * This class defines the basic properties of characters in XML 1.1. The data
- * in this class can be used to verify that a character is a valid
- * XML 1.1 character or if the character is a space, name start, or name
- * character.
- * <p>
- * A series of convenience methods are supplied to ease the burden
- * of the developer. Using the character as an index into the <code>XML11CHARS</code>
- * array and applying the appropriate mask flag (e.g.
- * <code>MASK_VALID</code>), yields the same results as calling the
- * convenience methods. There is one exception: check the comments
- * for the <code>isValid</code> method for details.
- *
- * @author Glenn Marcy, IBM
- * @author Andy Clark, IBM
- * @author Arnaud Le Hors, IBM
- * @author Neil Graham, IBM
- * @author Michael Glavassevich, IBM
- *
- * @version $Id: XML11Char.java,v 1.7 2010-11-01 04:40:15 joehw Exp $
- */
-public class XML11Char {
-
- //
- // Constants
- //
-
- /** Character flags for XML 1.1. */
- private static final byte XML11CHARS [] = new byte [1 << 16];
-
- /** XML 1.1 Valid character mask. */
- public static final int MASK_XML11_VALID = 0x01;
-
- /** XML 1.1 Space character mask. */
- public static final int MASK_XML11_SPACE = 0x02;
-
- /** XML 1.1 Name start character mask. */
- public static final int MASK_XML11_NAME_START = 0x04;
-
- /** XML 1.1 Name character mask. */
- public static final int MASK_XML11_NAME = 0x08;
-
- /** XML 1.1 control character mask */
- public static final int MASK_XML11_CONTROL = 0x10;
-
- /** XML 1.1 content for external entities (valid - "special" chars - control chars) */
- public static final int MASK_XML11_CONTENT = 0x20;
-
- /** XML namespaces 1.1 NCNameStart */
- public static final int MASK_XML11_NCNAME_START = 0x40;
-
- /** XML namespaces 1.1 NCName */
- public static final int MASK_XML11_NCNAME = 0x80;
-
- /** XML 1.1 content for internal entities (valid - "special" chars) */
- public static final int MASK_XML11_CONTENT_INTERNAL = MASK_XML11_CONTROL | MASK_XML11_CONTENT;
-
- //
- // Static initialization
- //
-
- static {
-
- // Initializing the Character Flag Array
- // Code generated by: XML11CharGenerator.
-
- Arrays.fill(XML11CHARS, 1, 9, (byte) 17 ); // Fill 8 of value (byte) 17
- XML11CHARS[9] = 35;
- XML11CHARS[10] = 3;
- Arrays.fill(XML11CHARS, 11, 13, (byte) 17 ); // Fill 2 of value (byte) 17
- XML11CHARS[13] = 3;
- Arrays.fill(XML11CHARS, 14, 32, (byte) 17 ); // Fill 18 of value (byte) 17
- XML11CHARS[32] = 35;
- Arrays.fill(XML11CHARS, 33, 38, (byte) 33 ); // Fill 5 of value (byte) 33
- XML11CHARS[38] = 1;
- Arrays.fill(XML11CHARS, 39, 45, (byte) 33 ); // Fill 6 of value (byte) 33
- Arrays.fill(XML11CHARS, 45, 47, (byte) -87 ); // Fill 2 of value (byte) -87
- XML11CHARS[47] = 33;
- Arrays.fill(XML11CHARS, 48, 58, (byte) -87 ); // Fill 10 of value (byte) -87
- XML11CHARS[58] = 45;
- XML11CHARS[59] = 33;
- XML11CHARS[60] = 1;
- Arrays.fill(XML11CHARS, 61, 65, (byte) 33 ); // Fill 4 of value (byte) 33
- Arrays.fill(XML11CHARS, 65, 91, (byte) -19 ); // Fill 26 of value (byte) -19
- Arrays.fill(XML11CHARS, 91, 93, (byte) 33 ); // Fill 2 of value (byte) 33
- XML11CHARS[93] = 1;
- XML11CHARS[94] = 33;
- XML11CHARS[95] = -19;
- XML11CHARS[96] = 33;
- Arrays.fill(XML11CHARS, 97, 123, (byte) -19 ); // Fill 26 of value (byte) -19
- Arrays.fill(XML11CHARS, 123, 127, (byte) 33 ); // Fill 4 of value (byte) 33
- Arrays.fill(XML11CHARS, 127, 133, (byte) 17 ); // Fill 6 of value (byte) 17
- XML11CHARS[133] = 35;
- Arrays.fill(XML11CHARS, 134, 160, (byte) 17 ); // Fill 26 of value (byte) 17
- Arrays.fill(XML11CHARS, 160, 183, (byte) 33 ); // Fill 23 of value (byte) 33
- XML11CHARS[183] = -87;
- Arrays.fill(XML11CHARS, 184, 192, (byte) 33 ); // Fill 8 of value (byte) 33
- Arrays.fill(XML11CHARS, 192, 215, (byte) -19 ); // Fill 23 of value (byte) -19
- XML11CHARS[215] = 33;
- Arrays.fill(XML11CHARS, 216, 247, (byte) -19 ); // Fill 31 of value (byte) -19
- XML11CHARS[247] = 33;
- Arrays.fill(XML11CHARS, 248, 768, (byte) -19 ); // Fill 520 of value (byte) -19
- Arrays.fill(XML11CHARS, 768, 880, (byte) -87 ); // Fill 112 of value (byte) -87
- Arrays.fill(XML11CHARS, 880, 894, (byte) -19 ); // Fill 14 of value (byte) -19
- XML11CHARS[894] = 33;
- Arrays.fill(XML11CHARS, 895, 8192, (byte) -19 ); // Fill 7297 of value (byte) -19
- Arrays.fill(XML11CHARS, 8192, 8204, (byte) 33 ); // Fill 12 of value (byte) 33
- Arrays.fill(XML11CHARS, 8204, 8206, (byte) -19 ); // Fill 2 of value (byte) -19
- Arrays.fill(XML11CHARS, 8206, 8232, (byte) 33 ); // Fill 26 of value (byte) 33
- XML11CHARS[8232] = 35;
- Arrays.fill(XML11CHARS, 8233, 8255, (byte) 33 ); // Fill 22 of value (byte) 33
- Arrays.fill(XML11CHARS, 8255, 8257, (byte) -87 ); // Fill 2 of value (byte) -87
- Arrays.fill(XML11CHARS, 8257, 8304, (byte) 33 ); // Fill 47 of value (byte) 33
- Arrays.fill(XML11CHARS, 8304, 8592, (byte) -19 ); // Fill 288 of value (byte) -19
- Arrays.fill(XML11CHARS, 8592, 11264, (byte) 33 ); // Fill 2672 of value (byte) 33
- Arrays.fill(XML11CHARS, 11264, 12272, (byte) -19 ); // Fill 1008 of value (byte) -19
- Arrays.fill(XML11CHARS, 12272, 12289, (byte) 33 ); // Fill 17 of value (byte) 33
- Arrays.fill(XML11CHARS, 12289, 55296, (byte) -19 ); // Fill 43007 of value (byte) -19
- Arrays.fill(XML11CHARS, 57344, 63744, (byte) 33 ); // Fill 6400 of value (byte) 33
- Arrays.fill(XML11CHARS, 63744, 64976, (byte) -19 ); // Fill 1232 of value (byte) -19
- Arrays.fill(XML11CHARS, 64976, 65008, (byte) 33 ); // Fill 32 of value (byte) 33
- Arrays.fill(XML11CHARS, 65008, 65534, (byte) -19 ); // Fill 526 of value (byte) -19
-
- } // <clinit>()
-
- //
- // Public static methods
- //
-
- /**
- * Returns true if the specified character is a space character
- * as amdended in the XML 1.1 specification.
- *
- * @param c The character to check.
- */
- public static boolean isXML11Space(int c) {
- return (c < 0x10000 && (XML11CHARS[c] & MASK_XML11_SPACE) != 0);
- } // isXML11Space(int):boolean
-
- /**
- * Returns true if the specified character is valid. This method
- * also checks the surrogate character range from 0x10000 to 0x10FFFF.
- * <p>
- * If the program chooses to apply the mask directly to the
- * <code>XML11CHARS</code> array, then they are responsible for checking
- * the surrogate character range.
- *
- * @param c The character to check.
- */
- public static boolean isXML11Valid(int c) {
- return (c < 0x10000 && (XML11CHARS[c] & MASK_XML11_VALID) != 0)
- || (0x10000 <= c && c <= 0x10FFFF);
- } // isXML11Valid(int):boolean
-
- /**
- * Returns true if the specified character is invalid.
- *
- * @param c The character to check.
- */
- public static boolean isXML11Invalid(int c) {
- return !isXML11Valid(c);
- } // isXML11Invalid(int):boolean
-
- /**
- * Returns true if the specified character is valid and permitted outside
- * of a character reference.
- * That is, this method will return false for the same set as
- * isXML11Valid, except it also reports false for "control characters".
- *
- * @param c The character to check.
- */
- public static boolean isXML11ValidLiteral(int c) {
- return ((c < 0x10000 && ((XML11CHARS[c] & MASK_XML11_VALID) != 0 && (XML11CHARS[c] & MASK_XML11_CONTROL) == 0))
- || (0x10000 <= c && c <= 0x10FFFF));
- } // isXML11ValidLiteral(int):boolean
-
- /**
- * Returns true if the specified character can be considered
- * content in an external parsed entity.
- *
- * @param c The character to check.
- */
- public static boolean isXML11Content(int c) {
- return (c < 0x10000 && (XML11CHARS[c] & MASK_XML11_CONTENT) != 0) ||
- (0x10000 <= c && c <= 0x10FFFF);
- } // isXML11Content(int):boolean
-
- /**
- * Returns true if the specified character can be considered
- * content in an internal parsed entity.
- *
- * @param c The character to check.
- */
- public static boolean isXML11InternalEntityContent(int c) {
- return (c < 0x10000 && (XML11CHARS[c] & MASK_XML11_CONTENT_INTERNAL) != 0) ||
- (0x10000 <= c && c <= 0x10FFFF);
- } // isXML11InternalEntityContent(int):boolean
-
- /**
- * Returns true if the specified character is a valid name start
- * character as defined by production [4] in the XML 1.1
- * specification.
- *
- * @param c The character to check.
- */
- public static boolean isXML11NameStart(int c) {
- return (c < 0x10000 && (XML11CHARS[c] & MASK_XML11_NAME_START) != 0)
- || (0x10000 <= c && c < 0xF0000);
- } // isXML11NameStart(int):boolean
-
- /**
- * Returns true if the specified character is a valid name
- * character as defined by production [4a] in the XML 1.1
- * specification.
- *
- * @param c The character to check.
- */
- public static boolean isXML11Name(int c) {
- return (c < 0x10000 && (XML11CHARS[c] & MASK_XML11_NAME) != 0)
- || (c >= 0x10000 && c < 0xF0000);
- } // isXML11Name(int):boolean
-
- /**
- * Returns true if the specified character is a valid NCName start
- * character as defined by production [4] in Namespaces in XML
- * 1.1 recommendation.
- *
- * @param c The character to check.
- */
- public static boolean isXML11NCNameStart(int c) {
- return (c < 0x10000 && (XML11CHARS[c] & MASK_XML11_NCNAME_START) != 0)
- || (0x10000 <= c && c < 0xF0000);
- } // isXML11NCNameStart(int):boolean
-
- /**
- * Returns true if the specified character is a valid NCName
- * character as defined by production [5] in Namespaces in XML
- * 1.1 recommendation.
- *
- * @param c The character to check.
- */
- public static boolean isXML11NCName(int c) {
- return (c < 0x10000 && (XML11CHARS[c] & MASK_XML11_NCNAME) != 0)
- || (0x10000 <= c && c < 0xF0000);
- } // isXML11NCName(int):boolean
-
- /**
- * Returns whether the given character is a valid
- * high surrogate for a name character. This includes
- * all high surrogates for characters [0x10000-0xEFFFF].
- * In other words everything excluding planes 15 and 16.
- *
- * @param c The character to check.
- */
- public static boolean isXML11NameHighSurrogate(int c) {
- return (0xD800 <= c && c <= 0xDB7F);
- }
-
- /*
- * [5] Name ::= NameStartChar NameChar*
- */
- /**
- * Check to see if a string is a valid Name according to [5]
- * in the XML 1.1 Recommendation
- *
- * @param name string to check
- * @return true if name is a valid Name
- */
- public static boolean isXML11ValidName(String name) {
- final int length = name.length();
- if (length == 0) {
- return false;
- }
- int i = 1;
- char ch = name.charAt(0);
- if (!isXML11NameStart(ch)) {
- if (length > 1 && isXML11NameHighSurrogate(ch)) {
- char ch2 = name.charAt(1);
- if (!XMLChar.isLowSurrogate(ch2) ||
- !isXML11NameStart(XMLChar.supplemental(ch, ch2))) {
- return false;
- }
- i = 2;
- }
- else {
- return false;
- }
- }
- while (i < length) {
- ch = name.charAt(i);
- if (!isXML11Name(ch)) {
- if (++i < length && isXML11NameHighSurrogate(ch)) {
- char ch2 = name.charAt(i);
- if (!XMLChar.isLowSurrogate(ch2) ||
- !isXML11Name(XMLChar.supplemental(ch, ch2))) {
- return false;
- }
- }
- else {
- return false;
- }
- }
- ++i;
- }
- return true;
- } // isXML11ValidName(String):boolean
-
- /*
- * from the namespace 1.1 rec
- * [4] NCName ::= NCNameStartChar NCNameChar*
- */
- /**
- * Check to see if a string is a valid NCName according to [4]
- * from the XML Namespaces 1.1 Recommendation
- *
- * @param ncName string to check
- * @return true if name is a valid NCName
- */
- public static boolean isXML11ValidNCName(String ncName) {
- final int length = ncName.length();
- if (length == 0) {
- return false;
- }
- int i = 1;
- char ch = ncName.charAt(0);
- if (!isXML11NCNameStart(ch)) {
- if (length > 1 && isXML11NameHighSurrogate(ch)) {
- char ch2 = ncName.charAt(1);
- if (!XMLChar.isLowSurrogate(ch2) ||
- !isXML11NCNameStart(XMLChar.supplemental(ch, ch2))) {
- return false;
- }
- i = 2;
- }
- else {
- return false;
- }
- }
- while (i < length) {
- ch = ncName.charAt(i);
- if (!isXML11NCName(ch)) {
- if (++i < length && isXML11NameHighSurrogate(ch)) {
- char ch2 = ncName.charAt(i);
- if (!XMLChar.isLowSurrogate(ch2) ||
- !isXML11NCName(XMLChar.supplemental(ch, ch2))) {
- return false;
- }
- }
- else {
- return false;
- }
- }
- ++i;
- }
- return true;
- } // isXML11ValidNCName(String):boolean
-
- /*
- * [7] Nmtoken ::= (NameChar)+
- */
- /**
- * Check to see if a string is a valid Nmtoken according to [7]
- * in the XML 1.1 Recommendation
- *
- * @param nmtoken string to check
- * @return true if nmtoken is a valid Nmtoken
- */
- public static boolean isXML11ValidNmtoken(String nmtoken) {
- final int length = nmtoken.length();
- if (length == 0) {
- return false;
- }
- for (int i = 0; i < length; ++i) {
- char ch = nmtoken.charAt(i);
- if (!isXML11Name(ch)) {
- if (++i < length && isXML11NameHighSurrogate(ch)) {
- char ch2 = nmtoken.charAt(i);
- if (!XMLChar.isLowSurrogate(ch2) ||
- !isXML11Name(XMLChar.supplemental(ch, ch2))) {
- return false;
- }
- }
- else {
- return false;
- }
- }
- }
- return true;
- } // isXML11ValidName(String):boolean
-
-} // class XML11Char
diff --git a/src/com/sun/org/apache/xerces/internal/util/XMLAttributesImpl.java b/src/com/sun/org/apache/xerces/internal/util/XMLAttributesImpl.java
deleted file mode 100644
index a02d54a..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/XMLAttributesImpl.java
+++ /dev/null
@@ -1,1296 +0,0 @@
-/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.util;
-
-import com.sun.org.apache.xerces.internal.xni.Augmentations;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
-import com.sun.org.apache.xerces.internal.xni.XMLString;
-import com.sun.xml.internal.stream.XMLBufferListener;
-/**
- * The XMLAttributesImpl class is an implementation of the XMLAttributes
- * interface which defines a collection of attributes for an element.
- * In the parser, the document source would scan the entire start element
- * and collect the attributes. The attributes are communicated to the
- * document handler in the startElement method.
- * <p>
- * The attributes are read-write so that subsequent stages in the document
- * pipeline can modify the values or change the attributes that are
- * propogated to the next stage.
- *
- * @see com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler#startElement
- *
- * @author Andy Clark, IBM
- * @author Elena Litani, IBM
- * @author Michael Glavassevich, IBM
- *
- * @version $Id: XMLAttributesImpl.java,v 1.7 2010/05/07 20:13:09 joehw Exp $
- */
-public class XMLAttributesImpl
-implements XMLAttributes, XMLBufferListener {
-
- //
- // Constants
- //
-
- /** Default table size. */
- protected static final int TABLE_SIZE = 101;
-
- /** Maximum hash collisions per bucket. */
- protected static final int MAX_HASH_COLLISIONS = 40;
-
- protected static final int MULTIPLIERS_SIZE = 1 << 5;
- protected static final int MULTIPLIERS_MASK = MULTIPLIERS_SIZE - 1;
-
- /**
- * Threshold at which an instance is treated
- * as a large attribute list.
- */
- protected static final int SIZE_LIMIT = 20;
-
- //
- // Data
- //
-
- // features
-
- /** Namespaces. */
- protected boolean fNamespaces = true;
-
- // data
-
- /**
- * Usage count for the attribute table view.
- * Incremented each time all attributes are removed
- * when the attribute table view is in use.
- */
- protected int fLargeCount = 1;
-
- /** Attribute count. */
- protected int fLength;
-
- /** Attribute information. */
- protected Attribute[] fAttributes = new Attribute[4];
-
- /**
- * Provides an alternate view of the attribute specification.
- */
- protected Attribute[] fAttributeTableView;
-
- /**
- * Tracks whether each chain in the hash table is stale
- * with respect to the current state of this object.
- * A chain is stale if its state is not the same as the number
- * of times the attribute table view has been used.
- */
- protected int[] fAttributeTableViewChainState;
-
- /**
- * Actual number of buckets in the table view.
- */
- protected int fTableViewBuckets;
-
- /**
- * Indicates whether the table view contains consistent data.
- */
- protected boolean fIsTableViewConsistent;
-
- /**
- * Array of randomly selected hash function multipliers or <code>null</code>
- * if the default String.hashCode() function should be used.
- */
- protected int[] fHashMultipliers;
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- public XMLAttributesImpl() {
- this(TABLE_SIZE);
- }
-
- /**
- * @param tableSize initial size of table view
- */
- public XMLAttributesImpl(int tableSize) {
- fTableViewBuckets = tableSize;
- for (int i = 0; i < fAttributes.length; i++) {
- fAttributes[i] = new Attribute();
- }
- } // <init>()
-
- //
- // Public methods
- //
-
- /**
- * Sets whether namespace processing is being performed. This state
- * is needed to return the correct value from the getLocalName method.
- *
- * @param namespaces True if namespace processing is turned on.
- *
- * @see #getLocalName
- */
- public void setNamespaces(boolean namespaces) {
- fNamespaces = namespaces;
- } // setNamespaces(boolean)
-
- //
- // XMLAttributes methods
- //
-
- /**
- * Adds an attribute. The attribute's non-normalized value of the
- * attribute will have the same value as the attribute value until
- * set using the <code>setNonNormalizedValue</code> method. Also,
- * the added attribute will be marked as specified in the XML instance
- * document unless set otherwise using the <code>setSpecified</code>
- * method.
- * <p>
- * <strong>Note:</strong> If an attribute of the same name already
- * exists, the old values for the attribute are replaced by the new
- * values.
- *
- * @param name The attribute name.
- * @param type The attribute type. The type name is determined by
- * the type specified for this attribute in the DTD.
- * For example: "CDATA", "ID", "NMTOKEN", etc. However,
- * attributes of type enumeration will have the type
- * value specified as the pipe ('|') separated list of
- * the enumeration values prefixed by an open
- * parenthesis and suffixed by a close parenthesis.
- * For example: "(true|false)".
- * @param value The attribute value.
- *
- * @return Returns the attribute index.
- *
- * @see #setNonNormalizedValue
- * @see #setSpecified
- */
- public int addAttribute(QName name, String type, String value) {
- return addAttribute(name,type,value,null);
- }
- public int addAttribute(QName name, String type, String value,XMLString valueCache) {
-
- int index;
- if (fLength < SIZE_LIMIT) {
- index = name.uri != null && !name.uri.equals("")
- ? getIndexFast(name.uri, name.localpart)
- : getIndexFast(name.rawname);
-
- if (index == -1) {
- index = fLength;
- if (fLength++ == fAttributes.length) {
- Attribute[] attributes = new Attribute[fAttributes.length + 4];
- System.arraycopy(fAttributes, 0, attributes, 0, fAttributes.length);
- for (int i = fAttributes.length; i < attributes.length; i++) {
- attributes[i] = new Attribute();
- }
- fAttributes = attributes;
- }
- }
- }
- else if (name.uri == null ||
- name.uri.length() == 0 ||
- (index = getIndexFast(name.uri, name.localpart)) == -1) {
-
- /**
- * If attributes were removed from the list after the table
- * becomes in use this isn't reflected in the table view. It's
- * assumed that once a user starts removing attributes they're
- * not likely to add more. We only make the view consistent if
- * the user of this class adds attributes, removes them, and
- * then adds more.
- */
- if (!fIsTableViewConsistent || fLength == SIZE_LIMIT ||
- (fLength > SIZE_LIMIT && fLength > fTableViewBuckets)) {
- prepareAndPopulateTableView();
- fIsTableViewConsistent = true;
- }
-
- int bucket = getTableViewBucket(name.rawname);
-
- // The chain is stale.
- // This must be a unique attribute.
- if (fAttributeTableViewChainState[bucket] != fLargeCount) {
- index = fLength;
- if (fLength++ == fAttributes.length) {
- Attribute[] attributes = new Attribute[fAttributes.length << 1];
- System.arraycopy(fAttributes, 0, attributes, 0, fAttributes.length);
- for (int i = fAttributes.length; i < attributes.length; i++) {
- attributes[i] = new Attribute();
- }
- fAttributes = attributes;
- }
-
- // Update table view.
- fAttributeTableViewChainState[bucket] = fLargeCount;
- fAttributes[index].next = null;
- fAttributeTableView[bucket] = fAttributes[index];
- }
- // This chain is active.
- // We need to check if any of the attributes has the same rawname.
- else {
- // Search the table.
- int collisionCount = 0;
- Attribute found = fAttributeTableView[bucket];
- while (found != null) {
- if (found.name.rawname == name.rawname) {
- break;
- }
- found = found.next;
- ++collisionCount;
- }
- // This attribute is unique.
- if (found == null) {
- index = fLength;
- if (fLength++ == fAttributes.length) {
- Attribute[] attributes = new Attribute[fAttributes.length << 1];
- System.arraycopy(fAttributes, 0, attributes, 0, fAttributes.length);
- for (int i = fAttributes.length; i < attributes.length; i++) {
- attributes[i] = new Attribute();
- }
- fAttributes = attributes;
- }
-
- // Select a new hash function and rehash the table view
- // if the collision threshold is exceeded.
- if (collisionCount >= MAX_HASH_COLLISIONS) {
- // The current attribute will be processed in the rehash.
- // Need to set its name first.
- fAttributes[index].name.setValues(name);
- rebalanceTableView(fLength);
- }
- else {
- // Update table view
- fAttributes[index].next = fAttributeTableView[bucket];
- fAttributeTableView[bucket] = fAttributes[index];
- }
- }
- // Duplicate. We still need to find the index.
- else {
- index = getIndexFast(name.rawname);
- }
- }
- }
-
- // set values
- Attribute attribute = fAttributes[index];
- attribute.name.setValues(name);
- attribute.type = type;
- attribute.value = value;
- attribute.xmlValue = valueCache;
- attribute.nonNormalizedValue = value;
- attribute.specified = false;
-
- // clear augmentations
- if(attribute.augs != null)
- attribute.augs.removeAllItems();
-
- return index;
-
- } // addAttribute(QName,String,XMLString)
-
- /**
- * Removes all of the attributes. This method will also remove all
- * entities associated to the attributes.
- */
- public void removeAllAttributes() {
- fLength = 0;
- } // removeAllAttributes()
-
- /**
- * Removes the attribute at the specified index.
- * <p>
- * <strong>Note:</strong> This operation changes the indexes of all
- * attributes following the attribute at the specified index.
- *
- * @param attrIndex The attribute index.
- */
- public void removeAttributeAt(int attrIndex) {
- fIsTableViewConsistent = false;
- if (attrIndex < fLength - 1) {
- Attribute removedAttr = fAttributes[attrIndex];
- System.arraycopy(fAttributes, attrIndex + 1,
- fAttributes, attrIndex, fLength - attrIndex - 1);
- // Make the discarded Attribute object available for re-use
- // by tucking it after the Attributes that are still in use
- fAttributes[fLength-1] = removedAttr;
- }
- fLength--;
- } // removeAttributeAt(int)
-
- /**
- * Sets the name of the attribute at the specified index.
- *
- * @param attrIndex The attribute index.
- * @param attrName The new attribute name.
- */
- public void setName(int attrIndex, QName attrName) {
- fAttributes[attrIndex].name.setValues(attrName);
- } // setName(int,QName)
-
- /**
- * Sets the fields in the given QName structure with the values
- * of the attribute name at the specified index.
- *
- * @param attrIndex The attribute index.
- * @param attrName The attribute name structure to fill in.
- */
- public void getName(int attrIndex, QName attrName) {
- attrName.setValues(fAttributes[attrIndex].name);
- } // getName(int,QName)
-
- /**
- * Sets the type of the attribute at the specified index.
- *
- * @param attrIndex The attribute index.
- * @param attrType The attribute type. The type name is determined by
- * the type specified for this attribute in the DTD.
- * For example: "CDATA", "ID", "NMTOKEN", etc. However,
- * attributes of type enumeration will have the type
- * value specified as the pipe ('|') separated list of
- * the enumeration values prefixed by an open
- * parenthesis and suffixed by a close parenthesis.
- * For example: "(true|false)".
- */
- public void setType(int attrIndex, String attrType) {
- fAttributes[attrIndex].type = attrType;
- } // setType(int,String)
-
- /**
- * Sets the value of the attribute at the specified index. This
- * method will overwrite the non-normalized value of the attribute.
- *
- * @param attrIndex The attribute index.
- * @param attrValue The new attribute value.
- *
- * @see #setNonNormalizedValue
- */
- public void setValue(int attrIndex, String attrValue) {
- setValue(attrIndex,attrValue,null);
- }
-
- public void setValue(int attrIndex, String attrValue,XMLString value) {
- Attribute attribute = fAttributes[attrIndex];
- attribute.value = attrValue;
- attribute.nonNormalizedValue = attrValue;
- attribute.xmlValue = value;
- } // setValue(int,String)
-
- /**
- * Sets the non-normalized value of the attribute at the specified
- * index.
- *
- * @param attrIndex The attribute index.
- * @param attrValue The new non-normalized attribute value.
- */
- public void setNonNormalizedValue(int attrIndex, String attrValue) {
- if (attrValue == null) {
- attrValue = fAttributes[attrIndex].value;
- }
- fAttributes[attrIndex].nonNormalizedValue = attrValue;
- } // setNonNormalizedValue(int,String)
-
- /**
- * Returns the non-normalized value of the attribute at the specified
- * index. If no non-normalized value is set, this method will return
- * the same value as the <code>getValue(int)</code> method.
- *
- * @param attrIndex The attribute index.
- */
- public String getNonNormalizedValue(int attrIndex) {
- String value = fAttributes[attrIndex].nonNormalizedValue;
- return value;
- } // getNonNormalizedValue(int):String
-
- /**
- * Sets whether an attribute is specified in the instance document
- * or not.
- *
- * @param attrIndex The attribute index.
- * @param specified True if the attribute is specified in the instance
- * document.
- */
- public void setSpecified(int attrIndex, boolean specified) {
- fAttributes[attrIndex].specified = specified;
- } // setSpecified(int,boolean)
-
- /**
- * Returns true if the attribute is specified in the instance document.
- *
- * @param attrIndex The attribute index.
- */
- public boolean isSpecified(int attrIndex) {
- return fAttributes[attrIndex].specified;
- } // isSpecified(int):boolean
-
- //
- // AttributeList and Attributes methods
- //
-
- /**
- * Return the number of attributes in the list.
- *
- * <p>Once you know the number of attributes, you can iterate
- * through the list.</p>
- *
- * @return The number of attributes in the list.
- */
- public int getLength() {
- return fLength;
- } // getLength():int
-
- /**
- * Look up an attribute's type by index.
- *
- * <p>The attribute type is one of the strings "CDATA", "ID",
- * "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY", "ENTITIES",
- * or "NOTATION" (always in upper case).</p>
- *
- * <p>If the parser has not read a declaration for the attribute,
- * or if the parser does not report attribute types, then it must
- * return the value "CDATA" as stated in the XML 1.0 Recommentation
- * (clause 3.3.3, "Attribute-Value Normalization").</p>
- *
- * <p>For an enumerated attribute that is not a notation, the
- * parser will report the type as "NMTOKEN".</p>
- *
- * @param index The attribute index (zero-based).
- * @return The attribute's type as a string, or null if the
- * index is out of range.
- * @see #getLength
- */
- public String getType(int index) {
- if (index < 0 || index >= fLength) {
- return null;
- }
- return getReportableType(fAttributes[index].type);
- } // getType(int):String
-
- /**
- * Look up an attribute's type by XML 1.0 qualified name.
- *
- * <p>See {@link #getType(int) getType(int)} for a description
- * of the possible types.</p>
- *
- * @param qname The XML 1.0 qualified name.
- * @return The attribute type as a string, or null if the
- * attribute is not in the list or if qualified names
- * are not available.
- */
- public String getType(String qname) {
- int index = getIndex(qname);
- return index != -1 ? getReportableType(fAttributes[index].type) : null;
- } // getType(String):String
-
- /**
- * Look up an attribute's value by index.
- *
- * <p>If the attribute value is a list of tokens (IDREFS,
- * ENTITIES, or NMTOKENS), the tokens will be concatenated
- * into a single string with each token separated by a
- * single space.</p>
- *
- * @param index The attribute index (zero-based).
- * @return The attribute's value as a string, or null if the
- * index is out of range.
- * @see #getLength
- */
- public String getValue(int index) {
- if (index < 0 || index >= fLength) {
- return null;
- }
- if(fAttributes[index].value == null && fAttributes[index].xmlValue != null)
- fAttributes[index].value = fAttributes[index].xmlValue.toString();
- return fAttributes[index].value;
- } // getValue(int):String
-
- /**
- * Look up an attribute's value by XML 1.0 qualified name.
- *
- * <p>See {@link #getValue(int) getValue(int)} for a description
- * of the possible values.</p>
- *
- * @param qname The XML 1.0 qualified name.
- * @return The attribute value as a string, or null if the
- * attribute is not in the list or if qualified names
- * are not available.
- */
- public String getValue(String qname) {
- int index = getIndex(qname);
- if(index == -1 )
- return null;
- if(fAttributes[index].value == null)
- fAttributes[index].value = fAttributes[index].xmlValue.toString();
- return fAttributes[index].value;
- } // getValue(String):String
-
- //
- // AttributeList methods
- //
-
- /**
- * Return the name of an attribute in this list (by position).
- *
- * <p>The names must be unique: the SAX parser shall not include the
- * same attribute twice. Attributes without values (those declared
- * #IMPLIED without a value specified in the start tag) will be
- * omitted from the list.</p>
- *
- * <p>If the attribute name has a namespace prefix, the prefix
- * will still be attached.</p>
- *
- * @param i The index of the attribute in the list (starting at 0).
- * @return The name of the indexed attribute, or null
- * if the index is out of range.
- * @see #getLength
- */
- public String getName(int index) {
- if (index < 0 || index >= fLength) {
- return null;
- }
- return fAttributes[index].name.rawname;
- } // getName(int):String
-
- //
- // Attributes methods
- //
-
- /**
- * Look up the index of an attribute by XML 1.0 qualified name.
- *
- * @param qName The qualified (prefixed) name.
- * @return The index of the attribute, or -1 if it does not
- * appear in the list.
- */
- public int getIndex(String qName) {
- for (int i = 0; i < fLength; i++) {
- Attribute attribute = fAttributes[i];
- if (attribute.name.rawname != null &&
- attribute.name.rawname.equals(qName)) {
- return i;
- }
- }
- return -1;
- } // getIndex(String):int
-
- /**
- * Look up the index of an attribute by Namespace name.
- *
- * @param uri The Namespace URI, or null if
- * the name has no Namespace URI.
- * @param localName The attribute's local name.
- * @return The index of the attribute, or -1 if it does not
- * appear in the list.
- */
- public int getIndex(String uri, String localPart) {
- for (int i = 0; i < fLength; i++) {
- Attribute attribute = fAttributes[i];
- if (attribute.name.localpart != null &&
- attribute.name.localpart.equals(localPart) &&
- ((uri==attribute.name.uri) ||
- (uri!=null && attribute.name.uri!=null && attribute.name.uri.equals(uri)))) {
- return i;
- }
- }
- return -1;
- } // getIndex(String,String):int
-
- /**
- * Look up the index of an attribute by local name only,
- * ignoring its namespace.
- *
- * @param localName The attribute's local name.
- * @return The index of the attribute, or -1 if it does not
- * appear in the list.
- */
- public int getIndexByLocalName(String localPart) {
- for (int i = 0; i < fLength; i++) {
- Attribute attribute = fAttributes[i];
- if (attribute.name.localpart != null &&
- attribute.name.localpart.equals(localPart)) {
- return i;
- }
- }
- return -1;
- } // getIndex(String):int
-
- /**
- * Look up an attribute's local name by index.
- *
- * @param index The attribute index (zero-based).
- * @return The local name, or the empty string if Namespace
- * processing is not being performed, or null
- * if the index is out of range.
- * @see #getLength
- */
- public String getLocalName(int index) {
- if (!fNamespaces) {
- return "";
- }
- if (index < 0 || index >= fLength) {
- return null;
- }
- return fAttributes[index].name.localpart;
- } // getLocalName(int):String
-
- /**
- * Look up an attribute's XML 1.0 qualified name by index.
- *
- * @param index The attribute index (zero-based).
- * @return The XML 1.0 qualified name, or the empty string
- * if none is available, or null if the index
- * is out of range.
- * @see #getLength
- */
- public String getQName(int index) {
- if (index < 0 || index >= fLength) {
- return null;
- }
- String rawname = fAttributes[index].name.rawname;
- return rawname != null ? rawname : "";
- } // getQName(int):String
-
- public QName getQualifiedName(int index){
- if (index < 0 || index >= fLength) {
- return null;
- }
- return fAttributes[index].name;
- }
-
- /**
- * Look up an attribute's type by Namespace name.
- *
- * <p>See {@link #getType(int) getType(int)} for a description
- * of the possible types.</p>
- *
- * @param uri The Namespace URI, or null if the
- * name has no Namespace URI.
- * @param localName The local name of the attribute.
- * @return The attribute type as a string, or null if the
- * attribute is not in the list or if Namespace
- * processing is not being performed.
- */
- public String getType(String uri, String localName) {
- if (!fNamespaces) {
- return null;
- }
- int index = getIndex(uri, localName);
- return index != -1 ? getType(index) : null;
- } // getType(String,String):String
- /**
- * Look up the index of an attribute by XML 1.0 qualified name.
- * <p>
- * <strong>Note:</strong>
- * This method uses reference comparison, and thus should
- * only be used internally. We cannot use this method in any
- * code exposed to users as they may not pass in unique strings.
- *
- * @param qName The qualified (prefixed) name.
- * @return The index of the attribute, or -1 if it does not
- * appear in the list.
- */
- public int getIndexFast(String qName) {
- for (int i = 0; i < fLength; ++i) {
- Attribute attribute = fAttributes[i];
- if (attribute.name.rawname == qName) {
- return i;
- }
- }
- return -1;
- } // getIndexFast(String):int
-
- /**
- * Adds an attribute. The attribute's non-normalized value of the
- * attribute will have the same value as the attribute value until
- * set using the <code>setNonNormalizedValue</code> method. Also,
- * the added attribute will be marked as specified in the XML instance
- * document unless set otherwise using the <code>setSpecified</code>
- * method.
- * <p>
- * This method differs from <code>addAttribute</code> in that it
- * does not check if an attribute of the same name already exists
- * in the list before adding it. In order to improve performance
- * of namespace processing, this method allows uniqueness checks
- * to be deferred until all the namespace information is available
- * after the entire attribute specification has been read.
- * <p>
- * <strong>Caution:</strong> If this method is called it should
- * not be mixed with calls to <code>addAttribute</code> unless
- * it has been determined that all the attribute names are unique.
- *
- * @param name the attribute name
- * @param type the attribute type
- * @param value the attribute value
- *
- * @see #setNonNormalizedValue
- * @see #setSpecified
- * @see #checkDuplicatesNS
- */
- public void addAttributeNS(QName name, String type, String value) {
- int index = fLength;
- if (fLength++ == fAttributes.length) {
- Attribute[] attributes;
- if (fLength < SIZE_LIMIT) {
- attributes = new Attribute[fAttributes.length + 4];
- }
- else {
- attributes = new Attribute[fAttributes.length << 1];
- }
- System.arraycopy(fAttributes, 0, attributes, 0, fAttributes.length);
- for (int i = fAttributes.length; i < attributes.length; i++) {
- attributes[i] = new Attribute();
- }
- fAttributes = attributes;
- }
-
- // set values
- Attribute attribute = fAttributes[index];
- attribute.name.setValues(name);
- attribute.type = type;
- attribute.value = value;
- attribute.nonNormalizedValue = value;
- attribute.specified = false;
-
- // clear augmentations
- attribute.augs.removeAllItems();
- }
-
- /**
- * Checks for duplicate expanded names (local part and namespace name
- * pairs) in the attribute specification. If a duplicate is found its
- * name is returned.
- * <p>
- * This should be called once all the in-scope namespaces for the element
- * enclosing these attributes is known, and after all the attributes
- * have gone through namespace binding.
- *
- * @return the name of a duplicate attribute found in the search,
- * otherwise null.
- */
- public QName checkDuplicatesNS() {
- // If the list is small check for duplicates using pairwise comparison.
- final int length = fLength;
- if (length <= SIZE_LIMIT) {
- final Attribute[] attributes = fAttributes;
- for (int i = 0; i < length - 1; ++i) {
- Attribute att1 = attributes[i];
- for (int j = i + 1; j < length; ++j) {
- Attribute att2 = attributes[j];
- if (att1.name.localpart == att2.name.localpart &&
- att1.name.uri == att2.name.uri) {
- return att2.name;
- }
- }
- }
- return null;
- }
- // If the list is large check duplicates using a hash table.
- else {
- return checkManyDuplicatesNS();
- }
- }
-
- private QName checkManyDuplicatesNS() {
- // We don't want this table view to be read if someone calls
- // addAttribute so we invalidate it up front.
- fIsTableViewConsistent = false;
-
- prepareTableView();
-
- Attribute attr;
- int bucket;
-
- final int length = fLength;
- final Attribute[] attributes = fAttributes;
- final Attribute[] attributeTableView = fAttributeTableView;
- final int[] attributeTableViewChainState = fAttributeTableViewChainState;
- int largeCount = fLargeCount;
-
- for (int i = 0; i < length; ++i) {
- attr = attributes[i];
- bucket = getTableViewBucket(attr.name.localpart, attr.name.uri);
-
- // The chain is stale.
- // This must be a unique attribute.
- if (attributeTableViewChainState[bucket] != largeCount) {
- attributeTableViewChainState[bucket] = largeCount;
- attr.next = null;
- attributeTableView[bucket] = attr;
- }
- // This chain is active.
- // We need to check if any of the attributes has the same name.
- else {
- // Search the table.
- int collisionCount = 0;
- Attribute found = attributeTableView[bucket];
- while (found != null) {
- if (found.name.localpart == attr.name.localpart &&
- found.name.uri == attr.name.uri) {
- return attr.name;
- }
- found = found.next;
- ++collisionCount;
- }
- // Select a new hash function and rehash the table view
- // if the collision threshold is exceeded.
- if (collisionCount >= MAX_HASH_COLLISIONS) {
- // The current attribute will be processed in the rehash.
- rebalanceTableViewNS(i+1);
- largeCount = fLargeCount;
- }
- else {
- // Update table view
- attr.next = attributeTableView[bucket];
- attributeTableView[bucket] = attr;
- }
- }
- }
- return null;
- }
-
- /**
- * Look up the index of an attribute by Namespace name.
- * <p>
- * <strong>Note:</strong>
- * This method uses reference comparison, and thus should
- * only be used internally. We cannot use this method in any
- * code exposed to users as they may not pass in unique strings.
- *
- * @param uri The Namespace URI, or null if
- * the name has no Namespace URI.
- * @param localName The attribute's local name.
- * @return The index of the attribute, or -1 if it does not
- * appear in the list.
- */
- public int getIndexFast(String uri, String localPart) {
- for (int i = 0; i < fLength; ++i) {
- Attribute attribute = fAttributes[i];
- if (attribute.name.localpart == localPart &&
- attribute.name.uri == uri) {
- return i;
- }
- }
- return -1;
- } // getIndexFast(String,String):int
-
- /**
- * Returns the value passed in or NMTOKEN if it's an enumerated type.
- *
- * @param type attribute type
- * @return the value passed in or NMTOKEN if it's an enumerated type.
- */
- private String getReportableType(String type) {
-
- if (type.charAt(0) == '(') {
- return "NMTOKEN";
- }
- return type;
- }
-
- /**
- * Returns the position in the table view
- * where the given attribute name would be hashed.
- *
- * @param qname the attribute name
- * @return the position in the table view where the given attribute
- * would be hashed
- */
- protected int getTableViewBucket(String qname) {
- return (hash(qname) & 0x7FFFFFFF) % fTableViewBuckets;
- }
-
- /**
- * Returns the position in the table view
- * where the given attribute name would be hashed.
- *
- * @param localpart the local part of the attribute
- * @param uri the namespace name of the attribute
- * @return the position in the table view where the given attribute
- * would be hashed
- */
- protected int getTableViewBucket(String localpart, String uri) {
- if (uri == null) {
- return (hash(localpart) & 0x7FFFFFFF) % fTableViewBuckets;
- }
- else {
- return (hash(localpart, uri) & 0x7FFFFFFF) % fTableViewBuckets;
- }
- }
-
- private int hash(String localpart) {
- if (fHashMultipliers == null) {
- return localpart.hashCode();
- }
- return hash0(localpart);
- } // hash(String):int
-
- private int hash(String localpart, String uri) {
- if (fHashMultipliers == null) {
- return localpart.hashCode() + uri.hashCode() * 31;
- }
- return hash0(localpart) + hash0(uri) * fHashMultipliers[MULTIPLIERS_SIZE];
- } // hash(String,String):int
-
- private int hash0(String symbol) {
- int code = 0;
- final int length = symbol.length();
- final int[] multipliers = fHashMultipliers;
- for (int i = 0; i < length; ++i) {
- code = code * multipliers[i & MULTIPLIERS_MASK] + symbol.charAt(i);
- }
- return code;
- } // hash0(String):int
-
- /**
- * Purges all elements from the table view.
- */
- protected void cleanTableView() {
- if (++fLargeCount < 0) {
- // Overflow. We actually need to visit the chain state array.
- if (fAttributeTableViewChainState != null) {
- for (int i = fTableViewBuckets - 1; i >= 0; --i) {
- fAttributeTableViewChainState[i] = 0;
- }
- }
- fLargeCount = 1;
- }
- }
-
- /**
- * Increases the capacity of the table view.
- */
- private void growTableView() {
- final int length = fLength;
- int tableViewBuckets = fTableViewBuckets;
- do {
- tableViewBuckets = (tableViewBuckets << 1) + 1;
- if (tableViewBuckets < 0) {
- tableViewBuckets = Integer.MAX_VALUE;
- break;
- }
- }
- while (length > tableViewBuckets);
- fTableViewBuckets = tableViewBuckets;
- fAttributeTableView = null;
- fLargeCount = 1;
- }
-
- /**
- * Prepares the table view of the attributes list for use.
- */
- protected void prepareTableView() {
- if (fLength > fTableViewBuckets) {
- growTableView();
- }
- if (fAttributeTableView == null) {
- fAttributeTableView = new Attribute[fTableViewBuckets];
- fAttributeTableViewChainState = new int[fTableViewBuckets];
- }
- else {
- cleanTableView();
- }
- }
-
- /**
- * Prepares the table view of the attributes list for use,
- * and populates it with the attributes which have been
- * previously read.
- */
- protected void prepareAndPopulateTableView() {
- prepareAndPopulateTableView(fLength);
- }
-
- private void prepareAndPopulateTableView(final int count) {
- prepareTableView();
- // Need to populate the hash table with the attributes we've processed so far.
- Attribute attr;
- int bucket;
- for (int i = 0; i < count; ++i) {
- attr = fAttributes[i];
- bucket = getTableViewBucket(attr.name.rawname);
- if (fAttributeTableViewChainState[bucket] != fLargeCount) {
- fAttributeTableViewChainState[bucket] = fLargeCount;
- attr.next = null;
- fAttributeTableView[bucket] = attr;
- }
- else {
- // Update table view
- attr.next = fAttributeTableView[bucket];
- fAttributeTableView[bucket] = attr;
- }
- }
- }
-
-
- /**
- * Returns the prefix of the attribute at the specified index.
- *
- * @param index The index of the attribute.
- */
- public String getPrefix(int index) {
- if (index < 0 || index >= fLength) {
- return null;
- }
- String prefix = fAttributes[index].name.prefix;
- // REVISIT: The empty string is not entered in the symbol table!
- return prefix != null ? prefix : "";
- } // getPrefix(int):String
-
- /**
- * Look up an attribute's Namespace URI by index.
- *
- * @param index The attribute index (zero-based).
- * @return The Namespace URI
- * @see #getLength
- */
- public String getURI(int index) {
- if (index < 0 || index >= fLength) {
- return null;
- }
- String uri = fAttributes[index].name.uri;
- return uri;
- } // getURI(int):String
-
- /**
- * Look up an attribute's value by Namespace name and
- * Local name. If Namespace is null, ignore namespace
- * comparison. If Namespace is "", treat the name as
- * having no Namespace URI.
- *
- * <p>See {@link #getValue(int) getValue(int)} for a description
- * of the possible values.</p>
- *
- * @param uri The Namespace URI, or null namespaces are ignored.
- * @param localName The local name of the attribute.
- * @return The attribute value as a string, or null if the
- * attribute is not in the list.
- */
- public String getValue(String uri, String localName) {
- int index = getIndex(uri, localName);
- return index != -1 ? getValue(index) : null;
- } // getValue(String,String):String
-
- /**
- * Look up an augmentations by Namespace name.
- *
- * @param uri The Namespace URI, or null if the
- * @param localName The local name of the attribute.
- * @return Augmentations
- */
- public Augmentations getAugmentations (String uri, String localName) {
- int index = getIndex(uri, localName);
- return index != -1 ? fAttributes[index].augs : null;
- }
-
- /**
- * Look up an augmentation by XML 1.0 qualified name.
- * <p>
- *
- * @param qName The XML 1.0 qualified name.
- *
- * @return Augmentations
- *
- */
- public Augmentations getAugmentations(String qName){
- int index = getIndex(qName);
- return index != -1 ? fAttributes[index].augs : null;
- }
-
-
-
- /**
- * Look up an augmentations by attributes index.
- *
- * @param attributeIndex The attribute index.
- * @return Augmentations
- */
- public Augmentations getAugmentations (int attributeIndex){
- if (attributeIndex < 0 || attributeIndex >= fLength) {
- return null;
- }
- return fAttributes[attributeIndex].augs;
- }
-
- /**
- * Sets the augmentations of the attribute at the specified index.
- *
- * @param attrIndex The attribute index.
- * @param augs The augmentations.
- */
- public void setAugmentations(int attrIndex, Augmentations augs) {
- fAttributes[attrIndex].augs = augs;
- }
-
- /**
- * Sets the uri of the attribute at the specified index.
- *
- * @param attrIndex The attribute index.
- * @param uri Namespace uri
- */
- public void setURI(int attrIndex, String uri) {
- fAttributes[attrIndex].name.uri = uri;
- } // getURI(int,QName)
-
- // Implementation methods
- public void setSchemaId(int attrIndex, boolean schemaId) {
- fAttributes[attrIndex].schemaId = schemaId;
- }
-
- public boolean getSchemaId(int index) {
- if (index < 0 || index >= fLength) {
- return false;
- }
- return fAttributes[index].schemaId;
- }
-
- public boolean getSchemaId(String qname) {
- int index = getIndex(qname);
- return index != -1 ? fAttributes[index].schemaId : false;
- } // getType(String):String
-
- public boolean getSchemaId(String uri, String localName) {
- if (!fNamespaces) {
- return false;
- }
- int index = getIndex(uri, localName);
- return index != -1 ? fAttributes[index].schemaId : false;
- } // getType(String,String):String
-
- //XMLBufferListener methods
- /**
- * This method will be invoked by XMLEntityReader before ScannedEntities buffer
- * is reloaded.
- */
- public void refresh() {
- if(fLength > 0){
- for(int i = 0 ; i < fLength ; i++){
- getValue(i);
- }
- }
- }
- public void refresh(int pos) {
- }
-
- private void prepareAndPopulateTableViewNS(final int count) {
- prepareTableView();
- // Need to populate the hash table with the attributes we've processed so far.
- Attribute attr;
- int bucket;
- for (int i = 0; i < count; ++i) {
- attr = fAttributes[i];
- bucket = getTableViewBucket(attr.name.localpart, attr.name.uri);
- if (fAttributeTableViewChainState[bucket] != fLargeCount) {
- fAttributeTableViewChainState[bucket] = fLargeCount;
- attr.next = null;
- fAttributeTableView[bucket] = attr;
- }
- else {
- // Update table view
- attr.next = fAttributeTableView[bucket];
- fAttributeTableView[bucket] = attr;
- }
- }
- }
-
- /**
- * Randomly selects a new hash function and reorganizes the table view
- * in order to more evenly distribute its entries. This method is called
- * automatically when the number of attributes in one bucket exceeds
- * MAX_HASH_COLLISIONS.
- */
- private void rebalanceTableView(final int count) {
- if (fHashMultipliers == null) {
- fHashMultipliers = new int[MULTIPLIERS_SIZE + 1];
- }
- PrimeNumberSequenceGenerator.generateSequence(fHashMultipliers);
- prepareAndPopulateTableView(count);
- }
-
- /**
- * Randomly selects a new hash function and reorganizes the table view
- * in order to more evenly distribute its entries. This method is called
- * automatically when the number of attributes in one bucket exceeds
- * MAX_HASH_COLLISIONS.
- */
- private void rebalanceTableViewNS(final int count) {
- if (fHashMultipliers == null) {
- fHashMultipliers = new int[MULTIPLIERS_SIZE + 1];
- }
- PrimeNumberSequenceGenerator.generateSequence(fHashMultipliers);
- prepareAndPopulateTableViewNS(count);
- }
-
- //
- // Classes
- //
-
- /**
- * Attribute information.
- *
- * @author Andy Clark, IBM
- */
- static class Attribute {
-
- //
- // Data
- //
-
- // basic info
-
- /** Name. */
- public QName name = new QName();
-
- /** Type. */
- public String type;
-
- /** Value. */
- public String value;
-
- /** This will point to the ScannedEntities buffer.*/
- public XMLString xmlValue;
-
- /** Non-normalized value. */
- public String nonNormalizedValue;
-
- /** Specified. */
- public boolean specified;
-
- /** Schema ID type. */
- public boolean schemaId;
-
- /**
- * Augmentations information for this attribute.
- * XMLAttributes has no knowledge if any augmentations
- * were attached to Augmentations.
- */
- public Augmentations augs = new AugmentationsImpl();
-
- // Additional data for attribute table view
-
- /** Pointer to the next attribute in the chain. **/
- public Attribute next;
-
- } // class Attribute
-
-} // class XMLAttributesImpl
diff --git a/src/com/sun/org/apache/xerces/internal/util/XMLAttributesIteratorImpl.java b/src/com/sun/org/apache/xerces/internal/util/XMLAttributesIteratorImpl.java
deleted file mode 100644
index 7f4dafb..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/XMLAttributesIteratorImpl.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.org.apache.xerces.internal.util;
-
-//java imports
-import java.util.Iterator ;
-import java.util.NoSuchElementException;
-
-//xerces imports
-import com.sun.org.apache.xerces.internal.util.XMLAttributesImpl ;
-
-/**
- *
- * @author Neeraj Bajaj, Sun Microsystems
- */
-
-/**
- * Its better to extend the functionality of existing XMLAttributesImpl and also make it of type Iterator.
- * We can directly give an object of type iterator from StartElement event. We should also have
- * Attribute object of type javax.xml.stream.Attribute internally. It would avoid the need of creating
- * new javax.xml.stream.Attribute object at the later stage.
- *
- * Should we change XMLAttributes interface to implement Iteraotr ? I think its better avoid touching XNI as
- * much as possible. - NB.
- */
-
-public class XMLAttributesIteratorImpl extends XMLAttributesImpl implements Iterator {
-
- //pointer to current position.
- protected int fCurrent = 0 ;
-
- protected XMLAttributesImpl.Attribute fLastReturnedItem ;
-
- /** Creates a new instance of XMLAttributesIteratorImpl */
- public XMLAttributesIteratorImpl() {
- }
-
- public boolean hasNext() {
- return fCurrent < getLength() ? true : false ;
- }//hasNext()
-
- public Object next() {
- if(hasNext()){
- // should this be of type javax.xml.stream.Attribute ?
- return fLastReturnedItem = fAttributes[fCurrent++] ;
- }
- else{
- throw new NoSuchElementException() ;
- }
- }//next
-
- public void remove() {
- //make sure that only last returned item can be removed.
- if(fLastReturnedItem == fAttributes[fCurrent - 1]){
- //remove the attribute at current index and lower the current position by 1.
- removeAttributeAt(fCurrent--) ;
- }
- else {
- //either the next method has been called yet, or the remove method has already been called
- //after the last call to the next method.
- throw new IllegalStateException();
- }
- }//remove
-
- public void removeAllAttributes() {
- super.removeAllAttributes() ;
- fCurrent = 0 ;
- }
- /** xxx: should we be doing this way ? Attribute event defines so many functions which doesn't make any sense
- *for Attribute.
- *
- */
- /*
- class AttributeImpl extends com.sun.org.apache.xerces.internal.util.XMLAttributesImpl.Attribute implements javax.xml.stream.events.Attribute{
-
- }
- */
-
-} //XMLAttributesIteratorImpl
diff --git a/src/com/sun/org/apache/xerces/internal/util/XMLCatalogResolver.java b/src/com/sun/org/apache/xerces/internal/util/XMLCatalogResolver.java
deleted file mode 100644
index 60e040d..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/XMLCatalogResolver.java
+++ /dev/null
@@ -1,586 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.util;
-
-import java.io.IOException;
-
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.ext.EntityResolver2;
-
-import org.w3c.dom.ls.LSInput;
-import org.w3c.dom.ls.LSResourceResolver;
-
-import javax.xml.parsers.SAXParserFactory;
-
-import com.sun.org.apache.xerces.internal.dom.DOMInputImpl;
-import com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl;
-
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
-
-import com.sun.org.apache.xerces.internal.xni.parser.XMLEntityResolver;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-
-import com.sun.org.apache.xml.internal.resolver.Catalog;
-import com.sun.org.apache.xml.internal.resolver.CatalogManager;
-import com.sun.org.apache.xml.internal.resolver.readers.OASISXMLCatalogReader;
-import com.sun.org.apache.xml.internal.resolver.readers.SAXCatalogReader;
-
-/**
- * <p>The catalog resolver handles the resolution of external
- * identifiers and URI references through XML catalogs. This
- * component supports XML catalogs defined by the
- * <a href="http://www.oasis-open.org/committees/entity/spec.html">
- * OASIS XML Catalogs Specification</a>. It encapsulates the
- * <a href="http://xml.apache.org/commons/">XML Commons</a> resolver.
- * An instance of this class may be registered on the parser
- * as a SAX entity resolver, as a DOM LSResourceResolver or
- * as an XNI entity resolver by setting the property
- * (http://apache.org/xml/properties/internal/entity-resolver).</p>
- *
- * <p>It is intended that this class may be used standalone to perform
- * catalog resolution outside of a parsing context. It may be shared
- * between several parsers and the application.</p>
- *
- * @author Michael Glavassevich, IBM
- *
- */
-public class XMLCatalogResolver
- implements XMLEntityResolver, EntityResolver2, LSResourceResolver {
-
- /** Internal catalog manager for Apache catalogs. **/
- private CatalogManager fResolverCatalogManager = null;
-
- /** Internal catalog structure. **/
- private Catalog fCatalog = null;
-
- /** An array of catalog URIs. **/
- private String [] fCatalogsList = null;
-
- /**
- * Indicates whether the list of catalogs has
- * changed since it was processed.
- */
- private boolean fCatalogsChanged = true;
-
- /** Application specified prefer public setting. **/
- private boolean fPreferPublic = true;
-
- /**
- * Indicates whether the application desires that
- * the parser or some other component performing catalog
- * resolution should use the literal system identifier
- * instead of the expanded system identifier.
- */
- private boolean fUseLiteralSystemId = true;
-
- /**
- * <p>Constructs a catalog resolver with a default configuration.</p>
- */
- public XMLCatalogResolver () {
- this(null, true);
- }
-
- /**
- * <p>Constructs a catalog resolver with the given
- * list of entry files.</p>
- *
- * @param catalogs an ordered array list of absolute URIs
- */
- public XMLCatalogResolver (String [] catalogs) {
- this(catalogs, true);
- }
-
- /**
- * <p>Constructs a catalog resolver with the given
- * list of entry files and the preference for whether
- * system or public matches are preferred.</p>
- *
- * @param catalogs an ordered array list of absolute URIs
- * @param preferPublic the prefer public setting
- */
- public XMLCatalogResolver (String [] catalogs, boolean preferPublic) {
- init(catalogs, preferPublic);
- }
-
- /**
- * <p>Returns the initial list of catalog entry files.</p>
- *
- * @return the initial list of catalog entry files
- */
- public final synchronized String [] getCatalogList () {
- return (fCatalogsList != null)
- ? (String[]) fCatalogsList.clone() : null;
- }
-
- /**
- * <p>Sets the initial list of catalog entry files.
- * If there were any catalog mappings cached from
- * the previous list they will be replaced by catalog
- * mappings from the new list the next time the catalog
- * is queried.</p>
- *
- * @param catalogs an ordered array list of absolute URIs
- */
- public final synchronized void setCatalogList (String [] catalogs) {
- fCatalogsChanged = true;
- fCatalogsList = (catalogs != null)
- ? (String[]) catalogs.clone() : null;
- }
-
- /**
- * <p>Forces the cache of catalog mappings to be cleared.</p>
- */
- public final synchronized void clear () {
- fCatalog = null;
- }
-
- /**
- * <p>Returns the preference for whether system or public
- * matches are preferred. This is used in the absence
- * of any occurence of the <code>prefer</code> attribute
- * on the <code>catalog</code> entry of a catalog. If this
- * property has not yet been explicitly set its value is
- * <code>true</code>.</p>
- *
- * @return the prefer public setting
- */
- public final boolean getPreferPublic () {
- return fPreferPublic;
- }
-
- /**
- * <p>Sets the preference for whether system or public
- * matches are preferred. This is used in the absence
- * of any occurence of the <code>prefer</code> attribute
- * on the <code>catalog</code> entry of a catalog.</p>
- *
- * @param preferPublic the prefer public setting
- */
- public final void setPreferPublic (boolean preferPublic) {
- fPreferPublic = preferPublic;
- fResolverCatalogManager.setPreferPublic(preferPublic);
- }
-
- /**
- * <p>Returns the preference for whether the literal system
- * identifier should be used when resolving system
- * identifiers when both it and the expanded system
- * identifier are available. If this property has not yet
- * been explicitly set its value is <code>true</code>.</p>
- *
- * @return the preference for using literal system identifers
- * for catalog resolution
- *
- * @see #setUseLiteralSystemId
- */
- public final boolean getUseLiteralSystemId () {
- return fUseLiteralSystemId;
- }
-
- /**
- * <p>Sets the preference for whether the literal system
- * identifier should be used when resolving system
- * identifiers when both it and the expanded system
- * identifier are available.</p>
- *
- * <p>The literal system identifier is the URI as it was
- * provided before absolutization. It may be embedded within
- * an entity. It may be provided externally or it may be the
- * result of redirection. For example, redirection may
- * have come from the protocol level through HTTP or from
- * an application's entity resolver.</p>
- *
- * <p>The expanded system identifier is an absolute URI
- * which is the result of resolving the literal system
- * identifier against a base URI.</p>
- *
- * @param useLiteralSystemId the preference for using
- * literal system identifers for catalog resolution
- */
- public final void setUseLiteralSystemId (boolean useLiteralSystemId) {
- fUseLiteralSystemId = useLiteralSystemId;
- }
-
- /**
- * <p>Resolves an external entity. If the entity cannot be
- * resolved, this method should return <code>null</code>. This
- * method returns an input source if an entry was found in the
- * catalog for the given external identifier. It should be
- * overrided if other behaviour is required.</p>
- *
- * @param publicId the public identifier, or <code>null</code> if none was supplied
- * @param systemId the system identifier
- *
- * @throws SAXException any SAX exception, possibly wrapping another exception
- * @throws IOException thrown if some i/o error occurs
- */
- public InputSource resolveEntity(String publicId, String systemId)
- throws SAXException, IOException {
-
- String resolvedId = null;
- if (publicId != null && systemId != null) {
- resolvedId = resolvePublic(publicId, systemId);
- }
- else if (systemId != null) {
- resolvedId = resolveSystem(systemId);
- }
-
- if (resolvedId != null) {
- InputSource source = new InputSource(resolvedId);
- source.setPublicId(publicId);
- return source;
- }
- return null;
- }
-
- /**
- * <p>Resolves an external entity. If the entity cannot be
- * resolved, this method should return <code>null</code>. This
- * method returns an input source if an entry was found in the
- * catalog for the given external identifier. It should be
- * overrided if other behaviour is required.</p>
- *
- * @param name the identifier of the external entity
- * @param publicId the public identifier, or <code>null</code> if none was supplied
- * @param baseURI the URI with respect to which relative systemIDs are interpreted.
- * @param systemId the system identifier
- *
- * @throws SAXException any SAX exception, possibly wrapping another exception
- * @throws IOException thrown if some i/o error occurs
- */
- public InputSource resolveEntity(String name, String publicId,
- String baseURI, String systemId) throws SAXException, IOException {
-
- String resolvedId = null;
-
- if (!getUseLiteralSystemId() && baseURI != null) {
- // Attempt to resolve the system identifier against the base URI.
- try {
- URI uri = new URI(new URI(baseURI), systemId);
- systemId = uri.toString();
- }
- // Ignore the exception. Fallback to the literal system identifier.
- catch (URI.MalformedURIException ex) {}
- }
-
- if (publicId != null && systemId != null) {
- resolvedId = resolvePublic(publicId, systemId);
- }
- else if (systemId != null) {
- resolvedId = resolveSystem(systemId);
- }
-
- if (resolvedId != null) {
- InputSource source = new InputSource(resolvedId);
- source.setPublicId(publicId);
- return source;
- }
- return null;
- }
-
- /**
- * <p>Locates an external subset for documents which do not explicitly
- * provide one. This method always returns <code>null</code>. It
- * should be overrided if other behaviour is required.</p>
- *
- * @param name the identifier of the document root element
- * @param baseURI the document's base URI
- *
- * @throws SAXException any SAX exception, possibly wrapping another exception
- * @throws IOException thrown if some i/o error occurs
- */
- public InputSource getExternalSubset(String name, String baseURI)
- throws SAXException, IOException {
- return null;
- }
-
- /**
- * <p>Resolves a resource using the catalog. This method interprets that
- * the namespace URI corresponds to uri entries in the catalog.
- * Where both a namespace and an external identifier exist, the namespace
- * takes precedence.</p>
- *
- * @param type the type of the resource being resolved
- * @param namespaceURI the namespace of the resource being resolved,
- * or <code>null</code> if none was supplied
- * @param publicId the public identifier of the resource being resolved,
- * or <code>null</code> if none was supplied
- * @param systemId the system identifier of the resource being resolved,
- * or <code>null</code> if none was supplied
- * @param baseURI the absolute base URI of the resource being parsed,
- * or <code>null</code> if there is no base URI
- */
- public LSInput resolveResource(String type, String namespaceURI,
- String publicId, String systemId, String baseURI) {
-
- String resolvedId = null;
-
- try {
- // The namespace is useful for resolving namespace aware
- // grammars such as XML schema. Let it take precedence over
- // the external identifier if one exists.
- if (namespaceURI != null) {
- resolvedId = resolveURI(namespaceURI);
- }
-
- if (!getUseLiteralSystemId() && baseURI != null) {
- // Attempt to resolve the system identifier against the base URI.
- try {
- URI uri = new URI(new URI(baseURI), systemId);
- systemId = uri.toString();
- }
- // Ignore the exception. Fallback to the literal system identifier.
- catch (URI.MalformedURIException ex) {}
- }
-
- // Resolve against an external identifier if one exists. This
- // is useful for resolving DTD external subsets and other
- // external entities. For XML schemas if there was no namespace
- // mapping we might be able to resolve a system identifier
- // specified as a location hint.
- if (resolvedId == null) {
- if (publicId != null && systemId != null) {
- resolvedId = resolvePublic(publicId, systemId);
- }
- else if (systemId != null) {
- resolvedId = resolveSystem(systemId);
- }
- }
- }
- // Ignore IOException. It cannot be thrown from this method.
- catch (IOException ex) {}
-
- if (resolvedId != null) {
- return new DOMInputImpl(publicId, resolvedId, baseURI);
- }
- return null;
- }
-
-
- /**
- * <p>Resolves an external entity. If the entity cannot be
- * resolved, this method should return <code>null</code>. This
- * method only calls <code>resolveIdentifier</code> and returns
- * an input source if an entry was found in the catalog. It
- * should be overrided if other behaviour is required.</p>
- *
- * @param resourceIdentifier location of the XML resource to resolve
- *
- * @throws XNIException thrown on general error
- * @throws IOException thrown if some i/o error occurs
- */
- public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier)
- throws XNIException, IOException {
-
- String resolvedId = resolveIdentifier(resourceIdentifier);
- if (resolvedId != null) {
- return new XMLInputSource(resourceIdentifier.getPublicId(),
- resolvedId,
- resourceIdentifier.getBaseSystemId());
- }
- return null;
- }
-
- /**
- * <p>Resolves an identifier using the catalog. This method interprets that
- * the namespace of the identifier corresponds to uri entries in the catalog.
- * Where both a namespace and an external identifier exist, the namespace
- * takes precedence.</p>
- *
- * @param resourceIdentifier the identifier to resolve
- *
- * @throws XNIException thrown on general error
- * @throws IOException thrown if some i/o error occurs
- */
- public String resolveIdentifier(XMLResourceIdentifier resourceIdentifier)
- throws IOException, XNIException {
-
- String resolvedId = null;
-
- // The namespace is useful for resolving namespace aware
- // grammars such as XML schema. Let it take precedence over
- // the external identifier if one exists.
- String namespace = resourceIdentifier.getNamespace();
- if (namespace != null) {
- resolvedId = resolveURI(namespace);
- }
-
- // Resolve against an external identifier if one exists. This
- // is useful for resolving DTD external subsets and other
- // external entities. For XML schemas if there was no namespace
- // mapping we might be able to resolve a system identifier
- // specified as a location hint.
- if (resolvedId == null) {
- String publicId = resourceIdentifier.getPublicId();
- String systemId = getUseLiteralSystemId()
- ? resourceIdentifier.getLiteralSystemId()
- : resourceIdentifier.getExpandedSystemId();
- if (publicId != null && systemId != null) {
- resolvedId = resolvePublic(publicId, systemId);
- }
- else if (systemId != null) {
- resolvedId = resolveSystem(systemId);
- }
- }
- return resolvedId;
- }
-
- /**
- * <p>Returns the URI mapping in the catalog for the given
- * external identifier or <code>null</code> if no mapping
- * exists. If the system identifier is an URN in the
- * <code>publicid</code> namespace it is converted into
- * a public identifier by URN "unwrapping" as specified
- * in the XML Catalogs specification.</p>
- *
- * @param systemId the system identifier to locate in the catalog
- *
- * @return the mapped URI or <code>null</code> if no mapping
- * was found in the catalog
- *
- * @throws IOException if an i/o error occurred while reading
- * the catalog
- */
- public final synchronized String resolveSystem (String systemId)
- throws IOException {
-
- if (fCatalogsChanged) {
- parseCatalogs();
- fCatalogsChanged = false;
- }
- return (fCatalog != null)
- ? fCatalog.resolveSystem(systemId) : null;
- }
-
- /**
- * <p>Returns the URI mapping in the catalog for the given
- * external identifier or <code>null</code> if no mapping
- * exists. Public identifiers are normalized before
- * comparison.</p>
- *
- * @param publicId the public identifier to locate in the catalog
- * @param systemId the system identifier to locate in the catalog
- *
- * @return the mapped URI or <code>null</code> if no mapping
- * was found in the catalog
- *
- * @throws IOException if an i/o error occurred while reading
- * the catalog
- */
- public final synchronized String resolvePublic (String publicId, String systemId)
- throws IOException {
-
- if (fCatalogsChanged) {
- parseCatalogs();
- fCatalogsChanged = false;
- }
- return (fCatalog != null)
- ? fCatalog.resolvePublic(publicId, systemId) : null;
- }
-
- /**
- * <p>Returns the URI mapping in the catalog for the given URI
- * reference or <code>null</code> if no mapping exists.
- * URI comparison is case sensitive. If the URI reference
- * is an URN in the <code>publicid</code> namespace
- * it is converted into a public identifier by URN "unwrapping"
- * as specified in the XML Catalogs specification and then
- * resolution is performed following the semantics of
- * external identifier resolution.</p>
- *
- * @param uri the URI to locate in the catalog
- *
- * @return the mapped URI or <code>null</code> if no mapping
- * was found in the catalog
- *
- * @throws IOException if an i/o error occurred while reading
- * the catalog
- */
- public final synchronized String resolveURI (String uri)
- throws IOException {
-
- if (fCatalogsChanged) {
- parseCatalogs();
- fCatalogsChanged = false;
- }
- return (fCatalog != null)
- ? fCatalog.resolveURI(uri) : null;
- }
-
- /**
- * Initialization. Create a CatalogManager and set all
- * the properties upfront. This prevents JVM wide system properties
- * or a property file somewhere in the environment from affecting
- * the behaviour of this catalog resolver.
- */
- private void init (String [] catalogs, boolean preferPublic) {
- fCatalogsList = (catalogs != null) ? (String[]) catalogs.clone() : null;
- fPreferPublic = preferPublic;
- fResolverCatalogManager = new CatalogManager();
- fResolverCatalogManager.setAllowOasisXMLCatalogPI(false);
- fResolverCatalogManager.setCatalogClassName("com.sun.org.apache.xml.internal.resolver.Catalog");
- fResolverCatalogManager.setCatalogFiles("");
- fResolverCatalogManager.setIgnoreMissingProperties(true);
- fResolverCatalogManager.setPreferPublic(fPreferPublic);
- fResolverCatalogManager.setRelativeCatalogs(false);
- fResolverCatalogManager.setUseStaticCatalog(false);
- fResolverCatalogManager.setVerbosity(0);
- }
-
- /**
- * Instruct the <code>Catalog</code> to parse each of the
- * catalogs in the list. Only the first catalog will actually be
- * parsed immediately. The others will be queued and read if
- * they are needed later.
- */
- private void parseCatalogs () throws IOException {
- if (fCatalogsList != null) {
- fCatalog = new Catalog(fResolverCatalogManager);
- attachReaderToCatalog(fCatalog);
- for (int i = 0; i < fCatalogsList.length; ++i) {
- String catalog = fCatalogsList[i];
- if (catalog != null && catalog.length() > 0) {
- fCatalog.parseCatalog(catalog);
- }
- }
- }
- else {
- fCatalog = null;
- }
- }
-
- /**
- * Attaches the reader to the catalog.
- */
- private void attachReaderToCatalog (Catalog catalog) {
-
- SAXParserFactory spf = new SAXParserFactoryImpl();
- spf.setNamespaceAware(true);
- spf.setValidating(false);
-
- SAXCatalogReader saxReader = new SAXCatalogReader(spf);
- saxReader.setCatalogParser(OASISXMLCatalogReader.namespaceName, "catalog",
- "com.sun.org.apache.xml.internal.resolver.readers.OASISXMLCatalogReader");
- catalog.addReader("application/xml", saxReader);
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/util/XMLChar.java b/src/com/sun/org/apache/xerces/internal/util/XMLChar.java
deleted file mode 100644
index 731b31a..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/XMLChar.java
+++ /dev/null
@@ -1,1065 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.util;
-
-import java.util.Arrays;
-
-/**
- * This class defines the basic XML character properties. The data
- * in this class can be used to verify that a character is a valid
- * XML character or if the character is a space, name start, or name
- * character.
- * <p>
- * A series of convenience methods are supplied to ease the burden
- * of the developer. Because inlining the checks can improve per
- * character performance, the tables of character properties are
- * public. Using the character as an index into the <code>CHARS</code>
- * array and applying the appropriate mask flag (e.g.
- * <code>MASK_VALID</code>), yields the same results as calling the
- * convenience methods. There is one exception: check the comments
- * for the <code>isValid</code> method for details.
- *
- * @author Glenn Marcy, IBM
- * @author Andy Clark, IBM
- * @author Eric Ye, IBM
- * @author Arnaud Le Hors, IBM
- * @author Michael Glavassevich, IBM
- * @author Rahul Srivastava, Sun Microsystems Inc.
- *
- * @version $Id: XMLChar.java,v 1.7 2010-11-01 04:40:15 joehw Exp $
- */
-public class XMLChar {
-
- //
- // Constants
- //
-
- /** Character flags. */
- private static final byte[] CHARS = new byte[1 << 16];
-
- /** Valid character mask. */
- public static final int MASK_VALID = 0x01;
-
- /** Space character mask. */
- public static final int MASK_SPACE = 0x02;
-
- /** Name start character mask. */
- public static final int MASK_NAME_START = 0x04;
-
- /** Name character mask. */
- public static final int MASK_NAME = 0x08;
-
- /** Pubid character mask. */
- public static final int MASK_PUBID = 0x10;
-
- /**
- * Content character mask. Special characters are those that can
- * be considered the start of markup, such as '&lt;' and '&amp;'.
- * The various newline characters are considered special as well.
- * All other valid XML characters can be considered content.
- * <p>
- * This is an optimization for the inner loop of character scanning.
- */
- public static final int MASK_CONTENT = 0x20;
-
- /** NCName start character mask. */
- public static final int MASK_NCNAME_START = 0x40;
-
- /** NCName character mask. */
- public static final int MASK_NCNAME = 0x80;
-
- //
- // Static initialization
- //
-
- static {
-
- // Initializing the Character Flag Array
- // Code generated by: XMLCharGenerator.
-
- CHARS[9] = 35;
- CHARS[10] = 19;
- CHARS[13] = 19;
- CHARS[32] = 51;
- CHARS[33] = 49;
- CHARS[34] = 33;
- Arrays.fill(CHARS, 35, 38, (byte) 49 ); // Fill 3 of value (byte) 49
- CHARS[38] = 1;
- Arrays.fill(CHARS, 39, 45, (byte) 49 ); // Fill 6 of value (byte) 49
- Arrays.fill(CHARS, 45, 47, (byte) -71 ); // Fill 2 of value (byte) -71
- CHARS[47] = 49;
- Arrays.fill(CHARS, 48, 58, (byte) -71 ); // Fill 10 of value (byte) -71
- CHARS[58] = 61;
- CHARS[59] = 49;
- CHARS[60] = 1;
- CHARS[61] = 49;
- CHARS[62] = 33;
- Arrays.fill(CHARS, 63, 65, (byte) 49 ); // Fill 2 of value (byte) 49
- Arrays.fill(CHARS, 65, 91, (byte) -3 ); // Fill 26 of value (byte) -3
- Arrays.fill(CHARS, 91, 93, (byte) 33 ); // Fill 2 of value (byte) 33
- CHARS[93] = 1;
- CHARS[94] = 33;
- CHARS[95] = -3;
- CHARS[96] = 33;
- Arrays.fill(CHARS, 97, 123, (byte) -3 ); // Fill 26 of value (byte) -3
- Arrays.fill(CHARS, 123, 183, (byte) 33 ); // Fill 60 of value (byte) 33
- CHARS[183] = -87;
- Arrays.fill(CHARS, 184, 192, (byte) 33 ); // Fill 8 of value (byte) 33
- Arrays.fill(CHARS, 192, 215, (byte) -19 ); // Fill 23 of value (byte) -19
- CHARS[215] = 33;
- Arrays.fill(CHARS, 216, 247, (byte) -19 ); // Fill 31 of value (byte) -19
- CHARS[247] = 33;
- Arrays.fill(CHARS, 248, 306, (byte) -19 ); // Fill 58 of value (byte) -19
- Arrays.fill(CHARS, 306, 308, (byte) 33 ); // Fill 2 of value (byte) 33
- Arrays.fill(CHARS, 308, 319, (byte) -19 ); // Fill 11 of value (byte) -19
- Arrays.fill(CHARS, 319, 321, (byte) 33 ); // Fill 2 of value (byte) 33
- Arrays.fill(CHARS, 321, 329, (byte) -19 ); // Fill 8 of value (byte) -19
- CHARS[329] = 33;
- Arrays.fill(CHARS, 330, 383, (byte) -19 ); // Fill 53 of value (byte) -19
- CHARS[383] = 33;
- Arrays.fill(CHARS, 384, 452, (byte) -19 ); // Fill 68 of value (byte) -19
- Arrays.fill(CHARS, 452, 461, (byte) 33 ); // Fill 9 of value (byte) 33
- Arrays.fill(CHARS, 461, 497, (byte) -19 ); // Fill 36 of value (byte) -19
- Arrays.fill(CHARS, 497, 500, (byte) 33 ); // Fill 3 of value (byte) 33
- Arrays.fill(CHARS, 500, 502, (byte) -19 ); // Fill 2 of value (byte) -19
- Arrays.fill(CHARS, 502, 506, (byte) 33 ); // Fill 4 of value (byte) 33
- Arrays.fill(CHARS, 506, 536, (byte) -19 ); // Fill 30 of value (byte) -19
- Arrays.fill(CHARS, 536, 592, (byte) 33 ); // Fill 56 of value (byte) 33
- Arrays.fill(CHARS, 592, 681, (byte) -19 ); // Fill 89 of value (byte) -19
- Arrays.fill(CHARS, 681, 699, (byte) 33 ); // Fill 18 of value (byte) 33
- Arrays.fill(CHARS, 699, 706, (byte) -19 ); // Fill 7 of value (byte) -19
- Arrays.fill(CHARS, 706, 720, (byte) 33 ); // Fill 14 of value (byte) 33
- Arrays.fill(CHARS, 720, 722, (byte) -87 ); // Fill 2 of value (byte) -87
- Arrays.fill(CHARS, 722, 768, (byte) 33 ); // Fill 46 of value (byte) 33
- Arrays.fill(CHARS, 768, 838, (byte) -87 ); // Fill 70 of value (byte) -87
- Arrays.fill(CHARS, 838, 864, (byte) 33 ); // Fill 26 of value (byte) 33
- Arrays.fill(CHARS, 864, 866, (byte) -87 ); // Fill 2 of value (byte) -87
- Arrays.fill(CHARS, 866, 902, (byte) 33 ); // Fill 36 of value (byte) 33
- CHARS[902] = -19;
- CHARS[903] = -87;
- Arrays.fill(CHARS, 904, 907, (byte) -19 ); // Fill 3 of value (byte) -19
- CHARS[907] = 33;
- CHARS[908] = -19;
- CHARS[909] = 33;
- Arrays.fill(CHARS, 910, 930, (byte) -19 ); // Fill 20 of value (byte) -19
- CHARS[930] = 33;
- Arrays.fill(CHARS, 931, 975, (byte) -19 ); // Fill 44 of value (byte) -19
- CHARS[975] = 33;
- Arrays.fill(CHARS, 976, 983, (byte) -19 ); // Fill 7 of value (byte) -19
- Arrays.fill(CHARS, 983, 986, (byte) 33 ); // Fill 3 of value (byte) 33
- CHARS[986] = -19;
- CHARS[987] = 33;
- CHARS[988] = -19;
- CHARS[989] = 33;
- CHARS[990] = -19;
- CHARS[991] = 33;
- CHARS[992] = -19;
- CHARS[993] = 33;
- Arrays.fill(CHARS, 994, 1012, (byte) -19 ); // Fill 18 of value (byte) -19
- Arrays.fill(CHARS, 1012, 1025, (byte) 33 ); // Fill 13 of value (byte) 33
- Arrays.fill(CHARS, 1025, 1037, (byte) -19 ); // Fill 12 of value (byte) -19
- CHARS[1037] = 33;
- Arrays.fill(CHARS, 1038, 1104, (byte) -19 ); // Fill 66 of value (byte) -19
- CHARS[1104] = 33;
- Arrays.fill(CHARS, 1105, 1117, (byte) -19 ); // Fill 12 of value (byte) -19
- CHARS[1117] = 33;
- Arrays.fill(CHARS, 1118, 1154, (byte) -19 ); // Fill 36 of value (byte) -19
- CHARS[1154] = 33;
- Arrays.fill(CHARS, 1155, 1159, (byte) -87 ); // Fill 4 of value (byte) -87
- Arrays.fill(CHARS, 1159, 1168, (byte) 33 ); // Fill 9 of value (byte) 33
- Arrays.fill(CHARS, 1168, 1221, (byte) -19 ); // Fill 53 of value (byte) -19
- Arrays.fill(CHARS, 1221, 1223, (byte) 33 ); // Fill 2 of value (byte) 33
- Arrays.fill(CHARS, 1223, 1225, (byte) -19 ); // Fill 2 of value (byte) -19
- Arrays.fill(CHARS, 1225, 1227, (byte) 33 ); // Fill 2 of value (byte) 33
- Arrays.fill(CHARS, 1227, 1229, (byte) -19 ); // Fill 2 of value (byte) -19
- Arrays.fill(CHARS, 1229, 1232, (byte) 33 ); // Fill 3 of value (byte) 33
- Arrays.fill(CHARS, 1232, 1260, (byte) -19 ); // Fill 28 of value (byte) -19
- Arrays.fill(CHARS, 1260, 1262, (byte) 33 ); // Fill 2 of value (byte) 33
- Arrays.fill(CHARS, 1262, 1270, (byte) -19 ); // Fill 8 of value (byte) -19
- Arrays.fill(CHARS, 1270, 1272, (byte) 33 ); // Fill 2 of value (byte) 33
- Arrays.fill(CHARS, 1272, 1274, (byte) -19 ); // Fill 2 of value (byte) -19
- Arrays.fill(CHARS, 1274, 1329, (byte) 33 ); // Fill 55 of value (byte) 33
- Arrays.fill(CHARS, 1329, 1367, (byte) -19 ); // Fill 38 of value (byte) -19
- Arrays.fill(CHARS, 1367, 1369, (byte) 33 ); // Fill 2 of value (byte) 33
- CHARS[1369] = -19;
- Arrays.fill(CHARS, 1370, 1377, (byte) 33 ); // Fill 7 of value (byte) 33
- Arrays.fill(CHARS, 1377, 1415, (byte) -19 ); // Fill 38 of value (byte) -19
- Arrays.fill(CHARS, 1415, 1425, (byte) 33 ); // Fill 10 of value (byte) 33
- Arrays.fill(CHARS, 1425, 1442, (byte) -87 ); // Fill 17 of value (byte) -87
- CHARS[1442] = 33;
- Arrays.fill(CHARS, 1443, 1466, (byte) -87 ); // Fill 23 of value (byte) -87
- CHARS[1466] = 33;
- Arrays.fill(CHARS, 1467, 1470, (byte) -87 ); // Fill 3 of value (byte) -87
- CHARS[1470] = 33;
- CHARS[1471] = -87;
- CHARS[1472] = 33;
- Arrays.fill(CHARS, 1473, 1475, (byte) -87 ); // Fill 2 of value (byte) -87
- CHARS[1475] = 33;
- CHARS[1476] = -87;
- Arrays.fill(CHARS, 1477, 1488, (byte) 33 ); // Fill 11 of value (byte) 33
- Arrays.fill(CHARS, 1488, 1515, (byte) -19 ); // Fill 27 of value (byte) -19
- Arrays.fill(CHARS, 1515, 1520, (byte) 33 ); // Fill 5 of value (byte) 33
- Arrays.fill(CHARS, 1520, 1523, (byte) -19 ); // Fill 3 of value (byte) -19
- Arrays.fill(CHARS, 1523, 1569, (byte) 33 ); // Fill 46 of value (byte) 33
- Arrays.fill(CHARS, 1569, 1595, (byte) -19 ); // Fill 26 of value (byte) -19
- Arrays.fill(CHARS, 1595, 1600, (byte) 33 ); // Fill 5 of value (byte) 33
- CHARS[1600] = -87;
- Arrays.fill(CHARS, 1601, 1611, (byte) -19 ); // Fill 10 of value (byte) -19
- Arrays.fill(CHARS, 1611, 1619, (byte) -87 ); // Fill 8 of value (byte) -87
- Arrays.fill(CHARS, 1619, 1632, (byte) 33 ); // Fill 13 of value (byte) 33
- Arrays.fill(CHARS, 1632, 1642, (byte) -87 ); // Fill 10 of value (byte) -87
- Arrays.fill(CHARS, 1642, 1648, (byte) 33 ); // Fill 6 of value (byte) 33
- CHARS[1648] = -87;
- Arrays.fill(CHARS, 1649, 1720, (byte) -19 ); // Fill 71 of value (byte) -19
- Arrays.fill(CHARS, 1720, 1722, (byte) 33 ); // Fill 2 of value (byte) 33
- Arrays.fill(CHARS, 1722, 1727, (byte) -19 ); // Fill 5 of value (byte) -19
- CHARS[1727] = 33;
- Arrays.fill(CHARS, 1728, 1743, (byte) -19 ); // Fill 15 of value (byte) -19
- CHARS[1743] = 33;
- Arrays.fill(CHARS, 1744, 1748, (byte) -19 ); // Fill 4 of value (byte) -19
- CHARS[1748] = 33;
- CHARS[1749] = -19;
- Arrays.fill(CHARS, 1750, 1765, (byte) -87 ); // Fill 15 of value (byte) -87
- Arrays.fill(CHARS, 1765, 1767, (byte) -19 ); // Fill 2 of value (byte) -19
- Arrays.fill(CHARS, 1767, 1769, (byte) -87 ); // Fill 2 of value (byte) -87
- CHARS[1769] = 33;
- Arrays.fill(CHARS, 1770, 1774, (byte) -87 ); // Fill 4 of value (byte) -87
- Arrays.fill(CHARS, 1774, 1776, (byte) 33 ); // Fill 2 of value (byte) 33
- Arrays.fill(CHARS, 1776, 1786, (byte) -87 ); // Fill 10 of value (byte) -87
- Arrays.fill(CHARS, 1786, 2305, (byte) 33 ); // Fill 519 of value (byte) 33
- Arrays.fill(CHARS, 2305, 2308, (byte) -87 ); // Fill 3 of value (byte) -87
- CHARS[2308] = 33;
- Arrays.fill(CHARS, 2309, 2362, (byte) -19 ); // Fill 53 of value (byte) -19
- Arrays.fill(CHARS, 2362, 2364, (byte) 33 ); // Fill 2 of value (byte) 33
- CHARS[2364] = -87;
- CHARS[2365] = -19;
- Arrays.fill(CHARS, 2366, 2382, (byte) -87 ); // Fill 16 of value (byte) -87
- Arrays.fill(CHARS, 2382, 2385, (byte) 33 ); // Fill 3 of value (byte) 33
- Arrays.fill(CHARS, 2385, 2389, (byte) -87 ); // Fill 4 of value (byte) -87
- Arrays.fill(CHARS, 2389, 2392, (byte) 33 ); // Fill 3 of value (byte) 33
- Arrays.fill(CHARS, 2392, 2402, (byte) -19 ); // Fill 10 of value (byte) -19
- Arrays.fill(CHARS, 2402, 2404, (byte) -87 ); // Fill 2 of value (byte) -87
- Arrays.fill(CHARS, 2404, 2406, (byte) 33 ); // Fill 2 of value (byte) 33
- Arrays.fill(CHARS, 2406, 2416, (byte) -87 ); // Fill 10 of value (byte) -87
- Arrays.fill(CHARS, 2416, 2433, (byte) 33 ); // Fill 17 of value (byte) 33
- Arrays.fill(CHARS, 2433, 2436, (byte) -87 ); // Fill 3 of value (byte) -87
- CHARS[2436] = 33;
- Arrays.fill(CHARS, 2437, 2445, (byte) -19 ); // Fill 8 of value (byte) -19
- Arrays.fill(CHARS, 2445, 2447, (byte) 33 ); // Fill 2 of value (byte) 33
- Arrays.fill(CHARS, 2447, 2449, (byte) -19 ); // Fill 2 of value (byte) -19
- Arrays.fill(CHARS, 2449, 2451, (byte) 33 ); // Fill 2 of value (byte) 33
- Arrays.fill(CHARS, 2451, 2473, (byte) -19 ); // Fill 22 of value (byte) -19
- CHARS[2473] = 33;
- Arrays.fill(CHARS, 2474, 2481, (byte) -19 ); // Fill 7 of value (byte) -19
- CHARS[2481] = 33;
- CHARS[2482] = -19;
- Arrays.fill(CHARS, 2483, 2486, (byte) 33 ); // Fill 3 of value (byte) 33
- Arrays.fill(CHARS, 2486, 2490, (byte) -19 ); // Fill 4 of value (byte) -19
- Arrays.fill(CHARS, 2490, 2492, (byte) 33 ); // Fill 2 of value (byte) 33
- CHARS[2492] = -87;
- CHARS[2493] = 33;
- Arrays.fill(CHARS, 2494, 2501, (byte) -87 ); // Fill 7 of value (byte) -87
- Arrays.fill(CHARS, 2501, 2503, (byte) 33 ); // Fill 2 of value (byte) 33
- Arrays.fill(CHARS, 2503, 2505, (byte) -87 ); // Fill 2 of value (byte) -87
- Arrays.fill(CHARS, 2505, 2507, (byte) 33 ); // Fill 2 of value (byte) 33
- Arrays.fill(CHARS, 2507, 2510, (byte) -87 ); // Fill 3 of value (byte) -87
- Arrays.fill(CHARS, 2510, 2519, (byte) 33 ); // Fill 9 of value (byte) 33
- CHARS[2519] = -87;
- Arrays.fill(CHARS, 2520, 2524, (byte) 33 ); // Fill 4 of value (byte) 33
- Arrays.fill(CHARS, 2524, 2526, (byte) -19 ); // Fill 2 of value (byte) -19
- CHARS[2526] = 33;
- Arrays.fill(CHARS, 2527, 2530, (byte) -19 ); // Fill 3 of value (byte) -19
- Arrays.fill(CHARS, 2530, 2532, (byte) -87 ); // Fill 2 of value (byte) -87
- Arrays.fill(CHARS, 2532, 2534, (byte) 33 ); // Fill 2 of value (byte) 33
- Arrays.fill(CHARS, 2534, 2544, (byte) -87 ); // Fill 10 of value (byte) -87
- Arrays.fill(CHARS, 2544, 2546, (byte) -19 ); // Fill 2 of value (byte) -19
- Arrays.fill(CHARS, 2546, 2562, (byte) 33 ); // Fill 16 of value (byte) 33
- CHARS[2562] = -87;
- Arrays.fill(CHARS, 2563, 2565, (byte) 33 ); // Fill 2 of value (byte) 33
- Arrays.fill(CHARS, 2565, 2571, (byte) -19 ); // Fill 6 of value (byte) -19
- Arrays.fill(CHARS, 2571, 2575, (byte) 33 ); // Fill 4 of value (byte) 33
- Arrays.fill(CHARS, 2575, 2577, (byte) -19 ); // Fill 2 of value (byte) -19
- Arrays.fill(CHARS, 2577, 2579, (byte) 33 ); // Fill 2 of value (byte) 33
- Arrays.fill(CHARS, 2579, 2601, (byte) -19 ); // Fill 22 of value (byte) -19
- CHARS[2601] = 33;
- Arrays.fill(CHARS, 2602, 2609, (byte) -19 ); // Fill 7 of value (byte) -19
- CHARS[2609] = 33;
- Arrays.fill(CHARS, 2610, 2612, (byte) -19 ); // Fill 2 of value (byte) -19
- CHARS[2612] = 33;
- Arrays.fill(CHARS, 2613, 2615, (byte) -19 ); // Fill 2 of value (byte) -19
- CHARS[2615] = 33;
- Arrays.fill(CHARS, 2616, 2618, (byte) -19 ); // Fill 2 of value (byte) -19
- Arrays.fill(CHARS, 2618, 2620, (byte) 33 ); // Fill 2 of value (byte) 33
- CHARS[2620] = -87;
- CHARS[2621] = 33;
- Arrays.fill(CHARS, 2622, 2627, (byte) -87 ); // Fill 5 of value (byte) -87
- Arrays.fill(CHARS, 2627, 2631, (byte) 33 ); // Fill 4 of value (byte) 33
- Arrays.fill(CHARS, 2631, 2633, (byte) -87 ); // Fill 2 of value (byte) -87
- Arrays.fill(CHARS, 2633, 2635, (byte) 33 ); // Fill 2 of value (byte) 33
- Arrays.fill(CHARS, 2635, 2638, (byte) -87 ); // Fill 3 of value (byte) -87
- Arrays.fill(CHARS, 2638, 2649, (byte) 33 ); // Fill 11 of value (byte) 33
- Arrays.fill(CHARS, 2649, 2653, (byte) -19 ); // Fill 4 of value (byte) -19
- CHARS[2653] = 33;
- CHARS[2654] = -19;
- Arrays.fill(CHARS, 2655, 2662, (byte) 33 ); // Fill 7 of value (byte) 33
- Arrays.fill(CHARS, 2662, 2674, (byte) -87 ); // Fill 12 of value (byte) -87
- Arrays.fill(CHARS, 2674, 2677, (byte) -19 ); // Fill 3 of value (byte) -19
- Arrays.fill(CHARS, 2677, 2689, (byte) 33 ); // Fill 12 of value (byte) 33
- Arrays.fill(CHARS, 2689, 2692, (byte) -87 ); // Fill 3 of value (byte) -87
- CHARS[2692] = 33;
- Arrays.fill(CHARS, 2693, 2700, (byte) -19 ); // Fill 7 of value (byte) -19
- CHARS[2700] = 33;
- CHARS[2701] = -19;
- CHARS[2702] = 33;
- Arrays.fill(CHARS, 2703, 2706, (byte) -19 ); // Fill 3 of value (byte) -19
- CHARS[2706] = 33;
- Arrays.fill(CHARS, 2707, 2729, (byte) -19 ); // Fill 22 of value (byte) -19
- CHARS[2729] = 33;
- Arrays.fill(CHARS, 2730, 2737, (byte) -19 ); // Fill 7 of value (byte) -19
- CHARS[2737] = 33;
- Arrays.fill(CHARS, 2738, 2740, (byte) -19 ); // Fill 2 of value (byte) -19
- CHARS[2740] = 33;
- Arrays.fill(CHARS, 2741, 2746, (byte) -19 ); // Fill 5 of value (byte) -19
- Arrays.fill(CHARS, 2746, 2748, (byte) 33 ); // Fill 2 of value (byte) 33
- CHARS[2748] = -87;
- CHARS[2749] = -19;
- Arrays.fill(CHARS, 2750, 2758, (byte) -87 ); // Fill 8 of value (byte) -87
- CHARS[2758] = 33;
- Arrays.fill(CHARS, 2759, 2762, (byte) -87 ); // Fill 3 of value (byte) -87
- CHARS[2762] = 33;
- Arrays.fill(CHARS, 2763, 2766, (byte) -87 ); // Fill 3 of value (byte) -87
- Arrays.fill(CHARS, 2766, 2784, (byte) 33 ); // Fill 18 of value (byte) 33
- CHARS[2784] = -19;
- Arrays.fill(CHARS, 2785, 2790, (byte) 33 ); // Fill 5 of value (byte) 33
- Arrays.fill(CHARS, 2790, 2800, (byte) -87 ); // Fill 10 of value (byte) -87
- Arrays.fill(CHARS, 2800, 2817, (byte) 33 ); // Fill 17 of value (byte) 33
- Arrays.fill(CHARS, 2817, 2820, (byte) -87 ); // Fill 3 of value (byte) -87
- CHARS[2820] = 33;
- Arrays.fill(CHARS, 2821, 2829, (byte) -19 ); // Fill 8 of value (byte) -19
- Arrays.fill(CHARS, 2829, 2831, (byte) 33 ); // Fill 2 of value (byte) 33
- Arrays.fill(CHARS, 2831, 2833, (byte) -19 ); // Fill 2 of value (byte) -19
- Arrays.fill(CHARS, 2833, 2835, (byte) 33 ); // Fill 2 of value (byte) 33
- Arrays.fill(CHARS, 2835, 2857, (byte) -19 ); // Fill 22 of value (byte) -19
- CHARS[2857] = 33;
- Arrays.fill(CHARS, 2858, 2865, (byte) -19 ); // Fill 7 of value (byte) -19
- CHARS[2865] = 33;
- Arrays.fill(CHARS, 2866, 2868, (byte) -19 ); // Fill 2 of value (byte) -19
- Arrays.fill(CHARS, 2868, 2870, (byte) 33 ); // Fill 2 of value (byte) 33
- Arrays.fill(CHARS, 2870, 2874, (byte) -19 ); // Fill 4 of value (byte) -19
- Arrays.fill(CHARS, 2874, 2876, (byte) 33 ); // Fill 2 of value (byte) 33
- CHARS[2876] = -87;
- CHARS[2877] = -19;
- Arrays.fill(CHARS, 2878, 2884, (byte) -87 ); // Fill 6 of value (byte) -87
- Arrays.fill(CHARS, 2884, 2887, (byte) 33 ); // Fill 3 of value (byte) 33
- Arrays.fill(CHARS, 2887, 2889, (byte) -87 ); // Fill 2 of value (byte) -87
- Arrays.fill(CHARS, 2889, 2891, (byte) 33 ); // Fill 2 of value (byte) 33
- Arrays.fill(CHARS, 2891, 2894, (byte) -87 ); // Fill 3 of value (byte) -87
- Arrays.fill(CHARS, 2894, 2902, (byte) 33 ); // Fill 8 of value (byte) 33
- Arrays.fill(CHARS, 2902, 2904, (byte) -87 ); // Fill 2 of value (byte) -87
- Arrays.fill(CHARS, 2904, 2908, (byte) 33 ); // Fill 4 of value (byte) 33
- Arrays.fill(CHARS, 2908, 2910, (byte) -19 ); // Fill 2 of value (byte) -19
- CHARS[2910] = 33;
- Arrays.fill(CHARS, 2911, 2914, (byte) -19 ); // Fill 3 of value (byte) -19
- Arrays.fill(CHARS, 2914, 2918, (byte) 33 ); // Fill 4 of value (byte) 33
- Arrays.fill(CHARS, 2918, 2928, (byte) -87 ); // Fill 10 of value (byte) -87
- Arrays.fill(CHARS, 2928, 2946, (byte) 33 ); // Fill 18 of value (byte) 33
- Arrays.fill(CHARS, 2946, 2948, (byte) -87 ); // Fill 2 of value (byte) -87
- CHARS[2948] = 33;
- Arrays.fill(CHARS, 2949, 2955, (byte) -19 ); // Fill 6 of value (byte) -19
- Arrays.fill(CHARS, 2955, 2958, (byte) 33 ); // Fill 3 of value (byte) 33
- Arrays.fill(CHARS, 2958, 2961, (byte) -19 ); // Fill 3 of value (byte) -19
- CHARS[2961] = 33;
- Arrays.fill(CHARS, 2962, 2966, (byte) -19 ); // Fill 4 of value (byte) -19
- Arrays.fill(CHARS, 2966, 2969, (byte) 33 ); // Fill 3 of value (byte) 33
- Arrays.fill(CHARS, 2969, 2971, (byte) -19 ); // Fill 2 of value (byte) -19
- CHARS[2971] = 33;
- CHARS[2972] = -19;
- CHARS[2973] = 33;
- Arrays.fill(CHARS, 2974, 2976, (byte) -19 ); // Fill 2 of value (byte) -19
- Arrays.fill(CHARS, 2976, 2979, (byte) 33 ); // Fill 3 of value (byte) 33
- Arrays.fill(CHARS, 2979, 2981, (byte) -19 ); // Fill 2 of value (byte) -19
- Arrays.fill(CHARS, 2981, 2984, (byte) 33 ); // Fill 3 of value (byte) 33
- Arrays.fill(CHARS, 2984, 2987, (byte) -19 ); // Fill 3 of value (byte) -19
- Arrays.fill(CHARS, 2987, 2990, (byte) 33 ); // Fill 3 of value (byte) 33
- Arrays.fill(CHARS, 2990, 2998, (byte) -19 ); // Fill 8 of value (byte) -19
- CHARS[2998] = 33;
- Arrays.fill(CHARS, 2999, 3002, (byte) -19 ); // Fill 3 of value (byte) -19
- Arrays.fill(CHARS, 3002, 3006, (byte) 33 ); // Fill 4 of value (byte) 33
- Arrays.fill(CHARS, 3006, 3011, (byte) -87 ); // Fill 5 of value (byte) -87
- Arrays.fill(CHARS, 3011, 3014, (byte) 33 ); // Fill 3 of value (byte) 33
- Arrays.fill(CHARS, 3014, 3017, (byte) -87 ); // Fill 3 of value (byte) -87
- CHARS[3017] = 33;
- Arrays.fill(CHARS, 3018, 3022, (byte) -87 ); // Fill 4 of value (byte) -87
- Arrays.fill(CHARS, 3022, 3031, (byte) 33 ); // Fill 9 of value (byte) 33
- CHARS[3031] = -87;
- Arrays.fill(CHARS, 3032, 3047, (byte) 33 ); // Fill 15 of value (byte) 33
- Arrays.fill(CHARS, 3047, 3056, (byte) -87 ); // Fill 9 of value (byte) -87
- Arrays.fill(CHARS, 3056, 3073, (byte) 33 ); // Fill 17 of value (byte) 33
- Arrays.fill(CHARS, 3073, 3076, (byte) -87 ); // Fill 3 of value (byte) -87
- CHARS[3076] = 33;
- Arrays.fill(CHARS, 3077, 3085, (byte) -19 ); // Fill 8 of value (byte) -19
- CHARS[3085] = 33;
- Arrays.fill(CHARS, 3086, 3089, (byte) -19 ); // Fill 3 of value (byte) -19
- CHARS[3089] = 33;
- Arrays.fill(CHARS, 3090, 3113, (byte) -19 ); // Fill 23 of value (byte) -19
- CHARS[3113] = 33;
- Arrays.fill(CHARS, 3114, 3124, (byte) -19 ); // Fill 10 of value (byte) -19
- CHARS[3124] = 33;
- Arrays.fill(CHARS, 3125, 3130, (byte) -19 ); // Fill 5 of value (byte) -19
- Arrays.fill(CHARS, 3130, 3134, (byte) 33 ); // Fill 4 of value (byte) 33
- Arrays.fill(CHARS, 3134, 3141, (byte) -87 ); // Fill 7 of value (byte) -87
- CHARS[3141] = 33;
- Arrays.fill(CHARS, 3142, 3145, (byte) -87 ); // Fill 3 of value (byte) -87
- CHARS[3145] = 33;
- Arrays.fill(CHARS, 3146, 3150, (byte) -87 ); // Fill 4 of value (byte) -87
- Arrays.fill(CHARS, 3150, 3157, (byte) 33 ); // Fill 7 of value (byte) 33
- Arrays.fill(CHARS, 3157, 3159, (byte) -87 ); // Fill 2 of value (byte) -87
- Arrays.fill(CHARS, 3159, 3168, (byte) 33 ); // Fill 9 of value (byte) 33
- Arrays.fill(CHARS, 3168, 3170, (byte) -19 ); // Fill 2 of value (byte) -19
- Arrays.fill(CHARS, 3170, 3174, (byte) 33 ); // Fill 4 of value (byte) 33
- Arrays.fill(CHARS, 3174, 3184, (byte) -87 ); // Fill 10 of value (byte) -87
- Arrays.fill(CHARS, 3184, 3202, (byte) 33 ); // Fill 18 of value (byte) 33
- Arrays.fill(CHARS, 3202, 3204, (byte) -87 ); // Fill 2 of value (byte) -87
- CHARS[3204] = 33;
- Arrays.fill(CHARS, 3205, 3213, (byte) -19 ); // Fill 8 of value (byte) -19
- CHARS[3213] = 33;
- Arrays.fill(CHARS, 3214, 3217, (byte) -19 ); // Fill 3 of value (byte) -19
- CHARS[3217] = 33;
- Arrays.fill(CHARS, 3218, 3241, (byte) -19 ); // Fill 23 of value (byte) -19
- CHARS[3241] = 33;
- Arrays.fill(CHARS, 3242, 3252, (byte) -19 ); // Fill 10 of value (byte) -19
- CHARS[3252] = 33;
- Arrays.fill(CHARS, 3253, 3258, (byte) -19 ); // Fill 5 of value (byte) -19
- Arrays.fill(CHARS, 3258, 3262, (byte) 33 ); // Fill 4 of value (byte) 33
- Arrays.fill(CHARS, 3262, 3269, (byte) -87 ); // Fill 7 of value (byte) -87
- CHARS[3269] = 33;
- Arrays.fill(CHARS, 3270, 3273, (byte) -87 ); // Fill 3 of value (byte) -87
- CHARS[3273] = 33;
- Arrays.fill(CHARS, 3274, 3278, (byte) -87 ); // Fill 4 of value (byte) -87
- Arrays.fill(CHARS, 3278, 3285, (byte) 33 ); // Fill 7 of value (byte) 33
- Arrays.fill(CHARS, 3285, 3287, (byte) -87 ); // Fill 2 of value (byte) -87
- Arrays.fill(CHARS, 3287, 3294, (byte) 33 ); // Fill 7 of value (byte) 33
- CHARS[3294] = -19;
- CHARS[3295] = 33;
- Arrays.fill(CHARS, 3296, 3298, (byte) -19 ); // Fill 2 of value (byte) -19
- Arrays.fill(CHARS, 3298, 3302, (byte) 33 ); // Fill 4 of value (byte) 33
- Arrays.fill(CHARS, 3302, 3312, (byte) -87 ); // Fill 10 of value (byte) -87
- Arrays.fill(CHARS, 3312, 3330, (byte) 33 ); // Fill 18 of value (byte) 33
- Arrays.fill(CHARS, 3330, 3332, (byte) -87 ); // Fill 2 of value (byte) -87
- CHARS[3332] = 33;
- Arrays.fill(CHARS, 3333, 3341, (byte) -19 ); // Fill 8 of value (byte) -19
- CHARS[3341] = 33;
- Arrays.fill(CHARS, 3342, 3345, (byte) -19 ); // Fill 3 of value (byte) -19
- CHARS[3345] = 33;
- Arrays.fill(CHARS, 3346, 3369, (byte) -19 ); // Fill 23 of value (byte) -19
- CHARS[3369] = 33;
- Arrays.fill(CHARS, 3370, 3386, (byte) -19 ); // Fill 16 of value (byte) -19
- Arrays.fill(CHARS, 3386, 3390, (byte) 33 ); // Fill 4 of value (byte) 33
- Arrays.fill(CHARS, 3390, 3396, (byte) -87 ); // Fill 6 of value (byte) -87
- Arrays.fill(CHARS, 3396, 3398, (byte) 33 ); // Fill 2 of value (byte) 33
- Arrays.fill(CHARS, 3398, 3401, (byte) -87 ); // Fill 3 of value (byte) -87
- CHARS[3401] = 33;
- Arrays.fill(CHARS, 3402, 3406, (byte) -87 ); // Fill 4 of value (byte) -87
- Arrays.fill(CHARS, 3406, 3415, (byte) 33 ); // Fill 9 of value (byte) 33
- CHARS[3415] = -87;
- Arrays.fill(CHARS, 3416, 3424, (byte) 33 ); // Fill 8 of value (byte) 33
- Arrays.fill(CHARS, 3424, 3426, (byte) -19 ); // Fill 2 of value (byte) -19
- Arrays.fill(CHARS, 3426, 3430, (byte) 33 ); // Fill 4 of value (byte) 33
- Arrays.fill(CHARS, 3430, 3440, (byte) -87 ); // Fill 10 of value (byte) -87
- Arrays.fill(CHARS, 3440, 3585, (byte) 33 ); // Fill 145 of value (byte) 33
- Arrays.fill(CHARS, 3585, 3631, (byte) -19 ); // Fill 46 of value (byte) -19
- CHARS[3631] = 33;
- CHARS[3632] = -19;
- CHARS[3633] = -87;
- Arrays.fill(CHARS, 3634, 3636, (byte) -19 ); // Fill 2 of value (byte) -19
- Arrays.fill(CHARS, 3636, 3643, (byte) -87 ); // Fill 7 of value (byte) -87
- Arrays.fill(CHARS, 3643, 3648, (byte) 33 ); // Fill 5 of value (byte) 33
- Arrays.fill(CHARS, 3648, 3654, (byte) -19 ); // Fill 6 of value (byte) -19
- Arrays.fill(CHARS, 3654, 3663, (byte) -87 ); // Fill 9 of value (byte) -87
- CHARS[3663] = 33;
- Arrays.fill(CHARS, 3664, 3674, (byte) -87 ); // Fill 10 of value (byte) -87
- Arrays.fill(CHARS, 3674, 3713, (byte) 33 ); // Fill 39 of value (byte) 33
- Arrays.fill(CHARS, 3713, 3715, (byte) -19 ); // Fill 2 of value (byte) -19
- CHARS[3715] = 33;
- CHARS[3716] = -19;
- Arrays.fill(CHARS, 3717, 3719, (byte) 33 ); // Fill 2 of value (byte) 33
- Arrays.fill(CHARS, 3719, 3721, (byte) -19 ); // Fill 2 of value (byte) -19
- CHARS[3721] = 33;
- CHARS[3722] = -19;
- Arrays.fill(CHARS, 3723, 3725, (byte) 33 ); // Fill 2 of value (byte) 33
- CHARS[3725] = -19;
- Arrays.fill(CHARS, 3726, 3732, (byte) 33 ); // Fill 6 of value (byte) 33
- Arrays.fill(CHARS, 3732, 3736, (byte) -19 ); // Fill 4 of value (byte) -19
- CHARS[3736] = 33;
- Arrays.fill(CHARS, 3737, 3744, (byte) -19 ); // Fill 7 of value (byte) -19
- CHARS[3744] = 33;
- Arrays.fill(CHARS, 3745, 3748, (byte) -19 ); // Fill 3 of value (byte) -19
- CHARS[3748] = 33;
- CHARS[3749] = -19;
- CHARS[3750] = 33;
- CHARS[3751] = -19;
- Arrays.fill(CHARS, 3752, 3754, (byte) 33 ); // Fill 2 of value (byte) 33
- Arrays.fill(CHARS, 3754, 3756, (byte) -19 ); // Fill 2 of value (byte) -19
- CHARS[3756] = 33;
- Arrays.fill(CHARS, 3757, 3759, (byte) -19 ); // Fill 2 of value (byte) -19
- CHARS[3759] = 33;
- CHARS[3760] = -19;
- CHARS[3761] = -87;
- Arrays.fill(CHARS, 3762, 3764, (byte) -19 ); // Fill 2 of value (byte) -19
- Arrays.fill(CHARS, 3764, 3770, (byte) -87 ); // Fill 6 of value (byte) -87
- CHARS[3770] = 33;
- Arrays.fill(CHARS, 3771, 3773, (byte) -87 ); // Fill 2 of value (byte) -87
- CHARS[3773] = -19;
- Arrays.fill(CHARS, 3774, 3776, (byte) 33 ); // Fill 2 of value (byte) 33
- Arrays.fill(CHARS, 3776, 3781, (byte) -19 ); // Fill 5 of value (byte) -19
- CHARS[3781] = 33;
- CHARS[3782] = -87;
- CHARS[3783] = 33;
- Arrays.fill(CHARS, 3784, 3790, (byte) -87 ); // Fill 6 of value (byte) -87
- Arrays.fill(CHARS, 3790, 3792, (byte) 33 ); // Fill 2 of value (byte) 33
- Arrays.fill(CHARS, 3792, 3802, (byte) -87 ); // Fill 10 of value (byte) -87
- Arrays.fill(CHARS, 3802, 3864, (byte) 33 ); // Fill 62 of value (byte) 33
- Arrays.fill(CHARS, 3864, 3866, (byte) -87 ); // Fill 2 of value (byte) -87
- Arrays.fill(CHARS, 3866, 3872, (byte) 33 ); // Fill 6 of value (byte) 33
- Arrays.fill(CHARS, 3872, 3882, (byte) -87 ); // Fill 10 of value (byte) -87
- Arrays.fill(CHARS, 3882, 3893, (byte) 33 ); // Fill 11 of value (byte) 33
- CHARS[3893] = -87;
- CHARS[3894] = 33;
- CHARS[3895] = -87;
- CHARS[3896] = 33;
- CHARS[3897] = -87;
- Arrays.fill(CHARS, 3898, 3902, (byte) 33 ); // Fill 4 of value (byte) 33
- Arrays.fill(CHARS, 3902, 3904, (byte) -87 ); // Fill 2 of value (byte) -87
- Arrays.fill(CHARS, 3904, 3912, (byte) -19 ); // Fill 8 of value (byte) -19
- CHARS[3912] = 33;
- Arrays.fill(CHARS, 3913, 3946, (byte) -19 ); // Fill 33 of value (byte) -19
- Arrays.fill(CHARS, 3946, 3953, (byte) 33 ); // Fill 7 of value (byte) 33
- Arrays.fill(CHARS, 3953, 3973, (byte) -87 ); // Fill 20 of value (byte) -87
- CHARS[3973] = 33;
- Arrays.fill(CHARS, 3974, 3980, (byte) -87 ); // Fill 6 of value (byte) -87
- Arrays.fill(CHARS, 3980, 3984, (byte) 33 ); // Fill 4 of value (byte) 33
- Arrays.fill(CHARS, 3984, 3990, (byte) -87 ); // Fill 6 of value (byte) -87
- CHARS[3990] = 33;
- CHARS[3991] = -87;
- CHARS[3992] = 33;
- Arrays.fill(CHARS, 3993, 4014, (byte) -87 ); // Fill 21 of value (byte) -87
- Arrays.fill(CHARS, 4014, 4017, (byte) 33 ); // Fill 3 of value (byte) 33
- Arrays.fill(CHARS, 4017, 4024, (byte) -87 ); // Fill 7 of value (byte) -87
- CHARS[4024] = 33;
- CHARS[4025] = -87;
- Arrays.fill(CHARS, 4026, 4256, (byte) 33 ); // Fill 230 of value (byte) 33
- Arrays.fill(CHARS, 4256, 4294, (byte) -19 ); // Fill 38 of value (byte) -19
- Arrays.fill(CHARS, 4294, 4304, (byte) 33 ); // Fill 10 of value (byte) 33
- Arrays.fill(CHARS, 4304, 4343, (byte) -19 ); // Fill 39 of value (byte) -19
- Arrays.fill(CHARS, 4343, 4352, (byte) 33 ); // Fill 9 of value (byte) 33
- CHARS[4352] = -19;
- CHARS[4353] = 33;
- Arrays.fill(CHARS, 4354, 4356, (byte) -19 ); // Fill 2 of value (byte) -19
- CHARS[4356] = 33;
- Arrays.fill(CHARS, 4357, 4360, (byte) -19 ); // Fill 3 of value (byte) -19
- CHARS[4360] = 33;
- CHARS[4361] = -19;
- CHARS[4362] = 33;
- Arrays.fill(CHARS, 4363, 4365, (byte) -19 ); // Fill 2 of value (byte) -19
- CHARS[4365] = 33;
- Arrays.fill(CHARS, 4366, 4371, (byte) -19 ); // Fill 5 of value (byte) -19
- Arrays.fill(CHARS, 4371, 4412, (byte) 33 ); // Fill 41 of value (byte) 33
- CHARS[4412] = -19;
- CHARS[4413] = 33;
- CHARS[4414] = -19;
- CHARS[4415] = 33;
- CHARS[4416] = -19;
- Arrays.fill(CHARS, 4417, 4428, (byte) 33 ); // Fill 11 of value (byte) 33
- CHARS[4428] = -19;
- CHARS[4429] = 33;
- CHARS[4430] = -19;
- CHARS[4431] = 33;
- CHARS[4432] = -19;
- Arrays.fill(CHARS, 4433, 4436, (byte) 33 ); // Fill 3 of value (byte) 33
- Arrays.fill(CHARS, 4436, 4438, (byte) -19 ); // Fill 2 of value (byte) -19
- Arrays.fill(CHARS, 4438, 4441, (byte) 33 ); // Fill 3 of value (byte) 33
- CHARS[4441] = -19;
- Arrays.fill(CHARS, 4442, 4447, (byte) 33 ); // Fill 5 of value (byte) 33
- Arrays.fill(CHARS, 4447, 4450, (byte) -19 ); // Fill 3 of value (byte) -19
- CHARS[4450] = 33;
- CHARS[4451] = -19;
- CHARS[4452] = 33;
- CHARS[4453] = -19;
- CHARS[4454] = 33;
- CHARS[4455] = -19;
- CHARS[4456] = 33;
- CHARS[4457] = -19;
- Arrays.fill(CHARS, 4458, 4461, (byte) 33 ); // Fill 3 of value (byte) 33
- Arrays.fill(CHARS, 4461, 4463, (byte) -19 ); // Fill 2 of value (byte) -19
- Arrays.fill(CHARS, 4463, 4466, (byte) 33 ); // Fill 3 of value (byte) 33
- Arrays.fill(CHARS, 4466, 4468, (byte) -19 ); // Fill 2 of value (byte) -19
- CHARS[4468] = 33;
- CHARS[4469] = -19;
- Arrays.fill(CHARS, 4470, 4510, (byte) 33 ); // Fill 40 of value (byte) 33
- CHARS[4510] = -19;
- Arrays.fill(CHARS, 4511, 4520, (byte) 33 ); // Fill 9 of value (byte) 33
- CHARS[4520] = -19;
- Arrays.fill(CHARS, 4521, 4523, (byte) 33 ); // Fill 2 of value (byte) 33
- CHARS[4523] = -19;
- Arrays.fill(CHARS, 4524, 4526, (byte) 33 ); // Fill 2 of value (byte) 33
- Arrays.fill(CHARS, 4526, 4528, (byte) -19 ); // Fill 2 of value (byte) -19
- Arrays.fill(CHARS, 4528, 4535, (byte) 33 ); // Fill 7 of value (byte) 33
- Arrays.fill(CHARS, 4535, 4537, (byte) -19 ); // Fill 2 of value (byte) -19
- CHARS[4537] = 33;
- CHARS[4538] = -19;
- CHARS[4539] = 33;
- Arrays.fill(CHARS, 4540, 4547, (byte) -19 ); // Fill 7 of value (byte) -19
- Arrays.fill(CHARS, 4547, 4587, (byte) 33 ); // Fill 40 of value (byte) 33
- CHARS[4587] = -19;
- Arrays.fill(CHARS, 4588, 4592, (byte) 33 ); // Fill 4 of value (byte) 33
- CHARS[4592] = -19;
- Arrays.fill(CHARS, 4593, 4601, (byte) 33 ); // Fill 8 of value (byte) 33
- CHARS[4601] = -19;
- Arrays.fill(CHARS, 4602, 7680, (byte) 33 ); // Fill 3078 of value (byte) 33
- Arrays.fill(CHARS, 7680, 7836, (byte) -19 ); // Fill 156 of value (byte) -19
- Arrays.fill(CHARS, 7836, 7840, (byte) 33 ); // Fill 4 of value (byte) 33
- Arrays.fill(CHARS, 7840, 7930, (byte) -19 ); // Fill 90 of value (byte) -19
- Arrays.fill(CHARS, 7930, 7936, (byte) 33 ); // Fill 6 of value (byte) 33
- Arrays.fill(CHARS, 7936, 7958, (byte) -19 ); // Fill 22 of value (byte) -19
- Arrays.fill(CHARS, 7958, 7960, (byte) 33 ); // Fill 2 of value (byte) 33
- Arrays.fill(CHARS, 7960, 7966, (byte) -19 ); // Fill 6 of value (byte) -19
- Arrays.fill(CHARS, 7966, 7968, (byte) 33 ); // Fill 2 of value (byte) 33
- Arrays.fill(CHARS, 7968, 8006, (byte) -19 ); // Fill 38 of value (byte) -19
- Arrays.fill(CHARS, 8006, 8008, (byte) 33 ); // Fill 2 of value (byte) 33
- Arrays.fill(CHARS, 8008, 8014, (byte) -19 ); // Fill 6 of value (byte) -19
- Arrays.fill(CHARS, 8014, 8016, (byte) 33 ); // Fill 2 of value (byte) 33
- Arrays.fill(CHARS, 8016, 8024, (byte) -19 ); // Fill 8 of value (byte) -19
- CHARS[8024] = 33;
- CHARS[8025] = -19;
- CHARS[8026] = 33;
- CHARS[8027] = -19;
- CHARS[8028] = 33;
- CHARS[8029] = -19;
- CHARS[8030] = 33;
- Arrays.fill(CHARS, 8031, 8062, (byte) -19 ); // Fill 31 of value (byte) -19
- Arrays.fill(CHARS, 8062, 8064, (byte) 33 ); // Fill 2 of value (byte) 33
- Arrays.fill(CHARS, 8064, 8117, (byte) -19 ); // Fill 53 of value (byte) -19
- CHARS[8117] = 33;
- Arrays.fill(CHARS, 8118, 8125, (byte) -19 ); // Fill 7 of value (byte) -19
- CHARS[8125] = 33;
- CHARS[8126] = -19;
- Arrays.fill(CHARS, 8127, 8130, (byte) 33 ); // Fill 3 of value (byte) 33
- Arrays.fill(CHARS, 8130, 8133, (byte) -19 ); // Fill 3 of value (byte) -19
- CHARS[8133] = 33;
- Arrays.fill(CHARS, 8134, 8141, (byte) -19 ); // Fill 7 of value (byte) -19
- Arrays.fill(CHARS, 8141, 8144, (byte) 33 ); // Fill 3 of value (byte) 33
- Arrays.fill(CHARS, 8144, 8148, (byte) -19 ); // Fill 4 of value (byte) -19
- Arrays.fill(CHARS, 8148, 8150, (byte) 33 ); // Fill 2 of value (byte) 33
- Arrays.fill(CHARS, 8150, 8156, (byte) -19 ); // Fill 6 of value (byte) -19
- Arrays.fill(CHARS, 8156, 8160, (byte) 33 ); // Fill 4 of value (byte) 33
- Arrays.fill(CHARS, 8160, 8173, (byte) -19 ); // Fill 13 of value (byte) -19
- Arrays.fill(CHARS, 8173, 8178, (byte) 33 ); // Fill 5 of value (byte) 33
- Arrays.fill(CHARS, 8178, 8181, (byte) -19 ); // Fill 3 of value (byte) -19
- CHARS[8181] = 33;
- Arrays.fill(CHARS, 8182, 8189, (byte) -19 ); // Fill 7 of value (byte) -19
- Arrays.fill(CHARS, 8189, 8400, (byte) 33 ); // Fill 211 of value (byte) 33
- Arrays.fill(CHARS, 8400, 8413, (byte) -87 ); // Fill 13 of value (byte) -87
- Arrays.fill(CHARS, 8413, 8417, (byte) 33 ); // Fill 4 of value (byte) 33
- CHARS[8417] = -87;
- Arrays.fill(CHARS, 8418, 8486, (byte) 33 ); // Fill 68 of value (byte) 33
- CHARS[8486] = -19;
- Arrays.fill(CHARS, 8487, 8490, (byte) 33 ); // Fill 3 of value (byte) 33
- Arrays.fill(CHARS, 8490, 8492, (byte) -19 ); // Fill 2 of value (byte) -19
- Arrays.fill(CHARS, 8492, 8494, (byte) 33 ); // Fill 2 of value (byte) 33
- CHARS[8494] = -19;
- Arrays.fill(CHARS, 8495, 8576, (byte) 33 ); // Fill 81 of value (byte) 33
- Arrays.fill(CHARS, 8576, 8579, (byte) -19 ); // Fill 3 of value (byte) -19
- Arrays.fill(CHARS, 8579, 12293, (byte) 33 ); // Fill 3714 of value (byte) 33
- CHARS[12293] = -87;
- CHARS[12294] = 33;
- CHARS[12295] = -19;
- Arrays.fill(CHARS, 12296, 12321, (byte) 33 ); // Fill 25 of value (byte) 33
- Arrays.fill(CHARS, 12321, 12330, (byte) -19 ); // Fill 9 of value (byte) -19
- Arrays.fill(CHARS, 12330, 12336, (byte) -87 ); // Fill 6 of value (byte) -87
- CHARS[12336] = 33;
- Arrays.fill(CHARS, 12337, 12342, (byte) -87 ); // Fill 5 of value (byte) -87
- Arrays.fill(CHARS, 12342, 12353, (byte) 33 ); // Fill 11 of value (byte) 33
- Arrays.fill(CHARS, 12353, 12437, (byte) -19 ); // Fill 84 of value (byte) -19
- Arrays.fill(CHARS, 12437, 12441, (byte) 33 ); // Fill 4 of value (byte) 33
- Arrays.fill(CHARS, 12441, 12443, (byte) -87 ); // Fill 2 of value (byte) -87
- Arrays.fill(CHARS, 12443, 12445, (byte) 33 ); // Fill 2 of value (byte) 33
- Arrays.fill(CHARS, 12445, 12447, (byte) -87 ); // Fill 2 of value (byte) -87
- Arrays.fill(CHARS, 12447, 12449, (byte) 33 ); // Fill 2 of value (byte) 33
- Arrays.fill(CHARS, 12449, 12539, (byte) -19 ); // Fill 90 of value (byte) -19
- CHARS[12539] = 33;
- Arrays.fill(CHARS, 12540, 12543, (byte) -87 ); // Fill 3 of value (byte) -87
- Arrays.fill(CHARS, 12543, 12549, (byte) 33 ); // Fill 6 of value (byte) 33
- Arrays.fill(CHARS, 12549, 12589, (byte) -19 ); // Fill 40 of value (byte) -19
- Arrays.fill(CHARS, 12589, 19968, (byte) 33 ); // Fill 7379 of value (byte) 33
- Arrays.fill(CHARS, 19968, 40870, (byte) -19 ); // Fill 20902 of value (byte) -19
- Arrays.fill(CHARS, 40870, 44032, (byte) 33 ); // Fill 3162 of value (byte) 33
- Arrays.fill(CHARS, 44032, 55204, (byte) -19 ); // Fill 11172 of value (byte) -19
- Arrays.fill(CHARS, 55204, 55296, (byte) 33 ); // Fill 92 of value (byte) 33
- Arrays.fill(CHARS, 57344, 65534, (byte) 33 ); // Fill 8190 of value (byte) 33
-
- } // <clinit>()
-
- //
- // Public static methods
- //
-
- /**
- * Returns true if the specified character is a supplemental character.
- *
- * @param c The character to check.
- */
- public static boolean isSupplemental(int c) {
- return (c >= 0x10000 && c <= 0x10FFFF);
- }
-
- /**
- * Returns true the supplemental character corresponding to the given
- * surrogates.
- *
- * @param h The high surrogate.
- * @param l The low surrogate.
- */
- public static int supplemental(char h, char l) {
- return (h - 0xD800) * 0x400 + (l - 0xDC00) + 0x10000;
- }
-
- /**
- * Returns the high surrogate of a supplemental character
- *
- * @param c The supplemental character to "split".
- */
- public static char highSurrogate(int c) {
- return (char) (((c - 0x00010000) >> 10) + 0xD800);
- }
-
- /**
- * Returns the low surrogate of a supplemental character
- *
- * @param c The supplemental character to "split".
- */
- public static char lowSurrogate(int c) {
- return (char) (((c - 0x00010000) & 0x3FF) + 0xDC00);
- }
-
- /**
- * Returns whether the given character is a high surrogate
- *
- * @param c The character to check.
- */
- public static boolean isHighSurrogate(int c) {
- return (0xD800 <= c && c <= 0xDBFF);
- }
-
- /**
- * Returns whether the given character is a low surrogate
- *
- * @param c The character to check.
- */
- public static boolean isLowSurrogate(int c) {
- return (0xDC00 <= c && c <= 0xDFFF);
- }
-
-
- /**
- * Returns true if the specified character is valid. This method
- * also checks the surrogate character range from 0x10000 to 0x10FFFF.
- * <p>
- * If the program chooses to apply the mask directly to the
- * <code>CHARS</code> array, then they are responsible for checking
- * the surrogate character range.
- *
- * @param c The character to check.
- */
- public static boolean isValid(int c) {
- return (c < 0x10000 && (CHARS[c] & MASK_VALID) != 0) ||
- (0x10000 <= c && c <= 0x10FFFF);
- } // isValid(int):boolean
-
- /**
- * Returns true if the specified character is invalid.
- *
- * @param c The character to check.
- */
- public static boolean isInvalid(int c) {
- return !isValid(c);
- } // isInvalid(int):boolean
-
- /**
- * Returns true if the specified character can be considered content.
- *
- * @param c The character to check.
- */
- public static boolean isContent(int c) {
- return (c < 0x10000 && (CHARS[c] & MASK_CONTENT) != 0) ||
- (0x10000 <= c && c <= 0x10FFFF);
- } // isContent(int):boolean
-
- /**
- * Returns true if the specified character can be considered markup.
- * Markup characters include '&lt;', '&amp;', and '%'.
- *
- * @param c The character to check.
- */
- public static boolean isMarkup(int c) {
- return c == '<' || c == '&' || c == '%';
- } // isMarkup(int):boolean
-
- /**
- * Returns true if the specified character is a space character
- * as defined by production [3] in the XML 1.0 specification.
- *
- * @param c The character to check.
- */
- public static boolean isSpace(int c) {
- return c <= 0x20 && (CHARS[c] & MASK_SPACE) != 0;
- } // isSpace(int):boolean
-
- /**
- * Returns true if the specified character is a valid name start
- * character as defined by production [5] in the XML 1.0
- * specification.
- *
- * @param c The character to check.
- */
- public static boolean isNameStart(int c) {
- return c < 0x10000 && (CHARS[c] & MASK_NAME_START) != 0;
- } // isNameStart(int):boolean
-
- /**
- * Returns true if the specified character is a valid name
- * character as defined by production [4] in the XML 1.0
- * specification.
- *
- * @param c The character to check.
- */
- public static boolean isName(int c) {
- return c < 0x10000 && (CHARS[c] & MASK_NAME) != 0;
- } // isName(int):boolean
-
- /**
- * Returns true if the specified character is a valid NCName start
- * character as defined by production [4] in Namespaces in XML
- * recommendation.
- *
- * @param c The character to check.
- */
- public static boolean isNCNameStart(int c) {
- return c < 0x10000 && (CHARS[c] & MASK_NCNAME_START) != 0;
- } // isNCNameStart(int):boolean
-
- /**
- * Returns true if the specified character is a valid NCName
- * character as defined by production [5] in Namespaces in XML
- * recommendation.
- *
- * @param c The character to check.
- */
- public static boolean isNCName(int c) {
- return c < 0x10000 && (CHARS[c] & MASK_NCNAME) != 0;
- } // isNCName(int):boolean
-
- /**
- * Returns true if the specified character is a valid Pubid
- * character as defined by production [13] in the XML 1.0
- * specification.
- *
- * @param c The character to check.
- */
- public static boolean isPubid(int c) {
- return c < 0x10000 && (CHARS[c] & MASK_PUBID) != 0;
- } // isPubid(int):boolean
-
- /*
- * [5] Name ::= (Letter | '_' | ':') (NameChar)*
- */
- /**
- * Check to see if a string is a valid Name according to [5]
- * in the XML 1.0 Recommendation
- *
- * @param name string to check
- * @return true if name is a valid Name
- */
- public static boolean isValidName(String name) {
- final int length = name.length();
- if (length == 0) {
- return false;
- }
- char ch = name.charAt(0);
- if (!isNameStart(ch)) {
- return false;
- }
- for (int i = 1; i < length; ++i) {
- ch = name.charAt(i);
- if (!isName(ch)) {
- return false;
- }
- }
- return true;
- } // isValidName(String):boolean
-
- /*
- * from the namespace rec
- * [4] NCName ::= (Letter | '_') (NCNameChar)*
- */
- /**
- * Check to see if a string is a valid NCName according to [4]
- * from the XML Namespaces 1.0 Recommendation
- *
- * @param ncName string to check
- * @return true if name is a valid NCName
- */
- public static boolean isValidNCName(String ncName) {
- final int length = ncName.length();
- if (length == 0) {
- return false;
- }
- char ch = ncName.charAt(0);
- if (!isNCNameStart(ch)) {
- return false;
- }
- for (int i = 1; i < length; ++i) {
- ch = ncName.charAt(i);
- if (!isNCName(ch)) {
- return false;
- }
- }
- return true;
- } // isValidNCName(String):boolean
-
- /*
- * [7] Nmtoken ::= (NameChar)+
- */
- /**
- * Check to see if a string is a valid Nmtoken according to [7]
- * in the XML 1.0 Recommendation
- *
- * @param nmtoken string to check
- * @return true if nmtoken is a valid Nmtoken
- */
- public static boolean isValidNmtoken(String nmtoken) {
- final int length = nmtoken.length();
- if (length == 0) {
- return false;
- }
- for (int i = 0; i < length; ++i) {
- char ch = nmtoken.charAt(i);
- if (!isName(ch)) {
- return false;
- }
- }
- return true;
- } // isValidName(String):boolean
-
-
-
-
-
- // encodings
-
- /**
- * Returns true if the encoding name is a valid IANA encoding.
- * This method does not verify that there is a decoder available
- * for this encoding, only that the characters are valid for an
- * IANA encoding name.
- *
- * @param ianaEncoding The IANA encoding name.
- */
- public static boolean isValidIANAEncoding(String ianaEncoding) {
- if (ianaEncoding != null) {
- int length = ianaEncoding.length();
- if (length > 0) {
- char c = ianaEncoding.charAt(0);
- if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')) {
- for (int i = 1; i < length; i++) {
- c = ianaEncoding.charAt(i);
- if ((c < 'A' || c > 'Z') && (c < 'a' || c > 'z') &&
- (c < '0' || c > '9') && c != '.' && c != '_' &&
- c != '-') {
- return false;
- }
- }
- return true;
- }
- }
- }
- return false;
- } // isValidIANAEncoding(String):boolean
-
- /**
- * Returns true if the encoding name is a valid Java encoding.
- * This method does not verify that there is a decoder available
- * for this encoding, only that the characters are valid for an
- * Java encoding name.
- *
- * @param javaEncoding The Java encoding name.
- */
- public static boolean isValidJavaEncoding(String javaEncoding) {
- if (javaEncoding != null) {
- int length = javaEncoding.length();
- if (length > 0) {
- for (int i = 1; i < length; i++) {
- char c = javaEncoding.charAt(i);
- if ((c < 'A' || c > 'Z') && (c < 'a' || c > 'z') &&
- (c < '0' || c > '9') && c != '.' && c != '_' &&
- c != '-') {
- return false;
- }
- }
- return true;
- }
- }
- return false;
- } // isValidIANAEncoding(String):boolean
-
- // other methods
-
- /**
- * Trims space characters as defined by production [3] in
- * the XML 1.0 specification from both ends of the given string.
- *
- * @param value the string to be trimmed
- * @return the given string with the space characters trimmed
- * from both ends
- */
- public static String trim(String value) {
- int start;
- int end;
- final int lengthMinusOne = value.length() - 1;
- for (start = 0; start <= lengthMinusOne; ++start) {
- if (!isSpace(value.charAt(start))) {
- break;
- }
- }
- for (end = lengthMinusOne; end >= start; --end) {
- if (!isSpace(value.charAt(end))) {
- break;
- }
- }
- if (start == 0 && end == lengthMinusOne) {
- return value;
- }
- if (start > lengthMinusOne) {
- return "";
- }
- return value.substring(start, end + 1);
- } // trim(String):String
-
-} // class XMLChar
diff --git a/src/com/sun/org/apache/xerces/internal/util/XMLDocumentFilterImpl.java b/src/com/sun/org/apache/xerces/internal/util/XMLDocumentFilterImpl.java
deleted file mode 100644
index bde6fd2..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/XMLDocumentFilterImpl.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2000-2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package com.sun.org.apache.xerces.internal.util;
-
-import com.sun.org.apache.xerces.internal.xni.Augmentations;
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
-import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLLocator;
-import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
-import com.sun.org.apache.xerces.internal.xni.XMLString;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentFilter;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource;
-
-/**
- * Default implementation of {@link XMLDocumentFilter}
- * that simply passes through events to the next component.
- *
- * <p>
- * Can be used as a base implementation of other more sophisticated
- * {@link XMLDocumentFilter}s.
- *
- * @author
- * Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
- */
-public class XMLDocumentFilterImpl implements XMLDocumentFilter {
- private XMLDocumentHandler next;
- private XMLDocumentSource source;
-
-
- public void setDocumentHandler(XMLDocumentHandler handler) {
- this.next = handler;
- }
-
- public XMLDocumentHandler getDocumentHandler() {
- return next;
- }
-
- public void setDocumentSource(XMLDocumentSource source) {
- this.source = source;
- }
-
- public XMLDocumentSource getDocumentSource() {
- return source;
- }
-
-
-
-
-
-
- public void characters(XMLString text, Augmentations augs) throws XNIException {
- next.characters(text, augs);
- }
-
- public void comment(XMLString text, Augmentations augs) throws XNIException {
- next.comment(text, augs);
- }
-
- public void doctypeDecl(String rootElement, String publicId, String systemId, Augmentations augs)
- throws XNIException {
- next.doctypeDecl(rootElement, publicId, systemId, augs);
- }
-
- public void emptyElement(QName element, XMLAttributes attributes, Augmentations augs) throws XNIException {
- next.emptyElement(element, attributes, augs);
- }
-
- public void endCDATA(Augmentations augs) throws XNIException {
- next.endCDATA(augs);
- }
-
- public void endDocument(Augmentations augs) throws XNIException {
- next.endDocument(augs);
- }
-
- public void endElement(QName element, Augmentations augs) throws XNIException {
- next.endElement(element, augs);
- }
-
- public void endGeneralEntity(String name, Augmentations augs) throws XNIException {
- next.endGeneralEntity(name, augs);
- }
-
- public void ignorableWhitespace(XMLString text, Augmentations augs) throws XNIException {
- next.ignorableWhitespace(text, augs);
- }
-
- public void processingInstruction(String target, XMLString data, Augmentations augs) throws XNIException {
- next.processingInstruction(target, data, augs);
- }
-
- public void startCDATA(Augmentations augs) throws XNIException {
- next.startCDATA(augs);
- }
-
- public void startDocument(
- XMLLocator locator,
- String encoding,
- NamespaceContext namespaceContext,
- Augmentations augs)
- throws XNIException {
- next.startDocument(locator, encoding, namespaceContext, augs);
- }
-
- public void startElement(QName element, XMLAttributes attributes, Augmentations augs) throws XNIException {
- next.startElement(element, attributes, augs);
- }
-
- public void startGeneralEntity(String name, XMLResourceIdentifier identifier, String encoding, Augmentations augs)
- throws XNIException {
- next.startGeneralEntity(name, identifier, encoding, augs);
- }
-
- public void textDecl(String version, String encoding, Augmentations augs) throws XNIException {
- next.textDecl(version, encoding, augs);
- }
-
- public void xmlDecl(String version, String encoding, String standalone, Augmentations augs) throws XNIException {
- next.xmlDecl(version, encoding, standalone, augs);
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/util/XMLEntityDescriptionImpl.java b/src/com/sun/org/apache/xerces/internal/util/XMLEntityDescriptionImpl.java
deleted file mode 100644
index 0a653a9..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/XMLEntityDescriptionImpl.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.util;
-
-import com.sun.org.apache.xerces.internal.impl.XMLEntityDescription;
-
-/**
- * <p>This class is an implementation of the XMLEntityDescription
- * interface which describes the properties of an entity.</p>
- *
- * @author Michael Glavassevich, IBM
- *
- */
-public class XMLEntityDescriptionImpl
- extends XMLResourceIdentifierImpl
- implements XMLEntityDescription {
-
- //
- // Constructors
- //
-
- /** Constructs an empty entity description. */
- public XMLEntityDescriptionImpl() {} // <init>()
-
- /**
- * Constructs an entity description.
- *
- * @param entityName The name of the entity.
- * @param publicId The public identifier.
- * @param literalSystemId The literal system identifier.
- * @param baseSystemId The base system identifier.
- * @param expandedSystemId The expanded system identifier.
- */
- public XMLEntityDescriptionImpl(String entityName, String publicId, String literalSystemId,
- String baseSystemId, String expandedSystemId) {
- setDescription(entityName, publicId, literalSystemId, baseSystemId, expandedSystemId);
- } // <init>(String,String,String,String,String)
-
- /**
- * Constructs a resource identifier.
- *
- * @param entityName The name of the entity.
- * @param publicId The public identifier.
- * @param literalSystemId The literal system identifier.
- * @param baseSystemId The base system identifier.
- * @param expandedSystemId The expanded system identifier.
- * @param namespace The namespace.
- */
- public XMLEntityDescriptionImpl(String entityName, String publicId, String literalSystemId,
- String baseSystemId, String expandedSystemId, String namespace) {
- setDescription(entityName, publicId, literalSystemId, baseSystemId, expandedSystemId, namespace);
- } // <init>(String,String,String,String,String,String)
-
- //
- // Data
- //
-
- /** The name of the entity. */
- protected String fEntityName;
-
- //
- // Public methods
- //
-
- /**
- * Sets the name of the entity.
- *
- * @param name the name of the entity
- */
- public void setEntityName(String name) {
- fEntityName = name;
- } // setEntityName(String)
-
- /**
- * Returns the name of the entity.
- *
- * @return the name of the entity
- */
- public String getEntityName() {
- return fEntityName;
- } // getEntityName():String
-
- /**
- * <p>Sets the values of this entity description.</p>
- *
- * @param entityName The name of the entity.
- * @param publicId The public identifier.
- * @param literalSystemId The literal system identifier.
- * @param baseSystemId The base system identifier.
- * @param expandedSystemId The expanded system identifier.
- */
- public void setDescription(String entityName, String publicId, String literalSystemId,
- String baseSystemId, String expandedSystemId) {
- setDescription(entityName, publicId, literalSystemId, baseSystemId, expandedSystemId, null);
- } // setDescription(String,String,String,String,String)
-
- /**
- * <p>Sets the values of this entity description.</p>
- *
- * @param entityName The name of the entity.
- * @param publicId The public identifier.
- * @param literalSystemId The literal system identifier.
- * @param baseSystemId The base system identifier.
- * @param expandedSystemId The expanded system identifier.
- * @param namespace The namespace.
- */
- public void setDescription(String entityName, String publicId, String literalSystemId,
- String baseSystemId, String expandedSystemId, String namespace) {
- fEntityName = entityName;
- setValues(publicId, literalSystemId, baseSystemId, expandedSystemId, namespace);
- } // setDescription(String,String,String,String,String,String)
-
- /**
- * <p>Clears the values.</p>
- */
- public void clear() {
- super.clear();
- fEntityName = null;
- } // clear()
-
- //
- // Object methods
- //
-
- /** Returns a hash code for this object. */
- public int hashCode() {
- int code = super.hashCode();
- if (fEntityName != null) {
- code += fEntityName.hashCode();
- }
- return code;
- } // hashCode():int
-
- /** Returns a string representation of this object. */
- public String toString() {
- StringBuffer str = new StringBuffer();
- if (fEntityName != null) {
- str.append(fEntityName);
- }
- str.append(':');
- if (fPublicId != null) {
- str.append(fPublicId);
- }
- str.append(':');
- if (fLiteralSystemId != null) {
- str.append(fLiteralSystemId);
- }
- str.append(':');
- if (fBaseSystemId != null) {
- str.append(fBaseSystemId);
- }
- str.append(':');
- if (fExpandedSystemId != null) {
- str.append(fExpandedSystemId);
- }
- str.append(':');
- if (fNamespace != null) {
- str.append(fNamespace);
- }
- return str.toString();
- } // toString():String
-
-} // XMLEntityDescriptionImpl
diff --git a/src/com/sun/org/apache/xerces/internal/util/XMLErrorCode.java b/src/com/sun/org/apache/xerces/internal/util/XMLErrorCode.java
deleted file mode 100644
index 8d173af..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/XMLErrorCode.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.util;
-
-/**
- * <p>A structure that represents an error code, characterized by
- * a domain and a message key.</p>
- *
- * @author Naela Nissar, IBM
- *
- */
-final class XMLErrorCode {
-
- //
- // Data
- //
-
- /** error domain **/
- private String fDomain;
-
- /** message key **/
- private String fKey;
-
- /**
- * <p>Constructs an XMLErrorCode with the given domain and key.</p>
- *
- * @param domain The error domain.
- * @param key The key of the error message.
- */
- public XMLErrorCode(String domain, String key) {
- fDomain = domain;
- fKey = key;
- }
-
- /**
- * <p>Convenience method to set the values of an XMLErrorCode.</p>
- *
- * @param domain The error domain.
- * @param key The key of the error message.
- */
- public void setValues(String domain, String key) {
- fDomain = domain;
- fKey = key;
- }
-
- /**
- * <p>Indicates whether some other object is equal to this XMLErrorCode.</p>
- *
- * @param obj the object with which to compare.
- */
- public boolean equals(Object obj) {
- if (!(obj instanceof XMLErrorCode))
- return false;
- XMLErrorCode err = (XMLErrorCode) obj;
- return (fDomain.equals(err.fDomain) && fKey.equals(err.fKey));
- }
-
- /**
- * <p>Returns a hash code value for this XMLErrorCode.</p>
- *
- * @return a hash code value for this XMLErrorCode.
- */
- public int hashCode() {
- return fDomain.hashCode() + fKey.hashCode();
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/util/XMLGrammarPoolImpl.java b/src/com/sun/org/apache/xerces/internal/util/XMLGrammarPoolImpl.java
deleted file mode 100644
index 277d3a3..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/XMLGrammarPoolImpl.java
+++ /dev/null
@@ -1,366 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.util;
-
-import com.sun.org.apache.xerces.internal.xni.grammars.Grammar;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
-
-/**
- * Stores grammars in a pool associated to a specific key. This grammar pool
- * implementation stores two types of grammars: those keyed by the root element
- * name, and those keyed by the grammar's target namespace.
- *
- * This is the default implementation of the GrammarPool interface.
- * As we move forward, this will become more function-rich and robust.
- *
- * @author Jeffrey Rodriguez, IBM
- * @author Andy Clark, IBM
- * @author Neil Graham, IBM
- * @author Pavani Mukthipudi, Sun Microsystems
- * @author Neeraj Bajaj, SUN Microsystems
- *
- */
-public class XMLGrammarPoolImpl implements XMLGrammarPool {
-
- //
- // Constants
- //
-
- /** Default size. */
- protected static final int TABLE_SIZE = 11;
-
- //
- // Data
- //
-
- /** Grammars. */
- protected Entry[] fGrammars = null;
-
- // whether this pool is locked
- protected boolean fPoolIsLocked;
-
- // the number of grammars in the pool
- protected int fGrammarCount = 0;
-
- private static final boolean DEBUG = false ;
-
- //
- // Constructors
- //
-
- /** Constructs a grammar pool with a default number of buckets. */
- public XMLGrammarPoolImpl() {
- fGrammars = new Entry[TABLE_SIZE];
- fPoolIsLocked = false;
- } // <init>()
-
- /** Constructs a grammar pool with a specified number of buckets. */
- public XMLGrammarPoolImpl(int initialCapacity) {
- fGrammars = new Entry[initialCapacity];
- fPoolIsLocked = false;
- }
-
- //
- // XMLGrammarPool methods
- //
-
- /* <p> Retrieve the initial known set of grammars. This method is
- * called by a validator before the validation starts. The application
- * can provide an initial set of grammars available to the current
- * validation attempt. </p>
- *
- * @param grammarType The type of the grammar, from the
- * <code>com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription</code>
- * interface.
- * @return The set of grammars the validator may put in its "bucket"
- */
- public Grammar [] retrieveInitialGrammarSet (String grammarType) {
- synchronized (fGrammars) {
- int grammarSize = fGrammars.length ;
- Grammar [] tempGrammars = new Grammar[fGrammarCount];
- int pos = 0;
- for (int i = 0; i < grammarSize; i++) {
- for (Entry e = fGrammars[i]; e != null; e = e.next) {
- if (e.desc.getGrammarType().equals(grammarType)) {
- tempGrammars[pos++] = e.grammar;
- }
- }
- }
- Grammar[] toReturn = new Grammar[pos];
- System.arraycopy(tempGrammars, 0, toReturn, 0, pos);
- return toReturn;
- }
- } // retrieveInitialGrammarSet (String): Grammar[]
-
- /* <p> Return the final set of grammars that the validator ended up
- * with. This method is called after the validation finishes. The
- * application may then choose to cache some of the returned grammars.</p>
- * <p>In this implementation, we make our choice based on whether this object
- * is "locked"--that is, whether the application has instructed
- * us not to accept any new grammars.</p>
- *
- * @param grammarType The type of the grammars being returned;
- * @param grammars An array containing the set of grammars being
- * returned; order is not significant.
- */
- public void cacheGrammars(String grammarType, Grammar[] grammars) {
- if(!fPoolIsLocked) {
- for (int i = 0; i < grammars.length; i++) {
- if(DEBUG) {
- System.out.println("CACHED GRAMMAR " + (i+1) ) ;
- Grammar temp = grammars[i] ;
- //print(temp.getGrammarDescription());
- }
- putGrammar(grammars[i]);
- }
- }
- } // cacheGrammars(String, Grammar[]);
-
- /* <p> This method requests that the application retrieve a grammar
- * corresponding to the given GrammarIdentifier from its cache.
- * If it cannot do so it must return null; the parser will then
- * call the EntityResolver. </p>
- * <strong>An application must not call its EntityResolver itself
- * from this method; this may result in infinite recursions.</strong>
- *
- * This implementation chooses to use the root element name to identify a DTD grammar
- * and the target namespace to identify a Schema grammar.
- *
- * @param desc The description of the Grammar being requested.
- * @return The Grammar corresponding to this description or null if
- * no such Grammar is known.
- */
- public Grammar retrieveGrammar(XMLGrammarDescription desc) {
- if(DEBUG){
- System.out.println("RETRIEVING GRAMMAR FROM THE APPLICATION WITH FOLLOWING DESCRIPTION :");
- //print(desc);
- }
- return getGrammar(desc);
- } // retrieveGrammar(XMLGrammarDescription): Grammar
-
- //
- // Public methods
- //
-
- /**
- * Puts the specified grammar into the grammar pool and associates it to
- * its root element name or its target namespace.
- *
- * @param grammar The Grammar.
- */
- public void putGrammar(Grammar grammar) {
- if(!fPoolIsLocked) {
- synchronized (fGrammars) {
- XMLGrammarDescription desc = grammar.getGrammarDescription();
- int hash = hashCode(desc);
- int index = (hash & 0x7FFFFFFF) % fGrammars.length;
- for (Entry entry = fGrammars[index]; entry != null; entry = entry.next) {
- if (entry.hash == hash && equals(entry.desc, desc)) {
- entry.grammar = grammar;
- return;
- }
- }
- // create a new entry
- Entry entry = new Entry(hash, desc, grammar, fGrammars[index]);
- fGrammars[index] = entry;
- fGrammarCount++;
- }
- }
- } // putGrammar(Grammar)
-
- /**
- * Returns the grammar associated to the specified grammar description.
- * Currently, the root element name is used as the key for DTD grammars
- * and the target namespace is used as the key for Schema grammars.
- *
- * @param desc The Grammar Description.
- */
- public Grammar getGrammar(XMLGrammarDescription desc) {
- synchronized (fGrammars) {
- int hash = hashCode(desc);
- int index = (hash & 0x7FFFFFFF) % fGrammars.length;
- for (Entry entry = fGrammars[index] ; entry != null ; entry = entry.next) {
- if ((entry.hash == hash) && equals(entry.desc, desc)) {
- return entry.grammar;
- }
- }
- return null;
- }
- } // getGrammar(XMLGrammarDescription):Grammar
-
- /**
- * Removes the grammar associated to the specified grammar description from the
- * grammar pool and returns the removed grammar. Currently, the root element name
- * is used as the key for DTD grammars and the target namespace is used
- * as the key for Schema grammars.
- *
- * @param desc The Grammar Description.
- * @return The removed grammar.
- */
- public Grammar removeGrammar(XMLGrammarDescription desc) {
- synchronized (fGrammars) {
- int hash = hashCode(desc);
- int index = (hash & 0x7FFFFFFF) % fGrammars.length;
- for (Entry entry = fGrammars[index], prev = null ; entry != null ; prev = entry, entry = entry.next) {
- if ((entry.hash == hash) && equals(entry.desc, desc)) {
- if (prev != null) {
- prev.next = entry.next;
- }
- else {
- fGrammars[index] = entry.next;
- }
- Grammar tempGrammar = entry.grammar;
- entry.grammar = null;
- fGrammarCount--;
- return tempGrammar;
- }
- }
- return null;
- }
- } // removeGrammar(XMLGrammarDescription):Grammar
-
- /**
- * Returns true if the grammar pool contains a grammar associated
- * to the specified grammar description. Currently, the root element name
- * is used as the key for DTD grammars and the target namespace is used
- * as the key for Schema grammars.
- *
- * @param desc The Grammar Description.
- */
- public boolean containsGrammar(XMLGrammarDescription desc) {
- synchronized (fGrammars) {
- int hash = hashCode(desc);
- int index = (hash & 0x7FFFFFFF) % fGrammars.length;
- for (Entry entry = fGrammars[index] ; entry != null ; entry = entry.next) {
- if ((entry.hash == hash) && equals(entry.desc, desc)) {
- return true;
- }
- }
- return false;
- }
- } // containsGrammar(XMLGrammarDescription):boolean
-
- /* <p> Sets this grammar pool to a "locked" state--i.e.,
- * no new grammars will be added until it is "unlocked".
- */
- public void lockPool() {
- fPoolIsLocked = true;
- } // lockPool()
-
- /* <p> Sets this grammar pool to an "unlocked" state--i.e.,
- * new grammars will be added when putGrammar or cacheGrammars
- * are called.
- */
- public void unlockPool() {
- fPoolIsLocked = false;
- } // unlockPool()
-
- /*
- * <p>This method clears the pool-i.e., removes references
- * to all the grammars in it.</p>
- */
- public void clear() {
- for (int i=0; i<fGrammars.length; i++) {
- if(fGrammars[i] != null) {
- fGrammars[i].clear();
- fGrammars[i] = null;
- }
- }
- fGrammarCount = 0;
- } // clear()
-
- /**
- * This method checks whether two grammars are the same. Currently, we compare
- * the root element names for DTD grammars and the target namespaces for Schema grammars.
- * The application can override this behaviour and add its own logic.
- *
- * @param desc1 The grammar description
- * @param desc2 The grammar description of the grammar to be compared to
- * @return True if the grammars are equal, otherwise false
- */
- public boolean equals(XMLGrammarDescription desc1, XMLGrammarDescription desc2) {
- return desc1.equals(desc2);
- }
-
- /**
- * Returns the hash code value for the given grammar description.
- *
- * @param desc The grammar description
- * @return The hash code value
- */
- public int hashCode(XMLGrammarDescription desc) {
- return desc.hashCode();
- }
-
- /**
- * This class is a grammar pool entry. Each entry acts as a node
- * in a linked list.
- */
- protected static final class Entry {
- public int hash;
- public XMLGrammarDescription desc;
- public Grammar grammar;
- public Entry next;
-
- protected Entry(int hash, XMLGrammarDescription desc, Grammar grammar, Entry next) {
- this.hash = hash;
- this.desc = desc;
- this.grammar = grammar;
- this.next = next;
- }
-
- // clear this entry; useful to promote garbage collection
- // since reduces reference count of objects to be destroyed
- protected void clear () {
- desc = null;
- grammar = null;
- if(next != null) {
- next.clear();
- next = null;
- }
- } // clear()
- } // class Entry
-
- /* For DTD build we can't import here XSDDescription. Thus, this method is commented out.. */
- /* public void print(XMLGrammarDescription description){
- if(description.getGrammarType().equals(XMLGrammarDescription.XML_DTD)){
-
- }
- else if(description.getGrammarType().equals(XMLGrammarDescription.XML_SCHEMA)){
- XSDDescription schema = (XSDDescription)description ;
- System.out.println("Context = " + schema.getContextType());
- System.out.println("TargetNamespace = " + schema.getTargetNamespace());
- String [] temp = schema.getLocationHints();
-
- for (int i = 0 ; (temp != null && i < temp.length) ; i++){
- System.out.println("LocationHint " + i + " = "+ temp[i]);
- }
-
- System.out.println("Triggering Component = " + schema.getTriggeringComponent());
- System.out.println("EnclosingElementName =" + schema.getEnclosingElementName());
-
- }
-
- }//print
- */
-
-} // class XMLGrammarPoolImpl
diff --git a/src/com/sun/org/apache/xerces/internal/util/XMLInputSourceAdaptor.java b/src/com/sun/org/apache/xerces/internal/util/XMLInputSourceAdaptor.java
deleted file mode 100644
index 7352625..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/XMLInputSourceAdaptor.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2000-2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package com.sun.org.apache.xerces.internal.util;
-
-import javax.xml.transform.Source;
-
-import com.sun.org.apache.xerces.internal.impl.XMLEntityManager;
-import com.sun.org.apache.xerces.internal.util.URI.MalformedURIException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-
-/**
- * {@link Source} that represents an {@link XMLInputSource}.
- *
- * <p>
- * Ideally, we should be able to have {@link XMLInputSource}
- * derive from {@link Source}, but the way
- * the {@link XMLInputSource#getSystemId()} method works is
- * different from the way {@link Source#getSystemId()} method works.
- *
- * <p>
- * In a long run, we should make them consistent so that we can
- * get rid of this awkward adaptor class.
- *
- * @author
- * Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
- */
-public final class XMLInputSourceAdaptor implements Source {
- /**
- * the actual source information.
- */
- public final XMLInputSource fSource;
-
- public XMLInputSourceAdaptor( XMLInputSource core ) {
- fSource = core;
- }
-
- public void setSystemId(String systemId) {
- fSource.setSystemId(systemId);
- }
-
- public String getSystemId() {
- try {
- return XMLEntityManager.expandSystemId(
- fSource.getSystemId(), fSource.getBaseSystemId(), false);
- } catch (MalformedURIException e) {
- return fSource.getSystemId();
- }
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/util/XMLResourceIdentifierImpl.java b/src/com/sun/org/apache/xerces/internal/util/XMLResourceIdentifierImpl.java
deleted file mode 100644
index 049d412..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/XMLResourceIdentifierImpl.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2002, 2003,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.util;
-
-import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
-
-/**
- * The XMLResourceIdentifierImpl class is an implementation of the
- * XMLResourceIdentifier interface which defines the location identity
- * of a resource.
- *
- * @author Andy Clark
- *
- */
-public class XMLResourceIdentifierImpl
- implements XMLResourceIdentifier {
-
- //
- // Data
- //
-
- /** The public identifier. */
- protected String fPublicId;
-
- /** The literal system identifier. */
- protected String fLiteralSystemId;
-
- /** The base system identifier. */
- protected String fBaseSystemId;
-
- /** The expanded system identifier. */
- protected String fExpandedSystemId;
-
- /** The namespace of the resource. */
- protected String fNamespace;
-
- //
- // Constructors
- //
-
- /** Constructs an empty resource identifier. */
- public XMLResourceIdentifierImpl() {} // <init>()
-
- /**
- * Constructs a resource identifier.
- *
- * @param publicId The public identifier.
- * @param literalSystemId The literal system identifier.
- * @param baseSystemId The base system identifier.
- * @param expandedSystemId The expanded system identifier.
- */
- public XMLResourceIdentifierImpl(String publicId,
- String literalSystemId, String baseSystemId,
- String expandedSystemId) {
- setValues(publicId, literalSystemId, baseSystemId,
- expandedSystemId, null);
- } // <init>(String,String,String,String)
-
- /**
- * Constructs a resource identifier.
- *
- * @param publicId The public identifier.
- * @param literalSystemId The literal system identifier.
- * @param baseSystemId The base system identifier.
- * @param expandedSystemId The expanded system identifier.
- * @param namespace The namespace.
- */
- public XMLResourceIdentifierImpl(String publicId, String literalSystemId,
- String baseSystemId, String expandedSystemId,
- String namespace) {
- setValues(publicId, literalSystemId, baseSystemId,
- expandedSystemId, namespace);
- } // <init>(String,String,String,String,String)
-
- //
- // Public methods
- //
-
- /** Sets the values of the resource identifier. */
- public void setValues(String publicId, String literalSystemId,
- String baseSystemId, String expandedSystemId) {
- setValues(publicId, literalSystemId, baseSystemId,
- expandedSystemId, null);
- } // setValues(String,String,String,String)
-
- /** Sets the values of the resource identifier. */
- public void setValues(String publicId, String literalSystemId,
- String baseSystemId, String expandedSystemId,
- String namespace) {
- fPublicId = publicId;
- fLiteralSystemId = literalSystemId;
- fBaseSystemId = baseSystemId;
- fExpandedSystemId = expandedSystemId;
- fNamespace = namespace;
- } // setValues(String,String,String,String,String)
-
- /** Clears the values. */
- public void clear() {
- fPublicId = null;
- fLiteralSystemId = null;
- fBaseSystemId = null;
- fExpandedSystemId = null;
- fNamespace = null;
- } // clear()
-
- /** Sets the public identifier. */
- public void setPublicId(String publicId) {
- fPublicId = publicId;
- } // setPublicId(String)
-
- /** Sets the literal system identifier. */
- public void setLiteralSystemId(String literalSystemId) {
- fLiteralSystemId = literalSystemId;
- } // setLiteralSystemId(String)
-
- /** Sets the base system identifier. */
- public void setBaseSystemId(String baseSystemId) {
- fBaseSystemId = baseSystemId;
- } // setBaseSystemId(String)
-
- /** Sets the expanded system identifier. */
- public void setExpandedSystemId(String expandedSystemId) {
- fExpandedSystemId = expandedSystemId;
- } // setExpandedSystemId(String)
-
- /** Sets the namespace of the resource. */
- public void setNamespace(String namespace) {
- fNamespace = namespace;
- } // setNamespace(String)
-
- //
- // XMLResourceIdentifier methods
- //
-
- /** Returns the public identifier. */
- public String getPublicId() {
- return fPublicId;
- } // getPublicId():String
-
- /** Returns the literal system identifier. */
- public String getLiteralSystemId() {
- return fLiteralSystemId;
- } // getLiteralSystemId():String
-
- /**
- * Returns the base URI against which the literal SystemId is to be resolved.
- */
- public String getBaseSystemId() {
- return fBaseSystemId;
- } // getBaseSystemId():String
-
- /** Returns the expanded system identifier. */
- public String getExpandedSystemId() {
- return fExpandedSystemId;
- } // getExpandedSystemId():String
-
- /** Returns the namespace of the resource. */
- public String getNamespace() {
- return fNamespace;
- } // getNamespace():String
-
- //
- // Object methods
- //
-
- /** Returns a hash code for this object. */
- public int hashCode() {
- int code = 0;
- if (fPublicId != null) {
- code += fPublicId.hashCode();
- }
- if (fLiteralSystemId != null) {
- code += fLiteralSystemId.hashCode();
- }
- if (fBaseSystemId != null) {
- code += fBaseSystemId.hashCode();
- }
- if (fExpandedSystemId != null) {
- code += fExpandedSystemId.hashCode();
- }
- if (fNamespace != null) {
- code += fNamespace.hashCode();
- }
- return code;
- } // hashCode():int
-
- /** Returns a string representation of this object. */
- public String toString() {
- StringBuffer str = new StringBuffer();
- if (fPublicId != null) {
- str.append(fPublicId);
- }
- str.append(':');
- if (fLiteralSystemId != null) {
- str.append(fLiteralSystemId);
- }
- str.append(':');
- if (fBaseSystemId != null) {
- str.append(fBaseSystemId);
- }
- str.append(':');
- if (fExpandedSystemId != null) {
- str.append(fExpandedSystemId);
- }
- str.append(':');
- if (fNamespace != null) {
- str.append(fNamespace);
- }
- return str.toString();
- } // toString():String
-
-} // class XMLResourceIdentifierImpl
diff --git a/src/com/sun/org/apache/xerces/internal/util/XMLStringBuffer.java b/src/com/sun/org/apache/xerces/internal/util/XMLStringBuffer.java
deleted file mode 100644
index 17f4671..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/XMLStringBuffer.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999-2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package com.sun.org.apache.xerces.internal.util;
-
-import com.sun.org.apache.xerces.internal.xni.XMLString;
-
-/**
- * XMLString is a structure used to pass character arrays. However,
- * XMLStringBuffer is a buffer in which characters can be appended
- * and extends XMLString so that it can be passed to methods
- * expecting an XMLString object. This is a safe operation because
- * it is assumed that any callee will <strong>not</strong> modify
- * the contents of the XMLString structure.
- * <p>
- * The contents of the string are managed by the string buffer. As
- * characters are appended, the string buffer will grow as needed.
- * <p>
- * <strong>Note:</strong> Never set the <code>ch</code>,
- * <code>offset</code>, and <code>length</code> fields directly.
- * These fields are managed by the string buffer. In order to reset
- * the buffer, call <code>clear()</code>.
- *
- * @author Andy Clark, IBM
- * @author Eric Ye, IBM
- *
- */
-public class XMLStringBuffer
-extends XMLString {
-
- //
- // Constants
- //
-
-
- /** Default buffer size (32). */
- public static final int DEFAULT_SIZE = 32;
-
- //
- // Data
- //
-
- //
- // Constructors
- //
-
- /**
- *
- */
- public XMLStringBuffer() {
- this(DEFAULT_SIZE);
- } // <init>()
-
- /**
- *
- *
- * @param size
- */
- public XMLStringBuffer(int size) {
- ch = new char[size];
- } // <init>(int)
-
- /** Constructs a string buffer from a char. */
- public XMLStringBuffer(char c) {
- this(1);
- append(c);
- } // <init>(char)
-
- /** Constructs a string buffer from a String. */
- public XMLStringBuffer(String s) {
- this(s.length());
- append(s);
- } // <init>(String)
-
- /** Constructs a string buffer from the specified character array. */
- public XMLStringBuffer(char[] ch, int offset, int length) {
- this(length);
- append(ch, offset, length);
- } // <init>(char[],int,int)
-
- /** Constructs a string buffer from the specified XMLString. */
- public XMLStringBuffer(XMLString s) {
- this(s.length);
- append(s);
- } // <init>(XMLString)
-
- //
- // Public methods
- //
-
- /** Clears the string buffer. */
- public void clear() {
- offset = 0;
- length = 0;
- }
-
- /**
- * append
- *
- * @param c
- */
- public void append(char c) {
- if(this.length + 1 > this.ch.length){
- int newLength = this.ch.length * 2 ;
- if(newLength < this.ch.length + DEFAULT_SIZE){
- newLength = this.ch.length + DEFAULT_SIZE;
- }
- char [] tmp = new char[newLength];
- System.arraycopy(this.ch, 0, tmp, 0, this.length);
- this.ch = tmp;
- }
- this.ch[this.length] = c ;
- this.length++;
- } // append(char)
-
- /**
- * append
- *
- * @param s
- */
- public void append(String s) {
- int length = s.length();
- if (this.length + length > this.ch.length) {
- int newLength = this.ch.length * 2 ;
- if(newLength < this.ch.length + length + DEFAULT_SIZE){
- newLength = this.ch.length + length+ DEFAULT_SIZE;
- }
-
- char[] newch = new char[newLength];
- System.arraycopy(this.ch, 0, newch, 0, this.length);
- this.ch = newch;
- }
- s.getChars(0, length, this.ch, this.length);
- this.length += length;
- } // append(String)
-
- /**
- * append
- *
- * @param ch
- * @param offset
- * @param length
- */
- public void append(char[] ch, int offset, int length) {
- if (this.length + length > this.ch.length) {
- int newLength = this.ch.length * 2 ;
- if(newLength < this.ch.length + length + DEFAULT_SIZE){
- newLength = this.ch.length + length + DEFAULT_SIZE;
- }
- char[] newch = new char[newLength];
- System.arraycopy(this.ch, 0, newch, 0, this.length);
- this.ch = newch;
- }
- //making the code more robust as it would handle null or 0 length data,
- //add the data only when it contains some thing
- if(ch != null && length > 0){
- System.arraycopy(ch, offset, this.ch, this.length, length);
- this.length += length;
- }
- } // append(char[],int,int)
-
- /**
- * append
- *
- * @param s
- */
- public void append(XMLString s) {
- append(s.ch, s.offset, s.length);
- } // append(XMLString)
-
-
-} // class XMLStringBuffer
diff --git a/src/com/sun/org/apache/xerces/internal/util/XMLSymbols.java b/src/com/sun/org/apache/xerces/internal/util/XMLSymbols.java
deleted file mode 100644
index 85f83e0..0000000
--- a/src/com/sun/org/apache/xerces/internal/util/XMLSymbols.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.util;
-
-/**
- * All internalized xml symbols. They can be compared using "==".
- *
- * @author Sandy Gao, IBM
- */
-public class XMLSymbols {
-
- // public constructor.
- public XMLSymbols(){}
-
- //==========================
- // Commonly used strings
- //==========================
-
- /**
- * The empty string.
- */
- public final static String EMPTY_STRING = "".intern();
-
- //==========================
- // Namespace prefixes/uris
- //==========================
-
- /**
- * The internalized "xml" prefix.
- */
- public final static String PREFIX_XML = "xml".intern();
-
- /**
- * The internalized "xmlns" prefix.
- */
- public final static String PREFIX_XMLNS = "xmlns".intern();
-
- //==========================
- // DTD symbols
- //==========================
-
- /** Symbol: "ANY". */
- public static final String fANYSymbol = "ANY".intern();
-
- /** Symbol: "CDATA". */
- public static final String fCDATASymbol = "CDATA".intern();
-
- /** Symbol: "ID". */
- public static final String fIDSymbol = "ID".intern();
-
- /** Symbol: "IDREF". */
- public static final String fIDREFSymbol = "IDREF".intern();
-
- /** Symbol: "IDREFS". */
- public static final String fIDREFSSymbol = "IDREFS".intern();
-
- /** Symbol: "ENTITY". */
- public static final String fENTITYSymbol = "ENTITY".intern();
-
- /** Symbol: "ENTITIES". */
- public static final String fENTITIESSymbol = "ENTITIES".intern();
-
- /** Symbol: "NMTOKEN". */
- public static final String fNMTOKENSymbol = "NMTOKEN".intern();
-
- /** Symbol: "NMTOKENS". */
- public static final String fNMTOKENSSymbol = "NMTOKENS".intern();
-
- /** Symbol: "NOTATION". */
- public static final String fNOTATIONSymbol = "NOTATION".intern();
-
- /** Symbol: "ENUMERATION". */
- public static final String fENUMERATIONSymbol = "ENUMERATION".intern();
-
- /** Symbol: "#IMPLIED. */
- public static final String fIMPLIEDSymbol = "#IMPLIED".intern();
-
- /** Symbol: "#REQUIRED". */
- public static final String fREQUIREDSymbol = "#REQUIRED".intern();
-
- /** Symbol: "#FIXED". */
- public static final String fFIXEDSymbol = "#FIXED".intern();
-
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/utils/ConfigurationError.java b/src/com/sun/org/apache/xerces/internal/utils/ConfigurationError.java
deleted file mode 100644
index 9cd8673..0000000
--- a/src/com/sun/org/apache/xerces/internal/utils/ConfigurationError.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.utils;
-
-/**
- * A configuration error. This was an internal class in ObjectFactory previously
- */
-public final class ConfigurationError
- extends Error {
-
- //
- // Data
- //
-
- /** Exception. */
- private Exception exception;
-
- //
- // Constructors
- //
-
- /**
- * Construct a new instance with the specified detail string and
- * exception.
- */
- ConfigurationError(String msg, Exception x) {
- super(msg);
- this.exception = x;
- } // <init>(String,Exception)
-
- //
- // methods
- //
-
- /** Returns the exception associated to this error. */
- public Exception getException() {
- return exception;
- } // getException():Exception
-
-} // class ConfigurationError
diff --git a/src/com/sun/org/apache/xerces/internal/utils/ObjectFactory.java b/src/com/sun/org/apache/xerces/internal/utils/ObjectFactory.java
deleted file mode 100644
index d1857eb..0000000
--- a/src/com/sun/org/apache/xerces/internal/utils/ObjectFactory.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.utils;
-
-/**
- * This class is duplicated for each JAXP subpackage so keep it in sync.
- * It is package private and therefore is not exposed as part of the JAXP
- * API.
- * <p>
- * This code is designed to implement the JAXP 1.1 spec pluggability
- * feature and is designed to run on JDK version 1.1 and
- * later, and to compile on JDK 1.2 and onward.
- * The code also runs both as part of an unbundled jar file and
- * when bundled as part of the JDK.
- * <p>
- *
- * @version $Id: ObjectFactory.java,v 1.6 2010/04/23 01:44:34 joehw Exp $
- */
-public final class ObjectFactory {
-
- //
- // Constants
- //
- private static final String JAXP_INTERNAL = "com.sun.org.apache";
- private static final String STAX_INTERNAL = "com.sun.xml.internal";
-
- /** Set to true for debugging */
- private static final boolean DEBUG = isDebugEnabled();
-
-
- //
- // Private static methods
- //
-
- /** Returns true if debug has been enabled. */
- private static boolean isDebugEnabled() {
- try {
- String val = SecuritySupport.getSystemProperty("xerces.debug");
- // Allow simply setting the prop to turn on debug
- return (val != null && (!"false".equals(val)));
- }
- catch (SecurityException se) {}
- return false;
- } // isDebugEnabled()
-
- /** Prints a message to standard error if debugging is enabled. */
- private static void debugPrintln(String msg) {
- if (DEBUG) {
- System.err.println("XERCES: " + msg);
- }
- } // debugPrintln(String)
-
- /**
- * Figure out which ClassLoader to use. For JDK 1.2 and later use
- * the context ClassLoader.
- */
- public static ClassLoader findClassLoader()
- throws ConfigurationError
- {
- if (System.getSecurityManager()!=null) {
- //this will ensure bootclassloader is used
- return null;
- }
- // Figure out which ClassLoader to use for loading the provider
- // class. If there is a Context ClassLoader then use it.
- ClassLoader context = SecuritySupport.getContextClassLoader();
- ClassLoader system = SecuritySupport.getSystemClassLoader();
-
- ClassLoader chain = system;
- while (true) {
- if (context == chain) {
- // Assert: we are on JDK 1.1 or we have no Context ClassLoader
- // or any Context ClassLoader in chain of system classloader
- // (including extension ClassLoader) so extend to widest
- // ClassLoader (always look in system ClassLoader if Xerces
- // is in boot/extension/system classpath and in current
- // ClassLoader otherwise); normal classloaders delegate
- // back to system ClassLoader first so this widening doesn't
- // change the fact that context ClassLoader will be consulted
- ClassLoader current = ObjectFactory.class.getClassLoader();
-
- chain = system;
- while (true) {
- if (current == chain) {
- // Assert: Current ClassLoader in chain of
- // boot/extension/system ClassLoaders
- return system;
- }
- if (chain == null) {
- break;
- }
- chain = SecuritySupport.getParentClassLoader(chain);
- }
-
- // Assert: Current ClassLoader not in chain of
- // boot/extension/system ClassLoaders
- return current;
- }
-
- if (chain == null) {
- // boot ClassLoader reached
- break;
- }
-
- // Check for any extension ClassLoaders in chain up to
- // boot ClassLoader
- chain = SecuritySupport.getParentClassLoader(chain);
- }
-
- // Assert: Context ClassLoader not in chain of
- // boot/extension/system ClassLoaders
- return context;
- } // findClassLoader():ClassLoader
-
- /**
- * Create an instance of a class using the same classloader for the ObjectFactory by default
- * or bootclassloader when Security Manager is in place
- */
- public static Object newInstance(String className, boolean doFallback)
- throws ConfigurationError
- {
- if (System.getSecurityManager()!=null) {
- return newInstance(className, null, doFallback);
- } else {
- return newInstance(className,
- findClassLoader (), doFallback);
- }
- }
-
- /**
- * Create an instance of a class using the specified ClassLoader
- */
- public static Object newInstance(String className, ClassLoader cl,
- boolean doFallback)
- throws ConfigurationError
- {
- // assert(className != null);
- try{
- Class providerClass = findProviderClass(className, cl, doFallback);
- Object instance = providerClass.newInstance();
- if (DEBUG) debugPrintln("created new instance of " + providerClass +
- " using ClassLoader: " + cl);
- return instance;
- } catch (ClassNotFoundException x) {
- throw new ConfigurationError(
- "Provider " + className + " not found", x);
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider " + className + " could not be instantiated: " + x,
- x);
- }
- }
-
- /**
- * Find a Class using the same classloader for the ObjectFactory by default
- * or bootclassloader when Security Manager is in place
- */
- public static Class findProviderClass(String className, boolean doFallback)
- throws ClassNotFoundException, ConfigurationError
- {
- return findProviderClass (className,
- findClassLoader (), doFallback);
- }
- /**
- * Find a Class using the specified ClassLoader
- */
- public static Class findProviderClass(String className, ClassLoader cl,
- boolean doFallback)
- throws ClassNotFoundException, ConfigurationError
- {
- //throw security exception if the calling thread is not allowed to access the package
- //restrict the access to package as speicified in java.security policy
- SecurityManager security = System.getSecurityManager();
- if (security != null) {
- if (className.startsWith(JAXP_INTERNAL) ||
- className.startsWith(STAX_INTERNAL)) {
- cl = null;
- } else {
- final int lastDot = className.lastIndexOf(".");
- String packageName = className;
- if (lastDot != -1) packageName = className.substring(0, lastDot);
- security.checkPackageAccess(packageName);
- }
- }
- Class providerClass;
- if (cl == null) {
- //use the bootstrap ClassLoader.
- providerClass = Class.forName(className, false, ObjectFactory.class.getClassLoader());
- } else {
- try {
- providerClass = cl.loadClass(className);
- } catch (ClassNotFoundException x) {
- if (doFallback) {
- // Fall back to current classloader
- ClassLoader current = ObjectFactory.class.getClassLoader();
- if (current == null) {
- providerClass = Class.forName(className);
- } else if (cl != current) {
- cl = current;
- providerClass = cl.loadClass(className);
- } else {
- throw x;
- }
- } else {
- throw x;
- }
- }
- }
-
- return providerClass;
- }
-
-} // class ObjectFactory
diff --git a/src/com/sun/org/apache/xerces/internal/utils/SecuritySupport.java b/src/com/sun/org/apache/xerces/internal/utils/SecuritySupport.java
deleted file mode 100644
index 613d651..0000000
--- a/src/com/sun/org/apache/xerces/internal/utils/SecuritySupport.java
+++ /dev/null
@@ -1,339 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.utils;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.Properties;
-import java.util.PropertyResourceBundle;
-import java.util.ResourceBundle;
-
-/**
- * This class is duplicated for each subpackage so keep it in sync.
- * It is package private and therefore is not exposed as part of any API.
- *
- * @xerces.internal
- */
-public final class SecuritySupport {
-
- private static final SecuritySupport securitySupport = new SecuritySupport();
-
- /**
- * Return an instance of this class.
- */
- public static SecuritySupport getInstance() {
- return securitySupport;
- }
-
- static ClassLoader getContextClassLoader() {
- return (ClassLoader)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- ClassLoader cl = null;
- try {
- cl = Thread.currentThread().getContextClassLoader();
- } catch (SecurityException ex) { }
- return cl;
- }
- });
- }
-
- static ClassLoader getSystemClassLoader() {
- return (ClassLoader)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- ClassLoader cl = null;
- try {
- cl = ClassLoader.getSystemClassLoader();
- } catch (SecurityException ex) {}
- return cl;
- }
- });
- }
-
- static ClassLoader getParentClassLoader(final ClassLoader cl) {
- return (ClassLoader)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- ClassLoader parent = null;
- try {
- parent = cl.getParent();
- } catch (SecurityException ex) {}
-
- // eliminate loops in case of the boot
- // ClassLoader returning itself as a parent
- return (parent == cl) ? null : parent;
- }
- });
- }
-
- public static String getSystemProperty(final String propName) {
- return (String)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return System.getProperty(propName);
- }
- });
- }
-
- static FileInputStream getFileInputStream(final File file)
- throws FileNotFoundException
- {
- try {
- return (FileInputStream)
- AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws FileNotFoundException {
- return new FileInputStream(file);
- }
- });
- } catch (PrivilegedActionException e) {
- throw (FileNotFoundException)e.getException();
- }
- }
- /**
- * Return resource using the same classloader for the ObjectFactory by default
- * or bootclassloader when Security Manager is in place
- */
- public static InputStream getResourceAsStream(final String name) {
- if (System.getSecurityManager()!=null) {
- return getResourceAsStream(null, name);
- } else {
- return getResourceAsStream(ObjectFactory.findClassLoader(), name);
- }
- }
-
- public static InputStream getResourceAsStream(final ClassLoader cl,
- final String name)
- {
- return (InputStream)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- InputStream ris;
- if (cl == null) {
- ris = Object.class.getResourceAsStream("/"+name);
- } else {
- ris = cl.getResourceAsStream(name);
- }
- return ris;
- }
- });
- }
-
- /**
- * Gets a resource bundle using the specified base name, the default locale, and the caller's class loader.
- * @param bundle the base name of the resource bundle, a fully qualified class name
- * @return a resource bundle for the given base name and the default locale
- */
- public static ResourceBundle getResourceBundle(String bundle) {
- return getResourceBundle(bundle, Locale.getDefault());
- }
-
- /**
- * Gets a resource bundle using the specified base name and locale, and the caller's class loader.
- * @param bundle the base name of the resource bundle, a fully qualified class name
- * @param locale the locale for which a resource bundle is desired
- * @return a resource bundle for the given base name and locale
- */
- public static ResourceBundle getResourceBundle(final String bundle, final Locale locale) {
- return AccessController.doPrivileged(new PrivilegedAction<ResourceBundle>() {
- public ResourceBundle run() {
- try {
- return PropertyResourceBundle.getBundle(bundle, locale);
- } catch (MissingResourceException e) {
- try {
- return PropertyResourceBundle.getBundle(bundle, new Locale("en", "US"));
- } catch (MissingResourceException e2) {
- throw new MissingResourceException(
- "Could not load any resource bundle by " + bundle, bundle, "");
- }
- }
- }
- });
- }
-
- static boolean getFileExists(final File f) {
- return ((Boolean)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return f.exists() ? Boolean.TRUE : Boolean.FALSE;
- }
- })).booleanValue();
- }
-
- static long getLastModified(final File f) {
- return ((Long)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return new Long(f.lastModified());
- }
- })).longValue();
- }
-
- /**
- * Strip off path from an URI
- *
- * @param uri an URI with full path
- * @return the file name only
- */
- public static String sanitizePath(String uri) {
- if (uri == null) {
- return "";
- }
- int i = uri.lastIndexOf("/");
- if (i > 0) {
- return uri.substring(i+1, uri.length());
- }
- return uri;
- }
-
- /**
- * Check the protocol used in the systemId against allowed protocols
- *
- * @param systemId the Id of the URI
- * @param allowedProtocols a list of allowed protocols separated by comma
- * @param accessAny keyword to indicate allowing any protocol
- * @return the name of the protocol if rejected, null otherwise
- */
- public static String checkAccess(String systemId, String allowedProtocols, String accessAny) throws IOException {
- if (systemId == null || (allowedProtocols != null &&
- allowedProtocols.equalsIgnoreCase(accessAny))) {
- return null;
- }
-
- String protocol;
- if (systemId.indexOf(":")==-1) {
- protocol = "file";
- } else {
- URL url = new URL(systemId);
- protocol = url.getProtocol();
- if (protocol.equalsIgnoreCase("jar")) {
- String path = url.getPath();
- protocol = path.substring(0, path.indexOf(":"));
- }
- }
-
- if (isProtocolAllowed(protocol, allowedProtocols)) {
- //access allowed
- return null;
- } else {
- return protocol;
- }
- }
-
- /**
- * Check if the protocol is in the allowed list of protocols. The check
- * is case-insensitive while ignoring whitespaces.
- *
- * @param protocol a protocol
- * @param allowedProtocols a list of allowed protocols
- * @return true if the protocol is in the list
- */
- private static boolean isProtocolAllowed(String protocol, String allowedProtocols) {
- if (allowedProtocols == null) {
- return false;
- }
- String temp[] = allowedProtocols.split(",");
- for (String t : temp) {
- t = t.trim();
- if (t.equalsIgnoreCase(protocol)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Read JAXP system property in this order: system property,
- * $java.home/lib/jaxp.properties if the system property is not specified
- *
- * @param propertyId the Id of the property
- * @return the value of the property
- */
- public static String getJAXPSystemProperty(String sysPropertyId) {
- String accessExternal = getSystemProperty(sysPropertyId);
- if (accessExternal == null) {
- accessExternal = readJAXPProperty(sysPropertyId);
- }
- return accessExternal;
- }
-
- /**
- * Read from $java.home/lib/jaxp.properties for the specified property
- * The program
- *
- * @param propertyId the Id of the property
- * @return the value of the property
- */
- static String readJAXPProperty(String propertyId) {
- String value = null;
- InputStream is = null;
- try {
- if (firstTime) {
- synchronized (cacheProps) {
- if (firstTime) {
- String configFile = getSystemProperty("java.home") + File.separator +
- "lib" + File.separator + "jaxp.properties";
- File f = new File(configFile);
- if (getFileExists(f)) {
- is = getFileInputStream(f);
- cacheProps.load(is);
- }
- firstTime = false;
- }
- }
- }
- value = cacheProps.getProperty(propertyId);
-
- }
- catch (Exception ex) {}
- finally {
- if (is != null) {
- try {
- is.close();
- } catch (IOException ex) {}
- }
- }
-
- return value;
- }
-
- /**
- * Cache for properties in java.home/lib/jaxp.properties
- */
- static final Properties cacheProps = new Properties();
-
- /**
- * Flag indicating if the program has tried reading java.home/lib/jaxp.properties
- */
- static volatile boolean firstTime = true;
-
- private SecuritySupport () {}
-}
diff --git a/src/com/sun/org/apache/xerces/internal/utils/XMLLimitAnalyzer.java b/src/com/sun/org/apache/xerces/internal/utils/XMLLimitAnalyzer.java
deleted file mode 100644
index 8dfe6c7..0000000
--- a/src/com/sun/org/apache/xerces/internal/utils/XMLLimitAnalyzer.java
+++ /dev/null
@@ -1,264 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.org.apache.xerces.internal.utils;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager.Limit;
-import java.util.Formatter;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * A helper for analyzing entity expansion limits
- *
- * @author Joe Wang Oracle Corp.
- *
- */
-public final class XMLLimitAnalyzer {
-
- /**
- * Map old property names with the new ones
- */
- public static enum NameMap {
- ENTITY_EXPANSION_LIMIT(Constants.SP_ENTITY_EXPANSION_LIMIT, Constants.ENTITY_EXPANSION_LIMIT),
- MAX_OCCUR_NODE_LIMIT(Constants.SP_MAX_OCCUR_LIMIT, Constants.MAX_OCCUR_LIMIT),
- ELEMENT_ATTRIBUTE_LIMIT(Constants.SP_ELEMENT_ATTRIBUTE_LIMIT, Constants.ELEMENT_ATTRIBUTE_LIMIT);
-
- final String newName;
- final String oldName;
-
- NameMap(String newName, String oldName) {
- this.newName = newName;
- this.oldName = oldName;
- }
-
- String getOldName(String newName) {
- if (newName.equals(this.newName)) {
- return oldName;
- }
- return null;
- }
- }
-
- /**
- * Max value accumulated for each property
- */
- private final int[] values;
- /**
- * Names of the entities corresponding to their max values
- */
- private final String[] names;
- /**
- * Total value of accumulated entities
- */
- private final int[] totalValue;
-
- /**
- * Maintain values of the top 10 elements in the process of parsing
- */
- private final Map[] caches;
-
- private String entityStart, entityEnd;
- /**
- * Default constructor. Establishes default values for known security
- * vulnerabilities.
- */
- public XMLLimitAnalyzer() {
- values = new int[Limit.values().length];
- totalValue = new int[Limit.values().length];
- names = new String[Limit.values().length];
- caches = new Map[Limit.values().length];
- }
-
- /**
- * Add the value to the current max count for the specified property
- * To find the max value of all entities, set no limit
- *
- * @param limit the type of the property
- * @param entityName the name of the entity
- * @param value the value of the entity
- */
- public void addValue(Limit limit, String entityName, int value) {
- addValue(limit.ordinal(), entityName, value);
- }
-
- /**
- * Add the value to the current count by the index of the property
- * @param index the index of the property
- * @param entityName the name of the entity
- * @param value the value of the entity
- */
- public void addValue(int index, String entityName, int value) {
- if (index == Limit.ENTITY_EXPANSION_LIMIT.ordinal() ||
- index == Limit.MAX_OCCUR_NODE_LIMIT.ordinal() ||
- index == Limit.ELEMENT_ATTRIBUTE_LIMIT.ordinal() ||
- index == Limit.TOTAL_ENTITY_SIZE_LIMIT.ordinal() ||
- index == Limit.ENTITY_REPLACEMENT_LIMIT.ordinal()
- ) {
- totalValue[index] += value;
- return;
- }
- if (index == Limit.MAX_ELEMENT_DEPTH_LIMIT.ordinal() ||
- index == Limit.MAX_NAME_LIMIT.ordinal()) {
- values[index] = value;
- totalValue[index] = value;
- return;
- }
-
- Map<String, Integer> cache;
- if (caches[index] == null) {
- cache = new HashMap<>(10);
- caches[index] = cache;
- } else {
- cache = caches[index];
- }
-
- int accumulatedValue = value;
- if (cache.containsKey(entityName)) {
- accumulatedValue += cache.get(entityName);
- cache.put(entityName, accumulatedValue);
- } else {
- cache.put(entityName, value);
- }
-
- if (accumulatedValue > values[index]) {
- values[index] = accumulatedValue;
- names[index] = entityName;
- }
-
-
- if (index == Limit.GENERAL_ENTITY_SIZE_LIMIT.ordinal() ||
- index == Limit.PARAMETER_ENTITY_SIZE_LIMIT.ordinal()) {
- totalValue[Limit.TOTAL_ENTITY_SIZE_LIMIT.ordinal()] += value;
- }
- }
-
- /**
- * Return the value of the current max count for the specified property
- *
- * @param limit the property
- * @return the value of the property
- */
- public int getValue(Limit limit) {
- return getValue(limit.ordinal());
- }
-
- public int getValue(int index) {
- if (index == Limit.ENTITY_REPLACEMENT_LIMIT.ordinal()) {
- return totalValue[index];
- }
- return values[index];
- }
- /**
- * Return the total value accumulated so far
- *
- * @param limit the property
- * @return the accumulated value of the property
- */
- public int getTotalValue(Limit limit) {
- return totalValue[limit.ordinal()];
- }
-
- public int getTotalValue(int index) {
- return totalValue[index];
- }
- /**
- * Return the current max value (count or length) by the index of a property
- * @param index the index of a property
- * @return count of a property
- */
- public int getValueByIndex(int index) {
- return values[index];
- }
-
- public void startEntity(String name) {
- entityStart = name;
- }
-
- public boolean isTracking(String name) {
- if (entityStart == null) {
- return false;
- }
- return entityStart.equals(name);
- }
- /**
- * Stop tracking the entity
- * @param limit the limit property
- * @param name the name of an entity
- */
- public void endEntity(Limit limit, String name) {
- entityStart = "";
- Map<String, Integer> cache = caches[limit.ordinal()];
- if (cache != null) {
- cache.remove(name);
- }
- }
-
- /**
- * Resets the current value of the specified limit.
- * @param limit The limit to be reset.
- */
- public void reset(Limit limit) {
- if (limit.ordinal() == Limit.TOTAL_ENTITY_SIZE_LIMIT.ordinal()) {
- totalValue[limit.ordinal()] = 0;
- } else if (limit.ordinal() == Limit.GENERAL_ENTITY_SIZE_LIMIT.ordinal()) {
- names[limit.ordinal()] = null;
- values[limit.ordinal()] = 0;
- caches[limit.ordinal()] = null;
- totalValue[limit.ordinal()] = 0;
- }
- }
-
- public void debugPrint(XMLSecurityManager securityManager) {
- Formatter formatter = new Formatter();
- System.out.println(formatter.format("%30s %15s %15s %15s %30s",
- "Property","Limit","Total size","Size","Entity Name"));
-
- for (Limit limit : Limit.values()) {
- formatter = new Formatter();
- System.out.println(formatter.format("%30s %15d %15d %15d %30s",
- limit.name(),
- securityManager.getLimit(limit),
- totalValue[limit.ordinal()],
- values[limit.ordinal()],
- names[limit.ordinal()]));
- }
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/utils/XMLSecurityManager.java b/src/com/sun/org/apache/xerces/internal/utils/XMLSecurityManager.java
deleted file mode 100644
index 6f44177..0000000
--- a/src/com/sun/org/apache/xerces/internal/utils/XMLSecurityManager.java
+++ /dev/null
@@ -1,581 +0,0 @@
-/*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.org.apache.xerces.internal.utils;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.util.SecurityManager;
-import java.util.concurrent.CopyOnWriteArrayList;
-import org.xml.sax.SAXException;
-
-/**
- * This class manages standard and implementation-specific limitations.
- *
- */
-public final class XMLSecurityManager {
-
- /**
- * States of the settings of a property, in the order: default value, value
- * set by FEATURE_SECURE_PROCESSING, jaxp.properties file, jaxp system
- * properties, and jaxp api properties
- */
- public static enum State {
- //this order reflects the overriding order
-
- DEFAULT("default"), FSP("FEATURE_SECURE_PROCESSING"),
- JAXPDOTPROPERTIES("jaxp.properties"), SYSTEMPROPERTY("system property"),
- APIPROPERTY("property");
-
- final String literal;
- State(String literal) {
- this.literal = literal;
- }
-
- String literal() {
- return literal;
- }
- }
-
- /**
- * Limits managed by the security manager
- */
- public static enum Limit {
-
- ENTITY_EXPANSION_LIMIT("EntityExpansionLimit",
- Constants.JDK_ENTITY_EXPANSION_LIMIT, Constants.SP_ENTITY_EXPANSION_LIMIT, 0, 64000),
- MAX_OCCUR_NODE_LIMIT("MaxOccurLimit",
- Constants.JDK_MAX_OCCUR_LIMIT, Constants.SP_MAX_OCCUR_LIMIT, 0, 5000),
- ELEMENT_ATTRIBUTE_LIMIT("ElementAttributeLimit",
- Constants.JDK_ELEMENT_ATTRIBUTE_LIMIT, Constants.SP_ELEMENT_ATTRIBUTE_LIMIT, 0, 10000),
- TOTAL_ENTITY_SIZE_LIMIT("TotalEntitySizeLimit",
- Constants.JDK_TOTAL_ENTITY_SIZE_LIMIT, Constants.SP_TOTAL_ENTITY_SIZE_LIMIT, 0, 50000000),
- GENERAL_ENTITY_SIZE_LIMIT("MaxEntitySizeLimit",
- Constants.JDK_GENERAL_ENTITY_SIZE_LIMIT, Constants.SP_GENERAL_ENTITY_SIZE_LIMIT, 0, 0),
- PARAMETER_ENTITY_SIZE_LIMIT("MaxEntitySizeLimit",
- Constants.JDK_PARAMETER_ENTITY_SIZE_LIMIT, Constants.SP_PARAMETER_ENTITY_SIZE_LIMIT, 0, 1000000),
- MAX_ELEMENT_DEPTH_LIMIT("MaxElementDepthLimit",
- Constants.JDK_MAX_ELEMENT_DEPTH, Constants.SP_MAX_ELEMENT_DEPTH, 0, 0),
- MAX_NAME_LIMIT("MaxXMLNameLimit",
- Constants.JDK_XML_NAME_LIMIT, Constants.SP_XML_NAME_LIMIT, 1000, 1000),
- ENTITY_REPLACEMENT_LIMIT("EntityReplacementLimit",
- Constants.JDK_ENTITY_REPLACEMENT_LIMIT, Constants.SP_ENTITY_REPLACEMENT_LIMIT, 0, 3000000);
-
- final String key;
- final String apiProperty;
- final String systemProperty;
- final int defaultValue;
- final int secureValue;
-
- Limit(String key, String apiProperty, String systemProperty, int value, int secureValue) {
- this.key = key;
- this.apiProperty = apiProperty;
- this.systemProperty = systemProperty;
- this.defaultValue = value;
- this.secureValue = secureValue;
- }
-
- public boolean equalsAPIPropertyName(String propertyName) {
- return (propertyName == null) ? false : apiProperty.equals(propertyName);
- }
-
- public boolean equalsSystemPropertyName(String propertyName) {
- return (propertyName == null) ? false : systemProperty.equals(propertyName);
- }
-
- public String key() {
- return key;
- }
-
- public String apiProperty() {
- return apiProperty;
- }
-
- String systemProperty() {
- return systemProperty;
- }
-
- public int defaultValue() {
- return defaultValue;
- }
-
- int secureValue() {
- return secureValue;
- }
- }
-
- /**
- * Map old property names with the new ones
- */
- public static enum NameMap {
-
- ENTITY_EXPANSION_LIMIT(Constants.SP_ENTITY_EXPANSION_LIMIT, Constants.ENTITY_EXPANSION_LIMIT),
- MAX_OCCUR_NODE_LIMIT(Constants.SP_MAX_OCCUR_LIMIT, Constants.MAX_OCCUR_LIMIT),
- ELEMENT_ATTRIBUTE_LIMIT(Constants.SP_ELEMENT_ATTRIBUTE_LIMIT, Constants.ELEMENT_ATTRIBUTE_LIMIT);
- final String newName;
- final String oldName;
-
- NameMap(String newName, String oldName) {
- this.newName = newName;
- this.oldName = oldName;
- }
-
- String getOldName(String newName) {
- if (newName.equals(this.newName)) {
- return oldName;
- }
- return null;
- }
- }
- private static final int NO_LIMIT = 0;
- /**
- * Values of the properties
- */
- private final int[] values;
- /**
- * States of the settings for each property
- */
- private State[] states;
- /**
- * Flag indicating if secure processing is set
- */
- boolean secureProcessing;
-
- /**
- * States that determine if properties are set explicitly
- */
- private boolean[] isSet;
-
-
- /**
- * Index of the special entityCountInfo property
- */
- private final int indexEntityCountInfo = 10000;
- private String printEntityCountInfo = "";
-
- /**
- * Default constructor. Establishes default values for known security
- * vulnerabilities.
- */
- public XMLSecurityManager() {
- this(false);
- }
-
- /**
- * Instantiate Security Manager in accordance with the status of
- * secure processing
- * @param secureProcessing
- */
- public XMLSecurityManager(boolean secureProcessing) {
- values = new int[Limit.values().length];
- states = new State[Limit.values().length];
- isSet = new boolean[Limit.values().length];
- this.secureProcessing = secureProcessing;
- for (Limit limit : Limit.values()) {
- if (secureProcessing) {
- values[limit.ordinal()] = limit.secureValue;
- states[limit.ordinal()] = State.FSP;
- } else {
- values[limit.ordinal()] = limit.defaultValue();
- states[limit.ordinal()] = State.DEFAULT;
- }
- }
- //read system properties or jaxp.properties
- readSystemProperties();
- }
-
- /**
- * Setting FEATURE_SECURE_PROCESSING explicitly
- */
- public void setSecureProcessing(boolean secure) {
- secureProcessing = secure;
- for (Limit limit : Limit.values()) {
- if (secure) {
- setLimit(limit.ordinal(), State.FSP, limit.secureValue());
- } else {
- setLimit(limit.ordinal(), State.FSP, limit.defaultValue());
- }
- }
- }
-
- /**
- * Return the state of secure processing
- * @return the state of secure processing
- */
- public boolean isSecureProcessing() {
- return secureProcessing;
- }
-
-
- /**
- * Set limit by property name and state
- * @param propertyName property name
- * @param state the state of the property
- * @param value the value of the property
- * @return true if the property is managed by the security manager; false
- * if otherwise.
- */
- public boolean setLimit(String propertyName, State state, Object value) {
- int index = getIndex(propertyName);
- if (index > -1) {
- setLimit(index, state, value);
- return true;
- }
- return false;
- }
-
- /**
- * Set the value for a specific limit.
- *
- * @param limit the limit
- * @param state the state of the property
- * @param value the value of the property
- */
- public void setLimit(Limit limit, State state, int value) {
- setLimit(limit.ordinal(), state, value);
- }
-
- /**
- * Set the value of a property by its index
- *
- * @param index the index of the property
- * @param state the state of the property
- * @param value the value of the property
- */
- public void setLimit(int index, State state, Object value) {
- if (index == indexEntityCountInfo) {
- printEntityCountInfo = (String)value;
- } else {
- int temp;
- if (Integer.class.isAssignableFrom(value.getClass())) {
- temp = ((Integer)value).intValue();
- } else {
- temp = Integer.parseInt((String) value);
- if (temp < 0) {
- temp = 0;
- }
- }
- setLimit(index, state, temp);
- }
- }
-
- /**
- * Set the value of a property by its index
- *
- * @param index the index of the property
- * @param state the state of the property
- * @param value the value of the property
- */
- public void setLimit(int index, State state, int value) {
- if (index == indexEntityCountInfo) {
- //if it's explicitly set, it's treated as yes no matter the value
- printEntityCountInfo = Constants.JDK_YES;
- } else {
- //only update if it shall override
- if (state.compareTo(states[index]) >= 0) {
- values[index] = value;
- states[index] = state;
- isSet[index] = true;
- }
- }
- }
-
- /**
- * Return the value of the specified property
- *
- * @param propertyName the property name
- * @return the value of the property as a string. If a property is managed
- * by this manager, its value shall not be null.
- */
- public String getLimitAsString(String propertyName) {
- int index = getIndex(propertyName);
- if (index > -1) {
- return getLimitValueByIndex(index);
- }
-
- return null;
- }
- /**
- * Return the value of the specified property
- *
- * @param limit the property
- * @return the value of the property
- */
- public int getLimit(Limit limit) {
- return values[limit.ordinal()];
- }
-
- /**
- * Return the value of a property by its ordinal
- *
- * @param limit the property
- * @return value of a property
- */
- public String getLimitValueAsString(Limit limit) {
- return Integer.toString(values[limit.ordinal()]);
- }
-
- /**
- * Return the value of a property by its ordinal
- *
- * @param index the index of a property
- * @return limit of a property as a string
- */
- public String getLimitValueByIndex(int index) {
- if (index == indexEntityCountInfo) {
- return printEntityCountInfo;
- }
-
- return Integer.toString(values[index]);
- }
-
- /**
- * Return the state of the limit property
- *
- * @param limit the limit
- * @return the state of the limit property
- */
- public State getState(Limit limit) {
- return states[limit.ordinal()];
- }
-
- /**
- * Return the state of the limit property
- *
- * @param limit the limit
- * @return the state of the limit property
- */
- public String getStateLiteral(Limit limit) {
- return states[limit.ordinal()].literal();
- }
-
- /**
- * Get the index by property name
- *
- * @param propertyName property name
- * @return the index of the property if found; return -1 if not
- */
- public int getIndex(String propertyName) {
- for (Limit limit : Limit.values()) {
- if (limit.equalsAPIPropertyName(propertyName)) {
- //internally, ordinal is used as index
- return limit.ordinal();
- }
- }
- //special property to return entity count info
- if (propertyName.equals(Constants.JDK_ENTITY_COUNT_INFO)) {
- return indexEntityCountInfo;
- }
- return -1;
- }
-
- /**
- * Check if there's no limit defined by the Security Manager
- * @param limit
- * @return
- */
- public boolean isNoLimit(int limit) {
- return limit==NO_LIMIT;
- }
- /**
- * Check if the size (length or count) of the specified limit property is
- * over the limit
- *
- * @param limit the type of the limit property
- * @param entityName the name of the entity
- * @param size the size (count or length) of the entity
- * @return true if the size is over the limit, false otherwise
- */
- public boolean isOverLimit(Limit limit, String entityName, int size,
- XMLLimitAnalyzer limitAnalyzer) {
- return isOverLimit(limit.ordinal(), entityName, size, limitAnalyzer);
- }
-
- /**
- * Check if the value (length or count) of the specified limit property is
- * over the limit
- *
- * @param index the index of the limit property
- * @param entityName the name of the entity
- * @param size the size (count or length) of the entity
- * @return true if the size is over the limit, false otherwise
- */
- public boolean isOverLimit(int index, String entityName, int size,
- XMLLimitAnalyzer limitAnalyzer) {
- if (values[index] == NO_LIMIT) {
- return false;
- }
- if (size > values[index]) {
- limitAnalyzer.addValue(index, entityName, size);
- return true;
- }
- return false;
- }
-
- /**
- * Check against cumulated value
- *
- * @param limit the type of the limit property
- * @param size the size (count or length) of the entity
- * @return true if the size is over the limit, false otherwise
- */
- public boolean isOverLimit(Limit limit, XMLLimitAnalyzer limitAnalyzer) {
- return isOverLimit(limit.ordinal(), limitAnalyzer);
- }
-
- public boolean isOverLimit(int index, XMLLimitAnalyzer limitAnalyzer) {
- if (values[index] == NO_LIMIT) {
- return false;
- }
-
- if (index == Limit.ELEMENT_ATTRIBUTE_LIMIT.ordinal() ||
- index == Limit.ENTITY_EXPANSION_LIMIT.ordinal() ||
- index == Limit.TOTAL_ENTITY_SIZE_LIMIT.ordinal() ||
- index == Limit.ENTITY_REPLACEMENT_LIMIT.ordinal() ||
- index == Limit.MAX_ELEMENT_DEPTH_LIMIT.ordinal() ||
- index == Limit.MAX_NAME_LIMIT.ordinal()
- ) {
- return (limitAnalyzer.getTotalValue(index) > values[index]);
- } else {
- return (limitAnalyzer.getValue(index) > values[index]);
- }
- }
-
- public void debugPrint(XMLLimitAnalyzer limitAnalyzer) {
- if (printEntityCountInfo.equals(Constants.JDK_YES)) {
- limitAnalyzer.debugPrint(this);
- }
- }
-
-
- /**
- * Indicate if a property is set explicitly
- * @param index
- * @return
- */
- public boolean isSet(int index) {
- return isSet[index];
- }
-
- public boolean printEntityCountInfo() {
- return printEntityCountInfo.equals(Constants.JDK_YES);
- }
-
- /**
- * Read from system properties, or those in jaxp.properties
- */
- private void readSystemProperties() {
-
- for (Limit limit : Limit.values()) {
- if (!getSystemProperty(limit, limit.systemProperty())) {
- //if system property is not found, try the older form if any
- for (NameMap nameMap : NameMap.values()) {
- String oldName = nameMap.getOldName(limit.systemProperty());
- if (oldName != null) {
- getSystemProperty(limit, oldName);
- }
- }
- }
- }
-
- }
-
- // Array list to store printed warnings for each SAX parser used
- private static final CopyOnWriteArrayList<String> printedWarnings = new CopyOnWriteArrayList<>();
-
- /**
- * Prints out warnings if a parser does not support the specified feature/property.
- *
- * @param parserClassName the name of the parser class
- * @param propertyName the property name
- * @param exception the exception thrown by the parser
- */
- public static void printWarning(String parserClassName, String propertyName, SAXException exception) {
- String key = parserClassName+":"+propertyName;
- if (printedWarnings.addIfAbsent(key)) {
- System.err.println( "Warning: "+parserClassName+": "+exception.getMessage());
- }
- }
-
- /**
- * Read from system properties, or those in jaxp.properties
- *
- * @param property the type of the property
- * @param sysPropertyName the name of system property
- */
- private boolean getSystemProperty(Limit limit, String sysPropertyName) {
- try {
- String value = SecuritySupport.getSystemProperty(sysPropertyName);
- if (value != null && !value.equals("")) {
- values[limit.ordinal()] = Integer.parseInt(value);
- states[limit.ordinal()] = State.SYSTEMPROPERTY;
- return true;
- }
-
- value = SecuritySupport.readJAXPProperty(sysPropertyName);
- if (value != null && !value.equals("")) {
- values[limit.ordinal()] = Integer.parseInt(value);
- states[limit.ordinal()] = State.JAXPDOTPROPERTIES;
- return true;
- }
- } catch (NumberFormatException e) {
- //invalid setting
- throw new NumberFormatException("Invalid setting for system property: " + limit.systemProperty());
- }
- return false;
- }
-
-
- /**
- * Convert a value set through setProperty to XMLSecurityManager.
- * If the value is an instance of XMLSecurityManager, use it to override the default;
- * If the value is an old SecurityManager, convert to the new XMLSecurityManager.
- *
- * @param value user specified security manager
- * @param securityManager an instance of XMLSecurityManager
- * @return an instance of the new security manager XMLSecurityManager
- */
- static public XMLSecurityManager convert(Object value, XMLSecurityManager securityManager) {
- if (value == null) {
- if (securityManager == null) {
- securityManager = new XMLSecurityManager(true);
- }
- return securityManager;
- }
- if (XMLSecurityManager.class.isAssignableFrom(value.getClass())) {
- return (XMLSecurityManager)value;
- } else {
- if (securityManager == null) {
- securityManager = new XMLSecurityManager(true);
- }
- if (SecurityManager.class.isAssignableFrom(value.getClass())) {
- SecurityManager origSM = (SecurityManager)value;
- securityManager.setLimit(Limit.MAX_OCCUR_NODE_LIMIT, State.APIPROPERTY, origSM.getMaxOccurNodeLimit());
- securityManager.setLimit(Limit.ENTITY_EXPANSION_LIMIT, State.APIPROPERTY, origSM.getEntityExpansionLimit());
- securityManager.setLimit(Limit.ELEMENT_ATTRIBUTE_LIMIT, State.APIPROPERTY, origSM.getElementAttrLimit());
- }
- return securityManager;
- }
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/utils/XMLSecurityPropertyManager.java b/src/com/sun/org/apache/xerces/internal/utils/XMLSecurityPropertyManager.java
deleted file mode 100644
index 43326e1..0000000
--- a/src/com/sun/org/apache/xerces/internal/utils/XMLSecurityPropertyManager.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.org.apache.xerces.internal.utils;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import javax.xml.XMLConstants;
-
-/**
- * This class manages security related properties
- *
- */
-public final class XMLSecurityPropertyManager {
-
- /**
- * States of the settings of a property, in the order: default value, value
- * set by FEATURE_SECURE_PROCESSING, jaxp.properties file, jaxp system
- * properties, and jaxp api properties
- */
- public static enum State {
- //this order reflects the overriding order
- DEFAULT, FSP, JAXPDOTPROPERTIES, SYSTEMPROPERTY, APIPROPERTY
- }
-
- /**
- * Limits managed by the security manager
- */
- public static enum Property {
- ACCESS_EXTERNAL_DTD(XMLConstants.ACCESS_EXTERNAL_DTD,
- Constants.EXTERNAL_ACCESS_DEFAULT),
- ACCESS_EXTERNAL_SCHEMA(XMLConstants.ACCESS_EXTERNAL_SCHEMA,
- Constants.EXTERNAL_ACCESS_DEFAULT);
-
- final String name;
- final String defaultValue;
-
- Property(String name, String value) {
- this.name = name;
- this.defaultValue = value;
- }
-
- public boolean equalsName(String propertyName) {
- return (propertyName == null) ? false : name.equals(propertyName);
- }
-
- String defaultValue() {
- return defaultValue;
- }
- }
-
- /**
- * Values of the properties as defined in enum Properties
- */
- private final String[] values;
- /**
- * States of the settings for each property in Properties above
- */
- private State[] states = {State.DEFAULT, State.DEFAULT};
-
- /**
- * Default constructor. Establishes default values
- */
- public XMLSecurityPropertyManager() {
- values = new String[Property.values().length];
- for (Property property : Property.values()) {
- values[property.ordinal()] = property.defaultValue();
- }
- //read system properties or jaxp.properties
- readSystemProperties();
- }
-
-
- /**
- * Set limit by property name and state
- * @param propertyName property name
- * @param state the state of the property
- * @param value the value of the property
- * @return true if the property is managed by the security property manager;
- * false if otherwise.
- */
- public boolean setValue(String propertyName, State state, Object value) {
- int index = getIndex(propertyName);
- if (index > -1) {
- setValue(index, state, (String)value);
- return true;
- }
- return false;
- }
-
- /**
- * Set the value for a specific property.
- *
- * @param property the property
- * @param state the state of the property
- * @param value the value of the property
- */
- public void setValue(Property property, State state, String value) {
- //only update if it shall override
- if (state.compareTo(states[property.ordinal()]) >= 0) {
- values[property.ordinal()] = value;
- states[property.ordinal()] = state;
- }
- }
-
- /**
- * Set the value of a property by its index
- * @param index the index of the property
- * @param state the state of the property
- * @param value the value of the property
- */
- public void setValue(int index, State state, String value) {
- //only update if it shall override
- if (state.compareTo(states[index]) >= 0) {
- values[index] = value;
- states[index] = state;
- }
- }
-
-
- /**
- * Return the value of the specified property
- *
- * @param propertyName the property name
- * @return the value of the property as a string
- */
- public String getValue(String propertyName) {
- int index = getIndex(propertyName);
- if (index > -1) {
- return getValueByIndex(index);
- }
-
- return null;
- }
-
- /**
- * Return the value of the specified property
- *
- * @param property the property
- * @return the value of the property
- */
- public String getValue(Property property) {
- return values[property.ordinal()];
- }
-
- /**
- * Return the value of a property by its ordinal
- * @param index the index of a property
- * @return value of a property
- */
- public String getValueByIndex(int index) {
- return values[index];
- }
-
- /**
- * Get the index by property name
- * @param propertyName property name
- * @return the index of the property if found; return -1 if not
- */
- public int getIndex(String propertyName){
- for (Property property : Property.values()) {
- if (property.equalsName(propertyName)) {
- //internally, ordinal is used as index
- return property.ordinal();
- }
- }
- return -1;
- }
-
- /**
- * Read from system properties, or those in jaxp.properties
- */
- private void readSystemProperties() {
- getSystemProperty(Property.ACCESS_EXTERNAL_DTD,
- Constants.SP_ACCESS_EXTERNAL_DTD);
- getSystemProperty(Property.ACCESS_EXTERNAL_SCHEMA,
- Constants.SP_ACCESS_EXTERNAL_SCHEMA);
- }
-
- /**
- * Read from system properties, or those in jaxp.properties
- *
- * @param property the property
- * @param systemProperty the name of the system property
- */
- private void getSystemProperty(Property property, String systemProperty) {
- try {
- String value = SecuritySupport.getSystemProperty(systemProperty);
- if (value != null) {
- values[property.ordinal()] = value;
- states[property.ordinal()] = State.SYSTEMPROPERTY;
- return;
- }
-
- value = SecuritySupport.readJAXPProperty(systemProperty);
- if (value != null) {
- values[property.ordinal()] = value;
- states[property.ordinal()] = State.JAXPDOTPROPERTIES;
- }
- } catch (NumberFormatException e) {
- //invalid setting ignored
- }
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xinclude/MultipleScopeNamespaceSupport.java b/src/com/sun/org/apache/xerces/internal/xinclude/MultipleScopeNamespaceSupport.java
deleted file mode 100644
index 27ac8ee..0000000
--- a/src/com/sun/org/apache/xerces/internal/xinclude/MultipleScopeNamespaceSupport.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xerces.internal.xinclude;
-
-import java.util.Enumeration;
-
-import com.sun.org.apache.xerces.internal.util.NamespaceSupport;
-import com.sun.org.apache.xerces.internal.util.XMLSymbols;
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-
-/**
- * This implementation of NamespaceContext has the ability to maintain multiple
- * scopes of namespace/prefix bindings. This is useful in situations when it is
- * not always appropriate for elements to inherit the namespace bindings of their
- * ancestors (such as included elements in XInclude).
- *
- * When searching for a URI to match a prefix, or a prefix to match a URI, it is
- * searched for in the current context, then the ancestors of the current context,
- * up to the beginning of the current scope. Other scopes are not searched.
- *
- * @author Peter McCracken, IBM
- *
- */
-public class MultipleScopeNamespaceSupport extends NamespaceSupport {
-
- protected int[] fScope = new int[8];
- protected int fCurrentScope;
-
- /**
- *
- */
- public MultipleScopeNamespaceSupport() {
- super();
- fCurrentScope = 0;
- fScope[0] = 0;
- }
-
- /**
- * @param context
- */
- public MultipleScopeNamespaceSupport(NamespaceContext context) {
- super(context);
- fCurrentScope = 0;
- fScope[0] = 0;
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xni.NamespaceContext#getAllPrefixes()
- */
- public Enumeration getAllPrefixes() {
- int count = 0;
- if (fPrefixes.length < (fNamespace.length / 2)) {
- // resize prefix array
- String[] prefixes = new String[fNamespaceSize];
- fPrefixes = prefixes;
- }
- String prefix = null;
- boolean unique = true;
- for (int i = fContext[fScope[fCurrentScope]];
- i <= (fNamespaceSize - 2);
- i += 2) {
- prefix = fNamespace[i];
- for (int k = 0; k < count; k++) {
- if (fPrefixes[k] == prefix) {
- unique = false;
- break;
- }
- }
- if (unique) {
- fPrefixes[count++] = prefix;
- }
- unique = true;
- }
- return new Prefixes(fPrefixes, count);
- }
-
- public int getScopeForContext(int context) {
- int scope = fCurrentScope;
- while (context < fScope[scope]) {
- scope--;
- }
- return scope;
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xni.NamespaceContext#getPrefix(java.lang.String)
- */
- public String getPrefix(String uri) {
- return getPrefix(uri, fNamespaceSize, fContext[fScope[fCurrentScope]]);
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xni.NamespaceContext#getURI(java.lang.String)
- */
- public String getURI(String prefix) {
- return getURI(prefix, fNamespaceSize, fContext[fScope[fCurrentScope]]);
- }
-
- public String getPrefix(String uri, int context) {
- return getPrefix(uri, fContext[context+1], fContext[fScope[getScopeForContext(context)]]);
- }
-
- public String getURI(String prefix, int context) {
- return getURI(prefix, fContext[context+1], fContext[fScope[getScopeForContext(context)]]);
- }
-
- public String getPrefix(String uri, int start, int end) {
- // this saves us from having a copy of each of these in fNamespace for each scope
- if (uri == NamespaceContext.XML_URI) {
- return XMLSymbols.PREFIX_XML;
- }
- if (uri == NamespaceContext.XMLNS_URI) {
- return XMLSymbols.PREFIX_XMLNS;
- }
-
- // find uri in current context
- for (int i = start; i > end; i -= 2) {
- if (fNamespace[i - 1] == uri) {
- if (getURI(fNamespace[i - 2]) == uri)
- return fNamespace[i - 2];
- }
- }
-
- // uri not found
- return null;
- }
-
- public String getURI(String prefix, int start, int end) {
- // this saves us from having a copy of each of these in fNamespace for each scope
- if (prefix == XMLSymbols.PREFIX_XML) {
- return NamespaceContext.XML_URI;
- }
- if (prefix == XMLSymbols.PREFIX_XMLNS) {
- return NamespaceContext.XMLNS_URI;
- }
-
- // find prefix in current context
- for (int i = start; i > end; i -= 2) {
- if (fNamespace[i - 2] == prefix) {
- return fNamespace[i - 1];
- }
- }
-
- // prefix not found
- return null;
- }
-
- /**
- * Only resets the current scope -- all namespaces defined in lower scopes
- * remain valid after a call to reset.
- */
- public void reset() {
- fCurrentContext = fScope[fCurrentScope];
- fNamespaceSize = fContext[fCurrentContext];
- }
-
- /**
- * Begins a new scope. None of the previous namespace bindings will be used,
- * until the new scope is popped with popScope()
- */
- public void pushScope() {
- if (fCurrentScope + 1 == fScope.length) {
- int[] contextarray = new int[fScope.length * 2];
- System.arraycopy(fScope, 0, contextarray, 0, fScope.length);
- fScope = contextarray;
- }
- pushContext();
- fScope[++fCurrentScope] = fCurrentContext;
- }
-
- /**
- * Pops the current scope. The namespace bindings from the new current scope
- * are then used for searching for namespaces and prefixes.
- */
- public void popScope() {
- fCurrentContext = fScope[fCurrentScope--];
- popContext();
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xinclude/SecuritySupport.java b/src/com/sun/org/apache/xerces/internal/xinclude/SecuritySupport.java
deleted file mode 100644
index eb875e2..0000000
--- a/src/com/sun/org/apache/xerces/internal/xinclude/SecuritySupport.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xinclude;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.InputStream;
-
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-
-/**
- * This class is duplicated for each subpackage so keep it in sync.
- * It is package private and therefore is not exposed as part of any API.
- *
- * @xerces.internal
- */
-final class SecuritySupport {
-
- private static final SecuritySupport securitySupport = new SecuritySupport();
-
- /**
- * Return an instance of this class.
- */
- static SecuritySupport getInstance() {
- return securitySupport;
- }
-
- ClassLoader getContextClassLoader() {
- return (ClassLoader)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- ClassLoader cl = null;
- try {
- cl = Thread.currentThread().getContextClassLoader();
- } catch (SecurityException ex) { }
- return cl;
- }
- });
- }
-
- ClassLoader getSystemClassLoader() {
- return (ClassLoader)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- ClassLoader cl = null;
- try {
- cl = ClassLoader.getSystemClassLoader();
- } catch (SecurityException ex) {}
- return cl;
- }
- });
- }
-
- ClassLoader getParentClassLoader(final ClassLoader cl) {
- return (ClassLoader)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- ClassLoader parent = null;
- try {
- parent = cl.getParent();
- } catch (SecurityException ex) {}
-
- // eliminate loops in case of the boot
- // ClassLoader returning itself as a parent
- return (parent == cl) ? null : parent;
- }
- });
- }
-
- String getSystemProperty(final String propName) {
- return (String)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return System.getProperty(propName);
- }
- });
- }
-
- FileInputStream getFileInputStream(final File file)
- throws FileNotFoundException
- {
- try {
- return (FileInputStream)
- AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws FileNotFoundException {
- return new FileInputStream(file);
- }
- });
- } catch (PrivilegedActionException e) {
- throw (FileNotFoundException)e.getException();
- }
- }
-
- InputStream getResourceAsStream(final ClassLoader cl,
- final String name)
- {
- return (InputStream)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- InputStream ris;
- if (cl == null) {
- ris = ClassLoader.getSystemResourceAsStream(name);
- } else {
- ris = cl.getResourceAsStream(name);
- }
- return ris;
- }
- });
- }
-
- boolean getFileExists(final File f) {
- return ((Boolean)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return new Boolean(f.exists());
- }
- })).booleanValue();
- }
-
- long getLastModified(final File f) {
- return ((Long)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return new Long(f.lastModified());
- }
- })).longValue();
- }
-
- private SecuritySupport () {}
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xinclude/XInclude11TextReader.java b/src/com/sun/org/apache/xerces/internal/xinclude/XInclude11TextReader.java
deleted file mode 100644
index 7ff7ecb..0000000
--- a/src/com/sun/org/apache/xerces/internal/xinclude/XInclude11TextReader.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xerces.internal.xinclude;
-
-import java.io.IOException;
-
-import com.sun.org.apache.xerces.internal.util.XML11Char;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-
-/**
- * This class is used for reading resources requested in &lt;include&gt; elements in
- * XML 1.1 entities, when the parse attribute of the &lt;include&gt; element is "text".
- * Using this class will open the location, detect the encoding, and discard the
- * byte order mark, if applicable.
- *
- * @author Michael Glavassevich, IBM
- *
- *
- * @see XIncludeHandler
- */
-public class XInclude11TextReader
- extends XIncludeTextReader {
-
- /**
- * Construct the XIncludeReader using the XMLInputSource and XIncludeHandler.
- *
- * @param source The XMLInputSource to use.
- * @param handler The XIncludeHandler to use.
- * @param bufferSize The size of this text reader's buffer.
- */
- public XInclude11TextReader(XMLInputSource source, XIncludeHandler handler, int bufferSize)
- throws IOException {
- super(source, handler, bufferSize);
- }
-
- /**
- * Returns true if the specified character is a valid XML character
- * as per the rules of XML 1.1.
- *
- * @param ch The character to check.
- */
- protected boolean isValid(int ch) {
- return XML11Char.isXML11Valid(ch);
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xinclude/XIncludeHandler.java b/src/com/sun/org/apache/xerces/internal/xinclude/XIncludeHandler.java
deleted file mode 100644
index a060f99..0000000
--- a/src/com/sun/org/apache/xerces/internal/xinclude/XIncludeHandler.java
+++ /dev/null
@@ -1,3080 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xerces.internal.xinclude;
-
-import java.io.CharConversionException;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Locale;
-import java.util.Stack;
-import java.util.StringTokenizer;
-import javax.xml.XMLConstants;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.XMLEntityManager;
-import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
-import com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException;
-import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter;
-import com.sun.org.apache.xerces.internal.util.AugmentationsImpl;
-import com.sun.org.apache.xerces.internal.util.HTTPInputSource;
-import com.sun.org.apache.xerces.internal.util.IntStack;
-import com.sun.org.apache.xerces.internal.util.ParserConfigurationSettings;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.util.URI;
-import com.sun.org.apache.xerces.internal.util.XMLAttributesImpl;
-import com.sun.org.apache.xerces.internal.util.XMLResourceIdentifierImpl;
-import com.sun.org.apache.xerces.internal.util.XMLChar;
-import com.sun.org.apache.xerces.internal.util.XMLSymbols;
-import com.sun.org.apache.xerces.internal.util.URI.MalformedURIException;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager;
-import com.sun.org.apache.xerces.internal.xni.Augmentations;
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
-import com.sun.org.apache.xerces.internal.xni.XMLDTDHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLLocator;
-import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
-import com.sun.org.apache.xerces.internal.xni.XMLString;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponent;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDFilter;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDSource;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentFilter;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLEntityResolver;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration;
-import com.sun.org.apache.xerces.internal.xpointer.XPointerHandler;
-import com.sun.org.apache.xerces.internal.xpointer.XPointerProcessor;
-import com.sun.org.apache.xerces.internal.utils.ObjectFactory;
-import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager;
-import java.util.Objects;
-
-/**
- * <p>
- * This is a pipeline component which performs XInclude handling, according to the
- * W3C specification for XML Inclusions.
- * </p>
- * <p>
- * This component analyzes each event in the pipeline, looking for &lt;include&gt;
- * elements. An &lt;include&gt; element is one which has a namespace of
- * <code>http://www.w3.org/2001/XInclude</code> and a localname of <code>include</code>.
- * When it finds an &lt;include&gt; element, it attempts to include the file specified
- * in the <code>href</code> attribute of the element. If inclusion succeeds, all
- * children of the &lt;include&gt; element are ignored (with the exception of
- * checking for invalid children as outlined in the specification). If the inclusion
- * fails, the &lt;fallback&gt; child of the &lt;include&gt; element is processed.
- * </p>
- * <p>
- * See the <a href="http://www.w3.org/TR/xinclude/">XInclude specification</a> for
- * more information on how XInclude is to be used.
- * </p>
- * <p>
- * This component requires the following features and properties from the
- * component manager that uses it:
- * <ul>
- * <li>http://xml.org/sax/features/allow-dtd-events-after-endDTD</li>
- * <li>http://apache.org/xml/properties/internal/error-reporter</li>
- * <li>http://apache.org/xml/properties/internal/entity-resolver</li>
- * </ul>
- * Optional property:
- * <ul>
- * <li>http://apache.org/xml/properties/input-buffer-size</li>
- * </ul>
- *
- * Furthermore, the <code>NamespaceContext</code> used in the pipeline is required
- * to be an instance of <code>XIncludeNamespaceSupport</code>.
- * </p>
- * <p>
- * Currently, this implementation has only partial support for the XInclude specification.
- * Specifically, it is missing support for XPointer document fragments. Thus, only whole
- * documents can be included using this component in the pipeline.
- * </p>
- *
- * @author Peter McCracken, IBM
- * @author Michael Glavassevich, IBM
- *
- * @version $Id: XIncludeHandler.java,v 1.7 2010-11-01 04:40:18 joehw Exp $
- *
- * @see XIncludeNamespaceSupport
- */
-public class XIncludeHandler
- implements XMLComponent, XMLDocumentFilter, XMLDTDFilter {
-
- public final static String XINCLUDE_DEFAULT_CONFIGURATION =
- "com.sun.org.apache.xerces.internal.parsers.XIncludeParserConfiguration";
- public final static String HTTP_ACCEPT = "Accept";
- public final static String HTTP_ACCEPT_LANGUAGE = "Accept-Language";
- public final static String XPOINTER = "xpointer";
-
- public final static String XINCLUDE_NS_URI =
- "http://www.w3.org/2001/XInclude".intern();
- public final static String XINCLUDE_INCLUDE = "include".intern();
- public final static String XINCLUDE_FALLBACK = "fallback".intern();
-
- public final static String XINCLUDE_PARSE_XML = "xml".intern();
- public final static String XINCLUDE_PARSE_TEXT = "text".intern();
-
- public final static String XINCLUDE_ATTR_HREF = "href".intern();
- public final static String XINCLUDE_ATTR_PARSE = "parse".intern();
- public final static String XINCLUDE_ATTR_ENCODING = "encoding".intern();
- public final static String XINCLUDE_ATTR_ACCEPT = "accept".intern();
- public final static String XINCLUDE_ATTR_ACCEPT_LANGUAGE = "accept-language".intern();
-
- // Top Level Information Items have [included] property in infoset
- public final static String XINCLUDE_INCLUDED = "[included]".intern();
-
- /** The identifier for the Augmentation that contains the current base URI */
- public final static String CURRENT_BASE_URI = "currentBaseURI";
-
- // used for adding [base URI] attributes
- public final static String XINCLUDE_BASE = "base".intern();
- public final static QName XML_BASE_QNAME =
- new QName(
- XMLSymbols.PREFIX_XML,
- XINCLUDE_BASE,
- (XMLSymbols.PREFIX_XML + ":" + XINCLUDE_BASE).intern(),
- NamespaceContext.XML_URI);
-
- // used for adding [language] attributes
- public final static String XINCLUDE_LANG = "lang".intern();
- public final static QName XML_LANG_QNAME =
- new QName(
- XMLSymbols.PREFIX_XML,
- XINCLUDE_LANG,
- (XMLSymbols.PREFIX_XML + ":" + XINCLUDE_LANG).intern(),
- NamespaceContext.XML_URI);
-
- public final static QName NEW_NS_ATTR_QNAME =
- new QName(
- XMLSymbols.PREFIX_XMLNS,
- "",
- XMLSymbols.PREFIX_XMLNS + ":",
- NamespaceContext.XMLNS_URI);
-
- // Processing States
- private final static int STATE_NORMAL_PROCESSING = 1;
- // we go into this state after a successful include (thus we ignore the children
- // of the include) or after a fallback
- private final static int STATE_IGNORE = 2;
- // we go into this state after a failed include. If we don't encounter a fallback
- // before we reach the end include tag, it's a fatal error
- private final static int STATE_EXPECT_FALLBACK = 3;
-
- // recognized features and properties
-
- /** Feature identifier: validation. */
- protected static final String VALIDATION =
- Constants.SAX_FEATURE_PREFIX + Constants.VALIDATION_FEATURE;
-
- /** Feature identifier: schema validation. */
- protected static final String SCHEMA_VALIDATION =
- Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_VALIDATION_FEATURE;
-
- /** Feature identifier: dynamic validation. */
- protected static final String DYNAMIC_VALIDATION =
- Constants.XERCES_FEATURE_PREFIX + Constants.DYNAMIC_VALIDATION_FEATURE;
-
- /** Feature identifier: allow notation and unparsed entity events to be sent out of order. */
- protected static final String ALLOW_UE_AND_NOTATION_EVENTS =
- Constants.SAX_FEATURE_PREFIX
- + Constants.ALLOW_DTD_EVENTS_AFTER_ENDDTD_FEATURE;
-
- /** Feature identifier: fixup base URIs. */
- protected static final String XINCLUDE_FIXUP_BASE_URIS =
- Constants.XERCES_FEATURE_PREFIX + Constants.XINCLUDE_FIXUP_BASE_URIS_FEATURE;
-
- /** Feature identifier: fixup language. */
- protected static final String XINCLUDE_FIXUP_LANGUAGE =
- Constants.XERCES_FEATURE_PREFIX + Constants.XINCLUDE_FIXUP_LANGUAGE_FEATURE;
-
- /** Property identifier: symbol table. */
- protected static final String SYMBOL_TABLE =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY;
-
- /** Property identifier: error reporter. */
- protected static final String ERROR_REPORTER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY;
-
- /** Property identifier: entity resolver. */
- protected static final String ENTITY_RESOLVER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_RESOLVER_PROPERTY;
-
- /** property identifier: security manager. */
- protected static final String SECURITY_MANAGER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SECURITY_MANAGER_PROPERTY;
-
- /** property identifier: buffer size. */
- public static final String BUFFER_SIZE =
- Constants.XERCES_PROPERTY_PREFIX + Constants.BUFFER_SIZE_PROPERTY;
-
- protected static final String PARSER_SETTINGS =
- Constants.XERCES_FEATURE_PREFIX + Constants.PARSER_SETTINGS;
-
- /** property identifier: XML security property manager. */
- protected static final String XML_SECURITY_PROPERTY_MANAGER =
- Constants.XML_SECURITY_PROPERTY_MANAGER;
-
- /** Recognized features. */
- private static final String[] RECOGNIZED_FEATURES =
- { ALLOW_UE_AND_NOTATION_EVENTS, XINCLUDE_FIXUP_BASE_URIS, XINCLUDE_FIXUP_LANGUAGE };
-
- /** Feature defaults. */
- private static final Boolean[] FEATURE_DEFAULTS = { Boolean.TRUE, Boolean.TRUE, Boolean.TRUE };
-
- /** Recognized properties. */
- private static final String[] RECOGNIZED_PROPERTIES =
- { ERROR_REPORTER, ENTITY_RESOLVER, SECURITY_MANAGER, BUFFER_SIZE };
-
- /** Property defaults. */
- private static final Object[] PROPERTY_DEFAULTS = { null, null, null, new Integer(XMLEntityManager.DEFAULT_BUFFER_SIZE) };
-
- // instance variables
-
- // for XMLDocumentFilter
- protected XMLDocumentHandler fDocumentHandler;
- protected XMLDocumentSource fDocumentSource;
-
- // for XMLDTDFilter
- protected XMLDTDHandler fDTDHandler;
- protected XMLDTDSource fDTDSource;
-
- // for XIncludeHandler
- protected XIncludeHandler fParentXIncludeHandler;
-
- // for buffer size in XIncludeTextReader
- protected int fBufferSize = XMLEntityManager.DEFAULT_BUFFER_SIZE;
-
- // It "feels wrong" to store this value here. However,
- // calculating it can be time consuming, so we cache it.
- // It's never going to change in the lifetime of this XIncludeHandler
- protected String fParentRelativeURI;
-
- // we cache the child parser configuration, so we don't have to re-create
- // the objects when the parser is re-used
- protected XMLParserConfiguration fChildConfig;
-
- // The cached child parser configuration, may contain a
- // XInclude or XPointer Handler. Cache both these
- protected XMLParserConfiguration fXIncludeChildConfig;
- protected XMLParserConfiguration fXPointerChildConfig;
-
- // The XPointerProcessor
- protected XPointerProcessor fXPtrProcessor = null;
-
- protected XMLLocator fDocLocation;
- protected XIncludeMessageFormatter fXIncludeMessageFormatter = new XIncludeMessageFormatter();
- protected XIncludeNamespaceSupport fNamespaceContext;
- protected SymbolTable fSymbolTable;
- protected XMLErrorReporter fErrorReporter;
- protected XMLEntityResolver fEntityResolver;
- protected XMLSecurityManager fSecurityManager;
- protected XMLSecurityPropertyManager fSecurityPropertyMgr;
-
- // these are needed for text include processing
- protected XIncludeTextReader fXInclude10TextReader;
- protected XIncludeTextReader fXInclude11TextReader;
-
- // these are needed for XML Base processing
- protected XMLResourceIdentifier fCurrentBaseURI;
- protected IntStack fBaseURIScope;
- protected Stack fBaseURI;
- protected Stack fLiteralSystemID;
- protected Stack fExpandedSystemID;
-
- // these are needed for Language Fixup
- protected IntStack fLanguageScope;
- protected Stack fLanguageStack;
- protected String fCurrentLanguage;
-
- // used for passing features on to child XIncludeHandler objects
- protected ParserConfigurationSettings fSettings;
-
- // The current element depth. We start at depth 0 (before we've reached any elements).
- // The first element is at depth 1.
- private int fDepth;
-
- // The current element depth of the result infoset.
- private int fResultDepth;
-
- // this value must be at least 1
- private static final int INITIAL_SIZE = 8;
-
- // Used to ensure that fallbacks are always children of include elements,
- // and that include elements are never children of other include elements.
- // An index contains true if the ancestor of the current element which resides
- // at that depth was an include element.
- private boolean[] fSawInclude = new boolean[INITIAL_SIZE];
-
- // Ensures that only one fallback element can be at a single depth.
- // An index contains true if we have seen any fallback elements at that depth,
- // and it is only reset to false when the end tag of the parent is encountered.
- private boolean[] fSawFallback = new boolean[INITIAL_SIZE];
-
- // The state of the processor at each given depth.
- private int[] fState = new int[INITIAL_SIZE];
-
- // buffering the necessary DTD events
- private ArrayList fNotations;
- private ArrayList fUnparsedEntities;
-
- // flags which control whether base URI or language fixup is performed.
- private boolean fFixupBaseURIs = true;
- private boolean fFixupLanguage = true;
-
- // for SAX compatibility.
- // Has the value of the ALLOW_UE_AND_NOTATION_EVENTS feature
- private boolean fSendUEAndNotationEvents;
-
- // track the version of the document being parsed
- private boolean fIsXML11;
-
- // track whether a DTD is being parsed
- private boolean fInDTD;
-
- // track whether the root element of the result infoset has been processed
- private boolean fSeenRootElement;
-
- // track whether the child config needs its features refreshed
- private boolean fNeedCopyFeatures = true;
-
- // Constructors
-
- public XIncludeHandler() {
- fDepth = 0;
-
- fSawFallback[fDepth] = false;
- fSawInclude[fDepth] = false;
- fState[fDepth] = STATE_NORMAL_PROCESSING;
- fNotations = new ArrayList();
- fUnparsedEntities = new ArrayList();
-
- fBaseURIScope = new IntStack();
- fBaseURI = new Stack();
- fLiteralSystemID = new Stack();
- fExpandedSystemID = new Stack();
- fCurrentBaseURI = new XMLResourceIdentifierImpl();
-
- fLanguageScope = new IntStack();
- fLanguageStack = new Stack();
- fCurrentLanguage = null;
- }
-
- // XMLComponent methods
-
- @Override
- public void reset(XMLComponentManager componentManager)
- throws XNIException {
- fNamespaceContext = null;
- fDepth = 0;
- fResultDepth = isRootDocument() ? 0 : fParentXIncludeHandler.getResultDepth();
- fNotations.clear();
- fUnparsedEntities.clear();
- fParentRelativeURI = null;
- fIsXML11 = false;
- fInDTD = false;
- fSeenRootElement = false;
-
- fBaseURIScope.clear();
- fBaseURI.clear();
- fLiteralSystemID.clear();
- fExpandedSystemID.clear();
- fLanguageScope.clear();
- fLanguageStack.clear();
-
- // REVISIT: Find a better method for maintaining
- // the state of the XInclude processor. These arrays
- // can potentially grow quite large. Cleaning them
- // out on reset may be very time consuming. -- mrglavas
- //
- // clear the previous settings from the arrays
- for (int i = 0; i < fState.length; ++i) {
- fState[i] = STATE_NORMAL_PROCESSING;
- }
- for (int i = 0; i < fSawFallback.length; ++i) {
- fSawFallback[i] = false;
- }
- for (int i = 0; i < fSawInclude.length; ++i) {
- fSawInclude[i] = false;
- }
-
- try {
- if (!componentManager.getFeature(PARSER_SETTINGS)) {
- // if parser settings have not changed return.
- return;
- }
- }
- catch (XMLConfigurationException e) {}
-
- // parser settings changed. Need to refresh features on child config.
- fNeedCopyFeatures = true;
-
- try {
- fSendUEAndNotationEvents =
- componentManager.getFeature(ALLOW_UE_AND_NOTATION_EVENTS);
- if (fChildConfig != null) {
- fChildConfig.setFeature(
- ALLOW_UE_AND_NOTATION_EVENTS,
- fSendUEAndNotationEvents);
- }
- }
- catch (XMLConfigurationException e) {
- }
-
- try {
- fFixupBaseURIs =
- componentManager.getFeature(XINCLUDE_FIXUP_BASE_URIS);
- if (fChildConfig != null) {
- fChildConfig.setFeature(
- XINCLUDE_FIXUP_BASE_URIS,
- fFixupBaseURIs);
- }
- }
- catch (XMLConfigurationException e) {
- fFixupBaseURIs = true;
- }
-
- try {
- fFixupLanguage =
- componentManager.getFeature(XINCLUDE_FIXUP_LANGUAGE);
- if (fChildConfig != null) {
- fChildConfig.setFeature(
- XINCLUDE_FIXUP_LANGUAGE,
- fFixupLanguage);
- }
- }
- catch (XMLConfigurationException e) {
- fFixupLanguage = true;
- }
-
- // Get symbol table.
- try {
- SymbolTable value =
- (SymbolTable)componentManager.getProperty(SYMBOL_TABLE);
- if (value != null) {
- fSymbolTable = value;
- if (fChildConfig != null) {
- fChildConfig.setProperty(SYMBOL_TABLE, value);
- }
- }
- }
- catch (XMLConfigurationException e) {
- fSymbolTable = null;
- }
-
- // Get error reporter.
- try {
- XMLErrorReporter value =
- (XMLErrorReporter)componentManager.getProperty(ERROR_REPORTER);
- if (value != null) {
- setErrorReporter(value);
- if (fChildConfig != null) {
- fChildConfig.setProperty(ERROR_REPORTER, value);
- }
- }
- }
- catch (XMLConfigurationException e) {
- fErrorReporter = null;
- }
-
- // Get entity resolver.
- try {
- XMLEntityResolver value =
- (XMLEntityResolver)componentManager.getProperty(
- ENTITY_RESOLVER);
-
- if (value != null) {
- fEntityResolver = value;
- if (fChildConfig != null) {
- fChildConfig.setProperty(ENTITY_RESOLVER, value);
- }
- }
- }
- catch (XMLConfigurationException e) {
- fEntityResolver = null;
- }
-
- // Get security manager.
- try {
- XMLSecurityManager value =
- (XMLSecurityManager)componentManager.getProperty(
- SECURITY_MANAGER);
-
- if (value != null) {
- fSecurityManager = value;
- if (fChildConfig != null) {
- fChildConfig.setProperty(SECURITY_MANAGER, value);
- }
- }
- }
- catch (XMLConfigurationException e) {
- fSecurityManager = null;
- }
-
- fSecurityPropertyMgr = (XMLSecurityPropertyManager)
- componentManager.getProperty(Constants.XML_SECURITY_PROPERTY_MANAGER);
-
- // Get buffer size.
- try {
- Integer value =
- (Integer)componentManager.getProperty(
- BUFFER_SIZE);
-
- if (value != null && value.intValue() > 0) {
- fBufferSize = value.intValue();
- if (fChildConfig != null) {
- fChildConfig.setProperty(BUFFER_SIZE, value);
- }
- }
- else {
- fBufferSize = ((Integer)getPropertyDefault(BUFFER_SIZE)).intValue();
- }
- }
- catch (XMLConfigurationException e) {
- fBufferSize = ((Integer)getPropertyDefault(BUFFER_SIZE)).intValue();
- }
-
- // Reset XML 1.0 text reader.
- if (fXInclude10TextReader != null) {
- fXInclude10TextReader.setBufferSize(fBufferSize);
- }
- // Reset XML 1.1 text reader.
- if (fXInclude11TextReader != null) {
- fXInclude11TextReader.setBufferSize(fBufferSize);
- }
-
- fSettings = new ParserConfigurationSettings();
- copyFeatures(componentManager, fSettings);
-
- // We don't want a schema validator on the new pipeline,
- // so if it was enabled, we set the feature to false. If
- // the validation feature was also enabled we turn on
- // dynamic validation, so that DTD validation is performed
- // on the included documents only if they have a DOCTYPE.
- // This is consistent with the behaviour on the main pipeline.
- try {
- if (componentManager.getFeature(SCHEMA_VALIDATION)) {
- fSettings.setFeature(SCHEMA_VALIDATION, false);
- if (componentManager.getFeature(VALIDATION)) {
- fSettings.setFeature(DYNAMIC_VALIDATION, true);
- }
- }
- }
- catch (XMLConfigurationException e) {}
-
- // Don't reset fChildConfig -- we don't want it to share the same components.
- // It will be reset when it is actually used to parse something.
- } // reset(XMLComponentManager)
-
- /**
- * Returns a list of feature identifiers that are recognized by
- * this component. This method may return null if no features
- * are recognized by this component.
- */
- @Override
- public String[] getRecognizedFeatures() {
- return (String[])(RECOGNIZED_FEATURES.clone());
- } // getRecognizedFeatures():String[]
-
- /**
- * Sets the state of a feature. This method is called by the component
- * manager any time after reset when a feature changes state.
- * <p>
- * <strong>Note:</strong> Components should silently ignore features
- * that do not affect the operation of the component.
- *
- * @param featureId The feature identifier.
- * @param state The state of the feature.
- *
- * @throws SAXNotRecognizedException The component should not throw
- * this exception.
- * @throws SAXNotSupportedException The component should not throw
- * this exception.
- */
- @Override
- public void setFeature(String featureId, boolean state)
- throws XMLConfigurationException {
- if (featureId.equals(ALLOW_UE_AND_NOTATION_EVENTS)) {
- fSendUEAndNotationEvents = state;
- }
- if (fSettings != null) {
- fNeedCopyFeatures = true;
- fSettings.setFeature(featureId, state);
- }
- } // setFeature(String,boolean)
-
- /**
- * Returns a list of property identifiers that are recognized by
- * this component. This method may return null if no properties
- * are recognized by this component.
- */
- @Override
- public String[] getRecognizedProperties() {
- return (String[])(RECOGNIZED_PROPERTIES.clone());
- } // getRecognizedProperties():String[]
-
- /**
- * Sets the value of a property. This method is called by the component
- * manager any time after reset when a property changes value.
- * <p>
- * <strong>Note:</strong> Components should silently ignore properties
- * that do not affect the operation of the component.
- *
- * @param propertyId The property identifier.
- * @param value The value of the property.
- *
- * @throws SAXNotRecognizedException The component should not throw
- * this exception.
- * @throws SAXNotSupportedException The component should not throw
- * this exception.
- */
- @Override
- public void setProperty(String propertyId, Object value)
- throws XMLConfigurationException {
- if (propertyId.equals(SYMBOL_TABLE)) {
- fSymbolTable = (SymbolTable)value;
- if (fChildConfig != null) {
- fChildConfig.setProperty(propertyId, value);
- }
- return;
- }
- if (propertyId.equals(ERROR_REPORTER)) {
- setErrorReporter((XMLErrorReporter)value);
- if (fChildConfig != null) {
- fChildConfig.setProperty(propertyId, value);
- }
- return;
- }
- if (propertyId.equals(ENTITY_RESOLVER)) {
- fEntityResolver = (XMLEntityResolver)value;
- if (fChildConfig != null) {
- fChildConfig.setProperty(propertyId, value);
- }
- return;
- }
- if (propertyId.equals(SECURITY_MANAGER)) {
- fSecurityManager = (XMLSecurityManager)value;
- if (fChildConfig != null) {
- fChildConfig.setProperty(propertyId, value);
- }
- return;
- }
- if (propertyId.equals(XML_SECURITY_PROPERTY_MANAGER)) {
- fSecurityPropertyMgr = (XMLSecurityPropertyManager)value;
-
- if (fChildConfig != null) {
- fChildConfig.setProperty(XML_SECURITY_PROPERTY_MANAGER, value);
- }
-
- return;
- }
-
- if (propertyId.equals(BUFFER_SIZE)) {
- Integer bufferSize = (Integer) value;
- if (fChildConfig != null) {
- fChildConfig.setProperty(propertyId, value);
- }
- if (bufferSize != null && bufferSize.intValue() > 0) {
- fBufferSize = bufferSize.intValue();
- // Reset XML 1.0 text reader.
- if (fXInclude10TextReader != null) {
- fXInclude10TextReader.setBufferSize(fBufferSize);
- }
- // Reset XML 1.1 text reader.
- if (fXInclude11TextReader != null) {
- fXInclude11TextReader.setBufferSize(fBufferSize);
- }
- }
- return;
- }
-
- } // setProperty(String,Object)
-
- /**
- * Returns the default state for a feature, or null if this
- * component does not want to report a default value for this
- * feature.
- *
- * @param featureId The feature identifier.
- *
- * @since Xerces 2.2.0
- */
- @Override
- public Boolean getFeatureDefault(String featureId) {
- for (int i = 0; i < RECOGNIZED_FEATURES.length; i++) {
- if (RECOGNIZED_FEATURES[i].equals(featureId)) {
- return FEATURE_DEFAULTS[i];
- }
- }
- return null;
- } // getFeatureDefault(String):Boolean
-
- /**
- * Returns the default state for a property, or null if this
- * component does not want to report a default value for this
- * property.
- *
- * @param propertyId The property identifier.
- *
- * @since Xerces 2.2.0
- */
- @Override
- public Object getPropertyDefault(String propertyId) {
- for (int i = 0; i < RECOGNIZED_PROPERTIES.length; i++) {
- if (RECOGNIZED_PROPERTIES[i].equals(propertyId)) {
- return PROPERTY_DEFAULTS[i];
- }
- }
- return null;
- } // getPropertyDefault(String):Object
-
- @Override
- public void setDocumentHandler(XMLDocumentHandler handler) {
- fDocumentHandler = handler;
- }
-
- @Override
- public XMLDocumentHandler getDocumentHandler() {
- return fDocumentHandler;
- }
-
- // XMLDocumentHandler methods
-
- /**
- * Event sent at the start of the document.
- *
- * A fatal error will occur here, if it is detected that this document has been processed
- * before.
- *
- * This event is only passed on to the document handler if this is the root document.
- */
- @Override
- public void startDocument(
- XMLLocator locator,
- String encoding,
- NamespaceContext namespaceContext,
- Augmentations augs)
- throws XNIException {
-
- // we do this to ensure that the proper location is reported in errors
- // otherwise, the locator from the root document would always be used
- fErrorReporter.setDocumentLocator(locator);
-
- if (!isRootDocument()
- && fParentXIncludeHandler.searchForRecursiveIncludes(locator)) {
- reportFatalError(
- "RecursiveInclude",
- new Object[] { locator.getExpandedSystemId()});
- }
-
- if (!(namespaceContext instanceof XIncludeNamespaceSupport)) {
- reportFatalError("IncompatibleNamespaceContext");
- }
- fNamespaceContext = (XIncludeNamespaceSupport)namespaceContext;
- fDocLocation = locator;
-
- // initialize the current base URI
- fCurrentBaseURI.setBaseSystemId(locator.getBaseSystemId());
- fCurrentBaseURI.setExpandedSystemId(locator.getExpandedSystemId());
- fCurrentBaseURI.setLiteralSystemId(locator.getLiteralSystemId());
- saveBaseURI();
- if (augs == null) {
- augs = new AugmentationsImpl();
- }
- augs.putItem(CURRENT_BASE_URI, fCurrentBaseURI);
-
- // initialize the current language
- fCurrentLanguage = XMLSymbols.EMPTY_STRING;
- saveLanguage(fCurrentLanguage);
-
- if (isRootDocument() && fDocumentHandler != null) {
- fDocumentHandler.startDocument(
- locator,
- encoding,
- namespaceContext,
- augs);
- }
- }
-
- @Override
- public void xmlDecl(
- String version,
- String encoding,
- String standalone,
- Augmentations augs)
- throws XNIException {
- fIsXML11 = "1.1".equals(version);
- if (isRootDocument() && fDocumentHandler != null) {
- fDocumentHandler.xmlDecl(version, encoding, standalone, augs);
- }
- }
-
- @Override
- public void doctypeDecl(
- String rootElement,
- String publicId,
- String systemId,
- Augmentations augs)
- throws XNIException {
- if (isRootDocument() && fDocumentHandler != null) {
- fDocumentHandler.doctypeDecl(rootElement, publicId, systemId, augs);
- }
- }
-
- @Override
- public void comment(XMLString text, Augmentations augs)
- throws XNIException {
- if (!fInDTD) {
- if (fDocumentHandler != null
- && getState() == STATE_NORMAL_PROCESSING) {
- fDepth++;
- augs = modifyAugmentations(augs);
- fDocumentHandler.comment(text, augs);
- fDepth--;
- }
- }
- else if (fDTDHandler != null) {
- fDTDHandler.comment(text, augs);
- }
- }
-
- @Override
- public void processingInstruction(
- String target,
- XMLString data,
- Augmentations augs)
- throws XNIException {
- if (!fInDTD) {
- if (fDocumentHandler != null
- && getState() == STATE_NORMAL_PROCESSING) {
- // we need to change the depth like this so that modifyAugmentations() works
- fDepth++;
- augs = modifyAugmentations(augs);
- fDocumentHandler.processingInstruction(target, data, augs);
- fDepth--;
- }
- }
- else if (fDTDHandler != null) {
- fDTDHandler.processingInstruction(target, data, augs);
- }
- }
-
- @Override
- public void startElement(
- QName element,
- XMLAttributes attributes,
- Augmentations augs)
- throws XNIException {
- fDepth++;
- int lastState = getState(fDepth - 1);
- // If the last two states were fallback then this must be a descendant of an include
- // child which isn't a fallback. The specification says we should ignore such elements
- // and their children.
- if (lastState == STATE_EXPECT_FALLBACK && getState(fDepth - 2) == STATE_EXPECT_FALLBACK) {
- setState(STATE_IGNORE);
- }
- else {
- setState(lastState);
- }
-
- // we process the xml:base and xml:lang attributes regardless
- // of what type of element it is.
- processXMLBaseAttributes(attributes);
- if (fFixupLanguage) {
- processXMLLangAttributes(attributes);
- }
-
- if (isIncludeElement(element)) {
- boolean success = this.handleIncludeElement(attributes);
- if (success) {
- setState(STATE_IGNORE);
- }
- else {
- setState(STATE_EXPECT_FALLBACK);
- }
- }
- else if (isFallbackElement(element)) {
- this.handleFallbackElement();
- }
- else if (hasXIncludeNamespace(element)) {
- if (getSawInclude(fDepth - 1)) {
- reportFatalError(
- "IncludeChild",
- new Object[] { element.rawname });
- }
- if (getSawFallback(fDepth - 1)) {
- reportFatalError(
- "FallbackChild",
- new Object[] { element.rawname });
- }
- if (getState() == STATE_NORMAL_PROCESSING) {
- if (fResultDepth++ == 0) {
- checkMultipleRootElements();
- }
- if (fDocumentHandler != null) {
- augs = modifyAugmentations(augs);
- attributes = processAttributes(attributes);
- fDocumentHandler.startElement(element, attributes, augs);
- }
- }
- }
- else if (getState() == STATE_NORMAL_PROCESSING) {
- if (fResultDepth++ == 0) {
- checkMultipleRootElements();
- }
- if (fDocumentHandler != null) {
- augs = modifyAugmentations(augs);
- attributes = processAttributes(attributes);
- fDocumentHandler.startElement(element, attributes, augs);
- }
- }
- }
-
- @Override
- public void emptyElement(
- QName element,
- XMLAttributes attributes,
- Augmentations augs)
- throws XNIException {
- fDepth++;
- int lastState = getState(fDepth - 1);
- // If the last two states were fallback then this must be a descendant of an include
- // child which isn't a fallback. The specification says we should ignore such elements
- // and their children.
- if (lastState == STATE_EXPECT_FALLBACK && getState(fDepth - 2) == STATE_EXPECT_FALLBACK) {
- setState(STATE_IGNORE);
- }
- else {
- setState(lastState);
- }
-
- // we process the xml:base and xml:lang attributes regardless
- // of what type of element it is.
- processXMLBaseAttributes(attributes);
- if (fFixupLanguage) {
- processXMLLangAttributes(attributes);
- }
-
- if (isIncludeElement(element)) {
- boolean success = this.handleIncludeElement(attributes);
- if (success) {
- setState(STATE_IGNORE);
- }
- else {
- reportFatalError("NoFallback",
- new Object[] { attributes.getValue(null, "href") });
- }
- }
- else if (isFallbackElement(element)) {
- this.handleFallbackElement();
- }
- else if (hasXIncludeNamespace(element)) {
- if (getSawInclude(fDepth - 1)) {
- reportFatalError(
- "IncludeChild",
- new Object[] { element.rawname });
- }
- if (getSawFallback(fDepth - 1)) {
- reportFatalError(
- "FallbackChild",
- new Object[] { element.rawname });
- }
- if (getState() == STATE_NORMAL_PROCESSING) {
- if (fResultDepth == 0) {
- checkMultipleRootElements();
- }
- if (fDocumentHandler != null) {
- augs = modifyAugmentations(augs);
- attributes = processAttributes(attributes);
- fDocumentHandler.emptyElement(element, attributes, augs);
- }
- }
- }
- else if (getState() == STATE_NORMAL_PROCESSING) {
- if (fResultDepth == 0) {
- checkMultipleRootElements();
- }
- if (fDocumentHandler != null) {
- augs = modifyAugmentations(augs);
- attributes = processAttributes(attributes);
- fDocumentHandler.emptyElement(element, attributes, augs);
- }
- }
- // reset the out of scope stack elements
- setSawFallback(fDepth + 1, false);
- setSawInclude(fDepth, false);
-
- // check if an xml:base has gone out of scope
- if (fBaseURIScope.size() > 0 && fDepth == fBaseURIScope.peek()) {
- // pop the values from the stack
- restoreBaseURI();
- }
- fDepth--;
- }
-
- @Override
- public void endElement(QName element, Augmentations augs)
- throws XNIException {
-
- if (isIncludeElement(element)) {
- // if we're ending an include element, and we were expecting a fallback
- // we check to see if the children of this include element contained a fallback
- if (getState() == STATE_EXPECT_FALLBACK
- && !getSawFallback(fDepth + 1)) {
- reportFatalError("NoFallback",
- new Object[] { "unknown" });
- }
- }
- if (isFallbackElement(element)) {
- // the state would have been set to normal processing if we were expecting the fallback element
- // now that we're done processing it, we should ignore all the other children of the include element
- if (getState() == STATE_NORMAL_PROCESSING) {
- setState(STATE_IGNORE);
- }
- }
- else if (getState() == STATE_NORMAL_PROCESSING) {
- --fResultDepth;
- if (fDocumentHandler != null) {
- fDocumentHandler.endElement(element, augs);
- }
- }
-
- // reset the out of scope stack elements
- setSawFallback(fDepth + 1, false);
- setSawInclude(fDepth, false);
-
- // check if an xml:base has gone out of scope
- if (fBaseURIScope.size() > 0 && fDepth == fBaseURIScope.peek()) {
- // pop the values from the stack
- restoreBaseURI();
- }
-
- // check if an xml:lang has gone out of scope
- if (fLanguageScope.size() > 0 && fDepth == fLanguageScope.peek()) {
- // pop the language from the stack
- fCurrentLanguage = restoreLanguage();
- }
-
- fDepth--;
- }
-
- @Override
- public void startGeneralEntity(
- String name,
- XMLResourceIdentifier resId,
- String encoding,
- Augmentations augs)
- throws XNIException {
- if (getState() == STATE_NORMAL_PROCESSING) {
- if (fResultDepth == 0) {
- if (augs != null && Boolean.TRUE.equals(augs.getItem(Constants.ENTITY_SKIPPED))) {
- reportFatalError("UnexpandedEntityReferenceIllegal");
- }
- }
- else if (fDocumentHandler != null) {
- fDocumentHandler.startGeneralEntity(name, resId, encoding, augs);
- }
- }
- }
-
- @Override
- public void textDecl(String version, String encoding, Augmentations augs)
- throws XNIException {
- if (fDocumentHandler != null
- && getState() == STATE_NORMAL_PROCESSING) {
- fDocumentHandler.textDecl(version, encoding, augs);
- }
- }
-
- @Override
- public void endGeneralEntity(String name, Augmentations augs)
- throws XNIException {
- if (fDocumentHandler != null
- && getState() == STATE_NORMAL_PROCESSING
- && fResultDepth != 0) {
- fDocumentHandler.endGeneralEntity(name, augs);
- }
- }
-
- @Override
- public void characters(XMLString text, Augmentations augs)
- throws XNIException {
- if (getState() == STATE_NORMAL_PROCESSING) {
- if (fResultDepth == 0) {
- checkWhitespace(text);
- }
- else if (fDocumentHandler != null) {
- // we need to change the depth like this so that modifyAugmentations() works
- fDepth++;
- augs = modifyAugmentations(augs);
- fDocumentHandler.characters(text, augs);
- fDepth--;
- }
- }
- }
-
- @Override
- public void ignorableWhitespace(XMLString text, Augmentations augs)
- throws XNIException {
- if (fDocumentHandler != null
- && getState() == STATE_NORMAL_PROCESSING
- && fResultDepth != 0) {
- fDocumentHandler.ignorableWhitespace(text, augs);
- }
- }
-
- @Override
- public void startCDATA(Augmentations augs) throws XNIException {
- if (fDocumentHandler != null
- && getState() == STATE_NORMAL_PROCESSING
- && fResultDepth != 0) {
- fDocumentHandler.startCDATA(augs);
- }
- }
-
- @Override
- public void endCDATA(Augmentations augs) throws XNIException {
- if (fDocumentHandler != null
- && getState() == STATE_NORMAL_PROCESSING
- && fResultDepth != 0) {
- fDocumentHandler.endCDATA(augs);
- }
- }
-
- @Override
- public void endDocument(Augmentations augs) throws XNIException {
- if (isRootDocument()) {
- if (!fSeenRootElement) {
- reportFatalError("RootElementRequired");
- }
- if (fDocumentHandler != null) {
- fDocumentHandler.endDocument(augs);
- }
- }
- }
-
- @Override
- public void setDocumentSource(XMLDocumentSource source) {
- fDocumentSource = source;
- }
-
- @Override
- public XMLDocumentSource getDocumentSource() {
- return fDocumentSource;
- }
-
- // DTDHandler methods
- // We are only interested in the notation and unparsed entity declarations,
- // the rest we just pass on
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xni.XMLDTDHandler#attributeDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String[], java.lang.String, com.sun.org.apache.xerces.internal.xni.XMLString, com.sun.org.apache.xerces.internal.xni.XMLString, com.sun.org.apache.xerces.internal.xni.Augmentations)
- */
- @Override
- public void attributeDecl(
- String elementName,
- String attributeName,
- String type,
- String[] enumeration,
- String defaultType,
- XMLString defaultValue,
- XMLString nonNormalizedDefaultValue,
- Augmentations augmentations)
- throws XNIException {
- if (fDTDHandler != null) {
- fDTDHandler.attributeDecl(
- elementName,
- attributeName,
- type,
- enumeration,
- defaultType,
- defaultValue,
- nonNormalizedDefaultValue,
- augmentations);
- }
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xni.XMLDTDHandler#elementDecl(java.lang.String, java.lang.String, com.sun.org.apache.xerces.internal.xni.Augmentations)
- */
- @Override
- public void elementDecl(
- String name,
- String contentModel,
- Augmentations augmentations)
- throws XNIException {
- if (fDTDHandler != null) {
- fDTDHandler.elementDecl(name, contentModel, augmentations);
- }
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xni.XMLDTDHandler#endAttlist(com.sun.org.apache.xerces.internal.xni.Augmentations)
- */
- @Override
- public void endAttlist(Augmentations augmentations) throws XNIException {
- if (fDTDHandler != null) {
- fDTDHandler.endAttlist(augmentations);
- }
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xni.XMLDTDHandler#endConditional(com.sun.org.apache.xerces.internal.xni.Augmentations)
- */
- @Override
- public void endConditional(Augmentations augmentations)
- throws XNIException {
- if (fDTDHandler != null) {
- fDTDHandler.endConditional(augmentations);
- }
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xni.XMLDTDHandler#endDTD(com.sun.org.apache.xerces.internal.xni.Augmentations)
- */
- @Override
- public void endDTD(Augmentations augmentations) throws XNIException {
- if (fDTDHandler != null) {
- fDTDHandler.endDTD(augmentations);
- }
- fInDTD = false;
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xni.XMLDTDHandler#endExternalSubset(com.sun.org.apache.xerces.internal.xni.Augmentations)
- */
- @Override
- public void endExternalSubset(Augmentations augmentations)
- throws XNIException {
- if (fDTDHandler != null) {
- fDTDHandler.endExternalSubset(augmentations);
- }
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xni.XMLDTDHandler#endParameterEntity(java.lang.String, com.sun.org.apache.xerces.internal.xni.Augmentations)
- */
- @Override
- public void endParameterEntity(String name, Augmentations augmentations)
- throws XNIException {
- if (fDTDHandler != null) {
- fDTDHandler.endParameterEntity(name, augmentations);
- }
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xni.XMLDTDHandler#externalEntityDecl(java.lang.String, com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier, com.sun.org.apache.xerces.internal.xni.Augmentations)
- */
- @Override
- public void externalEntityDecl(
- String name,
- XMLResourceIdentifier identifier,
- Augmentations augmentations)
- throws XNIException {
- if (fDTDHandler != null) {
- fDTDHandler.externalEntityDecl(name, identifier, augmentations);
- }
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xni.XMLDTDHandler#getDTDSource()
- */
- @Override
- public XMLDTDSource getDTDSource() {
- return fDTDSource;
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xni.XMLDTDHandler#ignoredCharacters(com.sun.org.apache.xerces.internal.xni.XMLString, com.sun.org.apache.xerces.internal.xni.Augmentations)
- */
- @Override
- public void ignoredCharacters(XMLString text, Augmentations augmentations)
- throws XNIException {
- if (fDTDHandler != null) {
- fDTDHandler.ignoredCharacters(text, augmentations);
- }
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xni.XMLDTDHandler#internalEntityDecl(java.lang.String, com.sun.org.apache.xerces.internal.xni.XMLString, com.sun.org.apache.xerces.internal.xni.XMLString, com.sun.org.apache.xerces.internal.xni.Augmentations)
- */
- @Override
- public void internalEntityDecl(
- String name,
- XMLString text,
- XMLString nonNormalizedText,
- Augmentations augmentations)
- throws XNIException {
- if (fDTDHandler != null) {
- fDTDHandler.internalEntityDecl(
- name,
- text,
- nonNormalizedText,
- augmentations);
- }
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xni.XMLDTDHandler#notationDecl(java.lang.String, com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier, com.sun.org.apache.xerces.internal.xni.Augmentations)
- */
- @Override
- public void notationDecl(
- String name,
- XMLResourceIdentifier identifier,
- Augmentations augmentations)
- throws XNIException {
- this.addNotation(name, identifier, augmentations);
- if (fDTDHandler != null) {
- fDTDHandler.notationDecl(name, identifier, augmentations);
- }
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xni.XMLDTDHandler#setDTDSource(com.sun.org.apache.xerces.internal.xni.parser.XMLDTDSource)
- */
- @Override
- public void setDTDSource(XMLDTDSource source) {
- fDTDSource = source;
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xni.XMLDTDHandler#startAttlist(java.lang.String, com.sun.org.apache.xerces.internal.xni.Augmentations)
- */
- @Override
- public void startAttlist(String elementName, Augmentations augmentations)
- throws XNIException {
- if (fDTDHandler != null) {
- fDTDHandler.startAttlist(elementName, augmentations);
- }
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xni.XMLDTDHandler#startConditional(short, com.sun.org.apache.xerces.internal.xni.Augmentations)
- */
- @Override
- public void startConditional(short type, Augmentations augmentations)
- throws XNIException {
- if (fDTDHandler != null) {
- fDTDHandler.startConditional(type, augmentations);
- }
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xni.XMLDTDHandler#startDTD(com.sun.org.apache.xerces.internal.xni.XMLLocator, com.sun.org.apache.xerces.internal.xni.Augmentations)
- */
- @Override
- public void startDTD(XMLLocator locator, Augmentations augmentations)
- throws XNIException {
- fInDTD = true;
- if (fDTDHandler != null) {
- fDTDHandler.startDTD(locator, augmentations);
- }
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xni.XMLDTDHandler#startExternalSubset(com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier, com.sun.org.apache.xerces.internal.xni.Augmentations)
- */
- @Override
- public void startExternalSubset(
- XMLResourceIdentifier identifier,
- Augmentations augmentations)
- throws XNIException {
- if (fDTDHandler != null) {
- fDTDHandler.startExternalSubset(identifier, augmentations);
- }
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xni.XMLDTDHandler#startParameterEntity(java.lang.String, com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier, java.lang.String, com.sun.org.apache.xerces.internal.xni.Augmentations)
- */
- @Override
- public void startParameterEntity(
- String name,
- XMLResourceIdentifier identifier,
- String encoding,
- Augmentations augmentations)
- throws XNIException {
- if (fDTDHandler != null) {
- fDTDHandler.startParameterEntity(
- name,
- identifier,
- encoding,
- augmentations);
- }
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xni.XMLDTDHandler#unparsedEntityDecl(java.lang.String, com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier, java.lang.String, com.sun.org.apache.xerces.internal.xni.Augmentations)
- */
- @Override
- public void unparsedEntityDecl(
- String name,
- XMLResourceIdentifier identifier,
- String notation,
- Augmentations augmentations)
- throws XNIException {
- this.addUnparsedEntity(name, identifier, notation, augmentations);
- if (fDTDHandler != null) {
- fDTDHandler.unparsedEntityDecl(
- name,
- identifier,
- notation,
- augmentations);
- }
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xni.parser.XMLDTDSource#getDTDHandler()
- */
- @Override
- public XMLDTDHandler getDTDHandler() {
- return fDTDHandler;
- }
-
- /* (non-Javadoc)
- * @see com.sun.org.apache.xerces.internal.xni.parser.XMLDTDSource#setDTDHandler(com.sun.org.apache.xerces.internal.xni.XMLDTDHandler)
- */
- @Override
- public void setDTDHandler(XMLDTDHandler handler) {
- fDTDHandler = handler;
- }
-
- // XIncludeHandler methods
-
- private void setErrorReporter(XMLErrorReporter reporter) {
- fErrorReporter = reporter;
- if (fErrorReporter != null) {
- fErrorReporter.putMessageFormatter(
- XIncludeMessageFormatter.XINCLUDE_DOMAIN, fXIncludeMessageFormatter);
- // this ensures the proper location is displayed in error messages
- if (fDocLocation != null) {
- fErrorReporter.setDocumentLocator(fDocLocation);
- }
- }
- }
-
- protected void handleFallbackElement() {
- if (!getSawInclude(fDepth - 1)) {
- if (getState() == STATE_IGNORE) {
- return;
- }
- reportFatalError("FallbackParent");
- }
-
- setSawInclude(fDepth, false);
- fNamespaceContext.setContextInvalid();
-
- if (getSawFallback(fDepth)) {
- reportFatalError("MultipleFallbacks");
- }
- else {
- setSawFallback(fDepth, true);
- }
-
- // Either the state is STATE_EXPECT_FALLBACK or it's STATE_IGNORE.
- // If we're ignoring, we want to stay ignoring. But if we're expecting this fallback element,
- // we want to signal that we should process the children.
- if (getState() == STATE_EXPECT_FALLBACK) {
- setState(STATE_NORMAL_PROCESSING);
- }
- }
-
- protected boolean handleIncludeElement(XMLAttributes attributes)
- throws XNIException {
- if (getSawInclude(fDepth - 1)) {
- reportFatalError("IncludeChild", new Object[] { XINCLUDE_INCLUDE });
- }
- if (getState() == STATE_IGNORE) {
- return true;
- }
- setSawInclude(fDepth, true);
- fNamespaceContext.setContextInvalid();
-
- // TODO: does Java use IURIs by default?
- // [Definition: An internationalized URI reference, or IURI, is a URI reference that directly uses [Unicode] characters.]
- // TODO: figure out what section 4.1.1 of the XInclude spec is talking about
- // has to do with disallowed ASCII character escaping
- // this ties in with the above IURI section, but I suspect Java already does it
-
- String href = attributes.getValue(XINCLUDE_ATTR_HREF);
- String parse = attributes.getValue(XINCLUDE_ATTR_PARSE);
- String xpointer = attributes.getValue(XPOINTER);
- String accept = attributes.getValue(XINCLUDE_ATTR_ACCEPT);
- String acceptLanguage = attributes.getValue(XINCLUDE_ATTR_ACCEPT_LANGUAGE);
-
- if (parse == null) {
- parse = XINCLUDE_PARSE_XML;
- }
- if (href == null) {
- href = XMLSymbols.EMPTY_STRING;
- }
- if (href.length() == 0 && XINCLUDE_PARSE_XML.equals(parse)) {
- if (xpointer == null) {
- reportFatalError("XpointerMissing");
- }
- else {
- // When parse="xml" and an xpointer is specified treat
- // all absences of the href attribute as a resource error.
- Locale locale = (fErrorReporter != null) ? fErrorReporter.getLocale() : null;
- String reason = fXIncludeMessageFormatter.formatMessage(locale, "XPointerStreamability", null);
- reportResourceError("XMLResourceError", new Object[] { href, reason });
- return false;
- }
- }
-
- URI hrefURI = null;
-
- // Check whether href is correct and perform escaping as per section 4.1.1 of the XInclude spec.
- // Report fatal error if the href value contains a fragment identifier or if the value after
- // escaping is a syntactically invalid URI or IRI.
- try {
- hrefURI = new URI(href, true);
- if (hrefURI.getFragment() != null) {
- reportFatalError("HrefFragmentIdentifierIllegal", new Object[] {href});
- }
- }
- catch (URI.MalformedURIException exc) {
- String newHref = escapeHref(href);
- if (href != newHref) {
- href = newHref;
- try {
- hrefURI = new URI(href, true);
- if (hrefURI.getFragment() != null) {
- reportFatalError("HrefFragmentIdentifierIllegal", new Object[] {href});
- }
- }
- catch (URI.MalformedURIException exc2) {
- reportFatalError("HrefSyntacticallyInvalid", new Object[] {href});
- }
- }
- else {
- reportFatalError("HrefSyntacticallyInvalid", new Object[] {href});
- }
- }
-
- // Verify that if an accept and/or an accept-language attribute exist
- // that the value(s) don't contain disallowed characters.
- if (accept != null && !isValidInHTTPHeader(accept)) {
- reportFatalError("AcceptMalformed", null);
- accept = null;
- }
- if (acceptLanguage != null && !isValidInHTTPHeader(acceptLanguage)) {
- reportFatalError("AcceptLanguageMalformed", null);
- acceptLanguage = null;
- }
-
- XMLInputSource includedSource = null;
- if (fEntityResolver != null) {
- try {
- XMLResourceIdentifier resourceIdentifier =
- new XMLResourceIdentifierImpl(
- null,
- href,
- fCurrentBaseURI.getExpandedSystemId(),
- XMLEntityManager.expandSystemId(
- href,
- fCurrentBaseURI.getExpandedSystemId(),
- false));
-
- includedSource =
- fEntityResolver.resolveEntity(resourceIdentifier);
-
- if (includedSource != null &&
- !(includedSource instanceof HTTPInputSource) &&
- (accept != null || acceptLanguage != null) &&
- includedSource.getCharacterStream() == null &&
- includedSource.getByteStream() == null) {
-
- includedSource = createInputSource(includedSource.getPublicId(), includedSource.getSystemId(),
- includedSource.getBaseSystemId(), accept, acceptLanguage);
- }
- }
- catch (IOException e) {
- reportResourceError(
- "XMLResourceError",
- new Object[] { href, e.getMessage()});
- return false;
- }
- }
-
- if (includedSource == null) {
- // setup an HTTPInputSource if either of the content negotation attributes were specified.
- if (accept != null || acceptLanguage != null) {
- includedSource = createInputSource(null, href, fCurrentBaseURI.getExpandedSystemId(), accept, acceptLanguage);
- }
- else {
- includedSource = new XMLInputSource(null, href, fCurrentBaseURI.getExpandedSystemId());
- }
- }
-
- if (parse.equals(XINCLUDE_PARSE_XML)) {
- // Instead of always creating a new configuration, the first one can be reused
- if ((xpointer != null && fXPointerChildConfig == null)
- || (xpointer == null && fXIncludeChildConfig == null) ) {
-
- String parserName = XINCLUDE_DEFAULT_CONFIGURATION;
- if (xpointer != null)
- parserName = "com.sun.org.apache.xerces.internal.parsers.XPointerParserConfiguration";
-
- fChildConfig =
- (XMLParserConfiguration)ObjectFactory.newInstance(
- parserName,
- true);
-
- // use the same symbol table, error reporter, entity resolver, security manager and buffer size.
- if (fSymbolTable != null) fChildConfig.setProperty(SYMBOL_TABLE, fSymbolTable);
- if (fErrorReporter != null) fChildConfig.setProperty(ERROR_REPORTER, fErrorReporter);
- if (fEntityResolver != null) fChildConfig.setProperty(ENTITY_RESOLVER, fEntityResolver);
- fChildConfig.setProperty(SECURITY_MANAGER, fSecurityManager);
- fChildConfig.setProperty(XML_SECURITY_PROPERTY_MANAGER, fSecurityPropertyMgr);
- fChildConfig.setProperty(BUFFER_SIZE, new Integer(fBufferSize));
-
- // features must be copied to child configuration
- fNeedCopyFeatures = true;
-
- // use the same namespace context
- fChildConfig.setProperty(
- Constants.XERCES_PROPERTY_PREFIX
- + Constants.NAMESPACE_CONTEXT_PROPERTY,
- fNamespaceContext);
-
- fChildConfig.setFeature(
- XINCLUDE_FIXUP_BASE_URIS,
- fFixupBaseURIs);
-
- fChildConfig.setFeature(
- XINCLUDE_FIXUP_LANGUAGE,
- fFixupLanguage);
-
-
- // If the xpointer attribute is present
- if (xpointer != null ) {
-
- XPointerHandler newHandler =
- (XPointerHandler)fChildConfig.getProperty(
- Constants.XERCES_PROPERTY_PREFIX
- + Constants.XPOINTER_HANDLER_PROPERTY);
-
- fXPtrProcessor = newHandler;
-
- // ???
- ((XPointerHandler)fXPtrProcessor).setProperty(
- Constants.XERCES_PROPERTY_PREFIX
- + Constants.NAMESPACE_CONTEXT_PROPERTY,
- fNamespaceContext);
-
- ((XPointerHandler)fXPtrProcessor).setProperty(XINCLUDE_FIXUP_BASE_URIS,
- fFixupBaseURIs);
-
- ((XPointerHandler)fXPtrProcessor).setProperty(
- XINCLUDE_FIXUP_LANGUAGE, fFixupLanguage);
-
- if (fErrorReporter != null)
- ((XPointerHandler)fXPtrProcessor).setProperty(ERROR_REPORTER, fErrorReporter);
- // ???
-
- newHandler.setParent(this);
- newHandler.setDocumentHandler(this.getDocumentHandler());
- fXPointerChildConfig = fChildConfig;
- } else {
- XIncludeHandler newHandler =
- (XIncludeHandler)fChildConfig.getProperty(
- Constants.XERCES_PROPERTY_PREFIX
- + Constants.XINCLUDE_HANDLER_PROPERTY);
-
- newHandler.setParent(this);
- newHandler.setDocumentHandler(this.getDocumentHandler());
- fXIncludeChildConfig = fChildConfig;
- }
- }
-
- // If an xpointer attribute is present
- if (xpointer != null ) {
- fChildConfig = fXPointerChildConfig ;
-
- // Parse the XPointer expression
- try {
- ((XPointerProcessor)fXPtrProcessor).parseXPointer(xpointer);
-
- } catch (XNIException ex) {
- // report the XPointer error as a resource error
- reportResourceError(
- "XMLResourceError",
- new Object[] { href, ex.getMessage()});
- return false;
- }
- } else {
- fChildConfig = fXIncludeChildConfig;
- }
-
- // set all features on parserConfig to match this parser configuration
- if (fNeedCopyFeatures) {
- copyFeatures(fSettings, fChildConfig);
- }
- fNeedCopyFeatures = false;
-
- try {
- fNamespaceContext.pushScope();
-
- fChildConfig.parse(includedSource);
- // necessary to make sure proper location is reported in errors
- if (fErrorReporter != null) {
- fErrorReporter.setDocumentLocator(fDocLocation);
- }
-
- // If the xpointer attribute is present
- if (xpointer != null ) {
- // and it was not resolved
- if (!((XPointerProcessor)fXPtrProcessor).isXPointerResolved()) {
- Locale locale = (fErrorReporter != null) ? fErrorReporter.getLocale() : null;
- String reason = fXIncludeMessageFormatter.formatMessage(locale, "XPointerResolutionUnsuccessful", null);
- reportResourceError("XMLResourceError", new Object[] {href, reason});
- // use the fallback
- return false;
- }
- }
- }
- catch (XNIException e) {
- // necessary to make sure proper location is reported in errors
- if (fErrorReporter != null) {
- fErrorReporter.setDocumentLocator(fDocLocation);
- }
- reportFatalError("XMLParseError", new Object[] { href, e.getMessage() });
- }
- catch (IOException e) {
- // necessary to make sure proper location is reported in errors
- if (fErrorReporter != null) {
- fErrorReporter.setDocumentLocator(fDocLocation);
- }
- // An IOException indicates that we had trouble reading the file, not
- // that it was an invalid XML file. So we send a resource error, not a
- // fatal error.
- reportResourceError(
- "XMLResourceError",
- new Object[] { href, e.getMessage()});
- return false;
- }
- finally {
- fNamespaceContext.popScope();
- }
- }
- else if (parse.equals(XINCLUDE_PARSE_TEXT)) {
- // we only care about encoding for parse="text"
- String encoding = attributes.getValue(XINCLUDE_ATTR_ENCODING);
- includedSource.setEncoding(encoding);
- XIncludeTextReader textReader = null;
-
- try {
- // Setup the appropriate text reader.
- if (!fIsXML11) {
- if (fXInclude10TextReader == null) {
- fXInclude10TextReader = new XIncludeTextReader(includedSource, this, fBufferSize);
- }
- else {
- fXInclude10TextReader.setInputSource(includedSource);
- }
- textReader = fXInclude10TextReader;
- }
- else {
- if (fXInclude11TextReader == null) {
- fXInclude11TextReader = new XInclude11TextReader(includedSource, this, fBufferSize);
- }
- else {
- fXInclude11TextReader.setInputSource(includedSource);
- }
- textReader = fXInclude11TextReader;
- }
- textReader.setErrorReporter(fErrorReporter);
- textReader.parse();
- }
- // encoding errors
- catch (MalformedByteSequenceException ex) {
- fErrorReporter.reportError(ex.getDomain(), ex.getKey(),
- ex.getArguments(), XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
- catch (CharConversionException e) {
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "CharConversionFailure", null, XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
- catch (IOException e) {
- reportResourceError(
- "TextResourceError",
- new Object[] { href, e.getMessage()});
- return false;
- }
- finally {
- if (textReader != null) {
- try {
- textReader.close();
- }
- catch (IOException e) {
- reportResourceError(
- "TextResourceError",
- new Object[] { href, e.getMessage()});
- return false;
- }
- }
- }
- }
- else {
- reportFatalError("InvalidParseValue", new Object[] { parse });
- }
- return true;
- }
-
- /**
- * Returns true if the element has the namespace "http://www.w3.org/2001/XInclude"
- * @param element the element to check
- * @return true if the element has the namespace "http://www.w3.org/2001/XInclude"
- */
- protected boolean hasXIncludeNamespace(QName element) {
- // REVISIT: The namespace of this element should be bound
- // already. Why are we looking it up from the namespace
- // context? -- mrglavas
- return element.uri == XINCLUDE_NS_URI
- || fNamespaceContext.getURI(element.prefix) == XINCLUDE_NS_URI;
- }
-
- /**
- * Checks if the element is an &lt;include&gt; element. The element must have
- * the XInclude namespace, and a local name of "include".
- *
- * @param element the element to check
- * @return true if the element is an &lt;include&gt; element
- * @see #hasXIncludeNamespace(QName)
- */
- protected boolean isIncludeElement(QName element) {
- return element.localpart.equals(XINCLUDE_INCLUDE) &&
- hasXIncludeNamespace(element);
- }
-
- /**
- * Checks if the element is an &lt;fallback&gt; element. The element must have
- * the XInclude namespace, and a local name of "fallback".
- *
- * @param element the element to check
- * @return true if the element is an &lt;fallback; element
- * @see #hasXIncludeNamespace(QName)
- */
- protected boolean isFallbackElement(QName element) {
- return element.localpart.equals(XINCLUDE_FALLBACK) &&
- hasXIncludeNamespace(element);
- }
-
- /**
- * Returns true if the current [base URI] is the same as the [base URI] that
- * was in effect on the include parent. This method should <em>only</em> be called
- * when the current element is a top level included element, i.e. the direct child
- * of a fallback element, or the root elements in an included document.
- * The "include parent" is the element which, in the result infoset, will be the
- * direct parent of the current element.
- * @return true if the [base URIs] are the same string
- */
- protected boolean sameBaseURIAsIncludeParent() {
- String parentBaseURI = getIncludeParentBaseURI();
- String baseURI = fCurrentBaseURI.getExpandedSystemId();
- // REVISIT: should we use File#sameFile() ?
- // I think the benefit of using it is that it resolves host names
- // instead of just doing a string comparison.
- // TODO: [base URI] is still an open issue with the working group.
- // They're deciding if xml:base should be added if the [base URI] is different in terms
- // of resolving relative references, or if it should be added if they are different at all.
- // Revisit this after a final decision has been made.
- // The decision also affects whether we output the file name of the URI, or just the path.
- return parentBaseURI != null && parentBaseURI.equals(baseURI);
- }
-
- /**
- * Returns true if the current [language] is equivalent to the [language] that
- * was in effect on the include parent, taking case-insensitivity into account
- * as per [RFC 3066]. This method should <em>only</em> be called when the
- * current element is a top level included element, i.e. the direct child
- * of a fallback element, or the root elements in an included document.
- * The "include parent" is the element which, in the result infoset, will be the
- * direct parent of the current element.
- *
- * @return true if the [language] properties have the same value
- * taking case-insensitivity into account as per [RFC 3066].
- */
- protected boolean sameLanguageAsIncludeParent() {
- String parentLanguage = getIncludeParentLanguage();
- return parentLanguage != null && parentLanguage.equalsIgnoreCase(fCurrentLanguage);
- }
-
- /**
- * Checks if the file indicated by the given XMLLocator has already been included
- * in the current stack.
- * @param includedSource the source to check for inclusion
- * @return true if the source has already been included
- */
- protected boolean searchForRecursiveIncludes(XMLLocator includedSource) {
- String includedSystemId = includedSource.getExpandedSystemId();
-
- if (includedSystemId == null) {
- try {
- includedSystemId =
- XMLEntityManager.expandSystemId(
- includedSource.getLiteralSystemId(),
- includedSource.getBaseSystemId(),
- false);
- }
- catch (MalformedURIException e) {
- reportFatalError("ExpandedSystemId");
- }
- }
-
- if (includedSystemId.equals(fCurrentBaseURI.getExpandedSystemId())) {
- return true;
- }
-
- if (fParentXIncludeHandler == null) {
- return false;
- }
- return fParentXIncludeHandler.searchForRecursiveIncludes(
- includedSource);
- }
-
- /**
- * Returns true if the current element is a top level included item. This means
- * it's either the child of a fallback element, or the top level item in an
- * included document
- * @return true if the current element is a top level included item
- */
- protected boolean isTopLevelIncludedItem() {
- return isTopLevelIncludedItemViaInclude()
- || isTopLevelIncludedItemViaFallback();
- }
-
- protected boolean isTopLevelIncludedItemViaInclude() {
- return fDepth == 1 && !isRootDocument();
- }
-
- protected boolean isTopLevelIncludedItemViaFallback() {
- // Technically, this doesn't check if the parent was a fallback, it also
- // would return true if any of the parent's sibling elements were fallbacks.
- // However, this doesn't matter, since we will always be ignoring elements
- // whose parent's siblings were fallbacks.
- return getSawFallback(fDepth - 1);
- }
-
- /**
- * Processes the XMLAttributes object of startElement() calls. Performs the following tasks:
- * <ul>
- * <li> If the element is a top level included item whose [base URI] is different from the
- * [base URI] of the include parent, then an xml:base attribute is added to specify the
- * true [base URI]
- * <li> For all namespace prefixes which are in-scope in an included item, but not in scope
- * in the include parent, a xmlns:prefix attribute is added
- * <li> For all attributes with a type of ENTITY, ENTITIES or NOTATIONS, the notations and
- * unparsed entities are processed as described in the spec, sections 4.5.1 and 4.5.2
- * </ul>
- * @param attributes
- * @return
- */
- protected XMLAttributes processAttributes(XMLAttributes attributes) {
- if (isTopLevelIncludedItem()) {
- // Modify attributes to fix the base URI (spec 4.5.5).
- // We only do it to top level included elements, which have a different
- // base URI than their include parent.
- if (fFixupBaseURIs && !sameBaseURIAsIncludeParent()) {
- if (attributes == null) {
- attributes = new XMLAttributesImpl();
- }
-
- // This causes errors with schema validation, if the schema doesn't
- // specify that these elements can have an xml:base attribute
- String uri = null;
- try {
- uri = this.getRelativeBaseURI();
- }
- catch (MalformedURIException e) {
- // this shouldn't ever happen, since by definition, we had to traverse
- // the same URIs to even get to this place
- uri = fCurrentBaseURI.getExpandedSystemId();
- }
- int index =
- attributes.addAttribute(
- XML_BASE_QNAME,
- XMLSymbols.fCDATASymbol,
- uri);
- attributes.setSpecified(index, true);
- }
-
- // Modify attributes to perform language-fixup (spec 4.5.6).
- // We only do it to top level included elements, which have a different
- // [language] than their include parent.
- if (fFixupLanguage && !sameLanguageAsIncludeParent()) {
- if (attributes == null) {
- attributes = new XMLAttributesImpl();
- }
- int index =
- attributes.addAttribute(
- XML_LANG_QNAME,
- XMLSymbols.fCDATASymbol,
- fCurrentLanguage);
- attributes.setSpecified(index, true);
- }
-
- // Modify attributes of included items to do namespace-fixup. (spec 4.5.4)
- Enumeration inscopeNS = fNamespaceContext.getAllPrefixes();
- while (inscopeNS.hasMoreElements()) {
- String prefix = (String)inscopeNS.nextElement();
- String parentURI =
- fNamespaceContext.getURIFromIncludeParent(prefix);
- String uri = fNamespaceContext.getURI(prefix);
- if (parentURI != uri && attributes != null) {
- if (prefix == XMLSymbols.EMPTY_STRING) {
- if (attributes
- .getValue(
- NamespaceContext.XMLNS_URI,
- XMLSymbols.PREFIX_XMLNS)
- == null) {
- if (attributes == null) {
- attributes = new XMLAttributesImpl();
- }
-
- QName ns = (QName)NEW_NS_ATTR_QNAME.clone();
- ns.prefix = null;
- ns.localpart = XMLSymbols.PREFIX_XMLNS;
- ns.rawname = XMLSymbols.PREFIX_XMLNS;
- int index =
- attributes.addAttribute(
- ns,
- XMLSymbols.fCDATASymbol,
- uri != null ? uri : XMLSymbols.EMPTY_STRING);
- attributes.setSpecified(index, true);
- // Need to re-declare this prefix in the current context
- // in order for the SAX parser to report the appropriate
- // start and end prefix mapping events. -- mrglavas
- fNamespaceContext.declarePrefix(prefix, uri);
- }
- }
- else if (
- attributes.getValue(NamespaceContext.XMLNS_URI, prefix)
- == null) {
- if (attributes == null) {
- attributes = new XMLAttributesImpl();
- }
-
- QName ns = (QName)NEW_NS_ATTR_QNAME.clone();
- ns.localpart = prefix;
- ns.rawname += prefix;
- ns.rawname = (fSymbolTable != null) ?
- fSymbolTable.addSymbol(ns.rawname) :
- ns.rawname.intern();
- int index =
- attributes.addAttribute(
- ns,
- XMLSymbols.fCDATASymbol,
- uri != null ? uri : XMLSymbols.EMPTY_STRING);
- attributes.setSpecified(index, true);
- // Need to re-declare this prefix in the current context
- // in order for the SAX parser to report the appropriate
- // start and end prefix mapping events. -- mrglavas
- fNamespaceContext.declarePrefix(prefix, uri);
- }
- }
- }
- }
-
- if (attributes != null) {
- int length = attributes.getLength();
- for (int i = 0; i < length; i++) {
- String type = attributes.getType(i);
- String value = attributes.getValue(i);
- if (type == XMLSymbols.fENTITYSymbol) {
- this.checkUnparsedEntity(value);
- }
- if (type == XMLSymbols.fENTITIESSymbol) {
- // 4.5.1 - Unparsed Entities
- StringTokenizer st = new StringTokenizer(value);
- while (st.hasMoreTokens()) {
- String entName = st.nextToken();
- this.checkUnparsedEntity(entName);
- }
- }
- else if (type == XMLSymbols.fNOTATIONSymbol) {
- // 4.5.2 - Notations
- this.checkNotation(value);
- }
- /* We actually don't need to do anything for 4.5.3, because at this stage the
- * value of the attribute is just a string. It will be taken care of later
- * in the pipeline, when the IDREFs are actually resolved against IDs.
- *
- * if (type == XMLSymbols.fIDREFSymbol || type == XMLSymbols.fIDREFSSymbol) { }
- */
- }
- }
-
- return attributes;
- }
-
- /**
- * Returns a URI, relative to the include parent's base URI, of the current
- * [base URI]. For instance, if the current [base URI] was "dir1/dir2/file.xml"
- * and the include parent's [base URI] was "dir/", this would return "dir2/file.xml".
- * @return the relative URI
- */
- protected String getRelativeBaseURI() throws MalformedURIException {
- int includeParentDepth = getIncludeParentDepth();
- String relativeURI = this.getRelativeURI(includeParentDepth);
- if (isRootDocument()) {
- return relativeURI;
- }
- else {
- if (relativeURI.equals("")) {
- relativeURI = fCurrentBaseURI.getLiteralSystemId();
- }
-
- if (includeParentDepth == 0) {
- if (fParentRelativeURI == null) {
- fParentRelativeURI =
- fParentXIncludeHandler.getRelativeBaseURI();
- }
- if (fParentRelativeURI.equals("")) {
- return relativeURI;
- }
-
- URI base = new URI(fParentRelativeURI, true);
- URI uri = new URI(base, relativeURI);
-
- /** Check whether the scheme components are equal. */
- final String baseScheme = base.getScheme();
- final String literalScheme = uri.getScheme();
- if (!Objects.equals(baseScheme, literalScheme)) {
- return relativeURI;
- }
-
- /** Check whether the authority components are equal. */
- final String baseAuthority = base.getAuthority();
- final String literalAuthority = uri.getAuthority();
- if (!Objects.equals(baseAuthority, literalAuthority)) {
- return uri.getSchemeSpecificPart();
- }
-
- /**
- * The scheme and authority components are equal,
- * return the path and the possible query and/or
- * fragment which follow.
- */
- final String literalPath = uri.getPath();
- final String literalQuery = uri.getQueryString();
- final String literalFragment = uri.getFragment();
- if (literalQuery != null || literalFragment != null) {
- final StringBuilder buffer = new StringBuilder();
- if (literalPath != null) {
- buffer.append(literalPath);
- }
- if (literalQuery != null) {
- buffer.append('?');
- buffer.append(literalQuery);
- }
- if (literalFragment != null) {
- buffer.append('#');
- buffer.append(literalFragment);
- }
- return buffer.toString();
- }
- return literalPath;
- }
- else {
- return relativeURI;
- }
- }
- }
-
- /**
- * Returns the [base URI] of the include parent.
- * @return the base URI of the include parent.
- */
- private String getIncludeParentBaseURI() {
- int depth = getIncludeParentDepth();
- if (!isRootDocument() && depth == 0) {
- return fParentXIncludeHandler.getIncludeParentBaseURI();
- }
- else {
- return this.getBaseURI(depth);
- }
- }
-
- /**
- * Returns the [language] of the include parent.
- *
- * @return the language property of the include parent.
- */
- private String getIncludeParentLanguage() {
- int depth = getIncludeParentDepth();
- if (!isRootDocument() && depth == 0) {
- return fParentXIncludeHandler.getIncludeParentLanguage();
- }
- else {
- return getLanguage(depth);
- }
- }
-
- /**
- * Returns the depth of the include parent. Here, the include parent is
- * calculated as the last non-include or non-fallback element. It is assumed
- * this method is called when the current element is a top level included item.
- * Returning 0 indicates that the top level element in this document
- * was an include element.
- * @return the depth of the top level include element
- */
- private int getIncludeParentDepth() {
- // We don't start at fDepth, since it is either the top level included item,
- // or an include element, when this method is called.
- for (int i = fDepth - 1; i >= 0; i--) {
- // This technically might not always return the first non-include/fallback
- // element that it comes to, since sawFallback() returns true if a fallback
- // was ever encountered at that depth. However, if a fallback was encountered
- // at that depth, and it wasn't the direct descendant of the current element
- // then we can't be in a situation where we're calling this method (because
- // we'll always be in STATE_IGNORE)
- if (!getSawInclude(i) && !getSawFallback(i)) {
- return i;
- }
- }
- // shouldn't get here, since depth 0 should never have an include element or
- // a fallback element
- return 0;
- }
-
- /**
- * Returns the current element depth of the result infoset.
- */
- private int getResultDepth() {
- return fResultDepth;
- }
-
- /**
- * Modify the augmentations. Add an [included] infoset item, if the current
- * element is a top level included item.
- * @param augs the Augmentations to modify.
- * @return the modified Augmentations
- */
- protected Augmentations modifyAugmentations(Augmentations augs) {
- return modifyAugmentations(augs, false);
- }
-
- /**
- * Modify the augmentations. Add an [included] infoset item, if <code>force</code>
- * is true, or if the current element is a top level included item.
- * @param augs the Augmentations to modify.
- * @param force whether to force modification
- * @return the modified Augmentations
- */
- protected Augmentations modifyAugmentations(
- Augmentations augs,
- boolean force) {
- if (force || isTopLevelIncludedItem()) {
- if (augs == null) {
- augs = new AugmentationsImpl();
- }
- augs.putItem(XINCLUDE_INCLUDED, Boolean.TRUE);
- }
- return augs;
- }
-
- protected int getState(int depth) {
- return fState[depth];
- }
-
- protected int getState() {
- return fState[fDepth];
- }
-
- protected void setState(int state) {
- if (fDepth >= fState.length) {
- int[] newarray = new int[fDepth * 2];
- System.arraycopy(fState, 0, newarray, 0, fState.length);
- fState = newarray;
- }
- fState[fDepth] = state;
- }
-
- /**
- * Records that an &lt;fallback&gt; was encountered at the specified depth,
- * as an ancestor of the current element, or as a sibling of an ancestor of the
- * current element.
- *
- * @param depth
- * @param val
- */
- protected void setSawFallback(int depth, boolean val) {
- if (depth >= fSawFallback.length) {
- boolean[] newarray = new boolean[depth * 2];
- System.arraycopy(fSawFallback, 0, newarray, 0, fSawFallback.length);
- fSawFallback = newarray;
- }
- fSawFallback[depth] = val;
- }
-
- /**
- * Returns whether an &lt;fallback&gt; was encountered at the specified depth,
- * as an ancestor of the current element, or as a sibling of an ancestor of the
- * current element.
- *
- * @param depth
- */
- protected boolean getSawFallback(int depth) {
- if (depth >= fSawFallback.length) {
- return false;
- }
- return fSawFallback[depth];
- }
-
- /**
- * Records that an &lt;include&gt; was encountered at the specified depth,
- * as an ancestor of the current item.
- *
- * @param depth
- * @param val
- */
- protected void setSawInclude(int depth, boolean val) {
- if (depth >= fSawInclude.length) {
- boolean[] newarray = new boolean[depth * 2];
- System.arraycopy(fSawInclude, 0, newarray, 0, fSawInclude.length);
- fSawInclude = newarray;
- }
- fSawInclude[depth] = val;
- }
-
- /**
- * Return whether an &lt;include&gt; was encountered at the specified depth,
- * as an ancestor of the current item.
- *
- * @param depth
- * @return
- */
- protected boolean getSawInclude(int depth) {
- if (depth >= fSawInclude.length) {
- return false;
- }
- return fSawInclude[depth];
- }
-
- protected void reportResourceError(String key) {
- this.reportFatalError(key, null);
- }
-
- protected void reportResourceError(String key, Object[] args) {
- this.reportError(key, args, XMLErrorReporter.SEVERITY_WARNING);
- }
-
- protected void reportFatalError(String key) {
- this.reportFatalError(key, null);
- }
-
- protected void reportFatalError(String key, Object[] args) {
- this.reportError(key, args, XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
-
- private void reportError(String key, Object[] args, short severity) {
- if (fErrorReporter != null) {
- fErrorReporter.reportError(
- XIncludeMessageFormatter.XINCLUDE_DOMAIN,
- key,
- args,
- severity);
- }
- // we won't worry about when error reporter is null, since there should always be
- // at least the default error reporter
- }
-
- /**
- * Set the parent of this XIncludeHandler in the tree
- * @param parent
- */
- protected void setParent(XIncludeHandler parent) {
- fParentXIncludeHandler = parent;
- }
-
- // used to know whether to pass declarations to the document handler
- protected boolean isRootDocument() {
- return fParentXIncludeHandler == null;
- }
-
- /**
- * Caches an unparsed entity.
- * @param name the name of the unparsed entity
- * @param identifier the location of the unparsed entity
- * @param augmentations any Augmentations that were on the original unparsed entity declaration
- */
- protected void addUnparsedEntity(
- String name,
- XMLResourceIdentifier identifier,
- String notation,
- Augmentations augmentations) {
- UnparsedEntity ent = new UnparsedEntity();
- ent.name = name;
- ent.systemId = identifier.getLiteralSystemId();
- ent.publicId = identifier.getPublicId();
- ent.baseURI = identifier.getBaseSystemId();
- ent.expandedSystemId = identifier.getExpandedSystemId();
- ent.notation = notation;
- ent.augmentations = augmentations;
- fUnparsedEntities.add(ent);
- }
-
- /**
- * Caches a notation.
- * @param name the name of the notation
- * @param identifier the location of the notation
- * @param augmentations any Augmentations that were on the original notation declaration
- */
- protected void addNotation(
- String name,
- XMLResourceIdentifier identifier,
- Augmentations augmentations) {
- Notation not = new Notation();
- not.name = name;
- not.systemId = identifier.getLiteralSystemId();
- not.publicId = identifier.getPublicId();
- not.baseURI = identifier.getBaseSystemId();
- not.expandedSystemId = identifier.getExpandedSystemId();
- not.augmentations = augmentations;
- fNotations.add(not);
- }
-
- /**
- * Checks if an UnparsedEntity with the given name was declared in the DTD of the document
- * for the current pipeline. If so, then the notation for the UnparsedEntity is checked.
- * If that turns out okay, then the UnparsedEntity is passed to the root pipeline to
- * be checked for conflicts, and sent to the root DTDHandler.
- *
- * @param entName the name of the UnparsedEntity to check
- */
- protected void checkUnparsedEntity(String entName) {
- UnparsedEntity ent = new UnparsedEntity();
- ent.name = entName;
- int index = fUnparsedEntities.indexOf(ent);
- if (index != -1) {
- ent = (UnparsedEntity)fUnparsedEntities.get(index);
- // first check the notation of the unparsed entity
- checkNotation(ent.notation);
- checkAndSendUnparsedEntity(ent);
- }
- }
-
- /**
- * Checks if a Notation with the given name was declared in the DTD of the document
- * for the current pipeline. If so, that Notation is passed to the root pipeline to
- * be checked for conflicts, and sent to the root DTDHandler
- *
- * @param notName the name of the Notation to check
- */
- protected void checkNotation(String notName) {
- Notation not = new Notation();
- not.name = notName;
- int index = fNotations.indexOf(not);
- if (index != -1) {
- not = (Notation)fNotations.get(index);
- checkAndSendNotation(not);
- }
- }
-
- /**
- * The purpose of this method is to check if an UnparsedEntity conflicts with a previously
- * declared entity in the current pipeline stack. If there is no conflict, the
- * UnparsedEntity is sent by the root pipeline.
- *
- * @param ent the UnparsedEntity to check for conflicts
- */
- protected void checkAndSendUnparsedEntity(UnparsedEntity ent) {
- if (isRootDocument()) {
- int index = fUnparsedEntities.indexOf(ent);
- if (index == -1) {
- // There is no unparsed entity with the same name that we have sent.
- // Calling unparsedEntityDecl() will add the entity to our local store,
- // and also send the unparsed entity to the DTDHandler
- XMLResourceIdentifier id =
- new XMLResourceIdentifierImpl(
- ent.publicId,
- ent.systemId,
- ent.baseURI,
- ent.expandedSystemId);
- addUnparsedEntity(
- ent.name,
- id,
- ent.notation,
- ent.augmentations);
- if (fSendUEAndNotationEvents && fDTDHandler != null) {
- fDTDHandler.unparsedEntityDecl(
- ent.name,
- id,
- ent.notation,
- ent.augmentations);
- }
- }
- else {
- UnparsedEntity localEntity =
- (UnparsedEntity)fUnparsedEntities.get(index);
- if (!ent.isDuplicate(localEntity)) {
- reportFatalError(
- "NonDuplicateUnparsedEntity",
- new Object[] { ent.name });
- }
- }
- }
- else {
- fParentXIncludeHandler.checkAndSendUnparsedEntity(ent);
- }
- }
-
- /**
- * The purpose of this method is to check if a Notation conflicts with a previously
- * declared notation in the current pipeline stack. If there is no conflict, the
- * Notation is sent by the root pipeline.
- *
- * @param not the Notation to check for conflicts
- */
- protected void checkAndSendNotation(Notation not) {
- if (isRootDocument()) {
- int index = fNotations.indexOf(not);
- if (index == -1) {
- // There is no notation with the same name that we have sent.
- XMLResourceIdentifier id =
- new XMLResourceIdentifierImpl(
- not.publicId,
- not.systemId,
- not.baseURI,
- not.expandedSystemId);
- addNotation(not.name, id, not.augmentations);
- if (fSendUEAndNotationEvents && fDTDHandler != null) {
- fDTDHandler.notationDecl(not.name, id, not.augmentations);
- }
- }
- else {
- Notation localNotation = (Notation)fNotations.get(index);
- if (!not.isDuplicate(localNotation)) {
- reportFatalError(
- "NonDuplicateNotation",
- new Object[] { not.name });
- }
- }
- }
- else {
- fParentXIncludeHandler.checkAndSendNotation(not);
- }
- }
-
- /**
- * Checks whether the string only contains white space characters.
- *
- * @param value the text to check
- */
- private void checkWhitespace(XMLString value) {
- int end = value.offset + value.length;
- for (int i = value.offset; i < end; ++i) {
- if (!XMLChar.isSpace(value.ch[i])) {
- reportFatalError("ContentIllegalAtTopLevel");
- return;
- }
- }
- }
-
- /**
- * Checks whether the root element has already been processed.
- */
- private void checkMultipleRootElements() {
- if (getRootElementProcessed()) {
- reportFatalError("MultipleRootElements");
- }
- setRootElementProcessed(true);
- }
-
- /**
- * Sets whether the root element has been processed.
- */
- private void setRootElementProcessed(boolean seenRoot) {
- if (isRootDocument()) {
- fSeenRootElement = seenRoot;
- return;
- }
- fParentXIncludeHandler.setRootElementProcessed(seenRoot);
- }
-
- /**
- * Returns whether the root element has been processed.
- */
- private boolean getRootElementProcessed() {
- return isRootDocument() ? fSeenRootElement : fParentXIncludeHandler.getRootElementProcessed();
- }
-
- // It would be nice if we didn't have to repeat code like this, but there's no interface that has
- // setFeature() and addRecognizedFeatures() that the objects have in common.
- protected void copyFeatures(
- XMLComponentManager from,
- ParserConfigurationSettings to) {
- Enumeration features = Constants.getXercesFeatures();
- copyFeatures1(features, Constants.XERCES_FEATURE_PREFIX, from, to);
- features = Constants.getSAXFeatures();
- copyFeatures1(features, Constants.SAX_FEATURE_PREFIX, from, to);
- }
-
- protected void copyFeatures(
- XMLComponentManager from,
- XMLParserConfiguration to) {
- Enumeration features = Constants.getXercesFeatures();
- copyFeatures1(features, Constants.XERCES_FEATURE_PREFIX, from, to);
- features = Constants.getSAXFeatures();
- copyFeatures1(features, Constants.SAX_FEATURE_PREFIX, from, to);
- }
-
- private void copyFeatures1(
- Enumeration features,
- String featurePrefix,
- XMLComponentManager from,
- ParserConfigurationSettings to) {
- while (features.hasMoreElements()) {
- String featureId = featurePrefix + (String)features.nextElement();
-
- to.addRecognizedFeatures(new String[] { featureId });
-
- try {
- to.setFeature(featureId, from.getFeature(featureId));
- }
- catch (XMLConfigurationException e) {
- // componentManager doesn't support this feature,
- // so we won't worry about it
- }
- }
- }
-
- private void copyFeatures1(
- Enumeration features,
- String featurePrefix,
- XMLComponentManager from,
- XMLParserConfiguration to) {
- while (features.hasMoreElements()) {
- String featureId = featurePrefix + (String)features.nextElement();
- boolean value = from.getFeature(featureId);
-
- try {
- to.setFeature(featureId, value);
- }
- catch (XMLConfigurationException e) {
- // componentManager doesn't support this feature,
- // so we won't worry about it
- }
- }
- }
-
- // This is a storage class to hold information about the notations.
- // We're not using XMLNotationDecl because we don't want to lose the augmentations.
- protected static class Notation {
- public String name;
- public String systemId;
- public String baseURI;
- public String publicId;
- public String expandedSystemId;
- public Augmentations augmentations;
-
- // equals() returns true if two Notations have the same name.
- // Useful for searching Vectors for notations with the same name
- @Override
- public boolean equals(Object obj) {
- return obj == this || obj instanceof Notation
- && Objects.equals(name, ((Notation)obj).name);
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(name);
- }
-
- // from 4.5.2
- // Notation items with the same [name], [system identifier],
- // [public identifier], and [declaration base URI] are considered
- // to be duplicate. An application may also be able to detect that
- // notations are duplicate through other means. For instance, the URI
- // resulting from combining the system identifier and the declaration
- // base URI is the same.
- public boolean isDuplicate(Object obj) {
- if (obj != null && obj instanceof Notation) {
- Notation other = (Notation)obj;
- return Objects.equals(name, other.name)
- && Objects.equals(publicId, other.publicId)
- && Objects.equals(expandedSystemId, other.expandedSystemId);
- }
- return false;
- }
- }
-
- // This is a storage class to hold information about the unparsed entities.
- // We're not using XMLEntityDecl because we don't want to lose the augmentations.
- protected static class UnparsedEntity {
- public String name;
- public String systemId;
- public String baseURI;
- public String publicId;
- public String expandedSystemId;
- public String notation;
- public Augmentations augmentations;
-
- // equals() returns true if two UnparsedEntities have the same name.
- // Useful for searching Vectors for entities with the same name
- @Override
- public boolean equals(Object obj) {
- return obj == this || obj instanceof UnparsedEntity
- && Objects.equals(name, ((UnparsedEntity)obj).name);
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(name);
- }
-
- // from 4.5.1:
- // Unparsed entity items with the same [name], [system identifier],
- // [public identifier], [declaration base URI], [notation name], and
- // [notation] are considered to be duplicate. An application may also
- // be able to detect that unparsed entities are duplicate through other
- // means. For instance, the URI resulting from combining the system
- // identifier and the declaration base URI is the same.
- public boolean isDuplicate(Object obj) {
- if (obj != null && obj instanceof UnparsedEntity) {
- UnparsedEntity other = (UnparsedEntity)obj;
- return Objects.equals(name, other.name)
- && Objects.equals(publicId, other.publicId)
- && Objects.equals(expandedSystemId, other.expandedSystemId)
- && Objects.equals(notation, other.notation);
- }
- return false;
- }
- }
-
- // The following methods are used for XML Base processing
-
- /**
- * Saves the current base URI to the top of the stack.
- */
- protected void saveBaseURI() {
- fBaseURIScope.push(fDepth);
- fBaseURI.push(fCurrentBaseURI.getBaseSystemId());
- fLiteralSystemID.push(fCurrentBaseURI.getLiteralSystemId());
- fExpandedSystemID.push(fCurrentBaseURI.getExpandedSystemId());
- }
-
- /**
- * Discards the URIs at the top of the stack, and restores the ones beneath it.
- */
- protected void restoreBaseURI() {
- fBaseURI.pop();
- fLiteralSystemID.pop();
- fExpandedSystemID.pop();
- fBaseURIScope.pop();
- fCurrentBaseURI.setBaseSystemId((String)fBaseURI.peek());
- fCurrentBaseURI.setLiteralSystemId((String)fLiteralSystemID.peek());
- fCurrentBaseURI.setExpandedSystemId((String)fExpandedSystemID.peek());
- }
-
- // The following methods are used for language processing
-
- /**
- * Saves the given language on the top of the stack.
- *
- * @param lanaguage the language to push onto the stack.
- */
- protected void saveLanguage(String language) {
- fLanguageScope.push(fDepth);
- fLanguageStack.push(language);
- }
-
- /**
- * Discards the language at the top of the stack, and returns the one beneath it.
- */
- public String restoreLanguage() {
- fLanguageStack.pop();
- fLanguageScope.pop();
- return (String) fLanguageStack.peek();
- }
-
- /**
- * Gets the base URI that was in use at that depth
- * @param depth
- * @return the base URI
- */
- public String getBaseURI(int depth) {
- int scope = scopeOfBaseURI(depth);
- return (String)fExpandedSystemID.elementAt(scope);
- }
-
- /**
- * Gets the language that was in use at that depth.
- * @param depth
- * @return the language
- */
- public String getLanguage(int depth) {
- int scope = scopeOfLanguage(depth);
- return (String)fLanguageStack.elementAt(scope);
- }
-
- /**
- * Returns a relative URI, which when resolved against the base URI at the
- * specified depth, will create the current base URI.
- * This is accomplished by merged the literal system IDs.
- * @param depth the depth at which to start creating the relative URI
- * @return a relative URI to convert the base URI at the given depth to the current
- * base URI
- */
- public String getRelativeURI(int depth) throws MalformedURIException {
- // The literal system id at the location given by "start" is *in focus* at
- // the given depth. So we need to adjust it to the next scope, so that we
- // only process out of focus literal system ids
- int start = scopeOfBaseURI(depth) + 1;
- if (start == fBaseURIScope.size()) {
- // If that is the last system id, then we don't need a relative URI
- return "";
- }
- URI uri = new URI("file", (String)fLiteralSystemID.elementAt(start));
- for (int i = start + 1; i < fBaseURIScope.size(); i++) {
- uri = new URI(uri, (String)fLiteralSystemID.elementAt(i));
- }
- return uri.getPath();
- }
-
- // We need to find two consecutive elements in the scope stack,
- // such that the first is lower than 'depth' (or equal), and the
- // second is higher.
- private int scopeOfBaseURI(int depth) {
- for (int i = fBaseURIScope.size() - 1; i >= 0; i--) {
- if (fBaseURIScope.elementAt(i) <= depth)
- return i;
- }
- // we should never get here, because 0 was put on the stack in startDocument()
- return -1;
- }
-
- private int scopeOfLanguage(int depth) {
- for (int i = fLanguageScope.size() - 1; i >= 0; i--) {
- if (fLanguageScope.elementAt(i) <= depth)
- return i;
- }
- // we should never get here, because 0 was put on the stack in startDocument()
- return -1;
- }
-
- /**
- * Search for a xml:base attribute, and if one is found, put the new base URI into
- * effect.
- */
- protected void processXMLBaseAttributes(XMLAttributes attributes) {
- String baseURIValue =
- attributes.getValue(NamespaceContext.XML_URI, "base");
- if (baseURIValue != null) {
- try {
- String expandedValue =
- XMLEntityManager.expandSystemId(
- baseURIValue,
- fCurrentBaseURI.getExpandedSystemId(),
- false);
- fCurrentBaseURI.setLiteralSystemId(baseURIValue);
- fCurrentBaseURI.setBaseSystemId(
- fCurrentBaseURI.getExpandedSystemId());
- fCurrentBaseURI.setExpandedSystemId(expandedValue);
-
- // push the new values on the stack
- saveBaseURI();
- }
- catch (MalformedURIException e) {
- // REVISIT: throw error here
- }
- }
- }
-
- /**
- * Search for a xml:lang attribute, and if one is found, put the new
- * [language] into effect.
- */
- protected void processXMLLangAttributes(XMLAttributes attributes) {
- String language = attributes.getValue(NamespaceContext.XML_URI, "lang");
- if (language != null) {
- fCurrentLanguage = language;
- saveLanguage(fCurrentLanguage);
- }
- }
-
- /**
- * Returns <code>true</code> if the given string
- * would be valid in an HTTP header.
- *
- * @param value string to check
- * @return <code>true</code> if the given string
- * would be valid in an HTTP header
- */
- private boolean isValidInHTTPHeader (String value) {
- char ch;
- for (int i = value.length() - 1; i >= 0; --i) {
- ch = value.charAt(i);
- if (ch < 0x20 || ch > 0x7E) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Returns a new <code>XMLInputSource</code> from the given parameters.
- */
- private XMLInputSource createInputSource(String publicId,
- String systemId, String baseSystemId,
- String accept, String acceptLanguage) {
-
- HTTPInputSource httpSource = new HTTPInputSource(publicId, systemId, baseSystemId);
- if (accept != null && accept.length() > 0) {
- httpSource.setHTTPRequestProperty(XIncludeHandler.HTTP_ACCEPT, accept);
- }
- if (acceptLanguage != null && acceptLanguage.length() > 0) {
- httpSource.setHTTPRequestProperty(XIncludeHandler.HTTP_ACCEPT_LANGUAGE, acceptLanguage);
- }
- return httpSource;
- }
-
- // which ASCII characters need to be escaped
- private static final boolean gNeedEscaping[] = new boolean[128];
- // the first hex character if a character needs to be escaped
- private static final char gAfterEscaping1[] = new char[128];
- // the second hex character if a character needs to be escaped
- private static final char gAfterEscaping2[] = new char[128];
- private static final char[] gHexChs = {'0', '1', '2', '3', '4', '5', '6', '7',
- '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
- // initialize the above 3 arrays
- static {
- char[] escChs = {' ', '<', '>', '"', '{', '}', '|', '\\', '^', '`'};
- int len = escChs.length;
- char ch;
- for (int i = 0; i < len; i++) {
- ch = escChs[i];
- gNeedEscaping[ch] = true;
- gAfterEscaping1[ch] = gHexChs[ch >> 4];
- gAfterEscaping2[ch] = gHexChs[ch & 0xf];
- }
- }
-
- //
- // Escape an href value according to (4.1.1):
- //
- // To convert the value of the href attribute to an IRI reference, the following characters must be escaped:
- // space #x20
- // the delimiters < #x3C, > #x3E and " #x22
- // the unwise characters { #x7B, } #x7D, | #x7C, \ #x5C, ^ #x5E and ` #x60
- //
- // To convert an IRI reference to a URI reference, the following characters must also be escaped:
- // the Unicode plane 0 characters #xA0 - #xD7FF, #xF900-#xFDCF, #xFDF0-#xFFEF
- // the Unicode plane 1-14 characters #x10000-#x1FFFD ... #xE0000-#xEFFFD
- //
- private String escapeHref(String href) {
- int len = href.length();
- int ch;
- final StringBuilder buffer = new StringBuilder(len*3);
-
- // for each character in the href
- int i = 0;
- for (; i < len; i++) {
- ch = href.charAt(i);
- // if it's not an ASCII character (excluding 0x7F), break here, and use UTF-8 encoding
- if (ch > 0x7E) {
- break;
- }
- // abort: href does not allow this character
- if (ch < 0x20) {
- return href;
- }
- if (gNeedEscaping[ch]) {
- buffer.append('%');
- buffer.append(gAfterEscaping1[ch]);
- buffer.append(gAfterEscaping2[ch]);
- }
- else {
- buffer.append((char)ch);
- }
- }
-
- // we saw some non-ascii character
- if (i < len) {
- // check if remainder of href contains any illegal characters before proceeding
- for (int j = i; j < len; ++j) {
- ch = href.charAt(j);
- if ((ch >= 0x20 && ch <= 0x7E) ||
- (ch >= 0xA0 && ch <= 0xD7FF) ||
- (ch >= 0xF900 && ch <= 0xFDCF) ||
- (ch >= 0xFDF0 && ch <= 0xFFEF)) {
- continue;
- }
- if (XMLChar.isHighSurrogate(ch) && ++j < len) {
- int ch2 = href.charAt(j);
- if (XMLChar.isLowSurrogate(ch2)) {
- ch2 = XMLChar.supplemental((char)ch, (char)ch2);
- if (ch2 < 0xF0000 && (ch2 & 0xFFFF) <= 0xFFFD) {
- continue;
- }
- }
- }
- // abort: href does not allow this character
- return href;
- }
-
- // get UTF-8 bytes for the remaining sub-string
- byte[] bytes = null;
- byte b;
- try {
- bytes = href.substring(i).getBytes("UTF-8");
- } catch (java.io.UnsupportedEncodingException e) {
- // should never happen
- return href;
- }
- len = bytes.length;
-
- // for each byte
- for (i = 0; i < len; i++) {
- b = bytes[i];
- // for non-ascii character: make it positive, then escape
- if (b < 0) {
- ch = b + 256;
- buffer.append('%');
- buffer.append(gHexChs[ch >> 4]);
- buffer.append(gHexChs[ch & 0xf]);
- }
- else if (gNeedEscaping[b]) {
- buffer.append('%');
- buffer.append(gAfterEscaping1[b]);
- buffer.append(gAfterEscaping2[b]);
- }
- else {
- buffer.append((char)b);
- }
- }
- }
-
- // If escaping happened, create a new string;
- // otherwise, return the orginal one.
- if (buffer.length() != len) {
- return buffer.toString();
- }
- else {
- return href;
- }
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xinclude/XIncludeMessageFormatter.java b/src/com/sun/org/apache/xerces/internal/xinclude/XIncludeMessageFormatter.java
deleted file mode 100644
index 0275615..0000000
--- a/src/com/sun/org/apache/xerces/internal/xinclude/XIncludeMessageFormatter.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xinclude;
-
-import com.sun.org.apache.xerces.internal.util.MessageFormatter;
-import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-// TODO: fix error messages in XIncludeMessages.properties
-/**
- * XIncludeMessageFormatter provides error messages for the XInclude 1.0 Candidate Recommendation
- *
- * @author Peter McCracken, IBM
- *
- * @version $Id: XIncludeMessageFormatter.java,v 1.7 2010-11-01 04:40:18 joehw Exp $
- */
-public class XIncludeMessageFormatter implements MessageFormatter {
-
- public static final String XINCLUDE_DOMAIN = "http://www.w3.org/TR/xinclude";
-
- // private objects to cache the locale and resource bundle
- private Locale fLocale = null;
- private ResourceBundle fResourceBundle = null;
-
- /**
- * Formats a message with the specified arguments using the given
- * locale information.
- *
- * @param locale The locale of the message.
- * @param key The message key.
- * @param arguments The message replacement text arguments. The order
- * of the arguments must match that of the placeholders
- * in the actual message.
- *
- * @return Returns the formatted message.
- *
- * @throws MissingResourceException Thrown if the message with the
- * specified key cannot be found.
- */
- public String formatMessage(Locale locale, String key, Object[] arguments)
- throws MissingResourceException {
-
- if (fResourceBundle == null || locale != fLocale) {
- if (locale != null) {
- fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XIncludeMessages", locale);
- // memorize the most-recent locale
- fLocale = locale;
- }
- if (fResourceBundle == null)
- fResourceBundle = SecuritySupport.getResourceBundle("com.sun.org.apache.xerces.internal.impl.msg.XIncludeMessages");
- }
-
- String msg = fResourceBundle.getString(key);
- if (arguments != null) {
- try {
- msg = java.text.MessageFormat.format(msg, arguments);
- } catch (Exception e) {
- msg = fResourceBundle.getString("FormatFailed");
- msg += " " + fResourceBundle.getString(key);
- }
- }
-
- if (msg == null) {
- msg = fResourceBundle.getString("BadMessageKey");
- throw new MissingResourceException(msg, "com.sun.org.apache.xerces.internal.impl.msg.XIncludeMessages", key);
- }
-
- return msg;
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xinclude/XIncludeNamespaceSupport.java b/src/com/sun/org/apache/xerces/internal/xinclude/XIncludeNamespaceSupport.java
deleted file mode 100644
index 3c36d14..0000000
--- a/src/com/sun/org/apache/xerces/internal/xinclude/XIncludeNamespaceSupport.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xerces.internal.xinclude;
-
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-
-/**
- * This is an implementation of NamespaceContext which is intended to be used for
- * XInclude processing. It enables each context to be marked as invalid, if necessary,
- * to indicate that the namespaces recorded on those contexts won't be apparent in the
- * resulting infoset.
- *
- * @author Peter McCracken, IBM
- *
- */
-public class XIncludeNamespaceSupport extends MultipleScopeNamespaceSupport {
-
- /**
- * This stores whether or not the context at the matching depth was valid.
- */
- private boolean[] fValidContext = new boolean[8];
-
- /**
- *
- */
- public XIncludeNamespaceSupport() {
- super();
- }
-
- /**
- * @param context
- */
- public XIncludeNamespaceSupport(NamespaceContext context) {
- super(context);
- }
-
- /**
- * Pushes a new context onto the stack.
- */
- public void pushContext() {
- super.pushContext();
- if (fCurrentContext + 1 == fValidContext.length) {
- boolean[] contextarray = new boolean[fValidContext.length * 2];
- System.arraycopy(fValidContext, 0, contextarray, 0, fValidContext.length);
- fValidContext = contextarray;
- }
-
- fValidContext[fCurrentContext] = true;
- }
-
- /**
- * This method is used to set a context invalid for XInclude namespace processing.
- * Any context defined by an &lt;include&gt; or &lt;fallback&gt; element is not
- * valid for processing the include parent's [in-scope namespaces]. Thus, contexts
- * defined by these elements are set to invalid by the XInclude processor using
- * this method.
- */
- public void setContextInvalid() {
- fValidContext[fCurrentContext] = false;
- }
-
- /**
- * This returns the namespace URI which was associated with the given pretext, in
- * the context that existed at the include parent of the current element. The
- * include parent is the last element, before the current one, which was not set
- * to an invalid context using setContextInvalid()
- *
- * @param prefix the prefix of the desired URI
- * @return the URI corresponding to the prefix in the context of the include parent
- */
- public String getURIFromIncludeParent(String prefix) {
- int lastValidContext = fCurrentContext - 1;
- while (lastValidContext > 0 && !fValidContext[lastValidContext]) {
- lastValidContext--;
- }
- return getURI(prefix, lastValidContext);
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xinclude/XIncludeTextReader.java b/src/com/sun/org/apache/xerces/internal/xinclude/XIncludeTextReader.java
deleted file mode 100644
index f6673b5..0000000
--- a/src/com/sun/org/apache/xerces/internal/xinclude/XIncludeTextReader.java
+++ /dev/null
@@ -1,516 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xerces.internal.xinclude;
-
-import java.io.BufferedInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.net.URLConnection;
-import java.util.Iterator;
-import java.util.Locale;
-import java.util.Map;
-
-import com.sun.org.apache.xerces.internal.impl.XMLEntityManager;
-import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
-import com.sun.org.apache.xerces.internal.impl.io.ASCIIReader;
-import com.sun.org.apache.xerces.internal.impl.io.UTF8Reader;
-import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter;
-import com.sun.org.apache.xerces.internal.util.EncodingMap;
-import com.sun.org.apache.xerces.internal.util.HTTPInputSource;
-import com.sun.org.apache.xerces.internal.util.MessageFormatter;
-import com.sun.org.apache.xerces.internal.util.XMLChar;
-import com.sun.org.apache.xerces.internal.xni.XMLString;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-
-/**
- * This class is used for reading resources requested in &lt;include&gt; elements,
- * when the parse attribute of the &lt;include&gt; element is "text". Using this
- * class will open the location, detect the encoding, and discard the byte order
- * mark, if applicable.
- *
- * REVISIT:
- * Much of the code in this class is taken from XMLEntityManager. It would be nice
- * if this code could be shared in some way. However, since XMLEntityManager is used
- * for reading files as XML, and this needs to read files as text, there would need
- * to be some refactoring done.
- *
- * @author Michael Glavassevich, IBM
- * @author Peter McCracken, IBM
- * @author Ankit Pasricha, IBM
- * @author Arun Yadav, Sun Microsystems Inc.
- *
- *
- * @see XIncludeHandler
- */
-public class XIncludeTextReader {
-
- private Reader fReader;
- private XIncludeHandler fHandler;
- private XMLInputSource fSource;
- private XMLErrorReporter fErrorReporter;
- private XMLString fTempString = new XMLString();
-
- /**
- * Construct the XIncludeReader using the XMLInputSource and XIncludeHandler.
- *
- * @param source The XMLInputSource to use.
- * @param handler The XIncludeHandler to use.
- * @param bufferSize The size of this text reader's buffer.
- */
- public XIncludeTextReader(XMLInputSource source, XIncludeHandler handler, int bufferSize)
- throws IOException {
- fHandler = handler;
- fSource = source;
- fTempString = new XMLString(new char[bufferSize + 1], 0, 0);
- }
-
- /**
- * Sets the XMLErrorReporter used for reporting errors while
- * reading the text include.
- *
- * @param errorReporter the XMLErrorReporter to be used for
- * reporting errors.
- */
- public void setErrorReporter(XMLErrorReporter errorReporter) {
- fErrorReporter = errorReporter;
- }
-
- /**
- * Return the Reader for given XMLInputSource.
- *
- * @param source The XMLInputSource to use.
- */
- protected Reader getReader(XMLInputSource source) throws IOException {
- if (source.getCharacterStream() != null) {
- return source.getCharacterStream();
- }
- else {
- InputStream stream = null;
-
- String encoding = source.getEncoding();
- if (encoding == null) {
- encoding = "UTF-8";
- }
- if (source.getByteStream() != null) {
- stream = source.getByteStream();
- // Wrap the InputStream so that it is possible to rewind it.
- if (!(stream instanceof BufferedInputStream)) {
- stream = new BufferedInputStream(stream, fTempString.ch.length);
- }
- }
- else {
- String expandedSystemId = XMLEntityManager.expandSystemId(source.getSystemId(), source.getBaseSystemId(), false);
-
- URL url = new URL(expandedSystemId);
- URLConnection urlCon = url.openConnection();
-
- // If this is an HTTP connection attach any request properties to the request.
- if (urlCon instanceof HttpURLConnection && source instanceof HTTPInputSource) {
- final HttpURLConnection urlConnection = (HttpURLConnection) urlCon;
- final HTTPInputSource httpInputSource = (HTTPInputSource) source;
-
- // set request properties
- Iterator propIter = httpInputSource.getHTTPRequestProperties();
- while (propIter.hasNext()) {
- Map.Entry entry = (Map.Entry) propIter.next();
- urlConnection.setRequestProperty((String) entry.getKey(), (String) entry.getValue());
- }
-
- // set preference for redirection
- boolean followRedirects = httpInputSource.getFollowHTTPRedirects();
- if (!followRedirects) {
- XMLEntityManager.setInstanceFollowRedirects(urlConnection, followRedirects);
- }
- }
-
- // Wrap the InputStream so that it is possible to rewind it.
- stream = new BufferedInputStream(urlCon.getInputStream());
-
- // content type will be string like "text/xml; charset=UTF-8" or "text/xml"
- String rawContentType = urlCon.getContentType();
-
- // text/xml and application/xml offer only one optional parameter
- int index = (rawContentType != null) ? rawContentType.indexOf(';') : -1;
-
- String contentType = null;
- String charset = null;
- if (index != -1) {
- // this should be something like "text/xml"
- contentType = rawContentType.substring(0, index).trim();
-
- // this should be something like "charset=UTF-8", but we want to
- // strip it down to just "UTF-8"
- charset = rawContentType.substring(index + 1).trim();
- if (charset.startsWith("charset=")) {
- // 8 is the length of "charset="
- charset = charset.substring(8).trim();
- // strip quotes, if present
- if ((charset.charAt(0) == '"'
- && charset.charAt(charset.length() - 1) == '"')
- || (charset.charAt(0) == '\''
- && charset.charAt(charset.length() - 1)
- == '\'')) {
- charset =
- charset.substring(1, charset.length() - 1);
- }
- }
- else {
- charset = null;
- }
- }
- else {
- contentType = rawContentType.trim();
- }
-
- String detectedEncoding = null;
- /** The encoding of such a resource is determined by:
- 1 external encoding information, if available, otherwise
- -- the most common type of external information is the "charset" parameter of a MIME package
- 2 if the media type of the resource is text/xml, application/xml, or matches the conventions text/*+xml or application/*+xml as described in XML Media Types [IETF RFC 3023], the encoding is recognized as specified in XML 1.0, otherwise
- 3 the value of the encoding attribute if one exists, otherwise
- 4 UTF-8.
- **/
- if (contentType.equals("text/xml")) {
- if (charset != null) {
- detectedEncoding = charset;
- }
- else {
- // see RFC2376 or 3023, section 3.1
- detectedEncoding = "US-ASCII";
- }
- }
- else if (contentType.equals("application/xml")) {
- if (charset != null) {
- detectedEncoding = charset;
- }
- else {
- // see RFC2376 or 3023, section 3.2
- detectedEncoding = getEncodingName(stream);
- }
- }
- else if (contentType.endsWith("+xml")) {
- detectedEncoding = getEncodingName(stream);
- }
-
- if (detectedEncoding != null) {
- encoding = detectedEncoding;
- }
- // else 3 or 4.
- }
-
- encoding = encoding.toUpperCase(Locale.ENGLISH);
-
- // eat the Byte Order Mark
- encoding = consumeBOM(stream, encoding);
-
- // If the document is UTF-8 or US-ASCII use
- // the Xerces readers for these encodings. For
- // US-ASCII consult the encoding map since
- // this encoding has many aliases.
- if (encoding.equals("UTF-8")) {
- return new UTF8Reader(stream,
- fTempString.ch.length,
- fErrorReporter.getMessageFormatter(XMLMessageFormatter.XML_DOMAIN),
- fErrorReporter.getLocale() );
- }
-
- // Try to use a Java reader.
- String javaEncoding = EncodingMap.getIANA2JavaMapping(encoding);
-
- // If the specified encoding wasn't a recognized IANA encoding throw an IOException.
- // The XIncludeHandler will report this as a ResourceError and then will
- // attempt to include a fallback if there is one.
- if (javaEncoding == null) {
- MessageFormatter aFormatter =
- fErrorReporter.getMessageFormatter(XMLMessageFormatter.XML_DOMAIN);
- Locale aLocale = fErrorReporter.getLocale();
- throw new IOException( aFormatter.formatMessage( aLocale,
- "EncodingDeclInvalid",
- new Object[] {encoding} ) );
- }
- else if (javaEncoding.equals("ASCII")) {
- return new ASCIIReader(stream,
- fTempString.ch.length,
- fErrorReporter.getMessageFormatter(XMLMessageFormatter.XML_DOMAIN),
- fErrorReporter.getLocale() );
- }
-
- return new InputStreamReader(stream, javaEncoding);
- }
- }
-
- /**
- * XMLEntityManager cares about endian-ness, since it creates its own optimized
- * readers. Since we're just using generic Java readers for now, we're not caring
- * about endian-ness. If this changes, even more code needs to be copied from
- * XMLEntity manager. -- PJM
- */
- protected String getEncodingName(InputStream stream) throws IOException {
- final byte[] b4 = new byte[4];
- String encoding = null;
-
- // this has the potential to throw an exception
- // it will be fixed when we ensure the stream is rewindable (see note above)
- stream.mark(4);
- int count = stream.read(b4, 0, 4);
- stream.reset();
- if (count == 4) {
- encoding = getEncodingName(b4);
- }
-
- return encoding;
- }
-
- /**
- * Removes the byte order mark from the stream, if
- * it exists and returns the encoding name.
- *
- * @param stream
- * @param encoding
- * @throws IOException
- */
- protected String consumeBOM(InputStream stream, String encoding)
- throws IOException {
-
- byte[] b = new byte[3];
- int count = 0;
- stream.mark(3);
- if (encoding.equals("UTF-8")) {
- count = stream.read(b, 0, 3);
- if (count == 3) {
- final int b0 = b[0] & 0xFF;
- final int b1 = b[1] & 0xFF;
- final int b2 = b[2] & 0xFF;
- if (b0 != 0xEF || b1 != 0xBB || b2 != 0xBF) {
- // First three bytes are not BOM, so reset.
- stream.reset();
- }
- }
- else {
- stream.reset();
- }
- }
- else if (encoding.startsWith("UTF-16")) {
- count = stream.read(b, 0, 2);
- if (count == 2) {
- final int b0 = b[0] & 0xFF;
- final int b1 = b[1] & 0xFF;
- if (b0 == 0xFE && b1 == 0xFF) {
- return "UTF-16BE";
- }
- else if (b0 == 0xFF && b1 == 0xFE) {
- return "UTF-16LE";
- }
- }
- // First two bytes are not BOM, so reset.
- stream.reset();
- }
- // We could do UTF-32, but since the getEncodingName() doesn't support that
- // we won't support it here.
- // To implement UTF-32, look for: 00 00 FE FF for big-endian
- // or FF FE 00 00 for little-endian
- return encoding;
- }
-
- /**
- * REVISIT: This code is taken from com.sun.org.apache.xerces.internal.impl.XMLEntityManager.
- * Is there any way we can share the code, without having it implemented twice?
- * I think we should make it public and static in XMLEntityManager. --PJM
- *
- * Returns the IANA encoding name that is auto-detected from
- * the bytes specified, with the endian-ness of that encoding where appropriate.
- *
- * @param b4 The first four bytes of the input.
- * @return the encoding name, or null if no encoding could be detected
- */
- protected String getEncodingName(byte[] b4) {
-
- // UTF-16, with BOM
- int b0 = b4[0] & 0xFF;
- int b1 = b4[1] & 0xFF;
- if (b0 == 0xFE && b1 == 0xFF) {
- // UTF-16, big-endian
- return "UTF-16BE";
- }
- if (b0 == 0xFF && b1 == 0xFE) {
- // UTF-16, little-endian
- return "UTF-16LE";
- }
-
- // UTF-8 with a BOM
- int b2 = b4[2] & 0xFF;
- if (b0 == 0xEF && b1 == 0xBB && b2 == 0xBF) {
- return "UTF-8";
- }
-
- // other encodings
- int b3 = b4[3] & 0xFF;
- if (b0 == 0x00 && b1 == 0x00 && b2 == 0x00 && b3 == 0x3C) {
- // UCS-4, big endian (1234)
- return "ISO-10646-UCS-4";
- }
- if (b0 == 0x3C && b1 == 0x00 && b2 == 0x00 && b3 == 0x00) {
- // UCS-4, little endian (4321)
- return "ISO-10646-UCS-4";
- }
- if (b0 == 0x00 && b1 == 0x00 && b2 == 0x3C && b3 == 0x00) {
- // UCS-4, unusual octet order (2143)
- return "ISO-10646-UCS-4";
- }
- if (b0 == 0x00 && b1 == 0x3C && b2 == 0x00 && b3 == 0x00) {
- // UCS-4, unusual octect order (3412)
- return "ISO-10646-UCS-4";
- }
- if (b0 == 0x00 && b1 == 0x3C && b2 == 0x00 && b3 == 0x3F) {
- // UTF-16, big-endian, no BOM
- // (or could turn out to be UCS-2...
- return "UTF-16BE";
- }
- if (b0 == 0x3C && b1 == 0x00 && b2 == 0x3F && b3 == 0x00) {
- // UTF-16, little-endian, no BOM
- // (or could turn out to be UCS-2...
- return "UTF-16LE";
- }
- if (b0 == 0x4C && b1 == 0x6F && b2 == 0xA7 && b3 == 0x94) {
- // EBCDIC
- // a la xerces1, return CP037 instead of EBCDIC here
- return "CP037";
- }
-
- // this signals us to use the value from the encoding attribute
- return null;
-
- } // getEncodingName(byte[]):Object[]
-
- /**
- * Read the input stream as text, and pass the text on to the XIncludeHandler
- * using calls to characters(). This will read all of the text it can from the
- * resource.
- *
- * @throws IOException
- */
- public void parse() throws IOException {
-
- fReader = getReader(fSource);
- fSource = null;
- int readSize = fReader.read(fTempString.ch, 0, fTempString.ch.length - 1);
- while (readSize != -1) {
- for (int i = 0; i < readSize; ++i) {
- char ch = fTempString.ch[i];
- if (!isValid(ch)) {
- if (XMLChar.isHighSurrogate(ch)) {
- int ch2;
- // retrieve next character
- if (++i < readSize) {
- ch2 = fTempString.ch[i];
- }
- // handle rare boundary case
- else {
- ch2 = fReader.read();
- if (ch2 != -1) {
- fTempString.ch[readSize++] = (char) ch2;
- }
- }
- if (XMLChar.isLowSurrogate(ch2)) {
- // convert surrogates to a supplemental character
- int sup = XMLChar.supplemental(ch, (char)ch2);
- if (!isValid(sup)) {
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "InvalidCharInContent",
- new Object[] { Integer.toString(sup, 16) },
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
- }
- else {
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "InvalidCharInContent",
- new Object[] { Integer.toString(ch2, 16) },
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
- }
- else {
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "InvalidCharInContent",
- new Object[] { Integer.toString(ch, 16) },
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
- }
- }
- if (fHandler != null && readSize > 0) {
- fTempString.offset = 0;
- fTempString.length = readSize;
- fHandler.characters(
- fTempString,
- fHandler.modifyAugmentations(null, true));
- }
- readSize = fReader.read(fTempString.ch, 0, fTempString.ch.length - 1);
- }
-
- }
-
- /**
- * Sets the input source on this text reader.
- *
- * @param source The XMLInputSource to use.
- */
- public void setInputSource(XMLInputSource source) {
- fSource = source;
- }
-
- /**
- * Closes the stream. Call this after parse(), or when there is no longer any need
- * for this object.
- *
- * @throws IOException
- */
- public void close() throws IOException {
- if (fReader != null) {
- fReader.close();
- fReader = null;
- }
- }
-
- /**
- * Returns true if the specified character is a valid XML character
- * as per the rules of XML 1.0.
- *
- * @param ch The character to check.
- */
- protected boolean isValid(int ch) {
- return XMLChar.isValid(ch);
- }
-
- /**
- * Sets the buffer size property for the reader which decides the chunk sizes that are parsed
- * by the reader at a time and passed to the handler
- *
- * @param bufferSize The size of the buffer desired
- */
- protected void setBufferSize(int bufferSize) {
- if (fTempString.ch.length != ++bufferSize) {
- fTempString.ch = new char[bufferSize];
- }
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xinclude/XPointerElementHandler.java b/src/com/sun/org/apache/xerces/internal/xinclude/XPointerElementHandler.java
deleted file mode 100644
index cccafcf..0000000
--- a/src/com/sun/org/apache/xerces/internal/xinclude/XPointerElementHandler.java
+++ /dev/null
@@ -1,763 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001-2003 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package com.sun.org.apache.xerces.internal.xinclude;
-
-
-import java.util.Enumeration;
-import java.util.StringTokenizer;
-import java.util.Stack;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
-import com.sun.org.apache.xerces.internal.impl.dtd.DTDGrammar;
-import com.sun.org.apache.xerces.internal.util.ParserConfigurationSettings;
-import com.sun.org.apache.xerces.internal.xni.Augmentations;
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
-import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLLocator;
-import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
-import com.sun.org.apache.xerces.internal.xni.XMLString;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription;
-import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLEntityResolver;
-import com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator;
-/**
- * @author Arun Yadav, Sun Microsystem
- */
-public class XPointerElementHandler implements XPointerSchema {
-
-
- // recognized features and properties
-
- /** Property identifier: error handler. */
- protected static final String ERROR_REPORTER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY;
-
- /** Property identifier: grammar pool . */
- protected static final String GRAMMAR_POOL =
- Constants.XERCES_PROPERTY_PREFIX + Constants.XMLGRAMMAR_POOL_PROPERTY;
-
- /** Property identifier: grammar pool . */
- protected static final String ENTITY_RESOLVER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_RESOLVER_PROPERTY;
-
- protected static final String XPOINTER_SCHEMA =
- Constants.XERCES_PROPERTY_PREFIX + Constants.XPOINTER_SCHEMA_PROPERTY;
-
- /** Recognized features. */
- private static final String[] RECOGNIZED_FEATURES = {
- };
-
- /** Feature defaults. */
- private static final Boolean[] FEATURE_DEFAULTS = {
- };
-
- /** Recognized properties. */
-
- private static final String[] RECOGNIZED_PROPERTIES =
- { ERROR_REPORTER, GRAMMAR_POOL, ENTITY_RESOLVER, XPOINTER_SCHEMA };
-
- /** Property defaults. */
- private static final Object[] PROPERTY_DEFAULTS = { null, null, null,null };
-
- // Data
-
- protected XMLDocumentHandler fDocumentHandler;
- protected XMLDocumentSource fDocumentSource;
-
- protected XIncludeHandler fParentXIncludeHandler;
-
- protected XMLLocator fDocLocation;
- protected XIncludeNamespaceSupport fNamespaceContext;
- protected XMLErrorReporter fErrorReporter;
- protected XMLGrammarPool fGrammarPool;
- protected XMLGrammarDescription fGrammarDesc;
- protected DTDGrammar fDTDGrammar;
- protected XMLEntityResolver fEntityResolver;
- protected ParserConfigurationSettings fSettings;
- //protected String fPointerSchema;
- protected StringBuffer fPointer;
- private int elemCount = 0;
-
-
- // The current element depth.
- // This is used to access the appropriate level of the following stacks.
- private int fDepth;
-
- // The depth of the first element to actually be part of the result infoset.
- // This will normally be 1, but it could be larger when the top-level item
- // is an include, and processing goes to the fallback.
- private int fRootDepth;
-
- // this value must be at least 1
- private static final int INITIAL_SIZE = 8;
-
-
- // Used to ensure that fallbacks are always children of include elements,
- // and that include elements are never children of other include elements.
- // An index contains true if the ancestor of the current element which resides
- // at that depth was an include element.
- private boolean[] fSawInclude = new boolean[INITIAL_SIZE];
-
-
- // Ensures that only one fallback element can be at a single depth.
- // An index contains true if we have seen any fallback elements at that depth,
- // and it is only reset to false when the end tag of the parent is encountered.
- private boolean[] fSawFallback = new boolean[INITIAL_SIZE];
-
-
- // The state of the processor at each given depth.
- private int[] fState = new int[INITIAL_SIZE];
-
- QName foundElement = null;
- boolean skip = false;
- // Constructors
-
- public XPointerElementHandler() {
-
-
- fDepth = 0;
- fRootDepth = 0;
- fSawFallback[fDepth] = false;
- fSawInclude[fDepth] = false;
- fSchemaName="element";
-
-
- }
-
- // START OF IMPLEMENTATION OF XMLComponent methods //////
-
- public void reset(){
- elemCount =0;
- fPointerToken = null;
- fCurrentTokenint=0;
- fCurrentTokenString=null;
- fCurrentTokenType=0 ;
- fElementCount =0;
- fCurrentToken =0;
- includeElement = false;
- foundElement = null;
- skip = false;
- fSubResourceIdentified=false;
- }
-
- public void reset(XMLComponentManager componentManager)
- throws XNIException {
- fNamespaceContext = null;
- elemCount =0;
- fDepth = 0;
- fRootDepth = 0;
- fPointerToken = null;
- fCurrentTokenint=0;
- fCurrentTokenString=null;
- fCurrentTokenType=0 ;
- foundElement = null;
- includeElement = false;
- skip = false;
- fSubResourceIdentified=false;
-
-
-
-
- try {
- setErrorReporter(
- (XMLErrorReporter)componentManager.getProperty(ERROR_REPORTER));
- }
- catch (XMLConfigurationException e) {
- fErrorReporter = null;
- }
- try {
- fGrammarPool =
- (XMLGrammarPool)componentManager.getProperty(GRAMMAR_POOL);
- }
- catch (XMLConfigurationException e) {
- fGrammarPool = null;
- }
- try {
- fEntityResolver =
- (XMLEntityResolver)componentManager.getProperty(
- ENTITY_RESOLVER);
- }
- catch (XMLConfigurationException e) {
- fEntityResolver = null;
- }
-
- fSettings = new ParserConfigurationSettings();
-
- Enumeration xercesFeatures = Constants.getXercesFeatures();
- while (xercesFeatures.hasMoreElements()) {
- String featureId = (String)xercesFeatures.nextElement();
- fSettings.addRecognizedFeatures(new String[] { featureId });
- try {
- fSettings.setFeature(
- featureId,
- componentManager.getFeature(featureId));
- }
- catch (XMLConfigurationException e) {
- // componentManager doesn't support this feature,
- // so we won't worry about it
- }
- }
-/* try{
- dtdValidator = (XMLDTDValidator)componentManager.getProperty( Constants.XERCES_PROPERTY_PREFIX + Constants.DTD_VALIDATOR_PROPERTY);
- }Catch(Exception ex){
- ex.printStackTrace();
- }*/
-
- } // reset(XMLComponentManager)
-
- /**
- * Returns a list of feature identifiers that are recognized by
- * this component. This method may return null if no features
- * are recognized by this component.
- */
- public String[] getRecognizedFeatures() {
- return RECOGNIZED_FEATURES;
- } // getRecognizedFeatures():String[]
-
- /**
- * Sets the state of a feature. This method is called by the component
- * manager any time after reset when a feature changes state.
- * <p>
- * <strong>Note:</strong> Components should silently ignore features
- * that do not affect the operation of the component.
- *
- * @param featureId The feature identifier.
- * @param state The state of the feature.
- *
- * @throws SAXNotRecognizedException The component should not throw
- * this exception.
- * @throws SAXNotSupportedException The component should not throw
- * this exception.
- */
- public void setFeature(String featureId, boolean state)
- throws XMLConfigurationException {
- if (fSettings != null) {
- fSettings.setFeature(featureId, state);
- }
-
- } // setFeature(String,boolean)
-
- /**
- * Returns a list of property identifiers that are recognized by
- * this component. This method may return null if no properties
- * are recognized by this component.
- */
- public String[] getRecognizedProperties() {
- return RECOGNIZED_PROPERTIES;
- } // getRecognizedProperties():String[]
-
- /**
- * Sets the value of a property. This method is called by the component
- * manager any time after reset when a property changes value.
- * <p>
- * <strong>Note:</strong> Components should silently ignore properties
- * that do not affect the operation of the component.
- *
- * @param propertyId The property identifier.
- * @param value The value of the property.
- *
- * @throws SAXNotRecognizedException The component should not throw
- * this exception.
- * @throws SAXNotSupportedException The component should not throw
- * this exception.
- */
- public void setProperty(String propertyId, Object value)
- throws XMLConfigurationException {
- if (propertyId.equals(ERROR_REPORTER)) {
- setErrorReporter((XMLErrorReporter)value);
- }
- if (propertyId.equals(GRAMMAR_POOL)) {
- fGrammarPool = (XMLGrammarPool)value;
- }
- if (propertyId.equals(ENTITY_RESOLVER)) {
- fEntityResolver = (XMLEntityResolver)value;
- }
-
- } // setProperty(String,Object)
-
- /**
- * Returns the default state for a feature, or null if this
- * component does not want to report a default value for this
- * feature.
- *
- * @param featureId The feature identifier.
- *
- * @since Xerces 2.2.0
- */
- public Boolean getFeatureDefault(String featureId) {
- for (int i = 0; i < RECOGNIZED_FEATURES.length; i++) {
- if (RECOGNIZED_FEATURES[i].equals(featureId)) {
- return FEATURE_DEFAULTS[i];
- }
- }
- return null;
- } // getFeatureDefault(String):Boolean
-
- /**
- * Returns the default state for a property, or null if this
- * component does not want to report a default value for this
- * property.
- *
- * @param propertyId The property identifier.
- *
- * @since Xerces 2.2.0
- */
- public Object getPropertyDefault(String propertyId) {
- for (int i = 0; i < RECOGNIZED_PROPERTIES.length; i++) {
- if (RECOGNIZED_PROPERTIES[i].equals(propertyId)) {
- return PROPERTY_DEFAULTS[i];
- }
- }
- return null;
- } // getPropertyDefault(String):Object
-
- private void setErrorReporter(XMLErrorReporter reporter) {
- fErrorReporter = reporter;
- if (fErrorReporter != null) {
- fErrorReporter.putMessageFormatter(
- XIncludeMessageFormatter.XINCLUDE_DOMAIN,
- new XIncludeMessageFormatter());
- }
- }
- ///////// END OF IMPLEMENTATION OF XMLComponents methods. //////////
-
-
-
- //////// START OF IMPLEMENTATION OF XMLDOCUMENTSOURCE INTERFACE /////////
-
- public void setDocumentHandler(XMLDocumentHandler handler) {
- fDocumentHandler = handler;
- }
-
- public XMLDocumentHandler getDocumentHandler() {
- return fDocumentHandler;
- }
-
- /////// END OF IMPLENTATION OF XMLDOCUMENTSOURCE INTERFACE ///////////
-
-
-
-
- /////////////// Implementation of XPointerSchema Methods //////////////////////
-
- String fSchemaName;
- String fSchemaPointer;
- boolean fSubResourceIdentified;
- /**
- * set the Schema Name eg element , xpointer
- */
- public void setXPointerSchemaName(String schemaName){
- fSchemaName = schemaName;
- }
-
- /**
- * Return Schema Name eg element , xpointer
- *
- */
- public String getXpointerSchemaName(){
- return fSchemaName;
- }
-
- /**
- * Parent Contenhandler for the this contenthandler.
- * // not sure about the parameter type. It can be Contenthandler instead of Object type.
- */
- public void setParent(Object parent){
- fParentXIncludeHandler = (XIncludeHandler)parent;
- }
-
-
- /**
- * return the Parent Contenthandler
- */
- public Object getParent(){
- return fParentXIncludeHandler;
- }
-
- /**
- * Content of the XPointer Schema. Xpath to be resolved.
- */
- public void setXPointerSchemaPointer(String content){
- fSchemaPointer = content;
- }
-
- /**
- * Return the XPointer Schema.
- */
- public String getXPointerSchemaPointer(){
- return fSchemaPointer;
- }
-
- public boolean isSubResourceIndentified(){
- return fSubResourceIdentified;
- }
-
- ///////////End Implementation of XPointerSchema Methods //////////////////////
-
-
-
- //////////// Tokens Playground ///////////////////
-
- Stack fPointerToken = new Stack();
- int fCurrentTokenint=0;
- String fCurrentTokenString=null;
- int fCurrentTokenType=0 ;// 0 Notype; 1 for integer; 2 for string.
-
- public void getTokens(){
- fSchemaPointer = fSchemaPointer.substring(fSchemaPointer.indexOf("(")+1, fSchemaPointer.length());
- StringTokenizer st = new StringTokenizer(fSchemaPointer, "/");
- String tempToken;
- Integer integerToken =null;
- Stack tempPointerToken = new Stack();
- if(fPointerToken == null){
- fPointerToken = new Stack();
- }
- while(st.hasMoreTokens()){
- tempToken=st.nextToken();
- try {
- integerToken = Integer.valueOf(tempToken);
- tempPointerToken.push(integerToken);
- }catch(NumberFormatException e){
- tempPointerToken.push(tempToken);
- }
- }
- while(!tempPointerToken.empty()){
- fPointerToken.push(tempPointerToken.pop());
- }
- }//getTokens
-
-
- public boolean hasMoreToken(){
- if(fPointerToken.isEmpty())
- return false;
- else
- return true;
- }
-
- public boolean getNextToken(){
- Object currentToken;
- if (!fPointerToken.isEmpty()){
- currentToken = fPointerToken.pop();
- if(currentToken instanceof Integer){
- fCurrentTokenint = ((Integer)currentToken).intValue();
- fCurrentTokenType = 1;
- }
- else{
- fCurrentTokenString = ((String)currentToken).toString();
- fCurrentTokenType = 2;
- }
- return true;
- }
- else {
- return false;
- }
- }
-
- private boolean isIdAttribute(XMLAttributes attributes,Augmentations augs, int index) {
- Object o = augs.getItem(Constants.ID_ATTRIBUTE);
- if( o instanceof Boolean )
- return ((Boolean)o).booleanValue();
- return "ID".equals(attributes.getType(index));
- }
-
- public boolean checkStringToken(QName element, XMLAttributes attributes){
- QName cacheQName = null;
- String id =null;
- String rawname =null;
- QName attrName = new QName();
- String attrType = null;
- String attrValue = null;
- int attrCount = attributes.getLength();
- for (int i = 0; i < attrCount; i++) {
- Augmentations aaugs = attributes.getAugmentations(i);
- attributes.getName(i,attrName);
- attrType = attributes.getType(i);
- attrValue = attributes.getValue(i);
- if(attrType != null && attrValue!= null && isIdAttribute(attributes,aaugs,i) && attrValue.equals(fCurrentTokenString)){
- if(hasMoreToken()){
- fCurrentTokenType = 0;
- fCurrentTokenString = null;
- return true;
- }
- else{
- foundElement = element;
- includeElement = true;
- fCurrentTokenType = 0;
- fCurrentTokenString = null;
- fSubResourceIdentified = true;
- return true;
- }
- }
- }
- return false;
- }
-
- public boolean checkIntegerToken(QName element){
- if(!skip){
- fElementCount++;
- if(fCurrentTokenint == fElementCount){
- if(hasMoreToken()){
- fElementCount=0;
- fCurrentTokenType = 0;
- return true;
- }
- else{
- foundElement = element;
- includeElement = true;
- fCurrentTokenType = 0;
- fElementCount=0;
- fSubResourceIdentified =true;
- return true;
- }
- }else{
- addQName(element);
- skip = true;
- return false;
- }
- }
- return false;
- }
-
- public void addQName(QName element){
- QName cacheQName = new QName(element);
- ftempCurrentElement.push(cacheQName);
- }
-
- /////////// END TOKEN PLAYGROUND ///////////////
-
-
- ///// START OF IMPLEMTATION OF XMLDocumentHandler methods //////////
-
-
- public void startDocument(XMLLocator locator, String encoding,
- NamespaceContext namespaceContext, Augmentations augs)
- throws XNIException {
-
- getTokens();
- }
-
- public void doctypeDecl(String rootElement, String publicId, String systemId,
- Augmentations augs)throws XNIException {
- }
-
- public void xmlDecl(String version, String encoding, String standalone,
- Augmentations augs) throws XNIException {
- }
-
-
- public void comment(XMLString text, Augmentations augs)
- throws XNIException {
- if (fDocumentHandler != null && includeElement) {
- fDocumentHandler.comment(text, augs);
- }
- }
-
- public void processingInstruction(String target, XMLString data,
- Augmentations augs) throws XNIException {
- if (fDocumentHandler != null && includeElement) {
- fDocumentHandler.processingInstruction(target, data, augs);
-
- }
- }
-
- Stack ftempCurrentElement = new Stack();
- int fElementCount =0;
- int fCurrentToken ;
- boolean includeElement;
-
-
- public void startElement(QName element, XMLAttributes attributes,
- Augmentations augs)throws XNIException {
-
- boolean requiredToken=false;
- if(fCurrentTokenType == 0)
- getNextToken();
- if(fCurrentTokenType ==1)
- requiredToken = checkIntegerToken(element);
- else if (fCurrentTokenType ==2)
- requiredToken = checkStringToken(element, attributes);
- if(requiredToken && hasMoreToken())
- getNextToken();
- if(fDocumentHandler != null && includeElement){
- elemCount++;
- fDocumentHandler.startElement(element, attributes, augs);
- }
-
- }
-
-
- public void endElement(QName element, Augmentations augs)
- throws XNIException {
- if(includeElement && foundElement != null ){
- if(elemCount >0 )elemCount --;
- fDocumentHandler.endElement(element, augs);
- if(elemCount == 0)includeElement = false;
-
- }else if(!ftempCurrentElement.empty()){
- QName name = (QName)ftempCurrentElement.peek();
- if(name.equals(element)){
- ftempCurrentElement.pop();
- skip = false;
- }
- }
- }
-
- public void emptyElement(QName element, XMLAttributes attributes,
- Augmentations augs)throws XNIException {
- if(fDocumentHandler != null && includeElement){
- fDocumentHandler.emptyElement(element, attributes, augs);
- }
- }
-
- public void startGeneralEntity(String name, XMLResourceIdentifier resId,
- String encoding,
- Augmentations augs)
- throws XNIException {
- if (fDocumentHandler != null && includeElement) {
- fDocumentHandler.startGeneralEntity(name, resId, encoding, augs);
- }
- }
-
- public void textDecl(String version, String encoding, Augmentations augs)
- throws XNIException {
- if (fDocumentHandler != null && includeElement) {
- fDocumentHandler.textDecl(version, encoding, augs);
- }
- }
-
- public void endGeneralEntity(String name, Augmentations augs)
- throws XNIException {
- if (fDocumentHandler != null) {
- fDocumentHandler.endGeneralEntity(name, augs);
- }
- }
-
- public void characters(XMLString text, Augmentations augs)
- throws XNIException {
- if (fDocumentHandler != null && includeElement) {
- fDocumentHandler.characters(text, augs);
- }
- }
-
- public void ignorableWhitespace(XMLString text, Augmentations augs)
- throws XNIException {
- if (fDocumentHandler != null && includeElement) {
- fDocumentHandler.ignorableWhitespace(text, augs);
- }
- }
-
- public void startCDATA(Augmentations augs) throws XNIException {
- if (fDocumentHandler != null && includeElement) {
- fDocumentHandler.startCDATA(augs);
- }
- }
-
- public void endCDATA(Augmentations augs) throws XNIException {
- if (fDocumentHandler != null && includeElement) {
- fDocumentHandler.endCDATA(augs);
- }
- }
-
- public void endDocument(Augmentations augs) throws XNIException {
- }
-
- public void setDocumentSource(XMLDocumentSource source) {
- fDocumentSource = source;
- }
-
- public XMLDocumentSource getDocumentSource() {
- return fDocumentSource;
- }
-
-
- protected void reportFatalError(String key) {
- this.reportFatalError(key, null);
- }
-
- protected void reportFatalError(String key, Object[] args) {
- if (fErrorReporter != null) {
- fErrorReporter.reportError(
- fDocLocation,
- XIncludeMessageFormatter.XINCLUDE_DOMAIN,
- key,
- args,
- XMLErrorReporter.SEVERITY_FATAL_ERROR);
- }
- // we won't worry about when error reporter is null, since there should always be
- // at least the default error reporter
- }
-
-
-
- // used to know whether to pass declarations to the document handler
- protected boolean isRootDocument() {
- return this.fParentXIncludeHandler == null;
- }
-
-
-} // class XPointerElementhandler
diff --git a/src/com/sun/org/apache/xerces/internal/xinclude/XPointerFramework.java b/src/com/sun/org/apache/xerces/internal/xinclude/XPointerFramework.java
deleted file mode 100644
index abe514e..0000000
--- a/src/com/sun/org/apache/xerces/internal/xinclude/XPointerFramework.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001-2003 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package com.sun.org.apache.xerces.internal.xinclude;
-
-import java.util.Stack;
-import com.sun.org.apache.xerces.internal.xinclude.XPointerSchema;
-
-public class XPointerFramework{
-
- /*
- Todo's by next integration.
- While constructing schema names and uris use a dynamic datastructure.
- */
-
- XPointerSchema [] fXPointerSchema;
- String [] fSchemaPointerName;
- String [] fSchemaPointerURI;
- String fSchemaPointer;
- String fCurrentSchemaPointer;
- Stack fSchemaNotAvailable;
- int fCountSchemaName = 0;
- int schemaLength = 0;
- XPointerSchema fDefaultXPointerSchema;
-
- public XPointerFramework(){
- this(null);
- }
-
- public XPointerFramework(XPointerSchema [] xpointerschema){
- fXPointerSchema = xpointerschema;
- fSchemaNotAvailable = new Stack();
- }
-
- public void reset(){
- fXPointerSchema = null;
- fXPointerSchema = null;
- fCountSchemaName = 0;
- schemaLength = 0;
- fSchemaPointerName = null;
- fSchemaPointerURI = null;
- fDefaultXPointerSchema = null;
- fCurrentSchemaPointer = null;
- }
-
- public void setXPointerSchema(XPointerSchema [] xpointerschema){
- fXPointerSchema = xpointerschema;
- }
-
- public void setSchemaPointer(String schemaPointer){
- fSchemaPointer = schemaPointer;
- }
-
- public XPointerSchema getNextXPointerSchema(){
- int i=fCountSchemaName;
- if(fSchemaPointerName == null){
- getSchemaNames();
- }
- if(fDefaultXPointerSchema == null){
- getDefaultSchema();
- }
- if(fDefaultXPointerSchema.getXpointerSchemaName().equalsIgnoreCase(fSchemaPointerName[i])){
- fDefaultXPointerSchema.reset();
- fDefaultXPointerSchema.setXPointerSchemaPointer(fSchemaPointerURI[i]);
- fCountSchemaName = ++i;
- return getDefaultSchema();
- }
- if(fXPointerSchema == null){
- fCountSchemaName = ++i;
- return null;
- }
-
- int fschemalength = fXPointerSchema.length;
-
- for(;fSchemaPointerName[i] != null; i++){
- for(int j=0; j<fschemalength; j++ ){
- if(fSchemaPointerName[i].equalsIgnoreCase(fXPointerSchema[j].getXpointerSchemaName())){
- fXPointerSchema[j].setXPointerSchemaPointer(fSchemaPointerURI[i]);
- fCountSchemaName = ++i;
- return fXPointerSchema[j];
- }
- }
-
- if(fSchemaNotAvailable == null)
- fSchemaNotAvailable = new Stack();
-
- fSchemaNotAvailable.push(fSchemaPointerName[i]);
- }
- return null;
- }
-
- public XPointerSchema getDefaultSchema(){
- if(fDefaultXPointerSchema == null)
- fDefaultXPointerSchema = new XPointerElementHandler();
- return fDefaultXPointerSchema;
- }
-
- public void getSchemaNames(){
- int count =0;
- int index =0, lastindex =0;
- int schemapointerindex =0, schemapointerURIindex=0;
- char c;
- int length = fSchemaPointer.length();
- fSchemaPointerName = new String [5];
- fSchemaPointerURI = new String [5];
-
- index = fSchemaPointer.indexOf('(');
- if( index <= 0)
- return;
-
- fSchemaPointerName[schemapointerindex++] = fSchemaPointer.substring(0, index++).trim();
- lastindex = index;
- String tempURI = null;
- count++;
-
- while(index < length){
- c = fSchemaPointer.charAt(index);
- if(c == '(')
- count++;
- if(c == ')')
- count--;
- if(count==0 ){
- tempURI = fSchemaPointer.substring(lastindex, index).trim();
- fSchemaPointerURI[schemapointerURIindex++] = getEscapedURI(tempURI);
- lastindex = index;
- if((index = fSchemaPointer.indexOf('(', lastindex)) != -1){
- fSchemaPointerName[schemapointerindex++] = fSchemaPointer.substring(lastindex+1, index).trim();
- count++;
- lastindex = index+1;
- }
- else{
- index = lastindex;
- }
- }
- index++;
- }
- schemaLength = schemapointerURIindex -1;
- }
-
- public String getEscapedURI(String URI){
- return URI;
- }
-
- public int getSchemaCount(){
- return schemaLength;
- }
-
- public int getCurrentPointer(){
- return fCountSchemaName;
- }
-
-}//XPointerFramwork
diff --git a/src/com/sun/org/apache/xerces/internal/xinclude/XPointerSchema.java b/src/com/sun/org/apache/xerces/internal/xinclude/XPointerSchema.java
deleted file mode 100644
index 3b4d585..0000000
--- a/src/com/sun/org/apache/xerces/internal/xinclude/XPointerSchema.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package com.sun.org.apache.xerces.internal.xinclude;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponent;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentFilter;
-
-
-
-public interface XPointerSchema extends XMLComponent, XMLDocumentFilter{
-
- /**
- * set the Schema Name eg element , xpointer
- */
- public void setXPointerSchemaName(String schemaName);
-
- /**
- * Return Schema Name eg element , xpointer
- *
- */
- public String getXpointerSchemaName();
-
- /**
- * Parent Contenhandler for the this contenthandler.
- * // not sure about the parameter type. It can be Contenthandler instead of Object type.
- */
- public void setParent(Object parent);
-
- /**
- * return the Parent Contenthandler
- */
- public Object getParent();
-
- /**
- * Content of the XPointer Schema. Xpath to be resolved.
- */
- public void setXPointerSchemaPointer(String content);
-
- /**
- * Return the XPointer Schema.
- */
- public String getXPointerSchemaPointer();
-
- public boolean isSubResourceIndentified();
-
- public void reset();
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xni/Augmentations.java b/src/com/sun/org/apache/xerces/internal/xni/Augmentations.java
deleted file mode 100644
index 0a437e2..0000000
--- a/src/com/sun/org/apache/xerces/internal/xni/Augmentations.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2000-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xni;
-
-import java.util.Enumeration;
-
-/**
- * The Augmentations interface defines a table of additional data that may
- * be passed along the document pipeline. The information can contain extra
- * arguments or infoset augmentations, for example PSVI. This additional
- * information is identified by a String key.
- * <p>
- * <strong>Note:</strong>
- * Methods that receive Augmentations are required to copy the information
- * if it is to be saved for use beyond the scope of the method.
- * The Augmentations content is volatile, and maybe modified by any method in
- * any component in the pipeline. Therefore, methods passed this structure
- * should not save any reference to the structure.
- *
- * @author Elena Litani, IBM
- */
-
-public interface Augmentations {
-
-
- /**
- * Add additional information identified by a key to the Augmentations structure.
- *
- * @param key Identifier, can't be <code>null</code>
- * @param item Additional information
- *
- * @return the previous value of the specified key in the Augmentations structure,
- * or <code>null</code> if it did not have one.
- */
- public Object putItem (String key, Object item);
-
-
- /**
- * Get information identified by a key from the Augmentations structure
- *
- * @param key Identifier, can't be <code>null</code>
- *
- * @return the value to which the key is mapped in the Augmentations structure;
- * <code>null</code> if the key is not mapped to any value.
- */
- public Object getItem(String key);
-
-
- /**
- * Remove additional info from the Augmentations structure
- *
- * @param key Identifier, can't be <code>null</code>
- * @return the previous value of the specified key in the Augmentations structure,
- * or <code>null</code> if it did not have one.
- */
- public Object removeItem (String key);
-
-
- /**
- * Returns an enumeration of the keys in the Augmentations structure
- *
- */
- public Enumeration keys ();
-
-
- /**
- * Remove all objects from the Augmentations structure.
- */
- public void removeAllItems ();
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xni/NamespaceContext.java b/src/com/sun/org/apache/xerces/internal/xni/NamespaceContext.java
deleted file mode 100644
index 91b85d5..0000000
--- a/src/com/sun/org/apache/xerces/internal/xni/NamespaceContext.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xni;
-
-import java.util.Enumeration;
-import java.util.Vector;
-
-/**
- * Represents an interface to query namespace information.
- * <p>
- * The prefix and namespace must be identical references for equal strings, thus
- * each string should be internalized (@see String.intern())
- * or added to the <code>SymbolTable</code>
- *
- * @see <a href="../../../../../xerces2/com/sun/org/apache/xerces/internal/util/SymbolTable.html">
- * com.sun.org.apache.xerces.internal.util.SymbolTable</a>
- *
- * @author Andy Clark, IBM
- *
- */
-public interface NamespaceContext {
-
- //
- // Constants
- //
-
- /**
- * The XML Namespace ("http://www.w3.org/XML/1998/namespace"). This is
- * the Namespace URI that is automatically mapped to the "xml" prefix.
- */
- public final static String XML_URI = "http://www.w3.org/XML/1998/namespace".intern();
-
- /**
- * XML Information Set REC
- * all namespace attributes (including those named xmlns,
- * whose [prefix] property has no value) have a namespace URI of http://www.w3.org/2000/xmlns/
- */
- public final static String XMLNS_URI = "http://www.w3.org/2000/xmlns/".intern();
-
- //
- // NamespaceContext methods
- //
-
- /**
- * Start a new Namespace context.
- * <p>
- * A new context should be pushed at the beginning
- * of each XML element: the new context will automatically inherit
- * the declarations of its parent context, but it will also keep
- * track of which declarations were made within this context.
- * <p>
- *
- * @see #popContext
- */
- public void pushContext();
-
- /**
- * Revert to the previous Namespace context.
- * <p>
- * The context should be popped at the end of each
- * XML element. After popping the context, all Namespace prefix
- * mappings that were previously in force are restored.
- * <p>
- * Users must not attempt to declare additional Namespace
- * prefixes after popping a context, unless you push another
- * context first.
- *
- * @see #pushContext
- */
- public void popContext();
-
- /**
- * Declare a Namespace prefix.
- * <p>
- * This method declares a prefix in the current Namespace
- * context; the prefix will remain in force until this context
- * is popped, unless it is shadowed in a descendant context.
- * <p>
- * Note that to declare a default Namespace, use the empty string.
- * The prefixes "xml" and "xmlns" can't be rebound.
- * <p>
- * Note that you must <em>not</em> declare a prefix after
- * you've pushed and popped another Namespace.
- *
- * @param prefix The prefix to declare, or null for the empty
- * string.
- * @param uri The Namespace URI to associate with the prefix.
- *
- * @return true if the prefix was legal, false otherwise
- *
- * @see #getURI
- * @see #getDeclaredPrefixAt
- */
- public boolean declarePrefix(String prefix, String uri);
-
-
- /**
- * Look up a prefix and get the currently-mapped Namespace URI.
- * <p>
- * This method looks up the prefix in the current context. If no mapping
- * is found, this methods will continue lookup in the parent context(s).
- * Use the empty string ("") for the default Namespace.
- *
- * @param prefix The prefix to look up.
- *
- * @return The associated Namespace URI, or null if the prefix
- * is undeclared in this context.
- */
- public String getURI(String prefix);
-
- /**
- * Look up a namespace URI and get one of the mapped prefix.
- * <p>
- * This method looks up the namespace URI in the current context.
- * If more than one prefix is currently mapped to the same URI,
- * this method will make an arbitrary selection
- * If no mapping is found, this methods will continue lookup in the
- * parent context(s).
- *
- * @param uri The namespace URI to look up.
- *
- * @return One of the associated prefixes, or null if the uri
- * does not map to any prefix.
- *
- * @see #getPrefix
- */
- public String getPrefix(String uri);
-
-
- /**
- * Return a count of locally declared prefixes, including
- * the default prefix if bound.
- */
- public int getDeclaredPrefixCount();
-
- /**
- * Returns the prefix at the specified index in the current context.
- */
- public String getDeclaredPrefixAt(int index);
-
- /**
- * Return an enumeration of all prefixes whose declarations are active
- * in the current context. This includes declarations from parent contexts
- * that have not been overridden.
- * @return Enumeration
- */
- public Enumeration getAllPrefixes();
-
- /**
- * Reset this Namespace support object for reuse.
- *
- * <p>It is necessary to invoke this method before reusing the
- * Namespace support object for a new session.</p>
- *
- * <p>Note that implementations of this method need to ensure that
- * the declaration of the prefixes "xmlns" and "xml" are available.</p>
- */
- public void reset();
-
-
-} // interface NamespaceContext
diff --git a/src/com/sun/org/apache/xerces/internal/xni/QName.java b/src/com/sun/org/apache/xerces/internal/xni/QName.java
deleted file mode 100644
index 5c47b7a..0000000
--- a/src/com/sun/org/apache/xerces/internal/xni/QName.java
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2000-2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package com.sun.org.apache.xerces.internal.xni;
-
-/**
- * A structure that holds the components of an XML Namespaces qualified
- * name.
- * <p>
- * To be used correctly, the strings must be identical references for
- * equal strings. Within the parser, these values are considered symbols
- * and should always be retrieved from the <code>SymbolTable</code>.
- *
- * @see <a href="../../../../../xerces2/com/sun/org/apache/xerces/internal/util/SymbolTable.html">com.sun.org.apache.xerces.internal.util.SymbolTable</a>
- *
- * @author Andy Clark, IBM
- *
- * Better performance patch for the equals method by Daniel Petersson: refer to jaxp issue 61;
- * == were used to compare strings
- * @author Joe Wang, Oracle
- *
- * @version $Id: QName.java,v 1.6 2010/03/18 19:32:31 joehw Exp $
- */
-public class QName
-implements Cloneable {
-
-
- /**
- * The qname prefix. For example, the prefix for the qname "a:foo"
- * is "a".
- */
- public String prefix;
-
- /**
- * The qname localpart. For example, the localpart for the qname "a:foo"
- * is "foo".
- */
- public String localpart;
-
- /**
- * The qname rawname. For example, the rawname for the qname "a:foo"
- * is "a:foo".
- */
- public String rawname;
-
- /**
- * The URI to which the qname prefix is bound. This binding must be
- * performed by a XML Namespaces aware processor.
- */
- public String uri;
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- public QName() {
- clear();
- } // <init>()
-
- /** Constructs a QName with the specified values. */
- public QName(String prefix, String localpart, String rawname, String uri) {
- setValues(prefix, localpart, rawname, uri);
- } // <init>(String,String,String,String)
-
- /** Constructs a copy of the specified QName. */
- public QName(QName qname) {
- setValues(qname);
- } // <init>(QName)
-
- //
- // Public methods
- //
-
- /**
- * Convenience method to set the values of the qname components.
- *
- * @param QName The qualified name to be copied.
- */
- public void setValues(QName qname) {
- prefix = qname.prefix;
- localpart = qname.localpart;
- rawname = qname.rawname;
- uri = qname.uri;
- } // setValues(QName)
-
- /**
- * Convenience method to set the values of the qname components.
- *
- * @param prefix The qname prefix. (e.g. "a")
- * @param localpart The qname localpart. (e.g. "foo")
- * @param rawname The qname rawname. (e.g. "a:foo")
- * @param uri The URI binding. (e.g. "http://foo.com/mybinding")
- */
- public void setValues(String prefix, String localpart, String rawname,
- String uri) {
- this.prefix = prefix;
- this.localpart = localpart;
- this.rawname = rawname;
- this.uri = uri;
- } // setValues(String,String,String,String)
-
- /** Clears the values of the qname components. */
- public void clear() {
- prefix = null;
- localpart = null;
- rawname = null;
- uri = null;
- } // clear()
-
- //
- // Cloneable methods
- //
-
- /** Returns a clone of this object. */
- public Object clone() {
- return new QName(this);
- } // clone():Object
-
- //
- // Object methods
- //
-
- /** Returns the hashcode for this object. */
- public int hashCode() {
- if (uri != null) {
- return uri.hashCode() +
- ((localpart != null) ? localpart.hashCode() : 0);
- }
- return (rawname != null) ? rawname.hashCode() : 0;
- } // hashCode():int
-
- /** Returns true if the two objects are equal. */
- public boolean equals(Object object) {
- if (object == this) {
- return true;
- }
-
- if (object != null && object instanceof QName) {
- QName qname = (QName)object;
- if (qname.uri != null) {
- return qname.localpart.equals(localpart) && qname.uri.equals(uri);
- }
- else if (uri == null) {
- return rawname.equals(qname.rawname);
- }
- // fall through and return not equal
- }
- return false;
- } // equals(Object):boolean
-
- /** Returns a string representation of this object. */
- public String toString() {
-
- StringBuffer str = new StringBuffer();
- boolean comma = false;
- if (prefix != null) {
- str.append("prefix=\""+prefix+'"');
- comma = true;
- }
- if (localpart != null) {
- if (comma) {
- str.append(',');
- }
- str.append("localpart=\""+localpart+'"');
- comma = true;
- }
- if (rawname != null) {
- if (comma) {
- str.append(',');
- }
- str.append("rawname=\""+rawname+'"');
- comma = true;
- }
- if (uri != null) {
- if (comma) {
- str.append(',');
- }
- str.append("uri=\""+uri+'"');
- }
- return str.toString();
-
- } // toString():String
-
-} // class QName
diff --git a/src/com/sun/org/apache/xerces/internal/xni/XMLAttributes.java b/src/com/sun/org/apache/xerces/internal/xni/XMLAttributes.java
deleted file mode 100644
index 4d4b93a..0000000
--- a/src/com/sun/org/apache/xerces/internal/xni/XMLAttributes.java
+++ /dev/null
@@ -1,439 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2000-2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package com.sun.org.apache.xerces.internal.xni;
-
-/**
- * The XMLAttributes interface defines a collection of attributes for
- * an element. In the parser, the document source would scan the entire
- * start element and collect the attributes. The attributes are
- * communicated to the document handler in the startElement method.
- * <p>
- * The attributes are read-write so that subsequent stages in the document
- * pipeline can modify the values or change the attributes that are
- * propogated to the next stage.
- *
- * @see XMLDocumentHandler#startElement
- *
- * @author Andy Clark, IBM
- *
- */
-public interface XMLAttributes {
-
- //
- // XMLAttributes methods
- //
-
- /**
- * Adds an attribute. The attribute's non-normalized value of the
- * attribute will have the same value as the attribute value until
- * set using the <code>setNonNormalizedValue</code> method. Also,
- * the added attribute will be marked as specified in the XML instance
- * document unless set otherwise using the <code>setSpecified</code>
- * method.
- * <p>
- * <strong>Note:</strong> If an attribute of the same name already
- * exists, the old values for the attribute are replaced by the new
- * values.
- *
- * @param attrName The attribute name.
- * @param attrType The attribute type. The type name is determined by
- * the type specified for this attribute in the DTD.
- * For example: "CDATA", "ID", "NMTOKEN", etc. However,
- * attributes of type enumeration will have the type
- * value specified as the pipe ('|') separated list of
- * the enumeration values prefixed by an open
- * parenthesis and suffixed by a close parenthesis.
- * For example: "(true|false)".
- * @param attrValue The attribute value.
- *
- * @return Returns the attribute index.
- *
- * @see #setNonNormalizedValue
- * @see #setSpecified
- */
- public int addAttribute(QName attrName, String attrType, String attrValue);
-
- /**
- * Removes all of the attributes. This method will also remove all
- * entities associated to the attributes.
- */
- public void removeAllAttributes();
-
- /**
- * Removes the attribute at the specified index.
- * <p>
- * <strong>Note:</strong> This operation changes the indexes of all
- * attributes following the attribute at the specified index.
- *
- * @param attrIndex The attribute index.
- */
- public void removeAttributeAt(int attrIndex);
-
- /**
- * Returns the number of attributes in the list.
- * <p>
- * Once you know the number of attributes, you can iterate
- * through the list.
- *
- * @see #getURI(int)
- * @see #getLocalName(int)
- * @see #getQName(int)
- * @see #getType(int)
- * @see #getValue(int)
- */
- public int getLength();
-
- /**
- * Look up the index of an attribute by XML 1.0 qualified name.
- *
- * @param qName The qualified (prefixed) name.
- *
- * @return The index of the attribute, or -1 if it does not
- * appear in the list.
- */
- public int getIndex(String qName);
-
- /**
- * Look up the index of an attribute by Namespace name.
- *
- * @param uri The Namespace URI, or the empty string if
- * the name has no Namespace URI.
- * @param localName The attribute's local name.
- *
- * @return The index of the attribute, or -1 if it does not
- * appear in the list.
- */
- public int getIndex(String uri, String localPart);
-
- /**
- * Sets the name of the attribute at the specified index.
- *
- * @param attrIndex The attribute index.
- * @param attrName The new attribute name.
- */
- public void setName(int attrIndex, QName attrName);
-
- /**
- * Sets the fields in the given QName structure with the values
- * of the attribute name at the specified index.
- *
- * @param attrIndex The attribute index.
- * @param attrName The attribute name structure to fill in.
- */
- public void getName(int attrIndex, QName attrName);
-
- /**
- * Returns the prefix of the attribute at the specified index.
- *
- * @param index The index of the attribute.
- */
- public String getPrefix(int index);
-
- /**
- * Look up an attribute's Namespace URI by index.
- *
- * @param index The attribute index (zero-based).
- *
- * @return The Namespace URI, or the empty string if none
- * is available, or null if the index is out of
- * range.
- *
- * @see #getLength
- */
- public String getURI(int index);
-
- /**
- * Look up an attribute's local name by index.
- *
- * @param index The attribute index (zero-based).
- *
- * @return The local name, or the empty string if Namespace
- * processing is not being performed, or null
- * if the index is out of range.
- *
- * @see #getLength
- */
- public String getLocalName(int index);
-
- /**
- * Look up an attribute's XML 1.0 qualified name by index.
- *
- * @param index The attribute index (zero-based).
- *
- * @return The XML 1.0 qualified name, or the empty string
- * if none is available, or null if the index
- * is out of range.
- *
- * @see #getLength
- */
- public String getQName(int index);
-
- //why the above method doens't return QName ?
- public QName getQualifiedName(int index);
-
-
- /**
- * Sets the type of the attribute at the specified index.
- *
- * @param attrIndex The attribute index.
- * @param attrType The attribute type. The type name is determined by
- * the type specified for this attribute in the DTD.
- * For example: "CDATA", "ID", "NMTOKEN", etc. However,
- * attributes of type enumeration will have the type
- * value specified as the pipe ('|') separated list of
- * the enumeration values prefixed by an open
- * parenthesis and suffixed by a close parenthesis.
- * For example: "(true|false)".
- */
- public void setType(int attrIndex, String attrType);
-
- /**
- * Look up an attribute's type by index.
- * <p>
- * The attribute type is one of the strings "CDATA", "ID",
- * "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY", "ENTITIES",
- * or "NOTATION" (always in upper case).
- * <p>
- * If the parser has not read a declaration for the attribute,
- * or if the parser does not report attribute types, then it must
- * return the value "CDATA" as stated in the XML 1.0 Recommentation
- * (clause 3.3.3, "Attribute-Value Normalization").
- * <p>
- * For an enumerated attribute that is not a notation, the
- * parser will report the type as "NMTOKEN".
- *
- * @param index The attribute index (zero-based).
- *
- * @return The attribute's type as a string, or null if the
- * index is out of range.
- *
- * @see #getLength
- */
- public String getType(int index);
-
- /**
- * Look up an attribute's type by XML 1.0 qualified name.
- * <p>
- * See {@link #getType(int) getType(int)} for a description
- * of the possible types.
- *
- * @param qName The XML 1.0 qualified name.
- *
- * @return The attribute type as a string, or null if the
- * attribute is not in the list or if qualified names
- * are not available.
- */
- public String getType(String qName);
-
- /**
- * Look up an attribute's type by Namespace name.
- * <p>
- * See {@link #getType(int) getType(int)} for a description
- * of the possible types.
- *
- * @param uri The Namespace URI, or the empty String if the
- * name has no Namespace URI.
- * @param localName The local name of the attribute.
- *
- * @return The attribute type as a string, or null if the
- * attribute is not in the list or if Namespace
- * processing is not being performed.
- */
- public String getType(String uri, String localName);
-
- /**
- * Sets the value of the attribute at the specified index. This
- * method will overwrite the non-normalized value of the attribute.
- *
- * @param attrIndex The attribute index.
- * @param attrValue The new attribute value.
- *
- * @see #setNonNormalizedValue
- */
- public void setValue(int attrIndex, String attrValue);
-
- public void setValue(int attrIndex, String attrValue, XMLString value);
-
- /**
- * Look up an attribute's value by index.
- * <p>
- * If the attribute value is a list of tokens (IDREFS,
- * ENTITIES, or NMTOKENS), the tokens will be concatenated
- * into a single string with each token separated by a
- * single space.
- *
- * @param index The attribute index (zero-based).
- *
- * @return The attribute's value as a string, or null if the
- * index is out of range.
- *
- * @see #getLength
- */
- public String getValue(int index);
-
- /**
- * Look up an attribute's value by XML 1.0 qualified name.
- * <p>
- * See {@link #getValue(int) getValue(int)} for a description
- * of the possible values.
- *
- * @param qName The XML 1.0 qualified name.
- *
- * @return The attribute value as a string, or null if the
- * attribute is not in the list or if qualified names
- * are not available.
- */
- public String getValue(String qName);
-
- /**
- * Look up an attribute's value by Namespace name.
- * <p>
- * See {@link #getValue(int) getValue(int)} for a description
- * of the possible values.
- *
- * @param uri The Namespace URI, or the empty String if the
- * name has no Namespace URI.
- * @param localName The local name of the attribute.
- *
- * @return The attribute value as a string, or null if the
- * attribute is not in the list.
- */
- public String getValue(String uri, String localName);
-
- /**
- * Sets the non-normalized value of the attribute at the specified
- * index.
- *
- * @param attrIndex The attribute index.
- * @param attrValue The new non-normalized attribute value.
- */
- public void setNonNormalizedValue(int attrIndex, String attrValue);
-
- /**
- * Returns the non-normalized value of the attribute at the specified
- * index. If no non-normalized value is set, this method will return
- * the same value as the <code>getValue(int)</code> method.
- *
- * @param attrIndex The attribute index.
- */
- public String getNonNormalizedValue(int attrIndex);
-
- /**
- * Sets whether an attribute is specified in the instance document
- * or not.
- *
- * @param attrIndex The attribute index.
- * @param specified True if the attribute is specified in the instance
- * document.
- */
- public void setSpecified(int attrIndex, boolean specified);
-
- /**
- * Returns true if the attribute is specified in the instance document.
- *
- * @param attrIndex The attribute index.
- */
- public boolean isSpecified(int attrIndex);
-
-
- /**
- * Look up an augmentation by attribute's index.
- *
- * @param attributeIndex The attribute index.
- * @return Augmentations
- */
- public Augmentations getAugmentations (int attributeIndex);
-
- /**
- * Look up an augmentation by namespace name.
- *
- * @param uri The Namespace URI, or the empty string if
- * the name has no Namespace URI.
- * @param localPart
- * @return Augmentations
- */
- public Augmentations getAugmentations (String uri, String localPart);
-
-
- /**
- * Look up an augmentation by XML 1.0 qualified name.
- * <p>
- *
- * @param qName The XML 1.0 qualified name.
- *
- * @return Augmentations
- *
- */
- public Augmentations getAugmentations(String qName);
-
- /**
- * Sets the augmentations of the attribute at the specified index.
- *
- * @param attrIndex The attribute index.
- * @param augs The augmentations.
- */
- public void setAugmentations(int attrIndex, Augmentations augs);
-
-
-
-
-} // interface XMLAttributes
diff --git a/src/com/sun/org/apache/xerces/internal/xni/XMLDTDContentModelHandler.java b/src/com/sun/org/apache/xerces/internal/xni/XMLDTDContentModelHandler.java
deleted file mode 100644
index 062825e..0000000
--- a/src/com/sun/org/apache/xerces/internal/xni/XMLDTDContentModelHandler.java
+++ /dev/null
@@ -1,273 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2000-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xni;
-
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDContentModelSource;
-
-/**
- * The DTD content model handler interface defines callback methods
- * to report information items in DTD content models of an element
- * declaration. Parser components interested in DTD content model
- * information implement this interface and are registered as the DTD
- * content model handler on the DTD content model source.
- *
- * @see XMLDTDHandler
- *
- * @author Andy Clark, IBM
- *
- */
-public interface XMLDTDContentModelHandler {
-
- //
- // Constants
- //
-
- // separators
-
- /**
- * A choice separator for children and mixed content models. This
- * separator is used to specify that the allowed child is one of a
- * collection.
- * <p>
- * For example:
- * <pre>
- * &lt;!ELEMENT elem (foo|bar)&gt;
- * &lt;!ELEMENT elem (foo|bar+)&gt;
- * &lt;!ELEMENT elem (foo|bar|baz)&gt;
- * &lt;!ELEMENT elem (#PCDATA|foo|bar)*&gt;
- * </pre>
- *
- * @see #SEPARATOR_SEQUENCE
- */
- public static final short SEPARATOR_CHOICE = 0;
-
- /**
- * A sequence separator for children content models. This separator
- * is used to specify that the allowed children must follow in the
- * specified sequence.
- * <p>
- * <pre>
- * &lt;!ELEMENT elem (foo,bar)&gt;
- * &lt;!ELEMENT elem (foo,bar*)&gt;
- * &lt;!ELEMENT elem (foo,bar,baz)&gt;
- * </pre>
- *
- * @see #SEPARATOR_CHOICE
- */
- public static final short SEPARATOR_SEQUENCE = 1;
-
- // occurrence counts
-
- /**
- * This occurrence count limits the element, choice, or sequence in a
- * children content model to zero or one. In other words, the child
- * is optional.
- * <p>
- * For example:
- * <pre>
- * &lt;!ELEMENT elem (foo?)&gt;
- * </pre>
- *
- * @see #OCCURS_ZERO_OR_MORE
- * @see #OCCURS_ONE_OR_MORE
- */
- public static final short OCCURS_ZERO_OR_ONE = 2;
-
- /**
- * This occurrence count limits the element, choice, or sequence in a
- * children content model to zero or more. In other words, the child
- * may appear an arbitrary number of times, or not at all. This
- * occurrence count is also used for mixed content models.
- * <p>
- * For example:
- * <pre>
- * &lt;!ELEMENT elem (foo*)&gt;
- * &lt;!ELEMENT elem (#PCDATA|foo|bar)*&gt;
- * </pre>
- *
- * @see #OCCURS_ZERO_OR_ONE
- * @see #OCCURS_ONE_OR_MORE
- */
- public static final short OCCURS_ZERO_OR_MORE = 3;
-
- /**
- * This occurrence count limits the element, choice, or sequence in a
- * children content model to one or more. In other words, the child
- * may appear an arbitrary number of times, but must appear at least
- * once.
- * <p>
- * For example:
- * <pre>
- * &lt;!ELEMENT elem (foo+)&gt;
- * </pre>
- *
- * @see #OCCURS_ZERO_OR_ONE
- * @see #OCCURS_ZERO_OR_MORE
- */
- public static final short OCCURS_ONE_OR_MORE = 4;
-
- //
- // XMLDTDContentModelHandler methods
- //
-
- /**
- * The start of a content model. Depending on the type of the content
- * model, specific methods may be called between the call to the
- * startContentModel method and the call to the endContentModel method.
- *
- * @param elementName The name of the element.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startContentModel(String elementName, Augmentations augmentations)
- throws XNIException;
-
- /**
- * A content model of ANY.
- *
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see #empty
- * @see #startGroup
- */
- public void any(Augmentations augmentations) throws XNIException;
-
- /**
- * A content model of EMPTY.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @see #any
- * @see #startGroup
- */
- public void empty(Augmentations augmentations) throws XNIException;
-
- /**
- * A start of either a mixed or children content model. A mixed
- * content model will immediately be followed by a call to the
- * <code>pcdata()</code> method. A children content model will
- * contain additional groups and/or elements.
- *
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see #any
- * @see #empty
- */
- public void startGroup(Augmentations augmentations) throws XNIException;
-
- /**
- * The appearance of "#PCDATA" within a group signifying a
- * mixed content model. This method will be the first called
- * following the content model's <code>startGroup()</code>.
- *
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see #startGroup
- */
- public void pcdata(Augmentations augmentations) throws XNIException;
-
- /**
- * A referenced element in a mixed or children content model.
- *
- * @param elementName The name of the referenced element.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void element(String elementName, Augmentations augmentations)
- throws XNIException;
-
- /**
- * The separator between choices or sequences of a mixed or children
- * content model.
- *
- * @param separator The type of children separator.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see #SEPARATOR_CHOICE
- * @see #SEPARATOR_SEQUENCE
- */
- public void separator(short separator, Augmentations augmentations)
- throws XNIException;
-
- /**
- * The occurrence count for a child in a children content model or
- * for the mixed content model group.
- *
- * @param occurrence The occurrence count for the last element
- * or group.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see #OCCURS_ZERO_OR_ONE
- * @see #OCCURS_ZERO_OR_MORE
- * @see #OCCURS_ONE_OR_MORE
- */
- public void occurrence(short occurrence, Augmentations augmentations)
- throws XNIException;
-
- /**
- * The end of a group for mixed or children content models.
- *
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endGroup(Augmentations augmentations) throws XNIException;
-
- /**
- * The end of a content model.
- *
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endContentModel(Augmentations augmentations) throws XNIException;
-
- // set content model source
- public void setDTDContentModelSource(XMLDTDContentModelSource source);
-
- // get content model source
- public XMLDTDContentModelSource getDTDContentModelSource();
-
-} // interface XMLDTDContentModelHandler
diff --git a/src/com/sun/org/apache/xerces/internal/xni/XMLDTDHandler.java b/src/com/sun/org/apache/xerces/internal/xni/XMLDTDHandler.java
deleted file mode 100644
index 7387766..0000000
--- a/src/com/sun/org/apache/xerces/internal/xni/XMLDTDHandler.java
+++ /dev/null
@@ -1,378 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2000-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xni;
-
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDSource;
-
-/**
- * The DTD handler interface defines callback methods to report
- * information items in the DTD of an XML document. Parser components
- * interested in DTD information implement this interface and are
- * registered as the DTD handler on the DTD source.
- *
- * @see XMLDTDContentModelHandler
- *
- * @author Andy Clark, IBM
- *
- */
-public interface XMLDTDHandler {
-
- //
- // Constants
- //
-
- /**
- * Conditional section: INCLUDE.
- *
- * @see #CONDITIONAL_IGNORE
- */
- public static final short CONDITIONAL_INCLUDE = 0;
-
- /**
- * Conditional section: IGNORE.
- *
- * @see #CONDITIONAL_INCLUDE
- */
- public static final short CONDITIONAL_IGNORE = 1;
-
- //
- // XMLDTDHandler methods
- //
-
- /**
- * The start of the DTD.
- *
- * @param locator The document locator, or null if the document
- * location cannot be reported during the parsing of
- * the document DTD. However, it is <em>strongly</em>
- * recommended that a locator be supplied that can
- * at least report the base system identifier of the
- * DTD.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startDTD(XMLLocator locator, Augmentations augmentations)
- throws XNIException;
-
- /**
- * This method notifies of the start of a parameter entity. The parameter
- * entity name start with a '%' character.
- *
- * @param name The name of the parameter entity.
- * @param identifier The resource identifier.
- * @param encoding The auto-detected IANA encoding name of the entity
- * stream. This value will be null in those situations
- * where the entity encoding is not auto-detected (e.g.
- * internal parameter entities).
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startParameterEntity(String name,
- XMLResourceIdentifier identifier,
- String encoding,
- Augmentations augmentations) throws XNIException;
-
- /**
- * Notifies of the presence of a TextDecl line in an entity. If present,
- * this method will be called immediately following the startEntity call.
- * <p>
- * <strong>Note:</strong> This method is only called for external
- * parameter entities referenced in the DTD.
- *
- * @param version The XML version, or null if not specified.
- * @param encoding The IANA encoding name of the entity.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void textDecl(String version, String encoding,
- Augmentations augmentations) throws XNIException;
-
- /**
- * This method notifies the end of a parameter entity. Parameter entity
- * names begin with a '%' character.
- *
- * @param name The name of the parameter entity.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endParameterEntity(String name, Augmentations augmentations)
- throws XNIException;
-
- /**
- * The start of the DTD external subset.
- *
- * @param identifier The resource identifier.
- * @param augmentations
- * Additional information that may include infoset
- * augmentations.
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void startExternalSubset(XMLResourceIdentifier identifier,
- Augmentations augmentations)
- throws XNIException;
-
- /**
- * The end of the DTD external subset.
- *
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endExternalSubset(Augmentations augmentations)
- throws XNIException;
-
- /**
- * A comment.
- *
- * @param text The text in the comment.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by application to signal an error.
- */
- public void comment(XMLString text, Augmentations augmentations)
- throws XNIException;
-
- /**
- * A processing instruction. Processing instructions consist of a
- * target name and, optionally, text data. The data is only meaningful
- * to the application.
- * <p>
- * Typically, a processing instruction's data will contain a series
- * of pseudo-attributes. These pseudo-attributes follow the form of
- * element attributes but are <strong>not</strong> parsed or presented
- * to the application as anything other than text. The application is
- * responsible for parsing the data.
- *
- * @param target The target.
- * @param data The data or null if none specified.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void processingInstruction(String target, XMLString data,
- Augmentations augmentations)
- throws XNIException;
-
- /**
- * An element declaration.
- *
- * @param name The name of the element.
- * @param contentModel The element content model.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void elementDecl(String name, String contentModel,
- Augmentations augmentations)
- throws XNIException;
-
- /**
- * The start of an attribute list.
- *
- * @param elementName The name of the element that this attribute
- * list is associated with.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startAttlist(String elementName,
- Augmentations augmentations) throws XNIException;
-
- /**
- * An attribute declaration.
- *
- * @param elementName The name of the element that this attribute
- * is associated with.
- * @param attributeName The name of the attribute.
- * @param type The attribute type. This value will be one of
- * the following: "CDATA", "ENTITY", "ENTITIES",
- * "ENUMERATION", "ID", "IDREF", "IDREFS",
- * "NMTOKEN", "NMTOKENS", or "NOTATION".
- * @param enumeration If the type has the value "ENUMERATION" or
- * "NOTATION", this array holds the allowed attribute
- * values; otherwise, this array is null.
- * @param defaultType The attribute default type. This value will be
- * one of the following: "#FIXED", "#IMPLIED",
- * "#REQUIRED", or null.
- * @param defaultValue The attribute default value, or null if no
- * default value is specified.
- * @param nonNormalizedDefaultValue The attribute default value with no normalization
- * performed, or null if no default value is specified.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void attributeDecl(String elementName, String attributeName,
- String type, String[] enumeration,
- String defaultType, XMLString defaultValue,
- XMLString nonNormalizedDefaultValue, Augmentations augmentations)
- throws XNIException;
-
- /**
- * The end of an attribute list.
- *
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endAttlist(Augmentations augmentations) throws XNIException;
-
- /**
- * An internal entity declaration.
- *
- * @param name The name of the entity. Parameter entity names start with
- * '%', whereas the name of a general entity is just the
- * entity name.
- * @param text The value of the entity.
- * @param nonNormalizedText The non-normalized value of the entity. This
- * value contains the same sequence of characters that was in
- * the internal entity declaration, without any entity
- * references expanded.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void internalEntityDecl(String name, XMLString text,
- XMLString nonNormalizedText,
- Augmentations augmentations)
- throws XNIException;
-
- /**
- * An external entity declaration.
- *
- * @param name The name of the entity. Parameter entity names start
- * with '%', whereas the name of a general entity is just
- * the entity name.
- * @param identifier An object containing all location information
- * pertinent to this external entity.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void externalEntityDecl(String name,
- XMLResourceIdentifier identifier,
- Augmentations augmentations)
- throws XNIException;
-
- /**
- * An unparsed entity declaration.
- *
- * @param name The name of the entity.
- * @param identifier An object containing all location information
- * pertinent to this unparsed entity declaration.
- * @param notation The name of the notation.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void unparsedEntityDecl(String name,
- XMLResourceIdentifier identifier,
- String notation, Augmentations augmentations)
- throws XNIException;
-
- /**
- * A notation declaration
- *
- * @param name The name of the notation.
- * @param identifier An object containing all location information
- * pertinent to this notation.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void notationDecl(String name, XMLResourceIdentifier identifier,
- Augmentations augmentations) throws XNIException;
-
- /**
- * The start of a conditional section.
- *
- * @param type The type of the conditional section. This value will
- * either be CONDITIONAL_INCLUDE or CONDITIONAL_IGNORE.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see #CONDITIONAL_INCLUDE
- * @see #CONDITIONAL_IGNORE
- */
- public void startConditional(short type, Augmentations augmentations)
- throws XNIException;
-
- /**
- * Characters within an IGNORE conditional section.
- *
- * @param text The ignored text.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void ignoredCharacters(XMLString text, Augmentations augmentations)
- throws XNIException;
-
- /**
- * The end of a conditional section.
- *
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endConditional(Augmentations augmentations) throws XNIException;
-
- /**
- * The end of the DTD.
- *
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endDTD(Augmentations augmentations) throws XNIException;
-
- // set the source of this handler
- public void setDTDSource(XMLDTDSource source);
-
- // return the source from which this handler derives its events
- public XMLDTDSource getDTDSource();
-
-} // interface XMLDTDHandler
diff --git a/src/com/sun/org/apache/xerces/internal/xni/XMLDocumentFragmentHandler.java b/src/com/sun/org/apache/xerces/internal/xni/XMLDocumentFragmentHandler.java
deleted file mode 100644
index 5efbfca..0000000
--- a/src/com/sun/org/apache/xerces/internal/xni/XMLDocumentFragmentHandler.java
+++ /dev/null
@@ -1,259 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xni;
-
-/**
- * This handler interface contains methods necessary to receive
- * information about document elements and content.
- * <p>
- * <strong>Note:</strong> Some of these methods overlap methods
- * found in the XMLDocumentHandler interface.
- *
- * @see XMLDocumentHandler
- *
- * @author Andy Clark, IBM
- */
-public interface XMLDocumentFragmentHandler {
-
- //
- // XMLDocumentFragmentHandler methods
- //
-
- /**
- * The start of the document fragment.
- *
- * @param locator The document locator, or null if the
- * document location cannot be reported
- * during the parsing of this fragment.
- * However, it is <em>strongly</em>
- * recommended that a locator be supplied
- * that can at least report the base
- * system identifier.
- * @param namespaceContext The namespace context in effect at the
- * start of this document fragment. This
- * object only represents the current context.
- * Implementors of this class are responsible
- * for copying the namespace bindings from the
- * the current context (and its parent contexts)
- * if that information is important.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startDocumentFragment(XMLLocator locator,
- NamespaceContext namespaceContext,
- Augmentations augmentations)
- throws XNIException;
-
- /**
- * This method notifies the start of a general entity.
- * <p>
- * <strong>Note:</strong> This method is not called for entity references
- * appearing as part of attribute values.
- *
- * @param name The name of the general entity.
- * @param identifier The resource identifier.
- * @param encoding The auto-detected IANA encoding name of the entity
- * stream. This value will be null in those situations
- * where the entity encoding is not auto-detected (e.g.
- * internal entities or a document entity that is
- * parsed from a java.io.Reader).
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startGeneralEntity(String name,
- XMLResourceIdentifier identifier,
- String encoding,
- Augmentations augmentations) throws XNIException;
-
- /**
- * Notifies of the presence of a TextDecl line in an entity. If present,
- * this method will be called immediately following the startEntity call.
- * <p>
- * <strong>Note:</strong> This method will never be called for the
- * document entity; it is only called for external general entities
- * referenced in document content.
- * <p>
- * <strong>Note:</strong> This method is not called for entity references
- * appearing as part of attribute values.
- *
- * @param version The XML version, or null if not specified.
- * @param encoding The IANA encoding name of the entity.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void textDecl(String version, String encoding,
- Augmentations augmentations) throws XNIException;
-
- /**
- * This method notifies the end of a general entity.
- * <p>
- * <strong>Note:</strong> This method is not called for entity references
- * appearing as part of attribute values.
- *
- * @param name The name of the general entity.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endGeneralEntity(String name, Augmentations augmentations)
- throws XNIException;
-
- /**
- * A comment.
- *
- * @param text The text in the comment.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by application to signal an error.
- */
- public void comment(XMLString text, Augmentations augmentations)
- throws XNIException;
-
- /**
- * A processing instruction. Processing instructions consist of a
- * target name and, optionally, text data. The data is only meaningful
- * to the application.
- * <p>
- * Typically, a processing instruction's data will contain a series
- * of pseudo-attributes. These pseudo-attributes follow the form of
- * element attributes but are <strong>not</strong> parsed or presented
- * to the application as anything other than text. The application is
- * responsible for parsing the data.
- *
- * @param target The target.
- * @param data The data or null if none specified.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void processingInstruction(String target, XMLString data,
- Augmentations augmentations)
- throws XNIException;
-
- /**
- * The start of an element.
- *
- * @param element The name of the element.
- * @param attributes The element attributes.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startElement(QName element, XMLAttributes attributes,
- Augmentations augmentations) throws XNIException;
-
- /**
- * An empty element.
- *
- * @param element The name of the element.
- * @param attributes The element attributes.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void emptyElement(QName element, XMLAttributes attributes,
- Augmentations augmentations) throws XNIException;
-
- /**
- * Character content.
- *
- * @param text The content.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void characters(XMLString text, Augmentations augmentations)
- throws XNIException;
-
- /**
- * Ignorable whitespace. For this method to be called, the document
- * source must have some way of determining that the text containing
- * only whitespace characters should be considered ignorable. For
- * example, the validator can determine if a length of whitespace
- * characters in the document are ignorable based on the element
- * content model.
- *
- * @param text The ignorable whitespace.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void ignorableWhitespace(XMLString text,
- Augmentations augmentations)
- throws XNIException;
-
- /**
- * The end of an element.
- *
- * @param element The name of the element.
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endElement(QName element, Augmentations augmentations)
- throws XNIException;
-
- /**
- * The start of a CDATA section.
- *
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startCDATA(Augmentations augmentations) throws XNIException;
-
- /**
- * The end of a CDATA section.
- *
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endCDATA(Augmentations augmentations) throws XNIException;
-
- /**
- * The end of the document fragment.
- *
- * @param augmentations Additional information that may include infoset
- * augmentations.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endDocumentFragment(Augmentations augmentations)
- throws XNIException;
-
-} // interface XMLDocumentFragmentHandler
diff --git a/src/com/sun/org/apache/xerces/internal/xni/XMLDocumentHandler.java b/src/com/sun/org/apache/xerces/internal/xni/XMLDocumentHandler.java
deleted file mode 100644
index 18d0c1c..0000000
--- a/src/com/sun/org/apache/xerces/internal/xni/XMLDocumentHandler.java
+++ /dev/null
@@ -1,296 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2000-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xni;
-
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource;
-
-/**
- * The document handler interface defines callback methods to report
- * information items in XML documents. Parser components interested in
- * document information implement this interface and are registered
- * as the document handler on the document source.
- *
- * @author Andy Clark, IBM
- *
- */
-public interface XMLDocumentHandler {
-
- //
- // XMLDocumentHandler methods
- //
-
- /**
- * The start of the document.
- *
- * @param locator The document locator, or null if the document
- * location cannot be reported during the parsing
- * of this document. However, it is <em>strongly</em>
- * recommended that a locator be supplied that can
- * at least report the system identifier of the
- * document.
- * @param encoding The auto-detected IANA encoding name of the entity
- * stream. This value will be null in those situations
- * where the entity encoding is not auto-detected (e.g.
- * internal entities or a document entity that is
- * parsed from a java.io.Reader).
- * @param namespaceContext
- * The namespace context in effect at the
- * start of this document.
- * This object represents the current context.
- * Implementors of this class are responsible
- * for copying the namespace bindings from the
- * the current context (and its parent contexts)
- * if that information is important.
- *
- * @param augs Additional information that may include infoset augmentations
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void startDocument(XMLLocator locator, String encoding,
- NamespaceContext namespaceContext,
- Augmentations augs)
- throws XNIException;
-
- /**
- * Notifies of the presence of an XMLDecl line in the document. If
- * present, this method will be called immediately following the
- * startDocument call.
- *
- * @param version The XML version.
- * @param encoding The IANA encoding name of the document, or null if
- * not specified.
- * @param standalone The standalone value, or null if not specified.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void xmlDecl(String version, String encoding, String standalone, Augmentations augs)
- throws XNIException;
-
- /**
- * Notifies of the presence of the DOCTYPE line in the document.
- *
- * @param rootElement
- * The name of the root element.
- * @param publicId The public identifier if an external DTD or null
- * if the external DTD is specified using SYSTEM.
- * @param systemId The system identifier if an external DTD, null
- * otherwise.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void doctypeDecl(String rootElement, String publicId, String systemId, Augmentations augs)
- throws XNIException;
-
- /**
- * A comment.
- *
- * @param text The text in the comment.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by application to signal an error.
- */
- public void comment(XMLString text, Augmentations augs) throws XNIException;
-
- /**
- * A processing instruction. Processing instructions consist of a
- * target name and, optionally, text data. The data is only meaningful
- * to the application.
- * <p>
- * Typically, a processing instruction's data will contain a series
- * of pseudo-attributes. These pseudo-attributes follow the form of
- * element attributes but are <strong>not</strong> parsed or presented
- * to the application as anything other than text. The application is
- * responsible for parsing the data.
- *
- * @param target The target.
- * @param data The data or null if none specified.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void processingInstruction(String target, XMLString data, Augmentations augs)
- throws XNIException;
-
- /**
- * The start of an element.
- *
- * @param element The name of the element.
- * @param attributes The element attributes.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void startElement(QName element, XMLAttributes attributes, Augmentations augs)
- throws XNIException;
-
- /**
- * An empty element.
- *
- * @param element The name of the element.
- * @param attributes The element attributes.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void emptyElement(QName element, XMLAttributes attributes, Augmentations augs)
- throws XNIException;
-
- /**
- * This method notifies the start of a general entity.
- * <p>
- * <strong>Note:</strong> This method is not called for entity references
- * appearing as part of attribute values.
- *
- * @param name The name of the general entity.
- * @param identifier The resource identifier.
- * @param encoding The auto-detected IANA encoding name of the entity
- * stream. This value will be null in those situations
- * where the entity encoding is not auto-detected (e.g.
- * internal entities or a document entity that is
- * parsed from a java.io.Reader).
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException Thrown by handler to signal an error.
- */
- public void startGeneralEntity(String name,
- XMLResourceIdentifier identifier,
- String encoding,
- Augmentations augs) throws XNIException;
-
- /**
- * Notifies of the presence of a TextDecl line in an entity. If present,
- * this method will be called immediately following the startEntity call.
- * <p>
- * <strong>Note:</strong> This method will never be called for the
- * document entity; it is only called for external general entities
- * referenced in document content.
- * <p>
- * <strong>Note:</strong> This method is not called for entity references
- * appearing as part of attribute values.
- *
- * @param version The XML version, or null if not specified.
- * @param encoding The IANA encoding name of the entity.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void textDecl(String version, String encoding, Augmentations augs) throws XNIException;
-
- /**
- * This method notifies the end of a general entity.
- * <p>
- * <strong>Note:</strong> This method is not called for entity references
- * appearing as part of attribute values.
- *
- * @param name The name of the entity.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void endGeneralEntity(String name, Augmentations augs) throws XNIException;
-
- /**
- * Character content.
- *
- * @param text The content.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void characters(XMLString text, Augmentations augs) throws XNIException;
-
- /**
- * Ignorable whitespace. For this method to be called, the document
- * source must have some way of determining that the text containing
- * only whitespace characters should be considered ignorable. For
- * example, the validator can determine if a length of whitespace
- * characters in the document are ignorable based on the element
- * content model.
- *
- * @param text The ignorable whitespace.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void ignorableWhitespace(XMLString text, Augmentations augs) throws XNIException;
-
- /**
- * The end of an element.
- *
- * @param element The name of the element.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void endElement(QName element, Augmentations augs) throws XNIException;
-
- /**
- * The start of a CDATA section.
- *
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void startCDATA(Augmentations augs) throws XNIException;
-
- /**
- * The end of a CDATA section.
- *
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void endCDATA(Augmentations augs) throws XNIException;
-
- /**
- * The end of the document.
- *
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void endDocument(Augmentations augs) throws XNIException;
-
-
- /** Sets the document source. */
- public void setDocumentSource(XMLDocumentSource source);
-
-
- /** Returns the document source. */
- public XMLDocumentSource getDocumentSource();
-
-} // interface XMLDocumentHandler
diff --git a/src/com/sun/org/apache/xerces/internal/xni/XMLLocator.java b/src/com/sun/org/apache/xerces/internal/xni/XMLLocator.java
deleted file mode 100644
index 7ab0f86..0000000
--- a/src/com/sun/org/apache/xerces/internal/xni/XMLLocator.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xni;
-
-/**
- * Location information.
- *
- * @author Andy Clark, IBM
- *
- */
-public interface XMLLocator {
-
- //
- // XMLLocator methods
- //
-
- /** Returns the public identifier. */
- public String getPublicId();
-
- /** Returns the literal system identifier. */
- public String getLiteralSystemId();
-
- /** Returns the base system identifier. */
- public String getBaseSystemId();
-
- /** Returns the expanded system identifier. */
- public String getExpandedSystemId();
-
- /** Returns the line number, or <code>-1</code> if no line number is available. */
- public int getLineNumber();
-
- /** Returns the column number, or <code>-1</code> if no column number is available. */
- public int getColumnNumber();
-
- /** Returns the character offset, or <code>-1</code> if no character offset is available. */
- public int getCharacterOffset();
-
- /**
- * Returns the encoding of the current entity.
- * Note that, for a given entity, this value can only be
- * considered final once the encoding declaration has been read (or once it
- * has been determined that there is no such declaration) since, no encoding
- * having been specified on the XMLInputSource, the parser
- * will make an initial "guess" which could be in error.
- */
- public String getEncoding();
-
- /**
- * Returns the XML version of the current entity. This will normally be the
- * value from the XML or text declaration or defaulted by the parser. Note that
- * that this value may be different than the version of the processing rules
- * applied to the current entity. For instance, an XML 1.1 document may refer to
- * XML 1.0 entities. In such a case the rules of XML 1.1 are applied to the entire
- * document. Also note that, for a given entity, this value can only be considered
- * final once the XML or text declaration has been read or once it has been
- * determined that there is no such declaration.
- */
- public String getXMLVersion();
-
-
-} // interface XMLLocator
diff --git a/src/com/sun/org/apache/xerces/internal/xni/XMLResourceIdentifier.java b/src/com/sun/org/apache/xerces/internal/xni/XMLResourceIdentifier.java
deleted file mode 100644
index f748d62..0000000
--- a/src/com/sun/org/apache/xerces/internal/xni/XMLResourceIdentifier.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2000-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xni;
-
-/**
- * <p> This represents the basic physical description of the location of any
- * XML resource (a Schema grammar, a DTD, a general entity etc.) </p>
- *
- * @author Neil Graham, IBM
- */
-
-public interface XMLResourceIdentifier {
-
- /** Sets the public identifier. */
- public void setPublicId(String publicId);
-
- /** Returns the public identifier. */
- public String getPublicId();
-
- /** Sets the expanded system identifier. */
- public void setExpandedSystemId(String systemId);
-
- /** Returns the expanded system identifier. */
- public String getExpandedSystemId();
-
- /** Sets the literal system identifier. */
- public void setLiteralSystemId(String systemId);
-
- /** Returns the literal system identifier. */
- public String getLiteralSystemId();
-
- /** Setsthe base URI against which the literal SystemId is to be
- resolved.*/
- public void setBaseSystemId(String systemId);
-
- /** <p> Returns the base URI against which the literal SystemId is to be
- resolved. </p> */
- public String getBaseSystemId();
-
- /** Sets the namespace of the resource. */
- public void setNamespace(String namespace);
-
- /** Returns the namespace of the resource. */
- public String getNamespace();
-
-} // XMLResourceIdentifier
diff --git a/src/com/sun/org/apache/xerces/internal/xni/XMLString.java b/src/com/sun/org/apache/xerces/internal/xni/XMLString.java
deleted file mode 100644
index dd4240d..0000000
--- a/src/com/sun/org/apache/xerces/internal/xni/XMLString.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2000-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xni;
-
-/**
- * This class is used as a structure to pass text contained in the underlying
- * character buffer of the scanner. The offset and length fields allow the
- * buffer to be re-used without creating new character arrays.
- * <p>
- * <strong>Note:</strong> Methods that are passed an XMLString structure
- * should consider the contents read-only and not make any modifications
- * to the contents of the buffer. The method receiving this structure
- * should also not modify the offset and length if this structure (or
- * the values of this structure) are passed to another method.
- * <p>
- * <strong>Note:</strong> Methods that are passed an XMLString structure
- * are required to copy the information out of the buffer if it is to be
- * saved for use beyond the scope of the method. The contents of the
- * structure are volatile and the contents of the character buffer cannot
- * be assured once the method that is passed this structure returns.
- * Therefore, methods passed this structure should not save any reference
- * to the structure or the character array contained in the structure.
- *
- * @author Eric Ye, IBM
- * @author Andy Clark, IBM
- *
- */
-public class XMLString {
-
- //
- // Data
- //
-
- /** The character array. */
- public char[] ch;
-
- /** The offset into the character array. */
- public int offset;
-
- /** The length of characters from the offset. */
- public int length;
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- public XMLString() {
- } // <init>()
-
- /**
- * Constructs an XMLString structure preset with the specified
- * values.
- *
- * @param ch The character array.
- * @param offset The offset into the character array.
- * @param length The length of characters from the offset.
- */
- public XMLString(char[] ch, int offset, int length) {
- setValues(ch, offset, length);
- } // <init>(char[],int,int)
-
- /**
- * Constructs an XMLString structure with copies of the values in
- * the given structure.
- * <p>
- * <strong>Note:</strong> This does not copy the character array;
- * only the reference to the array is copied.
- *
- * @param string The XMLString to copy.
- */
- public XMLString(XMLString string) {
- setValues(string);
- } // <init>(XMLString)
-
- //
- // Public methods
- //
-
- /**
- * Initializes the contents of the XMLString structure with the
- * specified values.
- *
- * @param ch The character array.
- * @param offset The offset into the character array.
- * @param length The length of characters from the offset.
- */
- public void setValues(char[] ch, int offset, int length) {
- this.ch = ch;
- this.offset = offset;
- this.length = length;
- } // setValues(char[],int,int)
-
- /**
- * Initializes the contents of the XMLString structure with copies
- * of the given string structure.
- * <p>
- * <strong>Note:</strong> This does not copy the character array;
- * only the reference to the array is copied.
- *
- * @param s
- */
- public void setValues(XMLString s) {
- setValues(s.ch, s.offset, s.length);
- } // setValues(XMLString)
-
- /** Resets all of the values to their defaults. */
- public void clear() {
- this.ch = null;
- this.offset = 0;
- this.length = -1;
- } // clear()
-
- /**
- * Returns true if the contents of this XMLString structure and
- * the specified array are equal.
- *
- * @param ch The character array.
- * @param offset The offset into the character array.
- * @param length The length of characters from the offset.
- */
- public boolean equals(char[] ch, int offset, int length) {
- if (ch == null) {
- return false;
- }
- if (this.length != length) {
- return false;
- }
-
- for (int i=0; i<length; i++) {
- if (this.ch[this.offset+i] != ch[offset+i] ) {
- return false;
- }
- }
- return true;
- } // equals(char[],int,int):boolean
-
- /**
- * Returns true if the contents of this XMLString structure and
- * the specified string are equal.
- *
- * @param s The string to compare.
- */
- public boolean equals(String s) {
- if (s == null) {
- return false;
- }
- if ( length != s.length() ) {
- return false;
- }
-
- // is this faster than call s.toCharArray first and compare the
- // two arrays directly, which will possibly involve creating a
- // new char array object.
- for (int i=0; i<length; i++) {
- if (ch[offset+i] != s.charAt(i)) {
- return false;
- }
- }
-
- return true;
- } // equals(String):boolean
-
- //
- // Object methods
- //
-
- /** Returns a string representation of this object. */
- public String toString() {
- return length > 0 ? new String(ch, offset, length) : "";
- } // toString():String
-
-} // class XMLString
diff --git a/src/com/sun/org/apache/xerces/internal/xni/XNIException.java b/src/com/sun/org/apache/xerces/internal/xni/XNIException.java
deleted file mode 100644
index 4247551..0000000
--- a/src/com/sun/org/apache/xerces/internal/xni/XNIException.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xni;
-
-/**
- * This exception is the base exception of all XNI exceptions. It
- * can be constructed with an error message or used to wrap another
- * exception object.
- * <p>
- * <strong>Note:</strong> By extending the Java
- * <code>RuntimeException</code>, XNI handlers and components are
- * not required to catch XNI exceptions but may explicitly catch
- * them, if so desired.
- *
- * @author Andy Clark, IBM
- *
- * @version $Id: XNIException.java,v 1.6 2010-11-01 04:40:19 joehw Exp $
- */
-public class XNIException
- extends RuntimeException {
-
- /** Serialization version. */
- static final long serialVersionUID = 9019819772686063775L;
-
- //
- // Data
- //
-
- /** The wrapped exception. */
- private Exception fException;
-
- //
- // Constructors
- //
-
- /**
- * Constructs an XNI exception with a message.
- *
- * @param message The exception message.
- */
- public XNIException(String message) {
- super(message);
- } // <init>(String)
-
- /**
- * Constructs an XNI exception with a wrapped exception.
- *
- * @param exception The wrapped exception.
- */
- public XNIException(Exception exception) {
- super(exception.getMessage());
- fException = exception;
- } // <init>(Exception)
-
- /**
- * Constructs an XNI exception with a message and wrapped exception.
- *
- * @param message The exception message.
- * @param exception The wrapped exception.
- */
- public XNIException(String message, Exception exception) {
- super(message);
- fException = exception;
- } // <init>(Exception,String)
-
- //
- // Public methods
- //
-
- /** Returns the wrapped exception. */
- public Exception getException() {
- return fException;
- } // getException():Exception
-
- public Throwable getCause() {
- return fException;
- }
-} // class QName
diff --git a/src/com/sun/org/apache/xerces/internal/xni/grammars/Grammar.java b/src/com/sun/org/apache/xerces/internal/xni/grammars/Grammar.java
deleted file mode 100644
index 95adbcd..0000000
--- a/src/com/sun/org/apache/xerces/internal/xni/grammars/Grammar.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2000-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xni.grammars;
-
-/**
- * A generic grammar for use in validating XML documents. The Grammar
- * object stores the validation information in a compiled form. Specific
- * subclasses extend this class and "populate" the grammar by compiling
- * the specific syntax (DTD, Schema, etc) into the data structures used
- * by this object.
- * <p>
- * <strong>Note:</strong> The Grammar object is not useful as a generic
- * grammar access or query object. In other words, you cannot round-trip
- * specific grammar syntaxes with the compiled grammar information in
- * the Grammar object. You <em>can</em> create equivalent validation
- * rules in your choice of grammar syntax but there is no guarantee that
- * the input and output will be the same.
- *
- * <p> Right now, this class is largely a shell; eventually,
- * it will be enriched by having more expressive methods added. </p>
- * will be moved from dtd.Grammar here.
- *
- * @author Jeffrey Rodriguez, IBM
- * @author Eric Ye, IBM
- * @author Andy Clark, IBM
- * @author Neil Graham, IBM
- *
- */
-
-public interface Grammar {
-
- /**
- * get the <code>XMLGrammarDescription</code> associated with this
- * object
- */
- public XMLGrammarDescription getGrammarDescription ();
-} // interface Grammar
diff --git a/src/com/sun/org/apache/xerces/internal/xni/grammars/XMLDTDDescription.java b/src/com/sun/org/apache/xerces/internal/xni/grammars/XMLDTDDescription.java
deleted file mode 100644
index 2b72668..0000000
--- a/src/com/sun/org/apache/xerces/internal/xni/grammars/XMLDTDDescription.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xni.grammars;
-
-/**
- * All information specific to DTD grammars.
- *
- * @author Sandy Gao, IBM
- */
-public interface XMLDTDDescription extends XMLGrammarDescription {
-
- /**
- * Return the root name of this DTD.
- *
- * @return the root name. null if the name is unknown.
- */
- public String getRootName();
-
-} // interface XMLDTDDescription
diff --git a/src/com/sun/org/apache/xerces/internal/xni/grammars/XMLGrammarDescription.java b/src/com/sun/org/apache/xerces/internal/xni/grammars/XMLGrammarDescription.java
deleted file mode 100644
index e5c83f2..0000000
--- a/src/com/sun/org/apache/xerces/internal/xni/grammars/XMLGrammarDescription.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2000-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xni.grammars;
-
-import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
-
-/**
- * <p> This interface describes basic attributes of XML grammars--their
- * physical location and their type. </p>
- *
- * @author Neil Graham, IBM
- */
-public interface XMLGrammarDescription extends XMLResourceIdentifier {
-
- // initial set of grammar constants that some configurations will recognize;user
- // components which create and/or recognize other types of grammars may
- // certainly use their own constants in place of these (so long as
- // their Grammar objects implement this interface).
-
- /**
- * The grammar type constant for XML Schema grammars. When getGrammarType()
- * method returns this constant, the object should be an instance of
- * the XMLSchemaDescription interface.
- */
- public static final String XML_SCHEMA = "http://www.w3.org/2001/XMLSchema";
-
- /**
- * The grammar type constant for DTD grammars. When getGrammarType()
- * method returns this constant, the object should be an instance of
- * the XMLDTDDescription interface.
- */
- public static final String XML_DTD = "http://www.w3.org/TR/REC-xml";
-
- /**
- * Return the type of this grammar.
- *
- * @return the type of this grammar
- */
- public String getGrammarType();
-
-} // interface XMLGrammarDescription
diff --git a/src/com/sun/org/apache/xerces/internal/xni/grammars/XMLGrammarLoader.java b/src/com/sun/org/apache/xerces/internal/xni/grammars/XMLGrammarLoader.java
deleted file mode 100644
index b8d3204..0000000
--- a/src/com/sun/org/apache/xerces/internal/xni/grammars/XMLGrammarLoader.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2000-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xni.grammars;
-
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLEntityResolver;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-
-import java.io.IOException;
-import java.util.Locale;
-
-/**
- * The intention of this interface is to provide a generic means
- * by which Grammar objects may be created without parsing instance
- * documents. Implementations of this interface will know how to load
- * specific types of grammars (e.g., DTD's or schemas); a wrapper
- * will be provided for user applications to interact with these implementations.
- *
- * @author Neil Graham, IBM
- */
-
-public interface XMLGrammarLoader {
-
- /**
- * Returns a list of feature identifiers that are recognized by
- * this XMLGrammarLoader. This method may return null if no features
- * are recognized.
- */
- public String[] getRecognizedFeatures();
-
- /**
- * Returns the state of a feature.
- *
- * @param featureId The feature identifier.
- *
- * @throws XMLConfigurationException Thrown on configuration error.
- */
- public boolean getFeature(String featureId)
- throws XMLConfigurationException;
-
- /**
- * Sets the state of a feature.
- *
- * @param featureId The feature identifier.
- * @param state The state of the feature.
- *
- * @throws XMLConfigurationException Thrown when a feature is not
- * recognized or cannot be set.
- */
- public void setFeature(String featureId,
- boolean state) throws XMLConfigurationException;
-
- /**
- * Returns a list of property identifiers that are recognized by
- * this XMLGrammarLoader. This method may return null if no properties
- * are recognized.
- */
- public String[] getRecognizedProperties();
-
- /**
- * Returns the state of a property.
- *
- * @param propertyId The property identifier.
- *
- * @throws XMLConfigurationException Thrown on configuration error.
- */
- public Object getProperty(String propertyId)
- throws XMLConfigurationException;
-
- /**
- * Sets the state of a property.
- *
- * @param propertyId The property identifier.
- * @param state The state of the property.
- *
- * @throws XMLConfigurationException Thrown when a property is not
- * recognized or cannot be set.
- */
- public void setProperty(String propertyId,
- Object state) throws XMLConfigurationException;
-
- /**
- * Set the locale to use for messages.
- *
- * @param locale The locale object to use for localization of messages.
- *
- * @exception XNIException Thrown if the parser does not support the
- * specified locale.
- */
- public void setLocale(Locale locale);
-
- /** Return the Locale the XMLGrammarLoader is using. */
- public Locale getLocale();
-
- /**
- * Sets the error handler.
- *
- * @param errorHandler The error handler.
- */
- public void setErrorHandler(XMLErrorHandler errorHandler);
-
- /** Returns the registered error handler. */
- public XMLErrorHandler getErrorHandler();
-
- /**
- * Sets the entity resolver.
- *
- * @param entityResolver The new entity resolver.
- */
- public void setEntityResolver(XMLEntityResolver entityResolver);
-
- /** Returns the registered entity resolver. */
- public XMLEntityResolver getEntityResolver();
-
- /**
- * Returns a Grammar object by parsing the contents of the
- * entity pointed to by source.
- *
- * @param source the location of the entity which forms
- * the starting point of the grammar to be constructed.
- * @throws IOException When a problem is encountered reading the entity
- * XNIException When a condition arises (such as a FatalError) that requires parsing
- * of the entity be terminated.
- */
- public Grammar loadGrammar(XMLInputSource source)
- throws IOException, XNIException;
-} // XMLGrammarLoader
diff --git a/src/com/sun/org/apache/xerces/internal/xni/grammars/XMLGrammarPool.java b/src/com/sun/org/apache/xerces/internal/xni/grammars/XMLGrammarPool.java
deleted file mode 100644
index bd947b5..0000000
--- a/src/com/sun/org/apache/xerces/internal/xni/grammars/XMLGrammarPool.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2000-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xerces.internal.xni.grammars;
-
-/**
- * <p> This interface specifies how the parser and the application
- * interact with respect to Grammar objects that the application
- * possesses--either by having precompiled them or by having stored them
- * from a previous validation of an instance document. It makes no
- * assumptions about the kind of Grammar involved, or about how the
- * application's storage mechanism works.</p>
- *
- * <p>The interaction works as follows:
- * <ul>
- * <li>When a validator considers a document, it is expected to request
- * grammars of the type it can handle from this object using the
- * <code>retrieveInitialGrammarSet</code> method. </li>
- * <li>If it requires a grammar
- * not in this set, it will request it from this Object using the
- * <code>retrieveGrammar</code> method. </li>
- * <li> After successfully validating an
- * instance, the validator should make any new grammars it has compiled
- * available to this object using the <code>cacheGrammars</code>
- * method; for ease of implementation it may make other Grammars it holds references to as well (i.e.,
- * it may return some grammars that were retrieved from the GrammarPool in earlier operations). </li> </ul> </p>
- *
- * @author Neil Graham, IBM
- */
-
-public interface XMLGrammarPool {
-
- // <p>we are trying to make this XMLGrammarPool work for all kinds of
- // grammars, so we have a parameter "grammarType" for each of the
- // methods. </p>
-
- /**
- * <p> retrieve the initial known set of grammars. this method is
- * called by a validator before the validation starts. the application
- * can provide an initial set of grammars available to the current
- * validation attempt. </p>
- * @param grammarType the type of the grammar, from the
- * <code>com.sun.org.apache.xerces.internal.xni.grammars.Grammar</code> interface.
- * @return the set of grammars the validator may put in its "bucket"
- */
- public Grammar[] retrieveInitialGrammarSet(String grammarType);
-
- /**
- * <p>return the final set of grammars that the validator ended up
- * with.
- * This method is called after the
- * validation finishes. The application may then choose to cache some
- * of the returned grammars. </p>
- * @param grammarType the type of the grammars being returned;
- * @param grammars an array containing the set of grammars being
- * returned; order is not significant.
- */
- public void cacheGrammars(String grammarType, Grammar[] grammars);
-
- /**
- * <p> This method requests that the application retrieve a grammar
- * corresponding to the given GrammarIdentifier from its cache.
- * If it cannot do so it must return null; the parser will then
- * call the EntityResolver. <strong>An application must not call its
- * EntityResolver itself from this method; this may result in infinite
- * recursions.</strong>
- * @param desc The description of the Grammar being requested.
- * @return the Grammar corresponding to this description or null if
- * no such Grammar is known.
- */
- public Grammar retrieveGrammar(XMLGrammarDescription desc);
-
- /**
- * Causes the XMLGrammarPool not to store any grammars when
- * the cacheGrammars(String, Grammar[[]) method is called.
- */
- public void lockPool();
-
- /**
- * Allows the XMLGrammarPool to store grammars when its cacheGrammars(String, Grammar[])
- * method is called. This is the default state of the object.
- */
- public void unlockPool();
-
- /**
- * Removes all grammars from the pool.
- */
- public void clear();
-} // XMLGrammarPool
diff --git a/src/com/sun/org/apache/xerces/internal/xni/grammars/XMLSchemaDescription.java b/src/com/sun/org/apache/xerces/internal/xni/grammars/XMLSchemaDescription.java
deleted file mode 100644
index bc38a2f..0000000
--- a/src/com/sun/org/apache/xerces/internal/xni/grammars/XMLSchemaDescription.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2002,2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xni.grammars;
-
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
-
-/**
- * All information specific to XML Schema grammars.
- *
- * @author Sandy Gao, IBM
- *
- */
-public interface XMLSchemaDescription extends XMLGrammarDescription {
-
- // used to indicate what triggered the call
- /**
- * Indicate that the current schema document is &lt;include&gt;d by another
- * schema document.
- */
- public final static short CONTEXT_INCLUDE = 0;
- /**
- * Indicate that the current schema document is &lt;redefine&gt;d by another
- * schema document.
- */
- public final static short CONTEXT_REDEFINE = 1;
- /**
- * Indicate that the current schema document is &lt;import&gt;ed by another
- * schema document.
- */
- public final static short CONTEXT_IMPORT = 2;
- /**
- * Indicate that the current schema document is being preparsed.
- */
- public final static short CONTEXT_PREPARSE = 3;
- /**
- * Indicate that the parse of the current schema document is triggered
- * by xsi:schemaLocation/noNamespaceSchemaLocation attribute(s) in the
- * instance document. This value is only used if we don't defer the loading
- * of schema documents.
- */
- public final static short CONTEXT_INSTANCE = 4;
- /**
- * Indicate that the parse of the current schema document is triggered by
- * the occurrence of an element whose namespace is the target namespace
- * of this schema document. This value is only used if we do defer the
- * loading of schema documents until a component from that namespace is
- * referenced from the instance.
- */
- public final static short CONTEXT_ELEMENT = 5;
- /**
- * Indicate that the parse of the current schema document is triggered by
- * the occurrence of an attribute whose namespace is the target namespace
- * of this schema document. This value is only used if we do defer the
- * loading of schema documents until a component from that namespace is
- * referenced from the instance.
- */
- public final static short CONTEXT_ATTRIBUTE = 6;
- /**
- * Indicate that the parse of the current schema document is triggered by
- * the occurrence of an "xsi:type" attribute, whose value (a QName) has
- * the target namespace of this schema document as its namespace.
- * This value is only used if we do defer the loading of schema documents
- * until a component from that namespace is referenced from the instance.
- */
- public final static short CONTEXT_XSITYPE = 7;
-
- /**
- * Get the context. The returned value is one of the pre-defined
- * CONTEXT_xxx constants.
- *
- * @return the value indicating the context
- */
- public short getContextType();
-
- /**
- * If the context is "include" or "redefine", then return the target
- * namespace of the enclosing schema document; otherwise, the expected
- * target namespace of this document.
- *
- * @return the expected/enclosing target namespace
- */
- public String getTargetNamespace();
-
- /**
- * For import and references from the instance document, it's possible to
- * have multiple hints for one namespace. So this method returns an array,
- * which contains all location hints.
- *
- * @return an array of all location hints associated to the expected
- * target namespace
- */
- public String[] getLocationHints();
-
- /**
- * If a call is triggered by an element/attribute/xsi:type in the instance,
- * this call returns the name of such triggering component: the name of
- * the element/attribute, or the value of the xsi:type.
- *
- * @return the name of the triggering component
- */
- public QName getTriggeringComponent();
-
- /**
- * If a call is triggered by an attribute or xsi:type, then this method
- * returns the enclosing element of such element.
- *
- * @return the name of the enclosing element
- */
- public QName getEnclosingElementName();
-
- /**
- * If a call is triggered by an element/attribute/xsi:type in the instance,
- * this call returns all attribute of such element (or enclosing element).
- *
- * @return all attributes of the tiggering/enclosing element
- */
- public XMLAttributes getAttributes();
-
-} // XSDDescription
diff --git a/src/com/sun/org/apache/xerces/internal/xni/grammars/XSGrammar.java b/src/com/sun/org/apache/xerces/internal/xni/grammars/XSGrammar.java
deleted file mode 100644
index 4455951..0000000
--- a/src/com/sun/org/apache/xerces/internal/xni/grammars/XSGrammar.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xni.grammars;
-
-import com.sun.org.apache.xerces.internal.xs.XSModel;
-
-/**
- * Representing a schema grammar. It contains declaratoin/definitions from
- * a certain namespace. When a grammar is preparsed, and its grammar type is
- * XML Schema, it can be casted to this interface. Objects of this interface
- * can be converted to XSModel, from which further information about components
- * in this grammar can be obtained.
- *
- * @author Sandy Gao, IBM
- *
- */
-public interface XSGrammar extends Grammar {
-
- /**
- * Return an <code>XSModel</code> that represents components in this schema
- * grammar and any schema grammars that are imported by this grammar
- * directly or indirectly.
- *
- * @return an <code>XSModel</code> representing this schema grammar
- */
- public XSModel toXSModel();
-
- /**
- * Return an <code>XSModel</code> that represents components in this schema
- * grammar and the grammars in the <code>grammars</code>parameter,
- * any schema grammars that are imported by them directly or indirectly.
- *
- * @return an <code>XSModel</code> representing these schema grammars
- */
- public XSModel toXSModel(XSGrammar[] grammars);
-
-} // interface XSGrammar
diff --git a/src/com/sun/org/apache/xerces/internal/xni/parser/XMLComponent.java b/src/com/sun/org/apache/xerces/internal/xni/parser/XMLComponent.java
deleted file mode 100644
index 68b2faa..0000000
--- a/src/com/sun/org/apache/xerces/internal/xni/parser/XMLComponent.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2000-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xni.parser;
-
-/**
- * The component interface defines methods that must be implemented
- * by components in a parser configuration. The component methods allow
- * the component manager to initialize the component state and notify
- * the component when feature and property values change.
- *
- * @see XMLComponentManager
- *
- * @author Andy Clark, IBM
- *
- */
-public interface XMLComponent {
-
- //
- // XMLComponent methods
- //
-
- /**
- * Resets the component. The component can query the component manager
- * about any features and properties that affect the operation of the
- * component.
- *
- * @param componentManager The component manager.
- *
- * @throws XNIException Thrown by component on initialization error.
- */
- public void reset(XMLComponentManager componentManager)
- throws XMLConfigurationException;
-
- /**
- * Returns a list of feature identifiers that are recognized by
- * this component. This method may return null if no features
- * are recognized by this component.
- */
- public String[] getRecognizedFeatures();
-
- /**
- * Sets the state of a feature. This method is called by the component
- * manager any time after reset when a feature changes state.
- * <p>
- * <strong>Note:</strong> Components should silently ignore features
- * that do not affect the operation of the component.
- *
- * @param featureId The feature identifier.
- * @param state The state of the feature.
- *
- * @throws XMLConfigurationException Thrown for configuration error.
- * In general, components should
- * only throw this exception if
- * it is <strong>really</strong>
- * a critical error.
- */
- public void setFeature(String featureId, boolean state)
- throws XMLConfigurationException;
-
- /**
- * Returns a list of property identifiers that are recognized by
- * this component. This method may return null if no properties
- * are recognized by this component.
- */
- public String[] getRecognizedProperties();
-
- /**
- * Sets the value of a property. This method is called by the component
- * manager any time after reset when a property changes value.
- * <p>
- * <strong>Note:</strong> Components should silently ignore properties
- * that do not affect the operation of the component.
- *
- * @param propertyId The property identifier.
- * @param value The value of the property.
- *
- * @throws XMLConfigurationException Thrown for configuration error.
- * In general, components should
- * only throw this exception if
- * it is <strong>really</strong>
- * a critical error.
- */
- public void setProperty(String propertyId, Object value)
- throws XMLConfigurationException;
-
- /**
- * Returns the default state for a feature, or null if this
- * component does not want to report a default value for this
- * feature.
- *
- * @param featureId The feature identifier.
- *
- * @since Xerces 2.2.0
- */
- public Boolean getFeatureDefault(String featureId);
-
- /**
- * Returns the default state for a property, or null if this
- * component does not want to report a default value for this
- * property.
- *
- * @param propertyId The property identifier.
- *
- * @since Xerces 2.2.0
- */
- public Object getPropertyDefault(String propertyId);
-
-} // interface XMLComponent
diff --git a/src/com/sun/org/apache/xerces/internal/xni/parser/XMLComponentManager.java b/src/com/sun/org/apache/xerces/internal/xni/parser/XMLComponentManager.java
deleted file mode 100644
index 80faa6a..0000000
--- a/src/com/sun/org/apache/xerces/internal/xni/parser/XMLComponentManager.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2000-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xni.parser;
-
-import com.sun.org.apache.xerces.internal.util.FeatureState;
-import com.sun.org.apache.xerces.internal.util.PropertyState;
-
-/**
- * The component manager manages a parser configuration and the components
- * that make up that configuration. The manager notifies each component
- * before parsing to allow the components to initialize their state; and
- * also any time that a parser feature or property changes.
- * <p>
- * The methods of the component manager allow components to query features
- * and properties that affect the operation of the component.
- *
- * @see XMLComponent
- *
- * @author Andy Clark, IBM
- *
- * @version $Id: XMLComponentManager.java,v 1.6 2010-11-01 04:40:22 joehw Exp $
- */
-public interface XMLComponentManager {
-
- //
- // XMLComponentManager methods
- //
-
- /**
- * Returns the state of a feature.
- *
- * @param featureId The feature identifier.
- *
- * @throws XMLConfigurationException Thrown on configuration error.
- */
- public boolean getFeature(String featureId)
- throws XMLConfigurationException;
-
- /**
- * Returns the state of a feature.
- * Does not throw exceptions.
- *
- * @param featureId The feature identifier.
- * @param defaultValue Default value if future is not available.
- */
- public boolean getFeature(String featureId, boolean defaultValue);
-
- /**
- * Returns the value of a property.
- *
- * @param propertyId The property identifier.
- *
- * @throws XMLConfigurationException Thrown on configuration error.
- */
- public Object getProperty(String propertyId)
- throws XMLConfigurationException;
-
- /**
- * Returns the value of a property.
- * Does not throw exceptions.
- *
- * @param propertyId The property identifier.
- * @param defaultObject Return value if property is not available.
- *
- */
- public Object getProperty(String propertyId, Object defaultObject);
-
- public FeatureState getFeatureState(String featureId);
-
- public PropertyState getPropertyState(String propertyId);
-
-} // interface XMLComponentManager
diff --git a/src/com/sun/org/apache/xerces/internal/xni/parser/XMLConfigurationException.java b/src/com/sun/org/apache/xerces/internal/xni/parser/XMLConfigurationException.java
deleted file mode 100644
index b1cd779..0000000
--- a/src/com/sun/org/apache/xerces/internal/xni/parser/XMLConfigurationException.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xni.parser;
-
-import com.sun.org.apache.xerces.internal.util.Status;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-
-/**
- * An XNI parser configuration exception. This exception class extends
- * <code>XNIException</code> in order to differentiate between general
- * parsing errors and configuration errors.
- *
- * @author Andy Clark, IBM
- *
- * @version $Id: XMLConfigurationException.java,v 1.7 2010-11-01 04:40:22 joehw Exp $
- */
-public class XMLConfigurationException
- extends XNIException {
-
- /** Serialization version. */
- static final long serialVersionUID = -5437427404547669188L;
-
- //
- // Data
- //
-
- /** Exception type. */
- protected Status fType;
-
- /** Identifier. */
- protected String fIdentifier;
-
- //
- // Constructors
- //
-
- /**
- * Constructs a configuration exception with the specified type
- * and feature/property identifier.
- *
- * @param type The type of the exception.
- * @param identifier The feature or property identifier.
- */
- public XMLConfigurationException(Status type, String identifier) {
- super(identifier);
- fType = type;
- fIdentifier = identifier;
- } // <init>(short,String)
-
- /**
- * Constructs a configuration exception with the specified type,
- * feature/property identifier, and error message
- *
- * @param type The type of the exception.
- * @param identifier The feature or property identifier.
- * @param message The error message.
- */
- public XMLConfigurationException(Status type, String identifier,
- String message) {
- super(message);
- fType = type;
- fIdentifier = identifier;
- } // <init>(short,String,String)
-
- //
- // Public methods
- //
-
- /**
- * Returns the exception type.
- */
- public Status getType() {
- return fType;
- } // getType():short
-
- /** Returns the feature or property identifier. */
- public String getIdentifier() {
- return fIdentifier;
- } // getIdentifier():String
-
-} // class XMLConfigurationException
diff --git a/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDContentModelFilter.java b/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDContentModelFilter.java
deleted file mode 100644
index 77e71f0..0000000
--- a/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDContentModelFilter.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xni.parser;
-
-import com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler;
-
-/**
- * Defines a DTD content model filter that acts as both a receiver and
- * an emitter of DTD content model events.
- *
- * @author Andy Clark, IBM
- *
- */
-public interface XMLDTDContentModelFilter
- extends XMLDTDContentModelHandler, XMLDTDContentModelSource {
-
-} // interface XMLDTDContentModelFilter
diff --git a/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDContentModelSource.java b/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDContentModelSource.java
deleted file mode 100644
index dca3bd9..0000000
--- a/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDContentModelSource.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001, 2002 The Apache Software Foundation.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xerces" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, International
- * Business Machines, Inc., http://www.apache.org. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-package com.sun.org.apache.xerces.internal.xni.parser;
-
-import com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler;
-
-/**
- * Defines a DTD content model source. In other words, any object that
- * implements this interface is able to emit DTD content model "events"
- * to the registered DTD content model handler. These events could be
- * produced by parsing an XML document's internal or external subset,
- * could be generated from some other source, or could be created
- * programmatically. This interface does not say <em>how</em> the events
- * are created, only that the implementor is able to emit them.
- *
- * @author Andy Clark, IBM
- *
- */
-public interface XMLDTDContentModelSource {
-
- //
- // XMLDTDContentModelSource methods
- //
-
- /** Sets the DTD content model handler. */
- public void setDTDContentModelHandler(XMLDTDContentModelHandler handler);
-
- /** Returns the DTD content model handler. */
- public XMLDTDContentModelHandler getDTDContentModelHandler( );
-
-} // interface XMLDTDContentModelSource
diff --git a/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDFilter.java b/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDFilter.java
deleted file mode 100644
index f30932f..0000000
--- a/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDFilter.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xni.parser;
-
-import com.sun.org.apache.xerces.internal.xni.XMLDTDHandler;
-
-/**
- * Defines a DTD filter that acts as both a receiver and an emitter
- * of DTD events.
- *
- * @author Andy Clark, IBM
- *
- */
-public interface XMLDTDFilter
- extends XMLDTDHandler, XMLDTDSource {
-
-} // interface XMLDTDFilter
diff --git a/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDScanner.java b/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDScanner.java
deleted file mode 100644
index 189152d..0000000
--- a/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDScanner.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xni.parser;
-
-import com.sun.org.apache.xerces.internal.utils.XMLLimitAnalyzer;
-import java.io.IOException;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-
-/**
- * This interface defines a generic DTD scanner. This interface
- * allows a scanner to be used interchangably in existing parser
- * configurations.
- * <p>
- * If the parser configuration uses a DTD scanner that implements
- * this interface, components should be able to query the scanner
- * instance from the component manager using the following property
- * identifier:
- * <blockquote>
- * "http://apache.org/xml/properties/internal/dtd-scanner"
- * </blockquote>
- *
- * @author Andy Clark, IBM
- *
- */
-public interface XMLDTDScanner
- extends XMLDTDSource, XMLDTDContentModelSource {
-
- //
- // XMLDTDScanner methods
- //
-
- /**
- * Sets the input source.
- *
- * @param inputSource The input source or null.
- *
- * @throws IOException Thrown on i/o error.
- */
- public void setInputSource(XMLInputSource inputSource) throws IOException;
-
- /**
- * Scans the internal subset of the document.
- *
- * @param complete True if the scanner should scan the document
- * completely, pushing all events to the registered
- * document handler. A value of false indicates that
- * that the scanner should only scan the next portion
- * of the document and return. A scanner instance is
- * permitted to completely scan a document if it does
- * not support this "pull" scanning model.
- * @param standalone True if the document was specified as standalone.
- * This value is important for verifying certain
- * well-formedness constraints.
- * @param hasExternalSubset True if the document has an external DTD.
- * This allows the scanner to properly notify
- * the handler of the end of the DTD in the
- * absence of an external subset.
- *
- * @return True if there is more to scan, false otherwise.
- */
- public boolean scanDTDInternalSubset(boolean complete, boolean standalone,
- boolean hasExternalSubset)
- throws IOException, XNIException;
-
- /**
- * Scans the external subset of the document.
- *
- * @param complete True if the scanner should scan the document
- * completely, pushing all events to the registered
- * document handler. A value of false indicates that
- * that the scanner should only scan the next portion
- * of the document and return. A scanner instance is
- * permitted to completely scan a document if it does
- * not support this "pull" scanning model.
- *
- * @return True if there is more to scan, false otherwise.
- */
- public boolean scanDTDExternalSubset(boolean complete)
- throws IOException, XNIException;
-
- /**
- * Skip the DTD if javax.xml.stream.supportDTD is false.
- * @param supportDTD The value of the property javax.xml.stream.supportDTD.
- * @return true if DTD is skipped, false otherwise.
- * @throws java.io.IOException if i/o error occurs
- */
- public boolean skipDTD(boolean supportDTD)
- throws IOException;
-
- public void setLimitAnalyzer(XMLLimitAnalyzer limitAnalyzer);
-} // interface XMLDTDScanner
diff --git a/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDSource.java b/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDSource.java
deleted file mode 100644
index 1f2c312..0000000
--- a/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDSource.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xni.parser;
-
-import com.sun.org.apache.xerces.internal.xni.XMLDTDHandler;
-
-/**
- * Defines a DTD source. In other words, any object that implements
- * this interface is able to emit DTD "events" to the registered
- * DTD handler. These events could be produced by parsing an XML
- * document's internal or external subset, could be generated from
- * some other source, or could be created programmatically. This
- * interface does not say <em>how</em> the events are created, only
- * that the implementor is able to emit them.
- *
- * @author Andy Clark, IBM
- *
- */
-public interface XMLDTDSource {
-
- //
- // XMLDTDSource methods
- //
-
- /** Sets the DTD handler. */
- public void setDTDHandler(XMLDTDHandler handler);
-
- /** Returns the DTD handler. */
- public XMLDTDHandler getDTDHandler();
-
-} // interface XMLDTDSource
diff --git a/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDocumentFilter.java b/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDocumentFilter.java
deleted file mode 100644
index 1eb55f4..0000000
--- a/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDocumentFilter.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xni.parser;
-
-import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
-
-/**
- * Defines a document filter that acts as both a receiver and an emitter
- * of document events.
- *
- * @author Andy Clark, IBM
- *
- */
-public interface XMLDocumentFilter
- extends XMLDocumentHandler, XMLDocumentSource {
-
-
-} // interface XMLDocumentFilter
diff --git a/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDocumentScanner.java b/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDocumentScanner.java
deleted file mode 100644
index 9fa5248..0000000
--- a/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDocumentScanner.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xni.parser;
-
-import java.io.IOException;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-
-/**
- * This interface defines a generic document scanner. This interface
- * allows a scanner to be used interchangably in existing parser
- * configurations.
- * <p>
- * If the parser configuration uses a document scanner that implements
- * this interface, components should be able to query the scanner
- * instance from the component manager using the following property
- * identifier:
- * <blockquote>
- * "http://apache.org/xml/properties/internal/document-scanner"
- * </blockquote>
- *
- * @author Andy Clark, IBM
- *
- */
-public interface XMLDocumentScanner
- extends XMLDocumentSource {
-
- //
- // XMLDocumentScanner methods
- //
-
- /**
- * Sets the input source.
- *
- * @param inputSource The input source.
- *
- * @throws IOException Thrown on i/o error.
- */
- public void setInputSource(XMLInputSource inputSource) throws IOException;
-
- /**
- * Scans a document.
- *
- * @param complete True if the scanner should scan the document
- * completely, pushing all events to the registered
- * document handler. A value of false indicates that
- * that the scanner should only scan the next portion
- * of the document and return. A scanner instance is
- * permitted to completely scan a document if it does
- * not support this "pull" scanning model.
- *
- * @return True if there is more to scan, false otherwise.
- */
- public boolean scanDocument(boolean complete)
- throws IOException, XNIException;
-
- public int next() throws XNIException, IOException;
-} // interface XMLDocumentScanner
diff --git a/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDocumentSource.java b/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDocumentSource.java
deleted file mode 100644
index 217b515..0000000
--- a/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDocumentSource.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xni.parser;
-
-import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
-
-/**
- * Defines a document source. In other words, any object that implements
- * this interface is able to emit document "events" to the registered
- * document handler. These events could be produced by parsing an XML
- * document, could be generated from some other source, or could be
- * created programmatically. This interface does not say <em>how</em>
- * the events are created, only that the implementor is able to emit
- * them.
- *
- * @author Andy Clark, IBM
- *
- */
-public interface XMLDocumentSource {
-
- //
- // XMLDocumentSource methods
- //
-
- /** Sets the document handler. */
- public void setDocumentHandler(XMLDocumentHandler handler);
-
- /** Returns the document handler */
- public XMLDocumentHandler getDocumentHandler();
-
-} // interface XMLDocumentSource
diff --git a/src/com/sun/org/apache/xerces/internal/xni/parser/XMLEntityResolver.java b/src/com/sun/org/apache/xerces/internal/xni/parser/XMLEntityResolver.java
deleted file mode 100644
index c39671f..0000000
--- a/src/com/sun/org/apache/xerces/internal/xni/parser/XMLEntityResolver.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xni.parser;
-
-import java.io.IOException;
-
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
-
-/**
- * This interface is used to resolve external parsed entities. The
- * application can register an object that implements this interface
- * with the parser configuration in order to intercept entities and
- * resolve them explicitly. If the registered entity resolver cannot
- * resolve the entity, it should return <code>null</code> so that the
- * parser will try to resolve the entity using a default mechanism.
- *
- * @see XMLParserConfiguration
- *
- * @author Andy Clark, IBM
- *
- */
-public interface XMLEntityResolver {
-
- //
- // XMLEntityResolver methods
- //
-
- /**
- * Resolves an external parsed entity. If the entity cannot be
- * resolved, this method should return null.
- *
- * @param resourceIdentifier location of the XML resource to resolve
- *
- * @throws XNIException Thrown on general error.
- * @throws IOException Thrown if resolved entity stream cannot be
- * opened or some other i/o error occurs.
- * @see com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier
- */
- public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier)
- throws XNIException, IOException;
-
-} // interface XMLEntityResolver
diff --git a/src/com/sun/org/apache/xerces/internal/xni/parser/XMLErrorHandler.java b/src/com/sun/org/apache/xerces/internal/xni/parser/XMLErrorHandler.java
deleted file mode 100644
index 47b77ba..0000000
--- a/src/com/sun/org/apache/xerces/internal/xni/parser/XMLErrorHandler.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xni.parser;
-
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-
-/**
- * An interface for handling errors. If the application is interested
- * in error notifications, then it can register an error handler object
- * that implements this interface with the parser configuration.
- *
- * @see XMLParserConfiguration
- *
- * @author Andy Clark, IBM
- *
- */
-public interface XMLErrorHandler {
-
- //
- // XMLErrorHandler methods
- //
-
- /**
- * Reports a warning. Warnings are non-fatal and can be safely ignored
- * by most applications.
- *
- * @param domain The domain of the warning. The domain can be any
- * string but is suggested to be a valid URI. The
- * domain can be used to conveniently specify a web
- * site location of the relevent specification or
- * document pertaining to this warning.
- * @param key The warning key. This key can be any string and
- * is implementation dependent.
- * @param exception Exception.
- *
- * @throws XNIException Thrown to signal that the parser should stop
- * parsing the document.
- */
- public void warning(String domain, String key,
- XMLParseException exception) throws XNIException;
-
- /**
- * Reports an error. Errors are non-fatal and usually signify that the
- * document is invalid with respect to its grammar(s).
- *
- * @param domain The domain of the error. The domain can be any
- * string but is suggested to be a valid URI. The
- * domain can be used to conveniently specify a web
- * site location of the relevent specification or
- * document pertaining to this error.
- * @param key The error key. This key can be any string and
- * is implementation dependent.
- * @param exception Exception.
- *
- * @throws XNIException Thrown to signal that the parser should stop
- * parsing the document.
- */
- public void error(String domain, String key,
- XMLParseException exception) throws XNIException;
-
- /**
- * Report a fatal error. Fatal errors usually occur when the document
- * is not well-formed and signifies that the parser cannot continue
- * normal operation.
- * <p>
- * <strong>Note:</strong> The error handler should <em>always</em>
- * throw an <code>XNIException</code> from this method. This exception
- * can either be the same exception that is passed as a parameter to
- * the method or a new XNI exception object. If the registered error
- * handler fails to throw an exception, the continuing operation of
- * the parser is undetermined.
- *
- * @param domain The domain of the fatal error. The domain can be
- * any string but is suggested to be a valid URI. The
- * domain can be used to conveniently specify a web
- * site location of the relevent specification or
- * document pertaining to this fatal error.
- * @param key The fatal error key. This key can be any string
- * and is implementation dependent.
- * @param exception Exception.
- *
- * @throws XNIException Thrown to signal that the parser should stop
- * parsing the document.
- */
- public void fatalError(String domain, String key,
- XMLParseException exception) throws XNIException;
-
-} // interface XMLErrorHandler
diff --git a/src/com/sun/org/apache/xerces/internal/xni/parser/XMLInputSource.java b/src/com/sun/org/apache/xerces/internal/xni/parser/XMLInputSource.java
deleted file mode 100644
index 2ae99a6..0000000
--- a/src/com/sun/org/apache/xerces/internal/xni/parser/XMLInputSource.java
+++ /dev/null
@@ -1,254 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2000-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xni.parser;
-
-import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
-
-import java.io.InputStream;
-import java.io.Reader;
-
-/**
- * This class represents an input source for an XML document. The
- * basic properties of an input source are the following:
- * <ul>
- * <li>public identifier</li>
- * <li>system identifier</li>
- * <li>byte stream or character stream</li>
- * <li>
- * </ul>
- *
- * @author Andy Clark, IBM
- *
- */
-public class XMLInputSource {
-
- //
- // Data
- //
-
- /** Public identifier. */
- protected String fPublicId;
-
- /** System identifier. */
- protected String fSystemId;
-
- /** Base system identifier. */
- protected String fBaseSystemId;
-
- /** Byte stream. */
- protected InputStream fByteStream;
-
- /** Character stream. */
- protected Reader fCharStream;
-
- /** Encoding. */
- protected String fEncoding;
-
- //
- // Constructors
- //
-
- /**
- * Constructs an input source from just the public and system
- * identifiers, leaving resolution of the entity and opening of
- * the input stream up to the caller.
- *
- * @param publicId The public identifier, if known.
- * @param systemId The system identifier. This value should
- * always be set, if possible, and can be
- * relative or absolute. If the system identifier
- * is relative, then the base system identifier
- * should be set.
- * @param baseSystemId The base system identifier. This value should
- * always be set to the fully expanded URI of the
- * base system identifier, if possible.
- */
- public XMLInputSource(String publicId, String systemId,
- String baseSystemId) {
- fPublicId = publicId;
- fSystemId = systemId;
- fBaseSystemId = baseSystemId;
- } // <init>(String,String,String)
-
- /**
- * Constructs an input source from a XMLResourceIdentifier
- * object, leaving resolution of the entity and opening of
- * the input stream up to the caller.
- *
- * @param resourceIdentifier the XMLResourceIdentifier containing the information
- */
- public XMLInputSource(XMLResourceIdentifier resourceIdentifier) {
-
- fPublicId = resourceIdentifier.getPublicId();
- fSystemId = resourceIdentifier.getLiteralSystemId();
- fBaseSystemId = resourceIdentifier.getBaseSystemId();
- } // <init>(XMLResourceIdentifier)
-
- /**
- * Constructs an input source from a byte stream.
- *
- * @param publicId The public identifier, if known.
- * @param systemId The system identifier. This value should
- * always be set, if possible, and can be
- * relative or absolute. If the system identifier
- * is relative, then the base system identifier
- * should be set.
- * @param baseSystemId The base system identifier. This value should
- * always be set to the fully expanded URI of the
- * base system identifier, if possible.
- * @param byteStream The byte stream.
- * @param encoding The encoding of the byte stream, if known.
- */
- public XMLInputSource(String publicId, String systemId,
- String baseSystemId, InputStream byteStream,
- String encoding) {
- fPublicId = publicId;
- fSystemId = systemId;
- fBaseSystemId = baseSystemId;
- fByteStream = byteStream;
- fEncoding = encoding;
- } // <init>(String,String,String,InputStream,String)
-
- /**
- * Constructs an input source from a character stream.
- *
- * @param publicId The public identifier, if known.
- * @param systemId The system identifier. This value should
- * always be set, if possible, and can be
- * relative or absolute. If the system identifier
- * is relative, then the base system identifier
- * should be set.
- * @param baseSystemId The base system identifier. This value should
- * always be set to the fully expanded URI of the
- * base system identifier, if possible.
- * @param charStream The character stream.
- * @param encoding The original encoding of the byte stream
- * used by the reader, if known.
- */
- public XMLInputSource(String publicId, String systemId,
- String baseSystemId, Reader charStream,
- String encoding) {
- fPublicId = publicId;
- fSystemId = systemId;
- fBaseSystemId = baseSystemId;
- fCharStream = charStream;
- fEncoding = encoding;
- } // <init>(String,String,String,Reader,String)
-
- //
- // Public methods
- //
-
- /**
- * Sets the public identifier.
- *
- * @param publicId The new public identifier.
- */
- public void setPublicId(String publicId) {
- fPublicId = publicId;
- } // setPublicId(String)
-
- /** Returns the public identifier. */
- public String getPublicId() {
- return fPublicId;
- } // getPublicId():String
-
- /**
- * Sets the system identifier.
- *
- * @param systemId The new system identifier.
- */
- public void setSystemId(String systemId) {
- fSystemId = systemId;
- } // setSystemId(String)
-
- /** Returns the system identifier. */
- public String getSystemId() {
- return fSystemId;
- } // getSystemId():String
-
- /**
- * Sets the base system identifier.
- *
- * @param baseSystemId The new base system identifier.
- */
- public void setBaseSystemId(String baseSystemId) {
- fBaseSystemId = baseSystemId;
- } // setBaseSystemId(String)
-
- /** Returns the base system identifier. */
- public String getBaseSystemId() {
- return fBaseSystemId;
- } // getBaseSystemId():String
-
- /**
- * Sets the byte stream. If the byte stream is not already opened
- * when this object is instantiated, then the code that opens the
- * stream should also set the byte stream on this object. Also, if
- * the encoding is auto-detected, then the encoding should also be
- * set on this object.
- *
- * @param byteStream The new byte stream.
- */
- public void setByteStream(InputStream byteStream) {
- fByteStream = byteStream;
- } // setByteStream(InputSource)
-
- /** Returns the byte stream. */
- public InputStream getByteStream() {
- return fByteStream;
- } // getByteStream():InputStream
-
- /**
- * Sets the character stream. If the character stream is not already
- * opened when this object is instantiated, then the code that opens
- * the stream should also set the character stream on this object.
- * Also, the encoding of the byte stream used by the reader should
- * also be set on this object, if known.
- *
- * @param charStream The new character stream.
- *
- * @see #setEncoding
- */
- public void setCharacterStream(Reader charStream) {
- fCharStream = charStream;
- } // setCharacterStream(Reader)
-
- /** Returns the character stream. */
- public Reader getCharacterStream() {
- return fCharStream;
- } // getCharacterStream():Reader
-
- /**
- * Sets the encoding of the stream.
- *
- * @param encoding The new encoding.
- */
- public void setEncoding(String encoding) {
- fEncoding = encoding;
- } // setEncoding(String)
-
- /** Returns the encoding of the stream, or null if not known. */
- public String getEncoding() {
- return fEncoding;
- } // getEncoding():String
-
-} // class XMLInputSource
diff --git a/src/com/sun/org/apache/xerces/internal/xni/parser/XMLParseException.java b/src/com/sun/org/apache/xerces/internal/xni/parser/XMLParseException.java
deleted file mode 100644
index 1abb9ac..0000000
--- a/src/com/sun/org/apache/xerces/internal/xni/parser/XMLParseException.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xni.parser;
-
-import com.sun.org.apache.xerces.internal.xni.XMLLocator;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-
-/**
- * A parsing exception. This exception is different from the standard
- * XNI exception in that it stores the location in the document (or
- * its entities) where the exception occurred.
- *
- * @author Andy Clark, IBM
- *
- */
-public class XMLParseException
- extends XNIException {
-
- /** Serialization version. */
- static final long serialVersionUID = 1732959359448549967L;
-
- //
- // Data
- //
-
- /** Public identifier. */
- protected String fPublicId;
-
- /** literal System identifier. */
- protected String fLiteralSystemId;
-
- /** expanded System identifier. */
- protected String fExpandedSystemId;
-
- /** Base system identifier. */
- protected String fBaseSystemId;
-
- /** Line number. */
- protected int fLineNumber = -1;
-
- /** Column number. */
- protected int fColumnNumber = -1;
-
- /** Character offset. */
- protected int fCharacterOffset = -1;
-
- //
- // Constructors
- //
-
- /** Constructs a parse exception. */
- public XMLParseException(XMLLocator locator, String message) {
- super(message);
- if (locator != null) {
- fPublicId = locator.getPublicId();
- fLiteralSystemId = locator.getLiteralSystemId();
- fExpandedSystemId = locator.getExpandedSystemId();
- fBaseSystemId = locator.getBaseSystemId();
- fLineNumber = locator.getLineNumber();
- fColumnNumber = locator.getColumnNumber();
- fCharacterOffset = locator.getCharacterOffset();
- }
- } // <init>(XMLLocator,String)
-
- /** Constructs a parse exception. */
- public XMLParseException(XMLLocator locator,
- String message, Exception exception) {
- super(message, exception);
- if (locator != null) {
- fPublicId = locator.getPublicId();
- fLiteralSystemId = locator.getLiteralSystemId();
- fExpandedSystemId = locator.getExpandedSystemId();
- fBaseSystemId = locator.getBaseSystemId();
- fLineNumber = locator.getLineNumber();
- fColumnNumber = locator.getColumnNumber();
- fCharacterOffset = locator.getCharacterOffset();
- }
- } // <init>(XMLLocator,String,Exception)
-
- //
- // Public methods
- //
-
- /** Returns the public identifier. */
- public String getPublicId() {
- return fPublicId;
- } // getPublicId():String
-
- /** Returns the expanded system identifier. */
- public String getExpandedSystemId() {
- return fExpandedSystemId;
- } // getExpandedSystemId():String
-
- /** Returns the literal system identifier. */
- public String getLiteralSystemId() {
- return fLiteralSystemId;
- } // getLiteralSystemId():String
-
- /** Returns the base system identifier. */
- public String getBaseSystemId() {
- return fBaseSystemId;
- } // getBaseSystemId():String
-
- /** Returns the line number. */
- public int getLineNumber() {
- return fLineNumber;
- } // getLineNumber():int
-
- /** Returns the row number. */
- public int getColumnNumber() {
- return fColumnNumber;
- } // getRowNumber():int
-
- /** Returns the character offset. */
- public int getCharacterOffset() {
- return fCharacterOffset;
- } // getCharacterOffset():int
-
- //
- // Object methods
- //
-
- /** Returns a string representation of this object. */
- public String toString() {
-
- StringBuffer str = new StringBuffer();
- if (fPublicId != null) {
- str.append(fPublicId);
- }
- str.append(':');
- if (fLiteralSystemId != null) {
- str.append(fLiteralSystemId);
- }
- str.append(':');
- if (fExpandedSystemId != null) {
- str.append(fExpandedSystemId);
- }
- str.append(':');
- if (fBaseSystemId != null) {
- str.append(fBaseSystemId);
- }
- str.append(':');
- str.append(fLineNumber);
- str.append(':');
- str.append(fColumnNumber);
- str.append(':');
- str.append(fCharacterOffset);
- str.append(':');
- String message = getMessage();
- if (message == null) {
- Exception exception = getException();
- if (exception != null) {
- message = exception.getMessage();
- }
- }
- if (message != null) {
- str.append(message);
- }
- return str.toString();
-
- } // toString():String
-
-} // XMLParseException
diff --git a/src/com/sun/org/apache/xerces/internal/xni/parser/XMLParserConfiguration.java b/src/com/sun/org/apache/xerces/internal/xni/parser/XMLParserConfiguration.java
deleted file mode 100644
index b42712e..0000000
--- a/src/com/sun/org/apache/xerces/internal/xni/parser/XMLParserConfiguration.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xni.parser;
-
-import java.io.IOException;
-import java.util.Locale;
-
-import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLDTDHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-
-/**
- * Represents a parser configuration. The parser configuration maintains
- * a table of recognized features and properties, assembles components
- * for the parsing pipeline, and is responsible for initiating parsing
- * of an XML document.
- * <p>
- * By separating the configuration of a parser from the specific parser
- * instance, applications can create new configurations and re-use the
- * existing parser components and external API generators (e.g. the
- * DOMParser and SAXParser).
- * <p>
- * The internals of any specific parser configuration instance are hidden.
- * Therefore, each configuration may implement the parsing mechanism any
- * way necessary. However, the parser configuration should follow these
- * guidelines:
- * <ul>
- * <li>
- * Call the <code>reset</code> method on each component before parsing.
- * This is only required if the configuration is re-using existing
- * components that conform to the <code>XMLComponent</code> interface.
- * If the configuration uses all custom parts, then it is free to
- * implement everything as it sees fit as long as it follows the
- * other guidelines.
- * </li>
- * <li>
- * Call the <code>setFeature</code> and <code>setProperty</code> method
- * on each component during parsing to propagate features and properties
- * that have changed. This is only required if the configuration is
- * re-using existing components that conform to the <code>XMLComponent</code>
- * interface. If the configuration uses all custom parts, then it is free
- * to implement everything as it sees fit as long as it follows the other
- * guidelines.
- * </li>
- * <li>
- * Pass the same unique String references for all symbols that are
- * propagated to the registered handlers. Symbols include, but may not
- * be limited to, the names of elements and attributes (including their
- * uri, prefix, and localpart). This is suggested but not an absolute
- * must. However, the standard parser components may require access to
- * the same symbol table for creation of unique symbol references to be
- * propagated in the XNI pipeline.
- * </li>
- * </ul>
- *
- * @author Arnaud Le Hors, IBM
- * @author Andy Clark, IBM
- *
- */
-public interface XMLParserConfiguration
- extends XMLComponentManager {
-
- //
- // XMLParserConfiguration methods
- //
-
- // parsing
-
- /**
- * Parse an XML document.
- * <p>
- * The parser can use this method to instruct this configuration
- * to begin parsing an XML document from any valid input source
- * (a character stream, a byte stream, or a URI).
- * <p>
- * Parsers may not invoke this method while a parse is in progress.
- * Once a parse is complete, the parser may then parse another XML
- * document.
- * <p>
- * This method is synchronous: it will not return until parsing
- * has ended. If a client application wants to terminate
- * parsing early, it should throw an exception.
- * <p>
- * When this method returns, all characters streams and byte streams
- * opened by the parser are closed.
- *
- * @param inputSource The input source for the top-level of the
- * XML document.
- *
- * @exception XNIException Any XNI exception, possibly wrapping
- * another exception.
- * @exception IOException An IO exception from the parser, possibly
- * from a byte stream or character stream
- * supplied by the parser.
- */
- public void parse(XMLInputSource inputSource)
- throws XNIException, IOException;
-
- // generic configuration
-
- /**
- * Allows a parser to add parser specific features to be recognized
- * and managed by the parser configuration.
- *
- * @param featureIds An array of the additional feature identifiers
- * to be recognized.
- */
- public void addRecognizedFeatures(String[] featureIds);
-
- /**
- * Sets the state of a feature. This method is called by the parser
- * and gets propagated to components in this parser configuration.
- *
- * @param featureId The feature identifier.
- * @param state The state of the feature.
- *
- * @throws XMLConfigurationException Thrown if there is a configuration
- * error.
- */
- public void setFeature(String featureId, boolean state)
- throws XMLConfigurationException;
-
- /**
- * Returns the state of a feature.
- *
- * @param featureId The feature identifier.
- *
- * @throws XMLConfigurationException Thrown if there is a configuration
- * error.
- */
- public boolean getFeature(String featureId)
- throws XMLConfigurationException;
-
- /**
- * Allows a parser to add parser specific properties to be recognized
- * and managed by the parser configuration.
- *
- * @param propertyIds An array of the additional property identifiers
- * to be recognized.
- */
- public void addRecognizedProperties(String[] propertyIds);
-
- /**
- * Sets the value of a property. This method is called by the parser
- * and gets propagated to components in this parser configuration.
- *
- * @param propertyId The property identifier.
- * @param value The value of the property.
- *
- * @throws XMLConfigurationException Thrown if there is a configuration
- * error.
- */
- public void setProperty(String propertyId, Object value)
- throws XMLConfigurationException;
-
- /**
- * Returns the value of a property.
- *
- * @param propertyId The property identifier.
- *
- * @throws XMLConfigurationException Thrown if there is a configuration
- * error.
- */
- public Object getProperty(String propertyId)
- throws XMLConfigurationException;
-
- // handlers
-
- /**
- * Sets the error handler.
- *
- * @param errorHandler The error resolver.
- */
- public void setErrorHandler(XMLErrorHandler errorHandler);
-
- /** Returns the registered error handler. */
- public XMLErrorHandler getErrorHandler();
-
- /**
- * Sets the document handler to receive information about the document.
- *
- * @param documentHandler The document handler.
- */
- public void setDocumentHandler(XMLDocumentHandler documentHandler);
-
- /** Returns the registered document handler. */
- public XMLDocumentHandler getDocumentHandler();
-
- /**
- * Sets the DTD handler.
- *
- * @param dtdHandler The DTD handler.
- */
- public void setDTDHandler(XMLDTDHandler dtdHandler);
-
- /** Returns the registered DTD handler. */
- public XMLDTDHandler getDTDHandler();
-
- /**
- * Sets the DTD content model handler.
- *
- * @param dtdContentModelHandler The DTD content model handler.
- */
- public void setDTDContentModelHandler(XMLDTDContentModelHandler dtdContentModelHandler);
-
- /** Returns the registered DTD content model handler. */
- public XMLDTDContentModelHandler getDTDContentModelHandler();
-
- // other settings
-
- /**
- * Sets the entity resolver.
- *
- * @param entityResolver The new entity resolver.
- */
- public void setEntityResolver(XMLEntityResolver entityResolver);
-
- /** Returns the registered entity resolver. */
- public XMLEntityResolver getEntityResolver();
-
- /**
- * Set the locale to use for messages.
- *
- * @param locale The locale object to use for localization of messages.
- *
- * @exception XNIException Thrown if the parser does not support the
- * specified locale.
- */
- public void setLocale(Locale locale) throws XNIException;
-
- /** Returns the locale. */
- public Locale getLocale();
-
-} // interface XMLParserConfiguration
diff --git a/src/com/sun/org/apache/xerces/internal/xni/parser/XMLPullParserConfiguration.java b/src/com/sun/org/apache/xerces/internal/xni/parser/XMLPullParserConfiguration.java
deleted file mode 100644
index f3db0a3..0000000
--- a/src/com/sun/org/apache/xerces/internal/xni/parser/XMLPullParserConfiguration.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xni.parser;
-
-import java.io.IOException;
-
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-
-/**
- * Represents a parser configuration that can be used as the
- * configuration for a "pull" parser. A pull parser allows the
- * application to drive the parser instead of having document
- * information events "pushed" to the registered handlers.
- * <p>
- * A pull parser using this type of configuration first calls
- * the <code>setInputSource</code> method. After the input
- * source is set, the pull parser repeatedly calls the
- * <code>parse(boolean):boolean</code> method. This method
- * returns a value of true if there is more to parse in the
- * document.
- * <p>
- * Calling the <code>parse(XMLInputSource)</code> is equivalent
- * to setting the input source and calling the
- * <code>parse(boolean):boolean</code> method with a "complete"
- * value of <code>true</code>.
- *
- * @author Andy Clark, IBM
- *
- */
-public interface XMLPullParserConfiguration
- extends XMLParserConfiguration {
-
- //
- // XMLPullParserConfiguration methods
- //
-
- // parsing
-
- /**
- * Sets the input source for the document to parse.
- *
- * @param inputSource The document's input source.
- *
- * @exception XMLConfigurationException Thrown if there is a
- * configuration error when initializing the
- * parser.
- * @exception IOException Thrown on I/O error.
- *
- * @see #parse(boolean)
- */
- public void setInputSource(XMLInputSource inputSource)
- throws XMLConfigurationException, IOException;
-
- /**
- * Parses the document in a pull parsing fashion.
- *
- * @param complete True if the pull parser should parse the
- * remaining document completely.
- *
- * @return True if there is more document to parse.
- *
- * @exception XNIException Any XNI exception, possibly wrapping
- * another exception.
- * @exception IOException An IO exception from the parser, possibly
- * from a byte stream or character stream
- * supplied by the parser.
- *
- * @see #setInputSource
- */
- public boolean parse(boolean complete) throws XNIException, IOException;
-
- /**
- * If the application decides to terminate parsing before the xml document
- * is fully parsed, the application should call this method to free any
- * resource allocated during parsing. For example, close all opened streams.
- */
- public void cleanup();
-
-} // interface XMLPullParserConfiguration
diff --git a/src/com/sun/org/apache/xerces/internal/xpointer/ElementSchemePointer.java b/src/com/sun/org/apache/xerces/internal/xpointer/ElementSchemePointer.java
deleted file mode 100644
index 5415c98..0000000
--- a/src/com/sun/org/apache/xerces/internal/xpointer/ElementSchemePointer.java
+++ /dev/null
@@ -1,879 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xerces.internal.xpointer;
-
-import java.util.Hashtable;
-
-import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.util.XMLChar;
-import com.sun.org.apache.xerces.internal.xni.Augmentations;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler;
-
-/**
- * <p>
- * Implements the XPointerPart interface for element() scheme specific processing.
- * </p>
- *
- * @xerces.internal
- *
- * @version $Id: ElementSchemePointer.java,v 1.4 2009/06/11 23:51:50 joehw Exp $
- *
- */
-class ElementSchemePointer implements XPointerPart {
-
- // Fields
-
- // The Scheme Name i.e element
- private String fSchemeName;
-
- // The scheme Data
- private String fSchemeData;
-
- // The scheme Data & child sequence
- private String fShortHandPointerName;
-
- // Should we attempt to resolve the ChildSequence from the
- // current element position. If a ShortHand Pointer is present
- // attempt to resolve relative to the short hand pointer.
- private boolean fIsResolveElement = false;
-
- // Has the element been found
- private boolean fIsElementFound = false;
-
- // Was only an empty element found
- private boolean fWasOnlyEmptyElementFound = false;
-
- // If a shorthand pointer is present and resolved
- boolean fIsShortHand = false;
-
- // The depth at which the element was found
- int fFoundDepth = 0;
-
- // The XPointer element child sequence
- private int fChildSequence[];
-
- // The current child position
- private int fCurrentChildPosition = 1;
-
- // The current child depth
- private int fCurrentChildDepth = 0;
-
- // The current element's child sequence
- private int fCurrentChildSequence[];;
-
- // Stores if the Fragment was resolved by the pointer
- private boolean fIsFragmentResolved = false;
-
- // Stores if the Fragment was resolved by the pointer
- private ShortHandPointer fShortHandPointer;
-
- // The XPointer Error reporter
- protected XMLErrorReporter fErrorReporter;
-
- // The XPointer Error Handler
- protected XMLErrorHandler fErrorHandler;
-
- //
- private SymbolTable fSymbolTable;
-
- // ************************************************************************
- // Constructors
- // ************************************************************************
- public ElementSchemePointer() {
- }
-
- public ElementSchemePointer(SymbolTable symbolTable) {
- fSymbolTable = symbolTable;
- }
-
- public ElementSchemePointer(SymbolTable symbolTable,
- XMLErrorReporter errorReporter) {
- fSymbolTable = symbolTable;
- fErrorReporter = errorReporter;
- }
-
- // ************************************************************************
- // XPointerPart implementation
- // ************************************************************************
-
- /**
- * Parses the XPointer expression and tokenizes it into Strings
- * delimited by whitespace.
- *
- * @see com.sun.org.apache.xerces.internal.xpointer.XPointerProcessor#parseXPointer(java.lang.String)
- */
- public void parseXPointer(String xpointer) throws XNIException {
-
- //
- init();
-
- // tokens
- final Tokens tokens = new Tokens(fSymbolTable);
-
- // scanner
- Scanner scanner = new Scanner(fSymbolTable) {
- protected void addToken(Tokens tokens, int token)
- throws XNIException {
- if (token == Tokens.XPTRTOKEN_ELEM_CHILD
- || token == Tokens.XPTRTOKEN_ELEM_NCNAME) {
- super.addToken(tokens, token);
- return;
- }
- reportError("InvalidElementSchemeToken", new Object[] { tokens
- .getTokenString(token) });
- }
- };
-
- // scan the element() XPointer expression
- int length = xpointer.length();
- boolean success = scanner.scanExpr(fSymbolTable, tokens, xpointer, 0,
- length);
-
- if (!success) {
- reportError("InvalidElementSchemeXPointer",
- new Object[] { xpointer });
- }
-
- // Initialize a temp arrays to the size of token count which should
- // be atleast twice the size of child sequence, to hold the ChildSequence.
- int tmpChildSequence[] = new int[tokens.getTokenCount() / 2 + 1];
-
- // the element depth
- int i = 0;
-
- // Traverse the scanned tokens
- while (tokens.hasMore()) {
- int token = tokens.nextToken();
-
- switch (token) {
- case Tokens.XPTRTOKEN_ELEM_NCNAME: {
- // Note: Only a single ShortHand pointer can be present
-
- // The shortHand name
- token = tokens.nextToken();
- fShortHandPointerName = tokens.getTokenString(token);
-
- // Create a new ShortHandPointer
- fShortHandPointer = new ShortHandPointer(fSymbolTable);
- fShortHandPointer.setSchemeName(fShortHandPointerName);
-
- break;
- }
- case Tokens.XPTRTOKEN_ELEM_CHILD: {
- tmpChildSequence[i] = tokens.nextToken();
- i++;
-
- break;
- }
- default:
- reportError("InvalidElementSchemeXPointer",
- new Object[] { xpointer });
- }
- }
-
- // Initialize the arrays to the number of elements in the ChildSequence.
- fChildSequence = new int[i];
- fCurrentChildSequence = new int[i];
- System.arraycopy(tmpChildSequence, 0, fChildSequence, 0, i);
-
- }
-
- /**
- * Returns the scheme name i.e element
- * @see com.sun.org.apache.xerces.internal.xpointer.XPointerPart#getSchemeName()
- */
- public String getSchemeName() {
- return fSchemeName;
- }
-
- /**
- * Returns the scheme data
- *
- * @see com.sun.org.apache.xerces.internal.xpointer.XPointerPart#getSchemeData()
- */
- public String getSchemeData() {
- return fSchemeData;
- }
-
- /**
- * Sets the scheme name
- *
- * @see com.sun.org.apache.xerces.internal.xpointer.XPointerPart#setSchemeName(java.lang.String)
- */
- public void setSchemeName(String schemeName) {
- fSchemeName = schemeName;
-
- }
-
- /**
- * Sets the scheme data
- *
- * @see com.sun.org.apache.xerces.internal.xpointer.XPointerPart#setSchemeData(java.lang.String)
- */
- public void setSchemeData(String schemeData) {
- fSchemeData = schemeData;
- }
-
- /**
- * Responsible for resolving the element() scheme XPointer. If a ShortHand
- * Pointer is present and it is successfully resolved and if a child
- * sequence is present, the child sequence is resolved relative to it.
- *
- * @see com.sun.org.apache.xerces.internal.xpointer.XPointerProcessor#resolveXPointer(com.sun.org.apache.xerces.internal.xni.QName, com.sun.org.apache.xerces.internal.xni.XMLAttributes, com.sun.org.apache.xerces.internal.xni.Augmentations, int event)
- */
- public boolean resolveXPointer(QName element, XMLAttributes attributes,
- Augmentations augs, int event) throws XNIException {
-
- boolean isShortHandPointerResolved = false;
-
- // if a ChildSequence exisits, resolve child elements
-
- // if an element name exists
- if (fShortHandPointerName != null) {
- // resolve ShortHand Pointer
- isShortHandPointerResolved = fShortHandPointer.resolveXPointer(
- element, attributes, augs, event);
- if (isShortHandPointerResolved) {
- fIsResolveElement = true;
- fIsShortHand = true;
- } else {
- fIsResolveElement = false;
- }
- } else {
- fIsResolveElement = true;
- }
-
- // Added here to skip the ShortHand pointer corresponding to
- // an element if one exisits and start searching from its child
- if (fChildSequence.length > 0) {
- fIsFragmentResolved = matchChildSequence(element, event);
- } else if (isShortHandPointerResolved && fChildSequence.length <= 0) {
- // if only a resolved shorthand pointer exists
- fIsFragmentResolved = isShortHandPointerResolved;
- } else {
- fIsFragmentResolved = false;
- }
-
- return fIsFragmentResolved;
- }
-
- /**
- * Matches the current element position in the document tree with the
- * element position specified in the element XPointer scheme.
- *
- * @param event
- * @return boolean - true if the current element position in the document
- * tree matches theelement position specified in the element XPointer
- * scheme.
- */
- protected boolean matchChildSequence(QName element, int event)
- throws XNIException {
-
- // need to resize fCurrentChildSequence
- if (fCurrentChildDepth >= fCurrentChildSequence.length) {
- int tmpCurrentChildSequence[] = new int[fCurrentChildSequence.length];
- System.arraycopy(fCurrentChildSequence, 0, tmpCurrentChildSequence,
- 0, fCurrentChildSequence.length);
-
- // Increase the size by a factor of 2 (?)
- fCurrentChildSequence = new int[fCurrentChildDepth * 2];
- System.arraycopy(tmpCurrentChildSequence, 0, fCurrentChildSequence,
- 0, tmpCurrentChildSequence.length);
- }
-
- //
- if (fIsResolveElement) {
- // start
- fWasOnlyEmptyElementFound = false;
- if (event == XPointerPart.EVENT_ELEMENT_START) {
- fCurrentChildSequence[fCurrentChildDepth] = fCurrentChildPosition;
- fCurrentChildDepth++;
-
- // reset the current child position
- fCurrentChildPosition = 1;
-
- //if (!fSchemeNameFound) {
- if ((fCurrentChildDepth <= fFoundDepth) || (fFoundDepth == 0)) {
- if (checkMatch()) {
- fIsElementFound = true;
- fFoundDepth = fCurrentChildDepth;
- } else {
- fIsElementFound = false;
- fFoundDepth = 0;
- }
- }
-
- } else if (event == XPointerPart.EVENT_ELEMENT_END) {
- if (fCurrentChildDepth == fFoundDepth) {
- fIsElementFound = true;
- } else if (((fCurrentChildDepth < fFoundDepth) && (fFoundDepth != 0))
- || ((fCurrentChildDepth > fFoundDepth) // or empty element found
- && (fFoundDepth == 0))) {
- fIsElementFound = false;
- }
-
- // reset array position of last child
- fCurrentChildSequence[fCurrentChildDepth] = 0;
-
- fCurrentChildDepth--;
- fCurrentChildPosition = fCurrentChildSequence[fCurrentChildDepth] + 1;
-
- } else if (event == XPointerPart.EVENT_ELEMENT_EMPTY) {
-
- fCurrentChildSequence[fCurrentChildDepth] = fCurrentChildPosition;
- fCurrentChildPosition++;
-
- // Donot check for empty elements if the empty element is
- // a child of a found parent element
- //if (!fIsElementFound) {
- if (checkMatch()) {
- fIsElementFound = true;
- fWasOnlyEmptyElementFound = true;
- } else {
- fIsElementFound = false;
- }
- //}
-
- }
- }
-
- return fIsElementFound;
- }
-
- /**
- * Matches the current position of the element being visited by checking
- * its position and previous elements against the element XPointer expression.
- * If a match is found it return true else false.
- *
- * @return boolean
- */
- protected boolean checkMatch() {
- // If the number of elements in the ChildSequence is greater than the
- // current child depth, there is not point in checking further
- if (!fIsShortHand) {
- // If a shorthand pointer is not present traverse the children
- // and compare
- if (fChildSequence.length <= fCurrentChildDepth + 1) {
-
- for (int i = 0; i < fChildSequence.length; i++) {
- if (fChildSequence[i] != fCurrentChildSequence[i]) {
- return false;
- }
- }
- } else {
- return false;
- }
- } else {
- // If a shorthand pointer is present traverse the children
- // ignoring the first element of the CurrenChildSequence which
- // contains the ShortHand pointer element and compare
- if (fChildSequence.length <= fCurrentChildDepth + 1) {
-
- for (int i = 0; i < fChildSequence.length; i++) {
- // ensure fCurrentChildSequence is large enough
- if (fCurrentChildSequence.length < i + 2) {
- return false;
- }
-
- // ignore the first element of fCurrentChildSequence
- if (fChildSequence[i] != fCurrentChildSequence[i + 1]) {
- return false;
- }
- }
- } else {
- return false;
- }
-
- }
-
- return true;
- }
-
- /**
- * Returns true if the node matches or is a child of a matching element()
- * scheme XPointer.
- *
- * @see com.sun.org.apache.xerces.internal.xpointer.XPointerProcessor#isFragmentResolved()
- */
- public boolean isFragmentResolved() throws XNIException {
- // Return true if the Fragment was resolved and the current Node depth
- // is greater than or equal to the depth at which the element was found
- return fIsFragmentResolved ;
- }
-
- /**
- * Returns true if the XPointer expression resolves to a non-element child
- * of the current resource fragment.
- *
- * @see com.sun.org.apache.xerces.internal.xpointer.XPointerPart#isChildFragmentResolved()
- *
- */
- public boolean isChildFragmentResolved() {
- // if only a shorthand pointer was present
- if (fIsShortHand && fShortHandPointer != null && fChildSequence.length <= 0) {
- return fShortHandPointer.isChildFragmentResolved();
- } else {
- return fWasOnlyEmptyElementFound ? !fWasOnlyEmptyElementFound
- : (fIsFragmentResolved && (fCurrentChildDepth >= fFoundDepth));
- }
- }
-
- /**
- * Reports an XPointer error
- */
- protected void reportError(String key, Object[] arguments)
- throws XNIException {
- /*fErrorReporter.reportError(XPointerMessageFormatter.XPOINTER_DOMAIN,
- key, arguments, XMLErrorReporter.SEVERITY_ERROR);
- */
- throw new XNIException((fErrorReporter
- .getMessageFormatter(XPointerMessageFormatter.XPOINTER_DOMAIN))
- .formatMessage(fErrorReporter.getLocale(), key, arguments));
- }
-
- /**
- * Initializes error handling objects
- */
- protected void initErrorReporter() {
- if (fErrorReporter == null) {
- fErrorReporter = new XMLErrorReporter();
- }
- if (fErrorHandler == null) {
- fErrorHandler = new XPointerErrorHandler();
- }
- fErrorReporter.putMessageFormatter(
- XPointerMessageFormatter.XPOINTER_DOMAIN,
- new XPointerMessageFormatter());
- }
-
- /**
- * Initializes the element scheme processor
- */
- protected void init() {
- fSchemeName = null;
- fSchemeData = null;
- fShortHandPointerName = null;
- fIsResolveElement = false;
- fIsElementFound = false;
- fWasOnlyEmptyElementFound = false;
- fFoundDepth = 0;
- fCurrentChildPosition = 1;
- fCurrentChildDepth = 0;
- fIsFragmentResolved = false;
- fShortHandPointer = null;
-
- initErrorReporter();
- }
-
- // ************************************************************************
- // element() Scheme expression scanner
- // ************************************************************************
-
- /**
- * List of XPointer Framework tokens.
- *
- * @xerces.internal
- *
- * @author Neil Delima, IBM
- * @version $Id: ElementSchemePointer.java,v 1.4 2009/06/11 23:51:50 joehw Exp $
- *
- */
- private final class Tokens {
-
- /**
- * XPointer element() scheme
- * [1] ElementSchemeData ::= (NCName ChildSequence?) | ChildSequence
- * [2] ChildSequence ::= ('/' [1-9] [0-9]*)+
- */
- private static final int XPTRTOKEN_ELEM_NCNAME = 0;
-
- private static final int XPTRTOKEN_ELEM_CHILD = 1;
-
- // Token names
- private final String[] fgTokenNames = { "XPTRTOKEN_ELEM_NCNAME",
- "XPTRTOKEN_ELEM_CHILD" };
-
- // Token count
- private static final int INITIAL_TOKEN_COUNT = 1 << 8;
-
- private int[] fTokens = new int[INITIAL_TOKEN_COUNT];
-
- private int fTokenCount = 0;
-
- // Current token position
- private int fCurrentTokenIndex;
-
- private SymbolTable fSymbolTable;
-
- private Hashtable fTokenNames = new Hashtable();
-
- /**
- * Constructor
- *
- * @param symbolTable SymbolTable
- */
- private Tokens(SymbolTable symbolTable) {
- fSymbolTable = symbolTable;
-
- fTokenNames.put(new Integer(XPTRTOKEN_ELEM_NCNAME),
- "XPTRTOKEN_ELEM_NCNAME");
- fTokenNames.put(new Integer(XPTRTOKEN_ELEM_CHILD),
- "XPTRTOKEN_ELEM_CHILD");
- }
-
- /*
- * Returns the token String
- * @param token The index of the token
- * @return String The token string
- */
- private String getTokenString(int token) {
- return (String) fTokenNames.get(new Integer(token));
- }
-
- /**
- * Returns the token String
- * @param token The index of the token
- * @return String The token string
- */
- private Integer getToken(int token) {
- return (Integer) fTokenNames.get(new Integer(token));
- }
-
- /**
- * Add the specified string as a token
- *
- * @param token The token string
- */
- private void addToken(String tokenStr) {
- Integer tokenInt = (Integer) fTokenNames.get(tokenStr);
- if (tokenInt == null) {
- tokenInt = new Integer(fTokenNames.size());
- fTokenNames.put(tokenInt, tokenStr);
- }
- addToken(tokenInt.intValue());
- }
-
- /**
- * Add the specified int token
- *
- * @param token The int specifying the token
- */
- private void addToken(int token) {
- try {
- fTokens[fTokenCount] = token;
- } catch (ArrayIndexOutOfBoundsException ex) {
- int[] oldList = fTokens;
- fTokens = new int[fTokenCount << 1];
- System.arraycopy(oldList, 0, fTokens, 0, fTokenCount);
- fTokens[fTokenCount] = token;
- }
- fTokenCount++;
- }
-
- /**
- * Resets the current position to the head of the token list.
- */
- private void rewind() {
- fCurrentTokenIndex = 0;
- }
-
- /**
- * Returns true if the {@link #getNextToken()} method
- * returns a valid token.
- */
- private boolean hasMore() {
- return fCurrentTokenIndex < fTokenCount;
- }
-
- /**
- * Obtains the token at the current position, then advance
- * the current position by one.
- *
- * If there's no such next token, this method throws
- * <tt>new XNIException("InvalidXPointerExpression");</tt>.
- */
- private int nextToken() throws XNIException {
- if (fCurrentTokenIndex == fTokenCount)
- reportError("XPointerElementSchemeProcessingError", null);
- return fTokens[fCurrentTokenIndex++];
- }
-
- /**
- * Obtains the token at the current position, without advancing
- * the current position.
- *
- * If there's no such next token, this method throws
- * <tt>new XNIException("InvalidXPointerExpression");</tt>.
- */
- private int peekToken() throws XNIException {
- if (fCurrentTokenIndex == fTokenCount)
- reportError("XPointerElementSchemeProcessingError", null);
- return fTokens[fCurrentTokenIndex];
- }
-
- /**
- * Obtains the token at the current position as a String.
- *
- * If there's no current token or if the current token
- * is not a string token, this method throws
- * If there's no such next token, this method throws
- * <tt>new XNIException("InvalidXPointerExpression");</tt>.
- */
- private String nextTokenAsString() throws XNIException {
- String s = getTokenString(nextToken());
- if (s == null)
- reportError("XPointerElementSchemeProcessingError", null);
- return s;
- }
-
- /**
- * Returns the number of tokens.
- *
- */
- private int getTokenCount() {
- return fTokenCount;
- }
- }
-
- /**
- *
- * The XPointer expression scanner. Scans the XPointer framework expression.
- *
- * @xerces.internal
- *
- * @version $Id: ElementSchemePointer.java,v 1.4 2009/06/11 23:51:50 joehw Exp $
- */
- private class Scanner {
-
- /**
- * 7-bit ASCII subset
- *
- * 0 1 2 3 4 5 6 7 8 9 A B C D E F
- * 0, 0, 0, 0, 0, 0, 0, 0, 0, HT, LF, 0, 0, CR, 0, 0, // 0
- * 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 1
- * SP, !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, // 2
- * 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, :, ;, <, =, >, ?, // 3
- * @, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, // 4
- * P, Q, R, S, T, U, V, W, X, Y, Z, [, \, ], ^, _, // 5
- * `, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, // 6
- * p, q, r, s, t, u, v, w, x, y, z, {, |, }, ~, DEL // 7
- */
- private static final byte CHARTYPE_INVALID = 0, // invalid XML characters, control characters and 7F
- CHARTYPE_OTHER = 1, // A valid XML character (possibly invalid NCNameChar) that does not fall in one of the other categories
- CHARTYPE_MINUS = 2, // '-' (0x2D)
- CHARTYPE_PERIOD = 3, // '.' (0x2E)
- CHARTYPE_SLASH = 4, // '/' (0x2F)
- CHARTYPE_DIGIT = 5, // '0'-'9' (0x30 to 0x39)
- CHARTYPE_LETTER = 6, // 'A'-'Z' or 'a'-'z' (0x41 to 0x5A and 0x61 to 0x7A)
- CHARTYPE_UNDERSCORE = 7, // '_' (0x5F)
- CHARTYPE_NONASCII = 8; // Non-ASCII Unicode codepoint (>= 0x80)
-
- private final byte[] fASCIICharMap = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,
- 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 4, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 1, 1, 1, 1, 1, 1, 1, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 1, 1, 1, 1,
- 7, 1, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 1, 1, 1, 1, 1 };
-
- /**
- * Symbol literals
- */
-
- //
- // Data
- //
- /** Symbol table. */
- private SymbolTable fSymbolTable;
-
- //
- // Constructors
- //
-
- /**
- * Constructs an XPath expression scanner.
- *
- * @param symbolTable SymbolTable
- */
- private Scanner(SymbolTable symbolTable) {
- // save pool and tokens
- fSymbolTable = symbolTable;
-
- } // <init>(SymbolTable)
-
- /**
- * Scans the XPointer Expression
- *
- */
- private boolean scanExpr(SymbolTable symbolTable, Tokens tokens,
- String data, int currentOffset, int endOffset)
- throws XNIException {
-
- int ch;
- int nameOffset;
- String nameHandle = null;
-
- while (true) {
- if (currentOffset == endOffset) {
- break;
- }
-
- ch = data.charAt(currentOffset);
- byte chartype = (ch >= 0x80) ? CHARTYPE_NONASCII
- : fASCIICharMap[ch];
-
- //
- // [1] ElementSchemeData ::= (NCName ChildSequence?) | ChildSequence
- // [2] ChildSequence ::= ('/' [1-9] [0-9]*)+
- //
-
- switch (chartype) {
-
- case CHARTYPE_SLASH:
- // if last character is '/', break and report an error
- if (++currentOffset == endOffset) {
- return false;
- }
-
- addToken(tokens, Tokens.XPTRTOKEN_ELEM_CHILD);
- ch = data.charAt(currentOffset);
-
- // ChildSequence ::= ('/' [1-9] [0-9]*)+
- int child = 0;
- while (ch >= '0' && ch <= '9') {
- child = (child * 10) + (ch - '0');
- if (++currentOffset == endOffset) {
- break;
- }
- ch = data.charAt(currentOffset);
- }
-
- // An invalid child sequence character
- if (child == 0) {
- reportError("InvalidChildSequenceCharacter",
- new Object[] { new Character((char) ch) });
- return false;
- }
-
- tokens.addToken(child);
-
- break;
-
- case CHARTYPE_DIGIT:
- case CHARTYPE_LETTER:
- case CHARTYPE_MINUS:
- case CHARTYPE_NONASCII:
- case CHARTYPE_OTHER:
- case CHARTYPE_PERIOD:
- case CHARTYPE_UNDERSCORE:
- // Scan the ShortHand Pointer NCName
- nameOffset = currentOffset;
- currentOffset = scanNCName(data, endOffset, currentOffset);
-
- if (currentOffset == nameOffset) {
- //return false;
- reportError("InvalidNCNameInElementSchemeData",
- new Object[] { data });
- return false;
- }
-
- if (currentOffset < endOffset) {
- ch = data.charAt(currentOffset);
- } else {
- ch = -1;
- }
-
- nameHandle = symbolTable.addSymbol(data.substring(
- nameOffset, currentOffset));
- addToken(tokens, Tokens.XPTRTOKEN_ELEM_NCNAME);
- tokens.addToken(nameHandle);
-
- break;
- }
- }
- return true;
- }
-
- /**
- * Scans a NCName.
- * From Namespaces in XML
- * [5] NCName ::= (Letter | '_') (NCNameChar)*
- * [6] NCNameChar ::= Letter | Digit | '.' | '-' | '_' | CombiningChar | Extender
- *
- * @param data A String containing the XPointer expression
- * @param endOffset The int XPointer expression length
- * @param currentOffset An int representing the current position of the XPointer expression pointer
- */
- private int scanNCName(String data, int endOffset, int currentOffset) {
- int ch = data.charAt(currentOffset);
- if (ch >= 0x80) {
- if (!XMLChar.isNameStart(ch)) {
- return currentOffset;
- }
- } else {
- byte chartype = fASCIICharMap[ch];
- if (chartype != CHARTYPE_LETTER
- && chartype != CHARTYPE_UNDERSCORE) {
- return currentOffset;
- }
- }
- while (++currentOffset < endOffset) {
- ch = data.charAt(currentOffset);
- if (ch >= 0x80) {
- if (!XMLChar.isName(ch)) {
- break;
- }
- } else {
- byte chartype = fASCIICharMap[ch];
- if (chartype != CHARTYPE_LETTER
- && chartype != CHARTYPE_DIGIT
- && chartype != CHARTYPE_PERIOD
- && chartype != CHARTYPE_MINUS
- && chartype != CHARTYPE_UNDERSCORE) {
- break;
- }
- }
- }
- return currentOffset;
- }
-
- //
- // Protected methods
- //
-
- /**
- * This method adds the specified token to the token list. By
- * default, this method allows all tokens. However, subclasses
- * of the XPathExprScanner can override this method in order
- * to disallow certain tokens from being used in the scanned
- * XPath expression. This is a convenient way of allowing only
- * a subset of XPath.
- */
- protected void addToken(Tokens tokens, int token) throws XNIException {
- tokens.addToken(token);
- } // addToken(int)
-
- } // class Scanner
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xpointer/ShortHandPointer.java b/src/com/sun/org/apache/xerces/internal/xpointer/ShortHandPointer.java
deleted file mode 100644
index 1317deb..0000000
--- a/src/com/sun/org/apache/xerces/internal/xpointer/ShortHandPointer.java
+++ /dev/null
@@ -1,296 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xerces.internal.xpointer;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.xni.Augmentations;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xs.AttributePSVI;
-import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
-
-/**
- * <p>
- * Implements the XPointerPart interface and handles processing of
- * ShortHand Pointers. It identifies at most one element in the
- * resource's information set; specifically, the first one (if any)
- * in document order that has a matching NCName as an identifier.
- * </p>
- *
- *
- */
-class ShortHandPointer implements XPointerPart {
-
- // The name of the ShortHand pointer
- private String fShortHandPointer;
-
- // The name of the ShortHand pointer
- private boolean fIsFragmentResolved = false;
-
- // SymbolTable
- private SymbolTable fSymbolTable;
-
- //
- // Constructors
- //
- public ShortHandPointer() {
- }
-
- public ShortHandPointer(SymbolTable symbolTable) {
- fSymbolTable = symbolTable;
- }
-
- /**
- * The XPointerProcessor takes care of this. Simply set the ShortHand Pointer here.
- *
- * @see com.sun.org.apache.xerces.internal.xpointer.XPointerPart#parseXPointer(java.lang.String)
- */
- public void parseXPointer(String part) throws XNIException {
- fShortHandPointer = part;
- // reset fIsFragmentResolved
- fIsFragmentResolved = false;
- }
-
- /**
- * Resolves the XPointer ShortHand pointer based on the rules defined in
- * Section 3.2 of the XPointer Framework Recommendation.
- * Note that in the current implementation only supports DTD determined ID's.
- *
- * @see com.sun.org.apache.xerces.internal.xpointer.XPointerPart#resolveXPointer(com.sun.org.apache.xerces.internal.xni.QName, com.sun.org.apache.xerces.internal.xni.XMLAttributes, com.sun.org.apache.xerces.internal.xni.Augmentations, int event)
- */
- int fMatchingChildCount = 0;
- public boolean resolveXPointer(QName element, XMLAttributes attributes,
- Augmentations augs, int event) throws XNIException {
-
- // reset fIsFragmentResolved
- if (fMatchingChildCount == 0) {
- fIsFragmentResolved = false;
- }
-
- // On startElement or emptyElement, if no matching elements or parent
- // elements were found, check for a matching idenfitier.
- if (event == XPointerPart.EVENT_ELEMENT_START) {
- if (fMatchingChildCount == 0) {
- fIsFragmentResolved = hasMatchingIdentifier(element, attributes, augs,
- event);
- }
- if (fIsFragmentResolved) {
- fMatchingChildCount++;
- }
- } else if (event == XPointerPart.EVENT_ELEMENT_EMPTY) {
- if (fMatchingChildCount == 0) {
- fIsFragmentResolved = hasMatchingIdentifier(element, attributes, augs,
- event);
- }
- }
- else {
- // On endElement, decrease the matching child count if the child or
- // its parent was resolved.
- if (fIsFragmentResolved) {
- fMatchingChildCount--;
- }
- }
-
- return fIsFragmentResolved ;
- }
-
- /**
- *
- * @param element
- * @param attributes
- * @param augs
- * @param event
- * @return
- * @throws XNIException
- */
- private boolean hasMatchingIdentifier(QName element,
- XMLAttributes attributes, Augmentations augs, int event)
- throws XNIException {
- String normalizedValue = null;
-
- // The identifiers of an element are determined by the
- // ShortHand Pointer as follows:
-
- if (attributes != null) {
- for (int i = 0; i < attributes.getLength(); i++) {
-
- // 1. If an element information item has an attribute information item
- // among its [attributes] that is a schema-determined ID, then it is
- // identified by the value of that attribute information item's
- // [schema normalized value] property;
- normalizedValue = getSchemaDeterminedID(attributes, i);
- if (normalizedValue != null) {
- break;
- }
-
- // 2. If an element information item has an element information item among
- // its [children] that is a schema-determined ID, then it is identified by
- // the value of that element information item's [schema normalized value] property;
- // ???
- normalizedValue = getChildrenSchemaDeterminedID(attributes, i);
- if (normalizedValue != null) {
- break;
- }
-
- // 3. If an element information item has an attribute information item among
- // its [attributes] that is a DTD-determined ID, then it is identified by the
- // value of that attribute information item's [normalized value] property.
- // An attribute information item is a DTD-determined ID if and only if it has
- // a [type definition] property whose value is equal to ID.
- normalizedValue = getDTDDeterminedID(attributes, i);
- if (normalizedValue != null) {
- break;
- }
- // 4. No externally determined ID's
- }
- }
-
- if (normalizedValue != null
- && normalizedValue.equals(fShortHandPointer)) {
- return true;
- }
-
- return false;
- }
-
- /**
- * Rerturns the DTD determine-ID
- *
- * @param attributes
- * @param index
- * @return String
- * @throws XNIException
- */
- public String getDTDDeterminedID(XMLAttributes attributes, int index)
- throws XNIException {
-
- if (attributes.getType(index).equals("ID")) {
- return attributes.getValue(index);
- }
- return null;
- }
-
- /**
- * Returns the schema-determined-ID.
- *
- *
- * @param attributes
- * @param index
- * @return A String containing the schema-determined ID.
- * @throws XNIException
- */
- public String getSchemaDeterminedID(XMLAttributes attributes, int index)
- throws XNIException {
- Augmentations augs = attributes.getAugmentations(index);
- AttributePSVI attrPSVI = (AttributePSVI) augs
- .getItem(Constants.ATTRIBUTE_PSVI);
-
- if (attrPSVI != null) {
- // An element or attribute information item is a schema-determined
- // ID if and only if one of the following is true:]
-
- // 1. It has a [member type definition] or [type definition] property
- // whose value in turn has [name] equal to ID and [target namespace]
- // equal to http://www.w3.org/2001/XMLSchema;
-
- // 2. It has a [base type definition] whose value has that [name] and [target namespace];
-
- // 3. It has a [base type definition] whose value has a [base type definition]
- // whose value has that [name] and [target namespace], and so on following
- // the [base type definition] property recursively;
-
- XSTypeDefinition typeDef = attrPSVI.getMemberTypeDefinition();
- if (typeDef != null) {
- typeDef = attrPSVI.getTypeDefinition();
- }
-
- //
- if (typeDef != null && ((XSSimpleType) typeDef).isIDType()) {
- return attrPSVI.getSchemaNormalizedValue();
- }
-
- // 4 & 5 NA
- }
-
- return null;
- }
-
- /**
- * Not quite sure how this can be correctly implemented.
- *
- * @param attributes
- * @param index
- * @return String - We return null since we currenly do not supprt this.
- * @throws XNIException
- */
- public String getChildrenSchemaDeterminedID(XMLAttributes attributes,
- int index) throws XNIException {
- return null;
- }
-
- /**
- *
- * @see com.sun.org.apache.xerces.internal.xpointer.XPointerPart#isFragmentResolved()
- */
- public boolean isFragmentResolved() {
- return fIsFragmentResolved;
- }
-
- /**
- *
- * @see com.sun.org.apache.xerces.internal.xpointer.XPointerPart#isChildFragmentResolved()
- */
- public boolean isChildFragmentResolved() {
- return fIsFragmentResolved & ( fMatchingChildCount > 0);
- }
-
- /**
- * Returns the name of the ShortHand pointer
- *
- * @see com.sun.org.apache.xerces.internal.xpointer.XPointerPart#getSchemeName()
- */
- public String getSchemeName() {
- return fShortHandPointer;
- }
-
- /**
- * @see com.sun.org.apache.xerces.internal.xpointer.XPointerPart#getSchemeData()
- */
- public String getSchemeData() {
- return null;
- }
-
- /**
- * @see com.sun.org.apache.xerces.internal.xpointer.XPointerPart#setSchemeName(java.lang.String)
- */
- public void setSchemeName(String schemeName) {
- fShortHandPointer = schemeName;
- }
-
- /**
- * @see com.sun.org.apache.xerces.internal.xpointer.XPointerPart#setSchemeData(java.lang.String)
- */
- public void setSchemeData(String schemeData) {
- // NA
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xpointer/XPointerErrorHandler.java b/src/com/sun/org/apache/xerces/internal/xpointer/XPointerErrorHandler.java
deleted file mode 100644
index e1a971f..0000000
--- a/src/com/sun/org/apache/xerces/internal/xpointer/XPointerErrorHandler.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xerces.internal.xpointer;
-
-import java.io.PrintWriter;
-
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLParseException;
-
-/**
- * The Default XPointer error handler used by the XInclude implementation.
- * XPointer error's are thrown so that they may be caught by the XInclude
- * implementation and reported as resource errors.
- *
- */
-class XPointerErrorHandler implements XMLErrorHandler {
-
- //
- // Data
- //
-
- /** Print writer. */
- protected PrintWriter fOut;
-
- //
- // Constructors
- //
-
- /**
- * Constructs an error handler that prints error messages to
- * <code>System.err</code>.
- */
- public XPointerErrorHandler() {
- this(new PrintWriter(System.err));
- } // <init>()
-
- /**
- * Constructs an error handler that prints error messages to the
- * specified <code>PrintWriter</code.
- */
- public XPointerErrorHandler(PrintWriter out) {
- fOut = out;
- } // <init>(PrintWriter)
-
- //
- // ErrorHandler methods
- //
-
- /** Warning. */
- public void warning(String domain, String key, XMLParseException ex)
- throws XNIException {
- printError("Warning", ex);
- } // warning(XMLParseException)
-
- /** Error. */
- public void error(String domain, String key, XMLParseException ex)
- throws XNIException {
- printError("Error", ex);
- //throw ex;
- } // error(XMLParseException)
-
- /** Fatal error. */
- public void fatalError(String domain, String key, XMLParseException ex)
- throws XNIException {
- printError("Fatal Error", ex);
- throw ex;
- } // fatalError(XMLParseException)
-
- //
- // Private methods
- //
-
- /** Prints the error message. */
- private void printError(String type, XMLParseException ex) {
-
- fOut.print("[");
- fOut.print(type);
- fOut.print("] ");
- String systemId = ex.getExpandedSystemId();
- if (systemId != null) {
- int index = systemId.lastIndexOf('/');
- if (index != -1)
- systemId = systemId.substring(index + 1);
- fOut.print(systemId);
- }
- fOut.print(':');
- fOut.print(ex.getLineNumber());
- fOut.print(':');
- fOut.print(ex.getColumnNumber());
- fOut.print(": ");
- fOut.print(ex.getMessage());
- fOut.println();
- fOut.flush();
-
- } // printError(String,SAXParseException)
-
-} // class DefaultErrorHandler
diff --git a/src/com/sun/org/apache/xerces/internal/xpointer/XPointerHandler.java b/src/com/sun/org/apache/xerces/internal/xpointer/XPointerHandler.java
deleted file mode 100644
index 30b7563..0000000
--- a/src/com/sun/org/apache/xerces/internal/xpointer/XPointerHandler.java
+++ /dev/null
@@ -1,1248 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xerces.internal.xpointer;
-
-import java.util.Hashtable;
-import java.util.Vector;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.util.XMLChar;
-import com.sun.org.apache.xerces.internal.util.XMLSymbols;
-import com.sun.org.apache.xerces.internal.xinclude.XIncludeHandler;
-import com.sun.org.apache.xerces.internal.xinclude.XIncludeNamespaceSupport;
-import com.sun.org.apache.xerces.internal.xni.Augmentations;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
-import com.sun.org.apache.xerces.internal.xni.XMLString;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler;
-
-/**
- * <p>
- * This is a pipeline component which extends the XIncludeHandler to perform
- * XPointer specific processing specified in the W3C XPointerFramework and
- * element() Scheme Recommendations.
- * </p>
- *
- * <p>
- * This component analyzes each event in the pipeline, looking for an element
- * that matches a PointerPart in the parent XInclude element's xpointer attribute
- * value. If the match succeeds, all children are passed by this component.
- * </p>
- *
- * <p>
- * See the <a href="http://www.w3.org/TR/xptr-framework//">XPointer Framework Recommendation</a> for
- * more information on the XPointer Framework and ShortHand Pointers.
- * See the <a href="http://www.w3.org/TR/xptr-element/">XPointer element() Scheme Recommendation</a> for
- * more information on the XPointer element() Scheme.
- * </p>
- *
- * @xerces.internal
- *
- */
-public final class XPointerHandler extends XIncludeHandler implements
- XPointerProcessor {
-
- // Fields
- // A Vector of XPointerParts
- protected Vector fXPointerParts = null;
-
- // The current XPointerPart
- protected XPointerPart fXPointerPart = null;
-
- // Has the fXPointerPart resolved successfully
- protected boolean fFoundMatchingPtrPart = false;
-
- // The XPointer Error reporter
- protected XMLErrorReporter fXPointerErrorReporter;
-
- // The XPointer Error Handler
- protected XMLErrorHandler fErrorHandler;
-
- // XPointerFramework symbol table
- protected SymbolTable fSymbolTable = null;
-
- // Supported schemes
- private final String ELEMENT_SCHEME_NAME = "element";
-
- // Has the XPointer resolved the subresource
- protected boolean fIsXPointerResolved = false;
-
- // Fixup xml:base and xml:lang attributes
- protected boolean fFixupBase = false;
- protected boolean fFixupLang = false;
-
- // ************************************************************************
- // Constructors
- // ************************************************************************
-
- /**
- *
- */
- public XPointerHandler() {
- super();
-
- fXPointerParts = new Vector();
- fSymbolTable = new SymbolTable();
- }
-
- public XPointerHandler(SymbolTable symbolTable,
- XMLErrorHandler errorHandler, XMLErrorReporter errorReporter) {
- super();
-
- fXPointerParts = new Vector();
- fSymbolTable = symbolTable;
- fErrorHandler = errorHandler;
- fXPointerErrorReporter = errorReporter;
- //fErrorReporter = errorReporter; // The XInclude ErrorReporter
- }
-
- // ************************************************************************
- // Implementation of the XPointerProcessor interface.
- // ************************************************************************
-
- /**
- * Parses the XPointer framework expression and delegates scheme specific parsing.
- *
- * @see com.sun.org.apache.xerces.internal.xpointer.XPointerProcessor#parseXPointer(java.lang.String)
- */
- public void parseXPointer(String xpointer) throws XNIException {
-
- // Initialize
- init();
-
- // tokens
- final Tokens tokens = new Tokens(fSymbolTable);
-
- // scanner
- Scanner scanner = new Scanner(fSymbolTable) {
- protected void addToken(Tokens tokens, int token)
- throws XNIException {
- if (token == Tokens.XPTRTOKEN_OPEN_PAREN
- || token == Tokens.XPTRTOKEN_CLOSE_PAREN
- || token == Tokens.XPTRTOKEN_SCHEMENAME
- || token == Tokens.XPTRTOKEN_SCHEMEDATA
- || token == Tokens.XPTRTOKEN_SHORTHAND) {
- super.addToken(tokens, token);
- return;
- }
- reportError("InvalidXPointerToken", new Object[] { tokens
- .getTokenString(token) });
- }
- };
-
- // scan the XPointer expression
- int length = xpointer.length();
- boolean success = scanner.scanExpr(fSymbolTable, tokens, xpointer, 0,
- length);
-
- if (!success)
- reportError("InvalidXPointerExpression", new Object[] { xpointer });
-
- while (tokens.hasMore()) {
- int token = tokens.nextToken();
-
- switch (token) {
- case Tokens.XPTRTOKEN_SHORTHAND: {
-
- // The shortHand name
- token = tokens.nextToken();
- String shortHandPointerName = tokens.getTokenString(token);
-
- if (shortHandPointerName == null) {
- reportError("InvalidXPointerExpression",
- new Object[] { xpointer });
- }
-
- XPointerPart shortHandPointer = new ShortHandPointer(
- fSymbolTable);
- shortHandPointer.setSchemeName(shortHandPointerName);
- fXPointerParts.add(shortHandPointer);
- break;
- }
- case Tokens.XPTRTOKEN_SCHEMENAME: {
-
- // Retreive the local name and prefix to form the scheme name
- token = tokens.nextToken();
- String prefix = tokens.getTokenString(token);
- token = tokens.nextToken();
- String localName = tokens.getTokenString(token);
-
- String schemeName = prefix + localName;
-
- // The next character should be an open parenthesis
- int openParenCount = 0;
- int closeParenCount = 0;
-
- token = tokens.nextToken();
- String openParen = tokens.getTokenString(token);
- if (openParen != "XPTRTOKEN_OPEN_PAREN") {
-
- // can not have more than one ShortHand Pointer
- if (token == Tokens.XPTRTOKEN_SHORTHAND) {
- reportError("MultipleShortHandPointers",
- new Object[] { xpointer });
- } else {
- reportError("InvalidXPointerExpression",
- new Object[] { xpointer });
- }
- }
- openParenCount++;
-
- // followed by zero or more ( and the schemeData
- String schemeData = null;
- while (tokens.hasMore()) {
- token = tokens.nextToken();
- schemeData = tokens.getTokenString(token);
- if (schemeData != "XPTRTOKEN_OPEN_PAREN") {
- break;
- }
- openParenCount++;
- }
- token = tokens.nextToken();
- schemeData = tokens.getTokenString(token);
-
- // followed by the same number of )
- token = tokens.nextToken();
- String closeParen = tokens.getTokenString(token);
- if (closeParen != "XPTRTOKEN_CLOSE_PAREN") {
- reportError("SchemeDataNotFollowedByCloseParenthesis",
- new Object[] { xpointer });
- }
- closeParenCount++;
-
- while (tokens.hasMore()) {
- if (tokens.getTokenString(tokens.peekToken()) != "XPTRTOKEN_OPEN_PAREN") {
- break;
- }
- closeParenCount++;
- }
-
- // check if the number of open parenthesis are equal to the number of close parenthesis
- if (openParenCount != closeParenCount) {
- reportError("UnbalancedParenthesisInXPointerExpression",
- new Object[] { xpointer,
- new Integer(openParenCount),
- new Integer(closeParenCount) });
- }
-
- // Perform scheme specific parsing of the pointer part
- if (schemeName.equals(ELEMENT_SCHEME_NAME)) {
- XPointerPart elementSchemePointer = new ElementSchemePointer(
- fSymbolTable, fErrorReporter);
- elementSchemePointer.setSchemeName(schemeName);
- elementSchemePointer.setSchemeData(schemeData);
-
- // If an exception occurs while parsing the element() scheme expression
- // ignore it and move on to the next pointer part
- try {
- elementSchemePointer.parseXPointer(schemeData);
- fXPointerParts.add(elementSchemePointer);
- } catch (XNIException e) {
- // Re-throw the XPointer element() scheme syntax error.
- throw new XNIException (e);
- }
-
- } else {
- // ????
- reportWarning("SchemeUnsupported",
- new Object[] { schemeName });
- }
-
- break;
- }
- default:
- reportError("InvalidXPointerExpression",
- new Object[] { xpointer });
- }
- }
-
- }
-
- /**
- *
- * @see com.sun.org.apache.xerces.internal.xpointer.XPointerProcessor#resolveXPointer(com.sun.org.apache.xerces.internal.xni.QName, com.sun.org.apache.xerces.internal.xni.XMLAttributes, com.sun.org.apache.xerces.internal.xni.Augmentations, int event)
- */
- public boolean resolveXPointer(QName element, XMLAttributes attributes,
- Augmentations augs, int event) throws XNIException {
- boolean resolved = false;
-
- // The result of the first pointer part whose evaluation identifies
- // one or more subresources is reported by the XPointer processor as the
- // result of the pointer as a whole, and evaluation stops.
- // In our implementation, typically the first xpointer scheme that
- // matches an element is the document is considered.
- // If the pointer part resolved then use it, else search for the fragment
- // using next pointer part from lef-right.
- if (!fFoundMatchingPtrPart) {
-
- // for each element, attempt to resolve it against each pointer part
- // in the XPointer expression until a matching element is found.
- for (int i = 0; i < fXPointerParts.size(); i++) {
-
- fXPointerPart = (XPointerPart) fXPointerParts.get(i);
-
- if (fXPointerPart.resolveXPointer(element, attributes, augs,
- event)) {
- fFoundMatchingPtrPart = true;
- resolved = true;
- }
- }
- } else {
- if (fXPointerPart.resolveXPointer(element, attributes, augs, event)) {
- resolved = true;
- }
- }
-
- if (!fIsXPointerResolved) {
- fIsXPointerResolved = resolved;
- }
-
- return resolved;
- }
-
- /**
- * Returns true if the Node fragment is resolved.
- *
- * @see com.sun.org.apache.xerces.internal.xpointer.XPointerProcessor#isFragmentResolved()
- */
- public boolean isFragmentResolved() throws XNIException {
- boolean resolved = (fXPointerPart != null) ? fXPointerPart.isFragmentResolved()
- : false;
-
- if (!fIsXPointerResolved) {
- fIsXPointerResolved = resolved;
- }
-
- return resolved;
- }
-
- /**
- * Returns true if the XPointer expression resolves to a non-element child
- * of the current resource fragment.
- *
- * @see com.sun.org.apache.xerces.internal.xpointer.XPointerPart#isChildFragmentResolved()
- *
- */
- public boolean isChildFragmentResolved() throws XNIException {
- boolean resolved = (fXPointerPart != null) ? fXPointerPart
- .isChildFragmentResolved() : false;
- return resolved;
- }
-
- /**
- * Returns true if the XPointer successfully found a sub-resource .
- *
- * @see com.sun.org.apache.xerces.internal.xpointer.XPointerProcessor#isFragmentResolved()
- */
- public boolean isXPointerResolved() throws XNIException {
- return fIsXPointerResolved;
- }
-
- /**
- * Returns the pointer part used to resolve the document fragment.
- *
- * @return String - The pointer part used to resolve the document fragment.
- */
- public XPointerPart getXPointerPart() {
- return fXPointerPart;
- }
-
- /**
- * Reports XPointer Errors
- *
- */
- private void reportError(String key, Object[] arguments)
- throws XNIException {
- /*
- fXPointerErrorReporter.reportError(
- XPointerMessageFormatter.XPOINTER_DOMAIN, key, arguments,
- XMLErrorReporter.SEVERITY_ERROR);
- */
- throw new XNIException((fErrorReporter
- .getMessageFormatter(XPointerMessageFormatter.XPOINTER_DOMAIN))
- .formatMessage(fErrorReporter.getLocale(), key, arguments));
- }
-
- /**
- * Reports XPointer Warnings
- *
- */
- private void reportWarning(String key, Object[] arguments)
- throws XNIException {
- fXPointerErrorReporter.reportError(
- XPointerMessageFormatter.XPOINTER_DOMAIN, key, arguments,
- XMLErrorReporter.SEVERITY_WARNING);
- }
-
- /**
- * Initializes error handling objects
- *
- */
- protected void initErrorReporter() {
- if (fXPointerErrorReporter == null) {
- fXPointerErrorReporter = new XMLErrorReporter();
- }
- if (fErrorHandler == null) {
- fErrorHandler = new XPointerErrorHandler();
- }
- /*
- fXPointerErrorReporter.setProperty(Constants.XERCES_PROPERTY_PREFIX
- + Constants.ERROR_HANDLER_PROPERTY, fErrorHandler);
- */
- fXPointerErrorReporter.putMessageFormatter(
- XPointerMessageFormatter.XPOINTER_DOMAIN,
- new XPointerMessageFormatter());
- }
-
- /**
- * Initializes the XPointer Processor;
- */
- protected void init() {
- fXPointerParts.clear();
- fXPointerPart = null;
- fFoundMatchingPtrPart = false;
- fIsXPointerResolved = false;
- //fFixupBase = false;
- //fFixupLang = false;
-
- initErrorReporter();
- }
-
- /**
- * Returns a Vector of XPointerPart objects
- *
- * @return A Vector of XPointerPart objects.
- */
- public Vector getPointerParts() {
- return fXPointerParts;
- }
-
- /**
- * List of XPointer Framework tokens.
- *
- * @xerces.internal
- *
- */
- private final class Tokens {
-
- /**
- * XPointer Framework tokens
- * [1] Pointer ::= Shorthand | SchemeBased
- * [2] Shorthand ::= NCName
- * [3] SchemeBased ::= PointerPart (S? PointerPart)*
- * [4] PointerPart ::= SchemeName '(' SchemeData ')'
- * [5] SchemeName ::= QName
- * [6] SchemeData ::= EscapedData*
- * [7] EscapedData ::= NormalChar | '^(' | '^)' | '^^' | '(' SchemeData ')'
- * [8] NormalChar ::= UnicodeChar - [()^]
- * [9] UnicodeChar ::= [#x0-#x10FFFF]
- *
- */
- private static final int XPTRTOKEN_OPEN_PAREN = 0,
- XPTRTOKEN_CLOSE_PAREN = 1, XPTRTOKEN_SHORTHAND = 2,
- XPTRTOKEN_SCHEMENAME = 3, XPTRTOKEN_SCHEMEDATA = 4;
-
- // Token names
- private final String[] fgTokenNames = { "XPTRTOKEN_OPEN_PAREN",
- "XPTRTOKEN_CLOSE_PAREN", "XPTRTOKEN_SHORTHAND",
- "XPTRTOKEN_SCHEMENAME", "XPTRTOKEN_SCHEMEDATA" };
-
- // Token count
- private static final int INITIAL_TOKEN_COUNT = 1 << 8;
-
- private int[] fTokens = new int[INITIAL_TOKEN_COUNT];
-
- private int fTokenCount = 0;
-
- // Current token position
- private int fCurrentTokenIndex;
-
- private SymbolTable fSymbolTable;
-
- private Hashtable fTokenNames = new Hashtable();
-
- /**
- * Constructor
- *
- * @param symbolTable SymbolTable
- */
- private Tokens(SymbolTable symbolTable) {
- fSymbolTable = symbolTable;
-
- fTokenNames.put(new Integer(XPTRTOKEN_OPEN_PAREN),
- "XPTRTOKEN_OPEN_PAREN");
- fTokenNames.put(new Integer(XPTRTOKEN_CLOSE_PAREN),
- "XPTRTOKEN_CLOSE_PAREN");
- fTokenNames.put(new Integer(XPTRTOKEN_SHORTHAND),
- "XPTRTOKEN_SHORTHAND");
- fTokenNames.put(new Integer(XPTRTOKEN_SCHEMENAME),
- "XPTRTOKEN_SCHEMENAME");
- fTokenNames.put(new Integer(XPTRTOKEN_SCHEMEDATA),
- "XPTRTOKEN_SCHEMEDATA");
- }
-
- /**
- * Returns the token String
- * @param token The index of the token
- * @return String The token string
- */
- private String getTokenString(int token) {
- return (String) fTokenNames.get(new Integer(token));
- }
-
- /**
- * Add the specified string as a token
- *
- * @param token The token string
- */
- private void addToken(String tokenStr) {
- Integer tokenInt = (Integer) fTokenNames.get(tokenStr);
- if (tokenInt == null) {
- tokenInt = new Integer(fTokenNames.size());
- fTokenNames.put(tokenInt, tokenStr);
- }
- addToken(tokenInt.intValue());
- }
-
- /**
- * Add the specified int token
- *
- * @param token The int specifying the token
- */
- private void addToken(int token) {
- try {
- fTokens[fTokenCount] = token;
- } catch (ArrayIndexOutOfBoundsException ex) {
- int[] oldList = fTokens;
- fTokens = new int[fTokenCount << 1];
- System.arraycopy(oldList, 0, fTokens, 0, fTokenCount);
- fTokens[fTokenCount] = token;
- }
- fTokenCount++;
- }
-
- /**
- * Resets the current position to the head of the token list.
- */
- private void rewind() {
- fCurrentTokenIndex = 0;
- }
-
- /**
- * Returns true if the {@link #getNextToken()} method
- * returns a valid token.
- */
- private boolean hasMore() {
- return fCurrentTokenIndex < fTokenCount;
- }
-
- /**
- * Obtains the token at the current position, then advance
- * the current position by one.
- *
- * throws If there's no such next token, this method throws
- * <tt>new XNIException("XPointerProcessingError");</tt>.
- */
- private int nextToken() throws XNIException {
- if (fCurrentTokenIndex == fTokenCount) {
- reportError("XPointerProcessingError", null);
- }
- return fTokens[fCurrentTokenIndex++];
- }
-
- /**
- * Obtains the token at the current position, without advancing
- * the current position.
- *
- * If there's no such next token, this method throws
- * <tt>new XNIException("XPointerProcessingError");</tt>.
- */
- private int peekToken() throws XNIException {
- if (fCurrentTokenIndex == fTokenCount) {
- reportError("XPointerProcessingError", null);
- }
- return fTokens[fCurrentTokenIndex];
- }
-
- /**
- * Obtains the token at the current position as a String.
- *
- * If there's no current token or if the current token
- * is not a string token, this method throws
- * If there's no such next token, this method throws
- * <tt>new XNIException("XPointerProcessingError");</tt>.
- */
- private String nextTokenAsString() throws XNIException {
- String tokenStrint = getTokenString(nextToken());
- if (tokenStrint == null) {
- reportError("XPointerProcessingError", null);
- }
- return tokenStrint;
- }
- }
-
- /**
- *
- * The XPointer expression scanner. Scans the XPointer framework expression.
- *
- * @xerces.internal
- *
- */
- private class Scanner {
-
- /**
- * 7-bit ASCII subset
- *
- * 0 1 2 3 4 5 6 7 8 9 A B C D E F
- * 0, 0, 0, 0, 0, 0, 0, 0, 0, HT, LF, 0, 0, CR, 0, 0, // 0
- * 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 1
- * SP, !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, // 2
- * 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, :, ;, <, =, >, ?, // 3
- * @, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, // 4
- * P, Q, R, S, T, U, V, W, X, Y, Z, [, \, ], ^, _, // 5
- * `, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, // 6
- * p, q, r, s, t, u, v, w, x, y, z, {, |, }, ~, DEL // 7
- */
- private static final byte CHARTYPE_INVALID = 0, // invalid XML character
- CHARTYPE_OTHER = 1, // not special - one of "#%&;?\`{}~" or DEL
- CHARTYPE_WHITESPACE = 2, // one of "\t\n\r " (0x09, 0x0A, 0x0D, 0x20)
- CHARTYPE_CARRET = 3, // ^
- CHARTYPE_OPEN_PAREN = 4, // '(' (0x28)
- CHARTYPE_CLOSE_PAREN = 5, // ')' (0x29)
- CHARTYPE_MINUS = 6, // '-' (0x2D)
- CHARTYPE_PERIOD = 7, // '.' (0x2E)
- CHARTYPE_SLASH = 8, // '/' (0x2F)
- CHARTYPE_DIGIT = 9, // '0'-'9' (0x30 to 0x39)
- CHARTYPE_COLON = 10, // ':' (0x3A)
- CHARTYPE_EQUAL = 11, // '=' (0x3D)
- CHARTYPE_LETTER = 12, // 'A'-'Z' or 'a'-'z' (0x41 to 0x5A and 0x61 to 0x7A)
- CHARTYPE_UNDERSCORE = 13, // '_' (0x5F)
- CHARTYPE_NONASCII = 14; // Non-ASCII Unicode codepoint (>= 0x80)
-
- private final byte[] fASCIICharMap = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2,
- 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 2, 1, 1, 1, 1, 1, 1, 1, 4, 5, 1, 1, 1, 6, 7, 8, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 10, 1, 1, 11, 1, 1, 1, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 1, 1, 1, 3, 13, 1, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 1, 1, 1, 1, 1 };
-
- //
- // Data
- //
- /** Symbol table. */
- private SymbolTable fSymbolTable;
-
- /**
- * Constructs an XPointer Framework expression scanner.
- *
- * @param symbolTable SymbolTable
- */
- private Scanner(SymbolTable symbolTable) {
- // save pool and tokens
- fSymbolTable = symbolTable;
-
- } // <init>(SymbolTable)
-
- /**
- * Scans the XPointer Expression
- *
- */
- private boolean scanExpr(SymbolTable symbolTable, Tokens tokens,
- String data, int currentOffset, int endOffset)
- throws XNIException {
-
- int ch;
- int openParen = 0;
- int closeParen = 0;
- int nameOffset, dataOffset;
- boolean isQName = false;
- String name = null;
- String prefix = null;
- String schemeData = null;
- StringBuffer schemeDataBuff = new StringBuffer();
-
- while (true) {
-
- if (currentOffset == endOffset) {
- break;
- }
- ch = data.charAt(currentOffset);
-
- //
- while (ch == ' ' || ch == 0x0A || ch == 0x09 || ch == 0x0D) {
- if (++currentOffset == endOffset) {
- break;
- }
- ch = data.charAt(currentOffset);
- }
- if (currentOffset == endOffset) {
- break;
- }
-
- //
- // [1] Pointer ::= Shorthand | SchemeBased
- // [2] Shorthand ::= NCName
- // [3] SchemeBased ::= PointerPart (S? PointerPart)*
- // [4] PointerPart ::= SchemeName '(' SchemeData ')'
- // [5] SchemeName ::= QName
- // [6] SchemeData ::= EscapedData*
- // [7] EscapedData ::= NormalChar | '^(' | '^)' | '^^' | '(' SchemeData ')'
- // [8] NormalChar ::= UnicodeChar - [()^]
- // [9] UnicodeChar ::= [#x0-#x10FFFF]
- // [?] QName ::= (NCName ':')? NCName
- // [?] NCName ::= (Letter | '_') (NCNameChar)*
- // [?] NCNameChar ::= Letter | Digit | '.' | '-' | '_' (ascii subset of 'NCNameChar')
- // [?] Letter ::= [A-Za-z] (ascii subset of 'Letter')
- // [?] Digit ::= [0-9] (ascii subset of 'Digit')
- //
- byte chartype = (ch >= 0x80) ? CHARTYPE_NONASCII
- : fASCIICharMap[ch];
-
- switch (chartype) {
-
- case CHARTYPE_OPEN_PAREN: // '('
- addToken(tokens, Tokens.XPTRTOKEN_OPEN_PAREN);
- openParen++;
- ++currentOffset;
- break;
-
- case CHARTYPE_CLOSE_PAREN: // ')'
- addToken(tokens, Tokens.XPTRTOKEN_CLOSE_PAREN);
- closeParen++;
- ++currentOffset;
- break;
-
- case CHARTYPE_CARRET:
- case CHARTYPE_COLON:
- case CHARTYPE_DIGIT:
- case CHARTYPE_EQUAL:
- case CHARTYPE_LETTER:
- case CHARTYPE_MINUS:
- case CHARTYPE_NONASCII:
- case CHARTYPE_OTHER:
- case CHARTYPE_PERIOD:
- case CHARTYPE_SLASH:
- case CHARTYPE_UNDERSCORE:
- case CHARTYPE_WHITESPACE:
- // Scanning SchemeName | Shorthand
- if (openParen == 0) {
- nameOffset = currentOffset;
- currentOffset = scanNCName(data, endOffset,
- currentOffset);
-
- if (currentOffset == nameOffset) {
- reportError("InvalidShortHandPointer",
- new Object[] { data });
- return false;
- }
-
- if (currentOffset < endOffset) {
- ch = data.charAt(currentOffset);
- } else {
- ch = -1;
- }
-
- name = symbolTable.addSymbol(data.substring(nameOffset,
- currentOffset));
- prefix = XMLSymbols.EMPTY_STRING;
-
- // The name is a QName => a SchemeName
- if (ch == ':') {
- if (++currentOffset == endOffset) {
- return false;
- }
-
- ch = data.charAt(currentOffset);
- prefix = name;
- nameOffset = currentOffset;
- currentOffset = scanNCName(data, endOffset,
- currentOffset);
-
- if (currentOffset == nameOffset) {
- return false;
- }
-
- if (currentOffset < endOffset) {
- ch = data.charAt(currentOffset);
- } else {
- ch = -1;
- }
-
- isQName = true;
- name = symbolTable.addSymbol(data.substring(
- nameOffset, currentOffset));
- }
-
- // REVISIT:
- if (currentOffset != endOffset) {
- addToken(tokens, Tokens.XPTRTOKEN_SCHEMENAME);
- tokens.addToken(prefix);
- tokens.addToken(name);
- isQName = false;
- } else if (currentOffset == endOffset) {
- // NCName => Shorthand
- addToken(tokens, Tokens.XPTRTOKEN_SHORTHAND);
- tokens.addToken(name);
- isQName = false;
- }
-
- // reset open/close paren for the next pointer part
- closeParen = 0;
-
- break;
-
- } else if (openParen > 0 && closeParen == 0 && name != null) {
- // Scanning SchemeData
- dataOffset = currentOffset;
- currentOffset = scanData(data, schemeDataBuff,
- endOffset, currentOffset);
-
- if (currentOffset == dataOffset) {
- reportError("InvalidSchemeDataInXPointer",
- new Object[] { data });
- return false;
- }
-
- if (currentOffset < endOffset) {
- ch = data.charAt(currentOffset);
- } else {
- ch = -1;
- }
-
- schemeData = symbolTable.addSymbol(schemeDataBuff
- .toString());
- addToken(tokens, Tokens.XPTRTOKEN_SCHEMEDATA);
- tokens.addToken(schemeData);
-
- // reset open/close paren for the next pointer part
- openParen = 0;
- schemeDataBuff.delete(0, schemeDataBuff.length());
-
- } else {
- // ex. schemeName()
- // Should we throw an exception with a more suitable message instead??
- return false;
- }
- }
- } // end while
- return true;
- }
-
- /**
- * Scans a NCName.
- * From Namespaces in XML
- * [5] NCName ::= (Letter | '_') (NCNameChar)*
- * [6] NCNameChar ::= Letter | Digit | '.' | '-' | '_' | CombiningChar | Extender
- *
- * @param data A String containing the XPointer expression
- * @param endOffset The int XPointer expression length
- * @param currentOffset An int representing the current position of the XPointer expression pointer
- */
- private int scanNCName(String data, int endOffset, int currentOffset) {
- int ch = data.charAt(currentOffset);
- if (ch >= 0x80) {
- if (!XMLChar.isNameStart(ch)) {
- return currentOffset;
- }
- } else {
- byte chartype = fASCIICharMap[ch];
- if (chartype != CHARTYPE_LETTER
- && chartype != CHARTYPE_UNDERSCORE) {
- return currentOffset;
- }
- }
-
- //while (currentOffset++ < endOffset) {
- while (++currentOffset < endOffset) {
- ch = data.charAt(currentOffset);
- if (ch >= 0x80) {
- if (!XMLChar.isName(ch)) {
- break;
- }
- } else {
- byte chartype = fASCIICharMap[ch];
- if (chartype != CHARTYPE_LETTER
- && chartype != CHARTYPE_DIGIT
- && chartype != CHARTYPE_PERIOD
- && chartype != CHARTYPE_MINUS
- && chartype != CHARTYPE_UNDERSCORE) {
- break;
- }
- }
- }
- return currentOffset;
- }
-
- /**
- * Scans the SchemeData.
- * [6] SchemeData ::= EscapedData*
- * [7] EscapedData ::= NormalChar | '^(' | '^)' | '^^' | '(' SchemeData ')'
- * [8] NormalChar ::= UnicodeChar - [()^]
- * [9] UnicodeChar ::= [#x0-#x10FFFF]
- *
- */
- private int scanData(String data, StringBuffer schemeData,
- int endOffset, int currentOffset) {
- while (true) {
-
- if (currentOffset == endOffset) {
- break;
- }
-
- int ch = data.charAt(currentOffset);
- byte chartype = (ch >= 0x80) ? CHARTYPE_NONASCII
- : fASCIICharMap[ch];
-
- if (chartype == CHARTYPE_OPEN_PAREN) {
- schemeData.append(ch);
- //schemeData.append(Tokens.XPTRTOKEN_OPEN_PAREN);
- currentOffset = scanData(data, schemeData, endOffset,
- ++currentOffset);
- if (currentOffset == endOffset) {
- return currentOffset;
- }
-
- ch = data.charAt(currentOffset);
- chartype = (ch >= 0x80) ? CHARTYPE_NONASCII
- : fASCIICharMap[ch];
-
- if (chartype != CHARTYPE_CLOSE_PAREN) {
- return endOffset;
- }
- schemeData.append((char) ch);
- ++currentOffset;//
-
- } else if (chartype == CHARTYPE_CLOSE_PAREN) {
- return currentOffset;
-
- } else if (chartype == CHARTYPE_CARRET) {
- ch = data.charAt(++currentOffset);
- chartype = (ch >= 0x80) ? CHARTYPE_NONASCII
- : fASCIICharMap[ch];
-
- if (chartype != CHARTYPE_CARRET
- && chartype != CHARTYPE_OPEN_PAREN
- && chartype != CHARTYPE_CLOSE_PAREN) {
- break;
- }
- schemeData.append((char) ch);
- ++currentOffset;
-
- } else {
- schemeData.append((char) ch);
- ++currentOffset;//
- }
- }
-
- return currentOffset;
- }
-
- //
- // Protected methods
- //
-
- /**
- * This method adds the specified token to the token list. By
- * default, this method allows all tokens. However, subclasses
- * of the XPathExprScanner can override this method in order
- * to disallow certain tokens from being used in the scanned
- * XPath expression. This is a convenient way of allowing only
- * a subset of XPath.
- */
- protected void addToken(Tokens tokens, int token) throws XNIException {
- tokens.addToken(token);
- } // addToken(int)
-
- } // class Scanner
-
- // ************************************************************************
- // Overridden XMLDocumentHandler methods
- // ************************************************************************
- /**
- * If the comment is a child of a matched element, then pass else return.
- *
- * @param text The text in the comment.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by application to signal an error.
- */
- public void comment(XMLString text, Augmentations augs) throws XNIException {
- if (!isChildFragmentResolved()) {
- return;
- }
- super.comment(text, augs);
- }
-
- /**
- * A processing instruction. Processing instructions consist of a
- * target name and, optionally, text data. The data is only meaningful
- * to the application.
- * <p>
- * Typically, a processing instruction's data will contain a series
- * of pseudo-attributes. These pseudo-attributes follow the form of
- * element attributes but are <strong>not</strong> parsed or presented
- * to the application as anything other than text. The application is
- * responsible for parsing the data.
- *
- * @param target The target.
- * @param data The data or null if none specified.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void processingInstruction(String target, XMLString data,
- Augmentations augs) throws XNIException {
- if (!isChildFragmentResolved()) {
- return;
- }
- super.processingInstruction(target, data, augs);
- }
-
- /**
- * The start of an element.
- *
- * @param element The name of the element.
- * @param attributes The element attributes.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void startElement(QName element, XMLAttributes attributes,
- Augmentations augs) throws XNIException {
- if (!resolveXPointer(element, attributes, augs,
- XPointerPart.EVENT_ELEMENT_START)) {
-
- // xml:base and xml:lang processing
- if (fFixupBase) {
- processXMLBaseAttributes(attributes);
- }
- if (fFixupLang) {
- processXMLLangAttributes(attributes);
- }
-
- // set the context invalid if the element till an element from the result infoset is included
- fNamespaceContext.setContextInvalid();
-
- return;
- }
- super.startElement(element, attributes, augs);
- }
-
- /**
- * An empty element.
- *
- * @param element The name of the element.
- * @param attributes The element attributes.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void emptyElement(QName element, XMLAttributes attributes,
- Augmentations augs) throws XNIException {
- if (!resolveXPointer(element, attributes, augs,
- XPointerPart.EVENT_ELEMENT_EMPTY)) {
- // xml:base and xml:lang processing
- if (fFixupBase) {
- processXMLBaseAttributes(attributes);
- }
- if (fFixupLang) {
- processXMLLangAttributes(attributes);
- }
- // no need to restore restoreBaseURI() for xml:base and xml:lang processing
-
- // set the context invalid if the element till an element from the result infoset is included
- fNamespaceContext.setContextInvalid();
- return;
- }
- super.emptyElement(element, attributes, augs);
- }
-
- /**
- * Character content.
- *
- * @param text The content.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void characters(XMLString text, Augmentations augs)
- throws XNIException {
- if (!isChildFragmentResolved()) {
- return;
- }
- super.characters(text, augs);
- }
-
- /**
- * Ignorable whitespace. For this method to be called, the document
- * source must have some way of determining that the text containing
- * only whitespace characters should be considered ignorable. For
- * example, the validator can determine if a length of whitespace
- * characters in the document are ignorable based on the element
- * content model.
- *
- * @param text The ignorable whitespace.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void ignorableWhitespace(XMLString text, Augmentations augs)
- throws XNIException {
- if (!isChildFragmentResolved()) {
- return;
- }
- super.ignorableWhitespace(text, augs);
- }
-
- /**
- * The end of an element.
- *
- * @param element The name of the element.
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void endElement(QName element, Augmentations augs)
- throws XNIException {
- if (!resolveXPointer(element, null, augs,
- XPointerPart.EVENT_ELEMENT_END)) {
-
- // no need to restore restoreBaseURI() for xml:base and xml:lang processing
- return;
- }
- super.endElement(element, augs);
- }
-
- /**
- * The start of a CDATA section.
- *
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void startCDATA(Augmentations augs) throws XNIException {
- if (!isChildFragmentResolved()) {
- return;
- }
- super.startCDATA(augs);
- }
-
- /**
- * The end of a CDATA section.
- *
- * @param augs Additional information that may include infoset augmentations
- *
- * @exception XNIException
- * Thrown by handler to signal an error.
- */
- public void endCDATA(Augmentations augs) throws XNIException {
- if (!isChildFragmentResolved()) {
- return;
- }
- super.endCDATA(augs);
- }
-
- // ************************************************************************
- // Overridden XMLComponent methods
- // ************************************************************************
- /**
- * <p>
- * Sets the value of a property. This method is called by the component
- * manager any time after reset when a property changes value.
- * </p>
- * <strong>Note:</strong> Components should silently ignore properties
- * that do not affect the operation of the component.
- *
- * @param propertyId The property identifier.
- * @param value The value of the property.
- *
- * @throws XMLConfigurationException Thrown for configuration error.
- * In general, components should
- * only throw this exception if
- * it is <strong>really</strong>
- * a critical error.
- */
- public void setProperty(String propertyId, Object value)
- throws XMLConfigurationException {
-
- // Error reporter
- if (propertyId == Constants.XERCES_PROPERTY_PREFIX
- + Constants.ERROR_REPORTER_PROPERTY) {
- if (value != null) {
- fXPointerErrorReporter = (XMLErrorReporter) value;
- } else {
- fXPointerErrorReporter = null;
- }
- }
-
- // Error handler
- if (propertyId == Constants.XERCES_PROPERTY_PREFIX
- + Constants.ERROR_HANDLER_PROPERTY) {
- if (value != null) {
- fErrorHandler = (XMLErrorHandler) value;
- } else {
- fErrorHandler = null;
- }
- }
-
- // xml:lang
- if (propertyId == Constants.XERCES_FEATURE_PREFIX
- + Constants.XINCLUDE_FIXUP_LANGUAGE_FEATURE) {
- if (value != null) {
- fFixupLang = ((Boolean)value).booleanValue();
- } else {
- fFixupLang = false;
- }
- }
-
- // xml:base
- if (propertyId == Constants.XERCES_FEATURE_PREFIX
- + Constants.XINCLUDE_FIXUP_BASE_URIS_FEATURE) {
- if (value != null) {
- fFixupBase = ((Boolean)value).booleanValue();
- } else {
- fFixupBase = false;
- }
- }
-
- //
- if (propertyId == Constants.XERCES_PROPERTY_PREFIX
- + Constants.NAMESPACE_CONTEXT_PROPERTY) {
- fNamespaceContext = (XIncludeNamespaceSupport) value;
- }
-
- super.setProperty(propertyId, value);
- }
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xpointer/XPointerMessageFormatter.java b/src/com/sun/org/apache/xerces/internal/xpointer/XPointerMessageFormatter.java
deleted file mode 100644
index 639bdef..0000000
--- a/src/com/sun/org/apache/xerces/internal/xpointer/XPointerMessageFormatter.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xerces.internal.xpointer;
-
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-import java.util.PropertyResourceBundle;
-import com.sun.org.apache.xerces.internal.util.MessageFormatter;
-import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
-
-/**
- * XPointerMessageFormatter provides error messages for the XPointer Framework
- * and element() Scheme Recommendations.
- *
- * @xerces.internal
- *
- * @version $Id: XPointerMessageFormatter.java,v 1.5 2010-11-01 04:40:26 joehw Exp $
- */
-class XPointerMessageFormatter implements MessageFormatter {
-
- public static final String XPOINTER_DOMAIN = "http://www.w3.org/TR/XPTR";
-
- // private objects to cache the locale and resource bundle
- private Locale fLocale = null;
-
- private ResourceBundle fResourceBundle = null;
-
- /**
- * Formats a message with the specified arguments using the given locale
- * information.
- *
- * @param locale
- * The locale of the message.
- * @param key
- * The message key.
- * @param arguments
- * The message replacement text arguments. The order of the
- * arguments must match that of the placeholders in the actual
- * message.
- *
- * @return Returns the formatted message.
- *
- * @throws MissingResourceException
- * Thrown if the message with the specified key cannot be found.
- */
- public String formatMessage(Locale locale, String key, Object[] arguments)
- throws MissingResourceException {
-
- if (fResourceBundle == null || locale != fLocale) {
- if (locale != null) {
- fResourceBundle = SecuritySupport.getResourceBundle(
- "com.sun.org.apache.xerces.internal.impl.msg.XPointerMessages", locale);
- // memorize the most-recent locale
- fLocale = locale;
- }
- if (fResourceBundle == null)
- fResourceBundle = SecuritySupport.getResourceBundle(
- "com.sun.org.apache.xerces.internal.impl.msg.XPointerMessages");
- }
-
- String msg = fResourceBundle.getString(key);
- if (arguments != null) {
- try {
- msg = java.text.MessageFormat.format(msg, arguments);
- } catch (Exception e) {
- msg = fResourceBundle.getString("FormatFailed");
- msg += " " + fResourceBundle.getString(key);
- }
- }
-
- if (msg == null) {
- msg = fResourceBundle.getString("BadMessageKey");
- throw new MissingResourceException(msg,
- "com.sun.org.apache.xerces.internal.impl.msg.XPointerMessages", key);
- }
-
- return msg;
- }
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xpointer/XPointerPart.java b/src/com/sun/org/apache/xerces/internal/xpointer/XPointerPart.java
deleted file mode 100644
index 667face..0000000
--- a/src/com/sun/org/apache/xerces/internal/xpointer/XPointerPart.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xerces.internal.xpointer;
-
-import com.sun.org.apache.xerces.internal.xni.Augmentations;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-
-/**
- * <p>
- * Used for scheme specific parsing and evaluation of an XPointer expression.
- * This interface applies to both ShortHand and SchemeBased XPointer
- * expressions.
- * </p>
- *
- * @xerces.internal
- *
- */
-public interface XPointerPart {
-
- // The start element event
- public static final int EVENT_ELEMENT_START = 0;
-
- // The end element event
- public static final int EVENT_ELEMENT_END = 1;
-
- // The empty element event
- public static final int EVENT_ELEMENT_EMPTY = 2;
-
- /**
- * Provides scheme specific parsing of a XPointer expression i.e.
- * the PointerPart or ShortHandPointer.
- *
- * @param xpointer A String representing the PointerPart or ShortHandPointer.
- * @throws XNIException Thrown if the PointerPart string does not conform to
- * the syntax defined by its scheme.
- *
- */
- public void parseXPointer(String part) throws XNIException;
-
- /**
- * Evaluates an XML resource with respect to an XPointer expressions
- * by checking if it's element and attributes parameters match the
- * criteria specified in the xpointer expression.
- *
- * @param element - The name of the element.
- * @param attributes - The element attributes.
- * @param augs - Additional information that may include infoset augmentations
- * @param event - An integer indicating
- * 0 - The start of an element
- * 1 - The end of an element
- * 2 - An empty element call
- * @throws XNIException Thrown to signal an error
- *
- */
- public boolean resolveXPointer(QName element, XMLAttributes attributes,
- Augmentations augs, int event) throws XNIException;
-
- /**
- * Returns true if the XPointer expression resolves to a resource fragment
- * specified as input else returns false.
- *
- * @return True if the xpointer expression matches a fragment in the resource
- * else returns false.
- * @throws XNIException Thrown to signal an error
- *
- */
- public boolean isFragmentResolved() throws XNIException;
-
- /**
- * Returns true if the XPointer expression resolves to a non-element child
- * of the current resource fragment.
- *
- * @return True if the XPointer expression resolves to a non-element child
- * of the current resource fragment.
- * @throws XNIException Thrown to signal an error
- *
- */
- public boolean isChildFragmentResolved() throws XNIException;
-
- /**
- * Returns a String containing the scheme name of the PointerPart
- * or the name of the ShortHand Pointer.
- *
- * @return A String containing the scheme name of the PointerPart.
- *
- */
- public String getSchemeName();
-
- /**
- * Returns a String containing the scheme data of the PointerPart.
- *
- * @return A String containing the scheme data of the PointerPart.
- *
- */
- public String getSchemeData();
-
- /**
- * Sets the scheme name of the PointerPart or the ShortHand Pointer name.
- *
- * @param schemeName A String containing the scheme name of the PointerPart.
- *
- */
- public void setSchemeName(String schemeName);
-
- /**
- * Sets the scheme data of the PointerPart.
- *
- * @param schemeData A String containing the scheme data of the PointerPart.
- *
- */
- public void setSchemeData(String schemeData);
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xpointer/XPointerProcessor.java b/src/com/sun/org/apache/xerces/internal/xpointer/XPointerProcessor.java
deleted file mode 100644
index c6e746e..0000000
--- a/src/com/sun/org/apache/xerces/internal/xpointer/XPointerProcessor.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xpointer;
-
-import com.sun.org.apache.xerces.internal.xni.Augmentations;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-
-/**
- * <p>
- * The XPointerProcessor is responsible for parsing an XPointer
- * expression and and providing scheme specific resolution of
- * the document fragment pointed to be the pointer.
- * </p>
- *
- * @xerces.internal
- *
- *
- */
-public interface XPointerProcessor {
-
- // The start element event
- public static final int EVENT_ELEMENT_START = 0;
-
- // The end element event
- public static final int EVENT_ELEMENT_END = 1;
-
- // The empty element event
- public static final int EVENT_ELEMENT_EMPTY = 2;
-
- /**
- * Parses an XPointer expression. It performs scheme specific processing
- * depending on the pointer parts and sets up a Vector of XPointerParts
- * in the order (left-to-right) they appear in the XPointer expression.
- *
- * @param xpointer A String representing the xpointer expression.
- * @throws XNIException Thrown if the xpointer string does not conform to
- * the XPointer Framework syntax or the syntax of the pointer part does
- * not conform to its definition for its scheme.
- *
- */
- public void parseXPointer(String xpointer) throws XNIException;
-
- /**
- * Evaluates an XML resource with respect to an XPointer expressions
- * by checking if it's element and attributes parameters match the
- * criteria specified in the xpointer expression.
- *
- * @param element - The name of the element.
- * @param attributes - The element attributes.
- * @param augs - Additional information that may include infoset augmentations
- * @param event - An integer indicating
- * 0 - The start of an element
- * 1 - The end of an element
- * 2 - An empty element call
- * @return true if the element was resolved by the xpointer
- * @throws XNIException Thrown to signal an error
- *
- */
- public boolean resolveXPointer(QName element, XMLAttributes attributes,
- Augmentations augs, int event) throws XNIException;
-
- /**
- * Returns true if the XPointer expression resolves to the current resource fragment
- * or Node which is part of the input resource being streamed else returns false.
- *
- * @return True if the xpointer expression matches a node/fragment in the resource
- * else returns false.
- * @throws XNIException Thrown to signal an error
- *
- */
- public boolean isFragmentResolved() throws XNIException;
-
- /**
- * Returns true if the XPointer expression resolves any subresource of the
- * input resource.
- *
- * @return True if the xpointer expression matches a fragment in the resource
- * else returns false.
- * @throws XNIException Thrown to signal an error
- *
- */
- public boolean isXPointerResolved() throws XNIException;
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xs/AttributePSVI.java b/src/com/sun/org/apache/xerces/internal/xs/AttributePSVI.java
deleted file mode 100644
index 5b0979b..0000000
--- a/src/com/sun/org/apache/xerces/internal/xs/AttributePSVI.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xs;
-
-/**
- * Represents a PSVI item for one attribute information item.
- */
-public interface AttributePSVI extends ItemPSVI {
- /**
- * [attribute declaration]: An item isomorphic to the declaration
- * component itself.
- */
- public XSAttributeDeclaration getAttributeDeclaration();
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xs/ElementPSVI.java b/src/com/sun/org/apache/xerces/internal/xs/ElementPSVI.java
deleted file mode 100644
index f3a68ac..0000000
--- a/src/com/sun/org/apache/xerces/internal/xs/ElementPSVI.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xs;
-
-/**
- * Represents a PSVI item for one element information item.
- */
-public interface ElementPSVI extends ItemPSVI {
- /**
- * [element declaration]: an item isomorphic to the element declaration
- * used to validate this element.
- */
- public XSElementDeclaration getElementDeclaration();
-
- /**
- * [notation]: the notation declaration.
- */
- public XSNotationDeclaration getNotation();
-
- /**
- * [nil]: true if clause 3.2 of Element Locally Valid (Element) (3.3.4) is
- * satisfied, otherwise false.
- */
- public boolean getNil();
-
- /**
- * schema information: the schema information property if it is the
- * validation root, <code>null</code> otherwise.
- */
- public XSModel getSchemaInformation();
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xs/ItemPSVI.java b/src/com/sun/org/apache/xerces/internal/xs/ItemPSVI.java
deleted file mode 100644
index 48d863e..0000000
--- a/src/com/sun/org/apache/xerces/internal/xs/ItemPSVI.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xs;
-
-/**
- * Represents an abstract PSVI item for an element or an attribute
- * information item.
- */
-public interface ItemPSVI {
- /**
- * Validity value indicating that validation has either not been performed
- * or that a strict assessment of validity could not be performed.
- */
- public static final short VALIDITY_NOTKNOWN = 0;
- /**
- * Validity value indicating that validation has been strictly assessed
- * and the item in question is invalid according to the rules of schema
- * validation.
- */
- public static final short VALIDITY_INVALID = 1;
- /**
- * Validation status indicating that schema validation has been performed
- * and the item in question is valid according to the rules of schema
- * validation.
- */
- public static final short VALIDITY_VALID = 2;
- /**
- * Validation status indicating that schema validation has been performed
- * and the item in question has specifically been skipped.
- */
- public static final short VALIDATION_NONE = 0;
- /**
- * Validation status indicating that schema validation has been performed
- * on the item in question under the rules of lax validation.
- */
- public static final short VALIDATION_PARTIAL = 1;
- /**
- * Validation status indicating that full schema validation has been
- * performed on the item.
- */
- public static final short VALIDATION_FULL = 2;
- /**
- * The nearest ancestor element information item with a
- * <code>[schema information]</code> property (or this element item
- * itself if it has such a property). For more information refer to
- * element validation context and attribute validation context .
- */
- public String getValidationContext();
-
- /**
- * <code>[validity]</code>: determines the validity of the schema item
- * with respect to the validation being attempted. The value will be one
- * of the constants: <code>VALIDITY_NOTKNOWN</code>,
- * <code>VALIDITY_INVALID</code> or <code>VALIDITY_VALID</code>.
- */
- public short getValidity();
-
- /**
- * <code>[validation attempted]</code>: determines the extent to which
- * the schema item has been validated. The value will be one of the
- * constants: <code>VALIDATION_NONE</code>,
- * <code>VALIDATION_PARTIAL</code> or <code>VALIDATION_FULL</code>.
- */
- public short getValidationAttempted();
-
- /**
- * <code>[schema error code]</code>: a list of error codes generated from
- * the validation attempt or an empty <code>StringList</code> if no
- * errors occurred during the validation attempt.
- */
- public StringList getErrorCodes();
-
- /**
- * <code>[schema normalized value]</code>: the normalized value of this
- * item after validation.
- */
- public String getSchemaNormalizedValue();
-
- /**
- * <code>[schema normalized value]</code>: Binding specific actual value
- * or <code>null</code> if the value is in error.
- * @exception XSException
- * NOT_SUPPORTED_ERR: Raised if the implementation does not support this
- * method.
- */
- public Object getActualNormalizedValue()
- throws XSException;
-
- /**
- * The actual value built-in datatype, e.g.
- * <code>STRING_DT, SHORT_DT</code>. If the type definition of this
- * value is a list type definition, this method returns
- * <code>LIST_DT</code>. If the type definition of this value is a list
- * type definition whose item type is a union type definition, this
- * method returns <code>LISTOFUNION_DT</code>. To query the actual value
- * of the list or list of union type definitions use
- * <code>itemValueTypes</code>. If the <code>actualNormalizedValue</code>
- * is <code>null</code>, this method returns <code>UNAVAILABLE_DT</code>
- * .
- * @exception XSException
- * NOT_SUPPORTED_ERR: Raised if the implementation does not support this
- * method.
- */
- public short getActualNormalizedValueType()
- throws XSException;
-
- /**
- * In the case the actual value represents a list, i.e. the
- * <code>actualNormalizedValueType</code> is <code>LIST_DT</code>, the
- * returned array consists of one type kind which represents the itemType
- * . For example:
- * <pre> &lt;simpleType name="listtype"&gt; &lt;list
- * itemType="positiveInteger"/&gt; &lt;/simpleType&gt; &lt;element
- * name="list" type="listtype"/&gt; ... &lt;list&gt;1 2 3&lt;/list&gt; </pre>
- *
- * The <code>schemaNormalizedValue</code> value is "1 2 3", the
- * <code>actualNormalizedValueType</code> value is <code>LIST_DT</code>,
- * and the <code>itemValueTypes</code> is an array of size 1 with the
- * value <code>POSITIVEINTEGER_DT</code>.
- * <br> If the actual value represents a list type definition whose item
- * type is a union type definition, i.e. <code>LISTOFUNION_DT</code>,
- * for each actual value in the list the array contains the
- * corresponding memberType kind. For example:
- * <pre> &lt;simpleType
- * name='union_type' memberTypes="integer string"/&gt; &lt;simpleType
- * name='listOfUnion'&gt; &lt;list itemType='union_type'/&gt;
- * &lt;/simpleType&gt; &lt;element name="list" type="listOfUnion"/&gt;
- * ... &lt;list&gt;1 2 foo&lt;/list&gt; </pre>
- * The
- * <code>schemaNormalizedValue</code> value is "1 2 foo", the
- * <code>actualNormalizedValueType</code> is <code>LISTOFUNION_DT</code>
- * , and the <code>itemValueTypes</code> is an array of size 3 with the
- * following values: <code>INTEGER_DT, INTEGER_DT, STRING_DT</code>.
- * @exception XSException
- * NOT_SUPPORTED_ERR: Raised if the implementation does not support this
- * method.
- */
- public ShortList getItemValueTypes()
- throws XSException;
-
- /**
- * <code>[type definition]</code>: an item isomorphic to the type
- * definition used to validate the schema item.
- */
- public XSTypeDefinition getTypeDefinition();
-
- /**
- * <code>[member type definition]</code>: if and only if that type
- * definition is a simple type definition with {variety} union, or a
- * complex type definition whose {content type} is a simple type
- * definition with {variety} union, then an item isomorphic to that
- * member of the union's {member type definitions} which actually
- * validated the schema item's normalized value.
- */
- public XSSimpleTypeDefinition getMemberTypeDefinition();
-
- /**
- * <code>[schema default]</code>: the canonical lexical representation of
- * the declaration's {value constraint} value. For more information
- * refer to element schema default and attribute schema default.
- */
- public String getSchemaDefault();
-
- /**
- * <code>[schema specified]</code>: if true, the value was specified in
- * the schema. If false, the value comes from the infoset. For more
- * information refer to element specified and attribute specified.
- */
- public boolean getIsSchemaSpecified();
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xs/LSInputList.java b/src/com/sun/org/apache/xerces/internal/xs/LSInputList.java
deleted file mode 100644
index 6459631..0000000
--- a/src/com/sun/org/apache/xerces/internal/xs/LSInputList.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xs;
-
-import java.util.List;
-
-import org.w3c.dom.ls.LSInput;
-
-/**
- * The <code>LSInputList</code> interface provides the abstraction of an
- * ordered collection of <code>LSInput</code>s, without defining or
- * constraining how this collection is implemented.
- */
-public interface LSInputList extends List {
- /**
- * The number of <code>LSInput</code>s in the list. The range of valid
- * child object indices is 0 to <code>length-1</code> inclusive.
- */
- public int getLength();
-
- /**
- * Returns the <code>index</code>th item in the collection or
- * <code>null</code> if <code>index</code> is greater than or equal to
- * the number of objects in the list. The index starts at 0.
- * @param index index into the collection.
- * @return The <code>LSInput</code> at the <code>index</code>th
- * position in the <code>LSInputList</code>, or <code>null</code> if
- * the index specified is not valid.
- */
- public LSInput item(int index);
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xs/PSVIProvider.java b/src/com/sun/org/apache/xerces/internal/xs/PSVIProvider.java
deleted file mode 100644
index 1dca0dd..0000000
--- a/src/com/sun/org/apache/xerces/internal/xs/PSVIProvider.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xs;
-
-/**
- * This interface provides access to the post schema validation infoset for an
- * API that provides a streaming document infoset, such as SAX, XNI, and
- * others.
- * <p>For implementations that would like to provide access to the PSVI in a
- * streaming model, a parser object should also implement the
- * <code>PSVIProvider</code> interface. Within the scope of the methods
- * handling the start and end of an element, applications may use the
- * <code>PSVIProvider</code> to retrieve the PSVI related to the element and
- * its attributes.
- */
-public interface PSVIProvider {
- /**
- * Provides the post schema validation item for the current element
- * information item. The method must be called by an application while
- * in the scope of the methods which report the start and end of an
- * element. For example, for SAX the method must be called within the
- * scope of the document handler's <code>startElement</code> or
- * <code>endElement</code> call. If the method is called outside of the
- * specified scope, the return value is undefined.
- * @return The post schema validation infoset for the current element. If
- * an element information item is valid, then in the
- * post-schema-validation infoset the following properties must be
- * available for the element information item: The following
- * properties are available in the scope of the method that reports
- * the start of an element: {element declaration}, {validation
- * context}, {notation}. The {schema information} property is
- * available for the validation root. The {error codes} property is
- * available if any errors occured during validation. The following
- * properties are available in the scope of the method that reports
- * the end of an element: {nil}, {schema specified}, {normalized
- * value},{ member type definition}, {validity}, {validation attempted}
- * . If the declaration has a value constraint, the property {schema
- * default} is available. The {error codes} property is available if
- * any errors occured during validation. Note: some processors may
- * choose to provide all the PSVI properties in the scope of the
- * method that reports the end of an element.
- */
- public ElementPSVI getElementPSVI();
-
- /**
- * Provides <code>AttributePSVI</code> given the index of an attribute
- * information item in the current element's attribute list. The method
- * must be called by an application while in the scope of the methods
- * which report the start and end of an element at a point where the
- * attribute list is available. For example, for SAX the method must be
- * called while in the scope of the document handler's
- * <code>startElement</code> call. If the method is called outside of
- * the specified scope, the return value is undefined.
- * @param index The attribute index.
- * @return The post schema validation properties of the attribute.
- */
- public AttributePSVI getAttributePSVI(int index);
-
- /**
- * Provides <code>AttributePSVI</code> given the namespace name and the
- * local name of an attribute information item in the current element's
- * attribute list. The method must be called by an application while in
- * the scope of the methods which report the start and end of an element
- * at a point where the attribute list is available. For example, for
- * SAX the method must be called while in the scope of the document
- * handler's <code>startElement</code> call. If the method is called
- * outside of the specified scope, the return value is undefined.
- * @param uri The namespace name of an attribute.
- * @param localname The local name of an attribute.
- * @return The post schema validation properties of the attribute.
- */
- public AttributePSVI getAttributePSVIByName(String uri,
- String localname);
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xs/ShortList.java b/src/com/sun/org/apache/xerces/internal/xs/ShortList.java
deleted file mode 100644
index a10e122..0000000
--- a/src/com/sun/org/apache/xerces/internal/xs/ShortList.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xs;
-
-import java.util.List;
-
-/**
- * The <code>ShortList</code> is an immutable ordered collection of
- * <code>unsigned short</code>.
- */
-public interface ShortList extends List {
- /**
- * The number of <code>unsigned short</code>s in the list. The range of
- * valid child object indices is 0 to <code>length-1</code> inclusive.
- */
- public int getLength();
-
- /**
- * Checks if the <code>unsigned short</code> <code>item</code> is a
- * member of this list.
- * @param item <code>unsigned short</code> whose presence in this list
- * is to be tested.
- * @return True if this list contains the <code>unsigned short</code>
- * <code>item</code>.
- */
- public boolean contains(short item);
-
- /**
- * Returns the <code>index</code>th item in the collection. The index
- * starts at 0.
- * @param index index into the collection.
- * @return The <code>unsigned short</code> at the <code>index</code>th
- * position in the <code>ShortList</code>.
- * @exception XSException
- * INDEX_SIZE_ERR: if <code>index</code> is greater than or equal to the
- * number of objects in the list.
- */
- public short item(int index)
- throws XSException;
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xs/StringList.java b/src/com/sun/org/apache/xerces/internal/xs/StringList.java
deleted file mode 100644
index f8e34e1..0000000
--- a/src/com/sun/org/apache/xerces/internal/xs/StringList.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xs;
-
-import java.util.List;
-
-/**
- * The <code>StringList</code> is an immutable ordered collection of
- * <code>GenericString</code>.
- */
-public interface StringList extends List {
- /**
- * The number of <code>GenericString</code>s in the list. The range of
- * valid child object indices is 0 to <code>length-1</code> inclusive.
- */
- public int getLength();
-
- /**
- * Checks if the <code>GenericString</code> <code>item</code> is a member
- * of this list.
- * @param item <code>GenericString</code> whose presence in this list is
- * to be tested.
- * @return True if this list contains the <code>GenericString</code>
- * <code>item</code>.
- */
- public boolean contains(String item);
-
- /**
- * Returns the <code>index</code>th item in the collection or
- * <code>null</code> if <code>index</code> is greater than or equal to
- * the number of objects in the list. The index starts at 0.
- * @param index index into the collection.
- * @return The <code>GenericString</code> at the <code>index</code>th
- * position in the <code>StringList</code>, or <code>null</code> if
- * the index specified is not valid.
- */
- public String item(int index);
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xs/XSAnnotation.java b/src/com/sun/org/apache/xerces/internal/xs/XSAnnotation.java
deleted file mode 100644
index d04f331..0000000
--- a/src/com/sun/org/apache/xerces/internal/xs/XSAnnotation.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xs;
-
-/**
- * This interface represents the Annotation schema component.
- */
-public interface XSAnnotation extends XSObject {
- // TargetType
- /**
- * The object type is <code>org.w3c.dom.Element</code>.
- */
- public static final short W3C_DOM_ELEMENT = 1;
- /**
- * The object type is <code>org.xml.sax.ContentHandler</code>.
- */
- public static final short SAX_CONTENTHANDLER = 2;
- /**
- * The object type is <code>org.w3c.dom.Document</code>.
- */
- public static final short W3C_DOM_DOCUMENT = 3;
-
- /**
- * Write contents of the annotation to the specified object. If the
- * specified <code>target</code> is a DOM object, in-scope namespace
- * declarations for <code>annotation</code> element are added as
- * attribute nodes of the serialized <code>annotation</code>, otherwise
- * the corresponding events for all in-scope namespace declarations are
- * sent via the specified document handler.
- * @param target A target pointer to the annotation target object, i.e.
- * <code>org.w3c.dom.Document</code>, <code>org.w3c.dom.Element</code>
- * , <code>org.xml.sax.ContentHandler</code>.
- * @param targetType A target type.
- * @return True if the <code>target</code> is a recognized type and
- * supported by this implementation, otherwise false.
- */
- public boolean writeAnnotation(Object target,
- short targetType);
-
- /**
- * A text representation of the annotation.
- */
- public String getAnnotationString();
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xs/XSAttributeDeclaration.java b/src/com/sun/org/apache/xerces/internal/xs/XSAttributeDeclaration.java
deleted file mode 100644
index 350a148..0000000
--- a/src/com/sun/org/apache/xerces/internal/xs/XSAttributeDeclaration.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xs;
-
-/**
- * The interface represents the Attribute Declaration schema component.
- */
-public interface XSAttributeDeclaration extends XSObject {
- /**
- * [type definition]: A simple type definition.
- */
- public XSSimpleTypeDefinition getTypeDefinition();
-
- /**
- * [scope]. One of <code>SCOPE_GLOBAL</code>, <code>SCOPE_LOCAL</code>, or
- * <code>SCOPE_ABSENT</code>. If the scope is local, then the
- * <code>enclosingCTDefinition</code> is present.
- */
- public short getScope();
-
- /**
- * The complex type definition for locally scoped declarations (see
- * <code>scope</code>), otherwise <code>null</code> if no such
- * definition exists.
- */
- public XSComplexTypeDefinition getEnclosingCTDefinition();
-
- /**
- * Value constraint: one of <code>VC_NONE, VC_DEFAULT, VC_FIXED</code>.
- */
- public short getConstraintType();
-
- /**
- * Value constraint: The constraint value with respect to the [type
- * definition], otherwise <code>null</code>.
- */
- public String getConstraintValue();
-
- /**
- * Value Constraint: Binding specific actual constraint value or
- * <code>null</code> if the value is in error or there is no value
- * constraint.
- * @exception XSException
- * NOT_SUPPORTED_ERR: Raised if the implementation does not support this
- * method.
- */
- public Object getActualVC()
- throws XSException;
-
- /**
- * The actual constraint value built-in datatype, e.g.
- * <code>STRING_DT, SHORT_DT</code>. If the type definition of this
- * value is a list type definition, this method returns
- * <code>LIST_DT</code>. If the type definition of this value is a list
- * type definition whose item type is a union type definition, this
- * method returns <code>LISTOFUNION_DT</code>. To query the actual
- * constraint value of the list or list of union type definitions use
- * <code>itemValueTypes</code>. If the <code>actualValue</code> is
- * <code>null</code>, this method returns <code>UNAVAILABLE_DT</code>.
- * @exception XSException
- * NOT_SUPPORTED_ERR: Raised if the implementation does not support this
- * method.
- */
- public short getActualVCType()
- throws XSException;
-
- /**
- * In the case the actual constraint value represents a list, i.e. the
- * <code>actualValueType</code> is <code>LIST_DT</code>, the returned
- * array consists of one type kind which represents the itemType. If the
- * actual constraint value represents a list type definition whose item
- * type is a union type definition, i.e. <code>LISTOFUNION_DT</code>,
- * for each actual constraint value in the list the array contains the
- * corresponding memberType kind. For examples, see
- * <code>ItemPSVI.itemValueTypes</code>.
- * @exception XSException
- * NOT_SUPPORTED_ERR: Raised if the implementation does not support this
- * method.
- */
- public ShortList getItemValueTypes()
- throws XSException;
-
- /**
- * An annotation if it exists, otherwise <code>null</code>.
- * If not null then the first [annotation] from the sequence of annotations.
- */
- public XSAnnotation getAnnotation();
-
- /**
- * A sequence of [annotations] or an empty <code>XSObjectList</code>.
- */
- public XSObjectList getAnnotations();
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xs/XSAttributeGroupDefinition.java b/src/com/sun/org/apache/xerces/internal/xs/XSAttributeGroupDefinition.java
deleted file mode 100644
index 71d90b0..0000000
--- a/src/com/sun/org/apache/xerces/internal/xs/XSAttributeGroupDefinition.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xs;
-
-/**
- * This interface represents the Attribute Group Definition schema component.
- */
-public interface XSAttributeGroupDefinition extends XSObject {
- /**
- * A set of [attribute uses] if it exists, otherwise an empty
- * <code>XSObjectList</code>.
- */
- public XSObjectList getAttributeUses();
-
- /**
- * A [wildcard] if it exists, otherwise <code>null</code>.
- */
- public XSWildcard getAttributeWildcard();
-
- /**
- * An annotation if it exists, otherwise <code>null</code>. If not null
- * then the first [annotation] from the sequence of annotations.
- */
- public XSAnnotation getAnnotation();
-
- /**
- * A sequence of [annotations] or an empty <code>XSObjectList</code>.
- */
- public XSObjectList getAnnotations();
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xs/XSAttributeUse.java b/src/com/sun/org/apache/xerces/internal/xs/XSAttributeUse.java
deleted file mode 100644
index b55e530..0000000
--- a/src/com/sun/org/apache/xerces/internal/xs/XSAttributeUse.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xs;
-
-/**
- * This interface represents the Attribute Use schema component.
- */
-public interface XSAttributeUse extends XSObject {
- /**
- * [required]: determines whether this use of an attribute declaration
- * requires an appropriate attribute information item to be present, or
- * merely allows it.
- */
- public boolean getRequired();
-
- /**
- * [attribute declaration]: provides the attribute declaration itself,
- * which will in turn determine the simple type definition used.
- */
- public XSAttributeDeclaration getAttrDeclaration();
-
- /**
- * Value Constraint: one of default, fixed.
- */
- public short getConstraintType();
-
- /**
- * Value Constraint: The constraint value, otherwise <code>null</code>.
- */
- public String getConstraintValue();
-
- /**
- * Value Constraint: Binding specific actual constraint value or
- * <code>null</code> if the value is in error or there is no value
- * constraint.
- * @exception XSException
- * NOT_SUPPORTED_ERR: Raised if the implementation does not support this
- * method.
- */
- public Object getActualVC()
- throws XSException;
-
- /**
- * The actual constraint value built-in datatype, e.g.
- * <code>STRING_DT, SHORT_DT</code>. If the type definition of this
- * value is a list type definition, this method returns
- * <code>LIST_DT</code>. If the type definition of this value is a list
- * type definition whose item type is a union type definition, this
- * method returns <code>LISTOFUNION_DT</code>. To query the actual
- * constraint value of the list or list of union type definitions use
- * <code>itemValueTypes</code>. If the <code>actualNormalizedValue</code>
- * is <code>null</code>, this method returns <code>UNAVAILABLE_DT</code>
- * .
- * @exception XSException
- * NOT_SUPPORTED_ERR: Raised if the implementation does not support this
- * method.
- */
- public short getActualVCType()
- throws XSException;
-
- /**
- * In the case the actual constraint value represents a list, i.e. the
- * <code>actualValueType</code> is <code>LIST_DT</code>, the returned
- * array consists of one type kind which represents the itemType. If the
- * actual constraint value represents a list type definition whose item
- * type is a union type definition, i.e. <code>LISTOFUNION_DT</code>,
- * for each actual constraint value in the list the array contains the
- * corresponding memberType kind. For examples, see
- * <code>ItemPSVI.itemValueTypes</code>.
- * @exception XSException
- * NOT_SUPPORTED_ERR: Raised if the implementation does not support this
- * method.
- */
- public ShortList getItemValueTypes()
- throws XSException;
-
- /**
- * A sequence of [annotations] or an empty <code>XSObjectList</code>.
- */
- public XSObjectList getAnnotations();
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xs/XSComplexTypeDefinition.java b/src/com/sun/org/apache/xerces/internal/xs/XSComplexTypeDefinition.java
deleted file mode 100644
index 104dbb6..0000000
--- a/src/com/sun/org/apache/xerces/internal/xs/XSComplexTypeDefinition.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xs;
-
-/**
- * This interface represents the Complex Type Definition schema component.
- */
-public interface XSComplexTypeDefinition extends XSTypeDefinition {
- // Content Model Types
- /**
- * Represents an empty content type. A content type with the distinguished
- * value empty validates elements with no character or element
- * information item children.
- */
- public static final short CONTENTTYPE_EMPTY = 0;
- /**
- * Represents a simple content type. A content type which is simple
- * validates elements with character-only children.
- */
- public static final short CONTENTTYPE_SIMPLE = 1;
- /**
- * Represents an element-only content type. An element-only content type
- * validates elements with children that conform to the supplied content
- * model.
- */
- public static final short CONTENTTYPE_ELEMENT = 2;
- /**
- * Represents a mixed content type.
- */
- public static final short CONTENTTYPE_MIXED = 3;
-
- /**
- * [derivation method]: either <code>DERIVATION_EXTENSION</code>,
- * <code>DERIVATION_RESTRICTION</code>, or <code>DERIVATION_NONE</code>
- * (see <code>XSConstants</code>).
- */
- public short getDerivationMethod();
-
- /**
- * [abstract]: a boolean. Complex types for which <code>abstract</code> is
- * true must not be used as the type definition for the validation of
- * element information items.
- */
- public boolean getAbstract();
-
- /**
- * A set of attribute uses if it exists, otherwise an empty
- * <code>XSObjectList</code>.
- */
- public XSObjectList getAttributeUses();
-
- /**
- * An attribute wildcard if it exists, otherwise <code>null</code>.
- */
- public XSWildcard getAttributeWildcard();
-
- /**
- * [content type]: one of empty (<code>CONTENTTYPE_EMPTY</code>), a simple
- * type definition (<code>CONTENTTYPE_SIMPLE</code>), mixed (
- * <code>CONTENTTYPE_MIXED</code>), or element-only (
- * <code>CONTENTTYPE_ELEMENT</code>).
- */
- public short getContentType();
-
- /**
- * A simple type definition corresponding to a simple content model,
- * otherwise <code>null</code>.
- */
- public XSSimpleTypeDefinition getSimpleType();
-
- /**
- * A particle for a mixed or element-only content model, otherwise
- * <code>null</code>.
- */
- public XSParticle getParticle();
-
- /**
- * [prohibited substitutions]: a subset of {extension, restriction}
- * @param restriction Extension or restriction constants (see
- * <code>XSConstants</code>).
- * @return True if <code>restriction</code> is a prohibited substitution,
- * otherwise false.
- */
- public boolean isProhibitedSubstitution(short restriction);
-
- /**
- * [prohibited substitutions]: A subset of {extension, restriction} or
- * <code>DERIVATION_NONE</code> represented as a bit flag (see
- * <code>XSConstants</code>).
- */
- public short getProhibitedSubstitutions();
-
- /**
- * A sequence of [annotations] or an empty <code>XSObjectList</code>.
- */
- public XSObjectList getAnnotations();
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xs/XSConstants.java b/src/com/sun/org/apache/xerces/internal/xs/XSConstants.java
deleted file mode 100644
index cbe1a46..0000000
--- a/src/com/sun/org/apache/xerces/internal/xs/XSConstants.java
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xs;
-
-/**
- * This interface defines constants used by this specification.
- */
-public interface XSConstants {
- // XML Schema Components
- /**
- * The object describes an attribute declaration.
- */
- public static final short ATTRIBUTE_DECLARATION = 1;
- /**
- * The object describes an element declaration.
- */
- public static final short ELEMENT_DECLARATION = 2;
- /**
- * The object describes a complex type or simple type definition.
- */
- public static final short TYPE_DEFINITION = 3;
- /**
- * The object describes an attribute use definition.
- */
- public static final short ATTRIBUTE_USE = 4;
- /**
- * The object describes an attribute group definition.
- */
- public static final short ATTRIBUTE_GROUP = 5;
- /**
- * The object describes a model group definition.
- */
- public static final short MODEL_GROUP_DEFINITION = 6;
- /**
- * A model group.
- */
- public static final short MODEL_GROUP = 7;
- /**
- * The object describes a particle.
- */
- public static final short PARTICLE = 8;
- /**
- * The object describes a wildcard.
- */
- public static final short WILDCARD = 9;
- /**
- * The object describes an identity constraint definition.
- */
- public static final short IDENTITY_CONSTRAINT = 10;
- /**
- * The object describes a notation declaration.
- */
- public static final short NOTATION_DECLARATION = 11;
- /**
- * The object describes an annotation.
- */
- public static final short ANNOTATION = 12;
- /**
- * The object describes a constraining facet. Note: this object does not
- * describe pattern and enumeration facets.
- */
- public static final short FACET = 13;
- /**
- * The object describes enumeration and pattern facets.
- */
- public static final short MULTIVALUE_FACET = 14;
-
- // Derivation constants
- /**
- * No constraint is available.
- */
- public static final short DERIVATION_NONE = 0;
- /**
- * <code>XSTypeDefinition</code> final set or
- * <code>XSElementDeclaration</code> disallowed substitution group.
- */
- public static final short DERIVATION_EXTENSION = 1;
- /**
- * <code>XSTypeDefinition</code> final set or
- * <code>XSElementDeclaration</code> disallowed substitution group.
- */
- public static final short DERIVATION_RESTRICTION = 2;
- /**
- * <code>XSTypeDefinition</code> final set.
- */
- public static final short DERIVATION_SUBSTITUTION = 4;
- /**
- * <code>XSTypeDefinition</code> final set.
- */
- public static final short DERIVATION_UNION = 8;
- /**
- * <code>XSTypeDefinition</code> final set.
- */
- public static final short DERIVATION_LIST = 16;
- /**
- * <code>XSTypeDefinition</code> final set.
- */
- public static final short DERIVATION_EXTENSION_RESTRICTION_SUBSTITION =
- XSConstants.DERIVATION_EXTENSION
- | XSConstants.DERIVATION_RESTRICTION
- | XSConstants.DERIVATION_SUBSTITUTION;
- /**
- * <code>XSTypeDefinition</code> final set.
- */
- public static final short DERIVATION_ALL =
- XSConstants.DERIVATION_SUBSTITUTION
- | XSConstants.DERIVATION_EXTENSION
- | XSConstants.DERIVATION_RESTRICTION
- | XSConstants.DERIVATION_LIST
- | XSConstants.DERIVATION_UNION;
-
- // Scope
- /**
- * The scope of a declaration within named model groups or attribute
- * groups is <code>absent</code>. The scope of such a declaration is
- * determined when it is used in the construction of complex type
- * definitions.
- */
- public static final short SCOPE_ABSENT = 0;
- /**
- * A scope of <code>global</code> identifies top-level declarations.
- */
- public static final short SCOPE_GLOBAL = 1;
- /**
- * <code>Locally scoped</code> declarations are available for use only
- * within the complex type.
- */
- public static final short SCOPE_LOCAL = 2;
-
- // Value Constraint
- /**
- * Indicates that the component does not have any value constraint.
- */
- public static final short VC_NONE = 0;
- /**
- * Indicates that there is a default value constraint.
- */
- public static final short VC_DEFAULT = 1;
- /**
- * Indicates that there is a fixed value constraint for this attribute.
- */
- public static final short VC_FIXED = 2;
-
- // Built-in types: primitive and derived
- /**
- * anySimpleType
- */
- public static final short ANYSIMPLETYPE_DT = 1;
- /**
- * string
- */
- public static final short STRING_DT = 2;
- /**
- * boolean
- */
- public static final short BOOLEAN_DT = 3;
- /**
- * decimal
- */
- public static final short DECIMAL_DT = 4;
- /**
- * float
- */
- public static final short FLOAT_DT = 5;
- /**
- * double
- */
- public static final short DOUBLE_DT = 6;
- /**
- * duration
- */
- public static final short DURATION_DT = 7;
- /**
- * dateTime
- */
- public static final short DATETIME_DT = 8;
- /**
- * time
- */
- public static final short TIME_DT = 9;
- /**
- * date
- */
- public static final short DATE_DT = 10;
- /**
- * gYearMonth
- */
- public static final short GYEARMONTH_DT = 11;
- /**
- * gYear
- */
- public static final short GYEAR_DT = 12;
- /**
- * gMonthDay
- */
- public static final short GMONTHDAY_DT = 13;
- /**
- * gDay
- */
- public static final short GDAY_DT = 14;
- /**
- * gMonth
- */
- public static final short GMONTH_DT = 15;
- /**
- * hexBinary
- */
- public static final short HEXBINARY_DT = 16;
- /**
- * base64Binary
- */
- public static final short BASE64BINARY_DT = 17;
- /**
- * anyURI
- */
- public static final short ANYURI_DT = 18;
- /**
- * QName
- */
- public static final short QNAME_DT = 19;
- /**
- * NOTATION
- */
- public static final short NOTATION_DT = 20;
- /**
- * normalizedString
- */
- public static final short NORMALIZEDSTRING_DT = 21;
- /**
- * token
- */
- public static final short TOKEN_DT = 22;
- /**
- * language
- */
- public static final short LANGUAGE_DT = 23;
- /**
- * NMTOKEN
- */
- public static final short NMTOKEN_DT = 24;
- /**
- * Name
- */
- public static final short NAME_DT = 25;
- /**
- * NCName
- */
- public static final short NCNAME_DT = 26;
- /**
- * ID
- */
- public static final short ID_DT = 27;
- /**
- * IDREF
- */
- public static final short IDREF_DT = 28;
- /**
- * ENTITY
- */
- public static final short ENTITY_DT = 29;
- /**
- * integer
- */
- public static final short INTEGER_DT = 30;
- /**
- * nonPositiveInteger
- */
- public static final short NONPOSITIVEINTEGER_DT = 31;
- /**
- * negativeInteger
- */
- public static final short NEGATIVEINTEGER_DT = 32;
- /**
- * long
- */
- public static final short LONG_DT = 33;
- /**
- * int
- */
- public static final short INT_DT = 34;
- /**
- * short
- */
- public static final short SHORT_DT = 35;
- /**
- * byte
- */
- public static final short BYTE_DT = 36;
- /**
- * nonNegativeInteger
- */
- public static final short NONNEGATIVEINTEGER_DT = 37;
- /**
- * unsignedLong
- */
- public static final short UNSIGNEDLONG_DT = 38;
- /**
- * unsignedInt
- */
- public static final short UNSIGNEDINT_DT = 39;
- /**
- * unsignedShort
- */
- public static final short UNSIGNEDSHORT_DT = 40;
- /**
- * unsignedByte
- */
- public static final short UNSIGNEDBYTE_DT = 41;
- /**
- * positiveInteger
- */
- public static final short POSITIVEINTEGER_DT = 42;
- /**
- * The type represents a list type definition whose item type (itemType)
- * is a union type definition
- */
- public static final short LISTOFUNION_DT = 43;
- /**
- * The type represents a list type definition.
- */
- public static final short LIST_DT = 44;
- /**
- * The built-in type category is not available.
- */
- public static final short UNAVAILABLE_DT = 45;
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xs/XSElementDeclaration.java b/src/com/sun/org/apache/xerces/internal/xs/XSElementDeclaration.java
deleted file mode 100644
index 48ae9dd..0000000
--- a/src/com/sun/org/apache/xerces/internal/xs/XSElementDeclaration.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xs;
-
-/**
- * The interface represents the Element Declaration schema component.
- */
-public interface XSElementDeclaration extends XSTerm {
- /**
- * [type definition]: either a simple type definition or a complex type
- * definition.
- */
- public XSTypeDefinition getTypeDefinition();
-
- /**
- * [scope]. One of <code>SCOPE_GLOBAL</code>, <code>SCOPE_LOCAL</code>, or
- * <code>SCOPE_ABSENT</code>. If the scope is local, then the
- * <code>enclosingCTDefinition</code> is present.
- */
- public short getScope();
-
- /**
- * The complex type definition for locally scoped declarations (see
- * <code>scope</code>), otherwise <code>null</code> if no such
- * definition exists.
- */
- public XSComplexTypeDefinition getEnclosingCTDefinition();
-
- /**
- * [Value constraint]: one of <code>VC_NONE, VC_DEFAULT, VC_FIXED</code>.
- */
- public short getConstraintType();
-
- /**
- * [Value constraint]: the constraint value with respect to the [type
- * definition], otherwise <code>null</code>.
- */
- public String getConstraintValue();
-
- /**
- * Value Constraint: Binding specific actual constraint value or
- * <code>null</code> if the value is in error or there is no value
- * constraint.
- * @exception XSException
- * NOT_SUPPORTED_ERR: Raised if the implementation does not support this
- * method.
- */
- public Object getActualVC()
- throws XSException;
-
- /**
- * The actual constraint value built-in datatype, e.g.
- * <code>STRING_DT, SHORT_DT</code>. If the type definition of this
- * value is a list type definition, this method returns
- * <code>LIST_DT</code>. If the type definition of this value is a list
- * type definition whose item type is a union type definition, this
- * method returns <code>LISTOFUNION_DT</code>. To query the actual
- * constraint value of the list or list of union type definitions use
- * <code>itemValueTypes</code>. If the <code>actualNormalizedValue</code>
- * is <code>null</code>, this method returns <code>UNAVAILABLE_DT</code>
- * .
- * @exception XSException
- * NOT_SUPPORTED_ERR: Raised if the implementation does not support this
- * method.
- */
- public short getActualVCType()
- throws XSException;
-
- /**
- * In the case the actual constraint value represents a list, i.e. the
- * <code>actualValueType</code> is <code>LIST_DT</code>, the returned
- * array consists of one type kind which represents the itemType. If the
- * actual constraint value represents a list type definition whose item
- * type is a union type definition, i.e. <code>LISTOFUNION_DT</code>,
- * for each actual constraint value in the list the array contains the
- * corresponding memberType kind. For examples, see
- * <code>ItemPSVI.itemValueTypes</code>.
- * @exception XSException
- * NOT_SUPPORTED_ERR: Raised if the implementation does not support this
- * method.
- */
- public ShortList getItemValueTypes()
- throws XSException;
-
- /**
- * If nillable is true, then an element may also be valid if it carries
- * the namespace qualified attribute with local name <code>nil</code>
- * from namespace <code>http://www.w3.org/2001/XMLSchema-instance</code>
- * and value <code>true</code> (xsi:nil) even if it has no text or
- * element content despite a <code>content type</code> which would
- * otherwise require content.
- */
- public boolean getNillable();
-
- /**
- * identity-constraint definitions: a set of constraint definitions if it
- * exists, otherwise an empty <code>XSNamedMap</code>.
- */
- public XSNamedMap getIdentityConstraints();
-
- /**
- * [substitution group affiliation]: a top-level element definition if it
- * exists, otherwise <code>null</code>.
- */
- public XSElementDeclaration getSubstitutionGroupAffiliation();
-
- /**
- * Convenience method that checks if <code>exclusion</code> is a
- * substitution group exclusion for this element declaration.
- * @param exclusion
- * <code>DERIVATION_EXTENSION, DERIVATION_RESTRICTION</code> or
- * <code>DERIVATION_NONE</code>. Represents final set for the element.
- * @return True if <code>exclusion</code> is a part of the substitution
- * group exclusion subset.
- */
- public boolean isSubstitutionGroupExclusion(short exclusion);
-
- /**
- * [substitution group exclusions]: the returned value is a bit
- * combination of the subset of {
- * <code>DERIVATION_EXTENSION, DERIVATION_RESTRICTION</code>} or
- * <code>DERIVATION_NONE</code>.
- */
- public short getSubstitutionGroupExclusions();
-
- /**
- * Convenience method that checks if <code>disallowed</code> is a
- * disallowed substitution for this element declaration.
- * @param disallowed {
- * <code>DERIVATION_SUBSTITUTION, DERIVATION_EXTENSION, DERIVATION_RESTRICTION</code>
- * } or <code>DERIVATION_NONE</code>. Represents a block set for the
- * element.
- * @return True if <code>disallowed</code> is a part of the substitution
- * group exclusion subset.
- */
- public boolean isDisallowedSubstitution(short disallowed);
-
- /**
- * [disallowed substitutions]: the returned value is a bit combination of
- * the subset of {
- * <code>DERIVATION_SUBSTITUTION, DERIVATION_EXTENSION, DERIVATION_RESTRICTION</code>
- * } corresponding to substitutions disallowed by this
- * <code>XSElementDeclaration</code> or <code>DERIVATION_NONE</code>.
- */
- public short getDisallowedSubstitutions();
-
- /**
- * {abstract} A boolean.
- */
- public boolean getAbstract();
-
- /**
- * An annotation if it exists, otherwise <code>null</code>. If not null
- * then the first [annotation] from the sequence of annotations.
- */
- public XSAnnotation getAnnotation();
-
- /**
- * A sequence of [annotations] or an empty <code>XSObjectList</code>.
- */
- public XSObjectList getAnnotations();
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xs/XSException.java b/src/com/sun/org/apache/xerces/internal/xs/XSException.java
deleted file mode 100644
index d091825..0000000
--- a/src/com/sun/org/apache/xerces/internal/xs/XSException.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xs;
-
-/**
- * The XML Schema API operations only raise exceptions in "exceptional"
- * circumstances, i.e., when an operation is impossible to perform (either
- * for logical reasons, because data is lost, or because the implementation
- * has become unstable).
- * <p>Implementations should raise other exceptions under other circumstances.
- * <p>Some languages and object systems do not support the concept of
- * exceptions. For such systems, error conditions may be indicated using
- * native error reporting mechanisms. For some bindings, for example,
- * methods may return error codes similar to those listed in the
- * corresponding method descriptions.
- */
-public class XSException extends RuntimeException {
-
- /** Serialization version. */
- static final long serialVersionUID = 3111893084677917742L;
-
- public XSException(short code, String message) {
- super(message);
- this.code = code;
- }
- public short code;
- // ExceptionCode
- /**
- * If the implementation does not support the requested type of object or
- * operation.
- */
- public static final short NOT_SUPPORTED_ERR = 1;
- /**
- * If index or size is negative, or greater than the allowed value
- */
- public static final short INDEX_SIZE_ERR = 2;
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xs/XSFacet.java b/src/com/sun/org/apache/xerces/internal/xs/XSFacet.java
deleted file mode 100644
index 2bef026..0000000
--- a/src/com/sun/org/apache/xerces/internal/xs/XSFacet.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xs;
-
-/**
- * Describes a constraining facet. Enumeration and pattern facets are exposed
- * via <code>XSMultiValueFacet</code> interface.
- */
-public interface XSFacet extends XSObject {
- /**
- * The name of the facet, e.g. <code>FACET_LENGTH, FACET_TOTALDIGITS</code>
- * (see <code>XSSimpleTypeDefinition</code>).
- */
- public short getFacetKind();
-
- /**
- * A value of this facet.
- */
- public String getLexicalFacetValue();
-
- /**
- * [Facets]: check whether a facet is fixed.
- */
- public boolean getFixed();
-
- /**
- * An annotation if it exists, otherwise <code>null</code>. If not null
- * then the first [annotation] from the sequence of annotations.
- */
- public XSAnnotation getAnnotation();
-
- /**
- * A sequence of [annotations] or an empty <code>XSObjectList</code>.
- */
- public XSObjectList getAnnotations();
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xs/XSIDCDefinition.java b/src/com/sun/org/apache/xerces/internal/xs/XSIDCDefinition.java
deleted file mode 100644
index c26cec7..0000000
--- a/src/com/sun/org/apache/xerces/internal/xs/XSIDCDefinition.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xs;
-
-/**
- * This interface represents the Identity-constraint Definition schema
- * component.
- */
-public interface XSIDCDefinition extends XSObject {
- // Identity Constraints
- /**
- * See the definition of <code>key</code> in the identity-constraint
- * category.
- */
- public static final short IC_KEY = 1;
- /**
- * See the definition of <code>keyref</code> in the identity-constraint
- * category.
- */
- public static final short IC_KEYREF = 2;
- /**
- * See the definition of <code>unique</code> in the identity-constraint
- * category.
- */
- public static final short IC_UNIQUE = 3;
-
- /**
- * [identity-constraint category]: one of key, keyref or unique.
- */
- public short getCategory();
-
- /**
- * [selector]: a restricted XPath 1.0 expression.
- */
- public String getSelectorStr();
-
- /**
- * [fields]: a non-empty list of restricted XPath 1.0 expressions.
- */
- public StringList getFieldStrs();
-
- /**
- * [referenced key]: required if [identity-constraint category] is keyref,
- * <code>null</code> otherwise. An identity-constraint definition with [
- * identity-constraint category] equal to key or unique.
- */
- public XSIDCDefinition getRefKey();
-
- /**
- * A sequence of [annotations] or an empty <code>XSObjectList</code>.
- */
- public XSObjectList getAnnotations();
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xs/XSImplementation.java b/src/com/sun/org/apache/xerces/internal/xs/XSImplementation.java
deleted file mode 100644
index 2d7a37f..0000000
--- a/src/com/sun/org/apache/xerces/internal/xs/XSImplementation.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xs;
-
-/**
- * This interface allows one to retrieve an instance of <code>XSLoader</code>.
- * This interface should be implemented on the same object that implements
- * DOMImplementation.
- */
-public interface XSImplementation {
- /**
- * A list containing the versions of XML Schema documents recognized by
- * this <code>XSImplemenation</code>.
- */
- public StringList getRecognizedVersions();
-
-
- /**
- * Creates a new XSLoader. The newly constructed loader may then be
- * configured and used to load XML Schemas.
- * @param versions A list containing the versions of XML Schema
- * documents which can be loaded by the <code>XSLoader</code> or
- * <code>null</code> to permit XML Schema documents of any recognized
- * version to be loaded by the XSLoader.
- * @return An XML Schema loader.
- * @exception XSException
- * NOT_SUPPORTED_ERR: Raised if the implementation does not support one
- * of the specified versions.
- */
- public XSLoader createXSLoader(StringList versions)
- throws XSException;
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xs/XSLoader.java b/src/com/sun/org/apache/xerces/internal/xs/XSLoader.java
deleted file mode 100644
index aabf95f..0000000
--- a/src/com/sun/org/apache/xerces/internal/xs/XSLoader.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xs;
-
-import org.w3c.dom.DOMConfiguration;
-import org.w3c.dom.ls.LSInput;
-
-/**
- * An interface that provides a method to load XML Schema documents. This
- * interface uses the DOM Level 3 Core and Load and Save interfaces.
- */
-public interface XSLoader {
- /**
- * The configuration of a document. It maintains a table of recognized
- * parameters. Using the configuration, it is possible to change the
- * behavior of the load methods. The configuration may support the
- * setting of and the retrieval of the following non-boolean parameters
- * defined on the <code>DOMConfiguration</code> interface:
- * <code>error-handler</code> (<code>DOMErrorHandler</code>) and
- * <code>resource-resolver</code> (<code>LSResourceResolver</code>).
- * <br> The following list of boolean parameters is defined:
- * <dl>
- * <dt>
- * <code>"validate"</code></dt>
- * <dd>
- * <dl>
- * <dt><code>true</code></dt>
- * <dd>[required] (default) Validate an XML
- * Schema during loading. If validation errors are found, the error
- * handler is notified. </dd>
- * <dt><code>false</code></dt>
- * <dd>[optional] Do not
- * report errors during the loading of an XML Schema document. </dd>
- * </dl></dd>
- * </dl>
- */
- public DOMConfiguration getConfig();
-
- /**
- * Parses the content of XML Schema documents specified as the list of URI
- * references. If the URI contains a fragment identifier, the behavior
- * is not defined by this specification.
- * @param uriList The list of URI locations.
- * @return An XSModel representing the schema documents.
- */
- public XSModel loadURIList(StringList uriList);
-
- /**
- * Parses the content of XML Schema documents specified as a list of
- * <code>LSInput</code>s.
- * @param is The list of <code>LSInput</code>s from which the XML
- * Schema documents are to be read.
- * @return An XSModel representing the schema documents.
- */
- public XSModel loadInputList(LSInputList is);
-
- /**
- * Parse an XML Schema document from a location identified by a URI
- * reference. If the URI contains a fragment identifier, the behavior is
- * not defined by this specification.
- * @param uri The location of the XML Schema document to be read.
- * @return An XSModel representing this schema.
- */
- public XSModel loadURI(String uri);
-
- /**
- * Parse an XML Schema document from a resource identified by a
- * <code>LSInput</code> .
- * @param is The <code>LSInput</code> from which the source
- * document is to be read.
- * @return An XSModel representing this schema.
- */
- public XSModel load(LSInput is);
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xs/XSModel.java b/src/com/sun/org/apache/xerces/internal/xs/XSModel.java
deleted file mode 100644
index 96a70ae..0000000
--- a/src/com/sun/org/apache/xerces/internal/xs/XSModel.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xs;
-
-/**
- * This interface represents an XML Schema.
- */
-public interface XSModel {
- /**
- * Convenience method. Returns a list of all namespaces that belong to
- * this schema. The value <code>null</code> is not a valid namespace
- * name, but if there are components that do not have a target namespace
- * , <code>null</code> is included in this list.
- */
- public StringList getNamespaces();
-
- /**
- * A set of namespace schema information information items (of type
- * <code>XSNamespaceItem</code>), one for each namespace name which
- * appears as the target namespace of any schema component in the schema
- * used for that assessment, and one for absent if any schema component
- * in the schema had no target namespace. For more information see
- * schema information.
- */
- public XSNamespaceItemList getNamespaceItems();
-
- /**
- * Returns a list of top-level components, i.e. element declarations,
- * attribute declarations, etc.
- * @param objectType The type of the declaration, i.e.
- * <code>ELEMENT_DECLARATION</code>. Note that
- * <code>XSTypeDefinition.SIMPLE_TYPE</code> and
- * <code>XSTypeDefinition.COMPLEX_TYPE</code> can also be used as the
- * <code>objectType</code> to retrieve only complex types or simple
- * types, instead of all types.
- * @return A list of top-level definitions of the specified type in
- * <code>objectType</code> or an empty <code>XSNamedMap</code> if no
- * such definitions exist.
- */
- public XSNamedMap getComponents(short objectType);
-
- /**
- * Convenience method. Returns a list of top-level component declarations
- * that are defined within the specified namespace, i.e. element
- * declarations, attribute declarations, etc.
- * @param objectType The type of the declaration, i.e.
- * <code>ELEMENT_DECLARATION</code>.
- * @param namespace The namespace to which the declaration belongs or
- * <code>null</code> (for components with no target namespace).
- * @return A list of top-level definitions of the specified type in
- * <code>objectType</code> and defined in the specified
- * <code>namespace</code> or an empty <code>XSNamedMap</code>.
- */
- public XSNamedMap getComponentsByNamespace(short objectType,
- String namespace);
-
- /**
- * [annotations]: a set of annotations if it exists, otherwise an empty
- * <code>XSObjectList</code>.
- */
- public XSObjectList getAnnotations();
-
- /**
- * Convenience method. Returns a top-level element declaration.
- * @param name The name of the declaration.
- * @param namespace The namespace of the declaration, otherwise
- * <code>null</code>.
- * @return A top-level element declaration or <code>null</code> if such a
- * declaration does not exist.
- */
- public XSElementDeclaration getElementDeclaration(String name,
- String namespace);
-
- /**
- * Convenience method. Returns a top-level attribute declaration.
- * @param name The name of the declaration.
- * @param namespace The namespace of the declaration, otherwise
- * <code>null</code>.
- * @return A top-level attribute declaration or <code>null</code> if such
- * a declaration does not exist.
- */
- public XSAttributeDeclaration getAttributeDeclaration(String name,
- String namespace);
-
- /**
- * Convenience method. Returns a top-level simple or complex type
- * definition.
- * @param name The name of the definition.
- * @param namespace The namespace of the declaration, otherwise
- * <code>null</code>.
- * @return An <code>XSTypeDefinition</code> or <code>null</code> if such
- * a definition does not exist.
- */
- public XSTypeDefinition getTypeDefinition(String name,
- String namespace);
-
- /**
- * Convenience method. Returns a top-level attribute group definition.
- * @param name The name of the definition.
- * @param namespace The namespace of the definition, otherwise
- * <code>null</code>.
- * @return A top-level attribute group definition or <code>null</code> if
- * such a definition does not exist.
- */
- public XSAttributeGroupDefinition getAttributeGroup(String name,
- String namespace);
-
- /**
- * Convenience method. Returns a top-level model group definition.
- * @param name The name of the definition.
- * @param namespace The namespace of the definition, otherwise
- * <code>null</code>.
- * @return A top-level model group definition or <code>null</code> if
- * such a definition does not exist.
- */
- public XSModelGroupDefinition getModelGroupDefinition(String name,
- String namespace);
-
- /**
- * Convenience method. Returns a top-level notation declaration.
- * @param name The name of the declaration.
- * @param namespace The namespace of the declaration, otherwise
- * <code>null</code>.
- * @return A top-level notation declaration or <code>null</code> if such
- * a declaration does not exist.
- */
- public XSNotationDeclaration getNotationDeclaration(String name,
- String namespace);
-
- /**
- * Convenience method. Returns a list containing the members of the
- * substitution group for the given <code>XSElementDeclaration</code>
- * or an empty <code>XSObjectList</code> if the substitution group
- * contains no members.
- * @param head The substitution group head.
- * @return A list containing the members of the substitution group
- * for the given <code>XSElementDeclaration</code> or an empty
- * <code>XSObjectList</code> if the substitution group contains
- * no members.
- */
- public XSObjectList getSubstitutionGroup(XSElementDeclaration head);
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xs/XSModelGroup.java b/src/com/sun/org/apache/xerces/internal/xs/XSModelGroup.java
deleted file mode 100644
index 265ecf3..0000000
--- a/src/com/sun/org/apache/xerces/internal/xs/XSModelGroup.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xs;
-
-/**
- * This interface represents the Model Group schema component.
- */
-public interface XSModelGroup extends XSTerm {
- // Content model compositors
- /**
- * This constant value signifies a sequence operator.
- */
- public static final short COMPOSITOR_SEQUENCE = 1;
- /**
- * This constant value signifies a choice operator.
- */
- public static final short COMPOSITOR_CHOICE = 2;
- /**
- * This content model represents a simplified version of the SGML
- * &amp;-Connector and is limited to the top-level of any content model.
- * No element in the all content model may appear more than once.
- */
- public static final short COMPOSITOR_ALL = 3;
-
- /**
- * [compositor]: one of all, choice or sequence. The valid constant values
- * are:
- * <code>COMPOSITOR_SEQUENCE, COMPOSITOR_CHOICE, COMPOSITOR_ALL</code>.
- */
- public short getCompositor();
-
- /**
- * A list of [particles] if it exists, otherwise an empty
- * <code>XSObjectList</code>.
- */
- public XSObjectList getParticles();
-
- /**
- * An annotation if it exists, otherwise <code>null</code>. If not null
- * then the first [annotation] from the sequence of annotations.
- */
- public XSAnnotation getAnnotation();
-
- /**
- * A sequence of [annotations] or an empty <code>XSObjectList</code>.
- */
- public XSObjectList getAnnotations();
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xs/XSModelGroupDefinition.java b/src/com/sun/org/apache/xerces/internal/xs/XSModelGroupDefinition.java
deleted file mode 100644
index fb6d594..0000000
--- a/src/com/sun/org/apache/xerces/internal/xs/XSModelGroupDefinition.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xs;
-
-/**
- * This interface represents the Model Group Definition schema component.
- */
-public interface XSModelGroupDefinition extends XSObject {
- /**
- * A model group.
- */
- public XSModelGroup getModelGroup();
-
- /**
- * An annotation if it exists, otherwise <code>null</code>. If not null
- * then the first [annotation] from the sequence of annotations.
- */
- public XSAnnotation getAnnotation();
-
- /**
- * A sequence of [annotations] or an empty <code>XSObjectList</code>.
- */
- public XSObjectList getAnnotations();
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xs/XSMultiValueFacet.java b/src/com/sun/org/apache/xerces/internal/xs/XSMultiValueFacet.java
deleted file mode 100644
index 960d798..0000000
--- a/src/com/sun/org/apache/xerces/internal/xs/XSMultiValueFacet.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xs;
-
-/**
- * Describes a multi-value constraining facets: pattern and enumeration.
- */
-public interface XSMultiValueFacet extends XSObject {
- /**
- * The name of the facet, i.e. <code>FACET_ENUMERATION</code> and
- * <code>FACET_PATTERN</code> (see <code>XSSimpleTypeDefinition</code>).
- */
- public short getFacetKind();
-
- /**
- * Values of this facet.
- */
- public StringList getLexicalFacetValues();
-
- /**
- * A sequence of [annotations] or an empty <code>XSObjectList</code>.
- */
- public XSObjectList getAnnotations();
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xs/XSNamedMap.java b/src/com/sun/org/apache/xerces/internal/xs/XSNamedMap.java
deleted file mode 100644
index 976680b..0000000
--- a/src/com/sun/org/apache/xerces/internal/xs/XSNamedMap.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xs;
-
-import java.util.Map;
-
-/**
- * Objects implementing the <code>XSNamedMap</code> interface are used to
- * represent immutable collections of XML Schema components that can be
- * accessed by name. Note that <code>XSNamedMap</code> does not inherit from
- * <code>XSObjectList</code>. The <code>XSObject</code>s in
- * <code>XSNamedMap</code>s are not maintained in any particular order.
- */
-public interface XSNamedMap extends Map {
- /**
- * The number of <code>XSObjects</code> in the <code>XSObjectList</code>.
- * The range of valid child object indices is 0 to <code>length-1</code>
- * inclusive.
- */
- public int getLength();
-
- /**
- * Returns the <code>index</code>th item in the collection or
- * <code>null</code> if <code>index</code> is greater than or equal to
- * the number of objects in the list. The index starts at 0.
- * @param index index into the collection.
- * @return The <code>XSObject</code> at the <code>index</code>th
- * position in the <code>XSObjectList</code>, or <code>null</code> if
- * the index specified is not valid.
- */
- public XSObject item(int index);
-
- /**
- * Retrieves an <code>XSObject</code> specified by local name and
- * namespace URI.
- * <br>Per XML Namespaces, applications must use the value <code>null</code> as the
- * <code>namespace</code> parameter for methods if they wish to specify
- * no namespace.
- * @param namespace The namespace URI of the <code>XSObject</code> to
- * retrieve, or <code>null</code> if the <code>XSObject</code> has no
- * namespace.
- * @param localName The local name of the <code>XSObject</code> to
- * retrieve.
- * @return A <code>XSObject</code> (of any type) with the specified local
- * name and namespace URI, or <code>null</code> if they do not
- * identify any object in this map.
- */
- public XSObject itemByName(String namespace,
- String localName);
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xs/XSNamespaceItem.java b/src/com/sun/org/apache/xerces/internal/xs/XSNamespaceItem.java
deleted file mode 100644
index a83d1e0..0000000
--- a/src/com/sun/org/apache/xerces/internal/xs/XSNamespaceItem.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xs;
-
-/**
- * The interface represents the namespace schema information information item.
- * Each namespace schema information information item corresponds to an XML
- * Schema with a unique namespace name.
- */
-public interface XSNamespaceItem {
- /**
- * [schema namespace]: A namespace name or <code>null</code> if absent.
- */
- public String getSchemaNamespace();
-
- /**
- * [schema components]: a list of top-level components, i.e. element
- * declarations, attribute declarations, etc.
- * @param objectType The type of the declaration, i.e.
- * <code>ELEMENT_DECLARATION</code>. Note that
- * <code>XSTypeDefinition.SIMPLE_TYPE</code> and
- * <code>XSTypeDefinition.COMPLEX_TYPE</code> can also be used as the
- * <code>objectType</code> to retrieve only complex types or simple
- * types, instead of all types.
- * @return A list of top-level definition of the specified type in
- * <code>objectType</code> or an empty <code>XSNamedMap</code> if no
- * such definitions exist.
- */
- public XSNamedMap getComponents(short objectType);
-
- /**
- * [annotations]: a set of annotations if it exists, otherwise an empty
- * <code>XSObjectList</code>.
- */
- public XSObjectList getAnnotations();
-
- /**
- * Convenience method. Returns a top-level element declaration.
- * @param name The name of the declaration.
- * @return A top-level element declaration or <code>null</code> if such a
- * declaration does not exist.
- */
- public XSElementDeclaration getElementDeclaration(String name);
-
- /**
- * Convenience method. Returns a top-level attribute declaration.
- * @param name The name of the declaration.
- * @return A top-level attribute declaration or <code>null</code> if such
- * a declaration does not exist.
- */
- public XSAttributeDeclaration getAttributeDeclaration(String name);
-
- /**
- * Convenience method. Returns a top-level simple or complex type
- * definition.
- * @param name The name of the definition.
- * @return An <code>XSTypeDefinition</code> or <code>null</code> if such
- * a definition does not exist.
- */
- public XSTypeDefinition getTypeDefinition(String name);
-
- /**
- * Convenience method. Returns a top-level attribute group definition.
- * @param name The name of the definition.
- * @return A top-level attribute group definition or <code>null</code> if
- * such a definition does not exist.
- */
- public XSAttributeGroupDefinition getAttributeGroup(String name);
-
- /**
- * Convenience method. Returns a top-level model group definition.
- * @param name The name of the definition.
- * @return A top-level model group definition definition or
- * <code>null</code> if such a definition does not exist.
- */
- public XSModelGroupDefinition getModelGroupDefinition(String name);
-
- /**
- * Convenience method. Returns a top-level notation declaration.
- * @param name The name of the declaration.
- * @return A top-level notation declaration or <code>null</code> if such
- * a declaration does not exist.
- */
- public XSNotationDeclaration getNotationDeclaration(String name);
-
- /**
- * [document location] - a list of location URIs for the documents that
- * contributed to the <code>XSModel</code>.
- */
- public StringList getDocumentLocations();
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xs/XSNamespaceItemList.java b/src/com/sun/org/apache/xerces/internal/xs/XSNamespaceItemList.java
deleted file mode 100644
index 8a8ee99..0000000
--- a/src/com/sun/org/apache/xerces/internal/xs/XSNamespaceItemList.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xs;
-
-import java.util.List;
-
-/**
- * The <code>XSNamesaceItemList</code> interface provides the abstraction of
- * an immutable ordered collection of <code>XSNamespaceItem</code>s, without
- * defining or constraining how this collection is implemented.
- */
-public interface XSNamespaceItemList extends List {
- /**
- * The number of <code>XSNamespaceItem</code>s in the list. The range of
- * valid child object indices is 0 to <code>length-1</code> inclusive.
- */
- public int getLength();
-
- /**
- * Returns the <code>index</code>th item in the collection or
- * <code>null</code> if <code>index</code> is greater than or equal to
- * the number of objects in the list. The index starts at 0.
- * @param index index into the collection.
- * @return The <code>XSNamespaceItem</code> at the <code>index</code>th
- * position in the <code>XSNamespaceItemList</code>, or
- * <code>null</code> if the index specified is not valid.
- */
- public XSNamespaceItem item(int index);
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xs/XSNotationDeclaration.java b/src/com/sun/org/apache/xerces/internal/xs/XSNotationDeclaration.java
deleted file mode 100644
index b1c03d2..0000000
--- a/src/com/sun/org/apache/xerces/internal/xs/XSNotationDeclaration.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xs;
-
-/**
- * This interface represents the Notation Declaration schema component.
- */
-public interface XSNotationDeclaration extends XSObject {
- /**
- * The URI reference representing the system identifier for the notation
- * declaration, if present, <code>null</code> otherwise.
- */
- public String getSystemId();
-
- /**
- * The string representing the public identifier for this notation
- * declaration, if present; <code>null</code> otherwise.
- */
- public String getPublicId();
-
- /**
- * An annotation if it exists, otherwise <code>null</code>. If not null
- * then the first [annotation] from the sequence of annotations.
- */
- public XSAnnotation getAnnotation();
-
- /**
- * A sequence of [annotations] or an empty <code>XSObjectList</code>.
- */
- public XSObjectList getAnnotations();
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xs/XSObject.java b/src/com/sun/org/apache/xerces/internal/xs/XSObject.java
deleted file mode 100644
index 176ae79..0000000
--- a/src/com/sun/org/apache/xerces/internal/xs/XSObject.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xs;
-
-/**
- * The <code>XSObject</code> is a base object for the XML Schema component
- * model.
- */
-public interface XSObject {
- /**
- * The <code>type</code> of this object, i.e.
- * <code>ELEMENT_DECLARATION</code>.
- */
- public short getType();
-
- /**
- * The name of type <code>NCName</code>, as defined in XML Namespaces, of
- * this declaration specified in the <code>{name}</code> property of the
- * component or <code>null</code> if the definition of this component
- * does not have a <code>{name}</code> property. For anonymous types,
- * the processor must construct and expose an anonymous type name that
- * is distinct from the name of every named type and the name of every
- * other anonymous type.
- */
- public String getName();
-
- /**
- * The [target namespace] of this object, or <code>null</code> if it is
- * unspecified.
- */
- public String getNamespace();
-
- /**
- * A namespace schema information item corresponding to the target
- * namespace of the component, if it is globally declared; or
- * <code>null</code> otherwise.
- */
- public XSNamespaceItem getNamespaceItem();
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xs/XSObjectList.java b/src/com/sun/org/apache/xerces/internal/xs/XSObjectList.java
deleted file mode 100644
index 5e60a1e..0000000
--- a/src/com/sun/org/apache/xerces/internal/xs/XSObjectList.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xs;
-
-import java.util.List;
-
-/**
- * The <code>XSObjectList</code> interface provides the abstraction of an
- * immutable ordered collection of <code>XSObject</code>s, without defining
- * or constraining how this collection is implemented.
- */
-public interface XSObjectList extends List {
- /**
- * The number of <code>XSObjects</code> in the list. The range of valid
- * child object indices is 0 to <code>length-1</code> inclusive.
- */
- public int getLength();
-
- /**
- * Returns the <code>index</code>th item in the collection or
- * <code>null</code> if <code>index</code> is greater than or equal to
- * the number of objects in the list. The index starts at 0.
- * @param index index into the collection.
- * @return The <code>XSObject</code> at the <code>index</code>th
- * position in the <code>XSObjectList</code>, or <code>null</code> if
- * the index specified is not valid.
- */
- public XSObject item(int index);
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xs/XSParticle.java b/src/com/sun/org/apache/xerces/internal/xs/XSParticle.java
deleted file mode 100644
index e645625..0000000
--- a/src/com/sun/org/apache/xerces/internal/xs/XSParticle.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xs;
-
-/**
- * This interface represents the Particle schema component.
- */
-public interface XSParticle extends XSObject {
- /**
- * [min occurs]: determines the minimum number of terms that can occur.
- */
- public int getMinOccurs();
-
- /**
- * [max occurs]: determines the maximum number of terms that can occur.
- * To query for the value of unbounded use
- * <code>maxOccursUnbounded</code>. When the value of
- * <code>maxOccursUnbounded</code> is <code>true</code>, the value of
- * <code>maxOccurs</code> is unspecified.
- */
- public int getMaxOccurs();
-
- /**
- * [max occurs]: whether the maxOccurs value is unbounded.
- */
- public boolean getMaxOccursUnbounded();
-
- /**
- * [term]: one of a model group, a wildcard, or an element declaration.
- */
- public XSTerm getTerm();
-
- /**
- * A sequence of [annotations] or an empty <code>XSObjectList</code>.
- */
- public XSObjectList getAnnotations();
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xs/XSSimpleTypeDefinition.java b/src/com/sun/org/apache/xerces/internal/xs/XSSimpleTypeDefinition.java
deleted file mode 100644
index 8442780..0000000
--- a/src/com/sun/org/apache/xerces/internal/xs/XSSimpleTypeDefinition.java
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xs;
-
-/**
- * This interface represents the Simple Type Definition schema component. This
- * interface provides several query operations for facet components. Users
- * can either retrieve the defined facets as XML Schema components, using
- * the <code>facets</code> and the <code>multiValueFacets</code> attributes;
- * or users can separately query a facet's properties using methods such as
- * <code>getLexicalFacetValue</code>, <code>isFixedFacet</code>, etc.
- */
-public interface XSSimpleTypeDefinition extends XSTypeDefinition {
- // Variety definitions
- /**
- * The variety is absent for the anySimpleType definition.
- */
- public static final short VARIETY_ABSENT = 0;
- /**
- * <code>Atomic</code> type.
- */
- public static final short VARIETY_ATOMIC = 1;
- /**
- * <code>List</code> type.
- */
- public static final short VARIETY_LIST = 2;
- /**
- * <code>Union</code> type.
- */
- public static final short VARIETY_UNION = 3;
-
- // Facets
- /**
- * No facets defined.
- */
- public static final short FACET_NONE = 0;
- /**
- * 4.3.1 Length
- */
- public static final short FACET_LENGTH = 1;
- /**
- * 4.3.2 minLength.
- */
- public static final short FACET_MINLENGTH = 2;
- /**
- * 4.3.3 maxLength.
- */
- public static final short FACET_MAXLENGTH = 4;
- /**
- * 4.3.4 pattern.
- */
- public static final short FACET_PATTERN = 8;
- /**
- * 4.3.5 whitespace.
- */
- public static final short FACET_WHITESPACE = 16;
- /**
- * 4.3.7 maxInclusive.
- */
- public static final short FACET_MAXINCLUSIVE = 32;
- /**
- * 4.3.9 maxExclusive.
- */
- public static final short FACET_MAXEXCLUSIVE = 64;
- /**
- * 4.3.9 minExclusive.
- */
- public static final short FACET_MINEXCLUSIVE = 128;
- /**
- * 4.3.10 minInclusive.
- */
- public static final short FACET_MININCLUSIVE = 256;
- /**
- * 4.3.11 totalDigits .
- */
- public static final short FACET_TOTALDIGITS = 512;
- /**
- * 4.3.12 fractionDigits.
- */
- public static final short FACET_FRACTIONDIGITS = 1024;
- /**
- * 4.3.5 enumeration.
- */
- public static final short FACET_ENUMERATION = 2048;
-
- /**
- * A constant defined for the 'ordered' fundamental facet: not ordered.
- */
- public static final short ORDERED_FALSE = 0;
- /**
- * A constant defined for the 'ordered' fundamental facet: partially
- * ordered.
- */
- public static final short ORDERED_PARTIAL = 1;
- /**
- * A constant defined for the 'ordered' fundamental facet: total ordered.
- */
- public static final short ORDERED_TOTAL = 2;
- /**
- * [variety]: one of {atomic, list, union} or absent.
- */
- public short getVariety();
-
- /**
- * If variety is <code>atomic</code> the primitive type definition (a
- * built-in primitive datatype definition or the simple ur-type
- * definition) is available, otherwise <code>null</code>.
- */
- public XSSimpleTypeDefinition getPrimitiveType();
-
- /**
- * Returns the closest built-in type category this type represents or
- * derived from. For example, if this simple type is a built-in derived
- * type integer the <code>INTEGER_DV</code> is returned.
- */
- public short getBuiltInKind();
-
- /**
- * If variety is <code>list</code> the item type definition (an atomic or
- * union simple type definition) is available, otherwise
- * <code>null</code>.
- */
- public XSSimpleTypeDefinition getItemType();
-
- /**
- * If variety is <code>union</code> the list of member type definitions (a
- * non-empty sequence of simple type definitions) is available,
- * otherwise an empty <code>XSObjectList</code>.
- */
- public XSObjectList getMemberTypes();
-
- /**
- * [facets]: all facets defined on this type. The value is a bit
- * combination of FACET_XXX constants of all defined facets.
- */
- public short getDefinedFacets();
-
- /**
- * Convenience method. [Facets]: check whether a facet is defined on this
- * type.
- * @param facetName The name of the facet.
- * @return True if the facet is defined, false otherwise.
- */
- public boolean isDefinedFacet(short facetName);
-
- /**
- * [facets]: all defined facets for this type which are fixed.
- */
- public short getFixedFacets();
-
- /**
- * Convenience method. [Facets]: check whether a facet is defined and
- * fixed on this type.
- * @param facetName The name of the facet.
- * @return True if the facet is fixed, false otherwise.
- */
- public boolean isFixedFacet(short facetName);
-
- /**
- * Convenience method. Returns a value of a single constraining facet for
- * this simple type definition. This method must not be used to retrieve
- * values for <code>enumeration</code> and <code>pattern</code> facets.
- * @param facetName The name of the facet, i.e.
- * <code>FACET_LENGTH, FACET_TOTALDIGITS</code>.
- * To retrieve the value for a pattern or
- * an enumeration, see <code>enumeration</code> and
- * <code>pattern</code>.
- * @return A value of the facet specified in <code>facetName</code> for
- * this simple type definition or <code>null</code>.
- */
- public String getLexicalFacetValue(short facetName);
-
- /**
- * A list of enumeration values if it exists, otherwise an empty
- * <code>StringList</code>.
- */
- public StringList getLexicalEnumeration();
-
- /**
- * A list of pattern values if it exists, otherwise an empty
- * <code>StringList</code>.
- */
- public StringList getLexicalPattern();
-
- /**
- * Fundamental Facet: ordered.
- */
- public short getOrdered();
-
- /**
- * Fundamental Facet: cardinality.
- */
- public boolean getFinite();
-
- /**
- * Fundamental Facet: bounded.
- */
- public boolean getBounded();
-
- /**
- * Fundamental Facet: numeric.
- */
- public boolean getNumeric();
-
- /**
- * A list of constraining facets if it exists, otherwise an empty
- * <code>XSObjectList</code>. Note: This method must not be used to
- * retrieve values for <code>enumeration</code> and <code>pattern</code>
- * facets.
- */
- public XSObjectList getFacets();
-
- /**
- * A list of enumeration and pattern constraining facets if it exists,
- * otherwise an empty <code>XSObjectList</code>.
- */
- public XSObjectList getMultiValueFacets();
-
- /**
- * A sequence of [annotations] or an empty <code>XSObjectList</code>.
- */
- public XSObjectList getAnnotations();
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xs/XSTerm.java b/src/com/sun/org/apache/xerces/internal/xs/XSTerm.java
deleted file mode 100644
index 1287839..0000000
--- a/src/com/sun/org/apache/xerces/internal/xs/XSTerm.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xs;
-
-/**
- * Describes a term that can be one of a model group, a wildcard, or an
- * element declaration. Objects implementing
- * <code>XSElementDeclaration</code>, <code>XSModelGroup</code> and
- * <code>XSWildcard</code> interfaces also implement this interface.
- */
-public interface XSTerm extends XSObject {
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xs/XSTypeDefinition.java b/src/com/sun/org/apache/xerces/internal/xs/XSTypeDefinition.java
deleted file mode 100644
index 3c4cc96..0000000
--- a/src/com/sun/org/apache/xerces/internal/xs/XSTypeDefinition.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xs;
-
-/**
- * This interface represents a complex or simple type definition.
- */
-public interface XSTypeDefinition extends XSObject {
- /**
- * The object describes a complex type.
- */
- public static final short COMPLEX_TYPE = 15;
- /**
- * The object describes a simple type.
- */
- public static final short SIMPLE_TYPE = 16;
- /**
- * Return whether this type definition is a simple type or complex type.
- */
- public short getTypeCategory();
-
- /**
- * {base type definition}: either a simple type definition or a complex
- * type definition.
- */
- public XSTypeDefinition getBaseType();
-
- /**
- * {final}. For a complex type definition it is a subset of {extension,
- * restriction}. For a simple type definition it is a subset of
- * {extension, list, restriction, union}.
- * @param restriction Extension, restriction, list, union constants
- * (defined in <code>XSConstants</code>).
- * @return True if <code>restriction</code> is in the final set,
- * otherwise false.
- */
- public boolean isFinal(short restriction);
-
- /**
- * For complex types the returned value is a bit combination of the subset
- * of {<code>DERIVATION_EXTENSION, DERIVATION_RESTRICTION</code>}
- * corresponding to <code>final</code> set of this type or
- * <code>DERIVATION_NONE</code>. For simple types the returned value is
- * a bit combination of the subset of {
- * <code>DERIVATION_RESTRICTION, DERIVATION_EXTENSION, DERIVATION_UNION, DERIVATION_LIST</code>
- * } corresponding to <code>final</code> set of this type or
- * <code>DERIVATION_NONE</code>.
- */
- public short getFinal();
-
- /**
- * Convenience attribute. A boolean that specifies if the type definition
- * is anonymous.
- */
- public boolean getAnonymous();
-
- /**
- * Convenience method which checks if this type is derived from the given
- * <code>ancestorType</code>.
- * @param ancestorType An ancestor type definition.
- * @param derivationMethod A bit combination representing a subset of {
- * <code>DERIVATION_RESTRICTION, DERIVATION_EXTENSION, DERIVATION_UNION, DERIVATION_LIST</code>
- * }.
- * @return True if this type is derived from <code>ancestorType</code>
- * using only derivation methods from the <code>derivationMethod</code>
- * .
- */
- public boolean derivedFromType(XSTypeDefinition ancestorType,
- short derivationMethod);
-
- /**
- * Convenience method which checks if this type is derived from the given
- * ancestor type.
- * @param namespace An ancestor type namespace.
- * @param name An ancestor type name.
- * @param derivationMethod A bit combination representing a subset of {
- * <code>DERIVATION_RESTRICTION, DERIVATION_EXTENSION, DERIVATION_UNION, DERIVATION_LIST</code>
- * }.
- * @return True if this type is derived from <code>ancestorType</code>
- * using only derivation methods from the <code>derivationMethod</code>
- * .
- */
- public boolean derivedFrom(String namespace,
- String name,
- short derivationMethod);
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xs/XSWildcard.java b/src/com/sun/org/apache/xerces/internal/xs/XSWildcard.java
deleted file mode 100644
index ee68f49..0000000
--- a/src/com/sun/org/apache/xerces/internal/xs/XSWildcard.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xs;
-
-/**
- * This interface represents the Wildcard schema component.
- */
-public interface XSWildcard extends XSTerm {
- // Namespace Constraint
- /**
- * Namespace Constraint: any namespace is allowed.
- */
- public static final short NSCONSTRAINT_ANY = 1;
- /**
- * Namespace Constraint: namespaces in the list are not allowed.
- */
- public static final short NSCONSTRAINT_NOT = 2;
- /**
- * Namespace Constraint: namespaces in the list are allowed.
- */
- public static final short NSCONSTRAINT_LIST = 3;
-
- // Process contents
- /**
- * There must be a top-level declaration for the item available, or the
- * item must have an xsi:type, and the item must be valid as appropriate.
- */
- public static final short PC_STRICT = 1;
- /**
- * No constraints at all: the item must simply be well-formed XML.
- */
- public static final short PC_SKIP = 2;
- /**
- * If the item, or any items among its [children] is an element
- * information item, has a uniquely determined declaration available, it
- * must be valid with respect to that definition, that is, validate
- * where you can and do not worry when you cannot.
- */
- public static final short PC_LAX = 3;
-
- /**
- * Namespace constraint: A constraint type: any, not, list.
- */
- public short getConstraintType();
-
- /**
- * Namespace constraint: For <code>constraintType</code>
- * <code>NSCONSTRAINT_LIST</code>, the list contains allowed namespaces.
- * For <code>constraintType</code> <code>NSCONSTRAINT_NOT</code>, the
- * list contains disallowed namespaces. For <code>constraintType</code>
- * <code>NSCONSTRAINT_ANY</code>, the <code>StringList</code> is empty.
- */
- public StringList getNsConstraintList();
-
- /**
- * [process contents]: one of skip, lax or strict. Valid constants values
- * are: <code>PC_LAX</code>, <code>PC_SKIP</code> and
- * <code>PC_STRICT</code>.
- */
- public short getProcessContents();
-
- /**
- * An annotation if it exists, otherwise <code>null</code>. If not null
- * then the first [annotation] from the sequence of annotations.
- */
- public XSAnnotation getAnnotation();
-
- /**
- * A sequence of [annotations] or an empty <code>XSObjectList</code>.
- */
- public XSObjectList getAnnotations();
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xs/datatypes/ByteList.java b/src/com/sun/org/apache/xerces/internal/xs/datatypes/ByteList.java
deleted file mode 100644
index a113840..0000000
--- a/src/com/sun/org/apache/xerces/internal/xs/datatypes/ByteList.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xerces.internal.xs.datatypes;
-
-import java.util.List;
-
-import com.sun.org.apache.xerces.internal.xs.XSException;
-
-/**
- * <p>The <code>ByteList</code> is an immutable ordered collection of
- * <code>byte</code>.</p>
- *
- * @author Ankit Pasricha, IBM
- *
- * @version $Id: ByteList.java,v 1.7 2010-11-01 04:40:31 joehw Exp $
- */
-public interface ByteList extends List {
-
- /**
- * The number of <code>byte</code>s in the list. The range of
- * valid child object indices is 0 to <code>length-1</code> inclusive.
- */
- public int getLength();
-
- /**
- * Checks if the <code>byte</code> <code>item</code> is a
- * member of this list.
- * @param item <code>byte</code> whose presence in this list
- * is to be tested.
- * @return True if this list contains the <code>byte</code>
- * <code>item</code>.
- */
- public boolean contains(byte item);
-
- /**
- * Returns the <code>index</code>th item in the collection. The index
- * starts at 0.
- * @param index index into the collection.
- * @return The <code>byte</code> at the <code>index</code>th
- * position in the <code>ByteList</code>.
- * @exception XSException
- * INDEX_SIZE_ERR: if <code>index</code> is greater than or equal to the
- * number of objects in the list or less than zero.
- */
- public byte item(int index) throws XSException;
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xs/datatypes/ObjectList.java b/src/com/sun/org/apache/xerces/internal/xs/datatypes/ObjectList.java
deleted file mode 100644
index c47853f..0000000
--- a/src/com/sun/org/apache/xerces/internal/xs/datatypes/ObjectList.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xerces.internal.xs.datatypes;
-
-import java.util.List;
-
-/**
- * <p>The <code>ObjectList</code> is an immutable ordered collection of
- * <code>Object</code>.</p>
- *
- * @author Ankit Pasricha, IBM
- *
- * @version $Id: ObjectList.java,v 1.7 2010-11-01 04:40:31 joehw Exp $
- */
-public interface ObjectList extends List {
-
- /**
- * The number of <code>Object</code>s in the list. The range of
- * valid child object indices is 0 to <code>length-1</code> inclusive.
- */
- public int getLength();
-
- /**
- * Checks if the <code>Object</code> <code>item</code> is a
- * member of this list.
- * @param item <code>Object</code> whose presence in this list
- * is to be tested.
- * @return True if this list contains the <code>Object</code>
- * <code>item</code>.
- */
- public boolean contains(Object item);
-
- /**
- * Returns the <code>index</code>th item in the collection or
- * <code>null</code> if <code>index</code> is greater than or equal to
- * the number of objects in the list. The index starts at 0.
- * @param index index into the collection.
- * @return The <code>Object</code> at the <code>index</code>th
- * position in the <code>ObjectList</code>, or <code>null</code> if
- * the index specified is not valid - greater than or equal to the
- * number of items in the list or less than zero.
- */
- public Object item(int index);
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xs/datatypes/XSDateTime.java b/src/com/sun/org/apache/xerces/internal/xs/datatypes/XSDateTime.java
deleted file mode 100644
index d083290..0000000
--- a/src/com/sun/org/apache/xerces/internal/xs/datatypes/XSDateTime.java
+++ /dev/null
@@ -1,293 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xerces.internal.xs.datatypes;
-
-import javax.xml.datatype.Duration;
-import javax.xml.datatype.XMLGregorianCalendar;
-
-/**
- * <p>Interface to expose the values for all date-time related types. The following
- * table shows the methods defined for various XML Schema 1.0 built-in types. 'X'
- * marks whether a particular method is defined for a particular type. Accessing undefined
- * methods may return unexpected values.
- *
- * <table border="1">
- * <br/>
- * <tr>
- * <td> XML Schema Datatype </td>
- * <td> getYears() </td>
- * <td> getMonths() </td>
- * <td> getDays() </td>
- * <td> getHours() </td>
- * <td> getMinutes() </td>
- * <td> getSeconds() </td>
- * <td> getTimeZoneHours() </td>
- * <td> getTimeZoneMinutes() </td>
- * <td> getXMLGregorianCalendar() </td>
- * <td> getDuration() </td>
- * <td> hasTimeZone() </td>
- * <td> normalize() </td>
- * <td> isNormalized() </td>
- * <td> getLexicalValue() </td>
- * </tr>
- * <tr>
- * <td> gYear </td>
- * <td>X</td>
- * <td>-</td>
- * <td>-</td>
- * <td>-</td>
- * <td>-</td>
- * <td>-</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * <td>-</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * </tr>
- * <tr>
- * <td> gMonth </td>
- * <td>-</td>
- * <td>X</td>
- * <td>-</td>
- * <td>-</td>
- * <td>-</td>
- * <td>-</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * <td>-</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * </tr>
- * <tr>
- * <td> gDay </td>
- * <td>-</td>
- * <td>-</td>
- * <td>X</td>
- * <td>-</td>
- * <td>-</td>
- * <td>-</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * <td>-</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * </tr>
- * <tr>
- * <td> gYearMonth </td>
- * <td>X</td>
- * <td>X</td>
- * <td>-</td>
- * <td>-</td>
- * <td>-</td>
- * <td>-</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * <td>-</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * </tr>
- * <tr>
- * <td> gMonthDay </td>
- * <td>-</td>
- * <td>X</td>
- * <td>X</td>
- * <td>-</td>
- * <td>-</td>
- * <td>-</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * <td>-</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * </tr>
- * <tr>
- * <td> date </td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * <td>-</td>
- * <td>-</td>
- * <td>-</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * <td>-</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * </tr>
- * <tr>
- * <td> time </td>
- * <td>-</td>
- * <td>-</td>
- * <td>-</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * <td>-</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * </tr>
- * <tr>
- * <td> datetime </td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * <td>-</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * </tr>
- * <tr>
- * <td> duration </td>
- * <td>-</td>
- * <td>X</td>
- * <td>-</td>
- * <td>-</td>
- * <td>-</td>
- * <td>X</td>
- * <td>-</td>
- * <td>-</td>
- * <td>-</td>
- * <td>X</td>
- * <td>-</td>
- * <td>-</td>
- * <td>-</td>
- * <td>X</td>
- * </tr>
- * </table>
- * </p>
- *
- * @author Ankit Pasricha, IBM
- *
- */
-public interface XSDateTime {
-
- /**
- * @return years - can be negative for date-time related types;
- *
- */
- public int getYears();
-
- /**
- * @return months - can be negative only for duration types;
- * For duration types, it returns years*12 + months
- */
- public int getMonths();
-
- /**
- * @return days - cannot be negative;
- *
- */
- public int getDays();
-
- /**
- * @return hours - cannot be negative;
- *
- */
- public int getHours();
-
- /**
- * @return minutes - cannot be negative;
- *
- */
- public int getMinutes();
-
- /**
- * @return seconds - can be negative only for durations;
- * For duration types, it returns days*24*3600 + hours*3600
- * + minutes*60 + seconds
- */
- public double getSeconds();
-
- /**
- * @return boolean (true when timezone is specified in the original lexical value)
- *
- */
- public boolean hasTimeZone();
-
- /**
- * @return timezone hours (for GMT-xx:xx this will be negative),
- *
- */
- public int getTimeZoneHours();
-
- /**
- * @return timezone minutes (for GMT-xx:xx this will be negative),
- *
- */
- public int getTimeZoneMinutes();
-
- /**
- * @return the original lexical value
- */
- public String getLexicalValue();
-
- /**
- * @return a new date-time related object with normalized values
- * (has no effect on objects already
- * normalized)
- */
- public XSDateTime normalize();
-
- /**
- * @return whether a date-time related object is normalized or not
- * (value is not useful for types where timezone is not specified)
- */
- public boolean isNormalized();
-
- /**
- * @return an un-normalized XMLGregorianCalendar (if applicable otherwise null)
- */
- public XMLGregorianCalendar getXMLGregorianCalendar();
-
- /**
- * @return a Duration (if applicable otherwise null)
- */
- public Duration getDuration();
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xs/datatypes/XSDecimal.java b/src/com/sun/org/apache/xerces/internal/xs/datatypes/XSDecimal.java
deleted file mode 100644
index 2170992..0000000
--- a/src/com/sun/org/apache/xerces/internal/xs/datatypes/XSDecimal.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xerces.internal.xs.datatypes;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-
-/**
- * <p>Interface to expose the value of 'decimal' and related datatypes.</p>
- *
- * @author Naela Nissar, IBM
- *
- */
-public interface XSDecimal {
-
- /**
- * @return the <code>BigDecimal</code> representation of this object
- */
- public BigDecimal getBigDecimal();
-
- /**
- * @return the <code>BigInteger</code> representation of this object
- * @exception NumberFormatException if the value cannot be represented as a <code>BigInteger</code>
- */
- public BigInteger getBigInteger() throws NumberFormatException;
-
- /**
- * @return the long value representation of this object
- * @exception NumberFormatException if the value cannot be represented as a <code>long</code>
- */
- public long getLong() throws NumberFormatException;
-
- /**
- * @return the int value representation of this object
- * @exception NumberFormatException if the value cannot be represented as a <code>int</code>
- */
- public int getInt() throws NumberFormatException;
-
- /**
- * @return the short value representation of this object
- * @exception NumberFormatException if the value cannot be represented as a <code>short</code>
- */
- public short getShort() throws NumberFormatException;
-
- /**
- * @return the byte value representation of this object
- * @exception NumberFormatException if the value cannot be represented as a <code>byte</code>
- */
- public byte getByte() throws NumberFormatException;
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xs/datatypes/XSDouble.java b/src/com/sun/org/apache/xerces/internal/xs/datatypes/XSDouble.java
deleted file mode 100644
index d3cb715..0000000
--- a/src/com/sun/org/apache/xerces/internal/xs/datatypes/XSDouble.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xerces.internal.xs.datatypes;
-
-/**
- * <p>Interface to expose the value of the 'double' datatype.</p>
- *
- * @author Ankit Pasricha, IBM
- *
- */
-public interface XSDouble {
-
- /**
- * @return a double value
- */
- public double getValue();
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xs/datatypes/XSFloat.java b/src/com/sun/org/apache/xerces/internal/xs/datatypes/XSFloat.java
deleted file mode 100644
index b7f8d6b..0000000
--- a/src/com/sun/org/apache/xerces/internal/xs/datatypes/XSFloat.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xerces.internal.xs.datatypes;
-
-/**
- * <p>Interface to expose value of the float datatype.</p>
- *
- * @author Ankit Pasricha, IBM
- *
- */
-public interface XSFloat {
-
- /**
- * @return a float value
- */
- public float getValue();
-
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xs/datatypes/XSQName.java b/src/com/sun/org/apache/xerces/internal/xs/datatypes/XSQName.java
deleted file mode 100644
index f780a61..0000000
--- a/src/com/sun/org/apache/xerces/internal/xs/datatypes/XSQName.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xerces.internal.xs.datatypes;
-
-/**
- * Interface to expose QName actual values
- *
- * @author Ankit Pasricha, IBM
- */
-public interface XSQName {
-
- /**
- * @return com.sun.org.apache.xerces.internal.xni.QName class instance
- */
- public com.sun.org.apache.xerces.internal.xni.QName getXNIQName();
-
- /**
- * @return javax.xml.namespace.QName class instance
- */
- public javax.xml.namespace.QName getJAXPQName();
-}
diff --git a/src/com/sun/org/apache/xerces/internal/xs/datatypes/package.html b/src/com/sun/org/apache/xerces/internal/xs/datatypes/package.html
deleted file mode 100644
index 6023f05..0000000
--- a/src/com/sun/org/apache/xerces/internal/xs/datatypes/package.html
+++ /dev/null
@@ -1,309 +0,0 @@
-<!--
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
--->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head >
-<!--
-
- Copyright 2005 The Apache Software Foundation.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
--->
-</head>
-<body bgcolor="white">This package provides interfaces for accessing actual value information through PSVI for XML Schema 1.0 data types.
-<BR>
-<BR>
-The table below gives the data type to applicable interface mapping:
-<BR>
-<BR>
-<TABLE border="1">
- <TBODY>
- <TR>
- <TD width="332" align="center">XML Schema Data Type</TD>
- <TD align="center" width="202">Interface/Class</TD>
- </TR>
- <TR>
- <TD width="332"></TD>
- <TD width="202"></TD>
- </TR>
- <TR>
- <TD width="332" align="center">string</TD>
- <TD width="202" align="center">java.lang.String</TD>
- </TR>
- <TR>
- <TD width="332" align="center">boolean</TD>
- <TD width="202" align="center">java.lang.Boolean</TD>
- </TR>
- <TR>
- <TD width="332" align="center">decimal</TD>
- <TD width="202" align="center">XSDecimal</TD>
- </TR>
- <TR>
- <TD width="332" align="center">float</TD>
- <TD width="202" align="center">XSFloat</TD>
- </TR>
- <TR>
- <TD width="332" align="center">double</TD>
- <TD width="202" align="center">XSDouble</TD>
- </TR>
- <TR>
- <TD width="332" align="center">duration</TD>
- <TD width="202" align="center">XSDateTime</TD>
- </TR>
- <TR>
- <TD width="332" align="center">dateTime</TD>
- <TD width="202" align="center">XSDateTime</TD>
- </TR>
- <TR>
- <TD width="332" align="center">date</TD>
- <TD width="202" align="center">XSDateTime</TD>
- </TR>
- <TR>
- <TD width="332" align="center">time</TD>
- <TD width="202" align="center">XSDateTime</TD>
- </TR>
- <TR>
- <TD width="332" align="center">gYear</TD>
- <TD width="202" align="center">XSDateTime</TD>
- </TR>
- <TR>
- <TD width="332" align="center">gMonth</TD>
- <TD width="202" align="center">XSDateTime</TD>
- </TR>
- <TR>
- <TD width="332" align="center">gDay</TD>
- <TD width="202" align="center">XSDateTime</TD>
- </TR>
- <TR>
- <TD width="332" align="center">gYearMonth</TD>
- <TD width="202" align="center">XSDateTime</TD>
- </TR>
- <TR>
- <TD width="332" align="center">gMonthDay</TD>
- <TD width="202" align="center">XSDateTime</TD>
- </TR>
- <TR>
- <TD width="332" align="center">hexBinary</TD>
- <TD width="202" align="center">ByteList</TD>
- </TR>
- <TR>
- <TD width="332" align="center">base64Binary</TD>
- <TD width="202" align="center">ByteList</TD>
- </TR>
- <TR>
- <TD width="332" align="center">anyURI</TD>
- <TD width="202" align="center">java.lang.String</TD>
- </TR>
- <TR>
- <TD width="332" align="center">QName</TD>
- <TD width="202" align="center">XSQName</TD>
- </TR>
- <TR>
- <TD width="332" align="center">NOTATION</TD>
- <TD width="202" align="center">XSQName</TD>
- </TR>
- <TR>
- <TD width="332" align="center">normalizedString</TD>
- <TD width="202" align="center">java.lang.String</TD>
- </TR>
- <TR>
- <TD width="332" align="center">token</TD>
- <TD width="202" align="center">java.lang.String</TD>
- </TR>
- <TR>
- <TD width="332" align="center">language</TD>
- <TD width="202" align="center">java.lang.String</TD>
- </TR>
- <TR>
- <TD width="332" align="center">NMTOKEN</TD>
- <TD width="202" align="center">java.lang.String</TD>
- </TR>
- <TR>
- <TD width="332" align="center">NMTOKENS</TD>
- <TD width="202" align="center">ObjectList</TD>
- </TR>
- <TR>
- <TD width="332" align="center">Name</TD>
- <TD width="202" align="center">java.lang.String</TD>
- </TR>
- <TR>
- <TD width="332" align="center">NCName</TD>
- <TD width="202" align="center">java.lang.String</TD>
- </TR>
- <TR>
- <TD width="332" align="center">ID</TD>
- <TD width="202" align="center">java.lang.String</TD>
- </TR>
- <TR>
- <TD width="332" align="center">IDREF</TD>
- <TD width="202" align="center">java.lang.String</TD>
- </TR>
- <TR>
- <TD width="332" align="center">IDREFS</TD>
- <TD width="202" align="center">ObjectList</TD>
- </TR>
- <TR>
- <TD width="332" align="center">ENTITY</TD>
- <TD width="202" align="center">java.lang.String</TD>
- </TR>
- <TR>
- <TD width="332" align="center">ENTITIES</TD>
- <TD width="202" align="center">ObjectList</TD>
- </TR>
- <TR>
- <TD width="332" align="center">list</TD>
- <TD width="202" align="center">ObjectList</TD>
- </TR>
- <TR>
- <TD width="332" align="center">integer</TD>
- <TD width="202" align="center">XSDecimal</TD>
- </TR>
- <TR>
- <TD width="332" align="center">positiveInteger</TD>
- <TD width="202" align="center">XSDecimal</TD>
- </TR>
- <TR>
- <TD width="332" align="center">negativeInteger</TD>
- <TD width="202" align="center">XSDecimal</TD>
- </TR>
- <TR>
- <TD width="332" align="center">nonPositiveInteger</TD>
- <TD width="202" align="center">XSDecimal</TD>
- </TR>
- <TR>
- <TD width="332" align="center">nonNegativeInteger</TD>
- <TD width="202" align="center">XSDecimal</TD>
- </TR>
- <TR>
- <TD width="332" align="center">unsignedShort</TD>
- <TD width="202" align="center">XSDecimal</TD>
- </TR>
- <TR>
- <TD width="332" align="center">unsignedLong</TD>
- <TD width="202" align="center">XSDecimal</TD>
- </TR>
- <TR>
- <TD width="332" align="center">unsignedByte</TD>
- <TD width="202" align="center">XSDecimal</TD>
- </TR>
- <TR>
- <TD width="332" align="center">unsignedInt</TD>
- <TD width="202" align="center">XSDecimal</TD>
- </TR>
- <TR>
- <TD width="332" align="center">long</TD>
- <TD width="202" align="center">XSDecimal</TD>
- </TR>
- <TR>
- <TD width="332" align="center">int</TD>
- <TD width="202" align="center">XSDecimal</TD>
- </TR>
- <TR>
- <TD width="332" align="center">short</TD>
- <TD width="202" align="center">XSDecimal</TD>
- </TR>
- <TR>
- <TD width="332" align="center">byte</TD>
- <TD width="202" align="center">XSDecimal</TD>
- </TR>
- </TBODY>
-</TABLE>
-<P><BR>As shown above, the XSDateTime interface provides mapping to a number of decimal/integer data types. The application needs to ensure that appropriate methods for each of these types is invoked. The mapping of these types to defined methods is shown in the table below. Accessing methods that are undefined for a type will give unexpected results.
-</P>
-
-
-<P><BR>
-</P>
-<TABLE border="1">
- <TBODY>
- <TR>
- <TD width="308" align="center">XML Schema Data Type</TD>
- <TD width="228" align="center">Applicable method in XSDateTime*</TD>
- </TR>
- <TR>
- <TD width="308"></TD>
- <TD width="228"></TD>
- </TR>
- <TR>
- <TD width="332" align="center">integer</TD><TD width="202" align="center">getBigInteger()</TD>
-
- </TR>
- <TR>
- <TD width="332" align="center">positiveInteger</TD><TD width="202" align="center">getBigInteger()</TD>
-
- </TR>
- <TR>
- <TD width="332" align="center">negativeInteger</TD><TD width="202" align="center">getBigInteger()</TD>
-
- </TR>
- <TR>
- <TD width="332" align="center">nonPositiveInteger</TD><TD width="202" align="center">getBigInteger()</TD>
-
- </TR>
- <TR>
- <TD width="332" align="center">nonNegativeInteger</TD><TD width="202" align="center">getBigInteger()</TD>
-
- </TR>
- <TR>
- <TD width="332" align="center">unsignedShort</TD><TD width="202" align="center">getInt()</TD>
-
- </TR>
- <TR>
- <TD width="332" align="center">unsignedLong</TD><TD width="202" align="center">getBigInteger()</TD>
-
- </TR>
- <TR>
- <TD width="332" align="center">unsignedByte</TD><TD width="202" align="center">getShort()</TD>
-
- </TR>
- <TR>
- <TD width="332" align="center">unsignedInt</TD><TD width="202" align="center">getLong()</TD>
-
- </TR>
- <TR>
- <TD width="332" align="center">long</TD><TD width="202" align="center">getLong()</TD>
-
- </TR>
- <TR>
- <TD width="332" align="center">int</TD><TD width="202" align="center">getInt()</TD>
-
- </TR>
- <TR>
- <TD width="332" align="center">short</TD><TD width="202" align="center">getShort()</TD>
-
- </TR>
- <TR>
- <TD width="332" align="center">byte</TD><TD width="202" align="center">getByte()</TD>
-
- </TR>
- <TR>
- <TD width="308"></TD>
- <TD width="228"></TD>
- </TR>
- </TBODY>
-</TABLE>
-<P><BR>* <SPAN
- style='font-size:12.0pt;font-family:"Times New Roman";
-mso-fareast-font-family:"Times New Roman";mso-ansi-language:EN-US;mso-fareast-language:
-EN-GB;mso-bidi-language:AR-SA'>This
-shows the base method that can be called. That is, users can call this
-method and all methods returning bigger types than the base method
-according to the order: byte &lt; short &lt; int &lt; long &lt;
-BigInteger &lt; BigDecimal. For example, in the case of unsignedShort,
-users can call getInt(), getLong(), getBigInteger() and getBigDecimal()
-but NOT getShort() or getByte().</SPAN>
-</P></body>
-</html>
diff --git a/src/com/sun/org/apache/xml/internal/dtm/Axis.java b/src/com/sun/org/apache/xml/internal/dtm/Axis.java
deleted file mode 100644
index 9239715..0000000
--- a/src/com/sun/org/apache/xml/internal/dtm/Axis.java
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Axis.java,v 1.2.4.1 2005/09/15 08:14:51 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.dtm;
-
-/**
- * Specifies values related to XPath Axes.
- * <p>The ancestor, descendant, following, preceding and self axes partition a
- * document (ignoring attribute and namespace nodes): they do not overlap
- * and together they contain all the nodes in the document.</p>
- *
- */
-public final class Axis
-{
-
- /**
- * The ancestor axis contains the ancestors of the context node;
- * the ancestors of the context node consist of the parent of context
- * node and the parent's parent and so on; thus, the ancestor axis will
- * always include the root node, unless the context node is the root node.
- */
- public static final int ANCESTOR = 0;
-
- /**
- * the ancestor-or-self axis contains the context node and the ancestors of
- * the context node; thus, the ancestor axis will always include the
- * root node.
- */
- public static final int ANCESTORORSELF = 1;
-
- /**
- * the attribute axis contains the attributes of the context node; the axis
- * will be empty unless the context node is an element.
- */
- public static final int ATTRIBUTE = 2;
-
- /** The child axis contains the children of the context node. */
- public static final int CHILD = 3;
-
- /**
- * The descendant axis contains the descendants of the context node;
- * a descendant is a child or a child of a child and so on; thus the
- * descendant axis never contains attribute or namespace nodes.
- */
- public static final int DESCENDANT = 4;
-
- /**
- * The descendant-or-self axis contains the context node and the
- * descendants of the context node.
- */
- public static final int DESCENDANTORSELF = 5;
-
- /**
- * the following axis contains all nodes in the same document as the
- * context node that are after the context node in document order, excluding
- * any descendants and excluding attribute nodes and namespace nodes.
- */
- public static final int FOLLOWING = 6;
-
- /**
- * The following-sibling axis contains all the following siblings of the
- * context node; if the context node is an attribute node or namespace node,
- * the following-sibling axis is empty.
- */
- public static final int FOLLOWINGSIBLING = 7;
-
- /**
- * The namespace axis contains the namespace nodes of the context node; the
- * axis will be empty unless the context node is an element.
- */
- public static final int NAMESPACEDECLS = 8;
-
- /**
- * The namespace axis contains the namespace nodes of the context node; the
- * axis will be empty unless the context node is an element.
- */
- public static final int NAMESPACE = 9;
-
- /**
- * The parent axis contains the parent of the context node,
- * if there is one.
- */
- public static final int PARENT = 10;
-
- /**
- * The preceding axis contains all nodes in the same document as the context
- * node that are before the context node in document order, excluding any
- * ancestors and excluding attribute nodes and namespace nodes
- */
- public static final int PRECEDING = 11;
-
- /**
- * The preceding-sibling axis contains all the preceding siblings of the
- * context node; if the context node is an attribute node or namespace node,
- * the preceding-sibling axis is empty.
- */
- public static final int PRECEDINGSIBLING = 12;
-
- /** The self axis contains just the context node itself. */
- public static final int SELF = 13;
-
- /**
- * A non-xpath axis, traversing the subtree including the subtree
- * root, descendants, attributes, and namespace node decls.
- */
- public static final int ALLFROMNODE = 14;
-
- /**
- * A non-xpath axis, traversing the the preceding and the ancestor nodes,
- * needed for inverseing select patterns to match patterns.
- */
- public static final int PRECEDINGANDANCESTOR = 15;
-
- // ===========================================
- // All axis past this are absolute.
-
- /**
- * A non-xpath axis, returns all nodes in the tree from and including the
- * root.
- */
- public static final int ALL = 16;
-
- /**
- * A non-xpath axis, returns all nodes that aren't namespaces or attributes,
- * from and including the root.
- */
- public static final int DESCENDANTSFROMROOT = 17;
-
- /**
- * A non-xpath axis, returns all nodes that aren't namespaces or attributes,
- * from and including the root.
- */
- public static final int DESCENDANTSORSELFFROMROOT = 18;
-
- /**
- * A non-xpath axis, returns root only.
- */
- public static final int ROOT = 19;
-
- /**
- * A non-xpath axis, for functions.
- */
- public static final int FILTEREDLIST = 20;
-
- /**
- * A table to identify whether an axis is a reverse axis;
- */
- private static final boolean[] isReverse = {
- true, // ancestor
- true, // ancestor-or-self
- false, // attribute
- false, // child
- false, // descendant
- false, // descendant-or-self
- false, // following
- false, // following-sibling
- false, // namespace
- false, // namespace-declarations
- false, // parent (one node, has no order)
- true, // preceding
- true, // preceding-sibling
- false // self (one node, has no order)
- };
-
- /** The names of the axes for diagnostic purposes. */
- private static final String[] names =
- {
- "ancestor", // 0
- "ancestor-or-self", // 1
- "attribute", // 2
- "child", // 3
- "descendant", // 4
- "descendant-or-self", // 5
- "following", // 6
- "following-sibling", // 7
- "namespace-decls", // 8
- "namespace", // 9
- "parent", // 10
- "preceding", // 11
- "preceding-sibling", // 12
- "self", // 13
- "all-from-node", // 14
- "preceding-and-ancestor", // 15
- "all", // 16
- "descendants-from-root", // 17
- "descendants-or-self-from-root", // 18
- "root", // 19
- "filtered-list" // 20
- };
-
- public static boolean isReverse(int axis){
- return isReverse[axis];
- }
-
- public static String getNames(int index){
- return names[index];
- }
-
- public static int getNamesLength(){
- return names.length;
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/dtm/DTM.java b/src/com/sun/org/apache/xml/internal/dtm/DTM.java
deleted file mode 100644
index 9182833..0000000
--- a/src/com/sun/org/apache/xml/internal/dtm/DTM.java
+++ /dev/null
@@ -1,969 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DTM.java,v 1.2.4.1 2005/09/15 08:14:51 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.dtm;
-
-import javax.xml.transform.SourceLocator;
-
-import com.sun.org.apache.xml.internal.utils.XMLString;
-
-/**
- * <code>DTM</code> is an XML document model expressed as a table
- * rather than an object tree. It attempts to provide an interface to
- * a parse tree that has very little object creation. (DTM
- * implementations may also support incremental construction of the
- * model, but that's hidden from the DTM API.)
- *
- * <p>Nodes in the DTM are identified by integer "handles". A handle must
- * be unique within a process, and carries both node identification and
- * document identification. It must be possible to compare two handles
- * (and thus their nodes) for identity with "==".</p>
- *
- * <p>Namespace URLs, local-names, and expanded-names can all be
- * represented by and tested as integer ID values. An expanded name
- * represents (and may or may not directly contain) a combination of
- * the URL ID, and the local-name ID. Note that the namespace URL id
- * can be 0, which should have the meaning that the namespace is null.
- * For consistancy, zero should not be used for a local-name index. </p>
- *
- * <p>Text content of a node is represented by an index and length,
- * permitting efficient storage such as a shared FastStringBuffer.</p>
- *
- * <p>The model of the tree, as well as the general navigation model,
- * is that of XPath 1.0, for the moment. The model will eventually be
- * adapted to match the XPath 2.0 data model, XML Schema, and
- * InfoSet.</p>
- *
- * <p>DTM does _not_ directly support the W3C's Document Object
- * Model. However, it attempts to come close enough that an
- * implementation of DTM can be created that wraps a DOM and vice
- * versa.</p>
- *
- * <p><strong>Please Note:</strong> The DTM API is still
- * <strong>Subject To Change.</strong> This wouldn't affect most
- * users, but might require updating some extensions.</p>
- *
- * <p> The largest change being contemplated is a reconsideration of
- * the Node Handle representation. We are still not entirely sure
- * that an integer packed with two numeric subfields is really the
- * best solution. It has been suggested that we move up to a Long, to
- * permit more nodes per document without having to reduce the number
- * of slots in the DTMManager. There's even been a proposal that we
- * replace these integers with "cursor" objects containing the
- * internal node id and a pointer to the actual DTM object; this might
- * reduce the need to continuously consult the DTMManager to retrieve
- * the latter, and might provide a useful "hook" back into normal Java
- * heap management. But changing this datatype would have huge impact
- * on Xalan's internals -- especially given Java's lack of C-style
- * typedefs -- so we won't cut over unless we're convinced the new
- * solution really would be an improvement!</p>
- * */
-public interface DTM
-{
-
- /**
- * Null node handles are represented by this value.
- */
- public static final int NULL = -1;
-
- // These nodeType mnemonics and values are deliberately the same as those
- // used by the DOM, for convenient mapping
- //
- // %REVIEW% Should we actually define these as initialized to,
- // eg. org.w3c.dom.Document.ELEMENT_NODE?
-
- /**
- * The node is a <code>Root</code>.
- */
- public static final short ROOT_NODE = 0;
-
- /**
- * The node is an <code>Element</code>.
- */
- public static final short ELEMENT_NODE = 1;
-
- /**
- * The node is an <code>Attr</code>.
- */
- public static final short ATTRIBUTE_NODE = 2;
-
- /**
- * The node is a <code>Text</code> node.
- */
- public static final short TEXT_NODE = 3;
-
- /**
- * The node is a <code>CDATASection</code>.
- */
- public static final short CDATA_SECTION_NODE = 4;
-
- /**
- * The node is an <code>EntityReference</code>.
- */
- public static final short ENTITY_REFERENCE_NODE = 5;
-
- /**
- * The node is an <code>Entity</code>.
- */
- public static final short ENTITY_NODE = 6;
-
- /**
- * The node is a <code>ProcessingInstruction</code>.
- */
- public static final short PROCESSING_INSTRUCTION_NODE = 7;
-
- /**
- * The node is a <code>Comment</code>.
- */
- public static final short COMMENT_NODE = 8;
-
- /**
- * The node is a <code>Document</code>.
- */
- public static final short DOCUMENT_NODE = 9;
-
- /**
- * The node is a <code>DocumentType</code>.
- */
- public static final short DOCUMENT_TYPE_NODE = 10;
-
- /**
- * The node is a <code>DocumentFragment</code>.
- */
- public static final short DOCUMENT_FRAGMENT_NODE = 11;
-
- /**
- * The node is a <code>Notation</code>.
- */
- public static final short NOTATION_NODE = 12;
-
- /**
- * The node is a <code>namespace node</code>. Note that this is not
- * currently a node type defined by the DOM API.
- */
- public static final short NAMESPACE_NODE = 13;
-
- /**
- * The number of valid nodetypes.
- */
- public static final short NTYPES = 14;
-
- // ========= DTM Implementation Control Functions. ==============
- // %TBD% RETIRED -- do via setFeature if needed. Remove from impls.
- // public void setParseBlockSize(int blockSizeSuggestion);
-
- /**
- * Set an implementation dependent feature.
- * <p>
- * %REVIEW% Do we really expect to set features on DTMs?
- *
- * @param featureId A feature URL.
- * @param state true if this feature should be on, false otherwise.
- */
- public void setFeature(String featureId, boolean state);
-
- /**
- * Set a run time property for this DTM instance.
- *
- * @param property a <code>String</code> value
- * @param value an <code>Object</code> value
- */
- public void setProperty(String property, Object value);
-
- // ========= Document Navigation Functions =========
-
- /**
- * This returns a stateless "traverser", that can navigate over an
- * XPath axis, though not in document order.
- *
- * @param axis One of Axes.ANCESTORORSELF, etc.
- *
- * @return A DTMAxisIterator, or null if the givin axis isn't supported.
- */
- public DTMAxisTraverser getAxisTraverser(final int axis);
-
- /**
- * This is a shortcut to the iterators that implement
- * XPath axes.
- * Returns a bare-bones iterator that must be initialized
- * with a start node (using iterator.setStartNode()).
- *
- * @param axis One of Axes.ANCESTORORSELF, etc.
- *
- * @return A DTMAxisIterator, or null if the givin axis isn't supported.
- */
- public DTMAxisIterator getAxisIterator(final int axis);
-
- /**
- * Get an iterator that can navigate over an XPath Axis, predicated by
- * the extended type ID.
- *
- * @param axis
- * @param type An extended type ID.
- *
- * @return A DTMAxisIterator, or null if the givin axis isn't supported.
- */
- public DTMAxisIterator getTypedAxisIterator(final int axis, final int type);
-
- /**
- * Given a node handle, test if it has child nodes.
- * <p> %REVIEW% This is obviously useful at the DOM layer, where it
- * would permit testing this without having to create a proxy
- * node. It's less useful in the DTM API, where
- * (dtm.getFirstChild(nodeHandle)!=DTM.NULL) is just as fast and
- * almost as self-evident. But it's a convenience, and eases porting
- * of DOM code to DTM. </p>
- *
- * @param nodeHandle int Handle of the node.
- * @return int true if the given node has child nodes.
- */
- public boolean hasChildNodes(int nodeHandle);
-
- /**
- * Given a node handle, get the handle of the node's first child.
- *
- * @param nodeHandle int Handle of the node.
- * @return int DTM node-number of first child,
- * or DTM.NULL to indicate none exists.
- */
- public int getFirstChild(int nodeHandle);
-
- /**
- * Given a node handle, get the handle of the node's last child.
- *
- * @param nodeHandle int Handle of the node.
- * @return int Node-number of last child,
- * or DTM.NULL to indicate none exists.
- */
- public int getLastChild(int nodeHandle);
-
- /**
- * Retrieves an attribute node by local name and namespace URI
- *
- * %TBD% Note that we currently have no way to support
- * the DOM's old getAttribute() call, which accesses only the qname.
- *
- * @param elementHandle Handle of the node upon which to look up this attribute.
- * @param namespaceURI The namespace URI of the attribute to
- * retrieve, or null.
- * @param name The local name of the attribute to
- * retrieve.
- * @return The attribute node handle with the specified name (
- * <code>nodeName</code>) or <code>DTM.NULL</code> if there is no such
- * attribute.
- */
- public int getAttributeNode(int elementHandle, String namespaceURI,
- String name);
-
- /**
- * Given a node handle, get the index of the node's first attribute.
- *
- * @param nodeHandle int Handle of the node.
- * @return Handle of first attribute, or DTM.NULL to indicate none exists.
- */
- public int getFirstAttribute(int nodeHandle);
-
- /**
- * Given a node handle, get the index of the node's first namespace node.
- *
- * @param nodeHandle handle to node, which should probably be an element
- * node, but need not be.
- *
- * @param inScope true if all namespaces in scope should be
- * returned, false if only the node's own
- * namespace declarations should be returned.
- * @return handle of first namespace,
- * or DTM.NULL to indicate none exists.
- */
- public int getFirstNamespaceNode(int nodeHandle, boolean inScope);
-
- /**
- * Given a node handle, advance to its next sibling.
- * @param nodeHandle int Handle of the node.
- * @return int Node-number of next sibling,
- * or DTM.NULL to indicate none exists.
- */
- public int getNextSibling(int nodeHandle);
-
- /**
- * Given a node handle, find its preceeding sibling.
- * WARNING: DTM implementations may be asymmetric; in some,
- * this operation has been resolved by search, and is relatively expensive.
- *
- * @param nodeHandle the id of the node.
- * @return int Node-number of the previous sib,
- * or DTM.NULL to indicate none exists.
- */
- public int getPreviousSibling(int nodeHandle);
-
- /**
- * Given a node handle, advance to the next attribute. If an
- * element, we advance to its first attribute; if an attr, we advance to
- * the next attr of the same element.
- *
- * @param nodeHandle int Handle of the node.
- * @return int DTM node-number of the resolved attr,
- * or DTM.NULL to indicate none exists.
- */
- public int getNextAttribute(int nodeHandle);
-
- /**
- * Given a namespace handle, advance to the next namespace in the same scope
- * (local or local-plus-inherited, as selected by getFirstNamespaceNode)
- *
- * @param baseHandle handle to original node from where the first child
- * was relative to (needed to return nodes in document order).
- * @param namespaceHandle handle to node which must be of type
- * NAMESPACE_NODE.
- * NEEDSDOC @param inScope
- * @return handle of next namespace,
- * or DTM.NULL to indicate none exists.
- */
- public int getNextNamespaceNode(int baseHandle, int namespaceHandle,
- boolean inScope);
-
- /**
- * Given a node handle, find its parent node.
- *
- * @param nodeHandle the id of the node.
- * @return int Node handle of parent,
- * or DTM.NULL to indicate none exists.
- */
- public int getParent(int nodeHandle);
-
- /**
- * Given a DTM which contains only a single document,
- * find the Node Handle of the Document node. Note
- * that if the DTM is configured so it can contain multiple
- * documents, this call will return the Document currently
- * under construction -- but may return null if it's between
- * documents. Generally, you should use getOwnerDocument(nodeHandle)
- * or getDocumentRoot(nodeHandle) instead.
- *
- * @return int Node handle of document, or DTM.NULL if a shared DTM
- * can not tell us which Document is currently active.
- */
- public int getDocument();
-
- /**
- * Given a node handle, find the owning document node. This version mimics
- * the behavior of the DOM call by the same name.
- *
- * @param nodeHandle the id of the node.
- * @return int Node handle of owning document, or DTM.NULL if the node was
- * a Document.
- * @see #getDocumentRoot(int nodeHandle)
- */
- public int getOwnerDocument(int nodeHandle);
-
- /**
- * Given a node handle, find the owning document node.
- *
- * @param nodeHandle the id of the node.
- * @return int Node handle of owning document, or the node itself if it was
- * a Document. (Note difference from DOM, where getOwnerDocument returns
- * null for the Document node.)
- * @see #getOwnerDocument(int nodeHandle)
- */
- public int getDocumentRoot(int nodeHandle);
-
- /**
- * Get the string-value of a node as a String object
- * (see http://www.w3.org/TR/xpath#data-model
- * for the definition of a node's string-value).
- *
- * @param nodeHandle The node ID.
- *
- * @return A string object that represents the string-value of the given node.
- */
- public XMLString getStringValue(int nodeHandle);
-
- /**
- * Get number of character array chunks in
- * the string-value of a node.
- * (see http://www.w3.org/TR/xpath#data-model
- * for the definition of a node's string-value).
- * Note that a single text node may have multiple text chunks.
- *
- * @param nodeHandle The node ID.
- *
- * @return number of character array chunks in
- * the string-value of a node.
- */
- public int getStringValueChunkCount(int nodeHandle);
-
- /**
- * Get a character array chunk in the string-value of a node.
- * (see http://www.w3.org/TR/xpath#data-model
- * for the definition of a node's string-value).
- * Note that a single text node may have multiple text chunks.
- *
- * @param nodeHandle The node ID.
- * @param chunkIndex Which chunk to get.
- * @param startAndLen A two-integer array which, upon return, WILL
- * BE FILLED with values representing the chunk's start position
- * within the returned character buffer and the length of the chunk.
- * @return The character array buffer within which the chunk occurs,
- * setting startAndLen's contents as a side-effect.
- */
- public char[] getStringValueChunk(int nodeHandle, int chunkIndex,
- int[] startAndLen);
-
- /**
- * Given a node handle, return an ID that represents the node's expanded name.
- *
- * @param nodeHandle The handle to the node in question.
- *
- * @return the expanded-name id of the node.
- */
- public int getExpandedTypeID(int nodeHandle);
-
- /**
- * Given an expanded name, return an ID. If the expanded-name does not
- * exist in the internal tables, the entry will be created, and the ID will
- * be returned. Any additional nodes that are created that have this
- * expanded name will use this ID.
- *
- * NEEDSDOC @param namespace
- * NEEDSDOC @param localName
- * NEEDSDOC @param type
- *
- * @return the expanded-name id of the node.
- */
- public int getExpandedTypeID(String namespace, String localName, int type);
-
- /**
- * Given an expanded-name ID, return the local name part.
- *
- * @param ExpandedNameID an ID that represents an expanded-name.
- * @return String Local name of this node.
- */
- public String getLocalNameFromExpandedNameID(int ExpandedNameID);
-
- /**
- * Given an expanded-name ID, return the namespace URI part.
- *
- * @param ExpandedNameID an ID that represents an expanded-name.
- * @return String URI value of this node's namespace, or null if no
- * namespace was resolved.
- */
- public String getNamespaceFromExpandedNameID(int ExpandedNameID);
-
- /**
- * Given a node handle, return its DOM-style node name. This will
- * include names such as #text or #document.
- *
- * @param nodeHandle the id of the node.
- * @return String Name of this node, which may be an empty string.
- * %REVIEW% Document when empty string is possible...
- */
- public String getNodeName(int nodeHandle);
-
- /**
- * Given a node handle, return the XPath node name. This should be
- * the name as described by the XPath data model, NOT the DOM-style
- * name.
- *
- * @param nodeHandle the id of the node.
- * @return String Name of this node.
- */
- public String getNodeNameX(int nodeHandle);
-
- /**
- * Given a node handle, return its DOM-style localname.
- * (As defined in Namespaces, this is the portion of the name after the
- * prefix, if present, or the whole node name if no prefix exists)
- *
- * @param nodeHandle the id of the node.
- * @return String Local name of this node.
- */
- public String getLocalName(int nodeHandle);
-
- /**
- * Given a namespace handle, return the prefix that the namespace decl is
- * mapping.
- * Given a node handle, return the prefix used to map to the namespace.
- * (As defined in Namespaces, this is the portion of the name before any
- * colon character).
- *
- * <p> %REVIEW% Are you sure you want "" for no prefix? </p>
- *
- * @param nodeHandle the id of the node.
- * @return String prefix of this node's name, or "" if no explicit
- * namespace prefix was given.
- */
- public String getPrefix(int nodeHandle);
-
- /**
- * Given a node handle, return its DOM-style namespace URI
- * (As defined in Namespaces, this is the declared URI which this node's
- * prefix -- or default in lieu thereof -- was mapped to.)
- * @param nodeHandle the id of the node.
- * @return String URI value of this node's namespace, or null if no
- * namespace was resolved.
- */
- public String getNamespaceURI(int nodeHandle);
-
- /**
- * Given a node handle, return its node value. This is mostly
- * as defined by the DOM, but may ignore some conveniences.
- * <p>
- * @param nodeHandle The node id.
- * @return String Value of this node, or null if not
- * meaningful for this node type.
- */
- public String getNodeValue(int nodeHandle);
-
- /**
- * Given a node handle, return its DOM-style node type.
- *
- * <p>%REVIEW% Generally, returning short is false economy. Return int?</p>
- *
- * @param nodeHandle The node id.
- * @return int Node type, as per the DOM's Node._NODE constants.
- */
- public short getNodeType(int nodeHandle);
-
- /**
- * Get the depth level of this node in the tree (equals 1 for
- * a parentless node).
- *
- * @param nodeHandle The node id.
- * @return the number of ancestors, plus one
- * @xsl.usage internal
- */
- public short getLevel(int nodeHandle);
-
- // ============== Document query functions ==============
-
- /**
- * Tests whether DTM DOM implementation implements a specific feature and
- * that feature is supported by this node.
- * @param feature The name of the feature to test.
- * @param version This is the version number of the feature to test.
- * If the version is not
- * specified, supporting any version of the feature will cause the
- * method to return <code>true</code>.
- * @return Returns <code>true</code> if the specified feature is
- * supported on this node, <code>false</code> otherwise.
- */
- public boolean isSupported(String feature, String version);
-
- /**
- * Return the base URI of the document entity. If it is not known
- * (because the document was parsed from a socket connection or from
- * standard input, for example), the value of this property is unknown.
- *
- * @return the document base URI String object or null if unknown.
- */
- public String getDocumentBaseURI();
-
- /**
- * Set the base URI of the document entity.
- *
- * @param baseURI the document base URI String object or null if unknown.
- */
- public void setDocumentBaseURI(String baseURI);
-
- /**
- * Return the system identifier of the document entity. If
- * it is not known, the value of this property is null.
- *
- * @param nodeHandle The node id, which can be any valid node handle.
- * @return the system identifier String object or null if unknown.
- */
- public String getDocumentSystemIdentifier(int nodeHandle);
-
- /**
- * Return the name of the character encoding scheme
- * in which the document entity is expressed.
- *
- * @param nodeHandle The node id, which can be any valid node handle.
- * @return the document encoding String object.
- */
- public String getDocumentEncoding(int nodeHandle);
-
- /**
- * Return an indication of the standalone status of the document,
- * either "yes" or "no". This property is derived from the optional
- * standalone document declaration in the XML declaration at the
- * beginning of the document entity, and has no value if there is no
- * standalone document declaration.
- *
- * @param nodeHandle The node id, which can be any valid node handle.
- * @return the document standalone String object, either "yes", "no", or null.
- */
- public String getDocumentStandalone(int nodeHandle);
-
- /**
- * Return a string representing the XML version of the document. This
- * property is derived from the XML declaration optionally present at the
- * beginning of the document entity, and has no value if there is no XML
- * declaration.
- *
- * @param documentHandle the document handle
- * @return the document version String object
- */
- public String getDocumentVersion(int documentHandle);
-
- /**
- * Return an indication of
- * whether the processor has read the complete DTD. Its value is a
- * boolean. If it is false, then certain properties (indicated in their
- * descriptions below) may be unknown. If it is true, those properties
- * are never unknown.
- *
- * @return <code>true</code> if all declarations were processed;
- * <code>false</code> otherwise.
- */
- public boolean getDocumentAllDeclarationsProcessed();
-
- /**
- * A document type declaration information item has the following properties:
- *
- * 1. [system identifier] The system identifier of the external subset, if
- * it exists. Otherwise this property has no value.
- *
- * @return the system identifier String object, or null if there is none.
- */
- public String getDocumentTypeDeclarationSystemIdentifier();
-
- /**
- * Return the public identifier of the external subset,
- * normalized as described in 4.2.2 External Entities [XML]. If there is
- * no external subset or if it has no public identifier, this property
- * has no value.
- *
- * @return the public identifier String object, or null if there is none.
- */
- public String getDocumentTypeDeclarationPublicIdentifier();
-
- /**
- * Returns the <code>Element</code> whose <code>ID</code> is given by
- * <code>elementId</code>. If no such element exists, returns
- * <code>DTM.NULL</code>. Behavior is not defined if more than one element
- * has this <code>ID</code>. Attributes (including those
- * with the name "ID") are not of type ID unless so defined by DTD/Schema
- * information available to the DTM implementation.
- * Implementations that do not know whether attributes are of type ID or
- * not are expected to return <code>DTM.NULL</code>.
- *
- * <p>%REVIEW% Presumably IDs are still scoped to a single document,
- * and this operation searches only within a single document, right?
- * Wouldn't want collisions between DTMs in the same process.</p>
- *
- * @param elementId The unique <code>id</code> value for an element.
- * @return The handle of the matching element.
- */
- public int getElementById(String elementId);
-
- /**
- * The getUnparsedEntityURI function returns the URI of the unparsed
- * entity with the specified name in the same document as the context
- * node (see [3.3 Unparsed Entities]). It returns the empty string if
- * there is no such entity.
- * <p>
- * XML processors may choose to use the System Identifier (if one
- * is provided) to resolve the entity, rather than the URI in the
- * Public Identifier. The details are dependent on the processor, and
- * we would have to support some form of plug-in resolver to handle
- * this properly. Currently, we simply return the System Identifier if
- * present, and hope that it a usable URI or that our caller can
- * map it to one.
- * %REVIEW% Resolve Public Identifiers... or consider changing function name.
- * <p>
- * If we find a relative URI
- * reference, XML expects it to be resolved in terms of the base URI
- * of the document. The DOM doesn't do that for us, and it isn't
- * entirely clear whether that should be done here; currently that's
- * pushed up to a higher level of our application. (Note that DOM Level
- * 1 didn't store the document's base URI.)
- * %REVIEW% Consider resolving Relative URIs.
- * <p>
- * (The DOM's statement that "An XML processor may choose to
- * completely expand entities before the structure model is passed
- * to the DOM" refers only to parsed entities, not unparsed, and hence
- * doesn't affect this function.)
- *
- * @param name A string containing the Entity Name of the unparsed
- * entity.
- *
- * @return String containing the URI of the Unparsed Entity, or an
- * empty string if no such entity exists.
- */
- public String getUnparsedEntityURI(String name);
-
- // ============== Boolean methods ================
-
- /**
- * Return true if the xsl:strip-space or xsl:preserve-space was processed
- * during construction of the document contained in this DTM.
- *
- * NEEDSDOC ($objectName$) @return
- */
- public boolean supportsPreStripping();
-
- /**
- * Figure out whether nodeHandle2 should be considered as being later
- * in the document than nodeHandle1, in Document Order as defined
- * by the XPath model. This may not agree with the ordering defined
- * by other XML applications.
- * <p>
- * There are some cases where ordering isn't defined, and neither are
- * the results of this function -- though we'll generally return true.
- * <p>
- * %REVIEW% Make sure this does the right thing with attribute nodes!!!
- * <p>
- * %REVIEW% Consider renaming for clarity. Perhaps isDocumentOrder(a,b)?
- *
- * @param firstNodeHandle DOM Node to perform position comparison on.
- * @param secondNodeHandle DOM Node to perform position comparison on.
- *
- * @return false if secondNode comes before firstNode, otherwise return true.
- * You can think of this as
- * <code>(firstNode.documentOrderPosition &lt;= secondNode.documentOrderPosition)</code>.
- */
- public boolean isNodeAfter(int firstNodeHandle, int secondNodeHandle);
-
- /**
- * 2. [element content whitespace] A boolean indicating whether a
- * text node represents white space appearing within element content
- * (see [XML], 2.10 "White Space Handling"). Note that validating
- * XML processors are required by XML 1.0 to provide this
- * information... but that DOM Level 2 did not support it, since it
- * depends on knowledge of the DTD which DOM2 could not guarantee
- * would be available.
- * <p>
- * If there is no declaration for the containing element, an XML
- * processor must assume that the whitespace could be meaningful and
- * return false. If no declaration has been read, but the [all
- * declarations processed] property of the document information item
- * is false (so there may be an unread declaration), then the value
- * of this property is indeterminate for white space characters and
- * should probably be reported as false. It is always false for text
- * nodes that contain anything other than (or in addition to) white
- * space.
- * <p>
- * Note too that it always returns false for non-Text nodes.
- * <p>
- * %REVIEW% Joe wants to rename this isWhitespaceInElementContent() for clarity
- *
- * @param nodeHandle the node ID.
- * @return <code>true</code> if the node definitely represents whitespace in
- * element content; <code>false</code> otherwise.
- */
- public boolean isCharacterElementContentWhitespace(int nodeHandle);
-
- /**
- * 10. [all declarations processed] This property is not strictly speaking
- * part of the infoset of the document. Rather it is an indication of
- * whether the processor has read the complete DTD. Its value is a
- * boolean. If it is false, then certain properties (indicated in their
- * descriptions below) may be unknown. If it is true, those properties
- * are never unknown.
- *
- * @param documentHandle A node handle that must identify a document.
- * @return <code>true</code> if all declarations were processed;
- * <code>false</code> otherwise.
- */
- public boolean isDocumentAllDeclarationsProcessed(int documentHandle);
-
- /**
- * 5. [specified] A flag indicating whether this attribute was actually
- * specified in the start-tag of its element, or was defaulted from the
- * DTD (or schema).
- *
- * @param attributeHandle The attribute handle
- * @return <code>true</code> if the attribute was specified;
- * <code>false</code> if it was defaulted or the handle doesn't
- * refer to an attribute node.
- */
- public boolean isAttributeSpecified(int attributeHandle);
-
- // ========== Direct SAX Dispatch, for optimization purposes ========
-
- /**
- * Directly call the
- * characters method on the passed ContentHandler for the
- * string-value of the given node (see http://www.w3.org/TR/xpath#data-model
- * for the definition of a node's string-value). Multiple calls to the
- * ContentHandler's characters methods may well occur for a single call to
- * this method.
- *
- * @param nodeHandle The node ID.
- * @param ch A non-null reference to a ContentHandler.
- * @param normalize true if the content should be normalized according to
- * the rules for the XPath
- * <a href="http://www.w3.org/TR/xpath#function-normalize-space">normalize-space</a>
- * function.
- *
- * @throws org.xml.sax.SAXException
- */
- public void dispatchCharactersEvents(
- int nodeHandle, org.xml.sax.ContentHandler ch, boolean normalize)
- throws org.xml.sax.SAXException;
-
- /**
- * Directly create SAX parser events representing the XML content of
- * a DTM subtree. This is a "serialize" operation.
- *
- * @param nodeHandle The node ID.
- * @param ch A non-null reference to a ContentHandler.
- *
- * @throws org.xml.sax.SAXException
- */
- public void dispatchToEvents(int nodeHandle, org.xml.sax.ContentHandler ch)
- throws org.xml.sax.SAXException;
-
- /**
- * Return an DOM node for the given node.
- *
- * @param nodeHandle The node ID.
- *
- * @return A node representation of the DTM node.
- */
- public org.w3c.dom.Node getNode(int nodeHandle);
-
- // ==== Construction methods (may not be supported by some implementations!) =====
- // %REVIEW% What response occurs if not supported?
-
- /**
- * @return true iff we're building this model incrementally (eg
- * we're partnered with a CoroutineParser) and thus require that the
- * transformation and the parse run simultaneously. Guidance to the
- * DTMManager.
- */
- public boolean needsTwoThreads();
-
- // %REVIEW% Do these appends make any sense, should we support a
- // wider set of methods (like the "append" methods in the
- // current DTMDocumentImpl draft), or should we just support SAX
- // listener interfaces? Should it be a separate interface to
- // make that distinction explicit?
-
- /**
- * Return this DTM's content handler, if it has one.
- *
- * @return null if this model doesn't respond to SAX events.
- */
- public org.xml.sax.ContentHandler getContentHandler();
-
- /**
- * Return this DTM's lexical handler, if it has one.
- *
- * %REVIEW% Should this return null if constrution already done/begun?
- *
- * @return null if this model doesn't respond to lexical SAX events.
- */
- public org.xml.sax.ext.LexicalHandler getLexicalHandler();
-
- /**
- * Return this DTM's EntityResolver, if it has one.
- *
- * @return null if this model doesn't respond to SAX entity ref events.
- */
- public org.xml.sax.EntityResolver getEntityResolver();
-
- /**
- * Return this DTM's DTDHandler, if it has one.
- *
- * @return null if this model doesn't respond to SAX dtd events.
- */
- public org.xml.sax.DTDHandler getDTDHandler();
-
- /**
- * Return this DTM's ErrorHandler, if it has one.
- *
- * @return null if this model doesn't respond to SAX error events.
- */
- public org.xml.sax.ErrorHandler getErrorHandler();
-
- /**
- * Return this DTM's DeclHandler, if it has one.
- *
- * @return null if this model doesn't respond to SAX Decl events.
- */
- public org.xml.sax.ext.DeclHandler getDeclHandler();
-
- /**
- * Append a child to "the end of the document". Please note that
- * the node is always cloned in a base DTM, since our basic behavior
- * is immutable so nodes can't be removed from their previous
- * location.
- *
- * <p> %REVIEW% DTM maintains an insertion cursor which
- * performs a depth-first tree walk as nodes come in, and this operation
- * is really equivalent to:
- * insertionCursor.appendChild(document.importNode(newChild)))
- * where the insert point is the last element that was appended (or
- * the last one popped back to by an end-element operation).</p>
- *
- * @param newChild Must be a valid new node handle.
- * @param clone true if the child should be cloned into the document.
- * @param cloneDepth if the clone argument is true, specifies that the
- * clone should include all it's children.
- */
- public void appendChild(int newChild, boolean clone, boolean cloneDepth);
-
- /**
- * Append a text node child that will be constructed from a string,
- * to the end of the document. Behavior is otherwise like appendChild().
- *
- * @param str Non-null reference to a string.
- */
- public void appendTextChild(String str);
-
- /**
- * Get the location of a node in the source document.
- *
- * @param node an <code>int</code> value
- * @return a <code>SourceLocator</code> value or null if no location
- * is available
- */
- public SourceLocator getSourceLocatorFor(int node);
-
- /**
- * As the DTM is registered with the DTMManager, this method
- * will be called. This will give the DTM implementation a
- * chance to initialize any subsystems that are required to
- * build the DTM
- */
- public void documentRegistration();
-
- /**
- * As documents are released from the DTMManager, the DTM implementation
- * will be notified of the event. This will allow the DTM implementation
- * to shutdown any subsystem activity that may of been assoiated with
- * the active DTM Implementation.
- */
-
- public void documentRelease();
-
- /**
- * Migrate a DTM built with an old DTMManager to a new DTMManager.
- * After the migration, the new DTMManager will treat the DTM as
- * one that is built by itself.
- * This is used to support DTM sharing between multiple transformations.
- * @param manager the DTMManager
- */
- public void migrateTo(DTMManager manager);
-}
diff --git a/src/com/sun/org/apache/xml/internal/dtm/DTMAxisIterator.java b/src/com/sun/org/apache/xml/internal/dtm/DTMAxisIterator.java
deleted file mode 100644
index f2934ae..0000000
--- a/src/com/sun/org/apache/xml/internal/dtm/DTMAxisIterator.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DTMAxisIterator.java,v 1.2.4.1 2005/09/15 08:14:52 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.dtm;
-
-/**
- * This class iterates over a single XPath Axis, and returns node handles.
- */
-public interface DTMAxisIterator extends Cloneable
-{
-
- /** Specifies the end of the iteration, and is the same as DTM.NULL. */
- public static final int END = DTM.NULL;
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next();
-
-
- /**
- * Resets the iterator to the last start node.
- *
- * @return A DTMAxisIterator, which may or may not be the same as this
- * iterator.
- */
- public DTMAxisIterator reset();
-
- /**
- * @return the number of nodes in this iterator. This may be an expensive
- * operation when called the first time.
- */
- public int getLast();
-
- /**
- * @return The position of the current node in the set, as defined by XPath.
- */
- public int getPosition();
-
- /**
- * Remembers the current node for the next call to gotoMark().
- */
- public void setMark();
-
- /**
- * Restores the current node remembered by setMark().
- */
- public void gotoMark();
-
- /**
- * Set start to END should 'close' the iterator,
- * i.e. subsequent call to next() should return END.
- *
- * @param node Sets the root of the iteration.
- *
- * @return A DTMAxisIterator set to the start of the iteration.
- */
- public DTMAxisIterator setStartNode(int node);
-
- /**
- * Get start to END should 'close' the iterator,
- * i.e. subsequent call to next() should return END.
- *
- * @return The root node of the iteration.
- */
- public int getStartNode();
-
- /**
- * @return true if this iterator has a reversed axis, else false.
- */
- public boolean isReverse();
-
- /**
- * @return a deep copy of this iterator. The clone should not be reset
- * from its current position.
- */
- public DTMAxisIterator cloneIterator();
-
- /**
- * Set if restartable.
- */
- public void setRestartable(boolean isRestartable);
-
- /**
- * Return the node at the given position.
- *
- * @param position The position
- * @return The node at the given position.
- */
- public int getNodeByPosition(int position);
-}
diff --git a/src/com/sun/org/apache/xml/internal/dtm/DTMAxisTraverser.java b/src/com/sun/org/apache/xml/internal/dtm/DTMAxisTraverser.java
deleted file mode 100644
index e4ba086..0000000
--- a/src/com/sun/org/apache/xml/internal/dtm/DTMAxisTraverser.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DTMAxisTraverser.java,v 1.2.4.1 2005/09/15 08:14:52 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.dtm;
-
-/**
- * A class that implements traverses DTMAxisTraverser interface can traverse
- * a set of nodes, usually as defined by an XPath axis. It is different from
- * an iterator, because it does not need to hold state, and, in fact, must not
- * hold any iteration-based state. It is meant to be implemented as an inner
- * class of a DTM, and returned by the getAxisTraverser(final int axis)
- * function.
- *
- * <p>A DTMAxisTraverser can probably not traverse a reverse axis in
- * document order.</p>
- *
- * <p>Typical usage:</p>
- * <pre><code>
- * for(int nodeHandle=myTraverser.first(myContext);
- * nodeHandle!=DTM.NULL;
- * nodeHandle=myTraverser.next(myContext,nodeHandle))
- * { ... processing for node indicated by nodeHandle goes here ... }
- * </code></pre>
- *
- * @author Scott Boag
- */
-public abstract class DTMAxisTraverser
-{
-
- /**
- * By the nature of the stateless traversal, the context node can not be
- * returned or the iteration will go into an infinate loop. So to traverse
- * an axis, the first function must be used to get the first node.
- *
- * <p>This method needs to be overloaded only by those axis that process
- * the self node. <\p>
- *
- * @param context The context node of this traversal. This is the point
- * that the traversal starts from.
- * @return the first node in the traversal.
- */
- public int first(int context)
- {
- return next(context, context);
- }
-
- /**
- * By the nature of the stateless traversal, the context node can not be
- * returned or the iteration will go into an infinate loop. So to traverse
- * an axis, the first function must be used to get the first node.
- *
- * <p>This method needs to be overloaded only by those axis that process
- * the self node. <\p>
- *
- * @param context The context node of this traversal. This is the point
- * of origin for the traversal -- its "root node" or starting point.
- * @param extendedTypeID The extended type ID that must match.
- *
- * @return the first node in the traversal.
- */
- public int first(int context, int extendedTypeID)
- {
- return next(context, context, extendedTypeID);
- }
-
- /**
- * Traverse to the next node after the current node.
- *
- * @param context The context node of this traversal. This is the point
- * of origin for the traversal -- its "root node" or starting point.
- * @param current The current node of the traversal. This is the last known
- * location in the traversal, typically the node-handle returned by the
- * previous traversal step. For the first traversal step, context
- * should be set equal to current. Note that in order to test whether
- * context is in the set, you must use the first() method instead.
- *
- * @return the next node in the iteration, or DTM.NULL.
- * @see #first(int)
- */
- public abstract int next(int context, int current);
-
- /**
- * Traverse to the next node after the current node that is matched
- * by the extended type ID.
- *
- * @param context The context node of this traversal. This is the point
- * of origin for the traversal -- its "root node" or starting point.
- * @param current The current node of the traversal. This is the last known
- * location in the traversal, typically the node-handle returned by the
- * previous traversal step. For the first traversal step, context
- * should be set equal to current. Note that in order to test whether
- * context is in the set, you must use the first() method instead.
- * @param extendedTypeID The extended type ID that must match.
- *
- * @return the next node in the iteration, or DTM.NULL.
- * @see #first(int,int)
- */
- public abstract int next(int context, int current, int extendedTypeID);
-}
diff --git a/src/com/sun/org/apache/xml/internal/dtm/DTMConfigurationException.java b/src/com/sun/org/apache/xml/internal/dtm/DTMConfigurationException.java
deleted file mode 100644
index c5de8bf..0000000
--- a/src/com/sun/org/apache/xml/internal/dtm/DTMConfigurationException.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DTMConfigurationException.java,v 1.2.4.1 2005/09/15 08:14:52 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.dtm;
-
-import javax.xml.transform.SourceLocator;
-
-/**
- * Indicates a serious configuration error.
- */
-public class DTMConfigurationException extends DTMException {
- static final long serialVersionUID = -4607874078818418046L;
-
- /**
- * Create a new <code>DTMConfigurationException</code> with no
- * detail mesage.
- */
- public DTMConfigurationException() {
- super("Configuration Error");
- }
-
- /**
- * Create a new <code>DTMConfigurationException</code> with
- * the <code>String </code> specified as an error message.
- *
- * @param msg The error message for the exception.
- */
- public DTMConfigurationException(String msg) {
- super(msg);
- }
-
- /**
- * Create a new <code>DTMConfigurationException</code> with a
- * given <code>Exception</code> base cause of the error.
- *
- * @param e The exception to be encapsulated in a
- * DTMConfigurationException.
- */
- public DTMConfigurationException(Throwable e) {
- super(e);
- }
-
- /**
- * Create a new <code>DTMConfigurationException</code> with the
- * given <code>Exception</code> base cause and detail message.
- *
- * @param msg The detail message.
- * @param e The exception to be wrapped in a DTMConfigurationException
- */
- public DTMConfigurationException(String msg, Throwable e) {
- super(msg, e);
- }
-
- /**
- * Create a new DTMConfigurationException from a message and a Locator.
- *
- * <p>This constructor is especially useful when an application is
- * creating its own exception from within a DocumentHandler
- * callback.</p>
- *
- * @param message The error or warning message.
- * @param locator The locator object for the error or warning.
- */
- public DTMConfigurationException(String message,
- SourceLocator locator) {
- super(message, locator);
- }
-
- /**
- * Wrap an existing exception in a DTMConfigurationException.
- *
- * @param message The error or warning message, or null to
- * use the message from the embedded exception.
- * @param locator The locator object for the error or warning.
- * @param e Any exception.
- */
- public DTMConfigurationException(String message,
- SourceLocator locator,
- Throwable e) {
- super(message, locator, e);
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/dtm/DTMDOMException.java b/src/com/sun/org/apache/xml/internal/dtm/DTMDOMException.java
deleted file mode 100644
index 616fa0b..0000000
--- a/src/com/sun/org/apache/xml/internal/dtm/DTMDOMException.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DTMDOMException.java,v 1.2.4.1 2005/09/15 08:14:52 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.dtm;
-
-/**
- * Simple implementation of DOMException.
- *
- * %REVIEW% Several classes were implementing this internally;
- * it makes more sense to have one shared version.
- * @xsl.usage internal
- */
-public class DTMDOMException extends org.w3c.dom.DOMException
-{
- static final long serialVersionUID = 1895654266613192414L;
- /**
- * Constructs a DOM/DTM exception.
- *
- * @param code
- * @param message
- */
- public DTMDOMException(short code, String message)
- {
- super(code, message);
- }
-
- /**
- * Constructor DTMDOMException
- *
- *
- * @param code
- */
- public DTMDOMException(short code)
- {
- super(code, "");
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/dtm/DTMException.java b/src/com/sun/org/apache/xml/internal/dtm/DTMException.java
deleted file mode 100644
index b5677fc..0000000
--- a/src/com/sun/org/apache/xml/internal/dtm/DTMException.java
+++ /dev/null
@@ -1,385 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DTMException.java,v 1.3 2005/09/28 13:48:50 pvedula Exp $
- */
-package com.sun.org.apache.xml.internal.dtm;
-
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-import javax.xml.transform.SourceLocator;
-
-import com.sun.org.apache.xml.internal.res.XMLErrorResources;
-import com.sun.org.apache.xml.internal.res.XMLMessages;
-
-
-/**
- * This class specifies an exceptional condition that occured
- * in the DTM module.
- */
-public class DTMException extends RuntimeException {
- static final long serialVersionUID = -775576419181334734L;
-
- /** Field locator specifies where the error occured.
- * @serial */
- SourceLocator locator;
-
- /**
- * Method getLocator retrieves an instance of a SourceLocator
- * object that specifies where an error occured.
- *
- * @return A SourceLocator object, or null if none was specified.
- */
- public SourceLocator getLocator() {
- return locator;
- }
-
- /**
- * Method setLocator sets an instance of a SourceLocator
- * object that specifies where an error occured.
- *
- * @param location A SourceLocator object, or null to clear the location.
- */
- public void setLocator(SourceLocator location) {
- locator = location;
- }
-
- /** Field containedException specifies a wrapped exception. May be null.
- * @serial */
- Throwable containedException;
-
- /**
- * This method retrieves an exception that this exception wraps.
- *
- * @return An Throwable object, or null.
- * @see #getCause
- */
- public Throwable getException() {
- return containedException;
- }
-
- /**
- * Returns the cause of this throwable or <code>null</code> if the
- * cause is nonexistent or unknown. (The cause is the throwable that
- * caused this throwable to get thrown.)
- */
- public Throwable getCause() {
-
- return ((containedException == this)
- ? null
- : containedException);
- }
-
- /**
- * Initializes the <i>cause</i> of this throwable to the specified value.
- * (The cause is the throwable that caused this throwable to get thrown.)
- *
- * <p>This method can be called at most once. It is generally called from
- * within the constructor, or immediately after creating the
- * throwable. If this throwable was created
- * with {@link #DTMException(Throwable)} or
- * {@link #DTMException(String,Throwable)}, this method cannot be called
- * even once.
- *
- * @param cause the cause (which is saved for later retrieval by the
- * {@link #getCause()} method). (A <tt>null</tt> value is
- * permitted, and indicates that the cause is nonexistent or
- * unknown.)
- * @return a reference to this <code>Throwable</code> instance.
- * @throws IllegalArgumentException if <code>cause</code> is this
- * throwable. (A throwable cannot
- * be its own cause.)
- * @throws IllegalStateException if this throwable was
- * created with {@link #DTMException(Throwable)} or
- * {@link #DTMException(String,Throwable)}, or this method has already
- * been called on this throwable.
- */
- public synchronized Throwable initCause(Throwable cause) {
-
- if ((this.containedException == null) && (cause != null)) {
- throw new IllegalStateException(XMLMessages.createXMLMessage(XMLErrorResources.ER_CANNOT_OVERWRITE_CAUSE, null)); //"Can't overwrite cause");
- }
-
- if (cause == this) {
- throw new IllegalArgumentException(
- XMLMessages.createXMLMessage(XMLErrorResources.ER_SELF_CAUSATION_NOT_PERMITTED, null)); //"Self-causation not permitted");
- }
-
- this.containedException = cause;
-
- return this;
- }
-
- /**
- * Create a new DTMException.
- *
- * @param message The error or warning message.
- */
- public DTMException(String message) {
-
- super(message);
-
- this.containedException = null;
- this.locator = null;
- }
-
- /**
- * Create a new DTMException wrapping an existing exception.
- *
- * @param e The exception to be wrapped.
- */
- public DTMException(Throwable e) {
-
- super(e.getMessage());
-
- this.containedException = e;
- this.locator = null;
- }
-
- /**
- * Wrap an existing exception in a DTMException.
- *
- * <p>This is used for throwing processor exceptions before
- * the processing has started.</p>
- *
- * @param message The error or warning message, or null to
- * use the message from the embedded exception.
- * @param e Any exception
- */
- public DTMException(String message, Throwable e) {
-
- super(((message == null) || (message.length() == 0))
- ? e.getMessage()
- : message);
-
- this.containedException = e;
- this.locator = null;
- }
-
- /**
- * Create a new DTMException from a message and a Locator.
- *
- * <p>This constructor is especially useful when an application is
- * creating its own exception from within a DocumentHandler
- * callback.</p>
- *
- * @param message The error or warning message.
- * @param locator The locator object for the error or warning.
- */
- public DTMException(String message, SourceLocator locator) {
-
- super(message);
-
- this.containedException = null;
- this.locator = locator;
- }
-
- /**
- * Wrap an existing exception in a DTMException.
- *
- * @param message The error or warning message, or null to
- * use the message from the embedded exception.
- * @param locator The locator object for the error or warning.
- * @param e Any exception
- */
- public DTMException(String message, SourceLocator locator,
- Throwable e) {
-
- super(message);
-
- this.containedException = e;
- this.locator = locator;
- }
-
- /**
- * Get the error message with location information
- * appended.
- */
- public String getMessageAndLocation() {
-
- StringBuffer sbuffer = new StringBuffer();
- String message = super.getMessage();
-
- if (null != message) {
- sbuffer.append(message);
- }
-
- if (null != locator) {
- String systemID = locator.getSystemId();
- int line = locator.getLineNumber();
- int column = locator.getColumnNumber();
-
- if (null != systemID) {
- sbuffer.append("; SystemID: ");
- sbuffer.append(systemID);
- }
-
- if (0 != line) {
- sbuffer.append("; Line#: ");
- sbuffer.append(line);
- }
-
- if (0 != column) {
- sbuffer.append("; Column#: ");
- sbuffer.append(column);
- }
- }
-
- return sbuffer.toString();
- }
-
- /**
- * Get the location information as a string.
- *
- * @return A string with location info, or null
- * if there is no location information.
- */
- public String getLocationAsString() {
-
- if (null != locator) {
- StringBuffer sbuffer = new StringBuffer();
- String systemID = locator.getSystemId();
- int line = locator.getLineNumber();
- int column = locator.getColumnNumber();
-
- if (null != systemID) {
- sbuffer.append("; SystemID: ");
- sbuffer.append(systemID);
- }
-
- if (0 != line) {
- sbuffer.append("; Line#: ");
- sbuffer.append(line);
- }
-
- if (0 != column) {
- sbuffer.append("; Column#: ");
- sbuffer.append(column);
- }
-
- return sbuffer.toString();
- } else {
- return null;
- }
- }
-
- /**
- * Print the the trace of methods from where the error
- * originated. This will trace all nested exception
- * objects, as well as this object.
- */
- public void printStackTrace() {
- printStackTrace(new java.io.PrintWriter(System.err, true));
- }
-
- /**
- * Print the the trace of methods from where the error
- * originated. This will trace all nested exception
- * objects, as well as this object.
- * @param s The stream where the dump will be sent to.
- */
- public void printStackTrace(java.io.PrintStream s) {
- printStackTrace(new java.io.PrintWriter(s));
- }
-
- /**
- * Print the the trace of methods from where the error
- * originated. This will trace all nested exception
- * objects, as well as this object.
- * @param s The writer where the dump will be sent to.
- */
- public void printStackTrace(java.io.PrintWriter s) {
-
- if (s == null) {
- s = new java.io.PrintWriter(System.err, true);
- }
-
- try {
- String locInfo = getLocationAsString();
-
- if (null != locInfo) {
- s.println(locInfo);
- }
-
- super.printStackTrace(s);
- } catch (Throwable e) {}
-
- boolean isJdk14OrHigher = false;
- try {
- Throwable.class.getMethod("getCause", (Class[]) null);
- isJdk14OrHigher = true;
- } catch (NoSuchMethodException nsme) {
- // do nothing
- }
-
- // The printStackTrace method of the Throwable class in jdk 1.4
- // and higher will include the cause when printing the backtrace.
- // The following code is only required when using jdk 1.3 or lower
- if (!isJdk14OrHigher) {
- Throwable exception = getException();
-
- for (int i = 0; (i < 10) && (null != exception); i++) {
- s.println("---------");
-
- try {
- if (exception instanceof DTMException) {
- String locInfo =
- ((DTMException) exception)
- .getLocationAsString();
-
- if (null != locInfo) {
- s.println(locInfo);
- }
- }
-
- exception.printStackTrace(s);
- } catch (Throwable e) {
- s.println("Could not print stack trace...");
- }
-
- try {
- Method meth =
- ((Object) exception).getClass().getMethod("getException",
- (Class[]) null);
-
- if (null != meth) {
- Throwable prev = exception;
-
- exception = (Throwable) meth.invoke(exception, (Object[]) null);
-
- if (prev == exception) {
- break;
- }
- } else {
- exception = null;
- }
- } catch (InvocationTargetException ite) {
- exception = null;
- } catch (IllegalAccessException iae) {
- exception = null;
- } catch (NoSuchMethodException nsme) {
- exception = null;
- }
- }
- }
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/dtm/DTMFilter.java b/src/com/sun/org/apache/xml/internal/dtm/DTMFilter.java
deleted file mode 100644
index 331e753..0000000
--- a/src/com/sun/org/apache/xml/internal/dtm/DTMFilter.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DTMFilter.java,v 1.2.4.1 2005/09/15 08:14:53 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.dtm;
-
-/**
- * Simple filter for doing node tests. Note the semantics of this are
- * somewhat different that the DOM's NodeFilter.
- */
-public interface DTMFilter
-{
-
- // Constants for whatToShow. These are used to set the node type that will
- // be traversed. These values may be ORed together before being passed to
- // the DTMIterator.
-
- /**
- * Show all <code>Nodes</code>.
- */
- public static final int SHOW_ALL = 0xFFFFFFFF;
-
- /**
- * Show <code>Element</code> nodes.
- */
- public static final int SHOW_ELEMENT = 0x00000001;
-
- /**
- * Show <code>Attr</code> nodes. This is meaningful only when creating an
- * iterator or tree-walker with an attribute node as its
- * <code>root</code>; in this case, it means that the attribute node
- * will appear in the first position of the iteration or traversal.
- * Since attributes are never children of other nodes, they do not
- * appear when traversing over the main document tree.
- */
- public static final int SHOW_ATTRIBUTE = 0x00000002;
-
- /**
- * Show <code>Text</code> nodes.
- */
- public static final int SHOW_TEXT = 0x00000004;
-
- /**
- * Show <code>CDATASection</code> nodes.
- */
- public static final int SHOW_CDATA_SECTION = 0x00000008;
-
- /**
- * Show <code>EntityReference</code> nodes. Note that if Entity References
- * have been fully expanded while the tree was being constructed, these
- * nodes will not appear and this mask has no effect.
- */
- public static final int SHOW_ENTITY_REFERENCE = 0x00000010;
-
- /**
- * Show <code>Entity</code> nodes. This is meaningful only when creating
- * an iterator or tree-walker with an<code> Entity</code> node as its
- * <code>root</code>; in this case, it means that the <code>Entity</code>
- * node will appear in the first position of the traversal. Since
- * entities are not part of the document tree, they do not appear when
- * traversing over the main document tree.
- */
- public static final int SHOW_ENTITY = 0x00000020;
-
- /**
- * Show <code>ProcessingInstruction</code> nodes.
- */
- public static final int SHOW_PROCESSING_INSTRUCTION = 0x00000040;
-
- /**
- * Show <code>Comment</code> nodes.
- */
- public static final int SHOW_COMMENT = 0x00000080;
-
- /**
- * Show <code>Document</code> nodes. (Of course, as with Attributes
- * and such, this is meaningful only when the iteration root is the
- * Document itself, since Document has no parent.)
- */
- public static final int SHOW_DOCUMENT = 0x00000100;
-
- /**
- * Show <code>DocumentType</code> nodes.
- */
- public static final int SHOW_DOCUMENT_TYPE = 0x00000200;
-
- /**
- * Show <code>DocumentFragment</code> nodes. (Of course, as with
- * Attributes and such, this is meaningful only when the iteration
- * root is the Document itself, since DocumentFragment has no parent.)
- */
- public static final int SHOW_DOCUMENT_FRAGMENT = 0x00000400;
-
- /**
- * Show <code>Notation</code> nodes. This is meaningful only when creating
- * an iterator or tree-walker with a <code>Notation</code> node as its
- * <code>root</code>; in this case, it means that the
- * <code>Notation</code> node will appear in the first position of the
- * traversal. Since notations are not part of the document tree, they do
- * not appear when traversing over the main document tree.
- */
- public static final int SHOW_NOTATION = 0x00000800;
-
- /**
-
- * This bit instructs the iterator to show namespace nodes, which
- * are modeled by DTM but not by the DOM. Make sure this does not
- * conflict with {@link org.w3c.dom.traversal.NodeFilter}.
- * <p>
- * %REVIEW% Might be safer to start from higher bits and work down,
- * to leave room for the DOM to expand its set of constants... Or,
- * possibly, to create a DTM-specific field for these additional bits.
- */
- public static final int SHOW_NAMESPACE = 0x00001000;
-
- /**
- * Special bit for filters implementing match patterns starting with
- * a function. Make sure this does not conflict with
- * {@link org.w3c.dom.traversal.NodeFilter}.
- * <p>
- * %REVIEW% Might be safer to start from higher bits and work down,
- * to leave room for the DOM to expand its set of constants... Or,
- * possibly, to create a DTM-specific field for these additional bits.
- */
- public static final int SHOW_BYFUNCTION = 0x00010000;
-
- /**
- * Test whether a specified node is visible in the logical view of a
- * <code>DTMIterator</code>. Normally, this function
- * will be called by the implementation of <code>DTMIterator</code>;
- * it is not normally called directly from
- * user code.
- *
- * @param nodeHandle int Handle of the node.
- * @param whatToShow one of SHOW_XXX values.
- * @return one of FILTER_ACCEPT, FILTER_REJECT, or FILTER_SKIP.
- */
- public short acceptNode(int nodeHandle, int whatToShow);
-
- /**
- * Test whether a specified node is visible in the logical view of a
- * <code>DTMIterator</code>. Normally, this function
- * will be called by the implementation of <code>DTMIterator</code>;
- * it is not normally called directly from
- * user code.
- * <p>
- * TODO: Should this be setNameMatch(expandedName) followed by accept()?
- * Or will we really be testing a different name at every invocation?
- *
- * <p>%REVIEW% Under what circumstances will this be used? The cases
- * I've considered are just as easy and just about as efficient if
- * the name test is performed in the DTMIterator... -- Joe</p>
- *
- * <p>%REVIEW% Should that 0xFFFF have a mnemonic assigned to it?
- * Also: This representation is assuming the expanded name is indeed
- * split into high/low 16-bit halfwords. If we ever change the
- * balance between namespace and localname bits (eg because we
- * decide there are many more localnames than namespaces, which is
- * fairly likely), this is going to break. It might be safer to
- * encapsulate the details with a makeExpandedName method and make
- * that responsible for setting up the wildcard version as well.</p>
- *
- * @param nodeHandle int Handle of the node.
- * @param whatToShow one of SHOW_XXX values.
- * @param expandedName a value defining the exanded name as defined in
- * the DTM interface. Wild cards will be defined
- * by 0xFFFF in the namespace and/or localname
- * portion of the expandedName.
- * @return one of FILTER_ACCEPT, FILTER_REJECT, or FILTER_SKIP. */
- public short acceptNode(int nodeHandle, int whatToShow, int expandedName);
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/dtm/DTMIterator.java b/src/com/sun/org/apache/xml/internal/dtm/DTMIterator.java
deleted file mode 100644
index 64d01be..0000000
--- a/src/com/sun/org/apache/xml/internal/dtm/DTMIterator.java
+++ /dev/null
@@ -1,346 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DTMIterator.java,v 1.2.4.1 2005/09/15 08:14:54 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.dtm;
-
-/**
-
- * <code>DTMIterators</code> are used to step through a (possibly
- * filtered) set of nodes. Their API is modeled largely after the DOM
- * NodeIterator.
- *
- * <p>A DTMIterator is a somewhat unusual type of iterator, in that it
- * can serve both single node iteration and random access.</p>
- *
- * <p>The DTMIterator's traversal semantics, i.e. how it walks the tree,
- * are specified when it is created, possibly and probably by an XPath
- * <a href="http://www.w3.org/TR/xpath#NT-LocationPath>LocationPath</a> or
- * a <a href="http://www.w3.org/TR/xpath#NT-UnionExpr">UnionExpr</a>.</p>
- *
- * <p>A DTMIterator is meant to be created once as a master static object, and
- * then cloned many times for runtime use. Or the master object itself may
- * be used for simpler use cases.</p>
- *
- * <p>At this time, we do not expect DTMIterator to emulate
- * NodeIterator's "maintain relative position" semantics under
- * document mutation. It's likely to respond more like the
- * TreeWalker's "current node" semantics. However, since the base DTM
- * is immutable, this issue currently makes no practical
- * difference.</p>
- *
- * <p>State: In progress!!</p> */
-public interface DTMIterator
-{
-
- // Constants returned by acceptNode, borrowed from the DOM Traversal chapter
- // %REVIEW% Should we explicitly initialize them from, eg,
- // org.w3c.dom.traversal.NodeFilter.FILTER_ACCEPT?
-
- /**
- * Accept the node.
- */
- public static final short FILTER_ACCEPT = 1;
-
- /**
- * Reject the node. Same behavior as FILTER_SKIP. (In the DOM these
- * differ when applied to a TreeWalker but have the same result when
- * applied to a NodeIterator).
- */
- public static final short FILTER_REJECT = 2;
-
- /**
- * Skip this single node.
- */
- public static final short FILTER_SKIP = 3;
-
- /**
- * Get an instance of a DTM that "owns" a node handle. Since a node
- * iterator may be passed without a DTMManager, this allows the
- * caller to easily get the DTM using just the iterator.
- *
- * @param nodeHandle the nodeHandle.
- *
- * @return a non-null DTM reference.
- */
- public DTM getDTM(int nodeHandle);
-
- /**
- * Get an instance of the DTMManager. Since a node
- * iterator may be passed without a DTMManager, this allows the
- * caller to easily get the DTMManager using just the iterator.
- *
- * @return a non-null DTMManager reference.
- */
- public DTMManager getDTMManager();
-
- /**
- * The root node of the <code>DTMIterator</code>, as specified when it
- * was created. Note the root node is not the root node of the
- * document tree, but the context node from where the iteration
- * begins and ends.
- *
- * @return nodeHandle int Handle of the context node.
- */
- public int getRoot();
-
- /**
- * Reset the root node of the <code>DTMIterator</code>, overriding
- * the value specified when it was created. Note the root node is
- * not the root node of the document tree, but the context node from
- * where the iteration begins.
- *
- * @param nodeHandle int Handle of the context node.
- * @param environment The environment object.
- * The environment in which this iterator operates, which should provide:
- * <ul>
- * <li>a node (the context node... same value as "root" defined below) </li>
- * <li>a pair of non-zero positive integers (the context position and the context size) </li>
- * <li>a set of variable bindings </li>
- * <li>a function library </li>
- * <li>the set of namespace declarations in scope for the expression.</li>
- * <ul>
- *
- * <p>At this time the exact implementation of this environment is application
- * dependent. Probably a proper interface will be created fairly soon.</p>
- *
- */
- public void setRoot(int nodeHandle, Object environment);
-
- /**
- * Reset the iterator to the start. After resetting, the next node returned
- * will be the root node -- or, if that's filtered out, the first node
- * within the root's subtree which is _not_ skipped by the filters.
- */
- public void reset();
-
- /**
- * This attribute determines which node types are presented via the
- * iterator. The available set of constants is defined above.
- * Nodes not accepted by
- * <code>whatToShow</code> will be skipped, but their children may still
- * be considered.
- *
- * @return one of the SHOW_XXX constants, or several ORed together.
- */
- public int getWhatToShow();
-
- /**
- * <p>The value of this flag determines whether the children of entity
- * reference nodes are visible to the iterator. If false, they and
- * their descendants will be rejected. Note that this rejection takes
- * precedence over <code>whatToShow</code> and the filter. </p>
- *
- * <p> To produce a view of the document that has entity references
- * expanded and does not expose the entity reference node itself, use
- * the <code>whatToShow</code> flags to hide the entity reference node
- * and set <code>expandEntityReferences</code> to true when creating the
- * iterator. To produce a view of the document that has entity reference
- * nodes but no entity expansion, use the <code>whatToShow</code> flags
- * to show the entity reference node and set
- * <code>expandEntityReferences</code> to false.</p>
- *
- * <p>NOTE: In Xalan's use of DTM we will generally have fully expanded
- * entity references when the document tree was built, and thus this
- * flag will have no effect.</p>
- *
- * @return true if entity references will be expanded. */
- public boolean getExpandEntityReferences();
-
- /**
- * Returns the next node in the set and advances the position of the
- * iterator in the set. After a <code>DTMIterator</code> has setRoot called,
- * the first call to <code>nextNode()</code> returns that root or (if it
- * is rejected by the filters) the first node within its subtree which is
- * not filtered out.
- * @return The next node handle in the set being iterated over, or
- * <code>DTM.NULL</code> if there are no more members in that set.
- */
- public int nextNode();
-
- /**
- * Returns the previous node in the set and moves the position of the
- * <code>DTMIterator</code> backwards in the set.
- * @return The previous node handle in the set being iterated over,
- * or <code>DTM.NULL</code> if there are no more members in that set.
- */
- public int previousNode();
-
- /**
- * Detaches the <code>DTMIterator</code> from the set which it iterated
- * over, releasing any computational resources and placing the iterator
- * in the INVALID state. After <code>detach</code> has been invoked,
- * calls to <code>nextNode</code> or <code>previousNode</code> will
- * raise a runtime exception.
- */
- public void detach();
-
- /**
- * Specify if it's OK for detach to release the iterator for reuse.
- *
- * @param allowRelease true if it is OK for detach to release this iterator
- * for pooling.
- */
- public void allowDetachToRelease(boolean allowRelease);
-
- /**
- * Get the current node in the iterator. Note that this differs from
- * the DOM's NodeIterator, where the current position lies between two
- * nodes (as part of the maintain-relative-position semantic).
- *
- * @return The current node handle, or -1.
- */
- public int getCurrentNode();
-
- /**
- * Tells if this NodeSetDTM is "fresh", in other words, if
- * the first nextNode() that is called will return the
- * first node in the set.
- *
- * @return true if the iteration of this list has not yet begun.
- */
- public boolean isFresh();
-
- //========= Random Access ==========
-
- /**
- * If setShouldCacheNodes(true) is called, then nodes will
- * be cached, enabling random access, and giving the ability to do
- * sorts and the like. They are not cached by default.
- *
- * %REVIEW% Shouldn't the other random-access methods throw an exception
- * if they're called on a DTMIterator with this flag set false?
- *
- * @param b true if the nodes should be cached.
- */
- public void setShouldCacheNodes(boolean b);
-
- /**
- * Tells if this iterator can have nodes added to it or set via
- * the <code>setItem(int node, int index)</code> method.
- *
- * @return True if the nodelist can be mutated.
- */
- public boolean isMutable();
-
- /** Get the current position within the cached list, which is one
- * less than the next nextNode() call will retrieve. i.e. if you
- * call getCurrentPos() and the return is 0, the next fetch will
- * take place at index 1.
- *
- * @return The position of the iteration.
- */
- public int getCurrentPos();
-
- /**
- * If an index is requested, NodeSetDTM will call this method
- * to run the iterator to the index. By default this sets
- * m_next to the index. If the index argument is -1, this
- * signals that the iterator should be run to the end and
- * completely fill the cache.
- *
- * @param index The index to run to, or -1 if the iterator should be run
- * to the end.
- */
- public void runTo(int index);
-
- /**
- * Set the current position in the node set.
- *
- * @param i Must be a valid index.
- */
- public void setCurrentPos(int i);
-
- /**
- * Returns the <code>node handle</code> of an item in the collection. If
- * <code>index</code> is greater than or equal to the number of nodes in
- * the list, this returns <code>null</code>.
- *
- * @param index of the item.
- * @return The node handle at the <code>index</code>th position in the
- * <code>DTMIterator</code>, or <code>-1</code> if that is not a valid
- * index.
- */
- public int item(int index);
-
- /**
- * Sets the node at the specified index of this vector to be the
- * specified node. The previous component at that position is discarded.
- *
- * <p>The index must be a value greater than or equal to 0 and less
- * than the current size of the vector.
- * The iterator must be in cached mode.</p>
- *
- * <p>Meant to be used for sorted iterators.</p>
- *
- * @param node Node to set
- * @param index Index of where to set the node
- */
- public void setItem(int node, int index);
-
- /**
- * The number of nodes in the list. The range of valid child node indices
- * is 0 to <code>length-1</code> inclusive. Note that this requires running
- * the iterator to completion, and presumably filling the cache.
- *
- * @return The number of nodes in the list.
- */
- public int getLength();
-
- //=========== Cloning operations. ============
-
- /**
- * Get a cloned Iterator that is reset to the start of the iteration.
- *
- * @return A clone of this iteration that has been reset.
- *
- * @throws CloneNotSupportedException
- */
- public DTMIterator cloneWithReset() throws CloneNotSupportedException;
-
- /**
- * Get a clone of this iterator, but don't reset the iteration in the
- * process, so that it may be used from the current position.
- *
- * @return A clone of this object.
- *
- * @throws CloneNotSupportedException
- */
- public Object clone() throws CloneNotSupportedException;
-
- /**
- * Returns true if all the nodes in the iteration well be returned in document
- * order.
- *
- * @return true if all the nodes in the iteration well be returned in document
- * order.
- */
- public boolean isDocOrdered();
-
- /**
- * Returns the axis being iterated, if it is known.
- *
- * @return Axis.CHILD, etc., or -1 if the axis is not known or is of multiple
- * types.
- */
- public int getAxis();
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/dtm/DTMManager.java b/src/com/sun/org/apache/xml/internal/dtm/DTMManager.java
deleted file mode 100644
index d629b9f..0000000
--- a/src/com/sun/org/apache/xml/internal/dtm/DTMManager.java
+++ /dev/null
@@ -1,441 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DTMManager.java,v 1.2.4.1 2005/09/15 08:14:54 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.dtm;
-
-import com.sun.org.apache.xml.internal.res.XMLErrorResources;
-import com.sun.org.apache.xml.internal.res.XMLMessages;
-import com.sun.org.apache.xml.internal.utils.PrefixResolver;
-import com.sun.org.apache.xml.internal.utils.XMLStringFactory;
-import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
-import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
-
-/**
- * A DTMManager instance can be used to create DTM and
- * DTMIterator objects, and manage the DTM objects in the system.
- *
- * <p>The system property that determines which Factory implementation
- * to create is named "com.sun.org.apache.xml.internal.utils.DTMFactory". This
- * property names a concrete subclass of the DTMFactory abstract
- * class. If the property is not defined, a platform default is be used.</p>
- *
- * <p>An instance of this class <emph>must</emph> be safe to use across
- * thread instances. It is expected that a client will create a single instance
- * of a DTMManager to use across multiple threads. This will allow sharing
- * of DTMs across multiple processes.</p>
- *
- * <p>Note: this class is incomplete right now. It will be pretty much
- * modeled after javax.xml.transform.TransformerFactory in terms of its
- * factory support.</p>
- *
- * <p>State: In progress!!</p>
- */
-public abstract class DTMManager
-{
-
- /**
- * Factory for creating XMLString objects.
- * %TBD% Make this set by the caller.
- */
- protected XMLStringFactory m_xsf = null;
-
- private boolean _useServicesMechanism;
- /**
- * Default constructor is protected on purpose.
- */
- protected DTMManager(){}
-
- /**
- * Get the XMLStringFactory used for the DTMs.
- *
- *
- * @return a valid XMLStringFactory object, or null if it hasn't been set yet.
- */
- public XMLStringFactory getXMLStringFactory()
- {
- return m_xsf;
- }
-
- /**
- * Set the XMLStringFactory used for the DTMs.
- *
- *
- * @param xsf a valid XMLStringFactory object, should not be null.
- */
- public void setXMLStringFactory(XMLStringFactory xsf)
- {
- m_xsf = xsf;
- }
-
- /**
- * Obtain a new instance of a <code>DTMManager</code>.
- * This static method creates a new factory instance
- * using the default <code>DTMManager</code> implementation, which is
- * <code>com.sun.org.apache.xml.internal.dtm.ref.DTMManagerDefault</code>.
- * </li>
- * </ul>
- *
- * Once an application has obtained a reference to a <code>
- * DTMManager</code> it can use the factory to configure
- * and obtain parser instances.
- *
- * @return new DTMManager instance, never null.
- *
- * @throws DTMConfigurationException
- * if the implementation is not available or cannot be instantiated.
- */
- public static DTMManager newInstance(XMLStringFactory xsf)
- throws DTMConfigurationException
- {
- final DTMManager factoryImpl = new com.sun.org.apache.xml.internal.dtm.ref.DTMManagerDefault();
- factoryImpl.setXMLStringFactory(xsf);
-
- return factoryImpl;
- }
-
- /**
- * Get an instance of a DTM, loaded with the content from the
- * specified source. If the unique flag is true, a new instance will
- * always be returned. Otherwise it is up to the DTMManager to return a
- * new instance or an instance that it already created and may be being used
- * by someone else.
- *
- * (More parameters may eventually need to be added for error handling
- * and entity resolution, and to better control selection of implementations.)
- *
- * @param source the specification of the source object, which may be null,
- * in which case it is assumed that node construction will take
- * by some other means.
- * @param unique true if the returned DTM must be unique, probably because it
- * is going to be mutated.
- * @param whiteSpaceFilter Enables filtering of whitespace nodes, and may
- * be null.
- * @param incremental true if the DTM should be built incrementally, if
- * possible.
- * @param doIndexing true if the caller considers it worth it to use
- * indexing schemes.
- *
- * @return a non-null DTM reference.
- */
- public abstract DTM getDTM(javax.xml.transform.Source source,
- boolean unique, DTMWSFilter whiteSpaceFilter,
- boolean incremental, boolean doIndexing);
-
- /**
- * Get the instance of DTM that "owns" a node handle.
- *
- * @param nodeHandle the nodeHandle.
- *
- * @return a non-null DTM reference.
- */
- public abstract DTM getDTM(int nodeHandle);
-
- /**
- * Given a W3C DOM node, try and return a DTM handle.
- * Note: calling this may be non-optimal.
- *
- * @param node Non-null reference to a DOM node.
- *
- * @return a valid DTM handle.
- */
- public abstract int getDTMHandleFromNode(org.w3c.dom.Node node);
-
- /**
- * Creates a DTM representing an empty <code>DocumentFragment</code> object.
- * @return a non-null DTM reference.
- */
- public abstract DTM createDocumentFragment();
-
- /**
- * Release a DTM either to a lru pool, or completely remove reference.
- * DTMs without system IDs are always hard deleted.
- * State: experimental.
- *
- * @param dtm The DTM to be released.
- * @param shouldHardDelete True if the DTM should be removed no matter what.
- * @return true if the DTM was removed, false if it was put back in a lru pool.
- */
- public abstract boolean release(DTM dtm, boolean shouldHardDelete);
-
- /**
- * Create a new <code>DTMIterator</code> based on an XPath
- * <a href="http://www.w3.org/TR/xpath#NT-LocationPath>LocationPath</a> or
- * a <a href="http://www.w3.org/TR/xpath#NT-UnionExpr">UnionExpr</a>.
- *
- * @param xpathCompiler ??? Somehow we need to pass in a subpart of the
- * expression. I hate to do this with strings, since the larger expression
- * has already been parsed.
- *
- * @param pos The position in the expression.
- * @return The newly created <code>DTMIterator</code>.
- */
- public abstract DTMIterator createDTMIterator(Object xpathCompiler,
- int pos);
-
- /**
- * Create a new <code>DTMIterator</code> based on an XPath
- * <a href="http://www.w3.org/TR/xpath#NT-LocationPath>LocationPath</a> or
- * a <a href="http://www.w3.org/TR/xpath#NT-UnionExpr">UnionExpr</a>.
- *
- * @param xpathString Must be a valid string expressing a
- * <a href="http://www.w3.org/TR/xpath#NT-LocationPath>LocationPath</a> or
- * a <a href="http://www.w3.org/TR/xpath#NT-UnionExpr">UnionExpr</a>.
- *
- * @param presolver An object that can resolve prefixes to namespace URLs.
- *
- * @return The newly created <code>DTMIterator</code>.
- */
- public abstract DTMIterator createDTMIterator(String xpathString,
- PrefixResolver presolver);
-
- /**
- * Create a new <code>DTMIterator</code> based only on a whatToShow
- * and a DTMFilter. The traversal semantics are defined as the
- * descendant access.
- * <p>
- * Note that DTMIterators may not be an exact match to DOM
- * NodeIterators. They are initialized and used in much the same way
- * as a NodeIterator, but their response to document mutation is not
- * currently defined.
- *
- * @param whatToShow This flag specifies which node types may appear in
- * the logical view of the tree presented by the iterator. See the
- * description of <code>NodeFilter</code> for the set of possible
- * <code>SHOW_</code> values.These flags can be combined using
- * <code>OR</code>.
- * @param filter The <code>NodeFilter</code> to be used with this
- * <code>DTMFilter</code>, or <code>null</code> to indicate no filter.
- * @param entityReferenceExpansion The value of this flag determines
- * whether entity reference nodes are expanded.
- *
- * @return The newly created <code>DTMIterator</code>.
- */
- public abstract DTMIterator createDTMIterator(int whatToShow,
- DTMFilter filter, boolean entityReferenceExpansion);
-
- /**
- * Create a new <code>DTMIterator</code> that holds exactly one node.
- *
- * @param node The node handle that the DTMIterator will iterate to.
- *
- * @return The newly created <code>DTMIterator</code>.
- */
- public abstract DTMIterator createDTMIterator(int node);
-
- /* Flag indicating whether an incremental transform is desired */
- public boolean m_incremental = false;
-
- /*
- * Flag set by FEATURE_SOURCE_LOCATION.
- * This feature specifies whether the transformation phase should
- * keep track of line and column numbers for the input source
- * document.
- */
- public boolean m_source_location = false;
-
- /**
- * Get a flag indicating whether an incremental transform is desired
- * @return incremental boolean.
- *
- */
- public boolean getIncremental()
- {
- return m_incremental;
- }
-
- /**
- * Set a flag indicating whether an incremental transform is desired
- * This flag should have the same value as the FEATURE_INCREMENTAL feature
- * which is set by the TransformerFactory.setAttribut() method before a
- * DTMManager is created
- * @param incremental boolean to use to set m_incremental.
- *
- */
- public void setIncremental(boolean incremental)
- {
- m_incremental = incremental;
- }
-
- /**
- * Get a flag indicating whether the transformation phase should
- * keep track of line and column numbers for the input source
- * document.
- * @return source location boolean
- *
- */
- public boolean getSource_location()
- {
- return m_source_location;
- }
-
- /**
- * Set a flag indicating whether the transformation phase should
- * keep track of line and column numbers for the input source
- * document.
- * This flag should have the same value as the FEATURE_SOURCE_LOCATION feature
- * which is set by the TransformerFactory.setAttribut() method before a
- * DTMManager is created
- * @param sourceLocation boolean to use to set m_source_location
- */
- public void setSource_location(boolean sourceLocation){
- m_source_location = sourceLocation;
- }
-
- /**
- * Return the state of the services mechanism feature.
- */
- public boolean useServicesMechnism() {
- return _useServicesMechanism;
- }
-
- /**
- * Set the state of the services mechanism feature.
- */
- public void setServicesMechnism(boolean flag) {
- _useServicesMechanism = flag;
- }
-
- // -------------------- private methods --------------------
-
- /**
- * Temp debug code - this will be removed after we test everything
- */
- private static boolean debug;
-
- static
- {
- try
- {
- debug = SecuritySupport.getSystemProperty("dtm.debug") != null;
- }
- catch (SecurityException ex){}
- }
-
- /** This value, set at compile time, controls how many bits of the
- * DTM node identifier numbers are used to identify a node within a
- * document, and thus sets the maximum number of nodes per
- * document. The remaining bits are used to identify the DTM
- * document which contains this node.
- *
- * If you change IDENT_DTM_NODE_BITS, be sure to rebuild _ALL_ the
- * files which use it... including the IDKey testcases.
- *
- * (FuncGenerateKey currently uses the node identifier directly and
- * thus is affected when this changes. The IDKEY results will still be
- * _correct_ (presuming no other breakage), but simple equality
- * comparison against the previous "golden" files will probably
- * complain.)
- * */
- public static final int IDENT_DTM_NODE_BITS = 16;
-
-
- /** When this bitmask is ANDed with a DTM node handle number, the result
- * is the low bits of the node's index number within that DTM. To obtain
- * the high bits, add the DTM ID portion's offset as assigned in the DTM
- * Manager.
- */
- public static final int IDENT_NODE_DEFAULT = (1<<IDENT_DTM_NODE_BITS)-1;
-
-
- /** When this bitmask is ANDed with a DTM node handle number, the result
- * is the DTM's document identity number.
- */
- public static final int IDENT_DTM_DEFAULT = ~IDENT_NODE_DEFAULT;
-
- /** This is the maximum number of DTMs available. The highest DTM is
- * one less than this.
- */
- public static final int IDENT_MAX_DTMS = (IDENT_DTM_DEFAULT >>> IDENT_DTM_NODE_BITS) + 1;
-
-
- /**
- * %TBD% Doc
- *
- * NEEDSDOC @param dtm
- *
- * NEEDSDOC ($objectName$) @return
- */
- public abstract int getDTMIdentity(DTM dtm);
-
- /**
- * %TBD% Doc
- *
- * NEEDSDOC ($objectName$) @return
- */
- public int getDTMIdentityMask()
- {
- return IDENT_DTM_DEFAULT;
- }
-
- /**
- * %TBD% Doc
- *
- * NEEDSDOC ($objectName$) @return
- */
- public int getNodeIdentityMask()
- {
- return IDENT_NODE_DEFAULT;
- }
-
- //
- // Classes
- //
-
- /**
- * A configuration error.
- * Originally in ObjectFactory. This is the only portion used in this package
- */
- static class ConfigurationError
- extends Error {
- static final long serialVersionUID = 5122054096615067992L;
- //
- // Data
- //
-
- /** Exception. */
- private Exception exception;
-
- //
- // Constructors
- //
-
- /**
- * Construct a new instance with the specified detail string and
- * exception.
- */
- ConfigurationError(String msg, Exception x) {
- super(msg);
- this.exception = x;
- } // <init>(String,Exception)
-
- //
- // Public methods
- //
-
- /** Returns the exception associated to this error. */
- Exception getException() {
- return exception;
- } // getException():Exception
-
- } // class ConfigurationError
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/dtm/DTMWSFilter.java b/src/com/sun/org/apache/xml/internal/dtm/DTMWSFilter.java
deleted file mode 100644
index 29864b0..0000000
--- a/src/com/sun/org/apache/xml/internal/dtm/DTMWSFilter.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DTMWSFilter.java,v 1.2.4.1 2005/09/15 08:14:55 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.dtm;
-
-/**
- * This interface is meant to be implemented by a client of the DTM, and allows
- * stripping of whitespace nodes.
- */
-public interface DTMWSFilter
-{
- /**
- * Do not strip whitespace child nodes of this element.
- */
- public static final short NOTSTRIP = 1;
-
- /**
- * Strip whitespace child nodes of this element.
- */
- public static final short STRIP = 2;
-
- /**
- * Inherit whitespace stripping behavior of the parent node.
- */
- public static final short INHERIT = 3;
-
- /**
- * Test whether whitespace-only text nodes are visible in the logical
- * view of <code>DTM</code>. Normally, this function
- * will be called by the implementation of <code>DTM</code>;
- * it is not normally called directly from
- * user code.
- *
- * @param elementHandle int Handle of the element.
- * @return one of NOTSTRIP, STRIP, or INHERIT.
- */
- public short getShouldStripSpace(int elementHandle, DTM dtm);
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/dtm/ref/ChunkedIntArray.java b/src/com/sun/org/apache/xml/internal/dtm/ref/ChunkedIntArray.java
deleted file mode 100644
index 85aebf7..0000000
--- a/src/com/sun/org/apache/xml/internal/dtm/ref/ChunkedIntArray.java
+++ /dev/null
@@ -1,308 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ChunkedIntArray.java,v 1.2.4.1 2005/09/15 08:14:58 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.dtm.ref;
-
-import com.sun.org.apache.xml.internal.res.XMLErrorResources;
-import com.sun.org.apache.xml.internal.res.XMLMessages;
-
-/**
- * <code>ChunkedIntArray</code> is an extensible array of blocks of integers.
- * (I'd consider Vector, but it's unable to handle integers except by
- * turning them into Objects.)
-
- * <p>Making this a separate class means some call-and-return overhead. But
- * doing it all inline tends to be fragile and expensive in coder time,
- * not to mention driving up code size. If you want to inline it, feel free.
- * The Java text suggest that private and Final methods may be inlined,
- * and one can argue that this beast need not be made subclassable...</p>
- *
- * <p>%REVIEW% This has strong conceptual overlap with the IntVector class.
- * It would probably be a good thing to merge the two, when time permits.<p>
- */
-final class ChunkedIntArray
-{
- final int slotsize=4; // Locked, MUST be power of two in current code
- // Debugging tip: Cranking lowbits down to 4 or so is a good
- // way to pound on the array addressing code.
- static final int lowbits=10; // How many bits address within chunks
- static final int chunkalloc=1<<lowbits;
- static final int lowmask=chunkalloc-1;
-
- ChunksVector chunks=new ChunksVector();
- final int fastArray[] = new int[chunkalloc];
- int lastUsed=0;
-
- /**
- * Create a new CIA with specified record size. Currently record size MUST
- * be a power of two... and in fact is hardcoded to 4.
- */
- ChunkedIntArray(int slotsize)
- {
- if(this.slotsize<slotsize)
- throw new ArrayIndexOutOfBoundsException(XMLMessages.createXMLMessage(XMLErrorResources.ER_CHUNKEDINTARRAY_NOT_SUPPORTED, new Object[]{Integer.toString(slotsize)})); //"ChunkedIntArray("+slotsize+") not currently supported");
- else if (this.slotsize>slotsize)
- System.out.println("*****WARNING: ChunkedIntArray("+slotsize+") wasting "+(this.slotsize-slotsize)+" words per slot");
- chunks.addElement(fastArray);
- }
- /**
- * Append a 4-integer record to the CIA, starting with record 1. (Since
- * arrays are initialized to all-0, 0 has been reserved as the "unknown"
- * value in DTM.)
- * @return the index at which this record was inserted.
- */
- int appendSlot(int w0, int w1, int w2, int w3)
- {
- /*
- try
- {
- int newoffset = (lastUsed+1)*slotsize;
- fastArray[newoffset] = w0;
- fastArray[newoffset+1] = w1;
- fastArray[newoffset+2] = w2;
- fastArray[newoffset+3] = w3;
- return ++lastUsed;
- }
- catch(ArrayIndexOutOfBoundsException aioobe)
- */
- {
- final int slotsize=4;
- int newoffset = (lastUsed+1)*slotsize;
- int chunkpos = newoffset >> lowbits;
- int slotpos = (newoffset & lowmask);
-
- // Grow if needed
- if (chunkpos > chunks.size() - 1)
- chunks.addElement(new int[chunkalloc]);
- int[] chunk = chunks.elementAt(chunkpos);
- chunk[slotpos] = w0;
- chunk[slotpos+1] = w1;
- chunk[slotpos+2] = w2;
- chunk[slotpos+3] = w3;
-
- return ++lastUsed;
- }
- }
- /**
- * Retrieve an integer from the CIA by record number and column within
- * the record, both 0-based (though position 0 is reserved for special
- * purposes).
- * @param position int Record number
- * @param slotpos int Column number
- */
- int readEntry(int position, int offset) throws ArrayIndexOutOfBoundsException
- {
- /*
- try
- {
- return fastArray[(position*slotsize)+offset];
- }
- catch(ArrayIndexOutOfBoundsException aioobe)
- */
- {
- // System.out.println("Using slow read (1)");
- if (offset>=slotsize)
- throw new ArrayIndexOutOfBoundsException(XMLMessages.createXMLMessage(XMLErrorResources.ER_OFFSET_BIGGER_THAN_SLOT, null)); //"Offset bigger than slot");
- position*=slotsize;
- int chunkpos = position >> lowbits;
- int slotpos = position & lowmask;
- int[] chunk = chunks.elementAt(chunkpos);
- return chunk[slotpos + offset];
- }
- }
-
- // Check that the node at index "position" is not an ancestor
- // of the node at index "startPos". IF IT IS, DO NOT ACCEPT IT AND
- // RETURN -1. If position is NOT an ancestor, return position.
- // Special case: The Document node (position==0) is acceptable.
- //
- // This test supports DTM.getNextPreceding.
- int specialFind(int startPos, int position)
- {
- // We have to look all the way up the ancestor chain
- // to make sure we don't have an ancestor.
- int ancestor = startPos;
- while(ancestor > 0)
- {
- // Get the node whose index == ancestor
- ancestor*=slotsize;
- int chunkpos = ancestor >> lowbits;
- int slotpos = ancestor & lowmask;
- int[] chunk = chunks.elementAt(chunkpos);
-
- // Get that node's parent (Note that this assumes w[1]
- // is the parent node index. That's really a DTM feature
- // rather than a ChunkedIntArray feature.)
- ancestor = chunk[slotpos + 1];
-
- if(ancestor == position)
- break;
- }
-
- if (ancestor <= 0)
- {
- return position;
- }
- return -1;
- }
-
- /**
- * @return int index of highest-numbered record currently in use
- */
- int slotsUsed()
- {
- return lastUsed;
- }
-
- /** Disard the highest-numbered record. This is used in the string-buffer
- CIA; when only a single characters() chunk has been recieved, its index
- is moved into the Text node rather than being referenced by indirection
- into the text accumulator.
- */
- void discardLast()
- {
- --lastUsed;
- }
-
- /**
- * Overwrite the integer found at a specific record and column.
- * Used to back-patch existing records, most often changing their
- * "next sibling" reference from 0 (unknown) to something meaningful
- * @param position int Record number
- * @param offset int Column number
- * @param value int New contents
- */
- void writeEntry(int position, int offset, int value) throws ArrayIndexOutOfBoundsException
- {
- /*
- try
- {
- fastArray[( position*slotsize)+offset] = value;
- }
- catch(ArrayIndexOutOfBoundsException aioobe)
- */
- {
- if (offset >= slotsize)
- throw new ArrayIndexOutOfBoundsException(XMLMessages.createXMLMessage(XMLErrorResources.ER_OFFSET_BIGGER_THAN_SLOT, null)); //"Offset bigger than slot");
- position*=slotsize;
- int chunkpos = position >> lowbits;
- int slotpos = position & lowmask;
- int[] chunk = chunks.elementAt(chunkpos);
- chunk[slotpos + offset] = value; // ATOMIC!
- }
- }
-
- /**
- * Overwrite an entire (4-integer) record at the specified index.
- * Mostly used to create record 0, the Document node.
- * @param position integer Record number
- * @param w0 int
- * @param w1 int
- * @param w2 int
- * @param w3 int
- */
- void writeSlot(int position, int w0, int w1, int w2, int w3)
- {
- position *= slotsize;
- int chunkpos = position >> lowbits;
- int slotpos = (position & lowmask);
-
- // Grow if needed
- if (chunkpos > chunks.size() - 1)
- chunks.addElement(new int[chunkalloc]);
- int[] chunk = chunks.elementAt(chunkpos);
- chunk[slotpos] = w0;
- chunk[slotpos + 1] = w1;
- chunk[slotpos + 2] = w2;
- chunk[slotpos + 3] = w3;
- }
-
- /**
- * Retrieve the contents of a record into a user-supplied buffer array.
- * Used to reduce addressing overhead when code will access several
- * columns of the record.
- * @param position int Record number
- * @param buffer int[] Integer array provided by user, must be large enough
- * to hold a complete record.
- */
- void readSlot(int position, int[] buffer)
- {
- /*
- try
- {
- System.arraycopy(fastArray, position*slotsize, buffer, 0, slotsize);
- }
- catch(ArrayIndexOutOfBoundsException aioobe)
- */
- {
- // System.out.println("Using slow read (2): "+position);
- position *= slotsize;
- int chunkpos = position >> lowbits;
- int slotpos = (position & lowmask);
-
- // Grow if needed
- if (chunkpos > chunks.size() - 1)
- chunks.addElement(new int[chunkalloc]);
- int[] chunk = chunks.elementAt(chunkpos);
- System.arraycopy(chunk,slotpos,buffer,0,slotsize);
- }
- }
-
- class ChunksVector
- {
- final int BLOCKSIZE = 64;
- int[] m_map[] = new int[BLOCKSIZE][];
- int m_mapSize = BLOCKSIZE;
- int pos = 0;
-
- ChunksVector()
- {
- }
-
- final int size()
- {
- return pos;
- }
-
- void addElement(int[] value)
- {
- if(pos >= m_mapSize)
- {
- int orgMapSize = m_mapSize;
- while(pos >= m_mapSize)
- m_mapSize+=BLOCKSIZE;
- int[] newMap[] = new int[m_mapSize][];
- System.arraycopy(m_map, 0, newMap, 0, orgMapSize);
- m_map = newMap;
- }
- // For now, just do a simple append. A sorted insert only
- // makes sense if we're doing an binary search or some such.
- m_map[pos] = value;
- pos++;
- }
-
- final int[] elementAt(int pos)
- {
- return m_map[pos];
- }
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/dtm/ref/CoroutineManager.java b/src/com/sun/org/apache/xml/internal/dtm/ref/CoroutineManager.java
deleted file mode 100644
index 6323b03..0000000
--- a/src/com/sun/org/apache/xml/internal/dtm/ref/CoroutineManager.java
+++ /dev/null
@@ -1,346 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: CoroutineManager.java,v 1.2.4.1 2005/09/15 08:14:58 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.dtm.ref;
-
-import java.util.BitSet;
-
-import com.sun.org.apache.xml.internal.res.XMLErrorResources;
-import com.sun.org.apache.xml.internal.res.XMLMessages;
-
-
-/**
- * <p>Support the coroutine design pattern.</p>
- *
- * <p>A coroutine set is a very simple cooperative non-preemptive
- * multitasking model, where the switch from one task to another is
- * performed via an explicit request. Coroutines interact according to
- * the following rules:</p>
- *
- * <ul>
- * <li>One coroutine in the set has control, which it retains until it
- * either exits or resumes another coroutine.</li>
- * <li>A coroutine is activated when it is resumed by some other coroutine
- * for the first time.</li>
- * <li>An active coroutine that gives up control by resuming another in
- * the set retains its context -- including call stack and local variables
- * -- so that if/when it is resumed, it will proceed from the point at which
- * it last gave up control.</li>
- * </ul>
- *
- * <p>Coroutines can be thought of as falling somewhere between pipes and
- * subroutines. Like call/return, there is an explicit flow of control
- * from one coroutine to another. Like pipes, neither coroutine is
- * actually "in charge", and neither must exit in order to transfer
- * control to the other. </p>
- *
- * <p>One classic application of coroutines is in compilers, where both
- * the parser and the lexer are maintaining complex state
- * information. The parser resumes the lexer to process incoming
- * characters into lexical tokens, and the lexer resumes the parser
- * when it has reached a point at which it has a reliably interpreted
- * set of tokens available for semantic processing. Structuring this
- * as call-and-return would require saving and restoring a
- * considerable amount of state each time. Structuring it as two tasks
- * connected by a queue may involve higher overhead (in systems which
- * can optimize the coroutine metaphor), isn't necessarily as clear in
- * intent, may have trouble handling cases where data flows in both
- * directions, and may not handle some of the more complex cases where
- * more than two coroutines are involved.</p>
- *
- * <p>Most coroutine systems also provide a way to pass data between the
- * source and target of a resume operation; this is sometimes referred
- * to as "yielding" a value. Others rely on the fact that, since only
- * one member of a coroutine set is running at a time and does not
- * lose control until it chooses to do so, data structures may be
- * directly shared between them with only minimal precautions.</p>
- *
- * <p>"Note: This should not be taken to mean that producer/consumer
- * problems should be always be done with coroutines." Queueing is
- * often a better solution when only two threads of execution are
- * involved and full two-way handshaking is not required. It's a bit
- * difficult to find short pedagogical examples that require
- * coroutines for a clear solution.</p>
- *
- * <p>The fact that only one of a group of coroutines is running at a
- * time, and the control transfer between them is explicit, simplifies
- * their possible interactions, and in some implementations permits
- * them to be implemented more efficiently than general multitasking.
- * In some situations, coroutines can be compiled out entirely;
- * in others, they may only require a few instructions more than a
- * simple function call.</p>
- *
- * <p>This version is built on top of standard Java threading, since
- * that's all we have available right now. It's been encapsulated for
- * code clarity and possible future optimization.</p>
- *
- * <p>(Two possible approaches: wait-notify based and queue-based. Some
- * folks think that a one-item queue is a cleaner solution because it's
- * more abstract -- but since coroutine _is_ an abstraction I'm not really
- * worried about that; folks should be able to switch this code without
- * concern.)</p>
- *
- * <p>%TBD% THIS SHOULD BE AN INTERFACE, to facilitate building other
- * implementations... perhaps including a true coroutine system
- * someday, rather than controlled threading. Arguably Coroutine
- * itself should be an interface much like Runnable, but I think that
- * can be built on top of this.</p>
- * */
-public class CoroutineManager
-{
- /** "Is this coroutine ID number already in use" lookup table.
- * Currently implemented as a bitset as a compromise between
- * compactness and speed of access, but obviously other solutions
- * could be applied.
- * */
- BitSet m_activeIDs=new BitSet();
-
- /** Limit on the coroutine ID numbers accepted. I didn't want the
- * in-use table to grow without bound. If we switch to a more efficient
- * sparse-array mechanism, it may be possible to raise or eliminate
- * this boundary.
- * @xsl.usage internal
- */
- static final int m_unreasonableId=1024;
-
- /** Internal field used to hold the data being explicitly passed
- * from one coroutine to another during a co_resume() operation.
- * (Of course implicit data sharing may also occur; one of the reasons
- * for using coroutines is that you're guaranteed that none of the
- * other coroutines in your set are using shared structures at the time
- * you access them.)
- *
- * %REVIEW% It's been proposed that we be able to pass types of data
- * other than Object -- more specific object types, or
- * lighter-weight primitives. This would seem to create a potential
- * explosion of "pass x recieve y back" methods (or require
- * fracturing resume into two calls, resume-other and
- * wait-to-be-resumed), and the weight issue could be managed by
- * reusing a mutable buffer object to contain the primitive
- * (remember that only one coroutine runs at a time, so once the
- * buffer's set it won't be walked on). Typechecking objects is
- * interesting from a code-robustness point of view, but it's
- * unclear whether it makes sense to encapsulate that in the
- * coroutine code or let the callers do it, since it depends on RTTI
- * either way. Restricting the parameters to objects implementing a
- * specific CoroutineParameter interface does _not_ seem to be a net
- * win; applications can do so if they want via front-end code, but
- * there seem to be too many use cases involving passing an existing
- * object type that you may not have the freedom to alter and may
- * not want to spend time wrapping another object around.
- * */
- Object m_yield=null;
-
- // Expose???
- final static int NOBODY=-1;
- final static int ANYBODY=-1;
-
- /** Internal field used to confirm that the coroutine now waking up is
- * in fact the one we intended to resume. Some such selection mechanism
- * is needed when more that two coroutines are operating within the same
- * group.
- */
- int m_nextCoroutine=NOBODY;
-
- /** <p>Each coroutine in the set managed by a single
- * CoroutineManager is identified by a small positive integer. This
- * brings up the question of how to manage those integers to avoid
- * reuse... since if two coroutines use the same ID number, resuming
- * that ID could resume either. I can see arguments for either
- * allowing applications to select their own numbers (they may want
- * to declare mnemonics via manefest constants) or generating
- * numbers on demand. This routine's intended to support both
- * approaches.</p>
- *
- * <p>%REVIEW% We could use an object as the identifier. Not sure
- * it's a net gain, though it would allow the thread to be its own
- * ID. Ponder.</p>
- *
- * @param coroutineID If >=0, requests that we reserve this number.
- * If <0, requests that we find, reserve, and return an available ID
- * number.
- *
- * @return If >=0, the ID number to be used by this coroutine. If <0,
- * an error occurred -- the ID requested was already in use, or we
- * couldn't assign one without going over the "unreasonable value" mark
- * */
- public synchronized int co_joinCoroutineSet(int coroutineID)
- {
- if(coroutineID>=0)
- {
- if(coroutineID>=m_unreasonableId || m_activeIDs.get(coroutineID))
- return -1;
- }
- else
- {
- // What I want is "Find first clear bit". That doesn't exist.
- // JDK1.2 added "find last set bit", but that doesn't help now.
- coroutineID=0;
- while(coroutineID<m_unreasonableId)
- {
- if(m_activeIDs.get(coroutineID))
- ++coroutineID;
- else
- break;
- }
- if(coroutineID>=m_unreasonableId)
- return -1;
- }
-
- m_activeIDs.set(coroutineID);
- return coroutineID;
- }
-
- /** In the standard coroutine architecture, coroutines are
- * identified by their method names and are launched and run up to
- * their first yield by simply resuming them; its's presumed that
- * this recognizes the not-already-running case and does the right
- * thing. We seem to need a way to achieve that same threadsafe
- * run-up... eg, start the coroutine with a wait.
- *
- * %TBD% whether this makes any sense...
- *
- * @param thisCoroutine the identifier of this coroutine, so we can
- * recognize when we are being resumed.
- * @exception java.lang.NoSuchMethodException if thisCoroutine isn't
- * a registered member of this group. %REVIEW% whether this is the
- * best choice.
- * */
- public synchronized Object co_entry_pause(int thisCoroutine) throws java.lang.NoSuchMethodException
- {
- if(!m_activeIDs.get(thisCoroutine))
- throw new java.lang.NoSuchMethodException();
-
- while(m_nextCoroutine != thisCoroutine)
- {
- try
- {
- wait();
- }
- catch(java.lang.InterruptedException e)
- {
- // %TBD% -- Declare? Encapsulate? Ignore? Or
- // dance widdershins about the instruction cache?
- }
- }
-
- return m_yield;
- }
-
- /** Transfer control to another coroutine which has already been started and
- * is waiting on this CoroutineManager. We won't return from this call
- * until that routine has relinquished control.
- *
- * %TBD% What should we do if toCoroutine isn't registered? Exception?
- *
- * @param arg_object A value to be passed to the other coroutine.
- * @param thisCoroutine Integer identifier for this coroutine. This is the
- * ID we watch for to see if we're the ones being resumed.
- * @param toCoroutine Integer identifier for the coroutine we wish to
- * invoke.
- * @exception java.lang.NoSuchMethodException if toCoroutine isn't a
- * registered member of this group. %REVIEW% whether this is the best choice.
- * */
- public synchronized Object co_resume(Object arg_object,int thisCoroutine,int toCoroutine) throws java.lang.NoSuchMethodException
- {
- if(!m_activeIDs.get(toCoroutine))
- throw new java.lang.NoSuchMethodException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COROUTINE_NOT_AVAIL, new Object[]{Integer.toString(toCoroutine)})); //"Coroutine not available, id="+toCoroutine);
-
- // We expect these values to be overwritten during the notify()/wait()
- // periods, as other coroutines in this set get their opportunity to run.
- m_yield=arg_object;
- m_nextCoroutine=toCoroutine;
-
- notify();
- while(m_nextCoroutine != thisCoroutine || m_nextCoroutine==ANYBODY || m_nextCoroutine==NOBODY)
- {
- try
- {
- // System.out.println("waiting...");
- wait();
- }
- catch(java.lang.InterruptedException e)
- {
- // %TBD% -- Declare? Encapsulate? Ignore? Or
- // dance deasil about the program counter?
- }
- }
-
- if(m_nextCoroutine==NOBODY)
- {
- // Pass it along
- co_exit(thisCoroutine);
- // And inform this coroutine that its partners are Going Away
- // %REVIEW% Should this throw/return something more useful?
- throw new java.lang.NoSuchMethodException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COROUTINE_CO_EXIT, null)); //"CoroutineManager recieved co_exit() request");
- }
-
- return m_yield;
- }
-
- /** Terminate this entire set of coroutines. The others will be
- * deregistered and have exceptions thrown at them. Note that this
- * is intended as a panic-shutdown operation; under normal
- * circumstances a coroutine should always end with co_exit_to() in
- * order to politely inform at least one of its partners that it is
- * going away.
- *
- * %TBD% This may need significantly more work.
- *
- * %TBD% Should this just be co_exit_to(,,CoroutineManager.PANIC)?
- *
- * @param thisCoroutine Integer identifier for the coroutine requesting exit.
- * */
- public synchronized void co_exit(int thisCoroutine)
- {
- m_activeIDs.clear(thisCoroutine);
- m_nextCoroutine=NOBODY; // %REVIEW%
- notify();
- }
-
- /** Make the ID available for reuse and terminate this coroutine,
- * transferring control to the specified coroutine. Note that this
- * returns immediately rather than waiting for any further coroutine
- * traffic, so the thread can proceed with other shutdown activities.
- *
- * @param arg_object A value to be passed to the other coroutine.
- * @param thisCoroutine Integer identifier for the coroutine leaving the set.
- * @param toCoroutine Integer identifier for the coroutine we wish to
- * invoke.
- * @exception java.lang.NoSuchMethodException if toCoroutine isn't a
- * registered member of this group. %REVIEW% whether this is the best choice.
- * */
- public synchronized void co_exit_to(Object arg_object,int thisCoroutine,int toCoroutine) throws java.lang.NoSuchMethodException
- {
- if(!m_activeIDs.get(toCoroutine))
- throw new java.lang.NoSuchMethodException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COROUTINE_NOT_AVAIL, new Object[]{Integer.toString(toCoroutine)})); //"Coroutine not available, id="+toCoroutine);
-
- // We expect these values to be overwritten during the notify()/wait()
- // periods, as other coroutines in this set get their opportunity to run.
- m_yield=arg_object;
- m_nextCoroutine=toCoroutine;
-
- m_activeIDs.clear(thisCoroutine);
-
- notify();
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/dtm/ref/CoroutineParser.java b/src/com/sun/org/apache/xml/internal/dtm/ref/CoroutineParser.java
deleted file mode 100644
index 57c7724..0000000
--- a/src/com/sun/org/apache/xml/internal/dtm/ref/CoroutineParser.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: CoroutineParser.java,v 1.2.4.1 2005/09/15 08:14:59 suresh_emailid Exp $
- */
-
-package com.sun.org.apache.xml.internal.dtm.ref;
-
-import org.xml.sax.ContentHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.XMLReader;
-
-/** <p>CoroutineParser is an API for parser threads that operate as
- * coroutines. See CoroutineSAXParser and CoroutineSAXParser_Xerces
- * for examples.</p>
- *
- * <p>&lt;grumble&gt; I'd like the interface to require a specific form
- * for either the base constructor or a static factory method. Java
- * doesn't allow us to specify either, so I'll just document them
- * here:
- *
- * <ul>
- * <li>public CoroutineParser(CoroutineManager co, int appCoroutine);</li>
- * <li>public CoroutineParser createCoroutineParser(CoroutineManager co, int appCoroutine);</li>
- * </ul>
- *
- * &lt;/grumble&gt;</p>
- *
- * @deprecated Since the ability to start a parse via the
- * coroutine protocol was not being used and was complicating design.
- * See {@link IncrementalSAXSource}.
- * */
-public interface CoroutineParser {
-
- /** @return the coroutine ID number for this CoroutineParser object.
- * Note that this isn't useful unless you know which CoroutineManager
- * you're talking to. Also note that the do...() methods encapsulate
- * the common transactions with the CoroutineParser, so you shouldn't
- * need this in most cases.
- * */
- public int getParserCoroutineID();
-
- /** @return the CoroutineManager for this CoroutineParser object.
- * If you're using the do...() methods, applications should only
- * need to talk to the CoroutineManager once, to obtain the
- * application's Coroutine ID.
- * */
- public CoroutineManager getCoroutineManager();
-
- /** Register a SAX-style content handler for us to output to */
- public void setContentHandler(ContentHandler handler);
-
- /** Register a SAX-style lexical handler for us to output to
- * Not all parsers support this...
- *
- * %REVIEW% Not called setLexicalHandler because Xalan uses that name
- * internally, which causes subclassing nuisances.
- */
- public void setLexHandler(org.xml.sax.ext.LexicalHandler handler);
-
- /* The run() method is required in CoroutineParsers that run as
- * threads (of course)... but it isn't part of our API, and
- * shouldn't be declared here.
- * */
-
- //================================================================
- /** doParse() is a simple API which tells the coroutine parser
- * to begin reading from a file. This is intended to be called from one
- * of our partner coroutines, and serves both to encapsulate the
- * communication protocol and to avoid having to explicitly use the
- * CoroutineParser's coroutine ID number.
- *
- * %REVIEW% Can/should this unify with doMore? (if URI hasn't changed,
- * parse more from same file, else end and restart parsing...?
- *
- * @param source The InputSource to parse from.
- * @param appCoroutine The coroutine ID number of the coroutine invoking
- * this method, so it can be resumed after the parser has responded to the
- * request.
- * @return Boolean.TRUE if the CoroutineParser believes more data may be available
- * for further parsing. Boolean.FALSE if parsing ran to completion.
- * Exception if the parser objected for some reason.
- * */
- public Object doParse(InputSource source, int appCoroutine);
-
- /** doMore() is a simple API which tells the coroutine parser
- * that we need more nodes. This is intended to be called from one
- * of our partner coroutines, and serves both to encapsulate the
- * communication protocol and to avoid having to explicitly use the
- * CoroutineParser's coroutine ID number.
- *
- * @param parsemore If true, tells the incremental parser to generate
- * another chunk of output. If false, tells the parser that we're
- * satisfied and it can terminate parsing of this document.
- * @param appCoroutine The coroutine ID number of the coroutine invoking
- * this method, so it can be resumed after the parser has responded to the
- * request.
- * @return Boolean.TRUE if the CoroutineParser believes more data may be available
- * for further parsing. Boolean.FALSE if parsing ran to completion.
- * Exception if the parser objected for some reason.
- * */
- public Object doMore (boolean parsemore, int appCoroutine);
-
- /** doTerminate() is a simple API which tells the coroutine
- * parser to terminate itself. This is intended to be called from
- * one of our partner coroutines, and serves both to encapsulate the
- * communication protocol and to avoid having to explicitly use the
- * CoroutineParser's coroutine ID number.
- *
- * Returns only after the CoroutineParser has acknowledged the request.
- *
- * @param appCoroutine The coroutine ID number of the coroutine invoking
- * this method, so it can be resumed after the parser has responded to the
- * request.
- * */
- public void doTerminate(int appCoroutine);
-
- /**
- * Initialize the coroutine parser. Same parameters could be passed
- * in a non-default constructor, or by using using context ClassLoader
- * and newInstance and then calling init()
- */
- public void init( CoroutineManager co, int appCoroutineID, XMLReader parser );
-
-} // class CoroutineParser
diff --git a/src/com/sun/org/apache/xml/internal/dtm/ref/CustomStringPool.java b/src/com/sun/org/apache/xml/internal/dtm/ref/CustomStringPool.java
deleted file mode 100644
index f20c151..0000000
--- a/src/com/sun/org/apache/xml/internal/dtm/ref/CustomStringPool.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: CustomStringPool.java,v 1.2.4.1 2005/09/15 08:14:59 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.dtm.ref;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * CustomStringPool is an example of an application-provided data structure for a
- * DTM implementation to hold symbol references, e.g. element names. It will
- * follow the DTMStringPool interface and use two simple methods
- * indexToString(int i) and stringToIndex(String s) to map between a set of
- * string values and a set of integer index values. Therefore, an application
- * may improve DTM processing speed by substituting the DTM symbol resolution
- * tables with application specific quick symbol resolution tables.
- * <p>
- * %REVIEW% The only difference between this an DTMStringPool seems to be that
- * it uses a java.lang.Hashtable full of Integers rather than implementing its
- * own hashing. Joe deliberately avoided that approach when writing
- * DTMStringPool, since it is both much more memory-hungry and probably slower
- * -- especially in JDK 1.1.x, where Hashtable is synchronized. We need to
- * either justify this implementation or discard it.
- *
- * <p>
- * Status: In progress, under discussion.
- *
- */
-public class CustomStringPool extends DTMStringPool {
-
- final Map<String, Integer> m_stringToInt = new HashMap<>();
- public static final int NULL = -1;
-
- public CustomStringPool() {
- super();
- }
-
- public void removeAllElements() {
- m_intToString.removeAllElements();
- if (m_stringToInt != null) {
- m_stringToInt.clear();
- }
- }
-
- /**
- * @return string whose value is uniquely identified by this integer index.
- * @throws java.lang.ArrayIndexOutOfBoundsException if index doesn't map to
- * a string.
- */
- @Override
- public String indexToString(int i)
- throws java.lang.ArrayIndexOutOfBoundsException {
- return (String) m_intToString.elementAt(i);
- }
-
- /**
- * @return integer index uniquely identifying the value of this string.
- */
- @Override
- public int stringToIndex(String s) {
- if (s == null) {
- return NULL;
- }
- Integer iobj = m_stringToInt.get(s);
- if (iobj == null) {
- m_intToString.addElement(s);
- iobj = m_intToString.size();
- m_stringToInt.put(s, iobj);
- }
- return iobj;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/dtm/ref/DTMAxisIterNodeList.java b/src/com/sun/org/apache/xml/internal/dtm/ref/DTMAxisIterNodeList.java
deleted file mode 100644
index 1993bd6..0000000
--- a/src/com/sun/org/apache/xml/internal/dtm/ref/DTMAxisIterNodeList.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DTMAxisIterNodeList.java,v 1.2.4.1 2005/09/15 08:14:59 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.dtm.ref;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
-import com.sun.org.apache.xml.internal.utils.IntVector;
-
-import org.w3c.dom.Node;
-
-/**
- * <code>DTMAxisNodeList</code> gives us an implementation of the DOM's
- * NodeList interface wrapped around a DTM Iterator. The author
- * considers this something of an abominations, since NodeList was not
- * intended to be a general purpose "list of nodes" API and is
- * generally considered by the DOM WG to have be a mistake... but I'm
- * told that some of the XPath/XSLT folks say they must have this
- * solution.
- *
- * Please note that this is not necessarily equivlaent to a DOM
- * NodeList operating over the same document. In particular:
- * <ul>
- *
- * <li>If there are several Text nodes in logical succession (ie,
- * across CDATASection and EntityReference boundaries), we will return
- * only the first; the caller is responsible for stepping through
- * them.
- * (%REVIEW% Provide a convenience routine here to assist, pending
- * proposed DOM Level 3 getAdjacentText() operation?) </li>
- *
- * <li>Since the whole XPath/XSLT architecture assumes that the source
- * document is not altered while we're working with it, we do not
- * promise to implement the DOM NodeList's "live view" response to
- * document mutation. </li>
- *
- * </ul>
- *
- * <p>State: In progress!!</p>
- * */
-public class DTMAxisIterNodeList extends DTMNodeListBase {
- private DTM m_dtm;
- private DTMAxisIterator m_iter;
- private IntVector m_cachedNodes;
- private int m_last = -1;
- //================================================================
- // Methods unique to this class
- private DTMAxisIterNodeList() {
- }
-
- /**
- * Public constructor: Wrap a DTMNodeList around an existing
- * and preconfigured DTMAxisIterator
- */
- public DTMAxisIterNodeList(DTM dtm, DTMAxisIterator dtmAxisIterator) {
- if (dtmAxisIterator == null) {
- m_last = 0;
- } else {
- m_cachedNodes = new IntVector();
- m_dtm = dtm;
- }
- m_iter = dtmAxisIterator;
- }
-
- /**
- * Access the wrapped DTMIterator. I'm not sure whether anyone will
- * need this or not, but let's write it and think about it.
- *
- */
- public DTMAxisIterator getDTMAxisIterator() {
- return m_iter;
- }
-
-
- //================================================================
- // org.w3c.dom.NodeList API follows
-
- /**
- * Returns the <code>index</code>th item in the collection. If
- * <code>index</code> is greater than or equal to the number of nodes in
- * the list, this returns <code>null</code>.
- * @param index Index into the collection.
- * @return The node at the <code>index</code>th position in the
- * <code>NodeList</code>, or <code>null</code> if that is not a valid
- * index.
- */
- public Node item(int index) {
- if (m_iter != null) {
- int node = 0;
- int count = m_cachedNodes.size();
-
- if (count > index) {
- node = m_cachedNodes.elementAt(index);
- return m_dtm.getNode(node);
- } else if (m_last == -1) {
- while (count <= index
- && ((node = m_iter.next()) != DTMAxisIterator.END)) {
- m_cachedNodes.addElement(node);
- count++;
- }
- if (node == DTMAxisIterator.END) {
- m_last = count;
- } else {
- return m_dtm.getNode(node);
- }
- }
- }
- return null;
- }
-
- /**
- * The number of nodes in the list. The range of valid child node indices
- * is 0 to <code>length-1</code> inclusive.
- */
- public int getLength() {
- if (m_last == -1) {
- int node;
- while ((node = m_iter.next()) != DTMAxisIterator.END) {
- m_cachedNodes.addElement(node);
- }
- m_last = m_cachedNodes.size();
- }
- return m_last;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/dtm/ref/DTMAxisIteratorBase.java b/src/com/sun/org/apache/xml/internal/dtm/ref/DTMAxisIteratorBase.java
deleted file mode 100644
index b9eecc2..0000000
--- a/src/com/sun/org/apache/xml/internal/dtm/ref/DTMAxisIteratorBase.java
+++ /dev/null
@@ -1,283 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DTMAxisIteratorBase.java,v 1.2.4.1 2005/09/15 08:14:59 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.dtm.ref;
-
-import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
-
-/**
- * This class serves as a default base for implementations of mutable
- * DTMAxisIterators.
- */
-public abstract class DTMAxisIteratorBase implements DTMAxisIterator
-{
-
- /** The position of the last node within the iteration, as defined by XPath.
- * Note that this is _not_ the node's handle within the DTM. Also, don't
- * confuse it with the current (most recently returned) position.
- */
- protected int _last = -1;
-
- /** The position of the current node within the iteration, as defined by XPath.
- * Note that this is _not_ the node's handle within the DTM!
- */
- protected int _position = 0;
-
- /** The position of the marked node within the iteration;
- * a saved itaration state that we may want to come back to.
- * Note that only one mark is maintained; there is no stack.
- */
- protected int _markedNode;
-
- /** The handle to the start, or root, of the iteration.
- * Set this to END to construct an empty iterator.
- */
- protected int _startNode = DTMAxisIterator.END;
-
- /** True if the start node should be considered part of the iteration.
- * False will cause it to be skipped.
- */
- protected boolean _includeSelf = false;
-
- /** True if this iteration can be restarted. False otherwise (eg, if
- * we are iterating over a stream that can not be re-scanned, or if
- * the iterator was produced by cloning another iterator.)
- */
- protected boolean _isRestartable = true;
-
- /**
- * Get start to END should 'close' the iterator,
- * i.e. subsequent call to next() should return END.
- *
- * @return The root node of the iteration.
- */
- public int getStartNode()
- {
- return _startNode;
- }
-
- /**
- * @return A DTMAxisIterator which has been reset to the start node,
- * which may or may not be the same as this iterator.
- * */
- public DTMAxisIterator reset()
- {
-
- final boolean temp = _isRestartable;
-
- _isRestartable = true;
-
- setStartNode(_startNode);
-
- _isRestartable = temp;
-
- return this;
- }
-
- /**
- * Set the flag to include the start node in the iteration.
- *
- *
- * @return This default method returns just returns this DTMAxisIterator,
- * after setting the flag.
- * (Returning "this" permits C++-style chaining of
- * method calls into a single expression.)
- */
- public DTMAxisIterator includeSelf()
- {
-
- _includeSelf = true;
-
- return this;
- }
-
- /** Returns the position of the last node within the iteration, as
- * defined by XPath. In a forward iterator, I believe this equals the number of nodes which this
- * iterator will yield. In a reverse iterator, I believe it should return
- * 1 (since the "last" is the first produced.)
- *
- * This may be an expensive operation when called the first time, since
- * it may have to iterate through a large part of the document to produce
- * its answer.
- *
- * @return The number of nodes in this iterator (forward) or 1 (reverse).
- */
- public int getLast()
- {
-
- if (_last == -1) // Not previously established
- {
- // Note that we're doing both setMark() -- which saves _currentChild
- // -- and explicitly saving our position counter (number of nodes
- // yielded so far).
- //
- // %REVIEW% Should position also be saved by setMark()?
- // (It wasn't in the XSLTC version, but I don't understand why not.)
-
- final int temp = _position; // Save state
- setMark();
-
- reset(); // Count the nodes found by this iterator
- do
- {
- _last++;
- }
- while (next() != END);
-
- gotoMark(); // Restore saved state
- _position = temp;
- }
-
- return _last;
- }
-
- /**
- * @return The position of the current node within the set, as defined by
- * XPath. Note that this is one-based, not zero-based.
- */
- public int getPosition()
- {
- return _position == 0 ? 1 : _position;
- }
-
- /**
- * @return true if this iterator has a reversed axis, else false
- */
- public boolean isReverse()
- {
- return false;
- }
-
- /**
- * Returns a deep copy of this iterator. Cloned iterators may not be
- * restartable. The iterator being cloned may or may not become
- * non-restartable as a side effect of this operation.
- *
- * @return a deep copy of this iterator.
- */
- public DTMAxisIterator cloneIterator()
- {
-
- try
- {
- final DTMAxisIteratorBase clone = (DTMAxisIteratorBase) super.clone();
-
- clone._isRestartable = false;
-
- // return clone.reset();
- return clone;
- }
- catch (CloneNotSupportedException e)
- {
- throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(e);
- }
- }
-
- /**
- * Do any final cleanup that is required before returning the node that was
- * passed in, and then return it. The intended use is
- * <br />
- * <code>return returnNode(node);</code>
- *
- * %REVIEW% If we're calling it purely for side effects, should we really
- * be bothering with a return value? Something like
- * <br />
- * <code> accept(node); return node; </code>
- * <br />
- * would probably optimize just about as well and avoid questions
- * about whether what's returned could ever be different from what's
- * passed in.
- *
- * @param node Node handle which iteration is about to yield.
- *
- * @return The node handle passed in. */
- protected final int returnNode(final int node)
- {
- _position++;
-
- return node;
- }
-
- /**
- * Reset the position to zero. NOTE that this does not change the iteration
- * state, only the position number associated with that state.
- *
- * %REVIEW% Document when this would be used?
- *
- * @return This instance.
- */
- protected final DTMAxisIterator resetPosition()
- {
-
- _position = 0;
-
- return this;
- }
-
- /**
- * Returns true if all the nodes in the iteration well be returned in document
- * order.
- *
- * @return true as a default.
- */
- public boolean isDocOrdered()
- {
- return true;
- }
-
- /**
- * Returns the axis being iterated, if it is known.
- *
- * @return Axis.CHILD, etc., or -1 if the axis is not known or is of multiple
- * types.
- */
- public int getAxis()
- {
- return -1;
- }
-
- public void setRestartable(boolean isRestartable) {
- _isRestartable = isRestartable;
- }
-
- /**
- * Return the node at the given position.
- *
- * @param position The position
- * @return The node at the given position.
- */
- public int getNodeByPosition(int position)
- {
- if (position > 0) {
- final int pos = isReverse() ? getLast() - position + 1
- : position;
- int node;
- while ((node = next()) != DTMAxisIterator.END) {
- if (pos == getPosition()) {
- return node;
- }
- }
- }
- return END;
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/dtm/ref/DTMChildIterNodeList.java b/src/com/sun/org/apache/xml/internal/dtm/ref/DTMChildIterNodeList.java
deleted file mode 100644
index 3d26b53..0000000
--- a/src/com/sun/org/apache/xml/internal/dtm/ref/DTMChildIterNodeList.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DTMChildIterNodeList.java,v 1.2.4.1 2005/09/15 08:15:00 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.dtm.ref;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import org.w3c.dom.Node;
-
-/**
- * <code>DTMNodeList</code> gives us an implementation of the DOM's
- * NodeList interface wrapped around a DTM Iterator. The author
- * considers this something of an abominations, since NodeList was not
- * intended to be a general purpose "list of nodes" API and is
- * generally considered by the DOM WG to have be a mistake... but I'm
- * told that some of the XPath/XSLT folks say they must have this
- * solution.
- *
- * Please note that this is not necessarily equivlaent to a DOM
- * NodeList operating over the same document. In particular:
- * <ul>
- *
- * <li>If there are several Text nodes in logical succession (ie,
- * across CDATASection and EntityReference boundaries), we will return
- * only the first; the caller is responsible for stepping through
- * them.
- * (%REVIEW% Provide a convenience routine here to assist, pending
- * proposed DOM Level 3 getAdjacentText() operation?) </li>
- *
- * <li>Since the whole XPath/XSLT architecture assumes that the source
- * document is not altered while we're working with it, we do not
- * promise to implement the DOM NodeList's "live view" response to
- * document mutation. </li>
- *
- * </ul>
- *
- * <p>State: In progress!!</p>
- * */
-public class DTMChildIterNodeList extends DTMNodeListBase {
- private int m_firstChild;
- private DTM m_parentDTM;
-
- //================================================================
- // Methods unique to this class
- private DTMChildIterNodeList() {
- }
-
- /**
- * Public constructor: Create a NodeList to support
- * DTMNodeProxy.getChildren().
- *
- * Unfortunately AxisIterators and DTMIterators don't share an API,
- * so I can't use the existing Axis.CHILD iterator. Rather than
- * create Yet Another Class, let's set up a special case of this
- * one.
- *
- * @param parentDTM The DTM containing this node
- * @param parentHandle DTM node-handle integer
- *
- */
- public DTMChildIterNodeList(DTM parentDTM,int parentHandle) {
- m_parentDTM=parentDTM;
- m_firstChild=parentDTM.getFirstChild(parentHandle);
- }
-
-
- //================================================================
- // org.w3c.dom.NodeList API follows
-
- /**
- * Returns the <code>index</code>th item in the collection. If
- * <code>index</code> is greater than or equal to the number of nodes in
- * the list, this returns <code>null</code>.
- * @param index Index into the collection.
- * @return The node at the <code>index</code>th position in the
- * <code>NodeList</code>, or <code>null</code> if that is not a valid
- * index.
- */
- public Node item(int index) {
- int handle=m_firstChild;
- while(--index>=0 && handle!=DTM.NULL) {
- handle=m_parentDTM.getNextSibling(handle);
- }
- if (handle == DTM.NULL) {
- return null;
- }
- return m_parentDTM.getNode(handle);
- }
-
- /**
- * The number of nodes in the list. The range of valid child node indices
- * is 0 to <code>length-1</code> inclusive.
- */
- public int getLength() {
- int count=0;
- for (int handle=m_firstChild;
- handle!=DTM.NULL;
- handle=m_parentDTM.getNextSibling(handle)) {
- ++count;
- }
- return count;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/dtm/ref/DTMDefaultBase.java b/src/com/sun/org/apache/xml/internal/dtm/ref/DTMDefaultBase.java
deleted file mode 100644
index 58fae69..0000000
--- a/src/com/sun/org/apache/xml/internal/dtm/ref/DTMDefaultBase.java
+++ /dev/null
@@ -1,2371 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DTMDefaultBase.java,v 1.3 2005/09/28 13:48:52 pvedula Exp $
- */
-package com.sun.org.apache.xml.internal.dtm.ref;
-
-import com.sun.org.apache.xml.internal.dtm.*;
-import com.sun.org.apache.xml.internal.utils.SuballocatedIntVector;
-import com.sun.org.apache.xml.internal.utils.BoolStack;
-
-import java.util.Vector;
-
-import javax.xml.transform.Source;
-
-import com.sun.org.apache.xml.internal.utils.XMLString;
-import com.sun.org.apache.xml.internal.utils.XMLStringFactory;
-
-import com.sun.org.apache.xml.internal.res.XMLMessages;
-import com.sun.org.apache.xml.internal.res.XMLErrorResources;
-
-import java.io.*; // for dumpDTM
-
-/**
- * The <code>DTMDefaultBase</code> class serves as a helper base for DTMs.
- * It sets up structures for navigation and type, while leaving data
- * management and construction to the derived classes.
- */
-public abstract class DTMDefaultBase implements DTM
-{
- static final boolean JJK_DEBUG=false;
-
- // This constant is likely to be removed in the future. Use the
- // getDocument() method instead of ROOTNODE to get at the root
- // node of a DTM.
- /** The identity of the root node. */
- public static final int ROOTNODE = 0;
-
- /**
- * The number of nodes, which is also used to determine the next
- * node index.
- */
- protected int m_size = 0;
-
- /** The expanded names, one array element for each node. */
- protected SuballocatedIntVector m_exptype;
-
- /** First child values, one array element for each node. */
- protected SuballocatedIntVector m_firstch;
-
- /** Next sibling values, one array element for each node. */
- protected SuballocatedIntVector m_nextsib;
-
- /** Previous sibling values, one array element for each node. */
- protected SuballocatedIntVector m_prevsib;
-
- /** Previous sibling values, one array element for each node. */
- protected SuballocatedIntVector m_parent;
-
- /** Vector of SuballocatedIntVectors of NS decl sets */
- protected Vector m_namespaceDeclSets = null;
-
- /** SuballocatedIntVector of elements at which corresponding
- * namespaceDeclSets were defined */
- protected SuballocatedIntVector m_namespaceDeclSetElements = null;
-
- /**
- * These hold indexes to elements based on namespace and local name.
- * The base lookup is the the namespace. The second lookup is the local
- * name, and the last array contains the the first free element
- * at the start, and the list of element handles following.
- */
- protected int[][][] m_elemIndexes;
-
- /** The default block size of the node arrays */
- public static final int DEFAULT_BLOCKSIZE = 512; // favor small docs.
-
- /** The number of blocks for the node arrays */
- public static final int DEFAULT_NUMBLOCKS = 32;
-
- /** The number of blocks used for small documents & RTFs */
- public static final int DEFAULT_NUMBLOCKS_SMALL = 4;
-
- /** The block size of the node arrays */
- //protected final int m_blocksize;
-
- /**
- * The value to use when the information has not been built yet.
- */
- protected static final int NOTPROCESSED = DTM.NULL - 1;
-
- /**
- * The DTM manager who "owns" this DTM.
- */
-
- public DTMManager m_mgr;
-
- /**
- * m_mgr cast to DTMManagerDefault, or null if it isn't an instance
- * (Efficiency hook)
- */
- protected DTMManagerDefault m_mgrDefault=null;
-
-
- /** The document identity number(s). If we have overflowed the addressing
- * range of the first that was assigned to us, we may add others. */
- protected SuballocatedIntVector m_dtmIdent;
-
- /** The mask for the identity.
- %REVIEW% Should this really be set to the _DEFAULT? What if
- a particular DTM wanted to use another value? */
- //protected final static int m_mask = DTMManager.IDENT_NODE_DEFAULT;
-
- /** The base URI for this document. */
- protected String m_documentBaseURI;
-
- /**
- * The whitespace filter that enables elements to strip whitespace or not.
- */
- protected DTMWSFilter m_wsfilter;
-
- /** Flag indicating whether to strip whitespace nodes */
- protected boolean m_shouldStripWS = false;
-
- /** Stack of flags indicating whether to strip whitespace nodes */
- protected BoolStack m_shouldStripWhitespaceStack;
-
- /** The XMLString factory for creating XMLStrings. */
- protected XMLStringFactory m_xstrf;
-
- /**
- * The table for exandedNameID lookups. This may or may not be the same
- * table as is contained in the DTMManagerDefault.
- */
- protected ExpandedNameTable m_expandedNameTable;
-
- /** true if indexing is turned on. */
- protected boolean m_indexing;
-
- /**
- * Construct a DTMDefaultBase object using the default block size.
- *
- * @param mgr The DTMManager who owns this DTM.
- * @param source The object that is used to specify the construction source.
- * @param dtmIdentity The DTM identity ID for this DTM.
- * @param whiteSpaceFilter The white space filter for this DTM, which may
- * be null.
- * @param xstringfactory The factory to use for creating XMLStrings.
- * @param doIndexing true if the caller considers it worth it to use
- * indexing schemes.
- */
- public DTMDefaultBase(DTMManager mgr, Source source, int dtmIdentity,
- DTMWSFilter whiteSpaceFilter,
- XMLStringFactory xstringfactory, boolean doIndexing)
- {
- this(mgr, source, dtmIdentity, whiteSpaceFilter, xstringfactory,
- doIndexing, DEFAULT_BLOCKSIZE, true, false);
- }
-
- /**
- * Construct a DTMDefaultBase object from a DOM node.
- *
- * @param mgr The DTMManager who owns this DTM.
- * @param source The object that is used to specify the construction source.
- * @param dtmIdentity The DTM identity ID for this DTM.
- * @param whiteSpaceFilter The white space filter for this DTM, which may
- * be null.
- * @param xstringfactory The factory to use for creating XMLStrings.
- * @param doIndexing true if the caller considers it worth it to use
- * indexing schemes.
- * @param blocksize The block size of the DTM.
- * @param usePrevsib true if we want to build the previous sibling node array.
- * @param newNameTable true if we want to use a new ExpandedNameTable for this DTM.
- */
- public DTMDefaultBase(DTMManager mgr, Source source, int dtmIdentity,
- DTMWSFilter whiteSpaceFilter,
- XMLStringFactory xstringfactory, boolean doIndexing,
- int blocksize, boolean usePrevsib,
- boolean newNameTable)
- {
- // Use smaller sizes for the internal node arrays if the block size
- // is small.
- int numblocks;
- if (blocksize <= 64)
- {
- numblocks = DEFAULT_NUMBLOCKS_SMALL;
- m_dtmIdent= new SuballocatedIntVector(4, 1);
- }
- else
- {
- numblocks = DEFAULT_NUMBLOCKS;
- m_dtmIdent= new SuballocatedIntVector(32);
- }
-
- m_exptype = new SuballocatedIntVector(blocksize, numblocks);
- m_firstch = new SuballocatedIntVector(blocksize, numblocks);
- m_nextsib = new SuballocatedIntVector(blocksize, numblocks);
- m_parent = new SuballocatedIntVector(blocksize, numblocks);
-
- // Only create the m_prevsib array if the usePrevsib flag is true.
- // Some DTM implementations (e.g. SAXImpl) do not need this array.
- // We can save the time to build it in those cases.
- if (usePrevsib)
- m_prevsib = new SuballocatedIntVector(blocksize, numblocks);
-
- m_mgr = mgr;
- if(mgr instanceof DTMManagerDefault)
- m_mgrDefault=(DTMManagerDefault)mgr;
-
- m_documentBaseURI = (null != source) ? source.getSystemId() : null;
- m_dtmIdent.setElementAt(dtmIdentity,0);
- m_wsfilter = whiteSpaceFilter;
- m_xstrf = xstringfactory;
- m_indexing = doIndexing;
-
- if (doIndexing)
- {
- m_expandedNameTable = new ExpandedNameTable();
- }
- else
- {
- // Note that this fails if we aren't talking to an instance of
- // DTMManagerDefault
- m_expandedNameTable = m_mgrDefault.getExpandedNameTable(this);
- }
-
- if (null != whiteSpaceFilter)
- {
- m_shouldStripWhitespaceStack = new BoolStack();
-
- pushShouldStripWhitespace(false);
- }
- }
-
- /**
- * Ensure that the size of the element indexes can hold the information.
- *
- * @param namespaceID Namespace ID index.
- * @param LocalNameID Local name ID.
- */
- protected void ensureSizeOfIndex(int namespaceID, int LocalNameID)
- {
-
- if (null == m_elemIndexes)
- {
- m_elemIndexes = new int[namespaceID + 20][][];
- }
- else if (m_elemIndexes.length <= namespaceID)
- {
- int[][][] indexes = m_elemIndexes;
-
- m_elemIndexes = new int[namespaceID + 20][][];
-
- System.arraycopy(indexes, 0, m_elemIndexes, 0, indexes.length);
- }
-
- int[][] localNameIndex = m_elemIndexes[namespaceID];
-
- if (null == localNameIndex)
- {
- localNameIndex = new int[LocalNameID + 100][];
- m_elemIndexes[namespaceID] = localNameIndex;
- }
- else if (localNameIndex.length <= LocalNameID)
- {
- int[][] indexes = localNameIndex;
-
- localNameIndex = new int[LocalNameID + 100][];
-
- System.arraycopy(indexes, 0, localNameIndex, 0, indexes.length);
-
- m_elemIndexes[namespaceID] = localNameIndex;
- }
-
- int[] elemHandles = localNameIndex[LocalNameID];
-
- if (null == elemHandles)
- {
- elemHandles = new int[128];
- localNameIndex[LocalNameID] = elemHandles;
- elemHandles[0] = 1;
- }
- else if (elemHandles.length <= elemHandles[0] + 1)
- {
- int[] indexes = elemHandles;
-
- elemHandles = new int[elemHandles[0] + 1024];
-
- System.arraycopy(indexes, 0, elemHandles, 0, indexes.length);
-
- localNameIndex[LocalNameID] = elemHandles;
- }
- }
-
- /**
- * Add a node to the element indexes. The node will not be added unless
- * it's an element.
- *
- * @param expandedTypeID The expanded type ID of the node.
- * @param identity The node identity index.
- */
- protected void indexNode(int expandedTypeID, int identity)
- {
-
- ExpandedNameTable ent = m_expandedNameTable;
- short type = ent.getType(expandedTypeID);
-
- if (DTM.ELEMENT_NODE == type)
- {
- int namespaceID = ent.getNamespaceID(expandedTypeID);
- int localNameID = ent.getLocalNameID(expandedTypeID);
-
- ensureSizeOfIndex(namespaceID, localNameID);
-
- int[] index = m_elemIndexes[namespaceID][localNameID];
-
- index[index[0]] = identity;
-
- index[0]++;
- }
- }
-
- /**
- * Find the first index that occurs in the list that is greater than or
- * equal to the given value.
- *
- * @param list A list of integers.
- * @param start The start index to begin the search.
- * @param len The number of items to search.
- * @param value Find the slot that has a value that is greater than or
- * identical to this argument.
- *
- * @return The index in the list of the slot that is higher or identical
- * to the identity argument, or -1 if no node is higher or equal.
- */
- protected int findGTE(int[] list, int start, int len, int value)
- {
-
- int low = start;
- int high = start + (len - 1);
- int end = high;
-
- while (low <= high)
- {
- int mid = (low + high) / 2;
- int c = list[mid];
-
- if (c > value)
- high = mid - 1;
- else if (c < value)
- low = mid + 1;
- else
- return mid;
- }
-
- return (low <= end && list[low] > value) ? low : -1;
- }
-
- /**
- * Find the first matching element from the index at or after the
- * given node.
- *
- * @param nsIndex The namespace index lookup.
- * @param lnIndex The local name index lookup.
- * @param firstPotential The first potential match that is worth looking at.
- *
- * @return The first node that is greater than or equal to the
- * firstPotential argument, or DTM.NOTPROCESSED if not found.
- */
- int findElementFromIndex(int nsIndex, int lnIndex, int firstPotential)
- {
-
- int[][][] indexes = m_elemIndexes;
-
- if (null != indexes && nsIndex < indexes.length)
- {
- int[][] lnIndexs = indexes[nsIndex];
-
- if (null != lnIndexs && lnIndex < lnIndexs.length)
- {
- int[] elems = lnIndexs[lnIndex];
-
- if (null != elems)
- {
- int pos = findGTE(elems, 1, elems[0], firstPotential);
-
- if (pos > -1)
- {
- return elems[pos];
- }
- }
- }
- }
-
- return NOTPROCESSED;
- }
-
- /**
- * Get the next node identity value in the list, and call the iterator
- * if it hasn't been added yet.
- *
- * @param identity The node identity (index).
- * @return identity+1, or DTM.NULL.
- */
- protected abstract int getNextNodeIdentity(int identity);
-
- /**
- * This method should try and build one or more nodes in the table.
- *
- * @return The true if a next node is found or false if
- * there are no more nodes.
- */
- protected abstract boolean nextNode();
-
- /**
- * Get the number of nodes that have been added.
- *
- * @return the number of nodes that have been mapped.
- */
- protected abstract int getNumberOfNodes();
-
- /** Stateless axis traversers, lazely built. */
- protected DTMAxisTraverser[] m_traversers;
-
-// /**
-// * Ensure that the size of the information arrays can hold another entry
-// * at the given index.
-// *
-// * @param index On exit from this function, the information arrays sizes must be
-// * at least index+1.
-// */
-// protected void ensureSize(int index)
-// {
-// // We've cut over to Suballocated*Vector, which are self-sizing.
-// }
-
- /**
- * Get the simple type ID for the given node identity.
- *
- * @param identity The node identity.
- *
- * @return The simple type ID, or DTM.NULL.
- */
- protected short _type(int identity)
- {
-
- int info = _exptype(identity);
-
- if (NULL != info)
- return m_expandedNameTable.getType(info);
- else
- return NULL;
- }
-
- /**
- * Get the expanded type ID for the given node identity.
- *
- * @param identity The node identity.
- *
- * @return The expanded type ID, or DTM.NULL.
- */
- protected int _exptype(int identity)
- {
- if (identity == DTM.NULL)
- return NULL;
- // Reorganized test and loop into single flow
- // Tiny performance improvement, saves a few bytes of code, clearer.
- // %OPT% Other internal getters could be treated simliarly
- while (identity>=m_size)
- {
- if (!nextNode() && identity >= m_size)
- return NULL;
- }
- return m_exptype.elementAt(identity);
-
- }
-
- /**
- * Get the level in the tree for the given node identity.
- *
- * @param identity The node identity.
- *
- * @return The tree level, or DTM.NULL.
- */
- protected int _level(int identity)
- {
- while (identity>=m_size)
- {
- boolean isMore = nextNode();
- if (!isMore && identity >= m_size)
- return NULL;
- }
-
- int i=0;
- while(NULL != (identity=_parent(identity)))
- ++i;
- return i;
- }
-
- /**
- * Get the first child for the given node identity.
- *
- * @param identity The node identity.
- *
- * @return The first child identity, or DTM.NULL.
- */
- protected int _firstch(int identity)
- {
-
- // Boiler-plate code for each of the _xxx functions, except for the array.
- int info = (identity >= m_size) ? NOTPROCESSED : m_firstch.elementAt(identity);
-
- // Check to see if the information requested has been processed, and,
- // if not, advance the iterator until we the information has been
- // processed.
- while (info == NOTPROCESSED)
- {
- boolean isMore = nextNode();
-
- if (identity >= m_size &&!isMore)
- return NULL;
- else
- {
- info = m_firstch.elementAt(identity);
- if(info == NOTPROCESSED && !isMore)
- return NULL;
- }
- }
-
- return info;
- }
-
- /**
- * Get the next sibling for the given node identity.
- *
- * @param identity The node identity.
- *
- * @return The next sibling identity, or DTM.NULL.
- */
- protected int _nextsib(int identity)
- {
- // Boiler-plate code for each of the _xxx functions, except for the array.
- int info = (identity >= m_size) ? NOTPROCESSED : m_nextsib.elementAt(identity);
-
- // Check to see if the information requested has been processed, and,
- // if not, advance the iterator until we the information has been
- // processed.
- while (info == NOTPROCESSED)
- {
- boolean isMore = nextNode();
-
- if (identity >= m_size &&!isMore)
- return NULL;
- else
- {
- info = m_nextsib.elementAt(identity);
- if(info == NOTPROCESSED && !isMore)
- return NULL;
- }
- }
-
- return info;
- }
-
- /**
- * Get the previous sibling for the given node identity.
- *
- * @param identity The node identity.
- *
- * @return The previous sibling identity, or DTM.NULL.
- */
- protected int _prevsib(int identity)
- {
-
- if (identity < m_size)
- return m_prevsib.elementAt(identity);
-
- // Check to see if the information requested has been processed, and,
- // if not, advance the iterator until we the information has been
- // processed.
- while (true)
- {
- boolean isMore = nextNode();
-
- if (identity >= m_size && !isMore)
- return NULL;
- else if (identity < m_size)
- return m_prevsib.elementAt(identity);
- }
- }
-
- /**
- * Get the parent for the given node identity.
- *
- * @param identity The node identity.
- *
- * @return The parent identity, or DTM.NULL.
- */
- protected int _parent(int identity)
- {
-
- if (identity < m_size)
- return m_parent.elementAt(identity);
-
- // Check to see if the information requested has been processed, and,
- // if not, advance the iterator until we the information has been
- // processed.
- while (true)
- {
- boolean isMore = nextNode();
-
- if (identity >= m_size && !isMore)
- return NULL;
- else if (identity < m_size)
- return m_parent.elementAt(identity);
- }
- }
-
- /**
- * Diagnostics function to dump the DTM.
- */
- public void dumpDTM(OutputStream os)
- {
- try
- {
- if(os==null)
- {
- File f = new File("DTMDump"+((Object)this).hashCode()+".txt");
- System.err.println("Dumping... "+f.getAbsolutePath());
- os=new FileOutputStream(f);
- }
- PrintStream ps = new PrintStream(os);
-
- while (nextNode()){}
-
- int nRecords = m_size;
-
- ps.println("Total nodes: " + nRecords);
-
- for (int index = 0; index < nRecords; ++index)
- {
- int i=makeNodeHandle(index);
- ps.println("=========== index=" + index + " handle=" + i + " ===========");
- ps.println("NodeName: " + getNodeName(i));
- ps.println("NodeNameX: " + getNodeNameX(i));
- ps.println("LocalName: " + getLocalName(i));
- ps.println("NamespaceURI: " + getNamespaceURI(i));
- ps.println("Prefix: " + getPrefix(i));
-
- int exTypeID = _exptype(index);
-
- ps.println("Expanded Type ID: "
- + Integer.toHexString(exTypeID));
-
- int type = _type(index);
- String typestring;
-
- switch (type)
- {
- case DTM.ATTRIBUTE_NODE :
- typestring = "ATTRIBUTE_NODE";
- break;
- case DTM.CDATA_SECTION_NODE :
- typestring = "CDATA_SECTION_NODE";
- break;
- case DTM.COMMENT_NODE :
- typestring = "COMMENT_NODE";
- break;
- case DTM.DOCUMENT_FRAGMENT_NODE :
- typestring = "DOCUMENT_FRAGMENT_NODE";
- break;
- case DTM.DOCUMENT_NODE :
- typestring = "DOCUMENT_NODE";
- break;
- case DTM.DOCUMENT_TYPE_NODE :
- typestring = "DOCUMENT_NODE";
- break;
- case DTM.ELEMENT_NODE :
- typestring = "ELEMENT_NODE";
- break;
- case DTM.ENTITY_NODE :
- typestring = "ENTITY_NODE";
- break;
- case DTM.ENTITY_REFERENCE_NODE :
- typestring = "ENTITY_REFERENCE_NODE";
- break;
- case DTM.NAMESPACE_NODE :
- typestring = "NAMESPACE_NODE";
- break;
- case DTM.NOTATION_NODE :
- typestring = "NOTATION_NODE";
- break;
- case DTM.NULL :
- typestring = "NULL";
- break;
- case DTM.PROCESSING_INSTRUCTION_NODE :
- typestring = "PROCESSING_INSTRUCTION_NODE";
- break;
- case DTM.TEXT_NODE :
- typestring = "TEXT_NODE";
- break;
- default :
- typestring = "Unknown!";
- break;
- }
-
- ps.println("Type: " + typestring);
-
- int firstChild = _firstch(index);
-
- if (DTM.NULL == firstChild)
- ps.println("First child: DTM.NULL");
- else if (NOTPROCESSED == firstChild)
- ps.println("First child: NOTPROCESSED");
- else
- ps.println("First child: " + firstChild);
-
- if (m_prevsib != null)
- {
- int prevSibling = _prevsib(index);
-
- if (DTM.NULL == prevSibling)
- ps.println("Prev sibling: DTM.NULL");
- else if (NOTPROCESSED == prevSibling)
- ps.println("Prev sibling: NOTPROCESSED");
- else
- ps.println("Prev sibling: " + prevSibling);
- }
-
- int nextSibling = _nextsib(index);
-
- if (DTM.NULL == nextSibling)
- ps.println("Next sibling: DTM.NULL");
- else if (NOTPROCESSED == nextSibling)
- ps.println("Next sibling: NOTPROCESSED");
- else
- ps.println("Next sibling: " + nextSibling);
-
- int parent = _parent(index);
-
- if (DTM.NULL == parent)
- ps.println("Parent: DTM.NULL");
- else if (NOTPROCESSED == parent)
- ps.println("Parent: NOTPROCESSED");
- else
- ps.println("Parent: " + parent);
-
- int level = _level(index);
-
- ps.println("Level: " + level);
- ps.println("Node Value: " + getNodeValue(i));
- ps.println("String Value: " + getStringValue(i));
- }
- }
- catch(IOException ioe)
- {
- ioe.printStackTrace(System.err);
- throw new RuntimeException(ioe.getMessage());
- }
- }
-
- /**
- * Diagnostics function to dump a single node.
- *
- * %REVIEW% KNOWN GLITCH: If you pass it a node index rather than a
- * node handle, it works just fine... but the displayed identity
- * number before the colon is different, which complicates comparing
- * it with nodes printed the other way. We could always OR the DTM ID
- * into the value, to suppress that distinction...
- *
- * %REVIEW% This might want to be moved up to DTMDefaultBase, or possibly
- * DTM itself, since it's a useful diagnostic and uses only DTM's public
- * APIs.
- */
- public String dumpNode(int nodeHandle)
- {
- if(nodeHandle==DTM.NULL)
- return "[null]";
-
- String typestring;
- switch (getNodeType(nodeHandle))
- {
- case DTM.ATTRIBUTE_NODE :
- typestring = "ATTR";
- break;
- case DTM.CDATA_SECTION_NODE :
- typestring = "CDATA";
- break;
- case DTM.COMMENT_NODE :
- typestring = "COMMENT";
- break;
- case DTM.DOCUMENT_FRAGMENT_NODE :
- typestring = "DOC_FRAG";
- break;
- case DTM.DOCUMENT_NODE :
- typestring = "DOC";
- break;
- case DTM.DOCUMENT_TYPE_NODE :
- typestring = "DOC_TYPE";
- break;
- case DTM.ELEMENT_NODE :
- typestring = "ELEMENT";
- break;
- case DTM.ENTITY_NODE :
- typestring = "ENTITY";
- break;
- case DTM.ENTITY_REFERENCE_NODE :
- typestring = "ENT_REF";
- break;
- case DTM.NAMESPACE_NODE :
- typestring = "NAMESPACE";
- break;
- case DTM.NOTATION_NODE :
- typestring = "NOTATION";
- break;
- case DTM.NULL :
- typestring = "null";
- break;
- case DTM.PROCESSING_INSTRUCTION_NODE :
- typestring = "PI";
- break;
- case DTM.TEXT_NODE :
- typestring = "TEXT";
- break;
- default :
- typestring = "Unknown!";
- break;
- }
-
- return "[" + nodeHandle + ": " + typestring +
- "(0x" + Integer.toHexString(getExpandedTypeID(nodeHandle)) + ") " +
- getNodeNameX(nodeHandle) + " {" + getNamespaceURI(nodeHandle) + "}" +
- "=\"" + getNodeValue(nodeHandle) + "\"]";
- }
-
- // ========= DTM Implementation Control Functions. ==============
-
- /**
- * Set an implementation dependent feature.
- * <p>
- * %REVIEW% Do we really expect to set features on DTMs?
- *
- * @param featureId A feature URL.
- * @param state true if this feature should be on, false otherwise.
- */
- public void setFeature(String featureId, boolean state){}
-
- // ========= Document Navigation Functions =========
-
- /**
- * Given a node handle, test if it has child nodes.
- * <p> %REVIEW% This is obviously useful at the DOM layer, where it
- * would permit testing this without having to create a proxy
- * node. It's less useful in the DTM API, where
- * (dtm.getFirstChild(nodeHandle)!=DTM.NULL) is just as fast and
- * almost as self-evident. But it's a convenience, and eases porting
- * of DOM code to DTM. </p>
- *
- * @param nodeHandle int Handle of the node.
- * @return int true if the given node has child nodes.
- */
- public boolean hasChildNodes(int nodeHandle)
- {
-
- int identity = makeNodeIdentity(nodeHandle);
- int firstChild = _firstch(identity);
-
- return firstChild != DTM.NULL;
- }
-
- /** Given a node identity, return a node handle. If extended addressing
- * has been used (multiple DTM IDs), we need to map the high bits of the
- * identity into the proper DTM ID.
- *
- * This has been made FINAL to facilitate inlining, since we do not expect
- * any subclass of DTMDefaultBase to ever change the algorithm. (I don't
- * really like doing so, and would love to have an excuse not to...)
- *
- * %REVIEW% Is it worth trying to specialcase small documents?
- * %REVIEW% Should this be exposed at the package/public layers?
- *
- * @param nodeIdentity Internal offset to this node's records.
- * @return NodeHandle (external representation of node)
- * */
- final public int makeNodeHandle(int nodeIdentity)
- {
- if(NULL==nodeIdentity) return NULL;
-
- if(JJK_DEBUG && nodeIdentity>DTMManager.IDENT_NODE_DEFAULT)
- System.err.println("GONK! (only useful in limited situations)");
-
- return m_dtmIdent.elementAt(nodeIdentity >>> DTMManager.IDENT_DTM_NODE_BITS)
- + (nodeIdentity & DTMManager.IDENT_NODE_DEFAULT) ;
- }
-
- /** Given a node handle, return a node identity. If extended addressing
- * has been used (multiple DTM IDs), we need to map the high bits of the
- * identity into the proper DTM ID and thence find the proper offset
- * to add to the low bits of the identity
- *
- * This has been made FINAL to facilitate inlining, since we do not expect
- * any subclass of DTMDefaultBase to ever change the algorithm. (I don't
- * really like doing so, and would love to have an excuse not to...)
- *
- * %OPT% Performance is critical for this operation.
- *
- * %REVIEW% Should this be exposed at the package/public layers?
- *
- * @param nodeHandle (external representation of node)
- * @return nodeIdentity Internal offset to this node's records.
- * */
- final public int makeNodeIdentity(int nodeHandle)
- {
- if(NULL==nodeHandle) return NULL;
-
- if(m_mgrDefault!=null)
- {
- // Optimization: use the DTMManagerDefault's fast DTMID-to-offsets
- // table. I'm not wild about this solution but this operation
- // needs need extreme speed.
-
- int whichDTMindex=nodeHandle>>>DTMManager.IDENT_DTM_NODE_BITS;
-
- // %REVIEW% Wish I didn't have to perform the pre-test, but
- // someone is apparently asking DTMs whether they contain nodes
- // which really don't belong to them. That's probably a bug
- // which should be fixed, but until it is:
- if(m_mgrDefault.m_dtms[whichDTMindex]!=this)
- return NULL;
- else
- return
- m_mgrDefault.m_dtm_offsets[whichDTMindex]
- | (nodeHandle & DTMManager.IDENT_NODE_DEFAULT);
- }
-
- int whichDTMid=m_dtmIdent.indexOf(nodeHandle & DTMManager.IDENT_DTM_DEFAULT);
- return (whichDTMid==NULL)
- ? NULL
- : (whichDTMid << DTMManager.IDENT_DTM_NODE_BITS)
- + (nodeHandle & DTMManager.IDENT_NODE_DEFAULT);
- }
-
-
- /**
- * Given a node handle, get the handle of the node's first child.
- * If not yet resolved, waits for more nodes to be added to the document and
- * tries again.
- *
- * @param nodeHandle int Handle of the node.
- * @return int DTM node-number of first child, or DTM.NULL to indicate none exists.
- */
- public int getFirstChild(int nodeHandle)
- {
-
- int identity = makeNodeIdentity(nodeHandle);
- int firstChild = _firstch(identity);
-
- return makeNodeHandle(firstChild);
- }
-
- /**
- * Given a node handle, get the handle of the node's first child.
- * If not yet resolved, waits for more nodes to be added to the document and
- * tries again.
- *
- * @param nodeHandle int Handle of the node.
- * @return int DTM node-number of first child, or DTM.NULL to indicate none exists.
- */
- public int getTypedFirstChild(int nodeHandle, int nodeType)
- {
-
- int firstChild, eType;
- if (nodeType < DTM.NTYPES) {
- for (firstChild = _firstch(makeNodeIdentity(nodeHandle));
- firstChild != DTM.NULL;
- firstChild = _nextsib(firstChild)) {
- eType = _exptype(firstChild);
- if (eType == nodeType
- || (eType >= DTM.NTYPES
- && m_expandedNameTable.getType(eType) == nodeType)) {
- return makeNodeHandle(firstChild);
- }
- }
- } else {
- for (firstChild = _firstch(makeNodeIdentity(nodeHandle));
- firstChild != DTM.NULL;
- firstChild = _nextsib(firstChild)) {
- if (_exptype(firstChild) == nodeType) {
- return makeNodeHandle(firstChild);
- }
- }
- }
- return DTM.NULL;
- }
-
- /**
- * Given a node handle, advance to its last child.
- * If not yet resolved, waits for more nodes to be added to the document and
- * tries again.
- *
- * @param nodeHandle int Handle of the node.
- * @return int Node-number of last child,
- * or DTM.NULL to indicate none exists.
- */
- public int getLastChild(int nodeHandle)
- {
-
- int identity = makeNodeIdentity(nodeHandle);
- int child = _firstch(identity);
- int lastChild = DTM.NULL;
-
- while (child != DTM.NULL)
- {
- lastChild = child;
- child = _nextsib(child);
- }
-
- return makeNodeHandle(lastChild);
- }
-
- /**
- * Retrieves an attribute node by by qualified name and namespace URI.
- *
- * @param nodeHandle int Handle of the node upon which to look up this attribute..
- * @param namespaceURI The namespace URI of the attribute to
- * retrieve, or null.
- * @param name The local name of the attribute to
- * retrieve.
- * @return The attribute node handle with the specified name (
- * <code>nodeName</code>) or <code>DTM.NULL</code> if there is no such
- * attribute.
- */
- public abstract int getAttributeNode(int nodeHandle, String namespaceURI,
- String name);
-
- /**
- * Given a node handle, get the index of the node's first attribute.
- *
- * @param nodeHandle int Handle of the node.
- * @return Handle of first attribute, or DTM.NULL to indicate none exists.
- */
- public int getFirstAttribute(int nodeHandle)
- {
- int nodeID = makeNodeIdentity(nodeHandle);
-
- return makeNodeHandle(getFirstAttributeIdentity(nodeID));
- }
-
- /**
- * Given a node identity, get the index of the node's first attribute.
- *
- * @param identity int identity of the node.
- * @return Identity of first attribute, or DTM.NULL to indicate none exists.
- */
- protected int getFirstAttributeIdentity(int identity) {
- int type = _type(identity);
-
- if (DTM.ELEMENT_NODE == type)
- {
- // Assume that attributes and namespaces immediately follow the element.
- while (DTM.NULL != (identity = getNextNodeIdentity(identity)))
- {
-
- // Assume this can not be null.
- type = _type(identity);
-
- if (type == DTM.ATTRIBUTE_NODE)
- {
- return identity;
- }
- else if (DTM.NAMESPACE_NODE != type)
- {
- break;
- }
- }
- }
-
- return DTM.NULL;
- }
-
- /**
- * Given a node handle and an expanded type ID, get the index of the node's
- * attribute of that type, if any.
- *
- * @param nodeHandle int Handle of the node.
- * @param attType int expanded type ID of the required attribute.
- * @return Handle of attribute of the required type, or DTM.NULL to indicate
- * none exists.
- */
- protected int getTypedAttribute(int nodeHandle, int attType) {
- int type = getNodeType(nodeHandle);
- if (DTM.ELEMENT_NODE == type) {
- int identity = makeNodeIdentity(nodeHandle);
-
- while (DTM.NULL != (identity = getNextNodeIdentity(identity)))
- {
- type = _type(identity);
-
- if (type == DTM.ATTRIBUTE_NODE)
- {
- if (_exptype(identity) == attType) return makeNodeHandle(identity);
- }
- else if (DTM.NAMESPACE_NODE != type)
- {
- break;
- }
- }
- }
-
- return DTM.NULL;
- }
-
- /**
- * Given a node handle, advance to its next sibling.
- * If not yet resolved, waits for more nodes to be added to the document and
- * tries again.
- * @param nodeHandle int Handle of the node.
- * @return int Node-number of next sibling,
- * or DTM.NULL to indicate none exists.
- */
- public int getNextSibling(int nodeHandle)
- {
- if (nodeHandle == DTM.NULL)
- return DTM.NULL;
- return makeNodeHandle(_nextsib(makeNodeIdentity(nodeHandle)));
- }
-
- /**
- * Given a node handle, advance to its next sibling.
- * If not yet resolved, waits for more nodes to be added to the document and
- * tries again.
- * @param nodeHandle int Handle of the node.
- * @return int Node-number of next sibling,
- * or DTM.NULL to indicate none exists.
- */
- public int getTypedNextSibling(int nodeHandle, int nodeType)
- {
- if (nodeHandle == DTM.NULL)
- return DTM.NULL;
- int node = makeNodeIdentity(nodeHandle);
- int eType;
- while ((node = _nextsib(node)) != DTM.NULL &&
- ((eType = _exptype(node)) != nodeType &&
- m_expandedNameTable.getType(eType)!= nodeType));
- //_type(node) != nodeType));
-
- return (node == DTM.NULL ? DTM.NULL : makeNodeHandle(node));
- }
-
- /**
- * Given a node handle, find its preceeding sibling.
- * WARNING: DTM is asymmetric; this operation is resolved by search, and is
- * relatively expensive.
- *
- * @param nodeHandle the id of the node.
- * @return int Node-number of the previous sib,
- * or DTM.NULL to indicate none exists.
- */
- public int getPreviousSibling(int nodeHandle)
- {
- if (nodeHandle == DTM.NULL)
- return DTM.NULL;
-
- if (m_prevsib != null)
- return makeNodeHandle(_prevsib(makeNodeIdentity(nodeHandle)));
- else
- {
- // If the previous sibling array is not built, we get at
- // the previous sibling using the parent, firstch and
- // nextsib arrays.
- int nodeID = makeNodeIdentity(nodeHandle);
- int parent = _parent(nodeID);
- int node = _firstch(parent);
- int result = DTM.NULL;
- while (node != nodeID)
- {
- result = node;
- node = _nextsib(node);
- }
- return makeNodeHandle(result);
- }
- }
-
- /**
- * Given a node handle, advance to the next attribute.
- * If an attr, we advance to
- * the next attr on the same node. If not an attribute, we return NULL.
- *
- * @param nodeHandle int Handle of the node.
- * @return int DTM node-number of the resolved attr,
- * or DTM.NULL to indicate none exists.
- */
- public int getNextAttribute(int nodeHandle) {
- int nodeID = makeNodeIdentity(nodeHandle);
-
- if (_type(nodeID) == DTM.ATTRIBUTE_NODE) {
- return makeNodeHandle(getNextAttributeIdentity(nodeID));
- }
-
- return DTM.NULL;
- }
-
- /**
- * Given a node identity for an attribute, advance to the next attribute.
- *
- * @param identity int identity of the attribute node. This
- * <strong>must</strong> be an attribute node.
- *
- * @return int DTM node-identity of the resolved attr,
- * or DTM.NULL to indicate none exists.
- *
- */
- protected int getNextAttributeIdentity(int identity) {
- // Assume that attributes and namespace nodes immediately follow the element
- while (DTM.NULL != (identity = getNextNodeIdentity(identity))) {
- int type = _type(identity);
-
- if (type == DTM.ATTRIBUTE_NODE) {
- return identity;
- } else if (type != DTM.NAMESPACE_NODE) {
- break;
- }
- }
-
- return DTM.NULL;
- }
-
- /** Lazily created namespace lists. */
- private Vector m_namespaceLists = null; // on demand
-
-
- /** Build table of namespace declaration
- * locations during DTM construction. Table is a Vector of
- * SuballocatedIntVectors containing the namespace node HANDLES declared at
- * that ID, plus an SuballocatedIntVector of the element node INDEXES at which
- * these declarations appeared.
- *
- * NOTE: Since this occurs during model build, nodes will be encountered
- * in doucment order and thus the table will be ordered by element,
- * permitting binary-search as a possible retrieval optimization.
- *
- * %REVIEW% Directly managed arrays rather than vectors?
- * %REVIEW% Handles or IDs? Given usage, I think handles.
- * */
- protected void declareNamespaceInContext(int elementNodeIndex,int namespaceNodeIndex)
- {
- SuballocatedIntVector nsList=null;
- if(m_namespaceDeclSets==null)
- {
-
- // First
- m_namespaceDeclSetElements=new SuballocatedIntVector(32);
- m_namespaceDeclSetElements.addElement(elementNodeIndex);
- m_namespaceDeclSets=new Vector();
- nsList=new SuballocatedIntVector(32);
- m_namespaceDeclSets.addElement(nsList);
- }
- else
- {
- // Most recent. May be -1 (none) if DTM was pruned.
- // %OPT% Is there a lastElement() method? Should there be?
- int last=m_namespaceDeclSetElements.size()-1;
-
- if(last>=0 && elementNodeIndex==m_namespaceDeclSetElements.elementAt(last))
- {
- nsList=(SuballocatedIntVector)m_namespaceDeclSets.elementAt(last);
- }
- }
- if(nsList==null)
- {
- m_namespaceDeclSetElements.addElement(elementNodeIndex);
-
- SuballocatedIntVector inherited =
- findNamespaceContext(_parent(elementNodeIndex));
-
- if (inherited!=null) {
- // %OPT% Count-down might be faster, but debuggability may
- // be better this way, and if we ever decide we want to
- // keep this ordered by expanded-type...
- int isize=inherited.size();
-
- // Base the size of a new namespace list on the
- // size of the inherited list - but within reason!
- nsList=new SuballocatedIntVector(Math.max(Math.min(isize+16,2048),
- 32));
-
- for(int i=0;i<isize;++i)
- {
- nsList.addElement(inherited.elementAt(i));
- }
- } else {
- nsList=new SuballocatedIntVector(32);
- }
-
- m_namespaceDeclSets.addElement(nsList);
- }
-
- // Handle overwriting inherited.
- // %OPT% Keep sorted? (By expanded-name rather than by doc order...)
- // Downside: Would require insertElementAt if not found,
- // which has recopying costs. But these are generally short lists...
- int newEType=_exptype(namespaceNodeIndex);
-
- for(int i=nsList.size()-1;i>=0;--i)
- {
- if(newEType==getExpandedTypeID(nsList.elementAt(i)))
- {
- nsList.setElementAt(makeNodeHandle(namespaceNodeIndex),i);
- return;
- }
- }
- nsList.addElement(makeNodeHandle(namespaceNodeIndex));
- }
-
- /** Retrieve list of namespace declaration locations
- * active at this node. List is an SuballocatedIntVector whose
- * entries are the namespace node HANDLES declared at that ID.
- *
- * %REVIEW% Directly managed arrays rather than vectors?
- * %REVIEW% Handles or IDs? Given usage, I think handles.
- * */
- protected SuballocatedIntVector findNamespaceContext(int elementNodeIndex)
- {
- if (null!=m_namespaceDeclSetElements)
- {
- // %OPT% Is binary-search really saving us a lot versus linear?
- // (... It may be, in large docs with many NS decls.)
- int wouldBeAt=findInSortedSuballocatedIntVector(m_namespaceDeclSetElements,
- elementNodeIndex);
- if(wouldBeAt>=0) // Found it
- return (SuballocatedIntVector) m_namespaceDeclSets.elementAt(wouldBeAt);
- if(wouldBeAt == -1) // -1-wouldbeat == 0
- return null; // Not after anything; definitely not found
-
- // Not found, but we know where it should have been.
- // Search back until we find an ancestor or run out.
- wouldBeAt=-1-wouldBeAt;
-
- // Decrement wouldBeAt to find last possible ancestor
- int candidate=m_namespaceDeclSetElements.elementAt(-- wouldBeAt);
- int ancestor=_parent(elementNodeIndex);
-
- // Special case: if the candidate is before the given node, and
- // is in the earliest possible position in the document, it
- // must have the namespace declarations we're interested in.
- if (wouldBeAt == 0 && candidate < ancestor) {
- int rootHandle = getDocumentRoot(makeNodeHandle(elementNodeIndex));
- int rootID = makeNodeIdentity(rootHandle);
- int uppermostNSCandidateID;
-
- if (getNodeType(rootHandle) == DTM.DOCUMENT_NODE) {
- int ch = _firstch(rootID);
- uppermostNSCandidateID = (ch != DTM.NULL) ? ch : rootID;
- } else {
- uppermostNSCandidateID = rootID;
- }
-
- if (candidate == uppermostNSCandidateID) {
- return (SuballocatedIntVector)m_namespaceDeclSets.elementAt(wouldBeAt);
- }
- }
-
- while(wouldBeAt>=0 && ancestor>0)
- {
- if (candidate==ancestor) {
- // Found ancestor in list
- return (SuballocatedIntVector)m_namespaceDeclSets.elementAt(wouldBeAt);
- } else if (candidate<ancestor) {
- // Too deep in tree
- do {
- ancestor=_parent(ancestor);
- } while (candidate < ancestor);
- } else if(wouldBeAt > 0){
- // Too late in list
- candidate=m_namespaceDeclSetElements.elementAt(--wouldBeAt);
- }
- else
- break;
- }
- }
-
- return null; // No namespaces known at this node
- }
-
- /**
- * Subroutine: Locate the specified node within
- * m_namespaceDeclSetElements, or the last element which
- * preceeds it in document order
- *
- * %REVIEW% Inlne this into findNamespaceContext? Create SortedSuballocatedIntVector type?
- *
- * @return If positive or zero, the index of the found item.
- * If negative, index of the point at which it would have appeared,
- * encoded as -1-index and hence reconvertable by subtracting
- * it from -1. (Encoding because I don't want to recompare the strings
- * but don't want to burn bytes on a datatype to hold a flagged value.)
- */
- protected int findInSortedSuballocatedIntVector(SuballocatedIntVector vector, int lookfor)
- {
- // Binary search
- int i = 0;
- if(vector != null) {
- int first = 0;
- int last = vector.size() - 1;
-
- while (first <= last) {
- i = (first + last) / 2;
- int test = lookfor-vector.elementAt(i);
- if(test == 0) {
- return i; // Name found
- }
- else if (test < 0) {
- last = i - 1; // looked too late
- }
- else {
- first = i + 1; // looked ot early
- }
- }
-
- if (first > i) {
- i = first; // Clean up at loop end
- }
- }
-
- return -1 - i; // not-found has to be encoded.
- }
-
-
- /**
- * Given a node handle, get the index of the node's first child.
- * If not yet resolved, waits for more nodes to be added to the document and
- * tries again
- *
- * @param nodeHandle handle to node, which should probably be an element
- * node, but need not be.
- *
- * @param inScope true if all namespaces in scope should be returned,
- * false if only the namespace declarations should be
- * returned.
- * @return handle of first namespace, or DTM.NULL to indicate none exists.
- */
- public int getFirstNamespaceNode(int nodeHandle, boolean inScope)
- {
- if(inScope)
- {
- int identity = makeNodeIdentity(nodeHandle);
- if (_type(identity) == DTM.ELEMENT_NODE)
- {
- SuballocatedIntVector nsContext=findNamespaceContext(identity);
- if(nsContext==null || nsContext.size()<1)
- return NULL;
-
- return nsContext.elementAt(0);
- }
- else
- return NULL;
- }
- else
- {
- // Assume that attributes and namespaces immediately
- // follow the element.
- //
- // %OPT% Would things be faster if all NS nodes were built
- // before all Attr nodes? Some costs at build time for 2nd
- // pass...
- int identity = makeNodeIdentity(nodeHandle);
- if (_type(identity) == DTM.ELEMENT_NODE)
- {
- while (DTM.NULL != (identity = getNextNodeIdentity(identity)))
- {
- int type = _type(identity);
- if (type == DTM.NAMESPACE_NODE)
- return makeNodeHandle(identity);
- else if (DTM.ATTRIBUTE_NODE != type)
- break;
- }
- return NULL;
- }
- else
- return NULL;
- }
- }
-
- /**
- * Given a namespace handle, advance to the next namespace.
- *
- * @param baseHandle handle to original node from where the first namespace
- * was relative to (needed to return nodes in document order).
- * @param nodeHandle A namespace handle for which we will find the next node.
- * @param inScope true if all namespaces that are in scope should be processed,
- * otherwise just process the nodes in the given element handle.
- * @return handle of next namespace, or DTM.NULL to indicate none exists.
- */
- public int getNextNamespaceNode(int baseHandle, int nodeHandle,
- boolean inScope)
- {
- if(inScope)
- {
- //Since we've been given the base, try direct lookup
- //(could look from nodeHandle but this is at least one
- //comparison/get-parent faster)
- //SuballocatedIntVector nsContext=findNamespaceContext(nodeHandle & m_mask);
-
- SuballocatedIntVector nsContext=findNamespaceContext(makeNodeIdentity(baseHandle));
-
- if(nsContext==null)
- return NULL;
- int i=1 + nsContext.indexOf(nodeHandle);
- if(i<=0 || i==nsContext.size())
- return NULL;
-
- return nsContext.elementAt(i);
- }
- else
- {
- // Assume that attributes and namespace nodes immediately follow the element.
- int identity = makeNodeIdentity(nodeHandle);
- while (DTM.NULL != (identity = getNextNodeIdentity(identity)))
- {
- int type = _type(identity);
- if (type == DTM.NAMESPACE_NODE)
- {
- return makeNodeHandle(identity);
- }
- else if (type != DTM.ATTRIBUTE_NODE)
- {
- break;
- }
- }
- }
- return DTM.NULL;
- }
-
- /**
- * Given a node handle, find its parent node.
- *
- * @param nodeHandle the id of the node.
- * @return int Node-number of parent,
- * or DTM.NULL to indicate none exists.
- */
- public int getParent(int nodeHandle)
- {
-
- int identity = makeNodeIdentity(nodeHandle);
-
- if (identity > 0)
- return makeNodeHandle(_parent(identity));
- else
- return DTM.NULL;
- }
-
- /**
- * Find the Document node handle for the document currently under construction.
- * PLEASE NOTE that most people should use getOwnerDocument(nodeHandle) instead;
- * this version of the operation is primarily intended for use during negotiation
- * with the DTM Manager.
- *
- * @return int Node handle of document, which should always be valid.
- */
- public int getDocument()
- {
- return m_dtmIdent.elementAt(0); // makeNodeHandle(0)
- }
-
- /**
- * Given a node handle, find the owning document node. This has the exact
- * same semantics as the DOM Document method of the same name, in that if
- * the nodeHandle is a document node, it will return NULL.
- *
- * <p>%REVIEW% Since this is DOM-specific, it may belong at the DOM
- * binding layer. Included here as a convenience function and to
- * aid porting of DOM code to DTM.</p>
- *
- * @param nodeHandle the id of the node.
- * @return int Node handle of owning document, or -1 if the node was a Docment
- */
- public int getOwnerDocument(int nodeHandle)
- {
-
- if (DTM.DOCUMENT_NODE == getNodeType(nodeHandle))
- return DTM.NULL;
-
- return getDocumentRoot(nodeHandle);
- }
-
- /**
- * Given a node handle, find the owning document node. Unlike the DOM,
- * this considers the owningDocument of a Document to be itself.
- *
- * @param nodeHandle the id of the node.
- * @return int Node handle of owning document, or the nodeHandle if it is
- * a Document.
- */
- public int getDocumentRoot(int nodeHandle)
- {
- return getManager().getDTM(nodeHandle).getDocument();
- }
-
- /**
- * Get the string-value of a node as a String object
- * (see http://www.w3.org/TR/xpath#data-model
- * for the definition of a node's string-value).
- *
- * @param nodeHandle The node ID.
- *
- * @return A string object that represents the string-value of the given node.
- */
- public abstract XMLString getStringValue(int nodeHandle);
-
- /**
- * Get number of character array chunks in
- * the string-value of a node.
- * (see http://www.w3.org/TR/xpath#data-model
- * for the definition of a node's string-value).
- * Note that a single text node may have multiple text chunks.
- *
- * @param nodeHandle The node ID.
- *
- * @return number of character array chunks in
- * the string-value of a node.
- */
- public int getStringValueChunkCount(int nodeHandle)
- {
-
- // %TBD%
- error(XMLMessages.createXMLMessage(XMLErrorResources.ER_METHOD_NOT_SUPPORTED, null));//("getStringValueChunkCount not yet supported!");
-
- return 0;
- }
-
- /**
- * Get a character array chunk in the string-value of a node.
- * (see http://www.w3.org/TR/xpath#data-model
- * for the definition of a node's string-value).
- * Note that a single text node may have multiple text chunks.
- *
- * @param nodeHandle The node ID.
- * @param chunkIndex Which chunk to get.
- * @param startAndLen An array of 2 where the start position and length of
- * the chunk will be returned.
- *
- * @return The character array reference where the chunk occurs.
- */
- public char[] getStringValueChunk(int nodeHandle, int chunkIndex,
- int[] startAndLen)
- {
-
- // %TBD%
- error(XMLMessages.createXMLMessage(XMLErrorResources.ER_METHOD_NOT_SUPPORTED, null));//"getStringValueChunk not yet supported!");
-
- return null;
- }
-
- /**
- * Given a node handle, return an ID that represents the node's expanded name.
- *
- * @param nodeHandle The handle to the node in question.
- *
- * @return the expanded-name id of the node.
- */
- public int getExpandedTypeID(int nodeHandle)
- {
- // %REVIEW% This _should_ only be null if someone asked the wrong DTM about the node...
- // which one would hope would never happen...
- int id=makeNodeIdentity(nodeHandle);
- if(id==NULL)
- return NULL;
- return _exptype(id);
- }
-
- /**
- * Given an expanded name, return an ID. If the expanded-name does not
- * exist in the internal tables, the entry will be created, and the ID will
- * be returned. Any additional nodes that are created that have this
- * expanded name will use this ID.
- *
- * @param type The simple type, i.e. one of ELEMENT, ATTRIBUTE, etc.
- *
- * @param namespace The namespace URI, which may be null, may be an empty
- * string (which will be the same as null), or may be a
- * namespace URI.
- * @param localName The local name string, which must be a valid
- * <a href="http://www.w3.org/TR/REC-xml-names/">NCName</a>.
- *
- * @return the expanded-name id of the node.
- */
- public int getExpandedTypeID(String namespace, String localName, int type)
- {
-
- ExpandedNameTable ent = m_expandedNameTable;
-
- return ent.getExpandedTypeID(namespace, localName, type);
- }
-
- /**
- * Given an expanded-name ID, return the local name part.
- *
- * @param expandedNameID an ID that represents an expanded-name.
- * @return String Local name of this node.
- */
- public String getLocalNameFromExpandedNameID(int expandedNameID)
- {
- return m_expandedNameTable.getLocalName(expandedNameID);
- }
-
- /**
- * Given an expanded-name ID, return the namespace URI part.
- *
- * @param expandedNameID an ID that represents an expanded-name.
- * @return String URI value of this node's namespace, or null if no
- * namespace was resolved.
- */
- public String getNamespaceFromExpandedNameID(int expandedNameID)
- {
- return m_expandedNameTable.getNamespace(expandedNameID);
- }
-
- /**
- * Returns the namespace type of a specific node
- * @param nodeHandle the id of the node.
- * @return the ID of the namespace.
- */
- public int getNamespaceType(final int nodeHandle)
- {
-
- int identity = makeNodeIdentity(nodeHandle);
- int expandedNameID = _exptype(identity);
-
- return m_expandedNameTable.getNamespaceID(expandedNameID);
- }
-
- /**
- * Given a node handle, return its DOM-style node name. This will
- * include names such as #text or #document.
- *
- * @param nodeHandle the id of the node.
- * @return String Name of this node, which may be an empty string.
- * %REVIEW% Document when empty string is possible...
- * %REVIEW-COMMENT% It should never be empty, should it?
- */
- public abstract String getNodeName(int nodeHandle);
-
- /**
- * Given a node handle, return the XPath node name. This should be
- * the name as described by the XPath data model, NOT the DOM-style
- * name.
- *
- * @param nodeHandle the id of the node.
- * @return String Name of this node, which may be an empty string.
- */
- public String getNodeNameX(int nodeHandle)
- {
-
- /** @todo: implement this com.sun.org.apache.xml.internal.dtm.DTMDefaultBase abstract method */
- error(XMLMessages.createXMLMessage(XMLErrorResources.ER_METHOD_NOT_SUPPORTED, null));//"Not yet supported!");
-
- return null;
- }
-
- /**
- * Given a node handle, return its XPath-style localname.
- * (As defined in Namespaces, this is the portion of the name after any
- * colon character).
- *
- * @param nodeHandle the id of the node.
- * @return String Local name of this node.
- */
- public abstract String getLocalName(int nodeHandle);
-
- /**
- * Given a namespace handle, return the prefix that the namespace decl is
- * mapping.
- * Given a node handle, return the prefix used to map to the namespace.
- *
- * <p> %REVIEW% Are you sure you want "" for no prefix? </p>
- * <p> %REVIEW-COMMENT% I think so... not totally sure. -sb </p>
- *
- * @param nodeHandle the id of the node.
- * @return String prefix of this node's name, or "" if no explicit
- * namespace prefix was given.
- */
- public abstract String getPrefix(int nodeHandle);
-
- /**
- * Given a node handle, return its DOM-style namespace URI
- * (As defined in Namespaces, this is the declared URI which this node's
- * prefix -- or default in lieu thereof -- was mapped to.)
- *
- * <p>%REVIEW% Null or ""? -sb</p>
- *
- * @param nodeHandle the id of the node.
- * @return String URI value of this node's namespace, or null if no
- * namespace was resolved.
- */
- public abstract String getNamespaceURI(int nodeHandle);
-
- /**
- * Given a node handle, return its node value. This is mostly
- * as defined by the DOM, but may ignore some conveniences.
- * <p>
- *
- * @param nodeHandle The node id.
- * @return String Value of this node, or null if not
- * meaningful for this node type.
- */
- public abstract String getNodeValue(int nodeHandle);
-
- /**
- * Given a node handle, return its DOM-style node type.
- * <p>
- * %REVIEW% Generally, returning short is false economy. Return int?
- * %REVIEW% Make assumption that node has already arrived. Is OK?
- *
- * @param nodeHandle The node id.
- * @return int Node type, as per the DOM's Node._NODE constants.
- */
- public short getNodeType(int nodeHandle)
- {
- if (nodeHandle == DTM.NULL)
- return DTM.NULL;
- return m_expandedNameTable.getType(_exptype(makeNodeIdentity(nodeHandle)));
- }
-
- /**
- * Get the depth level of this node in the tree (equals 1 for
- * a parentless node).
- *
- * @param nodeHandle The node id.
- * @return the number of ancestors, plus one
- * @xsl.usage internal
- */
- public short getLevel(int nodeHandle)
- {
- // Apparently, the axis walker stuff requires levels to count from 1.
- int identity = makeNodeIdentity(nodeHandle);
- return (short) (_level(identity) + 1);
- }
-
- /**
- * Get the identity of this node in the tree
- *
- * @param nodeHandle The node handle.
- * @return the node identity
- * @xsl.usage internal
- */
- public int getNodeIdent(int nodeHandle)
- {
- /*if (nodeHandle != DTM.NULL)
- return nodeHandle & m_mask;
- else
- return DTM.NULL;*/
-
- return makeNodeIdentity(nodeHandle);
- }
-
- /**
- * Get the handle of this node in the tree
- *
- * @param nodeId The node identity.
- * @return the node handle
- * @xsl.usage internal
- */
- public int getNodeHandle(int nodeId)
- {
- /*if (nodeId != DTM.NULL)
- return nodeId | m_dtmIdent;
- else
- return DTM.NULL;*/
-
- return makeNodeHandle(nodeId);
- }
-
- // ============== Document query functions ==============
-
- /**
- * Tests whether DTM DOM implementation implements a specific feature and
- * that feature is supported by this node.
- *
- * @param feature The name of the feature to test.
- * @param version This is the version number of the feature to test.
- * If the version is not
- * specified, supporting any version of the feature will cause the
- * method to return <code>true</code>.
- * @return Returns <code>true</code> if the specified feature is
- * supported on this node, <code>false</code> otherwise.
- */
- public boolean isSupported(String feature, String version)
- {
-
- // %TBD%
- return false;
- }
-
- /**
- * Return the base URI of the document entity. If it is not known
- * (because the document was parsed from a socket connection or from
- * standard input, for example), the value of this property is unknown.
- *
- * @return the document base URI String object or null if unknown.
- */
- public String getDocumentBaseURI()
- {
- return m_documentBaseURI;
- }
-
- /**
- * Set the base URI of the document entity.
- *
- * @param baseURI the document base URI String object or null if unknown.
- */
- public void setDocumentBaseURI(String baseURI)
- {
- m_documentBaseURI = baseURI;
- }
-
- /**
- * Return the system identifier of the document entity. If
- * it is not known, the value of this property is unknown.
- *
- * @param nodeHandle The node id, which can be any valid node handle.
- * @return the system identifier String object or null if unknown.
- */
- public String getDocumentSystemIdentifier(int nodeHandle)
- {
-
- // %REVIEW% OK? -sb
- return m_documentBaseURI;
- }
-
- /**
- * Return the name of the character encoding scheme
- * in which the document entity is expressed.
- *
- * @param nodeHandle The node id, which can be any valid node handle.
- * @return the document encoding String object.
- * @xsl.usage internal
- */
- public String getDocumentEncoding(int nodeHandle)
- {
-
- // %REVIEW% OK?? -sb
- return "UTF-8";
- }
-
- /**
- * Return an indication of the standalone status of the document,
- * either "yes" or "no". This property is derived from the optional
- * standalone document declaration in the XML declaration at the
- * beginning of the document entity, and has no value if there is no
- * standalone document declaration.
- *
- * @param nodeHandle The node id, which can be any valid node handle.
- * @return the document standalone String object, either "yes", "no", or null.
- */
- public String getDocumentStandalone(int nodeHandle)
- {
- return null;
- }
-
- /**
- * Return a string representing the XML version of the document. This
- * property is derived from the XML declaration optionally present at the
- * beginning of the document entity, and has no value if there is no XML
- * declaration.
- *
- * @param documentHandle The document handle
- *
- * @return the document version String object.
- */
- public String getDocumentVersion(int documentHandle)
- {
- return null;
- }
-
- /**
- * Return an indication of
- * whether the processor has read the complete DTD. Its value is a
- * boolean. If it is false, then certain properties (indicated in their
- * descriptions below) may be unknown. If it is true, those properties
- * are never unknown.
- *
- * @return <code>true</code> if all declarations were processed;
- * <code>false</code> otherwise.
- */
- public boolean getDocumentAllDeclarationsProcessed()
- {
-
- // %REVIEW% OK?
- return true;
- }
-
- /**
- * A document type declaration information item has the following properties:
- *
- * 1. [system identifier] The system identifier of the external subset, if
- * it exists. Otherwise this property has no value.
- *
- * @return the system identifier String object, or null if there is none.
- */
- public abstract String getDocumentTypeDeclarationSystemIdentifier();
-
- /**
- * Return the public identifier of the external subset,
- * normalized as described in 4.2.2 External Entities [XML]. If there is
- * no external subset or if it has no public identifier, this property
- * has no value.
- *
- * @return the public identifier String object, or null if there is none.
- */
- public abstract String getDocumentTypeDeclarationPublicIdentifier();
-
- /**
- * Returns the <code>Element</code> whose <code>ID</code> is given by
- * <code>elementId</code>. If no such element exists, returns
- * <code>DTM.NULL</code>. Behavior is not defined if more than one element
- * has this <code>ID</code>. Attributes (including those
- * with the name "ID") are not of type ID unless so defined by DTD/Schema
- * information available to the DTM implementation.
- * Implementations that do not know whether attributes are of type ID or
- * not are expected to return <code>DTM.NULL</code>.
- *
- * <p>%REVIEW% Presumably IDs are still scoped to a single document,
- * and this operation searches only within a single document, right?
- * Wouldn't want collisions between DTMs in the same process.</p>
- *
- * @param elementId The unique <code>id</code> value for an element.
- * @return The handle of the matching element.
- */
- public abstract int getElementById(String elementId);
-
- /**
- * The getUnparsedEntityURI function returns the URI of the unparsed
- * entity with the specified name in the same document as the context
- * node (see [3.3 Unparsed Entities]). It returns the empty string if
- * there is no such entity.
- * <p>
- * XML processors may choose to use the System Identifier (if one
- * is provided) to resolve the entity, rather than the URI in the
- * Public Identifier. The details are dependent on the processor, and
- * we would have to support some form of plug-in resolver to handle
- * this properly. Currently, we simply return the System Identifier if
- * present, and hope that it a usable URI or that our caller can
- * map it to one.
- * TODO: Resolve Public Identifiers... or consider changing function name.
- * <p>
- * If we find a relative URI
- * reference, XML expects it to be resolved in terms of the base URI
- * of the document. The DOM doesn't do that for us, and it isn't
- * entirely clear whether that should be done here; currently that's
- * pushed up to a higher level of our application. (Note that DOM Level
- * 1 didn't store the document's base URI.)
- * TODO: Consider resolving Relative URIs.
- * <p>
- * (The DOM's statement that "An XML processor may choose to
- * completely expand entities before the structure model is passed
- * to the DOM" refers only to parsed entities, not unparsed, and hence
- * doesn't affect this function.)
- *
- * @param name A string containing the Entity Name of the unparsed
- * entity.
- *
- * @return String containing the URI of the Unparsed Entity, or an
- * empty string if no such entity exists.
- */
- public abstract String getUnparsedEntityURI(String name);
-
- // ============== Boolean methods ================
-
- /**
- * Return true if the xsl:strip-space or xsl:preserve-space was processed
- * during construction of the DTM document.
- *
- * @return true if this DTM supports prestripping.
- */
- public boolean supportsPreStripping()
- {
- return true;
- }
-
- /**
- * Figure out whether nodeHandle2 should be considered as being later
- * in the document than nodeHandle1, in Document Order as defined
- * by the XPath model. This may not agree with the ordering defined
- * by other XML applications.
- * <p>
- * There are some cases where ordering isn't defined, and neither are
- * the results of this function -- though we'll generally return false.
- *
- * @param nodeHandle1 Node handle to perform position comparison on.
- * @param nodeHandle2 Second Node handle to perform position comparison on .
- *
- * @return true if node1 comes before node2, otherwise return false.
- * You can think of this as
- * <code>(node1.documentOrderPosition &lt;= node2.documentOrderPosition)</code>.
- */
- public boolean isNodeAfter(int nodeHandle1, int nodeHandle2)
- {
- // These return NULL if the node doesn't belong to this document.
- int index1 = makeNodeIdentity(nodeHandle1);
- int index2 = makeNodeIdentity(nodeHandle2);
-
- return index1!=NULL && index2!=NULL && index1 <= index2;
- }
-
- /**
- * 2. [element content whitespace] A boolean indicating whether the
- * character is white space appearing within element content (see [XML],
- * 2.10 "White Space Handling"). Note that validating XML processors are
- * required by XML 1.0 to provide this information. If there is no
- * declaration for the containing element, this property has no value for
- * white space characters. If no declaration has been read, but the [all
- * declarations processed] property of the document information item is
- * false (so there may be an unread declaration), then the value of this
- * property is unknown for white space characters. It is always false for
- * characters that are not white space.
- *
- * @param nodeHandle the node ID.
- * @return <code>true</code> if the character data is whitespace;
- * <code>false</code> otherwise.
- */
- public boolean isCharacterElementContentWhitespace(int nodeHandle)
- {
-
- // %TBD%
- return false;
- }
-
- /**
- * 10. [all declarations processed] This property is not strictly speaking
- * part of the infoset of the document. Rather it is an indication of
- * whether the processor has read the complete DTD. Its value is a
- * boolean. If it is false, then certain properties (indicated in their
- * descriptions below) may be unknown. If it is true, those properties
- * are never unknown.
- *
- * @param documentHandle A node handle that must identify a document.
- * @return <code>true</code> if all declarations were processed;
- * <code>false</code> otherwise.
- */
- public boolean isDocumentAllDeclarationsProcessed(int documentHandle)
- {
- return true;
- }
-
- /**
- * 5. [specified] A flag indicating whether this attribute was actually
- * specified in the start-tag of its element, or was defaulted from the
- * DTD.
- *
- * @param attributeHandle The attribute handle in question.
- *
- * @return <code>true</code> if the attribute was specified;
- * <code>false</code> if it was defaulted.
- */
- public abstract boolean isAttributeSpecified(int attributeHandle);
-
- // ========== Direct SAX Dispatch, for optimization purposes ========
-
- /**
- * Directly call the
- * characters method on the passed ContentHandler for the
- * string-value of the given node (see http://www.w3.org/TR/xpath#data-model
- * for the definition of a node's string-value). Multiple calls to the
- * ContentHandler's characters methods may well occur for a single call to
- * this method.
- *
- * @param nodeHandle The node ID.
- * @param ch A non-null reference to a ContentHandler.
- * @param normalize true if the content should be normalized according to
- * the rules for the XPath
- * <a href="http://www.w3.org/TR/xpath#function-normalize-space">normalize-space</a>
- * function.
- *
- * @throws org.xml.sax.SAXException
- */
- public abstract void dispatchCharactersEvents(
- int nodeHandle, org.xml.sax.ContentHandler ch, boolean normalize)
- throws org.xml.sax.SAXException;
-
- /**
- * Directly create SAX parser events from a subtree.
- *
- * @param nodeHandle The node ID.
- * @param ch A non-null reference to a ContentHandler.
- *
- * @throws org.xml.sax.SAXException
- */
- public abstract void dispatchToEvents(
- int nodeHandle, org.xml.sax.ContentHandler ch)
- throws org.xml.sax.SAXException;
-
- /**
- * Return an DOM node for the given node.
- *
- * @param nodeHandle The node ID.
- *
- * @return A node representation of the DTM node.
- */
- public org.w3c.dom.Node getNode(int nodeHandle)
- {
- return new DTMNodeProxy(this, nodeHandle);
- }
-
- // ==== Construction methods (may not be supported by some implementations!) =====
-
- /**
- * Append a child to the end of the document. Please note that the node
- * is always cloned if it is owned by another document.
- *
- * <p>%REVIEW% "End of the document" needs to be defined more clearly.
- * Does it become the last child of the Document? Of the root element?</p>
- *
- * @param newChild Must be a valid new node handle.
- * @param clone true if the child should be cloned into the document.
- * @param cloneDepth if the clone argument is true, specifies that the
- * clone should include all it's children.
- */
- public void appendChild(int newChild, boolean clone, boolean cloneDepth)
- {
- error(XMLMessages.createXMLMessage(XMLErrorResources.ER_METHOD_NOT_SUPPORTED, null));//"appendChild not yet supported!");
- }
-
- /**
- * Append a text node child that will be constructed from a string,
- * to the end of the document.
- *
- * <p>%REVIEW% "End of the document" needs to be defined more clearly.
- * Does it become the last child of the Document? Of the root element?</p>
- *
- * @param str Non-null reverence to a string.
- */
- public void appendTextChild(String str)
- {
- error(XMLMessages.createXMLMessage(XMLErrorResources.ER_METHOD_NOT_SUPPORTED, null));//"appendTextChild not yet supported!");
- }
-
- /**
- * Simple error for asserts and the like.
- *
- * @param msg Error message to report.
- */
- protected void error(String msg)
- {
- throw new DTMException(msg);
- }
-
- /**
- * Find out whether or not to strip whispace nodes.
- *
- *
- * @return whether or not to strip whispace nodes.
- */
- protected boolean getShouldStripWhitespace()
- {
- return m_shouldStripWS;
- }
-
- /**
- * Set whether to strip whitespaces and push in current value of
- * m_shouldStripWS in m_shouldStripWhitespaceStack.
- *
- * @param shouldStrip Flag indicating whether to strip whitespace nodes
- */
- protected void pushShouldStripWhitespace(boolean shouldStrip)
- {
-
- m_shouldStripWS = shouldStrip;
-
- if (null != m_shouldStripWhitespaceStack)
- m_shouldStripWhitespaceStack.push(shouldStrip);
- }
-
- /**
- * Set whether to strip whitespaces at this point by popping out
- * m_shouldStripWhitespaceStack.
- *
- */
- protected void popShouldStripWhitespace()
- {
- if (null != m_shouldStripWhitespaceStack)
- m_shouldStripWS = m_shouldStripWhitespaceStack.popAndTop();
- }
-
- /**
- * Set whether to strip whitespaces and set the top of the stack to
- * the current value of m_shouldStripWS.
- *
- *
- * @param shouldStrip Flag indicating whether to strip whitespace nodes
- */
- protected void setShouldStripWhitespace(boolean shouldStrip)
- {
-
- m_shouldStripWS = shouldStrip;
-
- if (null != m_shouldStripWhitespaceStack)
- m_shouldStripWhitespaceStack.setTop(shouldStrip);
- }
-
- /**
- * A dummy routine to satisify the abstract interface. If the DTM
- * implememtation that extends the default base requires notification
- * of registration, they can override this method.
- */
- public void documentRegistration()
- {
- }
-
- /**
- * A dummy routine to satisify the abstract interface. If the DTM
- * implememtation that extends the default base requires notification
- * when the document is being released, they can override this method
- */
- public void documentRelease()
- {
- }
-
- /**
- * Migrate a DTM built with an old DTMManager to a new DTMManager.
- * After the migration, the new DTMManager will treat the DTM as
- * one that is built by itself.
- * This is used to support DTM sharing between multiple transformations.
- * @param mgr the DTMManager
- */
- public void migrateTo(DTMManager mgr)
- {
- m_mgr = mgr;
- if(mgr instanceof DTMManagerDefault)
- m_mgrDefault=(DTMManagerDefault)mgr;
- }
-
- /** Query which DTMManager this DTM is currently being handled by.
- *
- * %REVEW% Should this become part of the base DTM API?
- *
- * @return a DTMManager, or null if this is a "stand-alone" DTM.
- */
- public DTMManager getManager()
- {
- return m_mgr;
- }
-
- /** Query which DTMIDs this DTM is currently using within the DTMManager.
- *
- * %REVEW% Should this become part of the base DTM API?
- *
- * @return an IntVector, or null if this is a "stand-alone" DTM.
- */
- public SuballocatedIntVector getDTMIDs()
- {
- if(m_mgr==null) return null;
- return m_dtmIdent;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/dtm/ref/DTMDefaultBaseIterators.java b/src/com/sun/org/apache/xml/internal/dtm/ref/DTMDefaultBaseIterators.java
deleted file mode 100644
index 31c059c..0000000
--- a/src/com/sun/org/apache/xml/internal/dtm/ref/DTMDefaultBaseIterators.java
+++ /dev/null
@@ -1,2195 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DTMDefaultBaseIterators.java,v 1.2.4.1 2005/09/15 08:15:00 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.dtm.ref;
-
-import com.sun.org.apache.xml.internal.dtm.*;
-
-import javax.xml.transform.Source;
-
-import com.sun.org.apache.xml.internal.utils.XMLStringFactory;
-
-import com.sun.org.apache.xml.internal.res.XMLErrorResources;
-import com.sun.org.apache.xml.internal.res.XMLMessages;
-import com.sun.org.apache.xalan.internal.xsltc.dom.NodeCounter;
-
-/**
- * This class implements the traversers for DTMDefaultBase.
- */
-public abstract class DTMDefaultBaseIterators extends DTMDefaultBaseTraversers
-{
-
- /**
- * Construct a DTMDefaultBaseTraversers object from a DOM node.
- *
- * @param mgr The DTMManager who owns this DTM.
- * @param source The object that is used to specify the construction source.
- * @param dtmIdentity The DTM identity ID for this DTM.
- * @param whiteSpaceFilter The white space filter for this DTM, which may
- * be null.
- * @param xstringfactory The factory to use for creating XMLStrings.
- * @param doIndexing true if the caller considers it worth it to use
- * indexing schemes.
- */
- public DTMDefaultBaseIterators(DTMManager mgr, Source source,
- int dtmIdentity,
- DTMWSFilter whiteSpaceFilter,
- XMLStringFactory xstringfactory,
- boolean doIndexing)
- {
- super(mgr, source, dtmIdentity, whiteSpaceFilter,
- xstringfactory, doIndexing);
- }
-
- /**
- * Construct a DTMDefaultBaseTraversers object from a DOM node.
- *
- * @param mgr The DTMManager who owns this DTM.
- * @param source The object that is used to specify the construction source.
- * @param dtmIdentity The DTM identity ID for this DTM.
- * @param whiteSpaceFilter The white space filter for this DTM, which may
- * be null.
- * @param xstringfactory The factory to use for creating XMLStrings.
- * @param doIndexing true if the caller considers it worth it to use
- * indexing schemes.
- * @param blocksize The block size of the DTM.
- * @param usePrevsib true if we want to build the previous sibling node array.
- * @param newNameTable true if we want to use a new ExpandedNameTable for this DTM.
- */
- public DTMDefaultBaseIterators(DTMManager mgr, Source source,
- int dtmIdentity,
- DTMWSFilter whiteSpaceFilter,
- XMLStringFactory xstringfactory,
- boolean doIndexing,
- int blocksize,
- boolean usePrevsib,
- boolean newNameTable)
- {
- super(mgr, source, dtmIdentity, whiteSpaceFilter,
- xstringfactory, doIndexing, blocksize, usePrevsib, newNameTable);
- }
-
- /**
- * Get an iterator that can navigate over an XPath Axis, predicated by
- * the extended type ID.
- * Returns an iterator that must be initialized
- * with a start node (using iterator.setStartNode()).
- *
- * @param axis One of Axes.ANCESTORORSELF, etc.
- * @param type An extended type ID.
- *
- * @return A DTMAxisIterator, or null if the given axis isn't supported.
- */
- public DTMAxisIterator getTypedAxisIterator(int axis, int type)
- {
-
- DTMAxisIterator iterator = null;
-
- /* This causes an error when using patterns for elements that
- do not exist in the DOM (translet types which do not correspond
- to a DOM type are mapped to the DOM.ELEMENT type).
- */
-
- // if (type == NO_TYPE) {
- // return(EMPTYITERATOR);
- // }
- // else if (type == ELEMENT) {
- // iterator = new FilterIterator(getAxisIterator(axis),
- // getElementFilter());
- // }
- // else
- {
- switch (axis)
- {
- case Axis.SELF :
- iterator = new TypedSingletonIterator(type);
- break;
- case Axis.CHILD :
- iterator = new TypedChildrenIterator(type);
- break;
- case Axis.PARENT :
- return (new ParentIterator().setNodeType(type));
- case Axis.ANCESTOR :
- return (new TypedAncestorIterator(type));
- case Axis.ANCESTORORSELF :
- return ((new TypedAncestorIterator(type)).includeSelf());
- case Axis.ATTRIBUTE :
- return (new TypedAttributeIterator(type));
- case Axis.DESCENDANT :
- iterator = new TypedDescendantIterator(type);
- break;
- case Axis.DESCENDANTORSELF :
- iterator = (new TypedDescendantIterator(type)).includeSelf();
- break;
- case Axis.FOLLOWING :
- iterator = new TypedFollowingIterator(type);
- break;
- case Axis.PRECEDING :
- iterator = new TypedPrecedingIterator(type);
- break;
- case Axis.FOLLOWINGSIBLING :
- iterator = new TypedFollowingSiblingIterator(type);
- break;
- case Axis.PRECEDINGSIBLING :
- iterator = new TypedPrecedingSiblingIterator(type);
- break;
- case Axis.NAMESPACE :
- iterator = new TypedNamespaceIterator(type);
- break;
- case Axis.ROOT :
- iterator = new TypedRootIterator(type);
- break;
- default :
- throw new DTMException(XMLMessages.createXMLMessage(
- XMLErrorResources.ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED,
- new Object[]{Axis.getNames(axis)}));
- //"Error: typed iterator for axis "
- //+ Axis.names[axis] + "not implemented");
- }
- }
-
- return (iterator);
- }
-
- /**
- * This is a shortcut to the iterators that implement the
- * XPath axes.
- * Returns a bare-bones iterator that must be initialized
- * with a start node (using iterator.setStartNode()).
- *
- * @param axis One of Axes.ANCESTORORSELF, etc.
- *
- * @return A DTMAxisIterator, or null if the given axis isn't supported.
- */
- public DTMAxisIterator getAxisIterator(final int axis)
- {
-
- DTMAxisIterator iterator = null;
-
- switch (axis)
- {
- case Axis.SELF :
- iterator = new SingletonIterator();
- break;
- case Axis.CHILD :
- iterator = new ChildrenIterator();
- break;
- case Axis.PARENT :
- return (new ParentIterator());
- case Axis.ANCESTOR :
- return (new AncestorIterator());
- case Axis.ANCESTORORSELF :
- return ((new AncestorIterator()).includeSelf());
- case Axis.ATTRIBUTE :
- return (new AttributeIterator());
- case Axis.DESCENDANT :
- iterator = new DescendantIterator();
- break;
- case Axis.DESCENDANTORSELF :
- iterator = (new DescendantIterator()).includeSelf();
- break;
- case Axis.FOLLOWING :
- iterator = new FollowingIterator();
- break;
- case Axis.PRECEDING :
- iterator = new PrecedingIterator();
- break;
- case Axis.FOLLOWINGSIBLING :
- iterator = new FollowingSiblingIterator();
- break;
- case Axis.PRECEDINGSIBLING :
- iterator = new PrecedingSiblingIterator();
- break;
- case Axis.NAMESPACE :
- iterator = new NamespaceIterator();
- break;
- case Axis.ROOT :
- iterator = new RootIterator();
- break;
- default :
- throw new DTMException(XMLMessages.createXMLMessage(
- XMLErrorResources.ER_ITERATOR_AXIS_NOT_IMPLEMENTED,
- new Object[]{Axis.getNames(axis)}));
- //"Error: iterator for axis '" + Axis.names[axis]
- //+ "' not implemented");
- }
-
- return (iterator);
- }
-
- /**
- * Abstract superclass defining behaviors shared by all DTMDefault's
- * internal implementations of DTMAxisIterator. Subclass this (and
- * override, if necessary) to implement the specifics of an
- * individual axis iterator.
- *
- * Currently there isn't a lot here
- */
- public abstract class InternalAxisIteratorBase extends DTMAxisIteratorBase
- {
-
- // %REVIEW% We could opt to share _nodeType and setNodeType() as
- // well, and simply ignore them in iterators which don't use them.
- // But Scott's worried about the overhead involved in cloning
- // these, and wants them to have as few fields as possible. Note
- // that we can't create a TypedInternalAxisIteratorBase because
- // those are often based on the untyped versions and Java doesn't
- // support multiple inheritance. <sigh/>
-
- /**
- * Current iteration location. Usually this is the last location
- * returned (starting point for the next() search); for single-node
- * iterators it may instead be initialized to point to that single node.
- */
- protected int _currentNode;
-
- /**
- * Remembers the current node for the next call to gotoMark().
- *
- * %REVIEW% Should this save _position too?
- */
- public void setMark()
- {
- _markedNode = _currentNode;
- }
-
- /**
- * Restores the current node remembered by setMark().
- *
- * %REVEIW% Should this restore _position too?
- */
- public void gotoMark()
- {
- _currentNode = _markedNode;
- }
-
- } // end of InternalAxisIteratorBase
-
- /**
- * Iterator that returns all immediate children of a given node
- */
- public final class ChildrenIterator extends InternalAxisIteratorBase
- {
-
- /**
- * Setting start to END should 'close' the iterator,
- * i.e. subsequent call to next() should return END.
- *
- * If the iterator is not restartable, this has no effect.
- * %REVIEW% Should it return/throw something in that case,
- * or set current node to END, to indicate request-not-honored?
- *
- * @param node Sets the root of the iteration.
- *
- * @return A DTMAxisIterator set to the start of the iteration.
- */
- public DTMAxisIterator setStartNode(int node)
- {
-//%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
- if (node == DTMDefaultBase.ROOTNODE)
- node = getDocument();
- if (_isRestartable)
- {
- _startNode = node;
- _currentNode = (node == DTM.NULL) ? DTM.NULL
- : _firstch(makeNodeIdentity(node));
-
- return resetPosition();
- }
-
- return this;
- }
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END if no more
- * are available.
- */
- public int next()
- {
- if (_currentNode != NULL) {
- int node = _currentNode;
- _currentNode = _nextsib(node);
- return returnNode(makeNodeHandle(node));
- }
-
- return END;
- }
- } // end of ChildrenIterator
-
- /**
- * Iterator that returns the parent of a given node. Note that
- * this delivers only a single node; if you want all the ancestors,
- * see AncestorIterator.
- */
- public final class ParentIterator extends InternalAxisIteratorBase
- {
-
- /** The extended type ID that was requested. */
- private int _nodeType = -1;
-
- /**
- * Set start to END should 'close' the iterator,
- * i.e. subsequent call to next() should return END.
- *
- * @param node Sets the root of the iteration.
- *
- * @return A DTMAxisIterator set to the start of the iteration.
- */
- public DTMAxisIterator setStartNode(int node)
- {
-//%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
- if (node == DTMDefaultBase.ROOTNODE)
- node = getDocument();
- if (_isRestartable)
- {
- _startNode = node;
- _currentNode = getParent(node);
-
- return resetPosition();
- }
-
- return this;
- }
-
- /**
- * Set the node type of the parent that we're looking for.
- * Note that this does _not_ mean "find the nearest ancestor of
- * this type", but "yield the parent if it is of this type".
- *
- *
- * @param type extended type ID.
- *
- * @return ParentIterator configured with the type filter set.
- */
- public DTMAxisIterator setNodeType(final int type)
- {
-
- _nodeType = type;
-
- return this;
- }
-
- /**
- * Get the next node in the iteration. In this case, we return
- * only the immediate parent, _if_ it matches the requested nodeType.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next()
- {
- int result = _currentNode;
-
- if (_nodeType >= DTM.NTYPES) {
- if (_nodeType != getExpandedTypeID(_currentNode)) {
- result = END;
- }
- } else if (_nodeType != NULL) {
- if (_nodeType != getNodeType(_currentNode)) {
- result = END;
- }
- }
-
- _currentNode = END;
-
- return returnNode(result);
- }
- } // end of ParentIterator
-
- /**
- * Iterator that returns children of a given type for a given node.
- * The functionality chould be achieved by putting a filter on top
- * of a basic child iterator, but a specialised iterator is used
- * for efficiency (both speed and size of translet).
- */
- public final class TypedChildrenIterator extends InternalAxisIteratorBase
- {
-
- /** The extended type ID that was requested. */
- private final int _nodeType;
-
- /**
- * Constructor TypedChildrenIterator
- *
- *
- * @param nodeType The extended type ID being requested.
- */
- public TypedChildrenIterator(int nodeType)
- {
- _nodeType = nodeType;
- }
-
- /**
- * Set start to END should 'close' the iterator,
- * i.e. subsequent call to next() should return END.
- *
- * @param node Sets the root of the iteration.
- *
- * @return A DTMAxisIterator set to the start of the iteration.
- */
- public DTMAxisIterator setStartNode(int node)
- {
-//%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
- if (node == DTMDefaultBase.ROOTNODE)
- node = getDocument();
- if (_isRestartable)
- {
- _startNode = node;
- _currentNode = (node == DTM.NULL)
- ? DTM.NULL
- : _firstch(makeNodeIdentity(_startNode));
-
- return resetPosition();
- }
-
- return this;
- }
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next()
- {
- int eType;
- int node = _currentNode;
-
- int nodeType = _nodeType;
-
- if (nodeType >= DTM.NTYPES) {
- while (node != DTM.NULL && _exptype(node) != nodeType) {
- node = _nextsib(node);
- }
- } else {
- while (node != DTM.NULL) {
- eType = _exptype(node);
- if (eType < DTM.NTYPES) {
- if (eType == nodeType) {
- break;
- }
- } else if (m_expandedNameTable.getType(eType) == nodeType) {
- break;
- }
- node = _nextsib(node);
- }
- }
-
- if (node == DTM.NULL) {
- _currentNode = DTM.NULL;
- return DTM.NULL;
- } else {
- _currentNode = _nextsib(node);
- return returnNode(makeNodeHandle(node));
- }
-
- }
- } // end of TypedChildrenIterator
-
- /**
- * Iterator that returns children within a given namespace for a
- * given node. The functionality chould be achieved by putting a
- * filter on top of a basic child iterator, but a specialised
- * iterator is used for efficiency (both speed and size of translet).
- */
- public final class NamespaceChildrenIterator
- extends InternalAxisIteratorBase
- {
-
- /** The extended type ID being requested. */
- private final int _nsType;
-
- /**
- * Constructor NamespaceChildrenIterator
- *
- *
- * @param type The extended type ID being requested.
- */
- public NamespaceChildrenIterator(final int type)
- {
- _nsType = type;
- }
-
- /**
- * Set start to END should 'close' the iterator,
- * i.e. subsequent call to next() should return END.
- *
- * @param node Sets the root of the iteration.
- *
- * @return A DTMAxisIterator set to the start of the iteration.
- */
- public DTMAxisIterator setStartNode(int node)
- {
-//%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
- if (node == DTMDefaultBase.ROOTNODE)
- node = getDocument();
- if (_isRestartable)
- {
- _startNode = node;
- _currentNode = (node == DTM.NULL) ? DTM.NULL : NOTPROCESSED;
-
- return resetPosition();
- }
-
- return this;
- }
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next()
- {
- if (_currentNode != DTM.NULL) {
- for (int node = (NOTPROCESSED == _currentNode)
- ? _firstch(makeNodeIdentity(_startNode))
- : _nextsib(_currentNode);
- node != END;
- node = _nextsib(node)) {
- if (m_expandedNameTable.getNamespaceID(_exptype(node)) == _nsType) {
- _currentNode = node;
-
- return returnNode(node);
- }
- }
- }
-
- return END;
- }
- } // end of NamespaceChildrenIterator
-
- /**
- * Iterator that returns the namespace nodes as defined by the XPath data model
- * for a given node.
- */
- public class NamespaceIterator
- extends InternalAxisIteratorBase
- {
-
- /**
- * Constructor NamespaceAttributeIterator
- */
- public NamespaceIterator()
- {
-
- super();
- }
-
- /**
- * Set start to END should 'close' the iterator,
- * i.e. subsequent call to next() should return END.
- *
- * @param node Sets the root of the iteration.
- *
- * @return A DTMAxisIterator set to the start of the iteration.
- */
- public DTMAxisIterator setStartNode(int node)
- {
-//%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
- if (node == DTMDefaultBase.ROOTNODE)
- node = getDocument();
- if (_isRestartable)
- {
- _startNode = node;
- _currentNode = getFirstNamespaceNode(node, true);
-
- return resetPosition();
- }
-
- return this;
- }
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next()
- {
-
- int node = _currentNode;
-
- if (DTM.NULL != node)
- _currentNode = getNextNamespaceNode(_startNode, node, true);
-
- return returnNode(node);
- }
- } // end of NamespaceIterator
-
- /**
- * Iterator that returns the namespace nodes as defined by the XPath data model
- * for a given node, filtered by extended type ID.
- */
- public class TypedNamespaceIterator extends NamespaceIterator
- {
-
- /** The extended type ID that was requested. */
- private final int _nodeType;
-
- /**
- * Constructor TypedNamespaceIterator
- *
- *
- * @param nodeType The extended type ID being requested.
- */
- public TypedNamespaceIterator(int nodeType)
- {
- super();
- _nodeType = nodeType;
- }
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next()
- {
- int node;
-
- for (node = _currentNode;
- node != END;
- node = getNextNamespaceNode(_startNode, node, true)) {
- if (getExpandedTypeID(node) == _nodeType
- || getNodeType(node) == _nodeType
- || getNamespaceType(node) == _nodeType) {
- _currentNode = node;
-
- return returnNode(node);
- }
- }
-
- return (_currentNode =END);
- }
- } // end of TypedNamespaceIterator
-
- /**
- * Iterator that returns the the root node as defined by the XPath data model
- * for a given node.
- */
- public class RootIterator
- extends InternalAxisIteratorBase
- {
-
- /**
- * Constructor RootIterator
- */
- public RootIterator()
- {
-
- super();
- }
-
- /**
- * Set start to END should 'close' the iterator,
- * i.e. subsequent call to next() should return END.
- *
- * @param node Sets the root of the iteration.
- *
- * @return A DTMAxisIterator set to the start of the iteration.
- */
- public DTMAxisIterator setStartNode(int node)
- {
-
- if (_isRestartable)
- {
- _startNode = getDocumentRoot(node);
- _currentNode = NULL;
-
- return resetPosition();
- }
-
- return this;
- }
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next()
- {
- if(_startNode == _currentNode)
- return NULL;
-
- _currentNode = _startNode;
-
- return returnNode(_startNode);
- }
- } // end of RootIterator
-
- /**
- * Iterator that returns the namespace nodes as defined by the XPath data model
- * for a given node, filtered by extended type ID.
- */
- public class TypedRootIterator extends RootIterator
- {
-
- /** The extended type ID that was requested. */
- private final int _nodeType;
-
- /**
- * Constructor TypedRootIterator
- *
- * @param nodeType The extended type ID being requested.
- */
- public TypedRootIterator(int nodeType)
- {
- super();
- _nodeType = nodeType;
- }
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next()
- {
- if(_startNode == _currentNode)
- return NULL;
-
- int nodeType = _nodeType;
- int node = _startNode;
- int expType = getExpandedTypeID(node);
-
- _currentNode = node;
-
- if (nodeType >= DTM.NTYPES) {
- if (nodeType == expType) {
- return returnNode(node);
- }
- } else {
- if (expType < DTM.NTYPES) {
- if (expType == nodeType) {
- return returnNode(node);
- }
- } else {
- if (m_expandedNameTable.getType(expType) == nodeType) {
- return returnNode(node);
- }
- }
- }
-
- return END;
- }
- } // end of TypedRootIterator
-
- /**
- * Iterator that returns attributes within a given namespace for a node.
- */
- public final class NamespaceAttributeIterator
- extends InternalAxisIteratorBase
- {
-
- /** The extended type ID being requested. */
- private final int _nsType;
-
- /**
- * Constructor NamespaceAttributeIterator
- *
- *
- * @param nsType The extended type ID being requested.
- */
- public NamespaceAttributeIterator(int nsType)
- {
-
- super();
-
- _nsType = nsType;
- }
-
- /**
- * Set start to END should 'close' the iterator,
- * i.e. subsequent call to next() should return END.
- *
- * @param node Sets the root of the iteration.
- *
- * @return A DTMAxisIterator set to the start of the iteration.
- */
- public DTMAxisIterator setStartNode(int node)
- {
-//%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
- if (node == DTMDefaultBase.ROOTNODE)
- node = getDocument();
- if (_isRestartable)
- {
- _startNode = node;
- _currentNode = getFirstNamespaceNode(node, false);
-
- return resetPosition();
- }
-
- return this;
- }
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next()
- {
-
- int node = _currentNode;
-
- if (DTM.NULL != node)
- _currentNode = getNextNamespaceNode(_startNode, node, false);
-
- return returnNode(node);
- }
- } // end of NamespaceAttributeIterator
-
- /**
- * Iterator that returns all siblings of a given node.
- */
- public class FollowingSiblingIterator extends InternalAxisIteratorBase
- {
-
- /**
- * Set start to END should 'close' the iterator,
- * i.e. subsequent call to next() should return END.
- *
- * @param node Sets the root of the iteration.
- *
- * @return A DTMAxisIterator set to the start of the iteration.
- */
- public DTMAxisIterator setStartNode(int node)
- {
-//%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
- if (node == DTMDefaultBase.ROOTNODE)
- node = getDocument();
- if (_isRestartable)
- {
- _startNode = node;
- _currentNode = makeNodeIdentity(node);
-
- return resetPosition();
- }
-
- return this;
- }
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next()
- {
- _currentNode = (_currentNode == DTM.NULL) ? DTM.NULL
- : _nextsib(_currentNode);
- return returnNode(makeNodeHandle(_currentNode));
- }
- } // end of FollowingSiblingIterator
-
- /**
- * Iterator that returns all following siblings of a given node.
- */
- public final class TypedFollowingSiblingIterator
- extends FollowingSiblingIterator
- {
-
- /** The extended type ID that was requested. */
- private final int _nodeType;
-
- /**
- * Constructor TypedFollowingSiblingIterator
- *
- *
- * @param type The extended type ID being requested.
- */
- public TypedFollowingSiblingIterator(int type)
- {
- _nodeType = type;
- }
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next()
- {
- if (_currentNode == DTM.NULL) {
- return DTM.NULL;
- }
-
- int node = _currentNode;
- int eType;
- int nodeType = _nodeType;
-
- if (nodeType >= DTM.NTYPES) {
- do {
- node = _nextsib(node);
- } while (node != DTM.NULL && _exptype(node) != nodeType);
- } else {
- while ((node = _nextsib(node)) != DTM.NULL) {
- eType = _exptype(node);
- if (eType < DTM.NTYPES) {
- if (eType == nodeType) {
- break;
- }
- } else if (m_expandedNameTable.getType(eType) == nodeType) {
- break;
- }
- }
- }
-
- _currentNode = node;
-
- return (_currentNode == DTM.NULL)
- ? DTM.NULL
- : returnNode(makeNodeHandle(_currentNode));
- }
- } // end of TypedFollowingSiblingIterator
-
- /**
- * Iterator that returns attribute nodes (of what nodes?)
- */
- public final class AttributeIterator extends InternalAxisIteratorBase
- {
-
- // assumes caller will pass element nodes
-
- /**
- * Set start to END should 'close' the iterator,
- * i.e. subsequent call to next() should return END.
- *
- * @param node Sets the root of the iteration.
- *
- * @return A DTMAxisIterator set to the start of the iteration.
- */
- public DTMAxisIterator setStartNode(int node)
- {
-//%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
- if (node == DTMDefaultBase.ROOTNODE)
- node = getDocument();
- if (_isRestartable)
- {
- _startNode = node;
- _currentNode = getFirstAttributeIdentity(makeNodeIdentity(node));
-
- return resetPosition();
- }
-
- return this;
- }
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next()
- {
-
- final int node = _currentNode;
-
- if (node != NULL) {
- _currentNode = getNextAttributeIdentity(node);
- return returnNode(makeNodeHandle(node));
- }
-
- return NULL;
- }
- } // end of AttributeIterator
-
- /**
- * Iterator that returns attribute nodes of a given type
- */
- public final class TypedAttributeIterator extends InternalAxisIteratorBase
- {
-
- /** The extended type ID that was requested. */
- private final int _nodeType;
-
- /**
- * Constructor TypedAttributeIterator
- *
- *
- * @param nodeType The extended type ID that is requested.
- */
- public TypedAttributeIterator(int nodeType)
- {
- _nodeType = nodeType;
- }
-
- // assumes caller will pass element nodes
-
- /**
- * Set start to END should 'close' the iterator,
- * i.e. subsequent call to next() should return END.
- *
- * @param node Sets the root of the iteration.
- *
- * @return A DTMAxisIterator set to the start of the iteration.
- */
- public DTMAxisIterator setStartNode(int node)
- {
- if (_isRestartable)
- {
- _startNode = node;
-
- _currentNode = getTypedAttribute(node, _nodeType);
-
- return resetPosition();
- }
-
- return this;
- }
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next()
- {
-
- final int node = _currentNode;
-
- // singleton iterator, since there can only be one attribute of
- // a given type.
- _currentNode = NULL;
-
- return returnNode(node);
- }
- } // end of TypedAttributeIterator
-
- /**
- * Iterator that returns preceding siblings of a given node
- */
- public class PrecedingSiblingIterator extends InternalAxisIteratorBase
- {
-
- /**
- * The node identity of _startNode for this iterator
- */
- protected int _startNodeID;
-
- /**
- * True if this iterator has a reversed axis.
- *
- * @return true.
- */
- public boolean isReverse()
- {
- return true;
- }
-
- /**
- * Set start to END should 'close' the iterator,
- * i.e. subsequent call to next() should return END.
- *
- * @param node Sets the root of the iteration.
- *
- * @return A DTMAxisIterator set to the start of the iteration.
- */
- public DTMAxisIterator setStartNode(int node)
- {
-//%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
- if (node == DTMDefaultBase.ROOTNODE)
- node = getDocument();
- if (_isRestartable)
- {
- _startNode = node;
- node = _startNodeID = makeNodeIdentity(node);
-
- if(node == NULL)
- {
- _currentNode = node;
- return resetPosition();
- }
-
- int type = m_expandedNameTable.getType(_exptype(node));
- if(ExpandedNameTable.ATTRIBUTE == type
- || ExpandedNameTable.NAMESPACE == type )
- {
- _currentNode = node;
- }
- else
- {
- // Be careful to handle the Document node properly
- _currentNode = _parent(node);
- if(NULL!=_currentNode)
- _currentNode = _firstch(_currentNode);
- else
- _currentNode = node;
- }
-
- return resetPosition();
- }
-
- return this;
- }
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next()
- {
-
- if (_currentNode == _startNodeID || _currentNode == DTM.NULL)
- {
- return NULL;
- }
- else
- {
- final int node = _currentNode;
- _currentNode = _nextsib(node);
-
- return returnNode(makeNodeHandle(node));
- }
- }
- } // end of PrecedingSiblingIterator
-
- /**
- * Iterator that returns preceding siblings of a given type for
- * a given node
- */
- public final class TypedPrecedingSiblingIterator
- extends PrecedingSiblingIterator
- {
-
- /** The extended type ID that was requested. */
- private final int _nodeType;
-
- /**
- * Constructor TypedPrecedingSiblingIterator
- *
- *
- * @param type The extended type ID being requested.
- */
- public TypedPrecedingSiblingIterator(int type)
- {
- _nodeType = type;
- }
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next()
- {
- int node = _currentNode;
- int expType;
-
- int nodeType = _nodeType;
- int startID = _startNodeID;
-
- if (nodeType >= DTM.NTYPES) {
- while (node != NULL && node != startID && _exptype(node) != nodeType) {
- node = _nextsib(node);
- }
- } else {
- while (node != NULL && node != startID) {
- expType = _exptype(node);
- if (expType < DTM.NTYPES) {
- if (expType == nodeType) {
- break;
- }
- } else {
- if (m_expandedNameTable.getType(expType) == nodeType) {
- break;
- }
- }
- node = _nextsib(node);
- }
- }
-
- if (node == DTM.NULL || node == _startNodeID) {
- _currentNode = NULL;
- return NULL;
- } else {
- _currentNode = _nextsib(node);
- return returnNode(makeNodeHandle(node));
- }
- }
- } // end of TypedPrecedingSiblingIterator
-
- /**
- * Iterator that returns preceding nodes of a given node.
- * This includes the node set {root+1, start-1}, but excludes
- * all ancestors, attributes, and namespace nodes.
- */
- public class PrecedingIterator extends InternalAxisIteratorBase
- {
-
- /** The max ancestors, but it can grow... */
- private final int _maxAncestors = 8;
-
- /**
- * The stack of start node + ancestors up to the root of the tree,
- * which we must avoid.
- */
- protected int[] _stack = new int[_maxAncestors];
-
- /** (not sure yet... -sb) */
- protected int _sp, _oldsp;
-
- protected int _markedsp, _markedNode, _markedDescendant;
-
- /* _currentNode precedes candidates. This is the identity, not the handle! */
-
- /**
- * True if this iterator has a reversed axis.
- *
- * @return true since this iterator is a reversed axis.
- */
- public boolean isReverse()
- {
- return true;
- }
-
- /**
- * Returns a deep copy of this iterator. The cloned iterator is not reset.
- *
- * @return a deep copy of this iterator.
- */
- public DTMAxisIterator cloneIterator()
- {
- _isRestartable = false;
-
- try
- {
- final PrecedingIterator clone = (PrecedingIterator) super.clone();
- final int[] stackCopy = new int[_stack.length];
- System.arraycopy(_stack, 0, stackCopy, 0, _stack.length);
-
- clone._stack = stackCopy;
-
- // return clone.reset();
- return clone;
- }
- catch (CloneNotSupportedException e)
- {
- throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported.");
- }
- }
-
- /**
- * Set start to END should 'close' the iterator,
- * i.e. subsequent call to next() should return END.
- *
- * @param node Sets the root of the iteration.
- *
- * @return A DTMAxisIterator set to the start of the iteration.
- */
- public DTMAxisIterator setStartNode(int node)
- {
-//%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
- if (node == DTMDefaultBase.ROOTNODE)
- node = getDocument();
- if (_isRestartable)
- {
- node = makeNodeIdentity(node);
-
- // iterator is not a clone
- int parent, index;
-
- if (_type(node) == DTM.ATTRIBUTE_NODE)
- node = _parent(node);
-
- _startNode = node;
- _stack[index = 0] = node;
-
-
-
- parent=node;
- while ((parent = _parent(parent)) != NULL)
- {
- if (++index == _stack.length)
- {
- final int[] stack = new int[index + 4];
- System.arraycopy(_stack, 0, stack, 0, index);
- _stack = stack;
- }
- _stack[index] = parent;
- }
- if(index>0)
- --index; // Pop actual root node (if not start) back off the stack
-
- _currentNode=_stack[index]; // Last parent before root node
-
- _oldsp = _sp = index;
-
- return resetPosition();
- }
-
- return this;
- }
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next()
- {
- // Bugzilla 8324: We were forgetting to skip Attrs and NS nodes.
- // Also recoded the loop controls for clarity and to flatten out
- // the tail-recursion.
- for(++_currentNode;
- _sp>=0;
- ++_currentNode)
- {
- if(_currentNode < _stack[_sp])
- {
- if(_type(_currentNode) != ATTRIBUTE_NODE &&
- _type(_currentNode) != NAMESPACE_NODE)
- return returnNode(makeNodeHandle(_currentNode));
- }
- else
- --_sp;
- }
- return NULL;
- }
-
- // redefine DTMAxisIteratorBase's reset
-
- /**
- * Resets the iterator to the last start node.
- *
- * @return A DTMAxisIterator, which may or may not be the same as this
- * iterator.
- */
- public DTMAxisIterator reset()
- {
-
- _sp = _oldsp;
-
- return resetPosition();
- }
-
- public void setMark() {
- _markedsp = _sp;
- _markedNode = _currentNode;
- _markedDescendant = _stack[0];
- }
-
- public void gotoMark() {
- _sp = _markedsp;
- _currentNode = _markedNode;
- }
- } // end of PrecedingIterator
-
- /**
- * Iterator that returns preceding nodes of agiven type for a
- * given node. This includes the node set {root+1, start-1}, but
- * excludes all ancestors.
- */
- public final class TypedPrecedingIterator extends PrecedingIterator
- {
-
- /** The extended type ID that was requested. */
- private final int _nodeType;
-
- /**
- * Constructor TypedPrecedingIterator
- *
- *
- * @param type The extended type ID being requested.
- */
- public TypedPrecedingIterator(int type)
- {
- _nodeType = type;
- }
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next()
- {
- int node = _currentNode;
- int nodeType = _nodeType;
-
- if (nodeType >= DTM.NTYPES) {
- while (true) {
- node = node + 1;
-
- if (_sp < 0) {
- node = NULL;
- break;
- } else if (node >= _stack[_sp]) {
- if (--_sp < 0) {
- node = NULL;
- break;
- }
- } else if (_exptype(node) == nodeType) {
- break;
- }
- }
- } else {
- int expType;
-
- while (true) {
- node = node + 1;
-
- if (_sp < 0) {
- node = NULL;
- break;
- } else if (node >= _stack[_sp]) {
- if (--_sp < 0) {
- node = NULL;
- break;
- }
- } else {
- expType = _exptype(node);
- if (expType < DTM.NTYPES) {
- if (expType == nodeType) {
- break;
- }
- } else {
- if (m_expandedNameTable.getType(expType) == nodeType) {
- break;
- }
- }
- }
- }
- }
-
- _currentNode = node;
-
- return (node == NULL) ? NULL : returnNode(makeNodeHandle(node));
- }
- } // end of TypedPrecedingIterator
-
- /**
- * Iterator that returns following nodes of for a given node.
- */
- public class FollowingIterator extends InternalAxisIteratorBase
- {
- DTMAxisTraverser m_traverser; // easier for now
-
- public FollowingIterator()
- {
- m_traverser = getAxisTraverser(Axis.FOLLOWING);
- }
-
- /**
- * Set start to END should 'close' the iterator,
- * i.e. subsequent call to next() should return END.
- *
- * @param node Sets the root of the iteration.
- *
- * @return A DTMAxisIterator set to the start of the iteration.
- */
- public DTMAxisIterator setStartNode(int node)
- {
-//%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
- if (node == DTMDefaultBase.ROOTNODE)
- node = getDocument();
- if (_isRestartable)
- {
- _startNode = node;
-
- // ?? -sb
- // find rightmost descendant (or self)
- // int current;
- // while ((node = getLastChild(current = node)) != NULL){}
- // _currentNode = current;
- _currentNode = m_traverser.first(node);
-
- // _currentNode precedes possible following(node) nodes
- return resetPosition();
- }
-
- return this;
- }
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next()
- {
-
- int node = _currentNode;
-
- _currentNode = m_traverser.next(_startNode, _currentNode);
-
- return returnNode(node);
- }
- } // end of FollowingIterator
-
- /**
- * Iterator that returns following nodes of a given type for a given node.
- */
- public final class TypedFollowingIterator extends FollowingIterator
- {
-
- /** The extended type ID that was requested. */
- private final int _nodeType;
-
- /**
- * Constructor TypedFollowingIterator
- *
- *
- * @param type The extended type ID being requested.
- */
- public TypedFollowingIterator(int type)
- {
- _nodeType = type;
- }
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next()
- {
-
- int node;
-
- do{
- node = _currentNode;
-
- _currentNode = m_traverser.next(_startNode, _currentNode);
-
- }
- while (node != DTM.NULL
- && (getExpandedTypeID(node) != _nodeType && getNodeType(node) != _nodeType));
-
- return (node == DTM.NULL ? DTM.NULL :returnNode(node));
- }
- } // end of TypedFollowingIterator
-
- /**
- * Iterator that returns the ancestors of a given node in document
- * order. (NOTE! This was changed from the XSLTC code!)
- */
- public class AncestorIterator extends InternalAxisIteratorBase
- {
- com.sun.org.apache.xml.internal.utils.NodeVector m_ancestors =
- new com.sun.org.apache.xml.internal.utils.NodeVector();
-
- int m_ancestorsPos;
-
- int m_markedPos;
-
- /** The real start node for this axes, since _startNode will be adjusted. */
- int m_realStartNode;
-
- /**
- * Get start to END should 'close' the iterator,
- * i.e. subsequent call to next() should return END.
- *
- * @return The root node of the iteration.
- */
- public int getStartNode()
- {
- return m_realStartNode;
- }
-
- /**
- * True if this iterator has a reversed axis.
- *
- * @return true since this iterator is a reversed axis.
- */
- public final boolean isReverse()
- {
- return true;
- }
-
- /**
- * Returns a deep copy of this iterator. The cloned iterator is not reset.
- *
- * @return a deep copy of this iterator.
- */
- public DTMAxisIterator cloneIterator()
- {
- _isRestartable = false; // must set to false for any clone
-
- try
- {
- final AncestorIterator clone = (AncestorIterator) super.clone();
-
- clone._startNode = _startNode;
-
- // return clone.reset();
- return clone;
- }
- catch (CloneNotSupportedException e)
- {
- throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported.");
- }
- }
-
- /**
- * Set start to END should 'close' the iterator,
- * i.e. subsequent call to next() should return END.
- *
- * @param node Sets the root of the iteration.
- *
- * @return A DTMAxisIterator set to the start of the iteration.
- */
- public DTMAxisIterator setStartNode(int node)
- {
-//%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
- if (node == DTMDefaultBase.ROOTNODE)
- node = getDocument();
- m_realStartNode = node;
-
- if (_isRestartable)
- {
- int nodeID = makeNodeIdentity(node);
-
- if (!_includeSelf && node != DTM.NULL) {
- nodeID = _parent(nodeID);
- node = makeNodeHandle(nodeID);
- }
-
- _startNode = node;
-
- while (nodeID != END) {
- m_ancestors.addElement(node);
- nodeID = _parent(nodeID);
- node = makeNodeHandle(nodeID);
- }
- m_ancestorsPos = m_ancestors.size()-1;
-
- _currentNode = (m_ancestorsPos>=0)
- ? m_ancestors.elementAt(m_ancestorsPos)
- : DTM.NULL;
-
- return resetPosition();
- }
-
- return this;
- }
-
- /**
- * Resets the iterator to the last start node.
- *
- * @return A DTMAxisIterator, which may or may not be the same as this
- * iterator.
- */
- public DTMAxisIterator reset()
- {
-
- m_ancestorsPos = m_ancestors.size()-1;
-
- _currentNode = (m_ancestorsPos>=0) ? m_ancestors.elementAt(m_ancestorsPos)
- : DTM.NULL;
-
- return resetPosition();
- }
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next()
- {
-
- int next = _currentNode;
-
- int pos = --m_ancestorsPos;
-
- _currentNode = (pos >= 0) ? m_ancestors.elementAt(m_ancestorsPos)
- : DTM.NULL;
-
- return returnNode(next);
- }
-
- public void setMark() {
- m_markedPos = m_ancestorsPos;
- }
-
- public void gotoMark() {
- m_ancestorsPos = m_markedPos;
- _currentNode = m_ancestorsPos>=0 ? m_ancestors.elementAt(m_ancestorsPos)
- : DTM.NULL;
- }
- } // end of AncestorIterator
-
- /**
- * Typed iterator that returns the ancestors of a given node.
- */
- public final class TypedAncestorIterator extends AncestorIterator
- {
-
- /** The extended type ID that was requested. */
- private final int _nodeType;
-
- /**
- * Constructor TypedAncestorIterator
- *
- *
- * @param type The extended type ID being requested.
- */
- public TypedAncestorIterator(int type)
- {
- _nodeType = type;
- }
-
- /**
- * Set start to END should 'close' the iterator,
- * i.e. subsequent call to next() should return END.
- *
- * @param node Sets the root of the iteration.
- *
- * @return A DTMAxisIterator set to the start of the iteration.
- */
- public DTMAxisIterator setStartNode(int node)
- {
-//%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
- if (node == DTMDefaultBase.ROOTNODE)
- node = getDocument();
- m_realStartNode = node;
-
- if (_isRestartable)
- {
- int nodeID = makeNodeIdentity(node);
- int nodeType = _nodeType;
-
- if (!_includeSelf && node != DTM.NULL) {
- nodeID = _parent(nodeID);
- }
-
- _startNode = node;
-
- if (nodeType >= DTM.NTYPES) {
- while (nodeID != END) {
- int eType = _exptype(nodeID);
-
- if (eType == nodeType) {
- m_ancestors.addElement(makeNodeHandle(nodeID));
- }
- nodeID = _parent(nodeID);
- }
- } else {
- while (nodeID != END) {
- int eType = _exptype(nodeID);
-
- if ((eType >= DTM.NTYPES
- && m_expandedNameTable.getType(eType) == nodeType)
- || (eType < DTM.NTYPES && eType == nodeType)) {
- m_ancestors.addElement(makeNodeHandle(nodeID));
- }
- nodeID = _parent(nodeID);
- }
- }
- m_ancestorsPos = m_ancestors.size()-1;
-
- _currentNode = (m_ancestorsPos>=0)
- ? m_ancestors.elementAt(m_ancestorsPos)
- : DTM.NULL;
-
- return resetPosition();
- }
-
- return this;
- }
- } // end of TypedAncestorIterator
-
- /**
- * Iterator that returns the descendants of a given node.
- */
- public class DescendantIterator extends InternalAxisIteratorBase
- {
-
- /**
- * Set start to END should 'close' the iterator,
- * i.e. subsequent call to next() should return END.
- *
- * @param node Sets the root of the iteration.
- *
- * @return A DTMAxisIterator set to the start of the iteration.
- */
- public DTMAxisIterator setStartNode(int node)
- {
-//%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
- if (node == DTMDefaultBase.ROOTNODE)
- node = getDocument();
- if (_isRestartable)
- {
- node = makeNodeIdentity(node);
- _startNode = node;
-
- if (_includeSelf)
- node--;
-
- _currentNode = node;
-
- return resetPosition();
- }
-
- return this;
- }
-
- /**
- * Tell if this node identity is a descendant. Assumes that
- * the node info for the element has already been obtained.
- *
- * This one-sided test works only if the parent has been
- * previously tested and is known to be a descendent. It fails if
- * the parent is the _startNode's next sibling, or indeed any node
- * that follows _startNode in document order. That may suffice
- * for this iterator, but it's not really an isDescendent() test.
- * %REVIEW% rename?
- *
- * @param identity The index number of the node in question.
- * @return true if the index is a descendant of _startNode.
- */
- protected boolean isDescendant(int identity)
- {
- return (_parent(identity) >= _startNode) || (_startNode == identity);
- }
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next()
- {
- if (_startNode == NULL) {
- return NULL;
- }
-
- if (_includeSelf && (_currentNode + 1) == _startNode)
- return returnNode(makeNodeHandle(++_currentNode)); // | m_dtmIdent);
-
- int node = _currentNode;
- int type;
-
- do {
- node++;
- type = _type(node);
-
- if (NULL == type ||!isDescendant(node)) {
- _currentNode = NULL;
- return END;
- }
- } while(ATTRIBUTE_NODE == type || TEXT_NODE == type
- || NAMESPACE_NODE == type);
-
- _currentNode = node;
- return returnNode(makeNodeHandle(node)); // make handle.
- }
-
- /**
- * Reset.
- *
- */
- public DTMAxisIterator reset()
- {
-
- final boolean temp = _isRestartable;
-
- _isRestartable = true;
-
- setStartNode(makeNodeHandle(_startNode));
-
- _isRestartable = temp;
-
- return this;
- }
-
- } // end of DescendantIterator
-
- /**
- * Typed iterator that returns the descendants of a given node.
- */
- public final class TypedDescendantIterator extends DescendantIterator
- {
-
- /** The extended type ID that was requested. */
- private final int _nodeType;
-
- /**
- * Constructor TypedDescendantIterator
- *
- *
- * @param nodeType Extended type ID being requested.
- */
- public TypedDescendantIterator(int nodeType)
- {
- _nodeType = nodeType;
- }
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next()
- {
- int node;
- int type;
-
- if (_startNode == NULL) {
- return NULL;
- }
-
- node = _currentNode;
-
- do
- {
- node++;
- type = _type(node);
-
- if (NULL == type ||!isDescendant(node)) {
- _currentNode = NULL;
- return END;
- }
- }
- while (type != _nodeType && _exptype(node) != _nodeType);
-
- _currentNode = node;
- return returnNode(makeNodeHandle(node));
- }
- } // end of TypedDescendantIterator
-
- /**
- * Iterator that returns the descendants of a given node.
- * I'm not exactly clear about this one... -sb
- */
- public class NthDescendantIterator extends DescendantIterator
- {
-
- /** The current nth position. */
- int _pos;
-
- /**
- * Constructor NthDescendantIterator
- *
- *
- * @param pos The nth position being requested.
- */
- public NthDescendantIterator(int pos)
- {
- _pos = pos;
- }
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next()
- {
-
- // I'm not exactly clear yet what this is doing... -sb
- int node;
-
- while ((node = super.next()) != END)
- {
- node = makeNodeIdentity(node);
-
- int parent = _parent(node);
- int child = _firstch(parent);
- int pos = 0;
-
- do
- {
- int type = _type(child);
-
- if (ELEMENT_NODE == type)
- pos++;
- }
- while ((pos < _pos) && (child = _nextsib(child)) != END);
-
- if (node == child)
- return node;
- }
-
- return (END);
- }
- } // end of NthDescendantIterator
-
- /**
- * Class SingletonIterator.
- */
- public class SingletonIterator extends InternalAxisIteratorBase
- {
-
- /** (not sure yet what this is. -sb) (sc & sb remove final to compile in JDK 1.1.8) */
- private boolean _isConstant;
-
- /**
- * Constructor SingletonIterator
- *
- */
- public SingletonIterator()
- {
- this(Integer.MIN_VALUE, false);
- }
-
- /**
- * Constructor SingletonIterator
- *
- *
- * @param node The node handle to return.
- */
- public SingletonIterator(int node)
- {
- this(node, false);
- }
-
- /**
- * Constructor SingletonIterator
- *
- *
- * @param node the node handle to return.
- * @param constant (Not sure what this is yet. -sb)
- */
- public SingletonIterator(int node, boolean constant)
- {
- _currentNode = _startNode = node;
- _isConstant = constant;
- }
-
- /**
- * Set start to END should 'close' the iterator,
- * i.e. subsequent call to next() should return END.
- *
- * @param node Sets the root of the iteration.
- *
- * @return A DTMAxisIterator set to the start of the iteration.
- */
- public DTMAxisIterator setStartNode(int node)
- {
-//%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
- if (node == DTMDefaultBase.ROOTNODE)
- node = getDocument();
- if (_isConstant)
- {
- _currentNode = _startNode;
-
- return resetPosition();
- }
- else if (_isRestartable)
- {
- _currentNode = _startNode = node;
-
- return resetPosition();
- }
-
- return this;
- }
-
- /**
- * Resets the iterator to the last start node.
- *
- * @return A DTMAxisIterator, which may or may not be the same as this
- * iterator.
- */
- public DTMAxisIterator reset()
- {
-
- if (_isConstant)
- {
- _currentNode = _startNode;
-
- return resetPosition();
- }
- else
- {
- final boolean temp = _isRestartable;
-
- _isRestartable = true;
-
- setStartNode(_startNode);
-
- _isRestartable = temp;
- }
-
- return this;
- }
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next()
- {
-
- final int result = _currentNode;
-
- _currentNode = END;
-
- return returnNode(result);
- }
- } // end of SingletonIterator
-
- /**
- * Iterator that returns a given node only if it is of a given type.
- */
- public final class TypedSingletonIterator extends SingletonIterator
- {
-
- /** The extended type ID that was requested. */
- private final int _nodeType;
-
- /**
- * Constructor TypedSingletonIterator
- *
- *
- * @param nodeType The extended type ID being requested.
- */
- public TypedSingletonIterator(int nodeType)
- {
- _nodeType = nodeType;
- }
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next()
- {
-
- //final int result = super.next();
- final int result = _currentNode;
- int nodeType = _nodeType;
-
- _currentNode = END;
-
- if (nodeType >= DTM.NTYPES) {
- if (getExpandedTypeID(result) == nodeType) {
- return returnNode(result);
- }
- } else {
- if (getNodeType(result) == nodeType) {
- return returnNode(result);
- }
- }
-
- return NULL;
- }
- } // end of TypedSingletonIterator
-}
diff --git a/src/com/sun/org/apache/xml/internal/dtm/ref/DTMDefaultBaseTraversers.java b/src/com/sun/org/apache/xml/internal/dtm/ref/DTMDefaultBaseTraversers.java
deleted file mode 100644
index c335454..0000000
--- a/src/com/sun/org/apache/xml/internal/dtm/ref/DTMDefaultBaseTraversers.java
+++ /dev/null
@@ -1,1747 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DTMDefaultBaseTraversers.java,v 1.2.4.1 2005/09/15 08:15:00 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.dtm.ref;
-
-import com.sun.org.apache.xml.internal.dtm.*;
-
-import javax.xml.transform.Source;
-
-import com.sun.org.apache.xml.internal.utils.XMLStringFactory;
-
-import com.sun.org.apache.xml.internal.res.XMLErrorResources;
-import com.sun.org.apache.xml.internal.res.XMLMessages;
-import com.sun.org.apache.xalan.internal.xsltc.dom.NodeCounter;
-
-/**
- * This class implements the traversers for DTMDefaultBase.
- *
- * PLEASE NOTE that the public interface for all traversers should be
- * in terms of DTM Node Handles... but they may use the internal node
- * identity indices within their logic, for efficiency's sake. Be very
- * careful to avoid confusing these when maintaining this code.
- * */
-public abstract class DTMDefaultBaseTraversers extends DTMDefaultBase
-{
-
- /**
- * Construct a DTMDefaultBaseTraversers object from a DOM node.
- *
- * @param mgr The DTMManager who owns this DTM.
- * @param source The object that is used to specify the construction source.
- * @param dtmIdentity The DTM identity ID for this DTM.
- * @param whiteSpaceFilter The white space filter for this DTM, which may
- * be null.
- * @param xstringfactory The factory to use for creating XMLStrings.
- * @param doIndexing true if the caller considers it worth it to use
- * indexing schemes.
- */
- public DTMDefaultBaseTraversers(DTMManager mgr, Source source,
- int dtmIdentity,
- DTMWSFilter whiteSpaceFilter,
- XMLStringFactory xstringfactory,
- boolean doIndexing)
- {
- super(mgr, source, dtmIdentity, whiteSpaceFilter, xstringfactory,
- doIndexing);
- }
-
- /**
- * Construct a DTMDefaultBaseTraversers object from a DOM node.
- *
- * @param mgr The DTMManager who owns this DTM.
- * @param source The object that is used to specify the construction source.
- * @param dtmIdentity The DTM identity ID for this DTM.
- * @param whiteSpaceFilter The white space filter for this DTM, which may
- * be null.
- * @param xstringfactory The factory to use for creating XMLStrings.
- * @param doIndexing true if the caller considers it worth it to use
- * indexing schemes.
- * @param blocksize The block size of the DTM.
- * @param usePrevsib true if we want to build the previous sibling node array.
- * @param newNameTable true if we want to use a new ExpandedNameTable for this DTM.
- */
- public DTMDefaultBaseTraversers(DTMManager mgr, Source source,
- int dtmIdentity,
- DTMWSFilter whiteSpaceFilter,
- XMLStringFactory xstringfactory,
- boolean doIndexing,
- int blocksize,
- boolean usePrevsib,
- boolean newNameTable)
- {
- super(mgr, source, dtmIdentity, whiteSpaceFilter, xstringfactory,
- doIndexing, blocksize, usePrevsib, newNameTable);
- }
-
- /**
- * This returns a stateless "traverser", that can navigate
- * over an XPath axis, though perhaps not in document order.
- *
- * @param axis One of Axes.ANCESTORORSELF, etc.
- *
- * @return A DTMAxisTraverser, or null if the given axis isn't supported.
- */
- public DTMAxisTraverser getAxisTraverser(final int axis)
- {
-
- DTMAxisTraverser traverser;
-
- if (null == m_traversers) // Cache of stateless traversers for this DTM
- {
- m_traversers = new DTMAxisTraverser[Axis.getNamesLength()];
- traverser = null;
- }
- else
- {
- traverser = m_traversers[axis]; // Share/reuse existing traverser
-
- if (traverser != null)
- return traverser;
- }
-
- switch (axis) // Generate new traverser
- {
- case Axis.ANCESTOR :
- traverser = new AncestorTraverser();
- break;
- case Axis.ANCESTORORSELF :
- traverser = new AncestorOrSelfTraverser();
- break;
- case Axis.ATTRIBUTE :
- traverser = new AttributeTraverser();
- break;
- case Axis.CHILD :
- traverser = new ChildTraverser();
- break;
- case Axis.DESCENDANT :
- traverser = new DescendantTraverser();
- break;
- case Axis.DESCENDANTORSELF :
- traverser = new DescendantOrSelfTraverser();
- break;
- case Axis.FOLLOWING :
- traverser = new FollowingTraverser();
- break;
- case Axis.FOLLOWINGSIBLING :
- traverser = new FollowingSiblingTraverser();
- break;
- case Axis.NAMESPACE :
- traverser = new NamespaceTraverser();
- break;
- case Axis.NAMESPACEDECLS :
- traverser = new NamespaceDeclsTraverser();
- break;
- case Axis.PARENT :
- traverser = new ParentTraverser();
- break;
- case Axis.PRECEDING :
- traverser = new PrecedingTraverser();
- break;
- case Axis.PRECEDINGSIBLING :
- traverser = new PrecedingSiblingTraverser();
- break;
- case Axis.SELF :
- traverser = new SelfTraverser();
- break;
- case Axis.ALL :
- traverser = new AllFromRootTraverser();
- break;
- case Axis.ALLFROMNODE :
- traverser = new AllFromNodeTraverser();
- break;
- case Axis.PRECEDINGANDANCESTOR :
- traverser = new PrecedingAndAncestorTraverser();
- break;
- case Axis.DESCENDANTSFROMROOT :
- traverser = new DescendantFromRootTraverser();
- break;
- case Axis.DESCENDANTSORSELFFROMROOT :
- traverser = new DescendantOrSelfFromRootTraverser();
- break;
- case Axis.ROOT :
- traverser = new RootTraverser();
- break;
- case Axis.FILTEREDLIST :
- return null; // Don't want to throw an exception for this one.
- default :
- throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_UNKNOWN_AXIS_TYPE, new Object[]{Integer.toString(axis)})); //"Unknown axis traversal type: "+axis);
- }
-
- if (null == traverser)
- throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_AXIS_TRAVERSER_NOT_SUPPORTED, new Object[]{Axis.getNames(axis)}));
- // "Axis traverser not supported: "
- // + Axis.names[axis]);
-
- m_traversers[axis] = traverser;
-
- return traverser;
- }
-
- /**
- * Implements traversal of the Ancestor access, in reverse document order.
- */
- private class AncestorTraverser extends DTMAxisTraverser
- {
-
- /**
- * Traverse to the next node after the current node.
- *
- * @param context The context node if this iteration.
- * @param current The current node of the iteration.
- *
- * @return the next node in the iteration, or DTM.NULL.
- */
- public int next(int context, int current)
- {
- return getParent(current);
- }
-
- /**
- * Traverse to the next node after the current node that is matched
- * by the expanded type ID.
- *
- * @param context The context node of this iteration.
- * @param current The current node of the iteration.
- * @param expandedTypeID The expanded type ID that must match.
- *
- * @return the next node in the iteration, or DTM.NULL.
- */
- public int next(int context, int current, int expandedTypeID)
- {
- // Process using identities
- current = makeNodeIdentity(current);
-
- while (DTM.NULL != (current = m_parent.elementAt(current)))
- {
- if (m_exptype.elementAt(current) == expandedTypeID)
- return makeNodeHandle(current);
- }
-
- return NULL;
- }
- }
-
- /**
- * Implements traversal of the Ancestor access, in reverse document order.
- */
- private class AncestorOrSelfTraverser extends AncestorTraverser
- {
-
- /**
- * By the nature of the stateless traversal, the context node can not be
- * returned or the iteration will go into an infinate loop. To see if
- * the self node should be processed, use this function.
- *
- * @param context The context node of this traversal.
- *
- * @return the first node in the traversal.
- */
- public int first(int context)
- {
- return context;
- }
-
- /**
- * By the nature of the stateless traversal, the context node can not be
- * returned or the iteration will go into an infinate loop. To see if
- * the self node should be processed, use this function. If the context
- * node does not match the expanded type ID, this function will return
- * false.
- *
- * @param context The context node of this traversal.
- * @param expandedTypeID The expanded type ID that must match.
- *
- * @return the first node in the traversal.
- */
- public int first(int context, int expandedTypeID)
- {
- return (getExpandedTypeID(context) == expandedTypeID)
- ? context : next(context, context, expandedTypeID);
- }
- }
-
- /**
- * Implements traversal of the Attribute access
- */
- private class AttributeTraverser extends DTMAxisTraverser
- {
-
- /**
- * Traverse to the next node after the current node.
- *
- * @param context The context node of this iteration.
- * @param current The current node of the iteration.
- *
- * @return the next node in the iteration, or DTM.NULL.
- */
- public int next(int context, int current)
- {
- return (context == current)
- ? getFirstAttribute(context) : getNextAttribute(current);
- }
-
- /**
- * Traverse to the next node after the current node that is matched
- * by the expanded type ID.
- *
- * @param context The context node of this iteration.
- * @param current The current node of the iteration.
- * @param expandedTypeID The expanded type ID that must match.
- *
- * @return the next node in the iteration, or DTM.NULL.
- */
- public int next(int context, int current, int expandedTypeID)
- {
-
- current = (context == current)
- ? getFirstAttribute(context) : getNextAttribute(current);
-
- do
- {
- if (getExpandedTypeID(current) == expandedTypeID)
- return current;
- }
- while (DTM.NULL != (current = getNextAttribute(current)));
-
- return NULL;
- }
- }
-
- /**
- * Implements traversal of the Ancestor access, in reverse document order.
- */
- private class ChildTraverser extends DTMAxisTraverser
- {
-
- /**
- * Get the next indexed node that matches the expanded type ID. Before
- * calling this function, one should first call
- * {@link #isIndexed(int) isIndexed} to make sure that the index can
- * contain nodes that match the given expanded type ID.
- *
- * @param axisRoot The root identity of the axis.
- * @param nextPotential The node found must match or occur after this node.
- * @param expandedTypeID The expanded type ID for the request.
- *
- * @return The node ID or NULL if not found.
- */
- protected int getNextIndexed(int axisRoot, int nextPotential,
- int expandedTypeID)
- {
-
- int nsIndex = m_expandedNameTable.getNamespaceID(expandedTypeID);
- int lnIndex = m_expandedNameTable.getLocalNameID(expandedTypeID);
-
- for (; ; )
- {
- int nextID = findElementFromIndex(nsIndex, lnIndex, nextPotential);
-
- if (NOTPROCESSED != nextID)
- {
- int parentID = m_parent.elementAt(nextID);
-
- // Is it a child?
- if(parentID == axisRoot)
- return nextID;
-
- // If the parent occured before the subtree root, then
- // we know it is past the child axis.
- if(parentID < axisRoot)
- return NULL;
-
- // Otherwise, it could be a descendant below the subtree root
- // children, or it could be after the subtree root. So we have
- // to climb up until the parent is less than the subtree root, in
- // which case we return NULL, or until it is equal to the subtree
- // root, in which case we continue to look.
- do
- {
- parentID = m_parent.elementAt(parentID);
- if(parentID < axisRoot)
- return NULL;
- }
- while(parentID > axisRoot);
-
- // System.out.println("Found node via index: "+first);
- nextPotential = nextID+1;
- continue;
- }
-
- nextNode();
-
- if(!(m_nextsib.elementAt(axisRoot) == NOTPROCESSED))
- break;
- }
-
- return DTM.NULL;
- }
-
- /**
- * By the nature of the stateless traversal, the context node can not be
- * returned or the iteration will go into an infinate loop. So to traverse
- * an axis, the first function must be used to get the first node.
- *
- * <p>This method needs to be overloaded only by those axis that process
- * the self node. <\p>
- *
- * @param context The context node of this traversal. This is the point
- * that the traversal starts from.
- * @return the first node in the traversal.
- */
- public int first(int context)
- {
- return getFirstChild(context);
- }
-
- /**
- * By the nature of the stateless traversal, the context node can not be
- * returned or the iteration will go into an infinate loop. So to traverse
- * an axis, the first function must be used to get the first node.
- *
- * <p>This method needs to be overloaded only by those axis that process
- * the self node. <\p>
- *
- * @param context The context node of this traversal. This is the point
- * of origin for the traversal -- its "root node" or starting point.
- * @param expandedTypeID The expanded type ID that must match.
- *
- * @return the first node in the traversal.
- */
- public int first(int context, int expandedTypeID)
- {
- if(true)
- {
- int identity = makeNodeIdentity(context);
-
- int firstMatch = getNextIndexed(identity, _firstch(identity),
- expandedTypeID);
-
- return makeNodeHandle(firstMatch);
- }
- else
- {
- // %REVIEW% Dead code. Eliminate?
- for (int current = _firstch(makeNodeIdentity(context));
- DTM.NULL != current;
- current = _nextsib(current))
- {
- if (m_exptype.elementAt(current) == expandedTypeID)
- return makeNodeHandle(current);
- }
- return NULL;
- }
- }
-
- /**
- * Traverse to the next node after the current node.
- *
- * @param context The context node of this iteration.
- * @param current The current node of the iteration.
- *
- * @return the next node in the iteration, or DTM.NULL.
- */
- public int next(int context, int current)
- {
- return getNextSibling(current);
- }
-
- /**
- * Traverse to the next node after the current node that is matched
- * by the expanded type ID.
- *
- * @param context The context node of this iteration.
- * @param current The current node of the iteration.
- * @param expandedTypeID The expanded type ID that must match.
- *
- * @return the next node in the iteration, or DTM.NULL.
- */
- public int next(int context, int current, int expandedTypeID)
- {
- // Process in Identifier space
- for (current = _nextsib(makeNodeIdentity(current));
- DTM.NULL != current;
- current = _nextsib(current))
- {
- if (m_exptype.elementAt(current) == expandedTypeID)
- return makeNodeHandle(current);
- }
-
- return NULL;
- }
- }
-
- /**
- * Super class for derived classes that want a convenient way to access
- * the indexing mechanism.
- */
- private abstract class IndexedDTMAxisTraverser extends DTMAxisTraverser
- {
-
- /**
- * Tell if the indexing is on and the given expanded type ID matches
- * what is in the indexes. Derived classes should call this before
- * calling {@link #getNextIndexed(int, int, int) getNextIndexed} method.
- *
- * @param expandedTypeID The expanded type ID being requested.
- *
- * @return true if it is OK to call the
- * {@link #getNextIndexed(int, int, int) getNextIndexed} method.
- */
- protected final boolean isIndexed(int expandedTypeID)
- {
- return (m_indexing
- && ExpandedNameTable.ELEMENT
- == m_expandedNameTable.getType(expandedTypeID));
- }
-
- /**
- * Tell if a node is outside the axis being traversed. This method must be
- * implemented by derived classes, and must be robust enough to handle any
- * node that occurs after the axis root.
- *
- * @param axisRoot The root identity of the axis.
- * @param identity The node in question.
- *
- * @return true if the given node falls outside the axis being traversed.
- */
- protected abstract boolean isAfterAxis(int axisRoot, int identity);
-
- /**
- * Tell if the axis has been fully processed to tell if a the wait for
- * an arriving node should terminate. This method must be implemented
- * be a derived class.
- *
- * @param axisRoot The root identity of the axis.
- *
- * @return true if the axis has been fully processed.
- */
- protected abstract boolean axisHasBeenProcessed(int axisRoot);
-
- /**
- * Get the next indexed node that matches the expanded type ID. Before
- * calling this function, one should first call
- * {@link #isIndexed(int) isIndexed} to make sure that the index can
- * contain nodes that match the given expanded type ID.
- *
- * @param axisRoot The root identity of the axis.
- * @param nextPotential The node found must match or occur after this node.
- * @param expandedTypeID The expanded type ID for the request.
- *
- * @return The node ID or NULL if not found.
- */
- protected int getNextIndexed(int axisRoot, int nextPotential,
- int expandedTypeID)
- {
-
- int nsIndex = m_expandedNameTable.getNamespaceID(expandedTypeID);
- int lnIndex = m_expandedNameTable.getLocalNameID(expandedTypeID);
-
- while(true)
- {
- int next = findElementFromIndex(nsIndex, lnIndex, nextPotential);
-
- if (NOTPROCESSED != next)
- {
- if (isAfterAxis(axisRoot, next))
- return NULL;
-
- // System.out.println("Found node via index: "+first);
- return next;
- }
- else if(axisHasBeenProcessed(axisRoot))
- break;
-
- nextNode();
- }
-
- return DTM.NULL;
- }
- }
-
- /**
- * Implements traversal of the Ancestor access, in reverse document order.
- */
- private class DescendantTraverser extends IndexedDTMAxisTraverser
- {
- /**
- * Get the first potential identity that can be returned. This should
- * be overridded by classes that need to return the self node.
- *
- * @param identity The node identity of the root context of the traversal.
- *
- * @return The first potential node that can be in the traversal.
- */
- protected int getFirstPotential(int identity)
- {
- return identity + 1;
- }
-
- /**
- * Tell if the axis has been fully processed to tell if a the wait for
- * an arriving node should terminate.
- *
- * @param axisRoot The root identity of the axis.
- *
- * @return true if the axis has been fully processed.
- */
- protected boolean axisHasBeenProcessed(int axisRoot)
- {
- return !(m_nextsib.elementAt(axisRoot) == NOTPROCESSED);
- }
-
- /**
- * Get the subtree root identity from the handle that was passed in by
- * the caller. Derived classes may override this to change the root
- * context of the traversal.
- *
- * @param handle handle to the root context.
- * @return identity of the root of the subtree.
- */
- protected int getSubtreeRoot(int handle)
- {
- return makeNodeIdentity(handle);
- }
-
- /**
- * Tell if this node identity is a descendant. Assumes that
- * the node info for the element has already been obtained.
- *
- * %REVIEW% This is really parentFollowsRootInDocumentOrder ...
- * which fails if the parent starts after the root ends.
- * May be sufficient for this class's logic, but misleadingly named!
- *
- * @param subtreeRootIdentity The root context of the subtree in question.
- * @param identity The index number of the node in question.
- * @return true if the index is a descendant of _startNode.
- */
- protected boolean isDescendant(int subtreeRootIdentity, int identity)
- {
- return _parent(identity) >= subtreeRootIdentity;
- }
-
- /**
- * Tell if a node is outside the axis being traversed. This method must be
- * implemented by derived classes, and must be robust enough to handle any
- * node that occurs after the axis root.
- *
- * @param axisRoot The root identity of the axis.
- * @param identity The node in question.
- *
- * @return true if the given node falls outside the axis being traversed.
- */
- protected boolean isAfterAxis(int axisRoot, int identity)
- {
- // %REVIEW% Is there *any* cheaper way to do this?
- // Yes. In ID space, compare to axisRoot's successor
- // (next-sib or ancestor's-next-sib). Probably shallower search.
- do
- {
- if(identity == axisRoot)
- return false;
- identity = m_parent.elementAt(identity);
- }
- while(identity >= axisRoot);
-
- return true;
- }
-
- /**
- * By the nature of the stateless traversal, the context node can not be
- * returned or the iteration will go into an infinate loop. So to traverse
- * an axis, the first function must be used to get the first node.
- *
- * <p>This method needs to be overloaded only by those axis that process
- * the self node. <\p>
- *
- * @param context The context node of this traversal. This is the point
- * of origin for the traversal -- its "root node" or starting point.
- * @param expandedTypeID The expanded type ID that must match.
- *
- * @return the first node in the traversal.
- */
- public int first(int context, int expandedTypeID)
- {
-
- if (isIndexed(expandedTypeID))
- {
- int identity = getSubtreeRoot(context);
- int firstPotential = getFirstPotential(identity);
-
- return makeNodeHandle(getNextIndexed(identity, firstPotential, expandedTypeID));
- }
-
- return next(context, context, expandedTypeID);
- }
-
- /**
- * Traverse to the next node after the current node.
- *
- * @param context The context node of this iteration.
- * @param current The current node of the iteration.
- *
- * @return the next node in the iteration, or DTM.NULL.
- */
- public int next(int context, int current)
- {
-
- int subtreeRootIdent = getSubtreeRoot(context);
-
- for (current = makeNodeIdentity(current) + 1; ; current++)
- {
- int type = _type(current); // may call nextNode()
-
- if (!isDescendant(subtreeRootIdent, current))
- return NULL;
-
- if (ATTRIBUTE_NODE == type || NAMESPACE_NODE == type)
- continue;
-
- return makeNodeHandle(current); // make handle.
- }
- }
-
- /**
- * Traverse to the next node after the current node that is matched
- * by the expanded type ID.
- *
- * @param context The context node of this iteration.
- * @param current The current node of the iteration.
- * @param expandedTypeID The expanded type ID that must match.
- *
- * @return the next node in the iteration, or DTM.NULL.
- */
- public int next(int context, int current, int expandedTypeID)
- {
-
- int subtreeRootIdent = getSubtreeRoot(context);
-
- current = makeNodeIdentity(current) + 1;
-
- if (isIndexed(expandedTypeID))
- {
- return makeNodeHandle(getNextIndexed(subtreeRootIdent, current, expandedTypeID));
- }
-
- for (; ; current++)
- {
- int exptype = _exptype(current); // may call nextNode()
-
- if (!isDescendant(subtreeRootIdent, current))
- return NULL;
-
- if (exptype != expandedTypeID)
- continue;
-
- return makeNodeHandle(current); // make handle.
- }
- }
- }
-
- /**
- * Implements traversal of the Ancestor access, in reverse document order.
- */
- private class DescendantOrSelfTraverser extends DescendantTraverser
- {
-
- /**
- * Get the first potential identity that can be returned, which is the
- * axis context, in this case.
- *
- * @param identity The node identity of the root context of the traversal.
- *
- * @return The axis context.
- */
- protected int getFirstPotential(int identity)
- {
- return identity;
- }
-
- /**
- * By the nature of the stateless traversal, the context node can not be
- * returned or the iteration will go into an infinate loop. To see if
- * the self node should be processed, use this function.
- *
- * @param context The context node of this traversal.
- *
- * @return the first node in the traversal.
- */
- public int first(int context)
- {
- return context;
- }
- }
-
- /**
- * Implements traversal of the entire subtree, including the root node.
- */
- private class AllFromNodeTraverser extends DescendantOrSelfTraverser
- {
-
- /**
- * Traverse to the next node after the current node.
- *
- * @param context The context node of this iteration.
- * @param current The current node of the iteration.
- *
- * @return the next node in the iteration, or DTM.NULL.
- */
- public int next(int context, int current)
- {
-
- int subtreeRootIdent = makeNodeIdentity(context);
-
- for (current = makeNodeIdentity(current) + 1; ; current++)
- {
- // Trickological code: _exptype() has the side-effect of
- // running nextNode until the specified node has been loaded,
- // and thus can be used to ensure that incremental construction of
- // the DTM has gotten this far. Using it just for that side-effect
- // is quite a kluge...
- _exptype(current); // make sure it's here.
-
- if (!isDescendant(subtreeRootIdent, current))
- return NULL;
-
- return makeNodeHandle(current); // make handle.
- }
- }
- }
-
- /**
- * Implements traversal of the following access, in document order.
- */
- private class FollowingTraverser extends DescendantTraverser
- {
-
- /**
- * Get the first of the following.
- *
- * @param context The context node of this traversal. This is the point
- * that the traversal starts from.
- * @return the first node in the traversal.
- */
- public int first(int context)
- {
- // Compute in ID space
- context=makeNodeIdentity(context);
-
- int first;
- int type = _type(context);
-
- if ((DTM.ATTRIBUTE_NODE == type) || (DTM.NAMESPACE_NODE == type))
- {
- context = _parent(context);
- first = _firstch(context);
-
- if (NULL != first)
- return makeNodeHandle(first);
- }
-
- do
- {
- first = _nextsib(context);
-
- if (NULL == first)
- context = _parent(context);
- }
- while (NULL == first && NULL != context);
-
- return makeNodeHandle(first);
- }
-
- /**
- * Get the first of the following.
- *
- * @param context The context node of this traversal. This is the point
- * of origin for the traversal -- its "root node" or starting point.
- * @param expandedTypeID The expanded type ID that must match.
- *
- * @return the first node in the traversal.
- */
- public int first(int context, int expandedTypeID)
- {
- // %REVIEW% This looks like it might want shift into identity space
- // to avoid repeated conversion in the individual functions
- int first;
- int type = getNodeType(context);
-
- if ((DTM.ATTRIBUTE_NODE == type) || (DTM.NAMESPACE_NODE == type))
- {
- context = getParent(context);
- first = getFirstChild(context);
-
- if (NULL != first)
- {
- if (getExpandedTypeID(first) == expandedTypeID)
- return first;
- else
- return next(context, first, expandedTypeID);
- }
- }
-
- do
- {
- first = getNextSibling(context);
-
- if (NULL == first)
- context = getParent(context);
- else
- {
- if (getExpandedTypeID(first) == expandedTypeID)
- return first;
- else
- return next(context, first, expandedTypeID);
- }
- }
- while (NULL == first && NULL != context);
-
- return first;
- }
-
- /**
- * Traverse to the next node after the current node.
- *
- * @param context The context node of this iteration.
- * @param current The current node of the iteration.
- *
- * @return the next node in the iteration, or DTM.NULL.
- */
- public int next(int context, int current)
- {
- // Compute in identity space
- current=makeNodeIdentity(current);
-
- while (true)
- {
- current++; // Only works on IDs, not handles.
-
- // %REVIEW% Are we using handles or indexes?
- int type = _type(current); // may call nextNode()
-
- if (NULL == type)
- return NULL;
-
- if (ATTRIBUTE_NODE == type || NAMESPACE_NODE == type)
- continue;
-
- return makeNodeHandle(current); // make handle.
- }
- }
-
- /**
- * Traverse to the next node after the current node that is matched
- * by the expanded type ID.
- *
- * @param context The context node of this iteration.
- * @param current The current node of the iteration.
- * @param expandedTypeID The expanded type ID that must match.
- *
- * @return the next node in the iteration, or DTM.NULL.
- */
- public int next(int context, int current, int expandedTypeID)
- {
- // Compute in ID space
- current=makeNodeIdentity(current);
-
- while (true)
- {
- current++;
-
- int etype = _exptype(current); // may call nextNode()
-
- if (NULL == etype)
- return NULL;
-
- if (etype != expandedTypeID)
- continue;
-
- return makeNodeHandle(current); // make handle.
- }
- }
- }
-
- /**
- * Implements traversal of the Ancestor access, in reverse document order.
- */
- private class FollowingSiblingTraverser extends DTMAxisTraverser
- {
-
- /**
- * Traverse to the next node after the current node.
- *
- * @param context The context node of this iteration.
- * @param current The current node of the iteration.
- *
- * @return the next node in the iteration, or DTM.NULL.
- */
- public int next(int context, int current)
- {
- return getNextSibling(current);
- }
-
- /**
- * Traverse to the next node after the current node that is matched
- * by the expanded type ID.
- *
- * @param context The context node of this iteration.
- * @param current The current node of the iteration.
- * @param expandedTypeID The expanded type ID that must match.
- *
- * @return the next node in the iteration, or DTM.NULL.
- */
- public int next(int context, int current, int expandedTypeID)
- {
-
- while (DTM.NULL != (current = getNextSibling(current)))
- {
- if (getExpandedTypeID(current) == expandedTypeID)
- return current;
- }
-
- return NULL;
- }
- }
-
- /**
- * Implements traversal of the Ancestor access, in reverse document order.
- */
- private class NamespaceDeclsTraverser extends DTMAxisTraverser
- {
-
- /**
- * Traverse to the next node after the current node.
- *
- * @param context The context node of this iteration.
- * @param current The current node of the iteration.
- *
- * @return the next node in the iteration, or DTM.NULL.
- */
- public int next(int context, int current)
- {
-
- return (context == current)
- ? getFirstNamespaceNode(context, false)
- : getNextNamespaceNode(context, current, false);
- }
-
- /**
- * Traverse to the next node after the current node that is matched
- * by the expanded type ID.
- *
- * @param context The context node of this iteration.
- * @param current The current node of the iteration.
- * @param expandedTypeID The expanded type ID that must match.
- *
- * @return the next node in the iteration, or DTM.NULL.
- */
- public int next(int context, int current, int expandedTypeID)
- {
-
- current = (context == current)
- ? getFirstNamespaceNode(context, false)
- : getNextNamespaceNode(context, current, false);
-
- do
- {
- if (getExpandedTypeID(current) == expandedTypeID)
- return current;
- }
- while (DTM.NULL
- != (current = getNextNamespaceNode(context, current, false)));
-
- return NULL;
- }
- }
-
- /**
- * Implements traversal of the Ancestor access, in reverse document order.
- */
- private class NamespaceTraverser extends DTMAxisTraverser
- {
-
- /**
- * Traverse to the next node after the current node.
- *
- * @param context The context node of this iteration.
- * @param current The current node of the iteration.
- *
- * @return the next node in the iteration, or DTM.NULL.
- */
- public int next(int context, int current)
- {
-
- return (context == current)
- ? getFirstNamespaceNode(context, true)
- : getNextNamespaceNode(context, current, true);
- }
-
- /**
- * Traverse to the next node after the current node that is matched
- * by the expanded type ID.
- *
- * @param context The context node of this iteration.
- * @param current The current node of the iteration.
- * @param expandedTypeID The expanded type ID that must match.
- *
- * @return the next node in the iteration, or DTM.NULL.
- */
- public int next(int context, int current, int expandedTypeID)
- {
-
- current = (context == current)
- ? getFirstNamespaceNode(context, true)
- : getNextNamespaceNode(context, current, true);
-
- do
- {
- if (getExpandedTypeID(current) == expandedTypeID)
- return current;
- }
- while (DTM.NULL
- != (current = getNextNamespaceNode(context, current, true)));
-
- return NULL;
- }
- }
-
- /**
- * Implements traversal of the Ancestor access, in reverse document order.
- */
- private class ParentTraverser extends DTMAxisTraverser
- {
- /**
- * By the nature of the stateless traversal, the context node can not be
- * returned or the iteration will go into an infinate loop. So to traverse
- * an axis, the first function must be used to get the first node.
- *
- * <p>This method needs to be overloaded only by those axis that process
- * the self node. <\p>
- *
- * @param context The context node of this traversal. This is the point
- * that the traversal starts from.
- * @return the first node in the traversal.
- */
- public int first(int context)
- {
- return getParent(context);
- }
-
- /**
- * By the nature of the stateless traversal, the context node can not be
- * returned or the iteration will go into an infinate loop. So to traverse
- * an axis, the first function must be used to get the first node.
- *
- * <p>This method needs to be overloaded only by those axis that process
- * the self node. <\p>
- *
- * @param context The context node of this traversal. This is the point
- * of origin for the traversal -- its "root node" or starting point.
- * @param expandedTypeID The expanded type ID that must match.
- *
- * @return the first node in the traversal.
- */
- public int first(int current, int expandedTypeID)
- {
- // Compute in ID space
- current = makeNodeIdentity(current);
-
- while (NULL != (current = m_parent.elementAt(current)))
- {
- if (m_exptype.elementAt(current) == expandedTypeID)
- return makeNodeHandle(current);
- }
-
- return NULL;
- }
-
-
- /**
- * Traverse to the next node after the current node.
- *
- * @param context The context node of this iteration.
- * @param current The current node of the iteration.
- *
- * @return the next node in the iteration, or DTM.NULL.
- */
- public int next(int context, int current)
- {
-
- return NULL;
- }
-
-
-
- /**
- * Traverse to the next node after the current node that is matched
- * by the expanded type ID.
- *
- * @param context The context node of this iteration.
- * @param current The current node of the iteration.
- * @param expandedTypeID The expanded type ID that must match.
- *
- * @return the next node in the iteration, or DTM.NULL.
- */
- public int next(int context, int current, int expandedTypeID)
- {
-
- return NULL;
- }
- }
-
- /**
- * Implements traversal of the Ancestor access, in reverse document order.
- */
- private class PrecedingTraverser extends DTMAxisTraverser
- {
-
- /**
- * Tell if the current identity is an ancestor of the context identity.
- * This is an expensive operation, made worse by the stateless traversal.
- * But the preceding axis is used fairly infrequently.
- *
- * @param contextIdent The context node of the axis traversal.
- * @param currentIdent The node in question.
- * @return true if the currentIdent node is an ancestor of contextIdent.
- */
- protected boolean isAncestor(int contextIdent, int currentIdent)
- {
- // %REVIEW% See comments in IsAfterAxis; using the "successor" of
- // contextIdent is probably more efficient.
- for (contextIdent = m_parent.elementAt(contextIdent); DTM.NULL != contextIdent;
- contextIdent = m_parent.elementAt(contextIdent))
- {
- if (contextIdent == currentIdent)
- return true;
- }
-
- return false;
- }
-
- /**
- * Traverse to the next node after the current node.
- *
- * @param context The context node of this iteration.
- * @param current The current node of the iteration.
- *
- * @return the next node in the iteration, or DTM.NULL.
- */
- public int next(int context, int current)
- {
- // compute in ID space
- int subtreeRootIdent = makeNodeIdentity(context);
-
- for (current = makeNodeIdentity(current) - 1; current >= 0; current--)
- {
- short type = _type(current);
-
- if (ATTRIBUTE_NODE == type || NAMESPACE_NODE == type
- || isAncestor(subtreeRootIdent, current))
- continue;
-
- return makeNodeHandle(current); // make handle.
- }
-
- return NULL;
- }
-
- /**
- * Traverse to the next node after the current node that is matched
- * by the expanded type ID.
- *
- * @param context The context node of this iteration.
- * @param current The current node of the iteration.
- * @param expandedTypeID The expanded type ID that must match.
- *
- * @return the next node in the iteration, or DTM.NULL.
- */
- public int next(int context, int current, int expandedTypeID)
- {
- // Compute in ID space
- int subtreeRootIdent = makeNodeIdentity(context);
-
- for (current = makeNodeIdentity(current) - 1; current >= 0; current--)
- {
- int exptype = m_exptype.elementAt(current);
-
- if (exptype != expandedTypeID
- || isAncestor(subtreeRootIdent, current))
- continue;
-
- return makeNodeHandle(current); // make handle.
- }
-
- return NULL;
- }
- }
-
- /**
- * Implements traversal of the Ancestor and the Preceding axis,
- * in reverse document order.
- */
- private class PrecedingAndAncestorTraverser extends DTMAxisTraverser
- {
-
- /**
- * Traverse to the next node after the current node.
- *
- * @param context The context node of this iteration.
- * @param current The current node of the iteration.
- *
- * @return the next node in the iteration, or DTM.NULL.
- */
- public int next(int context, int current)
- {
- // Compute in ID space
- int subtreeRootIdent = makeNodeIdentity(context );
-
- for (current = makeNodeIdentity(current) - 1; current >= 0; current--)
- {
- short type = _type(current);
-
- if (ATTRIBUTE_NODE == type || NAMESPACE_NODE == type)
- continue;
-
- return makeNodeHandle(current); // make handle.
- }
-
- return NULL;
- }
-
- /**
- * Traverse to the next node after the current node that is matched
- * by the expanded type ID.
- *
- * @param context The context node of this iteration.
- * @param current The current node of the iteration.
- * @param expandedTypeID The expanded type ID that must match.
- *
- * @return the next node in the iteration, or DTM.NULL.
- */
- public int next(int context, int current, int expandedTypeID)
- {
- // Compute in ID space
- int subtreeRootIdent = makeNodeIdentity(context);
-
- for (current = makeNodeIdentity(current) - 1; current >= 0; current--)
- {
- int exptype = m_exptype.elementAt(current);
-
- if (exptype != expandedTypeID)
- continue;
-
- return makeNodeHandle(current); // make handle.
- }
-
- return NULL;
- }
- }
-
- /**
- * Implements traversal of the Ancestor access, in reverse document order.
- */
- private class PrecedingSiblingTraverser extends DTMAxisTraverser
- {
-
- /**
- * Traverse to the next node after the current node.
- *
- * @param context The context node of this iteration.
- * @param current The current node of the iteration.
- *
- * @return the next node in the iteration, or DTM.NULL.
- */
- public int next(int context, int current)
- {
- return getPreviousSibling(current);
- }
-
- /**
- * Traverse to the next node after the current node that is matched
- * by the expanded type ID.
- *
- * @param context The context node of this iteration.
- * @param current The current node of the iteration.
- * @param expandedTypeID The expanded type ID that must match.
- *
- * @return the next node in the iteration, or DTM.NULL.
- */
- public int next(int context, int current, int expandedTypeID)
- {
-
- while (DTM.NULL != (current = getPreviousSibling(current)))
- {
- if (getExpandedTypeID(current) == expandedTypeID)
- return current;
- }
-
- return NULL;
- }
- }
-
- /**
- * Implements traversal of the Self axis.
- */
- private class SelfTraverser extends DTMAxisTraverser
- {
-
- /**
- * By the nature of the stateless traversal, the context node can not be
- * returned or the iteration will go into an infinate loop. To see if
- * the self node should be processed, use this function.
- *
- * @param context The context node of this traversal.
- *
- * @return the first node in the traversal.
- */
- public int first(int context)
- {
- return context;
- }
-
- /**
- * By the nature of the stateless traversal, the context node can not be
- * returned or the iteration will go into an infinate loop. To see if
- * the self node should be processed, use this function. If the context
- * node does not match the expanded type ID, this function will return
- * false.
- *
- * @param context The context node of this traversal.
- * @param expandedTypeID The expanded type ID that must match.
- *
- * @return the first node in the traversal.
- */
- public int first(int context, int expandedTypeID)
- {
- return (getExpandedTypeID(context) == expandedTypeID) ? context : NULL;
- }
-
- /**
- * Traverse to the next node after the current node.
- *
- * @param context The context node of this iteration.
- * @param current The current node of the iteration.
- *
- * @return Always return NULL for this axis.
- */
- public int next(int context, int current)
- {
- return NULL;
- }
-
- /**
- * Traverse to the next node after the current node that is matched
- * by the expanded type ID.
- *
- * @param context The context node of this iteration.
- * @param current The current node of the iteration.
- * @param expandedTypeID The expanded type ID that must match.
- *
- * @return the next node in the iteration, or DTM.NULL.
- */
- public int next(int context, int current, int expandedTypeID)
- {
- return NULL;
- }
- }
-
- /**
- * Implements traversal of the Ancestor access, in reverse document order.
- */
- private class AllFromRootTraverser extends AllFromNodeTraverser
- {
-
- /**
- * Return the root.
- *
- * @param context The context node of this traversal.
- *
- * @return the first node in the traversal.
- */
- public int first(int context)
- {
- return getDocumentRoot(context);
- }
-
- /**
- * Return the root if it matches the expanded type ID.
- *
- * @param context The context node of this traversal.
- * @param expandedTypeID The expanded type ID that must match.
- *
- * @return the first node in the traversal.
- */
- public int first(int context, int expandedTypeID)
- {
- return (getExpandedTypeID(getDocumentRoot(context)) == expandedTypeID)
- ? context : next(context, context, expandedTypeID);
- }
-
- /**
- * Traverse to the next node after the current node.
- *
- * @param context The context node of this iteration.
- * @param current The current node of the iteration.
- *
- * @return the next node in the iteration, or DTM.NULL.
- */
- public int next(int context, int current)
- {
- // Compute in ID space
- int subtreeRootIdent = makeNodeIdentity(context);
-
- for (current = makeNodeIdentity(current) + 1; ; current++)
- {
- // Kluge test: Just make sure +1 yielded a real node
- int type = _type(current); // may call nextNode()
- if (type == NULL)
- return NULL;
-
- return makeNodeHandle(current); // make handle.
- }
- }
-
- /**
- * Traverse to the next node after the current node that is matched
- * by the expanded type ID.
- *
- * @param context The context node of this iteration.
- * @param current The current node of the iteration.
- * @param expandedTypeID The expanded type ID that must match.
- *
- * @return the next node in the iteration, or DTM.NULL.
- */
- public int next(int context, int current, int expandedTypeID)
- {
- // Compute in ID space
- int subtreeRootIdent = makeNodeIdentity(context);
-
- for (current = makeNodeIdentity(current) + 1; ; current++)
- {
- int exptype = _exptype(current); // may call nextNode()
-
- if (exptype == NULL)
- return NULL;
-
- if (exptype != expandedTypeID)
- continue;
-
- return makeNodeHandle(current); // make handle.
- }
- }
- }
-
- /**
- * Implements traversal of the Self axis.
- */
- private class RootTraverser extends AllFromRootTraverser
- {
- /**
- * Return the root if it matches the expanded type ID,
- * else return null (nothing found)
- *
- * @param context The context node of this traversal.
- * @param expandedTypeID The expanded type ID that must match.
- *
- * @return the first node in the traversal.
- */
- public int first(int context, int expandedTypeID)
- {
- int root=getDocumentRoot(context);
- return (getExpandedTypeID(root) == expandedTypeID)
- ? root : NULL;
- }
-
- /**
- * Traverse to the next node after the current node.
- *
- * @param context The context node of this iteration.
- * @param current The current node of the iteration.
- *
- * @return Always return NULL for this axis.
- */
- public int next(int context, int current)
- {
- return NULL;
- }
-
- /**
- * Traverse to the next node after the current node that is matched
- * by the expanded type ID.
- *
- * @param context The context node of this iteration.
- * @param current The current node of the iteration.
- * @param expandedTypeID The expanded type ID that must match.
- *
- * @return the next node in the iteration, or DTM.NULL.
- */
- public int next(int context, int current, int expandedTypeID)
- {
- return NULL;
- }
- }
-
- /**
- * A non-xpath axis, returns all nodes that aren't namespaces or attributes,
- * from and including the root.
- */
- private class DescendantOrSelfFromRootTraverser extends DescendantTraverser
- {
-
- /**
- * Get the first potential identity that can be returned, which is the axis
- * root context in this case.
- *
- * @param identity The node identity of the root context of the traversal.
- *
- * @return The identity argument.
- */
- protected int getFirstPotential(int identity)
- {
- return identity;
- }
-
- /**
- * Get the first potential identity that can be returned.
- * @param handle handle to the root context.
- * @return identity of the root of the subtree.
- */
- protected int getSubtreeRoot(int handle)
- {
- // %REVIEW% Shouldn't this always be 0?
- return makeNodeIdentity(getDocument());
- }
-
- /**
- * Return the root.
- *
- * @param context The context node of this traversal.
- *
- * @return the first node in the traversal.
- */
- public int first(int context)
- {
- return getDocumentRoot(context);
- }
-
- /**
- * By the nature of the stateless traversal, the context node can not be
- * returned or the iteration will go into an infinate loop. So to traverse
- * an axis, the first function must be used to get the first node.
- *
- * <p>This method needs to be overloaded only by those axis that process
- * the self node. <\p>
- *
- * @param context The context node of this traversal. This is the point
- * of origin for the traversal -- its "root node" or starting point.
- * @param expandedTypeID The expanded type ID that must match.
- *
- * @return the first node in the traversal.
- */
- public int first(int context, int expandedTypeID)
- {
- if (isIndexed(expandedTypeID))
- {
- int identity = 0;
- int firstPotential = getFirstPotential(identity);
-
- return makeNodeHandle(getNextIndexed(identity, firstPotential, expandedTypeID));
- }
-
- int root = first(context);
- return next(root, root, expandedTypeID);
- }
- }
-
- /**
- * A non-xpath axis, returns all nodes that aren't namespaces or attributes,
- * from but not including the root.
- */
- private class DescendantFromRootTraverser extends DescendantTraverser
- {
-
- /**
- * Get the first potential identity that can be returned, which is the axis
- * root context in this case.
- *
- * @param identity The node identity of the root context of the traversal.
- *
- * @return The identity argument.
- */
- protected int getFirstPotential(int identity)
- {
- return _firstch(0);
- }
-
- /**
- * Get the first potential identity that can be returned.
- * @param handle handle to the root context.
- * @return identity of the root of the subtree.
- */
- protected int getSubtreeRoot(int handle)
- {
- return 0;
- }
-
- /**
- * Return the root.
- *
- * @param context The context node of this traversal.
- *
- * @return the first node in the traversal.
- */
- public int first(int context)
- {
- return makeNodeHandle(_firstch(0));
- }
-
- /**
- * By the nature of the stateless traversal, the context node can not be
- * returned or the iteration will go into an infinate loop. So to traverse
- * an axis, the first function must be used to get the first node.
- *
- * <p>This method needs to be overloaded only by those axis that process
- * the self node. <\p>
- *
- * @param context The context node of this traversal. This is the point
- * of origin for the traversal -- its "root node" or starting point.
- * @param expandedTypeID The expanded type ID that must match.
- *
- * @return the first node in the traversal.
- */
- public int first(int context, int expandedTypeID)
- {
- if (isIndexed(expandedTypeID))
- {
- int identity = 0;
- int firstPotential = getFirstPotential(identity);
-
- return makeNodeHandle(getNextIndexed(identity, firstPotential, expandedTypeID));
- }
-
- int root = getDocumentRoot(context);
- return next(root, root, expandedTypeID);
- }
-
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/dtm/ref/DTMDocumentImpl.java b/src/com/sun/org/apache/xml/internal/dtm/ref/DTMDocumentImpl.java
deleted file mode 100644
index b9bb3ac..0000000
--- a/src/com/sun/org/apache/xml/internal/dtm/ref/DTMDocumentImpl.java
+++ /dev/null
@@ -1,2413 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DTMDocumentImpl.java,v 1.2.4.1 2005/09/15 08:15:01 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.dtm.ref;
-
-import javax.xml.transform.SourceLocator;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
-import com.sun.org.apache.xml.internal.dtm.DTMAxisTraverser;
-import com.sun.org.apache.xml.internal.dtm.DTMManager;
-import com.sun.org.apache.xml.internal.dtm.DTMWSFilter;
-import com.sun.org.apache.xml.internal.utils.FastStringBuffer;
-import com.sun.org.apache.xml.internal.utils.XMLString;
-import com.sun.org.apache.xml.internal.utils.XMLStringFactory;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.Locator;
-import org.xml.sax.ext.LexicalHandler;
-
-/**
- * This is the implementation of the DTM document interface. It receives
- * requests from an XML content handler similar to that of an XML DOM or SAX parser
- * to store information from the xml document in an array based
- * dtm table structure. This informtion is used later for document navigation,
- * query, and SAX event dispatch functions. The DTM can also be used directly as a
- * document composition model for an application. The requests received are:
- * <ul>
- * <li>initiating DTM to set the doc handle</li>
- * <li>resetting DTM for data structure reuse</li>
- * <li>hinting the end of document to adjust the end of data structure pointers</li>
- * <li>createnodes (element, comment, text, attribute, ....)</li>
- * <li>hinting the end of an element to patch parent and siblings<li>
- * <li>setting application provided symbol name stringpool data structures</li>
- * </ul>
- * <p>State: In progress!!</p>
- *
- * %REVIEW% I _think_ the SAX convention is that "no namespace" is expressed
- * as "" rather than as null (which is the DOM's convention). What should
- * DTM expect? What should it do with the other?
- *
- * <p>Origin: the implemention is a composite logic based on the DTM of XalanJ1 and
- * DocImpl, DocumentImpl, ElementImpl, TextImpl, etc. of XalanJ2</p>
- */
-public class DTMDocumentImpl
-implements DTM, org.xml.sax.ContentHandler, org.xml.sax.ext.LexicalHandler
-{
-
- // Number of lower bits used to represent node index.
- protected static final byte DOCHANDLE_SHIFT = 22;
- // Masks the lower order of node handle.
- // Same as {@link DTMConstructor.IDENT_NODE_DEFAULT}
- protected static final int NODEHANDLE_MASK = (1 << (DOCHANDLE_SHIFT + 1)) - 1;
- // Masks the higher order Document handle
- // Same as {@link DTMConstructor.IDENT_DOC_DEFAULT}
- protected static final int DOCHANDLE_MASK = -1 - NODEHANDLE_MASK;
-
- int m_docHandle = NULL; // masked document handle for this dtm document
- int m_docElement = NULL; // nodeHandle to the root of the actual dtm doc content
-
- // Context for parse-and-append operations
- int currentParent = 0; // current parent - default is document root
- int previousSibling = 0; // previous sibling - no previous sibling
- protected int m_currentNode = -1; // current node
-
- // The tree under construction can itself be used as
- // the element stack, so m_elemStack isn't needed.
- //protected Stack m_elemStack = new Stack(); // element stack
-
- private boolean previousSiblingWasParent = false;
- // Local cache for record-at-a-time fetch
- int gotslot[] = new int[4];
-
- // endDocument recieved?
- private boolean done = false;
- boolean m_isError = false;
-
- private final boolean DEBUG = false;
-
- /** The document base URI. */
- protected String m_documentBaseURI;
-
- /** If we're building the model incrementally on demand, we need to
- * be able to tell the source when to send us more data.
- *
- * Note that if this has not been set, and you attempt to read ahead
- * of the current build point, we'll probably throw a null-pointer
- * exception. We could try to wait-and-retry instead, as a very poor
- * fallback, but that has all the known problems with multithreading
- * on multiprocessors and we Don't Want to Go There.
- *
- * @see setIncrementalSAXSource
- */
- private IncrementalSAXSource m_incrSAXSource=null;
-
-
- // ========= DTM data structure declarations. ==============
-
- // nodes array: integer array blocks to hold the first level reference of the nodes,
- // each reference slot is addressed by a nodeHandle index value.
- // Assumes indices are not larger than {@link NODEHANDLE_MASK}
- // ({@link DOCHANDLE_SHIFT} bits).
- ChunkedIntArray nodes = new ChunkedIntArray(4);
-
- // text/comment table: string buffer to hold the text string values of the document,
- // each of which is addressed by the absolute offset and length in the buffer
- private FastStringBuffer m_char = new FastStringBuffer();
- // Start of string currently being accumulated into m_char;
- // needed because the string may be appended in several chunks.
- private int m_char_current_start=0;
-
- // %TBD% INITIALIZATION/STARTUP ISSUES
- // -- Should we really be creating these, or should they be
- // passed in from outside? Scott want to be able to share
- // pools across multiple documents, so setting them here is
- // probably not the right default.
- private DTMStringPool m_localNames = new DTMStringPool();
- private DTMStringPool m_nsNames = new DTMStringPool();
- private DTMStringPool m_prefixNames = new DTMStringPool();
-
- // %TBD% If we use the current ExpandedNameTable mapper, it
- // needs to be bound to the NS and local name pools. Which
- // means it needs to attach to them AFTER we've resolved their
- // startup. Or it needs to attach to this document and
- // retrieve them each time. Or this needs to be
- // an interface _implemented_ by this class... which might be simplest!
- private ExpandedNameTable m_expandedNames=
- new ExpandedNameTable();
-
- private XMLStringFactory m_xsf;
-
-
- /**
- * Construct a DTM.
- *
- * @param documentNumber the ID number assigned to this document.
- * It will be shifted up into the high bits and returned as part of
- * all node ID numbers, so those IDs indicate which document they
- * came from as well as a location within the document. It is the
- * DTMManager's responsibility to assign a unique number to each
- * document.
- */
- public DTMDocumentImpl(DTMManager mgr, int documentNumber,
- DTMWSFilter whiteSpaceFilter,
- XMLStringFactory xstringfactory){
- initDocument(documentNumber); // clear nodes and document handle
- m_xsf = xstringfactory;
- }
-
- /** Bind a IncrementalSAXSource to this DTM. If we discover we need nodes
- * that have not yet been built, we will ask this object to send us more
- * events, and it will manage interactions with its data sources.
- *
- * Note that we do not actually build the IncrementalSAXSource, since we don't
- * know what source it's reading from, what thread that source will run in,
- * or when it will run.
- *
- * @param source The IncrementalSAXSource that we want to recieve events from
- * on demand.
- */
- public void setIncrementalSAXSource(IncrementalSAXSource source)
- {
- m_incrSAXSource=source;
-
- // Establish SAX-stream link so we can receive the requested data
- source.setContentHandler(this);
- source.setLexicalHandler(this);
-
- // Are the following really needed? IncrementalSAXSource doesn't yet
- // support them, and they're mostly no-ops here...
- //source.setErrorHandler(this);
- //source.setDTDHandler(this);
- //source.setDeclHandler(this);
- }
-
- /**
- * Wrapper for ChunkedIntArray.append, to automatically update the
- * previous sibling's "next" reference (if necessary) and periodically
- * wake a reader who may have encountered incomplete data and entered
- * a wait state.
- * @param w0 int As in ChunkedIntArray.append
- * @param w1 int As in ChunkedIntArray.append
- * @param w2 int As in ChunkedIntArray.append
- * @param w3 int As in ChunkedIntArray.append
- * @return int As in ChunkedIntArray.append
- * @see ChunkedIntArray.append
- */
- private final int appendNode(int w0, int w1, int w2, int w3)
- {
- // A decent compiler may inline this.
- int slotnumber = nodes.appendSlot(w0, w1, w2, w3);
-
- if (DEBUG) System.out.println(slotnumber+": "+w0+" "+w1+" "+w2+" "+w3);
-
- if (previousSiblingWasParent)
- nodes.writeEntry(previousSibling,2,slotnumber);
-
- previousSiblingWasParent = false; // Set the default; endElement overrides
-
- return slotnumber;
- }
-
- // ========= DTM Implementation Control Functions. ==============
-
- /**
- * Set an implementation dependent feature.
- * <p>
- * %REVIEW% Do we really expect to set features on DTMs?
- *
- * @param featureId A feature URL.
- * @param state true if this feature should be on, false otherwise.
- */
- public void setFeature(String featureId, boolean state) {};
-
- /**
- * Set a reference pointer to the element name symbol table.
- * %REVIEW% Should this really be Public? Changing it while
- * DTM is in use would be a disaster.
- *
- * @param poolRef DTMStringPool reference to an instance of table.
- */
- public void setLocalNameTable(DTMStringPool poolRef) {
- m_localNames = poolRef;
- }
-
- /**
- * Get a reference pointer to the element name symbol table.
- *
- * @return DTMStringPool reference to an instance of table.
- */
- public DTMStringPool getLocalNameTable() {
- return m_localNames;
- }
-
- /**
- * Set a reference pointer to the namespace URI symbol table.
- * %REVIEW% Should this really be Public? Changing it while
- * DTM is in use would be a disaster.
- *
- * @param poolRef DTMStringPool reference to an instance of table.
- */
- public void setNsNameTable(DTMStringPool poolRef) {
- m_nsNames = poolRef;
- }
-
- /**
- * Get a reference pointer to the namespace URI symbol table.
- *
- * @return DTMStringPool reference to an instance of table.
- */
- public DTMStringPool getNsNameTable() {
- return m_nsNames;
- }
-
- /**
- * Set a reference pointer to the prefix name symbol table.
- * %REVIEW% Should this really be Public? Changing it while
- * DTM is in use would be a disaster.
- *
- * @param poolRef DTMStringPool reference to an instance of table.
- */
- public void setPrefixNameTable(DTMStringPool poolRef) {
- m_prefixNames = poolRef;
- }
-
- /**
- * Get a reference pointer to the prefix name symbol table.
- *
- * @return DTMStringPool reference to an instance of table.
- */
- public DTMStringPool getPrefixNameTable() {
- return m_prefixNames;
- }
-
- /**
- * Set a reference pointer to the content-text repository
- *
- * @param buffer FastStringBuffer reference to an instance of
- * buffer
- */
- void setContentBuffer(FastStringBuffer buffer) {
- m_char = buffer;
- }
-
- /**
- * Get a reference pointer to the content-text repository
- *
- * @return FastStringBuffer reference to an instance of buffer
- */
- FastStringBuffer getContentBuffer() {
- return m_char;
- }
-
- /** getContentHandler returns "our SAX builder" -- the thing that
- * someone else should send SAX events to in order to extend this
- * DTM model.
- *
- * @return null if this model doesn't respond to SAX events,
- * "this" if the DTM object has a built-in SAX ContentHandler,
- * the IncrementalSAXSource if we're bound to one and should receive
- * the SAX stream via it for incremental build purposes...
- * */
- public org.xml.sax.ContentHandler getContentHandler()
- {
- if (m_incrSAXSource instanceof IncrementalSAXSource_Filter)
- return (ContentHandler) m_incrSAXSource;
- else
- return this;
- }
-
- /**
- * Return this DTM's lexical handler.
- *
- * %REVIEW% Should this return null if constrution already done/begun?
- *
- * @return null if this model doesn't respond to lexical SAX events,
- * "this" if the DTM object has a built-in SAX ContentHandler,
- * the IncrementalSAXSource if we're bound to one and should receive
- * the SAX stream via it for incremental build purposes...
- */
- public LexicalHandler getLexicalHandler()
- {
-
- if (m_incrSAXSource instanceof IncrementalSAXSource_Filter)
- return (LexicalHandler) m_incrSAXSource;
- else
- return this;
- }
-
- /**
- * Return this DTM's EntityResolver.
- *
- * @return null if this model doesn't respond to SAX entity ref events.
- */
- public org.xml.sax.EntityResolver getEntityResolver()
- {
-
- return null;
- }
-
- /**
- * Return this DTM's DTDHandler.
- *
- * @return null if this model doesn't respond to SAX dtd events.
- */
- public org.xml.sax.DTDHandler getDTDHandler()
- {
-
- return null;
- }
-
- /**
- * Return this DTM's ErrorHandler.
- *
- * @return null if this model doesn't respond to SAX error events.
- */
- public org.xml.sax.ErrorHandler getErrorHandler()
- {
-
- return null;
- }
-
- /**
- * Return this DTM's DeclHandler.
- *
- * @return null if this model doesn't respond to SAX Decl events.
- */
- public org.xml.sax.ext.DeclHandler getDeclHandler()
- {
-
- return null;
- }
-
- /** @return true iff we're building this model incrementally (eg
- * we're partnered with a IncrementalSAXSource) and thus require that the
- * transformation and the parse run simultaneously. Guidance to the
- * DTMManager.
- * */
- public boolean needsTwoThreads()
- {
- return null!=m_incrSAXSource;
- }
-
- //================================================================
- // ========= SAX2 ContentHandler methods =========
- // Accept SAX events, use them to build/extend the DTM tree.
- // Replaces the deprecated DocumentHandler interface.
-
- public void characters(char[] ch, int start, int length)
- throws org.xml.sax.SAXException
- {
- // Actually creating the text node is handled by
- // processAccumulatedText(); here we just accumulate the
- // characters into the buffer.
- m_char.append(ch,start,length);
- }
-
- // Flush string accumulation into a text node
- private void processAccumulatedText()
- {
- int len=m_char.length();
- if(len!=m_char_current_start)
- {
- // The FastStringBuffer has been previously agreed upon
- appendTextChild(m_char_current_start,len-m_char_current_start);
- m_char_current_start=len;
- }
- }
- public void endDocument()
- throws org.xml.sax.SAXException
- {
- // May need to tell the low-level builder code to pop up a level.
- // There _should't_ be any significant pending text at this point.
- appendEndDocument();
- }
- public void endElement(java.lang.String namespaceURI, java.lang.String localName,
- java.lang.String qName)
- throws org.xml.sax.SAXException
- {
- processAccumulatedText();
- // No args but we do need to tell the low-level builder code to
- // pop up a level.
- appendEndElement();
- }
- public void endPrefixMapping(java.lang.String prefix)
- throws org.xml.sax.SAXException
- {
- // No-op
- }
- public void ignorableWhitespace(char[] ch, int start, int length)
- throws org.xml.sax.SAXException
- {
- // %TBD% I believe ignorable text isn't part of the DTM model...?
- }
- public void processingInstruction(java.lang.String target, java.lang.String data)
- throws org.xml.sax.SAXException
- {
- processAccumulatedText();
- // %TBD% Which pools do target and data go into?
- }
- public void setDocumentLocator(Locator locator)
- {
- // No-op for DTM
- }
- public void skippedEntity(java.lang.String name)
- throws org.xml.sax.SAXException
- {
- processAccumulatedText();
- //%TBD%
- }
- public void startDocument()
- throws org.xml.sax.SAXException
- {
- appendStartDocument();
- }
- public void startElement(java.lang.String namespaceURI, java.lang.String localName,
- java.lang.String qName, Attributes atts)
- throws org.xml.sax.SAXException
- {
- processAccumulatedText();
-
- // %TBD% Split prefix off qname
- String prefix=null;
- int colon=qName.indexOf(':');
- if(colon>0)
- prefix=qName.substring(0,colon);
-
- // %TBD% Where do we pool expandedName, or is it just the union, or...
- /**/System.out.println("Prefix="+prefix+" index="+m_prefixNames.stringToIndex(prefix));
- appendStartElement(m_nsNames.stringToIndex(namespaceURI),
- m_localNames.stringToIndex(localName),
- m_prefixNames.stringToIndex(prefix)); /////// %TBD%
-
- // %TBD% I'm assuming that DTM will require resequencing of
- // NS decls before other attrs, hence two passes are taken.
- // %TBD% Is there an easier way to test for NSDecl?
- int nAtts=(atts==null) ? 0 : atts.getLength();
- // %TBD% Countdown is more efficient if nobody cares about sequence.
- for(int i=nAtts-1;i>=0;--i)
- {
- qName=atts.getQName(i);
- if(qName.startsWith("xmlns:") || "xmlns".equals(qName))
- {
- prefix=null;
- colon=qName.indexOf(':');
- if(colon>0)
- {
- prefix=qName.substring(0,colon);
- }
- else
- {
- // %REVEIW% Null or ""?
- prefix=null; // Default prefix
- }
-
-
- appendNSDeclaration(
- m_prefixNames.stringToIndex(prefix),
- m_nsNames.stringToIndex(atts.getValue(i)),
- atts.getType(i).equalsIgnoreCase("ID"));
- }
- }
-
- for(int i=nAtts-1;i>=0;--i)
- {
- qName=atts.getQName(i);
- if(!(qName.startsWith("xmlns:") || "xmlns".equals(qName)))
- {
- // %TBD% I hate having to extract the prefix into a new
- // string when we may never use it. Consider pooling whole
- // qNames, which are already strings?
- prefix=null;
- colon=qName.indexOf(':');
- if(colon>0)
- {
- prefix=qName.substring(0,colon);
- localName=qName.substring(colon+1);
- }
- else
- {
- prefix=""; // Default prefix
- localName=qName;
- }
-
-
- m_char.append(atts.getValue(i)); // Single-string value
- int contentEnd=m_char.length();
-
- if(!("xmlns".equals(prefix) || "xmlns".equals(qName)))
- appendAttribute(m_nsNames.stringToIndex(atts.getURI(i)),
- m_localNames.stringToIndex(localName),
- m_prefixNames.stringToIndex(prefix),
- atts.getType(i).equalsIgnoreCase("ID"),
- m_char_current_start, contentEnd-m_char_current_start);
- m_char_current_start=contentEnd;
- }
- }
- }
- public void startPrefixMapping(java.lang.String prefix, java.lang.String uri)
- throws org.xml.sax.SAXException
- {
- // No-op in DTM, handled during element/attr processing?
- }
-
- //
- // LexicalHandler support. Not all SAX2 parsers support these events
- // but we may want to pass them through when they exist...
- //
- public void comment(char[] ch, int start, int length)
- throws org.xml.sax.SAXException
- {
- processAccumulatedText();
-
- m_char.append(ch,start,length); // Single-string value
- appendComment(m_char_current_start,length);
- m_char_current_start+=length;
- }
- public void endCDATA()
- throws org.xml.sax.SAXException
- {
- // No-op in DTM
- }
- public void endDTD()
- throws org.xml.sax.SAXException
- {
- // No-op in DTM
- }
- public void endEntity(java.lang.String name)
- throws org.xml.sax.SAXException
- {
- // No-op in DTM
- }
- public void startCDATA()
- throws org.xml.sax.SAXException
- {
- // No-op in DTM
- }
- public void startDTD(java.lang.String name, java.lang.String publicId,
- java.lang.String systemId)
- throws org.xml.sax.SAXException
- {
- // No-op in DTM
- }
- public void startEntity(java.lang.String name)
- throws org.xml.sax.SAXException
- {
- // No-op in DTM
- }
-
-
- //================================================================
- // ========= Document Handler Functions =========
- // %REVIEW% jjk -- DocumentHandler is SAX Level 1, and deprecated....
- // and this wasn't a fully compliant or declared implementation of that API
- // in any case. Phase out in favor of SAX2 ContentHandler/LexicalHandler
-
- /**
- * Reset a dtm document to its initial (empty) state.
- *
- * The DTMManager will invoke this method when the dtm is created.
- *
- * @param documentNumber the handle for the DTM document.
- */
- final void initDocument(int documentNumber)
- {
- // save masked DTM document handle
- m_docHandle = documentNumber<<DOCHANDLE_SHIFT;
-
- // Initialize the doc -- no parent, no next-sib
- nodes.writeSlot(0,DOCUMENT_NODE,-1,-1,0);
- // wait for the first startElement to create the doc root node
- done = false;
- }
-
-// /**
-// * Receive hint of the end of a document.
-// *
-// * <p>The content handler will invoke this method only once, and it will
-// * be the last method invoked during the parse. The handler shall not
-// * not invoke this method until it has either abandoned parsing
-// * (because of an unrecoverable error) or reached the end of
-// * input.</p>
-// */
-// public void documentEnd()
-// {
-// done = true;
-// // %TBD% may need to notice the last slot number and slot count to avoid
-// // residual data from provious use of this DTM
-// }
-
-// /**
-// * Receive notification of the beginning of a document.
-// *
-// * <p>The SAX parser will invoke this method only once, before any
-// * other methods in this interface.</p>
-// */
-// public void reset()
-// {
-
-// // %TBD% reset slot 0 to indicate ChunkedIntArray reuse or wait for
-// // the next initDocument().
-// m_docElement = NULL; // reset nodeHandle to the root of the actual dtm doc content
-// initDocument(0);
-// }
-
-// /**
-// * Factory method; creates an Element node in this document.
-// *
-// * The node created will be chained according to its natural order of request
-// * received. %TBD% It can be rechained later via the optional DTM writable interface.
-// *
-// * <p>The XML content handler will invoke endElement() method after all
-// * of the element's content are processed in order to give DTM the indication
-// * to prepare and patch up parent and sibling node pointers.</p>
-// *
-// * <p>The following interface for createElement will use an index value corresponds
-// * to the symbol entry in the DTMDStringPool based symbol tables.</p>
-// *
-// * @param nsIndex The namespace of the node
-// * @param nameIndex The element name.
-// * @see #endElement
-// * @see org.xml.sax.Attributes
-// * @return nodeHandle int of the element created
-// */
-// public int createElement(int nsIndex, int nameIndex, Attributes atts)
-// {
-// // do document root node creation here on the first element, create nodes for
-// // this element and its attributes, store the element, namespace, and attritute
-// // name indexes to the nodes array, keep track of the current node and parent
-// // element used
-
-// // W0 High: Namespace Low: Node Type
-// int w0 = (nsIndex << 16) | ELEMENT_NODE;
-// // W1: Parent
-// int w1 = currentParent;
-// // W2: Next (initialized as 0)
-// int w2 = 0;
-// // W3: Tagname
-// int w3 = nameIndex;
-// //int ourslot = nodes.appendSlot(w0, w1, w2, w3);
-// int ourslot = appendNode(w0, w1, w2, w3);
-// currentParent = ourslot;
-// previousSibling = 0;
-// setAttributes(atts);
-
-// // set the root element pointer when creating the first element node
-// if (m_docElement == NULL)
-// m_docElement = ourslot;
-// return (m_docHandle | ourslot);
-// }
-
-// // Factory method to create an Element node not associated with a given name space
-// // using String value parameters passed in from a content handler or application
-// /**
-// * Factory method; creates an Element node not associated with a given name space in this document.
-// *
-// * The node created will be chained according to its natural order of request
-// * received. %TBD% It can be rechained later via the optional DTM writable interface.
-// *
-// * <p>The XML content handler or application will invoke endElement() method after all
-// * of the element's content are processed in order to give DTM the indication
-// * to prepare and patch up parent and sibling node pointers.</p>
-// *
-// * <p>The following parameters for createElement contains raw string values for name
-// * symbols used in an Element node.</p>
-// *
-// * @param name String the element name, including the prefix if any.
-// * @param atts The attributes attached to the element, if any.
-// * @see #endElement
-// * @see org.xml.sax.Attributes
-// */
-// public int createElement(String name, Attributes atts)
-// {
-// // This method wraps around the index valued interface of the createElement interface.
-// // The raw string values are stored into the current DTM name symbol tables. The method
-// // method will then use the index values returned to invoke the other createElement()
-// // onverted to index values modified to match a
-// // method.
-// int nsIndex = NULL;
-// int nameIndex = m_localNames.stringToIndex(name);
-// // note - there should be no prefix separator in the name because it is not associated
-// // with a name space
-
-// return createElement(nsIndex, nameIndex, atts);
-// }
-
-// // Factory method to create an Element node associated with a given name space
-// // using String value parameters passed in from a content handler or application
-// /**
-// * Factory method; creates an Element node associated with a given name space in this document.
-// *
-// * The node created will be chained according to its natural order of request
-// * received. %TBD% It can be rechained later via the optional DTM writable interface.
-// *
-// * <p>The XML content handler or application will invoke endElement() method after all
-// * of the element's content are processed in order to give DTM the indication
-// * to prepare and patch up parent and sibling node pointers.</p>
-// *
-// * <p>The following parameters for createElementNS contains raw string values for name
-// * symbols used in an Element node.</p>
-// *
-// * @param ns String the namespace of the node
-// * @param name String the element name, including the prefix if any.
-// * @param atts The attributes attached to the element, if any.
-// * @see #endElement
-// * @see org.xml.sax.Attributes
-// */
-// public int createElementNS(String ns, String name, Attributes atts)
-// {
-// // This method wraps around the index valued interface of the createElement interface.
-// // The raw string values are stored into the current DTM name symbol tables. The method
-// // method will then use the index values returned to invoke the other createElement()
-// // onverted to index values modified to match a
-// // method.
-// int nsIndex = m_nsNames.stringToIndex(ns);
-// int nameIndex = m_localNames.stringToIndex(name);
-// // The prefixIndex is not needed by the indexed interface of the createElement method
-// int prefixSep = name.indexOf(":");
-// int prefixIndex = m_prefixNames.stringToIndex(name.substring(0, prefixSep));
-// return createElement(nsIndex, nameIndex, atts);
-// }
-
-// /**
-// * Receive an indication for the end of an element.
-// *
-// * <p>The XML content handler will invoke this method at the end of every
-// * element in the XML document to give hint its time to pop up the current
-// * element and parent and patch up parent and sibling pointers if necessary
-// *
-// * <p>%tbd% The following interface may need to be modified to match a
-// * coordinated access to the DTMDStringPool based symbol tables.</p>
-// *
-// * @param ns the namespace of the element
-// * @param name The element name
-// */
-// public void endElement(String ns, String name)
-// {
-// // pop up the stacks
-
-// //
-// if (previousSiblingWasParent)
-// nodes.writeEntry(previousSibling, 2, NULL);
-
-// // Pop parentage
-// previousSibling = currentParent;
-// nodes.readSlot(currentParent, gotslot);
-// currentParent = gotslot[1] & 0xFFFF;
-
-// // The element just being finished will be
-// // the previous sibling for the next operation
-// previousSiblingWasParent = true;
-
-// // Pop a level of namespace table
-// // namespaceTable.removeLastElem();
-// }
-
-// /**
-// * Creates attributes for the current node.
-// *
-// * @param atts Attributes to be created.
-// */
-// void setAttributes(Attributes atts) {
-// int atLength = (null == atts) ? 0 : atts.getLength();
-// for (int i=0; i < atLength; i++) {
-// String qname = atts.getQName(i);
-// createAttribute(atts.getQName(i), atts.getValue(i));
-// }
-// }
-
-// /**
-// * Appends an attribute to the document.
-// * @param qname Qualified Name of the attribute
-// * @param value Value of the attribute
-// * @return Handle of node
-// */
-// public int createAttribute(String qname, String value) {
-// int colonpos = qname.indexOf(":");
-// String attName = qname.substring(colonpos+1);
-// int w0 = 0;
-// if (colonpos > 0) {
-// String prefix = qname.substring(0, colonpos);
-// if (prefix.equals("xml")) {
-// //w0 = ATTRIBUTE_NODE |
-// // (com.sun.org.apache.xalan.internal.templates.Constants.S_XMLNAMESPACEURI << 16);
-// } else {
-// //w0 = ATTRIBUTE_NODE |
-// }
-// } else {
-// w0 = ATTRIBUTE_NODE;
-// }
-// // W1: Parent
-// int w1 = currentParent;
-// // W2: Next (not yet resolved)
-// int w2 = 0;
-// // W3: Tag name
-// int w3 = m_localNames.stringToIndex(attName);
-// // Add node
-// int ourslot = appendNode(w0, w1, w2, w3);
-// previousSibling = ourslot; // Should attributes be previous siblings
-
-// // W0: Node Type
-// w0 = TEXT_NODE;
-// // W1: Parent
-// w1 = ourslot;
-// // W2: Start Position within buffer
-// w2 = m_char.length();
-// m_char.append(value);
-// // W3: Length
-// w3 = m_char.length() - w2;
-// appendNode(w0, w1, w2, w3);
-// charStringStart=m_char.length();
-// charStringLength = 0;
-// //previousSibling = ourslot;
-// // Attrs are Parents
-// previousSiblingWasParent = true;
-// return (m_docHandle | ourslot);
-// }
-
-// /**
-// * Factory method; creates a Text node in this document.
-// *
-// * The node created will be chained according to its natural order of request
-// * received. %TBD% It can be rechained later via the optional DTM writable interface.
-// *
-// * @param text String The characters text string from the XML document.
-// * @return int DTM node-number of the text node created
-// */
-// public int createTextNode(String text)
-// throws DTMException
-// {
-// // wraps around the index value based createTextNode method
-// return createTextNode(text.toCharArray(), 0, text.length());
-// }
-
-// /**
-// * Factory method; creates a Text node in this document.
-// *
-// * The node created will be chained according to its natural order of request
-// * received. %TBD% It can be rechained later via the optional DTM writable interface.
-// *
-// * %REVIEW% for text normalization issues, unless we are willing to
-// * insist that all adjacent text must be merged before this method
-// * is called.
-// *
-// * @param ch The characters from the XML document.
-// * @param start The start position in the array.
-// * @param length The number of characters to read from the array.
-// */
-// public int createTextNode(char ch[], int start, int length)
-// throws DTMException
-// {
-// m_char.append(ch, start, length); // store the chunk to the text/comment string table
-
-// // create a Text Node
-// // %TBD% may be possible to combine with appendNode()to replace the next chunk of code
-// int w0 = TEXT_NODE;
-// // W1: Parent
-// int w1 = currentParent;
-// // W2: Start position within m_char
-// int w2 = charStringStart;
-// // W3: Length of the full string
-// int w3 = length;
-// int ourslot = appendNode(w0, w1, w2, w3);
-// previousSibling = ourslot;
-
-// charStringStart=m_char.length();
-// charStringLength = 0;
-// return (m_docHandle | ourslot);
-// }
-
-// /**
-// * Factory method; creates a Comment node in this document.
-// *
-// * The node created will be chained according to its natural order of request
-// * received. %TBD% It can be rechained later via the optional DTM writable interface.
-// *
-// * @param text String The characters text string from the XML document.
-// * @return int DTM node-number of the text node created
-// */
-// public int createComment(String text)
-// throws DTMException
-// {
-// // wraps around the index value based createTextNode method
-// return createComment(text.toCharArray(), 0, text.length());
-// }
-
-// /**
-// * Factory method; creates a Comment node in this document.
-// *
-// * The node created will be chained according to its natural order of request
-// * received. %TBD% It can be rechained later via the optional DTM writable interface.
-// *
-// * @param ch An array holding the characters in the comment.
-// * @param start The starting position in the array.
-// * @param length The number of characters to use from the array.
-// * @see DTMException
-// */
-// public int createComment(char ch[], int start, int length)
-// throws DTMException
-// {
-// m_char.append(ch, start, length); // store the comment string to the text/comment string table
-
-// // create a Comment Node
-// // %TBD% may be possible to combine with appendNode()to replace the next chunk of code
-// int w0 = COMMENT_NODE;
-// // W1: Parent
-// int w1 = currentParent;
-// // W2: Start position within m_char
-// int w2 = charStringStart;
-// // W3: Length of the full string
-// int w3 = length;
-// int ourslot = appendNode(w0, w1, w2, w3);
-// previousSibling = ourslot;
-
-// charStringStart=m_char.length();
-// charStringLength = 0;
-// return (m_docHandle | ourslot);
-// }
-
-// // Counters to keep track of the current text string being accumulated with respect
-// // to the text/comment string table: charStringStart should point to the starting
-// // offset of the string in the table and charStringLength the acccumulated length when
-// // appendAccumulatedText starts, and reset to the end of the table and 0 at the end
-// // of appendAccumulatedText for the next set of characters receives
-// int charStringStart=0,charStringLength=0;
-
- // ========= Document Navigation Functions =========
-
- /** Given a node handle, test if it has child nodes.
- * <p> %REVIEW% This is obviously useful at the DOM layer, where it
- * would permit testing this without having to create a proxy
- * node. It's less useful in the DTM API, where
- * (dtm.getFirstChild(nodeHandle)!=DTM.NULL) is just as fast and
- * almost as self-evident. But it's a convenience, and eases porting
- * of DOM code to DTM. </p>
- *
- * @param nodeHandle int Handle of the node.
- * @return int true if the given node has child nodes.
- */
- public boolean hasChildNodes(int nodeHandle) {
- return(getFirstChild(nodeHandle) != NULL);
- }
-
- /**
- * Given a node handle, get the handle of the node's first child.
- * If not yet resolved, waits for more nodes to be added to the document and
- * tries again.
- *
- * @param nodeHandle int Handle of the node.
- * @return int DTM node-number of first child, or DTM.NULL to indicate none exists.
- */
- public int getFirstChild(int nodeHandle) {
-
- // ###shs worry about tracing/debug later
- nodeHandle &= NODEHANDLE_MASK;
- // Read node into variable
- nodes.readSlot(nodeHandle, gotslot);
-
- // type is the last half of first slot
- short type = (short) (gotslot[0] & 0xFFFF);
-
- // Check to see if Element or Document node
- if ((type == ELEMENT_NODE) || (type == DOCUMENT_NODE) ||
- (type == ENTITY_REFERENCE_NODE)) {
-
- // In case when Document root is given
- // if (nodeHandle == 0) nodeHandle = 1;
- // %TBD% Probably was a mistake.
- // If someone explicitly asks for first child
- // of Document, I would expect them to want
- // that and only that.
-
- int kid = nodeHandle + 1;
- nodes.readSlot(kid, gotslot);
- while (ATTRIBUTE_NODE == (gotslot[0] & 0xFFFF)) {
- // points to next sibling
- kid = gotslot[2];
- // Return NULL if node has only attributes
- if (kid == NULL) return NULL;
- nodes.readSlot(kid, gotslot);
- }
- // If parent slot matches given parent, return kid
- if (gotslot[1] == nodeHandle)
- {
- int firstChild = kid | m_docHandle;
-
- return firstChild;
- }
- }
- // No child found
-
- return NULL;
- }
-
- /**
- * Given a node handle, advance to its last child.
- * If not yet resolved, waits for more nodes to be added to the document and
- * tries again.
- *
- * @param nodeHandle int Handle of the node.
- * @return int Node-number of last child,
- * or DTM.NULL to indicate none exists.
- */
- public int getLastChild(int nodeHandle) {
- // ###shs put trace/debug later
- nodeHandle &= NODEHANDLE_MASK;
- // do not need to test node type since getFirstChild does that
- int lastChild = NULL;
- for (int nextkid = getFirstChild(nodeHandle); nextkid != NULL;
- nextkid = getNextSibling(nextkid)) {
- lastChild = nextkid;
- }
- return lastChild | m_docHandle;
- }
-
- /**
- * Retrieves an attribute node by by qualified name and namespace URI.
- *
- * @param nodeHandle int Handle of the node upon which to look up this attribute.
- * @param namespaceURI The namespace URI of the attribute to
- * retrieve, or null.
- * @param name The local name of the attribute to
- * retrieve.
- * @return The attribute node handle with the specified name (
- * <code>nodeName</code>) or <code>DTM.NULL</code> if there is no such
- * attribute.
- */
- public int getAttributeNode(int nodeHandle, String namespaceURI, String name) {
- int nsIndex = m_nsNames.stringToIndex(namespaceURI),
- nameIndex = m_localNames.stringToIndex(name);
- nodeHandle &= NODEHANDLE_MASK;
- nodes.readSlot(nodeHandle, gotslot);
- short type = (short) (gotslot[0] & 0xFFFF);
- // If nodeHandle points to element next slot would be first attribute
- if (type == ELEMENT_NODE)
- nodeHandle++;
- // Iterate through Attribute Nodes
- while (type == ATTRIBUTE_NODE) {
- if ((nsIndex == (gotslot[0] << 16)) && (gotslot[3] == nameIndex))
- return nodeHandle | m_docHandle;
- // Goto next sibling
- nodeHandle = gotslot[2];
- nodes.readSlot(nodeHandle, gotslot);
- }
- return NULL;
- }
-
- /**
- * Given a node handle, get the index of the node's first attribute.
- *
- * @param nodeHandle int Handle of the Element node.
- * @return Handle of first attribute, or DTM.NULL to indicate none exists.
- */
- public int getFirstAttribute(int nodeHandle) {
- nodeHandle &= NODEHANDLE_MASK;
-
- // %REVIEW% jjk: Just a quick observation: If you're going to
- // call readEntry repeatedly on the same node, it may be
- // more efficiently to do a readSlot to get the data locally,
- // reducing the addressing and call-and-return overhead.
-
- // Should we check if handle is element (do we want sanity checks?)
- if (ELEMENT_NODE != (nodes.readEntry(nodeHandle, 0) & 0xFFFF))
- return NULL;
- // First Attribute (if any) should be at next position in table
- nodeHandle++;
- return(ATTRIBUTE_NODE == (nodes.readEntry(nodeHandle, 0) & 0xFFFF)) ?
- nodeHandle | m_docHandle : NULL;
- }
-
- /**
- * Given a node handle, get the index of the node's first child.
- * If not yet resolved, waits for more nodes to be added to the document and
- * tries again
- *
- * @param nodeHandle handle to node, which should probably be an element
- * node, but need not be.
- *
- * @param inScope true if all namespaces in scope should be returned,
- * false if only the namespace declarations should be
- * returned.
- * @return handle of first namespace, or DTM.NULL to indicate none exists.
- */
- public int getFirstNamespaceNode(int nodeHandle, boolean inScope) {
-
- return NULL;
- }
-
- /**
- * Given a node handle, advance to its next sibling.
- *
- * %TBD% This currently uses the DTM-internal definition of
- * sibling; eg, the last attr's next sib is the first
- * child. In the old DTM, the DOM proxy layer provided the
- * additional logic for the public view. If we're rewriting
- * for XPath emulation, that test must be done here.
- *
- * %TBD% CODE INTERACTION WITH INCREMENTAL PARSE - If not yet
- * resolved, should wait for more nodes to be added to the document
- * and tries again.
- *
- * @param nodeHandle int Handle of the node.
- * @return int Node-number of next sibling,
- * or DTM.NULL to indicate none exists.
- * */
- public int getNextSibling(int nodeHandle) {
- nodeHandle &= NODEHANDLE_MASK;
- // Document root has no next sibling
- if (nodeHandle == 0)
- return NULL;
-
- short type = (short) (nodes.readEntry(nodeHandle, 0) & 0xFFFF);
- if ((type == ELEMENT_NODE) || (type == ATTRIBUTE_NODE) ||
- (type == ENTITY_REFERENCE_NODE)) {
- int nextSib = nodes.readEntry(nodeHandle, 2);
- if (nextSib == NULL)
- return NULL;
- if (nextSib != 0)
- return (m_docHandle | nextSib);
- // ###shs should cycle/wait if nextSib is 0? Working on threading next
- }
- // Next Sibling is in the next position if it shares the same parent
- int thisParent = nodes.readEntry(nodeHandle, 1);
-
- if (nodes.readEntry(++nodeHandle, 1) == thisParent)
- return (m_docHandle | nodeHandle);
-
- return NULL;
- }
-
- /**
- * Given a node handle, find its preceeding sibling.
- * WARNING: DTM is asymmetric; this operation is resolved by search, and is
- * relatively expensive.
- *
- * @param nodeHandle the id of the node.
- * @return int Node-number of the previous sib,
- * or DTM.NULL to indicate none exists.
- */
- public int getPreviousSibling(int nodeHandle) {
- nodeHandle &= NODEHANDLE_MASK;
- // Document root has no previous sibling
- if (nodeHandle == 0)
- return NULL;
-
- int parent = nodes.readEntry(nodeHandle, 1);
- int kid = NULL;
- for (int nextkid = getFirstChild(parent); nextkid != nodeHandle;
- nextkid = getNextSibling(nextkid)) {
- kid = nextkid;
- }
- return kid | m_docHandle;
- }
-
- /**
- * Given a node handle, advance to the next attribute. If an
- * element, we advance to its first attribute; if an attr, we advance to
- * the next attr on the same node.
- *
- * @param nodeHandle int Handle of the node.
- * @return int DTM node-number of the resolved attr,
- * or DTM.NULL to indicate none exists.
- */
- public int getNextAttribute(int nodeHandle) {
- nodeHandle &= NODEHANDLE_MASK;
- nodes.readSlot(nodeHandle, gotslot);
-
- //%REVIEW% Why are we using short here? There's no storage
- //reduction for an automatic variable, especially one used
- //so briefly, and it typically costs more cycles to process
- //than an int would.
- short type = (short) (gotslot[0] & 0xFFFF);
-
- if (type == ELEMENT_NODE) {
- return getFirstAttribute(nodeHandle);
- } else if (type == ATTRIBUTE_NODE) {
- if (gotslot[2] != NULL)
- return (m_docHandle | gotslot[2]);
- }
- return NULL;
- }
-
- /**
- * Given a namespace handle, advance to the next namespace.
- *
- * %TBD% THIS METHOD DOES NOT MATCH THE CURRENT SIGNATURE IN
- * THE DTM INTERFACE. FIX IT, OR JUSTIFY CHANGING THE DTM
- * API.
- *
- * @param namespaceHandle handle to node which must be of type NAMESPACE_NODE.
- * @return handle of next namespace, or DTM.NULL to indicate none exists.
- */
- public int getNextNamespaceNode(int baseHandle,int namespaceHandle, boolean inScope) {
- // ###shs need to work on namespace
- return NULL;
- }
-
- /**
- * Given a node handle, advance to its next descendant.
- * If not yet resolved, waits for more nodes to be added to the document and
- * tries again.
- *
- * @param subtreeRootHandle
- * @param nodeHandle int Handle of the node.
- * @return handle of next descendant,
- * or DTM.NULL to indicate none exists.
- */
- public int getNextDescendant(int subtreeRootHandle, int nodeHandle) {
- subtreeRootHandle &= NODEHANDLE_MASK;
- nodeHandle &= NODEHANDLE_MASK;
- // Document root [Document Node? -- jjk] - no next-sib
- if (nodeHandle == 0)
- return NULL;
- while (!m_isError) {
- // Document done and node out of bounds
- if (done && (nodeHandle > nodes.slotsUsed()))
- break;
- if (nodeHandle > subtreeRootHandle) {
- nodes.readSlot(nodeHandle+1, gotslot);
- if (gotslot[2] != 0) {
- short type = (short) (gotslot[0] & 0xFFFF);
- if (type == ATTRIBUTE_NODE) {
- nodeHandle +=2;
- } else {
- int nextParentPos = gotslot[1];
- if (nextParentPos >= subtreeRootHandle)
- return (m_docHandle | (nodeHandle+1));
- else
- break;
- }
- } else if (!done) {
- // Add wait logic here
- } else
- break;
- } else {
- nodeHandle++;
- }
- }
- // Probably should throw error here like original instead of returning
- return NULL;
- }
-
- /**
- * Given a node handle, advance to the next node on the following axis.
- *
- * @param axisContextHandle the start of the axis that is being traversed.
- * @param nodeHandle
- * @return handle of next sibling,
- * or DTM.NULL to indicate none exists.
- */
- public int getNextFollowing(int axisContextHandle, int nodeHandle) {
- //###shs still working on
- return NULL;
- }
-
- /**
- * Given a node handle, advance to the next node on the preceding axis.
- *
- * @param axisContextHandle the start of the axis that is being traversed.
- * @param nodeHandle the id of the node.
- * @return int Node-number of preceding sibling,
- * or DTM.NULL to indicate none exists.
- */
- public int getNextPreceding(int axisContextHandle, int nodeHandle) {
- // ###shs copied from Xalan 1, what is this suppose to do?
- nodeHandle &= NODEHANDLE_MASK;
- while (nodeHandle > 1) {
- nodeHandle--;
- if (ATTRIBUTE_NODE == (nodes.readEntry(nodeHandle, 0) & 0xFFFF))
- continue;
-
- // if nodeHandle is _not_ an ancestor of
- // axisContextHandle, specialFind will return it.
- // If it _is_ an ancestor, specialFind will return -1
-
- // %REVIEW% unconditional return defeats the
- // purpose of the while loop -- does this
- // logic make any sense?
-
- return (m_docHandle | nodes.specialFind(axisContextHandle, nodeHandle));
- }
- return NULL;
- }
-
- /**
- * Given a node handle, find its parent node.
- *
- * @param nodeHandle the id of the node.
- * @return int Node-number of parent,
- * or DTM.NULL to indicate none exists.
- */
- public int getParent(int nodeHandle) {
- // Should check to see within range?
-
- // Document Root should not have to be handled differently
- return (m_docHandle | nodes.readEntry(nodeHandle, 1));
- }
-
- /**
- * Returns the root element of the document.
- * @return nodeHandle to the Document Root.
- */
- public int getDocumentRoot() {
- return (m_docHandle | m_docElement);
- }
-
- /**
- * Given a node handle, find the owning document node.
- *
- * @return int Node handle of document, which should always be valid.
- */
- public int getDocument() {
- return m_docHandle;
- }
-
- /**
- * Given a node handle, find the owning document node. This has the exact
- * same semantics as the DOM Document method of the same name, in that if
- * the nodeHandle is a document node, it will return NULL.
- *
- * <p>%REVIEW% Since this is DOM-specific, it may belong at the DOM
- * binding layer. Included here as a convenience function and to
- * aid porting of DOM code to DTM.</p>
- *
- * @param nodeHandle the id of the node.
- * @return int Node handle of owning document, or NULL if the nodeHandle is
- * a document.
- */
- public int getOwnerDocument(int nodeHandle) {
- // Assumption that Document Node is always in 0 slot
- if ((nodeHandle & NODEHANDLE_MASK) == 0)
- return NULL;
- return (nodeHandle & DOCHANDLE_MASK);
- }
-
- /**
- * Given a node handle, find the owning document node. This has the DTM
- * semantics; a Document node is its own owner.
- *
- * <p>%REVIEW% Since this is DOM-specific, it may belong at the DOM
- * binding layer. Included here as a convenience function and to
- * aid porting of DOM code to DTM.</p>
- *
- * @param nodeHandle the id of the node.
- * @return int Node handle of owning document, or NULL if the nodeHandle is
- * a document.
- */
- public int getDocumentRoot(int nodeHandle) {
- // Assumption that Document Node is always in 0 slot
- if ((nodeHandle & NODEHANDLE_MASK) == 0)
- return NULL;
- return (nodeHandle & DOCHANDLE_MASK);
- }
-
- /**
- * Get the string-value of a node as a String object
- * (see http://www.w3.org/TR/xpath#data-model
- * for the definition of a node's string-value).
- *
- * @param nodeHandle The node ID.
- *
- * @return A string object that represents the string-value of the given node.
- */
- public XMLString getStringValue(int nodeHandle) {
- // ###zaj - researching
- nodes.readSlot(nodeHandle, gotslot);
- int nodetype=gotslot[0] & 0xFF;
- String value=null;
-
- switch (nodetype) {
- case TEXT_NODE:
- case COMMENT_NODE:
- case CDATA_SECTION_NODE:
- value= m_char.getString(gotslot[2], gotslot[3]);
- break;
- case PROCESSING_INSTRUCTION_NODE:
- case ATTRIBUTE_NODE:
- case ELEMENT_NODE:
- case ENTITY_REFERENCE_NODE:
- default:
- break;
- }
- return m_xsf.newstr( value );
-
- }
-
- /**
- * Get number of character array chunks in
- * the string-value of a node.
- * (see http://www.w3.org/TR/xpath#data-model
- * for the definition of a node's string-value).
- * Note that a single text node may have multiple text chunks.
- *
- * EXPLANATION: This method is an artifact of the fact that the
- * underlying m_chars object may not store characters in a
- * single contiguous array -- for example,the current
- * FastStringBuffer may split a single node's text across
- * multiple allocation units. This call tells us how many
- * separate accesses will be required to retrieve the entire
- * content. PLEASE NOTE that this may not be the same as the
- * number of SAX characters() events that caused the text node
- * to be built in the first place, since m_chars buffering may
- * be on different boundaries than the parser's buffers.
- *
- * @param nodeHandle The node ID.
- *
- * @return number of character array chunks in
- * the string-value of a node.
- * */
- //###zaj - tbd
- public int getStringValueChunkCount(int nodeHandle)
- {
- //###zaj return value
- return 0;
- }
-
- /**
- * Get a character array chunk in the string-value of a node.
- * (see http://www.w3.org/TR/xpath#data-model
- * for the definition of a node's string-value).
- * Note that a single text node may have multiple text chunks.
- *
- * EXPLANATION: This method is an artifact of the fact that
- * the underlying m_chars object may not store characters in a
- * single contiguous array -- for example,the current
- * FastStringBuffer may split a single node's text across
- * multiple allocation units. This call retrieves a single
- * contiguous portion of the text -- as much as m-chars was
- * able to store in a single allocation unit. PLEASE NOTE
- * that this may not be the same granularityas the SAX
- * characters() events that caused the text node to be built
- * in the first place, since m_chars buffering may be on
- * different boundaries than the parser's buffers.
- *
- * @param nodeHandle The node ID.
- * @param chunkIndex Which chunk to get.
- * @param startAndLen An array of 2 where the start position and length of
- * the chunk will be returned.
- *
- * @return The character array reference where the chunk occurs. */
- //###zaj - tbd
- public char[] getStringValueChunk(int nodeHandle, int chunkIndex,
- int[] startAndLen) {return new char[0];}
-
- /**
- * Given a node handle, return an ID that represents the node's expanded name.
- *
- * @param nodeHandle The handle to the node in question.
- *
- * @return the expanded-name id of the node.
- */
- public int getExpandedTypeID(int nodeHandle) {
- nodes.readSlot(nodeHandle, gotslot);
- String qName = m_localNames.indexToString(gotslot[3]);
- // Remove prefix from qName
- // %TBD% jjk This is assuming the elementName is the qName.
- int colonpos = qName.indexOf(":");
- String localName = qName.substring(colonpos+1);
- // Get NS
- String namespace = m_nsNames.indexToString(gotslot[0] << 16);
- // Create expanded name
- String expandedName = namespace + ":" + localName;
- int expandedNameID = m_nsNames.stringToIndex(expandedName);
-
- return expandedNameID;
- }
-
-
- /**
- * Given an expanded name, return an ID. If the expanded-name does not
- * exist in the internal tables, the entry will be created, and the ID will
- * be returned. Any additional nodes that are created that have this
- * expanded name will use this ID.
- *
- * @return the expanded-name id of the node.
- */
- public int getExpandedTypeID(String namespace, String localName, int type) {
- // Create expanded name
- // %TBD% jjk Expanded name is bitfield-encoded as
- // typeID[6]nsuriID[10]localID[16]. Switch to that form, and to
- // accessing the ns/local via their tables rather than confusing
- // nsnames and expandednames.
- String expandedName = namespace + ":" + localName;
- int expandedNameID = m_nsNames.stringToIndex(expandedName);
-
- return expandedNameID;
- }
-
-
- /**
- * Given an expanded-name ID, return the local name part.
- *
- * @param ExpandedNameID an ID that represents an expanded-name.
- * @return String Local name of this node.
- */
- public String getLocalNameFromExpandedNameID(int ExpandedNameID) {
-
- // Get expanded name
- String expandedName = m_localNames.indexToString(ExpandedNameID);
- // Remove prefix from expanded name
- int colonpos = expandedName.indexOf(":");
- String localName = expandedName.substring(colonpos+1);
- return localName;
- }
-
-
- /**
- * Given an expanded-name ID, return the namespace URI part.
- *
- * @param ExpandedNameID an ID that represents an expanded-name.
- * @return String URI value of this node's namespace, or null if no
- * namespace was resolved.
- */
- public String getNamespaceFromExpandedNameID(int ExpandedNameID) {
-
- String expandedName = m_localNames.indexToString(ExpandedNameID);
- // Remove local name from expanded name
- int colonpos = expandedName.indexOf(":");
- String nsName = expandedName.substring(0, colonpos);
-
- return nsName;
- }
-
-
- /**
- * fixednames
- */
- private static final String[] fixednames=
- {
- null,null, // nothing, Element
- null,"#text", // Attr, Text
- "#cdata_section",null, // CDATA, EntityReference
- null,null, // Entity, PI
- "#comment","#document", // Comment, Document
- null,"#document-fragment", // Doctype, DocumentFragment
- null}; // Notation
-
- /**
- * Given a node handle, return its DOM-style node name. This will
- * include names such as #text or #document.
- *
- * @param nodeHandle the id of the node.
- * @return String Name of this node, which may be an empty string.
- * %REVIEW% Document when empty string is possible...
- */
- public String getNodeName(int nodeHandle) {
- nodes.readSlot(nodeHandle, gotslot);
- short type = (short) (gotslot[0] & 0xFFFF);
- String name = fixednames[type];
- if (null == name) {
- int i=gotslot[3];
- /**/System.out.println("got i="+i+" "+(i>>16)+"/"+(i&0xffff));
-
- name=m_localNames.indexToString(i & 0xFFFF);
- String prefix=m_prefixNames.indexToString(i >>16);
- if(prefix!=null && prefix.length()>0)
- name=prefix+":"+name;
- }
- return name;
- }
-
- /**
- * Given a node handle, return the XPath node name. This should be
- * the name as described by the XPath data model, NOT the DOM-style
- * name.
- *
- * @param nodeHandle the id of the node.
- * @return String Name of this node.
- */
- public String getNodeNameX(int nodeHandle) {return null;}
-
- /**
- * Given a node handle, return its DOM-style localname.
- * (As defined in Namespaces, this is the portion of the name after any
- * colon character)
- *
- * %REVIEW% What's the local name of something other than Element/Attr?
- * Should this be DOM-style (undefined unless namespaced), or other?
- *
- * @param nodeHandle the id of the node.
- * @return String Local name of this node.
- */
- public String getLocalName(int nodeHandle) {
- nodes.readSlot(nodeHandle, gotslot);
- short type = (short) (gotslot[0] & 0xFFFF);
- String name = "";
- if ((type==ELEMENT_NODE) || (type==ATTRIBUTE_NODE)) {
- int i=gotslot[3];
- name=m_localNames.indexToString(i & 0xFFFF);
- if(name==null) name="";
- }
- return name;
- }
-
- /**
- * Given a namespace handle, return the prefix that the namespace decl is
- * mapping.
- * Given a node handle, return the prefix used to map to the namespace.
- *
- * <p> %REVIEW% Are you sure you want "" for no prefix? </p>
- *
- * %REVIEW% Should this be DOM-style (undefined unless namespaced),
- * or other?
- *
- * @param nodeHandle the id of the node.
- * @return String prefix of this node's name, or "" if no explicit
- * namespace prefix was given.
- */
- public String getPrefix(int nodeHandle) {
- nodes.readSlot(nodeHandle, gotslot);
- short type = (short) (gotslot[0] & 0xFFFF);
- String name = "";
- if((type==ELEMENT_NODE) || (type==ATTRIBUTE_NODE)) {
- int i=gotslot[3];
- name=m_prefixNames.indexToString(i >>16);
- if(name==null) name="";
- }
- return name;
- }
-
- /**
- * Given a node handle, return its DOM-style namespace URI
- * (As defined in Namespaces, this is the declared URI which this node's
- * prefix -- or default in lieu thereof -- was mapped to.)
- *
- * @param nodeHandle the id of the node.
- * @return String URI value of this node's namespace, or null if no
- * namespace was resolved.
- */
- public String getNamespaceURI(int nodeHandle) {return null;}
-
- /**
- * Given a node handle, return its node value. This is mostly
- * as defined by the DOM, but may ignore some conveniences.
- * <p>
- *
- * @param nodeHandle The node id.
- * @return String Value of this node, or null if not
- * meaningful for this node type.
- */
- public String getNodeValue(int nodeHandle)
- {
- nodes.readSlot(nodeHandle, gotslot);
- int nodetype=gotslot[0] & 0xFF; // ###zaj use mask to get node type
- String value=null;
-
- switch (nodetype) { // ###zaj todo - document nodetypes
- case ATTRIBUTE_NODE:
- nodes.readSlot(nodeHandle+1, gotslot);
- case TEXT_NODE:
- case COMMENT_NODE:
- case CDATA_SECTION_NODE:
- value=m_char.getString(gotslot[2], gotslot[3]); //###zaj
- break;
- case PROCESSING_INSTRUCTION_NODE:
- case ELEMENT_NODE:
- case ENTITY_REFERENCE_NODE:
- default:
- break;
- }
- return value;
- }
-
- /**
- * Given a node handle, return its DOM-style node type.
- * <p>
- * %REVIEW% Generally, returning short is false economy. Return int?
- *
- * @param nodeHandle The node id.
- * @return int Node type, as per the DOM's Node._NODE constants.
- */
- public short getNodeType(int nodeHandle) {
- return(short) (nodes.readEntry(nodeHandle, 0) & 0xFFFF);
- }
-
- /**
- * Get the depth level of this node in the tree (equals 1 for
- * a parentless node).
- *
- * @param nodeHandle The node id.
- * @return the number of ancestors, plus one
- * @xsl.usage internal
- */
- public short getLevel(int nodeHandle) {
- short count = 0;
- while (nodeHandle != 0) {
- count++;
- nodeHandle = nodes.readEntry(nodeHandle, 1);
- }
- return count;
- }
-
- // ============== Document query functions ==============
-
- /**
- * Tests whether DTM DOM implementation implements a specific feature and
- * that feature is supported by this node.
- *
- * @param feature The name of the feature to test.
- * @param version This is the version number of the feature to test.
- * If the version is not
- * specified, supporting any version of the feature will cause the
- * method to return <code>true</code>.
- * @return Returns <code>true</code> if the specified feature is
- * supported on this node, <code>false</code> otherwise.
- */
- public boolean isSupported(String feature, String version) {return false;}
-
- /**
- * Return the base URI of the document entity. If it is not known
- * (because the document was parsed from a socket connection or from
- * standard input, for example), the value of this property is unknown.
- *
- * @return the document base URI String object or null if unknown.
- */
- public String getDocumentBaseURI()
- {
-
- return m_documentBaseURI;
- }
-
- /**
- * Set the base URI of the document entity.
- *
- * @param baseURI the document base URI String object or null if unknown.
- */
- public void setDocumentBaseURI(String baseURI)
- {
-
- m_documentBaseURI = baseURI;
- }
-
- /**
- * Return the system identifier of the document entity. If
- * it is not known, the value of this property is unknown.
- *
- * @param nodeHandle The node id, which can be any valid node handle.
- * @return the system identifier String object or null if unknown.
- */
- public String getDocumentSystemIdentifier(int nodeHandle) {return null;}
-
- /**
- * Return the name of the character encoding scheme
- * in which the document entity is expressed.
- *
- * @param nodeHandle The node id, which can be any valid node handle.
- * @return the document encoding String object.
- */
- public String getDocumentEncoding(int nodeHandle) {return null;}
-
- /**
- * Return an indication of the standalone status of the document,
- * either "yes" or "no". This property is derived from the optional
- * standalone document declaration in the XML declaration at the
- * beginning of the document entity, and has no value if there is no
- * standalone document declaration.
- *
- * @param nodeHandle The node id, which can be any valid node handle.
- * @return the document standalone String object, either "yes", "no", or null.
- */
- public String getDocumentStandalone(int nodeHandle) {return null;}
-
- /**
- * Return a string representing the XML version of the document. This
- * property is derived from the XML declaration optionally present at the
- * beginning of the document entity, and has no value if there is no XML
- * declaration.
- *
- * @param documentHandle the document handle
- *
- * @return the document version String object
- */
- public String getDocumentVersion(int documentHandle) {return null;}
-
- /**
- * Return an indication of
- * whether the processor has read the complete DTD. Its value is a
- * boolean. If it is false, then certain properties (indicated in their
- * descriptions below) may be unknown. If it is true, those properties
- * are never unknown.
- *
- * @return <code>true</code> if all declarations were processed {};
- * <code>false</code> otherwise.
- */
- public boolean getDocumentAllDeclarationsProcessed() {return false;}
-
- /**
- * A document type declaration information item has the following properties:
- *
- * 1. [system identifier] The system identifier of the external subset, if
- * it exists. Otherwise this property has no value.
- *
- * @return the system identifier String object, or null if there is none.
- */
- public String getDocumentTypeDeclarationSystemIdentifier() {return null;}
-
- /**
- * Return the public identifier of the external subset,
- * normalized as described in 4.2.2 External Entities [XML]. If there is
- * no external subset or if it has no public identifier, this property
- * has no value.
- *
- * @return the public identifier String object, or null if there is none.
- */
- public String getDocumentTypeDeclarationPublicIdentifier() {return null;}
-
- /**
- * Returns the <code>Element</code> whose <code>ID</code> is given by
- * <code>elementId</code>. If no such element exists, returns
- * <code>DTM.NULL</code>. Behavior is not defined if more than one element
- * has this <code>ID</code>. Attributes (including those
- * with the name "ID") are not of type ID unless so defined by DTD/Schema
- * information available to the DTM implementation.
- * Implementations that do not know whether attributes are of type ID or
- * not are expected to return <code>DTM.NULL</code>.
- *
- * <p>%REVIEW% Presumably IDs are still scoped to a single document,
- * and this operation searches only within a single document, right?
- * Wouldn't want collisions between DTMs in the same process.</p>
- *
- * @param elementId The unique <code>id</code> value for an element.
- * @return The handle of the matching element.
- */
- public int getElementById(String elementId) {return 0;}
-
- /**
- * The getUnparsedEntityURI function returns the URI of the unparsed
- * entity with the specified name in the same document as the context
- * node (see [3.3 Unparsed Entities]). It returns the empty string if
- * there is no such entity.
- * <p>
- * XML processors may choose to use the System Identifier (if one
- * is provided) to resolve the entity, rather than the URI in the
- * Public Identifier. The details are dependent on the processor, and
- * we would have to support some form of plug-in resolver to handle
- * this properly. Currently, we simply return the System Identifier if
- * present, and hope that it a usable URI or that our caller can
- * map it to one.
- * TODO: Resolve Public Identifiers... or consider changing function name.
- * <p>
- * If we find a relative URI
- * reference, XML expects it to be resolved in terms of the base URI
- * of the document. The DOM doesn't do that for us, and it isn't
- * entirely clear whether that should be done here; currently that's
- * pushed up to a higher level of our application. (Note that DOM Level
- * 1 didn't store the document's base URI.)
- * TODO: Consider resolving Relative URIs.
- * <p>
- * (The DOM's statement that "An XML processor may choose to
- * completely expand entities before the structure model is passed
- * to the DOM" refers only to parsed entities, not unparsed, and hence
- * doesn't affect this function.)
- *
- * @param name A string containing the Entity Name of the unparsed
- * entity.
- *
- * @return String containing the URI of the Unparsed Entity, or an
- * empty string if no such entity exists.
- */
- public String getUnparsedEntityURI(String name) {return null;}
-
-
- // ============== Boolean methods ================
-
- /**
- * Return true if the xsl:strip-space or xsl:preserve-space was processed
- * during construction of the DTM document.
- *
- * <p>%REVEIW% Presumes a 1:1 mapping from DTM to Document, since
- * we aren't saying which Document to query...?</p>
- */
- public boolean supportsPreStripping() {return false;}
-
- /**
- * Figure out whether nodeHandle2 should be considered as being later
- * in the document than nodeHandle1, in Document Order as defined
- * by the XPath model. This may not agree with the ordering defined
- * by other XML applications.
- * <p>
- * There are some cases where ordering isn't defined, and neither are
- * the results of this function -- though we'll generally return true.
- *
- * TODO: Make sure this does the right thing with attribute nodes!!!
- *
- * @param nodeHandle1 DOM Node to perform position comparison on.
- * @param nodeHandle2 DOM Node to perform position comparison on .
- *
- * @return false if node2 comes before node1, otherwise return true.
- * You can think of this as
- * <code>(node1.documentOrderPosition &lt;= node2.documentOrderPosition)</code>.
- */
- public boolean isNodeAfter(int nodeHandle1, int nodeHandle2) {return false;}
-
- /**
- * 2. [element content whitespace] A boolean indicating whether the
- * character is white space appearing within element content (see [XML],
- * 2.10 "White Space Handling"). Note that validating XML processors are
- * required by XML 1.0 to provide this information. If there is no
- * declaration for the containing element, this property has no value for
- * white space characters. If no declaration has been read, but the [all
- * declarations processed] property of the document information item is
- * false (so there may be an unread declaration), then the value of this
- * property is unknown for white space characters. It is always false for
- * characters that are not white space.
- *
- * @param nodeHandle the node ID.
- * @return <code>true</code> if the character data is whitespace;
- * <code>false</code> otherwise.
- */
- public boolean isCharacterElementContentWhitespace(int nodeHandle) {return false;}
-
- /**
- * 10. [all declarations processed] This property is not strictly speaking
- * part of the infoset of the document. Rather it is an indication of
- * whether the processor has read the complete DTD. Its value is a
- * boolean. If it is false, then certain properties (indicated in their
- * descriptions below) may be unknown. If it is true, those properties
- * are never unknown.
- *
- * @param documentHandle A node handle that must identify a document.
- * @return <code>true</code> if all declarations were processed;
- * <code>false</code> otherwise.
- */
- public boolean isDocumentAllDeclarationsProcessed(int documentHandle) {return false;}
-
- /**
- * 5. [specified] A flag indicating whether this attribute was actually
- * specified in the start-tag of its element, or was defaulted from the
- * DTD.
- *
- * @param attributeHandle the attribute handle
- * @return <code>true</code> if the attribute was specified;
- * <code>false</code> if it was defaulted.
- */
- public boolean isAttributeSpecified(int attributeHandle) {return false;}
-
- // ========== Direct SAX Dispatch, for optimization purposes ========
-
- /**
- * Directly call the
- * characters method on the passed ContentHandler for the
- * string-value of the given node (see http://www.w3.org/TR/xpath#data-model
- * for the definition of a node's string-value). Multiple calls to the
- * ContentHandler's characters methods may well occur for a single call to
- * this method.
- *
- * @param nodeHandle The node ID.
- * @param ch A non-null reference to a ContentHandler.
- *
- * @throws org.xml.sax.SAXException
- */
- public void dispatchCharactersEvents(
- int nodeHandle, org.xml.sax.ContentHandler ch, boolean normalize)
- throws org.xml.sax.SAXException {}
-
- /**
- * Directly create SAX parser events from a subtree.
- *
- * @param nodeHandle The node ID.
- * @param ch A non-null reference to a ContentHandler.
- *
- * @throws org.xml.sax.SAXException
- */
-
- public void dispatchToEvents(int nodeHandle, org.xml.sax.ContentHandler ch)
- throws org.xml.sax.SAXException {}
-
- /**
- * Return an DOM node for the given node.
- *
- * @param nodeHandle The node ID.
- *
- * @return A node representation of the DTM node.
- */
- public org.w3c.dom.Node getNode(int nodeHandle)
- {
- return null;
- }
-
- // ==== Construction methods (may not be supported by some implementations!) =====
- // %REVIEW% jjk: These probably aren't the right API. At the very least
- // they need to deal with current-insertion-location and end-element
- // issues.
-
- /**
- * Append a child to the end of the child list of the current node. Please note that the node
- * is always cloned if it is owned by another document.
- *
- * <p>%REVIEW% "End of the document" needs to be defined more clearly.
- * Does it become the last child of the Document? Of the root element?</p>
- *
- * @param newChild Must be a valid new node handle.
- * @param clone true if the child should be cloned into the document.
- * @param cloneDepth if the clone argument is true, specifies that the
- * clone should include all it's children.
- */
- public void appendChild(int newChild, boolean clone, boolean cloneDepth) {
- boolean sameDoc = ((newChild & DOCHANDLE_MASK) == m_docHandle);
- if (clone || !sameDoc) {
-
- } else {
-
- }
- }
-
- /**
- * Append a text node child that will be constructed from a string,
- * to the end of the document.
- *
- * <p>%REVIEW% "End of the document" needs to be defined more clearly.
- * Does it become the last child of the Document? Of the root element?</p>
- *
- * @param str Non-null reference to a string.
- */
- public void appendTextChild(String str) {
- // ###shs Think more about how this differs from createTextNode
- //%TBD%
- }
-
-
- //================================================================
- // ==== BUILDER methods ====
- // %TBD% jjk: SHOULD PROBABLY BE INLINED, unless we want to support
- // both SAX1 and SAX2 and share this logic between them.
-
- /** Append a text child at the current insertion point. Assumes that the
- * actual content of the text has previously been appended to the m_char
- * buffer (shared with the builder).
- *
- * @param m_char_current_start int Starting offset of node's content in m_char.
- * @param contentLength int Length of node's content in m_char.
- * */
- void appendTextChild(int m_char_current_start,int contentLength)
- {
- // create a Text Node
- // %TBD% may be possible to combine with appendNode()to replace the next chunk of code
- int w0 = TEXT_NODE;
- // W1: Parent
- int w1 = currentParent;
- // W2: Start position within m_char
- int w2 = m_char_current_start;
- // W3: Length of the full string
- int w3 = contentLength;
-
- int ourslot = appendNode(w0, w1, w2, w3);
- previousSibling = ourslot;
- }
-
- /** Append a comment child at the current insertion point. Assumes that the
- * actual content of the comment has previously been appended to the m_char
- * buffer (shared with the builder).
- *
- * @param m_char_current_start int Starting offset of node's content in m_char.
- * @param contentLength int Length of node's content in m_char.
- * */
- void appendComment(int m_char_current_start,int contentLength)
- {
- // create a Comment Node
- // %TBD% may be possible to combine with appendNode()to replace the next chunk of code
- int w0 = COMMENT_NODE;
- // W1: Parent
- int w1 = currentParent;
- // W2: Start position within m_char
- int w2 = m_char_current_start;
- // W3: Length of the full string
- int w3 = contentLength;
-
- int ourslot = appendNode(w0, w1, w2, w3);
- previousSibling = ourslot;
- }
-
-
- /** Append an Element child at the current insertion point. This
- * Element then _becomes_ the insertion point; subsequent appends
- * become its lastChild until an appendEndElement() call is made.
- *
- * Assumes that the symbols (local name, namespace URI and prefix)
- * have already been added to the pools
- *
- * Note that this _only_ handles the Element node itself. Attrs and
- * namespace nodes are unbundled in the ContentHandler layer
- * and appended separately.
- *
- * @param namespaceIndex: Index within the namespaceURI string pool
- * @param localNameIndex Index within the local name string pool
- * @param prefixIndex: Index within the prefix string pool
- * */
- void appendStartElement(int namespaceIndex,int localNameIndex, int prefixIndex)
- {
- // do document root node creation here on the first element, create nodes for
- // this element and its attributes, store the element, namespace, and attritute
- // name indexes to the nodes array, keep track of the current node and parent
- // element used
-
- // W0 High: Namespace Low: Node Type
- int w0 = (namespaceIndex << 16) | ELEMENT_NODE;
- // W1: Parent
- int w1 = currentParent;
- // W2: Next (initialized as 0)
- int w2 = 0;
- // W3: Tagname high: prefix Low: local name
- int w3 = localNameIndex | prefixIndex<<16;
- /**/System.out.println("set w3="+w3+" "+(w3>>16)+"/"+(w3&0xffff));
-
- //int ourslot = nodes.appendSlot(w0, w1, w2, w3);
- int ourslot = appendNode(w0, w1, w2, w3);
- currentParent = ourslot;
- previousSibling = 0;
-
- // set the root element pointer when creating the first element node
- if (m_docElement == NULL)
- m_docElement = ourslot;
- }
-
- /** Append a Namespace Declaration child at the current insertion point.
- * Assumes that the symbols (namespace URI and prefix) have already been
- * added to the pools
- *
- * @param prefixIndex: Index within the prefix string pool
- * @param namespaceIndex: Index within the namespaceURI string pool
- * @param isID: If someone really insists on writing a bad DTD, it is
- * theoretically possible for a namespace declaration to also be declared
- * as being a node ID. I don't really want to support that stupidity,
- * but I'm not sure we can refuse to accept it.
- * */
- void appendNSDeclaration(int prefixIndex, int namespaceIndex,
- boolean isID)
- {
- // %REVIEW% I'm assigning this node the "namespace for namespaces"
- // which the DOM defined. It is expected that the Namespace spec will
- // adopt this as official. It isn't strictly needed since it's implied
- // by the nodetype, but for now...
-
- // %REVIEW% Prefix need not be recorded; it's implied too. But
- // recording it might simplify the design.
-
- // %TBD% isID is not currently honored.
-
- final int namespaceForNamespaces=m_nsNames.stringToIndex("http://www.w3.org/2000/xmlns/");
-
- // W0 High: Namespace Low: Node Type
- int w0 = NAMESPACE_NODE | (m_nsNames.stringToIndex("http://www.w3.org/2000/xmlns/")<<16);
-
- // W1: Parent
- int w1 = currentParent;
- // W2: CURRENTLY UNUSED -- It's next-sib in attrs, but we have no kids.
- int w2 = 0;
- // W3: namespace name
- int w3 = namespaceIndex;
- // Add node
- int ourslot = appendNode(w0, w1, w2, w3);
- previousSibling = ourslot; // Should attributes be previous siblings
- previousSiblingWasParent = false;
- return ;//(m_docHandle | ourslot);
- }
-
- /** Append an Attribute child at the current insertion
- * point. Assumes that the symbols (namespace URI, local name, and
- * prefix) have already been added to the pools, and that the content has
- * already been appended to m_char. Note that the attribute's content has
- * been flattened into a single string; DTM does _NOT_ attempt to model
- * the details of entity references within attribute values.
- *
- * @param namespaceIndex int Index within the namespaceURI string pool
- * @param localNameIndex int Index within the local name string pool
- * @param prefixIndex int Index within the prefix string pool
- * @param isID boolean True if this attribute was declared as an ID
- * (for use in supporting getElementByID).
- * @param m_char_current_start int Starting offset of node's content in m_char.
- * @param contentLength int Length of node's content in m_char.
- * */
- void appendAttribute(int namespaceIndex, int localNameIndex, int prefixIndex,
- boolean isID,
- int m_char_current_start, int contentLength)
- {
- // %TBD% isID is not currently honored.
-
- // W0 High: Namespace Low: Node Type
- int w0 = ATTRIBUTE_NODE | namespaceIndex<<16;
-
- // W1: Parent
- int w1 = currentParent;
- // W2: Next (not yet resolved)
- int w2 = 0;
- // W3: Tagname high: prefix Low: local name
- int w3 = localNameIndex | prefixIndex<<16;
- /**/System.out.println("set w3="+w3+" "+(w3>>16)+"/"+(w3&0xffff));
- // Add node
- int ourslot = appendNode(w0, w1, w2, w3);
- previousSibling = ourslot; // Should attributes be previous siblings
-
- // Attribute's content is currently appended as a Text Node
-
- // W0: Node Type
- w0 = TEXT_NODE;
- // W1: Parent
- w1 = ourslot;
- // W2: Start Position within buffer
- w2 = m_char_current_start;
- // W3: Length
- w3 = contentLength;
- appendNode(w0, w1, w2, w3);
-
- // Attrs are Parents
- previousSiblingWasParent = true;
- return ;//(m_docHandle | ourslot);
- }
-
- /**
- * This returns a stateless "traverser", that can navigate over an
- * XPath axis, though not in document order.
- *
- * @param axis One of Axes.ANCESTORORSELF, etc.
- *
- * @return A DTMAxisIterator, or null if the given axis isn't supported.
- */
- public DTMAxisTraverser getAxisTraverser(final int axis)
- {
- return null;
- }
-
- /**
- * This is a shortcut to the iterators that implement the
- * supported XPath axes (only namespace::) is not supported.
- * Returns a bare-bones iterator that must be initialized
- * with a start node (using iterator.setStartNode()).
- *
- * @param axis One of Axes.ANCESTORORSELF, etc.
- *
- * @return A DTMAxisIterator, or null if the given axis isn't supported.
- */
- public DTMAxisIterator getAxisIterator(final int axis)
- {
- // %TBD%
- return null;
- }
-
- /**
- * Get an iterator that can navigate over an XPath Axis, predicated by
- * the extended type ID.
- *
- *
- * @param axis
- * @param type An extended type ID.
- *
- * @return A DTMAxisIterator, or null if the given axis isn't supported.
- */
- public DTMAxisIterator getTypedAxisIterator(final int axis, final int type)
- {
- // %TBD%
- return null;
- }
-
-
- /** Terminate the element currently acting as an insertion point. Subsequent
- * insertions will occur as the last child of this element's parent.
- * */
- void appendEndElement()
- {
- // pop up the stacks
-
- if (previousSiblingWasParent)
- nodes.writeEntry(previousSibling, 2, NULL);
-
- // Pop parentage
- previousSibling = currentParent;
- nodes.readSlot(currentParent, gotslot);
- currentParent = gotslot[1] & 0xFFFF;
-
- // The element just being finished will be
- // the previous sibling for the next operation
- previousSiblingWasParent = true;
-
- // Pop a level of namespace table
- // namespaceTable.removeLastElem();
- }
-
- /** Starting a new document. Perform any resets/initialization
- * not already handled.
- * */
- void appendStartDocument()
- {
-
- // %TBD% reset slot 0 to indicate ChunkedIntArray reuse or wait for
- // the next initDocument().
- m_docElement = NULL; // reset nodeHandle to the root of the actual dtm doc content
- initDocument(0);
- }
-
- /** All appends to this document have finished; do whatever final
- * cleanup is needed.
- * */
- void appendEndDocument()
- {
- done = true;
- // %TBD% may need to notice the last slot number and slot count to avoid
- // residual data from provious use of this DTM
- }
-
- /**
- * For the moment all the run time properties are ignored by this
- * class.
- *
- * @param property a <code>String</code> value
- * @param value an <code>Object</code> value
- */
- public void setProperty(String property, Object value)
- {
- }
-
- /**
- * Source information is not handled yet, so return
- * <code>null</code> here.
- *
- * @param node an <code>int</code> value
- * @return null
- */
- public SourceLocator getSourceLocatorFor(int node)
- {
- return null;
- }
-
-
- /**
- * A dummy routine to satisify the abstract interface. If the DTM
- * implememtation that extends the default base requires notification
- * of registration, they can override this method.
- */
- public void documentRegistration()
- {
- }
-
- /**
- * A dummy routine to satisify the abstract interface. If the DTM
- * implememtation that extends the default base requires notification
- * when the document is being released, they can override this method
- */
- public void documentRelease()
- {
- }
-
- /**
- * Migrate a DTM built with an old DTMManager to a new DTMManager.
- * After the migration, the new DTMManager will treat the DTM as
- * one that is built by itself.
- * This is used to support DTM sharing between multiple transformations.
- * @param manager the DTMManager
- */
- public void migrateTo(DTMManager manager)
- {
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/dtm/ref/DTMManagerDefault.java b/src/com/sun/org/apache/xml/internal/dtm/ref/DTMManagerDefault.java
deleted file mode 100644
index 9f93f80..0000000
--- a/src/com/sun/org/apache/xml/internal/dtm/ref/DTMManagerDefault.java
+++ /dev/null
@@ -1,861 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DTMManagerDefault.java,v 1.2.4.1 2005/09/15 08:15:02 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.dtm.ref;
-
-import com.sun.org.apache.xalan.internal.utils.FactoryImpl;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.transform.Source;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.transform.stream.StreamSource;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMException;
-import com.sun.org.apache.xml.internal.dtm.DTMFilter;
-import com.sun.org.apache.xml.internal.dtm.DTMIterator;
-import com.sun.org.apache.xml.internal.dtm.DTMManager;
-import com.sun.org.apache.xml.internal.dtm.DTMWSFilter;
-import com.sun.org.apache.xml.internal.dtm.ref.dom2dtm.DOM2DTM;
-import com.sun.org.apache.xml.internal.dtm.ref.sax2dtm.SAX2DTM;
-import com.sun.org.apache.xml.internal.dtm.ref.sax2dtm.SAX2RTFDTM;
-import com.sun.org.apache.xml.internal.res.XMLErrorResources;
-import com.sun.org.apache.xml.internal.res.XMLMessages;
-import com.sun.org.apache.xml.internal.utils.PrefixResolver;
-import com.sun.org.apache.xml.internal.utils.SystemIDResolver;
-import com.sun.org.apache.xml.internal.utils.XMLReaderManager;
-import com.sun.org.apache.xml.internal.utils.XMLStringFactory;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.helpers.DefaultHandler;
-
-/**
- * The default implementation for the DTMManager.
- *
- * %REVIEW% There is currently a reentrancy issue, since the finalizer
- * for XRTreeFrag (which runs in the GC thread) wants to call
- * DTMManager.release(), and may do so at the same time that the main
- * transformation thread is accessing the manager. Our current solution is
- * to make most of the manager's methods <code>synchronized</code>.
- * Early tests suggest that doing so is not causing a significant
- * performance hit in Xalan. However, it should be noted that there
- * is a possible alternative solution: rewrite release() so it merely
- * posts a request for release onto a threadsafe queue, and explicitly
- * process that queue on an infrequent basis during main-thread
- * activity (eg, when getDTM() is invoked). The downside of that solution
- * would be a greater delay before the DTM's storage is actually released
- * for reuse.
- * */
-public class DTMManagerDefault extends DTMManager
-{
- //static final boolean JKESS_XNI_EXPERIMENT=true;
-
- /** Set this to true if you want a dump of the DTM after creation. */
- private static final boolean DUMPTREE = false;
-
- /** Set this to true if you want a basic diagnostics. */
- private static final boolean DEBUG = false;
-
- /**
- * Map from DTM identifier numbers to DTM objects that this manager manages.
- * One DTM may have several prefix numbers, if extended node indexing
- * is in use; in that case, m_dtm_offsets[] will used to control which
- * prefix maps to which section of the DTM.
- *
- * This array grows as necessary; see addDTM().
- *
- * This array grows as necessary; see addDTM(). Growth is uncommon... but
- * access needs to be blindingly fast since it's used in node addressing.
- */
- protected DTM m_dtms[] = new DTM[256];
-
- /** Map from DTM identifier numbers to offsets. For small DTMs with a
- * single identifier, this will always be 0. In overflow addressing, where
- * additional identifiers are allocated to access nodes beyond the range of
- * a single Node Handle, this table is used to map the handle's node field
- * into the actual node identifier.
- *
- * This array grows as necessary; see addDTM().
- *
- * This array grows as necessary; see addDTM(). Growth is uncommon... but
- * access needs to be blindingly fast since it's used in node addressing.
- * (And at the moment, that includes accessing it from DTMDefaultBase,
- * which is why this is not Protected or Private.)
- */
- int m_dtm_offsets[] = new int[256];
-
- /**
- * The cache for XMLReader objects to be used if the user did not
- * supply an XMLReader for a SAXSource or supplied a StreamSource.
- */
- protected XMLReaderManager m_readerManager = null;
-
- /**
- * The default implementation of ContentHandler, DTDHandler and ErrorHandler.
- */
- protected DefaultHandler m_defaultHandler = new DefaultHandler();
-
- /**
- * Add a DTM to the DTM table. This convenience call adds it as the
- * "base DTM ID", with offset 0. The other version of addDTM should
- * be used if you want to add "extended" DTM IDs with nonzero offsets.
- *
- * @param dtm Should be a valid reference to a DTM.
- * @param id Integer DTM ID to be bound to this DTM
- */
- synchronized public void addDTM(DTM dtm, int id) { addDTM(dtm,id,0); }
-
-
- /**
- * Add a DTM to the DTM table.
- *
- * @param dtm Should be a valid reference to a DTM.
- * @param id Integer DTM ID to be bound to this DTM.
- * @param offset Integer addressing offset. The internal DTM Node ID is
- * obtained by adding this offset to the node-number field of the
- * public DTM Handle. For the first DTM ID accessing each DTM, this is 0;
- * for overflow addressing it will be a multiple of 1<<IDENT_DTM_NODE_BITS.
- */
- synchronized public void addDTM(DTM dtm, int id, int offset)
- {
- if(id>=IDENT_MAX_DTMS)
- {
- // TODO: %REVIEW% Not really the right error message.
- throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_NO_DTMIDS_AVAIL, null)); //"No more DTM IDs are available!");
- }
-
- // We used to just allocate the array size to IDENT_MAX_DTMS.
- // But we expect to increase that to 16 bits, and I'm not willing
- // to allocate that much space unless needed. We could use one of our
- // handy-dandy Fast*Vectors, but this will do for now.
- // %REVIEW%
- int oldlen=m_dtms.length;
- if(oldlen<=id)
- {
- // Various growth strategies are possible. I think we don't want
- // to over-allocate excessively, and I'm willing to reallocate
- // more often to get that. See also Fast*Vector classes.
- //
- // %REVIEW% Should throw a more diagnostic error if we go over the max...
- int newlen=Math.min((id+256),IDENT_MAX_DTMS);
-
- DTM new_m_dtms[] = new DTM[newlen];
- System.arraycopy(m_dtms,0,new_m_dtms,0,oldlen);
- m_dtms=new_m_dtms;
- int new_m_dtm_offsets[] = new int[newlen];
- System.arraycopy(m_dtm_offsets,0,new_m_dtm_offsets,0,oldlen);
- m_dtm_offsets=new_m_dtm_offsets;
- }
-
- m_dtms[id] = dtm;
- m_dtm_offsets[id]=offset;
- dtm.documentRegistration();
- // The DTM should have been told who its manager was when we created it.
- // Do we need to allow for adopting DTMs _not_ created by this manager?
- }
-
- /**
- * Get the first free DTM ID available. %OPT% Linear search is inefficient!
- */
- synchronized public int getFirstFreeDTMID()
- {
- int n = m_dtms.length;
- for (int i = 1; i < n; i++)
- {
- if(null == m_dtms[i])
- {
- return i;
- }
- }
- return n; // count on addDTM() to throw exception if out of range
- }
-
- /**
- * The default table for exandedNameID lookups.
- */
- private ExpandedNameTable m_expandedNameTable =
- new ExpandedNameTable();
-
- /**
- * Constructor DTMManagerDefault
- *
- */
- public DTMManagerDefault(){}
-
-
- /**
- * Get an instance of a DTM, loaded with the content from the
- * specified source. If the unique flag is true, a new instance will
- * always be returned. Otherwise it is up to the DTMManager to return a
- * new instance or an instance that it already created and may be being used
- * by someone else.
- *
- * A bit of magic in this implementation: If the source is null, unique is true,
- * and incremental and doIndexing are both false, we return an instance of
- * SAX2RTFDTM, which see.
- *
- * (I think more parameters will need to be added for error handling, and entity
- * resolution, and more explicit control of the RTF situation).
- *
- * @param source the specification of the source object.
- * @param unique true if the returned DTM must be unique, probably because it
- * is going to be mutated.
- * @param whiteSpaceFilter Enables filtering of whitespace nodes, and may
- * be null.
- * @param incremental true if the DTM should be built incrementally, if
- * possible.
- * @param doIndexing true if the caller considers it worth it to use
- * indexing schemes.
- *
- * @return a non-null DTM reference.
- */
- synchronized public DTM getDTM(Source source, boolean unique,
- DTMWSFilter whiteSpaceFilter,
- boolean incremental, boolean doIndexing)
- {
-
- if(DEBUG && null != source)
- System.out.println("Starting "+
- (unique ? "UNIQUE" : "shared")+
- " source: "+source.getSystemId()
- );
-
- XMLStringFactory xstringFactory = m_xsf;
- int dtmPos = getFirstFreeDTMID();
- int documentID = dtmPos << IDENT_DTM_NODE_BITS;
-
- if ((null != source) && source instanceof DOMSource)
- {
- DOM2DTM dtm = new DOM2DTM(this, (DOMSource) source, documentID,
- whiteSpaceFilter, xstringFactory, doIndexing);
-
- addDTM(dtm, dtmPos, 0);
-
- // if (DUMPTREE)
- // {
- // dtm.dumpDTM();
- // }
-
- return dtm;
- }
- else
- {
- boolean isSAXSource = (null != source)
- ? (source instanceof SAXSource) : true;
- boolean isStreamSource = (null != source)
- ? (source instanceof StreamSource) : false;
-
- if (isSAXSource || isStreamSource) {
- XMLReader reader = null;
- SAX2DTM dtm;
-
- try {
- InputSource xmlSource;
-
- if (null == source) {
- xmlSource = null;
- } else {
- reader = getXMLReader(source);
- xmlSource = SAXSource.sourceToInputSource(source);
-
- String urlOfSource = xmlSource.getSystemId();
-
- if (null != urlOfSource) {
- try {
- urlOfSource = SystemIDResolver.getAbsoluteURI(urlOfSource);
- } catch (Exception e) {
- // %REVIEW% Is there a better way to send a warning?
- System.err.println("Can not absolutize URL: " + urlOfSource);
- }
-
- xmlSource.setSystemId(urlOfSource);
- }
- }
-
- if (source==null && unique && !incremental && !doIndexing) {
- // Special case to support RTF construction into shared DTM.
- // It should actually still work for other uses,
- // but may be slightly deoptimized relative to the base
- // to allow it to deal with carrying multiple documents.
- //
- // %REVIEW% This is a sloppy way to request this mode;
- // we need to consider architectural improvements.
- dtm = new SAX2RTFDTM(this, source, documentID, whiteSpaceFilter,
- xstringFactory, doIndexing);
- }
- /**************************************************************
- // EXPERIMENTAL 3/22/02
- else if(JKESS_XNI_EXPERIMENT && m_incremental) {
- dtm = new XNI2DTM(this, source, documentID, whiteSpaceFilter,
- xstringFactory, doIndexing);
- }
- **************************************************************/
- // Create the basic SAX2DTM.
- else {
- dtm = new SAX2DTM(this, source, documentID, whiteSpaceFilter,
- xstringFactory, doIndexing);
- }
-
- // Go ahead and add the DTM to the lookup table. This needs to be
- // done before any parsing occurs. Note offset 0, since we've just
- // created a new DTM.
- addDTM(dtm, dtmPos, 0);
-
-
- boolean haveXercesParser =
- (null != reader)
- && (reader.getClass()
- .getName()
- .equals("com.sun.org.apache.xerces.internal.parsers.SAXParser") );
-
- if (haveXercesParser) {
- incremental = true; // No matter what. %REVIEW%
- }
-
- // If the reader is null, but they still requested an incremental
- // build, then we still want to set up the IncrementalSAXSource stuff.
- if (m_incremental && incremental
- /* || ((null == reader) && incremental) */) {
- IncrementalSAXSource coParser=null;
-
- if (haveXercesParser) {
- // IncrementalSAXSource_Xerces to avoid threading.
- try {
- coParser =(IncrementalSAXSource)
- Class.forName("com.sun.org.apache.xml.internal.dtm.ref.IncrementalSAXSource_Xerces").newInstance();
- } catch( Exception ex ) {
- ex.printStackTrace();
- coParser=null;
- }
- }
-
- if (coParser==null ) {
- // Create a IncrementalSAXSource to run on the secondary thread.
- if (null == reader) {
- coParser = new IncrementalSAXSource_Filter();
- } else {
- IncrementalSAXSource_Filter filter =
- new IncrementalSAXSource_Filter();
- filter.setXMLReader(reader);
- coParser=filter;
- }
- }
-
-
- /**************************************************************
- // EXPERIMENTAL 3/22/02
- if (JKESS_XNI_EXPERIMENT && m_incremental &&
- dtm instanceof XNI2DTM &&
- coParser instanceof IncrementalSAXSource_Xerces) {
- com.sun.org.apache.xerces.internal.xni.parser.XMLPullParserConfiguration xpc=
- ((IncrementalSAXSource_Xerces)coParser)
- .getXNIParserConfiguration();
- if (xpc!=null) {
- // Bypass SAX; listen to the XNI stream
- ((XNI2DTM)dtm).setIncrementalXNISource(xpc);
- } else {
- // Listen to the SAX stream (will fail, diagnostically...)
- dtm.setIncrementalSAXSource(coParser);
- }
- } else
- ***************************************************************/
-
- // Have the DTM set itself up as IncrementalSAXSource's listener.
- dtm.setIncrementalSAXSource(coParser);
-
- if (null == xmlSource) {
-
- // Then the user will construct it themselves.
- return dtm;
- }
-
- if (null == reader.getErrorHandler()) {
- reader.setErrorHandler(dtm);
- }
- reader.setDTDHandler(dtm);
-
- try {
- // Launch parsing coroutine. Launches a second thread,
- // if we're using IncrementalSAXSource.filter().
-
- coParser.startParse(xmlSource);
- } catch (RuntimeException re) {
-
- dtm.clearCoRoutine();
-
- throw re;
- } catch (Exception e) {
-
- dtm.clearCoRoutine();
-
- throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(e);
- }
- } else {
- if (null == reader) {
-
- // Then the user will construct it themselves.
- return dtm;
- }
-
- // not incremental
- reader.setContentHandler(dtm);
- reader.setDTDHandler(dtm);
- if (null == reader.getErrorHandler()) {
- reader.setErrorHandler(dtm);
- }
-
- try {
- reader.setProperty(
- "http://xml.org/sax/properties/lexical-handler",
- dtm);
- } catch (SAXNotRecognizedException e){}
- catch (SAXNotSupportedException e){}
-
- try {
- reader.parse(xmlSource);
- } catch (RuntimeException re) {
- dtm.clearCoRoutine();
-
- throw re;
- } catch (Exception e) {
- dtm.clearCoRoutine();
-
- throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(e);
- }
- }
-
- if (DUMPTREE) {
- System.out.println("Dumping SAX2DOM");
- dtm.dumpDTM(System.err);
- }
-
- return dtm;
- } finally {
- // Reset the ContentHandler, DTDHandler, ErrorHandler to the DefaultHandler
- // after creating the DTM.
- if (reader != null && !(m_incremental && incremental)) {
- reader.setContentHandler(m_defaultHandler);
- reader.setDTDHandler(m_defaultHandler);
- reader.setErrorHandler(m_defaultHandler);
-
- // Reset the LexicalHandler to null after creating the DTM.
- try {
- reader.setProperty("http://xml.org/sax/properties/lexical-handler", null);
- }
- catch (Exception e) {}
- }
- releaseXMLReader(reader);
- }
- } else {
-
- // It should have been handled by a derived class or the caller
- // made a mistake.
- throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_NOT_SUPPORTED, new Object[]{source})); //"Not supported: " + source);
- }
- }
- }
-
- /**
- * Given a W3C DOM node, try and return a DTM handle.
- * Note: calling this may be non-optimal, and there is no guarantee that
- * the node will be found in any particular DTM.
- *
- * @param node Non-null reference to a DOM node.
- *
- * @return a valid DTM handle.
- */
- synchronized public int getDTMHandleFromNode(org.w3c.dom.Node node)
- {
- if(null == node)
- throw new IllegalArgumentException(XMLMessages.createXMLMessage(XMLErrorResources.ER_NODE_NON_NULL, null)); //"node must be non-null for getDTMHandleFromNode!");
-
- if (node instanceof com.sun.org.apache.xml.internal.dtm.ref.DTMNodeProxy)
- return ((com.sun.org.apache.xml.internal.dtm.ref.DTMNodeProxy) node).getDTMNodeNumber();
-
- else
- {
- // Find the DOM2DTMs wrapped around this Document (if any)
- // and check whether they contain the Node in question.
- //
- // NOTE that since a DOM2DTM may represent a subtree rather
- // than a full document, we have to be prepared to check more
- // than one -- and there is no guarantee that we will find
- // one that contains ancestors or siblings of the node we're
- // seeking.
- //
- // %REVIEW% We could search for the one which contains this
- // node at the deepest level, and thus covers the widest
- // subtree, but that's going to entail additional work
- // checking more DTMs... and getHandleOfNode is not a
- // cheap operation in most implementations.
- //
- // TODO: %REVIEW% If overflow addressing, we may recheck a DTM
- // already examined. Ouch. But with the increased number of DTMs,
- // scanning back to check this is painful.
- // POSSIBLE SOLUTIONS:
- // Generate a list of _unique_ DTM objects?
- // Have each DTM cache last DOM node search?
- int max = m_dtms.length;
- for(int i = 0; i < max; i++)
- {
- DTM thisDTM=m_dtms[i];
- if((null != thisDTM) && thisDTM instanceof DOM2DTM)
- {
- int handle=((DOM2DTM)thisDTM).getHandleOfNode(node);
- if(handle!=DTM.NULL) return handle;
- }
- }
-
- // Not found; generate a new DTM.
- //
- // %REVIEW% Is this really desirable, or should we return null
- // and make folks explicitly instantiate from a DOMSource? The
- // latter is more work but gives the caller the opportunity to
- // explicitly add the DTM to a DTMManager... and thus to know when
- // it can be discarded again, which is something we need to pay much
- // more attention to. (Especially since only DTMs which are assigned
- // to a manager can use the overflow addressing scheme.)
- //
- // %BUG% If the source node was a DOM2DTM$defaultNamespaceDeclarationNode
- // and the DTM wasn't registered with this DTMManager, we will create
- // a new DTM and _still_ not be able to find the node (since it will
- // be resynthesized). Another reason to push hard on making all DTMs
- // be managed DTMs.
-
- // Since the real root of our tree may be a DocumentFragment, we need to
- // use getParent to find the root, instead of getOwnerDocument. Otherwise
- // DOM2DTM#getHandleOfNode will be very unhappy.
- Node root = node;
- Node p = (root.getNodeType() == Node.ATTRIBUTE_NODE) ? ((org.w3c.dom.Attr)root).getOwnerElement() : root.getParentNode();
- for (; p != null; p = p.getParentNode())
- {
- root = p;
- }
-
- DOM2DTM dtm = (DOM2DTM) getDTM(new javax.xml.transform.dom.DOMSource(root),
- false, null, true, true);
-
- int handle;
-
- if(node instanceof com.sun.org.apache.xml.internal.dtm.ref.dom2dtm.DOM2DTMdefaultNamespaceDeclarationNode)
- {
- // Can't return the same node since it's unique to a specific DTM,
- // but can return the equivalent node -- find the corresponding
- // Document Element, then ask it for the xml: namespace decl.
- handle=dtm.getHandleOfNode(((org.w3c.dom.Attr)node).getOwnerElement());
- handle=dtm.getAttributeNode(handle,node.getNamespaceURI(),node.getLocalName());
- }
- else
- handle = ((DOM2DTM)dtm).getHandleOfNode(node);
-
- if(DTM.NULL == handle)
- throw new RuntimeException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COULD_NOT_RESOLVE_NODE, null)); //"Could not resolve the node to a handle!");
-
- return handle;
- }
- }
-
- /**
- * This method returns the SAX2 parser to use with the InputSource
- * obtained from this URI.
- * It may return null if any SAX2-conformant XML parser can be used,
- * or if getInputSource() will also return null. The parser must
- * be free for use (i.e., not currently in use for another parse().
- * After use of the parser is completed, the releaseXMLReader(XMLReader)
- * must be called.
- *
- * @param inputSource The value returned from the URIResolver.
- * @return a SAX2 XMLReader to use to resolve the inputSource argument.
- *
- * @return non-null XMLReader reference ready to parse.
- */
- synchronized public XMLReader getXMLReader(Source inputSource)
- {
-
- try
- {
- XMLReader reader = (inputSource instanceof SAXSource)
- ? ((SAXSource) inputSource).getXMLReader() : null;
-
- // If user did not supply a reader, ask for one from the reader manager
- if (null == reader) {
- if (m_readerManager == null) {
- m_readerManager = XMLReaderManager.getInstance(super.useServicesMechnism());
- }
-
- reader = m_readerManager.getXMLReader();
- }
-
- return reader;
-
- } catch (SAXException se) {
- throw new DTMException(se.getMessage(), se);
- }
- }
-
- /**
- * Indicates that the XMLReader object is no longer in use for the transform.
- *
- * Note that the getXMLReader method may return an XMLReader that was
- * specified on the SAXSource object by the application code. Such a
- * reader should still be passed to releaseXMLReader, but the reader manager
- * will only re-use XMLReaders that it created.
- *
- * @param reader The XMLReader to be released.
- */
- synchronized public void releaseXMLReader(XMLReader reader) {
- if (m_readerManager != null) {
- m_readerManager.releaseXMLReader(reader);
- }
- }
-
- /**
- * Return the DTM object containing a representation of this node.
- *
- * @param nodeHandle DTM Handle indicating which node to retrieve
- *
- * @return a reference to the DTM object containing this node.
- */
- synchronized public DTM getDTM(int nodeHandle)
- {
- try
- {
- // Performance critical function.
- return m_dtms[nodeHandle >>> IDENT_DTM_NODE_BITS];
- }
- catch(java.lang.ArrayIndexOutOfBoundsException e)
- {
- if(nodeHandle==DTM.NULL)
- return null; // Accept as a special case.
- else
- throw e; // Programming error; want to know about it.
- }
- }
-
- /**
- * Given a DTM, find the ID number in the DTM tables which addresses
- * the start of the document. If overflow addressing is in use, other
- * DTM IDs may also be assigned to this DTM.
- *
- * @param dtm The DTM which (hopefully) contains this node.
- *
- * @return The DTM ID (as the high bits of a NodeHandle, not as our
- * internal index), or -1 if the DTM doesn't belong to this manager.
- */
- synchronized public int getDTMIdentity(DTM dtm)
- {
- // Shortcut using DTMDefaultBase's extension hooks
- // %REVIEW% Should the lookup be part of the basic DTM API?
- if(dtm instanceof DTMDefaultBase)
- {
- DTMDefaultBase dtmdb=(DTMDefaultBase)dtm;
- if(dtmdb.getManager()==this)
- return dtmdb.getDTMIDs().elementAt(0);
- else
- return -1;
- }
-
- int n = m_dtms.length;
-
- for (int i = 0; i < n; i++)
- {
- DTM tdtm = m_dtms[i];
-
- if (tdtm == dtm && m_dtm_offsets[i]==0)
- return i << IDENT_DTM_NODE_BITS;
- }
-
- return -1;
- }
-
- /**
- * Release the DTMManager's reference(s) to a DTM, making it unmanaged.
- * This is typically done as part of returning the DTM to the heap after
- * we're done with it.
- *
- * @param dtm the DTM to be released.
- *
- * @param shouldHardDelete If false, this call is a suggestion rather than an
- * order, and we may not actually release the DTM. This is intended to
- * support intelligent caching of documents... which is not implemented
- * in this version of the DTM manager.
- *
- * @return true if the DTM was released, false if shouldHardDelete was set
- * and we decided not to.
- */
- synchronized public boolean release(DTM dtm, boolean shouldHardDelete)
- {
- if(DEBUG)
- {
- System.out.println("Releasing "+
- (shouldHardDelete ? "HARD" : "soft")+
- " dtm="+
- // Following shouldn't need a nodeHandle, but does...
- // and doesn't seem to report the intended value
- dtm.getDocumentBaseURI()
- );
- }
-
- if (dtm instanceof SAX2DTM)
- {
- ((SAX2DTM) dtm).clearCoRoutine();
- }
-
- // Multiple DTM IDs may be assigned to a single DTM.
- // The Right Answer is to ask which (if it supports
- // extension, the DTM will need a list anyway). The
- // Wrong Answer, applied if the DTM can't help us,
- // is to linearly search them all; this may be very
- // painful.
- //
- // %REVIEW% Should the lookup move up into the basic DTM API?
- if(dtm instanceof DTMDefaultBase)
- {
- com.sun.org.apache.xml.internal.utils.SuballocatedIntVector ids=((DTMDefaultBase)dtm).getDTMIDs();
- for(int i=ids.size()-1;i>=0;--i)
- m_dtms[ids.elementAt(i)>>>DTMManager.IDENT_DTM_NODE_BITS]=null;
- }
- else
- {
- int i = getDTMIdentity(dtm);
- if (i >= 0)
- {
- m_dtms[i >>> DTMManager.IDENT_DTM_NODE_BITS] = null;
- }
- }
-
- dtm.documentRelease();
- return true;
- }
-
- /**
- * Method createDocumentFragment
- *
- *
- * NEEDSDOC (createDocumentFragment) @return
- */
- synchronized public DTM createDocumentFragment()
- {
-
- try
- {
- DocumentBuilderFactory dbf = FactoryImpl.getDOMFactory(super.useServicesMechnism());
- dbf.setNamespaceAware(true);
-
- DocumentBuilder db = dbf.newDocumentBuilder();
- Document doc = db.newDocument();
- Node df = doc.createDocumentFragment();
-
- return getDTM(new DOMSource(df), true, null, false, false);
- }
- catch (Exception e)
- {
- throw new DTMException(e);
- }
- }
-
- /**
- * NEEDSDOC Method createDTMIterator
- *
- *
- * NEEDSDOC @param whatToShow
- * NEEDSDOC @param filter
- * NEEDSDOC @param entityReferenceExpansion
- *
- * NEEDSDOC (createDTMIterator) @return
- */
- synchronized public DTMIterator createDTMIterator(int whatToShow, DTMFilter filter,
- boolean entityReferenceExpansion)
- {
-
- /** @todo: implement this com.sun.org.apache.xml.internal.dtm.DTMManager abstract method */
- return null;
- }
-
- /**
- * NEEDSDOC Method createDTMIterator
- *
- *
- * NEEDSDOC @param xpathString
- * NEEDSDOC @param presolver
- *
- * NEEDSDOC (createDTMIterator) @return
- */
- synchronized public DTMIterator createDTMIterator(String xpathString,
- PrefixResolver presolver)
- {
-
- /** @todo: implement this com.sun.org.apache.xml.internal.dtm.DTMManager abstract method */
- return null;
- }
-
- /**
- * NEEDSDOC Method createDTMIterator
- *
- *
- * NEEDSDOC @param node
- *
- * NEEDSDOC (createDTMIterator) @return
- */
- synchronized public DTMIterator createDTMIterator(int node)
- {
-
- /** @todo: implement this com.sun.org.apache.xml.internal.dtm.DTMManager abstract method */
- return null;
- }
-
- /**
- * NEEDSDOC Method createDTMIterator
- *
- *
- * NEEDSDOC @param xpathCompiler
- * NEEDSDOC @param pos
- *
- * NEEDSDOC (createDTMIterator) @return
- */
- synchronized public DTMIterator createDTMIterator(Object xpathCompiler, int pos)
- {
-
- /** @todo: implement this com.sun.org.apache.xml.internal.dtm.DTMManager abstract method */
- return null;
- }
-
- /**
- * return the expanded name table.
- *
- * NEEDSDOC @param dtm
- *
- * NEEDSDOC ($objectName$) @return
- */
- public ExpandedNameTable getExpandedNameTable(DTM dtm)
- {
- return m_expandedNameTable;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/dtm/ref/DTMNamedNodeMap.java b/src/com/sun/org/apache/xml/internal/dtm/ref/DTMNamedNodeMap.java
deleted file mode 100644
index 8c8d1d9..0000000
--- a/src/com/sun/org/apache/xml/internal/dtm/ref/DTMNamedNodeMap.java
+++ /dev/null
@@ -1,302 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DTMNamedNodeMap.java,v 1.2.4.1 2005/09/15 08:15:03 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.dtm.ref;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-
-import org.w3c.dom.DOMException;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
- * DTMNamedNodeMap is a quickie (as opposed to quick) implementation of the DOM's
- * NamedNodeMap interface, intended to support DTMProxy's getAttributes()
- * call.
- * <p>
- * ***** Note: this does _not_ current attempt to cache any of the data;
- * if you ask for attribute 27 and then 28, you'll have to rescan the first
- * 27. It should probably at least keep track of the last one retrieved,
- * and possibly buffer the whole array.
- * <p>
- * ***** Also note that there's no fastpath for the by-name query; we search
- * linearly until we find it or fail to find it. Again, that could be
- * optimized at some cost in object creation/storage.
- * @xsl.usage internal
- */
-public class DTMNamedNodeMap implements NamedNodeMap
-{
-
- /** The DTM for this node. */
- DTM dtm;
-
- /** The DTM element handle. */
- int element;
-
- /** The number of nodes in this map. */
- short m_count = -1;
-
- /**
- * Create a getAttributes NamedNodeMap for a given DTM element node
- *
- * @param dtm The DTM Reference, must be non-null.
- * @param element The DTM element handle.
- */
- public DTMNamedNodeMap(DTM dtm, int element)
- {
- this.dtm = dtm;
- this.element = element;
- }
-
- /**
- * Return the number of Attributes on this Element
- *
- * @return The number of nodes in this map.
- */
- public int getLength()
- {
-
- if (m_count == -1)
- {
- short count = 0;
-
- for (int n = dtm.getFirstAttribute(element); n != -1;
- n = dtm.getNextAttribute(n))
- {
- ++count;
- }
-
- m_count = count;
- }
-
- return (int) m_count;
- }
-
- /**
- * Retrieves a node specified by name.
- * @param name The <code>nodeName</code> of a node to retrieve.
- * @return A <code>Node</code> (of any type) with the specified
- * <code>nodeName</code>, or <code>null</code> if it does not identify
- * any node in this map.
- */
- public Node getNamedItem(String name)
- {
-
- for (int n = dtm.getFirstAttribute(element); n != DTM.NULL;
- n = dtm.getNextAttribute(n))
- {
- if (dtm.getNodeName(n).equals(name))
- return dtm.getNode(n);
- }
-
- return null;
- }
-
- /**
- * Returns the <code>index</code>th item in the map. If <code>index</code>
- * is greater than or equal to the number of nodes in this map, this
- * returns <code>null</code>.
- * @param i The index of the requested item.
- * @return The node at the <code>index</code>th position in the map, or
- * <code>null</code> if that is not a valid index.
- */
- public Node item(int i)
- {
-
- int count = 0;
-
- for (int n = dtm.getFirstAttribute(element); n != -1;
- n = dtm.getNextAttribute(n))
- {
- if (count == i)
- return dtm.getNode(n);
- else
- ++count;
- }
-
- return null;
- }
-
- /**
- * Adds a node using its <code>nodeName</code> attribute. If a node with
- * that name is already present in this map, it is replaced by the new
- * one.
- * <br>As the <code>nodeName</code> attribute is used to derive the name
- * which the node must be stored under, multiple nodes of certain types
- * (those that have a "special" string value) cannot be stored as the
- * names would clash. This is seen as preferable to allowing nodes to be
- * aliased.
- * @param newNode node to store in this map. The node will later be
- * accessible using the value of its <code>nodeName</code> attribute.
- *
- * @return If the new <code>Node</code> replaces an existing node the
- * replaced <code>Node</code> is returned, otherwise <code>null</code>
- * is returned.
- * @exception DOMException
- * WRONG_DOCUMENT_ERR: Raised if <code>arg</code> was created from a
- * different document than the one that created this map.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.
- * <br>INUSE_ATTRIBUTE_ERR: Raised if <code>arg</code> is an
- * <code>Attr</code> that is already an attribute of another
- * <code>Element</code> object. The DOM user must explicitly clone
- * <code>Attr</code> nodes to re-use them in other elements.
- */
- public Node setNamedItem(Node newNode)
- {
- throw new DTMException(DTMException.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- /**
- * Removes a node specified by name. When this map contains the attributes
- * attached to an element, if the removed attribute is known to have a
- * default value, an attribute immediately appears containing the
- * default value as well as the corresponding namespace URI, local name,
- * and prefix when applicable.
- * @param name The <code>nodeName</code> of the node to remove.
- *
- * @return The node removed from this map if a node with such a name
- * exists.
- * @exception DOMException
- * NOT_FOUND_ERR: Raised if there is no node named <code>name</code> in
- * this map.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.
- */
- public Node removeNamedItem(String name)
- {
- throw new DTMException(DTMException.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- /**
- * Retrieves a node specified by local name and namespace URI. HTML-only
- * DOM implementations do not need to implement this method.
- * @param namespaceURI The namespace URI of the node to retrieve.
- * @param localName The local name of the node to retrieve.
- *
- * @return A <code>Node</code> (of any type) with the specified local
- * name and namespace URI, or <code>null</code> if they do not
- * identify any node in this map.
- * @since DOM Level 2
- */
- public Node getNamedItemNS(String namespaceURI, String localName)
- {
- Node retNode = null;
- for (int n = dtm.getFirstAttribute(element); n != DTM.NULL;
- n = dtm.getNextAttribute(n))
- {
- if (localName.equals(dtm.getLocalName(n)))
- {
- String nsURI = dtm.getNamespaceURI(n);
- if ((namespaceURI == null && nsURI == null)
- || (namespaceURI != null && namespaceURI.equals(nsURI)))
- {
- retNode = dtm.getNode(n);
- break;
- }
- }
- }
- return retNode;
- }
-
- /**
- * Adds a node using its <code>namespaceURI</code> and
- * <code>localName</code>. If a node with that namespace URI and that
- * local name is already present in this map, it is replaced by the new
- * one.
- * <br>HTML-only DOM implementations do not need to implement this method.
- * @param arg A node to store in this map. The node will later be
- * accessible using the value of its <code>namespaceURI</code> and
- * <code>localName</code> attributes.
- *
- * @return If the new <code>Node</code> replaces an existing node the
- * replaced <code>Node</code> is returned, otherwise <code>null</code>
- * is returned.
- * @exception DOMException
- * WRONG_DOCUMENT_ERR: Raised if <code>arg</code> was created from a
- * different document than the one that created this map.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.
- * <br>INUSE_ATTRIBUTE_ERR: Raised if <code>arg</code> is an
- * <code>Attr</code> that is already an attribute of another
- * <code>Element</code> object. The DOM user must explicitly clone
- * <code>Attr</code> nodes to re-use them in other elements.
- * @since DOM Level 2
- */
- public Node setNamedItemNS(Node arg) throws DOMException
- {
- throw new DTMException(DTMException.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- /**
- * Removes a node specified by local name and namespace URI. A removed
- * attribute may be known to have a default value when this map contains
- * the attributes attached to an element, as returned by the attributes
- * attribute of the <code>Node</code> interface. If so, an attribute
- * immediately appears containing the default value as well as the
- * corresponding namespace URI, local name, and prefix when applicable.
- * <br>HTML-only DOM implementations do not need to implement this method.
- *
- * @param namespaceURI The namespace URI of the node to remove.
- * @param localName The local name of the node to remove.
- *
- * @return The node removed from this map if a node with such a local
- * name and namespace URI exists.
- * @exception DOMException
- * NOT_FOUND_ERR: Raised if there is no node with the specified
- * <code>namespaceURI</code> and <code>localName</code> in this map.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.
- * @since DOM Level 2
- */
- public Node removeNamedItemNS(String namespaceURI, String localName)
- throws DOMException
- {
- throw new DTMException(DTMException.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- /**
- * Simple implementation of DOMException.
- * @xsl.usage internal
- */
- public class DTMException extends org.w3c.dom.DOMException
- {
- static final long serialVersionUID = -8290238117162437678L;
- /**
- * Constructs a DOM/DTM exception.
- *
- * @param code
- * @param message
- */
- public DTMException(short code, String message)
- {
- super(code, message);
- }
-
- /**
- * Constructor DTMException
- *
- *
- * @param code
- */
- public DTMException(short code)
- {
- super(code, "");
- }
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/dtm/ref/DTMNodeIterator.java b/src/com/sun/org/apache/xml/internal/dtm/ref/DTMNodeIterator.java
deleted file mode 100644
index b5a7bb6..0000000
--- a/src/com/sun/org/apache/xml/internal/dtm/ref/DTMNodeIterator.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DTMNodeIterator.java,v 1.2.4.1 2005/09/15 08:15:03 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.dtm.ref;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMDOMException;
-import com.sun.org.apache.xml.internal.dtm.DTMIterator;
-
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Node;
-import org.w3c.dom.traversal.NodeFilter;
-
-/**
- * <code>DTMNodeIterator</code> gives us an implementation of the
- * DTMNodeIterator which returns DOM nodes.
- *
- * Please note that this is not necessarily equivlaent to a DOM
- * NodeIterator operating over the same document. In particular:
- * <ul>
- *
- * <li>If there are several Text nodes in logical succession (ie,
- * across CDATASection and EntityReference boundaries), we will return
- * only the first; the caller is responsible for stepping through
- * them.
- * (%REVIEW% Provide a convenience routine here to assist, pending
- * proposed DOM Level 3 getAdjacentText() operation?) </li>
- *
- * <li>Since the whole XPath/XSLT architecture assumes that the source
- * document is not altered while we're working with it, we do not
- * promise to implement the DOM NodeIterator's "maintain current
- * position" response to document mutation. </li>
- *
- * <li>Since our design for XPath NodeIterators builds a stateful
- * filter directly into the traversal object, getNodeFilter() is not
- * supported.</li>
- *
- * </ul>
- *
- * <p>State: In progress!!</p>
- * */
-public class DTMNodeIterator implements org.w3c.dom.traversal.NodeIterator
-{
- private DTMIterator dtm_iter;
- private boolean valid=true;
-
- //================================================================
- // Methods unique to this class
-
- /** Public constructor: Wrap a DTMNodeIterator around an existing
- * and preconfigured DTMIterator
- * */
- public DTMNodeIterator(DTMIterator dtmIterator)
- {
- try
- {
- dtm_iter=(DTMIterator)dtmIterator.clone();
- }
- catch(CloneNotSupportedException cnse)
- {
- throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(cnse);
- }
- }
-
- /** Access the wrapped DTMIterator. I'm not sure whether anyone will
- * need this or not, but let's write it and think about it.
- * */
- public DTMIterator getDTMIterator()
- {
- return dtm_iter;
- }
-
-
- //================================================================
- // org.w3c.dom.traversal.NodeFilter API follows
-
- /** Detaches the NodeIterator from the set which it iterated over,
- * releasing any computational resources and placing the iterator in
- * the INVALID state.
- * */
- public void detach()
- {
- // Theoretically, we could release dtm_iter at this point. But
- // some of the operations may still want to consult it even though
- // navigation is now invalid.
- valid=false;
- }
-
- /** The value of this flag determines whether the children
- * of entity reference nodes are visible to the iterator.
- *
- * @return false, always (the DTM model flattens entity references)
- * */
- public boolean getExpandEntityReferences()
- {
- return false;
- }
-
- /** Return a handle to the filter used to screen nodes.
- *
- * This is ill-defined in Xalan's usage of Nodeiterator, where we have
- * built stateful XPath-based filtering directly into the traversal
- * object. We could return something which supports the NodeFilter interface
- * and allows querying whether a given node would be permitted if it appeared
- * as our next node, but in the current implementation that would be very
- * complex -- and just isn't all that useful.
- *
- * @throws DOMException -- NOT_SUPPORTED_ERROR because I can't think
- * of anything more useful to do in this case
- * */
- public NodeFilter getFilter()
- {
- throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
-
-
- /** @return The root node of the NodeIterator, as specified
- * when it was created.
- * */
- public Node getRoot()
- {
- int handle=dtm_iter.getRoot();
- return dtm_iter.getDTM(handle).getNode(handle);
- }
-
-
- /** Return a mask describing which node types are presented via the
- * iterator.
- **/
- public int getWhatToShow()
- {
- return dtm_iter.getWhatToShow();
- }
-
- /** @return the next node in the set and advance the position of the
- * iterator in the set.
- *
- * @throws DOMException - INVALID_STATE_ERR Raised if this method is
- * called after the detach method was invoked.
- * */
- public Node nextNode() throws DOMException
- {
- if(!valid)
- throw new DTMDOMException(DOMException.INVALID_STATE_ERR);
-
- int handle=dtm_iter.nextNode();
- if (handle==DTM.NULL)
- return null;
- return dtm_iter.getDTM(handle).getNode(handle);
- }
-
-
- /** @return the next previous in the set and advance the position of the
- * iterator in the set.
- *
- * @throws DOMException - INVALID_STATE_ERR Raised if this method is
- * called after the detach method was invoked.
- * */
- public Node previousNode()
- {
- if(!valid)
- throw new DTMDOMException(DOMException.INVALID_STATE_ERR);
-
- int handle=dtm_iter.previousNode();
- if (handle==DTM.NULL)
- return null;
- return dtm_iter.getDTM(handle).getNode(handle);
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/dtm/ref/DTMNodeList.java b/src/com/sun/org/apache/xml/internal/dtm/ref/DTMNodeList.java
deleted file mode 100644
index 3a933c8..0000000
--- a/src/com/sun/org/apache/xml/internal/dtm/ref/DTMNodeList.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DTMNodeList.java,v 1.2.4.1 2005/09/15 08:15:04 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.dtm.ref;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMIterator;
-import org.w3c.dom.Node;
-
-/**
- * <code>DTMNodeList</code> gives us an implementation of the DOM's
- * NodeList interface wrapped around a DTM Iterator. The author
- * considers this something of an abominations, since NodeList was not
- * intended to be a general purpose "list of nodes" API and is
- * generally considered by the DOM WG to have be a mistake... but I'm
- * told that some of the XPath/XSLT folks say they must have this
- * solution.
- *
- * Please note that this is not necessarily equivlaent to a DOM
- * NodeList operating over the same document. In particular:
- * <ul>
- *
- * <li>If there are several Text nodes in logical succession (ie,
- * across CDATASection and EntityReference boundaries), we will return
- * only the first; the caller is responsible for stepping through
- * them.
- * (%REVIEW% Provide a convenience routine here to assist, pending
- * proposed DOM Level 3 getAdjacentText() operation?) </li>
- *
- * <li>Since the whole XPath/XSLT architecture assumes that the source
- * document is not altered while we're working with it, we do not
- * promise to implement the DOM NodeList's "live view" response to
- * document mutation. </li>
- *
- * </ul>
- *
- * <p>State: In progress!!</p>
- * */
-public class DTMNodeList extends DTMNodeListBase {
- private DTMIterator m_iter;
-
- //================================================================
- // Methods unique to this class
- private DTMNodeList() {
- }
-
- /**
- * Public constructor: Wrap a DTMNodeList around an existing
- * and preconfigured DTMIterator
- *
- * WARNING: THIS HAS THE SIDE EFFECT OF ISSUING setShouldCacheNodes(true)
- * AGAINST THE DTMIterator.
- *
- */
- public DTMNodeList(DTMIterator dtmIterator) {
- if (dtmIterator != null) {
- int pos = dtmIterator.getCurrentPos();
- try {
- m_iter=(DTMIterator)dtmIterator.cloneWithReset();
- } catch(CloneNotSupportedException cnse) {
- m_iter = dtmIterator;
- }
- m_iter.setShouldCacheNodes(true);
- m_iter.runTo(-1);
- m_iter.setCurrentPos(pos);
- }
- }
-
- /**
- * Access the wrapped DTMIterator. I'm not sure whether anyone will
- * need this or not, but let's write it and think about it.
- *
- */
- public DTMIterator getDTMIterator() {
- return m_iter;
- }
-
- //================================================================
- // org.w3c.dom.NodeList API follows
-
- /**
- * Returns the <code>index</code>th item in the collection. If
- * <code>index</code> is greater than or equal to the number of nodes in
- * the list, this returns <code>null</code>.
- * @param index Index into the collection.
- * @return The node at the <code>index</code>th position in the
- * <code>NodeList</code>, or <code>null</code> if that is not a valid
- * index.
- */
- public Node item(int index)
- {
- if (m_iter != null) {
- int handle=m_iter.item(index);
- if (handle == DTM.NULL) {
- return null;
- }
- return m_iter.getDTM(handle).getNode(handle);
- } else {
- return null;
- }
- }
-
- /**
- * The number of nodes in the list. The range of valid child node indices
- * is 0 to <code>length-1</code> inclusive.
- */
- public int getLength() {
- return (m_iter != null) ? m_iter.getLength() : 0;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/dtm/ref/DTMNodeListBase.java b/src/com/sun/org/apache/xml/internal/dtm/ref/DTMNodeListBase.java
deleted file mode 100644
index d21f090..0000000
--- a/src/com/sun/org/apache/xml/internal/dtm/ref/DTMNodeListBase.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DTMNodeListBase.java,v 1.2.4.1 2005/09/15 08:15:04 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.dtm.ref;
-import org.w3c.dom.Node;
-
-/**
- * <code>DTMNodeList</code> gives us an implementation of the DOM's
- * NodeList interface wrapped around a DTM Iterator. The author
- * considers this something of an abominations, since NodeList was not
- * intended to be a general purpose "list of nodes" API and is
- * generally considered by the DOM WG to have be a mistake... but I'm
- * told that some of the XPath/XSLT folks say they must have this
- * solution.
- *
- * Please note that this is not necessarily equivlaent to a DOM
- * NodeList operating over the same document. In particular:
- * <ul>
- *
- * <li>If there are several Text nodes in logical succession (ie,
- * across CDATASection and EntityReference boundaries), we will return
- * only the first; the caller is responsible for stepping through
- * them.
- * (%REVIEW% Provide a convenience routine here to assist, pending
- * proposed DOM Level 3 getAdjacentText() operation?) </li>
- *
- * <li>Since the whole XPath/XSLT architecture assumes that the source
- * document is not altered while we're working with it, we do not
- * promise to implement the DOM NodeList's "live view" response to
- * document mutation. </li>
- *
- * </ul>
- *
- * <p>State: In progress!!</p>
- *
- */
-public class DTMNodeListBase implements org.w3c.dom.NodeList {
- public DTMNodeListBase() {
- }
-
- //================================================================
- // org.w3c.dom.NodeList API follows
-
- /**
- * Returns the <code>index</code>th item in the collection. If
- * <code>index</code> is greater than or equal to the number of nodes in
- * the list, this returns <code>null</code>.
- * @param index Index into the collection.
- * @return The node at the <code>index</code>th position in the
- * <code>NodeList</code>, or <code>null</code> if that is not a valid
- * index.
- */
- public Node item(int index) {
- return null;
- }
-
- /**
- * The number of nodes in the list. The range of valid child node indices
- * is 0 to <code>length-1</code> inclusive.
- */
- public int getLength() {
- return 0;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/dtm/ref/DTMNodeProxy.java b/src/com/sun/org/apache/xml/internal/dtm/ref/DTMNodeProxy.java
deleted file mode 100644
index 5fdf653..0000000
--- a/src/com/sun/org/apache/xml/internal/dtm/ref/DTMNodeProxy.java
+++ /dev/null
@@ -1,2415 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DTMNodeProxy.java,v
- */
-package com.sun.org.apache.xml.internal.dtm.ref;
-
-import java.util.Vector;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMDOMException;
-import com.sun.org.apache.xpath.internal.NodeSet;
-import java.util.Objects;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.CDATASection;
-import org.w3c.dom.Comment;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.EntityReference;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.ProcessingInstruction;
-import org.w3c.dom.Text;
-
-import org.w3c.dom.UserDataHandler;
-import org.w3c.dom.DOMConfiguration;
-import org.w3c.dom.TypeInfo;
-
-/**
- * <code>DTMNodeProxy</code> presents a DOM Node API front-end to the DTM model.
- * <p>
- * It does _not_ attempt to address the "node identity" question; no effort
- * is made to prevent the creation of multiple proxies referring to a single
- * DTM node. Users can create a mechanism for managing this, or relinquish the
- * use of "==" and use the .sameNodeAs() mechanism, which is under
- * consideration for future versions of the DOM.
- * <p>
- * DTMNodeProxy may be subclassed further to present specific DOM node types.
- *
- * @see org.w3c.dom
- */
-public class DTMNodeProxy
- implements Node, Document, Text, Element, Attr,
- ProcessingInstruction, Comment, DocumentFragment
-{
-
- /** The DTM for this node. */
- public DTM dtm;
-
- /** The DTM node handle. */
- int node;
-
- /** The return value as Empty String. */
- private static final String EMPTYSTRING = "";
-
- /** The DOMImplementation object */
- static final DOMImplementation implementation=new DTMNodeProxyImplementation();
-
- /**
- * Create a DTMNodeProxy Node representing a specific Node in a DTM
- *
- * @param dtm The DTM Reference, must be non-null.
- * @param node The DTM node handle.
- */
- public DTMNodeProxy(DTM dtm, int node)
- {
- this.dtm = dtm;
- this.node = node;
- }
-
- /**
- * NON-DOM: Return the DTM model
- *
- * @return The DTM that this proxy is a representative for.
- */
- public final DTM getDTM()
- {
- return dtm;
- }
-
- /**
- * NON-DOM: Return the DTM node number
- *
- * @return The DTM node handle.
- */
- public final int getDTMNodeNumber()
- {
- return node;
- }
-
- /**
- * Test for equality based on node number.
- *
- * @param node A DTM node proxy reference.
- *
- * @return true if the given node has the same handle as this node.
- */
- public final boolean equals(Node node)
- {
-
- try
- {
- DTMNodeProxy dtmp = (DTMNodeProxy) node;
-
- // return (dtmp.node == this.node);
- // Patch attributed to Gary L Peskin <garyp@firstech.com>
- return (dtmp.node == this.node) && (dtmp.dtm == this.dtm);
- }
- catch (ClassCastException cce)
- {
- return false;
- }
- }
-
- /**
- * Test for equality based on node number.
- *
- * @param node A DTM node proxy reference.
- *
- * @return true if the given node has the same handle as this node.
- */
- @Override
- public final boolean equals(Object node)
- {
- // DTMNodeProxy dtmp = (DTMNodeProxy)node;
- // return (dtmp.node == this.node);
- // Patch attributed to Gary L Peskin <garyp@firstech.com>
- return node instanceof Node && equals((Node) node);
- }
-
- @Override
- public int hashCode() {
- int hash = 7;
- hash = 29 * hash + Objects.hashCode(this.dtm);
- hash = 29 * hash + this.node;
- return hash;
- }
-
- /**
- * FUTURE DOM: Test node identity, in lieu of Node==Node
- *
- * @param other
- *
- * @return true if the given node has the same handle as this node.
- */
- public final boolean sameNodeAs(Node other)
- {
-
- if (!(other instanceof DTMNodeProxy))
- return false;
-
- DTMNodeProxy that = (DTMNodeProxy) other;
-
- return this.dtm == that.dtm && this.node == that.node;
- }
-
- /**
- *
- *
- * @see org.w3c.dom.Node
- */
- @Override
- public final String getNodeName()
- {
- return dtm.getNodeName(node);
- }
-
- /**
- * A PI's "target" states what processor channel the PI's data
- * should be directed to. It is defined differently in HTML and XML.
- * <p>
- * In XML, a PI's "target" is the first (whitespace-delimited) token
- * following the "<?" token that begins the PI.
- * <p>
- * In HTML, target is always null.
- * <p>
- * Note that getNodeName is aliased to getTarget.
- *
- *
- */
- @Override
- public final String getTarget()
- {
- return dtm.getNodeName(node);
- } // getTarget():String
-
- /**
- *
- *
- * @see org.w3c.dom.Node as of DOM Level 2
- */
- @Override
- public final String getLocalName()
- {
- return dtm.getLocalName(node);
- }
-
- /**
- * @return The prefix for this node.
- * @see org.w3c.dom.Node as of DOM Level 2
- */
- @Override
- public final String getPrefix()
- {
- return dtm.getPrefix(node);
- }
-
- /**
- *
- * @param prefix
- *
- * @throws DOMException
- * @see org.w3c.dom.Node as of DOM Level 2 -- DTMNodeProxy is read-only
- */
- @Override
- public final void setPrefix(String prefix) throws DOMException
- {
- throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- /**
- *
- *
- * @see org.w3c.dom.Node as of DOM Level 2
- */
- @Override
- public final String getNamespaceURI()
- {
- return dtm.getNamespaceURI(node);
- }
-
- /** Ask whether we support a given DOM feature.
- * In fact, we do not _fully_ support any DOM feature -- we're a
- * read-only subset -- so arguably we should always return false.
- * Or we could say that we support DOM Core Level 2 but all nodes
- * are read-only. Unclear which answer is least misleading.
- *
- * NON-DOM method. This was present in early drafts of DOM Level 2,
- * but was renamed isSupported. It's present here only because it's
- * cheap, harmless, and might help some poor fool who is still trying
- * to use an early Working Draft of the DOM.
- *
- * @param feature
- * @param version
- *
- * @return false
- */
- public final boolean supports(String feature, String version)
- {
- return implementation.hasFeature(feature,version);
- //throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
-
- /** Ask whether we support a given DOM feature.
- * In fact, we do not _fully_ support any DOM feature -- we're a
- * read-only subset -- so arguably we should always return false.
- *
- * @param feature
- * @param version
- *
- * @return false
- * @see org.w3c.dom.Node as of DOM Level 2
- */
- @Override
- public final boolean isSupported(String feature, String version)
- {
- return implementation.hasFeature(feature,version);
- // throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
-
- /**
- *
- *
- *
- * @throws DOMException
- * @see org.w3c.dom.Node
- */
- @Override
- public final String getNodeValue() throws DOMException
- {
- return dtm.getNodeValue(node);
- }
-
- /**
- * @return The string value of the node
- *
- * @throws DOMException
- */
- public final String getStringValue() throws DOMException
- {
- return dtm.getStringValue(node).toString();
- }
-
- /**
- *
- * @param nodeValue
- *
- * @throws DOMException
- * @see org.w3c.dom.Node -- DTMNodeProxy is read-only
- */
- @Override
- public final void setNodeValue(String nodeValue) throws DOMException
- {
- throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- /**
- *
- *
- * @see org.w3c.dom.Node
- */
- @Override
- public final short getNodeType()
- {
- return (short) dtm.getNodeType(node);
- }
-
- /**
- *
- *
- * @see org.w3c.dom.Node
- */
- @Override
- public final Node getParentNode()
- {
-
- if (getNodeType() == Node.ATTRIBUTE_NODE)
- return null;
-
- int newnode = dtm.getParent(node);
-
- return (newnode == DTM.NULL) ? null : dtm.getNode(newnode);
- }
-
- /**
- *
- *
- * @see org.w3c.dom.Node
- */
- public final Node getOwnerNode()
- {
-
- int newnode = dtm.getParent(node);
-
- return (newnode == DTM.NULL) ? null : dtm.getNode(newnode);
- }
-
- /**
- *
- *
- * @see org.w3c.dom.Node
- */
- @Override
- public final NodeList getChildNodes()
- {
-
- // Annoyingly, AxisIterators do not currently implement DTMIterator, so
- // we can't just wap DTMNodeList around an Axis.CHILD iterator.
- // Instead, we've created a special-case operating mode for that object.
- return new DTMChildIterNodeList(dtm,node);
-
- // throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
-
- /**
- *
- *
- * @see org.w3c.dom.Node
- */
- @Override
- public final Node getFirstChild()
- {
-
- int newnode = dtm.getFirstChild(node);
-
- return (newnode == DTM.NULL) ? null : dtm.getNode(newnode);
- }
-
- /**
- *
- *
- * @see org.w3c.dom.Node
- */
- @Override
- public final Node getLastChild()
- {
-
- int newnode = dtm.getLastChild(node);
-
- return (newnode == DTM.NULL) ? null : dtm.getNode(newnode);
- }
-
- /**
- *
- *
- * @see org.w3c.dom.Node
- */
- @Override
- public final Node getPreviousSibling()
- {
-
- int newnode = dtm.getPreviousSibling(node);
-
- return (newnode == DTM.NULL) ? null : dtm.getNode(newnode);
- }
-
- /**
- *
- *
- * @see org.w3c.dom.Node
- */
- @Override
- public final Node getNextSibling()
- {
-
- // Attr's Next is defined at DTM level, but not at DOM level.
- if (dtm.getNodeType(node) == Node.ATTRIBUTE_NODE)
- return null;
-
- int newnode = dtm.getNextSibling(node);
-
- return (newnode == DTM.NULL) ? null : dtm.getNode(newnode);
- }
-
- // DTMNamedNodeMap m_attrs;
-
- /**
- *
- *
- * @see org.w3c.dom.Node
- */
- @Override
- public final NamedNodeMap getAttributes()
- {
-
- return new DTMNamedNodeMap(dtm, node);
- }
-
- /**
- * Method hasAttribute
- *
- *
- * @param name
- *
- */
- @Override
- public boolean hasAttribute(String name)
- {
- return DTM.NULL != dtm.getAttributeNode(node,null,name);
- }
-
- /**
- * Method hasAttributeNS
- *
- *
- * @param namespaceURI
- * @param localName
- *
- *
- */
- @Override
- public boolean hasAttributeNS(String namespaceURI, String localName)
- {
- return DTM.NULL != dtm.getAttributeNode(node,namespaceURI,localName);
- }
-
- /**
- *
- *
- * @see org.w3c.dom.Node
- */
- @Override
- public final Document getOwnerDocument()
- {
- // Note that this uses the DOM-compatable version of the call
- return (Document)(dtm.getNode(dtm.getOwnerDocument(node)));
- }
-
- /**
- *
- * @param newChild
- * @param refChild
- *
- *
- *
- * @throws DOMException
- * @see org.w3c.dom.Node -- DTMNodeProxy is read-only
- */
- @Override
- public final Node insertBefore(Node newChild, Node refChild)
- throws DOMException
- {
- throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- /**
- *
- * @param newChild
- * @param oldChild
- *
- *
- *
- * @throws DOMException
- * @see org.w3c.dom.Node -- DTMNodeProxy is read-only
- */
- @Override
- public final Node replaceChild(Node newChild, Node oldChild)
- throws DOMException
- {
- throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- /**
- *
- * @param oldChild
- *
- *
- *
- * @throws DOMException
- * @see org.w3c.dom.Node -- DTMNodeProxy is read-only
- */
- @Override
- public final Node removeChild(Node oldChild) throws DOMException
- {
- throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- /**
- *
- * @param newChild
- *
- *
- *
- * @throws DOMException
- * @see org.w3c.dom.Node -- DTMNodeProxy is read-only
- */
- @Override
- public final Node appendChild(Node newChild) throws DOMException
- {
- throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- /**
- *
- *
- * @see org.w3c.dom.Node
- */
- @Override
- public final boolean hasChildNodes()
- {
- return (DTM.NULL != dtm.getFirstChild(node));
- }
-
- /**
- *
- * @param deep
- *
- *
- * @see org.w3c.dom.Node -- DTMNodeProxy is read-only
- */
- @Override
- public final Node cloneNode(boolean deep)
- {
- throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
-
- /**
- *
- *
- * @see org.w3c.dom.Document
- */
- @Override
- public final DocumentType getDoctype()
- {
- return null;
- }
-
- /**
- *
- *
- * @see org.w3c.dom.Document
- */
- @Override
- public final DOMImplementation getImplementation()
- {
- return implementation;
- }
-
- /** This is a bit of a problem in DTM, since a DTM may be a Document
- * Fragment and hence not have a clear-cut Document Element. We can
- * make it work in the well-formed cases but would that be confusing for others?
- *
- *
- * @see org.w3c.dom.Document
- */
- @Override
- public final Element getDocumentElement()
- {
- int dochandle=dtm.getDocument();
- int elementhandle=DTM.NULL;
- for(int kidhandle=dtm.getFirstChild(dochandle);
- kidhandle!=DTM.NULL;
- kidhandle=dtm.getNextSibling(kidhandle))
- {
- switch(dtm.getNodeType(kidhandle))
- {
- case Node.ELEMENT_NODE:
- if(elementhandle!=DTM.NULL)
- {
- elementhandle=DTM.NULL; // More than one; ill-formed.
- kidhandle=dtm.getLastChild(dochandle); // End loop
- }
- else
- elementhandle=kidhandle;
- break;
-
- // These are harmless; document is still wellformed
- case Node.COMMENT_NODE:
- case Node.PROCESSING_INSTRUCTION_NODE:
- case Node.DOCUMENT_TYPE_NODE:
- break;
-
- default:
- elementhandle=DTM.NULL; // ill-formed
- kidhandle=dtm.getLastChild(dochandle); // End loop
- break;
- }
- }
- if(elementhandle==DTM.NULL)
- throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
- else
- return (Element)(dtm.getNode(elementhandle));
- }
-
- /**
- *
- * @param tagName
- *
- *
- *
- * @throws DOMException
- * @see org.w3c.dom.Document
- */
- @Override
- public final Element createElement(String tagName) throws DOMException
- {
- throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
-
- /**
- *
- *
- * @see org.w3c.dom.Document
- */
- @Override
- public final DocumentFragment createDocumentFragment()
- {
- throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
-
- /**
- *
- * @param data
- *
- *
- * @see org.w3c.dom.Document
- */
- @Override
- public final Text createTextNode(String data)
- {
- throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
-
- /**
- *
- * @param data
- *
- *
- * @see org.w3c.dom.Document
- */
- @Override
- public final Comment createComment(String data)
- {
- throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
-
- /**
- *
- * @param data
- *
- *
- *
- * @throws DOMException
- * @see org.w3c.dom.Document
- */
- @Override
- public final CDATASection createCDATASection(String data)
- throws DOMException
- {
- throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
-
- /**
- *
- * @param target
- * @param data
- *
- *
- *
- * @throws DOMException
- * @see org.w3c.dom.Document
- */
- @Override
- public final ProcessingInstruction createProcessingInstruction(
- String target, String data) throws DOMException
- {
- throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
-
- /**
- *
- * @param name
- *
- *
- *
- * @throws DOMException
- * @see org.w3c.dom.Document
- */
- @Override
- public final Attr createAttribute(String name) throws DOMException
- {
- throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
-
- /**
- *
- * @param name
- *
- *
- *
- * @throws DOMException
- * @see org.w3c.dom.Document
- */
- @Override
- public final EntityReference createEntityReference(String name)
- throws DOMException
- {
- throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
- /**
- *
- * @param tagname
- *
- *
- * @see org.w3c.dom.Document
- */
- @Override
- public final NodeList getElementsByTagName(String tagname)
- {
- Vector listVector = new Vector();
- Node retNode = dtm.getNode(node);
- if (retNode != null)
- {
- boolean isTagNameWildCard = "*".equals(tagname);
- if (DTM.ELEMENT_NODE == retNode.getNodeType())
- {
- NodeList nodeList = retNode.getChildNodes();
- for (int i = 0; i < nodeList.getLength(); i++)
- {
- traverseChildren(listVector, nodeList.item(i), tagname,
- isTagNameWildCard);
- }
- } else if (DTM.DOCUMENT_NODE == retNode.getNodeType()) {
- traverseChildren(listVector, dtm.getNode(node), tagname,
- isTagNameWildCard);
- }
- }
- int size = listVector.size();
- NodeSet nodeSet = new NodeSet(size);
- for (int i = 0; i < size; i++)
- {
- nodeSet.addNode((Node) listVector.elementAt(i));
- }
- return (NodeList) nodeSet;
- }
-
- /**
- *
- * @param listVector
- * @param tempNode
- * @param tagname
- * @param isTagNameWildCard
- *
- *
- * Private method to be used for recursive iterations to obtain elements by tag name.
- */
- private final void traverseChildren
- (
- Vector listVector,
- Node tempNode,
- String tagname,
- boolean isTagNameWildCard) {
- if (tempNode == null)
- {
- return;
- }
- else
- {
- if (tempNode.getNodeType() == DTM.ELEMENT_NODE
- && (isTagNameWildCard || tempNode.getNodeName().equals(tagname)))
- {
- listVector.add(tempNode);
- }
- if(tempNode.hasChildNodes())
- {
- NodeList nodeList = tempNode.getChildNodes();
- for (int i = 0; i < nodeList.getLength(); i++)
- {
- traverseChildren(listVector, nodeList.item(i), tagname,
- isTagNameWildCard);
- }
- }
- }
- }
-
-
-
- /**
- *
- * @param importedNode
- * @param deep
- *
- *
- *
- * @throws DOMException
- * @see org.w3c.dom.Document as of DOM Level 2 -- DTMNodeProxy is read-only
- */
- @Override
- public final Node importNode(Node importedNode, boolean deep)
- throws DOMException
- {
- throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
- }
-
- /**
- *
- * @param namespaceURI
- * @param qualifiedName
- *
- *
- *
- * @throws DOMException
- * @see org.w3c.dom.Document as of DOM Level 2
- */
- @Override
- public final Element createElementNS(
- String namespaceURI, String qualifiedName) throws DOMException
- {
- throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
-
- /**
- *
- * @param namespaceURI
- * @param qualifiedName
- *
- *
- *
- * @throws DOMException
- * @see org.w3c.dom.Document as of DOM Level 2
- */
- @Override
- public final Attr createAttributeNS(
- String namespaceURI, String qualifiedName) throws DOMException
- {
- throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
-
- /**
- *
- * @param namespaceURI
- * @param localName
- *
- *
- * @see org.w3c.dom.Document as of DOM Level 2
- */
- @Override
- public final NodeList getElementsByTagNameNS(String namespaceURI,
- String localName)
- {
- Vector listVector = new Vector();
- Node retNode = dtm.getNode(node);
- if (retNode != null)
- {
- boolean isNamespaceURIWildCard = "*".equals(namespaceURI);
- boolean isLocalNameWildCard = "*".equals(localName);
- if (DTM.ELEMENT_NODE == retNode.getNodeType())
- {
- NodeList nodeList = retNode.getChildNodes();
- for(int i = 0; i < nodeList.getLength(); i++)
- {
- traverseChildren(listVector, nodeList.item(i), namespaceURI, localName, isNamespaceURIWildCard, isLocalNameWildCard);
- }
- }
- else if(DTM.DOCUMENT_NODE == retNode.getNodeType())
- {
- traverseChildren(listVector, dtm.getNode(node), namespaceURI, localName, isNamespaceURIWildCard, isLocalNameWildCard);
- }
- }
- int size = listVector.size();
- NodeSet nodeSet = new NodeSet(size);
- for (int i = 0; i < size; i++)
- {
- nodeSet.addNode((Node)listVector.elementAt(i));
- }
- return (NodeList) nodeSet;
- }
- /**
- *
- * @param listVector
- * @param tempNode
- * @param namespaceURI
- * @param localname
- * @param isNamespaceURIWildCard
- * @param isLocalNameWildCard
- *
- * Private method to be used for recursive iterations to obtain elements by tag name
- * and namespaceURI.
- */
- private final void traverseChildren
- (
- Vector listVector,
- Node tempNode,
- String namespaceURI,
- String localname,
- boolean isNamespaceURIWildCard,
- boolean isLocalNameWildCard)
- {
- if (tempNode == null)
- {
- return;
- }
- else
- {
- if (tempNode.getNodeType() == DTM.ELEMENT_NODE
- && (isLocalNameWildCard
- || tempNode.getLocalName().equals(localname)))
- {
- String nsURI = tempNode.getNamespaceURI();
- if ((namespaceURI == null && nsURI == null)
- || isNamespaceURIWildCard
- || (namespaceURI != null && namespaceURI.equals(nsURI)))
- {
- listVector.add(tempNode);
- }
- }
- if(tempNode.hasChildNodes())
- {
- NodeList nl = tempNode.getChildNodes();
- for(int i = 0; i < nl.getLength(); i++)
- {
- traverseChildren(listVector, nl.item(i), namespaceURI, localname,
- isNamespaceURIWildCard, isLocalNameWildCard);
- }
- }
- }
- }
- /**
- *
- * @param elementId
- *
- *
- * @see org.w3c.dom.Document as of DOM Level 2
- */
- @Override
- public final Element getElementById(String elementId)
- {
- return (Element) dtm.getNode(dtm.getElementById(elementId));
- }
-
- /**
- *
- * @param offset
- *
- *
- *
- * @throws DOMException
- * @see org.w3c.dom.Text
- */
- @Override
- public final Text splitText(int offset) throws DOMException
- {
- throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
-
- /**
- *
- *
- *
- * @throws DOMException
- * @see org.w3c.dom.CharacterData
- */
- @Override
- public final String getData() throws DOMException
- {
- return dtm.getNodeValue(node);
- }
-
- /**
- *
- * @param data
- *
- * @throws DOMException
- * @see org.w3c.dom.CharacterData
- */
- @Override
- public final void setData(String data) throws DOMException
- {
- throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
-
- /**
- *
- *
- * @see org.w3c.dom.CharacterData
- */
- @Override
- public final int getLength()
- {
- // %OPT% This should do something smarter?
- return dtm.getNodeValue(node).length();
- }
-
- /**
- *
- * @param offset
- * @param count
- *
- *
- *
- * @throws DOMException
- * @see org.w3c.dom.CharacterData
- */
- @Override
- public final String substringData(int offset, int count) throws DOMException
- {
- return getData().substring(offset,offset+count);
- }
-
- /**
- *
- * @param arg
- *
- * @throws DOMException
- * @see org.w3c.dom.CharacterData
- */
- @Override
- public final void appendData(String arg) throws DOMException
- {
- throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
-
- /**
- *
- * @param offset
- * @param arg
- *
- * @throws DOMException
- * @see org.w3c.dom.CharacterData
- */
- @Override
- public final void insertData(int offset, String arg) throws DOMException
- {
- throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
-
- /**
- *
- * @param offset
- * @param count
- *
- * @throws DOMException
- * @see org.w3c.dom.CharacterData
- */
- @Override
- public final void deleteData(int offset, int count) throws DOMException
- {
- throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
-
- /**
- *
- * @param offset
- * @param count
- * @param arg
- *
- * @throws DOMException
- * @see org.w3c.dom.CharacterData
- */
- @Override
- public final void replaceData(int offset, int count, String arg)
- throws DOMException
- {
- throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
-
- /**
- *
- *
- * @see org.w3c.dom.Element
- */
- @Override
- public final String getTagName()
- {
- return dtm.getNodeName(node);
- }
-
- /**
- *
- * @param name
- *
- *
- * @see org.w3c.dom.Element
- */
- @Override
- public final String getAttribute(String name)
- {
- DTMNamedNodeMap map = new DTMNamedNodeMap(dtm, node);
- Node n = map.getNamedItem(name);
- return (null == n) ? EMPTYSTRING : n.getNodeValue();
- }
-
- /**
- *
- * @param name
- * @param value
- *
- * @throws DOMException
- * @see org.w3c.dom.Element
- */
- @Override
- public final void setAttribute(String name, String value)
- throws DOMException
- {
- throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
-
- /**
- *
- * @param name
- *
- * @throws DOMException
- * @see org.w3c.dom.Element
- */
- @Override
- public final void removeAttribute(String name) throws DOMException
- {
- throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
-
- /**
- *
- * @param name
- *
- *
- * @see org.w3c.dom.Element
- */
- @Override
- public final Attr getAttributeNode(String name)
- {
- DTMNamedNodeMap map = new DTMNamedNodeMap(dtm, node);
- return (Attr)map.getNamedItem(name);
- }
-
- /**
- *
- * @param newAttr
- *
- *
- *
- * @throws DOMException
- * @see org.w3c.dom.Element
- */
- @Override
- public final Attr setAttributeNode(Attr newAttr) throws DOMException
- {
- throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
-
- /**
- *
- * @param oldAttr
- *
- *
- *
- * @throws DOMException
- * @see org.w3c.dom.Element
- */
- @Override
- public final Attr removeAttributeNode(Attr oldAttr) throws DOMException
- {
- throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
-
- /**
- * Introduced in DOM Level 2.
- *
- *
- */
- @Override
- public boolean hasAttributes()
- {
- return DTM.NULL != dtm.getFirstAttribute(node);
- }
-
- /** @see org.w3c.dom.Element */
- @Override
- public final void normalize()
- {
- throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
-
- /**
- *
- * @param namespaceURI
- * @param localName
- *
- *
- * @see org.w3c.dom.Element
- */
- @Override
- public final String getAttributeNS(String namespaceURI, String localName)
- {
- Node retNode = null;
- int n = dtm.getAttributeNode(node,namespaceURI,localName);
- if(n != DTM.NULL)
- retNode = dtm.getNode(n);
- return (null == retNode) ? EMPTYSTRING : retNode.getNodeValue();
- }
-
- /**
- *
- * @param namespaceURI
- * @param qualifiedName
- * @param value
- *
- * @throws DOMException
- * @see org.w3c.dom.Element
- */
- @Override
- public final void setAttributeNS(
- String namespaceURI, String qualifiedName, String value)
- throws DOMException
- {
- throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
-
- /**
- *
- * @param namespaceURI
- * @param localName
- *
- * @throws DOMException
- * @see org.w3c.dom.Element
- */
- @Override
- public final void removeAttributeNS(String namespaceURI, String localName)
- throws DOMException
- {
- throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
-
- /**
- *
- * @param namespaceURI
- * @param localName
- *
- *
- * @see org.w3c.dom.Element
- */
- @Override
- public final Attr getAttributeNodeNS(String namespaceURI, String localName)
- {
- Attr retAttr = null;
- int n = dtm.getAttributeNode(node,namespaceURI,localName);
- if(n != DTM.NULL)
- retAttr = (Attr) dtm.getNode(n);
- return retAttr;
-
- }
-
- /**
- *
- * @param newAttr
- *
- *
- *
- * @throws DOMException
- * @see org.w3c.dom.Element
- */
- @Override
- public final Attr setAttributeNodeNS(Attr newAttr) throws DOMException
- {
- throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
-
- /**
- *
- *
- * @see org.w3c.dom.Attr
- */
- @Override
- public final String getName()
- {
- return dtm.getNodeName(node);
- }
-
- /**
- *
- *
- * @see org.w3c.dom.Attr
- */
- @Override
- public final boolean getSpecified()
- {
- // We really don't know which attributes might have come from the
- // source document versus from the DTD. Treat them all as having
- // been provided by the user.
- // %REVIEW% if/when we become aware of DTDs/schemae.
- return true;
- }
-
- /**
- *
- *
- * @see org.w3c.dom.Attr
- */
- @Override
- public final String getValue()
- {
- return dtm.getNodeValue(node);
- }
-
- /**
- *
- * @param value
- * @see org.w3c.dom.Attr
- */
- @Override
- public final void setValue(String value)
- {
- throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
-
- /**
- * Get the owner element of an attribute.
- *
- *
- * @see org.w3c.dom.Attr as of DOM Level 2
- */
- @Override
- public final Element getOwnerElement()
- {
- if (getNodeType() != Node.ATTRIBUTE_NODE)
- return null;
- // In XPath and DTM data models, unlike DOM, an Attr's parent is its
- // owner element.
- int newnode = dtm.getParent(node);
- return (newnode == DTM.NULL) ? null : (Element)(dtm.getNode(newnode));
- }
-
- /**
- * NEEDSDOC Method adoptNode
- *
- *
- * NEEDSDOC @param source
- *
- * NEEDSDOC (adoptNode) @return
- *
- * @throws DOMException
- */
- @Override
- public Node adoptNode(Node source) throws DOMException
- {
- throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
-
- /**
- * <p>EXPERIMENTAL! Based on the <a
- * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
- * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
- * <p>
- * An attribute specifying, as part of the XML declaration, the encoding
- * of this document. This is <code>null</code> when unspecified.
- * @since DOM Level 3
- *
- * NEEDSDOC ($objectName$) @return
- */
- @Override
- public String getInputEncoding()
- {
- throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
-
- /**
- * <p>EXPERIMENTAL! Based on the <a
- * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
- * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
- * <p>
- * An attribute specifying, as part of the XML declaration, the encoding
- * of this document. This is <code>null</code> when unspecified.
- * @since DOM Level 3
- *
- * NEEDSDOC @param encoding
- */
- public void setEncoding(String encoding)
- {
- throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
-
- /**
- * <p>EXPERIMENTAL! Based on the <a
- * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
- * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
- * <p>
- * An attribute specifying, as part of the XML declaration, whether this
- * document is standalone.
- * @since DOM Level 3
- *
- * NEEDSDOC ($objectName$) @return
- */
- public boolean getStandalone()
- {
- throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
-
- /**
- * <p>EXPERIMENTAL! Based on the <a
- * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
- * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
- * <p>
- * An attribute specifying, as part of the XML declaration, whether this
- * document is standalone.
- * @since DOM Level 3
- *
- * NEEDSDOC @param standalone
- */
- public void setStandalone(boolean standalone)
- {
- throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
-
- /**
- * <p>EXPERIMENTAL! Based on the <a
- * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
- * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
- * <p>
- * An attribute specifying whether errors checking is enforced or not.
- * When set to <code>false</code>, the implementation is free to not
- * test every possible error case normally defined on DOM operations,
- * and not raise any <code>DOMException</code>. In case of error, the
- * behavior is undefined. This attribute is <code>true</code> by
- * defaults.
- * @since DOM Level 3
- *
- * NEEDSDOC ($objectName$) @return
- */
- @Override
- public boolean getStrictErrorChecking()
- {
- throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
-
- /**
- * <p>EXPERIMENTAL! Based on the <a
- * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
- * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
- * <p>
- * An attribute specifying whether errors checking is enforced or not.
- * When set to <code>false</code>, the implementation is free to not
- * test every possible error case normally defined on DOM operations,
- * and not raise any <code>DOMException</code>. In case of error, the
- * behavior is undefined. This attribute is <code>true</code> by
- * defaults.
- * @since DOM Level 3
- *
- * NEEDSDOC @param strictErrorChecking
- */
- @Override
- public void setStrictErrorChecking(boolean strictErrorChecking)
- {
- throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
-
- /**
- * <p>EXPERIMENTAL! Based on the <a
- * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
- * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
- * <p>
- * An attribute specifying, as part of the XML declaration, the version
- * number of this document. This is <code>null</code> when unspecified.
- * @since DOM Level 3
- *
- * NEEDSDOC ($objectName$) @return
- */
- public String getVersion()
- {
- throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
-
- /**
- * <p>EXPERIMENTAL! Based on the <a
- * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
- * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
- * <p>
- * An attribute specifying, as part of the XML declaration, the version
- * number of this document. This is <code>null</code> when unspecified.
- * @since DOM Level 3
- *
- * NEEDSDOC @param version
- */
- public void setVersion(String version)
- {
- throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
-
-
- /** Inner class to support getDOMImplementation.
- */
- static class DTMNodeProxyImplementation implements DOMImplementation
- {
- @Override
- public DocumentType createDocumentType(String qualifiedName,String publicId, String systemId)
- {
- throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
- @Override
- public Document createDocument(String namespaceURI,String qualfiedName,DocumentType doctype)
- {
- // Could create a DTM... but why, when it'd have to be permanantly empty?
- throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
- }
- /** Ask whether we support a given DOM feature.
- *
- * In fact, we do not _fully_ support any DOM feature -- we're a
- * read-only subset -- so arguably we should always return false.
- * On the other hand, it may be more practically useful to return
- * true and simply treat the whole DOM as read-only, failing on the
- * methods we can't support. I'm not sure which would be more useful
- * to the caller.
- */
- @Override
- public boolean hasFeature(String feature,String version)
- {
- if( ("CORE".equals(feature.toUpperCase()) || "XML".equals(feature.toUpperCase()))
- &&
- ("1.0".equals(version) || "2.0".equals(version)))
- return true;
- return false;
- }
-
- /**
- * This method returns a specialized object which implements the
- * specialized APIs of the specified feature and version. The
- * specialized object may also be obtained by using binding-specific
- * casting methods but is not necessarily expected to, as discussed in Mixed DOM implementations
-.
- * @param feature The name of the feature requested (case-insensitive).
- * @param version This is the version number of the feature to test. If
- * the version is <code>null</code> or the empty string, supporting
- * any version of the feature will cause the method to return an
- * object that supports at least one version of the feature.
- * @return Returns an object which implements the specialized APIs of
- * the specified feature and version, if any, or <code>null</code> if
- * there is no object which implements interfaces associated with that
- * feature. If the <code>DOMObject</code> returned by this method
- * implements the <code>Node</code> interface, it must delegate to the
- * primary core <code>Node</code> and not return results inconsistent
- * with the primary core <code>Node</code> such as attributes,
- * childNodes, etc.
- * @since DOM Level 3
- */
- @Override
- public Object getFeature(String feature, String version) {
- // we don't have any alternate node, either this node does the job
- // or we don't have anything that does
- //return hasFeature(feature, version) ? this : null;
- return null; //PENDING
- }
-
- }
-
-
-//RAMESH : Pending proper implementation of DOM Level 3
-
- @Override
- public Object setUserData(String key,
- Object data,
- UserDataHandler handler) {
- return getOwnerDocument().setUserData( key, data, handler);
- }
-
- /**
- * Retrieves the object associated to a key on a this node. The object
- * must first have been set to this node by calling
- * <code>setUserData</code> with the same key.
- * @param key The key the object is associated to.
- * @return Returns the <code>DOMObject</code> associated to the given key
- * on this node, or <code>null</code> if there was none.
- * @since DOM Level 3
- */
- @Override
- public Object getUserData(String key) {
- return getOwnerDocument().getUserData( key);
- }
-
- /**
- * This method returns a specialized object which implements the
- * specialized APIs of the specified feature and version. The
- * specialized object may also be obtained by using binding-specific
- * casting methods but is not necessarily expected to, as discussed in Mixed DOM implementations.
- * @param feature The name of the feature requested (case-insensitive).
- * @param version This is the version number of the feature to test. If
- * the version is <code>null</code> or the empty string, supporting
- * any version of the feature will cause the method to return an
- * object that supports at least one version of the feature.
- * @return Returns an object which implements the specialized APIs of
- * the specified feature and version, if any, or <code>null</code> if
- * there is no object which implements interfaces associated with that
- * feature. If the <code>DOMObject</code> returned by this method
- * implements the <code>Node</code> interface, it must delegate to the
- * primary core <code>Node</code> and not return results inconsistent
- * with the primary core <code>Node</code> such as attributes,
- * childNodes, etc.
- * @since DOM Level 3
- */
- @Override
- public Object getFeature(String feature, String version) {
- // we don't have any alternate node, either this node does the job
- // or we don't have anything that does
- return isSupported(feature, version) ? this : null;
- }
-
- /**
- * Tests whether two nodes are equal.
- * <br>This method tests for equality of nodes, not sameness (i.e.,
- * whether the two nodes are references to the same object) which can be
- * tested with <code>Node.isSameNode</code>. All nodes that are the same
- * will also be equal, though the reverse may not be true.
- * <br>Two nodes are equal if and only if the following conditions are
- * satisfied: The two nodes are of the same type.The following string
- * attributes are equal: <code>nodeName</code>, <code>localName</code>,
- * <code>namespaceURI</code>, <code>prefix</code>, <code>nodeValue</code>
- * , <code>baseURI</code>. This is: they are both <code>null</code>, or
- * they have the same length and are character for character identical.
- * The <code>attributes</code> <code>NamedNodeMaps</code> are equal.
- * This is: they are both <code>null</code>, or they have the same
- * length and for each node that exists in one map there is a node that
- * exists in the other map and is equal, although not necessarily at the
- * same index.The <code>childNodes</code> <code>NodeLists</code> are
- * equal. This is: they are both <code>null</code>, or they have the
- * same length and contain equal nodes at the same index. This is true
- * for <code>Attr</code> nodes as for any other type of node. Note that
- * normalization can affect equality; to avoid this, nodes should be
- * normalized before being compared.
- * <br>For two <code>DocumentType</code> nodes to be equal, the following
- * conditions must also be satisfied: The following string attributes
- * are equal: <code>publicId</code>, <code>systemId</code>,
- * <code>internalSubset</code>.The <code>entities</code>
- * <code>NamedNodeMaps</code> are equal.The <code>notations</code>
- * <code>NamedNodeMaps</code> are equal.
- * <br>On the other hand, the following do not affect equality: the
- * <code>ownerDocument</code> attribute, the <code>specified</code>
- * attribute for <code>Attr</code> nodes, the
- * <code>isWhitespaceInElementContent</code> attribute for
- * <code>Text</code> nodes, as well as any user data or event listeners
- * registered on the nodes.
- * @param arg The node to compare equality with.
- * @param deep If <code>true</code>, recursively compare the subtrees; if
- * <code>false</code>, compare only the nodes themselves (and its
- * attributes, if it is an <code>Element</code>).
- * @return If the nodes, and possibly subtrees are equal,
- * <code>true</code> otherwise <code>false</code>.
- * @since DOM Level 3
- */
- @Override
- public boolean isEqualNode(Node arg) {
- if (arg == this) {
- return true;
- }
- if (arg.getNodeType() != getNodeType()) {
- return false;
- }
- // in theory nodeName can't be null but better be careful
- // who knows what other implementations may be doing?...
- if (getNodeName() == null) {
- if (arg.getNodeName() != null) {
- return false;
- }
- }
- else if (!getNodeName().equals(arg.getNodeName())) {
- return false;
- }
-
- if (getLocalName() == null) {
- if (arg.getLocalName() != null) {
- return false;
- }
- }
- else if (!getLocalName().equals(arg.getLocalName())) {
- return false;
- }
-
- if (getNamespaceURI() == null) {
- if (arg.getNamespaceURI() != null) {
- return false;
- }
- }
- else if (!getNamespaceURI().equals(arg.getNamespaceURI())) {
- return false;
- }
-
- if (getPrefix() == null) {
- if (arg.getPrefix() != null) {
- return false;
- }
- }
- else if (!getPrefix().equals(arg.getPrefix())) {
- return false;
- }
-
- if (getNodeValue() == null) {
- if (arg.getNodeValue() != null) {
- return false;
- }
- }
- else if (!getNodeValue().equals(arg.getNodeValue())) {
- return false;
- }
- /*
- if (getBaseURI() == null) {
- if (((NodeImpl) arg).getBaseURI() != null) {
- return false;
- }
- }
- else if (!getBaseURI().equals(((NodeImpl) arg).getBaseURI())) {
- return false;
- }
-*/
-
- return true;
- }
-
- /**
- * DOM Level 3
- * Look up the namespace URI associated to the given prefix, starting from this node.
- * Use lookupNamespaceURI(null) to lookup the default namespace
- *
- * @param namespaceURI
- * @return th URI for the namespace
- * @since DOM Level 3
- */
- @Override
- public String lookupNamespaceURI(String specifiedPrefix) {
- short type = this.getNodeType();
- switch (type) {
- case Node.ELEMENT_NODE : {
-
- String namespace = this.getNamespaceURI();
- String prefix = this.getPrefix();
- if (namespace !=null) {
- // REVISIT: is it possible that prefix is empty string?
- if (specifiedPrefix== null && prefix==specifiedPrefix) {
- // looking for default namespace
- return namespace;
- } else if (prefix != null && prefix.equals(specifiedPrefix)) {
- // non default namespace
- return namespace;
- }
- }
- if (this.hasAttributes()) {
- NamedNodeMap map = this.getAttributes();
- int length = map.getLength();
- for (int i=0;i<length;i++) {
- Node attr = map.item(i);
- String attrPrefix = attr.getPrefix();
- String value = attr.getNodeValue();
- namespace = attr.getNamespaceURI();
- if (namespace !=null && namespace.equals("http://www.w3.org/2000/xmlns/")) {
- // at this point we are dealing with DOM Level 2 nodes only
- if (specifiedPrefix == null &&
- attr.getNodeName().equals("xmlns")) {
- // default namespace
- return value;
- } else if (attrPrefix !=null &&
- attrPrefix.equals("xmlns") &&
- attr.getLocalName().equals(specifiedPrefix)) {
- // non default namespace
- return value;
- }
- }
- }
- }
- /*
- NodeImpl ancestor = (NodeImpl)getElementAncestor(this);
- if (ancestor != null) {
- return ancestor.lookupNamespaceURI(specifiedPrefix);
- }
- */
-
- return null;
-
-
- }
-/*
- case Node.DOCUMENT_NODE : {
- return((NodeImpl)((Document)this).getDocumentElement()).lookupNamespaceURI(specifiedPrefix) ;
- }
-*/
- case Node.ENTITY_NODE :
- case Node.NOTATION_NODE:
- case Node.DOCUMENT_FRAGMENT_NODE:
- case Node.DOCUMENT_TYPE_NODE:
- // type is unknown
- return null;
- case Node.ATTRIBUTE_NODE:{
- if (this.getOwnerElement().getNodeType() == Node.ELEMENT_NODE) {
- return getOwnerElement().lookupNamespaceURI(specifiedPrefix);
-
- }
- return null;
- }
- default:{
- /*
- NodeImpl ancestor = (NodeImpl)getElementAncestor(this);
- if (ancestor != null) {
- return ancestor.lookupNamespaceURI(specifiedPrefix);
- }
- */
- return null;
- }
-
- }
- }
-
-
- /**
- * DOM Level 3
- * This method checks if the specified <code>namespaceURI</code> is the
- * default namespace or not.
- * @param namespaceURI The namespace URI to look for.
- * @return <code>true</code> if the specified <code>namespaceURI</code>
- * is the default namespace, <code>false</code> otherwise.
- * @since DOM Level 3
- */
- @Override
- public boolean isDefaultNamespace(String namespaceURI){
- /*
- // REVISIT: remove casts when DOM L3 becomes REC.
- short type = this.getNodeType();
- switch (type) {
- case Node.ELEMENT_NODE: {
- String namespace = this.getNamespaceURI();
- String prefix = this.getPrefix();
-
- // REVISIT: is it possible that prefix is empty string?
- if (prefix == null || prefix.length() == 0) {
- if (namespaceURI == null) {
- return (namespace == namespaceURI);
- }
- return namespaceURI.equals(namespace);
- }
- if (this.hasAttributes()) {
- ElementImpl elem = (ElementImpl)this;
- NodeImpl attr = (NodeImpl)elem.getAttributeNodeNS("http://www.w3.org/2000/xmlns/", "xmlns");
- if (attr != null) {
- String value = attr.getNodeValue();
- if (namespaceURI == null) {
- return (namespace == value);
- }
- return namespaceURI.equals(value);
- }
- }
-
- NodeImpl ancestor = (NodeImpl)getElementAncestor(this);
- if (ancestor != null) {
- return ancestor.isDefaultNamespace(namespaceURI);
- }
- return false;
- }
- case Node.DOCUMENT_NODE:{
- return((NodeImpl)((Document)this).getDocumentElement()).isDefaultNamespace(namespaceURI);
- }
-
- case Node.ENTITY_NODE :
- case Node.NOTATION_NODE:
- case Node.DOCUMENT_FRAGMENT_NODE:
- case Node.DOCUMENT_TYPE_NODE:
- // type is unknown
- return false;
- case Node.ATTRIBUTE_NODE:{
- if (this.ownerNode.getNodeType() == Node.ELEMENT_NODE) {
- return ownerNode.isDefaultNamespace(namespaceURI);
-
- }
- return false;
- }
- default:{
- NodeImpl ancestor = (NodeImpl)getElementAncestor(this);
- if (ancestor != null) {
- return ancestor.isDefaultNamespace(namespaceURI);
- }
- return false;
- }
-
- }
-*/
- return false;
-
-
- }
-
- /**
- *
- * DOM Level 3
- * Look up the prefix associated to the given namespace URI, starting from this node.
- *
- * @param namespaceURI
- * @return the prefix for the namespace
- */
- @Override
- public String lookupPrefix(String namespaceURI){
-
- // REVISIT: When Namespaces 1.1 comes out this may not be true
- // Prefix can't be bound to null namespace
- if (namespaceURI == null) {
- return null;
- }
-
- short type = this.getNodeType();
-
- switch (type) {
-/*
- case Node.ELEMENT_NODE: {
-
- String namespace = this.getNamespaceURI(); // to flip out children
- return lookupNamespacePrefix(namespaceURI, (ElementImpl)this);
- }
-
- case Node.DOCUMENT_NODE:{
- return((NodeImpl)((Document)this).getDocumentElement()).lookupPrefix(namespaceURI);
- }
-*/
- case Node.ENTITY_NODE :
- case Node.NOTATION_NODE:
- case Node.DOCUMENT_FRAGMENT_NODE:
- case Node.DOCUMENT_TYPE_NODE:
- // type is unknown
- return null;
- case Node.ATTRIBUTE_NODE:{
- if (this.getOwnerElement().getNodeType() == Node.ELEMENT_NODE) {
- return getOwnerElement().lookupPrefix(namespaceURI);
-
- }
- return null;
- }
- default:{
-/*
- NodeImpl ancestor = (NodeImpl)getElementAncestor(this);
- if (ancestor != null) {
- return ancestor.lookupPrefix(namespaceURI);
- }
-*/
- return null;
- }
- }
- }
-
- /**
- * Returns whether this node is the same node as the given one.
- * <br>This method provides a way to determine whether two
- * <code>Node</code> references returned by the implementation reference
- * the same object. When two <code>Node</code> references are references
- * to the same object, even if through a proxy, the references may be
- * used completely interchangably, such that all attributes have the
- * same values and calling the same DOM method on either reference
- * always has exactly the same effect.
- * @param other The node to test against.
- * @return Returns <code>true</code> if the nodes are the same,
- * <code>false</code> otherwise.
- * @since DOM Level 3
- */
- @Override
- public boolean isSameNode(Node other) {
- // we do not use any wrapper so the answer is obvious
- return this == other;
- }
-
- /**
- * This attribute returns the text content of this node and its
- * descendants. When it is defined to be null, setting it has no effect.
- * When set, any possible children this node may have are removed and
- * replaced by a single <code>Text</code> node containing the string
- * this attribute is set to. On getting, no serialization is performed,
- * the returned string does not contain any markup. No whitespace
- * normalization is performed, the returned string does not contain the
- * element content whitespaces . Similarly, on setting, no parsing is
- * performed either, the input string is taken as pure textual content.
- * <br>The string returned is made of the text content of this node
- * depending on its type, as defined below:
- * <table border='1'>
- * <tr>
- * <th>Node type</th>
- * <th>Content</th>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>
- * ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE,
- * DOCUMENT_FRAGMENT_NODE</td>
- * <td valign='top' rowspan='1' colspan='1'>concatenation of the <code>textContent</code>
- * attribute value of every child node, excluding COMMENT_NODE and
- * PROCESSING_INSTRUCTION_NODE nodes</td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>ATTRIBUTE_NODE, TEXT_NODE,
- * CDATA_SECTION_NODE, COMMENT_NODE, PROCESSING_INSTRUCTION_NODE</td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <code>nodeValue</code></td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>DOCUMENT_NODE, DOCUMENT_TYPE_NODE, NOTATION_NODE</td>
- * <td valign='top' rowspan='1' colspan='1'>
- * null</td>
- * </tr>
- * </table>
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
- * @exception DOMException
- * DOMSTRING_SIZE_ERR: Raised when it would return more characters than
- * fit in a <code>DOMString</code> variable on the implementation
- * platform.
- * @since DOM Level 3
- */
- @Override
- public void setTextContent(String textContent)
- throws DOMException {
- setNodeValue(textContent);
- }
- /**
- * This attribute returns the text content of this node and its
- * descendants. When it is defined to be null, setting it has no effect.
- * When set, any possible children this node may have are removed and
- * replaced by a single <code>Text</code> node containing the string
- * this attribute is set to. On getting, no serialization is performed,
- * the returned string does not contain any markup. No whitespace
- * normalization is performed, the returned string does not contain the
- * element content whitespaces . Similarly, on setting, no parsing is
- * performed either, the input string is taken as pure textual content.
- * <br>The string returned is made of the text content of this node
- * depending on its type, as defined below:
- * <table border='1'>
- * <tr>
- * <th>Node type</th>
- * <th>Content</th>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>
- * ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE,
- * DOCUMENT_FRAGMENT_NODE</td>
- * <td valign='top' rowspan='1' colspan='1'>concatenation of the <code>textContent</code>
- * attribute value of every child node, excluding COMMENT_NODE and
- * PROCESSING_INSTRUCTION_NODE nodes</td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>ATTRIBUTE_NODE, TEXT_NODE,
- * CDATA_SECTION_NODE, COMMENT_NODE, PROCESSING_INSTRUCTION_NODE</td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <code>nodeValue</code></td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>DOCUMENT_NODE, DOCUMENT_TYPE_NODE, NOTATION_NODE</td>
- * <td valign='top' rowspan='1' colspan='1'>
- * null</td>
- * </tr>
- * </table>
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
- * @exception DOMException
- * DOMSTRING_SIZE_ERR: Raised when it would return more characters than
- * fit in a <code>DOMString</code> variable on the implementation
- * platform.
- * @since DOM Level 3
- */
- @Override
- public String getTextContent() throws DOMException {
- return dtm.getStringValue(node).toString();
- }
-
- /**
- * Compares a node with this node with regard to their position in the
- * document.
- * @param other The node to compare against this node.
- * @return Returns how the given node is positioned relatively to this
- * node.
- * @since DOM Level 3
- */
- @Override
- public short compareDocumentPosition(Node other) throws DOMException {
- return 0;
- }
-
- /**
- * The absolute base URI of this node or <code>null</code> if undefined.
- * This value is computed according to . However, when the
- * <code>Document</code> supports the feature "HTML" , the base URI is
- * computed using first the value of the href attribute of the HTML BASE
- * element if any, and the value of the <code>documentURI</code>
- * attribute from the <code>Document</code> interface otherwise.
- * <br> When the node is an <code>Element</code>, a <code>Document</code>
- * or a a <code>ProcessingInstruction</code>, this attribute represents
- * the properties [base URI] defined in . When the node is a
- * <code>Notation</code>, an <code>Entity</code>, or an
- * <code>EntityReference</code>, this attribute represents the
- * properties [declaration base URI] in the . How will this be affected
- * by resolution of relative namespace URIs issue?It's not.Should this
- * only be on Document, Element, ProcessingInstruction, Entity, and
- * Notation nodes, according to the infoset? If not, what is it equal to
- * on other nodes? Null? An empty string? I think it should be the
- * parent's.No.Should this be read-only and computed or and actual
- * read-write attribute?Read-only and computed (F2F 19 Jun 2000 and
- * teleconference 30 May 2001).If the base HTML element is not yet
- * attached to a document, does the insert change the Document.baseURI?
- * Yes. (F2F 26 Sep 2001)
- * @since DOM Level 3
- */
- @Override
- public String getBaseURI() {
- return null;
- }
-
- /**
- * DOM Level 3
- * Renaming node
- */
- @Override
- public Node renameNode(Node n,
- String namespaceURI,
- String name)
- throws DOMException{
- return n;
- }
-
-
- /**
- * DOM Level 3
- * Normalize document.
- */
- @Override
- public void normalizeDocument(){
-
- }
- /**
- * The configuration used when <code>Document.normalizeDocument</code> is
- * invoked.
- * @since DOM Level 3
- */
- @Override
- public DOMConfiguration getDomConfig(){
- return null;
- }
-
-
- /** DOM Level 3 feature: documentURI */
- protected String fDocumentURI;
-
- /**
- * DOM Level 3
- */
- @Override
- public void setDocumentURI(String documentURI){
- fDocumentURI= documentURI;
- }
-
- /**
- * DOM Level 3
- * The location of the document or <code>null</code> if undefined.
- * <br>Beware that when the <code>Document</code> supports the feature
- * "HTML" , the href attribute of the HTML BASE element takes precedence
- * over this attribute.
- * @since DOM Level 3
- */
- @Override
- public String getDocumentURI(){
- return fDocumentURI;
- }
-
- /**DOM Level 3 feature: Document actualEncoding */
- protected String actualEncoding;
-
- /**
- * DOM Level 3
- * An attribute specifying the actual encoding of this document. This is
- * <code>null</code> otherwise.
- * <br> This attribute represents the property [character encoding scheme]
- * defined in .
- * @since DOM Level 3
- */
- public String getActualEncoding() {
- return actualEncoding;
- }
-
- /**
- * DOM Level 3
- * An attribute specifying the actual encoding of this document. This is
- * <code>null</code> otherwise.
- * <br> This attribute represents the property [character encoding scheme]
- * defined in .
- * @since DOM Level 3
- */
- public void setActualEncoding(String value) {
- actualEncoding = value;
- }
-
- /**
- * DOM Level 3
- */
- @Override
- public Text replaceWholeText(String content)
- throws DOMException{
-/*
-
- if (needsSyncData()) {
- synchronizeData();
- }
-
- // make sure we can make the replacement
- if (!canModify(nextSibling)) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null));
- }
-
- Node parent = this.getParentNode();
- if (content == null || content.length() == 0) {
- // remove current node
- if (parent !=null) { // check if node in the tree
- parent.removeChild(this);
- return null;
- }
- }
- Text currentNode = null;
- if (isReadOnly()){
- Text newNode = this.ownerDocument().createTextNode(content);
- if (parent !=null) { // check if node in the tree
- parent.insertBefore(newNode, this);
- parent.removeChild(this);
- currentNode = newNode;
- } else {
- return newNode;
- }
- } else {
- this.setData(content);
- currentNode = this;
- }
- Node sibling = currentNode.getNextSibling();
- while ( sibling !=null) {
- parent.removeChild(sibling);
- sibling = currentNode.getNextSibling();
- }
-
- return currentNode;
-*/
- return null; //Pending
- }
-
- /**
- * DOM Level 3
- * Returns all text of <code>Text</code> nodes logically-adjacent text
- * nodes to this node, concatenated in document order.
- * @since DOM Level 3
- */
- @Override
- public String getWholeText(){
-
-/*
- if (needsSyncData()) {
- synchronizeData();
- }
- if (nextSibling == null) {
- return data;
- }
- StringBuffer buffer = new StringBuffer();
- if (data != null && data.length() != 0) {
- buffer.append(data);
- }
- getWholeText(nextSibling, buffer);
- return buffer.toString();
-*/
- return null; // PENDING
-
- }
-
- /**
- * DOM Level 3
- * Returns whether this text node contains whitespace in element content,
- * often abusively called "ignorable whitespace".
- */
- @Override
- public boolean isElementContentWhitespace(){
- return false;
- }
-
- /**
- * NON-DOM: set the type of this attribute to be ID type.
- *
- * @param id
- */
- public void setIdAttribute(boolean id){
- //PENDING
- }
-
- /**
- * DOM Level 3: register the given attribute node as an ID attribute
- */
- @Override
- public void setIdAttribute(String name, boolean makeId) {
- //PENDING
- }
-
-
- /**
- * DOM Level 3: register the given attribute node as an ID attribute
- */
- @Override
- public void setIdAttributeNode(Attr at, boolean makeId) {
- //PENDING
- }
-
- /**
- * DOM Level 3: register the given attribute node as an ID attribute
- */
- @Override
- public void setIdAttributeNS(String namespaceURI, String localName,
- boolean makeId) {
- //PENDING
- }
- /**
- * Method getSchemaTypeInfo.
- * @return TypeInfo
- */
- @Override
- public TypeInfo getSchemaTypeInfo(){
- return null; //PENDING
- }
-
- @Override
- public boolean isId() {
- return false; //PENDING
- }
-
-
- private String xmlEncoding;
- @Override
- public String getXmlEncoding( ) {
- return xmlEncoding;
- }
- public void setXmlEncoding( String xmlEncoding ) {
- this.xmlEncoding = xmlEncoding;
- }
-
- private boolean xmlStandalone;
- @Override
- public boolean getXmlStandalone() {
- return xmlStandalone;
- }
-
- @Override
- public void setXmlStandalone(boolean xmlStandalone) throws DOMException {
- this.xmlStandalone = xmlStandalone;
- }
-
- private String xmlVersion;
- @Override
- public String getXmlVersion() {
- return xmlVersion;
- }
-
- @Override
- public void setXmlVersion(String xmlVersion) throws DOMException {
- this.xmlVersion = xmlVersion;
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/dtm/ref/DTMSafeStringPool.java b/src/com/sun/org/apache/xml/internal/dtm/ref/DTMSafeStringPool.java
deleted file mode 100644
index e22402d..0000000
--- a/src/com/sun/org/apache/xml/internal/dtm/ref/DTMSafeStringPool.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DTMSafeStringPool.java,v 1.2.4.1 2005/09/15 08:15:04 suresh_emailid Exp $
- */
-
-package com.sun.org.apache.xml.internal.dtm.ref;
-
-
-/** <p>Like DTMStringPool, but threadsafe. It's been proposed that DTMs
- * share their string pool(s); that raises threadsafety issues which
- * this addresses. Of course performance is inferior to that of the
- * bare-bones version.</p>
- *
- * <p>Status: Passed basic test in main().</p>
- * */
-public class DTMSafeStringPool
-extends DTMStringPool
-{
- public synchronized void removeAllElements()
- {
- super.removeAllElements();
- }
-
- /** @return string whose value is uniquely identified by this integer index.
- * @throws java.lang.ArrayIndexOutOfBoundsException
- * if index doesn't map to a string.
- * */
- public synchronized String indexToString(int i)
- throws java.lang.ArrayIndexOutOfBoundsException
- {
- return super.indexToString(i);
- }
-
- /** @return integer index uniquely identifying the value of this string. */
- public synchronized int stringToIndex(String s)
- {
- return super.stringToIndex(s);
- }
-
- /** Command-line unit test driver. This test relies on the fact that
- * this version of the pool assigns indices consecutively, starting
- * from zero, as new unique strings are encountered.
- */
- public static void _main(String[] args)
- {
- String[] word={
- "Zero","One","Two","Three","Four","Five",
- "Six","Seven","Eight","Nine","Ten",
- "Eleven","Twelve","Thirteen","Fourteen","Fifteen",
- "Sixteen","Seventeen","Eighteen","Nineteen","Twenty",
- "Twenty-One","Twenty-Two","Twenty-Three","Twenty-Four",
- "Twenty-Five","Twenty-Six","Twenty-Seven","Twenty-Eight",
- "Twenty-Nine","Thirty","Thirty-One","Thirty-Two",
- "Thirty-Three","Thirty-Four","Thirty-Five","Thirty-Six",
- "Thirty-Seven","Thirty-Eight","Thirty-Nine"};
-
- DTMStringPool pool=new DTMSafeStringPool();
-
- System.out.println("If no complaints are printed below, we passed initial test.");
-
- for(int pass=0;pass<=1;++pass)
- {
- int i;
-
- for(i=0;i<word.length;++i)
- {
- int j=pool.stringToIndex(word[i]);
- if(j!=i)
- System.out.println("\tMismatch populating pool: assigned "+
- j+" for create "+i);
- }
-
- for(i=0;i<word.length;++i)
- {
- int j=pool.stringToIndex(word[i]);
- if(j!=i)
- System.out.println("\tMismatch in stringToIndex: returned "+
- j+" for lookup "+i);
- }
-
- for(i=0;i<word.length;++i)
- {
- String w=pool.indexToString(i);
- if(!word[i].equals(w))
- System.out.println("\tMismatch in indexToString: returned"+
- w+" for lookup "+i);
- }
-
- pool.removeAllElements();
-
- System.out.println("\nPass "+pass+" complete\n");
- } // end pass loop
- }
-} // DTMSafeStringPool
diff --git a/src/com/sun/org/apache/xml/internal/dtm/ref/DTMStringPool.java b/src/com/sun/org/apache/xml/internal/dtm/ref/DTMStringPool.java
deleted file mode 100644
index d49b62a..0000000
--- a/src/com/sun/org/apache/xml/internal/dtm/ref/DTMStringPool.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DTMStringPool.java,v 1.2.4.1 2005/09/15 08:15:05 suresh_emailid Exp $
- */
-
-package com.sun.org.apache.xml.internal.dtm.ref;
-
-import java.util.Vector;
-
-import com.sun.org.apache.xml.internal.utils.IntVector;
-
-/** <p>DTMStringPool is an "interning" mechanism for strings. It will
- * create a stable 1:1 mapping between a set of string values and a set of
- * integer index values, so the integers can be used to reliably and
- * uniquely identify (and when necessary retrieve) the strings.</p>
- *
- * <p>Design Priorities:
- * <ul>
- * <li>String-to-index lookup speed is critical.</li>
- * <li>Index-to-String lookup speed is slightly less so.</li>
- * <li>Threadsafety is not guaranteed at this level.
- * Enforce that in the application if needed.</li>
- * <li>Storage efficiency is an issue but not a huge one.
- * It is expected that string pools won't exceed about 2000 entries.</li>
- * </ul>
- * </p>
- *
- * <p>Implementation detail: A standard Hashtable is relatively
- * inefficient when looking up primitive int values, especially when
- * we're already maintaining an int-to-string vector. So I'm
- * maintaining a simple hash chain within this class.</p>
- *
- * <p>NOTE: There is nothing in the code that has a real dependency upon
- * String. It would work with any object type that implements reliable
- * .hashCode() and .equals() operations. The API enforces Strings because
- * it's safer that way, but this could trivially be turned into a general
- * ObjectPool if one was needed.</p>
- *
- * <p>Status: Passed basic test in main().</p>
- * */
-public class DTMStringPool
-{
- Vector m_intToString;
- static final int HASHPRIME=101;
- int[] m_hashStart=new int[HASHPRIME];
- IntVector m_hashChain;
- public static final int NULL=-1;
-
- /**
- * Create a DTMStringPool using the given chain size
- *
- * @param chainSize The size of the hash chain vector
- */
- public DTMStringPool(int chainSize)
- {
- m_intToString=new Vector();
- m_hashChain=new IntVector(chainSize);
- removeAllElements();
-
- // -sb Add this to force empty strings to be index 0.
- stringToIndex("");
- }
-
- public DTMStringPool()
- {
- this(512);
- }
-
- public void removeAllElements()
- {
- m_intToString.removeAllElements();
- for(int i=0;i<HASHPRIME;++i)
- m_hashStart[i]=NULL;
- m_hashChain.removeAllElements();
- }
-
- /** @return string whose value is uniquely identified by this integer index.
- * @throws java.lang.ArrayIndexOutOfBoundsException
- * if index doesn't map to a string.
- * */
- public String indexToString(int i)
- throws java.lang.ArrayIndexOutOfBoundsException
- {
- if(i==NULL) return null;
- return (String) m_intToString.elementAt(i);
- }
-
- /** @return integer index uniquely identifying the value of this string. */
- public int stringToIndex(String s)
- {
- if(s==null) return NULL;
-
- int hashslot=s.hashCode()%HASHPRIME;
- if(hashslot<0) hashslot=-hashslot;
-
- // Is it one we already know?
- int hashlast=m_hashStart[hashslot];
- int hashcandidate=hashlast;
- while(hashcandidate!=NULL)
- {
- if(m_intToString.elementAt(hashcandidate).equals(s))
- return hashcandidate;
-
- hashlast=hashcandidate;
- hashcandidate=m_hashChain.elementAt(hashcandidate);
- }
-
- // New value. Add to tables.
- int newIndex=m_intToString.size();
- m_intToString.addElement(s);
-
- m_hashChain.addElement(NULL); // Initialize to no-following-same-hash
- if(hashlast==NULL) // First for this hash
- m_hashStart[hashslot]=newIndex;
- else // Link from previous with same hash
- m_hashChain.setElementAt(newIndex,hashlast);
-
- return newIndex;
- }
-
- /** Command-line unit test driver. This test relies on the fact that
- * this version of the pool assigns indices consecutively, starting
- * from zero, as new unique strings are encountered.
- */
- public static void _main(String[] args)
- {
- String[] word={
- "Zero","One","Two","Three","Four","Five",
- "Six","Seven","Eight","Nine","Ten",
- "Eleven","Twelve","Thirteen","Fourteen","Fifteen",
- "Sixteen","Seventeen","Eighteen","Nineteen","Twenty",
- "Twenty-One","Twenty-Two","Twenty-Three","Twenty-Four",
- "Twenty-Five","Twenty-Six","Twenty-Seven","Twenty-Eight",
- "Twenty-Nine","Thirty","Thirty-One","Thirty-Two",
- "Thirty-Three","Thirty-Four","Thirty-Five","Thirty-Six",
- "Thirty-Seven","Thirty-Eight","Thirty-Nine"};
-
- DTMStringPool pool=new DTMStringPool();
-
- System.out.println("If no complaints are printed below, we passed initial test.");
-
- for(int pass=0;pass<=1;++pass)
- {
- int i;
-
- for(i=0;i<word.length;++i)
- {
- int j=pool.stringToIndex(word[i]);
- if(j!=i)
- System.out.println("\tMismatch populating pool: assigned "+
- j+" for create "+i);
- }
-
- for(i=0;i<word.length;++i)
- {
- int j=pool.stringToIndex(word[i]);
- if(j!=i)
- System.out.println("\tMismatch in stringToIndex: returned "+
- j+" for lookup "+i);
- }
-
- for(i=0;i<word.length;++i)
- {
- String w=pool.indexToString(i);
- if(!word[i].equals(w))
- System.out.println("\tMismatch in indexToString: returned"+
- w+" for lookup "+i);
- }
-
- pool.removeAllElements();
-
- System.out.println("\nPass "+pass+" complete\n");
- } // end pass loop
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/dtm/ref/DTMTreeWalker.java b/src/com/sun/org/apache/xml/internal/dtm/ref/DTMTreeWalker.java
deleted file mode 100644
index 37c72d1..0000000
--- a/src/com/sun/org/apache/xml/internal/dtm/ref/DTMTreeWalker.java
+++ /dev/null
@@ -1,405 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DTMTreeWalker.java,v 1.2.4.1 2005/09/15 08:15:05 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.dtm.ref;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.utils.NodeConsumer;
-import com.sun.org.apache.xml.internal.utils.XMLString;
-
-import org.xml.sax.ContentHandler;
-import org.xml.sax.ext.LexicalHandler;
-
-/**
- * This class does a pre-order walk of the DTM tree, calling a ContentHandler
- * interface as it goes. As such, it's more like the Visitor design pattern
- * than like the DOM's TreeWalker.
- *
- * I think normally this class should not be needed, because
- * of DTM#dispatchToEvents.
- * @xsl.usage advanced
- */
-public class DTMTreeWalker
-{
-
- /** Local reference to a ContentHandler */
- private ContentHandler m_contentHandler = null;
-
- /** DomHelper for this TreeWalker */
- protected DTM m_dtm;
-
- /**
- * Set the DTM to be traversed.
- *
- * @param dtm The Document Table Model to be used.
- */
- public void setDTM(DTM dtm)
- {
- m_dtm = dtm;
- }
-
- /**
- * Get the ContentHandler used for the tree walk.
- *
- * @return the ContentHandler used for the tree walk
- */
- public ContentHandler getcontentHandler()
- {
- return m_contentHandler;
- }
-
- /**
- * Set the ContentHandler used for the tree walk.
- *
- * @param ch the ContentHandler to be the result of the tree walk.
- */
- public void setcontentHandler(ContentHandler ch)
- {
- m_contentHandler = ch;
- }
-
-
- /**
- * Constructor.
- */
- public DTMTreeWalker()
- {
- }
-
- /**
- * Constructor.
- * @param contentHandler The implemention of the
- * contentHandler operation (toXMLString, digest, ...)
- */
- public DTMTreeWalker(ContentHandler contentHandler, DTM dtm)
- {
- this.m_contentHandler = contentHandler;
- m_dtm = dtm;
- }
-
- /** Perform a non-recursive pre-order/post-order traversal,
- * operating as a Visitor. startNode (preorder) and endNode
- * (postorder) are invoked for each node as we traverse over them,
- * with the result that the node is written out to m_contentHandler.
- *
- * @param pos Node in the tree at which to start (and end) traversal --
- * in other words, the root of the subtree to traverse over.
- *
- * @throws TransformerException */
- public void traverse(int pos) throws org.xml.sax.SAXException
- {
- // %REVIEW% Why isn't this just traverse(pos,pos)?
-
- int top = pos; // Remember the root of this subtree
-
- while (DTM.NULL != pos)
- {
- startNode(pos);
- int nextNode = m_dtm.getFirstChild(pos);
- while (DTM.NULL == nextNode)
- {
- endNode(pos);
-
- if (top == pos)
- break;
-
- nextNode = m_dtm.getNextSibling(pos);
-
- if (DTM.NULL == nextNode)
- {
- pos = m_dtm.getParent(pos);
-
- if ((DTM.NULL == pos) || (top == pos))
- {
- // %REVIEW% This condition isn't tested in traverse(pos,top)
- // -- bug?
- if (DTM.NULL != pos)
- endNode(pos);
-
- nextNode = DTM.NULL;
-
- break;
- }
- }
- }
-
- pos = nextNode;
- }
- }
-
- /** Perform a non-recursive pre-order/post-order traversal,
- * operating as a Visitor. startNode (preorder) and endNode
- * (postorder) are invoked for each node as we traverse over them,
- * with the result that the node is written out to m_contentHandler.
- *
- * @param pos Node in the tree where to start traversal
- * @param top Node in the tree where to end traversal.
- * If top==DTM.NULL, run through end of document.
- *
- * @throws TransformerException
- */
- public void traverse(int pos, int top) throws org.xml.sax.SAXException
- {
- // %OPT% Can we simplify the loop conditionals by adding:
- // if(top==DTM.NULL) top=0
- // -- or by simply ignoring this case and relying on the fact that
- // pos will never equal DTM.NULL until we're ready to exit?
-
- while (DTM.NULL != pos)
- {
- startNode(pos);
- int nextNode = m_dtm.getFirstChild(pos);
- while (DTM.NULL == nextNode)
- {
- endNode(pos);
-
- if ((DTM.NULL != top) && top == pos)
- break;
-
- nextNode = m_dtm.getNextSibling(pos);
-
- if (DTM.NULL == nextNode)
- {
- pos = m_dtm.getParent(pos);
-
- if ((DTM.NULL == pos) || ((DTM.NULL != top) && (top == pos)))
- {
- nextNode = DTM.NULL;
-
- break;
- }
- }
- }
-
- pos = nextNode;
- }
- }
-
- /** Flag indicating whether following text to be processed is raw text */
- boolean nextIsRaw = false;
-
- /**
- * Optimized dispatch of characters.
- */
- private final void dispatachChars(int node)
- throws org.xml.sax.SAXException
- {
- m_dtm.dispatchCharactersEvents(node, m_contentHandler, false);
- }
-
- /**
- * Start processing given node
- *
- *
- * @param node Node to process
- *
- * @throws org.xml.sax.SAXException
- */
- protected void startNode(int node) throws org.xml.sax.SAXException
- {
-
- if (m_contentHandler instanceof NodeConsumer)
- {
- // %TBD%
-// ((NodeConsumer) m_contentHandler).setOriginatingNode(node);
- }
-
- switch (m_dtm.getNodeType(node))
- {
- case DTM.COMMENT_NODE :
- {
- XMLString data = m_dtm.getStringValue(node);
-
- if (m_contentHandler instanceof LexicalHandler)
- {
- LexicalHandler lh = ((LexicalHandler) this.m_contentHandler);
- data.dispatchAsComment(lh);
- }
- }
- break;
- case DTM.DOCUMENT_FRAGMENT_NODE :
-
- // ??;
- break;
- case DTM.DOCUMENT_NODE :
- this.m_contentHandler.startDocument();
- break;
- case DTM.ELEMENT_NODE :
- DTM dtm = m_dtm;
-
- for (int nsn = dtm.getFirstNamespaceNode(node, true); DTM.NULL != nsn;
- nsn = dtm.getNextNamespaceNode(node, nsn, true))
- {
- // String prefix = dtm.getPrefix(nsn);
- String prefix = dtm.getNodeNameX(nsn);
-
- this.m_contentHandler.startPrefixMapping(prefix, dtm.getNodeValue(nsn));
-
- }
-
- // System.out.println("m_dh.getNamespaceOfNode(node): "+m_dh.getNamespaceOfNode(node));
- // System.out.println("m_dh.getLocalNameOfNode(node): "+m_dh.getLocalNameOfNode(node));
- String ns = dtm.getNamespaceURI(node);
- if(null == ns)
- ns = "";
-
- // %OPT% !!
- org.xml.sax.helpers.AttributesImpl attrs =
- new org.xml.sax.helpers.AttributesImpl();
-
- for (int i = dtm.getFirstAttribute(node);
- i != DTM.NULL;
- i = dtm.getNextAttribute(i))
- {
- attrs.addAttribute(dtm.getNamespaceURI(i),
- dtm.getLocalName(i),
- dtm.getNodeName(i),
- "CDATA",
- dtm.getNodeValue(i));
- }
-
-
- this.m_contentHandler.startElement(ns,
- m_dtm.getLocalName(node),
- m_dtm.getNodeName(node),
- attrs);
- break;
- case DTM.PROCESSING_INSTRUCTION_NODE :
- {
- String name = m_dtm.getNodeName(node);
-
- // String data = pi.getData();
- if (name.equals("xslt-next-is-raw"))
- {
- nextIsRaw = true;
- }
- else
- {
- this.m_contentHandler.processingInstruction(name,
- m_dtm.getNodeValue(node));
- }
- }
- break;
- case DTM.CDATA_SECTION_NODE :
- {
- boolean isLexH = (m_contentHandler instanceof LexicalHandler);
- LexicalHandler lh = isLexH
- ? ((LexicalHandler) this.m_contentHandler) : null;
-
- if (isLexH)
- {
- lh.startCDATA();
- }
-
- dispatachChars(node);
-
- {
- if (isLexH)
- {
- lh.endCDATA();
- }
- }
- }
- break;
- case DTM.TEXT_NODE :
- {
- if (nextIsRaw)
- {
- nextIsRaw = false;
-
- m_contentHandler.processingInstruction(javax.xml.transform.Result.PI_DISABLE_OUTPUT_ESCAPING, "");
- dispatachChars(node);
- m_contentHandler.processingInstruction(javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING, "");
- }
- else
- {
- dispatachChars(node);
- }
- }
- break;
- case DTM.ENTITY_REFERENCE_NODE :
- {
- if (m_contentHandler instanceof LexicalHandler)
- {
- ((LexicalHandler) this.m_contentHandler).startEntity(
- m_dtm.getNodeName(node));
- }
- else
- {
-
- // warning("Can not output entity to a pure SAX ContentHandler");
- }
- }
- break;
- default :
- }
- }
-
- /**
- * End processing of given node
- *
- *
- * @param node Node we just finished processing
- *
- * @throws org.xml.sax.SAXException
- */
- protected void endNode(int node) throws org.xml.sax.SAXException
- {
-
- switch (m_dtm.getNodeType(node))
- {
- case DTM.DOCUMENT_NODE :
- this.m_contentHandler.endDocument();
- break;
- case DTM.ELEMENT_NODE :
- String ns = m_dtm.getNamespaceURI(node);
- if(null == ns)
- ns = "";
- this.m_contentHandler.endElement(ns,
- m_dtm.getLocalName(node),
- m_dtm.getNodeName(node));
-
- for (int nsn = m_dtm.getFirstNamespaceNode(node, true); DTM.NULL != nsn;
- nsn = m_dtm.getNextNamespaceNode(node, nsn, true))
- {
- // String prefix = m_dtm.getPrefix(nsn);
- String prefix = m_dtm.getNodeNameX(nsn);
-
- this.m_contentHandler.endPrefixMapping(prefix);
- }
- break;
- case DTM.CDATA_SECTION_NODE :
- break;
- case DTM.ENTITY_REFERENCE_NODE :
- {
- if (m_contentHandler instanceof LexicalHandler)
- {
- LexicalHandler lh = ((LexicalHandler) this.m_contentHandler);
-
- lh.endEntity(m_dtm.getNodeName(node));
- }
- }
- break;
- default :
- }
- }
-} //TreeWalker
diff --git a/src/com/sun/org/apache/xml/internal/dtm/ref/EmptyIterator.java b/src/com/sun/org/apache/xml/internal/dtm/ref/EmptyIterator.java
deleted file mode 100644
index 978ed92..0000000
--- a/src/com/sun/org/apache/xml/internal/dtm/ref/EmptyIterator.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: EmptyIterator.java,v 1.2.4.1 2005/09/15 08:15:05 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.dtm.ref;
-
-import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
-import com.sun.org.apache.xml.internal.dtm.DTM;
-
-
-/**
- * DTM Empty Axis Iterator. The class is immutable
- */
-public final class EmptyIterator implements DTMAxisIterator
-{
- private static final EmptyIterator INSTANCE = new EmptyIterator();
-
- public static DTMAxisIterator getInstance() {return INSTANCE;}
-
- private EmptyIterator(){}
-
- public final int next(){ return END; }
-
- public final DTMAxisIterator reset(){ return this; }
-
- public final int getLast(){ return 0; }
-
- public final int getPosition(){ return 1; }
-
- public final void setMark(){}
-
- public final void gotoMark(){}
-
- public final DTMAxisIterator setStartNode(int node){ return this; }
-
- public final int getStartNode(){ return END; }
-
- public final boolean isReverse(){return false;}
-
- public final DTMAxisIterator cloneIterator(){ return this; }
-
- public final void setRestartable(boolean isRestartable) {}
-
- public final int getNodeByPosition(int position){ return END; }
-}
diff --git a/src/com/sun/org/apache/xml/internal/dtm/ref/ExpandedNameTable.java b/src/com/sun/org/apache/xml/internal/dtm/ref/ExpandedNameTable.java
deleted file mode 100644
index 8d4c7a3..0000000
--- a/src/com/sun/org/apache/xml/internal/dtm/ref/ExpandedNameTable.java
+++ /dev/null
@@ -1,393 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ExpandedNameTable.java,v 1.2.4.1 2005/09/15 08:15:06 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.dtm.ref;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-
-/**
- * This is a default implementation of a table that manages mappings from
- * expanded names to expandedNameIDs.
- *
- * %OPT% The performance of the getExpandedTypeID() method is very important
- * to DTM building. To get the best performance out of this class, we implement
- * a simple hash algorithm directly into this class, instead of using the
- * inefficient java.util.Hashtable. The code for the get and put operations
- * are combined in getExpandedTypeID() method to share the same hash calculation
- * code. We only need to implement the rehash() interface which is used to
- * expand the hash table.
- */
-public class ExpandedNameTable
-{
-
- /** Array of extended types for this document */
- private ExtendedType[] m_extendedTypes;
-
- /** The initial size of the m_extendedTypes array */
- private static int m_initialSize = 128;
-
- /** Next available extended type */
- // %REVIEW% Since this is (should be) always equal
- // to the length of m_extendedTypes, do we need this?
- private int m_nextType;
-
- // These are all the types prerotated, for caller convenience.
- public static final int ELEMENT = ((int)DTM.ELEMENT_NODE) ;
- public static final int ATTRIBUTE = ((int)DTM.ATTRIBUTE_NODE) ;
- public static final int TEXT = ((int)DTM.TEXT_NODE) ;
- public static final int CDATA_SECTION = ((int)DTM.CDATA_SECTION_NODE) ;
- public static final int ENTITY_REFERENCE = ((int)DTM.ENTITY_REFERENCE_NODE) ;
- public static final int ENTITY = ((int)DTM.ENTITY_NODE) ;
- public static final int PROCESSING_INSTRUCTION = ((int)DTM.PROCESSING_INSTRUCTION_NODE) ;
- public static final int COMMENT = ((int)DTM.COMMENT_NODE) ;
- public static final int DOCUMENT = ((int)DTM.DOCUMENT_NODE) ;
- public static final int DOCUMENT_TYPE = ((int)DTM.DOCUMENT_TYPE_NODE) ;
- public static final int DOCUMENT_FRAGMENT =((int)DTM.DOCUMENT_FRAGMENT_NODE) ;
- public static final int NOTATION = ((int)DTM.NOTATION_NODE) ;
- public static final int NAMESPACE = ((int)DTM.NAMESPACE_NODE) ;
-
- /** Workspace for lookup. NOT THREAD SAFE!
- * */
- ExtendedType hashET = new ExtendedType(-1, "", "");
-
- /** The array to store the default extended types. */
- private static ExtendedType[] m_defaultExtendedTypes;
-
- /**
- * The default load factor of the Hashtable.
- * This is used to calcualte the threshold.
- */
- private static float m_loadFactor = 0.75f;
-
- /**
- * The initial capacity of the hash table. Use a bigger number
- * to avoid the cost of expanding the table.
- */
- private static int m_initialCapacity = 203;
-
- /**
- * The capacity of the hash table, i.e. the size of the
- * internal HashEntry array.
- */
- private int m_capacity;
-
- /**
- * The threshold of the hash table, which is equal to capacity * loadFactor.
- * If the number of entries in the hash table is bigger than the threshold,
- * the hash table needs to be expanded.
- */
- private int m_threshold;
-
- /**
- * The internal array to store the hash entries.
- * Each array member is a slot for a hash bucket.
- */
- private HashEntry[] m_table;
-
- /**
- * Init default values
- */
- static {
- m_defaultExtendedTypes = new ExtendedType[DTM.NTYPES];
-
- for (int i = 0; i < DTM.NTYPES; i++)
- {
- m_defaultExtendedTypes[i] = new ExtendedType(i, "", "");
- }
- }
-
- /**
- * Create an expanded name table.
- */
- public ExpandedNameTable()
- {
- m_capacity = m_initialCapacity;
- m_threshold = (int)(m_capacity * m_loadFactor);
- m_table = new HashEntry[m_capacity];
-
- initExtendedTypes();
- }
-
-
- /**
- * Initialize the vector of extended types with the
- * basic DOM node types.
- */
- private void initExtendedTypes()
- {
- m_extendedTypes = new ExtendedType[m_initialSize];
- for (int i = 0; i < DTM.NTYPES; i++) {
- m_extendedTypes[i] = m_defaultExtendedTypes[i];
- m_table[i] = new HashEntry(m_defaultExtendedTypes[i], i, i, null);
- }
-
- m_nextType = DTM.NTYPES;
- }
-
- /**
- * Given an expanded name represented by namespace, local name and node type,
- * return an ID. If the expanded-name does not exist in the internal tables,
- * the entry will be created, and the ID will be returned. Any additional
- * nodes that are created that have this expanded name will use this ID.
- *
- * @param namespace The namespace
- * @param localName The local name
- * @param type The node type
- *
- * @return the expanded-name id of the node.
- */
- public int getExpandedTypeID(String namespace, String localName, int type)
- {
- return getExpandedTypeID(namespace, localName, type, false);
- }
-
- /**
- * Given an expanded name represented by namespace, local name and node type,
- * return an ID. If the expanded-name does not exist in the internal tables,
- * the entry will be created, and the ID will be returned. Any additional
- * nodes that are created that have this expanded name will use this ID.
- * <p>
- * If searchOnly is true, we will return -1 if the name is not found in the
- * table, otherwise the name is added to the table and the expanded name id
- * of the new entry is returned.
- *
- * @param namespace The namespace
- * @param localName The local name
- * @param type The node type
- * @param searchOnly If it is true, we will only search for the expanded name.
- * -1 is return is the name is not found.
- *
- * @return the expanded-name id of the node.
- */
- public int getExpandedTypeID(String namespace, String localName, int type, boolean searchOnly)
- {
- if (null == namespace)
- namespace = "";
- if (null == localName)
- localName = "";
-
- // Calculate the hash code
- int hash = type + namespace.hashCode() + localName.hashCode();
-
- // Redefine the hashET object to represent the new expanded name.
- hashET.redefine(type, namespace, localName, hash);
-
- // Calculate the index into the HashEntry table.
- int index = hash % m_capacity;
- if (index < 0)
- index = -index;
-
- // Look up the expanded name in the hash table. Return the id if
- // the expanded name is already in the hash table.
- for (HashEntry e = m_table[index]; e != null; e = e.next)
- {
- if (e.hash == hash && e.key.equals(hashET))
- return e.value;
- }
-
- if (searchOnly)
- {
- return DTM.NULL;
- }
-
- // Expand the internal HashEntry array if necessary.
- if (m_nextType > m_threshold) {
- rehash();
- index = hash % m_capacity;
- if (index < 0)
- index = -index;
- }
-
- // Create a new ExtendedType object
- ExtendedType newET = new ExtendedType(type, namespace, localName, hash);
-
- // Expand the m_extendedTypes array if necessary.
- if (m_extendedTypes.length == m_nextType) {
- ExtendedType[] newArray = new ExtendedType[m_extendedTypes.length * 2];
- System.arraycopy(m_extendedTypes, 0, newArray, 0,
- m_extendedTypes.length);
- m_extendedTypes = newArray;
- }
-
- m_extendedTypes[m_nextType] = newET;
-
- // Create a new hash entry for the new ExtendedType and put it into
- // the table.
- HashEntry entry = new HashEntry(newET, m_nextType, hash, m_table[index]);
- m_table[index] = entry;
-
- return m_nextType++;
- }
-
- /**
- * Increases the capacity of and internally reorganizes the hashtable,
- * in order to accommodate and access its entries more efficiently.
- * This method is called when the number of keys in the hashtable exceeds
- * this hashtable's capacity and load factor.
- */
- private void rehash()
- {
- int oldCapacity = m_capacity;
- HashEntry[] oldTable = m_table;
-
- int newCapacity = 2 * oldCapacity + 1;
- m_capacity = newCapacity;
- m_threshold = (int)(newCapacity * m_loadFactor);
-
- m_table = new HashEntry[newCapacity];
- for (int i = oldCapacity-1; i >=0 ; i--)
- {
- for (HashEntry old = oldTable[i]; old != null; )
- {
- HashEntry e = old;
- old = old.next;
-
- int newIndex = e.hash % newCapacity;
- if (newIndex < 0)
- newIndex = -newIndex;
-
- e.next = m_table[newIndex];
- m_table[newIndex] = e;
- }
- }
- }
-
- /**
- * Given a type, return an expanded name ID.Any additional nodes that are
- * created that have this expanded name will use this ID.
- *
- * @return the expanded-name id of the node.
- */
- public int getExpandedTypeID(int type)
- {
- return type;
- }
-
- /**
- * Given an expanded-name ID, return the local name part.
- *
- * @param ExpandedNameID an ID that represents an expanded-name.
- * @return String Local name of this node, or null if the node has no name.
- */
- public String getLocalName(int ExpandedNameID)
- {
- return m_extendedTypes[ExpandedNameID].getLocalName();
- }
-
- /**
- * Given an expanded-name ID, return the local name ID.
- *
- * @param ExpandedNameID an ID that represents an expanded-name.
- * @return The id of this local name.
- */
- public final int getLocalNameID(int ExpandedNameID)
- {
- // ExtendedType etype = m_extendedTypes[ExpandedNameID];
- if (m_extendedTypes[ExpandedNameID].getLocalName().equals(""))
- return 0;
- else
- return ExpandedNameID;
- }
-
-
- /**
- * Given an expanded-name ID, return the namespace URI part.
- *
- * @param ExpandedNameID an ID that represents an expanded-name.
- * @return String URI value of this node's namespace, or null if no
- * namespace was resolved.
- */
- public String getNamespace(int ExpandedNameID)
- {
- String namespace = m_extendedTypes[ExpandedNameID].getNamespace();
- return (namespace.equals("") ? null : namespace);
- }
-
- /**
- * Given an expanded-name ID, return the namespace URI ID.
- *
- * @param ExpandedNameID an ID that represents an expanded-name.
- * @return The id of this namespace.
- */
- public final int getNamespaceID(int ExpandedNameID)
- {
- //ExtendedType etype = m_extendedTypes[ExpandedNameID];
- if (m_extendedTypes[ExpandedNameID].getNamespace().equals(""))
- return 0;
- else
- return ExpandedNameID;
- }
-
- /**
- * Given an expanded-name ID, return the local name ID.
- *
- * @param ExpandedNameID an ID that represents an expanded-name.
- * @return The id of this local name.
- */
- public final short getType(int ExpandedNameID)
- {
- //ExtendedType etype = m_extendedTypes[ExpandedNameID];
- return (short)m_extendedTypes[ExpandedNameID].getNodeType();
- }
-
- /**
- * Return the size of the ExpandedNameTable
- *
- * @return The size of the ExpandedNameTable
- */
- public int getSize()
- {
- return m_nextType;
- }
-
- /**
- * Return the array of extended types
- *
- * @return The array of extended types
- */
- public ExtendedType[] getExtendedTypes()
- {
- return m_extendedTypes;
- }
-
- /**
- * Inner class which represents a hash table entry.
- * The field next points to the next entry which is hashed into
- * the same bucket in the case of "hash collision".
- */
- private static final class HashEntry
- {
- ExtendedType key;
- int value;
- int hash;
- HashEntry next;
-
- protected HashEntry(ExtendedType key, int value, int hash, HashEntry next)
- {
- this.key = key;
- this.value = value;
- this.hash = hash;
- this.next = next;
- }
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/dtm/ref/ExtendedType.java b/src/com/sun/org/apache/xml/internal/dtm/ref/ExtendedType.java
deleted file mode 100644
index 682986c..0000000
--- a/src/com/sun/org/apache/xml/internal/dtm/ref/ExtendedType.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ExtendedType.java,v 1.2.4.1 2005/09/15 08:15:06 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.dtm.ref;
-
-/**
- * The class ExtendedType represents an extended type object used by
- * ExpandedNameTable.
- */
-public final class ExtendedType
-{
- private int nodetype;
- private String namespace;
- private String localName;
- private int hash;
-
- /**
- * Create an ExtendedType object from node type, namespace and local name.
- * The hash code is calculated from the node type, namespace and local name.
- *
- * @param nodetype Type of the node
- * @param namespace Namespace of the node
- * @param localName Local name of the node
- */
- public ExtendedType (int nodetype, String namespace, String localName)
- {
- this.nodetype = nodetype;
- this.namespace = namespace;
- this.localName = localName;
- this.hash = nodetype + namespace.hashCode() + localName.hashCode();
- }
-
- /**
- * Create an ExtendedType object from node type, namespace, local name
- * and a given hash code.
- *
- * @param nodetype Type of the node
- * @param namespace Namespace of the node
- * @param localName Local name of the node
- * @param hash The given hash code
- */
- public ExtendedType (int nodetype, String namespace, String localName, int hash)
- {
- this.nodetype = nodetype;
- this.namespace = namespace;
- this.localName = localName;
- this.hash = hash;
- }
-
- /**
- * Redefine this ExtendedType object to represent a different extended type.
- * This is intended to be used ONLY on the hashET object. Using it elsewhere
- * will mess up existing hashtable entries!
- */
- protected void redefine(int nodetype, String namespace, String localName)
- {
- this.nodetype = nodetype;
- this.namespace = namespace;
- this.localName = localName;
- this.hash = nodetype + namespace.hashCode() + localName.hashCode();
- }
-
- /**
- * Redefine this ExtendedType object to represent a different extended type.
- * This is intended to be used ONLY on the hashET object. Using it elsewhere
- * will mess up existing hashtable entries!
- */
- protected void redefine(int nodetype, String namespace, String localName, int hash)
- {
- this.nodetype = nodetype;
- this.namespace = namespace;
- this.localName = localName;
- this.hash = hash;
- }
-
- /**
- * Override the hashCode() method in the Object class
- */
- public int hashCode()
- {
- return hash;
- }
-
- /**
- * Test if this ExtendedType object is equal to the given ExtendedType.
- *
- * @param other The other ExtendedType object to test for equality
- * @return true if the two ExtendedType objects are equal.
- */
- public boolean equals(ExtendedType other)
- {
- try
- {
- return other.nodetype == this.nodetype &&
- other.localName.equals(this.localName) &&
- other.namespace.equals(this.namespace);
- }
- catch(NullPointerException e)
- {
- return false;
- }
- }
-
- /**
- * Return the node type
- */
- public int getNodeType()
- {
- return nodetype;
- }
-
- /**
- * Return the local name
- */
- public String getLocalName()
- {
- return localName;
- }
-
- /**
- * Return the namespace
- */
- public String getNamespace()
- {
- return namespace;
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/dtm/ref/IncrementalSAXSource.java b/src/com/sun/org/apache/xml/internal/dtm/ref/IncrementalSAXSource.java
deleted file mode 100644
index 417454f..0000000
--- a/src/com/sun/org/apache/xml/internal/dtm/ref/IncrementalSAXSource.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: IncrementalSAXSource.java,v 1.2.4.1 2005/09/15 08:15:06 suresh_emailid Exp $
- */
-
-package com.sun.org.apache.xml.internal.dtm.ref;
-
-import org.xml.sax.ContentHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
-/** <p>IncrementalSAXSource is an API that delivers a small number of
- * SAX events each time a request is made from a "controller"
- * coroutine. See IncrementalSAXFilter and IncrementalSAXFilter_Xerces
- * for examples.
- *
- * Note that interaction is via the deliverMoreNodes
- * method, and therefore coroutine support is not exposed
- * here.</p>
- * */
-public interface IncrementalSAXSource
-{
- // ------------------------------------------------------------------
- // SAX Output API
- // ------------------------------------------------------------------
-
- /** Register a SAX-style content handler for us to output to
- */
- public void setContentHandler(ContentHandler handler);
-
- /** Register a SAX-style lexical handler for us to output to
- */
- public void setLexicalHandler(org.xml.sax.ext.LexicalHandler handler);
-
- /** Register a SAX-style DTD handler for us to output to
- */
- public void setDTDHandler(org.xml.sax.DTDHandler handler);
-
- // ------------------------------------------------------------------
- // Command Input API
- // ------------------------------------------------------------------
-
- /** deliverMoreNodes() is a simple API which tells the thread in which the
- * IncrementalSAXSource is running to deliver more events (true),
- * or stop delivering events and close out its input (false).
- *
- * This is intended to be called from one of our partner coroutines,
- * and serves to encapsulate the coroutine communication protocol.
- *
- * @param parsemore If true, tells the incremental SAX stream to deliver
- * another chunk of events. If false, finishes out the stream.
- *
- * @return Boolean.TRUE if the IncrementalSAXSource believes more data
- * may be available for further parsing. Boolean.FALSE if parsing
- * ran to completion, or was ended by deliverMoreNodes(false).
- * */
- public Object deliverMoreNodes (boolean parsemore);
-
- // ------------------------------------------------------------------
- // Parse Thread Convenience API
- // ------------------------------------------------------------------
-
- /** Launch an XMLReader's parsing operation, feeding events to this
- * IncrementalSAXSource. In some implementations, this may launch a
- * thread which runs the previously supplied XMLReader's parse() operation.
- * In others, it may do other forms of initialization.
- *
- * @throws SAXException is parse thread is already in progress
- * or parsing can not be started.
- * */
- public void startParse(InputSource source) throws SAXException;
-
-} // class IncrementalSAXSource
diff --git a/src/com/sun/org/apache/xml/internal/dtm/ref/IncrementalSAXSource_Filter.java b/src/com/sun/org/apache/xml/internal/dtm/ref/IncrementalSAXSource_Filter.java
deleted file mode 100644
index 2d97451..0000000
--- a/src/com/sun/org/apache/xml/internal/dtm/ref/IncrementalSAXSource_Filter.java
+++ /dev/null
@@ -1,813 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: IncrementalSAXSource_Filter.java,v 1.2.4.1 2005/09/15 08:15:07 suresh_emailid Exp $
- */
-
-package com.sun.org.apache.xml.internal.dtm.ref;
-
-import java.io.IOException;
-
-import com.sun.org.apache.xml.internal.res.XMLErrorResources;
-import com.sun.org.apache.xml.internal.res.XMLMessages;
-import com.sun.org.apache.xml.internal.utils.ThreadControllerWrapper;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.DTDHandler;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.ext.LexicalHandler;
-
-/** <p>IncrementalSAXSource_Filter implements IncrementalSAXSource, using a
- * standard SAX2 event source as its input and parcelling out those
- * events gradually in reponse to deliverMoreNodes() requests. Output from the
- * filter will be passed along to a SAX handler registered as our
- * listener, but those callbacks will pass through a counting stage
- * which periodically yields control back to the controller coroutine.
- * </p>
- *
- * <p>%REVIEW%: This filter is not currenly intended to be reusable
- * for parsing additional streams/documents. We may want to consider
- * making it resettable at some point in the future. But it's a
- * small object, so that'd be mostly a convenience issue; the cost
- * of allocating each time is trivial compared to the cost of processing
- * any nontrival stream.</p>
- *
- * <p>For a brief usage example, see the unit-test main() method.</p>
- *
- * <p>This is a simplification of the old CoroutineSAXParser, focusing
- * specifically on filtering. The resulting controller protocol is _far_
- * simpler and less error-prone; the only controller operation is deliverMoreNodes(),
- * and the only requirement is that deliverMoreNodes(false) be called if you want to
- * discard the rest of the stream and the previous deliverMoreNodes() didn't return
- * false.
- *
- * This class is final and package private for security reasons. Please
- * see CR 6537912 for further details.
- *
- * */
-final class IncrementalSAXSource_Filter
-implements IncrementalSAXSource, ContentHandler, DTDHandler, LexicalHandler, ErrorHandler, Runnable
-{
- boolean DEBUG=false; //Internal status report
-
- //
- // Data
- //
- private CoroutineManager fCoroutineManager = null;
- private int fControllerCoroutineID = -1;
- private int fSourceCoroutineID = -1;
-
- private ContentHandler clientContentHandler=null; // %REVIEW% support multiple?
- private LexicalHandler clientLexicalHandler=null; // %REVIEW% support multiple?
- private DTDHandler clientDTDHandler=null; // %REVIEW% support multiple?
- private ErrorHandler clientErrorHandler=null; // %REVIEW% support multiple?
- private int eventcounter;
- private int frequency=5;
-
- // Flag indicating that no more events should be delivered -- either
- // because input stream ran to completion (endDocument), or because
- // the user requested an early stop via deliverMoreNodes(false).
- private boolean fNoMoreEvents=false;
-
- // Support for startParse()
- private XMLReader fXMLReader=null;
- private InputSource fXMLReaderInputSource=null;
-
- //
- // Constructors
- //
-
- public IncrementalSAXSource_Filter() {
- this.init( new CoroutineManager(), -1, -1);
- }
-
- /** Create a IncrementalSAXSource_Filter which is not yet bound to a specific
- * SAX event source.
- * */
- public IncrementalSAXSource_Filter(CoroutineManager co, int controllerCoroutineID)
- {
- this.init( co, controllerCoroutineID, -1 );
- }
-
- //
- // Factories
- //
- static public IncrementalSAXSource createIncrementalSAXSource(CoroutineManager co, int controllerCoroutineID) {
- return new IncrementalSAXSource_Filter(co, controllerCoroutineID);
- }
-
- //
- // Public methods
- //
-
- public void init( CoroutineManager co, int controllerCoroutineID,
- int sourceCoroutineID)
- {
- if(co==null)
- co = new CoroutineManager();
- fCoroutineManager = co;
- fControllerCoroutineID = co.co_joinCoroutineSet(controllerCoroutineID);
- fSourceCoroutineID = co.co_joinCoroutineSet(sourceCoroutineID);
- if (fControllerCoroutineID == -1 || fSourceCoroutineID == -1)
- throw new RuntimeException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COJOINROUTINESET_FAILED, null)); //"co_joinCoroutineSet() failed");
-
- fNoMoreEvents=false;
- eventcounter=frequency;
- }
-
- /** Bind our input streams to an XMLReader.
- *
- * Just a convenience routine; obviously you can explicitly register
- * this as a listener with the same effect.
- * */
- public void setXMLReader(XMLReader eventsource)
- {
- fXMLReader=eventsource;
- eventsource.setContentHandler(this);
- eventsource.setDTDHandler(this);
- eventsource.setErrorHandler(this); // to report fatal errors in filtering mode
-
- // Not supported by all SAX2 filters:
- try
- {
- eventsource.
- setProperty("http://xml.org/sax/properties/lexical-handler",
- this);
- }
- catch(SAXNotRecognizedException e)
- {
- // Nothing we can do about it
- }
- catch(SAXNotSupportedException e)
- {
- // Nothing we can do about it
- }
-
- // Should we also bind as other varieties of handler?
- // (DTDHandler and so on)
- }
-
- // Register a content handler for us to output to
- public void setContentHandler(ContentHandler handler)
- {
- clientContentHandler=handler;
- }
- // Register a DTD handler for us to output to
- public void setDTDHandler(DTDHandler handler)
- {
- clientDTDHandler=handler;
- }
- // Register a lexical handler for us to output to
- // Not all filters support this...
- // ??? Should we register directly on the filter?
- // NOTE NAME -- subclassing issue in the Xerces version
- public void setLexicalHandler(LexicalHandler handler)
- {
- clientLexicalHandler=handler;
- }
- // Register an error handler for us to output to
- // NOTE NAME -- subclassing issue in the Xerces version
- public void setErrHandler(ErrorHandler handler)
- {
- clientErrorHandler=handler;
- }
-
- // Set the number of events between resumes of our coroutine
- // Immediately resets number of events before _next_ resume as well.
- public void setReturnFrequency(int events)
- {
- if(events<1) events=1;
- frequency=eventcounter=events;
- }
-
- //
- // ContentHandler methods
- // These pass the data to our client ContentHandler...
- // but they also count the number of events passing through,
- // and resume our coroutine each time that counter hits zero and
- // is reset.
- //
- // Note that for everything except endDocument and fatalError, we do the count-and-yield
- // BEFORE passing the call along. I'm hoping that this will encourage JIT
- // compilers to realize that these are tail-calls, reducing the expense of
- // the additional layer of data flow.
- //
- // %REVIEW% Glenn suggests that pausing after endElement, endDocument,
- // and characters may be sufficient. I actually may not want to
- // stop after characters, since in our application these wind up being
- // concatenated before they're processed... but that risks huge blocks of
- // text causing greater than usual readahead. (Unlikely? Consider the
- // possibility of a large base-64 block in a SOAP stream.)
- //
- public void characters(char[] ch, int start, int length)
- throws org.xml.sax.SAXException
- {
- if(--eventcounter<=0)
- {
- co_yield(true);
- eventcounter=frequency;
- }
- if(clientContentHandler!=null)
- clientContentHandler.characters(ch,start,length);
- }
- public void endDocument()
- throws org.xml.sax.SAXException
- {
- // EXCEPTION: In this case we need to run the event BEFORE we yield.
- if(clientContentHandler!=null)
- clientContentHandler.endDocument();
-
- eventcounter=0;
- co_yield(false);
- }
- public void endElement(java.lang.String namespaceURI, java.lang.String localName,
- java.lang.String qName)
- throws org.xml.sax.SAXException
- {
- if(--eventcounter<=0)
- {
- co_yield(true);
- eventcounter=frequency;
- }
- if(clientContentHandler!=null)
- clientContentHandler.endElement(namespaceURI,localName,qName);
- }
- public void endPrefixMapping(java.lang.String prefix)
- throws org.xml.sax.SAXException
- {
- if(--eventcounter<=0)
- {
- co_yield(true);
- eventcounter=frequency;
- }
- if(clientContentHandler!=null)
- clientContentHandler.endPrefixMapping(prefix);
- }
- public void ignorableWhitespace(char[] ch, int start, int length)
- throws org.xml.sax.SAXException
- {
- if(--eventcounter<=0)
- {
- co_yield(true);
- eventcounter=frequency;
- }
- if(clientContentHandler!=null)
- clientContentHandler.ignorableWhitespace(ch,start,length);
- }
- public void processingInstruction(java.lang.String target, java.lang.String data)
- throws org.xml.sax.SAXException
- {
- if(--eventcounter<=0)
- {
- co_yield(true);
- eventcounter=frequency;
- }
- if(clientContentHandler!=null)
- clientContentHandler.processingInstruction(target,data);
- }
- public void setDocumentLocator(Locator locator)
- {
- if(--eventcounter<=0)
- {
- // This can cause a hang. -sb
- // co_yield(true);
- eventcounter=frequency;
- }
- if(clientContentHandler!=null)
- clientContentHandler.setDocumentLocator(locator);
- }
- public void skippedEntity(java.lang.String name)
- throws org.xml.sax.SAXException
- {
- if(--eventcounter<=0)
- {
- co_yield(true);
- eventcounter=frequency;
- }
- if(clientContentHandler!=null)
- clientContentHandler.skippedEntity(name);
- }
- public void startDocument()
- throws org.xml.sax.SAXException
- {
- co_entry_pause();
-
- // Otherwise, begin normal event delivery
- if(--eventcounter<=0)
- {
- co_yield(true);
- eventcounter=frequency;
- }
- if(clientContentHandler!=null)
- clientContentHandler.startDocument();
- }
- public void startElement(java.lang.String namespaceURI, java.lang.String localName,
- java.lang.String qName, Attributes atts)
- throws org.xml.sax.SAXException
- {
- if(--eventcounter<=0)
- {
- co_yield(true);
- eventcounter=frequency;
- }
- if(clientContentHandler!=null)
- clientContentHandler.startElement(namespaceURI, localName, qName, atts);
- }
- public void startPrefixMapping(java.lang.String prefix, java.lang.String uri)
- throws org.xml.sax.SAXException
- {
- if(--eventcounter<=0)
- {
- co_yield(true);
- eventcounter=frequency;
- }
- if(clientContentHandler!=null)
- clientContentHandler.startPrefixMapping(prefix,uri);
- }
-
- //
- // LexicalHandler support. Not all SAX2 filters support these events
- // but we may want to pass them through when they exist...
- //
- // %REVIEW% These do NOT currently affect the eventcounter; I'm asserting
- // that they're rare enough that it makes little or no sense to
- // pause after them. As such, it may make more sense for folks who
- // actually want to use them to register directly with the filter.
- // But I want 'em here for now, to remind us to recheck this assertion!
- //
- public void comment(char[] ch, int start, int length)
- throws org.xml.sax.SAXException
- {
- if(null!=clientLexicalHandler)
- clientLexicalHandler.comment(ch,start,length);
- }
- public void endCDATA()
- throws org.xml.sax.SAXException
- {
- if(null!=clientLexicalHandler)
- clientLexicalHandler.endCDATA();
- }
- public void endDTD()
- throws org.xml.sax.SAXException
- {
- if(null!=clientLexicalHandler)
- clientLexicalHandler.endDTD();
- }
- public void endEntity(java.lang.String name)
- throws org.xml.sax.SAXException
- {
- if(null!=clientLexicalHandler)
- clientLexicalHandler.endEntity(name);
- }
- public void startCDATA()
- throws org.xml.sax.SAXException
- {
- if(null!=clientLexicalHandler)
- clientLexicalHandler.startCDATA();
- }
- public void startDTD(java.lang.String name, java.lang.String publicId,
- java.lang.String systemId)
- throws org.xml.sax.SAXException
- {
- if(null!=clientLexicalHandler)
- clientLexicalHandler. startDTD(name, publicId, systemId);
- }
- public void startEntity(java.lang.String name)
- throws org.xml.sax.SAXException
- {
- if(null!=clientLexicalHandler)
- clientLexicalHandler.startEntity(name);
- }
-
- //
- // DTDHandler support.
-
- public void notationDecl(String a, String b, String c) throws SAXException
- {
- if(null!=clientDTDHandler)
- clientDTDHandler.notationDecl(a,b,c);
- }
- public void unparsedEntityDecl(String a, String b, String c, String d) throws SAXException
- {
- if(null!=clientDTDHandler)
- clientDTDHandler.unparsedEntityDecl(a,b,c,d);
- }
-
- //
- // ErrorHandler support.
- //
- // PROBLEM: Xerces is apparently _not_ calling the ErrorHandler for
- // exceptions thrown by the ContentHandler, which prevents us from
- // handling this properly when running in filtering mode with Xerces
- // as our event source. It's unclear whether this is a Xerces bug
- // or a SAX design flaw.
- //
- // %REVIEW% Current solution: In filtering mode, it is REQUIRED that
- // event source make sure this method is invoked if the event stream
- // abends before endDocument is delivered. If that means explicitly calling
- // us in the exception handling code because it won't be delivered as part
- // of the normal SAX ErrorHandler stream, that's fine; Not Our Problem.
- //
- public void error(SAXParseException exception) throws SAXException
- {
- if(null!=clientErrorHandler)
- clientErrorHandler.error(exception);
- }
-
- public void fatalError(SAXParseException exception) throws SAXException
- {
- // EXCEPTION: In this case we need to run the event BEFORE we yield --
- // just as with endDocument, this terminates the event stream.
- if(null!=clientErrorHandler)
- clientErrorHandler.error(exception);
-
- eventcounter=0;
- co_yield(false);
-
- }
-
- public void warning(SAXParseException exception) throws SAXException
- {
- if(null!=clientErrorHandler)
- clientErrorHandler.error(exception);
- }
-
-
- //
- // coroutine support
- //
-
- public int getSourceCoroutineID() {
- return fSourceCoroutineID;
- }
- public int getControllerCoroutineID() {
- return fControllerCoroutineID;
- }
-
- /** @return the CoroutineManager this CoroutineFilter object is bound to.
- * If you're using the do...() methods, applications should only
- * need to talk to the CoroutineManager once, to obtain the
- * application's Coroutine ID.
- * */
- public CoroutineManager getCoroutineManager()
- {
- return fCoroutineManager;
- }
-
- /** <p>In the SAX delegation code, I've inlined the count-down in
- * the hope of encouraging compilers to deliver better
- * performance. However, if we subclass (eg to directly connect the
- * output to a DTM builder), that would require calling super in
- * order to run that logic... which seems inelegant. Hence this
- * routine for the convenience of subclasses: every [frequency]
- * invocations, issue a co_yield.</p>
- *
- * @param moreExepected Should always be true unless this is being called
- * at the end of endDocument() handling.
- * */
- protected void count_and_yield(boolean moreExpected) throws SAXException
- {
- if(!moreExpected) eventcounter=0;
-
- if(--eventcounter<=0)
- {
- co_yield(true);
- eventcounter=frequency;
- }
- }
-
- /**
- * co_entry_pause is called in startDocument() before anything else
- * happens. It causes the filter to wait for a "go ahead" request
- * from the controller before delivering any events. Note that
- * the very first thing the controller tells us may be "I don't
- * need events after all"!
- */
- private void co_entry_pause() throws SAXException
- {
- if(fCoroutineManager==null)
- {
- // Nobody called init()? Do it now...
- init(null,-1,-1);
- }
-
- try
- {
- Object arg=fCoroutineManager.co_entry_pause(fSourceCoroutineID);
- if(arg==Boolean.FALSE)
- co_yield(false);
- }
- catch(NoSuchMethodException e)
- {
- // Coroutine system says we haven't registered. That's an
- // application coding error, and is unrecoverable.
- if(DEBUG) e.printStackTrace();
- throw new SAXException(e);
- }
- }
-
- /**
- * Co_Yield handles coroutine interactions while a parse is in progress.
- *
- * When moreRemains==true, we are pausing after delivering events, to
- * ask if more are needed. We will resume the controller thread with
- * co_resume(Boolean.TRUE, ...)
- * When control is passed back it may indicate
- * Boolean.TRUE indication to continue delivering events
- * Boolean.FALSE indication to discontinue events and shut down.
- *
- * When moreRemains==false, we shut down immediately without asking the
- * controller's permission. Normally this means end of document has been
- * reached.
- *
- * Shutting down a IncrementalSAXSource_Filter requires terminating the incoming
- * SAX event stream. If we are in control of that stream (if it came
- * from an XMLReader passed to our startReader() method), we can do so
- * very quickly by throwing a reserved exception to it. If the stream is
- * coming from another source, we can't do that because its caller may
- * not be prepared for this "normal abnormal exit", and instead we put
- * ourselves in a "spin" mode where events are discarded.
- */
- private void co_yield(boolean moreRemains) throws SAXException
- {
- // Horrendous kluge to run filter to completion. See below.
- if(fNoMoreEvents)
- return;
-
- try // Coroutine manager might throw no-such.
- {
- Object arg=Boolean.FALSE;
- if(moreRemains)
- {
- // Yield control, resume parsing when done
- arg = fCoroutineManager.co_resume(Boolean.TRUE, fSourceCoroutineID,
- fControllerCoroutineID);
-
- }
-
- // If we're at end of document or were told to stop early
- if(arg==Boolean.FALSE)
- {
- fNoMoreEvents=true;
-
- if(fXMLReader!=null) // Running under startParseThread()
- throw new StopException(); // We'll co_exit from there.
-
- // Yield control. We do NOT expect anyone to ever ask us again.
- fCoroutineManager.co_exit_to(Boolean.FALSE, fSourceCoroutineID,
- fControllerCoroutineID);
- }
- }
- catch(NoSuchMethodException e)
- {
- // Shouldn't happen unless we've miscoded our coroutine logic
- // "Shut down the garbage smashers on the detention level!"
- fNoMoreEvents=true;
- fCoroutineManager.co_exit(fSourceCoroutineID);
- throw new SAXException(e);
- }
- }
-
- //
- // Convenience: Run an XMLReader in a thread
- //
-
- /** Launch a thread that will run an XMLReader's parse() operation within
- * a thread, feeding events to this IncrementalSAXSource_Filter. Mostly a convenience
- * routine, but has the advantage that -- since we invoked parse() --
- * we can halt parsing quickly via a StopException rather than waiting
- * for the SAX stream to end by itself.
- *
- * @throws SAXException is parse thread is already in progress
- * or parsing can not be started.
- * */
- public void startParse(InputSource source) throws SAXException
- {
- if(fNoMoreEvents)
- throw new SAXException(XMLMessages.createXMLMessage(XMLErrorResources.ER_INCRSAXSRCFILTER_NOT_RESTARTABLE, null)); //"IncrmentalSAXSource_Filter not currently restartable.");
- if(fXMLReader==null)
- throw new SAXException(XMLMessages.createXMLMessage(XMLErrorResources.ER_XMLRDR_NOT_BEFORE_STARTPARSE, null)); //"XMLReader not before startParse request");
-
- fXMLReaderInputSource=source;
-
- // Xalan thread pooling...
- // com.sun.org.apache.xalan.internal.transformer.TransformerImpl.runTransformThread(this);
- ThreadControllerWrapper.runThread(this, -1);
- }
-
- /* Thread logic to support startParseThread()
- */
- public void run()
- {
- // Guard against direct invocation of start().
- if(fXMLReader==null) return;
-
- if(DEBUG)System.out.println("IncrementalSAXSource_Filter parse thread launched");
-
- // Initially assume we'll run successfully.
- Object arg=Boolean.FALSE;
-
- // For the duration of this operation, all coroutine handshaking
- // will occur in the co_yield method. That's the nice thing about
- // coroutines; they give us a way to hand off control from the
- // middle of a synchronous method.
- try
- {
- fXMLReader.parse(fXMLReaderInputSource);
- }
- catch(IOException ex)
- {
- arg=ex;
- }
- catch(StopException ex)
- {
- // Expected and harmless
- if(DEBUG)System.out.println("Active IncrementalSAXSource_Filter normal stop exception");
- }
- catch (SAXException ex)
- {
- Exception inner=ex.getException();
- if(inner instanceof StopException){
- // Expected and harmless
- if(DEBUG)System.out.println("Active IncrementalSAXSource_Filter normal stop exception");
- }
- else
- {
- // Unexpected malfunction
- if(DEBUG)
- {
- System.out.println("Active IncrementalSAXSource_Filter UNEXPECTED SAX exception: "+inner);
- inner.printStackTrace();
- }
- arg=ex;
- }
- } // end parse
-
- // Mark as no longer running in thread.
- fXMLReader=null;
-
- try
- {
- // Mark as done and yield control to the controller coroutine
- fNoMoreEvents=true;
- fCoroutineManager.co_exit_to(arg, fSourceCoroutineID,
- fControllerCoroutineID);
- }
- catch(java.lang.NoSuchMethodException e)
- {
- // Shouldn't happen unless we've miscoded our coroutine logic
- // "CPO, shut down the garbage smashers on the detention level!"
- e.printStackTrace(System.err);
- fCoroutineManager.co_exit(fSourceCoroutineID);
- }
- }
-
- /** Used to quickly terminate parse when running under a
- startParse() thread. Only its type is important. */
- class StopException extends RuntimeException
- {
- static final long serialVersionUID = -1129245796185754956L;
- }
-
- /** deliverMoreNodes() is a simple API which tells the coroutine
- * parser that we need more nodes. This is intended to be called
- * from one of our partner routines, and serves to encapsulate the
- * details of how incremental parsing has been achieved.
- *
- * @param parsemore If true, tells the incremental filter to generate
- * another chunk of output. If false, tells the filter that we're
- * satisfied and it can terminate parsing of this document.
- *
- * @return Boolean.TRUE if there may be more events available by invoking
- * deliverMoreNodes() again. Boolean.FALSE if parsing has run to completion (or been
- * terminated by deliverMoreNodes(false). Or an exception object if something
- * malfunctioned. %REVIEW% We _could_ actually throw the exception, but
- * that would require runinng deliverMoreNodes() in a try/catch... and for many
- * applications, exception will be simply be treated as "not TRUE" in
- * any case.
- * */
- public Object deliverMoreNodes(boolean parsemore)
- {
- // If parsing is already done, we can immediately say so
- if(fNoMoreEvents)
- return Boolean.FALSE;
-
- try
- {
- Object result =
- fCoroutineManager.co_resume(parsemore?Boolean.TRUE:Boolean.FALSE,
- fControllerCoroutineID, fSourceCoroutineID);
- if(result==Boolean.FALSE)
- fCoroutineManager.co_exit(fControllerCoroutineID);
-
- return result;
- }
-
- // SHOULD NEVER OCCUR, since the coroutine number and coroutine manager
- // are those previously established for this IncrementalSAXSource_Filter...
- // So I'm just going to return it as a parsing exception, for now.
- catch(NoSuchMethodException e)
- {
- return e;
- }
- }
-
-
- //================================================================
- /** Simple unit test. Attempt coroutine parsing of document indicated
- * by first argument (as a URI), report progress.
- */
- /*
- public static void _main(String args[])
- {
- System.out.println("Starting...");
-
- org.xml.sax.XMLReader theSAXParser=
- new com.sun.org.apache.xerces.internal.parsers.SAXParser();
-
-
- for(int arg=0;arg<args.length;++arg)
- {
- // The filter is not currently designed to be restartable
- // after a parse has ended. Generate a new one each time.
- IncrementalSAXSource_Filter filter=
- new IncrementalSAXSource_Filter();
- // Use a serializer as our sample output
- com.sun.org.apache.xml.internal.serialize.XMLSerializer trace;
- trace=new com.sun.org.apache.xml.internal.serialize.XMLSerializer(System.out,null);
- filter.setContentHandler(trace);
- filter.setLexicalHandler(trace);
-
- try
- {
- InputSource source = new InputSource(args[arg]);
- Object result=null;
- boolean more=true;
-
- // init not issued; we _should_ automagically Do The Right Thing
-
- // Bind parser, kick off parsing in a thread
- filter.setXMLReader(theSAXParser);
- filter.startParse(source);
-
- for(result = filter.deliverMoreNodes(more);
- (result instanceof Boolean && ((Boolean)result)==Boolean.TRUE);
- result = filter.deliverMoreNodes(more))
- {
- System.out.println("\nSome parsing successful, trying more.\n");
-
- // Special test: Terminate parsing early.
- if(arg+1<args.length && "!".equals(args[arg+1]))
- {
- ++arg;
- more=false;
- }
-
- }
-
- if (result instanceof Boolean && ((Boolean)result)==Boolean.FALSE)
- {
- System.out.println("\nFilter ended (EOF or on request).\n");
- }
- else if (result == null) {
- System.out.println("\nUNEXPECTED: Filter says shut down prematurely.\n");
- }
- else if (result instanceof Exception) {
- System.out.println("\nFilter threw exception:");
- ((Exception)result).printStackTrace();
- }
-
- }
- catch(SAXException e)
- {
- e.printStackTrace();
- }
- } // end for
- }
- */
-} // class IncrementalSAXSource_Filter
diff --git a/src/com/sun/org/apache/xml/internal/dtm/ref/IncrementalSAXSource_Xerces.java b/src/com/sun/org/apache/xml/internal/dtm/ref/IncrementalSAXSource_Xerces.java
deleted file mode 100644
index 29881eb..0000000
--- a/src/com/sun/org/apache/xml/internal/dtm/ref/IncrementalSAXSource_Xerces.java
+++ /dev/null
@@ -1,457 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: IncrementalSAXSource_Xerces.java,v 1.2.4.1 2005/09/15 08:15:08 suresh_emailid Exp $
- */
-
-package com.sun.org.apache.xml.internal.dtm.ref;
-
-import java.io.IOException;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Method;
-
-import com.sun.org.apache.xerces.internal.parsers.SAXParser;
-import com.sun.org.apache.xml.internal.res.XMLErrorResources;
-import com.sun.org.apache.xml.internal.res.XMLMessages;
-import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
-
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
-
-
-/** <p>IncrementalSAXSource_Xerces takes advantage of the fact that Xerces1
- * incremental mode is already a coroutine of sorts, and just wraps our
- * IncrementalSAXSource API around it.</p>
- *
- * <p>Usage example: See main().</p>
- *
- * <p>Status: Passes simple main() unit-test. NEEDS JAVADOC.</p>
- * */
-public class IncrementalSAXSource_Xerces
- implements IncrementalSAXSource
-{
- //
- // Reflection. To allow this to compile with both Xerces1 and Xerces2, which
- // require very different methods and objects, we need to avoid static
- // references to those APIs. So until Xerces2 is pervasive and we're willing
- // to make it a prerequisite, we will rely upon relection.
- //
- Method fParseSomeSetup=null; // Xerces1 method
- Method fParseSome=null; // Xerces1 method
- Object fPullParserConfig=null; // Xerces2 pull control object
- Method fConfigSetInput=null; // Xerces2 method
- Method fConfigParse=null; // Xerces2 method
- Method fSetInputSource=null; // Xerces2 pull control method
- Constructor fConfigInputSourceCtor=null; // Xerces2 initialization method
- Method fConfigSetByteStream=null; // Xerces2 initialization method
- Method fConfigSetCharStream=null; // Xerces2 initialization method
- Method fConfigSetEncoding=null; // Xerces2 initialization method
- Method fReset=null; // Both Xerces1 and Xerces2, but diff. signatures
-
- //
- // Data
- //
- SAXParser fIncrementalParser;
- private boolean fParseInProgress=false;
-
- //
- // Constructors
- //
-
- /** Create a IncrementalSAXSource_Xerces, and create a SAXParser
- * to go with it. Xerces2 incremental parsing is only supported if
- * this constructor is used, due to limitations in the Xerces2 API (as of
- * Beta 3). If you don't like that restriction, tell the Xerces folks that
- * there should be a simpler way to request incremental SAX parsing.
- * */
- public IncrementalSAXSource_Xerces()
- throws NoSuchMethodException
- {
- try
- {
- // Xerces-2 incremental parsing support (as of Beta 3)
- // ContentHandlers still get set on fIncrementalParser (to get
- // conversion from XNI events to SAX events), but
- // _control_ for incremental parsing must be exercised via the config.
- //
- // At this time there's no way to read the existing config, only
- // to assert a new one... and only when creating a brand-new parser.
- //
- // Reflection is used to allow us to continue to compile against
- // Xerces1. If/when we can abandon the older versions of the parser,
- // this will simplify significantly.
-
- // If we can't get the magic constructor, no need to look further.
- Class xniConfigClass=ObjectFactory.findProviderClass(
- "com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration",
- true);
- Class[] args1={xniConfigClass};
- Constructor ctor=SAXParser.class.getConstructor(args1);
-
- // Build the parser configuration object. StandardParserConfiguration
- // happens to implement XMLPullParserConfiguration, which is the API
- // we're going to want to use.
- Class xniStdConfigClass=ObjectFactory.findProviderClass(
- "com.sun.org.apache.xerces.internal.parsers.StandardParserConfiguration",
- true);
- fPullParserConfig=xniStdConfigClass.newInstance();
- Object[] args2={fPullParserConfig};
- fIncrementalParser = (SAXParser)ctor.newInstance(args2);
-
- // Preload all the needed the configuration methods... I want to know they're
- // all here before we commit to trying to use them, just in case the
- // API changes again.
- Class fXniInputSourceClass=ObjectFactory.findProviderClass(
- "com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource",
- true);
- Class[] args3={fXniInputSourceClass};
- fConfigSetInput=xniStdConfigClass.getMethod("setInputSource",args3);
-
- Class[] args4={String.class,String.class,String.class};
- fConfigInputSourceCtor=fXniInputSourceClass.getConstructor(args4);
- Class[] args5={java.io.InputStream.class};
- fConfigSetByteStream=fXniInputSourceClass.getMethod("setByteStream",args5);
- Class[] args6={java.io.Reader.class};
- fConfigSetCharStream=fXniInputSourceClass.getMethod("setCharacterStream",args6);
- Class[] args7={String.class};
- fConfigSetEncoding=fXniInputSourceClass.getMethod("setEncoding",args7);
-
- Class[] argsb={Boolean.TYPE};
- fConfigParse=xniStdConfigClass.getMethod("parse",argsb);
- Class[] noargs=new Class[0];
- fReset=fIncrementalParser.getClass().getMethod("reset",noargs);
- }
- catch(Exception e)
- {
- // Fallback if this fails (implemented in createIncrementalSAXSource) is
- // to attempt Xerces-1 incremental setup. Can't do tail-call in
- // constructor, so create new, copy Xerces-1 initialization,
- // then throw it away... Ugh.
- IncrementalSAXSource_Xerces dummy=new IncrementalSAXSource_Xerces(new SAXParser());
- this.fParseSomeSetup=dummy.fParseSomeSetup;
- this.fParseSome=dummy.fParseSome;
- this.fIncrementalParser=dummy.fIncrementalParser;
- }
- }
-
- /** Create a IncrementalSAXSource_Xerces wrapped around
- * an existing SAXParser. Currently this works only for recent
- * releases of Xerces-1. Xerces-2 incremental is currently possible
- * only if we are allowed to create the parser instance, due to
- * limitations in the API exposed by Xerces-2 Beta 3; see the
- * no-args constructor for that code.
- *
- * @exception if the SAXParser class doesn't support the Xerces
- * incremental parse operations. In that case, caller should
- * fall back upon the IncrementalSAXSource_Filter approach.
- * */
- public IncrementalSAXSource_Xerces(SAXParser parser)
- throws NoSuchMethodException
- {
- // Reflection is used to allow us to compile against
- // Xerces2. If/when we can abandon the older versions of the parser,
- // this constructor will simply have to fail until/unless the
- // Xerces2 incremental support is made available on previously
- // constructed SAXParser instances.
- fIncrementalParser=parser;
- Class me=parser.getClass();
- Class[] parms={InputSource.class};
- fParseSomeSetup=me.getMethod("parseSomeSetup",parms);
- parms=new Class[0];
- fParseSome=me.getMethod("parseSome",parms);
- // Fallback if this fails (implemented in createIncrementalSAXSource) is
- // to use IncrementalSAXSource_Filter rather than Xerces-specific code.
- }
-
- //
- // Factories
- //
- static public IncrementalSAXSource createIncrementalSAXSource()
- {
- try
- {
- return new IncrementalSAXSource_Xerces();
- }
- catch(NoSuchMethodException e)
- {
- // Xerces version mismatch; neither Xerces1 nor Xerces2 succeeded.
- // Fall back on filtering solution.
- IncrementalSAXSource_Filter iss=new IncrementalSAXSource_Filter();
- iss.setXMLReader(new SAXParser());
- return iss;
- }
- }
-
- static public IncrementalSAXSource
- createIncrementalSAXSource(SAXParser parser) {
- try
- {
- return new IncrementalSAXSource_Xerces(parser);
- }
- catch(NoSuchMethodException e)
- {
- // Xerces version mismatch; neither Xerces1 nor Xerces2 succeeded.
- // Fall back on filtering solution.
- IncrementalSAXSource_Filter iss=new IncrementalSAXSource_Filter();
- iss.setXMLReader(parser);
- return iss;
- }
- }
-
- //
- // Public methods
- //
-
- // Register handler directly with the incremental parser
- public void setContentHandler(org.xml.sax.ContentHandler handler)
- {
- // Typecast required in Xerces2; SAXParser doesn't inheret XMLReader
- // %OPT% Cast at asignment?
- ((XMLReader)fIncrementalParser).setContentHandler(handler);
- }
-
- // Register handler directly with the incremental parser
- public void setLexicalHandler(org.xml.sax.ext.LexicalHandler handler)
- {
- // Not supported by all SAX2 parsers but should work in Xerces:
- try
- {
- // Typecast required in Xerces2; SAXParser doesn't inheret XMLReader
- // %OPT% Cast at asignment?
- ((XMLReader)fIncrementalParser).setProperty("http://xml.org/sax/properties/lexical-handler",
- handler);
- }
- catch(org.xml.sax.SAXNotRecognizedException e)
- {
- // Nothing we can do about it
- }
- catch(org.xml.sax.SAXNotSupportedException e)
- {
- // Nothing we can do about it
- }
- }
-
- // Register handler directly with the incremental parser
- public void setDTDHandler(org.xml.sax.DTDHandler handler)
- {
- // Typecast required in Xerces2; SAXParser doesn't inheret XMLReader
- // %OPT% Cast at asignment?
- ((XMLReader)fIncrementalParser).setDTDHandler(handler);
- }
-
- //================================================================
- /** startParse() is a simple API which tells the IncrementalSAXSource
- * to begin reading a document.
- *
- * @throws SAXException is parse thread is already in progress
- * or parsing can not be started.
- * */
- public void startParse(InputSource source) throws SAXException
- {
- if (fIncrementalParser==null)
- throw new SAXException(XMLMessages.createXMLMessage(XMLErrorResources.ER_STARTPARSE_NEEDS_SAXPARSER, null)); //"startParse needs a non-null SAXParser.");
- if (fParseInProgress)
- throw new SAXException(XMLMessages.createXMLMessage(XMLErrorResources.ER_STARTPARSE_WHILE_PARSING, null)); //"startParse may not be called while parsing.");
-
- boolean ok=false;
-
- try
- {
- ok = parseSomeSetup(source);
- }
- catch(Exception ex)
- {
- throw new SAXException(ex);
- }
-
- if(!ok)
- throw new SAXException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COULD_NOT_INIT_PARSER, null)); //"could not initialize parser with");
- }
-
-
- /** deliverMoreNodes() is a simple API which tells the coroutine
- * parser that we need more nodes. This is intended to be called
- * from one of our partner routines, and serves to encapsulate the
- * details of how incremental parsing has been achieved.
- *
- * @param parsemore If true, tells the incremental parser to generate
- * another chunk of output. If false, tells the parser that we're
- * satisfied and it can terminate parsing of this document.
- * @return Boolean.TRUE if the CoroutineParser believes more data may be available
- * for further parsing. Boolean.FALSE if parsing ran to completion.
- * Exception if the parser objected for some reason.
- * */
- public Object deliverMoreNodes (boolean parsemore)
- {
- if(!parsemore)
- {
- fParseInProgress=false;
- return Boolean.FALSE;
- }
-
- Object arg;
- try {
- boolean keepgoing = parseSome();
- arg = keepgoing ? Boolean.TRUE : Boolean.FALSE;
- } catch (SAXException ex) {
- arg = ex;
- } catch (IOException ex) {
- arg = ex;
- } catch (Exception ex) {
- arg = new SAXException(ex);
- }
- return arg;
- }
-
- // Private methods -- conveniences to hide the reflection details
- private boolean parseSomeSetup(InputSource source)
- throws SAXException, IOException, IllegalAccessException,
- java.lang.reflect.InvocationTargetException,
- java.lang.InstantiationException
- {
- if(fConfigSetInput!=null)
- {
- // Obtain input from SAX inputSource object, construct XNI version of
- // that object. Logic adapted from Xerces2.
- Object[] parms1={source.getPublicId(),source.getSystemId(),null};
- Object xmlsource=fConfigInputSourceCtor.newInstance(parms1);
- Object[] parmsa={source.getByteStream()};
- fConfigSetByteStream.invoke(xmlsource,parmsa);
- parmsa[0]=source.getCharacterStream();
- fConfigSetCharStream.invoke(xmlsource,parmsa);
- parmsa[0]=source.getEncoding();
- fConfigSetEncoding.invoke(xmlsource,parmsa);
-
- // Bugzilla5272 patch suggested by Sandy Gao.
- // Has to be reflection to run with Xerces2
- // after compilation against Xerces1. or vice
- // versa, due to return type mismatches.
- Object[] noparms=new Object[0];
- fReset.invoke(fIncrementalParser,noparms);
-
- parmsa[0]=xmlsource;
- fConfigSetInput.invoke(fPullParserConfig,parmsa);
-
- // %REVIEW% Do first pull. Should we instead just return true?
- return parseSome();
- }
- else
- {
- Object[] parm={source};
- Object ret=fParseSomeSetup.invoke(fIncrementalParser,parm);
- return ((Boolean)ret).booleanValue();
- }
- }
-// Would null work???
- private static final Object[] noparms=new Object[0];
- private static final Object[] parmsfalse={Boolean.FALSE};
- private boolean parseSome()
- throws SAXException, IOException, IllegalAccessException,
- java.lang.reflect.InvocationTargetException
- {
- // Take next parsing step, return false iff parsing complete:
- if(fConfigSetInput!=null)
- {
- Object ret=(Boolean)(fConfigParse.invoke(fPullParserConfig,parmsfalse));
- return ((Boolean)ret).booleanValue();
- }
- else
- {
- Object ret=fParseSome.invoke(fIncrementalParser,noparms);
- return ((Boolean)ret).booleanValue();
- }
- }
-
-
- //================================================================
- /** Simple unit test. Attempt coroutine parsing of document indicated
- * by first argument (as a URI), report progress.
- */
- public static void _main(String args[])
- {
- System.out.println("Starting...");
-
- CoroutineManager co = new CoroutineManager();
- int appCoroutineID = co.co_joinCoroutineSet(-1);
- if (appCoroutineID == -1)
- {
- System.out.println("ERROR: Couldn't allocate coroutine number.\n");
- return;
- }
- IncrementalSAXSource parser=
- createIncrementalSAXSource();
-
- // Use a serializer as our sample output
- com.sun.org.apache.xml.internal.serialize.XMLSerializer trace;
- trace=new com.sun.org.apache.xml.internal.serialize.XMLSerializer(System.out,null);
- parser.setContentHandler(trace);
- parser.setLexicalHandler(trace);
-
- // Tell coroutine to begin parsing, run while parsing is in progress
-
- for(int arg=0;arg<args.length;++arg)
- {
- try
- {
- InputSource source = new InputSource(args[arg]);
- Object result=null;
- boolean more=true;
- parser.startParse(source);
- for(result = parser.deliverMoreNodes(more);
- result==Boolean.TRUE;
- result = parser.deliverMoreNodes(more))
- {
- System.out.println("\nSome parsing successful, trying more.\n");
-
- // Special test: Terminate parsing early.
- if(arg+1<args.length && "!".equals(args[arg+1]))
- {
- ++arg;
- more=false;
- }
-
- }
-
- if (result instanceof Boolean && ((Boolean)result)==Boolean.FALSE)
- {
- System.out.println("\nParser ended (EOF or on request).\n");
- }
- else if (result == null) {
- System.out.println("\nUNEXPECTED: Parser says shut down prematurely.\n");
- }
- else if (result instanceof Exception) {
- throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException((Exception)result);
- // System.out.println("\nParser threw exception:");
- // ((Exception)result).printStackTrace();
- }
-
- }
-
- catch(SAXException e)
- {
- e.printStackTrace();
- }
- }
-
- }
-
-
-} // class IncrementalSAXSource_Xerces
diff --git a/src/com/sun/org/apache/xml/internal/dtm/ref/NodeLocator.java b/src/com/sun/org/apache/xml/internal/dtm/ref/NodeLocator.java
deleted file mode 100644
index 2987dfd..0000000
--- a/src/com/sun/org/apache/xml/internal/dtm/ref/NodeLocator.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: NodeLocator.java,v 1.2.4.1 2005/09/15 08:15:08 suresh_emailid Exp $
- */
-
-package com.sun.org.apache.xml.internal.dtm.ref;
-
-import javax.xml.transform.SourceLocator;
-
-/**
- * <code>NodeLocator</code> maintains information on an XML source
- * node.
- *
- * @author <a href="mailto:ovidiu@cup.hp.com">Ovidiu Predescu</a>
- * @since May 23, 2001
- */
-public class NodeLocator implements SourceLocator
-{
- protected String m_publicId;
- protected String m_systemId;
- protected int m_lineNumber;
- protected int m_columnNumber;
-
- /**
- * Creates a new <code>NodeLocator</code> instance.
- *
- * @param publicId a <code>String</code> value
- * @param systemId a <code>String</code> value
- * @param lineNumber an <code>int</code> value
- * @param columnNumber an <code>int</code> value
- */
- public NodeLocator(String publicId, String systemId,
- int lineNumber, int columnNumber)
- {
- this.m_publicId = publicId;
- this.m_systemId = systemId;
- this.m_lineNumber = lineNumber;
- this.m_columnNumber = columnNumber;
- }
-
- /**
- * <code>getPublicId</code> returns the public ID of the node.
- *
- * @return a <code>String</code> value
- */
- public String getPublicId()
- {
- return m_publicId;
- }
-
- /**
- * <code>getSystemId</code> returns the system ID of the node.
- *
- * @return a <code>String</code> value
- */
- public String getSystemId()
- {
- return m_systemId;
- }
-
- /**
- * <code>getLineNumber</code> returns the line number of the node.
- *
- * @return an <code>int</code> value
- */
- public int getLineNumber()
- {
- return m_lineNumber;
- }
-
- /**
- * <code>getColumnNumber</code> returns the column number of the
- * node.
- *
- * @return an <code>int</code> value
- */
- public int getColumnNumber()
- {
- return m_columnNumber;
- }
-
- /**
- * <code>toString</code> returns a string representation of this
- * NodeLocator instance.
- *
- * @return a <code>String</code> value
- */
- public String toString()
- {
- return "file '" + m_systemId
- + "', line #" + m_lineNumber
- + ", column #" + m_columnNumber;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/dtm/ref/dom2dtm/DOM2DTM.java b/src/com/sun/org/apache/xml/internal/dtm/ref/dom2dtm/DOM2DTM.java
deleted file mode 100644
index 0e871e0..0000000
--- a/src/com/sun/org/apache/xml/internal/dtm/ref/dom2dtm/DOM2DTM.java
+++ /dev/null
@@ -1,1765 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DOM2DTM.java,v 1.2.4.1 2005/09/15 08:15:10 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.dtm.ref.dom2dtm;
-
-import java.util.Vector;
-
-import javax.xml.transform.SourceLocator;
-import javax.xml.transform.dom.DOMSource;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMManager;
-import com.sun.org.apache.xml.internal.dtm.DTMWSFilter;
-import com.sun.org.apache.xml.internal.dtm.ref.DTMDefaultBaseIterators;
-import com.sun.org.apache.xml.internal.dtm.ref.DTMManagerDefault;
-import com.sun.org.apache.xml.internal.dtm.ref.ExpandedNameTable;
-import com.sun.org.apache.xml.internal.dtm.ref.IncrementalSAXSource;
-import com.sun.org.apache.xml.internal.res.XMLErrorResources;
-import com.sun.org.apache.xml.internal.res.XMLMessages;
-import com.sun.org.apache.xml.internal.utils.FastStringBuffer;
-import com.sun.org.apache.xml.internal.utils.QName;
-import com.sun.org.apache.xml.internal.utils.StringBufferPool;
-import com.sun.org.apache.xml.internal.utils.TreeWalker;
-import com.sun.org.apache.xml.internal.utils.XMLCharacterRecognizer;
-import com.sun.org.apache.xml.internal.utils.XMLString;
-import com.sun.org.apache.xml.internal.utils.XMLStringFactory;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.Entity;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.xml.sax.ContentHandler;
-
-/** The <code>DOM2DTM</code> class serves up a DOM's contents via the
- * DTM API.
- *
- * Note that it doesn't necessarily represent a full Document
- * tree. You can wrap a DOM2DTM around a specific node and its subtree
- * and the right things should happen. (I don't _think_ we currently
- * support DocumentFrgment nodes as roots, though that might be worth
- * considering.)
- *
- * Note too that we do not currently attempt to track document
- * mutation. If you alter the DOM after wrapping DOM2DTM around it,
- * all bets are off.
- * */
-public class DOM2DTM extends DTMDefaultBaseIterators
-{
- static final boolean JJK_DEBUG=false;
- static final boolean JJK_NEWCODE=true;
-
- /** Manefest constant
- */
- static final String NAMESPACE_DECL_NS="http://www.w3.org/XML/1998/namespace";
-
- /** The current position in the DOM tree. Last node examined for
- * possible copying to DTM. */
- transient private Node m_pos;
- /** The current position in the DTM tree. Who children get appended to. */
- private int m_last_parent=0;
- /** The current position in the DTM tree. Who children reference as their
- * previous sib. */
- private int m_last_kid=NULL;
-
- /** The top of the subtree.
- * %REVIEW%: 'may not be the same as m_context if "//foo" pattern.'
- * */
- transient private Node m_root;
-
- /** True iff the first element has been processed. This is used to control
- synthesis of the implied xml: namespace declaration node. */
- boolean m_processedFirstElement=false;
-
- /** true if ALL the nodes in the m_root subtree have been processed;
- * false if our incremental build has not yet finished scanning the
- * DOM tree. */
- transient private boolean m_nodesAreProcessed;
-
- /** The node objects. The instance part of the handle indexes
- * directly into this vector. Each DTM node may actually be
- * composed of several DOM nodes (for example, if logically-adjacent
- * Text/CDATASection nodes in the DOM have been coalesced into a
- * single DTM Text node); this table points only to the first in
- * that sequence. */
- protected Vector m_nodes = new Vector();
-
- /**
- * Construct a DOM2DTM object from a DOM node.
- *
- * @param mgr The DTMManager who owns this DTM.
- * @param domSource the DOM source that this DTM will wrap.
- * @param dtmIdentity The DTM identity ID for this DTM.
- * @param whiteSpaceFilter The white space filter for this DTM, which may
- * be null.
- * @param xstringfactory XMLString factory for creating character content.
- * @param doIndexing true if the caller considers it worth it to use
- * indexing schemes.
- */
- public DOM2DTM(DTMManager mgr, DOMSource domSource,
- int dtmIdentity, DTMWSFilter whiteSpaceFilter,
- XMLStringFactory xstringfactory,
- boolean doIndexing)
- {
- super(mgr, domSource, dtmIdentity, whiteSpaceFilter,
- xstringfactory, doIndexing);
-
- // Initialize DOM navigation
- m_pos=m_root = domSource.getNode();
- // Initialize DTM navigation
- m_last_parent=m_last_kid=NULL;
- m_last_kid=addNode(m_root, m_last_parent,m_last_kid, NULL);
-
- // Apparently the domSource root may not actually be the
- // Document node. If it's an Element node, we need to immediately
- // add its attributes. Adapted from nextNode().
- // %REVIEW% Move this logic into addNode and recurse? Cleaner!
- //
- // (If it's an EntityReference node, we're probably scrod. For now
- // I'm just hoping nobody is ever quite that foolish... %REVIEW%)
- //
- // %ISSUE% What about inherited namespaces in this case?
- // Do we need to special-case initialize them into the DTM model?
- if(ELEMENT_NODE == m_root.getNodeType())
- {
- NamedNodeMap attrs=m_root.getAttributes();
- int attrsize=(attrs==null) ? 0 : attrs.getLength();
- if(attrsize>0)
- {
- int attrIndex=NULL; // start with no previous sib
- for(int i=0;i<attrsize;++i)
- {
- // No need to force nodetype in this case;
- // addNode() will take care of switching it from
- // Attr to Namespace if necessary.
- attrIndex=addNode(attrs.item(i),0,attrIndex,NULL);
- m_firstch.setElementAt(DTM.NULL,attrIndex);
- }
- // Terminate list of attrs, and make sure they aren't
- // considered children of the element
- m_nextsib.setElementAt(DTM.NULL,attrIndex);
-
- // IMPORTANT: This does NOT change m_last_parent or m_last_kid!
- } // if attrs exist
- } //if(ELEMENT_NODE)
-
- // Initialize DTM-completed status
- m_nodesAreProcessed = false;
- }
-
- /**
- * Construct the node map from the node.
- *
- * @param node The node that is to be added to the DTM.
- * @param parentIndex The current parent index.
- * @param previousSibling The previous sibling index.
- * @param forceNodeType If not DTM.NULL, overrides the DOM node type.
- * Used to force nodes to Text rather than CDATASection when their
- * coalesced value includes ordinary Text nodes (current DTM behavior).
- *
- * @return The index identity of the node that was added.
- */
- protected int addNode(Node node, int parentIndex,
- int previousSibling, int forceNodeType)
- {
- int nodeIndex = m_nodes.size();
-
- // Have we overflowed a DTM Identity's addressing range?
- if(m_dtmIdent.size() == (nodeIndex>>>DTMManager.IDENT_DTM_NODE_BITS))
- {
- try
- {
- if(m_mgr==null)
- throw new ClassCastException();
-
- // Handle as Extended Addressing
- DTMManagerDefault mgrD=(DTMManagerDefault)m_mgr;
- int id=mgrD.getFirstFreeDTMID();
- mgrD.addDTM(this,id,nodeIndex);
- m_dtmIdent.addElement(id<<DTMManager.IDENT_DTM_NODE_BITS);
- }
- catch(ClassCastException e)
- {
- // %REVIEW% Wrong error message, but I've been told we're trying
- // not to add messages right not for I18N reasons.
- // %REVIEW% Should this be a Fatal Error?
- error(XMLMessages.createXMLMessage(XMLErrorResources.ER_NO_DTMIDS_AVAIL, null));//"No more DTM IDs are available";
- }
- }
-
- m_size++;
- // ensureSize(nodeIndex);
-
- int type;
- if(NULL==forceNodeType)
- type = node.getNodeType();
- else
- type=forceNodeType;
-
- // %REVIEW% The Namespace Spec currently says that Namespaces are
- // processed in a non-namespace-aware manner, by matching the
- // QName, even though there is in fact a namespace assigned to
- // these nodes in the DOM. If and when that changes, we will have
- // to consider whether we check the namespace-for-namespaces
- // rather than the node name.
- //
- // %TBD% Note that the DOM does not necessarily explicitly declare
- // all the namespaces it uses. DOM Level 3 will introduce a
- // namespace-normalization operation which reconciles that, and we
- // can request that users invoke it or otherwise ensure that the
- // tree is namespace-well-formed before passing the DOM to Xalan.
- // But if they don't, what should we do about it? We probably
- // don't want to alter the source DOM (and may not be able to do
- // so if it's read-only). The best available answer might be to
- // synthesize additional DTM Namespace Nodes that don't correspond
- // to DOM Attr Nodes.
- if (Node.ATTRIBUTE_NODE == type)
- {
- String name = node.getNodeName();
-
- if (name.startsWith("xmlns:") || name.equals("xmlns"))
- {
- type = DTM.NAMESPACE_NODE;
- }
- }
-
- m_nodes.addElement(node);
-
- m_firstch.setElementAt(NOTPROCESSED,nodeIndex);
- m_nextsib.setElementAt(NOTPROCESSED,nodeIndex);
- m_prevsib.setElementAt(previousSibling,nodeIndex);
- m_parent.setElementAt(parentIndex,nodeIndex);
-
- if(DTM.NULL != parentIndex &&
- type != DTM.ATTRIBUTE_NODE &&
- type != DTM.NAMESPACE_NODE)
- {
- // If the DTM parent had no children, this becomes its first child.
- if(NOTPROCESSED == m_firstch.elementAt(parentIndex))
- m_firstch.setElementAt(nodeIndex,parentIndex);
- }
-
- String nsURI = node.getNamespaceURI();
-
- // Deal with the difference between Namespace spec and XSLT
- // definitions of local name. (The former says PIs don't have
- // localnames; the latter says they do.)
- String localName = (type == Node.PROCESSING_INSTRUCTION_NODE) ?
- node.getNodeName() :
- node.getLocalName();
-
- // Hack to make DOM1 sort of work...
- if(((type == Node.ELEMENT_NODE) || (type == Node.ATTRIBUTE_NODE))
- && null == localName)
- localName = node.getNodeName(); // -sb
-
- ExpandedNameTable exnt = m_expandedNameTable;
-
- // %TBD% Nodes created with the old non-namespace-aware DOM
- // calls createElement() and createAttribute() will never have a
- // localname. That will cause their expandedNameID to be just the
- // nodeType... which will keep them from being matched
- // successfully by name. Since the DOM makes no promise that
- // those will participate in namespace processing, this is
- // officially accepted as Not Our Fault. But it might be nice to
- // issue a diagnostic message!
- if(node.getLocalName()==null &&
- (type==Node.ELEMENT_NODE || type==Node.ATTRIBUTE_NODE))
- {
- // warning("DOM 'level 1' node "+node.getNodeName()+" won't be mapped properly in DOM2DTM.");
- }
-
- int expandedNameID = (null != localName)
- ? exnt.getExpandedTypeID(nsURI, localName, type) :
- exnt.getExpandedTypeID(type);
-
- m_exptype.setElementAt(expandedNameID,nodeIndex);
-
- indexNode(expandedNameID, nodeIndex);
-
- if (DTM.NULL != previousSibling)
- m_nextsib.setElementAt(nodeIndex,previousSibling);
-
- // This should be done after m_exptype has been set, and probably should
- // always be the last thing we do
- if (type == DTM.NAMESPACE_NODE)
- declareNamespaceInContext(parentIndex,nodeIndex);
-
- return nodeIndex;
- }
-
- /**
- * Get the number of nodes that have been added.
- */
- public int getNumberOfNodes()
- {
- return m_nodes.size();
- }
-
- /**
- * This method iterates to the next node that will be added to the table.
- * Each call to this method adds a new node to the table, unless the end
- * is reached, in which case it returns null.
- *
- * @return The true if a next node is found or false if
- * there are no more nodes.
- */
- protected boolean nextNode()
- {
- // Non-recursive one-fetch-at-a-time depth-first traversal with
- // attribute/namespace nodes and white-space stripping.
- // Navigating the DOM is simple, navigating the DTM is simple;
- // keeping track of both at once is a trifle baroque but at least
- // we've avoided most of the special cases.
- if (m_nodesAreProcessed)
- return false;
-
- // %REVIEW% Is this local copy Really Useful from a performance
- // point of view? Or is this a false microoptimization?
- Node pos=m_pos;
- Node next=null;
- int nexttype=NULL;
-
- // Navigate DOM tree
- do
- {
- // Look down to first child.
- if (pos.hasChildNodes())
- {
- next = pos.getFirstChild();
-
- // %REVIEW% There's probably a more elegant way to skip
- // the doctype. (Just let it go and Suppress it?
- if(next!=null && DOCUMENT_TYPE_NODE==next.getNodeType())
- next=next.getNextSibling();
-
- // Push DTM context -- except for children of Entity References,
- // which have no DTM equivalent and cause no DTM navigation.
- if(ENTITY_REFERENCE_NODE!=pos.getNodeType())
- {
- m_last_parent=m_last_kid;
- m_last_kid=NULL;
- // Whitespace-handler context stacking
- if(null != m_wsfilter)
- {
- short wsv =
- m_wsfilter.getShouldStripSpace(makeNodeHandle(m_last_parent),this);
- boolean shouldStrip = (DTMWSFilter.INHERIT == wsv)
- ? getShouldStripWhitespace()
- : (DTMWSFilter.STRIP == wsv);
- pushShouldStripWhitespace(shouldStrip);
- } // if(m_wsfilter)
- }
- }
-
- // If that fails, look up and right (but not past root!)
- else
- {
- if(m_last_kid!=NULL)
- {
- // Last node posted at this level had no more children
- // If it has _no_ children, we need to record that.
- if(m_firstch.elementAt(m_last_kid)==NOTPROCESSED)
- m_firstch.setElementAt(NULL,m_last_kid);
- }
-
- while(m_last_parent != NULL)
- {
- // %REVIEW% There's probably a more elegant way to
- // skip the doctype. (Just let it go and Suppress it?
- next = pos.getNextSibling();
- if(next!=null && DOCUMENT_TYPE_NODE==next.getNodeType())
- next=next.getNextSibling();
-
- if(next!=null)
- break; // Found it!
-
- // No next-sibling found. Pop the DOM.
- pos=pos.getParentNode();
- if(pos==null)
- {
- // %TBD% Should never arise, but I want to be sure of that...
- if(JJK_DEBUG)
- {
- System.out.println("***** DOM2DTM Pop Control Flow problem");
- for(;;); // Freeze right here!
- }
- }
-
- // The only parents in the DTM are Elements. However,
- // the DOM could contain EntityReferences. If we
- // encounter one, pop it _without_ popping DTM.
- if(pos!=null && ENTITY_REFERENCE_NODE == pos.getNodeType())
- {
- // Nothing needs doing
- if(JJK_DEBUG)
- System.out.println("***** DOM2DTM popping EntRef");
- }
- else
- {
- popShouldStripWhitespace();
- // Fix and pop DTM
- if(m_last_kid==NULL)
- m_firstch.setElementAt(NULL,m_last_parent); // Popping from an element
- else
- m_nextsib.setElementAt(NULL,m_last_kid); // Popping from anything else
- m_last_parent=m_parent.elementAt(m_last_kid=m_last_parent);
- }
- }
- if(m_last_parent==NULL)
- next=null;
- }
-
- if(next!=null)
- nexttype=next.getNodeType();
-
- // If it's an entity ref, advance past it.
- //
- // %REVIEW% Should we let this out the door and just suppress it?
- // More work, but simpler code, more likely to be correct, and
- // it doesn't happen very often. We'd get rid of the loop too.
- if (ENTITY_REFERENCE_NODE == nexttype)
- pos=next;
- }
- while (ENTITY_REFERENCE_NODE == nexttype);
-
- // Did we run out of the tree?
- if(next==null)
- {
- m_nextsib.setElementAt(NULL,0);
- m_nodesAreProcessed = true;
- m_pos=null;
-
- if(JJK_DEBUG)
- {
- System.out.println("***** DOM2DTM Crosscheck:");
- for(int i=0;i<m_nodes.size();++i)
- System.out.println(i+":\t"+m_firstch.elementAt(i)+"\t"+m_nextsib.elementAt(i));
- }
-
- return false;
- }
-
- // Text needs some special handling:
- //
- // DTM may skip whitespace. This is handled by the suppressNode flag, which
- // when true will keep the DTM node from being created.
- //
- // DTM only directly records the first DOM node of any logically-contiguous
- // sequence. The lastTextNode value will be set to the last node in the
- // contiguous sequence, and -- AFTER the DTM addNode -- can be used to
- // advance next over this whole block. Should be simpler than special-casing
- // the above loop for "Was the logically-preceeding sibling a text node".
- //
- // Finally, a DTM node should be considered a CDATASection only if all the
- // contiguous text it covers is CDATASections. The first Text should
- // force DTM to Text.
-
- boolean suppressNode=false;
- Node lastTextNode=null;
-
- nexttype=next.getNodeType();
-
- // nexttype=pos.getNodeType();
- if(TEXT_NODE == nexttype || CDATA_SECTION_NODE == nexttype)
- {
- // If filtering, initially assume we're going to suppress the node
- suppressNode=((null != m_wsfilter) && getShouldStripWhitespace());
-
- // Scan logically contiguous text (siblings, plus "flattening"
- // of entity reference boundaries).
- Node n=next;
- while(n!=null)
- {
- lastTextNode=n;
- // Any Text node means DTM considers it all Text
- if(TEXT_NODE == n.getNodeType())
- nexttype=TEXT_NODE;
- // Any non-whitespace in this sequence blocks whitespace
- // suppression
- suppressNode &=
- XMLCharacterRecognizer.isWhiteSpace(n.getNodeValue());
-
- n=logicalNextDOMTextNode(n);
- }
- }
-
- // Special handling for PIs: Some DOMs represent the XML
- // Declaration as a PI. This is officially incorrect, per the DOM
- // spec, but is considered a "wrong but tolerable" temporary
- // workaround pending proper handling of these fields in DOM Level
- // 3. We want to recognize and reject that case.
- else if(PROCESSING_INSTRUCTION_NODE==nexttype)
- {
- suppressNode = (pos.getNodeName().toLowerCase().equals("xml"));
- }
-
-
- if(!suppressNode)
- {
- // Inserting next. NOTE that we force the node type; for
- // coalesced Text, this records CDATASections adjacent to
- // ordinary Text as Text.
- int nextindex=addNode(next,m_last_parent,m_last_kid,
- nexttype);
-
- m_last_kid=nextindex;
-
- if(ELEMENT_NODE == nexttype)
- {
- int attrIndex=NULL; // start with no previous sib
- // Process attributes _now_, rather than waiting.
- // Simpler control flow, makes NS cache available immediately.
- NamedNodeMap attrs=next.getAttributes();
- int attrsize=(attrs==null) ? 0 : attrs.getLength();
- if(attrsize>0)
- {
- for(int i=0;i<attrsize;++i)
- {
- // No need to force nodetype in this case;
- // addNode() will take care of switching it from
- // Attr to Namespace if necessary.
- attrIndex=addNode(attrs.item(i),
- nextindex,attrIndex,NULL);
- m_firstch.setElementAt(DTM.NULL,attrIndex);
-
- // If the xml: prefix is explicitly declared
- // we don't need to synthesize one.
- //
- // NOTE that XML Namespaces were not originally
- // defined as being namespace-aware (grrr), and
- // while the W3C is planning to fix this it's
- // safer for now to test the QName and trust the
- // parsers to prevent anyone from redefining the
- // reserved xmlns: prefix
- if(!m_processedFirstElement
- && "xmlns:xml".equals(attrs.item(i).getNodeName()))
- m_processedFirstElement=true;
- }
- // Terminate list of attrs, and make sure they aren't
- // considered children of the element
- } // if attrs exist
- if(!m_processedFirstElement)
- {
- // The DOM might not have an explicit declaration for the
- // implicit "xml:" prefix, but the XPath data model
- // requires that this appear as a Namespace Node so we
- // have to synthesize one. You can think of this as
- // being a default attribute defined by the XML
- // Namespaces spec rather than by the DTD.
- attrIndex=addNode(new DOM2DTMdefaultNamespaceDeclarationNode(
- (Element)next,"xml",NAMESPACE_DECL_NS,
- makeNodeHandle(((attrIndex==NULL)?nextindex:attrIndex)+1)
- ),
- nextindex,attrIndex,NULL);
- m_firstch.setElementAt(DTM.NULL,attrIndex);
- m_processedFirstElement=true;
- }
- if(attrIndex!=NULL)
- m_nextsib.setElementAt(DTM.NULL,attrIndex);
- } //if(ELEMENT_NODE)
- } // (if !suppressNode)
-
- // Text postprocessing: Act on values stored above
- if(TEXT_NODE == nexttype || CDATA_SECTION_NODE == nexttype)
- {
- // %TBD% If nexttype was forced to TEXT, patch the DTM node
-
- next=lastTextNode; // Advance the DOM cursor over contiguous text
- }
-
- // Remember where we left off.
- m_pos=next;
- return true;
- }
-
-
- /**
- * Return an DOM node for the given node.
- *
- * @param nodeHandle The node ID.
- *
- * @return A node representation of the DTM node.
- */
- public Node getNode(int nodeHandle)
- {
-
- int identity = makeNodeIdentity(nodeHandle);
-
- return (Node) m_nodes.elementAt(identity);
- }
-
- /**
- * Get a Node from an identity index.
- *
- * NEEDSDOC @param nodeIdentity
- *
- * NEEDSDOC ($objectName$) @return
- */
- protected Node lookupNode(int nodeIdentity)
- {
- return (Node) m_nodes.elementAt(nodeIdentity);
- }
-
- /**
- * Get the next node identity value in the list, and call the iterator
- * if it hasn't been added yet.
- *
- * @param identity The node identity (index).
- * @return identity+1, or DTM.NULL.
- */
- protected int getNextNodeIdentity(int identity)
- {
-
- identity += 1;
-
- if (identity >= m_nodes.size())
- {
- if (!nextNode())
- identity = DTM.NULL;
- }
-
- return identity;
- }
-
- /**
- * Get the handle from a Node.
- * <p>%OPT% This will be pretty slow.</p>
- *
- * <p>%OPT% An XPath-like search (walk up DOM to root, tracking path;
- * walk down DTM reconstructing path) might be considerably faster
- * on later nodes in large documents. That might also imply improving
- * this call to handle nodes which would be in this DTM but
- * have not yet been built, which might or might not be a Good Thing.</p>
- *
- * %REVIEW% This relies on being able to test node-identity via
- * object-identity. DTM2DOM proxying is a great example of a case where
- * that doesn't work. DOM Level 3 will provide the isSameNode() method
- * to fix that, but until then this is going to be flaky.
- *
- * @param node A node, which may be null.
- *
- * @return The node handle or <code>DTM.NULL</code>.
- */
- private int getHandleFromNode(Node node)
- {
- if (null != node)
- {
- int len = m_nodes.size();
- boolean isMore;
- int i = 0;
- do
- {
- for (; i < len; i++)
- {
- if (m_nodes.elementAt(i) == node)
- return makeNodeHandle(i);
- }
-
- isMore = nextNode();
-
- len = m_nodes.size();
-
- }
- while(isMore || i < len);
- }
-
- return DTM.NULL;
- }
-
- /** Get the handle from a Node. This is a more robust version of
- * getHandleFromNode, intended to be usable by the public.
- *
- * <p>%OPT% This will be pretty slow.</p>
- *
- * %REVIEW% This relies on being able to test node-identity via
- * object-identity. DTM2DOM proxying is a great example of a case where
- * that doesn't work. DOM Level 3 will provide the isSameNode() method
- * to fix that, but until then this is going to be flaky.
- *
- * @param node A node, which may be null.
- *
- * @return The node handle or <code>DTM.NULL</code>. */
- public int getHandleOfNode(Node node)
- {
- if (null != node)
- {
- // Is Node actually within the same document? If not, don't search!
- // This would be easier if m_root was always the Document node, but
- // we decided to allow wrapping a DTM around a subtree.
- if((m_root==node) ||
- (m_root.getNodeType()==DOCUMENT_NODE &&
- m_root==node.getOwnerDocument()) ||
- (m_root.getNodeType()!=DOCUMENT_NODE &&
- m_root.getOwnerDocument()==node.getOwnerDocument())
- )
- {
- // If node _is_ in m_root's tree, find its handle
- //
- // %OPT% This check may be improved significantly when DOM
- // Level 3 nodeKey and relative-order tests become
- // available!
- for(Node cursor=node;
- cursor!=null;
- cursor=
- (cursor.getNodeType()!=ATTRIBUTE_NODE)
- ? cursor.getParentNode()
- : ((org.w3c.dom.Attr)cursor).getOwnerElement())
- {
- if(cursor==m_root)
- // We know this node; find its handle.
- return getHandleFromNode(node);
- } // for ancestors of node
- } // if node and m_root in same Document
- } // if node!=null
-
- return DTM.NULL;
- }
-
- /**
- * Retrieves an attribute node by by qualified name and namespace URI.
- *
- * @param nodeHandle int Handle of the node upon which to look up this attribute..
- * @param namespaceURI The namespace URI of the attribute to
- * retrieve, or null.
- * @param name The local name of the attribute to
- * retrieve.
- * @return The attribute node handle with the specified name (
- * <code>nodeName</code>) or <code>DTM.NULL</code> if there is no such
- * attribute.
- */
- public int getAttributeNode(int nodeHandle, String namespaceURI,
- String name)
- {
-
- // %OPT% This is probably slower than it needs to be.
- if (null == namespaceURI)
- namespaceURI = "";
-
- int type = getNodeType(nodeHandle);
-
- if (DTM.ELEMENT_NODE == type)
- {
-
- // Assume that attributes immediately follow the element.
- int identity = makeNodeIdentity(nodeHandle);
-
- while (DTM.NULL != (identity = getNextNodeIdentity(identity)))
- {
- // Assume this can not be null.
- type = _type(identity);
-
- // %REVIEW%
- // Should namespace nodes be retrievable DOM-style as attrs?
- // If not we need a separate function... which may be desirable
- // architecturally, but which is ugly from a code point of view.
- // (If we REALLY insist on it, this code should become a subroutine
- // of both -- retrieve the node, then test if the type matches
- // what you're looking for.)
- if (type == DTM.ATTRIBUTE_NODE || type==DTM.NAMESPACE_NODE)
- {
- Node node = lookupNode(identity);
- String nodeuri = node.getNamespaceURI();
-
- if (null == nodeuri)
- nodeuri = "";
-
- String nodelocalname = node.getLocalName();
-
- if (nodeuri.equals(namespaceURI) && name.equals(nodelocalname))
- return makeNodeHandle(identity);
- }
-
- else // if (DTM.NAMESPACE_NODE != type)
- {
- break;
- }
- }
- }
-
- return DTM.NULL;
- }
-
- /**
- * Get the string-value of a node as a String object
- * (see http://www.w3.org/TR/xpath#data-model
- * for the definition of a node's string-value).
- *
- * @param nodeHandle The node ID.
- *
- * @return A string object that represents the string-value of the given node.
- */
- public XMLString getStringValue(int nodeHandle)
- {
-
- int type = getNodeType(nodeHandle);
- Node node = getNode(nodeHandle);
- // %TBD% If an element only has one text node, we should just use it
- // directly.
- if(DTM.ELEMENT_NODE == type || DTM.DOCUMENT_NODE == type
- || DTM.DOCUMENT_FRAGMENT_NODE == type)
- {
- FastStringBuffer buf = StringBufferPool.get();
- String s;
-
- try
- {
- getNodeData(node, buf);
-
- s = (buf.length() > 0) ? buf.toString() : "";
- }
- finally
- {
- StringBufferPool.free(buf);
- }
-
- return m_xstrf.newstr( s );
- }
- else if(TEXT_NODE == type || CDATA_SECTION_NODE == type)
- {
- // If this is a DTM text node, it may be made of multiple DOM text
- // nodes -- including navigating into Entity References. DOM2DTM
- // records the first node in the sequence and requires that we
- // pick up the others when we retrieve the DTM node's value.
- //
- // %REVIEW% DOM Level 3 is expected to add a "whole text"
- // retrieval method which performs this function for us.
- FastStringBuffer buf = StringBufferPool.get();
- while(node!=null)
- {
- buf.append(node.getNodeValue());
- node=logicalNextDOMTextNode(node);
- }
- String s=(buf.length() > 0) ? buf.toString() : "";
- StringBufferPool.free(buf);
- return m_xstrf.newstr( s );
- }
- else
- return m_xstrf.newstr( node.getNodeValue() );
- }
-
- /**
- * Determine if the string-value of a node is whitespace
- *
- * @param nodeHandle The node Handle.
- *
- * @return Return true if the given node is whitespace.
- */
- public boolean isWhitespace(int nodeHandle)
- {
- int type = getNodeType(nodeHandle);
- Node node = getNode(nodeHandle);
- if(TEXT_NODE == type || CDATA_SECTION_NODE == type)
- {
- // If this is a DTM text node, it may be made of multiple DOM text
- // nodes -- including navigating into Entity References. DOM2DTM
- // records the first node in the sequence and requires that we
- // pick up the others when we retrieve the DTM node's value.
- //
- // %REVIEW% DOM Level 3 is expected to add a "whole text"
- // retrieval method which performs this function for us.
- FastStringBuffer buf = StringBufferPool.get();
- while(node!=null)
- {
- buf.append(node.getNodeValue());
- node=logicalNextDOMTextNode(node);
- }
- boolean b = buf.isWhitespace(0, buf.length());
- StringBufferPool.free(buf);
- return b;
- }
- return false;
- }
-
- /**
- * Retrieve the text content of a DOM subtree, appending it into a
- * user-supplied FastStringBuffer object. Note that attributes are
- * not considered part of the content of an element.
- * <p>
- * There are open questions regarding whitespace stripping.
- * Currently we make no special effort in that regard, since the standard
- * DOM doesn't yet provide DTD-based information to distinguish
- * whitespace-in-element-context from genuine #PCDATA. Note that we
- * should probably also consider xml:space if/when we address this.
- * DOM Level 3 may solve the problem for us.
- * <p>
- * %REVIEW% Actually, since this method operates on the DOM side of the
- * fence rather than the DTM side, it SHOULDN'T do
- * any special handling. The DOM does what the DOM does; if you want
- * DTM-level abstractions, use DTM-level methods.
- *
- * @param node Node whose subtree is to be walked, gathering the
- * contents of all Text or CDATASection nodes.
- * @param buf FastStringBuffer into which the contents of the text
- * nodes are to be concatenated.
- */
- protected static void getNodeData(Node node, FastStringBuffer buf)
- {
-
- switch (node.getNodeType())
- {
- case Node.DOCUMENT_FRAGMENT_NODE :
- case Node.DOCUMENT_NODE :
- case Node.ELEMENT_NODE :
- {
- for (Node child = node.getFirstChild(); null != child;
- child = child.getNextSibling())
- {
- getNodeData(child, buf);
- }
- }
- break;
- case Node.TEXT_NODE :
- case Node.CDATA_SECTION_NODE :
- case Node.ATTRIBUTE_NODE : // Never a child but might be our starting node
- buf.append(node.getNodeValue());
- break;
- case Node.PROCESSING_INSTRUCTION_NODE :
- // warning(XPATHErrorResources.WG_PARSING_AND_PREPARING);
- break;
- default :
- // ignore
- break;
- }
- }
-
- /**
- * Given a node handle, return its DOM-style node name. This will
- * include names such as #text or #document.
- *
- * @param nodeHandle the id of the node.
- * @return String Name of this node, which may be an empty string.
- * %REVIEW% Document when empty string is possible...
- * %REVIEW-COMMENT% It should never be empty, should it?
- */
- public String getNodeName(int nodeHandle)
- {
-
- Node node = getNode(nodeHandle);
-
- // Assume non-null.
- return node.getNodeName();
- }
-
- /**
- * Given a node handle, return the XPath node name. This should be
- * the name as described by the XPath data model, NOT the DOM-style
- * name.
- *
- * @param nodeHandle the id of the node.
- * @return String Name of this node, which may be an empty string.
- */
- public String getNodeNameX(int nodeHandle)
- {
-
- String name;
- short type = getNodeType(nodeHandle);
-
- switch (type)
- {
- case DTM.NAMESPACE_NODE :
- {
- Node node = getNode(nodeHandle);
-
- // assume not null.
- name = node.getNodeName();
- if(name.startsWith("xmlns:"))
- {
- name = QName.getLocalPart(name);
- }
- else if(name.equals("xmlns"))
- {
- name = "";
- }
- }
- break;
- case DTM.ATTRIBUTE_NODE :
- case DTM.ELEMENT_NODE :
- case DTM.ENTITY_REFERENCE_NODE :
- case DTM.PROCESSING_INSTRUCTION_NODE :
- {
- Node node = getNode(nodeHandle);
-
- // assume not null.
- name = node.getNodeName();
- }
- break;
- default :
- name = "";
- }
-
- return name;
- }
-
- /**
- * Given a node handle, return its XPath-style localname.
- * (As defined in Namespaces, this is the portion of the name after any
- * colon character).
- *
- * @param nodeHandle the id of the node.
- * @return String Local name of this node.
- */
- public String getLocalName(int nodeHandle)
- {
- if(JJK_NEWCODE)
- {
- int id=makeNodeIdentity(nodeHandle);
- if(NULL==id) return null;
- Node newnode=(Node)m_nodes.elementAt(id);
- String newname=newnode.getLocalName();
- if (null == newname)
- {
- // XSLT treats PIs, and possibly other things, as having QNames.
- String qname = newnode.getNodeName();
- if('#'==qname.charAt(0))
- {
- // Match old default for this function
- // This conversion may or may not be necessary
- newname="";
- }
- else
- {
- int index = qname.indexOf(':');
- newname = (index < 0) ? qname : qname.substring(index + 1);
- }
- }
- return newname;
- }
- else
- {
- String name;
- short type = getNodeType(nodeHandle);
- switch (type)
- {
- case DTM.ATTRIBUTE_NODE :
- case DTM.ELEMENT_NODE :
- case DTM.ENTITY_REFERENCE_NODE :
- case DTM.NAMESPACE_NODE :
- case DTM.PROCESSING_INSTRUCTION_NODE :
- {
- Node node = getNode(nodeHandle);
-
- // assume not null.
- name = node.getLocalName();
-
- if (null == name)
- {
- String qname = node.getNodeName();
- int index = qname.indexOf(':');
-
- name = (index < 0) ? qname : qname.substring(index + 1);
- }
- }
- break;
- default :
- name = "";
- }
- return name;
- }
- }
-
- /**
- * Given a namespace handle, return the prefix that the namespace decl is
- * mapping.
- * Given a node handle, return the prefix used to map to the namespace.
- *
- * <p> %REVIEW% Are you sure you want "" for no prefix? </p>
- * <p> %REVIEW-COMMENT% I think so... not totally sure. -sb </p>
- *
- * @param nodeHandle the id of the node.
- * @return String prefix of this node's name, or "" if no explicit
- * namespace prefix was given.
- */
- public String getPrefix(int nodeHandle)
- {
-
- String prefix;
- short type = getNodeType(nodeHandle);
-
- switch (type)
- {
- case DTM.NAMESPACE_NODE :
- {
- Node node = getNode(nodeHandle);
-
- // assume not null.
- String qname = node.getNodeName();
- int index = qname.indexOf(':');
-
- prefix = (index < 0) ? "" : qname.substring(index + 1);
- }
- break;
- case DTM.ATTRIBUTE_NODE :
- case DTM.ELEMENT_NODE :
- {
- Node node = getNode(nodeHandle);
-
- // assume not null.
- String qname = node.getNodeName();
- int index = qname.indexOf(':');
-
- prefix = (index < 0) ? "" : qname.substring(0, index);
- }
- break;
- default :
- prefix = "";
- }
-
- return prefix;
- }
-
- /**
- * Given a node handle, return its DOM-style namespace URI
- * (As defined in Namespaces, this is the declared URI which this node's
- * prefix -- or default in lieu thereof -- was mapped to.)
- *
- * <p>%REVIEW% Null or ""? -sb</p>
- *
- * @param nodeHandle the id of the node.
- * @return String URI value of this node's namespace, or null if no
- * namespace was resolved.
- */
- public String getNamespaceURI(int nodeHandle)
- {
- if(JJK_NEWCODE)
- {
- int id=makeNodeIdentity(nodeHandle);
- if(id==NULL) return null;
- Node node=(Node)m_nodes.elementAt(id);
- return node.getNamespaceURI();
- }
- else
- {
- String nsuri;
- short type = getNodeType(nodeHandle);
-
- switch (type)
- {
- case DTM.ATTRIBUTE_NODE :
- case DTM.ELEMENT_NODE :
- case DTM.ENTITY_REFERENCE_NODE :
- case DTM.NAMESPACE_NODE :
- case DTM.PROCESSING_INSTRUCTION_NODE :
- {
- Node node = getNode(nodeHandle);
-
- // assume not null.
- nsuri = node.getNamespaceURI();
-
- // %TBD% Handle DOM1?
- }
- break;
- default :
- nsuri = null;
- }
-
- return nsuri;
- }
-
- }
-
- /** Utility function: Given a DOM Text node, determine whether it is
- * logically followed by another Text or CDATASection node. This may
- * involve traversing into Entity References.
- *
- * %REVIEW% DOM Level 3 is expected to add functionality which may
- * allow us to retire this.
- */
- private Node logicalNextDOMTextNode(Node n)
- {
- Node p=n.getNextSibling();
- if(p==null)
- {
- // Walk out of any EntityReferenceNodes that ended with text
- for(n=n.getParentNode();
- n!=null && ENTITY_REFERENCE_NODE == n.getNodeType();
- n=n.getParentNode())
- {
- p=n.getNextSibling();
- if(p!=null)
- break;
- }
- }
- n=p;
- while(n!=null && ENTITY_REFERENCE_NODE == n.getNodeType())
- {
- // Walk into any EntityReferenceNodes that start with text
- if(n.hasChildNodes())
- n=n.getFirstChild();
- else
- n=n.getNextSibling();
- }
- if(n!=null)
- {
- // Found a logical next sibling. Is it text?
- int ntype=n.getNodeType();
- if(TEXT_NODE != ntype && CDATA_SECTION_NODE != ntype)
- n=null;
- }
- return n;
- }
-
- /**
- * Given a node handle, return its node value. This is mostly
- * as defined by the DOM, but may ignore some conveniences.
- * <p>
- *
- * @param nodeHandle The node id.
- * @return String Value of this node, or null if not
- * meaningful for this node type.
- */
- public String getNodeValue(int nodeHandle)
- {
- // The _type(nodeHandle) call was taking the lion's share of our
- // time, and was wrong anyway since it wasn't coverting handle to
- // identity. Inlined it.
- int type = _exptype(makeNodeIdentity(nodeHandle));
- type=(NULL != type) ? getNodeType(nodeHandle) : NULL;
-
- if(TEXT_NODE!=type && CDATA_SECTION_NODE!=type)
- return getNode(nodeHandle).getNodeValue();
-
- // If this is a DTM text node, it may be made of multiple DOM text
- // nodes -- including navigating into Entity References. DOM2DTM
- // records the first node in the sequence and requires that we
- // pick up the others when we retrieve the DTM node's value.
- //
- // %REVIEW% DOM Level 3 is expected to add a "whole text"
- // retrieval method which performs this function for us.
- Node node = getNode(nodeHandle);
- Node n=logicalNextDOMTextNode(node);
- if(n==null)
- return node.getNodeValue();
-
- FastStringBuffer buf = StringBufferPool.get();
- buf.append(node.getNodeValue());
- while(n!=null)
- {
- buf.append(n.getNodeValue());
- n=logicalNextDOMTextNode(n);
- }
- String s = (buf.length() > 0) ? buf.toString() : "";
- StringBufferPool.free(buf);
- return s;
- }
-
- /**
- * A document type declaration information item has the following properties:
- *
- * 1. [system identifier] The system identifier of the external subset, if
- * it exists. Otherwise this property has no value.
- *
- * @return the system identifier String object, or null if there is none.
- */
- public String getDocumentTypeDeclarationSystemIdentifier()
- {
-
- Document doc;
-
- if (m_root.getNodeType() == Node.DOCUMENT_NODE)
- doc = (Document) m_root;
- else
- doc = m_root.getOwnerDocument();
-
- if (null != doc)
- {
- DocumentType dtd = doc.getDoctype();
-
- if (null != dtd)
- {
- return dtd.getSystemId();
- }
- }
-
- return null;
- }
-
- /**
- * Return the public identifier of the external subset,
- * normalized as described in 4.2.2 External Entities [XML]. If there is
- * no external subset or if it has no public identifier, this property
- * has no value.
- *
- * @return the public identifier String object, or null if there is none.
- */
- public String getDocumentTypeDeclarationPublicIdentifier()
- {
-
- Document doc;
-
- if (m_root.getNodeType() == Node.DOCUMENT_NODE)
- doc = (Document) m_root;
- else
- doc = m_root.getOwnerDocument();
-
- if (null != doc)
- {
- DocumentType dtd = doc.getDoctype();
-
- if (null != dtd)
- {
- return dtd.getPublicId();
- }
- }
-
- return null;
- }
-
- /**
- * Returns the <code>Element</code> whose <code>ID</code> is given by
- * <code>elementId</code>. If no such element exists, returns
- * <code>DTM.NULL</code>. Behavior is not defined if more than one element
- * has this <code>ID</code>. Attributes (including those
- * with the name "ID") are not of type ID unless so defined by DTD/Schema
- * information available to the DTM implementation.
- * Implementations that do not know whether attributes are of type ID or
- * not are expected to return <code>DTM.NULL</code>.
- *
- * <p>%REVIEW% Presumably IDs are still scoped to a single document,
- * and this operation searches only within a single document, right?
- * Wouldn't want collisions between DTMs in the same process.</p>
- *
- * @param elementId The unique <code>id</code> value for an element.
- * @return The handle of the matching element.
- */
- public int getElementById(String elementId)
- {
-
- Document doc = (m_root.getNodeType() == Node.DOCUMENT_NODE)
- ? (Document) m_root : m_root.getOwnerDocument();
-
- if(null != doc)
- {
- Node elem = doc.getElementById(elementId);
- if(null != elem)
- {
- int elemHandle = getHandleFromNode(elem);
-
- if(DTM.NULL == elemHandle)
- {
- int identity = m_nodes.size()-1;
- while (DTM.NULL != (identity = getNextNodeIdentity(identity)))
- {
- Node node = getNode(identity);
- if(node == elem)
- {
- elemHandle = getHandleFromNode(elem);
- break;
- }
- }
- }
-
- return elemHandle;
- }
-
- }
- return DTM.NULL;
- }
-
- /**
- * The getUnparsedEntityURI function returns the URI of the unparsed
- * entity with the specified name in the same document as the context
- * node (see [3.3 Unparsed Entities]). It returns the empty string if
- * there is no such entity.
- * <p>
- * XML processors may choose to use the System Identifier (if one
- * is provided) to resolve the entity, rather than the URI in the
- * Public Identifier. The details are dependent on the processor, and
- * we would have to support some form of plug-in resolver to handle
- * this properly. Currently, we simply return the System Identifier if
- * present, and hope that it a usable URI or that our caller can
- * map it to one.
- * TODO: Resolve Public Identifiers... or consider changing function name.
- * <p>
- * If we find a relative URI
- * reference, XML expects it to be resolved in terms of the base URI
- * of the document. The DOM doesn't do that for us, and it isn't
- * entirely clear whether that should be done here; currently that's
- * pushed up to a higher level of our application. (Note that DOM Level
- * 1 didn't store the document's base URI.)
- * TODO: Consider resolving Relative URIs.
- * <p>
- * (The DOM's statement that "An XML processor may choose to
- * completely expand entities before the structure model is passed
- * to the DOM" refers only to parsed entities, not unparsed, and hence
- * doesn't affect this function.)
- *
- * @param name A string containing the Entity Name of the unparsed
- * entity.
- *
- * @return String containing the URI of the Unparsed Entity, or an
- * empty string if no such entity exists.
- */
- public String getUnparsedEntityURI(String name)
- {
-
- String url = "";
- Document doc = (m_root.getNodeType() == Node.DOCUMENT_NODE)
- ? (Document) m_root : m_root.getOwnerDocument();
-
- if (null != doc)
- {
- DocumentType doctype = doc.getDoctype();
-
- if (null != doctype)
- {
- NamedNodeMap entities = doctype.getEntities();
- if(null == entities)
- return url;
- Entity entity = (Entity) entities.getNamedItem(name);
- if(null == entity)
- return url;
-
- String notationName = entity.getNotationName();
-
- if (null != notationName) // then it's unparsed
- {
- // The draft says: "The XSLT processor may use the public
- // identifier to generate a URI for the entity instead of the URI
- // specified in the system identifier. If the XSLT processor does
- // not use the public identifier to generate the URI, it must use
- // the system identifier; if the system identifier is a relative
- // URI, it must be resolved into an absolute URI using the URI of
- // the resource containing the entity declaration as the base
- // URI [RFC2396]."
- // So I'm falling a bit short here.
- url = entity.getSystemId();
-
- if (null == url)
- {
- url = entity.getPublicId();
- }
- else
- {
- // This should be resolved to an absolute URL, but that's hard
- // to do from here.
- }
- }
- }
- }
-
- return url;
- }
-
- /**
- * 5. [specified] A flag indicating whether this attribute was actually
- * specified in the start-tag of its element, or was defaulted from the
- * DTD.
- *
- * @param attributeHandle the attribute handle
- * @return <code>true</code> if the attribute was specified;
- * <code>false</code> if it was defaulted.
- */
- public boolean isAttributeSpecified(int attributeHandle)
- {
- int type = getNodeType(attributeHandle);
-
- if (DTM.ATTRIBUTE_NODE == type)
- {
- Attr attr = (Attr)getNode(attributeHandle);
- return attr.getSpecified();
- }
- return false;
- }
-
- /** Bind an IncrementalSAXSource to this DTM. NOT RELEVANT for DOM2DTM, since
- * we're wrapped around an existing DOM.
- *
- * @param source The IncrementalSAXSource that we want to recieve events from
- * on demand.
- */
- public void setIncrementalSAXSource(IncrementalSAXSource source)
- {
- }
-
- /** getContentHandler returns "our SAX builder" -- the thing that
- * someone else should send SAX events to in order to extend this
- * DTM model.
- *
- * @return null if this model doesn't respond to SAX events,
- * "this" if the DTM object has a built-in SAX ContentHandler,
- * the IncrmentalSAXSource if we're bound to one and should receive
- * the SAX stream via it for incremental build purposes...
- * */
- public org.xml.sax.ContentHandler getContentHandler()
- {
- return null;
- }
-
- /**
- * Return this DTM's lexical handler.
- *
- * %REVIEW% Should this return null if constrution already done/begun?
- *
- * @return null if this model doesn't respond to lexical SAX events,
- * "this" if the DTM object has a built-in SAX ContentHandler,
- * the IncrementalSAXSource if we're bound to one and should receive
- * the SAX stream via it for incremental build purposes...
- */
- public org.xml.sax.ext.LexicalHandler getLexicalHandler()
- {
-
- return null;
- }
-
-
- /**
- * Return this DTM's EntityResolver.
- *
- * @return null if this model doesn't respond to SAX entity ref events.
- */
- public org.xml.sax.EntityResolver getEntityResolver()
- {
-
- return null;
- }
-
- /**
- * Return this DTM's DTDHandler.
- *
- * @return null if this model doesn't respond to SAX dtd events.
- */
- public org.xml.sax.DTDHandler getDTDHandler()
- {
-
- return null;
- }
-
- /**
- * Return this DTM's ErrorHandler.
- *
- * @return null if this model doesn't respond to SAX error events.
- */
- public org.xml.sax.ErrorHandler getErrorHandler()
- {
-
- return null;
- }
-
- /**
- * Return this DTM's DeclHandler.
- *
- * @return null if this model doesn't respond to SAX Decl events.
- */
- public org.xml.sax.ext.DeclHandler getDeclHandler()
- {
-
- return null;
- }
-
- /** @return true iff we're building this model incrementally (eg
- * we're partnered with a IncrementalSAXSource) and thus require that the
- * transformation and the parse run simultaneously. Guidance to the
- * DTMManager.
- * */
- public boolean needsTwoThreads()
- {
- return false;
- }
-
- // ========== Direct SAX Dispatch, for optimization purposes ========
-
- /**
- * Returns whether the specified <var>ch</var> conforms to the XML 1.0 definition
- * of whitespace. Refer to <A href="http://www.w3.org/TR/1998/REC-xml-19980210#NT-S">
- * the definition of <CODE>S</CODE></A> for details.
- * @param ch Character to check as XML whitespace.
- * @return =true if <var>ch</var> is XML whitespace; otherwise =false.
- */
- private static boolean isSpace(char ch)
- {
- return XMLCharacterRecognizer.isWhiteSpace(ch); // Take the easy way out for now.
- }
-
- /**
- * Directly call the
- * characters method on the passed ContentHandler for the
- * string-value of the given node (see http://www.w3.org/TR/xpath#data-model
- * for the definition of a node's string-value). Multiple calls to the
- * ContentHandler's characters methods may well occur for a single call to
- * this method.
- *
- * @param nodeHandle The node ID.
- * @param ch A non-null reference to a ContentHandler.
- *
- * @throws org.xml.sax.SAXException
- */
- public void dispatchCharactersEvents(
- int nodeHandle, org.xml.sax.ContentHandler ch,
- boolean normalize)
- throws org.xml.sax.SAXException
- {
- if(normalize)
- {
- XMLString str = getStringValue(nodeHandle);
- str = str.fixWhiteSpace(true, true, false);
- str.dispatchCharactersEvents(ch);
- }
- else
- {
- int type = getNodeType(nodeHandle);
- Node node = getNode(nodeHandle);
- dispatchNodeData(node, ch, 0);
- // Text coalition -- a DTM text node may represent multiple
- // DOM nodes.
- if(TEXT_NODE == type || CDATA_SECTION_NODE == type)
- {
- while( null != (node=logicalNextDOMTextNode(node)) )
- {
- dispatchNodeData(node, ch, 0);
- }
- }
- }
- }
-
- /**
- * Retrieve the text content of a DOM subtree, appending it into a
- * user-supplied FastStringBuffer object. Note that attributes are
- * not considered part of the content of an element.
- * <p>
- * There are open questions regarding whitespace stripping.
- * Currently we make no special effort in that regard, since the standard
- * DOM doesn't yet provide DTD-based information to distinguish
- * whitespace-in-element-context from genuine #PCDATA. Note that we
- * should probably also consider xml:space if/when we address this.
- * DOM Level 3 may solve the problem for us.
- * <p>
- * %REVIEW% Note that as a DOM-level operation, it can be argued that this
- * routine _shouldn't_ perform any processing beyond what the DOM already
- * does, and that whitespace stripping and so on belong at the DTM level.
- * If you want a stripped DOM view, wrap DTM2DOM around DOM2DTM.
- *
- * @param node Node whose subtree is to be walked, gathering the
- * contents of all Text or CDATASection nodes.
- */
- protected static void dispatchNodeData(Node node,
- org.xml.sax.ContentHandler ch,
- int depth)
- throws org.xml.sax.SAXException
- {
-
- switch (node.getNodeType())
- {
- case Node.DOCUMENT_FRAGMENT_NODE :
- case Node.DOCUMENT_NODE :
- case Node.ELEMENT_NODE :
- {
- for (Node child = node.getFirstChild(); null != child;
- child = child.getNextSibling())
- {
- dispatchNodeData(child, ch, depth+1);
- }
- }
- break;
- case Node.PROCESSING_INSTRUCTION_NODE : // %REVIEW%
- case Node.COMMENT_NODE :
- if(0 != depth)
- break;
- // NOTE: Because this operation works in the DOM space, it does _not_ attempt
- // to perform Text Coalition. That should only be done in DTM space.
- case Node.TEXT_NODE :
- case Node.CDATA_SECTION_NODE :
- case Node.ATTRIBUTE_NODE :
- String str = node.getNodeValue();
- if(ch instanceof CharacterNodeHandler)
- {
- ((CharacterNodeHandler)ch).characters(node);
- }
- else
- {
- ch.characters(str.toCharArray(), 0, str.length());
- }
- break;
-// /* case Node.PROCESSING_INSTRUCTION_NODE :
-// // warning(XPATHErrorResources.WG_PARSING_AND_PREPARING);
-// break; */
- default :
- // ignore
- break;
- }
- }
-
- TreeWalker m_walker = new TreeWalker(null);
-
- /**
- * Directly create SAX parser events from a subtree.
- *
- * @param nodeHandle The node ID.
- * @param ch A non-null reference to a ContentHandler.
- *
- * @throws org.xml.sax.SAXException
- */
- public void dispatchToEvents(int nodeHandle, org.xml.sax.ContentHandler ch)
- throws org.xml.sax.SAXException
- {
- TreeWalker treeWalker = m_walker;
- ContentHandler prevCH = treeWalker.getContentHandler();
-
- if(null != prevCH)
- {
- treeWalker = new TreeWalker(null);
- }
- treeWalker.setContentHandler(ch);
-
- try
- {
- Node node = getNode(nodeHandle);
- treeWalker.traverseFragment(node);
- }
- finally
- {
- treeWalker.setContentHandler(null);
- }
- }
-
- public interface CharacterNodeHandler
- {
- public void characters(Node node)
- throws org.xml.sax.SAXException;
- }
-
- /**
- * For the moment all the run time properties are ignored by this
- * class.
- *
- * @param property a <code>String</code> value
- * @param value an <code>Object</code> value
- */
- public void setProperty(String property, Object value)
- {
- }
-
- /**
- * No source information is available for DOM2DTM, so return
- * <code>null</code> here.
- *
- * @param node an <code>int</code> value
- * @return null
- */
- public SourceLocator getSourceLocatorFor(int node)
- {
- return null;
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/dtm/ref/dom2dtm/DOM2DTMdefaultNamespaceDeclarationNode.java b/src/com/sun/org/apache/xml/internal/dtm/ref/dom2dtm/DOM2DTMdefaultNamespaceDeclarationNode.java
deleted file mode 100644
index 68cafdd..0000000
--- a/src/com/sun/org/apache/xml/internal/dtm/ref/dom2dtm/DOM2DTMdefaultNamespaceDeclarationNode.java
+++ /dev/null
@@ -1,680 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DOM2DTMdefaultNamespaceDeclarationNode.java,v 1.2.4.1 2005/09/15 08:15:11 suresh_emailid Exp $
- */
-
-package com.sun.org.apache.xml.internal.dtm.ref.dom2dtm;
-
-import com.sun.org.apache.xml.internal.dtm.DTMException;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.TypeInfo;
-import org.w3c.dom.UserDataHandler;
-import org.w3c.dom.DOMException;
-
-/** This is a kluge to let us shove a declaration for xml: into the
- * DOM2DTM model. Basically, it creates a proxy node in DOM space to
- * carry the additional information. This is _NOT_ a full DOM
- * implementation, and shouldn't be one since it sits alongside the
- * DOM rather than becoming part of the DOM model.
- *
- * (This used to be an internal class within DOM2DTM. Moved out because
- * I need to perform an instanceof operation on it to support a temporary
- * workaround in DTMManagerDefault.)
- *
- * %REVIEW% What if the DOM2DTM was built around a DocumentFragment and
- * there isn't a single root element? I think this fails that case...
- *
- * %REVIEW% An alternative solution would be to create the node _only_
- * in DTM space, but given how DOM2DTM is currently written I think
- * this is simplest.
- * */
-public class DOM2DTMdefaultNamespaceDeclarationNode implements Attr,TypeInfo
-{
- final String NOT_SUPPORTED_ERR="Unsupported operation on pseudonode";
-
- Element pseudoparent;
- String prefix,uri,nodename;
- int handle;
- DOM2DTMdefaultNamespaceDeclarationNode(Element pseudoparent,String prefix,String uri,int handle)
- {
- this.pseudoparent=pseudoparent;
- this.prefix=prefix;
- this.uri=uri;
- this.handle=handle;
- this.nodename="xmlns:"+prefix;
- }
- public String getNodeName() {return nodename;}
- public String getName() {return nodename;}
- public String getNamespaceURI() {return "http://www.w3.org/2000/xmlns/";}
- public String getPrefix() {return prefix;}
- public String getLocalName() {return prefix;}
- public String getNodeValue() {return uri;}
- public String getValue() {return uri;}
- public Element getOwnerElement() {return pseudoparent;}
-
- public boolean isSupported(String feature, String version) {return false;}
- public boolean hasChildNodes() {return false;}
- public boolean hasAttributes() {return false;}
- public Node getParentNode() {return null;}
- public Node getFirstChild() {return null;}
- public Node getLastChild() {return null;}
- public Node getPreviousSibling() {return null;}
- public Node getNextSibling() {return null;}
- public boolean getSpecified() {return false;}
- public void normalize() {return;}
- public NodeList getChildNodes() {return null;}
- public NamedNodeMap getAttributes() {return null;}
- public short getNodeType() {return Node.ATTRIBUTE_NODE;}
- public void setNodeValue(String value) {throw new DTMException(NOT_SUPPORTED_ERR);}
- public void setValue(String value) {throw new DTMException(NOT_SUPPORTED_ERR);}
- public void setPrefix(String value) {throw new DTMException(NOT_SUPPORTED_ERR);}
- public Node insertBefore(Node a, Node b) {throw new DTMException(NOT_SUPPORTED_ERR);}
- public Node replaceChild(Node a, Node b) {throw new DTMException(NOT_SUPPORTED_ERR);}
- public Node appendChild(Node a) {throw new DTMException(NOT_SUPPORTED_ERR);}
- public Node removeChild(Node a) {throw new DTMException(NOT_SUPPORTED_ERR);}
- public Document getOwnerDocument() {return pseudoparent.getOwnerDocument();}
- public Node cloneNode(boolean deep) {throw new DTMException(NOT_SUPPORTED_ERR);}
-
- /** Non-DOM method, part of the temporary kluge
- * %REVIEW% This would be a pruning problem, but since it will always be
- * added to the root element and we prune on elements, we shouldn't have
- * to worry.
- */
- public int getHandleOfNode()
- {
- return handle;
- }
-
- //RAMESH: PENDING=> Add proper implementation for the below DOM L3 additions
-
- /**
- * @see org.w3c.dom.TypeInfo#getTypeName()
- */
- public String getTypeName() {return null; }
-
- /**
- * @see org.w3c.dom.TypeInfo#getTypeNamespace()
- */
- public String getTypeNamespace() { return null;}
-
- /**
- * @see or.gw3c.dom.TypeInfo#isDerivedFrom(String,String,int)
- */
- public boolean isDerivedFrom( String ns, String localName, int derivationMethod ) {
- return false;
- }
-
- public TypeInfo getSchemaTypeInfo() { return this; }
-
- public boolean isId( ) { return false; }
-
- /**
- * Associate an object to a key on this node. The object can later be
- * retrieved from this node by calling <code>getUserData</code> with the
- * same key.
- * @param key The key to associate the object to.
- * @param data The object to associate to the given key, or
- * <code>null</code> to remove any existing association to that key.
- * @param handler The handler to associate to that key, or
- * <code>null</code>.
- * @return Returns the <code>DOMObject</code> previously associated to
- * the given key on this node, or <code>null</code> if there was none.
- * @since DOM Level 3
- */
- public Object setUserData(String key,
- Object data,
- UserDataHandler handler) {
- return getOwnerDocument().setUserData( key, data, handler);
- }
-
- /**
- * Retrieves the object associated to a key on a this node. The object
- * must first have been set to this node by calling
- * <code>setUserData</code> with the same key.
- * @param key The key the object is associated to.
- * @return Returns the <code>DOMObject</code> associated to the given key
- * on this node, or <code>null</code> if there was none.
- * @since DOM Level 3
- */
- public Object getUserData(String key) {
- return getOwnerDocument().getUserData( key);
- }
-
- /**
- * This method returns a specialized object which implements the
- * specialized APIs of the specified feature and version. The
- * specialized object may also be obtained by using binding-specific
- * casting methods but is not necessarily expected to, as discussed in Mixed DOM implementations.
- * @param feature The name of the feature requested (case-insensitive).
- * @param version This is the version number of the feature to test. If
- * the version is <code>null</code> or the empty string, supporting
- * any version of the feature will cause the method to return an
- * object that supports at least one version of the feature.
- * @return Returns an object which implements the specialized APIs of
- * the specified feature and version, if any, or <code>null</code> if
- * there is no object which implements interfaces associated with that
- * feature. If the <code>DOMObject</code> returned by this method
- * implements the <code>Node</code> interface, it must delegate to the
- * primary core <code>Node</code> and not return results inconsistent
- * with the primary core <code>Node</code> such as attributes,
- * childNodes, etc.
- * @since DOM Level 3
- */
- public Object getFeature(String feature, String version) {
- // we don't have any alternate node, either this node does the job
- // or we don't have anything that does
- return isSupported(feature, version) ? this : null;
- }
-
- /**
- * Tests whether two nodes are equal.
- * <br>This method tests for equality of nodes, not sameness (i.e.,
- * whether the two nodes are references to the same object) which can be
- * tested with <code>Node.isSameNode</code>. All nodes that are the same
- * will also be equal, though the reverse may not be true.
- * <br>Two nodes are equal if and only if the following conditions are
- * satisfied: The two nodes are of the same type.The following string
- * attributes are equal: <code>nodeName</code>, <code>localName</code>,
- * <code>namespaceURI</code>, <code>prefix</code>, <code>nodeValue</code>
- * , <code>baseURI</code>. This is: they are both <code>null</code>, or
- * they have the same length and are character for character identical.
- * The <code>attributes</code> <code>NamedNodeMaps</code> are equal.
- * This is: they are both <code>null</code>, or they have the same
- * length and for each node that exists in one map there is a node that
- * exists in the other map and is equal, although not necessarily at the
- * same index.The <code>childNodes</code> <code>NodeLists</code> are
- * equal. This is: they are both <code>null</code>, or they have the
- * same length and contain equal nodes at the same index. This is true
- * for <code>Attr</code> nodes as for any other type of node. Note that
- * normalization can affect equality; to avoid this, nodes should be
- * normalized before being compared.
- * <br>For two <code>DocumentType</code> nodes to be equal, the following
- * conditions must also be satisfied: The following string attributes
- * are equal: <code>publicId</code>, <code>systemId</code>,
- * <code>internalSubset</code>.The <code>entities</code>
- * <code>NamedNodeMaps</code> are equal.The <code>notations</code>
- * <code>NamedNodeMaps</code> are equal.
- * <br>On the other hand, the following do not affect equality: the
- * <code>ownerDocument</code> attribute, the <code>specified</code>
- * attribute for <code>Attr</code> nodes, the
- * <code>isWhitespaceInElementContent</code> attribute for
- * <code>Text</code> nodes, as well as any user data or event listeners
- * registered on the nodes.
- * @param arg The node to compare equality with.
- * @param deep If <code>true</code>, recursively compare the subtrees; if
- * <code>false</code>, compare only the nodes themselves (and its
- * attributes, if it is an <code>Element</code>).
- * @return If the nodes, and possibly subtrees are equal,
- * <code>true</code> otherwise <code>false</code>.
- * @since DOM Level 3
- */
- public boolean isEqualNode(Node arg) {
- if (arg == this) {
- return true;
- }
- if (arg.getNodeType() != getNodeType()) {
- return false;
- }
- // in theory nodeName can't be null but better be careful
- // who knows what other implementations may be doing?...
- if (getNodeName() == null) {
- if (arg.getNodeName() != null) {
- return false;
- }
- }
- else if (!getNodeName().equals(arg.getNodeName())) {
- return false;
- }
-
- if (getLocalName() == null) {
- if (arg.getLocalName() != null) {
- return false;
- }
- }
- else if (!getLocalName().equals(arg.getLocalName())) {
- return false;
- }
-
- if (getNamespaceURI() == null) {
- if (arg.getNamespaceURI() != null) {
- return false;
- }
- }
- else if (!getNamespaceURI().equals(arg.getNamespaceURI())) {
- return false;
- }
-
- if (getPrefix() == null) {
- if (arg.getPrefix() != null) {
- return false;
- }
- }
- else if (!getPrefix().equals(arg.getPrefix())) {
- return false;
- }
-
- if (getNodeValue() == null) {
- if (arg.getNodeValue() != null) {
- return false;
- }
- }
- else if (!getNodeValue().equals(arg.getNodeValue())) {
- return false;
- }
- /*
- if (getBaseURI() == null) {
- if (((NodeImpl) arg).getBaseURI() != null) {
- return false;
- }
- }
- else if (!getBaseURI().equals(((NodeImpl) arg).getBaseURI())) {
- return false;
- }
-*/
-
- return true;
- }
-
- /**
- * DOM Level 3 - Experimental:
- * Look up the namespace URI associated to the given prefix, starting from this node.
- * Use lookupNamespaceURI(null) to lookup the default namespace
- *
- * @param namespaceURI
- * @return th URI for the namespace
- * @since DOM Level 3
- */
- public String lookupNamespaceURI(String specifiedPrefix) {
- short type = this.getNodeType();
- switch (type) {
- case Node.ELEMENT_NODE : {
-
- String namespace = this.getNamespaceURI();
- String prefix = this.getPrefix();
- if (namespace !=null) {
- // REVISIT: is it possible that prefix is empty string?
- if (specifiedPrefix== null && prefix==specifiedPrefix) {
- // looking for default namespace
- return namespace;
- } else if (prefix != null && prefix.equals(specifiedPrefix)) {
- // non default namespace
- return namespace;
- }
- }
- if (this.hasAttributes()) {
- NamedNodeMap map = this.getAttributes();
- int length = map.getLength();
- for (int i=0;i<length;i++) {
- Node attr = map.item(i);
- String attrPrefix = attr.getPrefix();
- String value = attr.getNodeValue();
- namespace = attr.getNamespaceURI();
- if (namespace !=null && namespace.equals("http://www.w3.org/2000/xmlns/")) {
- // at this point we are dealing with DOM Level 2 nodes only
- if (specifiedPrefix == null &&
- attr.getNodeName().equals("xmlns")) {
- // default namespace
- return value;
- } else if (attrPrefix !=null &&
- attrPrefix.equals("xmlns") &&
- attr.getLocalName().equals(specifiedPrefix)) {
- // non default namespace
- return value;
- }
- }
- }
- }
- /*
- NodeImpl ancestor = (NodeImpl)getElementAncestor(this);
- if (ancestor != null) {
- return ancestor.lookupNamespaceURI(specifiedPrefix);
- }
- */
-
- return null;
-
-
- }
-/*
- case Node.DOCUMENT_NODE : {
- return((NodeImpl)((Document)this).getDocumentElement()).lookupNamespaceURI(specifiedPrefix) ;
- }
-*/
- case Node.ENTITY_NODE :
- case Node.NOTATION_NODE:
- case Node.DOCUMENT_FRAGMENT_NODE:
- case Node.DOCUMENT_TYPE_NODE:
- // type is unknown
- return null;
- case Node.ATTRIBUTE_NODE:{
- if (this.getOwnerElement().getNodeType() == Node.ELEMENT_NODE) {
- return getOwnerElement().lookupNamespaceURI(specifiedPrefix);
-
- }
- return null;
- }
- default:{
- /*
- NodeImpl ancestor = (NodeImpl)getElementAncestor(this);
- if (ancestor != null) {
- return ancestor.lookupNamespaceURI(specifiedPrefix);
- }
- */
- return null;
- }
-
- }
- }
-
- /**
- * DOM Level 3: Experimental
- * This method checks if the specified <code>namespaceURI</code> is the
- * default namespace or not.
- * @param namespaceURI The namespace URI to look for.
- * @return <code>true</code> if the specified <code>namespaceURI</code>
- * is the default namespace, <code>false</code> otherwise.
- * @since DOM Level 3
- */
- public boolean isDefaultNamespace(String namespaceURI){
- /*
- // REVISIT: remove casts when DOM L3 becomes REC.
- short type = this.getNodeType();
- switch (type) {
- case Node.ELEMENT_NODE: {
- String namespace = this.getNamespaceURI();
- String prefix = this.getPrefix();
-
- // REVISIT: is it possible that prefix is empty string?
- if (prefix == null || prefix.length() == 0) {
- if (namespaceURI == null) {
- return (namespace == namespaceURI);
- }
- return namespaceURI.equals(namespace);
- }
- if (this.hasAttributes()) {
- ElementImpl elem = (ElementImpl)this;
- NodeImpl attr = (NodeImpl)elem.getAttributeNodeNS("http://www.w3.org/2000/xmlns/", "xmlns");
- if (attr != null) {
- String value = attr.getNodeValue();
- if (namespaceURI == null) {
- return (namespace == value);
- }
- return namespaceURI.equals(value);
- }
- }
-
- NodeImpl ancestor = (NodeImpl)getElementAncestor(this);
- if (ancestor != null) {
- return ancestor.isDefaultNamespace(namespaceURI);
- }
- return false;
- }
- case Node.DOCUMENT_NODE:{
- return((NodeImpl)((Document)this).getDocumentElement()).isDefaultNamespace(namespaceURI);
- }
-
- case Node.ENTITY_NODE :
- case Node.NOTATION_NODE:
- case Node.DOCUMENT_FRAGMENT_NODE:
- case Node.DOCUMENT_TYPE_NODE:
- // type is unknown
- return false;
- case Node.ATTRIBUTE_NODE:{
- if (this.ownerNode.getNodeType() == Node.ELEMENT_NODE) {
- return ownerNode.isDefaultNamespace(namespaceURI);
-
- }
- return false;
- }
- default:{
- NodeImpl ancestor = (NodeImpl)getElementAncestor(this);
- if (ancestor != null) {
- return ancestor.isDefaultNamespace(namespaceURI);
- }
- return false;
- }
-
- }
-*/
- return false;
-
-
- }
-
- /**
- *
- * DOM Level 3 - Experimental:
- * Look up the prefix associated to the given namespace URI, starting from this node.
- *
- * @param namespaceURI
- * @return the prefix for the namespace
- */
- public String lookupPrefix(String namespaceURI){
-
- // REVISIT: When Namespaces 1.1 comes out this may not be true
- // Prefix can't be bound to null namespace
- if (namespaceURI == null) {
- return null;
- }
-
- short type = this.getNodeType();
-
- switch (type) {
-/*
- case Node.ELEMENT_NODE: {
-
- String namespace = this.getNamespaceURI(); // to flip out children
- return lookupNamespacePrefix(namespaceURI, (ElementImpl)this);
- }
-
- case Node.DOCUMENT_NODE:{
- return((NodeImpl)((Document)this).getDocumentElement()).lookupPrefix(namespaceURI);
- }
-*/
- case Node.ENTITY_NODE :
- case Node.NOTATION_NODE:
- case Node.DOCUMENT_FRAGMENT_NODE:
- case Node.DOCUMENT_TYPE_NODE:
- // type is unknown
- return null;
- case Node.ATTRIBUTE_NODE:{
- if (this.getOwnerElement().getNodeType() == Node.ELEMENT_NODE) {
- return getOwnerElement().lookupPrefix(namespaceURI);
-
- }
- return null;
- }
- default:{
-/*
- NodeImpl ancestor = (NodeImpl)getElementAncestor(this);
- if (ancestor != null) {
- return ancestor.lookupPrefix(namespaceURI);
- }
-*/
- return null;
- }
- }
- }
-
- /**
- * Returns whether this node is the same node as the given one.
- * <br>This method provides a way to determine whether two
- * <code>Node</code> references returned by the implementation reference
- * the same object. When two <code>Node</code> references are references
- * to the same object, even if through a proxy, the references may be
- * used completely interchangably, such that all attributes have the
- * same values and calling the same DOM method on either reference
- * always has exactly the same effect.
- * @param other The node to test against.
- * @return Returns <code>true</code> if the nodes are the same,
- * <code>false</code> otherwise.
- * @since DOM Level 3
- */
- public boolean isSameNode(Node other) {
- // we do not use any wrapper so the answer is obvious
- return this == other;
- }
-
- /**
- * This attribute returns the text content of this node and its
- * descendants. When it is defined to be null, setting it has no effect.
- * When set, any possible children this node may have are removed and
- * replaced by a single <code>Text</code> node containing the string
- * this attribute is set to. On getting, no serialization is performed,
- * the returned string does not contain any markup. No whitespace
- * normalization is performed, the returned string does not contain the
- * element content whitespaces . Similarly, on setting, no parsing is
- * performed either, the input string is taken as pure textual content.
- * <br>The string returned is made of the text content of this node
- * depending on its type, as defined below:
- * <table border='1'>
- * <tr>
- * <th>Node type</th>
- * <th>Content</th>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>
- * ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE,
- * DOCUMENT_FRAGMENT_NODE</td>
- * <td valign='top' rowspan='1' colspan='1'>concatenation of the <code>textContent</code>
- * attribute value of every child node, excluding COMMENT_NODE and
- * PROCESSING_INSTRUCTION_NODE nodes</td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>ATTRIBUTE_NODE, TEXT_NODE,
- * CDATA_SECTION_NODE, COMMENT_NODE, PROCESSING_INSTRUCTION_NODE</td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <code>nodeValue</code></td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>DOCUMENT_NODE, DOCUMENT_TYPE_NODE, NOTATION_NODE</td>
- * <td valign='top' rowspan='1' colspan='1'>
- * null</td>
- * </tr>
- * </table>
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
- * @exception DOMException
- * DOMSTRING_SIZE_ERR: Raised when it would return more characters than
- * fit in a <code>DOMString</code> variable on the implementation
- * platform.
- * @since DOM Level 3
- */
- public void setTextContent(String textContent)
- throws DOMException {
- setNodeValue(textContent);
- }
-
- /**
- * This attribute returns the text content of this node and its
- * descendants. When it is defined to be null, setting it has no effect.
- * When set, any possible children this node may have are removed and
- * replaced by a single <code>Text</code> node containing the string
- * this attribute is set to. On getting, no serialization is performed,
- * the returned string does not contain any markup. No whitespace
- * normalization is performed, the returned string does not contain the
- * element content whitespaces . Similarly, on setting, no parsing is
- * performed either, the input string is taken as pure textual content.
- * <br>The string returned is made of the text content of this node
- * depending on its type, as defined below:
- * <table border='1'>
- * <tr>
- * <th>Node type</th>
- * <th>Content</th>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>
- * ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE,
- * DOCUMENT_FRAGMENT_NODE</td>
- * <td valign='top' rowspan='1' colspan='1'>concatenation of the <code>textContent</code>
- * attribute value of every child node, excluding COMMENT_NODE and
- * PROCESSING_INSTRUCTION_NODE nodes</td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>ATTRIBUTE_NODE, TEXT_NODE,
- * CDATA_SECTION_NODE, COMMENT_NODE, PROCESSING_INSTRUCTION_NODE</td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <code>nodeValue</code></td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>DOCUMENT_NODE, DOCUMENT_TYPE_NODE, NOTATION_NODE</td>
- * <td valign='top' rowspan='1' colspan='1'>
- * null</td>
- * </tr>
- * </table>
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
- * @exception DOMException
- * DOMSTRING_SIZE_ERR: Raised when it would return more characters than
- * fit in a <code>DOMString</code> variable on the implementation
- * platform.
- * @since DOM Level 3
- */
- public String getTextContent() throws DOMException {
- return getNodeValue(); // overriden in some subclasses
- }
-
- /**
- * Compares a node with this node with regard to their position in the
- * document.
- * @param other The node to compare against this node.
- * @return Returns how the given node is positioned relatively to this
- * node.
- * @since DOM Level 3
- */
- public short compareDocumentPosition(Node other) throws DOMException {
- return 0;
- }
-
- /**
- * The absolute base URI of this node or <code>null</code> if undefined.
- * This value is computed according to . However, when the
- * <code>Document</code> supports the feature "HTML" , the base URI is
- * computed using first the value of the href attribute of the HTML BASE
- * element if any, and the value of the <code>documentURI</code>
- * attribute from the <code>Document</code> interface otherwise.
- * <br> When the node is an <code>Element</code>, a <code>Document</code>
- * or a a <code>ProcessingInstruction</code>, this attribute represents
- * the properties [base URI] defined in . When the node is a
- * <code>Notation</code>, an <code>Entity</code>, or an
- * <code>EntityReference</code>, this attribute represents the
- * properties [declaration base URI] in the . How will this be affected
- * by resolution of relative namespace URIs issue?It's not.Should this
- * only be on Document, Element, ProcessingInstruction, Entity, and
- * Notation nodes, according to the infoset? If not, what is it equal to
- * on other nodes? Null? An empty string? I think it should be the
- * parent's.No.Should this be read-only and computed or and actual
- * read-write attribute?Read-only and computed (F2F 19 Jun 2000 and
- * teleconference 30 May 2001).If the base HTML element is not yet
- * attached to a document, does the insert change the Document.baseURI?
- * Yes. (F2F 26 Sep 2001)
- * @since DOM Level 3
- */
- public String getBaseURI() {
- return null;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/dtm/ref/sax2dtm/SAX2DTM.java b/src/com/sun/org/apache/xml/internal/dtm/ref/sax2dtm/SAX2DTM.java
deleted file mode 100644
index 4863666..0000000
--- a/src/com/sun/org/apache/xml/internal/dtm/ref/sax2dtm/SAX2DTM.java
+++ /dev/null
@@ -1,2540 +0,0 @@
-/*
- * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: SAX2DTM.java,v 1.2.4.1 2005/09/15 08:15:11 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.dtm.ref.sax2dtm;
-
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMManager;
-import com.sun.org.apache.xml.internal.dtm.DTMWSFilter;
-import com.sun.org.apache.xml.internal.dtm.ref.DTMDefaultBaseIterators;
-import com.sun.org.apache.xml.internal.dtm.ref.DTMManagerDefault;
-import com.sun.org.apache.xml.internal.dtm.ref.DTMStringPool;
-import com.sun.org.apache.xml.internal.dtm.ref.DTMTreeWalker;
-import com.sun.org.apache.xml.internal.dtm.ref.IncrementalSAXSource;
-import com.sun.org.apache.xml.internal.dtm.ref.NodeLocator;
-import com.sun.org.apache.xml.internal.res.XMLErrorResources;
-import com.sun.org.apache.xml.internal.res.XMLMessages;
-import com.sun.org.apache.xml.internal.utils.FastStringBuffer;
-import com.sun.org.apache.xml.internal.utils.IntStack;
-import com.sun.org.apache.xml.internal.utils.IntVector;
-import com.sun.org.apache.xml.internal.utils.StringVector;
-import com.sun.org.apache.xml.internal.utils.SuballocatedIntVector;
-import com.sun.org.apache.xml.internal.utils.SystemIDResolver;
-import com.sun.org.apache.xml.internal.utils.WrappedRuntimeException;
-import com.sun.org.apache.xml.internal.utils.XMLString;
-import com.sun.org.apache.xml.internal.utils.XMLStringFactory;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Vector;
-import javax.xml.transform.Source;
-import javax.xml.transform.SourceLocator;
-import org.xml.sax.Attributes;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.DTDHandler;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.ext.DeclHandler;
-import org.xml.sax.ext.LexicalHandler;
-
-/**
- * This class implements a DTM that tends to be optimized more for speed than
- * for compactness, that is constructed via SAX2 ContentHandler events.
- */
-public class SAX2DTM extends DTMDefaultBaseIterators
- implements EntityResolver, DTDHandler, ContentHandler, ErrorHandler,
- DeclHandler, LexicalHandler
-{
- /** Set true to monitor SAX events and similar diagnostic info. */
- private static final boolean DEBUG = false;
-
- /**
- * If we're building the model incrementally on demand, we need to
- * be able to tell the source when to send us more data.
- *
- * Note that if this has not been set, and you attempt to read ahead
- * of the current build point, we'll probably throw a null-pointer
- * exception. We could try to wait-and-retry instead, as a very poor
- * fallback, but that has all the known problems with multithreading
- * on multiprocessors and we Don't Want to Go There.
- *
- * @see setIncrementalSAXSource
- */
- private IncrementalSAXSource m_incrementalSAXSource = null;
-
- /**
- * All the character content, including attribute values, are stored in
- * this buffer.
- *
- * %REVIEW% Should this have an option of being shared across DTMs?
- * Sequentially only; not threadsafe... Currently, I think not.
- *
- * %REVIEW% Initial size was pushed way down to reduce weight of RTFs.
- * pending reduction in number of RTF DTMs. Now that we're sharing a DTM
- * between RTFs, and tail-pruning... consider going back to the larger/faster.
- *
- * Made protected rather than private so SAX2RTFDTM can access it.
- */
- //private FastStringBuffer m_chars = new FastStringBuffer(13, 13);
- protected FastStringBuffer m_chars;
-
- /** This vector holds offset and length data.
- */
- protected SuballocatedIntVector m_data;
-
- /** The parent stack, needed only for construction.
- * Made protected rather than private so SAX2RTFDTM can access it.
- */
- transient protected IntStack m_parents;
-
- /** The current previous node, needed only for construction time.
- * Made protected rather than private so SAX2RTFDTM can access it.
- */
- transient protected int m_previous = 0;
-
- /** Namespace support, only relevent at construction time.
- * Made protected rather than private so SAX2RTFDTM can access it.
- */
- transient protected java.util.Vector m_prefixMappings =
- new java.util.Vector();
-
- /** Namespace support, only relevent at construction time.
- * Made protected rather than private so SAX2RTFDTM can access it.
- */
- transient protected IntStack m_contextIndexes;
-
- /** Type of next characters() event within text block in prgress. */
- transient protected int m_textType = DTM.TEXT_NODE;
-
- /**
- * Type of coalesced text block. See logic in the characters()
- * method.
- */
- transient protected int m_coalescedTextType = DTM.TEXT_NODE;
-
- /** The SAX Document locator */
- transient protected Locator m_locator = null;
-
- /** The SAX Document system-id */
- transient private String m_systemId = null;
-
- /** We are inside the DTD. This is used for ignoring comments. */
- transient protected boolean m_insideDTD = false;
-
- /** Tree Walker for dispatchToEvents. */
- protected DTMTreeWalker m_walker = new DTMTreeWalker();
-
- /** pool of string values that come as strings. */
- protected DTMStringPool m_valuesOrPrefixes;
-
- /** End document has been reached.
- * Made protected rather than private so SAX2RTFDTM can access it.
- */
- protected boolean m_endDocumentOccured = false;
-
- /** Data or qualified name values, one array element for each node. */
- protected SuballocatedIntVector m_dataOrQName;
-
- /**
- * This table holds the ID string to node associations, for
- * XML IDs.
- */
- protected Map<String, Integer> m_idAttributes = new HashMap<>();
-
- /**
- * fixed dom-style names.
- */
- private static final String[] m_fixednames = { null,
- null, // nothing, Element
- null, "#text", // Attr, Text
- "#cdata_section", null, // CDATA, EntityReference
- null, null, // Entity, PI
- "#comment", "#document", // Comment, Document
- null, "#document-fragment", // Doctype, DocumentFragment
- null }; // Notation
-
- /**
- * Vector of entities. Each record is composed of four Strings:
- * publicId, systemID, notationName, and name.
- */
- private Vector m_entities = null;
-
- /** m_entities public ID offset. */
- private static final int ENTITY_FIELD_PUBLICID = 0;
-
- /** m_entities system ID offset. */
- private static final int ENTITY_FIELD_SYSTEMID = 1;
-
- /** m_entities notation name offset. */
- private static final int ENTITY_FIELD_NOTATIONNAME = 2;
-
- /** m_entities name offset. */
- private static final int ENTITY_FIELD_NAME = 3;
-
- /** Number of entries per record for m_entities. */
- private static final int ENTITY_FIELDS_PER = 4;
-
- /**
- * The starting offset within m_chars for the text or
- * CDATA_SECTION node currently being acumulated,
- * or -1 if there is no text node in progress
- */
- protected int m_textPendingStart = -1;
-
- /**
- * Describes whether information about document source location
- * should be maintained or not.
- *
- * Made protected for access by SAX2RTFDTM.
- */
- protected boolean m_useSourceLocationProperty = false;
-
- /** Made protected for access by SAX2RTFDTM.
- */
- protected StringVector m_sourceSystemId;
- /** Made protected for access by SAX2RTFDTM.
- */
- protected IntVector m_sourceLine;
- /** Made protected for access by SAX2RTFDTM.
- */
- protected IntVector m_sourceColumn;
-
- /**
- * Construct a SAX2DTM object using the default block size.
- *
- * @param mgr The DTMManager who owns this DTM.
- * @param source the JAXP 1.1 Source object for this DTM.
- * @param dtmIdentity The DTM identity ID for this DTM.
- * @param whiteSpaceFilter The white space filter for this DTM, which may
- * be null.
- * @param xstringfactory XMLString factory for creating character content.
- * @param doIndexing true if the caller considers it worth it to use
- * indexing schemes.
- */
- public SAX2DTM(DTMManager mgr, Source source, int dtmIdentity,
- DTMWSFilter whiteSpaceFilter,
- XMLStringFactory xstringfactory,
- boolean doIndexing)
- {
-
- this(mgr, source, dtmIdentity, whiteSpaceFilter,
- xstringfactory, doIndexing, DEFAULT_BLOCKSIZE, true, false);
- }
-
- /**
- * Construct a SAX2DTM object ready to be constructed from SAX2
- * ContentHandler events.
- *
- * @param mgr The DTMManager who owns this DTM.
- * @param source the JAXP 1.1 Source object for this DTM.
- * @param dtmIdentity The DTM identity ID for this DTM.
- * @param whiteSpaceFilter The white space filter for this DTM, which may
- * be null.
- * @param xstringfactory XMLString factory for creating character content.
- * @param doIndexing true if the caller considers it worth it to use
- * indexing schemes.
- * @param blocksize The block size of the DTM.
- * @param usePrevsib true if we want to build the previous sibling node array.
- * @param newNameTable true if we want to use a new ExpandedNameTable for this DTM.
- */
- public SAX2DTM(DTMManager mgr, Source source, int dtmIdentity,
- DTMWSFilter whiteSpaceFilter,
- XMLStringFactory xstringfactory,
- boolean doIndexing,
- int blocksize,
- boolean usePrevsib,
- boolean newNameTable)
- {
-
- super(mgr, source, dtmIdentity, whiteSpaceFilter,
- xstringfactory, doIndexing, blocksize, usePrevsib, newNameTable);
-
- // %OPT% Use smaller sizes for all internal storage units when
- // the blocksize is small. This reduces the cost of creating an RTF.
- if (blocksize <= 64)
- {
- m_data = new SuballocatedIntVector(blocksize, DEFAULT_NUMBLOCKS_SMALL);
- m_dataOrQName = new SuballocatedIntVector(blocksize, DEFAULT_NUMBLOCKS_SMALL);
- m_valuesOrPrefixes = new DTMStringPool(16);
- m_chars = new FastStringBuffer(7, 10);
- m_contextIndexes = new IntStack(4);
- m_parents = new IntStack(4);
- }
- else
- {
- m_data = new SuballocatedIntVector(blocksize, DEFAULT_NUMBLOCKS);
- m_dataOrQName = new SuballocatedIntVector(blocksize, DEFAULT_NUMBLOCKS);
- m_valuesOrPrefixes = new DTMStringPool();
- m_chars = new FastStringBuffer(10, 13);
- m_contextIndexes = new IntStack();
- m_parents = new IntStack();
- }
-
- // %REVIEW% Initial size pushed way down to reduce weight of RTFs
- // (I'm not entirely sure 0 would work, so I'm playing it safe for now.)
- //m_data = new SuballocatedIntVector(doIndexing ? (1024*2) : 512, 1024);
- //m_data = new SuballocatedIntVector(blocksize);
-
- m_data.addElement(0); // Need placeholder in case index into here must be <0.
-
- //m_dataOrQName = new SuballocatedIntVector(blocksize);
-
- // m_useSourceLocationProperty=com.sun.org.apache.xalan.internal.processor.TransformerFactoryImpl.m_source_location;
- m_useSourceLocationProperty = mgr.getSource_location();
- m_sourceSystemId = (m_useSourceLocationProperty) ? new StringVector() : null;
- m_sourceLine = (m_useSourceLocationProperty) ? new IntVector() : null;
- m_sourceColumn = (m_useSourceLocationProperty) ? new IntVector() : null;
- }
-
- /**
- * Set whether information about document source location
- * should be maintained or not.
- */
- public void setUseSourceLocation(boolean useSourceLocation)
- {
- m_useSourceLocationProperty = useSourceLocation;
- }
-
- /**
- * Get the data or qualified name for the given node identity.
- *
- * @param identity The node identity.
- *
- * @return The data or qualified name, or DTM.NULL.
- */
- protected int _dataOrQName(int identity)
- {
-
- if (identity < m_size)
- return m_dataOrQName.elementAt(identity);
-
- // Check to see if the information requested has been processed, and,
- // if not, advance the iterator until we the information has been
- // processed.
- while (true)
- {
- boolean isMore = nextNode();
-
- if (!isMore)
- return NULL;
- else if (identity < m_size)
- return m_dataOrQName.elementAt(identity);
- }
- }
-
- /**
- * Ask the CoRoutine parser to doTerminate and clear the reference.
- */
- public void clearCoRoutine()
- {
- clearCoRoutine(true);
- }
-
- /**
- * Ask the CoRoutine parser to doTerminate and clear the reference. If
- * the CoRoutine parser has already been cleared, this will have no effect.
- *
- * @param callDoTerminate true of doTerminate should be called on the
- * coRoutine parser.
- */
- public void clearCoRoutine(boolean callDoTerminate)
- {
-
- if (null != m_incrementalSAXSource)
- {
- if (callDoTerminate)
- m_incrementalSAXSource.deliverMoreNodes(false);
-
- m_incrementalSAXSource = null;
- }
- }
-
- /**
- * Bind a IncrementalSAXSource to this DTM. If we discover we need nodes
- * that have not yet been built, we will ask this object to send us more
- * events, and it will manage interactions with its data sources.
- *
- * Note that we do not actually build the IncrementalSAXSource, since we don't
- * know what source it's reading from, what thread that source will run in,
- * or when it will run.
- *
- * @param incrementalSAXSource The parser that we want to recieve events from
- * on demand.
- */
- public void setIncrementalSAXSource(IncrementalSAXSource incrementalSAXSource)
- {
-
- // Establish coroutine link so we can request more data
- //
- // Note: It's possible that some versions of IncrementalSAXSource may
- // not actually use a CoroutineManager, and hence may not require
- // that we obtain an Application Coroutine ID. (This relies on the
- // coroutine transaction details having been encapsulated in the
- // IncrementalSAXSource.do...() methods.)
- m_incrementalSAXSource = incrementalSAXSource;
-
- // Establish SAX-stream link so we can receive the requested data
- incrementalSAXSource.setContentHandler(this);
- incrementalSAXSource.setLexicalHandler(this);
- incrementalSAXSource.setDTDHandler(this);
-
- // Are the following really needed? incrementalSAXSource doesn't yet
- // support them, and they're mostly no-ops here...
- //incrementalSAXSource.setErrorHandler(this);
- //incrementalSAXSource.setDeclHandler(this);
- }
-
- /**
- * getContentHandler returns "our SAX builder" -- the thing that
- * someone else should send SAX events to in order to extend this
- * DTM model.
- *
- * %REVIEW% Should this return null if constrution already done/begun?
- *
- * @return null if this model doesn't respond to SAX events,
- * "this" if the DTM object has a built-in SAX ContentHandler,
- * the IncrementalSAXSource if we're bound to one and should receive
- * the SAX stream via it for incremental build purposes...
- *
- * Note that IncrementalSAXSource_Filter is package private, hence
- * it can be statically referenced using instanceof (CR 6537912).
- */
- public ContentHandler getContentHandler()
- {
-
- if (m_incrementalSAXSource.getClass()
- .getName().equals("com.sun.org.apache.xml.internal.dtm.ref.IncrementalSAXSource_Filter"))
- return (ContentHandler) m_incrementalSAXSource;
- else
- return this;
- }
-
- /**
- * Return this DTM's lexical handler.
- *
- * %REVIEW% Should this return null if constrution already done/begun?
- *
- * @return null if this model doesn't respond to lexical SAX events,
- * "this" if the DTM object has a built-in SAX ContentHandler,
- * the IncrementalSAXSource if we're bound to one and should receive
- * the SAX stream via it for incremental build purposes...
- *
- * Note that IncrementalSAXSource_Filter is package private, hence
- * it can be statically referenced using instanceof (CR 6537912).
- */
- public LexicalHandler getLexicalHandler()
- {
-
- if (m_incrementalSAXSource.getClass()
- .getName().equals("com.sun.org.apache.xml.internal.dtm.ref.IncrementalSAXSource_Filter"))
- return (LexicalHandler) m_incrementalSAXSource;
- else
- return this;
- }
-
- /**
- * Return this DTM's EntityResolver.
- *
- * @return null if this model doesn't respond to SAX entity ref events.
- */
- public EntityResolver getEntityResolver()
- {
- return this;
- }
-
- /**
- * Return this DTM's DTDHandler.
- *
- * @return null if this model doesn't respond to SAX dtd events.
- */
- public DTDHandler getDTDHandler()
- {
- return this;
- }
-
- /**
- * Return this DTM's ErrorHandler.
- *
- * @return null if this model doesn't respond to SAX error events.
- */
- public ErrorHandler getErrorHandler()
- {
- return this;
- }
-
- /**
- * Return this DTM's DeclHandler.
- *
- * @return null if this model doesn't respond to SAX Decl events.
- */
- public DeclHandler getDeclHandler()
- {
- return this;
- }
-
- /**
- * @return true iff we're building this model incrementally (eg
- * we're partnered with a IncrementalSAXSource) and thus require that the
- * transformation and the parse run simultaneously. Guidance to the
- * DTMManager.
- */
- public boolean needsTwoThreads()
- {
- return null != m_incrementalSAXSource;
- }
-
- /**
- * Directly call the
- * characters method on the passed ContentHandler for the
- * string-value of the given node (see http://www.w3.org/TR/xpath#data-model
- * for the definition of a node's string-value). Multiple calls to the
- * ContentHandler's characters methods may well occur for a single call to
- * this method.
- *
- * @param nodeHandle The node ID.
- * @param ch A non-null reference to a ContentHandler.
- * @param normalize true if the content should be normalized according to
- * the rules for the XPath
- * <a href="http://www.w3.org/TR/xpath#function-normalize-space">normalize-space</a>
- * function.
- *
- * @throws SAXException
- */
- public void dispatchCharactersEvents(int nodeHandle, ContentHandler ch,
- boolean normalize)
- throws SAXException
- {
-
- int identity = makeNodeIdentity(nodeHandle);
-
- if (identity == DTM.NULL)
- return;
-
- int type = _type(identity);
-
- if (isTextType(type))
- {
- int dataIndex = m_dataOrQName.elementAt(identity);
- int offset = m_data.elementAt(dataIndex);
- int length = m_data.elementAt(dataIndex + 1);
-
- if(normalize)
- m_chars.sendNormalizedSAXcharacters(ch, offset, length);
- else
- m_chars.sendSAXcharacters(ch, offset, length);
- }
- else
- {
- int firstChild = _firstch(identity);
-
- if (DTM.NULL != firstChild)
- {
- int offset = -1;
- int length = 0;
- int startNode = identity;
-
- identity = firstChild;
-
- do {
- type = _type(identity);
-
- if (isTextType(type))
- {
- int dataIndex = _dataOrQName(identity);
-
- if (-1 == offset)
- {
- offset = m_data.elementAt(dataIndex);
- }
-
- length += m_data.elementAt(dataIndex + 1);
- }
-
- identity = getNextNodeIdentity(identity);
- } while (DTM.NULL != identity && (_parent(identity) >= startNode));
-
- if (length > 0)
- {
- if(normalize)
- m_chars.sendNormalizedSAXcharacters(ch, offset, length);
- else
- m_chars.sendSAXcharacters(ch, offset, length);
- }
- }
- else if(type != DTM.ELEMENT_NODE)
- {
- int dataIndex = _dataOrQName(identity);
-
- if (dataIndex < 0)
- {
- dataIndex = -dataIndex;
- dataIndex = m_data.elementAt(dataIndex + 1);
- }
-
- String str = m_valuesOrPrefixes.indexToString(dataIndex);
-
- if(normalize)
- FastStringBuffer.sendNormalizedSAXcharacters(str.toCharArray(),
- 0, str.length(), ch);
- else
- ch.characters(str.toCharArray(), 0, str.length());
- }
- }
- }
-
-
- /**
- * Given a node handle, return its DOM-style node name. This will
- * include names such as #text or #document.
- *
- * @param nodeHandle the id of the node.
- * @return String Name of this node, which may be an empty string.
- * %REVIEW% Document when empty string is possible...
- * %REVIEW-COMMENT% It should never be empty, should it?
- */
- public String getNodeName(int nodeHandle)
- {
-
- int expandedTypeID = getExpandedTypeID(nodeHandle);
- // If just testing nonzero, no need to shift...
- int namespaceID = m_expandedNameTable.getNamespaceID(expandedTypeID);
-
- if (0 == namespaceID)
- {
- // Don't retrieve name until/unless needed
- // String name = m_expandedNameTable.getLocalName(expandedTypeID);
- int type = getNodeType(nodeHandle);
-
- if (type == DTM.NAMESPACE_NODE)
- {
- if (null == m_expandedNameTable.getLocalName(expandedTypeID))
- return "xmlns";
- else
- return "xmlns:" + m_expandedNameTable.getLocalName(expandedTypeID);
- }
- else if (0 == m_expandedNameTable.getLocalNameID(expandedTypeID))
- {
- return m_fixednames[type];
- }
- else
- return m_expandedNameTable.getLocalName(expandedTypeID);
- }
- else
- {
- int qnameIndex = m_dataOrQName.elementAt(makeNodeIdentity(nodeHandle));
-
- if (qnameIndex < 0)
- {
- qnameIndex = -qnameIndex;
- qnameIndex = m_data.elementAt(qnameIndex);
- }
-
- return m_valuesOrPrefixes.indexToString(qnameIndex);
- }
- }
-
- /**
- * Given a node handle, return the XPath node name. This should be
- * the name as described by the XPath data model, NOT the DOM-style
- * name.
- *
- * @param nodeHandle the id of the node.
- * @return String Name of this node, which may be an empty string.
- */
- public String getNodeNameX(int nodeHandle)
- {
-
- int expandedTypeID = getExpandedTypeID(nodeHandle);
- int namespaceID = m_expandedNameTable.getNamespaceID(expandedTypeID);
-
- if (0 == namespaceID)
- {
- String name = m_expandedNameTable.getLocalName(expandedTypeID);
-
- if (name == null)
- return "";
- else
- return name;
- }
- else
- {
- int qnameIndex = m_dataOrQName.elementAt(makeNodeIdentity(nodeHandle));
-
- if (qnameIndex < 0)
- {
- qnameIndex = -qnameIndex;
- qnameIndex = m_data.elementAt(qnameIndex);
- }
-
- return m_valuesOrPrefixes.indexToString(qnameIndex);
- }
- }
-
- /**
- * 5. [specified] A flag indicating whether this attribute was actually
- * specified in the start-tag of its element, or was defaulted from the
- * DTD.
- *
- * @param attributeHandle Must be a valid handle to an attribute node.
- * @return <code>true</code> if the attribute was specified;
- * <code>false</code> if it was defaulted.
- */
- public boolean isAttributeSpecified(int attributeHandle)
- {
-
- // I'm not sure if I want to do anything with this...
- return true; // ??
- }
-
- /**
- * A document type declaration information item has the following properties:
- *
- * 1. [system identifier] The system identifier of the external subset, if
- * it exists. Otherwise this property has no value.
- *
- * @return the system identifier String object, or null if there is none.
- */
- public String getDocumentTypeDeclarationSystemIdentifier()
- {
-
- /** @todo: implement this com.sun.org.apache.xml.internal.dtm.DTMDefaultBase abstract method */
- error(XMLMessages.createXMLMessage(XMLErrorResources.ER_METHOD_NOT_SUPPORTED, null));//"Not yet supported!");
-
- return null;
- }
-
- /**
- * Get the next node identity value in the list, and call the iterator
- * if it hasn't been added yet.
- *
- * @param identity The node identity (index).
- * @return identity+1, or DTM.NULL.
- */
- protected int getNextNodeIdentity(int identity)
- {
-
- identity += 1;
-
- while (identity >= m_size)
- {
- if (null == m_incrementalSAXSource)
- return DTM.NULL;
-
- nextNode();
- }
-
- return identity;
- }
-
- /**
- * Directly create SAX parser events from a subtree.
- *
- * @param nodeHandle The node ID.
- * @param ch A non-null reference to a ContentHandler.
- *
- * @throws org.xml.sax.SAXException
- */
- public void dispatchToEvents(int nodeHandle, org.xml.sax.ContentHandler ch)
- throws org.xml.sax.SAXException
- {
-
- DTMTreeWalker treeWalker = m_walker;
- ContentHandler prevCH = treeWalker.getcontentHandler();
-
- if (null != prevCH)
- {
- treeWalker = new DTMTreeWalker();
- }
-
- treeWalker.setcontentHandler(ch);
- treeWalker.setDTM(this);
-
- try
- {
- treeWalker.traverse(nodeHandle);
- }
- finally
- {
- treeWalker.setcontentHandler(null);
- }
- }
-
- /**
- * Get the number of nodes that have been added.
- *
- * @return The number of that are currently in the tree.
- */
- public int getNumberOfNodes()
- {
- return m_size;
- }
-
- /**
- * This method should try and build one or more nodes in the table.
- *
- * @return The true if a next node is found or false if
- * there are no more nodes.
- */
- protected boolean nextNode()
- {
-
- if (null == m_incrementalSAXSource)
- return false;
-
- if (m_endDocumentOccured)
- {
- clearCoRoutine();
-
- return false;
- }
-
- Object gotMore = m_incrementalSAXSource.deliverMoreNodes(true);
-
- // gotMore may be a Boolean (TRUE if still parsing, FALSE if
- // EOF) or an exception if IncrementalSAXSource malfunctioned
- // (code error rather than user error).
- //
- // %REVIEW% Currently the ErrorHandlers sketched herein are
- // no-ops, so I'm going to initially leave this also as a
- // no-op.
- if (!(gotMore instanceof Boolean))
- {
- if(gotMore instanceof RuntimeException)
- {
- throw (RuntimeException)gotMore;
- }
- else if(gotMore instanceof Exception)
- {
- throw new WrappedRuntimeException((Exception)gotMore);
- }
- // for now...
- clearCoRoutine();
-
- return false;
-
- // %TBD%
- }
-
- if (gotMore != Boolean.TRUE)
- {
-
- // EOF reached without satisfying the request
- clearCoRoutine(); // Drop connection, stop trying
-
- // %TBD% deregister as its listener?
- }
-
- return true;
- }
-
- /**
- * Bottleneck determination of text type.
- *
- * @param type oneof DTM.XXX_NODE.
- *
- * @return true if this is a text or cdata section.
- */
- private final boolean isTextType(int type)
- {
- return (DTM.TEXT_NODE == type || DTM.CDATA_SECTION_NODE == type);
- }
-
-// /**
-// * Ensure that the size of the information arrays can hold another entry
-// * at the given index.
-// *
-// * @param on exit from this function, the information arrays sizes must be
-// * at least index+1.
-// *
-// * NEEDSDOC @param index
-// */
-// protected void ensureSize(int index)
-// {
-// // dataOrQName is an SuballocatedIntVector and hence self-sizing.
-// // But DTMDefaultBase may need fixup.
-// super.ensureSize(index);
-// }
-
- /**
- * Construct the node map from the node.
- *
- * @param type raw type ID, one of DTM.XXX_NODE.
- * @param expandedTypeID The expended type ID.
- * @param parentIndex The current parent index.
- * @param previousSibling The previous sibling index.
- * @param dataOrPrefix index into m_data table, or string handle.
- * @param canHaveFirstChild true if the node can have a first child, false
- * if it is atomic.
- *
- * @return The index identity of the node that was added.
- */
- protected int addNode(int type, int expandedTypeID,
- int parentIndex, int previousSibling,
- int dataOrPrefix, boolean canHaveFirstChild)
- {
- // Common to all nodes:
- int nodeIndex = m_size++;
-
- // Have we overflowed a DTM Identity's addressing range?
- if(m_dtmIdent.size() == (nodeIndex>>>DTMManager.IDENT_DTM_NODE_BITS))
- {
- addNewDTMID(nodeIndex);
- }
-
- m_firstch.addElement(canHaveFirstChild ? NOTPROCESSED : DTM.NULL);
- m_nextsib.addElement(NOTPROCESSED);
- m_parent.addElement(parentIndex);
- m_exptype.addElement(expandedTypeID);
- m_dataOrQName.addElement(dataOrPrefix);
-
- if (m_prevsib != null) {
- m_prevsib.addElement(previousSibling);
- }
-
- if (DTM.NULL != previousSibling) {
- m_nextsib.setElementAt(nodeIndex,previousSibling);
- }
-
- if (m_locator != null && m_useSourceLocationProperty) {
- setSourceLocation();
- }
-
- // Note that nextSibling is not processed until charactersFlush()
- // is called, to handle successive characters() events.
-
- // Special handling by type: Declare namespaces, attach first child
- switch(type)
- {
- case DTM.NAMESPACE_NODE:
- declareNamespaceInContext(parentIndex,nodeIndex);
- break;
- case DTM.ATTRIBUTE_NODE:
- break;
- default:
- if (DTM.NULL == previousSibling && DTM.NULL != parentIndex) {
- m_firstch.setElementAt(nodeIndex,parentIndex);
- }
- break;
- }
-
- return nodeIndex;
- }
-
- /**
- * Get a new DTM ID beginning at the specified node index.
- * @param nodeIndex The node identity at which the new DTM ID will begin
- * addressing.
- */
- protected void addNewDTMID(int nodeIndex) {
- try
- {
- if(m_mgr==null)
- throw new ClassCastException();
-
- // Handle as Extended Addressing
- DTMManagerDefault mgrD=(DTMManagerDefault)m_mgr;
- int id=mgrD.getFirstFreeDTMID();
- mgrD.addDTM(this,id,nodeIndex);
- m_dtmIdent.addElement(id<<DTMManager.IDENT_DTM_NODE_BITS);
- }
- catch(ClassCastException e)
- {
- // %REVIEW% Wrong error message, but I've been told we're trying
- // not to add messages right not for I18N reasons.
- // %REVIEW% Should this be a Fatal Error?
- error(XMLMessages.createXMLMessage(XMLErrorResources.ER_NO_DTMIDS_AVAIL, null));//"No more DTM IDs are available";
- }
- }
-
- /**
- * Migrate a DTM built with an old DTMManager to a new DTMManager.
- * After the migration, the new DTMManager will treat the DTM as
- * one that is built by itself.
- * This is used to support DTM sharing between multiple transformations.
- * @param manager the DTMManager
- */
- public void migrateTo(DTMManager manager) {
- super.migrateTo(manager);
-
- // We have to reset the information in m_dtmIdent and
- // register the DTM with the new manager.
- int numDTMs = m_dtmIdent.size();
- int dtmId = m_mgrDefault.getFirstFreeDTMID();
- int nodeIndex = 0;
- for (int i = 0; i < numDTMs; i++)
- {
- m_dtmIdent.setElementAt(dtmId << DTMManager.IDENT_DTM_NODE_BITS, i);
- m_mgrDefault.addDTM(this, dtmId, nodeIndex);
- dtmId++;
- nodeIndex += (1 << DTMManager.IDENT_DTM_NODE_BITS);
- }
- }
-
- /**
- * Store the source location of the current node. This method must be called
- * as every node is added to the DTM or for no node.
- */
- protected void setSourceLocation() {
- m_sourceSystemId.addElement(m_locator.getSystemId());
- m_sourceLine.addElement(m_locator.getLineNumber());
- m_sourceColumn.addElement(m_locator.getColumnNumber());
-
- //%REVIEW% %BUG% Prevent this from arising in the first place
- // by not allowing the enabling conditions to change after we start
- // building the document.
- if (m_sourceSystemId.size() != m_size) {
- String msg = "CODING ERROR in Source Location: " + m_size + " != "
- + m_sourceSystemId.size();
- System.err.println(msg);
- throw new RuntimeException(msg);
- }
- }
-
- /**
- * Given a node handle, return its node value. This is mostly
- * as defined by the DOM, but may ignore some conveniences.
- * <p>
- *
- * @param nodeHandle The node id.
- * @return String Value of this node, or null if not
- * meaningful for this node type.
- */
- public String getNodeValue(int nodeHandle)
- {
-
- int identity = makeNodeIdentity(nodeHandle);
- int type = _type(identity);
-
- if (isTextType(type))
- {
- int dataIndex = _dataOrQName(identity);
- int offset = m_data.elementAt(dataIndex);
- int length = m_data.elementAt(dataIndex + 1);
-
- // %OPT% We should cache this, I guess.
- return m_chars.getString(offset, length);
- }
- else if (DTM.ELEMENT_NODE == type || DTM.DOCUMENT_FRAGMENT_NODE == type
- || DTM.DOCUMENT_NODE == type)
- {
- return null;
- }
- else
- {
- int dataIndex = _dataOrQName(identity);
-
- if (dataIndex < 0)
- {
- dataIndex = -dataIndex;
- dataIndex = m_data.elementAt(dataIndex + 1);
- }
-
- return m_valuesOrPrefixes.indexToString(dataIndex);
- }
- }
-
- /**
- * Given a node handle, return its XPath-style localname.
- * (As defined in Namespaces, this is the portion of the name after any
- * colon character).
- *
- * @param nodeHandle the id of the node.
- * @return String Local name of this node.
- */
- public String getLocalName(int nodeHandle)
- {
- return m_expandedNameTable.getLocalName(_exptype(makeNodeIdentity(nodeHandle)));
- }
-
- /**
- * The getUnparsedEntityURI function returns the URI of the unparsed
- * entity with the specified name in the same document as the context
- * node (see [3.3 Unparsed Entities]). It returns the empty string if
- * there is no such entity.
- * <p>
- * XML processors may choose to use the System Identifier (if one
- * is provided) to resolve the entity, rather than the URI in the
- * Public Identifier. The details are dependent on the processor, and
- * we would have to support some form of plug-in resolver to handle
- * this properly. Currently, we simply return the System Identifier if
- * present, and hope that it a usable URI or that our caller can
- * map it to one.
- * TODO: Resolve Public Identifiers... or consider changing function name.
- * <p>
- * If we find a relative URI
- * reference, XML expects it to be resolved in terms of the base URI
- * of the document. The DOM doesn't do that for us, and it isn't
- * entirely clear whether that should be done here; currently that's
- * pushed up to a higher level of our application. (Note that DOM Level
- * 1 didn't store the document's base URI.)
- * TODO: Consider resolving Relative URIs.
- * <p>
- * (The DOM's statement that "An XML processor may choose to
- * completely expand entities before the structure model is passed
- * to the DOM" refers only to parsed entities, not unparsed, and hence
- * doesn't affect this function.)
- *
- * @param name A string containing the Entity Name of the unparsed
- * entity.
- *
- * @return String containing the URI of the Unparsed Entity, or an
- * empty string if no such entity exists.
- */
- public String getUnparsedEntityURI(String name)
- {
-
- String url = "";
-
- if (null == m_entities)
- return url;
-
- int n = m_entities.size();
-
- for (int i = 0; i < n; i += ENTITY_FIELDS_PER)
- {
- String ename = (String) m_entities.elementAt(i + ENTITY_FIELD_NAME);
-
- if (null != ename && ename.equals(name))
- {
- String nname = (String) m_entities.elementAt(i
- + ENTITY_FIELD_NOTATIONNAME);
-
- if (null != nname)
- {
-
- // The draft says: "The XSLT processor may use the public
- // identifier to generate a URI for the entity instead of the URI
- // specified in the system identifier. If the XSLT processor does
- // not use the public identifier to generate the URI, it must use
- // the system identifier; if the system identifier is a relative
- // URI, it must be resolved into an absolute URI using the URI of
- // the resource containing the entity declaration as the base
- // URI [RFC2396]."
- // So I'm falling a bit short here.
- url = (String) m_entities.elementAt(i + ENTITY_FIELD_SYSTEMID);
-
- if (null == url)
- {
- url = (String) m_entities.elementAt(i + ENTITY_FIELD_PUBLICID);
- }
- }
-
- break;
- }
- }
-
- return url;
- }
-
- /**
- * Given a namespace handle, return the prefix that the namespace decl is
- * mapping.
- * Given a node handle, return the prefix used to map to the namespace.
- *
- * <p> %REVIEW% Are you sure you want "" for no prefix? </p>
- * <p> %REVIEW-COMMENT% I think so... not totally sure. -sb </p>
- *
- * @param nodeHandle the id of the node.
- * @return String prefix of this node's name, or "" if no explicit
- * namespace prefix was given.
- */
- public String getPrefix(int nodeHandle)
- {
-
- int identity = makeNodeIdentity(nodeHandle);
- int type = _type(identity);
-
- if (DTM.ELEMENT_NODE == type)
- {
- int prefixIndex = _dataOrQName(identity);
-
- if (0 == prefixIndex)
- return "";
- else
- {
- String qname = m_valuesOrPrefixes.indexToString(prefixIndex);
-
- return getPrefix(qname, null);
- }
- }
- else if (DTM.ATTRIBUTE_NODE == type)
- {
- int prefixIndex = _dataOrQName(identity);
-
- if (prefixIndex < 0)
- {
- prefixIndex = m_data.elementAt(-prefixIndex);
-
- String qname = m_valuesOrPrefixes.indexToString(prefixIndex);
-
- return getPrefix(qname, null);
- }
- }
-
- return "";
- }
-
- /**
- * Retrieves an attribute node by by qualified name and namespace URI.
- *
- * @param nodeHandle int Handle of the node upon which to look up this attribute..
- * @param namespaceURI The namespace URI of the attribute to
- * retrieve, or null.
- * @param name The local name of the attribute to
- * retrieve.
- * @return The attribute node handle with the specified name (
- * <code>nodeName</code>) or <code>DTM.NULL</code> if there is no such
- * attribute.
- */
- public int getAttributeNode(int nodeHandle, String namespaceURI,
- String name)
- {
-
- for (int attrH = getFirstAttribute(nodeHandle); DTM.NULL != attrH;
- attrH = getNextAttribute(attrH))
- {
- String attrNS = getNamespaceURI(attrH);
- String attrName = getLocalName(attrH);
- boolean nsMatch = namespaceURI == attrNS
- || (namespaceURI != null
- && namespaceURI.equals(attrNS));
-
- if (nsMatch && name.equals(attrName))
- return attrH;
- }
-
- return DTM.NULL;
- }
-
- /**
- * Return the public identifier of the external subset,
- * normalized as described in 4.2.2 External Entities [XML]. If there is
- * no external subset or if it has no public identifier, this property
- * has no value.
- *
- * @return the public identifier String object, or null if there is none.
- */
- public String getDocumentTypeDeclarationPublicIdentifier()
- {
-
- /** @todo: implement this com.sun.org.apache.xml.internal.dtm.DTMDefaultBase abstract method */
- error(XMLMessages.createXMLMessage(XMLErrorResources.ER_METHOD_NOT_SUPPORTED, null));//"Not yet supported!");
-
- return null;
- }
-
- /**
- * Given a node handle, return its DOM-style namespace URI
- * (As defined in Namespaces, this is the declared URI which this node's
- * prefix -- or default in lieu thereof -- was mapped to.)
- *
- * <p>%REVIEW% Null or ""? -sb</p>
- *
- * @param nodeHandle the id of the node.
- * @return String URI value of this node's namespace, or null if no
- * namespace was resolved.
- */
- public String getNamespaceURI(int nodeHandle)
- {
-
- return m_expandedNameTable.getNamespace(_exptype(makeNodeIdentity(nodeHandle)));
- }
-
- /**
- * Get the string-value of a node as a String object
- * (see http://www.w3.org/TR/xpath#data-model
- * for the definition of a node's string-value).
- *
- * @param nodeHandle The node ID.
- *
- * @return A string object that represents the string-value of the given node.
- */
- public XMLString getStringValue(int nodeHandle)
- {
- int identity = makeNodeIdentity(nodeHandle);
- int type;
- if(identity==DTM.NULL) // Separate lines because I wanted to breakpoint it
- type = DTM.NULL;
- else
- type= _type(identity);
-
- if (isTextType(type))
- {
- int dataIndex = _dataOrQName(identity);
- int offset = m_data.elementAt(dataIndex);
- int length = m_data.elementAt(dataIndex + 1);
-
- return m_xstrf.newstr(m_chars, offset, length);
- }
- else
- {
- int firstChild = _firstch(identity);
-
- if (DTM.NULL != firstChild)
- {
- int offset = -1;
- int length = 0;
- int startNode = identity;
-
- identity = firstChild;
-
- do {
- type = _type(identity);
-
- if (isTextType(type))
- {
- int dataIndex = _dataOrQName(identity);
-
- if (-1 == offset)
- {
- offset = m_data.elementAt(dataIndex);
- }
-
- length += m_data.elementAt(dataIndex + 1);
- }
-
- identity = getNextNodeIdentity(identity);
- } while (DTM.NULL != identity && (_parent(identity) >= startNode));
-
- if (length > 0)
- {
- return m_xstrf.newstr(m_chars, offset, length);
- }
- }
- else if(type != DTM.ELEMENT_NODE)
- {
- int dataIndex = _dataOrQName(identity);
-
- if (dataIndex < 0)
- {
- dataIndex = -dataIndex;
- dataIndex = m_data.elementAt(dataIndex + 1);
- }
- return m_xstrf.newstr(m_valuesOrPrefixes.indexToString(dataIndex));
- }
- }
-
- return m_xstrf.emptystr();
- }
-
- /**
- * Determine if the string-value of a node is whitespace
- *
- * @param nodeHandle The node Handle.
- *
- * @return Return true if the given node is whitespace.
- */
- public boolean isWhitespace(int nodeHandle)
- {
- int identity = makeNodeIdentity(nodeHandle);
- int type;
- if(identity==DTM.NULL) // Separate lines because I wanted to breakpoint it
- type = DTM.NULL;
- else
- type= _type(identity);
-
- if (isTextType(type))
- {
- int dataIndex = _dataOrQName(identity);
- int offset = m_data.elementAt(dataIndex);
- int length = m_data.elementAt(dataIndex + 1);
-
- return m_chars.isWhitespace(offset, length);
- }
- return false;
- }
-
- /**
- * Returns the <code>Element</code> whose <code>ID</code> is given by
- * <code>elementId</code>. If no such element exists, returns
- * <code>DTM.NULL</code>. Behavior is not defined if more than one element
- * has this <code>ID</code>. Attributes (including those
- * with the name "ID") are not of type ID unless so defined by DTD/Schema
- * information available to the DTM implementation.
- * Implementations that do not know whether attributes are of type ID or
- * not are expected to return <code>DTM.NULL</code>.
- *
- * <p>%REVIEW% Presumably IDs are still scoped to a single document,
- * and this operation searches only within a single document, right?
- * Wouldn't want collisions between DTMs in the same process.</p>
- *
- * @param elementId The unique <code>id</code> value for an element.
- * @return The handle of the matching element.
- */
- public int getElementById(String elementId)
- {
-
- Integer intObj;
- boolean isMore = true;
-
- do
- {
- intObj = m_idAttributes.get(elementId);
-
- if (null != intObj)
- return makeNodeHandle(intObj.intValue());
-
- if (!isMore || m_endDocumentOccured)
- break;
-
- isMore = nextNode();
- }
- while (null == intObj);
-
- return DTM.NULL;
- }
-
- /**
- * Get a prefix either from the qname or from the uri mapping, or just make
- * one up!
- *
- * @param qname The qualified name, which may be null.
- * @param uri The namespace URI, which may be null.
- *
- * @return The prefix if there is one, or null.
- */
- public String getPrefix(String qname, String uri)
- {
-
- String prefix;
- int uriIndex = -1;
-
- if (null != uri && uri.length() > 0)
- {
-
- do
- {
- uriIndex = m_prefixMappings.indexOf(uri, ++uriIndex);
- } while ( (uriIndex & 0x01) == 0);
-
- if (uriIndex >= 0)
- {
- prefix = (String) m_prefixMappings.elementAt(uriIndex - 1);
- }
- else if (null != qname)
- {
- int indexOfNSSep = qname.indexOf(':');
-
- if (qname.equals("xmlns"))
- prefix = "";
- else if (qname.startsWith("xmlns:"))
- prefix = qname.substring(indexOfNSSep + 1);
- else
- prefix = (indexOfNSSep > 0)
- ? qname.substring(0, indexOfNSSep) : null;
- }
- else
- {
- prefix = null;
- }
- }
- else if (null != qname)
- {
- int indexOfNSSep = qname.indexOf(':');
-
- if (indexOfNSSep > 0)
- {
- if (qname.startsWith("xmlns:"))
- prefix = qname.substring(indexOfNSSep + 1);
- else
- prefix = qname.substring(0, indexOfNSSep);
- }
- else
- {
- if (qname.equals("xmlns"))
- prefix = "";
- else
- prefix = null;
- }
- }
- else
- {
- prefix = null;
- }
-
- return prefix;
- }
-
- /**
- * Get a prefix either from the uri mapping, or just make
- * one up!
- *
- * @param uri The namespace URI, which may be null.
- *
- * @return The prefix if there is one, or null.
- */
- public int getIdForNamespace(String uri)
- {
-
- return m_valuesOrPrefixes.stringToIndex(uri);
-
- }
-
- /**
- * Get a prefix either from the qname or from the uri mapping, or just make
- * one up!
- *
- * @return The prefix if there is one, or null.
- */
- public String getNamespaceURI(String prefix)
- {
-
- String uri = "";
- int prefixIndex = m_contextIndexes.peek() - 1 ;
-
- if(null == prefix)
- prefix = "";
-
- do
- {
- prefixIndex = m_prefixMappings.indexOf(prefix, ++prefixIndex);
- } while ( (prefixIndex >= 0) && (prefixIndex & 0x01) == 0x01);
-
- if (prefixIndex > -1)
- {
- uri = (String) m_prefixMappings.elementAt(prefixIndex + 1);
- }
-
-
- return uri;
- }
-
- /**
- * Set an ID string to node association in the ID table.
- *
- * @param id The ID string.
- * @param elem The associated element handle.
- */
- public void setIDAttribute(String id, int elem)
- {
- m_idAttributes.put(id, elem);
- }
-
- /**
- * Check whether accumulated text should be stripped; if not,
- * append the appropriate flavor of text/cdata node.
- */
- protected void charactersFlush()
- {
-
- if (m_textPendingStart >= 0) // -1 indicates no-text-in-progress
- {
- int length = m_chars.size() - m_textPendingStart;
- boolean doStrip = false;
-
- if (getShouldStripWhitespace())
- {
- doStrip = m_chars.isWhitespace(m_textPendingStart, length);
- }
-
- if (doStrip) {
- m_chars.setLength(m_textPendingStart); // Discard accumulated text
- } else {
- // Guard against characters/ignorableWhitespace events that
- // contained no characters. They should not result in a node.
- if (length > 0) {
- int exName = m_expandedNameTable.getExpandedTypeID(DTM.TEXT_NODE);
- int dataIndex = m_data.size();
-
- m_previous = addNode(m_coalescedTextType, exName,
- m_parents.peek(), m_previous, dataIndex, false);
-
- m_data.addElement(m_textPendingStart);
- m_data.addElement(length);
- }
- }
-
- // Reset for next text block
- m_textPendingStart = -1;
- m_textType = m_coalescedTextType = DTM.TEXT_NODE;
- }
- }
-
- ////////////////////////////////////////////////////////////////////
- // Implementation of the EntityResolver interface.
- ////////////////////////////////////////////////////////////////////
-
- /**
- * Resolve an external entity.
- *
- * <p>Always return null, so that the parser will use the system
- * identifier provided in the XML document. This method implements
- * the SAX default behaviour: application writers can override it
- * in a subclass to do special translations such as catalog lookups
- * or URI redirection.</p>
- *
- * @param publicId The public identifer, or null if none is
- * available.
- * @param systemId The system identifier provided in the XML
- * document.
- * @return The new input source, or null to require the
- * default behaviour.
- * @throws SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.EntityResolver#resolveEntity
- *
- * @throws SAXException
- */
- public InputSource resolveEntity(String publicId, String systemId)
- throws SAXException
- {
- return null;
- }
-
- ////////////////////////////////////////////////////////////////////
- // Implementation of DTDHandler interface.
- ////////////////////////////////////////////////////////////////////
-
- /**
- * Receive notification of a notation declaration.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass if they wish to keep track of the notations
- * declared in a document.</p>
- *
- * @param name The notation name.
- * @param publicId The notation public identifier, or null if not
- * available.
- * @param systemId The notation system identifier.
- * @throws SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.DTDHandler#notationDecl
- *
- * @throws SAXException
- */
- public void notationDecl(String name, String publicId, String systemId)
- throws SAXException
- {
-
- // no op
- }
-
- /**
- * Receive notification of an unparsed entity declaration.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass to keep track of the unparsed entities
- * declared in a document.</p>
- *
- * @param name The entity name.
- * @param publicId The entity public identifier, or null if not
- * available.
- * @param systemId The entity system identifier.
- * @param notationName The name of the associated notation.
- * @throws SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.DTDHandler#unparsedEntityDecl
- *
- * @throws SAXException
- */
- public void unparsedEntityDecl(
- String name, String publicId, String systemId, String notationName)
- throws SAXException
- {
-
- if (null == m_entities)
- {
- m_entities = new Vector();
- }
-
- try
- {
- systemId = SystemIDResolver.getAbsoluteURI(systemId,
- getDocumentBaseURI());
- }
- catch (Exception e)
- {
- throw new org.xml.sax.SAXException(e);
- }
-
- // private static final int ENTITY_FIELD_PUBLICID = 0;
- m_entities.addElement(publicId);
-
- // private static final int ENTITY_FIELD_SYSTEMID = 1;
- m_entities.addElement(systemId);
-
- // private static final int ENTITY_FIELD_NOTATIONNAME = 2;
- m_entities.addElement(notationName);
-
- // private static final int ENTITY_FIELD_NAME = 3;
- m_entities.addElement(name);
- }
-
- ////////////////////////////////////////////////////////////////////
- // Implementation of ContentHandler interface.
- ////////////////////////////////////////////////////////////////////
-
- /**
- * Receive a Locator object for document events.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass if they wish to store the locator for use
- * with other document events.</p>
- *
- * @param locator A locator for all SAX document events.
- * @see org.xml.sax.ContentHandler#setDocumentLocator
- * @see org.xml.sax.Locator
- */
- public void setDocumentLocator(Locator locator)
- {
- m_locator = locator;
- m_systemId = locator.getSystemId();
- }
-
- /**
- * Receive notification of the beginning of the document.
- *
- * @throws SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ContentHandler#startDocument
- */
- public void startDocument() throws SAXException
- {
- if (DEBUG)
- System.out.println("startDocument");
-
-
- int doc = addNode(DTM.DOCUMENT_NODE,
- m_expandedNameTable.getExpandedTypeID(DTM.DOCUMENT_NODE),
- DTM.NULL, DTM.NULL, 0, true);
-
- m_parents.push(doc);
- m_previous = DTM.NULL;
-
- m_contextIndexes.push(m_prefixMappings.size()); // for the next element.
- }
-
- /**
- * Receive notification of the end of the document.
- *
- * @throws SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ContentHandler#endDocument
- */
- public void endDocument() throws SAXException
- {
- if (DEBUG)
- System.out.println("endDocument");
-
- charactersFlush();
-
- m_nextsib.setElementAt(NULL,0);
-
- if (m_firstch.elementAt(0) == NOTPROCESSED)
- m_firstch.setElementAt(NULL,0);
-
- if (DTM.NULL != m_previous)
- m_nextsib.setElementAt(DTM.NULL,m_previous);
-
- m_parents = null;
- m_prefixMappings = null;
- m_contextIndexes = null;
-
- m_endDocumentOccured = true;
-
- // Bugzilla 4858: throw away m_locator. we cache m_systemId
- m_locator = null;
- }
-
- /**
- * Receive notification of the start of a Namespace mapping.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass to take specific actions at the start of
- * each Namespace prefix scope (such as storing the prefix mapping).</p>
- *
- * @param prefix The Namespace prefix being declared.
- * @param uri The Namespace URI mapped to the prefix.
- * @throws SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ContentHandler#startPrefixMapping
- */
- public void startPrefixMapping(String prefix, String uri)
- throws SAXException
- {
-
- if (DEBUG)
- System.out.println("startPrefixMapping: prefix: " + prefix + ", uri: "
- + uri);
-
- if(null == prefix)
- prefix = "";
- m_prefixMappings.addElement(prefix); // JDK 1.1.x compat -sc
- m_prefixMappings.addElement(uri); // JDK 1.1.x compat -sc
- }
-
- /**
- * Receive notification of the end of a Namespace mapping.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass to take specific actions at the end of
- * each prefix mapping.</p>
- *
- * @param prefix The Namespace prefix being declared.
- * @throws SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ContentHandler#endPrefixMapping
- */
- public void endPrefixMapping(String prefix) throws SAXException
- {
- if (DEBUG)
- System.out.println("endPrefixMapping: prefix: " + prefix);
-
- if(null == prefix)
- prefix = "";
-
- int index = m_contextIndexes.peek() - 1;
-
- do
- {
- index = m_prefixMappings.indexOf(prefix, ++index);
- } while ( (index >= 0) && ((index & 0x01) == 0x01) );
-
-
- if (index > -1)
- {
- m_prefixMappings.setElementAt("%@$#^@#", index);
- m_prefixMappings.setElementAt("%@$#^@#", index + 1);
- }
-
- // no op
- }
-
- /**
- * Check if a declaration has already been made for a given prefix.
- *
- * @param prefix non-null prefix string.
- *
- * @return true if the declaration has already been declared in the
- * current context.
- */
- protected boolean declAlreadyDeclared(String prefix)
- {
-
- int startDecls = m_contextIndexes.peek();
- java.util.Vector prefixMappings = m_prefixMappings;
- int nDecls = prefixMappings.size();
-
- for (int i = startDecls; i < nDecls; i += 2)
- {
- String prefixDecl = (String) prefixMappings.elementAt(i);
-
- if (prefixDecl == null)
- continue;
-
- if (prefixDecl.equals(prefix))
- return true;
- }
-
- return false;
- }
-
- boolean m_pastFirstElement=false;
-
- /**
- * Receive notification of the start of an element.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass to take specific actions at the start of
- * each element (such as allocating a new tree node or writing
- * output to a file).</p>
- *
- * @param uri The Namespace URI, or the empty string if the
- * element has no Namespace URI or if Namespace
- * processing is not being performed.
- * @param localName The local name (without prefix), or the
- * empty string if Namespace processing is not being
- * performed.
- * @param qName The qualified name (with prefix), or the
- * empty string if qualified names are not available.
- * @param attributes The specified or defaulted attributes.
- * @throws SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ContentHandler#startElement
- */
- public void startElement(
- String uri, String localName, String qName, Attributes attributes)
- throws SAXException
- {
- if (DEBUG)
- {
- System.out.println("startElement: uri: " + uri + ", localname: "
- + localName + ", qname: "+qName+", atts: " + attributes);
-
- boolean DEBUG_ATTRS=true;
- if(DEBUG_ATTRS & attributes!=null)
- {
- int n = attributes.getLength();
- if(n==0)
- System.out.println("\tempty attribute list");
- else for (int i = 0; i < n; i++)
- System.out.println("\t attr: uri: " + attributes.getURI(i) +
- ", localname: " + attributes.getLocalName(i) +
- ", qname: " + attributes.getQName(i) +
- ", type: " + attributes.getType(i) +
- ", value: " + attributes.getValue(i)
- );
- }
- }
-
- charactersFlush();
-
- int exName = m_expandedNameTable.getExpandedTypeID(uri, localName, DTM.ELEMENT_NODE);
- String prefix = getPrefix(qName, uri);
- int prefixIndex = (null != prefix)
- ? m_valuesOrPrefixes.stringToIndex(qName) : 0;
-
- int elemNode = addNode(DTM.ELEMENT_NODE, exName,
- m_parents.peek(), m_previous, prefixIndex, true);
-
- if(m_indexing)
- indexNode(exName, elemNode);
-
-
- m_parents.push(elemNode);
-
- int startDecls = m_contextIndexes.peek();
- int nDecls = m_prefixMappings.size();
- int prev = DTM.NULL;
-
- if(!m_pastFirstElement)
- {
- // SPECIAL CASE: Implied declaration at root element
- prefix="xml";
- String declURL = "http://www.w3.org/XML/1998/namespace";
- exName = m_expandedNameTable.getExpandedTypeID(null, prefix, DTM.NAMESPACE_NODE);
- int val = m_valuesOrPrefixes.stringToIndex(declURL);
- prev = addNode(DTM.NAMESPACE_NODE, exName, elemNode,
- prev, val, false);
- m_pastFirstElement=true;
- }
-
- for (int i = startDecls; i < nDecls; i += 2)
- {
- prefix = (String) m_prefixMappings.elementAt(i);
-
- if (prefix == null)
- continue;
-
- String declURL = (String) m_prefixMappings.elementAt(i + 1);
-
- exName = m_expandedNameTable.getExpandedTypeID(null, prefix, DTM.NAMESPACE_NODE);
-
- int val = m_valuesOrPrefixes.stringToIndex(declURL);
-
- prev = addNode(DTM.NAMESPACE_NODE, exName, elemNode,
- prev, val, false);
- }
-
- int n = attributes.getLength();
-
- for (int i = 0; i < n; i++)
- {
- String attrUri = attributes.getURI(i);
- String attrQName = attributes.getQName(i);
- String valString = attributes.getValue(i);
-
- prefix = getPrefix(attrQName, attrUri);
-
- int nodeType;
-
- String attrLocalName = attributes.getLocalName(i);
-
- if ((null != attrQName)
- && (attrQName.equals("xmlns")
- || attrQName.startsWith("xmlns:")))
- {
- if (declAlreadyDeclared(prefix))
- continue; // go to the next attribute.
-
- nodeType = DTM.NAMESPACE_NODE;
- }
- else
- {
- nodeType = DTM.ATTRIBUTE_NODE;
-
- if (attributes.getType(i).equalsIgnoreCase("ID"))
- setIDAttribute(valString, elemNode);
- }
-
- // Bit of a hack... if somehow valString is null, stringToIndex will
- // return -1, which will make things very unhappy.
- if(null == valString)
- valString = "";
-
- int val = m_valuesOrPrefixes.stringToIndex(valString);
- //String attrLocalName = attributes.getLocalName(i);
-
- if (null != prefix)
- {
-
- prefixIndex = m_valuesOrPrefixes.stringToIndex(attrQName);
-
- int dataIndex = m_data.size();
-
- m_data.addElement(prefixIndex);
- m_data.addElement(val);
-
- val = -dataIndex;
- }
-
- exName = m_expandedNameTable.getExpandedTypeID(attrUri, attrLocalName, nodeType);
- prev = addNode(nodeType, exName, elemNode, prev, val,
- false);
- }
-
- if (DTM.NULL != prev)
- m_nextsib.setElementAt(DTM.NULL,prev);
-
- if (null != m_wsfilter)
- {
- short wsv = m_wsfilter.getShouldStripSpace(makeNodeHandle(elemNode), this);
- boolean shouldStrip = (DTMWSFilter.INHERIT == wsv)
- ? getShouldStripWhitespace()
- : (DTMWSFilter.STRIP == wsv);
-
- pushShouldStripWhitespace(shouldStrip);
- }
-
- m_previous = DTM.NULL;
-
- m_contextIndexes.push(m_prefixMappings.size()); // for the children.
- }
-
- /**
- * Receive notification of the end of an element.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass to take specific actions at the end of
- * each element (such as finalising a tree node or writing
- * output to a file).</p>
- *
- * @param uri The Namespace URI, or the empty string if the
- * element has no Namespace URI or if Namespace
- * processing is not being performed.
- * @param localName The local name (without prefix), or the
- * empty string if Namespace processing is not being
- * performed.
- * @param qName The qualified XML 1.0 name (with prefix), or the
- * empty string if qualified names are not available.
- * @throws SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ContentHandler#endElement
- */
- public void endElement(String uri, String localName, String qName)
- throws SAXException
- {
- if (DEBUG)
- System.out.println("endElement: uri: " + uri + ", localname: "
- + localName + ", qname: "+qName);
-
- charactersFlush();
-
- // If no one noticed, startPrefixMapping is a drag.
- // Pop the context for the last child (the one pushed by startElement)
- m_contextIndexes.quickPop(1);
-
- // Do it again for this one (the one pushed by the last endElement).
- int topContextIndex = m_contextIndexes.peek();
- if (topContextIndex != m_prefixMappings.size()) {
- m_prefixMappings.setSize(topContextIndex);
- }
-
- int lastNode = m_previous;
-
- m_previous = m_parents.pop();
-
- // If lastNode is still DTM.NULL, this element had no children
- if (DTM.NULL == lastNode)
- m_firstch.setElementAt(DTM.NULL,m_previous);
- else
- m_nextsib.setElementAt(DTM.NULL,lastNode);
-
- popShouldStripWhitespace();
- }
-
- /**
- * Receive notification of character data inside an element.
- *
- * <p>By default, do nothing. Application writers may override this
- * method to take specific actions for each chunk of character data
- * (such as adding the data to a node or buffer, or printing it to
- * a file).</p>
- *
- * @param ch The characters.
- * @param start The start position in the character array.
- * @param length The number of characters to use from the
- * character array.
- * @throws SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ContentHandler#characters
- */
- public void characters(char ch[], int start, int length) throws SAXException
- {
- if (m_textPendingStart == -1) // First one in this block
- {
- m_textPendingStart = m_chars.size();
- m_coalescedTextType = m_textType;
- }
- // Type logic: If all adjacent text is CDATASections, the
- // concatentated text is treated as a single CDATASection (see
- // initialization above). If any were ordinary Text, the whole
- // thing is treated as Text. This may be worth %REVIEW%ing.
- else if (m_textType == DTM.TEXT_NODE)
- {
- m_coalescedTextType = DTM.TEXT_NODE;
- }
-
- m_chars.append(ch, start, length);
- }
-
- /**
- * Receive notification of ignorable whitespace in element content.
- *
- * <p>By default, do nothing. Application writers may override this
- * method to take specific actions for each chunk of ignorable
- * whitespace (such as adding data to a node or buffer, or printing
- * it to a file).</p>
- *
- * @param ch The whitespace characters.
- * @param start The start position in the character array.
- * @param length The number of characters to use from the
- * character array.
- * @throws SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ContentHandler#ignorableWhitespace
- */
- public void ignorableWhitespace(char ch[], int start, int length)
- throws SAXException
- {
-
- // %OPT% We can probably take advantage of the fact that we know this
- // is whitespace.
- characters(ch, start, length);
- }
-
- /**
- * Receive notification of a processing instruction.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass to take specific actions for each
- * processing instruction, such as setting status variables or
- * invoking other methods.</p>
- *
- * @param target The processing instruction target.
- * @param data The processing instruction data, or null if
- * none is supplied.
- * @throws SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ContentHandler#processingInstruction
- */
- public void processingInstruction(String target, String data)
- throws SAXException
- {
- if (DEBUG)
- System.out.println("processingInstruction: target: " + target +", data: "+data);
-
- charactersFlush();
-
- int exName = m_expandedNameTable.getExpandedTypeID(null, target,
- DTM.PROCESSING_INSTRUCTION_NODE);
- int dataIndex = m_valuesOrPrefixes.stringToIndex(data);
-
- m_previous = addNode(DTM.PROCESSING_INSTRUCTION_NODE, exName,
- m_parents.peek(), m_previous,
- dataIndex, false);
- }
-
- /**
- * Receive notification of a skipped entity.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass to take specific actions for each
- * processing instruction, such as setting status variables or
- * invoking other methods.</p>
- *
- * @param name The name of the skipped entity.
- * @throws SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ContentHandler#processingInstruction
- */
- public void skippedEntity(String name) throws SAXException
- {
-
- // %REVIEW% What should be done here?
- // no op
- }
-
- ////////////////////////////////////////////////////////////////////
- // Implementation of the ErrorHandler interface.
- ////////////////////////////////////////////////////////////////////
-
- /**
- * Receive notification of a parser warning.
- *
- * <p>The default implementation does nothing. Application writers
- * may override this method in a subclass to take specific actions
- * for each warning, such as inserting the message in a log file or
- * printing it to the console.</p>
- *
- * @param e The warning information encoded as an exception.
- * @throws SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ErrorHandler#warning
- * @see org.xml.sax.SAXParseException
- */
- public void warning(SAXParseException e) throws SAXException
- {
-
- // %REVIEW% Is there anyway to get the JAXP error listener here?
- System.err.println(e.getMessage());
- }
-
- /**
- * Receive notification of a recoverable parser error.
- *
- * <p>The default implementation does nothing. Application writers
- * may override this method in a subclass to take specific actions
- * for each error, such as inserting the message in a log file or
- * printing it to the console.</p>
- *
- * @param e The warning information encoded as an exception.
- * @throws SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ErrorHandler#warning
- * @see org.xml.sax.SAXParseException
- */
- public void error(SAXParseException e) throws SAXException
- {
- throw e;
- }
-
- /**
- * Report a fatal XML parsing error.
- *
- * <p>The default implementation throws a SAXParseException.
- * Application writers may override this method in a subclass if
- * they need to take specific actions for each fatal error (such as
- * collecting all of the errors into a single report): in any case,
- * the application must stop all regular processing when this
- * method is invoked, since the document is no longer reliable, and
- * the parser may no longer report parsing events.</p>
- *
- * @param e The error information encoded as an exception.
- * @throws SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ErrorHandler#fatalError
- * @see org.xml.sax.SAXParseException
- */
- public void fatalError(SAXParseException e) throws SAXException
- {
- throw e;
- }
-
- ////////////////////////////////////////////////////////////////////
- // Implementation of the DeclHandler interface.
- ////////////////////////////////////////////////////////////////////
-
- /**
- * Report an element type declaration.
- *
- * <p>The content model will consist of the string "EMPTY", the
- * string "ANY", or a parenthesised group, optionally followed
- * by an occurrence indicator. The model will be normalized so
- * that all whitespace is removed,and will include the enclosing
- * parentheses.</p>
- *
- * @param name The element type name.
- * @param model The content model as a normalized string.
- * @throws SAXException The application may raise an exception.
- */
- public void elementDecl(String name, String model) throws SAXException
- {
-
- // no op
- }
-
- /**
- * Report an attribute type declaration.
- *
- * <p>Only the effective (first) declaration for an attribute will
- * be reported. The type will be one of the strings "CDATA",
- * "ID", "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY",
- * "ENTITIES", or "NOTATION", or a parenthesized token group with
- * the separator "|" and all whitespace removed.</p>
- *
- * @param eName The name of the associated element.
- * @param aName The name of the attribute.
- * @param type A string representing the attribute type.
- * @param valueDefault A string representing the attribute default
- * ("#IMPLIED", "#REQUIRED", or "#FIXED") or null if
- * none of these applies.
- * @param value A string representing the attribute's default value,
- * or null if there is none.
- * @throws SAXException The application may raise an exception.
- */
- public void attributeDecl(
- String eName, String aName, String type, String valueDefault, String value)
- throws SAXException
- {
-
- // no op
- }
-
- /**
- * Report an internal entity declaration.
- *
- * <p>Only the effective (first) declaration for each entity
- * will be reported.</p>
- *
- * @param name The name of the entity. If it is a parameter
- * entity, the name will begin with '%'.
- * @param value The replacement text of the entity.
- * @throws SAXException The application may raise an exception.
- * @see #externalEntityDecl
- * @see org.xml.sax.DTDHandler#unparsedEntityDecl
- */
- public void internalEntityDecl(String name, String value)
- throws SAXException
- {
-
- // no op
- }
-
- /**
- * Report a parsed external entity declaration.
- *
- * <p>Only the effective (first) declaration for each entity
- * will be reported.</p>
- *
- * @param name The name of the entity. If it is a parameter
- * entity, the name will begin with '%'.
- * @param publicId The declared public identifier of the entity, or
- * null if none was declared.
- * @param systemId The declared system identifier of the entity.
- * @throws SAXException The application may raise an exception.
- * @see #internalEntityDecl
- * @see org.xml.sax.DTDHandler#unparsedEntityDecl
- */
- public void externalEntityDecl(
- String name, String publicId, String systemId) throws SAXException
- {
-
- // no op
- }
-
- ////////////////////////////////////////////////////////////////////
- // Implementation of the LexicalHandler interface.
- ////////////////////////////////////////////////////////////////////
-
- /**
- * Report the start of DTD declarations, if any.
- *
- * <p>Any declarations are assumed to be in the internal subset
- * unless otherwise indicated by a {@link #startEntity startEntity}
- * event.</p>
- *
- * <p>Note that the start/endDTD events will appear within
- * the start/endDocument events from ContentHandler and
- * before the first startElement event.</p>
- *
- * @param name The document type name.
- * @param publicId The declared public identifier for the
- * external DTD subset, or null if none was declared.
- * @param systemId The declared system identifier for the
- * external DTD subset, or null if none was declared.
- * @throws SAXException The application may raise an
- * exception.
- * @see #endDTD
- * @see #startEntity
- */
- public void startDTD(String name, String publicId, String systemId)
- throws SAXException
- {
-
- m_insideDTD = true;
- }
-
- /**
- * Report the end of DTD declarations.
- *
- * @throws SAXException The application may raise an exception.
- * @see #startDTD
- */
- public void endDTD() throws SAXException
- {
-
- m_insideDTD = false;
- }
-
- /**
- * Report the beginning of an entity in content.
- *
- * <p><strong>NOTE:</entity> entity references in attribute
- * values -- and the start and end of the document entity --
- * are never reported.</p>
- *
- * <p>The start and end of the external DTD subset are reported
- * using the pseudo-name "[dtd]". All other events must be
- * properly nested within start/end entity events.</p>
- *
- * <p>Note that skipped entities will be reported through the
- * {@link org.xml.sax.ContentHandler#skippedEntity skippedEntity}
- * event, which is part of the ContentHandler interface.</p>
- *
- * @param name The name of the entity. If it is a parameter
- * entity, the name will begin with '%'.
- * @throws SAXException The application may raise an exception.
- * @see #endEntity
- * @see org.xml.sax.ext.DeclHandler#internalEntityDecl
- * @see org.xml.sax.ext.DeclHandler#externalEntityDecl
- */
- public void startEntity(String name) throws SAXException
- {
-
- // no op
- }
-
- /**
- * Report the end of an entity.
- *
- * @param name The name of the entity that is ending.
- * @throws SAXException The application may raise an exception.
- * @see #startEntity
- */
- public void endEntity(String name) throws SAXException
- {
-
- // no op
- }
-
- /**
- * Report the start of a CDATA section.
- *
- * <p>The contents of the CDATA section will be reported through
- * the regular {@link org.xml.sax.ContentHandler#characters
- * characters} event.</p>
- *
- * @throws SAXException The application may raise an exception.
- * @see #endCDATA
- */
- public void startCDATA() throws SAXException
- {
- m_textType = DTM.CDATA_SECTION_NODE;
- }
-
- /**
- * Report the end of a CDATA section.
- *
- * @throws SAXException The application may raise an exception.
- * @see #startCDATA
- */
- public void endCDATA() throws SAXException
- {
- m_textType = DTM.TEXT_NODE;
- }
-
- /**
- * Report an XML comment anywhere in the document.
- *
- * <p>This callback will be used for comments inside or outside the
- * document element, including comments in the external DTD
- * subset (if read).</p>
- *
- * @param ch An array holding the characters in the comment.
- * @param start The starting position in the array.
- * @param length The number of characters to use from the array.
- * @throws SAXException The application may raise an exception.
- */
- public void comment(char ch[], int start, int length) throws SAXException
- {
-
- if (m_insideDTD) // ignore comments if we're inside the DTD
- return;
-
- charactersFlush();
-
- int exName = m_expandedNameTable.getExpandedTypeID(DTM.COMMENT_NODE);
-
- // For now, treat comments as strings... I guess we should do a
- // seperate FSB buffer instead.
- int dataIndex = m_valuesOrPrefixes.stringToIndex(new String(ch, start,
- length));
-
-
- m_previous = addNode(DTM.COMMENT_NODE, exName,
- m_parents.peek(), m_previous, dataIndex, false);
- }
-
- /**
- * Set a run time property for this DTM instance.
- *
- * %REVIEW% Now that we no longer use this method to support
- * getSourceLocatorFor, can we remove it?
- *
- * @param property a <code>String</code> value
- * @param value an <code>Object</code> value
- */
- public void setProperty(String property, Object value)
- {
- }
-
- /** Retrieve the SourceLocator associated with a specific node.
- * This is only meaningful if the XalanProperties.SOURCE_LOCATION flag was
- * set True using setProperty; if it was never set, or was set false, we
- * will return null.
- *
- * (We _could_ return a locator with the document's base URI and bogus
- * line/column information. Trying that; see the else clause.)
- * */
- public SourceLocator getSourceLocatorFor(int node)
- {
- if (m_useSourceLocationProperty)
- {
-
- node = makeNodeIdentity(node);
-
-
- return new NodeLocator(null,
- m_sourceSystemId.elementAt(node),
- m_sourceLine.elementAt(node),
- m_sourceColumn.elementAt(node));
- }
- else if(m_locator!=null)
- {
- return new NodeLocator(null,m_locator.getSystemId(),-1,-1);
- }
- else if(m_systemId!=null)
- {
- return new NodeLocator(null,m_systemId,-1,-1);
- }
- return null;
- }
-
- public String getFixedNames(int type){
- return m_fixednames[type];
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/dtm/ref/sax2dtm/SAX2DTM2.java b/src/com/sun/org/apache/xml/internal/dtm/ref/sax2dtm/SAX2DTM2.java
deleted file mode 100644
index 526f5e1..0000000
--- a/src/com/sun/org/apache/xml/internal/dtm/ref/sax2dtm/SAX2DTM2.java
+++ /dev/null
@@ -1,3385 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: SAX2DTM2.java,v 1.2.4.1 2005/09/15 08:15:12 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.dtm.ref.sax2dtm;
-
-import com.sun.org.apache.xml.internal.dtm.*;
-import com.sun.org.apache.xml.internal.dtm.ref.*;
-import com.sun.org.apache.xml.internal.utils.FastStringBuffer;
-import com.sun.org.apache.xml.internal.utils.XMLString;
-import com.sun.org.apache.xml.internal.utils.XMLStringDefault;
-import com.sun.org.apache.xml.internal.utils.XMLStringFactory;
-import com.sun.org.apache.xml.internal.res.XMLMessages;
-import com.sun.org.apache.xml.internal.res.XMLErrorResources;
-import com.sun.org.apache.xml.internal.serializer.SerializationHandler;
-
-import javax.xml.transform.Source;
-import java.util.Vector;
-import com.sun.org.apache.xml.internal.utils.SuballocatedIntVector;
-import org.xml.sax.*;
-
-/**
- * SAX2DTM2 is an optimized version of SAX2DTM which is used in non-incremental situation.
- * It is used as the super class of the XSLTC SAXImpl. Many of the interfaces in SAX2DTM
- * and DTMDefaultBase are overridden in SAX2DTM2 in order to allow fast, efficient
- * access to the DTM model. Some nested iterators in DTMDefaultBaseIterators
- * are also overridden in SAX2DTM2 for performance reasons.
- * <p>
- * Performance is the biggest consideration in the design of SAX2DTM2. To make the code most
- * efficient, the incremental support is dropped in SAX2DTM2, which means that you should not
- * use it in incremental situation. To reduce the overhead of pulling data from the DTM model,
- * a few core interfaces in SAX2DTM2 have direct access to the internal arrays of the
- * SuballocatedIntVectors.
- * <p>
- * The design of SAX2DTM2 may limit its extensibilty. If you have a reason to extend the
- * SAX2DTM model, please extend from SAX2DTM instead of this class.
- * <p>
- * TODO: This class is currently only used by XSLTC. We need to investigate the possibility
- * of also using it in Xalan-J Interpretive. Xalan's performance is likely to get an instant
- * boost if we use SAX2DTM2 instead of SAX2DTM in non-incremental case.
- * <p>
- * %MK% The code in this class is critical to the XSLTC_DTM performance. Be very careful
- * when making changes here!
- */
-public class SAX2DTM2 extends SAX2DTM
-{
-
- /****************************************************************
- * Optimized version of the nested iterators
- ****************************************************************/
-
- /**
- * Iterator that returns all immediate children of a given node
- */
- public final class ChildrenIterator extends InternalAxisIteratorBase
- {
-
- /**
- * Setting start to END should 'close' the iterator,
- * i.e. subsequent call to next() should return END.
- * <p>
- * If the iterator is not restartable, this has no effect.
- * %REVIEW% Should it return/throw something in that case,
- * or set current node to END, to indicate request-not-honored?
- *
- * @param node Sets the root of the iteration.
- *
- * @return A DTMAxisIterator set to the start of the iteration.
- */
- public DTMAxisIterator setStartNode(int node)
- {
-//%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
- if (node == DTMDefaultBase.ROOTNODE)
- node = getDocument();
- if (_isRestartable)
- {
- _startNode = node;
- _currentNode = (node == DTM.NULL) ? DTM.NULL
- : _firstch2(makeNodeIdentity(node));
-
- return resetPosition();
- }
-
- return this;
- }
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END if no more
- * are available.
- */
- public int next()
- {
- if (_currentNode != NULL) {
- int node = _currentNode;
- _currentNode = _nextsib2(node);
- return returnNode(makeNodeHandle(node));
- }
-
- return END;
- }
- } // end of ChildrenIterator
-
- /**
- * Iterator that returns the parent of a given node. Note that
- * this delivers only a single node; if you want all the ancestors,
- * see AncestorIterator.
- */
- public final class ParentIterator extends InternalAxisIteratorBase
- {
-
- /** The extended type ID that was requested. */
- private int _nodeType = DTM.NULL;
-
- /**
- * Set start to END should 'close' the iterator,
- * i.e. subsequent call to next() should return END.
- *
- * @param node Sets the root of the iteration.
- *
- * @return A DTMAxisIterator set to the start of the iteration.
- */
- public DTMAxisIterator setStartNode(int node)
- {
-//%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
- if (node == DTMDefaultBase.ROOTNODE)
- node = getDocument();
- if (_isRestartable)
- {
- _startNode = node;
-
- if (node != DTM.NULL)
- _currentNode = _parent2(makeNodeIdentity(node));
- else
- _currentNode = DTM.NULL;
-
- return resetPosition();
- }
-
- return this;
- }
-
- /**
- * Set the node type of the parent that we're looking for.
- * Note that this does _not_ mean "find the nearest ancestor of
- * this type", but "yield the parent if it is of this type".
- *
- *
- * @param type extended type ID.
- *
- * @return ParentIterator configured with the type filter set.
- */
- public DTMAxisIterator setNodeType(final int type)
- {
-
- _nodeType = type;
-
- return this;
- }
-
- /**
- * Get the next node in the iteration. In this case, we return
- * only the immediate parent, _if_ it matches the requested nodeType.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next()
- {
- int result = _currentNode;
- if (result == END)
- return DTM.NULL;
-
- // %OPT% The most common case is handled first.
- if (_nodeType == NULL) {
- _currentNode = END;
- return returnNode(makeNodeHandle(result));
- }
- else if (_nodeType >= DTM.NTYPES) {
- if (_nodeType == _exptype2(result)) {
- _currentNode = END;
- return returnNode(makeNodeHandle(result));
- }
- }
- else {
- if (_nodeType == _type2(result)) {
- _currentNode = END;
- return returnNode(makeNodeHandle(result));
- }
- }
-
- return DTM.NULL;
- }
- } // end of ParentIterator
-
- /**
- * Iterator that returns children of a given type for a given node.
- * The functionality chould be achieved by putting a filter on top
- * of a basic child iterator, but a specialised iterator is used
- * for efficiency (both speed and size of translet).
- */
- public final class TypedChildrenIterator extends InternalAxisIteratorBase
- {
-
- /** The extended type ID that was requested. */
- private final int _nodeType;
-
- /**
- * Constructor TypedChildrenIterator
- *
- *
- * @param nodeType The extended type ID being requested.
- */
- public TypedChildrenIterator(int nodeType)
- {
- _nodeType = nodeType;
- }
-
- /**
- * Set start to END should 'close' the iterator,
- * i.e. subsequent call to next() should return END.
- *
- * @param node Sets the root of the iteration.
- *
- * @return A DTMAxisIterator set to the start of the iteration.
- */
- public DTMAxisIterator setStartNode(int node)
- {
-//%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
- if (node == DTMDefaultBase.ROOTNODE)
- node = getDocument();
- if (_isRestartable)
- {
- _startNode = node;
- _currentNode = (node == DTM.NULL)
- ? DTM.NULL
- : _firstch2(makeNodeIdentity(_startNode));
-
- return resetPosition();
- }
-
- return this;
- }
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next()
- {
- int node = _currentNode;
- if (node == DTM.NULL)
- return DTM.NULL;
-
- final int nodeType = _nodeType;
-
- if (nodeType != DTM.ELEMENT_NODE) {
- while (node != DTM.NULL && _exptype2(node) != nodeType) {
- node = _nextsib2(node);
- }
- }
- // %OPT% If the nodeType is element (matching child::*), we only
- // need to compare the expType with DTM.NTYPES. A child node of
- // an element can be either an element, text, comment or
- // processing instruction node. Only element node has an extended
- // type greater than or equal to DTM.NTYPES.
- else {
- int eType;
- while (node != DTM.NULL) {
- eType = _exptype2(node);
- if (eType >= DTM.NTYPES)
- break;
- else
- node = _nextsib2(node);
- }
- }
-
- if (node == DTM.NULL) {
- _currentNode = DTM.NULL;
- return DTM.NULL;
- } else {
- _currentNode = _nextsib2(node);
- return returnNode(makeNodeHandle(node));
- }
-
- }
-
- /**
- * Return the node at the given position.
- */
- public int getNodeByPosition(int position)
- {
- if (position <= 0)
- return DTM.NULL;
-
- int node = _currentNode;
- int pos = 0;
-
- final int nodeType = _nodeType;
- if (nodeType != DTM.ELEMENT_NODE) {
- while (node != DTM.NULL) {
- if (_exptype2(node) == nodeType) {
- pos++;
- if (pos == position)
- return makeNodeHandle(node);
- }
-
- node = _nextsib2(node);
- }
- return NULL;
- }
- else {
- while (node != DTM.NULL) {
- if (_exptype2(node) >= DTM.NTYPES) {
- pos++;
- if (pos == position)
- return makeNodeHandle(node);
- }
- node = _nextsib2(node);
- }
- return NULL;
- }
- }
-
- } // end of TypedChildrenIterator
-
- /**
- * Iterator that returns the namespace nodes as defined by the XPath data model
- * for a given node, filtered by extended type ID.
- */
- public class TypedRootIterator extends RootIterator
- {
-
- /** The extended type ID that was requested. */
- private final int _nodeType;
-
- /**
- * Constructor TypedRootIterator
- *
- * @param nodeType The extended type ID being requested.
- */
- public TypedRootIterator(int nodeType)
- {
- super();
- _nodeType = nodeType;
- }
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next()
- {
- if(_startNode == _currentNode)
- return NULL;
-
- final int node = _startNode;
- int expType = _exptype2(makeNodeIdentity(node));
-
- _currentNode = node;
-
- if (_nodeType >= DTM.NTYPES) {
- if (_nodeType == expType) {
- return returnNode(node);
- }
- }
- else {
- if (expType < DTM.NTYPES) {
- if (expType == _nodeType) {
- return returnNode(node);
- }
- }
- else {
- if (m_extendedTypes[expType].getNodeType() == _nodeType) {
- return returnNode(node);
- }
- }
- }
-
- return NULL;
- }
- } // end of TypedRootIterator
-
- /**
- * Iterator that returns all siblings of a given node.
- */
- public class FollowingSiblingIterator extends InternalAxisIteratorBase
- {
-
- /**
- * Set start to END should 'close' the iterator,
- * i.e. subsequent call to next() should return END.
- *
- * @param node Sets the root of the iteration.
- *
- * @return A DTMAxisIterator set to the start of the iteration.
- */
- public DTMAxisIterator setStartNode(int node)
- {
-//%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
- if (node == DTMDefaultBase.ROOTNODE)
- node = getDocument();
- if (_isRestartable)
- {
- _startNode = node;
- _currentNode = makeNodeIdentity(node);
-
- return resetPosition();
- }
-
- return this;
- }
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next()
- {
- _currentNode = (_currentNode == DTM.NULL) ? DTM.NULL
- : _nextsib2(_currentNode);
- return returnNode(makeNodeHandle(_currentNode));
- }
- } // end of FollowingSiblingIterator
-
- /**
- * Iterator that returns all following siblings of a given node.
- */
- public final class TypedFollowingSiblingIterator
- extends FollowingSiblingIterator
- {
-
- /** The extended type ID that was requested. */
- private final int _nodeType;
-
- /**
- * Constructor TypedFollowingSiblingIterator
- *
- *
- * @param type The extended type ID being requested.
- */
- public TypedFollowingSiblingIterator(int type)
- {
- _nodeType = type;
- }
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next()
- {
- if (_currentNode == DTM.NULL) {
- return DTM.NULL;
- }
-
- int node = _currentNode;
- final int nodeType = _nodeType;
-
- if (nodeType != DTM.ELEMENT_NODE) {
- while ((node = _nextsib2(node)) != DTM.NULL && _exptype2(node) != nodeType) {}
- }
- else {
- while ((node = _nextsib2(node)) != DTM.NULL && _exptype2(node) < DTM.NTYPES) {}
- }
-
- _currentNode = node;
-
- return (node == DTM.NULL)
- ? DTM.NULL
- : returnNode(makeNodeHandle(node));
- }
-
- } // end of TypedFollowingSiblingIterator
-
- /**
- * Iterator that returns attribute nodes (of what nodes?)
- */
- public final class AttributeIterator extends InternalAxisIteratorBase
- {
-
- // assumes caller will pass element nodes
-
- /**
- * Set start to END should 'close' the iterator,
- * i.e. subsequent call to next() should return END.
- *
- * @param node Sets the root of the iteration.
- *
- * @return A DTMAxisIterator set to the start of the iteration.
- */
- public DTMAxisIterator setStartNode(int node)
- {
-//%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
- if (node == DTMDefaultBase.ROOTNODE)
- node = getDocument();
- if (_isRestartable)
- {
- _startNode = node;
- _currentNode = getFirstAttributeIdentity(makeNodeIdentity(node));
-
- return resetPosition();
- }
-
- return this;
- }
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next()
- {
-
- final int node = _currentNode;
-
- if (node != NULL) {
- _currentNode = getNextAttributeIdentity(node);
- return returnNode(makeNodeHandle(node));
- }
-
- return NULL;
- }
- } // end of AttributeIterator
-
- /**
- * Iterator that returns attribute nodes of a given type
- */
- public final class TypedAttributeIterator extends InternalAxisIteratorBase
- {
-
- /** The extended type ID that was requested. */
- private final int _nodeType;
-
- /**
- * Constructor TypedAttributeIterator
- *
- *
- * @param nodeType The extended type ID that is requested.
- */
- public TypedAttributeIterator(int nodeType)
- {
- _nodeType = nodeType;
- }
-
- // assumes caller will pass element nodes
-
- /**
- * Set start to END should 'close' the iterator,
- * i.e. subsequent call to next() should return END.
- *
- * @param node Sets the root of the iteration.
- *
- * @return A DTMAxisIterator set to the start of the iteration.
- */
- public DTMAxisIterator setStartNode(int node)
- {
- if (_isRestartable)
- {
- _startNode = node;
-
- _currentNode = getTypedAttribute(node, _nodeType);
-
- return resetPosition();
- }
-
- return this;
- }
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next()
- {
-
- final int node = _currentNode;
-
- // singleton iterator, since there can only be one attribute of
- // a given type.
- _currentNode = NULL;
-
- return returnNode(node);
- }
- } // end of TypedAttributeIterator
-
- /**
- * Iterator that returns preceding siblings of a given node
- */
- public class PrecedingSiblingIterator extends InternalAxisIteratorBase
- {
-
- /**
- * The node identity of _startNode for this iterator
- */
- protected int _startNodeID;
-
- /**
- * True if this iterator has a reversed axis.
- *
- * @return true.
- */
- public boolean isReverse()
- {
- return true;
- }
-
- /**
- * Set start to END should 'close' the iterator,
- * i.e. subsequent call to next() should return END.
- *
- * @param node Sets the root of the iteration.
- *
- * @return A DTMAxisIterator set to the start of the iteration.
- */
- public DTMAxisIterator setStartNode(int node)
- {
-//%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
- if (node == DTMDefaultBase.ROOTNODE)
- node = getDocument();
- if (_isRestartable)
- {
- _startNode = node;
- node = _startNodeID = makeNodeIdentity(node);
-
- if(node == NULL)
- {
- _currentNode = node;
- return resetPosition();
- }
-
- int type = _type2(node);
- if(ExpandedNameTable.ATTRIBUTE == type
- || ExpandedNameTable.NAMESPACE == type )
- {
- _currentNode = node;
- }
- else
- {
- // Be careful to handle the Document node properly
- _currentNode = _parent2(node);
- if(NULL!=_currentNode)
- _currentNode = _firstch2(_currentNode);
- else
- _currentNode = node;
- }
-
- return resetPosition();
- }
-
- return this;
- }
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next()
- {
-
- if (_currentNode == _startNodeID || _currentNode == DTM.NULL)
- {
- return NULL;
- }
- else
- {
- final int node = _currentNode;
- _currentNode = _nextsib2(node);
-
- return returnNode(makeNodeHandle(node));
- }
- }
- } // end of PrecedingSiblingIterator
-
- /**
- * Iterator that returns preceding siblings of a given type for
- * a given node
- */
- public final class TypedPrecedingSiblingIterator
- extends PrecedingSiblingIterator
- {
-
- /** The extended type ID that was requested. */
- private final int _nodeType;
-
- /**
- * Constructor TypedPrecedingSiblingIterator
- *
- *
- * @param type The extended type ID being requested.
- */
- public TypedPrecedingSiblingIterator(int type)
- {
- _nodeType = type;
- }
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next()
- {
- int node = _currentNode;
-
- final int nodeType = _nodeType;
- final int startNodeID = _startNodeID;
-
- if (nodeType != DTM.ELEMENT_NODE) {
- while (node != NULL && node != startNodeID && _exptype2(node) != nodeType) {
- node = _nextsib2(node);
- }
- }
- else {
- while (node != NULL && node != startNodeID && _exptype2(node) < DTM.NTYPES) {
- node = _nextsib2(node);
- }
- }
-
- if (node == DTM.NULL || node == startNodeID) {
- _currentNode = NULL;
- return NULL;
- }
- else {
- _currentNode = _nextsib2(node);
- return returnNode(makeNodeHandle(node));
- }
- }
-
- /**
- * Return the index of the last node in this iterator.
- */
- public int getLast()
- {
- if (_last != -1)
- return _last;
-
- setMark();
-
- int node = _currentNode;
- final int nodeType = _nodeType;
- final int startNodeID = _startNodeID;
-
- int last = 0;
- if (nodeType != DTM.ELEMENT_NODE) {
- while (node != NULL && node != startNodeID) {
- if (_exptype2(node) == nodeType) {
- last++;
- }
- node = _nextsib2(node);
- }
- }
- else {
- while (node != NULL && node != startNodeID) {
- if (_exptype2(node) >= DTM.NTYPES) {
- last++;
- }
- node = _nextsib2(node);
- }
- }
-
- gotoMark();
-
- return (_last = last);
- }
- } // end of TypedPrecedingSiblingIterator
-
- /**
- * Iterator that returns preceding nodes of a given node.
- * This includes the node set {root+1, start-1}, but excludes
- * all ancestors, attributes, and namespace nodes.
- */
- public class PrecedingIterator extends InternalAxisIteratorBase
- {
-
- /** The max ancestors, but it can grow... */
- private final int _maxAncestors = 8;
-
- /**
- * The stack of start node + ancestors up to the root of the tree,
- * which we must avoid.
- */
- protected int[] _stack = new int[_maxAncestors];
-
- /** (not sure yet... -sb) */
- protected int _sp, _oldsp;
-
- protected int _markedsp, _markedNode, _markedDescendant;
-
- /* _currentNode precedes candidates. This is the identity, not the handle! */
-
- /**
- * True if this iterator has a reversed axis.
- *
- * @return true since this iterator is a reversed axis.
- */
- public boolean isReverse()
- {
- return true;
- }
-
- /**
- * Returns a deep copy of this iterator. The cloned iterator is not reset.
- *
- * @return a deep copy of this iterator.
- */
- public DTMAxisIterator cloneIterator()
- {
- _isRestartable = false;
-
- try
- {
- final PrecedingIterator clone = (PrecedingIterator) super.clone();
- final int[] stackCopy = new int[_stack.length];
- System.arraycopy(_stack, 0, stackCopy, 0, _stack.length);
-
- clone._stack = stackCopy;
-
- // return clone.reset();
- return clone;
- }
- catch (CloneNotSupportedException e)
- {
- throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported.");
- }
- }
-
- /**
- * Set start to END should 'close' the iterator,
- * i.e. subsequent call to next() should return END.
- *
- * @param node Sets the root of the iteration.
- *
- * @return A DTMAxisIterator set to the start of the iteration.
- */
- public DTMAxisIterator setStartNode(int node)
- {
-//%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
- if (node == DTMDefaultBase.ROOTNODE)
- node = getDocument();
- if (_isRestartable)
- {
- node = makeNodeIdentity(node);
-
- // iterator is not a clone
- int parent, index;
-
- if (_type2(node) == DTM.ATTRIBUTE_NODE)
- node = _parent2(node);
-
- _startNode = node;
- _stack[index = 0] = node;
-
- parent=node;
- while ((parent = _parent2(parent)) != NULL)
- {
- if (++index == _stack.length)
- {
- final int[] stack = new int[index*2];
- System.arraycopy(_stack, 0, stack, 0, index);
- _stack = stack;
- }
- _stack[index] = parent;
- }
-
- if(index>0)
- --index; // Pop actual root node (if not start) back off the stack
-
- _currentNode=_stack[index]; // Last parent before root node
-
- _oldsp = _sp = index;
-
- return resetPosition();
- }
-
- return this;
- }
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next()
- {
- // Bugzilla 8324: We were forgetting to skip Attrs and NS nodes.
- // Also recoded the loop controls for clarity and to flatten out
- // the tail-recursion.
- for(++_currentNode; _sp>=0; ++_currentNode)
- {
- if(_currentNode < _stack[_sp])
- {
- int type = _type2(_currentNode);
- if(type != ATTRIBUTE_NODE && type != NAMESPACE_NODE)
- return returnNode(makeNodeHandle(_currentNode));
- }
- else
- --_sp;
- }
- return NULL;
- }
-
- // redefine DTMAxisIteratorBase's reset
-
- /**
- * Resets the iterator to the last start node.
- *
- * @return A DTMAxisIterator, which may or may not be the same as this
- * iterator.
- */
- public DTMAxisIterator reset()
- {
-
- _sp = _oldsp;
-
- return resetPosition();
- }
-
- public void setMark() {
- _markedsp = _sp;
- _markedNode = _currentNode;
- _markedDescendant = _stack[0];
- }
-
- public void gotoMark() {
- _sp = _markedsp;
- _currentNode = _markedNode;
- }
- } // end of PrecedingIterator
-
- /**
- * Iterator that returns preceding nodes of agiven type for a
- * given node. This includes the node set {root+1, start-1}, but
- * excludes all ancestors.
- */
- public final class TypedPrecedingIterator extends PrecedingIterator
- {
-
- /** The extended type ID that was requested. */
- private final int _nodeType;
-
- /**
- * Constructor TypedPrecedingIterator
- *
- *
- * @param type The extended type ID being requested.
- */
- public TypedPrecedingIterator(int type)
- {
- _nodeType = type;
- }
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next()
- {
- int node = _currentNode;
- final int nodeType = _nodeType;
-
- if (nodeType >= DTM.NTYPES) {
- while (true) {
- node++;
-
- if (_sp < 0) {
- node = NULL;
- break;
- }
- else if (node >= _stack[_sp]) {
- if (--_sp < 0) {
- node = NULL;
- break;
- }
- }
- else if (_exptype2(node) == nodeType) {
- break;
- }
- }
- }
- else {
- int expType;
-
- while (true) {
- node++;
-
- if (_sp < 0) {
- node = NULL;
- break;
- }
- else if (node >= _stack[_sp]) {
- if (--_sp < 0) {
- node = NULL;
- break;
- }
- }
- else {
- expType = _exptype2(node);
- if (expType < DTM.NTYPES) {
- if (expType == nodeType) {
- break;
- }
- }
- else {
- if (m_extendedTypes[expType].getNodeType() == nodeType) {
- break;
- }
- }
- }
- }
- }
-
- _currentNode = node;
-
- return (node == NULL) ? NULL : returnNode(makeNodeHandle(node));
- }
- } // end of TypedPrecedingIterator
-
- /**
- * Iterator that returns following nodes of for a given node.
- */
- public class FollowingIterator extends InternalAxisIteratorBase
- {
- //DTMAxisTraverser m_traverser; // easier for now
-
- public FollowingIterator()
- {
- //m_traverser = getAxisTraverser(Axis.FOLLOWING);
- }
-
- /**
- * Set start to END should 'close' the iterator,
- * i.e. subsequent call to next() should return END.
- *
- * @param node Sets the root of the iteration.
- *
- * @return A DTMAxisIterator set to the start of the iteration.
- */
- public DTMAxisIterator setStartNode(int node)
- {
-//%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
- if (node == DTMDefaultBase.ROOTNODE)
- node = getDocument();
- if (_isRestartable)
- {
- _startNode = node;
-
- //_currentNode = m_traverser.first(node);
-
- node = makeNodeIdentity(node);
-
- int first;
- int type = _type2(node);
-
- if ((DTM.ATTRIBUTE_NODE == type) || (DTM.NAMESPACE_NODE == type))
- {
- node = _parent2(node);
- first = _firstch2(node);
-
- if (NULL != first) {
- _currentNode = makeNodeHandle(first);
- return resetPosition();
- }
- }
-
- do
- {
- first = _nextsib2(node);
-
- if (NULL == first)
- node = _parent2(node);
- }
- while (NULL == first && NULL != node);
-
- _currentNode = makeNodeHandle(first);
-
- // _currentNode precedes possible following(node) nodes
- return resetPosition();
- }
-
- return this;
- }
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next()
- {
-
- int node = _currentNode;
-
- //_currentNode = m_traverser.next(_startNode, _currentNode);
- int current = makeNodeIdentity(node);
-
- while (true)
- {
- current++;
-
- int type = _type2(current);
- if (NULL == type) {
- _currentNode = NULL;
- return returnNode(node);
- }
-
- if (ATTRIBUTE_NODE == type || NAMESPACE_NODE == type)
- continue;
-
- _currentNode = makeNodeHandle(current);
- return returnNode(node);
- }
- }
-
- } // end of FollowingIterator
-
- /**
- * Iterator that returns following nodes of a given type for a given node.
- */
- public final class TypedFollowingIterator extends FollowingIterator
- {
-
- /** The extended type ID that was requested. */
- private final int _nodeType;
-
- /**
- * Constructor TypedFollowingIterator
- *
- *
- * @param type The extended type ID being requested.
- */
- public TypedFollowingIterator(int type)
- {
- _nodeType = type;
- }
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next()
- {
- int current;
- int node;
- int type;
-
- final int nodeType = _nodeType;
- int currentNodeID = makeNodeIdentity(_currentNode);
-
- if (nodeType >= DTM.NTYPES) {
- do {
- node = currentNodeID;
- current = node;
-
- do {
- current++;
- type = _type2(current);
- }
- while (type != NULL && (ATTRIBUTE_NODE == type || NAMESPACE_NODE == type));
-
- currentNodeID = (type != NULL) ? current : NULL;
- }
- while (node != DTM.NULL && _exptype2(node) != nodeType);
- }
- else {
- do {
- node = currentNodeID;
- current = node;
-
- do {
- current++;
- type = _type2(current);
- }
- while (type != NULL && (ATTRIBUTE_NODE == type || NAMESPACE_NODE == type));
-
- currentNodeID = (type != NULL) ? current : NULL;
- }
- while (node != DTM.NULL
- && (_exptype2(node) != nodeType && _type2(node) != nodeType));
- }
-
- _currentNode = makeNodeHandle(currentNodeID);
- return (node == DTM.NULL ? DTM.NULL :returnNode(makeNodeHandle(node)));
- }
- } // end of TypedFollowingIterator
-
- /**
- * Iterator that returns the ancestors of a given node in document
- * order. (NOTE! This was changed from the XSLTC code!)
- */
- public class AncestorIterator extends InternalAxisIteratorBase
- {
- // The initial size of the ancestor array
- private static final int m_blocksize = 32;
-
- // The array for ancestor nodes. This array will grow dynamically.
- int[] m_ancestors = new int[m_blocksize];
-
- // Number of ancestor nodes in the array
- int m_size = 0;
-
- int m_ancestorsPos;
-
- int m_markedPos;
-
- /** The real start node for this axes, since _startNode will be adjusted. */
- int m_realStartNode;
-
- /**
- * Get start to END should 'close' the iterator,
- * i.e. subsequent call to next() should return END.
- *
- * @return The root node of the iteration.
- */
- public int getStartNode()
- {
- return m_realStartNode;
- }
-
- /**
- * True if this iterator has a reversed axis.
- *
- * @return true since this iterator is a reversed axis.
- */
- public final boolean isReverse()
- {
- return true;
- }
-
- /**
- * Returns a deep copy of this iterator. The cloned iterator is not reset.
- *
- * @return a deep copy of this iterator.
- */
- public DTMAxisIterator cloneIterator()
- {
- _isRestartable = false; // must set to false for any clone
-
- try
- {
- final AncestorIterator clone = (AncestorIterator) super.clone();
-
- clone._startNode = _startNode;
-
- // return clone.reset();
- return clone;
- }
- catch (CloneNotSupportedException e)
- {
- throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported.");
- }
- }
-
- /**
- * Set start to END should 'close' the iterator,
- * i.e. subsequent call to next() should return END.
- *
- * @param node Sets the root of the iteration.
- *
- * @return A DTMAxisIterator set to the start of the iteration.
- */
- public DTMAxisIterator setStartNode(int node)
- {
-//%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
- if (node == DTMDefaultBase.ROOTNODE)
- node = getDocument();
- m_realStartNode = node;
-
- if (_isRestartable)
- {
- int nodeID = makeNodeIdentity(node);
- m_size = 0;
-
- if (nodeID == DTM.NULL) {
- _currentNode = DTM.NULL;
- m_ancestorsPos = 0;
- return this;
- }
-
- // Start from the current node's parent if
- // _includeSelf is false.
- if (!_includeSelf) {
- nodeID = _parent2(nodeID);
- node = makeNodeHandle(nodeID);
- }
-
- _startNode = node;
-
- while (nodeID != END) {
- //m_ancestors.addElement(node);
- if (m_size >= m_ancestors.length)
- {
- int[] newAncestors = new int[m_size * 2];
- System.arraycopy(m_ancestors, 0, newAncestors, 0, m_ancestors.length);
- m_ancestors = newAncestors;
- }
-
- m_ancestors[m_size++] = node;
- nodeID = _parent2(nodeID);
- node = makeNodeHandle(nodeID);
- }
-
- m_ancestorsPos = m_size - 1;
-
- _currentNode = (m_ancestorsPos>=0)
- ? m_ancestors[m_ancestorsPos]
- : DTM.NULL;
-
- return resetPosition();
- }
-
- return this;
- }
-
- /**
- * Resets the iterator to the last start node.
- *
- * @return A DTMAxisIterator, which may or may not be the same as this
- * iterator.
- */
- public DTMAxisIterator reset()
- {
-
- m_ancestorsPos = m_size - 1;
-
- _currentNode = (m_ancestorsPos >= 0) ? m_ancestors[m_ancestorsPos]
- : DTM.NULL;
-
- return resetPosition();
- }
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next()
- {
-
- int next = _currentNode;
-
- int pos = --m_ancestorsPos;
-
- _currentNode = (pos >= 0) ? m_ancestors[m_ancestorsPos]
- : DTM.NULL;
-
- return returnNode(next);
- }
-
- public void setMark() {
- m_markedPos = m_ancestorsPos;
- }
-
- public void gotoMark() {
- m_ancestorsPos = m_markedPos;
- _currentNode = m_ancestorsPos>=0 ? m_ancestors[m_ancestorsPos]
- : DTM.NULL;
- }
- } // end of AncestorIterator
-
- /**
- * Typed iterator that returns the ancestors of a given node.
- */
- public final class TypedAncestorIterator extends AncestorIterator
- {
-
- /** The extended type ID that was requested. */
- private final int _nodeType;
-
- /**
- * Constructor TypedAncestorIterator
- *
- *
- * @param type The extended type ID being requested.
- */
- public TypedAncestorIterator(int type)
- {
- _nodeType = type;
- }
-
- /**
- * Set start to END should 'close' the iterator,
- * i.e. subsequent call to next() should return END.
- *
- * @param node Sets the root of the iteration.
- *
- * @return A DTMAxisIterator set to the start of the iteration.
- */
- public DTMAxisIterator setStartNode(int node)
- {
-//%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
- if (node == DTMDefaultBase.ROOTNODE)
- node = getDocument();
- m_realStartNode = node;
-
- if (_isRestartable)
- {
- int nodeID = makeNodeIdentity(node);
- m_size = 0;
-
- if (nodeID == DTM.NULL) {
- _currentNode = DTM.NULL;
- m_ancestorsPos = 0;
- return this;
- }
-
- final int nodeType = _nodeType;
-
- if (!_includeSelf) {
- nodeID = _parent2(nodeID);
- node = makeNodeHandle(nodeID);
- }
-
- _startNode = node;
-
- if (nodeType >= DTM.NTYPES) {
- while (nodeID != END) {
- int eType = _exptype2(nodeID);
-
- if (eType == nodeType) {
- if (m_size >= m_ancestors.length)
- {
- int[] newAncestors = new int[m_size * 2];
- System.arraycopy(m_ancestors, 0, newAncestors, 0, m_ancestors.length);
- m_ancestors = newAncestors;
- }
- m_ancestors[m_size++] = makeNodeHandle(nodeID);
- }
- nodeID = _parent2(nodeID);
- }
- }
- else {
- while (nodeID != END) {
- int eType = _exptype2(nodeID);
-
- if ((eType < DTM.NTYPES && eType == nodeType)
- || (eType >= DTM.NTYPES
- && m_extendedTypes[eType].getNodeType() == nodeType)) {
- if (m_size >= m_ancestors.length)
- {
- int[] newAncestors = new int[m_size * 2];
- System.arraycopy(m_ancestors, 0, newAncestors, 0, m_ancestors.length);
- m_ancestors = newAncestors;
- }
- m_ancestors[m_size++] = makeNodeHandle(nodeID);
- }
- nodeID = _parent2(nodeID);
- }
- }
- m_ancestorsPos = m_size - 1;
-
- _currentNode = (m_ancestorsPos>=0)
- ? m_ancestors[m_ancestorsPos]
- : DTM.NULL;
-
- return resetPosition();
- }
-
- return this;
- }
-
- /**
- * Return the node at the given position.
- */
- public int getNodeByPosition(int position)
- {
- if (position > 0 && position <= m_size) {
- return m_ancestors[position-1];
- }
- else
- return DTM.NULL;
- }
-
- /**
- * Returns the position of the last node within the iteration, as
- * defined by XPath.
- */
- public int getLast() {
- return m_size;
- }
- } // end of TypedAncestorIterator
-
- /**
- * Iterator that returns the descendants of a given node.
- */
- public class DescendantIterator extends InternalAxisIteratorBase
- {
-
- /**
- * Set start to END should 'close' the iterator,
- * i.e. subsequent call to next() should return END.
- *
- * @param node Sets the root of the iteration.
- *
- * @return A DTMAxisIterator set to the start of the iteration.
- */
- public DTMAxisIterator setStartNode(int node)
- {
-//%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
- if (node == DTMDefaultBase.ROOTNODE)
- node = getDocument();
- if (_isRestartable)
- {
- node = makeNodeIdentity(node);
- _startNode = node;
-
- if (_includeSelf)
- node--;
-
- _currentNode = node;
-
- return resetPosition();
- }
-
- return this;
- }
-
- /**
- * Tell if this node identity is a descendant. Assumes that
- * the node info for the element has already been obtained.
- *
- * This one-sided test works only if the parent has been
- * previously tested and is known to be a descendent. It fails if
- * the parent is the _startNode's next sibling, or indeed any node
- * that follows _startNode in document order. That may suffice
- * for this iterator, but it's not really an isDescendent() test.
- * %REVIEW% rename?
- *
- * @param identity The index number of the node in question.
- * @return true if the index is a descendant of _startNode.
- */
- protected final boolean isDescendant(int identity)
- {
- return (_parent2(identity) >= _startNode) || (_startNode == identity);
- }
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next()
- {
- final int startNode = _startNode;
- if (startNode == NULL) {
- return NULL;
- }
-
- if (_includeSelf && (_currentNode + 1) == startNode)
- return returnNode(makeNodeHandle(++_currentNode)); // | m_dtmIdent);
-
- int node = _currentNode;
- int type;
-
- // %OPT% If the startNode is the root node, do not need
- // to do the isDescendant() check.
- if (startNode == ROOTNODE) {
- int eType;
- do {
- node++;
- eType = _exptype2(node);
-
- if (NULL == eType) {
- _currentNode = NULL;
- return END;
- }
- } while (eType == TEXT_NODE
- || (type = m_extendedTypes[eType].getNodeType()) == ATTRIBUTE_NODE
- || type == NAMESPACE_NODE);
- }
- else {
- do {
- node++;
- type = _type2(node);
-
- if (NULL == type ||!isDescendant(node)) {
- _currentNode = NULL;
- return END;
- }
- } while(ATTRIBUTE_NODE == type || TEXT_NODE == type
- || NAMESPACE_NODE == type);
- }
-
- _currentNode = node;
- return returnNode(makeNodeHandle(node)); // make handle.
- }
-
- /**
- * Reset.
- *
- */
- public DTMAxisIterator reset()
- {
-
- final boolean temp = _isRestartable;
-
- _isRestartable = true;
-
- setStartNode(makeNodeHandle(_startNode));
-
- _isRestartable = temp;
-
- return this;
- }
-
- } // end of DescendantIterator
-
- /**
- * Typed iterator that returns the descendants of a given node.
- */
- public final class TypedDescendantIterator extends DescendantIterator
- {
-
- /** The extended type ID that was requested. */
- private final int _nodeType;
-
- /**
- * Constructor TypedDescendantIterator
- *
- *
- * @param nodeType Extended type ID being requested.
- */
- public TypedDescendantIterator(int nodeType)
- {
- _nodeType = nodeType;
- }
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next()
- {
- final int startNode = _startNode;
- if (_startNode == NULL) {
- return NULL;
- }
-
- int node = _currentNode;
-
- int expType;
- final int nodeType = _nodeType;
-
- if (nodeType != DTM.ELEMENT_NODE)
- {
- do
- {
- node++;
- expType = _exptype2(node);
-
- if (NULL == expType || _parent2(node) < startNode && startNode != node) {
- _currentNode = NULL;
- return END;
- }
- }
- while (expType != nodeType);
- }
- // %OPT% If the start node is root (e.g. in the case of //node),
- // we can save the isDescendant() check, because all nodes are
- // descendants of root.
- else if (startNode == DTMDefaultBase.ROOTNODE)
- {
- do
- {
- node++;
- expType = _exptype2(node);
-
- if (NULL == expType) {
- _currentNode = NULL;
- return END;
- }
- } while (expType < DTM.NTYPES
- || m_extendedTypes[expType].getNodeType() != DTM.ELEMENT_NODE);
- }
- else
- {
- do
- {
- node++;
- expType = _exptype2(node);
-
- if (NULL == expType || _parent2(node) < startNode && startNode != node) {
- _currentNode = NULL;
- return END;
- }
- }
- while (expType < DTM.NTYPES
- || m_extendedTypes[expType].getNodeType() != DTM.ELEMENT_NODE);
- }
-
- _currentNode = node;
- return returnNode(makeNodeHandle(node));
- }
- } // end of TypedDescendantIterator
-
- /**
- * Iterator that returns a given node only if it is of a given type.
- */
- public final class TypedSingletonIterator extends SingletonIterator
- {
-
- /** The extended type ID that was requested. */
- private final int _nodeType;
-
- /**
- * Constructor TypedSingletonIterator
- *
- *
- * @param nodeType The extended type ID being requested.
- */
- public TypedSingletonIterator(int nodeType)
- {
- _nodeType = nodeType;
- }
-
- /**
- * Get the next node in the iteration.
- *
- * @return The next node handle in the iteration, or END.
- */
- public int next()
- {
-
- final int result = _currentNode;
- if (result == END)
- return DTM.NULL;
-
- _currentNode = END;
-
- if (_nodeType >= DTM.NTYPES) {
- if (_exptype2(makeNodeIdentity(result)) == _nodeType) {
- return returnNode(result);
- }
- }
- else {
- if (_type2(makeNodeIdentity(result)) == _nodeType) {
- return returnNode(result);
- }
- }
-
- return NULL;
- }
- } // end of TypedSingletonIterator
-
- /*******************************************************************
- * End of nested iterators
- *******************************************************************/
-
-
- // %OPT% Array references which are used to cache the map0 arrays in
- // SuballocatedIntVectors. Using the cached arrays reduces the level
- // of indirection and results in better performance than just calling
- // SuballocatedIntVector.elementAt().
- private int[] m_exptype_map0;
- private int[] m_nextsib_map0;
- private int[] m_firstch_map0;
- private int[] m_parent_map0;
-
- // Double array references to the map arrays in SuballocatedIntVectors.
- private int[][] m_exptype_map;
- private int[][] m_nextsib_map;
- private int[][] m_firstch_map;
- private int[][] m_parent_map;
-
- // %OPT% Cache the array of extended types in this class
- protected ExtendedType[] m_extendedTypes;
-
- // A Vector which is used to store the values of attribute, namespace,
- // comment and PI nodes.
- //
- // %OPT% These values are unlikely to be equal. Storing
- // them in a plain Vector is more efficient than storing in the
- // DTMStringPool because we can save the cost for hash calculation.
- //
- // %REVISIT% Do we need a custom class (e.g. StringVector) here?
- protected Vector m_values;
-
- // The current index into the m_values Vector.
- private int m_valueIndex = 0;
-
- // The maximum value of the current node index.
- private int m_maxNodeIndex;
-
- // Cache the shift and mask values for the SuballocatedIntVectors.
- protected int m_SHIFT;
- protected int m_MASK;
- protected int m_blocksize;
-
- /** %OPT% If the offset and length of a Text node are within certain limits,
- * we store a bitwise encoded value into an int, using 10 bits (max. 1024)
- * for length and 21 bits for offset. We can save two SuballocatedIntVector
- * calls for each getStringValueX() and dispatchCharacterEvents() call by
- * doing this.
- */
- // The number of bits for the length of a Text node.
- protected final static int TEXT_LENGTH_BITS = 10;
-
- // The number of bits for the offset of a Text node.
- protected final static int TEXT_OFFSET_BITS = 21;
-
- // The maximum length value
- protected final static int TEXT_LENGTH_MAX = (1<<TEXT_LENGTH_BITS) - 1;
-
- // The maximum offset value
- protected final static int TEXT_OFFSET_MAX = (1<<TEXT_OFFSET_BITS) - 1;
-
- // True if we want to build the ID index table.
- protected boolean m_buildIdIndex = true;
-
- // Constant for empty String
- private static final String EMPTY_STR = "";
-
- // Constant for empty XMLString
- private static final XMLString EMPTY_XML_STR = new XMLStringDefault("");
-
- /**
- * Construct a SAX2DTM2 object using the default block size.
- */
- public SAX2DTM2(DTMManager mgr, Source source, int dtmIdentity,
- DTMWSFilter whiteSpaceFilter,
- XMLStringFactory xstringfactory,
- boolean doIndexing)
- {
-
- this(mgr, source, dtmIdentity, whiteSpaceFilter,
- xstringfactory, doIndexing, DEFAULT_BLOCKSIZE, true, true, false);
- }
-
- /**
- * Construct a SAX2DTM2 object using the given block size.
- */
- public SAX2DTM2(DTMManager mgr, Source source, int dtmIdentity,
- DTMWSFilter whiteSpaceFilter,
- XMLStringFactory xstringfactory,
- boolean doIndexing,
- int blocksize,
- boolean usePrevsib,
- boolean buildIdIndex,
- boolean newNameTable)
- {
-
- super(mgr, source, dtmIdentity, whiteSpaceFilter,
- xstringfactory, doIndexing, blocksize, usePrevsib, newNameTable);
-
- // Initialize the values of m_SHIFT and m_MASK.
- int shift;
- for(shift=0; (blocksize>>>=1) != 0; ++shift);
-
- m_blocksize = 1<<shift;
- m_SHIFT = shift;
- m_MASK = m_blocksize - 1;
-
- m_buildIdIndex = buildIdIndex;
-
- // Some documents do not have attribute nodes. That is why
- // we set the initial size of this Vector to be small and set
- // the increment to a bigger number.
- m_values = new Vector(32, 512);
-
- m_maxNodeIndex = 1 << DTMManager.IDENT_DTM_NODE_BITS;
-
- // Set the map0 values in the constructor.
- m_exptype_map0 = m_exptype.getMap0();
- m_nextsib_map0 = m_nextsib.getMap0();
- m_firstch_map0 = m_firstch.getMap0();
- m_parent_map0 = m_parent.getMap0();
- }
-
- /**
- * Override DTMDefaultBase._exptype() by dropping the incremental code.
- *
- * <p>This one is less efficient than _exptype2. It is only used during
- * DTM building. _exptype2 is used after the document is fully built.
- */
- public final int _exptype(int identity)
- {
- return m_exptype.elementAt(identity);
- }
-
- /************************************************************************
- * DTM base accessor interfaces
- *
- * %OPT% The code in the following interfaces (e.g. _exptype2, etc.) are
- * very important to the DTM performance. To have the best performace,
- * these several interfaces have direct access to the internal arrays of
- * the SuballocatedIntVectors. The final modifier also has a noticeable
- * impact on performance.
- ***********************************************************************/
-
- /**
- * The optimized version of DTMDefaultBase._exptype().
- *
- * @param identity A node identity, which <em>must not</em> be equal to
- * <code>DTM.NULL</code>
- */
- public final int _exptype2(int identity)
- {
- //return m_exptype.elementAt(identity);
-
- if (identity < m_blocksize)
- return m_exptype_map0[identity];
- else
- return m_exptype_map[identity>>>m_SHIFT][identity&m_MASK];
- }
-
- /**
- * The optimized version of DTMDefaultBase._nextsib().
- *
- * @param identity A node identity, which <em>must not</em> be equal to
- * <code>DTM.NULL</code>
- */
- public final int _nextsib2(int identity)
- {
- //return m_nextsib.elementAt(identity);
-
- if (identity < m_blocksize)
- return m_nextsib_map0[identity];
- else
- return m_nextsib_map[identity>>>m_SHIFT][identity&m_MASK];
- }
-
- /**
- * The optimized version of DTMDefaultBase._firstch().
- *
- * @param identity A node identity, which <em>must not</em> be equal to
- * <code>DTM.NULL</code>
- */
- public final int _firstch2(int identity)
- {
- //return m_firstch.elementAt(identity);
-
- if (identity < m_blocksize)
- return m_firstch_map0[identity];
- else
- return m_firstch_map[identity>>>m_SHIFT][identity&m_MASK];
- }
-
- /**
- * The optimized version of DTMDefaultBase._parent().
- *
- * @param identity A node identity, which <em>must not</em> be equal to
- * <code>DTM.NULL</code>
- */
- public final int _parent2(int identity)
- {
- //return m_parent.elementAt(identity);
-
- if (identity < m_blocksize)
- return m_parent_map0[identity];
- else
- return m_parent_map[identity>>>m_SHIFT][identity&m_MASK];
- }
-
- /**
- * The optimized version of DTMDefaultBase._type().
- *
- * @param identity A node identity, which <em>must not</em> be equal to
- * <code>DTM.NULL</code>
- */
- public final int _type2(int identity)
- {
- //int eType = _exptype2(identity);
- int eType;
- if (identity < m_blocksize)
- eType = m_exptype_map0[identity];
- else
- eType = m_exptype_map[identity>>>m_SHIFT][identity&m_MASK];
-
- if (NULL != eType)
- return m_extendedTypes[eType].getNodeType();
- else
- return NULL;
- }
-
- /**
- * The optimized version of DTMDefaultBase.getExpandedTypeID(int).
- *
- * <p>This one is only used by DOMAdapter.getExpandedTypeID(int), which
- * is mostly called from the compiled translets.
- */
- public final int getExpandedTypeID2(int nodeHandle)
- {
- int nodeID = makeNodeIdentity(nodeHandle);
-
- //return (nodeID != NULL) ? _exptype2(nodeID) : NULL;
-
- if (nodeID != NULL) {
- if (nodeID < m_blocksize)
- return m_exptype_map0[nodeID];
- else
- return m_exptype_map[nodeID>>>m_SHIFT][nodeID&m_MASK];
- }
- else
- return NULL;
- }
-
- /*************************************************************************
- * END of DTM base accessor interfaces
- *************************************************************************/
-
-
- /**
- * Return the node type from the expanded type
- */
- public final int _exptype2Type(int exptype)
- {
- if (NULL != exptype)
- return m_extendedTypes[exptype].getNodeType();
- else
- return NULL;
- }
-
- /**
- * Get a prefix either from the uri mapping, or just make
- * one up!
- *
- * @param uri The namespace URI, which may be null.
- *
- * @return The prefix if there is one, or null.
- */
- public int getIdForNamespace(String uri)
- {
- int index = m_values.indexOf(uri);
- if (index < 0)
- {
- m_values.addElement(uri);
- return m_valueIndex++;
- }
- else
- return index;
- }
-
- /**
- * Override SAX2DTM.startElement()
- *
- * <p>Receive notification of the start of an element.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass to take specific actions at the start of
- * each element (such as allocating a new tree node or writing
- * output to a file).</p>
- *
- * @param uri The Namespace URI, or the empty string if the
- * element has no Namespace URI or if Namespace
- * processing is not being performed.
- * @param localName The local name (without prefix), or the
- * empty string if Namespace processing is not being
- * performed.
- * @param qName The qualified name (with prefix), or the
- * empty string if qualified names are not available.
- * @param attributes The specified or defaulted attributes.
- * @throws SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ContentHandler#startElement
- */
- public void startElement(String uri, String localName, String qName, Attributes attributes)
- throws SAXException
- {
-
- charactersFlush();
-
- int exName = m_expandedNameTable.getExpandedTypeID(uri, localName, DTM.ELEMENT_NODE);
-
- int prefixIndex = (qName.length() != localName.length())
- ? m_valuesOrPrefixes.stringToIndex(qName) : 0;
-
- int elemNode = addNode(DTM.ELEMENT_NODE, exName,
- m_parents.peek(), m_previous, prefixIndex, true);
-
- if(m_indexing)
- indexNode(exName, elemNode);
-
- m_parents.push(elemNode);
-
- int startDecls = m_contextIndexes.peek();
- int nDecls = m_prefixMappings.size();
- String prefix;
-
- if(!m_pastFirstElement)
- {
- // SPECIAL CASE: Implied declaration at root element
- prefix="xml";
- String declURL = "http://www.w3.org/XML/1998/namespace";
- exName = m_expandedNameTable.getExpandedTypeID(null, prefix, DTM.NAMESPACE_NODE);
- m_values.addElement(declURL);
- int val = m_valueIndex++;
- addNode(DTM.NAMESPACE_NODE, exName, elemNode,
- DTM.NULL, val, false);
- m_pastFirstElement=true;
- }
-
- for (int i = startDecls; i < nDecls; i += 2)
- {
- prefix = (String) m_prefixMappings.elementAt(i);
-
- if (prefix == null)
- continue;
-
- String declURL = (String) m_prefixMappings.elementAt(i + 1);
-
- exName = m_expandedNameTable.getExpandedTypeID(null, prefix, DTM.NAMESPACE_NODE);
-
- m_values.addElement(declURL);
- int val = m_valueIndex++;
-
- addNode(DTM.NAMESPACE_NODE, exName, elemNode, DTM.NULL, val, false);
- }
-
- int n = attributes.getLength();
-
- for (int i = 0; i < n; i++)
- {
- String attrUri = attributes.getURI(i);
- String attrQName = attributes.getQName(i);
- String valString = attributes.getValue(i);
-
- int nodeType;
-
- String attrLocalName = attributes.getLocalName(i);
-
- if ((null != attrQName)
- && (attrQName.equals("xmlns")
- || attrQName.startsWith("xmlns:")))
- {
- prefix = getPrefix(attrQName, attrUri);
- if (declAlreadyDeclared(prefix))
- continue; // go to the next attribute.
-
- nodeType = DTM.NAMESPACE_NODE;
- }
- else
- {
- nodeType = DTM.ATTRIBUTE_NODE;
-
- if (m_buildIdIndex && attributes.getType(i).equalsIgnoreCase("ID"))
- setIDAttribute(valString, elemNode);
- }
-
- // Bit of a hack... if somehow valString is null, stringToIndex will
- // return -1, which will make things very unhappy.
- if(null == valString)
- valString = "";
-
- m_values.addElement(valString);
- int val = m_valueIndex++;
-
- if (attrLocalName.length() != attrQName.length())
- {
-
- prefixIndex = m_valuesOrPrefixes.stringToIndex(attrQName);
-
- int dataIndex = m_data.size();
-
- m_data.addElement(prefixIndex);
- m_data.addElement(val);
-
- val = -dataIndex;
- }
-
- exName = m_expandedNameTable.getExpandedTypeID(attrUri, attrLocalName, nodeType);
- addNode(nodeType, exName, elemNode, DTM.NULL, val,
- false);
- }
-
- if (null != m_wsfilter)
- {
- short wsv = m_wsfilter.getShouldStripSpace(makeNodeHandle(elemNode), this);
- boolean shouldStrip = (DTMWSFilter.INHERIT == wsv)
- ? getShouldStripWhitespace()
- : (DTMWSFilter.STRIP == wsv);
-
- pushShouldStripWhitespace(shouldStrip);
- }
-
- m_previous = DTM.NULL;
-
- m_contextIndexes.push(m_prefixMappings.size()); // for the children.
- }
-
- /**
- * Receive notification of the end of an element.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass to take specific actions at the end of
- * each element (such as finalising a tree node or writing
- * output to a file).</p>
- *
- * @param uri The Namespace URI, or the empty string if the
- * element has no Namespace URI or if Namespace
- * processing is not being performed.
- * @param localName The local name (without prefix), or the
- * empty string if Namespace processing is not being
- * performed.
- * @param qName The qualified XML 1.0 name (with prefix), or the
- * empty string if qualified names are not available.
- * @throws SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ContentHandler#endElement
- */
- public void endElement(String uri, String localName, String qName)
- throws SAXException
- {
- charactersFlush();
-
- // If no one noticed, startPrefixMapping is a drag.
- // Pop the context for the last child (the one pushed by startElement)
- m_contextIndexes.quickPop(1);
-
- // Do it again for this one (the one pushed by the last endElement).
- int topContextIndex = m_contextIndexes.peek();
- if (topContextIndex != m_prefixMappings.size()) {
- m_prefixMappings.setSize(topContextIndex);
- }
-
- m_previous = m_parents.pop();
-
- popShouldStripWhitespace();
- }
-
- /**
- * Report an XML comment anywhere in the document.
- *
- * <p>This callback will be used for comments inside or outside the
- * document element, including comments in the external DTD
- * subset (if read).</p>
- *
- * @param ch An array holding the characters in the comment.
- * @param start The starting position in the array.
- * @param length The number of characters to use from the array.
- * @throws SAXException The application may raise an exception.
- */
- public void comment(char ch[], int start, int length) throws SAXException
- {
-
- if (m_insideDTD) // ignore comments if we're inside the DTD
- return;
-
- charactersFlush();
-
- // %OPT% Saving the comment string in a Vector has a lower cost than
- // saving it in DTMStringPool.
- m_values.addElement(new String(ch, start, length));
- int dataIndex = m_valueIndex++;
-
- m_previous = addNode(DTM.COMMENT_NODE, DTM.COMMENT_NODE,
- m_parents.peek(), m_previous, dataIndex, false);
- }
-
- /**
- * Receive notification of the beginning of the document.
- *
- * @throws SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ContentHandler#startDocument
- */
- public void startDocument() throws SAXException
- {
-
- int doc = addNode(DTM.DOCUMENT_NODE,
- DTM.DOCUMENT_NODE,
- DTM.NULL, DTM.NULL, 0, true);
-
- m_parents.push(doc);
- m_previous = DTM.NULL;
-
- m_contextIndexes.push(m_prefixMappings.size()); // for the next element.
- }
-
- /**
- * Receive notification of the end of the document.
- *
- * @throws SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ContentHandler#endDocument
- */
- public void endDocument() throws SAXException
- {
- super.endDocument();
-
- // Add a NULL entry to the end of the node arrays as
- // the end indication.
- m_exptype.addElement(NULL);
- m_parent.addElement(NULL);
- m_nextsib.addElement(NULL);
- m_firstch.addElement(NULL);
-
- // Set the cached references after the document is built.
- m_extendedTypes = m_expandedNameTable.getExtendedTypes();
- m_exptype_map = m_exptype.getMap();
- m_nextsib_map = m_nextsib.getMap();
- m_firstch_map = m_firstch.getMap();
- m_parent_map = m_parent.getMap();
- }
-
- /**
- * Construct the node map from the node.
- *
- * @param type raw type ID, one of DTM.XXX_NODE.
- * @param expandedTypeID The expended type ID.
- * @param parentIndex The current parent index.
- * @param previousSibling The previous sibling index.
- * @param dataOrPrefix index into m_data table, or string handle.
- * @param canHaveFirstChild true if the node can have a first child, false
- * if it is atomic.
- *
- * @return The index identity of the node that was added.
- */
- protected final int addNode(int type, int expandedTypeID,
- int parentIndex, int previousSibling,
- int dataOrPrefix, boolean canHaveFirstChild)
- {
- // Common to all nodes:
- int nodeIndex = m_size++;
-
- // Have we overflowed a DTM Identity's addressing range?
- //if(m_dtmIdent.size() == (nodeIndex>>>DTMManager.IDENT_DTM_NODE_BITS))
- if (nodeIndex == m_maxNodeIndex)
- {
- addNewDTMID(nodeIndex);
- m_maxNodeIndex += (1 << DTMManager.IDENT_DTM_NODE_BITS);
- }
-
- m_firstch.addElement(DTM.NULL);
- m_nextsib.addElement(DTM.NULL);
- m_parent.addElement(parentIndex);
- m_exptype.addElement(expandedTypeID);
- m_dataOrQName.addElement(dataOrPrefix);
-
- if (m_prevsib != null) {
- m_prevsib.addElement(previousSibling);
- }
-
- if (m_locator != null && m_useSourceLocationProperty) {
- setSourceLocation();
- }
-
- // Note that nextSibling is not processed until charactersFlush()
- // is called, to handle successive characters() events.
-
- // Special handling by type: Declare namespaces, attach first child
- switch(type)
- {
- case DTM.NAMESPACE_NODE:
- declareNamespaceInContext(parentIndex,nodeIndex);
- break;
- case DTM.ATTRIBUTE_NODE:
- break;
- default:
- if (DTM.NULL != previousSibling) {
- m_nextsib.setElementAt(nodeIndex,previousSibling);
- }
- else if (DTM.NULL != parentIndex) {
- m_firstch.setElementAt(nodeIndex,parentIndex);
- }
- break;
- }
-
- return nodeIndex;
- }
-
- /**
- * Check whether accumulated text should be stripped; if not,
- * append the appropriate flavor of text/cdata node.
- */
- protected final void charactersFlush()
- {
-
- if (m_textPendingStart >= 0) // -1 indicates no-text-in-progress
- {
- int length = m_chars.size() - m_textPendingStart;
- boolean doStrip = false;
-
- if (getShouldStripWhitespace())
- {
- doStrip = m_chars.isWhitespace(m_textPendingStart, length);
- }
-
- if (doStrip) {
- m_chars.setLength(m_textPendingStart); // Discard accumulated text
- } else {
- // Guard against characters/ignorableWhitespace events that
- // contained no characters. They should not result in a node.
- if (length > 0) {
- // If the offset and length do not exceed the given limits
- // (offset < 2^21 and length < 2^10), then save both the offset
- // and length in a bitwise encoded value.
- if (length <= TEXT_LENGTH_MAX
- && m_textPendingStart <= TEXT_OFFSET_MAX) {
- m_previous = addNode(m_coalescedTextType, DTM.TEXT_NODE,
- m_parents.peek(), m_previous,
- length + (m_textPendingStart << TEXT_LENGTH_BITS),
- false);
-
- } else {
- // Store offset and length in the m_data array if one exceeds
- // the given limits. Use a negative dataIndex as an indication.
- int dataIndex = m_data.size();
- m_previous = addNode(m_coalescedTextType, DTM.TEXT_NODE,
- m_parents.peek(), m_previous, -dataIndex, false);
-
- m_data.addElement(m_textPendingStart);
- m_data.addElement(length);
- }
- }
- }
-
- // Reset for next text block
- m_textPendingStart = -1;
- m_textType = m_coalescedTextType = DTM.TEXT_NODE;
- }
- }
-
- /**
- * Override the processingInstruction() interface in SAX2DTM2.
- * <p>
- * %OPT% This one is different from SAX2DTM.processingInstruction()
- * in that we do not use extended types for PI nodes. The name of
- * the PI is saved in the DTMStringPool.
- *
- * Receive notification of a processing instruction.
- *
- * @param target The processing instruction target.
- * @param data The processing instruction data, or null if
- * none is supplied.
- * @throws SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ContentHandler#processingInstruction
- */
- public void processingInstruction(String target, String data)
- throws SAXException
- {
-
- charactersFlush();
-
- int dataIndex = m_data.size();
- m_previous = addNode(DTM.PROCESSING_INSTRUCTION_NODE,
- DTM.PROCESSING_INSTRUCTION_NODE,
- m_parents.peek(), m_previous,
- -dataIndex, false);
-
- m_data.addElement(m_valuesOrPrefixes.stringToIndex(target));
- m_values.addElement(data);
- m_data.addElement(m_valueIndex++);
-
- }
-
- /**
- * The optimized version of DTMDefaultBase.getFirstAttribute().
- * <p>
- * Given a node handle, get the index of the node's first attribute.
- *
- * @param nodeHandle int Handle of the node.
- * @return Handle of first attribute, or DTM.NULL to indicate none exists.
- */
- public final int getFirstAttribute(int nodeHandle)
- {
- int nodeID = makeNodeIdentity(nodeHandle);
-
- if (nodeID == DTM.NULL)
- return DTM.NULL;
-
- int type = _type2(nodeID);
-
- if (DTM.ELEMENT_NODE == type)
- {
- // Assume that attributes and namespaces immediately follow the element.
- while (true)
- {
- nodeID++;
- // Assume this can not be null.
- type = _type2(nodeID);
-
- if (type == DTM.ATTRIBUTE_NODE)
- {
- return makeNodeHandle(nodeID);
- }
- else if (DTM.NAMESPACE_NODE != type)
- {
- break;
- }
- }
- }
-
- return DTM.NULL;
- }
-
- /**
- * The optimized version of DTMDefaultBase.getFirstAttributeIdentity(int).
- * <p>
- * Given a node identity, get the index of the node's first attribute.
- *
- * @param identity int identity of the node.
- * @return Identity of first attribute, or DTM.NULL to indicate none exists.
- */
- protected int getFirstAttributeIdentity(int identity) {
- if (identity == NULL) {
- return NULL;
- }
- int type = _type2(identity);
-
- if (DTM.ELEMENT_NODE == type)
- {
- // Assume that attributes and namespaces immediately follow the element.
- while (true)
- {
- identity++;
-
- // Assume this can not be null.
- type = _type2(identity);
-
- if (type == DTM.ATTRIBUTE_NODE)
- {
- return identity;
- }
- else if (DTM.NAMESPACE_NODE != type)
- {
- break;
- }
- }
- }
-
- return DTM.NULL;
- }
-
- /**
- * The optimized version of DTMDefaultBase.getNextAttributeIdentity(int).
- * <p>
- * Given a node identity for an attribute, advance to the next attribute.
- *
- * @param identity int identity of the attribute node. This
- * <strong>must</strong> be an attribute node.
- *
- * @return int DTM node-identity of the resolved attr,
- * or DTM.NULL to indicate none exists.
- *
- */
- protected int getNextAttributeIdentity(int identity) {
- // Assume that attributes and namespace nodes immediately follow the element
- while (true) {
- identity++;
- int type = _type2(identity);
-
- if (type == DTM.ATTRIBUTE_NODE) {
- return identity;
- } else if (type != DTM.NAMESPACE_NODE) {
- break;
- }
- }
-
- return DTM.NULL;
- }
-
- /**
- * The optimized version of DTMDefaultBase.getTypedAttribute(int, int).
- * <p>
- * Given a node handle and an expanded type ID, get the index of the node's
- * attribute of that type, if any.
- *
- * @param nodeHandle int Handle of the node.
- * @param attType int expanded type ID of the required attribute.
- * @return Handle of attribute of the required type, or DTM.NULL to indicate
- * none exists.
- */
- protected final int getTypedAttribute(int nodeHandle, int attType)
- {
-
- int nodeID = makeNodeIdentity(nodeHandle);
-
- if (nodeID == DTM.NULL)
- return DTM.NULL;
-
- int type = _type2(nodeID);
-
- if (DTM.ELEMENT_NODE == type)
- {
- int expType;
- while (true)
- {
- nodeID++;
- expType = _exptype2(nodeID);
-
- if (expType != DTM.NULL)
- type = m_extendedTypes[expType].getNodeType();
- else
- return DTM.NULL;
-
- if (type == DTM.ATTRIBUTE_NODE)
- {
- if (expType == attType) return makeNodeHandle(nodeID);
- }
- else if (DTM.NAMESPACE_NODE != type)
- {
- break;
- }
- }
- }
-
- return DTM.NULL;
- }
-
- /**
- * Override SAX2DTM.getLocalName() in SAX2DTM2.
- * <p>Processing for PIs is different.
- *
- * Given a node handle, return its XPath- style localname. (As defined in
- * Namespaces, this is the portion of the name after any colon character).
- *
- * @param nodeHandle the id of the node.
- * @return String Local name of this node.
- */
- public String getLocalName(int nodeHandle)
- {
- int expType = _exptype(makeNodeIdentity(nodeHandle));
-
- if (expType == DTM.PROCESSING_INSTRUCTION_NODE)
- {
- int dataIndex = _dataOrQName(makeNodeIdentity(nodeHandle));
- dataIndex = m_data.elementAt(-dataIndex);
- return m_valuesOrPrefixes.indexToString(dataIndex);
- }
- else
- return m_expandedNameTable.getLocalName(expType);
- }
-
- /**
- * The optimized version of SAX2DTM.getNodeNameX().
- * <p>
- * Given a node handle, return the XPath node name. This should be the name
- * as described by the XPath data model, NOT the DOM- style name.
- *
- * @param nodeHandle the id of the node.
- * @return String Name of this node, which may be an empty string.
- */
- public final String getNodeNameX(int nodeHandle)
- {
-
- int nodeID = makeNodeIdentity(nodeHandle);
- int eType = _exptype2(nodeID);
-
- if (eType == DTM.PROCESSING_INSTRUCTION_NODE)
- {
- int dataIndex = _dataOrQName(nodeID);
- dataIndex = m_data.elementAt(-dataIndex);
- return m_valuesOrPrefixes.indexToString(dataIndex);
- }
-
- final ExtendedType extType = m_extendedTypes[eType];
-
- if (extType.getNamespace().length() == 0)
- {
- return extType.getLocalName();
- }
- else
- {
- int qnameIndex = m_dataOrQName.elementAt(nodeID);
-
- if (qnameIndex == 0)
- return extType.getLocalName();
-
- if (qnameIndex < 0)
- {
- qnameIndex = -qnameIndex;
- qnameIndex = m_data.elementAt(qnameIndex);
- }
-
- return m_valuesOrPrefixes.indexToString(qnameIndex);
- }
- }
-
- /**
- * The optimized version of SAX2DTM.getNodeName().
- * <p>
- * Given a node handle, return its DOM-style node name. This will include
- * names such as #text or #document.
- *
- * @param nodeHandle the id of the node.
- * @return String Name of this node, which may be an empty string.
- * %REVIEW% Document when empty string is possible...
- * %REVIEW-COMMENT% It should never be empty, should it?
- */
- public String getNodeName(int nodeHandle)
- {
-
- int nodeID = makeNodeIdentity(nodeHandle);
- int eType = _exptype2(nodeID);
-
- final ExtendedType extType = m_extendedTypes[eType];
- if (extType.getNamespace().length() == 0)
- {
- int type = extType.getNodeType();
-
- String localName = extType.getLocalName();
- if (type == DTM.NAMESPACE_NODE)
- {
- if (localName.length() == 0)
- return "xmlns";
- else
- return "xmlns:" + localName;
- }
- else if (type == DTM.PROCESSING_INSTRUCTION_NODE)
- {
- int dataIndex = _dataOrQName(nodeID);
- dataIndex = m_data.elementAt(-dataIndex);
- return m_valuesOrPrefixes.indexToString(dataIndex);
- }
- else if (localName.length() == 0)
- {
- return getFixedNames(type);
- }
- else
- return localName;
- }
- else
- {
- int qnameIndex = m_dataOrQName.elementAt(nodeID);
-
- if (qnameIndex == 0)
- return extType.getLocalName();
-
- if (qnameIndex < 0)
- {
- qnameIndex = -qnameIndex;
- qnameIndex = m_data.elementAt(qnameIndex);
- }
-
- return m_valuesOrPrefixes.indexToString(qnameIndex);
- }
- }
-
- /**
- * Override SAX2DTM.getStringValue(int)
- * <p>
- * This method is only used by Xalan-J Interpretive. It is not used by XSLTC.
- * <p>
- * If the caller supplies an XMLStringFactory, the getStringValue() interface
- * in SAX2DTM will be called. Otherwise just calls getStringValueX() and
- * wraps the returned String in an XMLString.
- *
- * Get the string-value of a node as a String object
- * (see http://www.w3.org/TR/xpath#data-model
- * for the definition of a node's string-value).
- *
- * @param nodeHandle The node ID.
- *
- * @return A string object that represents the string-value of the given node.
- */
- public XMLString getStringValue(int nodeHandle)
- {
- int identity = makeNodeIdentity(nodeHandle);
- if (identity == DTM.NULL)
- return EMPTY_XML_STR;
-
- int type= _type2(identity);
-
- if (type == DTM.ELEMENT_NODE || type == DTM.DOCUMENT_NODE)
- {
- int startNode = identity;
- identity = _firstch2(identity);
- if (DTM.NULL != identity)
- {
- int offset = -1;
- int length = 0;
-
- do
- {
- type = _exptype2(identity);
-
- if (type == DTM.TEXT_NODE || type == DTM.CDATA_SECTION_NODE)
- {
- int dataIndex = m_dataOrQName.elementAt(identity);
- if (dataIndex >= 0)
- {
- if (-1 == offset)
- {
- offset = dataIndex >>> TEXT_LENGTH_BITS;
- }
-
- length += dataIndex & TEXT_LENGTH_MAX;
- }
- else
- {
- if (-1 == offset)
- {
- offset = m_data.elementAt(-dataIndex);
- }
-
- length += m_data.elementAt(-dataIndex + 1);
- }
- }
-
- identity++;
- } while (_parent2(identity) >= startNode);
-
- if (length > 0)
- {
- if (m_xstrf != null)
- return m_xstrf.newstr(m_chars, offset, length);
- else
- return new XMLStringDefault(m_chars.getString(offset, length));
- }
- else
- return EMPTY_XML_STR;
- }
- else
- return EMPTY_XML_STR;
- }
- else if (DTM.TEXT_NODE == type || DTM.CDATA_SECTION_NODE == type)
- {
- int dataIndex = m_dataOrQName.elementAt(identity);
- if (dataIndex >= 0)
- {
- if (m_xstrf != null)
- return m_xstrf.newstr(m_chars, dataIndex >>> TEXT_LENGTH_BITS,
- dataIndex & TEXT_LENGTH_MAX);
- else
- return new XMLStringDefault(m_chars.getString(dataIndex >>> TEXT_LENGTH_BITS,
- dataIndex & TEXT_LENGTH_MAX));
- }
- else
- {
- if (m_xstrf != null)
- return m_xstrf.newstr(m_chars, m_data.elementAt(-dataIndex),
- m_data.elementAt(-dataIndex+1));
- else
- return new XMLStringDefault(m_chars.getString(m_data.elementAt(-dataIndex),
- m_data.elementAt(-dataIndex+1)));
- }
- }
- else
- {
- int dataIndex = m_dataOrQName.elementAt(identity);
-
- if (dataIndex < 0)
- {
- dataIndex = -dataIndex;
- dataIndex = m_data.elementAt(dataIndex + 1);
- }
-
- if (m_xstrf != null)
- return m_xstrf.newstr((String)m_values.elementAt(dataIndex));
- else
- return new XMLStringDefault((String)m_values.elementAt(dataIndex));
- }
- }
-
- /**
- * The optimized version of SAX2DTM.getStringValue(int).
- * <p>
- * %OPT% This is one of the most often used interfaces. Performance is
- * critical here. This one is different from SAX2DTM.getStringValue(int) in
- * that it returns a String instead of a XMLString.
- *
- * Get the string- value of a node as a String object (see http: //www. w3.
- * org/TR/xpath#data- model for the definition of a node's string- value).
- *
- * @param nodeHandle The node ID.
- *
- * @return A string object that represents the string-value of the given node.
- */
- public final String getStringValueX(final int nodeHandle)
- {
- int identity = makeNodeIdentity(nodeHandle);
- if (identity == DTM.NULL)
- return EMPTY_STR;
-
- int type= _type2(identity);
-
- if (type == DTM.ELEMENT_NODE || type == DTM.DOCUMENT_NODE)
- {
- int startNode = identity;
- identity = _firstch2(identity);
- if (DTM.NULL != identity)
- {
- int offset = -1;
- int length = 0;
-
- do
- {
- type = _exptype2(identity);
-
- if (type == DTM.TEXT_NODE || type == DTM.CDATA_SECTION_NODE)
- {
- int dataIndex = m_dataOrQName.elementAt(identity);
- if (dataIndex >= 0)
- {
- if (-1 == offset)
- {
- offset = dataIndex >>> TEXT_LENGTH_BITS;
- }
-
- length += dataIndex & TEXT_LENGTH_MAX;
- }
- else
- {
- if (-1 == offset)
- {
- offset = m_data.elementAt(-dataIndex);
- }
-
- length += m_data.elementAt(-dataIndex + 1);
- }
- }
-
- identity++;
- } while (_parent2(identity) >= startNode);
-
- if (length > 0)
- {
- return m_chars.getString(offset, length);
- }
- else
- return EMPTY_STR;
- }
- else
- return EMPTY_STR;
- }
- else if (DTM.TEXT_NODE == type || DTM.CDATA_SECTION_NODE == type)
- {
- int dataIndex = m_dataOrQName.elementAt(identity);
- if (dataIndex >= 0)
- {
- return m_chars.getString(dataIndex >>> TEXT_LENGTH_BITS,
- dataIndex & TEXT_LENGTH_MAX);
- }
- else
- {
- return m_chars.getString(m_data.elementAt(-dataIndex),
- m_data.elementAt(-dataIndex+1));
- }
- }
- else
- {
- int dataIndex = m_dataOrQName.elementAt(identity);
-
- if (dataIndex < 0)
- {
- dataIndex = -dataIndex;
- dataIndex = m_data.elementAt(dataIndex + 1);
- }
-
- return (String)m_values.elementAt(dataIndex);
- }
- }
-
- /**
- * Returns the string value of the entire tree
- */
- public String getStringValue()
- {
- int child = _firstch2(ROOTNODE);
- if (child == DTM.NULL) return EMPTY_STR;
-
- // optimization: only create StringBuffer if > 1 child
- if ((_exptype2(child) == DTM.TEXT_NODE) && (_nextsib2(child) == DTM.NULL))
- {
- int dataIndex = m_dataOrQName.elementAt(child);
- if (dataIndex >= 0)
- return m_chars.getString(dataIndex >>> TEXT_LENGTH_BITS, dataIndex & TEXT_LENGTH_MAX);
- else
- return m_chars.getString(m_data.elementAt(-dataIndex),
- m_data.elementAt(-dataIndex + 1));
- }
- else
- return getStringValueX(getDocument());
-
- }
-
- /**
- * The optimized version of SAX2DTM.dispatchCharactersEvents(int, ContentHandler, boolean).
- * <p>
- * Directly call the
- * characters method on the passed ContentHandler for the
- * string-value of the given node (see http://www.w3.org/TR/xpath#data-model
- * for the definition of a node's string-value). Multiple calls to the
- * ContentHandler's characters methods may well occur for a single call to
- * this method.
- *
- * @param nodeHandle The node ID.
- * @param ch A non-null reference to a ContentHandler.
- * @param normalize true if the content should be normalized according to
- * the rules for the XPath
- * <a href="http://www.w3.org/TR/xpath#function-normalize-space">normalize-space</a>
- * function.
- *
- * @throws SAXException
- */
- public final void dispatchCharactersEvents(int nodeHandle, ContentHandler ch,
- boolean normalize)
- throws SAXException
- {
-
- int identity = makeNodeIdentity(nodeHandle);
-
- if (identity == DTM.NULL)
- return;
-
- int type = _type2(identity);
-
- if (type == DTM.ELEMENT_NODE || type == DTM.DOCUMENT_NODE)
- {
- int startNode = identity;
- identity = _firstch2(identity);
- if (DTM.NULL != identity)
- {
- int offset = -1;
- int length = 0;
-
- do
- {
- type = _exptype2(identity);
-
- if (type == DTM.TEXT_NODE || type == DTM.CDATA_SECTION_NODE)
- {
- int dataIndex = m_dataOrQName.elementAt(identity);
-
- if (dataIndex >= 0)
- {
- if (-1 == offset)
- {
- offset = dataIndex >>> TEXT_LENGTH_BITS;
- }
-
- length += dataIndex & TEXT_LENGTH_MAX;
- }
- else
- {
- if (-1 == offset)
- {
- offset = m_data.elementAt(-dataIndex);
- }
-
- length += m_data.elementAt(-dataIndex + 1);
- }
- }
-
- identity++;
- } while (_parent2(identity) >= startNode);
-
- if (length > 0)
- {
- if(normalize)
- m_chars.sendNormalizedSAXcharacters(ch, offset, length);
- else
- m_chars.sendSAXcharacters(ch, offset, length);
- }
- }
- }
- else if (DTM.TEXT_NODE == type || DTM.CDATA_SECTION_NODE == type)
- {
- int dataIndex = m_dataOrQName.elementAt(identity);
-
- if (dataIndex >= 0)
- {
- if (normalize)
- m_chars.sendNormalizedSAXcharacters(ch, dataIndex >>> TEXT_LENGTH_BITS,
- dataIndex & TEXT_LENGTH_MAX);
- else
- m_chars.sendSAXcharacters(ch, dataIndex >>> TEXT_LENGTH_BITS,
- dataIndex & TEXT_LENGTH_MAX);
- }
- else
- {
- if (normalize)
- m_chars.sendNormalizedSAXcharacters(ch, m_data.elementAt(-dataIndex),
- m_data.elementAt(-dataIndex+1));
- else
- m_chars.sendSAXcharacters(ch, m_data.elementAt(-dataIndex),
- m_data.elementAt(-dataIndex+1));
- }
- }
- else
- {
- int dataIndex = m_dataOrQName.elementAt(identity);
-
- if (dataIndex < 0)
- {
- dataIndex = -dataIndex;
- dataIndex = m_data.elementAt(dataIndex + 1);
- }
-
- String str = (String)m_values.elementAt(dataIndex);
-
- if(normalize)
- FastStringBuffer.sendNormalizedSAXcharacters(str.toCharArray(),
- 0, str.length(), ch);
- else
- ch.characters(str.toCharArray(), 0, str.length());
- }
- }
-
- /**
- * Given a node handle, return its node value. This is mostly
- * as defined by the DOM, but may ignore some conveniences.
- * <p>
- *
- * @param nodeHandle The node id.
- * @return String Value of this node, or null if not
- * meaningful for this node type.
- */
- public String getNodeValue(int nodeHandle)
- {
-
- int identity = makeNodeIdentity(nodeHandle);
- int type = _type2(identity);
-
- if (type == DTM.TEXT_NODE || type == DTM.CDATA_SECTION_NODE)
- {
- int dataIndex = _dataOrQName(identity);
- if (dataIndex > 0)
- {
- return m_chars.getString(dataIndex >>> TEXT_LENGTH_BITS,
- dataIndex & TEXT_LENGTH_MAX);
- }
- else
- {
- return m_chars.getString(m_data.elementAt(-dataIndex),
- m_data.elementAt(-dataIndex+1));
- }
- }
- else if (DTM.ELEMENT_NODE == type || DTM.DOCUMENT_FRAGMENT_NODE == type
- || DTM.DOCUMENT_NODE == type)
- {
- return null;
- }
- else
- {
- int dataIndex = m_dataOrQName.elementAt(identity);
-
- if (dataIndex < 0)
- {
- dataIndex = -dataIndex;
- dataIndex = m_data.elementAt(dataIndex + 1);
- }
-
- return (String)m_values.elementAt(dataIndex);
- }
- }
-
- /**
- * Copy the String value of a Text node to a SerializationHandler
- */
- protected final void copyTextNode(final int nodeID, SerializationHandler handler)
- throws SAXException
- {
- if (nodeID != DTM.NULL) {
- int dataIndex = m_dataOrQName.elementAt(nodeID);
- if (dataIndex >= 0) {
- m_chars.sendSAXcharacters(handler,
- dataIndex >>> TEXT_LENGTH_BITS,
- dataIndex & TEXT_LENGTH_MAX);
- } else {
- m_chars.sendSAXcharacters(handler, m_data.elementAt(-dataIndex),
- m_data.elementAt(-dataIndex+1));
- }
- }
- }
-
- /**
- * Copy an Element node to a SerializationHandler.
- *
- * @param nodeID The node identity
- * @param exptype The expanded type of the Element node
- * @param handler The SerializationHandler
- * @return The qualified name of the Element node.
- */
- protected final String copyElement(int nodeID, int exptype,
- SerializationHandler handler)
- throws SAXException
- {
- final ExtendedType extType = m_extendedTypes[exptype];
- String uri = extType.getNamespace();
- String name = extType.getLocalName();
-
- if (uri.length() == 0) {
- handler.startElement(name);
- return name;
- }
- else {
- int qnameIndex = m_dataOrQName.elementAt(nodeID);
-
- if (qnameIndex == 0) {
- handler.startElement(name);
- handler.namespaceAfterStartElement(EMPTY_STR, uri);
- return name;
- }
-
- if (qnameIndex < 0) {
- qnameIndex = -qnameIndex;
- qnameIndex = m_data.elementAt(qnameIndex);
- }
-
- String qName = m_valuesOrPrefixes.indexToString(qnameIndex);
- handler.startElement(qName);
- int prefixIndex = qName.indexOf(':');
- String prefix;
- if (prefixIndex > 0) {
- prefix = qName.substring(0, prefixIndex);
- }
- else {
- prefix = null;
- }
- handler.namespaceAfterStartElement(prefix, uri);
- return qName;
- }
-
- }
-
- /**
- * Copy namespace nodes.
- *
- * @param nodeID The Element node identity
- * @param handler The SerializationHandler
- * @param inScope true if all namespaces in scope should be copied,
- * false if only the namespace declarations should be copied.
- */
- protected final void copyNS(final int nodeID, SerializationHandler handler, boolean inScope)
- throws SAXException
- {
- // %OPT% Optimization for documents which does not have any explicit
- // namespace nodes. For these documents, there is an implicit
- // namespace node (xmlns:xml="http://www.w3.org/XML/1998/namespace")
- // declared on the root element node. In this case, there is no
- // need to do namespace copying. We can safely return without
- // doing anything.
- if (m_namespaceDeclSetElements != null &&
- m_namespaceDeclSetElements.size() == 1 &&
- m_namespaceDeclSets != null &&
- ((SuballocatedIntVector)m_namespaceDeclSets.elementAt(0))
- .size() == 1)
- return;
-
- SuballocatedIntVector nsContext = null;
- int nextNSNode;
-
- // Find the first namespace node
- if (inScope) {
- nsContext = findNamespaceContext(nodeID);
- if (nsContext == null || nsContext.size() < 1)
- return;
- else
- nextNSNode = makeNodeIdentity(nsContext.elementAt(0));
- }
- else
- nextNSNode = getNextNamespaceNode2(nodeID);
-
- int nsIndex = 1;
- while (nextNSNode != DTM.NULL) {
- // Retrieve the name of the namespace node
- int eType = _exptype2(nextNSNode);
- String nodeName = m_extendedTypes[eType].getLocalName();
-
- // Retrieve the node value of the namespace node
- int dataIndex = m_dataOrQName.elementAt(nextNSNode);
-
- if (dataIndex < 0) {
- dataIndex = -dataIndex;
- dataIndex = m_data.elementAt(dataIndex + 1);
- }
-
- String nodeValue = (String)m_values.elementAt(dataIndex);
-
- handler.namespaceAfterStartElement(nodeName, nodeValue);
-
- if (inScope) {
- if (nsIndex < nsContext.size()) {
- nextNSNode = makeNodeIdentity(nsContext.elementAt(nsIndex));
- nsIndex++;
- }
- else
- return;
- }
- else
- nextNSNode = getNextNamespaceNode2(nextNSNode);
- }
- }
-
- /**
- * Return the next namespace node following the given base node.
- *
- * @baseID The node identity of the base node, which can be an
- * element, attribute or namespace node.
- * @return The namespace node immediately following the base node.
- */
- protected final int getNextNamespaceNode2(int baseID) {
- int type;
- while ((type = _type2(++baseID)) == DTM.ATTRIBUTE_NODE);
-
- if (type == DTM.NAMESPACE_NODE)
- return baseID;
- else
- return NULL;
- }
-
- /**
- * Copy attribute nodes from an element .
- *
- * @param nodeID The Element node identity
- * @param handler The SerializationHandler
- */
- protected final void copyAttributes(final int nodeID, SerializationHandler handler)
- throws SAXException{
-
- for(int current = getFirstAttributeIdentity(nodeID); current != DTM.NULL; current = getNextAttributeIdentity(current)){
- int eType = _exptype2(current);
- copyAttribute(current, eType, handler);
- }
- }
-
-
-
- /**
- * Copy an Attribute node to a SerializationHandler
- *
- * @param nodeID The node identity
- * @param exptype The expanded type of the Element node
- * @param handler The SerializationHandler
- */
- protected final void copyAttribute(int nodeID, int exptype,
- SerializationHandler handler)
- throws SAXException
- {
- /*
- final String uri = getNamespaceName(node);
- if (uri.length() != 0) {
- final String prefix = getPrefix(node);
- handler.namespaceAfterStartElement(prefix, uri);
- }
- handler.addAttribute(getNodeName(node), getNodeValue(node));
- */
- final ExtendedType extType = m_extendedTypes[exptype];
- final String uri = extType.getNamespace();
- final String localName = extType.getLocalName();
-
- String prefix = null;
- String qname = null;
- int dataIndex = _dataOrQName(nodeID);
- int valueIndex = dataIndex;
- if (dataIndex <= 0) {
- int prefixIndex = m_data.elementAt(-dataIndex);
- valueIndex = m_data.elementAt(-dataIndex+1);
- qname = m_valuesOrPrefixes.indexToString(prefixIndex);
- int colonIndex = qname.indexOf(':');
- if (colonIndex > 0) {
- prefix = qname.substring(0, colonIndex);
- }
- }
- if (uri.length() != 0) {
- handler.namespaceAfterStartElement(prefix, uri);
- }
-
- String nodeName = (prefix != null) ? qname : localName;
- String nodeValue = (String)m_values.elementAt(valueIndex);
-
- handler.addAttribute(uri, localName, nodeName, "CDATA", nodeValue);
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/dtm/ref/sax2dtm/SAX2RTFDTM.java b/src/com/sun/org/apache/xml/internal/dtm/ref/sax2dtm/SAX2RTFDTM.java
deleted file mode 100644
index c09968f..0000000
--- a/src/com/sun/org/apache/xml/internal/dtm/ref/sax2dtm/SAX2RTFDTM.java
+++ /dev/null
@@ -1,364 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: SAX2RTFDTM.java,v 1.2.4.1 2005/09/15 08:15:13 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.dtm.ref.sax2dtm;
-
-import javax.xml.transform.Source;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMManager;
-import com.sun.org.apache.xml.internal.dtm.DTMWSFilter;
-import com.sun.org.apache.xml.internal.utils.IntStack;
-import com.sun.org.apache.xml.internal.utils.IntVector;
-import com.sun.org.apache.xml.internal.utils.StringVector;
-import com.sun.org.apache.xml.internal.utils.XMLStringFactory;
-
-import org.xml.sax.SAXException;
-
-/**
- * This is a subclass of SAX2DTM which has been modified to meet the needs of
- * Result Tree Frameworks (RTFs). The differences are:
- *
- * 1) Multiple XML trees may be appended to the single DTM. This means
- * that the root node of each document is _not_ node 0. Some code has
- * had to be deoptimized to support this mode of operation, and an
- * explicit mechanism for obtaining the Node Handle of the root node
- * has been provided.
- *
- * 2) A stack of these documents is maintained, allowing us to "tail-prune" the
- * most recently added trees off the end of the DTM as stylesheet elements
- * (and thus variable contexts) are exited.
- *
- * PLEASE NOTE that this class may be _heavily_ dependent upon the
- * internals of the SAX2DTM superclass, and must be maintained in
- * parallel with that code. Arguably, they should be conditionals
- * within a single class... but they have deen separated for
- * performance reasons. (In fact, one could even argue about which is
- * the superclass and which is the subclass; the current arrangement
- * is as much about preserving stability of existing code during
- * development as anything else.)
- *
- * %REVIEW% In fact, since the differences are so minor, I think it
- * may be possible/practical to fold them back into the base
- * SAX2DTM. Consider that as a future code-size optimization.
- * */
-public class SAX2RTFDTM extends SAX2DTM
-{
- /** Set true to monitor SAX events and similar diagnostic info. */
- private static final boolean DEBUG = false;
-
- /** Most recently started Document, or null if the DTM is empty. */
- private int m_currentDocumentNode=NULL;
-
- /** Tail-pruning mark: Number of nodes in use */
- IntStack mark_size=new IntStack();
- /** Tail-pruning mark: Number of data items in use */
- IntStack mark_data_size=new IntStack();
- /** Tail-pruning mark: Number of size-of-data fields in use */
- IntStack mark_char_size=new IntStack();
- /** Tail-pruning mark: Number of dataOrQName slots in use */
- IntStack mark_doq_size=new IntStack();
- /** Tail-pruning mark: Number of namespace declaration sets in use
- * %REVIEW% I don't think number of NS sets is ever different from number
- * of NS elements. We can probabably reduce these to a single stack and save
- * some storage.
- * */
- IntStack mark_nsdeclset_size=new IntStack();
- /** Tail-pruning mark: Number of naespace declaration elements in use
- * %REVIEW% I don't think number of NS sets is ever different from number
- * of NS elements. We can probabably reduce these to a single stack and save
- * some storage.
- */
- IntStack mark_nsdeclelem_size=new IntStack();
-
- /**
- * Tail-pruning mark: initial number of nodes in use
- */
- int m_emptyNodeCount;
-
- /**
- * Tail-pruning mark: initial number of namespace declaration sets
- */
- int m_emptyNSDeclSetCount;
-
- /**
- * Tail-pruning mark: initial number of namespace declaration elements
- */
- int m_emptyNSDeclSetElemsCount;
-
- /**
- * Tail-pruning mark: initial number of data items in use
- */
- int m_emptyDataCount;
-
- /**
- * Tail-pruning mark: initial number of characters in use
- */
- int m_emptyCharsCount;
-
- /**
- * Tail-pruning mark: default initial number of dataOrQName slots in use
- */
- int m_emptyDataQNCount;
-
- public SAX2RTFDTM(DTMManager mgr, Source source, int dtmIdentity,
- DTMWSFilter whiteSpaceFilter,
- XMLStringFactory xstringfactory,
- boolean doIndexing)
- {
- super(mgr, source, dtmIdentity, whiteSpaceFilter,
- xstringfactory, doIndexing);
-
- // NEVER track source locators for RTFs; they aren't meaningful. I think.
- // (If we did track them, we'd need to tail-prune these too.)
- //com.sun.org.apache.xalan.internal.processor.TransformerFactoryImpl.m_source_location;
- m_useSourceLocationProperty=false;
- m_sourceSystemId = (m_useSourceLocationProperty) ? new StringVector()
- : null;
- m_sourceLine = (m_useSourceLocationProperty) ? new IntVector() : null;
- m_sourceColumn = (m_useSourceLocationProperty) ? new IntVector() : null;
-
- // Record initial sizes of fields that are pushed and restored
- // for RTF tail-pruning. More entries can be popped than pushed, so
- // we need this to mark the primordial state of the DTM.
- m_emptyNodeCount = m_size;
- m_emptyNSDeclSetCount = (m_namespaceDeclSets == null)
- ? 0 : m_namespaceDeclSets.size();
- m_emptyNSDeclSetElemsCount = (m_namespaceDeclSetElements == null)
- ? 0 : m_namespaceDeclSetElements.size();
- m_emptyDataCount = m_data.size();
- m_emptyCharsCount = m_chars.size();
- m_emptyDataQNCount = m_dataOrQName.size();
- }
-
- /**
- * Given a DTM, find the owning document node. In the case of
- * SAX2RTFDTM, which may contain multiple documents, this returns
- * the <b>most recently started</b> document, or null if the DTM is
- * empty or no document is currently under construction.
- *
- * %REVIEW% Should we continue to report the most recent after
- * construction has ended? I think not, given that it may have been
- * tail-pruned.
- *
- * @return int Node handle of Document node, or null if this DTM does not
- * contain an "active" document.
- * */
- public int getDocument()
- {
- return makeNodeHandle(m_currentDocumentNode);
- }
-
- /**
- * Given a node handle, find the owning document node, using DTM semantics
- * (Document owns itself) rather than DOM semantics (Document has no owner).
- *
- * (I'm counting on the fact that getOwnerDocument() is implemented on top
- * of this call, in the superclass, to avoid having to rewrite that one.
- * Be careful if that code changes!)
- *
- * @param nodeHandle the id of the node.
- * @return int Node handle of owning document
- */
- public int getDocumentRoot(int nodeHandle)
- {
- for (int id=makeNodeIdentity(nodeHandle); id!=NULL; id=_parent(id)) {
- if (_type(id)==DTM.DOCUMENT_NODE) {
- return makeNodeHandle(id);
- }
- }
-
- return DTM.NULL; // Safety net; should never happen
- }
-
- /**
- * Given a node identifier, find the owning document node. Unlike the DOM,
- * this considers the owningDocument of a Document to be itself. Note that
- * in shared DTMs this may not be zero.
- *
- * @param nodeIdentifier the id of the starting node.
- * @return int Node identifier of the root of this DTM tree
- */
- protected int _documentRoot(int nodeIdentifier)
- {
- if(nodeIdentifier==NULL) return NULL;
-
- for (int parent=_parent(nodeIdentifier);
- parent!=NULL;
- nodeIdentifier=parent,parent=_parent(nodeIdentifier))
- ;
-
- return nodeIdentifier;
- }
-
- /**
- * Receive notification of the beginning of a new RTF document.
- *
- * %REVIEW% Y'know, this isn't all that much of a deoptimization. We
- * might want to consider folding the start/endDocument changes back
- * into the main SAX2DTM so we don't have to expose so many fields
- * (even as Protected) and carry the additional code.
- *
- * @throws SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ContentHandler#startDocument
- * */
- public void startDocument() throws SAXException
- {
- // Re-initialize the tree append process
- m_endDocumentOccured = false;
- m_prefixMappings = new java.util.Vector();
- m_contextIndexes = new IntStack();
- m_parents = new IntStack();
-
- m_currentDocumentNode=m_size;
- super.startDocument();
- }
-
- /**
- * Receive notification of the end of the document.
- *
- * %REVIEW% Y'know, this isn't all that much of a deoptimization. We
- * might want to consider folding the start/endDocument changes back
- * into the main SAX2DTM so we don't have to expose so many fields
- * (even as Protected).
- *
- * @throws SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ContentHandler#endDocument
- * */
- public void endDocument() throws SAXException
- {
- charactersFlush();
-
- m_nextsib.setElementAt(NULL,m_currentDocumentNode);
-
- if (m_firstch.elementAt(m_currentDocumentNode) == NOTPROCESSED)
- m_firstch.setElementAt(NULL,m_currentDocumentNode);
-
- if (DTM.NULL != m_previous)
- m_nextsib.setElementAt(DTM.NULL,m_previous);
-
- m_parents = null;
- m_prefixMappings = null;
- m_contextIndexes = null;
-
- m_currentDocumentNode= NULL; // no longer open
- m_endDocumentOccured = true;
- }
-
-
- /** "Tail-pruning" support for RTFs.
- *
- * This function pushes information about the current size of the
- * DTM's data structures onto a stack, for use by popRewindMark()
- * (which see).
- *
- * %REVIEW% I have no idea how to rewind m_elemIndexes. However,
- * RTFs will not be indexed, so I can simply panic if that case
- * arises. Hey, it works...
- * */
- public void pushRewindMark()
- {
- if(m_indexing || m_elemIndexes!=null)
- throw new java.lang.NullPointerException("Coding error; Don't try to mark/rewind an indexed DTM");
-
- // Values from DTMDefaultBase
- // %REVIEW% Can the namespace stack sizes ever differ? If not, save space!
- mark_size.push(m_size);
- mark_nsdeclset_size.push((m_namespaceDeclSets==null)
- ? 0
- : m_namespaceDeclSets.size());
- mark_nsdeclelem_size.push((m_namespaceDeclSetElements==null)
- ? 0
- : m_namespaceDeclSetElements.size());
-
- // Values from SAX2DTM
- mark_data_size.push(m_data.size());
- mark_char_size.push(m_chars.size());
- mark_doq_size.push(m_dataOrQName.size());
- }
-
- /** "Tail-pruning" support for RTFs.
- *
- * This function pops the information previously saved by
- * pushRewindMark (which see) and uses it to discard all nodes added
- * to the DTM after that time. We expect that this will allow us to
- * reuse storage more effectively.
- *
- * This is _not_ intended to be called while a document is still being
- * constructed -- only between endDocument and the next startDocument
- *
- * %REVIEW% WARNING: This is the first use of some of the truncation
- * methods. If Xalan blows up after this is called, that's a likely
- * place to check.
- *
- * %REVIEW% Our original design for DTMs permitted them to share
- * string pools. If there any risk that this might be happening, we
- * can _not_ rewind and recover the string storage. One solution
- * might to assert that DTMs used for RTFs Must Not take advantage
- * of that feature, but this seems excessively fragile. Another, much
- * less attractive, would be to just let them leak... Nah.
- *
- * @return true if and only if the pop completely emptied the
- * RTF. That response is used when determining how to unspool
- * RTF-started-while-RTF-open situations.
- * */
- public boolean popRewindMark()
- {
- boolean top=mark_size.empty();
-
- m_size=top ? m_emptyNodeCount : mark_size.pop();
- m_exptype.setSize(m_size);
- m_firstch.setSize(m_size);
- m_nextsib.setSize(m_size);
- m_prevsib.setSize(m_size);
- m_parent.setSize(m_size);
-
- m_elemIndexes=null;
-
- int ds= top ? m_emptyNSDeclSetCount : mark_nsdeclset_size.pop();
- if (m_namespaceDeclSets!=null) {
- m_namespaceDeclSets.setSize(ds);
- }
-
- int ds1= top ? m_emptyNSDeclSetElemsCount : mark_nsdeclelem_size.pop();
- if (m_namespaceDeclSetElements!=null) {
- m_namespaceDeclSetElements.setSize(ds1);
- }
-
- // Values from SAX2DTM - m_data always has a reserved entry
- m_data.setSize(top ? m_emptyDataCount : mark_data_size.pop());
- m_chars.setLength(top ? m_emptyCharsCount : mark_char_size.pop());
- m_dataOrQName.setSize(top ? m_emptyDataQNCount : mark_doq_size.pop());
-
- // Return true iff DTM now empty
- return m_size==0;
- }
-
- /** @return true if a DTM tree is currently under construction.
- * */
- public boolean isTreeIncomplete()
- {
- return !m_endDocumentOccured;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/res/XMLErrorResources.java b/src/com/sun/org/apache/xml/internal/res/XMLErrorResources.java
deleted file mode 100644
index 1c83bc5..0000000
--- a/src/com/sun/org/apache/xml/internal/res/XMLErrorResources.java
+++ /dev/null
@@ -1,450 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xml.internal.res;
-
-
-import java.util.ListResourceBundle;
-
-/**
- * Set up error messages.
- * We build a two dimensional array of message keys and
- * message strings. In order to add a new message here,
- * you need to first add a String constant. And you need
- * to enter key, value pair as part of the contents
- * array. You also need to update MAX_CODE for error strings
- * and MAX_WARNING for warnings ( Needed for only information
- * purpose )
- */
-public class XMLErrorResources extends ListResourceBundle
-{
-
-/*
- * This file contains error and warning messages related to Xalan Error
- * Handling.
- *
- * General notes to translators:
- *
- * 1) Xalan (or more properly, Xalan-interpretive) and XSLTC are names of
- * components.
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- * XSLTC is an acronym for XSLT Compiler.
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 5) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 6) "Translet" is an invented term that describes the class file that
- * results from compiling an XML stylesheet into a Java class.
- *
- * 7) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- */
-
- /** Maximum error messages, this is needed to keep track of the number of messages. */
- public static final int MAX_CODE = 61;
-
- /** Maximum warnings, this is needed to keep track of the number of warnings. */
- public static final int MAX_WARNING = 0;
-
- /** Maximum misc strings. */
- public static final int MAX_OTHERS = 4;
-
- /** Maximum total warnings and error messages. */
- public static final int MAX_MESSAGES = MAX_CODE + MAX_WARNING + 1;
-
-
- /*
- * Message keys
- */
- public static final String ER_FUNCTION_NOT_SUPPORTED = "ER_FUNCTION_NOT_SUPPORTED";
- public static final String ER_CANNOT_OVERWRITE_CAUSE = "ER_CANNOT_OVERWRITE_CAUSE";
- public static final String ER_NO_DEFAULT_IMPL = "ER_NO_DEFAULT_IMPL";
- public static final String ER_CHUNKEDINTARRAY_NOT_SUPPORTED = "ER_CHUNKEDINTARRAY_NOT_SUPPORTED";
- public static final String ER_OFFSET_BIGGER_THAN_SLOT = "ER_OFFSET_BIGGER_THAN_SLOT";
- public static final String ER_COROUTINE_NOT_AVAIL = "ER_COROUTINE_NOT_AVAIL";
- public static final String ER_COROUTINE_CO_EXIT = "ER_COROUTINE_CO_EXIT";
- public static final String ER_COJOINROUTINESET_FAILED = "ER_COJOINROUTINESET_FAILED";
- public static final String ER_COROUTINE_PARAM = "ER_COROUTINE_PARAM";
- public static final String ER_PARSER_DOTERMINATE_ANSWERS = "ER_PARSER_DOTERMINATE_ANSWERS";
- public static final String ER_NO_PARSE_CALL_WHILE_PARSING = "ER_NO_PARSE_CALL_WHILE_PARSING";
- public static final String ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED = "ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED";
- public static final String ER_ITERATOR_AXIS_NOT_IMPLEMENTED = "ER_ITERATOR_AXIS_NOT_IMPLEMENTED";
- public static final String ER_ITERATOR_CLONE_NOT_SUPPORTED = "ER_ITERATOR_CLONE_NOT_SUPPORTED";
- public static final String ER_UNKNOWN_AXIS_TYPE = "ER_UNKNOWN_AXIS_TYPE";
- public static final String ER_AXIS_NOT_SUPPORTED = "ER_AXIS_NOT_SUPPORTED";
- public static final String ER_NO_DTMIDS_AVAIL = "ER_NO_DTMIDS_AVAIL";
- public static final String ER_NOT_SUPPORTED = "ER_NOT_SUPPORTED";
- public static final String ER_NODE_NON_NULL = "ER_NODE_NON_NULL";
- public static final String ER_COULD_NOT_RESOLVE_NODE = "ER_COULD_NOT_RESOLVE_NODE";
- public static final String ER_STARTPARSE_WHILE_PARSING = "ER_STARTPARSE_WHILE_PARSING";
- public static final String ER_STARTPARSE_NEEDS_SAXPARSER = "ER_STARTPARSE_NEEDS_SAXPARSER";
- public static final String ER_COULD_NOT_INIT_PARSER = "ER_COULD_NOT_INIT_PARSER";
- public static final String ER_EXCEPTION_CREATING_POOL = "ER_EXCEPTION_CREATING_POOL";
- public static final String ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE = "ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE";
- public static final String ER_SCHEME_REQUIRED = "ER_SCHEME_REQUIRED";
- public static final String ER_NO_SCHEME_IN_URI = "ER_NO_SCHEME_IN_URI";
- public static final String ER_NO_SCHEME_INURI = "ER_NO_SCHEME_INURI";
- public static final String ER_PATH_INVALID_CHAR = "ER_PATH_INVALID_CHAR";
- public static final String ER_SCHEME_FROM_NULL_STRING = "ER_SCHEME_FROM_NULL_STRING";
- public static final String ER_SCHEME_NOT_CONFORMANT = "ER_SCHEME_NOT_CONFORMANT";
- public static final String ER_HOST_ADDRESS_NOT_WELLFORMED = "ER_HOST_ADDRESS_NOT_WELLFORMED";
- public static final String ER_PORT_WHEN_HOST_NULL = "ER_PORT_WHEN_HOST_NULL";
- public static final String ER_INVALID_PORT = "ER_INVALID_PORT";
- public static final String ER_FRAG_FOR_GENERIC_URI ="ER_FRAG_FOR_GENERIC_URI";
- public static final String ER_FRAG_WHEN_PATH_NULL = "ER_FRAG_WHEN_PATH_NULL";
- public static final String ER_FRAG_INVALID_CHAR = "ER_FRAG_INVALID_CHAR";
- public static final String ER_PARSER_IN_USE = "ER_PARSER_IN_USE";
- public static final String ER_CANNOT_CHANGE_WHILE_PARSING = "ER_CANNOT_CHANGE_WHILE_PARSING";
- public static final String ER_SELF_CAUSATION_NOT_PERMITTED = "ER_SELF_CAUSATION_NOT_PERMITTED";
- public static final String ER_NO_USERINFO_IF_NO_HOST = "ER_NO_USERINFO_IF_NO_HOST";
- public static final String ER_NO_PORT_IF_NO_HOST = "ER_NO_PORT_IF_NO_HOST";
- public static final String ER_NO_QUERY_STRING_IN_PATH = "ER_NO_QUERY_STRING_IN_PATH";
- public static final String ER_NO_FRAGMENT_STRING_IN_PATH = "ER_NO_FRAGMENT_STRING_IN_PATH";
- public static final String ER_CANNOT_INIT_URI_EMPTY_PARMS = "ER_CANNOT_INIT_URI_EMPTY_PARMS";
- public static final String ER_METHOD_NOT_SUPPORTED ="ER_METHOD_NOT_SUPPORTED";
- public static final String ER_INCRSAXSRCFILTER_NOT_RESTARTABLE = "ER_INCRSAXSRCFILTER_NOT_RESTARTABLE";
- public static final String ER_XMLRDR_NOT_BEFORE_STARTPARSE = "ER_XMLRDR_NOT_BEFORE_STARTPARSE";
- public static final String ER_AXIS_TRAVERSER_NOT_SUPPORTED = "ER_AXIS_TRAVERSER_NOT_SUPPORTED";
- public static final String ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER = "ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER";
- public static final String ER_SYSTEMID_UNKNOWN = "ER_SYSTEMID_UNKNOWN";
- public static final String ER_LOCATION_UNKNOWN = "ER_LOCATION_UNKNOWN";
- public static final String ER_PREFIX_MUST_RESOLVE = "ER_PREFIX_MUST_RESOLVE";
- public static final String ER_CREATEDOCUMENT_NOT_SUPPORTED = "ER_CREATEDOCUMENT_NOT_SUPPORTED";
- public static final String ER_CHILD_HAS_NO_OWNER_DOCUMENT = "ER_CHILD_HAS_NO_OWNER_DOCUMENT";
- public static final String ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT = "ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT";
- public static final String ER_CANT_OUTPUT_TEXT_BEFORE_DOC = "ER_CANT_OUTPUT_TEXT_BEFORE_DOC";
- public static final String ER_CANT_HAVE_MORE_THAN_ONE_ROOT = "ER_CANT_HAVE_MORE_THAN_ONE_ROOT";
- public static final String ER_ARG_LOCALNAME_NULL = "ER_ARG_LOCALNAME_NULL";
- public static final String ER_ARG_LOCALNAME_INVALID = "ER_ARG_LOCALNAME_INVALID";
- public static final String ER_ARG_PREFIX_INVALID = "ER_ARG_PREFIX_INVALID";
- public static final String ER_NAME_CANT_START_WITH_COLON = "ER_NAME_CANT_START_WITH_COLON";
-
- // Message keys used by the serializer
- public static final String ER_RESOURCE_COULD_NOT_FIND = "ER_RESOURCE_COULD_NOT_FIND";
- public static final String ER_RESOURCE_COULD_NOT_LOAD = "ER_RESOURCE_COULD_NOT_LOAD";
- public static final String ER_BUFFER_SIZE_LESSTHAN_ZERO = "ER_BUFFER_SIZE_LESSTHAN_ZERO";
- public static final String ER_INVALID_UTF16_SURROGATE = "ER_INVALID_UTF16_SURROGATE";
- public static final String ER_OIERROR = "ER_OIERROR";
- public static final String ER_NAMESPACE_PREFIX = "ER_NAMESPACE_PREFIX";
- public static final String ER_STRAY_ATTRIBUTE = "ER_STRAY_ATTIRBUTE";
- public static final String ER_STRAY_NAMESPACE = "ER_STRAY_NAMESPACE";
- public static final String ER_COULD_NOT_LOAD_RESOURCE = "ER_COULD_NOT_LOAD_RESOURCE";
- public static final String ER_COULD_NOT_LOAD_METHOD_PROPERTY = "ER_COULD_NOT_LOAD_METHOD_PROPERTY";
- public static final String ER_SERIALIZER_NOT_CONTENTHANDLER = "ER_SERIALIZER_NOT_CONTENTHANDLER";
- public static final String ER_ILLEGAL_ATTRIBUTE_POSITION = "ER_ILLEGAL_ATTRIBUTE_POSITION";
- public static final String ER_ILLEGAL_CHARACTER = "ER_ILLEGAL_CHARACTER";
-
- /*
- * Now fill in the message text.
- * Then fill in the message text for that message code in the
- * array. Use the new error code as the index into the array.
- */
-
- // Error messages...
-
- /** The lookup table for error messages. */
- private static final Object[][] contents = {
-
- /** Error message ID that has a null message, but takes in a single object. */
- {"ER0000" , "{0}" },
-
- { ER_FUNCTION_NOT_SUPPORTED,
- "Function not supported!"},
-
- { ER_CANNOT_OVERWRITE_CAUSE,
- "Cannot overwrite cause"},
-
- { ER_NO_DEFAULT_IMPL,
- "No default implementation found "},
-
- { ER_CHUNKEDINTARRAY_NOT_SUPPORTED,
- "ChunkedIntArray({0}) not currently supported"},
-
- { ER_OFFSET_BIGGER_THAN_SLOT,
- "Offset bigger than slot"},
-
- { ER_COROUTINE_NOT_AVAIL,
- "Coroutine not available, id={0}"},
-
- { ER_COROUTINE_CO_EXIT,
- "CoroutineManager received co_exit() request"},
-
- { ER_COJOINROUTINESET_FAILED,
- "co_joinCoroutineSet() failed"},
-
- { ER_COROUTINE_PARAM,
- "Coroutine parameter error ({0})"},
-
- { ER_PARSER_DOTERMINATE_ANSWERS,
- "\nUNEXPECTED: Parser doTerminate answers {0}"},
-
- { ER_NO_PARSE_CALL_WHILE_PARSING,
- "parse may not be called while parsing"},
-
- { ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED,
- "Error: typed iterator for axis {0} not implemented"},
-
- { ER_ITERATOR_AXIS_NOT_IMPLEMENTED,
- "Error: iterator for axis {0} not implemented "},
-
- { ER_ITERATOR_CLONE_NOT_SUPPORTED,
- "Iterator clone not supported"},
-
- { ER_UNKNOWN_AXIS_TYPE,
- "Unknown axis traversal type: {0}"},
-
- { ER_AXIS_NOT_SUPPORTED,
- "Axis traverser not supported: {0}"},
-
- { ER_NO_DTMIDS_AVAIL,
- "No more DTM IDs are available"},
-
- { ER_NOT_SUPPORTED,
- "Not supported: {0}"},
-
- { ER_NODE_NON_NULL,
- "Node must be non-null for getDTMHandleFromNode"},
-
- { ER_COULD_NOT_RESOLVE_NODE,
- "Could not resolve the node to a handle"},
-
- { ER_STARTPARSE_WHILE_PARSING,
- "startParse may not be called while parsing"},
-
- { ER_STARTPARSE_NEEDS_SAXPARSER,
- "startParse needs a non-null SAXParser"},
-
- { ER_COULD_NOT_INIT_PARSER,
- "could not initialize parser with"},
-
- { ER_EXCEPTION_CREATING_POOL,
- "exception creating new instance for pool"},
-
- { ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE,
- "Path contains invalid escape sequence"},
-
- { ER_SCHEME_REQUIRED,
- "Scheme is required!"},
-
- { ER_NO_SCHEME_IN_URI,
- "No scheme found in URI: {0}"},
-
- { ER_NO_SCHEME_INURI,
- "No scheme found in URI"},
-
- { ER_PATH_INVALID_CHAR,
- "Path contains invalid character: {0}"},
-
- { ER_SCHEME_FROM_NULL_STRING,
- "Cannot set scheme from null string"},
-
- { ER_SCHEME_NOT_CONFORMANT,
- "The scheme is not conformant."},
-
- { ER_HOST_ADDRESS_NOT_WELLFORMED,
- "Host is not a well formed address"},
-
- { ER_PORT_WHEN_HOST_NULL,
- "Port cannot be set when host is null"},
-
- { ER_INVALID_PORT,
- "Invalid port number"},
-
- { ER_FRAG_FOR_GENERIC_URI,
- "Fragment can only be set for a generic URI"},
-
- { ER_FRAG_WHEN_PATH_NULL,
- "Fragment cannot be set when path is null"},
-
- { ER_FRAG_INVALID_CHAR,
- "Fragment contains invalid character"},
-
- { ER_PARSER_IN_USE,
- "Parser is already in use"},
-
- { ER_CANNOT_CHANGE_WHILE_PARSING,
- "Cannot change {0} {1} while parsing"},
-
- { ER_SELF_CAUSATION_NOT_PERMITTED,
- "Self-causation not permitted"},
-
- { ER_NO_USERINFO_IF_NO_HOST,
- "Userinfo may not be specified if host is not specified"},
-
- { ER_NO_PORT_IF_NO_HOST,
- "Port may not be specified if host is not specified"},
-
- { ER_NO_QUERY_STRING_IN_PATH,
- "Query string cannot be specified in path and query string"},
-
- { ER_NO_FRAGMENT_STRING_IN_PATH,
- "Fragment cannot be specified in both the path and fragment"},
-
- { ER_CANNOT_INIT_URI_EMPTY_PARMS,
- "Cannot initialize URI with empty parameters"},
-
- { ER_METHOD_NOT_SUPPORTED,
- "Method not yet supported "},
-
- { ER_INCRSAXSRCFILTER_NOT_RESTARTABLE,
- "IncrementalSAXSource_Filter not currently restartable"},
-
- { ER_XMLRDR_NOT_BEFORE_STARTPARSE,
- "XMLReader not before startParse request"},
-
- { ER_AXIS_TRAVERSER_NOT_SUPPORTED,
- "Axis traverser not supported: {0}"},
-
- { ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER,
- "ListingErrorHandler created with null PrintWriter!"},
-
- { ER_SYSTEMID_UNKNOWN,
- "SystemId Unknown"},
-
- { ER_LOCATION_UNKNOWN,
- "Location of error unknown"},
-
- { ER_PREFIX_MUST_RESOLVE,
- "Prefix must resolve to a namespace: {0}"},
-
- { ER_CREATEDOCUMENT_NOT_SUPPORTED,
- "createDocument() not supported in XPathContext!"},
-
- { ER_CHILD_HAS_NO_OWNER_DOCUMENT,
- "Attribute child does not have an owner document!"},
-
- { ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT,
- "Attribute child does not have an owner document element!"},
-
- { ER_CANT_OUTPUT_TEXT_BEFORE_DOC,
- "Warning: can't output text before document element! Ignoring..."},
-
- { ER_CANT_HAVE_MORE_THAN_ONE_ROOT,
- "Can't have more than one root on a DOM!"},
-
- { ER_ARG_LOCALNAME_NULL,
- "Argument 'localName' is null"},
-
- // Note to translators: A QNAME has the syntactic form [NCName:]NCName
- // The localname is the portion after the optional colon; the message indicates
- // that there is a problem with that part of the QNAME.
- { ER_ARG_LOCALNAME_INVALID,
- "Localname in QNAME should be a valid NCName"},
-
- // Note to translators: A QNAME has the syntactic form [NCName:]NCName
- // The prefix is the portion before the optional colon; the message indicates
- // that there is a problem with that part of the QNAME.
- { ER_ARG_PREFIX_INVALID,
- "Prefix in QNAME should be a valid NCName"},
-
- { ER_NAME_CANT_START_WITH_COLON,
- "Name cannot start with a colon"},
-
- { "BAD_CODE", "Parameter to createMessage was out of bounds"},
- { "FORMAT_FAILED", "Exception thrown during messageFormat call"},
- { "line", "Line #"},
- { "column","Column #"},
-
- {ER_SERIALIZER_NOT_CONTENTHANDLER,
- "The serializer class ''{0}'' does not implement org.xml.sax.ContentHandler."},
-
- {ER_RESOURCE_COULD_NOT_FIND,
- "The resource [ {0} ] could not be found.\n {1}" },
-
- {ER_RESOURCE_COULD_NOT_LOAD,
- "The resource [ {0} ] could not load: {1} \n {2} \t {3}" },
-
- {ER_BUFFER_SIZE_LESSTHAN_ZERO,
- "Buffer size <=0" },
-
- {ER_INVALID_UTF16_SURROGATE,
- "Invalid UTF-16 surrogate detected: {0} ?" },
-
- {ER_OIERROR,
- "IO error" },
-
- {ER_ILLEGAL_ATTRIBUTE_POSITION,
- "Cannot add attribute {0} after child nodes or before an element is produced. Attribute will be ignored."},
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- {ER_NAMESPACE_PREFIX,
- "Namespace for prefix ''{0}'' has not been declared." },
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- {ER_STRAY_ATTRIBUTE,
- "Attribute ''{0}'' outside of element." },
-
- /*
- * Note to translators: As with the preceding message, a namespace
- * declaration has the form of an attribute and is only permitted to
- * appear on an element. The substitution text {0} is the namespace
- * prefix and {1} is the URI that was being used in the erroneous
- * namespace declaration.
- */
- {ER_STRAY_NAMESPACE,
- "Namespace declaration ''{0}''=''{1}'' outside of element." },
-
- {ER_COULD_NOT_LOAD_RESOURCE,
- "Could not load ''{0}'' (check CLASSPATH), now using just the defaults"},
-
- { ER_ILLEGAL_CHARACTER,
- "Attempt to output character of integral value {0} that is not represented in specified output encoding of {1}."},
-
- {ER_COULD_NOT_LOAD_METHOD_PROPERTY,
- "Could not load the propery file ''{0}'' for output method ''{1}'' (check CLASSPATH)" }
-
-
- };
-
- /**
- * Get the association list.
- *
- * @return The association list.
- */
-
- protected Object[][] getContents() {
- return contents;
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_ca.java b/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_ca.java
deleted file mode 100644
index 5dcb27c..0000000
--- a/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_ca.java
+++ /dev/null
@@ -1,443 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XMLErrorResources_ca.java,v 1.1.6.2 2005/09/15 07:45:37 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.res;
-
-
-import java.util.ListResourceBundle;
-
-/**
- * Set up error messages.
- * We build a two dimensional array of message keys and
- * message strings. In order to add a new message here,
- * you need to first add a String constant. And you need
- * to enter key, value pair as part of the contents
- * array. You also need to update MAX_CODE for error strings
- * and MAX_WARNING for warnings ( Needed for only information
- * purpose )
- */
-public class XMLErrorResources_ca extends ListResourceBundle
-{
-
-/*
- * This file contains error and warning messages related to Xalan Error
- * Handling.
- *
- * General notes to translators:
- *
- * 1) Xalan (or more properly, Xalan-interpretive) and XSLTC are names of
- * components.
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- * XSLTC is an acronym for XSLT Compiler.
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 5) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 6) "Translet" is an invented term that describes the class file that
- * results from compiling an XML stylesheet into a Java class.
- *
- * 7) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- */
-
- /** Maximum error messages, this is needed to keep track of the number of messages. */
- public static final int MAX_CODE = 61;
-
- /** Maximum warnings, this is needed to keep track of the number of warnings. */
- public static final int MAX_WARNING = 0;
-
- /** Maximum misc strings. */
- public static final int MAX_OTHERS = 4;
-
- /** Maximum total warnings and error messages. */
- public static final int MAX_MESSAGES = MAX_CODE + MAX_WARNING + 1;
-
-
- /*
- * Message keys
- */
- public static final String ER_FUNCTION_NOT_SUPPORTED = "ER_FUNCTION_NOT_SUPPORTED";
- public static final String ER_CANNOT_OVERWRITE_CAUSE = "ER_CANNOT_OVERWRITE_CAUSE";
- public static final String ER_NO_DEFAULT_IMPL = "ER_NO_DEFAULT_IMPL";
- public static final String ER_CHUNKEDINTARRAY_NOT_SUPPORTED = "ER_CHUNKEDINTARRAY_NOT_SUPPORTED";
- public static final String ER_OFFSET_BIGGER_THAN_SLOT = "ER_OFFSET_BIGGER_THAN_SLOT";
- public static final String ER_COROUTINE_NOT_AVAIL = "ER_COROUTINE_NOT_AVAIL";
- public static final String ER_COROUTINE_CO_EXIT = "ER_COROUTINE_CO_EXIT";
- public static final String ER_COJOINROUTINESET_FAILED = "ER_COJOINROUTINESET_FAILED";
- public static final String ER_COROUTINE_PARAM = "ER_COROUTINE_PARAM";
- public static final String ER_PARSER_DOTERMINATE_ANSWERS = "ER_PARSER_DOTERMINATE_ANSWERS";
- public static final String ER_NO_PARSE_CALL_WHILE_PARSING = "ER_NO_PARSE_CALL_WHILE_PARSING";
- public static final String ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED = "ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED";
- public static final String ER_ITERATOR_AXIS_NOT_IMPLEMENTED = "ER_ITERATOR_AXIS_NOT_IMPLEMENTED";
- public static final String ER_ITERATOR_CLONE_NOT_SUPPORTED = "ER_ITERATOR_CLONE_NOT_SUPPORTED";
- public static final String ER_UNKNOWN_AXIS_TYPE = "ER_UNKNOWN_AXIS_TYPE";
- public static final String ER_AXIS_NOT_SUPPORTED = "ER_AXIS_NOT_SUPPORTED";
- public static final String ER_NO_DTMIDS_AVAIL = "ER_NO_DTMIDS_AVAIL";
- public static final String ER_NOT_SUPPORTED = "ER_NOT_SUPPORTED";
- public static final String ER_NODE_NON_NULL = "ER_NODE_NON_NULL";
- public static final String ER_COULD_NOT_RESOLVE_NODE = "ER_COULD_NOT_RESOLVE_NODE";
- public static final String ER_STARTPARSE_WHILE_PARSING = "ER_STARTPARSE_WHILE_PARSING";
- public static final String ER_STARTPARSE_NEEDS_SAXPARSER = "ER_STARTPARSE_NEEDS_SAXPARSER";
- public static final String ER_COULD_NOT_INIT_PARSER = "ER_COULD_NOT_INIT_PARSER";
- public static final String ER_EXCEPTION_CREATING_POOL = "ER_EXCEPTION_CREATING_POOL";
- public static final String ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE = "ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE";
- public static final String ER_SCHEME_REQUIRED = "ER_SCHEME_REQUIRED";
- public static final String ER_NO_SCHEME_IN_URI = "ER_NO_SCHEME_IN_URI";
- public static final String ER_NO_SCHEME_INURI = "ER_NO_SCHEME_INURI";
- public static final String ER_PATH_INVALID_CHAR = "ER_PATH_INVALID_CHAR";
- public static final String ER_SCHEME_FROM_NULL_STRING = "ER_SCHEME_FROM_NULL_STRING";
- public static final String ER_SCHEME_NOT_CONFORMANT = "ER_SCHEME_NOT_CONFORMANT";
- public static final String ER_HOST_ADDRESS_NOT_WELLFORMED = "ER_HOST_ADDRESS_NOT_WELLFORMED";
- public static final String ER_PORT_WHEN_HOST_NULL = "ER_PORT_WHEN_HOST_NULL";
- public static final String ER_INVALID_PORT = "ER_INVALID_PORT";
- public static final String ER_FRAG_FOR_GENERIC_URI ="ER_FRAG_FOR_GENERIC_URI";
- public static final String ER_FRAG_WHEN_PATH_NULL = "ER_FRAG_WHEN_PATH_NULL";
- public static final String ER_FRAG_INVALID_CHAR = "ER_FRAG_INVALID_CHAR";
- public static final String ER_PARSER_IN_USE = "ER_PARSER_IN_USE";
- public static final String ER_CANNOT_CHANGE_WHILE_PARSING = "ER_CANNOT_CHANGE_WHILE_PARSING";
- public static final String ER_SELF_CAUSATION_NOT_PERMITTED = "ER_SELF_CAUSATION_NOT_PERMITTED";
- public static final String ER_NO_USERINFO_IF_NO_HOST = "ER_NO_USERINFO_IF_NO_HOST";
- public static final String ER_NO_PORT_IF_NO_HOST = "ER_NO_PORT_IF_NO_HOST";
- public static final String ER_NO_QUERY_STRING_IN_PATH = "ER_NO_QUERY_STRING_IN_PATH";
- public static final String ER_NO_FRAGMENT_STRING_IN_PATH = "ER_NO_FRAGMENT_STRING_IN_PATH";
- public static final String ER_CANNOT_INIT_URI_EMPTY_PARMS = "ER_CANNOT_INIT_URI_EMPTY_PARMS";
- public static final String ER_METHOD_NOT_SUPPORTED ="ER_METHOD_NOT_SUPPORTED";
- public static final String ER_INCRSAXSRCFILTER_NOT_RESTARTABLE = "ER_INCRSAXSRCFILTER_NOT_RESTARTABLE";
- public static final String ER_XMLRDR_NOT_BEFORE_STARTPARSE = "ER_XMLRDR_NOT_BEFORE_STARTPARSE";
- public static final String ER_AXIS_TRAVERSER_NOT_SUPPORTED = "ER_AXIS_TRAVERSER_NOT_SUPPORTED";
- public static final String ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER = "ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER";
- public static final String ER_SYSTEMID_UNKNOWN = "ER_SYSTEMID_UNKNOWN";
- public static final String ER_LOCATION_UNKNOWN = "ER_LOCATION_UNKNOWN";
- public static final String ER_PREFIX_MUST_RESOLVE = "ER_PREFIX_MUST_RESOLVE";
- public static final String ER_CREATEDOCUMENT_NOT_SUPPORTED = "ER_CREATEDOCUMENT_NOT_SUPPORTED";
- public static final String ER_CHILD_HAS_NO_OWNER_DOCUMENT = "ER_CHILD_HAS_NO_OWNER_DOCUMENT";
- public static final String ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT = "ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT";
- public static final String ER_CANT_OUTPUT_TEXT_BEFORE_DOC = "ER_CANT_OUTPUT_TEXT_BEFORE_DOC";
- public static final String ER_CANT_HAVE_MORE_THAN_ONE_ROOT = "ER_CANT_HAVE_MORE_THAN_ONE_ROOT";
- public static final String ER_ARG_LOCALNAME_NULL = "ER_ARG_LOCALNAME_NULL";
- public static final String ER_ARG_LOCALNAME_INVALID = "ER_ARG_LOCALNAME_INVALID";
- public static final String ER_ARG_PREFIX_INVALID = "ER_ARG_PREFIX_INVALID";
-
- // Message keys used by the serializer
- public static final String ER_RESOURCE_COULD_NOT_FIND = "ER_RESOURCE_COULD_NOT_FIND";
- public static final String ER_RESOURCE_COULD_NOT_LOAD = "ER_RESOURCE_COULD_NOT_LOAD";
- public static final String ER_BUFFER_SIZE_LESSTHAN_ZERO = "ER_BUFFER_SIZE_LESSTHAN_ZERO";
- public static final String ER_INVALID_UTF16_SURROGATE = "ER_INVALID_UTF16_SURROGATE";
- public static final String ER_OIERROR = "ER_OIERROR";
- public static final String ER_NAMESPACE_PREFIX = "ER_NAMESPACE_PREFIX";
- public static final String ER_STRAY_ATTRIBUTE = "ER_STRAY_ATTIRBUTE";
- public static final String ER_STRAY_NAMESPACE = "ER_STRAY_NAMESPACE";
- public static final String ER_COULD_NOT_LOAD_RESOURCE = "ER_COULD_NOT_LOAD_RESOURCE";
- public static final String ER_COULD_NOT_LOAD_METHOD_PROPERTY = "ER_COULD_NOT_LOAD_METHOD_PROPERTY";
- public static final String ER_SERIALIZER_NOT_CONTENTHANDLER = "ER_SERIALIZER_NOT_CONTENTHANDLER";
- public static final String ER_ILLEGAL_ATTRIBUTE_POSITION = "ER_ILLEGAL_ATTRIBUTE_POSITION";
-
- /*
- * Now fill in the message text.
- * Then fill in the message text for that message code in the
- * array. Use the new error code as the index into the array.
- */
-
- // Error messages...
- private static final Object[][] _contents = new Object[][] {
-
- /** Error message ID that has a null message, but takes in a single object. */
- {"ER0000" , "{0}" },
-
- { ER_FUNCTION_NOT_SUPPORTED,
- "Aquesta funci\u00f3 no t\u00e9 suport. "},
-
- { ER_CANNOT_OVERWRITE_CAUSE,
- "No es pot sobreescriure una causa "},
-
- { ER_NO_DEFAULT_IMPL,
- "No s'ha trobat cap implementaci\u00f3 per defecte "},
-
- { ER_CHUNKEDINTARRAY_NOT_SUPPORTED,
- "En l''actualitat ChunkedIntArray({0}) no t\u00e9 suport "},
-
- { ER_OFFSET_BIGGER_THAN_SLOT,
- "El despla\u00e7ament \u00e9s m\u00e9s gran que la ranura "},
-
- { ER_COROUTINE_NOT_AVAIL,
- "Coroutine no est\u00e0 disponible, id={0} "},
-
- { ER_COROUTINE_CO_EXIT,
- "CoroutineManager ha rebut una petici\u00f3 co_exit() "},
-
- { ER_COJOINROUTINESET_FAILED,
- "S'ha produ\u00eft un error a co_joinCoroutineSet() "},
-
- { ER_COROUTINE_PARAM,
- "Error de par\u00e0metre coroutine ({0}) "},
-
- { ER_PARSER_DOTERMINATE_ANSWERS,
- "\nUNEXPECTED: doTerminate de l''analitzador respon {0}"},
-
- { ER_NO_PARSE_CALL_WHILE_PARSING,
- "L'an\u00e0lisi no es pot cridar mentre s'est\u00e0 duent a terme "},
-
- { ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED,
- "Error: l''iterador de tipus de l''eix {0} no s''ha implementat "},
-
- { ER_ITERATOR_AXIS_NOT_IMPLEMENTED,
- "Error: l''iterador de l''eix {0} no s''ha implementat "},
-
- { ER_ITERATOR_CLONE_NOT_SUPPORTED,
- "El clonatge de l'iterador no t\u00e9 suport "},
-
- { ER_UNKNOWN_AXIS_TYPE,
- "Tipus de commutaci\u00f3 de l''eix desconeguda: {0} "},
-
- { ER_AXIS_NOT_SUPPORTED,
- "La commutaci\u00f3 de l''eix no t\u00e9 suport: {0} "},
-
- { ER_NO_DTMIDS_AVAIL,
- "No hi ha m\u00e9s ID de DTM disponibles "},
-
- { ER_NOT_SUPPORTED,
- "No t\u00e9 suport: {0} "},
-
- { ER_NODE_NON_NULL,
- "El node no ha de ser nul per a getDTMHandleFromNode "},
-
- { ER_COULD_NOT_RESOLVE_NODE,
- "No s'ha pogut resoldre el node en un manejador "},
-
- { ER_STARTPARSE_WHILE_PARSING,
- "startParse no es pot cridar mentre s'est\u00e0 duent a terme l'an\u00e0lisi "},
-
- { ER_STARTPARSE_NEEDS_SAXPARSER,
- "startParse necessita un SAXParser que no sigui nul "},
-
- { ER_COULD_NOT_INIT_PARSER,
- "No s'ha pogut inicialitzar l'analitzador amb "},
-
- { ER_EXCEPTION_CREATING_POOL,
- "S'ha produ\u00eft una excepci\u00f3 en crear una nova inst\u00e0ncia de l'agrupaci\u00f3 "},
-
- { ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE,
- "La via d'acc\u00e9s cont\u00e9 una seq\u00fc\u00e8ncia d'escapament no v\u00e0lida "},
-
- { ER_SCHEME_REQUIRED,
- "Es necessita l'esquema "},
-
- { ER_NO_SCHEME_IN_URI,
- "No s''ha trobat cap esquema a l''URI: {0} "},
-
- { ER_NO_SCHEME_INURI,
- "No s'ha trobat cap esquema a l'URI "},
-
- { ER_PATH_INVALID_CHAR,
- "La via d'acc\u00e9s cont\u00e9 un car\u00e0cter no v\u00e0lid {0} "},
-
- { ER_SCHEME_FROM_NULL_STRING,
- "No es pot establir un esquema des d'una cadena nul\u00b7la "},
-
- { ER_SCHEME_NOT_CONFORMANT,
- "L'esquema no t\u00e9 conformitat. "},
-
- { ER_HOST_ADDRESS_NOT_WELLFORMED,
- "El sistema principal no t\u00e9 una adre\u00e7a ben formada "},
-
- { ER_PORT_WHEN_HOST_NULL,
- "El port no es pot establir quan el sistema principal \u00e9s nul "},
-
- { ER_INVALID_PORT,
- "N\u00famero de port no v\u00e0lid "},
-
- { ER_FRAG_FOR_GENERIC_URI,
- "El fragment nom\u00e9s es pot establir per a un URI gen\u00e8ric "},
-
- { ER_FRAG_WHEN_PATH_NULL,
- "El fragment no es pot establir si la via d'acc\u00e9s \u00e9s nul\u00b7la "},
-
- { ER_FRAG_INVALID_CHAR,
- "El fragment cont\u00e9 un car\u00e0cter no v\u00e0lid "},
-
- { ER_PARSER_IN_USE,
- "L'analitzador ja s'est\u00e0 utilitzant "},
-
- { ER_CANNOT_CHANGE_WHILE_PARSING,
- "No es pot modificar {0} {1} mentre es du a terme l''an\u00e0lisi "},
-
- { ER_SELF_CAUSATION_NOT_PERMITTED,
- "La causalitat pr\u00f2pia no est\u00e0 permesa. "},
-
- { ER_NO_USERINFO_IF_NO_HOST,
- "No es pot especificar informaci\u00f3 de l'usuari si no s'especifica el sistema principal "},
-
- { ER_NO_PORT_IF_NO_HOST,
- "No es pot especificar el port si no s'especifica el sistema principal "},
-
- { ER_NO_QUERY_STRING_IN_PATH,
- "No es pot especificar una cadena de consulta en la via d'acc\u00e9s i la cadena de consulta "},
-
- { ER_NO_FRAGMENT_STRING_IN_PATH,
- "No es pot especificar un fragment tant en la via d'acc\u00e9s com en el fragment "},
-
- { ER_CANNOT_INIT_URI_EMPTY_PARMS,
- "No es pot inicialitzar l'URI amb par\u00e0metres buits "},
-
- { ER_METHOD_NOT_SUPPORTED,
- "Aquest m\u00e8tode encara no t\u00e9 suport "},
-
- { ER_INCRSAXSRCFILTER_NOT_RESTARTABLE,
- "Ara mateix no es pot reiniciar IncrementalSAXSource_Filter "},
-
- { ER_XMLRDR_NOT_BEFORE_STARTPARSE,
- "XMLReader no es pot produir abans de la petici\u00f3 d'startParse "},
-
- { ER_AXIS_TRAVERSER_NOT_SUPPORTED,
- "La commutaci\u00f3 de l''eix no t\u00e9 suport: {0} "},
-
- { ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER,
- "S''ha creat ListingErrorHandler amb PrintWriter nul "},
-
- { ER_SYSTEMID_UNKNOWN,
- "ID del sistema (SystemId) desconegut "},
-
- { ER_LOCATION_UNKNOWN,
- "Ubicaci\u00f3 de l'error desconeguda"},
-
- { ER_PREFIX_MUST_RESOLVE,
- "El prefix s''ha de resoldre en un espai de noms: {0} "},
-
- { ER_CREATEDOCUMENT_NOT_SUPPORTED,
- "createDocument() no t\u00e9 suport a XPathContext "},
-
- { ER_CHILD_HAS_NO_OWNER_DOCUMENT,
- "El subordinat de l'atribut no t\u00e9 un document de propietari. "},
-
- { ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT,
- "El subordinat de l'atribut no t\u00e9 un element de document de propietari. "},
-
- { ER_CANT_OUTPUT_TEXT_BEFORE_DOC,
- "Av\u00eds: no es pot produir text abans de l'element de document. Es passa per alt. "},
-
- { ER_CANT_HAVE_MORE_THAN_ONE_ROOT,
- "No hi pot haver m\u00e9s d'una arrel en un DOM. "},
-
- { ER_ARG_LOCALNAME_NULL,
- "L'argument 'localName' \u00e9s nul. "},
-
- // Note to translators: A QNAME has the syntactic form [NCName:]NCName
- // The localname is the portion after the optional colon; the message indicates
- // that there is a problem with that part of the QNAME.
- { ER_ARG_LOCALNAME_INVALID,
- "El nom local de QNAME ha de ser un NCName v\u00e0lid. "},
-
- // Note to translators: A QNAME has the syntactic form [NCName:]NCName
- // The prefix is the portion before the optional colon; the message indicates
- // that there is a problem with that part of the QNAME.
- { ER_ARG_PREFIX_INVALID,
- "El prefix de QNAME ha de ser un NCName v\u00e0lid. "},
-
- { "BAD_CODE", "El par\u00e0metre de createMessage estava fora dels l\u00edmits. "},
- { "FORMAT_FAILED", "S'ha generat una excepci\u00f3 durant la crida messageFormat. "},
- { "line", "L\u00ednia n\u00fam. "},
- { "column","Columna n\u00fam. "},
-
- {ER_SERIALIZER_NOT_CONTENTHANDLER,
- "La classe de serialitzador ''{0}'' no implementa org.xml.sax.ContentHandler."},
-
- {ER_RESOURCE_COULD_NOT_FIND,
- "No s''ha trobat el recurs [ {0} ].\n {1}" },
-
- {ER_RESOURCE_COULD_NOT_LOAD,
- "El recurs [ {0} ] no s''ha pogut carregar: {1} \n {2} \t {3}" },
-
- {ER_BUFFER_SIZE_LESSTHAN_ZERO,
- "Grand\u00e0ria del buffer <=0 " },
-
- {ER_INVALID_UTF16_SURROGATE,
- "S''ha detectat un suplent UTF-16 no v\u00e0lid: {0} ? " },
-
- {ER_OIERROR,
- "Error d'E/S " },
-
- {ER_ILLEGAL_ATTRIBUTE_POSITION,
- "No es pot afegir l''atribut {0} despr\u00e9s dels nodes subordinats o abans que es produeixi un element. Es passar\u00e0 per alt l''atribut. "},
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- {ER_NAMESPACE_PREFIX,
- "L''espai de noms del prefix ''{0}'' no s''ha declarat." },
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- {ER_STRAY_ATTRIBUTE,
- "L''atribut ''{0}'' es troba fora de l''element." },
-
- /*
- * Note to translators: As with the preceding message, a namespace
- * declaration has the form of an attribute and is only permitted to
- * appear on an element. The substitution text {0} is the namespace
- * prefix and {1} is the URI that was being used in the erroneous
- * namespace declaration.
- */
- {ER_STRAY_NAMESPACE,
- "La declaraci\u00f3 d''espai de noms ''{0}''=''{1}'' es troba fora de l''element." },
-
- {ER_COULD_NOT_LOAD_RESOURCE,
- "No s''ha pogut carregar ''{0}'' (comproveu la CLASSPATH); ara s''estan fent servir els valors per defecte."},
-
- {ER_COULD_NOT_LOAD_METHOD_PROPERTY,
- "No s''ha pogut carregar el fitxer de propietats ''{0}'' del m\u00e8tode de sortida ''{1}'' (comproveu la CLASSPATH)" }
-
-
- };
-
- /**
- * Get the lookup table for error messages
- *
- * @return The association list.
- */
- public Object[][] getContents()
- {
- return _contents;
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_cs.java b/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_cs.java
deleted file mode 100644
index f3e3c3e..0000000
--- a/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_cs.java
+++ /dev/null
@@ -1,443 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XMLErrorResources_cs.java,v 1.1.6.2 2005/09/15 07:45:38 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.res;
-
-
-import java.util.ListResourceBundle;
-
-/**
- * Set up error messages.
- * We build a two dimensional array of message keys and
- * message strings. In order to add a new message here,
- * you need to first add a String constant. And you need
- * to enter key, value pair as part of the contents
- * array. You also need to update MAX_CODE for error strings
- * and MAX_WARNING for warnings ( Needed for only information
- * purpose )
- */
-public class XMLErrorResources_cs extends ListResourceBundle
-{
-
-/*
- * This file contains error and warning messages related to Xalan Error
- * Handling.
- *
- * General notes to translators:
- *
- * 1) Xalan (or more properly, Xalan-interpretive) and XSLTC are names of
- * components.
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- * XSLTC is an acronym for XSLT Compiler.
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 5) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 6) "Translet" is an invented term that describes the class file that
- * results from compiling an XML stylesheet into a Java class.
- *
- * 7) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- */
-
- /** Maximum error messages, this is needed to keep track of the number of messages. */
- public static final int MAX_CODE = 61;
-
- /** Maximum warnings, this is needed to keep track of the number of warnings. */
- public static final int MAX_WARNING = 0;
-
- /** Maximum misc strings. */
- public static final int MAX_OTHERS = 4;
-
- /** Maximum total warnings and error messages. */
- public static final int MAX_MESSAGES = MAX_CODE + MAX_WARNING + 1;
-
-
- /*
- * Message keys
- */
- public static final String ER_FUNCTION_NOT_SUPPORTED = "ER_FUNCTION_NOT_SUPPORTED";
- public static final String ER_CANNOT_OVERWRITE_CAUSE = "ER_CANNOT_OVERWRITE_CAUSE";
- public static final String ER_NO_DEFAULT_IMPL = "ER_NO_DEFAULT_IMPL";
- public static final String ER_CHUNKEDINTARRAY_NOT_SUPPORTED = "ER_CHUNKEDINTARRAY_NOT_SUPPORTED";
- public static final String ER_OFFSET_BIGGER_THAN_SLOT = "ER_OFFSET_BIGGER_THAN_SLOT";
- public static final String ER_COROUTINE_NOT_AVAIL = "ER_COROUTINE_NOT_AVAIL";
- public static final String ER_COROUTINE_CO_EXIT = "ER_COROUTINE_CO_EXIT";
- public static final String ER_COJOINROUTINESET_FAILED = "ER_COJOINROUTINESET_FAILED";
- public static final String ER_COROUTINE_PARAM = "ER_COROUTINE_PARAM";
- public static final String ER_PARSER_DOTERMINATE_ANSWERS = "ER_PARSER_DOTERMINATE_ANSWERS";
- public static final String ER_NO_PARSE_CALL_WHILE_PARSING = "ER_NO_PARSE_CALL_WHILE_PARSING";
- public static final String ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED = "ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED";
- public static final String ER_ITERATOR_AXIS_NOT_IMPLEMENTED = "ER_ITERATOR_AXIS_NOT_IMPLEMENTED";
- public static final String ER_ITERATOR_CLONE_NOT_SUPPORTED = "ER_ITERATOR_CLONE_NOT_SUPPORTED";
- public static final String ER_UNKNOWN_AXIS_TYPE = "ER_UNKNOWN_AXIS_TYPE";
- public static final String ER_AXIS_NOT_SUPPORTED = "ER_AXIS_NOT_SUPPORTED";
- public static final String ER_NO_DTMIDS_AVAIL = "ER_NO_DTMIDS_AVAIL";
- public static final String ER_NOT_SUPPORTED = "ER_NOT_SUPPORTED";
- public static final String ER_NODE_NON_NULL = "ER_NODE_NON_NULL";
- public static final String ER_COULD_NOT_RESOLVE_NODE = "ER_COULD_NOT_RESOLVE_NODE";
- public static final String ER_STARTPARSE_WHILE_PARSING = "ER_STARTPARSE_WHILE_PARSING";
- public static final String ER_STARTPARSE_NEEDS_SAXPARSER = "ER_STARTPARSE_NEEDS_SAXPARSER";
- public static final String ER_COULD_NOT_INIT_PARSER = "ER_COULD_NOT_INIT_PARSER";
- public static final String ER_EXCEPTION_CREATING_POOL = "ER_EXCEPTION_CREATING_POOL";
- public static final String ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE = "ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE";
- public static final String ER_SCHEME_REQUIRED = "ER_SCHEME_REQUIRED";
- public static final String ER_NO_SCHEME_IN_URI = "ER_NO_SCHEME_IN_URI";
- public static final String ER_NO_SCHEME_INURI = "ER_NO_SCHEME_INURI";
- public static final String ER_PATH_INVALID_CHAR = "ER_PATH_INVALID_CHAR";
- public static final String ER_SCHEME_FROM_NULL_STRING = "ER_SCHEME_FROM_NULL_STRING";
- public static final String ER_SCHEME_NOT_CONFORMANT = "ER_SCHEME_NOT_CONFORMANT";
- public static final String ER_HOST_ADDRESS_NOT_WELLFORMED = "ER_HOST_ADDRESS_NOT_WELLFORMED";
- public static final String ER_PORT_WHEN_HOST_NULL = "ER_PORT_WHEN_HOST_NULL";
- public static final String ER_INVALID_PORT = "ER_INVALID_PORT";
- public static final String ER_FRAG_FOR_GENERIC_URI ="ER_FRAG_FOR_GENERIC_URI";
- public static final String ER_FRAG_WHEN_PATH_NULL = "ER_FRAG_WHEN_PATH_NULL";
- public static final String ER_FRAG_INVALID_CHAR = "ER_FRAG_INVALID_CHAR";
- public static final String ER_PARSER_IN_USE = "ER_PARSER_IN_USE";
- public static final String ER_CANNOT_CHANGE_WHILE_PARSING = "ER_CANNOT_CHANGE_WHILE_PARSING";
- public static final String ER_SELF_CAUSATION_NOT_PERMITTED = "ER_SELF_CAUSATION_NOT_PERMITTED";
- public static final String ER_NO_USERINFO_IF_NO_HOST = "ER_NO_USERINFO_IF_NO_HOST";
- public static final String ER_NO_PORT_IF_NO_HOST = "ER_NO_PORT_IF_NO_HOST";
- public static final String ER_NO_QUERY_STRING_IN_PATH = "ER_NO_QUERY_STRING_IN_PATH";
- public static final String ER_NO_FRAGMENT_STRING_IN_PATH = "ER_NO_FRAGMENT_STRING_IN_PATH";
- public static final String ER_CANNOT_INIT_URI_EMPTY_PARMS = "ER_CANNOT_INIT_URI_EMPTY_PARMS";
- public static final String ER_METHOD_NOT_SUPPORTED ="ER_METHOD_NOT_SUPPORTED";
- public static final String ER_INCRSAXSRCFILTER_NOT_RESTARTABLE = "ER_INCRSAXSRCFILTER_NOT_RESTARTABLE";
- public static final String ER_XMLRDR_NOT_BEFORE_STARTPARSE = "ER_XMLRDR_NOT_BEFORE_STARTPARSE";
- public static final String ER_AXIS_TRAVERSER_NOT_SUPPORTED = "ER_AXIS_TRAVERSER_NOT_SUPPORTED";
- public static final String ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER = "ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER";
- public static final String ER_SYSTEMID_UNKNOWN = "ER_SYSTEMID_UNKNOWN";
- public static final String ER_LOCATION_UNKNOWN = "ER_LOCATION_UNKNOWN";
- public static final String ER_PREFIX_MUST_RESOLVE = "ER_PREFIX_MUST_RESOLVE";
- public static final String ER_CREATEDOCUMENT_NOT_SUPPORTED = "ER_CREATEDOCUMENT_NOT_SUPPORTED";
- public static final String ER_CHILD_HAS_NO_OWNER_DOCUMENT = "ER_CHILD_HAS_NO_OWNER_DOCUMENT";
- public static final String ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT = "ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT";
- public static final String ER_CANT_OUTPUT_TEXT_BEFORE_DOC = "ER_CANT_OUTPUT_TEXT_BEFORE_DOC";
- public static final String ER_CANT_HAVE_MORE_THAN_ONE_ROOT = "ER_CANT_HAVE_MORE_THAN_ONE_ROOT";
- public static final String ER_ARG_LOCALNAME_NULL = "ER_ARG_LOCALNAME_NULL";
- public static final String ER_ARG_LOCALNAME_INVALID = "ER_ARG_LOCALNAME_INVALID";
- public static final String ER_ARG_PREFIX_INVALID = "ER_ARG_PREFIX_INVALID";
-
- // Message keys used by the serializer
- public static final String ER_RESOURCE_COULD_NOT_FIND = "ER_RESOURCE_COULD_NOT_FIND";
- public static final String ER_RESOURCE_COULD_NOT_LOAD = "ER_RESOURCE_COULD_NOT_LOAD";
- public static final String ER_BUFFER_SIZE_LESSTHAN_ZERO = "ER_BUFFER_SIZE_LESSTHAN_ZERO";
- public static final String ER_INVALID_UTF16_SURROGATE = "ER_INVALID_UTF16_SURROGATE";
- public static final String ER_OIERROR = "ER_OIERROR";
- public static final String ER_NAMESPACE_PREFIX = "ER_NAMESPACE_PREFIX";
- public static final String ER_STRAY_ATTRIBUTE = "ER_STRAY_ATTIRBUTE";
- public static final String ER_STRAY_NAMESPACE = "ER_STRAY_NAMESPACE";
- public static final String ER_COULD_NOT_LOAD_RESOURCE = "ER_COULD_NOT_LOAD_RESOURCE";
- public static final String ER_COULD_NOT_LOAD_METHOD_PROPERTY = "ER_COULD_NOT_LOAD_METHOD_PROPERTY";
- public static final String ER_SERIALIZER_NOT_CONTENTHANDLER = "ER_SERIALIZER_NOT_CONTENTHANDLER";
- public static final String ER_ILLEGAL_ATTRIBUTE_POSITION = "ER_ILLEGAL_ATTRIBUTE_POSITION";
-
- /*
- * Now fill in the message text.
- * Then fill in the message text for that message code in the
- * array. Use the new error code as the index into the array.
- */
-
- // Error messages...
- private static final Object[][] _contents = new Object[][] {
-
- /** Error message ID that has a null message, but takes in a single object. */
- {"ER0000" , "{0}" },
-
- { ER_FUNCTION_NOT_SUPPORTED,
- "Nepodporovan\u00e1 funkce!"},
-
- { ER_CANNOT_OVERWRITE_CAUSE,
- "P\u0159\u00ed\u010dinu nelze p\u0159epsat"},
-
- { ER_NO_DEFAULT_IMPL,
- "Nebyla nalezena v\u00fdchoz\u00ed implementace. "},
-
- { ER_CHUNKEDINTARRAY_NOT_SUPPORTED,
- "Funkce ChunkedIntArray({0}) nen\u00ed aktu\u00e1ln\u011b podporov\u00e1na."},
-
- { ER_OFFSET_BIGGER_THAN_SLOT,
- "Offset je v\u011bt\u0161\u00ed ne\u017e slot."},
-
- { ER_COROUTINE_NOT_AVAIL,
- "Spole\u010dn\u00e1 rutina nen\u00ed k dispozici, id={0}"},
-
- { ER_COROUTINE_CO_EXIT,
- "Funkce CoroutineManager obdr\u017eela po\u017eadavek co_exit()"},
-
- { ER_COJOINROUTINESET_FAILED,
- "Selhala funkce co_joinCoroutineSet()"},
-
- { ER_COROUTINE_PARAM,
- "Chyba parametru spole\u010dn\u00e9 rutiny ({0})"},
-
- { ER_PARSER_DOTERMINATE_ANSWERS,
- "\nNeo\u010dek\u00e1van\u00e9: odpov\u011bdi funkce analyz\u00e1toru doTerminate {0}"},
-
- { ER_NO_PARSE_CALL_WHILE_PARSING,
- "b\u011bhem anal\u00fdzy nelze volat analyz\u00e1tor"},
-
- { ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED,
- "Chyba: zadan\u00fd iter\u00e1tor osy {0} nen\u00ed implementov\u00e1n"},
-
- { ER_ITERATOR_AXIS_NOT_IMPLEMENTED,
- "Chyba: zadan\u00fd iter\u00e1tor osy {0} nen\u00ed implementov\u00e1n "},
-
- { ER_ITERATOR_CLONE_NOT_SUPPORTED,
- "Nepodporovan\u00fd klon iter\u00e1toru."},
-
- { ER_UNKNOWN_AXIS_TYPE,
- "Nezn\u00e1m\u00fd typ osy pr\u016fchodu: {0}"},
-
- { ER_AXIS_NOT_SUPPORTED,
- "Nepodporovan\u00e1 osa pr\u016fchodu: {0}"},
-
- { ER_NO_DTMIDS_AVAIL,
- "\u017d\u00e1dn\u00e1 dal\u0161\u00ed ID DTM nejsou k dispozici"},
-
- { ER_NOT_SUPPORTED,
- "Nepodporov\u00e1no: {0}"},
-
- { ER_NODE_NON_NULL,
- "Uzel pou\u017eit\u00fd ve funkci getDTMHandleFromNode mus\u00ed m\u00edt hodnotu not-null"},
-
- { ER_COULD_NOT_RESOLVE_NODE,
- "Uzel nelze p\u0159elo\u017eit do manipul\u00e1toru"},
-
- { ER_STARTPARSE_WHILE_PARSING,
- "B\u011bhem anal\u00fdzy nelze volat funkci startParse."},
-
- { ER_STARTPARSE_NEEDS_SAXPARSER,
- "Funkce startParse vy\u017eaduje SAXParser s hodnotou not-null."},
-
- { ER_COULD_NOT_INIT_PARSER,
- "nelze inicializovat analyz\u00e1tor s: "},
-
- { ER_EXCEPTION_CREATING_POOL,
- "v\u00fdjimka p\u0159i vytv\u00e1\u0159en\u00ed nov\u00e9 instance spole\u010dn\u00e9 oblasti"},
-
- { ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE,
- "Cesta obsahuje neplatnou escape sekvenci"},
-
- { ER_SCHEME_REQUIRED,
- "Je vy\u017eadov\u00e1no sch\u00e9ma!"},
-
- { ER_NO_SCHEME_IN_URI,
- "V URI nebylo nalezeno \u017e\u00e1dn\u00e9 sch\u00e9ma: {0}"},
-
- { ER_NO_SCHEME_INURI,
- "V URI nebylo nalezeno \u017e\u00e1dn\u00e9 sch\u00e9ma"},
-
- { ER_PATH_INVALID_CHAR,
- "Cesta obsahuje neplatn\u00fd znak: {0}"},
-
- { ER_SCHEME_FROM_NULL_STRING,
- "Nelze nastavit sch\u00e9ma \u0159et\u011bzce s hodnotou null."},
-
- { ER_SCHEME_NOT_CONFORMANT,
- "Sch\u00e9ma nevyhovuje."},
-
- { ER_HOST_ADDRESS_NOT_WELLFORMED,
- "Adresa hostitele m\u00e1 nespr\u00e1vn\u00fd form\u00e1t."},
-
- { ER_PORT_WHEN_HOST_NULL,
- "M\u00e1-li hostitel hodnotu null, nelze nastavit port."},
-
- { ER_INVALID_PORT,
- "Neplatn\u00e9 \u010d\u00edslo portu."},
-
- { ER_FRAG_FOR_GENERIC_URI,
- "Fragment lze nastavit jen u generick\u00e9ho URI."},
-
- { ER_FRAG_WHEN_PATH_NULL,
- "M\u00e1-li cesta hodnotu null, nelze nastavit fragment."},
-
- { ER_FRAG_INVALID_CHAR,
- "Fragment obsahuje neplatn\u00fd znak."},
-
- { ER_PARSER_IN_USE,
- "Analyz\u00e1tor se ji\u017e pou\u017e\u00edv\u00e1."},
-
- { ER_CANNOT_CHANGE_WHILE_PARSING,
- "B\u011bhem anal\u00fdzy nelze m\u011bnit {0} {1}."},
-
- { ER_SELF_CAUSATION_NOT_PERMITTED,
- "Zp\u016fsoben\u00ed sama sebe (self-causation) nen\u00ed povoleno"},
-
- { ER_NO_USERINFO_IF_NO_HOST,
- "Nen\u00ed-li ur\u010den hostitel, nelze zadat \u00fadaje o u\u017eivateli."},
-
- { ER_NO_PORT_IF_NO_HOST,
- "Nen\u00ed-li ur\u010den hostitel, nelze zadat port."},
-
- { ER_NO_QUERY_STRING_IN_PATH,
- "V \u0159et\u011bzci cesty a dotazu nelze zadat \u0159et\u011bzec dotazu."},
-
- { ER_NO_FRAGMENT_STRING_IN_PATH,
- "Fragment nelze ur\u010dit z\u00e1rove\u0148 v cest\u011b i ve fragmentu."},
-
- { ER_CANNOT_INIT_URI_EMPTY_PARMS,
- "URI nelze inicializovat s pr\u00e1zdn\u00fdmi parametry."},
-
- { ER_METHOD_NOT_SUPPORTED,
- "Prozat\u00edm nepodporovan\u00e1 metoda. "},
-
- { ER_INCRSAXSRCFILTER_NOT_RESTARTABLE,
- "Filtr IncrementalSAXSource_Filter nelze aktu\u00e1ln\u011b znovu spustit."},
-
- { ER_XMLRDR_NOT_BEFORE_STARTPARSE,
- "P\u0159ed po\u017eadavkem startParse nen\u00ed XMLReader."},
-
- { ER_AXIS_TRAVERSER_NOT_SUPPORTED,
- "Nepodporovan\u00e1 osa pr\u016fchodu: {0}"},
-
- { ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER,
- "Prvek ListingErrorHandler byl vytvo\u0159en s funkc\u00ed PrintWriter s hodnotou null!"},
-
- { ER_SYSTEMID_UNKNOWN,
- "Nezn\u00e1m\u00fd identifik\u00e1tor SystemId"},
-
- { ER_LOCATION_UNKNOWN,
- "Chyba se vyskytla na nezn\u00e1m\u00e9m m\u00edst\u011b"},
-
- { ER_PREFIX_MUST_RESOLVE,
- "P\u0159edponu mus\u00ed b\u00fdt mo\u017eno p\u0159elo\u017eit do oboru n\u00e1zv\u016f: {0}"},
-
- { ER_CREATEDOCUMENT_NOT_SUPPORTED,
- "Funkce XPathContext nepodporuje funkci createDocument()!"},
-
- { ER_CHILD_HAS_NO_OWNER_DOCUMENT,
- "Potomek atributu nem\u00e1 dokument vlastn\u00edka!"},
-
- { ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT,
- "Potomek atributu nem\u00e1 prvek dokumentu vlastn\u00edka!"},
-
- { ER_CANT_OUTPUT_TEXT_BEFORE_DOC,
- "Varov\u00e1n\u00ed: v\u00fdstup textu nem\u016f\u017ee p\u0159edch\u00e1zet prvku dokumentu! Ignorov\u00e1no..."},
-
- { ER_CANT_HAVE_MORE_THAN_ONE_ROOT,
- "DOM nem\u016f\u017ee m\u00edt n\u011bkolik ko\u0159en\u016f!"},
-
- { ER_ARG_LOCALNAME_NULL,
- "Argument 'localName' m\u00e1 hodnotu null"},
-
- // Note to translators: A QNAME has the syntactic form [NCName:]NCName
- // The localname is the portion after the optional colon; the message indicates
- // that there is a problem with that part of the QNAME.
- { ER_ARG_LOCALNAME_INVALID,
- "Hodnota Localname ve funkci QNAME by m\u011bla b\u00fdt platn\u00fdm prvkem NCName"},
-
- // Note to translators: A QNAME has the syntactic form [NCName:]NCName
- // The prefix is the portion before the optional colon; the message indicates
- // that there is a problem with that part of the QNAME.
- { ER_ARG_PREFIX_INVALID,
- "P\u0159edpona ve funkci QNAME by m\u011bla b\u00fdt platn\u00fdm prvkem NCName"},
-
- { "BAD_CODE", "Parametr funkce createMessage je mimo limit"},
- { "FORMAT_FAILED", "P\u0159i vol\u00e1n\u00ed funkce messageFormat do\u0161lo k v\u00fdjimce"},
- { "line", "\u0158\u00e1dek #"},
- { "column","Sloupec #"},
-
- {ER_SERIALIZER_NOT_CONTENTHANDLER,
- "T\u0159\u00edda serializace ''{0}'' neimplementuje org.xml.sax.ContentHandler."},
-
- {ER_RESOURCE_COULD_NOT_FIND,
- "Nelze naj\u00edt zdroj [ {0} ].\n {1}" },
-
- {ER_RESOURCE_COULD_NOT_LOAD,
- "Nelze zav\u00e9st zdroj [ {0} ]: {1} \n {2} \t {3}" },
-
- {ER_BUFFER_SIZE_LESSTHAN_ZERO,
- "Velikost vyrovn\u00e1vac\u00ed pam\u011bti <=0" },
-
- {ER_INVALID_UTF16_SURROGATE,
- "Byla zji\u0161t\u011bna neplatn\u00e1 n\u00e1hrada UTF-16: {0} ?" },
-
- {ER_OIERROR,
- "Chyba vstupu/v\u00fdstupu" },
-
- {ER_ILLEGAL_ATTRIBUTE_POSITION,
- "Nelze p\u0159idat atribut {0} po uzlech potomk\u016f ani p\u0159ed t\u00edm, ne\u017e je vytvo\u0159en prvek. Atribut bude ignorov\u00e1n."},
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- {ER_NAMESPACE_PREFIX,
- "Obor n\u00e1zv\u016f pro p\u0159edponu ''{0}'' nebyl deklarov\u00e1n." },
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- {ER_STRAY_ATTRIBUTE,
- "Atribut ''{0}'' je vn\u011b prvku." },
-
- /*
- * Note to translators: As with the preceding message, a namespace
- * declaration has the form of an attribute and is only permitted to
- * appear on an element. The substitution text {0} is the namespace
- * prefix and {1} is the URI that was being used in the erroneous
- * namespace declaration.
- */
- {ER_STRAY_NAMESPACE,
- "Deklarace oboru n\u00e1zv\u016f ''{0}''=''{1}'' je vn\u011b prvku." },
-
- {ER_COULD_NOT_LOAD_RESOURCE,
- "Nelze zav\u00e9st ''{0}'' (zkontrolujte prom\u011bnnou CLASSPATH), proto se pou\u017e\u00edvaj\u00ed pouze v\u00fdchoz\u00ed hodnoty"},
-
- {ER_COULD_NOT_LOAD_METHOD_PROPERTY,
- "Nelze na\u010d\u00edst soubor vlastnost\u00ed ''{0}'' pro v\u00fdstupn\u00ed metodu ''{1}'' (zkontrolujte prom\u011bnnou CLASSPATH)." }
-
-
- };
-
- /**
- * Get the lookup table for error messages
- *
- * @return The association list.
- */
- public Object[][] getContents()
- {
- return _contents;
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_de.java b/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_de.java
deleted file mode 100644
index 3492aef..0000000
--- a/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_de.java
+++ /dev/null
@@ -1,450 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xml.internal.res;
-
-
-import java.util.ListResourceBundle;
-
-/**
- * Set up error messages.
- * We build a two dimensional array of message keys and
- * message strings. In order to add a new message here,
- * you need to first add a String constant. And you need
- * to enter key, value pair as part of the contents
- * array. You also need to update MAX_CODE for error strings
- * and MAX_WARNING for warnings ( Needed for only information
- * purpose )
- */
-public class XMLErrorResources_de extends ListResourceBundle
-{
-
-/*
- * This file contains error and warning messages related to Xalan Error
- * Handling.
- *
- * General notes to translators:
- *
- * 1) Xalan (or more properly, Xalan-interpretive) and XSLTC are names of
- * components.
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- * XSLTC is an acronym for XSLT Compiler.
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 5) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 6) "Translet" is an invented term that describes the class file that
- * results from compiling an XML stylesheet into a Java class.
- *
- * 7) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- */
-
- /** Maximum error messages, this is needed to keep track of the number of messages. */
- public static final int MAX_CODE = 61;
-
- /** Maximum warnings, this is needed to keep track of the number of warnings. */
- public static final int MAX_WARNING = 0;
-
- /** Maximum misc strings. */
- public static final int MAX_OTHERS = 4;
-
- /** Maximum total warnings and error messages. */
- public static final int MAX_MESSAGES = MAX_CODE + MAX_WARNING + 1;
-
-
- /*
- * Message keys
- */
- public static final String ER_FUNCTION_NOT_SUPPORTED = "ER_FUNCTION_NOT_SUPPORTED";
- public static final String ER_CANNOT_OVERWRITE_CAUSE = "ER_CANNOT_OVERWRITE_CAUSE";
- public static final String ER_NO_DEFAULT_IMPL = "ER_NO_DEFAULT_IMPL";
- public static final String ER_CHUNKEDINTARRAY_NOT_SUPPORTED = "ER_CHUNKEDINTARRAY_NOT_SUPPORTED";
- public static final String ER_OFFSET_BIGGER_THAN_SLOT = "ER_OFFSET_BIGGER_THAN_SLOT";
- public static final String ER_COROUTINE_NOT_AVAIL = "ER_COROUTINE_NOT_AVAIL";
- public static final String ER_COROUTINE_CO_EXIT = "ER_COROUTINE_CO_EXIT";
- public static final String ER_COJOINROUTINESET_FAILED = "ER_COJOINROUTINESET_FAILED";
- public static final String ER_COROUTINE_PARAM = "ER_COROUTINE_PARAM";
- public static final String ER_PARSER_DOTERMINATE_ANSWERS = "ER_PARSER_DOTERMINATE_ANSWERS";
- public static final String ER_NO_PARSE_CALL_WHILE_PARSING = "ER_NO_PARSE_CALL_WHILE_PARSING";
- public static final String ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED = "ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED";
- public static final String ER_ITERATOR_AXIS_NOT_IMPLEMENTED = "ER_ITERATOR_AXIS_NOT_IMPLEMENTED";
- public static final String ER_ITERATOR_CLONE_NOT_SUPPORTED = "ER_ITERATOR_CLONE_NOT_SUPPORTED";
- public static final String ER_UNKNOWN_AXIS_TYPE = "ER_UNKNOWN_AXIS_TYPE";
- public static final String ER_AXIS_NOT_SUPPORTED = "ER_AXIS_NOT_SUPPORTED";
- public static final String ER_NO_DTMIDS_AVAIL = "ER_NO_DTMIDS_AVAIL";
- public static final String ER_NOT_SUPPORTED = "ER_NOT_SUPPORTED";
- public static final String ER_NODE_NON_NULL = "ER_NODE_NON_NULL";
- public static final String ER_COULD_NOT_RESOLVE_NODE = "ER_COULD_NOT_RESOLVE_NODE";
- public static final String ER_STARTPARSE_WHILE_PARSING = "ER_STARTPARSE_WHILE_PARSING";
- public static final String ER_STARTPARSE_NEEDS_SAXPARSER = "ER_STARTPARSE_NEEDS_SAXPARSER";
- public static final String ER_COULD_NOT_INIT_PARSER = "ER_COULD_NOT_INIT_PARSER";
- public static final String ER_EXCEPTION_CREATING_POOL = "ER_EXCEPTION_CREATING_POOL";
- public static final String ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE = "ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE";
- public static final String ER_SCHEME_REQUIRED = "ER_SCHEME_REQUIRED";
- public static final String ER_NO_SCHEME_IN_URI = "ER_NO_SCHEME_IN_URI";
- public static final String ER_NO_SCHEME_INURI = "ER_NO_SCHEME_INURI";
- public static final String ER_PATH_INVALID_CHAR = "ER_PATH_INVALID_CHAR";
- public static final String ER_SCHEME_FROM_NULL_STRING = "ER_SCHEME_FROM_NULL_STRING";
- public static final String ER_SCHEME_NOT_CONFORMANT = "ER_SCHEME_NOT_CONFORMANT";
- public static final String ER_HOST_ADDRESS_NOT_WELLFORMED = "ER_HOST_ADDRESS_NOT_WELLFORMED";
- public static final String ER_PORT_WHEN_HOST_NULL = "ER_PORT_WHEN_HOST_NULL";
- public static final String ER_INVALID_PORT = "ER_INVALID_PORT";
- public static final String ER_FRAG_FOR_GENERIC_URI ="ER_FRAG_FOR_GENERIC_URI";
- public static final String ER_FRAG_WHEN_PATH_NULL = "ER_FRAG_WHEN_PATH_NULL";
- public static final String ER_FRAG_INVALID_CHAR = "ER_FRAG_INVALID_CHAR";
- public static final String ER_PARSER_IN_USE = "ER_PARSER_IN_USE";
- public static final String ER_CANNOT_CHANGE_WHILE_PARSING = "ER_CANNOT_CHANGE_WHILE_PARSING";
- public static final String ER_SELF_CAUSATION_NOT_PERMITTED = "ER_SELF_CAUSATION_NOT_PERMITTED";
- public static final String ER_NO_USERINFO_IF_NO_HOST = "ER_NO_USERINFO_IF_NO_HOST";
- public static final String ER_NO_PORT_IF_NO_HOST = "ER_NO_PORT_IF_NO_HOST";
- public static final String ER_NO_QUERY_STRING_IN_PATH = "ER_NO_QUERY_STRING_IN_PATH";
- public static final String ER_NO_FRAGMENT_STRING_IN_PATH = "ER_NO_FRAGMENT_STRING_IN_PATH";
- public static final String ER_CANNOT_INIT_URI_EMPTY_PARMS = "ER_CANNOT_INIT_URI_EMPTY_PARMS";
- public static final String ER_METHOD_NOT_SUPPORTED ="ER_METHOD_NOT_SUPPORTED";
- public static final String ER_INCRSAXSRCFILTER_NOT_RESTARTABLE = "ER_INCRSAXSRCFILTER_NOT_RESTARTABLE";
- public static final String ER_XMLRDR_NOT_BEFORE_STARTPARSE = "ER_XMLRDR_NOT_BEFORE_STARTPARSE";
- public static final String ER_AXIS_TRAVERSER_NOT_SUPPORTED = "ER_AXIS_TRAVERSER_NOT_SUPPORTED";
- public static final String ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER = "ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER";
- public static final String ER_SYSTEMID_UNKNOWN = "ER_SYSTEMID_UNKNOWN";
- public static final String ER_LOCATION_UNKNOWN = "ER_LOCATION_UNKNOWN";
- public static final String ER_PREFIX_MUST_RESOLVE = "ER_PREFIX_MUST_RESOLVE";
- public static final String ER_CREATEDOCUMENT_NOT_SUPPORTED = "ER_CREATEDOCUMENT_NOT_SUPPORTED";
- public static final String ER_CHILD_HAS_NO_OWNER_DOCUMENT = "ER_CHILD_HAS_NO_OWNER_DOCUMENT";
- public static final String ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT = "ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT";
- public static final String ER_CANT_OUTPUT_TEXT_BEFORE_DOC = "ER_CANT_OUTPUT_TEXT_BEFORE_DOC";
- public static final String ER_CANT_HAVE_MORE_THAN_ONE_ROOT = "ER_CANT_HAVE_MORE_THAN_ONE_ROOT";
- public static final String ER_ARG_LOCALNAME_NULL = "ER_ARG_LOCALNAME_NULL";
- public static final String ER_ARG_LOCALNAME_INVALID = "ER_ARG_LOCALNAME_INVALID";
- public static final String ER_ARG_PREFIX_INVALID = "ER_ARG_PREFIX_INVALID";
- public static final String ER_NAME_CANT_START_WITH_COLON = "ER_NAME_CANT_START_WITH_COLON";
-
- // Message keys used by the serializer
- public static final String ER_RESOURCE_COULD_NOT_FIND = "ER_RESOURCE_COULD_NOT_FIND";
- public static final String ER_RESOURCE_COULD_NOT_LOAD = "ER_RESOURCE_COULD_NOT_LOAD";
- public static final String ER_BUFFER_SIZE_LESSTHAN_ZERO = "ER_BUFFER_SIZE_LESSTHAN_ZERO";
- public static final String ER_INVALID_UTF16_SURROGATE = "ER_INVALID_UTF16_SURROGATE";
- public static final String ER_OIERROR = "ER_OIERROR";
- public static final String ER_NAMESPACE_PREFIX = "ER_NAMESPACE_PREFIX";
- public static final String ER_STRAY_ATTRIBUTE = "ER_STRAY_ATTIRBUTE";
- public static final String ER_STRAY_NAMESPACE = "ER_STRAY_NAMESPACE";
- public static final String ER_COULD_NOT_LOAD_RESOURCE = "ER_COULD_NOT_LOAD_RESOURCE";
- public static final String ER_COULD_NOT_LOAD_METHOD_PROPERTY = "ER_COULD_NOT_LOAD_METHOD_PROPERTY";
- public static final String ER_SERIALIZER_NOT_CONTENTHANDLER = "ER_SERIALIZER_NOT_CONTENTHANDLER";
- public static final String ER_ILLEGAL_ATTRIBUTE_POSITION = "ER_ILLEGAL_ATTRIBUTE_POSITION";
- public static final String ER_ILLEGAL_CHARACTER = "ER_ILLEGAL_CHARACTER";
-
- /*
- * Now fill in the message text.
- * Then fill in the message text for that message code in the
- * array. Use the new error code as the index into the array.
- */
-
- // Error messages...
-
- /** The lookup table for error messages. */
- private static final Object[][] contents = {
-
- /** Error message ID that has a null message, but takes in a single object. */
- {"ER0000" , "{0}" },
-
- { ER_FUNCTION_NOT_SUPPORTED,
- "Funktion nicht unterst\u00FCtzt."},
-
- { ER_CANNOT_OVERWRITE_CAUSE,
- "Ursache kann nicht \u00FCberschrieben werden"},
-
- { ER_NO_DEFAULT_IMPL,
- "Keine Standardimplementierung gefunden "},
-
- { ER_CHUNKEDINTARRAY_NOT_SUPPORTED,
- "ChunkedIntArray({0}) derzeit nicht unterst\u00FCtzt"},
-
- { ER_OFFSET_BIGGER_THAN_SLOT,
- "Offset gr\u00F6\u00DFer als Slot"},
-
- { ER_COROUTINE_NOT_AVAIL,
- "Coroutine nicht verf\u00FCgbar; ID={0}"},
-
- { ER_COROUTINE_CO_EXIT,
- "CoroutineManager hat co_exit()-Anforderung erhalten"},
-
- { ER_COJOINROUTINESET_FAILED,
- "co_joinCoroutineSet() nicht erfolgreich"},
-
- { ER_COROUTINE_PARAM,
- "Coroutine-Parameterfehler ({0})"},
-
- { ER_PARSER_DOTERMINATE_ANSWERS,
- "\nUNEXPECTED: Parser doTerminate antwortet {0}"},
-
- { ER_NO_PARSE_CALL_WHILE_PARSING,
- "\"parse\" darf w\u00E4hrend des Parsing nicht aufgerufen werden"},
-
- { ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED,
- "Fehler: Typisierter Iterator f\u00FCr Achse {0} nicht implementiert"},
-
- { ER_ITERATOR_AXIS_NOT_IMPLEMENTED,
- "Fehler: Iterator f\u00FCr Achse {0} nicht implementiert "},
-
- { ER_ITERATOR_CLONE_NOT_SUPPORTED,
- "Iteratorclone nicht unterst\u00FCtzt"},
-
- { ER_UNKNOWN_AXIS_TYPE,
- "Unbekannter Achsendurchlauftyp: {0}"},
-
- { ER_AXIS_NOT_SUPPORTED,
- "Achsen-Traverser nicht unterst\u00FCtzt: {0}"},
-
- { ER_NO_DTMIDS_AVAIL,
- "Keine weiteren DTM-IDs verf\u00FCgbar"},
-
- { ER_NOT_SUPPORTED,
- "Nicht unterst\u00FCtzt: {0}"},
-
- { ER_NODE_NON_NULL,
- "Knoten darf nicht null sein f\u00FCr getDTMHandleFromNode"},
-
- { ER_COULD_NOT_RESOLVE_NODE,
- "Knoten konnte nicht in Handle aufgel\u00F6st werden"},
-
- { ER_STARTPARSE_WHILE_PARSING,
- "\"startParse\" darf w\u00E4hrend des Parsing nicht aufgerufen werden"},
-
- { ER_STARTPARSE_NEEDS_SAXPARSER,
- "startParse erfordert einen SAXParser ungleich null"},
-
- { ER_COULD_NOT_INIT_PARSER,
- "Parser konnte nicht initialisiert werden mit"},
-
- { ER_EXCEPTION_CREATING_POOL,
- "Ausnahme beim Erstellen einer neuen Instanz f\u00FCr Pool"},
-
- { ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE,
- "Pfad enth\u00E4lt eine ung\u00FCltige Escapesequenz"},
-
- { ER_SCHEME_REQUIRED,
- "Schema ist erforderlich."},
-
- { ER_NO_SCHEME_IN_URI,
- "Kein Schema gefunden in URI: {0}"},
-
- { ER_NO_SCHEME_INURI,
- "Kein Schema gefunden in URI"},
-
- { ER_PATH_INVALID_CHAR,
- "Pfad enth\u00E4lt ung\u00FCltiges Zeichen: {0}"},
-
- { ER_SCHEME_FROM_NULL_STRING,
- "Schema kann nicht von Nullzeichenfolge festgelegt werden"},
-
- { ER_SCHEME_NOT_CONFORMANT,
- "Schema ist nicht konform."},
-
- { ER_HOST_ADDRESS_NOT_WELLFORMED,
- "Host ist keine wohlgeformte Adresse"},
-
- { ER_PORT_WHEN_HOST_NULL,
- "Port kann nicht festgelegt werden, wenn der Host null ist"},
-
- { ER_INVALID_PORT,
- "Ung\u00FCltige Portnummer"},
-
- { ER_FRAG_FOR_GENERIC_URI,
- "Fragment kann nur f\u00FCr einen generischen URI festgelegt werden"},
-
- { ER_FRAG_WHEN_PATH_NULL,
- "Fragment kann nicht festgelegt werden, wenn der Pfad null ist"},
-
- { ER_FRAG_INVALID_CHAR,
- "Fragment enth\u00E4lt ein ung\u00FCltiges Zeichen"},
-
- { ER_PARSER_IN_USE,
- "Parser wird bereits verwendet"},
-
- { ER_CANNOT_CHANGE_WHILE_PARSING,
- "{0} {1} kann w\u00E4hrend Parsing nicht ge\u00E4ndert werden"},
-
- { ER_SELF_CAUSATION_NOT_PERMITTED,
- "Selbstkausalit\u00E4t nicht zul\u00E4ssig"},
-
- { ER_NO_USERINFO_IF_NO_HOST,
- "Benutzerinformationen k\u00F6nnen nicht angegeben werden, wenn der Host nicht angegeben wurde"},
-
- { ER_NO_PORT_IF_NO_HOST,
- "Port kann nicht angegeben werden, wenn der Host nicht angegeben wurde"},
-
- { ER_NO_QUERY_STRING_IN_PATH,
- "Abfragezeichenfolge kann nicht im Pfad und in der Abfragezeichenfolge angegeben werden"},
-
- { ER_NO_FRAGMENT_STRING_IN_PATH,
- "Fragment kann nicht im Pfad und im Fragment angegeben werden"},
-
- { ER_CANNOT_INIT_URI_EMPTY_PARMS,
- "URI kann nicht mit leeren Parametern initialisiert werden"},
-
- { ER_METHOD_NOT_SUPPORTED,
- "Methode noch nicht unterst\u00FCtzt "},
-
- { ER_INCRSAXSRCFILTER_NOT_RESTARTABLE,
- "IncrementalSAXSource_Filter kann derzeit nicht neu gestartet werden"},
-
- { ER_XMLRDR_NOT_BEFORE_STARTPARSE,
- "XMLReader nicht vor startParse-Anforderung"},
-
- { ER_AXIS_TRAVERSER_NOT_SUPPORTED,
- "Achsen-Traverser nicht unterst\u00FCtzt: {0}"},
-
- { ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER,
- "ListingErrorHandler mit Null-PrintWriter erstellt."},
-
- { ER_SYSTEMID_UNKNOWN,
- "SystemId unbekannt"},
-
- { ER_LOCATION_UNKNOWN,
- "Fehlerposition unbekannt"},
-
- { ER_PREFIX_MUST_RESOLVE,
- "Pr\u00E4fix muss in Namespace aufgel\u00F6st werden: {0}"},
-
- { ER_CREATEDOCUMENT_NOT_SUPPORTED,
- "createDocument() nicht in XPathContext unterst\u00FCtzt."},
-
- { ER_CHILD_HAS_NO_OWNER_DOCUMENT,
- "Untergeordnetes Attribut hat kein Eigent\u00FCmerdokument."},
-
- { ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT,
- "Untergeordnetes Attribut hat kein Eigent\u00FCmerdokumentelement."},
-
- { ER_CANT_OUTPUT_TEXT_BEFORE_DOC,
- "Warnung: Text kann nicht vor Dokumentelement ausgegeben werden. Wird ignoriert..."},
-
- { ER_CANT_HAVE_MORE_THAN_ONE_ROOT,
- "Mehrere Roots f\u00FCr ein DOM nicht zul\u00E4ssig."},
-
- { ER_ARG_LOCALNAME_NULL,
- "Argument \"localName\" ist null"},
-
- // Note to translators: A QNAME has the syntactic form [NCName:]NCName
- // The localname is the portion after the optional colon; the message indicates
- // that there is a problem with that part of the QNAME.
- { ER_ARG_LOCALNAME_INVALID,
- "Localname in QNAME muss ein g\u00FCltiger NCName sein"},
-
- // Note to translators: A QNAME has the syntactic form [NCName:]NCName
- // The prefix is the portion before the optional colon; the message indicates
- // that there is a problem with that part of the QNAME.
- { ER_ARG_PREFIX_INVALID,
- "Pr\u00E4fix in QNAME muss ein g\u00FCltiger NCName sein"},
-
- { ER_NAME_CANT_START_WITH_COLON,
- "Name darf nicht mit einem Doppelpunkt beginnen"},
-
- { "BAD_CODE", "Parameter f\u00FCr createMessage war au\u00DFerhalb des g\u00FCltigen Bereichs"},
- { "FORMAT_FAILED", "Ausnahme bei messageFormat-Aufruf ausgel\u00F6st"},
- { "line", "Zeilennummer"},
- { "column","Spaltennummer"},
-
- {ER_SERIALIZER_NOT_CONTENTHANDLER,
- "Serializer-Klasse \"{0}\" implementiert org.xml.sax.ContentHandler nicht."},
-
- {ER_RESOURCE_COULD_NOT_FIND,
- "Ressource [ {0} ] konnte nicht gefunden werden.\n {1}" },
-
- {ER_RESOURCE_COULD_NOT_LOAD,
- "Ressource [ {0} ] konnte nicht geladen werden: {1} \n {2} \t {3}" },
-
- {ER_BUFFER_SIZE_LESSTHAN_ZERO,
- "Puffergr\u00F6\u00DFe <=0" },
-
- {ER_INVALID_UTF16_SURROGATE,
- "Ung\u00FCltige UTF-16-Ersetzung festgestellt: {0}?" },
-
- {ER_OIERROR,
- "I/O-Fehler" },
-
- {ER_ILLEGAL_ATTRIBUTE_POSITION,
- "Attribut {0} kann nicht nach untergeordneten Knoten oder vor dem Erstellen eines Elements hinzugef\u00FCgt werden. Attribut wird ignoriert."},
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- {ER_NAMESPACE_PREFIX,
- "Namespace f\u00FCr Pr\u00E4fix \"{0}\" wurde nicht deklariert." },
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- {ER_STRAY_ATTRIBUTE,
- "Attribut \"{0}\" au\u00DFerhalb des Elements." },
-
- /*
- * Note to translators: As with the preceding message, a namespace
- * declaration has the form of an attribute and is only permitted to
- * appear on an element. The substitution text {0} is the namespace
- * prefix and {1} is the URI that was being used in the erroneous
- * namespace declaration.
- */
- {ER_STRAY_NAMESPACE,
- "Namespace-Deklaration {0}={1} au\u00DFerhalb des Elements." },
-
- {ER_COULD_NOT_LOAD_RESOURCE,
- "\"{0}\" konnte nicht geladen werden (CLASSPATH pr\u00FCfen). Die Standardwerte werden verwendet"},
-
- { ER_ILLEGAL_CHARACTER,
- "Versuch, Zeichen mit Integralwert {0} auszugeben, das nicht in der speziellen Ausgabecodierung von {1} dargestellt wird."},
-
- {ER_COULD_NOT_LOAD_METHOD_PROPERTY,
- "Property-Datei \"{0}\" konnte f\u00FCr Ausgabemethode \"{1}\" nicht geladen werden (CLASSPATH pr\u00FCfen)" }
-
-
- };
-
- /**
- * Get the association list.
- *
- * @return The association list.
- */
-
- protected Object[][] getContents() {
- return contents;
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_en.java b/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_en.java
deleted file mode 100644
index 78c9b13..0000000
--- a/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_en.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XMLErrorResources_en.java,v 1.2.4.1 2005/09/15 07:45:40 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.res;
-
-
-/**
- * Default implementation of XPATHErrorResources. This is just
- * an empty class.
- * @xsl.usage advanced
- */
-public class XMLErrorResources_en extends XMLErrorResources
-{
-}
diff --git a/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_es.java b/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_es.java
deleted file mode 100644
index 4714732..0000000
--- a/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_es.java
+++ /dev/null
@@ -1,450 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xml.internal.res;
-
-
-import java.util.ListResourceBundle;
-
-/**
- * Set up error messages.
- * We build a two dimensional array of message keys and
- * message strings. In order to add a new message here,
- * you need to first add a String constant. And you need
- * to enter key, value pair as part of the contents
- * array. You also need to update MAX_CODE for error strings
- * and MAX_WARNING for warnings ( Needed for only information
- * purpose )
- */
-public class XMLErrorResources_es extends ListResourceBundle
-{
-
-/*
- * This file contains error and warning messages related to Xalan Error
- * Handling.
- *
- * General notes to translators:
- *
- * 1) Xalan (or more properly, Xalan-interpretive) and XSLTC are names of
- * components.
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- * XSLTC is an acronym for XSLT Compiler.
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 5) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 6) "Translet" is an invented term that describes the class file that
- * results from compiling an XML stylesheet into a Java class.
- *
- * 7) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- */
-
- /** Maximum error messages, this is needed to keep track of the number of messages. */
- public static final int MAX_CODE = 61;
-
- /** Maximum warnings, this is needed to keep track of the number of warnings. */
- public static final int MAX_WARNING = 0;
-
- /** Maximum misc strings. */
- public static final int MAX_OTHERS = 4;
-
- /** Maximum total warnings and error messages. */
- public static final int MAX_MESSAGES = MAX_CODE + MAX_WARNING + 1;
-
-
- /*
- * Message keys
- */
- public static final String ER_FUNCTION_NOT_SUPPORTED = "ER_FUNCTION_NOT_SUPPORTED";
- public static final String ER_CANNOT_OVERWRITE_CAUSE = "ER_CANNOT_OVERWRITE_CAUSE";
- public static final String ER_NO_DEFAULT_IMPL = "ER_NO_DEFAULT_IMPL";
- public static final String ER_CHUNKEDINTARRAY_NOT_SUPPORTED = "ER_CHUNKEDINTARRAY_NOT_SUPPORTED";
- public static final String ER_OFFSET_BIGGER_THAN_SLOT = "ER_OFFSET_BIGGER_THAN_SLOT";
- public static final String ER_COROUTINE_NOT_AVAIL = "ER_COROUTINE_NOT_AVAIL";
- public static final String ER_COROUTINE_CO_EXIT = "ER_COROUTINE_CO_EXIT";
- public static final String ER_COJOINROUTINESET_FAILED = "ER_COJOINROUTINESET_FAILED";
- public static final String ER_COROUTINE_PARAM = "ER_COROUTINE_PARAM";
- public static final String ER_PARSER_DOTERMINATE_ANSWERS = "ER_PARSER_DOTERMINATE_ANSWERS";
- public static final String ER_NO_PARSE_CALL_WHILE_PARSING = "ER_NO_PARSE_CALL_WHILE_PARSING";
- public static final String ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED = "ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED";
- public static final String ER_ITERATOR_AXIS_NOT_IMPLEMENTED = "ER_ITERATOR_AXIS_NOT_IMPLEMENTED";
- public static final String ER_ITERATOR_CLONE_NOT_SUPPORTED = "ER_ITERATOR_CLONE_NOT_SUPPORTED";
- public static final String ER_UNKNOWN_AXIS_TYPE = "ER_UNKNOWN_AXIS_TYPE";
- public static final String ER_AXIS_NOT_SUPPORTED = "ER_AXIS_NOT_SUPPORTED";
- public static final String ER_NO_DTMIDS_AVAIL = "ER_NO_DTMIDS_AVAIL";
- public static final String ER_NOT_SUPPORTED = "ER_NOT_SUPPORTED";
- public static final String ER_NODE_NON_NULL = "ER_NODE_NON_NULL";
- public static final String ER_COULD_NOT_RESOLVE_NODE = "ER_COULD_NOT_RESOLVE_NODE";
- public static final String ER_STARTPARSE_WHILE_PARSING = "ER_STARTPARSE_WHILE_PARSING";
- public static final String ER_STARTPARSE_NEEDS_SAXPARSER = "ER_STARTPARSE_NEEDS_SAXPARSER";
- public static final String ER_COULD_NOT_INIT_PARSER = "ER_COULD_NOT_INIT_PARSER";
- public static final String ER_EXCEPTION_CREATING_POOL = "ER_EXCEPTION_CREATING_POOL";
- public static final String ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE = "ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE";
- public static final String ER_SCHEME_REQUIRED = "ER_SCHEME_REQUIRED";
- public static final String ER_NO_SCHEME_IN_URI = "ER_NO_SCHEME_IN_URI";
- public static final String ER_NO_SCHEME_INURI = "ER_NO_SCHEME_INURI";
- public static final String ER_PATH_INVALID_CHAR = "ER_PATH_INVALID_CHAR";
- public static final String ER_SCHEME_FROM_NULL_STRING = "ER_SCHEME_FROM_NULL_STRING";
- public static final String ER_SCHEME_NOT_CONFORMANT = "ER_SCHEME_NOT_CONFORMANT";
- public static final String ER_HOST_ADDRESS_NOT_WELLFORMED = "ER_HOST_ADDRESS_NOT_WELLFORMED";
- public static final String ER_PORT_WHEN_HOST_NULL = "ER_PORT_WHEN_HOST_NULL";
- public static final String ER_INVALID_PORT = "ER_INVALID_PORT";
- public static final String ER_FRAG_FOR_GENERIC_URI ="ER_FRAG_FOR_GENERIC_URI";
- public static final String ER_FRAG_WHEN_PATH_NULL = "ER_FRAG_WHEN_PATH_NULL";
- public static final String ER_FRAG_INVALID_CHAR = "ER_FRAG_INVALID_CHAR";
- public static final String ER_PARSER_IN_USE = "ER_PARSER_IN_USE";
- public static final String ER_CANNOT_CHANGE_WHILE_PARSING = "ER_CANNOT_CHANGE_WHILE_PARSING";
- public static final String ER_SELF_CAUSATION_NOT_PERMITTED = "ER_SELF_CAUSATION_NOT_PERMITTED";
- public static final String ER_NO_USERINFO_IF_NO_HOST = "ER_NO_USERINFO_IF_NO_HOST";
- public static final String ER_NO_PORT_IF_NO_HOST = "ER_NO_PORT_IF_NO_HOST";
- public static final String ER_NO_QUERY_STRING_IN_PATH = "ER_NO_QUERY_STRING_IN_PATH";
- public static final String ER_NO_FRAGMENT_STRING_IN_PATH = "ER_NO_FRAGMENT_STRING_IN_PATH";
- public static final String ER_CANNOT_INIT_URI_EMPTY_PARMS = "ER_CANNOT_INIT_URI_EMPTY_PARMS";
- public static final String ER_METHOD_NOT_SUPPORTED ="ER_METHOD_NOT_SUPPORTED";
- public static final String ER_INCRSAXSRCFILTER_NOT_RESTARTABLE = "ER_INCRSAXSRCFILTER_NOT_RESTARTABLE";
- public static final String ER_XMLRDR_NOT_BEFORE_STARTPARSE = "ER_XMLRDR_NOT_BEFORE_STARTPARSE";
- public static final String ER_AXIS_TRAVERSER_NOT_SUPPORTED = "ER_AXIS_TRAVERSER_NOT_SUPPORTED";
- public static final String ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER = "ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER";
- public static final String ER_SYSTEMID_UNKNOWN = "ER_SYSTEMID_UNKNOWN";
- public static final String ER_LOCATION_UNKNOWN = "ER_LOCATION_UNKNOWN";
- public static final String ER_PREFIX_MUST_RESOLVE = "ER_PREFIX_MUST_RESOLVE";
- public static final String ER_CREATEDOCUMENT_NOT_SUPPORTED = "ER_CREATEDOCUMENT_NOT_SUPPORTED";
- public static final String ER_CHILD_HAS_NO_OWNER_DOCUMENT = "ER_CHILD_HAS_NO_OWNER_DOCUMENT";
- public static final String ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT = "ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT";
- public static final String ER_CANT_OUTPUT_TEXT_BEFORE_DOC = "ER_CANT_OUTPUT_TEXT_BEFORE_DOC";
- public static final String ER_CANT_HAVE_MORE_THAN_ONE_ROOT = "ER_CANT_HAVE_MORE_THAN_ONE_ROOT";
- public static final String ER_ARG_LOCALNAME_NULL = "ER_ARG_LOCALNAME_NULL";
- public static final String ER_ARG_LOCALNAME_INVALID = "ER_ARG_LOCALNAME_INVALID";
- public static final String ER_ARG_PREFIX_INVALID = "ER_ARG_PREFIX_INVALID";
- public static final String ER_NAME_CANT_START_WITH_COLON = "ER_NAME_CANT_START_WITH_COLON";
-
- // Message keys used by the serializer
- public static final String ER_RESOURCE_COULD_NOT_FIND = "ER_RESOURCE_COULD_NOT_FIND";
- public static final String ER_RESOURCE_COULD_NOT_LOAD = "ER_RESOURCE_COULD_NOT_LOAD";
- public static final String ER_BUFFER_SIZE_LESSTHAN_ZERO = "ER_BUFFER_SIZE_LESSTHAN_ZERO";
- public static final String ER_INVALID_UTF16_SURROGATE = "ER_INVALID_UTF16_SURROGATE";
- public static final String ER_OIERROR = "ER_OIERROR";
- public static final String ER_NAMESPACE_PREFIX = "ER_NAMESPACE_PREFIX";
- public static final String ER_STRAY_ATTRIBUTE = "ER_STRAY_ATTIRBUTE";
- public static final String ER_STRAY_NAMESPACE = "ER_STRAY_NAMESPACE";
- public static final String ER_COULD_NOT_LOAD_RESOURCE = "ER_COULD_NOT_LOAD_RESOURCE";
- public static final String ER_COULD_NOT_LOAD_METHOD_PROPERTY = "ER_COULD_NOT_LOAD_METHOD_PROPERTY";
- public static final String ER_SERIALIZER_NOT_CONTENTHANDLER = "ER_SERIALIZER_NOT_CONTENTHANDLER";
- public static final String ER_ILLEGAL_ATTRIBUTE_POSITION = "ER_ILLEGAL_ATTRIBUTE_POSITION";
- public static final String ER_ILLEGAL_CHARACTER = "ER_ILLEGAL_CHARACTER";
-
- /*
- * Now fill in the message text.
- * Then fill in the message text for that message code in the
- * array. Use the new error code as the index into the array.
- */
-
- // Error messages...
-
- /** The lookup table for error messages. */
- private static final Object[][] contents = {
-
- /** Error message ID that has a null message, but takes in a single object. */
- {"ER0000" , "{0}" },
-
- { ER_FUNCTION_NOT_SUPPORTED,
- "Funci\u00F3n no soportada."},
-
- { ER_CANNOT_OVERWRITE_CAUSE,
- "No se puede sobrescribir la causa"},
-
- { ER_NO_DEFAULT_IMPL,
- "No se ha encontrado la implantaci\u00F3n por defecto "},
-
- { ER_CHUNKEDINTARRAY_NOT_SUPPORTED,
- "ChunkedIntArray({0}) no est\u00E1 soportado actualmente"},
-
- { ER_OFFSET_BIGGER_THAN_SLOT,
- "El desplazamiento es mayor que la ranura"},
-
- { ER_COROUTINE_NOT_AVAIL,
- "Corrutina no disponible, id={0}"},
-
- { ER_COROUTINE_CO_EXIT,
- "CoroutineManager ha recibido la solicitud co_exit()"},
-
- { ER_COJOINROUTINESET_FAILED,
- "Fallo de co_joinCoroutineSet()"},
-
- { ER_COROUTINE_PARAM,
- "Error de par\u00E1metro de corrutina ({0})"},
-
- { ER_PARSER_DOTERMINATE_ANSWERS,
- "\nINESPERADO: respuestas doTerminate del analizador {0}"},
-
- { ER_NO_PARSE_CALL_WHILE_PARSING,
- "no se puede realizar un an\u00E1lisis mientras se lleva a cabo otro"},
-
- { ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED,
- "Error: el iterador introducido para el eje {0} no se ha implantado"},
-
- { ER_ITERATOR_AXIS_NOT_IMPLEMENTED,
- "Error: el iterador para el eje {0} no se ha implantado "},
-
- { ER_ITERATOR_CLONE_NOT_SUPPORTED,
- "La clonaci\u00F3n del iterador no est\u00E1 soportada"},
-
- { ER_UNKNOWN_AXIS_TYPE,
- "Tipo transversal de eje desconocido: {0}"},
-
- { ER_AXIS_NOT_SUPPORTED,
- "Traverser de eje no soportado: {0}"},
-
- { ER_NO_DTMIDS_AVAIL,
- "No hay m\u00E1s identificadores de DTM disponibles"},
-
- { ER_NOT_SUPPORTED,
- "No soportado: {0}"},
-
- { ER_NODE_NON_NULL,
- "El nodo debe ser no nulo para getDTMHandleFromNode"},
-
- { ER_COULD_NOT_RESOLVE_NODE,
- "No se ha podido resolver el nodo en un identificador"},
-
- { ER_STARTPARSE_WHILE_PARSING,
- "startParse no puede llamarse durante el an\u00E1lisis"},
-
- { ER_STARTPARSE_NEEDS_SAXPARSER,
- "startParse necesita un SAXParser no nulo"},
-
- { ER_COULD_NOT_INIT_PARSER,
- "no se ha podido inicializar el analizador con"},
-
- { ER_EXCEPTION_CREATING_POOL,
- "excepci\u00F3n al crear la nueva instancia para el pool"},
-
- { ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE,
- "La ruta de acceso contiene una secuencia de escape no v\u00E1lida"},
-
- { ER_SCHEME_REQUIRED,
- "Se necesita un esquema."},
-
- { ER_NO_SCHEME_IN_URI,
- "No se ha encontrado un esquema en el URI: {0}"},
-
- { ER_NO_SCHEME_INURI,
- "No se ha encontrado un esquema en el URI"},
-
- { ER_PATH_INVALID_CHAR,
- "La ruta de acceso contiene un car\u00E1cter no v\u00E1lido: {0}"},
-
- { ER_SCHEME_FROM_NULL_STRING,
- "No se puede definir un esquema a partir de una cadena nula"},
-
- { ER_SCHEME_NOT_CONFORMANT,
- "El esquema no es v\u00E1lido."},
-
- { ER_HOST_ADDRESS_NOT_WELLFORMED,
- "El formato de la direcci\u00F3n de host no es correcto"},
-
- { ER_PORT_WHEN_HOST_NULL,
- "No se puede definir el puerto si el host es nulo"},
-
- { ER_INVALID_PORT,
- "N\u00FAmero de puerto no v\u00E1lido"},
-
- { ER_FRAG_FOR_GENERIC_URI,
- "S\u00F3lo se puede definir el fragmento para un URI gen\u00E9rico"},
-
- { ER_FRAG_WHEN_PATH_NULL,
- "No se puede definir el fragmento si la ruta de acceso es nula"},
-
- { ER_FRAG_INVALID_CHAR,
- "El fragmento contiene un car\u00E1cter no v\u00E1lido"},
-
- { ER_PARSER_IN_USE,
- "El analizador ya se est\u00E1 utilizando"},
-
- { ER_CANNOT_CHANGE_WHILE_PARSING,
- "No se puede cambiar {0} {1} durante el an\u00E1lisis"},
-
- { ER_SELF_CAUSATION_NOT_PERMITTED,
- "La autocausalidad no est\u00E1 permitida"},
-
- { ER_NO_USERINFO_IF_NO_HOST,
- "No se puede especificar la informaci\u00F3n de usuario si no se ha especificado el host"},
-
- { ER_NO_PORT_IF_NO_HOST,
- "No se puede especificar el puerto si no se ha especificado el host"},
-
- { ER_NO_QUERY_STRING_IN_PATH,
- "No se puede especificar la cadena de consulta en la ruta de acceso y en la cadena de consulta"},
-
- { ER_NO_FRAGMENT_STRING_IN_PATH,
- "No se puede especificar el fragmento en la ruta de acceso y en el fragmento"},
-
- { ER_CANNOT_INIT_URI_EMPTY_PARMS,
- "No se puede inicializar el URI con par\u00E1metros vac\u00EDos"},
-
- { ER_METHOD_NOT_SUPPORTED,
- "M\u00E9todo no soportado a\u00FAn "},
-
- { ER_INCRSAXSRCFILTER_NOT_RESTARTABLE,
- "IncrementalSAXSource_Filter no se puede reiniciar actualmente"},
-
- { ER_XMLRDR_NOT_BEFORE_STARTPARSE,
- "XMLReader no anterior a la solicitud startParse"},
-
- { ER_AXIS_TRAVERSER_NOT_SUPPORTED,
- "Traverser de eje no soportado: {0}"},
-
- { ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER,
- "ListingErrorHandler se ha creado con un valor de PrintWriter nulo"},
-
- { ER_SYSTEMID_UNKNOWN,
- "Identificador de Sistema Desconocido"},
-
- { ER_LOCATION_UNKNOWN,
- "Ubicaci\u00F3n del error desconocida"},
-
- { ER_PREFIX_MUST_RESOLVE,
- "El prefijo se debe resolver en un espacio de nombres: {0}"},
-
- { ER_CREATEDOCUMENT_NOT_SUPPORTED,
- "createDocument() no soportado en XPathContext"},
-
- { ER_CHILD_HAS_NO_OWNER_DOCUMENT,
- "El atributo child no tiene un documento de propietario."},
-
- { ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT,
- "El atributo child no tiene un elemento de documento de propietario."},
-
- { ER_CANT_OUTPUT_TEXT_BEFORE_DOC,
- "Advertencia: no se puede realizar la salida de texto antes del elemento del documento. Ignorando..."},
-
- { ER_CANT_HAVE_MORE_THAN_ONE_ROOT,
- "No se puede tener m\u00E1s de una ra\u00EDz en un DOM."},
-
- { ER_ARG_LOCALNAME_NULL,
- "El argumento 'localName' es nulo"},
-
- // Note to translators: A QNAME has the syntactic form [NCName:]NCName
- // The localname is the portion after the optional colon; the message indicates
- // that there is a problem with that part of the QNAME.
- { ER_ARG_LOCALNAME_INVALID,
- "El nombre local de QNAME debe ser un NCName v\u00E1lido"},
-
- // Note to translators: A QNAME has the syntactic form [NCName:]NCName
- // The prefix is the portion before the optional colon; the message indicates
- // that there is a problem with that part of the QNAME.
- { ER_ARG_PREFIX_INVALID,
- "El prefijo de QNAME debe ser un NCName v\u00E1lido"},
-
- { ER_NAME_CANT_START_WITH_COLON,
- "El nombre no puede empezar con dos puntos"},
-
- { "BAD_CODE", "El par\u00E1metro para crear un mensaje est\u00E1 fuera de los l\u00EDmites"},
- { "FORMAT_FAILED", "Se ha emitido una excepci\u00F3n durante la llamada a messageFormat"},
- { "line", "N\u00BA de L\u00EDnea"},
- { "column","N\u00BA de Columna"},
-
- {ER_SERIALIZER_NOT_CONTENTHANDLER,
- "La clase de serializador ''{0}'' no implanta org.xml.sax.ContentHandler."},
-
- {ER_RESOURCE_COULD_NOT_FIND,
- "No se ha encontrado el recurso [ {0} ].\n {1}" },
-
- {ER_RESOURCE_COULD_NOT_LOAD,
- "No se ha podido cargar el recurso [ {0} ]: {1} \n {2} \t {3}" },
-
- {ER_BUFFER_SIZE_LESSTHAN_ZERO,
- "Tama\u00F1o de buffer menor o igual que 0" },
-
- {ER_INVALID_UTF16_SURROGATE,
- "\u00BFSe ha detectado un sustituto UTF-16 no v\u00E1lido: {0}?" },
-
- {ER_OIERROR,
- "Error de ES" },
-
- {ER_ILLEGAL_ATTRIBUTE_POSITION,
- "No se puede agregar el atributo {0} despu\u00E9s de nodos secundarios o antes de que se produzca un elemento. Se ignorar\u00E1 el atributo."},
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- {ER_NAMESPACE_PREFIX,
- "No se ha declarado el espacio de nombres para el prefijo ''{0}''." },
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- {ER_STRAY_ATTRIBUTE,
- "El atributo ''{0}'' est\u00E1 fuera del elemento." },
-
- /*
- * Note to translators: As with the preceding message, a namespace
- * declaration has the form of an attribute and is only permitted to
- * appear on an element. The substitution text {0} is the namespace
- * prefix and {1} is the URI that was being used in the erroneous
- * namespace declaration.
- */
- {ER_STRAY_NAMESPACE,
- "Declaraci\u00F3n del espacio de nombres ''{0}''=''{1}'' fuera del elemento." },
-
- {ER_COULD_NOT_LOAD_RESOURCE,
- "No se ha podido cargar ''{0}'' (compruebe la CLASSPATH), ahora s\u00F3lo se est\u00E1n utilizando los valores por defecto"},
-
- { ER_ILLEGAL_CHARACTER,
- "Intento de realizar la salida del car\u00E1cter del valor integral {0}, que no est\u00E1 representado en la codificaci\u00F3n de salida de {1}."},
-
- {ER_COULD_NOT_LOAD_METHOD_PROPERTY,
- "No se ha podido cargar el archivo de propiedades ''{0}'' para el m\u00E9todo de salida ''{1}'' (compruebe la CLASSPATH)" }
-
-
- };
-
- /**
- * Get the association list.
- *
- * @return The association list.
- */
-
- protected Object[][] getContents() {
- return contents;
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_fr.java b/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_fr.java
deleted file mode 100644
index 8155bf4..0000000
--- a/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_fr.java
+++ /dev/null
@@ -1,450 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xml.internal.res;
-
-
-import java.util.ListResourceBundle;
-
-/**
- * Set up error messages.
- * We build a two dimensional array of message keys and
- * message strings. In order to add a new message here,
- * you need to first add a String constant. And you need
- * to enter key, value pair as part of the contents
- * array. You also need to update MAX_CODE for error strings
- * and MAX_WARNING for warnings ( Needed for only information
- * purpose )
- */
-public class XMLErrorResources_fr extends ListResourceBundle
-{
-
-/*
- * This file contains error and warning messages related to Xalan Error
- * Handling.
- *
- * General notes to translators:
- *
- * 1) Xalan (or more properly, Xalan-interpretive) and XSLTC are names of
- * components.
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- * XSLTC is an acronym for XSLT Compiler.
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 5) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 6) "Translet" is an invented term that describes the class file that
- * results from compiling an XML stylesheet into a Java class.
- *
- * 7) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- */
-
- /** Maximum error messages, this is needed to keep track of the number of messages. */
- public static final int MAX_CODE = 61;
-
- /** Maximum warnings, this is needed to keep track of the number of warnings. */
- public static final int MAX_WARNING = 0;
-
- /** Maximum misc strings. */
- public static final int MAX_OTHERS = 4;
-
- /** Maximum total warnings and error messages. */
- public static final int MAX_MESSAGES = MAX_CODE + MAX_WARNING + 1;
-
-
- /*
- * Message keys
- */
- public static final String ER_FUNCTION_NOT_SUPPORTED = "ER_FUNCTION_NOT_SUPPORTED";
- public static final String ER_CANNOT_OVERWRITE_CAUSE = "ER_CANNOT_OVERWRITE_CAUSE";
- public static final String ER_NO_DEFAULT_IMPL = "ER_NO_DEFAULT_IMPL";
- public static final String ER_CHUNKEDINTARRAY_NOT_SUPPORTED = "ER_CHUNKEDINTARRAY_NOT_SUPPORTED";
- public static final String ER_OFFSET_BIGGER_THAN_SLOT = "ER_OFFSET_BIGGER_THAN_SLOT";
- public static final String ER_COROUTINE_NOT_AVAIL = "ER_COROUTINE_NOT_AVAIL";
- public static final String ER_COROUTINE_CO_EXIT = "ER_COROUTINE_CO_EXIT";
- public static final String ER_COJOINROUTINESET_FAILED = "ER_COJOINROUTINESET_FAILED";
- public static final String ER_COROUTINE_PARAM = "ER_COROUTINE_PARAM";
- public static final String ER_PARSER_DOTERMINATE_ANSWERS = "ER_PARSER_DOTERMINATE_ANSWERS";
- public static final String ER_NO_PARSE_CALL_WHILE_PARSING = "ER_NO_PARSE_CALL_WHILE_PARSING";
- public static final String ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED = "ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED";
- public static final String ER_ITERATOR_AXIS_NOT_IMPLEMENTED = "ER_ITERATOR_AXIS_NOT_IMPLEMENTED";
- public static final String ER_ITERATOR_CLONE_NOT_SUPPORTED = "ER_ITERATOR_CLONE_NOT_SUPPORTED";
- public static final String ER_UNKNOWN_AXIS_TYPE = "ER_UNKNOWN_AXIS_TYPE";
- public static final String ER_AXIS_NOT_SUPPORTED = "ER_AXIS_NOT_SUPPORTED";
- public static final String ER_NO_DTMIDS_AVAIL = "ER_NO_DTMIDS_AVAIL";
- public static final String ER_NOT_SUPPORTED = "ER_NOT_SUPPORTED";
- public static final String ER_NODE_NON_NULL = "ER_NODE_NON_NULL";
- public static final String ER_COULD_NOT_RESOLVE_NODE = "ER_COULD_NOT_RESOLVE_NODE";
- public static final String ER_STARTPARSE_WHILE_PARSING = "ER_STARTPARSE_WHILE_PARSING";
- public static final String ER_STARTPARSE_NEEDS_SAXPARSER = "ER_STARTPARSE_NEEDS_SAXPARSER";
- public static final String ER_COULD_NOT_INIT_PARSER = "ER_COULD_NOT_INIT_PARSER";
- public static final String ER_EXCEPTION_CREATING_POOL = "ER_EXCEPTION_CREATING_POOL";
- public static final String ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE = "ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE";
- public static final String ER_SCHEME_REQUIRED = "ER_SCHEME_REQUIRED";
- public static final String ER_NO_SCHEME_IN_URI = "ER_NO_SCHEME_IN_URI";
- public static final String ER_NO_SCHEME_INURI = "ER_NO_SCHEME_INURI";
- public static final String ER_PATH_INVALID_CHAR = "ER_PATH_INVALID_CHAR";
- public static final String ER_SCHEME_FROM_NULL_STRING = "ER_SCHEME_FROM_NULL_STRING";
- public static final String ER_SCHEME_NOT_CONFORMANT = "ER_SCHEME_NOT_CONFORMANT";
- public static final String ER_HOST_ADDRESS_NOT_WELLFORMED = "ER_HOST_ADDRESS_NOT_WELLFORMED";
- public static final String ER_PORT_WHEN_HOST_NULL = "ER_PORT_WHEN_HOST_NULL";
- public static final String ER_INVALID_PORT = "ER_INVALID_PORT";
- public static final String ER_FRAG_FOR_GENERIC_URI ="ER_FRAG_FOR_GENERIC_URI";
- public static final String ER_FRAG_WHEN_PATH_NULL = "ER_FRAG_WHEN_PATH_NULL";
- public static final String ER_FRAG_INVALID_CHAR = "ER_FRAG_INVALID_CHAR";
- public static final String ER_PARSER_IN_USE = "ER_PARSER_IN_USE";
- public static final String ER_CANNOT_CHANGE_WHILE_PARSING = "ER_CANNOT_CHANGE_WHILE_PARSING";
- public static final String ER_SELF_CAUSATION_NOT_PERMITTED = "ER_SELF_CAUSATION_NOT_PERMITTED";
- public static final String ER_NO_USERINFO_IF_NO_HOST = "ER_NO_USERINFO_IF_NO_HOST";
- public static final String ER_NO_PORT_IF_NO_HOST = "ER_NO_PORT_IF_NO_HOST";
- public static final String ER_NO_QUERY_STRING_IN_PATH = "ER_NO_QUERY_STRING_IN_PATH";
- public static final String ER_NO_FRAGMENT_STRING_IN_PATH = "ER_NO_FRAGMENT_STRING_IN_PATH";
- public static final String ER_CANNOT_INIT_URI_EMPTY_PARMS = "ER_CANNOT_INIT_URI_EMPTY_PARMS";
- public static final String ER_METHOD_NOT_SUPPORTED ="ER_METHOD_NOT_SUPPORTED";
- public static final String ER_INCRSAXSRCFILTER_NOT_RESTARTABLE = "ER_INCRSAXSRCFILTER_NOT_RESTARTABLE";
- public static final String ER_XMLRDR_NOT_BEFORE_STARTPARSE = "ER_XMLRDR_NOT_BEFORE_STARTPARSE";
- public static final String ER_AXIS_TRAVERSER_NOT_SUPPORTED = "ER_AXIS_TRAVERSER_NOT_SUPPORTED";
- public static final String ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER = "ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER";
- public static final String ER_SYSTEMID_UNKNOWN = "ER_SYSTEMID_UNKNOWN";
- public static final String ER_LOCATION_UNKNOWN = "ER_LOCATION_UNKNOWN";
- public static final String ER_PREFIX_MUST_RESOLVE = "ER_PREFIX_MUST_RESOLVE";
- public static final String ER_CREATEDOCUMENT_NOT_SUPPORTED = "ER_CREATEDOCUMENT_NOT_SUPPORTED";
- public static final String ER_CHILD_HAS_NO_OWNER_DOCUMENT = "ER_CHILD_HAS_NO_OWNER_DOCUMENT";
- public static final String ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT = "ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT";
- public static final String ER_CANT_OUTPUT_TEXT_BEFORE_DOC = "ER_CANT_OUTPUT_TEXT_BEFORE_DOC";
- public static final String ER_CANT_HAVE_MORE_THAN_ONE_ROOT = "ER_CANT_HAVE_MORE_THAN_ONE_ROOT";
- public static final String ER_ARG_LOCALNAME_NULL = "ER_ARG_LOCALNAME_NULL";
- public static final String ER_ARG_LOCALNAME_INVALID = "ER_ARG_LOCALNAME_INVALID";
- public static final String ER_ARG_PREFIX_INVALID = "ER_ARG_PREFIX_INVALID";
- public static final String ER_NAME_CANT_START_WITH_COLON = "ER_NAME_CANT_START_WITH_COLON";
-
- // Message keys used by the serializer
- public static final String ER_RESOURCE_COULD_NOT_FIND = "ER_RESOURCE_COULD_NOT_FIND";
- public static final String ER_RESOURCE_COULD_NOT_LOAD = "ER_RESOURCE_COULD_NOT_LOAD";
- public static final String ER_BUFFER_SIZE_LESSTHAN_ZERO = "ER_BUFFER_SIZE_LESSTHAN_ZERO";
- public static final String ER_INVALID_UTF16_SURROGATE = "ER_INVALID_UTF16_SURROGATE";
- public static final String ER_OIERROR = "ER_OIERROR";
- public static final String ER_NAMESPACE_PREFIX = "ER_NAMESPACE_PREFIX";
- public static final String ER_STRAY_ATTRIBUTE = "ER_STRAY_ATTIRBUTE";
- public static final String ER_STRAY_NAMESPACE = "ER_STRAY_NAMESPACE";
- public static final String ER_COULD_NOT_LOAD_RESOURCE = "ER_COULD_NOT_LOAD_RESOURCE";
- public static final String ER_COULD_NOT_LOAD_METHOD_PROPERTY = "ER_COULD_NOT_LOAD_METHOD_PROPERTY";
- public static final String ER_SERIALIZER_NOT_CONTENTHANDLER = "ER_SERIALIZER_NOT_CONTENTHANDLER";
- public static final String ER_ILLEGAL_ATTRIBUTE_POSITION = "ER_ILLEGAL_ATTRIBUTE_POSITION";
- public static final String ER_ILLEGAL_CHARACTER = "ER_ILLEGAL_CHARACTER";
-
- /*
- * Now fill in the message text.
- * Then fill in the message text for that message code in the
- * array. Use the new error code as the index into the array.
- */
-
- // Error messages...
-
- /** The lookup table for error messages. */
- private static final Object[][] contents = {
-
- /** Error message ID that has a null message, but takes in a single object. */
- {"ER0000" , "{0}" },
-
- { ER_FUNCTION_NOT_SUPPORTED,
- "Fonction non prise en charge."},
-
- { ER_CANNOT_OVERWRITE_CAUSE,
- "Impossible de remplacer la cause"},
-
- { ER_NO_DEFAULT_IMPL,
- "Aucune impl\u00E9mentation par d\u00E9faut trouv\u00E9e "},
-
- { ER_CHUNKEDINTARRAY_NOT_SUPPORTED,
- "ChunkedIntArray({0}) n''est actuellement pas pris en charge"},
-
- { ER_OFFSET_BIGGER_THAN_SLOT,
- "D\u00E9calage sup\u00E9rieur \u00E0 l'emplacement"},
-
- { ER_COROUTINE_NOT_AVAIL,
- "Coroutine non disponible, id={0}"},
-
- { ER_COROUTINE_CO_EXIT,
- "CoroutineManager a re\u00E7u la demande co_exit()"},
-
- { ER_COJOINROUTINESET_FAILED,
- "Echec de co_joinCoroutineSet()"},
-
- { ER_COROUTINE_PARAM,
- "Erreur de param\u00E8tre de coroutine ({0})"},
-
- { ER_PARSER_DOTERMINATE_ANSWERS,
- "\nINATTENDU : r\u00E9ponses doTerminate de l''analyseur - {0}"},
-
- { ER_NO_PARSE_CALL_WHILE_PARSING,
- "impossible d'appeler l'analyse lorsqu'elle est en cours"},
-
- { ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED,
- "Erreur : it\u00E9rateur saisi pour l''axe {0} non impl\u00E9ment\u00E9"},
-
- { ER_ITERATOR_AXIS_NOT_IMPLEMENTED,
- "Erreur : it\u00E9rateur pour l''axe {0} non impl\u00E9ment\u00E9 "},
-
- { ER_ITERATOR_CLONE_NOT_SUPPORTED,
- "Clone d'it\u00E9rateur non pris en charge"},
-
- { ER_UNKNOWN_AXIS_TYPE,
- "Type de parcours d''axe inconnu : {0}"},
-
- { ER_AXIS_NOT_SUPPORTED,
- "Parcours d''axe non pris en charge : {0}"},
-
- { ER_NO_DTMIDS_AVAIL,
- "Aucun autre ID DTM n'est disponible"},
-
- { ER_NOT_SUPPORTED,
- "Non pris en charge : {0}"},
-
- { ER_NODE_NON_NULL,
- "Le noeud doit \u00EAtre non NULL pour getDTMHandleFromNode"},
-
- { ER_COULD_NOT_RESOLVE_NODE,
- "Impossible de r\u00E9soudre le noeud sur un descripteur"},
-
- { ER_STARTPARSE_WHILE_PARSING,
- "impossible d'appeler startParse lorsque l'analyse est en cours"},
-
- { ER_STARTPARSE_NEEDS_SAXPARSER,
- "startParse n\u00E9cessite un SAXParser non NULL"},
-
- { ER_COULD_NOT_INIT_PARSER,
- "impossible d'initialiser l'analyseur avec"},
-
- { ER_EXCEPTION_CREATING_POOL,
- "exception lors de la cr\u00E9ation de l'instance du pool"},
-
- { ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE,
- "Le chemin d'acc\u00E8s contient une s\u00E9quence d'\u00E9chappement non valide"},
-
- { ER_SCHEME_REQUIRED,
- "Mod\u00E8le obligatoire."},
-
- { ER_NO_SCHEME_IN_URI,
- "Mod\u00E8le introuvable dans l''URI: {0}"},
-
- { ER_NO_SCHEME_INURI,
- "Mod\u00E8le introuvable dans l'URI"},
-
- { ER_PATH_INVALID_CHAR,
- "Le chemin contient un caract\u00E8re non valide : {0}"},
-
- { ER_SCHEME_FROM_NULL_STRING,
- "Impossible de d\u00E9finir le mod\u00E8le \u00E0 partir de la cha\u00EEne NULL"},
-
- { ER_SCHEME_NOT_CONFORMANT,
- "Le mod\u00E8le n'est pas conforme."},
-
- { ER_HOST_ADDRESS_NOT_WELLFORMED,
- "Le format de l'adresse de l'h\u00F4te n'est pas correct"},
-
- { ER_PORT_WHEN_HOST_NULL,
- "Impossible de d\u00E9finir le port quand l'h\u00F4te est NULL"},
-
- { ER_INVALID_PORT,
- "Num\u00E9ro de port non valide"},
-
- { ER_FRAG_FOR_GENERIC_URI,
- "Le fragment ne peut \u00EAtre d\u00E9fini que pour un URI g\u00E9n\u00E9rique"},
-
- { ER_FRAG_WHEN_PATH_NULL,
- "Impossible de d\u00E9finir le fragment quand le chemin d'acc\u00E8s est NULL"},
-
- { ER_FRAG_INVALID_CHAR,
- "Le fragment contient un caract\u00E8re non valide"},
-
- { ER_PARSER_IN_USE,
- "L'analyseur est d\u00E9j\u00E0 utilis\u00E9"},
-
- { ER_CANNOT_CHANGE_WHILE_PARSING,
- "Impossible de modifier {0} {1} pendant l''analyse"},
-
- { ER_SELF_CAUSATION_NOT_PERMITTED,
- "Causalit\u00E9 circulaire non autoris\u00E9e"},
-
- { ER_NO_USERINFO_IF_NO_HOST,
- "Userinfo peut ne pas \u00EAtre sp\u00E9cifi\u00E9 si l'h\u00F4te ne l'est pas"},
-
- { ER_NO_PORT_IF_NO_HOST,
- "Le port peut ne pas \u00EAtre sp\u00E9cifi\u00E9 si l'h\u00F4te ne l'est pas"},
-
- { ER_NO_QUERY_STRING_IN_PATH,
- "La cha\u00EEne de requ\u00EAte ne doit pas figurer dans un chemin et une cha\u00EEne de requ\u00EAte"},
-
- { ER_NO_FRAGMENT_STRING_IN_PATH,
- "Le fragment ne doit pas \u00EAtre indiqu\u00E9 \u00E0 la fois dans le chemin et dans le fragment"},
-
- { ER_CANNOT_INIT_URI_EMPTY_PARMS,
- "Impossible d'initialiser l'URI avec des param\u00E8tres vides"},
-
- { ER_METHOD_NOT_SUPPORTED,
- "La m\u00E9thode n'est pas encore prise en charge "},
-
- { ER_INCRSAXSRCFILTER_NOT_RESTARTABLE,
- "IncrementalSAXSource_Filter ne peut actuellement pas \u00EAtre red\u00E9marr\u00E9"},
-
- { ER_XMLRDR_NOT_BEFORE_STARTPARSE,
- "XMLReader pas avant la demande startParse"},
-
- { ER_AXIS_TRAVERSER_NOT_SUPPORTED,
- "Parcours d''axe non pris en charge : {0}"},
-
- { ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER,
- "ListingErrorHandler cr\u00E9\u00E9 avec PrintWriter NULL."},
-
- { ER_SYSTEMID_UNKNOWN,
- "ID syst\u00E8me inconnu"},
-
- { ER_LOCATION_UNKNOWN,
- "Emplacement de l'erreur inconnu"},
-
- { ER_PREFIX_MUST_RESOLVE,
- "Le pr\u00E9fixe doit \u00EAtre r\u00E9solu en espace de noms : {0}"},
-
- { ER_CREATEDOCUMENT_NOT_SUPPORTED,
- "createDocument() non pris en charge dans XPathContext."},
-
- { ER_CHILD_HAS_NO_OWNER_DOCUMENT,
- "L'enfant de l'attribut ne poss\u00E8de pas de document propri\u00E9taire."},
-
- { ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT,
- "L'enfant de l'attribut ne poss\u00E8de pas d'\u00E9l\u00E9ment de document propri\u00E9taire."},
-
- { ER_CANT_OUTPUT_TEXT_BEFORE_DOC,
- "Avertissement : impossible de g\u00E9n\u00E9rer une sortie du texte avant l'\u00E9l\u00E9ment de document. Non pris en compte..."},
-
- { ER_CANT_HAVE_MORE_THAN_ONE_ROOT,
- "Impossible d'avoir plus d'une racine sur un DOM."},
-
- { ER_ARG_LOCALNAME_NULL,
- "L'argument \"localName\" est NULL"},
-
- // Note to translators: A QNAME has the syntactic form [NCName:]NCName
- // The localname is the portion after the optional colon; the message indicates
- // that there is a problem with that part of the QNAME.
- { ER_ARG_LOCALNAME_INVALID,
- "Le nom local du QName doit \u00EAtre un NCName valide"},
-
- // Note to translators: A QNAME has the syntactic form [NCName:]NCName
- // The prefix is the portion before the optional colon; the message indicates
- // that there is a problem with that part of the QNAME.
- { ER_ARG_PREFIX_INVALID,
- "Le pr\u00E9fixe du QName doit \u00EAtre un NCName valide"},
-
- { ER_NAME_CANT_START_WITH_COLON,
- "Le nom ne peut pas commencer par deux-points"},
-
- { "BAD_CODE", "Le param\u00E8tre createMessage \u00E9tait hors limites"},
- { "FORMAT_FAILED", "Exception g\u00E9n\u00E9r\u00E9e pendant l'appel messageFormat"},
- { "line", "Ligne n\u00B0"},
- { "column","Colonne n\u00B0"},
-
- {ER_SERIALIZER_NOT_CONTENTHANDLER,
- "La classe de serializer ''{0}'' n''impl\u00E9mente pas org.xml.sax.ContentHandler."},
-
- {ER_RESOURCE_COULD_NOT_FIND,
- "La ressource [ {0} ] est introuvable.\n {1}" },
-
- {ER_RESOURCE_COULD_NOT_LOAD,
- "La ressource [ {0} ] n''a pas pu charger : {1} \n {2} \t {3}" },
-
- {ER_BUFFER_SIZE_LESSTHAN_ZERO,
- "Taille du tampon <=0" },
-
- {ER_INVALID_UTF16_SURROGATE,
- "Substitut UTF-16 non valide d\u00E9tect\u00E9 : {0} ?" },
-
- {ER_OIERROR,
- "Erreur d'E-S" },
-
- {ER_ILLEGAL_ATTRIBUTE_POSITION,
- "Impossible d''ajouter l''attribut {0} apr\u00E8s des noeuds enfant ou avant la production d''un \u00E9l\u00E9ment. L''attribut est ignor\u00E9."},
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- {ER_NAMESPACE_PREFIX,
- "L''espace de noms du pr\u00E9fixe ''{0}'' n''a pas \u00E9t\u00E9 d\u00E9clar\u00E9." },
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- {ER_STRAY_ATTRIBUTE,
- "Attribut ''{0}'' \u00E0 l''ext\u00E9rieur de l''\u00E9l\u00E9ment." },
-
- /*
- * Note to translators: As with the preceding message, a namespace
- * declaration has the form of an attribute and is only permitted to
- * appear on an element. The substitution text {0} is the namespace
- * prefix and {1} is the URI that was being used in the erroneous
- * namespace declaration.
- */
- {ER_STRAY_NAMESPACE,
- "La d\u00E9claration d''espace de noms ''{0}''=''{1}'' est \u00E0 l''ext\u00E9rieur de l''\u00E9l\u00E9ment." },
-
- {ER_COULD_NOT_LOAD_RESOURCE,
- "Impossible de charger ''{0}'' (v\u00E9rifier CLASSPATH), les valeurs par d\u00E9faut sont donc employ\u00E9es"},
-
- { ER_ILLEGAL_CHARACTER,
- "Tentative de sortie d''un caract\u00E8re avec une valeur enti\u00E8re {0}, non repr\u00E9sent\u00E9 dans l''encodage de sortie sp\u00E9cifi\u00E9 pour {1}."},
-
- {ER_COULD_NOT_LOAD_METHOD_PROPERTY,
- "Impossible de charger le fichier de propri\u00E9t\u00E9s ''{0}'' pour la m\u00E9thode de sortie ''{1}'' (v\u00E9rifier CLASSPATH)" }
-
-
- };
-
- /**
- * Get the association list.
- *
- * @return The association list.
- */
-
- protected Object[][] getContents() {
- return contents;
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_it.java b/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_it.java
deleted file mode 100644
index a86b206..0000000
--- a/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_it.java
+++ /dev/null
@@ -1,450 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xml.internal.res;
-
-
-import java.util.ListResourceBundle;
-
-/**
- * Set up error messages.
- * We build a two dimensional array of message keys and
- * message strings. In order to add a new message here,
- * you need to first add a String constant. And you need
- * to enter key, value pair as part of the contents
- * array. You also need to update MAX_CODE for error strings
- * and MAX_WARNING for warnings ( Needed for only information
- * purpose )
- */
-public class XMLErrorResources_it extends ListResourceBundle
-{
-
-/*
- * This file contains error and warning messages related to Xalan Error
- * Handling.
- *
- * General notes to translators:
- *
- * 1) Xalan (or more properly, Xalan-interpretive) and XSLTC are names of
- * components.
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- * XSLTC is an acronym for XSLT Compiler.
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 5) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 6) "Translet" is an invented term that describes the class file that
- * results from compiling an XML stylesheet into a Java class.
- *
- * 7) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- */
-
- /** Maximum error messages, this is needed to keep track of the number of messages. */
- public static final int MAX_CODE = 61;
-
- /** Maximum warnings, this is needed to keep track of the number of warnings. */
- public static final int MAX_WARNING = 0;
-
- /** Maximum misc strings. */
- public static final int MAX_OTHERS = 4;
-
- /** Maximum total warnings and error messages. */
- public static final int MAX_MESSAGES = MAX_CODE + MAX_WARNING + 1;
-
-
- /*
- * Message keys
- */
- public static final String ER_FUNCTION_NOT_SUPPORTED = "ER_FUNCTION_NOT_SUPPORTED";
- public static final String ER_CANNOT_OVERWRITE_CAUSE = "ER_CANNOT_OVERWRITE_CAUSE";
- public static final String ER_NO_DEFAULT_IMPL = "ER_NO_DEFAULT_IMPL";
- public static final String ER_CHUNKEDINTARRAY_NOT_SUPPORTED = "ER_CHUNKEDINTARRAY_NOT_SUPPORTED";
- public static final String ER_OFFSET_BIGGER_THAN_SLOT = "ER_OFFSET_BIGGER_THAN_SLOT";
- public static final String ER_COROUTINE_NOT_AVAIL = "ER_COROUTINE_NOT_AVAIL";
- public static final String ER_COROUTINE_CO_EXIT = "ER_COROUTINE_CO_EXIT";
- public static final String ER_COJOINROUTINESET_FAILED = "ER_COJOINROUTINESET_FAILED";
- public static final String ER_COROUTINE_PARAM = "ER_COROUTINE_PARAM";
- public static final String ER_PARSER_DOTERMINATE_ANSWERS = "ER_PARSER_DOTERMINATE_ANSWERS";
- public static final String ER_NO_PARSE_CALL_WHILE_PARSING = "ER_NO_PARSE_CALL_WHILE_PARSING";
- public static final String ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED = "ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED";
- public static final String ER_ITERATOR_AXIS_NOT_IMPLEMENTED = "ER_ITERATOR_AXIS_NOT_IMPLEMENTED";
- public static final String ER_ITERATOR_CLONE_NOT_SUPPORTED = "ER_ITERATOR_CLONE_NOT_SUPPORTED";
- public static final String ER_UNKNOWN_AXIS_TYPE = "ER_UNKNOWN_AXIS_TYPE";
- public static final String ER_AXIS_NOT_SUPPORTED = "ER_AXIS_NOT_SUPPORTED";
- public static final String ER_NO_DTMIDS_AVAIL = "ER_NO_DTMIDS_AVAIL";
- public static final String ER_NOT_SUPPORTED = "ER_NOT_SUPPORTED";
- public static final String ER_NODE_NON_NULL = "ER_NODE_NON_NULL";
- public static final String ER_COULD_NOT_RESOLVE_NODE = "ER_COULD_NOT_RESOLVE_NODE";
- public static final String ER_STARTPARSE_WHILE_PARSING = "ER_STARTPARSE_WHILE_PARSING";
- public static final String ER_STARTPARSE_NEEDS_SAXPARSER = "ER_STARTPARSE_NEEDS_SAXPARSER";
- public static final String ER_COULD_NOT_INIT_PARSER = "ER_COULD_NOT_INIT_PARSER";
- public static final String ER_EXCEPTION_CREATING_POOL = "ER_EXCEPTION_CREATING_POOL";
- public static final String ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE = "ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE";
- public static final String ER_SCHEME_REQUIRED = "ER_SCHEME_REQUIRED";
- public static final String ER_NO_SCHEME_IN_URI = "ER_NO_SCHEME_IN_URI";
- public static final String ER_NO_SCHEME_INURI = "ER_NO_SCHEME_INURI";
- public static final String ER_PATH_INVALID_CHAR = "ER_PATH_INVALID_CHAR";
- public static final String ER_SCHEME_FROM_NULL_STRING = "ER_SCHEME_FROM_NULL_STRING";
- public static final String ER_SCHEME_NOT_CONFORMANT = "ER_SCHEME_NOT_CONFORMANT";
- public static final String ER_HOST_ADDRESS_NOT_WELLFORMED = "ER_HOST_ADDRESS_NOT_WELLFORMED";
- public static final String ER_PORT_WHEN_HOST_NULL = "ER_PORT_WHEN_HOST_NULL";
- public static final String ER_INVALID_PORT = "ER_INVALID_PORT";
- public static final String ER_FRAG_FOR_GENERIC_URI ="ER_FRAG_FOR_GENERIC_URI";
- public static final String ER_FRAG_WHEN_PATH_NULL = "ER_FRAG_WHEN_PATH_NULL";
- public static final String ER_FRAG_INVALID_CHAR = "ER_FRAG_INVALID_CHAR";
- public static final String ER_PARSER_IN_USE = "ER_PARSER_IN_USE";
- public static final String ER_CANNOT_CHANGE_WHILE_PARSING = "ER_CANNOT_CHANGE_WHILE_PARSING";
- public static final String ER_SELF_CAUSATION_NOT_PERMITTED = "ER_SELF_CAUSATION_NOT_PERMITTED";
- public static final String ER_NO_USERINFO_IF_NO_HOST = "ER_NO_USERINFO_IF_NO_HOST";
- public static final String ER_NO_PORT_IF_NO_HOST = "ER_NO_PORT_IF_NO_HOST";
- public static final String ER_NO_QUERY_STRING_IN_PATH = "ER_NO_QUERY_STRING_IN_PATH";
- public static final String ER_NO_FRAGMENT_STRING_IN_PATH = "ER_NO_FRAGMENT_STRING_IN_PATH";
- public static final String ER_CANNOT_INIT_URI_EMPTY_PARMS = "ER_CANNOT_INIT_URI_EMPTY_PARMS";
- public static final String ER_METHOD_NOT_SUPPORTED ="ER_METHOD_NOT_SUPPORTED";
- public static final String ER_INCRSAXSRCFILTER_NOT_RESTARTABLE = "ER_INCRSAXSRCFILTER_NOT_RESTARTABLE";
- public static final String ER_XMLRDR_NOT_BEFORE_STARTPARSE = "ER_XMLRDR_NOT_BEFORE_STARTPARSE";
- public static final String ER_AXIS_TRAVERSER_NOT_SUPPORTED = "ER_AXIS_TRAVERSER_NOT_SUPPORTED";
- public static final String ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER = "ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER";
- public static final String ER_SYSTEMID_UNKNOWN = "ER_SYSTEMID_UNKNOWN";
- public static final String ER_LOCATION_UNKNOWN = "ER_LOCATION_UNKNOWN";
- public static final String ER_PREFIX_MUST_RESOLVE = "ER_PREFIX_MUST_RESOLVE";
- public static final String ER_CREATEDOCUMENT_NOT_SUPPORTED = "ER_CREATEDOCUMENT_NOT_SUPPORTED";
- public static final String ER_CHILD_HAS_NO_OWNER_DOCUMENT = "ER_CHILD_HAS_NO_OWNER_DOCUMENT";
- public static final String ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT = "ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT";
- public static final String ER_CANT_OUTPUT_TEXT_BEFORE_DOC = "ER_CANT_OUTPUT_TEXT_BEFORE_DOC";
- public static final String ER_CANT_HAVE_MORE_THAN_ONE_ROOT = "ER_CANT_HAVE_MORE_THAN_ONE_ROOT";
- public static final String ER_ARG_LOCALNAME_NULL = "ER_ARG_LOCALNAME_NULL";
- public static final String ER_ARG_LOCALNAME_INVALID = "ER_ARG_LOCALNAME_INVALID";
- public static final String ER_ARG_PREFIX_INVALID = "ER_ARG_PREFIX_INVALID";
- public static final String ER_NAME_CANT_START_WITH_COLON = "ER_NAME_CANT_START_WITH_COLON";
-
- // Message keys used by the serializer
- public static final String ER_RESOURCE_COULD_NOT_FIND = "ER_RESOURCE_COULD_NOT_FIND";
- public static final String ER_RESOURCE_COULD_NOT_LOAD = "ER_RESOURCE_COULD_NOT_LOAD";
- public static final String ER_BUFFER_SIZE_LESSTHAN_ZERO = "ER_BUFFER_SIZE_LESSTHAN_ZERO";
- public static final String ER_INVALID_UTF16_SURROGATE = "ER_INVALID_UTF16_SURROGATE";
- public static final String ER_OIERROR = "ER_OIERROR";
- public static final String ER_NAMESPACE_PREFIX = "ER_NAMESPACE_PREFIX";
- public static final String ER_STRAY_ATTRIBUTE = "ER_STRAY_ATTIRBUTE";
- public static final String ER_STRAY_NAMESPACE = "ER_STRAY_NAMESPACE";
- public static final String ER_COULD_NOT_LOAD_RESOURCE = "ER_COULD_NOT_LOAD_RESOURCE";
- public static final String ER_COULD_NOT_LOAD_METHOD_PROPERTY = "ER_COULD_NOT_LOAD_METHOD_PROPERTY";
- public static final String ER_SERIALIZER_NOT_CONTENTHANDLER = "ER_SERIALIZER_NOT_CONTENTHANDLER";
- public static final String ER_ILLEGAL_ATTRIBUTE_POSITION = "ER_ILLEGAL_ATTRIBUTE_POSITION";
- public static final String ER_ILLEGAL_CHARACTER = "ER_ILLEGAL_CHARACTER";
-
- /*
- * Now fill in the message text.
- * Then fill in the message text for that message code in the
- * array. Use the new error code as the index into the array.
- */
-
- // Error messages...
-
- /** The lookup table for error messages. */
- private static final Object[][] contents = {
-
- /** Error message ID that has a null message, but takes in a single object. */
- {"ER0000" , "{0}" },
-
- { ER_FUNCTION_NOT_SUPPORTED,
- "Funzione non supportata."},
-
- { ER_CANNOT_OVERWRITE_CAUSE,
- "Impossibile sovrascrivere la causa"},
-
- { ER_NO_DEFAULT_IMPL,
- "Nessuna implementazione predefinita trovata "},
-
- { ER_CHUNKEDINTARRAY_NOT_SUPPORTED,
- "ChunkedIntArray({0}) non supportato al momento"},
-
- { ER_OFFSET_BIGGER_THAN_SLOT,
- "Offset pi\u00F9 grande dello slot"},
-
- { ER_COROUTINE_NOT_AVAIL,
- "Co-routine non disponibile, ID={0}"},
-
- { ER_COROUTINE_CO_EXIT,
- "CoroutineManager ha ricevuto una richiesta co_exit()"},
-
- { ER_COJOINROUTINESET_FAILED,
- "co_joinCoroutineSet() non riuscito"},
-
- { ER_COROUTINE_PARAM,
- "Errore del parametro di co-routine ({0})"},
-
- { ER_PARSER_DOTERMINATE_ANSWERS,
- "\nIMPREVISTO: risposte doTerminate del parser {0}"},
-
- { ER_NO_PARSE_CALL_WHILE_PARSING,
- "impossibile richiamare parse mentre \u00E8 in corso un'analisi"},
-
- { ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED,
- "Errore: l''iteratore con tipo per l''asse {0} non \u00E8 implementato"},
-
- { ER_ITERATOR_AXIS_NOT_IMPLEMENTED,
- "Errore: l''iteratore per l''asse {0} non \u00E8 implementato "},
-
- { ER_ITERATOR_CLONE_NOT_SUPPORTED,
- "Duplicazione dell'iteratore non supportata"},
-
- { ER_UNKNOWN_AXIS_TYPE,
- "Tipo di asse trasversale sconosciuto: {0}"},
-
- { ER_AXIS_NOT_SUPPORTED,
- "Asse trasversale non supportato: {0}"},
-
- { ER_NO_DTMIDS_AVAIL,
- "Non sono disponibili altri ID DTM"},
-
- { ER_NOT_SUPPORTED,
- "Non supportato: {0}"},
-
- { ER_NODE_NON_NULL,
- "Il nodo deve essere non nullo per getDTMHandleFromNode"},
-
- { ER_COULD_NOT_RESOLVE_NODE,
- "Impossibile risolvere il nodo in un handle"},
-
- { ER_STARTPARSE_WHILE_PARSING,
- "impossibile richiamare startParse mentre \u00E8 in corso un'analisi"},
-
- { ER_STARTPARSE_NEEDS_SAXPARSER,
- "startParse richiede un valore non nullo per SAXParser"},
-
- { ER_COULD_NOT_INIT_PARSER,
- "impossibile inizializzare il parser con"},
-
- { ER_EXCEPTION_CREATING_POOL,
- "eccezione durante la creazione di una nuova istanza per il pool"},
-
- { ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE,
- "Il percorso contiene sequenza di escape non valida"},
-
- { ER_SCHEME_REQUIRED,
- "Lo schema \u00E8 obbligatorio."},
-
- { ER_NO_SCHEME_IN_URI,
- "Nessuno schema trovato nell''URI: {0}"},
-
- { ER_NO_SCHEME_INURI,
- "Nessuno schema trovato nell'URI"},
-
- { ER_PATH_INVALID_CHAR,
- "Il percorso contiene un carattere non valido: {0}"},
-
- { ER_SCHEME_FROM_NULL_STRING,
- "Impossibile impostare lo schema da una stringa nulla"},
-
- { ER_SCHEME_NOT_CONFORMANT,
- "Lo schema non \u00E8 conforme."},
-
- { ER_HOST_ADDRESS_NOT_WELLFORMED,
- "Host non \u00E8 un indirizzo corretto"},
-
- { ER_PORT_WHEN_HOST_NULL,
- "La porta non pu\u00F2 essere impostata se l'host \u00E8 nullo"},
-
- { ER_INVALID_PORT,
- "Numero di porta non valido"},
-
- { ER_FRAG_FOR_GENERIC_URI,
- "Il frammento pu\u00F2 essere impostato solo per un URI generico"},
-
- { ER_FRAG_WHEN_PATH_NULL,
- "Il frammento non pu\u00F2 essere impostato se il percorso \u00E8 nullo"},
-
- { ER_FRAG_INVALID_CHAR,
- "Il frammento contiene un carattere non valido"},
-
- { ER_PARSER_IN_USE,
- "Parser gi\u00E0 in uso"},
-
- { ER_CANNOT_CHANGE_WHILE_PARSING,
- "Impossibile modificare {0} {1} durante l''analisi"},
-
- { ER_SELF_CAUSATION_NOT_PERMITTED,
- "Creazione automatica della causa non consentita"},
-
- { ER_NO_USERINFO_IF_NO_HOST,
- "Userinfo non pu\u00F2 essere specificato se l'host non \u00E8 specificato"},
-
- { ER_NO_PORT_IF_NO_HOST,
- "La porta non pu\u00F2 essere specificata se l'host non \u00E8 specificato"},
-
- { ER_NO_QUERY_STRING_IN_PATH,
- "La stringa di query non pu\u00F2 essere specificata nella stringa di percorso e query."},
-
- { ER_NO_FRAGMENT_STRING_IN_PATH,
- "Il frammento non pu\u00F2 essere specificato sia nel percorso che nel frammento"},
-
- { ER_CANNOT_INIT_URI_EMPTY_PARMS,
- "Impossibile inizializzare l'URI con i parametri vuoti"},
-
- { ER_METHOD_NOT_SUPPORTED,
- "Metodo attualmente non supportato "},
-
- { ER_INCRSAXSRCFILTER_NOT_RESTARTABLE,
- "IncrementalSAXSource_Filter attualmente non riavviabile"},
-
- { ER_XMLRDR_NOT_BEFORE_STARTPARSE,
- "XMLReader non si trova prima della richiesta startParse"},
-
- { ER_AXIS_TRAVERSER_NOT_SUPPORTED,
- "Asse trasversale non supportato: {0}"},
-
- { ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER,
- "ListingErrorHandler creato con PrintWriter nullo."},
-
- { ER_SYSTEMID_UNKNOWN,
- "SystemId sconosciuto"},
-
- { ER_LOCATION_UNKNOWN,
- "Posizione sconosciuta dell'errore"},
-
- { ER_PREFIX_MUST_RESOLVE,
- "Il prefisso deve essere risolto in uno spazio di nomi: {0}"},
-
- { ER_CREATEDOCUMENT_NOT_SUPPORTED,
- "createDocument() non supportato in XPathContext"},
-
- { ER_CHILD_HAS_NO_OWNER_DOCUMENT,
- "L'elemento figlio dell'attributo non dispone di un documento proprietario."},
-
- { ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT,
- "L'elemento figlio dell'attributo non dispone di un elemento di documento proprietario."},
-
- { ER_CANT_OUTPUT_TEXT_BEFORE_DOC,
- "Avvertenza: impossibile creare l'output del testo prima dell'elemento del documento. Operazione ignorata..."},
-
- { ER_CANT_HAVE_MORE_THAN_ONE_ROOT,
- "Non possono esistere pi\u00F9 radici in un DOM."},
-
- { ER_ARG_LOCALNAME_NULL,
- "L'argomento 'localName' \u00E8 nullo"},
-
- // Note to translators: A QNAME has the syntactic form [NCName:]NCName
- // The localname is the portion after the optional colon; the message indicates
- // that there is a problem with that part of the QNAME.
- { ER_ARG_LOCALNAME_INVALID,
- "Localname in QNAME deve essere un NCName valido"},
-
- // Note to translators: A QNAME has the syntactic form [NCName:]NCName
- // The prefix is the portion before the optional colon; the message indicates
- // that there is a problem with that part of the QNAME.
- { ER_ARG_PREFIX_INVALID,
- "Il prefisso in QNAME deve essere un NCName valido"},
-
- { ER_NAME_CANT_START_WITH_COLON,
- "Il nome non pu\u00F2 iniziare con i due punti"},
-
- { "BAD_CODE", "Parametro per createMessage fuori limite"},
- { "FORMAT_FAILED", "Eccezione durante la chiamata messageFormat"},
- { "line", "N. riga"},
- { "column","N. colonna"},
-
- {ER_SERIALIZER_NOT_CONTENTHANDLER,
- "La classe serializzatore ''{0}'' non implementa org.xml.sax.ContentHandler."},
-
- {ER_RESOURCE_COULD_NOT_FIND,
- "Risorsa [ {0} ] non trovata.\n {1}" },
-
- {ER_RESOURCE_COULD_NOT_LOAD,
- "Impossibile caricare la risorsa [ {0} ]: {1} \n {2} \t {3}" },
-
- {ER_BUFFER_SIZE_LESSTHAN_ZERO,
- "Dimensione buffer <=0" },
-
- {ER_INVALID_UTF16_SURROGATE,
- "Rilevato surrogato UTF-16 non valido: {0}?" },
-
- {ER_OIERROR,
- "Errore IO" },
-
- {ER_ILLEGAL_ATTRIBUTE_POSITION,
- "Impossibile aggiungere l''attributo {0} dopo i nodi figlio o prima che sia prodotto un elemento. L''attributo verr\u00E0 ignorato."},
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- {ER_NAMESPACE_PREFIX,
- "Lo spazio di nomi per il prefisso ''{0}'' non \u00E8 stato dichiarato." },
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- {ER_STRAY_ATTRIBUTE,
- "Attributo ''{0}'' al di fuori dell''elemento." },
-
- /*
- * Note to translators: As with the preceding message, a namespace
- * declaration has the form of an attribute and is only permitted to
- * appear on an element. The substitution text {0} is the namespace
- * prefix and {1} is the URI that was being used in the erroneous
- * namespace declaration.
- */
- {ER_STRAY_NAMESPACE,
- "Dichiarazione dello spazio di nomi ''{0}''=''{1}'' al di fuori dell''elemento." },
-
- {ER_COULD_NOT_LOAD_RESOURCE,
- "Impossibile caricare ''{0}'' (verificare CLASSPATH); verranno utilizzati i valori predefiniti"},
-
- { ER_ILLEGAL_CHARACTER,
- "Tentativo di eseguire l''output di un carattere di valore integrale {0} non rappresentato nella codifica di output {1} specificata."},
-
- {ER_COULD_NOT_LOAD_METHOD_PROPERTY,
- "Impossibile caricare il file delle propriet\u00E0 ''{0}'' per il metodo di emissione ''{1}'' (verificare CLASSPATH)" }
-
-
- };
-
- /**
- * Get the association list.
- *
- * @return The association list.
- */
-
- protected Object[][] getContents() {
- return contents;
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_ja.java b/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_ja.java
deleted file mode 100644
index dfa387b..0000000
--- a/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_ja.java
+++ /dev/null
@@ -1,450 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xml.internal.res;
-
-
-import java.util.ListResourceBundle;
-
-/**
- * Set up error messages.
- * We build a two dimensional array of message keys and
- * message strings. In order to add a new message here,
- * you need to first add a String constant. And you need
- * to enter key, value pair as part of the contents
- * array. You also need to update MAX_CODE for error strings
- * and MAX_WARNING for warnings ( Needed for only information
- * purpose )
- */
-public class XMLErrorResources_ja extends ListResourceBundle
-{
-
-/*
- * This file contains error and warning messages related to Xalan Error
- * Handling.
- *
- * General notes to translators:
- *
- * 1) Xalan (or more properly, Xalan-interpretive) and XSLTC are names of
- * components.
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- * XSLTC is an acronym for XSLT Compiler.
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 5) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 6) "Translet" is an invented term that describes the class file that
- * results from compiling an XML stylesheet into a Java class.
- *
- * 7) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- */
-
- /** Maximum error messages, this is needed to keep track of the number of messages. */
- public static final int MAX_CODE = 61;
-
- /** Maximum warnings, this is needed to keep track of the number of warnings. */
- public static final int MAX_WARNING = 0;
-
- /** Maximum misc strings. */
- public static final int MAX_OTHERS = 4;
-
- /** Maximum total warnings and error messages. */
- public static final int MAX_MESSAGES = MAX_CODE + MAX_WARNING + 1;
-
-
- /*
- * Message keys
- */
- public static final String ER_FUNCTION_NOT_SUPPORTED = "ER_FUNCTION_NOT_SUPPORTED";
- public static final String ER_CANNOT_OVERWRITE_CAUSE = "ER_CANNOT_OVERWRITE_CAUSE";
- public static final String ER_NO_DEFAULT_IMPL = "ER_NO_DEFAULT_IMPL";
- public static final String ER_CHUNKEDINTARRAY_NOT_SUPPORTED = "ER_CHUNKEDINTARRAY_NOT_SUPPORTED";
- public static final String ER_OFFSET_BIGGER_THAN_SLOT = "ER_OFFSET_BIGGER_THAN_SLOT";
- public static final String ER_COROUTINE_NOT_AVAIL = "ER_COROUTINE_NOT_AVAIL";
- public static final String ER_COROUTINE_CO_EXIT = "ER_COROUTINE_CO_EXIT";
- public static final String ER_COJOINROUTINESET_FAILED = "ER_COJOINROUTINESET_FAILED";
- public static final String ER_COROUTINE_PARAM = "ER_COROUTINE_PARAM";
- public static final String ER_PARSER_DOTERMINATE_ANSWERS = "ER_PARSER_DOTERMINATE_ANSWERS";
- public static final String ER_NO_PARSE_CALL_WHILE_PARSING = "ER_NO_PARSE_CALL_WHILE_PARSING";
- public static final String ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED = "ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED";
- public static final String ER_ITERATOR_AXIS_NOT_IMPLEMENTED = "ER_ITERATOR_AXIS_NOT_IMPLEMENTED";
- public static final String ER_ITERATOR_CLONE_NOT_SUPPORTED = "ER_ITERATOR_CLONE_NOT_SUPPORTED";
- public static final String ER_UNKNOWN_AXIS_TYPE = "ER_UNKNOWN_AXIS_TYPE";
- public static final String ER_AXIS_NOT_SUPPORTED = "ER_AXIS_NOT_SUPPORTED";
- public static final String ER_NO_DTMIDS_AVAIL = "ER_NO_DTMIDS_AVAIL";
- public static final String ER_NOT_SUPPORTED = "ER_NOT_SUPPORTED";
- public static final String ER_NODE_NON_NULL = "ER_NODE_NON_NULL";
- public static final String ER_COULD_NOT_RESOLVE_NODE = "ER_COULD_NOT_RESOLVE_NODE";
- public static final String ER_STARTPARSE_WHILE_PARSING = "ER_STARTPARSE_WHILE_PARSING";
- public static final String ER_STARTPARSE_NEEDS_SAXPARSER = "ER_STARTPARSE_NEEDS_SAXPARSER";
- public static final String ER_COULD_NOT_INIT_PARSER = "ER_COULD_NOT_INIT_PARSER";
- public static final String ER_EXCEPTION_CREATING_POOL = "ER_EXCEPTION_CREATING_POOL";
- public static final String ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE = "ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE";
- public static final String ER_SCHEME_REQUIRED = "ER_SCHEME_REQUIRED";
- public static final String ER_NO_SCHEME_IN_URI = "ER_NO_SCHEME_IN_URI";
- public static final String ER_NO_SCHEME_INURI = "ER_NO_SCHEME_INURI";
- public static final String ER_PATH_INVALID_CHAR = "ER_PATH_INVALID_CHAR";
- public static final String ER_SCHEME_FROM_NULL_STRING = "ER_SCHEME_FROM_NULL_STRING";
- public static final String ER_SCHEME_NOT_CONFORMANT = "ER_SCHEME_NOT_CONFORMANT";
- public static final String ER_HOST_ADDRESS_NOT_WELLFORMED = "ER_HOST_ADDRESS_NOT_WELLFORMED";
- public static final String ER_PORT_WHEN_HOST_NULL = "ER_PORT_WHEN_HOST_NULL";
- public static final String ER_INVALID_PORT = "ER_INVALID_PORT";
- public static final String ER_FRAG_FOR_GENERIC_URI ="ER_FRAG_FOR_GENERIC_URI";
- public static final String ER_FRAG_WHEN_PATH_NULL = "ER_FRAG_WHEN_PATH_NULL";
- public static final String ER_FRAG_INVALID_CHAR = "ER_FRAG_INVALID_CHAR";
- public static final String ER_PARSER_IN_USE = "ER_PARSER_IN_USE";
- public static final String ER_CANNOT_CHANGE_WHILE_PARSING = "ER_CANNOT_CHANGE_WHILE_PARSING";
- public static final String ER_SELF_CAUSATION_NOT_PERMITTED = "ER_SELF_CAUSATION_NOT_PERMITTED";
- public static final String ER_NO_USERINFO_IF_NO_HOST = "ER_NO_USERINFO_IF_NO_HOST";
- public static final String ER_NO_PORT_IF_NO_HOST = "ER_NO_PORT_IF_NO_HOST";
- public static final String ER_NO_QUERY_STRING_IN_PATH = "ER_NO_QUERY_STRING_IN_PATH";
- public static final String ER_NO_FRAGMENT_STRING_IN_PATH = "ER_NO_FRAGMENT_STRING_IN_PATH";
- public static final String ER_CANNOT_INIT_URI_EMPTY_PARMS = "ER_CANNOT_INIT_URI_EMPTY_PARMS";
- public static final String ER_METHOD_NOT_SUPPORTED ="ER_METHOD_NOT_SUPPORTED";
- public static final String ER_INCRSAXSRCFILTER_NOT_RESTARTABLE = "ER_INCRSAXSRCFILTER_NOT_RESTARTABLE";
- public static final String ER_XMLRDR_NOT_BEFORE_STARTPARSE = "ER_XMLRDR_NOT_BEFORE_STARTPARSE";
- public static final String ER_AXIS_TRAVERSER_NOT_SUPPORTED = "ER_AXIS_TRAVERSER_NOT_SUPPORTED";
- public static final String ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER = "ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER";
- public static final String ER_SYSTEMID_UNKNOWN = "ER_SYSTEMID_UNKNOWN";
- public static final String ER_LOCATION_UNKNOWN = "ER_LOCATION_UNKNOWN";
- public static final String ER_PREFIX_MUST_RESOLVE = "ER_PREFIX_MUST_RESOLVE";
- public static final String ER_CREATEDOCUMENT_NOT_SUPPORTED = "ER_CREATEDOCUMENT_NOT_SUPPORTED";
- public static final String ER_CHILD_HAS_NO_OWNER_DOCUMENT = "ER_CHILD_HAS_NO_OWNER_DOCUMENT";
- public static final String ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT = "ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT";
- public static final String ER_CANT_OUTPUT_TEXT_BEFORE_DOC = "ER_CANT_OUTPUT_TEXT_BEFORE_DOC";
- public static final String ER_CANT_HAVE_MORE_THAN_ONE_ROOT = "ER_CANT_HAVE_MORE_THAN_ONE_ROOT";
- public static final String ER_ARG_LOCALNAME_NULL = "ER_ARG_LOCALNAME_NULL";
- public static final String ER_ARG_LOCALNAME_INVALID = "ER_ARG_LOCALNAME_INVALID";
- public static final String ER_ARG_PREFIX_INVALID = "ER_ARG_PREFIX_INVALID";
- public static final String ER_NAME_CANT_START_WITH_COLON = "ER_NAME_CANT_START_WITH_COLON";
-
- // Message keys used by the serializer
- public static final String ER_RESOURCE_COULD_NOT_FIND = "ER_RESOURCE_COULD_NOT_FIND";
- public static final String ER_RESOURCE_COULD_NOT_LOAD = "ER_RESOURCE_COULD_NOT_LOAD";
- public static final String ER_BUFFER_SIZE_LESSTHAN_ZERO = "ER_BUFFER_SIZE_LESSTHAN_ZERO";
- public static final String ER_INVALID_UTF16_SURROGATE = "ER_INVALID_UTF16_SURROGATE";
- public static final String ER_OIERROR = "ER_OIERROR";
- public static final String ER_NAMESPACE_PREFIX = "ER_NAMESPACE_PREFIX";
- public static final String ER_STRAY_ATTRIBUTE = "ER_STRAY_ATTIRBUTE";
- public static final String ER_STRAY_NAMESPACE = "ER_STRAY_NAMESPACE";
- public static final String ER_COULD_NOT_LOAD_RESOURCE = "ER_COULD_NOT_LOAD_RESOURCE";
- public static final String ER_COULD_NOT_LOAD_METHOD_PROPERTY = "ER_COULD_NOT_LOAD_METHOD_PROPERTY";
- public static final String ER_SERIALIZER_NOT_CONTENTHANDLER = "ER_SERIALIZER_NOT_CONTENTHANDLER";
- public static final String ER_ILLEGAL_ATTRIBUTE_POSITION = "ER_ILLEGAL_ATTRIBUTE_POSITION";
- public static final String ER_ILLEGAL_CHARACTER = "ER_ILLEGAL_CHARACTER";
-
- /*
- * Now fill in the message text.
- * Then fill in the message text for that message code in the
- * array. Use the new error code as the index into the array.
- */
-
- // Error messages...
-
- /** The lookup table for error messages. */
- private static final Object[][] contents = {
-
- /** Error message ID that has a null message, but takes in a single object. */
- {"ER0000" , "{0}" },
-
- { ER_FUNCTION_NOT_SUPPORTED,
- "\u95A2\u6570\u304C\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"},
-
- { ER_CANNOT_OVERWRITE_CAUSE,
- "\u539F\u56E0\u3092\u4E0A\u66F8\u304D\u3067\u304D\u307E\u305B\u3093"},
-
- { ER_NO_DEFAULT_IMPL,
- "\u30C7\u30D5\u30A9\u30EB\u30C8\u5B9F\u88C5\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093 "},
-
- { ER_CHUNKEDINTARRAY_NOT_SUPPORTED,
- "ChunkedIntArray({0})\u306F\u73FE\u5728\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093"},
-
- { ER_OFFSET_BIGGER_THAN_SLOT,
- "\u30AA\u30D5\u30BB\u30C3\u30C8\u304C\u30B9\u30ED\u30C3\u30C8\u3088\u308A\u3082\u5927\u304D\u3044\u3067\u3059"},
-
- { ER_COROUTINE_NOT_AVAIL,
- "\u30B3\u30EB\u30FC\u30C1\u30F3\u3092\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\u3002id={0}"},
-
- { ER_COROUTINE_CO_EXIT,
- "CoroutineManager\u304Cco_exit()\u30EA\u30AF\u30A8\u30B9\u30C8\u3092\u53D7\u3051\u53D6\u308A\u307E\u3057\u305F"},
-
- { ER_COJOINROUTINESET_FAILED,
- "co_joinCoroutineSet()\u304C\u5931\u6557\u3057\u307E\u3057\u305F"},
-
- { ER_COROUTINE_PARAM,
- "\u30B3\u30EB\u30FC\u30C1\u30F3\u30FB\u30D1\u30E9\u30E1\u30FC\u30BF\u306E\u30A8\u30E9\u30FC({0})"},
-
- { ER_PARSER_DOTERMINATE_ANSWERS,
- "\n\u4E0D\u660E: \u30D1\u30FC\u30B5\u30FCdoTerminate\u306E\u5FDC\u7B54\u306F{0}\u3067\u3059"},
-
- { ER_NO_PARSE_CALL_WHILE_PARSING,
- "\u89E3\u6790\u306F\u69CB\u6587\u89E3\u6790\u4E2D\u306B\u547C\u3073\u51FA\u3059\u3053\u3068\u304C\u3067\u304D\u307E\u305B\u3093"},
-
- { ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED,
- "\u30A8\u30E9\u30FC: \u8EF8{0}\u306E\u578B\u6307\u5B9A\u3055\u308C\u305F\u30A4\u30C6\u30EC\u30FC\u30BF\u304C\u5B9F\u88C5\u3055\u308C\u3066\u3044\u307E\u305B\u3093"},
-
- { ER_ITERATOR_AXIS_NOT_IMPLEMENTED,
- "\u30A8\u30E9\u30FC: \u8EF8{0}\u306E\u30A4\u30C6\u30EC\u30FC\u30BF\u304C\u5B9F\u88C5\u3055\u308C\u3066\u3044\u307E\u305B\u3093 "},
-
- { ER_ITERATOR_CLONE_NOT_SUPPORTED,
- "\u30A4\u30C6\u30EC\u30FC\u30BF\u306E\u30AF\u30ED\u30FC\u30F3\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093"},
-
- { ER_UNKNOWN_AXIS_TYPE,
- "\u4E0D\u660E\u306A\u8EF8\u30C8\u30E9\u30D0\u30FC\u30B9\u30FB\u30BF\u30A4\u30D7\u3067\u3059: {0}"},
-
- { ER_AXIS_NOT_SUPPORTED,
- "\u8EF8\u30C8\u30E9\u30D0\u30FC\u30B5\u6A5F\u80FD\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093: {0}"},
-
- { ER_NO_DTMIDS_AVAIL,
- "DTM ID\u306F\u3053\u308C\u4EE5\u4E0A\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093"},
-
- { ER_NOT_SUPPORTED,
- "\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093: {0}"},
-
- { ER_NODE_NON_NULL,
- "\u30CE\u30FC\u30C9\u306FgetDTMHandleFromNode\u306B\u3064\u3044\u3066\u975Enull\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
-
- { ER_COULD_NOT_RESOLVE_NODE,
- "\u30CE\u30FC\u30C9\u3092\u30CF\u30F3\u30C9\u30EB\u306B\u89E3\u6C7A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F"},
-
- { ER_STARTPARSE_WHILE_PARSING,
- "startParse\u306F\u69CB\u6587\u89E3\u6790\u4E2D\u306B\u547C\u3073\u51FA\u3059\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093"},
-
- { ER_STARTPARSE_NEEDS_SAXPARSER,
- "startParse\u306B\u306F\u975Enull\u306ESAXParser\u304C\u5FC5\u8981\u3067\u3059"},
-
- { ER_COULD_NOT_INIT_PARSER,
- "\u6B21\u306E\u7406\u7531\u3067\u30D1\u30FC\u30B5\u30FC\u3092\u521D\u671F\u5316\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F: "},
-
- { ER_EXCEPTION_CREATING_POOL,
- "\u30D7\u30FC\u30EB\u7528\u306E\u65B0\u898F\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u306E\u4F5C\u6210\u4E2D\u306B\u767A\u751F\u3057\u305F\u4F8B\u5916"},
-
- { ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE,
- "\u30D1\u30B9\u306B\u7121\u52B9\u306A\u30A8\u30B9\u30B1\u30FC\u30D7\u30FB\u30B7\u30FC\u30B1\u30F3\u30B9\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059"},
-
- { ER_SCHEME_REQUIRED,
- "\u30B9\u30AD\u30FC\u30E0\u304C\u5FC5\u8981\u3067\u3059\u3002"},
-
- { ER_NO_SCHEME_IN_URI,
- "\u30B9\u30AD\u30FC\u30E0\u304CURI\u306B\u898B\u3064\u304B\u308A\u307E\u305B\u3093: {0}"},
-
- { ER_NO_SCHEME_INURI,
- "\u30B9\u30AD\u30FC\u30E0\u304CURI\u306B\u898B\u3064\u304B\u308A\u307E\u305B\u3093"},
-
- { ER_PATH_INVALID_CHAR,
- "\u30D1\u30B9\u306B\u7121\u52B9\u306A\u6587\u5B57\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059: {0}"},
-
- { ER_SCHEME_FROM_NULL_STRING,
- "null\u6587\u5B57\u5217\u304B\u3089\u306F\u30B9\u30AD\u30FC\u30E0\u3092\u8A2D\u5B9A\u3067\u304D\u307E\u305B\u3093"},
-
- { ER_SCHEME_NOT_CONFORMANT,
- "\u30B9\u30AD\u30FC\u30E0\u304C\u6574\u5408\u3057\u3066\u3044\u307E\u305B\u3093\u3002"},
-
- { ER_HOST_ADDRESS_NOT_WELLFORMED,
- "\u30DB\u30B9\u30C8\u306F\u6574\u5F62\u5F0F\u306E\u30A2\u30C9\u30EC\u30B9\u3067\u306F\u3042\u308A\u307E\u305B\u3093"},
-
- { ER_PORT_WHEN_HOST_NULL,
- "\u30DB\u30B9\u30C8\u304Cnull\u306E\u5834\u5408\u306F\u30DD\u30FC\u30C8\u3092\u8A2D\u5B9A\u3067\u304D\u307E\u305B\u3093"},
-
- { ER_INVALID_PORT,
- "\u7121\u52B9\u306A\u30DD\u30FC\u30C8\u756A\u53F7"},
-
- { ER_FRAG_FOR_GENERIC_URI,
- "\u6C4E\u7528URI\u306E\u30D5\u30E9\u30B0\u30E1\u30F3\u30C8\u306E\u307F\u8A2D\u5B9A\u3067\u304D\u307E\u3059"},
-
- { ER_FRAG_WHEN_PATH_NULL,
- "\u30D1\u30B9\u304Cnull\u306E\u5834\u5408\u306F\u30D5\u30E9\u30B0\u30E1\u30F3\u30C8\u3092\u8A2D\u5B9A\u3067\u304D\u307E\u305B\u3093"},
-
- { ER_FRAG_INVALID_CHAR,
- "\u30D5\u30E9\u30B0\u30E1\u30F3\u30C8\u306B\u7121\u52B9\u6587\u5B57\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059"},
-
- { ER_PARSER_IN_USE,
- "\u30D1\u30FC\u30B5\u30FC\u306F\u3059\u3067\u306B\u4F7F\u7528\u4E2D\u3067\u3059"},
-
- { ER_CANNOT_CHANGE_WHILE_PARSING,
- "\u89E3\u6790\u4E2D\u306B{0} {1}\u3092\u5909\u66F4\u3067\u304D\u307E\u305B\u3093"},
-
- { ER_SELF_CAUSATION_NOT_PERMITTED,
- "\u81EA\u5DF1\u539F\u56E0\u306F\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093"},
-
- { ER_NO_USERINFO_IF_NO_HOST,
- "\u30DB\u30B9\u30C8\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u306A\u3044\u5834\u5408\u306FUserinfo\u3092\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093"},
-
- { ER_NO_PORT_IF_NO_HOST,
- "\u30DB\u30B9\u30C8\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u306A\u3044\u5834\u5408\u306F\u30DD\u30FC\u30C8\u3092\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093"},
-
- { ER_NO_QUERY_STRING_IN_PATH,
- "\u554F\u5408\u305B\u6587\u5B57\u5217\u306F\u30D1\u30B9\u304A\u3088\u3073\u554F\u5408\u305B\u6587\u5B57\u5217\u5185\u306B\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093"},
-
- { ER_NO_FRAGMENT_STRING_IN_PATH,
- "\u30D5\u30E9\u30B0\u30E1\u30F3\u30C8\u306F\u30D1\u30B9\u3068\u30D5\u30E9\u30B0\u30E1\u30F3\u30C8\u306E\u4E21\u65B9\u306B\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093"},
-
- { ER_CANNOT_INIT_URI_EMPTY_PARMS,
- "URI\u306F\u7A7A\u306E\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u4F7F\u7528\u3057\u3066\u521D\u671F\u5316\u3067\u304D\u307E\u305B\u3093"},
-
- { ER_METHOD_NOT_SUPPORTED,
- "\u30E1\u30BD\u30C3\u30C9\u306F\u307E\u3060\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093 "},
-
- { ER_INCRSAXSRCFILTER_NOT_RESTARTABLE,
- "IncrementalSAXSource_Filter\u306F\u73FE\u5728\u306F\u518D\u8D77\u52D5\u53EF\u80FD\u3067\u306F\u3042\u308A\u307E\u305B\u3093"},
-
- { ER_XMLRDR_NOT_BEFORE_STARTPARSE,
- "XMLReader\u306FstartParse\u30EA\u30AF\u30A8\u30B9\u30C8\u3088\u308A\u524D\u306B\u3067\u304D\u307E\u305B\u3093"},
-
- { ER_AXIS_TRAVERSER_NOT_SUPPORTED,
- "\u8EF8\u30C8\u30E9\u30D0\u30FC\u30B5\u6A5F\u80FD\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093: {0}"},
-
- { ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER,
- "null PrintWriter\u306B\u3088\u3063\u3066ListingErrorHandler\u304C\u4F5C\u6210\u3055\u308C\u307E\u3057\u305F\u3002"},
-
- { ER_SYSTEMID_UNKNOWN,
- "\u4E0D\u660E\u306ASystemId"},
-
- { ER_LOCATION_UNKNOWN,
- "\u30A8\u30E9\u30FC\u306E\u5834\u6240\u304C\u4E0D\u660E\u3067\u3059"},
-
- { ER_PREFIX_MUST_RESOLVE,
- "\u63A5\u982D\u8F9E\u306F\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u306B\u89E3\u6C7A\u3055\u308C\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059: {0}"},
-
- { ER_CREATEDOCUMENT_NOT_SUPPORTED,
- "createDocument()\u306FXPathContext\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"},
-
- { ER_CHILD_HAS_NO_OWNER_DOCUMENT,
- "\u5C5E\u6027\u306E\u5B50\u306B\u6240\u6709\u8005\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u304C\u3042\u308A\u307E\u305B\u3093\u3002"},
-
- { ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT,
- "\u5C5E\u6027\u306E\u5B50\u306B\u6240\u6709\u8005\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u8981\u7D20\u304C\u3042\u308A\u307E\u305B\u3093\u3002"},
-
- { ER_CANT_OUTPUT_TEXT_BEFORE_DOC,
- "\u8B66\u544A: \u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u8981\u7D20\u306E\u524D\u306B\u30C6\u30AD\u30B9\u30C8\u3092\u51FA\u529B\u3067\u304D\u307E\u305B\u3093\u3002 \u7121\u8996\u3057\u307E\u3059..."},
-
- { ER_CANT_HAVE_MORE_THAN_ONE_ROOT,
- "DOM\u306B\u8907\u6570\u306E\u30EB\u30FC\u30C8\u3092\u6301\u3064\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002"},
-
- { ER_ARG_LOCALNAME_NULL,
- "\u5F15\u6570'localName'\u306Fnull\u3067\u3059"},
-
- // Note to translators: A QNAME has the syntactic form [NCName:]NCName
- // The localname is the portion after the optional colon; the message indicates
- // that there is a problem with that part of the QNAME.
- { ER_ARG_LOCALNAME_INVALID,
- "QNAME\u306ELocalname\u306F\u6709\u52B9\u306ANCName\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
-
- // Note to translators: A QNAME has the syntactic form [NCName:]NCName
- // The prefix is the portion before the optional colon; the message indicates
- // that there is a problem with that part of the QNAME.
- { ER_ARG_PREFIX_INVALID,
- "QNAME\u306E\u63A5\u982D\u8F9E\u306F\u6709\u52B9\u306ANCName\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
-
- { ER_NAME_CANT_START_WITH_COLON,
- "\u540D\u524D\u306E\u5148\u982D\u3092\u30B3\u30ED\u30F3\u306B\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093"},
-
- { "BAD_CODE", "createMessage\u306E\u30D1\u30E9\u30E1\u30FC\u30BF\u304C\u7BC4\u56F2\u5916\u3067\u3059"},
- { "FORMAT_FAILED", "messageFormat\u306E\u547C\u51FA\u3057\u4E2D\u306B\u4F8B\u5916\u304C\u30B9\u30ED\u30FC\u3055\u308C\u307E\u3057\u305F"},
- { "line", "\u884C\u756A\u53F7"},
- { "column","\u5217\u756A\u53F7"},
-
- {ER_SERIALIZER_NOT_CONTENTHANDLER,
- "\u30B7\u30EA\u30A2\u30E9\u30A4\u30B6\u30FB\u30AF\u30E9\u30B9''{0}''\u306Forg.xml.sax.ContentHandler\u3092\u5B9F\u88C5\u3057\u307E\u305B\u3093\u3002"},
-
- {ER_RESOURCE_COULD_NOT_FIND,
- "\u30EA\u30BD\u30FC\u30B9[ {0} ]\u306F\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002\n {1}" },
-
- {ER_RESOURCE_COULD_NOT_LOAD,
- "\u30EA\u30BD\u30FC\u30B9[ {0} ]\u3092\u30ED\u30FC\u30C9\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F: {1} \n {2} \t {3}" },
-
- {ER_BUFFER_SIZE_LESSTHAN_ZERO,
- "\u30D0\u30C3\u30D5\u30A1\u30FB\u30B5\u30A4\u30BA<=0" },
-
- {ER_INVALID_UTF16_SURROGATE,
- "\u7121\u52B9\u306AUTF-16\u30B5\u30ED\u30B2\u30FC\u30C8\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F: {0}\u3002" },
-
- {ER_OIERROR,
- "IO\u30A8\u30E9\u30FC" },
-
- {ER_ILLEGAL_ATTRIBUTE_POSITION,
- "\u5B50\u30CE\u30FC\u30C9\u306E\u5F8C\u307E\u305F\u306F\u8981\u7D20\u304C\u751F\u6210\u3055\u308C\u308B\u524D\u306B\u5C5E\u6027{0}\u3092\u8FFD\u52A0\u3067\u304D\u307E\u305B\u3093\u3002\u5C5E\u6027\u306F\u7121\u8996\u3055\u308C\u307E\u3059\u3002"},
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- {ER_NAMESPACE_PREFIX,
- "\u63A5\u982D\u8F9E''{0}''\u306E\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u304C\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002" },
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- {ER_STRAY_ATTRIBUTE,
- "\u5C5E\u6027''{0}''\u304C\u8981\u7D20\u306E\u5916\u5074\u306B\u3042\u308A\u307E\u3059\u3002" },
-
- /*
- * Note to translators: As with the preceding message, a namespace
- * declaration has the form of an attribute and is only permitted to
- * appear on an element. The substitution text {0} is the namespace
- * prefix and {1} is the URI that was being used in the erroneous
- * namespace declaration.
- */
- {ER_STRAY_NAMESPACE,
- "\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u5BA3\u8A00''{0}''=''{1}''\u304C\u8981\u7D20\u306E\u5916\u5074\u306B\u3042\u308A\u307E\u3059\u3002" },
-
- {ER_COULD_NOT_LOAD_RESOURCE,
- "''{0}''\u3092\u30ED\u30FC\u30C9\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F(CLASSPATH\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044)\u3002\u73FE\u5728\u306F\u5358\u306B\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u4F7F\u7528\u3057\u3066\u3044\u307E\u3059"},
-
- { ER_ILLEGAL_CHARACTER,
- "{1}\u306E\u6307\u5B9A\u3055\u308C\u305F\u51FA\u529B\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u3067\u793A\u3055\u308C\u306A\u3044\u6574\u6570\u5024{0}\u306E\u6587\u5B57\u3092\u51FA\u529B\u3057\u3088\u3046\u3068\u3057\u307E\u3057\u305F\u3002"},
-
- {ER_COULD_NOT_LOAD_METHOD_PROPERTY,
- "\u51FA\u529B\u30E1\u30BD\u30C3\u30C9''{1}''\u306E\u30D7\u30ED\u30D1\u30C6\u30A3\u30FB\u30D5\u30A1\u30A4\u30EB''{0}''\u3092\u30ED\u30FC\u30C9\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F(CLASSPATH\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044)" }
-
-
- };
-
- /**
- * Get the association list.
- *
- * @return The association list.
- */
-
- protected Object[][] getContents() {
- return contents;
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_ko.java b/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_ko.java
deleted file mode 100644
index 4936488..0000000
--- a/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_ko.java
+++ /dev/null
@@ -1,450 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xml.internal.res;
-
-
-import java.util.ListResourceBundle;
-
-/**
- * Set up error messages.
- * We build a two dimensional array of message keys and
- * message strings. In order to add a new message here,
- * you need to first add a String constant. And you need
- * to enter key, value pair as part of the contents
- * array. You also need to update MAX_CODE for error strings
- * and MAX_WARNING for warnings ( Needed for only information
- * purpose )
- */
-public class XMLErrorResources_ko extends ListResourceBundle
-{
-
-/*
- * This file contains error and warning messages related to Xalan Error
- * Handling.
- *
- * General notes to translators:
- *
- * 1) Xalan (or more properly, Xalan-interpretive) and XSLTC are names of
- * components.
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- * XSLTC is an acronym for XSLT Compiler.
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 5) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 6) "Translet" is an invented term that describes the class file that
- * results from compiling an XML stylesheet into a Java class.
- *
- * 7) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- */
-
- /** Maximum error messages, this is needed to keep track of the number of messages. */
- public static final int MAX_CODE = 61;
-
- /** Maximum warnings, this is needed to keep track of the number of warnings. */
- public static final int MAX_WARNING = 0;
-
- /** Maximum misc strings. */
- public static final int MAX_OTHERS = 4;
-
- /** Maximum total warnings and error messages. */
- public static final int MAX_MESSAGES = MAX_CODE + MAX_WARNING + 1;
-
-
- /*
- * Message keys
- */
- public static final String ER_FUNCTION_NOT_SUPPORTED = "ER_FUNCTION_NOT_SUPPORTED";
- public static final String ER_CANNOT_OVERWRITE_CAUSE = "ER_CANNOT_OVERWRITE_CAUSE";
- public static final String ER_NO_DEFAULT_IMPL = "ER_NO_DEFAULT_IMPL";
- public static final String ER_CHUNKEDINTARRAY_NOT_SUPPORTED = "ER_CHUNKEDINTARRAY_NOT_SUPPORTED";
- public static final String ER_OFFSET_BIGGER_THAN_SLOT = "ER_OFFSET_BIGGER_THAN_SLOT";
- public static final String ER_COROUTINE_NOT_AVAIL = "ER_COROUTINE_NOT_AVAIL";
- public static final String ER_COROUTINE_CO_EXIT = "ER_COROUTINE_CO_EXIT";
- public static final String ER_COJOINROUTINESET_FAILED = "ER_COJOINROUTINESET_FAILED";
- public static final String ER_COROUTINE_PARAM = "ER_COROUTINE_PARAM";
- public static final String ER_PARSER_DOTERMINATE_ANSWERS = "ER_PARSER_DOTERMINATE_ANSWERS";
- public static final String ER_NO_PARSE_CALL_WHILE_PARSING = "ER_NO_PARSE_CALL_WHILE_PARSING";
- public static final String ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED = "ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED";
- public static final String ER_ITERATOR_AXIS_NOT_IMPLEMENTED = "ER_ITERATOR_AXIS_NOT_IMPLEMENTED";
- public static final String ER_ITERATOR_CLONE_NOT_SUPPORTED = "ER_ITERATOR_CLONE_NOT_SUPPORTED";
- public static final String ER_UNKNOWN_AXIS_TYPE = "ER_UNKNOWN_AXIS_TYPE";
- public static final String ER_AXIS_NOT_SUPPORTED = "ER_AXIS_NOT_SUPPORTED";
- public static final String ER_NO_DTMIDS_AVAIL = "ER_NO_DTMIDS_AVAIL";
- public static final String ER_NOT_SUPPORTED = "ER_NOT_SUPPORTED";
- public static final String ER_NODE_NON_NULL = "ER_NODE_NON_NULL";
- public static final String ER_COULD_NOT_RESOLVE_NODE = "ER_COULD_NOT_RESOLVE_NODE";
- public static final String ER_STARTPARSE_WHILE_PARSING = "ER_STARTPARSE_WHILE_PARSING";
- public static final String ER_STARTPARSE_NEEDS_SAXPARSER = "ER_STARTPARSE_NEEDS_SAXPARSER";
- public static final String ER_COULD_NOT_INIT_PARSER = "ER_COULD_NOT_INIT_PARSER";
- public static final String ER_EXCEPTION_CREATING_POOL = "ER_EXCEPTION_CREATING_POOL";
- public static final String ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE = "ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE";
- public static final String ER_SCHEME_REQUIRED = "ER_SCHEME_REQUIRED";
- public static final String ER_NO_SCHEME_IN_URI = "ER_NO_SCHEME_IN_URI";
- public static final String ER_NO_SCHEME_INURI = "ER_NO_SCHEME_INURI";
- public static final String ER_PATH_INVALID_CHAR = "ER_PATH_INVALID_CHAR";
- public static final String ER_SCHEME_FROM_NULL_STRING = "ER_SCHEME_FROM_NULL_STRING";
- public static final String ER_SCHEME_NOT_CONFORMANT = "ER_SCHEME_NOT_CONFORMANT";
- public static final String ER_HOST_ADDRESS_NOT_WELLFORMED = "ER_HOST_ADDRESS_NOT_WELLFORMED";
- public static final String ER_PORT_WHEN_HOST_NULL = "ER_PORT_WHEN_HOST_NULL";
- public static final String ER_INVALID_PORT = "ER_INVALID_PORT";
- public static final String ER_FRAG_FOR_GENERIC_URI ="ER_FRAG_FOR_GENERIC_URI";
- public static final String ER_FRAG_WHEN_PATH_NULL = "ER_FRAG_WHEN_PATH_NULL";
- public static final String ER_FRAG_INVALID_CHAR = "ER_FRAG_INVALID_CHAR";
- public static final String ER_PARSER_IN_USE = "ER_PARSER_IN_USE";
- public static final String ER_CANNOT_CHANGE_WHILE_PARSING = "ER_CANNOT_CHANGE_WHILE_PARSING";
- public static final String ER_SELF_CAUSATION_NOT_PERMITTED = "ER_SELF_CAUSATION_NOT_PERMITTED";
- public static final String ER_NO_USERINFO_IF_NO_HOST = "ER_NO_USERINFO_IF_NO_HOST";
- public static final String ER_NO_PORT_IF_NO_HOST = "ER_NO_PORT_IF_NO_HOST";
- public static final String ER_NO_QUERY_STRING_IN_PATH = "ER_NO_QUERY_STRING_IN_PATH";
- public static final String ER_NO_FRAGMENT_STRING_IN_PATH = "ER_NO_FRAGMENT_STRING_IN_PATH";
- public static final String ER_CANNOT_INIT_URI_EMPTY_PARMS = "ER_CANNOT_INIT_URI_EMPTY_PARMS";
- public static final String ER_METHOD_NOT_SUPPORTED ="ER_METHOD_NOT_SUPPORTED";
- public static final String ER_INCRSAXSRCFILTER_NOT_RESTARTABLE = "ER_INCRSAXSRCFILTER_NOT_RESTARTABLE";
- public static final String ER_XMLRDR_NOT_BEFORE_STARTPARSE = "ER_XMLRDR_NOT_BEFORE_STARTPARSE";
- public static final String ER_AXIS_TRAVERSER_NOT_SUPPORTED = "ER_AXIS_TRAVERSER_NOT_SUPPORTED";
- public static final String ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER = "ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER";
- public static final String ER_SYSTEMID_UNKNOWN = "ER_SYSTEMID_UNKNOWN";
- public static final String ER_LOCATION_UNKNOWN = "ER_LOCATION_UNKNOWN";
- public static final String ER_PREFIX_MUST_RESOLVE = "ER_PREFIX_MUST_RESOLVE";
- public static final String ER_CREATEDOCUMENT_NOT_SUPPORTED = "ER_CREATEDOCUMENT_NOT_SUPPORTED";
- public static final String ER_CHILD_HAS_NO_OWNER_DOCUMENT = "ER_CHILD_HAS_NO_OWNER_DOCUMENT";
- public static final String ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT = "ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT";
- public static final String ER_CANT_OUTPUT_TEXT_BEFORE_DOC = "ER_CANT_OUTPUT_TEXT_BEFORE_DOC";
- public static final String ER_CANT_HAVE_MORE_THAN_ONE_ROOT = "ER_CANT_HAVE_MORE_THAN_ONE_ROOT";
- public static final String ER_ARG_LOCALNAME_NULL = "ER_ARG_LOCALNAME_NULL";
- public static final String ER_ARG_LOCALNAME_INVALID = "ER_ARG_LOCALNAME_INVALID";
- public static final String ER_ARG_PREFIX_INVALID = "ER_ARG_PREFIX_INVALID";
- public static final String ER_NAME_CANT_START_WITH_COLON = "ER_NAME_CANT_START_WITH_COLON";
-
- // Message keys used by the serializer
- public static final String ER_RESOURCE_COULD_NOT_FIND = "ER_RESOURCE_COULD_NOT_FIND";
- public static final String ER_RESOURCE_COULD_NOT_LOAD = "ER_RESOURCE_COULD_NOT_LOAD";
- public static final String ER_BUFFER_SIZE_LESSTHAN_ZERO = "ER_BUFFER_SIZE_LESSTHAN_ZERO";
- public static final String ER_INVALID_UTF16_SURROGATE = "ER_INVALID_UTF16_SURROGATE";
- public static final String ER_OIERROR = "ER_OIERROR";
- public static final String ER_NAMESPACE_PREFIX = "ER_NAMESPACE_PREFIX";
- public static final String ER_STRAY_ATTRIBUTE = "ER_STRAY_ATTIRBUTE";
- public static final String ER_STRAY_NAMESPACE = "ER_STRAY_NAMESPACE";
- public static final String ER_COULD_NOT_LOAD_RESOURCE = "ER_COULD_NOT_LOAD_RESOURCE";
- public static final String ER_COULD_NOT_LOAD_METHOD_PROPERTY = "ER_COULD_NOT_LOAD_METHOD_PROPERTY";
- public static final String ER_SERIALIZER_NOT_CONTENTHANDLER = "ER_SERIALIZER_NOT_CONTENTHANDLER";
- public static final String ER_ILLEGAL_ATTRIBUTE_POSITION = "ER_ILLEGAL_ATTRIBUTE_POSITION";
- public static final String ER_ILLEGAL_CHARACTER = "ER_ILLEGAL_CHARACTER";
-
- /*
- * Now fill in the message text.
- * Then fill in the message text for that message code in the
- * array. Use the new error code as the index into the array.
- */
-
- // Error messages...
-
- /** The lookup table for error messages. */
- private static final Object[][] contents = {
-
- /** Error message ID that has a null message, but takes in a single object. */
- {"ER0000" , "{0}" },
-
- { ER_FUNCTION_NOT_SUPPORTED,
- "\uD568\uC218\uAC00 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4!"},
-
- { ER_CANNOT_OVERWRITE_CAUSE,
- "\uC6D0\uC778\uC744 \uACB9\uCCD0 \uC4F8 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_NO_DEFAULT_IMPL,
- "\uAE30\uBCF8 \uAD6C\uD604\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. "},
-
- { ER_CHUNKEDINTARRAY_NOT_SUPPORTED,
- "ChunkedIntArray({0})\uB294 \uD604\uC7AC \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
-
- { ER_OFFSET_BIGGER_THAN_SLOT,
- "\uC624\uD504\uC14B\uC774 \uC2AC\uB86F\uBCF4\uB2E4 \uD07D\uB2C8\uB2E4."},
-
- { ER_COROUTINE_NOT_AVAIL,
- "Coroutine\uC744 \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. ID={0}"},
-
- { ER_COROUTINE_CO_EXIT,
- "CoroutineManager\uAC00 co_exit() \uC694\uCCAD\uC744 \uC218\uC2E0\uD588\uC2B5\uB2C8\uB2E4."},
-
- { ER_COJOINROUTINESET_FAILED,
- "co_joinCoroutineSet()\uB97C \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4."},
-
- { ER_COROUTINE_PARAM,
- "Coroutine \uB9E4\uAC1C\uBCC0\uC218 \uC624\uB958({0})"},
-
- { ER_PARSER_DOTERMINATE_ANSWERS,
- "\n\uC608\uC0C1\uCE58 \uC54A\uC740 \uC624\uB958: \uAD6C\uBB38 \uBD84\uC11D\uAE30 doTerminate\uAC00 {0}\uC5D0 \uC751\uB2F5\uD569\uB2C8\uB2E4."},
-
- { ER_NO_PARSE_CALL_WHILE_PARSING,
- "\uAD6C\uBB38 \uBD84\uC11D \uC911 parse\uB97C \uD638\uCD9C\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED,
- "\uC624\uB958: {0} \uCD95\uC5D0 \uB300\uD574 \uC785\uB825\uB41C \uC774\uD130\uB808\uC774\uD130\uAC00 \uAD6C\uD604\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."},
-
- { ER_ITERATOR_AXIS_NOT_IMPLEMENTED,
- "\uC624\uB958: {0} \uCD95\uC5D0 \uB300\uD55C \uC774\uD130\uB808\uC774\uD130\uAC00 \uAD6C\uD604\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4. "},
-
- { ER_ITERATOR_CLONE_NOT_SUPPORTED,
- "\uC774\uD130\uB808\uC774\uD130 \uBCF5\uC81C\uB294 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
-
- { ER_UNKNOWN_AXIS_TYPE,
- "\uC54C \uC218 \uC5C6\uB294 \uCD95 \uC21C\uD68C \uC720\uD615: {0}"},
-
- { ER_AXIS_NOT_SUPPORTED,
- "\uCD95 \uC21C\uD658\uAE30\uAC00 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC74C: {0}"},
-
- { ER_NO_DTMIDS_AVAIL,
- "\uB354 \uC774\uC0C1 \uC0AC\uC6A9 \uAC00\uB2A5\uD55C DTM ID\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_NOT_SUPPORTED,
- "\uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC74C: {0}"},
-
- { ER_NODE_NON_NULL,
- "\uB178\uB4DC\uB294 getDTMHandleFromNode\uC5D0 \uB300\uD574 \uB110\uC774 \uC544\uB2C8\uC5B4\uC57C \uD569\uB2C8\uB2E4."},
-
- { ER_COULD_NOT_RESOLVE_NODE,
- "\uB178\uB4DC\uB97C \uD578\uB4E4\uB85C \uBD84\uC11D\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_STARTPARSE_WHILE_PARSING,
- "\uAD6C\uBB38 \uBD84\uC11D \uC911 startParse\uB97C \uD638\uCD9C\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_STARTPARSE_NEEDS_SAXPARSER,
- "startParse\uC5D0\uB294 \uB110\uC774 \uC544\uB2CC SAXParser\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4."},
-
- { ER_COULD_NOT_INIT_PARSER,
- "\uAD6C\uBB38 \uBD84\uC11D\uAE30\uB97C \uCD08\uAE30\uD654\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_EXCEPTION_CREATING_POOL,
- "\uD480\uC5D0 \uB300\uD55C \uC0C8 \uC778\uC2A4\uD134\uC2A4\uB97C \uC0DD\uC131\uD558\uB294 \uC911 \uC608\uC678\uC0AC\uD56D\uC774 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4."},
-
- { ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE,
- "\uACBD\uB85C\uC5D0 \uBD80\uC801\uD569\uD55C \uC774\uC2A4\uCF00\uC774\uD504 \uC2DC\uD000\uC2A4\uAC00 \uD3EC\uD568\uB418\uC5B4 \uC788\uC2B5\uB2C8\uB2E4."},
-
- { ER_SCHEME_REQUIRED,
- "\uCCB4\uACC4\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4!"},
-
- { ER_NO_SCHEME_IN_URI,
- "URI\uC5D0\uC11C \uCCB4\uACC4\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC74C: {0}"},
-
- { ER_NO_SCHEME_INURI,
- "URI\uC5D0\uC11C \uCCB4\uACC4\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_PATH_INVALID_CHAR,
- "\uACBD\uB85C\uC5D0 \uBD80\uC801\uD569\uD55C \uBB38\uC790\uAC00 \uD3EC\uD568\uB428: {0}"},
-
- { ER_SCHEME_FROM_NULL_STRING,
- "\uB110 \uBB38\uC790\uC5F4\uC5D0\uC11C \uCCB4\uACC4\uB97C \uC124\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_SCHEME_NOT_CONFORMANT,
- "\uCCB4\uACC4\uAC00 \uC77C\uCE58\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
-
- { ER_HOST_ADDRESS_NOT_WELLFORMED,
- "\uD638\uC2A4\uD2B8\uAC00 \uC644\uC804\uD55C \uC8FC\uC18C\uAC00 \uC544\uB2D9\uB2C8\uB2E4."},
-
- { ER_PORT_WHEN_HOST_NULL,
- "\uD638\uC2A4\uD2B8\uAC00 \uB110\uC77C \uACBD\uC6B0 \uD3EC\uD2B8\uB97C \uC124\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_INVALID_PORT,
- "\uD3EC\uD2B8 \uBC88\uD638\uAC00 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4."},
-
- { ER_FRAG_FOR_GENERIC_URI,
- "\uC77C\uBC18 URI\uC5D0 \uB300\uD574\uC11C\uB9CC \uBD80\uBD84\uC744 \uC124\uC815\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4."},
-
- { ER_FRAG_WHEN_PATH_NULL,
- "\uACBD\uB85C\uAC00 \uB110\uC77C \uACBD\uC6B0 \uBD80\uBD84\uC744 \uC124\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_FRAG_INVALID_CHAR,
- "\uBD80\uBD84\uC5D0 \uBD80\uC801\uD569\uD55C \uBB38\uC790\uAC00 \uD3EC\uD568\uB418\uC5B4 \uC788\uC2B5\uB2C8\uB2E4."},
-
- { ER_PARSER_IN_USE,
- "\uAD6C\uBB38 \uBD84\uC11D\uAE30\uAC00 \uC774\uBBF8 \uC0AC\uC6A9\uB418\uACE0 \uC788\uC2B5\uB2C8\uB2E4."},
-
- { ER_CANNOT_CHANGE_WHILE_PARSING,
- "\uAD6C\uBB38 \uBD84\uC11D \uC911 {0} {1}\uC744(\uB97C) \uBCC0\uACBD\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_SELF_CAUSATION_NOT_PERMITTED,
- "\uC790\uCCB4 \uC778\uACFC \uAD00\uACC4\uB294 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
-
- { ER_NO_USERINFO_IF_NO_HOST,
- "\uD638\uC2A4\uD2B8\uB97C \uC9C0\uC815\uD558\uC9C0 \uC54A\uC740 \uACBD\uC6B0\uC5D0\uB294 Userinfo\uB97C \uC9C0\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_NO_PORT_IF_NO_HOST,
- "\uD638\uC2A4\uD2B8\uB97C \uC9C0\uC815\uD558\uC9C0 \uC54A\uC740 \uACBD\uC6B0\uC5D0\uB294 \uD3EC\uD2B8\uB97C \uC9C0\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_NO_QUERY_STRING_IN_PATH,
- "\uACBD\uB85C \uBC0F \uC9C8\uC758 \uBB38\uC790\uC5F4\uC5D0 \uC9C8\uC758 \uBB38\uC790\uC5F4\uC744 \uC9C0\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_NO_FRAGMENT_STRING_IN_PATH,
- "\uACBD\uB85C\uC640 \uBD80\uBD84\uC5D0 \uBAA8\uB450 \uBD80\uBD84\uC744 \uC9C0\uC815\uD560 \uC218\uB294 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_CANNOT_INIT_URI_EMPTY_PARMS,
- "\uBE48 \uB9E4\uAC1C\uBCC0\uC218\uB85C URI\uB97C \uCD08\uAE30\uD654\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_METHOD_NOT_SUPPORTED,
- "\uBA54\uC18C\uB4DC\uAC00 \uC544\uC9C1 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. "},
-
- { ER_INCRSAXSRCFILTER_NOT_RESTARTABLE,
- "\uD604\uC7AC IncrementalSAXSource_Filter\uB97C \uC7AC\uC2DC\uC791\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_XMLRDR_NOT_BEFORE_STARTPARSE,
- "startParse \uC694\uCCAD \uC804\uC5D0 XMLReader\uAC00 \uC2E4\uD589\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."},
-
- { ER_AXIS_TRAVERSER_NOT_SUPPORTED,
- "\uCD95 \uC21C\uD658\uAE30\uAC00 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC74C: {0}"},
-
- { ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER,
- "\uB110 PrintWriter\uB85C ListingErrorHandler\uAC00 \uC0DD\uC131\uB418\uC5C8\uC2B5\uB2C8\uB2E4!"},
-
- { ER_SYSTEMID_UNKNOWN,
- "SystemId\uB97C \uC54C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_LOCATION_UNKNOWN,
- "\uC624\uB958 \uC704\uCE58\uB97C \uC54C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_PREFIX_MUST_RESOLVE,
- "\uC811\uB450\uC5B4\uB294 \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uB85C \uBD84\uC11D\uB418\uC5B4\uC57C \uD568: {0}"},
-
- { ER_CREATEDOCUMENT_NOT_SUPPORTED,
- "XPathContext\uC5D0\uC11C\uB294 createDocument()\uAC00 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4!"},
-
- { ER_CHILD_HAS_NO_OWNER_DOCUMENT,
- "\uC18D\uC131 \uD558\uC704\uC5D0 \uC18C\uC720\uC790 \uBB38\uC11C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4!"},
-
- { ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT,
- "\uC18D\uC131 \uD558\uC704\uC5D0 \uC18C\uC720\uC790 \uBB38\uC11C \uC694\uC18C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4!"},
-
- { ER_CANT_OUTPUT_TEXT_BEFORE_DOC,
- "\uACBD\uACE0: \uBB38\uC11C \uC694\uC18C \uC55E\uC5D0 \uD14D\uC2A4\uD2B8\uB97C \uCD9C\uB825\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4! \uBB34\uC2DC\uD558\uB294 \uC911..."},
-
- { ER_CANT_HAVE_MORE_THAN_ONE_ROOT,
- "DOM\uC5D0\uC11C \uB8E8\uD2B8\uB97C \uB450 \uAC1C \uC774\uC0C1 \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4!"},
-
- { ER_ARG_LOCALNAME_NULL,
- "'localName' \uC778\uC218\uAC00 \uB110\uC785\uB2C8\uB2E4."},
-
- // Note to translators: A QNAME has the syntactic form [NCName:]NCName
- // The localname is the portion after the optional colon; the message indicates
- // that there is a problem with that part of the QNAME.
- { ER_ARG_LOCALNAME_INVALID,
- "QNAME\uC758 Localname\uC740 \uC801\uD569\uD55C NCName\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4."},
-
- // Note to translators: A QNAME has the syntactic form [NCName:]NCName
- // The prefix is the portion before the optional colon; the message indicates
- // that there is a problem with that part of the QNAME.
- { ER_ARG_PREFIX_INVALID,
- "QNAME\uC758 \uC811\uB450\uC5B4\uB294 \uC801\uD569\uD55C NCName\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4."},
-
- { ER_NAME_CANT_START_WITH_COLON,
- "\uC774\uB984\uC740 \uCF5C\uB860\uC73C\uB85C \uC2DC\uC791\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { "BAD_CODE", "createMessage\uC5D0 \uB300\uD55C \uB9E4\uAC1C\uBCC0\uC218\uAC00 \uBC94\uC704\uB97C \uBC97\uC5B4\uB0AC\uC2B5\uB2C8\uB2E4."},
- { "FORMAT_FAILED", "messageFormat \uD638\uCD9C \uC911 \uC608\uC678\uC0AC\uD56D\uC774 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4."},
- { "line", "\uD589 \uBC88\uD638"},
- { "column","\uC5F4 \uBC88\uD638"},
-
- {ER_SERIALIZER_NOT_CONTENTHANDLER,
- "Serializer \uD074\uB798\uC2A4 ''{0}''\uC774(\uAC00) org.xml.sax.ContentHandler\uB97C \uAD6C\uD604\uD558\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."},
-
- {ER_RESOURCE_COULD_NOT_FIND,
- "[{0}] \uB9AC\uC18C\uC2A4\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.\n {1}" },
-
- {ER_RESOURCE_COULD_NOT_LOAD,
- "[{0}] \uB9AC\uC18C\uC2A4\uAC00 \uB2E4\uC74C\uC744 \uB85C\uB4DC\uD560 \uC218 \uC5C6\uC74C: {1} \n {2} \t {3}" },
-
- {ER_BUFFER_SIZE_LESSTHAN_ZERO,
- "\uBC84\uD37C \uD06C\uAE30 <=0" },
-
- {ER_INVALID_UTF16_SURROGATE,
- "\uBD80\uC801\uD569\uD55C UTF-16 \uB300\uB9AC \uC694\uC18C\uAC00 \uAC10\uC9C0\uB428: {0}" },
-
- {ER_OIERROR,
- "IO \uC624\uB958" },
-
- {ER_ILLEGAL_ATTRIBUTE_POSITION,
- "\uD558\uC704 \uB178\uB4DC\uAC00 \uC0DD\uC131\uB41C \uD6C4 \uB610\uB294 \uC694\uC18C\uAC00 \uC0DD\uC131\uB418\uAE30 \uC804\uC5D0 {0} \uC18D\uC131\uC744 \uCD94\uAC00\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uC18D\uC131\uC774 \uBB34\uC2DC\uB429\uB2C8\uB2E4."},
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- {ER_NAMESPACE_PREFIX,
- "''{0}'' \uC811\uB450\uC5B4\uC5D0 \uB300\uD55C \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uAC00 \uC120\uC5B8\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4." },
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- {ER_STRAY_ATTRIBUTE,
- "''{0}'' \uC18D\uC131\uC774 \uC694\uC18C\uC5D0 \uD3EC\uD568\uB418\uC5B4 \uC788\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4." },
-
- /*
- * Note to translators: As with the preceding message, a namespace
- * declaration has the form of an attribute and is only permitted to
- * appear on an element. The substitution text {0} is the namespace
- * prefix and {1} is the URI that was being used in the erroneous
- * namespace declaration.
- */
- {ER_STRAY_NAMESPACE,
- "\uB124\uC784\uC2A4\uD398\uC774\uC2A4 \uC120\uC5B8 ''{0}''=''{1}''\uC774(\uAC00) \uC694\uC18C\uC5D0 \uD3EC\uD568\uB418\uC5B4 \uC788\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4." },
-
- {ER_COULD_NOT_LOAD_RESOURCE,
- "{0}\uC744(\uB97C) \uB85C\uB4DC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. CLASSPATH\uB97C \uD655\uC778\uD558\uC2ED\uC2DC\uC624. \uD604\uC7AC \uAE30\uBCF8\uAC12\uB9CC \uC0AC\uC6A9\uD558\uB294 \uC911\uC785\uB2C8\uB2E4."},
-
- { ER_ILLEGAL_CHARACTER,
- "{1}\uC758 \uC9C0\uC815\uB41C \uCD9C\uB825 \uC778\uCF54\uB529\uC5D0\uC11C \uD45C\uC2DC\uB418\uC9C0 \uC54A\uB294 \uC815\uC218 \uAC12 {0}\uC758 \uBB38\uC790\uB97C \uCD9C\uB825\uD558\uB824\uACE0 \uC2DC\uB3C4\uD588\uC2B5\uB2C8\uB2E4."},
-
- {ER_COULD_NOT_LOAD_METHOD_PROPERTY,
- "\uCD9C\uB825 \uBA54\uC18C\uB4DC ''{1}''\uC5D0 \uB300\uD55C \uC18D\uC131 \uD30C\uC77C ''{0}''\uC744(\uB97C) \uB85C\uB4DC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. CLASSPATH\uB97C \uD655\uC778\uD558\uC2ED\uC2DC\uC624." }
-
-
- };
-
- /**
- * Get the association list.
- *
- * @return The association list.
- */
-
- protected Object[][] getContents() {
- return contents;
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_pt_BR.java b/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_pt_BR.java
deleted file mode 100644
index 814b19c..0000000
--- a/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_pt_BR.java
+++ /dev/null
@@ -1,450 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xml.internal.res;
-
-
-import java.util.ListResourceBundle;
-
-/**
- * Set up error messages.
- * We build a two dimensional array of message keys and
- * message strings. In order to add a new message here,
- * you need to first add a String constant. And you need
- * to enter key, value pair as part of the contents
- * array. You also need to update MAX_CODE for error strings
- * and MAX_WARNING for warnings ( Needed for only information
- * purpose )
- */
-public class XMLErrorResources_pt_BR extends ListResourceBundle
-{
-
-/*
- * This file contains error and warning messages related to Xalan Error
- * Handling.
- *
- * General notes to translators:
- *
- * 1) Xalan (or more properly, Xalan-interpretive) and XSLTC are names of
- * components.
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- * XSLTC is an acronym for XSLT Compiler.
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 5) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 6) "Translet" is an invented term that describes the class file that
- * results from compiling an XML stylesheet into a Java class.
- *
- * 7) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- */
-
- /** Maximum error messages, this is needed to keep track of the number of messages. */
- public static final int MAX_CODE = 61;
-
- /** Maximum warnings, this is needed to keep track of the number of warnings. */
- public static final int MAX_WARNING = 0;
-
- /** Maximum misc strings. */
- public static final int MAX_OTHERS = 4;
-
- /** Maximum total warnings and error messages. */
- public static final int MAX_MESSAGES = MAX_CODE + MAX_WARNING + 1;
-
-
- /*
- * Message keys
- */
- public static final String ER_FUNCTION_NOT_SUPPORTED = "ER_FUNCTION_NOT_SUPPORTED";
- public static final String ER_CANNOT_OVERWRITE_CAUSE = "ER_CANNOT_OVERWRITE_CAUSE";
- public static final String ER_NO_DEFAULT_IMPL = "ER_NO_DEFAULT_IMPL";
- public static final String ER_CHUNKEDINTARRAY_NOT_SUPPORTED = "ER_CHUNKEDINTARRAY_NOT_SUPPORTED";
- public static final String ER_OFFSET_BIGGER_THAN_SLOT = "ER_OFFSET_BIGGER_THAN_SLOT";
- public static final String ER_COROUTINE_NOT_AVAIL = "ER_COROUTINE_NOT_AVAIL";
- public static final String ER_COROUTINE_CO_EXIT = "ER_COROUTINE_CO_EXIT";
- public static final String ER_COJOINROUTINESET_FAILED = "ER_COJOINROUTINESET_FAILED";
- public static final String ER_COROUTINE_PARAM = "ER_COROUTINE_PARAM";
- public static final String ER_PARSER_DOTERMINATE_ANSWERS = "ER_PARSER_DOTERMINATE_ANSWERS";
- public static final String ER_NO_PARSE_CALL_WHILE_PARSING = "ER_NO_PARSE_CALL_WHILE_PARSING";
- public static final String ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED = "ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED";
- public static final String ER_ITERATOR_AXIS_NOT_IMPLEMENTED = "ER_ITERATOR_AXIS_NOT_IMPLEMENTED";
- public static final String ER_ITERATOR_CLONE_NOT_SUPPORTED = "ER_ITERATOR_CLONE_NOT_SUPPORTED";
- public static final String ER_UNKNOWN_AXIS_TYPE = "ER_UNKNOWN_AXIS_TYPE";
- public static final String ER_AXIS_NOT_SUPPORTED = "ER_AXIS_NOT_SUPPORTED";
- public static final String ER_NO_DTMIDS_AVAIL = "ER_NO_DTMIDS_AVAIL";
- public static final String ER_NOT_SUPPORTED = "ER_NOT_SUPPORTED";
- public static final String ER_NODE_NON_NULL = "ER_NODE_NON_NULL";
- public static final String ER_COULD_NOT_RESOLVE_NODE = "ER_COULD_NOT_RESOLVE_NODE";
- public static final String ER_STARTPARSE_WHILE_PARSING = "ER_STARTPARSE_WHILE_PARSING";
- public static final String ER_STARTPARSE_NEEDS_SAXPARSER = "ER_STARTPARSE_NEEDS_SAXPARSER";
- public static final String ER_COULD_NOT_INIT_PARSER = "ER_COULD_NOT_INIT_PARSER";
- public static final String ER_EXCEPTION_CREATING_POOL = "ER_EXCEPTION_CREATING_POOL";
- public static final String ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE = "ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE";
- public static final String ER_SCHEME_REQUIRED = "ER_SCHEME_REQUIRED";
- public static final String ER_NO_SCHEME_IN_URI = "ER_NO_SCHEME_IN_URI";
- public static final String ER_NO_SCHEME_INURI = "ER_NO_SCHEME_INURI";
- public static final String ER_PATH_INVALID_CHAR = "ER_PATH_INVALID_CHAR";
- public static final String ER_SCHEME_FROM_NULL_STRING = "ER_SCHEME_FROM_NULL_STRING";
- public static final String ER_SCHEME_NOT_CONFORMANT = "ER_SCHEME_NOT_CONFORMANT";
- public static final String ER_HOST_ADDRESS_NOT_WELLFORMED = "ER_HOST_ADDRESS_NOT_WELLFORMED";
- public static final String ER_PORT_WHEN_HOST_NULL = "ER_PORT_WHEN_HOST_NULL";
- public static final String ER_INVALID_PORT = "ER_INVALID_PORT";
- public static final String ER_FRAG_FOR_GENERIC_URI ="ER_FRAG_FOR_GENERIC_URI";
- public static final String ER_FRAG_WHEN_PATH_NULL = "ER_FRAG_WHEN_PATH_NULL";
- public static final String ER_FRAG_INVALID_CHAR = "ER_FRAG_INVALID_CHAR";
- public static final String ER_PARSER_IN_USE = "ER_PARSER_IN_USE";
- public static final String ER_CANNOT_CHANGE_WHILE_PARSING = "ER_CANNOT_CHANGE_WHILE_PARSING";
- public static final String ER_SELF_CAUSATION_NOT_PERMITTED = "ER_SELF_CAUSATION_NOT_PERMITTED";
- public static final String ER_NO_USERINFO_IF_NO_HOST = "ER_NO_USERINFO_IF_NO_HOST";
- public static final String ER_NO_PORT_IF_NO_HOST = "ER_NO_PORT_IF_NO_HOST";
- public static final String ER_NO_QUERY_STRING_IN_PATH = "ER_NO_QUERY_STRING_IN_PATH";
- public static final String ER_NO_FRAGMENT_STRING_IN_PATH = "ER_NO_FRAGMENT_STRING_IN_PATH";
- public static final String ER_CANNOT_INIT_URI_EMPTY_PARMS = "ER_CANNOT_INIT_URI_EMPTY_PARMS";
- public static final String ER_METHOD_NOT_SUPPORTED ="ER_METHOD_NOT_SUPPORTED";
- public static final String ER_INCRSAXSRCFILTER_NOT_RESTARTABLE = "ER_INCRSAXSRCFILTER_NOT_RESTARTABLE";
- public static final String ER_XMLRDR_NOT_BEFORE_STARTPARSE = "ER_XMLRDR_NOT_BEFORE_STARTPARSE";
- public static final String ER_AXIS_TRAVERSER_NOT_SUPPORTED = "ER_AXIS_TRAVERSER_NOT_SUPPORTED";
- public static final String ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER = "ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER";
- public static final String ER_SYSTEMID_UNKNOWN = "ER_SYSTEMID_UNKNOWN";
- public static final String ER_LOCATION_UNKNOWN = "ER_LOCATION_UNKNOWN";
- public static final String ER_PREFIX_MUST_RESOLVE = "ER_PREFIX_MUST_RESOLVE";
- public static final String ER_CREATEDOCUMENT_NOT_SUPPORTED = "ER_CREATEDOCUMENT_NOT_SUPPORTED";
- public static final String ER_CHILD_HAS_NO_OWNER_DOCUMENT = "ER_CHILD_HAS_NO_OWNER_DOCUMENT";
- public static final String ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT = "ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT";
- public static final String ER_CANT_OUTPUT_TEXT_BEFORE_DOC = "ER_CANT_OUTPUT_TEXT_BEFORE_DOC";
- public static final String ER_CANT_HAVE_MORE_THAN_ONE_ROOT = "ER_CANT_HAVE_MORE_THAN_ONE_ROOT";
- public static final String ER_ARG_LOCALNAME_NULL = "ER_ARG_LOCALNAME_NULL";
- public static final String ER_ARG_LOCALNAME_INVALID = "ER_ARG_LOCALNAME_INVALID";
- public static final String ER_ARG_PREFIX_INVALID = "ER_ARG_PREFIX_INVALID";
- public static final String ER_NAME_CANT_START_WITH_COLON = "ER_NAME_CANT_START_WITH_COLON";
-
- // Message keys used by the serializer
- public static final String ER_RESOURCE_COULD_NOT_FIND = "ER_RESOURCE_COULD_NOT_FIND";
- public static final String ER_RESOURCE_COULD_NOT_LOAD = "ER_RESOURCE_COULD_NOT_LOAD";
- public static final String ER_BUFFER_SIZE_LESSTHAN_ZERO = "ER_BUFFER_SIZE_LESSTHAN_ZERO";
- public static final String ER_INVALID_UTF16_SURROGATE = "ER_INVALID_UTF16_SURROGATE";
- public static final String ER_OIERROR = "ER_OIERROR";
- public static final String ER_NAMESPACE_PREFIX = "ER_NAMESPACE_PREFIX";
- public static final String ER_STRAY_ATTRIBUTE = "ER_STRAY_ATTIRBUTE";
- public static final String ER_STRAY_NAMESPACE = "ER_STRAY_NAMESPACE";
- public static final String ER_COULD_NOT_LOAD_RESOURCE = "ER_COULD_NOT_LOAD_RESOURCE";
- public static final String ER_COULD_NOT_LOAD_METHOD_PROPERTY = "ER_COULD_NOT_LOAD_METHOD_PROPERTY";
- public static final String ER_SERIALIZER_NOT_CONTENTHANDLER = "ER_SERIALIZER_NOT_CONTENTHANDLER";
- public static final String ER_ILLEGAL_ATTRIBUTE_POSITION = "ER_ILLEGAL_ATTRIBUTE_POSITION";
- public static final String ER_ILLEGAL_CHARACTER = "ER_ILLEGAL_CHARACTER";
-
- /*
- * Now fill in the message text.
- * Then fill in the message text for that message code in the
- * array. Use the new error code as the index into the array.
- */
-
- // Error messages...
-
- /** The lookup table for error messages. */
- private static final Object[][] contents = {
-
- /** Error message ID that has a null message, but takes in a single object. */
- {"ER0000" , "{0}" },
-
- { ER_FUNCTION_NOT_SUPPORTED,
- "Fun\u00E7\u00E3o n\u00E3o suportada!"},
-
- { ER_CANNOT_OVERWRITE_CAUSE,
- "N\u00E3o \u00E9 poss\u00EDvel substituir a causa"},
-
- { ER_NO_DEFAULT_IMPL,
- "Nenhuma implementa\u00E7\u00E3o padr\u00E3o encontrada "},
-
- { ER_CHUNKEDINTARRAY_NOT_SUPPORTED,
- "ChunkedIntArray({0}) n\u00E3o suportado atualmente"},
-
- { ER_OFFSET_BIGGER_THAN_SLOT,
- "Deslocamento maior que o slot"},
-
- { ER_COROUTINE_NOT_AVAIL,
- "Co-rotina n\u00E3o dispon\u00EDvel, id={0}"},
-
- { ER_COROUTINE_CO_EXIT,
- "CoroutineManager recebeu a solicita\u00E7\u00E3o co_exit()"},
-
- { ER_COJOINROUTINESET_FAILED,
- "Falha em co_joinCoroutineSet()"},
-
- { ER_COROUTINE_PARAM,
- "Erro no par\u00E2metro da co-rotina ({0})"},
-
- { ER_PARSER_DOTERMINATE_ANSWERS,
- "\nINESPERADO: Parser doTerminate responde {0}"},
-
- { ER_NO_PARSE_CALL_WHILE_PARSING,
- "o parsing n\u00E3o pode ser chamado durante o parsing"},
-
- { ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED,
- "Erro: iterador digitado para o eixo {0} n\u00E3o implementado"},
-
- { ER_ITERATOR_AXIS_NOT_IMPLEMENTED,
- "Erro: iterador para o eixo {0} n\u00E3o implementado "},
-
- { ER_ITERATOR_CLONE_NOT_SUPPORTED,
- "clonagem do iterador n\u00E3o suportada"},
-
- { ER_UNKNOWN_AXIS_TYPE,
- "Tipo transversal de eixo desconhecido: {0}"},
-
- { ER_AXIS_NOT_SUPPORTED,
- "Transversor de eixo n\u00E3o suportado: {0}"},
-
- { ER_NO_DTMIDS_AVAIL,
- "N\u00E3o h\u00E1 mais IDs de DTM dispon\u00EDveis"},
-
- { ER_NOT_SUPPORTED,
- "N\u00E3o suportado: {0}"},
-
- { ER_NODE_NON_NULL,
- "O n\u00F3 deve ser n\u00E3o-nulo para getDTMHandleFromNode"},
-
- { ER_COULD_NOT_RESOLVE_NODE,
- "N\u00E3o foi poss\u00EDvel resolver o n\u00F3 para um handle"},
-
- { ER_STARTPARSE_WHILE_PARSING,
- "startParse n\u00E3o pode ser chamado durante o parsing"},
-
- { ER_STARTPARSE_NEEDS_SAXPARSER,
- "startParse requer um SAXParser n\u00E3o nulo"},
-
- { ER_COULD_NOT_INIT_PARSER,
- "n\u00E3o foi poss\u00EDvel inicializar o parser com"},
-
- { ER_EXCEPTION_CREATING_POOL,
- "exce\u00E7\u00E3o ao criar a nova inst\u00E2ncia do pool"},
-
- { ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE,
- "O caminho cont\u00E9m uma sequ\u00EAncia inv\u00E1lida de caracteres de escape"},
-
- { ER_SCHEME_REQUIRED,
- "O esquema \u00E9 obrigat\u00F3rio!"},
-
- { ER_NO_SCHEME_IN_URI,
- "Nenhum esquema encontrado no URI: {0}"},
-
- { ER_NO_SCHEME_INURI,
- "Nenhum esquema encontrado no URI"},
-
- { ER_PATH_INVALID_CHAR,
- "O caminho cont\u00E9m um caractere inv\u00E1lido: {0}"},
-
- { ER_SCHEME_FROM_NULL_STRING,
- "N\u00E3o \u00E9 poss\u00EDvel definir o esquema de uma string nula"},
-
- { ER_SCHEME_NOT_CONFORMANT,
- "O esquema n\u00E3o \u00E9 compat\u00EDvel."},
-
- { ER_HOST_ADDRESS_NOT_WELLFORMED,
- "O host n\u00E3o \u00E9 um endere\u00E7o correto"},
-
- { ER_PORT_WHEN_HOST_NULL,
- "A porta n\u00E3o pode ser definida quando o host \u00E9 nulo"},
-
- { ER_INVALID_PORT,
- "N\u00FAmero de porta inv\u00E1lido"},
-
- { ER_FRAG_FOR_GENERIC_URI,
- "O fragmento s\u00F3 pode ser definido para um URI gen\u00E9rico"},
-
- { ER_FRAG_WHEN_PATH_NULL,
- "O fragmento n\u00E3o pode ser definido quando o caminho \u00E9 nulo"},
-
- { ER_FRAG_INVALID_CHAR,
- "O fragmento cont\u00E9m um caractere inv\u00E1lido"},
-
- { ER_PARSER_IN_USE,
- "O parser j\u00E1 est\u00E1 sendo usado"},
-
- { ER_CANNOT_CHANGE_WHILE_PARSING,
- "N\u00E3o \u00E9 poss\u00EDvel alterar {0} {1} durante o parsing"},
-
- { ER_SELF_CAUSATION_NOT_PERMITTED,
- "Autoaverigua\u00E7\u00E3o n\u00E3o permitida"},
-
- { ER_NO_USERINFO_IF_NO_HOST,
- "As informa\u00E7\u00F5es do usu\u00E1rio n\u00E3o podem ser especificadas se o host n\u00E3o tiver sido especificado"},
-
- { ER_NO_PORT_IF_NO_HOST,
- "A porta n\u00E3o pode ser especificada se o host n\u00E3o tiver sido especificado"},
-
- { ER_NO_QUERY_STRING_IN_PATH,
- "A string de consulta n\u00E3o pode ser especificada no caminho nem na string de consulta"},
-
- { ER_NO_FRAGMENT_STRING_IN_PATH,
- "O fragmento n\u00E3o pode ser especificado no caminho nem no fragmento"},
-
- { ER_CANNOT_INIT_URI_EMPTY_PARMS,
- "N\u00E3o \u00E9 poss\u00EDvel inicializar o URI com par\u00E2metros vazios"},
-
- { ER_METHOD_NOT_SUPPORTED,
- "M\u00E9todo ainda n\u00E3o suportado "},
-
- { ER_INCRSAXSRCFILTER_NOT_RESTARTABLE,
- "IncrementalSAXSource_Filter atualmente n\u00E3o reinicializ\u00E1vel"},
-
- { ER_XMLRDR_NOT_BEFORE_STARTPARSE,
- "XMLReader n\u00E3o anterior \u00E0 solicita\u00E7\u00E3o de startParse"},
-
- { ER_AXIS_TRAVERSER_NOT_SUPPORTED,
- "Transversor de eixo n\u00E3o suportado: {0}"},
-
- { ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER,
- "ListingErrorHandler criado com PrintWriter nulo!"},
-
- { ER_SYSTEMID_UNKNOWN,
- "SystemId Desconhecido"},
-
- { ER_LOCATION_UNKNOWN,
- "Localiza\u00E7\u00E3o de erro desconhecida"},
-
- { ER_PREFIX_MUST_RESOLVE,
- "O prefixo deve ser resolvido para um namespace: {0}"},
-
- { ER_CREATEDOCUMENT_NOT_SUPPORTED,
- "createDocument() n\u00E3o suportado no XPathContext!"},
-
- { ER_CHILD_HAS_NO_OWNER_DOCUMENT,
- "O filho do atributo n\u00E3o tem um documento do propriet\u00E1rio!"},
-
- { ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT,
- "O filho do atributo n\u00E3o tem um elemento do documento do propriet\u00E1rio!"},
-
- { ER_CANT_OUTPUT_TEXT_BEFORE_DOC,
- "Advert\u00EAncia: n\u00E3o pode haver texto antes do elemento do documento! Ignorando..."},
-
- { ER_CANT_HAVE_MORE_THAN_ONE_ROOT,
- "N\u00E3o pode ter mais de uma raiz em um DOM!"},
-
- { ER_ARG_LOCALNAME_NULL,
- "O argumento 'localName' \u00E9 nulo"},
-
- // Note to translators: A QNAME has the syntactic form [NCName:]NCName
- // The localname is the portion after the optional colon; the message indicates
- // that there is a problem with that part of the QNAME.
- { ER_ARG_LOCALNAME_INVALID,
- "Localname em QNAME deve ser um NCName v\u00E1lido"},
-
- // Note to translators: A QNAME has the syntactic form [NCName:]NCName
- // The prefix is the portion before the optional colon; the message indicates
- // that there is a problem with that part of the QNAME.
- { ER_ARG_PREFIX_INVALID,
- "O prefixo em QNAME deve ser um NCName v\u00E1lido"},
-
- { ER_NAME_CANT_START_WITH_COLON,
- "O nome n\u00E3o pode come\u00E7ar com dois pontos"},
-
- { "BAD_CODE", "O par\u00E2metro para createMessage estava fora dos limites"},
- { "FORMAT_FAILED", "Exce\u00E7\u00E3o gerada durante a chamada messageFormat"},
- { "line", "N\u00B0 da Linha"},
- { "column","N\u00B0 da Coluna"},
-
- {ER_SERIALIZER_NOT_CONTENTHANDLER,
- "A classe ''{0}'' do serializador n\u00E3o implementa org.xml.sax.ContentHandler."},
-
- {ER_RESOURCE_COULD_NOT_FIND,
- "N\u00E3o foi poss\u00EDvel encontrar o recurso [ {0} ].\n {1}" },
-
- {ER_RESOURCE_COULD_NOT_LOAD,
- "O recurso [ {0} ] n\u00E3o foi carregado: {1} \n {2} \t {3}" },
-
- {ER_BUFFER_SIZE_LESSTHAN_ZERO,
- "Tamanho do buffer <=0" },
-
- {ER_INVALID_UTF16_SURROGATE,
- "Foi detectado um substituto de UTF-16 inv\u00E1lido: {0} ?" },
-
- {ER_OIERROR,
- "Erro de E/S" },
-
- {ER_ILLEGAL_ATTRIBUTE_POSITION,
- "N\u00E3o \u00E9 poss\u00EDvel adicionar o atributo {0} depois dos n\u00F3s filhos ou antes que um elemento seja produzido. O atributo ser\u00E1 ignorado."},
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- {ER_NAMESPACE_PREFIX,
- "O namespace do prefixo ''{0}'' n\u00E3o foi declarado." },
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- {ER_STRAY_ATTRIBUTE,
- "Atributo ''{0}'' fora do elemento." },
-
- /*
- * Note to translators: As with the preceding message, a namespace
- * declaration has the form of an attribute and is only permitted to
- * appear on an element. The substitution text {0} is the namespace
- * prefix and {1} is the URI that was being used in the erroneous
- * namespace declaration.
- */
- {ER_STRAY_NAMESPACE,
- "Declara\u00E7\u00E3o de namespace ''{0}''=''{1}'' fora do elemento." },
-
- {ER_COULD_NOT_LOAD_RESOURCE,
- "N\u00E3o foi poss\u00EDvel carregar ''{0}'' (verificar CLASSPATH); usando agora apenas os padr\u00F5es"},
-
- { ER_ILLEGAL_CHARACTER,
- "Tentativa de exibir um caractere de valor integral {0} que n\u00E3o est\u00E1 representado na codifica\u00E7\u00E3o de sa\u00EDda especificada de {1}."},
-
- {ER_COULD_NOT_LOAD_METHOD_PROPERTY,
- "N\u00E3o foi poss\u00EDvel carregar o arquivo de propriedade ''{0}'' para o m\u00E9todo de sa\u00EDda ''{1}'' (verificar CLASSPATH)" }
-
-
- };
-
- /**
- * Get the association list.
- *
- * @return The association list.
- */
-
- protected Object[][] getContents() {
- return contents;
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_sk.java b/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_sk.java
deleted file mode 100644
index 1e4b293..0000000
--- a/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_sk.java
+++ /dev/null
@@ -1,443 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XMLErrorResources_sk.java,v 1.1.6.2 2005/09/15 07:45:45 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.res;
-
-
-import java.util.ListResourceBundle;
-
-/**
- * Set up error messages.
- * We build a two dimensional array of message keys and
- * message strings. In order to add a new message here,
- * you need to first add a String constant. And you need
- * to enter key, value pair as part of the contents
- * array. You also need to update MAX_CODE for error strings
- * and MAX_WARNING for warnings ( Needed for only information
- * purpose )
- */
-public class XMLErrorResources_sk extends ListResourceBundle
-{
-
-/*
- * This file contains error and warning messages related to Xalan Error
- * Handling.
- *
- * General notes to translators:
- *
- * 1) Xalan (or more properly, Xalan-interpretive) and XSLTC are names of
- * components.
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- * XSLTC is an acronym for XSLT Compiler.
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 5) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 6) "Translet" is an invented term that describes the class file that
- * results from compiling an XML stylesheet into a Java class.
- *
- * 7) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- */
-
- /** Maximum error messages, this is needed to keep track of the number of messages. */
- public static final int MAX_CODE = 61;
-
- /** Maximum warnings, this is needed to keep track of the number of warnings. */
- public static final int MAX_WARNING = 0;
-
- /** Maximum misc strings. */
- public static final int MAX_OTHERS = 4;
-
- /** Maximum total warnings and error messages. */
- public static final int MAX_MESSAGES = MAX_CODE + MAX_WARNING + 1;
-
-
- /*
- * Message keys
- */
- public static final String ER_FUNCTION_NOT_SUPPORTED = "ER_FUNCTION_NOT_SUPPORTED";
- public static final String ER_CANNOT_OVERWRITE_CAUSE = "ER_CANNOT_OVERWRITE_CAUSE";
- public static final String ER_NO_DEFAULT_IMPL = "ER_NO_DEFAULT_IMPL";
- public static final String ER_CHUNKEDINTARRAY_NOT_SUPPORTED = "ER_CHUNKEDINTARRAY_NOT_SUPPORTED";
- public static final String ER_OFFSET_BIGGER_THAN_SLOT = "ER_OFFSET_BIGGER_THAN_SLOT";
- public static final String ER_COROUTINE_NOT_AVAIL = "ER_COROUTINE_NOT_AVAIL";
- public static final String ER_COROUTINE_CO_EXIT = "ER_COROUTINE_CO_EXIT";
- public static final String ER_COJOINROUTINESET_FAILED = "ER_COJOINROUTINESET_FAILED";
- public static final String ER_COROUTINE_PARAM = "ER_COROUTINE_PARAM";
- public static final String ER_PARSER_DOTERMINATE_ANSWERS = "ER_PARSER_DOTERMINATE_ANSWERS";
- public static final String ER_NO_PARSE_CALL_WHILE_PARSING = "ER_NO_PARSE_CALL_WHILE_PARSING";
- public static final String ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED = "ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED";
- public static final String ER_ITERATOR_AXIS_NOT_IMPLEMENTED = "ER_ITERATOR_AXIS_NOT_IMPLEMENTED";
- public static final String ER_ITERATOR_CLONE_NOT_SUPPORTED = "ER_ITERATOR_CLONE_NOT_SUPPORTED";
- public static final String ER_UNKNOWN_AXIS_TYPE = "ER_UNKNOWN_AXIS_TYPE";
- public static final String ER_AXIS_NOT_SUPPORTED = "ER_AXIS_NOT_SUPPORTED";
- public static final String ER_NO_DTMIDS_AVAIL = "ER_NO_DTMIDS_AVAIL";
- public static final String ER_NOT_SUPPORTED = "ER_NOT_SUPPORTED";
- public static final String ER_NODE_NON_NULL = "ER_NODE_NON_NULL";
- public static final String ER_COULD_NOT_RESOLVE_NODE = "ER_COULD_NOT_RESOLVE_NODE";
- public static final String ER_STARTPARSE_WHILE_PARSING = "ER_STARTPARSE_WHILE_PARSING";
- public static final String ER_STARTPARSE_NEEDS_SAXPARSER = "ER_STARTPARSE_NEEDS_SAXPARSER";
- public static final String ER_COULD_NOT_INIT_PARSER = "ER_COULD_NOT_INIT_PARSER";
- public static final String ER_EXCEPTION_CREATING_POOL = "ER_EXCEPTION_CREATING_POOL";
- public static final String ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE = "ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE";
- public static final String ER_SCHEME_REQUIRED = "ER_SCHEME_REQUIRED";
- public static final String ER_NO_SCHEME_IN_URI = "ER_NO_SCHEME_IN_URI";
- public static final String ER_NO_SCHEME_INURI = "ER_NO_SCHEME_INURI";
- public static final String ER_PATH_INVALID_CHAR = "ER_PATH_INVALID_CHAR";
- public static final String ER_SCHEME_FROM_NULL_STRING = "ER_SCHEME_FROM_NULL_STRING";
- public static final String ER_SCHEME_NOT_CONFORMANT = "ER_SCHEME_NOT_CONFORMANT";
- public static final String ER_HOST_ADDRESS_NOT_WELLFORMED = "ER_HOST_ADDRESS_NOT_WELLFORMED";
- public static final String ER_PORT_WHEN_HOST_NULL = "ER_PORT_WHEN_HOST_NULL";
- public static final String ER_INVALID_PORT = "ER_INVALID_PORT";
- public static final String ER_FRAG_FOR_GENERIC_URI ="ER_FRAG_FOR_GENERIC_URI";
- public static final String ER_FRAG_WHEN_PATH_NULL = "ER_FRAG_WHEN_PATH_NULL";
- public static final String ER_FRAG_INVALID_CHAR = "ER_FRAG_INVALID_CHAR";
- public static final String ER_PARSER_IN_USE = "ER_PARSER_IN_USE";
- public static final String ER_CANNOT_CHANGE_WHILE_PARSING = "ER_CANNOT_CHANGE_WHILE_PARSING";
- public static final String ER_SELF_CAUSATION_NOT_PERMITTED = "ER_SELF_CAUSATION_NOT_PERMITTED";
- public static final String ER_NO_USERINFO_IF_NO_HOST = "ER_NO_USERINFO_IF_NO_HOST";
- public static final String ER_NO_PORT_IF_NO_HOST = "ER_NO_PORT_IF_NO_HOST";
- public static final String ER_NO_QUERY_STRING_IN_PATH = "ER_NO_QUERY_STRING_IN_PATH";
- public static final String ER_NO_FRAGMENT_STRING_IN_PATH = "ER_NO_FRAGMENT_STRING_IN_PATH";
- public static final String ER_CANNOT_INIT_URI_EMPTY_PARMS = "ER_CANNOT_INIT_URI_EMPTY_PARMS";
- public static final String ER_METHOD_NOT_SUPPORTED ="ER_METHOD_NOT_SUPPORTED";
- public static final String ER_INCRSAXSRCFILTER_NOT_RESTARTABLE = "ER_INCRSAXSRCFILTER_NOT_RESTARTABLE";
- public static final String ER_XMLRDR_NOT_BEFORE_STARTPARSE = "ER_XMLRDR_NOT_BEFORE_STARTPARSE";
- public static final String ER_AXIS_TRAVERSER_NOT_SUPPORTED = "ER_AXIS_TRAVERSER_NOT_SUPPORTED";
- public static final String ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER = "ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER";
- public static final String ER_SYSTEMID_UNKNOWN = "ER_SYSTEMID_UNKNOWN";
- public static final String ER_LOCATION_UNKNOWN = "ER_LOCATION_UNKNOWN";
- public static final String ER_PREFIX_MUST_RESOLVE = "ER_PREFIX_MUST_RESOLVE";
- public static final String ER_CREATEDOCUMENT_NOT_SUPPORTED = "ER_CREATEDOCUMENT_NOT_SUPPORTED";
- public static final String ER_CHILD_HAS_NO_OWNER_DOCUMENT = "ER_CHILD_HAS_NO_OWNER_DOCUMENT";
- public static final String ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT = "ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT";
- public static final String ER_CANT_OUTPUT_TEXT_BEFORE_DOC = "ER_CANT_OUTPUT_TEXT_BEFORE_DOC";
- public static final String ER_CANT_HAVE_MORE_THAN_ONE_ROOT = "ER_CANT_HAVE_MORE_THAN_ONE_ROOT";
- public static final String ER_ARG_LOCALNAME_NULL = "ER_ARG_LOCALNAME_NULL";
- public static final String ER_ARG_LOCALNAME_INVALID = "ER_ARG_LOCALNAME_INVALID";
- public static final String ER_ARG_PREFIX_INVALID = "ER_ARG_PREFIX_INVALID";
-
- // Message keys used by the serializer
- public static final String ER_RESOURCE_COULD_NOT_FIND = "ER_RESOURCE_COULD_NOT_FIND";
- public static final String ER_RESOURCE_COULD_NOT_LOAD = "ER_RESOURCE_COULD_NOT_LOAD";
- public static final String ER_BUFFER_SIZE_LESSTHAN_ZERO = "ER_BUFFER_SIZE_LESSTHAN_ZERO";
- public static final String ER_INVALID_UTF16_SURROGATE = "ER_INVALID_UTF16_SURROGATE";
- public static final String ER_OIERROR = "ER_OIERROR";
- public static final String ER_NAMESPACE_PREFIX = "ER_NAMESPACE_PREFIX";
- public static final String ER_STRAY_ATTRIBUTE = "ER_STRAY_ATTIRBUTE";
- public static final String ER_STRAY_NAMESPACE = "ER_STRAY_NAMESPACE";
- public static final String ER_COULD_NOT_LOAD_RESOURCE = "ER_COULD_NOT_LOAD_RESOURCE";
- public static final String ER_COULD_NOT_LOAD_METHOD_PROPERTY = "ER_COULD_NOT_LOAD_METHOD_PROPERTY";
- public static final String ER_SERIALIZER_NOT_CONTENTHANDLER = "ER_SERIALIZER_NOT_CONTENTHANDLER";
- public static final String ER_ILLEGAL_ATTRIBUTE_POSITION = "ER_ILLEGAL_ATTRIBUTE_POSITION";
-
- /*
- * Now fill in the message text.
- * Then fill in the message text for that message code in the
- * array. Use the new error code as the index into the array.
- */
-
- // Error messages...
- private static final Object[][] _contents = new Object[][] {
-
- /** Error message ID that has a null message, but takes in a single object. */
- {"ER0000" , "{0}" },
-
- { ER_FUNCTION_NOT_SUPPORTED,
- "Funkcia nie je podporovan\u00e1!"},
-
- { ER_CANNOT_OVERWRITE_CAUSE,
- "Nie je mo\u017en\u00e9 prep\u00edsa\u0165 pr\u00ed\u010dinu"},
-
- { ER_NO_DEFAULT_IMPL,
- "Nebola n\u00e1jden\u00e1 \u017eiadna predvolen\u00e1 implement\u00e1cia "},
-
- { ER_CHUNKEDINTARRAY_NOT_SUPPORTED,
- "ChunkedIntArray({0}) nie je moment\u00e1lne podporovan\u00fd"},
-
- { ER_OFFSET_BIGGER_THAN_SLOT,
- "Offset v\u00e4\u010d\u0161\u00ed, ne\u017e z\u00e1suvka"},
-
- { ER_COROUTINE_NOT_AVAIL,
- "Korutina nie je dostupn\u00e1, id={0}"},
-
- { ER_COROUTINE_CO_EXIT,
- "CoroutineManager obdr\u017eal po\u017eiadavku co_exit()"},
-
- { ER_COJOINROUTINESET_FAILED,
- "zlyhal co_joinCoroutineSet()"},
-
- { ER_COROUTINE_PARAM,
- "Chyba parametra korutiny ({0})"},
-
- { ER_PARSER_DOTERMINATE_ANSWERS,
- "\nNEO\u010cAK\u00c1VAN\u00c9: Analyz\u00e1tor doTerminate odpoved\u00e1 {0}"},
-
- { ER_NO_PARSE_CALL_WHILE_PARSING,
- "syntaktick\u00fd analyz\u00e1tor nem\u00f4\u017ee by\u0165 volan\u00fd po\u010das vykon\u00e1vania anal\u00fdzy"},
-
- { ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED,
- "Chyba: nap\u00edsan\u00fd iter\u00e1tor pre os {0} nie je implementovan\u00fd"},
-
- { ER_ITERATOR_AXIS_NOT_IMPLEMENTED,
- "Chyba: iter\u00e1tor pre os {0} nie je implementovan\u00fd "},
-
- { ER_ITERATOR_CLONE_NOT_SUPPORTED,
- "Klon iter\u00e1tora nie je podporovan\u00fd"},
-
- { ER_UNKNOWN_AXIS_TYPE,
- "Nezn\u00e1my typ pret\u00ednania os\u00ed: {0}"},
-
- { ER_AXIS_NOT_SUPPORTED,
- "Pret\u00ednanie os\u00ed nie je podporovan\u00e9: {0}"},
-
- { ER_NO_DTMIDS_AVAIL,
- "\u017diadne \u010fal\u0161ie DTM ID nie s\u00fa dostupn\u00e9"},
-
- { ER_NOT_SUPPORTED,
- "Nie je podporovan\u00e9: {0}"},
-
- { ER_NODE_NON_NULL,
- "Pre getDTMHandleFromNode mus\u00ed by\u0165 uzol nenulov\u00fd"},
-
- { ER_COULD_NOT_RESOLVE_NODE,
- "Nebolo mo\u017en\u00e9 ur\u010di\u0165 uzol na spracovanie"},
-
- { ER_STARTPARSE_WHILE_PARSING,
- "startParse nem\u00f4\u017ee by\u0165 volan\u00fd po\u010das vykon\u00e1vania anal\u00fdzy"},
-
- { ER_STARTPARSE_NEEDS_SAXPARSER,
- "startParse potrebuje nenulov\u00fd SAXParser"},
-
- { ER_COULD_NOT_INIT_PARSER,
- "nebolo mo\u017en\u00e9 inicializova\u0165 syntaktick\u00fd analyz\u00e1tor pomocou"},
-
- { ER_EXCEPTION_CREATING_POOL,
- "v\u00fdnimka vytv\u00e1rania novej in\u0161tancie oblasti"},
-
- { ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE,
- "Cesta obsahuje neplatn\u00fa \u00fanikov\u00fa sekvenciu"},
-
- { ER_SCHEME_REQUIRED,
- "Je po\u017eadovan\u00e1 sch\u00e9ma!"},
-
- { ER_NO_SCHEME_IN_URI,
- "V URI sa nena\u0161la \u017eiadna sch\u00e9ma: {0}"},
-
- { ER_NO_SCHEME_INURI,
- "V URI nebola n\u00e1jden\u00e1 \u017eiadna sch\u00e9ma"},
-
- { ER_PATH_INVALID_CHAR,
- "Cesta obsahuje neplatn\u00fd znak: {0}"},
-
- { ER_SCHEME_FROM_NULL_STRING,
- "Nie je mo\u017en\u00e9 stanovi\u0165 sch\u00e9mu z nulov\u00e9ho re\u0165azca"},
-
- { ER_SCHEME_NOT_CONFORMANT,
- "Nezhodn\u00e1 sch\u00e9ma."},
-
- { ER_HOST_ADDRESS_NOT_WELLFORMED,
- "Hostite\u013e nie je spr\u00e1vne form\u00e1tovan\u00e1 adresa"},
-
- { ER_PORT_WHEN_HOST_NULL,
- "Nem\u00f4\u017ee by\u0165 stanoven\u00fd port, ak je hostite\u013e null"},
-
- { ER_INVALID_PORT,
- "Neplatn\u00e9 \u010d\u00edslo portu"},
-
- { ER_FRAG_FOR_GENERIC_URI,
- "Fragment m\u00f4\u017ee by\u0165 stanoven\u00fd len pre v\u0161eobecn\u00e9 URI"},
-
- { ER_FRAG_WHEN_PATH_NULL,
- "Ak je cesta nulov\u00e1, nem\u00f4\u017ee by\u0165 stanoven\u00fd fragment"},
-
- { ER_FRAG_INVALID_CHAR,
- "Fragment obsahuje neplatn\u00fd znak"},
-
- { ER_PARSER_IN_USE,
- "Syntaktick\u00fd analyz\u00e1tor je u\u017e pou\u017e\u00edvan\u00fd"},
-
- { ER_CANNOT_CHANGE_WHILE_PARSING,
- "Nie je mo\u017en\u00e9 zmeni\u0165 {0} {1} po\u010das vykon\u00e1vania anal\u00fdzy"},
-
- { ER_SELF_CAUSATION_NOT_PERMITTED,
- "Samozapr\u00ed\u010dinenie nie je povolen\u00e9"},
-
- { ER_NO_USERINFO_IF_NO_HOST,
- "Ak nebol zadan\u00fd hostite\u013e, mo\u017eno nebolo zadan\u00e9 userinfo"},
-
- { ER_NO_PORT_IF_NO_HOST,
- "Ak nebol zadan\u00fd hostite\u013e, mo\u017eno nebol zadan\u00fd port"},
-
- { ER_NO_QUERY_STRING_IN_PATH,
- "Re\u0165azec dotazu nem\u00f4\u017ee by\u0165 zadan\u00fd v ceste a re\u0165azci dotazu"},
-
- { ER_NO_FRAGMENT_STRING_IN_PATH,
- "Fragment nem\u00f4\u017ee by\u0165 zadan\u00fd v ceste, ani vo fragmente"},
-
- { ER_CANNOT_INIT_URI_EMPTY_PARMS,
- "Nie je mo\u017en\u00e9 inicializova\u0165 URI s pr\u00e1zdnymi parametrami"},
-
- { ER_METHOD_NOT_SUPPORTED,
- "Met\u00f3da e\u0161te nie je podporovan\u00e1 "},
-
- { ER_INCRSAXSRCFILTER_NOT_RESTARTABLE,
- "IncrementalSAXSource_Filter nie je moment\u00e1lne re\u0161tartovate\u013en\u00fd"},
-
- { ER_XMLRDR_NOT_BEFORE_STARTPARSE,
- "XMLReader nepredch\u00e1dza po\u017eiadavke na startParse"},
-
- { ER_AXIS_TRAVERSER_NOT_SUPPORTED,
- "Pret\u00ednanie os\u00ed nie je podporovan\u00e9: {0}"},
-
- { ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER,
- "ListingErrorHandler vytvoren\u00fd s nulov\u00fdm PrintWriter!"},
-
- { ER_SYSTEMID_UNKNOWN,
- "Nezn\u00e1me SystemId"},
-
- { ER_LOCATION_UNKNOWN,
- "Nezn\u00e1me miesto v\u00fdskytu chyby"},
-
- { ER_PREFIX_MUST_RESOLVE,
- "Predpona sa mus\u00ed rozl\u00ed\u0161i\u0165 do n\u00e1zvov\u00e9ho priestoru: {0}"},
-
- { ER_CREATEDOCUMENT_NOT_SUPPORTED,
- "createDocument() nie je podporovan\u00e9 XPathContext!"},
-
- { ER_CHILD_HAS_NO_OWNER_DOCUMENT,
- "Potomok atrib\u00fatu nem\u00e1 dokument vlastn\u00edka!"},
-
- { ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT,
- "Potomok atrib\u00fatu nem\u00e1 s\u00fa\u010das\u0165 dokumentu vlastn\u00edka!"},
-
- { ER_CANT_OUTPUT_TEXT_BEFORE_DOC,
- "Upozornenie: nemo\u017eno vypusti\u0165 text pred elementom dokumentu! Ignorovanie..."},
-
- { ER_CANT_HAVE_MORE_THAN_ONE_ROOT,
- "Nie je mo\u017en\u00e9 ma\u0165 viac, ne\u017e jeden kore\u0148 DOM!"},
-
- { ER_ARG_LOCALNAME_NULL,
- "Argument 'localName' je null"},
-
- // Note to translators: A QNAME has the syntactic form [NCName:]NCName
- // The localname is the portion after the optional colon; the message indicates
- // that there is a problem with that part of the QNAME.
- { ER_ARG_LOCALNAME_INVALID,
- "Lok\u00e1lny n\u00e1zov v QNAME by mal by\u0165 platn\u00fdm NCName"},
-
- // Note to translators: A QNAME has the syntactic form [NCName:]NCName
- // The prefix is the portion before the optional colon; the message indicates
- // that there is a problem with that part of the QNAME.
- { ER_ARG_PREFIX_INVALID,
- "Predpona v QNAME by mala by\u0165 platn\u00fdm NCName"},
-
- { "BAD_CODE", "Parameter na createMessage bol mimo ohrani\u010denia"},
- { "FORMAT_FAILED", "V\u00fdnimka po\u010das volania messageFormat"},
- { "line", "Riadok #"},
- { "column","St\u013apec #"},
-
- {ER_SERIALIZER_NOT_CONTENTHANDLER,
- "Trieda serializ\u00e1tora ''{0}'' neimplementuje org.xml.sax.ContentHandler."},
-
- {ER_RESOURCE_COULD_NOT_FIND,
- "Prostriedok [ {0} ] nemohol by\u0165 n\u00e1jden\u00fd.\n {1}" },
-
- {ER_RESOURCE_COULD_NOT_LOAD,
- "Prostriedok [ {0} ] sa nedal na\u010d\u00edta\u0165: {1} \n {2} \t {3}" },
-
- {ER_BUFFER_SIZE_LESSTHAN_ZERO,
- "Ve\u013ekos\u0165 vyrovn\u00e1vacej pam\u00e4te <=0" },
-
- {ER_INVALID_UTF16_SURROGATE,
- "Bolo zisten\u00e9 neplatn\u00e9 nahradenie UTF-16: {0} ?" },
-
- {ER_OIERROR,
- "chyba IO" },
-
- {ER_ILLEGAL_ATTRIBUTE_POSITION,
- "Nie je mo\u017en\u00e9 prida\u0165 atrib\u00fat {0} po uzloch potomka alebo pred vytvoren\u00edm elementu. Atrib\u00fat bude ignorovan\u00fd."},
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- {ER_NAMESPACE_PREFIX,
- "N\u00e1zvov\u00fd priestor pre predponu ''{0}'' nebol deklarovan\u00fd." },
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- {ER_STRAY_ATTRIBUTE,
- "Atrib\u00fat ''{0}'' je mimo elementu." },
-
- /*
- * Note to translators: As with the preceding message, a namespace
- * declaration has the form of an attribute and is only permitted to
- * appear on an element. The substitution text {0} is the namespace
- * prefix and {1} is the URI that was being used in the erroneous
- * namespace declaration.
- */
- {ER_STRAY_NAMESPACE,
- "Deklar\u00e1cia n\u00e1zvov\u00e9ho priestoru ''{0}''=''{1}'' je mimo elementu." },
-
- {ER_COULD_NOT_LOAD_RESOURCE,
- "Nedalo sa na\u010d\u00edta\u0165 ''{0}'' (skontrolujte CLASSPATH), pou\u017e\u00edvaj\u00fa sa predvolen\u00e9 hodnoty"},
-
- {ER_COULD_NOT_LOAD_METHOD_PROPERTY,
- "Nedal sa na\u010d\u00edta\u0165 s\u00fabor vlastnost\u00ed ''{0}'' pre v\u00fdstupn\u00fa met\u00f3du ''{1}'' (skontrolujte CLASSPATH)" }
-
-
- };
-
- /**
- * Get the lookup table for error messages
- *
- * @return The association list.
- */
- public Object[][] getContents()
- {
- return _contents;
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_sv.java b/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_sv.java
deleted file mode 100644
index 7be3c6c..0000000
--- a/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_sv.java
+++ /dev/null
@@ -1,450 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xml.internal.res;
-
-
-import java.util.ListResourceBundle;
-
-/**
- * Set up error messages.
- * We build a two dimensional array of message keys and
- * message strings. In order to add a new message here,
- * you need to first add a String constant. And you need
- * to enter key, value pair as part of the contents
- * array. You also need to update MAX_CODE for error strings
- * and MAX_WARNING for warnings ( Needed for only information
- * purpose )
- */
-public class XMLErrorResources_sv extends ListResourceBundle
-{
-
-/*
- * This file contains error and warning messages related to Xalan Error
- * Handling.
- *
- * General notes to translators:
- *
- * 1) Xalan (or more properly, Xalan-interpretive) and XSLTC are names of
- * components.
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- * XSLTC is an acronym for XSLT Compiler.
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 5) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 6) "Translet" is an invented term that describes the class file that
- * results from compiling an XML stylesheet into a Java class.
- *
- * 7) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- */
-
- /** Maximum error messages, this is needed to keep track of the number of messages. */
- public static final int MAX_CODE = 61;
-
- /** Maximum warnings, this is needed to keep track of the number of warnings. */
- public static final int MAX_WARNING = 0;
-
- /** Maximum misc strings. */
- public static final int MAX_OTHERS = 4;
-
- /** Maximum total warnings and error messages. */
- public static final int MAX_MESSAGES = MAX_CODE + MAX_WARNING + 1;
-
-
- /*
- * Message keys
- */
- public static final String ER_FUNCTION_NOT_SUPPORTED = "ER_FUNCTION_NOT_SUPPORTED";
- public static final String ER_CANNOT_OVERWRITE_CAUSE = "ER_CANNOT_OVERWRITE_CAUSE";
- public static final String ER_NO_DEFAULT_IMPL = "ER_NO_DEFAULT_IMPL";
- public static final String ER_CHUNKEDINTARRAY_NOT_SUPPORTED = "ER_CHUNKEDINTARRAY_NOT_SUPPORTED";
- public static final String ER_OFFSET_BIGGER_THAN_SLOT = "ER_OFFSET_BIGGER_THAN_SLOT";
- public static final String ER_COROUTINE_NOT_AVAIL = "ER_COROUTINE_NOT_AVAIL";
- public static final String ER_COROUTINE_CO_EXIT = "ER_COROUTINE_CO_EXIT";
- public static final String ER_COJOINROUTINESET_FAILED = "ER_COJOINROUTINESET_FAILED";
- public static final String ER_COROUTINE_PARAM = "ER_COROUTINE_PARAM";
- public static final String ER_PARSER_DOTERMINATE_ANSWERS = "ER_PARSER_DOTERMINATE_ANSWERS";
- public static final String ER_NO_PARSE_CALL_WHILE_PARSING = "ER_NO_PARSE_CALL_WHILE_PARSING";
- public static final String ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED = "ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED";
- public static final String ER_ITERATOR_AXIS_NOT_IMPLEMENTED = "ER_ITERATOR_AXIS_NOT_IMPLEMENTED";
- public static final String ER_ITERATOR_CLONE_NOT_SUPPORTED = "ER_ITERATOR_CLONE_NOT_SUPPORTED";
- public static final String ER_UNKNOWN_AXIS_TYPE = "ER_UNKNOWN_AXIS_TYPE";
- public static final String ER_AXIS_NOT_SUPPORTED = "ER_AXIS_NOT_SUPPORTED";
- public static final String ER_NO_DTMIDS_AVAIL = "ER_NO_DTMIDS_AVAIL";
- public static final String ER_NOT_SUPPORTED = "ER_NOT_SUPPORTED";
- public static final String ER_NODE_NON_NULL = "ER_NODE_NON_NULL";
- public static final String ER_COULD_NOT_RESOLVE_NODE = "ER_COULD_NOT_RESOLVE_NODE";
- public static final String ER_STARTPARSE_WHILE_PARSING = "ER_STARTPARSE_WHILE_PARSING";
- public static final String ER_STARTPARSE_NEEDS_SAXPARSER = "ER_STARTPARSE_NEEDS_SAXPARSER";
- public static final String ER_COULD_NOT_INIT_PARSER = "ER_COULD_NOT_INIT_PARSER";
- public static final String ER_EXCEPTION_CREATING_POOL = "ER_EXCEPTION_CREATING_POOL";
- public static final String ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE = "ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE";
- public static final String ER_SCHEME_REQUIRED = "ER_SCHEME_REQUIRED";
- public static final String ER_NO_SCHEME_IN_URI = "ER_NO_SCHEME_IN_URI";
- public static final String ER_NO_SCHEME_INURI = "ER_NO_SCHEME_INURI";
- public static final String ER_PATH_INVALID_CHAR = "ER_PATH_INVALID_CHAR";
- public static final String ER_SCHEME_FROM_NULL_STRING = "ER_SCHEME_FROM_NULL_STRING";
- public static final String ER_SCHEME_NOT_CONFORMANT = "ER_SCHEME_NOT_CONFORMANT";
- public static final String ER_HOST_ADDRESS_NOT_WELLFORMED = "ER_HOST_ADDRESS_NOT_WELLFORMED";
- public static final String ER_PORT_WHEN_HOST_NULL = "ER_PORT_WHEN_HOST_NULL";
- public static final String ER_INVALID_PORT = "ER_INVALID_PORT";
- public static final String ER_FRAG_FOR_GENERIC_URI ="ER_FRAG_FOR_GENERIC_URI";
- public static final String ER_FRAG_WHEN_PATH_NULL = "ER_FRAG_WHEN_PATH_NULL";
- public static final String ER_FRAG_INVALID_CHAR = "ER_FRAG_INVALID_CHAR";
- public static final String ER_PARSER_IN_USE = "ER_PARSER_IN_USE";
- public static final String ER_CANNOT_CHANGE_WHILE_PARSING = "ER_CANNOT_CHANGE_WHILE_PARSING";
- public static final String ER_SELF_CAUSATION_NOT_PERMITTED = "ER_SELF_CAUSATION_NOT_PERMITTED";
- public static final String ER_NO_USERINFO_IF_NO_HOST = "ER_NO_USERINFO_IF_NO_HOST";
- public static final String ER_NO_PORT_IF_NO_HOST = "ER_NO_PORT_IF_NO_HOST";
- public static final String ER_NO_QUERY_STRING_IN_PATH = "ER_NO_QUERY_STRING_IN_PATH";
- public static final String ER_NO_FRAGMENT_STRING_IN_PATH = "ER_NO_FRAGMENT_STRING_IN_PATH";
- public static final String ER_CANNOT_INIT_URI_EMPTY_PARMS = "ER_CANNOT_INIT_URI_EMPTY_PARMS";
- public static final String ER_METHOD_NOT_SUPPORTED ="ER_METHOD_NOT_SUPPORTED";
- public static final String ER_INCRSAXSRCFILTER_NOT_RESTARTABLE = "ER_INCRSAXSRCFILTER_NOT_RESTARTABLE";
- public static final String ER_XMLRDR_NOT_BEFORE_STARTPARSE = "ER_XMLRDR_NOT_BEFORE_STARTPARSE";
- public static final String ER_AXIS_TRAVERSER_NOT_SUPPORTED = "ER_AXIS_TRAVERSER_NOT_SUPPORTED";
- public static final String ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER = "ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER";
- public static final String ER_SYSTEMID_UNKNOWN = "ER_SYSTEMID_UNKNOWN";
- public static final String ER_LOCATION_UNKNOWN = "ER_LOCATION_UNKNOWN";
- public static final String ER_PREFIX_MUST_RESOLVE = "ER_PREFIX_MUST_RESOLVE";
- public static final String ER_CREATEDOCUMENT_NOT_SUPPORTED = "ER_CREATEDOCUMENT_NOT_SUPPORTED";
- public static final String ER_CHILD_HAS_NO_OWNER_DOCUMENT = "ER_CHILD_HAS_NO_OWNER_DOCUMENT";
- public static final String ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT = "ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT";
- public static final String ER_CANT_OUTPUT_TEXT_BEFORE_DOC = "ER_CANT_OUTPUT_TEXT_BEFORE_DOC";
- public static final String ER_CANT_HAVE_MORE_THAN_ONE_ROOT = "ER_CANT_HAVE_MORE_THAN_ONE_ROOT";
- public static final String ER_ARG_LOCALNAME_NULL = "ER_ARG_LOCALNAME_NULL";
- public static final String ER_ARG_LOCALNAME_INVALID = "ER_ARG_LOCALNAME_INVALID";
- public static final String ER_ARG_PREFIX_INVALID = "ER_ARG_PREFIX_INVALID";
- public static final String ER_NAME_CANT_START_WITH_COLON = "ER_NAME_CANT_START_WITH_COLON";
-
- // Message keys used by the serializer
- public static final String ER_RESOURCE_COULD_NOT_FIND = "ER_RESOURCE_COULD_NOT_FIND";
- public static final String ER_RESOURCE_COULD_NOT_LOAD = "ER_RESOURCE_COULD_NOT_LOAD";
- public static final String ER_BUFFER_SIZE_LESSTHAN_ZERO = "ER_BUFFER_SIZE_LESSTHAN_ZERO";
- public static final String ER_INVALID_UTF16_SURROGATE = "ER_INVALID_UTF16_SURROGATE";
- public static final String ER_OIERROR = "ER_OIERROR";
- public static final String ER_NAMESPACE_PREFIX = "ER_NAMESPACE_PREFIX";
- public static final String ER_STRAY_ATTRIBUTE = "ER_STRAY_ATTIRBUTE";
- public static final String ER_STRAY_NAMESPACE = "ER_STRAY_NAMESPACE";
- public static final String ER_COULD_NOT_LOAD_RESOURCE = "ER_COULD_NOT_LOAD_RESOURCE";
- public static final String ER_COULD_NOT_LOAD_METHOD_PROPERTY = "ER_COULD_NOT_LOAD_METHOD_PROPERTY";
- public static final String ER_SERIALIZER_NOT_CONTENTHANDLER = "ER_SERIALIZER_NOT_CONTENTHANDLER";
- public static final String ER_ILLEGAL_ATTRIBUTE_POSITION = "ER_ILLEGAL_ATTRIBUTE_POSITION";
- public static final String ER_ILLEGAL_CHARACTER = "ER_ILLEGAL_CHARACTER";
-
- /*
- * Now fill in the message text.
- * Then fill in the message text for that message code in the
- * array. Use the new error code as the index into the array.
- */
-
- // Error messages...
-
- /** The lookup table for error messages. */
- private static final Object[][] contents = {
-
- /** Error message ID that has a null message, but takes in a single object. */
- {"ER0000" , "{0}" },
-
- { ER_FUNCTION_NOT_SUPPORTED,
- "Funktionen st\u00F6ds inte!"},
-
- { ER_CANNOT_OVERWRITE_CAUSE,
- "Orsak kan inte skrivas \u00F6ver"},
-
- { ER_NO_DEFAULT_IMPL,
- "Hittade ingen standardimplementering "},
-
- { ER_CHUNKEDINTARRAY_NOT_SUPPORTED,
- "ChunkedIntArray({0}) underst\u00F6ds f\u00F6r n\u00E4rvarande inte"},
-
- { ER_OFFSET_BIGGER_THAN_SLOT,
- "Offset st\u00F6rre \u00E4n plats"},
-
- { ER_COROUTINE_NOT_AVAIL,
- "Sidorutin \u00E4r inte tillg\u00E4nglig, id={0}"},
-
- { ER_COROUTINE_CO_EXIT,
- "CoroutineManager har tagit emot co_exit()-beg\u00E4ran"},
-
- { ER_COJOINROUTINESET_FAILED,
- "co_joinCoroutineSet() utf\u00F6rdes inte"},
-
- { ER_COROUTINE_PARAM,
- "Parameterfel f\u00F6r sidorutin ({0})"},
-
- { ER_PARSER_DOTERMINATE_ANSWERS,
- "\nUNEXPECTED: Parsersvar {0} f\u00F6r doTerminate"},
-
- { ER_NO_PARSE_CALL_WHILE_PARSING,
- "parse f\u00E5r inte anropas medan tolkning sker"},
-
- { ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED,
- "Fel: typad iterator f\u00F6r axeln {0} har inte implementerats"},
-
- { ER_ITERATOR_AXIS_NOT_IMPLEMENTED,
- "Fel: iterator f\u00F6r axeln {0} har inte implementerats "},
-
- { ER_ITERATOR_CLONE_NOT_SUPPORTED,
- "Iteratorklon underst\u00F6ds inte"},
-
- { ER_UNKNOWN_AXIS_TYPE,
- "Ok\u00E4nd axeltraverstyp: {0}"},
-
- { ER_AXIS_NOT_SUPPORTED,
- "Axeltravers underst\u00F6ds inte: {0}"},
-
- { ER_NO_DTMIDS_AVAIL,
- "Inga fler DTM-ID:n \u00E4r tillg\u00E4ngliga"},
-
- { ER_NOT_SUPPORTED,
- "Underst\u00F6ds inte: {0}"},
-
- { ER_NODE_NON_NULL,
- "Nod m\u00E5ste vara icke-null f\u00F6r getDTMHandleFromNode"},
-
- { ER_COULD_NOT_RESOLVE_NODE,
- "Kunde inte matcha noden med en referens"},
-
- { ER_STARTPARSE_WHILE_PARSING,
- "startParse f\u00E5r inte anropas medan tolkning sker"},
-
- { ER_STARTPARSE_NEEDS_SAXPARSER,
- "startParse beh\u00F6ver en SAXParser som \u00E4r icke-null"},
-
- { ER_COULD_NOT_INIT_PARSER,
- "kunde inte initiera parser med"},
-
- { ER_EXCEPTION_CREATING_POOL,
- "undantag skapar ny instans f\u00F6r pool"},
-
- { ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE,
- "S\u00F6kv\u00E4gen inneh\u00E5ller en ogiltig escape-sekvens"},
-
- { ER_SCHEME_REQUIRED,
- "Schema kr\u00E4vs!"},
-
- { ER_NO_SCHEME_IN_URI,
- "Schema saknas i URI: {0}"},
-
- { ER_NO_SCHEME_INURI,
- "Schema saknas i URI"},
-
- { ER_PATH_INVALID_CHAR,
- "S\u00F6kv\u00E4gen inneh\u00E5ller ett ogiltigt tecken: {0}"},
-
- { ER_SCHEME_FROM_NULL_STRING,
- "Kan inte st\u00E4lla in schema fr\u00E5n null-str\u00E4ng"},
-
- { ER_SCHEME_NOT_CONFORMANT,
- "Schemat \u00E4r inte likformigt."},
-
- { ER_HOST_ADDRESS_NOT_WELLFORMED,
- "V\u00E4rd \u00E4r inte en v\u00E4lformulerad adress"},
-
- { ER_PORT_WHEN_HOST_NULL,
- "Port kan inte st\u00E4llas in n\u00E4r v\u00E4rd \u00E4r null"},
-
- { ER_INVALID_PORT,
- "Ogiltigt portnummer"},
-
- { ER_FRAG_FOR_GENERIC_URI,
- "Fragment kan bara st\u00E4llas in f\u00F6r en allm\u00E4n URI"},
-
- { ER_FRAG_WHEN_PATH_NULL,
- "Fragment kan inte st\u00E4llas in n\u00E4r s\u00F6kv\u00E4g \u00E4r null"},
-
- { ER_FRAG_INVALID_CHAR,
- "Fragment inneh\u00E5ller ett ogiltigt tecken"},
-
- { ER_PARSER_IN_USE,
- "Parser anv\u00E4nds redan"},
-
- { ER_CANNOT_CHANGE_WHILE_PARSING,
- "Kan inte \u00E4ndra {0} {1} medan tolkning sker"},
-
- { ER_SELF_CAUSATION_NOT_PERMITTED,
- "Sj\u00E4lvorsakande inte till\u00E5ten"},
-
- { ER_NO_USERINFO_IF_NO_HOST,
- "Anv\u00E4ndarinfo f\u00E5r inte anges om v\u00E4rden inte \u00E4r angiven"},
-
- { ER_NO_PORT_IF_NO_HOST,
- "Port f\u00E5r inte anges om v\u00E4rden inte \u00E4r angiven"},
-
- { ER_NO_QUERY_STRING_IN_PATH,
- "Fr\u00E5gestr\u00E4ng kan inte anges i b\u00E5de s\u00F6kv\u00E4gen och fr\u00E5gestr\u00E4ngen"},
-
- { ER_NO_FRAGMENT_STRING_IN_PATH,
- "Fragment kan inte anges i b\u00E5de s\u00F6kv\u00E4gen och fragmentet"},
-
- { ER_CANNOT_INIT_URI_EMPTY_PARMS,
- "Kan inte initiera URI med tomma parametrar"},
-
- { ER_METHOD_NOT_SUPPORTED,
- "Metoden st\u00F6ds \u00E4nnu inte "},
-
- { ER_INCRSAXSRCFILTER_NOT_RESTARTABLE,
- "IncrementalSAXSource_Filter kan f\u00F6r n\u00E4rvarande inte startas om"},
-
- { ER_XMLRDR_NOT_BEFORE_STARTPARSE,
- "XMLReader inte f\u00F6re startParse-beg\u00E4ran"},
-
- { ER_AXIS_TRAVERSER_NOT_SUPPORTED,
- "Axeltravers underst\u00F6ds inte: {0}"},
-
- { ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER,
- "ListingErrorHandler skapad med null PrintWriter!"},
-
- { ER_SYSTEMID_UNKNOWN,
- "SystemId ok\u00E4nt"},
-
- { ER_LOCATION_UNKNOWN,
- "Platsen f\u00F6r felet \u00E4r ok\u00E4nd"},
-
- { ER_PREFIX_MUST_RESOLVE,
- "Prefix m\u00E5ste matchas till en namnrymd: {0}"},
-
- { ER_CREATEDOCUMENT_NOT_SUPPORTED,
- "createDocument() st\u00F6ds inte i XPathContext!"},
-
- { ER_CHILD_HAS_NO_OWNER_DOCUMENT,
- "Underordnat attribut har inget \u00E4gardokument!"},
-
- { ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT,
- "Underordnat attribut har inget \u00E4gardokumentelement!"},
-
- { ER_CANT_OUTPUT_TEXT_BEFORE_DOC,
- "Varning: utdatatext kan inte skrivas ut f\u00F6re dokumentelement! Ignoreras..."},
-
- { ER_CANT_HAVE_MORE_THAN_ONE_ROOT,
- "En DOM kan inte ha fler \u00E4n en rot!"},
-
- { ER_ARG_LOCALNAME_NULL,
- "Argumentet 'localName' \u00E4r null"},
-
- // Note to translators: A QNAME has the syntactic form [NCName:]NCName
- // The localname is the portion after the optional colon; the message indicates
- // that there is a problem with that part of the QNAME.
- { ER_ARG_LOCALNAME_INVALID,
- "Localname i QNAME b\u00F6r vara giltigt NCName"},
-
- // Note to translators: A QNAME has the syntactic form [NCName:]NCName
- // The prefix is the portion before the optional colon; the message indicates
- // that there is a problem with that part of the QNAME.
- { ER_ARG_PREFIX_INVALID,
- "Prefix i QNAME b\u00F6r vara giltigt NCName"},
-
- { ER_NAME_CANT_START_WITH_COLON,
- "Namnet kan inte b\u00F6rja med kolon"},
-
- { "BAD_CODE", "Parameter f\u00F6r createMessage ligger utanf\u00F6r gr\u00E4nsv\u00E4rdet"},
- { "FORMAT_FAILED", "Undantag utl\u00F6st vid messageFormat-anrop"},
- { "line", "Rad nr"},
- { "column","Kolumn nr"},
-
- {ER_SERIALIZER_NOT_CONTENTHANDLER,
- "Serializerklassen ''{0}'' implementerar inte org.xml.sax.ContentHandler."},
-
- {ER_RESOURCE_COULD_NOT_FIND,
- "Resursen [ {0} ] kunde inte h\u00E4mtas.\n {1}" },
-
- {ER_RESOURCE_COULD_NOT_LOAD,
- "Resursen [ {0} ] kunde inte laddas: {1} \n {2} \t {3}" },
-
- {ER_BUFFER_SIZE_LESSTHAN_ZERO,
- "Buffertstorlek <=0" },
-
- {ER_INVALID_UTF16_SURROGATE,
- "Ogiltigt UTF-16-surrogat uppt\u00E4ckt: {0} ?" },
-
- {ER_OIERROR,
- "IO-fel" },
-
- {ER_ILLEGAL_ATTRIBUTE_POSITION,
- "Kan inte l\u00E4gga till attributet {0} efter underordnade noder eller innan ett element har skapats. Attributet ignoreras."},
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- {ER_NAMESPACE_PREFIX,
- "Namnrymd f\u00F6r prefix ''{0}'' har inte deklarerats." },
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- {ER_STRAY_ATTRIBUTE,
- "Attributet ''{0}'' finns utanf\u00F6r elementet." },
-
- /*
- * Note to translators: As with the preceding message, a namespace
- * declaration has the form of an attribute and is only permitted to
- * appear on an element. The substitution text {0} is the namespace
- * prefix and {1} is the URI that was being used in the erroneous
- * namespace declaration.
- */
- {ER_STRAY_NAMESPACE,
- "Namnrymdsdeklarationen ''{0}''=''{1}'' finns utanf\u00F6r element." },
-
- {ER_COULD_NOT_LOAD_RESOURCE,
- "Kunde inte ladda ''{0}'' (kontrollera CLASSPATH), anv\u00E4nder nu enbart standardv\u00E4rden"},
-
- { ER_ILLEGAL_CHARACTER,
- "F\u00F6rs\u00F6k att skriva utdatatecken med integralv\u00E4rdet {0} som inte \u00E4r representerat i angiven utdatakodning av {1}."},
-
- {ER_COULD_NOT_LOAD_METHOD_PROPERTY,
- "Kunde inte ladda egenskapsfilen ''{0}'' f\u00F6r utdatametoden ''{1}'' (kontrollera CLASSPATH)" }
-
-
- };
-
- /**
- * Get the association list.
- *
- * @return The association list.
- */
-
- protected Object[][] getContents() {
- return contents;
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_tr.java b/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_tr.java
deleted file mode 100644
index 58973c6..0000000
--- a/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_tr.java
+++ /dev/null
@@ -1,443 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XMLErrorResources_tr.java,v 1.1.6.2 2005/09/15 07:45:46 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.res;
-
-
-import java.util.ListResourceBundle;
-
-/**
- * Set up error messages.
- * We build a two dimensional array of message keys and
- * message strings. In order to add a new message here,
- * you need to first add a String constant. And you need
- * to enter key, value pair as part of the contents
- * array. You also need to update MAX_CODE for error strings
- * and MAX_WARNING for warnings ( Needed for only information
- * purpose )
- */
-public class XMLErrorResources_tr extends ListResourceBundle
-{
-
-/*
- * This file contains error and warning messages related to Xalan Error
- * Handling.
- *
- * General notes to translators:
- *
- * 1) Xalan (or more properly, Xalan-interpretive) and XSLTC are names of
- * components.
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- * XSLTC is an acronym for XSLT Compiler.
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 5) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 6) "Translet" is an invented term that describes the class file that
- * results from compiling an XML stylesheet into a Java class.
- *
- * 7) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- */
-
- /** Maximum error messages, this is needed to keep track of the number of messages. */
- public static final int MAX_CODE = 61;
-
- /** Maximum warnings, this is needed to keep track of the number of warnings. */
- public static final int MAX_WARNING = 0;
-
- /** Maximum misc strings. */
- public static final int MAX_OTHERS = 4;
-
- /** Maximum total warnings and error messages. */
- public static final int MAX_MESSAGES = MAX_CODE + MAX_WARNING + 1;
-
-
- /*
- * Message keys
- */
- public static final String ER_FUNCTION_NOT_SUPPORTED = "ER_FUNCTION_NOT_SUPPORTED";
- public static final String ER_CANNOT_OVERWRITE_CAUSE = "ER_CANNOT_OVERWRITE_CAUSE";
- public static final String ER_NO_DEFAULT_IMPL = "ER_NO_DEFAULT_IMPL";
- public static final String ER_CHUNKEDINTARRAY_NOT_SUPPORTED = "ER_CHUNKEDINTARRAY_NOT_SUPPORTED";
- public static final String ER_OFFSET_BIGGER_THAN_SLOT = "ER_OFFSET_BIGGER_THAN_SLOT";
- public static final String ER_COROUTINE_NOT_AVAIL = "ER_COROUTINE_NOT_AVAIL";
- public static final String ER_COROUTINE_CO_EXIT = "ER_COROUTINE_CO_EXIT";
- public static final String ER_COJOINROUTINESET_FAILED = "ER_COJOINROUTINESET_FAILED";
- public static final String ER_COROUTINE_PARAM = "ER_COROUTINE_PARAM";
- public static final String ER_PARSER_DOTERMINATE_ANSWERS = "ER_PARSER_DOTERMINATE_ANSWERS";
- public static final String ER_NO_PARSE_CALL_WHILE_PARSING = "ER_NO_PARSE_CALL_WHILE_PARSING";
- public static final String ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED = "ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED";
- public static final String ER_ITERATOR_AXIS_NOT_IMPLEMENTED = "ER_ITERATOR_AXIS_NOT_IMPLEMENTED";
- public static final String ER_ITERATOR_CLONE_NOT_SUPPORTED = "ER_ITERATOR_CLONE_NOT_SUPPORTED";
- public static final String ER_UNKNOWN_AXIS_TYPE = "ER_UNKNOWN_AXIS_TYPE";
- public static final String ER_AXIS_NOT_SUPPORTED = "ER_AXIS_NOT_SUPPORTED";
- public static final String ER_NO_DTMIDS_AVAIL = "ER_NO_DTMIDS_AVAIL";
- public static final String ER_NOT_SUPPORTED = "ER_NOT_SUPPORTED";
- public static final String ER_NODE_NON_NULL = "ER_NODE_NON_NULL";
- public static final String ER_COULD_NOT_RESOLVE_NODE = "ER_COULD_NOT_RESOLVE_NODE";
- public static final String ER_STARTPARSE_WHILE_PARSING = "ER_STARTPARSE_WHILE_PARSING";
- public static final String ER_STARTPARSE_NEEDS_SAXPARSER = "ER_STARTPARSE_NEEDS_SAXPARSER";
- public static final String ER_COULD_NOT_INIT_PARSER = "ER_COULD_NOT_INIT_PARSER";
- public static final String ER_EXCEPTION_CREATING_POOL = "ER_EXCEPTION_CREATING_POOL";
- public static final String ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE = "ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE";
- public static final String ER_SCHEME_REQUIRED = "ER_SCHEME_REQUIRED";
- public static final String ER_NO_SCHEME_IN_URI = "ER_NO_SCHEME_IN_URI";
- public static final String ER_NO_SCHEME_INURI = "ER_NO_SCHEME_INURI";
- public static final String ER_PATH_INVALID_CHAR = "ER_PATH_INVALID_CHAR";
- public static final String ER_SCHEME_FROM_NULL_STRING = "ER_SCHEME_FROM_NULL_STRING";
- public static final String ER_SCHEME_NOT_CONFORMANT = "ER_SCHEME_NOT_CONFORMANT";
- public static final String ER_HOST_ADDRESS_NOT_WELLFORMED = "ER_HOST_ADDRESS_NOT_WELLFORMED";
- public static final String ER_PORT_WHEN_HOST_NULL = "ER_PORT_WHEN_HOST_NULL";
- public static final String ER_INVALID_PORT = "ER_INVALID_PORT";
- public static final String ER_FRAG_FOR_GENERIC_URI ="ER_FRAG_FOR_GENERIC_URI";
- public static final String ER_FRAG_WHEN_PATH_NULL = "ER_FRAG_WHEN_PATH_NULL";
- public static final String ER_FRAG_INVALID_CHAR = "ER_FRAG_INVALID_CHAR";
- public static final String ER_PARSER_IN_USE = "ER_PARSER_IN_USE";
- public static final String ER_CANNOT_CHANGE_WHILE_PARSING = "ER_CANNOT_CHANGE_WHILE_PARSING";
- public static final String ER_SELF_CAUSATION_NOT_PERMITTED = "ER_SELF_CAUSATION_NOT_PERMITTED";
- public static final String ER_NO_USERINFO_IF_NO_HOST = "ER_NO_USERINFO_IF_NO_HOST";
- public static final String ER_NO_PORT_IF_NO_HOST = "ER_NO_PORT_IF_NO_HOST";
- public static final String ER_NO_QUERY_STRING_IN_PATH = "ER_NO_QUERY_STRING_IN_PATH";
- public static final String ER_NO_FRAGMENT_STRING_IN_PATH = "ER_NO_FRAGMENT_STRING_IN_PATH";
- public static final String ER_CANNOT_INIT_URI_EMPTY_PARMS = "ER_CANNOT_INIT_URI_EMPTY_PARMS";
- public static final String ER_METHOD_NOT_SUPPORTED ="ER_METHOD_NOT_SUPPORTED";
- public static final String ER_INCRSAXSRCFILTER_NOT_RESTARTABLE = "ER_INCRSAXSRCFILTER_NOT_RESTARTABLE";
- public static final String ER_XMLRDR_NOT_BEFORE_STARTPARSE = "ER_XMLRDR_NOT_BEFORE_STARTPARSE";
- public static final String ER_AXIS_TRAVERSER_NOT_SUPPORTED = "ER_AXIS_TRAVERSER_NOT_SUPPORTED";
- public static final String ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER = "ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER";
- public static final String ER_SYSTEMID_UNKNOWN = "ER_SYSTEMID_UNKNOWN";
- public static final String ER_LOCATION_UNKNOWN = "ER_LOCATION_UNKNOWN";
- public static final String ER_PREFIX_MUST_RESOLVE = "ER_PREFIX_MUST_RESOLVE";
- public static final String ER_CREATEDOCUMENT_NOT_SUPPORTED = "ER_CREATEDOCUMENT_NOT_SUPPORTED";
- public static final String ER_CHILD_HAS_NO_OWNER_DOCUMENT = "ER_CHILD_HAS_NO_OWNER_DOCUMENT";
- public static final String ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT = "ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT";
- public static final String ER_CANT_OUTPUT_TEXT_BEFORE_DOC = "ER_CANT_OUTPUT_TEXT_BEFORE_DOC";
- public static final String ER_CANT_HAVE_MORE_THAN_ONE_ROOT = "ER_CANT_HAVE_MORE_THAN_ONE_ROOT";
- public static final String ER_ARG_LOCALNAME_NULL = "ER_ARG_LOCALNAME_NULL";
- public static final String ER_ARG_LOCALNAME_INVALID = "ER_ARG_LOCALNAME_INVALID";
- public static final String ER_ARG_PREFIX_INVALID = "ER_ARG_PREFIX_INVALID";
-
- // Message keys used by the serializer
- public static final String ER_RESOURCE_COULD_NOT_FIND = "ER_RESOURCE_COULD_NOT_FIND";
- public static final String ER_RESOURCE_COULD_NOT_LOAD = "ER_RESOURCE_COULD_NOT_LOAD";
- public static final String ER_BUFFER_SIZE_LESSTHAN_ZERO = "ER_BUFFER_SIZE_LESSTHAN_ZERO";
- public static final String ER_INVALID_UTF16_SURROGATE = "ER_INVALID_UTF16_SURROGATE";
- public static final String ER_OIERROR = "ER_OIERROR";
- public static final String ER_NAMESPACE_PREFIX = "ER_NAMESPACE_PREFIX";
- public static final String ER_STRAY_ATTRIBUTE = "ER_STRAY_ATTIRBUTE";
- public static final String ER_STRAY_NAMESPACE = "ER_STRAY_NAMESPACE";
- public static final String ER_COULD_NOT_LOAD_RESOURCE = "ER_COULD_NOT_LOAD_RESOURCE";
- public static final String ER_COULD_NOT_LOAD_METHOD_PROPERTY = "ER_COULD_NOT_LOAD_METHOD_PROPERTY";
- public static final String ER_SERIALIZER_NOT_CONTENTHANDLER = "ER_SERIALIZER_NOT_CONTENTHANDLER";
- public static final String ER_ILLEGAL_ATTRIBUTE_POSITION = "ER_ILLEGAL_ATTRIBUTE_POSITION";
-
- /*
- * Now fill in the message text.
- * Then fill in the message text for that message code in the
- * array. Use the new error code as the index into the array.
- */
-
- // Error messages...
- private static final Object[][] _contents = new Object[][] {
-
- /** Error message ID that has a null message, but takes in a single object. */
- {"ER0000" , "{0}" },
-
- { ER_FUNCTION_NOT_SUPPORTED,
- "\u0130\u015flev desteklenmiyor!"},
-
- { ER_CANNOT_OVERWRITE_CAUSE,
- "Nedenin \u00fczerine yaz\u0131lamaz"},
-
- { ER_NO_DEFAULT_IMPL,
- "Varsay\u0131lan uygulama bulunamad\u0131"},
-
- { ER_CHUNKEDINTARRAY_NOT_SUPPORTED,
- "ChunkedIntArray({0}) \u015fu an desteklenmiyor"},
-
- { ER_OFFSET_BIGGER_THAN_SLOT,
- "G\u00f6reli konum yuvadan b\u00fcy\u00fck"},
-
- { ER_COROUTINE_NOT_AVAIL,
- "Coroutine kullan\u0131lam\u0131yor, id={0}"},
-
- { ER_COROUTINE_CO_EXIT,
- "CoroutineManager co_exit() iste\u011fi ald\u0131"},
-
- { ER_COJOINROUTINESET_FAILED,
- "co_joinCoroutineSet() ba\u015far\u0131s\u0131z oldu"},
-
- { ER_COROUTINE_PARAM,
- "Coroutine de\u011fi\u015ftirgesi hatas\u0131 ({0})"},
-
- { ER_PARSER_DOTERMINATE_ANSWERS,
- "\nBEKLENMEYEN: Parser doTerminate yan\u0131t\u0131 {0}"},
-
- { ER_NO_PARSE_CALL_WHILE_PARSING,
- "Ayr\u0131\u015ft\u0131rma s\u0131ras\u0131nda parse \u00e7a\u011fr\u0131lamaz"},
-
- { ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED,
- "Hata: {0} ekseni i\u00e7in tip atanm\u0131\u015f yineleyici ger\u00e7ekle\u015ftirilmedi"},
-
- { ER_ITERATOR_AXIS_NOT_IMPLEMENTED,
- "Hata: {0} ekseni i\u00e7in yineleyici ger\u00e7ekle\u015ftirilmedi"},
-
- { ER_ITERATOR_CLONE_NOT_SUPPORTED,
- "Yineleyici e\u015fkopyas\u0131 desteklenmiyor"},
-
- { ER_UNKNOWN_AXIS_TYPE,
- "Bilinmeyen eksen dola\u015fma tipi: {0}"},
-
- { ER_AXIS_NOT_SUPPORTED,
- "Eksen dola\u015f\u0131c\u0131 desteklenmiyor: {0}"},
-
- { ER_NO_DTMIDS_AVAIL,
- "Kullan\u0131labilecek ba\u015fka DTM tan\u0131t\u0131c\u0131s\u0131 yok"},
-
- { ER_NOT_SUPPORTED,
- "Desteklenmiyor: {0}"},
-
- { ER_NODE_NON_NULL,
- "getDTMHandleFromNode i\u00e7in d\u00fc\u011f\u00fcm bo\u015f de\u011ferli olmamal\u0131d\u0131r"},
-
- { ER_COULD_NOT_RESOLVE_NODE,
- "D\u00fc\u011f\u00fcm tan\u0131t\u0131c\u0131 de\u011fere \u00e7\u00f6z\u00fclemedi"},
-
- { ER_STARTPARSE_WHILE_PARSING,
- "Ayr\u0131\u015ft\u0131rma s\u0131ras\u0131nda startParse \u00e7a\u011fr\u0131lamaz"},
-
- { ER_STARTPARSE_NEEDS_SAXPARSER,
- "startParse i\u00e7in bo\u015f de\u011ferli olmayan SAXParser gerekiyor"},
-
- { ER_COULD_NOT_INIT_PARSER,
- "Ayr\u0131\u015ft\u0131r\u0131c\u0131 bununla kullan\u0131ma haz\u0131rlanamad\u0131"},
-
- { ER_EXCEPTION_CREATING_POOL,
- "Havuz i\u00e7in yeni \u00f6rnek yarat\u0131l\u0131rken kural d\u0131\u015f\u0131 durum"},
-
- { ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE,
- "Yol ge\u00e7ersiz ka\u00e7\u0131\u015f dizisi i\u00e7eriyor"},
-
- { ER_SCHEME_REQUIRED,
- "\u015eema gerekli!"},
-
- { ER_NO_SCHEME_IN_URI,
- "URI i\u00e7inde \u015fema bulunamad\u0131: {0}"},
-
- { ER_NO_SCHEME_INURI,
- "URI i\u00e7inde \u015fema bulunamad\u0131"},
-
- { ER_PATH_INVALID_CHAR,
- "Yol ge\u00e7ersiz karakter i\u00e7eriyor: {0}"},
-
- { ER_SCHEME_FROM_NULL_STRING,
- "Bo\u015f de\u011ferli dizgiden \u015fema tan\u0131mlanamaz"},
-
- { ER_SCHEME_NOT_CONFORMANT,
- "\u015eema uyumlu de\u011fil."},
-
- { ER_HOST_ADDRESS_NOT_WELLFORMED,
- "Anasistem do\u011fru bi\u00e7imli bir adres de\u011fil"},
-
- { ER_PORT_WHEN_HOST_NULL,
- "Anasistem bo\u015f de\u011ferliyken kap\u0131 tan\u0131mlanamaz"},
-
- { ER_INVALID_PORT,
- "Kap\u0131 numaras\u0131 ge\u00e7ersiz"},
-
- { ER_FRAG_FOR_GENERIC_URI,
- "Par\u00e7a yaln\u0131zca soysal URI i\u00e7in tan\u0131mlanabilir"},
-
- { ER_FRAG_WHEN_PATH_NULL,
- "Yol bo\u015f de\u011ferliyken par\u00e7a tan\u0131mlanamaz"},
-
- { ER_FRAG_INVALID_CHAR,
- "Par\u00e7a ge\u00e7ersiz karakter i\u00e7eriyor"},
-
- { ER_PARSER_IN_USE,
- "Ayr\u0131\u015ft\u0131r\u0131c\u0131 kullan\u0131mda"},
-
- { ER_CANNOT_CHANGE_WHILE_PARSING,
- "Ayr\u0131\u015ft\u0131rma s\u0131ras\u0131nda {0} {1} de\u011fi\u015ftirilemez"},
-
- { ER_SELF_CAUSATION_NOT_PERMITTED,
- "\u00d6znedenselli\u011fe izin verilmez"},
-
- { ER_NO_USERINFO_IF_NO_HOST,
- "Anasistem belirtilmediyse kullan\u0131c\u0131 bilgisi belirtilemez"},
-
- { ER_NO_PORT_IF_NO_HOST,
- "Anasistem belirtilmediyse kap\u0131 belirtilemez"},
-
- { ER_NO_QUERY_STRING_IN_PATH,
- "Yol ve sorgu dizgisinde sorgu dizgisi belirtilemez"},
-
- { ER_NO_FRAGMENT_STRING_IN_PATH,
- "Par\u00e7a hem yolda, hem de par\u00e7ada belirtilemez"},
-
- { ER_CANNOT_INIT_URI_EMPTY_PARMS,
- "Bo\u015f de\u011fi\u015ftirgelerle URI kullan\u0131ma haz\u0131rlanamaz"},
-
- { ER_METHOD_NOT_SUPPORTED,
- "Y\u00f6ntem hen\u00fcz desteklenmiyor"},
-
- { ER_INCRSAXSRCFILTER_NOT_RESTARTABLE,
- "IncrementalSAXSource_Filter \u015fu an yeniden ba\u015flat\u0131labilir durumda de\u011fil"},
-
- { ER_XMLRDR_NOT_BEFORE_STARTPARSE,
- "XMLReader, startParse iste\u011finden \u00f6nce olmaz"},
-
- { ER_AXIS_TRAVERSER_NOT_SUPPORTED,
- "Eksen dola\u015f\u0131c\u0131 desteklenmiyor: {0}"},
-
- { ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER,
- "ListingErrorHandler bo\u015f de\u011ferli PrintWriter ile yarat\u0131ld\u0131!"},
-
- { ER_SYSTEMID_UNKNOWN,
- "SystemId bilinmiyor"},
-
- { ER_LOCATION_UNKNOWN,
- "Hata yeri bilinmiyor"},
-
- { ER_PREFIX_MUST_RESOLVE,
- "\u00d6nek bir ad alan\u0131na \u00e7\u00f6z\u00fclmelidir: {0}"},
-
- { ER_CREATEDOCUMENT_NOT_SUPPORTED,
- "XPathContext i\u00e7inde createDocument() desteklenmiyor!"},
-
- { ER_CHILD_HAS_NO_OWNER_DOCUMENT,
- "\u00d6zniteli\u011fin alt \u00f6\u011fesinin iye belgesi yok!"},
-
- { ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT,
- "\u00d6zniteli\u011fin alt \u00f6\u011fesinin iye belge \u00f6\u011fesi yok!"},
-
- { ER_CANT_OUTPUT_TEXT_BEFORE_DOC,
- "Uyar\u0131: Belge \u00f6\u011fesinden \u00f6nce metin \u00e7\u0131k\u0131\u015f\u0131 olamaz! Yoksay\u0131l\u0131yor..."},
-
- { ER_CANT_HAVE_MORE_THAN_ONE_ROOT,
- "DOM \u00fczerinde birden fazla k\u00f6k olamaz!"},
-
- { ER_ARG_LOCALNAME_NULL,
- "'localName' ba\u011f\u0131ms\u0131z de\u011fi\u015ftirgesi bo\u015f de\u011ferli"},
-
- // Note to translators: A QNAME has the syntactic form [NCName:]NCName
- // The localname is the portion after the optional colon; the message indicates
- // that there is a problem with that part of the QNAME.
- { ER_ARG_LOCALNAME_INVALID,
- "QNAME i\u00e7indeki yerel ad (localname) ge\u00e7erli bir NCName olmal\u0131d\u0131r"},
-
- // Note to translators: A QNAME has the syntactic form [NCName:]NCName
- // The prefix is the portion before the optional colon; the message indicates
- // that there is a problem with that part of the QNAME.
- { ER_ARG_PREFIX_INVALID,
- "QNAME i\u00e7indeki \u00f6nek ge\u00e7erli bir NCName olmal\u0131d\u0131r"},
-
- { "BAD_CODE", "createMessage i\u00e7in kullan\u0131lan de\u011fi\u015ftirge s\u0131n\u0131rlar\u0131n d\u0131\u015f\u0131nda"},
- { "FORMAT_FAILED", "messageFormat \u00e7a\u011fr\u0131s\u0131 s\u0131ras\u0131nda kural d\u0131\u015f\u0131 durum yay\u0131nland\u0131"},
- { "line", "Sat\u0131r #"},
- { "column","Kolon #"},
-
- {ER_SERIALIZER_NOT_CONTENTHANDLER,
- "Diziselle\u015ftirici s\u0131n\u0131f\u0131 ''{0}'' org.xml.sax.ContentHandler i\u015flevini uygulam\u0131yor."},
-
- {ER_RESOURCE_COULD_NOT_FIND,
- "Kaynak [ {0} ] bulunamad\u0131.\n {1}" },
-
- {ER_RESOURCE_COULD_NOT_LOAD,
- "Kaynak [ {0} ] y\u00fckleyemedi: {1} \n {2} \t {3}" },
-
- {ER_BUFFER_SIZE_LESSTHAN_ZERO,
- "Arabellek b\u00fcy\u00fckl\u00fc\u011f\u00fc <=0" },
-
- {ER_INVALID_UTF16_SURROGATE,
- "UTF-16 yerine kullan\u0131lan de\u011fer ge\u00e7ersiz: {0} ?" },
-
- {ER_OIERROR,
- "G\u00c7 hatas\u0131" },
-
- {ER_ILLEGAL_ATTRIBUTE_POSITION,
- "Alt d\u00fc\u011f\u00fcmlerden sonra ya da bir \u00f6\u011fe \u00fcretilmeden \u00f6nce {0} \u00f6zniteli\u011fi eklenemez. \u00d6znitelik yoksay\u0131lacak."},
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- {ER_NAMESPACE_PREFIX,
- "''{0}'' \u00f6nekine ili\u015fkin ad alan\u0131 bildirilmedi." },
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- {ER_STRAY_ATTRIBUTE,
- "''{0}'' \u00f6zniteli\u011fi \u00f6\u011fenin d\u0131\u015f\u0131nda." },
-
- /*
- * Note to translators: As with the preceding message, a namespace
- * declaration has the form of an attribute and is only permitted to
- * appear on an element. The substitution text {0} is the namespace
- * prefix and {1} is the URI that was being used in the erroneous
- * namespace declaration.
- */
- {ER_STRAY_NAMESPACE,
- "''{0}''=''{1}'' ad alan\u0131 bildirimi \u00f6\u011fenin d\u0131\u015f\u0131nda." },
-
- {ER_COULD_NOT_LOAD_RESOURCE,
- "''{0}'' y\u00fcklenemedi (CLASSPATH de\u011fi\u015fkeninizi inceleyin), yaln\u0131zca varsay\u0131lanlar kullan\u0131l\u0131yor"},
-
- {ER_COULD_NOT_LOAD_METHOD_PROPERTY,
- "''{1}'' \u00e7\u0131k\u0131\u015f y\u00f6ntemi i\u00e7in ''{0}'' \u00f6zellik dosyas\u0131 y\u00fcklenemedi (CLASSPATH de\u011fi\u015fkenini inceleyin)" }
-
-
- };
-
- /**
- * Get the lookup table for error messages
- *
- * @return The association list.
- */
- public Object[][] getContents()
- {
- return _contents;
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_zh_CN.java b/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_zh_CN.java
deleted file mode 100644
index c500135..0000000
--- a/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_zh_CN.java
+++ /dev/null
@@ -1,450 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xml.internal.res;
-
-
-import java.util.ListResourceBundle;
-
-/**
- * Set up error messages.
- * We build a two dimensional array of message keys and
- * message strings. In order to add a new message here,
- * you need to first add a String constant. And you need
- * to enter key, value pair as part of the contents
- * array. You also need to update MAX_CODE for error strings
- * and MAX_WARNING for warnings ( Needed for only information
- * purpose )
- */
-public class XMLErrorResources_zh_CN extends ListResourceBundle
-{
-
-/*
- * This file contains error and warning messages related to Xalan Error
- * Handling.
- *
- * General notes to translators:
- *
- * 1) Xalan (or more properly, Xalan-interpretive) and XSLTC are names of
- * components.
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- * XSLTC is an acronym for XSLT Compiler.
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 5) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 6) "Translet" is an invented term that describes the class file that
- * results from compiling an XML stylesheet into a Java class.
- *
- * 7) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- */
-
- /** Maximum error messages, this is needed to keep track of the number of messages. */
- public static final int MAX_CODE = 61;
-
- /** Maximum warnings, this is needed to keep track of the number of warnings. */
- public static final int MAX_WARNING = 0;
-
- /** Maximum misc strings. */
- public static final int MAX_OTHERS = 4;
-
- /** Maximum total warnings and error messages. */
- public static final int MAX_MESSAGES = MAX_CODE + MAX_WARNING + 1;
-
-
- /*
- * Message keys
- */
- public static final String ER_FUNCTION_NOT_SUPPORTED = "ER_FUNCTION_NOT_SUPPORTED";
- public static final String ER_CANNOT_OVERWRITE_CAUSE = "ER_CANNOT_OVERWRITE_CAUSE";
- public static final String ER_NO_DEFAULT_IMPL = "ER_NO_DEFAULT_IMPL";
- public static final String ER_CHUNKEDINTARRAY_NOT_SUPPORTED = "ER_CHUNKEDINTARRAY_NOT_SUPPORTED";
- public static final String ER_OFFSET_BIGGER_THAN_SLOT = "ER_OFFSET_BIGGER_THAN_SLOT";
- public static final String ER_COROUTINE_NOT_AVAIL = "ER_COROUTINE_NOT_AVAIL";
- public static final String ER_COROUTINE_CO_EXIT = "ER_COROUTINE_CO_EXIT";
- public static final String ER_COJOINROUTINESET_FAILED = "ER_COJOINROUTINESET_FAILED";
- public static final String ER_COROUTINE_PARAM = "ER_COROUTINE_PARAM";
- public static final String ER_PARSER_DOTERMINATE_ANSWERS = "ER_PARSER_DOTERMINATE_ANSWERS";
- public static final String ER_NO_PARSE_CALL_WHILE_PARSING = "ER_NO_PARSE_CALL_WHILE_PARSING";
- public static final String ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED = "ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED";
- public static final String ER_ITERATOR_AXIS_NOT_IMPLEMENTED = "ER_ITERATOR_AXIS_NOT_IMPLEMENTED";
- public static final String ER_ITERATOR_CLONE_NOT_SUPPORTED = "ER_ITERATOR_CLONE_NOT_SUPPORTED";
- public static final String ER_UNKNOWN_AXIS_TYPE = "ER_UNKNOWN_AXIS_TYPE";
- public static final String ER_AXIS_NOT_SUPPORTED = "ER_AXIS_NOT_SUPPORTED";
- public static final String ER_NO_DTMIDS_AVAIL = "ER_NO_DTMIDS_AVAIL";
- public static final String ER_NOT_SUPPORTED = "ER_NOT_SUPPORTED";
- public static final String ER_NODE_NON_NULL = "ER_NODE_NON_NULL";
- public static final String ER_COULD_NOT_RESOLVE_NODE = "ER_COULD_NOT_RESOLVE_NODE";
- public static final String ER_STARTPARSE_WHILE_PARSING = "ER_STARTPARSE_WHILE_PARSING";
- public static final String ER_STARTPARSE_NEEDS_SAXPARSER = "ER_STARTPARSE_NEEDS_SAXPARSER";
- public static final String ER_COULD_NOT_INIT_PARSER = "ER_COULD_NOT_INIT_PARSER";
- public static final String ER_EXCEPTION_CREATING_POOL = "ER_EXCEPTION_CREATING_POOL";
- public static final String ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE = "ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE";
- public static final String ER_SCHEME_REQUIRED = "ER_SCHEME_REQUIRED";
- public static final String ER_NO_SCHEME_IN_URI = "ER_NO_SCHEME_IN_URI";
- public static final String ER_NO_SCHEME_INURI = "ER_NO_SCHEME_INURI";
- public static final String ER_PATH_INVALID_CHAR = "ER_PATH_INVALID_CHAR";
- public static final String ER_SCHEME_FROM_NULL_STRING = "ER_SCHEME_FROM_NULL_STRING";
- public static final String ER_SCHEME_NOT_CONFORMANT = "ER_SCHEME_NOT_CONFORMANT";
- public static final String ER_HOST_ADDRESS_NOT_WELLFORMED = "ER_HOST_ADDRESS_NOT_WELLFORMED";
- public static final String ER_PORT_WHEN_HOST_NULL = "ER_PORT_WHEN_HOST_NULL";
- public static final String ER_INVALID_PORT = "ER_INVALID_PORT";
- public static final String ER_FRAG_FOR_GENERIC_URI ="ER_FRAG_FOR_GENERIC_URI";
- public static final String ER_FRAG_WHEN_PATH_NULL = "ER_FRAG_WHEN_PATH_NULL";
- public static final String ER_FRAG_INVALID_CHAR = "ER_FRAG_INVALID_CHAR";
- public static final String ER_PARSER_IN_USE = "ER_PARSER_IN_USE";
- public static final String ER_CANNOT_CHANGE_WHILE_PARSING = "ER_CANNOT_CHANGE_WHILE_PARSING";
- public static final String ER_SELF_CAUSATION_NOT_PERMITTED = "ER_SELF_CAUSATION_NOT_PERMITTED";
- public static final String ER_NO_USERINFO_IF_NO_HOST = "ER_NO_USERINFO_IF_NO_HOST";
- public static final String ER_NO_PORT_IF_NO_HOST = "ER_NO_PORT_IF_NO_HOST";
- public static final String ER_NO_QUERY_STRING_IN_PATH = "ER_NO_QUERY_STRING_IN_PATH";
- public static final String ER_NO_FRAGMENT_STRING_IN_PATH = "ER_NO_FRAGMENT_STRING_IN_PATH";
- public static final String ER_CANNOT_INIT_URI_EMPTY_PARMS = "ER_CANNOT_INIT_URI_EMPTY_PARMS";
- public static final String ER_METHOD_NOT_SUPPORTED ="ER_METHOD_NOT_SUPPORTED";
- public static final String ER_INCRSAXSRCFILTER_NOT_RESTARTABLE = "ER_INCRSAXSRCFILTER_NOT_RESTARTABLE";
- public static final String ER_XMLRDR_NOT_BEFORE_STARTPARSE = "ER_XMLRDR_NOT_BEFORE_STARTPARSE";
- public static final String ER_AXIS_TRAVERSER_NOT_SUPPORTED = "ER_AXIS_TRAVERSER_NOT_SUPPORTED";
- public static final String ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER = "ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER";
- public static final String ER_SYSTEMID_UNKNOWN = "ER_SYSTEMID_UNKNOWN";
- public static final String ER_LOCATION_UNKNOWN = "ER_LOCATION_UNKNOWN";
- public static final String ER_PREFIX_MUST_RESOLVE = "ER_PREFIX_MUST_RESOLVE";
- public static final String ER_CREATEDOCUMENT_NOT_SUPPORTED = "ER_CREATEDOCUMENT_NOT_SUPPORTED";
- public static final String ER_CHILD_HAS_NO_OWNER_DOCUMENT = "ER_CHILD_HAS_NO_OWNER_DOCUMENT";
- public static final String ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT = "ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT";
- public static final String ER_CANT_OUTPUT_TEXT_BEFORE_DOC = "ER_CANT_OUTPUT_TEXT_BEFORE_DOC";
- public static final String ER_CANT_HAVE_MORE_THAN_ONE_ROOT = "ER_CANT_HAVE_MORE_THAN_ONE_ROOT";
- public static final String ER_ARG_LOCALNAME_NULL = "ER_ARG_LOCALNAME_NULL";
- public static final String ER_ARG_LOCALNAME_INVALID = "ER_ARG_LOCALNAME_INVALID";
- public static final String ER_ARG_PREFIX_INVALID = "ER_ARG_PREFIX_INVALID";
- public static final String ER_NAME_CANT_START_WITH_COLON = "ER_NAME_CANT_START_WITH_COLON";
-
- // Message keys used by the serializer
- public static final String ER_RESOURCE_COULD_NOT_FIND = "ER_RESOURCE_COULD_NOT_FIND";
- public static final String ER_RESOURCE_COULD_NOT_LOAD = "ER_RESOURCE_COULD_NOT_LOAD";
- public static final String ER_BUFFER_SIZE_LESSTHAN_ZERO = "ER_BUFFER_SIZE_LESSTHAN_ZERO";
- public static final String ER_INVALID_UTF16_SURROGATE = "ER_INVALID_UTF16_SURROGATE";
- public static final String ER_OIERROR = "ER_OIERROR";
- public static final String ER_NAMESPACE_PREFIX = "ER_NAMESPACE_PREFIX";
- public static final String ER_STRAY_ATTRIBUTE = "ER_STRAY_ATTIRBUTE";
- public static final String ER_STRAY_NAMESPACE = "ER_STRAY_NAMESPACE";
- public static final String ER_COULD_NOT_LOAD_RESOURCE = "ER_COULD_NOT_LOAD_RESOURCE";
- public static final String ER_COULD_NOT_LOAD_METHOD_PROPERTY = "ER_COULD_NOT_LOAD_METHOD_PROPERTY";
- public static final String ER_SERIALIZER_NOT_CONTENTHANDLER = "ER_SERIALIZER_NOT_CONTENTHANDLER";
- public static final String ER_ILLEGAL_ATTRIBUTE_POSITION = "ER_ILLEGAL_ATTRIBUTE_POSITION";
- public static final String ER_ILLEGAL_CHARACTER = "ER_ILLEGAL_CHARACTER";
-
- /*
- * Now fill in the message text.
- * Then fill in the message text for that message code in the
- * array. Use the new error code as the index into the array.
- */
-
- // Error messages...
-
- /** The lookup table for error messages. */
- private static final Object[][] contents = {
-
- /** Error message ID that has a null message, but takes in a single object. */
- {"ER0000" , "{0}" },
-
- { ER_FUNCTION_NOT_SUPPORTED,
- "\u4E0D\u652F\u6301\u8BE5\u51FD\u6570!"},
-
- { ER_CANNOT_OVERWRITE_CAUSE,
- "\u65E0\u6CD5\u8986\u76D6\u539F\u56E0"},
-
- { ER_NO_DEFAULT_IMPL,
- "\u627E\u4E0D\u5230\u9ED8\u8BA4\u5B9E\u73B0 "},
-
- { ER_CHUNKEDINTARRAY_NOT_SUPPORTED,
- "\u5F53\u524D\u4E0D\u652F\u6301 ChunkedIntArray({0})"},
-
- { ER_OFFSET_BIGGER_THAN_SLOT,
- "\u504F\u79FB\u91CF\u5927\u4E8E\u63D2\u69FD"},
-
- { ER_COROUTINE_NOT_AVAIL,
- "Coroutine \u4E0D\u53EF\u7528, id={0}"},
-
- { ER_COROUTINE_CO_EXIT,
- "CoroutineManager \u6536\u5230 co_exit() \u8BF7\u6C42"},
-
- { ER_COJOINROUTINESET_FAILED,
- "co_joinCoroutineSet() \u5931\u8D25"},
-
- { ER_COROUTINE_PARAM,
- "Coroutine \u53C2\u6570\u9519\u8BEF ({0})"},
-
- { ER_PARSER_DOTERMINATE_ANSWERS,
- "\n\u610F\u5916: \u89E3\u6790\u5668\u5BF9\u7B54\u590D{0}\u6267\u884C doTerminate"},
-
- { ER_NO_PARSE_CALL_WHILE_PARSING,
- "\u65E0\u6CD5\u5728\u89E3\u6790\u65F6\u8C03\u7528 parse"},
-
- { ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED,
- "\u9519\u8BEF: \u672A\u5B9E\u73B0\u8F74{0}\u7684\u7C7B\u578B\u5316\u8FED\u4EE3\u5668"},
-
- { ER_ITERATOR_AXIS_NOT_IMPLEMENTED,
- "\u9519\u8BEF: \u672A\u5B9E\u73B0\u8F74{0}\u7684\u8FED\u4EE3\u5668 "},
-
- { ER_ITERATOR_CLONE_NOT_SUPPORTED,
- "\u4E0D\u652F\u6301\u514B\u9686\u8FED\u4EE3\u5668"},
-
- { ER_UNKNOWN_AXIS_TYPE,
- "\u8F74\u904D\u5386\u7C7B\u578B\u672A\u77E5: {0}"},
-
- { ER_AXIS_NOT_SUPPORTED,
- "\u4E0D\u652F\u6301\u8F74\u904D\u5386\u7A0B\u5E8F: {0}"},
-
- { ER_NO_DTMIDS_AVAIL,
- "\u65E0\u6CD5\u4F7F\u7528\u66F4\u591A DTM ID"},
-
- { ER_NOT_SUPPORTED,
- "\u4E0D\u652F\u6301: {0}"},
-
- { ER_NODE_NON_NULL,
- "getDTMHandleFromNode \u7684\u8282\u70B9\u5FC5\u987B\u4E3A\u975E\u7A7A\u503C"},
-
- { ER_COULD_NOT_RESOLVE_NODE,
- "\u65E0\u6CD5\u5C06\u8282\u70B9\u89E3\u6790\u4E3A\u53E5\u67C4"},
-
- { ER_STARTPARSE_WHILE_PARSING,
- "\u65E0\u6CD5\u5728\u89E3\u6790\u65F6\u8C03\u7528 startParse"},
-
- { ER_STARTPARSE_NEEDS_SAXPARSER,
- "startParse \u9700\u8981\u975E\u7A7A SAXParser"},
-
- { ER_COULD_NOT_INIT_PARSER,
- "\u65E0\u6CD5\u4F7F\u7528\u4EE5\u4E0B\u5BF9\u8C61\u521D\u59CB\u5316\u89E3\u6790\u5668"},
-
- { ER_EXCEPTION_CREATING_POOL,
- "\u4E3A\u6C60\u521B\u5EFA\u65B0\u5B9E\u4F8B\u65F6\u51FA\u73B0\u5F02\u5E38\u9519\u8BEF"},
-
- { ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE,
- "\u8DEF\u5F84\u5305\u542B\u65E0\u6548\u7684\u8F6C\u4E49\u5E8F\u5217"},
-
- { ER_SCHEME_REQUIRED,
- "\u65B9\u6848\u662F\u5FC5\u9700\u7684!"},
-
- { ER_NO_SCHEME_IN_URI,
- "\u5728 URI \u4E2D\u627E\u4E0D\u5230\u65B9\u6848: {0}"},
-
- { ER_NO_SCHEME_INURI,
- "\u5728 URI \u4E2D\u627E\u4E0D\u5230\u65B9\u6848"},
-
- { ER_PATH_INVALID_CHAR,
- "\u8DEF\u5F84\u5305\u542B\u65E0\u6548\u7684\u5B57\u7B26: {0}"},
-
- { ER_SCHEME_FROM_NULL_STRING,
- "\u65E0\u6CD5\u4ECE\u7A7A\u5B57\u7B26\u4E32\u8BBE\u7F6E\u65B9\u6848"},
-
- { ER_SCHEME_NOT_CONFORMANT,
- "\u65B9\u6848\u4E0D\u4E00\u81F4\u3002"},
-
- { ER_HOST_ADDRESS_NOT_WELLFORMED,
- "\u4E3B\u673A\u4E0D\u662F\u683C\u5F0F\u826F\u597D\u7684\u5730\u5740"},
-
- { ER_PORT_WHEN_HOST_NULL,
- "\u4E3B\u673A\u4E3A\u7A7A\u65F6, \u65E0\u6CD5\u8BBE\u7F6E\u7AEF\u53E3"},
-
- { ER_INVALID_PORT,
- "\u65E0\u6548\u7684\u7AEF\u53E3\u53F7"},
-
- { ER_FRAG_FOR_GENERIC_URI,
- "\u53EA\u80FD\u4E3A\u4E00\u822C URI \u8BBE\u7F6E\u7247\u6BB5"},
-
- { ER_FRAG_WHEN_PATH_NULL,
- "\u8DEF\u5F84\u4E3A\u7A7A\u65F6, \u65E0\u6CD5\u8BBE\u7F6E\u7247\u6BB5"},
-
- { ER_FRAG_INVALID_CHAR,
- "\u7247\u6BB5\u5305\u542B\u65E0\u6548\u7684\u5B57\u7B26"},
-
- { ER_PARSER_IN_USE,
- "\u89E3\u6790\u5668\u5DF2\u5728\u4F7F\u7528"},
-
- { ER_CANNOT_CHANGE_WHILE_PARSING,
- "\u65E0\u6CD5\u5728\u89E3\u6790\u65F6\u66F4\u6539{0} {1}"},
-
- { ER_SELF_CAUSATION_NOT_PERMITTED,
- "\u4E0D\u5141\u8BB8\u4F7F\u7528\u81EA\u56E0"},
-
- { ER_NO_USERINFO_IF_NO_HOST,
- "\u5982\u679C\u6CA1\u6709\u6307\u5B9A\u4E3B\u673A, \u5219\u4E0D\u53EF\u4EE5\u6307\u5B9A Userinfo"},
-
- { ER_NO_PORT_IF_NO_HOST,
- "\u5982\u679C\u6CA1\u6709\u6307\u5B9A\u4E3B\u673A, \u5219\u4E0D\u53EF\u4EE5\u6307\u5B9A\u7AEF\u53E3"},
-
- { ER_NO_QUERY_STRING_IN_PATH,
- "\u8DEF\u5F84\u548C\u67E5\u8BE2\u5B57\u7B26\u4E32\u4E2D\u4E0D\u80FD\u6307\u5B9A\u67E5\u8BE2\u5B57\u7B26\u4E32"},
-
- { ER_NO_FRAGMENT_STRING_IN_PATH,
- "\u8DEF\u5F84\u548C\u7247\u6BB5\u4E2D\u90FD\u65E0\u6CD5\u6307\u5B9A\u7247\u6BB5"},
-
- { ER_CANNOT_INIT_URI_EMPTY_PARMS,
- "\u65E0\u6CD5\u4EE5\u7A7A\u53C2\u6570\u521D\u59CB\u5316 URI"},
-
- { ER_METHOD_NOT_SUPPORTED,
- "\u5C1A\u4E0D\u652F\u6301\u8BE5\u65B9\u6CD5 "},
-
- { ER_INCRSAXSRCFILTER_NOT_RESTARTABLE,
- "\u5F53\u524D\u65E0\u6CD5\u91CD\u65B0\u542F\u52A8 IncrementalSAXSource_Filter"},
-
- { ER_XMLRDR_NOT_BEFORE_STARTPARSE,
- "XMLReader \u4E0D\u5728 startParse \u8BF7\u6C42\u4E4B\u524D"},
-
- { ER_AXIS_TRAVERSER_NOT_SUPPORTED,
- "\u4E0D\u652F\u6301\u8F74\u904D\u5386\u7A0B\u5E8F: {0}"},
-
- { ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER,
- "\u4F7F\u7528\u7A7A PrintWriter \u521B\u5EFA\u4E86 ListingErrorHandler!"},
-
- { ER_SYSTEMID_UNKNOWN,
- "SystemId \u672A\u77E5"},
-
- { ER_LOCATION_UNKNOWN,
- "\u9519\u8BEF\u6240\u5728\u7684\u4F4D\u7F6E\u672A\u77E5"},
-
- { ER_PREFIX_MUST_RESOLVE,
- "\u524D\u7F00\u5FC5\u987B\u89E3\u6790\u4E3A\u540D\u79F0\u7A7A\u95F4: {0}"},
-
- { ER_CREATEDOCUMENT_NOT_SUPPORTED,
- "XPathContext \u4E2D\u4E0D\u652F\u6301 createDocument()!"},
-
- { ER_CHILD_HAS_NO_OWNER_DOCUMENT,
- "\u5C5E\u6027\u5B50\u7EA7\u6CA1\u6709\u6240\u6709\u8005\u6587\u6863!"},
-
- { ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT,
- "\u5C5E\u6027\u5B50\u7EA7\u6CA1\u6709\u6240\u6709\u8005\u6587\u6863\u5143\u7D20!"},
-
- { ER_CANT_OUTPUT_TEXT_BEFORE_DOC,
- "\u8B66\u544A: \u65E0\u6CD5\u8F93\u51FA\u6587\u6863\u5143\u7D20\u4E4B\u524D\u7684\u6587\u672C! \u5C06\u5FFD\u7565..."},
-
- { ER_CANT_HAVE_MORE_THAN_ONE_ROOT,
- "DOM \u4E0A\u4E0D\u80FD\u6709\u591A\u4E2A\u6839!"},
-
- { ER_ARG_LOCALNAME_NULL,
- "\u53C2\u6570 'localName' \u4E3A\u7A7A\u503C"},
-
- // Note to translators: A QNAME has the syntactic form [NCName:]NCName
- // The localname is the portion after the optional colon; the message indicates
- // that there is a problem with that part of the QNAME.
- { ER_ARG_LOCALNAME_INVALID,
- "QNAME \u4E2D\u7684\u672C\u5730\u540D\u79F0\u5E94\u4E3A\u6709\u6548 NCName"},
-
- // Note to translators: A QNAME has the syntactic form [NCName:]NCName
- // The prefix is the portion before the optional colon; the message indicates
- // that there is a problem with that part of the QNAME.
- { ER_ARG_PREFIX_INVALID,
- "QNAME \u4E2D\u7684\u524D\u7F00\u5E94\u4E3A\u6709\u6548 NCName"},
-
- { ER_NAME_CANT_START_WITH_COLON,
- "\u540D\u79F0\u4E0D\u80FD\u4EE5\u5192\u53F7\u5F00\u5934"},
-
- { "BAD_CODE", "createMessage \u7684\u53C2\u6570\u8D85\u51FA\u8303\u56F4"},
- { "FORMAT_FAILED", "\u8C03\u7528 messageFormat \u65F6\u629B\u51FA\u5F02\u5E38\u9519\u8BEF"},
- { "line", "\u884C\u53F7"},
- { "column","\u5217\u53F7"},
-
- {ER_SERIALIZER_NOT_CONTENTHANDLER,
- "\u4E32\u884C\u5668\u7C7B ''{0}'' \u4E0D\u5B9E\u73B0 org.xml.sax.ContentHandler\u3002"},
-
- {ER_RESOURCE_COULD_NOT_FIND,
- "\u627E\u4E0D\u5230\u8D44\u6E90 [ {0} ]\u3002\n {1}" },
-
- {ER_RESOURCE_COULD_NOT_LOAD,
- "\u8D44\u6E90 [ {0} ] \u65E0\u6CD5\u52A0\u8F7D: {1} \n {2} \t {3}" },
-
- {ER_BUFFER_SIZE_LESSTHAN_ZERO,
- "\u7F13\u51B2\u533A\u5927\u5C0F <=0" },
-
- {ER_INVALID_UTF16_SURROGATE,
- "\u68C0\u6D4B\u5230\u65E0\u6548\u7684 UTF-16 \u4EE3\u7406: {0}?" },
-
- {ER_OIERROR,
- "IO \u9519\u8BEF" },
-
- {ER_ILLEGAL_ATTRIBUTE_POSITION,
- "\u5728\u751F\u6210\u5B50\u8282\u70B9\u4E4B\u540E\u6216\u5728\u751F\u6210\u5143\u7D20\u4E4B\u524D\u65E0\u6CD5\u6DFB\u52A0\u5C5E\u6027 {0}\u3002\u5C06\u5FFD\u7565\u5C5E\u6027\u3002"},
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- {ER_NAMESPACE_PREFIX,
- "\u6CA1\u6709\u8BF4\u660E\u540D\u79F0\u7A7A\u95F4\u524D\u7F00 ''{0}''\u3002" },
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- {ER_STRAY_ATTRIBUTE,
- "\u5C5E\u6027 ''{0}'' \u5728\u5143\u7D20\u5916\u90E8\u3002" },
-
- /*
- * Note to translators: As with the preceding message, a namespace
- * declaration has the form of an attribute and is only permitted to
- * appear on an element. The substitution text {0} is the namespace
- * prefix and {1} is the URI that was being used in the erroneous
- * namespace declaration.
- */
- {ER_STRAY_NAMESPACE,
- "\u540D\u79F0\u7A7A\u95F4\u58F0\u660E ''{0}''=''{1}'' \u5728\u5143\u7D20\u5916\u90E8\u3002" },
-
- {ER_COULD_NOT_LOAD_RESOURCE,
- "\u65E0\u6CD5\u52A0\u8F7D ''{0}'' (\u68C0\u67E5 CLASSPATH), \u73B0\u5728\u53EA\u4F7F\u7528\u9ED8\u8BA4\u503C"},
-
- { ER_ILLEGAL_CHARACTER,
- "\u5C1D\u8BD5\u8F93\u51FA\u672A\u4EE5{1}\u7684\u6307\u5B9A\u8F93\u51FA\u7F16\u7801\u8868\u793A\u7684\u6574\u6570\u503C {0} \u7684\u5B57\u7B26\u3002"},
-
- {ER_COULD_NOT_LOAD_METHOD_PROPERTY,
- "\u65E0\u6CD5\u4E3A\u8F93\u51FA\u65B9\u6CD5 ''{1}'' \u52A0\u8F7D\u5C5E\u6027\u6587\u4EF6 ''{0}'' (\u68C0\u67E5 CLASSPATH)" }
-
-
- };
-
- /**
- * Get the association list.
- *
- * @return The association list.
- */
-
- protected Object[][] getContents() {
- return contents;
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_zh_HK.java b/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_zh_HK.java
deleted file mode 100644
index 1a0d14a..0000000
--- a/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_zh_HK.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 1999-2003 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package com.sun.org.apache.xml.internal.res;
-
-/**
- * Set up error messages.
- * We build a two dimensional array of message keys and
- * message strings. In order to add a new message here,
- * you need to first add a String constant. And you need
- * to enter key, value pair as part of the contents
- * array. You also need to update MAX_CODE for error strings
- * and MAX_WARNING for warnings ( Needed for only information
- * purpose )
- */
-public class XMLErrorResources_zh_HK extends XMLErrorResources_zh_TW
-{
-
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_zh_TW.java b/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_zh_TW.java
deleted file mode 100644
index e1d1976..0000000
--- a/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_zh_TW.java
+++ /dev/null
@@ -1,450 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xml.internal.res;
-
-
-import java.util.ListResourceBundle;
-
-/**
- * Set up error messages.
- * We build a two dimensional array of message keys and
- * message strings. In order to add a new message here,
- * you need to first add a String constant. And you need
- * to enter key, value pair as part of the contents
- * array. You also need to update MAX_CODE for error strings
- * and MAX_WARNING for warnings ( Needed for only information
- * purpose )
- */
-public class XMLErrorResources_zh_TW extends ListResourceBundle
-{
-
-/*
- * This file contains error and warning messages related to Xalan Error
- * Handling.
- *
- * General notes to translators:
- *
- * 1) Xalan (or more properly, Xalan-interpretive) and XSLTC are names of
- * components.
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- * XSLTC is an acronym for XSLT Compiler.
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 5) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 6) "Translet" is an invented term that describes the class file that
- * results from compiling an XML stylesheet into a Java class.
- *
- * 7) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- */
-
- /** Maximum error messages, this is needed to keep track of the number of messages. */
- public static final int MAX_CODE = 61;
-
- /** Maximum warnings, this is needed to keep track of the number of warnings. */
- public static final int MAX_WARNING = 0;
-
- /** Maximum misc strings. */
- public static final int MAX_OTHERS = 4;
-
- /** Maximum total warnings and error messages. */
- public static final int MAX_MESSAGES = MAX_CODE + MAX_WARNING + 1;
-
-
- /*
- * Message keys
- */
- public static final String ER_FUNCTION_NOT_SUPPORTED = "ER_FUNCTION_NOT_SUPPORTED";
- public static final String ER_CANNOT_OVERWRITE_CAUSE = "ER_CANNOT_OVERWRITE_CAUSE";
- public static final String ER_NO_DEFAULT_IMPL = "ER_NO_DEFAULT_IMPL";
- public static final String ER_CHUNKEDINTARRAY_NOT_SUPPORTED = "ER_CHUNKEDINTARRAY_NOT_SUPPORTED";
- public static final String ER_OFFSET_BIGGER_THAN_SLOT = "ER_OFFSET_BIGGER_THAN_SLOT";
- public static final String ER_COROUTINE_NOT_AVAIL = "ER_COROUTINE_NOT_AVAIL";
- public static final String ER_COROUTINE_CO_EXIT = "ER_COROUTINE_CO_EXIT";
- public static final String ER_COJOINROUTINESET_FAILED = "ER_COJOINROUTINESET_FAILED";
- public static final String ER_COROUTINE_PARAM = "ER_COROUTINE_PARAM";
- public static final String ER_PARSER_DOTERMINATE_ANSWERS = "ER_PARSER_DOTERMINATE_ANSWERS";
- public static final String ER_NO_PARSE_CALL_WHILE_PARSING = "ER_NO_PARSE_CALL_WHILE_PARSING";
- public static final String ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED = "ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED";
- public static final String ER_ITERATOR_AXIS_NOT_IMPLEMENTED = "ER_ITERATOR_AXIS_NOT_IMPLEMENTED";
- public static final String ER_ITERATOR_CLONE_NOT_SUPPORTED = "ER_ITERATOR_CLONE_NOT_SUPPORTED";
- public static final String ER_UNKNOWN_AXIS_TYPE = "ER_UNKNOWN_AXIS_TYPE";
- public static final String ER_AXIS_NOT_SUPPORTED = "ER_AXIS_NOT_SUPPORTED";
- public static final String ER_NO_DTMIDS_AVAIL = "ER_NO_DTMIDS_AVAIL";
- public static final String ER_NOT_SUPPORTED = "ER_NOT_SUPPORTED";
- public static final String ER_NODE_NON_NULL = "ER_NODE_NON_NULL";
- public static final String ER_COULD_NOT_RESOLVE_NODE = "ER_COULD_NOT_RESOLVE_NODE";
- public static final String ER_STARTPARSE_WHILE_PARSING = "ER_STARTPARSE_WHILE_PARSING";
- public static final String ER_STARTPARSE_NEEDS_SAXPARSER = "ER_STARTPARSE_NEEDS_SAXPARSER";
- public static final String ER_COULD_NOT_INIT_PARSER = "ER_COULD_NOT_INIT_PARSER";
- public static final String ER_EXCEPTION_CREATING_POOL = "ER_EXCEPTION_CREATING_POOL";
- public static final String ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE = "ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE";
- public static final String ER_SCHEME_REQUIRED = "ER_SCHEME_REQUIRED";
- public static final String ER_NO_SCHEME_IN_URI = "ER_NO_SCHEME_IN_URI";
- public static final String ER_NO_SCHEME_INURI = "ER_NO_SCHEME_INURI";
- public static final String ER_PATH_INVALID_CHAR = "ER_PATH_INVALID_CHAR";
- public static final String ER_SCHEME_FROM_NULL_STRING = "ER_SCHEME_FROM_NULL_STRING";
- public static final String ER_SCHEME_NOT_CONFORMANT = "ER_SCHEME_NOT_CONFORMANT";
- public static final String ER_HOST_ADDRESS_NOT_WELLFORMED = "ER_HOST_ADDRESS_NOT_WELLFORMED";
- public static final String ER_PORT_WHEN_HOST_NULL = "ER_PORT_WHEN_HOST_NULL";
- public static final String ER_INVALID_PORT = "ER_INVALID_PORT";
- public static final String ER_FRAG_FOR_GENERIC_URI ="ER_FRAG_FOR_GENERIC_URI";
- public static final String ER_FRAG_WHEN_PATH_NULL = "ER_FRAG_WHEN_PATH_NULL";
- public static final String ER_FRAG_INVALID_CHAR = "ER_FRAG_INVALID_CHAR";
- public static final String ER_PARSER_IN_USE = "ER_PARSER_IN_USE";
- public static final String ER_CANNOT_CHANGE_WHILE_PARSING = "ER_CANNOT_CHANGE_WHILE_PARSING";
- public static final String ER_SELF_CAUSATION_NOT_PERMITTED = "ER_SELF_CAUSATION_NOT_PERMITTED";
- public static final String ER_NO_USERINFO_IF_NO_HOST = "ER_NO_USERINFO_IF_NO_HOST";
- public static final String ER_NO_PORT_IF_NO_HOST = "ER_NO_PORT_IF_NO_HOST";
- public static final String ER_NO_QUERY_STRING_IN_PATH = "ER_NO_QUERY_STRING_IN_PATH";
- public static final String ER_NO_FRAGMENT_STRING_IN_PATH = "ER_NO_FRAGMENT_STRING_IN_PATH";
- public static final String ER_CANNOT_INIT_URI_EMPTY_PARMS = "ER_CANNOT_INIT_URI_EMPTY_PARMS";
- public static final String ER_METHOD_NOT_SUPPORTED ="ER_METHOD_NOT_SUPPORTED";
- public static final String ER_INCRSAXSRCFILTER_NOT_RESTARTABLE = "ER_INCRSAXSRCFILTER_NOT_RESTARTABLE";
- public static final String ER_XMLRDR_NOT_BEFORE_STARTPARSE = "ER_XMLRDR_NOT_BEFORE_STARTPARSE";
- public static final String ER_AXIS_TRAVERSER_NOT_SUPPORTED = "ER_AXIS_TRAVERSER_NOT_SUPPORTED";
- public static final String ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER = "ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER";
- public static final String ER_SYSTEMID_UNKNOWN = "ER_SYSTEMID_UNKNOWN";
- public static final String ER_LOCATION_UNKNOWN = "ER_LOCATION_UNKNOWN";
- public static final String ER_PREFIX_MUST_RESOLVE = "ER_PREFIX_MUST_RESOLVE";
- public static final String ER_CREATEDOCUMENT_NOT_SUPPORTED = "ER_CREATEDOCUMENT_NOT_SUPPORTED";
- public static final String ER_CHILD_HAS_NO_OWNER_DOCUMENT = "ER_CHILD_HAS_NO_OWNER_DOCUMENT";
- public static final String ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT = "ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT";
- public static final String ER_CANT_OUTPUT_TEXT_BEFORE_DOC = "ER_CANT_OUTPUT_TEXT_BEFORE_DOC";
- public static final String ER_CANT_HAVE_MORE_THAN_ONE_ROOT = "ER_CANT_HAVE_MORE_THAN_ONE_ROOT";
- public static final String ER_ARG_LOCALNAME_NULL = "ER_ARG_LOCALNAME_NULL";
- public static final String ER_ARG_LOCALNAME_INVALID = "ER_ARG_LOCALNAME_INVALID";
- public static final String ER_ARG_PREFIX_INVALID = "ER_ARG_PREFIX_INVALID";
- public static final String ER_NAME_CANT_START_WITH_COLON = "ER_NAME_CANT_START_WITH_COLON";
-
- // Message keys used by the serializer
- public static final String ER_RESOURCE_COULD_NOT_FIND = "ER_RESOURCE_COULD_NOT_FIND";
- public static final String ER_RESOURCE_COULD_NOT_LOAD = "ER_RESOURCE_COULD_NOT_LOAD";
- public static final String ER_BUFFER_SIZE_LESSTHAN_ZERO = "ER_BUFFER_SIZE_LESSTHAN_ZERO";
- public static final String ER_INVALID_UTF16_SURROGATE = "ER_INVALID_UTF16_SURROGATE";
- public static final String ER_OIERROR = "ER_OIERROR";
- public static final String ER_NAMESPACE_PREFIX = "ER_NAMESPACE_PREFIX";
- public static final String ER_STRAY_ATTRIBUTE = "ER_STRAY_ATTIRBUTE";
- public static final String ER_STRAY_NAMESPACE = "ER_STRAY_NAMESPACE";
- public static final String ER_COULD_NOT_LOAD_RESOURCE = "ER_COULD_NOT_LOAD_RESOURCE";
- public static final String ER_COULD_NOT_LOAD_METHOD_PROPERTY = "ER_COULD_NOT_LOAD_METHOD_PROPERTY";
- public static final String ER_SERIALIZER_NOT_CONTENTHANDLER = "ER_SERIALIZER_NOT_CONTENTHANDLER";
- public static final String ER_ILLEGAL_ATTRIBUTE_POSITION = "ER_ILLEGAL_ATTRIBUTE_POSITION";
- public static final String ER_ILLEGAL_CHARACTER = "ER_ILLEGAL_CHARACTER";
-
- /*
- * Now fill in the message text.
- * Then fill in the message text for that message code in the
- * array. Use the new error code as the index into the array.
- */
-
- // Error messages...
-
- /** The lookup table for error messages. */
- private static final Object[][] contents = {
-
- /** Error message ID that has a null message, but takes in a single object. */
- {"ER0000" , "{0}" },
-
- { ER_FUNCTION_NOT_SUPPORTED,
- "\u4E0D\u652F\u63F4\u51FD\u6578\uFF01"},
-
- { ER_CANNOT_OVERWRITE_CAUSE,
- "\u7121\u6CD5\u8986\u5BEB\u539F\u56E0"},
-
- { ER_NO_DEFAULT_IMPL,
- "\u627E\u4E0D\u5230\u9810\u8A2D\u7684\u5BE6\u884C"},
-
- { ER_CHUNKEDINTARRAY_NOT_SUPPORTED,
- "\u76EE\u524D\u4E0D\u652F\u63F4 ChunkedIntArray({0})"},
-
- { ER_OFFSET_BIGGER_THAN_SLOT,
- "\u4F4D\u79FB\u5927\u65BC\u4F4D\u7F6E"},
-
- { ER_COROUTINE_NOT_AVAIL,
- "\u6C92\u6709\u53EF\u7528\u7684\u5171\u540C\u5E38\u5F0F\uFF0Cid={0}"},
-
- { ER_COROUTINE_CO_EXIT,
- "CoroutineManager \u6536\u5230 co_exit() \u8981\u6C42"},
-
- { ER_COJOINROUTINESET_FAILED,
- "co_joinCoroutineSet() \u5931\u6557"},
-
- { ER_COROUTINE_PARAM,
- "\u5171\u540C\u5E38\u5F0F\u53C3\u6578\u932F\u8AA4 ({0})"},
-
- { ER_PARSER_DOTERMINATE_ANSWERS,
- "\n\u672A\u9810\u671F: \u5256\u6790\u5668 doTerminate \u7B54\u8986 {0}"},
-
- { ER_NO_PARSE_CALL_WHILE_PARSING,
- "\u5256\u6790\u6642\u53EF\u80FD\u672A\u547C\u53EB parse"},
-
- { ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED,
- "\u932F\u8AA4: \u672A\u5BE6\u884C\u8EF8 {0} \u7684\u985E\u578B\u91CD\u8907\u7A0B\u5F0F"},
-
- { ER_ITERATOR_AXIS_NOT_IMPLEMENTED,
- "\u932F\u8AA4: \u672A\u5BE6\u884C\u8EF8 {0} \u7684\u91CD\u8907\u7A0B\u5F0F"},
-
- { ER_ITERATOR_CLONE_NOT_SUPPORTED,
- "\u4E0D\u652F\u63F4\u91CD\u8907\u7A0B\u5F0F\u8907\u88FD"},
-
- { ER_UNKNOWN_AXIS_TYPE,
- "\u4E0D\u660E\u7684\u8EF8\u5468\u904A\u985E\u578B: {0}"},
-
- { ER_AXIS_NOT_SUPPORTED,
- "\u4E0D\u652F\u63F4\u8EF8\u5468\u904A\u7A0B\u5F0F: {0}"},
-
- { ER_NO_DTMIDS_AVAIL,
- "\u4E0D\u518D\u6709\u53EF\u7528\u7684 DTM ID"},
-
- { ER_NOT_SUPPORTED,
- "\u4E0D\u652F\u63F4: {0}"},
-
- { ER_NODE_NON_NULL,
- "\u7BC0\u9EDE\u5FC5\u9808\u662F\u975E\u7A7A\u503C\u7684 getDTMHandleFromNode"},
-
- { ER_COULD_NOT_RESOLVE_NODE,
- "\u7121\u6CD5\u89E3\u6790\u7BC0\u9EDE\u70BA\u63A7\u5236\u4EE3\u78BC"},
-
- { ER_STARTPARSE_WHILE_PARSING,
- "\u5256\u6790\u6642\u53EF\u80FD\u672A\u547C\u53EB startParse"},
-
- { ER_STARTPARSE_NEEDS_SAXPARSER,
- "startParse \u9700\u8981\u975E\u7A7A\u503C SAXParser"},
-
- { ER_COULD_NOT_INIT_PARSER,
- "\u7121\u6CD5\u8D77\u59CB\u5256\u6790\u5668"},
-
- { ER_EXCEPTION_CREATING_POOL,
- "\u5EFA\u7ACB\u96C6\u5340\u7684\u65B0\u57F7\u884C\u8655\u7406\u6642\u767C\u751F\u7570\u5E38\u72C0\u6CC1"},
-
- { ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE,
- "\u8DEF\u5F91\u5305\u542B\u7121\u6548\u7684\u9041\u96E2\u5E8F\u5217"},
-
- { ER_SCHEME_REQUIRED,
- "\u914D\u7F6E\u662F\u5FC5\u8981\u7684\uFF01"},
-
- { ER_NO_SCHEME_IN_URI,
- "\u5728 URI \u4E2D\u627E\u4E0D\u5230\u914D\u7F6E: {0}"},
-
- { ER_NO_SCHEME_INURI,
- "\u5728 URI \u627E\u4E0D\u5230\u914D\u7F6E"},
-
- { ER_PATH_INVALID_CHAR,
- "\u8DEF\u5F91\u5305\u542B\u7121\u6548\u7684\u5B57\u5143: {0}"},
-
- { ER_SCHEME_FROM_NULL_STRING,
- "\u7121\u6CD5\u5F9E\u7A7A\u503C\u5B57\u4E32\u8A2D\u5B9A\u914D\u7F6E"},
-
- { ER_SCHEME_NOT_CONFORMANT,
- "\u914D\u7F6E\u4E0D\u4E00\u81F4\u3002"},
-
- { ER_HOST_ADDRESS_NOT_WELLFORMED,
- "\u4E3B\u6A5F\u6C92\u6709\u5B8C\u6574\u7684\u4F4D\u5740"},
-
- { ER_PORT_WHEN_HOST_NULL,
- "\u4E3B\u6A5F\u70BA\u7A7A\u503C\u6642\uFF0C\u7121\u6CD5\u8A2D\u5B9A\u9023\u63A5\u57E0"},
-
- { ER_INVALID_PORT,
- "\u7121\u6548\u7684\u9023\u63A5\u57E0\u865F\u78BC"},
-
- { ER_FRAG_FOR_GENERIC_URI,
- "\u53EA\u80FD\u5C0D\u4E00\u822C URI \u8A2D\u5B9A\u7247\u6BB5"},
-
- { ER_FRAG_WHEN_PATH_NULL,
- "\u8DEF\u5F91\u70BA\u7A7A\u503C\u6642\uFF0C\u7121\u6CD5\u8A2D\u5B9A\u7247\u6BB5"},
-
- { ER_FRAG_INVALID_CHAR,
- "\u7247\u6BB5\u5305\u542B\u7121\u6548\u7684\u5B57\u5143"},
-
- { ER_PARSER_IN_USE,
- "\u5256\u6790\u5668\u4F7F\u7528\u4E2D"},
-
- { ER_CANNOT_CHANGE_WHILE_PARSING,
- "\u5256\u6790\u6642\u7121\u6CD5\u8B8A\u66F4 {0} {1}"},
-
- { ER_SELF_CAUSATION_NOT_PERMITTED,
- "\u4E0D\u5141\u8A31\u81EA\u884C\u5F15\u767C"},
-
- { ER_NO_USERINFO_IF_NO_HOST,
- "\u5982\u679C\u6C92\u6709\u6307\u5B9A\u4E3B\u6A5F\uFF0C\u4E0D\u53EF\u6307\u5B9A Userinfo"},
-
- { ER_NO_PORT_IF_NO_HOST,
- "\u5982\u679C\u6C92\u6709\u6307\u5B9A\u4E3B\u6A5F\uFF0C\u4E0D\u53EF\u6307\u5B9A\u9023\u63A5\u57E0"},
-
- { ER_NO_QUERY_STRING_IN_PATH,
- "\u5728\u8DEF\u5F91\u53CA\u67E5\u8A62\u5B57\u4E32\u4E2D\u4E0D\u53EF\u6307\u5B9A\u67E5\u8A62\u5B57\u4E32"},
-
- { ER_NO_FRAGMENT_STRING_IN_PATH,
- "\u8DEF\u5F91\u548C\u7247\u6BB5\u4E0D\u80FD\u540C\u6642\u6307\u5B9A\u7247\u6BB5"},
-
- { ER_CANNOT_INIT_URI_EMPTY_PARMS,
- "\u7121\u6CD5\u4EE5\u7A7A\u767D\u53C3\u6578\u8D77\u59CB\u8A2D\u5B9A URI"},
-
- { ER_METHOD_NOT_SUPPORTED,
- "\u5C1A\u4E0D\u652F\u63F4\u65B9\u6CD5"},
-
- { ER_INCRSAXSRCFILTER_NOT_RESTARTABLE,
- "IncrementalSAXSource_Filter \u76EE\u524D\u7121\u6CD5\u91CD\u65B0\u555F\u52D5"},
-
- { ER_XMLRDR_NOT_BEFORE_STARTPARSE,
- "XMLReader \u4E0D\u80FD\u5728 startParse \u8981\u6C42\u4E4B\u524D"},
-
- { ER_AXIS_TRAVERSER_NOT_SUPPORTED,
- "\u4E0D\u652F\u63F4\u8EF8\u5468\u904A\u7A0B\u5F0F: {0}"},
-
- { ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER,
- "\u4F7F\u7528\u7A7A\u503C PrintWriter \u5EFA\u7ACB ListingErrorHandler\uFF01"},
-
- { ER_SYSTEMID_UNKNOWN,
- "\u4E0D\u660E\u7684 SystemId"},
-
- { ER_LOCATION_UNKNOWN,
- "\u4E0D\u660E\u7684\u932F\u8AA4\u4F4D\u7F6E"},
-
- { ER_PREFIX_MUST_RESOLVE,
- "\u524D\u7F6E\u78BC\u5FC5\u9808\u89E3\u6790\u70BA\u547D\u540D\u7A7A\u9593: {0}"},
-
- { ER_CREATEDOCUMENT_NOT_SUPPORTED,
- "XPathContext \u4E2D\u4E0D\u652F\u63F4 createDocument()\uFF01"},
-
- { ER_CHILD_HAS_NO_OWNER_DOCUMENT,
- "\u5C6C\u6027\u5B50\u9805\u4E0D\u5177\u6709\u64C1\u6709\u8005\u6587\u4EF6\uFF01"},
-
- { ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT,
- "\u5C6C\u6027\u5B50\u9805\u4E0D\u5177\u6709\u64C1\u6709\u8005\u6587\u4EF6\u5143\u7D20\uFF01"},
-
- { ER_CANT_OUTPUT_TEXT_BEFORE_DOC,
- "\u8B66\u544A: \u7121\u6CD5\u5728\u6587\u4EF6\u5143\u7D20\u4E4B\u524D\u8F38\u51FA\u6587\u5B57\uFF01\u6B63\u5728\u5FFD\u7565..."},
-
- { ER_CANT_HAVE_MORE_THAN_ONE_ROOT,
- "DOM \u7684\u6839\u4E0D\u80FD\u8D85\u904E\u4E00\u500B\uFF01"},
-
- { ER_ARG_LOCALNAME_NULL,
- "\u5F15\u6578 'localName' \u70BA\u7A7A\u503C"},
-
- // Note to translators: A QNAME has the syntactic form [NCName:]NCName
- // The localname is the portion after the optional colon; the message indicates
- // that there is a problem with that part of the QNAME.
- { ER_ARG_LOCALNAME_INVALID,
- "QNAME \u4E2D\u7684 Localname \u61C9\u70BA\u6709\u6548\u7684 NCName"},
-
- // Note to translators: A QNAME has the syntactic form [NCName:]NCName
- // The prefix is the portion before the optional colon; the message indicates
- // that there is a problem with that part of the QNAME.
- { ER_ARG_PREFIX_INVALID,
- "QNAME \u4E2D\u7684\u524D\u7F6E\u78BC\u61C9\u70BA\u6709\u6548\u7684 NCName"},
-
- { ER_NAME_CANT_START_WITH_COLON,
- "\u540D\u7A31\u4E0D\u80FD\u4EE5\u5192\u865F\u70BA\u958B\u982D"},
-
- { "BAD_CODE", "createMessage \u7684\u53C3\u6578\u8D85\u51FA\u7BC4\u570D"},
- { "FORMAT_FAILED", "messageFormat \u547C\u53EB\u671F\u9593\u767C\u751F\u7570\u5E38\u72C0\u6CC1"},
- { "line", "\u884C\u865F"},
- { "column","\u8CC7\u6599\u6B04\u7DE8\u865F"},
-
- {ER_SERIALIZER_NOT_CONTENTHANDLER,
- "serializer \u985E\u5225 ''{0}'' \u4E0D\u5BE6\u884C org.xml.sax.ContentHandler\u3002"},
-
- {ER_RESOURCE_COULD_NOT_FIND,
- "\u627E\u4E0D\u5230\u8CC7\u6E90 [ {0} ]\u3002\n{1}" },
-
- {ER_RESOURCE_COULD_NOT_LOAD,
- "\u7121\u6CD5\u8F09\u5165\u8CC7\u6E90 [ {0} ]: {1} \n {2} \t {3}" },
-
- {ER_BUFFER_SIZE_LESSTHAN_ZERO,
- "\u7DE9\u885D\u5340\u5927\u5C0F <=0" },
-
- {ER_INVALID_UTF16_SURROGATE,
- "\u5075\u6E2C\u5230\u7121\u6548\u7684 UTF-16 \u4EE3\u7406: {0}\uFF1F" },
-
- {ER_OIERROR,
- "IO \u932F\u8AA4" },
-
- {ER_ILLEGAL_ATTRIBUTE_POSITION,
- "\u5728\u7522\u751F\u5B50\u9805\u7BC0\u9EDE\u4E4B\u5F8C\uFF0C\u6216\u5728\u7522\u751F\u5143\u7D20\u4E4B\u524D\uFF0C\u4E0D\u53EF\u65B0\u589E\u5C6C\u6027 {0}\u3002\u5C6C\u6027\u6703\u88AB\u5FFD\u7565\u3002"},
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- {ER_NAMESPACE_PREFIX,
- "\u5B57\u9996 ''{0}'' \u7684\u547D\u540D\u7A7A\u9593\u5C1A\u672A\u5BA3\u544A\u3002" },
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- {ER_STRAY_ATTRIBUTE,
- "\u5C6C\u6027 ''{0}'' \u5728\u5143\u7D20\u4E4B\u5916\u3002" },
-
- /*
- * Note to translators: As with the preceding message, a namespace
- * declaration has the form of an attribute and is only permitted to
- * appear on an element. The substitution text {0} is the namespace
- * prefix and {1} is the URI that was being used in the erroneous
- * namespace declaration.
- */
- {ER_STRAY_NAMESPACE,
- "\u547D\u540D\u7A7A\u9593\u5BA3\u544A ''{0}''=''{1}'' \u8D85\u51FA\u5143\u7D20\u5916\u3002" },
-
- {ER_COULD_NOT_LOAD_RESOURCE,
- "\u7121\u6CD5\u8F09\u5165 ''{0}'' (\u6AA2\u67E5 CLASSPATH)\uFF0C\u76EE\u524D\u53EA\u4F7F\u7528\u9810\u8A2D\u503C"},
-
- { ER_ILLEGAL_CHARACTER,
- "\u5617\u8A66\u8F38\u51FA\u6574\u6578\u503C {0} \u7684\u5B57\u5143\uFF0C\u4F46\u662F\u5B83\u4E0D\u662F\u4EE5\u6307\u5B9A\u7684 {1} \u8F38\u51FA\u7DE8\u78BC\u5448\u73FE\u3002"},
-
- {ER_COULD_NOT_LOAD_METHOD_PROPERTY,
- "\u7121\u6CD5\u8F09\u5165\u8F38\u51FA\u65B9\u6CD5 ''{1}'' \u7684\u5C6C\u6027\u6A94 ''{0}'' (\u6AA2\u67E5 CLASSPATH)" }
-
-
- };
-
- /**
- * Get the association list.
- *
- * @return The association list.
- */
-
- protected Object[][] getContents() {
- return contents;
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/res/XMLMessages.java b/src/com/sun/org/apache/xml/internal/res/XMLMessages.java
deleted file mode 100644
index bb2f9bb..0000000
--- a/src/com/sun/org/apache/xml/internal/res/XMLMessages.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XMLMessages.java,v 1.2.4.1 2005/09/15 07:45:48 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.res;
-
-import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
-import java.util.ListResourceBundle;
-import java.util.Locale;
-
-/**
- * A utility class for issuing XML error messages.
- * @xsl.usage internal
- */
-public class XMLMessages
-{
-
- /** The local object to use. */
- protected Locale fLocale = Locale.getDefault();
-
- /** The language specific resource object for XML messages. */
- private static ListResourceBundle XMLBundle = null;
-
- /** The class name of the XML error message string table. */
- private static final String XML_ERROR_RESOURCES =
- "com.sun.org.apache.xml.internal.res.XMLErrorResources";
-
- /** String to use if a bad message code is used. */
- protected static final String BAD_CODE = "BAD_CODE";
-
- /** String to use if the message format operation failed. */
- protected static final String FORMAT_FAILED = "FORMAT_FAILED";
-
- /**
- * Set the Locale object to use.
- *
- * @param locale non-null reference to Locale object.
- */
- public void setLocale(Locale locale)
- {
- fLocale = locale;
- }
-
- /**
- * Get the Locale object that is being used.
- *
- * @return non-null reference to Locale object.
- */
- public Locale getLocale()
- {
- return fLocale;
- }
-
- /**
- * Creates a message from the specified key and replacement
- * arguments, localized to the given locale.
- *
- * @param msgKey The key for the message text.
- * @param args The arguments to be used as replacement text
- * in the message created.
- *
- * @return The formatted message string.
- */
- public static final String createXMLMessage(String msgKey, Object args[])
- {
- if (XMLBundle == null) {
- XMLBundle = SecuritySupport.getResourceBundle(XML_ERROR_RESOURCES);
- }
-
- if (XMLBundle != null)
- {
- return createMsg(XMLBundle, msgKey, args);
- }
- else
- return "Could not load any resource bundles.";
- }
-
- /**
- * Creates a message from the specified key and replacement
- * arguments, localized to the given locale.
- *
- * @param fResourceBundle The resource bundle to use.
- * @param msgKey The message key to use.
- * @param args The arguments to be used as replacement text
- * in the message created.
- *
- * @return The formatted message string.
- */
- public static final String createMsg(ListResourceBundle fResourceBundle,
- String msgKey, Object args[]) //throws Exception
- {
-
- String fmsg = null;
- boolean throwex = false;
- String msg = null;
-
- if (msgKey != null)
- msg = fResourceBundle.getString(msgKey);
-
- if (msg == null)
- {
- msg = fResourceBundle.getString(BAD_CODE);
- throwex = true;
- }
-
- if (args != null)
- {
- try
- {
-
- // Do this to keep format from crying.
- // This is better than making a bunch of conditional
- // code all over the place.
- int n = args.length;
-
- for (int i = 0; i < n; i++)
- {
- if (null == args[i])
- args[i] = "";
- }
-
- fmsg = java.text.MessageFormat.format(msg, args);
- }
- catch (Exception e)
- {
- fmsg = fResourceBundle.getString(FORMAT_FAILED);
- fmsg += " " + msg;
- }
- }
- else
- fmsg = msg;
-
- if (throwex)
- {
- throw new RuntimeException(fmsg);
- }
-
- return fmsg;
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/resolver/Catalog.java b/src/com/sun/org/apache/xml/internal/resolver/Catalog.java
deleted file mode 100644
index 9aff9f0..0000000
--- a/src/com/sun/org/apache/xml/internal/resolver/Catalog.java
+++ /dev/null
@@ -1,2204 +0,0 @@
-/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-// Catalog.java - Represents OASIS Open Catalog files.
-package com.sun.org.apache.xml.internal.resolver;
-
-import com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl;
-import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
-import com.sun.org.apache.xml.internal.resolver.helpers.FileURL;
-import com.sun.org.apache.xml.internal.resolver.helpers.PublicId;
-import com.sun.org.apache.xml.internal.resolver.readers.CatalogReader;
-import com.sun.org.apache.xml.internal.resolver.readers.OASISXMLCatalogReader;
-import com.sun.org.apache.xml.internal.resolver.readers.SAXCatalogReader;
-import com.sun.org.apache.xml.internal.resolver.readers.TR9401CatalogReader;
-
-import java.io.DataInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Vector;
-import javax.xml.parsers.SAXParserFactory;
-
-/**
- * Represents OASIS Open Catalog files.
- *
- * <p>This class implements the semantics of OASIS Open Catalog files
- * (defined by
- * <a href="http://www.oasis-open.org/html/a401.htm">OASIS Technical
- * Resolution 9401:1997 (Amendment 2 to TR 9401)</a>).</p>
- *
- * <p>The primary purpose of the Catalog is to associate resources in the
- * document with local system identifiers. Some entities
- * (document types, XML entities, and notations) have names and all of them
- * can have either public or system identifiers or both. (In XML, only a
- * notation can have a public identifier without a system identifier, but
- * the methods implemented in this class obey the Catalog semantics
- * from the SGML
- * days when system identifiers were optional.)</p>
- *
- * <p>The system identifiers returned by the resolution methods in this
- * class are valid, i.e. usable by, and in fact constructed by, the
- * <tt>java.net.URL</tt> class. Unfortunately, this class seems to behave in
- * somewhat non-standard ways and the system identifiers returned may
- * not be directly usable in a browser or filesystem context.
- *
- * <p>This class recognizes all of the Catalog entries defined in
- * TR9401:1997:</p>
- *
- * <ul>
- * <li><b>BASE</b>
- * changes the base URI for resolving relative system identifiers. The
- * initial base URI is the URI of the location of the catalog (which is,
- * in turn, relative to the location of the current working directory
- * at startup, as returned by the <tt>user.dir</tt> system property).</li>
- * <li><b>CATALOG</b>
- * processes other catalog files. An included catalog occurs logically
- * at the end of the including catalog.</li>
- * <li><b>DELEGATE_PUBLIC</b>
- * specifies alternate catalogs for some public identifiers. The delegated
- * catalogs are not loaded until they are needed, but they are cached
- * once loaded.</li>
- * <li><b>DELEGATE_SYSTEM</b>
- * specifies alternate catalogs for some system identifiers. The delegated
- * catalogs are not loaded until they are needed, but they are cached
- * once loaded.</li>
- * <li><b>DELEGATE_URI</b>
- * specifies alternate catalogs for some URIs. The delegated
- * catalogs are not loaded until they are needed, but they are cached
- * once loaded.</li>
- * <li><b>REWRITE_SYSTEM</b>
- * specifies alternate prefix for a system identifier.</li>
- * <li><b>REWRITE_URI</b>
- * specifies alternate prefix for a URI.</li>
- * <li><b>SYSTEM_SUFFIX</b>
- * maps any system identifier that ends with a particular suffix to another
- * system identifier.</li>
- * <li><b>URI_SUFFIX</b>
- * maps any URI that ends with a particular suffix to another URI.</li>
- * <li><b>DOCTYPE</b>
- * associates the names of root elements with URIs. (In other words, an XML
- * processor might infer the doctype of an XML document that does not include
- * a doctype declaration by looking for the DOCTYPE entry in the
- * catalog which matches the name of the root element of the document.)</li>
- * <li><b>DOCUMENT</b>
- * provides a default document.</li>
- * <li><b>DTDDECL</b>
- * recognized and silently ignored. Not relevant for XML.</li>
- * <li><b>ENTITY</b>
- * associates entity names with URIs.</li>
- * <li><b>LINKTYPE</b>
- * recognized and silently ignored. Not relevant for XML.</li>
- * <li><b>NOTATION</b>
- * associates notation names with URIs.</li>
- * <li><b>OVERRIDE</b>
- * changes the override behavior. Initial behavior is set by the
- * system property <tt>xml.catalog.override</tt>. The default initial
- * behavior is 'YES', that is, entries in the catalog override
- * system identifiers specified in the document.</li>
- * <li><b>PUBLIC</b>
- * maps a public identifier to a system identifier.</li>
- * <li><b>SGMLDECL</b>
- * recognized and silently ignored. Not relevant for XML.</li>
- * <li><b>SYSTEM</b>
- * maps a system identifier to another system identifier.</li>
- * <li><b>URI</b>
- * maps a URI to another URI.</li>
- * </ul>
- *
- * <p>Note that BASE entries are treated as described by RFC2396. In
- * particular, this has the counter-intuitive property that after a BASE
- * entry identifing "http://example.com/a/b/c" as the base URI,
- * the relative URI "foo" is resolved to the absolute URI
- * "http://example.com/a/b/foo". You must provide the trailing slash if
- * you do not want the final component of the path to be discarded as a
- * filename would in a URI for a resource: "http://example.com/a/b/c/".
- * </p>
- *
- * <p>Note that subordinate catalogs (all catalogs except the first,
- * including CATALOG and DELEGATE* catalogs) are only loaded if and when
- * they are required.</p>
- *
- * <p>This class relies on classes which implement the CatalogReader
- * interface to actually load catalog files. This allows the catalog
- * semantics to be implemented for TR9401 text-based catalogs, XML
- * catalogs, or any number of other storage formats.</p>
- *
- * <p>Additional catalogs may also be loaded with the
- * {@link #parseCatalog} method.</p>
- * </dd>
- * </dl>
- *
- * <p><b>Change Log:</b></p>
- * <dl>
- * <dt>2.0</dt>
- * <dd><p>Rewrite to use CatalogReaders.</p></dd>
- * <dt>1.1</dt>
- * <dd><p>Allow quoted components in <tt>xml.catalog.files</tt>
- * so that URLs containing colons can be used on Unix.
- * The string passed to <tt>xml.catalog.files</tt> can now have the form:</p>
- * <pre>
- * unquoted-path-with-no-sep-chars:"double-quoted path with or without sep chars":'single-quoted path with or without sep chars'
- * </pre>
- * <p>(Where ":" is the separater character in this example.)</p>
- * <p>If an unquoted path contains an embedded double or single quote
- * character, no special processig is performed on that character. No
- * path can contain separater characters, double, and single quotes
- * simultaneously.</p>
- * <p>Fix bug in calculation of BASE entries: if
- * a catalog contains multiple BASE entries, each is relative to the preceding
- * base, not the default base URI of the catalog.</p>
- * </dd>
- * <dt>1.0.1</dt>
- * <dd><p>Fixed a bug in the calculation of the list of subordinate catalogs.
- * This bug caused an infinite loop where parsing would alternately process
- * two catalogs indefinitely.</p>
- * </dd>
- * </dl>
- *
- * @see CatalogReader
- * @see CatalogEntry
- *
- * @author Norman Walsh
- * <a href="mailto:Norman.Walsh@Sun.COM">Norman.Walsh@Sun.COM</a>
- *
- * @version 1.0
- *
- * <p>Derived from public domain code originally published by Arbortext,
- * Inc.</p>
- */
-public class Catalog {
- /** The BASE Catalog Entry type. */
- public static final int BASE = CatalogEntry.addEntryType("BASE", 1);
-
- /** The CATALOG Catalog Entry type. */
- public static final int CATALOG = CatalogEntry.addEntryType("CATALOG", 1);
-
- /** The DOCUMENT Catalog Entry type. */
- public static final int DOCUMENT = CatalogEntry.addEntryType("DOCUMENT", 1);
-
- /** The OVERRIDE Catalog Entry type. */
- public static final int OVERRIDE = CatalogEntry.addEntryType("OVERRIDE", 1);
-
- /** The SGMLDECL Catalog Entry type. */
- public static final int SGMLDECL = CatalogEntry.addEntryType("SGMLDECL", 1);
-
- /** The DELEGATE_PUBLIC Catalog Entry type. */
- public static final int DELEGATE_PUBLIC = CatalogEntry.addEntryType("DELEGATE_PUBLIC", 2);
-
- /** The DELEGATE_SYSTEM Catalog Entry type. */
- public static final int DELEGATE_SYSTEM = CatalogEntry.addEntryType("DELEGATE_SYSTEM", 2);
-
- /** The DELEGATE_URI Catalog Entry type. */
- public static final int DELEGATE_URI = CatalogEntry.addEntryType("DELEGATE_URI", 2);
-
- /** The DOCTYPE Catalog Entry type. */
- public static final int DOCTYPE = CatalogEntry.addEntryType("DOCTYPE", 2);
-
- /** The DTDDECL Catalog Entry type. */
- public static final int DTDDECL = CatalogEntry.addEntryType("DTDDECL", 2);
-
- /** The ENTITY Catalog Entry type. */
- public static final int ENTITY = CatalogEntry.addEntryType("ENTITY", 2);
-
- /** The LINKTYPE Catalog Entry type. */
- public static final int LINKTYPE = CatalogEntry.addEntryType("LINKTYPE", 2);
-
- /** The NOTATION Catalog Entry type. */
- public static final int NOTATION = CatalogEntry.addEntryType("NOTATION", 2);
-
- /** The PUBLIC Catalog Entry type. */
- public static final int PUBLIC = CatalogEntry.addEntryType("PUBLIC", 2);
-
- /** The SYSTEM Catalog Entry type. */
- public static final int SYSTEM = CatalogEntry.addEntryType("SYSTEM", 2);
-
- /** The URI Catalog Entry type. */
- public static final int URI = CatalogEntry.addEntryType("URI", 2);
-
- /** The REWRITE_SYSTEM Catalog Entry type. */
- public static final int REWRITE_SYSTEM = CatalogEntry.addEntryType("REWRITE_SYSTEM", 2);
-
- /** The REWRITE_URI Catalog Entry type. */
- public static final int REWRITE_URI = CatalogEntry.addEntryType("REWRITE_URI", 2);
- /** The SYSTEM_SUFFIX Catalog Entry type. */
- public static final int SYSTEM_SUFFIX = CatalogEntry.addEntryType("SYSTEM_SUFFIX", 2);
- /** The URI_SUFFIX Catalog Entry type. */
- public static final int URI_SUFFIX = CatalogEntry.addEntryType("URI_SUFFIX", 2);
-
- /**
- * The base URI for relative system identifiers in the catalog.
- * This may be changed by BASE entries in the catalog.
- */
- protected URL base;
-
- /** The base URI of the Catalog file currently being parsed. */
- protected URL catalogCwd;
-
- /** The catalog entries currently known to the system. */
- protected Vector catalogEntries = new Vector();
-
- /** The default initial override setting. */
- protected boolean default_override = true;
-
- /** The catalog manager in use for this instance. */
- protected CatalogManager catalogManager = CatalogManager.getStaticManager();
-
- /**
- * A vector of catalog files to be loaded.
- *
- * <p>This list is initially established by
- * <code>loadSystemCatalogs</code> when
- * it parses the system catalog list, but CATALOG entries may
- * contribute to it during the course of parsing.</p>
- *
- * @see #loadSystemCatalogs
- * @see #localCatalogFiles
- */
- protected Vector catalogFiles = new Vector();
-
- /**
- * A vector of catalog files constructed during processing of
- * CATALOG entries in the current catalog.
- *
- * <p>This two-level system is actually necessary to correctly implement
- * the semantics of the CATALOG entry. If one catalog file includes
- * another with a CATALOG entry, the included catalog logically
- * occurs <i>at the end</i> of the including catalog, and after any
- * preceding CATALOG entries. In other words, the CATALOG entry
- * cannot insert anything into the middle of a catalog file.</p>
- *
- * <p>When processing reaches the end of each catalog files, any
- * elements on this vector are added to the front of the
- * <code>catalogFiles</code> vector.</p>
- *
- * @see #catalogFiles
- */
- protected Vector localCatalogFiles = new Vector();
-
- /**
- * A vector of Catalogs.
- *
- * <p>The semantics of Catalog resolution are such that each
- * catalog is effectively a list of Catalogs (in other words,
- * a recursive list of Catalog instances).</p>
- *
- * <p>Catalogs that are processed as the result of CATALOG or
- * DELEGATE* entries are subordinate to the catalog that contained
- * them, but they may in turn have subordinate catalogs.</p>
- *
- * <p>Catalogs are only loaded when they are needed, so this vector
- * initially contains a list of Catalog filenames (URLs). If, during
- * processing, one of these catalogs has to be loaded, the resulting
- * Catalog object is placed in the vector, effectively caching it
- * for the next query.</p>
- */
- protected Vector catalogs = new Vector();
-
- /**
- * A vector of DELEGATE* Catalog entries constructed during
- * processing of the Catalog.
- *
- * <p>This two-level system has two purposes; first, it allows
- * us to sort the DELEGATE* entries by the length of the partial
- * public identifier so that a linear search encounters them in
- * the correct order and second, it puts them all at the end of
- * the Catalog.</p>
- *
- * <p>When processing reaches the end of each catalog file, any
- * elements on this vector are added to the end of the
- * <code>catalogEntries</code> vector. This assures that matching
- * PUBLIC keywords are encountered before DELEGATE* entries.</p>
- */
- protected Vector localDelegate = new Vector();
-
- /**
- * A hash of CatalogReaders.
- *
- * <p>This hash maps MIME types to elements in the readerArr
- * vector. This allows the Catalog to quickly locate the reader
- * for a particular MIME type.</p>
- */
- protected Map<String, Integer> readerMap = new HashMap<>();
-
- /**
- * A vector of CatalogReaders.
- *
- * <p>This vector contains all of the readers in the order that they
- * were added. In the event that a catalog is read from a file, where
- * the MIME type is unknown, each reader is attempted in turn until
- * one succeeds.</p>
- */
- protected Vector readerArr = new Vector();
-
- /**
- * Constructs an empty Catalog.
- *
- * <p>The constructor interrogates the relevant system properties
- * using the default (static) CatalogManager
- * and initializes the catalog data structures.</p>
- */
- public Catalog() {
- // nop;
- }
-
- /**
- * Constructs an empty Catalog with a specific CatalogManager.
- *
- * <p>The constructor interrogates the relevant system properties
- * using the specified Catalog Manager
- * and initializes the catalog data structures.</p>
- */
- public Catalog(CatalogManager manager) {
- catalogManager = manager;
- }
-
- /**
- * Return the CatalogManager used by this catalog.
- *
- */
- public CatalogManager getCatalogManager() {
- return catalogManager;
- }
-
- /**
- * Establish the CatalogManager used by this catalog.
- *
- */
- public void setCatalogManager(CatalogManager manager) {
- catalogManager = manager;
- }
-
- /**
- * Setup readers.
- */
- public void setupReaders() {
- SAXParserFactory spf = catalogManager.useServicesMechanism() ?
- SAXParserFactory.newInstance() : new SAXParserFactoryImpl();
- spf.setNamespaceAware(true);
- spf.setValidating(false);
-
- SAXCatalogReader saxReader = new SAXCatalogReader(spf);
-
- saxReader.setCatalogParser(null, "XMLCatalog",
- "com.sun.org.apache.xml.internal.resolver.readers.XCatalogReader");
-
- saxReader.setCatalogParser(OASISXMLCatalogReader.namespaceName,
- "catalog",
- "com.sun.org.apache.xml.internal.resolver.readers.OASISXMLCatalogReader");
-
- addReader("application/xml", saxReader);
-
- TR9401CatalogReader textReader = new TR9401CatalogReader();
- addReader("text/plain", textReader);
- }
-
- /**
- * Add a new CatalogReader to the Catalog.
- *
- * <p>This method allows you to add a new CatalogReader to the
- * catalog. The reader will be associated with the specified mimeType.
- * You can only have one reader per mimeType.</p>
- *
- * <p>In the absence of a mimeType (e.g., when reading a catalog
- * directly from a file on the local system), the readers are attempted
- * in the order that you add them to the Catalog.</p>
- *
- * <p>Note that subordinate catalogs (created by CATALOG or
- * DELEGATE* entries) get a copy of the set of readers present in
- * the primary catalog when they are created. Readers added subsequently
- * will not be available. For this reason, it is best to add all
- * of the readers before the first call to parse a catalog.</p>
- *
- * @param mimeType The MIME type associated with this reader.
- * @param reader The CatalogReader to use.
- */
- public void addReader(String mimeType, CatalogReader reader) {
- if (readerMap.containsKey(mimeType)) {
- Integer pos = readerMap.get(mimeType);
- readerArr.set(pos, reader);
- } else {
- readerArr.add(reader);
- Integer pos = readerArr.size()-1;
- readerMap.put(mimeType, pos);
- }
- }
-
- /**
- * Copies the reader list from the current Catalog to a new Catalog.
- *
- * <p>This method is used internally when constructing a new catalog.
- * It copies the current reader associations over to the new catalog.
- * </p>
- *
- * @param newCatalog The new Catalog.
- */
- protected void copyReaders(Catalog newCatalog) {
- // Have to copy the readers in the right order...convert hash to arr
- Vector mapArr = new Vector(readerMap.size());
-
- // Pad the mapArr out to the right length
- for (int count = 0; count < readerMap.size(); count++) {
- mapArr.add(null);
- }
-
- for (Map.Entry<String, Integer> entry : readerMap.entrySet()) {
- mapArr.set(entry.getValue(), entry.getKey());
- }
-
- for (int count = 0; count < mapArr.size(); count++) {
- String mimeType = (String) mapArr.get(count);
- Integer pos = readerMap.get(mimeType);
- newCatalog.addReader(mimeType,
- (CatalogReader)
- readerArr.get(pos));
- }
- }
-
- /**
- * Create a new Catalog object.
- *
- * <p>This method constructs a new instance of the running Catalog
- * class (which might be a subtype of com.sun.org.apache.xml.internal.resolver.Catalog).
- * All new catalogs are managed by the same CatalogManager.
- * </p>
- *
- * <p>N.B. All Catalog subtypes should call newCatalog() to construct
- * a new Catalog. Do not simply use "new Subclass()" since that will
- * confuse future subclasses.</p>
- */
- protected Catalog newCatalog() {
- String catalogClass = this.getClass().getName();
-
- try {
- Catalog c = (Catalog) (Class.forName(catalogClass).newInstance());
- c.setCatalogManager(catalogManager);
- copyReaders(c);
- return c;
- } catch (ClassNotFoundException cnfe) {
- catalogManager.debug.message(1, "Class Not Found Exception: " + catalogClass);
- } catch (IllegalAccessException iae) {
- catalogManager.debug.message(1, "Illegal Access Exception: " + catalogClass);
- } catch (InstantiationException ie) {
- catalogManager.debug.message(1, "Instantiation Exception: " + catalogClass);
- } catch (ClassCastException cce) {
- catalogManager.debug.message(1, "Class Cast Exception: " + catalogClass);
- } catch (Exception e) {
- catalogManager.debug.message(1, "Other Exception: " + catalogClass);
- }
-
- Catalog c = new Catalog();
- c.setCatalogManager(catalogManager);
- copyReaders(c);
- return c;
- }
-
- /**
- * Returns the current base URI.
- */
- public String getCurrentBase() {
- return base.toString();
- }
-
- /**
- * Returns the default override setting associated with this
- * catalog.
- *
- * <p>All catalog files loaded by this catalog will have the
- * initial override setting specified by this default.</p>
- */
- public String getDefaultOverride() {
- if (default_override) {
- return "yes";
- } else {
- return "no";
- }
- }
-
- /**
- * Load the system catalog files.
- *
- * <p>The method adds all of the
- * catalogs specified in the <tt>xml.catalog.files</tt> property
- * to the Catalog list.</p>
- *
- * @throws MalformedURLException One of the system catalogs is
- * identified with a filename that is not a valid URL.
- * @throws IOException One of the system catalogs cannot be read.
- */
- public void loadSystemCatalogs()
- throws MalformedURLException, IOException {
-
- Vector catalogs = catalogManager.getCatalogFiles();
- if (catalogs != null) {
- for (int count = 0; count < catalogs.size(); count++) {
- catalogFiles.addElement(catalogs.elementAt(count));
- }
- }
-
- if (catalogFiles.size() > 0) {
- // This is a little odd. The parseCatalog() method expects
- // a filename, but it adds that name to the end of the
- // catalogFiles vector, and then processes that vector.
- // This allows the system to handle CATALOG entries
- // correctly.
- //
- // In this init case, we take the last element off the
- // catalogFiles vector and pass it to parseCatalog. This
- // will "do the right thing" in the init case, and allow
- // parseCatalog() to do the right thing in the non-init
- // case. Honest.
- //
- String catfile = (String) catalogFiles.lastElement();
- catalogFiles.removeElement(catfile);
- parseCatalog(catfile);
- }
- }
-
- /**
- * Parse a catalog file, augmenting internal data structures.
- *
- * @param fileName The filename of the catalog file to process
- *
- * @throws MalformedURLException The fileName cannot be turned into
- * a valid URL.
- * @throws IOException Error reading catalog file.
- */
- public synchronized void parseCatalog(String fileName)
- throws MalformedURLException, IOException {
-
- default_override = catalogManager.getPreferPublic();
- catalogManager.debug.message(4, "Parse catalog: " + fileName);
-
- // Put the file into the list of catalogs to process...
- // In all cases except the case when initCatalog() is the
- // caller, this will be the only catalog initially in the list...
- catalogFiles.addElement(fileName);
-
- // Now process all the pending catalogs...
- parsePendingCatalogs();
- }
-
- /**
- * Parse a catalog file, augmenting internal data structures.
- *
- * <p>Catalogs retrieved over the net may have an associated MIME type.
- * The MIME type can be used to select an appropriate reader.</p>
- *
- * @param mimeType The MIME type of the catalog file.
- * @param is The InputStream from which the catalog should be read
- *
- * @throws CatalogException Failed to load catalog
- * mimeType.
- * @throws IOException Error reading catalog file.
- */
- public synchronized void parseCatalog(String mimeType, InputStream is)
- throws IOException, CatalogException {
-
- default_override = catalogManager.getPreferPublic();
- catalogManager.debug.message(4, "Parse " + mimeType + " catalog on input stream");
-
- CatalogReader reader = null;
-
- if (readerMap.containsKey(mimeType)) {
- int arrayPos = ((Integer) readerMap.get(mimeType)).intValue();
- reader = (CatalogReader) readerArr.get(arrayPos);
- }
-
- if (reader == null) {
- String msg = "No CatalogReader for MIME type: " + mimeType;
- catalogManager.debug.message(2, msg);
- throw new CatalogException(CatalogException.UNPARSEABLE, msg);
- }
-
- reader.readCatalog(this, is);
-
- // Now process all the pending catalogs...
- parsePendingCatalogs();
- }
-
- /**
- * Parse a catalog document, augmenting internal data structures.
- *
- * <p>This method supports catalog files stored in jar files: e.g.,
- * jar:file:///path/to/filename.jar!/path/to/catalog.xml". That URI
- * doesn't survive transmogrification through the URI processing that
- * the parseCatalog(String) performs and passing it as an input stream
- * doesn't set the base URI appropriately.</p>
- *
- * <p>Written by Stefan Wachter (2002-09-26)</p>
- *
- * @param aUrl The URL of the catalog document to process
- *
- * @throws IOException Error reading catalog file.
- */
- public synchronized void parseCatalog(URL aUrl) throws IOException {
- catalogCwd = aUrl;
- base = aUrl;
-
- default_override = catalogManager.getPreferPublic();
- catalogManager.debug.message(4, "Parse catalog: " + aUrl.toString());
-
- DataInputStream inStream = null;
- boolean parsed = false;
-
- for (int count = 0; !parsed && count < readerArr.size(); count++) {
- CatalogReader reader = (CatalogReader) readerArr.get(count);
-
- try {
- inStream = new DataInputStream(aUrl.openStream());
- } catch (FileNotFoundException fnfe) {
- // No catalog; give up!
- break;
- }
-
- try {
- reader.readCatalog(this, inStream);
- parsed=true;
- } catch (CatalogException ce) {
- if (ce.getExceptionType() == CatalogException.PARSE_FAILED) {
- // give up!
- break;
- } else {
- // try again!
- }
- }
-
- try {
- inStream.close();
- } catch (IOException e) {
- //nop
- }
- }
-
- if (parsed) parsePendingCatalogs();
- }
-
- /**
- * Parse all of the pending catalogs.
- *
- * <p>Catalogs may refer to other catalogs, this method parses
- * all of the currently pending catalog files.</p>
- */
- protected synchronized void parsePendingCatalogs()
- throws MalformedURLException, IOException {
-
- if (!localCatalogFiles.isEmpty()) {
- // Move all the localCatalogFiles into the front of
- // the catalogFiles queue
- Vector newQueue = new Vector();
- Enumeration q = localCatalogFiles.elements();
- while (q.hasMoreElements()) {
- newQueue.addElement(q.nextElement());
- }
-
- // Put the rest of the catalogs on the end of the new list
- for (int curCat = 0; curCat < catalogFiles.size(); curCat++) {
- String catfile = (String) catalogFiles.elementAt(curCat);
- newQueue.addElement(catfile);
- }
-
- catalogFiles = newQueue;
- localCatalogFiles.clear();
- }
-
- // Suppose there are no catalog files to process, but the
- // single catalog already parsed included some delegate
- // entries? Make sure they don't get lost.
- if (catalogFiles.isEmpty() && !localDelegate.isEmpty()) {
- Enumeration e = localDelegate.elements();
- while (e.hasMoreElements()) {
- catalogEntries.addElement(e.nextElement());
- }
- localDelegate.clear();
- }
-
- // Now process all the files on the catalogFiles vector. This
- // vector can grow during processing if CATALOG entries are
- // encountered in the catalog
- while (!catalogFiles.isEmpty()) {
- String catfile = (String) catalogFiles.elementAt(0);
- try {
- catalogFiles.remove(0);
- } catch (ArrayIndexOutOfBoundsException e) {
- // can't happen
- }
-
- if (catalogEntries.size() == 0 && catalogs.size() == 0) {
- // We haven't parsed any catalogs yet, let this
- // catalog be the first...
- try {
- parseCatalogFile(catfile);
- } catch (CatalogException ce) {
- System.out.println("FIXME: " + ce.toString());
- }
- } else {
- // This is a subordinate catalog. We save its name,
- // but don't bother to load it unless it's necessary.
- catalogs.addElement(catfile);
- }
-
- if (!localCatalogFiles.isEmpty()) {
- // Move all the localCatalogFiles into the front of
- // the catalogFiles queue
- Vector newQueue = new Vector();
- Enumeration q = localCatalogFiles.elements();
- while (q.hasMoreElements()) {
- newQueue.addElement(q.nextElement());
- }
-
- // Put the rest of the catalogs on the end of the new list
- for (int curCat = 0; curCat < catalogFiles.size(); curCat++) {
- catfile = (String) catalogFiles.elementAt(curCat);
- newQueue.addElement(catfile);
- }
-
- catalogFiles = newQueue;
- localCatalogFiles.clear();
- }
-
- if (!localDelegate.isEmpty()) {
- Enumeration e = localDelegate.elements();
- while (e.hasMoreElements()) {
- catalogEntries.addElement(e.nextElement());
- }
- localDelegate.clear();
- }
- }
-
- // We've parsed them all, reinit the vector...
- catalogFiles.clear();
- }
-
- /**
- * Parse a single catalog file, augmenting internal data structures.
- *
- * @param fileName The filename of the catalog file to process
- *
- * @throws MalformedURLException The fileName cannot be turned into
- * a valid URL.
- * @throws IOException Error reading catalog file.
- */
- protected synchronized void parseCatalogFile(String fileName)
- throws MalformedURLException, IOException, CatalogException {
-
- CatalogEntry entry;
-
- // The base-base is the cwd. If the catalog file is specified
- // with a relative path, this assures that it gets resolved
- // properly...
- try {
- // tack on a basename because URLs point to files not dirs
- catalogCwd = FileURL.makeURL("basename");
- } catch (MalformedURLException e) {
- catalogManager.debug.message(1, "Malformed URL on cwd", "user.dir");
- catalogCwd = null;
- }
-
- // The initial base URI is the location of the catalog file
- try {
- base = new URL(catalogCwd, fixSlashes(fileName));
- } catch (MalformedURLException e) {
- try {
- base = new URL("file:" + fixSlashes(fileName));
- } catch (MalformedURLException e2) {
- catalogManager.debug.message(1, "Malformed URL on catalog filename",
- fixSlashes(fileName));
- base = null;
- }
- }
-
- catalogManager.debug.message(2, "Loading catalog", fileName);
- catalogManager.debug.message(4, "Default BASE", base.toString());
-
- fileName = base.toString();
-
- DataInputStream inStream = null;
- boolean parsed = false;
- boolean notFound = false;
-
- for (int count = 0; !parsed && count < readerArr.size(); count++) {
- CatalogReader reader = (CatalogReader) readerArr.get(count);
-
- try {
- notFound = false;
- inStream = new DataInputStream(base.openStream());
- } catch (FileNotFoundException fnfe) {
- // No catalog; give up!
- notFound = true;
- break;
- }
-
- try {
- reader.readCatalog(this, inStream);
- parsed = true;
- } catch (CatalogException ce) {
- if (ce.getExceptionType() == CatalogException.PARSE_FAILED) {
- // give up!
- break;
- } else {
- // try again!
- }
- }
-
- try {
- inStream.close();
- } catch (IOException e) {
- //nop
- }
- }
-
- if (!parsed) {
- if (notFound) {
- catalogManager.debug.message(3, "Catalog does not exist", fileName);
- } else {
- catalogManager.debug.message(1, "Failed to parse catalog", fileName);
- }
- }
- }
-
- /**
- * Cleanup and process a Catalog entry.
- *
- * <p>This method processes each Catalog entry, changing mapped
- * relative system identifiers into absolute ones (based on the current
- * base URI), and maintaining other information about the current
- * catalog.</p>
- *
- * @param entry The CatalogEntry to process.
- */
- public void addEntry(CatalogEntry entry) {
- int type = entry.getEntryType();
-
- if (type == BASE) {
- String value = entry.getEntryArg(0);
- URL newbase = null;
-
- if (base == null) {
- catalogManager.debug.message(5, "BASE CUR", "null");
- } else {
- catalogManager.debug.message(5, "BASE CUR", base.toString());
- }
- catalogManager.debug.message(4, "BASE STR", value);
-
- try {
- value = fixSlashes(value);
- newbase = new URL(base, value);
- } catch (MalformedURLException e) {
- try {
- newbase = new URL("file:" + value);
- } catch (MalformedURLException e2) {
- catalogManager.debug.message(1, "Malformed URL on base", value);
- newbase = null;
- }
- }
-
- if (newbase != null) {
- base = newbase;
- }
-
- catalogManager.debug.message(5, "BASE NEW", base.toString());
- } else if (type == CATALOG) {
- String fsi = makeAbsolute(entry.getEntryArg(0));
-
- catalogManager.debug.message(4, "CATALOG", fsi);
-
- localCatalogFiles.addElement(fsi);
- } else if (type == PUBLIC) {
- String publicid = PublicId.normalize(entry.getEntryArg(0));
- String systemid = makeAbsolute(normalizeURI(entry.getEntryArg(1)));
-
- entry.setEntryArg(0, publicid);
- entry.setEntryArg(1, systemid);
-
- catalogManager.debug.message(4, "PUBLIC", publicid, systemid);
-
- catalogEntries.addElement(entry);
- } else if (type == SYSTEM) {
- String systemid = normalizeURI(entry.getEntryArg(0));
- String fsi = makeAbsolute(normalizeURI(entry.getEntryArg(1)));
-
- entry.setEntryArg(1, fsi);
-
- catalogManager.debug.message(4, "SYSTEM", systemid, fsi);
-
- catalogEntries.addElement(entry);
- } else if (type == URI) {
- String uri = normalizeURI(entry.getEntryArg(0));
- String altURI = makeAbsolute(normalizeURI(entry.getEntryArg(1)));
-
- entry.setEntryArg(1, altURI);
-
- catalogManager.debug.message(4, "URI", uri, altURI);
-
- catalogEntries.addElement(entry);
- } else if (type == DOCUMENT) {
- String fsi = makeAbsolute(normalizeURI(entry.getEntryArg(0)));
- entry.setEntryArg(0, fsi);
-
- catalogManager.debug.message(4, "DOCUMENT", fsi);
-
- catalogEntries.addElement(entry);
- } else if (type == OVERRIDE) {
- catalogManager.debug.message(4, "OVERRIDE", entry.getEntryArg(0));
-
- catalogEntries.addElement(entry);
- } else if (type == SGMLDECL) {
- // meaningless in XML
- String fsi = makeAbsolute(normalizeURI(entry.getEntryArg(0)));
- entry.setEntryArg(0, fsi);
-
- catalogManager.debug.message(4, "SGMLDECL", fsi);
-
- catalogEntries.addElement(entry);
- } else if (type == DELEGATE_PUBLIC) {
- String ppi = PublicId.normalize(entry.getEntryArg(0));
- String fsi = makeAbsolute(normalizeURI(entry.getEntryArg(1)));
-
- entry.setEntryArg(0, ppi);
- entry.setEntryArg(1, fsi);
-
- catalogManager.debug.message(4, "DELEGATE_PUBLIC", ppi, fsi);
-
- addDelegate(entry);
- } else if (type == DELEGATE_SYSTEM) {
- String psi = normalizeURI(entry.getEntryArg(0));
- String fsi = makeAbsolute(normalizeURI(entry.getEntryArg(1)));
-
- entry.setEntryArg(0, psi);
- entry.setEntryArg(1, fsi);
-
- catalogManager.debug.message(4, "DELEGATE_SYSTEM", psi, fsi);
-
- addDelegate(entry);
- } else if (type == DELEGATE_URI) {
- String pui = normalizeURI(entry.getEntryArg(0));
- String fsi = makeAbsolute(normalizeURI(entry.getEntryArg(1)));
-
- entry.setEntryArg(0, pui);
- entry.setEntryArg(1, fsi);
-
- catalogManager.debug.message(4, "DELEGATE_URI", pui, fsi);
-
- addDelegate(entry);
- } else if (type == REWRITE_SYSTEM) {
- String psi = normalizeURI(entry.getEntryArg(0));
- String rpx = makeAbsolute(normalizeURI(entry.getEntryArg(1)));
-
- entry.setEntryArg(0, psi);
- entry.setEntryArg(1, rpx);
-
- catalogManager.debug.message(4, "REWRITE_SYSTEM", psi, rpx);
-
- catalogEntries.addElement(entry);
- } else if (type == REWRITE_URI) {
- String pui = normalizeURI(entry.getEntryArg(0));
- String upx = makeAbsolute(normalizeURI(entry.getEntryArg(1)));
-
- entry.setEntryArg(0, pui);
- entry.setEntryArg(1, upx);
-
- catalogManager.debug.message(4, "REWRITE_URI", pui, upx);
-
- catalogEntries.addElement(entry);
- } else if (type == SYSTEM_SUFFIX) {
- String pui = normalizeURI(entry.getEntryArg(0));
- String upx = makeAbsolute(normalizeURI(entry.getEntryArg(1)));
-
- entry.setEntryArg(0, pui);
- entry.setEntryArg(1, upx);
-
- catalogManager.debug.message(4, "SYSTEM_SUFFIX", pui, upx);
-
- catalogEntries.addElement(entry);
- } else if (type == URI_SUFFIX) {
- String pui = normalizeURI(entry.getEntryArg(0));
- String upx = makeAbsolute(normalizeURI(entry.getEntryArg(1)));
-
- entry.setEntryArg(0, pui);
- entry.setEntryArg(1, upx);
-
- catalogManager.debug.message(4, "URI_SUFFIX", pui, upx);
-
- catalogEntries.addElement(entry);
- } else if (type == DOCTYPE) {
- String fsi = makeAbsolute(normalizeURI(entry.getEntryArg(1)));
- entry.setEntryArg(1, fsi);
-
- catalogManager.debug.message(4, "DOCTYPE", entry.getEntryArg(0), fsi);
-
- catalogEntries.addElement(entry);
- } else if (type == DTDDECL) {
- // meaningless in XML
- String fpi = PublicId.normalize(entry.getEntryArg(0));
- entry.setEntryArg(0, fpi);
- String fsi = makeAbsolute(normalizeURI(entry.getEntryArg(1)));
- entry.setEntryArg(1, fsi);
-
- catalogManager.debug.message(4, "DTDDECL", fpi, fsi);
-
- catalogEntries.addElement(entry);
- } else if (type == ENTITY) {
- String fsi = makeAbsolute(normalizeURI(entry.getEntryArg(1)));
- entry.setEntryArg(1, fsi);
-
- catalogManager.debug.message(4, "ENTITY", entry.getEntryArg(0), fsi);
-
- catalogEntries.addElement(entry);
- } else if (type == LINKTYPE) {
- // meaningless in XML
- String fsi = makeAbsolute(normalizeURI(entry.getEntryArg(1)));
- entry.setEntryArg(1, fsi);
-
- catalogManager.debug.message(4, "LINKTYPE", entry.getEntryArg(0), fsi);
-
- catalogEntries.addElement(entry);
- } else if (type == NOTATION) {
- String fsi = makeAbsolute(normalizeURI(entry.getEntryArg(1)));
- entry.setEntryArg(1, fsi);
-
- catalogManager.debug.message(4, "NOTATION", entry.getEntryArg(0), fsi);
-
- catalogEntries.addElement(entry);
- } else {
- catalogEntries.addElement(entry);
- }
- }
-
- /**
- * Handle unknown CatalogEntry types.
- *
- * <p>This method exists to allow subclasses to deal with unknown
- * entry types.</p>
- */
- public void unknownEntry(Vector strings) {
- if (strings != null && strings.size() > 0) {
- String keyword = (String) strings.elementAt(0);
- catalogManager.debug.message(2, "Unrecognized token parsing catalog", keyword);
- }
- }
-
- /**
- * Parse all subordinate catalogs.
- *
- * <p>This method recursively parses all of the subordinate catalogs.
- * If this method does not throw an exception, you can be confident that
- * no subsequent call to any resolve*() method will either, with two
- * possible exceptions:</p>
- *
- * <ol>
- * <li><p>Delegated catalogs are re-parsed each time they are needed
- * (because a variable list of them may be needed in each case,
- * depending on the length of the matching partial public identifier).</p>
- * <p>But they are parsed by this method, so as long as they don't
- * change or disappear while the program is running, they shouldn't
- * generate errors later if they don't generate errors now.</p>
- * <li><p>If you add new catalogs with <code>parseCatalog</code>, they
- * won't be loaded until they are needed or until you call
- * <code>parseAllCatalogs</code> again.</p>
- * </ol>
- *
- * <p>On the other hand, if you don't call this method, you may
- * successfully parse documents without having to load all possible
- * catalogs.</p>
- *
- * @throws MalformedURLException The filename (URL) for a
- * subordinate or delegated catalog is not a valid URL.
- * @throws IOException Error reading some subordinate or delegated
- * catalog file.
- */
- public void parseAllCatalogs()
- throws MalformedURLException, IOException {
-
- // Parse all the subordinate catalogs
- for (int catPos = 0; catPos < catalogs.size(); catPos++) {
- Catalog c = null;
-
- try {
- c = (Catalog) catalogs.elementAt(catPos);
- } catch (ClassCastException e) {
- String catfile = (String) catalogs.elementAt(catPos);
- c = newCatalog();
-
- c.parseCatalog(catfile);
- catalogs.setElementAt(c, catPos);
- c.parseAllCatalogs();
- }
- }
-
- // Parse all the DELEGATE catalogs
- Enumeration en = catalogEntries.elements();
- while (en.hasMoreElements()) {
- CatalogEntry e = (CatalogEntry) en.nextElement();
- if (e.getEntryType() == DELEGATE_PUBLIC
- || e.getEntryType() == DELEGATE_SYSTEM
- || e.getEntryType() == DELEGATE_URI) {
- Catalog dcat = newCatalog();
- dcat.parseCatalog(e.getEntryArg(1));
- }
- }
- }
-
-
- /**
- * Return the applicable DOCTYPE system identifier.
- *
- * @param entityName The name of the entity (element) for which
- * a doctype is required.
- * @param publicId The nominal public identifier for the doctype
- * (as provided in the source document).
- * @param systemId The nominal system identifier for the doctype
- * (as provided in the source document).
- *
- * @return The system identifier to use for the doctype.
- *
- * @throws MalformedURLException The formal system identifier of a
- * subordinate catalog cannot be turned into a valid URL.
- * @throws IOException Error reading subordinate catalog file.
- */
- public String resolveDoctype(String entityName,
- String publicId,
- String systemId)
- throws MalformedURLException, IOException {
- String resolved = null;
-
- catalogManager.debug.message(3, "resolveDoctype("
- +entityName+","+publicId+","+systemId+")");
-
- systemId = normalizeURI(systemId);
-
- if (publicId != null && publicId.startsWith("urn:publicid:")) {
- publicId = PublicId.decodeURN(publicId);
- }
-
- if (systemId != null && systemId.startsWith("urn:publicid:")) {
- systemId = PublicId.decodeURN(systemId);
- if (publicId != null && !publicId.equals(systemId)) {
- catalogManager.debug.message(1, "urn:publicid: system identifier differs from public identifier; using public identifier");
- systemId = null;
- } else {
- publicId = systemId;
- systemId = null;
- }
- }
-
- if (systemId != null) {
- // If there's a SYSTEM entry in this catalog, use it
- resolved = resolveLocalSystem(systemId);
- if (resolved != null) {
- return resolved;
- }
- }
-
- if (publicId != null) {
- // If there's a PUBLIC entry in this catalog, use it
- resolved = resolveLocalPublic(DOCTYPE,
- entityName,
- publicId,
- systemId);
- if (resolved != null) {
- return resolved;
- }
- }
-
- // If there's a DOCTYPE entry in this catalog, use it
- boolean over = default_override;
- Enumeration en = catalogEntries.elements();
- while (en.hasMoreElements()) {
- CatalogEntry e = (CatalogEntry) en.nextElement();
- if (e.getEntryType() == OVERRIDE) {
- over = e.getEntryArg(0).equalsIgnoreCase("YES");
- continue;
- }
-
- if (e.getEntryType() == DOCTYPE
- && e.getEntryArg(0).equals(entityName)) {
- if (over || systemId == null) {
- return e.getEntryArg(1);
- }
- }
- }
-
- // Otherwise, look in the subordinate catalogs
- return resolveSubordinateCatalogs(DOCTYPE,
- entityName,
- publicId,
- systemId);
- }
-
- /**
- * Return the applicable DOCUMENT entry.
- *
- * @return The system identifier to use for the doctype.
- *
- * @throws MalformedURLException The formal system identifier of a
- * subordinate catalog cannot be turned into a valid URL.
- * @throws IOException Error reading subordinate catalog file.
- */
- public String resolveDocument()
- throws MalformedURLException, IOException {
- // If there's a DOCUMENT entry, return it
-
- catalogManager.debug.message(3, "resolveDocument");
-
- Enumeration en = catalogEntries.elements();
- while (en.hasMoreElements()) {
- CatalogEntry e = (CatalogEntry) en.nextElement();
- if (e.getEntryType() == DOCUMENT) {
- return e.getEntryArg(0);
- }
- }
-
- return resolveSubordinateCatalogs(DOCUMENT,
- null, null, null);
- }
-
- /**
- * Return the applicable ENTITY system identifier.
- *
- * @param entityName The name of the entity for which
- * a system identifier is required.
- * @param publicId The nominal public identifier for the entity
- * (as provided in the source document).
- * @param systemId The nominal system identifier for the entity
- * (as provided in the source document).
- *
- * @return The system identifier to use for the entity.
- *
- * @throws MalformedURLException The formal system identifier of a
- * subordinate catalog cannot be turned into a valid URL.
- * @throws IOException Error reading subordinate catalog file.
- */
- public String resolveEntity(String entityName,
- String publicId,
- String systemId)
- throws MalformedURLException, IOException {
- String resolved = null;
-
- catalogManager.debug.message(3, "resolveEntity("
- +entityName+","+publicId+","+systemId+")");
-
- systemId = normalizeURI(systemId);
-
- if (publicId != null && publicId.startsWith("urn:publicid:")) {
- publicId = PublicId.decodeURN(publicId);
- }
-
- if (systemId != null && systemId.startsWith("urn:publicid:")) {
- systemId = PublicId.decodeURN(systemId);
- if (publicId != null && !publicId.equals(systemId)) {
- catalogManager.debug.message(1, "urn:publicid: system identifier differs from public identifier; using public identifier");
- systemId = null;
- } else {
- publicId = systemId;
- systemId = null;
- }
- }
-
- if (systemId != null) {
- // If there's a SYSTEM entry in this catalog, use it
- resolved = resolveLocalSystem(systemId);
- if (resolved != null) {
- return resolved;
- }
- }
-
- if (publicId != null) {
- // If there's a PUBLIC entry in this catalog, use it
- resolved = resolveLocalPublic(ENTITY,
- entityName,
- publicId,
- systemId);
- if (resolved != null) {
- return resolved;
- }
- }
-
- // If there's a ENTITY entry in this catalog, use it
- boolean over = default_override;
- Enumeration en = catalogEntries.elements();
- while (en.hasMoreElements()) {
- CatalogEntry e = (CatalogEntry) en.nextElement();
- if (e.getEntryType() == OVERRIDE) {
- over = e.getEntryArg(0).equalsIgnoreCase("YES");
- continue;
- }
-
- if (e.getEntryType() == ENTITY
- && e.getEntryArg(0).equals(entityName)) {
- if (over || systemId == null) {
- return e.getEntryArg(1);
- }
- }
- }
-
- // Otherwise, look in the subordinate catalogs
- return resolveSubordinateCatalogs(ENTITY,
- entityName,
- publicId,
- systemId);
- }
-
- /**
- * Return the applicable NOTATION system identifier.
- *
- * @param notationName The name of the notation for which
- * a doctype is required.
- * @param publicId The nominal public identifier for the notation
- * (as provided in the source document).
- * @param systemId The nominal system identifier for the notation
- * (as provided in the source document).
- *
- * @return The system identifier to use for the notation.
- *
- * @throws MalformedURLException The formal system identifier of a
- * subordinate catalog cannot be turned into a valid URL.
- * @throws IOException Error reading subordinate catalog file.
- */
- public String resolveNotation(String notationName,
- String publicId,
- String systemId)
- throws MalformedURLException, IOException {
- String resolved = null;
-
- catalogManager.debug.message(3, "resolveNotation("
- +notationName+","+publicId+","+systemId+")");
-
- systemId = normalizeURI(systemId);
-
- if (publicId != null && publicId.startsWith("urn:publicid:")) {
- publicId = PublicId.decodeURN(publicId);
- }
-
- if (systemId != null && systemId.startsWith("urn:publicid:")) {
- systemId = PublicId.decodeURN(systemId);
- if (publicId != null && !publicId.equals(systemId)) {
- catalogManager.debug.message(1, "urn:publicid: system identifier differs from public identifier; using public identifier");
- systemId = null;
- } else {
- publicId = systemId;
- systemId = null;
- }
- }
-
- if (systemId != null) {
- // If there's a SYSTEM entry in this catalog, use it
- resolved = resolveLocalSystem(systemId);
- if (resolved != null) {
- return resolved;
- }
- }
-
- if (publicId != null) {
- // If there's a PUBLIC entry in this catalog, use it
- resolved = resolveLocalPublic(NOTATION,
- notationName,
- publicId,
- systemId);
- if (resolved != null) {
- return resolved;
- }
- }
-
- // If there's a NOTATION entry in this catalog, use it
- boolean over = default_override;
- Enumeration en = catalogEntries.elements();
- while (en.hasMoreElements()) {
- CatalogEntry e = (CatalogEntry) en.nextElement();
- if (e.getEntryType() == OVERRIDE) {
- over = e.getEntryArg(0).equalsIgnoreCase("YES");
- continue;
- }
-
- if (e.getEntryType() == NOTATION
- && e.getEntryArg(0).equals(notationName)) {
- if (over || systemId == null) {
- return e.getEntryArg(1);
- }
- }
- }
-
- // Otherwise, look in the subordinate catalogs
- return resolveSubordinateCatalogs(NOTATION,
- notationName,
- publicId,
- systemId);
- }
-
- /**
- * Return the applicable PUBLIC or SYSTEM identifier.
- *
- * <p>This method searches the Catalog and returns the system
- * identifier specified for the given system or
- * public identifiers. If
- * no appropriate PUBLIC or SYSTEM entry is found in the Catalog,
- * null is returned.</p>
- *
- * @param publicId The public identifier to locate in the catalog.
- * Public identifiers are normalized before comparison.
- * @param systemId The nominal system identifier for the entity
- * in question (as provided in the source document).
- *
- * @throws MalformedURLException The formal system identifier of a
- * subordinate catalog cannot be turned into a valid URL.
- * @throws IOException Error reading subordinate catalog file.
- *
- * @return The system identifier to use.
- * Note that the nominal system identifier is not returned if a
- * match is not found in the catalog, instead null is returned
- * to indicate that no match was found.
- */
- public String resolvePublic(String publicId, String systemId)
- throws MalformedURLException, IOException {
-
- catalogManager.debug.message(3, "resolvePublic("+publicId+","+systemId+")");
-
- systemId = normalizeURI(systemId);
-
- if (publicId != null && publicId.startsWith("urn:publicid:")) {
- publicId = PublicId.decodeURN(publicId);
- }
-
- if (systemId != null && systemId.startsWith("urn:publicid:")) {
- systemId = PublicId.decodeURN(systemId);
- if (publicId != null && !publicId.equals(systemId)) {
- catalogManager.debug.message(1, "urn:publicid: system identifier differs from public identifier; using public identifier");
- systemId = null;
- } else {
- publicId = systemId;
- systemId = null;
- }
- }
-
- // If there's a SYSTEM entry in this catalog, use it
- if (systemId != null) {
- String resolved = resolveLocalSystem(systemId);
- if (resolved != null) {
- return resolved;
- }
- }
-
- // If there's a PUBLIC entry in this catalog, use it
- String resolved = resolveLocalPublic(PUBLIC,
- null,
- publicId,
- systemId);
- if (resolved != null) {
- return resolved;
- }
-
- // Otherwise, look in the subordinate catalogs
- return resolveSubordinateCatalogs(PUBLIC,
- null,
- publicId,
- systemId);
- }
-
- /**
- * Return the applicable PUBLIC or SYSTEM identifier.
- *
- * <p>This method searches the Catalog and returns the system
- * identifier specified for the given system or public identifiers.
- * If no appropriate PUBLIC or SYSTEM entry is found in the Catalog,
- * delegated Catalogs are interrogated.</p>
- *
- * <p>There are four possible cases:</p>
- *
- * <ul>
- * <li>If the system identifier provided matches a SYSTEM entry
- * in the current catalog, the SYSTEM entry is returned.
- * <li>If the system identifier is not null, the PUBLIC entries
- * that were encountered when OVERRIDE YES was in effect are
- * interrogated and the first matching entry is returned.</li>
- * <li>If the system identifier is null, then all of the PUBLIC
- * entries are interrogated and the first matching entry
- * is returned. This may not be the same as the preceding case, if
- * some PUBLIC entries are encountered when OVERRIDE NO is in effect. In
- * XML, the only place where a public identifier may occur without
- * a system identifier is in a notation declaration.</li>
- * <li>Finally, if the public identifier matches one of the partial
- * public identifiers specified in a DELEGATE* entry in
- * the Catalog, the delegated catalog is interrogated. The first
- * time that the delegated catalog is required, it will be
- * retrieved and parsed. It is subsequently cached.
- * </li>
- * </ul>
- *
- * @param entityType The CatalogEntry type for which this query is
- * being conducted. This is necessary in order to do the approprate
- * query on a delegated catalog.
- * @param entityName The name of the entity being searched for, if
- * appropriate.
- * @param publicId The public identifier of the entity in question.
- * @param systemId The nominal system identifier for the entity
- * in question (as provided in the source document).
- *
- * @throws MalformedURLException The formal system identifier of a
- * delegated catalog cannot be turned into a valid URL.
- * @throws IOException Error reading delegated catalog file.
- *
- * @return The system identifier to use.
- * Note that the nominal system identifier is not returned if a
- * match is not found in the catalog, instead null is returned
- * to indicate that no match was found.
- */
- protected synchronized String resolveLocalPublic(int entityType,
- String entityName,
- String publicId,
- String systemId)
- throws MalformedURLException, IOException {
-
- // Always normalize the public identifier before attempting a match
- publicId = PublicId.normalize(publicId);
-
- // If there's a SYSTEM entry in this catalog, use it
- if (systemId != null) {
- String resolved = resolveLocalSystem(systemId);
- if (resolved != null) {
- return resolved;
- }
- }
-
- // If there's a PUBLIC entry in this catalog, use it
- boolean over = default_override;
- Enumeration en = catalogEntries.elements();
- while (en.hasMoreElements()) {
- CatalogEntry e = (CatalogEntry) en.nextElement();
- if (e.getEntryType() == OVERRIDE) {
- over = e.getEntryArg(0).equalsIgnoreCase("YES");
- continue;
- }
-
- if (e.getEntryType() == PUBLIC
- && e.getEntryArg(0).equals(publicId)) {
- if (over || systemId == null) {
- return e.getEntryArg(1);
- }
- }
- }
-
- // If there's a DELEGATE_PUBLIC entry in this catalog, use it
- over = default_override;
- en = catalogEntries.elements();
- Vector delCats = new Vector();
- while (en.hasMoreElements()) {
- CatalogEntry e = (CatalogEntry) en.nextElement();
- if (e.getEntryType() == OVERRIDE) {
- over = e.getEntryArg(0).equalsIgnoreCase("YES");
- continue;
- }
-
- if (e.getEntryType() == DELEGATE_PUBLIC
- && (over || systemId == null)) {
- String p = (String) e.getEntryArg(0);
- if (p.length() <= publicId.length()
- && p.equals(publicId.substring(0, p.length()))) {
- // delegate this match to the other catalog
-
- delCats.addElement(e.getEntryArg(1));
- }
- }
- }
-
- if (delCats.size() > 0) {
- Enumeration enCats = delCats.elements();
-
- if (catalogManager.debug.getDebug() > 1) {
- catalogManager.debug.message(2, "Switching to delegated catalog(s):");
- while (enCats.hasMoreElements()) {
- String delegatedCatalog = (String) enCats.nextElement();
- catalogManager.debug.message(2, "\t" + delegatedCatalog);
- }
- }
-
- Catalog dcat = newCatalog();
-
- enCats = delCats.elements();
- while (enCats.hasMoreElements()) {
- String delegatedCatalog = (String) enCats.nextElement();
- dcat.parseCatalog(delegatedCatalog);
- }
-
- return dcat.resolvePublic(publicId, null);
- }
-
- // Nada!
- return null;
- }
-
- /**
- * Return the applicable SYSTEM system identifier.
- *
- * <p>If a SYSTEM entry exists in the Catalog
- * for the system ID specified, return the mapped value.</p>
- *
- * <p>On Windows-based operating systems, the comparison between
- * the system identifier provided and the SYSTEM entries in the
- * Catalog is case-insensitive.</p>
- *
- * @param systemId The system ID to locate in the catalog.
- *
- * @return The resolved system identifier.
- *
- * @throws MalformedURLException The formal system identifier of a
- * subordinate catalog cannot be turned into a valid URL.
- * @throws IOException Error reading subordinate catalog file.
- */
- public String resolveSystem(String systemId)
- throws MalformedURLException, IOException {
-
- catalogManager.debug.message(3, "resolveSystem("+systemId+")");
-
- systemId = normalizeURI(systemId);
-
- if (systemId != null && systemId.startsWith("urn:publicid:")) {
- systemId = PublicId.decodeURN(systemId);
- return resolvePublic(systemId, null);
- }
-
- // If there's a SYSTEM entry in this catalog, use it
- if (systemId != null) {
- String resolved = resolveLocalSystem(systemId);
- if (resolved != null) {
- return resolved;
- }
- }
-
- // Otherwise, look in the subordinate catalogs
- return resolveSubordinateCatalogs(SYSTEM,
- null,
- null,
- systemId);
- }
-
- /**
- * Return the applicable SYSTEM system identifier in this
- * catalog.
- *
- * <p>If a SYSTEM entry exists in the catalog file
- * for the system ID specified, return the mapped value.</p>
- *
- * @param systemId The system ID to locate in the catalog
- *
- * @return The mapped system identifier or null
- */
- protected String resolveLocalSystem(String systemId)
- throws MalformedURLException, IOException {
-
- String osname = SecuritySupport.getSystemProperty("os.name");
- boolean windows = (osname.indexOf("Windows") >= 0);
- Enumeration en = catalogEntries.elements();
- while (en.hasMoreElements()) {
- CatalogEntry e = (CatalogEntry) en.nextElement();
- if (e.getEntryType() == SYSTEM
- && (e.getEntryArg(0).equals(systemId)
- || (windows
- && e.getEntryArg(0).equalsIgnoreCase(systemId)))) {
- return e.getEntryArg(1);
- }
- }
-
- // If there's a REWRITE_SYSTEM entry in this catalog, use it
- en = catalogEntries.elements();
- String startString = null;
- String prefix = null;
- while (en.hasMoreElements()) {
- CatalogEntry e = (CatalogEntry) en.nextElement();
-
- if (e.getEntryType() == REWRITE_SYSTEM) {
- String p = (String) e.getEntryArg(0);
- if (p.length() <= systemId.length()
- && p.equals(systemId.substring(0, p.length()))) {
- // Is this the longest prefix?
- if (startString == null
- || p.length() > startString.length()) {
- startString = p;
- prefix = e.getEntryArg(1);
- }
- }
- }
- }
-
- if (prefix != null) {
- // return the systemId with the new prefix
- return prefix + systemId.substring(startString.length());
- }
-
- // If there's a SYSTEM_SUFFIX entry in this catalog, use it
- en = catalogEntries.elements();
- String suffixString = null;
- String suffixURI = null;
- while (en.hasMoreElements()) {
- CatalogEntry e = (CatalogEntry) en.nextElement();
-
- if (e.getEntryType() == SYSTEM_SUFFIX) {
- String p = (String) e.getEntryArg(0);
- if (p.length() <= systemId.length()
- && systemId.endsWith(p)) {
- // Is this the longest prefix?
- if (suffixString == null
- || p.length() > suffixString.length()) {
- suffixString = p;
- suffixURI = e.getEntryArg(1);
- }
- }
- }
- }
-
- if (suffixURI != null) {
- // return the systemId for the suffix
- return suffixURI;
- }
-
- // If there's a DELEGATE_SYSTEM entry in this catalog, use it
- en = catalogEntries.elements();
- Vector delCats = new Vector();
- while (en.hasMoreElements()) {
- CatalogEntry e = (CatalogEntry) en.nextElement();
-
- if (e.getEntryType() == DELEGATE_SYSTEM) {
- String p = (String) e.getEntryArg(0);
- if (p.length() <= systemId.length()
- && p.equals(systemId.substring(0, p.length()))) {
- // delegate this match to the other catalog
-
- delCats.addElement(e.getEntryArg(1));
- }
- }
- }
-
- if (delCats.size() > 0) {
- Enumeration enCats = delCats.elements();
-
- if (catalogManager.debug.getDebug() > 1) {
- catalogManager.debug.message(2, "Switching to delegated catalog(s):");
- while (enCats.hasMoreElements()) {
- String delegatedCatalog = (String) enCats.nextElement();
- catalogManager.debug.message(2, "\t" + delegatedCatalog);
- }
- }
-
- Catalog dcat = newCatalog();
-
- enCats = delCats.elements();
- while (enCats.hasMoreElements()) {
- String delegatedCatalog = (String) enCats.nextElement();
- dcat.parseCatalog(delegatedCatalog);
- }
-
- return dcat.resolveSystem(systemId);
- }
-
- return null;
- }
-
- /**
- * Return the applicable URI.
- *
- * <p>If a URI entry exists in the Catalog
- * for the URI specified, return the mapped value.</p>
- *
- * <p>URI comparison is case sensitive.</p>
- *
- * @param uri The URI to locate in the catalog.
- *
- * @return The resolved URI.
- *
- * @throws MalformedURLException The system identifier of a
- * subordinate catalog cannot be turned into a valid URL.
- * @throws IOException Error reading subordinate catalog file.
- */
- public String resolveURI(String uri)
- throws MalformedURLException, IOException {
-
- catalogManager.debug.message(3, "resolveURI("+uri+")");
-
- uri = normalizeURI(uri);
-
- if (uri != null && uri.startsWith("urn:publicid:")) {
- uri = PublicId.decodeURN(uri);
- return resolvePublic(uri, null);
- }
-
- // If there's a URI entry in this catalog, use it
- if (uri != null) {
- String resolved = resolveLocalURI(uri);
- if (resolved != null) {
- return resolved;
- }
- }
-
- // Otherwise, look in the subordinate catalogs
- return resolveSubordinateCatalogs(URI,
- null,
- null,
- uri);
- }
-
- /**
- * Return the applicable URI in this catalog.
- *
- * <p>If a URI entry exists in the catalog file
- * for the URI specified, return the mapped value.</p>
- *
- * @param uri The URI to locate in the catalog
- *
- * @return The mapped URI or null
- */
- protected String resolveLocalURI(String uri)
- throws MalformedURLException, IOException {
- Enumeration en = catalogEntries.elements();
- while (en.hasMoreElements()) {
- CatalogEntry e = (CatalogEntry) en.nextElement();
- if (e.getEntryType() == URI
- && (e.getEntryArg(0).equals(uri))) {
- return e.getEntryArg(1);
- }
- }
-
- // If there's a REWRITE_URI entry in this catalog, use it
- en = catalogEntries.elements();
- String startString = null;
- String prefix = null;
- while (en.hasMoreElements()) {
- CatalogEntry e = (CatalogEntry) en.nextElement();
-
- if (e.getEntryType() == REWRITE_URI) {
- String p = (String) e.getEntryArg(0);
- if (p.length() <= uri.length()
- && p.equals(uri.substring(0, p.length()))) {
- // Is this the longest prefix?
- if (startString == null
- || p.length() > startString.length()) {
- startString = p;
- prefix = e.getEntryArg(1);
- }
- }
- }
- }
-
- if (prefix != null) {
- // return the uri with the new prefix
- return prefix + uri.substring(startString.length());
- }
-
- // If there's a URI_SUFFIX entry in this catalog, use it
- en = catalogEntries.elements();
- String suffixString = null;
- String suffixURI = null;
- while (en.hasMoreElements()) {
- CatalogEntry e = (CatalogEntry) en.nextElement();
-
- if (e.getEntryType() == URI_SUFFIX) {
- String p = (String) e.getEntryArg(0);
- if (p.length() <= uri.length()
- && uri.endsWith(p)) {
- // Is this the longest prefix?
- if (suffixString == null
- || p.length() > suffixString.length()) {
- suffixString = p;
- suffixURI = e.getEntryArg(1);
- }
- }
- }
- }
-
- if (suffixURI != null) {
- // return the uri for the suffix
- return suffixURI;
- }
-
- // If there's a DELEGATE_URI entry in this catalog, use it
- en = catalogEntries.elements();
- Vector delCats = new Vector();
- while (en.hasMoreElements()) {
- CatalogEntry e = (CatalogEntry) en.nextElement();
-
- if (e.getEntryType() == DELEGATE_URI) {
- String p = (String) e.getEntryArg(0);
- if (p.length() <= uri.length()
- && p.equals(uri.substring(0, p.length()))) {
- // delegate this match to the other catalog
-
- delCats.addElement(e.getEntryArg(1));
- }
- }
- }
-
- if (delCats.size() > 0) {
- Enumeration enCats = delCats.elements();
-
- if (catalogManager.debug.getDebug() > 1) {
- catalogManager.debug.message(2, "Switching to delegated catalog(s):");
- while (enCats.hasMoreElements()) {
- String delegatedCatalog = (String) enCats.nextElement();
- catalogManager.debug.message(2, "\t" + delegatedCatalog);
- }
- }
-
- Catalog dcat = newCatalog();
-
- enCats = delCats.elements();
- while (enCats.hasMoreElements()) {
- String delegatedCatalog = (String) enCats.nextElement();
- dcat.parseCatalog(delegatedCatalog);
- }
-
- return dcat.resolveURI(uri);
- }
-
- return null;
- }
-
- /**
- * Search the subordinate catalogs, in order, looking for a match.
- *
- * <p>This method searches the Catalog and returns the system
- * identifier specified for the given entity type with the given
- * name, public, and system identifiers. In some contexts, these
- * may be null.</p>
- *
- * @param entityType The CatalogEntry type for which this query is
- * being conducted. This is necessary in order to do the approprate
- * query on a subordinate catalog.
- * @param entityName The name of the entity being searched for, if
- * appropriate.
- * @param publicId The public identifier of the entity in question
- * (as provided in the source document).
- * @param systemId The nominal system identifier for the entity
- * in question (as provided in the source document). This parameter is
- * overloaded for the URI entry type.
- *
- * @throws MalformedURLException The formal system identifier of a
- * delegated catalog cannot be turned into a valid URL.
- * @throws IOException Error reading delegated catalog file.
- *
- * @return The system identifier to use.
- * Note that the nominal system identifier is not returned if a
- * match is not found in the catalog, instead null is returned
- * to indicate that no match was found.
- */
- protected synchronized String resolveSubordinateCatalogs(int entityType,
- String entityName,
- String publicId,
- String systemId)
- throws MalformedURLException, IOException {
-
- for (int catPos = 0; catPos < catalogs.size(); catPos++) {
- Catalog c = null;
-
- try {
- c = (Catalog) catalogs.elementAt(catPos);
- } catch (ClassCastException e) {
- String catfile = (String) catalogs.elementAt(catPos);
- c = newCatalog();
-
- try {
- c.parseCatalog(catfile);
- } catch (MalformedURLException mue) {
- catalogManager.debug.message(1, "Malformed Catalog URL", catfile);
- } catch (FileNotFoundException fnfe) {
- catalogManager.debug.message(1, "Failed to load catalog, file not found",
- catfile);
- } catch (IOException ioe) {
- catalogManager.debug.message(1, "Failed to load catalog, I/O error", catfile);
- }
-
- catalogs.setElementAt(c, catPos);
- }
-
- String resolved = null;
-
- // Ok, now what are we supposed to call here?
- if (entityType == DOCTYPE) {
- resolved = c.resolveDoctype(entityName,
- publicId,
- systemId);
- } else if (entityType == DOCUMENT) {
- resolved = c.resolveDocument();
- } else if (entityType == ENTITY) {
- resolved = c.resolveEntity(entityName,
- publicId,
- systemId);
- } else if (entityType == NOTATION) {
- resolved = c.resolveNotation(entityName,
- publicId,
- systemId);
- } else if (entityType == PUBLIC) {
- resolved = c.resolvePublic(publicId, systemId);
- } else if (entityType == SYSTEM) {
- resolved = c.resolveSystem(systemId);
- } else if (entityType == URI) {
- resolved = c.resolveURI(systemId);
- }
-
- if (resolved != null) {
- return resolved;
- }
- }
-
- return null;
- }
-
- // -----------------------------------------------------------------
-
- /**
- * Replace backslashes with forward slashes. (URLs always use
- * forward slashes.)
- *
- * @param sysid The input system identifier.
- * @return The same system identifier with backslashes turned into
- * forward slashes.
- */
- protected String fixSlashes (String sysid) {
- return sysid.replace('\\', '/');
- }
-
- /**
- * Construct an absolute URI from a relative one, using the current
- * base URI.
- *
- * @param sysid The (possibly relative) system identifier
- * @return The system identifier made absolute with respect to the
- * current {@link #base}.
- */
- protected String makeAbsolute(String sysid) {
- URL local = null;
-
- sysid = fixSlashes(sysid);
-
- try {
- local = new URL(base, sysid);
- } catch (MalformedURLException e) {
- catalogManager.debug.message(1, "Malformed URL on system identifier", sysid);
- }
-
- if (local != null) {
- return local.toString();
- } else {
- return sysid;
- }
- }
-
- /**
- * Perform character normalization on a URI reference.
- *
- * @param uriref The URI reference
- * @return The normalized URI reference.
- */
- protected String normalizeURI(String uriref) {
- if (uriref == null) {
- return null;
- }
-
- byte[] bytes;
- try {
- bytes = uriref.getBytes("UTF-8");
- } catch (UnsupportedEncodingException uee) {
- // this can't happen
- catalogManager.debug.message(1, "UTF-8 is an unsupported encoding!?");
- return uriref;
- }
-
- StringBuilder newRef = new StringBuilder(bytes.length);
- for (int count = 0; count < bytes.length; count++) {
- int ch = bytes[count] & 0xFF;
-
- if ((ch <= 0x20) // ctrl
- || (ch > 0x7F) // high ascii
- || (ch == 0x22) // "
- || (ch == 0x3C) // <
- || (ch == 0x3E) // >
- || (ch == 0x5C) // \
- || (ch == 0x5E) // ^
- || (ch == 0x60) // `
- || (ch == 0x7B) // {
- || (ch == 0x7C) // |
- || (ch == 0x7D) // }
- || (ch == 0x7F)) {
- newRef.append(encodedByte(ch));
- } else {
- newRef.append((char) bytes[count]);
- }
- }
-
- return newRef.toString();
- }
-
- /**
- * Perform %-encoding on a single byte.
- *
- * @param b The 8-bit integer that represents th byte. (Bytes are signed
- but encoding needs to look at the bytes unsigned.)
- * @return The %-encoded string for the byte in question.
- */
- protected String encodedByte (int b) {
- String hex = Integer.toHexString(b).toUpperCase();
- if (hex.length() < 2) {
- return "%0" + hex;
- } else {
- return "%" + hex;
- }
- }
-
- // -----------------------------------------------------------------
-
- /**
- * Add to the current list of delegated catalogs.
- *
- * <p>This method always constructs the {@link #localDelegate}
- * vector so that it is ordered by length of partial
- * public identifier.</p>
- *
- * @param entry The DELEGATE catalog entry
- */
- protected void addDelegate(CatalogEntry entry) {
- int pos = 0;
- String partial = entry.getEntryArg(0);
-
- Enumeration local = localDelegate.elements();
- while (local.hasMoreElements()) {
- CatalogEntry dpe = (CatalogEntry) local.nextElement();
- String dp = dpe.getEntryArg(0);
- if (dp.equals(partial)) {
- // we already have this prefix
- return;
- }
- if (dp.length() > partial.length()) {
- pos++;
- }
- if (dp.length() < partial.length()) {
- break;
- }
- }
-
- // now insert partial into the vector at [pos]
- if (localDelegate.size() == 0) {
- localDelegate.addElement(entry);
- } else {
- localDelegate.insertElementAt(entry, pos);
- }
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/resolver/CatalogEntry.java b/src/com/sun/org/apache/xml/internal/resolver/CatalogEntry.java
deleted file mode 100644
index 44b2af9..0000000
--- a/src/com/sun/org/apache/xml/internal/resolver/CatalogEntry.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-// CatalogEntry.java - Represents Catalog entries
-package com.sun.org.apache.xml.internal.resolver;
-
-import java.util.Map;
-import java.util.Vector;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.atomic.AtomicInteger;
-
-/**
- * Represents a Catalog entry.
- *
- * <p>Instances of this class represent individual entries
- * in a Catalog.</p>
- *
- * <p>Each catalog entry has a unique name and is associated with
- * an arbitrary number of arguments (all strings). For example, the
- * TR9401 catalog entry "PUBLIC" has two arguments, a public identifier
- * and a system identifier. Each entry has a unique numeric type,
- * assigned automatically when the entry type is created.</p>
- *
- * <p>The number and type of catalog entries is maintained
- * <em>statically</em>. Catalog classes, or their subclasses, can add
- * new entry types, but all Catalog objects share the same global pool
- * of types.</p>
- *
- * <p>Initially there are no valid entries.</p>
- *
- * @see Catalog
- *
- * @author Norman Walsh
- * <a href="mailto:Norman.Walsh@Sun.COM">Norman.Walsh@Sun.COM</a>
- *
- */
-public class CatalogEntry {
- /** The nextEntry is the ordinal number of the next entry type. */
- protected static AtomicInteger nextEntry = new AtomicInteger(0);
-
- /**
- * The entryTypes vector maps catalog entry names
- * (e.g., 'BASE' or 'SYSTEM') to their type (1, 2, etc.).
- * Names are case sensitive.
- */
- protected static final Map<String, Integer> entryTypes = new ConcurrentHashMap<>();
-
- /** The entryTypes vector maps catalog entry types to the
- number of arguments they're required to have. */
- protected static Vector entryArgs = new Vector();
-
- /**
- * Adds a new catalog entry type.
- *
- * @param name The name of the catalog entry type. This must be
- * unique among all types and is case-sensitive. (Adding a duplicate
- * name effectively replaces the old type with the new type.)
- * @param numArgs The number of arguments that this entry type
- * is required to have. There is no provision for variable numbers
- * of arguments.
- * @return The type for the new entry.
- */
- static int addEntryType(String name, int numArgs) {
- final int index = nextEntry.getAndIncrement();
- entryTypes.put(name, index);
- entryArgs.add(index, numArgs);
-
- return index;
- }
-
- /**
- * Lookup an entry type
- *
- * @param name The name of the catalog entry type.
- * @return The type of the catalog entry with the specified name.
- * @throws InvalidCatalogEntryTypeException if no entry has the
- * specified name.
- */
- public static int getEntryType(String name)
- throws CatalogException {
- if (!entryTypes.containsKey(name)) {
- throw new CatalogException(CatalogException.INVALID_ENTRY_TYPE);
- }
-
- Integer iType = entryTypes.get(name);
-
- if (iType == null) {
- throw new CatalogException(CatalogException.INVALID_ENTRY_TYPE);
- }
-
- return iType;
- }
-
- /**
- * Find out how many arguments an entry is required to have.
- *
- * @param name The name of the catalog entry type.
- * @return The number of arguments that entry type is required to have.
- * @throws InvalidCatalogEntryTypeException if no entry has the
- * specified name.
- */
- public static int getEntryArgCount(String name)
- throws CatalogException {
- return getEntryArgCount(getEntryType(name));
- }
-
- /**
- * Find out how many arguments an entry is required to have.
- *
- * @param type A valid catalog entry type.
- * @return The number of arguments that entry type is required to have.
- * @throws InvalidCatalogEntryTypeException if the type is invalid.
- */
- public static int getEntryArgCount(int type)
- throws CatalogException {
- try {
- Integer iArgs = (Integer) entryArgs.get(type);
- return iArgs.intValue();
- } catch (ArrayIndexOutOfBoundsException e) {
- throw new CatalogException(CatalogException.INVALID_ENTRY_TYPE);
- }
- }
-
- /** The entry type of this entry */
- protected int entryType = 0;
-
- /** The arguments associated with this entry */
- protected Vector args = null;
-
- /**
- * Null constructor; something for subclasses to call.
- */
- public CatalogEntry() {}
-
- /**
- * Construct a catalog entry of the specified type.
- *
- * @param name The name of the entry type
- * @param args A String Vector of arguments
- * @throws InvalidCatalogEntryTypeException if no such entry type
- * exists.
- * @throws InvalidCatalogEntryException if the wrong number of arguments
- * is passed.
- */
- public CatalogEntry(String name, Vector args)
- throws CatalogException {
- Integer iType = entryTypes.get(name);
-
- if (iType == null) {
- throw new CatalogException(CatalogException.INVALID_ENTRY_TYPE);
- }
-
- int type = iType;
-
- try {
- Integer iArgs = (Integer) entryArgs.get(type);
- if (iArgs.intValue() != args.size()) {
- throw new CatalogException(CatalogException.INVALID_ENTRY);
- }
- } catch (ArrayIndexOutOfBoundsException e) {
- throw new CatalogException(CatalogException.INVALID_ENTRY_TYPE);
- }
-
- entryType = type;
- this.args = args;
- }
-
- /**
- * Construct a catalog entry of the specified type.
- *
- * @param type The entry type
- * @param args A String Vector of arguments
- * @throws InvalidCatalogEntryTypeException if no such entry type
- * exists.
- * @throws InvalidCatalogEntryException if the wrong number of arguments
- * is passed.
- */
- public CatalogEntry(int type, Vector args)
- throws CatalogException {
- try {
- Integer iArgs = (Integer) entryArgs.get(type);
- if (iArgs.intValue() != args.size()) {
- throw new CatalogException(CatalogException.INVALID_ENTRY);
- }
- } catch (ArrayIndexOutOfBoundsException e) {
- throw new CatalogException(CatalogException.INVALID_ENTRY_TYPE);
- }
-
- entryType = type;
- this.args = args;
- }
-
- /**
- * Get the entry type.
- *
- * @return The entry type of the CatalogEntry
- */
- public int getEntryType() {
- return entryType;
- }
-
- /**
- * Get an entry argument.
- *
- * @param argNum The argument number (arguments are numbered from 0).
- * @return The specified argument or null if an invalid argNum is
- * provided.
- */
- public String getEntryArg(int argNum) {
- try {
- String arg = (String) args.get(argNum);
- return arg;
- } catch (ArrayIndexOutOfBoundsException e) {
- return null;
- }
- }
-
- /**
- * Set an entry argument.
- *
- * <p>Catalogs sometimes need to adjust the catlog entry parameters,
- * for example to make a relative URI absolute with respect to the
- * current base URI. But in general, this function should only be
- * called shortly after object creation to do some sort of cleanup.
- * Catalog entries should not mutate over time.</p>
- *
- * @param argNum The argument number (arguments are numbered from 0).
- * @throws ArrayIndexOutOfBoundsException if an invalid argument
- * number is provided.
- */
- public void setEntryArg(int argNum, String newspec)
- throws ArrayIndexOutOfBoundsException {
- args.set(argNum, newspec);
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/resolver/CatalogException.java b/src/com/sun/org/apache/xml/internal/resolver/CatalogException.java
deleted file mode 100644
index c0b5404..0000000
--- a/src/com/sun/org/apache/xml/internal/resolver/CatalogException.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-// CatalogException.java - Catalog exception
-
-/*
- * Copyright 2001-2004 The Apache Software Foundation or its licensors,
- * as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xml.internal.resolver;
-
-/**
- * Signal Catalog exception.
- *
- * <p>This exception is thrown if an error occurs loading a
- * catalog file.</p>
- *
- * @see Catalog
- *
- * @author Norman Walsh
- * <a href="mailto:Norman.Walsh@Sun.COM">Norman.Walsh@Sun.COM</a>
- *
- */
-public class CatalogException extends Exception {
- /** A wrapper around another exception */
- public static final int WRAPPER = 1;
- /** An invalid entry */
- public static final int INVALID_ENTRY = 2;
- /** An invalid entry type */
- public static final int INVALID_ENTRY_TYPE = 3;
- /** Could not instantiate an XML parser */
- public static final int NO_XML_PARSER = 4;
- /** Unknown XML format */
- public static final int UNKNOWN_FORMAT = 5;
- /** Unparseable XML catalog (not XML)*/
- public static final int UNPARSEABLE = 6;
- /** XML but parse failed */
- public static final int PARSE_FAILED = 7;
- /** Text catalog ended in mid-comment */
- public static final int UNENDED_COMMENT = 8;
-
- /**
- * The embedded exception if tunnelling, or null.
- */
- private Exception exception = null;
- private int exceptionType = 0;
-
- /**
- * Create a new CatalogException.
- *
- * @param type The exception type
- * @param message The error or warning message.
- */
- public CatalogException (int type, String message) {
- super(message);
- this.exceptionType = type;
- this.exception = null;
- }
-
- /**
- * Create a new CatalogException.
- *
- * @param type The exception type
- */
- public CatalogException (int type) {
- super("Catalog Exception " + type);
- this.exceptionType = type;
- this.exception = null;
- }
-
- /**
- * Create a new CatalogException wrapping an existing exception.
- *
- * <p>The existing exception will be embedded in the new
- * one, and its message will become the default message for
- * the CatalogException.</p>
- *
- * @param e The exception to be wrapped in a CatalogException.
- */
- public CatalogException (Exception e) {
- super();
- this.exceptionType = WRAPPER;
- this.exception = e;
- }
-
- /**
- * Create a new CatalogException from an existing exception.
- *
- * <p>The existing exception will be embedded in the new
- * one, but the new exception will have its own message.</p>
- *
- * @param message The detail message.
- * @param e The exception to be wrapped in a CatalogException.
- */
- public CatalogException (String message, Exception e) {
- super(message);
- this.exceptionType = WRAPPER;
- this.exception = e;
- }
-
- /**
- * Return a detail message for this exception.
- *
- * <p>If there is an embedded exception, and if the CatalogException
- * has no detail message of its own, this method will return
- * the detail message from the embedded exception.</p>
- *
- * @return The error or warning message.
- */
- public String getMessage ()
- {
- String message = super.getMessage();
-
- if (message == null && exception != null) {
- return exception.getMessage();
- } else {
- return message;
- }
- }
-
- /**
- * Return the embedded exception, if any.
- *
- * @return The embedded exception, or null if there is none.
- */
- public Exception getException ()
- {
- return exception;
- }
-
- /**
- * Return the exception type
- *
- * @return The exception type
- */
- public int getExceptionType ()
- {
- return exceptionType;
- }
-
- /**
- * Override toString to pick up any embedded exception.
- *
- * @return A string representation of this exception.
- */
- public String toString ()
- {
- if (exception != null) {
- return exception.toString();
- } else {
- return super.toString();
- }
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/resolver/CatalogManager.java b/src/com/sun/org/apache/xml/internal/resolver/CatalogManager.java
deleted file mode 100644
index ab8cd27..0000000
--- a/src/com/sun/org/apache/xml/internal/resolver/CatalogManager.java
+++ /dev/null
@@ -1,846 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-// CatalogManager.java - Access CatalogManager.properties
-
-/*
- * Copyright 2001-2004 The Apache Software Foundation or its licensors,
- * as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xml.internal.resolver;
-
-import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
-import com.sun.org.apache.xml.internal.resolver.helpers.BootstrapResolver;
-import com.sun.org.apache.xml.internal.resolver.helpers.Debug;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.MissingResourceException;
-import java.util.PropertyResourceBundle;
-import java.util.ResourceBundle;
-import java.util.StringTokenizer;
-import java.util.Vector;
-import sun.reflect.misc.ReflectUtil;
-
-/**
- * CatalogManager provides an interface to the catalog properties.
- *
- * <p>Properties can come from two places: from system properties or
- * from a <i>CatalogManager.properties</i> file. This class provides a transparent
- * interface to both, with system properties preferred over property file values.</p>
- *
- * <p>The following table summarizes the properties:</p>
- *
- * <table border="1">
- * <thead>
- * <tr>
- * <td>System Property</td>
- * <td>CatalogManager.properties<br/>Property</td>
- * <td>Description</td>
- * </tr>
- * </thead>
- * <tbody>
- * <tr>
- * <td>xml.catalog.ignoreMissing</td>
- * <td>&#160;</td>
- * <td>If true, a missing <i>CatalogManager.properties</i> file or missing properties
- * within that file will not generate warning messages. See also the
- * <i>ignoreMissingProperties</i> method.</td>
- * </tr>
- *
- * <tr>
- * <td>xml.catalog.files</td>
- * <td>catalogs</td>
- * <td>The <emph>semicolon-delimited</emph> list of catalog files.</td>
- * </tr>
- *
- * <tr>
- * <td>&#160;</td>
- * <td>relative-catalogs</td>
- * <td>If false, relative catalog URIs are made absolute with respect to the base URI of
- * the <i>CatalogManager.properties</i> file. This setting only applies to catalog
- * URIs obtained from the <i>catalogs</i> property <emph>in the</emph>
- * <i>CatalogManager.properties</i> file</td>
- * </tr>
- *
- * <tr>
- * <td>xml.catalog.verbosity</td>
- * <td>verbosity</td>
- * <td>If non-zero, the Catalog classes will print informative and debugging messages.
- * The higher the number, the more messages.</td>
- * </tr>
- *
- * <tr>
- * <td>xml.catalog.prefer</td>
- * <td>prefer</td>
- * <td>Which identifier is preferred, "public" or "system"?</td>
- * </tr>
- *
- * <tr>
- * <td>xml.catalog.staticCatalog</td>
- * <td>static-catalog</td>
- * <td>Should a single catalog be constructed for all parsing, or should a different
- * catalog be created for each parser?</td>
- * </tr>
- *
- * <tr>
- * <td>xml.catalog.allowPI</td>
- * <td>allow-oasis-xml-catalog-pi</td>
- * <td>If the source document contains "oasis-xml-catalog" processing instructions,
- * should they be used?</td>
- * </tr>
- *
- * <tr>
- * <td>xml.catalog.className</td>
- * <td>catalog-class-name</td>
- * <td>If you're using the convenience classes
- * <tt>com.sun.org.apache.xml.internal.resolver.tools.*</tt>), this setting
- * allows you to specify an alternate class name to use for the underlying
- * catalog.</td>
- * </tr>
- * </tbody>
- * </table>
- *
- * @see Catalog
- *
- * @author Norman Walsh
- * <a href="mailto:Norman.Walsh@Sun.COM">Norman.Walsh@Sun.COM</a>
- *
- * @version 1.0
- */
-
-public class CatalogManager {
- private static String pFiles = "xml.catalog.files";
- private static String pVerbosity = "xml.catalog.verbosity";
- private static String pPrefer = "xml.catalog.prefer";
- private static String pStatic = "xml.catalog.staticCatalog";
- private static String pAllowPI = "xml.catalog.allowPI";
- private static String pClassname = "xml.catalog.className";
- private static String pIgnoreMissing = "xml.catalog.ignoreMissing";
-
- /** A static CatalogManager instance for sharing */
- private static CatalogManager staticManager = new CatalogManager();
-
- /** The bootstrap resolver to use when loading XML Catalogs. */
- private BootstrapResolver bResolver = new BootstrapResolver();
-
- /** Flag to ignore missing property files and/or properties */
- private boolean ignoreMissingProperties
- = (SecuritySupport.getSystemProperty(pIgnoreMissing) != null
- || SecuritySupport.getSystemProperty(pFiles) != null);
-
- /** Holds the resources after they are loaded from the file. */
- private ResourceBundle resources;
-
- /** The name of the CatalogManager properties file. */
- private String propertyFile = "CatalogManager.properties";
-
- /** The location of the propertyFile */
- private URL propertyFileURI = null;
-
- /** Default catalog files list. */
- private String defaultCatalogFiles = "./xcatalog";
-
- /** Current catalog files list. */
- private String catalogFiles = null;
-
- /** Did the catalogFiles come from the properties file? */
- private boolean fromPropertiesFile = false;
-
- /** Default verbosity level if there is no property setting for it. */
- private int defaultVerbosity = 1;
-
- /** Current verbosity level. */
- private Integer verbosity = null;
-
- /** Default preference setting. */
- private boolean defaultPreferPublic = true;
-
- /** Current preference setting. */
- private Boolean preferPublic = null;
-
- /** Default setting of the static catalog flag. */
- private boolean defaultUseStaticCatalog = true;
-
- /** Current setting of the static catalog flag. */
- private Boolean useStaticCatalog = null;
-
- /** The static catalog used by this manager. */
- private static Catalog staticCatalog = null;
-
- /** Default setting of the oasisXMLCatalogPI flag. */
- private boolean defaultOasisXMLCatalogPI = true;
-
- /** Current setting of the oasisXMLCatalogPI flag. */
- private Boolean oasisXMLCatalogPI = null;
-
- /** Default setting of the relativeCatalogs flag. */
- private boolean defaultRelativeCatalogs = true;
-
- /** Current setting of the relativeCatalogs flag. */
- private Boolean relativeCatalogs = null;
-
- /** Current catalog class name. */
- private String catalogClassName = null;
- /**
- * Indicates whether implementation parts should use
- * service loader (or similar).
- * Note the default value (false) is the safe option..
- */
- private boolean useServicesMechanism;
-
- /** The manager's debug object. Used for printing debugging messages.
- *
- * <p>This field is public so that objects that have access to this
- * CatalogManager can use this debug object.</p>
- */
- public Debug debug = null;
-
- /** Constructor. */
- public CatalogManager() {
- init();
- }
-
- /** Constructor that specifies an explicit property file. */
- public CatalogManager(String propertyFile) {
- this.propertyFile = propertyFile;
- init();
- }
-
- private void init() {
- debug = new Debug();
- // Note that we don't setDebug() here; we do that lazily. Either the
- // user will set it explicitly, or we'll do it automagically if they
- // read from the propertyFile for some other reason. That way, there's
- // no attempt to read from the file before the caller has had a chance
- // to avoid it.
- if (System.getSecurityManager() == null) {
- useServicesMechanism = true;
- }
- }
- /** Set the bootstrap resolver.*/
- public void setBootstrapResolver(BootstrapResolver resolver) {
- bResolver = resolver;
- }
-
- /** Get the bootstrap resolver.*/
- public BootstrapResolver getBootstrapResolver() {
- return bResolver;
- }
-
- /**
- * Load the properties from the propertyFile and build the
- * resources from it.
- */
- private synchronized void readProperties() {
- try {
- propertyFileURI = CatalogManager.class.getResource("/"+propertyFile);
- InputStream in =
- CatalogManager.class.getResourceAsStream("/"+propertyFile);
- if (in==null) {
- if (!ignoreMissingProperties) {
- System.err.println("Cannot find "+propertyFile);
- // there's no reason to give this warning more than once
- ignoreMissingProperties = true;
- }
- return;
- }
- resources = new PropertyResourceBundle(in);
- } catch (MissingResourceException mre) {
- if (!ignoreMissingProperties) {
- System.err.println("Cannot read "+propertyFile);
- }
- } catch (java.io.IOException e) {
- if (!ignoreMissingProperties) {
- System.err.println("Failure trying to read "+propertyFile);
- }
- }
-
- // This is a bit of a hack. After we've successfully read the properties,
- // use them to set the default debug level, if the user hasn't already set
- // the default debug level.
- if (verbosity == null) {
- try {
- String verbStr = resources.getString("verbosity");
- int verb = Integer.parseInt(verbStr.trim());
- debug.setDebug(verb);
- verbosity = new Integer(verb);
- } catch (Exception e) {
- // nop
- }
- }
- }
-
- /**
- * Allow access to the static CatalogManager
- */
- public static CatalogManager getStaticManager() {
- return staticManager;
- }
-
- /**
- * How are missing properties handled?
- *
- * <p>If true, missing or unreadable property files will
- * not be reported. Otherwise, a message will be sent to System.err.
- * </p>
- */
- public boolean getIgnoreMissingProperties() {
- return ignoreMissingProperties;
- }
-
- /**
- * How should missing properties be handled?
- *
- * <p>If ignore is true, missing or unreadable property files will
- * not be reported. Otherwise, a message will be sent to System.err.
- * </p>
- */
- public void setIgnoreMissingProperties(boolean ignore) {
- ignoreMissingProperties = ignore;
- }
-
- /**
- * How are missing properties handled?
- *
- * <p>If ignore is true, missing or unreadable property files will
- * not be reported. Otherwise, a message will be sent to System.err.
- * </p>
- *
- * @deprecated No longer static; use get/set methods.
- */
- public void ignoreMissingProperties(boolean ignore) {
- setIgnoreMissingProperties(ignore);
- }
-
- /**
- * Obtain the verbosity setting from the properties.
- *
- * @return The verbosity level from the propertyFile or the
- * defaultVerbosity.
- */
- private int queryVerbosity () {
- String defaultVerbStr = Integer.toString(defaultVerbosity);
-
- String verbStr = SecuritySupport.getSystemProperty(pVerbosity);
-
- if (verbStr == null) {
- if (resources==null) readProperties();
- if (resources != null) {
- try {
- verbStr = resources.getString("verbosity");
- } catch (MissingResourceException e) {
- verbStr = defaultVerbStr;
- }
- } else {
- verbStr = defaultVerbStr;
- }
- }
-
- int verb = defaultVerbosity;
-
- try {
- verb = Integer.parseInt(verbStr.trim());
- } catch (Exception e) {
- System.err.println("Cannot parse verbosity: \"" + verbStr + "\"");
- }
-
- // This is a bit of a hack. After we've successfully got the verbosity,
- // we have to use it to set the default debug level,
- // if the user hasn't already set the default debug level.
- if (verbosity == null) {
- debug.setDebug(verb);
- verbosity = new Integer(verb);
- }
-
- return verb;
- }
-
- /**
- * What is the current verbosity?
- */
- public int getVerbosity() {
- if (verbosity == null) {
- verbosity = new Integer(queryVerbosity());
- }
-
- return verbosity.intValue();
- }
-
- /**
- * Set the current verbosity.
- */
- public void setVerbosity (int verbosity) {
- this.verbosity = new Integer(verbosity);
- debug.setDebug(verbosity);
- }
-
- /**
- * What is the current verbosity?
- *
- * @deprecated No longer static; use get/set methods.
- */
- public int verbosity () {
- return getVerbosity();
- }
-
- /**
- * Obtain the relativeCatalogs setting from the properties.
- *
- * @return The relativeCatalogs setting from the propertyFile or the
- * defaultRelativeCatalogs.
- */
- private boolean queryRelativeCatalogs () {
- if (resources==null) readProperties();
-
- if (resources==null) return defaultRelativeCatalogs;
-
- try {
- String allow = resources.getString("relative-catalogs");
- return (allow.equalsIgnoreCase("true")
- || allow.equalsIgnoreCase("yes")
- || allow.equalsIgnoreCase("1"));
- } catch (MissingResourceException e) {
- return defaultRelativeCatalogs;
- }
- }
-
- /**
- * Get the relativeCatalogs setting.
- *
- * <p>This property is used when the catalogFiles property is
- * interrogated. If true, then relative catalog entry file names
- * are returned. If false, relative catalog entry file names are
- * made absolute with respect to the properties file before returning
- * them.</p>
- *
- * <p>This property <emph>only applies</emph> when the catalog files
- * come from a properties file. If they come from a system property or
- * the default list, they are never considered relative. (What would
- * they be relative to?)</p>
- *
- * <p>In the properties, a value of 'yes', 'true', or '1' is considered
- * true, anything else is false.</p>
- *
- * @return The relativeCatalogs setting from the propertyFile or the
- * defaultRelativeCatalogs.
- */
- public boolean getRelativeCatalogs () {
- if (relativeCatalogs == null) {
- relativeCatalogs = new Boolean(queryRelativeCatalogs());
- }
-
- return relativeCatalogs.booleanValue();
- }
-
- /**
- * Set the relativeCatalogs setting.
- *
- * @see #getRelativeCatalogs()
- */
- public void setRelativeCatalogs (boolean relative) {
- relativeCatalogs = new Boolean(relative);
- }
-
- /**
- * Get the relativeCatalogs setting.
- *
- * @deprecated No longer static; use get/set methods.
- */
- public boolean relativeCatalogs () {
- return getRelativeCatalogs();
- }
-
- /**
- * Obtain the list of catalog files from the properties.
- *
- * @return A semicolon delimited list of catlog file URIs
- */
- private String queryCatalogFiles () {
- String catalogList = SecuritySupport.getSystemProperty(pFiles);
- fromPropertiesFile = false;
-
- if (catalogList == null) {
- if (resources == null) readProperties();
- if (resources != null) {
- try {
- catalogList = resources.getString("catalogs");
- fromPropertiesFile = true;
- } catch (MissingResourceException e) {
- System.err.println(propertyFile + ": catalogs not found.");
- catalogList = null;
- }
- }
- }
-
- if (catalogList == null) {
- catalogList = defaultCatalogFiles;
- }
-
- return catalogList;
- }
-
- /**
- * Return the current list of catalog files.
- *
- * @return A vector of the catalog file names or null if no catalogs
- * are available in the properties.
- */
- public Vector getCatalogFiles() {
- if (catalogFiles == null) {
- catalogFiles = queryCatalogFiles();
- }
-
- StringTokenizer files = new StringTokenizer(catalogFiles, ";");
- Vector catalogs = new Vector();
- while (files.hasMoreTokens()) {
- String catalogFile = files.nextToken();
- URL absURI = null;
-
- if (fromPropertiesFile && !relativeCatalogs()) {
- try {
- absURI = new URL(propertyFileURI, catalogFile);
- catalogFile = absURI.toString();
- } catch (MalformedURLException mue) {
- absURI = null;
- }
- }
-
- catalogs.add(catalogFile);
- }
-
- return catalogs;
- }
-
- /**
- * Set the list of catalog files.
- */
- public void setCatalogFiles(String fileList) {
- catalogFiles = fileList;
- fromPropertiesFile = false;
- }
-
- /**
- * Return the current list of catalog files.
- *
- * @return A vector of the catalog file names or null if no catalogs
- * are available in the properties.
- *
- * @deprecated No longer static; use get/set methods.
- */
- public Vector catalogFiles() {
- return getCatalogFiles();
- }
-
- /**
- * Obtain the preferPublic setting from the properties.
- *
- * <p>In the properties, a value of 'public' is true,
- * anything else is false.</p>
- *
- * @return True if prefer is public or the
- * defaultPreferSetting.
- */
- private boolean queryPreferPublic () {
- String prefer = SecuritySupport.getSystemProperty(pPrefer);
-
- if (prefer == null) {
- if (resources==null) readProperties();
- if (resources==null) return defaultPreferPublic;
- try {
- prefer = resources.getString("prefer");
- } catch (MissingResourceException e) {
- return defaultPreferPublic;
- }
- }
-
- if (prefer == null) {
- return defaultPreferPublic;
- }
-
- return (prefer.equalsIgnoreCase("public"));
- }
-
- /**
- * Return the current prefer public setting.
- *
- * @return True if public identifiers are preferred.
- */
- public boolean getPreferPublic () {
- if (preferPublic == null) {
- preferPublic = new Boolean(queryPreferPublic());
- }
- return preferPublic.booleanValue();
- }
-
- /**
- * Set the prefer public setting.
- */
- public void setPreferPublic (boolean preferPublic) {
- this.preferPublic = new Boolean(preferPublic);
- }
-
- /**
- * Return the current prefer public setting.
- *
- * @return True if public identifiers are preferred.
- *
- * @deprecated No longer static; use get/set methods.
- */
- public boolean preferPublic () {
- return getPreferPublic();
- }
-
- /**
- * Obtain the static-catalog setting from the properties.
- *
- * <p>In the properties, a value of 'yes', 'true', or '1' is considered
- * true, anything else is false.</p>
- *
- * @return The static-catalog setting from the propertyFile or the
- * defaultUseStaticCatalog.
- */
- private boolean queryUseStaticCatalog () {
- String staticCatalog = SecuritySupport.getSystemProperty(pStatic);
-
- if (staticCatalog == null) {
- if (resources==null) readProperties();
- if (resources==null) return defaultUseStaticCatalog;
- try {
- staticCatalog = resources.getString("static-catalog");
- } catch (MissingResourceException e) {
- return defaultUseStaticCatalog;
- }
- }
-
- if (staticCatalog == null) {
- return defaultUseStaticCatalog;
- }
-
- return (staticCatalog.equalsIgnoreCase("true")
- || staticCatalog.equalsIgnoreCase("yes")
- || staticCatalog.equalsIgnoreCase("1"));
- }
-
- /**
- * Get the current use static catalog setting.
- */
- public boolean getUseStaticCatalog() {
- if (useStaticCatalog == null) {
- useStaticCatalog = new Boolean(queryUseStaticCatalog());
- }
-
- return useStaticCatalog.booleanValue();
- }
-
- /**
- * Set the use static catalog setting.
- */
- public void setUseStaticCatalog(boolean useStatic) {
- useStaticCatalog = new Boolean(useStatic);
- }
-
- /**
- * Get the current use static catalog setting.
- *
- * @deprecated No longer static; use get/set methods.
- */
- public boolean staticCatalog() {
- return getUseStaticCatalog();
- }
-
- /**
- * Get a new catalog instance.
- *
- * This method always returns a new instance of the underlying catalog class.
- */
- public Catalog getPrivateCatalog() {
- Catalog catalog = staticCatalog;
-
- if (useStaticCatalog == null) {
- useStaticCatalog = new Boolean(getUseStaticCatalog());
- }
-
- if (catalog == null || !useStaticCatalog.booleanValue()) {
-
- try {
- String catalogClassName = getCatalogClassName();
-
- if (catalogClassName == null) {
- catalog = new Catalog();
- } else {
- try {
- catalog = (Catalog) ReflectUtil.forName(catalogClassName).newInstance();
- } catch (ClassNotFoundException cnfe) {
- debug.message(1,"Catalog class named '"
- + catalogClassName
- + "' could not be found. Using default.");
- catalog = new Catalog();
- } catch (ClassCastException cnfe) {
- debug.message(1,"Class named '"
- + catalogClassName
- + "' is not a Catalog. Using default.");
- catalog = new Catalog();
- }
- }
-
- catalog.setCatalogManager(this);
- catalog.setupReaders();
- catalog.loadSystemCatalogs();
- } catch (Exception ex) {
- ex.printStackTrace();
- }
-
- if (useStaticCatalog.booleanValue()) {
- staticCatalog = catalog;
- }
- }
-
- return catalog;
- }
-
- /**
- * Get a catalog instance.
- *
- * If this manager uses static catalogs, the same static catalog will
- * always be returned. Otherwise a new catalog will be returned.
- */
- public Catalog getCatalog() {
- Catalog catalog = staticCatalog;
-
- if (useStaticCatalog == null) {
- useStaticCatalog = new Boolean(getUseStaticCatalog());
- }
-
- if (catalog == null || !useStaticCatalog.booleanValue()) {
- catalog = getPrivateCatalog();
- if (useStaticCatalog.booleanValue()) {
- staticCatalog = catalog;
- }
- }
-
- return catalog;
- }
-
- /**
- * <p>Obtain the oasisXMLCatalogPI setting from the properties.</p>
- *
- * <p>In the properties, a value of 'yes', 'true', or '1' is considered
- * true, anything else is false.</p>
- *
- * @return The oasisXMLCatalogPI setting from the propertyFile or the
- * defaultOasisXMLCatalogPI.
- */
- public boolean queryAllowOasisXMLCatalogPI () {
- String allow = SecuritySupport.getSystemProperty(pAllowPI);
-
- if (allow == null) {
- if (resources==null) readProperties();
- if (resources==null) return defaultOasisXMLCatalogPI;
- try {
- allow = resources.getString("allow-oasis-xml-catalog-pi");
- } catch (MissingResourceException e) {
- return defaultOasisXMLCatalogPI;
- }
- }
-
- if (allow == null) {
- return defaultOasisXMLCatalogPI;
- }
-
- return (allow.equalsIgnoreCase("true")
- || allow.equalsIgnoreCase("yes")
- || allow.equalsIgnoreCase("1"));
- }
-
- /**
- * Get the current XML Catalog PI setting.
- */
- public boolean getAllowOasisXMLCatalogPI () {
- if (oasisXMLCatalogPI == null) {
- oasisXMLCatalogPI = new Boolean(queryAllowOasisXMLCatalogPI());
- }
-
- return oasisXMLCatalogPI.booleanValue();
- }
-
- public boolean useServicesMechanism() {
- return useServicesMechanism;
- }
- /**
- * Set the XML Catalog PI setting
- */
- public void setAllowOasisXMLCatalogPI(boolean allowPI) {
- oasisXMLCatalogPI = new Boolean(allowPI);
- }
-
- /**
- * Get the current XML Catalog PI setting.
- *
- * @deprecated No longer static; use get/set methods.
- */
- public boolean allowOasisXMLCatalogPI() {
- return getAllowOasisXMLCatalogPI();
- }
-
- /**
- * Obtain the Catalog class name setting from the properties.
- *
- */
- public String queryCatalogClassName () {
- String className = SecuritySupport.getSystemProperty(pClassname);
-
- if (className == null) {
- if (resources==null) readProperties();
- if (resources==null) return null;
- try {
- return resources.getString("catalog-class-name");
- } catch (MissingResourceException e) {
- return null;
- }
- }
-
- return className;
- }
-
- /**
- * Get the current Catalog class name.
- */
- public String getCatalogClassName() {
- if (catalogClassName == null) {
- catalogClassName = queryCatalogClassName();
- }
-
- return catalogClassName;
- }
-
- /**
- * Set the Catalog class name.
- */
- public void setCatalogClassName(String className) {
- catalogClassName = className;
- }
-
- /**
- * Get the current Catalog class name.
- *
- * @deprecated No longer static; use get/set methods.
- */
- public String catalogClassName() {
- return getCatalogClassName();
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/resolver/Resolver.java b/src/com/sun/org/apache/xml/internal/resolver/Resolver.java
deleted file mode 100644
index 721d67c..0000000
--- a/src/com/sun/org/apache/xml/internal/resolver/Resolver.java
+++ /dev/null
@@ -1,694 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-// Resolver.java - Represents an extension of OASIS Open Catalog files.
-
-/*
- * Copyright 2001-2004 The Apache Software Foundation or its licensors,
- * as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xml.internal.resolver;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.FileNotFoundException;
-import java.util.Enumeration;
-import java.util.Vector;
-import java.net.URL;
-import java.net.URLConnection;
-import java.net.MalformedURLException;
-import javax.xml.parsers.SAXParserFactory;
-import com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl;
-import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
-import com.sun.org.apache.xml.internal.resolver.readers.SAXCatalogReader;
-import com.sun.org.apache.xml.internal.resolver.readers.OASISXMLCatalogReader;
-import com.sun.org.apache.xml.internal.resolver.readers.TR9401CatalogReader;
-
-/**
- * An extension to OASIS Open Catalog files, this class supports
- * suffix-based matching and an external RFC2483 resolver.
- *
- * @see Catalog
- *
- * @author Norman Walsh
- * <a href="mailto:Norman.Walsh@Sun.COM">Norman.Walsh@Sun.COM</a>
- *
- * @version 1.0
- */
-public class Resolver extends Catalog {
- /**
- * The URISUFFIX Catalog Entry type.
- *
- * <p>URI suffix entries match URIs that end in a specified suffix.</p>
- */
- public static final int URISUFFIX = CatalogEntry.addEntryType("URISUFFIX", 2);
-
- /**
- * The SYSTEMSUFFIX Catalog Entry type.
- *
- * <p>System suffix entries match system identifiers that end in a
- * specified suffix.</p>
- */
- public static final int SYSTEMSUFFIX = CatalogEntry.addEntryType("SYSTEMSUFFIX", 2);
-
- /**
- * The RESOLVER Catalog Entry type.
- *
- * <p>A hook for providing support for web-based backup resolvers.</p>
- */
- public static final int RESOLVER = CatalogEntry.addEntryType("RESOLVER", 1);
-
- /**
- * The SYSTEMREVERSE Catalog Entry type.
- *
- * <p>This is a bit of a hack. There's no actual SYSTEMREVERSE entry,
- * but this entry type is used to indicate that a reverse lookup is
- * being performed. (This allows the Resolver to implement
- * RFC2483 I2N and I2NS.)
- */
- public static final int SYSTEMREVERSE
- = CatalogEntry.addEntryType("SYSTEMREVERSE", 1);
-
- /**
- * Setup readers.
- */
- public void setupReaders() {
- SAXParserFactory spf = catalogManager.useServicesMechanism() ?
- SAXParserFactory.newInstance() : new SAXParserFactoryImpl();
- spf.setNamespaceAware(true);
- spf.setValidating(false);
-
- SAXCatalogReader saxReader = new SAXCatalogReader(spf);
-
- saxReader.setCatalogParser(null, "XMLCatalog",
- "com.sun.org.apache.xml.internal.resolver.readers.XCatalogReader");
-
- saxReader.setCatalogParser(OASISXMLCatalogReader.namespaceName,
- "catalog",
- "com.sun.org.apache.xml.internal.resolver.readers.ExtendedXMLCatalogReader");
-
- addReader("application/xml", saxReader);
-
- TR9401CatalogReader textReader = new TR9401CatalogReader();
- addReader("text/plain", textReader);
- }
-
- /**
- * Cleanup and process a Catalog entry.
- *
- * <p>This method processes each Catalog entry, changing mapped
- * relative system identifiers into absolute ones (based on the current
- * base URI), and maintaining other information about the current
- * catalog.</p>
- *
- * @param entry The CatalogEntry to process.
- */
- public void addEntry(CatalogEntry entry) {
- int type = entry.getEntryType();
-
- if (type == URISUFFIX) {
- String suffix = normalizeURI(entry.getEntryArg(0));
- String fsi = makeAbsolute(normalizeURI(entry.getEntryArg(1)));
-
- entry.setEntryArg(1, fsi);
-
- catalogManager.debug.message(4, "URISUFFIX", suffix, fsi);
- } else if (type == SYSTEMSUFFIX) {
- String suffix = normalizeURI(entry.getEntryArg(0));
- String fsi = makeAbsolute(normalizeURI(entry.getEntryArg(1)));
-
- entry.setEntryArg(1, fsi);
-
- catalogManager.debug.message(4, "SYSTEMSUFFIX", suffix, fsi);
- }
-
- super.addEntry(entry);
- }
-
- /**
- * Return the applicable URI.
- *
- * <p>If a URI entry exists in the Catalog
- * for the URI specified, return the mapped value.</p>
- *
- * <p>In the Resolver (as opposed to the Catalog) class, if the
- * URI isn't found by the usual algorithm, URISUFFIX entries are
- * considered.</p>
- *
- * <p>URI comparison is case sensitive.</p>
- *
- * @param uri The URI to locate in the catalog.
- *
- * @return The resolved URI.
- *
- * @throws MalformedURLException The system identifier of a
- * subordinate catalog cannot be turned into a valid URL.
- * @throws IOException Error reading subordinate catalog file.
- */
- public String resolveURI(String uri)
- throws MalformedURLException, IOException {
-
- String resolved = super.resolveURI(uri);
- if (resolved != null) {
- return resolved;
- }
-
- Enumeration en = catalogEntries.elements();
- while (en.hasMoreElements()) {
- CatalogEntry e = (CatalogEntry) en.nextElement();
- if (e.getEntryType() == RESOLVER) {
- resolved = resolveExternalSystem(uri, e.getEntryArg(0));
- if (resolved != null) {
- return resolved;
- }
- } else if (e.getEntryType() == URISUFFIX) {
- String suffix = e.getEntryArg(0);
- String result = e.getEntryArg(1);
-
- if (suffix.length() <= uri.length()
- && uri.substring(uri.length()-suffix.length()).equals(suffix)) {
- return result;
- }
- }
- }
-
- // Otherwise, look in the subordinate catalogs
- return resolveSubordinateCatalogs(Catalog.URI,
- null,
- null,
- uri);
- }
-
- /**
- * Return the applicable SYSTEM system identifier, resorting
- * to external RESOLVERs if necessary.
- *
- * <p>If a SYSTEM entry exists in the Catalog
- * for the system ID specified, return the mapped value.</p>
- *
- * <p>In the Resolver (as opposed to the Catalog) class, if the
- * URI isn't found by the usual algorithm, SYSTEMSUFFIX entries are
- * considered.</p>
- *
- * <p>On Windows-based operating systems, the comparison between
- * the system identifier provided and the SYSTEM entries in the
- * Catalog is case-insensitive.</p>
- *
- * @param systemId The system ID to locate in the catalog.
- *
- * @return The system identifier to use for systemId.
- *
- * @throws MalformedURLException The formal system identifier of a
- * subordinate catalog cannot be turned into a valid URL.
- * @throws IOException Error reading subordinate catalog file.
- */
- public String resolveSystem(String systemId)
- throws MalformedURLException, IOException {
-
- String resolved = super.resolveSystem(systemId);
- if (resolved != null) {
- return resolved;
- }
-
- Enumeration en = catalogEntries.elements();
- while (en.hasMoreElements()) {
- CatalogEntry e = (CatalogEntry) en.nextElement();
- if (e.getEntryType() == RESOLVER) {
- resolved = resolveExternalSystem(systemId, e.getEntryArg(0));
- if (resolved != null) {
- return resolved;
- }
- } else if (e.getEntryType() == SYSTEMSUFFIX) {
- String suffix = e.getEntryArg(0);
- String result = e.getEntryArg(1);
-
- if (suffix.length() <= systemId.length()
- && systemId.substring(systemId.length()-suffix.length()).equals(suffix)) {
- return result;
- }
- }
- }
-
- return resolveSubordinateCatalogs(Catalog.SYSTEM,
- null,
- null,
- systemId);
- }
-
- /**
- * Return the applicable PUBLIC or SYSTEM identifier, resorting
- * to external resolvers if necessary.
- *
- * <p>This method searches the Catalog and returns the system
- * identifier specified for the given system or
- * public identifiers. If
- * no appropriate PUBLIC or SYSTEM entry is found in the Catalog,
- * null is returned.</p>
- *
- * <p>Note that a system or public identifier in the current catalog
- * (or subordinate catalogs) will be used in preference to an
- * external resolver. Further, if a systemId is present, the external
- * resolver(s) will be queried for that before the publicId.</p>
- *
- * @param publicId The public identifier to locate in the catalog.
- * Public identifiers are normalized before comparison.
- * @param systemId The nominal system identifier for the entity
- * in question (as provided in the source document).
- *
- * @throws MalformedURLException The formal system identifier of a
- * subordinate catalog cannot be turned into a valid URL.
- * @throws IOException Error reading subordinate catalog file.
- *
- * @return The system identifier to use.
- * Note that the nominal system identifier is not returned if a
- * match is not found in the catalog, instead null is returned
- * to indicate that no match was found.
- */
- public String resolvePublic(String publicId, String systemId)
- throws MalformedURLException, IOException {
-
- String resolved = super.resolvePublic(publicId, systemId);
- if (resolved != null) {
- return resolved;
- }
-
- Enumeration en = catalogEntries.elements();
- while (en.hasMoreElements()) {
- CatalogEntry e = (CatalogEntry) en.nextElement();
- if (e.getEntryType() == RESOLVER) {
- if (systemId != null) {
- resolved = resolveExternalSystem(systemId,
- e.getEntryArg(0));
- if (resolved != null) {
- return resolved;
- }
- }
- resolved = resolveExternalPublic(publicId, e.getEntryArg(0));
- if (resolved != null) {
- return resolved;
- }
- }
- }
-
- return resolveSubordinateCatalogs(Catalog.PUBLIC,
- null,
- publicId,
- systemId);
- }
-
- /**
- * Query an external RFC2483 resolver for a system identifier.
- *
- * @param systemId The system ID to locate.
- * @param resolver The name of the resolver to use.
- *
- * @return The system identifier to use for the systemId.
- */
- protected String resolveExternalSystem(String systemId, String resolver)
- throws MalformedURLException, IOException {
- Resolver r = queryResolver(resolver, "i2l", systemId, null);
- if (r != null) {
- return r.resolveSystem(systemId);
- } else {
- return null;
- }
- }
-
- /**
- * Query an external RFC2483 resolver for a public identifier.
- *
- * @param publicId The system ID to locate.
- * @param resolver The name of the resolver to use.
- *
- * @return The system identifier to use for the systemId.
- */
- protected String resolveExternalPublic(String publicId, String resolver)
- throws MalformedURLException, IOException {
- Resolver r = queryResolver(resolver, "fpi2l", publicId, null);
- if (r != null) {
- return r.resolvePublic(publicId, null);
- } else {
- return null;
- }
- }
-
- /**
- * Query an external RFC2483 resolver.
- *
- * @param resolver The URL of the RFC2483 resolver.
- * @param command The command to send the resolver.
- * @param arg1 The first argument to the resolver.
- * @param arg2 The second argument to the resolver, usually null.
- *
- * @return The Resolver constructed.
- */
- protected Resolver queryResolver(String resolver,
- String command,
- String arg1,
- String arg2) {
- InputStream iStream = null;
- String RFC2483 = resolver + "?command=" + command
- + "&format=tr9401&uri=" + arg1
- + "&uri2=" + arg2;
- String line = null;
-
- try {
- URL url = new URL(RFC2483);
-
- URLConnection urlCon = url.openConnection();
-
- urlCon.setUseCaches(false);
-
- Resolver r = (Resolver) newCatalog();
-
- String cType = urlCon.getContentType();
-
- // I don't care about the character set or subtype
- if (cType.indexOf(";") > 0) {
- cType = cType.substring(0, cType.indexOf(";"));
- }
-
- r.parseCatalog(cType, urlCon.getInputStream());
-
- return r;
- } catch (CatalogException cex) {
- if (cex.getExceptionType() == CatalogException.UNPARSEABLE) {
- catalogManager.debug.message(1, "Unparseable catalog: " + RFC2483);
- } else if (cex.getExceptionType()
- == CatalogException.UNKNOWN_FORMAT) {
- catalogManager.debug.message(1, "Unknown catalog format: " + RFC2483);
- }
- return null;
- } catch (MalformedURLException mue) {
- catalogManager.debug.message(1, "Malformed resolver URL: " + RFC2483);
- return null;
- } catch (IOException ie) {
- catalogManager.debug.message(1, "I/O Exception opening resolver: " + RFC2483);
- return null;
- }
- }
-
- /**
- * Append two vectors, returning the result.
- *
- * @param vec The first vector
- * @param appvec The vector to be appended
- * @return The vector vec, with appvec's elements appended to it
- */
- private Vector appendVector(Vector vec, Vector appvec) {
- if (appvec != null) {
- for (int count = 0; count < appvec.size(); count++) {
- vec.addElement(appvec.elementAt(count));
- }
- }
- return vec;
- }
-
- /**
- * Find the URNs for a given system identifier in all catalogs.
- *
- * @param systemId The system ID to locate.
- *
- * @return A vector of URNs that map to the systemId.
- */
- public Vector resolveAllSystemReverse(String systemId)
- throws MalformedURLException, IOException {
- Vector resolved = new Vector();
-
- // If there's a SYSTEM entry in this catalog, use it
- if (systemId != null) {
- Vector localResolved = resolveLocalSystemReverse(systemId);
- resolved = appendVector(resolved, localResolved);
- }
-
- // Otherwise, look in the subordinate catalogs
- Vector subResolved = resolveAllSubordinateCatalogs(SYSTEMREVERSE,
- null,
- null,
- systemId);
-
- return appendVector(resolved, subResolved);
- }
-
- /**
- * Find the URN for a given system identifier.
- *
- * @param systemId The system ID to locate.
- *
- * @return A (single) URN that maps to the systemId.
- */
- public String resolveSystemReverse(String systemId)
- throws MalformedURLException, IOException {
- Vector resolved = resolveAllSystemReverse(systemId);
- if (resolved != null && resolved.size() > 0) {
- return (String) resolved.elementAt(0);
- } else {
- return null;
- }
- }
-
- /**
- * Return the applicable SYSTEM system identifiers.
- *
- * <p>If one or more SYSTEM entries exists in the Catalog
- * for the system ID specified, return the mapped values.</p>
- *
- * <p>The caller is responsible for doing any necessary
- * normalization of the system identifier before calling
- * this method. For example, a relative system identifier in
- * a document might be converted to an absolute system identifier
- * before attempting to resolve it.</p>
- *
- * <p>Note that this function will force all subordinate catalogs
- * to be loaded.</p>
- *
- * <p>On Windows-based operating systems, the comparison between
- * the system identifier provided and the SYSTEM entries in the
- * Catalog is case-insensitive.</p>
- *
- * @param systemId The system ID to locate in the catalog.
- *
- * @return The system identifier to use for the notation.
- *
- * @throws MalformedURLException The formal system identifier of a
- * subordinate catalog cannot be turned into a valid URL.
- * @throws IOException Error reading subordinate catalog file.
- */
- public Vector resolveAllSystem(String systemId)
- throws MalformedURLException, IOException {
- Vector resolutions = new Vector();
-
- // If there are SYSTEM entries in this catalog, start with them
- if (systemId != null) {
- Vector localResolutions = resolveAllLocalSystem(systemId);
- resolutions = appendVector(resolutions, localResolutions);
- }
-
- // Then look in the subordinate catalogs
- Vector subResolutions = resolveAllSubordinateCatalogs(SYSTEM,
- null,
- null,
- systemId);
- resolutions = appendVector(resolutions, subResolutions);
-
- if (resolutions.size() > 0) {
- return resolutions;
- } else {
- return null;
- }
- }
-
- /**
- * Return all applicable SYSTEM system identifiers in this
- * catalog.
- *
- * <p>If one or more SYSTEM entries exists in the catalog file
- * for the system ID specified, return the mapped values.</p>
- *
- * @param systemId The system ID to locate in the catalog
- *
- * @return A vector of the mapped system identifiers or null
- */
- private Vector resolveAllLocalSystem(String systemId) {
- Vector map = new Vector();
- String osname = SecuritySupport.getSystemProperty("os.name");
- boolean windows = (osname.indexOf("Windows") >= 0);
- Enumeration en = catalogEntries.elements();
- while (en.hasMoreElements()) {
- CatalogEntry e = (CatalogEntry) en.nextElement();
- if (e.getEntryType() == SYSTEM
- && (e.getEntryArg(0).equals(systemId)
- || (windows
- && e.getEntryArg(0).equalsIgnoreCase(systemId)))) {
- map.addElement(e.getEntryArg(1));
- }
- }
- if (map.size() == 0) {
- return null;
- } else {
- return map;
- }
- }
-
- /**
- * Find the URNs for a given system identifier in the current catalog.
- *
- * @param systemId The system ID to locate.
- *
- * @return A vector of URNs that map to the systemId.
- */
- private Vector resolveLocalSystemReverse(String systemId) {
- Vector map = new Vector();
- String osname = SecuritySupport.getSystemProperty("os.name");
- boolean windows = (osname.indexOf("Windows") >= 0);
- Enumeration en = catalogEntries.elements();
- while (en.hasMoreElements()) {
- CatalogEntry e = (CatalogEntry) en.nextElement();
- if (e.getEntryType() == SYSTEM
- && (e.getEntryArg(1).equals(systemId)
- || (windows
- && e.getEntryArg(1).equalsIgnoreCase(systemId)))) {
- map.addElement(e.getEntryArg(0));
- }
- }
- if (map.size() == 0) {
- return null;
- } else {
- return map;
- }
- }
-
- /**
- * Search the subordinate catalogs, in order, looking for all
- * match.
- *
- * <p>This method searches the Catalog and returns all of the system
- * identifiers specified for the given entity type with the given
- * name, public, and system identifiers. In some contexts, these
- * may be null.</p>
- *
- * @param entityType The CatalogEntry type for which this query is
- * being conducted. This is necessary in order to do the approprate
- * query on a subordinate catalog.
- * @param entityName The name of the entity being searched for, if
- * appropriate.
- * @param publicId The public identifier of the entity in question
- * (as provided in the source document).
- * @param systemId The nominal system identifier for the entity
- * in question (as provided in the source document).
- *
- * @throws MalformedURLException The formal system identifier of a
- * delegated catalog cannot be turned into a valid URL.
- * @throws IOException Error reading delegated catalog file.
- *
- * @return The system identifier to use.
- * Note that the nominal system identifier is not returned if a
- * match is not found in the catalog, instead null is returned
- * to indicate that no match was found.
- */
- private synchronized Vector resolveAllSubordinateCatalogs(int entityType,
- String entityName,
- String publicId,
- String systemId)
- throws MalformedURLException, IOException {
-
- Vector resolutions = new Vector();
-
- for (int catPos = 0; catPos < catalogs.size(); catPos++) {
- Resolver c = null;
-
- try {
- c = (Resolver) catalogs.elementAt(catPos);
- } catch (ClassCastException e) {
- String catfile = (String) catalogs.elementAt(catPos);
- c = (Resolver) newCatalog();
-
- try {
- c.parseCatalog(catfile);
- } catch (MalformedURLException mue) {
- catalogManager.debug.message(1, "Malformed Catalog URL", catfile);
- } catch (FileNotFoundException fnfe) {
- catalogManager.debug.message(1, "Failed to load catalog, file not found",
- catfile);
- } catch (IOException ioe) {
- catalogManager.debug.message(1, "Failed to load catalog, I/O error", catfile);
- }
-
- catalogs.setElementAt(c, catPos);
- }
-
- String resolved = null;
-
- // Ok, now what are we supposed to call here?
- if (entityType == DOCTYPE) {
- resolved = c.resolveDoctype(entityName,
- publicId,
- systemId);
- if (resolved != null) {
- // Only find one DOCTYPE resolution
- resolutions.addElement(resolved);
- return resolutions;
- }
- } else if (entityType == DOCUMENT) {
- resolved = c.resolveDocument();
- if (resolved != null) {
- // Only find one DOCUMENT resolution
- resolutions.addElement(resolved);
- return resolutions;
- }
- } else if (entityType == ENTITY) {
- resolved = c.resolveEntity(entityName,
- publicId,
- systemId);
- if (resolved != null) {
- // Only find one ENTITY resolution
- resolutions.addElement(resolved);
- return resolutions;
- }
- } else if (entityType == NOTATION) {
- resolved = c.resolveNotation(entityName,
- publicId,
- systemId);
- if (resolved != null) {
- // Only find one NOTATION resolution
- resolutions.addElement(resolved);
- return resolutions;
- }
- } else if (entityType == PUBLIC) {
- resolved = c.resolvePublic(publicId, systemId);
- if (resolved != null) {
- // Only find one PUBLIC resolution
- resolutions.addElement(resolved);
- return resolutions;
- }
- } else if (entityType == SYSTEM) {
- Vector localResolutions = c.resolveAllSystem(systemId);
- resolutions = appendVector(resolutions, localResolutions);
- break;
- } else if (entityType == SYSTEMREVERSE) {
- Vector localResolutions = c.resolveAllSystemReverse(systemId);
- resolutions = appendVector(resolutions, localResolutions);
- }
- }
-
- if (resolutions != null) {
- return resolutions;
- } else {
- return null;
- }
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/resolver/helpers/BootstrapResolver.java b/src/com/sun/org/apache/xml/internal/resolver/helpers/BootstrapResolver.java
deleted file mode 100644
index e44f50d..0000000
--- a/src/com/sun/org/apache/xml/internal/resolver/helpers/BootstrapResolver.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-// BootstrapResolver.java - Resolve entities and URIs internally
-
-package com.sun.org.apache.xml.internal.resolver.helpers;
-
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-import javax.xml.transform.Source;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.URIResolver;
-import javax.xml.transform.sax.SAXSource;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.InputSource;
-
-/**
- * A simple bootstrapping resolver.
- *
- * <p>This class is used as the entity resolver when reading XML Catalogs.
- * It searches for the OASIS XML Catalog DTD, Relax NG Grammar and W3C XML Schema
- * as resources (e.g., in the resolver jar file).</p>
- *
- * <p>If you have your own DTDs or schemas, you can extend this class and
- * set the BootstrapResolver in your CatalogManager.</p>
- *
- * @see com.sun.org.apache.xml.internal.resolver.CatalogManager
- *
- * @author Norman Walsh
- * <a href="mailto:Norman.Walsh@Sun.COM">Norman.Walsh@Sun.COM</a>
- *
- */
-public class BootstrapResolver implements EntityResolver, URIResolver {
- /** URI of the W3C XML Schema for OASIS XML Catalog files. */
- public static final String xmlCatalogXSD = "http://www.oasis-open.org/committees/entity/release/1.0/catalog.xsd";
-
- /** URI of the RELAX NG Grammar for OASIS XML Catalog files. */
- public static final String xmlCatalogRNG = "http://www.oasis-open.org/committees/entity/release/1.0/catalog.rng";
-
- /** Public identifier for OASIS XML Catalog files. */
- public static final String xmlCatalogPubId = "-//OASIS//DTD XML Catalogs V1.0//EN";
-
- /** System identifier for OASIS XML Catalog files. */
- public static final String xmlCatalogSysId = "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd";
-
- /** Private hash used for public identifiers. */
- private final Map<String, String> publicMap = new HashMap<>();
-
- /** Private hash used for system identifiers. */
- private final Map<String, String> systemMap = new HashMap<>();
-
- /** Private hash used for URIs. */
- private final Map<String, String> uriMap = new HashMap<>();
-
- /** Constructor. */
- public BootstrapResolver() {
- URL url = this.getClass().getResource("/com/sun/org/apache/xml/internal/resolver/etc/catalog.dtd");
- if (url != null) {
- publicMap.put(xmlCatalogPubId, url.toString());
- systemMap.put(xmlCatalogSysId, url.toString());
- }
-
- url = this.getClass().getResource("/com/sun/org/apache/xml/internal/resolver/etc/catalog.rng");
- if (url != null) {
- uriMap.put(xmlCatalogRNG, url.toString());
- }
-
- url = this.getClass().getResource("/com/sun/org/apache/xml/internal/resolver/etc/catalog.xsd");
- if (url != null) {
- uriMap.put(xmlCatalogXSD, url.toString());
- }
- }
-
- /** SAX resolveEntity API. */
- public InputSource resolveEntity (String publicId, String systemId) {
- String resolved = null;
-
- if (systemId != null && systemMap.containsKey(systemId)) {
- resolved = systemMap.get(systemId);
- } else if (publicId != null && publicMap.containsKey(publicId)) {
- resolved = publicMap.get(publicId);
- }
-
- if (resolved != null) {
- try {
- InputSource iSource = new InputSource(resolved);
- iSource.setPublicId(publicId);
-
- // Ideally this method would not attempt to open the
- // InputStream, but there is a bug (in Xerces, at least)
- // that causes the parser to mistakenly open the wrong
- // system identifier if the returned InputSource does
- // not have a byteStream.
- //
- // It could be argued that we still shouldn't do this here,
- // but since the purpose of calling the entityResolver is
- // almost certainly to open the input stream, it seems to
- // do little harm.
- //
- URL url = new URL(resolved);
- InputStream iStream = url.openStream();
- iSource.setByteStream(iStream);
-
- return iSource;
- } catch (Exception e) {
- // FIXME: silently fail?
- return null;
- }
- }
-
- return null;
- }
-
- /** Transformer resolve API. */
- public Source resolve(String href, String base)
- throws TransformerException {
-
- String uri = href;
- String fragment = null;
- int hashPos = href.indexOf("#");
- if (hashPos >= 0) {
- uri = href.substring(0, hashPos);
- fragment = href.substring(hashPos+1);
- }
-
- String result = null;
- if (href != null && uriMap.containsKey(href)) {
- result = uriMap.get(href);
- }
-
- if (result == null) {
- try {
- URL url = null;
-
- if (base==null) {
- url = new URL(uri);
- result = url.toString();
- } else {
- URL baseURL = new URL(base);
- url = (href.length()==0 ? baseURL : new URL(baseURL, uri));
- result = url.toString();
- }
- } catch (java.net.MalformedURLException mue) {
- // try to make an absolute URI from the current base
- String absBase = makeAbsolute(base);
- if (!absBase.equals(base)) {
- // don't bother if the absBase isn't different!
- return resolve(href, absBase);
- } else {
- throw new TransformerException("Malformed URL "
- + href + "(base " + base + ")",
- mue);
- }
- }
- }
-
- SAXSource source = new SAXSource();
- source.setInputSource(new InputSource(result));
- return source;
- }
-
- /** Attempt to construct an absolute URI */
- private String makeAbsolute(String uri) {
- if (uri == null) {
- uri = "";
- }
-
- try {
- URL url = new URL(uri);
- return url.toString();
- } catch (MalformedURLException mue) {
- try {
- URL fileURL = FileURL.makeURL(uri);
- return fileURL.toString();
- } catch (MalformedURLException mue2) {
- // bail
- return uri;
- }
- }
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/resolver/helpers/Debug.java b/src/com/sun/org/apache/xml/internal/resolver/helpers/Debug.java
deleted file mode 100644
index fbf2b8f..0000000
--- a/src/com/sun/org/apache/xml/internal/resolver/helpers/Debug.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-// Debug.java - Print debug messages
-
-/*
- * Copyright 2001-2004 The Apache Software Foundation or its licensors,
- * as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xml.internal.resolver.helpers;
-
-/**
- * Static debugging/messaging class for Catalogs.
- *
- * <p>This class defines a set of static methods that can be called
- * to produce debugging messages. Messages have an associated "debug
- * level" and messages below the current setting are not displayed.</p>
- *
- * @author Norman Walsh
- * <a href="mailto:Norman.Walsh@Sun.COM">Norman.Walsh@Sun.COM</a>
- *
- */
-public class Debug {
- /** The internal debug level. */
- protected int debug = 0;
-
- /** Constructor */
- public Debug() {
- // nop
- }
-
- /** Set the debug level for future messages. */
- public void setDebug(int newDebug) {
- debug = newDebug;
- }
-
- /** Get the current debug level. */
- public int getDebug() {
- return debug;
- }
-
- /**
- * Print debug message (if the debug level is high enough).
- *
- * <p>Prints "the message"</p>
- *
- * @param level The debug level of this message. This message
- * will only be
- * displayed if the current debug level is at least equal to this
- * value.
- * @param message The text of the message.
- */
- public void message(int level, String message) {
- if (debug >= level) {
- System.out.println(message);
- }
- }
-
- /**
- * Print debug message (if the debug level is high enough).
- *
- * <p>Prints "the message: spec"</p>
- *
- * @param level The debug level of this message. This message
- * will only be
- * displayed if the current debug level is at least equal to this
- * value.
- * @param message The text of the message.
- * @param spec An argument to the message.
- */
- public void message(int level, String message, String spec) {
- if (debug >= level) {
- System.out.println(message + ": " + spec);
- }
- }
-
- /**
- * Print debug message (if the debug level is high enough).
- *
- * <p>Prints "the message: spec1" and "spec2" indented on the next line.</p>
- *
- * @param level The debug level of this message. This message
- * will only be
- * displayed if the current debug level is at least equal to this
- * value.
- * @param message The text of the message.
- * @param spec1 An argument to the message.
- * @param spec2 Another argument to the message.
- */
- public void message(int level, String message,
- String spec1, String spec2) {
- if (debug >= level) {
- System.out.println(message + ": " + spec1);
- System.out.println("\t" + spec2);
- }
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/resolver/helpers/FileURL.java b/src/com/sun/org/apache/xml/internal/resolver/helpers/FileURL.java
deleted file mode 100644
index e5a5605..0000000
--- a/src/com/sun/org/apache/xml/internal/resolver/helpers/FileURL.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-// FileURL.java - Construct a file: scheme URL
-
-/*
- * Copyright 2001-2004 The Apache Software Foundation or its licensors,
- * as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xml.internal.resolver.helpers;
-
-import java.net.URL;
-import java.net.MalformedURLException;
-import java.io.File;
-
-/**
- * Static method for dealing with file: URLs.
- *
- * <p>This class defines a static method that can be used to construct
- * an appropriate file: URL from parts. It's defined here so that it
- * can be reused throught the resolver.</p>
- *
- * <p>(Yes, I'd rather have called this class FileUR<b>I</b>, but
- * given that a jave.net.URL is returned, it seemed...even more
- * confusing.)</p>
- *
- * @author Norman Walsh
- * <a href="mailto:Norman.Walsh@Sun.COM">Norman.Walsh@Sun.COM</a>
- *
- * @version 1.0
- */
-public abstract class FileURL {
- protected FileURL() { }
-
- /**
- * Construct a file: URL for a path name.
- *
- * <p>URLs in the file: scheme can be constructed for paths on
- * the local file system. Several possibilities need to be considered:
- * </p>
- *
- * <ul>
- * <li>If the path does not begin with a slash, then it is assumed
- * to reside in the users current working directory
- * (System.getProperty("user.dir")).</li>
- * <li>On Windows machines, the current working directory uses
- * backslashes (\\, instead of /).</li>
- * <li>If the current working directory is "/", don't add an extra
- * slash before the base name.</li>
- * </ul>
- *
- * <p>This method is declared static so that other classes
- * can use it directly.</p>
- *
- * @param pathname The path name component for which to construct a URL.
- *
- * @return The appropriate file: URL.
- *
- * @throws MalformedURLException if the pathname can't be turned into
- * a proper URL.
- */
- public static URL makeURL(String pathname) throws MalformedURLException {
- /*if (pathname.startsWith("/")) {
- return new URL("file://" + pathname);
- }
-
- String userdir = System.getProperty("user.dir");
- userdir.replace('\\', '/');
-
- if (userdir.endsWith("/")) {
- return new URL("file:///" + userdir + pathname);
- } else {
- return new URL("file:///" + userdir + "/" + pathname);
- }
- */
- File file = new File(pathname);
- return file.toURI().toURL();
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/resolver/helpers/Namespaces.java b/src/com/sun/org/apache/xml/internal/resolver/helpers/Namespaces.java
deleted file mode 100644
index 02624a6..0000000
--- a/src/com/sun/org/apache/xml/internal/resolver/helpers/Namespaces.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-// Namespaces.java - Analyze namespace nodes in a DOM tree
-
-/*
- * Copyright 2001-2004 The Apache Software Foundation or its licensors,
- * as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xml.internal.resolver.helpers;
-
-import org.w3c.dom.*;
-
-/**
- * Static Namespace query methods.
- *
- * <p>This class defines a set of static methods that can be called
- * to analyze the namespace properties of DOM nodes.</p>
- *
- * @author Norman Walsh
- * <a href="mailto:Norman.Walsh@Sun.COM">Norman.Walsh@Sun.COM</a>
- *
- */
-public class Namespaces {
- /**
- * Returns the "prefix" part of a QName or the empty string (not
- * null) if the name has no prefix.
- *
- * @param element The QName of an element.
- * @return The prefix part of the element name.
- */
- public static String getPrefix(Element element) {
- String name = element.getTagName();
- String prefix = "";
-
- if (name.indexOf(':') > 0) {
- prefix = name.substring(0, name.indexOf(':'));
- }
-
- return prefix;
- }
-
- /**
- * Returns the "localname" part of a QName, which is the whole
- * name if it has no prefix.
- *
- * @param element The QName of an element.
- * @return The local part of a QName.
- */
- public static String getLocalName(Element element) {
- String name = element.getTagName();
-
- if (name.indexOf(':') > 0) {
- name = name.substring(name.indexOf(':')+1);
- }
-
- return name;
- }
-
- /**
- * Returns the namespace URI for the specified prefix at the
- * specified context node.
- *
- * @param node The context node.
- * @param prefix The prefix.
- * @return The namespace URI associated with the prefix, or
- * null if no namespace declaration exists for the prefix.
- */
- public static String getNamespaceURI(Node node, String prefix) {
- if (node == null || node.getNodeType() != Node.ELEMENT_NODE) {
- return null;
- }
-
- if (prefix.equals("")) {
- if (((Element) node).hasAttribute("xmlns")) {
- return ((Element) node).getAttribute("xmlns");
- }
- } else {
- String nsattr = "xmlns:" + prefix;
- if (((Element) node).hasAttribute(nsattr)) {
- return ((Element) node).getAttribute(nsattr);
- }
- }
-
- return getNamespaceURI(node.getParentNode(), prefix);
- }
-
- /**
- * Returns the namespace URI for the namespace to which the
- * element belongs.
- *
- * @param element The element.
- * @return The namespace URI associated with the namespace of the
- * element, or null if no namespace declaration exists for it.
- */
- public static String getNamespaceURI(Element element) {
- String prefix = getPrefix(element);
- return getNamespaceURI(element, prefix);
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/resolver/helpers/PublicId.java b/src/com/sun/org/apache/xml/internal/resolver/helpers/PublicId.java
deleted file mode 100644
index 8211a77..0000000
--- a/src/com/sun/org/apache/xml/internal/resolver/helpers/PublicId.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-// PublicId.java - Information about public identifiers
-
-/*
- * Copyright 2001-2004 The Apache Software Foundation or its licensors,
- * as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xml.internal.resolver.helpers;
-
-/**
- * Static methods for dealing with public identifiers.
- *
- * <p>This class defines a set of static methods that can be called
- * to handle public identifiers.</p>
- *
- * @author Norman Walsh
- * <a href="mailto:Norman.Walsh@Sun.COM">Norman.Walsh@Sun.COM</a>
- *
- */
-public abstract class PublicId {
- protected PublicId() { }
-
- /**
- * Normalize a public identifier.
- *
- * <p>Public identifiers must be normalized according to the following
- * rules before comparisons between them can be made:</p>
- *
- * <ul>
- * <li>Whitespace characters are normalized to spaces (e.g., line feeds,
- * tabs, etc. become spaces).</li>
- * <li>Leading and trailing whitespace is removed.</li>
- * <li>Multiple internal whitespaces are normalized to a single
- * space.</li>
- * </ul>
- *
- * <p>This method is declared static so that other classes
- * can use it directly.</p>
- *
- * @param publicId The unnormalized public identifier.
- *
- * @return The normalized identifier.
- */
- public static String normalize(String publicId) {
- String normal = publicId.replace('\t', ' ');
- normal = normal.replace('\r', ' ');
- normal = normal.replace('\n', ' ');
- normal = normal.trim();
-
- int pos;
-
- while ((pos = normal.indexOf(" ")) >= 0) {
- normal = normal.substring(0, pos) + normal.substring(pos+1);
- }
-
- return normal;
- }
-
- /**
- * Encode a public identifier as a "publicid" URN.
- *
- * <p>This method is declared static so that other classes
- * can use it directly.</p>
- *
- * @param publicId The unnormalized public identifier.
- *
- * @return The normalized identifier.
- */
- public static String encodeURN(String publicId) {
- String urn = PublicId.normalize(publicId);
-
- urn = PublicId.stringReplace(urn, "%", "%25");
- urn = PublicId.stringReplace(urn, ";", "%3B");
- urn = PublicId.stringReplace(urn, "'", "%27");
- urn = PublicId.stringReplace(urn, "?", "%3F");
- urn = PublicId.stringReplace(urn, "#", "%23");
- urn = PublicId.stringReplace(urn, "+", "%2B");
- urn = PublicId.stringReplace(urn, " ", "+");
- urn = PublicId.stringReplace(urn, "::", ";");
- urn = PublicId.stringReplace(urn, ":", "%3A");
- urn = PublicId.stringReplace(urn, "//", ":");
- urn = PublicId.stringReplace(urn, "/", "%2F");
-
- return "urn:publicid:" + urn;
- }
-
- /**
- * Decode a "publicid" URN into a public identifier.
- *
- * <p>This method is declared static so that other classes
- * can use it directly.</p>
- *
- * @param urn The urn:publicid: URN
- *
- * @return The normalized identifier.
- */
- public static String decodeURN(String urn) {
- String publicId = "";
-
- if (urn.startsWith("urn:publicid:")) {
- publicId = urn.substring(13);
- } else {
- return urn;
- }
-
- publicId = PublicId.stringReplace(publicId, "%2F", "/");
- publicId = PublicId.stringReplace(publicId, ":", "//");
- publicId = PublicId.stringReplace(publicId, "%3A", ":");
- publicId = PublicId.stringReplace(publicId, ";", "::");
- publicId = PublicId.stringReplace(publicId, "+", " ");
- publicId = PublicId.stringReplace(publicId, "%2B", "+");
- publicId = PublicId.stringReplace(publicId, "%23", "#");
- publicId = PublicId.stringReplace(publicId, "%3F", "?");
- publicId = PublicId.stringReplace(publicId, "%27", "'");
- publicId = PublicId.stringReplace(publicId, "%3B", ";");
- publicId = PublicId.stringReplace(publicId, "%25", "%");
-
- return publicId;
- }
-
- /**
- * Replace one string with another.
- *
- */
- private static String stringReplace(String str,
- String oldStr,
- String newStr) {
-
- String result = "";
- int pos = str.indexOf(oldStr);
-
- // System.out.println(str + ": " + oldStr + " => " + newStr);
-
- while (pos >= 0) {
- // System.out.println(str + " (" + pos + ")");
- result += str.substring(0, pos);
- result += newStr;
- str = str.substring(pos+1);
-
- pos = str.indexOf(oldStr);
- }
-
- return result + str;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/resolver/readers/CatalogReader.java b/src/com/sun/org/apache/xml/internal/resolver/readers/CatalogReader.java
deleted file mode 100644
index cc8bd09..0000000
--- a/src/com/sun/org/apache/xml/internal/resolver/readers/CatalogReader.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-// CatalogReader.java - An interface for reading catalog files
-
-/*
- * Copyright 2001-2004 The Apache Software Foundation or its licensors,
- * as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xml.internal.resolver.readers;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import com.sun.org.apache.xml.internal.resolver.CatalogException;
-
-import java.io.InputStream;
-import com.sun.org.apache.xml.internal.resolver.Catalog;
-
-/**
- * The CatalogReader interface.
- *
- * <p>The Catalog class requires that classes implement this interface
- * in order to be used to read catalogs. Examples of CatalogReaders
- * include the TextCatalogReader, the SAXCatalogReader, and the
- * DOMCatalogReader.</p>
- *
- * @see Catalog
- *
- * @author Norman Walsh
- * <a href="mailto:Norman.Walsh@Sun.COM">Norman.Walsh@Sun.COM</a>
- *
- */
-public interface CatalogReader {
- /**
- * Read a catalog from a file.
- *
- * <p>This class reads a catalog from a URL.</p>
- *
- * @param catalog The catalog for which this reader is called.
- * @param fileUrl The URL of a document to be read.
- * @throws MalformedURLException if the specified URL cannot be
- * turned into a URL object.
- * @throws IOException if the URL cannot be read.
- * @throws UnknownCatalogFormatException if the catalog format is
- * not recognized.
- * @throws UnparseableCatalogException if the catalog cannot be parsed.
- * (For example, if it is supposed to be XML and isn't well-formed.)
- */
- public void readCatalog(Catalog catalog, String fileUrl)
- throws MalformedURLException, IOException, CatalogException;
-
- /**
- * Read a catalog from an input stream.
- *
- * <p>This class reads a catalog from an input stream.</p>
- *
- * @param catalog The catalog for which this reader is called.
- * @param is The input stream that is to be read.
- * @throws IOException if the URL cannot be read.
- * @throws UnknownCatalogFormatException if the catalog format is
- * not recognized.
- * @throws UnparseableCatalogException if the catalog cannot be parsed.
- * (For example, if it is supposed to be XML and isn't well-formed.)
- */
- public void readCatalog(Catalog catalog, InputStream is)
- throws IOException, CatalogException;
-}
diff --git a/src/com/sun/org/apache/xml/internal/resolver/readers/DOMCatalogParser.java b/src/com/sun/org/apache/xml/internal/resolver/readers/DOMCatalogParser.java
deleted file mode 100644
index ff4af95..0000000
--- a/src/com/sun/org/apache/xml/internal/resolver/readers/DOMCatalogParser.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-// DOMCatalogParser.java - An interface for reading catalog files
-
-/*
- * Copyright 2001-2004 The Apache Software Foundation or its licensors,
- * as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xml.internal.resolver.readers;
-
-import com.sun.org.apache.xml.internal.resolver.Catalog;
-import org.w3c.dom.Node;
-
-/**
- * The DOMCatalogParser interface.
- *
- * <p>This interface must be implemented in order for a class to
- * participate as a parser for the DOMCatalogReader.
- *
- * @see Catalog
- * @see DOMCatalogReader
- *
- * @author Norman Walsh
- * <a href="mailto:Norman.Walsh@Sun.COM">Norman.Walsh@Sun.COM</a>
- *
- */
-public interface DOMCatalogParser {
- /**
- * Parse a DOM node as a catalog entry.
- *
- * <p>This method is expected to analyze the specified node and
- * construct appropriate catalog entry(ies) from it.</p>
- *
- * @param catalog The catalog for which this node is being considered.
- * @param node The DOM Node from the catalog.
- */
- public void parseCatalogEntry(Catalog catalog, Node node);
-}
diff --git a/src/com/sun/org/apache/xml/internal/resolver/readers/DOMCatalogReader.java b/src/com/sun/org/apache/xml/internal/resolver/readers/DOMCatalogReader.java
deleted file mode 100644
index 6f44953..0000000
--- a/src/com/sun/org/apache/xml/internal/resolver/readers/DOMCatalogReader.java
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-// DOMCatalogReader.java - Read XML Catalog files
-
-package com.sun.org.apache.xml.internal.resolver.readers;
-
-import com.sun.org.apache.xml.internal.resolver.Catalog;
-import com.sun.org.apache.xml.internal.resolver.CatalogException;
-import com.sun.org.apache.xml.internal.resolver.helpers.Namespaces;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLConnection;
-import java.util.HashMap;
-import java.util.Map;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.xml.sax.SAXException;
-import sun.reflect.misc.ReflectUtil;
-
-/**
- * A DOM-based CatalogReader.
- *
- * <p>This class is used to read XML Catalogs using the DOM. This reader
- * has an advantage over the SAX-based reader that it can analyze the
- * DOM tree rather than simply a series of SAX events. It has the disadvantage
- * that it requires all of the code necessary to build and walk a DOM
- * tree.</p>
- *
- * <p>Since the choice of CatalogReaders (in the InputStream case) can only
- * be made on the basis of MIME type, the following problem occurs: only
- * one CatalogReader can exist for all XML mime types. In order to get
- * around this problem, the DOMCatalogReader relies on a set of external
- * CatalogParsers to actually build the catalog.</p>
- *
- * <p>The selection of CatalogParsers is made on the basis of the QName
- * of the root element of the document.</p>
- *
- *
- * @see Catalog
- * @see CatalogReader
- * @see SAXCatalogReader
- * @see TextCatalogReader
- * @see DOMCatalogParser
- *
- * @author Norman Walsh
- * <a href="mailto:Norman.Walsh@Sun.COM">Norman.Walsh@Sun.COM</a>
- *
- */
-public class DOMCatalogReader implements CatalogReader {
- /**
- * Mapping table from QNames to CatalogParser classes.
- *
- * <p>Each key in this hash table has the form "elementname"
- * or "{namespaceuri}elementname". The former is used if the
- * namespace URI is null.</p>
- */
- protected Map<String, String> namespaceMap = new HashMap<>();
-
- /**
- * Add a new parser to the reader.
- *
- * <p>This method associates the specified parserClass with the
- * namespaceURI/rootElement names specified.</p>
- *
- * @param namespaceURI The namespace URI. <em>Not</em> the prefix.
- * @param rootElement The name of the root element.
- * @param parserClass The name of the parserClass to instantiate
- * for this kind of catalog.
- */
- public void setCatalogParser(String namespaceURI,
- String rootElement,
- String parserClass) {
- if (namespaceURI == null) {
- namespaceMap.put(rootElement, parserClass);
- } else {
- namespaceMap.put("{"+namespaceURI+"}"+rootElement, parserClass);
- }
- }
-
- /**
- * Get the name of the parser class for a given catalog type.
- *
- * <p>This method returns the parserClass associated with the
- * namespaceURI/rootElement names specified.</p>
- *
- * @param namespaceURI The namespace URI. <em>Not</em> the prefix.
- * @param rootElement The name of the root element.
- * @return The parser class.
- */
- public String getCatalogParser(String namespaceURI,
- String rootElement) {
- if (namespaceURI == null) {
- return namespaceMap.get(rootElement);
- } else {
- return namespaceMap.get("{"+namespaceURI+"}"+rootElement);
- }
- }
-
- /**
- * Null constructor; something for subclasses to call.
- */
- public DOMCatalogReader() { }
-
- /**
- * Read a catalog from an input stream.
- *
- * <p>This class reads a catalog from an input stream:</p>
- *
- * <ul>
- * <li>Based on the QName of the root element, it determines which
- * parser to instantiate for this catalog.</li>
- * <li>It constructs a DOM Document from the catalog and</li>
- * <li>For each child of the root node, it calls the parser's
- * parseCatalogEntry method. This method is expected to make
- * appropriate calls back into the catalog to add entries for the
- * entries in the catalog. It is free to do this in whatever manner
- * is appropriate (perhaps using just the node passed in, perhaps
- * wandering arbitrarily throughout the tree).</li>
- * </ul>
- *
- * @param catalog The catalog for which this reader is called.
- * @param is The input stream that is to be read.
- * @throws IOException if the URL cannot be read.
- * @throws UnknownCatalogFormatException if the catalog format is
- * not recognized.
- * @throws UnparseableCatalogException if the catalog cannot be parsed.
- * (For example, if it is supposed to be XML and isn't well-formed or
- * if the parser class cannot be instantiated.)
- */
- public void readCatalog(Catalog catalog, InputStream is)
- throws IOException, CatalogException {
-
- DocumentBuilderFactory factory = null;
- DocumentBuilder builder = null;
-
- factory = DocumentBuilderFactory.newInstance();
- factory.setNamespaceAware(false);
- factory.setValidating(false);
- try {
- builder = factory.newDocumentBuilder();
- } catch (ParserConfigurationException pce) {
- throw new CatalogException(CatalogException.UNPARSEABLE);
- }
-
- Document doc = null;
-
- try {
- doc = builder.parse(is);
- } catch (SAXException se) {
- throw new CatalogException(CatalogException.UNKNOWN_FORMAT);
- }
-
- Element root = doc.getDocumentElement();
-
- String namespaceURI = Namespaces.getNamespaceURI(root);
- String localName = Namespaces.getLocalName(root);
-
- String domParserClass = getCatalogParser(namespaceURI,
- localName);
-
- if (domParserClass == null) {
- if (namespaceURI == null) {
- catalog.getCatalogManager().debug.message(1, "No Catalog parser for "
- + localName);
- } else {
- catalog.getCatalogManager().debug.message(1, "No Catalog parser for "
- + "{" + namespaceURI + "}"
- + localName);
- }
- return;
- }
-
- DOMCatalogParser domParser = null;
-
- try {
- domParser = (DOMCatalogParser) ReflectUtil.forName(domParserClass).newInstance();
- } catch (ClassNotFoundException cnfe) {
- catalog.getCatalogManager().debug.message(1, "Cannot load XML Catalog Parser class", domParserClass);
- throw new CatalogException(CatalogException.UNPARSEABLE);
- } catch (InstantiationException ie) {
- catalog.getCatalogManager().debug.message(1, "Cannot instantiate XML Catalog Parser class", domParserClass);
- throw new CatalogException(CatalogException.UNPARSEABLE);
- } catch (IllegalAccessException iae) {
- catalog.getCatalogManager().debug.message(1, "Cannot access XML Catalog Parser class", domParserClass);
- throw new CatalogException(CatalogException.UNPARSEABLE);
- } catch (ClassCastException cce ) {
- catalog.getCatalogManager().debug.message(1, "Cannot cast XML Catalog Parser class", domParserClass);
- throw new CatalogException(CatalogException.UNPARSEABLE);
- }
-
- Node node = root.getFirstChild();
- while (node != null) {
- domParser.parseCatalogEntry(catalog, node);
- node = node.getNextSibling();
- }
- }
-
- /**
- * Read the catalog behind the specified URL.
- *
- * @see #readCatalog(Catalog, InputStream)
- *
- * @param catalog The catalog for which we are reading.
- * @param fileUrl The URL of the document that should be read.
- *
- * @throws MalformedURLException if the specified URL cannot be
- * turned into a URL object.
- * @throws IOException if the URL cannot be read.
- * @throws UnknownCatalogFormatException if the catalog format is
- * not recognized.
- * @throws UnparseableCatalogException if the catalog cannot be parsed.
- * (For example, if it is supposed to be XML and isn't well-formed.)
- */
- public void readCatalog(Catalog catalog, String fileUrl)
- throws MalformedURLException, IOException, CatalogException {
- URL url = new URL(fileUrl);
- URLConnection urlCon = url.openConnection();
- readCatalog(catalog, urlCon.getInputStream());
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/resolver/readers/ExtendedXMLCatalogReader.java b/src/com/sun/org/apache/xml/internal/resolver/readers/ExtendedXMLCatalogReader.java
deleted file mode 100644
index a638a47..0000000
--- a/src/com/sun/org/apache/xml/internal/resolver/readers/ExtendedXMLCatalogReader.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-// ExtendedXMLCatalogReader.java - Read XML Catalog files
-
-/*
- * Copyright 2001-2004 The Apache Software Foundation or its licensors,
- * as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xml.internal.resolver.readers;
-
-import java.util.Vector;
-import com.sun.org.apache.xml.internal.resolver.Catalog;
-import com.sun.org.apache.xml.internal.resolver.Resolver;
-import com.sun.org.apache.xml.internal.resolver.CatalogEntry;
-import com.sun.org.apache.xml.internal.resolver.CatalogException;
-
-import org.xml.sax.*;
-import org.w3c.dom.*;
-
-/**
- * Parse Extended OASIS Entity Resolution Technical Committee
- * XML Catalog files.
- *
- * @see Catalog
- *
- * @author Norman Walsh
- * <a href="mailto:Norman.Walsh@Sun.COM">Norman.Walsh@Sun.COM</a>
- *
- */
-public class ExtendedXMLCatalogReader extends OASISXMLCatalogReader {
- /** The namespace name of extended catalog elements */
- public static final String extendedNamespaceName = "http://nwalsh.com/xcatalog/1.0";
-
- /**
- * The SAX <code>startElement</code> method recognizes elements
- * from the plain catalog format and instantiates CatalogEntry
- * objects for them.
- *
- * @param namespaceURI The namespace name of the element.
- * @param localName The local name of the element.
- * @param qName The QName of the element.
- * @param atts The list of attributes on the element.
- *
- * @see CatalogEntry
- */
- public void startElement (String namespaceURI,
- String localName,
- String qName,
- Attributes atts)
- throws SAXException {
-
- // Check before calling the super because super will report our
- // namespace as an extension namespace, but that doesn't count
- // for this element.
- boolean inExtension = inExtensionNamespace();
-
- super.startElement(namespaceURI, localName, qName, atts);
-
- int entryType = -1;
- Vector entryArgs = new Vector();
-
- if (namespaceURI != null && extendedNamespaceName.equals(namespaceURI)
- && !inExtension) {
- // This is an Extended XML Catalog entry
-
- if (atts.getValue("xml:base") != null) {
- String baseURI = atts.getValue("xml:base");
- entryType = Catalog.BASE;
- entryArgs.add(baseURI);
- baseURIStack.push(baseURI);
-
- debug.message(4, "xml:base", baseURI);
-
- try {
- CatalogEntry ce = new CatalogEntry(entryType, entryArgs);
- catalog.addEntry(ce);
- } catch (CatalogException cex) {
- if (cex.getExceptionType() == CatalogException.INVALID_ENTRY_TYPE) {
- debug.message(1, "Invalid catalog entry type", localName);
- } else if (cex.getExceptionType() == CatalogException.INVALID_ENTRY) {
- debug.message(1, "Invalid catalog entry (base)", localName);
- }
- }
-
- entryType = -1;
- entryArgs = new Vector();
- } else {
- baseURIStack.push(baseURIStack.peek());
- }
-
- if (localName.equals("uriSuffix")) {
- if (checkAttributes(atts, "suffix", "uri")) {
- entryType = Resolver.URISUFFIX;
- entryArgs.add(atts.getValue("suffix"));
- entryArgs.add(atts.getValue("uri"));
-
- debug.message(4, "uriSuffix",
- atts.getValue("suffix"),
- atts.getValue("uri"));
- }
- } else if (localName.equals("systemSuffix")) {
- if (checkAttributes(atts, "suffix", "uri")) {
- entryType = Resolver.SYSTEMSUFFIX;
- entryArgs.add(atts.getValue("suffix"));
- entryArgs.add(atts.getValue("uri"));
-
- debug.message(4, "systemSuffix",
- atts.getValue("suffix"),
- atts.getValue("uri"));
- }
- } else {
- // This is equivalent to an invalid catalog entry type
- debug.message(1, "Invalid catalog entry type", localName);
- }
-
- if (entryType >= 0) {
- try {
- CatalogEntry ce = new CatalogEntry(entryType, entryArgs);
- catalog.addEntry(ce);
- } catch (CatalogException cex) {
- if (cex.getExceptionType() == CatalogException.INVALID_ENTRY_TYPE) {
- debug.message(1, "Invalid catalog entry type", localName);
- } else if (cex.getExceptionType() == CatalogException.INVALID_ENTRY) {
- debug.message(1, "Invalid catalog entry", localName);
- }
- }
- }
- }
- }
-
- /** The SAX <code>endElement</code> method does nothing. */
- public void endElement (String namespaceURI,
- String localName,
- String qName)
- throws SAXException {
-
- super.endElement(namespaceURI, localName, qName);
-
- // Check after popping the stack so we don't erroneously think we
- // are our own extension namespace...
- boolean inExtension = inExtensionNamespace();
-
- int entryType = -1;
- Vector entryArgs = new Vector();
-
- if (namespaceURI != null
- && (extendedNamespaceName.equals(namespaceURI))
- && !inExtension) {
-
- String popURI = (String) baseURIStack.pop();
- String baseURI = (String) baseURIStack.peek();
-
- if (!baseURI.equals(popURI)) {
- entryType = catalog.BASE;
- entryArgs.add(baseURI);
-
- debug.message(4, "(reset) xml:base", baseURI);
-
- try {
- CatalogEntry ce = new CatalogEntry(entryType, entryArgs);
- catalog.addEntry(ce);
- } catch (CatalogException cex) {
- if (cex.getExceptionType() == CatalogException.INVALID_ENTRY_TYPE) {
- debug.message(1, "Invalid catalog entry type", localName);
- } else if (cex.getExceptionType() == CatalogException.INVALID_ENTRY) {
- debug.message(1, "Invalid catalog entry (rbase)", localName);
- }
- }
- }
- }
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/resolver/readers/OASISXMLCatalogReader.java b/src/com/sun/org/apache/xml/internal/resolver/readers/OASISXMLCatalogReader.java
deleted file mode 100644
index f1d6b89..0000000
--- a/src/com/sun/org/apache/xml/internal/resolver/readers/OASISXMLCatalogReader.java
+++ /dev/null
@@ -1,541 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-// OASISXMLCatalogReader.java - Read XML Catalog files
-
-/*
- * Copyright 2001-2004 The Apache Software Foundation or its licensors,
- * as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xml.internal.resolver.readers;
-
-import java.util.Stack;
-import java.util.Vector;
-import java.util.Enumeration;
-import com.sun.org.apache.xml.internal.resolver.Catalog;
-import com.sun.org.apache.xml.internal.resolver.CatalogEntry;
-import com.sun.org.apache.xml.internal.resolver.CatalogException;
-import com.sun.org.apache.xml.internal.resolver.helpers.PublicId;
-
-import org.xml.sax.*;
-import org.w3c.dom.*;
-
-/**
- * Parse OASIS Entity Resolution Technical Committee
- * XML Catalog files.
- *
- * @see Catalog
- *
- * @author Norman Walsh
- * <a href="mailto:Norman.Walsh@Sun.COM">Norman.Walsh@Sun.COM</a>
- *
- */
-public class OASISXMLCatalogReader extends SAXCatalogReader implements SAXCatalogParser {
- /** The catalog object needs to be stored by the object so that
- * SAX callbacks can use it.
- */
- protected Catalog catalog = null;
-
- /** The namespace name of OASIS ERTC catalogs */
- public static final String namespaceName = "urn:oasis:names:tc:entity:xmlns:xml:catalog";
-
- /** The namespace name of OASIS ERTC TR9401 catalog extension */
- public static final String tr9401NamespaceName = "urn:oasis:names:tc:entity:xmlns:tr9401:catalog";
-
- protected Stack baseURIStack = new Stack();
- protected Stack overrideStack = new Stack();
- protected Stack namespaceStack = new Stack();
-
- /** Set the current catalog. */
- public void setCatalog (Catalog catalog) {
- this.catalog = catalog;
- debug = catalog.getCatalogManager().debug;
- }
-
- /** Get the current catalog. */
- public Catalog getCatalog () {
- return catalog;
- }
-
- /**
- * Are we in an extension namespace?
- *
- * @return true if the current stack of open namespaces includes
- * an extension namespace.
- */
- protected boolean inExtensionNamespace() {
- boolean inExtension = false;
-
- Enumeration elements = namespaceStack.elements();
- while (!inExtension && elements.hasMoreElements()) {
- String ns = (String) elements.nextElement();
- if (ns == null) {
- inExtension = true;
- } else {
- inExtension = (!ns.equals(tr9401NamespaceName)
- && !ns.equals(namespaceName));
- }
- }
-
- return inExtension;
- }
-
- // ----------------------------------------------------------------------
- // Implement the SAX ContentHandler interface
-
- /** The SAX <code>setDocumentLocator</code> method does nothing. */
- public void setDocumentLocator (Locator locator) {
- return;
- }
-
- /** The SAX <code>startDocument</code> method does nothing. */
- public void startDocument ()
- throws SAXException {
- baseURIStack.push(catalog.getCurrentBase());
- overrideStack.push(catalog.getDefaultOverride());
- return;
- }
-
- /** The SAX <code>endDocument</code> method does nothing. */
- public void endDocument ()
- throws SAXException {
- return;
- }
-
- /**
- * The SAX <code>startElement</code> method recognizes elements
- * from the plain catalog format and instantiates CatalogEntry
- * objects for them.
- *
- * @param namespaceURI The namespace name of the element.
- * @param localName The local name of the element.
- * @param qName The QName of the element.
- * @param atts The list of attributes on the element.
- *
- * @see CatalogEntry
- */
- public void startElement (String namespaceURI,
- String localName,
- String qName,
- Attributes atts)
- throws SAXException {
-
- int entryType = -1;
- Vector entryArgs = new Vector();
-
- namespaceStack.push(namespaceURI);
-
- boolean inExtension = inExtensionNamespace();
-
- if (namespaceURI != null && namespaceName.equals(namespaceURI)
- && !inExtension) {
- // This is an XML Catalog entry
-
- if (atts.getValue("xml:base") != null) {
- String baseURI = atts.getValue("xml:base");
- entryType = Catalog.BASE;
- entryArgs.add(baseURI);
- baseURIStack.push(baseURI);
-
- debug.message(4, "xml:base", baseURI);
-
- try {
- CatalogEntry ce = new CatalogEntry(entryType, entryArgs);
- catalog.addEntry(ce);
- } catch (CatalogException cex) {
- if (cex.getExceptionType() == CatalogException.INVALID_ENTRY_TYPE) {
- debug.message(1, "Invalid catalog entry type", localName);
- } else if (cex.getExceptionType() == CatalogException.INVALID_ENTRY) {
- debug.message(1, "Invalid catalog entry (base)", localName);
- }
- }
-
- entryType = -1;
- entryArgs = new Vector();
-
- } else {
- baseURIStack.push(baseURIStack.peek());
- }
-
- if ((localName.equals("catalog") || localName.equals("group"))
- && atts.getValue("prefer") != null) {
- String override = atts.getValue("prefer");
-
- if (override.equals("public")) {
- override = "yes";
- } else if (override.equals("system")) {
- override = "no";
- } else {
- debug.message(1,
- "Invalid prefer: must be 'system' or 'public'",
- localName);
- override = catalog.getDefaultOverride();
- }
-
- entryType = Catalog.OVERRIDE;
- entryArgs.add(override);
- overrideStack.push(override);
-
- debug.message(4, "override", override);
-
- try {
- CatalogEntry ce = new CatalogEntry(entryType, entryArgs);
- catalog.addEntry(ce);
- } catch (CatalogException cex) {
- if (cex.getExceptionType() == CatalogException.INVALID_ENTRY_TYPE) {
- debug.message(1, "Invalid catalog entry type", localName);
- } else if (cex.getExceptionType() == CatalogException.INVALID_ENTRY) {
- debug.message(1, "Invalid catalog entry (override)", localName);
- }
- }
-
- entryType = -1;
- entryArgs = new Vector();
-
- } else {
- overrideStack.push(overrideStack.peek());
- }
-
- if (localName.equals("delegatePublic")) {
- if (checkAttributes(atts, "publicIdStartString", "catalog")) {
- entryType = Catalog.DELEGATE_PUBLIC;
- entryArgs.add(atts.getValue("publicIdStartString"));
- entryArgs.add(atts.getValue("catalog"));
-
- debug.message(4, "delegatePublic",
- PublicId.normalize(atts.getValue("publicIdStartString")),
- atts.getValue("catalog"));
- }
- } else if (localName.equals("delegateSystem")) {
- if (checkAttributes(atts, "systemIdStartString", "catalog")) {
- entryType = Catalog.DELEGATE_SYSTEM;
- entryArgs.add(atts.getValue("systemIdStartString"));
- entryArgs.add(atts.getValue("catalog"));
-
- debug.message(4, "delegateSystem",
- atts.getValue("systemIdStartString"),
- atts.getValue("catalog"));
- }
- } else if (localName.equals("delegateURI")) {
- if (checkAttributes(atts, "uriStartString", "catalog")) {
- entryType = Catalog.DELEGATE_URI;
- entryArgs.add(atts.getValue("uriStartString"));
- entryArgs.add(atts.getValue("catalog"));
-
- debug.message(4, "delegateURI",
- atts.getValue("uriStartString"),
- atts.getValue("catalog"));
- }
- } else if (localName.equals("rewriteSystem")) {
- if (checkAttributes(atts, "systemIdStartString", "rewritePrefix")) {
- entryType = Catalog.REWRITE_SYSTEM;
- entryArgs.add(atts.getValue("systemIdStartString"));
- entryArgs.add(atts.getValue("rewritePrefix"));
-
- debug.message(4, "rewriteSystem",
- atts.getValue("systemIdStartString"),
- atts.getValue("rewritePrefix"));
- }
- } else if (localName.equals("systemSuffix")) {
- if (checkAttributes(atts, "systemIdSuffix", "uri")) {
- entryType = Catalog.SYSTEM_SUFFIX;
- entryArgs.add(atts.getValue("systemIdSuffix"));
- entryArgs.add(atts.getValue("uri"));
-
- debug.message(4, "systemSuffix",
- atts.getValue("systemIdSuffix"),
- atts.getValue("uri"));
- }
- } else if (localName.equals("rewriteURI")) {
- if (checkAttributes(atts, "uriStartString", "rewritePrefix")) {
- entryType = Catalog.REWRITE_URI;
- entryArgs.add(atts.getValue("uriStartString"));
- entryArgs.add(atts.getValue("rewritePrefix"));
-
- debug.message(4, "rewriteURI",
- atts.getValue("uriStartString"),
- atts.getValue("rewritePrefix"));
- }
- } else if (localName.equals("uriSuffix")) {
- if (checkAttributes(atts, "uriSuffix", "uri")) {
- entryType = Catalog.URI_SUFFIX;
- entryArgs.add(atts.getValue("uriSuffix"));
- entryArgs.add(atts.getValue("uri"));
-
- debug.message(4, "uriSuffix",
- atts.getValue("uriSuffix"),
- atts.getValue("uri"));
- }
- } else if (localName.equals("nextCatalog")) {
- if (checkAttributes(atts, "catalog")) {
- entryType = Catalog.CATALOG;
- entryArgs.add(atts.getValue("catalog"));
-
- debug.message(4, "nextCatalog", atts.getValue("catalog"));
- }
- } else if (localName.equals("public")) {
- if (checkAttributes(atts, "publicId", "uri")) {
- entryType = Catalog.PUBLIC;
- entryArgs.add(atts.getValue("publicId"));
- entryArgs.add(atts.getValue("uri"));
-
- debug.message(4, "public",
- PublicId.normalize(atts.getValue("publicId")),
- atts.getValue("uri"));
- }
- } else if (localName.equals("system")) {
- if (checkAttributes(atts, "systemId", "uri")) {
- entryType = Catalog.SYSTEM;
- entryArgs.add(atts.getValue("systemId"));
- entryArgs.add(atts.getValue("uri"));
-
- debug.message(4, "system",
- atts.getValue("systemId"),
- atts.getValue("uri"));
- }
- } else if (localName.equals("uri")) {
- if (checkAttributes(atts, "name", "uri")) {
- entryType = Catalog.URI;
- entryArgs.add(atts.getValue("name"));
- entryArgs.add(atts.getValue("uri"));
-
- debug.message(4, "uri",
- atts.getValue("name"),
- atts.getValue("uri"));
- }
- } else if (localName.equals("catalog")) {
- // nop, start of catalog
- } else if (localName.equals("group")) {
- // nop, a group
- } else {
- // This is equivalent to an invalid catalog entry type
- debug.message(1, "Invalid catalog entry type", localName);
- }
-
- if (entryType >= 0) {
- try {
- CatalogEntry ce = new CatalogEntry(entryType, entryArgs);
- catalog.addEntry(ce);
- } catch (CatalogException cex) {
- if (cex.getExceptionType() == CatalogException.INVALID_ENTRY_TYPE) {
- debug.message(1, "Invalid catalog entry type", localName);
- } else if (cex.getExceptionType() == CatalogException.INVALID_ENTRY) {
- debug.message(1, "Invalid catalog entry", localName);
- }
- }
- }
- }
-
- if (namespaceURI != null && tr9401NamespaceName.equals(namespaceURI)
- && !inExtension) {
- // This is a TR9401 Catalog entry
-
- if (atts.getValue("xml:base") != null) {
- String baseURI = atts.getValue("xml:base");
- entryType = Catalog.BASE;
- entryArgs.add(baseURI);
- baseURIStack.push(baseURI);
-
- debug.message(4, "xml:base", baseURI);
-
- try {
- CatalogEntry ce = new CatalogEntry(entryType, entryArgs);
- catalog.addEntry(ce);
- } catch (CatalogException cex) {
- if (cex.getExceptionType() == CatalogException.INVALID_ENTRY_TYPE) {
- debug.message(1, "Invalid catalog entry type", localName);
- } else if (cex.getExceptionType() == CatalogException.INVALID_ENTRY) {
- debug.message(1, "Invalid catalog entry (base)", localName);
- }
- }
-
- entryType = -1;
- entryArgs = new Vector();
-
- } else {
- baseURIStack.push(baseURIStack.peek());
- }
-
- if (localName.equals("doctype")) {
- entryType = catalog.DOCTYPE;
- entryArgs.add(atts.getValue("name"));
- entryArgs.add(atts.getValue("uri"));
- } else if (localName.equals("document")) {
- entryType = catalog.DOCUMENT;
- entryArgs.add(atts.getValue("uri"));
- } else if (localName.equals("dtddecl")) {
- entryType = catalog.DTDDECL;
- entryArgs.add(atts.getValue("publicId"));
- entryArgs.add(atts.getValue("uri"));
- } else if (localName.equals("entity")) {
- entryType = Catalog.ENTITY;
- entryArgs.add(atts.getValue("name"));
- entryArgs.add(atts.getValue("uri"));
- } else if (localName.equals("linktype")) {
- entryType = Catalog.LINKTYPE;
- entryArgs.add(atts.getValue("name"));
- entryArgs.add(atts.getValue("uri"));
- } else if (localName.equals("notation")) {
- entryType = Catalog.NOTATION;
- entryArgs.add(atts.getValue("name"));
- entryArgs.add(atts.getValue("uri"));
- } else if (localName.equals("sgmldecl")) {
- entryType = Catalog.SGMLDECL;
- entryArgs.add(atts.getValue("uri"));
- } else {
- // This is equivalent to an invalid catalog entry type
- debug.message(1, "Invalid catalog entry type", localName);
- }
-
- if (entryType >= 0) {
- try {
- CatalogEntry ce = new CatalogEntry(entryType, entryArgs);
- catalog.addEntry(ce);
- } catch (CatalogException cex) {
- if (cex.getExceptionType() == CatalogException.INVALID_ENTRY_TYPE) {
- debug.message(1, "Invalid catalog entry type", localName);
- } else if (cex.getExceptionType() == CatalogException.INVALID_ENTRY) {
- debug.message(1, "Invalid catalog entry", localName);
- }
- }
- }
- }
- }
-
- public boolean checkAttributes (Attributes atts, String attName) {
- if (atts.getValue(attName) == null) {
- debug.message(1, "Error: required attribute " + attName + " missing.");
- return false;
- } else {
- return true;
- }
- }
-
- public boolean checkAttributes (Attributes atts,
- String attName1,
- String attName2) {
- return checkAttributes(atts, attName1)
- && checkAttributes(atts, attName2);
- }
-
- /** The SAX <code>endElement</code> method does nothing. */
- public void endElement (String namespaceURI,
- String localName,
- String qName)
- throws SAXException {
-
- int entryType = -1;
- Vector entryArgs = new Vector();
-
- boolean inExtension = inExtensionNamespace();
-
- if (namespaceURI != null
- && !inExtension
- && (namespaceName.equals(namespaceURI)
- || tr9401NamespaceName.equals(namespaceURI))) {
-
- String popURI = (String) baseURIStack.pop();
- String baseURI = (String) baseURIStack.peek();
-
- if (!baseURI.equals(popURI)) {
- entryType = catalog.BASE;
- entryArgs.add(baseURI);
-
- debug.message(4, "(reset) xml:base", baseURI);
-
- try {
- CatalogEntry ce = new CatalogEntry(entryType, entryArgs);
- catalog.addEntry(ce);
- } catch (CatalogException cex) {
- if (cex.getExceptionType() == CatalogException.INVALID_ENTRY_TYPE) {
- debug.message(1, "Invalid catalog entry type", localName);
- } else if (cex.getExceptionType() == CatalogException.INVALID_ENTRY) {
- debug.message(1, "Invalid catalog entry (rbase)", localName);
- }
- }
- }
- }
-
- if (namespaceURI != null && namespaceName.equals(namespaceURI)
- && !inExtension) {
- if (localName.equals("catalog") || localName.equals("group")) {
- String popOverride = (String) overrideStack.pop();
- String override = (String) overrideStack.peek();
-
- if (!override.equals(popOverride)) {
- entryType = catalog.OVERRIDE;
- entryArgs.add(override);
- overrideStack.push(override);
-
- debug.message(4, "(reset) override", override);
-
- try {
- CatalogEntry ce = new CatalogEntry(entryType, entryArgs);
- catalog.addEntry(ce);
- } catch (CatalogException cex) {
- if (cex.getExceptionType() == CatalogException.INVALID_ENTRY_TYPE) {
- debug.message(1, "Invalid catalog entry type", localName);
- } else if (cex.getExceptionType() == CatalogException.INVALID_ENTRY) {
- debug.message(1, "Invalid catalog entry (roverride)", localName);
- }
- }
- }
- }
- }
-
- namespaceStack.pop();
-
- return;
- }
-
- /** The SAX <code>characters</code> method does nothing. */
- public void characters (char ch[], int start, int length)
- throws SAXException {
- return;
- }
-
- /** The SAX <code>ignorableWhitespace</code> method does nothing. */
- public void ignorableWhitespace (char ch[], int start, int length)
- throws SAXException {
- return;
- }
-
- /** The SAX <code>processingInstruction</code> method does nothing. */
- public void processingInstruction (String target, String data)
- throws SAXException {
- return;
- }
-
- /** The SAX <code>skippedEntity</code> method does nothing. */
- public void skippedEntity (String name)
- throws SAXException {
- return;
- }
-
- /** The SAX <code>startPrefixMapping</code> method does nothing. */
- public void startPrefixMapping(String prefix, String uri)
- throws SAXException {
- return;
- }
-
- /** The SAX <code>endPrefixMapping</code> method does nothing. */
- public void endPrefixMapping(String prefix)
- throws SAXException {
- return;
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/resolver/readers/SAXCatalogParser.java b/src/com/sun/org/apache/xml/internal/resolver/readers/SAXCatalogParser.java
deleted file mode 100644
index 782744b..0000000
--- a/src/com/sun/org/apache/xml/internal/resolver/readers/SAXCatalogParser.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-// SAXCatalogParser.java - An interface for reading catalog files
-
-/*
- * Copyright 2001-2004 The Apache Software Foundation or its licensors,
- * as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xml.internal.resolver.readers;
-
-import com.sun.org.apache.xml.internal.resolver.Catalog;
-import org.xml.sax.*;
-
-/**
- * The SAXCatalogParser interface.
- *
- * <p>This interface must be implemented in order for a class to
- * participate as a parser for the SAXCatalogReader.
- *
- * @see Catalog
- * @see SAXCatalogReader
- *
- * @author Norman Walsh
- * <a href="mailto:Norman.Walsh@Sun.COM">Norman.Walsh@Sun.COM</a>
- *
- */
-public interface SAXCatalogParser extends ContentHandler, DocumentHandler {
- /** Set the Catalog for which parsing is being performed. */
- public void setCatalog(Catalog catalog);
-}
diff --git a/src/com/sun/org/apache/xml/internal/resolver/readers/SAXCatalogReader.java b/src/com/sun/org/apache/xml/internal/resolver/readers/SAXCatalogReader.java
deleted file mode 100644
index 3e75ab3..0000000
--- a/src/com/sun/org/apache/xml/internal/resolver/readers/SAXCatalogReader.java
+++ /dev/null
@@ -1,502 +0,0 @@
-/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-// SAXCatalogReader.java - Read XML Catalog files
-
-package com.sun.org.apache.xml.internal.resolver.readers;
-
-import com.sun.org.apache.xml.internal.resolver.Catalog;
-import com.sun.org.apache.xml.internal.resolver.CatalogException;
-import com.sun.org.apache.xml.internal.resolver.CatalogManager;
-import com.sun.org.apache.xml.internal.resolver.helpers.Debug;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLConnection;
-import java.net.UnknownHostException;
-import java.util.HashMap;
-import java.util.Map;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-import org.xml.sax.AttributeList;
-import org.xml.sax.Attributes;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.DocumentHandler;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.InputSource;
-import org.xml.sax.Locator;
-import org.xml.sax.Parser;
-import org.xml.sax.SAXException;
-import sun.reflect.misc.ReflectUtil;
-
-/**
- * A SAX-based CatalogReader.
- *
- * <p>This class is used to read XML Catalogs using the SAX. This reader
- * has an advantage over the DOM-based reader in that it functions on
- * the stream of SAX events. It has the disadvantage
- * that it cannot look around in the tree.</p>
- *
- * <p>Since the choice of CatalogReaders (in the InputStream case) can only
- * be made on the basis of MIME type, the following problem occurs: only
- * one CatalogReader can exist for all XML mime types. In order to get
- * around this problem, the SAXCatalogReader relies on a set of external
- * CatalogParsers to actually build the catalog.</p>
- *
- * <p>The selection of CatalogParsers is made on the basis of the QName
- * of the root element of the document.</p>
- *
- * @see Catalog
- * @see CatalogReader
- * @see SAXCatalogReader
- * @see TextCatalogReader
- * @see DOMCatalogParser
- *
- * @author Norman Walsh
- * <a href="mailto:Norman.Walsh@Sun.COM">Norman.Walsh@Sun.COM</a>
- *
- */
-public class SAXCatalogReader implements CatalogReader, ContentHandler, DocumentHandler {
- /** The SAX Parser Factory */
- protected SAXParserFactory parserFactory = null;
-
- /** The SAX Parser Class */
- protected String parserClass = null;
-
- /**
- * Mapping table from QNames to CatalogParser classes.
- *
- * <p>Each key in this hash table has the form "elementname"
- * or "{namespaceuri}elementname". The former is used if the
- * namespace URI is null.</p>
- */
- protected Map<String, String> namespaceMap = new HashMap<>();
-
- /** The parser in use for the current catalog. */
- private SAXCatalogParser saxParser = null;
-
- /** Set if something goes horribly wrong. It allows the class to
- * ignore the rest of the events that are received.
- */
- private boolean abandonHope = false;
-
- /** The Catalog that we're working for. */
- private Catalog catalog;
-
- /** Set the XML SAX Parser Factory.
- */
- public void setParserFactory(SAXParserFactory parserFactory) {
- this.parserFactory = parserFactory;
- }
-
- /** Set the XML SAX Parser Class
- */
- public void setParserClass(String parserClass) {
- this.parserClass = parserClass;
- }
-
- /** Get the parser factory currently in use. */
- public SAXParserFactory getParserFactory() {
- return parserFactory;
- }
-
- /** Get the parser class currently in use. */
- public String getParserClass() {
- return parserClass;
- }
-
- /** The debug class to use for this reader.
- *
- * This is a bit of a hack. Anyway, whenever we read for a catalog,
- * we extract the debug object
- * from the catalog's manager so that we can use it to print messages.
- *
- * In production, we don't really expect any messages so it doesn't
- * really matter. But it's still a bit of a hack.
- */
- protected Debug debug = CatalogManager.getStaticManager().debug;
-
- /** The constructor */
- public SAXCatalogReader() {
- parserFactory = null;
- parserClass = null;
- }
-
- /** The constructor */
- public SAXCatalogReader(SAXParserFactory parserFactory) {
- this.parserFactory = parserFactory;
- }
-
- /** The constructor */
- public SAXCatalogReader(String parserClass) {
- this.parserClass = parserClass;
- }
-
- /** Set the SAXCatalogParser class for the given namespace/root
- * element type.
- */
- public void setCatalogParser(String namespaceURI,
- String rootElement,
- String parserClass) {
- if (namespaceURI == null) {
- namespaceMap.put(rootElement, parserClass);
- } else {
- namespaceMap.put("{"+namespaceURI+"}"+rootElement, parserClass);
- }
- }
-
- /** Get the SAXCatalogParser class for the given namespace/root
- * element type.
- */
- public String getCatalogParser(String namespaceURI,
- String rootElement) {
- if (namespaceURI == null) {
- return namespaceMap.get(rootElement);
- } else {
- return namespaceMap.get("{"+namespaceURI+"}"+rootElement);
- }
- }
-
- /**
- * Parse an XML Catalog file.
- *
- * @param catalog The catalog to which this catalog file belongs
- * @param fileUrl The URL or filename of the catalog file to process
- *
- * @throws MalformedURLException Improper fileUrl
- * @throws IOException Error reading catalog file
- */
- public void readCatalog(Catalog catalog, String fileUrl)
- throws MalformedURLException, IOException,
- CatalogException {
-
- URL url = null;
-
- try {
- url = new URL(fileUrl);
- } catch (MalformedURLException e) {
- url = new URL("file:///" + fileUrl);
- }
-
- debug = catalog.getCatalogManager().debug;
-
- try {
- URLConnection urlCon = url.openConnection();
- readCatalog(catalog, urlCon.getInputStream());
- } catch (FileNotFoundException e) {
- catalog.getCatalogManager().debug.message(1, "Failed to load catalog, file not found",
- url.toString());
- }
- }
-
- /**
- * Parse an XML Catalog stream.
- *
- * @param catalog The catalog to which this catalog file belongs
- * @param is The input stream from which the catalog will be read
- *
- * @throws MalformedURLException Improper fileUrl
- * @throws IOException Error reading catalog file
- * @throws CatalogException A Catalog exception
- */
- public void readCatalog(Catalog catalog, InputStream is)
- throws IOException, CatalogException {
-
- // Create an instance of the parser
- if (parserFactory == null && parserClass == null) {
- debug.message(1, "Cannot read SAX catalog without a parser");
- throw new CatalogException(CatalogException.UNPARSEABLE);
- }
-
- debug = catalog.getCatalogManager().debug;
- EntityResolver bResolver = catalog.getCatalogManager().getBootstrapResolver();
-
- this.catalog = catalog;
-
- try {
- if (parserFactory != null) {
- SAXParser parser = parserFactory.newSAXParser();
- SAXParserHandler spHandler = new SAXParserHandler();
- spHandler.setContentHandler(this);
- if (bResolver != null) {
- spHandler.setEntityResolver(bResolver);
- }
- parser.parse(new InputSource(is), spHandler);
- } else {
- Parser parser = (Parser) ReflectUtil.forName(parserClass).newInstance();
- parser.setDocumentHandler(this);
- if (bResolver != null) {
- parser.setEntityResolver(bResolver);
- }
- parser.parse(new InputSource(is));
- }
- } catch (ClassNotFoundException cnfe) {
- throw new CatalogException(CatalogException.UNPARSEABLE);
- } catch (IllegalAccessException iae) {
- throw new CatalogException(CatalogException.UNPARSEABLE);
- } catch (InstantiationException ie) {
- throw new CatalogException(CatalogException.UNPARSEABLE);
- } catch (ParserConfigurationException pce) {
- throw new CatalogException(CatalogException.UNKNOWN_FORMAT);
- } catch (SAXException se) {
- Exception e = se.getException();
- // FIXME: there must be a better way
- UnknownHostException uhe = new UnknownHostException();
- FileNotFoundException fnfe = new FileNotFoundException();
- if (e != null) {
- if (e.getClass() == uhe.getClass()) {
- throw new CatalogException(CatalogException.PARSE_FAILED,
- e.toString());
- } else if (e.getClass() == fnfe.getClass()) {
- throw new CatalogException(CatalogException.PARSE_FAILED,
- e.toString());
- }
- }
- throw new CatalogException(se);
- }
- }
-
- // ----------------------------------------------------------------------
- // Implement the SAX ContentHandler interface
-
- /** The SAX <code>setDocumentLocator</code> method. Does nothing. */
- public void setDocumentLocator (Locator locator) {
- if (saxParser != null) {
- saxParser.setDocumentLocator(locator);
- }
- }
-
- /** The SAX <code>startDocument</code> method. Does nothing. */
- public void startDocument () throws SAXException {
- saxParser = null;
- abandonHope = false;
- return;
- }
-
- /** The SAX <code>endDocument</code> method. Does nothing. */
- public void endDocument ()throws SAXException {
- if (saxParser != null) {
- saxParser.endDocument();
- }
- }
-
- /**
- * The SAX <code>startElement</code> method.
- *
- * <p>The catalog parser is selected based on the namespace of the
- * first element encountered in the catalog.</p>
- */
- public void startElement (String name,
- AttributeList atts)
- throws SAXException {
-
- if (abandonHope) {
- return;
- }
-
- if (saxParser == null) {
- String prefix = "";
- if (name.indexOf(':') > 0) {
- prefix = name.substring(0, name.indexOf(':'));
- }
-
- String localName = name;
- if (localName.indexOf(':') > 0) {
- localName = localName.substring(localName.indexOf(':')+1);
- }
-
- String namespaceURI = null;
- if (prefix.equals("")) {
- namespaceURI = atts.getValue("xmlns");
- } else {
- namespaceURI = atts.getValue("xmlns:" + prefix);
- }
-
- String saxParserClass = getCatalogParser(namespaceURI,
- localName);
-
- if (saxParserClass == null) {
- abandonHope = true;
- if (namespaceURI == null) {
- debug.message(2, "No Catalog parser for " + name);
- } else {
- debug.message(2, "No Catalog parser for "
- + "{" + namespaceURI + "}"
- + name);
- }
- return;
- }
-
- try {
- saxParser = (SAXCatalogParser)
- ReflectUtil.forName(saxParserClass).newInstance();
-
- saxParser.setCatalog(catalog);
- saxParser.startDocument();
- saxParser.startElement(name, atts);
- } catch (ClassNotFoundException cnfe) {
- saxParser = null;
- abandonHope = true;
- debug.message(2, cnfe.toString());
- } catch (InstantiationException ie) {
- saxParser = null;
- abandonHope = true;
- debug.message(2, ie.toString());
- } catch (IllegalAccessException iae) {
- saxParser = null;
- abandonHope = true;
- debug.message(2, iae.toString());
- } catch (ClassCastException cce ) {
- saxParser = null;
- abandonHope = true;
- debug.message(2, cce.toString());
- }
- } else {
- saxParser.startElement(name, atts);
- }
- }
-
- /**
- * The SAX2 <code>startElement</code> method.
- *
- * <p>The catalog parser is selected based on the namespace of the
- * first element encountered in the catalog.</p>
- */
- public void startElement (String namespaceURI,
- String localName,
- String qName,
- Attributes atts)
- throws SAXException {
-
- if (abandonHope) {
- return;
- }
-
- if (saxParser == null) {
- String saxParserClass = getCatalogParser(namespaceURI,
- localName);
-
- if (saxParserClass == null) {
- abandonHope = true;
- if (namespaceURI == null) {
- debug.message(2, "No Catalog parser for " + localName);
- } else {
- debug.message(2, "No Catalog parser for "
- + "{" + namespaceURI + "}"
- + localName);
- }
- return;
- }
-
- try {
- saxParser = (SAXCatalogParser)
- ReflectUtil.forName(saxParserClass).newInstance();
-
- saxParser.setCatalog(catalog);
- saxParser.startDocument();
- saxParser.startElement(namespaceURI, localName, qName, atts);
- } catch (ClassNotFoundException cnfe) {
- saxParser = null;
- abandonHope = true;
- debug.message(2, cnfe.toString());
- } catch (InstantiationException ie) {
- saxParser = null;
- abandonHope = true;
- debug.message(2, ie.toString());
- } catch (IllegalAccessException iae) {
- saxParser = null;
- abandonHope = true;
- debug.message(2, iae.toString());
- } catch (ClassCastException cce ) {
- saxParser = null;
- abandonHope = true;
- debug.message(2, cce.toString());
- }
- } else {
- saxParser.startElement(namespaceURI, localName, qName, atts);
- }
- }
-
- /** The SAX <code>endElement</code> method. Does nothing. */
- public void endElement (String name) throws SAXException {
- if (saxParser != null) {
- saxParser.endElement(name);
- }
- }
-
- /** The SAX2 <code>endElement</code> method. Does nothing. */
- public void endElement (String namespaceURI,
- String localName,
- String qName) throws SAXException {
- if (saxParser != null) {
- saxParser.endElement(namespaceURI, localName, qName);
- }
- }
-
- /** The SAX <code>characters</code> method. Does nothing. */
- public void characters (char ch[], int start, int length)
- throws SAXException {
- if (saxParser != null) {
- saxParser.characters(ch, start, length);
- }
- }
-
- /** The SAX <code>ignorableWhitespace</code> method. Does nothing. */
- public void ignorableWhitespace (char ch[], int start, int length)
- throws SAXException {
- if (saxParser != null) {
- saxParser.ignorableWhitespace(ch, start, length);
- }
- }
-
- /** The SAX <code>processingInstruction</code> method. Does nothing. */
- public void processingInstruction (String target, String data)
- throws SAXException {
- if (saxParser != null) {
- saxParser.processingInstruction(target, data);
- }
- }
-
- /** The SAX <code>startPrefixMapping</code> method. Does nothing. */
- public void startPrefixMapping (String prefix, String uri)
- throws SAXException {
- if (saxParser != null) {
- saxParser.startPrefixMapping (prefix, uri);
- }
- }
-
- /** The SAX <code>endPrefixMapping</code> method. Does nothing. */
- public void endPrefixMapping (String prefix)
- throws SAXException {
- if (saxParser != null) {
- saxParser.endPrefixMapping (prefix);
- }
- }
-
- /** The SAX <code>skippedentity</code> method. Does nothing. */
- public void skippedEntity (String name)
- throws SAXException {
- if (saxParser != null) {
- saxParser.skippedEntity(name);
- }
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/resolver/readers/SAXParserHandler.java b/src/com/sun/org/apache/xml/internal/resolver/readers/SAXParserHandler.java
deleted file mode 100644
index 0d07510..0000000
--- a/src/com/sun/org/apache/xml/internal/resolver/readers/SAXParserHandler.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-// SAXParserHandler.java - An entity-resolving DefaultHandler
-
-/*
- * Copyright 2001-2004 The Apache Software Foundation or its licensors,
- * as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xml.internal.resolver.readers;
-
-import java.io.IOException;
-
-import org.xml.sax.*;
-import org.xml.sax.helpers.*;
-
-/**
- * An entity-resolving DefaultHandler.
- *
- * <p>This class provides a SAXParser DefaultHandler that performs
- * entity resolution.
- * </p>
- *
- * @author Norman Walsh
- * <a href="mailto:Norman.Walsh@Sun.COM">Norman.Walsh@Sun.COM</a>
- */
-public class SAXParserHandler extends DefaultHandler {
- private EntityResolver er = null;
- private ContentHandler ch = null;
-
- public SAXParserHandler() {
- super();
- }
-
- public void setEntityResolver(EntityResolver er) {
- this.er = er;
- }
-
- public void setContentHandler(ContentHandler ch) {
- this.ch = ch;
- }
-
- // Entity Resolver
- public InputSource resolveEntity(String publicId, String systemId)
- throws SAXException {
-
- if (er != null) {
- try {
- return er.resolveEntity(publicId, systemId);
- } catch (IOException e) {
- System.out.println("resolveEntity threw IOException!");
- return null;
- }
- } else {
- return null;
- }
- }
-
- // Content Handler
- public void characters(char[] ch, int start, int length)
- throws SAXException {
- if (this.ch != null) {
- this.ch.characters(ch, start, length);
- }
- }
-
- public void endDocument()
- throws SAXException {
- if (ch != null) {
- ch.endDocument();
- }
- }
-
- public void endElement(String namespaceURI, String localName, String qName)
- throws SAXException {
- if (ch != null) {
- ch.endElement(namespaceURI, localName, qName);
- }
- }
-
- public void endPrefixMapping(String prefix)
- throws SAXException {
- if (ch != null) {
- ch.endPrefixMapping(prefix);
- }
- }
-
- public void ignorableWhitespace(char[] ch, int start, int length)
- throws SAXException {
- if (this.ch != null) {
- this.ch.ignorableWhitespace(ch, start, length);
- }
- }
-
- public void processingInstruction(String target, String data)
- throws SAXException {
- if (ch != null) {
- ch.processingInstruction(target, data);
- }
- }
-
- public void setDocumentLocator(Locator locator) {
- if (ch != null) {
- ch.setDocumentLocator(locator);
- }
- }
-
- public void skippedEntity(String name)
- throws SAXException {
- if (ch != null) {
- ch.skippedEntity(name);
- }
- }
-
- public void startDocument()
- throws SAXException {
- if (ch != null) {
- ch.startDocument();
- }
- }
-
- public void startElement(String namespaceURI, String localName,
- String qName, Attributes atts)
- throws SAXException {
- if (ch != null) {
- ch.startElement(namespaceURI, localName, qName, atts);
- }
- }
-
- public void startPrefixMapping(String prefix, String uri)
- throws SAXException {
- if (ch != null) {
- ch.startPrefixMapping(prefix, uri);
- }
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/resolver/readers/TR9401CatalogReader.java b/src/com/sun/org/apache/xml/internal/resolver/readers/TR9401CatalogReader.java
deleted file mode 100644
index b274810..0000000
--- a/src/com/sun/org/apache/xml/internal/resolver/readers/TR9401CatalogReader.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-// TR9401CatalogReader.java - Read OASIS Catalog files
-
-/*
- * Copyright 2001-2004 The Apache Software Foundation or its licensors,
- * as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xml.internal.resolver.readers;
-
-import java.io.InputStream;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.util.Vector;
-import com.sun.org.apache.xml.internal.resolver.Catalog;
-import com.sun.org.apache.xml.internal.resolver.CatalogEntry;
-import com.sun.org.apache.xml.internal.resolver.CatalogException;
-
-/**
- * Parses OASIS Open Catalog files.
- *
- * <p>This class reads OASIS Open Catalog files, returning a stream
- * of tokens.</p>
- *
- * <p>This code interrogates the following non-standard system properties:</p>
- *
- * <dl>
- * <dt><b>xml.catalog.debug</b></dt>
- * <dd><p>Sets the debug level. A value of 0 is assumed if the
- * property is not set or is not a number.</p></dd>
- * </dl>
- *
- * @see Catalog
- *
- * @author Norman Walsh
- * <a href="mailto:Norman.Walsh@Sun.COM">Norman.Walsh@Sun.COM</a>
- *
- */
-public class TR9401CatalogReader extends TextCatalogReader {
-
- /**
- * Start parsing an OASIS TR9401 Open Catalog file. The file is
- * actually read and parsed
- * as needed by <code>nextEntry</code>.
- *
- * <p>In a TR9401 Catalog the 'DELEGATE' entry delegates public
- * identifiers. There is no delegate entry for system identifiers
- * or URIs.</p>
- *
- * @param catalog The Catalog to populate
- * @param is The input stream from which to read the TR9401 Catalog
- *
- * @throws MalformedURLException Improper fileUrl
- * @throws IOException Error reading catalog file
- */
- public void readCatalog(Catalog catalog, InputStream is)
- throws MalformedURLException, IOException {
-
- catfile = is;
-
- if (catfile == null) {
- return;
- }
-
- Vector unknownEntry = null;
-
- try {
- while (true) {
- String token = nextToken();
-
- if (token == null) {
- if (unknownEntry != null) {
- catalog.unknownEntry(unknownEntry);
- unknownEntry = null;
- }
- catfile.close();
- catfile = null;
- return;
- }
-
- String entryToken = null;
- if (caseSensitive) {
- entryToken = token;
- } else {
- entryToken = token.toUpperCase();
- }
-
- if (entryToken.equals("DELEGATE")) {
- entryToken = "DELEGATE_PUBLIC";
- }
-
- try {
- int type = CatalogEntry.getEntryType(entryToken);
- int numArgs = CatalogEntry.getEntryArgCount(type);
- Vector args = new Vector();
-
- if (unknownEntry != null) {
- catalog.unknownEntry(unknownEntry);
- unknownEntry = null;
- }
-
- for (int count = 0; count < numArgs; count++) {
- args.addElement(nextToken());
- }
-
- catalog.addEntry(new CatalogEntry(entryToken, args));
- } catch (CatalogException cex) {
- if (cex.getExceptionType() == CatalogException.INVALID_ENTRY_TYPE) {
- if (unknownEntry == null) {
- unknownEntry = new Vector();
- }
- unknownEntry.addElement(token);
- } else if (cex.getExceptionType() == CatalogException.INVALID_ENTRY) {
- catalog.getCatalogManager().debug.message(1, "Invalid catalog entry", token);
- unknownEntry = null;
- } else if (cex.getExceptionType() == CatalogException.UNENDED_COMMENT) {
- catalog.getCatalogManager().debug.message(1, cex.getMessage());
- }
- }
- }
- } catch (CatalogException cex2) {
- if (cex2.getExceptionType() == CatalogException.UNENDED_COMMENT) {
- catalog.getCatalogManager().debug.message(1, cex2.getMessage());
- }
- }
-
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/resolver/readers/TextCatalogReader.java b/src/com/sun/org/apache/xml/internal/resolver/readers/TextCatalogReader.java
deleted file mode 100644
index 3493e48..0000000
--- a/src/com/sun/org/apache/xml/internal/resolver/readers/TextCatalogReader.java
+++ /dev/null
@@ -1,303 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-// TextCatalogReader.java - Read text/plain Catalog files
-
-/*
- * Copyright 2001-2004 The Apache Software Foundation or its licensors,
- * as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xml.internal.resolver.readers;
-
-import java.io.InputStream;
-import java.io.IOException;
-import java.io.FileNotFoundException;
-import java.net.URL;
-import java.net.URLConnection;
-import java.net.MalformedURLException;
-import java.util.Vector;
-import java.util.Stack;
-import com.sun.org.apache.xml.internal.resolver.Catalog;
-import com.sun.org.apache.xml.internal.resolver.CatalogEntry;
-import com.sun.org.apache.xml.internal.resolver.CatalogException;
-import com.sun.org.apache.xml.internal.resolver.readers.CatalogReader;
-
-/**
- * Parses plain text Catalog files.
- *
- * <p>This class reads plain text Open Catalog files.</p>
- *
- * @see Catalog
- *
- * @author Norman Walsh
- * <a href="mailto:Norman.Walsh@Sun.COM">Norman.Walsh@Sun.COM</a>
- *
- */
-public class TextCatalogReader implements CatalogReader {
- /** The input stream used to read the catalog */
- protected InputStream catfile = null;
-
- /**
- * Character lookahead stack. Reading a catalog sometimes requires
- * up to two characters of lookahead.
- */
- protected int[] stack = new int[3];
-
- /**
- * Token stack. Recognizing an unexpected catalog entry requires
- * the ability to "push back" a token.
- */
- protected Stack tokenStack = new Stack();
-
- /** The current position on the lookahead stack */
- protected int top = -1;
-
- /** Are keywords in the catalog case sensitive? */
- protected boolean caseSensitive = false;
-
- /**
- * Construct a CatalogReader object.
- */
- public TextCatalogReader() { }
-
- public void setCaseSensitive(boolean isCaseSensitive) {
- caseSensitive = isCaseSensitive;
- }
-
- public boolean getCaseSensitive() {
- return caseSensitive;
- }
-
- /**
- * Start parsing a text catalog file. The file is
- * actually read and parsed
- * as needed by <code>nextEntry</code>.</p>
- *
- * @param fileUrl The URL or filename of the catalog file to process
- *
- * @throws MalformedURLException Improper fileUrl
- * @throws IOException Error reading catalog file
- */
- public void readCatalog(Catalog catalog, String fileUrl)
- throws MalformedURLException, IOException {
- URL catURL = null;
-
- try {
- catURL = new URL(fileUrl);
- } catch (MalformedURLException e) {
- catURL = new URL("file:///" + fileUrl);
- }
-
- URLConnection urlCon = catURL.openConnection();
- try {
- readCatalog(catalog, urlCon.getInputStream());
- } catch (FileNotFoundException e) {
- catalog.getCatalogManager().debug.message(1, "Failed to load catalog, file not found",
- catURL.toString());
- }
- }
-
- public void readCatalog(Catalog catalog, InputStream is)
- throws MalformedURLException, IOException {
-
- catfile = is;
-
- if (catfile == null) {
- return;
- }
-
- Vector unknownEntry = null;
-
- try {
- while (true) {
- String token = nextToken();
-
- if (token == null) {
- if (unknownEntry != null) {
- catalog.unknownEntry(unknownEntry);
- unknownEntry = null;
- }
- catfile.close();
- catfile = null;
- return;
- }
-
- String entryToken = null;
- if (caseSensitive) {
- entryToken = token;
- } else {
- entryToken = token.toUpperCase();
- }
-
- try {
- int type = CatalogEntry.getEntryType(entryToken);
- int numArgs = CatalogEntry.getEntryArgCount(type);
- Vector args = new Vector();
-
- if (unknownEntry != null) {
- catalog.unknownEntry(unknownEntry);
- unknownEntry = null;
- }
-
- for (int count = 0; count < numArgs; count++) {
- args.addElement(nextToken());
- }
-
- catalog.addEntry(new CatalogEntry(entryToken, args));
- } catch (CatalogException cex) {
- if (cex.getExceptionType() == CatalogException.INVALID_ENTRY_TYPE) {
- if (unknownEntry == null) {
- unknownEntry = new Vector();
- }
- unknownEntry.addElement(token);
- } else if (cex.getExceptionType() == CatalogException.INVALID_ENTRY) {
- catalog.getCatalogManager().debug.message(1, "Invalid catalog entry", token);
- unknownEntry = null;
- } else if (cex.getExceptionType() == CatalogException.UNENDED_COMMENT) {
- catalog.getCatalogManager().debug.message(1, cex.getMessage());
- }
- }
- }
- } catch (CatalogException cex2) {
- if (cex2.getExceptionType() == CatalogException.UNENDED_COMMENT) {
- catalog.getCatalogManager().debug.message(1, cex2.getMessage());
- }
- }
- }
-
- /**
- * The destructor.
- *
- * <p>Makes sure the catalog file is closed.</p>
- */
- protected void finalize() {
- if (catfile != null) {
- try {
- catfile.close();
- } catch (IOException e) {
- // whatever...
- }
- }
- catfile = null;
- }
-
- // -----------------------------------------------------------------
-
- /**
- * Return the next token in the catalog file.
- *
- * <p>FYI: This code does not throw any sort of exception for
- * a file that contains an n
- *
- * @return The Catalog file token from the input stream.
- * @throws IOException If an error occurs reading from the stream.
- */
- protected String nextToken() throws IOException, CatalogException {
- String token = "";
- int ch, nextch;
-
- if (!tokenStack.empty()) {
- return (String) tokenStack.pop();
- }
-
- // Skip over leading whitespace and comments
- while (true) {
- // skip leading whitespace
- ch = catfile.read();
- while (ch <= ' ') { // all ctrls are whitespace
- ch = catfile.read();
- if (ch < 0) {
- return null;
- }
- }
-
- // now 'ch' is the current char from the file
- nextch = catfile.read();
- if (nextch < 0) {
- return null;
- }
-
- if (ch == '-' && nextch == '-') {
- // we've found a comment, skip it...
- ch = ' ';
- nextch = nextChar();
- while ((ch != '-' || nextch != '-') && nextch > 0) {
- ch = nextch;
- nextch = nextChar();
- }
-
- if (nextch < 0) {
- throw new CatalogException(CatalogException.UNENDED_COMMENT,
- "Unterminated comment in catalog file; EOF treated as end-of-comment.");
- }
-
- // Ok, we've found the end of the comment,
- // loop back to the top and start again...
- } else {
- stack[++top] = nextch;
- stack[++top] = ch;
- break;
- }
- }
-
- ch = nextChar();
- if (ch == '"' || ch == '\'') {
- int quote = ch;
- while ((ch = nextChar()) != quote) {
- char[] chararr = new char[1];
- chararr[0] = (char) ch;
- String s = new String(chararr);
- token = token.concat(s);
- }
- return token;
- } else {
- // return the next whitespace or comment delimited
- // string
- while (ch > ' ') {
- nextch = nextChar();
- if (ch == '-' && nextch == '-') {
- stack[++top] = ch;
- stack[++top] = nextch;
- return token;
- } else {
- char[] chararr = new char[1];
- chararr[0] = (char) ch;
- String s = new String(chararr);
- token = token.concat(s);
- ch = nextch;
- }
- }
- return token;
- }
- }
-
- /**
- * Return the next logical character from the input stream.
- *
- * @return The next (logical) character from the input stream. The
- * character may be buffered from a previous lookahead.
- *
- * @throws IOException If an error occurs reading from the stream.
- */
- protected int nextChar() throws IOException {
- if (top < 0) {
- return catfile.read();
- } else {
- return stack[top--];
- }
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/resolver/readers/XCatalogReader.java b/src/com/sun/org/apache/xml/internal/resolver/readers/XCatalogReader.java
deleted file mode 100644
index 3d94545..0000000
--- a/src/com/sun/org/apache/xml/internal/resolver/readers/XCatalogReader.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-// XCatalogReader.java - Read XML Catalog files
-
-/*
- * Copyright 2001-2004 The Apache Software Foundation or its licensors,
- * as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xml.internal.resolver.readers;
-
-import java.util.Vector;
-import com.sun.org.apache.xml.internal.resolver.Catalog;
-import com.sun.org.apache.xml.internal.resolver.CatalogEntry;
-import com.sun.org.apache.xml.internal.resolver.CatalogException;
-import com.sun.org.apache.xml.internal.resolver.helpers.PublicId;
-
-import org.xml.sax.*;
-
-import javax.xml.parsers.*;
-
-/**
- * Parse "xcatalog" XML Catalog files, this is the XML Catalog format
- * developed by John Cowan and supported by Apache.
- *
- * @see Catalog
- *
- * @author Norman Walsh
- * <a href="mailto:Norman.Walsh@Sun.COM">Norman.Walsh@Sun.COM</a>
- *
- */
-public class XCatalogReader extends SAXCatalogReader implements SAXCatalogParser {
- /** The catalog object needs to be stored by the object so that
- * SAX callbacks can use it.
- */
- protected Catalog catalog = null;
-
- /** Set the current catalog. */
- public void setCatalog (Catalog catalog) {
- this.catalog = catalog;
- }
-
- /** Get the current catalog. */
- public Catalog getCatalog () {
- return catalog;
- }
-
- /** The constructor */
- public XCatalogReader(SAXParserFactory parserFactory) {
- super(parserFactory);
- }
-
- // ----------------------------------------------------------------------
- // Implement the SAX DocumentHandler interface
-
- /** The SAX <code>setDocumentLocator</code> method does nothing. */
- public void setDocumentLocator (Locator locator) {
- return;
- }
-
- /** The SAX <code>startDocument</code> method does nothing. */
- public void startDocument ()
- throws SAXException {
- return;
- }
-
- /** The SAX <code>endDocument</code> method does nothing. */
- public void endDocument ()
- throws SAXException {
- return;
- }
-
- /**
- * The SAX <code>startElement</code> method recognizes elements
- * from the plain catalog format and instantiates CatalogEntry
- * objects for them.
- *
- * @param namespaceURI The namespace name of the element.
- * @param localName The local name of the element.
- * @param qName The QName of the element.
- * @param atts The list of attributes on the element.
- *
- * @see CatalogEntry
- */
- public void startElement (String namespaceURI,
- String localName,
- String qName,
- Attributes atts)
- throws SAXException {
-
- int entryType = -1;
- Vector entryArgs = new Vector();
-
- if (localName.equals("Base")) {
- entryType = catalog.BASE;
- entryArgs.add(atts.getValue("HRef"));
-
- catalog.getCatalogManager().debug.message(4, "Base", atts.getValue("HRef"));
- } else if (localName.equals("Delegate")) {
- entryType = catalog.DELEGATE_PUBLIC;
- entryArgs.add(atts.getValue("PublicId"));
- entryArgs.add(atts.getValue("HRef"));
-
- catalog.getCatalogManager().debug.message(4, "Delegate",
- PublicId.normalize(atts.getValue("PublicId")),
- atts.getValue("HRef"));
- } else if (localName.equals("Extend")) {
- entryType = catalog.CATALOG;
- entryArgs.add(atts.getValue("HRef"));
-
- catalog.getCatalogManager().debug.message(4, "Extend", atts.getValue("HRef"));
- } else if (localName.equals("Map")) {
- entryType = catalog.PUBLIC;
- entryArgs.add(atts.getValue("PublicId"));
- entryArgs.add(atts.getValue("HRef"));
-
- catalog.getCatalogManager().debug.message(4, "Map",
- PublicId.normalize(atts.getValue("PublicId")),
- atts.getValue("HRef"));
- } else if (localName.equals("Remap")) {
- entryType = catalog.SYSTEM;
- entryArgs.add(atts.getValue("SystemId"));
- entryArgs.add(atts.getValue("HRef"));
-
- catalog.getCatalogManager().debug.message(4, "Remap",
- atts.getValue("SystemId"),
- atts.getValue("HRef"));
- } else if (localName.equals("XMLCatalog")) {
- // nop, start of catalog
- } else {
- // This is equivalent to an invalid catalog entry type
- catalog.getCatalogManager().debug.message(1, "Invalid catalog entry type", localName);
- }
-
- if (entryType >= 0) {
- try {
- CatalogEntry ce = new CatalogEntry(entryType, entryArgs);
- catalog.addEntry(ce);
- } catch (CatalogException cex) {
- if (cex.getExceptionType() == CatalogException.INVALID_ENTRY_TYPE) {
- catalog.getCatalogManager().debug.message(1, "Invalid catalog entry type", localName);
- } else if (cex.getExceptionType() == CatalogException.INVALID_ENTRY) {
- catalog.getCatalogManager().debug.message(1, "Invalid catalog entry", localName);
- }
- }
- }
- }
-
- /** The SAX <code>endElement</code> method does nothing. */
- public void endElement (String namespaceURI,
- String localName,
- String qName)
- throws SAXException {
- return;
- }
-
- /** The SAX <code>characters</code> method does nothing. */
- public void characters (char ch[], int start, int length)
- throws SAXException {
- return;
- }
-
- /** The SAX <code>ignorableWhitespace</code> method does nothing. */
- public void ignorableWhitespace (char ch[], int start, int length)
- throws SAXException {
- return;
- }
-
- /** The SAX <code>processingInstruction</code> method does nothing. */
- public void processingInstruction (String target, String data)
- throws SAXException {
- return;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/resolver/tools/CatalogResolver.java b/src/com/sun/org/apache/xml/internal/resolver/tools/CatalogResolver.java
deleted file mode 100644
index 25951aa..0000000
--- a/src/com/sun/org/apache/xml/internal/resolver/tools/CatalogResolver.java
+++ /dev/null
@@ -1,343 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-// CatalogResolver.java - A SAX EntityResolver/JAXP URI Resolver
-
-/*
- * Copyright 2001-2004 The Apache Software Foundation or its licensors,
- * as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xml.internal.resolver.tools;
-
-import com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.net.MalformedURLException;
-
-import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.InputSource;
-import org.xml.sax.EntityResolver;
-
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.transform.Source;
-import javax.xml.transform.URIResolver;
-import javax.xml.transform.TransformerException;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParserFactory;
-
-import com.sun.org.apache.xml.internal.resolver.Catalog;
-import com.sun.org.apache.xml.internal.resolver.CatalogManager;
-import com.sun.org.apache.xml.internal.resolver.helpers.FileURL;
-
-/**
- * A SAX EntityResolver/JAXP URIResolver that uses catalogs.
- *
- * <p>This class implements both a SAX EntityResolver and a JAXP URIResolver.
- * </p>
- *
- * <p>This resolver understands OASIS TR9401 catalogs, XCatalogs, and the
- * current working draft of the OASIS Entity Resolution Technical
- * Committee specification.</p>
- *
- * @see Catalog
- * @see org.xml.sax.EntityResolver
- * @see javax.xml.transform.URIResolver
- *
- * @author Norman Walsh
- * <a href="mailto:Norman.Walsh@Sun.COM">Norman.Walsh@Sun.COM</a>
- *
- * @version 1.0
- */
-public class CatalogResolver implements EntityResolver, URIResolver {
- /** Make the parser Namespace aware? */
- public boolean namespaceAware = true;
-
- /** Make the parser validating? */
- public boolean validating = false;
-
- /** The underlying catalog */
- private Catalog catalog = null;
-
- /** The catalog manager */
- private CatalogManager catalogManager = CatalogManager.getStaticManager();
-
- /** Constructor */
- public CatalogResolver() {
- initializeCatalogs(false);
- }
-
- /** Constructor */
- public CatalogResolver(boolean privateCatalog) {
- initializeCatalogs(privateCatalog);
- }
-
- /** Constructor */
- public CatalogResolver(CatalogManager manager) {
- catalogManager = manager;
- initializeCatalogs(!catalogManager.getUseStaticCatalog());
- }
-
- /** Initialize catalog */
- private void initializeCatalogs(boolean privateCatalog) {
- catalog = catalogManager.getCatalog();
- }
-
- /** Return the underlying catalog */
- public Catalog getCatalog() {
- return catalog;
- }
-
- /**
- * Implements the guts of the <code>resolveEntity</code> method
- * for the SAX interface.
- *
- * <p>Presented with an optional public identifier and a system
- * identifier, this function attempts to locate a mapping in the
- * catalogs.</p>
- *
- * <p>If such a mapping is found, it is returned. If no mapping is
- * found, null is returned.</p>
- *
- * @param publicId The public identifier for the entity in question.
- * This may be null.
- *
- * @param systemId The system identifier for the entity in question.
- * XML requires a system identifier on all external entities, so this
- * value is always specified.
- *
- * @return The resolved identifier (a URI reference).
- */
- public String getResolvedEntity (String publicId, String systemId) {
- String resolved = null;
-
- if (catalog == null) {
- catalogManager.debug.message(1, "Catalog resolution attempted with null catalog; ignored");
- return null;
- }
-
- if (systemId != null) {
- try {
- resolved = catalog.resolveSystem(systemId);
- } catch (MalformedURLException me) {
- catalogManager.debug.message(1, "Malformed URL exception trying to resolve",
- publicId);
- resolved = null;
- } catch (IOException ie) {
- catalogManager.debug.message(1, "I/O exception trying to resolve", publicId);
- resolved = null;
- }
- }
-
- if (resolved == null) {
- if (publicId != null) {
- try {
- resolved = catalog.resolvePublic(publicId, systemId);
- } catch (MalformedURLException me) {
- catalogManager.debug.message(1, "Malformed URL exception trying to resolve",
- publicId);
- } catch (IOException ie) {
- catalogManager.debug.message(1, "I/O exception trying to resolve", publicId);
- }
- }
-
- if (resolved != null) {
- catalogManager.debug.message(2, "Resolved public", publicId, resolved);
- }
- } else {
- catalogManager.debug.message(2, "Resolved system", systemId, resolved);
- }
-
- return resolved;
- }
-
- /**
- * Implements the <code>resolveEntity</code> method
- * for the SAX interface.
- *
- * <p>Presented with an optional public identifier and a system
- * identifier, this function attempts to locate a mapping in the
- * catalogs.</p>
- *
- * <p>If such a mapping is found, the resolver attempts to open
- * the mapped value as an InputSource and return it. Exceptions are
- * ignored and null is returned if the mapped value cannot be opened
- * as an input source.</p>
- *
- * <p>If no mapping is found (or an error occurs attempting to open
- * the mapped value as an input source), null is returned and the system
- * will use the specified system identifier as if no entityResolver
- * was specified.</p>
- *
- * @param publicId The public identifier for the entity in question.
- * This may be null.
- *
- * @param systemId The system identifier for the entity in question.
- * XML requires a system identifier on all external entities, so this
- * value is always specified.
- *
- * @return An InputSource for the mapped identifier, or null.
- */
- public InputSource resolveEntity (String publicId, String systemId) {
- String resolved = getResolvedEntity(publicId, systemId);
-
- if (resolved != null) {
- try {
- InputSource iSource = new InputSource(resolved);
- iSource.setPublicId(publicId);
-
- // Ideally this method would not attempt to open the
- // InputStream, but there is a bug (in Xerces, at least)
- // that causes the parser to mistakenly open the wrong
- // system identifier if the returned InputSource does
- // not have a byteStream.
- //
- // It could be argued that we still shouldn't do this here,
- // but since the purpose of calling the entityResolver is
- // almost certainly to open the input stream, it seems to
- // do little harm.
- //
- URL url = new URL(resolved);
- InputStream iStream = url.openStream();
- iSource.setByteStream(iStream);
-
- return iSource;
- } catch (Exception e) {
- catalogManager.debug.message(1, "Failed to create InputSource", resolved);
- return null;
- }
- }
-
- return null;
- }
-
- /** JAXP URIResolver API */
- public Source resolve(String href, String base)
- throws TransformerException {
-
- String uri = href;
- String fragment = null;
- int hashPos = href.indexOf("#");
- if (hashPos >= 0) {
- uri = href.substring(0, hashPos);
- fragment = href.substring(hashPos+1);
- }
-
- String result = null;
-
- try {
- result = catalog.resolveURI(href);
- } catch (Exception e) {
- // nop;
- }
-
- if (result == null) {
- try {
- URL url = null;
-
- if (base==null) {
- url = new URL(uri);
- result = url.toString();
- } else {
- URL baseURL = new URL(base);
- url = (href.length()==0 ? baseURL : new URL(baseURL, uri));
- result = url.toString();
- }
- } catch (java.net.MalformedURLException mue) {
- // try to make an absolute URI from the current base
- String absBase = makeAbsolute(base);
- if (!absBase.equals(base)) {
- // don't bother if the absBase isn't different!
- return resolve(href, absBase);
- } else {
- throw new TransformerException("Malformed URL "
- + href + "(base " + base + ")",
- mue);
- }
- }
- }
-
- catalogManager.debug.message(2, "Resolved URI", href, result);
-
- SAXSource source = new SAXSource();
- source.setInputSource(new InputSource(result));
- setEntityResolver(source);
- return source;
- }
-
- /**
- * <p>Establish an entityResolver for newly resolved URIs.</p>
- *
- * <p>This is called from the URIResolver to set an EntityResolver
- * on the SAX parser to be used for new XML documents that are
- * encountered as a result of the document() function, xsl:import,
- * or xsl:include. This is done because the XSLT processor calls
- * out to the SAXParserFactory itself to create a new SAXParser to
- * parse the new document. The new parser does not automatically
- * inherit the EntityResolver of the original (although arguably
- * it should). See below:</p>
- *
- * <tt>"If an application wants to set the ErrorHandler or
- * EntityResolver for an XMLReader used during a transformation,
- * it should use a URIResolver to return the SAXSource which
- * provides (with getXMLReader) a reference to the XMLReader"</tt>
- *
- * <p>...quoted from page 118 of the Java API for XML
- * Processing 1.1 specification</p>
- *
- */
- private void setEntityResolver(SAXSource source) throws TransformerException {
- XMLReader reader = source.getXMLReader();
- if (reader == null) {
- SAXParserFactory spFactory = catalogManager.useServicesMechanism() ?
- SAXParserFactory.newInstance() : new SAXParserFactoryImpl();
- spFactory.setNamespaceAware(true);
- try {
- reader = spFactory.newSAXParser().getXMLReader();
- }
- catch (ParserConfigurationException ex) {
- throw new TransformerException(ex);
- }
- catch (SAXException ex) {
- throw new TransformerException(ex);
- }
- }
- reader.setEntityResolver(this);
- source.setXMLReader(reader);
- }
-
- /** Attempt to construct an absolute URI */
- private String makeAbsolute(String uri) {
- if (uri == null) {
- uri = "";
- }
-
- try {
- URL url = new URL(uri);
- return url.toString();
- } catch (MalformedURLException mue) {
- try {
- URL fileURL = FileURL.makeURL(uri);
- return fileURL.toString();
- } catch (MalformedURLException mue2) {
- // bail
- return uri;
- }
- }
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/resolver/tools/ResolvingParser.java b/src/com/sun/org/apache/xml/internal/resolver/tools/ResolvingParser.java
deleted file mode 100644
index 0d90d57..0000000
--- a/src/com/sun/org/apache/xml/internal/resolver/tools/ResolvingParser.java
+++ /dev/null
@@ -1,446 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-// ResolvingParser.java - An interface for reading catalog files
-
-/*
- * Copyright 2001-2004 The Apache Software Foundation or its licensors,
- * as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xml.internal.resolver.tools;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.net.MalformedURLException;
-import java.util.Locale;
-
-import org.xml.sax.Parser;
-import org.xml.sax.InputSource;
-import org.xml.sax.Locator;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.DTDHandler;
-import org.xml.sax.DocumentHandler;
-import org.xml.sax.AttributeList;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.SAXException;
-
-import javax.xml.parsers.SAXParserFactory;
-import javax.xml.parsers.SAXParser;
-
-import com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl;
-import com.sun.org.apache.xml.internal.resolver.Catalog;
-import com.sun.org.apache.xml.internal.resolver.CatalogManager;
-import com.sun.org.apache.xml.internal.resolver.helpers.FileURL;
-
-/**
- * A SAX Parser that performs catalog-based entity resolution.
- *
- * <p>This class implements a SAX Parser that performs entity resolution
- * using the CatalogResolver. The actual, underlying parser is obtained
- * from a SAXParserFactory.</p>
- * </p>
- *
- * @deprecated This interface has been replaced by the
- * {@link com.sun.org.apache.xml.internal.resolver.tools.ResolvingXMLReader} for SAX2.
- * @see CatalogResolver
- * @see org.xml.sax.Parser
- *
- * @author Norman Walsh
- * <a href="mailto:Norman.Walsh@Sun.COM">Norman.Walsh@Sun.COM</a>
- *
- * @version 1.0
- */
-public class ResolvingParser
- implements Parser, DTDHandler, DocumentHandler, EntityResolver {
- /** Make the parser Namespace aware? */
- public static boolean namespaceAware = true;
-
- /** Make the parser validating? */
- public static boolean validating = false;
-
- /** Suppress explanatory message?
- *
- * @see #parse(InputSource)
- */
- public static boolean suppressExplanation = false;
-
- /** The underlying parser. */
- private SAXParser saxParser = null;
-
- /** The underlying reader. */
- private Parser parser = null;
-
- /** The underlying DocumentHandler. */
- private DocumentHandler documentHandler = null;
-
- /** The underlying DTDHandler. */
- private DTDHandler dtdHandler = null;
-
- /** The manager for the underlying resolver. */
- private CatalogManager catalogManager = CatalogManager.getStaticManager();
-
- /** The underlying catalog resolver. */
- private CatalogResolver catalogResolver = null;
-
- /** A separate resolver for oasis-xml-pi catalogs. */
- private CatalogResolver piCatalogResolver = null;
-
- /** Are we in the prolog? Is an oasis-xml-catalog PI valid now? */
- private boolean allowXMLCatalogPI = false;
-
- /** Has an oasis-xml-catalog PI been seen? */
- private boolean oasisXMLCatalogPI = false;
-
- /** The base URI of the input document, if known. */
- private URL baseURL = null;
-
- /** Constructor. */
- public ResolvingParser() {
- initParser();
- }
-
- /** Constructor. */
- public ResolvingParser(CatalogManager manager) {
- catalogManager = manager;
- initParser();
- }
-
- /** Initialize the parser. */
- private void initParser() {
- catalogResolver = new CatalogResolver(catalogManager);
- SAXParserFactory spf = catalogManager.useServicesMechanism() ?
- SAXParserFactory.newInstance() : new SAXParserFactoryImpl();
- spf.setNamespaceAware(namespaceAware);
- spf.setValidating(validating);
-
- try {
- saxParser = spf.newSAXParser();
- parser = saxParser.getParser();
- documentHandler = null;
- dtdHandler = null;
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- /** Return the Catalog being used. */
- public Catalog getCatalog() {
- return catalogResolver.getCatalog();
- }
-
- /**
- * SAX Parser API.
- *
- * <p>Note that the JAXP 1.1ea2 parser crashes with an InternalError if
- * it encounters a system identifier that appears to be a relative URI
- * that begins with a slash. For example, the declaration:</p>
- *
- * <pre>
- * &lt;!DOCTYPE book SYSTEM "/path/to/dtd/on/my/system/docbookx.dtd">
- * </pre>
- *
- * <p>would cause such an error. As a convenience, this method catches
- * that error and prints an explanation. (Unfortunately, it's not possible
- * to identify the particular system identifier that causes the problem.)
- * </p>
- *
- * <p>The underlying error is forwarded after printing the explanatory
- * message. The message is only every printed once and if
- * <code>suppressExplanation</code> is set to <code>false</code> before
- * parsing, it will never be printed.</p>
- */
- public void parse(InputSource input)
- throws IOException,
- SAXException {
- setupParse(input.getSystemId());
- try {
- parser.parse(input);
- } catch (InternalError ie) {
- explain(input.getSystemId());
- throw ie;
- }
- }
-
- /** SAX Parser API.
- *
- * @see #parse(InputSource)
- */
- public void parse(String systemId)
- throws IOException,
- SAXException {
- setupParse(systemId);
- try {
- parser.parse(systemId);
- } catch (InternalError ie) {
- explain(systemId);
- throw ie;
- }
- }
-
- /** SAX Parser API. */
- public void setDocumentHandler(DocumentHandler handler) {
- documentHandler = handler;
- }
-
- /** SAX Parser API. */
- public void setDTDHandler(DTDHandler handler) {
- dtdHandler = handler;
- }
-
- /**
- * SAX Parser API.
- *
- * <p>The purpose of this class is to implement an entity resolver.
- * Attempting to set a different one is pointless (and ignored).</p>
- */
- public void setEntityResolver(EntityResolver resolver) {
- // nop
- }
-
- /** SAX Parser API. */
- public void setErrorHandler(ErrorHandler handler) {
- parser.setErrorHandler(handler);
- }
-
- /** SAX Parser API. */
- public void setLocale(Locale locale) throws SAXException {
- parser.setLocale(locale);
- }
-
- /** SAX DocumentHandler API. */
- public void characters(char[] ch, int start, int length)
- throws SAXException {
- if (documentHandler != null) {
- documentHandler.characters(ch,start,length);
- }
- }
-
- /** SAX DocumentHandler API. */
- public void endDocument() throws SAXException {
- if (documentHandler != null) {
- documentHandler.endDocument();
- }
- }
-
- /** SAX DocumentHandler API. */
- public void endElement(String name) throws SAXException {
- if (documentHandler != null) {
- documentHandler.endElement(name);
- }
- }
-
- /** SAX DocumentHandler API. */
- public void ignorableWhitespace(char[] ch, int start, int length)
- throws SAXException {
- if (documentHandler != null) {
- documentHandler.ignorableWhitespace(ch,start,length);
- }
- }
-
- /** SAX DocumentHandler API. */
- public void processingInstruction(String target, String pidata)
- throws SAXException {
-
- if (target.equals("oasis-xml-catalog")) {
- URL catalog = null;
- String data = pidata;
-
- int pos = data.indexOf("catalog=");
- if (pos >= 0) {
- data = data.substring(pos+8);
- if (data.length() > 1) {
- String quote = data.substring(0,1);
- data = data.substring(1);
- pos = data.indexOf(quote);
- if (pos >= 0) {
- data = data.substring(0, pos);
- try {
- if (baseURL != null) {
- catalog = new URL(baseURL, data);
- } else {
- catalog = new URL(data);
- }
- } catch (MalformedURLException mue) {
- // nevermind
- }
- }
- }
- }
-
- if (allowXMLCatalogPI) {
- if (catalogManager.getAllowOasisXMLCatalogPI()) {
- catalogManager.debug.message(4,"oasis-xml-catalog PI", pidata);
-
- if (catalog != null) {
- try {
- catalogManager.debug.message(4,"oasis-xml-catalog", catalog.toString());
- oasisXMLCatalogPI = true;
-
- if (piCatalogResolver == null) {
- piCatalogResolver = new CatalogResolver(true);
- }
-
- piCatalogResolver.getCatalog().parseCatalog(catalog.toString());
- } catch (Exception e) {
- catalogManager.debug.message(3, "Exception parsing oasis-xml-catalog: "
- + catalog.toString());
- }
- } else {
- catalogManager.debug.message(3, "PI oasis-xml-catalog unparseable: " + pidata);
- }
- } else {
- catalogManager.debug.message(4,"PI oasis-xml-catalog ignored: " + pidata);
- }
- } else {
- catalogManager.debug.message(3, "PI oasis-xml-catalog occurred in an invalid place: "
- + pidata);
- }
- } else {
- if (documentHandler != null) {
- documentHandler.processingInstruction(target, pidata);
- }
- }
- }
-
- /** SAX DocumentHandler API. */
- public void setDocumentLocator(Locator locator) {
- if (documentHandler != null) {
- documentHandler.setDocumentLocator(locator);
- }
- }
-
- /** SAX DocumentHandler API. */
- public void startDocument() throws SAXException {
- if (documentHandler != null) {
- documentHandler.startDocument();
- }
- }
-
- /** SAX DocumentHandler API. */
- public void startElement(String name, AttributeList atts)
- throws SAXException {
- allowXMLCatalogPI = false;
- if (documentHandler != null) {
- documentHandler.startElement(name,atts);
- }
- }
-
- /** SAX DTDHandler API. */
- public void notationDecl (String name, String publicId, String systemId)
- throws SAXException {
- allowXMLCatalogPI = false;
- if (dtdHandler != null) {
- dtdHandler.notationDecl(name,publicId,systemId);
- }
- }
-
- /** SAX DTDHandler API. */
- public void unparsedEntityDecl (String name,
- String publicId,
- String systemId,
- String notationName)
- throws SAXException {
- allowXMLCatalogPI = false;
- if (dtdHandler != null) {
- dtdHandler.unparsedEntityDecl (name, publicId, systemId, notationName);
- }
- }
-
- /**
- * Implements the <code>resolveEntity</code> method
- * for the SAX interface, using an underlying CatalogResolver
- * to do the real work.
- */
- public InputSource resolveEntity (String publicId, String systemId) {
- allowXMLCatalogPI = false;
- String resolved = catalogResolver.getResolvedEntity(publicId, systemId);
-
- if (resolved == null && piCatalogResolver != null) {
- resolved = piCatalogResolver.getResolvedEntity(publicId, systemId);
- }
-
- if (resolved != null) {
- try {
- InputSource iSource = new InputSource(resolved);
- iSource.setPublicId(publicId);
-
- // Ideally this method would not attempt to open the
- // InputStream, but there is a bug (in Xerces, at least)
- // that causes the parser to mistakenly open the wrong
- // system identifier if the returned InputSource does
- // not have a byteStream.
- //
- // It could be argued that we still shouldn't do this here,
- // but since the purpose of calling the entityResolver is
- // almost certainly to open the input stream, it seems to
- // do little harm.
- //
- URL url = new URL(resolved);
- InputStream iStream = url.openStream();
- iSource.setByteStream(iStream);
-
- return iSource;
- } catch (Exception e) {
- catalogManager.debug.message(1, "Failed to create InputSource", resolved);
- return null;
- }
- } else {
- return null;
- }
- }
-
- /** Setup for parsing. */
- private void setupParse(String systemId) {
- allowXMLCatalogPI = true;
- parser.setEntityResolver(this);
- parser.setDocumentHandler(this);
- parser.setDTDHandler(this);
-
- URL cwd = null;
-
- try {
- cwd = FileURL.makeURL("basename");
- } catch (MalformedURLException mue) {
- cwd = null;
- }
-
- try {
- baseURL = new URL(systemId);
- } catch (MalformedURLException mue) {
- if (cwd != null) {
- try {
- baseURL = new URL(cwd, systemId);
- } catch (MalformedURLException mue2) {
- // give up
- baseURL = null;
- }
- } else {
- // give up
- baseURL = null;
- }
- }
- }
-
- /** Provide one possible explanation for an InternalError. */
- private void explain(String systemId) {
- if (!suppressExplanation) {
- System.out.println("Parser probably encountered bad URI in " + systemId);
- System.out.println("For example, replace '/some/uri' with 'file:/some/uri'.");
- }
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/resolver/tools/ResolvingXMLFilter.java b/src/com/sun/org/apache/xml/internal/resolver/tools/ResolvingXMLFilter.java
deleted file mode 100644
index 660e4af..0000000
--- a/src/com/sun/org/apache/xml/internal/resolver/tools/ResolvingXMLFilter.java
+++ /dev/null
@@ -1,353 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-// ResolvingXMLFilter.java - An XMLFilter that performs catalog resolution
-
-/*
- * Copyright 2001-2004 The Apache Software Foundation or its licensors,
- * as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xml.internal.resolver.tools;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.Attributes;
-import org.xml.sax.helpers.XMLFilterImpl;
-
-import com.sun.org.apache.xml.internal.resolver.Catalog;
-import com.sun.org.apache.xml.internal.resolver.CatalogManager;
-
-import com.sun.org.apache.xml.internal.resolver.helpers.FileURL;
-
-/**
- * A SAX XMLFilter that performs catalog-based entity resolution.
- *
- * <p>This class implements a SAX XMLFilter that performs entity resolution
- * using the CatalogResolver. The actual, underlying parser is obtained
- * from a SAXParserFactory.</p>
- * </p>
- *
- * @see CatalogResolver
- * @see org.xml.sax.XMLFilter
- *
- * @author Norman Walsh
- * <a href="mailto:Norman.Walsh@Sun.COM">Norman.Walsh@Sun.COM</a>
- *
- * @version 1.0
- */
-public class ResolvingXMLFilter extends XMLFilterImpl {
- /**
- * Suppress explanatory message?
- *
- * @see #parse(InputSource)
- */
- public static boolean suppressExplanation = false;
-
- /** The manager for the underlying resolver. */
- CatalogManager catalogManager = CatalogManager.getStaticManager();
-
- /** The underlying catalog resolver. */
- private CatalogResolver catalogResolver = null;
-
- /** A separate resolver for oasis-xml-pi catalogs. */
- private CatalogResolver piCatalogResolver = null;
-
- /** Are we in the prolog? Is an oasis-xml-catalog PI valid now? */
- private boolean allowXMLCatalogPI = false;
-
- /** Has an oasis-xml-catalog PI been seen? */
- private boolean oasisXMLCatalogPI = false;
-
- /** The base URI of the input document, if known. */
- private URL baseURL = null;
-
- /** Construct an empty XML Filter with no parent. */
- public ResolvingXMLFilter() {
- super();
- catalogResolver = new CatalogResolver(catalogManager);
- }
-
- /** Construct an XML filter with the specified parent. */
- public ResolvingXMLFilter(XMLReader parent) {
- super(parent);
- catalogResolver = new CatalogResolver(catalogManager);
- }
-
- /** Construct an XML filter with the specified parent. */
- public ResolvingXMLFilter(CatalogManager manager) {
- super();
- catalogManager = manager;
- catalogResolver = new CatalogResolver(catalogManager);
- }
-
- /** Construct an XML filter with the specified parent. */
- public ResolvingXMLFilter(XMLReader parent, CatalogManager manager) {
- super(parent);
- catalogManager = manager;
- catalogResolver = new CatalogResolver(catalogManager);
- }
-
- /**
- * Provide accessto the underlying Catalog.
- */
- public Catalog getCatalog() {
- return catalogResolver.getCatalog();
- }
-
- /**
- * SAX XMLReader API.
- *
- * <p>Note that the JAXP 1.1ea2 parser crashes with an InternalError if
- * it encounters a system identifier that appears to be a relative URI
- * that begins with a slash. For example, the declaration:</p>
- *
- * <pre>
- * &lt;!DOCTYPE book SYSTEM "/path/to/dtd/on/my/system/docbookx.dtd">
- * </pre>
- *
- * <p>would cause such an error. As a convenience, this method catches
- * that error and prints an explanation. (Unfortunately, it's not possible
- * to identify the particular system identifier that causes the problem.)
- * </p>
- *
- * <p>The underlying error is forwarded after printing the explanatory
- * message. The message is only every printed once and if
- * <code>suppressExplanation</code> is set to <code>false</code> before
- * parsing, it will never be printed.</p>
- */
- public void parse(InputSource input)
- throws IOException, SAXException {
- allowXMLCatalogPI = true;
-
- setupBaseURI(input.getSystemId());
-
- try {
- super.parse(input);
- } catch (InternalError ie) {
- explain(input.getSystemId());
- throw ie;
- }
- }
-
- /** SAX XMLReader API.
- *
- * @see #parse(InputSource)
- */
- public void parse(String systemId)
- throws IOException, SAXException {
- allowXMLCatalogPI = true;
-
- setupBaseURI(systemId);
-
- try {
- super.parse(systemId);
- } catch (InternalError ie) {
- explain(systemId);
- throw ie;
- }
- }
-
- /**
- * Implements the <code>resolveEntity</code> method
- * for the SAX interface, using an underlying CatalogResolver
- * to do the real work.
- */
- public InputSource resolveEntity (String publicId, String systemId) {
- allowXMLCatalogPI = false;
- String resolved = catalogResolver.getResolvedEntity(publicId, systemId);
-
- if (resolved == null && piCatalogResolver != null) {
- resolved = piCatalogResolver.getResolvedEntity(publicId, systemId);
- }
-
- if (resolved != null) {
- try {
- InputSource iSource = new InputSource(resolved);
- iSource.setPublicId(publicId);
-
- // Ideally this method would not attempt to open the
- // InputStream, but there is a bug (in Xerces, at least)
- // that causes the parser to mistakenly open the wrong
- // system identifier if the returned InputSource does
- // not have a byteStream.
- //
- // It could be argued that we still shouldn't do this here,
- // but since the purpose of calling the entityResolver is
- // almost certainly to open the input stream, it seems to
- // do little harm.
- //
- URL url = new URL(resolved);
- InputStream iStream = url.openStream();
- iSource.setByteStream(iStream);
-
- return iSource;
- } catch (Exception e) {
- catalogManager.debug.message(1, "Failed to create InputSource", resolved);
- return null;
- }
- } else {
- return null;
- }
- }
-
- /** SAX DTDHandler API.
- *
- * <p>Captured here only to detect the end of the prolog so that
- * we can ignore subsequent oasis-xml-catalog PIs. Otherwise
- * the events are just passed through.</p>
- */
- public void notationDecl (String name, String publicId, String systemId)
- throws SAXException {
- allowXMLCatalogPI = false;
- super.notationDecl(name,publicId,systemId);
- }
-
- /** SAX DTDHandler API.
- *
- * <p>Captured here only to detect the end of the prolog so that
- * we can ignore subsequent oasis-xml-catalog PIs. Otherwise
- * the events are just passed through.</p>
- */
- public void unparsedEntityDecl (String name,
- String publicId,
- String systemId,
- String notationName)
- throws SAXException {
- allowXMLCatalogPI = false;
- super.unparsedEntityDecl (name, publicId, systemId, notationName);
- }
-
- /** SAX ContentHandler API.
- *
- * <p>Captured here only to detect the end of the prolog so that
- * we can ignore subsequent oasis-xml-catalog PIs. Otherwise
- * the events are just passed through.</p>
- */
- public void startElement (String uri, String localName, String qName,
- Attributes atts)
- throws SAXException {
- allowXMLCatalogPI = false;
- super.startElement(uri,localName,qName,atts);
- }
-
- /** SAX ContentHandler API.
- *
- * <p>Detect and use the oasis-xml-catalog PI if it occurs.</p>
- */
- public void processingInstruction(String target, String pidata)
- throws SAXException {
- if (target.equals("oasis-xml-catalog")) {
- URL catalog = null;
- String data = pidata;
-
- int pos = data.indexOf("catalog=");
- if (pos >= 0) {
- data = data.substring(pos+8);
- if (data.length() > 1) {
- String quote = data.substring(0,1);
- data = data.substring(1);
- pos = data.indexOf(quote);
- if (pos >= 0) {
- data = data.substring(0, pos);
- try {
- if (baseURL != null) {
- catalog = new URL(baseURL, data);
- } else {
- catalog = new URL(data);
- }
- } catch (MalformedURLException mue) {
- // nevermind
- }
- }
- }
- }
-
- if (allowXMLCatalogPI) {
- if (catalogManager.getAllowOasisXMLCatalogPI()) {
- catalogManager.debug.message(4,"oasis-xml-catalog PI", pidata);
-
- if (catalog != null) {
- try {
- catalogManager.debug.message(4,"oasis-xml-catalog", catalog.toString());
- oasisXMLCatalogPI = true;
-
- if (piCatalogResolver == null) {
- piCatalogResolver = new CatalogResolver(true);
- }
-
- piCatalogResolver.getCatalog().parseCatalog(catalog.toString());
- } catch (Exception e) {
- catalogManager.debug.message(3, "Exception parsing oasis-xml-catalog: "
- + catalog.toString());
- }
- } else {
- catalogManager.debug.message(3, "PI oasis-xml-catalog unparseable: " + pidata);
- }
- } else {
- catalogManager.debug.message(4,"PI oasis-xml-catalog ignored: " + pidata);
- }
- } else {
- catalogManager.debug.message(3, "PI oasis-xml-catalog occurred in an invalid place: "
- + pidata);
- }
- } else {
- super.processingInstruction(target, pidata);
- }
- }
-
- /** Save the base URI of the document being parsed. */
- private void setupBaseURI(String systemId) {
- URL cwd = null;
-
- try {
- cwd = FileURL.makeURL("basename");
- } catch (MalformedURLException mue) {
- cwd = null;
- }
-
- try {
- baseURL = new URL(systemId);
- } catch (MalformedURLException mue) {
- if (cwd != null) {
- try {
- baseURL = new URL(cwd, systemId);
- } catch (MalformedURLException mue2) {
- // give up
- baseURL = null;
- }
- } else {
- // give up
- baseURL = null;
- }
- }
- }
-
- /** Provide one possible explanation for an InternalError. */
- private void explain(String systemId) {
- if (!suppressExplanation) {
- System.out.println("XMLReader probably encountered bad URI in " + systemId);
- System.out.println("For example, replace '/some/uri' with 'file:/some/uri'.");
- }
- suppressExplanation = true;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/resolver/tools/ResolvingXMLReader.java b/src/com/sun/org/apache/xml/internal/resolver/tools/ResolvingXMLReader.java
deleted file mode 100644
index 0a98cd8..0000000
--- a/src/com/sun/org/apache/xml/internal/resolver/tools/ResolvingXMLReader.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-// ResolvingXMLReader.java - An XMLReader that performs catalog resolution
-
-/*
- * Copyright 2001-2004 The Apache Software Foundation or its licensors,
- * as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xml.internal.resolver.tools;
-
-import org.xml.sax.*;
-
-import javax.xml.parsers.*;
-
-import com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl;
-import com.sun.org.apache.xml.internal.resolver.*;
-
-/**
- * A SAX XMLReader that performs catalog-based entity resolution.
- *
- * <p>This class implements a SAX XMLReader that performs entity resolution
- * using the CatalogResolver. The actual, underlying parser is obtained
- * from a SAXParserFactory.</p>
- * </p>
- *
- * @see CatalogResolver
- * @see org.xml.sax.XMLReader
- *
- * @author Norman Walsh
- * <a href="mailto:Norman.Walsh@Sun.COM">Norman.Walsh@Sun.COM</a>
- *
- * @version 1.0
- */
-public class ResolvingXMLReader extends ResolvingXMLFilter {
- /** Make the parser Namespace aware? */
- public static boolean namespaceAware = true;
-
- /** Make the parser validating? */
- public static boolean validating = false;
-
- /**
- * Construct a new reader from the JAXP factory.
- *
- * <p>In order to do its job, a ResolvingXMLReader must in fact be
- * a filter. So the only difference between this code and the filter
- * code is that the constructor builds a new reader.</p>
- */
- public ResolvingXMLReader() {
- super();
- SAXParserFactory spf = catalogManager.useServicesMechanism() ?
- SAXParserFactory.newInstance() : new SAXParserFactoryImpl();
- spf.setNamespaceAware(namespaceAware);
- spf.setValidating(validating);
- try {
- SAXParser parser = spf.newSAXParser();
- setParent(parser.getXMLReader());
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- /**
- * Construct a new reader from the JAXP factory.
- *
- * <p>In order to do its job, a ResolvingXMLReader must in fact be
- * a filter. So the only difference between this code and the filter
- * code is that the constructor builds a new reader.</p>
- */
- public ResolvingXMLReader(CatalogManager manager) {
- super(manager);
- SAXParserFactory spf = catalogManager.useServicesMechanism() ?
- SAXParserFactory.newInstance() : new SAXParserFactoryImpl();
- spf.setNamespaceAware(namespaceAware);
- spf.setValidating(validating);
- try {
- SAXParser parser = spf.newSAXParser();
- setParent(parser.getXMLReader());
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/serialize/BaseMarkupSerializer.java b/src/com/sun/org/apache/xml/internal/serialize/BaseMarkupSerializer.java
deleted file mode 100644
index f4d5a1c..0000000
--- a/src/com/sun/org/apache/xml/internal/serialize/BaseMarkupSerializer.java
+++ /dev/null
@@ -1,1967 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Sep 14, 2000:
-// Fixed comments to preserve whitespaces and add a line break
-// when indenting. Reported by Gervase Markham <gerv@gerv.net>
-// Sep 14, 2000:
-// Fixed serializer to report IO exception directly, instead at
-// the end of document processing.
-// Reported by Patrick Higgins <phiggins@transzap.com>
-// Sep 13, 2000:
-// CR in character data will print as &#0D;
-// Aug 25, 2000:
-// Fixed processing instruction printing inside element content
-// to not escape content. Reported by Mikael Staldal
-// <d96-mst@d.kth.se>
-// Aug 25, 2000:
-// Added ability to omit comments.
-// Contributed by Anupam Bagchi <abagchi@jtcsv.com>
-// Aug 26, 2000:
-// Fixed bug in newline handling when preserving spaces.
-// Contributed by Mike Dusseault <mdusseault@home.com>
-// Aug 29, 2000:
-// Fixed state.unescaped not being set to false when
-// entering element state.
-// Reported by Lowell Vaughn <lvaughn@agillion.com>
-
-
-package com.sun.org.apache.xml.internal.serialize;
-
-import com.sun.org.apache.xerces.internal.dom.DOMErrorImpl;
-import com.sun.org.apache.xerces.internal.dom.DOMLocatorImpl;
-import com.sun.org.apache.xerces.internal.dom.DOMMessageFormatter;
-import com.sun.org.apache.xerces.internal.util.XMLChar;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.Writer;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Vector;
-
-import org.w3c.dom.DOMError;
-import org.w3c.dom.DOMErrorHandler;
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.Entity;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.Notation;
-import org.w3c.dom.ls.LSException;
-import org.w3c.dom.ls.LSSerializerFilter;
-import org.w3c.dom.traversal.NodeFilter;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.DTDHandler;
-import org.xml.sax.DocumentHandler;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-import org.xml.sax.ext.DeclHandler;
-import org.xml.sax.ext.LexicalHandler;
-
-/**
- * Base class for a serializer supporting both DOM and SAX pretty
- * serializing of XML/HTML/XHTML documents. Derives classes perform
- * the method-specific serializing, this class provides the common
- * serializing mechanisms.
- * <p>
- * The serializer must be initialized with the proper writer and
- * output format before it can be used by calling {@link #setOutputCharStream}
- * or {@link #setOutputByteStream} for the writer and {@link #setOutputFormat}
- * for the output format.
- * <p>
- * The serializer can be reused any number of times, but cannot
- * be used concurrently by two threads.
- * <p>
- * If an output stream is used, the encoding is taken from the
- * output format (defaults to <tt>UTF-8</tt>). If a writer is
- * used, make sure the writer uses the same encoding (if applies)
- * as specified in the output format.
- * <p>
- * The serializer supports both DOM and SAX. DOM serializing is done
- * by calling {@link #serialize(Document)} and SAX serializing is done by firing
- * SAX events and using the serializer as a document handler.
- * This also applies to derived class.
- * <p>
- * If an I/O exception occurs while serializing, the serializer
- * will not throw an exception directly, but only throw it
- * at the end of serializing (either DOM or SAX's {@link
- * org.xml.sax.DocumentHandler#endDocument}.
- * <p>
- * For elements that are not specified as whitespace preserving,
- * the serializer will potentially break long text lines at space
- * boundaries, indent lines, and serialize elements on separate
- * lines. Line terminators will be regarded as spaces, and
- * spaces at beginning of line will be stripped.
- * <p>
- * When indenting, the serializer is capable of detecting seemingly
- * element content, and serializing these elements indented on separate
- * lines. An element is serialized indented when it is the first or
- * last child of an element, or immediate following or preceding
- * another element.
- *
- *
- * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
- * @author <a href="mailto:rahul.srivastava@sun.com">Rahul Srivastava</a>
- * @author Elena Litani, IBM
- * @author Sunitha Reddy, Sun Microsystems
- * @see Serializer
- * @see LSSerializer
- */
-public abstract class BaseMarkupSerializer
- implements ContentHandler, DocumentHandler, LexicalHandler,
- DTDHandler, DeclHandler, DOMSerializer, Serializer
-{
-
- // DOM L3 implementation
- protected short features = 0xFFFFFFFF;
- protected DOMErrorHandler fDOMErrorHandler;
- protected final DOMErrorImpl fDOMError = new DOMErrorImpl();
- protected LSSerializerFilter fDOMFilter;
-
- protected EncodingInfo _encodingInfo;
-
-
- /**
- * Holds array of all element states that have been entered.
- * The array is automatically resized. When leaving an element,
- * it's state is not removed but reused when later returning
- * to the same nesting level.
- */
- private ElementState[] _elementStates;
-
-
- /**
- * The index of the next state to place in the array,
- * or one plus the index of the current state. When zero,
- * we are in no state.
- */
- private int _elementStateCount;
-
-
- /**
- * Vector holding comments and PIs that come before the root
- * element (even after it), see {@link #serializePreRoot}.
- */
- private Vector _preRoot;
-
-
- /**
- * If the document has been started (header serialized), this
- * flag is set to true so it's not started twice.
- */
- protected boolean _started;
-
-
- /**
- * True if the serializer has been prepared. This flag is set
- * to false when the serializer is reset prior to using it,
- * and to true after it has been prepared for usage.
- */
- private boolean _prepared;
-
-
- /**
- * Association between namespace URIs (keys) and prefixes (values).
- * Accumulated here prior to starting an element and placing this
- * list in the element state.
- */
- protected Map<String, String> _prefixes;
-
-
- /**
- * The system identifier of the document type, if known.
- */
- protected String _docTypePublicId;
-
-
- /**
- * The system identifier of the document type, if known.
- */
- protected String _docTypeSystemId;
-
-
- /**
- * The output format associated with this serializer. This will never
- * be a null reference. If no format was passed to the constructor,
- * the default one for this document type will be used. The format
- * object is never changed by the serializer.
- */
- protected OutputFormat _format;
-
-
- /**
- * The printer used for printing text parts.
- */
- protected Printer _printer;
-
-
- /**
- * True if indenting printer.
- */
- protected boolean _indenting;
-
- /** Temporary buffer to store character data */
- protected final StringBuffer fStrBuffer = new StringBuffer(40);
-
- /**
- * The underlying writer.
- */
- private Writer _writer;
-
-
- /**
- * The output stream.
- */
- private OutputStream _output;
-
- /** Current node that is being processed */
- protected Node fCurrentNode = null;
-
-
-
- //--------------------------------//
- // Constructor and initialization //
- //--------------------------------//
-
-
- /**
- * Protected constructor can only be used by derived class.
- * Must initialize the serializer before serializing any document,
- * by calling {@link #setOutputCharStream} or {@link #setOutputByteStream}
- * first
- */
- protected BaseMarkupSerializer( OutputFormat format )
- {
- int i;
-
- _elementStates = new ElementState[ 10 ];
- for ( i = 0 ; i < _elementStates.length ; ++i )
- _elementStates[ i ] = new ElementState();
- _format = format;
- }
-
-
- public DocumentHandler asDocumentHandler()
- throws IOException
- {
- prepare();
- return this;
- }
-
-
- public ContentHandler asContentHandler()
- throws IOException
- {
- prepare();
- return this;
- }
-
-
- public DOMSerializer asDOMSerializer()
- throws IOException
- {
- prepare();
- return this;
- }
-
-
- public void setOutputByteStream( OutputStream output )
- {
- if ( output == null ) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.SERIALIZER_DOMAIN,
- "ArgumentIsNull", new Object[]{"output"});
- throw new NullPointerException(msg);
- }
- _output = output;
- _writer = null;
- reset();
- }
-
-
- public void setOutputCharStream( Writer writer )
- {
- if ( writer == null ) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.SERIALIZER_DOMAIN,
- "ArgumentIsNull", new Object[]{"writer"});
- throw new NullPointerException(msg);
- }
- _writer = writer;
- _output = null;
- reset();
- }
-
-
- public void setOutputFormat( OutputFormat format )
- {
- if ( format == null ) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.SERIALIZER_DOMAIN,
- "ArgumentIsNull", new Object[]{"format"});
- throw new NullPointerException(msg);
- }
- _format = format;
- reset();
- }
-
-
- public boolean reset()
- {
- if ( _elementStateCount > 1 ) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.SERIALIZER_DOMAIN,
- "ResetInMiddle", null);
- throw new IllegalStateException(msg);
- }
- _prepared = false;
- fCurrentNode = null;
- fStrBuffer.setLength(0);
- return true;
- }
-
-
- protected void prepare()
- throws IOException
- {
- if ( _prepared )
- return;
-
- if ( _writer == null && _output == null ) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.SERIALIZER_DOMAIN,
- "NoWriterSupplied", null);
- throw new IOException(msg);
- }
- // If the output stream has been set, use it to construct
- // the writer. It is possible that the serializer has been
- // reused with the same output stream and different encoding.
-
- _encodingInfo = _format.getEncodingInfo();
-
- if ( _output != null ) {
- _writer = _encodingInfo.getWriter(_output);
- }
-
- if ( _format.getIndenting() ) {
- _indenting = true;
- _printer = new IndentPrinter( _writer, _format );
- } else {
- _indenting = false;
- _printer = new Printer( _writer, _format );
- }
-
- ElementState state;
-
- _elementStateCount = 0;
- state = _elementStates[ 0 ];
- state.namespaceURI = null;
- state.localName = null;
- state.rawName = null;
- state.preserveSpace = _format.getPreserveSpace();
- state.empty = true;
- state.afterElement = false;
- state.afterComment = false;
- state.doCData = state.inCData = false;
- state.prefixes = null;
-
- _docTypePublicId = _format.getDoctypePublic();
- _docTypeSystemId = _format.getDoctypeSystem();
- _started = false;
- _prepared = true;
- }
-
-
-
- //----------------------------------//
- // DOM document serializing methods //
- //----------------------------------//
-
-
- /**
- * Serializes the DOM element using the previously specified
- * writer and output format. Throws an exception only if
- * an I/O exception occured while serializing.
- *
- * @param elem The element to serialize
- * @throws IOException An I/O exception occured while
- * serializing
- */
- public void serialize( Element elem )
- throws IOException
- {
- reset();
- prepare();
- serializeNode( elem );
- _printer.flush();
- if ( _printer.getException() != null )
- throw _printer.getException();
- }
-
- /**
- * Serializes a node using the previously specified
- * writer and output format. Throws an exception only if
- * an I/O exception occured while serializing.
- *
- * @param node Node to serialize
- * @throws IOException An I/O exception occured while serializing
- */
- public void serialize( Node node ) throws IOException {
- reset();
- prepare();
- serializeNode( node );
- //Print any PIs and Comments which appeared in 'node'
- serializePreRoot();
- _printer.flush();
- if ( _printer.getException() != null )
- throw _printer.getException();
- }
-
- /**
- * Serializes the DOM document fragmnt using the previously specified
- * writer and output format. Throws an exception only if
- * an I/O exception occured while serializing.
- *
- * @param elem The element to serialize
- * @throws IOException An I/O exception occured while
- * serializing
- */
- public void serialize( DocumentFragment frag )
- throws IOException
- {
- reset();
- prepare();
- serializeNode( frag );
- _printer.flush();
- if ( _printer.getException() != null )
- throw _printer.getException();
- }
-
-
- /**
- * Serializes the DOM document using the previously specified
- * writer and output format. Throws an exception only if
- * an I/O exception occured while serializing.
- *
- * @param doc The document to serialize
- * @throws IOException An I/O exception occured while
- * serializing
- */
- public void serialize( Document doc )
- throws IOException
- {
- reset();
- prepare();
- serializeNode( doc );
- serializePreRoot();
- _printer.flush();
- if ( _printer.getException() != null )
- throw _printer.getException();
- }
-
-
- //------------------------------------------//
- // SAX document handler serializing methods //
- //------------------------------------------//
-
-
- public void startDocument()
- throws SAXException
- {
- try {
- prepare();
- } catch ( IOException except ) {
- throw new SAXException( except.toString() );
- }
- // Nothing to do here. All the magic happens in startDocument(String)
- }
-
-
- public void characters( char[] chars, int start, int length )
- throws SAXException
- {
- ElementState state;
-
- try {
- state = content();
-
- // Check if text should be print as CDATA section or unescaped
- // based on elements listed in the output format (the element
- // state) or whether we are inside a CDATA section or entity.
-
- if ( state.inCData || state.doCData ) {
- int saveIndent;
-
- // Print a CDATA section. The text is not escaped, but ']]>'
- // appearing in the code must be identified and dealt with.
- // The contents of a text node is considered space preserving.
- if ( ! state.inCData ) {
- _printer.printText( "<![CDATA[" );
- state.inCData = true;
- }
- saveIndent = _printer.getNextIndent();
- _printer.setNextIndent( 0 );
- char ch;
- final int end = start + length;
- for ( int index = start ; index < end; ++index ) {
- ch = chars[index];
- if ( ch == ']' && index + 2 < end &&
- chars[ index + 1 ] == ']' && chars[ index + 2 ] == '>' ) {
- _printer.printText("]]]]><![CDATA[>");
- index +=2;
- continue;
- }
- if (!XMLChar.isValid(ch)) {
- // check if it is surrogate
- if (++index < end) {
- surrogates(ch, chars[index]);
- }
- else {
- fatalError("The character '"+(char)ch+"' is an invalid XML character");
- }
- continue;
- } else {
- if ( ( ch >= ' ' && _encodingInfo.isPrintable((char)ch) && ch != 0xF7 ) ||
- ch == '\n' || ch == '\r' || ch == '\t' ) {
- _printer.printText((char)ch);
- } else {
- // The character is not printable -- split CDATA section
- _printer.printText("]]>&#x");
- _printer.printText(Integer.toHexString(ch));
- _printer.printText(";<![CDATA[");
- }
- }
- }
- _printer.setNextIndent( saveIndent );
-
- } else {
-
- int saveIndent;
-
- if ( state.preserveSpace ) {
- // If preserving space then hold of indentation so no
- // excessive spaces are printed at line breaks, escape
- // the text content without replacing spaces and print
- // the text breaking only at line breaks.
- saveIndent = _printer.getNextIndent();
- _printer.setNextIndent( 0 );
- printText( chars, start, length, true, state.unescaped );
- _printer.setNextIndent( saveIndent );
- } else {
- printText( chars, start, length, false, state.unescaped );
- }
- }
- } catch ( IOException except ) {
- throw new SAXException( except );
- }
- }
-
-
- public void ignorableWhitespace( char[] chars, int start, int length )
- throws SAXException
- {
- int i;
-
- try {
- content();
-
- // Print ignorable whitespaces only when indenting, after
- // all they are indentation. Cancel the indentation to
- // not indent twice.
- if ( _indenting ) {
- _printer.setThisIndent( 0 );
- for ( i = start ; length-- > 0 ; ++i )
- _printer.printText( chars[ i ] );
- }
- } catch ( IOException except ) {
- throw new SAXException( except );
- }
- }
-
-
- public final void processingInstruction( String target, String code )
- throws SAXException
- {
- try {
- processingInstructionIO( target, code );
- } catch ( IOException except ) {
- throw new SAXException( except );
- }
- }
-
- public void processingInstructionIO( String target, String code )
- throws IOException
- {
- int index;
- ElementState state;
-
- state = content();
-
- // Create the processing instruction textual representation.
- // Make sure we don't have '?>' inside either target or code.
- index = target.indexOf( "?>" );
- if ( index >= 0 )
- fStrBuffer.append( "<?" ).append( target.substring( 0, index ) );
- else
- fStrBuffer.append( "<?" ).append( target );
- if ( code != null ) {
- fStrBuffer.append( ' ' );
- index = code.indexOf( "?>" );
- if ( index >= 0 )
- fStrBuffer.append( code.substring( 0, index ) );
- else
- fStrBuffer.append( code );
- }
- fStrBuffer.append( "?>" );
-
- // If before the root element (or after it), do not print
- // the PI directly but place it in the pre-root vector.
- if ( isDocumentState() ) {
- if ( _preRoot == null )
- _preRoot = new Vector();
- _preRoot.addElement( fStrBuffer.toString() );
- } else {
- _printer.indent();
- printText( fStrBuffer.toString(), true, true );
- _printer.unindent();
- if ( _indenting )
- state.afterElement = true;
- }
-
- fStrBuffer.setLength(0);
- }
-
-
- public void comment( char[] chars, int start, int length )
- throws SAXException
- {
- try {
- comment( new String( chars, start, length ) );
- } catch ( IOException except ) {
- throw new SAXException( except );
- }
- }
-
-
- public void comment( String text )
- throws IOException
- {
- int index;
- ElementState state;
-
- if ( _format.getOmitComments() )
- return;
-
- state = content();
- // Create the processing comment textual representation.
- // Make sure we don't have '-->' inside the comment.
- index = text.indexOf( "-->" );
- if ( index >= 0 )
- fStrBuffer.append( "<!--" ).append( text.substring( 0, index ) ).append( "-->" );
- else
- fStrBuffer.append( "<!--" ).append( text ).append( "-->" );
-
- // If before the root element (or after it), do not print
- // the comment directly but place it in the pre-root vector.
- if ( isDocumentState() ) {
- if ( _preRoot == null )
- _preRoot = new Vector();
- _preRoot.addElement( fStrBuffer.toString() );
- } else {
- // Indent this element on a new line if the first
- // content of the parent element or immediately
- // following an element.
- if ( _indenting && ! state.preserveSpace)
- _printer.breakLine();
- _printer.indent();
- printText( fStrBuffer.toString(), true, true );
- _printer.unindent();
- if ( _indenting )
- state.afterElement = true;
- }
-
- fStrBuffer.setLength(0);
- state.afterComment = true;
- state.afterElement = false;
- }
-
-
- public void startCDATA()
- {
- ElementState state;
-
- state = getElementState();
- state.doCData = true;
- }
-
-
- public void endCDATA()
- {
- ElementState state;
-
- state = getElementState();
- state.doCData = false;
- }
-
-
- public void startNonEscaping()
- {
- ElementState state;
-
- state = getElementState();
- state.unescaped = true;
- }
-
-
- public void endNonEscaping()
- {
- ElementState state;
-
- state = getElementState();
- state.unescaped = false;
- }
-
-
- public void startPreserving()
- {
- ElementState state;
-
- state = getElementState();
- state.preserveSpace = true;
- }
-
-
- public void endPreserving()
- {
- ElementState state;
-
- state = getElementState();
- state.preserveSpace = false;
- }
-
-
- /**
- * Called at the end of the document to wrap it up.
- * Will flush the output stream and throw an exception
- * if any I/O error occured while serializing.
- *
- * @throws SAXException An I/O exception occured during
- * serializing
- */
- public void endDocument()
- throws SAXException
- {
- try {
- // Print all the elements accumulated outside of
- // the root element.
- serializePreRoot();
- // Flush the output, this is necessary for fStrBuffered output.
- _printer.flush();
- } catch ( IOException except ) {
- throw new SAXException( except );
- }
- }
-
-
- public void startEntity( String name )
- {
- // ???
- }
-
-
- public void endEntity( String name )
- {
- // ???
- }
-
-
- public void setDocumentLocator( Locator locator )
- {
- // Nothing to do
- }
-
-
- //-----------------------------------------//
- // SAX content handler serializing methods //
- //-----------------------------------------//
-
-
- public void skippedEntity ( String name )
- throws SAXException
- {
- try {
- endCDATA();
- content();
- _printer.printText( '&' );
- _printer.printText( name );
- _printer.printText( ';' );
- } catch ( IOException except ) {
- throw new SAXException( except );
- }
- }
-
-
- public void startPrefixMapping( String prefix, String uri )
- throws SAXException
- {
- if ( _prefixes == null )
- _prefixes = new HashMap<>();
- _prefixes.put( uri, prefix == null ? "" : prefix );
- }
-
-
- public void endPrefixMapping( String prefix )
- throws SAXException
- {
- }
-
-
- //------------------------------------------//
- // SAX DTD/Decl handler serializing methods //
- //------------------------------------------//
-
-
- public final void startDTD( String name, String publicId, String systemId )
- throws SAXException
- {
- try {
- _printer.enterDTD();
- _docTypePublicId = publicId;
- _docTypeSystemId = systemId;
-
- } catch ( IOException except ) {
- throw new SAXException( except );
- }
- }
-
-
- public void endDTD()
- {
- // Nothing to do here, all the magic occurs in startDocument(String).
- }
-
-
- public void elementDecl( String name, String model )
- throws SAXException
- {
- try {
- _printer.enterDTD();
- _printer.printText( "<!ELEMENT " );
- _printer.printText( name );
- _printer.printText( ' ' );
- _printer.printText( model );
- _printer.printText( '>' );
- if ( _indenting )
- _printer.breakLine();
- } catch ( IOException except ) {
- throw new SAXException( except );
- }
- }
-
-
- public void attributeDecl( String eName, String aName, String type,
- String valueDefault, String value )
- throws SAXException
- {
- try {
- _printer.enterDTD();
- _printer.printText( "<!ATTLIST " );
- _printer.printText( eName );
- _printer.printText( ' ' );
- _printer.printText( aName );
- _printer.printText( ' ' );
- _printer.printText( type );
- if ( valueDefault != null ) {
- _printer.printText( ' ' );
- _printer.printText( valueDefault );
- }
- if ( value != null ) {
- _printer.printText( " \"" );
- printEscaped( value );
- _printer.printText( '"' );
- }
- _printer.printText( '>' );
- if ( _indenting )
- _printer.breakLine();
- } catch ( IOException except ) {
- throw new SAXException( except );
- }
- }
-
-
- public void internalEntityDecl( String name, String value )
- throws SAXException
- {
- try {
- _printer.enterDTD();
- _printer.printText( "<!ENTITY " );
- _printer.printText( name );
- _printer.printText( " \"" );
- printEscaped( value );
- _printer.printText( "\">" );
- if ( _indenting )
- _printer.breakLine();
- } catch ( IOException except ) {
- throw new SAXException( except );
- }
- }
-
-
- public void externalEntityDecl( String name, String publicId, String systemId )
- throws SAXException
- {
- try {
- _printer.enterDTD();
- unparsedEntityDecl( name, publicId, systemId, null );
- } catch ( IOException except ) {
- throw new SAXException( except );
- }
- }
-
-
- public void unparsedEntityDecl( String name, String publicId,
- String systemId, String notationName )
- throws SAXException
- {
- try {
- _printer.enterDTD();
- if ( publicId == null ) {
- _printer.printText( "<!ENTITY " );
- _printer.printText( name );
- _printer.printText( " SYSTEM " );
- printDoctypeURL( systemId );
- } else {
- _printer.printText( "<!ENTITY " );
- _printer.printText( name );
- _printer.printText( " PUBLIC " );
- printDoctypeURL( publicId );
- _printer.printText( ' ' );
- printDoctypeURL( systemId );
- }
- if ( notationName != null ) {
- _printer.printText( " NDATA " );
- _printer.printText( notationName );
- }
- _printer.printText( '>' );
- if ( _indenting )
- _printer.breakLine();
- } catch ( IOException except ) {
- throw new SAXException( except );
- }
- }
-
-
- public void notationDecl( String name, String publicId, String systemId )
- throws SAXException
- {
- try {
- _printer.enterDTD();
- if ( publicId != null ) {
- _printer.printText( "<!NOTATION " );
- _printer.printText( name );
- _printer.printText( " PUBLIC " );
- printDoctypeURL( publicId );
- if ( systemId != null ) {
- _printer.printText( ' ' );
- printDoctypeURL( systemId );
- }
- } else {
- _printer.printText( "<!NOTATION " );
- _printer.printText( name );
- _printer.printText( " SYSTEM " );
- printDoctypeURL( systemId );
- }
- _printer.printText( '>' );
- if ( _indenting )
- _printer.breakLine();
- } catch ( IOException except ) {
- throw new SAXException( except );
- }
- }
-
-
- //------------------------------------------//
- // Generic node serializing methods methods //
- //------------------------------------------//
-
-
- /**
- * Serialize the DOM node. This method is shared across XML, HTML and XHTML
- * serializers and the differences are masked out in a separate {@link
- * #serializeElement}.
- *
- * @param node The node to serialize
- * @see #serializeElement
- * @throws IOException An I/O exception occured while
- * serializing
- */
- protected void serializeNode( Node node )
- throws IOException
- {
- fCurrentNode = node;
-
- // Based on the node type call the suitable SAX handler.
- // Only comments entities and documents which are not
- // handled by SAX are serialized directly.
- switch ( node.getNodeType() ) {
- case Node.TEXT_NODE : {
- String text;
-
- text = node.getNodeValue();
- if ( text != null ) {
- if (fDOMFilter !=null &&
- (fDOMFilter.getWhatToShow() & NodeFilter.SHOW_TEXT)!= 0) {
- short code = fDOMFilter.acceptNode(node);
- switch (code) {
- case NodeFilter.FILTER_REJECT:
- case NodeFilter.FILTER_SKIP: {
- break;
- }
- default: {
- characters(text);
- }
- }
- }
- else if ( !_indenting || getElementState().preserveSpace
- || (text.replace('\n',' ').trim().length() != 0))
- characters( text );
-
- }
- break;
- }
-
- case Node.CDATA_SECTION_NODE : {
- String text = node.getNodeValue();
- if ((features & DOMSerializerImpl.CDATA) != 0) {
- if (text != null) {
- if (fDOMFilter != null
- && (fDOMFilter.getWhatToShow()
- & NodeFilter.SHOW_CDATA_SECTION)
- != 0) {
- short code = fDOMFilter.acceptNode(node);
- switch (code) {
- case NodeFilter.FILTER_REJECT :
- case NodeFilter.FILTER_SKIP :
- {
- // skip the CDATA node
- return;
- }
- default :
- {
- //fall through..
- }
- }
- }
- startCDATA();
- characters(text);
- endCDATA();
- }
- } else {
- // transform into a text node
- characters(text);
- }
- break;
- }
- case Node.COMMENT_NODE : {
- String text;
-
- if ( ! _format.getOmitComments() ) {
- text = node.getNodeValue();
- if ( text != null ) {
-
- if (fDOMFilter !=null &&
- (fDOMFilter.getWhatToShow() & NodeFilter.SHOW_COMMENT)!= 0) {
- short code = fDOMFilter.acceptNode(node);
- switch (code) {
- case NodeFilter.FILTER_REJECT:
- case NodeFilter.FILTER_SKIP: {
- // skip the comment node
- return;
- }
- default: {
- // fall through
- }
- }
- }
- comment( text );
- }
- }
- break;
- }
-
- case Node.ENTITY_REFERENCE_NODE : {
- Node child;
-
- endCDATA();
- content();
-
- if (((features & DOMSerializerImpl.ENTITIES) != 0)
- || (node.getFirstChild() == null)) {
- if (fDOMFilter !=null &&
- (fDOMFilter.getWhatToShow() & NodeFilter.SHOW_ENTITY_REFERENCE)!= 0) {
- short code = fDOMFilter.acceptNode(node);
- switch (code) {
- case NodeFilter.FILTER_REJECT:{
- return; // remove the node
- }
- case NodeFilter.FILTER_SKIP: {
- child = node.getFirstChild();
- while ( child != null ) {
- serializeNode( child );
- child = child.getNextSibling();
- }
- return;
- }
-
- default: {
- // fall through
- }
- }
- }
- checkUnboundNamespacePrefixedNode(node);
-
- _printer.printText("&");
- _printer.printText(node.getNodeName());
- _printer.printText(";");
- }
- else {
- child = node.getFirstChild();
- while ( child != null ) {
- serializeNode( child );
- child = child.getNextSibling();
- }
- }
-
- break;
- }
-
- case Node.PROCESSING_INSTRUCTION_NODE : {
-
- if (fDOMFilter !=null &&
- (fDOMFilter.getWhatToShow() & NodeFilter.SHOW_PROCESSING_INSTRUCTION)!= 0) {
- short code = fDOMFilter.acceptNode(node);
- switch (code) {
- case NodeFilter.FILTER_REJECT:
- case NodeFilter.FILTER_SKIP: {
- return; // skip this node
- }
- default: { // fall through
- }
- }
- }
- processingInstructionIO( node.getNodeName(), node.getNodeValue() );
- break;
- }
- case Node.ELEMENT_NODE : {
-
- if (fDOMFilter !=null &&
- (fDOMFilter.getWhatToShow() & NodeFilter.SHOW_ELEMENT)!= 0) {
- short code = fDOMFilter.acceptNode(node);
- switch (code) {
- case NodeFilter.FILTER_REJECT: {
- return;
- }
- case NodeFilter.FILTER_SKIP: {
- Node child = node.getFirstChild();
- while ( child != null ) {
- serializeNode( child );
- child = child.getNextSibling();
- }
- return; // skip this node
- }
-
- default: { // fall through
- }
- }
- }
- serializeElement( (Element) node );
- break;
- }
- case Node.DOCUMENT_NODE : {
- DocumentType docType;
- DOMImplementation domImpl;
- NamedNodeMap map;
- Entity entity;
- Notation notation;
- int i;
-
- serializeDocument();
-
- // If there is a document type, use the SAX events to
- // serialize it.
- docType = ( (Document) node ).getDoctype();
- if (docType != null) {
- // DOM Level 2 (or higher)
- domImpl = ( (Document) node ).getImplementation();
- try {
- String internal;
-
- _printer.enterDTD();
- _docTypePublicId = docType.getPublicId();
- _docTypeSystemId = docType.getSystemId();
- internal = docType.getInternalSubset();
- if ( internal != null && internal.length() > 0 )
- _printer.printText( internal );
- endDTD();
- }
- // DOM Level 1 -- does implementation have methods?
- catch (NoSuchMethodError nsme) {
- Class docTypeClass = docType.getClass();
-
- String docTypePublicId = null;
- String docTypeSystemId = null;
- try {
- java.lang.reflect.Method getPublicId = docTypeClass.getMethod("getPublicId", (Class[]) null);
- if (getPublicId.getReturnType().equals(String.class)) {
- docTypePublicId = (String)getPublicId.invoke(docType, (Object[]) null);
- }
- }
- catch (Exception e) {
- // ignore
- }
- try {
- java.lang.reflect.Method getSystemId = docTypeClass.getMethod("getSystemId", (Class[]) null);
- if (getSystemId.getReturnType().equals(String.class)) {
- docTypeSystemId = (String)getSystemId.invoke(docType, (Object[]) null);
- }
- }
- catch (Exception e) {
- // ignore
- }
- _printer.enterDTD();
- _docTypePublicId = docTypePublicId;
- _docTypeSystemId = docTypeSystemId;
- endDTD();
- }
-
- serializeDTD(docType.getName());
-
- }
- _started = true;
-
- // !! Fall through
- }
- case Node.DOCUMENT_FRAGMENT_NODE : {
- Node child;
-
- // By definition this will happen if the node is a document,
- // document fragment, etc. Just serialize its contents. It will
- // work well for other nodes that we do not know how to serialize.
- child = node.getFirstChild();
- while ( child != null ) {
- serializeNode( child );
- child = child.getNextSibling();
- }
- break;
- }
-
- default:
- break;
- }
- }
-
-
- /* Serializes XML Declaration, according to 'xml-declaration' property.
- */
- protected void serializeDocument()throws IOException {
- int i;
-
- String dtd = _printer.leaveDTD();
- if (! _started) {
-
- if (! _format.getOmitXMLDeclaration()) {
- StringBuffer buffer;
-
- // Serialize the document declaration appreaing at the head
- // of very XML document (unless asked not to).
- buffer = new StringBuffer( "<?xml version=\"" );
- if (_format.getVersion() != null)
- buffer.append( _format.getVersion() );
- else
- buffer.append( "1.0" );
- buffer.append( '"' );
- String format_encoding = _format.getEncoding();
- if (format_encoding != null) {
- buffer.append( " encoding=\"" );
- buffer.append( format_encoding );
- buffer.append( '"' );
- }
- if (_format.getStandalone() && _docTypeSystemId == null &&
- _docTypePublicId == null)
- buffer.append( " standalone=\"yes\"" );
- buffer.append( "?>" );
- _printer.printText( buffer );
- _printer.breakLine();
- }
- }
-
- // Always serialize these, even if not te first root element.
- serializePreRoot();
-
- }
-
- /* Serializes DTD, if present.
- */
- protected void serializeDTD(String name) throws IOException{
-
- String dtd = _printer.leaveDTD();
- if (! _format.getOmitDocumentType()) {
- if (_docTypeSystemId != null) {
- // System identifier must be specified to print DOCTYPE.
- // If public identifier is specified print 'PUBLIC
- // <public> <system>', if not, print 'SYSTEM <system>'.
- _printer.printText( "<!DOCTYPE " );
- _printer.printText( name );
- if (_docTypePublicId != null) {
- _printer.printText( " PUBLIC " );
- printDoctypeURL( _docTypePublicId );
- if (_indenting) {
- _printer.breakLine();
- for (int i = 0 ; i < 18 + name.length() ; ++i)
- _printer.printText( " " );
- } else
- _printer.printText( " " );
- printDoctypeURL( _docTypeSystemId );
- } else {
- _printer.printText( " SYSTEM " );
- printDoctypeURL( _docTypeSystemId );
- }
-
- // If we accumulated any DTD contents while printing.
- // this would be the place to print it.
- if (dtd != null && dtd.length() > 0) {
- _printer.printText( " [" );
- printText( dtd, true, true );
- _printer.printText( ']' );
- }
-
- _printer.printText( ">" );
- _printer.breakLine();
- } else if (dtd != null && dtd.length() > 0) {
- _printer.printText( "<!DOCTYPE " );
- _printer.printText( name );
- _printer.printText( " [" );
- printText( dtd, true, true );
- _printer.printText( "]>" );
- _printer.breakLine();
- }
- }
- }
-
-
- /**
- * Must be called by a method about to print any type of content.
- * If the element was just opened, the opening tag is closed and
- * will be matched to a closing tag. Returns the current element
- * state with <tt>empty</tt> and <tt>afterElement</tt> set to false.
- *
- * @return The current element state
- * @throws IOException An I/O exception occured while
- * serializing
- */
- protected ElementState content()
- throws IOException
- {
- ElementState state;
-
- state = getElementState();
- if ( ! isDocumentState() ) {
- // Need to close CData section first
- if ( state.inCData && ! state.doCData ) {
- _printer.printText( "]]>" );
- state.inCData = false;
- }
- // If this is the first content in the element,
- // change the state to not-empty and close the
- // opening element tag.
- if ( state.empty ) {
- _printer.printText( '>' );
- state.empty = false;
- }
- // Except for one content type, all of them
- // are not last element. That one content
- // type will take care of itself.
- state.afterElement = false;
- // Except for one content type, all of them
- // are not last comment. That one content
- // type will take care of itself.
- state.afterComment = false;
- }
- return state;
- }
-
-
- /**
- * Called to print the text contents in the prevailing element format.
- * Since this method is capable of printing text as CDATA, it is used
- * for that purpose as well. White space handling is determined by the
- * current element state. In addition, the output format can dictate
- * whether the text is printed as CDATA or unescaped.
- *
- * @param text The text to print
- * @param unescaped True is should print unescaped
- * @throws IOException An I/O exception occured while
- * serializing
- */
- protected void characters( String text )
- throws IOException
- {
- ElementState state;
-
- state = content();
- // Check if text should be print as CDATA section or unescaped
- // based on elements listed in the output format (the element
- // state) or whether we are inside a CDATA section or entity.
-
- if ( state.inCData || state.doCData ) {
- int index;
- int saveIndent;
-
- // Print a CDATA section. The text is not escaped, but ']]>'
- // appearing in the code must be identified and dealt with.
- // The contents of a text node is considered space preserving.
- if ( ! state.inCData ) {
- _printer.printText("<![CDATA[");
- state.inCData = true;
- }
- saveIndent = _printer.getNextIndent();
- _printer.setNextIndent( 0 );
- printCDATAText( text);
- _printer.setNextIndent( saveIndent );
-
- } else {
-
- int saveIndent;
-
- if ( state.preserveSpace ) {
- // If preserving space then hold of indentation so no
- // excessive spaces are printed at line breaks, escape
- // the text content without replacing spaces and print
- // the text breaking only at line breaks.
- saveIndent = _printer.getNextIndent();
- _printer.setNextIndent( 0 );
- printText( text, true, state.unescaped );
- _printer.setNextIndent( saveIndent );
- } else {
- printText( text, false, state.unescaped );
- }
- }
- }
-
-
- /**
- * Returns the suitable entity reference for this character value,
- * or null if no such entity exists. Calling this method with <tt>'&amp;'</tt>
- * will return <tt>"&amp;amp;"</tt>.
- *
- * @param ch Character value
- * @return Character entity name, or null
- */
- protected abstract String getEntityRef( int ch );
-
-
- /**
- * Called to serializee the DOM element. The element is serialized based on
- * the serializer's method (XML, HTML, XHTML).
- *
- * @param elem The element to serialize
- * @throws IOException An I/O exception occured while
- * serializing
- */
- protected abstract void serializeElement( Element elem )
- throws IOException;
-
-
- /**
- * Comments and PIs cannot be serialized before the root element,
- * because the root element serializes the document type, which
- * generally comes first. Instead such PIs and comments are
- * accumulated inside a vector and serialized by calling this
- * method. Will be called when the root element is serialized
- * and when the document finished serializing.
- *
- * @throws IOException An I/O exception occured while
- * serializing
- */
- protected void serializePreRoot()
- throws IOException
- {
- int i;
-
- if ( _preRoot != null ) {
- for ( i = 0 ; i < _preRoot.size() ; ++i ) {
- printText( (String) _preRoot.elementAt( i ), true, true );
- if ( _indenting )
- _printer.breakLine();
- }
- _preRoot.removeAllElements();
- }
- }
-
-
- //---------------------------------------------//
- // Text pretty printing and formatting methods //
- //---------------------------------------------//
-
- protected void printCDATAText( String text ) throws IOException {
- int length = text.length();
- char ch;
-
- for ( int index = 0 ; index < length; ++index ) {
- ch = text.charAt( index );
- if (ch == ']'
- && index + 2 < length
- && text.charAt(index + 1) == ']'
- && text.charAt(index + 2) == '>') { // check for ']]>'
- if (fDOMErrorHandler != null) {
- // REVISIT: this means that if DOM Error handler is not registered we don't report any
- // fatal errors and might serialize not wellformed document
- if ((features & DOMSerializerImpl.SPLITCDATA) == 0) {
- String msg = DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.SERIALIZER_DOMAIN,
- "EndingCDATA",
- null);
- if ((features & DOMSerializerImpl.WELLFORMED) != 0) {
- // issue fatal error
- modifyDOMError(msg, DOMError.SEVERITY_FATAL_ERROR, "wf-invalid-character", fCurrentNode);
- fDOMErrorHandler.handleError(fDOMError);
- throw new LSException(LSException.SERIALIZE_ERR, msg);
- }
- else {
- // issue error
- modifyDOMError(msg, DOMError.SEVERITY_ERROR, "cdata-section-not-splitted", fCurrentNode);
- if (!fDOMErrorHandler.handleError(fDOMError)) {
- throw new LSException(LSException.SERIALIZE_ERR, msg);
- }
- }
- } else {
- // issue warning
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.SERIALIZER_DOMAIN,
- "SplittingCDATA",
- null);
- modifyDOMError(
- msg,
- DOMError.SEVERITY_WARNING,
- null, fCurrentNode);
- fDOMErrorHandler.handleError(fDOMError);
- }
- }
- // split CDATA section
- _printer.printText("]]]]><![CDATA[>");
- index += 2;
- continue;
- }
-
- if (!XMLChar.isValid(ch)) {
- // check if it is surrogate
- if (++index <length) {
- surrogates(ch, text.charAt(index));
- }
- else {
- fatalError("The character '"+(char)ch+"' is an invalid XML character");
- }
- continue;
- } else {
- if ( ( ch >= ' ' && _encodingInfo.isPrintable((char)ch) && ch != 0xF7 ) ||
- ch == '\n' || ch == '\r' || ch == '\t' ) {
- _printer.printText((char)ch);
- } else {
-
- // The character is not printable -- split CDATA section
- _printer.printText("]]>&#x");
- _printer.printText(Integer.toHexString(ch));
- _printer.printText(";<![CDATA[");
- }
- }
- }
- }
-
-
- protected void surrogates(int high, int low) throws IOException{
- if (XMLChar.isHighSurrogate(high)) {
- if (!XMLChar.isLowSurrogate(low)) {
- //Invalid XML
- fatalError("The character '"+(char)low+"' is an invalid XML character");
- }
- else {
- int supplemental = XMLChar.supplemental((char)high, (char)low);
- if (!XMLChar.isValid(supplemental)) {
- //Invalid XML
- fatalError("The character '"+(char)supplemental+"' is an invalid XML character");
- }
- else {
- if (content().inCData ) {
- _printer.printText("]]>&#x");
- _printer.printText(Integer.toHexString(supplemental));
- _printer.printText(";<![CDATA[");
- }
- else {
- printHex(supplemental);
- }
- }
- }
- } else {
- fatalError("The character '"+(char)high+"' is an invalid XML character");
- }
-
- }
-
- /**
- * Called to print additional text with whitespace handling.
- * If spaces are preserved, the text is printed as if by calling
- * {@link #printText(String,boolean,boolean)} with a call to {@link Printer#breakLine}
- * for each new line. If spaces are not preserved, the text is
- * broken at space boundaries if longer than the line width;
- * Multiple spaces are printed as such, but spaces at beginning
- * of line are removed.
- *
- * @param text The text to print
- * @param preserveSpace Space preserving flag
- * @param unescaped Print unescaped
- */
- protected void printText( char[] chars, int start, int length,
- boolean preserveSpace, boolean unescaped )
- throws IOException
- {
- int index;
- char ch;
-
- if ( preserveSpace ) {
- // Preserving spaces: the text must print exactly as it is,
- // without breaking when spaces appear in the text and without
- // consolidating spaces. If a line terminator is used, a line
- // break will occur.
- while ( length-- > 0 ) {
- ch = chars[ start ];
- ++start;
- if ( ch == '\n' || ch == '\r' || unescaped )
- _printer.printText( ch );
- else
- printEscaped( ch );
- }
- } else {
- // Not preserving spaces: print one part at a time, and
- // use spaces between parts to break them into different
- // lines. Spaces at beginning of line will be stripped
- // by printing mechanism. Line terminator is treated
- // no different than other text part.
- while ( length-- > 0 ) {
- ch = chars[ start ];
- ++start;
- if ( ch == ' ' || ch == '\f' || ch == '\t' || ch == '\n' || ch == '\r' )
- _printer.printSpace();
- else if ( unescaped )
- _printer.printText( ch );
- else
- printEscaped( ch );
- }
- }
- }
-
-
- protected void printText( String text, boolean preserveSpace, boolean unescaped )
- throws IOException
- {
- int index;
- char ch;
-
- if ( preserveSpace ) {
- // Preserving spaces: the text must print exactly as it is,
- // without breaking when spaces appear in the text and without
- // consolidating spaces. If a line terminator is used, a line
- // break will occur.
- for ( index = 0 ; index < text.length() ; ++index ) {
- ch = text.charAt( index );
- if ( ch == '\n' || ch == '\r' || unescaped )
- _printer.printText( ch );
- else
- printEscaped( ch );
- }
- } else {
- // Not preserving spaces: print one part at a time, and
- // use spaces between parts to break them into different
- // lines. Spaces at beginning of line will be stripped
- // by printing mechanism. Line terminator is treated
- // no different than other text part.
- for ( index = 0 ; index < text.length() ; ++index ) {
- ch = text.charAt( index );
- if ( ch == ' ' || ch == '\f' || ch == '\t' || ch == '\n' || ch == '\r' )
- _printer.printSpace();
- else if ( unescaped )
- _printer.printText( ch );
- else
- printEscaped( ch );
- }
- }
- }
-
-
- /**
- * Print a document type public or system identifier URL.
- * Encapsulates the URL in double quotes, escapes non-printing
- * characters and print it equivalent to {@link #printText}.
- *
- * @param url The document type url to print
- */
- protected void printDoctypeURL( String url )
- throws IOException
- {
- int i;
-
- _printer.printText( '"' );
- for( i = 0 ; i < url.length() ; ++i ) {
- if ( url.charAt( i ) == '"' || url.charAt( i ) < 0x20 || url.charAt( i ) > 0x7F ) {
- _printer.printText( '%' );
- _printer.printText( Integer.toHexString( url.charAt( i ) ) );
- } else
- _printer.printText( url.charAt( i ) );
- }
- _printer.printText( '"' );
- }
-
-
- protected void printEscaped( int ch )
- throws IOException
- {
- String charRef;
- // If there is a suitable entity reference for this
- // character, print it. The list of available entity
- // references is almost but not identical between
- // XML and HTML.
- charRef = getEntityRef( ch );
- if ( charRef != null ) {
- _printer.printText( '&' );
- _printer.printText( charRef );
- _printer.printText( ';' );
- } else if ( ( ch >= ' ' && _encodingInfo.isPrintable((char)ch) && ch != 0xF7 ) ||
- ch == '\n' || ch == '\r' || ch == '\t' ) {
- // Non printables are below ASCII space but not tab or line
- // terminator, ASCII delete, or above a certain Unicode threshold.
- if (ch < 0x10000) {
- _printer.printText((char)ch );
- } else {
- _printer.printText((char)(((ch-0x10000)>>10)+0xd800));
- _printer.printText((char)(((ch-0x10000)&0x3ff)+0xdc00));
- }
- } else {
- printHex(ch);
- }
- }
-
- /**
- * Escapes chars
- */
- final void printHex( int ch) throws IOException {
- _printer.printText( "&#x" );
- _printer.printText(Integer.toHexString(ch));
- _printer.printText( ';' );
-
- }
-
-
- /**
- * Escapes a string so it may be printed as text content or attribute
- * value. Non printable characters are escaped using character references.
- * Where the format specifies a deault entity reference, that reference
- * is used (e.g. <tt>&amp;lt;</tt>).
- *
- * @param source The string to escape
- */
- protected void printEscaped( String source )
- throws IOException
- {
- for ( int i = 0 ; i < source.length() ; ++i ) {
- int ch = source.charAt(i);
- if ((ch & 0xfc00) == 0xd800 && i+1 < source.length()) {
- int lowch = source.charAt(i+1);
- if ((lowch & 0xfc00) == 0xdc00) {
- ch = 0x10000 + ((ch-0xd800)<<10) + lowch-0xdc00;
- i++;
- }
- }
- printEscaped(ch);
- }
- }
-
-
- //--------------------------------//
- // Element state handling methods //
- //--------------------------------//
-
-
- /**
- * Return the state of the current element.
- *
- * @return Current element state
- */
- protected ElementState getElementState()
- {
- return _elementStates[ _elementStateCount ];
- }
-
-
- /**
- * Enter a new element state for the specified element.
- * Tag name and space preserving is specified, element
- * state is initially empty.
- *
- * @return Current element state, or null
- */
- protected ElementState enterElementState( String namespaceURI, String localName,
- String rawName, boolean preserveSpace )
- {
- ElementState state;
-
- if ( _elementStateCount + 1 == _elementStates.length ) {
- ElementState[] newStates;
-
- // Need to create a larger array of states. This does not happen
- // often, unless the document is really deep.
- newStates = new ElementState[ _elementStates.length + 10 ];
- for ( int i = 0 ; i < _elementStates.length ; ++i )
- newStates[ i ] = _elementStates[ i ];
- for ( int i = _elementStates.length ; i < newStates.length ; ++i )
- newStates[ i ] = new ElementState();
- _elementStates = newStates;
- }
-
- ++_elementStateCount;
- state = _elementStates[ _elementStateCount ];
- state.namespaceURI = namespaceURI;
- state.localName = localName;
- state.rawName = rawName;
- state.preserveSpace = preserveSpace;
- state.empty = true;
- state.afterElement = false;
- state.afterComment = false;
- state.doCData = state.inCData = false;
- state.unescaped = false;
- state.prefixes = _prefixes;
-
- _prefixes = null;
- return state;
- }
-
-
- /**
- * Leave the current element state and return to the
- * state of the parent element. If this was the root
- * element, return to the state of the document.
- *
- * @return Previous element state
- */
- protected ElementState leaveElementState()
- {
- if ( _elementStateCount > 0 ) {
- /*Corrected by David Blondeau (blondeau@intalio.com)*/
- _prefixes = null;
- //_prefixes = _elementStates[ _elementStateCount ].prefixes;
- -- _elementStateCount;
- return _elementStates[ _elementStateCount ];
- } else {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.SERIALIZER_DOMAIN, "Internal", null);
- throw new IllegalStateException(msg);
- }
- }
-
-
- /**
- * Returns true if in the state of the document.
- * Returns true before entering any element and after
- * leaving the root element.
- *
- * @return True if in the state of the document
- */
- protected boolean isDocumentState()
- {
- return _elementStateCount == 0;
- }
-
-
- /**
- * Returns the namespace prefix for the specified URI.
- * If the URI has been mapped to a prefix, returns the
- * prefix, otherwise returns null.
- *
- * @param namespaceURI The namespace URI
- * @return The namespace prefix if known, or null
- */
- protected String getPrefix( String namespaceURI )
- {
- String prefix;
-
- if ( _prefixes != null ) {
- prefix = _prefixes.get( namespaceURI );
- if ( prefix != null )
- return prefix;
- }
- if ( _elementStateCount == 0 )
- return null;
- else {
- for ( int i = _elementStateCount ; i > 0 ; --i ) {
- if ( _elementStates[ i ].prefixes != null ) {
- prefix = (String) _elementStates[ i ].prefixes.get( namespaceURI );
- if ( prefix != null )
- return prefix;
- }
- }
- }
- return null;
- }
-
- /**
- * The method modifies global DOM error object
- *
- * @param message
- * @param severity
- * @param type
- * @return a DOMError
- */
- protected DOMError modifyDOMError(String message, short severity, String type, Node node){
- fDOMError.reset();
- fDOMError.fMessage = message;
- fDOMError.fType = type;
- fDOMError.fSeverity = severity;
- fDOMError.fLocator = new DOMLocatorImpl(-1, -1, -1, node, null);
- return fDOMError;
-
- }
-
-
- protected void fatalError(String message) throws IOException{
- if (fDOMErrorHandler != null) {
- modifyDOMError(message, DOMError.SEVERITY_FATAL_ERROR, null, fCurrentNode);
- fDOMErrorHandler.handleError(fDOMError);
- }
- else {
- throw new IOException(message);
- }
- }
-
- /**
- * DOM level 3:
- * Check a node to determine if it contains unbound namespace prefixes.
- *
- * @param node The node to check for unbound namespace prefices
- */
- protected void checkUnboundNamespacePrefixedNode (Node node) throws IOException{
-
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/serialize/DOMSerializer.java b/src/com/sun/org/apache/xml/internal/serialize/DOMSerializer.java
deleted file mode 100644
index 4056661..0000000
--- a/src/com/sun/org/apache/xml/internal/serialize/DOMSerializer.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package com.sun.org.apache.xml.internal.serialize;
-
-
-import java.io.IOException;
-import org.w3c.dom.Element;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentFragment;
-
-
-
-/**
- * Interface for a DOM serializer implementation.
- *
- *
- * @author <a href="mailto:Scott_Boag/CAM/Lotus@lotus.com">Scott Boag</a>
- * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
- */
-public interface DOMSerializer
-{
-
-
- /**
- * Serialized the DOM element. Throws an exception only if
- * an I/O exception occured while serializing.
- *
- * @param elem The element to serialize
- * @throws IOException An I/O exception occured while
- * serializing
- */
- public void serialize( Element elem )
- throws IOException;
-
-
- /**
- * Serializes the DOM document. Throws an exception only if
- * an I/O exception occured while serializing.
- *
- * @param doc The document to serialize
- * @throws IOException An I/O exception occured while
- * serializing
- */
- public void serialize( Document doc )
- throws IOException;
-
-
- /**
- * Serializes the DOM document fragment. Throws an exception
- * only if an I/O exception occured while serializing.
- *
- * @param frag The document fragment to serialize
- * @throws IOException An I/O exception occured while
- * serializing
- */
- public void serialize( DocumentFragment frag )
- throws IOException;
-
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/serialize/DOMSerializerImpl.java b/src/com/sun/org/apache/xml/internal/serialize/DOMSerializerImpl.java
deleted file mode 100644
index 8f14d74..0000000
--- a/src/com/sun/org/apache/xml/internal/serialize/DOMSerializerImpl.java
+++ /dev/null
@@ -1,1205 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xml.internal.serialize;
-
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.StringWriter;
-import java.io.UnsupportedEncodingException;
-import java.io.Writer;
-import java.lang.reflect.Method;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.net.URLConnection;
-import java.util.StringTokenizer;
-import java.util.Vector;
-
-import com.sun.org.apache.xerces.internal.dom.AbortException;
-import com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl;
-import com.sun.org.apache.xerces.internal.dom.DOMErrorImpl;
-import com.sun.org.apache.xerces.internal.dom.DOMLocatorImpl;
-import com.sun.org.apache.xerces.internal.dom.DOMMessageFormatter;
-import com.sun.org.apache.xerces.internal.dom.DOMNormalizer;
-import com.sun.org.apache.xerces.internal.dom.DOMStringListImpl;
-import org.w3c.dom.DOMConfiguration;
-import org.w3c.dom.DOMError;
-import org.w3c.dom.DOMErrorHandler;
-import org.w3c.dom.DOMStringList;
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.XMLEntityManager;
-import com.sun.org.apache.xerces.internal.util.DOMUtil;
-import com.sun.org.apache.xerces.internal.util.NamespaceSupport;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.util.XML11Char;
-import com.sun.org.apache.xerces.internal.util.XMLChar;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Comment;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.ProcessingInstruction;
-import org.w3c.dom.ls.LSException;
-import org.w3c.dom.ls.LSOutput;
-import org.w3c.dom.ls.LSSerializer;
-import org.w3c.dom.ls.LSSerializerFilter;
-
-
-/**
- * EXPERIMENTAL: Implemenatation of DOM Level 3 org.w3c.ls.LSSerializer by delegating serialization
- * calls to <CODE>XMLSerializer</CODE>.
- * LSSerializer provides an API for serializing (writing) a DOM document out in an
- * XML document. The XML data is written to an output stream.
- * During serialization of XML data, namespace fixup is done when possible as
- * defined in DOM Level 3 Core, Appendix B.
- *
- * @author Elena Litani, IBM
- * @author Gopal Sharma, Sun Microsystems
- * @author Arun Yadav, Sun Microsystems
- * @author Sunitha Reddy, Sun Microsystems
- * @version $Id: DOMSerializerImpl.java,v 1.11 2010-11-01 04:40:36 joehw Exp $
- */
-public class DOMSerializerImpl implements LSSerializer, DOMConfiguration {
-
- // TODO: When DOM Level 3 goes to REC replace method calls using
- // reflection for: getXmlEncoding, getInputEncoding and getXmlEncoding
- // with regular static calls on the Document object.
-
- // data
- // serializer
- private XMLSerializer serializer;
-
- // XML 1.1 serializer
- private XML11Serializer xml11Serializer;
-
- //Recognized parameters
- private DOMStringList fRecognizedParameters;
-
- /** REVISIT: Currently we handle 3 different configurations, would be nice just have one configuration
- * that has different recognized parameters depending if it is used in Core/LS.
- */
- protected short features = 0;
-
- protected final static short NAMESPACES = 0x1<<0;
- protected final static short WELLFORMED = 0x1<<1;
- protected final static short ENTITIES = 0x1<<2;
- protected final static short CDATA = 0x1<<3;
- protected final static short SPLITCDATA = 0x1<<4;
- protected final static short COMMENTS = 0x1<<5;
- protected final static short DISCARDDEFAULT = 0x1<<6;
- protected final static short INFOSET = 0x1<<7;
- protected final static short XMLDECL = 0x1<<8;
- protected final static short NSDECL = 0x1<<9;
- protected final static short DOM_ELEMENT_CONTENT_WHITESPACE = 0x1<<10;
- protected final static short FORMAT_PRETTY_PRINT = 0x1<<11;
-
- // well-formness checking
- private DOMErrorHandler fErrorHandler = null;
- private final DOMErrorImpl fError = new DOMErrorImpl();
- private final DOMLocatorImpl fLocator = new DOMLocatorImpl();
-
- /**
- * Constructs a new LSSerializer.
- * The constructor turns on the namespace support in <code>XMLSerializer</code> and
- * initializes the following fields: fNSBinder, fLocalNSBinder, fSymbolTable,
- * fEmptySymbol, fXmlSymbol, fXmlnsSymbol, fNamespaceCounter, fFeatures.
- */
- public DOMSerializerImpl() {
- // set default features
- features |= NAMESPACES;
- features |= ENTITIES;
- features |= COMMENTS;
- features |= CDATA;
- features |= SPLITCDATA;
- features |= WELLFORMED;
- features |= NSDECL;
- features |= DOM_ELEMENT_CONTENT_WHITESPACE;
- features |= DISCARDDEFAULT;
- features |= XMLDECL;
-
- serializer = new XMLSerializer();
- initSerializer(serializer);
- }
-
-
-
- //
- // LSSerializer methods
- //
-
- public DOMConfiguration getDomConfig(){
- return this;
- }
-
- /** DOM L3-EXPERIMENTAL:
- * Setter for boolean and object parameters
- */
- public void setParameter(String name, Object value) throws DOMException {
- if (value instanceof Boolean) {
- boolean state = ((Boolean) value).booleanValue();
- if (name.equalsIgnoreCase(Constants.DOM_INFOSET)){
- if (state){
- features &= ~ENTITIES;
- features &= ~CDATA;
- features |= NAMESPACES;
- features |= NSDECL;
- features |= WELLFORMED;
- features |= COMMENTS;
- }
- // false does not have any effect
- } else if (name.equalsIgnoreCase(Constants.DOM_XMLDECL)) {
- features =
- (short) (state ? features | XMLDECL : features & ~XMLDECL);
- } else if (name.equalsIgnoreCase(Constants.DOM_NAMESPACES)) {
- features =
- (short) (state
- ? features | NAMESPACES
- : features & ~NAMESPACES);
- serializer.fNamespaces = state;
- } else if (name.equalsIgnoreCase(Constants.DOM_SPLIT_CDATA)) {
- features =
- (short) (state
- ? features | SPLITCDATA
- : features & ~SPLITCDATA);
- } else if (name.equalsIgnoreCase(Constants.DOM_DISCARD_DEFAULT_CONTENT)) {
- features =
- (short) (state
- ? features | DISCARDDEFAULT
- : features & ~DISCARDDEFAULT);
- } else if (name.equalsIgnoreCase(Constants.DOM_WELLFORMED)) {
- features =
- (short) (state
- ? features | WELLFORMED
- : features & ~WELLFORMED);
- } else if (name.equalsIgnoreCase(Constants.DOM_ENTITIES)){
- features =
- (short) (state
- ? features | ENTITIES
- : features & ~ENTITIES);
- }
- else if (name.equalsIgnoreCase(Constants.DOM_CDATA_SECTIONS)){
- features =
- (short) (state
- ? features | CDATA
- : features & ~CDATA);
- }
- else if (name.equalsIgnoreCase(Constants.DOM_COMMENTS)){
- features =
- (short) (state
- ? features | COMMENTS
- : features & ~COMMENTS);
- }
- else if (name.equalsIgnoreCase(Constants.DOM_FORMAT_PRETTY_PRINT)){
- features =
- (short) (state
- ? features | FORMAT_PRETTY_PRINT
- : features & ~FORMAT_PRETTY_PRINT);
- }
- else if (name.equalsIgnoreCase(Constants.DOM_CANONICAL_FORM)
- || name.equalsIgnoreCase(Constants.DOM_VALIDATE_IF_SCHEMA)
- || name.equalsIgnoreCase(Constants.DOM_VALIDATE)
- || name.equalsIgnoreCase(Constants.DOM_CHECK_CHAR_NORMALIZATION)
- || name.equalsIgnoreCase(Constants.DOM_DATATYPE_NORMALIZATION)) {
- // || name.equalsIgnoreCase(Constants.DOM_NORMALIZE_CHARACTERS)) {
- // true is not supported
- if (state) {
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "FEATURE_NOT_SUPPORTED",
- new Object[] { name });
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
- }
- }else if (
- name.equalsIgnoreCase(Constants.DOM_NAMESPACE_DECLARATIONS)) {
- //namespace-declaration has effect only if namespaces is true
- features =
- (short) (state
- ? features | NSDECL
- : features & ~NSDECL);
- serializer.fNamespacePrefixes = state;
- } else if (name.equalsIgnoreCase(Constants.DOM_ELEMENT_CONTENT_WHITESPACE)
- || name.equalsIgnoreCase(Constants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS)) {
- // false is not supported
- if (!state) {
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "FEATURE_NOT_SUPPORTED",
- new Object[] { name });
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
- }
- } else {
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "FEATURE_NOT_FOUND",
- new Object[] { name });
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
- }
- } else if (name.equalsIgnoreCase(Constants.DOM_ERROR_HANDLER)) {
- if (value == null || value instanceof DOMErrorHandler) {
- fErrorHandler = (DOMErrorHandler)value;
- } else {
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "TYPE_MISMATCH_ERR",
- new Object[] { name });
- throw new DOMException(DOMException.TYPE_MISMATCH_ERR, msg);
- }
- } else if (
- name.equalsIgnoreCase(Constants.DOM_RESOURCE_RESOLVER)
- || name.equalsIgnoreCase(Constants.DOM_SCHEMA_LOCATION)
- || name.equalsIgnoreCase(Constants.DOM_SCHEMA_TYPE)
- || name.equalsIgnoreCase(Constants.DOM_NORMALIZE_CHARACTERS)
- && value != null) {
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "FEATURE_NOT_SUPPORTED",
- new Object[] { name });
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
- } else {
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "FEATURE_NOT_FOUND",
- new Object[] { name });
- throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
- }
- }
-
- /** DOM L3-EXPERIMENTAL:
- * Check if parameter can be set
- */
- public boolean canSetParameter(String name, Object state) {
-
- if (state == null) {
- return true;
- }
-
- if (state instanceof Boolean) {
- boolean value = ((Boolean) state).booleanValue();
-
- if (name.equalsIgnoreCase(Constants.DOM_NAMESPACES)
- || name.equalsIgnoreCase(Constants.DOM_SPLIT_CDATA)
- || name.equalsIgnoreCase(Constants.DOM_DISCARD_DEFAULT_CONTENT)
- || name.equalsIgnoreCase(Constants.DOM_XMLDECL)
- || name.equalsIgnoreCase(Constants.DOM_WELLFORMED)
- || name.equalsIgnoreCase(Constants.DOM_INFOSET)
- || name.equalsIgnoreCase(Constants.DOM_ENTITIES)
- || name.equalsIgnoreCase(Constants.DOM_CDATA_SECTIONS)
- || name.equalsIgnoreCase(Constants.DOM_COMMENTS)
- || name.equalsIgnoreCase(Constants.DOM_NAMESPACE_DECLARATIONS)
- || name.equalsIgnoreCase(Constants.DOM_FORMAT_PRETTY_PRINT)) {
- // both values supported
- return true;
- } else if (name.equalsIgnoreCase(Constants.DOM_CANONICAL_FORM)
- || name.equalsIgnoreCase(Constants.DOM_VALIDATE_IF_SCHEMA)
- || name.equalsIgnoreCase(Constants.DOM_VALIDATE)
- || name.equalsIgnoreCase(Constants.DOM_CHECK_CHAR_NORMALIZATION)
- || name.equalsIgnoreCase(Constants.DOM_DATATYPE_NORMALIZATION)) {
- // || name.equalsIgnoreCase(Constants.DOM_NORMALIZE_CHARACTERS)) {
- // true is not supported
- return !value;
- } else if (name.equalsIgnoreCase(Constants.DOM_ELEMENT_CONTENT_WHITESPACE)
- || name.equalsIgnoreCase(Constants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS)) {
- // false is not supported
- return value;
- }
- } else if (name.equalsIgnoreCase(Constants.DOM_ERROR_HANDLER) &&
- state == null || state instanceof DOMErrorHandler) {
- return true;
- }
-
- return false;
- }
-
- /**
- * DOM Level 3 Core CR - Experimental.
- *
- * The list of the parameters supported by this
- * <code>DOMConfiguration</code> object and for which at least one value
- * can be set by the application. Note that this list can also contain
- * parameter names defined outside this specification.
- */
- public DOMStringList getParameterNames() {
-
- if (fRecognizedParameters == null){
- Vector parameters = new Vector();
-
- //Add DOM recognized parameters
- //REVISIT: Would have been nice to have a list of
- //recognized parameters.
- parameters.add(Constants.DOM_NAMESPACES);
- parameters.add(Constants.DOM_SPLIT_CDATA);
- parameters.add(Constants.DOM_DISCARD_DEFAULT_CONTENT);
- parameters.add(Constants.DOM_XMLDECL);
- parameters.add(Constants.DOM_CANONICAL_FORM);
- parameters.add(Constants.DOM_VALIDATE_IF_SCHEMA);
- parameters.add(Constants.DOM_VALIDATE);
- parameters.add(Constants.DOM_CHECK_CHAR_NORMALIZATION);
- parameters.add(Constants.DOM_DATATYPE_NORMALIZATION);
- parameters.add(Constants.DOM_FORMAT_PRETTY_PRINT);
- //parameters.add(Constants.DOM_NORMALIZE_CHARACTERS);
- parameters.add(Constants.DOM_WELLFORMED);
- parameters.add(Constants.DOM_INFOSET);
- parameters.add(Constants.DOM_NAMESPACE_DECLARATIONS);
- parameters.add(Constants.DOM_ELEMENT_CONTENT_WHITESPACE);
- parameters.add(Constants.DOM_ENTITIES);
- parameters.add(Constants.DOM_CDATA_SECTIONS);
- parameters.add(Constants.DOM_COMMENTS);
- parameters.add(Constants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS);
- parameters.add(Constants.DOM_ERROR_HANDLER);
- //parameters.add(Constants.DOM_SCHEMA_LOCATION);
- //parameters.add(Constants.DOM_SCHEMA_TYPE);
-
- //Add recognized xerces features and properties
-
- fRecognizedParameters = new DOMStringListImpl(parameters);
-
- }
-
- return fRecognizedParameters;
- }
-
- /** DOM L3-EXPERIMENTAL:
- * Getter for boolean and object parameters
- */
- public Object getParameter(String name) throws DOMException {
-
- if(name.equalsIgnoreCase(Constants.DOM_NORMALIZE_CHARACTERS)){
- return null;
- } else if (name.equalsIgnoreCase(Constants.DOM_COMMENTS)) {
- return ((features & COMMENTS) != 0) ? Boolean.TRUE : Boolean.FALSE;
- } else if (name.equalsIgnoreCase(Constants.DOM_NAMESPACES)) {
- return (features & NAMESPACES) != 0 ? Boolean.TRUE : Boolean.FALSE;
- } else if (name.equalsIgnoreCase(Constants.DOM_XMLDECL)) {
- return (features & XMLDECL) != 0 ? Boolean.TRUE : Boolean.FALSE;
- } else if (name.equalsIgnoreCase(Constants.DOM_CDATA_SECTIONS)) {
- return (features & CDATA) != 0 ? Boolean.TRUE : Boolean.FALSE;
- } else if (name.equalsIgnoreCase(Constants.DOM_ENTITIES)) {
- return (features & ENTITIES) != 0 ? Boolean.TRUE : Boolean.FALSE;
- } else if (name.equalsIgnoreCase(Constants.DOM_SPLIT_CDATA)) {
- return (features & SPLITCDATA) != 0 ? Boolean.TRUE : Boolean.FALSE;
- } else if (name.equalsIgnoreCase(Constants.DOM_WELLFORMED)) {
- return (features & WELLFORMED) != 0 ? Boolean.TRUE : Boolean.FALSE;
- } else if (name.equalsIgnoreCase(Constants.DOM_NAMESPACE_DECLARATIONS)) {
- return (features & NSDECL) != 0 ? Boolean.TRUE : Boolean.FALSE;
- } else if (name.equalsIgnoreCase(Constants.DOM_FORMAT_PRETTY_PRINT)) {
- return (features & FORMAT_PRETTY_PRINT) != 0 ? Boolean.TRUE : Boolean.FALSE;
- } else if (name.equalsIgnoreCase(Constants.DOM_ELEMENT_CONTENT_WHITESPACE) ||
- name.equalsIgnoreCase(Constants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS)) {
- return Boolean.TRUE;
- }else if (name.equalsIgnoreCase(Constants.DOM_DISCARD_DEFAULT_CONTENT)){
- return ((features & DISCARDDEFAULT)!=0)?Boolean.TRUE:Boolean.FALSE;
- }else if (name.equalsIgnoreCase(Constants.DOM_INFOSET)){
- if ((features & ENTITIES) == 0 &&
- (features & CDATA) == 0 &&
- (features & NAMESPACES) != 0 &&
- (features & NSDECL) != 0 &&
- (features & WELLFORMED) != 0 &&
- (features & COMMENTS) != 0) {
- return Boolean.TRUE;
- }
- return Boolean.FALSE;
- } else if (name.equalsIgnoreCase(Constants.DOM_CANONICAL_FORM)
- || name.equalsIgnoreCase(Constants.DOM_VALIDATE_IF_SCHEMA)
- || name.equalsIgnoreCase(Constants.DOM_CHECK_CHAR_NORMALIZATION)
- || name.equalsIgnoreCase(Constants.DOM_VALIDATE)
- || name.equalsIgnoreCase(Constants.DOM_VALIDATE_IF_SCHEMA)
- || name.equalsIgnoreCase(Constants.DOM_DATATYPE_NORMALIZATION)) {
- return Boolean.FALSE;
- } else if (name.equalsIgnoreCase(Constants.DOM_ERROR_HANDLER)) {
- return fErrorHandler;
- } else if (
- name.equalsIgnoreCase(Constants.DOM_RESOURCE_RESOLVER)
- || name.equalsIgnoreCase(Constants.DOM_SCHEMA_LOCATION)
- || name.equalsIgnoreCase(Constants.DOM_SCHEMA_TYPE)) {
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "FEATURE_NOT_SUPPORTED",
- new Object[] { name });
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
- } else {
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "FEATURE_NOT_FOUND",
- new Object[] { name });
- throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
- }
- }
-
-
- /**
- * DOM L3 EXPERIMENTAL:
- * Serialize the specified node as described above in the description of
- * <code>LSSerializer</code>. The result of serializing the node is
- * returned as a string. Writing a Document or Entity node produces a
- * serialized form that is well formed XML. Writing other node types
- * produces a fragment of text in a form that is not fully defined by
- * this document, but that should be useful to a human for debugging or
- * diagnostic purposes.
- * @param wnode The node to be written.
- * @return Returns the serialized data
- * @exception DOMException
- * DOMSTRING_SIZE_ERR: The resulting string is too long to fit in a
- * <code>DOMString</code>.
- * @exception LSException
- * SERIALIZE_ERR: Unable to serialize the node. DOM applications should
- * attach a <code>DOMErrorHandler</code> using the parameter
- * &quot;<i>error-handler</i>&quot; to get details on error.
- */
- public String writeToString(Node wnode) throws DOMException, LSException {
- // determine which serializer to use:
- Document doc = (wnode.getNodeType() == Node.DOCUMENT_NODE)?(Document)wnode:wnode.getOwnerDocument();
- Method getVersion = null;
- XMLSerializer ser = null;
- String ver = null;
- // this should run under JDK 1.1.8...
- try {
- getVersion = doc.getClass().getMethod("getXmlVersion", new Class[]{});
- if(getVersion != null ) {
- ver = (String)getVersion.invoke(doc, (Object[]) null);
- }
- } catch (Exception e) {
- // no way to test the version...
- // ignore the exception
- }
- if(ver != null && ver.equals("1.1")) {
- if(xml11Serializer == null) {
- xml11Serializer = new XML11Serializer();
- initSerializer(xml11Serializer);
- }
- // copy setting from "main" serializer to XML 1.1 serializer
- copySettings(serializer, xml11Serializer);
- ser = xml11Serializer;
- } else {
- ser = serializer;
- }
-
- StringWriter destination = new StringWriter();
- try {
- prepareForSerialization(ser, wnode);
- ser._format.setEncoding("UTF-16");
- ser.setOutputCharStream(destination);
- if (wnode.getNodeType() == Node.DOCUMENT_NODE) {
- ser.serialize((Document)wnode);
- }
- else if (wnode.getNodeType() == Node.DOCUMENT_FRAGMENT_NODE) {
- ser.serialize((DocumentFragment)wnode);
- }
- else if (wnode.getNodeType() == Node.ELEMENT_NODE) {
- ser.serialize((Element)wnode);
- }
- else if (wnode.getNodeType() == Node.TEXT_NODE ||
- wnode.getNodeType() == Node.COMMENT_NODE ||
- wnode.getNodeType() == Node.ENTITY_REFERENCE_NODE ||
- wnode.getNodeType() == Node.CDATA_SECTION_NODE ||
- wnode.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE ) {
- ser.serialize(wnode);
- }
- else {
- String msg = DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.SERIALIZER_DOMAIN,
- "unable-to-serialize-node", null);
- if (ser.fDOMErrorHandler != null) {
- DOMErrorImpl error = new DOMErrorImpl();
- error.fType = "unable-to-serialize-node";
- error.fMessage = msg;
- error.fSeverity = DOMError.SEVERITY_FATAL_ERROR;
- ser.fDOMErrorHandler.handleError(error);
- }
- throw new LSException(LSException.SERIALIZE_ERR, msg);
- }
- } catch (LSException lse) {
- // Rethrow LSException.
- throw lse;
- } catch (AbortException e) {
- return null;
- } catch (RuntimeException e) {
- throw (LSException) new LSException(LSException.SERIALIZE_ERR, e.toString()).initCause(e);
- } catch (IOException ioe) {
- // REVISIT: A generic IOException doesn't provide enough information
- // to determine that the serialized document is too large to fit
- // into a string. This could have thrown for some other reason. -- mrglavas
- String msg = DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "STRING_TOO_LONG",
- new Object[] { ioe.getMessage()});
- throw (DOMException) new DOMException(DOMException.DOMSTRING_SIZE_ERR, msg).initCause(ioe);
- }
-
- return destination.toString();
- }
-
- /**
- * DOM L3 EXPERIMENTAL:
- * The end-of-line sequence of characters to be used in the XML being
- * written out. The only permitted values are these:
- * <dl>
- * <dt><code>null</code></dt>
- * <dd>
- * Use a default end-of-line sequence. DOM implementations should choose
- * the default to match the usual convention for text files in the
- * environment being used. Implementations must choose a default
- * sequence that matches one of those allowed by 2.11 "End-of-Line
- * Handling". </dd>
- * <dt>CR</dt>
- * <dd>The carriage-return character (#xD).</dd>
- * <dt>CR-LF</dt>
- * <dd> The
- * carriage-return and line-feed characters (#xD #xA). </dd>
- * <dt>LF</dt>
- * <dd> The line-feed
- * character (#xA). </dd>
- * </dl>
- * <br>The default value for this attribute is <code>null</code>.
- */
- public void setNewLine(String newLine) {
- serializer._format.setLineSeparator(newLine);
- }
-
-
- /**
- * DOM L3 EXPERIMENTAL:
- * The end-of-line sequence of characters to be used in the XML being
- * written out. The only permitted values are these:
- * <dl>
- * <dt><code>null</code></dt>
- * <dd>
- * Use a default end-of-line sequence. DOM implementations should choose
- * the default to match the usual convention for text files in the
- * environment being used. Implementations must choose a default
- * sequence that matches one of those allowed by 2.11 "End-of-Line
- * Handling". </dd>
- * <dt>CR</dt>
- * <dd>The carriage-return character (#xD).</dd>
- * <dt>CR-LF</dt>
- * <dd> The
- * carriage-return and line-feed characters (#xD #xA). </dd>
- * <dt>LF</dt>
- * <dd> The line-feed
- * character (#xA). </dd>
- * </dl>
- * <br>The default value for this attribute is <code>null</code>.
- */
- public String getNewLine() {
- return serializer._format.getLineSeparator();
- }
-
-
- /**
- * When the application provides a filter, the serializer will call out
- * to the filter before serializing each Node. Attribute nodes are never
- * passed to the filter. The filter implementation can choose to remove
- * the node from the stream or to terminate the serialization early.
- */
- public LSSerializerFilter getFilter(){
- return serializer.fDOMFilter;
- }
- /**
- * When the application provides a filter, the serializer will call out
- * to the filter before serializing each Node. Attribute nodes are never
- * passed to the filter. The filter implementation can choose to remove
- * the node from the stream or to terminate the serialization early.
- */
- public void setFilter(LSSerializerFilter filter){
- serializer.fDOMFilter = filter;
- }
-
- // this initializes a newly-created serializer
- private void initSerializer(XMLSerializer ser) {
- ser.fNSBinder = new NamespaceSupport();
- ser.fLocalNSBinder = new NamespaceSupport();
- ser.fSymbolTable = new SymbolTable();
- }
-
- // copies all settings that could have been modified
- // by calls to LSSerializer methods from one serializer to another.
- // IMPORTANT: if new methods are implemented or more settings of
- // the serializer are made alterable, this must be
- // reflected in this method!
- private void copySettings(XMLSerializer src, XMLSerializer dest) {
- dest.fDOMErrorHandler = fErrorHandler;
- dest._format.setEncoding(src._format.getEncoding());
- dest._format.setLineSeparator(src._format.getLineSeparator());
- dest.fDOMFilter = src.fDOMFilter;
- }//copysettings
-
- /**
- * Serialize the specified node as described above in the general
- * description of the <code>LSSerializer</code> interface. The output
- * is written to the supplied <code>LSOutput</code>.
- * <br> When writing to a <code>LSOutput</code>, the encoding is found by
- * looking at the encoding information that is reachable through the
- * <code>LSOutput</code> and the item to be written (or its owner
- * document) in this order:
- * <ol>
- * <li> <code>LSOutput.encoding</code>,
- * </li>
- * <li>
- * <code>Document.actualEncoding</code>,
- * </li>
- * <li>
- * <code>Document.xmlEncoding</code>.
- * </li>
- * </ol>
- * <br> If no encoding is reachable through the above properties, a
- * default encoding of "UTF-8" will be used.
- * <br> If the specified encoding is not supported an
- * "unsupported-encoding" error is raised.
- * <br> If no output is specified in the <code>LSOutput</code>, a
- * "no-output-specified" error is raised.
- * @param node The node to serialize.
- * @param destination The destination for the serialized DOM.
- * @return Returns <code>true</code> if <code>node</code> was
- * successfully serialized and <code>false</code> in case the node
- * couldn't be serialized.
- */
- public boolean write(Node node, LSOutput destination) throws LSException{
-
- if (node == null)
- return false;
-
- Method getVersion = null;
- XMLSerializer ser = null;
- String ver = null;
- Document fDocument =(node.getNodeType() == Node.DOCUMENT_NODE)
- ? (Document) node
- : node.getOwnerDocument();
- // this should run under JDK 1.1.8...
- try {
- getVersion = fDocument.getClass().getMethod("getXmlVersion", new Class[] {});
- if (getVersion != null) {
- ver = (String) getVersion.invoke(fDocument, (Object[]) null);
- }
- } catch (Exception e) {
- //no way to test the version...
- //ignore the exception
- }
- //determine which serializer to use:
- if (ver != null && ver.equals("1.1")) {
- if (xml11Serializer == null) {
- xml11Serializer = new XML11Serializer();
- initSerializer(xml11Serializer);
- }
- //copy setting from "main" serializer to XML 1.1 serializer
- copySettings(serializer, xml11Serializer);
- ser = xml11Serializer;
- } else {
- ser = serializer;
- }
-
- String encoding = null;
- if ((encoding = destination.getEncoding()) == null) {
- try {
- Method getEncoding =
- fDocument.getClass().getMethod("getInputEncoding", new Class[] {});
- if (getEncoding != null) {
- encoding = (String) getEncoding.invoke(fDocument, (Object[]) null);
- }
- } catch (Exception e) {
- // ignore the exception
- }
- if (encoding == null) {
- try {
- Method getEncoding =
- fDocument.getClass().getMethod("getXmlEncoding", new Class[] {});
- if (getEncoding != null) {
- encoding = (String) getEncoding.invoke(fDocument, (Object[]) null);
- }
- } catch (Exception e) {
- // ignore the exception
- }
- if (encoding == null) {
- encoding = "UTF-8";
- }
- }
- }
- try {
- prepareForSerialization(ser, node);
- ser._format.setEncoding(encoding);
- OutputStream outputStream = destination.getByteStream();
- Writer writer = destination.getCharacterStream();
- String uri = destination.getSystemId();
- if (writer == null) {
- if (outputStream == null) {
- if (uri == null) {
- String msg = DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.SERIALIZER_DOMAIN,
- "no-output-specified", null);
- if (ser.fDOMErrorHandler != null) {
- DOMErrorImpl error = new DOMErrorImpl();
- error.fType = "no-output-specified";
- error.fMessage = msg;
- error.fSeverity = DOMError.SEVERITY_FATAL_ERROR;
- ser.fDOMErrorHandler.handleError(error);
- }
- throw new LSException(LSException.SERIALIZE_ERR, msg);
- }
- else {
- // URI was specified. Handle relative URIs.
- String expanded = XMLEntityManager.expandSystemId(uri, null, true);
- URL url = new URL(expanded != null ? expanded : uri);
- OutputStream out = null;
- String protocol = url.getProtocol();
- String host = url.getHost();
- // Use FileOutputStream if this URI is for a local file.
- if (protocol.equals("file")
- && (host == null || host.length() == 0 || host.equals("localhost"))) {
- out = new FileOutputStream(getPathWithoutEscapes(url.getFile()));
- }
- // Try to write to some other kind of URI. Some protocols
- // won't support this, though HTTP should work.
- else {
- URLConnection urlCon = url.openConnection();
- urlCon.setDoInput(false);
- urlCon.setDoOutput(true);
- urlCon.setUseCaches(false); // Enable tunneling.
- if (urlCon instanceof HttpURLConnection) {
- // The DOM L3 LS CR says if we are writing to an HTTP URI
- // it is to be done with an HTTP PUT.
- HttpURLConnection httpCon = (HttpURLConnection) urlCon;
- httpCon.setRequestMethod("PUT");
- }
- out = urlCon.getOutputStream();
- }
- ser.setOutputByteStream(out);
- }
- }
- else {
- // byte stream was specified
- ser.setOutputByteStream(outputStream);
- }
- }
- else {
- // character stream is specified
- ser.setOutputCharStream(writer);
- }
-
- if (node.getNodeType() == Node.DOCUMENT_NODE)
- ser.serialize((Document) node);
- else if (node.getNodeType() == Node.DOCUMENT_FRAGMENT_NODE)
- ser.serialize((DocumentFragment) node);
- else if (node.getNodeType() == Node.ELEMENT_NODE)
- ser.serialize((Element) node);
- else if (node.getNodeType() == Node.TEXT_NODE ||
- node.getNodeType() == Node.COMMENT_NODE ||
- node.getNodeType() == Node.ENTITY_REFERENCE_NODE ||
- node.getNodeType() == Node.CDATA_SECTION_NODE ||
- node.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE ) {
- ser.serialize(node);
- }
- else
- return false;
- } catch( UnsupportedEncodingException ue) {
- if (ser.fDOMErrorHandler != null) {
- DOMErrorImpl error = new DOMErrorImpl();
- error.fException = ue;
- error.fType = "unsupported-encoding";
- error.fMessage = ue.getMessage();
- error.fSeverity = DOMError.SEVERITY_FATAL_ERROR;
- ser.fDOMErrorHandler.handleError(error);
- }
- throw new LSException(LSException.SERIALIZE_ERR,
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.SERIALIZER_DOMAIN,
- "unsupported-encoding", null));
- //return false;
- } catch (LSException lse) {
- // Rethrow LSException.
- throw lse;
- } catch (AbortException e) {
- return false;
- } catch (RuntimeException e) {
- throw (LSException) DOMUtil.createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace();
- } catch (Exception e) {
- if (ser.fDOMErrorHandler != null) {
- DOMErrorImpl error = new DOMErrorImpl();
- error.fException = e;
- error.fMessage = e.getMessage();
- error.fSeverity = DOMError.SEVERITY_ERROR;
- ser.fDOMErrorHandler.handleError(error);
-
- }
- throw (LSException) DOMUtil.createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace();
- }
- return true;
-
- } //write
-
- /**
- * Serialize the specified node as described above in the general
- * description of the <code>LSSerializer</code> interface. The output
- * is written to the supplied URI.
- * <br> When writing to a URI, the encoding is found by looking at the
- * encoding information that is reachable through the item to be written
- * (or its owner document) in this order:
- * <ol>
- * <li>
- * <code>Document.inputEncoding</code>,
- * </li>
- * <li>
- * <code>Document.xmlEncoding</code>.
- * </li>
- * </ol>
- * <br> If no encoding is reachable through the above properties, a
- * default encoding of "UTF-8" will be used.
- * <br> If the specified encoding is not supported an
- * "unsupported-encoding" error is raised.
- * @param node The node to serialize.
- * @param URI The URI to write to.
- * @return Returns <code>true</code> if <code>node</code> was
- * successfully serialized and <code>false</code> in case the node
- * couldn't be serialized.
- */
- public boolean writeToURI(Node node, String URI) throws LSException{
- if (node == null){
- return false;
- }
-
- Method getXmlVersion = null;
- XMLSerializer ser = null;
- String ver = null;
- String encoding = null;
-
- Document fDocument =(node.getNodeType() == Node.DOCUMENT_NODE)
- ? (Document) node
- : node.getOwnerDocument();
- // this should run under JDK 1.1.8...
- try {
- getXmlVersion =
- fDocument.getClass().getMethod("getXmlVersion", new Class[] {});
- if (getXmlVersion != null) {
- ver = (String) getXmlVersion.invoke(fDocument, (Object[]) null);
- }
- } catch (Exception e) {
- // no way to test the version...
- // ignore the exception
- }
- if (ver != null && ver.equals("1.1")) {
- if (xml11Serializer == null) {
- xml11Serializer = new XML11Serializer();
- initSerializer(xml11Serializer);
- }
- // copy setting from "main" serializer to XML 1.1 serializer
- copySettings(serializer, xml11Serializer);
- ser = xml11Serializer;
- } else {
- ser = serializer;
- }
-
- try {
- Method getEncoding =
- fDocument.getClass().getMethod("getInputEncoding", new Class[] {});
- if (getEncoding != null) {
- encoding = (String) getEncoding.invoke(fDocument, (Object[]) null);
- }
- } catch (Exception e) {
- // ignore the exception
- }
- if (encoding == null) {
- try {
- Method getEncoding =
- fDocument.getClass().getMethod("getXmlEncoding", new Class[] {});
- if (getEncoding != null) {
- encoding = (String) getEncoding.invoke(fDocument, (Object[]) null);
- }
- } catch (Exception e) {
- // ignore the exception
- }
- if (encoding == null) {
- encoding = "UTF-8";
- }
- }
-
- try {
- prepareForSerialization(ser, node);
- ser._format.setEncoding(encoding);
-
- // URI was specified. Handle relative URIs.
- String expanded = XMLEntityManager.expandSystemId(URI, null, true);
- URL url = new URL(expanded != null ? expanded : URI);
- OutputStream out = null;
- String protocol = url.getProtocol();
- String host = url.getHost();
- // Use FileOutputStream if this URI is for a local file.
- if (protocol.equals("file")
- && (host == null || host.length() == 0 || host.equals("localhost"))) {
- out = new FileOutputStream(getPathWithoutEscapes(url.getFile()));
- }
- // Try to write to some other kind of URI. Some protocols
- // won't support this, though HTTP should work.
- else {
- URLConnection urlCon = url.openConnection();
- urlCon.setDoInput(false);
- urlCon.setDoOutput(true);
- urlCon.setUseCaches(false); // Enable tunneling.
- if (urlCon instanceof HttpURLConnection) {
- // The DOM L3 LS CR says if we are writing to an HTTP URI
- // it is to be done with an HTTP PUT.
- HttpURLConnection httpCon = (HttpURLConnection) urlCon;
- httpCon.setRequestMethod("PUT");
- }
- out = urlCon.getOutputStream();
- }
- ser.setOutputByteStream(out);
-
- if (node.getNodeType() == Node.DOCUMENT_NODE)
- ser.serialize((Document) node);
- else if (node.getNodeType() == Node.DOCUMENT_FRAGMENT_NODE)
- ser.serialize((DocumentFragment) node);
- else if (node.getNodeType() == Node.ELEMENT_NODE)
- ser.serialize((Element) node);
- else if (node.getNodeType() == Node.TEXT_NODE ||
- node.getNodeType() == Node.COMMENT_NODE ||
- node.getNodeType() == Node.ENTITY_REFERENCE_NODE ||
- node.getNodeType() == Node.CDATA_SECTION_NODE ||
- node.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE ) {
- ser.serialize(node);
- }
- else
- return false;
- } catch (LSException lse) {
- // Rethrow LSException.
- throw lse;
- } catch (AbortException e) {
- return false;
- } catch (RuntimeException e) {
- throw (LSException) DOMUtil.createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace();
- } catch (Exception e) {
- if (ser.fDOMErrorHandler != null) {
- DOMErrorImpl error = new DOMErrorImpl();
- error.fException = e;
- error.fMessage = e.getMessage();
- error.fSeverity = DOMError.SEVERITY_ERROR;
- ser.fDOMErrorHandler.handleError(error);
- }
- throw (LSException) DOMUtil.createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace();
- }
- return true;
- } //writeURI
-
-
- //
- // Private methods
- //
-
- private void prepareForSerialization(XMLSerializer ser, Node node) {
- ser.reset();
- ser.features = features;
- ser.fDOMErrorHandler = fErrorHandler;
- ser.fNamespaces = (features & NAMESPACES) != 0;
- ser.fNamespacePrefixes = (features & NSDECL) != 0;
- ser._format.setOmitComments((features & COMMENTS)==0);
- ser._format.setOmitXMLDeclaration((features & XMLDECL) == 0);
- ser._format.setIndenting((features & FORMAT_PRETTY_PRINT) != 0);
-
- if ((features & WELLFORMED) != 0) {
- // REVISIT: this is inefficient implementation of well-formness. Instead, we should check
- // well-formness as we serialize the tree
- Node next, root;
- root = node;
- Method versionChanged;
- boolean verifyNames = true;
- Document document =(node.getNodeType() == Node.DOCUMENT_NODE)
- ? (Document) node
- : node.getOwnerDocument();
- try {
- versionChanged = document.getClass().getMethod("isXMLVersionChanged()", new Class[] {});
- if (versionChanged != null) {
- verifyNames = ((Boolean)versionChanged.invoke(document, (Object[]) null)).booleanValue();
- }
- } catch (Exception e) {
- //no way to test the version...
- //ignore the exception
- }
- if (node.getFirstChild() != null) {
- while (node != null) {
- verify(node, verifyNames, false);
- // Move down to first child
- next = node.getFirstChild();
- // No child nodes, so walk tree
- while (next == null) {
- // Move to sibling if possible.
- next = node.getNextSibling();
- if (next == null) {
- node = node.getParentNode();
- if (root == node){
- next = null;
- break;
- }
- next = node.getNextSibling();
- }
- }
- node = next;
- }
- }
- else {
- verify(node, verifyNames, false);
- }
- }
- }
-
-
- private void verify (Node node, boolean verifyNames, boolean xml11Version){
-
- int type = node.getNodeType();
- fLocator.fRelatedNode = node;
- boolean wellformed;
- switch (type) {
- case Node.DOCUMENT_NODE:{
- break;
- }
- case Node.DOCUMENT_TYPE_NODE:{
- break;
- }
- case Node.ELEMENT_NODE:{
- if (verifyNames){
- if((features & NAMESPACES) != 0){
- wellformed = CoreDocumentImpl.isValidQName(node.getPrefix() , node.getLocalName(), xml11Version) ;
- }
- else{
- wellformed = CoreDocumentImpl.isXMLName(node.getNodeName() , xml11Version);
- }
- if (!wellformed){
- if (!wellformed){
- if (fErrorHandler != null) {
- String msg = DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "wf-invalid-character-in-node-name",
- new Object[]{"Element", node.getNodeName()});
- DOMNormalizer.reportDOMError(fErrorHandler, fError, fLocator, msg, DOMError.SEVERITY_FATAL_ERROR,
- "wf-invalid-character-in-node-name");
- }
-
- }
- }
- }
-
- NamedNodeMap attributes = (node.hasAttributes()) ? node.getAttributes() : null;
- if (attributes != null) {
- for (int i = 0; i < attributes.getLength(); ++i) {
- Attr attr = (Attr) attributes.item(i);
- fLocator.fRelatedNode = attr;
- DOMNormalizer.isAttrValueWF( fErrorHandler, fError, fLocator,
- attributes, attr, attr.getValue(), xml11Version);
- if (verifyNames) {
- wellformed = CoreDocumentImpl.isXMLName( attr.getNodeName(), xml11Version);
- if (!wellformed) {
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "wf-invalid-character-in-node-name",
- new Object[] { "Attr", node.getNodeName()});
- DOMNormalizer.reportDOMError( fErrorHandler, fError, fLocator, msg, DOMError.SEVERITY_FATAL_ERROR,
- "wf-invalid-character-in-node-name");
- }
- }
- }
-
- }
-
- break;
- }
-
- case Node.COMMENT_NODE: {
- // only verify well-formness if comments included in the tree
- if ((features & COMMENTS) != 0)
- DOMNormalizer.isCommentWF(fErrorHandler, fError, fLocator, ((Comment)node).getData(), xml11Version);
- break;
- }
- case Node.ENTITY_REFERENCE_NODE: {
- // only if entity is preserved in the tree
- if (verifyNames && (features & ENTITIES) != 0){
- CoreDocumentImpl.isXMLName(node.getNodeName() , xml11Version);
- }
- break;
-
- }
- case Node.CDATA_SECTION_NODE: {
- // verify content
- DOMNormalizer.isXMLCharWF(fErrorHandler, fError, fLocator, node.getNodeValue(), xml11Version);
- // the ]]> string will be checked during serialization
- break;
- }
- case Node.TEXT_NODE:{
- DOMNormalizer.isXMLCharWF(fErrorHandler, fError, fLocator, node.getNodeValue(), xml11Version);
- break;
- }
- case Node.PROCESSING_INSTRUCTION_NODE:{
- ProcessingInstruction pinode = (ProcessingInstruction)node ;
- String target = pinode.getTarget();
- if (verifyNames) {
- if (xml11Version) {
- wellformed = XML11Char.isXML11ValidName(target);
- } else {
- wellformed = XMLChar.isValidName(target);
- }
-
- if (!wellformed) {
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "wf-invalid-character-in-node-name",
- new Object[] { "Element", node.getNodeName()});
- DOMNormalizer.reportDOMError(
- fErrorHandler,
- fError,
- fLocator,
- msg,
- DOMError.SEVERITY_FATAL_ERROR,
- "wf-invalid-character-in-node-name");
- }
- }
- DOMNormalizer.isXMLCharWF(fErrorHandler, fError, fLocator, pinode.getData(), xml11Version);
- break;
- }
- }
-
- }
-
- private String getPathWithoutEscapes(String origPath) {
- if (origPath != null && origPath.length() != 0 && origPath.indexOf('%') != -1) {
- // Locate the escape characters
- StringTokenizer tokenizer = new StringTokenizer(origPath, "%");
- StringBuffer result = new StringBuffer(origPath.length());
- int size = tokenizer.countTokens();
- result.append(tokenizer.nextToken());
- for(int i = 1; i < size; ++i) {
- String token = tokenizer.nextToken();
- // Decode the 2 digit hexadecimal number following % in '%nn'
- result.append((char)Integer.valueOf(token.substring(0, 2), 16).intValue());
- result.append(token.substring(2));
- }
- return result.toString();
- }
- return origPath;
- }
-
-}//DOMSerializerImpl
diff --git a/src/com/sun/org/apache/xml/internal/serialize/ElementState.java b/src/com/sun/org/apache/xml/internal/serialize/ElementState.java
deleted file mode 100644
index 7653a2f..0000000
--- a/src/com/sun/org/apache/xml/internal/serialize/ElementState.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package com.sun.org.apache.xml.internal.serialize;
-
-
-import java.util.Map;
-
-
-/**
- * Holds the state of the currently serialized element.
- *
- *
- * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
- * @see BaseMarkupSerializer
- */
-public class ElementState
-{
-
-
- /**
- * The element's raw tag name (local or prefix:local).
- */
- public String rawName;
-
-
- /**
- * The element's local tag name.
- */
- public String localName;
-
-
- /**
- * The element's namespace URI.
- */
- public String namespaceURI;
-
-
- /**
- * True if element is space preserving.
- */
- public boolean preserveSpace;
-
-
- /**
- * True if element is empty. Turns false immediately
- * after serializing the first contents of the element.
- */
- public boolean empty;
-
-
- /**
- * True if the last serialized node was an element node.
- */
- public boolean afterElement;
-
-
- /**
- * True if the last serialized node was a comment node.
- */
- public boolean afterComment;
-
-
- /**
- * True if textual content of current element should be
- * serialized as CDATA section.
- */
- public boolean doCData;
-
-
- /**
- * True if textual content of current element should be
- * serialized as raw characters (unescaped).
- */
- public boolean unescaped;
-
-
- /**
- * True while inside CData and printing text as CData.
- */
- public boolean inCData;
-
-
- /**
- * Association between namespace URIs (keys) and prefixes (values).
- */
- public Map<String, String> prefixes;
-
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/serialize/EncodingInfo.java b/src/com/sun/org/apache/xml/internal/serialize/EncodingInfo.java
deleted file mode 100644
index 9c21756..0000000
--- a/src/com/sun/org/apache/xml/internal/serialize/EncodingInfo.java
+++ /dev/null
@@ -1,271 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2000-2002,2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xml.internal.serialize;
-
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.UnsupportedEncodingException;
-import java.io.Writer;
-import com.sun.org.apache.xerces.internal.util.EncodingMap;
-
-/**
- * This class represents an encoding.
- *
- * @version $Id: EncodingInfo.java,v 1.6 2007/10/18 03:39:08 joehw Exp $
- */
-public class EncodingInfo {
-
- // An array to hold the argument for a method of Charset, CharsetEncoder or CharToByteConverter.
- private Object [] fArgsForMethod = null;
-
- // name of encoding as registered with IANA;
- // preferably a MIME name, but aliases are fine too.
- String ianaName;
- String javaName;
- int lastPrintable;
-
- // The CharsetEncoder with which we test unusual characters.
- Object fCharsetEncoder = null;
-
- // The CharToByteConverter with which we test unusual characters.
- Object fCharToByteConverter = null;
-
- // Is the converter null because it can't be instantiated
- // for some reason (perhaps we're running with insufficient authority as
- // an applet?
- boolean fHaveTriedCToB = false;
-
- // Is the charset encoder usable or available.
- boolean fHaveTriedCharsetEncoder = false;
-
- /**
- * Creates new <code>EncodingInfo</code> instance.
- */
- public EncodingInfo(String ianaName, String javaName, int lastPrintable) {
- this.ianaName = ianaName;
- this.javaName = EncodingMap.getIANA2JavaMapping(ianaName);
- this.lastPrintable = lastPrintable;
- }
-
- /**
- * Returns a MIME charset name of this encoding.
- */
- public String getIANAName() {
- return this.ianaName;
- }
-
- /**
- * Returns a writer for this encoding based on
- * an output stream.
- *
- * @return A suitable writer
- * @exception UnsupportedEncodingException There is no convertor
- * to support this encoding
- */
- public Writer getWriter(OutputStream output)
- throws UnsupportedEncodingException {
- // this should always be true!
- if (javaName != null)
- return new OutputStreamWriter(output, javaName);
- javaName = EncodingMap.getIANA2JavaMapping(ianaName);
- if(javaName == null)
- // use UTF-8 as preferred encoding
- return new OutputStreamWriter(output, "UTF8");
- return new OutputStreamWriter(output, javaName);
- }
-
- /**
- * Checks whether the specified character is printable or not in this encoding.
- *
- * @param ch a code point (0-0x10ffff)
- */
- public boolean isPrintable(char ch) {
- if (ch <= this.lastPrintable) {
- return true;
- }
- return isPrintable0(ch);
- }
-
- /**
- * Checks whether the specified character is printable or not in this encoding.
- * This method accomplishes this using a java.nio.CharsetEncoder. If NIO isn't
- * available it will attempt use a sun.io.CharToByteConverter.
- *
- * @param ch a code point (0-0x10ffff)
- */
- private boolean isPrintable0(char ch) {
-
- // Attempt to get a CharsetEncoder for this encoding.
- if (fCharsetEncoder == null && CharsetMethods.fgNIOCharsetAvailable && !fHaveTriedCharsetEncoder) {
- if (fArgsForMethod == null) {
- fArgsForMethod = new Object [1];
- }
- // try and create the CharsetEncoder
- try {
- fArgsForMethod[0] = javaName;
- Object charset = CharsetMethods.fgCharsetForNameMethod.invoke(null, fArgsForMethod);
- if (((Boolean) CharsetMethods.fgCharsetCanEncodeMethod.invoke(charset, (Object[]) null)).booleanValue()) {
- fCharsetEncoder = CharsetMethods.fgCharsetNewEncoderMethod.invoke(charset, (Object[]) null);
- }
- // This charset cannot be used for encoding, don't try it again...
- else {
- fHaveTriedCharsetEncoder = true;
- }
- }
- catch (Exception e) {
- // don't try it again...
- fHaveTriedCharsetEncoder = true;
- }
- }
- // Attempt to use the CharsetEncoder to determine whether the character is printable.
- if (fCharsetEncoder != null) {
- try {
- fArgsForMethod[0] = new Character(ch);
- return ((Boolean) CharsetMethods.fgCharsetEncoderCanEncodeMethod.invoke(fCharsetEncoder, fArgsForMethod)).booleanValue();
- }
- catch (Exception e) {
- // obviously can't use this charset encoder; possibly a JDK bug
- fCharsetEncoder = null;
- fHaveTriedCharsetEncoder = false;
- }
- }
-
- // As a last resort try to use a sun.io.CharToByteConverter to
- // determine whether this character is printable. We will always
- // reach here on JDK 1.3 or below.
- if (fCharToByteConverter == null) {
- if (fHaveTriedCToB || !CharToByteConverterMethods.fgConvertersAvailable) {
- // forget it; nothing we can do...
- return false;
- }
- if (fArgsForMethod == null) {
- fArgsForMethod = new Object [1];
- }
- // try and create the CharToByteConverter
- try {
- fArgsForMethod[0] = javaName;
- fCharToByteConverter = CharToByteConverterMethods.fgGetConverterMethod.invoke(null, fArgsForMethod);
- }
- catch (Exception e) {
- // don't try it again...
- fHaveTriedCToB = true;
- return false;
- }
- }
- try {
- fArgsForMethod[0] = new Character(ch);
- return ((Boolean) CharToByteConverterMethods.fgCanConvertMethod.invoke(fCharToByteConverter, fArgsForMethod)).booleanValue();
- }
- catch (Exception e) {
- // obviously can't use this converter; probably some kind of
- // security restriction
- fCharToByteConverter = null;
- fHaveTriedCToB = false;
- return false;
- }
- }
-
- // is this an encoding name recognized by this JDK?
- // if not, will throw UnsupportedEncodingException
- public static void testJavaEncodingName(String name) throws UnsupportedEncodingException {
- final byte [] bTest = {(byte)'v', (byte)'a', (byte)'l', (byte)'i', (byte)'d'};
- String s = new String(bTest, name);
- }
-
- /**
- * Holder of methods from java.nio.charset.Charset and java.nio.charset.CharsetEncoder.
- */
- static class CharsetMethods {
-
- // Method: java.nio.charset.Charset.forName(java.lang.String)
- private static java.lang.reflect.Method fgCharsetForNameMethod = null;
-
- // Method: java.nio.charset.Charset.canEncode()
- private static java.lang.reflect.Method fgCharsetCanEncodeMethod = null;
-
- // Method: java.nio.charset.Charset.newEncoder()
- private static java.lang.reflect.Method fgCharsetNewEncoderMethod = null;
-
- // Method: java.nio.charset.CharsetEncoder.canEncode(char)
- private static java.lang.reflect.Method fgCharsetEncoderCanEncodeMethod = null;
-
- // Flag indicating whether or not java.nio.charset.* is available.
- private static boolean fgNIOCharsetAvailable = false;
-
- private CharsetMethods() {}
-
- // Attempt to get methods for Charset and CharsetEncoder on class initialization.
- static {
- try {
- Class charsetClass = Class.forName("java.nio.charset.Charset");
- Class charsetEncoderClass = Class.forName("java.nio.charset.CharsetEncoder");
- fgCharsetForNameMethod = charsetClass.getMethod("forName", new Class [] {String.class});
- fgCharsetCanEncodeMethod = charsetClass.getMethod("canEncode", new Class [] {});
- fgCharsetNewEncoderMethod = charsetClass.getMethod("newEncoder", new Class [] {});
- fgCharsetEncoderCanEncodeMethod = charsetEncoderClass.getMethod("canEncode", new Class [] {Character.TYPE});
- fgNIOCharsetAvailable = true;
- }
- // ClassNotFoundException, NoSuchMethodException or SecurityException
- // Whatever the case, we cannot use java.nio.charset.*.
- catch (Exception exc) {
- fgCharsetForNameMethod = null;
- fgCharsetCanEncodeMethod = null;
- fgCharsetEncoderCanEncodeMethod = null;
- fgCharsetNewEncoderMethod = null;
- fgNIOCharsetAvailable = false;
- }
- }
- }
-
- /**
- * Holder of methods from sun.io.CharToByteConverter.
- */
- static class CharToByteConverterMethods {
-
- // Method: sun.io.CharToByteConverter.getConverter(java.lang.String)
- private static java.lang.reflect.Method fgGetConverterMethod = null;
-
- // Method: sun.io.CharToByteConverter.canConvert(char)
- private static java.lang.reflect.Method fgCanConvertMethod = null;
-
- // Flag indicating whether or not sun.io.CharToByteConverter is available.
- private static boolean fgConvertersAvailable = false;
-
- private CharToByteConverterMethods() {}
-
- // Attempt to get methods for char to byte converter on class initialization.
- static {
- try {
- Class clazz = Class.forName("sun.io.CharToByteConverter");
- fgGetConverterMethod = clazz.getMethod("getConverter", new Class [] {String.class});
- fgCanConvertMethod = clazz.getMethod("canConvert", new Class [] {Character.TYPE});
- fgConvertersAvailable = true;
- }
- // ClassNotFoundException, NoSuchMethodException or SecurityException
- // Whatever the case, we cannot use sun.io.CharToByteConverter.
- catch (Exception exc) {
- fgGetConverterMethod = null;
- fgCanConvertMethod = null;
- fgConvertersAvailable = false;
- }
- }
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/serialize/Encodings.java b/src/com/sun/org/apache/xml/internal/serialize/Encodings.java
deleted file mode 100644
index 41feb9d..0000000
--- a/src/com/sun/org/apache/xml/internal/serialize/Encodings.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package com.sun.org.apache.xml.internal.serialize;
-
-
-import com.sun.org.apache.xerces.internal.util.EncodingMap;
-import java.io.UnsupportedEncodingException;
-import java.util.Locale;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-
-/**
- * Provides information about encodings. Depends on the Java runtime
- * to provides writers for the different encodings, but can be used
- * to override encoding names and provide the last printable character
- * for each encoding.
- *
- * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
- */
-class Encodings
-{
-
-
- /**
- * The last printable character for unknown encodings.
- */
- static final int DEFAULT_LAST_PRINTABLE = 0x7F;
-
- // last printable character for Unicode-compatible encodings
- static final int LAST_PRINTABLE_UNICODE = 0xffff;
- // unicode-compliant encodings; can express plane 0
- static final String[] UNICODE_ENCODINGS = {
- "Unicode", "UnicodeBig", "UnicodeLittle", "GB2312", "UTF8", "UTF-16",
- };
- // default (Java) encoding if none supplied:
- static final String DEFAULT_ENCODING = "UTF8";
-
- // note that the size of this Map
- // is bounded by the number of encodings recognized by EncodingMap;
- // therefore it poses no static mutability risk.
- private static final Map<String, EncodingInfo> _encodings = new ConcurrentHashMap();
-
- /**
- * @param encoding a MIME charset name, or null.
- */
- static EncodingInfo getEncodingInfo(String encoding, boolean allowJavaNames) throws UnsupportedEncodingException {
- EncodingInfo eInfo = null;
- if (encoding == null) {
- if((eInfo = _encodings.get(DEFAULT_ENCODING)) != null)
- return eInfo;
- eInfo = new EncodingInfo(EncodingMap.getJava2IANAMapping(DEFAULT_ENCODING), DEFAULT_ENCODING, LAST_PRINTABLE_UNICODE);
- _encodings.put(DEFAULT_ENCODING, eInfo);
- return eInfo;
- }
- // need to convert it to upper case:
- encoding = encoding.toUpperCase(Locale.ENGLISH);
- String jName = EncodingMap.getIANA2JavaMapping(encoding);
- if(jName == null) {
- // see if the encoding passed in is a Java encoding name.
- if(allowJavaNames ) {
- EncodingInfo.testJavaEncodingName(encoding);
- if((eInfo = _encodings.get(encoding)) != null)
- return eInfo;
- // is it known to be unicode-compliant?
- int i=0;
- for(; i<UNICODE_ENCODINGS.length; i++) {
- if(UNICODE_ENCODINGS[i].equalsIgnoreCase(encoding)) {
- eInfo = new EncodingInfo(EncodingMap.getJava2IANAMapping(encoding), encoding, LAST_PRINTABLE_UNICODE);
- break;
- }
- }
- if(i == UNICODE_ENCODINGS.length) {
- eInfo = new EncodingInfo(EncodingMap.getJava2IANAMapping(encoding), encoding, DEFAULT_LAST_PRINTABLE);
- }
- _encodings.put(encoding, eInfo);
- return eInfo;
- } else {
- throw new UnsupportedEncodingException(encoding);
- }
- }
- if ((eInfo = _encodings.get(jName)) != null)
- return eInfo;
- // have to create one...
- // is it known to be unicode-compliant?
- int i=0;
- for(; i<UNICODE_ENCODINGS.length; i++) {
- if(UNICODE_ENCODINGS[i].equalsIgnoreCase(jName)) {
- eInfo = new EncodingInfo(encoding, jName, LAST_PRINTABLE_UNICODE);
- break;
- }
- }
- if(i == UNICODE_ENCODINGS.length) {
- eInfo = new EncodingInfo(encoding, jName, DEFAULT_LAST_PRINTABLE);
- }
- _encodings.put(jName, eInfo);
- return eInfo;
- }
-
- static final String JIS_DANGER_CHARS
- = "\\\u007e\u007f\u00a2\u00a3\u00a5\u00ac"
- +"\u2014\u2015\u2016\u2026\u203e\u203e\u2225\u222f\u301c"
- +"\uff3c\uff5e\uffe0\uffe1\uffe2\uffe3";
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/serialize/HTMLEntities.res b/src/com/sun/org/apache/xml/internal/serialize/HTMLEntities.res
deleted file mode 100644
index 0423630..0000000
--- a/src/com/sun/org/apache/xml/internal/serialize/HTMLEntities.res
+++ /dev/null
@@ -1,290 +0,0 @@
-# $Id: HTMLEntities.res,v 1.3 2000/08/30 18:59:20 arkin Exp $
-#
-# @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
-#
-# Character entity references for markup-significant
-#
-quot 34
-amp 38
-lt 60
-gt 62
-nbsp 160
-#
-# Character entity references for ISO 8859-1 characters
-#
-iexcl 161
-cent 162
-pound 163
-curren 164
-yen 165
-brvbar 166
-sect 167
-uml 168
-copy 169
-ordf 170
-laquo 171
-not 172
-shy 173
-reg 174
-macr 175
-deg 176
-plusmn 177
-sup2 178
-sup3 179
-acute 180
-micro 181
-para 182
-middot 183
-cedil 184
-sup1 185
-ordm 186
-raquo 187
-frac14 188
-frac12 189
-frac34 190
-iquest 191
-Agrave 192
-Aacute 193
-Acirc 194
-Atilde 195
-Auml 196
-Aring 197
-AElig 198
-Ccedil 199
-Egrave 200
-Eacute 201
-Ecirc 202
-Euml 203
-Igrave 204
-Iacute 205
-Icirc 206
-Iuml 207
-ETH 208
-Ntilde 209
-Ograve 210
-Oacute 211
-Ocirc 212
-Otilde 213
-Ouml 214
-times 215
-Oslash 216
-Ugrave 217
-Uacute 218
-Ucirc 219
-Uuml 220
-Yacute 221
-THORN 222
-szlig 223
-agrave 224
-aacute 225
-acirc 226
-atilde 227
-auml 228
-aring 229
-aelig 230
-ccedil 231
-egrave 232
-eacute 233
-ecirc 234
-euml 235
-igrave 236
-iacute 237
-icirc 238
-iuml 239
-eth 240
-ntilde 241
-ograve 242
-oacute 243
-ocirc 244
-otilde 245
-ouml 246
-divide 247
-oslash 248
-ugrave 249
-uacute 250
-ucirc 251
-uuml 252
-yacute 253
-thorn 254
-yuml 255
-#
-# Character entity references for symbols, mathematical symbols, and Greek letters
-#
-# Latin Extended
-fnof 402
-#
-# Greek
-Alpha 913
-Beta 914
-Gamma 915
-Delta 916
-Epsilon 917
-Zeta 918
-Eta 919
-Theta 920
-Iota 921
-Kappa 922
-Lambda 923
-Mu 924
-Nu 925
-Xi 926
-Omicron 927
-Pi 928
-Rho 929
-Sigma 931
-Tau 932
-Upsilon 933
-Phi 934
-Chi 935
-Psi 936
-Omega 937
-alpha 945
-beta 946
-gamma 947
-delta 948
-epsilon 949
-zeta 950
-eta 951
-theta 952
-iota 953
-kappa 954
-lambda 955
-mu 956
-nu 957
-xi 958
-omicron 959
-pi 960
-rho 961
-sigmaf 962
-sigma 963
-tau 964
-upsilon 965
-phi 966
-chi 967
-psi 968
-omega 969
-thetasym 977
-upsih 978
-piv 982
-#
-# General Punctuation
-bull 8226
-hellip 8230
-prime 8242
-Prime 8243
-oline 8254
-frasl 8260
-#
-# Letterlike Symbols
-weierp 8472
-image 8465
-real 8476
-trade 8482
-alefsym 8501
-#
-# Arrows
-larr 8592
-uarr 8593
-rarr 8594
-darr 8595
-harr 8596
-crarr 8629
-lArr 8656
-uArr 8657
-rArr 8658
-dArr 8659
-hArr 8660
-#
-# Mathematical Operators
-forall 8704
-part 8706
-exist 8707
-empty 8709
-nabla 8711
-isin 8712
-notin 8713
-ni 8715
-prod 8719
-sum 8721
-minus 8722
-lowast 8727
-radic 8730
-prop 8733
-infin 8734
-ang 8736
-and 8743
-or 8744
-cap 8745
-cup 8746
-int 8747
-there4 8756
-sim 8764
-cong 8773
-asymp 8776
-ne 8800
-equiv 8801
-le 8804
-ge 8805
-sub 8834
-sup 8835
-nsub 8836
-sube 8838
-supe 8839
-oplus 8853
-otimes 8855
-perp 8869
-sdot 8901
-#
-# Miscellaneous Technical
-lceil 8968
-rceil 8969
-lfloor 8970
-rfloor 8971
-lang 9001
-rang 9002
-#
-# Geometric Shapes
-loz 9674
-#
-# Miscellaneous Symbols
-spades 9824
-clubs 9827
-hearts 9829
-diams 9830
-#
-# Character entity references for internationalization characters
-#
-# Latin Extended-A
-OElig 338
-oelig 339
-#-- Commented out. NN 4.7 does not seem to support these --
-#Scaron 352
-#scaron 353
-Yuml 376
-#
-# Spacing Modifier Letters
-circ 710
-tilde 732
-#
-# General Punctuation
-ensp 8194
-emsp 8195
-thinsp 8201
-zwnj 8204
-zwj 8205
-lrm 8206
-rlm 8207
-ndash 8211
-mdash 8212
-lsquo 8216
-rsquo 8217
-sbquo 8218
-ldquo 8220
-rdquo 8221
-bdquo 8222
-dagger 8224
-Dagger 8225
-permil 8240
-lsaquo 8249
-rsaquo 8250
-euro 8364
diff --git a/src/com/sun/org/apache/xml/internal/serialize/HTMLSerializer.java b/src/com/sun/org/apache/xml/internal/serialize/HTMLSerializer.java
deleted file mode 100644
index 49bbe18..0000000
--- a/src/com/sun/org/apache/xml/internal/serialize/HTMLSerializer.java
+++ /dev/null
@@ -1,876 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-// Sep 14, 2000:
-// Fixed serializer to report IO exception directly, instead at
-// the end of document processing.
-// Reported by Patrick Higgins <phiggins@transzap.com>
-// Aug 21, 2000:
-// Fixed bug in startDocument not calling prepare.
-// Reported by Mikael Staldal <d96-mst-ingen-reklam@d.kth.se>
-// Aug 21, 2000:
-// Added ability to omit DOCTYPE declaration.
-// Sep 1, 2000:
-// If no output format is provided the serializer now defaults
-// to ISO-8859-1 encoding. Reported by Mikael Staldal
-// <d96-mst@d.kth.se>
-
-
-package com.sun.org.apache.xml.internal.serialize;
-
-import com.sun.org.apache.xerces.internal.dom.DOMMessageFormatter;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.Writer;
-import java.util.Locale;
-import java.util.Map;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.xml.sax.AttributeList;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-
-
-/**
- * Implements an HTML/XHTML serializer supporting both DOM and SAX
- * pretty serializing. HTML/XHTML mode is determined in the
- * constructor. For usage instructions see {@link Serializer}.
- * <p>
- * If an output stream is used, the encoding is taken from the
- * output format (defaults to <tt>UTF-8</tt>). If a writer is
- * used, make sure the writer uses the same encoding (if applies)
- * as specified in the output format.
- * <p>
- * The serializer supports both DOM and SAX. DOM serializing is done
- * by calling {@link #serialize} and SAX serializing is done by firing
- * SAX events and using the serializer as a document handler.
- * <p>
- * If an I/O exception occurs while serializing, the serializer
- * will not throw an exception directly, but only throw it
- * at the end of serializing (either DOM or SAX's {@link
- * org.xml.sax.DocumentHandler#endDocument}.
- * <p>
- * For elements that are not specified as whitespace preserving,
- * the serializer will potentially break long text lines at space
- * boundaries, indent lines, and serialize elements on separate
- * lines. Line terminators will be regarded as spaces, and
- * spaces at beginning of line will be stripped.
- * <p>
- * XHTML is slightly different than HTML:
- * <ul>
- * <li>Element/attribute names are lower case and case matters
- * <li>Attributes must specify value, even if empty string
- * <li>Empty elements must have '/' in empty tag
- * <li>Contents of SCRIPT and STYLE elements serialized as CDATA
- * </ul>
- *
- * @deprecated This class was deprecated in Xerces 2.6.2. It is
- * recommended that new applications use JAXP's Transformation API
- * for XML (TrAX) for serializing HTML. See the Xerces documentation
- * for more information.
- * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
- * @see Serializer
- */
-public class HTMLSerializer
- extends BaseMarkupSerializer
-{
-
-
- /**
- * True if serializing in XHTML format.
- */
- private boolean _xhtml;
-
-
- public static final String XHTMLNamespace = "http://www.w3.org/1999/xhtml";
-
- // for users to override XHTMLNamespace if need be.
- private String fUserXHTMLNamespace = null;
-
-
- /**
- * Constructs a new HTML/XHTML serializer depending on the value of
- * <tt>xhtml</tt>. The serializer cannot be used without calling
- * {@link #setOutputCharStream} or {@link #setOutputByteStream} first.
- *
- * @param xhtml True if XHTML serializing
- */
- protected HTMLSerializer( boolean xhtml, OutputFormat format )
- {
- super( format );
- _xhtml = xhtml;
- }
-
-
- /**
- * Constructs a new serializer. The serializer cannot be used without
- * calling {@link #setOutputCharStream} or {@link #setOutputByteStream}
- * first.
- */
- public HTMLSerializer()
- {
- this( false, new OutputFormat( Method.HTML, "ISO-8859-1", false ) );
- }
-
-
- /**
- * Constructs a new serializer. The serializer cannot be used without
- * calling {@link #setOutputCharStream} or {@link #setOutputByteStream}
- * first.
- */
- public HTMLSerializer( OutputFormat format )
- {
- this( false, format != null ? format : new OutputFormat( Method.HTML, "ISO-8859-1", false ) );
- }
-
-
-
- /**
- * Constructs a new serializer that writes to the specified writer
- * using the specified output format. If <tt>format</tt> is null,
- * will use a default output format.
- *
- * @param writer The writer to use
- * @param format The output format to use, null for the default
- */
- public HTMLSerializer( Writer writer, OutputFormat format )
- {
- this( false, format != null ? format : new OutputFormat( Method.HTML, "ISO-8859-1", false ) );
- setOutputCharStream( writer );
- }
-
-
- /**
- * Constructs a new serializer that writes to the specified output
- * stream using the specified output format. If <tt>format</tt>
- * is null, will use a default output format.
- *
- * @param output The output stream to use
- * @param format The output format to use, null for the default
- */
- public HTMLSerializer( OutputStream output, OutputFormat format )
- {
- this( false, format != null ? format : new OutputFormat( Method.HTML, "ISO-8859-1", false ) );
- setOutputByteStream( output );
- }
-
-
- public void setOutputFormat( OutputFormat format )
- {
- super.setOutputFormat( format != null ? format : new OutputFormat( Method.HTML, "ISO-8859-1", false ) );
- }
-
- // Set value for alternate XHTML namespace.
- public void setXHTMLNamespace(String newNamespace) {
- fUserXHTMLNamespace = newNamespace;
- } // setXHTMLNamespace(String)
-
- //-----------------------------------------//
- // SAX content handler serializing methods //
- //-----------------------------------------//
-
-
- public void startElement( String namespaceURI, String localName,
- String rawName, Attributes attrs )
- throws SAXException
- {
- int i;
- boolean preserveSpace;
- ElementState state;
- String name;
- String value;
- String htmlName;
- boolean addNSAttr = false;
-
- try {
- if ( _printer == null )
- throw new IllegalStateException(
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.SERIALIZER_DOMAIN,
- "NoWriterSupplied", null));
-
- state = getElementState();
- if ( isDocumentState() ) {
- // If this is the root element handle it differently.
- // If the first root element in the document, serialize
- // the document's DOCTYPE. Space preserving defaults
- // to that of the output format.
- if ( ! _started )
- startDocument( (localName == null || localName.length() == 0)
- ? rawName : localName );
- } else {
- // For any other element, if first in parent, then
- // close parent's opening tag and use the parnet's
- // space preserving.
- if ( state.empty )
- _printer.printText( '>' );
- // Indent this element on a new line if the first
- // content of the parent element or immediately
- // following an element.
- if ( _indenting && ! state.preserveSpace &&
- ( state.empty || state.afterElement ) )
- _printer.breakLine();
- }
- preserveSpace = state.preserveSpace;
-
- // Do not change the current element state yet.
- // This only happens in endElement().
-
- // As per SAX2, the namespace URI is an empty string if the element has no
- // namespace URI, or namespaces is turned off. The check against null protects
- // against broken SAX implementations, so I've left it there. - mrglavas
- boolean hasNamespaceURI = (namespaceURI != null && namespaceURI.length() != 0);
-
- // SAX2: rawName (QName) could be empty string if
- // namespace-prefixes property is false.
- if ( rawName == null || rawName.length() == 0) {
- rawName = localName;
- if ( hasNamespaceURI ) {
- String prefix;
- prefix = getPrefix( namespaceURI );
- if ( prefix != null && prefix.length() != 0 )
- rawName = prefix + ":" + localName;
- }
- addNSAttr = true;
- }
- if ( !hasNamespaceURI )
- htmlName = rawName;
- else {
- if ( namespaceURI.equals( XHTMLNamespace ) ||
- (fUserXHTMLNamespace != null && fUserXHTMLNamespace.equals(namespaceURI)) )
- htmlName = localName;
- else
- htmlName = null;
- }
-
- // XHTML: element names are lower case, DOM will be different
- _printer.printText( '<' );
- if ( _xhtml )
- _printer.printText( rawName.toLowerCase(Locale.ENGLISH) );
- else
- _printer.printText( rawName );
- _printer.indent();
-
- // For each attribute serialize it's name and value as one part,
- // separated with a space so the element can be broken on
- // multiple lines.
- if ( attrs != null ) {
- for ( i = 0 ; i < attrs.getLength() ; ++i ) {
- _printer.printSpace();
- name = attrs.getQName( i ).toLowerCase(Locale.ENGLISH);
- value = attrs.getValue( i );
- if ( _xhtml || hasNamespaceURI ) {
- // XHTML: print empty string for null values.
- if ( value == null ) {
- _printer.printText( name );
- _printer.printText( "=\"\"" );
- } else {
- _printer.printText( name );
- _printer.printText( "=\"" );
- printEscaped( value );
- _printer.printText( '"' );
- }
- } else {
- // HTML: Empty values print as attribute name, no value.
- // HTML: URI attributes will print unescaped
- if ( value == null ) {
- value = "";
- }
- if ( !_format.getPreserveEmptyAttributes() && value.length() == 0 )
- _printer.printText( name );
- else if ( HTMLdtd.isURI( rawName, name ) ) {
- _printer.printText( name );
- _printer.printText( "=\"" );
- _printer.printText( escapeURI( value ) );
- _printer.printText( '"' );
- } else if ( HTMLdtd.isBoolean( rawName, name ) )
- _printer.printText( name );
- else {
- _printer.printText( name );
- _printer.printText( "=\"" );
- printEscaped( value );
- _printer.printText( '"' );
- }
- }
- }
- }
- if ( htmlName != null && HTMLdtd.isPreserveSpace( htmlName ) )
- preserveSpace = true;
-
- if ( addNSAttr ) {
- for (Map.Entry<String, String> entry : _prefixes.entrySet()) {
- _printer.printSpace();
- value = entry.getKey(); //The prefixes map uses the URI value as key.
- name = entry.getValue(); //and prefix name as value
- if ( name.length() == 0 ) {
- _printer.printText( "xmlns=\"" );
- printEscaped( value );
- _printer.printText( '"' );
- } else {
- _printer.printText( "xmlns:" );
- _printer.printText( name );
- _printer.printText( "=\"" );
- printEscaped( value );
- _printer.printText( '"' );
- }
- }
- }
-
- // Now it's time to enter a new element state
- // with the tag name and space preserving.
- // We still do not change the curent element state.
- state = enterElementState( namespaceURI, localName, rawName, preserveSpace );
-
- // Prevents line breaks inside A/TD
-
- if ( htmlName != null && ( htmlName.equalsIgnoreCase( "A" ) ||
- htmlName.equalsIgnoreCase( "TD" ) ) ) {
- state.empty = false;
- _printer.printText( '>' );
- }
-
- // Handle SCRIPT and STYLE specifically by changing the
- // state of the current element to CDATA (XHTML) or
- // unescaped (HTML).
- if ( htmlName != null && ( rawName.equalsIgnoreCase( "SCRIPT" ) ||
- rawName.equalsIgnoreCase( "STYLE" ) ) ) {
- if ( _xhtml ) {
- // XHTML: Print contents as CDATA section
- state.doCData = true;
- } else {
- // HTML: Print contents unescaped
- state.unescaped = true;
- }
- }
- } catch ( IOException except ) {
- throw new SAXException( except );
- }
- }
-
-
- public void endElement( String namespaceURI, String localName,
- String rawName )
- throws SAXException
- {
- try {
- endElementIO( namespaceURI, localName, rawName );
- } catch ( IOException except ) {
- throw new SAXException( except );
- }
- }
-
-
- public void endElementIO( String namespaceURI, String localName,
- String rawName )
- throws IOException
- {
- ElementState state;
- String htmlName;
-
- // Works much like content() with additions for closing
- // an element. Note the different checks for the closed
- // element's state and the parent element's state.
- _printer.unindent();
- state = getElementState();
-
- if ( state.namespaceURI == null || state.namespaceURI.length() == 0 )
- htmlName = state.rawName;
- else {
- if ( state.namespaceURI.equals( XHTMLNamespace ) ||
- (fUserXHTMLNamespace != null && fUserXHTMLNamespace.equals(state.namespaceURI)) )
- htmlName = state.localName;
- else
- htmlName = null;
- }
-
- if ( _xhtml) {
- if ( state.empty ) {
- _printer.printText( " />" );
- } else {
- // Must leave CData section first
- if ( state.inCData )
- _printer.printText( "]]>" );
- // XHTML: element names are lower case, DOM will be different
- _printer.printText( "</" );
- _printer.printText( state.rawName.toLowerCase(Locale.ENGLISH) );
- _printer.printText( '>' );
- }
- } else {
- if ( state.empty )
- _printer.printText( '>' );
- // This element is not empty and that last content was
- // another element, so print a line break before that
- // last element and this element's closing tag.
- // [keith] Provided this is not an anchor.
- // HTML: some elements do not print closing tag (e.g. LI)
- if ( htmlName == null || ! HTMLdtd.isOnlyOpening( htmlName ) ) {
- if ( _indenting && ! state.preserveSpace && state.afterElement )
- _printer.breakLine();
- // Must leave CData section first (Illegal in HTML, but still)
- if ( state.inCData )
- _printer.printText( "]]>" );
- _printer.printText( "</" );
- _printer.printText( state.rawName );
- _printer.printText( '>' );
- }
- }
- // Leave the element state and update that of the parent
- // (if we're not root) to not empty and after element.
- state = leaveElementState();
- // Temporary hack to prevent line breaks inside A/TD
- if ( htmlName == null || ( ! htmlName.equalsIgnoreCase( "A" ) &&
- ! htmlName.equalsIgnoreCase( "TD" ) ) )
-
- state.afterElement = true;
- state.empty = false;
- if ( isDocumentState() )
- _printer.flush();
- }
-
-
- //------------------------------------------//
- // SAX document handler serializing methods //
- //------------------------------------------//
-
-
- public void characters( char[] chars, int start, int length )
- throws SAXException
- {
- ElementState state;
-
- try {
- // HTML: no CDATA section
- state = content();
- state.doCData = false;
- super.characters( chars, start, length );
- } catch ( IOException except ) {
- throw new SAXException( except );
- }
- }
-
-
- public void startElement( String tagName, AttributeList attrs )
- throws SAXException
- {
- int i;
- boolean preserveSpace;
- ElementState state;
- String name;
- String value;
-
- try {
- if ( _printer == null )
- throw new IllegalStateException(
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.SERIALIZER_DOMAIN,
- "NoWriterSupplied", null));
-
-
- state = getElementState();
- if ( isDocumentState() ) {
- // If this is the root element handle it differently.
- // If the first root element in the document, serialize
- // the document's DOCTYPE. Space preserving defaults
- // to that of the output format.
- if ( ! _started )
- startDocument( tagName );
- } else {
- // For any other element, if first in parent, then
- // close parent's opening tag and use the parnet's
- // space preserving.
- if ( state.empty )
- _printer.printText( '>' );
- // Indent this element on a new line if the first
- // content of the parent element or immediately
- // following an element.
- if ( _indenting && ! state.preserveSpace &&
- ( state.empty || state.afterElement ) )
- _printer.breakLine();
- }
- preserveSpace = state.preserveSpace;
-
- // Do not change the current element state yet.
- // This only happens in endElement().
-
- // XHTML: element names are lower case, DOM will be different
- _printer.printText( '<' );
- if ( _xhtml )
- _printer.printText( tagName.toLowerCase(Locale.ENGLISH) );
- else
- _printer.printText( tagName );
- _printer.indent();
-
- // For each attribute serialize it's name and value as one part,
- // separated with a space so the element can be broken on
- // multiple lines.
- if ( attrs != null ) {
- for ( i = 0 ; i < attrs.getLength() ; ++i ) {
- _printer.printSpace();
- name = attrs.getName( i ).toLowerCase(Locale.ENGLISH);
- value = attrs.getValue( i );
- if ( _xhtml ) {
- // XHTML: print empty string for null values.
- if ( value == null ) {
- _printer.printText( name );
- _printer.printText( "=\"\"" );
- } else {
- _printer.printText( name );
- _printer.printText( "=\"" );
- printEscaped( value );
- _printer.printText( '"' );
- }
- } else {
- // HTML: Empty values print as attribute name, no value.
- // HTML: URI attributes will print unescaped
- if ( value == null ) {
- value = "";
- }
- if ( !_format.getPreserveEmptyAttributes() && value.length() == 0 )
- _printer.printText( name );
- else if ( HTMLdtd.isURI( tagName, name ) ) {
- _printer.printText( name );
- _printer.printText( "=\"" );
- _printer.printText( escapeURI( value ) );
- _printer.printText( '"' );
- } else if ( HTMLdtd.isBoolean( tagName, name ) )
- _printer.printText( name );
- else {
- _printer.printText( name );
- _printer.printText( "=\"" );
- printEscaped( value );
- _printer.printText( '"' );
- }
- }
- }
- }
- if ( HTMLdtd.isPreserveSpace( tagName ) )
- preserveSpace = true;
-
- // Now it's time to enter a new element state
- // with the tag name and space preserving.
- // We still do not change the curent element state.
- state = enterElementState( null, null, tagName, preserveSpace );
-
- // Prevents line breaks inside A/TD
- if ( tagName.equalsIgnoreCase( "A" ) || tagName.equalsIgnoreCase( "TD" ) ) {
- state.empty = false;
- _printer.printText( '>' );
- }
-
- // Handle SCRIPT and STYLE specifically by changing the
- // state of the current element to CDATA (XHTML) or
- // unescaped (HTML).
- if ( tagName.equalsIgnoreCase( "SCRIPT" ) ||
- tagName.equalsIgnoreCase( "STYLE" ) ) {
- if ( _xhtml ) {
- // XHTML: Print contents as CDATA section
- state.doCData = true;
- } else {
- // HTML: Print contents unescaped
- state.unescaped = true;
- }
- }
- } catch ( IOException except ) {
- throw new SAXException( except );
- }
- }
-
-
- public void endElement( String tagName )
- throws SAXException
- {
- endElement( null, null, tagName );
- }
-
-
- //------------------------------------------//
- // Generic node serializing methods methods //
- //------------------------------------------//
-
-
- /**
- * Called to serialize the document's DOCTYPE by the root element.
- * The document type declaration must name the root element,
- * but the root element is only known when that element is serialized,
- * and not at the start of the document.
- * <p>
- * This method will check if it has not been called before ({@link #_started}),
- * will serialize the document type declaration, and will serialize all
- * pre-root comments and PIs that were accumulated in the document
- * (see {@link #serializePreRoot}). Pre-root will be serialized even if
- * this is not the first root element of the document.
- */
- protected void startDocument( String rootTagName )
- throws IOException
- {
- StringBuffer buffer;
-
- // Not supported in HTML/XHTML, but we still have to switch
- // out of DTD mode.
- _printer.leaveDTD();
- if ( ! _started ) {
- // If the public and system identifiers were not specified
- // in the output format, use the appropriate ones for HTML
- // or XHTML.
- if ( _docTypePublicId == null && _docTypeSystemId == null ) {
- if ( _xhtml ) {
- _docTypePublicId = HTMLdtd.XHTMLPublicId;
- _docTypeSystemId = HTMLdtd.XHTMLSystemId;
- } else {
- _docTypePublicId = HTMLdtd.HTMLPublicId;
- _docTypeSystemId = HTMLdtd.HTMLSystemId;
- }
- }
-
- if ( ! _format.getOmitDocumentType() ) {
- // XHTML: If public identifier and system identifier
- // specified, print them, else print just system identifier
- // HTML: If public identifier specified, print it with
- // system identifier, if specified.
- // XHTML requires that all element names are lower case, so the
- // root on the DOCTYPE must be 'html'. - mrglavas
- if ( _docTypePublicId != null && ( ! _xhtml || _docTypeSystemId != null ) ) {
- if (_xhtml) {
- _printer.printText( "<!DOCTYPE html PUBLIC " );
- }
- else {
- _printer.printText( "<!DOCTYPE HTML PUBLIC " );
- }
- printDoctypeURL( _docTypePublicId );
- if ( _docTypeSystemId != null ) {
- if ( _indenting ) {
- _printer.breakLine();
- _printer.printText( " " );
- } else
- _printer.printText( ' ' );
- printDoctypeURL( _docTypeSystemId );
- }
- _printer.printText( '>' );
- _printer.breakLine();
- } else if ( _docTypeSystemId != null ) {
- if (_xhtml) {
- _printer.printText( "<!DOCTYPE html SYSTEM " );
- }
- else {
- _printer.printText( "<!DOCTYPE HTML SYSTEM " );
- }
- printDoctypeURL( _docTypeSystemId );
- _printer.printText( '>' );
- _printer.breakLine();
- }
- }
- }
-
- _started = true;
- // Always serialize these, even if not te first root element.
- serializePreRoot();
- }
-
-
- /**
- * Called to serialize a DOM element. Equivalent to calling {@link
- * #startElement}, {@link #endElement} and serializing everything
- * inbetween, but better optimized.
- */
- protected void serializeElement( Element elem )
- throws IOException
- {
- Attr attr;
- NamedNodeMap attrMap;
- int i;
- Node child;
- ElementState state;
- boolean preserveSpace;
- String name;
- String value;
- String tagName;
-
- tagName = elem.getTagName();
- state = getElementState();
- if ( isDocumentState() ) {
- // If this is the root element handle it differently.
- // If the first root element in the document, serialize
- // the document's DOCTYPE. Space preserving defaults
- // to that of the output format.
- if ( ! _started )
- startDocument( tagName );
- } else {
- // For any other element, if first in parent, then
- // close parent's opening tag and use the parnet's
- // space preserving.
- if ( state.empty )
- _printer.printText( '>' );
- // Indent this element on a new line if the first
- // content of the parent element or immediately
- // following an element.
- if ( _indenting && ! state.preserveSpace &&
- ( state.empty || state.afterElement ) )
- _printer.breakLine();
- }
- preserveSpace = state.preserveSpace;
-
- // Do not change the current element state yet.
- // This only happens in endElement().
-
- // XHTML: element names are lower case, DOM will be different
- _printer.printText( '<' );
- if ( _xhtml )
- _printer.printText( tagName.toLowerCase(Locale.ENGLISH) );
- else
- _printer.printText( tagName );
- _printer.indent();
-
- // Lookup the element's attribute, but only print specified
- // attributes. (Unspecified attributes are derived from the DTD.
- // For each attribute print it's name and value as one part,
- // separated with a space so the element can be broken on
- // multiple lines.
- attrMap = elem.getAttributes();
- if ( attrMap != null ) {
- for ( i = 0 ; i < attrMap.getLength() ; ++i ) {
- attr = (Attr) attrMap.item( i );
- name = attr.getName().toLowerCase(Locale.ENGLISH);
- value = attr.getValue();
- if ( attr.getSpecified() ) {
- _printer.printSpace();
- if ( _xhtml ) {
- // XHTML: print empty string for null values.
- if ( value == null ) {
- _printer.printText( name );
- _printer.printText( "=\"\"" );
- } else {
- _printer.printText( name );
- _printer.printText( "=\"" );
- printEscaped( value );
- _printer.printText( '"' );
- }
- } else {
- // HTML: Empty values print as attribute name, no value.
- // HTML: URI attributes will print unescaped
- if ( value == null ) {
- value = "";
- }
- if ( !_format.getPreserveEmptyAttributes() && value.length() == 0 )
- _printer.printText( name );
- else if ( HTMLdtd.isURI( tagName, name ) ) {
- _printer.printText( name );
- _printer.printText( "=\"" );
- _printer.printText( escapeURI( value ) );
- _printer.printText( '"' );
- } else if ( HTMLdtd.isBoolean( tagName, name ) )
- _printer.printText( name );
- else {
- _printer.printText( name );
- _printer.printText( "=\"" );
- printEscaped( value );
- _printer.printText( '"' );
- }
- }
- }
- }
- }
- if ( HTMLdtd.isPreserveSpace( tagName ) )
- preserveSpace = true;
-
- // If element has children, or if element is not an empty tag,
- // serialize an opening tag.
- if ( elem.hasChildNodes() || ! HTMLdtd.isEmptyTag( tagName ) ) {
- // Enter an element state, and serialize the children
- // one by one. Finally, end the element.
- state = enterElementState( null, null, tagName, preserveSpace );
-
- // Prevents line breaks inside A/TD
- if ( tagName.equalsIgnoreCase( "A" ) || tagName.equalsIgnoreCase( "TD" ) ) {
- state.empty = false;
- _printer.printText( '>' );
- }
-
- // Handle SCRIPT and STYLE specifically by changing the
- // state of the current element to CDATA (XHTML) or
- // unescaped (HTML).
- if ( tagName.equalsIgnoreCase( "SCRIPT" ) ||
- tagName.equalsIgnoreCase( "STYLE" ) ) {
- if ( _xhtml ) {
- // XHTML: Print contents as CDATA section
- state.doCData = true;
- } else {
- // HTML: Print contents unescaped
- state.unescaped = true;
- }
- }
- child = elem.getFirstChild();
- while ( child != null ) {
- serializeNode( child );
- child = child.getNextSibling();
- }
- endElementIO( null, null, tagName );
- } else {
- _printer.unindent();
- // XHTML: Close empty tag with ' />' so it's XML and HTML compatible.
- // HTML: Empty tags are defined as such in DTD no in document.
- if ( _xhtml )
- _printer.printText( " />" );
- else
- _printer.printText( '>' );
- // After element but parent element is no longer empty.
- state.afterElement = true;
- state.empty = false;
- if ( isDocumentState() )
- _printer.flush();
- }
- }
-
-
-
- protected void characters( String text )
- throws IOException
- {
- ElementState state;
-
- // HTML: no CDATA section
- state = content();
- super.characters( text );
- }
-
-
- protected String getEntityRef( int ch )
- {
- return HTMLdtd.fromChar( ch );
- }
-
-
- protected String escapeURI( String uri )
- {
- int index;
-
- // XXX Apparently Netscape doesn't like if we escape the URI
- // using %nn, so we leave it as is, just remove any quotes.
- index = uri.indexOf( "\"" );
- if ( index >= 0 )
- return uri.substring( 0, index );
- else
- return uri;
- }
-
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/serialize/HTMLdtd.java b/src/com/sun/org/apache/xml/internal/serialize/HTMLdtd.java
deleted file mode 100644
index 6a00818..0000000
--- a/src/com/sun/org/apache/xml/internal/serialize/HTMLdtd.java
+++ /dev/null
@@ -1,556 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Aug 21, 2000:
-// Fixed bug in isElement and made HTMLdtd public.
-// Contributed by Eric SCHAEFFER" <eschaeffer@posterconseil.com>
-
-
-package com.sun.org.apache.xml.internal.serialize;
-
-import com.sun.org.apache.xerces.internal.dom.DOMMessageFormatter;
-import java.io.BufferedReader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.Map;
-
-
-/**
- * Utility class for accessing information specific to HTML documents.
- * The HTML DTD is expressed as three utility function groups. Two methods
- * allow for checking whether an element requires an open tag on printing
- * ({@link #isEmptyTag}) or on parsing ({@link #isOptionalClosing}).
- * <P>
- * Two other methods translate character references from name to value and
- * from value to name. A small entities resource is loaded into memory the
- * first time any of these methods is called for fast and efficient access.
- *
- *
- * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
- */
-public final class HTMLdtd
-{
-
- /**
- * Public identifier for HTML 4.01 (Strict) document type.
- */
- public static final String HTMLPublicId = "-//W3C//DTD HTML 4.01//EN";
-
- /**
- * System identifier for HTML 4.01 (Strict) document type.
- */
- public static final String HTMLSystemId =
- "http://www.w3.org/TR/html4/strict.dtd";
-
- /**
- * Public identifier for XHTML 1.0 (Strict) document type.
- */
- public static final String XHTMLPublicId =
- "-//W3C//DTD XHTML 1.0 Strict//EN";
-
- /**
- * System identifier for XHTML 1.0 (Strict) document type.
- */
- public static final String XHTMLSystemId =
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";
-
- /**
- * Table of reverse character reference mapping. Character codes are held
- * as single-character strings, mapped to their reference name.
- */
- private static Map<Integer, String> _byChar;
-
-
- /**
- * Table of entity name to value mapping. Entities are held as strings,
- * character references as <TT>Character</TT> objects.
- */
- private static Map<String, Integer> _byName;
-
-
- private static final Map<String, String[]> _boolAttrs;
-
-
- /**
- * Holds element definitions.
- */
- private static final Map<String, Integer> _elemDefs;
-
-
- /**
- * Locates the HTML entities file that is loaded upon initialization.
- * This file is a resource loaded with the default class loader.
- */
- private static final String ENTITIES_RESOURCE = "HTMLEntities.res";
-
-
- /**
- * Only opening tag should be printed.
- */
- private static final int ONLY_OPENING = 0x0001;
-
- /**
- * Element contains element content only.
- */
- private static final int ELEM_CONTENT = 0x0002;
-
-
- /**
- * Element preserve spaces.
- */
- private static final int PRESERVE = 0x0004;
-
-
- /**
- * Optional closing tag.
- */
- private static final int OPT_CLOSING = 0x0008;
-
-
- /**
- * Element is empty (also means only opening tag)
- */
- private static final int EMPTY = 0x0010 | ONLY_OPENING;
-
-
- /**
- * Allowed to appear in head.
- */
- private static final int ALLOWED_HEAD = 0x0020;
-
-
- /**
- * When opened, closes P.
- */
- private static final int CLOSE_P = 0x0040;
-
-
- /**
- * When opened, closes DD or DT.
- */
- private static final int CLOSE_DD_DT = 0x0080;
-
-
- /**
- * When opened, closes itself.
- */
- private static final int CLOSE_SELF = 0x0100;
-
-
- /**
- * When opened, closes another table section.
- */
- private static final int CLOSE_TABLE = 0x0200;
-
-
- /**
- * When opened, closes TH or TD.
- */
- private static final int CLOSE_TH_TD = 0x04000;
-
-
- /**
- * Returns true if element is declared to be empty. HTML elements are
- * defines as empty in the DTD, not by the document syntax.
- *
- * @param tagName The element tag name (upper case)
- * @return True if element is empty
- */
- public static boolean isEmptyTag( String tagName )
- {
- return isElement( tagName, EMPTY );
- }
-
-
- /**
- * Returns true if element is declared to have element content.
- * Whitespaces appearing inside element content will be ignored,
- * other text will simply report an error.
- *
- * @param tagName The element tag name (upper case)
- * @return True if element content
- */
- public static boolean isElementContent( String tagName )
- {
- return isElement( tagName, ELEM_CONTENT );
- }
-
-
- /**
- * Returns true if element's textual contents preserves spaces.
- * This only applies to PRE and TEXTAREA, all other HTML elements
- * do not preserve space.
- *
- * @param tagName The element tag name (upper case)
- * @return True if element's text content preserves spaces
- */
- public static boolean isPreserveSpace( String tagName )
- {
- return isElement( tagName, PRESERVE );
- }
-
-
- /**
- * Returns true if element's closing tag is optional and need not
- * exist. An error will not be reported for such elements if they
- * are not closed. For example, <tt>LI</tt> is most often not closed.
- *
- * @param tagName The element tag name (upper case)
- * @return True if closing tag implied
- */
- public static boolean isOptionalClosing( String tagName )
- {
- return isElement( tagName, OPT_CLOSING );
- }
-
-
- /**
- * Returns true if element's closing tag is generally not printed.
- * For example, <tt>LI</tt> should not print the closing tag.
- *
- * @param tagName The element tag name (upper case)
- * @return True if only opening tag should be printed
- */
- public static boolean isOnlyOpening( String tagName )
- {
- return isElement( tagName, ONLY_OPENING );
- }
-
-
- /**
- * Returns true if the opening of one element (<tt>tagName</tt>) implies
- * the closing of another open element (<tt>openTag</tt>). For example,
- * every opening <tt>LI</tt> will close the previously open <tt>LI</tt>,
- * and every opening <tt>BODY</tt> will close the previously open <tt>HEAD</tt>.
- *
- * @param tagName The newly opened element
- * @param openTag The already opened element
- * @return True if closing tag closes opening tag
- */
- public static boolean isClosing( String tagName, String openTag )
- {
- // Several elements are defined as closing the HEAD
- if ( openTag.equalsIgnoreCase( "HEAD" ) )
- return ! isElement( tagName, ALLOWED_HEAD );
- // P closes iteself
- if ( openTag.equalsIgnoreCase( "P" ) )
- return isElement( tagName, CLOSE_P );
- // DT closes DD, DD closes DT
- if ( openTag.equalsIgnoreCase( "DT" ) || openTag.equalsIgnoreCase( "DD" ) )
- return isElement( tagName, CLOSE_DD_DT );
- // LI and OPTION close themselves
- if ( openTag.equalsIgnoreCase( "LI" ) || openTag.equalsIgnoreCase( "OPTION" ) )
- return isElement( tagName, CLOSE_SELF );
- // Each of these table sections closes all the others
- if ( openTag.equalsIgnoreCase( "THEAD" ) || openTag.equalsIgnoreCase( "TFOOT" ) ||
- openTag.equalsIgnoreCase( "TBODY" ) || openTag.equalsIgnoreCase( "TR" ) ||
- openTag.equalsIgnoreCase( "COLGROUP" ) )
- return isElement( tagName, CLOSE_TABLE );
- // TD closes TH and TH closes TD
- if ( openTag.equalsIgnoreCase( "TH" ) || openTag.equalsIgnoreCase( "TD" ) )
- return isElement( tagName, CLOSE_TH_TD );
- return false;
- }
-
-
- /**
- * Returns true if the specified attribute it a URI and should be
- * escaped appropriately. In HTML URIs are escaped differently
- * than normal attributes.
- *
- * @param tagName The element's tag name
- * @param attrName The attribute's name
- */
- public static boolean isURI( String tagName, String attrName )
- {
- // Stupid checks.
- return ( attrName.equalsIgnoreCase( "href" ) || attrName.equalsIgnoreCase( "src" ) );
- }
-
-
- /**
- * Returns true if the specified attribute is a boolean and should be
- * printed without the value. This applies to attributes that are true
- * if they exist, such as selected (OPTION/INPUT).
- *
- * @param tagName The element's tag name
- * @param attrName The attribute's name
- */
- public static boolean isBoolean( String tagName, String attrName )
- {
- String[] attrNames;
-
- attrNames = _boolAttrs.get( tagName.toUpperCase(Locale.ENGLISH) );
- if ( attrNames == null )
- return false;
- for ( int i = 0 ; i < attrNames.length ; ++i )
- if ( attrNames[ i ].equalsIgnoreCase( attrName ) )
- return true;
- return false;
- }
-
-
- /**
- * Returns the value of an HTML character reference by its name. If the
- * reference is not found or was not defined as a character reference,
- * returns EOF (-1).
- *
- * @param name Name of character reference
- * @return Character code or EOF (-1)
- */
- public static int charFromName( String name )
- {
- Object value;
-
- initialize();
- value = _byName.get( name );
- if ( value != null && value instanceof Integer )
- return ( (Integer) value ).intValue();
- else
- return -1;
- }
-
-
- /**
- * Returns the name of an HTML character reference based on its character
- * value. Only valid for entities defined from character references. If no
- * such character value was defined, return null.
- *
- * @param value Character value of entity
- * @return Entity's name or null
- */
- public static String fromChar(int value )
- {
- if (value > 0xffff)
- return null;
-
- String name;
-
- initialize();
- name = _byChar.get(value);
- return name;
- }
-
-
- /**
- * Initialize upon first access. Will load all the HTML character references
- * into a list that is accessible by name or character value and is optimized
- * for character substitution. This method may be called any number of times
- * but will execute only once.
- */
- private static void initialize()
- {
- InputStream is = null;
- BufferedReader reader = null;
- int index;
- String name;
- String value;
- int code;
- String line;
-
- // Make sure not to initialize twice.
- if ( _byName != null )
- return;
- try {
- _byName = new HashMap<>();
- _byChar = new HashMap<>();
- is = HTMLdtd.class.getResourceAsStream( ENTITIES_RESOURCE );
- if ( is == null ) {
- throw new RuntimeException(
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.SERIALIZER_DOMAIN,
- "ResourceNotFound", new Object[] {ENTITIES_RESOURCE}));
- }
- reader = new BufferedReader( new InputStreamReader( is, "ASCII" ) );
- line = reader.readLine();
- while ( line != null ) {
- if ( line.length() == 0 || line.charAt( 0 ) == '#' ) {
- line = reader.readLine();
- continue;
- }
- index = line.indexOf( ' ' );
- if ( index > 1 ) {
- name = line.substring( 0, index );
- ++index;
- if ( index < line.length() ) {
- value = line.substring( index );
- index = value.indexOf( ' ' );
- if ( index > 0 )
- value = value.substring( 0, index );
- code = Integer.parseInt( value );
- defineEntity( name, (char) code );
- }
- }
- line = reader.readLine();
- }
- is.close();
- } catch ( Exception except ) {
- throw new RuntimeException(
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.SERIALIZER_DOMAIN,
- "ResourceNotLoaded", new Object[] {ENTITIES_RESOURCE, except.toString()}));
- } finally {
- if ( is != null ) {
- try {
- is.close();
- } catch ( Exception except ) { }
- }
- }
- }
-
-
- /**
- * Defines a new character reference. The reference's name and value are
- * supplied. Nothing happens if the character reference is already defined.
- * <P>
- * Unlike internal entities, character references are a string to single
- * character mapping. They are used to map non-ASCII characters both on
- * parsing and printing, primarily for HTML documents. '&lt;amp;' is an
- * example of a character reference.
- *
- * @param name The entity's name
- * @param value The entity's value
- */
- private static void defineEntity( String name, char value )
- {
- if ( _byName.get( name ) == null ) {
- _byName.put( name, new Integer( value ) );
- _byChar.put( new Integer( value ), name );
- }
- }
-
-
- private static void defineElement( String name, int flags )
- {
- _elemDefs.put(name, flags);
- }
-
-
- private static void defineBoolean( String tagName, String attrName )
- {
- defineBoolean( tagName, new String[] { attrName } );
- }
-
-
- private static void defineBoolean( String tagName, String[] attrNames )
- {
- _boolAttrs.put( tagName, attrNames );
- }
-
-
- private static boolean isElement( String name, int flag )
- {
- Integer flags;
-
- flags = _elemDefs.get( name.toUpperCase(Locale.ENGLISH) );
- if ( flags == null )
- return false;
- else
- return ( ( flags.intValue() & flag ) == flag );
- }
-
-
- static
- {
- _elemDefs = new HashMap<>();
- defineElement( "ADDRESS", CLOSE_P );
- defineElement( "AREA", EMPTY );
- defineElement( "BASE", EMPTY | ALLOWED_HEAD );
- defineElement( "BASEFONT", EMPTY );
- defineElement( "BLOCKQUOTE", CLOSE_P );
- defineElement( "BODY", OPT_CLOSING );
- defineElement( "BR", EMPTY );
- defineElement( "COL", EMPTY );
- defineElement( "COLGROUP", ELEM_CONTENT | OPT_CLOSING | CLOSE_TABLE );
- defineElement( "DD", OPT_CLOSING | ONLY_OPENING | CLOSE_DD_DT );
- defineElement( "DIV", CLOSE_P );
- defineElement( "DL", ELEM_CONTENT | CLOSE_P );
- defineElement( "DT", OPT_CLOSING | ONLY_OPENING | CLOSE_DD_DT );
- defineElement( "FIELDSET", CLOSE_P );
- defineElement( "FORM", CLOSE_P );
- defineElement( "FRAME", EMPTY | OPT_CLOSING );
- defineElement( "H1", CLOSE_P );
- defineElement( "H2", CLOSE_P );
- defineElement( "H3", CLOSE_P );
- defineElement( "H4", CLOSE_P );
- defineElement( "H5", CLOSE_P );
- defineElement( "H6", CLOSE_P );
- defineElement( "HEAD", ELEM_CONTENT | OPT_CLOSING );
- defineElement( "HR", EMPTY | CLOSE_P );
- defineElement( "HTML", ELEM_CONTENT | OPT_CLOSING );
- defineElement( "IMG", EMPTY );
- defineElement( "INPUT", EMPTY );
- defineElement( "ISINDEX", EMPTY | ALLOWED_HEAD );
- defineElement( "LI", OPT_CLOSING | ONLY_OPENING | CLOSE_SELF );
- defineElement( "LINK", EMPTY | ALLOWED_HEAD );
- defineElement( "MAP", ALLOWED_HEAD );
- defineElement( "META", EMPTY | ALLOWED_HEAD );
- defineElement( "OL", ELEM_CONTENT | CLOSE_P );
- defineElement( "OPTGROUP", ELEM_CONTENT );
- defineElement( "OPTION", OPT_CLOSING | ONLY_OPENING | CLOSE_SELF );
- defineElement( "P", OPT_CLOSING | CLOSE_P | CLOSE_SELF );
- defineElement( "PARAM", EMPTY );
- defineElement( "PRE", PRESERVE | CLOSE_P );
- defineElement( "SCRIPT", ALLOWED_HEAD | PRESERVE );
- defineElement( "NOSCRIPT", ALLOWED_HEAD | PRESERVE );
- defineElement( "SELECT", ELEM_CONTENT );
- defineElement( "STYLE", ALLOWED_HEAD | PRESERVE );
- defineElement( "TABLE", ELEM_CONTENT | CLOSE_P );
- defineElement( "TBODY", ELEM_CONTENT | OPT_CLOSING | CLOSE_TABLE );
- defineElement( "TD", OPT_CLOSING | CLOSE_TH_TD );
- defineElement( "TEXTAREA", PRESERVE );
- defineElement( "TFOOT", ELEM_CONTENT | OPT_CLOSING | CLOSE_TABLE );
- defineElement( "TH", OPT_CLOSING | CLOSE_TH_TD );
- defineElement( "THEAD", ELEM_CONTENT | OPT_CLOSING | CLOSE_TABLE );
- defineElement( "TITLE", ALLOWED_HEAD );
- defineElement( "TR", ELEM_CONTENT | OPT_CLOSING | CLOSE_TABLE );
- defineElement( "UL", ELEM_CONTENT | CLOSE_P );
-
- _boolAttrs = new HashMap<>();
- defineBoolean( "AREA", "href" );
- defineBoolean( "BUTTON", "disabled" );
- defineBoolean( "DIR", "compact" );
- defineBoolean( "DL", "compact" );
- defineBoolean( "FRAME", "noresize" );
- defineBoolean( "HR", "noshade" );
- defineBoolean( "IMAGE", "ismap" );
- defineBoolean( "INPUT", new String[] { "defaultchecked", "checked", "readonly", "disabled" } );
- defineBoolean( "LINK", "link" );
- defineBoolean( "MENU", "compact" );
- defineBoolean( "OBJECT", "declare" );
- defineBoolean( "OL", "compact" );
- defineBoolean( "OPTGROUP", "disabled" );
- defineBoolean( "OPTION", new String[] { "default-selected", "selected", "disabled" } );
- defineBoolean( "SCRIPT", "defer" );
- defineBoolean( "SELECT", new String[] { "multiple", "disabled" } );
- defineBoolean( "STYLE", "disabled" );
- defineBoolean( "TD", "nowrap" );
- defineBoolean( "TH", "nowrap" );
- defineBoolean( "TEXTAREA", new String[] { "disabled", "readonly" } );
- defineBoolean( "UL", "compact" );
-
- initialize();
- }
-
-
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/serialize/IndentPrinter.java b/src/com/sun/org/apache/xml/internal/serialize/IndentPrinter.java
deleted file mode 100644
index efc7af1..0000000
--- a/src/com/sun/org/apache/xml/internal/serialize/IndentPrinter.java
+++ /dev/null
@@ -1,365 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package com.sun.org.apache.xml.internal.serialize;
-
-
-import java.io.Writer;
-import java.io.StringWriter;
-import java.io.IOException;
-
-
-/**
- * Extends {@link Printer} and adds support for indentation and line
- * wrapping.
- *
- * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
- */
-public class IndentPrinter
- extends Printer
-{
-
-
- /**
- * Holds the currently accumulating text line. This buffer will constantly
- * be reused by deleting its contents instead of reallocating it.
- */
- private StringBuffer _line;
-
-
- /**
- * Holds the currently accumulating text that follows {@link #_line}.
- * When the end of the part is identified by a call to {@link #printSpace}
- * or {@link #breakLine}, this part is added to the accumulated line.
- */
- private StringBuffer _text;
-
-
- /**
- * Counts how many white spaces come between the accumulated line and the
- * current accumulated text. Multiple spaces at the end of the a line
- * will not be printed.
- */
- private int _spaces;
-
-
- /**
- * Holds the indentation for the current line that is now accumulating in
- * memory and will be sent for printing shortly.
- */
- private int _thisIndent;
-
-
- /**
- * Holds the indentation for the next line to be printed. After this line is
- * printed, {@link #_nextIndent} is assigned to {@link #_thisIndent}.
- */
- private int _nextIndent;
-
-
- public IndentPrinter( Writer writer, OutputFormat format)
- {
- super( writer, format );
- // Initialize everything for a first/second run.
- _line = new StringBuffer( 80 );
- _text = new StringBuffer( 20 );
- _spaces = 0;
- _thisIndent = _nextIndent = 0;
- }
-
-
- /**
- * Called by any of the DTD handlers to enter DTD mode.
- * Once entered, all output will be accumulated in a string
- * that can be printed as part of the document's DTD.
- * This method may be called any number of time but will only
- * have affect the first time it's called. To exist DTD state
- * and get the accumulated DTD, call {@link #leaveDTD}.
- */
- public void enterDTD()
- {
- // Can only enter DTD state once. Once we're out of DTD
- // state, can no longer re-enter it.
- if ( _dtdWriter == null ) {
- _line.append( _text );
- _text = new StringBuffer( 20 );
- flushLine( false );
- _dtdWriter = new StringWriter();
- _docWriter = _writer;
- _writer = _dtdWriter;
- }
- }
-
-
- /**
- * Called by the root element to leave DTD mode and if any
- * DTD parts were printer, will return a string with their
- * textual content.
- */
- public String leaveDTD()
- {
- // Only works if we're going out of DTD mode.
- if ( _writer == _dtdWriter ) {
- _line.append( _text );
- _text = new StringBuffer( 20 );
- flushLine( false );
- _writer = _docWriter;
- return _dtdWriter.toString();
- } else
- return null;
- }
-
-
- /**
- * Called to print additional text. Each time this method is called
- * it accumulates more text. When a space is printed ({@link
- * #printSpace}) all the accumulated text becomes one part and is
- * added to the accumulate line. When a line is long enough, it can
- * be broken at its text boundary.
- *
- * @param text The text to print
- */
- public void printText( String text )
- {
- _text.append( text );
- }
-
-
- public void printText( StringBuffer text )
- {
- _text.append( text.toString() );
- }
-
-
- public void printText( char ch )
- {
- _text.append( ch );
- }
-
-
- public void printText( char[] chars, int start, int length )
- {
- _text.append( chars, start, length );
- }
-
-
- /**
- * Called to print a single space between text parts that may be
- * broken into separate lines. Must not be called to print a space
- * when preserving spaces. The text accumulated so far with {@link
- * #printText} will be added to the accumulated line, and a space
- * separator will be counted. If the line accumulated so far is
- * long enough, it will be printed.
- */
- public void printSpace()
- {
- // The line consists of the text accumulated in _line,
- // followed by one or more spaces as counted by _spaces,
- // followed by more space accumulated in _text:
- // - Text is printed and accumulated into _text.
- // - A space is printed, so _text is added to _line and
- // a space is counted.
- // - More text is printed and accumulated into _text.
- // - A space is printed, the previous spaces are added
- // to _line, the _text is added to _line, and a new
- // space is counted.
-
- // If text was accumulated with printText(), then the space
- // means we have to move that text into the line and
- // start accumulating new text with printText().
- if ( _text.length() > 0 ) {
- // If the text breaks a line bounary, wrap to the next line.
- // The printed line size consists of the indentation we're going
- // to use next, the accumulated line so far, some spaces and the
- // accumulated text so far.
- if ( _format.getLineWidth() > 0 &&
- _thisIndent + _line.length() + _spaces + _text.length() > _format.getLineWidth() ) {
- flushLine( false );
- try {
- // Print line and new line, then zero the line contents.
- _writer.write( _format.getLineSeparator() );
- } catch ( IOException except ) {
- // We don't throw an exception, but hold it
- // until the end of the document.
- if ( _exception == null )
- _exception = except;
- }
- }
-
- // Add as many spaces as we accumulaed before.
- // At the end of this loop, _spaces is zero.
- while ( _spaces > 0 ) {
- _line.append( ' ' );
- --_spaces;
- }
- _line.append( _text );
- _text = new StringBuffer( 20 );
- }
- // Starting a new word: accumulate the text between the line
- // and this new word; not a new word: just add another space.
- ++_spaces;
- }
-
-
- /**
- * Called to print a line consisting of the text accumulated so
- * far. This is equivalent to calling {@link #printSpace} but
- * forcing the line to print and starting a new line ({@link
- * #printSpace} will only start a new line if the current line
- * is long enough).
- */
- public void breakLine()
- {
- breakLine( false );
- }
-
-
- public void breakLine( boolean preserveSpace )
- {
- // Equivalent to calling printSpace and forcing a flushLine.
- if ( _text.length() > 0 ) {
- while ( _spaces > 0 ) {
- _line.append( ' ' );
- --_spaces;
- }
- _line.append( _text );
- _text = new StringBuffer( 20 );
- }
- flushLine( preserveSpace );
- try {
- // Print line and new line, then zero the line contents.
- _writer.write( _format.getLineSeparator() );
- } catch ( IOException except ) {
- // We don't throw an exception, but hold it
- // until the end of the document.
- if ( _exception == null )
- _exception = except;
- }
- }
-
-
- /**
- * Flushes the line accumulated so far to the writer and get ready
- * to accumulate the next line. This method is called by {@link
- * #printText} and {@link #printSpace} when the accumulated line plus
- * accumulated text are two long to fit on a given line. At the end of
- * this method _line is empty and _spaces is zero.
- */
- public void flushLine( boolean preserveSpace )
- {
- int indent;
-
- if ( _line.length() > 0 ) {
- try {
-
- if ( _format.getIndenting() && ! preserveSpace ) {
- // Make sure the indentation does not blow us away.
- indent = _thisIndent;
- if ( ( 2 * indent ) > _format.getLineWidth() && _format.getLineWidth() > 0 )
- indent = _format.getLineWidth() / 2;
- // Print the indentation as spaces and set the current
- // indentation to the next expected indentation.
- while ( indent > 0 ) {
- _writer.write( ' ' );
- --indent;
- }
- }
- _thisIndent = _nextIndent;
-
- // There is no need to print the spaces at the end of the line,
- // they are simply stripped and replaced with a single line
- // separator.
- _spaces = 0;
- _writer.write( _line.toString() );
-
- _line = new StringBuffer( 40 );
- } catch ( IOException except ) {
- // We don't throw an exception, but hold it
- // until the end of the document.
- if ( _exception == null )
- _exception = except;
- }
- }
- }
-
-
- /**
- * Flush the output stream. Must be called when done printing
- * the document, otherwise some text might be buffered.
- */
- public void flush()
- {
- if ( _line.length() > 0 || _text.length() > 0 )
- breakLine();
- try {
- _writer.flush();
- } catch ( IOException except ) {
- // We don't throw an exception, but hold it
- // until the end of the document.
- if ( _exception == null )
- _exception = except;
- }
- }
-
-
- /**
- * Increment the indentation for the next line.
- */
- public void indent()
- {
- _nextIndent += _format.getIndent();
- }
-
-
- /**
- * Decrement the indentation for the next line.
- */
- public void unindent()
- {
- _nextIndent -= _format.getIndent();
- if ( _nextIndent < 0 )
- _nextIndent = 0;
- // If there is no current line and we're de-identing then
- // this indentation level is actually the next level.
- if ( ( _line.length() + _spaces + _text.length() ) == 0 )
- _thisIndent = _nextIndent;
- }
-
-
- public int getNextIndent()
- {
- return _nextIndent;
- }
-
-
- public void setNextIndent( int indent )
- {
- _nextIndent = indent;
- }
-
-
- public void setThisIndent( int indent )
- {
- _thisIndent = indent;
- }
-
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/serialize/LineSeparator.java b/src/com/sun/org/apache/xml/internal/serialize/LineSeparator.java
deleted file mode 100644
index bb4b1b9..0000000
--- a/src/com/sun/org/apache/xml/internal/serialize/LineSeparator.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package com.sun.org.apache.xml.internal.serialize;
-
-
-/**
- * @author <a href="mailto:arkin@intalio..com">Assaf Arkin</a>
- * @see OutputFormat
- */
-public final class LineSeparator
-{
-
-
- /**
- * Line separator for Unix systems (<tt>\n</tt>).
- */
- public static final String Unix = "\n";
-
-
- /**
- * Line separator for Windows systems (<tt>\r\n</tt>).
- */
- public static final String Windows = "\r\n";
-
-
- /**
- * Line separator for Macintosh systems (<tt>\r</tt>).
- */
- public static final String Macintosh = "\r";
-
-
- /**
- * Line separator for the Web (<tt>\n</tt>).
- */
- public static final String Web = "\n";
-
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/serialize/Method.java b/src/com/sun/org/apache/xml/internal/serialize/Method.java
deleted file mode 100644
index c6cfff0..0000000
--- a/src/com/sun/org/apache/xml/internal/serialize/Method.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package com.sun.org.apache.xml.internal.serialize;
-
-
-/**
- * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
- * @see OutputFormat
- */
-public final class Method
-{
-
-
- /**
- * The output method for XML documents.
- */
- public static final String XML = "xml";
-
-
- /**
- * The output method for HTML documents.
- */
- public static final String HTML = "html";
-
-
- /**
- * The output method for HTML documents as XHTML.
- */
- public static final String XHTML = "xhtml";
-
-
- /**
- * The output method for text documents.
- */
- public static final String TEXT = "text";
-
-
- /**
- * The output method for FO documents as PDF.
- */
- public static final String FOP = "fop";
-
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/serialize/OutputFormat.java b/src/com/sun/org/apache/xml/internal/serialize/OutputFormat.java
deleted file mode 100644
index 505a899..0000000
--- a/src/com/sun/org/apache/xml/internal/serialize/OutputFormat.java
+++ /dev/null
@@ -1,961 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-// Aug 21, 2000:
-// Added ability to omit DOCTYPE declaration.
-// Reported by Lars Martin <lars@smb-tec.com>
-// Aug 25, 2000:
-// Added ability to omit comments.
-// Contributed by Anupam Bagchi <abagchi@jtcsv.com>
-
-
-package com.sun.org.apache.xml.internal.serialize;
-
-
-import java.io.UnsupportedEncodingException;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Node;
-import org.w3c.dom.html.HTMLDocument;
-
-
-/**
- * Specifies an output format to control the serializer. Based on the
- * XSLT specification for output format, plus additional parameters.
- * Used to select the suitable serializer and determine how the
- * document should be formatted on output.
- * <p>
- * The two interesting constructors are:
- * <ul>
- * <li>{@link #OutputFormat(String,String,boolean)} creates a format
- * for the specified method (XML, HTML, Text, etc), encoding and indentation
- * <li>{@link #OutputFormat(Document,String,boolean)} creates a format
- * compatible with the document type (XML, HTML, Text, etc), encoding and
- * indentation
- * </ul>
- *
- *
- * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
- * <a href="mailto:visco@intalio.com">Keith Visco</a>
- * @see Serializer
- * @see Method
- * @see LineSeparator
- */
-public class OutputFormat
-{
-
-
- public static class DTD
- {
-
- /**
- * Public identifier for HTML 4.01 (Strict) document type.
- */
- public static final String HTMLPublicId = "-//W3C//DTD HTML 4.01//EN";
-
- /**
- * System identifier for HTML 4.01 (Strict) document type.
- */
- public static final String HTMLSystemId =
- "http://www.w3.org/TR/html4/strict.dtd";
-
- /**
- * Public identifier for XHTML 1.0 (Strict) document type.
- */
- public static final String XHTMLPublicId =
- "-//W3C//DTD XHTML 1.0 Strict//EN";
-
- /**
- * System identifier for XHTML 1.0 (Strict) document type.
- */
- public static final String XHTMLSystemId =
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";
-
- }
-
-
- public static class Defaults
- {
-
- /**
- * If indentation is turned on, the default identation
- * level is 4.
- *
- * @see #setIndenting(boolean)
- */
- public static final int Indent = 4;
-
- /**
- * The default encoding for Web documents it UTF-8.
- *
- * @see #getEncoding()
- */
- public static final String Encoding = "UTF-8";
-
- /**
- * The default line width at which to break long lines
- * when identing. This is set to 72.
- */
- public static final int LineWidth = 72;
-
- }
-
-
- /**
- * Holds the output method specified for this document,
- * or null if no method was specified.
- */
- private String _method;
-
-
- /**
- * Specifies the version of the output method.
- */
- private String _version;
-
-
- /**
- * The indentation level, or zero if no indentation
- * was requested.
- */
- private int _indent = 0;
-
-
- /**
- * The encoding to use, if an input stream is used.
- * The default is always UTF-8.
- */
- private String _encoding = Defaults.Encoding;
-
- /**
- * The EncodingInfo instance for _encoding.
- */
- private EncodingInfo _encodingInfo = null;
-
- // whether java names for encodings are permitted
- private boolean _allowJavaNames = false;
-
- /**
- * The specified media type or null.
- */
- private String _mediaType;
-
-
- /**
- * The specified document type system identifier, or null.
- */
- private String _doctypeSystem;
-
-
- /**
- * The specified document type public identifier, or null.
- */
- private String _doctypePublic;
-
-
- /**
- * Ture if the XML declaration should be ommited;
- */
- private boolean _omitXmlDeclaration = false;
-
-
- /**
- * Ture if the DOCTYPE declaration should be ommited;
- */
- private boolean _omitDoctype = false;
-
-
- /**
- * Ture if comments should be ommited;
- */
- private boolean _omitComments = false;
-
-
- /**
- * Ture if the comments should be ommited;
- */
- private boolean _stripComments = false;
-
-
- /**
- * True if the document type should be marked as standalone.
- */
- private boolean _standalone = false;
-
-
- /**
- * List of element tag names whose text node children must
- * be output as CDATA.
- */
- private String[] _cdataElements;
-
-
- /**
- * List of element tag names whose text node children must
- * be output unescaped.
- */
- private String[] _nonEscapingElements;
-
-
- /**
- * The selected line separator.
- */
- private String _lineSeparator = LineSeparator.Web;
-
-
- /**
- * The line width at which to wrap long lines when indenting.
- */
- private int _lineWidth = Defaults.LineWidth;
-
-
- /**
- * True if spaces should be preserved in elements that do not
- * specify otherwise, or specify the default behavior.
- */
- private boolean _preserve = false;
- /** If true, an empty string valued attribute is output as "". If false and
- * and we are using the HTMLSerializer, then only the attribute name is
- * serialized. Defaults to false for backwards compatibility.
- */
- private boolean _preserveEmptyAttributes = false;
-
- /**
- * Constructs a new output format with the default values.
- */
- public OutputFormat()
- {
- }
-
-
- /**
- * Constructs a new output format with the default values for
- * the specified method and encoding. If <tt>indent</tt>
- * is true, the document will be pretty printed with the default
- * indentation level and default line wrapping.
- *
- * @param method The specified output method
- * @param encoding The specified encoding
- * @param indenting True for pretty printing
- * @see #setEncoding
- * @see #setIndenting
- * @see #setMethod
- */
- public OutputFormat( String method, String encoding, boolean indenting )
- {
- setMethod( method );
- setEncoding( encoding );
- setIndenting( indenting );
- }
-
-
- /**
- * Constructs a new output format with the proper method,
- * document type identifiers and media type for the specified
- * document.
- *
- * @param doc The document to output
- * @see #whichMethod
- */
- public OutputFormat( Document doc )
- {
- setMethod( whichMethod( doc ) );
- setDoctype( whichDoctypePublic( doc ), whichDoctypeSystem( doc ) );
- setMediaType( whichMediaType( getMethod() ) );
- }
-
-
- /**
- * Constructs a new output format with the proper method,
- * document type identifiers and media type for the specified
- * document, and with the specified encoding. If <tt>indent</tt>
- * is true, the document will be pretty printed with the default
- * indentation level and default line wrapping.
- *
- * @param doc The document to output
- * @param encoding The specified encoding
- * @param indenting True for pretty printing
- * @see #setEncoding
- * @see #setIndenting
- * @see #whichMethod
- */
- public OutputFormat( Document doc, String encoding, boolean indenting )
- {
- this( doc );
- setEncoding( encoding );
- setIndenting( indenting );
- }
-
-
- /**
- * Returns the method specified for this output format.
- * Typically the method will be <tt>xml</tt>, <tt>html</tt>
- * or <tt>text</tt>, but it might be other values.
- * If no method was specified, null will be returned
- * and the most suitable method will be determined for
- * the document by calling {@link #whichMethod}.
- *
- * @return The specified output method, or null
- */
- public String getMethod()
- {
- return _method;
- }
-
-
- /**
- * Sets the method for this output format.
- *
- * @see #getMethod
- * @param method The output method, or null
- */
- public void setMethod( String method )
- {
- _method = method;
- }
-
-
- /**
- * Returns the version for this output method.
- * If no version was specified, will return null
- * and the default version number will be used.
- * If the serializerr does not support that particular
- * version, it should default to a supported version.
- *
- * @return The specified method version, or null
- */
- public String getVersion()
- {
- return _version;
- }
-
-
- /**
- * Sets the version for this output method.
- * For XML the value would be "1.0", for HTML
- * it would be "4.0".
- *
- * @see #getVersion
- * @param version The output method version, or null
- */
- public void setVersion( String version )
- {
- _version = version;
- }
-
-
- /**
- * Returns the indentation specified. If no indentation
- * was specified, zero is returned and the document
- * should not be indented.
- *
- * @return The indentation or zero
- * @see #setIndenting
- */
- public int getIndent()
- {
- return _indent;
- }
-
-
- /**
- * Returns true if indentation was specified.
- */
- public boolean getIndenting()
- {
- return ( _indent > 0 );
- }
-
-
- /**
- * Sets the indentation. The document will not be
- * indented if the indentation is set to zero.
- * Calling {@link #setIndenting} will reset this
- * value to zero (off) or the default (on).
- *
- * @param indent The indentation, or zero
- */
- public void setIndent( int indent )
- {
- if ( indent < 0 )
- _indent = 0;
- else
- _indent = indent;
- }
-
-
- /**
- * Sets the indentation on and off. When set on, the default
- * indentation level and default line wrapping is used
- * (see {@link Defaults#Indent} and {@link Defaults#LineWidth}).
- * To specify a different indentation level or line wrapping,
- * use {@link #setIndent} and {@link #setLineWidth}.
- *
- * @param on True if indentation should be on
- */
- public void setIndenting( boolean on )
- {
- if ( on ) {
- _indent = Defaults.Indent;
- _lineWidth = Defaults.LineWidth;
- } else {
- _indent = 0;
- _lineWidth = 0;
- }
- }
-
-
- /**
- * Returns the specified encoding. If no encoding was
- * specified, the default is always "UTF-8".
- *
- * @return The encoding
- */
- public String getEncoding()
- {
- return _encoding;
- }
-
-
- /**
- * Sets the encoding for this output method. If no
- * encoding was specified, the default is always "UTF-8".
- * Make sure the encoding is compatible with the one
- * used by the {@link java.io.Writer}.
- *
- * @see #getEncoding
- * @param encoding The encoding, or null
- */
- public void setEncoding( String encoding )
- {
- _encoding = encoding;
- _encodingInfo = null;
- }
-
- /**
- * Sets the encoding for this output method with an <code>EncodingInfo</code>
- * instance.
- */
- public void setEncoding(EncodingInfo encInfo) {
- _encoding = encInfo.getIANAName();
- _encodingInfo = encInfo;
- }
-
- /**
- * Returns an <code>EncodingInfo<code> instance for the encoding.
- *
- * @see #setEncoding
- */
- public EncodingInfo getEncodingInfo() throws UnsupportedEncodingException {
- if (_encodingInfo == null)
- _encodingInfo = Encodings.getEncodingInfo(_encoding, _allowJavaNames);
- return _encodingInfo;
- }
-
- /**
- * Sets whether java encoding names are permitted
- */
- public void setAllowJavaNames (boolean allow) {
- _allowJavaNames = allow;
- }
-
- /**
- * Returns whether java encoding names are permitted
- */
- public boolean setAllowJavaNames () {
- return _allowJavaNames;
- }
-
- /**
- * Returns the specified media type, or null.
- * To determine the media type based on the
- * document type, use {@link #whichMediaType}.
- *
- * @return The specified media type, or null
- */
- public String getMediaType()
- {
- return _mediaType;
- }
-
-
- /**
- * Sets the media type.
- *
- * @see #getMediaType
- * @param mediaType The specified media type
- */
- public void setMediaType( String mediaType )
- {
- _mediaType = mediaType;
- }
-
-
- /**
- * Sets the document type public and system identifiers.
- * Required only if the DOM Document or SAX events do not
- * specify the document type, and one must be present in
- * the serialized document. Any document type specified
- * by the DOM Document or SAX events will override these
- * values.
- *
- * @param publicId The public identifier, or null
- * @param systemId The system identifier, or null
- */
- public void setDoctype( String publicId, String systemId )
- {
- _doctypePublic = publicId;
- _doctypeSystem = systemId;
- }
-
-
- /**
- * Returns the specified document type public identifier,
- * or null.
- */
- public String getDoctypePublic()
- {
- return _doctypePublic;
- }
-
-
- /**
- * Returns the specified document type system identifier,
- * or null.
- */
- public String getDoctypeSystem()
- {
- return _doctypeSystem;
- }
-
-
- /**
- * Returns true if comments should be ommited.
- * The default is false.
- */
- public boolean getOmitComments()
- {
- return _omitComments;
- }
-
-
- /**
- * Sets comment omitting on and off.
- *
- * @param omit True if comments should be ommited
- */
- public void setOmitComments( boolean omit )
- {
- _omitComments = omit;
- }
-
-
- /**
- * Returns true if the DOCTYPE declaration should
- * be ommited. The default is false.
- */
- public boolean getOmitDocumentType()
- {
- return _omitDoctype;
- }
-
-
- /**
- * Sets DOCTYPE declaration omitting on and off.
- *
- * @param omit True if DOCTYPE declaration should be ommited
- */
- public void setOmitDocumentType( boolean omit )
- {
- _omitDoctype = omit;
- }
-
-
- /**
- * Returns true if the XML document declaration should
- * be ommited. The default is false.
- */
- public boolean getOmitXMLDeclaration()
- {
- return _omitXmlDeclaration;
- }
-
-
- /**
- * Sets XML declaration omitting on and off.
- *
- * @param omit True if XML declaration should be ommited
- */
- public void setOmitXMLDeclaration( boolean omit )
- {
- _omitXmlDeclaration = omit;
- }
-
-
- /**
- * Returns true if the document type is standalone.
- * The default is false.
- */
- public boolean getStandalone()
- {
- return _standalone;
- }
-
-
- /**
- * Sets document DTD standalone. The public and system
- * identifiers must be null for the document to be
- * serialized as standalone.
- *
- * @param standalone True if document DTD is standalone
- */
- public void setStandalone( boolean standalone )
- {
- _standalone = standalone;
- }
-
-
- /**
- * Returns a list of all the elements whose text node children
- * should be output as CDATA, or null if no such elements were
- * specified.
- */
- public String[] getCDataElements()
- {
- return _cdataElements;
- }
-
-
- /**
- * Returns true if the text node children of the given elements
- * should be output as CDATA.
- *
- * @param tagName The element's tag name
- * @return True if should serialize as CDATA
- */
- public boolean isCDataElement( String tagName )
- {
- int i;
-
- if ( _cdataElements == null )
- return false;
- for ( i = 0 ; i < _cdataElements.length ; ++i )
- if ( _cdataElements[ i ].equals( tagName ) )
- return true;
- return false;
- }
-
-
- /**
- * Sets the list of elements for which text node children
- * should be output as CDATA.
- *
- * @param cdataElements List of CDATA element tag names
- */
- public void setCDataElements( String[] cdataElements )
- {
- _cdataElements = cdataElements;
- }
-
-
- /**
- * Returns a list of all the elements whose text node children
- * should be output unescaped (no character references), or null
- * if no such elements were specified.
- */
- public String[] getNonEscapingElements()
- {
- return _nonEscapingElements;
- }
-
-
- /**
- * Returns true if the text node children of the given elements
- * should be output unescaped.
- *
- * @param tagName The element's tag name
- * @return True if should serialize unescaped
- */
- public boolean isNonEscapingElement( String tagName )
- {
- int i;
-
- if ( _nonEscapingElements == null ) {
- return false;
- }
- for ( i = 0 ; i < _nonEscapingElements.length ; ++i )
- if ( _nonEscapingElements[ i ].equals( tagName ) )
- return true;
- return false;
- }
-
-
- /**
- * Sets the list of elements for which text node children
- * should be output unescaped (no character references).
- *
- * @param nonEscapingElements List of unescaped element tag names
- */
- public void setNonEscapingElements( String[] nonEscapingElements )
- {
- _nonEscapingElements = nonEscapingElements;
- }
-
-
-
- /**
- * Returns a specific line separator to use. The default is the
- * Web line separator (<tt>\n</tt>). A string is returned to
- * support double codes (CR + LF).
- *
- * @return The specified line separator
- */
- public String getLineSeparator()
- {
- return _lineSeparator;
- }
-
-
- /**
- * Sets the line separator. The default is the Web line separator
- * (<tt>\n</tt>). The machine's line separator can be obtained
- * from the system property <tt>line.separator</tt>, but is only
- * useful if the document is edited on machines of the same type.
- * For general documents, use the Web line separator.
- *
- * @param lineSeparator The specified line separator
- */
- public void setLineSeparator( String lineSeparator )
- {
- if ( lineSeparator == null )
- _lineSeparator = LineSeparator.Web;
- else
- _lineSeparator = lineSeparator;
- }
-
-
- /**
- * Returns true if the default behavior for this format is to
- * preserve spaces. All elements that do not specify otherwise
- * or specify the default behavior will be formatted based on
- * this rule. All elements that specify space preserving will
- * always preserve space.
- */
- public boolean getPreserveSpace()
- {
- return _preserve;
- }
-
-
- /**
- * Sets space preserving as the default behavior. The default is
- * space stripping and all elements that do not specify otherwise
- * or use the default value will not preserve spaces.
- *
- * @param preserve True if spaces should be preserved
- */
- public void setPreserveSpace( boolean preserve )
- {
- _preserve = preserve;
- }
-
-
- /**
- * Return the selected line width for breaking up long lines.
- * When indenting, and only when indenting, long lines will be
- * broken at space boundaries based on this line width.
- * No line wrapping occurs if this value is zero.
- */
- public int getLineWidth()
- {
- return _lineWidth;
- }
-
-
- /**
- * Sets the line width. If zero then no line wrapping will
- * occur. Calling {@link #setIndenting} will reset this
- * value to zero (off) or the default (on).
- *
- * @param lineWidth The line width to use, zero for default
- * @see #getLineWidth
- * @see #setIndenting
- */
- public void setLineWidth( int lineWidth )
- {
- if ( lineWidth <= 0 )
- _lineWidth = 0;
- else
- _lineWidth = lineWidth;
- }
- /**
- * Returns the preserveEmptyAttribute flag. If flag is false, then'
- * attributes with empty string values are output as the attribute
- * name only (in HTML mode).
- * @return preserve the preserve flag
- */ public boolean getPreserveEmptyAttributes () { return _preserveEmptyAttributes; } /**
- * Sets the preserveEmptyAttribute flag. If flag is false, then'
- * attributes with empty string values are output as the attribute
- * name only (in HTML mode).
- * @param preserve the preserve flag
- */ public void setPreserveEmptyAttributes (boolean preserve) { _preserveEmptyAttributes = preserve; }
-
- /**
- * Returns the last printable character based on the selected
- * encoding. Control characters and non-printable characters
- * are always printed as character references.
- */
- public char getLastPrintable()
- {
- if ( getEncoding() != null &&
- ( getEncoding().equalsIgnoreCase( "ASCII" ) ) )
- return 0xFF;
- else
- return 0xFFFF;
- }
-
-
- /**
- * Determine the output method for the specified document.
- * If the document is an instance of {@link org.w3c.dom.html.HTMLDocument}
- * then the method is said to be <tt>html</tt>. If the root
- * element is 'html' and all text nodes preceding the root
- * element are all whitespace, then the method is said to be
- * <tt>html</tt>. Otherwise the method is <tt>xml</tt>.
- *
- * @param doc The document to check
- * @return The suitable method
- */
- public static String whichMethod( Document doc )
- {
- Node node;
- String value;
- int i;
-
- // If document is derived from HTMLDocument then the default
- // method is html.
- if ( doc instanceof HTMLDocument )
- return Method.HTML;
-
- // Lookup the root element and the text nodes preceding it.
- // If root element is html and all text nodes contain whitespace
- // only, the method is html.
-
- // FIXME (SM) should we care about namespaces here?
-
- node = doc.getFirstChild();
- while (node != null) {
- // If the root element is html, the method is html.
- if ( node.getNodeType() == Node.ELEMENT_NODE ) {
- if ( node.getNodeName().equalsIgnoreCase( "html" ) ) {
- return Method.HTML;
- } else if ( node.getNodeName().equalsIgnoreCase( "root" ) ) {
- return Method.FOP;
- } else {
- return Method.XML;
- }
- } else if ( node.getNodeType() == Node.TEXT_NODE ) {
- // If a text node preceding the root element contains
- // only whitespace, this might be html, otherwise it's
- // definitely xml.
- value = node.getNodeValue();
- for ( i = 0 ; i < value.length() ; ++i )
- if ( value.charAt( i ) != 0x20 && value.charAt( i ) != 0x0A &&
- value.charAt( i ) != 0x09 && value.charAt( i ) != 0x0D )
- return Method.XML;
- }
- node = node.getNextSibling();
- }
- // Anything else, the method is xml.
- return Method.XML;
- }
-
-
- /**
- * Returns the document type public identifier
- * specified for this document, or null.
- */
- public static String whichDoctypePublic( Document doc )
- {
- DocumentType doctype;
-
- /* DOM Level 2 was introduced into the code base*/
- doctype = doc.getDoctype();
- if ( doctype != null ) {
- // Note on catch: DOM Level 1 does not specify this method
- // and the code will throw a NoSuchMethodError
- try {
- return doctype.getPublicId();
- } catch ( Error except ) { }
- }
-
- if ( doc instanceof HTMLDocument )
- return DTD.XHTMLPublicId;
- return null;
- }
-
-
- /**
- * Returns the document type system identifier
- * specified for this document, or null.
- */
- public static String whichDoctypeSystem( Document doc )
- {
- DocumentType doctype;
-
- /* DOM Level 2 was introduced into the code base*/
- doctype = doc.getDoctype();
- if ( doctype != null ) {
- // Note on catch: DOM Level 1 does not specify this method
- // and the code will throw a NoSuchMethodError
- try {
- return doctype.getSystemId();
- } catch ( Error except ) { }
- }
-
- if ( doc instanceof HTMLDocument )
- return DTD.XHTMLSystemId;
- return null;
- }
-
-
- /**
- * Returns the suitable media format for a document
- * output with the specified method.
- */
- public static String whichMediaType( String method )
- {
- if ( method.equalsIgnoreCase( Method.XML ) )
- return "text/xml";
- if ( method.equalsIgnoreCase( Method.HTML ) )
- return "text/html";
- if ( method.equalsIgnoreCase( Method.XHTML ) )
- return "text/html";
- if ( method.equalsIgnoreCase( Method.TEXT ) )
- return "text/plain";
- if ( method.equalsIgnoreCase( Method.FOP ) )
- return "application/pdf";
- return null;
- }
-
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/serialize/Printer.java b/src/com/sun/org/apache/xml/internal/serialize/Printer.java
deleted file mode 100644
index ab9d8e4..0000000
--- a/src/com/sun/org/apache/xml/internal/serialize/Printer.java
+++ /dev/null
@@ -1,364 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-// Sep 14, 2000:
-// Fixed serializer to report IO exception directly, instead at
-// the end of document processing.
-// Reported by Patrick Higgins <phiggins@transzap.com>
-
-
-package com.sun.org.apache.xml.internal.serialize;
-
-
-import java.io.Writer;
-import java.io.StringWriter;
-import java.io.IOException;
-
-
-/**
- * The printer is responsible for sending text to the output stream
- * or writer. This class performs direct writing for efficiency.
- * {@link IndentPrinter} supports indentation and line wrapping by
- * extending this class.
- *
- * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
- */
-public class Printer
-{
-
-
- /**
- * The output format associated with this serializer. This will never
- * be a null reference. If no format was passed to the constructor,
- * the default one for this document type will be used. The format
- * object is never changed by the serializer.
- */
- protected final OutputFormat _format;
-
-
- /**
- * The writer to which the document is written.
- */
- protected Writer _writer;
-
-
- /**
- * The DTD writer. When we switch to DTD mode, all output is
- * accumulated in this DTD writer. When we switch out of it,
- * the output is obtained as a string. Must not be reset to
- * null until we're done with the document.
- */
- protected StringWriter _dtdWriter;
-
-
- /**
- * Holds a reference to the document writer while we are
- * in DTD mode.
- */
- protected Writer _docWriter;
-
-
- /**
- * Holds the exception thrown by the serializer. Exceptions do not cause
- * the serializer to quit, but are held and one is thrown at the end.
- */
- protected IOException _exception;
-
-
- /**
- * The size of the output buffer.
- */
- private static final int BufferSize = 4096;
-
-
- /**
- * Output buffer.
- */
- private final char[] _buffer = new char[ BufferSize ];
-
-
- /**
- * Position within the output buffer.
- */
- private int _pos = 0;
-
-
- public Printer( Writer writer, OutputFormat format)
- {
- _writer = writer;
- _format = format;
- _exception = null;
- _dtdWriter = null;
- _docWriter = null;
- _pos = 0;
- }
-
-
- public IOException getException()
- {
- return _exception;
- }
-
-
- /**
- * Called by any of the DTD handlers to enter DTD mode.
- * Once entered, all output will be accumulated in a string
- * that can be printed as part of the document's DTD.
- * This method may be called any number of time but will only
- * have affect the first time it's called. To exist DTD state
- * and get the accumulated DTD, call {@link #leaveDTD}.
- */
- public void enterDTD()
- throws IOException
- {
- // Can only enter DTD state once. Once we're out of DTD
- // state, can no longer re-enter it.
- if ( _dtdWriter == null ) {
- flushLine( false );
-
- _dtdWriter = new StringWriter();
- _docWriter = _writer;
- _writer = _dtdWriter;
- }
- }
-
-
- /**
- * Called by the root element to leave DTD mode and if any
- * DTD parts were printer, will return a string with their
- * textual content.
- */
- public String leaveDTD()
- throws IOException
- {
- // Only works if we're going out of DTD mode.
- if ( _writer == _dtdWriter ) {
- flushLine( false );
-
- _writer = _docWriter;
- return _dtdWriter.toString();
- } else
- return null;
- }
-
-
- public void printText( String text )
- throws IOException
- {
- try {
- int length = text.length();
- for ( int i = 0 ; i < length ; ++i ) {
- if ( _pos == BufferSize ) {
- _writer.write( _buffer );
- _pos = 0;
- }
- _buffer[ _pos ] = text.charAt( i );
- ++_pos;
- }
- } catch ( IOException except ) {
- // We don't throw an exception, but hold it
- // until the end of the document.
- if ( _exception == null )
- _exception = except;
- throw except;
- }
- }
-
-
- public void printText( StringBuffer text )
- throws IOException
- {
- try {
- int length = text.length();
- for ( int i = 0 ; i < length ; ++i ) {
- if ( _pos == BufferSize ) {
- _writer.write( _buffer );
- _pos = 0;
- }
- _buffer[ _pos ] = text.charAt( i );
- ++_pos;
- }
- } catch ( IOException except ) {
- // We don't throw an exception, but hold it
- // until the end of the document.
- if ( _exception == null )
- _exception = except;
- throw except;
- }
- }
-
-
- public void printText( char[] chars, int start, int length )
- throws IOException
- {
- try {
- while ( length-- > 0 ) {
- if ( _pos == BufferSize ) {
- _writer.write( _buffer );
- _pos = 0;
- }
- _buffer[ _pos ] = chars[ start ];
- ++start;
- ++_pos;
- }
- } catch ( IOException except ) {
- // We don't throw an exception, but hold it
- // until the end of the document.
- if ( _exception == null )
- _exception = except;
- throw except;
- }
- }
-
-
- public void printText( char ch )
- throws IOException
- {
- try {
- if ( _pos == BufferSize ) {
- _writer.write( _buffer );
- _pos = 0;
- }
- _buffer[ _pos ] = ch;
- ++_pos;
- } catch ( IOException except ) {
- // We don't throw an exception, but hold it
- // until the end of the document.
- if ( _exception == null )
- _exception = except;
- throw except;
- }
- }
-
-
- public void printSpace()
- throws IOException
- {
- try {
- if ( _pos == BufferSize ) {
- _writer.write( _buffer );
- _pos = 0;
- }
- _buffer[ _pos ] = ' ';
- ++_pos;
- } catch ( IOException except ) {
- // We don't throw an exception, but hold it
- // until the end of the document.
- if ( _exception == null )
- _exception = except;
- throw except;
- }
- }
-
-
- public void breakLine()
- throws IOException
- {
- try {
- if ( _pos == BufferSize ) {
- _writer.write( _buffer );
- _pos = 0;
- }
- _buffer[ _pos ] = '\n';
- ++_pos;
- } catch ( IOException except ) {
- // We don't throw an exception, but hold it
- // until the end of the document.
- if ( _exception == null )
- _exception = except;
- throw except;
- }
- }
-
-
- public void breakLine( boolean preserveSpace )
- throws IOException
- {
- breakLine();
- }
-
-
- public void flushLine( boolean preserveSpace )
- throws IOException
- {
- // Write anything left in the buffer into the writer.
- try {
- _writer.write( _buffer, 0, _pos );
- } catch ( IOException except ) {
- // We don't throw an exception, but hold it
- // until the end of the document.
- if ( _exception == null )
- _exception = except;
- }
- _pos = 0;
- }
-
-
- /**
- * Flush the output stream. Must be called when done printing
- * the document, otherwise some text might be buffered.
- */
- public void flush()
- throws IOException
- {
- try {
- _writer.write( _buffer, 0, _pos );
- _writer.flush();
- } catch ( IOException except ) {
- // We don't throw an exception, but hold it
- // until the end of the document.
- if ( _exception == null )
- _exception = except;
- throw except;
- }
- _pos = 0;
- }
-
-
- public void indent()
- {
- // NOOP
- }
-
-
- public void unindent()
- {
- // NOOP
- }
-
-
- public int getNextIndent()
- {
- return 0;
- }
-
-
- public void setNextIndent( int indent )
- {
- }
-
-
- public void setThisIndent( int indent )
- {
- }
-
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/serialize/SecuritySupport.java b/src/com/sun/org/apache/xml/internal/serialize/SecuritySupport.java
deleted file mode 100644
index b8ad8f8..0000000
--- a/src/com/sun/org/apache/xml/internal/serialize/SecuritySupport.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xml.internal.serialize;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.InputStream;
-
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-
-/**
- * This class is duplicated for each subpackage so keep it in sync.
- * It is package private and therefore is not exposed as part of any API.
- *
- * @xerces.internal
- */
-final class SecuritySupport {
-
- private static final SecuritySupport securitySupport = new SecuritySupport();
-
- /**
- * Return an instance of this class.
- */
- static SecuritySupport getInstance() {
- return securitySupport;
- }
-
- ClassLoader getContextClassLoader() {
- return (ClassLoader)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- ClassLoader cl = null;
- try {
- cl = Thread.currentThread().getContextClassLoader();
- } catch (SecurityException ex) { }
- return cl;
- }
- });
- }
-
- ClassLoader getSystemClassLoader() {
- return (ClassLoader)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- ClassLoader cl = null;
- try {
- cl = ClassLoader.getSystemClassLoader();
- } catch (SecurityException ex) {}
- return cl;
- }
- });
- }
-
- ClassLoader getParentClassLoader(final ClassLoader cl) {
- return (ClassLoader)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- ClassLoader parent = null;
- try {
- parent = cl.getParent();
- } catch (SecurityException ex) {}
-
- // eliminate loops in case of the boot
- // ClassLoader returning itself as a parent
- return (parent == cl) ? null : parent;
- }
- });
- }
-
- String getSystemProperty(final String propName) {
- return (String)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return System.getProperty(propName);
- }
- });
- }
-
- FileInputStream getFileInputStream(final File file)
- throws FileNotFoundException
- {
- try {
- return (FileInputStream)
- AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws FileNotFoundException {
- return new FileInputStream(file);
- }
- });
- } catch (PrivilegedActionException e) {
- throw (FileNotFoundException)e.getException();
- }
- }
-
- InputStream getResourceAsStream(final ClassLoader cl,
- final String name)
- {
- return (InputStream)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- InputStream ris;
- if (cl == null) {
- ris = ClassLoader.getSystemResourceAsStream(name);
- } else {
- ris = cl.getResourceAsStream(name);
- }
- return ris;
- }
- });
- }
-
- boolean getFileExists(final File f) {
- return ((Boolean)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return new Boolean(f.exists());
- }
- })).booleanValue();
- }
-
- long getLastModified(final File f) {
- return ((Long)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return new Long(f.lastModified());
- }
- })).longValue();
- }
-
- private SecuritySupport () {}
-}
diff --git a/src/com/sun/org/apache/xml/internal/serialize/Serializer.java b/src/com/sun/org/apache/xml/internal/serialize/Serializer.java
deleted file mode 100644
index 5aecb4f..0000000
--- a/src/com/sun/org/apache/xml/internal/serialize/Serializer.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package com.sun.org.apache.xml.internal.serialize;
-
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.Writer;
-
-import org.xml.sax.ContentHandler;
-import org.xml.sax.DocumentHandler;
-
-
-/**
- * Interface for a DOM serializer implementation, factory for DOM and SAX
- * serializers, and static methods for serializing DOM documents.
- * <p>
- * To serialize a document using SAX events, create a compatible serializer
- * and pass it around as a {@link
- * org.xml.sax.DocumentHandler}. If an I/O error occurs while serializing, it will
- * be thrown by {@link DocumentHandler#endDocument}. The SAX serializer
- * may also be used as {@link org.xml.sax.DTDHandler}, {@link org.xml.sax.ext.DeclHandler} and
- * {@link org.xml.sax.ext.LexicalHandler}.
- * <p>
- * To serialize a DOM document or DOM element, create a compatible
- * serializer and call it's {@link
- * DOMSerializer#serialize(Document)} or {@link DOMSerializer#serialize(Element)} methods.
- * Both methods would produce a full XML document, to serizlie only
- * the portion of the document use {@link OutputFormat#setOmitXMLDeclaration}
- * and specify no document type.
- * <p>
- * The {@link OutputFormat} dictates what underlying serialized is used
- * to serialize the document based on the specified method. If the output
- * format or method are missing, the default is an XML serializer with
- * UTF-8 encoding and now indentation.
- *
- *
- * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
- * @author <a href="mailto:Scott_Boag/CAM/Lotus@lotus.com">Scott Boag</a>
- * @see DocumentHandler
- * @see ContentHandler
- * @see OutputFormat
- * @see DOMSerializer
- */
-public interface Serializer
-{
-
-
- /**
- * Specifies an output stream to which the document should be
- * serialized. This method should not be called while the
- * serializer is in the process of serializing a document.
- */
- public void setOutputByteStream(OutputStream output);
-
-
- /**
- * Specifies a writer to which the document should be serialized.
- * This method should not be called while the serializer is in
- * the process of serializing a document.
- */
- public void setOutputCharStream( Writer output );
-
-
- /**
- * Specifies an output format for this serializer. It the
- * serializer has already been associated with an output format,
- * it will switch to the new format. This method should not be
- * called while the serializer is in the process of serializing
- * a document.
- *
- * @param format The output format to use
- */
- public void setOutputFormat( OutputFormat format );
-
-
- /**
- * Return a {@link DocumentHandler} interface into this serializer.
- * If the serializer does not support the {@link DocumentHandler}
- * interface, it should return null.
- */
- public DocumentHandler asDocumentHandler()
- throws IOException;
-
-
- /**
- * Return a {@link ContentHandler} interface into this serializer.
- * If the serializer does not support the {@link ContentHandler}
- * interface, it should return null.
- */
- public ContentHandler asContentHandler()
- throws IOException;
-
-
- /**
- * Return a {@link DOMSerializer} interface into this serializer.
- * If the serializer does not support the {@link DOMSerializer}
- * interface, it should return null.
- */
- public DOMSerializer asDOMSerializer()
- throws IOException;
-
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/serialize/SerializerFactory.java b/src/com/sun/org/apache/xml/internal/serialize/SerializerFactory.java
deleted file mode 100644
index 27b1e5c..0000000
--- a/src/com/sun/org/apache/xml/internal/serialize/SerializerFactory.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package com.sun.org.apache.xml.internal.serialize;
-
-import com.sun.org.apache.xerces.internal.utils.ObjectFactory;
-import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
-import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
-import java.io.Writer;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.StringTokenizer;
-
-/**
- *
- *
- * @version $Revision: 1.6 $ $Date: 2010-11-01 04:40:36 $
- * @author <a href="mailto:Scott_Boag/CAM/Lotus@lotus.com">Scott Boag</a>
- * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
- */
-public abstract class SerializerFactory
-{
-
-
- public static final String FactoriesProperty = "com.sun.org.apache.xml.internal.serialize.factories";
-
-
- private static final Map<String, SerializerFactory> _factories = Collections.synchronizedMap(new HashMap());
-
-
- static
- {
- SerializerFactory factory;
- String list;
- StringTokenizer token;
- String className;
-
- // The default factories are always registered first,
- // any factory specified in the properties file and supporting
- // the same method will override the default factory.
- factory = new SerializerFactoryImpl( Method.XML );
- registerSerializerFactory( factory );
- factory = new SerializerFactoryImpl( Method.HTML );
- registerSerializerFactory( factory );
- factory = new SerializerFactoryImpl( Method.XHTML );
- registerSerializerFactory( factory );
- factory = new SerializerFactoryImpl( Method.TEXT );
- registerSerializerFactory( factory );
-
- list = SecuritySupport.getSystemProperty( FactoriesProperty );
- if ( list != null ) {
- token = new StringTokenizer( list, " ;,:" );
- while ( token.hasMoreTokens() ) {
- className = token.nextToken();
- try {
- factory = (SerializerFactory) ObjectFactory.newInstance( className, true);
- if ( _factories.containsKey( factory.getSupportedMethod() ) )
- _factories.put( factory.getSupportedMethod(), factory );
- } catch ( Exception except ) { }
- }
- }
- }
-
-
- /**
- * Register a serializer factory, keyed by the given
- * method string.
- */
- public static void registerSerializerFactory( SerializerFactory factory )
- {
- String method;
-
- synchronized ( _factories ) {
- method = factory.getSupportedMethod();
- _factories.put( method, factory );
- }
- }
-
-
- /**
- * Register a serializer factory, keyed by the given
- * method string.
- */
- public static SerializerFactory getSerializerFactory( String method )
- {
- return _factories.get( method );
- }
-
-
- /**
- * Returns the method supported by this factory and used to register
- * the factory. This call is required so factories can be added from
- * a properties file by knowing only the class name. This method is
- * protected, it is only required by this class but must be implemented
- * in derived classes.
- */
- protected abstract String getSupportedMethod();
-
-
- /**
- * Create a new serializer based on the {@link OutputFormat}.
- * If this method is used to create the serializer, the {@link
- * Serializer#setOutputByteStream} or {@link Serializer#setOutputCharStream}
- * methods must be called before serializing a document.
- */
- public abstract Serializer makeSerializer(OutputFormat format);
-
-
- /**
- * Create a new serializer, based on the {@link OutputFormat} and
- * using the writer as the output character stream. If this
- * method is used, the encoding property will be ignored.
- */
- public abstract Serializer makeSerializer( Writer writer,
- OutputFormat format );
-
-
- /**
- * Create a new serializer, based on the {@link OutputFormat} and
- * using the output byte stream and the encoding specified in the
- * output format.
- *
- * @throws UnsupportedEncodingException The specified encoding is
- * not supported
- */
- public abstract Serializer makeSerializer( OutputStream output,
- OutputFormat format )
- throws UnsupportedEncodingException;
-
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/serialize/SerializerFactoryImpl.java b/src/com/sun/org/apache/xml/internal/serialize/SerializerFactoryImpl.java
deleted file mode 100644
index dd27e57..0000000
--- a/src/com/sun/org/apache/xml/internal/serialize/SerializerFactoryImpl.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package com.sun.org.apache.xml.internal.serialize;
-
-
-import java.io.OutputStream;
-import java.io.Writer;
-import java.io.UnsupportedEncodingException;
-import com.sun.org.apache.xerces.internal.dom.DOMMessageFormatter;
-
-/**
- * Default serializer factory can construct serializers for the three
- * markup serializers (XML, HTML, XHTML ).
- *
- *
- * @author <a href="mailto:Scott_Boag/CAM/Lotus@lotus.com">Scott Boag</a>
- * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
- */
-final class SerializerFactoryImpl
- extends SerializerFactory
-{
-
-
- private String _method;
-
-
- SerializerFactoryImpl( String method )
- {
- _method = method;
- if ( ! _method.equals( Method.XML ) &&
- ! _method.equals( Method.HTML ) &&
- ! _method.equals( Method.XHTML ) &&
- ! _method.equals( Method.TEXT ) ) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.SERIALIZER_DOMAIN, "MethodNotSupported", new Object[]{method});
- throw new IllegalArgumentException(msg);
- }
- }
-
-
- public Serializer makeSerializer( OutputFormat format )
- {
- Serializer serializer;
-
- serializer = getSerializer( format );
- serializer.setOutputFormat( format );
- return serializer;
- }
-
-
-
- public Serializer makeSerializer( Writer writer,
- OutputFormat format )
- {
- Serializer serializer;
-
- serializer = getSerializer( format );
- serializer.setOutputCharStream( writer );
- return serializer;
- }
-
-
- public Serializer makeSerializer( OutputStream output,
- OutputFormat format )
- throws UnsupportedEncodingException
- {
- Serializer serializer;
-
- serializer = getSerializer( format );
- serializer.setOutputByteStream( output );
- return serializer;
- }
-
-
- private Serializer getSerializer( OutputFormat format )
- {
- if ( _method.equals( Method.XML ) ) {
- return new XMLSerializer( format );
- } else if ( _method.equals( Method.HTML ) ) {
- return new HTMLSerializer( format );
- } else if ( _method.equals( Method.XHTML ) ) {
- return new XHTMLSerializer( format );
- } else if ( _method.equals( Method.TEXT ) ) {
- return new TextSerializer();
- } else {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.SERIALIZER_DOMAIN, "MethodNotSupported", new Object[]{_method});
- throw new IllegalStateException(msg);
- }
- }
-
-
- protected String getSupportedMethod()
- {
- return _method;
- }
-
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/serialize/TextSerializer.java b/src/com/sun/org/apache/xml/internal/serialize/TextSerializer.java
deleted file mode 100644
index 789f636..0000000
--- a/src/com/sun/org/apache/xml/internal/serialize/TextSerializer.java
+++ /dev/null
@@ -1,390 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-// Sep 14, 2000:
-// Fixed serializer to report IO exception directly, instead at
-// the end of document processing.
-// Reported by Patrick Higgins <phiggins@transzap.com>
-
-
-package com.sun.org.apache.xml.internal.serialize;
-
-
-import java.io.IOException;
-
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.xml.sax.AttributeList;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-
-
-/**
- * Implements a text serializer supporting both DOM and SAX
- * serializing. For usage instructions see {@link Serializer}.
- * <p>
- * If an output stream is used, the encoding is taken from the
- * output format (defaults to <tt>UTF-8</tt>). If a writer is
- * used, make sure the writer uses the same encoding (if applies)
- * as specified in the output format.
- * <p>
- * The serializer supports both DOM and SAX. DOM serializing is done
- * by calling {@link #serialize} and SAX serializing is done by firing
- * SAX events and using the serializer as a document handler.
- * <p>
- * If an I/O exception occurs while serializing, the serializer
- * will not throw an exception directly, but only throw it
- * at the end of serializing (either DOM or SAX's {@link
- * org.xml.sax.DocumentHandler#endDocument}.
- *
- *
- * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
- * @see Serializer
- */
-public class TextSerializer
- extends BaseMarkupSerializer
-{
-
-
- /**
- * Constructs a new serializer. The serializer cannot be used without
- * calling {@link #setOutputCharStream} or {@link #setOutputByteStream}
- * first.
- */
- public TextSerializer()
- {
- super( new OutputFormat( Method.TEXT, null, false ) );
- }
-
-
- public void setOutputFormat( OutputFormat format )
- {
- super.setOutputFormat( format != null ? format : new OutputFormat( Method.TEXT, null, false ) );
- }
-
-
- //-----------------------------------------//
- // SAX content handler serializing methods //
- //-----------------------------------------//
-
-
- public void startElement( String namespaceURI, String localName,
- String rawName, Attributes attrs )
- throws SAXException
- {
- startElement( rawName == null ? localName : rawName, null );
- }
-
-
- public void endElement( String namespaceURI, String localName,
- String rawName )
- throws SAXException
- {
- endElement( rawName == null ? localName : rawName );
- }
-
-
- //------------------------------------------//
- // SAX document handler serializing methods //
- //------------------------------000---------//
-
-
- public void startElement( String tagName, AttributeList attrs )
- throws SAXException
- {
- boolean preserveSpace;
- ElementState state;
-
- try {
- state = getElementState();
- if ( isDocumentState() ) {
- // If this is the root element handle it differently.
- // If the first root element in the document, serialize
- // the document's DOCTYPE. Space preserving defaults
- // to that of the output format.
- if ( ! _started )
- startDocument( tagName );
- }
- // For any other element, if first in parent, then
- // use the parnet's space preserving.
- preserveSpace = state.preserveSpace;
-
- // Do not change the current element state yet.
- // This only happens in endElement().
-
- // Ignore all other attributes of the element, only printing
- // its contents.
-
- // Now it's time to enter a new element state
- // with the tag name and space preserving.
- // We still do not change the curent element state.
- state = enterElementState( null, null, tagName, preserveSpace );
- } catch ( IOException except ) {
- throw new SAXException( except );
- }
- }
-
-
- public void endElement( String tagName )
- throws SAXException
- {
- try {
- endElementIO( tagName );
- } catch ( IOException except ) {
- throw new SAXException( except );
- }
- }
-
-
- public void endElementIO( String tagName )
- throws IOException
- {
- ElementState state;
-
- // Works much like content() with additions for closing
- // an element. Note the different checks for the closed
- // element's state and the parent element's state.
- state = getElementState();
- // Leave the element state and update that of the parent
- // (if we're not root) to not empty and after element.
- state = leaveElementState();
- state.afterElement = true;
- state.empty = false;
- if ( isDocumentState() )
- _printer.flush();
- }
-
-
- public void processingInstructionIO( String target, String code ) throws IOException
- {
- }
-
-
- public void comment( String text )
- {
- }
-
-
- public void comment( char[] chars, int start, int length )
- {
- }
-
-
- public void characters( char[] chars, int start, int length )
- throws SAXException
- {
- ElementState state;
-
- try {
- state = content();
- state.doCData = state.inCData = false;
- printText( chars, start, length, true, true );
- } catch ( IOException except ) {
- throw new SAXException( except );
- }
- }
-
-
- protected void characters( String text, boolean unescaped )
- throws IOException
- {
- ElementState state;
-
- state = content();
- state.doCData = state.inCData = false;
- printText( text, true, true );
- }
-
-
- //------------------------------------------//
- // Generic node serializing methods methods //
- //------------------------------------------//
-
-
- /**
- * Called to serialize the document's DOCTYPE by the root element.
- * <p>
- * This method will check if it has not been called before ({@link #_started}),
- * will serialize the document type declaration, and will serialize all
- * pre-root comments and PIs that were accumulated in the document
- * (see {@link #serializePreRoot}). Pre-root will be serialized even if
- * this is not the first root element of the document.
- */
- protected void startDocument( String rootTagName )
- throws IOException
- {
- // Required to stop processing the DTD, even though the DTD
- // is not printed.
- _printer.leaveDTD();
-
- _started = true;
- // Always serialize these, even if not te first root element.
- serializePreRoot();
- }
-
-
- /**
- * Called to serialize a DOM element. Equivalent to calling {@link
- * #startElement}, {@link #endElement} and serializing everything
- * inbetween, but better optimized.
- */
- protected void serializeElement( Element elem )
- throws IOException
- {
- Node child;
- ElementState state;
- boolean preserveSpace;
- String tagName;
-
- tagName = elem.getTagName();
- state = getElementState();
- if ( isDocumentState() ) {
- // If this is the root element handle it differently.
- // If the first root element in the document, serialize
- // the document's DOCTYPE. Space preserving defaults
- // to that of the output format.
- if ( ! _started )
- startDocument( tagName );
- }
- // For any other element, if first in parent, then
- // use the parnet's space preserving.
- preserveSpace = state.preserveSpace;
-
- // Do not change the current element state yet.
- // This only happens in endElement().
-
- // Ignore all other attributes of the element, only printing
- // its contents.
-
- // If element has children, then serialize them, otherwise
- // serialize en empty tag.
- if ( elem.hasChildNodes() ) {
- // Enter an element state, and serialize the children
- // one by one. Finally, end the element.
- state = enterElementState( null, null, tagName, preserveSpace );
- child = elem.getFirstChild();
- while ( child != null ) {
- serializeNode( child );
- child = child.getNextSibling();
- }
- endElementIO( tagName );
- } else {
- if ( ! isDocumentState() ) {
- // After element but parent element is no longer empty.
- state.afterElement = true;
- state.empty = false;
- }
- }
- }
-
-
- /**
- * Serialize the DOM node. This method is unique to the Text serializer.
- *
- * @param node The node to serialize
- */
- protected void serializeNode( Node node )
- throws IOException
- {
- // Based on the node type call the suitable SAX handler.
- // Only comments entities and documents which are not
- // handled by SAX are serialized directly.
- switch ( node.getNodeType() ) {
- case Node.TEXT_NODE : {
- String text;
-
- text = node.getNodeValue();
- if ( text != null )
- characters( node.getNodeValue(), true );
- break;
- }
-
- case Node.CDATA_SECTION_NODE : {
- String text;
-
- text = node.getNodeValue();
- if ( text != null )
- characters( node.getNodeValue(), true );
- break;
- }
-
- case Node.COMMENT_NODE :
- break;
-
- case Node.ENTITY_REFERENCE_NODE :
- // Ignore.
- break;
-
- case Node.PROCESSING_INSTRUCTION_NODE :
- break;
-
- case Node.ELEMENT_NODE :
- serializeElement( (Element) node );
- break;
-
- case Node.DOCUMENT_NODE :
- // !!! Fall through
- case Node.DOCUMENT_FRAGMENT_NODE : {
- Node child;
-
- // By definition this will happen if the node is a document,
- // document fragment, etc. Just serialize its contents. It will
- // work well for other nodes that we do not know how to serialize.
- child = node.getFirstChild();
- while ( child != null ) {
- serializeNode( child );
- child = child.getNextSibling();
- }
- break;
- }
-
- default:
- break;
- }
- }
-
-
- protected ElementState content()
- {
- ElementState state;
-
- state = getElementState();
- if ( ! isDocumentState() ) {
- // If this is the first content in the element,
- // change the state to not-empty.
- if ( state.empty )
- state.empty = false;
- // Except for one content type, all of them
- // are not last element. That one content
- // type will take care of itself.
- state.afterElement = false;
- }
- return state;
- }
-
-
- protected String getEntityRef( int ch )
- {
- return null;
- }
-
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/serialize/XHTMLSerializer.java b/src/com/sun/org/apache/xml/internal/serialize/XHTMLSerializer.java
deleted file mode 100644
index 5925a25..0000000
--- a/src/com/sun/org/apache/xml/internal/serialize/XHTMLSerializer.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package com.sun.org.apache.xml.internal.serialize;
-
-
-import java.io.OutputStream;
-import java.io.Writer;
-
-
-/**
- * Implements an XHTML serializer supporting both DOM and SAX
- * pretty serializing. For usage instructions see either {@link
- * Serializer} or {@link BaseMarkupSerializer}.
- *
- * @deprecated This class was deprecated in Xerces 2.6.2. It is
- * recommended that new applications use JAXP's Transformation API
- * for XML (TrAX) for serializing XHTML. See the Xerces documentation
- * for more information.
- * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
- * @see Serializer
- */
-public class XHTMLSerializer
- extends HTMLSerializer
-{
-
-
- /**
- * Constructs a new serializer. The serializer cannot be used without
- * calling {@link #setOutputCharStream} or {@link #setOutputByteStream}
- * first.
- */
- public XHTMLSerializer()
- {
- super( true, new OutputFormat( Method.XHTML, null, false ) );
- }
-
-
- /**
- * Constructs a new serializer. The serializer cannot be used without
- * calling {@link #setOutputCharStream} or {@link #setOutputByteStream}
- * first.
- */
- public XHTMLSerializer( OutputFormat format )
- {
- super( true, format != null ? format : new OutputFormat( Method.XHTML, null, false ) );
- }
-
-
- /**
- * Constructs a new serializer that writes to the specified writer
- * using the specified output format. If <tt>format</tt> is null,
- * will use a default output format.
- *
- * @param writer The writer to use
- * @param format The output format to use, null for the default
- */
- public XHTMLSerializer( Writer writer, OutputFormat format )
- {
- super( true, format != null ? format : new OutputFormat( Method.XHTML, null, false ) );
- setOutputCharStream( writer );
- }
-
-
- /**
- * Constructs a new serializer that writes to the specified output
- * stream using the specified output format. If <tt>format</tt>
- * is null, will use a default output format.
- *
- * @param output The output stream to use
- * @param format The output format to use, null for the default
- */
- public XHTMLSerializer( OutputStream output, OutputFormat format )
- {
- super( true, format != null ? format : new OutputFormat( Method.XHTML, null, false ) );
- setOutputByteStream( output );
- }
-
-
- public void setOutputFormat( OutputFormat format )
- {
- super.setOutputFormat( format != null ? format : new OutputFormat( Method.XHTML, null, false ) );
- }
-
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/serialize/XML11Serializer.java b/src/com/sun/org/apache/xml/internal/serialize/XML11Serializer.java
deleted file mode 100644
index e1728cd..0000000
--- a/src/com/sun/org/apache/xml/internal/serialize/XML11Serializer.java
+++ /dev/null
@@ -1,537 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2002,2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-
-// Sep 14, 2000:
-// Fixed problem with namespace handling. Contributed by
-// David Blondeau <blondeau@intalio.com>
-// Sep 14, 2000:
-// Fixed serializer to report IO exception directly, instead at
-// the end of document processing.
-// Reported by Patrick Higgins <phiggins@transzap.com>
-// Aug 21, 2000:
-// Fixed bug in startDocument not calling prepare.
-// Reported by Mikael Staldal <d96-mst-ingen-reklam@d.kth.se>
-// Aug 21, 2000:
-// Added ability to omit DOCTYPE declaration.
-
-
-package com.sun.org.apache.xml.internal.serialize;
-
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.Writer;
-
-import com.sun.org.apache.xerces.internal.dom.DOMMessageFormatter;
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.util.NamespaceSupport;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.util.XML11Char;
-import com.sun.org.apache.xerces.internal.util.XMLChar;
-import org.xml.sax.SAXException;
-import org.w3c.dom.DOMError;
-
-/**
- * Implements an XML serializer supporting both DOM and SAX pretty
- * serializing. For usage instructions see {@link Serializer}.
- * <p>
- * If an output stream is used, the encoding is taken from the
- * output format (defaults to <tt>UTF-8</tt>). If a writer is
- * used, make sure the writer uses the same encoding (if applies)
- * as specified in the output format.
- * <p>
- * The serializer supports both DOM and SAX. SAX serializing is done by firing
- * SAX events and using the serializer as a document handler. DOM serializing is done
- * by calling {@link #serialize(Document)} or by using DOM Level 3
- * {@link org.w3c.dom.ls.DOMSerializer} and
- * serializing with {@link org.w3c.dom.ls.DOMSerializer#write},
- * {@link org.w3c.dom.ls.DOMSerializer#writeToString}.
- * <p>
- * If an I/O exception occurs while serializing, the serializer
- * will not throw an exception directly, but only throw it
- * at the end of serializing (either DOM or SAX's {@link
- * org.xml.sax.DocumentHandler#endDocument}.
- * <p>
- * For elements that are not specified as whitespace preserving,
- * the serializer will potentially break long text lines at space
- * boundaries, indent lines, and serialize elements on separate
- * lines. Line terminators will be regarded as spaces, and
- * spaces at beginning of line will be stripped.
- * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
- * @author <a href="mailto:rahul.srivastava@sun.com">Rahul Srivastava</a>
- * @author Elena Litani IBM
- * @see Serializer
- */
-public class XML11Serializer
-extends XMLSerializer {
-
- //
- // constants
- //
-
- protected static final boolean DEBUG = false;
-
- //
- // data
- //
-
- //
- // DOM Level 3 implementation: variables intialized in DOMSerializerImpl
- //
-
- /** stores namespaces in scope */
- protected NamespaceSupport fNSBinder;
-
- /** stores all namespace bindings on the current element */
- protected NamespaceSupport fLocalNSBinder;
-
- /** symbol table for serialization */
- protected SymbolTable fSymbolTable;
-
- // is node dom level 1 node?
- protected boolean fDOML1 = false;
- // counter for new prefix names
- protected int fNamespaceCounter = 1;
- protected final static String PREFIX = "NS";
-
- /**
- * Controls whether namespace fixup should be performed during
- * the serialization.
- * NOTE: if this field is set to true the following
- * fields need to be initialized: fNSBinder, fLocalNSBinder, fSymbolTable,
- * XMLSymbols.EMPTY_STRING, fXmlSymbol, fXmlnsSymbol, fNamespaceCounter.
- */
- protected boolean fNamespaces = false;
-
-
- private boolean fPreserveSpace;
-
-
- /**
- * Constructs a new serializer. The serializer cannot be used without
- * calling {@link #setOutputCharStream} or {@link #setOutputByteStream}
- * first.
- */
- public XML11Serializer() {
- super( );
- _format.setVersion("1.1");
- }
-
-
- /**
- * Constructs a new serializer. The serializer cannot be used without
- * calling {@link #setOutputCharStream} or {@link #setOutputByteStream}
- * first.
- */
- public XML11Serializer( OutputFormat format ) {
- super( format );
- _format.setVersion("1.1");
- }
-
-
- /**
- * Constructs a new serializer that writes to the specified writer
- * using the specified output format. If <tt>format</tt> is null,
- * will use a default output format.
- *
- * @param writer The writer to use
- * @param format The output format to use, null for the default
- */
- public XML11Serializer( Writer writer, OutputFormat format ) {
- super( writer, format );
- _format.setVersion("1.1");
- }
-
-
- /**
- * Constructs a new serializer that writes to the specified output
- * stream using the specified output format. If <tt>format</tt>
- * is null, will use a default output format.
- *
- * @param output The output stream to use
- * @param format The output format to use, null for the default
- */
- public XML11Serializer( OutputStream output, OutputFormat format ) {
- super( output, format != null ? format : new OutputFormat( Method.XML, null, false ) );
- _format.setVersion("1.1");
- }
-
- //-----------------------------------------//
- // SAX content handler serializing methods //
- //-----------------------------------------//
-
-
- public void characters( char[] chars, int start, int length )
- throws SAXException
- {
- ElementState state;
-
- try {
- state = content();
-
- // Check if text should be print as CDATA section or unescaped
- // based on elements listed in the output format (the element
- // state) or whether we are inside a CDATA section or entity.
-
- if ( state.inCData || state.doCData ) {
- int saveIndent;
-
- // Print a CDATA section. The text is not escaped, but ']]>'
- // appearing in the code must be identified and dealt with.
- // The contents of a text node is considered space preserving.
- if ( ! state.inCData ) {
- _printer.printText( "<![CDATA[" );
- state.inCData = true;
- }
- saveIndent = _printer.getNextIndent();
- _printer.setNextIndent( 0 );
- char ch;
- final int end = start + length;
- for ( int index = start; index < end; ++index ) {
- ch = chars[index];
- if ( ch == ']' && index + 2 < end &&
- chars[ index + 1 ] == ']' && chars[ index + 2 ] == '>' ) {
- _printer.printText("]]]]><![CDATA[>");
- index +=2;
- continue;
- }
- if (!XML11Char.isXML11Valid(ch)) {
- // check if it is surrogate
- if (++index < end) {
- surrogates(ch, chars[index]);
- }
- else {
- fatalError("The character '"+(char)ch+"' is an invalid XML character");
- }
- continue;
- } else {
- if ( _encodingInfo.isPrintable((char)ch) && XML11Char.isXML11ValidLiteral(ch)) {
- _printer.printText((char)ch);
- } else {
- // The character is not printable -- split CDATA section
- _printer.printText("]]>&#x");
- _printer.printText(Integer.toHexString(ch));
- _printer.printText(";<![CDATA[");
- }
- }
- }
- _printer.setNextIndent( saveIndent );
-
- } else {
-
- int saveIndent;
-
- if ( state.preserveSpace ) {
- // If preserving space then hold of indentation so no
- // excessive spaces are printed at line breaks, escape
- // the text content without replacing spaces and print
- // the text breaking only at line breaks.
- saveIndent = _printer.getNextIndent();
- _printer.setNextIndent( 0 );
- printText( chars, start, length, true, state.unescaped );
- _printer.setNextIndent( saveIndent );
- } else {
- printText( chars, start, length, false, state.unescaped );
- }
- }
- } catch ( IOException except ) {
- throw new SAXException( except );
- }
- }
-
-
- //
- // overwrite printing functions to make sure serializer prints out valid XML
- //
- protected void printEscaped( String source ) throws IOException {
- int length = source.length();
- for ( int i = 0 ; i < length ; ++i ) {
- int ch = source.charAt(i);
- if (!XML11Char.isXML11Valid(ch)) {
- if (++i <length) {
- surrogates(ch, source.charAt(i));
- } else {
- fatalError("The character '"+(char)ch+"' is an invalid XML character");
- }
- continue;
- }
- if (ch == '\n' || ch == '\r' || ch == '\t' || ch == 0x0085 || ch == 0x2028){
- printHex(ch);
- } else if (ch == '<') {
- _printer.printText("&lt;");
- } else if (ch == '&') {
- _printer.printText("&amp;");
- } else if (ch == '"') {
- _printer.printText("&quot;");
- } else if ((ch >= ' ' && _encodingInfo.isPrintable((char) ch))) {
- _printer.printText((char) ch);
- } else {
- printHex(ch);
- }
- }
- }
-
- protected final void printCDATAText(String text) throws IOException {
- int length = text.length();
- char ch;
-
- for (int index = 0; index < length; ++index) {
- ch = text.charAt(index);
-
- if (ch == ']'
- && index + 2 < length
- && text.charAt(index + 1) == ']'
- && text.charAt(index + 2) == '>') { // check for ']]>'
- if (fDOMErrorHandler != null){
- // REVISIT: this means that if DOM Error handler is not registered we don't report any
- // fatal errors and might serialize not wellformed document
- if ((features & DOMSerializerImpl.SPLITCDATA) == 0
- && (features & DOMSerializerImpl.WELLFORMED) == 0) {
- // issue fatal error
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.SERIALIZER_DOMAIN,
- "EndingCDATA",
- null);
- modifyDOMError(
- msg,
- DOMError.SEVERITY_FATAL_ERROR,
- null, fCurrentNode);
- boolean continueProcess =
- fDOMErrorHandler.handleError(fDOMError);
- if (!continueProcess) {
- throw new IOException();
- }
- } else {
- // issue warning
- String msg =
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.SERIALIZER_DOMAIN,
- "SplittingCDATA",
- null);
- modifyDOMError(
- msg,
- DOMError.SEVERITY_WARNING,
- null, fCurrentNode);
- fDOMErrorHandler.handleError(fDOMError);
- }
- }
- // split CDATA section
- _printer.printText("]]]]><![CDATA[>");
- index += 2;
- continue;
- }
-
- if (!XML11Char.isXML11Valid(ch)) {
- // check if it is surrogate
- if (++index < length) {
- surrogates(ch, text.charAt(index));
- } else {
- fatalError(
- "The character '"
- + (char) ch
- + "' is an invalid XML character");
- }
- continue;
- } else {
- if (_encodingInfo.isPrintable((char) ch)
- && XML11Char.isXML11ValidLiteral(ch)) {
- _printer.printText((char) ch);
- } else {
-
- // The character is not printable -- split CDATA section
- _printer.printText("]]>&#x");
- _printer.printText(Integer.toHexString(ch));
- _printer.printText(";<![CDATA[");
- }
- }
- }
- }
-
-
- // note that this "int" should, in all cases, be a char.
- // REVISIT: make it a char...
- protected final void printXMLChar( int ch ) throws IOException {
-
- if (ch == '\r' || ch == 0x0085 || ch == 0x2028) {
- printHex(ch);
- } else if ( ch == '<') {
- _printer.printText("&lt;");
- } else if (ch == '&') {
- _printer.printText("&amp;");
- } else if (ch == '>'){
- // character sequence "]]>" can't appear in content, therefore
- // we should escape '>'
- _printer.printText("&gt;");
- } else if ( _encodingInfo.isPrintable((char)ch) && XML11Char.isXML11ValidLiteral(ch)) {
- _printer.printText((char)ch);
- } else {
- printHex(ch);
- }
- }
-
-
-
- protected final void surrogates(int high, int low) throws IOException{
- if (XMLChar.isHighSurrogate(high)) {
- if (!XMLChar.isLowSurrogate(low)) {
- //Invalid XML
- fatalError("The character '"+(char)low+"' is an invalid XML character");
- }
- else {
- int supplemental = XMLChar.supplemental((char)high, (char)low);
- if (!XML11Char.isXML11Valid(supplemental)) {
- //Invalid XML
- fatalError("The character '"+(char)supplemental+"' is an invalid XML character");
- }
- else {
- if (content().inCData ) {
- _printer.printText("]]>&#x");
- _printer.printText(Integer.toHexString(supplemental));
- _printer.printText(";<![CDATA[");
- }
- else {
- printHex(supplemental);
- }
- }
- }
- } else {
- fatalError("The character '"+(char)high+"' is an invalid XML character");
- }
-
- }
-
-
- protected void printText( String text, boolean preserveSpace, boolean unescaped )
- throws IOException {
- int index;
- char ch;
- int length = text.length();
- if ( preserveSpace ) {
- // Preserving spaces: the text must print exactly as it is,
- // without breaking when spaces appear in the text and without
- // consolidating spaces. If a line terminator is used, a line
- // break will occur.
- for ( index = 0 ; index < length ; ++index ) {
- ch = text.charAt( index );
- if (!XML11Char.isXML11Valid(ch)) {
- // check if it is surrogate
- if (++index <length) {
- surrogates(ch, text.charAt(index));
- } else {
- fatalError("The character '"+(char)ch+"' is an invalid XML character");
- }
- continue;
- }
- if ( unescaped && XML11Char.isXML11ValidLiteral(ch)) {
- _printer.printText( ch );
- } else
- printXMLChar( ch );
- }
- } else {
- // Not preserving spaces: print one part at a time, and
- // use spaces between parts to break them into different
- // lines. Spaces at beginning of line will be stripped
- // by printing mechanism. Line terminator is treated
- // no different than other text part.
- for ( index = 0 ; index < length ; ++index ) {
- ch = text.charAt( index );
- if (!XML11Char.isXML11Valid(ch)) {
- // check if it is surrogate
- if (++index <length) {
- surrogates(ch, text.charAt(index));
- } else {
- fatalError("The character '"+(char)ch+"' is an invalid XML character");
- }
- continue;
- }
-
- if ( unescaped && XML11Char.isXML11ValidLiteral(ch) )
- _printer.printText( ch );
- else
- printXMLChar( ch);
- }
- }
- }
-
-
-
- protected void printText( char[] chars, int start, int length,
- boolean preserveSpace, boolean unescaped ) throws IOException {
- int index;
- char ch;
-
- if ( preserveSpace ) {
- // Preserving spaces: the text must print exactly as it is,
- // without breaking when spaces appear in the text and without
- // consolidating spaces. If a line terminator is used, a line
- // break will occur.
- while ( length-- > 0 ) {
- ch = chars[start++];
- if (!XML11Char.isXML11Valid(ch)) {
- // check if it is surrogate
- if ( length-- > 0) {
- surrogates(ch, chars[start++]);
- } else {
- fatalError("The character '"+(char)ch+"' is an invalid XML character");
- }
- continue;
- }
- if ( unescaped && XML11Char.isXML11ValidLiteral(ch))
- _printer.printText( ch );
- else
- printXMLChar( ch );
- }
- } else {
- // Not preserving spaces: print one part at a time, and
- // use spaces between parts to break them into different
- // lines. Spaces at beginning of line will be stripped
- // by printing mechanism. Line terminator is treated
- // no different than other text part.
- while ( length-- > 0 ) {
- ch = chars[start++];
- if (!XML11Char.isXML11Valid(ch)) {
- // check if it is surrogate
- if ( length-- > 0) {
- surrogates(ch, chars[start++]);
- } else {
- fatalError("The character '"+(char)ch+"' is an invalid XML character");
- }
- continue;
- }
-
- if ( unescaped && XML11Char.isXML11ValidLiteral(ch))
- _printer.printText( ch );
- else
- printXMLChar( ch );
- }
- }
- }
-
-
- public boolean reset() {
- super.reset();
- return true;
-
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/serialize/XMLSerializer.java b/src/com/sun/org/apache/xml/internal/serialize/XMLSerializer.java
deleted file mode 100644
index a926d12..0000000
--- a/src/com/sun/org/apache/xml/internal/serialize/XMLSerializer.java
+++ /dev/null
@@ -1,1464 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-
-// Sep 14, 2000:
-// Fixed problem with namespace handling. Contributed by
-// David Blondeau <blondeau@intalio.com>
-// Sep 14, 2000:
-// Fixed serializer to report IO exception directly, instead at
-// the end of document processing.
-// Reported by Patrick Higgins <phiggins@transzap.com>
-// Aug 21, 2000:
-// Fixed bug in startDocument not calling prepare.
-// Reported by Mikael Staldal <d96-mst-ingen-reklam@d.kth.se>
-// Aug 21, 2000:
-// Added ability to omit DOCTYPE declaration.
-
-
-package com.sun.org.apache.xml.internal.serialize;
-
-import com.sun.org.apache.xerces.internal.dom.DOMMessageFormatter;
-import com.sun.org.apache.xerces.internal.util.NamespaceSupport;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.util.XMLChar;
-import com.sun.org.apache.xerces.internal.util.XMLSymbols;
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.Writer;
-import java.util.Map;
-import org.w3c.dom.Attr;
-import org.w3c.dom.DOMError;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.traversal.NodeFilter;
-import org.xml.sax.AttributeList;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.AttributesImpl;
-
-/**
- * Implements an XML serializer supporting both DOM and SAX pretty
- * serializing. For usage instructions see {@link Serializer}.
- * <p>
- * If an output stream is used, the encoding is taken from the
- * output format (defaults to <tt>UTF-8</tt>). If a writer is
- * used, make sure the writer uses the same encoding (if applies)
- * as specified in the output format.
- * <p>
- * The serializer supports both DOM and SAX. SAX serializing is done by firing
- * SAX events and using the serializer as a document handler. DOM serializing is done
- * by calling {@link #serialize(Document)} or by using DOM Level 3
- * {@link org.w3c.dom.ls.DOMSerializer} and
- * serializing with {@link org.w3c.dom.ls.DOMSerializer#write},
- * {@link org.w3c.dom.ls.DOMSerializer#writeToString}.
- * <p>
- * If an I/O exception occurs while serializing, the serializer
- * will not throw an exception directly, but only throw it
- * at the end of serializing (either DOM or SAX's {@link
- * org.xml.sax.DocumentHandler#endDocument}.
- * <p>
- * For elements that are not specified as whitespace preserving,
- * the serializer will potentially break long text lines at space
- * boundaries, indent lines, and serialize elements on separate
- * lines. Line terminators will be regarded as spaces, and
- * spaces at beginning of line will be stripped.
- * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
- * @author <a href="mailto:rahul.srivastava@sun.com">Rahul Srivastava</a>
- * @author Elena Litani IBM
- * @see Serializer
- */
-public class XMLSerializer
-extends BaseMarkupSerializer {
-
- //
- // constants
- //
-
- protected static final boolean DEBUG = false;
-
- //
- // data
- //
-
- //
- // DOM Level 3 implementation: variables intialized in DOMSerializerImpl
- //
-
- /** stores namespaces in scope */
- protected NamespaceSupport fNSBinder;
-
- /** stores all namespace bindings on the current element */
- protected NamespaceSupport fLocalNSBinder;
-
- /** symbol table for serialization */
- protected SymbolTable fSymbolTable;
-
- protected final static String PREFIX = "NS";
-
- /**
- * Controls whether namespace fixup should be performed during
- * the serialization.
- * NOTE: if this field is set to true the following
- * fields need to be initialized: fNSBinder, fLocalNSBinder, fSymbolTable,
- * XMLSymbols.EMPTY_STRING, fXmlSymbol, fXmlnsSymbol
- */
- protected boolean fNamespaces = false;
-
- /**
- * Controls whether namespace prefixes will be printed out during serialization
- */
- protected boolean fNamespacePrefixes = true;
-
-
- private boolean fPreserveSpace;
-
-
- /**
- * Constructs a new serializer. The serializer cannot be used without
- * calling {@link #setOutputCharStream} or {@link #setOutputByteStream}
- * first.
- */
- public XMLSerializer() {
- super( new OutputFormat( Method.XML, null, false ) );
- }
-
-
- /**
- * Constructs a new serializer. The serializer cannot be used without
- * calling {@link #setOutputCharStream} or {@link #setOutputByteStream}
- * first.
- */
- public XMLSerializer( OutputFormat format ) {
- super( format != null ? format : new OutputFormat( Method.XML, null, false ) );
- _format.setMethod( Method.XML );
- }
-
-
- /**
- * Constructs a new serializer that writes to the specified writer
- * using the specified output format. If <tt>format</tt> is null,
- * will use a default output format.
- *
- * @param writer The writer to use
- * @param format The output format to use, null for the default
- */
- public XMLSerializer( Writer writer, OutputFormat format ) {
- super( format != null ? format : new OutputFormat( Method.XML, null, false ) );
- _format.setMethod( Method.XML );
- setOutputCharStream( writer );
- }
-
-
- /**
- * Constructs a new serializer that writes to the specified output
- * stream using the specified output format. If <tt>format</tt>
- * is null, will use a default output format.
- *
- * @param output The output stream to use
- * @param format The output format to use, null for the default
- */
- public XMLSerializer( OutputStream output, OutputFormat format ) {
- super( format != null ? format : new OutputFormat( Method.XML, null, false ) );
- _format.setMethod( Method.XML );
- setOutputByteStream( output );
- }
-
-
- public void setOutputFormat( OutputFormat format ) {
- super.setOutputFormat( format != null ? format : new OutputFormat( Method.XML, null, false ) );
- }
-
-
- /**
- * This methods turns on namespace fixup algorithm during
- * DOM serialization.
- * @see org.w3c.dom.ls.DOMSerializer
- *
- * @param namespaces
- */
- public void setNamespaces (boolean namespaces){
- fNamespaces = namespaces;
- if (fNSBinder == null) {
- fNSBinder = new NamespaceSupport();
- fLocalNSBinder = new NamespaceSupport();
- fSymbolTable = new SymbolTable();
- }
- }
-
- //-----------------------------------------//
- // SAX content handler serializing methods //
- //-----------------------------------------//
-
-
- public void startElement( String namespaceURI, String localName,
- String rawName, Attributes attrs )
- throws SAXException
- {
- int i;
- boolean preserveSpace;
- ElementState state;
- String name;
- String value;
- boolean addNSAttr = false;
-
- if (DEBUG) {
- System.out.println("==>startElement("+namespaceURI+","+localName+
- ","+rawName+")");
- }
-
- try {
- if (_printer == null) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.SERIALIZER_DOMAIN, "NoWriterSupplied", null);
- throw new IllegalStateException(msg);
- }
-
- state = getElementState();
- if (isDocumentState()) {
- // If this is the root element handle it differently.
- // If the first root element in the document, serialize
- // the document's DOCTYPE. Space preserving defaults
- // to that of the output format.
- if (! _started)
- startDocument( ( localName == null || localName.length() == 0 ) ? rawName : localName );
- } else {
- // For any other element, if first in parent, then
- // close parent's opening tag and use the parnet's
- // space preserving.
- if (state.empty)
- _printer.printText( '>' );
- // Must leave CData section first
- if (state.inCData) {
- _printer.printText( "]]>" );
- state.inCData = false;
- }
- // Indent this element on a new line if the first
- // content of the parent element or immediately
- // following an element or a comment
- if (_indenting && ! state.preserveSpace &&
- ( state.empty || state.afterElement || state.afterComment))
- _printer.breakLine();
- }
- preserveSpace = state.preserveSpace;
-
- //We remove the namespaces from the attributes list so that they will
- //be in _prefixes
- attrs = extractNamespaces(attrs);
-
- // Do not change the current element state yet.
- // This only happens in endElement().
- if (rawName == null || rawName.length() == 0) {
- if (localName == null) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.SERIALIZER_DOMAIN, "NoName", null);
- throw new SAXException(msg);
- }
- if (namespaceURI != null && ! namespaceURI.equals( "" )) {
- String prefix;
- prefix = getPrefix( namespaceURI );
- if (prefix != null && prefix.length() > 0)
- rawName = prefix + ":" + localName;
- else
- rawName = localName;
- } else
- rawName = localName;
- addNSAttr = true;
- }
-
- _printer.printText( '<' );
- _printer.printText( rawName );
- _printer.indent();
-
- // For each attribute print it's name and value as one part,
- // separated with a space so the element can be broken on
- // multiple lines.
- if (attrs != null) {
- for (i = 0 ; i < attrs.getLength() ; ++i) {
- _printer.printSpace();
-
- name = attrs.getQName( i );
- if (name != null && name.length() == 0) {
- String prefix;
- String attrURI;
-
- name = attrs.getLocalName( i );
- attrURI = attrs.getURI( i );
- if (( attrURI != null && attrURI.length() != 0 ) &&
- ( namespaceURI == null || namespaceURI.length() == 0 ||
- ! attrURI.equals( namespaceURI ) )) {
- prefix = getPrefix( attrURI );
- if (prefix != null && prefix.length() > 0)
- name = prefix + ":" + name;
- }
- }
-
- value = attrs.getValue( i );
- if (value == null)
- value = "";
- _printer.printText( name );
- _printer.printText( "=\"" );
- printEscaped( value );
- _printer.printText( '"' );
-
- // If the attribute xml:space exists, determine whether
- // to preserve spaces in this and child nodes based on
- // its value.
- if (name.equals( "xml:space" )) {
- if (value.equals( "preserve" ))
- preserveSpace = true;
- else
- preserveSpace = _format.getPreserveSpace();
- }
- }
- }
-
- if (_prefixes != null) {
- for (Map.Entry<String, String> entry : _prefixes.entrySet()) {
- _printer.printSpace();
- value = entry.getKey(); //The prefixes map uses the URI value as key.
- name = entry.getValue(); //and prefix name as value
- if (name.length() == 0) {
- _printer.printText( "xmlns=\"" );
- printEscaped( value );
- _printer.printText( '"' );
- } else {
- _printer.printText( "xmlns:" );
- _printer.printText( name );
- _printer.printText( "=\"" );
- printEscaped( value );
- _printer.printText( '"' );
- }
- }
- }
-
- // Now it's time to enter a new element state
- // with the tag name and space preserving.
- // We still do not change the curent element state.
- state = enterElementState( namespaceURI, localName, rawName, preserveSpace );
- name = ( localName == null || localName.length() == 0 ) ? rawName : namespaceURI + "^" + localName;
- state.doCData = _format.isCDataElement( name );
- state.unescaped = _format.isNonEscapingElement( name );
- } catch (IOException except) {
- throw new SAXException( except );
- }
- }
-
-
- public void endElement( String namespaceURI, String localName,
- String rawName )
- throws SAXException
- {
- try {
- endElementIO( namespaceURI, localName, rawName );
- } catch (IOException except) {
- throw new SAXException( except );
- }
- }
-
-
- public void endElementIO( String namespaceURI, String localName,
- String rawName )
- throws IOException
- {
- ElementState state;
- if (DEBUG) {
- System.out.println("==>endElement: " +rawName);
- }
- // Works much like content() with additions for closing
- // an element. Note the different checks for the closed
- // element's state and the parent element's state.
- _printer.unindent();
- state = getElementState();
- if (state.empty) {
- _printer.printText( "/>" );
- } else {
- // Must leave CData section first
- if (state.inCData)
- _printer.printText( "]]>" );
- // This element is not empty and that last content was
- // another element, so print a line break before that
- // last element and this element's closing tag.
- if (_indenting && ! state.preserveSpace && (state.afterElement || state.afterComment))
- _printer.breakLine();
- _printer.printText( "</" );
- _printer.printText( state.rawName );
- _printer.printText( '>' );
- }
- // Leave the element state and update that of the parent
- // (if we're not root) to not empty and after element.
- state = leaveElementState();
- state.afterElement = true;
- state.afterComment = false;
- state.empty = false;
- if (isDocumentState())
- _printer.flush();
- }
-
-
- //------------------------------------------//
- // SAX document handler serializing methods //
- //------------------------------------------//
-
-
- public void startElement( String tagName, AttributeList attrs )
- throws SAXException
- {
- int i;
- boolean preserveSpace;
- ElementState state;
- String name;
- String value;
-
-
- if (DEBUG) {
- System.out.println("==>startElement("+tagName+")");
- }
-
- try {
- if (_printer == null) {
- String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.SERIALIZER_DOMAIN, "NoWriterSupplied", null);
- throw new IllegalStateException(msg);
- }
-
- state = getElementState();
- if (isDocumentState()) {
- // If this is the root element handle it differently.
- // If the first root element in the document, serialize
- // the document's DOCTYPE. Space preserving defaults
- // to that of the output format.
- if (! _started)
- startDocument( tagName );
- } else {
- // For any other element, if first in parent, then
- // close parent's opening tag and use the parnet's
- // space preserving.
- if (state.empty)
- _printer.printText( '>' );
- // Must leave CData section first
- if (state.inCData) {
- _printer.printText( "]]>" );
- state.inCData = false;
- }
- // Indent this element on a new line if the first
- // content of the parent element or immediately
- // following an element.
- if (_indenting && ! state.preserveSpace &&
- ( state.empty || state.afterElement || state.afterComment))
- _printer.breakLine();
- }
- preserveSpace = state.preserveSpace;
-
- // Do not change the current element state yet.
- // This only happens in endElement().
-
- _printer.printText( '<' );
- _printer.printText( tagName );
- _printer.indent();
-
- // For each attribute print it's name and value as one part,
- // separated with a space so the element can be broken on
- // multiple lines.
- if (attrs != null) {
- for (i = 0 ; i < attrs.getLength() ; ++i) {
- _printer.printSpace();
- name = attrs.getName( i );
- value = attrs.getValue( i );
- if (value != null) {
- _printer.printText( name );
- _printer.printText( "=\"" );
- printEscaped( value );
- _printer.printText( '"' );
- }
-
- // If the attribute xml:space exists, determine whether
- // to preserve spaces in this and child nodes based on
- // its value.
- if (name.equals( "xml:space" )) {
- if (value.equals( "preserve" ))
- preserveSpace = true;
- else
- preserveSpace = _format.getPreserveSpace();
- }
- }
- }
- // Now it's time to enter a new element state
- // with the tag name and space preserving.
- // We still do not change the curent element state.
- state = enterElementState( null, null, tagName, preserveSpace );
- state.doCData = _format.isCDataElement( tagName );
- state.unescaped = _format.isNonEscapingElement( tagName );
- } catch (IOException except) {
- throw new SAXException( except );
- }
-
- }
-
-
- public void endElement( String tagName )
- throws SAXException
- {
- endElement( null, null, tagName );
- }
-
-
-
- //------------------------------------------//
- // Generic node serializing methods methods //
- //------------------------------------------//
-
-
- /**
- * Called to serialize the document's DOCTYPE by the root element.
- * The document type declaration must name the root element,
- * but the root element is only known when that element is serialized,
- * and not at the start of the document.
- * <p>
- * This method will check if it has not been called before ({@link #_started}),
- * will serialize the document type declaration, and will serialize all
- * pre-root comments and PIs that were accumulated in the document
- * (see {@link #serializePreRoot}). Pre-root will be serialized even if
- * this is not the first root element of the document.
- */
- protected void startDocument( String rootTagName )
- throws IOException
- {
- int i;
- String dtd;
-
- dtd = _printer.leaveDTD();
- if (! _started) {
-
- if (! _format.getOmitXMLDeclaration()) {
- StringBuffer buffer;
-
- // Serialize the document declaration appreaing at the head
- // of very XML document (unless asked not to).
- buffer = new StringBuffer( "<?xml version=\"" );
- if (_format.getVersion() != null)
- buffer.append( _format.getVersion() );
- else
- buffer.append( "1.0" );
- buffer.append( '"' );
- String format_encoding = _format.getEncoding();
- if (format_encoding != null) {
- buffer.append( " encoding=\"" );
- buffer.append( format_encoding );
- buffer.append( '"' );
- }
- if (_format.getStandalone() && _docTypeSystemId == null &&
- _docTypePublicId == null)
- buffer.append( " standalone=\"yes\"" );
- buffer.append( "?>" );
- _printer.printText( buffer );
- _printer.breakLine();
- }
-
- if (! _format.getOmitDocumentType()) {
- if (_docTypeSystemId != null) {
- // System identifier must be specified to print DOCTYPE.
- // If public identifier is specified print 'PUBLIC
- // <public> <system>', if not, print 'SYSTEM <system>'.
- _printer.printText( "<!DOCTYPE " );
- _printer.printText( rootTagName );
- if (_docTypePublicId != null) {
- _printer.printText( " PUBLIC " );
- printDoctypeURL( _docTypePublicId );
- if (_indenting) {
- _printer.breakLine();
- for (i = 0 ; i < 18 + rootTagName.length() ; ++i)
- _printer.printText( " " );
- } else
- _printer.printText( " " );
- printDoctypeURL( _docTypeSystemId );
- } else {
- _printer.printText( " SYSTEM " );
- printDoctypeURL( _docTypeSystemId );
- }
-
- // If we accumulated any DTD contents while printing.
- // this would be the place to print it.
- if (dtd != null && dtd.length() > 0) {
- _printer.printText( " [" );
- printText( dtd, true, true );
- _printer.printText( ']' );
- }
-
- _printer.printText( ">" );
- _printer.breakLine();
- } else if (dtd != null && dtd.length() > 0) {
- _printer.printText( "<!DOCTYPE " );
- _printer.printText( rootTagName );
- _printer.printText( " [" );
- printText( dtd, true, true );
- _printer.printText( "]>" );
- _printer.breakLine();
- }
- }
- }
- _started = true;
- // Always serialize these, even if not te first root element.
- serializePreRoot();
- }
-
-
- /**
- * Called to serialize a DOM element. Equivalent to calling {@link
- * #startElement}, {@link #endElement} and serializing everything
- * inbetween, but better optimized.
- */
- protected void serializeElement( Element elem )
- throws IOException
- {
- Attr attr;
- NamedNodeMap attrMap;
- int i;
- Node child;
- ElementState state;
- String name;
- String value;
- String tagName;
-
- String prefix, localUri;
- String uri;
- if (fNamespaces) {
- // local binder stores namespace declaration
- // that has been printed out during namespace fixup of
- // the current element
- fLocalNSBinder.reset();
-
- // add new namespace context
- fNSBinder.pushContext();
- }
-
- if (DEBUG) {
- System.out.println("==>startElement: " +elem.getNodeName() +" ns="+elem.getNamespaceURI());
- }
- tagName = elem.getTagName();
- state = getElementState();
- if (isDocumentState()) {
- // If this is the root element handle it differently.
- // If the first root element in the document, serialize
- // the document's DOCTYPE. Space preserving defaults
- // to that of the output format.
-
- if (! _started) {
- startDocument( tagName);
- }
- } else {
- // For any other element, if first in parent, then
- // close parent's opening tag and use the parent's
- // space preserving.
- if (state.empty)
- _printer.printText( '>' );
- // Must leave CData section first
- if (state.inCData) {
- _printer.printText( "]]>" );
- state.inCData = false;
- }
- // Indent this element on a new line if the first
- // content of the parent element or immediately
- // following an element.
- if (_indenting && ! state.preserveSpace &&
- ( state.empty || state.afterElement || state.afterComment))
- _printer.breakLine();
- }
-
- // Do not change the current element state yet.
- // This only happens in endElement().
- fPreserveSpace = state.preserveSpace;
-
-
- int length = 0;
- attrMap = null;
- // retrieve attributes
- if (elem.hasAttributes()) {
- attrMap = elem.getAttributes();
- length = attrMap.getLength();
- }
-
- if (!fNamespaces) { // no namespace fixup should be performed
-
- // serialize element name
- _printer.printText( '<' );
- _printer.printText( tagName );
- _printer.indent();
-
- // For each attribute print it's name and value as one part,
- // separated with a space so the element can be broken on
- // multiple lines.
- for ( i = 0 ; i < length ; ++i ) {
- attr = (Attr) attrMap.item( i );
- name = attr.getName();
- value = attr.getValue();
- if ( value == null )
- value = "";
- printAttribute (name, value, attr.getSpecified(), attr);
- }
- } else { // do namespace fixup
-
- // REVISIT: some optimization could probably be done to avoid traversing
- // attributes twice.
- //
-
- // ---------------------------------------
- // record all valid namespace declarations
- // before attempting to fix element's namespace
- // ---------------------------------------
-
- for (i = 0;i < length;i++) {
-
- attr = (Attr) attrMap.item( i );
- uri = attr.getNamespaceURI();
- // check if attribute is a namespace decl
- if (uri != null && uri.equals(NamespaceContext.XMLNS_URI)) {
-
- value = attr.getNodeValue();
- if (value == null) {
- value=XMLSymbols.EMPTY_STRING;
- }
-
- if (value.equals(NamespaceContext.XMLNS_URI)) {
- if (fDOMErrorHandler != null) {
- String msg = DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.XML_DOMAIN,"CantBindXMLNS",null );
- modifyDOMError(msg, DOMError.SEVERITY_ERROR, null, attr);
- boolean continueProcess = fDOMErrorHandler.handleError(fDOMError);
- if (!continueProcess) {
- // stop the namespace fixup and validation
- throw new RuntimeException(
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.SERIALIZER_DOMAIN,
- "SerializationStopped", null));
- }
- }
- } else {
- prefix = attr.getPrefix();
- prefix = (prefix == null ||
- prefix.length() == 0) ? XMLSymbols.EMPTY_STRING :fSymbolTable.addSymbol(prefix);
- String localpart = fSymbolTable.addSymbol( attr.getLocalName());
- if (prefix == XMLSymbols.PREFIX_XMLNS) { //xmlns:prefix
- value = fSymbolTable.addSymbol(value);
- // record valid decl
- if (value.length() != 0) {
- fNSBinder.declarePrefix(localpart, value);
- } else {
- // REVISIT: issue error on invalid declarations
- // xmlns:foo = ""
- }
- continue;
- } else { // xmlns
- // empty prefix is always bound ("" or some string)
-
- value = fSymbolTable.addSymbol(value);
- fNSBinder.declarePrefix(XMLSymbols.EMPTY_STRING, value);
- continue;
- }
- } // end-else: valid declaration
- } // end-if: namespace declaration
- } // end-for
-
- //-----------------------
- // get element uri/prefix
- //-----------------------
- uri = elem.getNamespaceURI();
- prefix = elem.getPrefix();
-
- //----------------------
- // output element name
- //----------------------
- // REVISIT: this could be removed if we always convert empty string to null
- // for the namespaces.
- if ((uri !=null && prefix !=null ) && uri.length() == 0 && prefix.length()!=0) {
- // uri is an empty string and element has some prefix
- // the namespace alg later will fix up the namespace attributes
- // remove element prefix
- prefix = null;
- _printer.printText( '<' );
- _printer.printText( elem.getLocalName() );
- _printer.indent();
- } else {
- _printer.printText( '<' );
- _printer.printText( tagName );
- _printer.indent();
- }
-
-
- // ---------------------------------------------------------
- // Fix up namespaces for element: per DOM L3
- // Need to consider the following cases:
- //
- // case 1: <foo:elem xmlns:ns1="myURI" xmlns="default"/>
- // Assume "foo", "ns1" are declared on the parent. We should not miss
- // redeclaration for both "ns1" and default namespace. To solve this
- // we add a local binder that stores declaration only for current element.
- // This way we avoid outputing duplicate declarations for the same element
- // as well as we are not omitting redeclarations.
- //
- // case 2: <elem xmlns="" xmlns="default"/>
- // We need to bind default namespace to empty string, to be able to
- // omit duplicate declarations for the same element
- //
- // case 3: <xsl:stylesheet xmlns:xsl="http://xsl">
- // We create another element body bound to the "http://xsl" namespace
- // as well as namespace attribute rebounding xsl to another namespace.
- // <xsl:body xmlns:xsl="http://another">
- // Need to make sure that the new namespace decl value is changed to
- // "http://xsl"
- //
- // ---------------------------------------------------------
- // check if prefix/namespace is correct for current element
- // ---------------------------------------------------------
-
-
- if (uri != null) { // Element has a namespace
- uri = fSymbolTable.addSymbol(uri);
- prefix = (prefix == null ||
- prefix.length() == 0) ? XMLSymbols.EMPTY_STRING :fSymbolTable.addSymbol(prefix);
- if (fNSBinder.getURI(prefix) == uri) {
- // The xmlns:prefix=namespace or xmlns="default" was declared at parent.
- // The binder always stores mapping of empty prefix to "".
- // (NOTE: local binder does not store this kind of binding!)
- // Thus the case where element was declared with uri="" (with or without a prefix)
- // will be covered here.
-
- } else {
- // the prefix is either undeclared
- // or
- // conflict: the prefix is bound to another URI
- if (fNamespacePrefixes) {
- printNamespaceAttr(prefix, uri);
- }
- fLocalNSBinder.declarePrefix(prefix, uri);
- fNSBinder.declarePrefix(prefix, uri);
- }
- } else { // Element has no namespace
- if (elem.getLocalName() == null) {
- // DOM Level 1 node!
- if (fDOMErrorHandler != null) {
- String msg = DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN, "NullLocalElementName",
- new Object[]{elem.getNodeName()});
- modifyDOMError(msg,DOMError.SEVERITY_ERROR, null, elem);
- boolean continueProcess = fDOMErrorHandler.handleError(fDOMError);
- // REVISIT: should we terminate upon request?
- if (!continueProcess) {
- throw new RuntimeException(
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.SERIALIZER_DOMAIN,
- "SerializationStopped", null));
- }
- }
- } else { // uri=null and no colon (DOM L2 node)
- uri = fNSBinder.getURI(XMLSymbols.EMPTY_STRING);
-
- if (uri !=null && uri.length() > 0) {
- // there is a default namespace decl that is bound to
- // non-zero length uri, output xmlns=""
- if (fNamespacePrefixes) {
- printNamespaceAttr(XMLSymbols.EMPTY_STRING, XMLSymbols.EMPTY_STRING);
- }
- fLocalNSBinder.declarePrefix(XMLSymbols.EMPTY_STRING, XMLSymbols.EMPTY_STRING);
- fNSBinder.declarePrefix(XMLSymbols.EMPTY_STRING, XMLSymbols.EMPTY_STRING);
- }
- }
- }
-
-
- // -----------------------------------------
- // Fix up namespaces for attributes: per DOM L3
- // check if prefix/namespace is correct the attributes
- // -----------------------------------------
-
- for (i = 0; i < length; i++) {
-
- attr = (Attr) attrMap.item( i );
- value = attr.getValue();
- name = attr.getNodeName();
-
- uri = attr.getNamespaceURI();
-
- // Fix attribute that was declared with a prefix and namespace=""
- if (uri !=null && uri.length() == 0) {
- uri=null;
- // we must remove prefix for this attribute
- name=attr.getLocalName();
- }
-
- if (DEBUG) {
- System.out.println("==>process attribute: "+attr.getNodeName());
- }
- // make sure that value is never null.
- if (value == null) {
- value=XMLSymbols.EMPTY_STRING;
- }
-
- if (uri != null) { // attribute has namespace !=null
- prefix = attr.getPrefix();
- prefix = prefix == null ? XMLSymbols.EMPTY_STRING :fSymbolTable.addSymbol(prefix);
- String localpart = fSymbolTable.addSymbol( attr.getLocalName());
-
-
-
- // ---------------------------------------------------
- // print namespace declarations namespace declarations
- // ---------------------------------------------------
- if (uri != null && uri.equals(NamespaceContext.XMLNS_URI)) {
- // check if we need to output this declaration
- prefix = attr.getPrefix();
- prefix = (prefix == null ||
- prefix.length() == 0) ? XMLSymbols.EMPTY_STRING : fSymbolTable.addSymbol(prefix);
- localpart = fSymbolTable.addSymbol( attr.getLocalName());
- if (prefix == XMLSymbols.PREFIX_XMLNS) { //xmlns:prefix
- localUri = fLocalNSBinder.getURI(localpart); // local prefix mapping
- value = fSymbolTable.addSymbol(value);
- if (value.length() != 0 ) {
- if (localUri == null) {
- // declaration was not printed while fixing element namespace binding
-
- // If the DOM Level 3 namespace-prefixes feature is set to false
- // do not print xmlns attributes
- if (fNamespacePrefixes) {
- printNamespaceAttr(localpart, value);
- }
-
- // case 4: <elem xmlns:xx="foo" xx:attr=""/>
- // where attribute is bound to "bar".
- // If the xmlns:xx is output here first, later we should not
- // redeclare "xx" prefix. Instead we would pick up different prefix
- // for the attribute.
- // final: <elem xmlns:xx="foo" NS1:attr="" xmlns:NS1="bar"/>
- fLocalNSBinder.declarePrefix(localpart, value);
- }
- } else {
- // REVISIT: issue error on invalid declarations
- // xmlns:foo = ""
- }
- continue;
- } else { // xmlns
- // empty prefix is always bound ("" or some string)
-
- uri = fNSBinder.getURI(XMLSymbols.EMPTY_STRING);
- localUri=fLocalNSBinder.getURI(XMLSymbols.EMPTY_STRING);
- value = fSymbolTable.addSymbol(value);
- if (localUri == null ){
- // declaration was not printed while fixing element namespace binding
- if (fNamespacePrefixes) {
- printNamespaceAttr(XMLSymbols.EMPTY_STRING, value);
- }
- // case 4 does not apply here since attributes can't use
- // default namespace
- }
- continue;
- }
-
- }
- uri = fSymbolTable.addSymbol(uri);
-
- // find if for this prefix a URI was already declared
- String declaredURI = fNSBinder.getURI(prefix);
-
- if (prefix == XMLSymbols.EMPTY_STRING || declaredURI != uri) {
- // attribute has no prefix (default namespace decl does not apply to attributes)
- // OR
- // attribute prefix is not declared
- // OR
- // conflict: attr URI does not match the prefix in scope
-
- name = attr.getNodeName();
- // Find if any prefix for attributes namespace URI is available
- // in the scope
- String declaredPrefix = fNSBinder.getPrefix(uri);
-
- if (declaredPrefix !=null && declaredPrefix !=XMLSymbols.EMPTY_STRING) {
- // use the prefix that was found
- prefix = declaredPrefix;
- name=prefix+":"+localpart;
- } else {
- if (DEBUG) {
- System.out.println("==> cound not find prefix for the attribute: " +prefix);
- }
-
- if (prefix != XMLSymbols.EMPTY_STRING && fLocalNSBinder.getURI(prefix) == null) {
- // the current prefix is not null and it has no in scope declaration
-
- // use this prefix
- } else {
- // find a prefix following the pattern "NS" +index (starting at 1)
- // make sure this prefix is not declared in the current scope.
- int counter = 1;
- prefix = fSymbolTable.addSymbol(PREFIX + counter++);
- while (fLocalNSBinder.getURI(prefix)!=null) {
- prefix = fSymbolTable.addSymbol(PREFIX +counter++);
- }
- name=prefix+":"+localpart;
- }
- // add declaration for the new prefix
- if (fNamespacePrefixes) {
- printNamespaceAttr(prefix, uri);
- }
- value = fSymbolTable.addSymbol(value);
- fLocalNSBinder.declarePrefix(prefix, value);
- fNSBinder.declarePrefix(prefix, uri);
- }
-
- // change prefix for this attribute
- }
-
- printAttribute (name, (value==null)?XMLSymbols.EMPTY_STRING:value, attr.getSpecified(), attr);
- } else { // attribute uri == null
- if (attr.getLocalName() == null) {
- if (fDOMErrorHandler != null) {
- String msg = DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.DOM_DOMAIN,
- "NullLocalAttrName", new Object[]{attr.getNodeName()});
- modifyDOMError(msg, DOMError.SEVERITY_ERROR, null, attr);
- boolean continueProcess = fDOMErrorHandler.handleError(fDOMError);
- if (!continueProcess) {
- // stop the namespace fixup and validation
- throw new RuntimeException(
- DOMMessageFormatter.formatMessage(
- DOMMessageFormatter.SERIALIZER_DOMAIN,
- "SerializationStopped", null));
- }
- }
- printAttribute (name, value, attr.getSpecified(), attr);
- } else { // uri=null and no colon
-
- // no fix up is needed: default namespace decl does not
- // apply to attributes
- printAttribute (name, value, attr.getSpecified(), attr);
- }
- }
- } // end loop for attributes
-
- }// end namespace fixup algorithm
-
-
- // If element has children, then serialize them, otherwise
- // serialize en empty tag.
- if (elem.hasChildNodes()) {
- // Enter an element state, and serialize the children
- // one by one. Finally, end the element.
- state = enterElementState( null, null, tagName, fPreserveSpace );
- state.doCData = _format.isCDataElement( tagName );
- state.unescaped = _format.isNonEscapingElement( tagName );
- child = elem.getFirstChild();
- while (child != null) {
- serializeNode( child );
- child = child.getNextSibling();
- }
- if (fNamespaces) {
- fNSBinder.popContext();
- }
- endElementIO( null, null, tagName );
- } else {
- if (DEBUG) {
- System.out.println("==>endElement: " +elem.getNodeName());
- }
- if (fNamespaces) {
- fNSBinder.popContext();
- }
- _printer.unindent();
- _printer.printText( "/>" );
- // After element but parent element is no longer empty.
- state.afterElement = true;
- state.afterComment = false;
- state.empty = false;
- if (isDocumentState())
- _printer.flush();
- }
- }
-
-
-
- /**
- * Serializes a namespace attribute with the given prefix and value for URI.
- * In case prefix is empty will serialize default namespace declaration.
- *
- * @param prefix
- * @param uri
- * @exception IOException
- */
-
- private void printNamespaceAttr(String prefix, String uri) throws IOException{
- _printer.printSpace();
- if (prefix == XMLSymbols.EMPTY_STRING) {
- if (DEBUG) {
- System.out.println("=>add xmlns=\""+uri+"\" declaration");
- }
- _printer.printText( XMLSymbols.PREFIX_XMLNS );
- } else {
- if (DEBUG) {
- System.out.println("=>add xmlns:"+prefix+"=\""+uri+"\" declaration");
- }
- _printer.printText( "xmlns:"+prefix );
- }
- _printer.printText( "=\"" );
- printEscaped( uri );
- _printer.printText( '"' );
- }
-
-
-
- /**
- * Prints attribute.
- * NOTE: xml:space attribute modifies output format
- *
- * @param name
- * @param value
- * @param isSpecified
- * @exception IOException
- */
- private void printAttribute (String name, String value, boolean isSpecified, Attr attr) throws IOException{
-
- if (isSpecified || (features & DOMSerializerImpl.DISCARDDEFAULT) == 0) {
- if (fDOMFilter !=null &&
- (fDOMFilter.getWhatToShow() & NodeFilter.SHOW_ATTRIBUTE)!= 0) {
- short code = fDOMFilter.acceptNode(attr);
- switch (code) {
- case NodeFilter.FILTER_REJECT:
- case NodeFilter.FILTER_SKIP: {
- return;
- }
- default: {
- // fall through
- }
- }
- }
- _printer.printSpace();
- _printer.printText( name );
- _printer.printText( "=\"" );
- printEscaped( value );
- _printer.printText( '"' );
- }
-
- // If the attribute xml:space exists, determine whether
- // to preserve spaces in this and child nodes based on
- // its value.
- if (name.equals( "xml:space" )) {
- if (value.equals( "preserve" ))
- fPreserveSpace = true;
- else
- fPreserveSpace = _format.getPreserveSpace();
- }
- }
-
- protected String getEntityRef( int ch ) {
- // Encode special XML characters into the equivalent character references.
- // These five are defined by default for all XML documents.
- switch (ch) {
- case '<':
- return "lt";
- case '>':
- return "gt";
- case '"':
- return "quot";
- case '\'':
- return "apos";
- case '&':
- return "amp";
- }
- return null;
- }
-
-
- /** Retrieve and remove the namespaces declarations from the list of attributes.
- *
- */
- private Attributes extractNamespaces( Attributes attrs )
- throws SAXException
- {
- AttributesImpl attrsOnly;
- String rawName;
- int i;
- int indexColon;
- String prefix;
- int length;
-
- if (attrs == null) {
- return null;
- }
- length = attrs.getLength();
- attrsOnly = new AttributesImpl( attrs );
-
- for (i = length - 1 ; i >= 0 ; --i) {
- rawName = attrsOnly.getQName( i );
-
- //We have to exclude the namespaces declarations from the attributes
- //Append only when the feature http://xml.org/sax/features/namespace-prefixes"
- //is TRUE
- if (rawName.startsWith( "xmlns" )) {
- if (rawName.length() == 5) {
- startPrefixMapping( "", attrs.getValue( i ) );
- attrsOnly.removeAttribute( i );
- } else if (rawName.charAt(5) == ':') {
- startPrefixMapping(rawName.substring(6), attrs.getValue(i));
- attrsOnly.removeAttribute( i );
- }
- }
- }
- return attrsOnly;
- }
-
- //
- // Printing attribute value
- //
- protected void printEscaped(String source) throws IOException {
- int length = source.length();
- for (int i = 0; i < length; ++i) {
- int ch = source.charAt(i);
- if (!XMLChar.isValid(ch)) {
- if (++i < length) {
- surrogates(ch, source.charAt(i));
- } else {
- fatalError("The character '" + (char) ch + "' is an invalid XML character");
- }
- continue;
- }
- // escape NL, CR, TAB
- if (ch == '\n' || ch == '\r' || ch == '\t') {
- printHex(ch);
- } else if (ch == '<') {
- _printer.printText("&lt;");
- } else if (ch == '&') {
- _printer.printText("&amp;");
- } else if (ch == '"') {
- _printer.printText("&quot;");
- } else if ((ch >= ' ' && _encodingInfo.isPrintable((char) ch))) {
- _printer.printText((char) ch);
- } else {
- printHex(ch);
- }
- }
- }
-
- /** print text data */
- protected void printXMLChar( int ch) throws IOException {
- if (ch == '\r') {
- printHex(ch);
- } else if ( ch == '<') {
- _printer.printText("&lt;");
- } else if (ch == '&') {
- _printer.printText("&amp;");
- } else if (ch == '>'){
- // character sequence "]]>" can't appear in content, therefore
- // we should escape '>'
- _printer.printText("&gt;");
- } else if ( ch == '\n' || ch == '\t' ||
- ( ch >= ' ' && _encodingInfo.isPrintable((char)ch))) {
- _printer.printText((char)ch);
- } else {
- printHex(ch);
- }
- }
-
- protected void printText( String text, boolean preserveSpace, boolean unescaped )
- throws IOException {
- int index;
- char ch;
- int length = text.length();
- if ( preserveSpace ) {
- // Preserving spaces: the text must print exactly as it is,
- // without breaking when spaces appear in the text and without
- // consolidating spaces. If a line terminator is used, a line
- // break will occur.
- for ( index = 0 ; index < length ; ++index ) {
- ch = text.charAt( index );
- if (!XMLChar.isValid(ch)) {
- // check if it is surrogate
- if (++index <length) {
- surrogates(ch, text.charAt(index));
- } else {
- fatalError("The character '"+(char)ch+"' is an invalid XML character");
- }
- continue;
- }
- if ( unescaped ) {
- _printer.printText( ch );
- } else
- printXMLChar( ch );
- }
- } else {
- // Not preserving spaces: print one part at a time, and
- // use spaces between parts to break them into different
- // lines. Spaces at beginning of line will be stripped
- // by printing mechanism. Line terminator is treated
- // no different than other text part.
- for ( index = 0 ; index < length ; ++index ) {
- ch = text.charAt( index );
- if (!XMLChar.isValid(ch)) {
- // check if it is surrogate
- if (++index <length) {
- surrogates(ch, text.charAt(index));
- } else {
- fatalError("The character '"+(char)ch+"' is an invalid XML character");
- }
- continue;
- }
-
- if ( unescaped )
- _printer.printText( ch );
- else
- printXMLChar( ch);
- }
- }
- }
-
-
-
- protected void printText( char[] chars, int start, int length,
- boolean preserveSpace, boolean unescaped ) throws IOException {
- int index;
- char ch;
-
- if ( preserveSpace ) {
- // Preserving spaces: the text must print exactly as it is,
- // without breaking when spaces appear in the text and without
- // consolidating spaces. If a line terminator is used, a line
- // break will occur.
- while ( length-- > 0 ) {
- ch = chars[start++];
- if (!XMLChar.isValid(ch)) {
- // check if it is surrogate
- if ( length-- > 0 ) {
- surrogates(ch, chars[start++]);
- } else {
- fatalError("The character '"+(char)ch+"' is an invalid XML character");
- }
- continue;
- }
- if ( unescaped )
- _printer.printText( ch );
- else
- printXMLChar( ch );
- }
- } else {
- // Not preserving spaces: print one part at a time, and
- // use spaces between parts to break them into different
- // lines. Spaces at beginning of line will be stripped
- // by printing mechanism. Line terminator is treated
- // no different than other text part.
- while ( length-- > 0 ) {
- ch = chars[start++];
- if (!XMLChar.isValid(ch)) {
- // check if it is surrogate
- if ( length-- > 0 ) {
- surrogates(ch, chars[start++]);
- } else {
- fatalError("The character '"+(char)ch+"' is an invalid XML character");
- }
- continue;
- }
- if ( unescaped )
- _printer.printText( ch );
- else
- printXMLChar( ch );
- }
- }
- }
-
-
- /**
- * DOM Level 3:
- * Check a node to determine if it contains unbound namespace prefixes.
- *
- * @param node The node to check for unbound namespace prefices
- */
- protected void checkUnboundNamespacePrefixedNode (Node node) throws IOException{
-
- if (fNamespaces) {
-
- if (DEBUG) {
- System.out.println("==>serializeNode("+node.getNodeName()+") [Entity Reference - Namespaces on]");
- System.out.println("==>Declared Prefix Count: " + fNSBinder.getDeclaredPrefixCount());
- System.out.println("==>Node Name: " + node.getNodeName());
- System.out.println("==>First Child Node Name: " + node.getFirstChild().getNodeName());
- System.out.println("==>First Child Node Prefix: " + node.getFirstChild().getPrefix());
- System.out.println("==>First Child Node NamespaceURI: " + node.getFirstChild().getNamespaceURI());
- }
-
-
- Node child, next;
- for (child = node.getFirstChild(); child != null; child = next) {
- next = child.getNextSibling();
- if (DEBUG) {
- System.out.println("==>serializeNode("+child.getNodeName()+") [Child Node]");
- System.out.println("==>serializeNode("+child.getPrefix()+") [Child Node Prefix]");
- }
-
- //If a NamespaceURI is not declared for the current
- //node's prefix, raise a fatal error.
- String prefix = child.getPrefix();
- prefix = (prefix == null ||
- prefix.length() == 0) ? XMLSymbols.EMPTY_STRING : fSymbolTable.addSymbol(prefix);
- if (fNSBinder.getURI(prefix) == null && prefix != null) {
- fatalError("The replacement text of the entity node '"
- + node.getNodeName()
- + "' contains an element node '"
- + child.getNodeName()
- + "' with an undeclared prefix '"
- + prefix + "'.");
- }
-
- if (child.getNodeType() == Node.ELEMENT_NODE) {
-
- NamedNodeMap attrs = child.getAttributes();
-
- for (int i = 0; i< attrs.getLength(); i++ ) {
-
- String attrPrefix = attrs.item(i).getPrefix();
- attrPrefix = (attrPrefix == null ||
- attrPrefix.length() == 0) ? XMLSymbols.EMPTY_STRING : fSymbolTable.addSymbol(attrPrefix);
- if (fNSBinder.getURI(attrPrefix) == null && attrPrefix != null) {
- fatalError("The replacement text of the entity node '"
- + node.getNodeName()
- + "' contains an element node '"
- + child.getNodeName()
- + "' with an attribute '"
- + attrs.item(i).getNodeName()
- + "' an undeclared prefix '"
- + attrPrefix + "'.");
- }
-
- }
-
- }
-
- if (child.hasChildNodes()) {
- checkUnboundNamespacePrefixedNode(child);
- }
- }
- }
- }
-
- public boolean reset() {
- super.reset();
- if (fNSBinder != null){
- fNSBinder.reset();
- // during serialization always have a mapping to empty string
- // so we assume there is a declaration.
- fNSBinder.declarePrefix(XMLSymbols.EMPTY_STRING, XMLSymbols.EMPTY_STRING);
- }
- return true;
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/AttributesImplSerializer.java b/src/com/sun/org/apache/xml/internal/serializer/AttributesImplSerializer.java
deleted file mode 100644
index a3cdaa9..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/AttributesImplSerializer.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: AttributesImplSerializer.java,v 1.2.4.1 2005/09/15 08:15:14 suresh_emailid Exp $
- */
-
-package com.sun.org.apache.xml.internal.serializer;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.xml.sax.Attributes;
-import org.xml.sax.helpers.AttributesImpl;
-
-/**
- * This class extends org.xml.sax.helpers.AttributesImpl which implements org.
- * xml.sax.Attributes. But for optimization this class adds a Map for
- * faster lookup of an index by qName, which is commonly done in the stream
- * serializer.
- *
- * @see org.xml.sax.Attributes
- *
- * @xsl.usage internal
- */
-public final class AttributesImplSerializer extends AttributesImpl
-{
- /**
- * Hash table of qName/index values to quickly lookup the index
- * of an attributes qName. qNames are in uppercase in the hash table
- * to make the search case insensitive.
- *
- * The keys to the hashtable to find the index are either
- * "prefix:localName" or "{uri}localName".
- */
- private final Map<String, Integer> m_indexFromQName = new HashMap<>();
-
- private final StringBuffer m_buff = new StringBuffer();
-
- /**
- * This is the number of attributes before switching to the hash table,
- * and can be tuned, but 12 seems good for now - Brian M.
- */
- private static final int MAX = 12;
-
- /**
- * One less than the number of attributes before switching to
- * the Map.
- */
- private static final int MAXMinus1 = MAX - 1;
-
- /**
- * This method gets the index of an attribute given its qName.
- * @param qname the qualified name of the attribute, e.g. "prefix1:locName1"
- * @return the integer index of the attribute.
- * @see org.xml.sax.Attributes#getIndex(String)
- */
- public final int getIndex(String qname)
- {
- int index;
-
- if (super.getLength() < MAX)
- {
- // if we haven't got too many attributes let the
- // super class look it up
- index = super.getIndex(qname);
- return index;
- }
- // we have too many attributes and the super class is slow
- // so find it quickly using our Map.
- Integer i = m_indexFromQName.get(qname);
- if (i == null)
- index = -1;
- else
- index = i.intValue();
- return index;
- }
- /**
- * This method adds the attribute, but also records its qName/index pair in
- * the hashtable for fast lookup by getIndex(qName).
- * @param uri the URI of the attribute
- * @param local the local name of the attribute
- * @param qname the qualified name of the attribute
- * @param type the type of the attribute
- * @param val the value of the attribute
- *
- * @see org.xml.sax.helpers.AttributesImpl#addAttribute(String, String, String, String, String)
- * @see #getIndex(String)
- */
- public final void addAttribute(
- String uri,
- String local,
- String qname,
- String type,
- String val)
- {
- int index = super.getLength();
- super.addAttribute(uri, local, qname, type, val);
- // (index + 1) is now the number of attributes
- // so either compare (index+1) to MAX, or compare index to (MAX-1)
-
- if (index < MAXMinus1)
- {
- return;
- }
- else if (index == MAXMinus1)
- {
- switchOverToHash(MAX);
- }
- else
- {
- /* add the key with the format of "prefix:localName" */
- /* we have just added the attibute, its index is the old length */
- Integer i = index;
- m_indexFromQName.put(qname, i);
-
- /* now add with key of the format "{uri}localName" */
- m_buff.setLength(0);
- m_buff.append('{').append(uri).append('}').append(local);
- String key = m_buff.toString();
- m_indexFromQName.put(key, i);
- }
- }
-
- /**
- * We are switching over to having a hash table for quick look
- * up of attributes, but up until now we haven't kept any
- * information in the Map, so we now update the Map.
- * Future additional attributes will update the Map as
- * they are added.
- * @param numAtts
- */
- private void switchOverToHash(int numAtts)
- {
- for (int index = 0; index < numAtts; index++)
- {
- String qName = super.getQName(index);
- Integer i = index;
- m_indexFromQName.put(qName, i);
-
- // Add quick look-up to find with uri/local name pair
- String uri = super.getURI(index);
- String local = super.getLocalName(index);
- m_buff.setLength(0);
- m_buff.append('{').append(uri).append('}').append(local);
- String key = m_buff.toString();
- m_indexFromQName.put(key, i);
- }
- }
-
- /**
- * This method clears the accumulated attributes.
- *
- * @see org.xml.sax.helpers.AttributesImpl#clear()
- */
- public final void clear()
- {
-
- int len = super.getLength();
- super.clear();
- if (MAX <= len)
- {
- // if we have had enough attributes and are
- // using the Map, then clear the Map too.
- m_indexFromQName.clear();
- }
-
- }
-
- /**
- * This method sets the attributes, previous attributes are cleared,
- * it also keeps the hashtable up to date for quick lookup via
- * getIndex(qName).
- * @param atts the attributes to copy into these attributes.
- * @see org.xml.sax.helpers.AttributesImpl#setAttributes(Attributes)
- * @see #getIndex(String)
- */
- public final void setAttributes(Attributes atts)
- {
-
- super.setAttributes(atts);
-
- // we've let the super class add the attributes, but
- // we need to keep the hash table up to date ourselves for the
- // potentially new qName/index pairs for quick lookup.
- int numAtts = atts.getLength();
- if (MAX <= numAtts)
- switchOverToHash(numAtts);
-
- }
-
- /**
- * This method gets the index of an attribute given its uri and locanName.
- * @param uri the URI of the attribute name.
- * @param localName the local namer (after the ':' ) of the attribute name.
- * @return the integer index of the attribute.
- * @see org.xml.sax.Attributes#getIndex(String)
- */
- public final int getIndex(String uri, String localName)
- {
- int index;
-
- if (super.getLength() < MAX)
- {
- // if we haven't got too many attributes let the
- // super class look it up
- index = super.getIndex(uri,localName);
- return index;
- }
- // we have too many attributes and the super class is slow
- // so find it quickly using our Map.
- // Form the key of format "{uri}localName"
- m_buff.setLength(0);
- m_buff.append('{').append(uri).append('}').append(localName);
- String key = m_buff.toString();
- Integer i = m_indexFromQName.get(key);
- if (i == null)
- index = -1;
- else
- index = i;
- return index;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/CharInfo.java b/src/com/sun/org/apache/xml/internal/serializer/CharInfo.java
deleted file mode 100644
index 04e77d6..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/CharInfo.java
+++ /dev/null
@@ -1,746 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: CharInfo.java,v 1.2.4.1 2005/09/15 08:15:14 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.serializer;
-
-import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
-import com.sun.org.apache.xml.internal.serializer.utils.MsgKey;
-import com.sun.org.apache.xml.internal.serializer.utils.SystemIDResolver;
-import com.sun.org.apache.xml.internal.serializer.utils.Utils;
-import com.sun.org.apache.xml.internal.serializer.utils.WrappedRuntimeException;
-import java.io.BufferedReader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.UnsupportedEncodingException;
-import java.net.URL;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.PropertyResourceBundle;
-import java.util.ResourceBundle;
-import javax.xml.transform.TransformerException;
-
-/**
- * This class provides services that tell if a character should have
- * special treatement, such as entity reference substitution or normalization
- * of a newline character. It also provides character to entity reference
- * lookup.
- *
- * DEVELOPERS: See Known Issue in the constructor.
- *
- * @xsl.usage internal
- */
-final class CharInfo
-{
- /** Given a character, lookup a String to output (e.g. a decorated entity reference). */
- private HashMap m_charToString = new HashMap();
-
- /**
- * The name of the HTML entities file.
- * If specified, the file will be resource loaded with the default class loader.
- */
- public static final String HTML_ENTITIES_RESOURCE =
- "com.sun.org.apache.xml.internal.serializer.HTMLEntities";
-
- /**
- * The name of the XML entities file.
- * If specified, the file will be resource loaded with the default class loader.
- */
- public static final String XML_ENTITIES_RESOURCE =
- "com.sun.org.apache.xml.internal.serializer.XMLEntities";
-
- /** The horizontal tab character, which the parser should always normalize. */
- public static final char S_HORIZONAL_TAB = 0x09;
-
- /** The linefeed character, which the parser should always normalize. */
- public static final char S_LINEFEED = 0x0A;
-
- /** The carriage return character, which the parser should always normalize. */
- public static final char S_CARRIAGERETURN = 0x0D;
-
- /** This flag is an optimization for HTML entities. It false if entities
- * other than quot (34), amp (38), lt (60) and gt (62) are defined
- * in the range 0 to 127.
- * @xsl.usage internal
- */
- final boolean onlyQuotAmpLtGt;
-
- /** Copy the first 0,1 ... ASCII_MAX values into an array */
- private static final int ASCII_MAX = 128;
-
- /** Array of values is faster access than a set of bits
- * to quickly check ASCII characters in attribute values.
- */
- private boolean[] isSpecialAttrASCII = new boolean[ASCII_MAX];
-
- /** Array of values is faster access than a set of bits
- * to quickly check ASCII characters in text nodes.
- */
- private boolean[] isSpecialTextASCII = new boolean[ASCII_MAX];
-
- private boolean[] isCleanTextASCII = new boolean[ASCII_MAX];
-
- /** An array of bits to record if the character is in the set.
- * Although information in this array is complete, the
- * isSpecialAttrASCII array is used first because access to its values
- * is common and faster.
- */
- private int array_of_bits[] = createEmptySetOfIntegers(65535);
-
-
- // 5 for 32 bit words, 6 for 64 bit words ...
- /*
- * This constant is used to shift an integer to quickly
- * calculate which element its bit is stored in.
- * 5 for 32 bit words (int) , 6 for 64 bit words (long)
- */
- private static final int SHIFT_PER_WORD = 5;
-
- /*
- * A mask to get the low order bits which are used to
- * calculate the value of the bit within a given word,
- * that will represent the presence of the integer in the
- * set.
- *
- * 0x1F for 32 bit words (int),
- * or 0x3F for 64 bit words (long)
- */
- private static final int LOW_ORDER_BITMASK = 0x1f;
-
- /*
- * This is used for optimizing the lookup of bits representing
- * the integers in the set. It is the index of the first element
- * in the array array_of_bits[] that is not used.
- */
- private int firstWordNotUsed;
-
-
- /**
- * Constructor that reads in a resource file that describes the mapping of
- * characters to entity references.
- * This constructor is private, just to force the use
- * of the getCharInfo(entitiesResource) factory
- *
- * Resource files must be encoded in UTF-8 and can either be properties
- * files with a .properties extension assumed. Alternatively, they can
- * have the following form, with no particular extension assumed:
- *
- * <pre>
- * # First char # is a comment
- * Entity numericValue
- * quot 34
- * amp 38
- * </pre>
- *
- * @param entitiesResource Name of properties or resource file that should
- * be loaded, which describes that mapping of characters to entity
- * references.
- */
- private CharInfo(String entitiesResource, String method)
- {
- this(entitiesResource, method, false);
- }
-
- private CharInfo(String entitiesResource, String method, boolean internal)
- {
- ResourceBundle entities = null;
- boolean noExtraEntities = true;
-
- // Make various attempts to interpret the parameter as a properties
- // file or resource file, as follows:
- //
- // 1) attempt to load .properties file using ResourceBundle
- // 2) try using the class loader to find the specified file a resource
- // file
- // 3) try treating the resource a URI
-
- try {
- if (internal) {
- // Load entity property files by using PropertyResourceBundle,
- // cause of security issure for applets
- entities = PropertyResourceBundle.getBundle(entitiesResource);
- } else {
- ClassLoader cl = SecuritySupport.getContextClassLoader();
- if (cl != null) {
- entities = PropertyResourceBundle.getBundle(entitiesResource,
- Locale.getDefault(), cl);
- }
- }
- } catch (Exception e) {}
-
- if (entities != null) {
- Enumeration keys = entities.getKeys();
- while (keys.hasMoreElements()){
- String name = (String) keys.nextElement();
- String value = entities.getString(name);
- int code = Integer.parseInt(value);
- defineEntity(name, (char) code);
- if (extraEntity(code))
- noExtraEntities = false;
- }
- set(S_LINEFEED);
- set(S_CARRIAGERETURN);
- } else {
- InputStream is = null;
- String err = null;
-
- // Load user specified resource file by using URL loading, it
- // requires a valid URI as parameter
- try {
- if (internal) {
- is = CharInfo.class.getResourceAsStream(entitiesResource);
- } else {
- ClassLoader cl = SecuritySupport.getContextClassLoader();
- if (cl != null) {
- try {
- is = cl.getResourceAsStream(entitiesResource);
- } catch (Exception e) {
- err = e.getMessage();
- }
- }
-
- if (is == null) {
- try {
- URL url = new URL(entitiesResource);
- is = url.openStream();
- } catch (Exception e) {
- err = e.getMessage();
- }
- }
- }
-
- if (is == null) {
- throw new RuntimeException(
- Utils.messages.createMessage(
- MsgKey.ER_RESOURCE_COULD_NOT_FIND,
- new Object[] {entitiesResource, err}));
- }
-
- // Fix Bugzilla#4000: force reading in UTF-8
- // This creates the de facto standard that Xalan's resource
- // files must be encoded in UTF-8. This should work in all
- // JVMs.
- //
- // %REVIEW% KNOWN ISSUE: IT FAILS IN MICROSOFT VJ++, which
- // didn't implement the UTF-8 encoding. Theoretically, we should
- // simply let it fail in that case, since the JVM is obviously
- // broken if it doesn't support such a basic standard. But
- // since there are still some users attempting to use VJ++ for
- // development, we have dropped in a fallback which makes a
- // second attempt using the platform's default encoding. In VJ++
- // this is apparently ASCII, which is subset of UTF-8... and
- // since the strings we'll be reading here are also primarily
- // limited to the 7-bit ASCII range (at least, in English
- // versions of Xalan), this should work well enough to keep us
- // on the air until we're ready to officially decommit from
- // VJ++.
-
- BufferedReader reader;
- try {
- reader = new BufferedReader(new InputStreamReader(is, "UTF-8"));
- } catch (UnsupportedEncodingException e) {
- reader = new BufferedReader(new InputStreamReader(is));
- }
-
- String line = reader.readLine();
-
- while (line != null) {
- if (line.length() == 0 || line.charAt(0) == '#') {
- line = reader.readLine();
-
- continue;
- }
-
- int index = line.indexOf(' ');
-
- if (index > 1) {
- String name = line.substring(0, index);
-
- ++index;
-
- if (index < line.length()) {
- String value = line.substring(index);
- index = value.indexOf(' ');
-
- if (index > 0) {
- value = value.substring(0, index);
- }
-
- int code = Integer.parseInt(value);
-
- defineEntity(name, (char) code);
- if (extraEntity(code))
- noExtraEntities = false;
- }
- }
-
- line = reader.readLine();
- }
-
- is.close();
- set(S_LINEFEED);
- set(S_CARRIAGERETURN);
- } catch (Exception e) {
- throw new RuntimeException(
- Utils.messages.createMessage(
- MsgKey.ER_RESOURCE_COULD_NOT_LOAD,
- new Object[] { entitiesResource,
- e.toString(),
- entitiesResource,
- e.toString()}));
- } finally {
- if (is != null) {
- try {
- is.close();
- } catch (Exception except) {}
- }
- }
- }
-
- /* initialize the array isCleanTextASCII[] with a cache of values
- * for use by ToStream.character(char[], int , int)
- * and the array isSpecialTextASCII[] with the opposite values
- * (all in the name of performance!)
- */
- for (int ch = 0; ch <ASCII_MAX; ch++)
- if((((0x20 <= ch || (0x0A == ch || 0x0D == ch || 0x09 == ch)))
- && (!get(ch))) || ('"' == ch))
- {
- isCleanTextASCII[ch] = true;
- isSpecialTextASCII[ch] = false;
- }
- else {
- isCleanTextASCII[ch] = false;
- isSpecialTextASCII[ch] = true;
- }
-
-
-
- onlyQuotAmpLtGt = noExtraEntities;
-
- // initialize the array with a cache of the BitSet values
- for (int i=0; i<ASCII_MAX; i++)
- isSpecialAttrASCII[i] = get(i);
-
- /* Now that we've used get(ch) just above to initialize the
- * two arrays we will change by adding a tab to the set of
- * special chars for XML (but not HTML!).
- * We do this because a tab is always a
- * special character in an XML attribute,
- * but only a special character in XML text
- * if it has an entity defined for it.
- * This is the reason for this delay.
- */
- if (Method.XML.equals(method))
- {
- isSpecialAttrASCII[S_HORIZONAL_TAB] = true;
- }
- }
-
- /**
- * Defines a new character reference. The reference's name and value are
- * supplied. Nothing happens if the character reference is already defined.
- * <p>Unlike internal entities, character references are a string to single
- * character mapping. They are used to map non-ASCII characters both on
- * parsing and printing, primarily for HTML documents. '&lt;amp;' is an
- * example of a character reference.</p>
- *
- * @param name The entity's name
- * @param value The entity's value
- */
- private void defineEntity(String name, char value)
- {
- StringBuilder sb = new StringBuilder("&");
- sb.append(name);
- sb.append(';');
- String entityString = sb.toString();
-
- defineChar2StringMapping(entityString, value);
- }
-
- /**
- * Map a character to a String. For example given
- * the character '>' this method would return the fully decorated
- * entity name "&lt;".
- * Strings for entity references are loaded from a properties file,
- * but additional mappings defined through calls to defineChar2String()
- * are possible. Such entity reference mappings could be over-ridden.
- *
- * This is reusing a stored key object, in an effort to avoid
- * heap activity. Unfortunately, that introduces a threading risk.
- * Simplest fix for now is to make it a synchronized method, or to give
- * up the reuse; I see very little performance difference between them.
- * Long-term solution would be to replace the hashtable with a sparse array
- * keyed directly from the character's integer value; see DTM's
- * string pool for a related solution.
- *
- * @param value The character that should be resolved to
- * a String, e.g. resolve '>' to "&lt;".
- *
- * @return The String that the character is mapped to, or null if not found.
- * @xsl.usage internal
- */
- String getOutputStringForChar(char value)
- {
- CharKey charKey = new CharKey();
- charKey.setChar(value);
- return (String) m_charToString.get(charKey);
- }
-
- /**
- * Tell if the character argument that is from
- * an attribute value should have special treatment.
- *
- * @param value the value of a character that is in an attribute value
- * @return true if the character should have any special treatment,
- * such as when writing out attribute values,
- * or entity references.
- * @xsl.usage internal
- */
- final boolean isSpecialAttrChar(int value)
- {
- // for performance try the values in the boolean array first,
- // this is faster access than the BitSet for common ASCII values
-
- if (value < ASCII_MAX)
- return isSpecialAttrASCII[value];
-
- // rather than java.util.BitSet, our private
- // implementation is faster (and less general).
- return get(value);
- }
-
- /**
- * Tell if the character argument that is from a
- * text node should have special treatment.
- *
- * @param value the value of a character that is in a text node
- * @return true if the character should have any special treatment,
- * such as when writing out attribute values,
- * or entity references.
- * @xsl.usage internal
- */
- final boolean isSpecialTextChar(int value)
- {
- // for performance try the values in the boolean array first,
- // this is faster access than the BitSet for common ASCII values
-
- if (value < ASCII_MAX)
- return isSpecialTextASCII[value];
-
- // rather than java.util.BitSet, our private
- // implementation is faster (and less general).
- return get(value);
- }
-
- /**
- * This method is used to determine if an ASCII character in
- * a text node (not an attribute value) is "clean".
- * @param value the character to check (0 to 127).
- * @return true if the character can go to the writer as-is
- * @xsl.usage internal
- */
- final boolean isTextASCIIClean(int value)
- {
- return isCleanTextASCII[value];
- }
-
-
- /**
- * Read an internal resource file that describes the mapping of
- * characters to entity references; Construct a CharInfo object.
- *
- * @param entitiesFileName Name of entities resource file that should
- * be loaded, which describes the mapping of characters to entity references.
- * @param method the output method type, which should be one of "xml", "html", and "text".
- * @return an instance of CharInfo
- *
- * @xsl.usage internal
- */
- static CharInfo getCharInfoInternal(String entitiesFileName, String method)
- {
- CharInfo charInfo = (CharInfo) m_getCharInfoCache.get(entitiesFileName);
- if (charInfo != null) {
- return charInfo;
- }
-
- charInfo = new CharInfo(entitiesFileName, method, true);
- m_getCharInfoCache.put(entitiesFileName, charInfo);
- return charInfo;
- }
-
- /**
- * Constructs a CharInfo object using the following process to try reading
- * the entitiesFileName parameter:
- *
- * 1) attempt to load it as a ResourceBundle
- * 2) try using the class loader to find the specified file
- * 3) try opening it as an URI
- *
- * In case of 2 and 3, the resource file must be encoded in UTF-8 and have the
- * following format:
- * <pre>
- * # First char # is a comment
- * Entity numericValue
- * quot 34
- * amp 38
- * </pre>
- *
- * @param entitiesFileName Name of entities resource file that should
- * be loaded, which describes the mapping of characters to entity references.
- * @param method the output method type, which should be one of "xml", "html", and "text".
- * @return an instance of CharInfo
- */
- static CharInfo getCharInfo(String entitiesFileName, String method)
- {
- try {
- return new CharInfo(entitiesFileName, method, false);
- } catch (Exception e) {}
-
- String absoluteEntitiesFileName;
-
- if (entitiesFileName.indexOf(':') < 0) {
- absoluteEntitiesFileName =
- SystemIDResolver.getAbsoluteURIFromRelative(entitiesFileName);
- } else {
- try {
- absoluteEntitiesFileName =
- SystemIDResolver.getAbsoluteURI(entitiesFileName, null);
- } catch (TransformerException te) {
- throw new WrappedRuntimeException(te);
- }
- }
-
- return new CharInfo(absoluteEntitiesFileName, method, false);
- }
-
- /** Table of user-specified char infos. */
- private static HashMap m_getCharInfoCache = new HashMap();
-
- /**
- * Returns the array element holding the bit value for the
- * given integer
- * @param i the integer that might be in the set of integers
- *
- */
- private static int arrayIndex(int i) {
- return (i >> SHIFT_PER_WORD);
- }
-
- /**
- * For a given integer in the set it returns the single bit
- * value used within a given word that represents whether
- * the integer is in the set or not.
- */
- private static int bit(int i) {
- int ret = (1 << (i & LOW_ORDER_BITMASK));
- return ret;
- }
-
- /**
- * Creates a new empty set of integers (characters)
- * @param max the maximum integer to be in the set.
- */
- private int[] createEmptySetOfIntegers(int max) {
- firstWordNotUsed = 0; // an optimization
-
- int[] arr = new int[arrayIndex(max - 1) + 1];
- return arr;
-
- }
-
- /**
- * Adds the integer (character) to the set of integers.
- * @param i the integer to add to the set, valid values are
- * 0, 1, 2 ... up to the maximum that was specified at
- * the creation of the set.
- */
- private final void set(int i) {
- setASCIIdirty(i);
-
- int j = (i >> SHIFT_PER_WORD); // this word is used
- int k = j + 1;
-
- if(firstWordNotUsed < k) // for optimization purposes.
- firstWordNotUsed = k;
-
- array_of_bits[j] |= (1 << (i & LOW_ORDER_BITMASK));
- }
-
-
- /**
- * Return true if the integer (character)is in the set of integers.
- *
- * This implementation uses an array of integers with 32 bits per
- * integer. If a bit is set to 1 the corresponding integer is
- * in the set of integers.
- *
- * @param i an integer that is tested to see if it is the
- * set of integers, or not.
- */
- private final boolean get(int i) {
-
- boolean in_the_set = false;
- int j = (i >> SHIFT_PER_WORD); // wordIndex(i)
- // an optimization here, ... a quick test to see
- // if this integer is beyond any of the words in use
- if(j < firstWordNotUsed)
- in_the_set = (array_of_bits[j] &
- (1 << (i & LOW_ORDER_BITMASK))
- ) != 0; // 0L for 64 bit words
- return in_the_set;
- }
-
- // record if there are any entities other than
- // quot, amp, lt, gt (probably user defined)
- /**
- * @return true if the entity
- * @param code The value of the character that has an entity defined
- * for it.
- */
- private boolean extraEntity(int entityValue)
- {
- boolean extra = false;
- if (entityValue < 128)
- {
- switch (entityValue)
- {
- case 34 : // quot
- case 38 : // amp
- case 60 : // lt
- case 62 : // gt
- break;
- default : // other entity in range 0 to 127
- extra = true;
- }
- }
- return extra;
- }
-
- /**
- * If the character is a printable ASCII character then
- * mark it as not clean and needing replacement with
- * a String on output.
- * @param ch
- */
- private void setASCIIdirty(int j)
- {
- if (0 <= j && j < ASCII_MAX)
- {
- isCleanTextASCII[j] = false;
- isSpecialTextASCII[j] = true;
- }
- }
-
- /**
- * If the character is a printable ASCII character then
- * mark it as and not needing replacement with
- * a String on output.
- * @param ch
- */
- private void setASCIIclean(int j)
- {
- if (0 <= j && j < ASCII_MAX)
- {
- isCleanTextASCII[j] = true;
- isSpecialTextASCII[j] = false;
- }
- }
-
- private void defineChar2StringMapping(String outputString, char inputChar)
- {
- CharKey character = new CharKey(inputChar);
- m_charToString.put(character, outputString);
- set(inputChar);
- }
-
- /**
- * Simple class for fast lookup of char values, when used with
- * hashtables. You can set the char, then use it as a key.
- *
- * This class is a copy of the one in com.sun.org.apache.xml.internal.utils.
- * It exists to cut the serializers dependancy on that package.
- *
- * @xsl.usage internal
- */
- private static class CharKey extends Object
- {
-
- /** String value */
- private char m_char;
-
- /**
- * Constructor CharKey
- *
- * @param key char value of this object.
- */
- public CharKey(char key)
- {
- m_char = key;
- }
-
- /**
- * Default constructor for a CharKey.
- *
- * @param key char value of this object.
- */
- public CharKey()
- {
- }
-
- /**
- * Get the hash value of the character.
- *
- * @return hash value of the character.
- */
- public final void setChar(char c)
- {
- m_char = c;
- }
-
-
-
- /**
- * Get the hash value of the character.
- *
- * @return hash value of the character.
- */
- public final int hashCode()
- {
- return (int)m_char;
- }
-
- /**
- * Override of equals() for this object
- *
- * @param obj to compare to
- *
- * @return True if this object equals this string value
- */
- public final boolean equals(Object obj)
- {
- return ((CharKey)obj).m_char == m_char;
- }
- }
-
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/DOMSerializer.java b/src/com/sun/org/apache/xml/internal/serializer/DOMSerializer.java
deleted file mode 100644
index e87c2c2..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/DOMSerializer.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DOMSerializer.java,v 1.2.4.1 2005/09/15 08:15:15 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.serializer;
-
-import java.io.IOException;
-
-import org.w3c.dom.Node;
-
-/**
- * Interface for a DOM serializer implementation.
- * <p>
- * The DOMSerializer is a facet of a serializer and is obtained from the
- * asDOMSerializer() method of the Serializer interface.
- * A serializer may or may not support a DOM serializer, if it does not then the
- * return value from asDOMSerializer() is null.
- * <p>
- * Example:
- * <pre>
- * Document doc;
- * Serializer ser;
- * OutputStream os;
- *
- * ser = ...;
- * os = ...;
- *
- * ser.setOutputStream( os );
- * DOMSerialzier dser = ser.asDOMSerializer();
- * dser.serialize(doc);
- * </pre>
- *
- * @see Serializer
- *
- * @xsl.usage general
- *
- */
-public interface DOMSerializer
-{
- /**
- * Serializes the DOM node. Throws an exception only if an I/O
- * exception occured while serializing.
- *
- * This interface is a public API.
- *
- * @param node the DOM node to serialize
- * @throws IOException if an I/O exception occured while serializing
- */
- public void serialize(Node node) throws IOException;
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/ElemContext.java b/src/com/sun/org/apache/xml/internal/serializer/ElemContext.java
deleted file mode 100644
index 805d7c7..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/ElemContext.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ElemContext.java,v 1.2.4.1 2005/09/15 08:15:15 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.serializer;
-
-/**
- * This class is a stack frame that consists of
- * information about the element currently being processed
- * by a serializer. Consider this example:
- * <pre>
- * <A>
- * <B1>
- * </B1>
- * <B2>
- * </B2>
- * <A>
- * </pre>
- *
- * A stack frame will be pushed for "A" at depth 1,
- * then another one for "B1" at depth 2.
- * Then "B1" stackframe is popped. When the stack frame for "B2" is
- * pushed, this implementation re-uses the old stack fram object used
- * by "B1" to be efficient at not creating too many of these object.
- *
- * This is by no means a public class, and neither are its fields or methods,
- * they are all helper fields for a serializer.
- *
- * The purpose of this class is to be more consistent with pushing information
- * when a new element is being serialized and more quickly restoring the old
- * information about the parent element with a simple pop() when the
- * child element is done. Previously there was some redundant and error-prone
- * calculations going on to retore information.
- *
- * @xsl.usage internal
- */
-final class ElemContext
-{
- // Fields that form the context of the element
-
- /**
- * The nesting depth of the element inside other elements.
- */
- final int m_currentElemDepth;
-
- /** HTML field, the element description of the HTML element */
- ElemDesc m_elementDesc = null;
-
- /**
- * The local name of the element.
- */
- String m_elementLocalName = null;
-
- /**
- * The fully qualified name of the element (with prefix, if any).
- */
- String m_elementName = null;
-
- /**
- * The URI of the element.
- */
- String m_elementURI = null;
-
- /** If the element is in the cdata-section-names list
- * then the value is true. If it is true the text children of the element
- * should be output in CDATA section blocks.
- */
- boolean m_isCdataSection;
-
- /** True if the current element has output escaping disabled.
- * This is true for SCRIPT and STYLE elements.
- */
- boolean m_isRaw = false;
-
- /** The next element "stack frame". This value will only be
- * set once as deeper stack frames are not deleted when popped off,
- * but are rather re-used when a push is required.
- *
- * This makes for very fast pushing and popping of stack frames
- * because very few stack frame objects are ever created, they are
- * mostly re-used. This re-use saves object creation but it also means
- * that connections between the frames via m_next and m_prev
- * never changes either. Just the contents of the frames change
- * as they are re-used. Only the reference to the current stack frame, which
- * is held by the serializer is changed via a quick pop() or push().
- */
- private ElemContext m_next;
-
- /** The previous element "stack frame". */
- final ElemContext m_prev;
-
- /**
- * Set to true when a start tag is started, or open, but not all the
- * attributes or namespace information is yet collected.
- */
- boolean m_startTagOpen = false;
-
- /**
- * Constructor to create the root of the element contexts.
- *
- */
- ElemContext()
- {
- // this assignment means can never pop this context off
- m_prev = this;
- // depth 0 because it doesn't correspond to any element
- m_currentElemDepth = 0;
- }
-
- /**
- * Constructor to create the "stack frame" for a given element depth.
- *
- * This implementation will re-use the context at each depth. If
- * a documents deepest element depth is N then there will be (N+1)
- * such objects created, no more than that.
- *
- * @param previous The "stack frame" corresponding to the new
- * elements parent element.
- */
- private ElemContext(final ElemContext previous)
- {
- m_prev = previous;
- m_currentElemDepth = previous.m_currentElemDepth + 1;
- }
-
- /**
- * Pop the current "stack frame".
- * @return Returns the parent "stack frame" of the one popped.
- */
- final ElemContext pop()
- {
- /* a very simple pop. No clean up is done of the deeper
- * stack frame. All deeper stack frames are still attached
- * but dormant, just waiting to be re-used.
- */
- return this.m_prev;
- }
-
- /**
- * This method pushes an element "stack frame"
- * but with no initialization of values in that frame.
- * This method is used for optimization purposes, like when pushing
- * a stack frame for an HTML "IMG" tag which has no children and
- * the stack frame will almost immediately be popped.
- */
- final ElemContext push()
- {
- ElemContext frame = this.m_next;
- if (frame == null)
- {
- /* We have never been at this depth yet, and there is no
- * stack frame to re-use, so we now make a new one.
- */
- frame = new ElemContext(this);
- this.m_next = frame;
- }
- /*
- * We shouldn't need to set this true because we should just
- * be pushing a dummy stack frame that will be instantly popped.
- * Yet we need to be ready in case this element does have
- * unexpected children.
- */
- frame.m_startTagOpen = true;
- return frame;
- }
-
- /**
- * Push an element context on the stack. This context keeps track of
- * information gathered about the element.
- * @param uri The URI for the namespace for the element name,
- * can be null if it is not yet known.
- * @param localName The local name of the element (no prefix),
- * can be null.
- * @param qName The qualified name (with prefix, if any)
- * of the element, this parameter is required.
- */
- final ElemContext push(
- final String uri,
- final String localName,
- final String qName)
- {
- ElemContext frame = this.m_next;
- if (frame == null)
- {
- /* We have never been at this depth yet, and there is no
- * stack frame to re-use, so we now make a new one.
- */
- frame = new ElemContext(this);
- this.m_next = frame;
- }
-
- // Initialize, or reset values in the new or re-used stack frame.
- frame.m_elementName = qName;
- frame.m_elementLocalName = localName;
- frame.m_elementURI = uri;
- frame.m_isCdataSection = false;
- frame.m_startTagOpen = true;
-
- // is_Raw is already set in the HTML startElement() method
- // frame.m_isRaw = false;
- return frame;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/ElemDesc.java b/src/com/sun/org/apache/xml/internal/serializer/ElemDesc.java
deleted file mode 100644
index 5670952..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/ElemDesc.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ElemDesc.java,v 1.2.4.1 2005/09/15 08:15:15 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.serializer;
-
-import com.sun.org.apache.xml.internal.serializer.utils.StringToIntTable;
-
-/**
- * This class has a series of flags (bit values) that describe an HTML element
- *
- * This class is public because XSLTC uses it, it is not a public API.
- *
- * @xsl.usage internal
- */
-public final class ElemDesc
-{
- /** Bit flags to tell about this element type. */
- private int m_flags;
-
- /**
- * Table of attribute names to integers, which contain bit flags telling about
- * the attributes.
- */
- private StringToIntTable m_attrs = null;
-
- /** Bit position if this element type is empty. */
- static final int EMPTY = (1 << 1);
-
- /** Bit position if this element type is a flow. */
- private static final int FLOW = (1 << 2);
-
- /** Bit position if this element type is a block. */
- static final int BLOCK = (1 << 3);
-
- /** Bit position if this element type is a block form. */
- static final int BLOCKFORM = (1 << 4);
-
- /** Bit position if this element type is a block form field set. */
- static final int BLOCKFORMFIELDSET = (1 << 5);
-
- /** Bit position if this element type is CDATA. */
- private static final int CDATA = (1 << 6);
-
- /** Bit position if this element type is PCDATA. */
- private static final int PCDATA = (1 << 7);
-
- /** Bit position if this element type is should be raw characters. */
- static final int RAW = (1 << 8);
-
- /** Bit position if this element type should be inlined. */
- private static final int INLINE = (1 << 9);
-
- /** Bit position if this element type is INLINEA. */
- private static final int INLINEA = (1 << 10);
-
- /** Bit position if this element type is an inline label. */
- static final int INLINELABEL = (1 << 11);
-
- /** Bit position if this element type is a font style. */
- static final int FONTSTYLE = (1 << 12);
-
- /** Bit position if this element type is a phrase. */
- static final int PHRASE = (1 << 13);
-
- /** Bit position if this element type is a form control. */
- static final int FORMCTRL = (1 << 14);
-
- /** Bit position if this element type is ???. */
- static final int SPECIAL = (1 << 15);
-
- /** Bit position if this element type is ???. */
- static final int ASPECIAL = (1 << 16);
-
- /** Bit position if this element type is an odd header element. */
- static final int HEADMISC = (1 << 17);
-
- /** Bit position if this element type is a head element (i.e. H1, H2, etc.) */
- static final int HEAD = (1 << 18);
-
- /** Bit position if this element type is a list. */
- static final int LIST = (1 << 19);
-
- /** Bit position if this element type is a preformatted type. */
- static final int PREFORMATTED = (1 << 20);
-
- /** Bit position if this element type is whitespace sensitive. */
- static final int WHITESPACESENSITIVE = (1 << 21);
-
- /** Bit position if this element type is a header element (i.e. HEAD). */
- static final int HEADELEM = (1 << 22);
-
- /** Bit position if this element is the "HTML" element */
- private static final int HTMLELEM = (1 << 23);
-
- /** Bit position if this attribute type is a URL. */
- public static final int ATTRURL = (1 << 1);
-
- /** Bit position if this attribute type is an empty type. */
- public static final int ATTREMPTY = (1 << 2);
-
- /**
- * Construct an ElemDesc from a set of bit flags.
- *
- *
- * @param flags Bit flags that describe the basic properties of this element type.
- */
- ElemDesc(int flags)
- {
- m_flags = flags;
- }
-
- /**
- * Tell if this element type has the basic bit properties that are passed
- * as an argument.
- *
- * @param flags Bit flags that describe the basic properties of interest.
- *
- * @return true if any of the flag bits are true.
- */
- private boolean is(int flags)
- {
-
- // int which = (m_flags & flags);
- return (m_flags & flags) != 0;
- }
-
- int getFlags() {
- return m_flags;
- }
-
- /**
- * Set an attribute name and it's bit properties.
- *
- *
- * @param name non-null name of attribute, in upper case.
- * @param flags flag bits.
- */
- void setAttr(String name, int flags)
- {
-
- if (null == m_attrs)
- m_attrs = new StringToIntTable();
-
- m_attrs.put(name, flags);
- }
-
- /**
- * Tell if any of the bits of interest are set for a named attribute type.
- *
- * @param name non-null reference to attribute name, in any case.
- * @param flags flag mask.
- *
- * @return true if any of the flags are set for the named attribute.
- */
- public boolean isAttrFlagSet(String name, int flags)
- {
- return (null != m_attrs)
- ? ((m_attrs.getIgnoreCase(name) & flags) != 0)
- : false;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/EmptySerializer.java b/src/com/sun/org/apache/xml/internal/serializer/EmptySerializer.java
deleted file mode 100644
index 5492de5..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/EmptySerializer.java
+++ /dev/null
@@ -1,752 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: EmptySerializer.java,v 1.2.4.1 2005/09/15 08:15:16 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.serializer;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.Writer;
-import java.util.Properties;
-import java.util.Vector;
-import javax.xml.transform.SourceLocator;
-import javax.xml.transform.Transformer;
-import org.w3c.dom.Node;
-import org.xml.sax.Attributes;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-
-/**
- * This class is an adapter class. Its only purpose is to be extended and
- * for that extended class to over-ride all methods that are to be used.
- *
- * This class is not a public API, it is only public because it is used
- * across package boundaries.
- *
- * @xsl.usage internal
- */
-public class EmptySerializer implements SerializationHandler
-{
- protected static final String ERR = "EmptySerializer method not over-ridden";
- /**
- * @see SerializationHandler#asContentHandler()
- */
-
- protected void couldThrowIOException() throws IOException
- {
- return; // don't do anything.
- }
-
- protected void couldThrowSAXException() throws SAXException
- {
- return; // don't do anything.
- }
-
- protected void couldThrowSAXException(char[] chars, int off, int len) throws SAXException
- {
- return; // don't do anything.
- }
-
- protected void couldThrowSAXException(String elemQName) throws SAXException
- {
- return; // don't do anything.
- }
-
- void aMethodIsCalled()
- {
-
- // throw new RuntimeException(err);
- return;
- }
-
-
- /**
- * @see SerializationHandler#asContentHandler()
- */
- public ContentHandler asContentHandler() throws IOException
- {
- couldThrowIOException();
- return null;
- }
- /**
- * @see SerializationHandler#setContentHandler(org.xml.sax.ContentHandler)
- */
- public void setContentHandler(ContentHandler ch)
- {
- aMethodIsCalled();
- }
- /**
- * @see SerializationHandler#close()
- */
- public void close()
- {
- aMethodIsCalled();
- }
- /**
- * @see SerializationHandler#getOutputFormat()
- */
- public Properties getOutputFormat()
- {
- aMethodIsCalled();
- return null;
- }
- /**
- * @see SerializationHandler#getOutputStream()
- */
- public OutputStream getOutputStream()
- {
- aMethodIsCalled();
- return null;
- }
- /**
- * @see SerializationHandler#getWriter()
- */
- public Writer getWriter()
- {
- aMethodIsCalled();
- return null;
- }
- /**
- * @see SerializationHandler#reset()
- */
- public boolean reset()
- {
- aMethodIsCalled();
- return false;
- }
- /**
- * @see SerializationHandler#serialize(org.w3c.dom.Node)
- */
- public void serialize(Node node) throws IOException
- {
- couldThrowIOException();
- }
- /**
- * @see SerializationHandler#setCdataSectionElements(java.util.Vector)
- */
- public void setCdataSectionElements(Vector URI_and_localNames)
- {
- aMethodIsCalled();
- }
- /**
- * @see SerializationHandler#setEscaping(boolean)
- */
- public boolean setEscaping(boolean escape) throws SAXException
- {
- couldThrowSAXException();
- return false;
- }
- /**
- * @see SerializationHandler#setIndent(boolean)
- */
- public void setIndent(boolean indent)
- {
- aMethodIsCalled();
- }
- /**
- * @see SerializationHandler#setIndentAmount(int)
- */
- public void setIndentAmount(int spaces)
- {
- aMethodIsCalled();
- }
- /**
- * @see SerializationHandler#setIsStandalone(boolean)
- */
- public void setIsStandalone(boolean isStandalone)
- {
- aMethodIsCalled();
- }
- /**
- * @see SerializationHandler#setOutputFormat(java.util.Properties)
- */
- public void setOutputFormat(Properties format)
- {
- aMethodIsCalled();
- }
- /**
- * @see SerializationHandler#setOutputStream(java.io.OutputStream)
- */
- public void setOutputStream(OutputStream output)
- {
- aMethodIsCalled();
- }
- /**
- * @see SerializationHandler#setVersion(java.lang.String)
- */
- public void setVersion(String version)
- {
- aMethodIsCalled();
- }
- /**
- * @see SerializationHandler#setWriter(java.io.Writer)
- */
- public void setWriter(Writer writer)
- {
- aMethodIsCalled();
- }
- /**
- * @see SerializationHandler#setTransformer(javax.xml.transform.Transformer)
- */
- public void setTransformer(Transformer transformer)
- {
- aMethodIsCalled();
- }
- /**
- * @see SerializationHandler#getTransformer()
- */
- public Transformer getTransformer()
- {
- aMethodIsCalled();
- return null;
- }
- /**
- * @see SerializationHandler#flushPending()
- */
- public void flushPending() throws SAXException
- {
- couldThrowSAXException();
- }
- /**
- * @see ExtendedContentHandler#addAttribute(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)
- */
- public void addAttribute(
- String uri,
- String localName,
- String rawName,
- String type,
- String value,
- boolean XSLAttribute)
- throws SAXException
- {
- couldThrowSAXException();
- }
- /**
- * @see ExtendedContentHandler#addAttributes(org.xml.sax.Attributes)
- */
- public void addAttributes(Attributes atts) throws SAXException
- {
- couldThrowSAXException();
- }
- /**
- * @see ExtendedContentHandler#addAttribute(java.lang.String, java.lang.String)
- */
- public void addAttribute(String name, String value)
- {
- aMethodIsCalled();
- }
-
- /**
- * @see ExtendedContentHandler#characters(java.lang.String)
- */
- public void characters(String chars) throws SAXException
- {
- couldThrowSAXException();
- }
- /**
- * @see ExtendedContentHandler#endElement(java.lang.String)
- */
- public void endElement(String elemName) throws SAXException
- {
- couldThrowSAXException();
- }
- /**
- * @see ExtendedContentHandler#startDocument()
- */
- public void startDocument() throws SAXException
- {
- couldThrowSAXException();
- }
- /**
- * @see ExtendedContentHandler#startElement(java.lang.String, java.lang.String, java.lang.String)
- */
- public void startElement(String uri, String localName, String qName)
- throws SAXException
- {
- couldThrowSAXException(qName);
- }
- /**
- * @see ExtendedContentHandler#startElement(java.lang.String)
- */
- public void startElement(String qName) throws SAXException
- {
- couldThrowSAXException(qName);
- }
- /**
- * @see ExtendedContentHandler#namespaceAfterStartElement(java.lang.String, java.lang.String)
- */
- public void namespaceAfterStartElement(String uri, String prefix)
- throws SAXException
- {
- couldThrowSAXException();
- }
- /**
- * @see ExtendedContentHandler#startPrefixMapping(java.lang.String, java.lang.String, boolean)
- */
- public boolean startPrefixMapping(
- String prefix,
- String uri,
- boolean shouldFlush)
- throws SAXException
- {
- couldThrowSAXException();
- return false;
- }
- /**
- * @see ExtendedContentHandler#entityReference(java.lang.String)
- */
- public void entityReference(String entityName) throws SAXException
- {
- couldThrowSAXException();
- }
- /**
- * @see ExtendedContentHandler#getNamespaceMappings()
- */
- public NamespaceMappings getNamespaceMappings()
- {
- aMethodIsCalled();
- return null;
- }
- /**
- * @see ExtendedContentHandler#getPrefix(java.lang.String)
- */
- public String getPrefix(String uri)
- {
- aMethodIsCalled();
- return null;
- }
- /**
- * @see ExtendedContentHandler#getNamespaceURI(java.lang.String, boolean)
- */
- public String getNamespaceURI(String name, boolean isElement)
- {
- aMethodIsCalled();
- return null;
- }
- /**
- * @see ExtendedContentHandler#getNamespaceURIFromPrefix(java.lang.String)
- */
- public String getNamespaceURIFromPrefix(String prefix)
- {
- aMethodIsCalled();
- return null;
- }
- /**
- * @see org.xml.sax.ContentHandler#setDocumentLocator(org.xml.sax.Locator)
- */
- public void setDocumentLocator(Locator arg0)
- {
- aMethodIsCalled();
- }
- /**
- * @see org.xml.sax.ContentHandler#endDocument()
- */
- public void endDocument() throws SAXException
- {
- couldThrowSAXException();
- }
- /**
- * @see org.xml.sax.ContentHandler#startPrefixMapping(java.lang.String, java.lang.String)
- */
- public void startPrefixMapping(String arg0, String arg1)
- throws SAXException
- {
- couldThrowSAXException();
- }
- /**
- * @see org.xml.sax.ContentHandler#endPrefixMapping(java.lang.String)
- */
- public void endPrefixMapping(String arg0) throws SAXException
- {
- couldThrowSAXException();
- }
- /**
- * @see org.xml.sax.ContentHandler#startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
- */
- public void startElement(
- String arg0,
- String arg1,
- String arg2,
- Attributes arg3)
- throws SAXException
- {
- couldThrowSAXException();
- }
- /**
- * @see org.xml.sax.ContentHandler#endElement(java.lang.String, java.lang.String, java.lang.String)
- */
- public void endElement(String arg0, String arg1, String arg2)
- throws SAXException
- {
- couldThrowSAXException();
- }
- /**
- * @see org.xml.sax.ContentHandler#characters(char[], int, int)
- */
- public void characters(char[] arg0, int arg1, int arg2) throws SAXException
- {
- couldThrowSAXException(arg0, arg1, arg2);
- }
- /**
- * @see org.xml.sax.ContentHandler#ignorableWhitespace(char[], int, int)
- */
- public void ignorableWhitespace(char[] arg0, int arg1, int arg2)
- throws SAXException
- {
- couldThrowSAXException();
- }
- /**
- * @see org.xml.sax.ContentHandler#processingInstruction(java.lang.String, java.lang.String)
- */
- public void processingInstruction(String arg0, String arg1)
- throws SAXException
- {
- couldThrowSAXException();
- }
- /**
- * @see org.xml.sax.ContentHandler#skippedEntity(java.lang.String)
- */
- public void skippedEntity(String arg0) throws SAXException
- {
- couldThrowSAXException();
- }
- /**
- * @see ExtendedLexicalHandler#comment(java.lang.String)
- */
- public void comment(String comment) throws SAXException
- {
- couldThrowSAXException();
- }
- /**
- * @see org.xml.sax.ext.LexicalHandler#startDTD(java.lang.String, java.lang.String, java.lang.String)
- */
- public void startDTD(String arg0, String arg1, String arg2)
- throws SAXException
- {
- couldThrowSAXException();
- }
- /**
- * @see org.xml.sax.ext.LexicalHandler#endDTD()
- */
- public void endDTD() throws SAXException
- {
- couldThrowSAXException();
- }
- /**
- * @see org.xml.sax.ext.LexicalHandler#startEntity(java.lang.String)
- */
- public void startEntity(String arg0) throws SAXException
- {
- couldThrowSAXException();
- }
- /**
- * @see org.xml.sax.ext.LexicalHandler#endEntity(java.lang.String)
- */
- public void endEntity(String arg0) throws SAXException
- {
- couldThrowSAXException();
- }
- /**
- * @see org.xml.sax.ext.LexicalHandler#startCDATA()
- */
- public void startCDATA() throws SAXException
- {
- couldThrowSAXException();
- }
- /**
- * @see org.xml.sax.ext.LexicalHandler#endCDATA()
- */
- public void endCDATA() throws SAXException
- {
- couldThrowSAXException();
- }
- /**
- * @see org.xml.sax.ext.LexicalHandler#comment(char[], int, int)
- */
- public void comment(char[] arg0, int arg1, int arg2) throws SAXException
- {
- couldThrowSAXException();
- }
- /**
- * @see XSLOutputAttributes#getDoctypePublic()
- */
- public String getDoctypePublic()
- {
- aMethodIsCalled();
- return null;
- }
- /**
- * @see XSLOutputAttributes#getDoctypeSystem()
- */
- public String getDoctypeSystem()
- {
- aMethodIsCalled();
- return null;
- }
- /**
- * @see XSLOutputAttributes#getEncoding()
- */
- public String getEncoding()
- {
- aMethodIsCalled();
- return null;
- }
- /**
- * @see XSLOutputAttributes#getIndent()
- */
- public boolean getIndent()
- {
- aMethodIsCalled();
- return false;
- }
- /**
- * @see XSLOutputAttributes#getIndentAmount()
- */
- public int getIndentAmount()
- {
- aMethodIsCalled();
- return 0;
- }
- /**
- * @see XSLOutputAttributes#getMediaType()
- */
- public String getMediaType()
- {
- aMethodIsCalled();
- return null;
- }
- /**
- * @see XSLOutputAttributes#getOmitXMLDeclaration()
- */
- public boolean getOmitXMLDeclaration()
- {
- aMethodIsCalled();
- return false;
- }
- /**
- * @see XSLOutputAttributes#getStandalone()
- */
- public String getStandalone()
- {
- aMethodIsCalled();
- return null;
- }
- /**
- * @see XSLOutputAttributes#getVersion()
- */
- public String getVersion()
- {
- aMethodIsCalled();
- return null;
- }
- /**
- * @see XSLOutputAttributes#setDoctype(java.lang.String, java.lang.String)
- */
- public void setDoctype(String system, String pub)
- {
- aMethodIsCalled();
- }
- /**
- * @see XSLOutputAttributes#setDoctypePublic(java.lang.String)
- */
- public void setDoctypePublic(String doctype)
- {
- aMethodIsCalled();
- }
- /**
- * @see XSLOutputAttributes#setDoctypeSystem(java.lang.String)
- */
- public void setDoctypeSystem(String doctype)
- {
- aMethodIsCalled();
- }
- /**
- * @see XSLOutputAttributes#setEncoding(java.lang.String)
- */
- public void setEncoding(String encoding)
- {
- aMethodIsCalled();
- }
- /**
- * @see XSLOutputAttributes#setMediaType(java.lang.String)
- */
- public void setMediaType(String mediatype)
- {
- aMethodIsCalled();
- }
- /**
- * @see XSLOutputAttributes#setOmitXMLDeclaration(boolean)
- */
- public void setOmitXMLDeclaration(boolean b)
- {
- aMethodIsCalled();
- }
- /**
- * @see XSLOutputAttributes#setStandalone(java.lang.String)
- */
- public void setStandalone(String standalone)
- {
- aMethodIsCalled();
- }
- /**
- * @see org.xml.sax.ext.DeclHandler#elementDecl(java.lang.String, java.lang.String)
- */
- public void elementDecl(String arg0, String arg1) throws SAXException
- {
- couldThrowSAXException();
- }
- /**
- * @see org.xml.sax.ext.DeclHandler#attributeDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)
- */
- public void attributeDecl(
- String arg0,
- String arg1,
- String arg2,
- String arg3,
- String arg4)
- throws SAXException
- {
- couldThrowSAXException();
- }
- /**
- * @see org.xml.sax.ext.DeclHandler#internalEntityDecl(java.lang.String, java.lang.String)
- */
- public void internalEntityDecl(String arg0, String arg1)
- throws SAXException
- {
- couldThrowSAXException();
- }
- /**
- * @see org.xml.sax.ext.DeclHandler#externalEntityDecl(java.lang.String, java.lang.String, java.lang.String)
- */
- public void externalEntityDecl(String arg0, String arg1, String arg2)
- throws SAXException
- {
- couldThrowSAXException();
- }
- /**
- * @see org.xml.sax.ErrorHandler#warning(org.xml.sax.SAXParseException)
- */
- public void warning(SAXParseException arg0) throws SAXException
- {
- couldThrowSAXException();
- }
- /**
- * @see org.xml.sax.ErrorHandler#error(org.xml.sax.SAXParseException)
- */
- public void error(SAXParseException arg0) throws SAXException
- {
- couldThrowSAXException();
- }
- /**
- * @see org.xml.sax.ErrorHandler#fatalError(org.xml.sax.SAXParseException)
- */
- public void fatalError(SAXParseException arg0) throws SAXException
- {
- couldThrowSAXException();
- }
- /**
- * @see Serializer#asDOMSerializer()
- */
- public DOMSerializer asDOMSerializer() throws IOException
- {
- couldThrowIOException();
- return null;
- }
-
- /**
- * @see SerializationHandler#setNamespaceMappings(NamespaceMappings)
- */
- public void setNamespaceMappings(NamespaceMappings mappings) {
- aMethodIsCalled();
- }
-
- /**
- * @see ExtendedContentHandler#setSourceLocator(javax.xml.transform.SourceLocator)
- */
- public void setSourceLocator(SourceLocator locator)
- {
- aMethodIsCalled();
- }
-
- /**
- * @see ExtendedContentHandler#addUniqueAttribute(java.lang.String, java.lang.String, int)
- */
- public void addUniqueAttribute(String name, String value, int flags)
- throws SAXException
- {
- couldThrowSAXException();
- }
-
- /**
- * @see ExtendedContentHandler#characters(org.w3c.dom.Node)
- */
- public void characters(Node node) throws SAXException
- {
- couldThrowSAXException();
- }
-
- /**
- * @see ExtendedContentHandler#addXSLAttribute(java.lang.String, java.lang.String, java.lang.String)
- */
- public void addXSLAttribute(String qName, String value, String uri)
- {
- aMethodIsCalled();
- }
-
- /**
- * @see ExtendedContentHandler#addAttribute(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)
- */
- public void addAttribute(String uri, String localName, String rawName, String type, String value) throws SAXException
- {
- couldThrowSAXException();
- }
- /**
- * @see org.xml.sax.DTDHandler#notationDecl(java.lang.String, java.lang.String, java.lang.String)
- */
- public void notationDecl(String arg0, String arg1, String arg2) throws SAXException
- {
- couldThrowSAXException();
- }
-
- /**
- * @see org.xml.sax.DTDHandler#unparsedEntityDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
- */
- public void unparsedEntityDecl(
- String arg0,
- String arg1,
- String arg2,
- String arg3)
- throws SAXException {
- couldThrowSAXException();
- }
-
- /**
- * @see SerializationHandler#setDTDEntityExpansion(boolean)
- */
- public void setDTDEntityExpansion(boolean expand) {
- aMethodIsCalled();
-
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/EncodingInfo.java b/src/com/sun/org/apache/xml/internal/serializer/EncodingInfo.java
deleted file mode 100644
index 60d503d..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/EncodingInfo.java
+++ /dev/null
@@ -1,514 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: EncodingInfo.java,v 1.2.4.2 2005/09/15 12:01:24 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.serializer;
-
-import java.io.UnsupportedEncodingException;
-
-/**
- * Holds information about a given encoding, which is the Java name for the
- * encoding, the equivalent ISO name.
- * <p>
- * An object of this type has two useful methods
- * <pre>
- * isInEncoding(char ch);
- * </pre>
- * which can be called if the character is not the high one in
- * a surrogate pair and:
- * <pre>
- * isInEncoding(char high, char low);
- * </pre>
- * which can be called if the two characters from a high/low surrogate pair.
- * <p>
- * An EncodingInfo object is a node in a binary search tree. Such a node
- * will answer if a character is in the encoding, and do so for a given
- * range of unicode values (<code>m_first</code> to
- * <code>m_last</code>). It will handle a certain range of values
- * explicitly (<code>m_explFirst</code> to <code>m_explLast</code>).
- * If the unicode point is before that explicit range, that is it
- * is in the range <code>m_first <= value < m_explFirst</code>, then it will delegate to another EncodingInfo object for The root
- * of such a tree, m_before. Likewise for values in the range
- * <code>m_explLast < value <= m_last</code>, but delgating to <code>m_after</code>
- * <p>
- * Actually figuring out if a code point is in the encoding is expensive. So the
- * purpose of this tree is to cache such determinations, and not to build the
- * entire tree of information at the start, but only build up as much of the
- * tree as is used during the transformation.
- * <p>
- * This Class is not a public API, and should only be used internally within
- * the serializer.
- *
- * @xsl.usage internal
- */
-public final class EncodingInfo extends Object
-{
-
- /**
- * The ISO encoding name.
- */
- final String name;
-
- /**
- * The name used by the Java convertor.
- */
- final String javaName;
-
- /**
- * A helper object that we can ask if a
- * single char, or a surrogate UTF-16 pair
- * of chars that form a single character,
- * is in this encoding.
- */
- private InEncoding m_encoding;
-
- /**
- * This is not a public API. It returns true if the
- * char in question is in the encoding.
- * @param ch the char in question.
- * @xsl.usage internal
- */
- public boolean isInEncoding(char ch) {
- if (m_encoding == null) {
- m_encoding = new EncodingImpl();
-
- // One could put alternate logic in here to
- // instantiate another object that implements the
- // InEncoding interface. For example if the JRE is 1.4 or up
- // we could have an object that uses JRE 1.4 methods
- }
- return m_encoding.isInEncoding(ch);
- }
-
- /**
- * This is not a public API. It returns true if the
- * character formed by the high/low pair is in the encoding.
- * @param high a char that the a high char of a high/low surrogate pair.
- * @param low a char that is the low char of a high/low surrogate pair.
- * @xsl.usage internal
- */
- public boolean isInEncoding(char high, char low) {
- if (m_encoding == null) {
- m_encoding = new EncodingImpl();
-
- // One could put alternate logic in here to
- // instantiate another object that implements the
- // InEncoding interface. For example if the JRE is 1.4 or up
- // we could have an object that uses JRE 1.4 methods
- }
- return m_encoding.isInEncoding(high, low);
- }
-
- /**
- * Create an EncodingInfo object based on the ISO name and Java name.
- * If both parameters are null any character will be considered to
- * be in the encoding. This is useful for when the serializer is in
- * temporary output state, and has no assciated encoding.
- *
- * @param name reference to the ISO name.
- * @param javaName reference to the Java encoding name.
- */
- public EncodingInfo(String name, String javaName)
- {
-
- this.name = name;
- this.javaName = javaName;
- }
-
-
-
- /**
- * A simple interface to isolate the implementation.
- * We could also use some new JRE 1.4 methods in another implementation
- * provided we use reflection with them.
- * <p>
- * This interface is not a public API,
- * and should only be used internally within the serializer.
- * @xsl.usage internal
- */
- private interface InEncoding {
- /**
- * Returns true if the char is in the encoding
- */
- public boolean isInEncoding(char ch);
- /**
- * Returns true if the high/low surrogate pair forms
- * a character that is in the encoding.
- */
- public boolean isInEncoding(char high, char low);
- }
-
- /**
- * This class implements the
- */
- private class EncodingImpl implements InEncoding {
-
-
-
- public boolean isInEncoding(char ch1) {
- final boolean ret;
- int codePoint = Encodings.toCodePoint(ch1);
- if (codePoint < m_explFirst) {
- // The unicode value is before the range
- // that we explictly manage, so we delegate the answer.
-
- // If we don't have an m_before object to delegate to, make one.
- if (m_before == null)
- m_before =
- new EncodingImpl(
- m_encoding,
- m_first,
- m_explFirst - 1,
- codePoint);
- ret = m_before.isInEncoding(ch1);
- } else if (m_explLast < codePoint) {
- // The unicode value is after the range
- // that we explictly manage, so we delegate the answer.
-
- // If we don't have an m_after object to delegate to, make one.
- if (m_after == null)
- m_after =
- new EncodingImpl(
- m_encoding,
- m_explLast + 1,
- m_last,
- codePoint);
- ret = m_after.isInEncoding(ch1);
- } else {
- // The unicode value is in the range we explitly handle
- final int idx = codePoint - m_explFirst;
-
- // If we already know the answer, just return it.
- if (m_alreadyKnown[idx])
- ret = m_isInEncoding[idx];
- else {
- // We don't know the answer, so find out,
- // which may be expensive, then cache the answer
- ret = inEncoding(ch1, m_encoding);
- m_alreadyKnown[idx] = true;
- m_isInEncoding[idx] = ret;
- }
- }
- return ret;
- }
-
- public boolean isInEncoding(char high, char low) {
- final boolean ret;
- int codePoint = Encodings.toCodePoint(high,low);
- if (codePoint < m_explFirst) {
- // The unicode value is before the range
- // that we explictly manage, so we delegate the answer.
-
- // If we don't have an m_before object to delegate to, make one.
- if (m_before == null)
- m_before =
- new EncodingImpl(
- m_encoding,
- m_first,
- m_explFirst - 1,
- codePoint);
- ret = m_before.isInEncoding(high,low);
- } else if (m_explLast < codePoint) {
- // The unicode value is after the range
- // that we explictly manage, so we delegate the answer.
-
- // If we don't have an m_after object to delegate to, make one.
- if (m_after == null)
- m_after =
- new EncodingImpl(
- m_encoding,
- m_explLast + 1,
- m_last,
- codePoint);
- ret = m_after.isInEncoding(high,low);
- } else {
- // The unicode value is in the range we explitly handle
- final int idx = codePoint - m_explFirst;
-
- // If we already know the answer, just return it.
- if (m_alreadyKnown[idx])
- ret = m_isInEncoding[idx];
- else {
- // We don't know the answer, so find out,
- // which may be expensive, then cache the answer
- ret = inEncoding(high, low, m_encoding);
- m_alreadyKnown[idx] = true;
- m_isInEncoding[idx] = ret;
- }
- }
- return ret;
- }
-
- /**
- * The encoding.
- */
- final private String m_encoding;
- /**
- * m_first through m_last is the range of unicode
- * values that this object will return an answer on.
- * It may delegate to a similar object with a different
- * range
- */
- final private int m_first;
-
- /**
- * m_explFirst through m_explLast is the range of unicode
- * value that this object handles explicitly and does not
- * delegate to a similar object.
- */
- final private int m_explFirst;
- final private int m_explLast;
- final private int m_last;
-
- /**
- * The object, of the same type as this one,
- * that handles unicode values in a range before
- * the range explictly handled by this object, and
- * to which this object may delegate.
- */
- private InEncoding m_before;
- /**
- * The object, of the same type as this one,
- * that handles unicode values in a range after
- * the range explictly handled by this object, and
- * to which this object may delegate.
- */
- private InEncoding m_after;
-
- /**
- * The number of unicode values explicitly handled
- * by a single EncodingInfo object. This value is
- * tuneable, but is set to 128 because that covers the
- * entire low range of ASCII type chars within a single
- * object.
- */
- private static final int RANGE = 128;
-
- /**
- * A flag to record if we already know the answer
- * for the given unicode value.
- */
- final private boolean m_alreadyKnown[] = new boolean[RANGE];
- /**
- * A table holding the answer on whether the given unicode
- * value is in the encoding.
- */
- final private boolean m_isInEncoding[] = new boolean[RANGE];
-
- private EncodingImpl() {
- // This object will answer whether any unicode value
- // is in the encoding, it handles values 0 through Integer.MAX_VALUE
- this(javaName, 0, Integer.MAX_VALUE, (char) 0);
- }
-
- private EncodingImpl(String encoding, int first, int last, int codePoint) {
- // Set the range of unicode values that this object manages
- // either explicitly or implicitly.
- m_first = first;
- m_last = last;
-
- // Set the range of unicode values that this object
- // explicitly manages. Align the explicitly managed values
- // to RANGE so multiple EncodingImpl objects dont manage the same
- // values.
- m_explFirst = codePoint / RANGE * RANGE;
- m_explLast = m_explFirst + (RANGE-1);
-
- m_encoding = encoding;
-
- if (javaName != null)
- {
- // Some optimization.
- if (0 <= m_explFirst && m_explFirst <= 127) {
- // This particular EncodingImpl explicitly handles
- // characters in the low range.
- if ("UTF8".equals(javaName)
- || "UTF-16".equals(javaName)
- || "ASCII".equals(javaName)
- || "US-ASCII".equals(javaName)
- || "Unicode".equals(javaName)
- || "UNICODE".equals(javaName)
- || javaName.startsWith("ISO8859")) {
-
- // Not only does this EncodingImpl object explicitly
- // handle chracters in the low range, it is
- // also one that we know something about, without
- // needing to call inEncoding(char ch, String encoding)
- // for this low range
- //
- // By initializing the table ahead of time
- // for these low values, we prevent the expensive
- // inEncoding(char ch, String encoding)
- // from being called, at least for these common
- // encodings.
- for (int unicode = 1; unicode < 127; unicode++) {
- final int idx = unicode - m_explFirst;
- if (0 <= idx && idx < RANGE) {
- m_alreadyKnown[idx] = true;
- m_isInEncoding[idx] = true;
- }
- }
- }
- }
-
- /* A little bit more than optimization.
- *
- * We will say that any character is in the encoding if
- * we don't have an encoding.
- * This is meaningful when the serializer is being used
- * in temporary output state, where we are not writing to
- * the final output tree. It is when writing to the
- * final output tree that we need to worry about the output
- * encoding
- */
- if (javaName == null) {
- for (int idx = 0; idx < m_alreadyKnown.length; idx++) {
- m_alreadyKnown[idx] = true;
- m_isInEncoding[idx] = true;
- }
- }
- }
- }
- }
-
- /**
- * This is heart of the code that determines if a given character
- * is in the given encoding. This method is probably expensive,
- * and the answer should be cached.
- * <p>
- * This method is not a public API,
- * and should only be used internally within the serializer.
- * @param ch the char in question, that is not a high char of
- * a high/low surrogate pair.
- * @param encoding the Java name of the enocding.
- *
- * @xsl.usage internal
- *
- */
- private static boolean inEncoding(char ch, String encoding) {
- boolean isInEncoding;
- try {
- char cArray[] = new char[1];
- cArray[0] = ch;
- // Construct a String from the char
- String s = new String(cArray);
- // Encode the String into a sequence of bytes
- // using the given, named charset.
- byte[] bArray = s.getBytes(encoding);
- isInEncoding = inEncoding(ch, bArray);
-
- } catch (Exception e) {
- isInEncoding = false;
-
- // If for some reason the encoding is null, e.g.
- // for a temporary result tree, we should just
- // say that every character is in the encoding.
- if (encoding == null)
- isInEncoding = true;
- }
- return isInEncoding;
- }
-
- /**
- * This is heart of the code that determines if a given high/low
- * surrogate pair forms a character that is in the given encoding.
- * This method is probably expensive, and the answer should be cached.
- * <p>
- * This method is not a public API,
- * and should only be used internally within the serializer.
- * @param high the high char of
- * a high/low surrogate pair.
- * @param low the low char of a high/low surrogate pair.
- * @param encoding the Java name of the encoding.
- *
- * @xsl.usage internal
- *
- */
- private static boolean inEncoding(char high, char low, String encoding) {
- boolean isInEncoding;
- try {
- char cArray[] = new char[2];
- cArray[0] = high;
- cArray[1] = low;
- // Construct a String from the char
- String s = new String(cArray);
- // Encode the String into a sequence of bytes
- // using the given, named charset.
- byte[] bArray = s.getBytes(encoding);
- isInEncoding = inEncoding(high,bArray);
- } catch (Exception e) {
- isInEncoding = false;
- }
-
- return isInEncoding;
- }
-
- /**
- * This method is the core of determining if character
- * is in the encoding. The method is not foolproof, because
- * s.getBytes(encoding) has specified behavior only if the
- * characters are in the specified encoding. However this
- * method tries it's best.
- * @param ch the char that was converted using getBytes, or
- * the first char of a high/low pair that was converted.
- * @param data the bytes written out by the call to s.getBytes(encoding);
- * @return true if the character is in the encoding.
- */
- private static boolean inEncoding(char ch, byte[] data) {
- final boolean isInEncoding;
- // If the string written out as data is not in the encoding,
- // the output is not specified according to the documentation
- // on the String.getBytes(encoding) method,
- // but we do our best here.
- if (data==null || data.length == 0) {
- isInEncoding = false;
- }
- else {
- if (data[0] == 0)
- isInEncoding = false;
- else if (data[0] == '?' && ch != '?')
- isInEncoding = false;
- /*
- * else if (isJapanese) {
- * // isJapanese is really
- * // ( "EUC-JP".equals(javaName)
- * // || "EUC_JP".equals(javaName)
- * // || "SJIS".equals(javaName) )
- *
- * // Work around some bugs in JRE for Japanese
- * if(data[0] == 0x21)
- * isInEncoding = false;
- * else if (ch == 0xA5)
- * isInEncoding = false;
- * else
- * isInEncoding = true;
- * }
- */
-
- else {
- // We don't know for sure, but it looks like it is in the encoding
- isInEncoding = true;
- }
- }
- return isInEncoding;
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/Encodings.java b/src/com/sun/org/apache/xml/internal/serializer/Encodings.java
deleted file mode 100644
index d4d95ff..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/Encodings.java
+++ /dev/null
@@ -1,566 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Encodings.java,v 1.3 2005/09/28 13:49:04 pvedula Exp $
- */
-package com.sun.org.apache.xml.internal.serializer;
-
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.UnsupportedEncodingException;
-import java.io.Writer;
-import java.io.BufferedWriter;
-import java.net.URL;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Properties;
-import java.util.StringTokenizer;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.nio.charset.Charset;
-import java.nio.charset.IllegalCharsetNameException;
-import java.nio.charset.UnsupportedCharsetException;
-import java.util.Collections;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
-
-/**
- * Provides information about encodings. Depends on the Java runtime
- * to provides writers for the different encodings, but can be used
- * to override encoding names and provide the last printable character
- * for each encoding.
- *
- * @version $Revision: 1.11 $ $Date: 2010-11-01 04:34:44 $
- * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
- */
-
-public final class Encodings extends Object
-{
-
- /**
- * The last printable character for unknown encodings.
- */
- private static final int m_defaultLastPrintable = 0x7F;
-
- /**
- * Standard filename for properties file with encodings data.
- */
- private static final String ENCODINGS_FILE = "com/sun/org/apache/xml/internal/serializer/Encodings.properties";
-
- /**
- * Standard filename for properties file with encodings data.
- */
- private static final String ENCODINGS_PROP = "com.sun.org.apache.xalan.internal.serialize.encodings";
-
-
- /**
- * Returns a writer for the specified encoding based on
- * an output stream.
- *
- * @param output The output stream
- * @param encoding The encoding
- * @return A suitable writer
- * @throws UnsupportedEncodingException There is no convertor
- * to support this encoding
- */
- static Writer getWriter(OutputStream output, String encoding)
- throws UnsupportedEncodingException
- {
-
- final EncodingInfo ei = _encodingInfos.findEncoding(toUpperCaseFast(encoding));
- if (ei != null) {
- try {
- return new BufferedWriter(new OutputStreamWriter(
- output, ei.javaName));
- } catch (UnsupportedEncodingException usee) {
- // keep trying
- }
- }
-
- return new BufferedWriter(new OutputStreamWriter(output, encoding));
- }
-
-
- /**
- * Returns the last printable character for an unspecified
- * encoding.
- *
- * @return the default size
- */
- public static int getLastPrintable()
- {
- return m_defaultLastPrintable;
- }
-
-
-
- /**
- * Returns the EncodingInfo object for the specified
- * encoding.
- * <p>
- * This is not a public API.
- *
- * @param encoding The encoding
- * @return The object that is used to determine if
- * characters are in the given encoding.
- * @xsl.usage internal
- */
- static EncodingInfo getEncodingInfo(String encoding)
- {
- EncodingInfo ei;
-
- String normalizedEncoding = toUpperCaseFast(encoding);
- ei = _encodingInfos.findEncoding(normalizedEncoding);
- if (ei == null) {
- // We shouldn't have to do this, but just in case.
- try {
- // This may happen if the caller tries to use
- // an encoding that wasn't registered in the
- // (java name)->(preferred mime name) mapping file.
- // In that case we attempt to load the charset for the
- // given encoding, and if that succeeds - we create a new
- // EncodingInfo instance - assuming the canonical name
- // of the charset can be used as the mime name.
- final Charset c = Charset.forName(encoding);
- final String name = c.name();
- ei = new EncodingInfo(name, name);
- _encodingInfos.putEncoding(normalizedEncoding, ei);
- } catch (IllegalCharsetNameException | UnsupportedCharsetException x) {
- ei = new EncodingInfo(null,null);
- }
- }
-
- return ei;
- }
-
- /**
- * A fast and cheap way to uppercase a String that is
- * only made of printable ASCII characters.
- * <p>
- * This is not a public API.
- * @param s a String of ASCII characters
- * @return an uppercased version of the input String,
- * possibly the same String.
- * @xsl.usage internal
- */
- static private String toUpperCaseFast(final String s) {
-
- boolean different = false;
- final int mx = s.length();
- char[] chars = new char[mx];
- for (int i=0; i < mx; i++) {
- char ch = s.charAt(i);
- // is the character a lower case ASCII one?
- if ('a' <= ch && ch <= 'z') {
- // a cheap and fast way to uppercase that is good enough
- ch = (char) (ch + ('A' - 'a'));
- different = true; // the uppercased String is different
- }
- chars[i] = ch;
- }
-
- // A little optimization, don't call String.valueOf() if
- // the uppercased string is the same as the input string.
- final String upper;
- if (different)
- upper = String.valueOf(chars);
- else
- upper = s;
-
- return upper;
- }
-
- /** The default encoding, ISO style, ISO style. */
- static final String DEFAULT_MIME_ENCODING = "UTF-8";
-
- /**
- * Get the proper mime encoding. From the XSLT recommendation: "The encoding
- * attribute specifies the preferred encoding to use for outputting the result
- * tree. XSLT processors are required to respect values of UTF-8 and UTF-16.
- * For other values, if the XSLT processor does not support the specified
- * encoding it may signal an error; if it does not signal an error it should
- * use UTF-8 or UTF-16 instead. The XSLT processor must not use an encoding
- * whose name does not match the EncName production of the XML Recommendation
- * [XML]. If no encoding attribute is specified, then the XSLT processor should
- * use either UTF-8 or UTF-16."
- *
- * @param encoding Reference to java-style encoding string, which may be null,
- * in which case a default will be found.
- *
- * @return The ISO-style encoding string, or null if failure.
- */
- static String getMimeEncoding(String encoding)
- {
-
- if (null == encoding)
- {
- try
- {
-
- // Get the default system character encoding. This may be
- // incorrect if they passed in a writer, but right now there
- // seems to be no way to get the encoding from a writer.
- encoding = SecuritySupport.getSystemProperty("file.encoding", "UTF8");
-
- if (null != encoding)
- {
-
- /*
- * See if the mime type is equal to UTF8. If you don't
- * do that, then convertJava2MimeEncoding will convert
- * 8859_1 to "ISO-8859-1", which is not what we want,
- * I think, and I don't think I want to alter the tables
- * to convert everything to UTF-8.
- */
- String jencoding =
- (encoding.equalsIgnoreCase("Cp1252")
- || encoding.equalsIgnoreCase("ISO8859_1")
- || encoding.equalsIgnoreCase("8859_1")
- || encoding.equalsIgnoreCase("UTF8"))
- ? DEFAULT_MIME_ENCODING
- : convertJava2MimeEncoding(encoding);
-
- encoding =
- (null != jencoding) ? jencoding : DEFAULT_MIME_ENCODING;
- }
- else
- {
- encoding = DEFAULT_MIME_ENCODING;
- }
- }
- catch (SecurityException se)
- {
- encoding = DEFAULT_MIME_ENCODING;
- }
- }
- else
- {
- encoding = convertJava2MimeEncoding(encoding);
- }
-
- return encoding;
- }
-
- /**
- * Try the best we can to convert a Java encoding to a XML-style encoding.
- *
- * @param encoding non-null reference to encoding string, java style.
- *
- * @return ISO-style encoding string.
- */
- private static String convertJava2MimeEncoding(String encoding)
- {
- final EncodingInfo enc =
- _encodingInfos.getEncodingFromJavaKey(toUpperCaseFast(encoding));
- if (null != enc)
- return enc.name;
- return encoding;
- }
-
- /**
- * Try the best we can to convert a Java encoding to a XML-style encoding.
- *
- * @param encoding non-null reference to encoding string, java style.
- *
- * @return ISO-style encoding string.
- */
- public static String convertMime2JavaEncoding(String encoding)
- {
- final EncodingInfo info = _encodingInfos.findEncoding(toUpperCaseFast(encoding));
- return info != null ? info.javaName : encoding;
- }
-
- // Using an inner static class here prevent initialization races
- // where the hash maps could be used before they were populated.
- //
- private final static class EncodingInfos {
- // These maps are final and not modified after initialization.
- private final Map<String, EncodingInfo> _encodingTableKeyJava = new HashMap<>();
- private final Map<String, EncodingInfo> _encodingTableKeyMime = new HashMap<>();
- // This map will be added to after initialization: make sure it's
- // thread-safe. This map should not be used frequently - only in cases
- // where the mapping requested was not declared in the Encodings.properties
- // file.
- private final Map<String, EncodingInfo> _encodingDynamicTable =
- Collections.synchronizedMap(new HashMap<String, EncodingInfo>());
-
- private EncodingInfos() {
- loadEncodingInfo();
- }
-
- // Opens the file/resource containing java charset name -> preferred mime
- // name mapping and returns it as an InputStream.
- private InputStream openEncodingsFileStream() throws MalformedURLException, IOException {
- String urlString = null;
- InputStream is = null;
-
- try {
- urlString = SecuritySupport.getSystemProperty(ENCODINGS_PROP, "");
- } catch (SecurityException e) {
- }
-
- if (urlString != null && urlString.length() > 0) {
- URL url = new URL(urlString);
- is = url.openStream();
- }
-
- if (is == null) {
- is = SecuritySupport.getResourceAsStream(ENCODINGS_FILE);
- }
- return is;
- }
-
- // Loads the Properties resource containing the mapping:
- // java charset name -> preferred mime name
- // and returns it.
- private Properties loadProperties() throws MalformedURLException, IOException {
- Properties props = new Properties();
- try (InputStream is = openEncodingsFileStream()) {
- if (is != null) {
- props.load(is);
- } else {
- // Seems to be no real need to force failure here, let the
- // system do its best... The issue is not really very critical,
- // and the output will be in any case _correct_ though maybe not
- // always human-friendly... :)
- // But maybe report/log the resource problem?
- // Any standard ways to report/log errors (in static context)?
- }
- }
- return props;
- }
-
- // Parses the mime list associated to a java charset name.
- // The first mime name in the list is supposed to be the preferred
- // mime name.
- private String[] parseMimeTypes(String val) {
- int pos = val.indexOf(' ');
- //int lastPrintable;
- if (pos < 0) {
- // Maybe report/log this problem?
- // "Last printable character not defined for encoding " +
- // mimeName + " (" + val + ")" ...
- return new String[] { val };
- //lastPrintable = 0x00FF;
- }
- //lastPrintable =
- // Integer.decode(val.substring(pos).trim()).intValue();
- StringTokenizer st =
- new StringTokenizer(val.substring(0, pos), ",");
- String[] values = new String[st.countTokens()];
- for (int i=0; st.hasMoreTokens(); i++) {
- values[i] = st.nextToken();
- }
- return values;
- }
-
- // This method here attempts to find the canonical charset name for the
- // the given name - which is supposed to be either a java name or a mime
- // name.
- // For that, it attempts to load the charset using the given name, and
- // then returns the charset's canonical name.
- // If the charset could not be loaded from the given name,
- // the method returns null.
- private String findCharsetNameFor(String name) {
- try {
- return Charset.forName(name).name();
- } catch (Exception x) {
- return null;
- }
- }
-
- // This method here attempts to find the canonical charset name for the
- // the set javaName+mimeNames - which are supposed to all refer to the
- // same charset.
- // For that it attempts to load the charset using the javaName, and if
- // not found, attempts again using each of the mime names in turn.
- // If the charset could be loaded from the javaName, then the javaName
- // itself is returned as charset name. Otherwise, each of the mime names
- // is tried in turn, until a charset can be loaded from one of the names,
- // and the loaded charset's canonical name is returned.
- // If no charset can be loaded from either the javaName or one of the
- // mime names, then null is returned.
- //
- // Note that the returned name is the 'java' name that will be used in
- // instances of EncodingInfo.
- // This is important because EncodingInfo uses that 'java name' later on
- // in calls to String.getBytes(javaName).
- // As it happens, sometimes only one element of the set mime names/javaName
- // is known by Charset: sometimes only one of the mime names is known,
- // sometime only the javaName is known, sometimes all are known.
- //
- // By using this method here, we fix the problem where one of the mime
- // names is known but the javaName is unknown, by associating the charset
- // loaded from one of the mime names with the unrecognized javaName.
- //
- // When none of the mime names or javaName are known - there's not much we can
- // do... It can mean that this encoding is not supported for this
- // OS. If such a charset is ever use it will result in having all characters
- // escaped.
- //
- private String findCharsetNameFor(String javaName, String[] mimes) {
- String cs = findCharsetNameFor(javaName);
- if (cs != null) return javaName;
- for (String m : mimes) {
- cs = findCharsetNameFor(m);
- if (cs != null) break;
- }
- return cs;
- }
-
- /**
- * Loads a list of all the supported encodings.
- *
- * System property "encodings" formatted using URL syntax may define an
- * external encodings list. Thanks to Sergey Ushakov for the code
- * contribution!
- */
- private void loadEncodingInfo() {
- try {
- // load (java name)->(preferred mime name) mapping.
- final Properties props = loadProperties();
-
- // create instances of EncodingInfo from the loaded mapping
- Enumeration keys = props.keys();
- Map<String, EncodingInfo> canonicals = new HashMap<>();
- while (keys.hasMoreElements()) {
- final String javaName = (String) keys.nextElement();
- final String[] mimes = parseMimeTypes(props.getProperty(javaName));
-
- final String charsetName = findCharsetNameFor(javaName, mimes);
- if (charsetName != null) {
- final String kj = toUpperCaseFast(javaName);
- final String kc = toUpperCaseFast(charsetName);
- for (int i = 0; i < mimes.length; ++i) {
- final String mimeName = mimes[i];
- final String km = toUpperCaseFast(mimeName);
- EncodingInfo info = new EncodingInfo(mimeName, charsetName);
- _encodingTableKeyMime.put(km, info);
- if (!canonicals.containsKey(kc)) {
- // canonicals will map the charset name to
- // the info containing the prefered mime name
- // (the preferred mime name is the first mime
- // name in the list).
- canonicals.put(kc, info);
- _encodingTableKeyJava.put(kc, info);
- }
- _encodingTableKeyJava.put(kj, info);
- }
- } else {
- // None of the java or mime names on the line were
- // recognized => this charset is not supported?
- }
- }
-
- // Fix up the _encodingTableKeyJava so that the info mapped to
- // the java name contains the preferred mime name.
- // (a given java name can correspond to several mime name,
- // but we want the _encodingTableKeyJava to point to the
- // preferred mime name).
- for (Entry<String, EncodingInfo> e : _encodingTableKeyJava.entrySet()) {
- e.setValue(canonicals.get(toUpperCaseFast(e.getValue().javaName)));
- }
-
- } catch (java.net.MalformedURLException mue) {
- throw new com.sun.org.apache.xml.internal.serializer.utils.WrappedRuntimeException(mue);
- } catch (java.io.IOException ioe) {
- throw new com.sun.org.apache.xml.internal.serializer.utils.WrappedRuntimeException(ioe);
- }
- }
-
- EncodingInfo findEncoding(String normalizedEncoding) {
- EncodingInfo info = _encodingTableKeyJava.get(normalizedEncoding);
- if (info == null) {
- info = _encodingTableKeyMime.get(normalizedEncoding);
- }
- if (info == null) {
- info = _encodingDynamicTable.get(normalizedEncoding);
- }
- return info;
- }
-
- EncodingInfo getEncodingFromMimeKey(String normalizedMimeName) {
- return _encodingTableKeyMime.get(normalizedMimeName);
- }
-
- EncodingInfo getEncodingFromJavaKey(String normalizedJavaName) {
- return _encodingTableKeyJava.get(normalizedJavaName);
- }
-
- void putEncoding(String key, EncodingInfo info) {
- _encodingDynamicTable.put(key, info);
- }
- }
-
- /**
- * Return true if the character is the high member of a surrogate pair.
- * <p>
- * This is not a public API.
- * @param ch the character to test
- * @xsl.usage internal
- */
- static boolean isHighUTF16Surrogate(char ch) {
- return ('\uD800' <= ch && ch <= '\uDBFF');
- }
- /**
- * Return true if the character is the low member of a surrogate pair.
- * <p>
- * This is not a public API.
- * @param ch the character to test
- * @xsl.usage internal
- */
- static boolean isLowUTF16Surrogate(char ch) {
- return ('\uDC00' <= ch && ch <= '\uDFFF');
- }
- /**
- * Return the unicode code point represented by the high/low surrogate pair.
- * <p>
- * This is not a public API.
- * @param highSurrogate the high char of the high/low pair
- * @param lowSurrogate the low char of the high/low pair
- * @xsl.usage internal
- */
- static int toCodePoint(char highSurrogate, char lowSurrogate) {
- int codePoint =
- ((highSurrogate - 0xd800) << 10)
- + (lowSurrogate - 0xdc00)
- + 0x10000;
- return codePoint;
- }
- /**
- * Return the unicode code point represented by the char.
- * A bit of a dummy method, since all it does is return the char,
- * but as an int value.
- * <p>
- * This is not a public API.
- * @param ch the char.
- * @xsl.usage internal
- */
- static int toCodePoint(char ch) {
- int codePoint = ch;
- return codePoint;
- }
-
- private final static EncodingInfos _encodingInfos = new EncodingInfos();
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/Encodings.properties b/src/com/sun/org/apache/xml/internal/serializer/Encodings.properties
deleted file mode 100644
index e380f77..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/Encodings.properties
+++ /dev/null
@@ -1,118 +0,0 @@
-###########################################################################
-# Copyright 2003-2004 The Apache Software Foundation.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-##########################################################################
-#
-# $Id$
-#
-# <JAVA name encoding>, <PREFERRED name MIME>
-# Peter Smolik
-Cp1250 WINDOWS-1250 0x00FF
-# Patch attributed to havardw@underdusken.no (Håvard Wigtil)
-Cp1251 WINDOWS-1251 0x00FF
-Cp1252 WINDOWS-1252 0x00FF
-ISO8859_1 ISO-8859-1 0x00FF
-# Patch attributed to havardw@underdusken.no (Håvard Wigtil)
-ISO8859-1 ISO-8859-1 0x00FF
-ISO8859_2 ISO-8859-2 0x00FF
-# I'm going to apply "ISO8859-X" variant to all these, to be safe.
-ISO8859-2 ISO-8859-2 0x00FF
-ISO8859_3 ISO-8859-3 0x00FF
-ISO8859-3 ISO-8859-3 0x00FF
-ISO8859_4 ISO-8859-4 0x00FF
-ISO8859-4 ISO-8859-4 0x00FF
-ISO8859_5 ISO-8859-5 0x00FF
-ISO8859-5 ISO-8859-5 0x00FF
-ISO8859_6 ISO-8859-6 0x00FF
-ISO8859-6 ISO-8859-6 0x00FF
-ISO8859_7 ISO-8859-7 0x00FF
-ISO8859-7 ISO-8859-7 0x00FF
-ISO8859_8 ISO-8859-8 0x00FF
-ISO8859-8 ISO-8859-8 0x00FF
-ISO8859_9 ISO-8859-9 0x00FF
-ISO8859-9 ISO-8859-9 0x00FF
-ISO8859_10 ISO-8859-10 0x00FF
-ISO8859-10 ISO-8859-10 0x00FF
-ISO8859_11 ISO-8859-11 0x00FF
-ISO8859-11 ISO-8859-11 0x00FF
-ISO8859_12 ISO-8859-12 0x00FF
-ISO8859-12 ISO-8859-12 0x00FF
-ISO8859_13 ISO-8859-13 0x00FF
-ISO8859-13 ISO-8859-13 0x00FF
-ISO8859_14 ISO-8859-14 0x00FF
-ISO8859-14 ISO-8859-14 0x00FF
-ISO8859_15 ISO-8859-15 0x00FF
-ISO8859-15 ISO-8859-15 0x00FF
-# # ?
-8859_1 ISO-8859-1 0x00FF
-8859_2 ISO-8859-2 0x00FF
-8859_3 ISO-8859-3 0x00FF
-8859_4 ISO-8859-4 0x00FF
-8859_5 ISO-8859-5 0x00FF
-8859_6 ISO-8859-6 0x00FF
-8859_7 ISO-8859-7 0x00FF
-8859_8 ISO-8859-8 0x00FF
-8859_9 ISO-8859-9 0x00FF
-8859-1 ISO-8859-1 0x00FF
-8859-2 ISO-8859-2 0x00FF
-8859-3 ISO-8859-3 0x00FF
-8859-4 ISO-8859-4 0x00FF
-8859-5 ISO-8859-5 0x00FF
-8859-6 ISO-8859-6 0x00FF
-8859-7 ISO-8859-7 0x00FF
-8859-8 ISO-8859-8 0x00FF
-8859-9 ISO-8859-9 0x00FF
-JIS ISO-2022-JP 0xFFFF
-ISO2022KR ISO-2022-KR 0xFFFF
-SJIS SHIFT_JIS 0xFFFF
-EUC_JP EUC-JP 0xFFFF
-EUC_KR EUC-KR 0xFFFF
-EUC_CN EUC-CN 0xFFFF
-EUC_TW EUC-TW 0xFFFF
-EUC_CN GB2312 0xFFFF
-EUC-JP EUC-JP 0xFFFF
-EUC-KR EUC-KR 0xFFFF
-EUC-CN EUC-CN 0xFFFF
-EUC-TW EUC-TW 0xFFFF
-EUC-CN GB2312 0xFFFF
-GB2312 GB2312 0xFFFF
-Big5 BIG5 0xFFFF
-EUCJIS EUC-JP 0xFFFF
-KSC5601 EUC-KR 0xFFFF
-KOI8_R KOI8-R 0xFFFF
-Cp037 EBCDIC-CP-US,EBCDIC-CP-CA,EBCDIC-CP-NL 0x00FF
-Cp277 EBCDIC-CP-DK,EBCDIC-CP-NO 0x00FF
-Cp278 EBCDIC-CP-FI,EBCDIC-CP-SE 0x00FF
-Cp280 EBCDIC-CP-IT 0x00FF
-Cp284 EBCDIC-CP-ES 0x00FF
-Cp285 EBCDIC-CP-GB 0x00FF
-Cp297 EBCDIC-CP-FR 0x00FF
-Cp420 EBCDIC-CP-AR1 0x00FF
-Cp424 EBCDIC-CP-HE 0x00FF
-Cp500 EBCDIC-CP-CH 0x00FF
-Cp850 850,csPC850Multilingual 0xFFFF
-Cp860 860,csIBM860 0xFFFF
-Cp870 EBCDIC-CP-ROECE,EBCDIC-CP-YU 0x00FF
-Cp871 EBCDIC-CP-IS 0x00FF
-Cp918 EBCDIC-CP-AR2 0x00FF
-Cp1047 IBM1047,IBM-1047 0x00FF
-MacTEC MacRoman 0x00FF
-ASCII ASCII,US-ASCII 0x007F
-Unicode UNICODE,UTF-16 0xFFFF
-UTF8 UTF-8 0xFFFF
-# patch attributed to Jinsung Lee
-KS_C_5601-1987 KS_C_5601-1987,iso-ir-149,KS_C_5601-1989,KSC_5601,csKSC56011987 0xFFFF
-# note that more character set names and their aliases
-# can be found at http://www.iana.org/assignments/character-sets
-
diff --git a/src/com/sun/org/apache/xml/internal/serializer/ExtendedContentHandler.java b/src/com/sun/org/apache/xml/internal/serializer/ExtendedContentHandler.java
deleted file mode 100644
index 6deefb2..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/ExtendedContentHandler.java
+++ /dev/null
@@ -1,273 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ExtendedContentHandler.java,v 1.2.4.1 2005/09/15 08:15:17 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.serializer;
-
-import javax.xml.transform.SourceLocator;
-
-import org.xml.sax.SAXException;
-
-/**
- * This interface describes extensions to the SAX ContentHandler interface.
- * It is intended to be used by a serializer. The methods on this interface will
- * implement SAX- like behavior. This allows the gradual collection of
- * information rather than having it all up front. For example the call
- * <pre>
- * startElement(namespaceURI,localName,qName,atts)
- * </pre>
- * could be replaced with the calls
- * <pre>
- * startElement(namespaceURI,localName,qName)
- * addAttributes(atts)
- * </pre>
- * If there are no attributes the second call can be dropped. If attributes are
- * to be added one at a time with calls to
- * <pre>
- * addAttribute(namespaceURI, localName, qName, type, value)
- * </pre>
- * @xsl.usage internal
- */
-abstract interface ExtendedContentHandler extends org.xml.sax.ContentHandler
-{
- /**
- * Add at attribute to the current element
- * @param uri the namespace URI of the attribute name
- * @param localName the local name of the attribute (without prefix)
- * @param rawName the qualified name of the attribute
- * @param type the attribute type typically character data (CDATA)
- * @param value the value of the attribute
- * @param XSLAttribute true if the added attribute is coming from an xsl:attribute element
- * @throws SAXException
- */
- public void addAttribute(
- String uri,
- String localName,
- String rawName,
- String type,
- String value,
- boolean XSLAttribute)
- throws SAXException;
- /**
- * Add attributes to the current element
- * @param atts the attributes to add.
- * @throws SAXException
- */
- public void addAttributes(org.xml.sax.Attributes atts)
- throws org.xml.sax.SAXException;
- /**
- * Add an attribute to the current element. The namespace URI of the
- * attribute will be calculated from the prefix of qName. The local name
- * will be derived from qName and the type will be assumed to be "CDATA".
- * @param qName
- * @param value
- */
- public void addAttribute(String qName, String value);
-
- /**
- * This method is used to notify of a character event, but passing the data
- * as a character String rather than the standard character array.
- * @param chars the character data
- * @throws SAXException
- */
- public void characters(String chars) throws SAXException;
-
- /**
- * This method is used to notify of a character event, but passing the data
- * as a DOM Node rather than the standard character array.
- * @param node a DOM Node containing text.
- * @throws SAXException
- */
- public void characters(org.w3c.dom.Node node) throws org.xml.sax.SAXException;
- /**
- * This method is used to notify that an element has ended. Unlike the
- * standard SAX method
- * <pre>
- * endElement(namespaceURI,localName,qName)
- * </pre>
- * only the last parameter is passed. If needed the serializer can derive
- * the localName from the qualified name and derive the namespaceURI from
- * its implementation.
- * @param elemName the fully qualified element name.
- * @throws SAXException
- */
- public void endElement(String elemName) throws SAXException;
-
- /**
- * This method is used to notify that an element is starting.
- * This method is just like the standard SAX method
- * <pre>
- * startElement(uri,localName,qname,atts)
- * </pre>
- * but without the attributes.
- * @param uri the namespace URI of the element
- * @param localName the local name (without prefix) of the element
- * @param qName the qualified name of the element
- *
- * @throws SAXException
- */
- public void startElement(String uri, String localName, String qName)
- throws org.xml.sax.SAXException;
-
- /**
- * This method is used to notify of the start of an element
- * @param qName the fully qualified name of the element
- * @throws SAXException
- */
- public void startElement(String qName) throws SAXException;
- /**
- * This method is used to notify that a prefix mapping is to start, but
- * after an element is started. The SAX method call
- * <pre>
- * startPrefixMapping(prefix,uri)
- * </pre>
- * is used just before an element starts and applies to the element to come,
- * not to the current element. This method applies to the current element.
- * For example one could make the calls in this order:
- * <pre>
- * startElement("prfx8:elem9")
- * namespaceAfterStartElement("http://namespace8","prfx8")
- * </pre>
- *
- * @param uri the namespace URI being declared
- * @param prefix the prefix that maps to the given namespace
- * @throws SAXException
- */
- public void namespaceAfterStartElement(String uri, String prefix)
- throws SAXException;
-
- /**
- * This method is used to notify that a prefix maping is to start, which can
- * be for the current element, or for the one to come.
- * @param prefix the prefix that maps to the given URI
- * @param uri the namespace URI of the given prefix
- * @param shouldFlush if true this call is like the SAX
- * startPrefixMapping(prefix,uri) call and the mapping applies to the
- * element to come. If false the mapping applies to the current element.
- * @return boolean false if the prefix mapping was already in effect (in
- * other words we are just re-declaring), true if this is a new, never
- * before seen mapping for the element.
- * @throws SAXException
- */
- public boolean startPrefixMapping(
- String prefix,
- String uri,
- boolean shouldFlush)
- throws SAXException;
- /**
- * Notify of an entity reference.
- * @param entityName the name of the entity
- * @throws SAXException
- */
- public void entityReference(String entityName) throws SAXException;
-
- /**
- * This method returns an object that has the current namespace mappings in
- * effect.
- *
- * @return NamespaceMappings an object that has the current namespace
- * mappings in effect.
- */
- public NamespaceMappings getNamespaceMappings();
- /**
- * This method returns the prefix that currently maps to the given namespace
- * URI.
- * @param uri the namespace URI
- * @return String the prefix that currently maps to the given URI.
- */
- public String getPrefix(String uri);
- /**
- * This method gets the prefix associated with a current element or
- * attribute name.
- * @param name the qualified name of an element, or attribute
- * @param isElement true if it is an element name, false if it is an
- * atttribute name
- * @return String the namespace URI associated with the element or
- * attribute.
- */
- public String getNamespaceURI(String name, boolean isElement);
- /**
- * This method returns the namespace URI currently associated with the
- * prefix.
- * @param prefix a prefix of an element or attribute.
- * @return String the namespace URI currently associated with the prefix.
- */
- public String getNamespaceURIFromPrefix(String prefix);
-
- /**
- * This method is used to set the source locator, which might be used to
- * generated an error message.
- * @param locator the source locator
- */
- public void setSourceLocator(SourceLocator locator);
-
- // Bit constants for addUniqueAttribute().
-
- // The attribute value contains no bad characters. A "bad" character is one which
- // is greater than 126 or it is one of '<', '>', '&' or '"'.
- public static final int NO_BAD_CHARS = 0x1;
-
- // An HTML empty attribute (e.g. <OPTION selected>).
- public static final int HTML_ATTREMPTY = 0x2;
-
- // An HTML URL attribute
- public static final int HTML_ATTRURL = 0x4;
-
- /**
- * Add a unique attribute to the current element.
- * The attribute is guaranteed to be unique here. The serializer can write
- * it out immediately without saving it in a table first. The integer
- * flag contains information about the attribute, which helps the serializer
- * to decide whether a particular processing is needed.
- *
- * @param qName the fully qualified attribute name.
- * @param value the attribute value
- * @param flags a bitwise flag
- */
- public void addUniqueAttribute(String qName, String value, int flags)
- throws SAXException;
-
- /**
- * Add an attribute from an xsl:attribute element.
- * @param qName the qualified attribute name (prefix:localName)
- * @param value the attributes value
- * @param uri the uri that the prefix of the qName is mapped to.
- */
- public void addXSLAttribute(String qName, final String value, final String uri);
-
- /**
- * Add at attribute to the current element, not from an xsl:attribute
- * element.
- * @param uri the namespace URI of the attribute name
- * @param localName the local name of the attribute (without prefix)
- * @param rawName the qualified name of the attribute
- * @param type the attribute type typically character data (CDATA)
- * @param value the value of the attribute
- * @throws SAXException
- */
- public void addAttribute(
- String uri,
- String localName,
- String rawName,
- String type,
- String value)
- throws SAXException;
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/ExtendedLexicalHandler.java b/src/com/sun/org/apache/xml/internal/serializer/ExtendedLexicalHandler.java
deleted file mode 100644
index 4983dbe..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/ExtendedLexicalHandler.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ExtendedLexicalHandler.java,v 1.2.4.1 2005/09/15 08:15:18 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.serializer;
-
-import org.xml.sax.SAXException;
-
-/**
- * This interface has extensions to the standard SAX LexicalHandler interface.
- * This interface is intended to be used by a serializer.
- * @xsl.usage internal
- */
-abstract interface ExtendedLexicalHandler extends org.xml.sax.ext.LexicalHandler
-{
- /**
- * This method is used to notify of a comment
- * @param comment the comment, but unlike the SAX comment() method this
- * method takes a String rather than a character array.
- * @throws SAXException
- */
- public void comment(String comment) throws SAXException;
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/HTMLEntities.properties b/src/com/sun/org/apache/xml/internal/serializer/HTMLEntities.properties
deleted file mode 100644
index 5c272c9..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/HTMLEntities.properties
+++ /dev/null
@@ -1,314 +0,0 @@
-###########################################################################
-# reserved comment block
-# DO NOT REMOVE OR ALTER!
-###########################################################################
-###########################################################################
-# Copyright 2003-2004 The Apache Software Foundation.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-##########################################################################
-#
-# $Id: HTMLEntities.properties,v 1.2.4.1 2005/09/15 08:15:19 suresh_emailid Exp $
-# in ./java/src/com/sun/org/apache/xml/internal/serializer
-#
-# @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
-# This file must be encoded in UTF-8; see com.sun.org.apache.xml.internal.serializer.CharInfo
-#
-# Character entity references for markup-significant
-#
-quot=34
-amp=38
-lt=60
-gt=62
-nbsp=160
-#
-# Character entity references for ISO 8859-1 characters
-#
-iexcl=161
-cent=162
-pound=163
-curren=164
-yen=165
-brvbar=166
-sect=167
-uml=168
-copy=169
-ordf=170
-laquo=171
-not=172
-shy=173
-reg=174
-macr=175
-deg=176
-plusmn=177
-sup2=178
-sup3=179
-acute=180
-micro=181
-para=182
-middot=183
-cedil=184
-sup1=185
-ordm=186
-raquo=187
-frac14=188
-frac12=189
-frac34=190
-iquest=191
-Agrave=192
-Aacute=193
-Acirc=194
-Atilde=195
-Auml=196
-Aring=197
-AElig=198
-Ccedil=199
-Egrave=200
-Eacute=201
-Ecirc=202
-Euml=203
-Igrave=204
-Iacute=205
-Icirc=206
-Iuml=207
-ETH=208
-Ntilde=209
-Ograve=210
-Oacute=211
-Ocirc=212
-Otilde=213
-Ouml=214
-times=215
-Oslash=216
-Ugrave=217
-Uacute=218
-Ucirc=219
-Uuml=220
-Yacute=221
-THORN=222
-szlig=223
-agrave=224
-aacute=225
-acirc=226
-atilde=227
-auml=228
-aring=229
-aelig=230
-ccedil=231
-egrave=232
-eacute=233
-ecirc=234
-euml=235
-igrave=236
-iacute=237
-icirc=238
-iuml=239
-eth=240
-ntilde=241
-ograve=242
-oacute=243
-ocirc=244
-otilde=245
-ouml=246
-divide=247
-oslash=248
-ugrave=249
-uacute=250
-ucirc=251
-uuml=252
-yacute=253
-thorn=254
-yuml=255
-#
-# Character entity references for symbols, mathematical symbols, and Greek letters
-#
-# Latin Extended -- Netscape can't handle
-# fnof 402
-#
-# Greek - Netscape can't handle these
-# Alpha 913
-# Beta 914
-# Gamma 915
-# Delta 916
-# Epsilon 917
-# Zeta 918
-# Eta 919
-# Theta 920
-# Iota 921
-# Kappa 922
-# Lambda 923
-# Mu 924
-# Nu 925
-# Xi 926
-# Omicron 927
-# Pi 928
-# Rho 929
-# Sigma 931
-# Tau 932
-# Upsilon 933
-# Phi 934
-# Chi 935
-# Psi 936
-# Omega 937
-# alpha 945
-# beta 946
-# gamma 947
-# delta 948
-# epsilon 949
-# zeta 950
-# eta 951
-# theta 952
-# iota 953
-# kappa 954
-# lambda 955
-# mu 956
-# nu 957
-# xi 958
-# omicron 959
-# pi 960
-# rho 961
-# sigmaf 962
-# sigma 963
-# tau 964
-# upsilon 965
-# phi 966
-# chi 967
-# psi 968
-# omega 969
-# thetasym 977
-# upsih 978
-# piv 982
-#
-# General Punctuation
-bull=8226
-hellip=8230
-prime=8242
-Prime=8243
-oline=8254
-frasl=8260
-#
-# Letterlike Symbols
-weierp=8472
-image=8465
-real=8476
-trade=8482
-alefsym=8501
-#
-# Arrows
-larr=8592
-uarr=8593
-rarr=8594
-darr=8595
-harr=8596
-crarr=8629
-lArr=8656
-uArr=8657
-rArr=8658
-dArr=8659
-hArr=8660
-#
-# Mathematical Operators
-forall=8704
-part=8706
-exist=8707
-empty=8709
-nabla=8711
-isin=8712
-notin=8713
-ni=8715
-prod=8719
-sum=8721
-minus=8722
-lowast=8727
-radic=8730
-prop=8733
-infin=8734
-ang=8736
-and=8743
-or=8744
-cap=8745
-cup=8746
-int=8747
-there4=8756
-sim=8764
-cong=8773
-asymp=8776
-ne=8800
-equiv=8801
-le=8804
-ge=8805
-sub=8834
-sup=8835
-nsub=8836
-sube=8838
-supe=8839
-oplus=8853
-otimes=8855
-perp=8869
-sdot=8901
-#
-# Miscellaneous Technical
-lceil=8968
-rceil=8969
-lfloor=8970
-rfloor=8971
-lang=9001
-rang=9002
-#
-# Geometric Shapes
-loz=9674
-#
-# Miscellaneous Symbols
-spades=9824
-clubs=9827
-hearts=9829
-diams=9830
-#
-# Character entity references for internationalization characters
-#
-# Latin Extended-A
-# Netscape can't handle!
-# OElig 338
-# oelig 339
-
-#-- NN 4.7 does not seem to support these, so they might ought to be commented.
-# Scaron 352
-# scaron 353
-# Yuml 376
-#
-# Spacing Modifier Letters -- Netscape can't handle
-# circ 710
-# tilde 732
-#
-# General Punctuation
-ensp=8194
-emsp=8195
-thinsp=8201
-zwnj=8204
-zwj=8205
-lrm=8206
-rlm=8207
-ndash=8211
-mdash=8212
-lsquo=8216
-rsquo=8217
-sbquo=8218
-ldquo=8220
-rdquo=8221
-bdquo=8222
-dagger=8224
-Dagger=8225
-permil=8240
-lsaquo=8249
-rsaquo=8250
-euro=8364
diff --git a/src/com/sun/org/apache/xml/internal/serializer/Method.java b/src/com/sun/org/apache/xml/internal/serializer/Method.java
deleted file mode 100644
index cecacc1..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/Method.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Method.java,v 1.2.4.1 2005/09/15 08:15:19 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.serializer;
-
-/**
- * This class defines the constants which are the names of the four default
- * output methods.
- * <p>
- * Three default output methods are defined: XML, HTML, and TEXT.
- * These constants can be used as an argument to the
- * OutputPropertiesFactory.getDefaultMethodProperties() method to get
- * the properties to create a serializer.
- *
- * This class is a public API.
- *
- * @see OutputPropertiesFactory
- * @see Serializer
- *
- * @xsl.usage general
- */
-public final class Method
-{
- /**
- * A private constructor to prevent the creation of such a class.
- */
- private Method() {
-
- }
-
- /**
- * The output method type for XML documents: <tt>xml</tt>.
- */
- public static final String XML = "xml";
-
- /**
- * The output method type for HTML documents: <tt>html</tt>.
- */
- public static final String HTML = "html";
-
- /**
- * The output method for XHTML documents,
- * this method type is not currently supported: <tt>xhtml</tt>.
- */
- public static final String XHTML = "xhtml";
-
- /**
- * The output method type for text documents: <tt>text</tt>.
- */
- public static final String TEXT = "text";
-
- /**
- * The "internal" method, just used when no method is
- * specified in the style sheet, and a serializer of this type wraps either an
- * XML or HTML type (depending on the first tag in the output being html or
- * not)
- */
- public static final String UNKNOWN = "";
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/NamespaceMappings.java b/src/com/sun/org/apache/xml/internal/serializer/NamespaceMappings.java
deleted file mode 100644
index 5df83c1..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/NamespaceMappings.java
+++ /dev/null
@@ -1,327 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: NamespaceMappings.java,v 1.2.4.1 2005/09/15 08:15:19 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.serializer;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Stack;
-
-import org.xml.sax.ContentHandler;
-import org.xml.sax.SAXException;
-
-/**
- * This class keeps track of the currently defined namespaces. Conceptually the
- * prefix/uri/depth triplets are pushed on a stack pushed on a stack. The depth
- * indicates the nesting depth of the element for which the mapping was made.
- *
- * <p>For example:
- * <pre>
- * <chapter xmlns:p1="def">
- * <paragraph xmlns:p2="ghi">
- * <sentance xmlns:p3="jkl">
- * </sentance>
- * </paragraph>
- * <paragraph xlmns:p4="mno">
- * </paragraph>
- * </chapter>
- * </pre>
- *
- * When the <chapter> element is encounted the prefix "p1" associated with uri
- * "def" is pushed on the stack with depth 1.
- * When the first <paragraph> is encountered "p2" and "ghi" are pushed with
- * depth 2.
- * When the <sentance> is encountered "p3" and "jkl" are pushed with depth 3.
- * When </sentance> occurs the popNamespaces(3) will pop "p3"/"jkl" off the
- * stack. Of course popNamespaces(2) would pop anything with depth 2 or
- * greater.
- *
- * So prefix/uri pairs are pushed and poped off the stack as elements are
- * processed. At any given moment of processing the currently visible prefixes
- * are on the stack and a prefix can be found given a uri, or a uri can be found
- * given a prefix.
- *
- * This class is public only because it is used by Xalan. It is not a public API
- *
- * @xsl.usage internal
- */
-public class NamespaceMappings
-{
- /**
- * This member is continually incremented when new prefixes need to be
- * generated. ("ns0" "ns1" ...)
- */
- private int count;
-
- /**
- * Each entry (prefix) in this hashmap points to a Stack of URIs
- * This maps a prefix (String) to a Stack of prefix mappings.
- * All mappings in that retrieved stack have the same prefix,
- * though possibly different URI's or depths. Such a stack must have
- * mappings at deeper depths push later on such a stack. Mappings pushed
- * earlier on the stack will have smaller values for MappingRecord.m_declarationDepth.
- */
- private HashMap m_namespaces = new HashMap();
-
- /**
- * The top of this stack contains the MapRecord
- * of the last declared a namespace.
- * Used to know how many prefix mappings to pop when leaving
- * the current element depth.
- * For every prefix mapping the current element depth is
- * pushed on this stack.
- * That way all prefixes pushed at the current depth can be
- * removed at the same time.
- * Used to ensure prefix/uri map scopes are closed correctly
- *
- */
- private Stack m_nodeStack = new Stack();
-
- private static final String EMPTYSTRING = "";
- private static final String XML_PREFIX = "xml"; // was "xmlns"
-
- /**
- * Default constructor
- * @see java.lang.Object#Object()
- */
- public NamespaceMappings()
- {
- initNamespaces();
- }
-
- /**
- * This method initializes the namespace object with appropriate stacks
- * and predefines a few prefix/uri pairs which always exist.
- */
- private void initNamespaces()
- {
-
-
- // Define the default namespace (initially maps to "" uri)
- Stack stack;
- m_namespaces.put(EMPTYSTRING, stack = new Stack());
- stack.push(new MappingRecord(EMPTYSTRING,EMPTYSTRING,0));
-
- m_namespaces.put(XML_PREFIX, stack = new Stack());
- stack.push(new MappingRecord( XML_PREFIX,
- "http://www.w3.org/XML/1998/namespace",0));
-
- m_nodeStack.push(new MappingRecord(null,null,-1));
-
- }
-
- /**
- * Use a namespace prefix to lookup a namespace URI.
- *
- * @param prefix String the prefix of the namespace
- * @return the URI corresponding to the prefix
- */
- public String lookupNamespace(String prefix)
- {
- final Stack stack = (Stack) m_namespaces.get(prefix);
- return stack != null && !stack.isEmpty() ?
- ((MappingRecord) stack.peek()).m_uri : null;
- }
-
- MappingRecord getMappingFromPrefix(String prefix) {
- final Stack stack = (Stack) m_namespaces.get(prefix);
- return stack != null && !stack.isEmpty() ?
- ((MappingRecord) stack.peek()) : null;
- }
-
- /**
- * Given a namespace uri, and the namespaces mappings for the
- * current element, return the current prefix for that uri.
- *
- * @param uri the namespace URI to be search for
- * @return an existing prefix that maps to the given URI, null if no prefix
- * maps to the given namespace URI.
- */
- public String lookupPrefix(String uri)
- {
- String foundPrefix = null;
- Iterator<String> itr = m_namespaces.keySet().iterator();
- while (itr.hasNext()) {
- String prefix = itr.next();
- String uri2 = lookupNamespace(prefix);
- if (uri2 != null && uri2.equals(uri))
- {
- foundPrefix = prefix;
- break;
- }
- }
- return foundPrefix;
- }
-
- MappingRecord getMappingFromURI(String uri)
- {
- MappingRecord foundMap = null;
- Iterator<String> itr = m_namespaces.keySet().iterator();
- while (itr.hasNext())
- {
- String prefix = itr.next();
- MappingRecord map2 = getMappingFromPrefix(prefix);
- if (map2 != null && (map2.m_uri).equals(uri))
- {
- foundMap = map2;
- break;
- }
- }
- return foundMap;
- }
-
- /**
- * Undeclare the namespace that is currently pointed to by a given prefix
- */
- boolean popNamespace(String prefix)
- {
- // Prefixes "xml" and "xmlns" cannot be redefined
- if (prefix.startsWith(XML_PREFIX))
- {
- return false;
- }
-
- Stack stack;
- if ((stack = (Stack) m_namespaces.get(prefix)) != null)
- {
- stack.pop();
- return true;
- }
- return false;
- }
-
- /**
- * Declare a mapping of a prefix to namespace URI at the given element depth.
- * @param prefix a String with the prefix for a qualified name
- * @param uri a String with the uri to which the prefix is to map
- * @param elemDepth the depth of current declaration
- */
- boolean pushNamespace(String prefix, String uri, int elemDepth)
- {
- // Prefixes "xml" and "xmlns" cannot be redefined
- if (prefix.startsWith(XML_PREFIX))
- {
- return false;
- }
-
- Stack stack;
- // Get the stack that contains URIs for the specified prefix
- if ((stack = (Stack) m_namespaces.get(prefix)) == null)
- {
- m_namespaces.put(prefix, stack = new Stack());
- }
-
- if (!stack.empty() && uri.equals(((MappingRecord)stack.peek()).m_uri))
- {
- return false;
- }
- MappingRecord map = new MappingRecord(prefix,uri,elemDepth);
- stack.push(map);
- m_nodeStack.push(map);
- return true;
- }
-
- /**
- * Pop, or undeclare all namespace definitions that are currently
- * declared at the given element depth, or deepter.
- * @param elemDepth the element depth for which mappings declared at this
- * depth or deeper will no longer be valid
- * @param saxHandler The ContentHandler to notify of any endPrefixMapping()
- * calls. This parameter can be null.
- */
- void popNamespaces(int elemDepth, ContentHandler saxHandler)
- {
- while (true)
- {
- if (m_nodeStack.isEmpty())
- return;
- MappingRecord map = (MappingRecord)(m_nodeStack.peek());
- int depth = map.m_declarationDepth;
- if (depth < elemDepth)
- return;
- /* the depth of the declared mapping is elemDepth or deeper
- * so get rid of it
- */
-
- map = (MappingRecord) m_nodeStack.pop();
- final String prefix = map.m_prefix;
- popNamespace(prefix);
- if (saxHandler != null)
- {
- try
- {
- saxHandler.endPrefixMapping(prefix);
- }
- catch (SAXException e)
- {
- // not much we can do if they aren't willing to listen
- }
- }
-
- }
- }
-
- /**
- * Generate a new namespace prefix ( ns0, ns1 ...) not used before
- * @return String a new namespace prefix ( ns0, ns1, ns2 ...)
- */
- public String generateNextPrefix()
- {
- return "ns" + (count++);
- }
-
-
- /**
- * This method makes a clone of this object.
- *
- */
- public Object clone() throws CloneNotSupportedException {
- NamespaceMappings clone = new NamespaceMappings();
- clone.m_nodeStack = (Stack) m_nodeStack.clone();
- clone.m_namespaces = (HashMap) m_namespaces.clone();
- clone.count = count;
- return clone;
-
- }
-
- final void reset()
- {
- this.count = 0;
- this.m_namespaces.clear();
- this.m_nodeStack.clear();
- initNamespaces();
- }
-
- class MappingRecord {
- final String m_prefix; // the prefix
- final String m_uri; // the uri
- // the depth of the element where declartion was made
- final int m_declarationDepth;
- MappingRecord(String prefix, String uri, int depth) {
- m_prefix = prefix;
- m_uri = uri;
- m_declarationDepth = depth;
-
- }
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/OutputPropertiesFactory.java b/src/com/sun/org/apache/xml/internal/serializer/OutputPropertiesFactory.java
deleted file mode 100644
index 0d91b7a..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/OutputPropertiesFactory.java
+++ /dev/null
@@ -1,539 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: OutputPropertiesFactory.java,v 1.2.4.1 2005/09/15 08:15:21 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.serializer;
-
-import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
-import java.io.BufferedInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.Enumeration;
-import java.util.Properties;
-
-import javax.xml.transform.OutputKeys;
-
-import com.sun.org.apache.xml.internal.serializer.utils.MsgKey;
-import com.sun.org.apache.xml.internal.serializer.utils.Utils;
-import com.sun.org.apache.xml.internal.serializer.utils.WrappedRuntimeException;
-
-/**
- * This class is a factory to generate a set of default properties
- * of key/value pairs that are used to create a serializer through the
- * factory {@link SerializerFactory SerilizerFactory}.
- * The properties generated by this factory
- * may be modified to non-default values before the SerializerFactory is used to
- * create a Serializer.
- * <p>
- * The given output types supported are "xml", "text", and "html".
- * These type strings can be obtained from the
- * {@link Method Method} class in this package.
- * <p>
- * Other constants defined in this class are the non-standard property keys
- * that can be used to set non-standard property values on a java.util.Properties object
- * that is used to create or configure a serializer. Here are the non-standard keys:
- * <ul>
- * <li> <b>S_KEY_INDENT_AMOUNT </b> -
- * The non-standard property key to use to set the indentation amount.
- * The "indent" key needs to have a value of "yes", and this
- * properties value is a the number of whitespaces to indent by per
- * indentation level.
- *
- * <li> <b>S_KEY_CONTENT_HANDLER </b> -
- * This non-standard property key is used to set the name of the fully qualified
- * Java class that implements the ContentHandler interface.
- * The output of the serializer will be SAX events sent to this an
- * object of this class.
- *
- * <li> <b>S_KEY_ENTITIES </b> -
- * This non-standard property key is used to specify the name of the property file
- * that specifies character to entity reference mappings. A line in such a
- * file is has the name of the entity and the numeric (base 10) value
- * of the corresponding character, like this one: <br> quot=34 <br>
- *
- * <li> <b>S_USE_URL_ESCAPING </b> -
- * This non-standard property key is used to set a value of "yes" if the href values for HTML serialization should
- * use %xx escaping.
- *
- * <li> <b>S_OMIT_META_TAG </b> -
- * This non-standard property key is used to set a value of "yes" if the META tag should be omitted where it would
- * otherwise be supplied.
- * </ul>
- *
- * @see SerializerFactory
- * @see Method
- * @see Serializer
- */
-public final class OutputPropertiesFactory
-{
- /** S_BUILTIN_EXTENSIONS_URL is a mnemonic for the XML Namespace
- *(http://xml.apache.org/xalan) predefined to signify Xalan's
- * built-in XSLT Extensions. When used in stylesheets, this is often
- * bound to the "xalan:" prefix.
- */
- private static final String
- S_BUILTIN_EXTENSIONS_URL = "http://xml.apache.org/xalan";
-
- /**
- * The old built-in extension url. It is still supported for
- * backward compatibility.
- */
- private static final String
- S_BUILTIN_OLD_EXTENSIONS_URL = "http://xml.apache.org/xslt";
-
- //************************************************************
- //* PUBLIC CONSTANTS
- //************************************************************
- /**
- * This is not a public API.
- * This is the built-in extensions namespace,
- * reexpressed in {namespaceURI} syntax
- * suitable for prepending to a localname to produce a "universal
- * name".
- */
- public static final String S_BUILTIN_EXTENSIONS_UNIVERSAL =
- "{" + S_BUILTIN_EXTENSIONS_URL + "}";
-
- // Some special Xalan keys.
-
- /**
- * The non-standard property key to use to set the
- * number of whitepaces to indent by, per indentation level,
- * if indent="yes".
- */
- public static final String S_KEY_INDENT_AMOUNT =
- S_BUILTIN_EXTENSIONS_UNIVERSAL + "indent-amount";
-
- /**
- * The non-standard property key to use to set the
- * number of whitepaces to indent by, per indentation level,
- * if indent="yes".
- */
- public static final String S_KEY_LINE_SEPARATOR =
- S_BUILTIN_EXTENSIONS_UNIVERSAL + "line-separator";
-
- /** This non-standard property key is used to set the name of the fully qualified
- * Java class that implements the ContentHandler interface.
- * Fully qualified name of class with a default constructor that
- * implements the ContentHandler interface, where the result tree events
- * will be sent to.
- */
-
- public static final String S_KEY_CONTENT_HANDLER =
- S_BUILTIN_EXTENSIONS_UNIVERSAL + "content-handler";
-
- /**
- * This non-standard property key is used to specify the name of the property file
- * that specifies character to entity reference mappings.
- */
- public static final String S_KEY_ENTITIES =
- S_BUILTIN_EXTENSIONS_UNIVERSAL + "entities";
-
- /**
- * This non-standard property key is used to set a value of "yes" if the href values for HTML serialization should
- * use %xx escaping. */
- public static final String S_USE_URL_ESCAPING =
- S_BUILTIN_EXTENSIONS_UNIVERSAL + "use-url-escaping";
-
- /**
- * This non-standard property key is used to set a value of "yes" if the META tag should be omitted where it would
- * otherwise be supplied.
- */
- public static final String S_OMIT_META_TAG =
- S_BUILTIN_EXTENSIONS_UNIVERSAL + "omit-meta-tag";
-
- /**
- * The old built-in extension namespace, this is not a public API.
- */
- public static final String S_BUILTIN_OLD_EXTENSIONS_UNIVERSAL =
- "{" + S_BUILTIN_OLD_EXTENSIONS_URL + "}";
-
- /**
- * This is not a public API, it is only public because it is used
- * by outside of this package,
- * it is the length of the old built-in extension namespace.
- */
- public static final int S_BUILTIN_OLD_EXTENSIONS_UNIVERSAL_LEN =
- S_BUILTIN_OLD_EXTENSIONS_UNIVERSAL.length();
-
- /**
- * This non-standard, Oracle-impl only property key is used as if OutputKeys.STANDALONE is specified but
- * without writing it out in the declaration; It can be used to reverse the change by Xalan patch 1495.
- * Since Xalan patch 1495 can cause incompatible behavior, this property is add for application to neutralize
- * the effect of Xalan patch 1495
- */
- /**
- * <p>Is Standalone</p>
- *
- * <ul>
- * <li>
- * <code>yes</code> to indicate the output is intended to be used as standalone
- * </li>
- * <li>
- * <code>no</code> has no effect.
- * </li>
- * </ul>
- */
- public static final String ORACLE_IS_STANDALONE = "http://www.oracle.com/xml/is-standalone";
-
- //************************************************************
- //* PRIVATE CONSTANTS
- //************************************************************
-
- private static final String S_XSLT_PREFIX = "xslt.output.";
- private static final int S_XSLT_PREFIX_LEN = S_XSLT_PREFIX.length();
- private static final String S_XALAN_PREFIX = "org.apache.xslt.";
- private static final int S_XALAN_PREFIX_LEN = S_XALAN_PREFIX.length();
-
- /** Synchronization object for lazy initialization of the above tables. */
- private static Integer m_synch_object = new Integer(1);
-
- /** the directory in which the various method property files are located */
- private static final String PROP_DIR = "com/sun/org/apache/xml/internal/serializer/";
- /** property file for default XML properties */
- private static final String PROP_FILE_XML = "output_xml.properties";
- /** property file for default TEXT properties */
- private static final String PROP_FILE_TEXT = "output_text.properties";
- /** property file for default HTML properties */
- private static final String PROP_FILE_HTML = "output_html.properties";
- /** property file for default UNKNOWN (Either XML or HTML, to be determined later) properties */
- private static final String PROP_FILE_UNKNOWN = "output_unknown.properties";
-
- //************************************************************
- //* PRIVATE STATIC FIELDS
- //************************************************************
-
- /** The default properties of all output files. */
- private static Properties m_xml_properties = null;
-
- /** The default properties when method="html". */
- private static Properties m_html_properties = null;
-
- /** The default properties when method="text". */
- private static Properties m_text_properties = null;
-
- /** The properties when method="" for the "unknown" wrapper */
- private static Properties m_unknown_properties = null;
-
- private static final Class
- ACCESS_CONTROLLER_CLASS = findAccessControllerClass();
-
- private static Class findAccessControllerClass() {
- try
- {
- // This Class was introduced in JDK 1.2. With the re-architecture of
- // security mechanism ( starting in JDK 1.2 ), we have option of
- // giving privileges to certain part of code using doPrivileged block.
- // In JDK1.1.X applications won't be having security manager and if
- // there is security manager ( in applets ), code need to be signed
- // and trusted for having access to resources.
-
- return Class.forName("java.security.AccessController");
- }
- catch (Exception e)
- {
- //User may be using older JDK ( JDK <1.2 ). Allow him/her to use it.
- // But don't try to use doPrivileged
- }
-
- return null;
- }
-
- /**
- * Creates an empty OutputProperties with the property key/value defaults specified by
- * a property file. The method argument is used to construct a string of
- * the form output_[method].properties (for instance, output_html.properties).
- * The output_xml.properties file is always used as the base.
- *
- * <p>Anything other than 'text', 'xml', and 'html', will
- * use the output_xml.properties file.</p>
- *
- * @param method non-null reference to method name.
- *
- * @return Properties object that holds the defaults for the given method.
- */
- static public final Properties getDefaultMethodProperties(String method)
- {
- String fileName = null;
- Properties defaultProperties = null;
- // According to this article : Double-check locking does not work
- // http://www.javaworld.com/javaworld/jw-02-2001/jw-0209-toolbox.html
- try
- {
- synchronized (m_synch_object)
- {
- if (null == m_xml_properties) // double check
- {
- fileName = PROP_FILE_XML;
- m_xml_properties = loadPropertiesFile(fileName, null);
- }
- }
-
- if (method.equals(Method.XML))
- {
- defaultProperties = m_xml_properties;
- }
- else if (method.equals(Method.HTML))
- {
- if (null == m_html_properties) // double check
- {
- fileName = PROP_FILE_HTML;
- m_html_properties =
- loadPropertiesFile(fileName, m_xml_properties);
- }
-
- defaultProperties = m_html_properties;
- }
- else if (method.equals(Method.TEXT))
- {
- if (null == m_text_properties) // double check
- {
- fileName = PROP_FILE_TEXT;
- m_text_properties =
- loadPropertiesFile(fileName, m_xml_properties);
- if (null
- == m_text_properties.getProperty(OutputKeys.ENCODING))
- {
- String mimeEncoding = Encodings.getMimeEncoding(null);
- m_text_properties.put(
- OutputKeys.ENCODING,
- mimeEncoding);
- }
- }
-
- defaultProperties = m_text_properties;
- }
- else if (method.equals(com.sun.org.apache.xml.internal.serializer.Method.UNKNOWN))
- {
- if (null == m_unknown_properties) // double check
- {
- fileName = PROP_FILE_UNKNOWN;
- m_unknown_properties =
- loadPropertiesFile(fileName, m_xml_properties);
- }
-
- defaultProperties = m_unknown_properties;
- }
- else
- {
- // TODO: Calculate res file from name.
- defaultProperties = m_xml_properties;
- }
- }
- catch (IOException ioe)
- {
- throw new WrappedRuntimeException(
- Utils.messages.createMessage(
- MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY,
- new Object[] { fileName, method }),
- ioe);
- }
- // wrap these cached defaultProperties in a new Property object just so
- // that the caller of this method can't modify the default values
- return new Properties(defaultProperties);
- }
-
- /**
- * Load the properties file from a resource stream. If a
- * key name such as "org.apache.xslt.xxx", fix up the start of
- * string to be a curly namespace. If a key name starts with
- * "xslt.output.xxx", clip off "xslt.output.". If a key name *or* a
- * key value is discovered, check for \u003a in the text, and
- * fix it up to be ":", since earlier versions of the JDK do not
- * handle the escape sequence (at least in key names).
- *
- * @param resourceName non-null reference to resource name.
- * @param defaults Default properties, which may be null.
- */
- static private Properties loadPropertiesFile(
- final String resourceName,
- Properties defaults)
- throws IOException
- {
-
- // This static method should eventually be moved to a thread-specific class
- // so that we can cache the ContextClassLoader and bottleneck all properties file
- // loading throughout Xalan.
-
- Properties props = new Properties(defaults);
-
- InputStream is = null;
- BufferedInputStream bis = null;
-
- try
- {
- if (ACCESS_CONTROLLER_CLASS != null)
- {
- is = (InputStream) AccessController
- .doPrivileged(new PrivilegedAction() {
- public Object run()
- {
- return OutputPropertiesFactory.class
- .getResourceAsStream(resourceName);
- }
- });
- }
- else
- {
- // User may be using older JDK ( JDK < 1.2 )
- is = OutputPropertiesFactory.class
- .getResourceAsStream(resourceName);
- }
-
- bis = new BufferedInputStream(is);
- props.load(bis);
- }
- catch (IOException ioe)
- {
- if (defaults == null)
- {
- throw ioe;
- }
- else
- {
- throw new WrappedRuntimeException(
- Utils.messages.createMessage(
- MsgKey.ER_COULD_NOT_LOAD_RESOURCE,
- new Object[] { resourceName }),
- ioe);
- //"Could not load '"+resourceName+"' (check CLASSPATH), now using just the defaults ", ioe);
- }
- }
- catch (SecurityException se)
- {
- // Repeat IOException handling for sandbox/applet case -sc
- if (defaults == null)
- {
- throw se;
- }
- else
- {
- throw new WrappedRuntimeException(
- Utils.messages.createMessage(
- MsgKey.ER_COULD_NOT_LOAD_RESOURCE,
- new Object[] { resourceName }),
- se);
- //"Could not load '"+resourceName+"' (check CLASSPATH, applet security), now using just the defaults ", se);
- }
- }
- finally
- {
- if (bis != null)
- {
- bis.close();
- }
- if (is != null)
- {
- is.close();
- }
- }
-
- // Note that we're working at the HashTable level here,
- // and not at the Properties level! This is important
- // because we don't want to modify the default properties.
- // NB: If fixupPropertyString ends up changing the property
- // name or value, we need to remove the old key and re-add
- // with the new key and value. However, then our Enumeration
- // could lose its place in the HashTable. So, we first
- // clone the HashTable and enumerate over that since the
- // clone will not change. When we migrate to Collections,
- // this code should be revisited and cleaned up to use
- // an Iterator which may (or may not) alleviate the need for
- // the clone. Many thanks to Padraig O'hIceadha
- // <padraig@gradient.ie> for finding this problem. Bugzilla 2000.
-
- Enumeration keys = ((Properties) props.clone()).keys();
- while (keys.hasMoreElements())
- {
- String key = (String) keys.nextElement();
- // Now check if the given key was specified as a
- // System property. If so, the system property
- // overides the default value in the propery file.
- String value = null;
- try
- {
- value = SecuritySupport.getSystemProperty(key);
- }
- catch (SecurityException se)
- {
- // No-op for sandbox/applet case, leave null -sc
- }
- if (value == null)
- value = (String) props.get(key);
-
- String newKey = fixupPropertyString(key, true);
- String newValue = null;
- try
- {
- newValue = SecuritySupport.getSystemProperty(newKey);
- }
- catch (SecurityException se)
- {
- // No-op for sandbox/applet case, leave null -sc
- }
- if (newValue == null)
- newValue = fixupPropertyString(value, false);
- else
- newValue = fixupPropertyString(newValue, false);
-
- if (key != newKey || value != newValue)
- {
- props.remove(key);
- props.put(newKey, newValue);
- }
-
- }
-
- return props;
- }
-
- /**
- * Fix up a string in an output properties file according to
- * the rules of {@link #loadPropertiesFile}.
- *
- * @param s non-null reference to string that may need to be fixed up.
- * @return A new string if fixup occured, otherwise the s argument.
- */
- static private String fixupPropertyString(String s, boolean doClipping)
- {
- int index;
- if (doClipping && s.startsWith(S_XSLT_PREFIX))
- {
- s = s.substring(S_XSLT_PREFIX_LEN);
- }
- if (s.startsWith(S_XALAN_PREFIX))
- {
- s =
- S_BUILTIN_EXTENSIONS_UNIVERSAL
- + s.substring(S_XALAN_PREFIX_LEN);
- }
- if ((index = s.indexOf("\\u003a")) > 0)
- {
- String temp = s.substring(index + 6);
- s = s.substring(0, index) + ":" + temp;
-
- }
- return s;
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/OutputPropertyUtils.java b/src/com/sun/org/apache/xml/internal/serializer/OutputPropertyUtils.java
deleted file mode 100644
index 7e4ccb9..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/OutputPropertyUtils.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: OutputPropertyUtils.java,v 1.2.4.1 2005/09/15 08:15:21 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.serializer;
-
-import java.util.Properties;
-
-/**
- * This class contains some static methods that act as helpers when parsing a
- * Java Property object.
- *
- * This class is not a public API.
- * It is only public because it is used outside of this package.
- *
- * @see java.util.Properties
- * @xsl.usage internal
- */
-public final class OutputPropertyUtils
-{
- /**
- * Searches for the boolean property with the specified key in the property list.
- * If the key is not found in this property list, the default property list,
- * and its defaults, recursively, are then checked. The method returns
- * <code>false</code> if the property is not found, or if the value is other
- * than "yes".
- *
- * @param key the property key.
- * @param props the list of properties that will be searched.
- * @return the value in this property list as a boolean value, or false
- * if null or not "yes".
- */
- public static boolean getBooleanProperty(String key, Properties props)
- {
-
- String s = props.getProperty(key);
-
- if (null == s || !s.equals("yes"))
- return false;
- else
- return true;
- }
-
- /**
- * Searches for the int property with the specified key in the property list.
- * If the key is not found in this property list, the default property list,
- * and its defaults, recursively, are then checked. The method returns
- * <code>false</code> if the property is not found, or if the value is other
- * than "yes".
- *
- * @param key the property key.
- * @param props the list of properties that will be searched.
- * @return the value in this property list as a int value, or 0
- * if null or not a number.
- */
- public static int getIntProperty(String key, Properties props)
- {
-
- String s = props.getProperty(key);
-
- if (null == s)
- return 0;
- else
- return Integer.parseInt(s);
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/SerializationHandler.java b/src/com/sun/org/apache/xml/internal/serializer/SerializationHandler.java
deleted file mode 100644
index 1e91855..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/SerializationHandler.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: SerializationHandler.java,v 1.2.4.1 2005/09/15 08:15:22 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.serializer;
-
-import java.io.IOException;
-
-import javax.xml.transform.Transformer;
-
-import org.w3c.dom.Node;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.SAXException;
-import org.xml.sax.ext.DeclHandler;
-
-/**
- * This interface is the one that a serializer implements. It is a group of
- * other interfaces, such as ExtendedContentHandler, ExtendedLexicalHandler etc.
- * In addition there are other methods, such as reset().
- *
- * This class is public only because it is used in another package,
- * it is not a public API.
- *
- * @xsl.usage internal
- */
-public interface SerializationHandler
- extends
- ExtendedContentHandler,
- ExtendedLexicalHandler,
- XSLOutputAttributes,
- DeclHandler,
- org.xml.sax.DTDHandler,
- ErrorHandler,
- DOMSerializer,
- Serializer
-{
- /**
- * Set the SAX Content handler that the serializer sends its output to. This
- * method only applies to a ToSAXHandler, not to a ToStream serializer.
- *
- * @see Serializer#asContentHandler()
- * @see ToSAXHandler
- */
- public void setContentHandler(ContentHandler ch);
-
- public void close();
-
- /**
- * Notify that the serializer should take this DOM node as input to be
- * serialized.
- *
- * @param node the DOM node to be serialized.
- * @throws IOException
- */
- public void serialize(Node node) throws IOException;
- /**
- * Turns special character escaping on/off.
- *
- * Note that characters will
- * never, even if this option is set to 'true', be escaped within
- * CDATA sections in output XML documents.
- *
- * @param escape true if escaping is to be set on.
- */
- public boolean setEscaping(boolean escape) throws SAXException;
-
- /**
- * Set the number of spaces to indent for each indentation level.
- * @param spaces the number of spaces to indent for each indentation level.
- */
- public void setIndentAmount(int spaces);
-
- /**
- * Set the transformer associated with the serializer.
- * @param transformer the transformer associated with the serializer.
- */
- public void setTransformer(Transformer transformer);
-
- /**
- * Get the transformer associated with the serializer.
- * @return Transformer the transformer associated with the serializer.
- */
- public Transformer getTransformer();
-
- /**
- * Used only by TransformerSnapshotImpl to restore the serialization
- * to a previous state.
- *
- * @param mappings NamespaceMappings
- */
- public void setNamespaceMappings(NamespaceMappings mappings);
-
- /**
- * Flush any pending events currently queued up in the serializer. This will
- * flush any input that the serializer has which it has not yet sent as
- * output.
- */
- public void flushPending() throws SAXException;
-
- /**
- * Default behavior is to expand DTD entities,
- * that is the initall default value is true.
- * @param expand true if DTD entities are to be expanded,
- * false if they are to be left as DTD entity references.
- */
- public void setDTDEntityExpansion(boolean expand);
-
- /**
- * Specify if the output will be treated as a standalone property
- * @param isStandalone true if the http://www.oracle.com/xml/is-standalone is set to yes
- * @see OutputPropertiesFactory ORACLE_IS_STANDALONE
- */
- public void setIsStandalone(boolean b);
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/Serializer.java b/src/com/sun/org/apache/xml/internal/serializer/Serializer.java
deleted file mode 100644
index 9cae2d2..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/Serializer.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Serializer.java,v 1.2.4.1 2005/09/15 08:15:22 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.serializer;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.Writer;
-import java.util.Properties;
-
-import org.xml.sax.ContentHandler;
-
-/**
- * The Serializer interface is implemented by a serializer to enable users to:
- * <ul>
- * <li>get and set streams or writers
- * <li>configure the serializer with key/value properties
- * <li>get an org.xml.sax.ContentHandler or a DOMSerializer to provide input to
- * </ul>
- *
- * <p>
- * Here is an example using the asContentHandler() method:
- * <pre>
- * java.util.Properties props =
- * OutputPropertiesFactory.getDefaultMethodProperties(Method.TEXT);
- * Serializer ser = SerializerFactory.getSerializer(props);
- * java.io.PrintStream ostream = System.out;
- * ser.setOutputStream(ostream);
- *
- * // Provide the SAX input events
- * ContentHandler handler = ser.asContentHandler();
- * handler.startDocument();
- * char[] chars = { 'a', 'b', 'c' };
- * handler.characters(chars, 0, chars.length);
- * handler.endDocument();
- *
- * ser.reset(); // get ready to use the serializer for another document
- * // of the same output method (TEXT).
- * </pre>
- *
- * <p>
- * As an alternate to supplying a series of SAX events as input through the
- * ContentHandler interface, the input to serialize may be given as a DOM.
- * <p>
- * For example:
- * <pre>
- * org.w3c.dom.Document inputDoc;
- * com.sun.org.apache.xml.internal.serializer.Serializer ser;
- * java.io.Writer owriter;
- *
- * java.util.Properties props =
- * OutputPropertiesFactory.getDefaultMethodProperties(Method.XML);
- * Serializer ser = SerializerFactory.getSerializer(props);
- * owriter = ...; // create a writer to serialize the document to
- * ser.setWriter( owriter );
- *
- * inputDoc = ...; // create the DOM document to be serialized
- * DOMSerializer dser = ser.asDOMSerializer(); // a DOM will be serialized
- * dser.serialize(inputDoc); // serialize the DOM, sending output to owriter
- *
- * ser.reset(); // get ready to use the serializer for another document
- * // of the same output method.
- * </pre>
- *
- * This interface is a public API.
- *
- * @see Method
- * @see OutputPropertiesFactory
- * @see SerializerFactory
- * @see DOMSerializer
- * @see ContentHandler
- *
- * @xsl.usage general
- */
-public interface Serializer {
-
- /**
- * Specifies an output stream to which the document should be
- * serialized. This method should not be called while the
- * serializer is in the process of serializing a document.
- * <p>
- * The encoding specified in the output {@link Properties} is used, or
- * if no encoding was specified, the default for the selected
- * output method.
- * <p>
- * Only one of setWriter() or setOutputStream() should be called.
- *
- * @param output The output stream
- */
- public void setOutputStream(OutputStream output);
-
- /**
- * Get the output stream where the events will be serialized to.
- *
- * @return reference to the result stream, or null if only a writer was
- * set.
- */
- public OutputStream getOutputStream();
-
- /**
- * Specifies a writer to which the document should be serialized.
- * This method should not be called while the serializer is in
- * the process of serializing a document.
- * <p>
- * The encoding specified for the output {@link Properties} must be
- * identical to the output format used with the writer.
- *
- * <p>
- * Only one of setWriter() or setOutputStream() should be called.
- *
- * @param writer The output writer stream
- */
- public void setWriter(Writer writer);
-
- /**
- * Get the character stream where the events will be serialized to.
- *
- * @return Reference to the result Writer, or null.
- */
- public Writer getWriter();
-
- /**
- * Specifies an output format for this serializer. It the
- * serializer has already been associated with an output format,
- * it will switch to the new format. This method should not be
- * called while the serializer is in the process of serializing
- * a document.
- * <p>
- * The standard property keys supported are: "method", "version", "encoding",
- * "omit-xml-declaration", "standalone", doctype-public",
- * "doctype-system", "cdata-section-elements", "indent", "media-type".
- * These property keys and their values are described in the XSLT recommendation,
- * see {@link <a href="http://www.w3.org/TR/1999/REC-xslt-19991116"> XSLT 1.0 recommendation</a>}
- * <p>
- * The non-standard property keys supported are defined in {@link OutputPropertiesFactory}.
- *
- * <p>
- * This method can be called multiple times before a document is serialized. Each
- * time it is called more, or over-riding property values, can be specified. One
- * property value that can not be changed is that of the "method" property key.
- * <p>
- * The value of the "cdata-section-elements" property key is a whitespace
- * separated list of elements. If the element is in a namespace then
- * value is passed in this format: {uri}localName
- * <p>
- * If the "cdata-section-elements" key is specified on multiple calls
- * to this method the set of elements specified in the value
- * is not replaced from one call to the
- * next, but it is cumulative across the calls.
- *
- * @param format The output format to use, as a set of key/value pairs.
- */
- public void setOutputFormat(Properties format);
-
- /**
- * Returns the output format properties for this serializer.
- *
- * @return The output format key/value pairs in use.
- */
- public Properties getOutputFormat();
-
- /**
- * Return a {@link ContentHandler} interface to provide SAX input to.
- * Through the returned object the document to be serailized,
- * as a series of SAX events, can be provided to the serialzier.
- * If the serializer does not support the {@link ContentHandler}
- * interface, it will return null.
- * <p>
- * In principle only one of asDOMSerializer() or asContentHander()
- * should be called.
- *
- * @return A {@link ContentHandler} interface into this serializer,
- * or null if the serializer is not SAX 2 capable
- * @throws IOException An I/O exception occured
- */
- public ContentHandler asContentHandler() throws IOException;
-
- /**
- * Return a {@link DOMSerializer} interface into this serializer.
- * Through the returned object the document to be serialized,
- * a DOM, can be provided to the serializer.
- * If the serializer does not support the {@link DOMSerializer}
- * interface, it should return null.
- * <p>
- * In principle only one of asDOMSerializer() or asContentHander()
- * should be called.
- *
- * @return A {@link DOMSerializer} interface into this serializer,
- * or null if the serializer is not DOM capable
- * @throws IOException An I/O exception occured
- */
- public DOMSerializer asDOMSerializer() throws IOException;
-
- /**
- * This method resets the serializer.
- * If this method returns true, the
- * serializer may be used for subsequent serialization of new
- * documents. It is possible to change the output format and
- * output stream prior to serializing, or to reuse the existing
- * output format and output stream or writer.
- *
- * @return True if serializer has been reset and can be reused
- */
- public boolean reset();
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/SerializerBase.java b/src/com/sun/org/apache/xml/internal/serializer/SerializerBase.java
deleted file mode 100644
index a477890..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/SerializerBase.java
+++ /dev/null
@@ -1,1402 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: SerializerBase.java,v 1.5 2006/04/14 12:09:19 sunithareddy Exp $
- */
-package com.sun.org.apache.xml.internal.serializer;
-
-import java.io.IOException;
-import java.util.Vector;
-
-import javax.xml.transform.SourceLocator;
-import javax.xml.transform.Transformer;
-
-import com.sun.org.apache.xml.internal.serializer.utils.MsgKey;
-import com.sun.org.apache.xml.internal.serializer.utils.Utils;
-import org.xml.sax.Attributes;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.ext.Locator2;
-
-
-/**
- * This class acts as a base class for the XML "serializers"
- * and the stream serializers.
- * It contains a number of common fields and methods.
- *
- * @xsl.usage internal
- */
-public abstract class SerializerBase
- implements SerializationHandler, SerializerConstants
-{
-
-
- /**
- * To fire off the end element trace event
- * @param name Name of element
- */
- protected void fireEndElem(String name)
- throws org.xml.sax.SAXException
- {
- if (m_tracer != null)
- {
- flushMyWriter();
- m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_ENDELEMENT,name, (Attributes)null);
- }
- }
-
- /**
- * Report the characters trace event
- * @param chars content of characters
- * @param start starting index of characters to output
- * @param length number of characters to output
- */
- protected void fireCharEvent(char[] chars, int start, int length)
- throws org.xml.sax.SAXException
- {
- if (m_tracer != null)
- {
- flushMyWriter();
- m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_CHARACTERS, chars, start,length);
- }
- }
-
- /**
- * true if we still need to call startDocumentInternal()
- */
- protected boolean m_needToCallStartDocument = true;
-
- /** True if a trailing "]]>" still needs to be written to be
- * written out. Used to merge adjacent CDATA sections
- */
- protected boolean m_cdataTagOpen = false;
-
- /**
- * All the attributes of the current element, collected from
- * startPrefixMapping() calls, or addAddtribute() calls, or
- * from the SAX attributes in a startElement() call.
- */
- protected AttributesImplSerializer m_attributes = new AttributesImplSerializer();
-
- /**
- * Tells if we're in an EntityRef event.
- */
- protected boolean m_inEntityRef = false;
-
- /** This flag is set while receiving events from the external DTD */
- protected boolean m_inExternalDTD = false;
-
- /**
- * The System ID for the doc type.
- */
- private String m_doctypeSystem;
-
- /**
- * The public ID for the doc type.
- */
- private String m_doctypePublic;
-
- /**
- * Flag to tell that we need to add the doctype decl, which we can't do
- * until the first element is encountered.
- */
- boolean m_needToOutputDocTypeDecl = true;
-
- /**
- * The character encoding. Must match the encoding used for the
- * printWriter.
- */
- private String m_encoding = null;
-
- /**
- * Tells if we should write the XML declaration.
- */
- private boolean m_shouldNotWriteXMLHeader = false;
-
- /**
- * The standalone value for the doctype.
- */
- private String m_standalone;
-
- /**
- * True if standalone was specified.
- */
- protected boolean m_standaloneWasSpecified = false;
-
- /**
- * Determine if the output is a standalone.
- */
- protected boolean m_isStandalone = false;
-
- /**
- * Flag to tell if indenting (pretty-printing) is on.
- */
- protected boolean m_doIndent = false;
- /**
- * Amount to indent.
- */
- protected int m_indentAmount = 0;
-
- /**
- * Tells the XML version, for writing out to the XML decl.
- */
- private String m_version = null;
-
- /**
- * The mediatype. Not used right now.
- */
- private String m_mediatype;
-
- /**
- * The transformer that was around when this output handler was created (if
- * any).
- */
- private Transformer m_transformer;
-
- /**
- * Pairs of local names and corresponding URIs of CDATA sections. This list
- * comes from the cdata-section-elements attribute. Every second one is a
- * local name, and every other second one is the URI for the local name.
- */
- protected Vector m_cdataSectionElements = null;
-
- /**
- * Namespace support, that keeps track of currently defined
- * prefix/uri mappings. As processed elements come and go, so do
- * the associated mappings for that element.
- */
- protected NamespaceMappings m_prefixMap;
-
- /**
- * Handle for firing generate events. This interface may be implemented
- * by the referenced transformer object.
- */
- protected SerializerTrace m_tracer;
-
- protected SourceLocator m_sourceLocator;
-
-
- /**
- * The writer to send output to. This field is only used in the ToStream
- * serializers, but exists here just so that the fireStartDoc() and
- * other fire... methods can flush this writer when tracing.
- */
- protected java.io.Writer m_writer = null;
-
- /**
- * A reference to "stack frame" corresponding to
- * the current element. Such a frame is pushed at a startElement()
- * and popped at an endElement(). This frame contains information about
- * the element, such as its namespace URI.
- */
- protected ElemContext m_elemContext = new ElemContext();
-
- /**
- * A utility buffer for converting Strings passed to
- * character() methods to character arrays.
- * Reusing this buffer means not creating a new character array
- * everytime and it runs faster.
- */
- protected char[] m_charsBuff = new char[60];
-
- /**
- * A utility buffer for converting Strings passed to
- * attribute methods to character arrays.
- * Reusing this buffer means not creating a new character array
- * everytime and it runs faster.
- */
- protected char[] m_attrBuff = new char[30];
-
- private Locator m_locator = null;
-
- protected boolean m_needToCallSetDocumentInfo = true;
-
- /**
- * Receive notification of a comment.
- *
- * @see ExtendedLexicalHandler#comment(String)
- */
- public void comment(String data) throws SAXException
- {
- final int length = data.length();
- if (length > m_charsBuff.length)
- {
- m_charsBuff = new char[length * 2 + 1];
- }
- data.getChars(0, length, m_charsBuff, 0);
- comment(m_charsBuff, 0, length);
- }
-
- /**
- * If at runtime, when the qname of the attribute is
- * known, another prefix is specified for the attribute, then we can
- * patch or hack the name with this method. For
- * a qname of the form "ns?:otherprefix:name", this function patches the
- * qname by simply ignoring "otherprefix".
- * TODO: This method is a HACK! We do not have access to the
- * XML file, it sometimes generates a NS prefix of the form "ns?" for
- * an attribute.
- */
- protected String patchName(String qname)
- {
-
-
- final int lastColon = qname.lastIndexOf(':');
-
- if (lastColon > 0) {
- final int firstColon = qname.indexOf(':');
- final String prefix = qname.substring(0, firstColon);
- final String localName = qname.substring(lastColon + 1);
-
- // If uri is "" then ignore prefix
- final String uri = m_prefixMap.lookupNamespace(prefix);
- if (uri != null && uri.length() == 0) {
- return localName;
- }
- else if (firstColon != lastColon) {
- return prefix + ':' + localName;
- }
- }
- return qname;
- }
-
- /**
- * Returns the local name of a qualified name. If the name has no prefix,
- * then it works as the identity (SAX2).
- * @param qname the qualified name
- * @return the name, but excluding any prefix and colon.
- */
- protected static String getLocalName(String qname)
- {
- final int col = qname.lastIndexOf(':');
- return (col > 0) ? qname.substring(col + 1) : qname;
- }
-
- /**
- * Receive an object for locating the origin of SAX document events.
- *
- * @param locator An object that can return the location of any SAX document
- * event.
- *
- * Receive an object for locating the origin of SAX document events.
- *
- * <p>SAX parsers are strongly encouraged (though not absolutely
- * required) to supply a locator: if it does so, it must supply
- * the locator to the application by invoking this method before
- * invoking any of the other methods in the DocumentHandler
- * interface.</p>
- *
- * <p>The locator allows the application to determine the end
- * position of any document-related event, even if the parser is
- * not reporting an error. Typically, the application will
- * use this information for reporting its own errors (such as
- * character content that does not match an application's
- * business rules). The information returned by the locator
- * is probably not sufficient for use with a search engine.</p>
- *
- * <p>Note that the locator will return correct information only
- * during the invocation of the events in this interface. The
- * application should not attempt to use it at any other time.</p>
- */
- public void setDocumentLocator(Locator locator)
- {
- m_locator = locator;
- }
-
- /**
- * Adds the given attribute to the set of collected attributes , but only if
- * there is a currently open element.
- *
- * An element is currently open if a startElement() notification has
- * occured but the start of the element has not yet been written to the
- * output. In the stream case this means that we have not yet been forced
- * to close the elements opening tag by another notification, such as a
- * character notification.
- *
- * @param uri the URI of the attribute
- * @param localName the local name of the attribute
- * @param rawName the qualified name of the attribute
- * @param type the type of the attribute (probably CDATA)
- * @param value the value of the attribute
- * @param XSLAttribute true if this attribute is coming from an xsl:attriute element
- * @see ExtendedContentHandler#addAttribute(String, String, String, String, String)
- */
- public void addAttribute(
- String uri,
- String localName,
- String rawName,
- String type,
- String value,
- boolean XSLAttribute)
- throws SAXException
- {
- if (m_elemContext.m_startTagOpen)
- {
- addAttributeAlways(uri, localName, rawName, type, value, XSLAttribute);
- }
-
- }
-
- /**
- * Adds the given attribute to the set of attributes, even if there is
- * no currently open element. This is useful if a SAX startPrefixMapping()
- * should need to add an attribute before the element name is seen.
- *
- * @param uri the URI of the attribute
- * @param localName the local name of the attribute
- * @param rawName the qualified name of the attribute
- * @param type the type of the attribute (probably CDATA)
- * @param value the value of the attribute
- * @param XSLAttribute true if this attribute is coming from an xsl:attribute element
- * @return true if the attribute was added,
- * false if an existing value was replaced.
- */
- public boolean addAttributeAlways(
- String uri,
- String localName,
- String rawName,
- String type,
- String value,
- boolean XSLAttribute)
- {
- boolean was_added;
-// final int index =
-// (localName == null || uri == null) ?
-// m_attributes.getIndex(rawName):m_attributes.getIndex(uri, localName);
- int index;
-// if (localName == null || uri == null){
-// index = m_attributes.getIndex(rawName);
-// }
-// else {
-// index = m_attributes.getIndex(uri, localName);
-// }
-
- if (localName == null || uri == null || uri.length() == 0)
- index = m_attributes.getIndex(rawName);
- else {
- index = m_attributes.getIndex(uri,localName);
- }
- if (index >= 0)
- {
- /* We've seen the attribute before.
- * We may have a null uri or localName, but all
- * we really want to re-set is the value anyway.
- */
- m_attributes.setValue(index,value);
- was_added = false;
- }
- else
- {
- // the attribute doesn't exist yet, create it
- m_attributes.addAttribute(uri, localName, rawName, type, value);
- was_added = true;
- }
- return was_added;
-
- }
-
-
- /**
- * Adds the given attribute to the set of collected attributes,
- * but only if there is a currently open element.
- *
- * @param name the attribute's qualified name
- * @param value the value of the attribute
- */
- public void addAttribute(String name, final String value)
- {
- if (m_elemContext.m_startTagOpen)
- {
- final String patchedName = patchName(name);
- final String localName = getLocalName(patchedName);
- final String uri = getNamespaceURI(patchedName, false);
-
- addAttributeAlways(uri,localName, patchedName, "CDATA", value, false);
- }
- }
-
- /**
- * Adds the given xsl:attribute to the set of collected attributes,
- * but only if there is a currently open element.
- *
- * @param name the attribute's qualified name (prefix:localName)
- * @param value the value of the attribute
- * @param uri the URI that the prefix of the name points to
- */
- public void addXSLAttribute(String name, final String value, final String uri)
- {
- if (m_elemContext.m_startTagOpen)
- {
- final String patchedName = patchName(name);
- final String localName = getLocalName(patchedName);
-
- addAttributeAlways(uri,localName, patchedName, "CDATA", value, true);
- }
- }
-
- /**
- * Add the given attributes to the currently collected ones. These
- * attributes are always added, regardless of whether on not an element
- * is currently open.
- * @param atts List of attributes to add to this list
- */
- public void addAttributes(Attributes atts) throws SAXException
- {
-
- int nAtts = atts.getLength();
- for (int i = 0; i < nAtts; i++)
- {
- String uri = atts.getURI(i);
-
- if (null == uri)
- uri = "";
-
- addAttributeAlways(
- uri,
- atts.getLocalName(i),
- atts.getQName(i),
- atts.getType(i),
- atts.getValue(i),
- false);
-
- }
- }
-
- /**
- * Return a {@link ContentHandler} interface into this serializer.
- * If the serializer does not support the {@link ContentHandler}
- * interface, it should return null.
- *
- * @return A {@link ContentHandler} interface into this serializer,
- * or null if the serializer is not SAX 2 capable
- * @throws IOException An I/O exception occured
- */
- public ContentHandler asContentHandler() throws IOException
- {
- return this;
- }
-
- /**
- * Report the end of an entity.
- *
- * @param name The name of the entity that is ending.
- * @throws org.xml.sax.SAXException The application may raise an exception.
- * @see #startEntity
- */
- public void endEntity(String name) throws org.xml.sax.SAXException
- {
- if (name.equals("[dtd]"))
- m_inExternalDTD = false;
- m_inEntityRef = false;
-
- if (m_tracer != null)
- this.fireEndEntity(name);
- }
-
- /**
- * Flush and close the underlying java.io.Writer. This method applies to
- * ToStream serializers, not ToSAXHandler serializers.
- * @see ToStream
- */
- public void close()
- {
- // do nothing (base behavior)
- }
-
- /**
- * Initialize global variables
- */
- protected void initCDATA()
- {
- // CDATA stack
- // _cdataStack = new Stack();
- // _cdataStack.push(new Integer(-1)); // push dummy value
- }
-
- /**
- * Returns the character encoding to be used in the output document.
- * @return the character encoding to be used in the output document.
- */
- public String getEncoding()
- {
- return m_encoding;
- }
-
- /**
- * Sets the character encoding coming from the xsl:output encoding stylesheet attribute.
- * @param m_encoding the character encoding
- */
- public void setEncoding(String m_encoding)
- {
- this.m_encoding = m_encoding;
- }
-
- /**
- * Sets the value coming from the xsl:output omit-xml-declaration stylesheet attribute
- * @param b true if the XML declaration is to be omitted from the output
- * document.
- */
- public void setOmitXMLDeclaration(boolean b)
- {
- this.m_shouldNotWriteXMLHeader = b;
- }
-
-
- /**
- * @return true if the XML declaration is to be omitted from the output
- * document.
- */
- public boolean getOmitXMLDeclaration()
- {
- return m_shouldNotWriteXMLHeader;
- }
-
- /**
- * Returns the previously set value of the value to be used as the public
- * identifier in the document type declaration (DTD).
- *
- *@return the public identifier to be used in the DOCTYPE declaration in the
- * output document.
- */
- public String getDoctypePublic()
- {
- return m_doctypePublic;
- }
-
- /** Set the value coming from the xsl:output doctype-public stylesheet attribute.
- * @param doctypePublic the public identifier to be used in the DOCTYPE
- * declaration in the output document.
- */
- public void setDoctypePublic(String doctypePublic)
- {
- this.m_doctypePublic = doctypePublic;
- }
-
-
- /**
- * Returns the previously set value of the value to be used
- * as the system identifier in the document type declaration (DTD).
- * @return the system identifier to be used in the DOCTYPE declaration in
- * the output document.
- *
- */
- public String getDoctypeSystem()
- {
- return m_doctypeSystem;
- }
-
- /** Set the value coming from the xsl:output doctype-system stylesheet attribute.
- * @param doctypeSystem the system identifier to be used in the DOCTYPE
- * declaration in the output document.
- */
- public void setDoctypeSystem(String doctypeSystem)
- {
- this.m_doctypeSystem = doctypeSystem;
- }
-
- /** Set the value coming from the xsl:output doctype-public and doctype-system stylesheet properties
- * @param doctypeSystem the system identifier to be used in the DOCTYPE
- * declaration in the output document.
- * @param doctypePublic the public identifier to be used in the DOCTYPE
- * declaration in the output document.
- */
- public void setDoctype(String doctypeSystem, String doctypePublic)
- {
- this.m_doctypeSystem = doctypeSystem;
- this.m_doctypePublic = doctypePublic;
- }
-
- /**
- * Sets the value coming from the xsl:output standalone stylesheet attribute.
- * @param standalone a value of "yes" indicates that the
- * <code>standalone</code> delaration is to be included in the output
- * document. This method remembers if the value was explicitly set using
- * this method, verses if the value is the default value.
- */
- public void setStandalone(String standalone)
- {
- if (standalone != null)
- {
- m_standaloneWasSpecified = true;
- setStandaloneInternal(standalone);
- }
- }
- /**
- * Sets the XSL standalone attribute, but does not remember if this is a
- * default or explicite setting.
- * @param standalone "yes" | "no"
- */
- protected void setStandaloneInternal(String standalone)
- {
- if ("yes".equals(standalone))
- m_standalone = "yes";
- else
- m_standalone = "no";
-
- }
-
- /**
- * Gets the XSL standalone attribute
- * @return a value of "yes" if the <code>standalone</code> delaration is to
- * be included in the output document.
- * @see XSLOutputAttributes#getStandalone()
- */
- public String getStandalone()
- {
- return m_standalone;
- }
-
- /**
- * @return true if the output document should be indented to visually
- * indicate its structure.
- */
- public boolean getIndent()
- {
- return m_doIndent;
- }
- /**
- * Gets the mediatype the media-type or MIME type associated with the output
- * document.
- * @return the mediatype the media-type or MIME type associated with the
- * output document.
- */
- public String getMediaType()
- {
- return m_mediatype;
- }
-
- /**
- * Gets the version of the output format.
- * @return the version of the output format.
- */
- public String getVersion()
- {
- return m_version;
- }
-
- /**
- * Sets the value coming from the xsl:output version attribute.
- * @param version the version of the output format.
- * @see SerializationHandler#setVersion(String)
- */
- public void setVersion(String version)
- {
- m_version = version;
- }
-
- /**
- * Sets the value coming from the xsl:output media-type stylesheet attribute.
- * @param mediaType the non-null media-type or MIME type associated with the
- * output document.
- * @see javax.xml.transform.OutputKeys#MEDIA_TYPE
- * @see SerializationHandler#setMediaType(String)
- */
- public void setMediaType(String mediaType)
- {
- m_mediatype = mediaType;
- }
-
- /**
- * @return the number of spaces to indent for each indentation level.
- */
- public int getIndentAmount()
- {
- return m_indentAmount;
- }
-
- /**
- * Sets the indentation amount.
- * @param m_indentAmount The m_indentAmount to set
- */
- public void setIndentAmount(int m_indentAmount)
- {
- this.m_indentAmount = m_indentAmount;
- }
-
- /**
- * Sets the value coming from the xsl:output indent stylesheet
- * attribute.
- * @param doIndent true if the output document should be indented to
- * visually indicate its structure.
- * @see XSLOutputAttributes#setIndent(boolean)
- */
- public void setIndent(boolean doIndent)
- {
- m_doIndent = doIndent;
- }
-
- /**
- * Sets the isStandalone property
- * @param isStandalone true if the ORACLE_IS_STANDALONE is set to yes
- * @see OutputPropertiesFactory ORACLE_IS_STANDALONE
- */
- public void setIsStandalone(boolean isStandalone)
- {
- m_isStandalone = isStandalone;
- }
-
- /**
- * This method is used when a prefix/uri namespace mapping
- * is indicated after the element was started with a
- * startElement() and before and endElement().
- * startPrefixMapping(prefix,uri) would be used before the
- * startElement() call.
- * @param uri the URI of the namespace
- * @param prefix the prefix associated with the given URI.
- *
- * @see ExtendedContentHandler#namespaceAfterStartElement(String, String)
- */
- public void namespaceAfterStartElement(String uri, String prefix)
- throws SAXException
- {
- // default behavior is to do nothing
- }
-
- /**
- * Return a {@link DOMSerializer} interface into this serializer. If the
- * serializer does not support the {@link DOMSerializer} interface, it should
- * return null.
- *
- * @return A {@link DOMSerializer} interface into this serializer, or null
- * if the serializer is not DOM capable
- * @throws IOException An I/O exception occured
- * @see Serializer#asDOMSerializer()
- */
- public DOMSerializer asDOMSerializer() throws IOException
- {
- return this;
- }
-
- /**
- * Push a boolean state based on if the name of the current element
- * is found in the list of qnames. A state is only pushed if
- * there were some cdata-section-names were specified.
- * <p>
- * Hidden parameters are the vector of qualified elements specified in
- * cdata-section-names attribute, and the m_cdataSectionStates stack
- * onto which whether the current element is in the list is pushed (true or
- * false). Other hidden parameters are the current elements namespaceURI,
- * localName and qName
- */
- protected boolean isCdataSection()
- {
-
- boolean b = false;
-
- if (null != m_cdataSectionElements)
- {
- if (m_elemContext.m_elementLocalName == null)
- m_elemContext.m_elementLocalName =
- getLocalName(m_elemContext.m_elementName);
- if (m_elemContext.m_elementURI == null)
- {
- String prefix = getPrefixPart(m_elemContext.m_elementName);
- if (prefix != null)
- m_elemContext.m_elementURI =
- m_prefixMap.lookupNamespace(prefix);
-
- }
-
- if ((null != m_elemContext.m_elementURI)
- && m_elemContext.m_elementURI.length() == 0)
- m_elemContext.m_elementURI = null;
-
- int nElems = m_cdataSectionElements.size();
-
- // loop through 2 at a time, as these are pairs of URI and localName
- for (int i = 0; i < nElems; i += 2)
- {
- String uri = (String) m_cdataSectionElements.elementAt(i);
- String loc = (String) m_cdataSectionElements.elementAt(i + 1);
- if (loc.equals(m_elemContext.m_elementLocalName)
- && subPartMatch(m_elemContext.m_elementURI, uri))
- {
- b = true;
-
- break;
- }
- }
- }
- return b;
- }
-
- /**
- * Tell if two strings are equal, without worry if the first string is null.
- *
- * @param p String reference, which may be null.
- * @param t String reference, which may be null.
- *
- * @return true if strings are equal.
- */
- private static final boolean subPartMatch(String p, String t)
- {
- return (p == t) || ((null != p) && (p.equals(t)));
- }
-
- /**
- * Returns the local name of a qualified name.
- * If the name has no prefix,
- * then it works as the identity (SAX2).
- *
- * @param qname a qualified name
- * @return returns the prefix of the qualified name,
- * or null if there is no prefix.
- */
- protected static final String getPrefixPart(String qname)
- {
- final int col = qname.indexOf(':');
- return (col > 0) ? qname.substring(0, col) : null;
- //return (col > 0) ? qname.substring(0,col) : "";
- }
-
- /**
- * Some users of the serializer may need the current namespace mappings
- * @return the current namespace mappings (prefix/uri)
- * @see ExtendedContentHandler#getNamespaceMappings()
- */
- public NamespaceMappings getNamespaceMappings()
- {
- return m_prefixMap;
- }
-
- /**
- * Returns the prefix currently pointing to the given URI (if any).
- * @param namespaceURI the uri of the namespace in question
- * @return a prefix pointing to the given URI (if any).
- * @see ExtendedContentHandler#getPrefix(String)
- */
- public String getPrefix(String namespaceURI)
- {
- String prefix = m_prefixMap.lookupPrefix(namespaceURI);
- return prefix;
- }
-
- /**
- * Returns the URI of an element or attribute. Note that default namespaces
- * do not apply directly to attributes.
- * @param qname a qualified name
- * @param isElement true if the qualified name is the name of
- * an element.
- * @return returns the namespace URI associated with the qualified name.
- */
- public String getNamespaceURI(String qname, boolean isElement)
- {
- String uri = EMPTYSTRING;
- int col = qname.lastIndexOf(':');
- final String prefix = (col > 0) ? qname.substring(0, col) : EMPTYSTRING;
-
- if (!EMPTYSTRING.equals(prefix) || isElement)
- {
- if (m_prefixMap != null)
- {
- uri = m_prefixMap.lookupNamespace(prefix);
- if (uri == null && !prefix.equals(XMLNS_PREFIX))
- {
- throw new RuntimeException(
- Utils.messages.createMessage(
- MsgKey.ER_NAMESPACE_PREFIX,
- new Object[] { qname.substring(0, col) } ));
- }
- }
- }
- return uri;
- }
-
- /**
- * Returns the URI of prefix (if any)
- *
- * @param prefix the prefix whose URI is searched for
- * @return the namespace URI currently associated with the
- * prefix, null if the prefix is undefined.
- */
- public String getNamespaceURIFromPrefix(String prefix)
- {
- String uri = null;
- if (m_prefixMap != null)
- uri = m_prefixMap.lookupNamespace(prefix);
- return uri;
- }
-
- /**
- * Entity reference event.
- *
- * @param name Name of entity
- *
- * @throws org.xml.sax.SAXException
- */
- public void entityReference(String name) throws org.xml.sax.SAXException
- {
-
- flushPending();
-
- startEntity(name);
- endEntity(name);
-
- if (m_tracer != null)
- fireEntityReference(name);
- }
-
- /**
- * Sets the transformer associated with this serializer
- * @param t the transformer associated with this serializer.
- * @see SerializationHandler#setTransformer(Transformer)
- */
- public void setTransformer(Transformer t)
- {
- m_transformer = t;
-
- // If this transformer object implements the SerializerTrace interface
- // then assign m_tracer to the transformer object so it can be used
- // to fire trace events.
- if ((m_transformer instanceof SerializerTrace) &&
- (((SerializerTrace) m_transformer).hasTraceListeners())) {
- m_tracer = (SerializerTrace) m_transformer;
- } else {
- m_tracer = null;
- }
- }
- /**
- * Gets the transformer associated with this serializer
- * @return returns the transformer associated with this serializer.
- * @see SerializationHandler#getTransformer()
- */
- public Transformer getTransformer()
- {
- return m_transformer;
- }
-
- /**
- * This method gets the nodes value as a String and uses that String as if
- * it were an input character notification.
- * @param node the Node to serialize
- * @throws org.xml.sax.SAXException
- */
- public void characters(org.w3c.dom.Node node)
- throws org.xml.sax.SAXException
- {
- flushPending();
- String data = node.getNodeValue();
- if (data != null)
- {
- final int length = data.length();
- if (length > m_charsBuff.length)
- {
- m_charsBuff = new char[length * 2 + 1];
- }
- data.getChars(0, length, m_charsBuff, 0);
- characters(m_charsBuff, 0, length);
- }
- }
-
-
- /**
- * @see org.xml.sax.ErrorHandler#error(SAXParseException)
- */
- public void error(SAXParseException exc) throws SAXException {
- }
-
- /**
- * @see org.xml.sax.ErrorHandler#fatalError(SAXParseException)
- */
- public void fatalError(SAXParseException exc) throws SAXException {
-
- m_elemContext.m_startTagOpen = false;
-
- }
-
- /**
- * @see org.xml.sax.ErrorHandler#warning(SAXParseException)
- */
- public void warning(SAXParseException exc) throws SAXException
- {
- }
-
- /**
- * To fire off start entity trace event
- * @param name Name of entity
- */
- protected void fireStartEntity(String name)
- throws org.xml.sax.SAXException
- {
- if (m_tracer != null)
- {
- flushMyWriter();
- m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_ENTITYREF, name);
- }
- }
-
- /**
- * Report the characters event
- * @param chars content of characters
- * @param start starting index of characters to output
- * @param length number of characters to output
- */
-// protected void fireCharEvent(char[] chars, int start, int length)
-// throws org.xml.sax.SAXException
-// {
-// if (m_tracer != null)
-// m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_CHARACTERS, chars, start,length);
-// }
-//
-
- /**
- * This method is only used internally when flushing the writer from the
- * various fire...() trace events. Due to the writer being wrapped with
- * SerializerTraceWriter it may cause the flush of these trace events:
- * EVENTTYPE_OUTPUT_PSEUDO_CHARACTERS
- * EVENTTYPE_OUTPUT_CHARACTERS
- * which trace the output written to the output stream.
- *
- */
- private void flushMyWriter()
- {
- if (m_writer != null)
- {
- try
- {
- m_writer.flush();
- }
- catch(IOException ioe)
- {
-
- }
- }
- }
- /**
- * Report the CDATA trace event
- * @param chars content of CDATA
- * @param start starting index of characters to output
- * @param length number of characters to output
- */
- protected void fireCDATAEvent(char[] chars, int start, int length)
- throws org.xml.sax.SAXException
- {
- if (m_tracer != null)
- {
- flushMyWriter();
- m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_CDATA, chars, start,length);
- }
- }
-
- /**
- * Report the comment trace event
- * @param chars content of comment
- * @param start starting index of comment to output
- * @param length number of characters to output
- */
- protected void fireCommentEvent(char[] chars, int start, int length)
- throws org.xml.sax.SAXException
- {
- if (m_tracer != null)
- {
- flushMyWriter();
- m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_COMMENT, new String(chars, start, length));
- }
- }
-
-
- /**
- * To fire off end entity trace event
- * @param name Name of entity
- */
- public void fireEndEntity(String name)
- throws org.xml.sax.SAXException
- {
- if (m_tracer != null)
- flushMyWriter();
- // we do not need to handle this.
- }
-
- /**
- * To fire off start document trace event
- */
- protected void fireStartDoc()
- throws org.xml.sax.SAXException
- {
- if (m_tracer != null)
- {
- flushMyWriter();
- m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_STARTDOCUMENT);
- }
- }
-
-
- /**
- * To fire off end document trace event
- */
- protected void fireEndDoc()
- throws org.xml.sax.SAXException
- {
- if (m_tracer != null)
- {
- flushMyWriter();
- m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_ENDDOCUMENT);
- }
- }
-
- /**
- * Report the start element trace event. This trace method needs to be
- * called just before the attributes are cleared.
- *
- * @param elemName the qualified name of the element
- *
- */
- protected void fireStartElem(String elemName)
- throws org.xml.sax.SAXException
- {
- if (m_tracer != null)
- {
- flushMyWriter();
- m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_STARTELEMENT,
- elemName, m_attributes);
- }
- }
-
-
- /**
- * To fire off the end element event
- * @param name Name of element
- */
-// protected void fireEndElem(String name)
-// throws org.xml.sax.SAXException
-// {
-// if (m_tracer != null)
-// m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_ENDELEMENT,name, (Attributes)null);
-// }
-
-
- /**
- * To fire off the PI trace event
- * @param name Name of PI
- */
- protected void fireEscapingEvent(String name, String data)
- throws org.xml.sax.SAXException
- {
-
- if (m_tracer != null)
- {
- flushMyWriter();
- m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_PI,name, data);
- }
- }
-
-
- /**
- * To fire off the entity reference trace event
- * @param name Name of entity reference
- */
- protected void fireEntityReference(String name)
- throws org.xml.sax.SAXException
- {
- if (m_tracer != null)
- {
- flushMyWriter();
- m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_ENTITYREF,name, (Attributes)null);
- }
- }
-
- /**
- * Receive notification of the beginning of a document.
- * This method is never a self generated call,
- * but only called externally.
- *
- * <p>The SAX parser will invoke this method only once, before any
- * other methods in this interface or in DTDHandler (except for
- * setDocumentLocator).</p>
- *
- * @throws org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- *
- * @throws org.xml.sax.SAXException
- */
- public void startDocument() throws org.xml.sax.SAXException
- {
-
- // if we do get called with startDocument(), handle it right away
- startDocumentInternal();
- m_needToCallStartDocument = false;
- return;
- }
-
- /**
- * This method handles what needs to be done at a startDocument() call,
- * whether from an external caller, or internally called in the
- * serializer. For historical reasons the serializer is flexible to
- * startDocument() not always being called.
- * Even if no external call is
- * made into startDocument() this method will always be called as a self
- * generated internal startDocument, it handles what needs to be done at a
- * startDocument() call.
- *
- * This method exists just to make sure that startDocument() is only ever
- * called from an external caller, which in principle is just a matter of
- * style.
- *
- * @throws SAXException
- */
- protected void startDocumentInternal() throws org.xml.sax.SAXException
- {
- if (m_tracer != null)
- this.fireStartDoc();
-
- }
-
- /* This method extracts version and encoding information from SAX events.
- */
- protected void setDocumentInfo() {
- if (m_locator == null)
- return;
- try{
- String strVersion = ((Locator2)m_locator).getXMLVersion();
- if (strVersion != null)
- setVersion(strVersion);
- /*String strEncoding = ((Locator2)m_locator).getEncoding();
- if (strEncoding != null)
- setEncoding(strEncoding); */
-
- }catch(ClassCastException e){}
- }
-
- /**
- * This method is used to set the source locator, which might be used to
- * generated an error message.
- * @param locator the source locator
- *
- * @see ExtendedContentHandler#setSourceLocator(javax.xml.transform.SourceLocator)
- */
- public void setSourceLocator(SourceLocator locator)
- {
- m_sourceLocator = locator;
- }
-
-
- /**
- * Used only by TransformerSnapshotImpl to restore the serialization
- * to a previous state.
- *
- * @param mappings NamespaceMappings
- */
- public void setNamespaceMappings(NamespaceMappings mappings) {
- m_prefixMap = mappings;
- }
-
- public boolean reset()
- {
- resetSerializerBase();
- return true;
- }
-
- /**
- * Reset all of the fields owned by SerializerBase
- *
- */
- private void resetSerializerBase()
- {
- this.m_attributes.clear();
- this.m_cdataSectionElements = null;
- this.m_elemContext = new ElemContext();
- this.m_doctypePublic = null;
- this.m_doctypeSystem = null;
- this.m_doIndent = false;
- this.m_encoding = null;
- this.m_indentAmount = 0;
- this.m_inEntityRef = false;
- this.m_inExternalDTD = false;
- this.m_mediatype = null;
- this.m_needToCallStartDocument = true;
- this.m_needToOutputDocTypeDecl = false;
- if (this.m_prefixMap != null)
- this.m_prefixMap.reset();
- this.m_shouldNotWriteXMLHeader = false;
- this.m_sourceLocator = null;
- this.m_standalone = null;
- this.m_standaloneWasSpecified = false;
- this.m_tracer = null;
- this.m_transformer = null;
- this.m_version = null;
- // don't set writer to null, so that it might be re-used
- //this.m_writer = null;
- }
-
- /**
- * Returns true if the serializer is used for temporary output rather than
- * final output.
- *
- * This concept is made clear in the XSLT 2.0 draft.
- */
- final boolean inTemporaryOutputState()
- {
- /* This is a hack. We should really be letting the serializer know
- * that it is in temporary output state with an explicit call, but
- * from a pragmatic point of view (for now anyways) having no output
- * encoding at all, not even the default UTF-8 indicates that the serializer
- * is being used for temporary RTF.
- */
- return (getEncoding() == null);
-
- }
-
- /**
- * This method adds an attribute the the current element,
- * but should not be used for an xsl:attribute child.
- * @see ExtendedContentHandler#addAttribute(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)
- */
- public void addAttribute(String uri, String localName, String rawName, String type, String value) throws SAXException
- {
- if (m_elemContext.m_startTagOpen)
- {
- addAttributeAlways(uri, localName, rawName, type, value, false);
- }
- }
-
- /**
- * @see org.xml.sax.DTDHandler#notationDecl(java.lang.String, java.lang.String, java.lang.String)
- */
- public void notationDecl(String arg0, String arg1, String arg2)
- throws SAXException {
- // This method just provides a definition to satisfy the interface
- // A particular sub-class of SerializerBase provides the implementation (if desired)
- }
-
- /**
- * @see org.xml.sax.DTDHandler#unparsedEntityDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
- */
- public void unparsedEntityDecl(
- String arg0,
- String arg1,
- String arg2,
- String arg3)
- throws SAXException {
- // This method just provides a definition to satisfy the interface
- // A particular sub-class of SerializerBase provides the implementation (if desired)
- }
-
- /**
- * If set to false the serializer does not expand DTD entities,
- * but leaves them as is, the default value is true.
- */
- public void setDTDEntityExpansion(boolean expand) {
- // This method just provides a definition to satisfy the interface
- // A particular sub-class of SerializerBase provides the implementation (if desired)
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/SerializerConstants.java b/src/com/sun/org/apache/xml/internal/serializer/SerializerConstants.java
deleted file mode 100644
index c8a4fce..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/SerializerConstants.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: SerializerConstants.java,v 1.2.4.1 2005/09/15 08:15:23 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.serializer;
-
-/**
- * Constants used in serialization, such as the string "xmlns"
- * @xsl.usage internal
- */
-interface SerializerConstants
-{
-
- /** To insert ]]> in a CDATA section by ending the last CDATA section with
- * ]] and starting the next CDATA section with >
- */
- static final String CDATA_CONTINUE = "]]]]><![CDATA[>";
- /**
- * The constant "]]>"
- */
- static final String CDATA_DELIMITER_CLOSE = "]]>";
- static final String CDATA_DELIMITER_OPEN = "<![CDATA[";
-
- static final String EMPTYSTRING = "";
-
- static final String ENTITY_AMP = "&amp;";
- static final String ENTITY_CRLF = "&#xA;";
- static final String ENTITY_GT = "&gt;";
- static final String ENTITY_LT = "&lt;";
- static final String ENTITY_QUOT = "&quot;";
-
- static final String XML_PREFIX = "xml";
- static final String XMLNS_PREFIX = "xmlns";
- static final String XMLNS_URI = "http://www.w3.org/2000/xmlns/";
-
- public static final String DEFAULT_SAX_SERIALIZER="com.sun.org.apache.xml.internal.serializer.ToXMLSAXHandler";
-
- /**
- * Define the XML version.
- */
- static final String XMLVERSION11 = "1.1";
- static final String XMLVERSION10 = "1.0";
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/SerializerFactory.java b/src/com/sun/org/apache/xml/internal/serializer/SerializerFactory.java
deleted file mode 100644
index 28139c3..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/SerializerFactory.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: SerializerFactory.java,v 1.2.4.1 2005/09/15 08:15:24 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.serializer;
-
-import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
-import com.sun.org.apache.xml.internal.serializer.utils.MsgKey;
-import com.sun.org.apache.xml.internal.serializer.utils.Utils;
-import java.util.Properties;
-import javax.xml.transform.OutputKeys;
-import org.xml.sax.ContentHandler;
-
-/**
- * This class is a public API, it is a factory for creating serializers.
- *
- * The properties object passed to the getSerializer() method should be created by
- * the OutputPropertiesFactory. Although the properties object
- * used to create a serializer does not need to be obtained
- * from OutputPropertiesFactory,
- * using this factory ensures that the default key/value properties
- * are set for the given output "method".
- *
- * <p>
- * The standard property keys supported are: "method", "version", "encoding",
- * "omit-xml-declaration", "standalone", doctype-public",
- * "doctype-system", "cdata-section-elements", "indent", "media-type".
- * These property keys and their values are described in the XSLT recommendation,
- * see {@link <a href="http://www.w3.org/TR/1999/REC-xslt-19991116"> XSLT 1.0 recommendation</a>}
- *
- * <p>
- * The value of the "cdata-section-elements" property key is a whitespace
- * separated list of elements. If the element is in a namespace then
- * value is passed in this format: {uri}localName
- *
- * <p>
- * The non-standard property keys supported are defined in {@link OutputPropertiesFactory}.
- *
- * @see OutputPropertiesFactory
- * @see Method
- * @see Serializer
- */
-public final class SerializerFactory
-{
- /**
- * This constructor is private just to prevent the creation of such an object.
- */
-
- private SerializerFactory() {
-
- }
-
- /**
- * Returns a serializer for the specified output method. The output method
- * is specified by the value of the property associated with the "method" key.
- * If no implementation exists that supports the specified output method
- * an exception of some type will be thrown.
- * For a list of the output "method" key values see {@link Method}.
- *
- * @param format The output format, minimally the "method" property must be set.
- * @return A suitable serializer.
- * @throws IllegalArgumentException if method is
- * null or an appropriate serializer can't be found
- * @throws Exception if the class for the serializer is found but does not
- * implement ContentHandler.
- * @throws WrappedRuntimeException if an exception is thrown while trying to find serializer
- */
- public static Serializer getSerializer(Properties format)
- {
- Serializer ser;
-
- try
- {
- String method = format.getProperty(OutputKeys.METHOD);
-
- if (method == null) {
- String msg = Utils.messages.createMessage(
- MsgKey.ER_FACTORY_PROPERTY_MISSING,
- new Object[] { OutputKeys.METHOD});
- throw new IllegalArgumentException(msg);
- }
-
- String className =
- format.getProperty(OutputPropertiesFactory.S_KEY_CONTENT_HANDLER);
-
-
- if (null == className)
- {
- // Missing Content Handler property, load default using OutputPropertiesFactory
- Properties methodDefaults =
- OutputPropertiesFactory.getDefaultMethodProperties(method);
- className =
- methodDefaults.getProperty(OutputPropertiesFactory.S_KEY_CONTENT_HANDLER);
- if (null == className) {
- String msg = Utils.messages.createMessage(
- MsgKey.ER_FACTORY_PROPERTY_MISSING,
- new Object[] { OutputPropertiesFactory.S_KEY_CONTENT_HANDLER});
- throw new IllegalArgumentException(msg);
- }
-
- }
-
-
-
- Class cls = ObjectFactory.findProviderClass(className, true);
-
- // _serializers.put(method, cls);
-
- Object obj = cls.newInstance();
-
- if (obj instanceof SerializationHandler)
- {
- // this is one of the supplied serializers
- ser = (Serializer) cls.newInstance();
- ser.setOutputFormat(format);
- }
- else
- {
- /*
- * This must be a user defined Serializer.
- * It had better implement ContentHandler.
- */
- if (obj instanceof ContentHandler)
- {
-
- /*
- * The user defined serializer defines ContentHandler,
- * but we need to wrap it with ToXMLSAXHandler which
- * will collect SAX-like events and emit true
- * SAX ContentHandler events to the users handler.
- */
- className = SerializerConstants.DEFAULT_SAX_SERIALIZER;
- cls = ObjectFactory.findProviderClass(className, true);
- SerializationHandler sh =
- (SerializationHandler) cls.newInstance();
- sh.setContentHandler( (ContentHandler) obj);
- sh.setOutputFormat(format);
-
- ser = sh;
- }
- else
- {
- // user defined serializer does not implement
- // ContentHandler, ... very bad
- throw new Exception(
- Utils.messages.createMessage(
- MsgKey.ER_SERIALIZER_NOT_CONTENTHANDLER,
- new Object[] { className}));
- }
-
- }
- }
- catch (Exception e)
- {
- throw new com.sun.org.apache.xml.internal.serializer.utils.WrappedRuntimeException(e);
- }
-
- // If we make it to here ser is not null.
- return ser;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/SerializerTrace.java b/src/com/sun/org/apache/xml/internal/serializer/SerializerTrace.java
deleted file mode 100644
index 0710412..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/SerializerTrace.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: SerializerTrace.java,v 1.2.4.1 2005/09/15 08:15:24 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.serializer;
-
-import org.xml.sax.Attributes;
-
-/**
- * This interface defines a set of integer constants that identify trace event
- * types.
- *
- * @xsl.usage internal
- */
-
-public interface SerializerTrace {
-
- /**
- * Event type generated when a document begins.
- *
- */
- public static final int EVENTTYPE_STARTDOCUMENT = 1;
-
- /**
- * Event type generated when a document ends.
- */
- public static final int EVENTTYPE_ENDDOCUMENT = 2;
-
- /**
- * Event type generated when an element begins (after the attributes have been processed but before the children have been added).
- */
- public static final int EVENTTYPE_STARTELEMENT = 3;
-
- /**
- * Event type generated when an element ends, after it's children have been added.
- */
- public static final int EVENTTYPE_ENDELEMENT = 4;
-
- /**
- * Event type generated for character data (CDATA and Ignorable Whitespace have their own events).
- */
- public static final int EVENTTYPE_CHARACTERS = 5;
-
- /**
- * Event type generated for ignorable whitespace (I'm not sure how much this is actually called.
- */
- public static final int EVENTTYPE_IGNORABLEWHITESPACE = 6;
-
- /**
- * Event type generated for processing instructions.
- */
- public static final int EVENTTYPE_PI = 7;
-
- /**
- * Event type generated after a comment has been added.
- */
- public static final int EVENTTYPE_COMMENT = 8;
-
- /**
- * Event type generate after an entity ref is created.
- */
- public static final int EVENTTYPE_ENTITYREF = 9;
-
- /**
- * Event type generated after CDATA is generated.
- */
- public static final int EVENTTYPE_CDATA = 10;
-
- /**
- * Event type generated when characters might be written to an output stream,
- * but these characters never are. They will ultimately be written out via
- * EVENTTYPE_OUTPUT_CHARACTERS. This type is used as attributes are collected.
- * Whenever the attributes change this event type is fired. At the very end
- * however, when the attributes do not change anymore and are going to be
- * ouput to the document the real characters will be written out using the
- * EVENTTYPE_OUTPUT_CHARACTERS.
- */
- public static final int EVENTTYPE_OUTPUT_PSEUDO_CHARACTERS = 11;
-
- /**
- * Event type generated when characters are written to an output stream.
- */
- public static final int EVENTTYPE_OUTPUT_CHARACTERS = 12;
-
-
- /**
- * Tell if trace listeners are present.
- *
- * @return True if there are trace listeners
- */
- public boolean hasTraceListeners();
-
- /**
- * Fire startDocument, endDocument events.
- *
- * @param eventType One of the EVENTTYPE_XXX constants.
- */
- public void fireGenerateEvent(int eventType);
-
- /**
- * Fire startElement, endElement events.
- *
- * @param eventType One of the EVENTTYPE_XXX constants.
- * @param name The name of the element.
- * @param atts The SAX attribute list.
- */
- public void fireGenerateEvent(int eventType, String name, Attributes atts);
-
- /**
- * Fire characters, cdata events.
- *
- * @param eventType One of the EVENTTYPE_XXX constants.
- * @param ch The char array from the SAX event.
- * @param start The start offset to be used in the char array.
- * @param length The end offset to be used in the chara array.
- */
- public void fireGenerateEvent(int eventType, char ch[], int start, int length);
-
- /**
- * Fire processingInstruction events.
- *
- * @param eventType One of the EVENTTYPE_XXX constants.
- * @param name The name of the processing instruction.
- * @param data The processing instruction data.
- */
- public void fireGenerateEvent(int eventType, String name, String data);
-
-
- /**
- * Fire comment and entity ref events.
- *
- * @param eventType One of the EVENTTYPE_XXX constants.
- * @param data The comment or entity ref data.
- */
- public void fireGenerateEvent(int eventType, String data);
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/SerializerTraceWriter.java b/src/com/sun/org/apache/xml/internal/serializer/SerializerTraceWriter.java
deleted file mode 100644
index 482faad..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/SerializerTraceWriter.java
+++ /dev/null
@@ -1,343 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: SerializerTraceWriter.java,v 1.2.4.1 2005/09/15 08:15:25 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.serializer;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.Writer;
-
-/**
- * This class wraps the real writer, it only purpose is to send
- * CHARACTERTOSTREAM events to the trace listener.
- * Each method immediately sends the call to the wrapped writer unchanged, but
- * in addition it collects characters to be issued to a trace listener.
- *
- * In this way the trace
- * listener knows what characters have been written to the output Writer.
- *
- * There may still be differences in what the trace events say is going to the
- * output writer and what is really going there. These differences will be due
- * to the fact that this class is UTF-8 encoding before emiting the trace event
- * and the underlying writer may not be UTF-8 encoding. There may also be
- * encoding differences. So the main pupose of this class is to provide a
- * resonable facsimile of the true output.
- *
- * @xsl.usage internal
- */
-final class SerializerTraceWriter extends Writer implements WriterChain
-{
-
- /** The real writer to immediately write to.
- * This reference may be null, in which case nothing is written out, but
- * only the trace events are fired for output.
- */
- private final java.io.Writer m_writer;
-
- /** The tracer to send events to */
- private final SerializerTrace m_tracer;
-
- /** The size of the internal buffer, just to keep too many
- * events from being sent to the tracer
- */
- private int buf_length;
-
- /**
- * Internal buffer to collect the characters to go to the trace listener.
- *
- */
- private byte buf[];
-
- /**
- * How many bytes have been collected and still need to go to trace
- * listener.
- */
- private int count;
-
- /**
- * Creates or replaces the internal buffer, and makes sure it has a few
- * extra bytes slight overflow of the last UTF8 encoded character.
- * @param size
- */
- private void setBufferSize(int size)
- {
- buf = new byte[size + 3];
- buf_length = size;
- count = 0;
- }
-
- /**
- * Constructor.
- * If the writer passed in is null, then this SerializerTraceWriter will
- * only signal trace events of what would have been written to that writer.
- * If the writer passed in is not null then the trace events will mirror
- * what is going to that writer. In this way tools, such as a debugger, can
- * gather information on what is being written out.
- *
- * @param out the Writer to write to (possibly null)
- * @param tracer the tracer to inform that characters are being written
- */
- public SerializerTraceWriter(Writer out, SerializerTrace tracer)
- {
- m_writer = out;
- m_tracer = tracer;
- setBufferSize(1024);
- }
-
- /**
- * Flush out the collected characters by sending them to the trace
- * listener. These characters are never written to the real writer
- * (m_writer) because that has already happened with every method
- * call. This method simple informs the listener of what has already
- * happened.
- * @throws IOException
- */
- private void flushBuffer() throws IOException
- {
-
- // Just for tracing purposes
- if (count > 0)
- {
- char[] chars = new char[count];
- for(int i=0; i<count; i++)
- chars[i] = (char) buf[i];
-
- if (m_tracer != null)
- m_tracer.fireGenerateEvent(
- SerializerTrace.EVENTTYPE_OUTPUT_CHARACTERS,
- chars,
- 0,
- chars.length);
-
- count = 0;
- }
- }
-
- /**
- * Flush the internal buffer and flush the Writer
- * @see java.io.Writer#flush()
- */
- public void flush() throws java.io.IOException
- {
- // send to the real writer
- if (m_writer != null)
- m_writer.flush();
-
- // from here on just for tracing purposes
- flushBuffer();
- }
-
- /**
- * Flush the internal buffer and close the Writer
- * @see java.io.Writer#close()
- */
- public void close() throws java.io.IOException
- {
- // send to the real writer
- if (m_writer != null)
- m_writer.close();
-
- // from here on just for tracing purposes
- flushBuffer();
- }
-
-
- /**
- * Write a single character. The character to be written is contained in
- * the 16 low-order bits of the given integer value; the 16 high-order bits
- * are ignored.
- *
- * <p> Subclasses that intend to support efficient single-character output
- * should override this method.
- *
- * @param c int specifying a character to be written.
- * @exception IOException If an I/O error occurs
- */
- public void write(final int c) throws IOException
- {
- // send to the real writer
- if (m_writer != null)
- m_writer.write(c);
-
- // ---------- from here on just collect for tracing purposes
-
- /* If we are close to the end of the buffer then flush it.
- * Remember the buffer can hold a few more characters than buf_length
- */
- if (count >= buf_length)
- flushBuffer();
-
- if (c < 0x80)
- {
- buf[count++] = (byte) (c);
- }
- else if (c < 0x800)
- {
- buf[count++] = (byte) (0xc0 + (c >> 6));
- buf[count++] = (byte) (0x80 + (c & 0x3f));
- }
- else
- {
- buf[count++] = (byte) (0xe0 + (c >> 12));
- buf[count++] = (byte) (0x80 + ((c >> 6) & 0x3f));
- buf[count++] = (byte) (0x80 + (c & 0x3f));
- }
- }
-
- /**
- * Write a portion of an array of characters.
- *
- * @param chars Array of characters
- * @param start Offset from which to start writing characters
- * @param length Number of characters to write
- *
- * @exception IOException If an I/O error occurs
- *
- * @throws java.io.IOException
- */
- public void write(final char chars[], final int start, final int length)
- throws java.io.IOException
- {
- // send to the real writer
- if (m_writer != null)
- m_writer.write(chars, start, length);
-
- // from here on just collect for tracing purposes
- int lengthx3 = (length << 1) + length;
-
- if (lengthx3 >= buf_length)
- {
-
- /* If the request length exceeds the size of the output buffer,
- * flush the output buffer and make the buffer bigger to handle.
- */
-
- flushBuffer();
- setBufferSize(2 * lengthx3);
-
- }
-
- if (lengthx3 > buf_length - count)
- {
- flushBuffer();
- }
-
- final int n = length + start;
- for (int i = start; i < n; i++)
- {
- final char c = chars[i];
-
- if (c < 0x80)
- buf[count++] = (byte) (c);
- else if (c < 0x800)
- {
- buf[count++] = (byte) (0xc0 + (c >> 6));
- buf[count++] = (byte) (0x80 + (c & 0x3f));
- }
- else
- {
- buf[count++] = (byte) (0xe0 + (c >> 12));
- buf[count++] = (byte) (0x80 + ((c >> 6) & 0x3f));
- buf[count++] = (byte) (0x80 + (c & 0x3f));
- }
- }
-
- }
-
- /**
- * Write a string.
- *
- * @param s String to be written
- *
- * @exception IOException If an I/O error occurs
- */
- public void write(final String s) throws IOException
- {
- // send to the real writer
- if (m_writer != null)
- m_writer.write(s);
-
- // from here on just collect for tracing purposes
- final int length = s.length();
-
- // We multiply the length by three since this is the maximum length
- // of the characters that we can put into the buffer. It is possible
- // for each Unicode character to expand to three bytes.
-
- int lengthx3 = (length << 1) + length;
-
- if (lengthx3 >= buf_length)
- {
-
- /* If the request length exceeds the size of the output buffer,
- * flush the output buffer and make the buffer bigger to handle.
- */
-
- flushBuffer();
- setBufferSize(2 * lengthx3);
- }
-
- if (lengthx3 > buf_length - count)
- {
- flushBuffer();
- }
-
- for (int i = 0; i < length; i++)
- {
- final char c = s.charAt(i);
-
- if (c < 0x80)
- buf[count++] = (byte) (c);
- else if (c < 0x800)
- {
- buf[count++] = (byte) (0xc0 + (c >> 6));
- buf[count++] = (byte) (0x80 + (c & 0x3f));
- }
- else
- {
- buf[count++] = (byte) (0xe0 + (c >> 12));
- buf[count++] = (byte) (0x80 + ((c >> 6) & 0x3f));
- buf[count++] = (byte) (0x80 + (c & 0x3f));
- }
- }
- }
-
- /**
- * Get the writer that this one directly wraps.
- */
- public Writer getWriter()
- {
- return m_writer;
- }
-
- /**
- * Get the OutputStream that is the at the end of the
- * chain of writers.
- */
- public OutputStream getOutputStream()
- {
- OutputStream retval = null;
- if (m_writer instanceof WriterChain)
- retval = ((WriterChain) m_writer).getOutputStream();
- return retval;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/ToHTMLSAXHandler.java b/src/com/sun/org/apache/xml/internal/serializer/ToHTMLSAXHandler.java
deleted file mode 100644
index 596a641..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/ToHTMLSAXHandler.java
+++ /dev/null
@@ -1,747 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ToHTMLSAXHandler.java,v 1.3 2005/09/28 13:49:07 pvedula Exp $
- */
-
-package com.sun.org.apache.xml.internal.serializer;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.Writer;
-import java.util.Properties;
-
-import javax.xml.transform.Result;
-
-import org.w3c.dom.Node;
-import org.xml.sax.Attributes;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-import org.xml.sax.ext.LexicalHandler;
-
-/**
- * This class accepts SAX-like calls, then sends true SAX calls to a
- * wrapped SAX handler. There is optimization done knowing that the ultimate
- * output is HTML.
- *
- * This class is not a public API.
- *
- * @xsl.usage internal
- */
-public final class ToHTMLSAXHandler extends ToSAXHandler
-{
- /**
- * Handle document type declaration (for first element only)
- */
- private boolean m_dtdHandled = false;
-
- /**
- * Keeps track of whether output escaping is currently enabled
- */
- protected boolean m_escapeSetting = true;
-
- /**
- * Returns null.
- * @return null
- * @see Serializer#getOutputFormat()
- */
- public Properties getOutputFormat()
- {
- return null;
- }
-
- /**
- * Reurns null
- * @return null
- * @see Serializer#getOutputStream()
- */
- public OutputStream getOutputStream()
- {
- return null;
- }
-
- /**
- * Returns null
- * @return null
- * @see Serializer#getWriter()
- */
- public Writer getWriter()
- {
- return null;
- }
-
- /**
- * Does nothing.
- *
- */
- public void indent(int n) throws SAXException
- {
- }
-
- /**
- * Does nothing.
- * @see DOMSerializer#serialize(Node)
- */
- public void serialize(Node node) throws IOException
- {
- return;
- }
-
- /**
- * Turns special character escaping on/off.
- *
- *
- * @param escape true if escaping is to be set on.
- *
- * @see SerializationHandler#setEscaping(boolean)
- */
- public boolean setEscaping(boolean escape) throws SAXException
- {
- boolean oldEscapeSetting = m_escapeSetting;
- m_escapeSetting = escape;
-
- if (escape) {
- processingInstruction(Result.PI_ENABLE_OUTPUT_ESCAPING, "");
- } else {
- processingInstruction(Result.PI_DISABLE_OUTPUT_ESCAPING, "");
- }
-
- return oldEscapeSetting;
- }
-
- /**
- * Does nothing
- * @param indent the number of spaces to indent per indentation level
- * (ignored)
- * @see SerializationHandler#setIndent(boolean)
- */
- public void setIndent(boolean indent)
- {
- }
-
- /**
- * Does nothing.
- * @param format this parameter is not used
- * @see Serializer#setOutputFormat(Properties)
- */
- public void setOutputFormat(Properties format)
- {
- }
-
- /**
- * Does nothing.
- * @param output this parameter is ignored
- * @see Serializer#setOutputStream(OutputStream)
- */
- public void setOutputStream(OutputStream output)
- {
- }
-
-
- /**
- * Does nothing.
- * @param writer this parameter is ignored.
- * @see Serializer#setWriter(Writer)
- */
- public void setWriter(Writer writer)
- {
- }
-
- /**
- * @see org.xml.sax.ext.DeclHandler#attributeDecl(String, String, String, String, String)
- */
- /**
- * Does nothing.
- *
- * @param eName this parameter is ignored
- * @param aName this parameter is ignored
- * @param type this parameter is ignored
- * @param valueDefault this parameter is ignored
- * @param value this parameter is ignored
- * @see org.xml.sax.ext.DeclHandler#attributeDecl(String, String, String,String,String)
- */
- public void attributeDecl(
- String eName,
- String aName,
- String type,
- String valueDefault,
- String value)
- throws SAXException
- {
- }
-
-
- /**
- * Does nothing.
- * @see org.xml.sax.ext.DeclHandler#elementDecl(String, String)
- */
- public void elementDecl(String name, String model) throws SAXException
- {
- return;
- }
-
- /**
- * @see org.xml.sax.ext.DeclHandler#externalEntityDecl(String, String, String)
- */
- public void externalEntityDecl(String arg0, String arg1, String arg2)
- throws SAXException
- {
- }
-
- /**
- * Does nothing.
- *
- * @see org.xml.sax.DTDHandler#unparsedEntityDecl
- */
- public void internalEntityDecl(String name, String value)
- throws SAXException
- {
- }
-
- /**
- * Receive notification of the end of an element.
- *
- * <p>The SAX parser will invoke this method at the end of every
- * element in the XML document; there will be a corresponding
- * startElement() event for every endElement() event (even when the
- * element is empty).</p>
- *
- * <p>If the element name has a namespace prefix, the prefix will
- * still be attached to the name.</p>
- *
- *
- * @param uri The Namespace URI, or the empty string if the
- * element has no Namespace URI or if Namespace
- * processing is not being performed.
- * @param localName The local name (without prefix), or the
- * empty string if Namespace processing is not being
- * performed.
- * @param qName The qualified name (with prefix), or the
- * empty string if qualified names are not available.
- * @throws org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ContentHandler#endElement(String, String, String)
- */
- public void endElement(String uri, String localName, String qName)
- throws SAXException
- {
- flushPending();
- m_saxHandler.endElement(uri, localName, qName);
-
- // time to fire off endElement event
- if (m_tracer != null)
- super.fireEndElem(qName);
- }
-
- /**
- * Does nothing.
- */
- public void endPrefixMapping(String prefix) throws SAXException
- {
- }
-
- /**
- * Does nothing.
- * @see org.xml.sax.ContentHandler#ignorableWhitespace(char[], int, int)
- */
- public void ignorableWhitespace(char[] ch, int start, int length)
- throws SAXException
- {
- }
-
- /**
- * Receive notification of a processing instruction.
- *
- * <p>The Parser will invoke this method once for each processing
- * instruction found: note that processing instructions may occur
- * before or after the main document element.</p>
- *
- * <p>A SAX parser should never report an XML declaration (XML 1.0,
- * section 2.8) or a text declaration (XML 1.0, section 4.3.1)
- * using this method.</p>
- *
- * @param target The processing instruction target.
- * @param data The processing instruction data, or null if
- * none was supplied.
- * @throws org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- *
- * @throws org.xml.sax.SAXException
- * @see org.xml.sax.ContentHandler#processingInstruction(String, String)
- */
- public void processingInstruction(String target, String data)
- throws SAXException
- {
- flushPending();
- m_saxHandler.processingInstruction(target,data);
-
- // time to fire off processing instruction event
-
- if (m_tracer != null)
- super.fireEscapingEvent(target,data);
- }
-
- /**
- * Does nothing.
- * @see org.xml.sax.ContentHandler#setDocumentLocator(Locator)
- */
- public void setDocumentLocator(Locator arg0)
- {
- super.setDocumentLocator(arg0);
- }
-
- /**
- * Does nothing.
- * @see org.xml.sax.ContentHandler#skippedEntity(String)
- */
- public void skippedEntity(String arg0) throws SAXException
- {
- }
-
- /**
- * Receive notification of the beginning of an element, although this is a
- * SAX method additional namespace or attribute information can occur before
- * or after this call, that is associated with this element.
- *
- *
- * @param namespaceURI The Namespace URI, or the empty string if the
- * element has no Namespace URI or if Namespace
- * processing is not being performed.
- * @param localName The local name (without prefix), or the
- * empty string if Namespace processing is not being
- * performed.
- * @param qName The elements name.
- * @param atts The attributes attached to the element, if any.
- * @throws org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ContentHandler#startElement
- * @see org.xml.sax.ContentHandler#endElement
- * @see org.xml.sax.AttributeList
- *
- * @throws org.xml.sax.SAXException
- *
- * @see org.xml.sax.ContentHandler#startElement(String, String, String, Attributes)
- */
- public void startElement(
- String namespaceURI,
- String localName,
- String qName,
- Attributes atts)
- throws SAXException
- {
- flushPending();
- super.startElement(namespaceURI, localName, qName, atts);
- m_saxHandler.startElement(namespaceURI, localName, qName, atts);
- m_elemContext.m_startTagOpen = false;
- }
-
- /**
- * Receive notification of a comment anywhere in the document. This callback
- * will be used for comments inside or outside the document element.
- * @param ch An array holding the characters in the comment.
- * @param start The starting position in the array.
- * @param length The number of characters to use from the array.
- * @throws org.xml.sax.SAXException The application may raise an exception.
- *
- * @see org.xml.sax.ext.LexicalHandler#comment(char[], int, int)
- */
- public void comment(char[] ch, int start, int length) throws SAXException
- {
- flushPending();
- if (m_lexHandler != null)
- m_lexHandler.comment(ch, start, length);
-
- // time to fire off comment event
- if (m_tracer != null)
- super.fireCommentEvent(ch, start, length);
- return;
- }
-
- /**
- * Does nothing.
- * @see org.xml.sax.ext.LexicalHandler#endCDATA()
- */
- public void endCDATA() throws SAXException
- {
- return;
- }
-
- /**
- * Does nothing.
- * @see org.xml.sax.ext.LexicalHandler#endDTD()
- */
- public void endDTD() throws SAXException
- {
- }
-
- /**
- * Does nothing.
- * @see org.xml.sax.ext.LexicalHandler#startCDATA()
- */
- public void startCDATA() throws SAXException
- {
- }
-
- /**
- * Does nothing.
- * @see org.xml.sax.ext.LexicalHandler#startEntity(String)
- */
- public void startEntity(String arg0) throws SAXException
- {
- }
-
- /**
- * Receive notification of the end of a document.
- *
- * <p>The SAX parser will invoke this method only once, and it will
- * be the last method invoked during the parse. The parser shall
- * not invoke this method until it has either abandoned parsing
- * (because of an unrecoverable error) or reached the end of
- * input.</p>
- *
- * @throws org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- *
- * @throws org.xml.sax.SAXException
- *
- *
- */
- public void endDocument() throws SAXException
- {
- flushPending();
-
- // Close output document
- m_saxHandler.endDocument();
-
- if (m_tracer != null)
- super.fireEndDoc();
- }
-
- /**
- * This method is called when all the data needed for a call to the
- * SAX handler's startElement() method has been gathered.
- */
- protected void closeStartTag() throws SAXException
- {
-
- m_elemContext.m_startTagOpen = false;
-
- // Now is time to send the startElement event
- m_saxHandler.startElement(
- EMPTYSTRING,
- m_elemContext.m_elementName,
- m_elemContext.m_elementName,
- m_attributes);
- m_attributes.clear();
-
- }
-
- /**
- * Do nothing.
- * @see SerializationHandler#close()
- */
- public void close()
- {
- return;
- }
-
- /**
- * Receive notification of character data.
- *
- * @param chars The string of characters to process.
- *
- * @throws org.xml.sax.SAXException
- *
- * @see ExtendedContentHandler#characters(String)
- */
- public void characters(final String chars) throws SAXException
- {
- final int length = chars.length();
- if (length > m_charsBuff.length)
- {
- m_charsBuff = new char[length * 2 + 1];
- }
- chars.getChars(0, length, m_charsBuff, 0);
- this.characters(m_charsBuff, 0, length);
- }
-
-
- /**
- * A constructor
- * @param handler the wrapped SAX content handler
- * @param encoding the encoding of the output HTML document
- */
- public ToHTMLSAXHandler(ContentHandler handler, String encoding)
- {
- super(handler,encoding);
- }
- /**
- * A constructor.
- * @param handler the wrapped SAX content handler
- * @param lex the wrapped lexical handler
- * @param encoding the encoding of the output HTML document
- */
- public ToHTMLSAXHandler(
- ContentHandler handler,
- LexicalHandler lex,
- String encoding)
- {
- super(handler,lex,encoding);
- }
-
- /**
- * An element starts, but attributes are not fully known yet.
- *
- * @param elementNamespaceURI the URI of the namespace of the element
- * (optional)
- * @param elementLocalName the element name, but without prefix
- * (optional)
- * @param elementName the element name, with prefix, if any (required)
- *
- * @see ExtendedContentHandler#startElement(String)
- */
- public void startElement(
- String elementNamespaceURI,
- String elementLocalName,
- String elementName) throws SAXException
- {
-
- super.startElement(elementNamespaceURI, elementLocalName, elementName);
-
- flushPending();
-
- // Handle document type declaration (for first element only)
- if (!m_dtdHandled)
- {
- String doctypeSystem = getDoctypeSystem();
- String doctypePublic = getDoctypePublic();
- if ((doctypeSystem != null) || (doctypePublic != null)) {
- if (m_lexHandler != null)
- m_lexHandler.startDTD(
- elementName,
- doctypePublic,
- doctypeSystem);
- }
- m_dtdHandled = true;
- }
- m_elemContext = m_elemContext.push(elementNamespaceURI, elementLocalName, elementName);
- }
- /**
- * An element starts, but attributes are not fully known yet.
- *
- * @param elementName the element name, with prefix, if any
- *
- * @see ExtendedContentHandler#startElement(String)
- */
- public void startElement(String elementName) throws SAXException
- {
- this.startElement(null,null, elementName);
- }
-
- /**
- * Receive notification of the end of an element.
- * @param elementName The element type name
- * @throws org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- *
- * @see ExtendedContentHandler#endElement(String)
- */
- public void endElement(String elementName) throws SAXException
- {
- flushPending();
- m_saxHandler.endElement(EMPTYSTRING, elementName, elementName);
-
- // time to fire off endElement event
- if (m_tracer != null)
- super.fireEndElem(elementName);
- }
-
- /**
- * Receive notification of character data.
- *
- * <p>The Parser will call this method to report each chunk of
- * character data. SAX parsers may return all contiguous character
- * data in a single chunk, or they may split it into several
- * chunks; however, all of the characters in any single event
- * must come from the same external entity, so that the Locator
- * provides useful information.</p>
- *
- * <p>The application must not attempt to read from the array
- * outside of the specified range.</p>
- *
- * <p>Note that some parsers will report whitespace using the
- * ignorableWhitespace() method rather than this one (validating
- * parsers must do so).</p>
- *
- * @param ch The characters from the XML document.
- * @param off The start position in the array.
- * @param len The number of characters to read from the array.
- * @throws org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see #ignorableWhitespace
- * @see org.xml.sax.Locator
- *
- * @throws org.xml.sax.SAXException
- *
- * @see org.xml.sax.ContentHandler#characters(char[], int, int)
- */
- public void characters(char[] ch, int off, int len) throws SAXException
- {
-
- flushPending();
- m_saxHandler.characters(ch, off, len);
-
- // time to fire off characters event
- if (m_tracer != null)
- super.fireCharEvent(ch, off, len);
- }
-
- /**
- * This method flushes any pending events, which can be startDocument()
- * closing the opening tag of an element, or closing an open CDATA section.
- */
- public void flushPending() throws SAXException
- {
- if (m_needToCallStartDocument)
- {
- startDocumentInternal();
- m_needToCallStartDocument = false;
- }
- // Close any open element
- if (m_elemContext.m_startTagOpen)
- {
- closeStartTag();
- m_elemContext.m_startTagOpen = false;
- }
- }
- /**
- * Handle a prefix/uri mapping, which is associated with a startElement()
- * that is soon to follow. Need to close any open start tag to make
- * sure than any name space attributes due to this event are associated wih
- * the up comming element, not the current one.
- * @see ExtendedContentHandler#startPrefixMapping
- *
- * @param prefix The Namespace prefix being declared.
- * @param uri The Namespace URI the prefix is mapped to.
- * @param shouldFlush true if any open tags need to be closed first, this
- * will impact which element the mapping applies to (open parent, or its up
- * comming child)
- * @return returns true if the call made a change to the current
- * namespace information, false if it did not change anything, e.g. if the
- * prefix/namespace mapping was already in scope from before.
- *
- * @throws org.xml.sax.SAXException The client may throw
- * an exception during processing.
- */
- public boolean startPrefixMapping(
- String prefix,
- String uri,
- boolean shouldFlush)
- throws SAXException
- {
- // no namespace support for HTML
- if (shouldFlush)
- flushPending();
- m_saxHandler.startPrefixMapping(prefix,uri);
- return false;
- }
-
- /**
- * Begin the scope of a prefix-URI Namespace mapping
- * just before another element is about to start.
- * This call will close any open tags so that the prefix mapping
- * will not apply to the current element, but the up comming child.
- *
- * @see org.xml.sax.ContentHandler#startPrefixMapping
- *
- * @param prefix The Namespace prefix being declared.
- * @param uri The Namespace URI the prefix is mapped to.
- *
- * @throws org.xml.sax.SAXException The client may throw
- * an exception during processing.
- *
- */
- public void startPrefixMapping(String prefix, String uri)
- throws org.xml.sax.SAXException
- {
- startPrefixMapping(prefix,uri,true);
- }
-
- /**
- * This method is used when a prefix/uri namespace mapping
- * is indicated after the element was started with a
- * startElement() and before and endElement().
- * startPrefixMapping(prefix,uri) would be used before the
- * startElement() call.
- * @param prefix the prefix associated with the given URI.
- * @param uri the URI of the namespace
- *
- * @see ExtendedContentHandler#namespaceAfterStartElement(String, String)
- */
- public void namespaceAfterStartElement(
- final String prefix,
- final String uri)
- throws SAXException
- {
- // hack for XSLTC with finding URI for default namespace
- if (m_elemContext.m_elementURI == null)
- {
- String prefix1 = getPrefixPart(m_elemContext.m_elementName);
- if (prefix1 == null && EMPTYSTRING.equals(prefix))
- {
- // the elements URI is not known yet, and it
- // doesn't have a prefix, and we are currently
- // setting the uri for prefix "", so we have
- // the uri for the element... lets remember it
- m_elemContext.m_elementURI = uri;
- }
- }
- startPrefixMapping(prefix,uri,false);
- }
-
- /**
- * Try's to reset the super class and reset this class for
- * re-use, so that you don't need to create a new serializer
- * (mostly for performance reasons).
- *
- * @return true if the class was successfuly reset.
- * @see Serializer#reset()
- */
- public boolean reset()
- {
- boolean wasReset = false;
- if (super.reset())
- {
- resetToHTMLSAXHandler();
- wasReset = true;
- }
- return wasReset;
- }
-
- /**
- * Reset all of the fields owned by ToHTMLSAXHandler class
- *
- */
- private void resetToHTMLSAXHandler()
- {
- this.m_escapeSetting = true;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/ToHTMLStream.java b/src/com/sun/org/apache/xml/internal/serializer/ToHTMLStream.java
deleted file mode 100644
index a68ec6d..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/ToHTMLStream.java
+++ /dev/null
@@ -1,2320 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ToHTMLStream.java,v 1.2.4.1 2005/09/15 08:15:26 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.serializer;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
-import java.util.Properties;
-
-import javax.xml.transform.Result;
-
-import com.sun.org.apache.xml.internal.serializer.utils.MsgKey;
-import com.sun.org.apache.xml.internal.serializer.utils.Utils;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-
-/**
- * This serializer takes a series of SAX or
- * SAX-like events and writes its output
- * to the given stream.
- *
- * This class is not a public API, it is public
- * because it is used from another package.
- *
- * @xsl.usage internal
- */
-public final class ToHTMLStream extends ToStream
-{
-
- /** This flag is set while receiving events from the DTD */
- protected boolean m_inDTD = false;
-
- /** True if the current element is a block element. (seems like
- * this needs to be a stack. -sb). */
- private boolean m_inBlockElem = false;
-
- /**
- * Map that tells which XML characters should have special treatment, and it
- * provides character to entity name lookup.
- */
- private static final CharInfo m_htmlcharInfo =
-// new CharInfo(CharInfo.HTML_ENTITIES_RESOURCE);
- CharInfo.getCharInfoInternal(CharInfo.HTML_ENTITIES_RESOURCE, Method.HTML);
-
- /** A digital search trie for fast, case insensitive lookup of ElemDesc objects. */
- static final Trie m_elementFlags = new Trie();
-
- static {
- initTagReference(m_elementFlags);
- }
- static void initTagReference(Trie m_elementFlags) {
-
- // HTML 4.0 loose DTD
- m_elementFlags.put("BASEFONT", new ElemDesc(0 | ElemDesc.EMPTY));
- m_elementFlags.put(
- "FRAME",
- new ElemDesc(0 | ElemDesc.EMPTY | ElemDesc.BLOCK));
- m_elementFlags.put("FRAMESET", new ElemDesc(0 | ElemDesc.BLOCK));
- m_elementFlags.put("NOFRAMES", new ElemDesc(0 | ElemDesc.BLOCK));
- m_elementFlags.put(
- "ISINDEX",
- new ElemDesc(0 | ElemDesc.EMPTY | ElemDesc.BLOCK));
- m_elementFlags.put(
- "APPLET",
- new ElemDesc(0 | ElemDesc.WHITESPACESENSITIVE));
- m_elementFlags.put("CENTER", new ElemDesc(0 | ElemDesc.BLOCK));
- m_elementFlags.put("DIR", new ElemDesc(0 | ElemDesc.BLOCK));
- m_elementFlags.put("MENU", new ElemDesc(0 | ElemDesc.BLOCK));
-
- // HTML 4.0 strict DTD
- m_elementFlags.put("TT", new ElemDesc(0 | ElemDesc.FONTSTYLE));
- m_elementFlags.put("I", new ElemDesc(0 | ElemDesc.FONTSTYLE));
- m_elementFlags.put("B", new ElemDesc(0 | ElemDesc.FONTSTYLE));
- m_elementFlags.put("BIG", new ElemDesc(0 | ElemDesc.FONTSTYLE));
- m_elementFlags.put("SMALL", new ElemDesc(0 | ElemDesc.FONTSTYLE));
- m_elementFlags.put("EM", new ElemDesc(0 | ElemDesc.PHRASE));
- m_elementFlags.put("STRONG", new ElemDesc(0 | ElemDesc.PHRASE));
- m_elementFlags.put("DFN", new ElemDesc(0 | ElemDesc.PHRASE));
- m_elementFlags.put("CODE", new ElemDesc(0 | ElemDesc.PHRASE));
- m_elementFlags.put("SAMP", new ElemDesc(0 | ElemDesc.PHRASE));
- m_elementFlags.put("KBD", new ElemDesc(0 | ElemDesc.PHRASE));
- m_elementFlags.put("VAR", new ElemDesc(0 | ElemDesc.PHRASE));
- m_elementFlags.put("CITE", new ElemDesc(0 | ElemDesc.PHRASE));
- m_elementFlags.put("ABBR", new ElemDesc(0 | ElemDesc.PHRASE));
- m_elementFlags.put("ACRONYM", new ElemDesc(0 | ElemDesc.PHRASE));
- m_elementFlags.put(
- "SUP",
- new ElemDesc(0 | ElemDesc.SPECIAL | ElemDesc.ASPECIAL));
- m_elementFlags.put(
- "SUB",
- new ElemDesc(0 | ElemDesc.SPECIAL | ElemDesc.ASPECIAL));
- m_elementFlags.put(
- "SPAN",
- new ElemDesc(0 | ElemDesc.SPECIAL | ElemDesc.ASPECIAL));
- m_elementFlags.put(
- "BDO",
- new ElemDesc(0 | ElemDesc.SPECIAL | ElemDesc.ASPECIAL));
- m_elementFlags.put(
- "BR",
- new ElemDesc(
- 0
- | ElemDesc.SPECIAL
- | ElemDesc.ASPECIAL
- | ElemDesc.EMPTY
- | ElemDesc.BLOCK));
- m_elementFlags.put("BODY", new ElemDesc(0 | ElemDesc.BLOCK));
- m_elementFlags.put(
- "ADDRESS",
- new ElemDesc(
- 0
- | ElemDesc.BLOCK
- | ElemDesc.BLOCKFORM
- | ElemDesc.BLOCKFORMFIELDSET));
- m_elementFlags.put(
- "DIV",
- new ElemDesc(
- 0
- | ElemDesc.BLOCK
- | ElemDesc.BLOCKFORM
- | ElemDesc.BLOCKFORMFIELDSET));
- m_elementFlags.put("A", new ElemDesc(0 | ElemDesc.SPECIAL));
- m_elementFlags.put(
- "MAP",
- new ElemDesc(
- 0 | ElemDesc.SPECIAL | ElemDesc.ASPECIAL | ElemDesc.BLOCK));
- m_elementFlags.put(
- "AREA",
- new ElemDesc(0 | ElemDesc.EMPTY | ElemDesc.BLOCK));
- m_elementFlags.put(
- "LINK",
- new ElemDesc(
- 0 | ElemDesc.HEADMISC | ElemDesc.EMPTY | ElemDesc.BLOCK));
- m_elementFlags.put(
- "IMG",
- new ElemDesc(
- 0
- | ElemDesc.SPECIAL
- | ElemDesc.ASPECIAL
- | ElemDesc.EMPTY
- | ElemDesc.WHITESPACESENSITIVE));
- m_elementFlags.put(
- "OBJECT",
- new ElemDesc(
- 0
- | ElemDesc.SPECIAL
- | ElemDesc.ASPECIAL
- | ElemDesc.HEADMISC
- | ElemDesc.WHITESPACESENSITIVE));
- m_elementFlags.put("PARAM", new ElemDesc(0 | ElemDesc.EMPTY));
- m_elementFlags.put(
- "HR",
- new ElemDesc(
- 0
- | ElemDesc.BLOCK
- | ElemDesc.BLOCKFORM
- | ElemDesc.BLOCKFORMFIELDSET
- | ElemDesc.EMPTY));
- m_elementFlags.put(
- "P",
- new ElemDesc(
- 0
- | ElemDesc.BLOCK
- | ElemDesc.BLOCKFORM
- | ElemDesc.BLOCKFORMFIELDSET));
- m_elementFlags.put(
- "H1",
- new ElemDesc(0 | ElemDesc.HEAD | ElemDesc.BLOCK));
- m_elementFlags.put(
- "H2",
- new ElemDesc(0 | ElemDesc.HEAD | ElemDesc.BLOCK));
- m_elementFlags.put(
- "H3",
- new ElemDesc(0 | ElemDesc.HEAD | ElemDesc.BLOCK));
- m_elementFlags.put(
- "H4",
- new ElemDesc(0 | ElemDesc.HEAD | ElemDesc.BLOCK));
- m_elementFlags.put(
- "H5",
- new ElemDesc(0 | ElemDesc.HEAD | ElemDesc.BLOCK));
- m_elementFlags.put(
- "H6",
- new ElemDesc(0 | ElemDesc.HEAD | ElemDesc.BLOCK));
- m_elementFlags.put(
- "PRE",
- new ElemDesc(0 | ElemDesc.PREFORMATTED | ElemDesc.BLOCK));
- m_elementFlags.put(
- "Q",
- new ElemDesc(0 | ElemDesc.SPECIAL | ElemDesc.ASPECIAL));
- m_elementFlags.put(
- "BLOCKQUOTE",
- new ElemDesc(
- 0
- | ElemDesc.BLOCK
- | ElemDesc.BLOCKFORM
- | ElemDesc.BLOCKFORMFIELDSET));
- m_elementFlags.put("INS", new ElemDesc(0));
- m_elementFlags.put("DEL", new ElemDesc(0));
- m_elementFlags.put(
- "DL",
- new ElemDesc(
- 0
- | ElemDesc.BLOCK
- | ElemDesc.BLOCKFORM
- | ElemDesc.BLOCKFORMFIELDSET));
- m_elementFlags.put("DT", new ElemDesc(0 | ElemDesc.BLOCK));
- m_elementFlags.put("DD", new ElemDesc(0 | ElemDesc.BLOCK));
- m_elementFlags.put(
- "OL",
- new ElemDesc(0 | ElemDesc.LIST | ElemDesc.BLOCK));
- m_elementFlags.put(
- "UL",
- new ElemDesc(0 | ElemDesc.LIST | ElemDesc.BLOCK));
- m_elementFlags.put("LI", new ElemDesc(0 | ElemDesc.BLOCK));
- m_elementFlags.put("FORM", new ElemDesc(0 | ElemDesc.BLOCK));
- m_elementFlags.put("LABEL", new ElemDesc(0 | ElemDesc.FORMCTRL));
- m_elementFlags.put(
- "INPUT",
- new ElemDesc(
- 0 | ElemDesc.FORMCTRL | ElemDesc.INLINELABEL | ElemDesc.EMPTY));
- m_elementFlags.put(
- "SELECT",
- new ElemDesc(0 | ElemDesc.FORMCTRL | ElemDesc.INLINELABEL));
- m_elementFlags.put("OPTGROUP", new ElemDesc(0));
- m_elementFlags.put("OPTION", new ElemDesc(0));
- m_elementFlags.put(
- "TEXTAREA",
- new ElemDesc(0 | ElemDesc.FORMCTRL | ElemDesc.INLINELABEL));
- m_elementFlags.put(
- "FIELDSET",
- new ElemDesc(0 | ElemDesc.BLOCK | ElemDesc.BLOCKFORM));
- m_elementFlags.put("LEGEND", new ElemDesc(0));
- m_elementFlags.put(
- "BUTTON",
- new ElemDesc(0 | ElemDesc.FORMCTRL | ElemDesc.INLINELABEL));
- m_elementFlags.put(
- "TABLE",
- new ElemDesc(
- 0
- | ElemDesc.BLOCK
- | ElemDesc.BLOCKFORM
- | ElemDesc.BLOCKFORMFIELDSET));
- m_elementFlags.put("CAPTION", new ElemDesc(0 | ElemDesc.BLOCK));
- m_elementFlags.put("THEAD", new ElemDesc(0 | ElemDesc.BLOCK));
- m_elementFlags.put("TFOOT", new ElemDesc(0 | ElemDesc.BLOCK));
- m_elementFlags.put("TBODY", new ElemDesc(0 | ElemDesc.BLOCK));
- m_elementFlags.put("COLGROUP", new ElemDesc(0 | ElemDesc.BLOCK));
- m_elementFlags.put(
- "COL",
- new ElemDesc(0 | ElemDesc.EMPTY | ElemDesc.BLOCK));
- m_elementFlags.put("TR", new ElemDesc(0 | ElemDesc.BLOCK));
- m_elementFlags.put("TH", new ElemDesc(0));
- m_elementFlags.put("TD", new ElemDesc(0));
- m_elementFlags.put(
- "HEAD",
- new ElemDesc(0 | ElemDesc.BLOCK | ElemDesc.HEADELEM));
- m_elementFlags.put("TITLE", new ElemDesc(0 | ElemDesc.BLOCK));
- m_elementFlags.put(
- "BASE",
- new ElemDesc(0 | ElemDesc.EMPTY | ElemDesc.BLOCK));
- m_elementFlags.put(
- "META",
- new ElemDesc(
- 0 | ElemDesc.HEADMISC | ElemDesc.EMPTY | ElemDesc.BLOCK));
- m_elementFlags.put(
- "STYLE",
- new ElemDesc(
- 0 | ElemDesc.HEADMISC | ElemDesc.RAW | ElemDesc.BLOCK));
- m_elementFlags.put(
- "SCRIPT",
- new ElemDesc(
- 0
- | ElemDesc.SPECIAL
- | ElemDesc.ASPECIAL
- | ElemDesc.HEADMISC
- | ElemDesc.RAW));
- m_elementFlags.put(
- "NOSCRIPT",
- new ElemDesc(
- 0
- | ElemDesc.BLOCK
- | ElemDesc.BLOCKFORM
- | ElemDesc.BLOCKFORMFIELDSET));
- m_elementFlags.put("HTML", new ElemDesc(0 | ElemDesc.BLOCK));
-
- // From "John Ky" <hand@syd.speednet.com.au
- // Transitional Document Type Definition ()
- // file:///C:/Documents%20and%20Settings/sboag.BOAG600E/My%20Documents/html/sgml/loosedtd.html#basefont
- m_elementFlags.put("FONT", new ElemDesc(0 | ElemDesc.FONTSTYLE));
-
- // file:///C:/Documents%20and%20Settings/sboag.BOAG600E/My%20Documents/html/present/graphics.html#edef-STRIKE
- m_elementFlags.put("S", new ElemDesc(0 | ElemDesc.FONTSTYLE));
- m_elementFlags.put("STRIKE", new ElemDesc(0 | ElemDesc.FONTSTYLE));
-
- // file:///C:/Documents%20and%20Settings/sboag.BOAG600E/My%20Documents/html/present/graphics.html#edef-U
- m_elementFlags.put("U", new ElemDesc(0 | ElemDesc.FONTSTYLE));
-
- // From "John Ky" <hand@syd.speednet.com.au
- m_elementFlags.put("NOBR", new ElemDesc(0 | ElemDesc.FONTSTYLE));
-
- // HTML 4.0, section 16.5
- m_elementFlags.put(
- "IFRAME",
- new ElemDesc(
- 0
- | ElemDesc.BLOCK
- | ElemDesc.BLOCKFORM
- | ElemDesc.BLOCKFORMFIELDSET));
-
- // Netscape 4 extension
- m_elementFlags.put(
- "LAYER",
- new ElemDesc(
- 0
- | ElemDesc.BLOCK
- | ElemDesc.BLOCKFORM
- | ElemDesc.BLOCKFORMFIELDSET));
- // Netscape 4 extension
- m_elementFlags.put(
- "ILAYER",
- new ElemDesc(
- 0
- | ElemDesc.BLOCK
- | ElemDesc.BLOCKFORM
- | ElemDesc.BLOCKFORMFIELDSET));
-
-
- // NOW FOR ATTRIBUTE INFORMATION . . .
- ElemDesc elemDesc;
-
-
- // ----------------------------------------------
- elemDesc = (ElemDesc) m_elementFlags.get("A");
- elemDesc.setAttr("HREF", ElemDesc.ATTRURL);
- elemDesc.setAttr("NAME", ElemDesc.ATTRURL);
-
- // ----------------------------------------------
- elemDesc = (ElemDesc) m_elementFlags.get("AREA");
- elemDesc.setAttr("HREF", ElemDesc.ATTRURL);
- elemDesc.setAttr("NOHREF", ElemDesc.ATTREMPTY);
-
- // ----------------------------------------------
- elemDesc = (ElemDesc) m_elementFlags.get("BASE");
- elemDesc.setAttr("HREF", ElemDesc.ATTRURL);
-
- // ----------------------------------------------
- elemDesc = (ElemDesc) m_elementFlags.get("BUTTON");
- elemDesc.setAttr("DISABLED", ElemDesc.ATTREMPTY);
-
- // ----------------------------------------------
- elemDesc = (ElemDesc) m_elementFlags.get("BLOCKQUOTE");
- elemDesc.setAttr("CITE", ElemDesc.ATTRURL);
-
- // ----------------------------------------------
- elemDesc = (ElemDesc) m_elementFlags.get("DEL");
- elemDesc.setAttr("CITE", ElemDesc.ATTRURL);
-
- // ----------------------------------------------
- elemDesc = (ElemDesc) m_elementFlags.get("DIR");
- elemDesc.setAttr("COMPACT", ElemDesc.ATTREMPTY);
-
- // ----------------------------------------------
-
- elemDesc = (ElemDesc) m_elementFlags.get("DIV");
- elemDesc.setAttr("SRC", ElemDesc.ATTRURL); // Netscape 4 extension
- elemDesc.setAttr("NOWRAP", ElemDesc.ATTREMPTY); // Internet-Explorer extension
-
- // ----------------------------------------------
- elemDesc = (ElemDesc) m_elementFlags.get("DL");
- elemDesc.setAttr("COMPACT", ElemDesc.ATTREMPTY);
-
- // ----------------------------------------------
- elemDesc = (ElemDesc) m_elementFlags.get("FORM");
- elemDesc.setAttr("ACTION", ElemDesc.ATTRURL);
-
- // ----------------------------------------------
- // Attribution to: "Voytenko, Dimitry" <DVoytenko@SECTORBASE.COM>
- elemDesc = (ElemDesc) m_elementFlags.get("FRAME");
- elemDesc.setAttr("SRC", ElemDesc.ATTRURL);
- elemDesc.setAttr("LONGDESC", ElemDesc.ATTRURL);
- elemDesc.setAttr("NORESIZE",ElemDesc.ATTREMPTY);
-
- // ----------------------------------------------
- elemDesc = (ElemDesc) m_elementFlags.get("HEAD");
- elemDesc.setAttr("PROFILE", ElemDesc.ATTRURL);
-
- // ----------------------------------------------
- elemDesc = (ElemDesc) m_elementFlags.get("HR");
- elemDesc.setAttr("NOSHADE", ElemDesc.ATTREMPTY);
-
- // ----------------------------------------------
- // HTML 4.0, section 16.5
- elemDesc = (ElemDesc) m_elementFlags.get("IFRAME");
- elemDesc.setAttr("SRC", ElemDesc.ATTRURL);
- elemDesc.setAttr("LONGDESC", ElemDesc.ATTRURL);
-
- // ----------------------------------------------
- // Netscape 4 extension
- elemDesc = (ElemDesc) m_elementFlags.get("ILAYER");
- elemDesc.setAttr("SRC", ElemDesc.ATTRURL);
-
- // ----------------------------------------------
- elemDesc = (ElemDesc) m_elementFlags.get("IMG");
- elemDesc.setAttr("SRC", ElemDesc.ATTRURL);
- elemDesc.setAttr("LONGDESC", ElemDesc.ATTRURL);
- elemDesc.setAttr("USEMAP", ElemDesc.ATTRURL);
- elemDesc.setAttr("ISMAP", ElemDesc.ATTREMPTY);
-
- // ----------------------------------------------
- elemDesc = (ElemDesc) m_elementFlags.get("INPUT");
- elemDesc.setAttr("SRC", ElemDesc.ATTRURL);
- elemDesc.setAttr("USEMAP", ElemDesc.ATTRURL);
- elemDesc.setAttr("CHECKED", ElemDesc.ATTREMPTY);
- elemDesc.setAttr("DISABLED", ElemDesc.ATTREMPTY);
- elemDesc.setAttr("ISMAP", ElemDesc.ATTREMPTY);
- elemDesc.setAttr("READONLY", ElemDesc.ATTREMPTY);
-
- // ----------------------------------------------
- elemDesc = (ElemDesc) m_elementFlags.get("INS");
- elemDesc.setAttr("CITE", ElemDesc.ATTRURL);
-
- // ----------------------------------------------
- // Netscape 4 extension
- elemDesc = (ElemDesc) m_elementFlags.get("LAYER");
- elemDesc.setAttr("SRC", ElemDesc.ATTRURL);
-
- // ----------------------------------------------
- elemDesc = (ElemDesc) m_elementFlags.get("LINK");
- elemDesc.setAttr("HREF", ElemDesc.ATTRURL);
-
- // ----------------------------------------------
- elemDesc = (ElemDesc) m_elementFlags.get("MENU");
- elemDesc.setAttr("COMPACT", ElemDesc.ATTREMPTY);
-
- // ----------------------------------------------
- elemDesc = (ElemDesc) m_elementFlags.get("OBJECT");
- elemDesc.setAttr("CLASSID", ElemDesc.ATTRURL);
- elemDesc.setAttr("CODEBASE", ElemDesc.ATTRURL);
- elemDesc.setAttr("DATA", ElemDesc.ATTRURL);
- elemDesc.setAttr("ARCHIVE", ElemDesc.ATTRURL);
- elemDesc.setAttr("USEMAP", ElemDesc.ATTRURL);
- elemDesc.setAttr("DECLARE", ElemDesc.ATTREMPTY);
-
- // ----------------------------------------------
- elemDesc = (ElemDesc) m_elementFlags.get("OL");
- elemDesc.setAttr("COMPACT", ElemDesc.ATTREMPTY);
-
- // ----------------------------------------------
- elemDesc = (ElemDesc) m_elementFlags.get("OPTGROUP");
- elemDesc.setAttr("DISABLED", ElemDesc.ATTREMPTY);
-
- // ----------------------------------------------
- elemDesc = (ElemDesc) m_elementFlags.get("OPTION");
- elemDesc.setAttr("SELECTED", ElemDesc.ATTREMPTY);
- elemDesc.setAttr("DISABLED", ElemDesc.ATTREMPTY);
-
- // ----------------------------------------------
- elemDesc = (ElemDesc) m_elementFlags.get("Q");
- elemDesc.setAttr("CITE", ElemDesc.ATTRURL);
-
- // ----------------------------------------------
- elemDesc = (ElemDesc) m_elementFlags.get("SCRIPT");
- elemDesc.setAttr("SRC", ElemDesc.ATTRURL);
- elemDesc.setAttr("FOR", ElemDesc.ATTRURL);
- elemDesc.setAttr("DEFER", ElemDesc.ATTREMPTY);
-
- // ----------------------------------------------
- elemDesc = (ElemDesc) m_elementFlags.get("SELECT");
- elemDesc.setAttr("DISABLED", ElemDesc.ATTREMPTY);
- elemDesc.setAttr("MULTIPLE", ElemDesc.ATTREMPTY);
-
- // ----------------------------------------------
- elemDesc = (ElemDesc) m_elementFlags.get("TABLE");
- elemDesc.setAttr("NOWRAP", ElemDesc.ATTREMPTY); // Internet-Explorer extension
-
- // ----------------------------------------------
- elemDesc = (ElemDesc) m_elementFlags.get("TD");
- elemDesc.setAttr("NOWRAP", ElemDesc.ATTREMPTY);
-
- // ----------------------------------------------
- elemDesc = (ElemDesc) m_elementFlags.get("TEXTAREA");
- elemDesc.setAttr("DISABLED", ElemDesc.ATTREMPTY);
- elemDesc.setAttr("READONLY", ElemDesc.ATTREMPTY);
-
- // ----------------------------------------------
- elemDesc = (ElemDesc) m_elementFlags.get("TH");
- elemDesc.setAttr("NOWRAP", ElemDesc.ATTREMPTY);
-
- // ----------------------------------------------
- // The nowrap attribute of a tr element is both
- // a Netscape and Internet-Explorer extension
- elemDesc = (ElemDesc) m_elementFlags.get("TR");
- elemDesc.setAttr("NOWRAP", ElemDesc.ATTREMPTY);
-
- // ----------------------------------------------
- elemDesc = (ElemDesc) m_elementFlags.get("UL");
- elemDesc.setAttr("COMPACT", ElemDesc.ATTREMPTY);
- }
-
- /**
- * Dummy element for elements not found.
- */
- static private final ElemDesc m_dummy = new ElemDesc(0 | ElemDesc.BLOCK);
-
- /** True if URLs should be specially escaped with the %xx form. */
- private boolean m_specialEscapeURLs = true;
-
- /** True if the META tag should be omitted. */
- private boolean m_omitMetaTag = false;
-
- /**
- * Tells if the formatter should use special URL escaping.
- *
- * @param bool True if URLs should be specially escaped with the %xx form.
- */
- public void setSpecialEscapeURLs(boolean bool)
- {
- m_specialEscapeURLs = bool;
- }
-
- /**
- * Tells if the formatter should omit the META tag.
- *
- * @param bool True if the META tag should be omitted.
- */
- public void setOmitMetaTag(boolean bool)
- {
- m_omitMetaTag = bool;
- }
-
- /**
- * Specifies an output format for this serializer. It the
- * serializer has already been associated with an output format,
- * it will switch to the new format. This method should not be
- * called while the serializer is in the process of serializing
- * a document.
- *
- * This method can be called multiple times before starting
- * the serialization of a particular result-tree. In principle
- * all serialization parameters can be changed, with the exception
- * of method="html" (it must be method="html" otherwise we
- * shouldn't even have a ToHTMLStream object here!)
- *
- * @param format The output format or serialzation parameters
- * to use.
- */
- public void setOutputFormat(Properties format)
- {
-
- m_specialEscapeURLs =
- OutputPropertyUtils.getBooleanProperty(
- OutputPropertiesFactory.S_USE_URL_ESCAPING,
- format);
-
- m_omitMetaTag =
- OutputPropertyUtils.getBooleanProperty(
- OutputPropertiesFactory.S_OMIT_META_TAG,
- format);
-
- super.setOutputFormat(format);
- }
-
- /**
- * Tells if the formatter should use special URL escaping.
- *
- * @return True if URLs should be specially escaped with the %xx form.
- */
- private final boolean getSpecialEscapeURLs()
- {
- return m_specialEscapeURLs;
- }
-
- /**
- * Tells if the formatter should omit the META tag.
- *
- * @return True if the META tag should be omitted.
- */
- private final boolean getOmitMetaTag()
- {
- return m_omitMetaTag;
- }
-
- /**
- * Get a description of the given element.
- *
- * @param name non-null name of element, case insensitive.
- *
- * @return non-null reference to ElemDesc, which may be m_dummy if no
- * element description matches the given name.
- */
- public static final ElemDesc getElemDesc(String name)
- {
- /* this method used to return m_dummy when name was null
- * but now it doesn't check and and requires non-null name.
- */
- Object obj = m_elementFlags.get(name);
- if (null != obj)
- return (ElemDesc)obj;
- return m_dummy;
- }
-
- /**
- * A Trie that is just a copy of the "static" one.
- * We need this one to be able to use the faster, but not thread-safe
- * method Trie.get2(name)
- */
- private Trie m_htmlInfo = new Trie(m_elementFlags);
- /**
- * Calls to this method could be replaced with calls to
- * getElemDesc(name), but this one should be faster.
- */
- private ElemDesc getElemDesc2(String name)
- {
- Object obj = m_htmlInfo.get2(name);
- if (null != obj)
- return (ElemDesc)obj;
- return m_dummy;
- }
-
- /**
- * Default constructor.
- */
- public ToHTMLStream()
- {
-
- super();
- m_charInfo = m_htmlcharInfo;
- // initialize namespaces
- m_prefixMap = new NamespaceMappings();
-
- }
-
- /** The name of the current element. */
-// private String m_currentElementName = null;
-
- /**
- * Receive notification of the beginning of a document.
- *
- * @throws org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- *
- * @throws org.xml.sax.SAXException
- */
- protected void startDocumentInternal() throws org.xml.sax.SAXException
- {
- super.startDocumentInternal();
-
- m_needToCallStartDocument = false;
- m_needToOutputDocTypeDecl = true;
- m_startNewLine = false;
- setOmitXMLDeclaration(true);
-
- if (true == m_needToOutputDocTypeDecl)
- {
- String doctypeSystem = getDoctypeSystem();
- String doctypePublic = getDoctypePublic();
- if ((null != doctypeSystem) || (null != doctypePublic))
- {
- final java.io.Writer writer = m_writer;
- try
- {
- writer.write("<!DOCTYPE html");
-
- if (null != doctypePublic)
- {
- writer.write(" PUBLIC \"");
- writer.write(doctypePublic);
- writer.write('"');
- }
-
- if (null != doctypeSystem)
- {
- if (null == doctypePublic)
- writer.write(" SYSTEM \"");
- else
- writer.write(" \"");
-
- writer.write(doctypeSystem);
- writer.write('"');
- }
-
- writer.write('>');
- outputLineSep();
- }
- catch(IOException e)
- {
- throw new SAXException(e);
- }
- }
- }
-
- m_needToOutputDocTypeDecl = false;
- }
-
- /**
- * Receive notification of the end of a document.
- *
- * @throws org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- *
- * @throws org.xml.sax.SAXException
- */
- public final void endDocument() throws org.xml.sax.SAXException
- {
-
- flushPending();
- if (m_doIndent && !m_isprevtext)
- {
- try
- {
- outputLineSep();
- }
- catch(IOException e)
- {
- throw new SAXException(e);
- }
- }
-
- flushWriter();
- if (m_tracer != null)
- super.fireEndDoc();
- }
-
- /**
- * Receive notification of the beginning of an element.
- *
- *
- * @param namespaceURI
- * @param localName
- * @param name The element type name.
- * @param atts The attributes attached to the element, if any.
- * @throws org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see #endElement
- * @see org.xml.sax.AttributeList
- */
- public void startElement(
- String namespaceURI,
- String localName,
- String name,
- Attributes atts)
- throws org.xml.sax.SAXException
- {
-
- ElemContext elemContext = m_elemContext;
-
- // clean up any pending things first
- if (elemContext.m_startTagOpen)
- {
- closeStartTag();
- elemContext.m_startTagOpen = false;
- }
- else if (m_cdataTagOpen)
- {
- closeCDATA();
- m_cdataTagOpen = false;
- }
- else if (m_needToCallStartDocument)
- {
- startDocumentInternal();
- m_needToCallStartDocument = false;
- }
-
-
- // if this element has a namespace then treat it like XML
- if (null != namespaceURI && namespaceURI.length() > 0)
- {
- super.startElement(namespaceURI, localName, name, atts);
-
- return;
- }
-
- try
- {
- // getElemDesc2(name) is faster than getElemDesc(name)
- ElemDesc elemDesc = getElemDesc2(name);
- int elemFlags = elemDesc.getFlags();
-
- // deal with indentation issues first
- if (m_doIndent)
- {
-
- boolean isBlockElement = (elemFlags & ElemDesc.BLOCK) != 0;
- if (m_ispreserve)
- m_ispreserve = false;
- else if (
- (null != elemContext.m_elementName)
- && (!m_inBlockElem
- || isBlockElement) /* && !isWhiteSpaceSensitive */
- )
- {
- m_startNewLine = true;
-
- indent();
-
- }
- m_inBlockElem = !isBlockElement;
- }
-
- // save any attributes for later processing
- if (atts != null)
- addAttributes(atts);
-
- m_isprevtext = false;
- final java.io.Writer writer = m_writer;
- writer.write('<');
- writer.write(name);
-
-
-
- if (m_tracer != null)
- firePseudoAttributes();
-
- if ((elemFlags & ElemDesc.EMPTY) != 0)
- {
- // an optimization for elements which are expected
- // to be empty.
- m_elemContext = elemContext.push();
- /* XSLTC sometimes calls namespaceAfterStartElement()
- * so we need to remember the name
- */
- m_elemContext.m_elementName = name;
- m_elemContext.m_elementDesc = elemDesc;
- return;
- }
- else
- {
- elemContext = elemContext.push(namespaceURI,localName,name);
- m_elemContext = elemContext;
- elemContext.m_elementDesc = elemDesc;
- elemContext.m_isRaw = (elemFlags & ElemDesc.RAW) != 0;
- }
-
-
- if ((elemFlags & ElemDesc.HEADELEM) != 0)
- {
- // This is the <HEAD> element, do some special processing
- closeStartTag();
- elemContext.m_startTagOpen = false;
- if (!m_omitMetaTag)
- {
- if (m_doIndent)
- indent();
- writer.write(
- "<META http-equiv=\"Content-Type\" content=\"text/html; charset=");
- String encoding = getEncoding();
- String encode = Encodings.getMimeEncoding(encoding);
- writer.write(encode);
- writer.write("\">");
- }
- }
- }
- catch (IOException e)
- {
- throw new SAXException(e);
- }
- }
-
- /**
- * Receive notification of the end of an element.
- *
- *
- * @param namespaceURI
- * @param localName
- * @param name The element type name
- * @throws org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- */
- public final void endElement(
- final String namespaceURI,
- final String localName,
- final String name)
- throws org.xml.sax.SAXException
- {
- // deal with any pending issues
- if (m_cdataTagOpen)
- closeCDATA();
-
- // if the element has a namespace, treat it like XML, not HTML
- if (null != namespaceURI && namespaceURI.length() > 0)
- {
- super.endElement(namespaceURI, localName, name);
-
- return;
- }
-
- try
- {
-
- ElemContext elemContext = m_elemContext;
- final ElemDesc elemDesc = elemContext.m_elementDesc;
- final int elemFlags = elemDesc.getFlags();
- final boolean elemEmpty = (elemFlags & ElemDesc.EMPTY) != 0;
-
- // deal with any indentation issues
- if (m_doIndent)
- {
- final boolean isBlockElement = (elemFlags&ElemDesc.BLOCK) != 0;
- boolean shouldIndent = false;
-
- if (m_ispreserve)
- {
- m_ispreserve = false;
- }
- else if (m_doIndent && (!m_inBlockElem || isBlockElement))
- {
- m_startNewLine = true;
- shouldIndent = true;
- }
- if (!elemContext.m_startTagOpen && shouldIndent)
- indent(elemContext.m_currentElemDepth - 1);
- m_inBlockElem = !isBlockElement;
- }
-
- final java.io.Writer writer = m_writer;
- if (!elemContext.m_startTagOpen)
- {
- writer.write("</");
- writer.write(name);
- writer.write('>');
- }
- else
- {
- // the start-tag open when this method was called,
- // so we need to process it now.
-
- if (m_tracer != null)
- super.fireStartElem(name);
-
- // the starting tag was still open when we received this endElement() call
- // so we need to process any gathered attributes NOW, before they go away.
- int nAttrs = m_attributes.getLength();
- if (nAttrs > 0)
- {
- processAttributes(m_writer, nAttrs);
- // clear attributes object for re-use with next element
- m_attributes.clear();
- }
- if (!elemEmpty)
- {
- // As per Dave/Paul recommendation 12/06/2000
- // if (shouldIndent)
- // writer.write('>');
- // indent(m_currentIndent);
-
- writer.write("></");
- writer.write(name);
- writer.write('>');
- }
- else
- {
- writer.write('>');
- }
- }
-
- // clean up because the element has ended
- if ((elemFlags & ElemDesc.WHITESPACESENSITIVE) != 0)
- m_ispreserve = true;
- m_isprevtext = false;
-
- // fire off the end element event
- if (m_tracer != null)
- super.fireEndElem(name);
-
- // OPTIMIZE-EMPTY
- if (elemEmpty)
- {
- // a quick exit if the HTML element had no children.
- // This block of code can be removed if the corresponding block of code
- // in startElement() also labeled with "OPTIMIZE-EMPTY" is also removed
- m_elemContext = elemContext.m_prev;
- return;
- }
-
- // some more clean because the element has ended.
- if (!elemContext.m_startTagOpen)
- {
- if (m_doIndent && !m_preserves.isEmpty())
- m_preserves.pop();
- }
- m_elemContext = elemContext.m_prev;
-// m_isRawStack.pop();
- }
- catch (IOException e)
- {
- throw new SAXException(e);
- }
- }
-
- /**
- * Process an attribute.
- * @param writer The writer to write the processed output to.
- * @param name The name of the attribute.
- * @param value The value of the attribute.
- * @param elemDesc The description of the HTML element
- * that has this attribute.
- *
- * @throws org.xml.sax.SAXException
- */
- protected void processAttribute(
- java.io.Writer writer,
- String name,
- String value,
- ElemDesc elemDesc)
- throws IOException
- {
- writer.write(' ');
-
- if ( ((value.length() == 0) || value.equalsIgnoreCase(name))
- && elemDesc != null
- && elemDesc.isAttrFlagSet(name, ElemDesc.ATTREMPTY))
- {
- writer.write(name);
- }
- else
- {
- // %REVIEW% %OPT%
- // Two calls to single-char write may NOT
- // be more efficient than one to string-write...
- writer.write(name);
- writer.write("=\"");
- if ( elemDesc != null
- && elemDesc.isAttrFlagSet(name, ElemDesc.ATTRURL))
- writeAttrURI(writer, value, m_specialEscapeURLs);
- else
- writeAttrString(writer, value, this.getEncoding());
- writer.write('"');
-
- }
- }
-
- /**
- * Tell if a character is an ASCII digit.
- */
- private boolean isASCIIDigit(char c)
- {
- return (c >= '0' && c <= '9');
- }
-
- /**
- * Make an integer into an HH hex value.
- * Does no checking on the size of the input, since this
- * is only meant to be used locally by writeAttrURI.
- *
- * @param i must be a value less than 255.
- *
- * @return should be a two character string.
- */
- private static String makeHHString(int i)
- {
- String s = Integer.toHexString(i).toUpperCase();
- if (s.length() == 1)
- {
- s = "0" + s;
- }
- return s;
- }
-
- /**
- * Dmitri Ilyin: Makes sure if the String is HH encoded sign.
- * @param str must be 2 characters long
- *
- * @return true or false
- */
- private boolean isHHSign(String str)
- {
- boolean sign = true;
- try
- {
- char r = (char) Integer.parseInt(str, 16);
- }
- catch (NumberFormatException e)
- {
- sign = false;
- }
- return sign;
- }
-
- /**
- * Write the specified <var>string</var> after substituting non ASCII characters,
- * with <CODE>%HH</CODE>, where HH is the hex of the byte value.
- *
- * @param string String to convert to XML format.
- * @param doURLEscaping True if we should try to encode as
- * per http://www.ietf.org/rfc/rfc2396.txt.
- *
- * @throws org.xml.sax.SAXException if a bad surrogate pair is detected.
- */
- public void writeAttrURI(
- final java.io.Writer writer, String string, boolean doURLEscaping)
- throws IOException
- {
- // http://www.ietf.org/rfc/rfc2396.txt says:
- // A URI is always in an "escaped" form, since escaping or unescaping a
- // completed URI might change its semantics. Normally, the only time
- // escape encodings can safely be made is when the URI is being created
- // from its component parts; each component may have its own set of
- // characters that are reserved, so only the mechanism responsible for
- // generating or interpreting that component can determine whether or
- // not escaping a character will change its semantics. Likewise, a URI
- // must be separated into its components before the escaped characters
- // within those components can be safely decoded.
- //
- // ...So we do our best to do limited escaping of the URL, without
- // causing damage. If the URL is already properly escaped, in theory, this
- // function should not change the string value.
-
- final int end = string.length();
- if (end > m_attrBuff.length)
- {
- m_attrBuff = new char[end*2 + 1];
- }
- string.getChars(0,end, m_attrBuff, 0);
- final char[] chars = m_attrBuff;
-
- int cleanStart = 0;
- int cleanLength = 0;
-
-
- char ch = 0;
- for (int i = 0; i < end; i++)
- {
- ch = chars[i];
-
- if ((ch < 32) || (ch > 126))
- {
- if (cleanLength > 0)
- {
- writer.write(chars, cleanStart, cleanLength);
- cleanLength = 0;
- }
- if (doURLEscaping)
- {
- // Encode UTF16 to UTF8.
- // Reference is Unicode, A Primer, by Tony Graham.
- // Page 92.
-
- // Note that Kay doesn't escape 0x20...
- // if(ch == 0x20) // Not sure about this... -sb
- // {
- // writer.write(ch);
- // }
- // else
- if (ch <= 0x7F)
- {
- writer.write('%');
- writer.write(makeHHString(ch));
- }
- else if (ch <= 0x7FF)
- {
- // Clear low 6 bits before rotate, put high 4 bits in low byte,
- // and set two high bits.
- int high = (ch >> 6) | 0xC0;
- int low = (ch & 0x3F) | 0x80;
- // First 6 bits, + high bit
- writer.write('%');
- writer.write(makeHHString(high));
- writer.write('%');
- writer.write(makeHHString(low));
- }
- else if (Encodings.isHighUTF16Surrogate(ch)) // high surrogate
- {
- // I'm sure this can be done in 3 instructions, but I choose
- // to try and do it exactly like it is done in the book, at least
- // until we are sure this is totally clean. I don't think performance
- // is a big issue with this particular function, though I could be
- // wrong. Also, the stuff below clearly does more masking than
- // it needs to do.
-
- // Clear high 6 bits.
- int highSurrogate = ((int) ch) & 0x03FF;
-
- // Middle 4 bits (wwww) + 1
- // "Note that the value of wwww from the high surrogate bit pattern
- // is incremented to make the uuuuu bit pattern in the scalar value
- // so the surrogate pair don't address the BMP."
- int wwww = ((highSurrogate & 0x03C0) >> 6);
- int uuuuu = wwww + 1;
-
- // next 4 bits
- int zzzz = (highSurrogate & 0x003C) >> 2;
-
- // low 2 bits
- int yyyyyy = ((highSurrogate & 0x0003) << 4) & 0x30;
-
- // Get low surrogate character.
- ch = chars[++i];
-
- // Clear high 6 bits.
- int lowSurrogate = ((int) ch) & 0x03FF;
-
- // put the middle 4 bits into the bottom of yyyyyy (byte 3)
- yyyyyy = yyyyyy | ((lowSurrogate & 0x03C0) >> 6);
-
- // bottom 6 bits.
- int xxxxxx = (lowSurrogate & 0x003F);
-
- int byte1 = 0xF0 | (uuuuu >> 2); // top 3 bits of uuuuu
- int byte2 =
- 0x80 | (((uuuuu & 0x03) << 4) & 0x30) | zzzz;
- int byte3 = 0x80 | yyyyyy;
- int byte4 = 0x80 | xxxxxx;
-
- writer.write('%');
- writer.write(makeHHString(byte1));
- writer.write('%');
- writer.write(makeHHString(byte2));
- writer.write('%');
- writer.write(makeHHString(byte3));
- writer.write('%');
- writer.write(makeHHString(byte4));
- }
- else
- {
- int high = (ch >> 12) | 0xE0; // top 4 bits
- int middle = ((ch & 0x0FC0) >> 6) | 0x80;
- // middle 6 bits
- int low = (ch & 0x3F) | 0x80;
- // First 6 bits, + high bit
- writer.write('%');
- writer.write(makeHHString(high));
- writer.write('%');
- writer.write(makeHHString(middle));
- writer.write('%');
- writer.write(makeHHString(low));
- }
-
- }
- else if (escapingNotNeeded(ch))
- {
- writer.write(ch);
- }
- else
- {
- writer.write("&#");
- writer.write(Integer.toString(ch));
- writer.write(';');
- }
- // In this character range we have first written out any previously accumulated
- // "clean" characters, then processed the current more complicated character,
- // which may have incremented "i".
- // We now we reset the next possible clean character.
- cleanStart = i + 1;
- }
- // Since http://www.ietf.org/rfc/rfc2396.txt refers to the URI grammar as
- // not allowing quotes in the URI proper syntax, nor in the fragment
- // identifier, we believe that it's OK to double escape quotes.
- else if (ch == '"')
- {
- // If the character is a '%' number number, try to avoid double-escaping.
- // There is a question if this is legal behavior.
-
- // Dmitri Ilyin: to check if '%' number number is invalid. It must be checked if %xx is a sign, that would be encoded
- // The encoded signes are in Hex form. So %xx my be in form %3C that is "<" sign. I will try to change here a little.
-
- // if( ((i+2) < len) && isASCIIDigit(stringArray[i+1]) && isASCIIDigit(stringArray[i+2]) )
-
- // We are no longer escaping '%'
-
- if (cleanLength > 0)
- {
- writer.write(chars, cleanStart, cleanLength);
- cleanLength = 0;
- }
-
-
- // Mike Kay encodes this as &#34;, so he may know something I don't?
- if (doURLEscaping)
- writer.write("%22");
- else
- writer.write("&quot;"); // we have to escape this, I guess.
-
- // We have written out any clean characters, then the escaped '%' and now we
- // We now we reset the next possible clean character.
- cleanStart = i + 1;
- }
- else if (ch == '&')
- {
- // HTML 4.01 reads, "Authors should use "&amp;" (ASCII decimal 38)
- // instead of "&" to avoid confusion with the beginning of a character
- // reference (entity reference open delimiter).
- if (cleanLength > 0)
- {
- writer.write(chars, cleanStart, cleanLength);
- cleanLength = 0;
- }
- writer.write("&amp;");
- cleanStart = i + 1;
- }
- else
- {
- // no processing for this character, just count how
- // many characters in a row that we have that need no processing
- cleanLength++;
- }
- }
-
- // are there any clean characters at the end of the array
- // that we haven't processed yet?
- if (cleanLength > 1)
- {
- // if the whole string can be written out as-is do so
- // otherwise write out the clean chars at the end of the
- // array
- if (cleanStart == 0)
- writer.write(string);
- else
- writer.write(chars, cleanStart, cleanLength);
- }
- else if (cleanLength == 1)
- {
- // a little optimization for 1 clean character
- // (we could have let the previous if(...) handle them all)
- writer.write(ch);
- }
- }
-
- /**
- * Writes the specified <var>string</var> after substituting <VAR>specials</VAR>,
- * and UTF-16 surrogates for character references <CODE>&amp;#xnn</CODE>.
- *
- * @param string String to convert to XML format.
- * @param encoding CURRENTLY NOT IMPLEMENTED.
- *
- * @throws org.xml.sax.SAXException
- */
- public void writeAttrString(
- final java.io.Writer writer, String string, String encoding)
- throws IOException
- {
- final int end = string.length();
- if (end > m_attrBuff.length)
- {
- m_attrBuff = new char[end * 2 + 1];
- }
- string.getChars(0, end, m_attrBuff, 0);
- final char[] chars = m_attrBuff;
-
-
-
- int cleanStart = 0;
- int cleanLength = 0;
-
- char ch = 0;
- for (int i = 0; i < end; i++)
- {
- ch = chars[i];
-
- // System.out.println("SPECIALSSIZE: "+SPECIALSSIZE);
- // System.out.println("ch: "+(int)ch);
- // System.out.println("m_maxCharacter: "+(int)m_maxCharacter);
- // System.out.println("m_attrCharsMap[ch]: "+(int)m_attrCharsMap[ch]);
- if (escapingNotNeeded(ch) && (!m_charInfo.isSpecialAttrChar(ch)))
- {
- cleanLength++;
- }
- else if ('<' == ch || '>' == ch)
- {
- cleanLength++; // no escaping in this case, as specified in 15.2
- }
- else if (
- ('&' == ch) && ((i + 1) < end) && ('{' == chars[i + 1]))
- {
- cleanLength++; // no escaping in this case, as specified in 15.2
- }
- else
- {
- if (cleanLength > 0)
- {
- writer.write(chars,cleanStart,cleanLength);
- cleanLength = 0;
- }
- int pos = accumDefaultEntity(writer, ch, i, chars, end, false, true);
-
- if (i != pos)
- {
- i = pos - 1;
- }
- else
- {
- if (Encodings.isHighUTF16Surrogate(ch))
- {
-
- writeUTF16Surrogate(ch, chars, i, end);
- i++; // two input characters processed
- // this increments by one and the for()
- // loop itself increments by another one.
- }
-
- // The next is kind of a hack to keep from escaping in the case
- // of Shift_JIS and the like.
-
- /*
- else if ((ch < m_maxCharacter) && (m_maxCharacter == 0xFFFF)
- && (ch != 160))
- {
- writer.write(ch); // no escaping in this case
- }
- else
- */
- String outputStringForChar = m_charInfo.getOutputStringForChar(ch);
- if (null != outputStringForChar)
- {
- writer.write(outputStringForChar);
- }
- else if (escapingNotNeeded(ch))
- {
- writer.write(ch); // no escaping in this case
- }
- else
- {
- writer.write("&#");
- writer.write(Integer.toString(ch));
- writer.write(';');
- }
- }
- cleanStart = i + 1;
- }
- } // end of for()
-
- // are there any clean characters at the end of the array
- // that we haven't processed yet?
- if (cleanLength > 1)
- {
- // if the whole string can be written out as-is do so
- // otherwise write out the clean chars at the end of the
- // array
- if (cleanStart == 0)
- writer.write(string);
- else
- writer.write(chars, cleanStart, cleanLength);
- }
- else if (cleanLength == 1)
- {
- // a little optimization for 1 clean character
- // (we could have let the previous if(...) handle them all)
- writer.write(ch);
- }
- }
-
-
-
- /**
- * Receive notification of character data.
- *
- * <p>The Parser will call this method to report each chunk of
- * character data. SAX parsers may return all contiguous character
- * data in a single chunk, or they may split it into several
- * chunks; however, all of the characters in any single event
- * must come from the same external entity, so that the Locator
- * provides useful information.</p>
- *
- * <p>The application must not attempt to read from the array
- * outside of the specified range.</p>
- *
- * <p>Note that some parsers will report whitespace using the
- * ignorableWhitespace() method rather than this one (validating
- * parsers must do so).</p>
- *
- * @param chars The characters from the XML document.
- * @param start The start position in the array.
- * @param length The number of characters to read from the array.
- * @throws org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see #ignorableWhitespace
- * @see org.xml.sax.Locator
- *
- * @throws org.xml.sax.SAXException
- */
- public final void characters(char chars[], int start, int length)
- throws org.xml.sax.SAXException
- {
-
- if (m_elemContext.m_isRaw)
- {
- try
- {
- if (m_elemContext.m_startTagOpen)
- {
- closeStartTag();
- m_elemContext.m_startTagOpen = false;
- }
- m_ispreserve = true;
-
-// With m_ispreserve just set true it looks like shouldIndent()
-// will always return false, so drop any possible indentation.
-// if (shouldIndent())
-// indent();
-
- // writer.write("<![CDATA[");
- // writer.write(chars, start, length);
- writeNormalizedChars(chars, start, length, false, m_lineSepUse);
-
- // writer.write("]]>");
-
- // time to generate characters event
- if (m_tracer != null)
- super.fireCharEvent(chars, start, length);
-
- return;
- }
- catch (IOException ioe)
- {
- throw new org.xml.sax.SAXException(
- Utils.messages.createMessage(
- MsgKey.ER_OIERROR,
- null),
- ioe);
- //"IO error", ioe);
- }
- }
- else
- {
- super.characters(chars, start, length);
- }
- }
-
- /**
- * Receive notification of cdata.
- *
- * <p>The Parser will call this method to report each chunk of
- * character data. SAX parsers may return all contiguous character
- * data in a single chunk, or they may split it into several
- * chunks; however, all of the characters in any single event
- * must come from the same external entity, so that the Locator
- * provides useful information.</p>
- *
- * <p>The application must not attempt to read from the array
- * outside of the specified range.</p>
- *
- * <p>Note that some parsers will report whitespace using the
- * ignorableWhitespace() method rather than this one (validating
- * parsers must do so).</p>
- *
- * @param ch The characters from the XML document.
- * @param start The start position in the array.
- * @param length The number of characters to read from the array.
- * @throws org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see #ignorableWhitespace
- * @see org.xml.sax.Locator
- *
- * @throws org.xml.sax.SAXException
- */
- public final void cdata(char ch[], int start, int length)
- throws org.xml.sax.SAXException
- {
-
- if ((null != m_elemContext.m_elementName)
- && (m_elemContext.m_elementName.equalsIgnoreCase("SCRIPT")
- || m_elemContext.m_elementName.equalsIgnoreCase("STYLE")))
- {
- try
- {
- if (m_elemContext.m_startTagOpen)
- {
- closeStartTag();
- m_elemContext.m_startTagOpen = false;
- }
-
- m_ispreserve = true;
-
- if (shouldIndent())
- indent();
-
- // writer.write(ch, start, length);
- writeNormalizedChars(ch, start, length, true, m_lineSepUse);
- }
- catch (IOException ioe)
- {
- throw new org.xml.sax.SAXException(
- Utils.messages.createMessage(
- MsgKey.ER_OIERROR,
- null),
- ioe);
- //"IO error", ioe);
- }
- }
- else
- {
- super.cdata(ch, start, length);
- }
- }
-
- /**
- * Receive notification of a processing instruction.
- *
- * @param target The processing instruction target.
- * @param data The processing instruction data, or null if
- * none was supplied.
- * @throws org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- *
- * @throws org.xml.sax.SAXException
- */
- public void processingInstruction(String target, String data)
- throws org.xml.sax.SAXException
- {
-
- // Process any pending starDocument and startElement first.
- flushPending();
-
- // Use a fairly nasty hack to tell if the next node is supposed to be
- // unescaped text.
- if (target.equals(Result.PI_DISABLE_OUTPUT_ESCAPING))
- {
- startNonEscaping();
- }
- else if (target.equals(Result.PI_ENABLE_OUTPUT_ESCAPING))
- {
- endNonEscaping();
- }
- else
- {
- try
- {
- if (m_elemContext.m_startTagOpen)
- {
- closeStartTag();
- m_elemContext.m_startTagOpen = false;
- }
- else if (m_needToCallStartDocument)
- startDocumentInternal();
-
- if (shouldIndent())
- indent();
-
- final java.io.Writer writer = m_writer;
- //writer.write("<?" + target);
- writer.write("<?");
- writer.write(target);
-
- if (data.length() > 0 && !Character.isSpaceChar(data.charAt(0)))
- writer.write(' ');
-
- //writer.write(data + ">"); // different from XML
- writer.write(data); // different from XML
- writer.write('>'); // different from XML
-
- // Always output a newline char if not inside of an
- // element. The whitespace is not significant in that
- // case.
- if (m_elemContext.m_currentElemDepth <= 0)
- outputLineSep();
-
- m_startNewLine = true;
- }
- catch(IOException e)
- {
- throw new SAXException(e);
- }
- }
-
- // now generate the PI event
- if (m_tracer != null)
- super.fireEscapingEvent(target, data);
- }
-
- /**
- * Receive notivication of a entityReference.
- *
- * @param name non-null reference to entity name string.
- *
- * @throws org.xml.sax.SAXException
- */
- public final void entityReference(String name)
- throws org.xml.sax.SAXException
- {
- try
- {
-
- final java.io.Writer writer = m_writer;
- writer.write('&');
- writer.write(name);
- writer.write(';');
-
- } catch(IOException e)
- {
- throw new SAXException(e);
- }
- }
- /**
- * @see ExtendedContentHandler#endElement(String)
- */
- public final void endElement(String elemName) throws SAXException
- {
- endElement(null, null, elemName);
- }
-
- /**
- * Process the attributes, which means to write out the currently
- * collected attributes to the writer. The attributes are not
- * cleared by this method
- *
- * @param writer the writer to write processed attributes to.
- * @param nAttrs the number of attributes in m_attributes
- * to be processed
- *
- * @throws org.xml.sax.SAXException
- */
- public void processAttributes(java.io.Writer writer, int nAttrs)
- throws IOException,SAXException
- {
- /*
- * process the collected attributes
- */
- for (int i = 0; i < nAttrs; i++)
- {
- processAttribute(
- writer,
- m_attributes.getQName(i),
- m_attributes.getValue(i),
- m_elemContext.m_elementDesc);
- }
- }
-
- /**
- * For the enclosing elements starting tag write out out any attributes
- * followed by ">"
- *
- *@throws org.xml.sax.SAXException
- */
- protected void closeStartTag() throws SAXException
- {
- try
- {
-
- // finish processing attributes, time to fire off the start element event
- if (m_tracer != null)
- super.fireStartElem(m_elemContext.m_elementName);
-
- int nAttrs = m_attributes.getLength();
- if (nAttrs>0)
- {
- processAttributes(m_writer, nAttrs);
- // clear attributes object for re-use with next element
- m_attributes.clear();
- }
-
- m_writer.write('>');
-
- /* whether Xalan or XSLTC, we have the prefix mappings now, so
- * lets determine if the current element is specified in the cdata-
- * section-elements list.
- */
- if (m_cdataSectionElements != null)
- m_elemContext.m_isCdataSection = isCdataSection();
- if (m_doIndent)
- {
- m_isprevtext = false;
- m_preserves.push(m_ispreserve);
- }
-
- }
- catch(IOException e)
- {
- throw new SAXException(e);
- }
- }
- /**
- * Initialize the serializer with the specified output stream and output
- * format. Must be called before calling any of the serialize methods.
- *
- * @param output The output stream to use
- * @param format The output format
- * @throws UnsupportedEncodingException The encoding specified in the
- * output format is not supported
- */
- protected synchronized void init(OutputStream output, Properties format)
- throws UnsupportedEncodingException
- {
- if (null == format)
- {
- format = OutputPropertiesFactory.getDefaultMethodProperties(Method.HTML);
- }
- super.init(output,format, false);
- }
-
- /**
- * Specifies an output stream to which the document should be
- * serialized. This method should not be called while the
- * serializer is in the process of serializing a document.
- * <p>
- * The encoding specified in the output properties is used, or
- * if no encoding was specified, the default for the selected
- * output method.
- *
- * @param output The output stream
- */
- public void setOutputStream(OutputStream output)
- {
-
- try
- {
- Properties format;
- if (null == m_format)
- format = OutputPropertiesFactory.getDefaultMethodProperties(Method.HTML);
- else
- format = m_format;
- init(output, format, true);
- }
- catch (UnsupportedEncodingException uee)
- {
-
- // Should have been warned in init, I guess...
- }
- }
- /**
- * This method is used when a prefix/uri namespace mapping
- * is indicated after the element was started with a
- * startElement() and before and endElement().
- * startPrefixMapping(prefix,uri) would be used before the
- * startElement() call.
- * @param uri the URI of the namespace
- * @param prefix the prefix associated with the given URI.
- *
- * @see ExtendedContentHandler#namespaceAfterStartElement(String, String)
- */
- public void namespaceAfterStartElement(String prefix, String uri)
- throws SAXException
- {
- // hack for XSLTC with finding URI for default namespace
- if (m_elemContext.m_elementURI == null)
- {
- String prefix1 = getPrefixPart(m_elemContext.m_elementName);
- if (prefix1 == null && EMPTYSTRING.equals(prefix))
- {
- // the elements URI is not known yet, and it
- // doesn't have a prefix, and we are currently
- // setting the uri for prefix "", so we have
- // the uri for the element... lets remember it
- m_elemContext.m_elementURI = uri;
- }
- }
- startPrefixMapping(prefix,uri,false);
- }
-
- public void startDTD(String name, String publicId, String systemId)
- throws SAXException
- {
- m_inDTD = true;
- super.startDTD(name, publicId, systemId);
- }
-
- /**
- * Report the end of DTD declarations.
- * @throws org.xml.sax.SAXException The application may raise an exception.
- * @see #startDTD
- */
- public void endDTD() throws org.xml.sax.SAXException
- {
- m_inDTD = false;
- /* for ToHTMLStream the DOCTYPE is entirely output in the
- * startDocumentInternal() method, so don't do anything here
- */
- }
- /**
- * This method does nothing.
- */
- public void attributeDecl(
- String eName,
- String aName,
- String type,
- String valueDefault,
- String value)
- throws SAXException
- {
- // The internal DTD subset is not serialized by the ToHTMLStream serializer
- }
-
- /**
- * This method does nothing.
- */
- public void elementDecl(String name, String model) throws SAXException
- {
- // The internal DTD subset is not serialized by the ToHTMLStream serializer
- }
- /**
- * This method does nothing.
- */
- public void internalEntityDecl(String name, String value)
- throws SAXException
- {
- // The internal DTD subset is not serialized by the ToHTMLStream serializer
- }
- /**
- * This method does nothing.
- */
- public void externalEntityDecl(
- String name,
- String publicId,
- String systemId)
- throws SAXException
- {
- // The internal DTD subset is not serialized by the ToHTMLStream serializer
- }
-
- /**
- * This method is used to add an attribute to the currently open element.
- * The caller has guaranted that this attribute is unique, which means that it
- * not been seen before and will not be seen again.
- *
- * @param name the qualified name of the attribute
- * @param value the value of the attribute which can contain only
- * ASCII printable characters characters in the range 32 to 127 inclusive.
- * @param flags the bit values of this integer give optimization information.
- */
- public void addUniqueAttribute(String name, String value, int flags)
- throws SAXException
- {
- try
- {
- final java.io.Writer writer = m_writer;
- if ((flags & NO_BAD_CHARS) > 0 && m_htmlcharInfo.onlyQuotAmpLtGt)
- {
- // "flags" has indicated that the characters
- // '>' '<' '&' and '"' are not in the value and
- // m_htmlcharInfo has recorded that there are no other
- // entities in the range 0 to 127 so we write out the
- // value directly
- writer.write(' ');
- writer.write(name);
- writer.write("=\"");
- writer.write(value);
- writer.write('"');
- }
- else if (
- (flags & HTML_ATTREMPTY) > 0
- && (value.length() == 0 || value.equalsIgnoreCase(name)))
- {
- writer.write(' ');
- writer.write(name);
- }
- else
- {
- writer.write(' ');
- writer.write(name);
- writer.write("=\"");
- if ((flags & HTML_ATTRURL) > 0)
- {
- writeAttrURI(writer, value, m_specialEscapeURLs);
- }
- else
- {
- writeAttrString(writer, value, this.getEncoding());
- }
- writer.write('"');
- }
- } catch (IOException e) {
- throw new SAXException(e);
- }
- }
-
- public void comment(char ch[], int start, int length)
- throws SAXException
- {
- // The internal DTD subset is not serialized by the ToHTMLStream serializer
- if (m_inDTD)
- return;
- super.comment(ch, start, length);
- }
-
- public boolean reset()
- {
- boolean ret = super.reset();
- if (!ret)
- return false;
- initToHTMLStream();
- return true;
- }
-
- private void initToHTMLStream()
- {
-// m_elementDesc = null;
- m_inBlockElem = false;
- m_inDTD = false;
-// m_isRawStack.clear();
- m_omitMetaTag = false;
- m_specialEscapeURLs = true;
- }
-
- static class Trie
- {
- /**
- * A digital search trie for 7-bit ASCII text
- * The API is a subset of java.util.Hashtable
- * The key must be a 7-bit ASCII string
- * The value may be any Java Object
- * One can get an object stored in a trie from its key,
- * but the search is either case sensitive or case
- * insensitive to the characters in the key, and this
- * choice of sensitivity or insensitivity is made when
- * the Trie is created, before any objects are put in it.
- *
- * This class is a copy of the one in com.sun.org.apache.xml.internal.utils.
- * It exists to cut the serializers dependancy on that package.
- *
- * @xsl.usage internal
- */
-
- /** Size of the m_nextChar array. */
- public static final int ALPHA_SIZE = 128;
-
- /** The root node of the tree. */
- final Node m_Root;
-
- /** helper buffer to convert Strings to char arrays */
- private char[] m_charBuffer = new char[0];
-
- /** true if the search for an object is lower case only with the key */
- private final boolean m_lowerCaseOnly;
-
- /**
- * Construct the trie that has a case insensitive search.
- */
- public Trie()
- {
- m_Root = new Node();
- m_lowerCaseOnly = false;
- }
-
- /**
- * Construct the trie given the desired case sensitivity with the key.
- * @param lowerCaseOnly true if the search keys are to be loser case only,
- * not case insensitive.
- */
- public Trie(boolean lowerCaseOnly)
- {
- m_Root = new Node();
- m_lowerCaseOnly = lowerCaseOnly;
- }
-
- /**
- * Put an object into the trie for lookup.
- *
- * @param key must be a 7-bit ASCII string
- * @param value any java object.
- *
- * @return The old object that matched key, or null.
- */
- public Object put(String key, Object value)
- {
-
- final int len = key.length();
- if (len > m_charBuffer.length)
- {
- // make the biggest buffer ever needed in get(String)
- m_charBuffer = new char[len];
- }
-
- Node node = m_Root;
-
- for (int i = 0; i < len; i++)
- {
- Node nextNode =
- node.m_nextChar[Character.toLowerCase(key.charAt(i))];
-
- if (nextNode != null)
- {
- node = nextNode;
- }
- else
- {
- for (; i < len; i++)
- {
- Node newNode = new Node();
- if (m_lowerCaseOnly)
- {
- // put this value into the tree only with a lower case key
- node.m_nextChar[Character.toLowerCase(
- key.charAt(i))] =
- newNode;
- }
- else
- {
- // put this value into the tree with a case insensitive key
- node.m_nextChar[Character.toUpperCase(
- key.charAt(i))] =
- newNode;
- node.m_nextChar[Character.toLowerCase(
- key.charAt(i))] =
- newNode;
- }
- node = newNode;
- }
- break;
- }
- }
-
- Object ret = node.m_Value;
-
- node.m_Value = value;
-
- return ret;
- }
-
- /**
- * Get an object that matches the key.
- *
- * @param key must be a 7-bit ASCII string
- *
- * @return The object that matches the key, or null.
- */
- public Object get(final String key)
- {
-
- final int len = key.length();
-
- /* If the name is too long, we won't find it, this also keeps us
- * from overflowing m_charBuffer
- */
- if (m_charBuffer.length < len)
- return null;
-
- Node node = m_Root;
- switch (len) // optimize the look up based on the number of chars
- {
- // case 0 looks silly, but the generated bytecode runs
- // faster for lookup of elements of length 2 with this in
- // and a fair bit faster. Don't know why.
- case 0 :
- {
- return null;
- }
-
- case 1 :
- {
- final char ch = key.charAt(0);
- if (ch < ALPHA_SIZE)
- {
- node = node.m_nextChar[ch];
- if (node != null)
- return node.m_Value;
- }
- return null;
- }
- // comment out case 2 because the default is faster
- // case 2 :
- // {
- // final char ch0 = key.charAt(0);
- // final char ch1 = key.charAt(1);
- // if (ch0 < ALPHA_SIZE && ch1 < ALPHA_SIZE)
- // {
- // node = node.m_nextChar[ch0];
- // if (node != null)
- // {
- //
- // if (ch1 < ALPHA_SIZE)
- // {
- // node = node.m_nextChar[ch1];
- // if (node != null)
- // return node.m_Value;
- // }
- // }
- // }
- // return null;
- // }
- default :
- {
- for (int i = 0; i < len; i++)
- {
- // A thread-safe way to loop over the characters
- final char ch = key.charAt(i);
- if (ALPHA_SIZE <= ch)
- {
- // the key is not 7-bit ASCII so we won't find it here
- return null;
- }
-
- node = node.m_nextChar[ch];
- if (node == null)
- return null;
- }
-
- return node.m_Value;
- }
- }
- }
-
- /**
- * The node representation for the trie.
- * @xsl.usage internal
- */
- private class Node
- {
-
- /**
- * Constructor, creates a Node[ALPHA_SIZE].
- */
- Node()
- {
- m_nextChar = new Node[ALPHA_SIZE];
- m_Value = null;
- }
-
- /** The next nodes. */
- final Node m_nextChar[];
-
- /** The value. */
- Object m_Value;
- }
- /**
- * Construct the trie from another Trie.
- * Both the existing Trie and this new one share the same table for
- * lookup, and it is assumed that the table is fully populated and
- * not changing anymore.
- *
- * @param existingTrie the Trie that this one is a copy of.
- */
- public Trie(Trie existingTrie)
- {
- // copy some fields from the existing Trie into this one.
- m_Root = existingTrie.m_Root;
- m_lowerCaseOnly = existingTrie.m_lowerCaseOnly;
-
- // get a buffer just big enough to hold the longest key in the table.
- int max = existingTrie.getLongestKeyLength();
- m_charBuffer = new char[max];
- }
-
- /**
- * Get an object that matches the key.
- * This method is faster than get(), but is not thread-safe.
- *
- * @param key must be a 7-bit ASCII string
- *
- * @return The object that matches the key, or null.
- */
- public Object get2(final String key)
- {
-
- final int len = key.length();
-
- /* If the name is too long, we won't find it, this also keeps us
- * from overflowing m_charBuffer
- */
- if (m_charBuffer.length < len)
- return null;
-
- Node node = m_Root;
- switch (len) // optimize the look up based on the number of chars
- {
- // case 0 looks silly, but the generated bytecode runs
- // faster for lookup of elements of length 2 with this in
- // and a fair bit faster. Don't know why.
- case 0 :
- {
- return null;
- }
-
- case 1 :
- {
- final char ch = key.charAt(0);
- if (ch < ALPHA_SIZE)
- {
- node = node.m_nextChar[ch];
- if (node != null)
- return node.m_Value;
- }
- return null;
- }
- default :
- {
- /* Copy string into array. This is not thread-safe because
- * it modifies the contents of m_charBuffer. If multiple
- * threads were to use this Trie they all would be
- * using this same array (not good). So this
- * method is not thread-safe, but it is faster because
- * converting to a char[] and looping over elements of
- * the array is faster than a String's charAt(i).
- */
- key.getChars(0, len, m_charBuffer, 0);
-
- for (int i = 0; i < len; i++)
- {
- final char ch = m_charBuffer[i];
- if (ALPHA_SIZE <= ch)
- {
- // the key is not 7-bit ASCII so we won't find it here
- return null;
- }
-
- node = node.m_nextChar[ch];
- if (node == null)
- return null;
- }
-
- return node.m_Value;
- }
- }
- }
-
- /**
- * Get the length of the longest key used in the table.
- */
- public int getLongestKeyLength()
- {
- return m_charBuffer.length;
- }
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/ToSAXHandler.java b/src/com/sun/org/apache/xml/internal/serializer/ToSAXHandler.java
deleted file mode 100644
index e6bc70a..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/ToSAXHandler.java
+++ /dev/null
@@ -1,440 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ToSAXHandler.java,v 1.2.4.1 2005/09/22 11:03:15 pvedula Exp $
- */
-package com.sun.org.apache.xml.internal.serializer;
-
-import java.util.Vector;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.ext.LexicalHandler;
-
-/**
- * This class is used to provide a base behavior to be inherited
- * by other To...SAXHandler serializers.
- *
- * This class is not a public API.
- *
- * @xsl.usage internal
- */
-public abstract class ToSAXHandler extends SerializerBase
-{
- public ToSAXHandler()
- {
- }
-
- public ToSAXHandler(
- ContentHandler hdlr,
- LexicalHandler lex,
- String encoding)
- {
- setContentHandler(hdlr);
- setLexHandler(lex);
- setEncoding(encoding);
- }
- public ToSAXHandler(ContentHandler handler, String encoding)
- {
- setContentHandler(handler);
- setEncoding(encoding);
- }
-
- /**
- * Underlying SAX handler. Taken from XSLTC
- */
- protected ContentHandler m_saxHandler;
-
- /**
- * Underlying LexicalHandler. Taken from XSLTC
- */
- protected LexicalHandler m_lexHandler;
-
- /**
- * A startPrefixMapping() call on a ToSAXHandler will pass that call
- * on to the wrapped ContentHandler, but should we also mirror these calls
- * with matching attributes, if so this field is true.
- * For example if this field is true then a call such as
- * startPrefixMapping("prefix1","uri1") will also cause the additional
- * internally generated attribute xmlns:prefix1="uri1" to be effectively added
- * to the attributes passed to the wrapped ContentHandler.
- */
- private boolean m_shouldGenerateNSAttribute = true;
-
- /** If this is true, then the content handler wrapped by this
- * serializer implements the TransformState interface which
- * will give the content handler access to the state of
- * the transform. */
- protected TransformStateSetter m_state = null;
-
- /**
- * Pass callback to the SAX Handler
- */
- protected void startDocumentInternal() throws SAXException
- {
- if (m_needToCallStartDocument)
- {
- super.startDocumentInternal();
-
- m_saxHandler.startDocument();
- m_needToCallStartDocument = false;
- }
- }
- /**
- * Do nothing.
- * @see org.xml.sax.ext.LexicalHandler#startDTD(String, String, String)
- */
- public void startDTD(String arg0, String arg1, String arg2)
- throws SAXException
- {
- // do nothing for now
- }
-
- /**
- * Receive notification of character data.
- *
- * @param characters The string of characters to process.
- *
- * @throws org.xml.sax.SAXException
- *
- * @see ExtendedContentHandler#characters(String)
- */
- public void characters(String characters) throws SAXException
- {
- final int len = characters.length();
- if (len > m_charsBuff.length)
- {
- m_charsBuff = new char[len*2 + 1];
- }
- characters.getChars(0,len, m_charsBuff, 0);
- characters(m_charsBuff, 0, len);
- }
-
- /**
- * Receive notification of a comment.
- *
- * @see ExtendedLexicalHandler#comment(String)
- */
- public void comment(String comment) throws SAXException
- {
- flushPending();
-
- // Ignore if a lexical handler has not been set
- if (m_lexHandler != null)
- {
- final int len = comment.length();
- if (len > m_charsBuff.length)
- {
- m_charsBuff = new char[len*2 + 1];
- }
- comment.getChars(0,len, m_charsBuff, 0);
- m_lexHandler.comment(m_charsBuff, 0, len);
- // time to fire off comment event
- if (m_tracer != null)
- super.fireCommentEvent(m_charsBuff, 0, len);
- }
-
- }
-
- /**
- * Do nothing as this is an abstract class. All subclasses will need to
- * define their behavior if it is different.
- * @see org.xml.sax.ContentHandler#processingInstruction(String, String)
- */
- public void processingInstruction(String target, String data)
- throws SAXException
- {
- // Redefined in SAXXMLOutput
- }
-
- protected void closeStartTag() throws SAXException
- {
- }
-
- protected void closeCDATA() throws SAXException
- {
- // Redefined in SAXXMLOutput
- }
-
- /**
- * Receive notification of the beginning of an element, although this is a
- * SAX method additional namespace or attribute information can occur before
- * or after this call, that is associated with this element.
- *
- * @throws org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ContentHandler#startElement
- * @see org.xml.sax.ContentHandler#endElement
- * @see org.xml.sax.AttributeList
- *
- * @throws org.xml.sax.SAXException
- *
- * @see org.xml.sax.ContentHandler#startElement(String,String,String,Attributes)
- */
- public void startElement(
- String arg0,
- String arg1,
- String arg2,
- Attributes arg3)
- throws SAXException
- {
- if (m_state != null) {
- m_state.resetState(getTransformer());
- }
-
- // fire off the start element event
- if (m_tracer != null)
- super.fireStartElem(arg2);
- }
-
- /**
- * Sets the LexicalHandler.
- * @param _lexHandler The LexicalHandler to set
- */
- public void setLexHandler(LexicalHandler _lexHandler)
- {
- this.m_lexHandler = _lexHandler;
- }
-
- /**
- * Sets the SAX ContentHandler.
- * @param _saxHandler The ContentHandler to set
- */
- public void setContentHandler(ContentHandler _saxHandler)
- {
- this.m_saxHandler = _saxHandler;
- if (m_lexHandler == null && _saxHandler instanceof LexicalHandler)
- {
- // we are not overwriting an existing LexicalHandler, and _saxHandler
- // is also implements LexicalHandler, so lets use it
- m_lexHandler = (LexicalHandler) _saxHandler;
- }
- }
-
- /**
- * Does nothing. The setting of CDATA section elements has an impact on
- * stream serializers.
- * @see SerializationHandler#setCdataSectionElements(java.util.Vector)
- */
- public void setCdataSectionElements(Vector URI_and_localNames)
- {
- // do nothing
- }
-
- /** Set whether or not namespace declarations (e.g.
- * xmlns:foo) should appear as attributes of
- * elements
- * @param doOutputNSAttr whether or not namespace declarations
- * should appear as attributes
- */
- public void setShouldOutputNSAttr(boolean doOutputNSAttr)
- {
- m_shouldGenerateNSAttribute = doOutputNSAttr;
- }
-
- /**
- * Returns true if namespace declarations from calls such as
- * startPrefixMapping("prefix1","uri1") should
- * also be mirrored with self generated additional attributes of elements
- * that declare the namespace, for example the attribute xmlns:prefix1="uri1"
- */
- boolean getShouldOutputNSAttr()
- {
- return m_shouldGenerateNSAttribute;
- }
-
- /**
- * This method flushes any pending events, which can be startDocument()
- * closing the opening tag of an element, or closing an open CDATA section.
- */
- public void flushPending() throws SAXException
- {
-
- if (m_needToCallStartDocument)
- {
- startDocumentInternal();
- m_needToCallStartDocument = false;
- }
-
- if (m_elemContext.m_startTagOpen)
- {
- closeStartTag();
- m_elemContext.m_startTagOpen = false;
- }
-
- if (m_cdataTagOpen)
- {
- closeCDATA();
- m_cdataTagOpen = false;
- }
-
- }
-
- /**
- * Pass in a reference to a TransformState object, which
- * can be used during SAX ContentHandler events to obtain
- * information about he state of the transformation. This
- * method will be called before each startDocument event.
- *
- * @param ts A reference to a TransformState object
- */
- public void setTransformState(TransformStateSetter ts) {
- this.m_state = ts;
- }
-
- /**
- * Receives notification that an element starts, but attributes are not
- * fully known yet.
- *
- * @param uri the URI of the namespace of the element (optional)
- * @param localName the element name, but without prefix (optional)
- * @param qName the element name, with prefix, if any (required)
- *
- * @see ExtendedContentHandler#startElement(String, String, String)
- */
- public void startElement(String uri, String localName, String qName)
- throws SAXException {
-
- if (m_state != null) {
- m_state.resetState(getTransformer());
- }
-
- // fire off the start element event
- if (m_tracer != null)
- super.fireStartElem(qName);
- }
-
- /**
- * An element starts, but attributes are not fully known yet.
- *
- * @param qName the element name, with prefix (if any).
-
- * @see ExtendedContentHandler#startElement(String)
- */
- public void startElement(String qName) throws SAXException {
- if (m_state != null) {
- m_state.resetState(getTransformer());
- }
- // fire off the start element event
- if (m_tracer != null)
- super.fireStartElem(qName);
- }
-
- /**
- * This method gets the node's value as a String and uses that String as if
- * it were an input character notification.
- * @param node the Node to serialize
- * @throws org.xml.sax.SAXException
- */
- public void characters(org.w3c.dom.Node node)
- throws org.xml.sax.SAXException
- {
- // remember the current node
- if (m_state != null)
- {
- m_state.setCurrentNode(node);
- }
-
- // Get the node's value as a String and use that String as if
- // it were an input character notification.
- String data = node.getNodeValue();
- if (data != null) {
- this.characters(data);
- }
- }
-
- /**
- * @see org.xml.sax.ErrorHandler#fatalError(SAXParseException)
- */
- public void fatalError(SAXParseException exc) throws SAXException {
- super.fatalError(exc);
-
- m_needToCallStartDocument = false;
-
- if (m_saxHandler instanceof ErrorHandler) {
- ((ErrorHandler)m_saxHandler).fatalError(exc);
- }
- }
-
- /**
- * @see org.xml.sax.ErrorHandler#error(SAXParseException)
- */
- public void error(SAXParseException exc) throws SAXException {
- super.error(exc);
-
- if (m_saxHandler instanceof ErrorHandler)
- ((ErrorHandler)m_saxHandler).error(exc);
-
- }
-
- /**
- * @see org.xml.sax.ErrorHandler#warning(SAXParseException)
- */
- public void warning(SAXParseException exc) throws SAXException {
- super.warning(exc);
-
- if (m_saxHandler instanceof ErrorHandler)
- ((ErrorHandler)m_saxHandler).warning(exc);
- }
-
-
- /**
- * Try's to reset the super class and reset this class for
- * re-use, so that you don't need to create a new serializer
- * (mostly for performance reasons).
- *
- * @return true if the class was successfuly reset.
- * @see Serializer#reset()
- */
- public boolean reset()
- {
- boolean wasReset = false;
- if (super.reset())
- {
- resetToSAXHandler();
- wasReset = true;
- }
- return wasReset;
- }
-
- /**
- * Reset all of the fields owned by ToSAXHandler class
- *
- */
- private void resetToSAXHandler()
- {
- this.m_lexHandler = null;
- this.m_saxHandler = null;
- this.m_state = null;
- this.m_shouldGenerateNSAttribute = false;
- }
-
- /**
- * Add a unique attribute
- */
- public void addUniqueAttribute(String qName, String value, int flags)
- throws SAXException
- {
- addAttribute(qName, value);
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/ToStream.java b/src/com/sun/org/apache/xml/internal/serializer/ToStream.java
deleted file mode 100644
index 2301763..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/ToStream.java
+++ /dev/null
@@ -1,3389 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ToStream.java,v 1.4 2005/11/10 06:43:26 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.serializer;
-
-import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
-import java.io.Writer;
-import java.util.Properties;
-import java.util.StringTokenizer;
-import java.util.Vector;
-
-import javax.xml.transform.ErrorListener;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
-
-import com.sun.org.apache.xml.internal.serializer.utils.MsgKey;
-import com.sun.org.apache.xml.internal.serializer.utils.Utils;
-import com.sun.org.apache.xml.internal.serializer.utils.WrappedRuntimeException;
-import org.w3c.dom.Node;
-import org.xml.sax.Attributes;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.SAXException;
-
-//import com.sun.media.sound.IESecurity;
-
-/**
- * This abstract class is a base class for other stream
- * serializers (xml, html, text ...) that write output to a stream.
- *
- * @xsl.usage internal
- */
-abstract public class ToStream extends SerializerBase
-{
-
- private static final String COMMENT_BEGIN = "<!--";
- private static final String COMMENT_END = "-->";
-
- /** Stack to keep track of disabling output escaping. */
- protected BoolStack m_disableOutputEscapingStates = new BoolStack();
-
-
- /**
- * The encoding information associated with this serializer.
- * Although initially there is no encoding,
- * there is a dummy EncodingInfo object that will say
- * that every character is in the encoding. This is useful
- * for a serializer that is in temporary output state and has
- * no associated encoding. A serializer in final output state
- * will have an encoding, and will worry about whether
- * single chars or surrogate pairs of high/low chars form
- * characters in the output encoding.
- */
- EncodingInfo m_encodingInfo = new EncodingInfo(null,null);
-
- /**
- * Method reference to the sun.io.CharToByteConverter#canConvert method
- * for this encoding. Invalid if m_charToByteConverter is null.
- */
- java.lang.reflect.Method m_canConvertMeth;
-
-
-
- /**
- * Boolean that tells if we already tried to get the converter.
- */
- boolean m_triedToGetConverter = false;
-
-
- /**
- * Opaque reference to the sun.io.CharToByteConverter for this
- * encoding.
- */
- Object m_charToByteConverter = null;
-
-
- /**
- * Stack to keep track of whether or not we need to
- * preserve whitespace.
- *
- * Used to push/pop values used for the field m_ispreserve, but
- * m_ispreserve is only relevant if m_doIndent is true.
- * If m_doIndent is false this field has no impact.
- *
- */
- protected BoolStack m_preserves = new BoolStack();
-
- /**
- * State flag to tell if preservation of whitespace
- * is important.
- *
- * Used only in shouldIndent() but only if m_doIndent is true.
- * If m_doIndent is false this flag has no impact.
- *
- */
- protected boolean m_ispreserve = false;
-
- /**
- * State flag that tells if the previous node processed
- * was text, so we can tell if we should preserve whitespace.
- *
- * Used in endDocument() and shouldIndent() but
- * only if m_doIndent is true.
- * If m_doIndent is false this flag has no impact.
- */
- protected boolean m_isprevtext = false;
-
- /**
- * The maximum character size before we have to resort
- * to escaping.
- */
- protected int m_maxCharacter = Encodings.getLastPrintable();
-
-
- /**
- * The system line separator for writing out line breaks.
- * The default value is from the system property,
- * but this value can be set through the xsl:output
- * extension attribute xalan:line-separator.
- */
- protected char[] m_lineSep =
- SecuritySupport.getSystemProperty("line.separator").toCharArray();
-
- /**
- * True if the the system line separator is to be used.
- */
- protected boolean m_lineSepUse = true;
-
- /**
- * The length of the line seperator, since the write is done
- * one character at a time.
- */
- protected int m_lineSepLen = m_lineSep.length;
-
- /**
- * Map that tells which characters should have special treatment, and it
- * provides character to entity name lookup.
- */
- protected CharInfo m_charInfo;
-
- /** True if we control the buffer, and we should flush the output on endDocument. */
- boolean m_shouldFlush = true;
-
- /**
- * Add space before '/>' for XHTML.
- */
- protected boolean m_spaceBeforeClose = false;
-
- /**
- * Flag to signal that a newline should be added.
- *
- * Used only in indent() which is called only if m_doIndent is true.
- * If m_doIndent is false this flag has no impact.
- */
- boolean m_startNewLine;
-
- /**
- * Tells if we're in an internal document type subset.
- */
- protected boolean m_inDoctype = false;
-
- /**
- * Flag to quickly tell if the encoding is UTF8.
- */
- boolean m_isUTF8 = false;
-
- /** The xsl:output properties. */
- protected Properties m_format;
-
- /**
- * remembers if we are in between the startCDATA() and endCDATA() callbacks
- */
- protected boolean m_cdataStartCalled = false;
-
- /**
- * If this flag is true DTD entity references are not left as-is,
- * which is exiting older behavior.
- */
- private boolean m_expandDTDEntities = true;
-
-
- /**
- * Default constructor
- */
- public ToStream()
- {
- }
-
- /**
- * This helper method to writes out "]]>" when closing a CDATA section.
- *
- * @throws org.xml.sax.SAXException
- */
- protected void closeCDATA() throws org.xml.sax.SAXException
- {
- try
- {
- m_writer.write(CDATA_DELIMITER_CLOSE);
- // write out a CDATA section closing "]]>"
- m_cdataTagOpen = false; // Remember that we have done so.
- }
- catch (IOException e)
- {
- throw new SAXException(e);
- }
- }
-
- /**
- * Serializes the DOM node. Throws an exception only if an I/O
- * exception occured while serializing.
- *
- * @param node Node to serialize.
- * @throws IOException An I/O exception occured while serializing
- */
- public void serialize(Node node) throws IOException
- {
-
- try
- {
- TreeWalker walker =
- new TreeWalker(this);
-
- walker.traverse(node);
- }
- catch (org.xml.sax.SAXException se)
- {
- throw new WrappedRuntimeException(se);
- }
- }
-
- /**
- * Return true if the character is the high member of a surrogate pair.
- *
- * NEEDSDOC @param c
- *
- * NEEDSDOC ($objectName$) @return
- */
- static final boolean isUTF16Surrogate(char c)
- {
- return (c & 0xFC00) == 0xD800;
- }
-
- /**
- * Taken from XSLTC
- */
- private boolean m_escaping = true;
-
- /**
- * Flush the formatter's result stream.
- *
- * @throws org.xml.sax.SAXException
- */
- protected final void flushWriter() throws org.xml.sax.SAXException
- {
- final java.io.Writer writer = m_writer;
- if (null != writer)
- {
- try
- {
- if (writer instanceof WriterToUTF8Buffered)
- {
- if (m_shouldFlush)
- ((WriterToUTF8Buffered) writer).flush();
- else
- ((WriterToUTF8Buffered) writer).flushBuffer();
- }
- if (writer instanceof WriterToASCI)
- {
- if (m_shouldFlush)
- writer.flush();
- }
- else
- {
- // Flush always.
- // Not a great thing if the writer was created
- // by this class, but don't have a choice.
- writer.flush();
- }
- }
- catch (IOException ioe)
- {
- throw new org.xml.sax.SAXException(ioe);
- }
- }
- }
-
- /**
- * Get the output stream where the events will be serialized to.
- *
- * @return reference to the result stream, or null of only a writer was
- * set.
- */
- public OutputStream getOutputStream()
- {
-
- if (m_writer instanceof WriterToUTF8Buffered)
- return ((WriterToUTF8Buffered) m_writer).getOutputStream();
- if (m_writer instanceof WriterToASCI)
- return ((WriterToASCI) m_writer).getOutputStream();
- else
- return null;
- }
-
- // Implement DeclHandler
-
- /**
- * Report an element type declaration.
- *
- * <p>The content model will consist of the string "EMPTY", the
- * string "ANY", or a parenthesised group, optionally followed
- * by an occurrence indicator. The model will be normalized so
- * that all whitespace is removed,and will include the enclosing
- * parentheses.</p>
- *
- * @param name The element type name.
- * @param model The content model as a normalized string.
- * @exception SAXException The application may raise an exception.
- */
- public void elementDecl(String name, String model) throws SAXException
- {
- // Do not inline external DTD
- if (m_inExternalDTD)
- return;
- try
- {
- final java.io.Writer writer = m_writer;
- DTDprolog();
-
- writer.write("<!ELEMENT ");
- writer.write(name);
- writer.write(' ');
- writer.write(model);
- writer.write('>');
- writer.write(m_lineSep, 0, m_lineSepLen);
- }
- catch (IOException e)
- {
- throw new SAXException(e);
- }
-
- }
-
- /**
- * Report an internal entity declaration.
- *
- * <p>Only the effective (first) declaration for each entity
- * will be reported.</p>
- *
- * @param name The name of the entity. If it is a parameter
- * entity, the name will begin with '%'.
- * @param value The replacement text of the entity.
- * @exception SAXException The application may raise an exception.
- * @see #externalEntityDecl
- * @see org.xml.sax.DTDHandler#unparsedEntityDecl
- */
- public void internalEntityDecl(String name, String value)
- throws SAXException
- {
- // Do not inline external DTD
- if (m_inExternalDTD)
- return;
- try
- {
- DTDprolog();
- outputEntityDecl(name, value);
- }
- catch (IOException e)
- {
- throw new SAXException(e);
- }
-
- }
-
- /**
- * Output the doc type declaration.
- *
- * @param name non-null reference to document type name.
- * NEEDSDOC @param value
- *
- * @throws org.xml.sax.SAXException
- */
- void outputEntityDecl(String name, String value) throws IOException
- {
- final java.io.Writer writer = m_writer;
- writer.write("<!ENTITY ");
- writer.write(name);
- writer.write(" \"");
- writer.write(value);
- writer.write("\">");
- writer.write(m_lineSep, 0, m_lineSepLen);
- }
-
- /**
- * Output a system-dependent line break.
- *
- * @throws org.xml.sax.SAXException
- */
- protected final void outputLineSep() throws IOException
- {
-
- m_writer.write(m_lineSep, 0, m_lineSepLen);
- }
-
- /**
- * Specifies an output format for this serializer. It the
- * serializer has already been associated with an output format,
- * it will switch to the new format. This method should not be
- * called while the serializer is in the process of serializing
- * a document.
- *
- * @param format The output format to use
- */
- public void setOutputFormat(Properties format)
- {
-
- boolean shouldFlush = m_shouldFlush;
-
- init(m_writer, format, false, false);
-
- m_shouldFlush = shouldFlush;
- }
-
- /**
- * Initialize the serializer with the specified writer and output format.
- * Must be called before calling any of the serialize methods.
- * This method can be called multiple times and the xsl:output properties
- * passed in the 'format' parameter are accumulated across calls.
- *
- * @param writer The writer to use
- * @param format The output format
- * @param shouldFlush True if the writer should be flushed at EndDocument.
- */
- private synchronized void init(
- Writer writer,
- Properties format,
- boolean defaultProperties,
- boolean shouldFlush)
- {
-
- m_shouldFlush = shouldFlush;
-
-
- // if we are tracing events we need to trace what
- // characters are written to the output writer.
- if (m_tracer != null
- && !(writer instanceof SerializerTraceWriter) )
- m_writer = new SerializerTraceWriter(writer, m_tracer);
- else
- m_writer = writer;
-
-
- m_format = format;
- // m_cdataSectionNames =
- // OutputProperties.getQNameProperties(
- // OutputKeys.CDATA_SECTION_ELEMENTS,
- // format);
- setCdataSectionElements(OutputKeys.CDATA_SECTION_ELEMENTS, format);
-
- setIndentAmount(
- OutputPropertyUtils.getIntProperty(
- OutputPropertiesFactory.S_KEY_INDENT_AMOUNT,
- format));
- setIndent(
- OutputPropertyUtils.getBooleanProperty(OutputKeys.INDENT, format));
-
- {
- String sep =
- format.getProperty(OutputPropertiesFactory.S_KEY_LINE_SEPARATOR);
- if (sep != null) {
- m_lineSep = sep.toCharArray();
- m_lineSepLen = sep.length();
- }
- }
-
- boolean shouldNotWriteXMLHeader =
- OutputPropertyUtils.getBooleanProperty(
- OutputKeys.OMIT_XML_DECLARATION,
- format);
- setOmitXMLDeclaration(shouldNotWriteXMLHeader);
- setDoctypeSystem(format.getProperty(OutputKeys.DOCTYPE_SYSTEM));
- String doctypePublic = format.getProperty(OutputKeys.DOCTYPE_PUBLIC);
- setDoctypePublic(doctypePublic);
-
- // if standalone was explicitly specified
- if (format.get(OutputKeys.STANDALONE) != null)
- {
- String val = format.getProperty(OutputKeys.STANDALONE);
- if (defaultProperties)
- setStandaloneInternal(val);
- else
- setStandalone(val);
- }
-
- setMediaType(format.getProperty(OutputKeys.MEDIA_TYPE));
-
- if (null != doctypePublic)
- {
- if (doctypePublic.startsWith("-//W3C//DTD XHTML"))
- m_spaceBeforeClose = true;
- }
-
- /*
- * This code is added for XML 1.1 Version output.
- */
- String version = getVersion();
- if (null == version)
- {
- version = format.getProperty(OutputKeys.VERSION);
- setVersion(version);
- }
-
- // initCharsMap();
- String encoding = getEncoding();
- if (null == encoding)
- {
- encoding =
- Encodings.getMimeEncoding(
- format.getProperty(OutputKeys.ENCODING));
- setEncoding(encoding);
- }
-
- m_isUTF8 = encoding.equals(Encodings.DEFAULT_MIME_ENCODING);
-
- // Access this only from the Hashtable level... we don't want to
- // get default properties.
- String entitiesFileName =
- (String) format.get(OutputPropertiesFactory.S_KEY_ENTITIES);
-
- if (null != entitiesFileName)
- {
-
- String method =
- (String) format.get(OutputKeys.METHOD);
-
- m_charInfo = CharInfo.getCharInfo(entitiesFileName, method);
- }
-
- }
-
- /**
- * Initialize the serializer with the specified writer and output format.
- * Must be called before calling any of the serialize methods.
- *
- * @param writer The writer to use
- * @param format The output format
- */
- private synchronized void init(Writer writer, Properties format)
- {
- init(writer, format, false, false);
- }
- /**
- * Initialize the serializer with the specified output stream and output
- * format. Must be called before calling any of the serialize methods.
- *
- * @param output The output stream to use
- * @param format The output format
- * @param defaultProperties true if the properties are the default
- * properties
- *
- * @throws UnsupportedEncodingException The encoding specified in the
- * output format is not supported
- */
- protected synchronized void init(
- OutputStream output,
- Properties format,
- boolean defaultProperties)
- throws UnsupportedEncodingException
- {
-
- String encoding = getEncoding();
- if (encoding == null)
- {
- // if not already set then get it from the properties
- encoding =
- Encodings.getMimeEncoding(
- format.getProperty(OutputKeys.ENCODING));
- setEncoding(encoding);
- }
-
- if (encoding.equalsIgnoreCase("UTF-8"))
- {
- m_isUTF8 = true;
- // if (output instanceof java.io.BufferedOutputStream)
- // {
- // init(new WriterToUTF8(output), format, defaultProperties, true);
- // }
- // else if (output instanceof java.io.FileOutputStream)
- // {
- // init(new WriterToUTF8Buffered(output), format, defaultProperties, true);
- // }
- // else
- // {
- // // Not sure what to do in this case. I'm going to be conservative
- // // and not buffer.
- // init(new WriterToUTF8(output), format, defaultProperties, true);
- // }
-
-
- init(
- new WriterToUTF8Buffered(output),
- format,
- defaultProperties,
- true);
-
-
- }
- else if (
- encoding.equals("WINDOWS-1250")
- || encoding.equals("US-ASCII")
- || encoding.equals("ASCII"))
- {
- init(new WriterToASCI(output), format, defaultProperties, true);
- }
- else
- {
- Writer osw;
-
- try
- {
- osw = Encodings.getWriter(output, encoding);
- }
- catch (UnsupportedEncodingException uee)
- {
- System.out.println(
- "Warning: encoding \""
- + encoding
- + "\" not supported"
- + ", using "
- + Encodings.DEFAULT_MIME_ENCODING);
-
- encoding = Encodings.DEFAULT_MIME_ENCODING;
- setEncoding(encoding);
- osw = Encodings.getWriter(output, encoding);
- }
-
- init(osw, format, defaultProperties, true);
- }
-
- }
-
- /**
- * Returns the output format for this serializer.
- *
- * @return The output format in use
- */
- public Properties getOutputFormat()
- {
- return m_format;
- }
-
- /**
- * Specifies a writer to which the document should be serialized.
- * This method should not be called while the serializer is in
- * the process of serializing a document.
- *
- * @param writer The output writer stream
- */
- public void setWriter(Writer writer)
- {
- // if we are tracing events we need to trace what
- // characters are written to the output writer.
- if (m_tracer != null
- && !(writer instanceof SerializerTraceWriter) )
- m_writer = new SerializerTraceWriter(writer, m_tracer);
- else
- m_writer = writer;
- }
-
- /**
- * Set if the operating systems end-of-line line separator should
- * be used when serializing. If set false NL character
- * (decimal 10) is left alone, otherwise the new-line will be replaced on
- * output with the systems line separator. For example on UNIX this is
- * NL, while on Windows it is two characters, CR NL, where CR is the
- * carriage-return (decimal 13).
- *
- * @param use_sytem_line_break True if an input NL is replaced with the
- * operating systems end-of-line separator.
- * @return The previously set value of the serializer.
- */
- public boolean setLineSepUse(boolean use_sytem_line_break)
- {
- boolean oldValue = m_lineSepUse;
- m_lineSepUse = use_sytem_line_break;
- return oldValue;
- }
-
- /**
- * Specifies an output stream to which the document should be
- * serialized. This method should not be called while the
- * serializer is in the process of serializing a document.
- * <p>
- * The encoding specified in the output properties is used, or
- * if no encoding was specified, the default for the selected
- * output method.
- *
- * @param output The output stream
- */
- public void setOutputStream(OutputStream output)
- {
-
- try
- {
- Properties format;
- if (null == m_format)
- format =
- OutputPropertiesFactory.getDefaultMethodProperties(
- Method.XML);
- else
- format = m_format;
- init(output, format, true);
- }
- catch (UnsupportedEncodingException uee)
- {
-
- // Should have been warned in init, I guess...
- }
- }
-
- /**
- * @see SerializationHandler#setEscaping(boolean)
- */
- public boolean setEscaping(boolean escape)
- {
- final boolean temp = m_escaping;
- m_escaping = escape;
- return temp;
-
- }
-
-
- /**
- * Might print a newline character and the indentation amount
- * of the given depth.
- *
- * @param depth the indentation depth (element nesting depth)
- *
- * @throws org.xml.sax.SAXException if an error occurs during writing.
- */
- protected void indent(int depth) throws IOException
- {
-
- if (m_startNewLine)
- outputLineSep();
- /* For m_indentAmount > 0 this extra test might be slower
- * but Xalan's default value is 0, so this extra test
- * will run faster in that situation.
- */
- if (m_indentAmount > 0)
- printSpace(depth * m_indentAmount);
-
- }
-
- /**
- * Indent at the current element nesting depth.
- * @throws IOException
- */
- protected void indent() throws IOException
- {
- indent(m_elemContext.m_currentElemDepth);
- }
- /**
- * Prints <var>n</var> spaces.
- * @param n Number of spaces to print.
- *
- * @throws org.xml.sax.SAXException if an error occurs when writing.
- */
- private void printSpace(int n) throws IOException
- {
- final java.io.Writer writer = m_writer;
- for (int i = 0; i < n; i++)
- {
- writer.write(' ');
- }
-
- }
-
- /**
- * Report an attribute type declaration.
- *
- * <p>Only the effective (first) declaration for an attribute will
- * be reported. The type will be one of the strings "CDATA",
- * "ID", "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY",
- * "ENTITIES", or "NOTATION", or a parenthesized token group with
- * the separator "|" and all whitespace removed.</p>
- *
- * @param eName The name of the associated element.
- * @param aName The name of the attribute.
- * @param type A string representing the attribute type.
- * @param valueDefault A string representing the attribute default
- * ("#IMPLIED", "#REQUIRED", or "#FIXED") or null if
- * none of these applies.
- * @param value A string representing the attribute's default value,
- * or null if there is none.
- * @exception SAXException The application may raise an exception.
- */
- public void attributeDecl(
- String eName,
- String aName,
- String type,
- String valueDefault,
- String value)
- throws SAXException
- {
- // Do not inline external DTD
- if (m_inExternalDTD)
- return;
- try
- {
- final java.io.Writer writer = m_writer;
- DTDprolog();
-
- writer.write("<!ATTLIST ");
- writer.write(eName);
- writer.write(' ');
-
- writer.write(aName);
- writer.write(' ');
- writer.write(type);
- if (valueDefault != null)
- {
- writer.write(' ');
- writer.write(valueDefault);
- }
-
- //writer.write(" ");
- //writer.write(value);
- writer.write('>');
- writer.write(m_lineSep, 0, m_lineSepLen);
- }
- catch (IOException e)
- {
- throw new SAXException(e);
- }
- }
-
- /**
- * Get the character stream where the events will be serialized to.
- *
- * @return Reference to the result Writer, or null.
- */
- public Writer getWriter()
- {
- return m_writer;
- }
-
- /**
- * Report a parsed external entity declaration.
- *
- * <p>Only the effective (first) declaration for each entity
- * will be reported.</p>
- *
- * @param name The name of the entity. If it is a parameter
- * entity, the name will begin with '%'.
- * @param publicId The declared public identifier of the entity, or
- * null if none was declared.
- * @param systemId The declared system identifier of the entity.
- * @exception SAXException The application may raise an exception.
- * @see #internalEntityDecl
- * @see org.xml.sax.DTDHandler#unparsedEntityDecl
- */
- public void externalEntityDecl(
- String name,
- String publicId,
- String systemId)
- throws SAXException
- {
- try {
- DTDprolog();
-
- m_writer.write("<!ENTITY ");
- m_writer.write(name);
- if (publicId != null) {
- m_writer.write(" PUBLIC \"");
- m_writer.write(publicId);
-
- }
- else {
- m_writer.write(" SYSTEM \"");
- m_writer.write(systemId);
- }
- m_writer.write("\" >");
- m_writer.write(m_lineSep, 0, m_lineSepLen);
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
- }
-
- /**
- * Tell if this character can be written without escaping.
- */
- protected boolean escapingNotNeeded(char ch)
- {
- final boolean ret;
- if (ch < 127)
- {
- // This is the old/fast code here, but is this
- // correct for all encodings?
- if (ch >= 0x20 || (0x0A == ch || 0x0D == ch || 0x09 == ch))
- ret= true;
- else
- ret = false;
- }
- else {
- ret = m_encodingInfo.isInEncoding(ch);
- }
- return ret;
- }
-
- /**
- * Once a surrogate has been detected, write out the pair of
- * characters if it is in the encoding, or if there is no
- * encoding, otherwise write out an entity reference
- * of the value of the unicode code point of the character
- * represented by the high/low surrogate pair.
- * <p>
- * An exception is thrown if there is no low surrogate in the pair,
- * because the array ends unexpectely, or if the low char is there
- * but its value is such that it is not a low surrogate.
- *
- * @param c the first (high) part of the surrogate, which
- * must be confirmed before calling this method.
- * @param ch Character array.
- * @param i position Where the surrogate was detected.
- * @param end The end index of the significant characters.
- * @return 0 if the pair of characters was written out as-is,
- * the unicode code point of the character represented by
- * the surrogate pair if an entity reference with that value
- * was written out.
- *
- * @throws IOException
- * @throws org.xml.sax.SAXException if invalid UTF-16 surrogate detected.
- */
- protected int writeUTF16Surrogate(char c, char ch[], int i, int end)
- throws IOException
- {
- int codePoint = 0;
- if (i + 1 >= end)
- {
- throw new IOException(
- Utils.messages.createMessage(
- MsgKey.ER_INVALID_UTF16_SURROGATE,
- new Object[] { Integer.toHexString((int) c)}));
- }
-
- final char high = c;
- final char low = ch[i+1];
- if (!Encodings.isLowUTF16Surrogate(low)) {
- throw new IOException(
- Utils.messages.createMessage(
- MsgKey.ER_INVALID_UTF16_SURROGATE,
- new Object[] {
- Integer.toHexString((int) c)
- + " "
- + Integer.toHexString(low)}));
- }
-
- final java.io.Writer writer = m_writer;
-
- // If we make it to here we have a valid high, low surrogate pair
- if (m_encodingInfo.isInEncoding(c,low)) {
- // If the character formed by the surrogate pair
- // is in the encoding, so just write it out
- writer.write(ch,i,2);
- }
- else {
- // Don't know what to do with this char, it is
- // not in the encoding and not a high char in
- // a surrogate pair, so write out as an entity ref
- final String encoding = getEncoding();
- if (encoding != null) {
- /* The output encoding is known,
- * so somthing is wrong.
- */
- codePoint = Encodings.toCodePoint(high, low);
- // not in the encoding, so write out a character reference
- writer.write('&');
- writer.write('#');
- writer.write(Integer.toString(codePoint));
- writer.write(';');
- } else {
- /* The output encoding is not known,
- * so just write it out as-is.
- */
- writer.write(ch, i, 2);
- }
- }
- // non-zero only if character reference was written out.
- return codePoint;
- }
-
- /**
- * Handle one of the default entities, return false if it
- * is not a default entity.
- *
- * @param ch character to be escaped.
- * @param i index into character array.
- * @param chars non-null reference to character array.
- * @param len length of chars.
- * @param fromTextNode true if the characters being processed
- * are from a text node, false if they are from an attribute value
- * @param escLF true if the linefeed should be escaped.
- *
- * @return i+1 if the character was written, else i.
- *
- * @throws java.io.IOException
- */
- protected int accumDefaultEntity(
- java.io.Writer writer,
- char ch,
- int i,
- char[] chars,
- int len,
- boolean fromTextNode,
- boolean escLF)
- throws IOException
- {
-
- if (!escLF && CharInfo.S_LINEFEED == ch)
- {
- writer.write(m_lineSep, 0, m_lineSepLen);
- }
- else
- {
- // if this is text node character and a special one of those,
- // or if this is a character from attribute value and a special one of those
- if ((fromTextNode && m_charInfo.isSpecialTextChar(ch)) || (!fromTextNode && m_charInfo.isSpecialAttrChar(ch)))
- {
- String outputStringForChar = m_charInfo.getOutputStringForChar(ch);
-
- if (null != outputStringForChar)
- {
- writer.write(outputStringForChar);
- }
- else
- return i;
- }
- else
- return i;
- }
-
- return i + 1;
-
- }
- /**
- * Normalize the characters, but don't escape.
- *
- * @param ch The characters from the XML document.
- * @param start The start position in the array.
- * @param length The number of characters to read from the array.
- * @param isCData true if a CDATA block should be built around the characters.
- * @param useSystemLineSeparator true if the operating systems
- * end-of-line separator should be output rather than a new-line character.
- *
- * @throws IOException
- * @throws org.xml.sax.SAXException
- */
- void writeNormalizedChars(
- char ch[],
- int start,
- int length,
- boolean isCData,
- boolean useSystemLineSeparator)
- throws IOException, org.xml.sax.SAXException
- {
- final java.io.Writer writer = m_writer;
- int end = start + length;
-
- for (int i = start; i < end; i++)
- {
- char c = ch[i];
-
- if (CharInfo.S_LINEFEED == c && useSystemLineSeparator)
- {
- writer.write(m_lineSep, 0, m_lineSepLen);
- }
- else if (isCData && (!escapingNotNeeded(c)))
- {
- // if (i != 0)
- if (m_cdataTagOpen)
- closeCDATA();
-
- // This needs to go into a function...
- if (Encodings.isHighUTF16Surrogate(c))
- {
- writeUTF16Surrogate(c, ch, i, end);
- i++ ; // process two input characters
- }
- else
- {
- writer.write("&#");
-
- String intStr = Integer.toString((int) c);
-
- writer.write(intStr);
- writer.write(';');
- }
-
- // if ((i != 0) && (i < (end - 1)))
- // if (!m_cdataTagOpen && (i < (end - 1)))
- // {
- // writer.write(CDATA_DELIMITER_OPEN);
- // m_cdataTagOpen = true;
- // }
- }
- else if (
- isCData
- && ((i < (end - 2))
- && (']' == c)
- && (']' == ch[i + 1])
- && ('>' == ch[i + 2])))
- {
- writer.write(CDATA_CONTINUE);
-
- i += 2;
- }
- else
- {
- if (escapingNotNeeded(c))
- {
- if (isCData && !m_cdataTagOpen)
- {
- writer.write(CDATA_DELIMITER_OPEN);
- m_cdataTagOpen = true;
- }
- writer.write(c);
- }
-
- // This needs to go into a function...
- else if (Encodings.isHighUTF16Surrogate(c))
- {
- if (m_cdataTagOpen)
- closeCDATA();
- writeUTF16Surrogate(c, ch, i, end);
- i++; // process two input characters
- }
- else
- {
- if (m_cdataTagOpen)
- closeCDATA();
- writer.write("&#");
-
- String intStr = Integer.toString((int) c);
-
- writer.write(intStr);
- writer.write(';');
- }
- }
- }
-
- }
-
- /**
- * Ends an un-escaping section.
- *
- * @see #startNonEscaping
- *
- * @throws org.xml.sax.SAXException
- */
- public void endNonEscaping() throws org.xml.sax.SAXException
- {
- m_disableOutputEscapingStates.pop();
- }
-
- /**
- * Starts an un-escaping section. All characters printed within an un-
- * escaping section are printed as is, without escaping special characters
- * into entity references. Only XML and HTML serializers need to support
- * this method.
- * <p> The contents of the un-escaping section will be delivered through the
- * regular <tt>characters</tt> event.
- *
- * @throws org.xml.sax.SAXException
- */
- public void startNonEscaping() throws org.xml.sax.SAXException
- {
- m_disableOutputEscapingStates.push(true);
- }
-
- /**
- * Receive notification of cdata.
- *
- * <p>The Parser will call this method to report each chunk of
- * character data. SAX parsers may return all contiguous character
- * data in a single chunk, or they may split it into several
- * chunks; however, all of the characters in any single event
- * must come from the same external entity, so that the Locator
- * provides useful information.</p>
- *
- * <p>The application must not attempt to read from the array
- * outside of the specified range.</p>
- *
- * <p>Note that some parsers will report whitespace using the
- * ignorableWhitespace() method rather than this one (validating
- * parsers must do so).</p>
- *
- * @param ch The characters from the XML document.
- * @param start The start position in the array.
- * @param length The number of characters to read from the array.
- * @throws org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see #ignorableWhitespace
- * @see org.xml.sax.Locator
- *
- * @throws org.xml.sax.SAXException
- */
- protected void cdata(char ch[], int start, final int length)
- throws org.xml.sax.SAXException
- {
-
- try
- {
- final int old_start = start;
- if (m_elemContext.m_startTagOpen)
- {
- closeStartTag();
- m_elemContext.m_startTagOpen = false;
- }
- m_ispreserve = true;
-
- if (shouldIndent())
- indent();
-
- boolean writeCDataBrackets =
- (((length >= 1) && escapingNotNeeded(ch[start])));
-
- /* Write out the CDATA opening delimiter only if
- * we are supposed to, and if we are not already in
- * the middle of a CDATA section
- */
- if (writeCDataBrackets && !m_cdataTagOpen)
- {
- m_writer.write(CDATA_DELIMITER_OPEN);
- m_cdataTagOpen = true;
- }
-
- // writer.write(ch, start, length);
- if (isEscapingDisabled())
- {
- charactersRaw(ch, start, length);
- }
- else
- writeNormalizedChars(ch, start, length, true, m_lineSepUse);
-
- /* used to always write out CDATA closing delimiter here,
- * but now we delay, so that we can merge CDATA sections on output.
- * need to write closing delimiter later
- */
- if (writeCDataBrackets)
- {
- /* if the CDATA section ends with ] don't leave it open
- * as there is a chance that an adjacent CDATA sections
- * starts with ]>.
- * We don't want to merge ]] with > , or ] with ]>
- */
- if (ch[start + length - 1] == ']')
- closeCDATA();
- }
-
- // time to fire off CDATA event
- if (m_tracer != null)
- super.fireCDATAEvent(ch, old_start, length);
- }
- catch (IOException ioe)
- {
- throw new org.xml.sax.SAXException(
- Utils.messages.createMessage(
- MsgKey.ER_OIERROR,
- null),
- ioe);
- //"IO error", ioe);
- }
- }
-
- /**
- * Tell if the character escaping should be disabled for the current state.
- *
- * @return true if the character escaping should be disabled.
- */
- private boolean isEscapingDisabled()
- {
- return m_disableOutputEscapingStates.peekOrFalse();
- }
-
- /**
- * If available, when the disable-output-escaping attribute is used,
- * output raw text without escaping.
- *
- * @param ch The characters from the XML document.
- * @param start The start position in the array.
- * @param length The number of characters to read from the array.
- *
- * @throws org.xml.sax.SAXException
- */
- protected void charactersRaw(char ch[], int start, int length)
- throws org.xml.sax.SAXException
- {
-
- if (m_inEntityRef)
- return;
- try
- {
- if (m_elemContext.m_startTagOpen)
- {
- closeStartTag();
- m_elemContext.m_startTagOpen = false;
- }
-
- m_ispreserve = true;
-
- m_writer.write(ch, start, length);
- }
- catch (IOException e)
- {
- throw new SAXException(e);
- }
-
- }
-
- /**
- * Receive notification of character data.
- *
- * <p>The Parser will call this method to report each chunk of
- * character data. SAX parsers may return all contiguous character
- * data in a single chunk, or they may split it into several
- * chunks; however, all of the characters in any single event
- * must come from the same external entity, so that the Locator
- * provides useful information.</p>
- *
- * <p>The application must not attempt to read from the array
- * outside of the specified range.</p>
- *
- * <p>Note that some parsers will report whitespace using the
- * ignorableWhitespace() method rather than this one (validating
- * parsers must do so).</p>
- *
- * @param chars The characters from the XML document.
- * @param start The start position in the array.
- * @param length The number of characters to read from the array.
- * @throws org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see #ignorableWhitespace
- * @see org.xml.sax.Locator
- *
- * @throws org.xml.sax.SAXException
- */
- public void characters(final char chars[], final int start, final int length)
- throws org.xml.sax.SAXException
- {
- // It does not make sense to continue with rest of the method if the number of
- // characters to read from array is 0.
- // Section 7.6.1 of XSLT 1.0 (http://www.w3.org/TR/xslt#value-of) suggest no text node
- // is created if string is empty.
- if (length == 0 || (m_inEntityRef && !m_expandDTDEntities))
- return;
- if (m_elemContext.m_startTagOpen)
- {
- closeStartTag();
- m_elemContext.m_startTagOpen = false;
- }
- else if (m_needToCallStartDocument)
- {
- startDocumentInternal();
- }
-
- if (m_cdataStartCalled || m_elemContext.m_isCdataSection)
- {
- /* either due to startCDATA() being called or due to
- * cdata-section-elements atribute, we need this as cdata
- */
- cdata(chars, start, length);
-
- return;
- }
-
- if (m_cdataTagOpen)
- closeCDATA();
- // the check with _escaping is a bit of a hack for XLSTC
-
- if (m_disableOutputEscapingStates.peekOrFalse() || (!m_escaping))
- {
- charactersRaw(chars, start, length);
-
- // time to fire off characters generation event
- if (m_tracer != null)
- super.fireCharEvent(chars, start, length);
-
- return;
- }
-
- if (m_elemContext.m_startTagOpen)
- {
- closeStartTag();
- m_elemContext.m_startTagOpen = false;
- }
-
-
- try
- {
- int i;
- char ch1;
- int startClean;
-
- // skip any leading whitspace
- // don't go off the end and use a hand inlined version
- // of isWhitespace(ch)
- final int end = start + length;
- int lastDirty = start - 1; // last character that needed processing
- for (i = start;
- ((i < end)
- && ((ch1 = chars[i]) == 0x20
- || (ch1 == 0xA && m_lineSepUse)
- || ch1 == 0xD
- || ch1 == 0x09));
- i++)
- {
- /*
- * We are processing leading whitespace, but are doing the same
- * processing for dirty characters here as for non-whitespace.
- *
- */
- if (!m_charInfo.isTextASCIIClean(ch1))
- {
- lastDirty = processDirty(chars,end, i,ch1, lastDirty, true);
- i = lastDirty;
- }
- }
- /* If there is some non-whitespace, mark that we may need
- * to preserve this. This is only important if we have indentation on.
- */
- if (i < end)
- m_ispreserve = true;
-
-
-// int lengthClean; // number of clean characters in a row
-// final boolean[] isAsciiClean = m_charInfo.getASCIIClean();
-
- final boolean isXML10 = XMLVERSION10.equals(getVersion());
- // we've skipped the leading whitespace, now deal with the rest
- for (; i < end; i++)
- {
- {
- // A tight loop to skip over common clean chars
- // This tight loop makes it easier for the JIT
- // to optimize.
- char ch2;
- while (i<end
- && ((ch2 = chars[i])<127)
- && m_charInfo.isTextASCIIClean(ch2))
- i++;
- if (i == end)
- break;
- }
-
- final char ch = chars[i];
- /* The check for isCharacterInC0orC1Ranger and
- * isNELorLSEPCharacter has been added
- * to support Control Characters in XML 1.1
- */
- if (!isCharacterInC0orC1Range(ch) &&
- (isXML10 || !isNELorLSEPCharacter(ch)) &&
- (escapingNotNeeded(ch) && (!m_charInfo.isSpecialTextChar(ch)))
- || ('"' == ch))
- {
- ; // a character needing no special processing
- }
- else
- {
- lastDirty = processDirty(chars,end, i, ch, lastDirty, true);
- i = lastDirty;
- }
- }
-
- // we've reached the end. Any clean characters at the
- // end of the array than need to be written out?
- startClean = lastDirty + 1;
- if (i > startClean)
- {
- int lengthClean = i - startClean;
- m_writer.write(chars, startClean, lengthClean);
- }
-
- // For indentation purposes, mark that we've just writen text out
- m_isprevtext = true;
- }
- catch (IOException e)
- {
- throw new SAXException(e);
- }
-
- // time to fire off characters generation event
- if (m_tracer != null)
- super.fireCharEvent(chars, start, length);
- }
- /**
- * This method checks if a given character is between C0 or C1 range
- * of Control characters.
- * This method is added to support Control Characters for XML 1.1
- * If a given character is TAB (0x09), LF (0x0A) or CR (0x0D), this method
- * return false. Since they are whitespace characters, no special processing is needed.
- *
- * @param ch
- * @return boolean
- */
- private static boolean isCharacterInC0orC1Range(char ch)
- {
- if(ch == 0x09 || ch == 0x0A || ch == 0x0D)
- return false;
- else
- return (ch >= 0x7F && ch <= 0x9F)|| (ch >= 0x01 && ch <= 0x1F);
- }
- /**
- * This method checks if a given character either NEL (0x85) or LSEP (0x2028)
- * These are new end of line charcters added in XML 1.1. These characters must be
- * written as Numeric Character References (NCR) in XML 1.1 output document.
- *
- * @param ch
- * @return boolean
- */
- private static boolean isNELorLSEPCharacter(char ch)
- {
- return (ch == 0x85 || ch == 0x2028);
- }
- /**
- * Process a dirty character and any preeceding clean characters
- * that were not yet processed.
- * @param chars array of characters being processed
- * @param end one (1) beyond the last character
- * in chars to be processed
- * @param i the index of the dirty character
- * @param ch the character in chars[i]
- * @param lastDirty the last dirty character previous to i
- * @param fromTextNode true if the characters being processed are
- * from a text node, false if they are from an attribute value.
- * @return the index of the last character processed
- */
- private int processDirty(
- char[] chars,
- int end,
- int i,
- char ch,
- int lastDirty,
- boolean fromTextNode) throws IOException
- {
- int startClean = lastDirty + 1;
- // if we have some clean characters accumulated
- // process them before the dirty one.
- if (i > startClean)
- {
- int lengthClean = i - startClean;
- m_writer.write(chars, startClean, lengthClean);
- }
-
- // process the "dirty" character
- if (CharInfo.S_LINEFEED == ch && fromTextNode)
- {
- m_writer.write(m_lineSep, 0, m_lineSepLen);
- }
- else
- {
- startClean =
- accumDefaultEscape(
- m_writer,
- (char)ch,
- i,
- chars,
- end,
- fromTextNode,
- false);
- i = startClean - 1;
- }
- // Return the index of the last character that we just processed
- // which is a dirty character.
- return i;
- }
-
- /**
- * Receive notification of character data.
- *
- * @param s The string of characters to process.
- *
- * @throws org.xml.sax.SAXException
- */
- public void characters(String s) throws org.xml.sax.SAXException
- {
- if (m_inEntityRef && !m_expandDTDEntities)
- return;
- final int length = s.length();
- if (length > m_charsBuff.length)
- {
- m_charsBuff = new char[length * 2 + 1];
- }
- s.getChars(0, length, m_charsBuff, 0);
- characters(m_charsBuff, 0, length);
- }
-
- /**
- * Escape and writer.write a character.
- *
- * @param ch character to be escaped.
- * @param i index into character array.
- * @param chars non-null reference to character array.
- * @param len length of chars.
- * @param fromTextNode true if the characters being processed are
- * from a text node, false if the characters being processed are from
- * an attribute value.
- * @param escLF true if the linefeed should be escaped.
- *
- * @return i+1 if a character was written, i+2 if two characters
- * were written out, else return i.
- *
- * @throws org.xml.sax.SAXException
- */
- protected int accumDefaultEscape(
- Writer writer,
- char ch,
- int i,
- char[] chars,
- int len,
- boolean fromTextNode,
- boolean escLF)
- throws IOException
- {
-
- int pos = accumDefaultEntity(writer, ch, i, chars, len, fromTextNode, escLF);
-
- if (i == pos)
- {
- if (Encodings.isHighUTF16Surrogate(ch))
- {
-
- // Should be the UTF-16 low surrogate of the hig/low pair.
- char next;
- // Unicode code point formed from the high/low pair.
- int codePoint = 0;
-
- if (i + 1 >= len)
- {
- throw new IOException(
- Utils.messages.createMessage(
- MsgKey.ER_INVALID_UTF16_SURROGATE,
- new Object[] { Integer.toHexString(ch)}));
- //"Invalid UTF-16 surrogate detected: "
-
- //+Integer.toHexString(ch)+ " ?");
- }
- else
- {
- next = chars[++i];
-
- if (!(Encodings.isLowUTF16Surrogate(next)))
- throw new IOException(
- Utils.messages.createMessage(
- MsgKey
- .ER_INVALID_UTF16_SURROGATE,
- new Object[] {
- Integer.toHexString(ch)
- + " "
- + Integer.toHexString(next)}));
- //"Invalid UTF-16 surrogate detected: "
-
- //+Integer.toHexString(ch)+" "+Integer.toHexString(next));
- codePoint = Encodings.toCodePoint(ch,next);
- }
-
- writer.write("&#");
- writer.write(Integer.toString(codePoint));
- writer.write(';');
- pos += 2; // count the two characters that went into writing out this entity
- }
- else
- {
- /* This if check is added to support control characters in XML 1.1.
- * If a character is a Control Character within C0 and C1 range, it is desirable
- * to write it out as Numeric Character Reference(NCR) regardless of XML Version
- * being used for output document.
- */
- if (isCharacterInC0orC1Range(ch) ||
- (XMLVERSION11.equals(getVersion()) && isNELorLSEPCharacter(ch)))
- {
- writer.write("&#");
- writer.write(Integer.toString(ch));
- writer.write(';');
- }
- else if ((!escapingNotNeeded(ch) ||
- ( (fromTextNode && m_charInfo.isSpecialTextChar(ch))
- || (!fromTextNode && m_charInfo.isSpecialAttrChar(ch))))
- && m_elemContext.m_currentElemDepth > 0)
- {
- writer.write("&#");
- writer.write(Integer.toString(ch));
- writer.write(';');
- }
- else
- {
- writer.write(ch);
- }
- pos++; // count the single character that was processed
- }
-
- }
- return pos;
- }
-
- /**
- * Receive notification of the beginning of an element, although this is a
- * SAX method additional namespace or attribute information can occur before
- * or after this call, that is associated with this element.
- *
- *
- * @param namespaceURI The Namespace URI, or the empty string if the
- * element has no Namespace URI or if Namespace
- * processing is not being performed.
- * @param localName The local name (without prefix), or the
- * empty string if Namespace processing is not being
- * performed.
- * @param name The element type name.
- * @param atts The attributes attached to the element, if any.
- * @throws org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ContentHandler#startElement
- * @see org.xml.sax.ContentHandler#endElement
- * @see org.xml.sax.AttributeList
- *
- * @throws org.xml.sax.SAXException
- */
- public void startElement(
- String namespaceURI,
- String localName,
- String name,
- Attributes atts)
- throws org.xml.sax.SAXException
- {
- if (m_inEntityRef)
- return;
-
- if (m_needToCallStartDocument)
- {
- startDocumentInternal();
- m_needToCallStartDocument = false;
- }
- else if (m_cdataTagOpen)
- closeCDATA();
- try
- {
- if ((true == m_needToOutputDocTypeDecl)
- && (null != getDoctypeSystem()))
- {
- outputDocTypeDecl(name, true);
- }
-
- m_needToOutputDocTypeDecl = false;
-
- /* before we over-write the current elementLocalName etc.
- * lets close out the old one (if we still need to)
- */
- if (m_elemContext.m_startTagOpen)
- {
- closeStartTag();
- m_elemContext.m_startTagOpen = false;
- }
-
- if (namespaceURI != null)
- ensurePrefixIsDeclared(namespaceURI, name);
-
- m_ispreserve = false;
-
- if (shouldIndent() && m_startNewLine)
- {
- indent();
- }
-
- m_startNewLine = true;
-
- final java.io.Writer writer = m_writer;
- writer.write('<');
- writer.write(name);
- }
- catch (IOException e)
- {
- throw new SAXException(e);
- }
-
- // process the attributes now, because after this SAX call they might be gone
- if (atts != null)
- addAttributes(atts);
-
- m_elemContext = m_elemContext.push(namespaceURI,localName,name);
- m_isprevtext = false;
-
- if (m_tracer != null){
- firePseudoAttributes();
- }
-
- }
-
- /**
- * Receive notification of the beginning of an element, additional
- * namespace or attribute information can occur before or after this call,
- * that is associated with this element.
- *
- *
- * @param elementNamespaceURI The Namespace URI, or the empty string if the
- * element has no Namespace URI or if Namespace
- * processing is not being performed.
- * @param elementLocalName The local name (without prefix), or the
- * empty string if Namespace processing is not being
- * performed.
- * @param elementName The element type name.
- * @throws org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ContentHandler#startElement
- * @see org.xml.sax.ContentHandler#endElement
- * @see org.xml.sax.AttributeList
- *
- * @throws org.xml.sax.SAXException
- */
- public void startElement(
- String elementNamespaceURI,
- String elementLocalName,
- String elementName)
- throws SAXException
- {
- startElement(elementNamespaceURI, elementLocalName, elementName, null);
- }
-
- public void startElement(String elementName) throws SAXException
- {
- startElement(null, null, elementName, null);
- }
-
- /**
- * Output the doc type declaration.
- *
- * @param name non-null reference to document type name.
- * NEEDSDOC @param closeDecl
- *
- * @throws java.io.IOException
- */
- void outputDocTypeDecl(String name, boolean closeDecl) throws SAXException
- {
- if (m_cdataTagOpen)
- closeCDATA();
- try
- {
- final java.io.Writer writer = m_writer;
- writer.write("<!DOCTYPE ");
- writer.write(name);
-
- String doctypePublic = getDoctypePublic();
- if (null != doctypePublic)
- {
- writer.write(" PUBLIC \"");
- writer.write(doctypePublic);
- writer.write('\"');
- }
-
- String doctypeSystem = getDoctypeSystem();
- if (null != doctypeSystem)
- {
- if (null == doctypePublic)
- writer.write(" SYSTEM \"");
- else
- writer.write(" \"");
-
- writer.write(doctypeSystem);
-
- if (closeDecl)
- {
- writer.write("\">");
- writer.write(m_lineSep, 0, m_lineSepLen);
- closeDecl = false; // done closing
- }
- else
- writer.write('\"');
- }
- boolean dothis = false;
- if (dothis)
- {
- // at one point this code seemed right,
- // but not anymore - Brian M.
- if (closeDecl)
- {
- writer.write('>');
- writer.write(m_lineSep, 0, m_lineSepLen);
- }
- }
- }
- catch (IOException e)
- {
- throw new SAXException(e);
- }
- }
-
- /**
- * Process the attributes, which means to write out the currently
- * collected attributes to the writer. The attributes are not
- * cleared by this method
- *
- * @param writer the writer to write processed attributes to.
- * @param nAttrs the number of attributes in m_attributes
- * to be processed
- *
- * @throws java.io.IOException
- * @throws org.xml.sax.SAXException
- */
- public void processAttributes(java.io.Writer writer, int nAttrs) throws IOException, SAXException
- {
- /* real SAX attributes are not passed in, so process the
- * attributes that were collected after the startElement call.
- * _attribVector is a "cheap" list for Stream serializer output
- * accumulated over a series of calls to attribute(name,value)
- */
- String encoding = getEncoding();
- for (int i = 0; i < nAttrs; i++)
- {
- // elementAt is JDK 1.1.8
- final String name = m_attributes.getQName(i);
- final String value = m_attributes.getValue(i);
- writer.write(' ');
- writer.write(name);
- writer.write("=\"");
- writeAttrString(writer, value, encoding);
- writer.write('\"');
- }
- }
-
- /**
- * Returns the specified <var>string</var> after substituting <VAR>specials</VAR>,
- * and UTF-16 surrogates for chracter references <CODE>&amp;#xnn</CODE>.
- *
- * @param string String to convert to XML format.
- * @param encoding CURRENTLY NOT IMPLEMENTED.
- *
- * @throws java.io.IOException
- */
- public void writeAttrString(
- Writer writer,
- String string,
- String encoding)
- throws IOException
- {
- final int len = string.length();
- if (len > m_attrBuff.length)
- {
- m_attrBuff = new char[len*2 + 1];
- }
- string.getChars(0,len, m_attrBuff, 0);
- final char[] stringChars = m_attrBuff;
-
- for (int i = 0; i < len; )
- {
- char ch = stringChars[i];
- if (escapingNotNeeded(ch) && (!m_charInfo.isSpecialAttrChar(ch)))
- {
- writer.write(ch);
- i++;
- }
- else
- { // I guess the parser doesn't normalize cr/lf in attributes. -sb
-// if ((CharInfo.S_CARRIAGERETURN == ch)
-// && ((i + 1) < len)
-// && (CharInfo.S_LINEFEED == stringChars[i + 1]))
-// {
-// i++;
-// ch = CharInfo.S_LINEFEED;
-// }
-
- i = accumDefaultEscape(writer, ch, i, stringChars, len, false, true);
- }
- }
-
- }
-
- /**
- * Receive notification of the end of an element.
- *
- *
- * @param namespaceURI The Namespace URI, or the empty string if the
- * element has no Namespace URI or if Namespace
- * processing is not being performed.
- * @param localName The local name (without prefix), or the
- * empty string if Namespace processing is not being
- * performed.
- * @param name The element type name
- * @throws org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- *
- * @throws org.xml.sax.SAXException
- */
- public void endElement(String namespaceURI, String localName, String name)
- throws org.xml.sax.SAXException
- {
-
- if (m_inEntityRef)
- return;
-
- // namespaces declared at the current depth are no longer valid
- // so get rid of them
- m_prefixMap.popNamespaces(m_elemContext.m_currentElemDepth, null);
-
- try
- {
- final java.io.Writer writer = m_writer;
- if (m_elemContext.m_startTagOpen)
- {
- if (m_tracer != null)
- super.fireStartElem(m_elemContext.m_elementName);
- int nAttrs = m_attributes.getLength();
- if (nAttrs > 0)
- {
- processAttributes(m_writer, nAttrs);
- // clear attributes object for re-use with next element
- m_attributes.clear();
- }
- if (m_spaceBeforeClose)
- writer.write(" />");
- else
- writer.write("/>");
- /* don't need to pop cdataSectionState because
- * this element ended so quickly that we didn't get
- * to push the state.
- */
-
- }
- else
- {
- if (m_cdataTagOpen)
- closeCDATA();
-
- if (shouldIndent())
- indent(m_elemContext.m_currentElemDepth - 1);
- writer.write('<');
- writer.write('/');
- writer.write(name);
- writer.write('>');
- }
- }
- catch (IOException e)
- {
- throw new SAXException(e);
- }
-
- if (!m_elemContext.m_startTagOpen && m_doIndent)
- {
- m_ispreserve = m_preserves.isEmpty() ? false : m_preserves.pop();
- }
-
- m_isprevtext = false;
-
- // fire off the end element event
- if (m_tracer != null)
- super.fireEndElem(name);
- m_elemContext = m_elemContext.m_prev;
- }
-
- /**
- * Receive notification of the end of an element.
- * @param name The element type name
- * @throws org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- */
- public void endElement(String name) throws org.xml.sax.SAXException
- {
- endElement(null, null, name);
- }
-
- /**
- * Begin the scope of a prefix-URI Namespace mapping
- * just before another element is about to start.
- * This call will close any open tags so that the prefix mapping
- * will not apply to the current element, but the up comming child.
- *
- * @see org.xml.sax.ContentHandler#startPrefixMapping
- *
- * @param prefix The Namespace prefix being declared.
- * @param uri The Namespace URI the prefix is mapped to.
- *
- * @throws org.xml.sax.SAXException The client may throw
- * an exception during processing.
- *
- */
- public void startPrefixMapping(String prefix, String uri)
- throws org.xml.sax.SAXException
- {
- // the "true" causes the flush of any open tags
- startPrefixMapping(prefix, uri, true);
- }
-
- /**
- * Handle a prefix/uri mapping, which is associated with a startElement()
- * that is soon to follow. Need to close any open start tag to make
- * sure than any name space attributes due to this event are associated wih
- * the up comming element, not the current one.
- * @see ExtendedContentHandler#startPrefixMapping
- *
- * @param prefix The Namespace prefix being declared.
- * @param uri The Namespace URI the prefix is mapped to.
- * @param shouldFlush true if any open tags need to be closed first, this
- * will impact which element the mapping applies to (open parent, or its up
- * comming child)
- * @return returns true if the call made a change to the current
- * namespace information, false if it did not change anything, e.g. if the
- * prefix/namespace mapping was already in scope from before.
- *
- * @throws org.xml.sax.SAXException The client may throw
- * an exception during processing.
- *
- *
- */
- public boolean startPrefixMapping(
- String prefix,
- String uri,
- boolean shouldFlush)
- throws org.xml.sax.SAXException
- {
-
- /* Remember the mapping, and at what depth it was declared
- * This is one greater than the current depth because these
- * mappings will apply to the next depth. This is in
- * consideration that startElement() will soon be called
- */
-
- boolean pushed;
- int pushDepth;
- if (shouldFlush)
- {
- flushPending();
- // the prefix mapping applies to the child element (one deeper)
- pushDepth = m_elemContext.m_currentElemDepth + 1;
- }
- else
- {
- // the prefix mapping applies to the current element
- pushDepth = m_elemContext.m_currentElemDepth;
- }
- pushed = m_prefixMap.pushNamespace(prefix, uri, pushDepth);
-
- if (pushed)
- {
- /* Brian M.: don't know if we really needto do this. The
- * callers of this object should have injected both
- * startPrefixMapping and the attributes. We are
- * just covering our butt here.
- */
- String name;
- if (EMPTYSTRING.equals(prefix))
- {
- name = "xmlns";
- addAttributeAlways(XMLNS_URI, name, name, "CDATA", uri, false);
- }
- else
- {
- if (!EMPTYSTRING.equals(uri))
- // hack for XSLTC attribset16 test
- { // that maps ns1 prefix to "" URI
- name = "xmlns:" + prefix;
-
- /* for something like xmlns:abc="w3.pretend.org"
- * the uri is the value, that is why we pass it in the
- * value, or 5th slot of addAttributeAlways()
- */
- addAttributeAlways(XMLNS_URI, prefix, name, "CDATA", uri, false);
- }
- }
- }
- return pushed;
- }
-
- /**
- * Receive notification of an XML comment anywhere in the document. This
- * callback will be used for comments inside or outside the document
- * element, including comments in the external DTD subset (if read).
- * @param ch An array holding the characters in the comment.
- * @param start The starting position in the array.
- * @param length The number of characters to use from the array.
- * @throws org.xml.sax.SAXException The application may raise an exception.
- */
- public void comment(char ch[], int start, int length)
- throws org.xml.sax.SAXException
- {
-
- int start_old = start;
- if (m_inEntityRef)
- return;
- if (m_elemContext.m_startTagOpen)
- {
- closeStartTag();
- m_elemContext.m_startTagOpen = false;
- }
- else if (m_needToCallStartDocument)
- {
- startDocumentInternal();
- m_needToCallStartDocument = false;
- }
-
- try
- {
- if (shouldIndent() && m_isStandalone)
- indent();
-
- final int limit = start + length;
- boolean wasDash = false;
- if (m_cdataTagOpen)
- closeCDATA();
-
- if (shouldIndent() && !m_isStandalone)
- indent();
-
- final java.io.Writer writer = m_writer;
- writer.write(COMMENT_BEGIN);
- // Detect occurrences of two consecutive dashes, handle as necessary.
- for (int i = start; i < limit; i++)
- {
- if (wasDash && ch[i] == '-')
- {
- writer.write(ch, start, i - start);
- writer.write(" -");
- start = i + 1;
- }
- wasDash = (ch[i] == '-');
- }
-
- // if we have some chars in the comment
- if (length > 0)
- {
- // Output the remaining characters (if any)
- final int remainingChars = (limit - start);
- if (remainingChars > 0)
- writer.write(ch, start, remainingChars);
- // Protect comment end from a single trailing dash
- if (ch[limit - 1] == '-')
- writer.write(' ');
- }
- writer.write(COMMENT_END);
- }
- catch (IOException e)
- {
- throw new SAXException(e);
- }
-
- /*
- * Don't write out any indentation whitespace now,
- * because there may be non-whitespace text after this.
- *
- * Simply mark that at this point if we do decide
- * to indent that we should
- * add a newline on the end of the current line before
- * the indentation at the start of the next line.
- */
- m_startNewLine = true;
- // time to generate comment event
- if (m_tracer != null)
- super.fireCommentEvent(ch, start_old,length);
- }
-
- /**
- * Report the end of a CDATA section.
- * @throws org.xml.sax.SAXException The application may raise an exception.
- *
- * @see #startCDATA
- */
- public void endCDATA() throws org.xml.sax.SAXException
- {
- if (m_cdataTagOpen)
- closeCDATA();
- m_cdataStartCalled = false;
- }
-
- /**
- * Report the end of DTD declarations.
- * @throws org.xml.sax.SAXException The application may raise an exception.
- * @see #startDTD
- */
- public void endDTD() throws org.xml.sax.SAXException
- {
- try
- {
- // Don't output doctype declaration until startDocumentInternal
- // has been called. Otherwise, it can appear before XML decl.
- if (m_needToCallStartDocument) {
- return;
- }
-
- if (m_needToOutputDocTypeDecl)
- {
- outputDocTypeDecl(m_elemContext.m_elementName, false);
- m_needToOutputDocTypeDecl = false;
- }
- final java.io.Writer writer = m_writer;
- if (!m_inDoctype)
- writer.write("]>");
- else
- {
- writer.write('>');
- }
-
- writer.write(m_lineSep, 0, m_lineSepLen);
- }
- catch (IOException e)
- {
- throw new SAXException(e);
- }
-
- }
-
- /**
- * End the scope of a prefix-URI Namespace mapping.
- * @see org.xml.sax.ContentHandler#endPrefixMapping
- *
- * @param prefix The prefix that was being mapping.
- * @throws org.xml.sax.SAXException The client may throw
- * an exception during processing.
- */
- public void endPrefixMapping(String prefix) throws org.xml.sax.SAXException
- { // do nothing
- }
-
- /**
- * Receive notification of ignorable whitespace in element content.
- *
- * Not sure how to get this invoked quite yet.
- *
- * @param ch The characters from the XML document.
- * @param start The start position in the array.
- * @param length The number of characters to read from the array.
- * @throws org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see #characters
- *
- * @throws org.xml.sax.SAXException
- */
- public void ignorableWhitespace(char ch[], int start, int length)
- throws org.xml.sax.SAXException
- {
-
- if (0 == length)
- return;
- characters(ch, start, length);
- }
-
- /**
- * Receive notification of a skipped entity.
- * @see org.xml.sax.ContentHandler#skippedEntity
- *
- * @param name The name of the skipped entity. If it is a
- * parameter entity, the name will begin with '%',
- * and if it is the external DTD subset, it will be the string
- * "[dtd]".
- * @throws org.xml.sax.SAXException Any SAX exception, possibly wrapping
- * another exception.
- */
- public void skippedEntity(String name) throws org.xml.sax.SAXException
- { // TODO: Should handle
- }
-
- /**
- * Report the start of a CDATA section.
- *
- * @throws org.xml.sax.SAXException The application may raise an exception.
- * @see #endCDATA
- */
- public void startCDATA() throws org.xml.sax.SAXException
- {
- m_cdataStartCalled = true;
- }
-
- /**
- * Report the beginning of an entity.
- *
- * The start and end of the document entity are not reported.
- * The start and end of the external DTD subset are reported
- * using the pseudo-name "[dtd]". All other events must be
- * properly nested within start/end entity events.
- *
- * @param name The name of the entity. If it is a parameter
- * entity, the name will begin with '%'.
- * @throws org.xml.sax.SAXException The application may raise an exception.
- * @see #endEntity
- * @see org.xml.sax.ext.DeclHandler#internalEntityDecl
- * @see org.xml.sax.ext.DeclHandler#externalEntityDecl
- */
- public void startEntity(String name) throws org.xml.sax.SAXException
- {
- if (name.equals("[dtd]"))
- m_inExternalDTD = true;
-
- if (!m_expandDTDEntities && !m_inExternalDTD) {
- /* Only leave the entity as-is if
- * we've been told not to expand them
- * and this is not the magic [dtd] name.
- */
- startNonEscaping();
- characters("&" + name + ';');
- endNonEscaping();
- }
-
- m_inEntityRef = true;
- }
-
- /**
- * For the enclosing elements starting tag write out
- * out any attributes followed by ">"
- *
- * @throws org.xml.sax.SAXException
- */
- protected void closeStartTag() throws SAXException
- {
- if (m_elemContext.m_startTagOpen)
- {
-
- try
- {
- if (m_tracer != null)
- super.fireStartElem(m_elemContext.m_elementName);
- int nAttrs = m_attributes.getLength();
- if (nAttrs > 0)
- {
- processAttributes(m_writer, nAttrs);
- // clear attributes object for re-use with next element
- m_attributes.clear();
- }
- m_writer.write('>');
- }
- catch (IOException e)
- {
- throw new SAXException(e);
- }
-
- /* whether Xalan or XSLTC, we have the prefix mappings now, so
- * lets determine if the current element is specified in the cdata-
- * section-elements list.
- */
- if (m_cdataSectionElements != null)
- m_elemContext.m_isCdataSection = isCdataSection();
-
- if (m_doIndent)
- {
- m_isprevtext = false;
- m_preserves.push(m_ispreserve);
- }
- }
-
- }
-
- /**
- * Report the start of DTD declarations, if any.
- *
- * Any declarations are assumed to be in the internal subset unless
- * otherwise indicated.
- *
- * @param name The document type name.
- * @param publicId The declared public identifier for the
- * external DTD subset, or null if none was declared.
- * @param systemId The declared system identifier for the
- * external DTD subset, or null if none was declared.
- * @throws org.xml.sax.SAXException The application may raise an
- * exception.
- * @see #endDTD
- * @see #startEntity
- */
- public void startDTD(String name, String publicId, String systemId)
- throws org.xml.sax.SAXException
- {
- setDoctypeSystem(systemId);
- setDoctypePublic(publicId);
-
- m_elemContext.m_elementName = name;
- m_inDoctype = true;
- }
-
- /**
- * Returns the m_indentAmount.
- * @return int
- */
- public int getIndentAmount()
- {
- return m_indentAmount;
- }
-
- /**
- * Sets the m_indentAmount.
- *
- * @param m_indentAmount The m_indentAmount to set
- */
- public void setIndentAmount(int m_indentAmount)
- {
- this.m_indentAmount = m_indentAmount;
- }
-
- /**
- * Tell if, based on space preservation constraints and the doIndent property,
- * if an indent should occur.
- *
- * @return True if an indent should occur.
- */
- protected boolean shouldIndent()
- {
- return m_doIndent && (!m_ispreserve && !m_isprevtext) && (m_elemContext.m_currentElemDepth > 0 || m_isStandalone);
- }
-
- /**
- * Searches for the list of qname properties with the specified key in the
- * property list. If the key is not found in this property list, the default
- * property list, and its defaults, recursively, are then checked. The
- * method returns <code>null</code> if the property is not found.
- *
- * @param key the property key.
- * @param props the list of properties to search in.
- *
- * Sets the vector of local-name/URI pairs of the cdata section elements
- * specified in the cdata-section-elements property.
- *
- * This method is essentially a copy of getQNameProperties() from
- * OutputProperties. Eventually this method should go away and a call
- * to setCdataSectionElements(Vector v) should be made directly.
- */
- private void setCdataSectionElements(String key, Properties props)
- {
-
- String s = props.getProperty(key);
-
- if (null != s)
- {
- // Vector of URI/LocalName pairs
- Vector v = new Vector();
- int l = s.length();
- boolean inCurly = false;
- StringBuffer buf = new StringBuffer();
-
- // parse through string, breaking on whitespaces. I do this instead
- // of a tokenizer so I can track whitespace inside of curly brackets,
- // which theoretically shouldn't happen if they contain legal URLs.
- for (int i = 0; i < l; i++)
- {
- char c = s.charAt(i);
-
- if (Character.isWhitespace(c))
- {
- if (!inCurly)
- {
- if (buf.length() > 0)
- {
- addCdataSectionElement(buf.toString(), v);
- buf.setLength(0);
- }
- continue;
- }
- }
- else if ('{' == c)
- inCurly = true;
- else if ('}' == c)
- inCurly = false;
-
- buf.append(c);
- }
-
- if (buf.length() > 0)
- {
- addCdataSectionElement(buf.toString(), v);
- buf.setLength(0);
- }
- // call the official, public method to set the collected names
- setCdataSectionElements(v);
- }
-
- }
-
- /**
- * Adds a URI/LocalName pair of strings to the list.
- *
- * @param URI_and_localName String of the form "{uri}local" or "local"
- *
- * @return a QName object
- */
- private void addCdataSectionElement(String URI_and_localName, Vector v)
- {
-
- StringTokenizer tokenizer =
- new StringTokenizer(URI_and_localName, "{}", false);
- String s1 = tokenizer.nextToken();
- String s2 = tokenizer.hasMoreTokens() ? tokenizer.nextToken() : null;
-
- if (null == s2)
- {
- // add null URI and the local name
- v.addElement(null);
- v.addElement(s1);
- }
- else
- {
- // add URI, then local name
- v.addElement(s1);
- v.addElement(s2);
- }
- }
-
- /**
- * Remembers the cdata sections specified in the cdata-section-elements.
- * The "official way to set URI and localName pairs.
- * This method should be used by both Xalan and XSLTC.
- *
- * @param URI_and_localNames a vector of pairs of Strings (URI/local)
- */
- public void setCdataSectionElements(Vector URI_and_localNames)
- {
- m_cdataSectionElements = URI_and_localNames;
- }
-
- /**
- * Makes sure that the namespace URI for the given qualified attribute name
- * is declared.
- * @param ns the namespace URI
- * @param rawName the qualified name
- * @return returns null if no action is taken, otherwise it returns the
- * prefix used in declaring the namespace.
- * @throws SAXException
- */
- protected String ensureAttributesNamespaceIsDeclared(
- String ns,
- String localName,
- String rawName)
- throws org.xml.sax.SAXException
- {
-
- if (ns != null && ns.length() > 0)
- {
-
- // extract the prefix in front of the raw name
- int index = 0;
- String prefixFromRawName =
- (index = rawName.indexOf(":")) < 0
- ? ""
- : rawName.substring(0, index);
-
- if (index > 0)
- {
- // we have a prefix, lets see if it maps to a namespace
- String uri = m_prefixMap.lookupNamespace(prefixFromRawName);
- if (uri != null && uri.equals(ns))
- {
- // the prefix in the raw name is already maps to the given namespace uri
- // so we don't need to do anything
- return null;
- }
- else
- {
- // The uri does not map to the prefix in the raw name,
- // so lets make the mapping.
- this.startPrefixMapping(prefixFromRawName, ns, false);
- this.addAttribute(
- "http://www.w3.org/2000/xmlns/",
- prefixFromRawName,
- "xmlns:" + prefixFromRawName,
- "CDATA",
- ns, false);
- return prefixFromRawName;
- }
- }
- else
- {
- // we don't have a prefix in the raw name.
- // Does the URI map to a prefix already?
- String prefix = m_prefixMap.lookupPrefix(ns);
- if (prefix == null)
- {
- // uri is not associated with a prefix,
- // so lets generate a new prefix to use
- prefix = m_prefixMap.generateNextPrefix();
- this.startPrefixMapping(prefix, ns, false);
- this.addAttribute(
- "http://www.w3.org/2000/xmlns/",
- prefix,
- "xmlns:" + prefix,
- "CDATA",
- ns, false);
- }
-
- return prefix;
-
- }
- }
- return null;
- }
-
- void ensurePrefixIsDeclared(String ns, String rawName)
- throws org.xml.sax.SAXException
- {
-
- if (ns != null && ns.length() > 0)
- {
- int index;
- final boolean no_prefix = ((index = rawName.indexOf(":")) < 0);
- String prefix = (no_prefix) ? "" : rawName.substring(0, index);
-
- if (null != prefix)
- {
- String foundURI = m_prefixMap.lookupNamespace(prefix);
-
- if ((null == foundURI) || !foundURI.equals(ns))
- {
- this.startPrefixMapping(prefix, ns);
-
- // Bugzilla1133: Generate attribute as well as namespace event.
- // SAX does expect both.
-
- this.addAttributeAlways(
- "http://www.w3.org/2000/xmlns/",
- no_prefix ? "xmlns" : prefix, // local name
- no_prefix ? "xmlns" : ("xmlns:"+ prefix), // qname
- "CDATA",
- ns,
- false);
- }
-
- }
- }
- }
-
- /**
- * This method flushes any pending events, which can be startDocument()
- * closing the opening tag of an element, or closing an open CDATA section.
- */
- public void flushPending() throws SAXException
- {
- if (m_needToCallStartDocument)
- {
- startDocumentInternal();
- m_needToCallStartDocument = false;
- }
- if (m_elemContext.m_startTagOpen)
- {
- closeStartTag();
- m_elemContext.m_startTagOpen = false;
- }
-
- if (m_cdataTagOpen)
- {
- closeCDATA();
- m_cdataTagOpen = false;
- }
- }
-
- public void setContentHandler(ContentHandler ch)
- {
- // this method is really only useful in the ToSAXHandler classes but it is
- // in the interface. If the method defined here is ever called
- // we are probably in trouble.
- }
-
- /**
- * Adds the given attribute to the set of attributes, even if there is
- * no currently open element. This is useful if a SAX startPrefixMapping()
- * should need to add an attribute before the element name is seen.
- *
- * This method is a copy of its super classes method, except that some
- * tracing of events is done. This is so the tracing is only done for
- * stream serializers, not for SAX ones.
- *
- * @param uri the URI of the attribute
- * @param localName the local name of the attribute
- * @param rawName the qualified name of the attribute
- * @param type the type of the attribute (probably CDATA)
- * @param value the value of the attribute
- * @param xslAttribute true if this attribute is coming from an xsl:attribute element.
- * @return true if the attribute value was added,
- * false if the attribute already existed and the value was
- * replaced with the new value.
- */
- public boolean addAttributeAlways(
- String uri,
- String localName,
- String rawName,
- String type,
- String value,
- boolean xslAttribute)
- {
- boolean was_added;
- int index;
- //if (uri == null || localName == null || uri.length() == 0)
- index = m_attributes.getIndex(rawName);
- // Don't use 'localName' as it gives incorrect value, rely only on 'rawName'
- /*else {
- index = m_attributes.getIndex(uri, localName);
- }*/
- if (index >= 0)
- {
- String old_value = null;
- if (m_tracer != null)
- {
- old_value = m_attributes.getValue(index);
- if (value.equals(old_value))
- old_value = null;
- }
-
- /* We've seen the attribute before.
- * We may have a null uri or localName, but all we really
- * want to re-set is the value anyway.
- */
- m_attributes.setValue(index, value);
- was_added = false;
- if (old_value != null){
- firePseudoAttributes();
- }
-
- }
- else
- {
- // the attribute doesn't exist yet, create it
- if (xslAttribute)
- {
- /*
- * This attribute is from an xsl:attribute element so we take some care in
- * adding it, e.g.
- * <elem1 foo:attr1="1" xmlns:foo="uri1">
- * <xsl:attribute name="foo:attr2">2</xsl:attribute>
- * </elem1>
- *
- * We are adding attr1 and attr2 both as attributes of elem1,
- * and this code is adding attr2 (the xsl:attribute ).
- * We could have a collision with the prefix like in the example above.
- */
-
- // In the example above, is there a prefix like foo ?
- final int colonIndex = rawName.indexOf(':');
- if (colonIndex > 0)
- {
- String prefix = rawName.substring(0,colonIndex);
- NamespaceMappings.MappingRecord existing_mapping = m_prefixMap.getMappingFromPrefix(prefix);
-
- /* Before adding this attribute (foo:attr2),
- * is the prefix for it (foo) already mapped at the current depth?
- */
- if (existing_mapping != null
- && existing_mapping.m_declarationDepth == m_elemContext.m_currentElemDepth
- && !existing_mapping.m_uri.equals(uri))
- {
- /*
- * There is an existing mapping of this prefix,
- * it differs from the one we need,
- * and unfortunately it is at the current depth so we
- * can not over-ride it.
- */
-
- /*
- * Are we lucky enough that an existing other prefix maps to this URI ?
- */
- prefix = m_prefixMap.lookupPrefix(uri);
- if (prefix == null)
- {
- /* Unfortunately there is no existing prefix that happens to map to ours,
- * so to avoid a prefix collision we must generated a new prefix to use.
- * This is OK because the prefix URI mapping
- * defined in the xsl:attribute is short in scope,
- * just the xsl:attribute element itself,
- * and at this point in serialization the body of the
- * xsl:attribute, if any, is just a String. Right?
- * . . . I sure hope so - Brian M.
- */
- prefix = m_prefixMap.generateNextPrefix();
- }
-
- rawName = prefix + ':' + localName;
- }
- }
-
- try
- {
- /* This is our last chance to make sure the namespace for this
- * attribute is declared, especially if we just generated an alternate
- * prefix to avoid a collision (the new prefix/rawName will go out of scope
- * soon and be lost ... last chance here.
- */
- String prefixUsed =
- ensureAttributesNamespaceIsDeclared(
- uri,
- localName,
- rawName);
- }
- catch (SAXException e)
- {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- m_attributes.addAttribute(uri, localName, rawName, type, value);
- was_added = true;
- if (m_tracer != null){
- firePseudoAttributes();
- }
- }
- return was_added;
- }
-
- /**
- * To fire off the pseudo characters of attributes, as they currently
- * exist. This method should be called everytime an attribute is added,
- * or when an attribute value is changed, or an element is created.
- */
-
- protected void firePseudoAttributes()
- {
- if (m_tracer != null)
- {
- try
- {
- // flush out the "<elemName" if not already flushed
- m_writer.flush();
-
- // make a StringBuffer to write the name="value" pairs to.
- StringBuffer sb = new StringBuffer();
- int nAttrs = m_attributes.getLength();
- if (nAttrs > 0)
- {
- // make a writer that internally appends to the same
- // StringBuffer
- java.io.Writer writer =
- new ToStream.WritertoStringBuffer(sb);
-
- processAttributes(writer, nAttrs);
- // Don't clear the attributes!
- // We only want to see what would be written out
- // at this point, we don't want to loose them.
- }
- sb.append('>'); // the potential > after the attributes.
- // convert the StringBuffer to a char array and
- // emit the trace event that these characters "might"
- // be written
- char ch[] = sb.toString().toCharArray();
- m_tracer.fireGenerateEvent(
- SerializerTrace.EVENTTYPE_OUTPUT_PSEUDO_CHARACTERS,
- ch,
- 0,
- ch.length);
- }
- catch (IOException ioe)
- {
- // ignore ?
- }
- catch (SAXException se)
- {
- // ignore ?
- }
- }
- }
-
- /**
- * This inner class is used only to collect attribute values
- * written by the method writeAttrString() into a string buffer.
- * In this manner trace events, and the real writing of attributes will use
- * the same code.
- */
- private class WritertoStringBuffer extends java.io.Writer
- {
- final private StringBuffer m_stringbuf;
- /**
- * @see java.io.Writer#write(char[], int, int)
- */
- WritertoStringBuffer(StringBuffer sb)
- {
- m_stringbuf = sb;
- }
-
- public void write(char[] arg0, int arg1, int arg2) throws IOException
- {
- m_stringbuf.append(arg0, arg1, arg2);
- }
- /**
- * @see java.io.Writer#flush()
- */
- public void flush() throws IOException
- {
- }
- /**
- * @see java.io.Writer#close()
- */
- public void close() throws IOException
- {
- }
-
- public void write(int i)
- {
- m_stringbuf.append((char) i);
- }
-
- public void write(String s)
- {
- m_stringbuf.append(s);
- }
- }
-
- /**
- * @see SerializationHandler#setTransformer(Transformer)
- */
- public void setTransformer(Transformer transformer) {
- super.setTransformer(transformer);
- if (m_tracer != null
- && !(m_writer instanceof SerializerTraceWriter) )
- m_writer = new SerializerTraceWriter(m_writer, m_tracer);
-
-
- }
- /**
- * Try's to reset the super class and reset this class for
- * re-use, so that you don't need to create a new serializer
- * (mostly for performance reasons).
- *
- * @return true if the class was successfuly reset.
- */
- public boolean reset()
- {
- boolean wasReset = false;
- if (super.reset())
- {
- resetToStream();
- wasReset = true;
- }
- return wasReset;
- }
-
- /**
- * Reset all of the fields owned by ToStream class
- *
- */
- private void resetToStream()
- {
- this.m_cdataStartCalled = false;
- /* The stream is being reset. It is one of
- * ToXMLStream, ToHTMLStream ... and this type can't be changed
- * so neither should m_charInfo which is associated with the
- * type of Stream. Just leave m_charInfo as-is for the next re-use.
- *
- */
- // this.m_charInfo = null; // don't set to null
-
- this.m_disableOutputEscapingStates.clear();
-
- this.m_escaping = true;
- // Leave m_format alone for now - Brian M.
- // this.m_format = null;
- this.m_inDoctype = false;
- this.m_ispreserve = false;
- this.m_ispreserve = false;
- this.m_isprevtext = false;
- this.m_isUTF8 = false; // ?? used anywhere ??
- this.m_preserves.clear();
- this.m_shouldFlush = true;
- this.m_spaceBeforeClose = false;
- this.m_startNewLine = false;
- this.m_lineSepUse = true;
- // DON'T SET THE WRITER TO NULL, IT MAY BE REUSED !!
- // this.m_writer = null;
- this.m_expandDTDEntities = true;
-
- }
-
- /**
- * Sets the character encoding coming from the xsl:output encoding stylesheet attribute.
- * @param encoding the character encoding
- */
- public void setEncoding(String encoding)
- {
- String old = getEncoding();
- super.setEncoding(encoding);
- if (old == null || !old.equals(encoding)) {
- // If we have changed the setting of the
- m_encodingInfo = Encodings.getEncodingInfo(encoding);
-
- if (encoding != null && m_encodingInfo.name == null) {
- // We tried to get an EncodingInfo for Object for the given
- // encoding, but it came back with an internall null name
- // so the encoding is not supported by the JDK, issue a message.
- String msg = Utils.messages.createMessage(
- MsgKey.ER_ENCODING_NOT_SUPPORTED,new Object[]{ encoding });
- try
- {
- // Prepare to issue the warning message
- Transformer tran = super.getTransformer();
- if (tran != null) {
- ErrorListener errHandler = tran.getErrorListener();
- // Issue the warning message
- if (null != errHandler && m_sourceLocator != null)
- errHandler.warning(new TransformerException(msg, m_sourceLocator));
- else
- System.out.println(msg);
- }
- else
- System.out.println(msg);
- }
- catch (Exception e){}
- }
- }
- return;
- }
-
- /**
- * Simple stack for boolean values.
- *
- * This class is a copy of the one in com.sun.org.apache.xml.internal.utils.
- * It exists to cut the serializers dependancy on that package.
- * A minor changes from that package are:
- * doesn't implement Clonable
- *
- * @xsl.usage internal
- */
- static final class BoolStack
- {
-
- /** Array of boolean values */
- private boolean m_values[];
-
- /** Array size allocated */
- private int m_allocatedSize;
-
- /** Index into the array of booleans */
- private int m_index;
-
- /**
- * Default constructor. Note that the default
- * block size is very small, for small lists.
- */
- public BoolStack()
- {
- this(32);
- }
-
- /**
- * Construct a IntVector, using the given block size.
- *
- * @param size array size to allocate
- */
- public BoolStack(int size)
- {
-
- m_allocatedSize = size;
- m_values = new boolean[size];
- m_index = -1;
- }
-
- /**
- * Get the length of the list.
- *
- * @return Current length of the list
- */
- public final int size()
- {
- return m_index + 1;
- }
-
- /**
- * Clears the stack.
- *
- */
- public final void clear()
- {
- m_index = -1;
- }
-
- /**
- * Pushes an item onto the top of this stack.
- *
- *
- * @param val the boolean to be pushed onto this stack.
- * @return the <code>item</code> argument.
- */
- public final boolean push(boolean val)
- {
-
- if (m_index == m_allocatedSize - 1)
- grow();
-
- return (m_values[++m_index] = val);
- }
-
- /**
- * Removes the object at the top of this stack and returns that
- * object as the value of this function.
- *
- * @return The object at the top of this stack.
- * @throws EmptyStackException if this stack is empty.
- */
- public final boolean pop()
- {
- return m_values[m_index--];
- }
-
- /**
- * Removes the object at the top of this stack and returns the
- * next object at the top as the value of this function.
- *
- *
- * @return Next object to the top or false if none there
- */
- public final boolean popAndTop()
- {
-
- m_index--;
-
- return (m_index >= 0) ? m_values[m_index] : false;
- }
-
- /**
- * Set the item at the top of this stack
- *
- *
- * @param b Object to set at the top of this stack
- */
- public final void setTop(boolean b)
- {
- m_values[m_index] = b;
- }
-
- /**
- * Looks at the object at the top of this stack without removing it
- * from the stack.
- *
- * @return the object at the top of this stack.
- * @throws EmptyStackException if this stack is empty.
- */
- public final boolean peek()
- {
- return m_values[m_index];
- }
-
- /**
- * Looks at the object at the top of this stack without removing it
- * from the stack. If the stack is empty, it returns false.
- *
- * @return the object at the top of this stack.
- */
- public final boolean peekOrFalse()
- {
- return (m_index > -1) ? m_values[m_index] : false;
- }
-
- /**
- * Looks at the object at the top of this stack without removing it
- * from the stack. If the stack is empty, it returns true.
- *
- * @return the object at the top of this stack.
- */
- public final boolean peekOrTrue()
- {
- return (m_index > -1) ? m_values[m_index] : true;
- }
-
- /**
- * Tests if this stack is empty.
- *
- * @return <code>true</code> if this stack is empty;
- * <code>false</code> otherwise.
- */
- public boolean isEmpty()
- {
- return (m_index == -1);
- }
-
- /**
- * Grows the size of the stack
- *
- */
- private void grow()
- {
-
- m_allocatedSize *= 2;
-
- boolean newVector[] = new boolean[m_allocatedSize];
-
- System.arraycopy(m_values, 0, newVector, 0, m_index + 1);
-
- m_values = newVector;
- }
- }
-
- // Implement DTDHandler
- /**
- * If this method is called, the serializer is used as a
- * DTDHandler, which changes behavior how the serializer
- * handles document entities.
- * @see org.xml.sax.DTDHandler#notationDecl(java.lang.String, java.lang.String, java.lang.String)
- */
- public void notationDecl(String name, String pubID, String sysID) throws SAXException {
- // TODO Auto-generated method stub
- try {
- DTDprolog();
-
- m_writer.write("<!NOTATION ");
- m_writer.write(name);
- if (pubID != null) {
- m_writer.write(" PUBLIC \"");
- m_writer.write(pubID);
-
- }
- else {
- m_writer.write(" SYSTEM \"");
- m_writer.write(sysID);
- }
- m_writer.write("\" >");
- m_writer.write(m_lineSep, 0, m_lineSepLen);
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
- /**
- * If this method is called, the serializer is used as a
- * DTDHandler, which changes behavior how the serializer
- * handles document entities.
- * @see org.xml.sax.DTDHandler#unparsedEntityDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
- */
- public void unparsedEntityDecl(String name, String pubID, String sysID, String notationName) throws SAXException {
- // TODO Auto-generated method stub
- try {
- DTDprolog();
-
- m_writer.write("<!ENTITY ");
- m_writer.write(name);
- if (pubID != null) {
- m_writer.write(" PUBLIC \"");
- m_writer.write(pubID);
-
- }
- else {
- m_writer.write(" SYSTEM \"");
- m_writer.write(sysID);
- }
- m_writer.write("\" NDATA ");
- m_writer.write(notationName);
- m_writer.write(" >");
- m_writer.write(m_lineSep, 0, m_lineSepLen);
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
- /**
- * A private helper method to output the
- * @throws SAXException
- * @throws IOException
- */
- private void DTDprolog() throws SAXException, IOException {
- final java.io.Writer writer = m_writer;
- if (m_needToOutputDocTypeDecl)
- {
- outputDocTypeDecl(m_elemContext.m_elementName, false);
- m_needToOutputDocTypeDecl = false;
- }
- if (m_inDoctype)
- {
- writer.write(" [");
- writer.write(m_lineSep, 0, m_lineSepLen);
- m_inDoctype = false;
- }
- }
-
- /**
- * If set to false the serializer does not expand DTD entities,
- * but leaves them as is, the default value is true;
- */
- public void setDTDEntityExpansion(boolean expand) {
- m_expandDTDEntities = expand;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/ToTextSAXHandler.java b/src/com/sun/org/apache/xml/internal/serializer/ToTextSAXHandler.java
deleted file mode 100644
index f76c552..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/ToTextSAXHandler.java
+++ /dev/null
@@ -1,414 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ToTextSAXHandler.java,v 1.3 2005/09/28 13:49:08 pvedula Exp $
- */
-package com.sun.org.apache.xml.internal.serializer;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.Writer;
-import java.util.Properties;
-
-import org.w3c.dom.Node;
-import org.xml.sax.Attributes;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-import org.xml.sax.ext.LexicalHandler;
-
-/**
- * This class converts SAX-like event to SAX events for
- * xsl:output method "text".
- *
- * This class is only to be used internally. This class is not a public API.
- *
- * @xsl.usage internal
- */
-public final class ToTextSAXHandler extends ToSAXHandler
-{
- /**
- * From XSLTC
- * @see ExtendedContentHandler#endElement(String)
- */
- public void endElement(String elemName) throws SAXException
- {
- if (m_tracer != null)
- super.fireEndElem(elemName);
- }
-
- /**
- * @see org.xml.sax.ContentHandler#endElement(String, String, String)
- */
- public void endElement(String arg0, String arg1, String arg2)
- throws SAXException
- {
- if (m_tracer != null)
- super.fireEndElem(arg2);
- }
-
- public ToTextSAXHandler(ContentHandler hdlr, LexicalHandler lex, String encoding)
- {
- super(hdlr, lex, encoding);
- }
-
- /**
- * From XSLTC
- */
- public ToTextSAXHandler(ContentHandler handler, String encoding)
- {
- super(handler,encoding);
- }
-
- public void comment(char ch[], int start, int length)
- throws org.xml.sax.SAXException
- {
- if (m_tracer != null)
- super.fireCommentEvent(ch, start, length);
- }
-
- public void comment(String data) throws org.xml.sax.SAXException
- {
- final int length = data.length();
- if (length > m_charsBuff.length)
- {
- m_charsBuff = new char[length*2 + 1];
- }
- data.getChars(0, length, m_charsBuff, 0);
- comment(m_charsBuff, 0, length);
- }
-
- /**
- * @see Serializer#getOutputFormat()
- */
- public Properties getOutputFormat()
- {
- return null;
- }
-
- /**
- * @see Serializer#getOutputStream()
- */
- public OutputStream getOutputStream()
- {
- return null;
- }
-
- /**
- * @see Serializer#getWriter()
- */
- public Writer getWriter()
- {
- return null;
- }
-
- /**
- * Does nothing because
- * the indent attribute is ignored for text output.
- *
- */
- public void indent(int n) throws SAXException
- {
- }
-
- /**
- * @see Serializer#reset()
- */
- public boolean reset()
- {
- return false;
- }
-
- /**
- * @see DOMSerializer#serialize(Node)
- */
- public void serialize(Node node) throws IOException
- {
- }
-
- /**
- * @see SerializationHandler#setEscaping(boolean)
- */
- public boolean setEscaping(boolean escape)
- {
- return false;
- }
-
- /**
- * @see SerializationHandler#setIndent(boolean)
- */
- public void setIndent(boolean indent)
- {
- }
-
- /**
- * @see Serializer#setOutputFormat(Properties)
- */
- public void setOutputFormat(Properties format)
- {
- }
-
- /**
- * @see Serializer#setOutputStream(OutputStream)
- */
- public void setOutputStream(OutputStream output)
- {
- }
-
- /**
- * @see Serializer#setWriter(Writer)
- */
- public void setWriter(Writer writer)
- {
- }
-
- /**
- * @see ExtendedContentHandler#addAttribute(String, String, String, String, String)
- */
- public void addAttribute(
- String uri,
- String localName,
- String rawName,
- String type,
- String value,
- boolean XSLAttribute)
- {
- }
-
- /**
- * @see org.xml.sax.ext.DeclHandler#attributeDecl(String, String, String, String, String)
- */
- public void attributeDecl(
- String arg0,
- String arg1,
- String arg2,
- String arg3,
- String arg4)
- throws SAXException
- {
- }
-
- /**
- * @see org.xml.sax.ext.DeclHandler#elementDecl(String, String)
- */
- public void elementDecl(String arg0, String arg1) throws SAXException
- {
- }
-
- /**
- * @see org.xml.sax.ext.DeclHandler#externalEntityDecl(String, String, String)
- */
- public void externalEntityDecl(String arg0, String arg1, String arg2)
- throws SAXException
- {
- }
-
- /**
- * @see org.xml.sax.ext.DeclHandler#internalEntityDecl(String, String)
- */
- public void internalEntityDecl(String arg0, String arg1)
- throws SAXException
- {
- }
-
- /**
- * @see org.xml.sax.ContentHandler#endPrefixMapping(String)
- */
- public void endPrefixMapping(String arg0) throws SAXException
- {
- }
-
- /**
- * @see org.xml.sax.ContentHandler#ignorableWhitespace(char[], int, int)
- */
- public void ignorableWhitespace(char[] arg0, int arg1, int arg2)
- throws SAXException
- {
- }
-
- /**
- * From XSLTC
- * @see org.xml.sax.ContentHandler#processingInstruction(String, String)
- */
- public void processingInstruction(String arg0, String arg1)
- throws SAXException
- {
- if (m_tracer != null)
- super.fireEscapingEvent(arg0, arg1);
- }
-
- /**
- * @see org.xml.sax.ContentHandler#setDocumentLocator(Locator)
- */
- public void setDocumentLocator(Locator arg0)
- {
- super.setDocumentLocator(arg0);
- }
-
- /**
- * @see org.xml.sax.ContentHandler#skippedEntity(String)
- */
- public void skippedEntity(String arg0) throws SAXException
- {
- }
-
- /**
- * @see org.xml.sax.ContentHandler#startElement(String, String, String, Attributes)
- */
- public void startElement(
- String arg0,
- String arg1,
- String arg2,
- Attributes arg3)
- throws SAXException
- {
- flushPending();
- super.startElement(arg0, arg1, arg2, arg3);
- }
-
- /**
- * @see org.xml.sax.ext.LexicalHandler#endCDATA()
- */
- public void endCDATA() throws SAXException
- {
- }
-
- /**
- * @see org.xml.sax.ext.LexicalHandler#endDTD()
- */
- public void endDTD() throws SAXException
- {
- }
-
- /**
- * @see org.xml.sax.ext.LexicalHandler#startCDATA()
- */
- public void startCDATA() throws SAXException
- {
- }
-
-
- /**
- * @see org.xml.sax.ext.LexicalHandler#startEntity(String)
- */
- public void startEntity(String arg0) throws SAXException
- {
- }
-
-
- /**
- * From XSLTC
- * @see ExtendedContentHandler#startElement(String)
- */
- public void startElement(
- String elementNamespaceURI,
- String elementLocalName,
- String elementName) throws SAXException
- {
- super.startElement(elementNamespaceURI, elementLocalName, elementName);
- }
-
- public void startElement(
- String elementName) throws SAXException
- {
- super.startElement(elementName);
- }
-
-
- /**
- * From XSLTC
- * @see org.xml.sax.ContentHandler#endDocument()
- */
- public void endDocument() throws SAXException {
-
- flushPending();
- m_saxHandler.endDocument();
-
- if (m_tracer != null)
- super.fireEndDoc();
- }
-
- /**
- *
- * @see ExtendedContentHandler#characters(String)
- */
- public void characters(String characters)
- throws SAXException
- {
- final int length = characters.length();
- if (length > m_charsBuff.length)
- {
- m_charsBuff = new char[length*2 + 1];
- }
- characters.getChars(0, length, m_charsBuff, 0);
-
- m_saxHandler.characters(m_charsBuff, 0, length);
-
- }
- /**
- * @see org.xml.sax.ContentHandler#characters(char[], int, int)
- */
- public void characters(char[] characters, int offset, int length)
- throws SAXException
- {
-
- m_saxHandler.characters(characters, offset, length);
-
- // time to fire off characters event
- if (m_tracer != null)
- super.fireCharEvent(characters, offset, length);
- }
-
- /**
- * From XSLTC
- */
- public void addAttribute(String name, String value)
- {
- // do nothing
- }
-
-
- public boolean startPrefixMapping(
- String prefix,
- String uri,
- boolean shouldFlush)
- throws SAXException
- {
- // no namespace support for HTML
- return false;
- }
-
-
- public void startPrefixMapping(String prefix, String uri)
- throws org.xml.sax.SAXException
- {
- // no namespace support for HTML
- }
-
-
- public void namespaceAfterStartElement(
- final String prefix,
- final String uri)
- throws SAXException
- {
- // no namespace support for HTML
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/ToTextStream.java b/src/com/sun/org/apache/xml/internal/serializer/ToTextStream.java
deleted file mode 100644
index 9e39b89..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/ToTextStream.java
+++ /dev/null
@@ -1,636 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ToTextStream.java,v 1.2.4.1 2005/09/21 10:35:34 pvedula Exp $
- */
-package com.sun.org.apache.xml.internal.serializer;
-
-import java.io.IOException;
-
-import com.sun.org.apache.xml.internal.serializer.utils.MsgKey;
-import com.sun.org.apache.xml.internal.serializer.utils.Utils;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-
-/**
- * This class is not a public API.
- * It is only public because it is used in other packages.
- * This class converts SAX or SAX-like calls to a
- * serialized document for xsl:output method of "text".
- * @xsl.usage internal
- */
-public final class ToTextStream extends ToStream
-{
-
-
- /**
- * Default constructor.
- */
- public ToTextStream()
- {
- super();
- }
-
-
-
- /**
- * Receive notification of the beginning of a document.
- *
- * <p>The SAX parser will invoke this method only once, before any
- * other methods in this interface or in DTDHandler (except for
- * setDocumentLocator).</p>
- *
- * @throws org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- *
- * @throws org.xml.sax.SAXException
- */
- protected void startDocumentInternal() throws org.xml.sax.SAXException
- {
- super.startDocumentInternal();
-
- m_needToCallStartDocument = false;
-
- // No action for the moment.
- }
-
- /**
- * Receive notification of the end of a document.
- *
- * <p>The SAX parser will invoke this method only once, and it will
- * be the last method invoked during the parse. The parser shall
- * not invoke this method until it has either abandoned parsing
- * (because of an unrecoverable error) or reached the end of
- * input.</p>
- *
- * @throws org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- *
- * @throws org.xml.sax.SAXException
- */
- public void endDocument() throws org.xml.sax.SAXException
- {
- flushPending();
- flushWriter();
- if (m_tracer != null)
- super.fireEndDoc();
- }
-
- /**
- * Receive notification of the beginning of an element.
- *
- * <p>The Parser will invoke this method at the beginning of every
- * element in the XML document; there will be a corresponding
- * endElement() event for every startElement() event (even when the
- * element is empty). All of the element's content will be
- * reported, in order, before the corresponding endElement()
- * event.</p>
- *
- * <p>If the element name has a namespace prefix, the prefix will
- * still be attached. Note that the attribute list provided will
- * contain only attributes with explicit values (specified or
- * defaulted): #IMPLIED attributes will be omitted.</p>
- *
- *
- * @param namespaceURI The Namespace URI, or the empty string if the
- * element has no Namespace URI or if Namespace
- * processing is not being performed.
- * @param localName The local name (without prefix), or the
- * empty string if Namespace processing is not being
- * performed.
- * @param name The qualified name (with prefix), or the
- * empty string if qualified names are not available.
- * @param atts The attributes attached to the element, if any.
- * @throws org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see #endElement
- * @see org.xml.sax.AttributeList
- *
- * @throws org.xml.sax.SAXException
- */
- public void startElement(
- String namespaceURI, String localName, String name, Attributes atts)
- throws org.xml.sax.SAXException
- {
- // time to fire off startElement event
- if (m_tracer != null) {
- super.fireStartElem(name);
- this.firePseudoAttributes();
- }
- return;
- }
-
- /**
- * Receive notification of the end of an element.
- *
- * <p>The SAX parser will invoke this method at the end of every
- * element in the XML document; there will be a corresponding
- * startElement() event for every endElement() event (even when the
- * element is empty).</p>
- *
- * <p>If the element name has a namespace prefix, the prefix will
- * still be attached to the name.</p>
- *
- *
- * @param namespaceURI The Namespace URI, or the empty string if the
- * element has no Namespace URI or if Namespace
- * processing is not being performed.
- * @param localName The local name (without prefix), or the
- * empty string if Namespace processing is not being
- * performed.
- * @param name The qualified name (with prefix), or the
- * empty string if qualified names are not available.
- * @throws org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- *
- * @throws org.xml.sax.SAXException
- */
- public void endElement(String namespaceURI, String localName, String name)
- throws org.xml.sax.SAXException
- {
- if (m_tracer != null)
- super.fireEndElem(name);
- }
-
- /**
- * Receive notification of character data.
- *
- * <p>The Parser will call this method to report each chunk of
- * character data. SAX parsers may return all contiguous character
- * data in a single chunk, or they may split it into several
- * chunks; however, all of the characters in any single event
- * must come from the same external entity, so that the Locator
- * provides useful information.</p>
- *
- * <p>The application must not attempt to read from the array
- * outside of the specified range.</p>
- *
- * <p>Note that some parsers will report whitespace using the
- * ignorableWhitespace() method rather than this one (validating
- * parsers must do so).</p>
- *
- * @param ch The characters from the XML document.
- * @param start The start position in the array.
- * @param length The number of characters to read from the array.
- * @throws org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see #ignorableWhitespace
- * @see org.xml.sax.Locator
- */
- public void characters(char ch[], int start, int length)
- throws org.xml.sax.SAXException
- {
-
- flushPending();
-
- try
- {
- if (inTemporaryOutputState()) {
- /* leave characters un-processed as we are
- * creating temporary output, the output generated by
- * this serializer will be input to a final serializer
- * later on and it will do the processing in final
- * output state (not temporary output state).
- *
- * A "temporary" ToTextStream serializer is used to
- * evaluate attribute value templates (for example),
- * and the result of evaluating such a thing
- * is fed into a final serializer later on.
- */
- m_writer.write(ch, start, length);
- }
- else {
- // In final output state we do process the characters!
- writeNormalizedChars(ch, start, length, m_lineSepUse);
- }
-
- if (m_tracer != null)
- super.fireCharEvent(ch, start, length);
- }
- catch(IOException ioe)
- {
- throw new SAXException(ioe);
- }
- }
-
- /**
- * If available, when the disable-output-escaping attribute is used,
- * output raw text without escaping.
- *
- * @param ch The characters from the XML document.
- * @param start The start position in the array.
- * @param length The number of characters to read from the array.
- *
- * @throws org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- */
- public void charactersRaw(char ch[], int start, int length)
- throws org.xml.sax.SAXException
- {
-
- try
- {
- writeNormalizedChars(ch, start, length, m_lineSepUse);
- }
- catch(IOException ioe)
- {
- throw new SAXException(ioe);
- }
- }
-
- /**
- * Normalize the characters, but don't escape. Different from
- * SerializerToXML#writeNormalizedChars because it does not attempt to do
- * XML escaping at all.
- *
- * @param ch The characters from the XML document.
- * @param start The start position in the array.
- * @param length The number of characters to read from the array.
- * @param useLineSep true if the operating systems
- * end-of-line separator should be output rather than a new-line character.
- *
- * @throws IOException
- * @throws org.xml.sax.SAXException
- */
- void writeNormalizedChars(
- final char ch[],
- final int start,
- final int length,
- final boolean useLineSep)
- throws IOException, org.xml.sax.SAXException
- {
- final String encoding = getEncoding();
- final java.io.Writer writer = m_writer;
- final int end = start + length;
-
- /* copy a few "constants" before the loop for performance */
- final char S_LINEFEED = CharInfo.S_LINEFEED;
-
- // This for() loop always increments i by one at the end
- // of the loop. Additional increments of i adjust for when
- // two input characters (a high/low UTF16 surrogate pair)
- // are processed.
- for (int i = start; i < end; i++) {
- final char c = ch[i];
-
- if (S_LINEFEED == c && useLineSep) {
- writer.write(m_lineSep, 0, m_lineSepLen);
- // one input char processed
- } else if (m_encodingInfo.isInEncoding(c)) {
- writer.write(c);
- // one input char processed
- } else if (Encodings.isHighUTF16Surrogate(c)) {
- final int codePoint = writeUTF16Surrogate(c, ch, i, end);
- if (codePoint != 0) {
- // I think we can just emit the message,
- // not crash and burn.
- final String integralValue = Integer.toString(codePoint);
- final String msg = Utils.messages.createMessage(
- MsgKey.ER_ILLEGAL_CHARACTER,
- new Object[] { integralValue, encoding });
-
- //Older behavior was to throw the message,
- //but newer gentler behavior is to write a message to System.err
- //throw new SAXException(msg);
- System.err.println(msg);
-
- }
- i++; // two input chars processed
- } else {
- // Don't know what to do with this char, it is
- // not in the encoding and not a high char in
- // a surrogate pair, so write out as an entity ref
- if (encoding != null) {
- /* The output encoding is known,
- * so somthing is wrong.
- */
-
- // not in the encoding, so write out a character reference
- writer.write('&');
- writer.write('#');
- writer.write(Integer.toString(c));
- writer.write(';');
-
- // I think we can just emit the message,
- // not crash and burn.
- final String integralValue = Integer.toString(c);
- final String msg = Utils.messages.createMessage(
- MsgKey.ER_ILLEGAL_CHARACTER,
- new Object[] { integralValue, encoding });
-
- //Older behavior was to throw the message,
- //but newer gentler behavior is to write a message to System.err
- //throw new SAXException(msg);
- System.err.println(msg);
- } else {
- /* The output encoding is not known,
- * so just write it out as-is.
- */
- writer.write(c);
- }
-
- // one input char was processed
- }
- }
- }
-
- /**
- * Receive notification of cdata.
- *
- * <p>The Parser will call this method to report each chunk of
- * character data. SAX parsers may return all contiguous character
- * data in a single chunk, or they may split it into several
- * chunks; however, all of the characters in any single event
- * must come from the same external entity, so that the Locator
- * provides useful information.</p>
- *
- * <p>The application must not attempt to read from the array
- * outside of the specified range.</p>
- *
- * <p>Note that some parsers will report whitespace using the
- * ignorableWhitespace() method rather than this one (validating
- * parsers must do so).</p>
- *
- * @param ch The characters from the XML document.
- * @param start The start position in the array.
- * @param length The number of characters to read from the array.
- * @throws org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see #ignorableWhitespace
- * @see org.xml.sax.Locator
- */
- public void cdata(char ch[], int start, int length)
- throws org.xml.sax.SAXException
- {
- try
- {
- writeNormalizedChars(ch, start, length, m_lineSepUse);
- if (m_tracer != null)
- super.fireCDATAEvent(ch, start, length);
- }
- catch(IOException ioe)
- {
- throw new SAXException(ioe);
- }
- }
-
- /**
- * Receive notification of ignorable whitespace in element content.
- *
- * <p>Validating Parsers must use this method to report each chunk
- * of ignorable whitespace (see the W3C XML 1.0 recommendation,
- * section 2.10): non-validating parsers may also use this method
- * if they are capable of parsing and using content models.</p>
- *
- * <p>SAX parsers may return all contiguous whitespace in a single
- * chunk, or they may split it into several chunks; however, all of
- * the characters in any single event must come from the same
- * external entity, so that the Locator provides useful
- * information.</p>
- *
- * <p>The application must not attempt to read from the array
- * outside of the specified range.</p>
- *
- * @param ch The characters from the XML document.
- * @param start The start position in the array.
- * @param length The number of characters to read from the array.
- * @throws org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see #characters
- *
- * @throws org.xml.sax.SAXException
- */
- public void ignorableWhitespace(char ch[], int start, int length)
- throws org.xml.sax.SAXException
- {
-
- try
- {
- writeNormalizedChars(ch, start, length, m_lineSepUse);
- }
- catch(IOException ioe)
- {
- throw new SAXException(ioe);
- }
- }
-
- /**
- * Receive notification of a processing instruction.
- *
- * <p>The Parser will invoke this method once for each processing
- * instruction found: note that processing instructions may occur
- * before or after the main document element.</p>
- *
- * <p>A SAX parser should never report an XML declaration (XML 1.0,
- * section 2.8) or a text declaration (XML 1.0, section 4.3.1)
- * using this method.</p>
- *
- * @param target The processing instruction target.
- * @param data The processing instruction data, or null if
- * none was supplied.
- * @throws org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- *
- * @throws org.xml.sax.SAXException
- */
- public void processingInstruction(String target, String data)
- throws org.xml.sax.SAXException
- {
- // flush anything pending first
- flushPending();
-
- if (m_tracer != null)
- super.fireEscapingEvent(target, data);
- }
-
- /**
- * Called when a Comment is to be constructed.
- * Note that Xalan will normally invoke the other version of this method.
- * %REVIEW% In fact, is this one ever needed, or was it a mistake?
- *
- * @param data The comment data.
- * @throws org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- */
- public void comment(String data) throws org.xml.sax.SAXException
- {
- final int length = data.length();
- if (length > m_charsBuff.length)
- {
- m_charsBuff = new char[length*2 + 1];
- }
- data.getChars(0, length, m_charsBuff, 0);
- comment(m_charsBuff, 0, length);
- }
-
- /**
- * Report an XML comment anywhere in the document.
- *
- * This callback will be used for comments inside or outside the
- * document element, including comments in the external DTD
- * subset (if read).
- *
- * @param ch An array holding the characters in the comment.
- * @param start The starting position in the array.
- * @param length The number of characters to use from the array.
- * @throws org.xml.sax.SAXException The application may raise an exception.
- */
- public void comment(char ch[], int start, int length)
- throws org.xml.sax.SAXException
- {
-
- flushPending();
- if (m_tracer != null)
- super.fireCommentEvent(ch, start, length);
- }
-
- /**
- * Receive notivication of a entityReference.
- *
- * @param name non-null reference to the name of the entity.
- *
- * @throws org.xml.sax.SAXException
- */
- public void entityReference(String name) throws org.xml.sax.SAXException
- {
- if (m_tracer != null)
- super.fireEntityReference(name);
- }
-
- /**
- * @see ExtendedContentHandler#addAttribute(String, String, String, String, String)
- */
- public void addAttribute(
- String uri,
- String localName,
- String rawName,
- String type,
- String value,
- boolean XSLAttribute)
- {
- // do nothing, just forget all about the attribute
- }
-
- /**
- * @see org.xml.sax.ext.LexicalHandler#endCDATA()
- */
- public void endCDATA() throws SAXException
- {
- // do nothing
- }
-
- /**
- * @see ExtendedContentHandler#endElement(String)
- */
- public void endElement(String elemName) throws SAXException
- {
- if (m_tracer != null)
- super.fireEndElem(elemName);
- }
-
- /**
- * From XSLTC
- */
- public void startElement(
- String elementNamespaceURI,
- String elementLocalName,
- String elementName)
- throws SAXException
- {
- if (m_needToCallStartDocument)
- startDocumentInternal();
- // time to fire off startlement event.
- if (m_tracer != null) {
- super.fireStartElem(elementName);
- this.firePseudoAttributes();
- }
-
- return;
- }
-
-
- /**
- * From XSLTC
- */
- public void characters(String characters)
- throws SAXException
- {
- final int length = characters.length();
- if (length > m_charsBuff.length)
- {
- m_charsBuff = new char[length*2 + 1];
- }
- characters.getChars(0, length, m_charsBuff, 0);
- characters(m_charsBuff, 0, length);
- }
-
-
- /**
- * From XSLTC
- */
- public void addAttribute(String name, String value)
- {
- // do nothing, forget about the attribute
- }
-
- /**
- * Add a unique attribute
- */
- public void addUniqueAttribute(String qName, String value, int flags)
- throws SAXException
- {
- // do nothing, forget about the attribute
- }
-
- public boolean startPrefixMapping(
- String prefix,
- String uri,
- boolean shouldFlush)
- throws SAXException
- {
- // no namespace support for HTML
- return false;
- }
-
-
- public void startPrefixMapping(String prefix, String uri)
- throws org.xml.sax.SAXException
- {
- // no namespace support for HTML
- }
-
-
- public void namespaceAfterStartElement(
- final String prefix,
- final String uri)
- throws SAXException
- {
- // no namespace support for HTML
- }
-
- public void flushPending() throws org.xml.sax.SAXException
- {
- if (m_needToCallStartDocument)
- {
- startDocumentInternal();
- m_needToCallStartDocument = false;
- }
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/ToUnknownStream.java b/src/com/sun/org/apache/xml/internal/serializer/ToUnknownStream.java
deleted file mode 100644
index f82e9c0..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/ToUnknownStream.java
+++ /dev/null
@@ -1,1338 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ToUnknownStream.java,v 1.3 2005/09/28 13:49:08 pvedula Exp $
- */
-package com.sun.org.apache.xml.internal.serializer;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.Writer;
-import java.util.Properties;
-import java.util.Vector;
-
-import javax.xml.transform.SourceLocator;
-import javax.xml.transform.Transformer;
-
-import org.w3c.dom.Node;
-import org.xml.sax.Attributes;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-
-/**
- *This class wraps another SerializationHandler. The wrapped object will either
- * handler XML or HTML, which is not known until a little later when the first XML
- * tag is seen. If the first tag is <html> then the wrapped object is an HTML
- * handler, otherwise it is an XML handler.
- *
- * This class effectively caches the first few calls to it then passes them
- * on to the wrapped handler (once it exists). After that subsequent calls a
- * simply passed directly to the wrapped handler.
- *
- * The user of this class doesn't know if the output is ultimatley XML or HTML.
- *
- * This class is not a public API, it is public because it is used within Xalan.
- * @xsl.usage internal
- */
-public final class ToUnknownStream extends SerializerBase
-{
-
- /**
- * The wrapped handler, initially XML but possibly switched to HTML
- */
- private SerializationHandler m_handler;
-
- /**
- * A String with no characters
- */
- private static final String EMPTYSTRING = "";
-
- /**
- * true if the underlying handler (XML or HTML) is fully initialized
- */
- private boolean m_wrapped_handler_not_initialized = false;
-
-
- /**
- * the prefix of the very first tag in the document
- */
- private String m_firstElementPrefix;
- /**
- * the element name (including any prefix) of the very first tag in the document
- */
- private String m_firstElementName;
-
- /**
- * the namespace URI associated with the first element
- */
- private String m_firstElementURI;
-
- /**
- * the local name (no prefix) associated with the first element
- */
- private String m_firstElementLocalName = null;
-
- /**
- * true if the first tag has been emitted to the wrapped handler
- */
- private boolean m_firstTagNotEmitted = true;
-
- /**
- * A collection of namespace URI's (only for first element).
- * _namespacePrefix has the matching prefix for these URI's
- */
- private Vector m_namespaceURI = null;
- /**
- * A collection of namespace Prefix (only for first element)
- * _namespaceURI has the matching URIs for these prefix'
- */
- private Vector m_namespacePrefix = null;
-
- /**
- * true if startDocument() was called before the underlying handler
- * was initialized
- */
- private boolean m_needToCallStartDocument = false;
- /**
- * true if setVersion() was called before the underlying handler
- * was initialized
- */
- private boolean m_setVersion_called = false;
- /**
- * true if setDoctypeSystem() was called before the underlying handler
- * was initialized
- */
- private boolean m_setDoctypeSystem_called = false;
- /**
- * true if setDoctypePublic() was called before the underlying handler
- * was initialized
- */
- private boolean m_setDoctypePublic_called = false;
- /**
- * true if setMediaType() was called before the underlying handler
- * was initialized
- */
- private boolean m_setMediaType_called = false;
-
- /**
- * Default constructor.
- * Initially this object wraps an XML Stream object, so _handler is never null.
- * That may change later to an HTML Stream object.
- */
- public ToUnknownStream()
- {
- m_handler = new ToXMLStream();
- }
-
- /**
- * @see Serializer#asContentHandler()
- * @return the wrapped XML or HTML handler
- */
- public ContentHandler asContentHandler() throws IOException
- {
- /* don't return the real handler ( m_handler ) because
- * that would expose the real handler to the outside.
- * Keep m_handler private so it can be internally swapped
- * to an HTML handler.
- */
- return this;
- }
-
- /**
- * @see SerializationHandler#close()
- */
- public void close()
- {
- m_handler.close();
- }
-
- /**
- * @see Serializer#getOutputFormat()
- * @return the properties of the underlying handler
- */
- public Properties getOutputFormat()
- {
- return m_handler.getOutputFormat();
- }
-
- /**
- * @see Serializer#getOutputStream()
- * @return the OutputStream of the underlying XML or HTML handler
- */
- public OutputStream getOutputStream()
- {
- return m_handler.getOutputStream();
- }
-
- /**
- * @see Serializer#getWriter()
- * @return the Writer of the underlying XML or HTML handler
- */
- public Writer getWriter()
- {
- return m_handler.getWriter();
- }
-
- /**
- * passes the call on to the underlying HTML or XML handler
- * @see Serializer#reset()
- * @return ???
- */
- public boolean reset()
- {
- return m_handler.reset();
- }
-
- /**
- * Converts the DOM node to output
- * @param node the DOM node to transform to output
- * @see DOMSerializer#serialize(Node)
- *
- */
- public void serialize(Node node) throws IOException
- {
- if (m_firstTagNotEmitted)
- {
- flush();
- }
- m_handler.serialize(node);
- }
-
- /**
- * @see SerializationHandler#setEscaping(boolean)
- */
- public boolean setEscaping(boolean escape) throws SAXException
- {
- return m_handler.setEscaping(escape);
- }
-
- /**
- * Set the properties of the handler
- * @param format the output properties to set
- * @see Serializer#setOutputFormat(Properties)
- */
- public void setOutputFormat(Properties format)
- {
- m_handler.setOutputFormat(format);
- }
-
- /**
- * Sets the output stream to write to
- * @param output the OutputStream to write to
- * @see Serializer#setOutputStream(OutputStream)
- */
- public void setOutputStream(OutputStream output)
- {
- m_handler.setOutputStream(output);
- }
-
- /**
- * Sets the writer to write to
- * @param writer the writer to write to
- * @see Serializer#setWriter(Writer)
- */
- public void setWriter(Writer writer)
- {
- m_handler.setWriter(writer);
- }
-
- /**
- * Adds an attribute to the currenly open tag
- * @param uri the URI of a namespace
- * @param localName the attribute name, without prefix
- * @param rawName the attribute name, with prefix (if any)
- * @param type the type of the attribute, typically "CDATA"
- * @param value the value of the parameter
- * @param XSLAttribute true if this attribute is coming from an xsl:attribute element
- * @see ExtendedContentHandler#addAttribute(String, String, String, String, String)
- */
- public void addAttribute(
- String uri,
- String localName,
- String rawName,
- String type,
- String value)
- throws SAXException
- {
- addAttribute(uri, localName, rawName, type, value, false);
- }
-
- /**
- * Adds an attribute to the currenly open tag
- * @param uri the URI of a namespace
- * @param localName the attribute name, without prefix
- * @param rawName the attribute name, with prefix (if any)
- * @param type the type of the attribute, typically "CDATA"
- * @param value the value of the parameter
- * @param XSLAttribute true if this attribute is coming from an xsl:attribute element
- * @see ExtendedContentHandler#addAttribute(String, String, String, String, String)
- */
- public void addAttribute(
- String uri,
- String localName,
- String rawName,
- String type,
- String value,
- boolean XSLAttribute)
- throws SAXException
- {
- if (m_firstTagNotEmitted)
- {
- flush();
- }
- m_handler.addAttribute(uri, localName, rawName, type, value, XSLAttribute);
- }
- /**
- * Adds an attribute to the currenly open tag
- * @param rawName the attribute name, with prefix (if any)
- * @param value the value of the parameter
- * @see ExtendedContentHandler#addAttribute(String, String)
- */
- public void addAttribute(String rawName, String value)
- {
- if (m_firstTagNotEmitted)
- {
- flush();
- }
- m_handler.addAttribute(rawName, value);
-
- }
-
- /**
- * Adds a unique attribute to the currenly open tag
- */
- public void addUniqueAttribute(String rawName, String value, int flags)
- throws SAXException
- {
- if (m_firstTagNotEmitted)
- {
- flush();
- }
- m_handler.addUniqueAttribute(rawName, value, flags);
-
- }
-
- /**
- * Converts the String to a character array and calls the SAX method
- * characters(char[],int,int);
- *
- * @see ExtendedContentHandler#characters(String)
- */
- public void characters(String chars) throws SAXException
- {
- final int length = chars.length();
- if (length > m_charsBuff.length)
- {
- m_charsBuff = new char[length*2 + 1];
- }
- chars.getChars(0, length, m_charsBuff, 0);
- this.characters(m_charsBuff, 0, length);
- }
-
- /**
- * Pass the call on to the underlying handler
- * @see ExtendedContentHandler#endElement(String)
- */
- public void endElement(String elementName) throws SAXException
- {
- if (m_firstTagNotEmitted)
- {
- flush();
- }
- m_handler.endElement(elementName);
- }
-
-
- /**
- * @see org.xml.sax.ContentHandler#startPrefixMapping(String, String)
- * @param prefix The prefix that maps to the URI
- * @param uri The URI for the namespace
- */
- public void startPrefixMapping(String prefix, String uri) throws SAXException
- {
- this.startPrefixMapping(prefix,uri, true);
- }
-
- /**
- * This method is used when a prefix/uri namespace mapping
- * is indicated after the element was started with a
- * startElement() and before and endElement().
- * startPrefixMapping(prefix,uri) would be used before the
- * startElement() call.
- * @param uri the URI of the namespace
- * @param prefix the prefix associated with the given URI.
- *
- * @see ExtendedContentHandler#namespaceAfterStartElement(String, String)
- */
- public void namespaceAfterStartElement(String prefix, String uri)
- throws SAXException
- {
- // hack for XSLTC with finding URI for default namespace
- if (m_firstTagNotEmitted && m_firstElementURI == null && m_firstElementName != null)
- {
- String prefix1 = getPrefixPart(m_firstElementName);
- if (prefix1 == null && EMPTYSTRING.equals(prefix))
- {
- // the elements URI is not known yet, and it
- // doesn't have a prefix, and we are currently
- // setting the uri for prefix "", so we have
- // the uri for the element... lets remember it
- m_firstElementURI = uri;
- }
- }
- startPrefixMapping(prefix,uri, false);
- }
-
- public boolean startPrefixMapping(String prefix, String uri, boolean shouldFlush)
- throws SAXException
- {
- boolean pushed = false;
- if (m_firstTagNotEmitted)
- {
- if (m_firstElementName != null && shouldFlush)
- {
- /* we've already seen a startElement, and this is a prefix mapping
- * for the up coming element, so flush the old element
- * then send this event on its way.
- */
- flush();
- pushed = m_handler.startPrefixMapping(prefix, uri, shouldFlush);
- }
- else
- {
- if (m_namespacePrefix == null)
- {
- m_namespacePrefix = new Vector();
- m_namespaceURI = new Vector();
- }
- m_namespacePrefix.addElement(prefix);
- m_namespaceURI.addElement(uri);
-
- if (m_firstElementURI == null)
- {
- if (prefix.equals(m_firstElementPrefix))
- m_firstElementURI = uri;
- }
- }
-
- }
- else
- {
- pushed = m_handler.startPrefixMapping(prefix, uri, shouldFlush);
- }
- return pushed;
- }
-
- /**
- * This method cannot be cached because default is different in
- * HTML and XML (we need more than a boolean).
- */
-
- public void setVersion(String version)
- {
- m_handler.setVersion(version);
-
- // Cache call to setVersion()
- // super.setVersion(version);
- m_setVersion_called = true;
- }
-
- /**
- * @see org.xml.sax.ContentHandler#startDocument()
- */
- public void startDocument() throws SAXException
- {
- m_needToCallStartDocument = true;
- }
-
-
-
- public void startElement(String qName) throws SAXException
- {
- this.startElement(null, null, qName, null);
- }
-
- public void startElement(String namespaceURI, String localName, String qName) throws SAXException
- {
- this.startElement(namespaceURI, localName, qName, null);
- }
-
- public void startElement(
- String namespaceURI,
- String localName,
- String elementName,
- Attributes atts) throws SAXException
- {
-
- if (m_needToCallSetDocumentInfo){
- super.setDocumentInfo();
- m_needToCallSetDocumentInfo = false;
- }
-
- /* we are notified of the start of an element */
- if (m_firstTagNotEmitted)
- {
- /* we have not yet sent the first element on its way */
- if (m_firstElementName != null)
- {
- /* this is not the first element, but a later one.
- * But we have the old element pending, so flush it out,
- * then send this one on its way.
- */
- flush();
- m_handler.startElement(namespaceURI, localName, elementName, atts);
- }
- else
- {
- /* this is the very first element that we have seen,
- * so save it for flushing later. We may yet get to know its
- * URI due to added attributes.
- */
-
- m_wrapped_handler_not_initialized = true;
- m_firstElementName = elementName;
-
- // null if not known
- m_firstElementPrefix = getPrefixPartUnknown(elementName);
-
- // null if not known
- m_firstElementURI = namespaceURI;
-
- // null if not known
- m_firstElementLocalName = localName;
-
- if (m_tracer != null)
- firePseudoElement(elementName);
-
- /* we don't want to call our own addAttributes, which
- * merely delegates to the wrapped handler, but we want to
- * add these attributes to m_attributes. So me must call super.
- * addAttributes() In this case m_attributes is only used for the
- * first element, after that this class totally delegates to the
- * wrapped handler which is either XML or HTML.
- */
- if (atts != null)
- super.addAttributes(atts);
-
- // if there are attributes, then lets make the flush()
- // call the startElement on the handler and send the
- // attributes on their way.
- if (atts != null)
- flush();
-
- }
- }
- else
- {
- // this is not the first element, but a later one, so just
- // send it on its way.
- m_handler.startElement(namespaceURI, localName, elementName, atts);
- }
- }
-
- /**
- * Pass the call on to the underlying handler
- * @see ExtendedLexicalHandler#comment(String)
- */
- public void comment(String comment) throws SAXException
- {
- if (m_firstTagNotEmitted && m_firstElementName != null)
- {
- emitFirstTag();
- }
- else if (m_needToCallStartDocument)
- {
- m_handler.startDocument();
- m_needToCallStartDocument = false;
- }
-
- m_handler.comment(comment);
- }
-
- /**
- * Pass the call on to the underlying handler
- * @see XSLOutputAttributes#getDoctypePublic()
- */
- public String getDoctypePublic()
- {
-
- return m_handler.getDoctypePublic();
- }
-
- /**
- * Pass the call on to the underlying handler
- * @see XSLOutputAttributes#getDoctypeSystem()
- */
- public String getDoctypeSystem()
- {
- return m_handler.getDoctypeSystem();
- }
-
- /**
- * Pass the call on to the underlying handler
- * @see XSLOutputAttributes#getEncoding()
- */
- public String getEncoding()
- {
- return m_handler.getEncoding();
- }
-
- /**
- * Pass the call on to the underlying handler
- * @see XSLOutputAttributes#getIndent()
- */
- public boolean getIndent()
- {
- return m_handler.getIndent();
- }
-
- /**
- * Pass the call on to the underlying handler
- * @see XSLOutputAttributes#getIndentAmount()
- */
- public int getIndentAmount()
- {
- return m_handler.getIndentAmount();
- }
-
- /**
- * Pass the call on to the underlying handler
- * @see XSLOutputAttributes#getMediaType()
- */
- public String getMediaType()
- {
- return m_handler.getMediaType();
- }
-
- /**
- * Pass the call on to the underlying handler
- * @see XSLOutputAttributes#getOmitXMLDeclaration()
- */
- public boolean getOmitXMLDeclaration()
- {
- return m_handler.getOmitXMLDeclaration();
- }
-
- /**
- * Pass the call on to the underlying handler
- * @see XSLOutputAttributes#getStandalone()
- */
- public String getStandalone()
- {
- return m_handler.getStandalone();
- }
-
- /**
- * Pass the call on to the underlying handler
- * @see XSLOutputAttributes#getVersion()
- */
- public String getVersion()
- {
- return m_handler.getVersion();
- }
-
- /**
- * @see XSLOutputAttributes#setDoctype(String, String)
- */
- public void setDoctype(String system, String pub)
- {
- m_handler.setDoctypePublic(pub);
- m_handler.setDoctypeSystem(system);
- }
-
- /**
- * Set the doctype in the underlying XML handler. Remember that this method
- * was called, just in case we need to transfer this doctype to an HTML handler
- * @param doctype the public doctype to set
- * @see XSLOutputAttributes#setDoctypePublic(String)
- */
- public void setDoctypePublic(String doctype)
- {
- m_handler.setDoctypePublic(doctype);
- m_setDoctypePublic_called = true;
- }
-
- /**
- * Set the doctype in the underlying XML handler. Remember that this method
- * was called, just in case we need to transfer this doctype to an HTML handler
- * @param doctype the system doctype to set
- * @see XSLOutputAttributes#setDoctypeSystem(String)
- */
- public void setDoctypeSystem(String doctype)
- {
- m_handler.setDoctypeSystem(doctype);
- m_setDoctypeSystem_called = true;
- }
-
- /**
- * Pass the call on to the underlying handler
- * @see XSLOutputAttributes#setEncoding(String)
- */
- public void setEncoding(String encoding)
- {
- m_handler.setEncoding(encoding);
- }
-
- /**
- * Pass the call on to the underlying handler
- * @see XSLOutputAttributes#setIndent(boolean)
- */
- public void setIndent(boolean indent)
- {
- m_handler.setIndent(indent);
- }
-
- /**
- * Pass the call on to the underlying handler
- */
- public void setIndentAmount(int value)
- {
- m_handler.setIndentAmount(value);
- }
-
- /**
- * @see XSLOutputAttributes#setMediaType(String)
- */
- public void setMediaType(String mediaType)
- {
- m_handler.setMediaType(mediaType);
- m_setMediaType_called = true;
- }
-
- /**
- * Pass the call on to the underlying handler
- * @see XSLOutputAttributes#setOmitXMLDeclaration(boolean)
- */
- public void setOmitXMLDeclaration(boolean b)
- {
- m_handler.setOmitXMLDeclaration(b);
- }
-
- /**
- * Pass the call on to the underlying handler
- * @see XSLOutputAttributes#setStandalone(String)
- */
- public void setStandalone(String standalone)
- {
- m_handler.setStandalone(standalone);
- }
-
- /**
- * @see XSLOutputAttributes#setVersion(String)
- */
-
- /**
- * Pass the call on to the underlying handler
- * @see org.xml.sax.ext.DeclHandler#attributeDecl(String, String, String, String, String)
- */
- public void attributeDecl(
- String arg0,
- String arg1,
- String arg2,
- String arg3,
- String arg4)
- throws SAXException
- {
- m_handler.attributeDecl(arg0, arg1, arg2, arg3, arg4);
- }
-
- /**
- * Pass the call on to the underlying handler
- * @see org.xml.sax.ext.DeclHandler#elementDecl(String, String)
- */
- public void elementDecl(String arg0, String arg1) throws SAXException
- {
- if (m_firstTagNotEmitted)
- {
- emitFirstTag();
- }
- m_handler.elementDecl(arg0, arg1);
- }
-
- /**
- * Pass the call on to the underlying handler
- * @see org.xml.sax.ext.DeclHandler#externalEntityDecl(String, String, String)
- */
- public void externalEntityDecl(
- String name,
- String publicId,
- String systemId)
- throws SAXException
- {
- if (m_firstTagNotEmitted)
- {
- flush();
- }
- m_handler.externalEntityDecl(name, publicId, systemId);
- }
-
- /**
- * Pass the call on to the underlying handler
- * @see org.xml.sax.ext.DeclHandler#internalEntityDecl(String, String)
- */
- public void internalEntityDecl(String arg0, String arg1)
- throws SAXException
- {
- if (m_firstTagNotEmitted)
- {
- flush();
- }
- m_handler.internalEntityDecl(arg0, arg1);
- }
-
- /**
- * Pass the call on to the underlying handler
- * @see org.xml.sax.ContentHandler#characters(char[], int, int)
- */
- public void characters(char[] characters, int offset, int length)
- throws SAXException
- {
- if (m_firstTagNotEmitted)
- {
- flush();
- }
-
- m_handler.characters(characters, offset, length);
-
- }
-
- /**
- * Pass the call on to the underlying handler
- * @see org.xml.sax.ContentHandler#endDocument()
- */
- public void endDocument() throws SAXException
- {
- if (m_firstTagNotEmitted)
- {
- flush();
- }
-
- m_handler.endDocument();
-
-
- }
-
- /**
- * Pass the call on to the underlying handler
- * @see org.xml.sax.ContentHandler#endElement(String, String, String)
- */
- public void endElement(String namespaceURI, String localName, String qName)
- throws SAXException
- {
- if (m_firstTagNotEmitted)
- {
- flush();
- if (namespaceURI == null && m_firstElementURI != null)
- namespaceURI = m_firstElementURI;
-
-
- if (localName == null && m_firstElementLocalName != null)
- localName = m_firstElementLocalName;
- }
-
- m_handler.endElement(namespaceURI, localName, qName);
- }
-
- /**
- * Pass the call on to the underlying handler
- * @see org.xml.sax.ContentHandler#endPrefixMapping(String)
- */
- public void endPrefixMapping(String prefix) throws SAXException
- {
- m_handler.endPrefixMapping(prefix);
- }
-
- /**
- * Pass the call on to the underlying handler
- * @see org.xml.sax.ContentHandler#ignorableWhitespace(char[], int, int)
- */
- public void ignorableWhitespace(char[] ch, int start, int length)
- throws SAXException
- {
- if (m_firstTagNotEmitted)
- {
- flush();
- }
- m_handler.ignorableWhitespace(ch, start, length);
- }
-
- /**
- * Pass the call on to the underlying handler
- * @see org.xml.sax.ContentHandler#processingInstruction(String, String)
- */
- public void processingInstruction(String target, String data)
- throws SAXException
- {
- if (m_firstTagNotEmitted)
- {
- flush();
- }
-
- m_handler.processingInstruction(target, data);
- }
-
- /**
- * Pass the call on to the underlying handler
- * @see org.xml.sax.ContentHandler#setDocumentLocator(Locator)
- */
- public void setDocumentLocator(Locator locator)
- {
- super.setDocumentLocator(locator);
- m_handler.setDocumentLocator(locator);
- }
-
- /**
- * Pass the call on to the underlying handler
- * @see org.xml.sax.ContentHandler#skippedEntity(String)
- */
- public void skippedEntity(String name) throws SAXException
- {
- m_handler.skippedEntity(name);
- }
-
-
-
- /**
- * Pass the call on to the underlying handler
- * @see org.xml.sax.ext.LexicalHandler#comment(char[], int, int)
- */
- public void comment(char[] ch, int start, int length) throws SAXException
- {
- if (m_firstTagNotEmitted)
- {
- flush();
- }
-
- m_handler.comment(ch, start, length);
- }
-
- /**
- * Pass the call on to the underlying handler
- * @see org.xml.sax.ext.LexicalHandler#endCDATA()
- */
- public void endCDATA() throws SAXException
- {
-
- m_handler.endCDATA();
- }
-
- /**
- * Pass the call on to the underlying handler
- * @see org.xml.sax.ext.LexicalHandler#endDTD()
- */
- public void endDTD() throws SAXException
- {
-
- m_handler.endDTD();
- }
-
- /**
- * Pass the call on to the underlying handler
- * @see org.xml.sax.ext.LexicalHandler#endEntity(String)
- */
- public void endEntity(String name) throws SAXException
- {
- if (m_firstTagNotEmitted)
- {
- emitFirstTag();
- }
- m_handler.endEntity(name);
- }
-
- /**
- * Pass the call on to the underlying handler
- * @see org.xml.sax.ext.LexicalHandler#startCDATA()
- */
- public void startCDATA() throws SAXException
- {
- m_handler.startCDATA();
- }
-
- /**
- * Pass the call on to the underlying handler
- * @see org.xml.sax.ext.LexicalHandler#startDTD(String, String, String)
- */
- public void startDTD(String name, String publicId, String systemId)
- throws SAXException
- {
- m_handler.startDTD(name, publicId, systemId);
- }
-
- /**
- * Pass the call on to the underlying handler
- * @see org.xml.sax.ext.LexicalHandler#startEntity(String)
- */
- public void startEntity(String name) throws SAXException
- {
- m_handler.startEntity(name);
- }
-
- /**
- * Initialize the wrapped output stream (XML or HTML).
- * If the stream handler should be HTML, then replace the XML handler with
- * an HTML handler. After than send the starting method calls that were cached
- * to the wrapped handler.
- *
- */
- private void initStreamOutput() throws SAXException
- {
-
- // Try to rule out if this is an not to be an HTML document based on prefix
- boolean firstElementIsHTML = isFirstElemHTML();
-
- if (firstElementIsHTML)
- {
- // create an HTML output handler, and initialize it
-
- // keep a reference to the old handler, ... it will soon be gone
- SerializationHandler oldHandler = m_handler;
-
- /* We have to make sure we get an output properties with the proper
- * defaults for the HTML method. The easiest way to do this is to
- * have the OutputProperties class do it.
- */
-
- Properties htmlProperties =
- OutputPropertiesFactory.getDefaultMethodProperties(Method.HTML);
- Serializer serializer =
- SerializerFactory.getSerializer(htmlProperties);
-
- // The factory should be returning a ToStream
- // Don't know what to do if it doesn't
- // i.e. the user has over-ridden the content-handler property
- // for html
- m_handler = (SerializationHandler) serializer;
- //m_handler = new ToHTMLStream();
-
- Writer writer = oldHandler.getWriter();
-
- if (null != writer)
- m_handler.setWriter(writer);
- else
- {
- OutputStream os = oldHandler.getOutputStream();
-
- if (null != os)
- m_handler.setOutputStream(os);
- }
-
- // need to copy things from the old handler to the new one here
-
- // if (_setVersion_called)
- // {
- m_handler.setVersion(oldHandler.getVersion());
- // }
- // if (_setDoctypeSystem_called)
- // {
- m_handler.setDoctypeSystem(oldHandler.getDoctypeSystem());
- // }
- // if (_setDoctypePublic_called)
- // {
- m_handler.setDoctypePublic(oldHandler.getDoctypePublic());
- // }
- // if (_setMediaType_called)
- // {
- m_handler.setMediaType(oldHandler.getMediaType());
- // }
-
- m_handler.setTransformer(oldHandler.getTransformer());
- }
-
- /* Now that we have a real wrapped handler (XML or HTML) lets
- * pass any cached calls to it
- */
- // Call startDocument() if necessary
- if (m_needToCallStartDocument)
- {
- m_handler.startDocument();
- m_needToCallStartDocument = false;
- }
-
- // the wrapped handler is now fully initialized
- m_wrapped_handler_not_initialized = false;
- }
-
- private void emitFirstTag() throws SAXException
- {
- if (m_firstElementName != null)
- {
- if (m_wrapped_handler_not_initialized)
- {
- initStreamOutput();
- m_wrapped_handler_not_initialized = false;
- }
- // Output first tag
- m_handler.startElement(m_firstElementURI, null, m_firstElementName, m_attributes);
- // don't need the collected attributes of the first element anymore.
- m_attributes = null;
-
- // Output namespaces of first tag
- if (m_namespacePrefix != null)
- {
- final int n = m_namespacePrefix.size();
- for (int i = 0; i < n; i++)
- {
- final String prefix =
- (String) m_namespacePrefix.elementAt(i);
- final String uri = (String) m_namespaceURI.elementAt(i);
- m_handler.startPrefixMapping(prefix, uri, false);
- }
- m_namespacePrefix = null;
- m_namespaceURI = null;
- }
- m_firstTagNotEmitted = false;
- }
- }
-
- /**
- * Utility function for calls to local-name().
- *
- * Don't want to override static function on SerializerBase
- * So added Unknown suffix to method name.
- */
- private String getLocalNameUnknown(String value)
- {
- int idx = value.lastIndexOf(':');
- if (idx >= 0)
- value = value.substring(idx + 1);
- idx = value.lastIndexOf('@');
- if (idx >= 0)
- value = value.substring(idx + 1);
- return (value);
- }
-
- /**
- * Utility function to return prefix
- *
- * Don't want to override static function on SerializerBase
- * So added Unknown suffix to method name.
- */
- private String getPrefixPartUnknown(String qname)
- {
- final int index = qname.indexOf(':');
- return (index > 0) ? qname.substring(0, index) : EMPTYSTRING;
- }
-
- /**
- * Determine if the firts element in the document is <html> or <HTML>
- * This uses the cached first element name, first element prefix and the
- * cached namespaces from previous method calls
- *
- * @return true if the first element is an opening <html> tag
- */
- private boolean isFirstElemHTML()
- {
- boolean isHTML;
-
- // is the first tag html, not considering the prefix ?
- isHTML =
- getLocalNameUnknown(m_firstElementName).equalsIgnoreCase("html");
-
- // Try to rule out if this is not to be an HTML document based on URI
- if (isHTML
- && m_firstElementURI != null
- && !EMPTYSTRING.equals(m_firstElementURI))
- {
- // the <html> element has a non-trivial namespace
- isHTML = false;
- }
- // Try to rule out if this is an not to be an HTML document based on prefix
- if (isHTML && m_namespacePrefix != null)
- {
- /* the first element has a name of "html", but lets check the prefix.
- * If the prefix points to a namespace with a URL that is not ""
- * then the doecument doesn't start with an <html> tag, and isn't html
- */
- final int max = m_namespacePrefix.size();
- for (int i = 0; i < max; i++)
- {
- final String prefix = (String) m_namespacePrefix.elementAt(i);
- final String uri = (String) m_namespaceURI.elementAt(i);
-
- if (m_firstElementPrefix != null
- && m_firstElementPrefix.equals(prefix)
- && !EMPTYSTRING.equals(uri))
- {
- // The first element has a prefix, so it can't be <html>
- isHTML = false;
- break;
- }
- }
-
- }
- return isHTML;
- }
- /**
- * @see Serializer#asDOMSerializer()
- */
- public DOMSerializer asDOMSerializer() throws IOException
- {
- return m_handler.asDOMSerializer();
- }
-
- /**
- * @param URI_and_localNames Vector a list of pairs of URI/localName
- * specified in the cdata-section-elements attribute.
- * @see SerializationHandler#setCdataSectionElements(java.util.Vector)
- */
- public void setCdataSectionElements(Vector URI_and_localNames)
- {
- m_handler.setCdataSectionElements(URI_and_localNames);
- }
- /**
- * @see ExtendedContentHandler#addAttributes(org.xml.sax.Attributes)
- */
- public void addAttributes(Attributes atts) throws SAXException
- {
- m_handler.addAttributes(atts);
- }
-
- /**
- * Get the current namespace mappings.
- * Simply returns the mappings of the wrapped handler.
- * @see ExtendedContentHandler#getNamespaceMappings()
- */
- public NamespaceMappings getNamespaceMappings()
- {
- NamespaceMappings mappings = null;
- if (m_handler != null)
- {
- mappings = m_handler.getNamespaceMappings();
- }
- return mappings;
- }
- /**
- * @see SerializationHandler#flushPending()
- */
- public void flushPending() throws SAXException
- {
-
- flush();
-
- m_handler.flushPending();
- }
-
- private void flush()
- {
- try
- {
- if (m_firstTagNotEmitted)
- {
- emitFirstTag();
- }
- if (m_needToCallStartDocument)
- {
- m_handler.startDocument();
- m_needToCallStartDocument = false;
- }
- }
- catch(SAXException e)
- {
- throw new RuntimeException(e.toString());
- }
-
-
- }
-
- /**
- * @see ExtendedContentHandler#getPrefix
- */
- public String getPrefix(String namespaceURI)
- {
- return m_handler.getPrefix(namespaceURI);
- }
- /**
- * @see ExtendedContentHandler#entityReference(java.lang.String)
- */
- public void entityReference(String entityName) throws SAXException
- {
- m_handler.entityReference(entityName);
- }
-
- /**
- * @see ExtendedContentHandler#getNamespaceURI(java.lang.String, boolean)
- */
- public String getNamespaceURI(String qname, boolean isElement)
- {
- return m_handler.getNamespaceURI(qname, isElement);
- }
-
- public String getNamespaceURIFromPrefix(String prefix)
- {
- return m_handler.getNamespaceURIFromPrefix(prefix);
- }
-
- public void setTransformer(Transformer t)
- {
- m_handler.setTransformer(t);
- if ((t instanceof SerializerTrace) &&
- (((SerializerTrace) t).hasTraceListeners())) {
- m_tracer = (SerializerTrace) t;
- } else {
- m_tracer = null;
- }
- }
- public Transformer getTransformer()
- {
- return m_handler.getTransformer();
- }
-
- /**
- * @see SerializationHandler#setContentHandler(org.xml.sax.ContentHandler)
- */
- public void setContentHandler(ContentHandler ch)
- {
- m_handler.setContentHandler(ch);
- }
- /**
- * This method is used to set the source locator, which might be used to
- * generated an error message.
- * @param locator the source locator
- *
- * @see ExtendedContentHandler#setSourceLocator(javax.xml.transform.SourceLocator)
- */
- public void setSourceLocator(SourceLocator locator)
- {
- m_handler.setSourceLocator(locator);
- }
-
- protected void firePseudoElement(String elementName)
- {
-
- if (m_tracer != null) {
- StringBuffer sb = new StringBuffer();
-
- sb.append('<');
- sb.append(elementName);
-
- // convert the StringBuffer to a char array and
- // emit the trace event that these characters "might"
- // be written
- char ch[] = sb.toString().toCharArray();
- m_tracer.fireGenerateEvent(
- SerializerTrace.EVENTTYPE_OUTPUT_PSEUDO_CHARACTERS,
- ch,
- 0,
- ch.length);
- }
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/ToXMLSAXHandler.java b/src/com/sun/org/apache/xml/internal/serializer/ToXMLSAXHandler.java
deleted file mode 100644
index 7b165e4..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/ToXMLSAXHandler.java
+++ /dev/null
@@ -1,778 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ToXMLSAXHandler.java,v 1.3 2005/09/28 13:49:08 pvedula Exp $
- */
- package com.sun.org.apache.xml.internal.serializer;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.Writer;
-import java.util.Properties;
-
-import javax.xml.transform.Result;
-
-import org.w3c.dom.Node;
-import org.xml.sax.Attributes;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-import org.xml.sax.ext.LexicalHandler;
-
-/**
- * This class receives notification of SAX-like events, and with gathered
- * information over these calls it will invoke the equivalent SAX methods
- * on a handler, the ultimate xsl:output method is known to be "xml".
- *
- * This class is not a public API, it is only public because it is used by Xalan.
- * @xsl.usage internal
- */
-public final class ToXMLSAXHandler extends ToSAXHandler
-{
-
- /**
- * Keeps track of whether output escaping is currently enabled
- */
- protected boolean m_escapeSetting = true;
-
- public ToXMLSAXHandler()
- {
- // default constructor (need to set content handler ASAP !)
- m_prefixMap = new NamespaceMappings();
- initCDATA();
- }
-
- /**
- * @see Serializer#getOutputFormat()
- */
- public Properties getOutputFormat()
- {
- return null;
- }
-
- /**
- * @see Serializer#getOutputStream()
- */
- public OutputStream getOutputStream()
- {
- return null;
- }
-
- /**
- * @see Serializer#getWriter()
- */
- public Writer getWriter()
- {
- return null;
- }
-
- /**
- * Do nothing for SAX.
- */
- public void indent(int n) throws SAXException
- {
- }
-
-
- /**
- * @see DOMSerializer#serialize(Node)
- */
- public void serialize(Node node) throws IOException
- {
- }
-
- /**
- * @see SerializationHandler#setEscaping(boolean)
- */
- public boolean setEscaping(boolean escape) throws SAXException
- {
- boolean oldEscapeSetting = m_escapeSetting;
- m_escapeSetting = escape;
-
- if (escape) {
- processingInstruction(Result.PI_ENABLE_OUTPUT_ESCAPING, "");
- } else {
- processingInstruction(Result.PI_DISABLE_OUTPUT_ESCAPING, "");
- }
-
- return oldEscapeSetting;
- }
-
- /**
- * @see Serializer#setOutputFormat(Properties)
- */
- public void setOutputFormat(Properties format)
- {
- }
-
- /**
- * @see Serializer#setOutputStream(OutputStream)
- */
- public void setOutputStream(OutputStream output)
- {
- }
-
- /**
- * @see Serializer#setWriter(Writer)
- */
- public void setWriter(Writer writer)
- {
- }
-
- /**
- * @see org.xml.sax.ext.DeclHandler#attributeDecl(String, String, String, String, String)
- */
- public void attributeDecl(
- String arg0,
- String arg1,
- String arg2,
- String arg3,
- String arg4)
- throws SAXException
- {
- }
-
- /**
- * @see org.xml.sax.ext.DeclHandler#elementDecl(String, String)
- */
- public void elementDecl(String arg0, String arg1) throws SAXException
- {
- }
-
- /**
- * @see org.xml.sax.ext.DeclHandler#externalEntityDecl(String, String, String)
- */
- public void externalEntityDecl(String arg0, String arg1, String arg2)
- throws SAXException
- {
- }
-
- /**
- * @see org.xml.sax.ext.DeclHandler#internalEntityDecl(String, String)
- */
- public void internalEntityDecl(String arg0, String arg1)
- throws SAXException
- {
- }
-
- /**
- * Receives notification of the end of the document.
- * @see org.xml.sax.ContentHandler#endDocument()
- */
- public void endDocument() throws SAXException
- {
-
- flushPending();
-
- // Close output document
- m_saxHandler.endDocument();
-
- if (m_tracer != null)
- super.fireEndDoc();
- }
-
- /**
- * This method is called when all the data needed for a call to the
- * SAX handler's startElement() method has been gathered.
- */
- protected void closeStartTag() throws SAXException
- {
-
- m_elemContext.m_startTagOpen = false;
-
- final String localName = getLocalName(m_elemContext.m_elementName);
- final String uri = getNamespaceURI(m_elemContext.m_elementName, true);
-
- // Now is time to send the startElement event
- if (m_needToCallStartDocument)
- {
- startDocumentInternal();
- }
- m_saxHandler.startElement(uri, localName, m_elemContext.m_elementName, m_attributes);
- // we've sent the official SAX attributes on their way,
- // now we don't need them anymore.
- m_attributes.clear();
-
- if(m_state != null)
- m_state.setCurrentNode(null);
- }
-
- /**
- * Closes ane open cdata tag, and
- * unlike the this.endCDATA() method (from the LexicalHandler) interface,
- * this "internal" method will send the endCDATA() call to the wrapped
- * handler.
- *
- */
- public void closeCDATA() throws SAXException
- {
-
- // Output closing bracket - "]]>"
- if (m_lexHandler != null && m_cdataTagOpen) {
- m_lexHandler.endCDATA();
- }
-
-
- // There are no longer any calls made to
- // m_lexHandler.startCDATA() without a balancing call to
- // m_lexHandler.endCDATA()
- // so we set m_cdataTagOpen to false to remember this.
- m_cdataTagOpen = false;
- }
-
- /**
- * @see org.xml.sax.ContentHandler#endElement(String, String, String)
- */
- public void endElement(String namespaceURI, String localName, String qName)
- throws SAXException
- {
- // Close any open elements etc.
- flushPending();
-
- if (namespaceURI == null)
- {
- if (m_elemContext.m_elementURI != null)
- namespaceURI = m_elemContext.m_elementURI;
- else
- namespaceURI = getNamespaceURI(qName, true);
- }
-
- if (localName == null)
- {
- if (m_elemContext.m_elementLocalName != null)
- localName = m_elemContext.m_elementLocalName;
- else
- localName = getLocalName(qName);
- }
-
- m_saxHandler.endElement(namespaceURI, localName, qName);
-
- if (m_tracer != null)
- super.fireEndElem(qName);
-
- /* Pop all namespaces at the current element depth.
- * We are not waiting for official endPrefixMapping() calls.
- */
- m_prefixMap.popNamespaces(m_elemContext.m_currentElemDepth,
- m_saxHandler);
- m_elemContext = m_elemContext.m_prev;
- }
-
- /**
- * @see org.xml.sax.ContentHandler#endPrefixMapping(String)
- */
- public void endPrefixMapping(String prefix) throws SAXException
- {
- /* poping all prefix mappings should have been done
- * in endElement() already
- */
- return;
- }
-
- /**
- * @see org.xml.sax.ContentHandler#ignorableWhitespace(char[], int, int)
- */
- public void ignorableWhitespace(char[] arg0, int arg1, int arg2)
- throws SAXException
- {
- m_saxHandler.ignorableWhitespace(arg0,arg1,arg2);
- }
-
- /**
- * @see org.xml.sax.ContentHandler#setDocumentLocator(Locator)
- */
- public void setDocumentLocator(Locator arg0)
- {
- super.setDocumentLocator(arg0);
- m_saxHandler.setDocumentLocator(arg0);
- }
-
- /**
- * @see org.xml.sax.ContentHandler#skippedEntity(String)
- */
- public void skippedEntity(String arg0) throws SAXException
- {
- m_saxHandler.skippedEntity(arg0);
- }
-
- /**
- * @see org.xml.sax.ContentHandler#startPrefixMapping(String, String)
- * @param prefix The prefix that maps to the URI
- * @param uri The URI for the namespace
- */
- public void startPrefixMapping(String prefix, String uri)
- throws SAXException
- {
- startPrefixMapping(prefix, uri, true);
- }
-
- /**
- * Remember the prefix/uri mapping at the current nested element depth.
- *
- * @see org.xml.sax.ContentHandler#startPrefixMapping(String, String)
- * @param prefix The prefix that maps to the URI
- * @param uri The URI for the namespace
- * @param shouldFlush a flag indicating if the mapping applies to the
- * current element or an up coming child (not used).
- */
-
- public boolean startPrefixMapping(
- String prefix,
- String uri,
- boolean shouldFlush)
- throws org.xml.sax.SAXException
- {
-
- /* Remember the mapping, and at what depth it was declared
- * This is one greater than the current depth because these
- * mappings will apply to the next depth. This is in
- * consideration that startElement() will soon be called
- */
-
- boolean pushed;
- int pushDepth;
- if (shouldFlush)
- {
- flushPending();
- // the prefix mapping applies to the child element (one deeper)
- pushDepth = m_elemContext.m_currentElemDepth + 1;
- }
- else
- {
- // the prefix mapping applies to the current element
- pushDepth = m_elemContext.m_currentElemDepth;
- }
- pushed = m_prefixMap.pushNamespace(prefix, uri, pushDepth);
-
- if (pushed)
- {
- m_saxHandler.startPrefixMapping(prefix,uri);
-
- if (getShouldOutputNSAttr())
- {
-
- /* Brian M.: don't know if we really needto do this. The
- * callers of this object should have injected both
- * startPrefixMapping and the attributes. We are
- * just covering our butt here.
- */
- String name;
- if (EMPTYSTRING.equals(prefix))
- {
- name = "xmlns";
- addAttributeAlways(XMLNS_URI, name, name,"CDATA",uri, false);
- }
- else
- {
- if (!EMPTYSTRING.equals(uri)) // hack for XSLTC attribset16 test
- { // that maps ns1 prefix to "" URI
- name = "xmlns:" + prefix;
-
- /* for something like xmlns:abc="w3.pretend.org"
- * the uri is the value, that is why we pass it in the
- * value, or 5th slot of addAttributeAlways()
- */
- addAttributeAlways(XMLNS_URI, prefix, name,"CDATA",uri, false );
- }
- }
- }
- }
- return pushed;
- }
-
-
- /**
- * @see org.xml.sax.ext.LexicalHandler#comment(char[], int, int)
- */
- public void comment(char[] arg0, int arg1, int arg2) throws SAXException
- {
- flushPending();
- if (m_lexHandler != null)
- m_lexHandler.comment(arg0, arg1, arg2);
-
- if (m_tracer != null)
- super.fireCommentEvent(arg0, arg1, arg2);
- }
-
- /**
- * @see org.xml.sax.ext.LexicalHandler#endCDATA()
- */
- public void endCDATA() throws SAXException
- {
- /* Normally we would do somthing with this but we ignore it.
- * The neccessary call to m_lexHandler.endCDATA() will be made
- * in flushPending().
- *
- * This is so that if we get calls like these:
- * this.startCDATA();
- * this.characters(chars1, off1, len1);
- * this.endCDATA();
- * this.startCDATA();
- * this.characters(chars2, off2, len2);
- * this.endCDATA();
- *
- * that we will only make these calls to the wrapped handlers:
- *
- * m_lexHandler.startCDATA();
- * m_saxHandler.characters(chars1, off1, len1);
- * m_saxHandler.characters(chars1, off2, len2);
- * m_lexHandler.endCDATA();
- *
- * We will merge adjacent CDATA blocks.
- */
- }
-
- /**
- * @see org.xml.sax.ext.LexicalHandler#endDTD()
- */
- public void endDTD() throws SAXException
- {
- if (m_lexHandler != null)
- m_lexHandler.endDTD();
- }
-
- /**
- * @see org.xml.sax.ext.LexicalHandler#startEntity(String)
- */
- public void startEntity(String arg0) throws SAXException
- {
- if (m_lexHandler != null)
- m_lexHandler.startEntity(arg0);
- }
-
- /**
- * @see ExtendedContentHandler#characters(String)
- */
- public void characters(String chars) throws SAXException
- {
- final int length = chars.length();
- if (length > m_charsBuff.length)
- {
- m_charsBuff = new char[length*2 + 1];
- }
- chars.getChars(0, length, m_charsBuff, 0);
- this.characters(m_charsBuff, 0, length);
- }
-
- /////////////////// from XSLTC //////////////
- public ToXMLSAXHandler(ContentHandler handler, String encoding)
- {
- super(handler, encoding);
-
- initCDATA();
- // initNamespaces();
- m_prefixMap = new NamespaceMappings();
- }
-
- public ToXMLSAXHandler(
- ContentHandler handler,
- LexicalHandler lex,
- String encoding)
- {
- super(handler, lex, encoding);
-
- initCDATA();
- // initNamespaces();
- m_prefixMap = new NamespaceMappings();
- }
-
- /**
- * Start an element in the output document. This might be an XML element
- * (<elem>data</elem> type) or a CDATA section.
- */
- public void startElement(
- String elementNamespaceURI,
- String elementLocalName,
- String elementName) throws SAXException
- {
- startElement(
- elementNamespaceURI,elementLocalName,elementName, null);
-
-
- }
- public void startElement(String elementName) throws SAXException
- {
- startElement(null, null, elementName, null);
- }
-
-
- public void characters(char[] ch, int off, int len) throws SAXException
- {
- // We do the first two things in flushPending() but we don't
- // close any open CDATA calls.
- if (m_needToCallStartDocument)
- {
- startDocumentInternal();
- m_needToCallStartDocument = false;
- }
-
- if (m_elemContext.m_startTagOpen)
- {
- closeStartTag();
- m_elemContext.m_startTagOpen = false;
- }
-
- if (m_elemContext.m_isCdataSection && !m_cdataTagOpen
- && m_lexHandler != null)
- {
- m_lexHandler.startCDATA();
- // We have made a call to m_lexHandler.startCDATA() with
- // no balancing call to m_lexHandler.endCDATA()
- // so we set m_cdataTagOpen true to remember this.
- m_cdataTagOpen = true;
- }
-
- /* If there are any occurances of "]]>" in the character data
- * let m_saxHandler worry about it, we've already warned them with
- * the previous call of m_lexHandler.startCDATA();
- */
- m_saxHandler.characters(ch, off, len);
-
- // time to generate characters event
- if (m_tracer != null)
- fireCharEvent(ch, off, len);
- }
-
-
- /**
- * @see ExtendedContentHandler#endElement(String)
- */
- public void endElement(String elemName) throws SAXException
- {
- endElement(null, null, elemName);
- }
-
-
- /**
- * Send a namespace declaration in the output document. The namespace
- * declaration will not be include if the namespace is already in scope
- * with the same prefix.
- */
- public void namespaceAfterStartElement(
- final String prefix,
- final String uri)
- throws SAXException
- {
- startPrefixMapping(prefix,uri,false);
- }
-
- /**
- *
- * @see org.xml.sax.ContentHandler#processingInstruction(String, String)
- * Send a processing instruction to the output document
- */
- public void processingInstruction(String target, String data)
- throws SAXException
- {
- flushPending();
-
- // Pass the processing instruction to the SAX handler
- m_saxHandler.processingInstruction(target, data);
-
- // we don't want to leave serializer to fire off this event,
- // so do it here.
- if (m_tracer != null)
- super.fireEscapingEvent(target, data);
- }
-
- /**
- * Undeclare the namespace that is currently pointed to by a given
- * prefix. Inform SAX handler if prefix was previously mapped.
- */
- protected boolean popNamespace(String prefix)
- {
- try
- {
- if (m_prefixMap.popNamespace(prefix))
- {
- m_saxHandler.endPrefixMapping(prefix);
- return true;
- }
- }
- catch (SAXException e)
- {
- // falls through
- }
- return false;
- }
-
- public void startCDATA() throws SAXException
- {
- /* m_cdataTagOpen can only be true here if we have ignored the
- * previous call to this.endCDATA() and the previous call
- * this.startCDATA() before that is still "open". In this way
- * we merge adjacent CDATA. If anything else happened after the
- * ignored call to this.endCDATA() and this call then a call to
- * flushPending() would have been made which would have
- * closed the CDATA and set m_cdataTagOpen to false.
- */
- if (!m_cdataTagOpen )
- {
- flushPending();
- if (m_lexHandler != null) {
- m_lexHandler.startCDATA();
-
- // We have made a call to m_lexHandler.startCDATA() with
- // no balancing call to m_lexHandler.endCDATA()
- // so we set m_cdataTagOpen true to remember this.
- m_cdataTagOpen = true;
- }
- }
- }
-
- /**
- * @see org.xml.sax.ContentHandler#startElement(String, String, String, Attributes)
- */
- public void startElement(
- String namespaceURI,
- String localName,
- String name,
- Attributes atts)
- throws SAXException
- {
- flushPending();
- super.startElement(namespaceURI, localName, name, atts);
-
- // Handle document type declaration (for first element only)
- if (m_needToOutputDocTypeDecl)
- {
- String doctypeSystem = getDoctypeSystem();
- if (doctypeSystem != null && m_lexHandler != null)
- {
- String doctypePublic = getDoctypePublic();
- if (doctypeSystem != null)
- m_lexHandler.startDTD(
- name,
- doctypePublic,
- doctypeSystem);
- }
- m_needToOutputDocTypeDecl = false;
- }
- m_elemContext = m_elemContext.push(namespaceURI, localName, name);
-
- // ensurePrefixIsDeclared depends on the current depth, so
- // the previous increment is necessary where it is.
- if (namespaceURI != null)
- ensurePrefixIsDeclared(namespaceURI, name);
-
- // add the attributes to the collected ones
- if (atts != null)
- addAttributes(atts);
-
-
- // do we really need this CDATA section state?
- m_elemContext.m_isCdataSection = isCdataSection();
-
- }
-
- private void ensurePrefixIsDeclared(String ns, String rawName)
- throws org.xml.sax.SAXException
- {
-
- if (ns != null && ns.length() > 0)
- {
- int index;
- final boolean no_prefix = ((index = rawName.indexOf(":")) < 0);
- String prefix = (no_prefix) ? "" : rawName.substring(0, index);
-
-
- if (null != prefix)
- {
- String foundURI = m_prefixMap.lookupNamespace(prefix);
-
- if ((null == foundURI) || !foundURI.equals(ns))
- {
- this.startPrefixMapping(prefix, ns, false);
-
- if (getShouldOutputNSAttr()) {
- // Bugzilla1133: Generate attribute as well as namespace event.
- // SAX does expect both.
- this.addAttributeAlways(
- "http://www.w3.org/2000/xmlns/",
- no_prefix ? "xmlns" : prefix, // local name
- no_prefix ? "xmlns" : ("xmlns:"+ prefix), // qname
- "CDATA",
- ns,
- false);
- }
- }
-
- }
- }
- }
- /**
- * Adds the given attribute to the set of attributes, and also makes sure
- * that the needed prefix/uri mapping is declared, but only if there is a
- * currently open element.
- *
- * @param uri the URI of the attribute
- * @param localName the local name of the attribute
- * @param rawName the qualified name of the attribute
- * @param type the type of the attribute (probably CDATA)
- * @param value the value of the attribute
- * @param XSLAttribute true if this attribute is coming from an xsl:attribute element
- * @see ExtendedContentHandler#addAttribute(String, String, String, String, String)
- */
- public void addAttribute(
- String uri,
- String localName,
- String rawName,
- String type,
- String value,
- boolean XSLAttribute)
- throws SAXException
- {
- if (m_elemContext.m_startTagOpen)
- {
- ensurePrefixIsDeclared(uri, rawName);
- addAttributeAlways(uri, localName, rawName, type, value, false);
- }
-
- }
-
- /**
- * Try's to reset the super class and reset this class for
- * re-use, so that you don't need to create a new serializer
- * (mostly for performance reasons).
- *
- * @return true if the class was successfuly reset.
- * @see Serializer#reset()
- */
- public boolean reset()
- {
- boolean wasReset = false;
- if (super.reset())
- {
- resetToXMLSAXHandler();
- wasReset = true;
- }
- return wasReset;
- }
-
- /**
- * Reset all of the fields owned by ToXMLSAXHandler class
- *
- */
- private void resetToXMLSAXHandler()
- {
- this.m_escapeSetting = true;
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/ToXMLStream.java b/src/com/sun/org/apache/xml/internal/serializer/ToXMLStream.java
deleted file mode 100644
index 00463bc..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/ToXMLStream.java
+++ /dev/null
@@ -1,656 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ToXMLStream.java,v 1.2.4.2 2005/09/15 12:01:25 suresh_emailid Exp $
- */
- package com.sun.org.apache.xml.internal.serializer;
-
-import java.io.IOException;
-
-import javax.xml.transform.ErrorListener;
-import javax.xml.transform.Result;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
-
-import com.sun.org.apache.xml.internal.serializer.utils.MsgKey;
-import com.sun.org.apache.xml.internal.serializer.utils.Utils;
-import org.xml.sax.SAXException;
-
-/**
- * This class converts SAX or SAX-like calls to a
- * serialized xml document. The xsl:output method is "xml".
- *
- * This class is used explicitly in code generated by XSLTC,
- * so it is "public", but it should
- * be viewed as internal or package private, this is not an API.
- *
- * @xsl.usage internal
- */
-public final class ToXMLStream extends ToStream
-{
-
- /**
- * remembers if we need to write out "]]>" to close the CDATA
- */
- boolean m_cdataTagOpen = false;
-
-
- /**
- * Map that tells which XML characters should have special treatment, and it
- * provides character to entity name lookup.
- */
- private static CharInfo m_xmlcharInfo =
-// new CharInfo(CharInfo.XML_ENTITIES_RESOURCE);
- CharInfo.getCharInfoInternal(CharInfo.XML_ENTITIES_RESOURCE, Method.XML);
-
- /**
- * Default constructor.
- */
- public ToXMLStream()
- {
- m_charInfo = m_xmlcharInfo;
-
- initCDATA();
- // initialize namespaces
- m_prefixMap = new NamespaceMappings();
-
- }
-
- /**
- * Copy properties from another SerializerToXML.
- *
- * @param xmlListener non-null reference to a SerializerToXML object.
- */
- public void CopyFrom(ToXMLStream xmlListener)
- {
-
- m_writer = xmlListener.m_writer;
-
-
- // m_outputStream = xmlListener.m_outputStream;
- String encoding = xmlListener.getEncoding();
- setEncoding(encoding);
-
- setOmitXMLDeclaration(xmlListener.getOmitXMLDeclaration());
-
- m_ispreserve = xmlListener.m_ispreserve;
- m_preserves = xmlListener.m_preserves;
- m_isprevtext = xmlListener.m_isprevtext;
- m_doIndent = xmlListener.m_doIndent;
- setIndentAmount(xmlListener.getIndentAmount());
- m_startNewLine = xmlListener.m_startNewLine;
- m_needToOutputDocTypeDecl = xmlListener.m_needToOutputDocTypeDecl;
- setDoctypeSystem(xmlListener.getDoctypeSystem());
- setDoctypePublic(xmlListener.getDoctypePublic());
- setStandalone(xmlListener.getStandalone());
- setMediaType(xmlListener.getMediaType());
- m_maxCharacter = xmlListener.m_maxCharacter;
- m_encodingInfo = xmlListener.m_encodingInfo;
- m_spaceBeforeClose = xmlListener.m_spaceBeforeClose;
- m_cdataStartCalled = xmlListener.m_cdataStartCalled;
-
- }
-
- /**
- * Receive notification of the beginning of a document.
- *
- * @throws org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- *
- * @throws org.xml.sax.SAXException
- */
- public void startDocumentInternal() throws org.xml.sax.SAXException
- {
-
- if (m_needToCallStartDocument)
- {
- super.startDocumentInternal();
- m_needToCallStartDocument = false;
-
- if (m_inEntityRef)
- return;
-
- m_needToOutputDocTypeDecl = true;
- m_startNewLine = false;
- /* The call to getXMLVersion() might emit an error message
- * and we should emit this message regardless of if we are
- * writing out an XML header or not.
- */
- if (getOmitXMLDeclaration() == false)
- {
- String encoding = Encodings.getMimeEncoding(getEncoding());
- String version = getVersion();
- if (version == null)
- version = "1.0";
- String standalone;
-
- if (m_standaloneWasSpecified)
- {
- standalone = " standalone=\"" + getStandalone() + "\"";
- }
- else
- {
- standalone = "";
- }
-
- try
- {
- final java.io.Writer writer = m_writer;
- writer.write("<?xml version=\"");
- writer.write(version);
- writer.write("\" encoding=\"");
- writer.write(encoding);
- writer.write('\"');
- writer.write(standalone);
- writer.write("?>");
- if (m_doIndent) {
- if (m_standaloneWasSpecified
- || getDoctypePublic() != null
- || getDoctypeSystem() != null
- || m_isStandalone) {
- // We almost never put a newline after the XML
- // header because this XML could be used as
- // an extenal general parsed entity
- // and we don't know the context into which it
- // will be used in the future. Only when
- // standalone, or a doctype system or public is
- // specified are we free to insert a new line
- // after the header. Is it even worth bothering
- // in these rare cases?
- writer.write(m_lineSep, 0, m_lineSepLen);
- }
- }
- }
- catch(IOException e)
- {
- throw new SAXException(e);
- }
-
- }
- }
- }
-
- /**
- * Receive notification of the end of a document.
- *
- * @throws org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- *
- * @throws org.xml.sax.SAXException
- */
- public void endDocument() throws org.xml.sax.SAXException
- {
- flushPending();
- if (m_doIndent && !m_isprevtext)
- {
- try
- {
- outputLineSep();
- }
- catch(IOException e)
- {
- throw new SAXException(e);
- }
- }
-
- flushWriter();
-
- if (m_tracer != null)
- super.fireEndDoc();
- }
-
- /**
- * Starts a whitespace preserving section. All characters printed
- * within a preserving section are printed without indentation and
- * without consolidating multiple spaces. This is equivalent to
- * the <tt>xml:space=&quot;preserve&quot;</tt> attribute. Only XML
- * and HTML serializers need to support this method.
- * <p>
- * The contents of the whitespace preserving section will be delivered
- * through the regular <tt>characters</tt> event.
- *
- * @throws org.xml.sax.SAXException
- */
- public void startPreserving() throws org.xml.sax.SAXException
- {
-
- // Not sure this is really what we want. -sb
- m_preserves.push(true);
-
- m_ispreserve = true;
- }
-
- /**
- * Ends a whitespace preserving section.
- *
- * @see #startPreserving
- *
- * @throws org.xml.sax.SAXException
- */
- public void endPreserving() throws org.xml.sax.SAXException
- {
-
- // Not sure this is really what we want. -sb
- m_ispreserve = m_preserves.isEmpty() ? false : m_preserves.pop();
- }
-
- /**
- * Receive notification of a processing instruction.
- *
- * @param target The processing instruction target.
- * @param data The processing instruction data, or null if
- * none was supplied.
- * @throws org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- *
- * @throws org.xml.sax.SAXException
- */
- public void processingInstruction(String target, String data)
- throws org.xml.sax.SAXException
- {
- if (m_inEntityRef)
- return;
-
- flushPending();
-
- if (target.equals(Result.PI_DISABLE_OUTPUT_ESCAPING))
- {
- startNonEscaping();
- }
- else if (target.equals(Result.PI_ENABLE_OUTPUT_ESCAPING))
- {
- endNonEscaping();
- }
- else
- {
- try
- {
- if (m_elemContext.m_startTagOpen)
- {
- closeStartTag();
- m_elemContext.m_startTagOpen = false;
- }
- else if (m_needToCallStartDocument)
- startDocumentInternal();
-
- if (shouldIndent())
- indent();
-
- final java.io.Writer writer = m_writer;
- writer.write("<?");
- writer.write(target);
-
- if (data.length() > 0
- && !Character.isSpaceChar(data.charAt(0)))
- writer.write(' ');
-
- int indexOfQLT = data.indexOf("?>");
-
- if (indexOfQLT >= 0)
- {
-
- // See XSLT spec on error recovery of "?>" in PIs.
- if (indexOfQLT > 0)
- {
- writer.write(data.substring(0, indexOfQLT));
- }
-
- writer.write("? >"); // add space between.
-
- if ((indexOfQLT + 2) < data.length())
- {
- writer.write(data.substring(indexOfQLT + 2));
- }
- }
- else
- {
- writer.write(data);
- }
-
- writer.write('?');
- writer.write('>');
-
- /**
- * Before Xalan 1497, a newline char was printed out if not inside of an
- * element. The whitespace is not significant is the output is standalone
- */
- if (m_elemContext.m_currentElemDepth <= 0 && m_isStandalone)
- writer.write(m_lineSep, 0, m_lineSepLen);
-
-
- /*
- * Don't write out any indentation whitespace now,
- * because there may be non-whitespace text after this.
- *
- * Simply mark that at this point if we do decide
- * to indent that we should
- * add a newline on the end of the current line before
- * the indentation at the start of the next line.
- */
- m_startNewLine = true;
- }
- catch(IOException e)
- {
- throw new SAXException(e);
- }
- }
-
- if (m_tracer != null)
- super.fireEscapingEvent(target, data);
- }
-
- /**
- * Receive notivication of a entityReference.
- *
- * @param name The name of the entity.
- *
- * @throws org.xml.sax.SAXException
- */
- public void entityReference(String name) throws org.xml.sax.SAXException
- {
- if (m_elemContext.m_startTagOpen)
- {
- closeStartTag();
- m_elemContext.m_startTagOpen = false;
- }
-
- try
- {
- if (shouldIndent())
- indent();
-
- final java.io.Writer writer = m_writer;
- writer.write('&');
- writer.write(name);
- writer.write(';');
- }
- catch(IOException e)
- {
- throw new SAXException(e);
- }
-
- if (m_tracer != null)
- super.fireEntityReference(name);
- }
-
- /**
- * This method is used to add an attribute to the currently open element.
- * The caller has guaranted that this attribute is unique, which means that it
- * not been seen before and will not be seen again.
- *
- * @param name the qualified name of the attribute
- * @param value the value of the attribute which can contain only
- * ASCII printable characters characters in the range 32 to 127 inclusive.
- * @param flags the bit values of this integer give optimization information.
- */
- public void addUniqueAttribute(String name, String value, int flags)
- throws SAXException
- {
- if (m_elemContext.m_startTagOpen)
- {
-
- try
- {
- final String patchedName = patchName(name);
- final java.io.Writer writer = m_writer;
- if ((flags & NO_BAD_CHARS) > 0 && m_xmlcharInfo.onlyQuotAmpLtGt)
- {
- // "flags" has indicated that the characters
- // '>' '<' '&' and '"' are not in the value and
- // m_htmlcharInfo has recorded that there are no other
- // entities in the range 32 to 127 so we write out the
- // value directly
-
- writer.write(' ');
- writer.write(patchedName);
- writer.write("=\"");
- writer.write(value);
- writer.write('"');
- }
- else
- {
- writer.write(' ');
- writer.write(patchedName);
- writer.write("=\"");
- writeAttrString(writer, value, this.getEncoding());
- writer.write('"');
- }
- } catch (IOException e) {
- throw new SAXException(e);
- }
- }
- }
-
- /**
- * Add an attribute to the current element.
- * @param uri the URI associated with the element name
- * @param localName local part of the attribute name
- * @param rawName prefix:localName
- * @param type
- * @param value the value of the attribute
- * @param xslAttribute true if this attribute is from an xsl:attribute,
- * false if declared within the elements opening tag.
- * @throws SAXException
- */
- public void addAttribute(
- String uri,
- String localName,
- String rawName,
- String type,
- String value,
- boolean xslAttribute)
- throws SAXException
- {
- if (m_elemContext.m_startTagOpen)
- {
- boolean was_added = addAttributeAlways(uri, localName, rawName, type, value, xslAttribute);
-
-
- /*
- * We don't run this block of code if:
- * 1. The attribute value was only replaced (was_added is false).
- * 2. The attribute is from an xsl:attribute element (that is handled
- * in the addAttributeAlways() call just above.
- * 3. The name starts with "xmlns", i.e. it is a namespace declaration.
- */
- if (was_added && !xslAttribute && !rawName.startsWith("xmlns"))
- {
- String prefixUsed =
- ensureAttributesNamespaceIsDeclared(
- uri,
- localName,
- rawName);
- if (prefixUsed != null
- && rawName != null
- && !rawName.startsWith(prefixUsed))
- {
- // use a different raw name, with the prefix used in the
- // generated namespace declaration
- rawName = prefixUsed + ":" + localName;
-
- }
- }
- addAttributeAlways(uri, localName, rawName, type, value, xslAttribute);
- }
- else
- {
- /*
- * The startTag is closed, yet we are adding an attribute?
- *
- * Section: 7.1.3 Creating Attributes Adding an attribute to an
- * element after a PI (for example) has been added to it is an
- * error. The attributes can be ignored. The spec doesn't explicitly
- * say this is disallowed, as it does for child elements, but it
- * makes sense to have the same treatment.
- *
- * We choose to ignore the attribute which is added too late.
- */
- // Generate a warning of the ignored attributes
-
- // Create the warning message
- String msg = Utils.messages.createMessage(
- MsgKey.ER_ILLEGAL_ATTRIBUTE_POSITION,new Object[]{ localName });
-
- try {
- // Prepare to issue the warning message
- Transformer tran = super.getTransformer();
- ErrorListener errHandler = tran.getErrorListener();
-
-
- // Issue the warning message
- if (null != errHandler && m_sourceLocator != null)
- errHandler.warning(new TransformerException(msg, m_sourceLocator));
- else
- System.out.println(msg);
- }
- catch (Exception e){}
- }
- }
-
- /**
- * @see ExtendedContentHandler#endElement(String)
- */
- public void endElement(String elemName) throws SAXException
- {
- endElement(null, null, elemName);
- }
-
- /**
- * This method is used to notify the serializer of a namespace mapping (or node)
- * that applies to the current element whose startElement() call has already been seen.
- * The official SAX startPrefixMapping(prefix,uri) is to define a mapping for a child
- * element that is soon to be seen with a startElement() call. The official SAX call
- * does not apply to the current element, hence the reason for this method.
- */
- public void namespaceAfterStartElement(
- final String prefix,
- final String uri)
- throws SAXException
- {
-
- // hack for XSLTC with finding URI for default namespace
- if (m_elemContext.m_elementURI == null)
- {
- String prefix1 = getPrefixPart(m_elemContext.m_elementName);
- if (prefix1 == null && EMPTYSTRING.equals(prefix))
- {
- // the elements URI is not known yet, and it
- // doesn't have a prefix, and we are currently
- // setting the uri for prefix "", so we have
- // the uri for the element... lets remember it
- m_elemContext.m_elementURI = uri;
- }
- }
- startPrefixMapping(prefix,uri,false);
- return;
-
- }
-
- /**
- * From XSLTC
- * Declare a prefix to point to a namespace URI. Inform SAX handler
- * if this is a new prefix mapping.
- */
- protected boolean pushNamespace(String prefix, String uri)
- {
- try
- {
- if (m_prefixMap.pushNamespace(
- prefix, uri, m_elemContext.m_currentElemDepth))
- {
- startPrefixMapping(prefix, uri);
- return true;
- }
- }
- catch (SAXException e)
- {
- // falls through
- }
- return false;
- }
- /**
- * Try's to reset the super class and reset this class for
- * re-use, so that you don't need to create a new serializer
- * (mostly for performance reasons).
- *
- * @return true if the class was successfuly reset.
- */
- public boolean reset()
- {
- boolean wasReset = false;
- if (super.reset())
- {
- resetToXMLStream();
- wasReset = true;
- }
- return wasReset;
- }
-
- /**
- * Reset all of the fields owned by ToStream class
- *
- */
- private void resetToXMLStream()
- {
- this.m_cdataTagOpen = false;
-
- }
-
- /**
- * This method checks for the XML version of output document.
- * If XML version of output document is not specified, then output
- * document is of version XML 1.0.
- * If XML version of output doucment is specified, but it is not either
- * XML 1.0 or XML 1.1, a warning message is generated, the XML Version of
- * output document is set to XML 1.0 and processing continues.
- * @return string (XML version)
- */
- private String getXMLVersion()
- {
- String xmlVersion = getVersion();
- if(xmlVersion == null || xmlVersion.equals(XMLVERSION10))
- {
- xmlVersion = XMLVERSION10;
- }
- else if(xmlVersion.equals(XMLVERSION11))
- {
- xmlVersion = XMLVERSION11;
- }
- else
- {
- String msg = Utils.messages.createMessage(
- MsgKey.ER_XML_VERSION_NOT_SUPPORTED,new Object[]{ xmlVersion });
- try
- {
- // Prepare to issue the warning message
- Transformer tran = super.getTransformer();
- ErrorListener errHandler = tran.getErrorListener();
- // Issue the warning message
- if (null != errHandler && m_sourceLocator != null)
- errHandler.warning(new TransformerException(msg, m_sourceLocator));
- else
- System.out.println(msg);
- }
- catch (Exception e){}
- xmlVersion = XMLVERSION10;
- }
- return xmlVersion;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/TransformStateSetter.java b/src/com/sun/org/apache/xml/internal/serializer/TransformStateSetter.java
deleted file mode 100644
index cb8d4e5..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/TransformStateSetter.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: TransformStateSetter.java,v 1.2.4.1 2005/09/15 08:15:29 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.serializer;
-
-import javax.xml.transform.Transformer;
-
-import org.w3c.dom.Node;
-/**
- * This interface is meant to be used by a base interface to
- * TransformState, but which as only the setters which have non Xalan
- * specific types in their signature, so that there are no dependancies
- * of the serializer on Xalan.
- *
- * This interface is not a public API, it is only public because it is
- * used by Xalan.
- *
- * @see com.sun.org.apache.xalan.internal.transformer.TransformState
- * @xsl.usage internal
- */
-public interface TransformStateSetter
-{
-
-
- /**
- * Set the current node.
- *
- * @param n The current node.
- */
- void setCurrentNode(Node n);
-
- /**
- * Reset the state on the given transformer object.
- *
- * @param transformer
- */
- void resetState(Transformer transformer);
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/TreeWalker.java b/src/com/sun/org/apache/xml/internal/serializer/TreeWalker.java
deleted file mode 100644
index 37f6c7a..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/TreeWalker.java
+++ /dev/null
@@ -1,510 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xml.internal.serializer;
-
-import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
-import java.io.File;
-
-import com.sun.org.apache.xml.internal.serializer.utils.AttList;
-import com.sun.org.apache.xml.internal.serializer.utils.DOM2Helper;
-import org.w3c.dom.Comment;
-import org.w3c.dom.Element;
-import org.w3c.dom.EntityReference;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.ProcessingInstruction;
-import org.w3c.dom.Text;
-
-import org.xml.sax.ContentHandler;
-import org.xml.sax.Locator;
-import org.xml.sax.ext.LexicalHandler;
-import org.xml.sax.helpers.LocatorImpl;
-
-/**
- * This class does a pre-order walk of the DOM tree, calling a ContentHandler
- * interface as it goes.
- *
- * This class is a copy of the one in com.sun.org.apache.xml.internal.utils.
- * It exists to cut the serializers dependancy on that package.
- *
- * @xsl.usage internal
- */
-
-public final class TreeWalker
-{
-
- /** Local reference to a ContentHandler */
- final private ContentHandler m_contentHandler;
- /**
- * If m_contentHandler is a SerializationHandler, then this is
- * a reference to the same object.
- */
- final private SerializationHandler m_Serializer;
-
- // ARGHH!! JAXP Uses Xerces without setting the namespace processing to ON!
- // DOM2Helper m_dh = new DOM2Helper();
-
- /** DomHelper for this TreeWalker */
- final protected DOM2Helper m_dh;
-
- /** Locator object for this TreeWalker */
- final private LocatorImpl m_locator = new LocatorImpl();
-
- /**
- * Get the ContentHandler used for the tree walk.
- *
- * @return the ContentHandler used for the tree walk
- */
- public ContentHandler getContentHandler()
- {
- return m_contentHandler;
- }
-
- public TreeWalker(ContentHandler ch) {
- this(ch,null);
- }
- /**
- * Constructor.
- * @param contentHandler The implemention of the
- * contentHandler operation (toXMLString, digest, ...)
- */
- public TreeWalker(ContentHandler contentHandler, String systemId)
- {
- // Set the content handler
- m_contentHandler = contentHandler;
- if (m_contentHandler instanceof SerializationHandler) {
- m_Serializer = (SerializationHandler) m_contentHandler;
- } else {
- m_Serializer = null;
- }
-
- // Set the system ID, if it is given
- m_contentHandler.setDocumentLocator(m_locator);
- if (systemId != null) {
- m_locator.setSystemId(systemId);
- }
-
- m_dh = new DOM2Helper();
- }
-
- /**
- * Perform a pre-order traversal non-recursive style.
- *
- * Note that TreeWalker assumes that the subtree is intended to represent
- * a complete (though not necessarily well-formed) document and, during a
- * traversal, startDocument and endDocument will always be issued to the
- * SAX listener.
- *
- * @param pos Node in the tree where to start traversal
- *
- * @throws TransformerException
- */
- public void traverse(Node pos) throws org.xml.sax.SAXException
- {
-
- this.m_contentHandler.startDocument();
-
- Node top = pos;
-
- while (null != pos)
- {
- startNode(pos);
-
- Node nextNode = pos.getFirstChild();
-
- while (null == nextNode)
- {
- endNode(pos);
-
- if (top.equals(pos))
- break;
-
- nextNode = pos.getNextSibling();
-
- if (null == nextNode)
- {
- pos = pos.getParentNode();
-
- if ((null == pos) || (top.equals(pos)))
- {
- if (null != pos)
- endNode(pos);
-
- nextNode = null;
-
- break;
- }
- }
- }
-
- pos = nextNode;
- }
- this.m_contentHandler.endDocument();
- }
-
- /**
- * Perform a pre-order traversal non-recursive style.
-
- * Note that TreeWalker assumes that the subtree is intended to represent
- * a complete (though not necessarily well-formed) document and, during a
- * traversal, startDocument and endDocument will always be issued to the
- * SAX listener.
- *
- * @param pos Node in the tree where to start traversal
- * @param top Node in the tree where to end traversal
- *
- * @throws TransformerException
- */
- public void traverse(Node pos, Node top) throws org.xml.sax.SAXException
- {
-
- this.m_contentHandler.startDocument();
-
- while (null != pos)
- {
- startNode(pos);
-
- Node nextNode = pos.getFirstChild();
-
- while (null == nextNode)
- {
- endNode(pos);
-
- if ((null != top) && top.equals(pos))
- break;
-
- nextNode = pos.getNextSibling();
-
- if (null == nextNode)
- {
- pos = pos.getParentNode();
-
- if ((null == pos) || ((null != top) && top.equals(pos)))
- {
- nextNode = null;
-
- break;
- }
- }
- }
-
- pos = nextNode;
- }
- this.m_contentHandler.endDocument();
- }
-
- /** Flag indicating whether following text to be processed is raw text */
- boolean nextIsRaw = false;
-
- /**
- * Optimized dispatch of characters.
- */
- private final void dispatachChars(Node node)
- throws org.xml.sax.SAXException
- {
- if(m_Serializer != null)
- {
- this.m_Serializer.characters(node);
- }
- else
- {
- String data = ((Text) node).getData();
- this.m_contentHandler.characters(data.toCharArray(), 0, data.length());
- }
- }
-
- /**
- * Start processing given node
- *
- *
- * @param node Node to process
- *
- * @throws org.xml.sax.SAXException
- */
- protected void startNode(Node node) throws org.xml.sax.SAXException
- {
-
-// TODO: <REVIEW>
-// A Serializer implements ContentHandler, but not NodeConsumer
-// so drop this reference to NodeConsumer which would otherwise
-// pull in all sorts of things
-// if (m_contentHandler instanceof NodeConsumer)
-// {
-// ((NodeConsumer) m_contentHandler).setOriginatingNode(node);
-// }
-// TODO: </REVIEW>
-
- if (node instanceof Locator)
- {
- Locator loc = (Locator)node;
- m_locator.setColumnNumber(loc.getColumnNumber());
- m_locator.setLineNumber(loc.getLineNumber());
- m_locator.setPublicId(loc.getPublicId());
- m_locator.setSystemId(loc.getSystemId());
- }
- else
- {
- m_locator.setColumnNumber(0);
- m_locator.setLineNumber(0);
- }
-
- switch (node.getNodeType())
- {
- case Node.COMMENT_NODE :
- {
- String data = ((Comment) node).getData();
-
- if (m_contentHandler instanceof LexicalHandler)
- {
- LexicalHandler lh = ((LexicalHandler) this.m_contentHandler);
-
- lh.comment(data.toCharArray(), 0, data.length());
- }
- }
- break;
- case Node.DOCUMENT_FRAGMENT_NODE :
-
- // ??;
- break;
- case Node.DOCUMENT_NODE :
-
- break;
- case Node.ELEMENT_NODE :
- Element elem_node = (Element) node;
- {
- // Make sure the namespace node
- // for the element itself is declared
- // to the ContentHandler
- String uri = elem_node.getNamespaceURI();
- if (uri != null) {
- String prefix = elem_node.getPrefix();
- if (prefix==null)
- prefix="";
- this.m_contentHandler.startPrefixMapping(prefix,uri);
- }
- }
- NamedNodeMap atts = elem_node.getAttributes();
- int nAttrs = atts.getLength();
- // System.out.println("TreeWalker#startNode: "+node.getNodeName());
-
-
- // Make sure the namespace node of
- // each attribute is declared to the ContentHandler
- for (int i = 0; i < nAttrs; i++)
- {
- final Node attr = atts.item(i);
- final String attrName = attr.getNodeName();
- final int colon = attrName.indexOf(':');
- final String prefix;
-
- // System.out.println("TreeWalker#startNode: attr["+i+"] = "+attrName+", "+attr.getNodeValue());
- if (attrName.equals("xmlns") || attrName.startsWith("xmlns:"))
- {
- // Use "" instead of null, as Xerces likes "" for the
- // name of the default namespace. Fix attributed
- // to "Steven Murray" <smurray@ebt.com>.
- if (colon < 0)
- prefix = "";
- else
- prefix = attrName.substring(colon + 1);
-
- this.m_contentHandler.startPrefixMapping(prefix,
- attr.getNodeValue());
- }
- else if (colon > 0) {
- prefix = attrName.substring(0,colon);
- String uri = attr.getNamespaceURI();
- if (uri != null)
- this.m_contentHandler.startPrefixMapping(prefix,uri);
- }
- }
-
- String ns = m_dh.getNamespaceOfNode(node);
- if(null == ns)
- ns = "";
- this.m_contentHandler.startElement(ns,
- m_dh.getLocalNameOfNode(node),
- node.getNodeName(),
- new AttList(atts, m_dh));
- break;
- case Node.PROCESSING_INSTRUCTION_NODE :
- {
- ProcessingInstruction pi = (ProcessingInstruction) node;
- String name = pi.getNodeName();
-
- // String data = pi.getData();
- if (name.equals("xslt-next-is-raw"))
- {
- nextIsRaw = true;
- }
- else
- {
- this.m_contentHandler.processingInstruction(pi.getNodeName(),
- pi.getData());
- }
- }
- break;
- case Node.CDATA_SECTION_NODE :
- {
- boolean isLexH = (m_contentHandler instanceof LexicalHandler);
- LexicalHandler lh = isLexH
- ? ((LexicalHandler) this.m_contentHandler) : null;
-
- if (isLexH)
- {
- lh.startCDATA();
- }
-
- dispatachChars(node);
-
- {
- if (isLexH)
- {
- lh.endCDATA();
- }
- }
- }
- break;
- case Node.TEXT_NODE :
- {
- //String data = ((Text) node).getData();
-
- if (nextIsRaw)
- {
- nextIsRaw = false;
-
- m_contentHandler.processingInstruction(javax.xml.transform.Result.PI_DISABLE_OUTPUT_ESCAPING, "");
- dispatachChars(node);
- m_contentHandler.processingInstruction(javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING, "");
- }
- else
- {
- dispatachChars(node);
- }
- }
- break;
- case Node.ENTITY_REFERENCE_NODE :
- {
- EntityReference eref = (EntityReference) node;
-
- if (m_contentHandler instanceof LexicalHandler)
- {
- ((LexicalHandler) this.m_contentHandler).startEntity(
- eref.getNodeName());
- }
- else
- {
-
- // warning("Can not output entity to a pure SAX ContentHandler");
- }
- }
- break;
- default :
- }
- }
-
- /**
- * End processing of given node
- *
- *
- * @param node Node we just finished processing
- *
- * @throws org.xml.sax.SAXException
- */
- protected void endNode(Node node) throws org.xml.sax.SAXException
- {
-
- switch (node.getNodeType())
- {
- case Node.DOCUMENT_NODE :
- break;
-
- case Node.ELEMENT_NODE :
- String ns = m_dh.getNamespaceOfNode(node);
- if(null == ns)
- ns = "";
- this.m_contentHandler.endElement(ns,
- m_dh.getLocalNameOfNode(node),
- node.getNodeName());
-
- if (m_Serializer == null) {
- // Don't bother with endPrefixMapping calls if the ContentHandler is a
- // SerializationHandler because SerializationHandler's ignore the
- // endPrefixMapping() calls anyways. . . . This is an optimization.
- Element elem_node = (Element) node;
- NamedNodeMap atts = elem_node.getAttributes();
- int nAttrs = atts.getLength();
-
- // do the endPrefixMapping calls in reverse order
- // of the startPrefixMapping calls
- for (int i = (nAttrs-1); 0 <= i; i--)
- {
- final Node attr = atts.item(i);
- final String attrName = attr.getNodeName();
- final int colon = attrName.indexOf(':');
- final String prefix;
-
- if (attrName.equals("xmlns") || attrName.startsWith("xmlns:"))
- {
- // Use "" instead of null, as Xerces likes "" for the
- // name of the default namespace. Fix attributed
- // to "Steven Murray" <smurray@ebt.com>.
- if (colon < 0)
- prefix = "";
- else
- prefix = attrName.substring(colon + 1);
-
- this.m_contentHandler.endPrefixMapping(prefix);
- }
- else if (colon > 0) {
- prefix = attrName.substring(0, colon);
- this.m_contentHandler.endPrefixMapping(prefix);
- }
- }
- {
- String uri = elem_node.getNamespaceURI();
- if (uri != null) {
- String prefix = elem_node.getPrefix();
- if (prefix==null)
- prefix="";
- this.m_contentHandler.endPrefixMapping(prefix);
- }
- }
- }
- break;
- case Node.CDATA_SECTION_NODE :
- break;
- case Node.ENTITY_REFERENCE_NODE :
- {
- EntityReference eref = (EntityReference) node;
-
- if (m_contentHandler instanceof LexicalHandler)
- {
- LexicalHandler lh = ((LexicalHandler) this.m_contentHandler);
-
- lh.endEntity(eref.getNodeName());
- }
- }
- break;
- default :
- }
- }
-} //TreeWalker
diff --git a/src/com/sun/org/apache/xml/internal/serializer/Version.java b/src/com/sun/org/apache/xml/internal/serializer/Version.java
deleted file mode 100644
index dfdde0c..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/Version.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Version.java,v 1.2 2005/09/28 13:49:09 pvedula Exp $
- */
-package com.sun.org.apache.xml.internal.serializer;
-
-/**
- * Administrative class to keep track of the version number of
- * the Serializer release.
- * <P>This class implements the upcoming standard of having
- * org.apache.project-name.Version.getVersion() be a standard way
- * to get version information.</P>
- * @xsl.usage general
- */
-public final class Version
-{
-
- /**
- * Get the basic version string for the current Serializer.
- * Version String formatted like
- * <CODE>"<B>Serializer</B> <B>Java</B> v.r[.dd| <B>D</B>nn]"</CODE>.
- *
- * Futurework: have this read version info from jar manifest.
- *
- * @return String denoting our current version
- */
- public static String getVersion()
- {
- return getProduct()+" "+getImplementationLanguage()+" "
- +getMajorVersionNum()+"."+getReleaseVersionNum()+"."
- +( (getDevelopmentVersionNum() > 0) ?
- ("D"+getDevelopmentVersionNum()) : (""+getMaintenanceVersionNum()));
- }
-
- /**
- * Print the processor version to the command line.
- *
- * @param argv command line arguments, unused.
- */
- public static void _main(String argv[])
- {
- System.out.println(getVersion());
- }
-
- /**
- * Name of product: Serializer.
- */
- public static String getProduct()
- {
- return "Serializer";
- }
-
- /**
- * Implementation Language: Java.
- */
- public static String getImplementationLanguage()
- {
- return "Java";
- }
-
-
- /**
- * Major version number.
- * Version number. This changes only when there is a
- * significant, externally apparent enhancement from
- * the previous release. 'n' represents the n'th
- * version.
- *
- * Clients should carefully consider the implications
- * of new versions as external interfaces and behaviour
- * may have changed.
- */
- public static int getMajorVersionNum()
- {
- return 2;
-
- }
-
- /**
- * Release Number.
- * Release number. This changes when:
- * - a new set of functionality is to be added, eg,
- * implementation of a new W3C specification.
- * - API or behaviour change.
- * - its designated as a reference release.
- */
- public static int getReleaseVersionNum()
- {
- return 7;
- }
-
- /**
- * Maintenance Drop Number.
- * Optional identifier used to designate maintenance
- * drop applied to a specific release and contains
- * fixes for defects reported. It maintains compatibility
- * with the release and contains no API changes.
- * When missing, it designates the final and complete
- * development drop for a release.
- */
- public static int getMaintenanceVersionNum()
- {
- return 0;
- }
-
- /**
- * Development Drop Number.
- * Optional identifier designates development drop of
- * a specific release. D01 is the first development drop
- * of a new release.
- *
- * Development drops are works in progress towards a
- * compeleted, final release. A specific development drop
- * may not completely implement all aspects of a new
- * feature, which may take several development drops to
- * complete. At the point of the final drop for the
- * release, the D suffix will be omitted.
- *
- * Each 'D' drops can contain functional enhancements as
- * well as defect fixes. 'D' drops may not be as stable as
- * the final releases.
- */
- public static int getDevelopmentVersionNum()
- {
- try {
- if ((new String("")).length() == 0)
- return 0;
- else
- return Integer.parseInt("");
- } catch (NumberFormatException nfe) {
- return 0;
- }
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/WriterChain.java b/src/com/sun/org/apache/xml/internal/serializer/WriterChain.java
deleted file mode 100644
index bf5d466..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/WriterChain.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: WriterChain.java,v 1.1.4.1 2005/09/08 10:58:44 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.serializer;
-
-import java.io.IOException;
-
-/**
- * It is unfortunate that java.io.Writer is a class rather than an interface.
- * The serializer has a number of classes that extend java.io.Writer
- * and which send their ouput to a yet another wrapped Writer or OutputStream.
- *
- * The purpose of this interface is to force such classes to over-ride all of
- * the important methods defined on the java.io.Writer class, namely these:
- * <code>
- * write(int val)
- * write(char[] chars)
- * write(char[] chars, int start, int count)
- * write(String chars)
- * write(String chars, int start, int count)
- * flush()
- * close()
- * </code>
- * In this manner nothing will accidentally go directly to
- * the base class rather than to the wrapped Writer or OutputStream.
- *
- * The purpose of this class is to have a uniform way of chaining the output of one writer to
- * the next writer in the chain. In addition there are methods to obtain the Writer or
- * OutputStream that this object sends its output to.
- *
- * This interface is only for internal use withing the serializer.
- * @xsl.usage internal
- */
-interface WriterChain
-{
- /** This method forces us to over-ride the method defined in java.io.Writer */
- public void write(int val) throws IOException;
- /** This method forces us to over-ride the method defined in java.io.Writer */
- public void write(char[] chars) throws IOException;
- /** This method forces us to over-ride the method defined in java.io.Writer */
- public void write(char[] chars, int start, int count) throws IOException;
- /** This method forces us to over-ride the method defined in java.io.Writer */
- public void write(String chars) throws IOException;
- /** This method forces us to over-ride the method defined in java.io.Writer */
- public void write(String chars, int start, int count) throws IOException;
- /** This method forces us to over-ride the method defined in java.io.Writer */
- public void flush() throws IOException;
- /** This method forces us to over-ride the method defined in java.io.Writer */
- public void close() throws IOException;
-
- /**
- * If this method returns null, getOutputStream() must return non-null.
- * Get the writer that this writer sends its output to.
- *
- * It is possible that the Writer returned by this method does not
- * implement the WriterChain interface.
- */
- public java.io.Writer getWriter();
-
- /**
- * If this method returns null, getWriter() must return non-null.
- * Get the OutputStream that this writer sends its output to.
- */
- public java.io.OutputStream getOutputStream();
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/WriterToASCI.java b/src/com/sun/org/apache/xml/internal/serializer/WriterToASCI.java
deleted file mode 100644
index cfbbd9c..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/WriterToASCI.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: WriterToASCI.java,v 1.2.4.1 2005/09/15 08:15:31 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.serializer;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.Writer;
-
-
-
-/**
- * This class writes ASCII to a byte stream as quickly as possible. For the
- * moment it does not do buffering, though I reserve the right to do some
- * buffering down the line if I can prove that it will be faster even if the
- * output stream is buffered.
- *
- * This class is only used internally within Xalan.
- *
- * @xsl.usage internal
- */
-class WriterToASCI extends Writer implements WriterChain
-{
-
- /** The byte stream to write to. */
- private final OutputStream m_os;
-
- /**
- * Create an unbuffered ASCII writer.
- *
- *
- * @param os The byte stream to write to.
- */
- public WriterToASCI(OutputStream os)
- {
- m_os = os;
- }
-
- /**
- * Write a portion of an array of characters.
- *
- * @param chars Array of characters
- * @param start Offset from which to start writing characters
- * @param length Number of characters to write
- *
- * @exception IOException If an I/O error occurs
- *
- * @throws java.io.IOException
- */
- public void write(char chars[], int start, int length)
- throws java.io.IOException
- {
-
- int n = length+start;
-
- for (int i = start; i < n; i++)
- {
- m_os.write(chars[i]);
- }
- }
-
- /**
- * Write a single character. The character to be written is contained in
- * the 16 low-order bits of the given integer value; the 16 high-order bits
- * are ignored.
- *
- * <p> Subclasses that intend to support efficient single-character output
- * should override this method.
- *
- * @param c int specifying a character to be written.
- * @exception IOException If an I/O error occurs
- */
- public void write(int c) throws IOException
- {
- m_os.write(c);
- }
-
- /**
- * Write a string.
- *
- * @param s String to be written
- *
- * @exception IOException If an I/O error occurs
- */
- public void write(String s) throws IOException
- {
- int n = s.length();
- for (int i = 0; i < n; i++)
- {
- m_os.write(s.charAt(i));
- }
- }
-
- /**
- * Flush the stream. If the stream has saved any characters from the
- * various write() methods in a buffer, write them immediately to their
- * intended destination. Then, if that destination is another character or
- * byte stream, flush it. Thus one flush() invocation will flush all the
- * buffers in a chain of Writers and OutputStreams.
- *
- * @exception IOException If an I/O error occurs
- */
- public void flush() throws java.io.IOException
- {
- m_os.flush();
- }
-
- /**
- * Close the stream, flushing it first. Once a stream has been closed,
- * further write() or flush() invocations will cause an IOException to be
- * thrown. Closing a previously-closed stream, however, has no effect.
- *
- * @exception IOException If an I/O error occurs
- */
- public void close() throws java.io.IOException
- {
- m_os.close();
- }
-
- /**
- * Get the output stream where the events will be serialized to.
- *
- * @return reference to the result stream, or null of only a writer was
- * set.
- */
- public OutputStream getOutputStream()
- {
- return m_os;
- }
-
- /**
- * Get the writer that this writer directly chains to.
- */
- public Writer getWriter()
- {
- return null;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/WriterToUTF8Buffered.java b/src/com/sun/org/apache/xml/internal/serializer/WriterToUTF8Buffered.java
deleted file mode 100644
index b9291cc..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/WriterToUTF8Buffered.java
+++ /dev/null
@@ -1,505 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: WriterToUTF8Buffered.java,v 1.2.4.1 2005/09/15 08:15:31 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.serializer;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
-import java.io.Writer;
-
-
-/**
- * This class writes unicode characters to a byte stream (java.io.OutputStream)
- * as quickly as possible. It buffers the output in an internal
- * buffer which must be flushed to the OutputStream when done. This flushing
- * is done via the close() flush() or flushBuffer() method.
- *
- * This class is only used internally within Xalan.
- *
- * @xsl.usage internal
- */
-final class WriterToUTF8Buffered extends Writer implements WriterChain
-{
-
- /** number of bytes that the byte buffer can hold.
- * This is a fixed constant is used rather than m_outputBytes.lenght for performance.
- */
- private static final int BYTES_MAX=16*1024;
- /** number of characters that the character buffer can hold.
- * This is 1/3 of the number of bytes because UTF-8 encoding
- * can expand one unicode character by up to 3 bytes.
- */
- private static final int CHARS_MAX=(BYTES_MAX/3);
-
- // private static final int
-
- /** The byte stream to write to. (sc & sb remove final to compile in JDK 1.1.8) */
- private final OutputStream m_os;
-
- /**
- * The internal buffer where data is stored.
- * (sc & sb remove final to compile in JDK 1.1.8)
- */
- private final byte m_outputBytes[];
-
- private final char m_inputChars[];
-
- /**
- * The number of valid bytes in the buffer. This value is always
- * in the range <tt>0</tt> through <tt>m_outputBytes.length</tt>; elements
- * <tt>m_outputBytes[0]</tt> through <tt>m_outputBytes[count-1]</tt> contain valid
- * byte data.
- */
- private int count;
-
- /**
- * Create an buffered UTF-8 writer.
- *
- *
- * @param out the underlying output stream.
- *
- * @throws UnsupportedEncodingException
- */
- public WriterToUTF8Buffered(OutputStream out)
- throws UnsupportedEncodingException
- {
- m_os = out;
- // get 3 extra bytes to make buffer overflow checking simpler and faster
- // we won't have to keep checking for a few extra characters
- m_outputBytes = new byte[BYTES_MAX + 3];
-
- // Big enough to hold the input chars that will be transformed
- // into output bytes in m_ouputBytes.
- m_inputChars = new char[CHARS_MAX + 2];
- count = 0;
-
-// the old body of this constructor, before the buffersize was changed to a constant
-// this(out, 8*1024);
- }
-
- /**
- * Create an buffered UTF-8 writer to write data to the
- * specified underlying output stream with the specified buffer
- * size.
- *
- * @param out the underlying output stream.
- * @param size the buffer size.
- * @exception IllegalArgumentException if size <= 0.
- */
-// public WriterToUTF8Buffered(final OutputStream out, final int size)
-// {
-//
-// m_os = out;
-//
-// if (size <= 0)
-// {
-// throw new IllegalArgumentException(
-// SerializerMessages.createMessage(SerializerErrorResources.ER_BUFFER_SIZE_LESSTHAN_ZERO, null)); //"Buffer size <= 0");
-// }
-//
-// m_outputBytes = new byte[size];
-// count = 0;
-// }
-
- /**
- * Write a single character. The character to be written is contained in
- * the 16 low-order bits of the given integer value; the 16 high-order bits
- * are ignored.
- *
- * <p> Subclasses that intend to support efficient single-character output
- * should override this method.
- *
- * @param c int specifying a character to be written.
- * @exception IOException If an I/O error occurs
- */
- public void write(final int c) throws IOException
- {
-
- /* If we are close to the end of the buffer then flush it.
- * Remember the buffer can hold a few more bytes than BYTES_MAX
- */
- if (count >= BYTES_MAX)
- flushBuffer();
-
- if (c < 0x80)
- {
- m_outputBytes[count++] = (byte) (c);
- }
- else if (c < 0x800)
- {
- m_outputBytes[count++] = (byte) (0xc0 + (c >> 6));
- m_outputBytes[count++] = (byte) (0x80 + (c & 0x3f));
- }
- else if (c < 0x10000)
- {
- m_outputBytes[count++] = (byte) (0xe0 + (c >> 12));
- m_outputBytes[count++] = (byte) (0x80 + ((c >> 6) & 0x3f));
- m_outputBytes[count++] = (byte) (0x80 + (c & 0x3f));
- }
- else
- {
- m_outputBytes[count++] = (byte) (0xf0 + (c >> 18));
- m_outputBytes[count++] = (byte) (0x80 + ((c >> 12) & 0x3f));
- m_outputBytes[count++] = (byte) (0x80 + ((c >> 6) & 0x3f));
- m_outputBytes[count++] = (byte) (0x80 + (c & 0x3f));
- }
-
- }
-
-
- /**
- * Write a portion of an array of characters.
- *
- * @param chars Array of characters
- * @param start Offset from which to start writing characters
- * @param length Number of characters to write
- *
- * @exception IOException If an I/O error occurs
- *
- * @throws java.io.IOException
- */
- public void write(final char chars[], final int start, final int length)
- throws java.io.IOException
- {
-
- // We multiply the length by three since this is the maximum length
- // of the characters that we can put into the buffer. It is possible
- // for each Unicode character to expand to three bytes.
-
- int lengthx3 = 3*length;
-
- if (lengthx3 >= BYTES_MAX - count)
- {
- // The requested length is greater than the unused part of the buffer
- flushBuffer();
-
- if (lengthx3 > BYTES_MAX)
- {
- /*
- * The requested length exceeds the size of the buffer.
- * Cut the buffer up into chunks, each of which will
- * not cause an overflow to the output buffer m_outputBytes,
- * and make multiple recursive calls.
- * Be careful about integer overflows in multiplication.
- */
- int split = length/CHARS_MAX;
- final int chunks;
- if (length % CHARS_MAX > 0)
- chunks = split + 1;
- else
- chunks = split;
- int end_chunk = start;
- for (int chunk = 1; chunk <= chunks; chunk++)
- {
- int start_chunk = end_chunk;
- end_chunk = start + (int) ((((long) length) * chunk) / chunks);
-
- // Adjust the end of the chunk if it ends on a high char
- // of a Unicode surrogate pair and low char of the pair
- // is not going to be in the same chunk
- final char c = chars[end_chunk - 1];
- int ic = chars[end_chunk - 1];
- if (c >= 0xD800 && c <= 0xDBFF) {
- // The last Java char that we were going
- // to process is the first of a
- // Java surrogate char pair that
- // represent a Unicode character.
-
- if (end_chunk < start + length) {
- // Avoid spanning by including the low
- // char in the current chunk of chars.
- end_chunk++;
- } else {
- /* This is the last char of the last chunk,
- * and it is the high char of a high/low pair with
- * no low char provided.
- * TODO: error message needed.
- * The char array incorrectly ends in a high char
- * of a high/low surrogate pair, but there is
- * no corresponding low as the high is the last char
- */
- end_chunk--;
- }
- }
-
-
- int len_chunk = (end_chunk - start_chunk);
- this.write(chars,start_chunk, len_chunk);
- }
- return;
- }
- }
-
-
-
- final int n = length+start;
- final byte[] buf_loc = m_outputBytes; // local reference for faster access
- int count_loc = count; // local integer for faster access
- int i = start;
- {
- /* This block could be omitted and the code would produce
- * the same result. But this block exists to give the JIT
- * a better chance of optimizing a tight and common loop which
- * occurs when writing out ASCII characters.
- */
- char c;
- for(; i < n && (c = chars[i])< 0x80 ; i++ )
- buf_loc[count_loc++] = (byte)c;
- }
- for (; i < n; i++)
- {
-
- final char c = chars[i];
-
- if (c < 0x80)
- buf_loc[count_loc++] = (byte) (c);
- else if (c < 0x800)
- {
- buf_loc[count_loc++] = (byte) (0xc0 + (c >> 6));
- buf_loc[count_loc++] = (byte) (0x80 + (c & 0x3f));
- }
- /**
- * The following else if condition is added to support XML 1.1 Characters for
- * UTF-8: [1111 0uuu] [10uu zzzz] [10yy yyyy] [10xx xxxx]*
- * Unicode: [1101 10ww] [wwzz zzyy] (high surrogate)
- * [1101 11yy] [yyxx xxxx] (low surrogate)
- * * uuuuu = wwww + 1
- */
- else if (c >= 0xD800 && c <= 0xDBFF)
- {
- char high, low;
- high = c;
- i++;
- low = chars[i];
-
- buf_loc[count_loc++] = (byte) (0xF0 | (((high + 0x40) >> 8) & 0xf0));
- buf_loc[count_loc++] = (byte) (0x80 | (((high + 0x40) >> 2) & 0x3f));
- buf_loc[count_loc++] = (byte) (0x80 | ((low >> 6) & 0x0f) + ((high << 4) & 0x30));
- buf_loc[count_loc++] = (byte) (0x80 | (low & 0x3f));
- }
- else
- {
- buf_loc[count_loc++] = (byte) (0xe0 + (c >> 12));
- buf_loc[count_loc++] = (byte) (0x80 + ((c >> 6) & 0x3f));
- buf_loc[count_loc++] = (byte) (0x80 + (c & 0x3f));
- }
- }
- // Store the local integer back into the instance variable
- count = count_loc;
-
- }
-
- /**
- * Write a string.
- *
- * @param s String to be written
- *
- * @exception IOException If an I/O error occurs
- */
- public void write(final String s) throws IOException
- {
-
- // We multiply the length by three since this is the maximum length
- // of the characters that we can put into the buffer. It is possible
- // for each Unicode character to expand to three bytes.
- final int length = s.length();
- int lengthx3 = 3*length;
-
- if (lengthx3 >= BYTES_MAX - count)
- {
- // The requested length is greater than the unused part of the buffer
- flushBuffer();
-
- if (lengthx3 > BYTES_MAX)
- {
- /*
- * The requested length exceeds the size of the buffer,
- * so break it up in chunks that don't exceed the buffer size.
- */
- final int start = 0;
- int split = length/CHARS_MAX;
- final int chunks;
- if (length % CHARS_MAX > 0)
- chunks = split + 1;
- else
- chunks = split;
- int end_chunk = 0;
- for (int chunk = 1; chunk <= chunks; chunk++)
- {
- int start_chunk = end_chunk;
- end_chunk = start + (int) ((((long) length) * chunk) / chunks);
- s.getChars(start_chunk,end_chunk, m_inputChars,0);
- int len_chunk = (end_chunk - start_chunk);
-
- // Adjust the end of the chunk if it ends on a high char
- // of a Unicode surrogate pair and low char of the pair
- // is not going to be in the same chunk
- final char c = m_inputChars[len_chunk - 1];
- if (c >= 0xD800 && c <= 0xDBFF) {
- // Exclude char in this chunk,
- // to avoid spanning a Unicode character
- // that is in two Java chars as a high/low surrogate
- end_chunk--;
- len_chunk--;
- if (chunk == chunks) {
- /* TODO: error message needed.
- * The String incorrectly ends in a high char
- * of a high/low surrogate pair, but there is
- * no corresponding low as the high is the last char
- * Recover by ignoring this last char.
- */
- }
- }
-
- this.write(m_inputChars,0, len_chunk);
- }
- return;
- }
- }
-
-
- s.getChars(0, length , m_inputChars, 0);
- final char[] chars = m_inputChars;
- final int n = length;
- final byte[] buf_loc = m_outputBytes; // local reference for faster access
- int count_loc = count; // local integer for faster access
- int i = 0;
- {
- /* This block could be omitted and the code would produce
- * the same result. But this block exists to give the JIT
- * a better chance of optimizing a tight and common loop which
- * occurs when writing out ASCII characters.
- */
- char c;
- for(; i < n && (c = chars[i])< 0x80 ; i++ )
- buf_loc[count_loc++] = (byte)c;
- }
- for (; i < n; i++)
- {
-
- final char c = chars[i];
-
- if (c < 0x80)
- buf_loc[count_loc++] = (byte) (c);
- else if (c < 0x800)
- {
- buf_loc[count_loc++] = (byte) (0xc0 + (c >> 6));
- buf_loc[count_loc++] = (byte) (0x80 + (c & 0x3f));
- }
- /**
- * The following else if condition is added to support XML 1.1 Characters for
- * UTF-8: [1111 0uuu] [10uu zzzz] [10yy yyyy] [10xx xxxx]*
- * Unicode: [1101 10ww] [wwzz zzyy] (high surrogate)
- * [1101 11yy] [yyxx xxxx] (low surrogate)
- * * uuuuu = wwww + 1
- */
- else if (c >= 0xD800 && c <= 0xDBFF)
- {
- char high, low;
- high = c;
- i++;
- low = chars[i];
-
- buf_loc[count_loc++] = (byte) (0xF0 | (((high + 0x40) >> 8) & 0xf0));
- buf_loc[count_loc++] = (byte) (0x80 | (((high + 0x40) >> 2) & 0x3f));
- buf_loc[count_loc++] = (byte) (0x80 | ((low >> 6) & 0x0f) + ((high << 4) & 0x30));
- buf_loc[count_loc++] = (byte) (0x80 | (low & 0x3f));
- }
- else
- {
- buf_loc[count_loc++] = (byte) (0xe0 + (c >> 12));
- buf_loc[count_loc++] = (byte) (0x80 + ((c >> 6) & 0x3f));
- buf_loc[count_loc++] = (byte) (0x80 + (c & 0x3f));
- }
- }
- // Store the local integer back into the instance variable
- count = count_loc;
-
- }
-
- /**
- * Flush the internal buffer
- *
- * @throws IOException
- */
- public void flushBuffer() throws IOException
- {
-
- if (count > 0)
- {
- m_os.write(m_outputBytes, 0, count);
-
- count = 0;
- }
- }
-
- /**
- * Flush the stream. If the stream has saved any characters from the
- * various write() methods in a buffer, write them immediately to their
- * intended destination. Then, if that destination is another character or
- * byte stream, flush it. Thus one flush() invocation will flush all the
- * buffers in a chain of Writers and OutputStreams.
- *
- * @exception IOException If an I/O error occurs
- *
- * @throws java.io.IOException
- */
- public void flush() throws java.io.IOException
- {
- flushBuffer();
- m_os.flush();
- }
-
- /**
- * Close the stream, flushing it first. Once a stream has been closed,
- * further write() or flush() invocations will cause an IOException to be
- * thrown. Closing a previously-closed stream, however, has no effect.
- *
- * @exception IOException If an I/O error occurs
- *
- * @throws java.io.IOException
- */
- public void close() throws java.io.IOException
- {
- flushBuffer();
- m_os.close();
- }
-
- /**
- * Get the output stream where the events will be serialized to.
- *
- * @return reference to the result stream, or null of only a writer was
- * set.
- */
- public OutputStream getOutputStream()
- {
- return m_os;
- }
-
- public Writer getWriter()
- {
- // Only one of getWriter() or getOutputStream() can return null
- // This type of writer wraps an OutputStream, not a Writer.
- return null;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/XMLEntities.properties b/src/com/sun/org/apache/xml/internal/serializer/XMLEntities.properties
deleted file mode 100644
index 5471de4..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/XMLEntities.properties
+++ /dev/null
@@ -1,32 +0,0 @@
-###########################################################################
-# reserved comment block
-# DO NOT REMOVE OR ALTER!
-###########################################################################
-###########################################################################
-# Copyright 2003-2004 The Apache Software Foundation.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-##########################################################################
-#
-# $Id: XMLEntities.properties,v 1.2.4.1 2005/09/15 08:15:32 suresh_emailid Exp $
-#
-# @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
-# This file must be encoded in UTF-8; see com.sun.org.apache.xml.internal.serializer.CharInfo
-#
-# Character entity references for markup-significant
-#
-quot=34
-amp=38
-lt=60
-gt=62
-
diff --git a/src/com/sun/org/apache/xml/internal/serializer/XSLOutputAttributes.java b/src/com/sun/org/apache/xml/internal/serializer/XSLOutputAttributes.java
deleted file mode 100644
index 4fb9b4b..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/XSLOutputAttributes.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2003-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XSLOutputAttributes.java,v 1.2.4.1 2005/09/15 08:15:32 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.serializer;
-
-import java.util.Vector;
-
-/**
- * This interface has methods associated with the XSLT xsl:output attribues
- * specified in the stylesheet that effect the format of the document output.
- *
- * In an XSLT stylesheet these attributes appear for example as:
- * <pre>
- * <xsl:output method="xml" omit-xml-declaration="no" indent="yes"/>
- * </pre>
- * The xsl:output attributes covered in this interface are:
- * <pre>
- * version
- * encoding
- * omit-xml-declarations
- * standalone
- * doctype-public
- * doctype-system
- * cdata-section-elements
- * indent
- * media-type
- * </pre>
- *
- * The one attribute not covered in this interface is <code>method</code> as
- * this value is implicitly chosen by the serializer that is created, for
- * example ToXMLStream vs. ToHTMLStream or another one.
- *
- * This interface is only used internally within Xalan.
- *
- * @xsl.usage internal
- */
-interface XSLOutputAttributes
-{
- /**
- * Returns the previously set value of the value to be used as the public
- * identifier in the document type declaration (DTD).
- *
- *@return the public identifier to be used in the DOCTYPE declaration in the
- * output document.
- */
- public String getDoctypePublic();
- /**
- * Returns the previously set value of the value to be used
- * as the system identifier in the document type declaration (DTD).
- * @return the system identifier to be used in the DOCTYPE declaration in
- * the output document.
- *
- */
- public String getDoctypeSystem();
- /**
- * @return the character encoding to be used in the output document.
- */
- public String getEncoding();
- /**
- * @return true if the output document should be indented to visually
- * indicate its structure.
- */
- public boolean getIndent();
-
- /**
- * @return the number of spaces to indent for each indentation level.
- */
- public int getIndentAmount();
- /**
- * @return the mediatype the media-type or MIME type associated with the
- * output document.
- */
- public String getMediaType();
- /**
- * @return true if the XML declaration is to be omitted from the output
- * document.
- */
- public boolean getOmitXMLDeclaration();
- /**
- * @return a value of "yes" if the <code>standalone</code> delaration is to
- * be included in the output document.
- */
- public String getStandalone();
- /**
- * @return the version of the output format.
- */
- public String getVersion();
-
-
-
-
-
-
- /**
- * Sets the value coming from the xsl:output cdata-section-elements
- * stylesheet property.
- *
- * This sets the elements whose text elements are to be output as CDATA
- * sections.
- * @param URI_and_localNames pairs of namespace URI and local names that
- * identify elements whose text elements are to be output as CDATA sections.
- * The namespace of the local element must be the given URI to match. The
- * qName is not given because the prefix does not matter, only the namespace
- * URI to which that prefix would map matters, so the prefix itself is not
- * relevant in specifying which elements have their text to be output as
- * CDATA sections.
- */
- public void setCdataSectionElements(Vector URI_and_localNames);
-
- /** Set the value coming from the xsl:output doctype-public and doctype-system stylesheet properties
- * @param system the system identifier to be used in the DOCTYPE declaration
- * in the output document.
- * @param pub the public identifier to be used in the DOCTYPE declaration in
- * the output document.
- */
- public void setDoctype(String system, String pub);
-
- /** Set the value coming from the xsl:output doctype-public stylesheet attribute.
- * @param doctype the public identifier to be used in the DOCTYPE
- * declaration in the output document.
- */
- public void setDoctypePublic(String doctype);
- /** Set the value coming from the xsl:output doctype-system stylesheet attribute.
- * @param doctype the system identifier to be used in the DOCTYPE
- * declaration in the output document.
- */
- public void setDoctypeSystem(String doctype);
- /**
- * Sets the character encoding coming from the xsl:output encoding stylesheet attribute.
- * @param encoding the character encoding
- */
- public void setEncoding(String encoding);
- /**
- * Sets the value coming from the xsl:output indent stylesheet
- * attribute.
- * @param indent true if the output document should be indented to visually
- * indicate its structure.
- */
- public void setIndent(boolean indent);
- /**
- * Sets the value coming from the xsl:output media-type stylesheet attribute.
- * @param mediatype the media-type or MIME type associated with the output
- * document.
- */
- public void setMediaType(String mediatype);
- /**
- * Sets the value coming from the xsl:output omit-xml-declaration stylesheet attribute
- * @param b true if the XML declaration is to be omitted from the output
- * document.
- */
- public void setOmitXMLDeclaration(boolean b);
- /**
- * Sets the value coming from the xsl:output standalone stylesheet attribute.
- * @param standalone a value of "yes" indicates that the
- * <code>standalone</code> delaration is to be included in the output
- * document.
- */
- public void setStandalone(String standalone);
- /**
- * Sets the value coming from the xsl:output version attribute.
- * @param version the version of the output format.
- */
- public void setVersion(String version);
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/output_html.properties b/src/com/sun/org/apache/xml/internal/serializer/output_html.properties
deleted file mode 100644
index ff16c65..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/output_html.properties
+++ /dev/null
@@ -1,46 +0,0 @@
-###########################################################################
-# reserved comment block
-# DO NOT REMOVE OR ALTER!
-###########################################################################
-###########################################################################
-# Copyright 2003-2004 The Apache Software Foundation.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-##########################################################################
-#
-# $Id: output_html.properties,v 1.2.4.1 2005/09/15 08:15:32 suresh_emailid Exp $
-#
-# Specify defaults when method="html". These defaults use output_xml.properties
-# as a base.
-#
-
-# XSLT properties do not need namespace qualification.
-method=html
-indent=yes
-media-type=text/html
-version=4.0
-
-# Xalan-specific output properties. These can be overridden in the stylesheet
-# assigning a xalan namespace. For example:
-# <xsl:stylesheet version="1.0"
-# xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-# xmlns:xalan="http://xml.apache.org/xalan">
-# <xsl:output method="html" encoding="UTF-8"
-# xalan:content-handler="MyContentHandler"/>
-# ...
-# Note that the colon after the protocol needs to be escaped.
-{http\u003a//xml.apache.org/xalan}indent-amount=0
-{http\u003a//xml.apache.org/xalan}content-handler=com.sun.org.apache.xml.internal.serializer.ToHTMLStream
-{http\u003a//xml.apache.org/xalan}entities=com/sun/org/apache/xml/internal/serializer/HTMLEntities
-{http\u003a//xml.apache.org/xalan}use-url-escaping=yes
-{http\u003a//xml.apache.org/xalan}omit-meta-tag=no
diff --git a/src/com/sun/org/apache/xml/internal/serializer/output_text.properties b/src/com/sun/org/apache/xml/internal/serializer/output_text.properties
deleted file mode 100644
index d3d2baf..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/output_text.properties
+++ /dev/null
@@ -1,39 +0,0 @@
-###########################################################################
-# reserved comment block
-# DO NOT REMOVE OR ALTER!
-###########################################################################
-##########################################################################
-# Copyright 2003-2004 The Apache Software Foundation.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-##########################################################################
-#
-# $Id: output_text.properties,v 1.3 2005/09/28 13:49:10 pvedula Exp $
-#
-# Specify defaults when method="text".
-#
-
-# XSLT properties do not need namespace qualification.
-method=text
-media-type=text/plain
-
-# Xalan-specific output properties. These can be overridden in the stylesheet
-# assigning a xalan namespace. For example:
-# <xsl:stylesheet version="1.0"
-# xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-# xmlns:xalan="http://xml.apache.org/xalan">
-# <xsl:output method="html" encoding="UTF-8"
-# xalan:content-handler="MyContentHandler"/>
-# ...
-# Note that the colon after the protocol needs to be escaped.
-{http\u003a//xml.apache.org/xalan}content-handler=com.sun.org.apache.xml.internal.serializer.ToTextStream
diff --git a/src/com/sun/org/apache/xml/internal/serializer/output_unknown.properties b/src/com/sun/org/apache/xml/internal/serializer/output_unknown.properties
deleted file mode 100644
index 118d469..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/output_unknown.properties
+++ /dev/null
@@ -1,48 +0,0 @@
-###########################################################################
-# reserved comment block
-# DO NOT REMOVE OR ALTER!
-###########################################################################
-###########################################################################
-# Copyright 2003-2004 The Apache Software Foundation.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-##########################################################################
-#
-# $Id: output_unknown.properties,v 1.2.4.1 2005/09/15 08:15:33 suresh_emailid Exp $
-#
-# Specify defaults when no method="..." is specified.
-# This type of output will quickly switch to "xml" or "html"
-# depending on the first element name.
-#
-
-# XSLT properties do not need namespace qualification.
-method=xml
-version=1.0
-encoding=UTF-8
-indent=no
-omit-xml-declaration=no
-standalone=no
-media-type=text/xml
-
-# Xalan-specific output properties. These can be overridden in the stylesheet
-# assigning a xalan namespace. For example:
-# <xsl:stylesheet version="1.0"
-# xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-# xmlns:xalan="http://xml.apache.org/xalan">
-# <xsl:output method="html" encoding="UTF-8"
-# xalan:content-handler="MyContentHandler"/>
-# ...
-# Note that the colon after the protocol needs to be escaped.
-{http\u003a//xml.apache.org/xalan}indent-amount=0
-{http\u003a//xml.apache.org/xalan}content-handler=com.sun.org.apache.xml.internal.serializer.ToUnknownStream
-
diff --git a/src/com/sun/org/apache/xml/internal/serializer/output_xml.properties b/src/com/sun/org/apache/xml/internal/serializer/output_xml.properties
deleted file mode 100644
index fd016f7..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/output_xml.properties
+++ /dev/null
@@ -1,48 +0,0 @@
-###########################################################################
-# reserved comment block
-# DO NOT REMOVE OR ALTER!
-###########################################################################
-###########################################################################
-# Copyright 2003-2004 The Apache Software Foundation.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-##########################################################################
-#
-# $Id: output_xml.properties,v 1.2.4.1 2005/09/15 08:15:33 suresh_emailid Exp $
-#
-# Specify defaults when method="xml". These defaults serve as a base for
-# other defaults, such as output_html and output_text.
-#
-
-# XSLT properties do not need namespace qualification.
-method=xml
-version=1.0
-encoding=UTF-8
-indent=no
-omit-xml-declaration=no
-standalone=no
-media-type=text/xml
-
-# Xalan-specific output properties. These can be overridden in the stylesheet
-# assigning a xalan namespace. For example:
-# <xsl:stylesheet version="1.0"
-# xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-# xmlns:xalan="http://xml.apache.org/xalan">
-# <xsl:output method="html" encoding="UTF-8"
-# xalan:content-handler="MyContentHandler"/>
-# ...
-# Note that the colon after the protocol needs to be escaped.
-{http\u003a//xml.apache.org/xalan}indent-amount=0
-{http\u003a//xml.apache.org/xalan}content-handler=com.sun.org.apache.xml.internal.serializer.ToXMLStream
-{http\u003a//xml.apache.org/xalan}entities=com/sun/org/apache/xml/internal/serializer/XMLEntities
-
diff --git a/src/com/sun/org/apache/xml/internal/serializer/package.html b/src/com/sun/org/apache/xml/internal/serializer/package.html
deleted file mode 100644
index ed84fe8..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/package.html
+++ /dev/null
@@ -1,45 +0,0 @@
-<!--
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
--->
-<!--
- * Copyright 2003-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
--->
-<!-- $Id: package.html,v 1.2.4.1 2005/09/15 08:15:34 suresh_emailid Exp $ -->
-<html>
- <title>Xalan Serializer Package.</title>
- <body>
- <p>Processes SAX events into streams.</p>
-
- <p>The {@link com.sun.org.apache.xml.internal.serializer.SerializerFactory} is used to
- create a {@link com.sun.org.apache.xml.internal.serializer.Serializer} from a set of
- output properties (see {@link javax.xml.transform.OutputKeys}).</p>
- <p>{@link com.sun.org.apache.xml.internal.serializer.ToStream} acts as the main
- baseclass for the Xalan serializer implementations.
- {@link com.sun.org.apache.xml.internal.serializer.ToHTMLStream} derives from this
- to implement HTML serialization.
- {@link com.sun.org.apache.xml.internal.serializer.ToTextStream}
- implements plain text serialization.
- {@link com.sun.org.apache.xml.internal.serializer.ToXMLStream}
- implements XML serialization.
- </p>
- <p>XML mapping from characters to entity references is defined in
- XMLEntities.res. HTML entity reference mapping is defined in HTMLEntities.res.
- </p>
- <p>Encoding information is defined in {@link com.sun.org.apache.xml.internal.serializer.Encodings}.</p>
- </body>
-</html>
-
-
diff --git a/src/com/sun/org/apache/xml/internal/serializer/utils/AttList.java b/src/com/sun/org/apache/xml/internal/serializer/utils/AttList.java
deleted file mode 100644
index 94b4422..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/utils/AttList.java
+++ /dev/null
@@ -1,265 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: AttList.java,v 1.1.4.1 2005/09/08 11:03:08 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.serializer.utils;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-import org.xml.sax.Attributes;
-
-/**
- * Wraps a DOM attribute list in a SAX Attributes.
- *
- * This class is a copy of the one in com.sun.org.apache.xml.internal.utils.
- * It exists to cut the serializers dependancy on that package.
- * A minor changes from that package are:
- * DOMHelper reference changed to DOM2Helper, class is not "public"
- *
- * This class is not a public API, it is only public because it is
- * used in com.sun.org.apache.xml.internal.serializer.
- *
- * @xsl.usage internal
- */
-public final class AttList implements Attributes
-{
-
- /** List of attribute nodes */
- NamedNodeMap m_attrs;
-
- /** Index of last attribute node */
- int m_lastIndex;
-
- // ARGHH!! JAXP Uses Xerces without setting the namespace processing to ON!
- // DOM2Helper m_dh = new DOM2Helper();
-
- /** Local reference to DOMHelper */
- DOM2Helper m_dh;
-
-// /**
-// * Constructor AttList
-// *
-// *
-// * @param attrs List of attributes this will contain
-// */
-// public AttList(NamedNodeMap attrs)
-// {
-//
-// m_attrs = attrs;
-// m_lastIndex = m_attrs.getLength() - 1;
-// m_dh = new DOM2Helper();
-// }
-
- /**
- * Constructor AttList
- *
- *
- * @param attrs List of attributes this will contain
- * @param dh DOMHelper
- */
- public AttList(NamedNodeMap attrs, DOM2Helper dh)
- {
-
- m_attrs = attrs;
- m_lastIndex = m_attrs.getLength() - 1;
- m_dh = dh;
- }
-
- /**
- * Get the number of attribute nodes in the list
- *
- *
- * @return number of attribute nodes
- */
- public int getLength()
- {
- return m_attrs.getLength();
- }
-
- /**
- * Look up an attribute's Namespace URI by index.
- *
- * @param index The attribute index (zero-based).
- * @return The Namespace URI, or the empty string if none
- * is available, or null if the index is out of
- * range.
- */
- public String getURI(int index)
- {
- String ns = m_dh.getNamespaceOfNode(((Attr) m_attrs.item(index)));
- if(null == ns)
- ns = "";
- return ns;
- }
-
- /**
- * Look up an attribute's local name by index.
- *
- * @param index The attribute index (zero-based).
- * @return The local name, or the empty string if Namespace
- * processing is not being performed, or null
- * if the index is out of range.
- */
- public String getLocalName(int index)
- {
- return m_dh.getLocalNameOfNode(((Attr) m_attrs.item(index)));
- }
-
- /**
- * Look up an attribute's qualified name by index.
- *
- *
- * @param i The attribute index (zero-based).
- *
- * @return The attribute's qualified name
- */
- public String getQName(int i)
- {
- return ((Attr) m_attrs.item(i)).getName();
- }
-
- /**
- * Get the attribute's node type by index
- *
- *
- * @param i The attribute index (zero-based)
- *
- * @return the attribute's node type
- */
- public String getType(int i)
- {
- return "CDATA"; // for the moment
- }
-
- /**
- * Get the attribute's node value by index
- *
- *
- * @param i The attribute index (zero-based)
- *
- * @return the attribute's node value
- */
- public String getValue(int i)
- {
- return ((Attr) m_attrs.item(i)).getValue();
- }
-
- /**
- * Get the attribute's node type by name
- *
- *
- * @param name Attribute name
- *
- * @return the attribute's node type
- */
- public String getType(String name)
- {
- return "CDATA"; // for the moment
- }
-
- /**
- * Look up an attribute's type by Namespace name.
- *
- * @param uri The Namespace URI, or the empty String if the
- * name has no Namespace URI.
- * @param localName The local name of the attribute.
- * @return The attribute type as a string, or null if the
- * attribute is not in the list or if Namespace
- * processing is not being performed.
- */
- public String getType(String uri, String localName)
- {
- return "CDATA"; // for the moment
- }
-
- /**
- * Look up an attribute's value by name.
- *
- *
- * @param name The attribute node's name
- *
- * @return The attribute node's value
- */
- public String getValue(String name)
- {
- Attr attr = ((Attr) m_attrs.getNamedItem(name));
- return (null != attr)
- ? attr.getValue() : null;
- }
-
- /**
- * Look up an attribute's value by Namespace name.
- *
- * @param uri The Namespace URI, or the empty String if the
- * name has no Namespace URI.
- * @param localName The local name of the attribute.
- * @return The attribute value as a string, or null if the
- * attribute is not in the list.
- */
- public String getValue(String uri, String localName)
- {
- Node a=m_attrs.getNamedItemNS(uri,localName);
- return (a==null) ? null : a.getNodeValue();
- }
-
- /**
- * Look up the index of an attribute by Namespace name.
- *
- * @param uri The Namespace URI, or the empty string if
- * the name has no Namespace URI.
- * @param localPart The attribute's local name.
- * @return The index of the attribute, or -1 if it does not
- * appear in the list.
- */
- public int getIndex(String uri, String localPart)
- {
- for(int i=m_attrs.getLength()-1;i>=0;--i)
- {
- Node a=m_attrs.item(i);
- String u=a.getNamespaceURI();
- if( (u==null ? uri==null : u.equals(uri))
- &&
- a.getLocalName().equals(localPart) )
- return i;
- }
- return -1;
- }
-
- /**
- * Look up the index of an attribute by raw XML 1.0 name.
- *
- * @param qName The qualified (prefixed) name.
- * @return The index of the attribute, or -1 if it does not
- * appear in the list.
- */
- public int getIndex(String qName)
- {
- for(int i=m_attrs.getLength()-1;i>=0;--i)
- {
- Node a=m_attrs.item(i);
- if(a.getNodeName().equals(qName) )
- return i;
- }
- return -1;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/utils/BoolStack.java b/src/com/sun/org/apache/xml/internal/serializer/utils/BoolStack.java
deleted file mode 100644
index d20d4d5..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/utils/BoolStack.java
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: BoolStack.java,v 1.1.4.1 2005/09/08 11:03:08 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.serializer.utils;
-
-
-/**
- * Simple stack for boolean values.
- *
- * This class is a copy of the one in com.sun.org.apache.xml.internal.utils.
- * It exists to cut the serializers dependancy on that package.
- * A minor changes from that package are:
- * doesn't implement Clonable
- *
- * This class is not a public API, it is only public because it is
- * used in com.sun.org.apache.xml.internal.serializer.
- *
- * @xsl.usage internal
- */
-public final class BoolStack
-{
-
- /** Array of boolean values */
- private boolean m_values[];
-
- /** Array size allocated */
- private int m_allocatedSize;
-
- /** Index into the array of booleans */
- private int m_index;
-
- /**
- * Default constructor. Note that the default
- * block size is very small, for small lists.
- */
- public BoolStack()
- {
- this(32);
- }
-
- /**
- * Construct a IntVector, using the given block size.
- *
- * @param size array size to allocate
- */
- public BoolStack(int size)
- {
-
- m_allocatedSize = size;
- m_values = new boolean[size];
- m_index = -1;
- }
-
- /**
- * Get the length of the list.
- *
- * @return Current length of the list
- */
- public final int size()
- {
- return m_index + 1;
- }
-
- /**
- * Clears the stack.
- *
- */
- public final void clear()
- {
- m_index = -1;
- }
-
- /**
- * Pushes an item onto the top of this stack.
- *
- *
- * @param val the boolean to be pushed onto this stack.
- * @return the <code>item</code> argument.
- */
- public final boolean push(boolean val)
- {
-
- if (m_index == m_allocatedSize - 1)
- grow();
-
- return (m_values[++m_index] = val);
- }
-
- /**
- * Removes the object at the top of this stack and returns that
- * object as the value of this function.
- *
- * @return The object at the top of this stack.
- * @throws EmptyStackException if this stack is empty.
- */
- public final boolean pop()
- {
- return m_values[m_index--];
- }
-
- /**
- * Removes the object at the top of this stack and returns the
- * next object at the top as the value of this function.
- *
- *
- * @return Next object to the top or false if none there
- */
- public final boolean popAndTop()
- {
-
- m_index--;
-
- return (m_index >= 0) ? m_values[m_index] : false;
- }
-
- /**
- * Set the item at the top of this stack
- *
- *
- * @param b Object to set at the top of this stack
- */
- public final void setTop(boolean b)
- {
- m_values[m_index] = b;
- }
-
- /**
- * Looks at the object at the top of this stack without removing it
- * from the stack.
- *
- * @return the object at the top of this stack.
- * @throws EmptyStackException if this stack is empty.
- */
- public final boolean peek()
- {
- return m_values[m_index];
- }
-
- /**
- * Looks at the object at the top of this stack without removing it
- * from the stack. If the stack is empty, it returns false.
- *
- * @return the object at the top of this stack.
- */
- public final boolean peekOrFalse()
- {
- return (m_index > -1) ? m_values[m_index] : false;
- }
-
- /**
- * Looks at the object at the top of this stack without removing it
- * from the stack. If the stack is empty, it returns true.
- *
- * @return the object at the top of this stack.
- */
- public final boolean peekOrTrue()
- {
- return (m_index > -1) ? m_values[m_index] : true;
- }
-
- /**
- * Tests if this stack is empty.
- *
- * @return <code>true</code> if this stack is empty;
- * <code>false</code> otherwise.
- */
- public boolean isEmpty()
- {
- return (m_index == -1);
- }
-
- /**
- * Grows the size of the stack
- *
- */
- private void grow()
- {
-
- m_allocatedSize *= 2;
-
- boolean newVector[] = new boolean[m_allocatedSize];
-
- System.arraycopy(m_values, 0, newVector, 0, m_index + 1);
-
- m_values = newVector;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/utils/DOM2Helper.java b/src/com/sun/org/apache/xml/internal/serializer/utils/DOM2Helper.java
deleted file mode 100644
index 7395903..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/utils/DOM2Helper.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DOM2Helper.java,v 1.1.4.1 2005/09/08 11:03:09 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.serializer.utils;
-
-import java.io.IOException;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.TransformerException;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-import org.xml.sax.InputSource;
-
-/**
- * This class provides a DOM level 2 "helper", which provides services currently
- * not provided be the DOM standard.
- *
- * This class is a copy of the one in com.sun.org.apache.xml.internal.utils.
- * It exists to cut the serializers dependancy on that package.
- *
- * The differences from the original class are:
- * it doesn't extend DOMHelper, not depricated,
- * dropped method isNodeAfter(Node node1, Node node2)
- * dropped method parse(InputSource)
- * dropped method supportSAX()
- * dropped method setDocument(doc)
- * dropped method checkNode(Node)
- * dropped method getDocument()
- * dropped method getElementByID(String id, Document doc)
- * dropped method getParentOfNode(Node node)
- * dropped field Document m_doc;
- * made class non-public
- *
- * This class is not a public API, it is only public because it is
- * used in com.sun.org.apache.xml.internal.serializer.
- *
- * @xsl.usage internal
- */
-public final class DOM2Helper
-{
-
- /**
- * Construct an instance.
- */
- public DOM2Helper(){}
-
- /**
- * Returns the local name of the given node, as defined by the
- * XML Namespaces specification. This is prepared to handle documents
- * built using DOM Level 1 methods by falling back upon explicitly
- * parsing the node name.
- *
- * @param n Node to be examined
- *
- * @return String containing the local name, or null if the node
- * was not assigned a Namespace.
- */
- public String getLocalNameOfNode(Node n)
- {
-
- String name = n.getLocalName();
-
- return (null == name) ? getLocalNameOfNodeFallback(n) : name;
- }
-
- /**
- * Returns the local name of the given node. If the node's name begins
- * with a namespace prefix, this is the part after the colon; otherwise
- * it's the full node name.
- *
- * This method is copied from com.sun.org.apache.xml.internal.utils.DOMHelper
- *
- * @param n the node to be examined.
- *
- * @return String containing the Local Name
- */
- private String getLocalNameOfNodeFallback(Node n)
- {
-
- String qname = n.getNodeName();
- int index = qname.indexOf(':');
-
- return (index < 0) ? qname : qname.substring(index + 1);
- }
-
- /**
- * Returns the Namespace Name (Namespace URI) for the given node.
- * In a Level 2 DOM, you can ask the node itself. Note, however, that
- * doing so conflicts with our decision in getLocalNameOfNode not
- * to trust the that the DOM was indeed created using the Level 2
- * methods. If Level 1 methods were used, these two functions will
- * disagree with each other.
- * <p>
- * TODO: Reconcile with getLocalNameOfNode.
- *
- * @param n Node to be examined
- *
- * @return String containing the Namespace URI bound to this DOM node
- * at the time the Node was created.
- */
- public String getNamespaceOfNode(Node n)
- {
- return n.getNamespaceURI();
- }
-
- /** Field m_useDOM2getNamespaceURI is a compile-time flag which
- * gates some of the parser options used to build a DOM -- but
- * that code is commented out at this time and nobody else
- * references it, so I've commented this out as well. */
- //private boolean m_useDOM2getNamespaceURI = false;
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/utils/Messages.java b/src/com/sun/org/apache/xml/internal/serializer/utils/Messages.java
deleted file mode 100644
index 84f4c98..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/utils/Messages.java
+++ /dev/null
@@ -1,272 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Messages.java,v 1.1.4.1 2005/09/08 11:03:10 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.serializer.utils;
-
-import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
-import java.util.ListResourceBundle;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * A utility class for issuing error messages.
- *
- * A user of this class normally would create a singleton
- * instance of this class, passing the name
- * of the message class on the constructor. For example:
- * <CODE>
- * static Messages x = new Messages("org.package.MyMessages");
- * </CODE>
- * Later the message is typically generated this way if there are no
- * substitution arguments:
- * <CODE>
- * String msg = x.createMessage(org.package.MyMessages.KEY_ONE, null);
- * </CODE>
- * If there are arguments substitutions then something like this:
- * <CODE>
- * String filename = ...;
- * String directory = ...;
- * String msg = x.createMessage(org.package.MyMessages.KEY_TWO,
- * new Object[] {filename, directory) );
- * </CODE>
- *
- * The constructor of an instance of this class must be given
- * the class name of a class that extends java.util.ListResourceBundle
- * ("org.package.MyMessages" in the example above).
- * The name should not have any language suffix
- * which will be added automatically by this utility class.
- *
- * The message class ("org.package.MyMessages")
- * must define the abstract method getContents() that is
- * declared in its base class, for example:
- * <CODE>
- * public Object[][] getContents() {return contents;}
- * </CODE>
- *
- * It is suggested that the message class expose its
- * message keys like this:
- * <CODE>
- * public static final String KEY_ONE = "KEY1";
- * public static final String KEY_TWO = "KEY2";
- * . . .
- * </CODE>
- * and used through their names (KEY_ONE ...) rather than
- * their values ("KEY1" ...).
- *
- * The field contents (returned by getContents()
- * should be initialized something like this:
- * <CODE>
- * public static final Object[][] contents = {
- * { KEY_ONE, "Something has gone wrong!" },
- * { KEY_TWO, "The file ''{0}'' does not exist in directory ''{1}''." },
- * . . .
- * { KEY_N, "Message N" } }
- * </CODE>
- *
- * Where that section of code with the KEY to Message mappings
- * (where the message classes 'contents' field is initialized)
- * can have the Message strings translated in an alternate language
- * in a errorResourceClass with a language suffix.
- *
- *
- * This class is not a public API, it is only public because it is
- * used in com.sun.org.apache.xml.internal.serializer.
- *
- * @xsl.usage internal
- */
-public final class Messages
-{
- /** The local object to use. */
- private final Locale m_locale = Locale.getDefault();
-
- /** The language specific resource object for messages. */
- private ListResourceBundle m_resourceBundle;
-
- /** The class name of the error message string table with no language suffix. */
- private String m_resourceBundleName;
-
-
-
- /**
- * Constructor.
- * @param resourceBundle the class name of the ListResourceBundle
- * that the instance of this class is associated with and will use when
- * creating messages.
- * The class name is without a language suffix. If the value passed
- * is null then loadResourceBundle(errorResourceClass) needs to be called
- * explicitly before any messages are created.
- *
- * @xsl.usage internal
- */
- Messages(String resourceBundle)
- {
-
- m_resourceBundleName = resourceBundle;
- }
-
-
- /**
- * Get the Locale object that is being used.
- *
- * @return non-null reference to Locale object.
- * @xsl.usage internal
- */
- private Locale getLocale()
- {
- return m_locale;
- }
-
- /**
- * Creates a message from the specified key and replacement
- * arguments, localized to the given locale.
- *
- * @param msgKey The key for the message text.
- * @param args The arguments to be used as replacement text
- * in the message created.
- *
- * @return The formatted message string.
- * @xsl.usage internal
- */
- public final String createMessage(String msgKey, Object args[])
- {
- if (m_resourceBundle == null)
- m_resourceBundle = SecuritySupport.getResourceBundle(m_resourceBundleName);
-
- if (m_resourceBundle != null)
- {
- return createMsg(m_resourceBundle, msgKey, args);
- }
- else
- return "Could not load the resource bundles: "+ m_resourceBundleName;
- }
-
- /**
- * Creates a message from the specified key and replacement
- * arguments, localized to the given locale.
- *
- * @param errorCode The key for the message text.
- *
- * @param fResourceBundle The resource bundle to use.
- * @param msgKey The message key to use.
- * @param args The arguments to be used as replacement text
- * in the message created.
- *
- * @return The formatted message string.
- * @xsl.usage internal
- */
- private final String createMsg(
- ListResourceBundle fResourceBundle,
- String msgKey,
- Object args[]) //throws Exception
- {
-
- String fmsg = null;
- boolean throwex = false;
- String msg = null;
-
- if (msgKey != null)
- msg = fResourceBundle.getString(msgKey);
- else
- msgKey = "";
-
- if (msg == null)
- {
- throwex = true;
- /* The message is not in the bundle . . . this is bad,
- * so try to get the message that the message is not in the bundle
- */
- try
- {
-
- msg =
- java.text.MessageFormat.format(
- MsgKey.BAD_MSGKEY,
- new Object[] { msgKey, m_resourceBundleName });
- }
- catch (Exception e)
- {
- /* even the message that the message is not in the bundle is
- * not there ... this is really bad
- */
- msg =
- "The message key '"
- + msgKey
- + "' is not in the message class '"
- + m_resourceBundleName+"'";
- }
- }
- else if (args != null)
- {
- try
- {
- // Do this to keep format from crying.
- // This is better than making a bunch of conditional
- // code all over the place.
- int n = args.length;
-
- for (int i = 0; i < n; i++)
- {
- if (null == args[i])
- args[i] = "";
- }
-
- fmsg = java.text.MessageFormat.format(msg, args);
- // if we get past the line above we have create the message ... hurray!
- }
- catch (Exception e)
- {
- throwex = true;
- try
- {
- // Get the message that the format failed.
- fmsg =
- java.text.MessageFormat.format(
- MsgKey.BAD_MSGFORMAT,
- new Object[] { msgKey, m_resourceBundleName });
- fmsg += " " + msg;
- }
- catch (Exception formatfailed)
- {
- // We couldn't even get the message that the format of
- // the message failed ... so fall back to English.
- fmsg =
- "The format of message '"
- + msgKey
- + "' in message class '"
- + m_resourceBundleName
- + "' failed.";
- }
- }
- }
- else
- fmsg = msg;
-
- if (throwex)
- {
- throw new RuntimeException(fmsg);
- }
-
- return fmsg;
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/utils/MsgKey.java b/src/com/sun/org/apache/xml/internal/serializer/utils/MsgKey.java
deleted file mode 100644
index a4b66ae..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/utils/MsgKey.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: MsgKey.java,v 1.1.4.1 2005/09/08 11:03:11 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.serializer.utils;
-
-/**
- * This class is not a public API,
- * It is used internally by serializer and is public,
- * in the Java sense, only because its use crosses
- * package boundaries.
- * <p>
- * This class holds only the message keys used
- * when generating messages.
- */
-public class MsgKey {
-
- /** An internal error with the messages,
- * this is the message to use if the message key can't be found
- */
- public static final String BAD_MSGKEY = "BAD_MSGKEY";
-
- /**
- * An internal error with the messages,
- * this is the message to use if the message format operation failed.
- */
- public static final String BAD_MSGFORMAT = "BAD_MSGFORMAT";
-
- public static final String ER_RESOURCE_COULD_NOT_FIND =
- "ER_RESOURCE_COULD_NOT_FIND";
- public static final String ER_RESOURCE_COULD_NOT_LOAD =
- "ER_RESOURCE_COULD_NOT_LOAD";
- public static final String ER_BUFFER_SIZE_LESSTHAN_ZERO =
- "ER_BUFFER_SIZE_LESSTHAN_ZERO";
- public static final String ER_INVALID_UTF16_SURROGATE =
- "ER_INVALID_UTF16_SURROGATE";
- public static final String ER_OIERROR = "ER_OIERROR";
- public static final String ER_NAMESPACE_PREFIX = "ER_NAMESPACE_PREFIX";
- public static final String ER_STRAY_ATTRIBUTE = "ER_STRAY_ATTRIBUTE";
- public static final String ER_STRAY_NAMESPACE = "ER_STRAY_NAMESPACE";
- public static final String ER_COULD_NOT_LOAD_RESOURCE =
- "ER_COULD_NOT_LOAD_RESOURCE";
- public static final String ER_COULD_NOT_LOAD_METHOD_PROPERTY =
- "ER_COULD_NOT_LOAD_METHOD_PROPERTY";
- public static final String ER_SERIALIZER_NOT_CONTENTHANDLER =
- "ER_SERIALIZER_NOT_CONTENTHANDLER";
- public static final String ER_ILLEGAL_ATTRIBUTE_POSITION =
- "ER_ILLEGAL_ATTRIBUTE_POSITION";
- public static final String ER_ILLEGAL_CHARACTER = "ER_ILLEGAL_CHARACTER";
-
- public static final String ER_INVALID_PORT = "ER_INVALID_PORT";
- public static final String ER_PORT_WHEN_HOST_NULL =
- "ER_PORT_WHEN_HOST_NULL";
- public static final String ER_HOST_ADDRESS_NOT_WELLFORMED =
- "ER_HOST_ADDRESS_NOT_WELLFORMED";
- public static final String ER_SCHEME_NOT_CONFORMANT =
- "ER_SCHEME_NOT_CONFORMANT";
- public static final String ER_SCHEME_FROM_NULL_STRING =
- "ER_SCHEME_FROM_NULL_STRING";
- public static final String ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE =
- "ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE";
- public static final String ER_PATH_INVALID_CHAR = "ER_PATH_INVALID_CHAR";
- public static final String ER_NO_SCHEME_INURI = "ER_NO_SCHEME_INURI";
- public static final String ER_FRAG_INVALID_CHAR = "ER_FRAG_INVALID_CHAR";
- public static final String ER_FRAG_WHEN_PATH_NULL =
- "ER_FRAG_WHEN_PATH_NULL";
- public static final String ER_FRAG_FOR_GENERIC_URI =
- "ER_FRAG_FOR_GENERIC_URI";
- public static final String ER_NO_SCHEME_IN_URI = "ER_NO_SCHEME_IN_URI";
- public static final String ER_CANNOT_INIT_URI_EMPTY_PARMS =
- "ER_CANNOT_INIT_URI_EMPTY_PARMS";
- public static final String ER_NO_FRAGMENT_STRING_IN_PATH =
- "ER_NO_FRAGMENT_STRING_IN_PATH";
- public static final String ER_NO_QUERY_STRING_IN_PATH =
- "ER_NO_QUERY_STRING_IN_PATH";
- public static final String ER_NO_PORT_IF_NO_HOST = "ER_NO_PORT_IF_NO_HOST";
- public static final String ER_NO_USERINFO_IF_NO_HOST =
- "ER_NO_USERINFO_IF_NO_HOST";
- public static final String ER_SCHEME_REQUIRED = "ER_SCHEME_REQUIRED";
- public static final String ER_XML_VERSION_NOT_SUPPORTED = "ER_XML_VERSION_NOT_SUPPORTED";
- public static final String ER_FACTORY_PROPERTY_MISSING = "ER_FACTORY_PROPERTY_MISSING";
- public static final String ER_ENCODING_NOT_SUPPORTED = "ER_ENCODING_NOT_SUPPORTED";
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages.java b/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages.java
deleted file mode 100644
index 8588686..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xml.internal.serializer.utils;
-
-import java.util.ListResourceBundle;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * An instance of this class is a ListResourceBundle that
- * has the required getContents() method that returns
- * an array of message-key/message associations.
- * <p>
- * The message keys are defined in {@link MsgKey}. The
- * messages that those keys map to are defined here.
- * <p>
- * The messages in the English version are intended to be
- * translated.
- *
- * This class is not a public API, it is only public because it is
- * used in com.sun.org.apache.xml.internal.serializer.
- *
- * @xsl.usage internal
- */
-public class SerializerMessages extends ListResourceBundle {
-
- /*
- * This file contains error and warning messages related to
- * Serializer Error Handling.
- *
- * General notes to translators:
-
- * 1) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
-
- *
- * 2) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 3) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- *
- */
-
- /** The lookup table for error messages. */
- public Object[][] getContents() {
- Object[][] contents = new Object[][] {
- { MsgKey.BAD_MSGKEY,
- "The message key ''{0}'' is not in the message class ''{1}''" },
-
- { MsgKey.BAD_MSGFORMAT,
- "The format of message ''{0}'' in message class ''{1}'' failed." },
-
- { MsgKey.ER_SERIALIZER_NOT_CONTENTHANDLER,
- "The serializer class ''{0}'' does not implement org.xml.sax.ContentHandler." },
-
- { MsgKey.ER_RESOURCE_COULD_NOT_FIND,
- "The resource [ {0} ] could not be found.\n {1}" },
-
- { MsgKey.ER_RESOURCE_COULD_NOT_LOAD,
- "The resource [ {0} ] could not load: {1} \n {2} \t {3}" },
-
- { MsgKey.ER_BUFFER_SIZE_LESSTHAN_ZERO,
- "Buffer size <=0" },
-
- { MsgKey.ER_INVALID_UTF16_SURROGATE,
- "Invalid UTF-16 surrogate detected: {0} ?" },
-
- { MsgKey.ER_OIERROR,
- "IO error" },
-
- { MsgKey.ER_ILLEGAL_ATTRIBUTE_POSITION,
- "Cannot add attribute {0} after child nodes or before an element is produced. Attribute will be ignored." },
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- { MsgKey.ER_NAMESPACE_PREFIX,
- "Namespace for prefix ''{0}'' has not been declared." },
-
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- { MsgKey.ER_STRAY_ATTRIBUTE,
- "Attribute ''{0}'' outside of element." },
-
- /*
- * Note to translators: As with the preceding message, a namespace
- * declaration has the form of an attribute and is only permitted to
- * appear on an element. The substitution text {0} is the namespace
- * prefix and {1} is the URI that was being used in the erroneous
- * namespace declaration.
- */
- { MsgKey.ER_STRAY_NAMESPACE,
- "Namespace declaration ''{0}''=''{1}'' outside of element." },
-
- { MsgKey.ER_COULD_NOT_LOAD_RESOURCE,
- "Could not load ''{0}'' (check CLASSPATH), now using just the defaults" },
-
- { MsgKey.ER_ILLEGAL_CHARACTER,
- "Attempt to output character of integral value {0} that is not represented in specified output encoding of {1}." },
-
- { MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY,
- "Could not load the propery file ''{0}'' for output method ''{1}'' (check CLASSPATH)" },
-
- { MsgKey.ER_INVALID_PORT,
- "Invalid port number" },
-
- { MsgKey.ER_PORT_WHEN_HOST_NULL,
- "Port cannot be set when host is null" },
-
- { MsgKey.ER_HOST_ADDRESS_NOT_WELLFORMED,
- "Host is not a well formed address" },
-
- { MsgKey.ER_SCHEME_NOT_CONFORMANT,
- "The scheme is not conformant." },
-
- { MsgKey.ER_SCHEME_FROM_NULL_STRING,
- "Cannot set scheme from null string" },
-
- { MsgKey.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE,
- "Path contains invalid escape sequence" },
-
- { MsgKey.ER_PATH_INVALID_CHAR,
- "Path contains invalid character: {0}" },
-
- { MsgKey.ER_FRAG_INVALID_CHAR,
- "Fragment contains invalid character" },
-
- { MsgKey.ER_FRAG_WHEN_PATH_NULL,
- "Fragment cannot be set when path is null" },
-
- { MsgKey.ER_FRAG_FOR_GENERIC_URI,
- "Fragment can only be set for a generic URI" },
-
- { MsgKey.ER_NO_SCHEME_IN_URI,
- "No scheme found in URI" },
-
- { MsgKey.ER_CANNOT_INIT_URI_EMPTY_PARMS,
- "Cannot initialize URI with empty parameters" },
-
- { MsgKey.ER_NO_FRAGMENT_STRING_IN_PATH,
- "Fragment cannot be specified in both the path and fragment" },
-
- { MsgKey.ER_NO_QUERY_STRING_IN_PATH,
- "Query string cannot be specified in path and query string" },
-
- { MsgKey.ER_NO_PORT_IF_NO_HOST,
- "Port may not be specified if host is not specified" },
-
- { MsgKey.ER_NO_USERINFO_IF_NO_HOST,
- "Userinfo may not be specified if host is not specified" },
-
- { MsgKey.ER_XML_VERSION_NOT_SUPPORTED,
- "Warning: The version of the output document is requested to be ''{0}''. This version of XML is not supported. The version of the output document will be ''1.0''." },
-
- { MsgKey.ER_SCHEME_REQUIRED,
- "Scheme is required!" },
-
- /*
- * Note to translators: The words 'Properties' and
- * 'SerializerFactory' in this message are Java class names
- * and should not be translated.
- */
- { MsgKey.ER_FACTORY_PROPERTY_MISSING,
- "The Properties object passed to the SerializerFactory does not have a ''{0}'' property." },
-
- { MsgKey.ER_ENCODING_NOT_SUPPORTED,
- "Warning: The encoding ''{0}'' is not supported by the Java runtime." },
-
-
- };
-
- return contents;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ca.java b/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ca.java
deleted file mode 100644
index 5533793..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ca.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: SerializerMessages_ca.java,v 1.1.4.1 2005/09/08 11:03:11 suresh_emailid Exp $
- */
-
-package com.sun.org.apache.xml.internal.serializer.utils;
-
-import java.util.ListResourceBundle;
-
-public class SerializerMessages_ca extends ListResourceBundle {
- public Object[][] getContents() {
- Object[][] contents = new Object[][] {
- { MsgKey.BAD_MSGKEY,
- "The message key ''{0}'' is not in the message class ''{1}''"},
-
- { MsgKey.BAD_MSGFORMAT,
- "The format of message ''{0}'' in message class ''{1}'' failed."},
-
- { MsgKey.ER_SERIALIZER_NOT_CONTENTHANDLER,
- "The serializer class ''{0}'' does not implement org.xml.sax.ContentHandler."},
-
- { MsgKey.ER_RESOURCE_COULD_NOT_FIND,
- "The resource [ {0} ] could not be found.\n {1}"},
-
- { MsgKey.ER_RESOURCE_COULD_NOT_LOAD,
- "The resource [ {0} ] could not load: {1} \n {2} \n {3}"},
-
- { MsgKey.ER_BUFFER_SIZE_LESSTHAN_ZERO,
- "Buffer size <=0"},
-
- { MsgKey.ER_INVALID_UTF16_SURROGATE,
- "Invalid UTF-16 surrogate detected: {0} ?"},
-
- { MsgKey.ER_OIERROR,
- "IO error"},
-
- { MsgKey.ER_ILLEGAL_ATTRIBUTE_POSITION,
- "Cannot add attribute {0} after child nodes or before an element is produced. Attribute will be ignored."},
-
- { MsgKey.ER_NAMESPACE_PREFIX,
- "Namespace for prefix ''{0}'' has not been declared."},
-
- { MsgKey.ER_STRAY_ATTRIBUTE,
- "Attribute ''{0}'' outside of element."},
-
- { MsgKey.ER_STRAY_NAMESPACE,
- "Namespace declaration ''{0}''=''{1}'' outside of element."},
-
- { MsgKey.ER_COULD_NOT_LOAD_RESOURCE,
- "Could not load ''{0}'' (check CLASSPATH), now using just the defaults"},
-
- { MsgKey.ER_ILLEGAL_CHARACTER,
- "Attempt to output character of integral value {0} that is not represented in specified output encoding of {1}."},
-
- { MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY,
- "Could not load the propery file ''{0}'' for output method ''{1}'' (check CLASSPATH)"},
-
- { MsgKey.ER_INVALID_PORT,
- "Invalid port number"},
-
- { MsgKey.ER_PORT_WHEN_HOST_NULL,
- "Port cannot be set when host is null"},
-
- { MsgKey.ER_HOST_ADDRESS_NOT_WELLFORMED,
- "Host is not a well formed address"},
-
- { MsgKey.ER_SCHEME_NOT_CONFORMANT,
- "The scheme is not conformant."},
-
- { MsgKey.ER_SCHEME_FROM_NULL_STRING,
- "Cannot set scheme from null string"},
-
- { MsgKey.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE,
- "Path contains invalid escape sequence"},
-
- { MsgKey.ER_PATH_INVALID_CHAR,
- "Path contains invalid character: {0}"},
-
- { MsgKey.ER_FRAG_INVALID_CHAR,
- "Fragment contains invalid character"},
-
- { MsgKey.ER_FRAG_WHEN_PATH_NULL,
- "Fragment cannot be set when path is null"},
-
- { MsgKey.ER_FRAG_FOR_GENERIC_URI,
- "Fragment can only be set for a generic URI"},
-
- { MsgKey.ER_NO_SCHEME_IN_URI,
- "No scheme found in URI"},
-
- { MsgKey.ER_CANNOT_INIT_URI_EMPTY_PARMS,
- "Cannot initialize URI with empty parameters"},
-
- { MsgKey.ER_NO_FRAGMENT_STRING_IN_PATH,
- "Fragment cannot be specified in both the path and fragment"},
-
- { MsgKey.ER_NO_QUERY_STRING_IN_PATH,
- "Query string cannot be specified in path and query string"},
-
- { MsgKey.ER_NO_PORT_IF_NO_HOST,
- "Port may not be specified if host is not specified"},
-
- { MsgKey.ER_NO_USERINFO_IF_NO_HOST,
- "Userinfo may not be specified if host is not specified"},
-
- { MsgKey.ER_SCHEME_REQUIRED,
- "Scheme is required!"}
-
- };
- return contents;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_cs.java b/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_cs.java
deleted file mode 100644
index 5c6977c..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_cs.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: SerializerMessages_cs.java,v 1.1.4.1 2005/09/08 11:03:12 suresh_emailid Exp $
- */
-
-package com.sun.org.apache.xml.internal.serializer.utils;
-
-import java.util.ListResourceBundle;
-
-public class SerializerMessages_cs extends ListResourceBundle {
- public Object[][] getContents() {
- Object[][] contents = new Object[][] {
- // BAD_MSGKEY needs translation
- // BAD_MSGFORMAT needs translation
- { MsgKey.ER_SERIALIZER_NOT_CONTENTHANDLER,
- "T\u0159\u00edda serializace ''{0}'' neimplementuje org.xml.sax.ContentHandler."},
-
- { MsgKey.ER_RESOURCE_COULD_NOT_FIND,
- "Nelze naj\u00edt zdroj [ {0} ].\n {1}"},
-
- { MsgKey.ER_RESOURCE_COULD_NOT_LOAD,
- "Nelze zav\u00e9st zdroj [ {0} ]: {1} \n {2} \n {3}"},
-
- { MsgKey.ER_BUFFER_SIZE_LESSTHAN_ZERO,
- "Velikost vyrovn\u00e1vac\u00ed pam\u011bti <=0"},
-
- { MsgKey.ER_INVALID_UTF16_SURROGATE,
- "Byla zji\u0161t\u011bna neplatn\u00e1 n\u00e1hrada UTF-16: {0} ?"},
-
- { MsgKey.ER_OIERROR,
- "Chyba vstupu/v\u00fdstupu"},
-
- { MsgKey.ER_ILLEGAL_ATTRIBUTE_POSITION,
- "Nelze p\u0159idat atribut {0} po uzlech potomk\u016f ani p\u0159ed t\u00edm, ne\u017e je vytvo\u0159en prvek. Atribut bude ignorov\u00e1n."},
-
- { MsgKey.ER_NAMESPACE_PREFIX,
- "Obor n\u00e1zv\u016f pro p\u0159edponu ''{0}'' nebyl deklarov\u00e1n."},
-
- // ER_STRAY_ATTRIBUTE needs translation
- { MsgKey.ER_STRAY_NAMESPACE,
- "Deklarace oboru n\u00e1zv\u016f ''{0}''=''{1}'' je vn\u011b prvku."},
-
- { MsgKey.ER_COULD_NOT_LOAD_RESOURCE,
- "Nelze zav\u00e9st ''{0}'' (zkontrolujte prom\u011bnnou CLASSPATH), proto se pou\u017e\u00edvaj\u00ed pouze v\u00fdchoz\u00ed hodnoty"},
-
- // ER_ILLEGAL_CHARACTER needs translation
- { MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY,
- "Nelze na\u010d\u00edst soubor vlastnost\u00ed ''{0}'' pro v\u00fdstupn\u00ed metodu ''{1}'' (zkontrolujte prom\u011bnnou CLASSPATH)."},
-
- { MsgKey.ER_INVALID_PORT,
- "Neplatn\u00e9 \u010d\u00edslo portu."},
-
- { MsgKey.ER_PORT_WHEN_HOST_NULL,
- "M\u00e1-li hostitel hodnotu null, nelze nastavit port."},
-
- { MsgKey.ER_HOST_ADDRESS_NOT_WELLFORMED,
- "Adresa hostitele m\u00e1 nespr\u00e1vn\u00fd form\u00e1t."},
-
- { MsgKey.ER_SCHEME_NOT_CONFORMANT,
- "Sch\u00e9ma nevyhovuje."},
-
- { MsgKey.ER_SCHEME_FROM_NULL_STRING,
- "Nelze nastavit sch\u00e9ma \u0159et\u011bzce s hodnotou null."},
-
- { MsgKey.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE,
- "Cesta obsahuje neplatnou escape sekvenci"},
-
- { MsgKey.ER_PATH_INVALID_CHAR,
- "Cesta obsahuje neplatn\u00fd znak: {0}"},
-
- { MsgKey.ER_FRAG_INVALID_CHAR,
- "Fragment obsahuje neplatn\u00fd znak."},
-
- { MsgKey.ER_FRAG_WHEN_PATH_NULL,
- "M\u00e1-li cesta hodnotu null, nelze nastavit fragment."},
-
- { MsgKey.ER_FRAG_FOR_GENERIC_URI,
- "Fragment lze nastavit jen u generick\u00e9ho URI."},
-
- { MsgKey.ER_NO_SCHEME_IN_URI,
- "V URI nebylo nalezeno \u017e\u00e1dn\u00e9 sch\u00e9ma: {0}"},
-
- { MsgKey.ER_CANNOT_INIT_URI_EMPTY_PARMS,
- "URI nelze inicializovat s pr\u00e1zdn\u00fdmi parametry."},
-
- { MsgKey.ER_NO_FRAGMENT_STRING_IN_PATH,
- "Fragment nelze ur\u010dit z\u00e1rove\u0148 v cest\u011b i ve fragmentu."},
-
- { MsgKey.ER_NO_QUERY_STRING_IN_PATH,
- "V \u0159et\u011bzci cesty a dotazu nelze zadat \u0159et\u011bzec dotazu."},
-
- { MsgKey.ER_NO_PORT_IF_NO_HOST,
- "Nen\u00ed-li ur\u010den hostitel, nelze zadat port."},
-
- { MsgKey.ER_NO_USERINFO_IF_NO_HOST,
- "Nen\u00ed-li ur\u010den hostitel, nelze zadat \u00fadaje o u\u017eivateli."},
-
- { MsgKey.ER_SCHEME_REQUIRED,
- "Je vy\u017eadov\u00e1no sch\u00e9ma!"}
-
- };
- return contents;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_de.java b/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_de.java
deleted file mode 100644
index 95f6f3f..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_de.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xml.internal.serializer.utils;
-
-import java.util.ListResourceBundle;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * An instance of this class is a ListResourceBundle that
- * has the required getContents() method that returns
- * an array of message-key/message associations.
- * <p>
- * The message keys are defined in {@link MsgKey}. The
- * messages that those keys map to are defined here.
- * <p>
- * The messages in the English version are intended to be
- * translated.
- *
- * This class is not a public API, it is only public because it is
- * used in com.sun.org.apache.xml.internal.serializer.
- *
- * @xsl.usage internal
- */
-public class SerializerMessages_de extends ListResourceBundle {
-
- /*
- * This file contains error and warning messages related to
- * Serializer Error Handling.
- *
- * General notes to translators:
-
- * 1) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
-
- *
- * 2) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 3) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- *
- */
-
- /** The lookup table for error messages. */
- public Object[][] getContents() {
- Object[][] contents = new Object[][] {
- { MsgKey.BAD_MSGKEY,
- "Der Nachrichtenschl\u00FCssel \"{0}\" ist nicht in der Nachrichtenklasse \"{1}\" enthalten" },
-
- { MsgKey.BAD_MSGFORMAT,
- "Das Format der Nachricht \"{0}\" in der Nachrichtenklasse \"{1}\" war nicht erfolgreich." },
-
- { MsgKey.ER_SERIALIZER_NOT_CONTENTHANDLER,
- "Serializer-Klasse \"{0}\" implementiert org.xml.sax.ContentHandler nicht." },
-
- { MsgKey.ER_RESOURCE_COULD_NOT_FIND,
- "Ressource [ {0} ] konnte nicht gefunden werden.\n {1}" },
-
- { MsgKey.ER_RESOURCE_COULD_NOT_LOAD,
- "Ressource [ {0} ] konnte nicht geladen werden: {1} \n {2} \t {3}" },
-
- { MsgKey.ER_BUFFER_SIZE_LESSTHAN_ZERO,
- "Puffergr\u00F6\u00DFe <=0" },
-
- { MsgKey.ER_INVALID_UTF16_SURROGATE,
- "Ung\u00FCltige UTF-16-Ersetzung festgestellt: {0}?" },
-
- { MsgKey.ER_OIERROR,
- "I/O-Fehler" },
-
- { MsgKey.ER_ILLEGAL_ATTRIBUTE_POSITION,
- "Attribut {0} kann nicht nach untergeordneten Knoten oder vor dem Erstellen eines Elements hinzugef\u00FCgt werden. Attribut wird ignoriert." },
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- { MsgKey.ER_NAMESPACE_PREFIX,
- "Namespace f\u00FCr Pr\u00E4fix \"{0}\" wurde nicht deklariert." },
-
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- { MsgKey.ER_STRAY_ATTRIBUTE,
- "Attribut \"{0}\" au\u00DFerhalb des Elements." },
-
- /*
- * Note to translators: As with the preceding message, a namespace
- * declaration has the form of an attribute and is only permitted to
- * appear on an element. The substitution text {0} is the namespace
- * prefix and {1} is the URI that was being used in the erroneous
- * namespace declaration.
- */
- { MsgKey.ER_STRAY_NAMESPACE,
- "Namespace-Deklaration {0}={1} au\u00DFerhalb des Elements." },
-
- { MsgKey.ER_COULD_NOT_LOAD_RESOURCE,
- "\"{0}\" konnte nicht geladen werden (CLASSPATH pr\u00FCfen). Die Standardwerte werden verwendet" },
-
- { MsgKey.ER_ILLEGAL_CHARACTER,
- "Versuch, Zeichen mit Integralwert {0} auszugeben, das nicht in der speziellen Ausgabecodierung von {1} dargestellt wird." },
-
- { MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY,
- "Property-Datei \"{0}\" konnte f\u00FCr Ausgabemethode \"{1}\" nicht geladen werden (CLASSPATH pr\u00FCfen)" },
-
- { MsgKey.ER_INVALID_PORT,
- "Ung\u00FCltige Portnummer" },
-
- { MsgKey.ER_PORT_WHEN_HOST_NULL,
- "Port kann nicht festgelegt werden, wenn der Host null ist" },
-
- { MsgKey.ER_HOST_ADDRESS_NOT_WELLFORMED,
- "Host ist keine wohlgeformte Adresse" },
-
- { MsgKey.ER_SCHEME_NOT_CONFORMANT,
- "Schema ist nicht konform." },
-
- { MsgKey.ER_SCHEME_FROM_NULL_STRING,
- "Schema kann nicht von Nullzeichenfolge festgelegt werden" },
-
- { MsgKey.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE,
- "Pfad enth\u00E4lt eine ung\u00FCltige Escapesequenz" },
-
- { MsgKey.ER_PATH_INVALID_CHAR,
- "Pfad enth\u00E4lt ung\u00FCltiges Zeichen: {0}" },
-
- { MsgKey.ER_FRAG_INVALID_CHAR,
- "Fragment enth\u00E4lt ein ung\u00FCltiges Zeichen" },
-
- { MsgKey.ER_FRAG_WHEN_PATH_NULL,
- "Fragment kann nicht festgelegt werden, wenn der Pfad null ist" },
-
- { MsgKey.ER_FRAG_FOR_GENERIC_URI,
- "Fragment kann nur f\u00FCr einen generischen URI festgelegt werden" },
-
- { MsgKey.ER_NO_SCHEME_IN_URI,
- "Kein Schema gefunden in URI" },
-
- { MsgKey.ER_CANNOT_INIT_URI_EMPTY_PARMS,
- "URI kann nicht mit leeren Parametern initialisiert werden" },
-
- { MsgKey.ER_NO_FRAGMENT_STRING_IN_PATH,
- "Fragment kann nicht im Pfad und im Fragment angegeben werden" },
-
- { MsgKey.ER_NO_QUERY_STRING_IN_PATH,
- "Abfragezeichenfolge kann nicht im Pfad und in der Abfragezeichenfolge angegeben werden" },
-
- { MsgKey.ER_NO_PORT_IF_NO_HOST,
- "Port kann nicht angegeben werden, wenn der Host nicht angegeben wurde" },
-
- { MsgKey.ER_NO_USERINFO_IF_NO_HOST,
- "Benutzerinformationen k\u00F6nnen nicht angegeben werden, wenn der Host nicht angegeben wurde" },
-
- { MsgKey.ER_XML_VERSION_NOT_SUPPORTED,
- "Warnung: Die Version des Ausgabedokuments soll \"{0}\" sein. Diese Version von XML wird nicht unterst\u00FCtzt. Die Version des Ausgabedokuments wird \"1.0\" sein." },
-
- { MsgKey.ER_SCHEME_REQUIRED,
- "Schema ist erforderlich." },
-
- /*
- * Note to translators: The words 'Properties' and
- * 'SerializerFactory' in this message are Java class names
- * and should not be translated.
- */
- { MsgKey.ER_FACTORY_PROPERTY_MISSING,
- "Das an die SerializerFactory \u00FCbergebene Properties-Objekt verf\u00FCgt \u00FCber keine Eigenschaft \"{0}\"." },
-
- { MsgKey.ER_ENCODING_NOT_SUPPORTED,
- "Warnung: Die Codierung \"{0}\" wird nicht von der Java-Laufzeit unterst\u00FCtzt." },
-
-
- };
-
- return contents;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_en.java b/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_en.java
deleted file mode 100644
index 3789a17..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_en.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: SerializerMessages_en.java,v 1.1.4.1 2005/09/08 11:03:13 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.serializer.utils;
-
-
-/**
- * Default implementation. This is just an empty class.
- * @xsl.usage internal
- */
-public final class SerializerMessages_en extends SerializerMessages
-{
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_es.java b/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_es.java
deleted file mode 100644
index 57e801e..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_es.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xml.internal.serializer.utils;
-
-import java.util.ListResourceBundle;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * An instance of this class is a ListResourceBundle that
- * has the required getContents() method that returns
- * an array of message-key/message associations.
- * <p>
- * The message keys are defined in {@link MsgKey}. The
- * messages that those keys map to are defined here.
- * <p>
- * The messages in the English version are intended to be
- * translated.
- *
- * This class is not a public API, it is only public because it is
- * used in com.sun.org.apache.xml.internal.serializer.
- *
- * @xsl.usage internal
- */
-public class SerializerMessages_es extends ListResourceBundle {
-
- /*
- * This file contains error and warning messages related to
- * Serializer Error Handling.
- *
- * General notes to translators:
-
- * 1) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
-
- *
- * 2) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 3) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- *
- */
-
- /** The lookup table for error messages. */
- public Object[][] getContents() {
- Object[][] contents = new Object[][] {
- { MsgKey.BAD_MSGKEY,
- "La clave de mensaje ''{0}'' no est\u00E1 en la clase de mensaje ''{1}''" },
-
- { MsgKey.BAD_MSGFORMAT,
- "Fallo de formato del mensaje ''{0}'' en la clase de mensaje ''{1}''." },
-
- { MsgKey.ER_SERIALIZER_NOT_CONTENTHANDLER,
- "La clase de serializador ''{0}'' no implanta org.xml.sax.ContentHandler." },
-
- { MsgKey.ER_RESOURCE_COULD_NOT_FIND,
- "No se ha encontrado el recurso [ {0} ].\n {1}" },
-
- { MsgKey.ER_RESOURCE_COULD_NOT_LOAD,
- "No se ha podido cargar el recurso [ {0} ]: {1} \n {2} \t {3}" },
-
- { MsgKey.ER_BUFFER_SIZE_LESSTHAN_ZERO,
- "Tama\u00F1o de buffer menor o igual que 0" },
-
- { MsgKey.ER_INVALID_UTF16_SURROGATE,
- "\u00BFSe ha detectado un sustituto UTF-16 no v\u00E1lido: {0}?" },
-
- { MsgKey.ER_OIERROR,
- "Error de E/S" },
-
- { MsgKey.ER_ILLEGAL_ATTRIBUTE_POSITION,
- "No se puede agregar el atributo {0} despu\u00E9s de nodos secundarios o antes de que se produzca un elemento. Se ignorar\u00E1 el atributo." },
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- { MsgKey.ER_NAMESPACE_PREFIX,
- "No se ha declarado el espacio de nombres para el prefijo ''{0}''." },
-
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- { MsgKey.ER_STRAY_ATTRIBUTE,
- "El atributo ''{0}'' est\u00E1 fuera del elemento." },
-
- /*
- * Note to translators: As with the preceding message, a namespace
- * declaration has the form of an attribute and is only permitted to
- * appear on an element. The substitution text {0} is the namespace
- * prefix and {1} is the URI that was being used in the erroneous
- * namespace declaration.
- */
- { MsgKey.ER_STRAY_NAMESPACE,
- "Declaraci\u00F3n del espacio de nombres ''{0}''=''{1}'' fuera del elemento." },
-
- { MsgKey.ER_COULD_NOT_LOAD_RESOURCE,
- "No se ha podido cargar ''{0}'' (compruebe la CLASSPATH), ahora s\u00F3lo se est\u00E1n utilizando los valores por defecto" },
-
- { MsgKey.ER_ILLEGAL_CHARACTER,
- "Intento de realizar la salida del car\u00E1cter del valor integral {0}, que no est\u00E1 representado en la codificaci\u00F3n de salida de {1}." },
-
- { MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY,
- "No se ha podido cargar el archivo de propiedades ''{0}'' para el m\u00E9todo de salida ''{1}'' (compruebe la CLASSPATH)" },
-
- { MsgKey.ER_INVALID_PORT,
- "N\u00FAmero de puerto no v\u00E1lido" },
-
- { MsgKey.ER_PORT_WHEN_HOST_NULL,
- "No se puede definir el puerto si el host es nulo" },
-
- { MsgKey.ER_HOST_ADDRESS_NOT_WELLFORMED,
- "El formato de la direcci\u00F3n de host no es correcto" },
-
- { MsgKey.ER_SCHEME_NOT_CONFORMANT,
- "El esquema no es v\u00E1lido." },
-
- { MsgKey.ER_SCHEME_FROM_NULL_STRING,
- "No se puede definir un esquema a partir de una cadena nula" },
-
- { MsgKey.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE,
- "La ruta de acceso contiene una secuencia de escape no v\u00E1lida" },
-
- { MsgKey.ER_PATH_INVALID_CHAR,
- "La ruta de acceso contiene un car\u00E1cter no v\u00E1lido: {0}" },
-
- { MsgKey.ER_FRAG_INVALID_CHAR,
- "El fragmento contiene un car\u00E1cter no v\u00E1lido" },
-
- { MsgKey.ER_FRAG_WHEN_PATH_NULL,
- "No se puede definir el fragmento si la ruta de acceso es nula" },
-
- { MsgKey.ER_FRAG_FOR_GENERIC_URI,
- "S\u00F3lo se puede definir el fragmento para un URI gen\u00E9rico" },
-
- { MsgKey.ER_NO_SCHEME_IN_URI,
- "No se ha encontrado un esquema en el URI" },
-
- { MsgKey.ER_CANNOT_INIT_URI_EMPTY_PARMS,
- "No se puede inicializar el URI con par\u00E1metros vac\u00EDos" },
-
- { MsgKey.ER_NO_FRAGMENT_STRING_IN_PATH,
- "No se puede especificar el fragmento en la ruta de acceso y en el fragmento" },
-
- { MsgKey.ER_NO_QUERY_STRING_IN_PATH,
- "No se puede especificar la cadena de consulta en la ruta de acceso y en la cadena de consulta" },
-
- { MsgKey.ER_NO_PORT_IF_NO_HOST,
- "No se puede especificar el puerto si no se ha especificado el host" },
-
- { MsgKey.ER_NO_USERINFO_IF_NO_HOST,
- "No se puede especificar la informaci\u00F3n de usuario si no se ha especificado el host" },
-
- { MsgKey.ER_XML_VERSION_NOT_SUPPORTED,
- "Advertencia: es necesario que la versi\u00F3n del documento de salida sea ''{0}''. Esta versi\u00F3n de XML no est\u00E1 soportada. La versi\u00F3n del documento de salida ser\u00E1 ''1.0''." },
-
- { MsgKey.ER_SCHEME_REQUIRED,
- "Se necesita un esquema." },
-
- /*
- * Note to translators: The words 'Properties' and
- * 'SerializerFactory' in this message are Java class names
- * and should not be translated.
- */
- { MsgKey.ER_FACTORY_PROPERTY_MISSING,
- "El objeto de propiedades transferido a SerializerFactory no tiene una propiedad ''{0}''." },
-
- { MsgKey.ER_ENCODING_NOT_SUPPORTED,
- "Advertencia: el tiempo de ejecuci\u00F3n de Java no soporta la codificaci\u00F3n ''{0}''." },
-
-
- };
-
- return contents;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_fr.java b/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_fr.java
deleted file mode 100644
index 6a6424d..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_fr.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xml.internal.serializer.utils;
-
-import java.util.ListResourceBundle;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * An instance of this class is a ListResourceBundle that
- * has the required getContents() method that returns
- * an array of message-key/message associations.
- * <p>
- * The message keys are defined in {@link MsgKey}. The
- * messages that those keys map to are defined here.
- * <p>
- * The messages in the English version are intended to be
- * translated.
- *
- * This class is not a public API, it is only public because it is
- * used in com.sun.org.apache.xml.internal.serializer.
- *
- * @xsl.usage internal
- */
-public class SerializerMessages_fr extends ListResourceBundle {
-
- /*
- * This file contains error and warning messages related to
- * Serializer Error Handling.
- *
- * General notes to translators:
-
- * 1) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
-
- *
- * 2) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 3) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- *
- */
-
- /** The lookup table for error messages. */
- public Object[][] getContents() {
- Object[][] contents = new Object[][] {
- { MsgKey.BAD_MSGKEY,
- "La cl\u00E9 de message ''{0}'' ne figure pas dans la classe de messages ''{1}''" },
-
- { MsgKey.BAD_MSGFORMAT,
- "Echec du format de message ''{0}'' dans la classe de messages ''{1}''." },
-
- { MsgKey.ER_SERIALIZER_NOT_CONTENTHANDLER,
- "La classe de serializer ''{0}'' n''impl\u00E9mente pas org.xml.sax.ContentHandler." },
-
- { MsgKey.ER_RESOURCE_COULD_NOT_FIND,
- "La ressource [ {0} ] est introuvable.\n {1}" },
-
- { MsgKey.ER_RESOURCE_COULD_NOT_LOAD,
- "La ressource [ {0} ] n''a pas pu charger : {1} \n {2} \t {3}" },
-
- { MsgKey.ER_BUFFER_SIZE_LESSTHAN_ZERO,
- "Taille du tampon <=0" },
-
- { MsgKey.ER_INVALID_UTF16_SURROGATE,
- "Substitut UTF-16 non valide d\u00E9tect\u00E9 : {0} ?" },
-
- { MsgKey.ER_OIERROR,
- "Erreur d'E/S" },
-
- { MsgKey.ER_ILLEGAL_ATTRIBUTE_POSITION,
- "Impossible d''ajouter l''attribut {0} apr\u00E8s des noeuds enfant ou avant la production d''un \u00E9l\u00E9ment. L''attribut est ignor\u00E9." },
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- { MsgKey.ER_NAMESPACE_PREFIX,
- "L''espace de noms du pr\u00E9fixe ''{0}'' n''a pas \u00E9t\u00E9 d\u00E9clar\u00E9." },
-
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- { MsgKey.ER_STRAY_ATTRIBUTE,
- "Attribut ''{0}'' en dehors de l''\u00E9l\u00E9ment." },
-
- /*
- * Note to translators: As with the preceding message, a namespace
- * declaration has the form of an attribute and is only permitted to
- * appear on an element. The substitution text {0} is the namespace
- * prefix and {1} is the URI that was being used in the erroneous
- * namespace declaration.
- */
- { MsgKey.ER_STRAY_NAMESPACE,
- "La d\u00E9claration d''espace de noms ''{0}''=''{1}'' est \u00E0 l''ext\u00E9rieur de l''\u00E9l\u00E9ment." },
-
- { MsgKey.ER_COULD_NOT_LOAD_RESOURCE,
- "Impossible de charger ''{0}'' (v\u00E9rifier CLASSPATH), les valeurs par d\u00E9faut sont donc employ\u00E9es" },
-
- { MsgKey.ER_ILLEGAL_CHARACTER,
- "Tentative de sortie d''un caract\u00E8re avec une valeur enti\u00E8re {0}, non repr\u00E9sent\u00E9 dans l''encodage de sortie sp\u00E9cifi\u00E9 pour {1}." },
-
- { MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY,
- "Impossible de charger le fichier de propri\u00E9t\u00E9s ''{0}'' pour la m\u00E9thode de sortie ''{1}'' (v\u00E9rifier CLASSPATH)" },
-
- { MsgKey.ER_INVALID_PORT,
- "Num\u00E9ro de port non valide" },
-
- { MsgKey.ER_PORT_WHEN_HOST_NULL,
- "Impossible de d\u00E9finir le port quand l'h\u00F4te est NULL" },
-
- { MsgKey.ER_HOST_ADDRESS_NOT_WELLFORMED,
- "Le format de l'adresse de l'h\u00F4te n'est pas correct" },
-
- { MsgKey.ER_SCHEME_NOT_CONFORMANT,
- "Le mod\u00E8le n'est pas conforme." },
-
- { MsgKey.ER_SCHEME_FROM_NULL_STRING,
- "Impossible de d\u00E9finir le mod\u00E8le \u00E0 partir de la cha\u00EEne NULL" },
-
- { MsgKey.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE,
- "Le chemin d'acc\u00E8s contient une s\u00E9quence d'\u00E9chappement non valide" },
-
- { MsgKey.ER_PATH_INVALID_CHAR,
- "Le chemin contient un caract\u00E8re non valide : {0}" },
-
- { MsgKey.ER_FRAG_INVALID_CHAR,
- "Le fragment contient un caract\u00E8re non valide" },
-
- { MsgKey.ER_FRAG_WHEN_PATH_NULL,
- "Impossible de d\u00E9finir le fragment quand le chemin d'acc\u00E8s est NULL" },
-
- { MsgKey.ER_FRAG_FOR_GENERIC_URI,
- "Le fragment ne peut \u00EAtre d\u00E9fini que pour un URI g\u00E9n\u00E9rique" },
-
- { MsgKey.ER_NO_SCHEME_IN_URI,
- "Mod\u00E8le introuvable dans l'URI" },
-
- { MsgKey.ER_CANNOT_INIT_URI_EMPTY_PARMS,
- "Impossible d'initialiser l'URI avec des param\u00E8tres vides" },
-
- { MsgKey.ER_NO_FRAGMENT_STRING_IN_PATH,
- "Le fragment ne doit pas \u00EAtre indiqu\u00E9 \u00E0 la fois dans le chemin et dans le fragment" },
-
- { MsgKey.ER_NO_QUERY_STRING_IN_PATH,
- "La cha\u00EEne de requ\u00EAte ne doit pas figurer dans un chemin et une cha\u00EEne de requ\u00EAte" },
-
- { MsgKey.ER_NO_PORT_IF_NO_HOST,
- "Le port peut ne pas \u00EAtre sp\u00E9cifi\u00E9 si l'h\u00F4te ne l'est pas" },
-
- { MsgKey.ER_NO_USERINFO_IF_NO_HOST,
- "Userinfo peut ne pas \u00EAtre sp\u00E9cifi\u00E9 si l'h\u00F4te ne l'est pas" },
-
- { MsgKey.ER_XML_VERSION_NOT_SUPPORTED,
- "Avertissement : la version du document de sortie doit \u00EAtre ''{0}''. Cette version XML n''est pas prise en charge. La version du document de sortie sera ''1.0''." },
-
- { MsgKey.ER_SCHEME_REQUIRED,
- "Mod\u00E8le obligatoire." },
-
- /*
- * Note to translators: The words 'Properties' and
- * 'SerializerFactory' in this message are Java class names
- * and should not be translated.
- */
- { MsgKey.ER_FACTORY_PROPERTY_MISSING,
- "L''objet de propri\u00E9t\u00E9s transmis \u00E0 SerializerFactory ne comporte aucune propri\u00E9t\u00E9 ''{0}''." },
-
- { MsgKey.ER_ENCODING_NOT_SUPPORTED,
- "Avertissement : l''encodage ''{0}'' n''est pas pris en charge par l''ex\u00E9cution Java." },
-
-
- };
-
- return contents;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_it.java b/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_it.java
deleted file mode 100644
index fc5ee8e..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_it.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xml.internal.serializer.utils;
-
-import java.util.ListResourceBundle;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * An instance of this class is a ListResourceBundle that
- * has the required getContents() method that returns
- * an array of message-key/message associations.
- * <p>
- * The message keys are defined in {@link MsgKey}. The
- * messages that those keys map to are defined here.
- * <p>
- * The messages in the English version are intended to be
- * translated.
- *
- * This class is not a public API, it is only public because it is
- * used in com.sun.org.apache.xml.internal.serializer.
- *
- * @xsl.usage internal
- */
-public class SerializerMessages_it extends ListResourceBundle {
-
- /*
- * This file contains error and warning messages related to
- * Serializer Error Handling.
- *
- * General notes to translators:
-
- * 1) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
-
- *
- * 2) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 3) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- *
- */
-
- /** The lookup table for error messages. */
- public Object[][] getContents() {
- Object[][] contents = new Object[][] {
- { MsgKey.BAD_MSGKEY,
- "La chiave di messaggio ''{0}'' non si trova nella classe messaggio ''{1}''" },
-
- { MsgKey.BAD_MSGFORMAT,
- "Formato di messaggio ''{0}'' in classe messaggio ''{1}'' non riuscito." },
-
- { MsgKey.ER_SERIALIZER_NOT_CONTENTHANDLER,
- "La classe serializzatore ''{0}'' non implementa org.xml.sax.ContentHandler." },
-
- { MsgKey.ER_RESOURCE_COULD_NOT_FIND,
- "Risorsa [ {0} ] non trovata.\n {1}" },
-
- { MsgKey.ER_RESOURCE_COULD_NOT_LOAD,
- "Impossibile caricare la risorsa [ {0} ]: {1} \n {2} \t {3}" },
-
- { MsgKey.ER_BUFFER_SIZE_LESSTHAN_ZERO,
- "Dimensione buffer <=0" },
-
- { MsgKey.ER_INVALID_UTF16_SURROGATE,
- "Rilevato surrogato UTF-16 non valido: {0}?" },
-
- { MsgKey.ER_OIERROR,
- "Errore di I/O" },
-
- { MsgKey.ER_ILLEGAL_ATTRIBUTE_POSITION,
- "Impossibile aggiungere l''attributo {0} dopo i nodi figlio o prima che sia prodotto un elemento. L''attributo verr\u00E0 ignorato." },
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- { MsgKey.ER_NAMESPACE_PREFIX,
- "Lo spazio di nomi per il prefisso ''{0}'' non \u00E8 stato dichiarato." },
-
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- { MsgKey.ER_STRAY_ATTRIBUTE,
- "Attributo ''{0}'' al di fuori dell''elemento." },
-
- /*
- * Note to translators: As with the preceding message, a namespace
- * declaration has the form of an attribute and is only permitted to
- * appear on an element. The substitution text {0} is the namespace
- * prefix and {1} is the URI that was being used in the erroneous
- * namespace declaration.
- */
- { MsgKey.ER_STRAY_NAMESPACE,
- "Dichiarazione dello spazio di nomi ''{0}''=''{1}'' al di fuori dell''elemento." },
-
- { MsgKey.ER_COULD_NOT_LOAD_RESOURCE,
- "Impossibile caricare ''{0}'' (verificare CLASSPATH); verranno utilizzati i valori predefiniti" },
-
- { MsgKey.ER_ILLEGAL_CHARACTER,
- "Tentativo di eseguire l''output di un carattere di valore integrale {0} non rappresentato nella codifica di output {1} specificata." },
-
- { MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY,
- "Impossibile caricare il file delle propriet\u00E0 ''{0}'' per il metodo di emissione ''{1}'' (verificare CLASSPATH)" },
-
- { MsgKey.ER_INVALID_PORT,
- "Numero di porta non valido" },
-
- { MsgKey.ER_PORT_WHEN_HOST_NULL,
- "La porta non pu\u00F2 essere impostata se l'host \u00E8 nullo" },
-
- { MsgKey.ER_HOST_ADDRESS_NOT_WELLFORMED,
- "Host non \u00E8 un indirizzo corretto" },
-
- { MsgKey.ER_SCHEME_NOT_CONFORMANT,
- "Lo schema non \u00E8 conforme." },
-
- { MsgKey.ER_SCHEME_FROM_NULL_STRING,
- "Impossibile impostare lo schema da una stringa nulla" },
-
- { MsgKey.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE,
- "Il percorso contiene sequenza di escape non valida" },
-
- { MsgKey.ER_PATH_INVALID_CHAR,
- "Il percorso contiene un carattere non valido: {0}" },
-
- { MsgKey.ER_FRAG_INVALID_CHAR,
- "Il frammento contiene un carattere non valido" },
-
- { MsgKey.ER_FRAG_WHEN_PATH_NULL,
- "Il frammento non pu\u00F2 essere impostato se il percorso \u00E8 nullo" },
-
- { MsgKey.ER_FRAG_FOR_GENERIC_URI,
- "Il frammento pu\u00F2 essere impostato solo per un URI generico" },
-
- { MsgKey.ER_NO_SCHEME_IN_URI,
- "Nessuno schema trovato nell'URI" },
-
- { MsgKey.ER_CANNOT_INIT_URI_EMPTY_PARMS,
- "Impossibile inizializzare l'URI con i parametri vuoti" },
-
- { MsgKey.ER_NO_FRAGMENT_STRING_IN_PATH,
- "Il frammento non pu\u00F2 essere specificato sia nel percorso che nel frammento" },
-
- { MsgKey.ER_NO_QUERY_STRING_IN_PATH,
- "La stringa di query non pu\u00F2 essere specificata nella stringa di percorso e query." },
-
- { MsgKey.ER_NO_PORT_IF_NO_HOST,
- "La porta non pu\u00F2 essere specificata se l'host non \u00E8 specificato" },
-
- { MsgKey.ER_NO_USERINFO_IF_NO_HOST,
- "Userinfo non pu\u00F2 essere specificato se l'host non \u00E8 specificato" },
-
- { MsgKey.ER_XML_VERSION_NOT_SUPPORTED,
- "Avvertenza: la versione del documento di output deve essere ''{0}''. Questa versione di XML non \u00E8 supportata. La versione del documento di output sar\u00E0 ''1.0''." },
-
- { MsgKey.ER_SCHEME_REQUIRED,
- "Lo schema \u00E8 obbligatorio." },
-
- /*
- * Note to translators: The words 'Properties' and
- * 'SerializerFactory' in this message are Java class names
- * and should not be translated.
- */
- { MsgKey.ER_FACTORY_PROPERTY_MISSING,
- "L''oggetto Properties passato a SerializerFactory non dispone di una propriet\u00E0 ''{0}''." },
-
- { MsgKey.ER_ENCODING_NOT_SUPPORTED,
- "Avvertenza: la codifica ''{0}'' non \u00E8 supportata da Java Runtime." },
-
-
- };
-
- return contents;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ja.java b/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ja.java
deleted file mode 100644
index ea74c2f..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ja.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xml.internal.serializer.utils;
-
-import java.util.ListResourceBundle;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * An instance of this class is a ListResourceBundle that
- * has the required getContents() method that returns
- * an array of message-key/message associations.
- * <p>
- * The message keys are defined in {@link MsgKey}. The
- * messages that those keys map to are defined here.
- * <p>
- * The messages in the English version are intended to be
- * translated.
- *
- * This class is not a public API, it is only public because it is
- * used in com.sun.org.apache.xml.internal.serializer.
- *
- * @xsl.usage internal
- */
-public class SerializerMessages_ja extends ListResourceBundle {
-
- /*
- * This file contains error and warning messages related to
- * Serializer Error Handling.
- *
- * General notes to translators:
-
- * 1) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
-
- *
- * 2) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 3) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- *
- */
-
- /** The lookup table for error messages. */
- public Object[][] getContents() {
- Object[][] contents = new Object[][] {
- { MsgKey.BAD_MSGKEY,
- "\u30E1\u30C3\u30BB\u30FC\u30B8\u30FB\u30AD\u30FC''{0}''\u306F\u3001\u30E1\u30C3\u30BB\u30FC\u30B8\u30FB\u30AF\u30E9\u30B9''{1}''\u3067\u306F\u3042\u308A\u307E\u305B\u3093" },
-
- { MsgKey.BAD_MSGFORMAT,
- "\u30E1\u30C3\u30BB\u30FC\u30B8\u30FB\u30AF\u30E9\u30B9''{1}''\u306E\u30E1\u30C3\u30BB\u30FC\u30B8''{0}''\u306E\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u304C\u5931\u6557\u3057\u307E\u3057\u305F\u3002" },
-
- { MsgKey.ER_SERIALIZER_NOT_CONTENTHANDLER,
- "\u30B7\u30EA\u30A2\u30E9\u30A4\u30B6\u30FB\u30AF\u30E9\u30B9''{0}''\u306Forg.xml.sax.ContentHandler\u3092\u5B9F\u88C5\u3057\u307E\u305B\u3093\u3002" },
-
- { MsgKey.ER_RESOURCE_COULD_NOT_FIND,
- "\u30EA\u30BD\u30FC\u30B9[ {0} ]\u306F\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002\n {1}" },
-
- { MsgKey.ER_RESOURCE_COULD_NOT_LOAD,
- "\u30EA\u30BD\u30FC\u30B9[ {0} ]\u3092\u30ED\u30FC\u30C9\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F: {1} \n {2} \t {3}" },
-
- { MsgKey.ER_BUFFER_SIZE_LESSTHAN_ZERO,
- "\u30D0\u30C3\u30D5\u30A1\u30FB\u30B5\u30A4\u30BA<=0" },
-
- { MsgKey.ER_INVALID_UTF16_SURROGATE,
- "\u7121\u52B9\u306AUTF-16\u30B5\u30ED\u30B2\u30FC\u30C8\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F: {0}\u3002" },
-
- { MsgKey.ER_OIERROR,
- "IO\u30A8\u30E9\u30FC" },
-
- { MsgKey.ER_ILLEGAL_ATTRIBUTE_POSITION,
- "\u5B50\u30CE\u30FC\u30C9\u306E\u5F8C\u307E\u305F\u306F\u8981\u7D20\u304C\u751F\u6210\u3055\u308C\u308B\u524D\u306B\u5C5E\u6027{0}\u3092\u8FFD\u52A0\u3067\u304D\u307E\u305B\u3093\u3002\u5C5E\u6027\u306F\u7121\u8996\u3055\u308C\u307E\u3059\u3002" },
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- { MsgKey.ER_NAMESPACE_PREFIX,
- "\u63A5\u982D\u8F9E''{0}''\u306E\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u304C\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002" },
-
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- { MsgKey.ER_STRAY_ATTRIBUTE,
- "\u5C5E\u6027''{0}''\u304C\u8981\u7D20\u306E\u5916\u5074\u306B\u3042\u308A\u307E\u3059\u3002" },
-
- /*
- * Note to translators: As with the preceding message, a namespace
- * declaration has the form of an attribute and is only permitted to
- * appear on an element. The substitution text {0} is the namespace
- * prefix and {1} is the URI that was being used in the erroneous
- * namespace declaration.
- */
- { MsgKey.ER_STRAY_NAMESPACE,
- "\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u5BA3\u8A00''{0}''=''{1}''\u304C\u8981\u7D20\u306E\u5916\u5074\u306B\u3042\u308A\u307E\u3059\u3002" },
-
- { MsgKey.ER_COULD_NOT_LOAD_RESOURCE,
- "''{0}''\u3092\u30ED\u30FC\u30C9\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F(CLASSPATH\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044)\u3002\u73FE\u5728\u306F\u5358\u306B\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u4F7F\u7528\u3057\u3066\u3044\u307E\u3059" },
-
- { MsgKey.ER_ILLEGAL_CHARACTER,
- "{1}\u306E\u6307\u5B9A\u3055\u308C\u305F\u51FA\u529B\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u3067\u793A\u3055\u308C\u306A\u3044\u6574\u6570\u5024{0}\u306E\u6587\u5B57\u3092\u51FA\u529B\u3057\u3088\u3046\u3068\u3057\u307E\u3057\u305F\u3002" },
-
- { MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY,
- "\u51FA\u529B\u30E1\u30BD\u30C3\u30C9''{1}''\u306E\u30D7\u30ED\u30D1\u30C6\u30A3\u30FB\u30D5\u30A1\u30A4\u30EB''{0}''\u3092\u30ED\u30FC\u30C9\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F(CLASSPATH\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044)" },
-
- { MsgKey.ER_INVALID_PORT,
- "\u7121\u52B9\u306A\u30DD\u30FC\u30C8\u756A\u53F7" },
-
- { MsgKey.ER_PORT_WHEN_HOST_NULL,
- "\u30DB\u30B9\u30C8\u304Cnull\u306E\u5834\u5408\u306F\u30DD\u30FC\u30C8\u3092\u8A2D\u5B9A\u3067\u304D\u307E\u305B\u3093" },
-
- { MsgKey.ER_HOST_ADDRESS_NOT_WELLFORMED,
- "\u30DB\u30B9\u30C8\u306F\u6574\u5F62\u5F0F\u306E\u30A2\u30C9\u30EC\u30B9\u3067\u306F\u3042\u308A\u307E\u305B\u3093" },
-
- { MsgKey.ER_SCHEME_NOT_CONFORMANT,
- "\u30B9\u30AD\u30FC\u30E0\u304C\u6574\u5408\u3057\u3066\u3044\u307E\u305B\u3093\u3002" },
-
- { MsgKey.ER_SCHEME_FROM_NULL_STRING,
- "null\u6587\u5B57\u5217\u304B\u3089\u306F\u30B9\u30AD\u30FC\u30E0\u3092\u8A2D\u5B9A\u3067\u304D\u307E\u305B\u3093" },
-
- { MsgKey.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE,
- "\u30D1\u30B9\u306B\u7121\u52B9\u306A\u30A8\u30B9\u30B1\u30FC\u30D7\u30FB\u30B7\u30FC\u30B1\u30F3\u30B9\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059" },
-
- { MsgKey.ER_PATH_INVALID_CHAR,
- "\u30D1\u30B9\u306B\u7121\u52B9\u306A\u6587\u5B57\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059: {0}" },
-
- { MsgKey.ER_FRAG_INVALID_CHAR,
- "\u30D5\u30E9\u30B0\u30E1\u30F3\u30C8\u306B\u7121\u52B9\u6587\u5B57\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059" },
-
- { MsgKey.ER_FRAG_WHEN_PATH_NULL,
- "\u30D1\u30B9\u304Cnull\u306E\u5834\u5408\u306F\u30D5\u30E9\u30B0\u30E1\u30F3\u30C8\u3092\u8A2D\u5B9A\u3067\u304D\u307E\u305B\u3093" },
-
- { MsgKey.ER_FRAG_FOR_GENERIC_URI,
- "\u6C4E\u7528URI\u306E\u30D5\u30E9\u30B0\u30E1\u30F3\u30C8\u306E\u307F\u8A2D\u5B9A\u3067\u304D\u307E\u3059" },
-
- { MsgKey.ER_NO_SCHEME_IN_URI,
- "\u30B9\u30AD\u30FC\u30E0\u304CURI\u306B\u898B\u3064\u304B\u308A\u307E\u305B\u3093" },
-
- { MsgKey.ER_CANNOT_INIT_URI_EMPTY_PARMS,
- "URI\u306F\u7A7A\u306E\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u4F7F\u7528\u3057\u3066\u521D\u671F\u5316\u3067\u304D\u307E\u305B\u3093" },
-
- { MsgKey.ER_NO_FRAGMENT_STRING_IN_PATH,
- "\u30D5\u30E9\u30B0\u30E1\u30F3\u30C8\u306F\u30D1\u30B9\u3068\u30D5\u30E9\u30B0\u30E1\u30F3\u30C8\u306E\u4E21\u65B9\u306B\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093" },
-
- { MsgKey.ER_NO_QUERY_STRING_IN_PATH,
- "\u554F\u5408\u305B\u6587\u5B57\u5217\u306F\u30D1\u30B9\u304A\u3088\u3073\u554F\u5408\u305B\u6587\u5B57\u5217\u5185\u306B\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093" },
-
- { MsgKey.ER_NO_PORT_IF_NO_HOST,
- "\u30DB\u30B9\u30C8\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u306A\u3044\u5834\u5408\u306F\u30DD\u30FC\u30C8\u3092\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093" },
-
- { MsgKey.ER_NO_USERINFO_IF_NO_HOST,
- "\u30DB\u30B9\u30C8\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u306A\u3044\u5834\u5408\u306FUserinfo\u3092\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093" },
-
- { MsgKey.ER_XML_VERSION_NOT_SUPPORTED,
- "\u8B66\u544A: \u51FA\u529B\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u306F\u3001''{0}''\u3067\u3042\u308B\u3053\u3068\u304C\u30EA\u30AF\u30A8\u30B9\u30C8\u3055\u308C\u3066\u3044\u307E\u3059\u3002XML\u306E\u3053\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u51FA\u529B\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u306F\u3001''1.0''\u306B\u306A\u308A\u307E\u3059\u3002" },
-
- { MsgKey.ER_SCHEME_REQUIRED,
- "\u30B9\u30AD\u30FC\u30E0\u304C\u5FC5\u8981\u3067\u3059\u3002" },
-
- /*
- * Note to translators: The words 'Properties' and
- * 'SerializerFactory' in this message are Java class names
- * and should not be translated.
- */
- { MsgKey.ER_FACTORY_PROPERTY_MISSING,
- "SerializerFactory\u306B\u6E21\u3055\u308C\u308B\u30D7\u30ED\u30D1\u30C6\u30A3\u30FB\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306B\u3001''{0}''\u30D7\u30ED\u30D1\u30C6\u30A3\u304C\u3042\u308A\u307E\u305B\u3093\u3002" },
-
- { MsgKey.ER_ENCODING_NOT_SUPPORTED,
- "\u8B66\u544A: \u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0''{0}''\u306F\u3001Java\u30E9\u30F3\u30BF\u30A4\u30E0\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002" },
-
-
- };
-
- return contents;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ko.java b/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ko.java
deleted file mode 100644
index 4f12607..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ko.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xml.internal.serializer.utils;
-
-import java.util.ListResourceBundle;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * An instance of this class is a ListResourceBundle that
- * has the required getContents() method that returns
- * an array of message-key/message associations.
- * <p>
- * The message keys are defined in {@link MsgKey}. The
- * messages that those keys map to are defined here.
- * <p>
- * The messages in the English version are intended to be
- * translated.
- *
- * This class is not a public API, it is only public because it is
- * used in com.sun.org.apache.xml.internal.serializer.
- *
- * @xsl.usage internal
- */
-public class SerializerMessages_ko extends ListResourceBundle {
-
- /*
- * This file contains error and warning messages related to
- * Serializer Error Handling.
- *
- * General notes to translators:
-
- * 1) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
-
- *
- * 2) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 3) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- *
- */
-
- /** The lookup table for error messages. */
- public Object[][] getContents() {
- Object[][] contents = new Object[][] {
- { MsgKey.BAD_MSGKEY,
- "\uBA54\uC2DC\uC9C0 \uD0A4 ''{0}''\uC774(\uAC00) \uBA54\uC2DC\uC9C0 \uD074\uB798\uC2A4 ''{1}''\uC5D0 \uC5C6\uC2B5\uB2C8\uB2E4." },
-
- { MsgKey.BAD_MSGFORMAT,
- "\uBA54\uC2DC\uC9C0 \uD074\uB798\uC2A4 ''{1}''\uC5D0\uC11C ''{0}'' \uBA54\uC2DC\uC9C0\uC758 \uD615\uC2DD\uC774 \uC798\uBABB\uB418\uC5C8\uC2B5\uB2C8\uB2E4." },
-
- { MsgKey.ER_SERIALIZER_NOT_CONTENTHANDLER,
- "Serializer \uD074\uB798\uC2A4 ''{0}''\uC774(\uAC00) org.xml.sax.ContentHandler\uB97C \uAD6C\uD604\uD558\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4." },
-
- { MsgKey.ER_RESOURCE_COULD_NOT_FIND,
- "[{0}] \uB9AC\uC18C\uC2A4\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.\n {1}" },
-
- { MsgKey.ER_RESOURCE_COULD_NOT_LOAD,
- "[{0}] \uB9AC\uC18C\uC2A4\uAC00 \uB2E4\uC74C\uC744 \uB85C\uB4DC\uD560 \uC218 \uC5C6\uC74C: {1} \n {2} \t {3}" },
-
- { MsgKey.ER_BUFFER_SIZE_LESSTHAN_ZERO,
- "\uBC84\uD37C \uD06C\uAE30 <=0" },
-
- { MsgKey.ER_INVALID_UTF16_SURROGATE,
- "\uBD80\uC801\uD569\uD55C UTF-16 \uB300\uB9AC \uC694\uC18C\uAC00 \uAC10\uC9C0\uB428: {0}" },
-
- { MsgKey.ER_OIERROR,
- "IO \uC624\uB958" },
-
- { MsgKey.ER_ILLEGAL_ATTRIBUTE_POSITION,
- "\uD558\uC704 \uB178\uB4DC\uAC00 \uC0DD\uC131\uB41C \uD6C4 \uB610\uB294 \uC694\uC18C\uAC00 \uC0DD\uC131\uB418\uAE30 \uC804\uC5D0 {0} \uC18D\uC131\uC744 \uCD94\uAC00\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uC18D\uC131\uC774 \uBB34\uC2DC\uB429\uB2C8\uB2E4." },
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- { MsgKey.ER_NAMESPACE_PREFIX,
- "''{0}'' \uC811\uB450\uC5B4\uC5D0 \uB300\uD55C \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uAC00 \uC120\uC5B8\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4." },
-
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- { MsgKey.ER_STRAY_ATTRIBUTE,
- "''{0}'' \uC18D\uC131\uC774 \uC694\uC18C\uC5D0 \uD3EC\uD568\uB418\uC5B4 \uC788\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4." },
-
- /*
- * Note to translators: As with the preceding message, a namespace
- * declaration has the form of an attribute and is only permitted to
- * appear on an element. The substitution text {0} is the namespace
- * prefix and {1} is the URI that was being used in the erroneous
- * namespace declaration.
- */
- { MsgKey.ER_STRAY_NAMESPACE,
- "\uB124\uC784\uC2A4\uD398\uC774\uC2A4 \uC120\uC5B8 ''{0}''=''{1}''\uC774(\uAC00) \uC694\uC18C\uC5D0 \uD3EC\uD568\uB418\uC5B4 \uC788\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4." },
-
- { MsgKey.ER_COULD_NOT_LOAD_RESOURCE,
- "{0}\uC744(\uB97C) \uB85C\uB4DC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. CLASSPATH\uB97C \uD655\uC778\uD558\uC2ED\uC2DC\uC624. \uD604\uC7AC \uAE30\uBCF8\uAC12\uB9CC \uC0AC\uC6A9\uD558\uB294 \uC911\uC785\uB2C8\uB2E4." },
-
- { MsgKey.ER_ILLEGAL_CHARACTER,
- "{1}\uC758 \uC9C0\uC815\uB41C \uCD9C\uB825 \uC778\uCF54\uB529\uC5D0\uC11C \uD45C\uC2DC\uB418\uC9C0 \uC54A\uB294 \uC815\uC218 \uAC12 {0}\uC758 \uBB38\uC790\uB97C \uCD9C\uB825\uD558\uB824\uACE0 \uC2DC\uB3C4\uD588\uC2B5\uB2C8\uB2E4." },
-
- { MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY,
- "\uCD9C\uB825 \uBA54\uC18C\uB4DC ''{1}''\uC5D0 \uB300\uD55C \uC18D\uC131 \uD30C\uC77C ''{0}''\uC744(\uB97C) \uB85C\uB4DC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. CLASSPATH\uB97C \uD655\uC778\uD558\uC2ED\uC2DC\uC624." },
-
- { MsgKey.ER_INVALID_PORT,
- "\uD3EC\uD2B8 \uBC88\uD638\uAC00 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4." },
-
- { MsgKey.ER_PORT_WHEN_HOST_NULL,
- "\uD638\uC2A4\uD2B8\uAC00 \uB110\uC77C \uACBD\uC6B0 \uD3EC\uD2B8\uB97C \uC124\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4." },
-
- { MsgKey.ER_HOST_ADDRESS_NOT_WELLFORMED,
- "\uD638\uC2A4\uD2B8\uAC00 \uC644\uC804\uD55C \uC8FC\uC18C\uAC00 \uC544\uB2D9\uB2C8\uB2E4." },
-
- { MsgKey.ER_SCHEME_NOT_CONFORMANT,
- "\uCCB4\uACC4\uAC00 \uC77C\uCE58\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4." },
-
- { MsgKey.ER_SCHEME_FROM_NULL_STRING,
- "\uB110 \uBB38\uC790\uC5F4\uC5D0\uC11C \uCCB4\uACC4\uB97C \uC124\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4." },
-
- { MsgKey.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE,
- "\uACBD\uB85C\uC5D0 \uBD80\uC801\uD569\uD55C \uC774\uC2A4\uCF00\uC774\uD504 \uC2DC\uD000\uC2A4\uAC00 \uD3EC\uD568\uB418\uC5B4 \uC788\uC2B5\uB2C8\uB2E4." },
-
- { MsgKey.ER_PATH_INVALID_CHAR,
- "\uACBD\uB85C\uC5D0 \uBD80\uC801\uD569\uD55C \uBB38\uC790\uAC00 \uD3EC\uD568\uB428: {0}" },
-
- { MsgKey.ER_FRAG_INVALID_CHAR,
- "\uBD80\uBD84\uC5D0 \uBD80\uC801\uD569\uD55C \uBB38\uC790\uAC00 \uD3EC\uD568\uB418\uC5B4 \uC788\uC2B5\uB2C8\uB2E4." },
-
- { MsgKey.ER_FRAG_WHEN_PATH_NULL,
- "\uACBD\uB85C\uAC00 \uB110\uC77C \uACBD\uC6B0 \uBD80\uBD84\uC744 \uC124\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4." },
-
- { MsgKey.ER_FRAG_FOR_GENERIC_URI,
- "\uC77C\uBC18 URI\uC5D0 \uB300\uD574\uC11C\uB9CC \uBD80\uBD84\uC744 \uC124\uC815\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4." },
-
- { MsgKey.ER_NO_SCHEME_IN_URI,
- "URI\uC5D0\uC11C \uCCB4\uACC4\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4." },
-
- { MsgKey.ER_CANNOT_INIT_URI_EMPTY_PARMS,
- "\uBE48 \uB9E4\uAC1C\uBCC0\uC218\uB85C URI\uB97C \uCD08\uAE30\uD654\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4." },
-
- { MsgKey.ER_NO_FRAGMENT_STRING_IN_PATH,
- "\uACBD\uB85C\uC640 \uBD80\uBD84\uC5D0 \uBAA8\uB450 \uBD80\uBD84\uC744 \uC9C0\uC815\uD560 \uC218\uB294 \uC5C6\uC2B5\uB2C8\uB2E4." },
-
- { MsgKey.ER_NO_QUERY_STRING_IN_PATH,
- "\uACBD\uB85C \uBC0F \uC9C8\uC758 \uBB38\uC790\uC5F4\uC5D0 \uC9C8\uC758 \uBB38\uC790\uC5F4\uC744 \uC9C0\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4." },
-
- { MsgKey.ER_NO_PORT_IF_NO_HOST,
- "\uD638\uC2A4\uD2B8\uB97C \uC9C0\uC815\uD558\uC9C0 \uC54A\uC740 \uACBD\uC6B0\uC5D0\uB294 \uD3EC\uD2B8\uB97C \uC9C0\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4." },
-
- { MsgKey.ER_NO_USERINFO_IF_NO_HOST,
- "\uD638\uC2A4\uD2B8\uB97C \uC9C0\uC815\uD558\uC9C0 \uC54A\uC740 \uACBD\uC6B0\uC5D0\uB294 Userinfo\uB97C \uC9C0\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4." },
-
- { MsgKey.ER_XML_VERSION_NOT_SUPPORTED,
- "\uACBD\uACE0: \uCD9C\uB825 \uBB38\uC11C\uC758 \uBC84\uC804\uC774 ''{0}''\uC774(\uAC00) \uB418\uB3C4\uB85D \uC694\uCCAD\uD588\uC2B5\uB2C8\uB2E4. \uC774 \uBC84\uC804\uC758 XML\uC740 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. \uCD9C\uB825 \uBB38\uC11C\uC758 \uBC84\uC804\uC740 ''1.0''\uC774 \uB429\uB2C8\uB2E4." },
-
- { MsgKey.ER_SCHEME_REQUIRED,
- "\uCCB4\uACC4\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4!" },
-
- /*
- * Note to translators: The words 'Properties' and
- * 'SerializerFactory' in this message are Java class names
- * and should not be translated.
- */
- { MsgKey.ER_FACTORY_PROPERTY_MISSING,
- "SerializerFactory\uC5D0 \uC804\uB2EC\uB41C Properties \uAC1D\uCCB4\uC5D0 ''{0}'' \uC18D\uC131\uC774 \uC5C6\uC2B5\uB2C8\uB2E4." },
-
- { MsgKey.ER_ENCODING_NOT_SUPPORTED,
- "\uACBD\uACE0: \uC778\uCF54\uB529 ''{0}''\uC740(\uB294) Java \uB7F0\uD0C0\uC784\uC5D0 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4." },
-
-
- };
-
- return contents;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_pt_BR.java b/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_pt_BR.java
deleted file mode 100644
index 9248fd3..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_pt_BR.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xml.internal.serializer.utils;
-
-import java.util.ListResourceBundle;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * An instance of this class is a ListResourceBundle that
- * has the required getContents() method that returns
- * an array of message-key/message associations.
- * <p>
- * The message keys are defined in {@link MsgKey}. The
- * messages that those keys map to are defined here.
- * <p>
- * The messages in the English version are intended to be
- * translated.
- *
- * This class is not a public API, it is only public because it is
- * used in com.sun.org.apache.xml.internal.serializer.
- *
- * @xsl.usage internal
- */
-public class SerializerMessages_pt_BR extends ListResourceBundle {
-
- /*
- * This file contains error and warning messages related to
- * Serializer Error Handling.
- *
- * General notes to translators:
-
- * 1) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
-
- *
- * 2) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 3) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- *
- */
-
- /** The lookup table for error messages. */
- public Object[][] getContents() {
- Object[][] contents = new Object[][] {
- { MsgKey.BAD_MSGKEY,
- "A chave de mensagem ''{0}'' n\u00E3o est\u00E1 na classe de mensagem ''{1}''" },
-
- { MsgKey.BAD_MSGFORMAT,
- "Houve falha no formato da mensagem ''{0}'' na classe de mensagem ''{1}''." },
-
- { MsgKey.ER_SERIALIZER_NOT_CONTENTHANDLER,
- "A classe ''{0}'' do serializador n\u00E3o implementa org.xml.sax.ContentHandler." },
-
- { MsgKey.ER_RESOURCE_COULD_NOT_FIND,
- "N\u00E3o foi poss\u00EDvel encontrar o recurso [ {0} ].\n {1}" },
-
- { MsgKey.ER_RESOURCE_COULD_NOT_LOAD,
- "O recurso [ {0} ] n\u00E3o foi carregado: {1} \n {2} \t {3}" },
-
- { MsgKey.ER_BUFFER_SIZE_LESSTHAN_ZERO,
- "Tamanho do buffer <=0" },
-
- { MsgKey.ER_INVALID_UTF16_SURROGATE,
- "Foi detectado um substituto de UTF-16 inv\u00E1lido: {0} ?" },
-
- { MsgKey.ER_OIERROR,
- "Erro de E/S" },
-
- { MsgKey.ER_ILLEGAL_ATTRIBUTE_POSITION,
- "N\u00E3o \u00E9 poss\u00EDvel adicionar o atributo {0} depois dos n\u00F3s filhos ou antes que um elemento seja produzido. O atributo ser\u00E1 ignorado." },
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- { MsgKey.ER_NAMESPACE_PREFIX,
- "O namespace do prefixo ''{0}'' n\u00E3o foi declarado." },
-
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- { MsgKey.ER_STRAY_ATTRIBUTE,
- "Atributo ''{0}'' fora do elemento." },
-
- /*
- * Note to translators: As with the preceding message, a namespace
- * declaration has the form of an attribute and is only permitted to
- * appear on an element. The substitution text {0} is the namespace
- * prefix and {1} is the URI that was being used in the erroneous
- * namespace declaration.
- */
- { MsgKey.ER_STRAY_NAMESPACE,
- "Declara\u00E7\u00E3o de namespace ''{0}''=''{1}'' fora do elemento." },
-
- { MsgKey.ER_COULD_NOT_LOAD_RESOURCE,
- "N\u00E3o foi poss\u00EDvel carregar ''{0}'' (verificar CLASSPATH); usando agora apenas os padr\u00F5es" },
-
- { MsgKey.ER_ILLEGAL_CHARACTER,
- "Tentativa de exibir um caractere de valor integral {0} que n\u00E3o est\u00E1 representado na codifica\u00E7\u00E3o de sa\u00EDda especificada de {1}." },
-
- { MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY,
- "N\u00E3o foi poss\u00EDvel carregar o arquivo de propriedade ''{0}'' para o m\u00E9todo de sa\u00EDda ''{1}'' (verificar CLASSPATH)" },
-
- { MsgKey.ER_INVALID_PORT,
- "N\u00FAmero de porta inv\u00E1lido" },
-
- { MsgKey.ER_PORT_WHEN_HOST_NULL,
- "A porta n\u00E3o pode ser definida quando o host \u00E9 nulo" },
-
- { MsgKey.ER_HOST_ADDRESS_NOT_WELLFORMED,
- "O host n\u00E3o \u00E9 um endere\u00E7o correto" },
-
- { MsgKey.ER_SCHEME_NOT_CONFORMANT,
- "O esquema n\u00E3o \u00E9 compat\u00EDvel." },
-
- { MsgKey.ER_SCHEME_FROM_NULL_STRING,
- "N\u00E3o \u00E9 poss\u00EDvel definir o esquema de uma string nula" },
-
- { MsgKey.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE,
- "O caminho cont\u00E9m uma sequ\u00EAncia inv\u00E1lida de caracteres de escape" },
-
- { MsgKey.ER_PATH_INVALID_CHAR,
- "O caminho cont\u00E9m um caractere inv\u00E1lido: {0}" },
-
- { MsgKey.ER_FRAG_INVALID_CHAR,
- "O fragmento cont\u00E9m um caractere inv\u00E1lido" },
-
- { MsgKey.ER_FRAG_WHEN_PATH_NULL,
- "O fragmento n\u00E3o pode ser definido quando o caminho \u00E9 nulo" },
-
- { MsgKey.ER_FRAG_FOR_GENERIC_URI,
- "O fragmento s\u00F3 pode ser definido para um URI gen\u00E9rico" },
-
- { MsgKey.ER_NO_SCHEME_IN_URI,
- "Nenhum esquema encontrado no URI" },
-
- { MsgKey.ER_CANNOT_INIT_URI_EMPTY_PARMS,
- "N\u00E3o \u00E9 poss\u00EDvel inicializar o URI com par\u00E2metros vazios" },
-
- { MsgKey.ER_NO_FRAGMENT_STRING_IN_PATH,
- "O fragmento n\u00E3o pode ser especificado no caminho nem no fragmento" },
-
- { MsgKey.ER_NO_QUERY_STRING_IN_PATH,
- "A string de consulta n\u00E3o pode ser especificada no caminho nem na string de consulta" },
-
- { MsgKey.ER_NO_PORT_IF_NO_HOST,
- "A porta n\u00E3o pode ser especificada se o host n\u00E3o tiver sido especificado" },
-
- { MsgKey.ER_NO_USERINFO_IF_NO_HOST,
- "As informa\u00E7\u00F5es do usu\u00E1rio n\u00E3o podem ser especificadas se o host n\u00E3o tiver sido especificado" },
-
- { MsgKey.ER_XML_VERSION_NOT_SUPPORTED,
- "Advert\u00EAncia: a vers\u00E3o do documento de sa\u00EDda deve ser obrigatoriamente ''{0}''. Esta vers\u00E3o do XML n\u00E3o \u00E9 suportada. A vers\u00E3o do documento de sa\u00EDda ser\u00E1 ''1.0''." },
-
- { MsgKey.ER_SCHEME_REQUIRED,
- "O esquema \u00E9 obrigat\u00F3rio!" },
-
- /*
- * Note to translators: The words 'Properties' and
- * 'SerializerFactory' in this message are Java class names
- * and should not be translated.
- */
- { MsgKey.ER_FACTORY_PROPERTY_MISSING,
- "O objeto Properties especificado para a SerializerFactory n\u00E3o tem uma propriedade ''{0}''." },
-
- { MsgKey.ER_ENCODING_NOT_SUPPORTED,
- "Advert\u00EAncia: a codifica\u00E7\u00E3o ''{0}'' n\u00E3o \u00E9 suportada pelo Java runtime." },
-
-
- };
-
- return contents;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_sv.java b/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_sv.java
deleted file mode 100644
index dcaeaf4..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_sv.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xml.internal.serializer.utils;
-
-import java.util.ListResourceBundle;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * An instance of this class is a ListResourceBundle that
- * has the required getContents() method that returns
- * an array of message-key/message associations.
- * <p>
- * The message keys are defined in {@link MsgKey}. The
- * messages that those keys map to are defined here.
- * <p>
- * The messages in the English version are intended to be
- * translated.
- *
- * This class is not a public API, it is only public because it is
- * used in com.sun.org.apache.xml.internal.serializer.
- *
- * @xsl.usage internal
- */
-public class SerializerMessages_sv extends ListResourceBundle {
-
- /*
- * This file contains error and warning messages related to
- * Serializer Error Handling.
- *
- * General notes to translators:
-
- * 1) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
-
- *
- * 2) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 3) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- *
- */
-
- /** The lookup table for error messages. */
- public Object[][] getContents() {
- Object[][] contents = new Object[][] {
- { MsgKey.BAD_MSGKEY,
- "Meddelandenyckeln ''{0}'' \u00E4r inte i meddelandeklassen ''{1}''" },
-
- { MsgKey.BAD_MSGFORMAT,
- "Formatet p\u00E5 meddelandet ''{0}'' i meddelandeklassen ''{1}'' underk\u00E4ndes." },
-
- { MsgKey.ER_SERIALIZER_NOT_CONTENTHANDLER,
- "Serializerklassen ''{0}'' implementerar inte org.xml.sax.ContentHandler." },
-
- { MsgKey.ER_RESOURCE_COULD_NOT_FIND,
- "Resursen [ {0} ] kunde inte h\u00E4mtas.\n {1}" },
-
- { MsgKey.ER_RESOURCE_COULD_NOT_LOAD,
- "Resursen [ {0} ] kunde inte laddas: {1} \n {2} \t {3}" },
-
- { MsgKey.ER_BUFFER_SIZE_LESSTHAN_ZERO,
- "Buffertstorlek <=0" },
-
- { MsgKey.ER_INVALID_UTF16_SURROGATE,
- "Ogiltigt UTF-16-surrogat uppt\u00E4ckt: {0} ?" },
-
- { MsgKey.ER_OIERROR,
- "IO-fel" },
-
- { MsgKey.ER_ILLEGAL_ATTRIBUTE_POSITION,
- "Kan inte l\u00E4gga till attributet {0} efter underordnade noder eller innan ett element har skapats. Attributet ignoreras." },
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- { MsgKey.ER_NAMESPACE_PREFIX,
- "Namnrymd f\u00F6r prefix ''{0}'' har inte deklarerats." },
-
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- { MsgKey.ER_STRAY_ATTRIBUTE,
- "Attributet ''{0}'' finns utanf\u00F6r elementet." },
-
- /*
- * Note to translators: As with the preceding message, a namespace
- * declaration has the form of an attribute and is only permitted to
- * appear on an element. The substitution text {0} is the namespace
- * prefix and {1} is the URI that was being used in the erroneous
- * namespace declaration.
- */
- { MsgKey.ER_STRAY_NAMESPACE,
- "Namnrymdsdeklarationen ''{0}''=''{1}'' finns utanf\u00F6r element." },
-
- { MsgKey.ER_COULD_NOT_LOAD_RESOURCE,
- "Kunde inte ladda ''{0}'' (kontrollera CLASSPATH), anv\u00E4nder nu enbart standardv\u00E4rden" },
-
- { MsgKey.ER_ILLEGAL_CHARACTER,
- "F\u00F6rs\u00F6k att skriva utdatatecken med integralv\u00E4rdet {0} som inte \u00E4r representerat i angiven utdatakodning av {1}." },
-
- { MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY,
- "Kunde inte ladda egenskapsfilen ''{0}'' f\u00F6r utdatametoden ''{1}'' (kontrollera CLASSPATH)" },
-
- { MsgKey.ER_INVALID_PORT,
- "Ogiltigt portnummer" },
-
- { MsgKey.ER_PORT_WHEN_HOST_NULL,
- "Port kan inte st\u00E4llas in n\u00E4r v\u00E4rd \u00E4r null" },
-
- { MsgKey.ER_HOST_ADDRESS_NOT_WELLFORMED,
- "V\u00E4rd \u00E4r inte en v\u00E4lformulerad adress" },
-
- { MsgKey.ER_SCHEME_NOT_CONFORMANT,
- "Schemat \u00E4r inte likformigt." },
-
- { MsgKey.ER_SCHEME_FROM_NULL_STRING,
- "Kan inte st\u00E4lla in schema fr\u00E5n null-str\u00E4ng" },
-
- { MsgKey.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE,
- "S\u00F6kv\u00E4gen inneh\u00E5ller en ogiltig escape-sekvens" },
-
- { MsgKey.ER_PATH_INVALID_CHAR,
- "S\u00F6kv\u00E4gen inneh\u00E5ller ett ogiltigt tecken: {0}" },
-
- { MsgKey.ER_FRAG_INVALID_CHAR,
- "Fragment inneh\u00E5ller ett ogiltigt tecken" },
-
- { MsgKey.ER_FRAG_WHEN_PATH_NULL,
- "Fragment kan inte st\u00E4llas in n\u00E4r s\u00F6kv\u00E4g \u00E4r null" },
-
- { MsgKey.ER_FRAG_FOR_GENERIC_URI,
- "Fragment kan bara st\u00E4llas in f\u00F6r en allm\u00E4n URI" },
-
- { MsgKey.ER_NO_SCHEME_IN_URI,
- "Schema saknas i URI" },
-
- { MsgKey.ER_CANNOT_INIT_URI_EMPTY_PARMS,
- "Kan inte initiera URI med tomma parametrar" },
-
- { MsgKey.ER_NO_FRAGMENT_STRING_IN_PATH,
- "Fragment kan inte anges i b\u00E5de s\u00F6kv\u00E4gen och fragmentet" },
-
- { MsgKey.ER_NO_QUERY_STRING_IN_PATH,
- "Fr\u00E5gestr\u00E4ng kan inte anges i b\u00E5de s\u00F6kv\u00E4gen och fr\u00E5gestr\u00E4ngen" },
-
- { MsgKey.ER_NO_PORT_IF_NO_HOST,
- "Port f\u00E5r inte anges om v\u00E4rden inte \u00E4r angiven" },
-
- { MsgKey.ER_NO_USERINFO_IF_NO_HOST,
- "Anv\u00E4ndarinfo f\u00E5r inte anges om v\u00E4rden inte \u00E4r angiven" },
-
- { MsgKey.ER_XML_VERSION_NOT_SUPPORTED,
- "Varning: Versionen av utdatadokumentet som beg\u00E4rts \u00E4r ''{0}''. Den h\u00E4r versionen av XML st\u00F6ds inte. Versionen av utdatadokumentet kommer att vara ''1.0''." },
-
- { MsgKey.ER_SCHEME_REQUIRED,
- "Schema kr\u00E4vs!" },
-
- /*
- * Note to translators: The words 'Properties' and
- * 'SerializerFactory' in this message are Java class names
- * and should not be translated.
- */
- { MsgKey.ER_FACTORY_PROPERTY_MISSING,
- "Egenskapsobjektet som \u00F6verf\u00F6rts till SerializerFactory har ingen ''{0}''-egenskap." },
-
- { MsgKey.ER_ENCODING_NOT_SUPPORTED,
- "Varning: Kodningen ''{0}'' st\u00F6ds inte av Java runtime." },
-
-
- };
-
- return contents;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_zh_CN.java b/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_zh_CN.java
deleted file mode 100644
index 7e5da7f..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_zh_CN.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xml.internal.serializer.utils;
-
-import java.util.ListResourceBundle;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * An instance of this class is a ListResourceBundle that
- * has the required getContents() method that returns
- * an array of message-key/message associations.
- * <p>
- * The message keys are defined in {@link MsgKey}. The
- * messages that those keys map to are defined here.
- * <p>
- * The messages in the English version are intended to be
- * translated.
- *
- * This class is not a public API, it is only public because it is
- * used in com.sun.org.apache.xml.internal.serializer.
- *
- * @xsl.usage internal
- */
-public class SerializerMessages_zh_CN extends ListResourceBundle {
-
- /*
- * This file contains error and warning messages related to
- * Serializer Error Handling.
- *
- * General notes to translators:
-
- * 1) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
-
- *
- * 2) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 3) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- *
- */
-
- /** The lookup table for error messages. */
- public Object[][] getContents() {
- Object[][] contents = new Object[][] {
- { MsgKey.BAD_MSGKEY,
- "\u6D88\u606F\u5173\u952E\u5B57 ''{0}'' \u4E0D\u5728\u6D88\u606F\u7C7B ''{1}'' \u4E2D" },
-
- { MsgKey.BAD_MSGFORMAT,
- "\u6D88\u606F\u7C7B ''{1}'' \u4E2D\u6D88\u606F ''{0}'' \u7684\u683C\u5F0F\u5316\u5931\u8D25\u3002" },
-
- { MsgKey.ER_SERIALIZER_NOT_CONTENTHANDLER,
- "\u4E32\u884C\u5668\u7C7B ''{0}'' \u4E0D\u5B9E\u73B0 org.xml.sax.ContentHandler\u3002" },
-
- { MsgKey.ER_RESOURCE_COULD_NOT_FIND,
- "\u627E\u4E0D\u5230\u8D44\u6E90 [ {0} ]\u3002\n {1}" },
-
- { MsgKey.ER_RESOURCE_COULD_NOT_LOAD,
- "\u8D44\u6E90 [ {0} ] \u65E0\u6CD5\u52A0\u8F7D: {1} \n {2} \t {3}" },
-
- { MsgKey.ER_BUFFER_SIZE_LESSTHAN_ZERO,
- "\u7F13\u51B2\u533A\u5927\u5C0F <=0" },
-
- { MsgKey.ER_INVALID_UTF16_SURROGATE,
- "\u68C0\u6D4B\u5230\u65E0\u6548\u7684 UTF-16 \u4EE3\u7406: {0}?" },
-
- { MsgKey.ER_OIERROR,
- "IO \u9519\u8BEF" },
-
- { MsgKey.ER_ILLEGAL_ATTRIBUTE_POSITION,
- "\u5728\u751F\u6210\u5B50\u8282\u70B9\u4E4B\u540E\u6216\u5728\u751F\u6210\u5143\u7D20\u4E4B\u524D\u65E0\u6CD5\u6DFB\u52A0\u5C5E\u6027 {0}\u3002\u5C06\u5FFD\u7565\u5C5E\u6027\u3002" },
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- { MsgKey.ER_NAMESPACE_PREFIX,
- "\u6CA1\u6709\u8BF4\u660E\u540D\u79F0\u7A7A\u95F4\u524D\u7F00 ''{0}''\u3002" },
-
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- { MsgKey.ER_STRAY_ATTRIBUTE,
- "\u5C5E\u6027 ''{0}'' \u5728\u5143\u7D20\u5916\u90E8\u3002" },
-
- /*
- * Note to translators: As with the preceding message, a namespace
- * declaration has the form of an attribute and is only permitted to
- * appear on an element. The substitution text {0} is the namespace
- * prefix and {1} is the URI that was being used in the erroneous
- * namespace declaration.
- */
- { MsgKey.ER_STRAY_NAMESPACE,
- "\u540D\u79F0\u7A7A\u95F4\u58F0\u660E ''{0}''=''{1}'' \u5728\u5143\u7D20\u5916\u90E8\u3002" },
-
- { MsgKey.ER_COULD_NOT_LOAD_RESOURCE,
- "\u65E0\u6CD5\u52A0\u8F7D ''{0}'' (\u68C0\u67E5 CLASSPATH), \u73B0\u5728\u53EA\u4F7F\u7528\u9ED8\u8BA4\u503C" },
-
- { MsgKey.ER_ILLEGAL_CHARACTER,
- "\u5C1D\u8BD5\u8F93\u51FA\u672A\u4EE5{1}\u7684\u6307\u5B9A\u8F93\u51FA\u7F16\u7801\u8868\u793A\u7684\u6574\u6570\u503C {0} \u7684\u5B57\u7B26\u3002" },
-
- { MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY,
- "\u65E0\u6CD5\u4E3A\u8F93\u51FA\u65B9\u6CD5 ''{1}'' \u52A0\u8F7D\u5C5E\u6027\u6587\u4EF6 ''{0}'' (\u68C0\u67E5 CLASSPATH)" },
-
- { MsgKey.ER_INVALID_PORT,
- "\u65E0\u6548\u7684\u7AEF\u53E3\u53F7" },
-
- { MsgKey.ER_PORT_WHEN_HOST_NULL,
- "\u4E3B\u673A\u4E3A\u7A7A\u65F6, \u65E0\u6CD5\u8BBE\u7F6E\u7AEF\u53E3" },
-
- { MsgKey.ER_HOST_ADDRESS_NOT_WELLFORMED,
- "\u4E3B\u673A\u4E0D\u662F\u683C\u5F0F\u826F\u597D\u7684\u5730\u5740" },
-
- { MsgKey.ER_SCHEME_NOT_CONFORMANT,
- "\u65B9\u6848\u4E0D\u4E00\u81F4\u3002" },
-
- { MsgKey.ER_SCHEME_FROM_NULL_STRING,
- "\u65E0\u6CD5\u4ECE\u7A7A\u5B57\u7B26\u4E32\u8BBE\u7F6E\u65B9\u6848" },
-
- { MsgKey.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE,
- "\u8DEF\u5F84\u5305\u542B\u65E0\u6548\u7684\u8F6C\u4E49\u5E8F\u5217" },
-
- { MsgKey.ER_PATH_INVALID_CHAR,
- "\u8DEF\u5F84\u5305\u542B\u65E0\u6548\u7684\u5B57\u7B26: {0}" },
-
- { MsgKey.ER_FRAG_INVALID_CHAR,
- "\u7247\u6BB5\u5305\u542B\u65E0\u6548\u7684\u5B57\u7B26" },
-
- { MsgKey.ER_FRAG_WHEN_PATH_NULL,
- "\u8DEF\u5F84\u4E3A\u7A7A\u65F6, \u65E0\u6CD5\u8BBE\u7F6E\u7247\u6BB5" },
-
- { MsgKey.ER_FRAG_FOR_GENERIC_URI,
- "\u53EA\u80FD\u4E3A\u4E00\u822C URI \u8BBE\u7F6E\u7247\u6BB5" },
-
- { MsgKey.ER_NO_SCHEME_IN_URI,
- "\u5728 URI \u4E2D\u627E\u4E0D\u5230\u65B9\u6848" },
-
- { MsgKey.ER_CANNOT_INIT_URI_EMPTY_PARMS,
- "\u65E0\u6CD5\u4EE5\u7A7A\u53C2\u6570\u521D\u59CB\u5316 URI" },
-
- { MsgKey.ER_NO_FRAGMENT_STRING_IN_PATH,
- "\u8DEF\u5F84\u548C\u7247\u6BB5\u4E2D\u90FD\u65E0\u6CD5\u6307\u5B9A\u7247\u6BB5" },
-
- { MsgKey.ER_NO_QUERY_STRING_IN_PATH,
- "\u8DEF\u5F84\u548C\u67E5\u8BE2\u5B57\u7B26\u4E32\u4E2D\u4E0D\u80FD\u6307\u5B9A\u67E5\u8BE2\u5B57\u7B26\u4E32" },
-
- { MsgKey.ER_NO_PORT_IF_NO_HOST,
- "\u5982\u679C\u6CA1\u6709\u6307\u5B9A\u4E3B\u673A, \u5219\u4E0D\u53EF\u4EE5\u6307\u5B9A\u7AEF\u53E3" },
-
- { MsgKey.ER_NO_USERINFO_IF_NO_HOST,
- "\u5982\u679C\u6CA1\u6709\u6307\u5B9A\u4E3B\u673A, \u5219\u4E0D\u53EF\u4EE5\u6307\u5B9A Userinfo" },
-
- { MsgKey.ER_XML_VERSION_NOT_SUPPORTED,
- "\u8B66\u544A: \u8F93\u51FA\u6587\u6863\u7684\u7248\u672C\u5E94\u4E3A ''{0}''\u3002\u4E0D\u652F\u6301\u6B64\u7248\u672C\u7684 XML\u3002\u8F93\u51FA\u6587\u6863\u7684\u7248\u672C\u5C06\u4E3A ''1.0''\u3002" },
-
- { MsgKey.ER_SCHEME_REQUIRED,
- "\u65B9\u6848\u662F\u5FC5\u9700\u7684!" },
-
- /*
- * Note to translators: The words 'Properties' and
- * 'SerializerFactory' in this message are Java class names
- * and should not be translated.
- */
- { MsgKey.ER_FACTORY_PROPERTY_MISSING,
- "\u4F20\u9012\u5230 SerializerFactory \u7684 Properties \u5BF9\u8C61\u6CA1\u6709 ''{0}'' \u5C5E\u6027\u3002" },
-
- { MsgKey.ER_ENCODING_NOT_SUPPORTED,
- "\u8B66\u544A: Java \u8FD0\u884C\u65F6\u4E0D\u652F\u6301\u7F16\u7801 ''{0}''\u3002" },
-
-
- };
-
- return contents;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_zh_TW.java b/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_zh_TW.java
deleted file mode 100644
index 6a54320..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_zh_TW.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xml.internal.serializer.utils;
-
-import java.util.ListResourceBundle;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * An instance of this class is a ListResourceBundle that
- * has the required getContents() method that returns
- * an array of message-key/message associations.
- * <p>
- * The message keys are defined in {@link MsgKey}. The
- * messages that those keys map to are defined here.
- * <p>
- * The messages in the English version are intended to be
- * translated.
- *
- * This class is not a public API, it is only public because it is
- * used in com.sun.org.apache.xml.internal.serializer.
- *
- * @xsl.usage internal
- */
-public class SerializerMessages_zh_TW extends ListResourceBundle {
-
- /*
- * This file contains error and warning messages related to
- * Serializer Error Handling.
- *
- * General notes to translators:
-
- * 1) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
-
- *
- * 2) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 3) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- *
- */
-
- /** The lookup table for error messages. */
- public Object[][] getContents() {
- Object[][] contents = new Object[][] {
- { MsgKey.BAD_MSGKEY,
- "\u8A0A\u606F\u7D22\u5F15\u9375 ''{0}'' \u7684\u8A0A\u606F\u985E\u5225\u4E0D\u662F ''{1}''" },
-
- { MsgKey.BAD_MSGFORMAT,
- "\u8A0A\u606F\u985E\u5225 ''{1}'' \u4E2D\u7684\u8A0A\u606F ''{0}'' \u683C\u5F0F\u4E0D\u6B63\u78BA\u3002" },
-
- { MsgKey.ER_SERIALIZER_NOT_CONTENTHANDLER,
- "serializer \u985E\u5225 ''{0}'' \u4E0D\u5BE6\u884C org.xml.sax.ContentHandler\u3002" },
-
- { MsgKey.ER_RESOURCE_COULD_NOT_FIND,
- "\u627E\u4E0D\u5230\u8CC7\u6E90 [ {0} ]\u3002\n{1}" },
-
- { MsgKey.ER_RESOURCE_COULD_NOT_LOAD,
- "\u7121\u6CD5\u8F09\u5165\u8CC7\u6E90 [ {0} ]: {1} \n {2} \t {3}" },
-
- { MsgKey.ER_BUFFER_SIZE_LESSTHAN_ZERO,
- "\u7DE9\u885D\u5340\u5927\u5C0F <=0" },
-
- { MsgKey.ER_INVALID_UTF16_SURROGATE,
- "\u5075\u6E2C\u5230\u7121\u6548\u7684 UTF-16 \u4EE3\u7406: {0}\uFF1F" },
-
- { MsgKey.ER_OIERROR,
- "IO \u932F\u8AA4" },
-
- { MsgKey.ER_ILLEGAL_ATTRIBUTE_POSITION,
- "\u5728\u7522\u751F\u5B50\u9805\u7BC0\u9EDE\u4E4B\u5F8C\uFF0C\u6216\u5728\u7522\u751F\u5143\u7D20\u4E4B\u524D\uFF0C\u4E0D\u53EF\u65B0\u589E\u5C6C\u6027 {0}\u3002\u5C6C\u6027\u6703\u88AB\u5FFD\u7565\u3002" },
-
- /*
- * Note to translators: The stylesheet contained a reference to a
- * namespace prefix that was undefined. The value of the substitution
- * text is the name of the prefix.
- */
- { MsgKey.ER_NAMESPACE_PREFIX,
- "\u5B57\u9996 ''{0}'' \u7684\u547D\u540D\u7A7A\u9593\u5C1A\u672A\u5BA3\u544A\u3002" },
-
- /*
- * Note to translators: This message is reported if the stylesheet
- * being processed attempted to construct an XML document with an
- * attribute in a place other than on an element. The substitution text
- * specifies the name of the attribute.
- */
- { MsgKey.ER_STRAY_ATTRIBUTE,
- "\u5C6C\u6027 ''{0}'' \u5728\u5143\u7D20\u4E4B\u5916\u3002" },
-
- /*
- * Note to translators: As with the preceding message, a namespace
- * declaration has the form of an attribute and is only permitted to
- * appear on an element. The substitution text {0} is the namespace
- * prefix and {1} is the URI that was being used in the erroneous
- * namespace declaration.
- */
- { MsgKey.ER_STRAY_NAMESPACE,
- "\u547D\u540D\u7A7A\u9593\u5BA3\u544A ''{0}''=''{1}'' \u8D85\u51FA\u5143\u7D20\u5916\u3002" },
-
- { MsgKey.ER_COULD_NOT_LOAD_RESOURCE,
- "\u7121\u6CD5\u8F09\u5165 ''{0}'' (\u6AA2\u67E5 CLASSPATH)\uFF0C\u76EE\u524D\u53EA\u4F7F\u7528\u9810\u8A2D\u503C" },
-
- { MsgKey.ER_ILLEGAL_CHARACTER,
- "\u5617\u8A66\u8F38\u51FA\u6574\u6578\u503C {0} \u7684\u5B57\u5143\uFF0C\u4F46\u662F\u5B83\u4E0D\u662F\u4EE5\u6307\u5B9A\u7684 {1} \u8F38\u51FA\u7DE8\u78BC\u5448\u73FE\u3002" },
-
- { MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY,
- "\u7121\u6CD5\u8F09\u5165\u8F38\u51FA\u65B9\u6CD5 ''{1}'' \u7684\u5C6C\u6027\u6A94 ''{0}'' (\u6AA2\u67E5 CLASSPATH)" },
-
- { MsgKey.ER_INVALID_PORT,
- "\u7121\u6548\u7684\u9023\u63A5\u57E0\u865F\u78BC" },
-
- { MsgKey.ER_PORT_WHEN_HOST_NULL,
- "\u4E3B\u6A5F\u70BA\u7A7A\u503C\u6642\uFF0C\u7121\u6CD5\u8A2D\u5B9A\u9023\u63A5\u57E0" },
-
- { MsgKey.ER_HOST_ADDRESS_NOT_WELLFORMED,
- "\u4E3B\u6A5F\u6C92\u6709\u5B8C\u6574\u7684\u4F4D\u5740" },
-
- { MsgKey.ER_SCHEME_NOT_CONFORMANT,
- "\u914D\u7F6E\u4E0D\u4E00\u81F4\u3002" },
-
- { MsgKey.ER_SCHEME_FROM_NULL_STRING,
- "\u7121\u6CD5\u5F9E\u7A7A\u503C\u5B57\u4E32\u8A2D\u5B9A\u914D\u7F6E" },
-
- { MsgKey.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE,
- "\u8DEF\u5F91\u5305\u542B\u7121\u6548\u7684\u9041\u96E2\u5E8F\u5217" },
-
- { MsgKey.ER_PATH_INVALID_CHAR,
- "\u8DEF\u5F91\u5305\u542B\u7121\u6548\u7684\u5B57\u5143: {0}" },
-
- { MsgKey.ER_FRAG_INVALID_CHAR,
- "\u7247\u6BB5\u5305\u542B\u7121\u6548\u7684\u5B57\u5143" },
-
- { MsgKey.ER_FRAG_WHEN_PATH_NULL,
- "\u8DEF\u5F91\u70BA\u7A7A\u503C\u6642\uFF0C\u7121\u6CD5\u8A2D\u5B9A\u7247\u6BB5" },
-
- { MsgKey.ER_FRAG_FOR_GENERIC_URI,
- "\u53EA\u80FD\u5C0D\u4E00\u822C URI \u8A2D\u5B9A\u7247\u6BB5" },
-
- { MsgKey.ER_NO_SCHEME_IN_URI,
- "\u5728 URI \u627E\u4E0D\u5230\u914D\u7F6E" },
-
- { MsgKey.ER_CANNOT_INIT_URI_EMPTY_PARMS,
- "\u7121\u6CD5\u4EE5\u7A7A\u767D\u53C3\u6578\u8D77\u59CB\u8A2D\u5B9A URI" },
-
- { MsgKey.ER_NO_FRAGMENT_STRING_IN_PATH,
- "\u8DEF\u5F91\u548C\u7247\u6BB5\u4E0D\u80FD\u540C\u6642\u6307\u5B9A\u7247\u6BB5" },
-
- { MsgKey.ER_NO_QUERY_STRING_IN_PATH,
- "\u5728\u8DEF\u5F91\u53CA\u67E5\u8A62\u5B57\u4E32\u4E2D\u4E0D\u53EF\u6307\u5B9A\u67E5\u8A62\u5B57\u4E32" },
-
- { MsgKey.ER_NO_PORT_IF_NO_HOST,
- "\u5982\u679C\u6C92\u6709\u6307\u5B9A\u4E3B\u6A5F\uFF0C\u4E0D\u53EF\u6307\u5B9A\u9023\u63A5\u57E0" },
-
- { MsgKey.ER_NO_USERINFO_IF_NO_HOST,
- "\u5982\u679C\u6C92\u6709\u6307\u5B9A\u4E3B\u6A5F\uFF0C\u4E0D\u53EF\u6307\u5B9A Userinfo" },
-
- { MsgKey.ER_XML_VERSION_NOT_SUPPORTED,
- "\u8B66\u544A: \u8981\u6C42\u7684\u8F38\u51FA\u6587\u4EF6\u7248\u672C\u70BA ''{0}''\u3002\u4E0D\u652F\u63F4\u6B64\u7248\u672C\u7684 XML\u3002\u8F38\u51FA\u6587\u4EF6\u7684\u7248\u672C\u5C07\u6703\u662F ''1.0''\u3002" },
-
- { MsgKey.ER_SCHEME_REQUIRED,
- "\u5FC5\u9808\u6709\u914D\u7F6E\uFF01" },
-
- /*
- * Note to translators: The words 'Properties' and
- * 'SerializerFactory' in this message are Java class names
- * and should not be translated.
- */
- { MsgKey.ER_FACTORY_PROPERTY_MISSING,
- "\u50B3\u905E\u7D66 SerializerFactory \u7684 Properties \u7269\u4EF6\u6C92\u6709 ''{0}'' \u5C6C\u6027\u3002" },
-
- { MsgKey.ER_ENCODING_NOT_SUPPORTED,
- "\u8B66\u544A: Java Runtime \u4E0D\u652F\u63F4\u7DE8\u78BC ''{0}''\u3002" },
-
-
- };
-
- return contents;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/utils/StringToIntTable.java b/src/com/sun/org/apache/xml/internal/serializer/utils/StringToIntTable.java
deleted file mode 100644
index 04140ff..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/utils/StringToIntTable.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: StringToIntTable.java,v 1.1.4.1 2005/09/08 11:03:19 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.serializer.utils;
-
-/**
- * A very simple lookup table that stores a list of strings, the even
- * number strings being keys, and the odd number strings being values.
- *
- * This class is a copy of the one in com.sun.org.apache.xml.internal.utils.
- * It exists to cut the serializers dependancy on that package.
- *
- * This class is not a public API, it is only public so it can be used
- * in com.sun.org.apache.xml.internal.serializer.
- *
- * @xsl.usage internal
- */
-public final class StringToIntTable
-{
-
- public static final int INVALID_KEY = -10000;
-
- /** Block size to allocate */
- private int m_blocksize;
-
- /** Array of strings this table points to. Associated with ints
- * in m_values */
- private String m_map[];
-
- /** Array of ints this table points. Associated with strings from
- * m_map. */
- private int m_values[];
-
- /** Number of ints in the table */
- private int m_firstFree = 0;
-
- /** Size of this table */
- private int m_mapSize;
-
- /**
- * Default constructor. Note that the default
- * block size is very small, for small lists.
- */
- public StringToIntTable()
- {
-
- m_blocksize = 8;
- m_mapSize = m_blocksize;
- m_map = new String[m_blocksize];
- m_values = new int[m_blocksize];
- }
-
- /**
- * Construct a StringToIntTable, using the given block size.
- *
- * @param blocksize Size of block to allocate
- */
- public StringToIntTable(int blocksize)
- {
-
- m_blocksize = blocksize;
- m_mapSize = blocksize;
- m_map = new String[blocksize];
- m_values = new int[m_blocksize];
- }
-
- /**
- * Get the length of the list.
- *
- * @return the length of the list
- */
- public final int getLength()
- {
- return m_firstFree;
- }
-
- /**
- * Append a string onto the vector.
- *
- * @param key String to append
- * @param value The int value of the string
- */
- public final void put(String key, int value)
- {
-
- if ((m_firstFree + 1) >= m_mapSize)
- {
- m_mapSize += m_blocksize;
-
- String newMap[] = new String[m_mapSize];
-
- System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);
-
- m_map = newMap;
-
- int newValues[] = new int[m_mapSize];
-
- System.arraycopy(m_values, 0, newValues, 0, m_firstFree + 1);
-
- m_values = newValues;
- }
-
- m_map[m_firstFree] = key;
- m_values[m_firstFree] = value;
-
- m_firstFree++;
- }
-
- /**
- * Tell if the table contains the given string.
- *
- * @param key String to look for
- *
- * @return The String's int value
- *
- */
- public final int get(String key)
- {
-
- for (int i = 0; i < m_firstFree; i++)
- {
- if (m_map[i].equals(key))
- return m_values[i];
- }
-
- return INVALID_KEY;
- }
-
- /**
- * Tell if the table contains the given string. Ignore case.
- *
- * @param key String to look for
- *
- * @return The string's int value
- */
- public final int getIgnoreCase(String key)
- {
-
- if (null == key)
- return INVALID_KEY;
-
- for (int i = 0; i < m_firstFree; i++)
- {
- if (m_map[i].equalsIgnoreCase(key))
- return m_values[i];
- }
-
- return INVALID_KEY;
- }
-
- /**
- * Tell if the table contains the given string.
- *
- * @param key String to look for
- *
- * @return True if the string is in the table
- */
- public final boolean contains(String key)
- {
-
- for (int i = 0; i < m_firstFree; i++)
- {
- if (m_map[i].equals(key))
- return true;
- }
-
- return false;
- }
-
- /**
- * Return array of keys in the table.
- *
- * @return Array of strings
- */
- public final String[] keys()
- {
- String [] keysArr = new String[m_firstFree];
-
- for (int i = 0; i < m_firstFree; i++)
- {
- keysArr[i] = m_map[i];
- }
-
- return keysArr;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/utils/SystemIDResolver.java b/src/com/sun/org/apache/xml/internal/serializer/utils/SystemIDResolver.java
deleted file mode 100644
index e5c38eb..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/utils/SystemIDResolver.java
+++ /dev/null
@@ -1,304 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: SystemIDResolver.java,v 1.1.4.1 2005/09/08 11:03:20 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.serializer.utils;
-
-import java.io.File;
-
-import javax.xml.transform.TransformerException;
-
-import com.sun.org.apache.xml.internal.serializer.utils.URI.MalformedURIException;
-
-/**
- * This class is used to resolve relative URIs and SystemID
- * strings into absolute URIs.
- *
- * <p>This is a generic utility for resolving URIs, other than the
- * fact that it's declared to throw TransformerException. Please
- * see code comments for details on how resolution is performed.</p>
- *
- * This class is a copy of the one in com.sun.org.apache.xml.internal.utils.
- * It exists to cut the serializers dependancy on that package.
- *
- * This class is not a public API, it is only public because it is
- * used in com.sun.org.apache.xml.internal.serializer.
- *
- * @xsl.usage internal
- */
-public final class SystemIDResolver
-{
-
- /**
- * Get an absolute URI from a given relative URI (local path).
- *
- * <p>The relative URI is a local filesystem path. The path can be
- * absolute or relative. If it is a relative path, it is resolved relative
- * to the system property "user.dir" if it is available; if not (i.e. in an
- * Applet perhaps which throws SecurityException) then we just return the
- * relative path. The space and backslash characters are also replaced to
- * generate a good absolute URI.</p>
- *
- * @param localPath The relative URI to resolve
- *
- * @return Resolved absolute URI
- */
- public static String getAbsoluteURIFromRelative(String localPath)
- {
- if (localPath == null || localPath.length() == 0)
- return "";
-
- // If the local path is a relative path, then it is resolved against
- // the "user.dir" system property.
- String absolutePath = localPath;
- if (!isAbsolutePath(localPath))
- {
- try
- {
- absolutePath = getAbsolutePathFromRelativePath(localPath);
- }
- // user.dir not accessible from applet
- catch (SecurityException se)
- {
- return "file:" + localPath;
- }
- }
-
- String urlString;
- if (null != absolutePath)
- {
- if (absolutePath.startsWith(File.separator))
- urlString = "file://" + absolutePath;
- else
- urlString = "file:///" + absolutePath;
- }
- else
- urlString = "file:" + localPath;
-
- return replaceChars(urlString);
- }
-
- /**
- * Return an absolute path from a relative path.
- *
- * @param relativePath A relative path
- * @return The absolute path
- */
- private static String getAbsolutePathFromRelativePath(String relativePath)
- {
- return new File(relativePath).getAbsolutePath();
- }
-
- /**
- * Return true if the systemId denotes an absolute URI .
- *
- * @param systemId The systemId string
- * @return true if the systemId is an an absolute URI
- */
- public static boolean isAbsoluteURI(String systemId)
- {
- /** http://www.ietf.org/rfc/rfc2396.txt
- * Authors should be aware that a path segment which contains a colon
- * character cannot be used as the first segment of a relative URI path
- * (e.g., "this:that"), because it would be mistaken for a scheme name.
- **/
- /**
- * %REVIEW% Can we assume here that systemId is a valid URI?
- * It looks like we cannot ( See discussion of this common problem in
- * Bugzilla Bug 22777 ).
- **/
- //"fix" for Bugzilla Bug 22777
- if(isWindowsAbsolutePath(systemId)){
- return false;
- }
-
- final int fragmentIndex = systemId.indexOf('#');
- final int queryIndex = systemId.indexOf('?');
- final int slashIndex = systemId.indexOf('/');
- final int colonIndex = systemId.indexOf(':');
-
- //finding substring before '#', '?', and '/'
- int index = systemId.length() -1;
- if(fragmentIndex > 0)
- index = fragmentIndex;
- if((queryIndex > 0) && (queryIndex <index))
- index = queryIndex;
- if((slashIndex > 0) && (slashIndex <index))
- index = slashIndex;
- // return true if there is ':' before '#', '?', and '/'
- return ((colonIndex >0) && (colonIndex<index));
-
- }
-
- /**
- * Return true if the local path is an absolute path.
- *
- * @param systemId The path string
- * @return true if the path is absolute
- */
- public static boolean isAbsolutePath(String systemId)
- {
- if(systemId == null)
- return false;
- final File file = new File(systemId);
- return file.isAbsolute();
-
- }
-
- /**
- * Return true if the local path is a Windows absolute path.
- *
- * @param systemId The path string
- * @return true if the path is a Windows absolute path
- */
- private static boolean isWindowsAbsolutePath(String systemId)
- {
- if(!isAbsolutePath(systemId))
- return false;
- // On Windows, an absolute path starts with "[drive_letter]:\".
- if (systemId.length() > 2
- && systemId.charAt(1) == ':'
- && Character.isLetter(systemId.charAt(0))
- && (systemId.charAt(2) == '\\' || systemId.charAt(2) == '/'))
- return true;
- else
- return false;
- }
-
- /**
- * Replace spaces with "%20" and backslashes with forward slashes in
- * the input string to generate a well-formed URI string.
- *
- * @param str The input string
- * @return The string after conversion
- */
- private static String replaceChars(String str)
- {
- StringBuffer buf = new StringBuffer(str);
- int length = buf.length();
- for (int i = 0; i < length; i++)
- {
- char currentChar = buf.charAt(i);
- // Replace space with "%20"
- if (currentChar == ' ')
- {
- buf.setCharAt(i, '%');
- buf.insert(i+1, "20");
- length = length + 2;
- i = i + 2;
- }
- // Replace backslash with forward slash
- else if (currentChar == '\\')
- {
- buf.setCharAt(i, '/');
- }
- }
-
- return buf.toString();
- }
-
- /**
- * Take a SystemID string and try to turn it into a good absolute URI.
- *
- * @param systemId A URI string, which may be absolute or relative.
- *
- * @return The resolved absolute URI
- */
- public static String getAbsoluteURI(String systemId)
- {
- String absoluteURI = systemId;
- if (isAbsoluteURI(systemId))
- {
- // Only process the systemId if it starts with "file:".
- if (systemId.startsWith("file:"))
- {
- String str = systemId.substring(5);
-
- // Resolve the absolute path if the systemId starts with "file:///"
- // or "file:/". Don't do anything if it only starts with "file://".
- if (str != null && str.startsWith("/"))
- {
- if (str.startsWith("///") || !str.startsWith("//"))
- {
- // A Windows path containing a drive letter can be relative.
- // A Unix path starting with "file:/" is always absolute.
- int secondColonIndex = systemId.indexOf(':', 5);
- if (secondColonIndex > 0)
- {
- String localPath = systemId.substring(secondColonIndex-1);
- try {
- if (!isAbsolutePath(localPath))
- absoluteURI = systemId.substring(0, secondColonIndex-1) +
- getAbsolutePathFromRelativePath(localPath);
- }
- catch (SecurityException se) {
- return systemId;
- }
- }
- }
- }
- else
- {
- return getAbsoluteURIFromRelative(systemId.substring(5));
- }
-
- return replaceChars(absoluteURI);
- }
- else
- return systemId;
- }
- else
- return getAbsoluteURIFromRelative(systemId);
-
- }
-
-
- /**
- * Take a SystemID string and try to turn it into a good absolute URI.
- *
- * @param urlString SystemID string
- * @param base The URI string used as the base for resolving the systemID
- *
- * @return The resolved absolute URI
- * @throws TransformerException thrown if the string can't be turned into a URI.
- */
- public static String getAbsoluteURI(String urlString, String base)
- throws TransformerException
- {
- if (base == null)
- return getAbsoluteURI(urlString);
-
- String absoluteBase = getAbsoluteURI(base);
- URI uri = null;
- try
- {
- URI baseURI = new URI(absoluteBase);
- uri = new URI(baseURI, urlString);
- }
- catch (MalformedURIException mue)
- {
- throw new TransformerException(mue);
- }
-
- return replaceChars(uri.toString());
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/utils/URI.java b/src/com/sun/org/apache/xml/internal/serializer/utils/URI.java
deleted file mode 100644
index 4d5375a..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/utils/URI.java
+++ /dev/null
@@ -1,1671 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: URI.java,v 1.1.4.1 2005/09/08 11:03:20 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.serializer.utils;
-
-import java.io.IOException;
-import java.util.Objects;
-
-
-/**
- * A class to represent a Uniform Resource Identifier (URI). This class
- * is designed to handle the parsing of URIs and provide access to
- * the various components (scheme, host, port, userinfo, path, query
- * string and fragment) that may constitute a URI.
- * <p>
- * Parsing of a URI specification is done according to the URI
- * syntax described in RFC 2396
- * <http://www.ietf.org/rfc/rfc2396.txt?number=2396>. Every URI consists
- * of a scheme, followed by a colon (':'), followed by a scheme-specific
- * part. For URIs that follow the "generic URI" syntax, the scheme-
- * specific part begins with two slashes ("//") and may be followed
- * by an authority segment (comprised of user information, host, and
- * port), path segment, query segment and fragment. Note that RFC 2396
- * no longer specifies the use of the parameters segment and excludes
- * the "user:password" syntax as part of the authority segment. If
- * "user:password" appears in a URI, the entire user/password string
- * is stored as userinfo.
- * <p>
- * For URIs that do not follow the "generic URI" syntax (e.g. mailto),
- * the entire scheme-specific part is treated as the "path" portion
- * of the URI.
- * <p>
- * Note that, unlike the java.net.URL class, this class does not provide
- * any built-in network access functionality nor does it provide any
- * scheme-specific functionality (for example, it does not know a
- * default port for a specific scheme). Rather, it only knows the
- * grammar and basic set of operations that can be applied to a URI.
- *
- * This class is a copy of the one in com.sun.org.apache.xml.internal.utils.
- * It exists to cut the serializers dependancy on that package.
- *
- * A minor change from the original is that this class no longer implements
- * Serializable, and the serialVersionUID magic field is dropped, and
- * the class is no longer "public".
- *
- * @xsl.usage internal
- */
-final class URI
-{
- /**
- * MalformedURIExceptions are thrown in the process of building a URI
- * or setting fields on a URI when an operation would result in an
- * invalid URI specification.
- *
- */
- public static class MalformedURIException extends IOException
- {
-
- /**
- * Constructs a <code>MalformedURIException</code> with no specified
- * detail message.
- */
- public MalformedURIException()
- {
- super();
- }
-
- /**
- * Constructs a <code>MalformedURIException</code> with the
- * specified detail message.
- *
- * @param p_msg the detail message.
- */
- public MalformedURIException(String p_msg)
- {
- super(p_msg);
- }
- }
-
- /** reserved characters */
- private static final String RESERVED_CHARACTERS = ";/?:@&=+$,";
-
- /**
- * URI punctuation mark characters - these, combined with
- * alphanumerics, constitute the "unreserved" characters
- */
- private static final String MARK_CHARACTERS = "-_.!~*'() ";
-
- /** scheme can be composed of alphanumerics and these characters */
- private static final String SCHEME_CHARACTERS = "+-.";
-
- /**
- * userinfo can be composed of unreserved, escaped and these
- * characters
- */
- private static final String USERINFO_CHARACTERS = ";:&=+$,";
-
- /** Stores the scheme (usually the protocol) for this URI.
- * @serial */
- private String m_scheme = null;
-
- /** If specified, stores the userinfo for this URI; otherwise null.
- * @serial */
- private String m_userinfo = null;
-
- /** If specified, stores the host for this URI; otherwise null.
- * @serial */
- private String m_host = null;
-
- /** If specified, stores the port for this URI; otherwise -1.
- * @serial */
- private int m_port = -1;
-
- /** If specified, stores the path for this URI; otherwise null.
- * @serial */
- private String m_path = null;
-
- /**
- * If specified, stores the query string for this URI; otherwise
- * null.
- * @serial
- */
- private String m_queryString = null;
-
- /** If specified, stores the fragment for this URI; otherwise null.
- * @serial */
- private String m_fragment = null;
-
- /** Indicate whether in DEBUG mode */
- private static boolean DEBUG = false;
-
- /**
- * Construct a new and uninitialized URI.
- */
- public URI(){}
-
- /**
- * Construct a new URI from another URI. All fields for this URI are
- * set equal to the fields of the URI passed in.
- *
- * @param p_other the URI to copy (cannot be null)
- */
- public URI(URI p_other)
- {
- initialize(p_other);
- }
-
- /**
- * Construct a new URI from a URI specification string. If the
- * specification follows the "generic URI" syntax, (two slashes
- * following the first colon), the specification will be parsed
- * accordingly - setting the scheme, userinfo, host,port, path, query
- * string and fragment fields as necessary. If the specification does
- * not follow the "generic URI" syntax, the specification is parsed
- * into a scheme and scheme-specific part (stored as the path) only.
- *
- * @param p_uriSpec the URI specification string (cannot be null or
- * empty)
- *
- * @throws MalformedURIException if p_uriSpec violates any syntax
- * rules
- */
- public URI(String p_uriSpec) throws MalformedURIException
- {
- this((URI) null, p_uriSpec);
- }
-
- /**
- * Construct a new URI from a base URI and a URI specification string.
- * The URI specification string may be a relative URI.
- *
- * @param p_base the base URI (cannot be null if p_uriSpec is null or
- * empty)
- * @param p_uriSpec the URI specification string (cannot be null or
- * empty if p_base is null)
- *
- * @throws MalformedURIException if p_uriSpec violates any syntax
- * rules
- */
- public URI(URI p_base, String p_uriSpec) throws MalformedURIException
- {
- initialize(p_base, p_uriSpec);
- }
-
- /**
- * Construct a new URI that does not follow the generic URI syntax.
- * Only the scheme and scheme-specific part (stored as the path) are
- * initialized.
- *
- * @param p_scheme the URI scheme (cannot be null or empty)
- * @param p_schemeSpecificPart the scheme-specific part (cannot be
- * null or empty)
- *
- * @throws MalformedURIException if p_scheme violates any
- * syntax rules
- */
- public URI(String p_scheme, String p_schemeSpecificPart)
- throws MalformedURIException
- {
-
- if (p_scheme == null || p_scheme.trim().length() == 0)
- {
- throw new MalformedURIException(
- "Cannot construct URI with null/empty scheme!");
- }
-
- if (p_schemeSpecificPart == null
- || p_schemeSpecificPart.trim().length() == 0)
- {
- throw new MalformedURIException(
- "Cannot construct URI with null/empty scheme-specific part!");
- }
-
- setScheme(p_scheme);
- setPath(p_schemeSpecificPart);
- }
-
- /**
- * Construct a new URI that follows the generic URI syntax from its
- * component parts. Each component is validated for syntax and some
- * basic semantic checks are performed as well. See the individual
- * setter methods for specifics.
- *
- * @param p_scheme the URI scheme (cannot be null or empty)
- * @param p_host the hostname or IPv4 address for the URI
- * @param p_path the URI path - if the path contains '?' or '#',
- * then the query string and/or fragment will be
- * set from the path; however, if the query and
- * fragment are specified both in the path and as
- * separate parameters, an exception is thrown
- * @param p_queryString the URI query string (cannot be specified
- * if path is null)
- * @param p_fragment the URI fragment (cannot be specified if path
- * is null)
- *
- * @throws MalformedURIException if any of the parameters violates
- * syntax rules or semantic rules
- */
- public URI(String p_scheme, String p_host, String p_path, String p_queryString, String p_fragment)
- throws MalformedURIException
- {
- this(p_scheme, null, p_host, -1, p_path, p_queryString, p_fragment);
- }
-
- /**
- * Construct a new URI that follows the generic URI syntax from its
- * component parts. Each component is validated for syntax and some
- * basic semantic checks are performed as well. See the individual
- * setter methods for specifics.
- *
- * @param p_scheme the URI scheme (cannot be null or empty)
- * @param p_userinfo the URI userinfo (cannot be specified if host
- * is null)
- * @param p_host the hostname or IPv4 address for the URI
- * @param p_port the URI port (may be -1 for "unspecified"; cannot
- * be specified if host is null)
- * @param p_path the URI path - if the path contains '?' or '#',
- * then the query string and/or fragment will be
- * set from the path; however, if the query and
- * fragment are specified both in the path and as
- * separate parameters, an exception is thrown
- * @param p_queryString the URI query string (cannot be specified
- * if path is null)
- * @param p_fragment the URI fragment (cannot be specified if path
- * is null)
- *
- * @throws MalformedURIException if any of the parameters violates
- * syntax rules or semantic rules
- */
- public URI(String p_scheme, String p_userinfo, String p_host, int p_port, String p_path, String p_queryString, String p_fragment)
- throws MalformedURIException
- {
-
- if (p_scheme == null || p_scheme.trim().length() == 0)
- {
- throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_SCHEME_REQUIRED, null)); //"Scheme is required!");
- }
-
- if (p_host == null)
- {
- if (p_userinfo != null)
- {
- throw new MalformedURIException(
- Utils.messages.createMessage(MsgKey.ER_NO_USERINFO_IF_NO_HOST, null)); //"Userinfo may not be specified if host is not specified!");
- }
-
- if (p_port != -1)
- {
- throw new MalformedURIException(
- Utils.messages.createMessage(MsgKey.ER_NO_PORT_IF_NO_HOST, null)); //"Port may not be specified if host is not specified!");
- }
- }
-
- if (p_path != null)
- {
- if (p_path.indexOf('?') != -1 && p_queryString != null)
- {
- throw new MalformedURIException(
- Utils.messages.createMessage(MsgKey.ER_NO_QUERY_STRING_IN_PATH, null)); //"Query string cannot be specified in path and query string!");
- }
-
- if (p_path.indexOf('#') != -1 && p_fragment != null)
- {
- throw new MalformedURIException(
- Utils.messages.createMessage(MsgKey.ER_NO_FRAGMENT_STRING_IN_PATH, null)); //"Fragment cannot be specified in both the path and fragment!");
- }
- }
-
- setScheme(p_scheme);
- setHost(p_host);
- setPort(p_port);
- setUserinfo(p_userinfo);
- setPath(p_path);
- setQueryString(p_queryString);
- setFragment(p_fragment);
- }
-
- /**
- * Initialize all fields of this URI from another URI.
- *
- * @param p_other the URI to copy (cannot be null)
- */
- private void initialize(URI p_other)
- {
-
- m_scheme = p_other.getScheme();
- m_userinfo = p_other.getUserinfo();
- m_host = p_other.getHost();
- m_port = p_other.getPort();
- m_path = p_other.getPath();
- m_queryString = p_other.getQueryString();
- m_fragment = p_other.getFragment();
- }
-
- /**
- * Initializes this URI from a base URI and a URI specification string.
- * See RFC 2396 Section 4 and Appendix B for specifications on parsing
- * the URI and Section 5 for specifications on resolving relative URIs
- * and relative paths.
- *
- * @param p_base the base URI (may be null if p_uriSpec is an absolute
- * URI)
- * @param p_uriSpec the URI spec string which may be an absolute or
- * relative URI (can only be null/empty if p_base
- * is not null)
- *
- * @throws MalformedURIException if p_base is null and p_uriSpec
- * is not an absolute URI or if
- * p_uriSpec violates syntax rules
- */
- private void initialize(URI p_base, String p_uriSpec)
- throws MalformedURIException
- {
-
- if (p_base == null
- && (p_uriSpec == null || p_uriSpec.trim().length() == 0))
- {
- throw new MalformedURIException(
- Utils.messages.createMessage(MsgKey.ER_CANNOT_INIT_URI_EMPTY_PARMS, null)); //"Cannot initialize URI with empty parameters.");
- }
-
- // just make a copy of the base if spec is empty
- if (p_uriSpec == null || p_uriSpec.trim().length() == 0)
- {
- initialize(p_base);
-
- return;
- }
-
- String uriSpec = p_uriSpec.trim();
- int uriSpecLen = uriSpec.length();
- int index = 0;
-
- // check for scheme
- int colonIndex = uriSpec.indexOf(':');
- if (colonIndex < 0)
- {
- if (p_base == null)
- {
- throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_NO_SCHEME_IN_URI, new Object[]{uriSpec})); //"No scheme found in URI: "+uriSpec);
- }
- }
- else
- {
- initializeScheme(uriSpec);
- uriSpec = uriSpec.substring(colonIndex+1);
- uriSpecLen = uriSpec.length();
- }
-
- // two slashes means generic URI syntax, so we get the authority
- if (((index + 1) < uriSpecLen)
- && (uriSpec.substring(index).startsWith("//")))
- {
- index += 2;
-
- int startPos = index;
-
- // get authority - everything up to path, query or fragment
- char testChar = '\0';
-
- while (index < uriSpecLen)
- {
- testChar = uriSpec.charAt(index);
-
- if (testChar == '/' || testChar == '?' || testChar == '#')
- {
- break;
- }
-
- index++;
- }
-
- // if we found authority, parse it out, otherwise we set the
- // host to empty string
- if (index > startPos)
- {
- initializeAuthority(uriSpec.substring(startPos, index));
- }
- else
- {
- m_host = "";
- }
- }
-
- initializePath(uriSpec.substring(index));
-
- // Resolve relative URI to base URI - see RFC 2396 Section 5.2
- // In some cases, it might make more sense to throw an exception
- // (when scheme is specified is the string spec and the base URI
- // is also specified, for example), but we're just following the
- // RFC specifications
- if (p_base != null)
- {
-
- // check to see if this is the current doc - RFC 2396 5.2 #2
- // note that this is slightly different from the RFC spec in that
- // we don't include the check for query string being null
- // - this handles cases where the urispec is just a query
- // string or a fragment (e.g. "?y" or "#s") -
- // see <http://www.ics.uci.edu/~fielding/url/test1.html> which
- // identified this as a bug in the RFC
- if (m_path.length() == 0 && m_scheme == null && m_host == null)
- {
- m_scheme = p_base.getScheme();
- m_userinfo = p_base.getUserinfo();
- m_host = p_base.getHost();
- m_port = p_base.getPort();
- m_path = p_base.getPath();
-
- if (m_queryString == null)
- {
- m_queryString = p_base.getQueryString();
- }
-
- return;
- }
-
- // check for scheme - RFC 2396 5.2 #3
- // if we found a scheme, it means absolute URI, so we're done
- if (m_scheme == null)
- {
- m_scheme = p_base.getScheme();
- }
-
- // check for authority - RFC 2396 5.2 #4
- // if we found a host, then we've got a network path, so we're done
- if (m_host == null)
- {
- m_userinfo = p_base.getUserinfo();
- m_host = p_base.getHost();
- m_port = p_base.getPort();
- }
- else
- {
- return;
- }
-
- // check for absolute path - RFC 2396 5.2 #5
- if (m_path.length() > 0 && m_path.startsWith("/"))
- {
- return;
- }
-
- // if we get to this point, we need to resolve relative path
- // RFC 2396 5.2 #6
- String path = "";
- String basePath = p_base.getPath();
-
- // 6a - get all but the last segment of the base URI path
- if (basePath != null)
- {
- int lastSlash = basePath.lastIndexOf('/');
-
- if (lastSlash != -1)
- {
- path = basePath.substring(0, lastSlash + 1);
- }
- }
-
- // 6b - append the relative URI path
- path = path.concat(m_path);
-
- // 6c - remove all "./" where "." is a complete path segment
- index = -1;
-
- while ((index = path.indexOf("/./")) != -1)
- {
- path = path.substring(0, index + 1).concat(path.substring(index + 3));
- }
-
- // 6d - remove "." if path ends with "." as a complete path segment
- if (path.endsWith("/."))
- {
- path = path.substring(0, path.length() - 1);
- }
-
- // 6e - remove all "<segment>/../" where "<segment>" is a complete
- // path segment not equal to ".."
- index = -1;
-
- int segIndex = -1;
- String tempString = null;
-
- while ((index = path.indexOf("/../")) > 0)
- {
- tempString = path.substring(0, path.indexOf("/../"));
- segIndex = tempString.lastIndexOf('/');
-
- if (segIndex != -1)
- {
- if (!tempString.substring(segIndex++).equals(".."))
- {
- path = path.substring(0, segIndex).concat(path.substring(index
- + 4));
- }
- }
- }
-
- // 6f - remove ending "<segment>/.." where "<segment>" is a
- // complete path segment
- if (path.endsWith("/.."))
- {
- tempString = path.substring(0, path.length() - 3);
- segIndex = tempString.lastIndexOf('/');
-
- if (segIndex != -1)
- {
- path = path.substring(0, segIndex + 1);
- }
- }
-
- m_path = path;
- }
- }
-
- /**
- * Initialize the scheme for this URI from a URI string spec.
- *
- * @param p_uriSpec the URI specification (cannot be null)
- *
- * @throws MalformedURIException if URI does not have a conformant
- * scheme
- */
- private void initializeScheme(String p_uriSpec) throws MalformedURIException
- {
-
- int uriSpecLen = p_uriSpec.length();
- int index = 0;
- String scheme = null;
- char testChar = '\0';
-
- while (index < uriSpecLen)
- {
- testChar = p_uriSpec.charAt(index);
-
- if (testChar == ':' || testChar == '/' || testChar == '?'
- || testChar == '#')
- {
- break;
- }
-
- index++;
- }
-
- scheme = p_uriSpec.substring(0, index);
-
- if (scheme.length() == 0)
- {
- throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_NO_SCHEME_INURI, null)); //"No scheme found in URI.");
- }
- else
- {
- setScheme(scheme);
- }
- }
-
- /**
- * Initialize the authority (userinfo, host and port) for this
- * URI from a URI string spec.
- *
- * @param p_uriSpec the URI specification (cannot be null)
- *
- * @throws MalformedURIException if p_uriSpec violates syntax rules
- */
- private void initializeAuthority(String p_uriSpec)
- throws MalformedURIException
- {
-
- int index = 0;
- int start = 0;
- int end = p_uriSpec.length();
- char testChar = '\0';
- String userinfo = null;
-
- // userinfo is everything up @
- if (p_uriSpec.indexOf('@', start) != -1)
- {
- while (index < end)
- {
- testChar = p_uriSpec.charAt(index);
-
- if (testChar == '@')
- {
- break;
- }
-
- index++;
- }
-
- userinfo = p_uriSpec.substring(start, index);
-
- index++;
- }
-
- // host is everything up to ':'
- String host = null;
-
- start = index;
-
- while (index < end)
- {
- testChar = p_uriSpec.charAt(index);
-
- if (testChar == ':')
- {
- break;
- }
-
- index++;
- }
-
- host = p_uriSpec.substring(start, index);
-
- int port = -1;
-
- if (host.length() > 0)
- {
-
- // port
- if (testChar == ':')
- {
- index++;
-
- start = index;
-
- while (index < end)
- {
- index++;
- }
-
- String portStr = p_uriSpec.substring(start, index);
-
- if (portStr.length() > 0)
- {
- for (int i = 0; i < portStr.length(); i++)
- {
- if (!isDigit(portStr.charAt(i)))
- {
- throw new MalformedURIException(
- portStr + " is invalid. Port should only contain digits!");
- }
- }
-
- try
- {
- port = Integer.parseInt(portStr);
- }
- catch (NumberFormatException nfe)
- {
-
- // can't happen
- }
- }
- }
- }
-
- setHost(host);
- setPort(port);
- setUserinfo(userinfo);
- }
-
- /**
- * Initialize the path for this URI from a URI string spec.
- *
- * @param p_uriSpec the URI specification (cannot be null)
- *
- * @throws MalformedURIException if p_uriSpec violates syntax rules
- */
- private void initializePath(String p_uriSpec) throws MalformedURIException
- {
-
- if (p_uriSpec == null)
- {
- throw new MalformedURIException(
- "Cannot initialize path from null string!");
- }
-
- int index = 0;
- int start = 0;
- int end = p_uriSpec.length();
- char testChar = '\0';
-
- // path - everything up to query string or fragment
- while (index < end)
- {
- testChar = p_uriSpec.charAt(index);
-
- if (testChar == '?' || testChar == '#')
- {
- break;
- }
-
- // check for valid escape sequence
- if (testChar == '%')
- {
- if (index + 2 >= end ||!isHex(p_uriSpec.charAt(index + 1))
- ||!isHex(p_uriSpec.charAt(index + 2)))
- {
- throw new MalformedURIException(
- Utils.messages.createMessage(MsgKey.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE, null)); //"Path contains invalid escape sequence!");
- }
- }
- else if (!isReservedCharacter(testChar)
- &&!isUnreservedCharacter(testChar))
- {
- if ('\\' != testChar)
- throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_PATH_INVALID_CHAR, new Object[]{String.valueOf(testChar)})); //"Path contains invalid character: "
- //+ testChar);
- }
-
- index++;
- }
-
- m_path = p_uriSpec.substring(start, index);
-
- // query - starts with ? and up to fragment or end
- if (testChar == '?')
- {
- index++;
-
- start = index;
-
- while (index < end)
- {
- testChar = p_uriSpec.charAt(index);
-
- if (testChar == '#')
- {
- break;
- }
-
- if (testChar == '%')
- {
- if (index + 2 >= end ||!isHex(p_uriSpec.charAt(index + 1))
- ||!isHex(p_uriSpec.charAt(index + 2)))
- {
- throw new MalformedURIException(
- "Query string contains invalid escape sequence!");
- }
- }
- else if (!isReservedCharacter(testChar)
- &&!isUnreservedCharacter(testChar))
- {
- throw new MalformedURIException(
- "Query string contains invalid character:" + testChar);
- }
-
- index++;
- }
-
- m_queryString = p_uriSpec.substring(start, index);
- }
-
- // fragment - starts with #
- if (testChar == '#')
- {
- index++;
-
- start = index;
-
- while (index < end)
- {
- testChar = p_uriSpec.charAt(index);
-
- if (testChar == '%')
- {
- if (index + 2 >= end ||!isHex(p_uriSpec.charAt(index + 1))
- ||!isHex(p_uriSpec.charAt(index + 2)))
- {
- throw new MalformedURIException(
- "Fragment contains invalid escape sequence!");
- }
- }
- else if (!isReservedCharacter(testChar)
- &&!isUnreservedCharacter(testChar))
- {
- throw new MalformedURIException(
- "Fragment contains invalid character:" + testChar);
- }
-
- index++;
- }
-
- m_fragment = p_uriSpec.substring(start, index);
- }
- }
-
- /**
- * Get the scheme for this URI.
- *
- * @return the scheme for this URI
- */
- public String getScheme()
- {
- return m_scheme;
- }
-
- /**
- * Get the scheme-specific part for this URI (everything following the
- * scheme and the first colon). See RFC 2396 Section 5.2 for spec.
- *
- * @return the scheme-specific part for this URI
- */
- public String getSchemeSpecificPart()
- {
-
- final StringBuilder schemespec = new StringBuilder();
-
- if (m_userinfo != null || m_host != null || m_port != -1)
- {
- schemespec.append("//");
- }
-
- if (m_userinfo != null)
- {
- schemespec.append(m_userinfo);
- schemespec.append('@');
- }
-
- if (m_host != null)
- {
- schemespec.append(m_host);
- }
-
- if (m_port != -1)
- {
- schemespec.append(':');
- schemespec.append(m_port);
- }
-
- if (m_path != null)
- {
- schemespec.append((m_path));
- }
-
- if (m_queryString != null)
- {
- schemespec.append('?');
- schemespec.append(m_queryString);
- }
-
- if (m_fragment != null)
- {
- schemespec.append('#');
- schemespec.append(m_fragment);
- }
-
- return schemespec.toString();
- }
-
- /**
- * Get the userinfo for this URI.
- *
- * @return the userinfo for this URI (null if not specified).
- */
- public String getUserinfo()
- {
- return m_userinfo;
- }
-
- /**
- * Get the host for this URI.
- *
- * @return the host for this URI (null if not specified).
- */
- public String getHost()
- {
- return m_host;
- }
-
- /**
- * Get the port for this URI.
- *
- * @return the port for this URI (-1 if not specified).
- */
- public int getPort()
- {
- return m_port;
- }
-
- /**
- * Get the path for this URI (optionally with the query string and
- * fragment).
- *
- * @param p_includeQueryString if true (and query string is not null),
- * then a "?" followed by the query string
- * will be appended
- * @param p_includeFragment if true (and fragment is not null),
- * then a "#" followed by the fragment
- * will be appended
- *
- * @return the path for this URI possibly including the query string
- * and fragment
- */
- public String getPath(boolean p_includeQueryString,
- boolean p_includeFragment)
- {
-
- final StringBuilder pathString = new StringBuilder(m_path);
-
- if (p_includeQueryString && m_queryString != null)
- {
- pathString.append('?');
- pathString.append(m_queryString);
- }
-
- if (p_includeFragment && m_fragment != null)
- {
- pathString.append('#');
- pathString.append(m_fragment);
- }
-
- return pathString.toString();
- }
-
- /**
- * Get the path for this URI. Note that the value returned is the path
- * only and does not include the query string or fragment.
- *
- * @return the path for this URI.
- */
- public String getPath()
- {
- return m_path;
- }
-
- /**
- * Get the query string for this URI.
- *
- * @return the query string for this URI. Null is returned if there
- * was no "?" in the URI spec, empty string if there was a
- * "?" but no query string following it.
- */
- public String getQueryString()
- {
- return m_queryString;
- }
-
- /**
- * Get the fragment for this URI.
- *
- * @return the fragment for this URI. Null is returned if there
- * was no "#" in the URI spec, empty string if there was a
- * "#" but no fragment following it.
- */
- public String getFragment()
- {
- return m_fragment;
- }
-
- /**
- * Set the scheme for this URI. The scheme is converted to lowercase
- * before it is set.
- *
- * @param p_scheme the scheme for this URI (cannot be null)
- *
- * @throws MalformedURIException if p_scheme is not a conformant
- * scheme name
- */
- public void setScheme(String p_scheme) throws MalformedURIException
- {
-
- if (p_scheme == null)
- {
- throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_SCHEME_FROM_NULL_STRING, null)); //"Cannot set scheme from null string!");
- }
-
- if (!isConformantSchemeName(p_scheme))
- {
- throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_SCHEME_NOT_CONFORMANT, null)); //"The scheme is not conformant.");
- }
-
- m_scheme = p_scheme.toLowerCase();
- }
-
- /**
- * Set the userinfo for this URI. If a non-null value is passed in and
- * the host value is null, then an exception is thrown.
- *
- * @param p_userinfo the userinfo for this URI
- *
- * @throws MalformedURIException if p_userinfo contains invalid
- * characters
- */
- public void setUserinfo(String p_userinfo) throws MalformedURIException
- {
-
- if (p_userinfo == null)
- {
- m_userinfo = null;
- }
- else
- {
- if (m_host == null)
- {
- throw new MalformedURIException(
- "Userinfo cannot be set when host is null!");
- }
-
- // userinfo can contain alphanumerics, mark characters, escaped
- // and ';',':','&','=','+','$',','
- int index = 0;
- int end = p_userinfo.length();
- char testChar = '\0';
-
- while (index < end)
- {
- testChar = p_userinfo.charAt(index);
-
- if (testChar == '%')
- {
- if (index + 2 >= end ||!isHex(p_userinfo.charAt(index + 1))
- ||!isHex(p_userinfo.charAt(index + 2)))
- {
- throw new MalformedURIException(
- "Userinfo contains invalid escape sequence!");
- }
- }
- else if (!isUnreservedCharacter(testChar)
- && USERINFO_CHARACTERS.indexOf(testChar) == -1)
- {
- throw new MalformedURIException(
- "Userinfo contains invalid character:" + testChar);
- }
-
- index++;
- }
- }
-
- m_userinfo = p_userinfo;
- }
-
- /**
- * Set the host for this URI. If null is passed in, the userinfo
- * field is also set to null and the port is set to -1.
- *
- * @param p_host the host for this URI
- *
- * @throws MalformedURIException if p_host is not a valid IP
- * address or DNS hostname.
- */
- public void setHost(String p_host) throws MalformedURIException
- {
-
- if (p_host == null || p_host.trim().length() == 0)
- {
- m_host = p_host;
- m_userinfo = null;
- m_port = -1;
- }
- else if (!isWellFormedAddress(p_host))
- {
- throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_HOST_ADDRESS_NOT_WELLFORMED, null)); //"Host is not a well formed address!");
- }
-
- m_host = p_host;
- }
-
- /**
- * Set the port for this URI. -1 is used to indicate that the port is
- * not specified, otherwise valid port numbers are between 0 and 65535.
- * If a valid port number is passed in and the host field is null,
- * an exception is thrown.
- *
- * @param p_port the port number for this URI
- *
- * @throws MalformedURIException if p_port is not -1 and not a
- * valid port number
- */
- public void setPort(int p_port) throws MalformedURIException
- {
-
- if (p_port >= 0 && p_port <= 65535)
- {
- if (m_host == null)
- {
- throw new MalformedURIException(
- Utils.messages.createMessage(MsgKey.ER_PORT_WHEN_HOST_NULL, null)); //"Port cannot be set when host is null!");
- }
- }
- else if (p_port != -1)
- {
- throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_INVALID_PORT, null)); //"Invalid port number!");
- }
-
- m_port = p_port;
- }
-
- /**
- * Set the path for this URI. If the supplied path is null, then the
- * query string and fragment are set to null as well. If the supplied
- * path includes a query string and/or fragment, these fields will be
- * parsed and set as well. Note that, for URIs following the "generic
- * URI" syntax, the path specified should start with a slash.
- * For URIs that do not follow the generic URI syntax, this method
- * sets the scheme-specific part.
- *
- * @param p_path the path for this URI (may be null)
- *
- * @throws MalformedURIException if p_path contains invalid
- * characters
- */
- public void setPath(String p_path) throws MalformedURIException
- {
-
- if (p_path == null)
- {
- m_path = null;
- m_queryString = null;
- m_fragment = null;
- }
- else
- {
- initializePath(p_path);
- }
- }
-
- /**
- * Append to the end of the path of this URI. If the current path does
- * not end in a slash and the path to be appended does not begin with
- * a slash, a slash will be appended to the current path before the
- * new segment is added. Also, if the current path ends in a slash
- * and the new segment begins with a slash, the extra slash will be
- * removed before the new segment is appended.
- *
- * @param p_addToPath the new segment to be added to the current path
- *
- * @throws MalformedURIException if p_addToPath contains syntax
- * errors
- */
- public void appendPath(String p_addToPath) throws MalformedURIException
- {
-
- if (p_addToPath == null || p_addToPath.trim().length() == 0)
- {
- return;
- }
-
- if (!isURIString(p_addToPath))
- {
- throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_PATH_INVALID_CHAR, new Object[]{p_addToPath})); //"Path contains invalid character!");
- }
-
- if (m_path == null || m_path.trim().length() == 0)
- {
- if (p_addToPath.startsWith("/"))
- {
- m_path = p_addToPath;
- }
- else
- {
- m_path = "/" + p_addToPath;
- }
- }
- else if (m_path.endsWith("/"))
- {
- if (p_addToPath.startsWith("/"))
- {
- m_path = m_path.concat(p_addToPath.substring(1));
- }
- else
- {
- m_path = m_path.concat(p_addToPath);
- }
- }
- else
- {
- if (p_addToPath.startsWith("/"))
- {
- m_path = m_path.concat(p_addToPath);
- }
- else
- {
- m_path = m_path.concat("/" + p_addToPath);
- }
- }
- }
-
- /**
- * Set the query string for this URI. A non-null value is valid only
- * if this is an URI conforming to the generic URI syntax and
- * the path value is not null.
- *
- * @param p_queryString the query string for this URI
- *
- * @throws MalformedURIException if p_queryString is not null and this
- * URI does not conform to the generic
- * URI syntax or if the path is null
- */
- public void setQueryString(String p_queryString)
- throws MalformedURIException
- {
-
- if (p_queryString == null)
- {
- m_queryString = null;
- }
- else if (!isGenericURI())
- {
- throw new MalformedURIException(
- "Query string can only be set for a generic URI!");
- }
- else if (getPath() == null)
- {
- throw new MalformedURIException(
- "Query string cannot be set when path is null!");
- }
- else if (!isURIString(p_queryString))
- {
- throw new MalformedURIException(
- "Query string contains invalid character!");
- }
- else
- {
- m_queryString = p_queryString;
- }
- }
-
- /**
- * Set the fragment for this URI. A non-null value is valid only
- * if this is a URI conforming to the generic URI syntax and
- * the path value is not null.
- *
- * @param p_fragment the fragment for this URI
- *
- * @throws MalformedURIException if p_fragment is not null and this
- * URI does not conform to the generic
- * URI syntax or if the path is null
- */
- public void setFragment(String p_fragment) throws MalformedURIException
- {
-
- if (p_fragment == null)
- {
- m_fragment = null;
- }
- else if (!isGenericURI())
- {
- throw new MalformedURIException(
- Utils.messages.createMessage(MsgKey.ER_FRAG_FOR_GENERIC_URI, null)); //"Fragment can only be set for a generic URI!");
- }
- else if (getPath() == null)
- {
- throw new MalformedURIException(
- Utils.messages.createMessage(MsgKey.ER_FRAG_WHEN_PATH_NULL, null)); //"Fragment cannot be set when path is null!");
- }
- else if (!isURIString(p_fragment))
- {
- throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_FRAG_INVALID_CHAR, null)); //"Fragment contains invalid character!");
- }
- else
- {
- m_fragment = p_fragment;
- }
- }
-
- /**
- * Determines if the passed-in Object is equivalent to this URI.
- *
- * @param p_test the Object to test for equality.
- *
- * @return true if p_test is a URI with all values equal to this
- * URI, false otherwise
- */
- @Override
- public boolean equals(Object p_test)
- {
-
- if (p_test instanceof URI)
- {
- URI testURI = (URI) p_test;
-
- if (((m_scheme == null && testURI.m_scheme == null) || (m_scheme != null && testURI.m_scheme != null && m_scheme.equals(
- testURI.m_scheme))) && ((m_userinfo == null && testURI.m_userinfo == null) || (m_userinfo != null && testURI.m_userinfo != null && m_userinfo.equals(
- testURI.m_userinfo))) && ((m_host == null && testURI.m_host == null) || (m_host != null && testURI.m_host != null && m_host.equals(
- testURI.m_host))) && m_port == testURI.m_port && ((m_path == null && testURI.m_path == null) || (m_path != null && testURI.m_path != null && m_path.equals(
- testURI.m_path))) && ((m_queryString == null && testURI.m_queryString == null) || (m_queryString != null && testURI.m_queryString != null && m_queryString.equals(
- testURI.m_queryString))) && ((m_fragment == null && testURI.m_fragment == null) || (m_fragment != null && testURI.m_fragment != null && m_fragment.equals(
- testURI.m_fragment))))
- {
- return true;
- }
- }
-
- return false;
- }
-
- @Override
- public int hashCode() {
- int hash = 5;
- hash = 41 * hash + Objects.hashCode(this.m_scheme);
- hash = 41 * hash + Objects.hashCode(this.m_userinfo);
- hash = 41 * hash + Objects.hashCode(this.m_host);
- hash = 41 * hash + this.m_port;
- hash = 41 * hash + Objects.hashCode(this.m_path);
- hash = 41 * hash + Objects.hashCode(this.m_queryString);
- hash = 41 * hash + Objects.hashCode(this.m_fragment);
- return hash;
- }
-
- /**
- * Get the URI as a string specification. See RFC 2396 Section 5.2.
- *
- * @return the URI string specification
- */
- @Override
- public String toString()
- {
-
- final StringBuilder uriSpecString = new StringBuilder();
-
- if (m_scheme != null)
- {
- uriSpecString.append(m_scheme);
- uriSpecString.append(':');
- }
-
- uriSpecString.append(getSchemeSpecificPart());
-
- return uriSpecString.toString();
- }
-
- /**
- * Get the indicator as to whether this URI uses the "generic URI"
- * syntax.
- *
- * @return true if this URI uses the "generic URI" syntax, false
- * otherwise
- */
- public boolean isGenericURI()
- {
-
- // presence of the host (whether valid or empty) means
- // double-slashes which means generic uri
- return (m_host != null);
- }
-
- /**
- * Determine whether a scheme conforms to the rules for a scheme name.
- * A scheme is conformant if it starts with an alphanumeric, and
- * contains only alphanumerics, '+','-' and '.'.
- *
- *
- * @param p_scheme The sheme name to check
- * @return true if the scheme is conformant, false otherwise
- */
- public static boolean isConformantSchemeName(String p_scheme)
- {
-
- if (p_scheme == null || p_scheme.trim().length() == 0)
- {
- return false;
- }
-
- if (!isAlpha(p_scheme.charAt(0)))
- {
- return false;
- }
-
- char testChar;
-
- for (int i = 1; i < p_scheme.length(); i++)
- {
- testChar = p_scheme.charAt(i);
-
- if (!isAlphanum(testChar) && SCHEME_CHARACTERS.indexOf(testChar) == -1)
- {
- return false;
- }
- }
-
- return true;
- }
-
- /**
- * Determine whether a string is syntactically capable of representing
- * a valid IPv4 address or the domain name of a network host. A valid
- * IPv4 address consists of four decimal digit groups separated by a
- * '.'. A hostname consists of domain labels (each of which must
- * begin and end with an alphanumeric but may contain '-') separated
- * & by a '.'. See RFC 2396 Section 3.2.2.
- *
- *
- * @param p_address The address string to check
- * @return true if the string is a syntactically valid IPv4 address
- * or hostname
- */
- public static boolean isWellFormedAddress(String p_address)
- {
-
- if (p_address == null)
- {
- return false;
- }
-
- String address = p_address.trim();
- int addrLength = address.length();
-
- if (addrLength == 0 || addrLength > 255)
- {
- return false;
- }
-
- if (address.startsWith(".") || address.startsWith("-"))
- {
- return false;
- }
-
- // rightmost domain label starting with digit indicates IP address
- // since top level domain label can only start with an alpha
- // see RFC 2396 Section 3.2.2
- int index = address.lastIndexOf('.');
-
- if (address.endsWith("."))
- {
- index = address.substring(0, index).lastIndexOf('.');
- }
-
- if (index + 1 < addrLength && isDigit(p_address.charAt(index + 1)))
- {
- char testChar;
- int numDots = 0;
-
- // make sure that 1) we see only digits and dot separators, 2) that
- // any dot separator is preceded and followed by a digit and
- // 3) that we find 3 dots
- for (int i = 0; i < addrLength; i++)
- {
- testChar = address.charAt(i);
-
- if (testChar == '.')
- {
- if (!isDigit(address.charAt(i - 1))
- || (i + 1 < addrLength &&!isDigit(address.charAt(i + 1))))
- {
- return false;
- }
-
- numDots++;
- }
- else if (!isDigit(testChar))
- {
- return false;
- }
- }
-
- if (numDots != 3)
- {
- return false;
- }
- }
- else
- {
-
- // domain labels can contain alphanumerics and '-"
- // but must start and end with an alphanumeric
- char testChar;
-
- for (int i = 0; i < addrLength; i++)
- {
- testChar = address.charAt(i);
-
- if (testChar == '.')
- {
- if (!isAlphanum(address.charAt(i - 1)))
- {
- return false;
- }
-
- if (i + 1 < addrLength &&!isAlphanum(address.charAt(i + 1)))
- {
- return false;
- }
- }
- else if (!isAlphanum(testChar) && testChar != '-')
- {
- return false;
- }
- }
- }
-
- return true;
- }
-
- /**
- * Determine whether a char is a digit.
- *
- *
- * @param p_char the character to check
- * @return true if the char is betweeen '0' and '9', false otherwise
- */
- private static boolean isDigit(char p_char)
- {
- return p_char >= '0' && p_char <= '9';
- }
-
- /**
- * Determine whether a character is a hexadecimal character.
- *
- *
- * @param p_char the character to check
- * @return true if the char is between '0' and '9', 'a' and 'f'
- * or 'A' and 'F', false otherwise
- */
- private static boolean isHex(char p_char)
- {
- return (isDigit(p_char) || (p_char >= 'a' && p_char <= 'f')
- || (p_char >= 'A' && p_char <= 'F'));
- }
-
- /**
- * Determine whether a char is an alphabetic character: a-z or A-Z
- *
- *
- * @param p_char the character to check
- * @return true if the char is alphabetic, false otherwise
- */
- private static boolean isAlpha(char p_char)
- {
- return ((p_char >= 'a' && p_char <= 'z')
- || (p_char >= 'A' && p_char <= 'Z'));
- }
-
- /**
- * Determine whether a char is an alphanumeric: 0-9, a-z or A-Z
- *
- *
- * @param p_char the character to check
- * @return true if the char is alphanumeric, false otherwise
- */
- private static boolean isAlphanum(char p_char)
- {
- return (isAlpha(p_char) || isDigit(p_char));
- }
-
- /**
- * Determine whether a character is a reserved character:
- * ';', '/', '?', ':', '@', '&', '=', '+', '$' or ','
- *
- *
- * @param p_char the character to check
- * @return true if the string contains any reserved characters
- */
- private static boolean isReservedCharacter(char p_char)
- {
- return RESERVED_CHARACTERS.indexOf(p_char) != -1;
- }
-
- /**
- * Determine whether a char is an unreserved character.
- *
- *
- * @param p_char the character to check
- * @return true if the char is unreserved, false otherwise
- */
- private static boolean isUnreservedCharacter(char p_char)
- {
- return (isAlphanum(p_char) || MARK_CHARACTERS.indexOf(p_char) != -1);
- }
-
- /**
- * Determine whether a given string contains only URI characters (also
- * called "uric" in RFC 2396). uric consist of all reserved
- * characters, unreserved characters and escaped characters.
- *
- *
- * @param p_uric URI string
- * @return true if the string is comprised of uric, false otherwise
- */
- private static boolean isURIString(String p_uric)
- {
-
- if (p_uric == null)
- {
- return false;
- }
-
- int end = p_uric.length();
- char testChar = '\0';
-
- for (int i = 0; i < end; i++)
- {
- testChar = p_uric.charAt(i);
-
- if (testChar == '%')
- {
- if (i + 2 >= end ||!isHex(p_uric.charAt(i + 1))
- ||!isHex(p_uric.charAt(i + 2)))
- {
- return false;
- }
- else
- {
- i += 2;
-
- continue;
- }
- }
-
- if (isReservedCharacter(testChar) || isUnreservedCharacter(testChar))
- {
- continue;
- }
- else
- {
- return false;
- }
- }
-
- return true;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/utils/Utils.java b/src/com/sun/org/apache/xml/internal/serializer/utils/Utils.java
deleted file mode 100644
index 57be3ca..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/utils/Utils.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Utils.java,v 1.1.4.1 2005/09/08 11:03:21 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.serializer.utils;
-
-/**
- * This class contains utilities used by the serializer.
- *
- * This class is not a public API, it is only public because it is
- * used by com.sun.org.apache.xml.internal.serializer.
- *
- * @xsl.usage internal
- */
-public final class Utils
-{
- /**
- * A singleton Messages object is used to load the
- * given resource bundle just once, it is
- * used by multiple transformations as long as the JVM stays up.
- */
- public static final com.sun.org.apache.xml.internal.serializer.utils.Messages messages=
- new com.sun.org.apache.xml.internal.serializer.utils.Messages(
- "com.sun.org.apache.xml.internal.serializer.utils.SerializerMessages");
-}
diff --git a/src/com/sun/org/apache/xml/internal/serializer/utils/WrappedRuntimeException.java b/src/com/sun/org/apache/xml/internal/serializer/utils/WrappedRuntimeException.java
deleted file mode 100644
index 758e30f..0000000
--- a/src/com/sun/org/apache/xml/internal/serializer/utils/WrappedRuntimeException.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: WrappedRuntimeException.java,v 1.1.4.1 2005/09/08 11:03:21 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.serializer.utils;
-
-/**
- * This class is for throwing important checked exceptions
- * over non-checked methods. It should be used with care,
- * and in limited circumstances.
- *
- * This class is a copy of the one in com.sun.org.apache.xml.internal.utils.
- * It exists to cut the serializers dependancy on that package.
- *
- * This class is not a public API, it is only public because it is
- * used by com.sun.org.apache.xml.internal.serializer.
- * @xsl.usage internal
- */
-public final class WrappedRuntimeException extends RuntimeException
-{
- static final long serialVersionUID = 7140414456714658073L;
-
- /** Primary checked exception.
- * @serial */
- private Exception m_exception;
-
- /**
- * Construct a WrappedRuntimeException from a
- * checked exception.
- *
- * @param e Primary checked exception
- */
- public WrappedRuntimeException(Exception e)
- {
-
- super(e.getMessage());
-
- m_exception = e;
- }
-
- /**
- * Constructor WrappedRuntimeException
- *
- *
- * @param msg Exception information.
- * @param e Primary checked exception
- */
- public WrappedRuntimeException(String msg, Exception e)
- {
-
- super(msg);
-
- m_exception = e;
- }
-
- /**
- * Get the checked exception that this runtime exception wraps.
- *
- * @return The primary checked exception
- */
- public Exception getException()
- {
- return m_exception;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/AttList.java b/src/com/sun/org/apache/xml/internal/utils/AttList.java
deleted file mode 100644
index 8437ffd..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/AttList.java
+++ /dev/null
@@ -1,256 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: AttList.java,v 1.2.4.1 2005/09/15 08:15:35 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-import org.xml.sax.Attributes;
-
-/**
- * Wraps a DOM attribute list in a SAX Attributes.
- * @xsl.usage internal
- */
-public class AttList implements Attributes
-{
-
- /** List of attribute nodes */
- NamedNodeMap m_attrs;
-
- /** Index of last attribute node */
- int m_lastIndex;
-
- // ARGHH!! JAXP Uses Xerces without setting the namespace processing to ON!
- // DOM2Helper m_dh = new DOM2Helper();
-
- /** Local reference to DOMHelper */
- DOMHelper m_dh;
-
-// /**
-// * Constructor AttList
-// *
-// *
-// * @param attrs List of attributes this will contain
-// */
-// public AttList(NamedNodeMap attrs)
-// {
-//
-// m_attrs = attrs;
-// m_lastIndex = m_attrs.getLength() - 1;
-// m_dh = new DOM2Helper();
-// }
-
- /**
- * Constructor AttList
- *
- *
- * @param attrs List of attributes this will contain
- * @param dh DOMHelper
- */
- public AttList(NamedNodeMap attrs, DOMHelper dh)
- {
-
- m_attrs = attrs;
- m_lastIndex = m_attrs.getLength() - 1;
- m_dh = dh;
- }
-
- /**
- * Get the number of attribute nodes in the list
- *
- *
- * @return number of attribute nodes
- */
- public int getLength()
- {
- return m_attrs.getLength();
- }
-
- /**
- * Look up an attribute's Namespace URI by index.
- *
- * @param index The attribute index (zero-based).
- * @return The Namespace URI, or the empty string if none
- * is available, or null if the index is out of
- * range.
- */
- public String getURI(int index)
- {
- String ns = m_dh.getNamespaceOfNode(((Attr) m_attrs.item(index)));
- if(null == ns)
- ns = "";
- return ns;
- }
-
- /**
- * Look up an attribute's local name by index.
- *
- * @param index The attribute index (zero-based).
- * @return The local name, or the empty string if Namespace
- * processing is not being performed, or null
- * if the index is out of range.
- */
- public String getLocalName(int index)
- {
- return m_dh.getLocalNameOfNode(((Attr) m_attrs.item(index)));
- }
-
- /**
- * Look up an attribute's qualified name by index.
- *
- *
- * @param i The attribute index (zero-based).
- *
- * @return The attribute's qualified name
- */
- public String getQName(int i)
- {
- return ((Attr) m_attrs.item(i)).getName();
- }
-
- /**
- * Get the attribute's node type by index
- *
- *
- * @param i The attribute index (zero-based)
- *
- * @return the attribute's node type
- */
- public String getType(int i)
- {
- return "CDATA"; // for the moment
- }
-
- /**
- * Get the attribute's node value by index
- *
- *
- * @param i The attribute index (zero-based)
- *
- * @return the attribute's node value
- */
- public String getValue(int i)
- {
- return ((Attr) m_attrs.item(i)).getValue();
- }
-
- /**
- * Get the attribute's node type by name
- *
- *
- * @param name Attribute name
- *
- * @return the attribute's node type
- */
- public String getType(String name)
- {
- return "CDATA"; // for the moment
- }
-
- /**
- * Look up an attribute's type by Namespace name.
- *
- * @param uri The Namespace URI, or the empty String if the
- * name has no Namespace URI.
- * @param localName The local name of the attribute.
- * @return The attribute type as a string, or null if the
- * attribute is not in the list or if Namespace
- * processing is not being performed.
- */
- public String getType(String uri, String localName)
- {
- return "CDATA"; // for the moment
- }
-
- /**
- * Look up an attribute's value by name.
- *
- *
- * @param name The attribute node's name
- *
- * @return The attribute node's value
- */
- public String getValue(String name)
- {
- Attr attr = ((Attr) m_attrs.getNamedItem(name));
- return (null != attr)
- ? attr.getValue() : null;
- }
-
- /**
- * Look up an attribute's value by Namespace name.
- *
- * @param uri The Namespace URI, or the empty String if the
- * name has no Namespace URI.
- * @param localName The local name of the attribute.
- * @return The attribute value as a string, or null if the
- * attribute is not in the list.
- */
- public String getValue(String uri, String localName)
- {
- Node a=m_attrs.getNamedItemNS(uri,localName);
- return (a==null) ? null : a.getNodeValue();
- }
-
- /**
- * Look up the index of an attribute by Namespace name.
- *
- * @param uri The Namespace URI, or the empty string if
- * the name has no Namespace URI.
- * @param localPart The attribute's local name.
- * @return The index of the attribute, or -1 if it does not
- * appear in the list.
- */
- public int getIndex(String uri, String localPart)
- {
- for(int i=m_attrs.getLength()-1;i>=0;--i)
- {
- Node a=m_attrs.item(i);
- String u=a.getNamespaceURI();
- if( (u==null ? uri==null : u.equals(uri))
- &&
- a.getLocalName().equals(localPart) )
- return i;
- }
- return -1;
- }
-
- /**
- * Look up the index of an attribute by raw XML 1.0 name.
- *
- * @param qName The qualified (prefixed) name.
- * @return The index of the attribute, or -1 if it does not
- * appear in the list.
- */
- public int getIndex(String qName)
- {
- for(int i=m_attrs.getLength()-1;i>=0;--i)
- {
- Node a=m_attrs.item(i);
- if(a.getNodeName().equals(qName) )
- return i;
- }
- return -1;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/BoolStack.java b/src/com/sun/org/apache/xml/internal/utils/BoolStack.java
deleted file mode 100644
index b47dc5c..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/BoolStack.java
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: BoolStack.java,v 1.2.4.1 2005/09/15 08:15:35 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-
-/**
- * Simple stack for boolean values.
- * @xsl.usage internal
- */
-public final class BoolStack implements Cloneable
-{
-
- /** Array of boolean values */
- private boolean m_values[];
-
- /** Array size allocated */
- private int m_allocatedSize;
-
- /** Index into the array of booleans */
- private int m_index;
-
- /**
- * Default constructor. Note that the default
- * block size is very small, for small lists.
- */
- public BoolStack()
- {
- this(32);
- }
-
- /**
- * Construct a IntVector, using the given block size.
- *
- * @param size array size to allocate
- */
- public BoolStack(int size)
- {
-
- m_allocatedSize = size;
- m_values = new boolean[size];
- m_index = -1;
- }
-
- /**
- * Get the length of the list.
- *
- * @return Current length of the list
- */
- public final int size()
- {
- return m_index + 1;
- }
-
- /**
- * Clears the stack.
- *
- */
- public final void clear()
- {
- m_index = -1;
- }
-
- /**
- * Pushes an item onto the top of this stack.
- *
- *
- * @param val the boolean to be pushed onto this stack.
- * @return the <code>item</code> argument.
- */
- public final boolean push(boolean val)
- {
-
- if (m_index == m_allocatedSize - 1)
- grow();
-
- return (m_values[++m_index] = val);
- }
-
- /**
- * Removes the object at the top of this stack and returns that
- * object as the value of this function.
- *
- * @return The object at the top of this stack.
- * @throws EmptyStackException if this stack is empty.
- */
- public final boolean pop()
- {
- return m_values[m_index--];
- }
-
- /**
- * Removes the object at the top of this stack and returns the
- * next object at the top as the value of this function.
- *
- *
- * @return Next object to the top or false if none there
- */
- public final boolean popAndTop()
- {
-
- m_index--;
-
- return (m_index >= 0) ? m_values[m_index] : false;
- }
-
- /**
- * Set the item at the top of this stack
- *
- *
- * @param b Object to set at the top of this stack
- */
- public final void setTop(boolean b)
- {
- m_values[m_index] = b;
- }
-
- /**
- * Looks at the object at the top of this stack without removing it
- * from the stack.
- *
- * @return the object at the top of this stack.
- * @throws EmptyStackException if this stack is empty.
- */
- public final boolean peek()
- {
- return m_values[m_index];
- }
-
- /**
- * Looks at the object at the top of this stack without removing it
- * from the stack. If the stack is empty, it returns false.
- *
- * @return the object at the top of this stack.
- */
- public final boolean peekOrFalse()
- {
- return (m_index > -1) ? m_values[m_index] : false;
- }
-
- /**
- * Looks at the object at the top of this stack without removing it
- * from the stack. If the stack is empty, it returns true.
- *
- * @return the object at the top of this stack.
- */
- public final boolean peekOrTrue()
- {
- return (m_index > -1) ? m_values[m_index] : true;
- }
-
- /**
- * Tests if this stack is empty.
- *
- * @return <code>true</code> if this stack is empty;
- * <code>false</code> otherwise.
- */
- public boolean isEmpty()
- {
- return (m_index == -1);
- }
-
- /**
- * Grows the size of the stack
- *
- */
- private void grow()
- {
-
- m_allocatedSize *= 2;
-
- boolean newVector[] = new boolean[m_allocatedSize];
-
- System.arraycopy(m_values, 0, newVector, 0, m_index + 1);
-
- m_values = newVector;
- }
-
- public Object clone()
- throws CloneNotSupportedException
- {
- return super.clone();
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/CharKey.java b/src/com/sun/org/apache/xml/internal/utils/CharKey.java
deleted file mode 100644
index 64c9406..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/CharKey.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: CharKey.java,v 1.3 2005/09/28 13:49:18 pvedula Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-/**
- * Simple class for fast lookup of char values, when used with
- * hashtables. You can set the char, then use it as a key.
- * @xsl.usage internal
- */
-public class CharKey extends Object
-{
-
- /** String value */
- private char m_char;
-
- /**
- * Constructor CharKey
- *
- * @param key char value of this object.
- */
- public CharKey(char key)
- {
- m_char = key;
- }
-
- /**
- * Default constructor for a CharKey.
- */
- public CharKey()
- {
- }
-
- /**
- * Get the hash value of the character.
- *
- * @return hash value of the character.
- */
- public final void setChar(char c)
- {
- m_char = c;
- }
-
-
-
- /**
- * Get the hash value of the character.
- *
- * @return hash value of the character.
- */
- public final int hashCode()
- {
- return (int)m_char;
- }
-
- /**
- * Override of equals() for this object
- *
- * @param obj to compare to
- *
- * @return True if this object equals this string value
- */
- public final boolean equals(Object obj)
- {
- return ((CharKey)obj).m_char == m_char;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/Constants.java b/src/com/sun/org/apache/xml/internal/utils/Constants.java
deleted file mode 100644
index c027234..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/Constants.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Constants.java,v 1.2.4.1 2005/09/15 08:15:37 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-/**
- * Primary constants used by the XSLT Processor
- * @xsl.usage advanced
- */
-public class Constants
-{
-
- /**
- * Mnemonics for standard XML Namespace URIs, as Java Strings:
- * <ul>
- * <li>S_XMLNAMESPACEURI (http://www.w3.org/XML/1998/namespace) is the
- * URI permanantly assigned to the "xml:" prefix. This is used for some
- * features built into the XML specification itself, such as xml:space
- * and xml:lang. It was defined by the W3C's XML Namespaces spec.</li>
- * <li>S_XSLNAMESPACEURL (http://www.w3.org/1999/XSL/Transform) is the
- * URI which indicates that a name may be an XSLT directive. In most
- * XSLT stylesheets, this is bound to the "xsl:" prefix. It's defined
- * by the W3C's XSLT Recommendation.</li>
- * <li>S_OLDXSLNAMESPACEURL (http://www.w3.org/XSL/Transform/1.0) was
- * used in early prototypes of XSLT processors for much the same purpose
- * as S_XSLNAMESPACEURL. It is now considered obsolete, and the version
- * of XSLT which it signified is not fully compatable with the final
- * XSLT Recommendation, so what it really signifies is a badly obsolete
- * stylesheet.</li>
- * </ul> */
- public static final String
- S_XMLNAMESPACEURI = "http://www.w3.org/XML/1998/namespace",
- S_XSLNAMESPACEURL = "http://www.w3.org/1999/XSL/Transform",
- S_OLDXSLNAMESPACEURL = "http://www.w3.org/XSL/Transform/1.0";
-
- /** Authorship mnemonics, as Java Strings. Not standardized,
- * as far as I know.
- * <ul>
- * <li>S_VENDOR -- the name of the organization/individual who published
- * this XSLT processor. </li>
- * <li>S_VENDORURL -- URL where one can attempt to retrieve more
- * information about this publisher and product.</li>
- * </ul>
- */
- public static final String
- S_VENDOR = "Apache Software Foundation",
- S_VENDORURL = "http://xml.apache.org";
-
- /** S_BUILTIN_EXTENSIONS_URL is a mnemonic for the XML Namespace
- *(http://xml.apache.org/xalan) predefined to signify Xalan's
- * built-in XSLT Extensions. When used in stylesheets, this is often
- * bound to the "xalan:" prefix.
- */
- public static final String
- S_BUILTIN_EXTENSIONS_URL = "http://xml.apache.org/xalan";
-
- /**
- * The old built-in extension url. It is still supported for
- * backward compatibility.
- */
- public static final String
- S_BUILTIN_OLD_EXTENSIONS_URL = "http://xml.apache.org/xslt";
-
- /**
- * Xalan extension namespaces.
- */
- public static final String
- // The old namespace for Java extension
- S_EXTENSIONS_OLD_JAVA_URL = "http://xml.apache.org/xslt/java",
- // The new namespace for Java extension
- S_EXTENSIONS_JAVA_URL = "http://xml.apache.org/xalan/java",
- S_EXTENSIONS_LOTUSXSL_JAVA_URL = "http://xsl.lotus.com/java",
- S_EXTENSIONS_XALANLIB_URL = "http://xml.apache.org/xalan",
- S_EXTENSIONS_REDIRECT_URL = "http://xml.apache.org/xalan/redirect",
- S_EXTENSIONS_PIPE_URL = "http://xml.apache.org/xalan/PipeDocument",
- S_EXTENSIONS_SQL_URL = "http://xml.apache.org/xalan/sql";
-
- /**
- * EXSLT extension namespaces.
- */
- public static final String
- S_EXSLT_COMMON_URL = "http://exslt.org/common",
- S_EXSLT_MATH_URL = "http://exslt.org/math",
- S_EXSLT_SETS_URL = "http://exslt.org/sets",
- S_EXSLT_DATETIME_URL = "http://exslt.org/dates-and-times",
- S_EXSLT_FUNCTIONS_URL = "http://exslt.org/functions",
- S_EXSLT_DYNAMIC_URL = "http://exslt.org/dynamic",
- S_EXSLT_STRINGS_URL = "http://exslt.org/strings";
-
-
- /**
- * The minimum version of XSLT supported by this processor.
- */
- public static final double XSLTVERSUPPORTED = 1.0;
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/DOM2Helper.java b/src/com/sun/org/apache/xml/internal/utils/DOM2Helper.java
deleted file mode 100644
index c23f08e..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/DOM2Helper.java
+++ /dev/null
@@ -1,316 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DOM2Helper.java,v 1.2.4.1 2005/09/15 08:15:37 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-import java.io.IOException;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.TransformerException;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-import org.xml.sax.InputSource;
-
-/**
- * @deprecated Since the introduction of the DTM, this class will be removed.
- * This class provides a DOM level 2 "helper", which provides services currently
- * not provided be the DOM standard.
- */
-public class DOM2Helper extends DOMHelper
-{
-
- /**
- * Construct an instance.
- */
- public DOM2Helper(){}
-
- /**
- * Check node to see if it was created by a DOM implementation
- * that this helper is intended to support. This is currently
- * disabled, and assumes all nodes are acceptable rather than checking
- * that they implement com.sun.org.apache.xerces.internal.dom.NodeImpl.
- *
- * @param node The node to be tested.
- *
- * @throws TransformerException if the node is not one which this
- * DOM2Helper can support. If we return without throwing the exception,
- * the node is compatable.
- * @xsl.usage internal
- */
- public void checkNode(Node node) throws TransformerException
- {
-
- // if(!(node instanceof com.sun.org.apache.xerces.internal.dom.NodeImpl))
- // throw new TransformerException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_XERCES_CANNOT_HANDLE_NODES, new Object[]{((Object)node).getClass()})); //"DOM2Helper can not handle nodes of type"
- //+((Object)node).getClass());
- }
-
- /**
- * Returns true if the DOM implementation handled by this helper
- * supports the SAX ContentHandler interface.
- *
- * @return true (since Xerces does).
- */
- public boolean supportsSAX()
- {
- return true;
- }
-
- /** Field m_doc: Document Node for the document this helper is currently
- * accessing or building
- * @see #setDocument
- * @see #getDocument
- * */
- private Document m_doc;
-
- /**
- * Specify which document this helper is currently operating on.
- *
- * @param doc The DOM Document node for this document.
- * @see #getDocument
- */
- public void setDocument(Document doc)
- {
- m_doc = doc;
- }
-
- /**
- * Query which document this helper is currently operating on.
- *
- * @return The DOM Document node for this document.
- * @see #setDocument
- */
- public Document getDocument()
- {
- return m_doc;
- }
-
- /**
- * Parse an XML document.
- *
- * <p>Right now the Xerces DOMParser class is used. This needs
- * fixing, either via jaxp, or via some other, standard method.</p>
- *
- * <p>The application can use this method to instruct the SAX parser
- * to begin parsing an XML document from any valid input
- * source (a character stream, a byte stream, or a URI).</p>
- *
- * <p>Applications may not invoke this method while a parse is in
- * progress (they should create a new Parser instead for each
- * additional XML document). Once a parse is complete, an
- * application may reuse the same Parser object, possibly with a
- * different input source.</p>
- *
- * @param source The input source for the top-level of the
- * XML document.
- *
- * @throws TransformerException if any checked exception is thrown.
- * @xsl.usage internal
- */
- public void parse(InputSource source) throws TransformerException
- {
-
- try
- {
-
- // I guess I should use JAXP factory here... when it's legal.
- // com.sun.org.apache.xerces.internal.parsers.DOMParser parser
- // = new com.sun.org.apache.xerces.internal.parsers.DOMParser();
- DocumentBuilderFactory builderFactory =
- DocumentBuilderFactory.newInstance();
-
- builderFactory.setNamespaceAware(true);
- builderFactory.setValidating(true);
-
- DocumentBuilder parser = builderFactory.newDocumentBuilder();
-
- /*
- // domParser.setFeature("http://apache.org/xml/features/dom/create-entity-ref-nodes", getShouldExpandEntityRefs()? false : true);
- if(m_useDOM2getNamespaceURI)
- {
- parser.setFeature("http://apache.org/xml/features/dom/defer-node-expansion", true);
- parser.setFeature("http://xml.org/sax/features/namespaces", true);
- }
- else
- {
- parser.setFeature("http://apache.org/xml/features/dom/defer-node-expansion", false);
- }
-
- parser.setFeature("http://apache.org/xml/features/allow-java-encodings", true);
- */
-
- parser.setErrorHandler(
- new com.sun.org.apache.xml.internal.utils.DefaultErrorHandler());
-
- // if(null != m_entityResolver)
- // {
- // System.out.println("Setting the entity resolver.");
- // parser.setEntityResolver(m_entityResolver);
- // }
- setDocument(parser.parse(source));
- }
- catch (org.xml.sax.SAXException se)
- {
- throw new TransformerException(se);
- }
- catch (ParserConfigurationException pce)
- {
- throw new TransformerException(pce);
- }
- catch (IOException ioe)
- {
- throw new TransformerException(ioe);
- }
-
- // setDocument(((com.sun.org.apache.xerces.internal.parsers.DOMParser)parser).getDocument());
- }
-
- /**
- * Given an XML ID, return the element. This requires assistance from the
- * DOM and parser, and is meaningful only in the context of a DTD
- * or schema which declares attributes as being of type ID. This
- * information may or may not be available in all parsers, may or
- * may not be available for specific documents, and may or may not
- * be available when validation is not turned on.
- *
- * @param id The ID to search for, as a String.
- * @param doc The document to search within, as a DOM Document node.
- * @return DOM Element node with an attribute of type ID whose value
- * uniquely matches the requested id string, or null if there isn't
- * such an element or if the DOM can't answer the question for other
- * reasons.
- */
- public Element getElementByID(String id, Document doc)
- {
- return doc.getElementById(id);
- }
-
- /**
- * Figure out whether node2 should be considered as being later
- * in the document than node1, in Document Order as defined
- * by the XPath model. This may not agree with the ordering defined
- * by other XML applications.
- * <p>
- * There are some cases where ordering isn't defined, and neither are
- * the results of this function -- though we'll generally return true.
- * <p>
- * TODO: Make sure this does the right thing with attribute nodes!!!
- *
- * @param node1 DOM Node to perform position comparison on.
- * @param node2 DOM Node to perform position comparison on .
- *
- * @return false if node2 comes before node1, otherwise return true.
- * You can think of this as
- * <code>(node1.documentOrderPosition &lt;= node2.documentOrderPosition)</code>.
- */
- public static boolean isNodeAfter(Node node1, Node node2)
- {
-
- // Assume first that the nodes are DTM nodes, since discovering node
- // order is massivly faster for the DTM.
- if(node1 instanceof DOMOrder && node2 instanceof DOMOrder)
- {
- int index1 = ((DOMOrder) node1).getUid();
- int index2 = ((DOMOrder) node2).getUid();
-
- return index1 <= index2;
- }
- else
- {
-
- // isNodeAfter will return true if node is after countedNode
- // in document order. The base isNodeAfter is sloooow (relatively).
- return DOMHelper.isNodeAfter(node1, node2);
- }
- }
-
- /**
- * Get the XPath-model parent of a node. This version takes advantage
- * of the DOM Level 2 Attr.ownerElement() method; the base version we
- * would otherwise inherit is prepared to fall back on exhaustively
- * walking the document to find an Attr's parent.
- *
- * @param node Node to be examined
- *
- * @return the DOM parent of the input node, if there is one, or the
- * ownerElement if the input node is an Attr, or null if the node is
- * a Document, a DocumentFragment, or an orphan.
- */
- public static Node getParentOfNode(Node node)
- {
- Node parent=node.getParentNode();
- if(parent==null && (Node.ATTRIBUTE_NODE == node.getNodeType()) )
- parent=((Attr) node).getOwnerElement();
- return parent;
- }
-
- /**
- * Returns the local name of the given node, as defined by the
- * XML Namespaces specification. This is prepared to handle documents
- * built using DOM Level 1 methods by falling back upon explicitly
- * parsing the node name.
- *
- * @param n Node to be examined
- *
- * @return String containing the local name, or null if the node
- * was not assigned a Namespace.
- */
- public String getLocalNameOfNode(Node n)
- {
-
- String name = n.getLocalName();
-
- return (null == name) ? super.getLocalNameOfNode(n) : name;
- }
-
- /**
- * Returns the Namespace Name (Namespace URI) for the given node.
- * In a Level 2 DOM, you can ask the node itself. Note, however, that
- * doing so conflicts with our decision in getLocalNameOfNode not
- * to trust the that the DOM was indeed created using the Level 2
- * methods. If Level 1 methods were used, these two functions will
- * disagree with each other.
- * <p>
- * TODO: Reconcile with getLocalNameOfNode.
- *
- * @param n Node to be examined
- *
- * @return String containing the Namespace URI bound to this DOM node
- * at the time the Node was created.
- */
- public String getNamespaceOfNode(Node n)
- {
- return n.getNamespaceURI();
- }
-
- /** Field m_useDOM2getNamespaceURI is a compile-time flag which
- * gates some of the parser options used to build a DOM -- but
- * that code is commented out at this time and nobody else
- * references it, so I've commented this out as well. */
- //private boolean m_useDOM2getNamespaceURI = false;
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/DOMBuilder.java b/src/com/sun/org/apache/xml/internal/utils/DOMBuilder.java
deleted file mode 100644
index 9dadac9..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/DOMBuilder.java
+++ /dev/null
@@ -1,790 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DOMBuilder.java,v 1.2.4.1 2005/09/15 08:15:39 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-import java.util.Stack;
-
-import com.sun.org.apache.xml.internal.res.XMLErrorResources;
-import com.sun.org.apache.xml.internal.res.XMLMessages;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-import org.w3c.dom.CDATASection;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.Locator;
-import org.xml.sax.ext.LexicalHandler;
-/**
- * This class takes SAX events (in addition to some extra events
- * that SAX doesn't handle yet) and adds the result to a document
- * or document fragment.
- * @xsl.usage general
- */
-public class DOMBuilder
- implements ContentHandler, LexicalHandler
-{
-
- /** Root document */
- public Document m_doc;
-
- /** Current node */
- protected Node m_currentNode = null;
-
- /** The root node */
- protected Node m_root = null;
-
- /** The next sibling node */
- protected Node m_nextSibling = null;
-
- /** First node of document fragment or null if not a DocumentFragment */
- public DocumentFragment m_docFrag = null;
-
- /** Vector of element nodes */
- protected Stack m_elemStack = new Stack();
-
- /**
- * DOMBuilder instance constructor... it will add the DOM nodes
- * to the document fragment.
- *
- * @param doc Root document
- * @param node Current node
- */
- public DOMBuilder(Document doc, Node node)
- {
- m_doc = doc;
- m_currentNode = m_root = node;
-
- if (node instanceof Element)
- m_elemStack.push(node);
- }
-
- /**
- * DOMBuilder instance constructor... it will add the DOM nodes
- * to the document fragment.
- *
- * @param doc Root document
- * @param docFrag Document fragment
- */
- public DOMBuilder(Document doc, DocumentFragment docFrag)
- {
- m_doc = doc;
- m_docFrag = docFrag;
- }
-
- /**
- * DOMBuilder instance constructor... it will add the DOM nodes
- * to the document.
- *
- * @param doc Root document
- */
- public DOMBuilder(Document doc)
- {
- m_doc = doc;
- }
-
- /**
- * Get the root document or DocumentFragment of the DOM being created.
- *
- * @return The root document or document fragment if not null
- */
- public Node getRootDocument()
- {
- return (null != m_docFrag) ? (Node) m_docFrag : (Node) m_doc;
- }
-
- /**
- * Get the root node of the DOM tree.
- */
- public Node getRootNode()
- {
- return m_root;
- }
-
- /**
- * Get the node currently being processed.
- *
- * @return the current node being processed
- */
- public Node getCurrentNode()
- {
- return m_currentNode;
- }
-
- /**
- * Set the next sibling node, which is where the result nodes
- * should be inserted before.
- *
- * @param nextSibling the next sibling node.
- */
- public void setNextSibling(Node nextSibling)
- {
- m_nextSibling = nextSibling;
- }
-
- /**
- * Return the next sibling node.
- *
- * @return the next sibling node.
- */
- public Node getNextSibling()
- {
- return m_nextSibling;
- }
-
- /**
- * Return null since there is no Writer for this class.
- *
- * @return null
- */
- public java.io.Writer getWriter()
- {
- return null;
- }
-
- /**
- * Append a node to the current container.
- *
- * @param newNode New node to append
- */
- protected void append(Node newNode) throws org.xml.sax.SAXException
- {
-
- Node currentNode = m_currentNode;
-
- if (null != currentNode)
- {
- if (currentNode == m_root && m_nextSibling != null)
- currentNode.insertBefore(newNode, m_nextSibling);
- else
- currentNode.appendChild(newNode);
-
- // System.out.println(newNode.getNodeName());
- }
- else if (null != m_docFrag)
- {
- if (m_nextSibling != null)
- m_docFrag.insertBefore(newNode, m_nextSibling);
- else
- m_docFrag.appendChild(newNode);
- }
- else
- {
- boolean ok = true;
- short type = newNode.getNodeType();
-
- if (type == Node.TEXT_NODE)
- {
- String data = newNode.getNodeValue();
-
- if ((null != data) && (data.trim().length() > 0))
- {
- throw new org.xml.sax.SAXException(
- XMLMessages.createXMLMessage(
- XMLErrorResources.ER_CANT_OUTPUT_TEXT_BEFORE_DOC, null)); //"Warning: can't output text before document element! Ignoring...");
- }
-
- ok = false;
- }
- else if (type == Node.ELEMENT_NODE)
- {
- if (m_doc.getDocumentElement() != null)
- {
- ok = false;
-
- throw new org.xml.sax.SAXException(
- XMLMessages.createXMLMessage(
- XMLErrorResources.ER_CANT_HAVE_MORE_THAN_ONE_ROOT, null)); //"Can't have more than one root on a DOM!");
- }
- }
-
- if (ok)
- {
- if (m_nextSibling != null)
- m_doc.insertBefore(newNode, m_nextSibling);
- else
- m_doc.appendChild(newNode);
- }
- }
- }
-
- /**
- * Receive an object for locating the origin of SAX document events.
- *
- * <p>SAX parsers are strongly encouraged (though not absolutely
- * required) to supply a locator: if it does so, it must supply
- * the locator to the application by invoking this method before
- * invoking any of the other methods in the ContentHandler
- * interface.</p>
- *
- * <p>The locator allows the application to determine the end
- * position of any document-related event, even if the parser is
- * not reporting an error. Typically, the application will
- * use this information for reporting its own errors (such as
- * character content that does not match an application's
- * business rules). The information returned by the locator
- * is probably not sufficient for use with a search engine.</p>
- *
- * <p>Note that the locator will return correct information only
- * during the invocation of the events in this interface. The
- * application should not attempt to use it at any other time.</p>
- *
- * @param locator An object that can return the location of
- * any SAX document event.
- * @see org.xml.sax.Locator
- */
- public void setDocumentLocator(Locator locator)
- {
-
- // No action for the moment.
- }
-
- /**
- * Receive notification of the beginning of a document.
- *
- * <p>The SAX parser will invoke this method only once, before any
- * other methods in this interface or in DTDHandler (except for
- * setDocumentLocator).</p>
- */
- public void startDocument() throws org.xml.sax.SAXException
- {
-
- // No action for the moment.
- }
-
- /**
- * Receive notification of the end of a document.
- *
- * <p>The SAX parser will invoke this method only once, and it will
- * be the last method invoked during the parse. The parser shall
- * not invoke this method until it has either abandoned parsing
- * (because of an unrecoverable error) or reached the end of
- * input.</p>
- */
- public void endDocument() throws org.xml.sax.SAXException
- {
-
- // No action for the moment.
- }
-
- /**
- * Receive notification of the beginning of an element.
- *
- * <p>The Parser will invoke this method at the beginning of every
- * element in the XML document; there will be a corresponding
- * endElement() event for every startElement() event (even when the
- * element is empty). All of the element's content will be
- * reported, in order, before the corresponding endElement()
- * event.</p>
- *
- * <p>If the element name has a namespace prefix, the prefix will
- * still be attached. Note that the attribute list provided will
- * contain only attributes with explicit values (specified or
- * defaulted): #IMPLIED attributes will be omitted.</p>
- *
- *
- * @param ns The namespace of the node
- * @param localName The local part of the qualified name
- * @param name The element name.
- * @param atts The attributes attached to the element, if any.
- * @see #endElement
- * @see org.xml.sax.Attributes
- */
- public void startElement(
- String ns, String localName, String name, Attributes atts)
- throws org.xml.sax.SAXException
- {
-
- Element elem;
-
- // Note that the namespace-aware call must be used to correctly
- // construct a Level 2 DOM, even for non-namespaced nodes.
- if ((null == ns) || (ns.length() == 0))
- elem = m_doc.createElementNS(null,name);
- else
- elem = m_doc.createElementNS(ns, name);
-
- append(elem);
-
- try
- {
- int nAtts = atts.getLength();
-
- if (0 != nAtts)
- {
- for (int i = 0; i < nAtts; i++)
- {
-
- //System.out.println("type " + atts.getType(i) + " name " + atts.getLocalName(i) );
- // First handle a possible ID attribute
- if (atts.getType(i).equalsIgnoreCase("ID"))
- setIDAttribute(atts.getValue(i), elem);
-
- String attrNS = atts.getURI(i);
-
- if("".equals(attrNS))
- attrNS = null; // DOM represents no-namespace as null
-
- // System.out.println("attrNS: "+attrNS+", localName: "+atts.getQName(i)
- // +", qname: "+atts.getQName(i)+", value: "+atts.getValue(i));
- // Crimson won't let us set an xmlns: attribute on the DOM.
- String attrQName = atts.getQName(i);
-
- // In SAX, xmlns[:] attributes have an empty namespace, while in DOM they
- // should have the xmlns namespace
- if (attrQName.startsWith("xmlns:") || attrQName.equals("xmlns")) {
- attrNS = "http://www.w3.org/2000/xmlns/";
- }
-
- // ALWAYS use the DOM Level 2 call!
- elem.setAttributeNS(attrNS,attrQName, atts.getValue(i));
- }
- }
-
- // append(elem);
-
- m_elemStack.push(elem);
-
- m_currentNode = elem;
-
- // append(elem);
- }
- catch(java.lang.Exception de)
- {
- // de.printStackTrace();
- throw new org.xml.sax.SAXException(de);
- }
-
- }
-
- /**
-
-
-
- * Receive notification of the end of an element.
- *
- * <p>The SAX parser will invoke this method at the end of every
- * element in the XML document; there will be a corresponding
- * startElement() event for every endElement() event (even when the
- * element is empty).</p>
- *
- * <p>If the element name has a namespace prefix, the prefix will
- * still be attached to the name.</p>
- *
- *
- * @param ns the namespace of the element
- * @param localName The local part of the qualified name of the element
- * @param name The element name
- */
- public void endElement(String ns, String localName, String name)
- throws org.xml.sax.SAXException
- {
- m_elemStack.pop();
- m_currentNode = m_elemStack.isEmpty() ? null : (Node)m_elemStack.peek();
- }
-
- /**
- * Set an ID string to node association in the ID table.
- *
- * @param id The ID string.
- * @param elem The associated ID.
- */
- public void setIDAttribute(String id, Element elem)
- {
-
- // Do nothing. This method is meant to be overiden.
- }
-
- /**
- * Receive notification of character data.
- *
- * <p>The Parser will call this method to report each chunk of
- * character data. SAX parsers may return all contiguous character
- * data in a single chunk, or they may split it into several
- * chunks; however, all of the characters in any single event
- * must come from the same external entity, so that the Locator
- * provides useful information.</p>
- *
- * <p>The application must not attempt to read from the array
- * outside of the specified range.</p>
- *
- * <p>Note that some parsers will report whitespace using the
- * ignorableWhitespace() method rather than this one (validating
- * parsers must do so).</p>
- *
- * @param ch The characters from the XML document.
- * @param start The start position in the array.
- * @param length The number of characters to read from the array.
- * @see #ignorableWhitespace
- * @see org.xml.sax.Locator
- */
- public void characters(char ch[], int start, int length) throws org.xml.sax.SAXException
- {
- if(isOutsideDocElem()
- && com.sun.org.apache.xml.internal.utils.XMLCharacterRecognizer.isWhiteSpace(ch, start, length))
- return; // avoid DOM006 Hierarchy request error
-
- if (m_inCData)
- {
- cdata(ch, start, length);
-
- return;
- }
-
- String s = new String(ch, start, length);
- Node childNode;
- childNode = m_currentNode != null ? m_currentNode.getLastChild(): null;
- if( childNode != null && childNode.getNodeType() == Node.TEXT_NODE ){
- ((Text)childNode).appendData(s);
- }
- else{
- Text text = m_doc.createTextNode(s);
- append(text);
- }
- }
-
- /**
- * If available, when the disable-output-escaping attribute is used,
- * output raw text without escaping. A PI will be inserted in front
- * of the node with the name "lotusxsl-next-is-raw" and a value of
- * "formatter-to-dom".
- *
- * @param ch Array containing the characters
- * @param start Index to start of characters in the array
- * @param length Number of characters in the array
- */
- public void charactersRaw(char ch[], int start, int length)
- throws org.xml.sax.SAXException
- {
- if(isOutsideDocElem()
- && com.sun.org.apache.xml.internal.utils.XMLCharacterRecognizer.isWhiteSpace(ch, start, length))
- return; // avoid DOM006 Hierarchy request error
-
-
- String s = new String(ch, start, length);
-
- append(m_doc.createProcessingInstruction("xslt-next-is-raw",
- "formatter-to-dom"));
- append(m_doc.createTextNode(s));
- }
-
- /**
- * Report the beginning of an entity.
- *
- * The start and end of the document entity are not reported.
- * The start and end of the external DTD subset are reported
- * using the pseudo-name "[dtd]". All other events must be
- * properly nested within start/end entity events.
- *
- * @param name The name of the entity. If it is a parameter
- * entity, the name will begin with '%'.
- * @see #endEntity
- * @see org.xml.sax.ext.DeclHandler#internalEntityDecl
- * @see org.xml.sax.ext.DeclHandler#externalEntityDecl
- */
- public void startEntity(String name) throws org.xml.sax.SAXException
- {
-
- // Almost certainly the wrong behavior...
- // entityReference(name);
- }
-
- /**
- * Report the end of an entity.
- *
- * @param name The name of the entity that is ending.
- * @see #startEntity
- */
- public void endEntity(String name) throws org.xml.sax.SAXException{}
-
- /**
- * Receive notivication of a entityReference.
- *
- * @param name name of the entity reference
- */
- public void entityReference(String name) throws org.xml.sax.SAXException
- {
- append(m_doc.createEntityReference(name));
- }
-
- /**
- * Receive notification of ignorable whitespace in element content.
- *
- * <p>Validating Parsers must use this method to report each chunk
- * of ignorable whitespace (see the W3C XML 1.0 recommendation,
- * section 2.10): non-validating parsers may also use this method
- * if they are capable of parsing and using content models.</p>
- *
- * <p>SAX parsers may return all contiguous whitespace in a single
- * chunk, or they may split it into several chunks; however, all of
- * the characters in any single event must come from the same
- * external entity, so that the Locator provides useful
- * information.</p>
- *
- * <p>The application must not attempt to read from the array
- * outside of the specified range.</p>
- *
- * @param ch The characters from the XML document.
- * @param start The start position in the array.
- * @param length The number of characters to read from the array.
- * @see #characters
- */
- public void ignorableWhitespace(char ch[], int start, int length)
- throws org.xml.sax.SAXException
- {
- if(isOutsideDocElem())
- return; // avoid DOM006 Hierarchy request error
-
- String s = new String(ch, start, length);
-
- append(m_doc.createTextNode(s));
- }
-
- /**
- * Tell if the current node is outside the document element.
- *
- * @return true if the current node is outside the document element.
- */
- private boolean isOutsideDocElem()
- {
- return (null == m_docFrag) && m_elemStack.size() == 0 && (null == m_currentNode || m_currentNode.getNodeType() == Node.DOCUMENT_NODE);
- }
-
- /**
- * Receive notification of a processing instruction.
- *
- * <p>The Parser will invoke this method once for each processing
- * instruction found: note that processing instructions may occur
- * before or after the main document element.</p>
- *
- * <p>A SAX parser should never report an XML declaration (XML 1.0,
- * section 2.8) or a text declaration (XML 1.0, section 4.3.1)
- * using this method.</p>
- *
- * @param target The processing instruction target.
- * @param data The processing instruction data, or null if
- * none was supplied.
- */
- public void processingInstruction(String target, String data)
- throws org.xml.sax.SAXException
- {
- append(m_doc.createProcessingInstruction(target, data));
- }
-
- /**
- * Report an XML comment anywhere in the document.
- *
- * This callback will be used for comments inside or outside the
- * document element, including comments in the external DTD
- * subset (if read).
- *
- * @param ch An array holding the characters in the comment.
- * @param start The starting position in the array.
- * @param length The number of characters to use from the array.
- */
- public void comment(char ch[], int start, int length) throws org.xml.sax.SAXException
- {
- append(m_doc.createComment(new String(ch, start, length)));
- }
-
- /** Flag indicating that we are processing a CData section */
- protected boolean m_inCData = false;
-
- /**
- * Report the start of a CDATA section.
- *
- * @see #endCDATA
- */
- public void startCDATA() throws org.xml.sax.SAXException
- {
- m_inCData = true;
- append(m_doc.createCDATASection(""));
- }
-
- /**
- * Report the end of a CDATA section.
- *
- * @see #startCDATA
- */
- public void endCDATA() throws org.xml.sax.SAXException
- {
- m_inCData = false;
- }
-
- /**
- * Receive notification of cdata.
- *
- * <p>The Parser will call this method to report each chunk of
- * character data. SAX parsers may return all contiguous character
- * data in a single chunk, or they may split it into several
- * chunks; however, all of the characters in any single event
- * must come from the same external entity, so that the Locator
- * provides useful information.</p>
- *
- * <p>The application must not attempt to read from the array
- * outside of the specified range.</p>
- *
- * <p>Note that some parsers will report whitespace using the
- * ignorableWhitespace() method rather than this one (validating
- * parsers must do so).</p>
- *
- * @param ch The characters from the XML document.
- * @param start The start position in the array.
- * @param length The number of characters to read from the array.
- * @see #ignorableWhitespace
- * @see org.xml.sax.Locator
- */
- public void cdata(char ch[], int start, int length) throws org.xml.sax.SAXException
- {
- if(isOutsideDocElem()
- && com.sun.org.apache.xml.internal.utils.XMLCharacterRecognizer.isWhiteSpace(ch, start, length))
- return; // avoid DOM006 Hierarchy request error
-
- String s = new String(ch, start, length);
-
- CDATASection section =(CDATASection) m_currentNode.getLastChild();
- section.appendData(s);
- }
-
- /**
- * Report the start of DTD declarations, if any.
- *
- * Any declarations are assumed to be in the internal subset
- * unless otherwise indicated.
- *
- * @param name The document type name.
- * @param publicId The declared public identifier for the
- * external DTD subset, or null if none was declared.
- * @param systemId The declared system identifier for the
- * external DTD subset, or null if none was declared.
- * @see #endDTD
- * @see #startEntity
- */
- public void startDTD(String name, String publicId, String systemId)
- throws org.xml.sax.SAXException
- {
-
- // Do nothing for now.
- }
-
- /**
- * Report the end of DTD declarations.
- *
- * @see #startDTD
- */
- public void endDTD() throws org.xml.sax.SAXException
- {
-
- // Do nothing for now.
- }
-
- /**
- * Begin the scope of a prefix-URI Namespace mapping.
- *
- * <p>The information from this event is not necessary for
- * normal Namespace processing: the SAX XML reader will
- * automatically replace prefixes for element and attribute
- * names when the http://xml.org/sax/features/namespaces
- * feature is true (the default).</p>
- *
- * <p>There are cases, however, when applications need to
- * use prefixes in character data or in attribute values,
- * where they cannot safely be expanded automatically; the
- * start/endPrefixMapping event supplies the information
- * to the application to expand prefixes in those contexts
- * itself, if necessary.</p>
- *
- * <p>Note that start/endPrefixMapping events are not
- * guaranteed to be properly nested relative to each-other:
- * all startPrefixMapping events will occur before the
- * corresponding startElement event, and all endPrefixMapping
- * events will occur after the corresponding endElement event,
- * but their order is not guaranteed.</p>
- *
- * @param prefix The Namespace prefix being declared.
- * @param uri The Namespace URI the prefix is mapped to.
- * @see #endPrefixMapping
- * @see #startElement
- */
- public void startPrefixMapping(String prefix, String uri)
- throws org.xml.sax.SAXException
- {
-
- /*
- // Not sure if this is needed or wanted
- // Also, it fails in the stree.
- if((null != m_currentNode)
- && (m_currentNode.getNodeType() == Node.ELEMENT_NODE))
- {
- String qname;
- if(((null != prefix) && (prefix.length() == 0))
- || (null == prefix))
- qname = "xmlns";
- else
- qname = "xmlns:"+prefix;
-
- Element elem = (Element)m_currentNode;
- String val = elem.getAttribute(qname); // Obsolete, should be DOM2...?
- if(val == null)
- {
- elem.setAttributeNS("http://www.w3.org/XML/1998/namespace",
- qname, uri);
- }
- }
- */
- }
-
- /**
- * End the scope of a prefix-URI mapping.
- *
- * <p>See startPrefixMapping for details. This event will
- * always occur after the corresponding endElement event,
- * but the order of endPrefixMapping events is not otherwise
- * guaranteed.</p>
- *
- * @param prefix The prefix that was being mapping.
- * @see #startPrefixMapping
- * @see #endElement
- */
- public void endPrefixMapping(String prefix) throws org.xml.sax.SAXException{}
-
- /**
- * Receive notification of a skipped entity.
- *
- * <p>The Parser will invoke this method once for each entity
- * skipped. Non-validating processors may skip entities if they
- * have not seen the declarations (because, for example, the
- * entity was declared in an external DTD subset). All processors
- * may skip external entities, depending on the values of the
- * http://xml.org/sax/features/external-general-entities and the
- * http://xml.org/sax/features/external-parameter-entities
- * properties.</p>
- *
- * @param name The name of the skipped entity. If it is a
- * parameter entity, the name will begin with '%'.
- */
- public void skippedEntity(String name) throws org.xml.sax.SAXException{}
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/DOMHelper.java b/src/com/sun/org/apache/xml/internal/utils/DOMHelper.java
deleted file mode 100644
index 416c200..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/DOMHelper.java
+++ /dev/null
@@ -1,1330 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DOMHelper.java,v 1.2.4.1 2005/09/15 08:15:40 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-import com.sun.org.apache.xml.internal.dtm.ref.DTMNodeProxy;
-import com.sun.org.apache.xml.internal.res.XMLErrorResources;
-import com.sun.org.apache.xml.internal.res.XMLMessages;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Vector;
-import javax.xml.XMLConstants;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import org.w3c.dom.Attr;
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.Entity;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-/**
- * @deprecated Since the introduction of the DTM, this class will be removed.
- * This class provides a front-end to DOM implementations, providing
- * a number of utility functions that either aren't yet standardized
- * by the DOM spec or that are defined in optional DOM modules and
- * hence may not be present in all DOMs.
- */
-public class DOMHelper
-{
-
- /**
- * DOM Level 1 did not have a standard mechanism for creating a new
- * Document object. This function provides a DOM-implementation-independent
- * abstraction for that for that concept. It's typically used when
- * outputting a new DOM as the result of an operation.
- * <p>
- * TODO: This isn't directly compatable with DOM Level 2.
- * The Level 2 createDocument call also creates the root
- * element, and thus requires that you know what that element will be
- * before creating the Document. We should think about whether we want
- * to change this code, and the callers, so we can use the DOM's own
- * method. (It's also possible that DOM Level 3 may relax this
- * sequence, but you may give up some intelligence in the DOM by
- * doing so; the intent was that knowing the document type and root
- * element might let the DOM automatically switch to a specialized
- * subclass for particular kinds of documents.)
- *
- * @param isSecureProcessing state of the secure processing feature.
- * @return The newly created DOM Document object, with no children, or
- * null if we can't find a DOM implementation that permits creating
- * new empty Documents.
- */
- public static Document createDocument(boolean isSecureProcessing)
- {
-
- try
- {
-
- // Use an implementation of the JAVA API for XML Parsing 1.0 to
- // create a DOM Document node to contain the result.
- DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
-
- dfactory.setNamespaceAware(true);
- dfactory.setValidating(true);
-
- if (isSecureProcessing)
- {
- try
- {
- dfactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
- }
- catch (ParserConfigurationException pce) {}
- }
-
- DocumentBuilder docBuilder = dfactory.newDocumentBuilder();
- Document outNode = docBuilder.newDocument();
-
- return outNode;
- }
- catch (ParserConfigurationException pce)
- {
- throw new RuntimeException(
- XMLMessages.createXMLMessage(
- XMLErrorResources.ER_CREATEDOCUMENT_NOT_SUPPORTED, null)); //"createDocument() not supported in XPathContext!");
-
- // return null;
- }
- }
-
- /**
- * DOM Level 1 did not have a standard mechanism for creating a new
- * Document object. This function provides a DOM-implementation-independent
- * abstraction for that for that concept. It's typically used when
- * outputting a new DOM as the result of an operation.
- *
- * @return The newly created DOM Document object, with no children, or
- * null if we can't find a DOM implementation that permits creating
- * new empty Documents.
- */
- public static Document createDocument()
- {
- return createDocument(false);
- }
-
- /**
- * Tells, through the combination of the default-space attribute
- * on xsl:stylesheet, xsl:strip-space, xsl:preserve-space, and the
- * xml:space attribute, whether or not extra whitespace should be stripped
- * from the node. Literal elements from template elements should
- * <em>not</em> be tested with this function.
- * @param textNode A text node from the source tree.
- * @return true if the text node should be stripped of extra whitespace.
- *
- * @throws javax.xml.transform.TransformerException
- * @xsl.usage advanced
- */
- public boolean shouldStripSourceNode(Node textNode)
- throws javax.xml.transform.TransformerException
- {
-
- // return (null == m_envSupport) ? false : m_envSupport.shouldStripSourceNode(textNode);
- return false;
- }
-
- /**
- * Supports the XPath function GenerateID by returning a unique
- * identifier string for any given DOM Node.
- * <p>
- * Warning: The base implementation uses the Node object's hashCode(),
- * which is NOT guaranteed to be unique. If that method hasn't been
- * overridden in this DOM ipmlementation, most Java implementions will
- * derive it from the object's address and should be OK... but if
- * your DOM uses a different definition of hashCode (eg hashing the
- * contents of the subtree), or if your DOM may have multiple objects
- * that represent a single Node in the data structure (eg via proxying),
- * you may need to find another way to assign a unique identifier.
- * <p>
- * Also, be aware that if nodes are destroyed and recreated, there is
- * an open issue regarding whether an ID may be reused. Currently
- * we're assuming that the input document is stable for the duration
- * of the XPath/XSLT operation, so this shouldn't arise in this context.
- * <p>
- * (DOM Level 3 is investigating providing a unique node "key", but
- * that won't help Level 1 and Level 2 implementations.)
- *
- * @param node whose identifier you want to obtain
- *
- * @return a string which should be different for every Node object.
- */
- public String getUniqueID(Node node)
- {
- return "N" + Integer.toHexString(node.hashCode()).toUpperCase();
- }
-
- /**
- * Figure out whether node2 should be considered as being later
- * in the document than node1, in Document Order as defined
- * by the XPath model. This may not agree with the ordering defined
- * by other XML applications.
- * <p>
- * There are some cases where ordering isn't defined, and neither are
- * the results of this function -- though we'll generally return true.
- *
- * TODO: Make sure this does the right thing with attribute nodes!!!
- *
- * @param node1 DOM Node to perform position comparison on.
- * @param node2 DOM Node to perform position comparison on .
- *
- * @return false if node2 comes before node1, otherwise return true.
- * You can think of this as
- * <code>(node1.documentOrderPosition &lt;= node2.documentOrderPosition)</code>.
- */
- public static boolean isNodeAfter(Node node1, Node node2)
- {
- if (node1 == node2 || isNodeTheSame(node1, node2))
- return true;
-
- // Default return value, if there is no defined ordering
- boolean isNodeAfter = true;
-
- Node parent1 = getParentOfNode(node1);
- Node parent2 = getParentOfNode(node2);
-
- // Optimize for most common case
- if (parent1 == parent2 || isNodeTheSame(parent1, parent2)) // then we know they are siblings
- {
- if (null != parent1)
- isNodeAfter = isNodeAfterSibling(parent1, node1, node2);
- else
- {
- // If both parents are null, ordering is not defined.
- // We're returning a value in lieu of throwing an exception.
- // Not a case we expect to arise in XPath, but beware if you
- // try to reuse this method.
-
- // We can just fall through in this case, which allows us
- // to hit the debugging code at the end of the function.
- //return isNodeAfter;
- }
- }
- else
- {
-
- // General strategy: Figure out the lengths of the two
- // ancestor chains, reconcile the lengths, and look for
- // the lowest common ancestor. If that ancestor is one of
- // the nodes being compared, it comes before the other.
- // Otherwise perform a sibling compare.
- //
- // NOTE: If no common ancestor is found, ordering is undefined
- // and we return the default value of isNodeAfter.
-
- // Count parents in each ancestor chain
- int nParents1 = 2, nParents2 = 2; // include node & parent obtained above
-
- while (parent1 != null)
- {
- nParents1++;
-
- parent1 = getParentOfNode(parent1);
- }
-
- while (parent2 != null)
- {
- nParents2++;
-
- parent2 = getParentOfNode(parent2);
- }
-
- // Initially assume scan for common ancestor starts with
- // the input nodes.
- Node startNode1 = node1, startNode2 = node2;
-
- // If one ancestor chain is longer, adjust its start point
- // so we're comparing at the same depths
- if (nParents1 < nParents2)
- {
- // Adjust startNode2 to depth of startNode1
- int adjust = nParents2 - nParents1;
-
- for (int i = 0; i < adjust; i++)
- {
- startNode2 = getParentOfNode(startNode2);
- }
- }
- else if (nParents1 > nParents2)
- {
- // adjust startNode1 to depth of startNode2
- int adjust = nParents1 - nParents2;
-
- for (int i = 0; i < adjust; i++)
- {
- startNode1 = getParentOfNode(startNode1);
- }
- }
-
- Node prevChild1 = null, prevChild2 = null; // so we can "back up"
-
- // Loop up the ancestor chain looking for common parent
- while (null != startNode1)
- {
- if (startNode1 == startNode2 || isNodeTheSame(startNode1, startNode2)) // common parent?
- {
- if (null == prevChild1) // first time in loop?
- {
-
- // Edge condition: one is the ancestor of the other.
- isNodeAfter = (nParents1 < nParents2) ? true : false;
-
- break; // from while loop
- }
- else
- {
- // Compare ancestors below lowest-common as siblings
- isNodeAfter = isNodeAfterSibling(startNode1, prevChild1,
- prevChild2);
-
- break; // from while loop
- }
- } // end if(startNode1 == startNode2)
-
- // Move up one level and try again
- prevChild1 = startNode1;
- startNode1 = getParentOfNode(startNode1);
- prevChild2 = startNode2;
- startNode2 = getParentOfNode(startNode2);
- } // end while(parents exist to examine)
- } // end big else (not immediate siblings)
-
- // WARNING: The following diagnostic won't report the early
- // "same node" case. Fix if/when needed.
-
- /* -- please do not remove... very useful for diagnostics --
- System.out.println("node1 = "+node1.getNodeName()+"("+node1.getNodeType()+")"+
- ", node2 = "+node2.getNodeName()
- +"("+node2.getNodeType()+")"+
- ", isNodeAfter = "+isNodeAfter); */
- return isNodeAfter;
- } // end isNodeAfter(Node node1, Node node2)
-
- /**
- * Use DTMNodeProxy to determine whether two nodes are the same.
- *
- * @param node1 The first DOM node to compare.
- * @param node2 The second DOM node to compare.
- * @return true if the two nodes are the same.
- */
- public static boolean isNodeTheSame(Node node1, Node node2)
- {
- if (node1 instanceof DTMNodeProxy && node2 instanceof DTMNodeProxy)
- return ((DTMNodeProxy)node1).equals((DTMNodeProxy)node2);
- else
- return (node1 == node2);
- }
-
- /**
- * Figure out if child2 is after child1 in document order.
- * <p>
- * Warning: Some aspects of "document order" are not well defined.
- * For example, the order of attributes is considered
- * meaningless in XML, and the order reported by our model will
- * be consistant for a given invocation but may not
- * match that of either the source file or the serialized output.
- *
- * @param parent Must be the parent of both child1 and child2.
- * @param child1 Must be the child of parent and not equal to child2.
- * @param child2 Must be the child of parent and not equal to child1.
- * @return true if child 2 is after child1 in document order.
- */
- private static boolean isNodeAfterSibling(Node parent, Node child1,
- Node child2)
- {
-
- boolean isNodeAfterSibling = false;
- short child1type = child1.getNodeType();
- short child2type = child2.getNodeType();
-
- if ((Node.ATTRIBUTE_NODE != child1type)
- && (Node.ATTRIBUTE_NODE == child2type))
- {
-
- // always sort attributes before non-attributes.
- isNodeAfterSibling = false;
- }
- else if ((Node.ATTRIBUTE_NODE == child1type)
- && (Node.ATTRIBUTE_NODE != child2type))
- {
-
- // always sort attributes before non-attributes.
- isNodeAfterSibling = true;
- }
- else if (Node.ATTRIBUTE_NODE == child1type)
- {
- NamedNodeMap children = parent.getAttributes();
- int nNodes = children.getLength();
- boolean found1 = false, found2 = false;
-
- // Count from the start until we find one or the other.
- for (int i = 0; i < nNodes; i++)
- {
- Node child = children.item(i);
-
- if (child1 == child || isNodeTheSame(child1, child))
- {
- if (found2)
- {
- isNodeAfterSibling = false;
-
- break;
- }
-
- found1 = true;
- }
- else if (child2 == child || isNodeTheSame(child2, child))
- {
- if (found1)
- {
- isNodeAfterSibling = true;
-
- break;
- }
-
- found2 = true;
- }
- }
- }
- else
- {
- // TODO: Check performance of alternate solution:
- // There are two choices here: Count from the start of
- // the document until we find one or the other, or count
- // from one until we find or fail to find the other.
- // Either can wind up scanning all the siblings in the worst
- // case, which on a wide document can be a lot of work but
- // is more typically is a short list.
- // Scanning from the start involves two tests per iteration,
- // but it isn't clear that scanning from the middle doesn't
- // yield more iterations on average.
- // We should run some testcases.
- Node child = parent.getFirstChild();
- boolean found1 = false, found2 = false;
-
- while (null != child)
- {
-
- // Node child = children.item(i);
- if (child1 == child || isNodeTheSame(child1, child))
- {
- if (found2)
- {
- isNodeAfterSibling = false;
-
- break;
- }
-
- found1 = true;
- }
- else if (child2 == child || isNodeTheSame(child2, child))
- {
- if (found1)
- {
- isNodeAfterSibling = true;
-
- break;
- }
-
- found2 = true;
- }
-
- child = child.getNextSibling();
- }
- }
-
- return isNodeAfterSibling;
- } // end isNodeAfterSibling(Node parent, Node child1, Node child2)
-
- //==========================================================
- // SECTION: Namespace resolution
- //==========================================================
-
- /**
- * Get the depth level of this node in the tree (equals 1 for
- * a parentless node).
- *
- * @param n Node to be examined.
- * @return the number of ancestors, plus one
- * @xsl.usage internal
- */
- public short getLevel(Node n)
- {
-
- short level = 1;
-
- while (null != (n = getParentOfNode(n)))
- {
- level++;
- }
-
- return level;
- }
-
- /**
- * Given an XML Namespace prefix and a context in which the prefix
- * is to be evaluated, return the Namespace Name this prefix was
- * bound to. Note that DOM Level 3 is expected to provide a version of
- * this which deals with the DOM's "early binding" behavior.
- *
- * Default handling:
- *
- * @param prefix String containing namespace prefix to be resolved,
- * without the ':' which separates it from the localname when used
- * in a Node Name. The empty sting signifies the default namespace
- * at this point in the document.
- * @param namespaceContext Element which provides context for resolution.
- * (We could extend this to work for other nodes by first seeking their
- * nearest Element ancestor.)
- *
- * @return a String containing the Namespace URI which this prefix
- * represents in the specified context.
- */
- public String getNamespaceForPrefix(String prefix, Element namespaceContext)
- {
-
- int type;
- Node parent = namespaceContext;
- String namespace = null;
-
- if (prefix.equals("xml"))
- {
- namespace = QName.S_XMLNAMESPACEURI; // Hardcoded, per Namespace spec
- }
- else if(prefix.equals("xmlns"))
- {
- // Hardcoded in the DOM spec, expected to be adopted by
- // Namespace spec. NOTE: Namespace declarations _must_ use
- // the xmlns: prefix; other prefixes declared as belonging
- // to this namespace will not be recognized and should
- // probably be rejected by parsers as erroneous declarations.
- namespace = "http://www.w3.org/2000/xmlns/";
- }
- else
- {
- // Attribute name for this prefix's declaration
- String declname=(prefix=="")
- ? "xmlns"
- : "xmlns:"+prefix;
-
- // Scan until we run out of Elements or have resolved the namespace
- while ((null != parent) && (null == namespace)
- && (((type = parent.getNodeType()) == Node.ELEMENT_NODE)
- || (type == Node.ENTITY_REFERENCE_NODE)))
- {
- if (type == Node.ELEMENT_NODE)
- {
-
- // Look for the appropriate Namespace Declaration attribute,
- // either "xmlns:prefix" or (if prefix is "") "xmlns".
- // TODO: This does not handle "implicit declarations"
- // which may be created when the DOM is edited. DOM Level
- // 3 will define how those should be interpreted. But
- // this issue won't arise in freshly-parsed DOMs.
-
- // NOTE: declname is set earlier, outside the loop.
- Attr attr=((Element)parent).getAttributeNode(declname);
- if(attr!=null)
- {
- namespace = attr.getNodeValue();
- break;
- }
- }
-
- parent = getParentOfNode(parent);
- }
- }
-
- return namespace;
- }
-
- /**
- * An experiment for the moment.
- */
- Map<Node, NSInfo> m_NSInfos = new HashMap<>();
-
- /** Object to put into the m_NSInfos table that tells that a node has not been
- * processed, but has xmlns namespace decls. */
- protected static final NSInfo m_NSInfoUnProcWithXMLNS = new NSInfo(false,
- true);
-
- /** Object to put into the m_NSInfos table that tells that a node has not been
- * processed, but has no xmlns namespace decls. */
- protected static final NSInfo m_NSInfoUnProcWithoutXMLNS = new NSInfo(false,
- false);
-
- /** Object to put into the m_NSInfos table that tells that a node has not been
- * processed, and has no xmlns namespace decls, and has no ancestor decls. */
- protected static final NSInfo m_NSInfoUnProcNoAncestorXMLNS =
- new NSInfo(false, false, NSInfo.ANCESTORNOXMLNS);
-
- /** Object to put into the m_NSInfos table that tells that a node has been
- * processed, and has xmlns namespace decls. */
- protected static final NSInfo m_NSInfoNullWithXMLNS = new NSInfo(true,
- true);
-
- /** Object to put into the m_NSInfos table that tells that a node has been
- * processed, and has no xmlns namespace decls. */
- protected static final NSInfo m_NSInfoNullWithoutXMLNS = new NSInfo(true,
- false);
-
- /** Object to put into the m_NSInfos table that tells that a node has been
- * processed, and has no xmlns namespace decls. and has no ancestor decls. */
- protected static final NSInfo m_NSInfoNullNoAncestorXMLNS =
- new NSInfo(true, false, NSInfo.ANCESTORNOXMLNS);
-
- /** Vector of node (odd indexes) and NSInfos (even indexes) that tell if
- * the given node is a candidate for ancestor namespace processing. */
- protected Vector m_candidateNoAncestorXMLNS = new Vector();
-
- /**
- * Returns the namespace of the given node. Differs from simply getting
- * the node's prefix and using getNamespaceForPrefix in that it attempts
- * to cache some of the data in NSINFO objects, to avoid repeated lookup.
- * TODO: Should we consider moving that logic into getNamespaceForPrefix?
- *
- * @param n Node to be examined.
- *
- * @return String containing the Namespace Name (uri) for this node.
- * Note that this is undefined for any nodes other than Elements and
- * Attributes.
- */
- public String getNamespaceOfNode(Node n)
- {
-
- String namespaceOfPrefix;
- boolean hasProcessedNS;
- NSInfo nsInfo;
- short ntype = n.getNodeType();
-
- if (Node.ATTRIBUTE_NODE != ntype)
- {
- nsInfo = m_NSInfos.get(n);
- hasProcessedNS = (nsInfo == null) ? false : nsInfo.m_hasProcessedNS;
- }
- else
- {
- hasProcessedNS = false;
- nsInfo = null;
- }
-
- if (hasProcessedNS)
- {
- namespaceOfPrefix = nsInfo.m_namespace;
- }
- else
- {
- namespaceOfPrefix = null;
-
- String nodeName = n.getNodeName();
- int indexOfNSSep = nodeName.indexOf(':');
- String prefix;
-
- if (Node.ATTRIBUTE_NODE == ntype)
- {
- if (indexOfNSSep > 0)
- {
- prefix = nodeName.substring(0, indexOfNSSep);
- }
- else
- {
-
- // Attributes don't use the default namespace, so if
- // there isn't a prefix, we're done.
- return namespaceOfPrefix;
- }
- }
- else
- {
- prefix = (indexOfNSSep >= 0)
- ? nodeName.substring(0, indexOfNSSep) : "";
- }
-
- boolean ancestorsHaveXMLNS = false;
- boolean nHasXMLNS = false;
-
- if (prefix.equals("xml"))
- {
- namespaceOfPrefix = QName.S_XMLNAMESPACEURI;
- }
- else
- {
- int parentType;
- Node parent = n;
-
- while ((null != parent) && (null == namespaceOfPrefix))
- {
- if ((null != nsInfo)
- && (nsInfo.m_ancestorHasXMLNSAttrs
- == NSInfo.ANCESTORNOXMLNS))
- {
- break;
- }
-
- parentType = parent.getNodeType();
-
- if ((null == nsInfo) || nsInfo.m_hasXMLNSAttrs)
- {
- boolean elementHasXMLNS = false;
-
- if (parentType == Node.ELEMENT_NODE)
- {
- NamedNodeMap nnm = parent.getAttributes();
-
- for (int i = 0; i < nnm.getLength(); i++)
- {
- Node attr = nnm.item(i);
- String aname = attr.getNodeName();
-
- if (aname.charAt(0) == 'x')
- {
- boolean isPrefix = aname.startsWith("xmlns:");
-
- if (aname.equals("xmlns") || isPrefix)
- {
- if (n == parent)
- nHasXMLNS = true;
-
- elementHasXMLNS = true;
- ancestorsHaveXMLNS = true;
-
- String p = isPrefix ? aname.substring(6) : "";
-
- if (p.equals(prefix))
- {
- namespaceOfPrefix = attr.getNodeValue();
-
- break;
- }
- }
- }
- }
- }
-
- if ((Node.ATTRIBUTE_NODE != parentType) && (null == nsInfo)
- && (n != parent))
- {
- nsInfo = elementHasXMLNS
- ? m_NSInfoUnProcWithXMLNS : m_NSInfoUnProcWithoutXMLNS;
-
- m_NSInfos.put(parent, nsInfo);
- }
- }
-
- if (Node.ATTRIBUTE_NODE == parentType)
- {
- parent = getParentOfNode(parent);
- }
- else
- {
- m_candidateNoAncestorXMLNS.addElement(parent);
- m_candidateNoAncestorXMLNS.addElement(nsInfo);
-
- parent = parent.getParentNode();
- }
-
- if (null != parent)
- {
- nsInfo = m_NSInfos.get(parent);
- }
- }
-
- int nCandidates = m_candidateNoAncestorXMLNS.size();
-
- if (nCandidates > 0)
- {
- if ((false == ancestorsHaveXMLNS) && (null == parent))
- {
- for (int i = 0; i < nCandidates; i += 2)
- {
- Object candidateInfo = m_candidateNoAncestorXMLNS.elementAt(i
- + 1);
-
- if (candidateInfo == m_NSInfoUnProcWithoutXMLNS)
- {
- m_NSInfos.put((Node)m_candidateNoAncestorXMLNS.elementAt(i),
- m_NSInfoUnProcNoAncestorXMLNS);
- }
- else if (candidateInfo == m_NSInfoNullWithoutXMLNS)
- {
- m_NSInfos.put((Node)m_candidateNoAncestorXMLNS.elementAt(i),
- m_NSInfoNullNoAncestorXMLNS);
- }
- }
- }
-
- m_candidateNoAncestorXMLNS.removeAllElements();
- }
- }
-
- if (Node.ATTRIBUTE_NODE != ntype)
- {
- if (null == namespaceOfPrefix)
- {
- if (ancestorsHaveXMLNS)
- {
- if (nHasXMLNS)
- m_NSInfos.put(n, m_NSInfoNullWithXMLNS);
- else
- m_NSInfos.put(n, m_NSInfoNullWithoutXMLNS);
- }
- else
- {
- m_NSInfos.put(n, m_NSInfoNullNoAncestorXMLNS);
- }
- }
- else
- {
- m_NSInfos.put(n, new NSInfo(namespaceOfPrefix, nHasXMLNS));
- }
- }
- }
-
- return namespaceOfPrefix;
- }
-
- /**
- * Returns the local name of the given node. If the node's name begins
- * with a namespace prefix, this is the part after the colon; otherwise
- * it's the full node name.
- *
- * @param n the node to be examined.
- *
- * @return String containing the Local Name
- */
- public String getLocalNameOfNode(Node n)
- {
-
- String qname = n.getNodeName();
- int index = qname.indexOf(':');
-
- return (index < 0) ? qname : qname.substring(index + 1);
- }
-
- /**
- * Returns the element name with the namespace prefix (if any) replaced
- * by the Namespace URI it was bound to. This is not a standard
- * representation of a node name, but it allows convenient
- * single-string comparison of the "universal" names of two nodes.
- *
- * @param elem Element to be examined.
- *
- * @return String in the form "namespaceURI:localname" if the node
- * belongs to a namespace, or simply "localname" if it doesn't.
- * @see #getExpandedAttributeName
- */
- public String getExpandedElementName(Element elem)
- {
-
- String namespace = getNamespaceOfNode(elem);
-
- return (null != namespace)
- ? namespace + ":" + getLocalNameOfNode(elem)
- : getLocalNameOfNode(elem);
- }
-
- /**
- * Returns the attribute name with the namespace prefix (if any) replaced
- * by the Namespace URI it was bound to. This is not a standard
- * representation of a node name, but it allows convenient
- * single-string comparison of the "universal" names of two nodes.
- *
- * @param attr Attr to be examined
- *
- * @return String in the form "namespaceURI:localname" if the node
- * belongs to a namespace, or simply "localname" if it doesn't.
- * @see #getExpandedElementName
- */
- public String getExpandedAttributeName(Attr attr)
- {
-
- String namespace = getNamespaceOfNode(attr);
-
- return (null != namespace)
- ? namespace + ":" + getLocalNameOfNode(attr)
- : getLocalNameOfNode(attr);
- }
-
- //==========================================================
- // SECTION: DOM Helper Functions
- //==========================================================
-
- /**
- * Tell if the node is ignorable whitespace. Note that this can
- * be determined only in the context of a DTD or other Schema,
- * and that DOM Level 2 has nostandardized DOM API which can
- * return that information.
- * @deprecated
- *
- * @param node Node to be examined
- *
- * @return CURRENTLY HARDCODED TO FALSE, but should return true if
- * and only if the node is of type Text, contains only whitespace,
- * and does not appear as part of the #PCDATA content of an element.
- * (Note that determining this last may require allowing for
- * Entity References.)
- */
- public boolean isIgnorableWhitespace(Text node)
- {
-
- boolean isIgnorable = false; // return value
-
- // TODO: I can probably do something to figure out if this
- // space is ignorable from just the information in
- // the DOM tree.
- // -- You need to be able to distinguish whitespace
- // that is #PCDATA from whitespace that isn't. That requires
- // DTD support, which won't be standardized until DOM Level 3.
- return isIgnorable;
- }
-
- /**
- * Get the first unparented node in the ancestor chain.
- * @deprecated
- *
- * @param node Starting node, to specify which chain to chase
- *
- * @return the topmost ancestor.
- */
- public Node getRoot(Node node)
- {
-
- Node root = null;
-
- while (node != null)
- {
- root = node;
- node = getParentOfNode(node);
- }
-
- return root;
- }
-
- /**
- * Get the root node of the document tree, regardless of
- * whether or not the node passed in is a document node.
- * <p>
- * TODO: This doesn't handle DocumentFragments or "orphaned" subtrees
- * -- it's currently returning ownerDocument even when the tree is
- * not actually part of the main Document tree. We should either
- * rewrite the description to say that it finds the Document node,
- * or change the code to walk up the ancestor chain.
-
- *
- * @param n Node to be examined
- *
- * @return the Document node. Note that this is not the correct answer
- * if n was (or was a child of) a DocumentFragment or an orphaned node,
- * as can arise if the DOM has been edited rather than being generated
- * by a parser.
- */
- public Node getRootNode(Node n)
- {
- int nt = n.getNodeType();
- return ( (Node.DOCUMENT_NODE == nt) || (Node.DOCUMENT_FRAGMENT_NODE == nt) )
- ? n : n.getOwnerDocument();
- }
-
- /**
- * Test whether the given node is a namespace decl node. In DOM Level 2
- * this can be done in a namespace-aware manner, but in Level 1 DOMs
- * it has to be done by testing the node name.
- *
- * @param n Node to be examined.
- *
- * @return boolean -- true iff the node is an Attr whose name is
- * "xmlns" or has the "xmlns:" prefix.
- */
- public boolean isNamespaceNode(Node n)
- {
-
- if (Node.ATTRIBUTE_NODE == n.getNodeType())
- {
- String attrName = n.getNodeName();
-
- return (attrName.startsWith("xmlns:") || attrName.equals("xmlns"));
- }
-
- return false;
- }
-
- /**
- * Obtain the XPath-model parent of a DOM node -- ownerElement for Attrs,
- * parent for other nodes.
- * <p>
- * Background: The DOM believes that you must be your Parent's
- * Child, and thus Attrs don't have parents. XPath said that Attrs
- * do have their owning Element as their parent. This function
- * bridges the difference, either by using the DOM Level 2 ownerElement
- * function or by using a "silly and expensive function" in Level 1
- * DOMs.
- * <p>
- * (There's some discussion of future DOMs generalizing ownerElement
- * into ownerNode and making it work on all types of nodes. This
- * still wouldn't help the users of Level 1 or Level 2 DOMs)
- * <p>
- *
- * @param node Node whose XPath parent we want to obtain
- *
- * @return the parent of the node, or the ownerElement if it's an
- * Attr node, or null if the node is an orphan.
- *
- * @throws RuntimeException if the Document has no root element.
- * This can't arise if the Document was created
- * via the DOM Level 2 factory methods, but is possible if other
- * mechanisms were used to obtain it
- */
- public static Node getParentOfNode(Node node) throws RuntimeException
- {
- Node parent;
- short nodeType = node.getNodeType();
-
- if (Node.ATTRIBUTE_NODE == nodeType)
- {
- Document doc = node.getOwnerDocument();
- /*
- TBD:
- if(null == doc)
- {
- throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_CHILD_HAS_NO_OWNER_DOCUMENT, null));//"Attribute child does not have an owner document!");
- }
- */
-
- // Given how expensive the tree walk may be, we should first ask
- // whether this DOM can answer the question for us. The additional
- // test does slow down Level 1 DOMs slightly. DOMHelper2, which
- // is currently specialized for Xerces, assumes it can use the
- // Level 2 solution. We might want to have an intermediate stage,
- // which would assume DOM Level 2 but not assume Xerces.
- //
- // (Shouldn't have to check whether impl is null in a compliant DOM,
- // but let's be paranoid for a moment...)
- DOMImplementation impl=doc.getImplementation();
- if(impl!=null && impl.hasFeature("Core","2.0"))
- {
- parent=((Attr)node).getOwnerElement();
- return parent;
- }
-
- // DOM Level 1 solution, as fallback. Hugely expensive.
-
- Element rootElem = doc.getDocumentElement();
-
- if (null == rootElem)
- {
- throw new RuntimeException(
- XMLMessages.createXMLMessage(
- XMLErrorResources.ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT,
- null)); //"Attribute child does not have an owner document element!");
- }
-
- parent = locateAttrParent(rootElem, node);
-
- }
- else
- {
- parent = node.getParentNode();
-
- // if((Node.DOCUMENT_NODE != nodeType) && (null == parent))
- // {
- // throw new RuntimeException("Child does not have parent!");
- // }
- }
-
- return parent;
- }
-
- /**
- * Given an ID, return the element. This can work only if the document
- * is interpreted in the context of a DTD or Schema, since otherwise
- * we don't know which attributes are or aren't IDs.
- * <p>
- * Note that DOM Level 1 had no ability to retrieve this information.
- * DOM Level 2 introduced it but does not promise that it will be
- * supported in all DOMs; those which can't support it will always
- * return null.
- * <p>
- * TODO: getElementByID is currently unimplemented. Support DOM Level 2?
- *
- * @param id The unique identifier to be searched for.
- * @param doc The document to search within.
- * @return CURRENTLY HARDCODED TO NULL, but it should be:
- * The node which has this unique identifier, or null if there
- * is no such node or this DOM can't reliably recognize it.
- */
- public Element getElementByID(String id, Document doc)
- {
- return null;
- }
-
- /**
- * The getUnparsedEntityURI function returns the URI of the unparsed
- * entity with the specified name in the same document as the context
- * node (see [3.3 Unparsed Entities]). It returns the empty string if
- * there is no such entity.
- * <p>
- * XML processors may choose to use the System Identifier (if one
- * is provided) to resolve the entity, rather than the URI in the
- * Public Identifier. The details are dependent on the processor, and
- * we would have to support some form of plug-in resolver to handle
- * this properly. Currently, we simply return the System Identifier if
- * present, and hope that it a usable URI or that our caller can
- * map it to one.
- * TODO: Resolve Public Identifiers... or consider changing function name.
- * <p>
- * If we find a relative URI
- * reference, XML expects it to be resolved in terms of the base URI
- * of the document. The DOM doesn't do that for us, and it isn't
- * entirely clear whether that should be done here; currently that's
- * pushed up to a higher levelof our application. (Note that DOM Level
- * 1 didn't store the document's base URI.)
- * TODO: Consider resolving Relative URIs.
- * <p>
- * (The DOM's statement that "An XML processor may choose to
- * completely expand entities before the structure model is passed
- * to the DOM" refers only to parsed entities, not unparsed, and hence
- * doesn't affect this function.)
- *
- * @param name A string containing the Entity Name of the unparsed
- * entity.
- * @param doc Document node for the document to be searched.
- *
- * @return String containing the URI of the Unparsed Entity, or an
- * empty string if no such entity exists.
- */
- public String getUnparsedEntityURI(String name, Document doc)
- {
-
- String url = "";
- DocumentType doctype = doc.getDoctype();
-
- if (null != doctype)
- {
- NamedNodeMap entities = doctype.getEntities();
- if(null == entities)
- return url;
- Entity entity = (Entity) entities.getNamedItem(name);
- if(null == entity)
- return url;
-
- String notationName = entity.getNotationName();
-
- if (null != notationName) // then it's unparsed
- {
- // The draft says: "The XSLT processor may use the public
- // identifier to generate a URI for the entity instead of the URI
- // specified in the system identifier. If the XSLT processor does
- // not use the public identifier to generate the URI, it must use
- // the system identifier; if the system identifier is a relative
- // URI, it must be resolved into an absolute URI using the URI of
- // the resource containing the entity declaration as the base
- // URI [RFC2396]."
- // So I'm falling a bit short here.
- url = entity.getSystemId();
-
- if (null == url)
- {
- url = entity.getPublicId();
- }
- else
- {
- // This should be resolved to an absolute URL, but that's hard
- // to do from here.
- }
- }
- }
-
- return url;
- }
-
- /**
- * Support for getParentOfNode; walks a DOM tree until it finds
- * the Element which owns the Attr. This is hugely expensive, and
- * if at all possible you should use the DOM Level 2 Attr.ownerElement()
- * method instead.
- * <p>
- * The DOM Level 1 developers expected that folks would keep track
- * of the last Element they'd seen and could recover the info from
- * that source. Obviously that doesn't work very well if the only
- * information you've been presented with is the Attr. The DOM Level 2
- * getOwnerElement() method fixes that, but only for Level 2 and
- * later DOMs.
- *
- * @param elem Element whose subtree is to be searched for this Attr
- * @param attr Attr whose owner is to be located.
- *
- * @return the first Element whose attribute list includes the provided
- * attr. In modern DOMs, this will also be the only such Element. (Early
- * DOMs had some hope that Attrs might be sharable, but this idea has
- * been abandoned.)
- */
- private static Node locateAttrParent(Element elem, Node attr)
- {
-
- Node parent = null;
-
- // This should only be called for Level 1 DOMs, so we don't have to
- // worry about namespace issues. In later levels, it's possible
- // for a DOM to have two Attrs with the same NodeName but
- // different namespaces, and we'd need to get getAttributeNodeNS...
- // but later levels also have Attr.getOwnerElement.
- Attr check=elem.getAttributeNode(attr.getNodeName());
- if(check==attr)
- parent = elem;
-
- if (null == parent)
- {
- for (Node node = elem.getFirstChild(); null != node;
- node = node.getNextSibling())
- {
- if (Node.ELEMENT_NODE == node.getNodeType())
- {
- parent = locateAttrParent((Element) node, attr);
-
- if (null != parent)
- break;
- }
- }
- }
-
- return parent;
- }
-
- /**
- * The factory object used for creating nodes
- * in the result tree.
- */
- protected Document m_DOMFactory = null;
-
- /**
- * Store the factory object required to create DOM nodes
- * in the result tree. In fact, that's just the result tree's
- * Document node...
- *
- * @param domFactory The DOM Document Node within whose context
- * the result tree will be built.
- */
- public void setDOMFactory(Document domFactory)
- {
- this.m_DOMFactory = domFactory;
- }
-
- /**
- * Retrieve the factory object required to create DOM nodes
- * in the result tree.
- *
- * @return The result tree's DOM Document Node.
- */
- public Document getDOMFactory()
- {
-
- if (null == this.m_DOMFactory)
- {
- this.m_DOMFactory = createDocument();
- }
-
- return this.m_DOMFactory;
- }
-
- /**
- * Get the textual contents of the node. See
- * getNodeData(Node,FastStringBuffer) for discussion of how
- * whitespace nodes are handled.
- *
- * @param node DOM Node to be examined
- * @return String containing a concatenation of all the
- * textual content within that node.
- * @see #getNodeData(Node,FastStringBuffer)
- *
- */
- public static String getNodeData(Node node)
- {
-
- FastStringBuffer buf = StringBufferPool.get();
- String s;
-
- try
- {
- getNodeData(node, buf);
-
- s = (buf.length() > 0) ? buf.toString() : "";
- }
- finally
- {
- StringBufferPool.free(buf);
- }
-
- return s;
- }
-
- /**
- * Retrieve the text content of a DOM subtree, appending it into a
- * user-supplied FastStringBuffer object. Note that attributes are
- * not considered part of the content of an element.
- * <p>
- * There are open questions regarding whitespace stripping.
- * Currently we make no special effort in that regard, since the standard
- * DOM doesn't yet provide DTD-based information to distinguish
- * whitespace-in-element-context from genuine #PCDATA. Note that we
- * should probably also consider xml:space if/when we address this.
- * DOM Level 3 may solve the problem for us.
- *
- * @param node Node whose subtree is to be walked, gathering the
- * contents of all Text or CDATASection nodes.
- * @param buf FastStringBuffer into which the contents of the text
- * nodes are to be concatenated.
- */
- public static void getNodeData(Node node, FastStringBuffer buf)
- {
-
- switch (node.getNodeType())
- {
- case Node.DOCUMENT_FRAGMENT_NODE :
- case Node.DOCUMENT_NODE :
- case Node.ELEMENT_NODE :
- {
- for (Node child = node.getFirstChild(); null != child;
- child = child.getNextSibling())
- {
- getNodeData(child, buf);
- }
- }
- break;
- case Node.TEXT_NODE :
- case Node.CDATA_SECTION_NODE :
- buf.append(node.getNodeValue());
- break;
- case Node.ATTRIBUTE_NODE :
- buf.append(node.getNodeValue());
- break;
- case Node.PROCESSING_INSTRUCTION_NODE :
- // warning(XPATHErrorResources.WG_PARSING_AND_PREPARING);
- break;
- default :
- // ignore
- break;
- }
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/DOMOrder.java b/src/com/sun/org/apache/xml/internal/utils/DOMOrder.java
deleted file mode 100644
index ca74f77..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/DOMOrder.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DOMOrder.java,v 1.2.4.1 2005/09/15 08:15:41 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-/**
- * @deprecated Since the introduction of the DTM, this class will be removed.
- * Nodes that implement this index can return a document order index.
- * Eventually, this will be replaced by DOM 3 methods.
- * (compareDocumentOrder and/or compareTreePosition.)
- */
-public interface DOMOrder
-{
-
- /**
- * Get the UID (document order index).
- *
- * @return integer whose relative value corresponds to document order
- * -- that is, if node1.getUid()<node2.getUid(), node1 comes before
- * node2, and if they're equal node1 and node2 are the same node. No
- * promises are made beyond that.
- */
- public int getUid();
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/DefaultErrorHandler.java b/src/com/sun/org/apache/xml/internal/utils/DefaultErrorHandler.java
deleted file mode 100644
index c08fbe8..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/DefaultErrorHandler.java
+++ /dev/null
@@ -1,344 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DefaultErrorHandler.java,v 1.2.4.1 2005/09/15 08:15:43 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-import java.io.PrintStream;
-import java.io.PrintWriter;
-
-import javax.xml.transform.ErrorListener;
-import javax.xml.transform.SourceLocator;
-import javax.xml.transform.TransformerException;
-
-import com.sun.org.apache.xml.internal.res.XMLErrorResources;
-import com.sun.org.apache.xml.internal.res.XMLMessages;
-
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-
-/**
- * Implement SAX error handler for default reporting.
- * @xsl.usage general
- */
-public class DefaultErrorHandler implements ErrorHandler, ErrorListener
-{
- PrintWriter m_pw;
-
- /**
- * if this flag is set to true, we will rethrow the exception on
- * the error() and fatalError() methods. If it is false, the errors
- * are reported to System.err.
- */
- boolean m_throwExceptionOnError = true;
-
- /**
- * Constructor DefaultErrorHandler
- */
- public DefaultErrorHandler(PrintWriter pw)
- {
- m_pw = pw;
- }
-
- /**
- * Constructor DefaultErrorHandler
- */
- public DefaultErrorHandler(PrintStream pw)
- {
- m_pw = new PrintWriter(pw, true);
- }
-
- /**
- * Constructor DefaultErrorHandler
- */
- public DefaultErrorHandler()
- {
- this(true);
- }
-
- /**
- * Constructor DefaultErrorHandler
- */
- public DefaultErrorHandler(boolean throwExceptionOnError)
- {
- m_pw = new PrintWriter(System.err, true);
- m_throwExceptionOnError = throwExceptionOnError;
- }
-
-
- /**
- * Receive notification of a warning.
- *
- * <p>SAX parsers will use this method to report conditions that
- * are not errors or fatal errors as defined by the XML 1.0
- * recommendation. The default behaviour is to take no action.</p>
- *
- * <p>The SAX parser must continue to provide normal parsing events
- * after invoking this method: it should still be possible for the
- * application to process the document through to the end.</p>
- *
- * @param exception The warning information encapsulated in a
- * SAX parse exception.
- * @throws SAXException Any SAX exception, possibly
- * wrapping another exception.
- */
- public void warning(SAXParseException exception) throws SAXException
- {
- printLocation(m_pw, exception);
- m_pw.println("Parser warning: " + exception.getMessage());
- }
-
- /**
- * Receive notification of a recoverable error.
- *
- * <p>This corresponds to the definition of "error" in section 1.2
- * of the W3C XML 1.0 Recommendation. For example, a validating
- * parser would use this callback to report the violation of a
- * validity constraint. The default behaviour is to take no
- * action.</p>
- *
- * <p>The SAX parser must continue to provide normal parsing events
- * after invoking this method: it should still be possible for the
- * application to process the document through to the end. If the
- * application cannot do so, then the parser should report a fatal
- * error even if the XML 1.0 recommendation does not require it to
- * do so.</p>
- *
- * @param exception The error information encapsulated in a
- * SAX parse exception.
- * @throws SAXException Any SAX exception, possibly
- * wrapping another exception.
- */
- public void error(SAXParseException exception) throws SAXException
- {
- //printLocation(exception);
- // m_pw.println(exception.getMessage());
-
- throw exception;
- }
-
- /**
- * Receive notification of a non-recoverable error.
- *
- * <p>This corresponds to the definition of "fatal error" in
- * section 1.2 of the W3C XML 1.0 Recommendation. For example, a
- * parser would use this callback to report the violation of a
- * well-formedness constraint.</p>
- *
- * <p>The application must assume that the document is unusable
- * after the parser has invoked this method, and should continue
- * (if at all) only for the sake of collecting addition error
- * messages: in fact, SAX parsers are free to stop reporting any
- * other events once this method has been invoked.</p>
- *
- * @param exception The error information encapsulated in a
- * SAX parse exception.
- * @throws SAXException Any SAX exception, possibly
- * wrapping another exception.
- */
- public void fatalError(SAXParseException exception) throws SAXException
- {
- // printLocation(exception);
- // m_pw.println(exception.getMessage());
-
- throw exception;
- }
-
- /**
- * Receive notification of a warning.
- *
- * <p>SAX parsers will use this method to report conditions that
- * are not errors or fatal errors as defined by the XML 1.0
- * recommendation. The default behaviour is to take no action.</p>
- *
- * <p>The SAX parser must continue to provide normal parsing events
- * after invoking this method: it should still be possible for the
- * application to process the document through to the end.</p>
- *
- * @param exception The warning information encapsulated in a
- * SAX parse exception.
- * @throws javax.xml.transform.TransformerException Any SAX exception, possibly
- * wrapping another exception.
- * @see javax.xml.transform.TransformerException
- */
- public void warning(TransformerException exception) throws TransformerException
- {
- printLocation(m_pw, exception);
-
- m_pw.println(exception.getMessage());
- }
-
- /**
- * Receive notification of a recoverable error.
- *
- * <p>This corresponds to the definition of "error" in section 1.2
- * of the W3C XML 1.0 Recommendation. For example, a validating
- * parser would use this callback to report the violation of a
- * validity constraint. The default behaviour is to take no
- * action.</p>
- *
- * <p>The SAX parser must continue to provide normal parsing events
- * after invoking this method: it should still be possible for the
- * application to process the document through to the end. If the
- * application cannot do so, then the parser should report a fatal
- * error even if the XML 1.0 recommendation does not require it to
- * do so.</p>
- *
- * @param exception The error information encapsulated in a
- * SAX parse exception.
- * @throws javax.xml.transform.TransformerException Any SAX exception, possibly
- * wrapping another exception.
- * @see javax.xml.transform.TransformerException
- */
- public void error(TransformerException exception) throws TransformerException
- {
- // If the m_throwExceptionOnError flag is true, rethrow the exception.
- // Otherwise report the error to System.err.
- if (m_throwExceptionOnError)
- throw exception;
- else
- {
- printLocation(m_pw, exception);
- m_pw.println(exception.getMessage());
- }
- }
-
- /**
- * Receive notification of a non-recoverable error.
- *
- * <p>This corresponds to the definition of "fatal error" in
- * section 1.2 of the W3C XML 1.0 Recommendation. For example, a
- * parser would use this callback to report the violation of a
- * well-formedness constraint.</p>
- *
- * <p>The application must assume that the document is unusable
- * after the parser has invoked this method, and should continue
- * (if at all) only for the sake of collecting addition error
- * messages: in fact, SAX parsers are free to stop reporting any
- * other events once this method has been invoked.</p>
- *
- * @param exception The error information encapsulated in a
- * SAX parse exception.
- * @throws javax.xml.transform.TransformerException Any SAX exception, possibly
- * wrapping another exception.
- * @see javax.xml.transform.TransformerException
- */
- public void fatalError(TransformerException exception) throws TransformerException
- {
- // If the m_throwExceptionOnError flag is true, rethrow the exception.
- // Otherwise report the error to System.err.
- if (m_throwExceptionOnError)
- throw exception;
- else
- {
- printLocation(m_pw, exception);
- m_pw.println(exception.getMessage());
- }
- }
-
- public static void ensureLocationSet(TransformerException exception)
- {
- // SourceLocator locator = exception.getLocator();
- SourceLocator locator = null;
- Throwable cause = exception;
-
- // Try to find the locator closest to the cause.
- do
- {
- if(cause instanceof SAXParseException)
- {
- locator = new SAXSourceLocator((SAXParseException)cause);
- }
- else if (cause instanceof TransformerException)
- {
- SourceLocator causeLocator = ((TransformerException)cause).getLocator();
- if(null != causeLocator)
- locator = causeLocator;
- }
-
- if(cause instanceof TransformerException)
- cause = ((TransformerException)cause).getCause();
- else if(cause instanceof SAXException)
- cause = ((SAXException)cause).getException();
- else
- cause = null;
- }
- while(null != cause);
-
- exception.setLocator(locator);
- }
-
- public static void printLocation(PrintStream pw, TransformerException exception)
- {
- printLocation(new PrintWriter(pw), exception);
- }
-
- public static void printLocation(java.io.PrintStream pw, org.xml.sax.SAXParseException exception)
- {
- printLocation(new PrintWriter(pw), exception);
- }
-
- public static void printLocation(PrintWriter pw, Throwable exception)
- {
- SourceLocator locator = null;
- Throwable cause = exception;
-
- // Try to find the locator closest to the cause.
- do
- {
- if(cause instanceof SAXParseException)
- {
- locator = new SAXSourceLocator((SAXParseException)cause);
- }
- else if (cause instanceof TransformerException)
- {
- SourceLocator causeLocator = ((TransformerException)cause).getLocator();
- if(null != causeLocator)
- locator = causeLocator;
- }
- if(cause instanceof TransformerException)
- cause = ((TransformerException)cause).getCause();
- else if(cause instanceof WrappedRuntimeException)
- cause = ((WrappedRuntimeException)cause).getException();
- else if(cause instanceof SAXException)
- cause = ((SAXException)cause).getException();
- else
- cause = null;
- }
- while(null != cause);
-
- if(null != locator)
- {
- // m_pw.println("Parser fatal error: "+exception.getMessage());
- String id = (null != locator.getPublicId() )
- ? locator.getPublicId()
- : (null != locator.getSystemId())
- ? locator.getSystemId() : XMLMessages.createXMLMessage(XMLErrorResources.ER_SYSTEMID_UNKNOWN, null); //"SystemId Unknown";
-
- pw.print(id + "; " +XMLMessages.createXMLMessage("line", null) + locator.getLineNumber()
- + "; " +XMLMessages.createXMLMessage("column", null) + locator.getColumnNumber()+"; ");
- }
- else
- pw.print("("+XMLMessages.createXMLMessage(XMLErrorResources.ER_LOCATION_UNKNOWN, null)+")");
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/ElemDesc.java b/src/com/sun/org/apache/xml/internal/utils/ElemDesc.java
deleted file mode 100644
index 0237b01..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/ElemDesc.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ElemDesc.java,v 1.2.4.1 2005/09/15 08:15:44 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-import java.util.HashMap;
-import java.util.Map;
-
-
-/**
- * This class is in support of SerializerToHTML, and acts as a sort
- * of element representative for HTML elements.
- * @xsl.usage internal
- */
-class ElemDesc
-{
-
- /** Table of attributes for the element */
- Map<String, Integer> m_attrs = null;
-
- /** Element's flags, describing the role this element plays during
- * formatting of the document. This is used as a bitvector; more than one flag
- * may be set at a time, bitwise-ORed together. Mnemonic and bits
- * have been assigned to the flag values. NOTE: Some bits are
- * currently assigned multiple mnemonics; it is the caller's
- * responsibility to disambiguate these if necessary. */
- int m_flags;
-
- /** Defines mnemonic and bit-value for the EMPTY flag */
- static final int EMPTY = (1 << 1);
-
- /** Defines mnemonic and bit-value for the FLOW flag */
- static final int FLOW = (1 << 2);
-
- /** Defines mnemonic and bit-value for the BLOCK flag */
- static final int BLOCK = (1 << 3);
-
- /** Defines mnemonic and bit-value for the BLOCKFORM flag */
- static final int BLOCKFORM = (1 << 4);
-
- /** Defines mnemonic and bit-value for the BLOCKFORMFIELDSET flag */
- static final int BLOCKFORMFIELDSET = (1 << 5);
-
- /** Defines mnemonic and bit-value for the CDATA flag */
- static final int CDATA = (1 << 6);
-
- /** Defines mnemonic and bit-value for the PCDATA flag */
- static final int PCDATA = (1 << 7);
-
- /** Defines mnemonic and bit-value for the RAW flag */
- static final int RAW = (1 << 8);
-
- /** Defines mnemonic and bit-value for the INLINE flag */
- static final int INLINE = (1 << 9);
-
- /** Defines mnemonic and bit-value for the INLINEA flag */
- static final int INLINEA = (1 << 10);
-
- /** Defines mnemonic and bit-value for the INLINELABEL flag */
- static final int INLINELABEL = (1 << 11);
-
- /** Defines mnemonic and bit-value for the FONTSTYLE flag */
- static final int FONTSTYLE = (1 << 12);
-
- /** Defines mnemonic and bit-value for the PHRASE flag */
- static final int PHRASE = (1 << 13);
-
- /** Defines mnemonic and bit-value for the FORMCTRL flag */
- static final int FORMCTRL = (1 << 14);
-
- /** Defines mnemonic and bit-value for the SPECIAL flag */
- static final int SPECIAL = (1 << 15);
-
- /** Defines mnemonic and bit-value for the ASPECIAL flag */
- static final int ASPECIAL = (1 << 16);
-
- /** Defines mnemonic and bit-value for the HEADMISC flag */
- static final int HEADMISC = (1 << 17);
-
- /** Defines mnemonic and bit-value for the HEAD flag */
- static final int HEAD = (1 << 18);
-
- /** Defines mnemonic and bit-value for the LIST flag */
- static final int LIST = (1 << 19);
-
- /** Defines mnemonic and bit-value for the PREFORMATTED flag */
- static final int PREFORMATTED = (1 << 20);
-
- /** Defines mnemonic and bit-value for the WHITESPACESENSITIVE flag */
- static final int WHITESPACESENSITIVE = (1 << 21);
-
- /** Defines mnemonic and bit-value for the ATTRURL flag */
- static final int ATTRURL = (1 << 1);
-
- /** Defines mnemonic and bit-value for the ATTREMPTY flag */
- static final int ATTREMPTY = (1 << 2);
-
- /**
- * Construct an ElementDescription with an initial set of flags.
- *
- * @param flags Element flags
- * @see m_flags
- */
- ElemDesc(int flags)
- {
- m_flags = flags;
- }
-
- /**
- * "is (this element described by these flags)".
- *
- * This might more properly be called areFlagsSet(). It accepts an
- * integer (being used as a bitvector) and checks whether all the
- * corresponding bits are set in our internal flags. Note that this
- * test is performed as a bitwise AND, not an equality test, so a
- * 0 bit in the input means "don't test", not "must be set false".
- *
- * @param flags Vector of flags to compare against this element's flags
- *
- * @return true if the flags set in the parameter are also set in the
- * element's stored flags.
- *
- * @see m_flags
- * @see isAttrFlagSet
- */
- boolean is(int flags)
- {
- // int which = (m_flags & flags);
- return (m_flags & flags) != 0;
- }
-
- /**
- * Set a new attribute for this element
- *
- *
- * @param name Attribute name
- * @param flags Attibute flags
- */
- void setAttr(String name, int flags)
- {
-
- if (null == m_attrs)
- m_attrs = new HashMap<>();
-
- m_attrs.put(name, flags);
- }
-
- /**
- * Find out if a flag is set in a given attribute of this element
- *
- *
- * @param name Attribute name
- * @param flags Flag to check
- *
- * @return True if the flag is set in the attribute. Returns false
- * if the attribute is not found
- * @see m_flags
- */
- boolean isAttrFlagSet(String name, int flags)
- {
-
- if (null != m_attrs)
- {
- Integer _flags = m_attrs.get(name);
-
- if (null != _flags)
- {
- return (_flags & flags) != 0;
- }
- }
-
- return false;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/FastStringBuffer.java b/src/com/sun/org/apache/xml/internal/utils/FastStringBuffer.java
deleted file mode 100644
index b8b9a51..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/FastStringBuffer.java
+++ /dev/null
@@ -1,1298 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FastStringBuffer.java,v 1.2.4.1 2005/09/15 08:15:44 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-/**
- * Bare-bones, unsafe, fast string buffer. No thread-safety, no
- * parameter range checking, exposed fields. Note that in typical
- * applications, thread-safety of a StringBuffer is a somewhat
- * dubious concept in any case.
- * <p>
- * Note that Stree and DTM used a single FastStringBuffer as a string pool,
- * by recording start and length indices within this single buffer. This
- * minimizes heap overhead, but of course requires more work when retrieving
- * the data.
- * <p>
- * FastStringBuffer operates as a "chunked buffer". Doing so
- * reduces the need to recopy existing information when an append
- * exceeds the space available; we just allocate another chunk and
- * flow across to it. (The array of chunks may need to grow,
- * admittedly, but that's a much smaller object.) Some excess
- * recopying may arise when we extract Strings which cross chunk
- * boundaries; larger chunks make that less frequent.
- * <p>
- * The size values are parameterized, to allow tuning this code. In
- * theory, Result Tree Fragments might want to be tuned differently
- * from the main document's text.
- * <p>
- * %REVIEW% An experiment in self-tuning is
- * included in the code (using nested FastStringBuffers to achieve
- * variation in chunk sizes), but this implementation has proven to
- * be problematic when data may be being copied from the FSB into itself.
- * We should either re-architect that to make this safe (if possible)
- * or remove that code and clean up for performance/maintainability reasons.
- * <p>
- */
-public class FastStringBuffer
-{
- // If nonzero, forces the inial chunk size.
- /**/static final int DEBUG_FORCE_INIT_BITS=0;
-
- // %BUG% %REVIEW% *****PROBLEM SUSPECTED: If data from an FSB is being copied
- // back into the same FSB (variable set from previous variable, for example)
- // and blocksize changes in mid-copy... there's risk of severe malfunction in
- // the read process, due to how the resizing code re-jiggers storage. Arggh.
- // If we want to retain the variable-size-block feature, we need to reconsider
- // that issue. For now, I have forced us into fixed-size mode.
- static final boolean DEBUG_FORCE_FIXED_CHUNKSIZE=true;
-
- /** Manifest constant: Suppress leading whitespace.
- * This should be used when normalize-to-SAX is called for the first chunk of a
- * multi-chunk output, or one following unsuppressed whitespace in a previous
- * chunk.
- * @see #sendNormalizedSAXcharacters(org.xml.sax.ContentHandler,int,int)
- */
- public static final int SUPPRESS_LEADING_WS=0x01;
-
- /** Manifest constant: Suppress trailing whitespace.
- * This should be used when normalize-to-SAX is called for the last chunk of a
- * multi-chunk output; it may have to be or'ed with SUPPRESS_LEADING_WS.
- */
- public static final int SUPPRESS_TRAILING_WS=0x02;
-
- /** Manifest constant: Suppress both leading and trailing whitespace.
- * This should be used when normalize-to-SAX is called for a complete string.
- * (I'm not wild about the name of this one. Ideas welcome.)
- * @see #sendNormalizedSAXcharacters(org.xml.sax.ContentHandler,int,int)
- */
- public static final int SUPPRESS_BOTH
- = SUPPRESS_LEADING_WS | SUPPRESS_TRAILING_WS;
-
- /** Manifest constant: Carry trailing whitespace of one chunk as leading
- * whitespace of the next chunk. Used internally; I don't see any reason
- * to make it public right now.
- */
- private static final int CARRY_WS=0x04;
-
- /**
- * Field m_chunkBits sets our chunking strategy, by saying how many
- * bits of index can be used within a single chunk before flowing over
- * to the next chunk. For example, if m_chunkbits is set to 15, each
- * chunk can contain up to 2^15 (32K) characters
- */
- int m_chunkBits = 15;
-
- /**
- * Field m_maxChunkBits affects our chunk-growth strategy, by saying what
- * the largest permissible chunk size is in this particular FastStringBuffer
- * hierarchy.
- */
- int m_maxChunkBits = 15;
-
- /**
- * Field m_rechunkBits affects our chunk-growth strategy, by saying how
- * many chunks should be allocated at one size before we encapsulate them
- * into the first chunk of the next size up. For example, if m_rechunkBits
- * is set to 3, then after 8 chunks at a given size we will rebundle
- * them as the first element of a FastStringBuffer using a chunk size
- * 8 times larger (chunkBits shifted left three bits).
- */
- int m_rebundleBits = 2;
-
- /**
- * Field m_chunkSize establishes the maximum size of one chunk of the array
- * as 2**chunkbits characters.
- * (Which may also be the minimum size if we aren't tuning for storage)
- */
- int m_chunkSize; // =1<<(m_chunkBits-1);
-
- /**
- * Field m_chunkMask is m_chunkSize-1 -- in other words, m_chunkBits
- * worth of low-order '1' bits, useful for shift-and-mask addressing
- * within the chunks.
- */
- int m_chunkMask; // =m_chunkSize-1;
-
- /**
- * Field m_array holds the string buffer's text contents, using an
- * array-of-arrays. Note that this array, and the arrays it contains, may be
- * reallocated when necessary in order to allow the buffer to grow;
- * references to them should be considered to be invalidated after any
- * append. However, the only time these arrays are directly exposed
- * is in the sendSAXcharacters call.
- */
- char[][] m_array;
-
- /**
- * Field m_lastChunk is an index into m_array[], pointing to the last
- * chunk of the Chunked Array currently in use. Note that additional
- * chunks may actually be allocated, eg if the FastStringBuffer had
- * previously been truncated or if someone issued an ensureSpace request.
- * <p>
- * The insertion point for append operations is addressed by the combination
- * of m_lastChunk and m_firstFree.
- */
- int m_lastChunk = 0;
-
- /**
- * Field m_firstFree is an index into m_array[m_lastChunk][], pointing to
- * the first character in the Chunked Array which is not part of the
- * FastStringBuffer's current content. Since m_array[][] is zero-based,
- * the length of that content can be calculated as
- * (m_lastChunk<<m_chunkBits) + m_firstFree
- */
- int m_firstFree = 0;
-
- /**
- * Field m_innerFSB, when non-null, is a FastStringBuffer whose total
- * length equals m_chunkSize, and which replaces m_array[0]. This allows
- * building a hierarchy of FastStringBuffers, where early appends use
- * a smaller chunkSize (for less wasted memory overhead) but later
- * ones use a larger chunkSize (for less heap activity overhead).
- */
- FastStringBuffer m_innerFSB = null;
-
- /**
- * Construct a FastStringBuffer, with allocation policy as per parameters.
- * <p>
- * For coding convenience, I've expressed both allocation sizes in terms of
- * a number of bits. That's needed for the final size of a chunk,
- * to permit fast and efficient shift-and-mask addressing. It's less critical
- * for the inital size, and may be reconsidered.
- * <p>
- * An alternative would be to accept integer sizes and round to powers of two;
- * that really doesn't seem to buy us much, if anything.
- *
- * @param initChunkBits Length in characters of the initial allocation
- * of a chunk, expressed in log-base-2. (That is, 10 means allocate 1024
- * characters.) Later chunks will use larger allocation units, to trade off
- * allocation speed of large document against storage efficiency of small
- * ones.
- * @param maxChunkBits Number of character-offset bits that should be used for
- * addressing within a chunk. Maximum length of a chunk is 2^chunkBits
- * characters.
- * @param rebundleBits Number of character-offset bits that addressing should
- * advance before we attempt to take a step from initChunkBits to maxChunkBits
- */
- public FastStringBuffer(int initChunkBits, int maxChunkBits,
- int rebundleBits)
- {
- if(DEBUG_FORCE_INIT_BITS!=0) initChunkBits=DEBUG_FORCE_INIT_BITS;
-
- // %REVIEW%
- // Should this force to larger value, or smaller? Smaller less efficient, but if
- // someone requested variable mode it's because they care about storage space.
- // On the other hand, given the other changes I'm making, odds are that we should
- // adopt the larger size. Dither, dither, dither... This is just stopgap workaround
- // anyway; we need a permanant solution.
- //
- if(DEBUG_FORCE_FIXED_CHUNKSIZE) maxChunkBits=initChunkBits;
- //if(DEBUG_FORCE_FIXED_CHUNKSIZE) initChunkBits=maxChunkBits;
-
- m_array = new char[16][];
-
- // Don't bite off more than we're prepared to swallow!
- if (initChunkBits > maxChunkBits)
- initChunkBits = maxChunkBits;
-
- m_chunkBits = initChunkBits;
- m_maxChunkBits = maxChunkBits;
- m_rebundleBits = rebundleBits;
- m_chunkSize = 1 << (initChunkBits);
- m_chunkMask = m_chunkSize - 1;
- m_array[0] = new char[m_chunkSize];
- }
-
- /**
- * Construct a FastStringBuffer, using a default rebundleBits value.
- *
- * NEEDSDOC @param initChunkBits
- * NEEDSDOC @param maxChunkBits
- */
- public FastStringBuffer(int initChunkBits, int maxChunkBits)
- {
- this(initChunkBits, maxChunkBits, 2);
- }
-
- /**
- * Construct a FastStringBuffer, using default maxChunkBits and
- * rebundleBits values.
- * <p>
- * ISSUE: Should this call assert initial size, or fixed size?
- * Now configured as initial, with a default for fixed.
- *
- * NEEDSDOC @param initChunkBits
- */
- public FastStringBuffer(int initChunkBits)
- {
- this(initChunkBits, 15, 2);
- }
-
- /**
- * Construct a FastStringBuffer, using a default allocation policy.
- */
- public FastStringBuffer()
- {
-
- // 10 bits is 1K. 15 bits is 32K. Remember that these are character
- // counts, so actual memory allocation unit is doubled for UTF-16 chars.
- //
- // For reference: In the original FastStringBuffer, we simply
- // overallocated by blocksize (default 1KB) on each buffer-growth.
- this(10, 15, 2);
- }
-
- /**
- * Get the length of the list. Synonym for length().
- *
- * @return the number of characters in the FastStringBuffer's content.
- */
- public final int size()
- {
- return (m_lastChunk << m_chunkBits) + m_firstFree;
- }
-
- /**
- * Get the length of the list. Synonym for size().
- *
- * @return the number of characters in the FastStringBuffer's content.
- */
- public final int length()
- {
- return (m_lastChunk << m_chunkBits) + m_firstFree;
- }
-
- /**
- * Discard the content of the FastStringBuffer, and most of the memory
- * that was allocated by it, restoring the initial state. Note that this
- * may eventually be different from setLength(0), which see.
- */
- public final void reset()
- {
-
- m_lastChunk = 0;
- m_firstFree = 0;
-
- // Recover the original chunk size
- FastStringBuffer innermost = this;
-
- while (innermost.m_innerFSB != null)
- {
- innermost = innermost.m_innerFSB;
- }
-
- m_chunkBits = innermost.m_chunkBits;
- m_chunkSize = innermost.m_chunkSize;
- m_chunkMask = innermost.m_chunkMask;
-
- // Discard the hierarchy
- m_innerFSB = null;
- m_array = new char[16][0];
- m_array[0] = new char[m_chunkSize];
- }
-
- /**
- * Directly set how much of the FastStringBuffer's storage is to be
- * considered part of its content. This is a fast but hazardous
- * operation. It is not protected against negative values, or values
- * greater than the amount of storage currently available... and even
- * if additional storage does exist, its contents are unpredictable.
- * The only safe use for our setLength() is to truncate the FastStringBuffer
- * to a shorter string.
- *
- * @param l New length. If l<0 or l>=getLength(), this operation will
- * not report an error but future operations will almost certainly fail.
- */
- public final void setLength(int l)
- {
- m_lastChunk = l >>> m_chunkBits;
-
- if (m_lastChunk == 0 && m_innerFSB != null)
- {
- // Replace this FSB with the appropriate inner FSB, truncated
- m_innerFSB.setLength(l, this);
- }
- else
- {
- m_firstFree = l & m_chunkMask;
-
- // There's an edge case if l is an exact multiple of m_chunkBits, which risks leaving
- // us pointing at the start of a chunk which has not yet been allocated. Rather than
- // pay the cost of dealing with that in the append loops (more scattered and more
- // inner-loop), we correct it here by moving to the safe side of that
- // line -- as we would have left the indexes had we appended up to that point.
- if(m_firstFree==0 && m_lastChunk>0)
- {
- --m_lastChunk;
- m_firstFree=m_chunkSize;
- }
- }
- }
-
- /**
- * Subroutine for the public setLength() method. Deals with the fact
- * that truncation may require restoring one of the innerFSBs
- *
- * NEEDSDOC @param l
- * NEEDSDOC @param rootFSB
- */
- private final void setLength(int l, FastStringBuffer rootFSB)
- {
-
- m_lastChunk = l >>> m_chunkBits;
-
- if (m_lastChunk == 0 && m_innerFSB != null)
- {
- m_innerFSB.setLength(l, rootFSB);
- }
- else
- {
-
- // Undo encapsulation -- pop the innerFSB data back up to root.
- // Inefficient, but attempts to keep the code simple.
- rootFSB.m_chunkBits = m_chunkBits;
- rootFSB.m_maxChunkBits = m_maxChunkBits;
- rootFSB.m_rebundleBits = m_rebundleBits;
- rootFSB.m_chunkSize = m_chunkSize;
- rootFSB.m_chunkMask = m_chunkMask;
- rootFSB.m_array = m_array;
- rootFSB.m_innerFSB = m_innerFSB;
- rootFSB.m_lastChunk = m_lastChunk;
-
- // Finally, truncate this sucker.
- rootFSB.m_firstFree = l & m_chunkMask;
- }
- }
-
- /**
- * Note that this operation has been somewhat deoptimized by the shift to a
- * chunked array, as there is no factory method to produce a String object
- * directly from an array of arrays and hence a double copy is needed.
- * By using ensureCapacity we hope to minimize the heap overhead of building
- * the intermediate StringBuffer.
- * <p>
- * (It really is a pity that Java didn't design String as a final subclass
- * of MutableString, rather than having StringBuffer be a separate hierarchy.
- * We'd avoid a <strong>lot</strong> of double-buffering.)
- *
- * @return the contents of the FastStringBuffer as a standard Java string.
- */
- public final String toString()
- {
-
- int length = (m_lastChunk << m_chunkBits) + m_firstFree;
-
- return getString(new StringBuffer(length), 0, 0, length).toString();
- }
-
- /**
- * Append a single character onto the FastStringBuffer, growing the
- * storage if necessary.
- * <p>
- * NOTE THAT after calling append(), previously obtained
- * references to m_array[][] may no longer be valid....
- * though in fact they should be in this instance.
- *
- * @param value character to be appended.
- */
- public final void append(char value)
- {
-
- char[] chunk;
-
- // We may have preallocated chunks. If so, all but last should
- // be at full size.
- boolean lastchunk = (m_lastChunk + 1 == m_array.length);
-
- if (m_firstFree < m_chunkSize) // Simplified test single-character-fits
- chunk = m_array[m_lastChunk];
- else
- {
-
- // Extend array?
- int i = m_array.length;
-
- if (m_lastChunk + 1 == i)
- {
- char[][] newarray = new char[i + 16][];
-
- System.arraycopy(m_array, 0, newarray, 0, i);
-
- m_array = newarray;
- }
-
- // Advance one chunk
- chunk = m_array[++m_lastChunk];
-
- if (chunk == null)
- {
-
- // Hierarchical encapsulation
- if (m_lastChunk == 1 << m_rebundleBits
- && m_chunkBits < m_maxChunkBits)
- {
-
- // Should do all the work of both encapsulating
- // existing data and establishing new sizes/offsets
- m_innerFSB = new FastStringBuffer(this);
- }
-
- // Add a chunk.
- chunk = m_array[m_lastChunk] = new char[m_chunkSize];
- }
-
- m_firstFree = 0;
- }
-
- // Space exists in the chunk. Append the character.
- chunk[m_firstFree++] = value;
- }
-
- /**
- * Append the contents of a String onto the FastStringBuffer,
- * growing the storage if necessary.
- * <p>
- * NOTE THAT after calling append(), previously obtained
- * references to m_array[] may no longer be valid.
- *
- * @param value String whose contents are to be appended.
- */
- public final void append(String value)
- {
-
- if (value == null)
- return;
- int strlen = value.length();
-
- if (0 == strlen)
- return;
-
- int copyfrom = 0;
- char[] chunk = m_array[m_lastChunk];
- int available = m_chunkSize - m_firstFree;
-
- // Repeat while data remains to be copied
- while (strlen > 0)
- {
-
- // Copy what fits
- if (available > strlen)
- available = strlen;
-
- value.getChars(copyfrom, copyfrom + available, m_array[m_lastChunk],
- m_firstFree);
-
- strlen -= available;
- copyfrom += available;
-
- // If there's more left, allocate another chunk and continue
- if (strlen > 0)
- {
-
- // Extend array?
- int i = m_array.length;
-
- if (m_lastChunk + 1 == i)
- {
- char[][] newarray = new char[i + 16][];
-
- System.arraycopy(m_array, 0, newarray, 0, i);
-
- m_array = newarray;
- }
-
- // Advance one chunk
- chunk = m_array[++m_lastChunk];
-
- if (chunk == null)
- {
-
- // Hierarchical encapsulation
- if (m_lastChunk == 1 << m_rebundleBits
- && m_chunkBits < m_maxChunkBits)
- {
-
- // Should do all the work of both encapsulating
- // existing data and establishing new sizes/offsets
- m_innerFSB = new FastStringBuffer(this);
- }
-
- // Add a chunk.
- chunk = m_array[m_lastChunk] = new char[m_chunkSize];
- }
-
- available = m_chunkSize;
- m_firstFree = 0;
- }
- }
-
- // Adjust the insert point in the last chunk, when we've reached it.
- m_firstFree += available;
- }
-
- /**
- * Append the contents of a StringBuffer onto the FastStringBuffer,
- * growing the storage if necessary.
- * <p>
- * NOTE THAT after calling append(), previously obtained
- * references to m_array[] may no longer be valid.
- *
- * @param value StringBuffer whose contents are to be appended.
- */
- public final void append(StringBuffer value)
- {
-
- if (value == null)
- return;
- int strlen = value.length();
-
- if (0 == strlen)
- return;
-
- int copyfrom = 0;
- char[] chunk = m_array[m_lastChunk];
- int available = m_chunkSize - m_firstFree;
-
- // Repeat while data remains to be copied
- while (strlen > 0)
- {
-
- // Copy what fits
- if (available > strlen)
- available = strlen;
-
- value.getChars(copyfrom, copyfrom + available, m_array[m_lastChunk],
- m_firstFree);
-
- strlen -= available;
- copyfrom += available;
-
- // If there's more left, allocate another chunk and continue
- if (strlen > 0)
- {
-
- // Extend array?
- int i = m_array.length;
-
- if (m_lastChunk + 1 == i)
- {
- char[][] newarray = new char[i + 16][];
-
- System.arraycopy(m_array, 0, newarray, 0, i);
-
- m_array = newarray;
- }
-
- // Advance one chunk
- chunk = m_array[++m_lastChunk];
-
- if (chunk == null)
- {
-
- // Hierarchical encapsulation
- if (m_lastChunk == 1 << m_rebundleBits
- && m_chunkBits < m_maxChunkBits)
- {
-
- // Should do all the work of both encapsulating
- // existing data and establishing new sizes/offsets
- m_innerFSB = new FastStringBuffer(this);
- }
-
- // Add a chunk.
- chunk = m_array[m_lastChunk] = new char[m_chunkSize];
- }
-
- available = m_chunkSize;
- m_firstFree = 0;
- }
- }
-
- // Adjust the insert point in the last chunk, when we've reached it.
- m_firstFree += available;
- }
-
- /**
- * Append part of the contents of a Character Array onto the
- * FastStringBuffer, growing the storage if necessary.
- * <p>
- * NOTE THAT after calling append(), previously obtained
- * references to m_array[] may no longer be valid.
- *
- * @param chars character array from which data is to be copied
- * @param start offset in chars of first character to be copied,
- * zero-based.
- * @param length number of characters to be copied
- */
- public final void append(char[] chars, int start, int length)
- {
-
- int strlen = length;
-
- if (0 == strlen)
- return;
-
- int copyfrom = start;
- char[] chunk = m_array[m_lastChunk];
- int available = m_chunkSize - m_firstFree;
-
- // Repeat while data remains to be copied
- while (strlen > 0)
- {
-
- // Copy what fits
- if (available > strlen)
- available = strlen;
-
- System.arraycopy(chars, copyfrom, m_array[m_lastChunk], m_firstFree,
- available);
-
- strlen -= available;
- copyfrom += available;
-
- // If there's more left, allocate another chunk and continue
- if (strlen > 0)
- {
-
- // Extend array?
- int i = m_array.length;
-
- if (m_lastChunk + 1 == i)
- {
- char[][] newarray = new char[i + 16][];
-
- System.arraycopy(m_array, 0, newarray, 0, i);
-
- m_array = newarray;
- }
-
- // Advance one chunk
- chunk = m_array[++m_lastChunk];
-
- if (chunk == null)
- {
-
- // Hierarchical encapsulation
- if (m_lastChunk == 1 << m_rebundleBits
- && m_chunkBits < m_maxChunkBits)
- {
-
- // Should do all the work of both encapsulating
- // existing data and establishing new sizes/offsets
- m_innerFSB = new FastStringBuffer(this);
- }
-
- // Add a chunk.
- chunk = m_array[m_lastChunk] = new char[m_chunkSize];
- }
-
- available = m_chunkSize;
- m_firstFree = 0;
- }
- }
-
- // Adjust the insert point in the last chunk, when we've reached it.
- m_firstFree += available;
- }
-
- /**
- * Append the contents of another FastStringBuffer onto
- * this FastStringBuffer, growing the storage if necessary.
- * <p>
- * NOTE THAT after calling append(), previously obtained
- * references to m_array[] may no longer be valid.
- *
- * @param value FastStringBuffer whose contents are
- * to be appended.
- */
- public final void append(FastStringBuffer value)
- {
-
- // Complicating factor here is that the two buffers may use
- // different chunk sizes, and even if they're the same we're
- // probably on a different alignment due to previously appended
- // data. We have to work through the source in bite-sized chunks.
- if (value == null)
- return;
- int strlen = value.length();
-
- if (0 == strlen)
- return;
-
- int copyfrom = 0;
- char[] chunk = m_array[m_lastChunk];
- int available = m_chunkSize - m_firstFree;
-
- // Repeat while data remains to be copied
- while (strlen > 0)
- {
-
- // Copy what fits
- if (available > strlen)
- available = strlen;
-
- int sourcechunk = (copyfrom + value.m_chunkSize - 1)
- >>> value.m_chunkBits;
- int sourcecolumn = copyfrom & value.m_chunkMask;
- int runlength = value.m_chunkSize - sourcecolumn;
-
- if (runlength > available)
- runlength = available;
-
- System.arraycopy(value.m_array[sourcechunk], sourcecolumn,
- m_array[m_lastChunk], m_firstFree, runlength);
-
- if (runlength != available)
- System.arraycopy(value.m_array[sourcechunk + 1], 0,
- m_array[m_lastChunk], m_firstFree + runlength,
- available - runlength);
-
- strlen -= available;
- copyfrom += available;
-
- // If there's more left, allocate another chunk and continue
- if (strlen > 0)
- {
-
- // Extend array?
- int i = m_array.length;
-
- if (m_lastChunk + 1 == i)
- {
- char[][] newarray = new char[i + 16][];
-
- System.arraycopy(m_array, 0, newarray, 0, i);
-
- m_array = newarray;
- }
-
- // Advance one chunk
- chunk = m_array[++m_lastChunk];
-
- if (chunk == null)
- {
-
- // Hierarchical encapsulation
- if (m_lastChunk == 1 << m_rebundleBits
- && m_chunkBits < m_maxChunkBits)
- {
-
- // Should do all the work of both encapsulating
- // existing data and establishing new sizes/offsets
- m_innerFSB = new FastStringBuffer(this);
- }
-
- // Add a chunk.
- chunk = m_array[m_lastChunk] = new char[m_chunkSize];
- }
-
- available = m_chunkSize;
- m_firstFree = 0;
- }
- }
-
- // Adjust the insert point in the last chunk, when we've reached it.
- m_firstFree += available;
- }
-
- /**
- * @return true if the specified range of characters are all whitespace,
- * as defined by XMLCharacterRecognizer.
- * <p>
- * CURRENTLY DOES NOT CHECK FOR OUT-OF-RANGE.
- *
- * @param start Offset of first character in the range.
- * @param length Number of characters to send.
- */
- public boolean isWhitespace(int start, int length)
- {
-
- int sourcechunk = start >>> m_chunkBits;
- int sourcecolumn = start & m_chunkMask;
- int available = m_chunkSize - sourcecolumn;
- boolean chunkOK;
-
- while (length > 0)
- {
- int runlength = (length <= available) ? length : available;
-
- if (sourcechunk == 0 && m_innerFSB != null)
- chunkOK = m_innerFSB.isWhitespace(sourcecolumn, runlength);
- else
- chunkOK = com.sun.org.apache.xml.internal.utils.XMLCharacterRecognizer.isWhiteSpace(
- m_array[sourcechunk], sourcecolumn, runlength);
-
- if (!chunkOK)
- return false;
-
- length -= runlength;
-
- ++sourcechunk;
-
- sourcecolumn = 0;
- available = m_chunkSize;
- }
-
- return true;
- }
-
- /**
- * @param start Offset of first character in the range.
- * @param length Number of characters to send.
- * @return a new String object initialized from the specified range of
- * characters.
- */
- public String getString(int start, int length)
- {
- int startColumn = start & m_chunkMask;
- int startChunk = start >>> m_chunkBits;
- if (startColumn + length < m_chunkMask && m_innerFSB == null) {
- return getOneChunkString(startChunk, startColumn, length);
- }
- return getString(new StringBuffer(length), startChunk, startColumn,
- length).toString();
- }
-
- protected String getOneChunkString(int startChunk, int startColumn,
- int length) {
- return new String(m_array[startChunk], startColumn, length);
- }
-
- /**
- * @param sb StringBuffer to be appended to
- * @param start Offset of first character in the range.
- * @param length Number of characters to send.
- * @return sb with the requested text appended to it
- */
- StringBuffer getString(StringBuffer sb, int start, int length)
- {
- return getString(sb, start >>> m_chunkBits, start & m_chunkMask, length);
- }
-
- /**
- * Internal support for toString() and getString().
- * PLEASE NOTE SIGNATURE CHANGE from earlier versions; it now appends into
- * and returns a StringBuffer supplied by the caller. This simplifies
- * m_innerFSB support.
- * <p>
- * Note that this operation has been somewhat deoptimized by the shift to a
- * chunked array, as there is no factory method to produce a String object
- * directly from an array of arrays and hence a double copy is needed.
- * By presetting length we hope to minimize the heap overhead of building
- * the intermediate StringBuffer.
- * <p>
- * (It really is a pity that Java didn't design String as a final subclass
- * of MutableString, rather than having StringBuffer be a separate hierarchy.
- * We'd avoid a <strong>lot</strong> of double-buffering.)
- *
- *
- * @param sb
- * @param startChunk
- * @param startColumn
- * @param length
- *
- * @return the contents of the FastStringBuffer as a standard Java string.
- */
- StringBuffer getString(StringBuffer sb, int startChunk, int startColumn,
- int length)
- {
-
- int stop = (startChunk << m_chunkBits) + startColumn + length;
- int stopChunk = stop >>> m_chunkBits;
- int stopColumn = stop & m_chunkMask;
-
- // Factored out
- //StringBuffer sb=new StringBuffer(length);
- for (int i = startChunk; i < stopChunk; ++i)
- {
- if (i == 0 && m_innerFSB != null)
- m_innerFSB.getString(sb, startColumn, m_chunkSize - startColumn);
- else
- sb.append(m_array[i], startColumn, m_chunkSize - startColumn);
-
- startColumn = 0; // after first chunk
- }
-
- if (stopChunk == 0 && m_innerFSB != null)
- m_innerFSB.getString(sb, startColumn, stopColumn - startColumn);
- else if (stopColumn > startColumn)
- sb.append(m_array[stopChunk], startColumn, stopColumn - startColumn);
-
- return sb;
- }
-
- /**
- * Get a single character from the string buffer.
- *
- *
- * @param pos character position requested.
- * @return A character from the requested position.
- */
- public char charAt(int pos)
- {
- int startChunk = pos >>> m_chunkBits;
-
- if (startChunk == 0 && m_innerFSB != null)
- return m_innerFSB.charAt(pos & m_chunkMask);
- else
- return m_array[startChunk][pos & m_chunkMask];
- }
-
- /**
- * Sends the specified range of characters as one or more SAX characters()
- * events.
- * Note that the buffer reference passed to the ContentHandler may be
- * invalidated if the FastStringBuffer is edited; it's the user's
- * responsibility to manage access to the FastStringBuffer to prevent this
- * problem from arising.
- * <p>
- * Note too that there is no promise that the output will be sent as a
- * single call. As is always true in SAX, one logical string may be split
- * across multiple blocks of memory and hence delivered as several
- * successive events.
- *
- * @param ch SAX ContentHandler object to receive the event.
- * @param start Offset of first character in the range.
- * @param length Number of characters to send.
- * @exception org.xml.sax.SAXException may be thrown by handler's
- * characters() method.
- */
- public void sendSAXcharacters(
- org.xml.sax.ContentHandler ch, int start, int length)
- throws org.xml.sax.SAXException
- {
-
- int startChunk = start >>> m_chunkBits;
- int startColumn = start & m_chunkMask;
- if (startColumn + length < m_chunkMask && m_innerFSB == null) {
- ch.characters(m_array[startChunk], startColumn, length);
- return;
- }
-
- int stop = start + length;
- int stopChunk = stop >>> m_chunkBits;
- int stopColumn = stop & m_chunkMask;
-
- for (int i = startChunk; i < stopChunk; ++i)
- {
- if (i == 0 && m_innerFSB != null)
- m_innerFSB.sendSAXcharacters(ch, startColumn,
- m_chunkSize - startColumn);
- else
- ch.characters(m_array[i], startColumn, m_chunkSize - startColumn);
-
- startColumn = 0; // after first chunk
- }
-
- // Last, or only, chunk
- if (stopChunk == 0 && m_innerFSB != null)
- m_innerFSB.sendSAXcharacters(ch, startColumn, stopColumn - startColumn);
- else if (stopColumn > startColumn)
- {
- ch.characters(m_array[stopChunk], startColumn,
- stopColumn - startColumn);
- }
- }
-
- /**
- * Sends the specified range of characters as one or more SAX characters()
- * events, normalizing the characters according to XSLT rules.
- *
- * @param ch SAX ContentHandler object to receive the event.
- * @param start Offset of first character in the range.
- * @param length Number of characters to send.
- * @return normalization status to apply to next chunk (because we may
- * have been called recursively to process an inner FSB):
- * <dl>
- * <dt>0</dt>
- * <dd>if this output did not end in retained whitespace, and thus whitespace
- * at the start of the following chunk (if any) should be converted to a
- * single space.
- * <dt>SUPPRESS_LEADING_WS</dt>
- * <dd>if this output ended in retained whitespace, and thus whitespace
- * at the start of the following chunk (if any) should be completely
- * suppressed.</dd>
- * </dd>
- * </dl>
- * @exception org.xml.sax.SAXException may be thrown by handler's
- * characters() method.
- */
- public int sendNormalizedSAXcharacters(
- org.xml.sax.ContentHandler ch, int start, int length)
- throws org.xml.sax.SAXException
- {
- // This call always starts at the beginning of the
- // string being written out, either because it was called directly or
- // because it was an m_innerFSB recursion. This is important since
- // it gives us a well-known initial state for this flag:
- int stateForNextChunk=SUPPRESS_LEADING_WS;
-
- int stop = start + length;
- int startChunk = start >>> m_chunkBits;
- int startColumn = start & m_chunkMask;
- int stopChunk = stop >>> m_chunkBits;
- int stopColumn = stop & m_chunkMask;
-
- for (int i = startChunk; i < stopChunk; ++i)
- {
- if (i == 0 && m_innerFSB != null)
- stateForNextChunk=
- m_innerFSB.sendNormalizedSAXcharacters(ch, startColumn,
- m_chunkSize - startColumn);
- else
- stateForNextChunk=
- sendNormalizedSAXcharacters(m_array[i], startColumn,
- m_chunkSize - startColumn,
- ch,stateForNextChunk);
-
- startColumn = 0; // after first chunk
- }
-
- // Last, or only, chunk
- if (stopChunk == 0 && m_innerFSB != null)
- stateForNextChunk= // %REVIEW% Is this update really needed?
- m_innerFSB.sendNormalizedSAXcharacters(ch, startColumn, stopColumn - startColumn);
- else if (stopColumn > startColumn)
- {
- stateForNextChunk= // %REVIEW% Is this update really needed?
- sendNormalizedSAXcharacters(m_array[stopChunk],
- startColumn, stopColumn - startColumn,
- ch, stateForNextChunk | SUPPRESS_TRAILING_WS);
- }
- return stateForNextChunk;
- }
-
- static final char[] SINGLE_SPACE = {' '};
-
- /**
- * Internal method to directly normalize and dispatch the character array.
- * This version is aware of the fact that it may be called several times
- * in succession if the data is made up of multiple "chunks", and thus
- * must actively manage the handling of leading and trailing whitespace.
- *
- * Note: The recursion is due to the possible recursion of inner FSBs.
- *
- * @param ch The characters from the XML document.
- * @param start The start position in the array.
- * @param length The number of characters to read from the array.
- * @param handler SAX ContentHandler object to receive the event.
- * @param edgeTreatmentFlags How leading/trailing spaces should be handled.
- * This is a bitfield contining two flags, bitwise-ORed together:
- * <dl>
- * <dt>SUPPRESS_LEADING_WS</dt>
- * <dd>When false, causes leading whitespace to be converted to a single
- * space; when true, causes it to be discarded entirely.
- * Should be set TRUE for the first chunk, and (in multi-chunk output)
- * whenever the previous chunk ended in retained whitespace.</dd>
- * <dt>SUPPRESS_TRAILING_WS</dt>
- * <dd>When false, causes trailing whitespace to be converted to a single
- * space; when true, causes it to be discarded entirely.
- * Should be set TRUE for the last or only chunk.
- * </dd>
- * </dl>
- * @return normalization status, as in the edgeTreatmentFlags parameter:
- * <dl>
- * <dt>0</dt>
- * <dd>if this output did not end in retained whitespace, and thus whitespace
- * at the start of the following chunk (if any) should be converted to a
- * single space.
- * <dt>SUPPRESS_LEADING_WS</dt>
- * <dd>if this output ended in retained whitespace, and thus whitespace
- * at the start of the following chunk (if any) should be completely
- * suppressed.</dd>
- * </dd>
- * </dl>
- *
- *
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- */
- static int sendNormalizedSAXcharacters(char ch[],
- int start, int length,
- org.xml.sax.ContentHandler handler,
- int edgeTreatmentFlags)
- throws org.xml.sax.SAXException
- {
- boolean processingLeadingWhitespace =
- ((edgeTreatmentFlags & SUPPRESS_LEADING_WS) != 0);
- boolean seenWhitespace = ((edgeTreatmentFlags & CARRY_WS) != 0);
- boolean suppressTrailingWhitespace =
- ((edgeTreatmentFlags & SUPPRESS_TRAILING_WS) != 0);
- int currPos = start;
- int limit = start+length;
-
- // Strip any leading spaces first, if required
- if (processingLeadingWhitespace) {
- for (; currPos < limit
- && XMLCharacterRecognizer.isWhiteSpace(ch[currPos]);
- currPos++) { }
-
- // If we've only encountered leading spaces, the
- // current state remains unchanged
- if (currPos == limit) {
- return edgeTreatmentFlags;
- }
- }
-
- // If we get here, there are no more leading spaces to strip
- while (currPos < limit) {
- int startNonWhitespace = currPos;
-
- // Grab a chunk of non-whitespace characters
- for (; currPos < limit
- && !XMLCharacterRecognizer.isWhiteSpace(ch[currPos]);
- currPos++) { }
-
- // Non-whitespace seen - emit them, along with a single
- // space for any preceding whitespace characters
- if (startNonWhitespace != currPos) {
- if (seenWhitespace) {
- handler.characters(SINGLE_SPACE, 0, 1);
- seenWhitespace = false;
- }
- handler.characters(ch, startNonWhitespace,
- currPos - startNonWhitespace);
- }
-
- int startWhitespace = currPos;
-
- // Consume any whitespace characters
- for (; currPos < limit
- && XMLCharacterRecognizer.isWhiteSpace(ch[currPos]);
- currPos++) { }
-
- if (startWhitespace != currPos) {
- seenWhitespace = true;
- }
- }
-
- return (seenWhitespace ? CARRY_WS : 0)
- | (edgeTreatmentFlags & SUPPRESS_TRAILING_WS);
- }
-
- /**
- * Directly normalize and dispatch the character array.
- *
- * @param ch The characters from the XML document.
- * @param start The start position in the array.
- * @param length The number of characters to read from the array.
- * @param handler SAX ContentHandler object to receive the event.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- */
- public static void sendNormalizedSAXcharacters(char ch[],
- int start, int length,
- org.xml.sax.ContentHandler handler)
- throws org.xml.sax.SAXException
- {
- sendNormalizedSAXcharacters(ch, start, length,
- handler, SUPPRESS_BOTH);
- }
-
- /**
- * Sends the specified range of characters as sax Comment.
- * <p>
- * Note that, unlike sendSAXcharacters, this has to be done as a single
- * call to LexicalHandler#comment.
- *
- * @param ch SAX LexicalHandler object to receive the event.
- * @param start Offset of first character in the range.
- * @param length Number of characters to send.
- * @exception org.xml.sax.SAXException may be thrown by handler's
- * characters() method.
- */
- public void sendSAXComment(
- org.xml.sax.ext.LexicalHandler ch, int start, int length)
- throws org.xml.sax.SAXException
- {
-
- // %OPT% Do it this way for now...
- String comment = getString(start, length);
- ch.comment(comment.toCharArray(), 0, length);
- }
-
- /**
- * Copies characters from this string into the destination character
- * array.
- *
- * @param srcBegin index of the first character in the string
- * to copy.
- * @param srcEnd index after the last character in the string
- * to copy.
- * @param dst the destination array.
- * @param dstBegin the start offset in the destination array.
- * @exception IndexOutOfBoundsException If any of the following
- * is true:
- * <ul><li><code>srcBegin</code> is negative.
- * <li><code>srcBegin</code> is greater than <code>srcEnd</code>
- * <li><code>srcEnd</code> is greater than the length of this
- * string
- * <li><code>dstBegin</code> is negative
- * <li><code>dstBegin+(srcEnd-srcBegin)</code> is larger than
- * <code>dst.length</code></ul>
- * @exception NullPointerException if <code>dst</code> is <code>null</code>
- */
- private void getChars(int srcBegin, int srcEnd, char dst[], int dstBegin)
- {
- // %TBD% Joe needs to write this function. Make public when implemented.
- }
-
- /**
- * Encapsulation c'tor. After this is called, the source FastStringBuffer
- * will be reset to use the new object as its m_innerFSB, and will have
- * had its chunk size reset appropriately. IT SHOULD NEVER BE CALLED
- * EXCEPT WHEN source.length()==1<<(source.m_chunkBits+source.m_rebundleBits)
- *
- * NEEDSDOC @param source
- */
- private FastStringBuffer(FastStringBuffer source)
- {
-
- // Copy existing information into new encapsulation
- m_chunkBits = source.m_chunkBits;
- m_maxChunkBits = source.m_maxChunkBits;
- m_rebundleBits = source.m_rebundleBits;
- m_chunkSize = source.m_chunkSize;
- m_chunkMask = source.m_chunkMask;
- m_array = source.m_array;
- m_innerFSB = source.m_innerFSB;
-
- // These have to be adjusted because we're calling just at the time
- // when we would be about to allocate another chunk
- m_lastChunk = source.m_lastChunk - 1;
- m_firstFree = source.m_chunkSize;
-
- // Establish capsule as the Inner FSB, reset chunk sizes/addressing
- source.m_array = new char[16][];
- source.m_innerFSB = this;
-
- // Since we encapsulated just as we were about to append another
- // chunk, return ready to create the chunk after the innerFSB
- // -- 1, not 0.
- source.m_lastChunk = 1;
- source.m_firstFree = 0;
- source.m_chunkBits += m_rebundleBits;
- source.m_chunkSize = 1 << (source.m_chunkBits);
- source.m_chunkMask = source.m_chunkSize - 1;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/Hashtree2Node.java b/src/com/sun/org/apache/xml/internal/utils/Hashtree2Node.java
deleted file mode 100644
index 89491f5..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/Hashtree2Node.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2002-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Hashtree2Node.java,v 1.2.4.1 2005/09/15 08:15:45 suresh_emailid Exp $
- */
-
-package com.sun.org.apache.xml.internal.utils;
-
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Vector;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * Simple static utility to convert Hashtable to a Node.
- *
- * Please maintain JDK 1.1.x compatibility; no Collections!
- *
- * @see com.sun.org.apache.xalan.internal.xslt.EnvironmentCheck
- * @see com.sun.org.apache.xalan.internal.lib.Extensions
- * @author shane_curcuru@us.ibm.com
- * @xsl.usage general
- */
-public abstract class Hashtree2Node
-{
-
- /**
- * Convert a Hashtable into a Node tree.
- *
- * <p>The hash may have either Hashtables as values (in which
- * case we recurse) or other values, in which case we print them
- * as &lt;item> elements, with a 'key' attribute with the value
- * of the key, and the element contents as the value.</p>
- *
- * <p>If args are null we simply return without doing anything.
- * If we encounter an error, we will attempt to add an 'ERROR'
- * Element with exception info; if that doesn't work we simply
- * return without doing anything else byt printStackTrace().</p>
- *
- * @param hash to get info from (may have sub-hashtables)
- * @param name to use as parent element for appended node
- * futurework could have namespace and prefix as well
- * @param container Node to append our report to
- * @param factory Document providing createElement, etc. services
- */
- public static void appendHashToNode(Hashtable hash, String name,
- Node container, Document factory)
- {
- // Required arguments must not be null
- if ((null == container) || (null == factory) || (null == hash))
- {
- return;
- }
-
- // name we will provide a default value for
- String elemName = null;
- if ((null == name) || ("".equals(name)))
- elemName = "appendHashToNode";
- else
- elemName = name;
-
- try
- {
- Element hashNode = factory.createElement(elemName);
- container.appendChild(hashNode);
-
- Enumeration keys = hash.keys();
- Vector v = new Vector();
-
- while (keys.hasMoreElements())
- {
- Object key = keys.nextElement();
- String keyStr = key.toString();
- Object item = hash.get(key);
-
- if (item instanceof Hashtable)
- {
- // Ensure a pre-order traversal; add this hashes
- // items before recursing to child hashes
- // Save name and hash in two steps
- v.addElement(keyStr);
- v.addElement((Hashtable) item);
- }
- else
- {
- try
- {
- // Add item to node
- Element node = factory.createElement("item");
- node.setAttribute("key", keyStr);
- node.appendChild(factory.createTextNode((String)item));
- hashNode.appendChild(node);
- }
- catch (Exception e)
- {
- Element node = factory.createElement("item");
- node.setAttribute("key", keyStr);
- node.appendChild(factory.createTextNode("ERROR: Reading " + key + " threw: " + e.toString()));
- hashNode.appendChild(node);
- }
- }
- }
-
- // Now go back and do the saved hashes
- keys = v.elements();
- while (keys.hasMoreElements())
- {
- // Retrieve name and hash in two steps
- String n = (String) keys.nextElement();
- Hashtable h = (Hashtable) keys.nextElement();
-
- appendHashToNode(h, n, hashNode, factory);
- }
- }
- catch (Exception e2)
- {
- // Ooops, just bail (suggestions for a safe thing
- // to do in this case appreciated)
- e2.printStackTrace();
- }
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/IntStack.java b/src/com/sun/org/apache/xml/internal/utils/IntStack.java
deleted file mode 100644
index eb18b3a..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/IntStack.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: IntStack.java,v 1.2.4.1 2005/09/15 08:15:45 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-import java.util.EmptyStackException;
-
-/**
- * Implement a stack of simple integers.
- *
- * %OPT%
- * This is currently based on IntVector, which permits fast acess but pays a
- * heavy recopying penalty if/when its size is increased. If we expect deep
- * stacks, we should consider a version based on ChunkedIntVector.
- * @xsl.usage internal
- */
-public class IntStack extends IntVector
-{
-
- /**
- * Default constructor. Note that the default
- * block size is very small, for small lists.
- */
- public IntStack()
- {
- super();
- }
-
- /**
- * Construct a IntVector, using the given block size.
- *
- * @param blocksize Size of block to allocate
- */
- public IntStack(int blocksize)
- {
- super(blocksize);
- }
-
- /**
- * Copy constructor for IntStack
- *
- * @param v IntStack to copy
- */
- public IntStack (IntStack v)
- {
- super(v);
- }
-
- /**
- * Pushes an item onto the top of this stack.
- *
- * @param i the int to be pushed onto this stack.
- * @return the <code>item</code> argument.
- */
- public int push(int i)
- {
-
- if ((m_firstFree + 1) >= m_mapSize)
- {
- m_mapSize += m_blocksize;
-
- int newMap[] = new int[m_mapSize];
-
- System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);
-
- m_map = newMap;
- }
-
- m_map[m_firstFree] = i;
-
- m_firstFree++;
-
- return i;
- }
-
- /**
- * Removes the object at the top of this stack and returns that
- * object as the value of this function.
- *
- * @return The object at the top of this stack.
- */
- public final int pop()
- {
- return m_map[--m_firstFree];
- }
-
- /**
- * Quickly pops a number of items from the stack.
- */
-
- public final void quickPop(int n)
- {
- m_firstFree -= n;
- }
-
- /**
- * Looks at the object at the top of this stack without removing it
- * from the stack.
- *
- * @return the object at the top of this stack.
- * @throws EmptyStackException if this stack is empty.
- */
- public final int peek()
- {
- try {
- return m_map[m_firstFree - 1];
- }
- catch (ArrayIndexOutOfBoundsException e)
- {
- throw new EmptyStackException();
- }
- }
-
- /**
- * Looks at the object at the position the stack counting down n items.
- *
- * @param n The number of items down, indexed from zero.
- * @return the object at n items down.
- * @throws EmptyStackException if this stack is empty.
- */
- public int peek(int n)
- {
- try {
- return m_map[m_firstFree-(1+n)];
- }
- catch (ArrayIndexOutOfBoundsException e)
- {
- throw new EmptyStackException();
- }
- }
-
- /**
- * Sets an object at a the top of the statck
- *
- *
- * @param val object to set at the top
- * @throws EmptyStackException if this stack is empty.
- */
- public void setTop(int val)
- {
- try {
- m_map[m_firstFree - 1] = val;
- }
- catch (ArrayIndexOutOfBoundsException e)
- {
- throw new EmptyStackException();
- }
- }
-
- /**
- * Tests if this stack is empty.
- *
- * @return <code>true</code> if this stack is empty;
- * <code>false</code> otherwise.
- * @since JDK1.0
- */
- public boolean empty()
- {
- return m_firstFree == 0;
- }
-
- /**
- * Returns where an object is on this stack.
- *
- * @param o the desired object.
- * @return the distance from the top of the stack where the object is]
- * located; the return value <code>-1</code> indicates that the
- * object is not on the stack.
- * @since JDK1.0
- */
- public int search(int o)
- {
-
- int i = lastIndexOf(o);
-
- if (i >= 0)
- {
- return size() - i;
- }
-
- return -1;
- }
-
- /**
- * Returns clone of current IntStack
- *
- * @return clone of current IntStack
- */
- public Object clone()
- throws CloneNotSupportedException
- {
- return (IntStack) super.clone();
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/IntVector.java b/src/com/sun/org/apache/xml/internal/utils/IntVector.java
deleted file mode 100644
index d8748c4..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/IntVector.java
+++ /dev/null
@@ -1,421 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: IntVector.java,v 1.2.4.1 2005/09/15 08:15:45 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-/**
- * A very simple table that stores a list of int.
- *
- * This version is based on a "realloc" strategy -- a simle array is
- * used, and when more storage is needed, a larger array is obtained
- * and all existing data is recopied into it. As a result, read/write
- * access to existing nodes is O(1) fast but appending may be O(N**2)
- * slow. See also SuballocatedIntVector.
- * @xsl.usage internal
- */
-public class IntVector implements Cloneable
-{
-
- /** Size of blocks to allocate */
- protected int m_blocksize;
-
- /** Array of ints */
- protected int m_map[]; // IntStack is trying to see this directly
-
- /** Number of ints in array */
- protected int m_firstFree = 0;
-
- /** Size of array */
- protected int m_mapSize;
-
- /**
- * Default constructor. Note that the default
- * block size is very small, for small lists.
- */
- public IntVector()
- {
-
- m_blocksize = 32;
- m_mapSize = m_blocksize;
- m_map = new int[m_blocksize];
- }
-
- /**
- * Construct a IntVector, using the given block size.
- *
- * @param blocksize Size of block to allocate
- */
- public IntVector(int blocksize)
- {
-
- m_blocksize = blocksize;
- m_mapSize = blocksize;
- m_map = new int[blocksize];
- }
-
- /**
- * Construct a IntVector, using the given block size.
- *
- * @param blocksize Size of block to allocate
- */
- public IntVector(int blocksize, int increaseSize)
- {
-
- m_blocksize = increaseSize;
- m_mapSize = blocksize;
- m_map = new int[blocksize];
- }
-
- /**
- * Copy constructor for IntVector
- *
- * @param v Existing IntVector to copy
- */
- public IntVector(IntVector v)
- {
- m_map = new int[v.m_mapSize];
- m_mapSize = v.m_mapSize;
- m_firstFree = v.m_firstFree;
- m_blocksize = v.m_blocksize;
- System.arraycopy(v.m_map, 0, m_map, 0, m_firstFree);
- }
-
- /**
- * Get the length of the list.
- *
- * @return length of the list
- */
- public final int size()
- {
- return m_firstFree;
- }
-
- /**
- * Get the length of the list.
- *
- * @return length of the list
- */
- public final void setSize(int sz)
- {
- m_firstFree = sz;
- }
-
-
- /**
- * Append a int onto the vector.
- *
- * @param value Int to add to the list
- */
- public final void addElement(int value)
- {
-
- if ((m_firstFree + 1) >= m_mapSize)
- {
- m_mapSize += m_blocksize;
-
- int newMap[] = new int[m_mapSize];
-
- System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);
-
- m_map = newMap;
- }
-
- m_map[m_firstFree] = value;
-
- m_firstFree++;
- }
-
- /**
- * Append several int values onto the vector.
- *
- * @param value Int to add to the list
- */
- public final void addElements(int value, int numberOfElements)
- {
-
- if ((m_firstFree + numberOfElements) >= m_mapSize)
- {
- m_mapSize += (m_blocksize+numberOfElements);
-
- int newMap[] = new int[m_mapSize];
-
- System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);
-
- m_map = newMap;
- }
-
- for (int i = 0; i < numberOfElements; i++)
- {
- m_map[m_firstFree] = value;
- m_firstFree++;
- }
- }
-
- /**
- * Append several slots onto the vector, but do not set the values.
- *
- * @param numberOfElements Int to add to the list
- */
- public final void addElements(int numberOfElements)
- {
-
- if ((m_firstFree + numberOfElements) >= m_mapSize)
- {
- m_mapSize += (m_blocksize+numberOfElements);
-
- int newMap[] = new int[m_mapSize];
-
- System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);
-
- m_map = newMap;
- }
-
- m_firstFree += numberOfElements;
- }
-
-
- /**
- * Inserts the specified node in this vector at the specified index.
- * Each component in this vector with an index greater or equal to
- * the specified index is shifted upward to have an index one greater
- * than the value it had previously.
- *
- * @param value Int to insert
- * @param at Index of where to insert
- */
- public final void insertElementAt(int value, int at)
- {
-
- if ((m_firstFree + 1) >= m_mapSize)
- {
- m_mapSize += m_blocksize;
-
- int newMap[] = new int[m_mapSize];
-
- System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);
-
- m_map = newMap;
- }
-
- if (at <= (m_firstFree - 1))
- {
- System.arraycopy(m_map, at, m_map, at + 1, m_firstFree - at);
- }
-
- m_map[at] = value;
-
- m_firstFree++;
- }
-
- /**
- * Inserts the specified node in this vector at the specified index.
- * Each component in this vector with an index greater or equal to
- * the specified index is shifted upward to have an index one greater
- * than the value it had previously.
- */
- public final void removeAllElements()
- {
-
- for (int i = 0; i < m_firstFree; i++)
- {
- m_map[i] = java.lang.Integer.MIN_VALUE;
- }
-
- m_firstFree = 0;
- }
-
- /**
- * Removes the first occurrence of the argument from this vector.
- * If the object is found in this vector, each component in the vector
- * with an index greater or equal to the object's index is shifted
- * downward to have an index one smaller than the value it had
- * previously.
- *
- * @param s Int to remove from array
- *
- * @return True if the int was removed, false if it was not found
- */
- public final boolean removeElement(int s)
- {
-
- for (int i = 0; i < m_firstFree; i++)
- {
- if (m_map[i] == s)
- {
- if ((i + 1) < m_firstFree)
- System.arraycopy(m_map, i + 1, m_map, i - 1, m_firstFree - i);
- else
- m_map[i] = java.lang.Integer.MIN_VALUE;
-
- m_firstFree--;
-
- return true;
- }
- }
-
- return false;
- }
-
- /**
- * Deletes the component at the specified index. Each component in
- * this vector with an index greater or equal to the specified
- * index is shifted downward to have an index one smaller than
- * the value it had previously.
- *
- * @param i index of where to remove and int
- */
- public final void removeElementAt(int i)
- {
-
- if (i > m_firstFree)
- System.arraycopy(m_map, i + 1, m_map, i, m_firstFree);
- else
- m_map[i] = java.lang.Integer.MIN_VALUE;
-
- m_firstFree--;
- }
-
- /**
- * Sets the component at the specified index of this vector to be the
- * specified object. The previous component at that position is discarded.
- *
- * The index must be a value greater than or equal to 0 and less
- * than the current size of the vector.
- *
- * @param value object to set
- * @param index Index of where to set the object
- */
- public final void setElementAt(int value, int index)
- {
- m_map[index] = value;
- }
-
- /**
- * Get the nth element.
- *
- * @param i index of object to get
- *
- * @return object at given index
- */
- public final int elementAt(int i)
- {
- return m_map[i];
- }
-
- /**
- * Tell if the table contains the given node.
- *
- * @param s object to look for
- *
- * @return true if the object is in the list
- */
- public final boolean contains(int s)
- {
-
- for (int i = 0; i < m_firstFree; i++)
- {
- if (m_map[i] == s)
- return true;
- }
-
- return false;
- }
-
- /**
- * Searches for the first occurence of the given argument,
- * beginning the search at index, and testing for equality
- * using the equals method.
- *
- * @param elem object to look for
- * @param index Index of where to begin search
- * @return the index of the first occurrence of the object
- * argument in this vector at position index or later in the
- * vector; returns -1 if the object is not found.
- */
- public final int indexOf(int elem, int index)
- {
-
- for (int i = index; i < m_firstFree; i++)
- {
- if (m_map[i] == elem)
- return i;
- }
-
- return java.lang.Integer.MIN_VALUE;
- }
-
- /**
- * Searches for the first occurence of the given argument,
- * beginning the search at index, and testing for equality
- * using the equals method.
- *
- * @param elem object to look for
- * @return the index of the first occurrence of the object
- * argument in this vector at position index or later in the
- * vector; returns -1 if the object is not found.
- */
- public final int indexOf(int elem)
- {
-
- for (int i = 0; i < m_firstFree; i++)
- {
- if (m_map[i] == elem)
- return i;
- }
-
- return java.lang.Integer.MIN_VALUE;
- }
-
- /**
- * Searches for the first occurence of the given argument,
- * beginning the search at index, and testing for equality
- * using the equals method.
- *
- * @param elem Object to look for
- * @return the index of the first occurrence of the object
- * argument in this vector at position index or later in the
- * vector; returns -1 if the object is not found.
- */
- public final int lastIndexOf(int elem)
- {
-
- for (int i = (m_firstFree - 1); i >= 0; i--)
- {
- if (m_map[i] == elem)
- return i;
- }
-
- return java.lang.Integer.MIN_VALUE;
- }
-
- /**
- * Returns clone of current IntVector
- *
- * @return clone of current IntVector
- */
- public Object clone()
- throws CloneNotSupportedException
- {
- return new IntVector(this);
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/ListingErrorHandler.java b/src/com/sun/org/apache/xml/internal/utils/ListingErrorHandler.java
deleted file mode 100644
index 5ddf139..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/ListingErrorHandler.java
+++ /dev/null
@@ -1,567 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2000-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ListingErrorHandler.java,v 1.2.4.1 2005/09/15 08:15:46 suresh_emailid Exp $
- */
-
-package com.sun.org.apache.xml.internal.utils;
-
-import java.io.BufferedReader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.PrintWriter;
-import java.net.URL;
-import java.net.URLConnection;
-
-import javax.xml.transform.ErrorListener;
-import javax.xml.transform.SourceLocator;
-import javax.xml.transform.TransformerException;
-
-import com.sun.org.apache.xml.internal.res.XMLErrorResources;
-import com.sun.org.apache.xml.internal.res.XMLMessages;
-
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-
-/**
- * Sample implementation of similar SAX ErrorHandler and JAXP ErrorListener.
- *
- * <p>This implementation is suitable for various use cases, and
- * provides some basic configuration API's as well to control
- * when we re-throw errors, etc.</p>
- *
- * @author shane_curcuru@us.ibm.com
- * @xsl.usage general
- */
-public class ListingErrorHandler implements ErrorHandler, ErrorListener
-{
- protected PrintWriter m_pw = null;
-
-
- /**
- * Constructor ListingErrorHandler; user-supplied PrintWriter.
- */
- public ListingErrorHandler(PrintWriter pw)
- {
- if (null == pw)
- throw new NullPointerException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER, null));
- // "ListingErrorHandler created with null PrintWriter!");
-
- m_pw = pw;
- }
-
- /**
- * Constructor ListingErrorHandler; uses System.err.
- */
- public ListingErrorHandler()
- {
- m_pw = new PrintWriter(System.err, true);
- }
-
-
- /* ======== Implement org.xml.sax.ErrorHandler ======== */
- /**
- * Receive notification of a warning.
- *
- * <p>SAX parsers will use this method to report conditions that
- * are not errors or fatal errors as defined by the XML 1.0
- * recommendation. The default behaviour is to take no action.</p>
- *
- * <p>The SAX parser must continue to provide normal parsing events
- * after invoking this method: it should still be possible for the
- * application to process the document through to the end.</p>
- *
- * <p>Filters may use this method to report other, non-XML warnings
- * as well.</p>
- *
- * @param exception The warning information encapsulated in a
- * SAX parse exception.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception; only if setThrowOnWarning is true.
- * @see org.xml.sax.SAXParseException
- */
- public void warning (SAXParseException exception)
- throws SAXException
- {
- logExceptionLocation(m_pw, exception);
- // Note: should we really call .toString() below, since
- // sometimes the message is not properly set?
- m_pw.println("warning: " + exception.getMessage());
- m_pw.flush();
-
- if (getThrowOnWarning())
- throw exception;
- }
-
-
- /**
- * Receive notification of a recoverable error.
- *
- * <p>This corresponds to the definition of "error" in section 1.2
- * of the W3C XML 1.0 Recommendation. For example, a validating
- * parser would use this callback to report the violation of a
- * validity constraint. The default behaviour is to take no
- * action.</p>
- *
- * <p>The SAX parser must continue to provide normal parsing events
- * after invoking this method: it should still be possible for the
- * application to process the document through to the end. If the
- * application cannot do so, then the parser should report a fatal
- * error even if the XML 1.0 recommendation does not require it to
- * do so.</p>
- *
- * <p>Filters may use this method to report other, non-XML errors
- * as well.</p>
- *
- * @param exception The error information encapsulated in a
- * SAX parse exception.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception; only if setThrowOnErroris true.
- * @see org.xml.sax.SAXParseException
- */
- public void error (SAXParseException exception)
- throws SAXException
- {
- logExceptionLocation(m_pw, exception);
- m_pw.println("error: " + exception.getMessage());
- m_pw.flush();
-
- if (getThrowOnError())
- throw exception;
- }
-
-
- /**
- * Receive notification of a non-recoverable error.
- *
- * <p>This corresponds to the definition of "fatal error" in
- * section 1.2 of the W3C XML 1.0 Recommendation. For example, a
- * parser would use this callback to report the violation of a
- * well-formedness constraint.</p>
- *
- * <p>The application must assume that the document is unusable
- * after the parser has invoked this method, and should continue
- * (if at all) only for the sake of collecting addition error
- * messages: in fact, SAX parsers are free to stop reporting any
- * other events once this method has been invoked.</p>
- *
- * @param exception The error information encapsulated in a
- * SAX parse exception.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception; only if setThrowOnFatalError is true.
- * @see org.xml.sax.SAXParseException
- */
- public void fatalError (SAXParseException exception)
- throws SAXException
- {
- logExceptionLocation(m_pw, exception);
- m_pw.println("fatalError: " + exception.getMessage());
- m_pw.flush();
-
- if (getThrowOnFatalError())
- throw exception;
- }
-
-
- /* ======== Implement javax.xml.transform.ErrorListener ======== */
-
- /**
- * Receive notification of a warning.
- *
- * <p>{@link javax.xml.transform.Transformer} can use this method to report
- * conditions that are not errors or fatal errors. The default behaviour
- * is to take no action.</p>
- *
- * <p>After invoking this method, the Transformer must continue with
- * the transformation. It should still be possible for the
- * application to process the document through to the end.</p>
- *
- * @param exception The warning information encapsulated in a
- * transformer exception.
- *
- * @throws javax.xml.transform.TransformerException only if
- * setThrowOnWarning is true.
- *
- * @see javax.xml.transform.TransformerException
- */
- public void warning(TransformerException exception)
- throws TransformerException
- {
- logExceptionLocation(m_pw, exception);
- m_pw.println("warning: " + exception.getMessage());
- m_pw.flush();
-
- if (getThrowOnWarning())
- throw exception;
- }
-
- /**
- * Receive notification of a recoverable error.
- *
- * <p>The transformer must continue to try and provide normal transformation
- * after invoking this method. It should still be possible for the
- * application to process the document through to the end if no other errors
- * are encountered.</p>
- *
- * @param exception The error information encapsulated in a
- * transformer exception.
- *
- * @throws javax.xml.transform.TransformerException only if
- * setThrowOnError is true.
- *
- * @see javax.xml.transform.TransformerException
- */
- public void error(TransformerException exception)
- throws TransformerException
- {
- logExceptionLocation(m_pw, exception);
- m_pw.println("error: " + exception.getMessage());
- m_pw.flush();
-
- if (getThrowOnError())
- throw exception;
- }
-
- /**
- * Receive notification of a non-recoverable error.
- *
- * <p>The transformer must continue to try and provide normal transformation
- * after invoking this method. It should still be possible for the
- * application to process the document through to the end if no other errors
- * are encountered, but there is no guarantee that the output will be
- * useable.</p>
- *
- * @param exception The error information encapsulated in a
- * transformer exception.
- *
- * @throws javax.xml.transform.TransformerException only if
- * setThrowOnError is true.
- *
- * @see javax.xml.transform.TransformerException
- */
- public void fatalError(TransformerException exception)
- throws TransformerException
- {
- logExceptionLocation(m_pw, exception);
- m_pw.println("error: " + exception.getMessage());
- m_pw.flush();
-
- if (getThrowOnError())
- throw exception;
- }
-
-
-
- /* ======== Implement worker methods ======== */
-
-
- /**
- * Print out location information about the exception.
- *
- * Cribbed from DefaultErrorHandler.printLocation()
- * @param pw PrintWriter to send output to
- * @param exception TransformerException or SAXParseException
- * to log information about
- */
- public static void logExceptionLocation(PrintWriter pw, Throwable exception)
- {
- if (null == pw)
- pw = new PrintWriter(System.err, true);
-
- SourceLocator locator = null;
- Throwable cause = exception;
-
- // Try to find the locator closest to the cause.
- do
- {
- // Find the current locator, if one present
- if(cause instanceof SAXParseException)
- {
- // A SAXSourceLocator is a Xalan helper class
- // that implements both a SourceLocator and a SAX Locator
- //@todo check that the new locator actually has
- // as much or more information as the
- // current one already does
- locator = new SAXSourceLocator((SAXParseException)cause);
- }
- else if (cause instanceof TransformerException)
- {
- SourceLocator causeLocator = ((TransformerException)cause).getLocator();
- if(null != causeLocator)
- {
- locator = causeLocator;
- }
- }
-
- // Then walk back down the chain of exceptions
- if(cause instanceof TransformerException)
- cause = ((TransformerException)cause).getCause();
- else if(cause instanceof WrappedRuntimeException)
- cause = ((WrappedRuntimeException)cause).getException();
- else if(cause instanceof SAXException)
- cause = ((SAXException)cause).getException();
- else
- cause = null;
- }
- while(null != cause);
-
- // Formatting note: mimic javac-like errors:
- // path\filename:123: message-here
- // systemId:L=1;C=2: message-here
- if(null != locator)
- {
- String id = (locator.getPublicId() != locator.getPublicId())
- ? locator.getPublicId()
- : (null != locator.getSystemId())
- ? locator.getSystemId() : "SystemId-Unknown";
-
- pw.print(id + ":Line=" + locator.getLineNumber()
- + ";Column=" + locator.getColumnNumber()+": ");
- pw.println("exception:" + exception.getMessage());
- pw.println("root-cause:"
- + ((null != cause) ? cause.getMessage() : "null"));
- logSourceLine(pw, locator);
- }
- else
- {
- pw.print("SystemId-Unknown:locator-unavailable: ");
- pw.println("exception:" + exception.getMessage());
- pw.println("root-cause:"
- + ((null != cause) ? cause.getMessage() : "null"));
- }
- }
-
-
- /**
- * Print out the specific source line that caused the exception,
- * if possible to load it.
- *
- * @param pw PrintWriter to send output to
- * @param locator Xalan wrapper for either a JAXP or a SAX
- * source location object
- */
- public static void logSourceLine(PrintWriter pw, SourceLocator locator)
- {
- if (null == locator)
- return;
-
- if (null == pw)
- pw = new PrintWriter(System.err, true);
-
- String url = locator.getSystemId();
- // Bail immediately if we get SystemId-Unknown
- //@todo future improvement: attempt to get resource
- // from a publicId if possible
- if (null == url)
- {
- pw.println("line: (No systemId; cannot read file)");
- pw.println();
- return;
- }
-
- //@todo attempt to get DOM backpointer or other ids
-
- try
- {
- int line = locator.getLineNumber();
- int column = locator.getColumnNumber();
- pw.println("line: " + getSourceLine(url, line));
- StringBuffer buf = new StringBuffer("line: ");
- for (int i = 1; i < column; i++)
- {
- buf.append(' ');
- }
- buf.append('^');
- pw.println(buf.toString());
- }
- catch (Exception e)
- {
- pw.println("line: logSourceLine unavailable due to: " + e.getMessage());
- pw.println();
- }
- }
-
-
- /**
- * Return the specific source line that caused the exception,
- * if possible to load it; allow exceptions to be thrown.
- *
- * @author shane_curcuru@us.ibm.com
- */
- protected static String getSourceLine(String sourceUrl, int lineNum)
- throws Exception
- {
- URL url = null;
- // Get a URL from the sourceUrl
- try
- {
- // Try to get a URL from it as-is
- url = new URL(sourceUrl);
- }
- catch (java.net.MalformedURLException mue)
- {
- int indexOfColon = sourceUrl.indexOf(':');
- int indexOfSlash = sourceUrl.indexOf('/');
-
- if ((indexOfColon != -1)
- && (indexOfSlash != -1)
- && (indexOfColon < indexOfSlash))
- {
- // The url is already absolute, but we could not get
- // the system to form it, so bail
- throw mue;
- }
- else
- {
- // The url is relative, so attempt to get absolute
- url = new URL(SystemIDResolver.getAbsoluteURI(sourceUrl));
- // If this fails, allow the exception to propagate
- }
- }
-
- String line = null;
- InputStream is = null;
- BufferedReader br = null;
- try
- {
- // Open the URL and read to our specified line
- URLConnection uc = url.openConnection();
- is = uc.getInputStream();
- br = new BufferedReader(new InputStreamReader(is));
-
- // Not the most efficient way, but it works
- // (Feel free to patch to seek to the appropriate line)
- for (int i = 1; i <= lineNum; i++)
- {
- line = br.readLine();
- }
-
- }
- // Allow exceptions to propagate from here, but ensure
- // streams are closed!
- finally
- {
- br.close();
- is.close();
- }
-
- // Return whatever we found
- return line;
- }
-
-
- /* ======== Implement settable properties ======== */
-
- /**
- * User-settable behavior: when to re-throw exceptions.
- *
- * <p>This allows per-instance configuration of
- * ListingErrorHandlers. You can ask us to either throw
- * an exception when we're called for various warning /
- * error / fatalErrors, or simply log them and continue.</p>
- *
- * @param b if we should throw an exception on warnings
- */
- public void setThrowOnWarning(boolean b)
- {
- throwOnWarning = b;
- }
-
- /**
- * User-settable behavior: when to re-throw exceptions.
- *
- * @return if we throw an exception on warnings
- */
- public boolean getThrowOnWarning()
- {
- return throwOnWarning;
- }
-
- /** If we should throw exception on warnings; default:false. */
- protected boolean throwOnWarning = false;
-
-
- /**
- * User-settable behavior: when to re-throw exceptions.
- *
- * <p>This allows per-instance configuration of
- * ListingErrorHandlers. You can ask us to either throw
- * an exception when we're called for various warning /
- * error / fatalErrors, or simply log them and continue.</p>
- *
- * <p>Note that the behavior of many parsers/transformers
- * after an error is not necessarily defined!</p>
- *
- * @param b if we should throw an exception on errors
- */
- public void setThrowOnError(boolean b)
- {
- throwOnError = b;
- }
-
- /**
- * User-settable behavior: when to re-throw exceptions.
- *
- * @return if we throw an exception on errors
- */
- public boolean getThrowOnError()
- {
- return throwOnError;
- }
-
- /** If we should throw exception on errors; default:true. */
- protected boolean throwOnError = true;
-
-
- /**
- * User-settable behavior: when to re-throw exceptions.
- *
- * <p>This allows per-instance configuration of
- * ListingErrorHandlers. You can ask us to either throw
- * an exception when we're called for various warning /
- * error / fatalErrors, or simply log them and continue.</p>
- *
- * <p>Note that the behavior of many parsers/transformers
- * after a fatalError is not necessarily defined, most
- * products will probably barf if you continue.</p>
- *
- * @param b if we should throw an exception on fatalErrors
- */
- public void setThrowOnFatalError(boolean b)
- {
- throwOnFatalError = b;
- }
-
- /**
- * User-settable behavior: when to re-throw exceptions.
- *
- * @return if we throw an exception on fatalErrors
- */
- public boolean getThrowOnFatalError()
- {
- return throwOnFatalError;
- }
-
- /** If we should throw exception on fatalErrors; default:true. */
- protected boolean throwOnFatalError = true;
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/LocaleUtility.java b/src/com/sun/org/apache/xml/internal/utils/LocaleUtility.java
deleted file mode 100644
index 0a5c359..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/LocaleUtility.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-
-
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: LocaleUtility.java,v 1.2.4.1 2005/09/15 08:15:47 suresh_emailid Exp $
- */
-
-package com.sun.org.apache.xml.internal.utils;
-
-import java.util.Locale;
-
-/**
- * @author Igor Hersht, igorh@ca.ibm.com
- */
-public class LocaleUtility {
- /**
- * IETF RFC 1766 tag separator
- */
- public final static char IETF_SEPARATOR = '-';
- public final static String EMPTY_STRING = "";
-
-
- public static Locale langToLocale(String lang) {
- if((lang == null) || lang.equals(EMPTY_STRING)){ // not specified => getDefault
- return Locale.getDefault();
- }
- String language = EMPTY_STRING;
- String country = EMPTY_STRING;
- String variant = EMPTY_STRING;
-
- int i1 = lang.indexOf(IETF_SEPARATOR);
- if (i1 < 0) {
- language = lang;
- } else {
- language = lang.substring(0, i1);
- ++i1;
- int i2 = lang.indexOf(IETF_SEPARATOR, i1);
- if (i2 < 0) {
- country = lang.substring(i1);
- } else {
- country = lang.substring(i1, i2);
- variant = lang.substring(i2+1);
- }
- }
-
- if(language.length() == 2){
- language = language.toLowerCase();
- }else {
- language = EMPTY_STRING;
- }
-
- if(country.length() == 2){
- country = country.toUpperCase();
- }else {
- country = EMPTY_STRING;
- }
-
- if((variant.length() > 0) &&
- ((language.length() == 2) ||(country.length() == 2))){
- variant = variant.toUpperCase();
- }else{
- variant = EMPTY_STRING;
- }
-
- return new Locale(language, country, variant );
- }
-
-
-
- }
diff --git a/src/com/sun/org/apache/xml/internal/utils/MutableAttrListImpl.java b/src/com/sun/org/apache/xml/internal/utils/MutableAttrListImpl.java
deleted file mode 100644
index e44d8b0..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/MutableAttrListImpl.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: MutableAttrListImpl.java,v 1.2.4.1 2005/09/15 08:15:47 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-import java.io.Serializable;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.helpers.AttributesImpl;
-
-/**
- * Mutable version of AttributesImpl.
- * @xsl.usage advanced
- */
-public class MutableAttrListImpl extends AttributesImpl
- implements Serializable
-{
- static final long serialVersionUID = 6289452013442934470L;
-
-/**
- * Construct a new, empty AttributesImpl object.
- */
-
-public MutableAttrListImpl()
- {
- super();
- }
-
- /**
- * Copy an existing Attributes object.
- *
- * <p>This constructor is especially useful inside a start
- * element event.</p>
- *
- * @param atts The existing Attributes object.
- */
- public MutableAttrListImpl(Attributes atts)
- {
- super(atts);
- }
-
- /**
- * Add an attribute to the end of the list.
- *
- * <p>For the sake of speed, this method does no checking
- * to see if the attribute is already in the list: that is
- * the responsibility of the application.</p>
- *
- * @param uri The Namespace URI, or the empty string if
- * none is available or Namespace processing is not
- * being performed.
- * @param localName The local name, or the empty string if
- * Namespace processing is not being performed.
- * @param qName The qualified (prefixed) name, or the empty string
- * if qualified names are not available.
- * @param type The attribute type as a string.
- * @param value The attribute value.
- */
- public void addAttribute(String uri, String localName, String qName,
- String type, String value)
- {
-
- if (null == uri)
- uri = "";
-
- // getIndex(qName) seems to be more reliable than getIndex(uri, localName),
- // in the case of the xmlns attribute anyway.
- int index = this.getIndex(qName);
- // int index = this.getIndex(uri, localName);
-
- // System.out.println("MutableAttrListImpl#addAttribute: "+uri+":"+localName+", "+index+", "+qName+", "+this);
-
- if (index >= 0)
- this.setAttribute(index, uri, localName, qName, type, value);
- else
- super.addAttribute(uri, localName, qName, type, value);
- }
-
- /**
- * Add the contents of the attribute list to this list.
- *
- * @param atts List of attributes to add to this list
- */
- public void addAttributes(Attributes atts)
- {
-
- int nAtts = atts.getLength();
-
- for (int i = 0; i < nAtts; i++)
- {
- String uri = atts.getURI(i);
-
- if (null == uri)
- uri = "";
-
- String localName = atts.getLocalName(i);
- String qname = atts.getQName(i);
- int index = this.getIndex(uri, localName);
- // System.out.println("MutableAttrListImpl#addAttributes: "+uri+":"+localName+", "+index+", "+atts.getQName(i)+", "+this);
- if (index >= 0)
- this.setAttribute(index, uri, localName, qname, atts.getType(i),
- atts.getValue(i));
- else
- addAttribute(uri, localName, qname, atts.getType(i),
- atts.getValue(i));
- }
- }
-
- /**
- * Return true if list contains the given (raw) attribute name.
- *
- * @param name Raw name of attribute to look for
- *
- * @return true if an attribute is found with this name
- */
- public boolean contains(String name)
- {
- return getValue(name) != null;
- }
-}
-
-// end of MutableAttrListImpl.java
diff --git a/src/com/sun/org/apache/xml/internal/utils/NSInfo.java b/src/com/sun/org/apache/xml/internal/utils/NSInfo.java
deleted file mode 100644
index 73886ea..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/NSInfo.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: NSInfo.java,v 1.2.4.1 2005/09/15 08:15:48 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-/**
- * This class holds information about the namespace info
- * of a node. It is used to optimize namespace lookup in
- * a generic DOM.
- * @xsl.usage internal
- */
-public class NSInfo
-{
-
- /**
- * Constructor NSInfo
- *
- *
- * @param hasProcessedNS Flag indicating whether namespaces
- * have been processed for this node
- * @param hasXMLNSAttrs Flag indicating whether this node
- * has XMLNS attributes.
- */
- public NSInfo(boolean hasProcessedNS, boolean hasXMLNSAttrs)
- {
-
- m_hasProcessedNS = hasProcessedNS;
- m_hasXMLNSAttrs = hasXMLNSAttrs;
- m_namespace = null;
- m_ancestorHasXMLNSAttrs = ANCESTORXMLNSUNPROCESSED;
- }
-
- // Unused at the moment
-
- /**
- * Constructor NSInfo
- *
- *
- * @param hasProcessedNS Flag indicating whether namespaces
- * have been processed for this node
- * @param hasXMLNSAttrs Flag indicating whether this node
- * has XMLNS attributes.
- * @param ancestorHasXMLNSAttrs Flag indicating whether one of this node's
- * ancestor has XMLNS attributes.
- */
- public NSInfo(boolean hasProcessedNS, boolean hasXMLNSAttrs,
- int ancestorHasXMLNSAttrs)
- {
-
- m_hasProcessedNS = hasProcessedNS;
- m_hasXMLNSAttrs = hasXMLNSAttrs;
- m_ancestorHasXMLNSAttrs = ancestorHasXMLNSAttrs;
- m_namespace = null;
- }
-
- /**
- * Constructor NSInfo
- *
- *
- * @param namespace The namespace URI
- * @param hasXMLNSAttrs Flag indicating whether this node
- * has XMLNS attributes.
- */
- public NSInfo(String namespace, boolean hasXMLNSAttrs)
- {
-
- m_hasProcessedNS = true;
- m_hasXMLNSAttrs = hasXMLNSAttrs;
- m_namespace = namespace;
- m_ancestorHasXMLNSAttrs = ANCESTORXMLNSUNPROCESSED;
- }
-
- /** The namespace URI */
- public String m_namespace;
-
- /** Flag indicating whether this node has an XMLNS attribute */
- public boolean m_hasXMLNSAttrs;
-
- /** Flag indicating whether namespaces have been processed for this node */
- public boolean m_hasProcessedNS;
-
- /** Flag indicating whether one of this node's ancestor has an XMLNS attribute */
- public int m_ancestorHasXMLNSAttrs;
-
- /** Constant for ancestors XMLNS atributes not processed */
- public static final int ANCESTORXMLNSUNPROCESSED = 0;
-
- /** Constant indicating an ancestor has an XMLNS attribute */
- public static final int ANCESTORHASXMLNS = 1;
-
- /** Constant indicating ancestors don't have an XMLNS attribute */
- public static final int ANCESTORNOXMLNS = 2;
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/NameSpace.java b/src/com/sun/org/apache/xml/internal/utils/NameSpace.java
deleted file mode 100644
index b262e43..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/NameSpace.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: NameSpace.java,v 1.2.4.1 2005/09/15 08:15:49 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-import java.io.Serializable;
-
-/**
- * A representation of a namespace. One of these will
- * be pushed on the namespace stack for each
- * element.
- * @xsl.usage advanced
- */
-public class NameSpace implements Serializable
-{
- static final long serialVersionUID = 1471232939184881839L;
-
- /** Next NameSpace element on the stack.
- * @serial */
- public NameSpace m_next = null;
-
- /** Prefix of this NameSpace element.
- * @serial */
- public String m_prefix;
-
- /** Namespace URI of this NameSpace element.
- * @serial */
- public String m_uri; // if null, then Element namespace is empty.
-
- /**
- * Construct a namespace for placement on the
- * result tree namespace stack.
- *
- * @param prefix Prefix of this element
- * @param uri URI of this element
- */
- public NameSpace(String prefix, String uri)
- {
- m_prefix = prefix;
- m_uri = uri;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/NodeConsumer.java b/src/com/sun/org/apache/xml/internal/utils/NodeConsumer.java
deleted file mode 100644
index f0b36bc..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/NodeConsumer.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: NodeConsumer.java,v 1.2.4.1 2005/09/15 08:15:50 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-import org.w3c.dom.Node;
-
-/**
- * The tree walker will test for this interface, and call
- * setOriginatingNode before calling the SAX event. For creating
- * DOM backpointers for things that are normally created via
- * SAX events.
- */
-public interface NodeConsumer
-{
-
- /**
- * Set the node that is originating the SAX event.
- *
- * @param n Reference to node that originated the current event.
- */
- public void setOriginatingNode(Node n);
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/NodeVector.java b/src/com/sun/org/apache/xml/internal/utils/NodeVector.java
deleted file mode 100644
index 8bba6d5..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/NodeVector.java
+++ /dev/null
@@ -1,741 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: NodeVector.java,v 1.2.4.1 2005/09/15 08:15:50 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-import java.io.Serializable;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-
-/**
- * A very simple table that stores a list of Nodes.
- * @xsl.usage internal
- */
-public class NodeVector implements Serializable, Cloneable
-{
- static final long serialVersionUID = -713473092200731870L;
-
- /**
- * Size of blocks to allocate.
- * @serial
- */
- private int m_blocksize;
-
- /**
- * Array of nodes this points to.
- * @serial
- */
- private int m_map[];
-
- /**
- * Number of nodes in this NodeVector.
- * @serial
- */
- protected int m_firstFree = 0;
-
- /**
- * Size of the array this points to.
- * @serial
- */
- private int m_mapSize; // lazy initialization
-
- /**
- * Default constructor.
- */
- public NodeVector()
- {
- m_blocksize = 32;
- m_mapSize = 0;
- }
-
- /**
- * Construct a NodeVector, using the given block size.
- *
- * @param blocksize Size of blocks to allocate
- */
- public NodeVector(int blocksize)
- {
- m_blocksize = blocksize;
- m_mapSize = 0;
- }
-
- /**
- * Get a cloned LocPathIterator.
- *
- * @return A clone of this
- *
- * @throws CloneNotSupportedException
- */
- public Object clone() throws CloneNotSupportedException
- {
-
- NodeVector clone = (NodeVector) super.clone();
-
- if ((null != this.m_map) && (this.m_map == clone.m_map))
- {
- clone.m_map = new int[this.m_map.length];
-
- System.arraycopy(this.m_map, 0, clone.m_map, 0, this.m_map.length);
- }
-
- return clone;
- }
-
- /**
- * Get the length of the list.
- *
- * @return Number of nodes in this NodeVector
- */
- public int size()
- {
- return m_firstFree;
- }
-
- /**
- * Append a Node onto the vector.
- *
- * @param value Node to add to the vector
- */
- public void addElement(int value)
- {
-
- if ((m_firstFree + 1) >= m_mapSize)
- {
- if (null == m_map)
- {
- m_map = new int[m_blocksize];
- m_mapSize = m_blocksize;
- }
- else
- {
- m_mapSize += m_blocksize;
-
- int newMap[] = new int[m_mapSize];
-
- System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);
-
- m_map = newMap;
- }
- }
-
- m_map[m_firstFree] = value;
-
- m_firstFree++;
- }
-
- /**
- * Append a Node onto the vector.
- *
- * @param value Node to add to the vector
- */
- public final void push(int value)
- {
-
- int ff = m_firstFree;
-
- if ((ff + 1) >= m_mapSize)
- {
- if (null == m_map)
- {
- m_map = new int[m_blocksize];
- m_mapSize = m_blocksize;
- }
- else
- {
- m_mapSize += m_blocksize;
-
- int newMap[] = new int[m_mapSize];
-
- System.arraycopy(m_map, 0, newMap, 0, ff + 1);
-
- m_map = newMap;
- }
- }
-
- m_map[ff] = value;
-
- ff++;
-
- m_firstFree = ff;
- }
-
- /**
- * Pop a node from the tail of the vector and return the result.
- *
- * @return the node at the tail of the vector
- */
- public final int pop()
- {
-
- m_firstFree--;
-
- int n = m_map[m_firstFree];
-
- m_map[m_firstFree] = DTM.NULL;
-
- return n;
- }
-
- /**
- * Pop a node from the tail of the vector and return the
- * top of the stack after the pop.
- *
- * @return The top of the stack after it's been popped
- */
- public final int popAndTop()
- {
-
- m_firstFree--;
-
- m_map[m_firstFree] = DTM.NULL;
-
- return (m_firstFree == 0) ? DTM.NULL : m_map[m_firstFree - 1];
- }
-
- /**
- * Pop a node from the tail of the vector.
- */
- public final void popQuick()
- {
-
- m_firstFree--;
-
- m_map[m_firstFree] = DTM.NULL;
- }
-
- /**
- * Return the node at the top of the stack without popping the stack.
- * Special purpose method for TransformerImpl, pushElemTemplateElement.
- * Performance critical.
- *
- * @return Node at the top of the stack or null if stack is empty.
- */
- public final int peepOrNull()
- {
- return ((null != m_map) && (m_firstFree > 0))
- ? m_map[m_firstFree - 1] : DTM.NULL;
- }
-
- /**
- * Push a pair of nodes into the stack.
- * Special purpose method for TransformerImpl, pushElemTemplateElement.
- * Performance critical.
- *
- * @param v1 First node to add to vector
- * @param v2 Second node to add to vector
- */
- public final void pushPair(int v1, int v2)
- {
-
- if (null == m_map)
- {
- m_map = new int[m_blocksize];
- m_mapSize = m_blocksize;
- }
- else
- {
- if ((m_firstFree + 2) >= m_mapSize)
- {
- m_mapSize += m_blocksize;
-
- int newMap[] = new int[m_mapSize];
-
- System.arraycopy(m_map, 0, newMap, 0, m_firstFree);
-
- m_map = newMap;
- }
- }
-
- m_map[m_firstFree] = v1;
- m_map[m_firstFree + 1] = v2;
- m_firstFree += 2;
- }
-
- /**
- * Pop a pair of nodes from the tail of the stack.
- * Special purpose method for TransformerImpl, pushElemTemplateElement.
- * Performance critical.
- */
- public final void popPair()
- {
-
- m_firstFree -= 2;
- m_map[m_firstFree] = DTM.NULL;
- m_map[m_firstFree + 1] = DTM.NULL;
- }
-
- /**
- * Set the tail of the stack to the given node.
- * Special purpose method for TransformerImpl, pushElemTemplateElement.
- * Performance critical.
- *
- * @param n Node to set at the tail of vector
- */
- public final void setTail(int n)
- {
- m_map[m_firstFree - 1] = n;
- }
-
- /**
- * Set the given node one position from the tail.
- * Special purpose method for TransformerImpl, pushElemTemplateElement.
- * Performance critical.
- *
- * @param n Node to set
- */
- public final void setTailSub1(int n)
- {
- m_map[m_firstFree - 2] = n;
- }
-
- /**
- * Return the node at the tail of the vector without popping
- * Special purpose method for TransformerImpl, pushElemTemplateElement.
- * Performance critical.
- *
- * @return Node at the tail of the vector
- */
- public final int peepTail()
- {
- return m_map[m_firstFree - 1];
- }
-
- /**
- * Return the node one position from the tail without popping.
- * Special purpose method for TransformerImpl, pushElemTemplateElement.
- * Performance critical.
- *
- * @return Node one away from the tail
- */
- public final int peepTailSub1()
- {
- return m_map[m_firstFree - 2];
- }
-
- /**
- * Insert a node in order in the list.
- *
- * @param value Node to insert
- */
- public void insertInOrder(int value)
- {
-
- for (int i = 0; i < m_firstFree; i++)
- {
- if (value < m_map[i])
- {
- insertElementAt(value, i);
-
- return;
- }
- }
-
- addElement(value);
- }
-
- /**
- * Inserts the specified node in this vector at the specified index.
- * Each component in this vector with an index greater or equal to
- * the specified index is shifted upward to have an index one greater
- * than the value it had previously.
- *
- * @param value Node to insert
- * @param at Position where to insert
- */
- public void insertElementAt(int value, int at)
- {
-
- if (null == m_map)
- {
- m_map = new int[m_blocksize];
- m_mapSize = m_blocksize;
- }
- else if ((m_firstFree + 1) >= m_mapSize)
- {
- m_mapSize += m_blocksize;
-
- int newMap[] = new int[m_mapSize];
-
- System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);
-
- m_map = newMap;
- }
-
- if (at <= (m_firstFree - 1))
- {
- System.arraycopy(m_map, at, m_map, at + 1, m_firstFree - at);
- }
-
- m_map[at] = value;
-
- m_firstFree++;
- }
-
- /**
- * Append the nodes to the list.
- *
- * @param nodes NodeVector to append to this list
- */
- public void appendNodes(NodeVector nodes)
- {
-
- int nNodes = nodes.size();
-
- if (null == m_map)
- {
- m_mapSize = nNodes + m_blocksize;
- m_map = new int[m_mapSize];
- }
- else if ((m_firstFree + nNodes) >= m_mapSize)
- {
- m_mapSize += (nNodes + m_blocksize);
-
- int newMap[] = new int[m_mapSize];
-
- System.arraycopy(m_map, 0, newMap, 0, m_firstFree + nNodes);
-
- m_map = newMap;
- }
-
- System.arraycopy(nodes.m_map, 0, m_map, m_firstFree, nNodes);
-
- m_firstFree += nNodes;
- }
-
- /**
- * Inserts the specified node in this vector at the specified index.
- * Each component in this vector with an index greater or equal to
- * the specified index is shifted upward to have an index one greater
- * than the value it had previously.
- */
- public void removeAllElements()
- {
-
- if (null == m_map)
- return;
-
- for (int i = 0; i < m_firstFree; i++)
- {
- m_map[i] = DTM.NULL;
- }
-
- m_firstFree = 0;
- }
-
- /**
- * Set the length to zero, but don't clear the array.
- */
- public void RemoveAllNoClear()
- {
-
- if (null == m_map)
- return;
-
- m_firstFree = 0;
- }
-
- /**
- * Removes the first occurrence of the argument from this vector.
- * If the object is found in this vector, each component in the vector
- * with an index greater or equal to the object's index is shifted
- * downward to have an index one smaller than the value it had
- * previously.
- *
- * @param s Node to remove from the list
- *
- * @return True if the node was successfully removed
- */
- public boolean removeElement(int s)
- {
-
- if (null == m_map)
- return false;
-
- for (int i = 0; i < m_firstFree; i++)
- {
- int node = m_map[i];
-
- if (node == s)
- {
- if (i > m_firstFree)
- System.arraycopy(m_map, i + 1, m_map, i - 1, m_firstFree - i);
- else
- m_map[i] = DTM.NULL;
-
- m_firstFree--;
-
- return true;
- }
- }
-
- return false;
- }
-
- /**
- * Deletes the component at the specified index. Each component in
- * this vector with an index greater or equal to the specified
- * index is shifted downward to have an index one smaller than
- * the value it had previously.
- *
- * @param i Index of node to remove
- */
- public void removeElementAt(int i)
- {
-
- if (null == m_map)
- return;
-
- if (i > m_firstFree)
- System.arraycopy(m_map, i + 1, m_map, i - 1, m_firstFree - i);
- else
- m_map[i] = DTM.NULL;
- }
-
- /**
- * Sets the component at the specified index of this vector to be the
- * specified object. The previous component at that position is discarded.
- *
- * The index must be a value greater than or equal to 0 and less
- * than the current size of the vector.
- *
- * @param node Node to set
- * @param index Index of where to set the node
- */
- public void setElementAt(int node, int index)
- {
-
- if (null == m_map)
- {
- m_map = new int[m_blocksize];
- m_mapSize = m_blocksize;
- }
-
- if(index == -1)
- addElement(node);
-
- m_map[index] = node;
- }
-
- /**
- * Get the nth element.
- *
- * @param i Index of node to get
- *
- * @return Node at specified index
- */
- public int elementAt(int i)
- {
-
- if (null == m_map)
- return DTM.NULL;
-
- return m_map[i];
- }
-
- /**
- * Tell if the table contains the given node.
- *
- * @param s Node to look for
- *
- * @return True if the given node was found.
- */
- public boolean contains(int s)
- {
-
- if (null == m_map)
- return false;
-
- for (int i = 0; i < m_firstFree; i++)
- {
- int node = m_map[i];
-
- if (node == s)
- return true;
- }
-
- return false;
- }
-
- /**
- * Searches for the first occurence of the given argument,
- * beginning the search at index, and testing for equality
- * using the equals method.
- *
- * @param elem Node to look for
- * @param index Index of where to start the search
- * @return the index of the first occurrence of the object
- * argument in this vector at position index or later in the
- * vector; returns -1 if the object is not found.
- */
- public int indexOf(int elem, int index)
- {
-
- if (null == m_map)
- return -1;
-
- for (int i = index; i < m_firstFree; i++)
- {
- int node = m_map[i];
-
- if (node == elem)
- return i;
- }
-
- return -1;
- }
-
- /**
- * Searches for the first occurence of the given argument,
- * beginning the search at index, and testing for equality
- * using the equals method.
- *
- * @param elem Node to look for
- * @return the index of the first occurrence of the object
- * argument in this vector at position index or later in the
- * vector; returns -1 if the object is not found.
- */
- public int indexOf(int elem)
- {
-
- if (null == m_map)
- return -1;
-
- for (int i = 0; i < m_firstFree; i++)
- {
- int node = m_map[i];
-
- if (node == elem)
- return i;
- }
-
- return -1;
- }
-
- /**
- * Sort an array using a quicksort algorithm.
- *
- * @param a The array to be sorted.
- * @param lo0 The low index.
- * @param hi0 The high index.
- *
- * @throws Exception
- */
- public void sort(int a[], int lo0, int hi0) throws Exception
- {
-
- int lo = lo0;
- int hi = hi0;
-
- // pause(lo, hi);
- if (lo >= hi)
- {
- return;
- }
- else if (lo == hi - 1)
- {
-
- /*
- * sort a two element list by swapping if necessary
- */
- if (a[lo] > a[hi])
- {
- int T = a[lo];
-
- a[lo] = a[hi];
- a[hi] = T;
- }
-
- return;
- }
-
- /*
- * Pick a pivot and move it out of the way
- */
- int pivot = a[(lo + hi) / 2];
-
- a[(lo + hi) / 2] = a[hi];
- a[hi] = pivot;
-
- while (lo < hi)
- {
-
- /*
- * Search forward from a[lo] until an element is found that
- * is greater than the pivot or lo >= hi
- */
- while (a[lo] <= pivot && lo < hi)
- {
- lo++;
- }
-
- /*
- * Search backward from a[hi] until element is found that
- * is less than the pivot, or lo >= hi
- */
- while (pivot <= a[hi] && lo < hi)
- {
- hi--;
- }
-
- /*
- * Swap elements a[lo] and a[hi]
- */
- if (lo < hi)
- {
- int T = a[lo];
-
- a[lo] = a[hi];
- a[hi] = T;
-
- // pause();
- }
-
- // if (stopRequested) {
- // return;
- // }
- }
-
- /*
- * Put the median in the "center" of the list
- */
- a[hi0] = a[hi];
- a[hi] = pivot;
-
- /*
- * Recursive calls, elements a[lo0] to a[lo-1] are less than or
- * equal to pivot, elements a[hi+1] to a[hi0] are greater than
- * pivot.
- */
- sort(a, lo0, lo - 1);
- sort(a, hi + 1, hi0);
- }
-
- /**
- * Sort an array using a quicksort algorithm.
- *
- * @throws Exception
- */
- public void sort() throws Exception
- {
- sort(m_map, 0, m_firstFree - 1);
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/ObjectPool.java b/src/com/sun/org/apache/xml/internal/utils/ObjectPool.java
deleted file mode 100644
index fb75bc4..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/ObjectPool.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ObjectPool.java,v 1.2.4.1 2005/09/15 08:15:50 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-import java.util.ArrayList;
-
-import com.sun.org.apache.xml.internal.res.XMLErrorResources;
-import com.sun.org.apache.xml.internal.res.XMLMessages;
-import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
-
-
-/**
- * Pool of object of a given type to pick from to help memory usage
- * @xsl.usage internal
- */
-public class ObjectPool implements java.io.Serializable
-{
- static final long serialVersionUID = -8519013691660936643L;
-
- /** Type of objects in this pool.
- * @serial */
- private final Class objectType;
-
- /** Stack of given objects this points to.
- * @serial */
- private final ArrayList freeStack;
-
- /**
- * Constructor ObjectPool
- *
- * @param type Type of objects for this pool
- */
- public ObjectPool(Class type)
- {
- objectType = type;
- freeStack = new ArrayList();
- }
-
- /**
- * Constructor ObjectPool
- *
- * @param className Fully qualified name of the type of objects for this pool.
- */
- public ObjectPool(String className)
- {
- try
- {
- objectType = ObjectFactory.findProviderClass(className, true);
- }
- catch(ClassNotFoundException cnfe)
- {
- throw new WrappedRuntimeException(cnfe);
- }
- freeStack = new ArrayList();
- }
-
-
- /**
- * Constructor ObjectPool
- *
- *
- * @param type Type of objects for this pool
- * @param size Size of vector to allocate
- */
- public ObjectPool(Class type, int size)
- {
- objectType = type;
- freeStack = new ArrayList(size);
- }
-
- /**
- * Constructor ObjectPool
- *
- */
- public ObjectPool()
- {
- objectType = null;
- freeStack = new ArrayList();
- }
-
- /**
- * Get an instance of the given object in this pool if available
- *
- *
- * @return an instance of the given object if available or null
- */
- public synchronized Object getInstanceIfFree()
- {
-
- // Check if the pool is empty.
- if (!freeStack.isEmpty())
- {
-
- // Remove object from end of free pool.
- Object result = freeStack.remove(freeStack.size() - 1);
- return result;
- }
-
- return null;
- }
-
- /**
- * Get an instance of the given object in this pool
- *
- *
- * @return An instance of the given object
- */
- public synchronized Object getInstance()
- {
-
- // Check if the pool is empty.
- if (freeStack.isEmpty())
- {
-
- // Create a new object if so.
- try
- {
- return objectType.newInstance();
- }
- catch (InstantiationException ex){}
- catch (IllegalAccessException ex){}
-
- // Throw unchecked exception for error in pool configuration.
- throw new RuntimeException(XMLMessages.createXMLMessage(XMLErrorResources.ER_EXCEPTION_CREATING_POOL, null)); //"exception creating new instance for pool");
- }
- else
- {
-
- // Remove object from end of free pool.
- Object result = freeStack.remove(freeStack.size() - 1);
- return result;
- }
- }
-
- /**
- * Add an instance of the given object to the pool
- *
- *
- * @param obj Object to add.
- */
- public synchronized void freeInstance(Object obj)
- {
-
- // Make sure the object is of the correct type.
- // Remove safety. -sb
- // if (objectType.isInstance(obj))
- // {
- freeStack.add(obj);
- // }
- // else
- // {
- // throw new IllegalArgumentException("argument type invalid for pool");
- // }
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/ObjectStack.java b/src/com/sun/org/apache/xml/internal/utils/ObjectStack.java
deleted file mode 100644
index f8051b8..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/ObjectStack.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ObjectStack.java,v 1.2.4.1 2005/09/15 08:15:51 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-import java.util.EmptyStackException;
-
-/**
- * Implement a stack of simple integers.
- *
- * %OPT%
- * This is currently based on ObjectVector, which permits fast acess but pays a
- * heavy recopying penalty if/when its size is increased. If we expect deep
- * stacks, we should consider a version based on ChunkedObjectVector.
- * @xsl.usage internal
- */
-public class ObjectStack extends ObjectVector
-{
-
- /**
- * Default constructor. Note that the default
- * block size is very small, for small lists.
- */
- public ObjectStack()
- {
- super();
- }
-
- /**
- * Construct a ObjectVector, using the given block size.
- *
- * @param blocksize Size of block to allocate
- */
- public ObjectStack(int blocksize)
- {
- super(blocksize);
- }
-
- /**
- * Copy constructor for ObjectStack
- *
- * @param v ObjectStack to copy
- */
- public ObjectStack (ObjectStack v)
- {
- super(v);
- }
-
- /**
- * Pushes an item onto the top of this stack.
- *
- * @param i the int to be pushed onto this stack.
- * @return the <code>item</code> argument.
- */
- public Object push(Object i)
- {
-
- if ((m_firstFree + 1) >= m_mapSize)
- {
- m_mapSize += m_blocksize;
-
- Object newMap[] = new Object[m_mapSize];
-
- System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);
-
- m_map = newMap;
- }
-
- m_map[m_firstFree] = i;
-
- m_firstFree++;
-
- return i;
- }
-
- /**
- * Removes the object at the top of this stack and returns that
- * object as the value of this function.
- *
- * @return The object at the top of this stack.
- */
- public Object pop()
- {
- Object val = m_map[--m_firstFree];
- m_map[m_firstFree] = null;
-
- return val;
- }
-
- /**
- * Quickly pops a number of items from the stack.
- */
-
- public void quickPop(int n)
- {
- m_firstFree -= n;
- }
-
- /**
- * Looks at the object at the top of this stack without removing it
- * from the stack.
- *
- * @return the object at the top of this stack.
- * @throws EmptyStackException if this stack is empty.
- */
- public Object peek()
- {
- try {
- return m_map[m_firstFree - 1];
- }
- catch (ArrayIndexOutOfBoundsException e)
- {
- throw new EmptyStackException();
- }
- }
-
- /**
- * Looks at the object at the position the stack counting down n items.
- *
- * @param n The number of items down, indexed from zero.
- * @return the object at n items down.
- * @throws EmptyStackException if this stack is empty.
- */
- public Object peek(int n)
- {
- try {
- return m_map[m_firstFree-(1+n)];
- }
- catch (ArrayIndexOutOfBoundsException e)
- {
- throw new EmptyStackException();
- }
- }
-
- /**
- * Sets an object at a the top of the statck
- *
- *
- * @param val object to set at the top
- * @throws EmptyStackException if this stack is empty.
- */
- public void setTop(Object val)
- {
- try {
- m_map[m_firstFree - 1] = val;
- }
- catch (ArrayIndexOutOfBoundsException e)
- {
- throw new EmptyStackException();
- }
- }
-
- /**
- * Tests if this stack is empty.
- *
- * @return <code>true</code> if this stack is empty;
- * <code>false</code> otherwise.
- * @since JDK1.0
- */
- public boolean empty()
- {
- return m_firstFree == 0;
- }
-
- /**
- * Returns where an object is on this stack.
- *
- * @param o the desired object.
- * @return the distance from the top of the stack where the object is]
- * located; the return value <code>-1</code> indicates that the
- * object is not on the stack.
- * @since JDK1.0
- */
- public int search(Object o)
- {
-
- int i = lastIndexOf(o);
-
- if (i >= 0)
- {
- return size() - i;
- }
-
- return -1;
- }
-
- /**
- * Returns clone of current ObjectStack
- *
- * @return clone of current ObjectStack
- */
- public Object clone()
- throws CloneNotSupportedException
- {
- return (ObjectStack) super.clone();
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/ObjectVector.java b/src/com/sun/org/apache/xml/internal/utils/ObjectVector.java
deleted file mode 100644
index 19c5af8..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/ObjectVector.java
+++ /dev/null
@@ -1,433 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2002-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ObjectVector.java,v 1.2.4.1 2005/09/15 08:15:51 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-/**
- * A very simple table that stores a list of objects.
- *
- * This version is based on a "realloc" strategy -- a simle array is
- * used, and when more storage is needed, a larger array is obtained
- * and all existing data is recopied into it. As a result, read/write
- * access to existing nodes is O(1) fast but appending may be O(N**2)
- * slow.
- * @xsl.usage internal
- */
-public class ObjectVector implements Cloneable
-{
-
- /** Size of blocks to allocate */
- protected int m_blocksize;
-
- /** Array of objects */
- protected Object m_map[];
-
- /** Number of ints in array */
- protected int m_firstFree = 0;
-
- /** Size of array */
- protected int m_mapSize;
-
- /**
- * Default constructor. Note that the default
- * block size is very small, for small lists.
- */
- public ObjectVector()
- {
-
- m_blocksize = 32;
- m_mapSize = m_blocksize;
- m_map = new Object[m_blocksize];
- }
-
- /**
- * Construct a IntVector, using the given block size.
- *
- * @param blocksize Size of block to allocate
- */
- public ObjectVector(int blocksize)
- {
-
- m_blocksize = blocksize;
- m_mapSize = blocksize;
- m_map = new Object[blocksize];
- }
-
- /**
- * Construct a IntVector, using the given block size.
- *
- * @param blocksize Size of block to allocate
- */
- public ObjectVector(int blocksize, int increaseSize)
- {
-
- m_blocksize = increaseSize;
- m_mapSize = blocksize;
- m_map = new Object[blocksize];
- }
-
- /**
- * Copy constructor for ObjectVector
- *
- * @param v Existing ObjectVector to copy
- */
- public ObjectVector(ObjectVector v)
- {
- m_map = new Object[v.m_mapSize];
- m_mapSize = v.m_mapSize;
- m_firstFree = v.m_firstFree;
- m_blocksize = v.m_blocksize;
- System.arraycopy(v.m_map, 0, m_map, 0, m_firstFree);
- }
-
- /**
- * Get the length of the list.
- *
- * @return length of the list
- */
- public final int size()
- {
- return m_firstFree;
- }
-
- /**
- * Get the length of the list.
- *
- * @return length of the list
- */
- public final void setSize(int sz)
- {
- m_firstFree = sz;
- }
-
-
- /**
- * Append an object onto the vector.
- *
- * @param value Object to add to the list
- */
- public final void addElement(Object value)
- {
-
- if ((m_firstFree + 1) >= m_mapSize)
- {
- m_mapSize += m_blocksize;
-
- Object newMap[] = new Object[m_mapSize];
-
- System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);
-
- m_map = newMap;
- }
-
- m_map[m_firstFree] = value;
-
- m_firstFree++;
- }
-
- /**
- * Append several Object values onto the vector.
- *
- * @param value Object to add to the list
- */
- public final void addElements(Object value, int numberOfElements)
- {
-
- if ((m_firstFree + numberOfElements) >= m_mapSize)
- {
- m_mapSize += (m_blocksize+numberOfElements);
-
- Object newMap[] = new Object[m_mapSize];
-
- System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);
-
- m_map = newMap;
- }
-
- for (int i = 0; i < numberOfElements; i++)
- {
- m_map[m_firstFree] = value;
- m_firstFree++;
- }
- }
-
- /**
- * Append several slots onto the vector, but do not set the values.
- *
- * @param numberOfElements number of slots to append
- */
- public final void addElements(int numberOfElements)
- {
-
- if ((m_firstFree + numberOfElements) >= m_mapSize)
- {
- m_mapSize += (m_blocksize+numberOfElements);
-
- Object newMap[] = new Object[m_mapSize];
-
- System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);
-
- m_map = newMap;
- }
-
- m_firstFree += numberOfElements;
- }
-
-
- /**
- * Inserts the specified object in this vector at the specified index.
- * Each component in this vector with an index greater or equal to
- * the specified index is shifted upward to have an index one greater
- * than the value it had previously.
- *
- * @param value Object to insert
- * @param at Index of where to insert
- */
- public final void insertElementAt(Object value, int at)
- {
-
- if ((m_firstFree + 1) >= m_mapSize)
- {
- m_mapSize += m_blocksize;
-
- Object newMap[] = new Object[m_mapSize];
-
- System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);
-
- m_map = newMap;
- }
-
- if (at <= (m_firstFree - 1))
- {
- System.arraycopy(m_map, at, m_map, at + 1, m_firstFree - at);
- }
-
- m_map[at] = value;
-
- m_firstFree++;
- }
-
- /**
- * Remove all elements objects from the list.
- */
- public final void removeAllElements()
- {
-
- for (int i = 0; i < m_firstFree; i++)
- {
- m_map[i] = null;
- }
-
- m_firstFree = 0;
- }
-
- /**
- * Removes the first occurrence of the argument from this vector.
- * If the object is found in this vector, each component in the vector
- * with an index greater or equal to the object's index is shifted
- * downward to have an index one smaller than the value it had
- * previously.
- *
- * @param s Object to remove from array
- *
- * @return True if the object was removed, false if it was not found
- */
- public final boolean removeElement(Object s)
- {
-
- for (int i = 0; i < m_firstFree; i++)
- {
- if (m_map[i] == s)
- {
- if ((i + 1) < m_firstFree)
- System.arraycopy(m_map, i + 1, m_map, i - 1, m_firstFree - i);
- else
- m_map[i] = null;
-
- m_firstFree--;
-
- return true;
- }
- }
-
- return false;
- }
-
- /**
- * Deletes the component at the specified index. Each component in
- * this vector with an index greater or equal to the specified
- * index is shifted downward to have an index one smaller than
- * the value it had previously.
- *
- * @param i index of where to remove an object
- */
- public final void removeElementAt(int i)
- {
-
- if (i > m_firstFree)
- System.arraycopy(m_map, i + 1, m_map, i, m_firstFree);
- else
- m_map[i] = null;
-
- m_firstFree--;
- }
-
- /**
- * Sets the component at the specified index of this vector to be the
- * specified object. The previous component at that position is discarded.
- *
- * The index must be a value greater than or equal to 0 and less
- * than the current size of the vector.
- *
- * @param value object to set
- * @param index Index of where to set the object
- */
- public final void setElementAt(Object value, int index)
- {
- m_map[index] = value;
- }
-
- /**
- * Get the nth element.
- *
- * @param i index of object to get
- *
- * @return object at given index
- */
- public final Object elementAt(int i)
- {
- return m_map[i];
- }
-
- /**
- * Tell if the table contains the given Object.
- *
- * @param s object to look for
- *
- * @return true if the object is in the list
- */
- public final boolean contains(Object s)
- {
-
- for (int i = 0; i < m_firstFree; i++)
- {
- if (m_map[i] == s)
- return true;
- }
-
- return false;
- }
-
- /**
- * Searches for the first occurence of the given argument,
- * beginning the search at index, and testing for equality
- * using the equals method.
- *
- * @param elem object to look for
- * @param index Index of where to begin search
- * @return the index of the first occurrence of the object
- * argument in this vector at position index or later in the
- * vector; returns -1 if the object is not found.
- */
- public final int indexOf(Object elem, int index)
- {
-
- for (int i = index; i < m_firstFree; i++)
- {
- if (m_map[i] == elem)
- return i;
- }
-
- return java.lang.Integer.MIN_VALUE;
- }
-
- /**
- * Searches for the first occurence of the given argument,
- * beginning the search at index, and testing for equality
- * using the equals method.
- *
- * @param elem object to look for
- * @return the index of the first occurrence of the object
- * argument in this vector at position index or later in the
- * vector; returns -1 if the object is not found.
- */
- public final int indexOf(Object elem)
- {
-
- for (int i = 0; i < m_firstFree; i++)
- {
- if (m_map[i] == elem)
- return i;
- }
-
- return java.lang.Integer.MIN_VALUE;
- }
-
- /**
- * Searches for the first occurence of the given argument,
- * beginning the search at index, and testing for equality
- * using the equals method.
- *
- * @param elem Object to look for
- * @return the index of the first occurrence of the object
- * argument in this vector at position index or later in the
- * vector; returns -1 if the object is not found.
- */
- public final int lastIndexOf(Object elem)
- {
-
- for (int i = (m_firstFree - 1); i >= 0; i--)
- {
- if (m_map[i] == elem)
- return i;
- }
-
- return java.lang.Integer.MIN_VALUE;
- }
-
- /*
- * Reset the array to the supplied size.
- *
- * @param size
- */
- public final void setToSize(int size) {
-
- Object newMap[] = new Object[size];
-
- System.arraycopy(m_map, 0, newMap, 0, m_firstFree);
- m_mapSize = size;
-
- m_map = newMap;
-
- }
-
- /**
- * Returns clone of current ObjectVector
- *
- * @return clone of current ObjectVector
- */
- public Object clone()
- throws CloneNotSupportedException
- {
- return new ObjectVector(this);
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/PrefixResolver.java b/src/com/sun/org/apache/xml/internal/utils/PrefixResolver.java
deleted file mode 100644
index f00de59..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/PrefixResolver.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: PrefixResolver.java,v 1.2.4.1 2005/09/15 08:15:51 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-/**
- * The class that implements this interface can resolve prefixes to
- * namespaces. Examples would include resolving the meaning of a
- * prefix at a particular point in a document, or mapping the prefixes
- * used in an XPath expression.
- * @xsl.usage advanced
- */
-public interface PrefixResolver
-{
-
- /**
- * Given a namespace, get the corrisponding prefix. This assumes that
- * the PrefixResolver holds its own namespace context, or is a namespace
- * context itself.
- *
- * @param prefix The prefix to look up, which may be an empty string ("") for the default Namespace.
- *
- * @return The associated Namespace URI, or null if the prefix
- * is undeclared in this context.
- */
- String getNamespaceForPrefix(String prefix);
-
- /**
- * Given a namespace, get the corresponding prefix, based on the context node.
- *
- * @param prefix The prefix to look up, which may be an empty string ("") for the default Namespace.
- * @param context The node context from which to look up the URI.
- *
- * @return The associated Namespace URI as a string, or null if the prefix
- * is undeclared in this context.
- */
- String getNamespaceForPrefix(String prefix, org.w3c.dom.Node context);
-
- /**
- * Return the base identifier.
- *
- * @return The base identifier from where relative URIs should be absolutized, or null
- * if the base ID is unknown.
- * <p>
- * CAVEAT: Note that the base URI in an XML document may vary with where
- * you are in the document, if part of the doc's contents were brought in
- * via an external entity reference or if mechanisms such as xml:base have
- * been used. Unless this PrefixResolver is bound to a specific portion of
- * the document, or has been kept up to date via some other mechanism, it
- * may not accurately reflect that context information.
- */
- public String getBaseIdentifier();
-
- public boolean handlesNullPrefixes();
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/PrefixResolverDefault.java b/src/com/sun/org/apache/xml/internal/utils/PrefixResolverDefault.java
deleted file mode 100644
index d89a83e..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/PrefixResolverDefault.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: PrefixResolverDefault.java,v 1.2.4.1 2005/09/15 08:15:51 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
- * This class implements a generic PrefixResolver that
- * can be used to perform prefix-to-namespace lookup
- * for the XPath object.
- * @xsl.usage general
- */
-public class PrefixResolverDefault implements PrefixResolver
-{
-
- /**
- * The context to resolve the prefix from, if the context
- * is not given.
- */
- Node m_context;
-
- /**
- * Construct a PrefixResolverDefault object.
- * @param xpathExpressionContext The context from
- * which XPath expression prefixes will be resolved.
- * Warning: This will not work correctly if xpathExpressionContext
- * is an attribute node.
- */
- public PrefixResolverDefault(Node xpathExpressionContext)
- {
- m_context = xpathExpressionContext;
- }
-
- /**
- * Given a namespace, get the corrisponding prefix. This assumes that
- * the PrevixResolver hold's it's own namespace context, or is a namespace
- * context itself.
- * @param prefix Prefix to resolve.
- * @return Namespace that prefix resolves to, or null if prefix
- * is not bound.
- */
- public String getNamespaceForPrefix(String prefix)
- {
- return getNamespaceForPrefix(prefix, m_context);
- }
-
- /**
- * Given a namespace, get the corrisponding prefix.
- * Warning: This will not work correctly if namespaceContext
- * is an attribute node.
- * @param prefix Prefix to resolve.
- * @param namespaceContext Node from which to start searching for a
- * xmlns attribute that binds a prefix to a namespace.
- * @return Namespace that prefix resolves to, or null if prefix
- * is not bound.
- */
- public String getNamespaceForPrefix(String prefix,
- org.w3c.dom.Node namespaceContext)
- {
-
- Node parent = namespaceContext;
- String namespace = null;
-
- if (prefix.equals("xml"))
- {
- namespace = Constants.S_XMLNAMESPACEURI;
- }
- else
- {
- int type;
-
- while ((null != parent) && (null == namespace)
- && (((type = parent.getNodeType()) == Node.ELEMENT_NODE)
- || (type == Node.ENTITY_REFERENCE_NODE)))
- {
- if (type == Node.ELEMENT_NODE)
- {
- if (parent.getNodeName().indexOf(prefix+":") == 0)
- return parent.getNamespaceURI();
- NamedNodeMap nnm = parent.getAttributes();
-
- for (int i = 0; i < nnm.getLength(); i++)
- {
- Node attr = nnm.item(i);
- String aname = attr.getNodeName();
- boolean isPrefix = aname.startsWith("xmlns:");
-
- if (isPrefix || aname.equals("xmlns"))
- {
- int index = aname.indexOf(':');
- String p = isPrefix ? aname.substring(index + 1) : "";
-
- if (p.equals(prefix))
- {
- namespace = attr.getNodeValue();
-
- break;
- }
- }
- }
- }
-
- parent = parent.getParentNode();
- }
- }
-
- return namespace;
- }
-
- /**
- * Return the base identifier.
- *
- * @return null
- */
- public String getBaseIdentifier()
- {
- return null;
- }
- /**
- * @see PrefixResolver#handlesNullPrefixes()
- */
- public boolean handlesNullPrefixes() {
- return false;
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/QName.java b/src/com/sun/org/apache/xml/internal/utils/QName.java
deleted file mode 100644
index 474b761..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/QName.java
+++ /dev/null
@@ -1,711 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: QName.java,v 1.2.4.1 2005/09/15 08:15:52 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-import java.util.Stack;
-import java.util.StringTokenizer;
-
-import com.sun.org.apache.xml.internal.res.XMLErrorResources;
-import com.sun.org.apache.xml.internal.res.XMLMessages;
-
-import org.w3c.dom.Element;
-
-/**
- * Class to represent a qualified name: "The name of an internal XSLT object,
- * specifically a named template (see [7 Named Templates]), a mode (see [6.7 Modes]),
- * an attribute set (see [8.1.4 Named Attribute Sets]), a key (see [14.2 Keys]),
- * a locale (see [14.3 Number Formatting]), a variable or a parameter (see
- * [12 Variables and Parameters]) is specified as a QName. If it has a prefix,
- * then the prefix is expanded into a URI reference using the namespace declarations
- * in effect on the attribute in which the name occurs. The expanded name
- * consisting of the local part of the name and the possibly null URI reference
- * is used as the name of the object. The default namespace is not used for
- * unprefixed names."
- * @xsl.usage general
- */
-public class QName implements java.io.Serializable
-{
- static final long serialVersionUID = 467434581652829920L;
-
- /**
- * The local name.
- * @serial
- */
- protected String _localName;
-
- /**
- * The namespace URI.
- * @serial
- */
- protected String _namespaceURI;
-
- /**
- * The namespace prefix.
- * @serial
- */
- protected String _prefix;
-
- /**
- * The XML namespace.
- */
- public static final String S_XMLNAMESPACEURI =
- "http://www.w3.org/XML/1998/namespace";
-
- /**
- * The cached hashcode, which is calculated at construction time.
- * @serial
- */
- private int m_hashCode;
-
- /**
- * Constructs an empty QName.
- * 20001019: Try making this public, to support Serializable? -- JKESS
- */
- public QName(){}
-
- /**
- * Constructs a new QName with the specified namespace URI and
- * local name.
- *
- * @param namespaceURI The namespace URI if known, or null
- * @param localName The local name
- */
- public QName(String namespaceURI, String localName)
- {
- this(namespaceURI, localName, false);
- }
-
- /**
- * Constructs a new QName with the specified namespace URI and
- * local name.
- *
- * @param namespaceURI The namespace URI if known, or null
- * @param localName The local name
- * @param validate If true the new QName will be validated and an IllegalArgumentException will
- * be thrown if it is invalid.
- */
- public QName(String namespaceURI, String localName, boolean validate)
- {
-
- // This check was already here. So, for now, I will not add it to the validation
- // that is done when the validate parameter is true.
- if (localName == null)
- throw new IllegalArgumentException(XMLMessages.createXMLMessage(
- XMLErrorResources.ER_ARG_LOCALNAME_NULL, null)); //"Argument 'localName' is null");
-
- if (validate)
- {
- if (!XML11Char.isXML11ValidNCName(localName))
- {
- throw new IllegalArgumentException(XMLMessages.createXMLMessage(
- XMLErrorResources.ER_ARG_LOCALNAME_INVALID,null )); //"Argument 'localName' not a valid NCName");
- }
- }
-
- _namespaceURI = namespaceURI;
- _localName = localName;
- m_hashCode = toString().hashCode();
- }
-
- /**
- * Constructs a new QName with the specified namespace URI, prefix
- * and local name.
- *
- * @param namespaceURI The namespace URI if known, or null
- * @param prefix The namespace prefix is known, or null
- * @param localName The local name
- *
- */
- public QName(String namespaceURI, String prefix, String localName)
- {
- this(namespaceURI, prefix, localName, false);
- }
-
- /**
- * Constructs a new QName with the specified namespace URI, prefix
- * and local name.
- *
- * @param namespaceURI The namespace URI if known, or null
- * @param prefix The namespace prefix is known, or null
- * @param localName The local name
- * @param validate If true the new QName will be validated and an IllegalArgumentException will
- * be thrown if it is invalid.
- */
- public QName(String namespaceURI, String prefix, String localName, boolean validate)
- {
-
- // This check was already here. So, for now, I will not add it to the validation
- // that is done when the validate parameter is true.
- if (localName == null)
- throw new IllegalArgumentException(XMLMessages.createXMLMessage(
- XMLErrorResources.ER_ARG_LOCALNAME_NULL, null)); //"Argument 'localName' is null");
-
- if (validate)
- {
- if (!XML11Char.isXML11ValidNCName(localName))
- {
- throw new IllegalArgumentException(XMLMessages.createXMLMessage(
- XMLErrorResources.ER_ARG_LOCALNAME_INVALID,null )); //"Argument 'localName' not a valid NCName");
- }
-
- if ((null != prefix) && (!XML11Char.isXML11ValidNCName(prefix)))
- {
- throw new IllegalArgumentException(XMLMessages.createXMLMessage(
- XMLErrorResources.ER_ARG_PREFIX_INVALID,null )); //"Argument 'prefix' not a valid NCName");
- }
-
- }
- _namespaceURI = namespaceURI;
- _prefix = prefix;
- _localName = localName;
- m_hashCode = toString().hashCode();
- }
-
- /**
- * Construct a QName from a string, without namespace resolution. Good
- * for a few odd cases.
- *
- * @param localName Local part of qualified name
- *
- */
- public QName(String localName)
- {
- this(localName, false);
- }
-
- /**
- * Construct a QName from a string, without namespace resolution. Good
- * for a few odd cases.
- *
- * @param localName Local part of qualified name
- * @param validate If true the new QName will be validated and an IllegalArgumentException will
- * be thrown if it is invalid.
- */
- public QName(String localName, boolean validate)
- {
-
- // This check was already here. So, for now, I will not add it to the validation
- // that is done when the validate parameter is true.
- if (localName == null)
- throw new IllegalArgumentException(XMLMessages.createXMLMessage(
- XMLErrorResources.ER_ARG_LOCALNAME_NULL, null)); //"Argument 'localName' is null");
-
- if (validate)
- {
- if (!XML11Char.isXML11ValidNCName(localName))
- {
- throw new IllegalArgumentException(XMLMessages.createXMLMessage(
- XMLErrorResources.ER_ARG_LOCALNAME_INVALID,null )); //"Argument 'localName' not a valid NCName");
- }
- }
- _namespaceURI = null;
- _localName = localName;
- m_hashCode = toString().hashCode();
- }
-
- /**
- * Construct a QName from a string, resolving the prefix
- * using the given namespace stack. The default namespace is
- * not resolved.
- *
- * @param qname Qualified name to resolve
- * @param namespaces Namespace stack to use to resolve namespace
- */
- public QName(String qname, Stack namespaces)
- {
- this(qname, namespaces, false);
- }
-
- /**
- * Construct a QName from a string, resolving the prefix
- * using the given namespace stack. The default namespace is
- * not resolved.
- *
- * @param qname Qualified name to resolve
- * @param namespaces Namespace stack to use to resolve namespace
- * @param validate If true the new QName will be validated and an IllegalArgumentException will
- * be thrown if it is invalid.
- */
- public QName(String qname, Stack namespaces, boolean validate)
- {
-
- String namespace = null;
- String prefix = null;
- int indexOfNSSep = qname.indexOf(':');
-
- if (indexOfNSSep > 0)
- {
- prefix = qname.substring(0, indexOfNSSep);
-
- if (prefix.equals("xml"))
- {
- namespace = S_XMLNAMESPACEURI;
- }
- // Do we want this?
- else if (prefix.equals("xmlns"))
- {
- return;
- }
- else
- {
- int depth = namespaces.size();
-
- for (int i = depth - 1; i >= 0; i--)
- {
- NameSpace ns = (NameSpace) namespaces.elementAt(i);
-
- while (null != ns)
- {
- if ((null != ns.m_prefix) && prefix.equals(ns.m_prefix))
- {
- namespace = ns.m_uri;
- i = -1;
-
- break;
- }
-
- ns = ns.m_next;
- }
- }
- }
-
- if (null == namespace)
- {
- throw new RuntimeException(
- XMLMessages.createXMLMessage(
- XMLErrorResources.ER_PREFIX_MUST_RESOLVE,
- new Object[]{ prefix })); //"Prefix must resolve to a namespace: "+prefix);
- }
- }
-
- _localName = (indexOfNSSep < 0)
- ? qname : qname.substring(indexOfNSSep + 1);
-
- if (validate)
- {
- if ((_localName == null) || (!XML11Char.isXML11ValidNCName(_localName)))
- {
- throw new IllegalArgumentException(XMLMessages.createXMLMessage(
- XMLErrorResources.ER_ARG_LOCALNAME_INVALID,null )); //"Argument 'localName' not a valid NCName");
- }
- }
- _namespaceURI = namespace;
- _prefix = prefix;
- m_hashCode = toString().hashCode();
- }
-
- /**
- * Construct a QName from a string, resolving the prefix
- * using the given namespace context and prefix resolver.
- * The default namespace is not resolved.
- *
- * @param qname Qualified name to resolve
- * @param namespaceContext Namespace Context to use
- * @param resolver Prefix resolver for this context
- */
- public QName(String qname, Element namespaceContext,
- PrefixResolver resolver)
- {
- this(qname, namespaceContext, resolver, false);
- }
-
- /**
- * Construct a QName from a string, resolving the prefix
- * using the given namespace context and prefix resolver.
- * The default namespace is not resolved.
- *
- * @param qname Qualified name to resolve
- * @param namespaceContext Namespace Context to use
- * @param resolver Prefix resolver for this context
- * @param validate If true the new QName will be validated and an IllegalArgumentException will
- * be thrown if it is invalid.
- */
- public QName(String qname, Element namespaceContext,
- PrefixResolver resolver, boolean validate)
- {
-
- _namespaceURI = null;
-
- int indexOfNSSep = qname.indexOf(':');
-
- if (indexOfNSSep > 0)
- {
- if (null != namespaceContext)
- {
- String prefix = qname.substring(0, indexOfNSSep);
-
- _prefix = prefix;
-
- if (prefix.equals("xml"))
- {
- _namespaceURI = S_XMLNAMESPACEURI;
- }
-
- // Do we want this?
- else if (prefix.equals("xmlns"))
- {
- return;
- }
- else
- {
- _namespaceURI = resolver.getNamespaceForPrefix(prefix,
- namespaceContext);
- }
-
- if (null == _namespaceURI)
- {
- throw new RuntimeException(
- XMLMessages.createXMLMessage(
- XMLErrorResources.ER_PREFIX_MUST_RESOLVE,
- new Object[]{ prefix })); //"Prefix must resolve to a namespace: "+prefix);
- }
- }
- else
- {
-
- // TODO: error or warning...
- }
- }
-
- _localName = (indexOfNSSep < 0)
- ? qname : qname.substring(indexOfNSSep + 1);
-
- if (validate)
- {
- if ((_localName == null) || (!XML11Char.isXML11ValidNCName(_localName)))
- {
- throw new IllegalArgumentException(XMLMessages.createXMLMessage(
- XMLErrorResources.ER_ARG_LOCALNAME_INVALID,null )); //"Argument 'localName' not a valid NCName");
- }
- }
-
- m_hashCode = toString().hashCode();
- }
-
-
- /**
- * Construct a QName from a string, resolving the prefix
- * using the given namespace stack. The default namespace is
- * not resolved.
- *
- * @param qname Qualified name to resolve
- * @param resolver Prefix resolver for this context
- */
- public QName(String qname, PrefixResolver resolver)
- {
- this(qname, resolver, false);
- }
-
- /**
- * Construct a QName from a string, resolving the prefix
- * using the given namespace stack. The default namespace is
- * not resolved.
- *
- * @param qname Qualified name to resolve
- * @param resolver Prefix resolver for this context
- * @param validate If true the new QName will be validated and an IllegalArgumentException will
- * be thrown if it is invalid.
- */
- public QName(String qname, PrefixResolver resolver, boolean validate)
- {
-
- String prefix = null;
- _namespaceURI = null;
-
- int indexOfNSSep = qname.indexOf(':');
-
- if (indexOfNSSep > 0)
- {
- prefix = qname.substring(0, indexOfNSSep);
-
- if (prefix.equals("xml"))
- {
- _namespaceURI = S_XMLNAMESPACEURI;
- }
- else
- {
- _namespaceURI = resolver.getNamespaceForPrefix(prefix);
- }
-
- if (null == _namespaceURI)
- {
- throw new RuntimeException(
- XMLMessages.createXMLMessage(
- XMLErrorResources.ER_PREFIX_MUST_RESOLVE,
- new Object[]{ prefix })); //"Prefix must resolve to a namespace: "+prefix);
- }
- _localName = qname.substring(indexOfNSSep + 1);
- }
- else if (indexOfNSSep == 0)
- {
- throw new RuntimeException(
- XMLMessages.createXMLMessage(
- XMLErrorResources.ER_NAME_CANT_START_WITH_COLON,
- null));
- }
- else
- {
- _localName = qname;
- }
-
- if (validate)
- {
- if ((_localName == null) || (!XML11Char.isXML11ValidNCName(_localName)))
- {
- throw new IllegalArgumentException(XMLMessages.createXMLMessage(
- XMLErrorResources.ER_ARG_LOCALNAME_INVALID,null )); //"Argument 'localName' not a valid NCName");
- }
- }
-
-
- m_hashCode = toString().hashCode();
- _prefix = prefix;
- }
-
- /**
- * Returns the namespace URI. Returns null if the namespace URI
- * is not known.
- *
- * @return The namespace URI, or null
- */
- public String getNamespaceURI()
- {
- return _namespaceURI;
- }
-
- /**
- * Returns the namespace prefix. Returns null if the namespace
- * prefix is not known.
- *
- * @return The namespace prefix, or null
- */
- public String getPrefix()
- {
- return _prefix;
- }
-
- /**
- * Returns the local part of the qualified name.
- *
- * @return The local part of the qualified name
- */
- public String getLocalName()
- {
- return _localName;
- }
-
- /**
- * Return the string representation of the qualified name, using the
- * prefix if available, or the '{ns}foo' notation if not. Performs
- * string concatenation, so beware of performance issues.
- *
- * @return the string representation of the namespace
- */
- public String toString()
- {
-
- return _prefix != null
- ? (_prefix + ":" + _localName)
- : (_namespaceURI != null
- ? ("{"+_namespaceURI + "}" + _localName) : _localName);
- }
-
- /**
- * Return the string representation of the qualified name using the
- * the '{ns}foo' notation. Performs
- * string concatenation, so beware of performance issues.
- *
- * @return the string representation of the namespace
- */
- public String toNamespacedString()
- {
-
- return (_namespaceURI != null
- ? ("{"+_namespaceURI + "}" + _localName) : _localName);
- }
-
-
- /**
- * Get the namespace of the qualified name.
- *
- * @return the namespace URI of the qualified name
- */
- public String getNamespace()
- {
- return getNamespaceURI();
- }
-
- /**
- * Get the local part of the qualified name.
- *
- * @return the local part of the qualified name
- */
- public String getLocalPart()
- {
- return getLocalName();
- }
-
- /**
- * Return the cached hashcode of the qualified name.
- *
- * @return the cached hashcode of the qualified name
- */
- public int hashCode()
- {
- return m_hashCode;
- }
-
- /**
- * Override equals and agree that we're equal if
- * the passed object is a string and it matches
- * the name of the arg.
- *
- * @param ns Namespace URI to compare to
- * @param localPart Local part of qualified name to compare to
- *
- * @return True if the local name and uri match
- */
- public boolean equals(String ns, String localPart)
- {
-
- String thisnamespace = getNamespaceURI();
-
- return getLocalName().equals(localPart)
- && (((null != thisnamespace) && (null != ns))
- ? thisnamespace.equals(ns)
- : ((null == thisnamespace) && (null == ns)));
- }
-
- /**
- * Override equals and agree that we're equal if
- * the passed object is a QName and it matches
- * the name of the arg.
- *
- * @return True if the qualified names are equal
- */
- public boolean equals(Object object)
- {
-
- if (object == this)
- return true;
-
- if (object instanceof QName) {
- QName qname = (QName) object;
- String thisnamespace = getNamespaceURI();
- String thatnamespace = qname.getNamespaceURI();
-
- return getLocalName().equals(qname.getLocalName())
- && (((null != thisnamespace) && (null != thatnamespace))
- ? thisnamespace.equals(thatnamespace)
- : ((null == thisnamespace) && (null == thatnamespace)));
- }
- else
- return false;
- }
-
- /**
- * Given a string, create and return a QName object
- *
- *
- * @param name String to use to create QName
- *
- * @return a QName object
- */
- public static QName getQNameFromString(String name)
- {
-
- StringTokenizer tokenizer = new StringTokenizer(name, "{}", false);
- QName qname;
- String s1 = tokenizer.nextToken();
- String s2 = tokenizer.hasMoreTokens() ? tokenizer.nextToken() : null;
-
- if (null == s2)
- qname = new QName(null, s1);
- else
- qname = new QName(s1, s2);
-
- return qname;
- }
-
- /**
- * This function tells if a raw attribute name is a
- * xmlns attribute.
- *
- * @param attRawName Raw name of attribute
- *
- * @return True if the attribute starts with or is equal to xmlns
- */
- public static boolean isXMLNSDecl(String attRawName)
- {
-
- return (attRawName.startsWith("xmlns")
- && (attRawName.equals("xmlns")
- || attRawName.startsWith("xmlns:")));
- }
-
- /**
- * This function tells if a raw attribute name is a
- * xmlns attribute.
- *
- * @param attRawName Raw name of attribute
- *
- * @return Prefix of attribute
- */
- public static String getPrefixFromXMLNSDecl(String attRawName)
- {
-
- int index = attRawName.indexOf(':');
-
- return (index >= 0) ? attRawName.substring(index + 1) : "";
- }
-
- /**
- * Returns the local name of the given node.
- *
- * @param qname Input name
- *
- * @return Local part of the name if prefixed, or the given name if not
- */
- public static String getLocalPart(String qname)
- {
-
- int index = qname.indexOf(':');
-
- return (index < 0) ? qname : qname.substring(index + 1);
- }
-
- /**
- * Returns the local name of the given node.
- *
- * @param qname Input name
- *
- * @return Prefix of name or empty string if none there
- */
- public static String getPrefixPart(String qname)
- {
-
- int index = qname.indexOf(':');
-
- return (index >= 0) ? qname.substring(0, index) : "";
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/RawCharacterHandler.java b/src/com/sun/org/apache/xml/internal/utils/RawCharacterHandler.java
deleted file mode 100644
index d01ce86..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/RawCharacterHandler.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: RawCharacterHandler.java,v 1.2.4.1 2005/09/15 08:15:52 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-/**
- * An interface that a Serializer/ContentHandler/ContentHandler must
- * implement in order for disable-output-escaping to work.
- * @xsl.usage advanced
- */
-public interface RawCharacterHandler
-{
-
- /**
- * Serialize the characters without escaping.
- *
- * @param ch Array of characters
- * @param start Start index of characters in the array
- * @param length Number of characters in the array
- *
- * @throws javax.xml.transform.TransformerException
- */
- public void charactersRaw(char ch[], int start, int length)
- throws javax.xml.transform.TransformerException;
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/SAXSourceLocator.java b/src/com/sun/org/apache/xml/internal/utils/SAXSourceLocator.java
deleted file mode 100644
index c9f7574..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/SAXSourceLocator.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: SAXSourceLocator.java,v 1.2.4.1 2005/09/15 08:15:52 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-import java.io.Serializable;
-
-import javax.xml.transform.SourceLocator;
-
-import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.helpers.LocatorImpl;
-
-/**
- * Class SAXSourceLocator extends org.xml.sax.helpers.LocatorImpl
- * for the purpose of implementing the SourceLocator interface,
- * and thus can be both a SourceLocator and a SAX Locator.
- */
-public class SAXSourceLocator extends LocatorImpl
- implements SourceLocator, Serializable
-{
- static final long serialVersionUID = 3181680946321164112L;
- /** The SAX Locator object.
- * @serial
- */
- Locator m_locator;
-
- /**
- * Constructor SAXSourceLocator
- *
- */
- public SAXSourceLocator(){}
-
- /**
- * Constructor SAXSourceLocator
- *
- *
- * @param locator Source locator
- */
- public SAXSourceLocator(Locator locator)
- {
- m_locator = locator;
- this.setColumnNumber(locator.getColumnNumber());
- this.setLineNumber(locator.getLineNumber());
- this.setPublicId(locator.getPublicId());
- this.setSystemId(locator.getSystemId());
- }
-
- /**
- * Constructor SAXSourceLocator
- *
- *
- * @param locator Source locator
- */
- public SAXSourceLocator(javax.xml.transform.SourceLocator locator)
- {
- m_locator = null;
- this.setColumnNumber(locator.getColumnNumber());
- this.setLineNumber(locator.getLineNumber());
- this.setPublicId(locator.getPublicId());
- this.setSystemId(locator.getSystemId());
- }
-
-
- /**
- * Constructor SAXSourceLocator
- *
- *
- * @param spe SAXParseException exception.
- */
- public SAXSourceLocator(SAXParseException spe)
- {
- this.setLineNumber( spe.getLineNumber() );
- this.setColumnNumber( spe.getColumnNumber() );
- this.setPublicId( spe.getPublicId() );
- this.setSystemId( spe.getSystemId() );
- }
-
- /**
- * Return the public identifier for the current document event.
- *
- * <p>The return value is the public identifier of the document
- * entity or of the external parsed entity in which the markup
- * triggering the event appears.</p>
- *
- * @return A string containing the public identifier, or
- * null if none is available.
- * @see #getSystemId
- */
- public String getPublicId()
- {
- return (null == m_locator) ? super.getPublicId() : m_locator.getPublicId();
- }
-
- /**
- * Return the system identifier for the current document event.
- *
- * <p>The return value is the system identifier of the document
- * entity or of the external parsed entity in which the markup
- * triggering the event appears.</p>
- *
- * <p>If the system identifier is a URL, the parser must resolve it
- * fully before passing it to the application.</p>
- *
- * @return A string containing the system identifier, or null
- * if none is available.
- * @see #getPublicId
- */
- public String getSystemId()
- {
- return (null == m_locator) ? super.getSystemId() : m_locator.getSystemId();
- }
-
- /**
- * Return the line number where the current document event ends.
- *
- * <p><strong>Warning:</strong> The return value from the method
- * is intended only as an approximation for the sake of error
- * reporting; it is not intended to provide sufficient information
- * to edit the character content of the original XML document.</p>
- *
- * <p>The return value is an approximation of the line number
- * in the document entity or external parsed entity where the
- * markup triggering the event appears.</p>
- *
- * @return The line number, or -1 if none is available.
- * @see #getColumnNumber
- */
- public int getLineNumber()
- {
- return (null == m_locator) ? super.getLineNumber() : m_locator.getLineNumber();
- }
-
- /**
- * Return the column number where the current document event ends.
- *
- * <p><strong>Warning:</strong> The return value from the method
- * is intended only as an approximation for the sake of error
- * reporting; it is not intended to provide sufficient information
- * to edit the character content of the original XML document.</p>
- *
- * <p>The return value is an approximation of the column number
- * in the document entity or external parsed entity where the
- * markup triggering the event appears.</p>
- *
- * @return The column number, or -1 if none is available.
- * @see #getLineNumber
- */
- public int getColumnNumber()
- {
- return (null == m_locator) ? super.getColumnNumber() : m_locator.getColumnNumber();
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/SerializableLocatorImpl.java b/src/com/sun/org/apache/xml/internal/utils/SerializableLocatorImpl.java
deleted file mode 100644
index 1bb007d..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/SerializableLocatorImpl.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: SerializableLocatorImpl.java,v 1.2.4.1 2005/09/15 08:15:54 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-
-/**
- * The standard SAX implementation of LocatorImpl is not serializable,
- * limiting its utility as "a persistent snapshot of a locator".
- * This is a quick hack to make it so. Note that it makes more sense
- * in many cases to set up fields to hold this data rather than pointing
- * at another object... but that decision should be made on architectural
- * grounds rather than serializability.
- *<p>
- * It isn't clear whether subclassing LocatorImpl and adding serialization
- * methods makes more sense than copying it and just adding Serializable
- * to its interface. Since it's so simple, I've taken the latter approach
- * for now.
- *
- * @see org.xml.sax.helpers.LocatorImpl
- * @see org.xml.sax.Locator Locator
- * @since XalanJ2
- * @author Joe Kesselman
- */
-public class SerializableLocatorImpl
-implements org.xml.sax.Locator, java.io.Serializable
-
-{
- static final long serialVersionUID = -2660312888446371460L;
- /**
- * Zero-argument constructor.
- *
- * <p>SAX says "This will not normally be useful, since the main purpose
- * of this class is to make a snapshot of an existing Locator." In fact,
- * it _is_ sometimes useful when you want to construct a new Locator
- * pointing to a specific location... which, after all, is why the
- * setter methods are provided.
- * </p>
- */
- public SerializableLocatorImpl ()
- {
- }
-
-
- /**
- * Copy constructor.
- *
- * <p>Create a persistent copy of the current state of a locator.
- * When the original locator changes, this copy will still keep
- * the original values (and it can be used outside the scope of
- * DocumentHandler methods).</p>
- *
- * @param locator The locator to copy.
- */
- public SerializableLocatorImpl (org.xml.sax.Locator locator)
- {
- setPublicId(locator.getPublicId());
- setSystemId(locator.getSystemId());
- setLineNumber(locator.getLineNumber());
- setColumnNumber(locator.getColumnNumber());
- }
-
-
- ////////////////////////////////////////////////////////////////////
- // Implementation of org.xml.sax.Locator
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Return the saved public identifier.
- *
- * @return The public identifier as a string, or null if none
- * is available.
- * @see org.xml.sax.Locator#getPublicId
- * @see #setPublicId
- */
- public String getPublicId ()
- {
- return publicId;
- }
-
-
- /**
- * Return the saved system identifier.
- *
- * @return The system identifier as a string, or null if none
- * is available.
- * @see org.xml.sax.Locator#getSystemId
- * @see #setSystemId
- */
- public String getSystemId ()
- {
- return systemId;
- }
-
-
- /**
- * Return the saved line number (1-based).
- *
- * @return The line number as an integer, or -1 if none is available.
- * @see org.xml.sax.Locator#getLineNumber
- * @see #setLineNumber
- */
- public int getLineNumber ()
- {
- return lineNumber;
- }
-
-
- /**
- * Return the saved column number (1-based).
- *
- * @return The column number as an integer, or -1 if none is available.
- * @see org.xml.sax.Locator#getColumnNumber
- * @see #setColumnNumber
- */
- public int getColumnNumber ()
- {
- return columnNumber;
- }
-
-
- ////////////////////////////////////////////////////////////////////
- // Setters for the properties (not in org.xml.sax.Locator)
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Set the public identifier for this locator.
- *
- * @param publicId The new public identifier, or null
- * if none is available.
- * @see #getPublicId
- */
- public void setPublicId (String publicId)
- {
- this.publicId = publicId;
- }
-
-
- /**
- * Set the system identifier for this locator.
- *
- * @param systemId The new system identifier, or null
- * if none is available.
- * @see #getSystemId
- */
- public void setSystemId (String systemId)
- {
- this.systemId = systemId;
- }
-
-
- /**
- * Set the line number for this locator (1-based).
- *
- * @param lineNumber The line number, or -1 if none is available.
- * @see #getLineNumber
- */
- public void setLineNumber (int lineNumber)
- {
- this.lineNumber = lineNumber;
- }
-
-
- /**
- * Set the column number for this locator (1-based).
- *
- * @param columnNumber The column number, or -1 if none is available.
- * @see #getColumnNumber
- */
- public void setColumnNumber (int columnNumber)
- {
- this.columnNumber = columnNumber;
- }
-
-
- ////////////////////////////////////////////////////////////////////
- // Internal state.
- ////////////////////////////////////////////////////////////////////
-
- /**
- * The public ID.
- * @serial
- */
- private String publicId;
-
- /**
- * The system ID.
- * @serial
- */
- private String systemId;
-
- /**
- * The line number.
- * @serial
- */
- private int lineNumber;
-
- /**
- * The column number.
- * @serial
- */
- private int columnNumber;
-
-}
-
-// end of LocatorImpl.java
diff --git a/src/com/sun/org/apache/xml/internal/utils/StopParseException.java b/src/com/sun/org/apache/xml/internal/utils/StopParseException.java
deleted file mode 100644
index bc29bd2..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/StopParseException.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: StopParseException.java,v 1.2.4.1 2005/09/15 08:15:54 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-/**
- * This is a special exception that is used to stop parsing when
- * search for an element. For instance, when searching for xml:stylesheet
- * PIs, it is used to stop the parse once the document element is found.
- * @see StylesheetPIHandler
- * @xsl.usage internal
- */
-public class StopParseException extends org.xml.sax.SAXException
-{
- static final long serialVersionUID = 210102479218258961L;
- /**
- * Constructor StopParseException.
- */
- StopParseException()
- {
- super("Stylesheet PIs found, stop the parse");
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/StringBufferPool.java b/src/com/sun/org/apache/xml/internal/utils/StringBufferPool.java
deleted file mode 100644
index 2990480..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/StringBufferPool.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: StringBufferPool.java,v 1.2.4.1 2005/09/15 08:15:54 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-/**
- * This class pools string buffers, since they are reused so often.
- * String buffers are good candidates for pooling, because of
- * their supporting character arrays.
- * @xsl.usage internal
- */
-public class StringBufferPool
-{
-
- /** The global pool of string buffers. */
- private static ObjectPool m_stringBufPool =
- new ObjectPool(com.sun.org.apache.xml.internal.utils.FastStringBuffer.class);
-
- /**
- * Get the first free instance of a string buffer, or create one
- * if there are no free instances.
- *
- * @return A string buffer ready for use.
- */
- public synchronized static FastStringBuffer get()
- {
- return (FastStringBuffer) m_stringBufPool.getInstance();
- }
-
- /**
- * Return a string buffer back to the pool.
- *
- * @param sb Must be a non-null reference to a string buffer.
- */
- public synchronized static void free(FastStringBuffer sb)
- {
- // Since this isn't synchronized, setLength must be
- // done before the instance is freed.
- // Fix attributed to Peter Speck <speck@ruc.dk>.
- sb.setLength(0);
- m_stringBufPool.freeInstance(sb);
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/StringComparable.java b/src/com/sun/org/apache/xml/internal/utils/StringComparable.java
deleted file mode 100644
index 81cc838..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/StringComparable.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: StringComparable.java,v 1.2.4.1 2005/09/15 08:15:55 suresh_emailid Exp $
- */
-
-package com.sun.org.apache.xml.internal.utils;
-
-import java.util.Vector;
-import java.text.Collator;
-import java.text.RuleBasedCollator;
-import java.text.CollationElementIterator;
-import java.util.Locale;
-import java.text.CollationKey;
-
-
-/**
-* International friendly string comparison with case-order
- * @author Igor Hersht, igorh@ca.ibm.com
-*/
-public class StringComparable implements Comparable {
-
- public final static int UNKNOWN_CASE = -1;
- public final static int UPPER_CASE = 1;
- public final static int LOWER_CASE = 2;
-
- private String m_text;
- private Locale m_locale;
- private RuleBasedCollator m_collator;
- private String m_caseOrder;
- private int m_mask = 0xFFFFFFFF;
-
- public StringComparable(final String text, final Locale locale, final Collator collator, final String caseOrder){
- m_text = text;
- m_locale = locale;
- m_collator = (RuleBasedCollator)collator;
- m_caseOrder = caseOrder;
- m_mask = getMask(m_collator.getStrength());
- }
-
- public final static Comparable getComparator( final String text, final Locale locale, final Collator collator, final String caseOrder){
- if((caseOrder == null) ||(caseOrder.length() == 0)){// no case-order specified
- return ((RuleBasedCollator)collator).getCollationKey(text);
- }else{
- return new StringComparable(text, locale, collator, caseOrder);
- }
- }
-
- public final String toString(){return m_text;}
-
- public int compareTo(Object o) {
- final String pattern = ((StringComparable)o).toString();
- if(m_text.equals(pattern)){//Code-point equals
- return 0;
- }
- final int savedStrength = m_collator.getStrength();
- int comp = 0;
- // Is there difference more significant than case-order?
- if(((savedStrength == Collator.PRIMARY) || (savedStrength == Collator.SECONDARY))){
- comp = m_collator.compare(m_text, pattern );
- }else{// more than SECONDARY
- m_collator.setStrength(Collator.SECONDARY);
- comp = m_collator.compare(m_text, pattern );
- m_collator.setStrength(savedStrength);
- }
- if(comp != 0){//Difference more significant than case-order
- return comp ;
- }
-
- // No difference more significant than case-order.
- // Find case difference
- comp = getCaseDiff(m_text, pattern);
- if(comp != 0){
- return comp;
- }else{// No case differences. Less significant difference could exist
- return m_collator.compare(m_text, pattern );
- }
- }
-
-
- private final int getCaseDiff (final String text, final String pattern){
- final int savedStrength = m_collator.getStrength();
- final int savedDecomposition = m_collator.getDecomposition();
- m_collator.setStrength(Collator.TERTIARY);// not to ignore case
- m_collator.setDecomposition(Collator.CANONICAL_DECOMPOSITION );// corresponds NDF
-
- final int diff[] =getFirstCaseDiff (text, pattern, m_locale);
- m_collator.setStrength(savedStrength);// restore
- m_collator.setDecomposition(savedDecomposition); //restore
- if(diff != null){
- if((m_caseOrder).equals("upper-first")){
- if(diff[0] == UPPER_CASE){
- return -1;
- }else{
- return 1;
- }
- }else{// lower-first
- if(diff[0] == LOWER_CASE){
- return -1;
- }else{
- return 1;
- }
- }
- }else{// No case differences
- return 0;
- }
-
- }
-
-
-
- private final int[] getFirstCaseDiff(final String text, final String pattern, final Locale locale){
-
- final CollationElementIterator targIter = m_collator.getCollationElementIterator(text);
- final CollationElementIterator patIter = m_collator.getCollationElementIterator(pattern);
- int startTarg = -1;
- int endTarg = -1;
- int startPatt = -1;
- int endPatt = -1;
- final int done = getElement(CollationElementIterator.NULLORDER);
- int patternElement = 0, targetElement = 0;
- boolean getPattern = true, getTarget = true;
-
- while (true) {
- if (getPattern){
- startPatt = patIter.getOffset();
- patternElement = getElement(patIter.next());
- endPatt = patIter.getOffset();
- }
- if ((getTarget)){
- startTarg = targIter.getOffset();
- targetElement = getElement(targIter.next());
- endTarg = targIter.getOffset();
- }
- getTarget = getPattern = true;
- if ((patternElement == done) ||( targetElement == done)) {
- return null;
- } else if (targetElement == 0) {
- getPattern = false;
- } else if (patternElement == 0) {
- getTarget = false;
- } else if (targetElement != patternElement) {// mismatch
- if((startPatt < endPatt) && (startTarg < endTarg)){
- final String subText = text.substring(startTarg, endTarg);
- final String subPatt = pattern.substring(startPatt, endPatt);
- final String subTextUp = subText.toUpperCase(locale);
- final String subPattUp = subPatt.toUpperCase(locale);
- if(m_collator.compare(subTextUp, subPattUp) != 0){ // not case diffference
- continue;
- }
-
- int diff[] = {UNKNOWN_CASE, UNKNOWN_CASE};
- if(m_collator.compare(subText, subTextUp) == 0){
- diff[0] = UPPER_CASE;
- }else if(m_collator.compare(subText, subText.toLowerCase(locale)) == 0){
- diff[0] = LOWER_CASE;
- }
- if(m_collator.compare(subPatt, subPattUp) == 0){
- diff[1] = UPPER_CASE;
- }else if(m_collator.compare(subPatt, subPatt.toLowerCase(locale)) == 0){
- diff[1] = LOWER_CASE;
- }
-
- if(((diff[0] == UPPER_CASE) && ( diff[1] == LOWER_CASE)) ||
- ((diff[0] == LOWER_CASE) && ( diff[1] == UPPER_CASE))){
- return diff;
- }else{// not case diff
- continue;
- }
- }else{
- continue;
- }
-
- }
- }
-
- }
-
-
- // Return a mask for the part of the order we're interested in
- private static final int getMask(final int strength) {
- switch (strength) {
- case Collator.PRIMARY:
- return 0xFFFF0000;
- case Collator.SECONDARY:
- return 0xFFFFFF00;
- default:
- return 0xFFFFFFFF;
- }
- }
- //get collation element with given strength
- // from the element with max strength
- private final int getElement(int maxStrengthElement){
-
- return (maxStrengthElement & m_mask);
- }
-
-}//StringComparable
diff --git a/src/com/sun/org/apache/xml/internal/utils/StringToIntTable.java b/src/com/sun/org/apache/xml/internal/utils/StringToIntTable.java
deleted file mode 100644
index 0e9984d..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/StringToIntTable.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: StringToIntTable.java,v 1.2.4.1 2005/09/15 08:15:55 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-/**
- * A very simple lookup table that stores a list of strings, the even
- * number strings being keys, and the odd number strings being values.
- * @xsl.usage internal
- */
-public class StringToIntTable
-{
-
- public static final int INVALID_KEY = -10000;
-
- /** Block size to allocate */
- private int m_blocksize;
-
- /** Array of strings this table points to. Associated with ints
- * in m_values */
- private String m_map[];
-
- /** Array of ints this table points. Associated with strings from
- * m_map. */
- private int m_values[];
-
- /** Number of ints in the table */
- private int m_firstFree = 0;
-
- /** Size of this table */
- private int m_mapSize;
-
- /**
- * Default constructor. Note that the default
- * block size is very small, for small lists.
- */
- public StringToIntTable()
- {
-
- m_blocksize = 8;
- m_mapSize = m_blocksize;
- m_map = new String[m_blocksize];
- m_values = new int[m_blocksize];
- }
-
- /**
- * Construct a StringToIntTable, using the given block size.
- *
- * @param blocksize Size of block to allocate
- */
- public StringToIntTable(int blocksize)
- {
-
- m_blocksize = blocksize;
- m_mapSize = blocksize;
- m_map = new String[blocksize];
- m_values = new int[m_blocksize];
- }
-
- /**
- * Get the length of the list.
- *
- * @return the length of the list
- */
- public final int getLength()
- {
- return m_firstFree;
- }
-
- /**
- * Append a string onto the vector.
- *
- * @param key String to append
- * @param value The int value of the string
- */
- public final void put(String key, int value)
- {
-
- if ((m_firstFree + 1) >= m_mapSize)
- {
- m_mapSize += m_blocksize;
-
- String newMap[] = new String[m_mapSize];
-
- System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);
-
- m_map = newMap;
-
- int newValues[] = new int[m_mapSize];
-
- System.arraycopy(m_values, 0, newValues, 0, m_firstFree + 1);
-
- m_values = newValues;
- }
-
- m_map[m_firstFree] = key;
- m_values[m_firstFree] = value;
-
- m_firstFree++;
- }
-
- /**
- * Tell if the table contains the given string.
- *
- * @param key String to look for
- *
- * @return The String's int value
- *
- */
- public final int get(String key)
- {
-
- for (int i = 0; i < m_firstFree; i++)
- {
- if (m_map[i].equals(key))
- return m_values[i];
- }
-
- return INVALID_KEY;
- }
-
- /**
- * Tell if the table contains the given string. Ignore case.
- *
- * @param key String to look for
- *
- * @return The string's int value
- */
- public final int getIgnoreCase(String key)
- {
-
- if (null == key)
- return INVALID_KEY;
-
- for (int i = 0; i < m_firstFree; i++)
- {
- if (m_map[i].equalsIgnoreCase(key))
- return m_values[i];
- }
-
- return INVALID_KEY;
- }
-
- /**
- * Tell if the table contains the given string.
- *
- * @param key String to look for
- *
- * @return True if the string is in the table
- */
- public final boolean contains(String key)
- {
-
- for (int i = 0; i < m_firstFree; i++)
- {
- if (m_map[i].equals(key))
- return true;
- }
-
- return false;
- }
-
- /**
- * Return array of keys in the table.
- *
- * @return Array of strings
- */
- public final String[] keys()
- {
- String [] keysArr = new String[m_firstFree];
-
- for (int i = 0; i < m_firstFree; i++)
- {
- keysArr[i] = m_map[i];
- }
-
- return keysArr;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/StringToStringTable.java b/src/com/sun/org/apache/xml/internal/utils/StringToStringTable.java
deleted file mode 100644
index 02fe9cd..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/StringToStringTable.java
+++ /dev/null
@@ -1,244 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: StringToStringTable.java,v 1.2.4.1 2005/09/15 08:15:56 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-/**
- * A very simple lookup table that stores a list of strings, the even
- * number strings being keys, and the odd number strings being values.
- * @xsl.usage internal
- */
-public class StringToStringTable
-{
-
- /** Size of blocks to allocate */
- private int m_blocksize;
-
- /** Array of strings this contains */
- private String m_map[];
-
- /** Number of strings this contains */
- private int m_firstFree = 0;
-
- /** Size of this table */
- private int m_mapSize;
-
- /**
- * Default constructor. Note that the default
- * block size is very small, for small lists.
- */
- public StringToStringTable()
- {
-
- m_blocksize = 16;
- m_mapSize = m_blocksize;
- m_map = new String[m_blocksize];
- }
-
- /**
- * Construct a StringToStringTable, using the given block size.
- *
- * @param blocksize Size of blocks to allocate
- */
- public StringToStringTable(int blocksize)
- {
-
- m_blocksize = blocksize;
- m_mapSize = blocksize;
- m_map = new String[blocksize];
- }
-
- /**
- * Get the length of the list.
- *
- * @return Number of strings in the list
- */
- public final int getLength()
- {
- return m_firstFree;
- }
-
- /**
- * Append a string onto the vector.
- * The strings go to the even locations in the array
- * and the values in the odd.
- *
- * @param key String to add to the list
- * @param value Value of the string
- */
- public final void put(String key, String value)
- {
-
- if ((m_firstFree + 2) >= m_mapSize)
- {
- m_mapSize += m_blocksize;
-
- String newMap[] = new String[m_mapSize];
-
- System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);
-
- m_map = newMap;
- }
-
- m_map[m_firstFree] = key;
-
- m_firstFree++;
-
- m_map[m_firstFree] = value;
-
- m_firstFree++;
- }
-
- /**
- * Tell if the table contains the given string.
- *
- * @param key String to look up
- *
- * @return return the value of the string or null if not found.
- */
- public final String get(String key)
- {
-
- for (int i = 0; i < m_firstFree; i += 2)
- {
- if (m_map[i].equals(key))
- return m_map[i + 1];
- }
-
- return null;
- }
-
- /**
- * Remove the given string and its value from this table.
- *
- * @param key String to remove from the table
- */
- public final void remove(String key)
- {
-
- for (int i = 0; i < m_firstFree; i += 2)
- {
- if (m_map[i].equals(key))
- {
- if ((i + 2) < m_firstFree)
- System.arraycopy(m_map, i + 2, m_map, i, m_firstFree - (i + 2));
-
- m_firstFree -= 2;
- m_map[m_firstFree] = null;
- m_map[m_firstFree + 1] = null;
-
- break;
- }
- }
- }
-
- /**
- * Tell if the table contains the given string. Ignore case
- *
- * @param key String to look up
- *
- * @return The value of the string or null if not found
- */
- public final String getIgnoreCase(String key)
- {
-
- if (null == key)
- return null;
-
- for (int i = 0; i < m_firstFree; i += 2)
- {
- if (m_map[i].equalsIgnoreCase(key))
- return m_map[i + 1];
- }
-
- return null;
- }
-
- /**
- * Tell if the table contains the given string in the value.
- *
- * @param val Value of the string to look up
- *
- * @return the string associated with the given value or null if not found
- */
- public final String getByValue(String val)
- {
-
- for (int i = 1; i < m_firstFree; i += 2)
- {
- if (m_map[i].equals(val))
- return m_map[i - 1];
- }
-
- return null;
- }
-
- /**
- * Get the nth element.
- *
- * @param i index of the string to look up.
- *
- * @return The string at the given index.
- */
- public final String elementAt(int i)
- {
- return m_map[i];
- }
-
- /**
- * Tell if the table contains the given string.
- *
- * @param key String to look up
- *
- * @return True if the given string is in this table
- */
- public final boolean contains(String key)
- {
-
- for (int i = 0; i < m_firstFree; i += 2)
- {
- if (m_map[i].equals(key))
- return true;
- }
-
- return false;
- }
-
- /**
- * Tell if the table contains the given string.
- *
- * @param val value to look up
- *
- * @return True if the given value is in the table.
- */
- public final boolean containsValue(String val)
- {
-
- for (int i = 1; i < m_firstFree; i += 2)
- {
- if (m_map[i].equals(val))
- return true;
- }
-
- return false;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/StringToStringTableVector.java b/src/com/sun/org/apache/xml/internal/utils/StringToStringTableVector.java
deleted file mode 100644
index 1eeec4c..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/StringToStringTableVector.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: StringToStringTableVector.java,v 1.2.4.1 2005/09/15 08:15:56 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-/**
- * A very simple table that stores a list of StringToStringTables, optimized
- * for small lists.
- * @xsl.usage internal
- */
-public class StringToStringTableVector
-{
-
- /** Size of blocks to allocate */
- private int m_blocksize;
-
- /** Array of StringToStringTable objects */
- private StringToStringTable m_map[];
-
- /** Number of StringToStringTable objects in this array */
- private int m_firstFree = 0;
-
- /** Size of this array */
- private int m_mapSize;
-
- /**
- * Default constructor. Note that the default
- * block size is very small, for small lists.
- */
- public StringToStringTableVector()
- {
-
- m_blocksize = 8;
- m_mapSize = m_blocksize;
- m_map = new StringToStringTable[m_blocksize];
- }
-
- /**
- * Construct a StringToStringTableVector, using the given block size.
- *
- * @param blocksize Size of blocks to allocate
- */
- public StringToStringTableVector(int blocksize)
- {
-
- m_blocksize = blocksize;
- m_mapSize = blocksize;
- m_map = new StringToStringTable[blocksize];
- }
-
- /**
- * Get the length of the list.
- *
- * @return Number of StringToStringTable objects in the list
- */
- public final int getLength()
- {
- return m_firstFree;
- }
-
- /**
- * Get the length of the list.
- *
- * @return Number of StringToStringTable objects in the list
- */
- public final int size()
- {
- return m_firstFree;
- }
-
- /**
- * Append a StringToStringTable object onto the vector.
- *
- * @param value StringToStringTable object to add
- */
- public final void addElement(StringToStringTable value)
- {
-
- if ((m_firstFree + 1) >= m_mapSize)
- {
- m_mapSize += m_blocksize;
-
- StringToStringTable newMap[] = new StringToStringTable[m_mapSize];
-
- System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);
-
- m_map = newMap;
- }
-
- m_map[m_firstFree] = value;
-
- m_firstFree++;
- }
-
- /**
- * Given a string, find the last added occurance value
- * that matches the key.
- *
- * @param key String to look up
- *
- * @return the last added occurance value that matches the key
- * or null if not found.
- */
- public final String get(String key)
- {
-
- for (int i = m_firstFree - 1; i >= 0; --i)
- {
- String nsuri = m_map[i].get(key);
-
- if (nsuri != null)
- return nsuri;
- }
-
- return null;
- }
-
- /**
- * Given a string, find out if there is a value in this table
- * that matches the key.
- *
- * @param key String to look for
- *
- * @return True if the string was found in table, null if not
- */
- public final boolean containsKey(String key)
- {
-
- for (int i = m_firstFree - 1; i >= 0; --i)
- {
- if (m_map[i].get(key) != null)
- return true;
- }
-
- return false;
- }
-
- /**
- * Remove the last element.
- */
- public final void removeLastElem()
- {
-
- if (m_firstFree > 0)
- {
- m_map[m_firstFree] = null;
-
- m_firstFree--;
- }
- }
-
- /**
- * Get the nth element.
- *
- * @param i Index of element to find
- *
- * @return The StringToStringTable object at the given index
- */
- public final StringToStringTable elementAt(int i)
- {
- return m_map[i];
- }
-
- /**
- * Tell if the table contains the given StringToStringTable.
- *
- * @param s The StringToStringTable to find
- *
- * @return True if the StringToStringTable is found
- */
- public final boolean contains(StringToStringTable s)
- {
-
- for (int i = 0; i < m_firstFree; i++)
- {
- if (m_map[i].equals(s))
- return true;
- }
-
- return false;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/StringVector.java b/src/com/sun/org/apache/xml/internal/utils/StringVector.java
deleted file mode 100644
index 0acbbc1..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/StringVector.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: StringVector.java,v 1.2.4.1 2005/09/15 08:15:56 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-/**
- * A very simple table that stores a list of strings, optimized
- * for small lists.
- * @xsl.usage internal
- */
-public class StringVector implements java.io.Serializable
-{
- static final long serialVersionUID = 4995234972032919748L;
-
- /** @serial Size of blocks to allocate */
- protected int m_blocksize;
-
- /** @serial Array of strings this contains */
- protected String m_map[];
-
- /** @serial Number of strings this contains */
- protected int m_firstFree = 0;
-
- /** @serial Size of the array */
- protected int m_mapSize;
-
- /**
- * Default constructor. Note that the default
- * block size is very small, for small lists.
- */
- public StringVector()
- {
-
- m_blocksize = 8;
- m_mapSize = m_blocksize;
- m_map = new String[m_blocksize];
- }
-
- /**
- * Construct a StringVector, using the given block size.
- *
- * @param blocksize Size of the blocks to allocate
- */
- public StringVector(int blocksize)
- {
-
- m_blocksize = blocksize;
- m_mapSize = blocksize;
- m_map = new String[blocksize];
- }
-
- /**
- * Get the length of the list.
- *
- * @return Number of strings in the list
- */
- public int getLength()
- {
- return m_firstFree;
- }
-
- /**
- * Get the length of the list.
- *
- * @return Number of strings in the list
- */
- public final int size()
- {
- return m_firstFree;
- }
-
- /**
- * Append a string onto the vector.
- *
- * @param value Sting to add to the vector
- */
- public final void addElement(String value)
- {
-
- if ((m_firstFree + 1) >= m_mapSize)
- {
- m_mapSize += m_blocksize;
-
- String newMap[] = new String[m_mapSize];
-
- System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);
-
- m_map = newMap;
- }
-
- m_map[m_firstFree] = value;
-
- m_firstFree++;
- }
-
- /**
- * Get the nth element.
- *
- * @param i Index of string to find
- *
- * @return String at given index
- */
- public final String elementAt(int i)
- {
- return m_map[i];
- }
-
- /**
- * Tell if the table contains the given string.
- *
- * @param s String to look for
- *
- * @return True if the string is in this table
- */
- public final boolean contains(String s)
- {
-
- if (null == s)
- return false;
-
- for (int i = 0; i < m_firstFree; i++)
- {
- if (m_map[i].equals(s))
- return true;
- }
-
- return false;
- }
-
- /**
- * Tell if the table contains the given string. Ignore case.
- *
- * @param s String to find
- *
- * @return True if the String is in this vector
- */
- public final boolean containsIgnoreCase(String s)
- {
-
- if (null == s)
- return false;
-
- for (int i = 0; i < m_firstFree; i++)
- {
- if (m_map[i].equalsIgnoreCase(s))
- return true;
- }
-
- return false;
- }
-
- /**
- * Tell if the table contains the given string.
- *
- * @param s String to push into the vector
- */
- public final void push(String s)
- {
-
- if ((m_firstFree + 1) >= m_mapSize)
- {
- m_mapSize += m_blocksize;
-
- String newMap[] = new String[m_mapSize];
-
- System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);
-
- m_map = newMap;
- }
-
- m_map[m_firstFree] = s;
-
- m_firstFree++;
- }
-
- /**
- * Pop the tail of this vector.
- *
- * @return The String last added to this vector or null not found.
- * The string is removed from the vector.
- */
- public final String pop()
- {
-
- if (m_firstFree <= 0)
- return null;
-
- m_firstFree--;
-
- String s = m_map[m_firstFree];
-
- m_map[m_firstFree] = null;
-
- return s;
- }
-
- /**
- * Get the string at the tail of this vector without popping.
- *
- * @return The string at the tail of this vector.
- */
- public final String peek()
- {
- return (m_firstFree <= 0) ? null : m_map[m_firstFree - 1];
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/StylesheetPIHandler.java b/src/com/sun/org/apache/xml/internal/utils/StylesheetPIHandler.java
deleted file mode 100644
index 812730f..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/StylesheetPIHandler.java
+++ /dev/null
@@ -1,342 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: StylesheetPIHandler.java,v 1.2.4.1 2005/09/15 08:15:57 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-import java.util.StringTokenizer;
-import java.util.Vector;
-
-import javax.xml.transform.Source;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.URIResolver;
-import javax.xml.transform.sax.SAXSource;
-
-import com.sun.org.apache.xml.internal.utils.SystemIDResolver;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.InputSource;
-import org.xml.sax.helpers.DefaultHandler;
-
-/**
- * Search for the xml-stylesheet processing instructions in an XML document.
- * @see <a href="http://www.w3.org/TR/xml-stylesheet/">Associating Style Sheets with XML documents, Version 1.0</a>
- */
-public class StylesheetPIHandler extends DefaultHandler
-{
- /** The baseID of the document being processed. */
- String m_baseID;
-
- /** The desired media criteria. */
- String m_media;
-
- /** The desired title criteria. */
- String m_title;
-
- /** The desired character set criteria. */
- String m_charset;
-
- /** A list of SAXSource objects that match the criteria. */
- Vector m_stylesheets = new Vector();
-
- // Add code to use a URIResolver. Patch from Dmitri Ilyin.
-
- /**
- * The object that implements the URIResolver interface,
- * or null.
- */
- URIResolver m_uriResolver;
-
- /**
- * Get the object that will be used to resolve URIs in href
- * in xml-stylesheet processing instruction.
- *
- * @param resolver An object that implements the URIResolver interface,
- * or null.
- */
- public void setURIResolver(URIResolver resolver)
- {
- m_uriResolver = resolver;
- }
-
- /**
- * Get the object that will be used to resolve URIs in href
- * in xml-stylesheet processing instruction.
- *
- * @return The URIResolver that was set with setURIResolver.
- */
- public URIResolver getURIResolver()
- {
- return m_uriResolver;
- }
-
- /**
- * Construct a StylesheetPIHandler instance that will search
- * for xml-stylesheet PIs based on the given criteria.
- *
- * @param baseID The base ID of the XML document, needed to resolve
- * relative IDs.
- * @param media The desired media criteria.
- * @param title The desired title criteria.
- * @param charset The desired character set criteria.
- */
- public StylesheetPIHandler(String baseID, String media, String title,
- String charset)
- {
-
- m_baseID = baseID;
- m_media = media;
- m_title = title;
- m_charset = charset;
- }
-
- /**
- * Return the last stylesheet found that match the constraints.
- *
- * @return Source object that references the last stylesheet reference
- * that matches the constraints.
- */
- public Source getAssociatedStylesheet()
- {
-
- int sz = m_stylesheets.size();
-
- if (sz > 0)
- {
- Source source = (Source) m_stylesheets.elementAt(sz-1);
- return source;
- }
- else
- return null;
- }
-
- /**
- * Handle the xml-stylesheet processing instruction.
- *
- * @param target The processing instruction target.
- * @param data The processing instruction data, or null if
- * none is supplied.
- * @throws org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ContentHandler#processingInstruction
- * @see <a href="http://www.w3.org/TR/xml-stylesheet/">Associating Style Sheets with XML documents, Version 1.0</a>
- */
- public void processingInstruction(String target, String data)
- throws org.xml.sax.SAXException
- {
-
- if (target.equals("xml-stylesheet"))
- {
- String href = null; // CDATA #REQUIRED
- String type = null; // CDATA #REQUIRED
- String title = null; // CDATA #IMPLIED
- String media = null; // CDATA #IMPLIED
- String charset = null; // CDATA #IMPLIED
- boolean alternate = false; // (yes|no) "no"
- StringTokenizer tokenizer = new StringTokenizer(data, " \t=\n", true);
- boolean lookedAhead = false;
- Source source = null;
-
- String token = "";
- while (tokenizer.hasMoreTokens())
- {
- if (!lookedAhead)
- token = tokenizer.nextToken();
- else
- lookedAhead = false;
- if (tokenizer.hasMoreTokens() &&
- (token.equals(" ") || token.equals("\t") || token.equals("=")))
- continue;
-
- String name = token;
- if (name.equals("type"))
- {
- token = tokenizer.nextToken();
- while (tokenizer.hasMoreTokens() &&
- (token.equals(" " ) || token.equals("\t") || token.equals("=")))
- token = tokenizer.nextToken();
- type = token.substring(1, token.length() - 1);
-
- }
- else if (name.equals("href"))
- {
- token = tokenizer.nextToken();
- while (tokenizer.hasMoreTokens() &&
- (token.equals(" " ) || token.equals("\t") || token.equals("=")))
- token = tokenizer.nextToken();
- href = token;
- if (tokenizer.hasMoreTokens())
- {
- token = tokenizer.nextToken();
- // If the href value has parameters to be passed to a
- // servlet(something like "foobar?id=12..."),
- // we want to make sure we get them added to
- // the href value. Without this check, we would move on
- // to try to process another attribute and that would be
- // wrong.
- // We need to set lookedAhead here to flag that we
- // already have the next token.
- while ( token.equals("=") && tokenizer.hasMoreTokens())
- {
- href = href + token + tokenizer.nextToken();
- if (tokenizer.hasMoreTokens())
- {
- token = tokenizer.nextToken();
- lookedAhead = true;
- }
- else
- {
- break;
- }
- }
- }
- href = href.substring(1, href.length() - 1);
- try
- {
- // Add code to use a URIResolver. Patch from Dmitri Ilyin.
- if (m_uriResolver != null)
- {
- source = m_uriResolver.resolve(href, m_baseID);
- }
- else
- {
- href = SystemIDResolver.getAbsoluteURI(href, m_baseID);
- source = new SAXSource(new InputSource(href));
- }
- }
- catch(TransformerException te)
- {
- throw new org.xml.sax.SAXException(te);
- }
- }
- else if (name.equals("title"))
- {
- token = tokenizer.nextToken();
- while (tokenizer.hasMoreTokens() &&
- (token.equals(" " ) || token.equals("\t") || token.equals("=")))
- token = tokenizer.nextToken();
- title = token.substring(1, token.length() - 1);
- }
- else if (name.equals("media"))
- {
- token = tokenizer.nextToken();
- while (tokenizer.hasMoreTokens() &&
- (token.equals(" " ) || token.equals("\t") || token.equals("=")))
- token = tokenizer.nextToken();
- media = token.substring(1, token.length() - 1);
- }
- else if (name.equals("charset"))
- {
- token = tokenizer.nextToken();
- while (tokenizer.hasMoreTokens() &&
- (token.equals(" " ) || token.equals("\t") || token.equals("=")))
- token = tokenizer.nextToken();
- charset = token.substring(1, token.length() - 1);
- }
- else if (name.equals("alternate"))
- {
- token = tokenizer.nextToken();
- while (tokenizer.hasMoreTokens() &&
- (token.equals(" " ) || token.equals("\t") || token.equals("=")))
- token = tokenizer.nextToken();
- alternate = token.substring(1, token.length()
- - 1).equals("yes");
- }
-
- }
-
- if ((null != type)
- && (type.equals("text/xsl") || type.equals("text/xml") || type.equals("application/xml+xslt"))
- && (null != href))
- {
- if (null != m_media)
- {
- if (null != media)
- {
- if (!media.equals(m_media))
- return;
- }
- else
- return;
- }
-
- if (null != m_charset)
- {
- if (null != charset)
- {
- if (!charset.equals(m_charset))
- return;
- }
- else
- return;
- }
-
- if (null != m_title)
- {
- if (null != title)
- {
- if (!title.equals(m_title))
- return;
- }
- else
- return;
- }
-
- m_stylesheets.addElement(source);
- }
- }
- }
-
-
- /**
- * The spec notes that "The xml-stylesheet processing instruction is allowed only in the prolog of an XML document.",
- * so, at least for right now, I'm going to go ahead an throw a TransformerException
- * in order to stop the parse.
- *
- * @param namespaceURI The Namespace URI, or an empty string.
- * @param localName The local name (without prefix), or empty string if not namespace processing.
- * @param qName The qualified name (with prefix).
- * @param atts The specified or defaulted attributes.
- *
- * @throws StopParseException since there can be no valid xml-stylesheet processing
- * instructions past the first element.
- */
- public void startElement(
- String namespaceURI, String localName, String qName, Attributes atts)
- throws org.xml.sax.SAXException
- {
- throw new StopParseException();
- }
-
- /**
- * Added additional getter and setter methods for the Base Id
- * to fix bugzilla bug 24187
- *
- */
- public void setBaseId(String baseId) {
- m_baseID = baseId;
-
- }
- public String getBaseId() {
- return m_baseID ;
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/SuballocatedByteVector.java b/src/com/sun/org/apache/xml/internal/utils/SuballocatedByteVector.java
deleted file mode 100644
index 563886e..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/SuballocatedByteVector.java
+++ /dev/null
@@ -1,500 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: SuballocatedByteVector.java,v 1.2.4.1 2005/09/15 08:15:57 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-/**
- * A very simple table that stores a list of byte. Very similar API to our
- * IntVector class (same API); different internal storage.
- *
- * This version uses an array-of-arrays solution. Read/write access is thus
- * a bit slower than the simple IntVector, and basic storage is a trifle
- * higher due to the top-level array -- but appending is O(1) fast rather
- * than O(N**2) slow, which will swamp those costs in situations where
- * long vectors are being built up.
- *
- * Known issues:
- *
- * Some methods are private because they haven't yet been tested properly.
- *
- * If an element has not been set (because we skipped it), its value will
- * initially be 0. Shortening the vector does not clear old storage; if you
- * then skip values and setElementAt a higher index again, you may see old data
- * reappear in the truncated-and-restored section. Doing anything else would
- * have performance costs.
- * @xsl.usage internal
- */
-public class SuballocatedByteVector
-{
- /** Size of blocks to allocate */
- protected int m_blocksize;
-
- /** Number of blocks to (over)allocate by */
- protected int m_numblocks=32;
-
- /** Array of arrays of bytes */
- protected byte m_map[][];
-
- /** Number of bytes in array */
- protected int m_firstFree = 0;
-
- /** "Shortcut" handle to m_map[0] */
- protected byte m_map0[];
-
- /**
- * Default constructor. Note that the default
- * block size is very small, for small lists.
- */
- public SuballocatedByteVector()
- {
- this(2048);
- }
-
- /**
- * Construct a ByteVector, using the given block size.
- *
- * @param blocksize Size of block to allocate
- */
- public SuballocatedByteVector(int blocksize)
- {
- m_blocksize = blocksize;
- m_map0=new byte[blocksize];
- m_map = new byte[m_numblocks][];
- m_map[0]=m_map0;
- }
-
- /**
- * Construct a ByteVector, using the given block size.
- *
- * @param blocksize Size of block to allocate
- */
- public SuballocatedByteVector(int blocksize, int increaseSize)
- {
- // increaseSize not currently used.
- this(blocksize);
- }
-
-
- /**
- * Get the length of the list.
- *
- * @return length of the list
- */
- public int size()
- {
- return m_firstFree;
- }
-
- /**
- * Set the length of the list.
- *
- * @return length of the list
- */
- private void setSize(int sz)
- {
- if(m_firstFree<sz)
- m_firstFree = sz;
- }
-
- /**
- * Append a byte onto the vector.
- *
- * @param value Byte to add to the list
- */
- public void addElement(byte value)
- {
- if(m_firstFree<m_blocksize)
- m_map0[m_firstFree++]=value;
- else
- {
- int index=m_firstFree/m_blocksize;
- int offset=m_firstFree%m_blocksize;
- ++m_firstFree;
-
- if(index>=m_map.length)
- {
- int newsize=index+m_numblocks;
- byte[][] newMap=new byte[newsize][];
- System.arraycopy(m_map, 0, newMap, 0, m_map.length);
- m_map=newMap;
- }
- byte[] block=m_map[index];
- if(null==block)
- block=m_map[index]=new byte[m_blocksize];
- block[offset]=value;
- }
- }
-
- /**
- * Append several byte values onto the vector.
- *
- * @param value Byte to add to the list
- */
- private void addElements(byte value, int numberOfElements)
- {
- if(m_firstFree+numberOfElements<m_blocksize)
- for (int i = 0; i < numberOfElements; i++)
- {
- m_map0[m_firstFree++]=value;
- }
- else
- {
- int index=m_firstFree/m_blocksize;
- int offset=m_firstFree%m_blocksize;
- m_firstFree+=numberOfElements;
- while( numberOfElements>0)
- {
- if(index>=m_map.length)
- {
- int newsize=index+m_numblocks;
- byte[][] newMap=new byte[newsize][];
- System.arraycopy(m_map, 0, newMap, 0, m_map.length);
- m_map=newMap;
- }
- byte[] block=m_map[index];
- if(null==block)
- block=m_map[index]=new byte[m_blocksize];
- int copied=(m_blocksize-offset < numberOfElements)
- ? m_blocksize-offset : numberOfElements;
- numberOfElements-=copied;
- while(copied-- > 0)
- block[offset++]=value;
-
- ++index;offset=0;
- }
- }
- }
-
- /**
- * Append several slots onto the vector, but do not set the values.
- * Note: "Not Set" means the value is unspecified.
- *
- * @param numberOfElements
- */
- private void addElements(int numberOfElements)
- {
- int newlen=m_firstFree+numberOfElements;
- if(newlen>m_blocksize)
- {
- int index=m_firstFree%m_blocksize;
- int newindex=(m_firstFree+numberOfElements)%m_blocksize;
- for(int i=index+1;i<=newindex;++i)
- m_map[i]=new byte[m_blocksize];
- }
- m_firstFree=newlen;
- }
-
- /**
- * Inserts the specified node in this vector at the specified index.
- * Each component in this vector with an index greater or equal to
- * the specified index is shifted upward to have an index one greater
- * than the value it had previously.
- *
- * Insertion may be an EXPENSIVE operation!
- *
- * @param value Byte to insert
- * @param at Index of where to insert
- */
- private void insertElementAt(byte value, int at)
- {
- if(at==m_firstFree)
- addElement(value);
- else if (at>m_firstFree)
- {
- int index=at/m_blocksize;
- if(index>=m_map.length)
- {
- int newsize=index+m_numblocks;
- byte[][] newMap=new byte[newsize][];
- System.arraycopy(m_map, 0, newMap, 0, m_map.length);
- m_map=newMap;
- }
- byte[] block=m_map[index];
- if(null==block)
- block=m_map[index]=new byte[m_blocksize];
- int offset=at%m_blocksize;
- block[offset]=value;
- m_firstFree=offset+1;
- }
- else
- {
- int index=at/m_blocksize;
- int maxindex=m_firstFree+1/m_blocksize;
- ++m_firstFree;
- int offset=at%m_blocksize;
- byte push;
-
- // ***** Easier to work down from top?
- while(index<=maxindex)
- {
- int copylen=m_blocksize-offset-1;
- byte[] block=m_map[index];
- if(null==block)
- {
- push=0;
- block=m_map[index]=new byte[m_blocksize];
- }
- else
- {
- push=block[m_blocksize-1];
- System.arraycopy(block, offset , block, offset+1, copylen);
- }
- block[offset]=value;
- value=push;
- offset=0;
- ++index;
- }
- }
- }
-
- /**
- * Wipe it out.
- */
- public void removeAllElements()
- {
- m_firstFree = 0;
- }
-
- /**
- * Removes the first occurrence of the argument from this vector.
- * If the object is found in this vector, each component in the vector
- * with an index greater or equal to the object's index is shifted
- * downward to have an index one smaller than the value it had
- * previously.
- *
- * @param s Byte to remove from array
- *
- * @return True if the byte was removed, false if it was not found
- */
- private boolean removeElement(byte s)
- {
- int at=indexOf(s,0);
- if(at<0)
- return false;
- removeElementAt(at);
- return true;
- }
-
- /**
- * Deletes the component at the specified index. Each component in
- * this vector with an index greater or equal to the specified
- * index is shifted downward to have an index one smaller than
- * the value it had previously.
- *
- * @param at index of where to remove a byte
- */
- private void removeElementAt(int at)
- {
- // No point in removing elements that "don't exist"...
- if(at<m_firstFree)
- {
- int index=at/m_blocksize;
- int maxindex=m_firstFree/m_blocksize;
- int offset=at%m_blocksize;
-
- while(index<=maxindex)
- {
- int copylen=m_blocksize-offset-1;
- byte[] block=m_map[index];
- if(null==block)
- block=m_map[index]=new byte[m_blocksize];
- else
- System.arraycopy(block, offset+1, block, offset, copylen);
- if(index<maxindex)
- {
- byte[] next=m_map[index+1];
- if(next!=null)
- block[m_blocksize-1]=(next!=null) ? next[0] : 0;
- }
- else
- block[m_blocksize-1]=0;
- offset=0;
- ++index;
- }
- }
- --m_firstFree;
- }
-
- /**
- * Sets the component at the specified index of this vector to be the
- * specified object. The previous component at that position is discarded.
- *
- * The index must be a value greater than or equal to 0 and less
- * than the current size of the vector.
- *
- * @param value
- * @param at Index of where to set the object
- */
- public void setElementAt(byte value, int at)
- {
- if(at<m_blocksize)
- {
- m_map0[at]=value;
- return;
- }
-
- int index=at/m_blocksize;
- int offset=at%m_blocksize;
-
- if(index>=m_map.length)
- {
- int newsize=index+m_numblocks;
- byte[][] newMap=new byte[newsize][];
- System.arraycopy(m_map, 0, newMap, 0, m_map.length);
- m_map=newMap;
- }
-
- byte[] block=m_map[index];
- if(null==block)
- block=m_map[index]=new byte[m_blocksize];
- block[offset]=value;
-
- if(at>=m_firstFree)
- m_firstFree=at+1;
- }
-
- /**
- * Get the nth element. This is often at the innermost loop of an
- * application, so performance is critical.
- *
- * @param i index of value to get
- *
- * @return value at given index. If that value wasn't previously set,
- * the result is undefined for performance reasons. It may throw an
- * exception (see below), may return zero, or (if setSize has previously
- * been used) may return stale data.
- *
- * @throws ArrayIndexOutOfBoundsException if the index was _clearly_
- * unreasonable (negative, or past the highest block).
- *
- * @throws NullPointerException if the index points to a block that could
- * have existed (based on the highest index used) but has never had anything
- * set into it.
- * %REVIEW% Could add a catch to create the block in that case, or return 0.
- * Try/Catch is _supposed_ to be nearly free when not thrown to. Do we
- * believe that? Should we have a separate safeElementAt?
- */
- public byte elementAt(int i)
- {
- // %OPT% Does this really buy us anything? Test versus division for small,
- // test _plus_ division for big docs.
- if(i<m_blocksize)
- return m_map0[i];
-
- return m_map[i/m_blocksize][i%m_blocksize];
- }
-
- /**
- * Tell if the table contains the given node.
- *
- * @param s object to look for
- *
- * @return true if the object is in the list
- */
- private boolean contains(byte s)
- {
- return (indexOf(s,0) >= 0);
- }
-
- /**
- * Searches for the first occurence of the given argument,
- * beginning the search at index, and testing for equality
- * using the equals method.
- *
- * @param elem object to look for
- * @param index Index of where to begin search
- * @return the index of the first occurrence of the object
- * argument in this vector at position index or later in the
- * vector; returns -1 if the object is not found.
- */
- public int indexOf(byte elem, int index)
- {
- if(index>=m_firstFree)
- return -1;
-
- int bindex=index/m_blocksize;
- int boffset=index%m_blocksize;
- int maxindex=m_firstFree/m_blocksize;
- byte[] block;
-
- for(;bindex<maxindex;++bindex)
- {
- block=m_map[bindex];
- if(block!=null)
- for(int offset=boffset;offset<m_blocksize;++offset)
- if(block[offset]==elem)
- return offset+bindex*m_blocksize;
- boffset=0; // after first
- }
- // Last block may need to stop before end
- int maxoffset=m_firstFree%m_blocksize;
- block=m_map[maxindex];
- for(int offset=boffset;offset<maxoffset;++offset)
- if(block[offset]==elem)
- return offset+maxindex*m_blocksize;
-
- return -1;
- }
-
- /**
- * Searches for the first occurence of the given argument,
- * beginning the search at index, and testing for equality
- * using the equals method.
- *
- * @param elem object to look for
- * @return the index of the first occurrence of the object
- * argument in this vector at position index or later in the
- * vector; returns -1 if the object is not found.
- */
- public int indexOf(byte elem)
- {
- return indexOf(elem,0);
- }
-
- /**
- * Searches for the first occurence of the given argument,
- * beginning the search at index, and testing for equality
- * using the equals method.
- *
- * @param elem Object to look for
- * @return the index of the first occurrence of the object
- * argument in this vector at position index or later in the
- * vector; returns -1 if the object is not found.
- */
- private int lastIndexOf(byte elem)
- {
- int boffset=m_firstFree%m_blocksize;
- for(int index=m_firstFree/m_blocksize;
- index>=0;
- --index)
- {
- byte[] block=m_map[index];
- if(block!=null)
- for(int offset=boffset; offset>=0; --offset)
- if(block[offset]==elem)
- return offset+index*m_blocksize;
- boffset=0; // after first
- }
- return -1;
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/SuballocatedIntVector.java b/src/com/sun/org/apache/xml/internal/utils/SuballocatedIntVector.java
deleted file mode 100644
index 4032302..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/SuballocatedIntVector.java
+++ /dev/null
@@ -1,559 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: SuballocatedIntVector.java,v 1.3 2005/09/28 13:49:22 pvedula Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-/**
- * A very simple table that stores a list of int. Very similar API to our
- * IntVector class (same API); different internal storage.
- *
- * This version uses an array-of-arrays solution. Read/write access is thus
- * a bit slower than the simple IntVector, and basic storage is a trifle
- * higher due to the top-level array -- but appending is O(1) fast rather
- * than O(N**2) slow, which will swamp those costs in situations where
- * long vectors are being built up.
- *
- * Known issues:
- *
- * Some methods are private because they haven't yet been tested properly.
- *
- * Retrieval performance is critical, since this is used at the core
- * of the DTM model. (Append performance is almost as important.)
- * That's pushing me toward just letting reads from unset indices
- * throw exceptions or return stale data; safer behavior would have
- * performance costs.
- * */
-public class SuballocatedIntVector
-{
- /** Size of blocks to allocate */
- protected int m_blocksize;
-
- /** Bitwise addressing (much faster than div/remainder */
- protected int m_SHIFT, m_MASK;
-
- /** The default number of blocks to (over)allocate by */
- protected static final int NUMBLOCKS_DEFAULT = 32;
-
- /** The number of blocks to (over)allocate by */
- protected int m_numblocks = NUMBLOCKS_DEFAULT;
-
- /** Array of arrays of ints */
- protected int m_map[][];
-
- /** Number of ints in array */
- protected int m_firstFree = 0;
-
- /** "Shortcut" handle to m_map[0]. Surprisingly helpful for short vectors. */
- protected int m_map0[];
-
- /** "Shortcut" handle to most recently added row of m_map.
- * Very helpful during construction.
- * @xsl.usage internal
- */
- protected int m_buildCache[];
- protected int m_buildCacheStartIndex;
-
-
- /**
- * Default constructor. Note that the default
- * block size is currently 2K, which may be overkill for
- * small lists and undershootng for large ones.
- */
- public SuballocatedIntVector()
- {
- this(2048);
- }
-
- /**
- * Construct a IntVector, using the given block size and number
- * of blocks. For efficiency, we will round the requested size
- * off to a power of two.
- *
- * @param blocksize Size of block to allocate
- * @param numblocks Number of blocks to allocate
- * */
- public SuballocatedIntVector(int blocksize, int numblocks)
- {
- //m_blocksize = blocksize;
- for(m_SHIFT=0;0!=(blocksize>>>=1);++m_SHIFT)
- ;
- m_blocksize=1<<m_SHIFT;
- m_MASK=m_blocksize-1;
- m_numblocks = numblocks;
-
- m_map0=new int[m_blocksize];
- m_map = new int[numblocks][];
- m_map[0]=m_map0;
- m_buildCache = m_map0;
- m_buildCacheStartIndex = 0;
- }
-
- /** Construct a IntVector, using the given block size and
- * the default number of blocks (32).
- *
- * @param blocksize Size of block to allocate
- * */
- public SuballocatedIntVector(int blocksize)
- {
- this(blocksize, NUMBLOCKS_DEFAULT);
- }
-
- /**
- * Get the length of the list.
- *
- * @return length of the list
- */
- public int size()
- {
- return m_firstFree;
- }
-
- /**
- * Set the length of the list. This will only work to truncate the list, and
- * even then it has not been heavily tested and may not be trustworthy.
- *
- * @return length of the list
- */
- public void setSize(int sz)
- {
- if(m_firstFree>sz) // Whups; had that backward!
- m_firstFree = sz;
- }
-
- /**
- * Append a int onto the vector.
- *
- * @param value Int to add to the list
- */
- public void addElement(int value)
- {
- int indexRelativeToCache = m_firstFree - m_buildCacheStartIndex;
-
- // Is the new index an index into the cache row of m_map?
- if(indexRelativeToCache >= 0 && indexRelativeToCache < m_blocksize) {
- m_buildCache[indexRelativeToCache]=value;
- ++m_firstFree;
- } else {
- // Growing the outer array should be rare. We initialize to a
- // total of m_blocksize squared elements, which at the default
- // size is 4M integers... and we grow by at least that much each
- // time. However, attempts to microoptimize for this (assume
- // long enough and catch exceptions) yield no noticable
- // improvement.
-
- int index=m_firstFree>>>m_SHIFT;
- int offset=m_firstFree&m_MASK;
-
- if(index>=m_map.length)
- {
- int newsize=index+m_numblocks;
- int[][] newMap=new int[newsize][];
- System.arraycopy(m_map, 0, newMap, 0, m_map.length);
- m_map=newMap;
- }
- int[] block=m_map[index];
- if(null==block)
- block=m_map[index]=new int[m_blocksize];
- block[offset]=value;
-
- // Cache the current row of m_map. Next m_blocksize-1
- // values added will go to this row.
- m_buildCache = block;
- m_buildCacheStartIndex = m_firstFree-offset;
-
- ++m_firstFree;
- }
- }
-
- /**
- * Append several int values onto the vector.
- *
- * @param value Int to add to the list
- */
- private void addElements(int value, int numberOfElements)
- {
- if(m_firstFree+numberOfElements<m_blocksize)
- for (int i = 0; i < numberOfElements; i++)
- {
- m_map0[m_firstFree++]=value;
- }
- else
- {
- int index=m_firstFree>>>m_SHIFT;
- int offset=m_firstFree&m_MASK;
- m_firstFree+=numberOfElements;
- while( numberOfElements>0)
- {
- if(index>=m_map.length)
- {
- int newsize=index+m_numblocks;
- int[][] newMap=new int[newsize][];
- System.arraycopy(m_map, 0, newMap, 0, m_map.length);
- m_map=newMap;
- }
- int[] block=m_map[index];
- if(null==block)
- block=m_map[index]=new int[m_blocksize];
- int copied=(m_blocksize-offset < numberOfElements)
- ? m_blocksize-offset : numberOfElements;
- numberOfElements-=copied;
- while(copied-- > 0)
- block[offset++]=value;
-
- ++index;offset=0;
- }
- }
- }
-
- /**
- * Append several slots onto the vector, but do not set the values.
- * Note: "Not Set" means the value is unspecified.
- *
- * @param numberOfElements Int to add to the list
- */
- private void addElements(int numberOfElements)
- {
- int newlen=m_firstFree+numberOfElements;
- if(newlen>m_blocksize)
- {
- int index=m_firstFree>>>m_SHIFT;
- int newindex=(m_firstFree+numberOfElements)>>>m_SHIFT;
- for(int i=index+1;i<=newindex;++i)
- m_map[i]=new int[m_blocksize];
- }
- m_firstFree=newlen;
- }
-
- /**
- * Inserts the specified node in this vector at the specified index.
- * Each component in this vector with an index greater or equal to
- * the specified index is shifted upward to have an index one greater
- * than the value it had previously.
- *
- * Insertion may be an EXPENSIVE operation!
- *
- * @param value Int to insert
- * @param at Index of where to insert
- */
- private void insertElementAt(int value, int at)
- {
- if(at==m_firstFree)
- addElement(value);
- else if (at>m_firstFree)
- {
- int index=at>>>m_SHIFT;
- if(index>=m_map.length)
- {
- int newsize=index+m_numblocks;
- int[][] newMap=new int[newsize][];
- System.arraycopy(m_map, 0, newMap, 0, m_map.length);
- m_map=newMap;
- }
- int[] block=m_map[index];
- if(null==block)
- block=m_map[index]=new int[m_blocksize];
- int offset=at&m_MASK;
- block[offset]=value;
- m_firstFree=offset+1;
- }
- else
- {
- int index=at>>>m_SHIFT;
- int maxindex=m_firstFree>>>m_SHIFT; // %REVIEW% (m_firstFree+1?)
- ++m_firstFree;
- int offset=at&m_MASK;
- int push;
-
- // ***** Easier to work down from top?
- while(index<=maxindex)
- {
- int copylen=m_blocksize-offset-1;
- int[] block=m_map[index];
- if(null==block)
- {
- push=0;
- block=m_map[index]=new int[m_blocksize];
- }
- else
- {
- push=block[m_blocksize-1];
- System.arraycopy(block, offset , block, offset+1, copylen);
- }
- block[offset]=value;
- value=push;
- offset=0;
- ++index;
- }
- }
- }
-
- /**
- * Wipe it out. Currently defined as equivalent to setSize(0).
- */
- public void removeAllElements()
- {
- m_firstFree = 0;
- m_buildCache = m_map0;
- m_buildCacheStartIndex = 0;
- }
-
- /**
- * Removes the first occurrence of the argument from this vector.
- * If the object is found in this vector, each component in the vector
- * with an index greater or equal to the object's index is shifted
- * downward to have an index one smaller than the value it had
- * previously.
- *
- * @param s Int to remove from array
- *
- * @return True if the int was removed, false if it was not found
- */
- private boolean removeElement(int s)
- {
- int at=indexOf(s,0);
- if(at<0)
- return false;
- removeElementAt(at);
- return true;
- }
-
- /**
- * Deletes the component at the specified index. Each component in
- * this vector with an index greater or equal to the specified
- * index is shifted downward to have an index one smaller than
- * the value it had previously.
- *
- * @param at index of where to remove and int
- */
- private void removeElementAt(int at)
- {
- // No point in removing elements that "don't exist"...
- if(at<m_firstFree)
- {
- int index=at>>>m_SHIFT;
- int maxindex=m_firstFree>>>m_SHIFT;
- int offset=at&m_MASK;
-
- while(index<=maxindex)
- {
- int copylen=m_blocksize-offset-1;
- int[] block=m_map[index];
- if(null==block)
- block=m_map[index]=new int[m_blocksize];
- else
- System.arraycopy(block, offset+1, block, offset, copylen);
- if(index<maxindex)
- {
- int[] next=m_map[index+1];
- if(next!=null)
- block[m_blocksize-1]=(next!=null) ? next[0] : 0;
- }
- else
- block[m_blocksize-1]=0;
- offset=0;
- ++index;
- }
- }
- --m_firstFree;
- }
-
- /**
- * Sets the component at the specified index of this vector to be the
- * specified object. The previous component at that position is discarded.
- *
- * The index must be a value greater than or equal to 0 and less
- * than the current size of the vector.
- *
- * @param value object to set
- * @param at Index of where to set the object
- */
- public void setElementAt(int value, int at)
- {
- if(at<m_blocksize)
- m_map0[at]=value;
- else
- {
- int index=at>>>m_SHIFT;
- int offset=at&m_MASK;
-
- if(index>=m_map.length)
- {
- int newsize=index+m_numblocks;
- int[][] newMap=new int[newsize][];
- System.arraycopy(m_map, 0, newMap, 0, m_map.length);
- m_map=newMap;
- }
-
- int[] block=m_map[index];
- if(null==block)
- block=m_map[index]=new int[m_blocksize];
- block[offset]=value;
- }
-
- if(at>=m_firstFree)
- m_firstFree=at+1;
- }
-
-
- /**
- * Get the nth element. This is often at the innermost loop of an
- * application, so performance is critical.
- *
- * @param i index of value to get
- *
- * @return value at given index. If that value wasn't previously set,
- * the result is undefined for performance reasons. It may throw an
- * exception (see below), may return zero, or (if setSize has previously
- * been used) may return stale data.
- *
- * @throws ArrayIndexOutOfBoundsException if the index was _clearly_
- * unreasonable (negative, or past the highest block).
- *
- * @throws NullPointerException if the index points to a block that could
- * have existed (based on the highest index used) but has never had anything
- * set into it.
- * %REVIEW% Could add a catch to create the block in that case, or return 0.
- * Try/Catch is _supposed_ to be nearly free when not thrown to. Do we
- * believe that? Should we have a separate safeElementAt?
- */
- public int elementAt(int i)
- {
- // This is actually a significant optimization!
- if(i<m_blocksize)
- return m_map0[i];
-
- return m_map[i>>>m_SHIFT][i&m_MASK];
- }
-
- /**
- * Tell if the table contains the given node.
- *
- * @param s object to look for
- *
- * @return true if the object is in the list
- */
- private boolean contains(int s)
- {
- return (indexOf(s,0) >= 0);
- }
-
- /**
- * Searches for the first occurence of the given argument,
- * beginning the search at index, and testing for equality
- * using the equals method.
- *
- * @param elem object to look for
- * @param index Index of where to begin search
- * @return the index of the first occurrence of the object
- * argument in this vector at position index or later in the
- * vector; returns -1 if the object is not found.
- */
- public int indexOf(int elem, int index)
- {
- if(index>=m_firstFree)
- return -1;
-
- int bindex=index>>>m_SHIFT;
- int boffset=index&m_MASK;
- int maxindex=m_firstFree>>>m_SHIFT;
- int[] block;
-
- for(;bindex<maxindex;++bindex)
- {
- block=m_map[bindex];
- if(block!=null)
- for(int offset=boffset;offset<m_blocksize;++offset)
- if(block[offset]==elem)
- return offset+bindex*m_blocksize;
- boffset=0; // after first
- }
- // Last block may need to stop before end
- int maxoffset=m_firstFree&m_MASK;
- block=m_map[maxindex];
- for(int offset=boffset;offset<maxoffset;++offset)
- if(block[offset]==elem)
- return offset+maxindex*m_blocksize;
-
- return -1;
- }
-
- /**
- * Searches for the first occurence of the given argument,
- * beginning the search at index, and testing for equality
- * using the equals method.
- *
- * @param elem object to look for
- * @return the index of the first occurrence of the object
- * argument in this vector at position index or later in the
- * vector; returns -1 if the object is not found.
- */
- public int indexOf(int elem)
- {
- return indexOf(elem,0);
- }
-
- /**
- * Searches for the first occurence of the given argument,
- * beginning the search at index, and testing for equality
- * using the equals method.
- *
- * @param elem Object to look for
- * @return the index of the first occurrence of the object
- * argument in this vector at position index or later in the
- * vector; returns -1 if the object is not found.
- */
- private int lastIndexOf(int elem)
- {
- int boffset=m_firstFree&m_MASK;
- for(int index=m_firstFree>>>m_SHIFT;
- index>=0;
- --index)
- {
- int[] block=m_map[index];
- if(block!=null)
- for(int offset=boffset; offset>=0; --offset)
- if(block[offset]==elem)
- return offset+index*m_blocksize;
- boffset=0; // after first
- }
- return -1;
- }
-
- /**
- * Return the internal m_map0 array
- * @return the m_map0 array
- */
- public final int[] getMap0()
- {
- return m_map0;
- }
-
- /**
- * Return the m_map double array
- * @return the internal map of array of arrays
- */
- public final int[][] getMap()
- {
- return m_map;
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/SystemIDResolver.java b/src/com/sun/org/apache/xml/internal/utils/SystemIDResolver.java
deleted file mode 100644
index 7b6f53b..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/SystemIDResolver.java
+++ /dev/null
@@ -1,297 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: SystemIDResolver.java,v 1.2.4.1 2005/09/15 08:15:58 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-import java.io.File;
-
-import javax.xml.transform.TransformerException;
-
-import com.sun.org.apache.xml.internal.utils.URI.MalformedURIException;
-
-/**
- * This class is used to resolve relative URIs and SystemID
- * strings into absolute URIs.
- *
- * <p>This is a generic utility for resolving URIs, other than the
- * fact that it's declared to throw TransformerException. Please
- * see code comments for details on how resolution is performed.</p>
- * @xsl.usage internal
- */
-public class SystemIDResolver
-{
-
- /**
- * Get an absolute URI from a given relative URI (local path).
- *
- * <p>The relative URI is a local filesystem path. The path can be
- * absolute or relative. If it is a relative path, it is resolved relative
- * to the system property "user.dir" if it is available; if not (i.e. in an
- * Applet perhaps which throws SecurityException) then we just return the
- * relative path. The space and backslash characters are also replaced to
- * generate a good absolute URI.</p>
- *
- * @param localPath The relative URI to resolve
- *
- * @return Resolved absolute URI
- */
- public static String getAbsoluteURIFromRelative(String localPath)
- {
- if (localPath == null || localPath.length() == 0)
- return "";
-
- // If the local path is a relative path, then it is resolved against
- // the "user.dir" system property.
- String absolutePath = localPath;
- if (!isAbsolutePath(localPath))
- {
- try
- {
- absolutePath = getAbsolutePathFromRelativePath(localPath);
- }
- // user.dir not accessible from applet
- catch (SecurityException se)
- {
- return "file:" + localPath;
- }
- }
-
- String urlString;
- if (null != absolutePath)
- {
- if (absolutePath.startsWith(File.separator))
- urlString = "file://" + absolutePath;
- else
- urlString = "file:///" + absolutePath;
- }
- else
- urlString = "file:" + localPath;
-
- return replaceChars(urlString);
- }
-
- /**
- * Return an absolute path from a relative path.
- *
- * @param relativePath A relative path
- * @return The absolute path
- */
- private static String getAbsolutePathFromRelativePath(String relativePath)
- {
- return new File(relativePath).getAbsolutePath();
- }
-
- /**
- * Return true if the systemId denotes an absolute URI .
- *
- * @param systemId The systemId string
- * @return true if the systemId is an an absolute URI
- */
- public static boolean isAbsoluteURI(String systemId)
- {
- /** http://www.ietf.org/rfc/rfc2396.txt
- * Authors should be aware that a path segment which contains a colon
- * character cannot be used as the first segment of a relative URI path
- * (e.g., "this:that"), because it would be mistaken for a scheme name.
- **/
- /**
- * %REVIEW% Can we assume here that systemId is a valid URI?
- * It looks like we cannot ( See discussion of this common problem in
- * Bugzilla Bug 22777 ).
- **/
- //"fix" for Bugzilla Bug 22777
- if(isWindowsAbsolutePath(systemId)){
- return false;
- }
-
- final int fragmentIndex = systemId.indexOf('#');
- final int queryIndex = systemId.indexOf('?');
- final int slashIndex = systemId.indexOf('/');
- final int colonIndex = systemId.indexOf(':');
-
- //finding substring before '#', '?', and '/'
- int index = systemId.length() -1;
- if(fragmentIndex > 0)
- index = fragmentIndex;
- if((queryIndex > 0) && (queryIndex <index))
- index = queryIndex;
- if((slashIndex > 0) && (slashIndex <index))
- index = slashIndex;
- // return true if there is ':' before '#', '?', and '/'
- return ((colonIndex >0) && (colonIndex<index));
-
- }
-
- /**
- * Return true if the local path is an absolute path.
- *
- * @param systemId The path string
- * @return true if the path is absolute
- */
- public static boolean isAbsolutePath(String systemId)
- {
- if(systemId == null)
- return false;
- final File file = new File(systemId);
- return file.isAbsolute();
-
- }
-
- /**
- * Return true if the local path is a Windows absolute path.
- *
- * @param systemId The path string
- * @return true if the path is a Windows absolute path
- */
- private static boolean isWindowsAbsolutePath(String systemId)
- {
- if(!isAbsolutePath(systemId))
- return false;
- // On Windows, an absolute path starts with "[drive_letter]:\".
- if (systemId.length() > 2
- && systemId.charAt(1) == ':'
- && Character.isLetter(systemId.charAt(0))
- && (systemId.charAt(2) == '\\' || systemId.charAt(2) == '/'))
- return true;
- else
- return false;
- }
-
- /**
- * Replace spaces with "%20" and backslashes with forward slashes in
- * the input string to generate a well-formed URI string.
- *
- * @param str The input string
- * @return The string after conversion
- */
- private static String replaceChars(String str)
- {
- StringBuffer buf = new StringBuffer(str);
- int length = buf.length();
- for (int i = 0; i < length; i++)
- {
- char currentChar = buf.charAt(i);
- // Replace space with "%20"
- if (currentChar == ' ')
- {
- buf.setCharAt(i, '%');
- buf.insert(i+1, "20");
- length = length + 2;
- i = i + 2;
- }
- // Replace backslash with forward slash
- else if (currentChar == '\\')
- {
- buf.setCharAt(i, '/');
- }
- }
-
- return buf.toString();
- }
-
- /**
- * Take a SystemID string and try to turn it into a good absolute URI.
- *
- * @param systemId A URI string, which may be absolute or relative.
- *
- * @return The resolved absolute URI
- */
- public static String getAbsoluteURI(String systemId)
- {
- String absoluteURI = systemId;
- if (isAbsoluteURI(systemId))
- {
- // Only process the systemId if it starts with "file:".
- if (systemId.startsWith("file:"))
- {
- String str = systemId.substring(5);
-
- // Resolve the absolute path if the systemId starts with "file:///"
- // or "file:/". Don't do anything if it only starts with "file://".
- if (str != null && str.startsWith("/"))
- {
- if (str.startsWith("///") || !str.startsWith("//"))
- {
- // A Windows path containing a drive letter can be relative.
- // A Unix path starting with "file:/" is always absolute.
- int secondColonIndex = systemId.indexOf(':', 5);
- if (secondColonIndex > 0)
- {
- String localPath = systemId.substring(secondColonIndex-1);
- try {
- if (!isAbsolutePath(localPath))
- absoluteURI = systemId.substring(0, secondColonIndex-1) +
- getAbsolutePathFromRelativePath(localPath);
- }
- catch (SecurityException se) {
- return systemId;
- }
- }
- }
- }
- else
- {
- return getAbsoluteURIFromRelative(systemId.substring(5));
- }
-
- return replaceChars(absoluteURI);
- }
- else
- return systemId;
- }
- else
- return getAbsoluteURIFromRelative(systemId);
-
- }
-
-
- /**
- * Take a SystemID string and try to turn it into a good absolute URI.
- *
- * @param urlString SystemID string
- * @param base The URI string used as the base for resolving the systemID
- *
- * @return The resolved absolute URI
- * @throws TransformerException thrown if the string can't be turned into a URI.
- */
- public static String getAbsoluteURI(String urlString, String base)
- throws TransformerException
- {
- if (base == null)
- return getAbsoluteURI(urlString);
-
- String absoluteBase = getAbsoluteURI(base);
- URI uri = null;
- try
- {
- URI baseURI = new URI(absoluteBase);
- uri = new URI(baseURI, urlString);
- }
- catch (MalformedURIException mue)
- {
- throw new TransformerException(mue);
- }
-
- return replaceChars(uri.toString());
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/ThreadControllerWrapper.java b/src/com/sun/org/apache/xml/internal/utils/ThreadControllerWrapper.java
deleted file mode 100644
index 2dc8782..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/ThreadControllerWrapper.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ThreadControllerWrapper.java,v 1.2.4.1 2005/09/15 08:15:59 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-/**
- * A utility class that wraps the ThreadController, which is used
- * by IncrementalSAXSource for the incremental building of DTM.
- */
-public class ThreadControllerWrapper
-{
-
- /** The ThreadController pool */
- private static ThreadController m_tpool = new ThreadController();
-
- public static Thread runThread(Runnable runnable, int priority)
- {
- return m_tpool.run(runnable, priority);
- }
-
- public static void waitThread(Thread worker, Runnable task)
- throws InterruptedException
- {
- m_tpool.waitThread(worker, task);
- }
-
- /**
- * Thread controller utility class for incremental SAX source. Must
- * be overriden with a derived class to support thread pooling.
- *
- * All thread-related stuff is in this class.
- */
- public static class ThreadController
- {
-
- /**
- * This class was introduced as a fix for CR 6607339.
- */
- final class SafeThread extends Thread {
- private volatile boolean ran = false;
-
- public SafeThread(Runnable target) {
- super(target);
- }
-
- public final void run() {
- if (Thread.currentThread() != this) {
- throw new IllegalStateException("The run() method in a"
- + " SafeThread cannot be called from another thread.");
- }
- synchronized (this) {
- if (!ran) {
- ran = true;
- }
- else {
- throw new IllegalStateException("The run() method in a"
- + " SafeThread cannot be called more than once.");
- }
- }
- super.run();
- }
- }
-
- /**
- * Will get a thread from the pool, execute the task
- * and return the thread to the pool.
- *
- * The return value is used only to wait for completion
- *
- *
- * NEEDSDOC @param task
- * @param priority if >0 the task will run with the given priority
- * ( doesn't seem to be used in xalan, since it's allways the default )
- * @return The thread that is running the task, can be used
- * to wait for completion
- */
- public Thread run(Runnable task, int priority)
- {
-
- Thread t = new SafeThread(task);
-
- t.start();
-
- // if( priority > 0 )
- // t.setPriority( priority );
- return t;
- }
-
- /**
- * Wait until the task is completed on the worker
- * thread.
- *
- * NEEDSDOC @param worker
- * NEEDSDOC @param task
- *
- * @throws InterruptedException
- */
- public void waitThread(Thread worker, Runnable task)
- throws InterruptedException
- {
-
- // This should wait until the transformThread is considered not alive.
- worker.join();
- }
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/TreeWalker.java b/src/com/sun/org/apache/xml/internal/utils/TreeWalker.java
deleted file mode 100644
index 09946f3..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/TreeWalker.java
+++ /dev/null
@@ -1,489 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xml.internal.utils;
-
-import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
-import java.io.File;
-
-import org.w3c.dom.Comment;
-import org.w3c.dom.Element;
-import org.w3c.dom.EntityReference;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.ProcessingInstruction;
-import org.w3c.dom.Text;
-
-import org.xml.sax.ContentHandler;
-import org.xml.sax.Locator;
-import org.xml.sax.ext.LexicalHandler;
-import org.xml.sax.helpers.LocatorImpl;
-
-/**
- * This class does a pre-order walk of the DOM tree, calling a ContentHandler
- * interface as it goes.
- * @xsl.usage advanced
- */
-
-public class TreeWalker
-{
-
- /** Local reference to a ContentHandler */
- private ContentHandler m_contentHandler = null;
-
- // ARGHH!! JAXP Uses Xerces without setting the namespace processing to ON!
- // DOM2Helper m_dh = new DOM2Helper();
-
- /** DomHelper for this TreeWalker */
- protected DOMHelper m_dh;
-
- /** Locator object for this TreeWalker */
- private LocatorImpl m_locator = new LocatorImpl();
-
- /**
- * Get the ContentHandler used for the tree walk.
- *
- * @return the ContentHandler used for the tree walk
- */
- public ContentHandler getContentHandler()
- {
- return m_contentHandler;
- }
-
- /**
- * Get the ContentHandler used for the tree walk.
- *
- * @return the ContentHandler used for the tree walk
- */
- public void setContentHandler(ContentHandler ch)
- {
- m_contentHandler = ch;
- }
-
- /**
- * Constructor.
- * @param contentHandler The implementation of the
- * @param systemId System identifier for the document.
- * contentHandler operation (toXMLString, digest, ...)
- */
- public TreeWalker(ContentHandler contentHandler, DOMHelper dh, String systemId)
- {
- this.m_contentHandler = contentHandler;
- m_contentHandler.setDocumentLocator(m_locator);
- if (systemId != null) {
- m_locator.setSystemId(systemId);
- }
- m_dh = dh;
- }
-
- /**
- * Constructor.
- * @param contentHandler The implemention of the
- * contentHandler operation (toXMLString, digest, ...)
- */
- public TreeWalker(ContentHandler contentHandler, DOMHelper dh)
- {
- this.m_contentHandler = contentHandler;
- m_contentHandler.setDocumentLocator(m_locator);
- m_dh = dh;
- }
-
- /**
- * Constructor.
- * @param contentHandler The implementation of the
- * contentHandler operation (toXMLString, digest, ...)
- */
- public TreeWalker(ContentHandler contentHandler)
- {
- this.m_contentHandler = contentHandler;
- if (m_contentHandler != null) {
- m_contentHandler.setDocumentLocator(m_locator);
- }
- m_dh = new DOM2Helper();
- }
-
- /**
- * Perform a pre-order traversal non-recursive style.
- *
- * Note that TreeWalker assumes that the subtree is intended to represent
- * a complete (though not necessarily well-formed) document and, during a
- * traversal, startDocument and endDocument will always be issued to the
- * SAX listener.
- *
- * @param pos Node in the tree where to start traversal
- *
- * @throws TransformerException
- */
- public void traverse(Node pos) throws org.xml.sax.SAXException
- {
- this.m_contentHandler.startDocument();
-
- traverseFragment(pos);
-
- this.m_contentHandler.endDocument();
- }
-
- /**
- * Perform a pre-order traversal non-recursive style.
- *
- * In contrast to the traverse() method this method will not issue
- * startDocument() and endDocument() events to the SAX listener.
- *
- * @param pos Node in the tree where to start traversal
- *
- * @throws TransformerException
- */
- public void traverseFragment(Node pos) throws org.xml.sax.SAXException
- {
- Node top = pos;
-
- while (null != pos)
- {
- startNode(pos);
-
- Node nextNode = pos.getFirstChild();
-
- while (null == nextNode)
- {
- endNode(pos);
-
- if (top.equals(pos))
- break;
-
- nextNode = pos.getNextSibling();
-
- if (null == nextNode)
- {
- pos = pos.getParentNode();
-
- if ((null == pos) || (top.equals(pos)))
- {
- if (null != pos)
- endNode(pos);
-
- nextNode = null;
-
- break;
- }
- }
- }
-
- pos = nextNode;
- }
- }
-
- /**
- * Perform a pre-order traversal non-recursive style.
-
- * Note that TreeWalker assumes that the subtree is intended to represent
- * a complete (though not necessarily well-formed) document and, during a
- * traversal, startDocument and endDocument will always be issued to the
- * SAX listener.
- *
- * @param pos Node in the tree where to start traversal
- * @param top Node in the tree where to end traversal
- *
- * @throws TransformerException
- */
- public void traverse(Node pos, Node top) throws org.xml.sax.SAXException
- {
-
- this.m_contentHandler.startDocument();
-
- while (null != pos)
- {
- startNode(pos);
-
- Node nextNode = pos.getFirstChild();
-
- while (null == nextNode)
- {
- endNode(pos);
-
- if ((null != top) && top.equals(pos))
- break;
-
- nextNode = pos.getNextSibling();
-
- if (null == nextNode)
- {
- pos = pos.getParentNode();
-
- if ((null == pos) || ((null != top) && top.equals(pos)))
- {
- nextNode = null;
-
- break;
- }
- }
- }
-
- pos = nextNode;
- }
- this.m_contentHandler.endDocument();
- }
-
- /** Flag indicating whether following text to be processed is raw text */
- boolean nextIsRaw = false;
-
- /**
- * Optimized dispatch of characters.
- */
- private final void dispatachChars(Node node)
- throws org.xml.sax.SAXException
- {
- if(m_contentHandler instanceof com.sun.org.apache.xml.internal.dtm.ref.dom2dtm.DOM2DTM.CharacterNodeHandler)
- {
- ((com.sun.org.apache.xml.internal.dtm.ref.dom2dtm.DOM2DTM.CharacterNodeHandler)m_contentHandler).characters(node);
- }
- else
- {
- String data = ((Text) node).getData();
- this.m_contentHandler.characters(data.toCharArray(), 0, data.length());
- }
- }
-
- /**
- * Start processing given node
- *
- *
- * @param node Node to process
- *
- * @throws org.xml.sax.SAXException
- */
- protected void startNode(Node node) throws org.xml.sax.SAXException
- {
-
- if (m_contentHandler instanceof NodeConsumer)
- {
- ((NodeConsumer) m_contentHandler).setOriginatingNode(node);
- }
-
- if (node instanceof Locator)
- {
- Locator loc = (Locator)node;
- m_locator.setColumnNumber(loc.getColumnNumber());
- m_locator.setLineNumber(loc.getLineNumber());
- m_locator.setPublicId(loc.getPublicId());
- m_locator.setSystemId(loc.getSystemId());
- }
- else
- {
- m_locator.setColumnNumber(0);
- m_locator.setLineNumber(0);
- }
-
- switch (node.getNodeType())
- {
- case Node.COMMENT_NODE :
- {
- String data = ((Comment) node).getData();
-
- if (m_contentHandler instanceof LexicalHandler)
- {
- LexicalHandler lh = ((LexicalHandler) this.m_contentHandler);
-
- lh.comment(data.toCharArray(), 0, data.length());
- }
- }
- break;
- case Node.DOCUMENT_FRAGMENT_NODE :
-
- // ??;
- break;
- case Node.DOCUMENT_NODE :
-
- break;
- case Node.ELEMENT_NODE :
- NamedNodeMap atts = ((Element) node).getAttributes();
- int nAttrs = atts.getLength();
- // System.out.println("TreeWalker#startNode: "+node.getNodeName());
-
- for (int i = 0; i < nAttrs; i++)
- {
- Node attr = atts.item(i);
- String attrName = attr.getNodeName();
-
- // System.out.println("TreeWalker#startNode: attr["+i+"] = "+attrName+", "+attr.getNodeValue());
- if (attrName.equals("xmlns") || attrName.startsWith("xmlns:"))
- {
- // System.out.println("TreeWalker#startNode: attr["+i+"] = "+attrName+", "+attr.getNodeValue());
- int index;
- // Use "" instead of null, as Xerces likes "" for the
- // name of the default namespace. Fix attributed
- // to "Steven Murray" <smurray@ebt.com>.
- String prefix = (index = attrName.indexOf(":")) < 0
- ? "" : attrName.substring(index + 1);
-
- this.m_contentHandler.startPrefixMapping(prefix,
- attr.getNodeValue());
- }
-
- }
-
- // System.out.println("m_dh.getNamespaceOfNode(node): "+m_dh.getNamespaceOfNode(node));
- // System.out.println("m_dh.getLocalNameOfNode(node): "+m_dh.getLocalNameOfNode(node));
- String ns = m_dh.getNamespaceOfNode(node);
- if(null == ns)
- ns = "";
- this.m_contentHandler.startElement(ns,
- m_dh.getLocalNameOfNode(node),
- node.getNodeName(),
- new AttList(atts, m_dh));
- break;
- case Node.PROCESSING_INSTRUCTION_NODE :
- {
- ProcessingInstruction pi = (ProcessingInstruction) node;
- String name = pi.getNodeName();
-
- // String data = pi.getData();
- if (name.equals("xslt-next-is-raw"))
- {
- nextIsRaw = true;
- }
- else
- {
- this.m_contentHandler.processingInstruction(pi.getNodeName(),
- pi.getData());
- }
- }
- break;
- case Node.CDATA_SECTION_NODE :
- {
- boolean isLexH = (m_contentHandler instanceof LexicalHandler);
- LexicalHandler lh = isLexH
- ? ((LexicalHandler) this.m_contentHandler) : null;
-
- if (isLexH)
- {
- lh.startCDATA();
- }
-
- dispatachChars(node);
-
- {
- if (isLexH)
- {
- lh.endCDATA();
- }
- }
- }
- break;
- case Node.TEXT_NODE :
- {
- //String data = ((Text) node).getData();
-
- if (nextIsRaw)
- {
- nextIsRaw = false;
-
- m_contentHandler.processingInstruction(javax.xml.transform.Result.PI_DISABLE_OUTPUT_ESCAPING, "");
- dispatachChars(node);
- m_contentHandler.processingInstruction(javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING, "");
- }
- else
- {
- dispatachChars(node);
- }
- }
- break;
- case Node.ENTITY_REFERENCE_NODE :
- {
- EntityReference eref = (EntityReference) node;
-
- if (m_contentHandler instanceof LexicalHandler)
- {
- ((LexicalHandler) this.m_contentHandler).startEntity(
- eref.getNodeName());
- }
- else
- {
-
- // warning("Can not output entity to a pure SAX ContentHandler");
- }
- }
- break;
- default :
- }
- }
-
- /**
- * End processing of given node
- *
- *
- * @param node Node we just finished processing
- *
- * @throws org.xml.sax.SAXException
- */
- protected void endNode(Node node) throws org.xml.sax.SAXException
- {
-
- switch (node.getNodeType())
- {
- case Node.DOCUMENT_NODE :
- break;
-
- case Node.ELEMENT_NODE :
- String ns = m_dh.getNamespaceOfNode(node);
- if(null == ns)
- ns = "";
- this.m_contentHandler.endElement(ns,
- m_dh.getLocalNameOfNode(node),
- node.getNodeName());
-
- NamedNodeMap atts = ((Element) node).getAttributes();
- int nAttrs = atts.getLength();
-
- for (int i = 0; i < nAttrs; i++)
- {
- Node attr = atts.item(i);
- String attrName = attr.getNodeName();
-
- if (attrName.equals("xmlns") || attrName.startsWith("xmlns:"))
- {
- int index;
- // Use "" instead of null, as Xerces likes "" for the
- // name of the default namespace. Fix attributed
- // to "Steven Murray" <smurray@ebt.com>.
- String prefix = (index = attrName.indexOf(":")) < 0
- ? "" : attrName.substring(index + 1);
-
- this.m_contentHandler.endPrefixMapping(prefix);
- }
- }
- break;
- case Node.CDATA_SECTION_NODE :
- break;
- case Node.ENTITY_REFERENCE_NODE :
- {
- EntityReference eref = (EntityReference) node;
-
- if (m_contentHandler instanceof LexicalHandler)
- {
- LexicalHandler lh = ((LexicalHandler) this.m_contentHandler);
-
- lh.endEntity(eref.getNodeName());
- }
- }
- break;
- default :
- }
- }
-} //TreeWalker
diff --git a/src/com/sun/org/apache/xml/internal/utils/Trie.java b/src/com/sun/org/apache/xml/internal/utils/Trie.java
deleted file mode 100644
index 96b2138..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/Trie.java
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Trie.java,v 1.2.4.1 2005/09/15 08:15:59 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-/**
- * A digital search trie for 7-bit ASCII text
- * The API is a subset of java.util.Hashtable
- * The key must be a 7-bit ASCII string
- * The value may be any Java Object
- * @xsl.usage internal
- */
-public class Trie
-{
-
- /** Size of the m_nextChar array. */
- public static final int ALPHA_SIZE = 128;
-
- /** The root node of the tree. */
- Node m_Root;
-
- /** helper buffer to convert Strings to char arrays */
- private char[] m_charBuffer = new char[0];
-
- /**
- * Construct the trie.
- */
- public Trie()
- {
- m_Root = new Node();
- }
-
- /**
- * Put an object into the trie for lookup.
- *
- * @param key must be a 7-bit ASCII string
- * @param value any java object.
- *
- * @return The old object that matched key, or null.
- */
- public Object put(String key, Object value)
- {
-
- final int len = key.length();
- if (len > m_charBuffer.length)
- {
- // make the biggest buffer ever needed in get(String)
- m_charBuffer = new char[len];
- }
-
- Node node = m_Root;
-
- for (int i = 0; i < len; i++)
- {
- Node nextNode = node.m_nextChar[Character.toUpperCase(key.charAt(i))];
-
- if (nextNode != null)
- {
- node = nextNode;
- }
- else
- {
- for (; i < len; i++)
- {
- Node newNode = new Node();
- // put this value into the tree with a case insensitive key
- node.m_nextChar[Character.toUpperCase(key.charAt(i))] = newNode;
- node.m_nextChar[Character.toLowerCase(key.charAt(i))] = newNode;
- node = newNode;
- }
- break;
- }
- }
-
- Object ret = node.m_Value;
-
- node.m_Value = value;
-
- return ret;
- }
-
- /**
- * Get an object that matches the key.
- *
- * @param key must be a 7-bit ASCII string
- *
- * @return The object that matches the key, or null.
- */
-public Object get(final String key)
-{
-
- final int len = key.length();
-
- /* If the name is too long, we won't find it, this also keeps us
- * from overflowing m_charBuffer
- */
- if (m_charBuffer.length < len)
- return null;
-
- Node node = m_Root;
- switch (len) // optimize the look up based on the number of chars
- {
- // case 0 looks silly, but the generated bytecode runs
- // faster for lookup of elements of length 2 with this in
- // and a fair bit faster. Don't know why.
- case 0 :
- {
- return null;
- }
-
- case 1 :
- {
- final char ch = key.charAt(0);
- if (ch < ALPHA_SIZE)
- {
- node = node.m_nextChar[ch];
- if (node != null)
- return node.m_Value;
- }
- return null;
- }
-// comment out case 2 because the default is faster
-// case 2 :
-// {
-// final char ch0 = key.charAt(0);
-// final char ch1 = key.charAt(1);
-// if (ch0 < ALPHA_SIZE && ch1 < ALPHA_SIZE)
-// {
-// node = node.m_nextChar[ch0];
-// if (node != null)
-// {
-//
-// if (ch1 < ALPHA_SIZE)
-// {
-// node = node.m_nextChar[ch1];
-// if (node != null)
-// return node.m_Value;
-// }
-// }
-// }
-// return null;
-// }
- default :
- {
- key.getChars(0, len, m_charBuffer, 0);
- // copy string into array
- for (int i = 0; i < len; i++)
- {
- final char ch = m_charBuffer[i];
- if (ALPHA_SIZE <= ch)
- {
- // the key is not 7-bit ASCII so we won't find it here
- return null;
- }
-
- node = node.m_nextChar[ch];
- if (node == null)
- return null;
- }
-
- return node.m_Value;
- }
- }
-}
-
- /**
- * The node representation for the trie.
- * @xsl.usage internal
- */
- class Node
- {
-
- /**
- * Constructor, creates a Node[ALPHA_SIZE].
- */
- Node()
- {
- m_nextChar = new Node[ALPHA_SIZE];
- m_Value = null;
- }
-
- /** The next nodes. */
- Node m_nextChar[];
-
- /** The value. */
- Object m_Value;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/URI.java b/src/com/sun/org/apache/xml/internal/utils/URI.java
deleted file mode 100644
index f9e67ab..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/URI.java
+++ /dev/null
@@ -1,1692 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: URI.java,v 1.2.4.1 2005/09/15 08:16:00 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-import java.io.IOException;
-import java.io.Serializable;
-
-import com.sun.org.apache.xml.internal.res.XMLErrorResources;
-import com.sun.org.apache.xml.internal.res.XMLMessages;
-import java.util.Objects;
-
-/**
- * A class to represent a Uniform Resource Identifier (URI). This class
- * is designed to handle the parsing of URIs and provide access to
- * the various components (scheme, host, port, userinfo, path, query
- * string and fragment) that may constitute a URI.
- * <p>
- * Parsing of a URI specification is done according to the URI
- * syntax described in RFC 2396
- * <http://www.ietf.org/rfc/rfc2396.txt?number=2396>. Every URI consists
- * of a scheme, followed by a colon (':'), followed by a scheme-specific
- * part. For URIs that follow the "generic URI" syntax, the scheme-
- * specific part begins with two slashes ("//") and may be followed
- * by an authority segment (comprised of user information, host, and
- * port), path segment, query segment and fragment. Note that RFC 2396
- * no longer specifies the use of the parameters segment and excludes
- * the "user:password" syntax as part of the authority segment. If
- * "user:password" appears in a URI, the entire user/password string
- * is stored as userinfo.
- * <p>
- * For URIs that do not follow the "generic URI" syntax (e.g. mailto),
- * the entire scheme-specific part is treated as the "path" portion
- * of the URI.
- * <p>
- * Note that, unlike the java.net.URL class, this class does not provide
- * any built-in network access functionality nor does it provide any
- * scheme-specific functionality (for example, it does not know a
- * default port for a specific scheme). Rather, it only knows the
- * grammar and basic set of operations that can be applied to a URI.
- *
- *
- */
-public class URI implements Serializable
-{
- static final long serialVersionUID = 7096266377907081897L;
-
- /**
- * MalformedURIExceptions are thrown in the process of building a URI
- * or setting fields on a URI when an operation would result in an
- * invalid URI specification.
- *
- */
- public static class MalformedURIException extends IOException
- {
-
- /**
- * Constructs a <code>MalformedURIException</code> with no specified
- * detail message.
- */
- public MalformedURIException()
- {
- super();
- }
-
- /**
- * Constructs a <code>MalformedURIException</code> with the
- * specified detail message.
- *
- * @param p_msg the detail message.
- */
- public MalformedURIException(String p_msg)
- {
- super(p_msg);
- }
- }
-
- /** reserved characters */
- private static final String RESERVED_CHARACTERS = ";/?:@&=+$,";
-
- /**
- * URI punctuation mark characters - these, combined with
- * alphanumerics, constitute the "unreserved" characters
- */
- private static final String MARK_CHARACTERS = "-_.!~*'() ";
-
- /** scheme can be composed of alphanumerics and these characters */
- private static final String SCHEME_CHARACTERS = "+-.";
-
- /**
- * userinfo can be composed of unreserved, escaped and these
- * characters
- */
- private static final String USERINFO_CHARACTERS = ";:&=+$,";
-
- /** Stores the scheme (usually the protocol) for this URI.
- * @serial */
- private String m_scheme = null;
-
- /** If specified, stores the userinfo for this URI; otherwise null.
- * @serial */
- private String m_userinfo = null;
-
- /** If specified, stores the host for this URI; otherwise null.
- * @serial */
- private String m_host = null;
-
- /** If specified, stores the port for this URI; otherwise -1.
- * @serial */
- private int m_port = -1;
-
- /** If specified, stores the path for this URI; otherwise null.
- * @serial */
- private String m_path = null;
-
- /**
- * If specified, stores the query string for this URI; otherwise
- * null.
- * @serial
- */
- private String m_queryString = null;
-
- /** If specified, stores the fragment for this URI; otherwise null.
- * @serial */
- private String m_fragment = null;
-
- /** Indicate whether in DEBUG mode */
- private static boolean DEBUG = false;
-
- /**
- * Construct a new and uninitialized URI.
- */
- public URI(){}
-
- /**
- * Construct a new URI from another URI. All fields for this URI are
- * set equal to the fields of the URI passed in.
- *
- * @param p_other the URI to copy (cannot be null)
- */
- public URI(URI p_other)
- {
- initialize(p_other);
- }
-
- /**
- * Construct a new URI from a URI specification string. If the
- * specification follows the "generic URI" syntax, (two slashes
- * following the first colon), the specification will be parsed
- * accordingly - setting the scheme, userinfo, host,port, path, query
- * string and fragment fields as necessary. If the specification does
- * not follow the "generic URI" syntax, the specification is parsed
- * into a scheme and scheme-specific part (stored as the path) only.
- *
- * @param p_uriSpec the URI specification string (cannot be null or
- * empty)
- *
- * @throws MalformedURIException if p_uriSpec violates any syntax
- * rules
- */
- public URI(String p_uriSpec) throws MalformedURIException
- {
- this((URI) null, p_uriSpec);
- }
-
- /**
- * Construct a new URI from a base URI and a URI specification string.
- * The URI specification string may be a relative URI.
- *
- * @param p_base the base URI (cannot be null if p_uriSpec is null or
- * empty)
- * @param p_uriSpec the URI specification string (cannot be null or
- * empty if p_base is null)
- *
- * @throws MalformedURIException if p_uriSpec violates any syntax
- * rules
- */
- public URI(URI p_base, String p_uriSpec) throws MalformedURIException
- {
- initialize(p_base, p_uriSpec);
- }
-
- /**
- * Construct a new URI that does not follow the generic URI syntax.
- * Only the scheme and scheme-specific part (stored as the path) are
- * initialized.
- *
- * @param p_scheme the URI scheme (cannot be null or empty)
- * @param p_schemeSpecificPart the scheme-specific part (cannot be
- * null or empty)
- *
- * @throws MalformedURIException if p_scheme violates any
- * syntax rules
- */
- public URI(String p_scheme, String p_schemeSpecificPart)
- throws MalformedURIException
- {
-
- if (p_scheme == null || p_scheme.trim().length() == 0)
- {
- throw new MalformedURIException(
- "Cannot construct URI with null/empty scheme!");
- }
-
- if (p_schemeSpecificPart == null
- || p_schemeSpecificPart.trim().length() == 0)
- {
- throw new MalformedURIException(
- "Cannot construct URI with null/empty scheme-specific part!");
- }
-
- setScheme(p_scheme);
- setPath(p_schemeSpecificPart);
- }
-
- /**
- * Construct a new URI that follows the generic URI syntax from its
- * component parts. Each component is validated for syntax and some
- * basic semantic checks are performed as well. See the individual
- * setter methods for specifics.
- *
- * @param p_scheme the URI scheme (cannot be null or empty)
- * @param p_host the hostname or IPv4 address for the URI
- * @param p_path the URI path - if the path contains '?' or '#',
- * then the query string and/or fragment will be
- * set from the path; however, if the query and
- * fragment are specified both in the path and as
- * separate parameters, an exception is thrown
- * @param p_queryString the URI query string (cannot be specified
- * if path is null)
- * @param p_fragment the URI fragment (cannot be specified if path
- * is null)
- *
- * @throws MalformedURIException if any of the parameters violates
- * syntax rules or semantic rules
- */
- public URI(String p_scheme, String p_host, String p_path, String p_queryString, String p_fragment)
- throws MalformedURIException
- {
- this(p_scheme, null, p_host, -1, p_path, p_queryString, p_fragment);
- }
-
- /**
- * Construct a new URI that follows the generic URI syntax from its
- * component parts. Each component is validated for syntax and some
- * basic semantic checks are performed as well. See the individual
- * setter methods for specifics.
- *
- * @param p_scheme the URI scheme (cannot be null or empty)
- * @param p_userinfo the URI userinfo (cannot be specified if host
- * is null)
- * @param p_host the hostname or IPv4 address for the URI
- * @param p_port the URI port (may be -1 for "unspecified"; cannot
- * be specified if host is null)
- * @param p_path the URI path - if the path contains '?' or '#',
- * then the query string and/or fragment will be
- * set from the path; however, if the query and
- * fragment are specified both in the path and as
- * separate parameters, an exception is thrown
- * @param p_queryString the URI query string (cannot be specified
- * if path is null)
- * @param p_fragment the URI fragment (cannot be specified if path
- * is null)
- *
- * @throws MalformedURIException if any of the parameters violates
- * syntax rules or semantic rules
- */
- public URI(String p_scheme, String p_userinfo, String p_host, int p_port, String p_path, String p_queryString, String p_fragment)
- throws MalformedURIException
- {
-
- if (p_scheme == null || p_scheme.trim().length() == 0)
- {
- throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_SCHEME_REQUIRED, null)); //"Scheme is required!");
- }
-
- if (p_host == null)
- {
- if (p_userinfo != null)
- {
- throw new MalformedURIException(
- XMLMessages.createXMLMessage(XMLErrorResources.ER_NO_USERINFO_IF_NO_HOST, null)); //"Userinfo may not be specified if host is not specified!");
- }
-
- if (p_port != -1)
- {
- throw new MalformedURIException(
- XMLMessages.createXMLMessage(XMLErrorResources.ER_NO_PORT_IF_NO_HOST, null)); //"Port may not be specified if host is not specified!");
- }
- }
-
- if (p_path != null)
- {
- if (p_path.indexOf('?') != -1 && p_queryString != null)
- {
- throw new MalformedURIException(
- XMLMessages.createXMLMessage(XMLErrorResources.ER_NO_QUERY_STRING_IN_PATH, null)); //"Query string cannot be specified in path and query string!");
- }
-
- if (p_path.indexOf('#') != -1 && p_fragment != null)
- {
- throw new MalformedURIException(
- XMLMessages.createXMLMessage(XMLErrorResources.ER_NO_FRAGMENT_STRING_IN_PATH, null)); //"Fragment cannot be specified in both the path and fragment!");
- }
- }
-
- setScheme(p_scheme);
- setHost(p_host);
- setPort(p_port);
- setUserinfo(p_userinfo);
- setPath(p_path);
- setQueryString(p_queryString);
- setFragment(p_fragment);
- }
-
- /**
- * Initialize all fields of this URI from another URI.
- *
- * @param p_other the URI to copy (cannot be null)
- */
- private void initialize(URI p_other)
- {
-
- m_scheme = p_other.getScheme();
- m_userinfo = p_other.getUserinfo();
- m_host = p_other.getHost();
- m_port = p_other.getPort();
- m_path = p_other.getPath();
- m_queryString = p_other.getQueryString();
- m_fragment = p_other.getFragment();
- }
-
- /**
- * Initializes this URI from a base URI and a URI specification string.
- * See RFC 2396 Section 4 and Appendix B for specifications on parsing
- * the URI and Section 5 for specifications on resolving relative URIs
- * and relative paths.
- *
- * @param p_base the base URI (may be null if p_uriSpec is an absolute
- * URI)
- * @param p_uriSpec the URI spec string which may be an absolute or
- * relative URI (can only be null/empty if p_base
- * is not null)
- *
- * @throws MalformedURIException if p_base is null and p_uriSpec
- * is not an absolute URI or if
- * p_uriSpec violates syntax rules
- */
- private void initialize(URI p_base, String p_uriSpec)
- throws MalformedURIException
- {
-
- if (p_base == null
- && (p_uriSpec == null || p_uriSpec.trim().length() == 0))
- {
- throw new MalformedURIException(
- XMLMessages.createXMLMessage(XMLErrorResources.ER_CANNOT_INIT_URI_EMPTY_PARMS, null)); //"Cannot initialize URI with empty parameters.");
- }
-
- // just make a copy of the base if spec is empty
- if (p_uriSpec == null || p_uriSpec.trim().length() == 0)
- {
- initialize(p_base);
-
- return;
- }
-
- String uriSpec = p_uriSpec.trim();
- int uriSpecLen = uriSpec.length();
- int index = 0;
-
- // check for scheme
- int colonIndex = uriSpec.indexOf(':');
- if (colonIndex < 0)
- {
- if (p_base == null)
- {
- throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_NO_SCHEME_IN_URI, new Object[]{uriSpec})); //"No scheme found in URI: "+uriSpec);
- }
- }
- else
- {
- initializeScheme(uriSpec);
- uriSpec = uriSpec.substring(colonIndex+1);
- // This is a fix for XALANJ-2059.
- if(m_scheme != null && p_base != null)
- {
- // a) If <uriSpec> starts with a slash (/), it means <uriSpec> is absolute
- // and p_base can be ignored.
- // For example,
- // uriSpec = file:/myDIR/myXSLFile.xsl
- // p_base = file:/myWork/
- //
- // Here, uriSpec has absolute path after scheme file and :
- // Hence p_base can be ignored.
- //
- // b) Similarily, according to RFC 2396, uri is resolved for <uriSpec> relative to <p_base>
- // if scheme in <uriSpec> is same as scheme in <p_base>, else p_base can be ignored.
- //
- // c) if <p_base> is not hierarchical, it can be ignored.
- //
- if(uriSpec.startsWith("/") || !m_scheme.equals(p_base.m_scheme) || !p_base.getSchemeSpecificPart().startsWith("/"))
- {
- p_base = null;
- }
- }
- // Fix for XALANJ-2059
- uriSpecLen = uriSpec.length();
- }
-
- // two slashes means generic URI syntax, so we get the authority
- if (((index + 1) < uriSpecLen)
- && (uriSpec.substring(index).startsWith("//")))
- {
- index += 2;
-
- int startPos = index;
-
- // get authority - everything up to path, query or fragment
- char testChar = '\0';
-
- while (index < uriSpecLen)
- {
- testChar = uriSpec.charAt(index);
-
- if (testChar == '/' || testChar == '?' || testChar == '#')
- {
- break;
- }
-
- index++;
- }
-
- // if we found authority, parse it out, otherwise we set the
- // host to empty string
- if (index > startPos)
- {
- initializeAuthority(uriSpec.substring(startPos, index));
- }
- else
- {
- m_host = "";
- }
- }
-
- initializePath(uriSpec.substring(index));
-
- // Resolve relative URI to base URI - see RFC 2396 Section 5.2
- // In some cases, it might make more sense to throw an exception
- // (when scheme is specified is the string spec and the base URI
- // is also specified, for example), but we're just following the
- // RFC specifications
- if (p_base != null)
- {
-
- // check to see if this is the current doc - RFC 2396 5.2 #2
- // note that this is slightly different from the RFC spec in that
- // we don't include the check for query string being null
- // - this handles cases where the urispec is just a query
- // string or a fragment (e.g. "?y" or "#s") -
- // see <http://www.ics.uci.edu/~fielding/url/test1.html> which
- // identified this as a bug in the RFC
- if (m_path.length() == 0 && m_scheme == null && m_host == null)
- {
- m_scheme = p_base.getScheme();
- m_userinfo = p_base.getUserinfo();
- m_host = p_base.getHost();
- m_port = p_base.getPort();
- m_path = p_base.getPath();
-
- if (m_queryString == null)
- {
- m_queryString = p_base.getQueryString();
- }
-
- return;
- }
-
- // check for scheme - RFC 2396 5.2 #3
- // if we found a scheme, it means absolute URI, so we're done
- if (m_scheme == null)
- {
- m_scheme = p_base.getScheme();
- }
-
- // check for authority - RFC 2396 5.2 #4
- // if we found a host, then we've got a network path, so we're done
- if (m_host == null)
- {
- m_userinfo = p_base.getUserinfo();
- m_host = p_base.getHost();
- m_port = p_base.getPort();
- }
- else
- {
- return;
- }
-
- // check for absolute path - RFC 2396 5.2 #5
- if (m_path.length() > 0 && m_path.startsWith("/"))
- {
- return;
- }
-
- // if we get to this point, we need to resolve relative path
- // RFC 2396 5.2 #6
- String path = "";
- String basePath = p_base.getPath();
-
- // 6a - get all but the last segment of the base URI path
- if (basePath != null)
- {
- int lastSlash = basePath.lastIndexOf('/');
-
- if (lastSlash != -1)
- {
- path = basePath.substring(0, lastSlash + 1);
- }
- }
-
- // 6b - append the relative URI path
- path = path.concat(m_path);
-
- // 6c - remove all "./" where "." is a complete path segment
- index = -1;
-
- while ((index = path.indexOf("/./")) != -1)
- {
- path = path.substring(0, index + 1).concat(path.substring(index + 3));
- }
-
- // 6d - remove "." if path ends with "." as a complete path segment
- if (path.endsWith("/."))
- {
- path = path.substring(0, path.length() - 1);
- }
-
- // 6e - remove all "<segment>/../" where "<segment>" is a complete
- // path segment not equal to ".."
- index = -1;
-
- int segIndex = -1;
- String tempString = null;
-
- while ((index = path.indexOf("/../")) > 0)
- {
- tempString = path.substring(0, path.indexOf("/../"));
- segIndex = tempString.lastIndexOf('/');
-
- if (segIndex != -1)
- {
- if (!tempString.substring(segIndex++).equals(".."))
- {
- path = path.substring(0, segIndex).concat(path.substring(index
- + 4));
- }
- }
- }
-
- // 6f - remove ending "<segment>/.." where "<segment>" is a
- // complete path segment
- if (path.endsWith("/.."))
- {
- tempString = path.substring(0, path.length() - 3);
- segIndex = tempString.lastIndexOf('/');
-
- if (segIndex != -1)
- {
- path = path.substring(0, segIndex + 1);
- }
- }
-
- m_path = path;
- }
- }
-
- /**
- * Initialize the scheme for this URI from a URI string spec.
- *
- * @param p_uriSpec the URI specification (cannot be null)
- *
- * @throws MalformedURIException if URI does not have a conformant
- * scheme
- */
- private void initializeScheme(String p_uriSpec) throws MalformedURIException
- {
-
- int uriSpecLen = p_uriSpec.length();
- int index = 0;
- String scheme = null;
- char testChar = '\0';
-
- while (index < uriSpecLen)
- {
- testChar = p_uriSpec.charAt(index);
-
- if (testChar == ':' || testChar == '/' || testChar == '?'
- || testChar == '#')
- {
- break;
- }
-
- index++;
- }
-
- scheme = p_uriSpec.substring(0, index);
-
- if (scheme.length() == 0)
- {
- throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_NO_SCHEME_INURI, null)); //"No scheme found in URI.");
- }
- else
- {
- setScheme(scheme);
- }
- }
-
- /**
- * Initialize the authority (userinfo, host and port) for this
- * URI from a URI string spec.
- *
- * @param p_uriSpec the URI specification (cannot be null)
- *
- * @throws MalformedURIException if p_uriSpec violates syntax rules
- */
- private void initializeAuthority(String p_uriSpec)
- throws MalformedURIException
- {
-
- int index = 0;
- int start = 0;
- int end = p_uriSpec.length();
- char testChar = '\0';
- String userinfo = null;
-
- // userinfo is everything up @
- if (p_uriSpec.indexOf('@', start) != -1)
- {
- while (index < end)
- {
- testChar = p_uriSpec.charAt(index);
-
- if (testChar == '@')
- {
- break;
- }
-
- index++;
- }
-
- userinfo = p_uriSpec.substring(start, index);
-
- index++;
- }
-
- // host is everything up to ':'
- String host = null;
-
- start = index;
-
- while (index < end)
- {
- testChar = p_uriSpec.charAt(index);
-
- if (testChar == ':')
- {
- break;
- }
-
- index++;
- }
-
- host = p_uriSpec.substring(start, index);
-
- int port = -1;
-
- if (host.length() > 0)
- {
-
- // port
- if (testChar == ':')
- {
- index++;
-
- start = index;
-
- while (index < end)
- {
- index++;
- }
-
- String portStr = p_uriSpec.substring(start, index);
-
- if (portStr.length() > 0)
- {
- for (int i = 0; i < portStr.length(); i++)
- {
- if (!isDigit(portStr.charAt(i)))
- {
- throw new MalformedURIException(
- portStr + " is invalid. Port should only contain digits!");
- }
- }
-
- try
- {
- port = Integer.parseInt(portStr);
- }
- catch (NumberFormatException nfe)
- {
-
- // can't happen
- }
- }
- }
- }
-
- setHost(host);
- setPort(port);
- setUserinfo(userinfo);
- }
-
- /**
- * Initialize the path for this URI from a URI string spec.
- *
- * @param p_uriSpec the URI specification (cannot be null)
- *
- * @throws MalformedURIException if p_uriSpec violates syntax rules
- */
- private void initializePath(String p_uriSpec) throws MalformedURIException
- {
-
- if (p_uriSpec == null)
- {
- throw new MalformedURIException(
- "Cannot initialize path from null string!");
- }
-
- int index = 0;
- int start = 0;
- int end = p_uriSpec.length();
- char testChar = '\0';
-
- // path - everything up to query string or fragment
- while (index < end)
- {
- testChar = p_uriSpec.charAt(index);
-
- if (testChar == '?' || testChar == '#')
- {
- break;
- }
-
- // check for valid escape sequence
- if (testChar == '%')
- {
- if (index + 2 >= end ||!isHex(p_uriSpec.charAt(index + 1))
- ||!isHex(p_uriSpec.charAt(index + 2)))
- {
- throw new MalformedURIException(
- XMLMessages.createXMLMessage(XMLErrorResources.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE, null)); //"Path contains invalid escape sequence!");
- }
- }
- else if (!isReservedCharacter(testChar)
- &&!isUnreservedCharacter(testChar))
- {
- if ('\\' != testChar)
- throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_PATH_INVALID_CHAR, new Object[]{String.valueOf(testChar)})); //"Path contains invalid character: "
- //+ testChar);
- }
-
- index++;
- }
-
- m_path = p_uriSpec.substring(start, index);
-
- // query - starts with ? and up to fragment or end
- if (testChar == '?')
- {
- index++;
-
- start = index;
-
- while (index < end)
- {
- testChar = p_uriSpec.charAt(index);
-
- if (testChar == '#')
- {
- break;
- }
-
- if (testChar == '%')
- {
- if (index + 2 >= end ||!isHex(p_uriSpec.charAt(index + 1))
- ||!isHex(p_uriSpec.charAt(index + 2)))
- {
- throw new MalformedURIException(
- "Query string contains invalid escape sequence!");
- }
- }
- else if (!isReservedCharacter(testChar)
- &&!isUnreservedCharacter(testChar))
- {
- throw new MalformedURIException(
- "Query string contains invalid character:" + testChar);
- }
-
- index++;
- }
-
- m_queryString = p_uriSpec.substring(start, index);
- }
-
- // fragment - starts with #
- if (testChar == '#')
- {
- index++;
-
- start = index;
-
- while (index < end)
- {
- testChar = p_uriSpec.charAt(index);
-
- if (testChar == '%')
- {
- if (index + 2 >= end ||!isHex(p_uriSpec.charAt(index + 1))
- ||!isHex(p_uriSpec.charAt(index + 2)))
- {
- throw new MalformedURIException(
- "Fragment contains invalid escape sequence!");
- }
- }
- else if (!isReservedCharacter(testChar)
- &&!isUnreservedCharacter(testChar))
- {
- throw new MalformedURIException(
- "Fragment contains invalid character:" + testChar);
- }
-
- index++;
- }
-
- m_fragment = p_uriSpec.substring(start, index);
- }
- }
-
- /**
- * Get the scheme for this URI.
- *
- * @return the scheme for this URI
- */
- public String getScheme()
- {
- return m_scheme;
- }
-
- /**
- * Get the scheme-specific part for this URI (everything following the
- * scheme and the first colon). See RFC 2396 Section 5.2 for spec.
- *
- * @return the scheme-specific part for this URI
- */
- public String getSchemeSpecificPart()
- {
-
- final StringBuilder schemespec = new StringBuilder();
-
- if (m_userinfo != null || m_host != null || m_port != -1)
- {
- schemespec.append("//");
- }
-
- if (m_userinfo != null)
- {
- schemespec.append(m_userinfo);
- schemespec.append('@');
- }
-
- if (m_host != null)
- {
- schemespec.append(m_host);
- }
-
- if (m_port != -1)
- {
- schemespec.append(':');
- schemespec.append(m_port);
- }
-
- if (m_path != null)
- {
- schemespec.append((m_path));
- }
-
- if (m_queryString != null)
- {
- schemespec.append('?');
- schemespec.append(m_queryString);
- }
-
- if (m_fragment != null)
- {
- schemespec.append('#');
- schemespec.append(m_fragment);
- }
-
- return schemespec.toString();
- }
-
- /**
- * Get the userinfo for this URI.
- *
- * @return the userinfo for this URI (null if not specified).
- */
- public String getUserinfo()
- {
- return m_userinfo;
- }
-
- /**
- * Get the host for this URI.
- *
- * @return the host for this URI (null if not specified).
- */
- public String getHost()
- {
- return m_host;
- }
-
- /**
- * Get the port for this URI.
- *
- * @return the port for this URI (-1 if not specified).
- */
- public int getPort()
- {
- return m_port;
- }
-
- /**
- * Get the path for this URI (optionally with the query string and
- * fragment).
- *
- * @param p_includeQueryString if true (and query string is not null),
- * then a "?" followed by the query string
- * will be appended
- * @param p_includeFragment if true (and fragment is not null),
- * then a "#" followed by the fragment
- * will be appended
- *
- * @return the path for this URI possibly including the query string
- * and fragment
- */
- public String getPath(boolean p_includeQueryString,
- boolean p_includeFragment)
- {
-
- final StringBuilder pathString = new StringBuilder(m_path);
-
- if (p_includeQueryString && m_queryString != null)
- {
- pathString.append('?');
- pathString.append(m_queryString);
- }
-
- if (p_includeFragment && m_fragment != null)
- {
- pathString.append('#');
- pathString.append(m_fragment);
- }
-
- return pathString.toString();
- }
-
- /**
- * Get the path for this URI. Note that the value returned is the path
- * only and does not include the query string or fragment.
- *
- * @return the path for this URI.
- */
- public String getPath()
- {
- return m_path;
- }
-
- /**
- * Get the query string for this URI.
- *
- * @return the query string for this URI. Null is returned if there
- * was no "?" in the URI spec, empty string if there was a
- * "?" but no query string following it.
- */
- public String getQueryString()
- {
- return m_queryString;
- }
-
- /**
- * Get the fragment for this URI.
- *
- * @return the fragment for this URI. Null is returned if there
- * was no "#" in the URI spec, empty string if there was a
- * "#" but no fragment following it.
- */
- public String getFragment()
- {
- return m_fragment;
- }
-
- /**
- * Set the scheme for this URI. The scheme is converted to lowercase
- * before it is set.
- *
- * @param p_scheme the scheme for this URI (cannot be null)
- *
- * @throws MalformedURIException if p_scheme is not a conformant
- * scheme name
- */
- public void setScheme(String p_scheme) throws MalformedURIException
- {
-
- if (p_scheme == null)
- {
- throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_SCHEME_FROM_NULL_STRING, null)); //"Cannot set scheme from null string!");
- }
-
- if (!isConformantSchemeName(p_scheme))
- {
- throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_SCHEME_NOT_CONFORMANT, null)); //"The scheme is not conformant.");
- }
-
- m_scheme = p_scheme.toLowerCase();
- }
-
- /**
- * Set the userinfo for this URI. If a non-null value is passed in and
- * the host value is null, then an exception is thrown.
- *
- * @param p_userinfo the userinfo for this URI
- *
- * @throws MalformedURIException if p_userinfo contains invalid
- * characters
- */
- public void setUserinfo(String p_userinfo) throws MalformedURIException
- {
-
- if (p_userinfo == null)
- {
- m_userinfo = null;
- }
- else
- {
- if (m_host == null)
- {
- throw new MalformedURIException(
- "Userinfo cannot be set when host is null!");
- }
-
- // userinfo can contain alphanumerics, mark characters, escaped
- // and ';',':','&','=','+','$',','
- int index = 0;
- int end = p_userinfo.length();
- char testChar = '\0';
-
- while (index < end)
- {
- testChar = p_userinfo.charAt(index);
-
- if (testChar == '%')
- {
- if (index + 2 >= end ||!isHex(p_userinfo.charAt(index + 1))
- ||!isHex(p_userinfo.charAt(index + 2)))
- {
- throw new MalformedURIException(
- "Userinfo contains invalid escape sequence!");
- }
- }
- else if (!isUnreservedCharacter(testChar)
- && USERINFO_CHARACTERS.indexOf(testChar) == -1)
- {
- throw new MalformedURIException(
- "Userinfo contains invalid character:" + testChar);
- }
-
- index++;
- }
- }
-
- m_userinfo = p_userinfo;
- }
-
- /**
- * Set the host for this URI. If null is passed in, the userinfo
- * field is also set to null and the port is set to -1.
- *
- * @param p_host the host for this URI
- *
- * @throws MalformedURIException if p_host is not a valid IP
- * address or DNS hostname.
- */
- public void setHost(String p_host) throws MalformedURIException
- {
-
- if (p_host == null || p_host.trim().length() == 0)
- {
- m_host = p_host;
- m_userinfo = null;
- m_port = -1;
- }
- else if (!isWellFormedAddress(p_host))
- {
- throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_HOST_ADDRESS_NOT_WELLFORMED, null)); //"Host is not a well formed address!");
- }
-
- m_host = p_host;
- }
-
- /**
- * Set the port for this URI. -1 is used to indicate that the port is
- * not specified, otherwise valid port numbers are between 0 and 65535.
- * If a valid port number is passed in and the host field is null,
- * an exception is thrown.
- *
- * @param p_port the port number for this URI
- *
- * @throws MalformedURIException if p_port is not -1 and not a
- * valid port number
- */
- public void setPort(int p_port) throws MalformedURIException
- {
-
- if (p_port >= 0 && p_port <= 65535)
- {
- if (m_host == null)
- {
- throw new MalformedURIException(
- XMLMessages.createXMLMessage(XMLErrorResources.ER_PORT_WHEN_HOST_NULL, null)); //"Port cannot be set when host is null!");
- }
- }
- else if (p_port != -1)
- {
- throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_INVALID_PORT, null)); //"Invalid port number!");
- }
-
- m_port = p_port;
- }
-
- /**
- * Set the path for this URI. If the supplied path is null, then the
- * query string and fragment are set to null as well. If the supplied
- * path includes a query string and/or fragment, these fields will be
- * parsed and set as well. Note that, for URIs following the "generic
- * URI" syntax, the path specified should start with a slash.
- * For URIs that do not follow the generic URI syntax, this method
- * sets the scheme-specific part.
- *
- * @param p_path the path for this URI (may be null)
- *
- * @throws MalformedURIException if p_path contains invalid
- * characters
- */
- public void setPath(String p_path) throws MalformedURIException
- {
-
- if (p_path == null)
- {
- m_path = null;
- m_queryString = null;
- m_fragment = null;
- }
- else
- {
- initializePath(p_path);
- }
- }
-
- /**
- * Append to the end of the path of this URI. If the current path does
- * not end in a slash and the path to be appended does not begin with
- * a slash, a slash will be appended to the current path before the
- * new segment is added. Also, if the current path ends in a slash
- * and the new segment begins with a slash, the extra slash will be
- * removed before the new segment is appended.
- *
- * @param p_addToPath the new segment to be added to the current path
- *
- * @throws MalformedURIException if p_addToPath contains syntax
- * errors
- */
- public void appendPath(String p_addToPath) throws MalformedURIException
- {
-
- if (p_addToPath == null || p_addToPath.trim().length() == 0)
- {
- return;
- }
-
- if (!isURIString(p_addToPath))
- {
- throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_PATH_INVALID_CHAR, new Object[]{p_addToPath})); //"Path contains invalid character!");
- }
-
- if (m_path == null || m_path.trim().length() == 0)
- {
- if (p_addToPath.startsWith("/"))
- {
- m_path = p_addToPath;
- }
- else
- {
- m_path = "/" + p_addToPath;
- }
- }
- else if (m_path.endsWith("/"))
- {
- if (p_addToPath.startsWith("/"))
- {
- m_path = m_path.concat(p_addToPath.substring(1));
- }
- else
- {
- m_path = m_path.concat(p_addToPath);
- }
- }
- else
- {
- if (p_addToPath.startsWith("/"))
- {
- m_path = m_path.concat(p_addToPath);
- }
- else
- {
- m_path = m_path.concat("/" + p_addToPath);
- }
- }
- }
-
- /**
- * Set the query string for this URI. A non-null value is valid only
- * if this is an URI conforming to the generic URI syntax and
- * the path value is not null.
- *
- * @param p_queryString the query string for this URI
- *
- * @throws MalformedURIException if p_queryString is not null and this
- * URI does not conform to the generic
- * URI syntax or if the path is null
- */
- public void setQueryString(String p_queryString)
- throws MalformedURIException
- {
-
- if (p_queryString == null)
- {
- m_queryString = null;
- }
- else if (!isGenericURI())
- {
- throw new MalformedURIException(
- "Query string can only be set for a generic URI!");
- }
- else if (getPath() == null)
- {
- throw new MalformedURIException(
- "Query string cannot be set when path is null!");
- }
- else if (!isURIString(p_queryString))
- {
- throw new MalformedURIException(
- "Query string contains invalid character!");
- }
- else
- {
- m_queryString = p_queryString;
- }
- }
-
- /**
- * Set the fragment for this URI. A non-null value is valid only
- * if this is a URI conforming to the generic URI syntax and
- * the path value is not null.
- *
- * @param p_fragment the fragment for this URI
- *
- * @throws MalformedURIException if p_fragment is not null and this
- * URI does not conform to the generic
- * URI syntax or if the path is null
- */
- public void setFragment(String p_fragment) throws MalformedURIException
- {
-
- if (p_fragment == null)
- {
- m_fragment = null;
- }
- else if (!isGenericURI())
- {
- throw new MalformedURIException(
- XMLMessages.createXMLMessage(XMLErrorResources.ER_FRAG_FOR_GENERIC_URI, null)); //"Fragment can only be set for a generic URI!");
- }
- else if (getPath() == null)
- {
- throw new MalformedURIException(
- XMLMessages.createXMLMessage(XMLErrorResources.ER_FRAG_WHEN_PATH_NULL, null)); //"Fragment cannot be set when path is null!");
- }
- else if (!isURIString(p_fragment))
- {
- throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_FRAG_INVALID_CHAR, null)); //"Fragment contains invalid character!");
- }
- else
- {
- m_fragment = p_fragment;
- }
- }
-
- /**
- * Determines if the passed-in Object is equivalent to this URI.
- *
- * @param p_test the Object to test for equality.
- *
- * @return true if p_test is a URI with all values equal to this
- * URI, false otherwise
- */
- @Override
- public boolean equals(Object p_test)
- {
-
- if (p_test instanceof URI)
- {
- URI testURI = (URI) p_test;
-
- if (((m_scheme == null && testURI.m_scheme == null) || (m_scheme != null && testURI.m_scheme != null && m_scheme.equals(
- testURI.m_scheme))) && ((m_userinfo == null && testURI.m_userinfo == null) || (m_userinfo != null && testURI.m_userinfo != null && m_userinfo.equals(
- testURI.m_userinfo))) && ((m_host == null && testURI.m_host == null) || (m_host != null && testURI.m_host != null && m_host.equals(
- testURI.m_host))) && m_port == testURI.m_port && ((m_path == null && testURI.m_path == null) || (m_path != null && testURI.m_path != null && m_path.equals(
- testURI.m_path))) && ((m_queryString == null && testURI.m_queryString == null) || (m_queryString != null && testURI.m_queryString != null && m_queryString.equals(
- testURI.m_queryString))) && ((m_fragment == null && testURI.m_fragment == null) || (m_fragment != null && testURI.m_fragment != null && m_fragment.equals(
- testURI.m_fragment))))
- {
- return true;
- }
- }
-
- return false;
- }
-
- @Override
- public int hashCode() {
- int hash = 7;
- hash = 59 * hash + Objects.hashCode(this.m_scheme);
- hash = 59 * hash + Objects.hashCode(this.m_userinfo);
- hash = 59 * hash + Objects.hashCode(this.m_host);
- hash = 59 * hash + this.m_port;
- hash = 59 * hash + Objects.hashCode(this.m_path);
- hash = 59 * hash + Objects.hashCode(this.m_queryString);
- hash = 59 * hash + Objects.hashCode(this.m_fragment);
- return hash;
- }
-
- /**
- * Get the URI as a string specification. See RFC 2396 Section 5.2.
- *
- * @return the URI string specification
- */
- @Override
- public String toString()
- {
-
- final StringBuilder uriSpecString = new StringBuilder();
-
- if (m_scheme != null)
- {
- uriSpecString.append(m_scheme);
- uriSpecString.append(':');
- }
-
- uriSpecString.append(getSchemeSpecificPart());
-
- return uriSpecString.toString();
- }
-
- /**
- * Get the indicator as to whether this URI uses the "generic URI"
- * syntax.
- *
- * @return true if this URI uses the "generic URI" syntax, false
- * otherwise
- */
- public boolean isGenericURI()
- {
-
- // presence of the host (whether valid or empty) means
- // double-slashes which means generic uri
- return (m_host != null);
- }
-
- /**
- * Determine whether a scheme conforms to the rules for a scheme name.
- * A scheme is conformant if it starts with an alphanumeric, and
- * contains only alphanumerics, '+','-' and '.'.
- *
- *
- * @param p_scheme The sheme name to check
- * @return true if the scheme is conformant, false otherwise
- */
- public static boolean isConformantSchemeName(String p_scheme)
- {
-
- if (p_scheme == null || p_scheme.trim().length() == 0)
- {
- return false;
- }
-
- if (!isAlpha(p_scheme.charAt(0)))
- {
- return false;
- }
-
- char testChar;
-
- for (int i = 1; i < p_scheme.length(); i++)
- {
- testChar = p_scheme.charAt(i);
-
- if (!isAlphanum(testChar) && SCHEME_CHARACTERS.indexOf(testChar) == -1)
- {
- return false;
- }
- }
-
- return true;
- }
-
- /**
- * Determine whether a string is syntactically capable of representing
- * a valid IPv4 address or the domain name of a network host. A valid
- * IPv4 address consists of four decimal digit groups separated by a
- * '.'. A hostname consists of domain labels (each of which must
- * begin and end with an alphanumeric but may contain '-') separated
- * & by a '.'. See RFC 2396 Section 3.2.2.
- *
- *
- * @param p_address The address string to check
- * @return true if the string is a syntactically valid IPv4 address
- * or hostname
- */
- public static boolean isWellFormedAddress(String p_address)
- {
-
- if (p_address == null)
- {
- return false;
- }
-
- String address = p_address.trim();
- int addrLength = address.length();
-
- if (addrLength == 0 || addrLength > 255)
- {
- return false;
- }
-
- if (address.startsWith(".") || address.startsWith("-"))
- {
- return false;
- }
-
- // rightmost domain label starting with digit indicates IP address
- // since top level domain label can only start with an alpha
- // see RFC 2396 Section 3.2.2
- int index = address.lastIndexOf('.');
-
- if (address.endsWith("."))
- {
- index = address.substring(0, index).lastIndexOf('.');
- }
-
- if (index + 1 < addrLength && isDigit(p_address.charAt(index + 1)))
- {
- char testChar;
- int numDots = 0;
-
- // make sure that 1) we see only digits and dot separators, 2) that
- // any dot separator is preceded and followed by a digit and
- // 3) that we find 3 dots
- for (int i = 0; i < addrLength; i++)
- {
- testChar = address.charAt(i);
-
- if (testChar == '.')
- {
- if (!isDigit(address.charAt(i - 1))
- || (i + 1 < addrLength &&!isDigit(address.charAt(i + 1))))
- {
- return false;
- }
-
- numDots++;
- }
- else if (!isDigit(testChar))
- {
- return false;
- }
- }
-
- if (numDots != 3)
- {
- return false;
- }
- }
- else
- {
-
- // domain labels can contain alphanumerics and '-"
- // but must start and end with an alphanumeric
- char testChar;
-
- for (int i = 0; i < addrLength; i++)
- {
- testChar = address.charAt(i);
-
- if (testChar == '.')
- {
- if (!isAlphanum(address.charAt(i - 1)))
- {
- return false;
- }
-
- if (i + 1 < addrLength &&!isAlphanum(address.charAt(i + 1)))
- {
- return false;
- }
- }
- else if (!isAlphanum(testChar) && testChar != '-')
- {
- return false;
- }
- }
- }
-
- return true;
- }
-
- /**
- * Determine whether a char is a digit.
- *
- *
- * @param p_char the character to check
- * @return true if the char is betweeen '0' and '9', false otherwise
- */
- private static boolean isDigit(char p_char)
- {
- return p_char >= '0' && p_char <= '9';
- }
-
- /**
- * Determine whether a character is a hexadecimal character.
- *
- *
- * @param p_char the character to check
- * @return true if the char is betweeen '0' and '9', 'a' and 'f'
- * or 'A' and 'F', false otherwise
- */
- private static boolean isHex(char p_char)
- {
- return (isDigit(p_char) || (p_char >= 'a' && p_char <= 'f')
- || (p_char >= 'A' && p_char <= 'F'));
- }
-
- /**
- * Determine whether a char is an alphabetic character: a-z or A-Z
- *
- *
- * @param p_char the character to check
- * @return true if the char is alphabetic, false otherwise
- */
- private static boolean isAlpha(char p_char)
- {
- return ((p_char >= 'a' && p_char <= 'z')
- || (p_char >= 'A' && p_char <= 'Z'));
- }
-
- /**
- * Determine whether a char is an alphanumeric: 0-9, a-z or A-Z
- *
- *
- * @param p_char the character to check
- * @return true if the char is alphanumeric, false otherwise
- */
- private static boolean isAlphanum(char p_char)
- {
- return (isAlpha(p_char) || isDigit(p_char));
- }
-
- /**
- * Determine whether a character is a reserved character:
- * ';', '/', '?', ':', '@', '&', '=', '+', '$' or ','
- *
- *
- * @param p_char the character to check
- * @return true if the string contains any reserved characters
- */
- private static boolean isReservedCharacter(char p_char)
- {
- return RESERVED_CHARACTERS.indexOf(p_char) != -1;
- }
-
- /**
- * Determine whether a char is an unreserved character.
- *
- *
- * @param p_char the character to check
- * @return true if the char is unreserved, false otherwise
- */
- private static boolean isUnreservedCharacter(char p_char)
- {
- return (isAlphanum(p_char) || MARK_CHARACTERS.indexOf(p_char) != -1);
- }
-
- /**
- * Determine whether a given string contains only URI characters (also
- * called "uric" in RFC 2396). uric consist of all reserved
- * characters, unreserved characters and escaped characters.
- *
- *
- * @param p_uric URI string
- * @return true if the string is comprised of uric, false otherwise
- */
- private static boolean isURIString(String p_uric)
- {
-
- if (p_uric == null)
- {
- return false;
- }
-
- int end = p_uric.length();
- char testChar = '\0';
-
- for (int i = 0; i < end; i++)
- {
- testChar = p_uric.charAt(i);
-
- if (testChar == '%')
- {
- if (i + 2 >= end ||!isHex(p_uric.charAt(i + 1))
- ||!isHex(p_uric.charAt(i + 2)))
- {
- return false;
- }
- else
- {
- i += 2;
-
- continue;
- }
- }
-
- if (isReservedCharacter(testChar) || isUnreservedCharacter(testChar))
- {
- continue;
- }
- else
- {
- return false;
- }
- }
-
- return true;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/UnImplNode.java b/src/com/sun/org/apache/xml/internal/utils/UnImplNode.java
deleted file mode 100644
index dfe2766..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/UnImplNode.java
+++ /dev/null
@@ -1,2054 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: UnImplNode.java,v
- */
-package com.sun.org.apache.xml.internal.utils;
-
-import com.sun.org.apache.xml.internal.res.XMLErrorResources;
-import com.sun.org.apache.xml.internal.res.XMLMessages;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.CDATASection;
-import org.w3c.dom.Comment;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.EntityReference;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.ProcessingInstruction;
-import org.w3c.dom.Text;
-
-import org.w3c.dom.UserDataHandler;
-import org.w3c.dom.DOMConfiguration;
-import org.w3c.dom.TypeInfo;
-/**
- * <meta name="usage" content="internal"/>
- * To be subclassed by classes that wish to fake being nodes.
- */
-public class UnImplNode implements Node, Element, NodeList, Document
-{
-
- /**
- * Constructor UnImplNode
- *
- */
- public UnImplNode(){}
-
- /**
- * Throw an error.
- *
- * @param msg Message Key for the error
- */
- public void error(String msg)
- {
-
- System.out.println("DOM ERROR! class: " + this.getClass().getName());
-
- throw new RuntimeException(XMLMessages.createXMLMessage(msg, null));
- }
-
- /**
- * Throw an error.
- *
- * @param msg Message Key for the error
- * @param args Array of arguments to be used in the error message
- */
- public void error(String msg, Object[] args)
- {
-
- System.out.println("DOM ERROR! class: " + this.getClass().getName());
-
- throw new RuntimeException(XMLMessages.createXMLMessage(msg, args)); //"UnImplNode error: "+msg);
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Node
- *
- * @param newChild New node to append to the list of this node's children
- *
- * @return null
- *
- * @throws DOMException
- */
- public Node appendChild(Node newChild) throws DOMException
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"appendChild not supported!");
-
- return null;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Node
- *
- * @return false
- */
- public boolean hasChildNodes()
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"hasChildNodes not supported!");
-
- return false;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Node
- *
- * @return 0
- */
- public short getNodeType()
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getNodeType not supported!");
-
- return 0;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Node
- *
- * @return null
- */
- public Node getParentNode()
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getParentNode not supported!");
-
- return null;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Node
- *
- * @return null
- */
- public NodeList getChildNodes()
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getChildNodes not supported!");
-
- return null;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Node
- *
- * @return null
- */
- public Node getFirstChild()
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getFirstChild not supported!");
-
- return null;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Node
- *
- * @return null
- */
- public Node getLastChild()
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getLastChild not supported!");
-
- return null;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Node
- *
- * @return null
- */
- public Node getNextSibling()
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getNextSibling not supported!");
-
- return null;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.NodeList
- *
- * @return 0
- */
- public int getLength()
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getLength not supported!");
-
- return 0;
- } // getLength():int
-
- /**
- * Unimplemented. See org.w3c.dom.NodeList
- *
- * @param index index of a child of this node in its list of children
- *
- * @return null
- */
- public Node item(int index)
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"item not supported!");
-
- return null;
- } // item(int):Node
-
- /**
- * Unimplemented. See org.w3c.dom.Node
- *
- * @return null
- */
- public Document getOwnerDocument()
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getOwnerDocument not supported!");
-
- return null;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Node
- *
- * @return null
- */
- public String getTagName()
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getTagName not supported!");
-
- return null;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Node
- *
- * @return null
- */
- public String getNodeName()
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getNodeName not supported!");
-
- return null;
- }
-
- /** Unimplemented. See org.w3c.dom.Node */
- public void normalize()
- {
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"normalize not supported!");
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Element
- *
- * @param name Name of the element
- *
- * @return null
- */
- public NodeList getElementsByTagName(String name)
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getElementsByTagName not supported!");
-
- return null;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Element
- *
- * @param oldAttr Attribute to be removed from this node's list of attributes
- *
- * @return null
- *
- * @throws DOMException
- */
- public Attr removeAttributeNode(Attr oldAttr) throws DOMException
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"removeAttributeNode not supported!");
-
- return null;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Element
- *
- * @param newAttr Attribute node to be added to this node's list of attributes
- *
- * @return null
- *
- * @throws DOMException
- */
- public Attr setAttributeNode(Attr newAttr) throws DOMException
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"setAttributeNode not supported!");
-
- return null;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Element
- *
- *
- * @param name Name of an attribute
- *
- * @return false
- */
- public boolean hasAttribute(String name)
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"hasAttribute not supported!");
-
- return false;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Element
- *
- *
- * @param name
- * @param x
- *
- * @return false
- */
- public boolean hasAttributeNS(String name, String x)
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"hasAttributeNS not supported!");
-
- return false;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Element
- *
- *
- * @param name Attribute node name
- *
- * @return null
- */
- public Attr getAttributeNode(String name)
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getAttributeNode not supported!");
-
- return null;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Element
- *
- * @param name Attribute node name to remove from list of attributes
- *
- * @throws DOMException
- */
- public void removeAttribute(String name) throws DOMException
- {
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"removeAttribute not supported!");
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Element
- *
- * @param name Name of attribute to set
- * @param value Value of attribute
- *
- * @throws DOMException
- */
- public void setAttribute(String name, String value) throws DOMException
- {
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"setAttribute not supported!");
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Element
- *
- * @param name Name of attribute to get
- *
- * @return null
- */
- public String getAttribute(String name)
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getAttribute not supported!");
-
- return null;
- }
-
- /**
- * Unimplemented. Introduced in DOM Level 2.
- *
- * @return false
- */
- public boolean hasAttributes()
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"hasAttributes not supported!");
-
- return false;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Element
- *
- * @param namespaceURI Namespace URI of the element
- * @param localName Local part of qualified name of the element
- *
- * @return null
- */
- public NodeList getElementsByTagNameNS(String namespaceURI,
- String localName)
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getElementsByTagNameNS not supported!");
-
- return null;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Element
- *
- * @param newAttr Attribute to set
- *
- * @return null
- *
- * @throws DOMException
- */
- public Attr setAttributeNodeNS(Attr newAttr) throws DOMException
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"setAttributeNodeNS not supported!");
-
- return null;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Element
- *
- * @param namespaceURI Namespace URI of attribute node to get
- * @param localName Local part of qualified name of attribute node to get
- *
- * @return null
- */
- public Attr getAttributeNodeNS(String namespaceURI, String localName)
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getAttributeNodeNS not supported!");
-
- return null;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Element
- *
- * @param namespaceURI Namespace URI of attribute node to remove
- * @param localName Local part of qualified name of attribute node to remove
- *
- * @throws DOMException
- */
- public void removeAttributeNS(String namespaceURI, String localName)
- throws DOMException
- {
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"removeAttributeNS not supported!");
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Element
- *
- * @param namespaceURI Namespace URI of attribute node to set
- * @param qualifiedName qualified name of attribute
- * @param value value of attribute
- *
- * @throws DOMException
- */
- public void setAttributeNS(
- String namespaceURI, String qualifiedName, String value)
- throws DOMException
- {
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"setAttributeNS not supported!");
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Element
- *
- * @param namespaceURI Namespace URI of attribute node to get
- * @param localName Local part of qualified name of attribute node to get
- *
- * @return null
- */
- public String getAttributeNS(String namespaceURI, String localName)
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getAttributeNS not supported!");
-
- return null;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Node
- *
- * @return null
- */
- public Node getPreviousSibling()
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getPreviousSibling not supported!");
-
- return null;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Node
- *
- * @param deep Flag indicating whether to clone deep (clone member variables)
- *
- * @return null
- */
- public Node cloneNode(boolean deep)
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"cloneNode not supported!");
-
- return null;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Node
- *
- * @return null
- *
- * @throws DOMException
- */
- public String getNodeValue() throws DOMException
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getNodeValue not supported!");
-
- return null;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Node
- *
- * @param nodeValue Value to set this node to
- *
- * @throws DOMException
- */
- public void setNodeValue(String nodeValue) throws DOMException
- {
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"setNodeValue not supported!");
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Node
- *
- *
- * NEEDSDOC @param value
- * @return value Node value
- *
- * @throws DOMException
- */
-
- // public String getValue ()
- // {
- // error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getValue not supported!");
- // return null;
- // }
-
- /**
- * Unimplemented. See org.w3c.dom.Node
- *
- * @param value Value to set this node to
- *
- * @throws DOMException
- */
- public void setValue(String value) throws DOMException
- {
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"setValue not supported!");
- }
-
- /**
- * Returns the name of this attribute.
- *
- * @return the name of this attribute.
- */
-
- // public String getName()
- // {
- // return this.getNodeName();
- // }
-
- /**
- * Unimplemented. See org.w3c.dom.Node
- *
- * @return null
- */
- public Element getOwnerElement()
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getOwnerElement not supported!");
-
- return null;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Node
- *
- * @return False
- */
- public boolean getSpecified()
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"setValue not supported!");
-
- return false;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Node
- *
- * @return null
- */
- public NamedNodeMap getAttributes()
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getAttributes not supported!");
-
- return null;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Node
- *
- * @param newChild New child node to insert
- * @param refChild Insert in front of this child
- *
- * @return null
- *
- * @throws DOMException
- */
- public Node insertBefore(Node newChild, Node refChild) throws DOMException
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"insertBefore not supported!");
-
- return null;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Node
- *
- * @param newChild Replace existing child with this one
- * @param oldChild Existing child to be replaced
- *
- * @return null
- *
- * @throws DOMException
- */
- public Node replaceChild(Node newChild, Node oldChild) throws DOMException
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"replaceChild not supported!");
-
- return null;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Node
- *
- * @param oldChild Child to be removed
- *
- * @return null
- *
- * @throws DOMException
- */
- public Node removeChild(Node oldChild) throws DOMException
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"replaceChild not supported!");
-
- return null;
- }
-
- /**
- * Tests whether the DOM implementation implements a specific feature and
- * that feature is supported by this node.
- * @param feature The name of the feature to test. This is the same name
- * which can be passed to the method <code>hasFeature</code> on
- * <code>DOMImplementation</code>.
- * @param version This is the version number of the feature to test. In
- * Level 2, version 1, this is the string "2.0". If the version is not
- * specified, supporting any version of the feature will cause the
- * method to return <code>true</code>.
- *
- * @return Returns <code>false</code>
- * @since DOM Level 2
- */
- public boolean isSupported(String feature, String version)
- {
- return false;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Node
- *
- * @return null
- */
- public String getNamespaceURI()
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getNamespaceURI not supported!");
-
- return null;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Node
- *
- * @return null
- */
- public String getPrefix()
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getPrefix not supported!");
-
- return null;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Node
- *
- * @param prefix Prefix to set for this node
- *
- * @throws DOMException
- */
- public void setPrefix(String prefix) throws DOMException
- {
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"setPrefix not supported!");
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Node
- *
- * @return null
- */
- public String getLocalName()
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getLocalName not supported!");
-
- return null;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Document
- *
- * @return null
- */
- public DocumentType getDoctype()
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-
- return null;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Document
- *
- * @return null
- */
- public DOMImplementation getImplementation()
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-
- return null;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Document
- *
- * @return null
- */
- public Element getDocumentElement()
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-
- return null;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Document
- *
- * @param tagName Element tag name
- *
- * @return null
- *
- * @throws DOMException
- */
- public Element createElement(String tagName) throws DOMException
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-
- return null;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Document
- *
- * @return null
- */
- public DocumentFragment createDocumentFragment()
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-
- return null;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Document
- *
- * @param data Data for text node
- *
- * @return null
- */
- public Text createTextNode(String data)
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-
- return null;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Document
- *
- * @param data Data for comment
- *
- * @return null
- */
- public Comment createComment(String data)
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-
- return null;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Document
- *
- * @param data Data for CDATA section
- *
- * @return null
- *
- * @throws DOMException
- */
- public CDATASection createCDATASection(String data) throws DOMException
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-
- return null;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Document
- *
- * @param target Target for Processing instruction
- * @param data Data for Processing instruction
- *
- * @return null
- *
- * @throws DOMException
- */
- public ProcessingInstruction createProcessingInstruction(
- String target, String data) throws DOMException
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-
- return null;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Document
- *
- * @param name Attribute name
- *
- * @return null
- *
- * @throws DOMException
- */
- public Attr createAttribute(String name) throws DOMException
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-
- return null;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Document
- *
- * @param name Entity Reference name
- *
- * @return null
- *
- * @throws DOMException
- */
- public EntityReference createEntityReference(String name)
- throws DOMException
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-
- return null;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Document
- *
- * @param importedNode The node to import.
- * @param deep If <code>true</code>, recursively import the subtree under
- * the specified node; if <code>false</code>, import only the node
- * itself, as explained above. This has no effect on <code>Attr</code>
- * , <code>EntityReference</code>, and <code>Notation</code> nodes.
- *
- * @return null
- *
- * @throws DOMException
- */
- public Node importNode(Node importedNode, boolean deep) throws DOMException
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-
- return null;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Document
- *
- * @param namespaceURI Namespace URI for the element
- * @param qualifiedName Qualified name of the element
- *
- * @return null
- *
- * @throws DOMException
- */
- public Element createElementNS(String namespaceURI, String qualifiedName)
- throws DOMException
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-
- return null;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Document
- *
- * @param namespaceURI Namespace URI of the attribute
- * @param qualifiedName Qualified name of the attribute
- *
- * @return null
- *
- * @throws DOMException
- */
- public Attr createAttributeNS(String namespaceURI, String qualifiedName)
- throws DOMException
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-
- return null;
- }
-
- /**
- * Unimplemented. See org.w3c.dom.Document
- *
- * @param elementId ID of the element to get
- *
- * @return null
- */
- public Element getElementById(String elementId)
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-
- return null;
- }
-
- /**
- * Set Node data
- *
- *
- * @param data data to set for this node
- *
- * @throws DOMException
- */
- public void setData(String data) throws DOMException
- {
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
- }
-
- /**
- * Unimplemented.
- *
- * @param offset Start offset of substring to extract.
- * @param count The length of the substring to extract.
- *
- * @return null
- *
- * @throws DOMException
- */
- public String substringData(int offset, int count) throws DOMException
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-
- return null;
- }
-
- /**
- * Unimplemented.
- *
- * @param arg String data to append
- *
- * @throws DOMException
- */
- public void appendData(String arg) throws DOMException
- {
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
- }
-
- /**
- * Unimplemented.
- *
- * @param offset Start offset of substring to insert.
- * @param arg The (sub)string to insert.
- *
- * @throws DOMException
- */
- public void insertData(int offset, String arg) throws DOMException
- {
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
- }
-
- /**
- * Unimplemented.
- *
- * @param offset Start offset of substring to delete.
- * @param count The length of the substring to delete.
- *
- * @throws DOMException
- */
- public void deleteData(int offset, int count) throws DOMException
- {
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
- }
-
- /**
- * Unimplemented.
- *
- * @param offset Start offset of substring to replace.
- * @param count The length of the substring to replace.
- * @param arg substring to replace with
- *
- * @throws DOMException
- */
- public void replaceData(int offset, int count, String arg)
- throws DOMException
- {
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
- }
-
- /**
- * Unimplemented.
- *
- * @param offset Offset into text to split
- *
- * @return null, unimplemented
- *
- * @throws DOMException
- */
- public Text splitText(int offset) throws DOMException
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-
- return null;
- }
-
- /**
- * NEEDSDOC Method adoptNode
- *
- *
- * NEEDSDOC @param source
- *
- * NEEDSDOC (adoptNode) @return
- *
- * @throws DOMException
- */
- public Node adoptNode(Node source) throws DOMException
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-
- return null;
- }
-
- /**
- * <p>EXPERIMENTAL! Based on the <a
- * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
- * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
- * <p>
- * An attribute specifying, as part of the XML declaration, the encoding
- * of this document. This is <code>null</code> when unspecified.
- * @since DOM Level 3
- *
- * NEEDSDOC ($objectName$) @return
- */
- public String getInputEncoding()
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-
- return null;
- }
-
- /**
- * <p>EXPERIMENTAL! Based on the <a
- * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
- * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
- * <p>
- * An attribute specifying, as part of the XML declaration, the encoding
- * of this document. This is <code>null</code> when unspecified.
- * @since DOM Level 3
- *
- * NEEDSDOC @param encoding
- */
- public void setInputEncoding(String encoding)
- {
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
- }
-
- /**
- * <p>EXPERIMENTAL! Based on the <a
- * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
- * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
- * <p>
- * An attribute specifying, as part of the XML declaration, whether this
- * document is standalone.
- * @since DOM Level 3
- *
- * NEEDSDOC ($objectName$) @return
- */
- public boolean getStandalone()
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-
- return false;
- }
-
- /**
- * <p>EXPERIMENTAL! Based on the <a
- * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
- * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
- * <p>
- * An attribute specifying, as part of the XML declaration, whether this
- * document is standalone.
- * @since DOM Level 3
- *
- * NEEDSDOC @param standalone
- */
- public void setStandalone(boolean standalone)
- {
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
- }
-
- /**
- * <p>EXPERIMENTAL! Based on the <a
- * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
- * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
- * <p>
- * An attribute specifying whether errors checking is enforced or not.
- * When set to <code>false</code>, the implementation is free to not
- * test every possible error case normally defined on DOM operations,
- * and not raise any <code>DOMException</code>. In case of error, the
- * behavior is undefined. This attribute is <code>true</code> by
- * defaults.
- * @since DOM Level 3
- *
- * NEEDSDOC ($objectName$) @return
- */
- public boolean getStrictErrorChecking()
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-
- return false;
- }
-
- /**
- * <p>EXPERIMENTAL! Based on the <a
- * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
- * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
- * <p>
- * An attribute specifying whether errors checking is enforced or not.
- * When set to <code>false</code>, the implementation is free to not
- * test every possible error case normally defined on DOM operations,
- * and not raise any <code>DOMException</code>. In case of error, the
- * behavior is undefined. This attribute is <code>true</code> by
- * defaults.
- * @since DOM Level 3
- *
- * NEEDSDOC @param strictErrorChecking
- */
- public void setStrictErrorChecking(boolean strictErrorChecking)
- {
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
- }
-
- /**
- * <p>EXPERIMENTAL! Based on the <a
- * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
- * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
- * <p>
- * An attribute specifying, as part of the XML declaration, the version
- * number of this document. This is <code>null</code> when unspecified.
- * @since DOM Level 3
- *
- * NEEDSDOC ($objectName$) @return
- */
- public String getVersion()
- {
-
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
-
- return null;
- }
-
- /**
- * <p>EXPERIMENTAL! Based on the <a
- * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
- * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
- * <p>
- * An attribute specifying, as part of the XML declaration, the version
- * number of this document. This is <code>null</code> when unspecified.
- * @since DOM Level 3
- *
- * NEEDSDOC @param version
- */
- public void setVersion(String version)
- {
- error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
- }
-
-
-
-//RAMESH : Pending proper implementation of DOM Level 3
-
- public Object setUserData(String key,
- Object data,
- UserDataHandler handler) {
- return getOwnerDocument().setUserData( key, data, handler);
- }
-
- /**
- * Retrieves the object associated to a key on a this node. The object
- * must first have been set to this node by calling
- * <code>setUserData</code> with the same key.
- * @param key The key the object is associated to.
- * @return Returns the <code>DOMObject</code> associated to the given key
- * on this node, or <code>null</code> if there was none.
- * @since DOM Level 3
- */
- public Object getUserData(String key) {
- return getOwnerDocument().getUserData( key);
- }
-
- /**
- * This method returns a specialized object which implements the
- * specialized APIs of the specified feature and version. The
- * specialized object may also be obtained by using binding-specific
- * casting methods but is not necessarily expected to, as discussed in Mixed DOM implementations.
- * @param feature The name of the feature requested (case-insensitive).
- * @param version This is the version number of the feature to test. If
- * the version is <code>null</code> or the empty string, supporting
- * any version of the feature will cause the method to return an
- * object that supports at least one version of the feature.
- * @return Returns an object which implements the specialized APIs of
- * the specified feature and version, if any, or <code>null</code> if
- * there is no object which implements interfaces associated with that
- * feature. If the <code>DOMObject</code> returned by this method
- * implements the <code>Node</code> interface, it must delegate to the
- * primary core <code>Node</code> and not return results inconsistent
- * with the primary core <code>Node</code> such as attributes,
- * childNodes, etc.
- * @since DOM Level 3
- */
- public Object getFeature(String feature, String version) {
- // we don't have any alternate node, either this node does the job
- // or we don't have anything that does
- return isSupported(feature, version) ? this : null;
- }
-
- /**
- * Tests whether two nodes are equal.
- * <br>This method tests for equality of nodes, not sameness (i.e.,
- * whether the two nodes are references to the same object) which can be
- * tested with <code>Node.isSameNode</code>. All nodes that are the same
- * will also be equal, though the reverse may not be true.
- * <br>Two nodes are equal if and only if the following conditions are
- * satisfied: The two nodes are of the same type.The following string
- * attributes are equal: <code>nodeName</code>, <code>localName</code>,
- * <code>namespaceURI</code>, <code>prefix</code>, <code>nodeValue</code>
- * , <code>baseURI</code>. This is: they are both <code>null</code>, or
- * they have the same length and are character for character identical.
- * The <code>attributes</code> <code>NamedNodeMaps</code> are equal.
- * This is: they are both <code>null</code>, or they have the same
- * length and for each node that exists in one map there is a node that
- * exists in the other map and is equal, although not necessarily at the
- * same index.The <code>childNodes</code> <code>NodeLists</code> are
- * equal. This is: they are both <code>null</code>, or they have the
- * same length and contain equal nodes at the same index. This is true
- * for <code>Attr</code> nodes as for any other type of node. Note that
- * normalization can affect equality; to avoid this, nodes should be
- * normalized before being compared.
- * <br>For two <code>DocumentType</code> nodes to be equal, the following
- * conditions must also be satisfied: The following string attributes
- * are equal: <code>publicId</code>, <code>systemId</code>,
- * <code>internalSubset</code>.The <code>entities</code>
- * <code>NamedNodeMaps</code> are equal.The <code>notations</code>
- * <code>NamedNodeMaps</code> are equal.
- * <br>On the other hand, the following do not affect equality: the
- * <code>ownerDocument</code> attribute, the <code>specified</code>
- * attribute for <code>Attr</code> nodes, the
- * <code>isWhitespaceInElementContent</code> attribute for
- * <code>Text</code> nodes, as well as any user data or event listeners
- * registered on the nodes.
- *
- * @param arg The node to compare equality with.
- * @return If the nodes, and possibly subtrees are equal,
- * <code>true</code> otherwise <code>false</code>.
- * @since DOM Level 3
- */
- public boolean isEqualNode(Node arg) {
- if (arg == this) {
- return true;
- }
- if (arg.getNodeType() != getNodeType()) {
- return false;
- }
- // in theory nodeName can't be null but better be careful
- // who knows what other implementations may be doing?...
- if (getNodeName() == null) {
- if (arg.getNodeName() != null) {
- return false;
- }
- }
- else if (!getNodeName().equals(arg.getNodeName())) {
- return false;
- }
-
- if (getLocalName() == null) {
- if (arg.getLocalName() != null) {
- return false;
- }
- }
- else if (!getLocalName().equals(arg.getLocalName())) {
- return false;
- }
-
- if (getNamespaceURI() == null) {
- if (arg.getNamespaceURI() != null) {
- return false;
- }
- }
- else if (!getNamespaceURI().equals(arg.getNamespaceURI())) {
- return false;
- }
-
- if (getPrefix() == null) {
- if (arg.getPrefix() != null) {
- return false;
- }
- }
- else if (!getPrefix().equals(arg.getPrefix())) {
- return false;
- }
-
- if (getNodeValue() == null) {
- if (arg.getNodeValue() != null) {
- return false;
- }
- }
- else if (!getNodeValue().equals(arg.getNodeValue())) {
- return false;
- }
- /*
- if (getBaseURI() == null) {
- if (((NodeImpl) arg).getBaseURI() != null) {
- return false;
- }
- }
- else if (!getBaseURI().equals(((NodeImpl) arg).getBaseURI())) {
- return false;
- }
-*/
-
- return true;
- }
-
- /**
- * DOM Level 3 - Experimental:
- * Look up the namespace URI associated to the given prefix, starting from this node.
- * Use lookupNamespaceURI(null) to lookup the default namespace
- *
- * @param namespaceURI
- * @return th URI for the namespace
- * @since DOM Level 3
- */
- public String lookupNamespaceURI(String specifiedPrefix) {
- short type = this.getNodeType();
- switch (type) {
- case Node.ELEMENT_NODE : {
-
- String namespace = this.getNamespaceURI();
- String prefix = this.getPrefix();
- if (namespace !=null) {
- // REVISIT: is it possible that prefix is empty string?
- if (specifiedPrefix== null && prefix==specifiedPrefix) {
- // looking for default namespace
- return namespace;
- } else if (prefix != null && prefix.equals(specifiedPrefix)) {
- // non default namespace
- return namespace;
- }
- }
- if (this.hasAttributes()) {
- NamedNodeMap map = this.getAttributes();
- int length = map.getLength();
- for (int i=0;i<length;i++) {
- Node attr = map.item(i);
- String attrPrefix = attr.getPrefix();
- String value = attr.getNodeValue();
- namespace = attr.getNamespaceURI();
- if (namespace !=null && namespace.equals("http://www.w3.org/2000/xmlns/")) {
- // at this point we are dealing with DOM Level 2 nodes only
- if (specifiedPrefix == null &&
- attr.getNodeName().equals("xmlns")) {
- // default namespace
- return value;
- } else if (attrPrefix !=null &&
- attrPrefix.equals("xmlns") &&
- attr.getLocalName().equals(specifiedPrefix)) {
- // non default namespace
- return value;
- }
- }
- }
- }
- /*
- NodeImpl ancestor = (NodeImpl)getElementAncestor(this);
- if (ancestor != null) {
- return ancestor.lookupNamespaceURI(specifiedPrefix);
- }
- */
-
- return null;
-
-
- }
-/*
- case Node.DOCUMENT_NODE : {
- return((NodeImpl)((Document)this).getDocumentElement()).lookupNamespaceURI(specifiedPrefix) ;
- }
-*/
- case Node.ENTITY_NODE :
- case Node.NOTATION_NODE:
- case Node.DOCUMENT_FRAGMENT_NODE:
- case Node.DOCUMENT_TYPE_NODE:
- // type is unknown
- return null;
- case Node.ATTRIBUTE_NODE:{
- if (this.getOwnerElement().getNodeType() == Node.ELEMENT_NODE) {
- return getOwnerElement().lookupNamespaceURI(specifiedPrefix);
-
- }
- return null;
- }
- default:{
- /*
- NodeImpl ancestor = (NodeImpl)getElementAncestor(this);
- if (ancestor != null) {
- return ancestor.lookupNamespaceURI(specifiedPrefix);
- }
- */
- return null;
- }
-
- }
- }
-
-
- /**
- * DOM Level 3: Experimental
- * This method checks if the specified <code>namespaceURI</code> is the
- * default namespace or not.
- * @param namespaceURI The namespace URI to look for.
- * @return <code>true</code> if the specified <code>namespaceURI</code>
- * is the default namespace, <code>false</code> otherwise.
- * @since DOM Level 3
- */
- public boolean isDefaultNamespace(String namespaceURI){
- /*
- // REVISIT: remove casts when DOM L3 becomes REC.
- short type = this.getNodeType();
- switch (type) {
- case Node.ELEMENT_NODE: {
- String namespace = this.getNamespaceURI();
- String prefix = this.getPrefix();
-
- // REVISIT: is it possible that prefix is empty string?
- if (prefix == null || prefix.length() == 0) {
- if (namespaceURI == null) {
- return (namespace == namespaceURI);
- }
- return namespaceURI.equals(namespace);
- }
- if (this.hasAttributes()) {
- ElementImpl elem = (ElementImpl)this;
- NodeImpl attr = (NodeImpl)elem.getAttributeNodeNS("http://www.w3.org/2000/xmlns/", "xmlns");
- if (attr != null) {
- String value = attr.getNodeValue();
- if (namespaceURI == null) {
- return (namespace == value);
- }
- return namespaceURI.equals(value);
- }
- }
-
- NodeImpl ancestor = (NodeImpl)getElementAncestor(this);
- if (ancestor != null) {
- return ancestor.isDefaultNamespace(namespaceURI);
- }
- return false;
- }
- case Node.DOCUMENT_NODE:{
- return((NodeImpl)((Document)this).getDocumentElement()).isDefaultNamespace(namespaceURI);
- }
-
- case Node.ENTITY_NODE :
- case Node.NOTATION_NODE:
- case Node.DOCUMENT_FRAGMENT_NODE:
- case Node.DOCUMENT_TYPE_NODE:
- // type is unknown
- return false;
- case Node.ATTRIBUTE_NODE:{
- if (this.ownerNode.getNodeType() == Node.ELEMENT_NODE) {
- return ownerNode.isDefaultNamespace(namespaceURI);
-
- }
- return false;
- }
- default:{
- NodeImpl ancestor = (NodeImpl)getElementAncestor(this);
- if (ancestor != null) {
- return ancestor.isDefaultNamespace(namespaceURI);
- }
- return false;
- }
-
- }
-*/
- return false;
-
-
- }
-
- /**
- *
- * DOM Level 3 - Experimental:
- * Look up the prefix associated to the given namespace URI, starting from this node.
- *
- * @param namespaceURI
- * @return the prefix for the namespace
- */
- public String lookupPrefix(String namespaceURI){
-
- // REVISIT: When Namespaces 1.1 comes out this may not be true
- // Prefix can't be bound to null namespace
- if (namespaceURI == null) {
- return null;
- }
-
- short type = this.getNodeType();
-
- switch (type) {
-/*
- case Node.ELEMENT_NODE: {
-
- String namespace = this.getNamespaceURI(); // to flip out children
- return lookupNamespacePrefix(namespaceURI, (ElementImpl)this);
- }
-
- case Node.DOCUMENT_NODE:{
- return((NodeImpl)((Document)this).getDocumentElement()).lookupPrefix(namespaceURI);
- }
-*/
- case Node.ENTITY_NODE :
- case Node.NOTATION_NODE:
- case Node.DOCUMENT_FRAGMENT_NODE:
- case Node.DOCUMENT_TYPE_NODE:
- // type is unknown
- return null;
- case Node.ATTRIBUTE_NODE:{
- if (this.getOwnerElement().getNodeType() == Node.ELEMENT_NODE) {
- return getOwnerElement().lookupPrefix(namespaceURI);
-
- }
- return null;
- }
- default:{
-/*
- NodeImpl ancestor = (NodeImpl)getElementAncestor(this);
- if (ancestor != null) {
- return ancestor.lookupPrefix(namespaceURI);
- }
-*/
- return null;
- }
- }
- }
-
- /**
- * Returns whether this node is the same node as the given one.
- * <br>This method provides a way to determine whether two
- * <code>Node</code> references returned by the implementation reference
- * the same object. When two <code>Node</code> references are references
- * to the same object, even if through a proxy, the references may be
- * used completely interchangably, such that all attributes have the
- * same values and calling the same DOM method on either reference
- * always has exactly the same effect.
- * @param other The node to test against.
- * @return Returns <code>true</code> if the nodes are the same,
- * <code>false</code> otherwise.
- * @since DOM Level 3
- */
- public boolean isSameNode(Node other) {
- // we do not use any wrapper so the answer is obvious
- return this == other;
- }
-
- /**
- * This attribute returns the text content of this node and its
- * descendants. When it is defined to be null, setting it has no effect.
- * When set, any possible children this node may have are removed and
- * replaced by a single <code>Text</code> node containing the string
- * this attribute is set to. On getting, no serialization is performed,
- * the returned string does not contain any markup. No whitespace
- * normalization is performed, the returned string does not contain the
- * element content whitespaces . Similarly, on setting, no parsing is
- * performed either, the input string is taken as pure textual content.
- * <br>The string returned is made of the text content of this node
- * depending on its type, as defined below:
- * <table border='1'>
- * <tr>
- * <th>Node type</th>
- * <th>Content</th>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>
- * ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE,
- * DOCUMENT_FRAGMENT_NODE</td>
- * <td valign='top' rowspan='1' colspan='1'>concatenation of the <code>textContent</code>
- * attribute value of every child node, excluding COMMENT_NODE and
- * PROCESSING_INSTRUCTION_NODE nodes</td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>ATTRIBUTE_NODE, TEXT_NODE,
- * CDATA_SECTION_NODE, COMMENT_NODE, PROCESSING_INSTRUCTION_NODE</td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <code>nodeValue</code></td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>DOCUMENT_NODE, DOCUMENT_TYPE_NODE, NOTATION_NODE</td>
- * <td valign='top' rowspan='1' colspan='1'>
- * null</td>
- * </tr>
- * </table>
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
- * @exception DOMException
- * DOMSTRING_SIZE_ERR: Raised when it would return more characters than
- * fit in a <code>DOMString</code> variable on the implementation
- * platform.
- * @since DOM Level 3
- */
- public void setTextContent(String textContent)
- throws DOMException {
- setNodeValue(textContent);
- }
- /**
- * This attribute returns the text content of this node and its
- * descendants. When it is defined to be null, setting it has no effect.
- * When set, any possible children this node may have are removed and
- * replaced by a single <code>Text</code> node containing the string
- * this attribute is set to. On getting, no serialization is performed,
- * the returned string does not contain any markup. No whitespace
- * normalization is performed, the returned string does not contain the
- * element content whitespaces . Similarly, on setting, no parsing is
- * performed either, the input string is taken as pure textual content.
- * <br>The string returned is made of the text content of this node
- * depending on its type, as defined below:
- * <table border='1'>
- * <tr>
- * <th>Node type</th>
- * <th>Content</th>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>
- * ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE,
- * DOCUMENT_FRAGMENT_NODE</td>
- * <td valign='top' rowspan='1' colspan='1'>concatenation of the <code>textContent</code>
- * attribute value of every child node, excluding COMMENT_NODE and
- * PROCESSING_INSTRUCTION_NODE nodes</td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>ATTRIBUTE_NODE, TEXT_NODE,
- * CDATA_SECTION_NODE, COMMENT_NODE, PROCESSING_INSTRUCTION_NODE</td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <code>nodeValue</code></td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>DOCUMENT_NODE, DOCUMENT_TYPE_NODE, NOTATION_NODE</td>
- * <td valign='top' rowspan='1' colspan='1'>
- * null</td>
- * </tr>
- * </table>
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
- * @exception DOMException
- * DOMSTRING_SIZE_ERR: Raised when it would return more characters than
- * fit in a <code>DOMString</code> variable on the implementation
- * platform.
- * @since DOM Level 3
- */
- public String getTextContent() throws DOMException {
- return getNodeValue(); // overriden in some subclasses
- }
-
- /**
- * Compares a node with this node with regard to their position in the
- * document.
- * @param other The node to compare against this node.
- * @return Returns how the given node is positioned relatively to this
- * node.
- * @since DOM Level 3
- */
- public short compareDocumentPosition(Node other) throws DOMException {
- return 0;
- }
-
- /**
- * The absolute base URI of this node or <code>null</code> if undefined.
- * This value is computed according to . However, when the
- * <code>Document</code> supports the feature "HTML" , the base URI is
- * computed using first the value of the href attribute of the HTML BASE
- * element if any, and the value of the <code>documentURI</code>
- * attribute from the <code>Document</code> interface otherwise.
- * <br> When the node is an <code>Element</code>, a <code>Document</code>
- * or a a <code>ProcessingInstruction</code>, this attribute represents
- * the properties [base URI] defined in . When the node is a
- * <code>Notation</code>, an <code>Entity</code>, or an
- * <code>EntityReference</code>, this attribute represents the
- * properties [declaration base URI] in the . How will this be affected
- * by resolution of relative namespace URIs issue?It's not.Should this
- * only be on Document, Element, ProcessingInstruction, Entity, and
- * Notation nodes, according to the infoset? If not, what is it equal to
- * on other nodes? Null? An empty string? I think it should be the
- * parent's.No.Should this be read-only and computed or and actual
- * read-write attribute?Read-only and computed (F2F 19 Jun 2000 and
- * teleconference 30 May 2001).If the base HTML element is not yet
- * attached to a document, does the insert change the Document.baseURI?
- * Yes. (F2F 26 Sep 2001)
- * @since DOM Level 3
- */
- public String getBaseURI() {
- return null;
- }
-
- /**
- * DOM Level 3 WD - Experimental.
- * Renaming node
- */
- public Node renameNode(Node n,
- String namespaceURI,
- String name)
- throws DOMException{
- return n;
- }
-
-
- /**
- * DOM Level 3 WD - Experimental
- * Normalize document.
- */
- public void normalizeDocument(){
-
- }
- /**
- * The configuration used when <code>Document.normalizeDocument</code> is
- * invoked.
- * @since DOM Level 3
- */
- public DOMConfiguration getDomConfig(){
- return null;
- }
-
-
- /**Experimental DOM Level 3 feature: documentURI */
- protected String fDocumentURI;
-
- /**
- * DOM Level 3 WD - Experimental.
- */
- public void setDocumentURI(String documentURI){
-
- fDocumentURI= documentURI;
- }
-
- /**
- * DOM Level 3 WD - Experimental.
- * The location of the document or <code>null</code> if undefined.
- * <br>Beware that when the <code>Document</code> supports the feature
- * "HTML" , the href attribute of the HTML BASE element takes precedence
- * over this attribute.
- * @since DOM Level 3
- */
- public String getDocumentURI(){
- return fDocumentURI;
- }
-
- /**Experimental DOM Level 3 feature: Document actualEncoding */
- protected String actualEncoding;
-
- /**
- * DOM Level 3 WD - Experimental.
- * An attribute specifying the actual encoding of this document. This is
- * <code>null</code> otherwise.
- * <br> This attribute represents the property [character encoding scheme]
- * defined in .
- * @since DOM Level 3
- */
- public String getActualEncoding() {
- return actualEncoding;
- }
-
- /**
- * DOM Level 3 WD - Experimental.
- * An attribute specifying the actual encoding of this document. This is
- * <code>null</code> otherwise.
- * <br> This attribute represents the property [character encoding scheme]
- * defined in .
- * @since DOM Level 3
- */
- public void setActualEncoding(String value) {
- actualEncoding = value;
- }
-
- /**
- * DOM Level 3 WD - Experimental.
- */
- public Text replaceWholeText(String content)
- throws DOMException{
-/*
-
- if (needsSyncData()) {
- synchronizeData();
- }
-
- // make sure we can make the replacement
- if (!canModify(nextSibling)) {
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
- DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null));
- }
-
- Node parent = this.getParentNode();
- if (content == null || content.length() == 0) {
- // remove current node
- if (parent !=null) { // check if node in the tree
- parent.removeChild(this);
- return null;
- }
- }
- Text currentNode = null;
- if (isReadOnly()){
- Text newNode = this.ownerDocument().createTextNode(content);
- if (parent !=null) { // check if node in the tree
- parent.insertBefore(newNode, this);
- parent.removeChild(this);
- currentNode = newNode;
- } else {
- return newNode;
- }
- } else {
- this.setData(content);
- currentNode = this;
- }
- Node sibling = currentNode.getNextSibling();
- while ( sibling !=null) {
- parent.removeChild(sibling);
- sibling = currentNode.getNextSibling();
- }
-
- return currentNode;
-*/
- return null; //Pending
- }
-
- /**
- * DOM Level 3 WD - Experimental.
- * Returns all text of <code>Text</code> nodes logically-adjacent text
- * nodes to this node, concatenated in document order.
- * @since DOM Level 3
- */
- public String getWholeText(){
-
-/*
- if (needsSyncData()) {
- synchronizeData();
- }
- if (nextSibling == null) {
- return data;
- }
- StringBuffer buffer = new StringBuffer();
- if (data != null && data.length() != 0) {
- buffer.append(data);
- }
- getWholeText(nextSibling, buffer);
- return buffer.toString();
-*/
- return null; // PENDING
-
- }
-
- /**
- * DOM Level 3 WD - Experimental.
- * Returns whether this text node contains whitespace in element content,
- * often abusively called "ignorable whitespace".
- */
- public boolean isWhitespaceInElementContent(){
- return false;
- }
-
-
-
-
- /**
- * NON-DOM: set the type of this attribute to be ID type.
- *
- * @param id
- */
- public void setIdAttribute(boolean id){
- //PENDING
- }
-
- /**
- * DOM Level 3: register the given attribute node as an ID attribute
- */
- public void setIdAttribute(String name, boolean makeId) {
- //PENDING
- }
-
-
- /**
- * DOM Level 3: register the given attribute node as an ID attribute
- */
- public void setIdAttributeNode(Attr at, boolean makeId) {
- //PENDING
- }
-
- /**
- * DOM Level 3: register the given attribute node as an ID attribute
- */
- public void setIdAttributeNS(String namespaceURI, String localName,
- boolean makeId) {
- //PENDING
- }
- /**
- * Method getSchemaTypeInfo.
- * @return TypeInfo
- */
- public TypeInfo getSchemaTypeInfo(){
- return null; //PENDING
- }
-
- public boolean isId() {
- return false; //PENDING
- }
-
- private String xmlEncoding;
- public String getXmlEncoding ( ) {
- return xmlEncoding;
- }
- public void setXmlEncoding ( String xmlEncoding ) {
- this.xmlEncoding = xmlEncoding;
- }
-
- private boolean xmlStandalone;
- public boolean getXmlStandalone() {
- return xmlStandalone;
- }
-
- public void setXmlStandalone(boolean xmlStandalone) throws DOMException {
- this.xmlStandalone = xmlStandalone;
- }
-
- private String xmlVersion;
- public String getXmlVersion() {
- return xmlVersion;
- }
-
- public void setXmlVersion(String xmlVersion) throws DOMException {
- this.xmlVersion = xmlVersion;
- }
-
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/WrappedRuntimeException.java b/src/com/sun/org/apache/xml/internal/utils/WrappedRuntimeException.java
deleted file mode 100644
index 9de632b..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/WrappedRuntimeException.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: WrappedRuntimeException.java,v 1.2.4.1 2005/09/15 08:16:00 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-/**
- * This class is for throwing important checked exceptions
- * over non-checked methods. It should be used with care,
- * and in limited circumstances.
- */
-public class WrappedRuntimeException extends RuntimeException
-{
- static final long serialVersionUID = 7140414456714658073L;
-
- /** Primary checked exception.
- * @serial */
- private Exception m_exception;
-
- /**
- * Construct a WrappedRuntimeException from a
- * checked exception.
- *
- * @param e Primary checked exception
- */
- public WrappedRuntimeException(Exception e)
- {
-
- super(e.getMessage());
-
- m_exception = e;
- }
-
- /**
- * Constructor WrappedRuntimeException
- *
- *
- * @param msg Exception information.
- * @param e Primary checked exception
- */
- public WrappedRuntimeException(String msg, Exception e)
- {
-
- super(msg);
-
- m_exception = e;
- }
-
- /**
- * Get the checked exception that this runtime exception wraps.
- *
- * @return The primary checked exception
- */
- public Exception getException()
- {
- return m_exception;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/WrongParserException.java b/src/com/sun/org/apache/xml/internal/utils/WrongParserException.java
deleted file mode 100644
index 0fe9310..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/WrongParserException.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: WrongParserException.java,v 1.2.4.1 2005/09/15 08:16:00 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-/**
- * Certain functions may throw this error if they are paired with
- * the incorrect parser.
- * @xsl.usage general
- */
-public class WrongParserException extends RuntimeException
-{
- static final long serialVersionUID = 6481643018533043846L;
-
- /**
- * Create a WrongParserException object.
- * @param message The error message that should be reported to the user.
- */
- public WrongParserException(String message)
- {
- super(message);
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/XML11Char.java b/src/com/sun/org/apache/xml/internal/utils/XML11Char.java
deleted file mode 100644
index 05bb315..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/XML11Char.java
+++ /dev/null
@@ -1,432 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xml.internal.utils;
-
-import java.util.Arrays;
-
-
-/**
- * THIS IS A COPY OF THE XERCES-2J CLASS com.sun.org.apache.xerces.internal.utls.XMLChar
- *
- * This class defines the basic properties of characters in XML 1.1. The data
- * in this class can be used to verify that a character is a valid
- * XML 1.1 character or if the character is a space, name start, or name
- * character.
- * <p>
- * A series of convenience methods are supplied to ease the burden
- * of the developer. Using the character as an index into the <code>XML11CHARS</code>
- * array and applying the appropriate mask flag (e.g.
- * <code>MASK_VALID</code>), yields the same results as calling the
- * convenience methods. There is one exception: check the comments
- * for the <code>isValid</code> method for details.
- *
- */
-public class XML11Char {
-
- //
- // Constants
- //
-
- /** Character flags for XML 1.1. */
- private static final byte XML11CHARS [] = new byte [1 << 16];
-
- /** XML 1.1 Valid character mask. */
- public static final int MASK_XML11_VALID = 0x01;
-
- /** XML 1.1 Space character mask. */
- public static final int MASK_XML11_SPACE = 0x02;
-
- /** XML 1.1 Name start character mask. */
- public static final int MASK_XML11_NAME_START = 0x04;
-
- /** XML 1.1 Name character mask. */
- public static final int MASK_XML11_NAME = 0x08;
-
- /** XML 1.1 control character mask */
- public static final int MASK_XML11_CONTROL = 0x10;
-
- /** XML 1.1 content for external entities (valid - "special" chars - control chars) */
- public static final int MASK_XML11_CONTENT = 0x20;
-
- /** XML namespaces 1.1 NCNameStart */
- public static final int MASK_XML11_NCNAME_START = 0x40;
-
- /** XML namespaces 1.1 NCName */
- public static final int MASK_XML11_NCNAME = 0x80;
-
- /** XML 1.1 content for internal entities (valid - "special" chars) */
- public static final int MASK_XML11_CONTENT_INTERNAL = MASK_XML11_CONTROL | MASK_XML11_CONTENT;
-
- //
- // Static initialization
- //
-
- static {
-
- // Initializing the Character Flag Array
- // Code generated by: XML11CharGenerator.
-
- Arrays.fill(XML11CHARS, 1, 9, (byte) 17 ); // Fill 8 of value (byte) 17
- XML11CHARS[9] = 35;
- XML11CHARS[10] = 3;
- Arrays.fill(XML11CHARS, 11, 13, (byte) 17 ); // Fill 2 of value (byte) 17
- XML11CHARS[13] = 3;
- Arrays.fill(XML11CHARS, 14, 32, (byte) 17 ); // Fill 18 of value (byte) 17
- XML11CHARS[32] = 35;
- Arrays.fill(XML11CHARS, 33, 38, (byte) 33 ); // Fill 5 of value (byte) 33
- XML11CHARS[38] = 1;
- Arrays.fill(XML11CHARS, 39, 45, (byte) 33 ); // Fill 6 of value (byte) 33
- Arrays.fill(XML11CHARS, 45, 47, (byte) -87 ); // Fill 2 of value (byte) -87
- XML11CHARS[47] = 33;
- Arrays.fill(XML11CHARS, 48, 58, (byte) -87 ); // Fill 10 of value (byte) -87
- XML11CHARS[58] = 45;
- XML11CHARS[59] = 33;
- XML11CHARS[60] = 1;
- Arrays.fill(XML11CHARS, 61, 65, (byte) 33 ); // Fill 4 of value (byte) 33
- Arrays.fill(XML11CHARS, 65, 91, (byte) -19 ); // Fill 26 of value (byte) -19
- Arrays.fill(XML11CHARS, 91, 93, (byte) 33 ); // Fill 2 of value (byte) 33
- XML11CHARS[93] = 1;
- XML11CHARS[94] = 33;
- XML11CHARS[95] = -19;
- XML11CHARS[96] = 33;
- Arrays.fill(XML11CHARS, 97, 123, (byte) -19 ); // Fill 26 of value (byte) -19
- Arrays.fill(XML11CHARS, 123, 127, (byte) 33 ); // Fill 4 of value (byte) 33
- Arrays.fill(XML11CHARS, 127, 133, (byte) 17 ); // Fill 6 of value (byte) 17
- XML11CHARS[133] = 35;
- Arrays.fill(XML11CHARS, 134, 160, (byte) 17 ); // Fill 26 of value (byte) 17
- Arrays.fill(XML11CHARS, 160, 183, (byte) 33 ); // Fill 23 of value (byte) 33
- XML11CHARS[183] = -87;
- Arrays.fill(XML11CHARS, 184, 192, (byte) 33 ); // Fill 8 of value (byte) 33
- Arrays.fill(XML11CHARS, 192, 215, (byte) -19 ); // Fill 23 of value (byte) -19
- XML11CHARS[215] = 33;
- Arrays.fill(XML11CHARS, 216, 247, (byte) -19 ); // Fill 31 of value (byte) -19
- XML11CHARS[247] = 33;
- Arrays.fill(XML11CHARS, 248, 768, (byte) -19 ); // Fill 520 of value (byte) -19
- Arrays.fill(XML11CHARS, 768, 880, (byte) -87 ); // Fill 112 of value (byte) -87
- Arrays.fill(XML11CHARS, 880, 894, (byte) -19 ); // Fill 14 of value (byte) -19
- XML11CHARS[894] = 33;
- Arrays.fill(XML11CHARS, 895, 8192, (byte) -19 ); // Fill 7297 of value (byte) -19
- Arrays.fill(XML11CHARS, 8192, 8204, (byte) 33 ); // Fill 12 of value (byte) 33
- Arrays.fill(XML11CHARS, 8204, 8206, (byte) -19 ); // Fill 2 of value (byte) -19
- Arrays.fill(XML11CHARS, 8206, 8232, (byte) 33 ); // Fill 26 of value (byte) 33
- XML11CHARS[8232] = 35;
- Arrays.fill(XML11CHARS, 8233, 8255, (byte) 33 ); // Fill 22 of value (byte) 33
- Arrays.fill(XML11CHARS, 8255, 8257, (byte) -87 ); // Fill 2 of value (byte) -87
- Arrays.fill(XML11CHARS, 8257, 8304, (byte) 33 ); // Fill 47 of value (byte) 33
- Arrays.fill(XML11CHARS, 8304, 8592, (byte) -19 ); // Fill 288 of value (byte) -19
- Arrays.fill(XML11CHARS, 8592, 11264, (byte) 33 ); // Fill 2672 of value (byte) 33
- Arrays.fill(XML11CHARS, 11264, 12272, (byte) -19 ); // Fill 1008 of value (byte) -19
- Arrays.fill(XML11CHARS, 12272, 12289, (byte) 33 ); // Fill 17 of value (byte) 33
- Arrays.fill(XML11CHARS, 12289, 55296, (byte) -19 ); // Fill 43007 of value (byte) -19
- Arrays.fill(XML11CHARS, 57344, 63744, (byte) 33 ); // Fill 6400 of value (byte) 33
- Arrays.fill(XML11CHARS, 63744, 64976, (byte) -19 ); // Fill 1232 of value (byte) -19
- Arrays.fill(XML11CHARS, 64976, 65008, (byte) 33 ); // Fill 32 of value (byte) 33
- Arrays.fill(XML11CHARS, 65008, 65534, (byte) -19 ); // Fill 526 of value (byte) -19
-
- } // <clinit>()
-
- //
- // Public static methods
- //
-
- /**
- * Returns true if the specified character is a space character
- * as amdended in the XML 1.1 specification.
- *
- * @param c The character to check.
- */
- public static boolean isXML11Space(int c) {
- return (c < 0x10000 && (XML11CHARS[c] & MASK_XML11_SPACE) != 0);
- } // isXML11Space(int):boolean
-
- /**
- * Returns true if the specified character is valid. This method
- * also checks the surrogate character range from 0x10000 to 0x10FFFF.
- * <p>
- * If the program chooses to apply the mask directly to the
- * <code>XML11CHARS</code> array, then they are responsible for checking
- * the surrogate character range.
- *
- * @param c The character to check.
- */
- public static boolean isXML11Valid(int c) {
- return (c < 0x10000 && (XML11CHARS[c] & MASK_XML11_VALID) != 0)
- || (0x10000 <= c && c <= 0x10FFFF);
- } // isXML11Valid(int):boolean
-
- /**
- * Returns true if the specified character is invalid.
- *
- * @param c The character to check.
- */
- public static boolean isXML11Invalid(int c) {
- return !isXML11Valid(c);
- } // isXML11Invalid(int):boolean
-
- /**
- * Returns true if the specified character is valid and permitted outside
- * of a character reference.
- * That is, this method will return false for the same set as
- * isXML11Valid, except it also reports false for "control characters".
- *
- * @param c The character to check.
- */
- public static boolean isXML11ValidLiteral(int c) {
- return ((c < 0x10000 && ((XML11CHARS[c] & MASK_XML11_VALID) != 0 && (XML11CHARS[c] & MASK_XML11_CONTROL) == 0))
- || (0x10000 <= c && c <= 0x10FFFF));
- } // isXML11ValidLiteral(int):boolean
-
- /**
- * Returns true if the specified character can be considered
- * content in an external parsed entity.
- *
- * @param c The character to check.
- */
- public static boolean isXML11Content(int c) {
- return (c < 0x10000 && (XML11CHARS[c] & MASK_XML11_CONTENT) != 0) ||
- (0x10000 <= c && c <= 0x10FFFF);
- } // isXML11Content(int):boolean
-
- /**
- * Returns true if the specified character can be considered
- * content in an internal parsed entity.
- *
- * @param c The character to check.
- */
- public static boolean isXML11InternalEntityContent(int c) {
- return (c < 0x10000 && (XML11CHARS[c] & MASK_XML11_CONTENT_INTERNAL) != 0) ||
- (0x10000 <= c && c <= 0x10FFFF);
- } // isXML11InternalEntityContent(int):boolean
-
- /**
- * Returns true if the specified character is a valid name start
- * character as defined by production [4] in the XML 1.1
- * specification.
- *
- * @param c The character to check.
- */
- public static boolean isXML11NameStart(int c) {
- return (c < 0x10000 && (XML11CHARS[c] & MASK_XML11_NAME_START) != 0)
- || (0x10000 <= c && c < 0xF0000);
- } // isXML11NameStart(int):boolean
-
- /**
- * Returns true if the specified character is a valid name
- * character as defined by production [4a] in the XML 1.1
- * specification.
- *
- * @param c The character to check.
- */
- public static boolean isXML11Name(int c) {
- return (c < 0x10000 && (XML11CHARS[c] & MASK_XML11_NAME) != 0)
- || (c >= 0x10000 && c < 0xF0000);
- } // isXML11Name(int):boolean
-
- /**
- * Returns true if the specified character is a valid NCName start
- * character as defined by production [4] in Namespaces in XML
- * 1.1 recommendation.
- *
- * @param c The character to check.
- */
- public static boolean isXML11NCNameStart(int c) {
- return (c < 0x10000 && (XML11CHARS[c] & MASK_XML11_NCNAME_START) != 0)
- || (0x10000 <= c && c < 0xF0000);
- } // isXML11NCNameStart(int):boolean
-
- /**
- * Returns true if the specified character is a valid NCName
- * character as defined by production [5] in Namespaces in XML
- * 1.1 recommendation.
- *
- * @param c The character to check.
- */
- public static boolean isXML11NCName(int c) {
- return (c < 0x10000 && (XML11CHARS[c] & MASK_XML11_NCNAME) != 0)
- || (0x10000 <= c && c < 0xF0000);
- } // isXML11NCName(int):boolean
-
- /**
- * Returns whether the given character is a valid
- * high surrogate for a name character. This includes
- * all high surrogates for characters [0x10000-0xEFFFF].
- * In other words everything excluding planes 15 and 16.
- *
- * @param c The character to check.
- */
- public static boolean isXML11NameHighSurrogate(int c) {
- return (0xD800 <= c && c <= 0xDB7F);
- }
-
- /*
- * [5] Name ::= NameStartChar NameChar*
- */
- /**
- * Check to see if a string is a valid Name according to [5]
- * in the XML 1.1 Recommendation
- *
- * @param name string to check
- * @return true if name is a valid Name
- */
- public static boolean isXML11ValidName(String name) {
- int length = name.length();
- if (length == 0)
- return false;
- int i = 1;
- char ch = name.charAt(0);
- if( !isXML11NameStart(ch) ) {
- if ( length > 1 && isXML11NameHighSurrogate(ch) ) {
- char ch2 = name.charAt(1);
- if ( !XMLChar.isLowSurrogate(ch2) ||
- !isXML11NameStart(XMLChar.supplemental(ch, ch2)) ) {
- return false;
- }
- i = 2;
- }
- else {
- return false;
- }
- }
- while (i < length) {
- ch = name.charAt(i);
- if ( !isXML11Name(ch) ) {
- if ( ++i < length && isXML11NameHighSurrogate(ch) ) {
- char ch2 = name.charAt(i);
- if ( !XMLChar.isLowSurrogate(ch2) ||
- !isXML11Name(XMLChar.supplemental(ch, ch2)) ) {
- return false;
- }
- }
- else {
- return false;
- }
- }
- ++i;
- }
- return true;
- } // isXML11ValidName(String):boolean
-
-
- /*
- * from the namespace 1.1 rec
- * [4] NCName ::= NCNameStartChar NCNameChar*
- */
- /**
- * Check to see if a string is a valid NCName according to [4]
- * from the XML Namespaces 1.1 Recommendation
- *
- * @param ncName string to check
- * @return true if name is a valid NCName
- */
- public static boolean isXML11ValidNCName(String ncName) {
- int length = ncName.length();
- if (length == 0)
- return false;
- int i = 1;
- char ch = ncName.charAt(0);
- if( !isXML11NCNameStart(ch) ) {
- if ( length > 1 && isXML11NameHighSurrogate(ch) ) {
- char ch2 = ncName.charAt(1);
- if ( !XMLChar.isLowSurrogate(ch2) ||
- !isXML11NCNameStart(XMLChar.supplemental(ch, ch2)) ) {
- return false;
- }
- i = 2;
- }
- else {
- return false;
- }
- }
- while (i < length) {
- ch = ncName.charAt(i);
- if ( !isXML11NCName(ch) ) {
- if ( ++i < length && isXML11NameHighSurrogate(ch) ) {
- char ch2 = ncName.charAt(i);
- if ( !XMLChar.isLowSurrogate(ch2) ||
- !isXML11NCName(XMLChar.supplemental(ch, ch2)) ) {
- return false;
- }
- }
- else {
- return false;
- }
- }
- ++i;
- }
- return true;
- } // isXML11ValidNCName(String):boolean
-
- /*
- * [7] Nmtoken ::= (NameChar)+
- */
- /**
- * Check to see if a string is a valid Nmtoken according to [7]
- * in the XML 1.1 Recommendation
- *
- * @param nmtoken string to check
- * @return true if nmtoken is a valid Nmtoken
- */
- public static boolean isXML11ValidNmtoken(String nmtoken) {
- int length = nmtoken.length();
- if (length == 0)
- return false;
- for (int i = 0; i < length; ++i ) {
- char ch = nmtoken.charAt(i);
- if( !isXML11Name(ch) ) {
- if ( ++i < length && isXML11NameHighSurrogate(ch) ) {
- char ch2 = nmtoken.charAt(i);
- if ( !XMLChar.isLowSurrogate(ch2) ||
- !isXML11Name(XMLChar.supplemental(ch, ch2)) ) {
- return false;
- }
- }
- else {
- return false;
- }
- }
- }
- return true;
- } // isXML11ValidName(String):boolean
-
- /**
- * Simple check to determine if qname is legal. If it returns false
- * then <param>str</param> is illegal; if it returns true then
- * <param>str</param> is legal.
- */
- public static boolean isXML11ValidQName(String str) {
-
- final int colon = str.indexOf(':');
-
- if (colon == 0 || colon == str.length() - 1) {
- return false;
- }
-
- if (colon > 0) {
- final String prefix = str.substring(0,colon);
- final String localPart = str.substring(colon+1);
- return isXML11ValidNCName(prefix) && isXML11ValidNCName(localPart);
- }
- else {
- return isXML11ValidNCName(str);
- }
- }
-
-} // class XML11Char
diff --git a/src/com/sun/org/apache/xml/internal/utils/XMLChar.java b/src/com/sun/org/apache/xml/internal/utils/XMLChar.java
deleted file mode 100644
index 45d754c..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/XMLChar.java
+++ /dev/null
@@ -1,669 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XMLChar.java,v 1.2.4.1 2005/09/15 08:16:01 suresh_emailid Exp $
- */
-
-package com.sun.org.apache.xml.internal.utils;
-
-/**
- * This class defines the basic XML character properties. The data
- * in this class can be used to verify that a character is a valid
- * XML character or if the character is a space, name start, or name
- * character.
- * <p>
- * A series of convenience methods are supplied to ease the burden
- * of the developer. Because inlining the checks can improve per
- * character performance, the tables of character properties are
- * public. Using the character as an index into the <code>CHARS</code>
- * array and applying the appropriate mask flag (e.g.
- * <code>MASK_VALID</code>), yields the same results as calling the
- * convenience methods. There is one exception: check the comments
- * for the <code>isValid</code> method for details.
- *
- * @author Glenn Marcy, IBM
- * @author Andy Clark, IBM
- * @author Eric Ye, IBM
- * @author Arnaud Le Hors, IBM
- * @author Rahul Srivastava, Sun Microsystems Inc.
- *
- */
-public class XMLChar {
-
- //
- // Constants
- //
-
- /** Character flags. */
- private static final byte[] CHARS = new byte[1 << 16];
-
- /** Valid character mask. */
- public static final int MASK_VALID = 0x01;
-
- /** Space character mask. */
- public static final int MASK_SPACE = 0x02;
-
- /** Name start character mask. */
- public static final int MASK_NAME_START = 0x04;
-
- /** Name character mask. */
- public static final int MASK_NAME = 0x08;
-
- /** Pubid character mask. */
- public static final int MASK_PUBID = 0x10;
-
- /**
- * Content character mask. Special characters are those that can
- * be considered the start of markup, such as '&lt;' and '&amp;'.
- * The various newline characters are considered special as well.
- * All other valid XML characters can be considered content.
- * <p>
- * This is an optimization for the inner loop of character scanning.
- */
- public static final int MASK_CONTENT = 0x20;
-
- /** NCName start character mask. */
- public static final int MASK_NCNAME_START = 0x40;
-
- /** NCName character mask. */
- public static final int MASK_NCNAME = 0x80;
-
- //
- // Static initialization
- //
-
- static {
-
- //
- // [2] Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] |
- // [#xE000-#xFFFD] | [#x10000-#x10FFFF]
- //
-
- int charRange[] = {
- 0x0009, 0x000A, 0x000D, 0x000D, 0x0020, 0xD7FF, 0xE000, 0xFFFD,
- };
-
- //
- // [3] S ::= (#x20 | #x9 | #xD | #xA)+
- //
-
- int spaceChar[] = {
- 0x0020, 0x0009, 0x000D, 0x000A,
- };
-
- //
- // [4] NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' |
- // CombiningChar | Extender
- //
-
- int nameChar[] = {
- 0x002D, 0x002E, // '-' and '.'
- };
-
- //
- // [5] Name ::= (Letter | '_' | ':') (NameChar)*
- //
-
- int nameStartChar[] = {
- 0x003A, 0x005F, // ':' and '_'
- };
-
- //
- // [13] PubidChar ::= #x20 | 0xD | 0xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]
- //
-
- int pubidChar[] = {
- 0x000A, 0x000D, 0x0020, 0x0021, 0x0023, 0x0024, 0x0025, 0x003D,
- 0x005F
- };
-
- int pubidRange[] = {
- 0x0027, 0x003B, 0x003F, 0x005A, 0x0061, 0x007A
- };
-
- //
- // [84] Letter ::= BaseChar | Ideographic
- //
-
- int letterRange[] = {
- // BaseChar
- 0x0041, 0x005A, 0x0061, 0x007A, 0x00C0, 0x00D6, 0x00D8, 0x00F6,
- 0x00F8, 0x0131, 0x0134, 0x013E, 0x0141, 0x0148, 0x014A, 0x017E,
- 0x0180, 0x01C3, 0x01CD, 0x01F0, 0x01F4, 0x01F5, 0x01FA, 0x0217,
- 0x0250, 0x02A8, 0x02BB, 0x02C1, 0x0388, 0x038A, 0x038E, 0x03A1,
- 0x03A3, 0x03CE, 0x03D0, 0x03D6, 0x03E2, 0x03F3, 0x0401, 0x040C,
- 0x040E, 0x044F, 0x0451, 0x045C, 0x045E, 0x0481, 0x0490, 0x04C4,
- 0x04C7, 0x04C8, 0x04CB, 0x04CC, 0x04D0, 0x04EB, 0x04EE, 0x04F5,
- 0x04F8, 0x04F9, 0x0531, 0x0556, 0x0561, 0x0586, 0x05D0, 0x05EA,
- 0x05F0, 0x05F2, 0x0621, 0x063A, 0x0641, 0x064A, 0x0671, 0x06B7,
- 0x06BA, 0x06BE, 0x06C0, 0x06CE, 0x06D0, 0x06D3, 0x06E5, 0x06E6,
- 0x0905, 0x0939, 0x0958, 0x0961, 0x0985, 0x098C, 0x098F, 0x0990,
- 0x0993, 0x09A8, 0x09AA, 0x09B0, 0x09B6, 0x09B9, 0x09DC, 0x09DD,
- 0x09DF, 0x09E1, 0x09F0, 0x09F1, 0x0A05, 0x0A0A, 0x0A0F, 0x0A10,
- 0x0A13, 0x0A28, 0x0A2A, 0x0A30, 0x0A32, 0x0A33, 0x0A35, 0x0A36,
- 0x0A38, 0x0A39, 0x0A59, 0x0A5C, 0x0A72, 0x0A74, 0x0A85, 0x0A8B,
- 0x0A8F, 0x0A91, 0x0A93, 0x0AA8, 0x0AAA, 0x0AB0, 0x0AB2, 0x0AB3,
- 0x0AB5, 0x0AB9, 0x0B05, 0x0B0C, 0x0B0F, 0x0B10, 0x0B13, 0x0B28,
- 0x0B2A, 0x0B30, 0x0B32, 0x0B33, 0x0B36, 0x0B39, 0x0B5C, 0x0B5D,
- 0x0B5F, 0x0B61, 0x0B85, 0x0B8A, 0x0B8E, 0x0B90, 0x0B92, 0x0B95,
- 0x0B99, 0x0B9A, 0x0B9E, 0x0B9F, 0x0BA3, 0x0BA4, 0x0BA8, 0x0BAA,
- 0x0BAE, 0x0BB5, 0x0BB7, 0x0BB9, 0x0C05, 0x0C0C, 0x0C0E, 0x0C10,
- 0x0C12, 0x0C28, 0x0C2A, 0x0C33, 0x0C35, 0x0C39, 0x0C60, 0x0C61,
- 0x0C85, 0x0C8C, 0x0C8E, 0x0C90, 0x0C92, 0x0CA8, 0x0CAA, 0x0CB3,
- 0x0CB5, 0x0CB9, 0x0CE0, 0x0CE1, 0x0D05, 0x0D0C, 0x0D0E, 0x0D10,
- 0x0D12, 0x0D28, 0x0D2A, 0x0D39, 0x0D60, 0x0D61, 0x0E01, 0x0E2E,
- 0x0E32, 0x0E33, 0x0E40, 0x0E45, 0x0E81, 0x0E82, 0x0E87, 0x0E88,
- 0x0E94, 0x0E97, 0x0E99, 0x0E9F, 0x0EA1, 0x0EA3, 0x0EAA, 0x0EAB,
- 0x0EAD, 0x0EAE, 0x0EB2, 0x0EB3, 0x0EC0, 0x0EC4, 0x0F40, 0x0F47,
- 0x0F49, 0x0F69, 0x10A0, 0x10C5, 0x10D0, 0x10F6, 0x1102, 0x1103,
- 0x1105, 0x1107, 0x110B, 0x110C, 0x110E, 0x1112, 0x1154, 0x1155,
- 0x115F, 0x1161, 0x116D, 0x116E, 0x1172, 0x1173, 0x11AE, 0x11AF,
- 0x11B7, 0x11B8, 0x11BC, 0x11C2, 0x1E00, 0x1E9B, 0x1EA0, 0x1EF9,
- 0x1F00, 0x1F15, 0x1F18, 0x1F1D, 0x1F20, 0x1F45, 0x1F48, 0x1F4D,
- 0x1F50, 0x1F57, 0x1F5F, 0x1F7D, 0x1F80, 0x1FB4, 0x1FB6, 0x1FBC,
- 0x1FC2, 0x1FC4, 0x1FC6, 0x1FCC, 0x1FD0, 0x1FD3, 0x1FD6, 0x1FDB,
- 0x1FE0, 0x1FEC, 0x1FF2, 0x1FF4, 0x1FF6, 0x1FFC, 0x212A, 0x212B,
- 0x2180, 0x2182, 0x3041, 0x3094, 0x30A1, 0x30FA, 0x3105, 0x312C,
- 0xAC00, 0xD7A3,
- // Ideographic
- 0x3021, 0x3029, 0x4E00, 0x9FA5,
- };
- int letterChar[] = {
- // BaseChar
- 0x0386, 0x038C, 0x03DA, 0x03DC, 0x03DE, 0x03E0, 0x0559, 0x06D5,
- 0x093D, 0x09B2, 0x0A5E, 0x0A8D, 0x0ABD, 0x0AE0, 0x0B3D, 0x0B9C,
- 0x0CDE, 0x0E30, 0x0E84, 0x0E8A, 0x0E8D, 0x0EA5, 0x0EA7, 0x0EB0,
- 0x0EBD, 0x1100, 0x1109, 0x113C, 0x113E, 0x1140, 0x114C, 0x114E,
- 0x1150, 0x1159, 0x1163, 0x1165, 0x1167, 0x1169, 0x1175, 0x119E,
- 0x11A8, 0x11AB, 0x11BA, 0x11EB, 0x11F0, 0x11F9, 0x1F59, 0x1F5B,
- 0x1F5D, 0x1FBE, 0x2126, 0x212E,
- // Ideographic
- 0x3007,
- };
-
- //
- // [87] CombiningChar ::= ...
- //
-
- int combiningCharRange[] = {
- 0x0300, 0x0345, 0x0360, 0x0361, 0x0483, 0x0486, 0x0591, 0x05A1,
- 0x05A3, 0x05B9, 0x05BB, 0x05BD, 0x05C1, 0x05C2, 0x064B, 0x0652,
- 0x06D6, 0x06DC, 0x06DD, 0x06DF, 0x06E0, 0x06E4, 0x06E7, 0x06E8,
- 0x06EA, 0x06ED, 0x0901, 0x0903, 0x093E, 0x094C, 0x0951, 0x0954,
- 0x0962, 0x0963, 0x0981, 0x0983, 0x09C0, 0x09C4, 0x09C7, 0x09C8,
- 0x09CB, 0x09CD, 0x09E2, 0x09E3, 0x0A40, 0x0A42, 0x0A47, 0x0A48,
- 0x0A4B, 0x0A4D, 0x0A70, 0x0A71, 0x0A81, 0x0A83, 0x0ABE, 0x0AC5,
- 0x0AC7, 0x0AC9, 0x0ACB, 0x0ACD, 0x0B01, 0x0B03, 0x0B3E, 0x0B43,
- 0x0B47, 0x0B48, 0x0B4B, 0x0B4D, 0x0B56, 0x0B57, 0x0B82, 0x0B83,
- 0x0BBE, 0x0BC2, 0x0BC6, 0x0BC8, 0x0BCA, 0x0BCD, 0x0C01, 0x0C03,
- 0x0C3E, 0x0C44, 0x0C46, 0x0C48, 0x0C4A, 0x0C4D, 0x0C55, 0x0C56,
- 0x0C82, 0x0C83, 0x0CBE, 0x0CC4, 0x0CC6, 0x0CC8, 0x0CCA, 0x0CCD,
- 0x0CD5, 0x0CD6, 0x0D02, 0x0D03, 0x0D3E, 0x0D43, 0x0D46, 0x0D48,
- 0x0D4A, 0x0D4D, 0x0E34, 0x0E3A, 0x0E47, 0x0E4E, 0x0EB4, 0x0EB9,
- 0x0EBB, 0x0EBC, 0x0EC8, 0x0ECD, 0x0F18, 0x0F19, 0x0F71, 0x0F84,
- 0x0F86, 0x0F8B, 0x0F90, 0x0F95, 0x0F99, 0x0FAD, 0x0FB1, 0x0FB7,
- 0x20D0, 0x20DC, 0x302A, 0x302F,
- };
-
- int combiningCharChar[] = {
- 0x05BF, 0x05C4, 0x0670, 0x093C, 0x094D, 0x09BC, 0x09BE, 0x09BF,
- 0x09D7, 0x0A02, 0x0A3C, 0x0A3E, 0x0A3F, 0x0ABC, 0x0B3C, 0x0BD7,
- 0x0D57, 0x0E31, 0x0EB1, 0x0F35, 0x0F37, 0x0F39, 0x0F3E, 0x0F3F,
- 0x0F97, 0x0FB9, 0x20E1, 0x3099, 0x309A,
- };
-
- //
- // [88] Digit ::= ...
- //
-
- int digitRange[] = {
- 0x0030, 0x0039, 0x0660, 0x0669, 0x06F0, 0x06F9, 0x0966, 0x096F,
- 0x09E6, 0x09EF, 0x0A66, 0x0A6F, 0x0AE6, 0x0AEF, 0x0B66, 0x0B6F,
- 0x0BE7, 0x0BEF, 0x0C66, 0x0C6F, 0x0CE6, 0x0CEF, 0x0D66, 0x0D6F,
- 0x0E50, 0x0E59, 0x0ED0, 0x0ED9, 0x0F20, 0x0F29,
- };
-
- //
- // [89] Extender ::= ...
- //
-
- int extenderRange[] = {
- 0x3031, 0x3035, 0x309D, 0x309E, 0x30FC, 0x30FE,
- };
-
- int extenderChar[] = {
- 0x00B7, 0x02D0, 0x02D1, 0x0387, 0x0640, 0x0E46, 0x0EC6, 0x3005,
- };
-
- //
- // SpecialChar ::= '<', '&', '\n', '\r', ']'
- //
-
- int specialChar[] = {
- '<', '&', '\n', '\r', ']',
- };
-
- //
- // Initialize
- //
-
- // set valid characters
- for (int i = 0; i < charRange.length; i += 2) {
- for (int j = charRange[i]; j <= charRange[i + 1]; j++) {
- CHARS[j] |= MASK_VALID | MASK_CONTENT;
- }
- }
-
- // remove special characters
- for (int i = 0; i < specialChar.length; i++) {
- CHARS[specialChar[i]] = (byte)(CHARS[specialChar[i]] & ~MASK_CONTENT);
- }
-
- // set space characters
- for (int i = 0; i < spaceChar.length; i++) {
- CHARS[spaceChar[i]] |= MASK_SPACE;
- }
-
- // set name start characters
- for (int i = 0; i < nameStartChar.length; i++) {
- CHARS[nameStartChar[i]] |= MASK_NAME_START | MASK_NAME |
- MASK_NCNAME_START | MASK_NCNAME;
- }
- for (int i = 0; i < letterRange.length; i += 2) {
- for (int j = letterRange[i]; j <= letterRange[i + 1]; j++) {
- CHARS[j] |= MASK_NAME_START | MASK_NAME |
- MASK_NCNAME_START | MASK_NCNAME;
- }
- }
- for (int i = 0; i < letterChar.length; i++) {
- CHARS[letterChar[i]] |= MASK_NAME_START | MASK_NAME |
- MASK_NCNAME_START | MASK_NCNAME;
- }
-
- // set name characters
- for (int i = 0; i < nameChar.length; i++) {
- CHARS[nameChar[i]] |= MASK_NAME | MASK_NCNAME;
- }
- for (int i = 0; i < digitRange.length; i += 2) {
- for (int j = digitRange[i]; j <= digitRange[i + 1]; j++) {
- CHARS[j] |= MASK_NAME | MASK_NCNAME;
- }
- }
- for (int i = 0; i < combiningCharRange.length; i += 2) {
- for (int j = combiningCharRange[i]; j <= combiningCharRange[i + 1]; j++) {
- CHARS[j] |= MASK_NAME | MASK_NCNAME;
- }
- }
- for (int i = 0; i < combiningCharChar.length; i++) {
- CHARS[combiningCharChar[i]] |= MASK_NAME | MASK_NCNAME;
- }
- for (int i = 0; i < extenderRange.length; i += 2) {
- for (int j = extenderRange[i]; j <= extenderRange[i + 1]; j++) {
- CHARS[j] |= MASK_NAME | MASK_NCNAME;
- }
- }
- for (int i = 0; i < extenderChar.length; i++) {
- CHARS[extenderChar[i]] |= MASK_NAME | MASK_NCNAME;
- }
-
- // remove ':' from allowable MASK_NCNAME_START and MASK_NCNAME chars
- CHARS[':'] &= ~(MASK_NCNAME_START | MASK_NCNAME);
-
- // set Pubid characters
- for (int i = 0; i < pubidChar.length; i++) {
- CHARS[pubidChar[i]] |= MASK_PUBID;
- }
- for (int i = 0; i < pubidRange.length; i += 2) {
- for (int j = pubidRange[i]; j <= pubidRange[i + 1]; j++) {
- CHARS[j] |= MASK_PUBID;
- }
- }
-
- } // <clinit>()
-
- //
- // Public static methods
- //
-
- /**
- * Returns true if the specified character is a supplemental character.
- *
- * @param c The character to check.
- */
- public static boolean isSupplemental(int c) {
- return (c >= 0x10000 && c <= 0x10FFFF);
- }
-
- /**
- * Returns true the supplemental character corresponding to the given
- * surrogates.
- *
- * @param h The high surrogate.
- * @param l The low surrogate.
- */
- public static int supplemental(char h, char l) {
- return (h - 0xD800) * 0x400 + (l - 0xDC00) + 0x10000;
- }
-
- /**
- * Returns the high surrogate of a supplemental character
- *
- * @param c The supplemental character to "split".
- */
- public static char highSurrogate(int c) {
- return (char) (((c - 0x00010000) >> 10) + 0xD800);
- }
-
- /**
- * Returns the low surrogate of a supplemental character
- *
- * @param c The supplemental character to "split".
- */
- public static char lowSurrogate(int c) {
- return (char) (((c - 0x00010000) & 0x3FF) + 0xDC00);
- }
-
- /**
- * Returns whether the given character is a high surrogate
- *
- * @param c The character to check.
- */
- public static boolean isHighSurrogate(int c) {
- return (0xD800 <= c && c <= 0xDBFF);
- }
-
- /**
- * Returns whether the given character is a low surrogate
- *
- * @param c The character to check.
- */
- public static boolean isLowSurrogate(int c) {
- return (0xDC00 <= c && c <= 0xDFFF);
- }
-
-
- /**
- * Returns true if the specified character is valid. This method
- * also checks the surrogate character range from 0x10000 to 0x10FFFF.
- * <p>
- * If the program chooses to apply the mask directly to the
- * <code>CHARS</code> array, then they are responsible for checking
- * the surrogate character range.
- *
- * @param c The character to check.
- */
- public static boolean isValid(int c) {
- return (c < 0x10000 && (CHARS[c] & MASK_VALID) != 0) ||
- (0x10000 <= c && c <= 0x10FFFF);
- } // isValid(int):boolean
-
- /**
- * Returns true if the specified character is invalid.
- *
- * @param c The character to check.
- */
- public static boolean isInvalid(int c) {
- return !isValid(c);
- } // isInvalid(int):boolean
-
- /**
- * Returns true if the specified character can be considered content.
- *
- * @param c The character to check.
- */
- public static boolean isContent(int c) {
- return (c < 0x10000 && (CHARS[c] & MASK_CONTENT) != 0) ||
- (0x10000 <= c && c <= 0x10FFFF);
- } // isContent(int):boolean
-
- /**
- * Returns true if the specified character can be considered markup.
- * Markup characters include '&lt;', '&amp;', and '%'.
- *
- * @param c The character to check.
- */
- public static boolean isMarkup(int c) {
- return c == '<' || c == '&' || c == '%';
- } // isMarkup(int):boolean
-
- /**
- * Returns true if the specified character is a space character
- * as defined by production [3] in the XML 1.0 specification.
- *
- * @param c The character to check.
- */
- public static boolean isSpace(int c) {
- return c < 0x10000 && (CHARS[c] & MASK_SPACE) != 0;
- } // isSpace(int):boolean
-
- /**
- * Returns true if the specified character is a valid name start
- * character as defined by production [5] in the XML 1.0
- * specification.
- *
- * @param c The character to check.
- */
- public static boolean isNameStart(int c) {
- return c < 0x10000 && (CHARS[c] & MASK_NAME_START) != 0;
- } // isNameStart(int):boolean
-
- /**
- * Returns true if the specified character is a valid name
- * character as defined by production [4] in the XML 1.0
- * specification.
- *
- * @param c The character to check.
- */
- public static boolean isName(int c) {
- return c < 0x10000 && (CHARS[c] & MASK_NAME) != 0;
- } // isName(int):boolean
-
- /**
- * Returns true if the specified character is a valid NCName start
- * character as defined by production [4] in Namespaces in XML
- * recommendation.
- *
- * @param c The character to check.
- */
- public static boolean isNCNameStart(int c) {
- return c < 0x10000 && (CHARS[c] & MASK_NCNAME_START) != 0;
- } // isNCNameStart(int):boolean
-
- /**
- * Returns true if the specified character is a valid NCName
- * character as defined by production [5] in Namespaces in XML
- * recommendation.
- *
- * @param c The character to check.
- */
- public static boolean isNCName(int c) {
- return c < 0x10000 && (CHARS[c] & MASK_NCNAME) != 0;
- } // isNCName(int):boolean
-
- /**
- * Returns true if the specified character is a valid Pubid
- * character as defined by production [13] in the XML 1.0
- * specification.
- *
- * @param c The character to check.
- */
- public static boolean isPubid(int c) {
- return c < 0x10000 && (CHARS[c] & MASK_PUBID) != 0;
- } // isPubid(int):boolean
-
- /*
- * [5] Name ::= (Letter | '_' | ':') (NameChar)*
- */
- /**
- * Check to see if a string is a valid Name according to [5]
- * in the XML 1.0 Recommendation
- *
- * @param name string to check
- * @return true if name is a valid Name
- */
- public static boolean isValidName(String name) {
- if (name.length() == 0)
- return false;
- char ch = name.charAt(0);
- if( isNameStart(ch) == false)
- return false;
- for (int i = 1; i < name.length(); i++ ) {
- ch = name.charAt(i);
- if( isName( ch ) == false ){
- return false;
- }
- }
- return true;
- } // isValidName(String):boolean
-
-
- /*
- * from the namespace rec
- * [4] NCName ::= (Letter | '_') (NCNameChar)*
- */
- /**
- * Check to see if a string is a valid NCName according to [4]
- * from the XML Namespaces 1.0 Recommendation
- *
- * @param ncName string to check
- * @return true if name is a valid NCName
- */
- public static boolean isValidNCName(String ncName) {
- if (ncName.length() == 0)
- return false;
- char ch = ncName.charAt(0);
- if( isNCNameStart(ch) == false)
- return false;
- for (int i = 1; i < ncName.length(); i++ ) {
- ch = ncName.charAt(i);
- if( isNCName( ch ) == false ){
- return false;
- }
- }
- return true;
- } // isValidNCName(String):boolean
-
- /*
- * [7] Nmtoken ::= (NameChar)+
- */
- /**
- * Check to see if a string is a valid Nmtoken according to [7]
- * in the XML 1.0 Recommendation
- *
- * @param nmtoken string to check
- * @return true if nmtoken is a valid Nmtoken
- */
- public static boolean isValidNmtoken(String nmtoken) {
- if (nmtoken.length() == 0)
- return false;
- for (int i = 0; i < nmtoken.length(); i++ ) {
- char ch = nmtoken.charAt(i);
- if( ! isName( ch ) ){
- return false;
- }
- }
- return true;
- } // isValidName(String):boolean
-
-
-
-
-
- // encodings
-
- /**
- * Returns true if the encoding name is a valid IANA encoding.
- * This method does not verify that there is a decoder available
- * for this encoding, only that the characters are valid for an
- * IANA encoding name.
- *
- * @param ianaEncoding The IANA encoding name.
- */
- public static boolean isValidIANAEncoding(String ianaEncoding) {
- if (ianaEncoding != null) {
- int length = ianaEncoding.length();
- if (length > 0) {
- char c = ianaEncoding.charAt(0);
- if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')) {
- for (int i = 1; i < length; i++) {
- c = ianaEncoding.charAt(i);
- if ((c < 'A' || c > 'Z') && (c < 'a' || c > 'z') &&
- (c < '0' || c > '9') && c != '.' && c != '_' &&
- c != '-') {
- return false;
- }
- }
- return true;
- }
- }
- }
- return false;
- } // isValidIANAEncoding(String):boolean
-
- /**
- * Returns true if the encoding name is a valid Java encoding.
- * This method does not verify that there is a decoder available
- * for this encoding, only that the characters are valid for an
- * Java encoding name.
- *
- * @param javaEncoding The Java encoding name.
- */
- public static boolean isValidJavaEncoding(String javaEncoding) {
- if (javaEncoding != null) {
- int length = javaEncoding.length();
- if (length > 0) {
- for (int i = 1; i < length; i++) {
- char c = javaEncoding.charAt(i);
- if ((c < 'A' || c > 'Z') && (c < 'a' || c > 'z') &&
- (c < '0' || c > '9') && c != '.' && c != '_' &&
- c != '-') {
- return false;
- }
- }
- return true;
- }
- }
- return false;
- } // isValidIANAEncoding(String):boolean
-
- /**
- * Simple check to determine if qname is legal. If it returns false
- * then <param>str</param> is illegal; if it returns true then
- * <param>str</param> is legal.
- */
- public static boolean isValidQName(String str) {
-
- final int colon = str.indexOf(':');
-
- if (colon == 0 || colon == str.length() - 1) {
- return false;
- }
-
- if (colon > 0) {
- final String prefix = str.substring(0,colon);
- final String localPart = str.substring(colon+1);
- return isValidNCName(prefix) && isValidNCName(localPart);
- }
- else {
- return isValidNCName(str);
- }
- }
-
-} // class XMLChar
diff --git a/src/com/sun/org/apache/xml/internal/utils/XMLCharacterRecognizer.java b/src/com/sun/org/apache/xml/internal/utils/XMLCharacterRecognizer.java
deleted file mode 100644
index fa137dc..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/XMLCharacterRecognizer.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XMLCharacterRecognizer.java,v 1.2.4.1 2005/09/15 08:16:01 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-/**
- * Class used to verify whether the specified <var>ch</var>
- * conforms to the XML 1.0 definition of whitespace.
- * @xsl.usage internal
- */
-public class XMLCharacterRecognizer
-{
-
- /**
- * Returns whether the specified <var>ch</var> conforms to the XML 1.0 definition
- * of whitespace. Refer to <A href="http://www.w3.org/TR/1998/REC-xml-19980210#NT-S">
- * the definition of <CODE>S</CODE></A> for details.
- * @param ch Character to check as XML whitespace.
- * @return =true if <var>ch</var> is XML whitespace; otherwise =false.
- */
- public static boolean isWhiteSpace(char ch)
- {
- return (ch == 0x20) || (ch == 0x09) || (ch == 0xD) || (ch == 0xA);
- }
-
- /**
- * Tell if the string is whitespace.
- *
- * @param ch Character array to check as XML whitespace.
- * @param start Start index of characters in the array
- * @param length Number of characters in the array
- * @return True if the characters in the array are
- * XML whitespace; otherwise, false.
- */
- public static boolean isWhiteSpace(char ch[], int start, int length)
- {
-
- int end = start + length;
-
- for (int s = start; s < end; s++)
- {
- if (!isWhiteSpace(ch[s]))
- return false;
- }
-
- return true;
- }
-
- /**
- * Tell if the string is whitespace.
- *
- * @param buf StringBuffer to check as XML whitespace.
- * @return True if characters in buffer are XML whitespace, false otherwise
- */
- public static boolean isWhiteSpace(StringBuffer buf)
- {
-
- int n = buf.length();
-
- for (int i = 0; i < n; i++)
- {
- if (!isWhiteSpace(buf.charAt(i)))
- return false;
- }
-
- return true;
- }
-
- /**
- * Tell if the string is whitespace.
- *
- * @param s String to check as XML whitespace.
- * @return True if characters in buffer are XML whitespace, false otherwise
- */
- public static boolean isWhiteSpace(String s)
- {
-
- if(null != s)
- {
- int n = s.length();
-
- for (int i = 0; i < n; i++)
- {
- if (!isWhiteSpace(s.charAt(i)))
- return false;
- }
- }
-
- return true;
- }
-
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/XMLReaderManager.java b/src/com/sun/org/apache/xml/internal/utils/XMLReaderManager.java
deleted file mode 100644
index 09cd04c..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/XMLReaderManager.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XMLReaderManager.java,v 1.2.4.1 2005/09/15 08:16:02 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-import com.sun.org.apache.xalan.internal.XalanConstants;
-import com.sun.org.apache.xalan.internal.utils.FactoryImpl;
-import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
-import com.sun.org.apache.xalan.internal.utils.XMLSecurityManager;
-import java.util.HashMap;
-
-import javax.xml.XMLConstants;
-import javax.xml.parsers.FactoryConfigurationError;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParserFactory;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.helpers.XMLReaderFactory;
-
-/**
- * Creates XMLReader objects and caches them for re-use.
- * This class follows the singleton pattern.
- */
-public class XMLReaderManager {
-
- private static final String NAMESPACES_FEATURE =
- "http://xml.org/sax/features/namespaces";
- private static final String NAMESPACE_PREFIXES_FEATURE =
- "http://xml.org/sax/features/namespace-prefixes";
- private static final XMLReaderManager m_singletonManager =
- new XMLReaderManager();
- private static final String property = "org.xml.sax.driver";
- /**
- * Parser factory to be used to construct XMLReader objects
- */
- private static SAXParserFactory m_parserFactory;
-
- /**
- * Cache of XMLReader objects
- */
- private ThreadLocal m_readers;
-
- /**
- * Keeps track of whether an XMLReader object is in use.
- */
- private HashMap m_inUse;
-
- private boolean m_useServicesMechanism = true;
-
- private boolean _secureProcessing;
- /**
- * protocols allowed for external DTD references in source file and/or stylesheet.
- */
- private String _accessExternalDTD = XalanConstants.EXTERNAL_ACCESS_DEFAULT;
-
- private XMLSecurityManager _xmlSecurityManager;
-
- /**
- * Hidden constructor
- */
- private XMLReaderManager() {
- }
-
- /**
- * Retrieves the singleton reader manager
- */
- public static XMLReaderManager getInstance(boolean useServicesMechanism) {
- m_singletonManager.setServicesMechnism(useServicesMechanism);
- return m_singletonManager;
- }
-
- /**
- * Retrieves a cached XMLReader for this thread, or creates a new
- * XMLReader, if the existing reader is in use. When the caller no
- * longer needs the reader, it must release it with a call to
- * {@link #releaseXMLReader}.
- */
- public synchronized XMLReader getXMLReader() throws SAXException {
- XMLReader reader;
-
- if (m_readers == null) {
- // When the m_readers.get() method is called for the first time
- // on a thread, a new XMLReader will automatically be created.
- m_readers = new ThreadLocal();
- }
-
- if (m_inUse == null) {
- m_inUse = new HashMap();
- }
-
- // If the cached reader for this thread is in use, construct a new
- // one; otherwise, return the cached reader unless it isn't an
- // instance of the class set in the 'org.xml.sax.driver' property
- reader = (XMLReader) m_readers.get();
- boolean threadHasReader = (reader != null);
- String factory = SecuritySupport.getSystemProperty(property);
- if (threadHasReader && m_inUse.get(reader) != Boolean.TRUE &&
- ( factory == null || reader.getClass().getName().equals(factory))) {
- m_inUse.put(reader, Boolean.TRUE);
- } else {
- try {
- try {
- // According to JAXP 1.2 specification, if a SAXSource
- // is created using a SAX InputSource the Transformer or
- // TransformerFactory creates a reader via the
- // XMLReaderFactory if setXMLReader is not used
- reader = XMLReaderFactory.createXMLReader();
- try {
- reader.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, _secureProcessing);
- } catch (SAXNotRecognizedException e) {
- XMLSecurityManager.printWarning(reader.getClass().getName(),
- XMLConstants.FEATURE_SECURE_PROCESSING, e);
- }
- } catch (Exception e) {
- try {
- // If unable to create an instance, let's try to use
- // the XMLReader from JAXP
- if (m_parserFactory == null) {
- m_parserFactory = FactoryImpl.getSAXFactory(m_useServicesMechanism);
- m_parserFactory.setNamespaceAware(true);
- }
-
- reader = m_parserFactory.newSAXParser().getXMLReader();
- } catch (ParserConfigurationException pce) {
- throw pce; // pass along pce
- }
- }
- try {
- reader.setFeature(NAMESPACES_FEATURE, true);
- reader.setFeature(NAMESPACE_PREFIXES_FEATURE, false);
- } catch (SAXException se) {
- // Try to carry on if we've got a parser that
- // doesn't know about namespace prefixes.
- }
- } catch (ParserConfigurationException ex) {
- throw new SAXException(ex);
- } catch (FactoryConfigurationError ex1) {
- throw new SAXException(ex1.toString());
- } catch (NoSuchMethodError ex2) {
- } catch (AbstractMethodError ame) {
- }
-
- // Cache the XMLReader if this is the first time we've created
- // a reader for this thread.
- if (!threadHasReader) {
- m_readers.set(reader);
- m_inUse.put(reader, Boolean.TRUE);
- }
- }
-
- try {
- //reader is cached, but this property might have been reset
- reader.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, _accessExternalDTD);
- } catch (SAXException se) {
- XMLSecurityManager.printWarning(reader.getClass().getName(),
- XMLConstants.ACCESS_EXTERNAL_DTD, se);
- }
-
- String lastProperty = "";
- try {
- if (_xmlSecurityManager != null) {
- for (XMLSecurityManager.Limit limit : XMLSecurityManager.Limit.values()) {
- lastProperty = limit.apiProperty();
- reader.setProperty(lastProperty,
- _xmlSecurityManager.getLimitValueAsString(limit));
- }
- if (_xmlSecurityManager.printEntityCountInfo()) {
- lastProperty = XalanConstants.JDK_ENTITY_COUNT_INFO;
- reader.setProperty(XalanConstants.JDK_ENTITY_COUNT_INFO, XalanConstants.JDK_YES);
- }
- }
- } catch (SAXException se) {
- XMLSecurityManager.printWarning(reader.getClass().getName(), lastProperty, se);
- }
-
- return reader;
- }
-
- /**
- * Mark the cached XMLReader as available. If the reader was not
- * actually in the cache, do nothing.
- *
- * @param reader The XMLReader that's being released.
- */
- public synchronized void releaseXMLReader(XMLReader reader) {
- // If the reader that's being released is the cached reader
- // for this thread, remove it from the m_isUse list.
- if (m_readers.get() == reader && reader != null) {
- m_inUse.remove(reader);
- }
- }
- /**
- * Return the state of the services mechanism feature.
- */
- public boolean useServicesMechnism() {
- return m_useServicesMechanism;
- }
-
- /**
- * Set the state of the services mechanism feature.
- */
- public void setServicesMechnism(boolean flag) {
- m_useServicesMechanism = flag;
- }
-
- /**
- * Set feature
- */
- public void setFeature(String name, boolean value) {
- if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
- _secureProcessing = value;
- }
- }
-
- /**
- * Get property value
- */
- public Object getProperty(String name) {
- if (name.equals(XMLConstants.ACCESS_EXTERNAL_DTD)) {
- return _accessExternalDTD;
- } else if (name.equals(XalanConstants.SECURITY_MANAGER)) {
- return _xmlSecurityManager;
- }
- return null;
- }
-
- /**
- * Set property.
- */
- public void setProperty(String name, Object value) {
- if (name.equals(XMLConstants.ACCESS_EXTERNAL_DTD)) {
- _accessExternalDTD = (String)value;
- } else if (name.equals(XalanConstants.SECURITY_MANAGER)) {
- _xmlSecurityManager = (XMLSecurityManager)value;
- }
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/XMLString.java b/src/com/sun/org/apache/xml/internal/utils/XMLString.java
deleted file mode 100644
index e8de6f3..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/XMLString.java
+++ /dev/null
@@ -1,691 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XMLString.java,v 1.2.4.1 2005/09/15 08:16:02 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-import java.util.Locale;
-
-/**
- * This class is meant to be an interface to character strings, whether they
- * be java Strings or <code>com.sun.org.apache.xml.internal.utils.FastStringBuffer</code>s, or
- * other character data. By using XMLString, character copies can be reduced
- * in the XML pipeline.
- */
-public interface XMLString
-{
-
- /**
- * Directly call the
- * characters method on the passed ContentHandler for the
- * string-value. Multiple calls to the
- * ContentHandler's characters methods may well occur for a single call to
- * this method.
- *
- * @param ch A non-null reference to a ContentHandler.
- *
- * @throws org.xml.sax.SAXException
- */
- public abstract void dispatchCharactersEvents(org.xml.sax.ContentHandler ch)
- throws org.xml.sax.SAXException;
-
- /**
- * Directly call the
- * comment method on the passed LexicalHandler for the
- * string-value.
- *
- * @param lh A non-null reference to a LexicalHandler.
- *
- * @throws org.xml.sax.SAXException
- */
- public abstract void dispatchAsComment(org.xml.sax.ext.LexicalHandler lh)
- throws org.xml.sax.SAXException;
-
- /**
- * Conditionally trim all leading and trailing whitespace in the specified String.
- * All strings of white space are
- * replaced by a single space character (#x20), except spaces after punctuation which
- * receive double spaces if doublePunctuationSpaces is true.
- * This function may be useful to a formatter, but to get first class
- * results, the formatter should probably do it's own white space handling
- * based on the semantics of the formatting object.
- *
- * @param trimHead Trim leading whitespace?
- * @param trimTail Trim trailing whitespace?
- * @param doublePunctuationSpaces Use double spaces for punctuation?
- * @return The trimmed string.
- */
- public XMLString fixWhiteSpace(boolean trimHead,
- boolean trimTail,
- boolean doublePunctuationSpaces);
-
- /**
- * Returns the length of this string.
- *
- * @return the length of the sequence of characters represented by this
- * object.
- */
- public abstract int length();
-
- /**
- * Returns the character at the specified index. An index ranges
- * from <code>0</code> to <code>length() - 1</code>. The first character
- * of the sequence is at index <code>0</code>, the next at index
- * <code>1</code>, and so on, as for array indexing.
- *
- * @param index the index of the character.
- * @return the character at the specified index of this string.
- * The first character is at index <code>0</code>.
- * @exception IndexOutOfBoundsException if the <code>index</code>
- * argument is negative or not less than the length of this
- * string.
- */
- public abstract char charAt(int index);
-
- /**
- * Copies characters from this string into the destination character
- * array.
- *
- * @param srcBegin index of the first character in the string
- * to copy.
- * @param srcEnd index after the last character in the string
- * to copy.
- * @param dst the destination array.
- * @param dstBegin the start offset in the destination array.
- * @exception IndexOutOfBoundsException If any of the following
- * is true:
- * <ul><li><code>srcBegin</code> is negative.
- * <li><code>srcBegin</code> is greater than <code>srcEnd</code>
- * <li><code>srcEnd</code> is greater than the length of this
- * string
- * <li><code>dstBegin</code> is negative
- * <li><code>dstBegin+(srcEnd-srcBegin)</code> is larger than
- * <code>dst.length</code></ul>
- * @exception NullPointerException if <code>dst</code> is <code>null</code>
- */
- public abstract void getChars(int srcBegin, int srcEnd, char dst[],
- int dstBegin);
-
- /**
- * Compares this string to the specified object.
- * The result is <code>true</code> if and only if the argument is not
- * <code>null</code> and is an <code>XMLString</code> object that represents
- * the same sequence of characters as this object.
- *
- * @param anObject the object to compare this <code>String</code>
- * against.
- * @return <code>true</code> if the <code>String </code>are equal;
- * <code>false</code> otherwise.
- * @see java.lang.String#compareTo(java.lang.String)
- * @see java.lang.String#equalsIgnoreCase(java.lang.String)
- */
- public abstract boolean equals(XMLString anObject);
-
- /**
- * Compares this string to the specified <code>String</code>.
- * The result is <code>true</code> if and only if the argument is not
- * <code>null</code> and is a <code>String</code> object that represents
- * the same sequence of characters as this object.
- *
- * @param anotherString the object to compare this <code>String</code>
- * against.
- * @return <code>true</code> if the <code>String</code>s are equal;
- * <code>false</code> otherwise.
- * @see java.lang.String#compareTo(java.lang.String)
- * @see java.lang.String#equalsIgnoreCase(java.lang.String)
- */
- public abstract boolean equals(String anotherString);
-
- /**
- * Compares this string to the specified object.
- * The result is <code>true</code> if and only if the argument is not
- * <code>null</code> and is a <code>String</code> object that represents
- * the same sequence of characters as this object.
- *
- * @param anObject the object to compare this <code>String</code>
- * against.
- * @return <code>true</code> if the <code>String </code>are equal;
- * <code>false</code> otherwise.
- * @see java.lang.String#compareTo(java.lang.String)
- * @see java.lang.String#equalsIgnoreCase(java.lang.String)
- */
- public abstract boolean equals(Object anObject);
-
- /**
- * Compares this <code>String</code> to another <code>String</code>,
- * ignoring case considerations. Two strings are considered equal
- * ignoring case if they are of the same length, and corresponding
- * characters in the two strings are equal ignoring case.
- *
- * @param anotherString the <code>String</code> to compare this
- * <code>String</code> against.
- * @return <code>true</code> if the argument is not <code>null</code>
- * and the <code>String</code>s are equal,
- * ignoring case; <code>false</code> otherwise.
- * @see #equals(Object)
- * @see java.lang.Character#toLowerCase(char)
- * @see java.lang.Character#toUpperCase(char)
- */
- public abstract boolean equalsIgnoreCase(String anotherString);
-
- /**
- * Compares two strings lexicographically.
- *
- * @param anotherString the <code>String</code> to be compared.
- * @return the value <code>0</code> if the argument string is equal to
- * this string; a value less than <code>0</code> if this string
- * is lexicographically less than the string argument; and a
- * value greater than <code>0</code> if this string is
- * lexicographically greater than the string argument.
- * @exception java.lang.NullPointerException if <code>anotherString</code>
- * is <code>null</code>.
- */
- public abstract int compareTo(XMLString anotherString);
-
- /**
- * Compares two strings lexicographically, ignoring case considerations.
- * This method returns an integer whose sign is that of
- * <code>this.toUpperCase().toLowerCase().compareTo(
- * str.toUpperCase().toLowerCase())</code>.
- * <p>
- * Note that this method does <em>not</em> take locale into account,
- * and will result in an unsatisfactory ordering for certain locales.
- * The java.text package provides <em>collators</em> to allow
- * locale-sensitive ordering.
- *
- * @param str the <code>String</code> to be compared.
- * @return a negative integer, zero, or a positive integer as the
- * the specified String is greater than, equal to, or less
- * than this String, ignoring case considerations.
- * @see java.text.Collator#compare(String, String)
- * @since 1.2
- */
- public abstract int compareToIgnoreCase(XMLString str);
-
- /**
- * Tests if this string starts with the specified prefix beginning
- * a specified index.
- *
- * @param prefix the prefix.
- * @param toffset where to begin looking in the string.
- * @return <code>true</code> if the character sequence represented by the
- * argument is a prefix of the substring of this object starting
- * at index <code>toffset</code>; <code>false</code> otherwise.
- * The result is <code>false</code> if <code>toffset</code> is
- * negative or greater than the length of this
- * <code>String</code> object; otherwise the result is the same
- * as the result of the expression
- * <pre>
- * this.subString(toffset).startsWith(prefix)
- * </pre>
- * @exception java.lang.NullPointerException if <code>prefix</code> is
- * <code>null</code>.
- */
- public abstract boolean startsWith(String prefix, int toffset);
-
- /**
- * Tests if this string starts with the specified prefix beginning
- * a specified index.
- *
- * @param prefix the prefix.
- * @param toffset where to begin looking in the string.
- * @return <code>true</code> if the character sequence represented by the
- * argument is a prefix of the substring of this object starting
- * at index <code>toffset</code>; <code>false</code> otherwise.
- * The result is <code>false</code> if <code>toffset</code> is
- * negative or greater than the length of this
- * <code>String</code> object; otherwise the result is the same
- * as the result of the expression
- * <pre>
- * this.subString(toffset).startsWith(prefix)
- * </pre>
- * @exception java.lang.NullPointerException if <code>prefix</code> is
- * <code>null</code>.
- */
- public abstract boolean startsWith(XMLString prefix, int toffset);
-
- /**
- * Tests if this string starts with the specified prefix.
- *
- * @param prefix the prefix.
- * @return <code>true</code> if the character sequence represented by the
- * argument is a prefix of the character sequence represented by
- * this string; <code>false</code> otherwise.
- * Note also that <code>true</code> will be returned if the
- * argument is an empty string or is equal to this
- * <code>String</code> object as determined by the
- * {@link #equals(Object)} method.
- * @exception java.lang.NullPointerException if <code>prefix</code> is
- * <code>null</code>.
- * @since JDK1. 0
- */
- public abstract boolean startsWith(String prefix);
-
- /**
- * Tests if this string starts with the specified prefix.
- *
- * @param prefix the prefix.
- * @return <code>true</code> if the character sequence represented by the
- * argument is a prefix of the character sequence represented by
- * this string; <code>false</code> otherwise.
- * Note also that <code>true</code> will be returned if the
- * argument is an empty string or is equal to this
- * <code>String</code> object as determined by the
- * {@link #equals(Object)} method.
- * @exception java.lang.NullPointerException if <code>prefix</code> is
- * <code>null</code>.
- * @since JDK1. 0
- */
- public abstract boolean startsWith(XMLString prefix);
-
- /**
- * Tests if this string ends with the specified suffix.
- *
- * @param suffix the suffix.
- * @return <code>true</code> if the character sequence represented by the
- * argument is a suffix of the character sequence represented by
- * this object; <code>false</code> otherwise. Note that the
- * result will be <code>true</code> if the argument is the
- * empty string or is equal to this <code>String</code> object
- * as determined by the {@link #equals(Object)} method.
- * @exception java.lang.NullPointerException if <code>suffix</code> is
- * <code>null</code>.
- */
- public abstract boolean endsWith(String suffix);
-
- /**
- * Returns a hashcode for this string. The hashcode for a
- * <code>String</code> object is computed as
- * <blockquote><pre>
- * s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1]
- * </pre></blockquote>
- * using <code>int</code> arithmetic, where <code>s[i]</code> is the
- * <i>i</i>th character of the string, <code>n</code> is the length of
- * the string, and <code>^</code> indicates exponentiation.
- * (The hash value of the empty string is zero.)
- *
- * @return a hash code value for this object.
- */
- public abstract int hashCode();
-
- /**
- * Returns the index within this string of the first occurrence of the
- * specified character. If a character with value <code>ch</code> occurs
- * in the character sequence represented by this <code>String</code>
- * object, then the index of the first such occurrence is returned --
- * that is, the smallest value <i>k</i> such that:
- * <blockquote><pre>
- * this.charAt(<i>k</i>) == ch
- * </pre></blockquote>
- * is <code>true</code>. If no such character occurs in this string,
- * then <code>-1</code> is returned.
- *
- * @param ch a character.
- * @return the index of the first occurrence of the character in the
- * character sequence represented by this object, or
- * <code>-1</code> if the character does not occur.
- */
- public abstract int indexOf(int ch);
-
- /**
- * Returns the index within this string of the first occurrence of the
- * specified character, starting the search at the specified index.
- * <p>
- * If a character with value <code>ch</code> occurs in the character
- * sequence represented by this <code>String</code> object at an index
- * no smaller than <code>fromIndex</code>, then the index of the first
- * such occurrence is returned--that is, the smallest value <i>k</i>
- * such that:
- * <blockquote><pre>
- * (this.charAt(<i>k</i>) == ch) && (<i>k</i> >= fromIndex)
- * </pre></blockquote>
- * is true. If no such character occurs in this string at or after
- * position <code>fromIndex</code>, then <code>-1</code> is returned.
- * <p>
- * There is no restriction on the value of <code>fromIndex</code>. If it
- * is negative, it has the same effect as if it were zero: this entire
- * string may be searched. If it is greater than the length of this
- * string, it has the same effect as if it were equal to the length of
- * this string: <code>-1</code> is returned.
- *
- * @param ch a character.
- * @param fromIndex the index to start the search from.
- * @return the index of the first occurrence of the character in the
- * character sequence represented by this object that is greater
- * than or equal to <code>fromIndex</code>, or <code>-1</code>
- * if the character does not occur.
- */
- public abstract int indexOf(int ch, int fromIndex);
-
- /**
- * Returns the index within this string of the last occurrence of the
- * specified character. That is, the index returned is the largest
- * value <i>k</i> such that:
- * <blockquote><pre>
- * this.charAt(<i>k</i>) == ch
- * </pre></blockquote>
- * is true.
- * The String is searched backwards starting at the last character.
- *
- * @param ch a character.
- * @return the index of the last occurrence of the character in the
- * character sequence represented by this object, or
- * <code>-1</code> if the character does not occur.
- */
- public abstract int lastIndexOf(int ch);
-
- /**
- * Returns the index within this string of the last occurrence of the
- * specified character, searching backward starting at the specified
- * index. That is, the index returned is the largest value <i>k</i>
- * such that:
- * <blockquote><pre>
- * this.charAt(k) == ch) && (k <= fromIndex)
- * </pre></blockquote>
- * is true.
- *
- * @param ch a character.
- * @param fromIndex the index to start the search from. There is no
- * restriction on the value of <code>fromIndex</code>. If it is
- * greater than or equal to the length of this string, it has
- * the same effect as if it were equal to one less than the
- * length of this string: this entire string may be searched.
- * If it is negative, it has the same effect as if it were -1:
- * -1 is returned.
- * @return the index of the last occurrence of the character in the
- * character sequence represented by this object that is less
- * than or equal to <code>fromIndex</code>, or <code>-1</code>
- * if the character does not occur before that point.
- */
- public abstract int lastIndexOf(int ch, int fromIndex);
-
- /**
- * Returns the index within this string of the first occurrence of the
- * specified substring. The integer returned is the smallest value
- * <i>k</i> such that:
- * <blockquote><pre>
- * this.startsWith(str, <i>k</i>)
- * </pre></blockquote>
- * is <code>true</code>.
- *
- * @param str any string.
- * @return if the string argument occurs as a substring within this
- * object, then the index of the first character of the first
- * such substring is returned; if it does not occur as a
- * substring, <code>-1</code> is returned.
- * @exception java.lang.NullPointerException if <code>str</code> is
- * <code>null</code>.
- */
- public abstract int indexOf(String str);
-
- /**
- * Returns the index within this string of the first occurrence of the
- * specified substring. The integer returned is the smallest value
- * <i>k</i> such that:
- * <blockquote><pre>
- * this.startsWith(str, <i>k</i>)
- * </pre></blockquote>
- * is <code>true</code>.
- *
- * @param str any string.
- * @return if the string argument occurs as a substring within this
- * object, then the index of the first character of the first
- * such substring is returned; if it does not occur as a
- * substring, <code>-1</code> is returned.
- * @exception java.lang.NullPointerException if <code>str</code> is
- * <code>null</code>.
- */
- public abstract int indexOf(XMLString str);
-
- /**
- * Returns the index within this string of the first occurrence of the
- * specified substring, starting at the specified index. The integer
- * returned is the smallest value <i>k</i> such that:
- * <blockquote><pre>
- * this.startsWith(str, <i>k</i>) && (<i>k</i> >= fromIndex)
- * </pre></blockquote>
- * is <code>true</code>.
- * <p>
- * There is no restriction on the value of <code>fromIndex</code>. If
- * it is negative, it has the same effect as if it were zero: this entire
- * string may be searched. If it is greater than the length of this
- * string, it has the same effect as if it were equal to the length of
- * this string: <code>-1</code> is returned.
- *
- * @param str the substring to search for.
- * @param fromIndex the index to start the search from.
- * @return If the string argument occurs as a substring within this
- * object at a starting index no smaller than
- * <code>fromIndex</code>, then the index of the first character
- * of the first such substring is returned. If it does not occur
- * as a substring starting at <code>fromIndex</code> or beyond,
- * <code>-1</code> is returned.
- * @exception java.lang.NullPointerException if <code>str</code> is
- * <code>null</code>
- */
- public abstract int indexOf(String str, int fromIndex);
-
- /**
- * Returns the index within this string of the rightmost occurrence
- * of the specified substring. The rightmost empty string "" is
- * considered to occur at the index value <code>this.length()</code>.
- * The returned index is the largest value <i>k</i> such that
- * <blockquote><pre>
- * this.startsWith(str, k)
- * </pre></blockquote>
- * is true.
- *
- * @param str the substring to search for.
- * @return if the string argument occurs one or more times as a substring
- * within this object, then the index of the first character of
- * the last such substring is returned. If it does not occur as
- * a substring, <code>-1</code> is returned.
- * @exception java.lang.NullPointerException if <code>str</code> is
- * <code>null</code>.
- */
- public abstract int lastIndexOf(String str);
-
- /**
- * Returns the index within this string of the last occurrence of
- * the specified substring.
- *
- * @param str the substring to search for.
- * @param fromIndex the index to start the search from. There is no
- * restriction on the value of fromIndex. If it is greater than
- * the length of this string, it has the same effect as if it
- * were equal to the length of this string: this entire string
- * may be searched. If it is negative, it has the same effect
- * as if it were -1: -1 is returned.
- * @return If the string argument occurs one or more times as a substring
- * within this object at a starting index no greater than
- * <code>fromIndex</code>, then the index of the first character of
- * the last such substring is returned. If it does not occur as a
- * substring starting at <code>fromIndex</code> or earlier,
- * <code>-1</code> is returned.
- * @exception java.lang.NullPointerException if <code>str</code> is
- * <code>null</code>.
- */
- public abstract int lastIndexOf(String str, int fromIndex);
-
- /**
- * Returns a new string that is a substring of this string. The
- * substring begins with the character at the specified index and
- * extends to the end of this string. <p>
- * Examples:
- * <blockquote><pre>
- * "unhappy".substring(2) returns "happy"
- * "Harbison".substring(3) returns "bison"
- * "emptiness".substring(9) returns "" (an empty string)
- * </pre></blockquote>
- *
- * @param beginIndex the beginning index, inclusive.
- * @return the specified substring.
- * @exception IndexOutOfBoundsException if
- * <code>beginIndex</code> is negative or larger than the
- * length of this <code>String</code> object.
- */
- public abstract XMLString substring(int beginIndex);
-
- /**
- * Returns a new string that is a substring of this string. The
- * substring begins at the specified <code>beginIndex</code> and
- * extends to the character at index <code>endIndex - 1</code>.
- * Thus the length of the substring is <code>endIndex-beginIndex</code>.
- *
- * @param beginIndex the beginning index, inclusive.
- * @param endIndex the ending index, exclusive.
- * @return the specified substring.
- * @exception IndexOutOfBoundsException if the
- * <code>beginIndex</code> is negative, or
- * <code>endIndex</code> is larger than the length of
- * this <code>String</code> object, or
- * <code>beginIndex</code> is larger than
- * <code>endIndex</code>.
- */
- public abstract XMLString substring(int beginIndex, int endIndex);
-
- /**
- * Concatenates the specified string to the end of this string.
- *
- * @param str the <code>String</code> that is concatenated to the end
- * of this <code>String</code>.
- * @return a string that represents the concatenation of this object's
- * characters followed by the string argument's characters.
- * @exception java.lang.NullPointerException if <code>str</code> is
- * <code>null</code>.
- */
- public abstract XMLString concat(String str);
-
- /**
- * Converts all of the characters in this <code>String</code> to lower
- * case using the rules of the given <code>Locale</code>.
- *
- * @param locale use the case transformation rules for this locale
- * @return the String, converted to lowercase.
- * @see java.lang.Character#toLowerCase(char)
- * @see java.lang.String#toUpperCase(Locale)
- */
- public abstract XMLString toLowerCase(Locale locale);
-
- /**
- * Converts all of the characters in this <code>String</code> to lower
- * case using the rules of the default locale, which is returned
- * by <code>Locale.getDefault</code>.
- * <p>
- *
- * @return the string, converted to lowercase.
- * @see java.lang.Character#toLowerCase(char)
- * @see java.lang.String#toLowerCase(Locale)
- */
- public abstract XMLString toLowerCase();
-
- /**
- * Converts all of the characters in this <code>String</code> to upper
- * case using the rules of the given locale.
- * @param locale use the case transformation rules for this locale
- * @return the String, converted to uppercase.
- * @see java.lang.Character#toUpperCase(char)
- * @see java.lang.String#toLowerCase(Locale)
- */
- public abstract XMLString toUpperCase(Locale locale);
-
- /**
- * Converts all of the characters in this <code>String</code> to upper
- * case using the rules of the default locale, which is returned
- * by <code>Locale.getDefault</code>.
- *
- * <p>
- * If no character in this string has a different uppercase version,
- * based on calling the <code>toUpperCase</code> method defined by
- * <code>Character</code>, then the original string is returned.
- * <p>
- * Otherwise, this method creates a new <code>String</code> object
- * representing a character sequence identical in length to the
- * character sequence represented by this <code>String</code> object and
- * with every character equal to the result of applying the method
- * <code>Character.toUpperCase</code> to the corresponding character of
- * this <code>String</code> object. <p>
- * Examples:
- * <blockquote><pre>
- * "Fahrvergn&uuml;gen".toUpperCase() returns "FAHRVERGN&Uuml;GEN"
- * "Visit Ljubinje!".toUpperCase() returns "VISIT LJUBINJE!"
- * </pre></blockquote>
- *
- * @return the string, converted to uppercase.
- * @see java.lang.Character#toUpperCase(char)
- * @see java.lang.String#toUpperCase(Locale)
- */
- public abstract XMLString toUpperCase();
-
- /**
- * Removes white space from both ends of this string.
- * <p>
- * If this <code>String</code> object represents an empty character
- * sequence, or the first and last characters of character sequence
- * represented by this <code>String</code> object both have codes
- * greater than <code>'&#92;u0020'</code> (the space character), then a
- * reference to this <code>String</code> object is returned.
- * <p>
- * Otherwise, if there is no character with a code greater than
- * <code>'&#92;u0020'</code> in the string, then a new
- * <code>String</code> object representing an empty string is created
- * and returned.
- * <p>
- * Otherwise, let <i>k</i> be the index of the first character in the
- * string whose code is greater than <code>'&#92;u0020'</code>, and let
- * <i>m</i> be the index of the last character in the string whose code
- * is greater than <code>'&#92;u0020'</code>. A new <code>String</code>
- * object is created, representing the substring of this string that
- * begins with the character at index <i>k</i> and ends with the
- * character at index <i>m</i>-that is, the result of
- * <code>this.substring(<i>k</i>,&nbsp;<i>m</i>+1)</code>.
- * <p>
- * This method may be used to trim
- * {@link Character#isSpace(char) whitespace} from the beginning and end
- * of a string; in fact, it trims all ASCII control characters as well.
- *
- * @return this string, with white space removed from the front and end.
- */
- public abstract XMLString trim();
-
- /**
- * This object (which is already a string!) is itself returned.
- *
- * @return the string itself.
- */
- public abstract String toString();
-
- /**
- * Tell if this object contains a java String object.
- *
- * @return true if this XMLString can return a string without creating one.
- */
- public abstract boolean hasString();
-
- /**
- * Convert a string to a double -- Allowed input is in fixed
- * notation ddd.fff.
- *
- * @return A double value representation of the string, or return Double.NaN
- * if the string can not be converted.
- */
- public double toDouble();
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/XMLStringDefault.java b/src/com/sun/org/apache/xml/internal/utils/XMLStringDefault.java
deleted file mode 100644
index 3953c86..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/XMLStringDefault.java
+++ /dev/null
@@ -1,820 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XMLStringDefault.java,v 1.2.4.1 2005/09/15 08:16:02 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-import java.util.Locale;
-
-/**
- * The default implementation of the XMLString interface,
- * which is just a simple wrapper of a String object.
- */
-public class XMLStringDefault implements XMLString
-{
-
- private String m_str;
-
- /**
- * Create a XMLStringDefault object from a String
- */
- public XMLStringDefault(String str)
- {
- m_str = str;
- }
-
- /**
- * Directly call the
- * characters method on the passed ContentHandler for the
- * string-value. Multiple calls to the
- * ContentHandler's characters methods may well occur for a single call to
- * this method.
- *
- * @param ch A non-null reference to a ContentHandler.
- *
- * @throws org.xml.sax.SAXException
- */
- public void dispatchCharactersEvents(org.xml.sax.ContentHandler ch)
- throws org.xml.sax.SAXException
- {
- }
-
- /**
- * Directly call the
- * comment method on the passed LexicalHandler for the
- * string-value.
- *
- * @param lh A non-null reference to a LexicalHandler.
- *
- * @throws org.xml.sax.SAXException
- */
- public void dispatchAsComment(org.xml.sax.ext.LexicalHandler lh)
- throws org.xml.sax.SAXException
- {
- }
-
- /**
- * Conditionally trim all leading and trailing whitespace in the specified String.
- * All strings of white space are
- * replaced by a single space character (#x20), except spaces after punctuation which
- * receive double spaces if doublePunctuationSpaces is true.
- * This function may be useful to a formatter, but to get first class
- * results, the formatter should probably do it's own white space handling
- * based on the semantics of the formatting object.
- *
- * @param trimHead Trim leading whitespace?
- * @param trimTail Trim trailing whitespace?
- * @param doublePunctuationSpaces Use double spaces for punctuation?
- * @return The trimmed string.
- */
- public XMLString fixWhiteSpace(boolean trimHead,
- boolean trimTail,
- boolean doublePunctuationSpaces)
- {
- return new XMLStringDefault(m_str.trim());
- }
-
- /**
- * Returns the length of this string.
- *
- * @return the length of the sequence of characters represented by this
- * object.
- */
- public int length()
- {
- return m_str.length();
- }
-
- /**
- * Returns the character at the specified index. An index ranges
- * from <code>0</code> to <code>length() - 1</code>. The first character
- * of the sequence is at index <code>0</code>, the next at index
- * <code>1</code>, and so on, as for array indexing.
- *
- * @param index the index of the character.
- * @return the character at the specified index of this string.
- * The first character is at index <code>0</code>.
- * @exception IndexOutOfBoundsException if the <code>index</code>
- * argument is negative or not less than the length of this
- * string.
- */
- public char charAt(int index)
- {
- return m_str.charAt(index);
- }
-
- /**
- * Copies characters from this string into the destination character
- * array.
- *
- * @param srcBegin index of the first character in the string
- * to copy.
- * @param srcEnd index after the last character in the string
- * to copy.
- * @param dst the destination array.
- * @param dstBegin the start offset in the destination array.
- * @exception IndexOutOfBoundsException If any of the following
- * is true:
- * <ul><li><code>srcBegin</code> is negative.
- * <li><code>srcBegin</code> is greater than <code>srcEnd</code>
- * <li><code>srcEnd</code> is greater than the length of this
- * string
- * <li><code>dstBegin</code> is negative
- * <li><code>dstBegin+(srcEnd-srcBegin)</code> is larger than
- * <code>dst.length</code></ul>
- * @exception NullPointerException if <code>dst</code> is <code>null</code>
- */
- public void getChars(int srcBegin, int srcEnd, char dst[],
- int dstBegin)
- {
- int destIndex = dstBegin;
- for (int i = srcBegin; i < srcEnd; i++)
- {
- dst[destIndex++] = m_str.charAt(i);
- }
- }
-
- /**
- * Compares this string to the specified <code>String</code>.
- * The result is <code>true</code> if and only if the argument is not
- * <code>null</code> and is a <code>String</code> object that represents
- * the same sequence of characters as this object.
- *
- * @param obj2 the object to compare this <code>String</code> against.
- * @return <code>true</code> if the <code>String</code>s are equal;
- * <code>false</code> otherwise.
- * @see java.lang.String#compareTo(java.lang.String)
- * @see java.lang.String#equalsIgnoreCase(java.lang.String)
- */
- public boolean equals(String obj2) {
- return m_str.equals(obj2);
- }
-
- /**
- * Compares this string to the specified object.
- * The result is <code>true</code> if and only if the argument is not
- * <code>null</code> and is a <code>String</code> object that represents
- * the same sequence of characters as this object.
- *
- * @param anObject the object to compare this <code>String</code>
- * against.
- * @return <code>true</code> if the <code>String </code>are equal;
- * <code>false</code> otherwise.
- * @see java.lang.String#compareTo(java.lang.String)
- * @see java.lang.String#equalsIgnoreCase(java.lang.String)
- */
- public boolean equals(XMLString anObject)
- {
- return m_str.equals(anObject.toString());
- }
-
-
- /**
- * Compares this string to the specified object.
- * The result is <code>true</code> if and only if the argument is not
- * <code>null</code> and is a <code>String</code> object that represents
- * the same sequence of characters as this object.
- *
- * @param anObject the object to compare this <code>String</code>
- * against.
- * @return <code>true</code> if the <code>String </code>are equal;
- * <code>false</code> otherwise.
- * @see java.lang.String#compareTo(java.lang.String)
- * @see java.lang.String#equalsIgnoreCase(java.lang.String)
- */
- public boolean equals(Object anObject)
- {
- return m_str.equals(anObject);
- }
-
- /**
- * Compares this <code>String</code> to another <code>String</code>,
- * ignoring case considerations. Two strings are considered equal
- * ignoring case if they are of the same length, and corresponding
- * characters in the two strings are equal ignoring case.
- *
- * @param anotherString the <code>String</code> to compare this
- * <code>String</code> against.
- * @return <code>true</code> if the argument is not <code>null</code>
- * and the <code>String</code>s are equal,
- * ignoring case; <code>false</code> otherwise.
- * @see #equals(Object)
- * @see java.lang.Character#toLowerCase(char)
- * @see java.lang.Character#toUpperCase(char)
- */
- public boolean equalsIgnoreCase(String anotherString)
- {
- return m_str.equalsIgnoreCase(anotherString);
- }
-
- /**
- * Compares two strings lexicographically.
- *
- * @param anotherString the <code>String</code> to be compared.
- * @return the value <code>0</code> if the argument string is equal to
- * this string; a value less than <code>0</code> if this string
- * is lexicographically less than the string argument; and a
- * value greater than <code>0</code> if this string is
- * lexicographically greater than the string argument.
- * @exception java.lang.NullPointerException if <code>anotherString</code>
- * is <code>null</code>.
- */
- public int compareTo(XMLString anotherString)
- {
- return m_str.compareTo(anotherString.toString());
- }
-
- /**
- * Compares two strings lexicographically, ignoring case considerations.
- * This method returns an integer whose sign is that of
- * <code>this.toUpperCase().toLowerCase().compareTo(
- * str.toUpperCase().toLowerCase())</code>.
- * <p>
- * Note that this method does <em>not</em> take locale into account,
- * and will result in an unsatisfactory ordering for certain locales.
- * The java.text package provides <em>collators</em> to allow
- * locale-sensitive ordering.
- *
- * @param str the <code>String</code> to be compared.
- * @return a negative integer, zero, or a positive integer as the
- * the specified String is greater than, equal to, or less
- * than this String, ignoring case considerations.
- * @see java.text.Collator#compare(String, String)
- * @since 1.2
- */
- public int compareToIgnoreCase(XMLString str)
- {
- return m_str.compareToIgnoreCase(str.toString());
- }
-
- /**
- * Tests if this string starts with the specified prefix beginning
- * a specified index.
- *
- * @param prefix the prefix.
- * @param toffset where to begin looking in the string.
- * @return <code>true</code> if the character sequence represented by the
- * argument is a prefix of the substring of this object starting
- * at index <code>toffset</code>; <code>false</code> otherwise.
- * The result is <code>false</code> if <code>toffset</code> is
- * negative or greater than the length of this
- * <code>String</code> object; otherwise the result is the same
- * as the result of the expression
- * <pre>
- * this.subString(toffset).startsWith(prefix)
- * </pre>
- * @exception java.lang.NullPointerException if <code>prefix</code> is
- * <code>null</code>.
- */
- public boolean startsWith(String prefix, int toffset)
- {
- return m_str.startsWith(prefix, toffset);
- }
-
- /**
- * Tests if this string starts with the specified prefix beginning
- * a specified index.
- *
- * @param prefix the prefix.
- * @param toffset where to begin looking in the string.
- * @return <code>true</code> if the character sequence represented by the
- * argument is a prefix of the substring of this object starting
- * at index <code>toffset</code>; <code>false</code> otherwise.
- * The result is <code>false</code> if <code>toffset</code> is
- * negative or greater than the length of this
- * <code>String</code> object; otherwise the result is the same
- * as the result of the expression
- * <pre>
- * this.subString(toffset).startsWith(prefix)
- * </pre>
- * @exception java.lang.NullPointerException if <code>prefix</code> is
- * <code>null</code>.
- */
- public boolean startsWith(XMLString prefix, int toffset)
- {
- return m_str.startsWith(prefix.toString(), toffset);
- }
-
- /**
- * Tests if this string starts with the specified prefix.
- *
- * @param prefix the prefix.
- * @return <code>true</code> if the character sequence represented by the
- * argument is a prefix of the character sequence represented by
- * this string; <code>false</code> otherwise.
- * Note also that <code>true</code> will be returned if the
- * argument is an empty string or is equal to this
- * <code>String</code> object as determined by the
- * {@link #equals(Object)} method.
- * @exception java.lang.NullPointerException if <code>prefix</code> is
- * <code>null</code>.
- * @since JDK1. 0
- */
- public boolean startsWith(String prefix)
- {
- return m_str.startsWith(prefix);
- }
-
- /**
- * Tests if this string starts with the specified prefix.
- *
- * @param prefix the prefix.
- * @return <code>true</code> if the character sequence represented by the
- * argument is a prefix of the character sequence represented by
- * this string; <code>false</code> otherwise.
- * Note also that <code>true</code> will be returned if the
- * argument is an empty string or is equal to this
- * <code>String</code> object as determined by the
- * {@link #equals(Object)} method.
- * @exception java.lang.NullPointerException if <code>prefix</code> is
- * <code>null</code>.
- * @since JDK1. 0
- */
- public boolean startsWith(XMLString prefix)
- {
- return m_str.startsWith(prefix.toString());
- }
-
- /**
- * Tests if this string ends with the specified suffix.
- *
- * @param suffix the suffix.
- * @return <code>true</code> if the character sequence represented by the
- * argument is a suffix of the character sequence represented by
- * this object; <code>false</code> otherwise. Note that the
- * result will be <code>true</code> if the argument is the
- * empty string or is equal to this <code>String</code> object
- * as determined by the {@link #equals(Object)} method.
- * @exception java.lang.NullPointerException if <code>suffix</code> is
- * <code>null</code>.
- */
- public boolean endsWith(String suffix)
- {
- return m_str.endsWith(suffix);
- }
-
- /**
- * Returns a hashcode for this string. The hashcode for a
- * <code>String</code> object is computed as
- * <blockquote><pre>
- * s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1]
- * </pre></blockquote>
- * using <code>int</code> arithmetic, where <code>s[i]</code> is the
- * <i>i</i>th character of the string, <code>n</code> is the length of
- * the string, and <code>^</code> indicates exponentiation.
- * (The hash value of the empty string is zero.)
- *
- * @return a hash code value for this object.
- */
- public int hashCode()
- {
- return m_str.hashCode();
- }
-
- /**
- * Returns the index within this string of the first occurrence of the
- * specified character. If a character with value <code>ch</code> occurs
- * in the character sequence represented by this <code>String</code>
- * object, then the index of the first such occurrence is returned --
- * that is, the smallest value <i>k</i> such that:
- * <blockquote><pre>
- * this.charAt(<i>k</i>) == ch
- * </pre></blockquote>
- * is <code>true</code>. If no such character occurs in this string,
- * then <code>-1</code> is returned.
- *
- * @param ch a character.
- * @return the index of the first occurrence of the character in the
- * character sequence represented by this object, or
- * <code>-1</code> if the character does not occur.
- */
- public int indexOf(int ch)
- {
- return m_str.indexOf(ch);
- }
-
- /**
- * Returns the index within this string of the first occurrence of the
- * specified character, starting the search at the specified index.
- * <p>
- * If a character with value <code>ch</code> occurs in the character
- * sequence represented by this <code>String</code> object at an index
- * no smaller than <code>fromIndex</code>, then the index of the first
- * such occurrence is returned--that is, the smallest value <i>k</i>
- * such that:
- * <blockquote><pre>
- * (this.charAt(<i>k</i>) == ch) && (<i>k</i> >= fromIndex)
- * </pre></blockquote>
- * is true. If no such character occurs in this string at or after
- * position <code>fromIndex</code>, then <code>-1</code> is returned.
- * <p>
- * There is no restriction on the value of <code>fromIndex</code>. If it
- * is negative, it has the same effect as if it were zero: this entire
- * string may be searched. If it is greater than the length of this
- * string, it has the same effect as if it were equal to the length of
- * this string: <code>-1</code> is returned.
- *
- * @param ch a character.
- * @param fromIndex the index to start the search from.
- * @return the index of the first occurrence of the character in the
- * character sequence represented by this object that is greater
- * than or equal to <code>fromIndex</code>, or <code>-1</code>
- * if the character does not occur.
- */
- public int indexOf(int ch, int fromIndex)
- {
- return m_str.indexOf(ch, fromIndex);
- }
-
- /**
- * Returns the index within this string of the last occurrence of the
- * specified character. That is, the index returned is the largest
- * value <i>k</i> such that:
- * <blockquote><pre>
- * this.charAt(<i>k</i>) == ch
- * </pre></blockquote>
- * is true.
- * The String is searched backwards starting at the last character.
- *
- * @param ch a character.
- * @return the index of the last occurrence of the character in the
- * character sequence represented by this object, or
- * <code>-1</code> if the character does not occur.
- */
- public int lastIndexOf(int ch)
- {
- return m_str.lastIndexOf(ch);
- }
-
- /**
- * Returns the index within this string of the last occurrence of the
- * specified character, searching backward starting at the specified
- * index. That is, the index returned is the largest value <i>k</i>
- * such that:
- * <blockquote><pre>
- * this.charAt(k) == ch) && (k <= fromIndex)
- * </pre></blockquote>
- * is true.
- *
- * @param ch a character.
- * @param fromIndex the index to start the search from. There is no
- * restriction on the value of <code>fromIndex</code>. If it is
- * greater than or equal to the length of this string, it has
- * the same effect as if it were equal to one less than the
- * length of this string: this entire string may be searched.
- * If it is negative, it has the same effect as if it were -1:
- * -1 is returned.
- * @return the index of the last occurrence of the character in the
- * character sequence represented by this object that is less
- * than or equal to <code>fromIndex</code>, or <code>-1</code>
- * if the character does not occur before that point.
- */
- public int lastIndexOf(int ch, int fromIndex)
- {
- return m_str.lastIndexOf(ch, fromIndex);
- }
-
- /**
- * Returns the index within this string of the first occurrence of the
- * specified substring. The integer returned is the smallest value
- * <i>k</i> such that:
- * <blockquote><pre>
- * this.startsWith(str, <i>k</i>)
- * </pre></blockquote>
- * is <code>true</code>.
- *
- * @param str any string.
- * @return if the string argument occurs as a substring within this
- * object, then the index of the first character of the first
- * such substring is returned; if it does not occur as a
- * substring, <code>-1</code> is returned.
- * @exception java.lang.NullPointerException if <code>str</code> is
- * <code>null</code>.
- */
- public int indexOf(String str)
- {
- return m_str.indexOf(str);
- }
-
- /**
- * Returns the index within this string of the first occurrence of the
- * specified substring. The integer returned is the smallest value
- * <i>k</i> such that:
- * <blockquote><pre>
- * this.startsWith(str, <i>k</i>)
- * </pre></blockquote>
- * is <code>true</code>.
- *
- * @param str any string.
- * @return if the string argument occurs as a substring within this
- * object, then the index of the first character of the first
- * such substring is returned; if it does not occur as a
- * substring, <code>-1</code> is returned.
- * @exception java.lang.NullPointerException if <code>str</code> is
- * <code>null</code>.
- */
- public int indexOf(XMLString str)
- {
- return m_str.indexOf(str.toString());
- }
-
- /**
- * Returns the index within this string of the first occurrence of the
- * specified substring, starting at the specified index. The integer
- * returned is the smallest value <i>k</i> such that:
- * <blockquote><pre>
- * this.startsWith(str, <i>k</i>) && (<i>k</i> >= fromIndex)
- * </pre></blockquote>
- * is <code>true</code>.
- * <p>
- * There is no restriction on the value of <code>fromIndex</code>. If
- * it is negative, it has the same effect as if it were zero: this entire
- * string may be searched. If it is greater than the length of this
- * string, it has the same effect as if it were equal to the length of
- * this string: <code>-1</code> is returned.
- *
- * @param str the substring to search for.
- * @param fromIndex the index to start the search from.
- * @return If the string argument occurs as a substring within this
- * object at a starting index no smaller than
- * <code>fromIndex</code>, then the index of the first character
- * of the first such substring is returned. If it does not occur
- * as a substring starting at <code>fromIndex</code> or beyond,
- * <code>-1</code> is returned.
- * @exception java.lang.NullPointerException if <code>str</code> is
- * <code>null</code>
- */
- public int indexOf(String str, int fromIndex)
- {
- return m_str.indexOf(str, fromIndex);
- }
-
- /**
- * Returns the index within this string of the rightmost occurrence
- * of the specified substring. The rightmost empty string "" is
- * considered to occur at the index value <code>this.length()</code>.
- * The returned index is the largest value <i>k</i> such that
- * <blockquote><pre>
- * this.startsWith(str, k)
- * </pre></blockquote>
- * is true.
- *
- * @param str the substring to search for.
- * @return if the string argument occurs one or more times as a substring
- * within this object, then the index of the first character of
- * the last such substring is returned. If it does not occur as
- * a substring, <code>-1</code> is returned.
- * @exception java.lang.NullPointerException if <code>str</code> is
- * <code>null</code>.
- */
- public int lastIndexOf(String str)
- {
- return m_str.lastIndexOf(str);
- }
-
- /**
- * Returns the index within this string of the last occurrence of
- * the specified substring.
- *
- * @param str the substring to search for.
- * @param fromIndex the index to start the search from. There is no
- * restriction on the value of fromIndex. If it is greater than
- * the length of this string, it has the same effect as if it
- * were equal to the length of this string: this entire string
- * may be searched. If it is negative, it has the same effect
- * as if it were -1: -1 is returned.
- * @return If the string argument occurs one or more times as a substring
- * within this object at a starting index no greater than
- * <code>fromIndex</code>, then the index of the first character of
- * the last such substring is returned. If it does not occur as a
- * substring starting at <code>fromIndex</code> or earlier,
- * <code>-1</code> is returned.
- * @exception java.lang.NullPointerException if <code>str</code> is
- * <code>null</code>.
- */
- public int lastIndexOf(String str, int fromIndex)
- {
- return m_str.lastIndexOf(str, fromIndex);
- }
-
- /**
- * Returns a new string that is a substring of this string. The
- * substring begins with the character at the specified index and
- * extends to the end of this string. <p>
- * Examples:
- * <blockquote><pre>
- * "unhappy".substring(2) returns "happy"
- * "Harbison".substring(3) returns "bison"
- * "emptiness".substring(9) returns "" (an empty string)
- * </pre></blockquote>
- *
- * @param beginIndex the beginning index, inclusive.
- * @return the specified substring.
- * @exception IndexOutOfBoundsException if
- * <code>beginIndex</code> is negative or larger than the
- * length of this <code>String</code> object.
- */
- public XMLString substring(int beginIndex)
- {
- return new XMLStringDefault(m_str.substring(beginIndex));
- }
-
- /**
- * Returns a new string that is a substring of this string. The
- * substring begins at the specified <code>beginIndex</code> and
- * extends to the character at index <code>endIndex - 1</code>.
- * Thus the length of the substring is <code>endIndex-beginIndex</code>.
- *
- * @param beginIndex the beginning index, inclusive.
- * @param endIndex the ending index, exclusive.
- * @return the specified substring.
- * @exception IndexOutOfBoundsException if the
- * <code>beginIndex</code> is negative, or
- * <code>endIndex</code> is larger than the length of
- * this <code>String</code> object, or
- * <code>beginIndex</code> is larger than
- * <code>endIndex</code>.
- */
- public XMLString substring(int beginIndex, int endIndex)
- {
- return new XMLStringDefault(m_str.substring(beginIndex, endIndex));
- }
-
- /**
- * Concatenates the specified string to the end of this string.
- *
- * @param str the <code>String</code> that is concatenated to the end
- * of this <code>String</code>.
- * @return a string that represents the concatenation of this object's
- * characters followed by the string argument's characters.
- * @exception java.lang.NullPointerException if <code>str</code> is
- * <code>null</code>.
- */
- public XMLString concat(String str)
- {
- return new XMLStringDefault(m_str.concat(str));
- }
-
- /**
- * Converts all of the characters in this <code>String</code> to lower
- * case using the rules of the given <code>Locale</code>.
- *
- * @param locale use the case transformation rules for this locale
- * @return the String, converted to lowercase.
- * @see java.lang.Character#toLowerCase(char)
- * @see java.lang.String#toUpperCase(Locale)
- */
- public XMLString toLowerCase(Locale locale)
- {
- return new XMLStringDefault(m_str.toLowerCase(locale));
- }
-
- /**
- * Converts all of the characters in this <code>String</code> to lower
- * case using the rules of the default locale, which is returned
- * by <code>Locale.getDefault</code>.
- * <p>
- *
- * @return the string, converted to lowercase.
- * @see java.lang.Character#toLowerCase(char)
- * @see java.lang.String#toLowerCase(Locale)
- */
- public XMLString toLowerCase()
- {
- return new XMLStringDefault(m_str.toLowerCase());
- }
-
- /**
- * Converts all of the characters in this <code>String</code> to upper
- * case using the rules of the given locale.
- * @param locale use the case transformation rules for this locale
- * @return the String, converted to uppercase.
- * @see java.lang.Character#toUpperCase(char)
- * @see java.lang.String#toLowerCase(Locale)
- */
- public XMLString toUpperCase(Locale locale)
- {
- return new XMLStringDefault(m_str.toUpperCase(locale));
- }
-
- /**
- * Converts all of the characters in this <code>String</code> to upper
- * case using the rules of the default locale, which is returned
- * by <code>Locale.getDefault</code>.
- *
- * <p>
- * If no character in this string has a different uppercase version,
- * based on calling the <code>toUpperCase</code> method defined by
- * <code>Character</code>, then the original string is returned.
- * <p>
- * Otherwise, this method creates a new <code>String</code> object
- * representing a character sequence identical in length to the
- * character sequence represented by this <code>String</code> object and
- * with every character equal to the result of applying the method
- * <code>Character.toUpperCase</code> to the corresponding character of
- * this <code>String</code> object. <p>
- * Examples:
- * <blockquote><pre>
- * "Fahrvergn&uuml;gen".toUpperCase() returns "FAHRVERGN&Uuml;GEN"
- * "Visit Ljubinje!".toUpperCase() returns "VISIT LJUBINJE!"
- * </pre></blockquote>
- *
- * @return the string, converted to uppercase.
- * @see java.lang.Character#toUpperCase(char)
- * @see java.lang.String#toUpperCase(Locale)
- */
- public XMLString toUpperCase()
- {
- return new XMLStringDefault(m_str.toUpperCase());
- }
-
- /**
- * Removes white space from both ends of this string.
- * <p>
- * If this <code>String</code> object represents an empty character
- * sequence, or the first and last characters of character sequence
- * represented by this <code>String</code> object both have codes
- * greater than <code>'&#92;u0020'</code> (the space character), then a
- * reference to this <code>String</code> object is returned.
- * <p>
- * Otherwise, if there is no character with a code greater than
- * <code>'&#92;u0020'</code> in the string, then a new
- * <code>String</code> object representing an empty string is created
- * and returned.
- * <p>
- * Otherwise, let <i>k</i> be the index of the first character in the
- * string whose code is greater than <code>'&#92;u0020'</code>, and let
- * <i>m</i> be the index of the last character in the string whose code
- * is greater than <code>'&#92;u0020'</code>. A new <code>String</code>
- * object is created, representing the substring of this string that
- * begins with the character at index <i>k</i> and ends with the
- * character at index <i>m</i>-that is, the result of
- * <code>this.substring(<i>k</i>,&nbsp;<i>m</i>+1)</code>.
- * <p>
- * This method may be used to trim
- * {@link Character#isSpace(char) whitespace} from the beginning and end
- * of a string; in fact, it trims all ASCII control characters as well.
- *
- * @return this string, with white space removed from the front and end.
- */
- public XMLString trim()
- {
- return new XMLStringDefault(m_str.trim());
- }
-
- /**
- * This object (which is already a string!) is itself returned.
- *
- * @return the string itself.
- */
- public String toString()
- {
- return m_str;
- }
-
- /**
- * Tell if this object contains a java String object.
- *
- * @return true if this XMLString can return a string without creating one.
- */
- public boolean hasString()
- {
- return true;
- }
-
- /**
- * Convert a string to a double -- Allowed input is in fixed
- * notation ddd.fff.
- *
- * @return A double value representation of the string, or return Double.NaN
- * if the string can not be converted.
- */
- public double toDouble()
- {
- try {
- return Double.valueOf(m_str).doubleValue();
- }
- catch (NumberFormatException nfe)
- {
- return Double.NaN;
- }
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/XMLStringFactory.java b/src/com/sun/org/apache/xml/internal/utils/XMLStringFactory.java
deleted file mode 100644
index 21cab32..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/XMLStringFactory.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XMLStringFactory.java,v 1.2.4.1 2005/09/15 08:16:03 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-/**
- * A concrete class that implements this interface creates XMLString objects.
- */
-public abstract class XMLStringFactory
-{
-
- /**
- * Create a new XMLString from a Java string.
- *
- *
- * @param string Java String reference, which must be non-null.
- *
- * @return An XMLString object that wraps the String reference.
- */
- public abstract XMLString newstr(String string);
-
- /**
- * Create a XMLString from a FastStringBuffer.
- *
- *
- * @param string FastStringBuffer reference, which must be non-null.
- * @param start The start position in the array.
- * @param length The number of characters to read from the array.
- *
- * @return An XMLString object that wraps the FastStringBuffer reference.
- */
- public abstract XMLString newstr(FastStringBuffer string, int start,
- int length);
-
- /**
- * Create a XMLString from a FastStringBuffer.
- *
- *
- * @param string FastStringBuffer reference, which must be non-null.
- * @param start The start position in the array.
- * @param length The number of characters to read from the array.
- *
- * @return An XMLString object that wraps the FastStringBuffer reference.
- */
- public abstract XMLString newstr(char[] string, int start,
- int length);
-
- /**
- * Get a cheap representation of an empty string.
- *
- * @return An non-null reference to an XMLString that represents "".
- */
- public abstract XMLString emptystr();
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/XMLStringFactoryDefault.java b/src/com/sun/org/apache/xml/internal/utils/XMLStringFactoryDefault.java
deleted file mode 100644
index 639aea7..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/XMLStringFactoryDefault.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XMLStringFactoryDefault.java,v 1.2.4.1 2005/09/15 08:16:03 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils;
-
-/**
- * The default implementation of XMLStringFactory.
- * This implementation creates XMLStringDefault objects.
- */
-public class XMLStringFactoryDefault extends XMLStringFactory
-{
- // A constant representing the empty String
- private static final XMLStringDefault EMPTY_STR = new XMLStringDefault("");
-
- /**
- * Create a new XMLString from a Java string.
- *
- *
- * @param string Java String reference, which must be non-null.
- *
- * @return An XMLString object that wraps the String reference.
- */
- public XMLString newstr(String string)
- {
- return new XMLStringDefault(string);
- }
-
- /**
- * Create a XMLString from a FastStringBuffer.
- *
- *
- * @param fsb FastStringBuffer reference, which must be non-null.
- * @param start The start position in the array.
- * @param length The number of characters to read from the array.
- *
- * @return An XMLString object that wraps the FastStringBuffer reference.
- */
- public XMLString newstr(FastStringBuffer fsb, int start, int length)
- {
- return new XMLStringDefault(fsb.getString(start, length));
- }
-
- /**
- * Create a XMLString from a FastStringBuffer.
- *
- *
- * @param string FastStringBuffer reference, which must be non-null.
- * @param start The start position in the array.
- * @param length The number of characters to read from the array.
- *
- * @return An XMLString object that wraps the FastStringBuffer reference.
- */
- public XMLString newstr(char[] string, int start, int length)
- {
- return new XMLStringDefault(new String(string, start, length));
- }
-
- /**
- * Get a cheap representation of an empty string.
- *
- * @return An non-null reference to an XMLString that represents "".
- */
- public XMLString emptystr()
- {
- return EMPTY_STR;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/package.html b/src/com/sun/org/apache/xml/internal/utils/package.html
deleted file mode 100644
index 2ad696a..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/package.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<!--
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
--->
-<!--
- * Copyright 2000-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
--->
-<!-- $Id: package.html,v 1.2.4.1 2005/09/15 08:16:04 suresh_emailid Exp $ -->
-<html>
- <title>Xalan utilities.</title>
- <body>
- <p>Implementation of Xalan utility classes. This package is also shared by XPath.
- There *should* be no outward dependencies to XPath or Xalan by classes in this package.<p>
- </body>
-</html>
-
-
diff --git a/src/com/sun/org/apache/xml/internal/utils/res/CharArrayWrapper.java b/src/com/sun/org/apache/xml/internal/utils/res/CharArrayWrapper.java
deleted file mode 100644
index c5b6aba..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/res/CharArrayWrapper.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: CharArrayWrapper.java,v 1.1.4.1 2005/09/08 11:39:32 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils.res;
-
-/**
- *
- * It is a mutable object to wrap the char[] used in
- * the contents of the XResourceBundle class
- */
-public class CharArrayWrapper {
- private char[] m_char;
-
- public CharArrayWrapper(char[] arg){
- m_char = arg;
- }
-
- public char getChar(int index){
- return m_char[index];
- }
-
- public int getLength(){
- return m_char.length;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/res/IntArrayWrapper.java b/src/com/sun/org/apache/xml/internal/utils/res/IntArrayWrapper.java
deleted file mode 100644
index 7fc22f5..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/res/IntArrayWrapper.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: IntArrayWrapper.java,v 1.1.4.1 2005/09/08 11:39:32 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils.res;
-
-/**
- *
- * It is a mutable object to wrap the int[] used in
- * the contents of the XResourceBundle class
- */
-public class IntArrayWrapper {
- private int[] m_int;
-
- public IntArrayWrapper(int[] arg){
- m_int = arg;
- }
-
- public int getInt(int index){
- return m_int[index];
- }
-
- public int getLength(){
- return m_int.length;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/res/LongArrayWrapper.java b/src/com/sun/org/apache/xml/internal/utils/res/LongArrayWrapper.java
deleted file mode 100644
index 5324033..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/res/LongArrayWrapper.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: LongArrayWrapper.java,v 1.1.4.1 2005/09/08 11:39:32 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils.res;
-
-/**
- *
- * It is a mutable object to wrap the long[] used in
- * the contents of the XResourceBundle class
- */
-public class LongArrayWrapper {
- private long[] m_long;
-
- public LongArrayWrapper(long[] arg){
- m_long = arg;
- }
-
- public long getLong(int index){
- return m_long[index];
- }
-
- public int getLength(){
- return m_long.length;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/res/StringArrayWrapper.java b/src/com/sun/org/apache/xml/internal/utils/res/StringArrayWrapper.java
deleted file mode 100644
index 00b1c41..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/res/StringArrayWrapper.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: StringArrayWrapper.java,v 1.1.4.1 2005/09/08 11:39:33 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils.res;
-
-/**
- *
- * It is a mutable object to wrap the String[] used in
- * the contents of the XResourceBundle class
- */
-public class StringArrayWrapper {
- private String[] m_string;
-
- public StringArrayWrapper(String[] arg){
- m_string = arg;
- }
-
- public String getString(int index){
- return m_string[index];
- }
-
- public int getLength(){
- return m_string.length;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/res/XResourceBundle.java b/src/com/sun/org/apache/xml/internal/utils/res/XResourceBundle.java
deleted file mode 100644
index 708fbb4..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/res/XResourceBundle.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XResourceBundle.java,v 1.2.4.1 2005/09/15 08:16:04 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils.res;
-
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.ListResourceBundle;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * The default (english) resource bundle.
- *
- * @xsl.usage internal
- */
-public class XResourceBundle extends ListResourceBundle {
-
- /**
- * Error resource constants
- */
- public static final String ERROR_RESOURCES =
- "com.sun.org.apache.xalan.internal.res.XSLTErrorResources", XSLT_RESOURCE =
- "com.sun.org.apache.xml.internal.utils.res.XResourceBundle", LANG_BUNDLE_NAME =
- "com.sun.org.apache.xml.internal.utils.res.XResources", MULT_ORDER =
- "multiplierOrder", MULT_PRECEDES = "precedes", MULT_FOLLOWS =
- "follows", LANG_ORIENTATION = "orientation", LANG_RIGHTTOLEFT =
- "rightToLeft", LANG_LEFTTORIGHT = "leftToRight", LANG_NUMBERING =
- "numbering", LANG_ADDITIVE = "additive", LANG_MULT_ADD =
- "multiplicative-additive", LANG_MULTIPLIER =
- "multiplier", LANG_MULTIPLIER_CHAR =
- "multiplierChar", LANG_NUMBERGROUPS = "numberGroups", LANG_NUM_TABLES =
- "tables", LANG_ALPHABET = "alphabet", LANG_TRAD_ALPHABET = "tradAlphabet";
-
-
- /**
- * Get the association list.
- *
- * @return The association list.
- */
- public Object[][] getContents() {
- return new Object[][]{
- {"ui_language", "en"}, {"help_language", "en"}, {"language", "en"},
- {"alphabet", new CharArrayWrapper(new char[]{'A', 'B', 'C', 'D', 'E', 'F', 'G',
- 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U',
- 'V', 'W', 'X', 'Y', 'Z'})},
- {"tradAlphabet", new CharArrayWrapper(new char[]{'A', 'B', 'C', 'D', 'E', 'F',
- 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T',
- 'U', 'V', 'W', 'X', 'Y', 'Z'})},
- //language orientation
- {"orientation", "LeftToRight"},
- //language numbering
- {"numbering", "additive"},};
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/res/XResourceBundleBase.java b/src/com/sun/org/apache/xml/internal/utils/res/XResourceBundleBase.java
deleted file mode 100644
index c559dd4..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/res/XResourceBundleBase.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XResourceBundleBase.java,v 1.2.4.1 2005/09/15 08:16:05 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils.res;
-
-import java.util.ListResourceBundle;
-
-/**
- * This is an interface for error messages. This class is misnamed,
- * and should be called XalanResourceBundle, or some such.
- * @xsl.usage internal
- */
-abstract public class XResourceBundleBase extends ListResourceBundle
-{
-
- /**
- * Get the error string associated with the error code
- *
- * @param errorCode Error code
- *
- * @return error string associated with the given error code
- */
- abstract public String getMessageKey(int errorCode);
-
- /**
- * Get the warning string associated with the error code
- *
- * @param errorCode Error code
- *
- * @return warning string associated with the given error code
- */
- abstract public String getWarningKey(int errorCode);
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/res/XResources_de.java b/src/com/sun/org/apache/xml/internal/utils/res/XResources_de.java
deleted file mode 100644
index 2b2cdae..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/res/XResources_de.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XResources_de.java,v 1.2.4.1 2005/09/15 08:16:05 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils.res;
-
-//
-// LangResources_de.properties
-//
-
-/**
- * The German resource bundle.
- * @xsl.usage internal
- */
-public class XResources_de extends XResourceBundle
-{
- private static final Object[][] _contents = new Object[][]
- {
- { "ui_language", "de" }, { "help_language", "de" }, { "language", "de" },
- { "alphabet", new CharArrayWrapper(
- new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
- 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
- 'Y', 'Z' }) },
- { "tradAlphabet", new CharArrayWrapper(
- new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
- 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
- 'Y', 'Z' }) },
-
- //language orientation
- { "orientation", "LeftToRight" },
-
- //language numbering
- { "numbering", "additive" },
-
- // largest numerical value
- //{"MaxNumericalValue", new Integer()},
- //These would not be used for EN. Only used for traditional numbering
- //{"numberGroups", new int[]{10,1}},
- //These only used for mutiplicative-additive numbering
- //{"multiplier", "10"},
- //{"multiplierChar", "M"},
- //{"digits", new char[]{'a','b','c','d','e','f','g','h','i'}},
- //{"digits", new char[]{0x10D0,0x10D1,0x10D2,0x10D3,0x10D4,0x10D5,0x10D6,0x10D7,0x10D8}},
- //{"tens", new char[]{0x10D9,0x10DA,0x10DB,0x10DC,0x10DD,0x10DE,0x10DF,0x10E0,0x10E1}},
- //hundreds, etc...
- //{"tables", new String[]{"tens", "digits"}}
- };
-
- /**
- * Get the association list.
- *
- * @return The association list.
- */
- public Object[][] getContents()
- {
- return _contents;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/res/XResources_en.java b/src/com/sun/org/apache/xml/internal/utils/res/XResources_en.java
deleted file mode 100644
index c1de0b4..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/res/XResources_en.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XResources_en.java,v 1.2.4.1 2005/09/15 08:16:06 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils.res;
-
-//
-// LangResources_en.properties
-//
-
-/**
- * The English resource bundle.
- * @xsl.usage internal
- */
-public class XResources_en extends XResourceBundle
-{
-
- private static final Object[][] _contents = new Object[][]
- {
- { "ui_language", "en" }, { "help_language", "en" }, { "language", "en" },
- { "alphabet", new CharArrayWrapper(
- new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
- 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
- 'Y', 'Z' })},
- { "tradAlphabet", new CharArrayWrapper(
- new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
- 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
- 'Y', 'Z' }) },
-
- //language orientation
- { "orientation", "LeftToRight" },
-
- //language numbering
- { "numbering", "additive" },
-
- // largest numerical value
- //{"MaxNumericalValue", new Integer()},
- //These would not be used for EN. Only used for traditional numbering
- //{"numberGroups", new int[]{10,1}},
- //These only used for mutiplicative-additive numbering
- //{"multiplier", "10"},
- //{"multiplierChar", "M"},
- //{"digits", new char[]{'a','b','c','d','e','f','g','h','i'}},
- //{"digits", new char[]{0x10D0,0x10D1,0x10D2,0x10D3,0x10D4,0x10D5,0x10D6,0x10D7,0x10D8}},
- //{"tens", new char[]{0x10D9,0x10DA,0x10DB,0x10DC,0x10DD,0x10DE,0x10DF,0x10E0,0x10E1}},
- //hundreds, etc...
- //{"tables", new String[]{"tens", "digits"}}
- };
- /**
- * Get the association list.
- *
- * @return The association list.
- */
- public Object[][] getContents()
- {
- return _contents;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/res/XResources_es.java b/src/com/sun/org/apache/xml/internal/utils/res/XResources_es.java
deleted file mode 100644
index cd2bb80..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/res/XResources_es.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XResources_es.java,v 1.2.4.1 2005/09/15 08:16:06 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils.res;
-
-//
-// LangResources_es.properties
-//
-
-/**
- * The Spanish resource bundle.
- * @xsl.usage internal
- */
-public class XResources_es extends XResourceBundle
-{
- private static final Object[][] _contents = new Object[][]
- {
- { "ui_language", "es" }, { "help_language", "es" }, { "language", "es" },
- { "alphabet", new CharArrayWrapper(
- new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
- 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
- 'Y', 'Z' }) },
- { "tradAlphabet", new CharArrayWrapper(
- new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
- 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
- 'Y', 'Z' }) },
-
- //language orientation
- { "orientation", "LeftToRight" },
-
- //language numbering
- { "numbering", "additive" },
-
- // largest numerical value
- //{"MaxNumericalValue", new Integer()},
- //These would not be used for EN. Only used for traditional numbering
- //{"numberGroups", new int[]{10,1}},
- //These only used for mutiplicative-additive numbering
- //{"multiplier", "10"},
- //{"multiplierChar", "M"},
- //{"digits", new char[]{'a','b','c','d','e','f','g','h','i'}},
- //{"digits", new char[]{0x10D0,0x10D1,0x10D2,0x10D3,0x10D4,0x10D5,0x10D6,0x10D7,0x10D8}},
- //{"tens", new char[]{0x10D9,0x10DA,0x10DB,0x10DC,0x10DD,0x10DE,0x10DF,0x10E0,0x10E1}},
- //hundreds, etc...
- //{"tables", new String[]{"tens", "digits"}}
- };
-
- /**
- * Get the association list.
- *
- * @return The association list.
- */
- public Object[][] getContents()
- {
- return _contents;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/res/XResources_fr.java b/src/com/sun/org/apache/xml/internal/utils/res/XResources_fr.java
deleted file mode 100644
index 76d0993..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/res/XResources_fr.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XResources_fr.java,v 1.2.4.1 2005/09/15 08:16:06 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils.res;
-
-//
-// LangResources_fr.properties
-//
-
-/**
- * The French resource bundle.
- * @xsl.usage internal
- */
-public class XResources_fr extends XResourceBundle
-{
- private static final Object[][] _contents = new Object[][]
- {
- { "ui_language", "fr" }, { "help_language", "fr" }, { "language", "fr" },
- { "alphabet", new CharArrayWrapper(
- new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
- 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
- 'Y', 'Z' }) },
- { "tradAlphabet", new CharArrayWrapper(
- new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
- 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
- 'Y', 'Z' }) },
-
- //language orientation
- { "orientation", "LeftToRight" },
-
- //language numbering
- { "numbering", "additive" },
-
- // largest numerical value
- //{"MaxNumericalValue", new Integer()},
- //These would not be used for EN. Only used for traditional numbering
- //{"numberGroups", new int[]{10,1}},
- //These only used for mutiplicative-additive numbering
- //{"multiplier", "10"},
- //{"multiplierChar", "M"},
- //{"digits", new char[]{'a','b','c','d','e','f','g','h','i'}},
- //{"digits", new char[]{0x10D0,0x10D1,0x10D2,0x10D3,0x10D4,0x10D5,0x10D6,0x10D7,0x10D8}},
- //{"tens", new char[]{0x10D9,0x10DA,0x10DB,0x10DC,0x10DD,0x10DE,0x10DF,0x10E0,0x10E1}},
- //hundreds, etc...
- //{"tables", new String[]{"tens", "digits"}}
- };
-
- /**
- * Get the association list.
- *
- * @return The association list.
- */
- public Object[][] getContents()
- {
- return _contents;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/res/XResources_it.java b/src/com/sun/org/apache/xml/internal/utils/res/XResources_it.java
deleted file mode 100644
index 2d95de3..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/res/XResources_it.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XResources_it.java,v 1.2.4.1 2005/09/15 08:16:07 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils.res;
-
-//
-// LangResources_it.properties
-//
-
-/**
- * The Italian resource bundle.
- * @xsl.usage internal
- */
-public class XResources_it extends XResourceBundle
-{
- private static final Object[][] _contents = new Object[][]
- {
- { "ui_language", "it" }, { "help_language", "it" }, { "language", "it" },
- { "alphabet", new CharArrayWrapper(
- new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
- 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
- 'Y', 'Z' }) },
- { "tradAlphabet", new CharArrayWrapper(
- new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
- 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
- 'Y', 'Z' }) },
-
- //language orientation
- { "orientation", "LeftToRight" },
-
- //language numbering
- { "numbering", "additive" },
-
- // largest numerical value
- //{"MaxNumericalValue", new Integer()},
- //These would not be used for EN. Only used for traditional numbering
- //{"numberGroups", new int[]{10,1}},
- //These only used for mutiplicative-additive numbering
- //{"multiplier", "10"},
- //{"multiplierChar", "M"},
- //{"digits", new char[]{'a','b','c','d','e','f','g','h','i'}},
- //{"digits", new char[]{0x10D0,0x10D1,0x10D2,0x10D3,0x10D4,0x10D5,0x10D6,0x10D7,0x10D8}},
- //{"tens", new char[]{0x10D9,0x10DA,0x10DB,0x10DC,0x10DD,0x10DE,0x10DF,0x10E0,0x10E1}},
- //hundreds, etc...
- //{"tables", new String[]{"tens", "digits"}}
- };
-
- /**
- * Get the association list.
- *
- * @return The association list.
- */
- public Object[][] getContents()
- {
- return _contents;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/res/XResources_ja_JP_A.java b/src/com/sun/org/apache/xml/internal/utils/res/XResources_ja_JP_A.java
deleted file mode 100644
index b27785d..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/res/XResources_ja_JP_A.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XResources_ja_JP_A.java,v 1.2.4.1 2005/09/15 08:16:07 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils.res;
-
-//
-// LangResources_en.properties
-//
-
-/**
- * The Japanese (Katakana) resource bundle.
- * @xsl.usage internal
- */
-public class XResources_ja_JP_A extends XResourceBundle
-{
- private static final Object[][] _contents = new Object[][]
- {
- { "ui_language", "ja" }, { "help_language", "ja" }, { "language", "ja" },
- { "alphabet", new CharArrayWrapper(
- new char[]{ 0x30a2, 0x30a4, 0x30a6, 0x30a8, 0x30aa, 0x30ab, 0x30ad,
- 0x30af, 0x30b1, 0x30b3, 0x30b5, 0x30b7, 0x30b9, 0x30bb,
- 0x30bd, 0x30bf, 0x30c1, 0x30c4, 0x30c6, 0x30c8, 0x30ca,
- 0x30cb, 0x30cc, 0x30cd, 0x30ce, 0x30cf, 0x30d2, 0x30d5,
- 0x30d8, 0x30db, 0x30de, 0x30df, 0x30e0, 0x30e1, 0x30e2,
- 0x30e4, 0x30e6, 0x30e8, 0x30e9, 0x30ea, 0x30eb, 0x30ec,
- 0x30ed, 0x30ef, 0x30f0, 0x30f1, 0x30f2, 0x30f3 }) },
- { "tradAlphabet", new CharArrayWrapper(
- new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
- 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
- 'Y', 'Z' }) },
-
- //language orientation
- { "orientation", "LeftToRight" },
-
- //language numbering
- { "numbering", "multiplicative-additive" },
- { "multiplierOrder", "follows" },
-
- // largest numerical value
- //{"MaxNumericalValue", new Integer(10000000000)},
- //These would not be used for EN. Only used for traditional numbering
- { "numberGroups", new IntArrayWrapper(new int[]{ 1 }) },
-
- //These only used for mutiplicative-additive numbering
- // Note that we are using longs and that the last two
- // multipliers are not supported. This is a known limitation.
- { "multiplier", new LongArrayWrapper(
- new long[]{ Long.MAX_VALUE, Long.MAX_VALUE, 100000000, 10000, 1000,
- 100, 10 }) },
- { "multiplierChar", new CharArrayWrapper(
- new char[]{ 0x4EAC, 0x5146, 0x5104, 0x4E07, 0x5343, 0x767e, 0x5341 }) },
-
- // chinese only?
- { "zero", new CharArrayWrapper(new char[0]) },
- { "digits", new CharArrayWrapper(
- new char[]{ 0x4E00, 0x4E8C, 0x4E09, 0x56DB, 0x4E94, 0x516D, 0x4E03,
- 0x516B, 0x4E5D }) }, { "tables", new StringArrayWrapper(
- new String[]{ "digits" }) }
- };
-
- /**
- * Get the association list.
- *
- * @return The association list.
- */
- public Object[][] getContents()
- {
- return _contents;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/res/XResources_ja_JP_HA.java b/src/com/sun/org/apache/xml/internal/utils/res/XResources_ja_JP_HA.java
deleted file mode 100644
index 2fc877b..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/res/XResources_ja_JP_HA.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XResources_ja_JP_HA.java,v 1.2.4.1 2005/09/15 08:16:07 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils.res;
-
-//
-// LangResources_en.properties
-//
-
-/**
- * The Japanese (Hiragana) resource bundle.
- * @xsl.usage internal
- */
-public class XResources_ja_JP_HA extends XResourceBundle
-{
- private static final Object[][] _contents = new Object[][]
- {
- { "ui_language", "ja" }, { "help_language", "ja" }, { "language", "ja" },
- { "alphabet", new CharArrayWrapper(
- new char[]{ 0x3042, 0x3044, 0x3046, 0x3048, 0x304a, 0x304b, 0x304d,
- 0x304f, 0x3051, 0x3053, 0x3055, 0x3057, 0x3059, 0x305b,
- 0x305d, 0x305f, 0x3061, 0x3064, 0x3066, 0x3068, 0x306a,
- 0x306b, 0x306c, 0x306d, 0x306e, 0x306f, 0x3072, 0x3075,
- 0x3078, 0x307b, 0x307e, 0x307f, 0x3080, 0x3081, 0x3082,
- 0x3084, 0x3086, 0x3088, 0x3089, 0x308a, 0x308b, 0x308c,
- 0x308d, 0x308f, 0x3090, 0x3091, 0x3092, 0x3093 }) },
- { "tradAlphabet", new CharArrayWrapper(
- new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
- 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
- 'Y', 'Z' }) },
-
- //language orientation
- { "orientation", "LeftToRight" },
-
- //language numbering
- { "numbering", "multiplicative-additive" },
- { "multiplierOrder", "follows" },
-
- // largest numerical value
- //{"MaxNumericalValue", new Integer(10000000000)},
- //These would not be used for EN. Only used for traditional numbering
- { "numberGroups", new IntArrayWrapper(new int[]{ 1 }) },
-
- //These only used for mutiplicative-additive numbering
- // Note that we are using longs and that the last two
- // multipliers are not supported. This is a known limitation.
- { "multiplier", new LongArrayWrapper(
- new long[]{ Long.MAX_VALUE, Long.MAX_VALUE, 100000000, 10000, 1000,
- 100, 10 }) },
- { "multiplierChar", new CharArrayWrapper(
- new char[]{ 0x4EAC, 0x5146, 0x5104, 0x4E07, 0x5343, 0x767e, 0x5341 }) },
-
- // chinese only?
- { "zero", new CharArrayWrapper(new char[0]) },
- { "digits", new CharArrayWrapper(
- new char[]{ 0x4E00, 0x4E8C, 0x4E09, 0x56DB, 0x4E94, 0x516D, 0x4E03,
- 0x516B, 0x4E5D }) }, { "tables", new StringArrayWrapper(
- new String[]{ "digits" }) }
- };
-
- /**
- * Get the association list.
- *
- * @return The association list.
- */
- public Object[][] getContents()
- {
- return _contents;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/res/XResources_ja_JP_HI.java b/src/com/sun/org/apache/xml/internal/utils/res/XResources_ja_JP_HI.java
deleted file mode 100644
index a1a5f53..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/res/XResources_ja_JP_HI.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XResources_ja_JP_HI.java,v 1.2.4.1 2005/09/15 08:16:07 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils.res;
-
-//
-// LangResources_en.properties
-//
-
-/**
- * The Japanese (Hiragana) resource bundle.
- * @xsl.usage internal
- */
-public class XResources_ja_JP_HI extends XResourceBundle
-{
- private static final Object[][] _contents = new Object[][]
- {
- { "ui_language", "ja" }, { "help_language", "ja" }, { "language", "ja" },
- { "alphabet", new CharArrayWrapper(
- new char[]{ 0x3044, 0x308d, 0x306f, 0x306b, 0x307b, 0x3078, 0x3068,
- 0x3061, 0x308a, 0x306c, 0x308b, 0x3092, 0x308f, 0x304b,
- 0x3088, 0x305f, 0x308c, 0x305d, 0x3064, 0x306d, 0x306a,
- 0x3089, 0x3080, 0x3046, 0x3090, 0x306e, 0x304a, 0x304f,
- 0x3084, 0x307e, 0x3051, 0x3075, 0x3053, 0x3048, 0x3066,
- 0x3042, 0x3055, 0x304d, 0x3086, 0x3081, 0x307f, 0x3057,
- 0x3091, 0x3072, 0x3082, 0x305b, 0x3059 }) },
- { "tradAlphabet", new CharArrayWrapper(
- new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
- 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
- 'Y', 'Z' }) },
-
- //language orientation
- { "orientation", "LeftToRight" },
-
- //language numbering
- { "numbering", "multiplicative-additive" },
- { "multiplierOrder", "follows" },
-
- // largest numerical value
- //{"MaxNumericalValue", new Integer(10000000000)},
- //These would not be used for EN. Only used for traditional numbering
- { "numberGroups", new IntArrayWrapper(new int[]{ 1 }) },
-
- //These only used for mutiplicative-additive numbering
- // Note that we are using longs and that the last two
- // multipliers are not supported. This is a known limitation.
- { "multiplier", new LongArrayWrapper(
- new long[]{ Long.MAX_VALUE, Long.MAX_VALUE, 100000000, 10000, 1000,
- 100, 10 }) },
- { "multiplierChar", new CharArrayWrapper(
- new char[]{ 0x4EAC, 0x5146, 0x5104, 0x4E07, 0x5343, 0x767e, 0x5341 }) },
-
- // chinese only??
- { "zero", new CharArrayWrapper(new char[0]) },
- { "digits", new CharArrayWrapper(
- new char[]{ 0x4E00, 0x4E8C, 0x4E09, 0x56DB, 0x4E94, 0x516D, 0x4E03,
- 0x516B, 0x4E5D }) }, { "tables", new StringArrayWrapper(
- new String[]{ "digits" }) }
- };
-
- /**
- * Get the association table for this resource.
- *
- *
- * @return the association table for this resource.
- */
- public Object[][] getContents()
- {
- return _contents;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/res/XResources_ja_JP_I.java b/src/com/sun/org/apache/xml/internal/utils/res/XResources_ja_JP_I.java
deleted file mode 100644
index 1f53e93..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/res/XResources_ja_JP_I.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XResources_ja_JP_I.java,v 1.2.4.1 2005/09/15 08:16:07 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils.res;
-
-//
-// LangResources_en.properties
-//
-
-/**
- * The Japanese (Katakana) resource bundle.
- * @xsl.usage internal
- */
-public class XResources_ja_JP_I extends XResourceBundle
-{
- private static final Object[][] _contents = new Object[][]
- {
- { "ui_language", "ja" }, { "help_language", "ja" }, { "language", "ja" },
- { "alphabet", new CharArrayWrapper(
- new char[]{ 0x30a4, 0x30ed, 0x30cf, 0x30cb, 0x30db, 0x30d8, 0x30c8,
- 0x30c1, 0x30ea, 0x30cc, 0x30eb, 0x30f2, 0x30ef, 0x30ab,
- 0x30e8, 0x30bf, 0x30ec, 0x30bd, 0x30c4, 0x30cd, 0x30ca,
- 0x30e9, 0x30e0, 0x30a6, 0x30f0, 0x30ce, 0x30aa, 0x30af,
- 0x30e4, 0x30de, 0x30b1, 0x30d5, 0x30b3, 0x30a8, 0x30c6,
- 0x30a2, 0x30b5, 0x30ad, 0x30e6, 0x30e1, 0x30df, 0x30b7,
- 0x30f1, 0x30d2, 0x30e2, 0x30bb, 0x30b9 }) },
- { "tradAlphabet", new CharArrayWrapper(
- new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
- 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
- 'Y', 'Z' }) },
-
- //language orientation
- { "orientation", "LeftToRight" },
-
- //language numbering
- { "numbering", "multiplicative-additive" },
- { "multiplierOrder", "follows" },
-
- // largest numerical value
- //{"MaxNumericalValue", new Integer(10000000000)},
- //These would not be used for EN. Only used for traditional numbering
- { "numberGroups", new IntArrayWrapper(new int[]{ 1 }) },
-
- //These only used for mutiplicative-additive numbering
- // Note that we are using longs and that the last two
- // multipliers are not supported. This is a known limitation.
- { "multiplier", new LongArrayWrapper(
- new long[]{ Long.MAX_VALUE, Long.MAX_VALUE, 100000000, 10000, 1000, 100, 10 }) },
- { "multiplierChar", new CharArrayWrapper(
- new char[]{ 0x4EAC, 0x5146, 0x5104, 0x4E07, 0x5343, 0x767e, 0x5341 }) },
-
- // chinese only??
- { "zero", new CharArrayWrapper(new char[0]) },
- { "digits", new CharArrayWrapper(
- new char[]{ 0x4E00, 0x4E8C, 0x4E09, 0x56DB, 0x4E94, 0x516D, 0x4E03,
- 0x516B, 0x4E5D }) }, { "tables", new StringArrayWrapper(
- new String[]{ "digits" }) }
- };
-
- /**
- * Get the association table for this resource.
- *
- *
- * @return the association table for this resource.
- */
- public Object[][] getContents()
- {
- return _contents;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/res/XResources_ko.java b/src/com/sun/org/apache/xml/internal/utils/res/XResources_ko.java
deleted file mode 100644
index 981d9a9..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/res/XResources_ko.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XResources_ko.java,v 1.2.4.1 2005/09/15 08:16:08 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils.res;
-
-//
-// LangResources_ko.properties
-//
-
-/**
- * The Korean resource bundle.
- * @xsl.usage internal
- */
-public class XResources_ko extends XResourceBundle
-{
- private static final Object[][] _contents = new Object[][]
- {
- { "ui_language", "ko" }, { "help_language", "ko" }, { "language", "ko" },
- { "alphabet", new CharArrayWrapper(
- new char[]{ 0x3131, 0x3134, 0x3137, 0x3139, 0x3141, 0x3142, 0x3145,
- 0x3147, 0x3148, 0x314a, 0x314b, 0x314c, 0x314d, 0x314e,
- 0x314f, 0x3151, 0x3153, 0x3155, 0x3157, 0x315b, 0x315c,
- 0x3160, 0x3161, 0x3163})},
- { "tradAlphabet", new CharArrayWrapper(
- new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
- 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
- 'Y', 'Z' }) },
-
- //language orientation
- { "orientation", "LeftToRight" },
-
- //language numbering
- { "numbering", "multiplicative-additive" },
- { "multiplierOrder", "follows" },
-
- // largest numerical value
- //{"MaxNumericalValue", new Integer(100000000)},
- //These would not be used for EN. Only used for traditional numbering
- { "numberGroups", new IntArrayWrapper(new int[]{ 1 }) },
-
- // chinese only ??
- { "zero", new CharArrayWrapper(new char[0]) },
-
- //These only used for mutiplicative-additive numbering
- { "multiplier", new LongArrayWrapper(new long[]{ 100000000, 10000, 1000,
- 100, 10 }) },
- { "multiplierChar", new CharArrayWrapper(
- new char[]{ 0xc5b5, 0xb9cc, 0xcc9c, 0xbc31, 0xc2ed }) },
- { "digits", new CharArrayWrapper(
- new char[]{ 0xc77c, 0xc774, 0xc0bc, 0xc0ac, 0xc624, 0xc721, 0xce60,
- 0xd314, 0xad6c}) }, { "tables", new StringArrayWrapper(
- new String[]{ "digits" }) }
- };
-
- /**
- * Get the association list.
- *
- * @return The association list.
- */
- public Object[][] getContents()
- {
- return _contents;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/res/XResources_sv.java b/src/com/sun/org/apache/xml/internal/utils/res/XResources_sv.java
deleted file mode 100644
index 2d04a64..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/res/XResources_sv.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XResources_sv.java,v 1.2.4.1 2005/09/15 08:16:09 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils.res;
-
-//
-// LangResources_sv.properties
-//
-
-/**
- * The Swedish resource bundle.
- * @xsl.usage internal
- */
-public class XResources_sv extends XResourceBundle
-{
- private static final Object[][] _contents = new Object[][]
- {
- { "ui_language", "sv" }, { "help_language", "sv" }, { "language", "sv" },
- { "alphabet", new CharArrayWrapper(
- new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
- 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
- 'Y', 'Z' }) },
- { "tradAlphabet", new CharArrayWrapper(
- new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
- 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
- 'Y', 'Z' }) },
-
- //language orientation
- { "orientation", "LeftToRight" },
-
- //language numbering
- { "numbering", "additive" },
-
- // largest numerical value
- //{"MaxNumericalValue", new Integer()},
- //These would not be used for EN. Only used for traditional numbering
- //{"numberGroups", new int[]{10,1}},
- //These only used for mutiplicative-additive numbering
- //{"multiplier", "10"},
- //{"multiplierChar", "M"},
- //{"digits", new char[]{'a','b','c','d','e','f','g','h','i'}},
- //{"digits", new char[]{0x10D0,0x10D1,0x10D2,0x10D3,0x10D4,0x10D5,0x10D6,0x10D7,0x10D8}},
- //{"tens", new char[]{0x10D9,0x10DA,0x10DB,0x10DC,0x10DD,0x10DE,0x10DF,0x10E0,0x10E1}},
- //hundreds, etc...
- //{"tables", new String[]{"tens", "digits"}}
- };
-
- /**
- * Get the association list.
- *
- * @return The association list.
- */
- public Object[][] getContents()
- {
- return _contents;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/res/XResources_zh_CN.java b/src/com/sun/org/apache/xml/internal/utils/res/XResources_zh_CN.java
deleted file mode 100644
index 8fd840f..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/res/XResources_zh_CN.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XResources_zh_CN.java,v 1.2.4.1 2005/09/15 08:16:10 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils.res;
-
-//
-// LangResources_en.properties
-//
-
-/**
- * The Chinese resource bundle.
- * @xsl.usage internal
- */
-public class XResources_zh_CN extends XResourceBundle
-{
- private static final Object[][] _contents = new Object[][]
- {
- { "ui_language", "zh" }, { "help_language", "zh" }, { "language", "zh" },
- { "alphabet", new CharArrayWrapper(
- new char[]{ 0xff21, 0xff22, 0xff23, 0xff24, 0xff25, 0xff26, 0xff27,
- 0xff28, 0xff29, 0xff2a, 0xff2b, 0xff2c, 0xff2d, 0xff2e,
- 0xff2f, 0xff30, 0xff31, 0xff32, 0xff33, 0xff34, 0xff35,
- 0xff36, 0xff37, 0xff38, 0xff39, 0xff3a }) },
- { "tradAlphabet", new CharArrayWrapper(
- new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
- 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
- 'Y', 'Z' }) },
-
- //language orientation
- { "orientation", "LeftToRight" },
-
- //language numbering
- { "numbering", "multiplicative-additive" },
- { "multiplierOrder", "follows" },
-
- // largest numerical value
- //{"MaxNumericalValue", new Integer(100000000)},
- //These would not be used for EN. Only used for traditional numbering
- { "numberGroups", new IntArrayWrapper(new int[]{ 1 }) },
-
- // simplified chinese
- { "zero", new CharArrayWrapper(new char[]{ 0x96f6 }) },
-
- //These only used for mutiplicative-additive numbering
- { "multiplier", new LongArrayWrapper(new long[]{ 100000000, 10000, 1000,
- 100, 10 }) },
- { "multiplierChar", new CharArrayWrapper(
- new char[]{ 0x4ebf, 0x4e07, 0x5343, 0x767e, 0x5341 }) },
- { "digits", new CharArrayWrapper(
- new char[]{ 0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x4e94, 0x516d, 0x4e03,
- 0x516b, 0x4e5d }) }, { "tables", new StringArrayWrapper(
- new String[]{ "digits" }) }
- };
-
- /**
- * Get the association list.
- *
- * @return The association list.
- */
- public Object[][] getContents()
- {
- return _contents;
- }
-}
diff --git a/src/com/sun/org/apache/xml/internal/utils/res/XResources_zh_TW.java b/src/com/sun/org/apache/xml/internal/utils/res/XResources_zh_TW.java
deleted file mode 100644
index 3397329..0000000
--- a/src/com/sun/org/apache/xml/internal/utils/res/XResources_zh_TW.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XResources_zh_TW.java,v 1.2.4.1 2005/09/15 08:16:10 suresh_emailid Exp $
- */
-package com.sun.org.apache.xml.internal.utils.res;
-
-//
-// LangResources_en.properties
-//
-
-/**
- * The Chinese(Taiwan) resource bundle.
- * @xsl.usage internal
- */
-public class XResources_zh_TW extends XResourceBundle
-{
- private static final Object[][] _contents = new Object[][]
- {
- { "ui_language", "zh" }, { "help_language", "zh" }, { "language", "zh" },
- { "alphabet", new CharArrayWrapper(
- new char[]{ 0xff21, 0xff22, 0xff23, 0xff24, 0xff25, 0xff26, 0xff27,
- 0xff28, 0xff29, 0xff2a, 0xff2b, 0xff2c, 0xff2d, 0xff2e,
- 0xff2f, 0xff30, 0xff31, 0xff32, 0xff33, 0xff34, 0xff35,
- 0xff36, 0xff37, 0xff38, 0xff39, 0xff3a }) },
- { "tradAlphabet", new CharArrayWrapper(
- new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
- 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
- 'Y', 'Z' }) },
-
- //language orientation
- { "orientation", "LeftToRight" },
-
- //language numbering
- { "numbering", "multiplicative-additive" },
- { "multiplierOrder", "follows" },
-
- // largest numerical value
- //{"MaxNumericalValue", new Integer(100000000)},
- //These would not be used for EN. Only used for traditional numbering
- { "numberGroups", new IntArrayWrapper(new int[]{ 1 }) },
-
- // simplified chinese
- { "zero", new CharArrayWrapper(new char[]{ 0x96f6 }) },
-
- //These only used for mutiplicative-additive numbering
- { "multiplier", new LongArrayWrapper(new long[]{ 100000000, 10000, 1000,
- 100, 10 }) },
- { "multiplierChar", new CharArrayWrapper(
- new char[]{ 0x5104, 0x842c, 0x4edf, 0x4f70, 0x62fe }) },
- { "digits", new CharArrayWrapper(
- new char[]{ 0x58f9, 0x8cb3, 0x53c3, 0x8086, 0x4f0d, 0x9678, 0x67d2,
- 0x634c, 0x7396 }) }, { "tables", new StringArrayWrapper(
- new String[]{ "digits" }) }
- };
-
- /**
- * Get the association list.
- *
- * @return The association list.
- */
- public Object[][] getContents()
- {
- return _contents;
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/Arg.java b/src/com/sun/org/apache/xpath/internal/Arg.java
deleted file mode 100644
index 311d07e..0000000
--- a/src/com/sun/org/apache/xpath/internal/Arg.java
+++ /dev/null
@@ -1,267 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Arg.java,v 1.1.2.1 2005/08/01 01:30:11 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal;
-
-import com.sun.org.apache.xml.internal.utils.QName;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-import java.util.Objects;
-
-/**
- * This class holds an instance of an argument on
- * the stack. The value of the argument can be either an
- * XObject or a String containing an expression.
- * @xsl.usage internal
- */
-public class Arg
-{
-
- /** Field m_qname: The name of this argument, expressed as a QName
- * (Qualified Name) object.
- * @see getQName
- * @see setQName
- * */
- private QName m_qname;
-
- /**
- * Get the qualified name for this argument.
- *
- * @return QName object containing the qualified name
- */
- public final QName getQName()
- {
- return m_qname;
- }
-
- /**
- * Set the qualified name for this argument.
- *
- * @param name QName object representing the new Qualified Name.
- */
- public final void setQName(QName name)
- {
- m_qname = name;
- }
-
- /** Field m_val: Stored XObject value of this argument
- * @see #getVal()
- * @see #setVal()
- */
- private XObject m_val;
-
- /**
- * Get the value for this argument.
- *
- * @return the argument's stored XObject value.
- * @see #setVal(XObject)
- */
- public final XObject getVal()
- {
- return m_val;
- }
-
- /**
- * Set the value of this argument.
- *
- * @param val an XObject representing the arguments's value.
- * @see #getVal()
- */
- public final void setVal(XObject val)
- {
- m_val = val;
- }
-
- /**
- * Have the object release it's resources.
- * Call only when the variable or argument is going out of scope.
- */
- public void detach()
- {
- if(null != m_val)
- {
- m_val.allowDetachToRelease(true);
- m_val.detach();
- }
- }
-
-
- /** Field m_expression: Stored expression value of this argument.
- * @see #setExpression
- * @see #getExpression
- * */
- private String m_expression;
-
- /**
- * Get the value expression for this argument.
- *
- * @return String containing the expression previously stored into this
- * argument
- * @see #setExpression
- */
- public String getExpression()
- {
- return m_expression;
- }
-
- /**
- * Set the value expression for this argument.
- *
- * @param expr String containing the expression to be stored as this
- * argument's value.
- * @see #getExpression
- */
- public void setExpression(String expr)
- {
- m_expression = expr;
- }
-
- /**
- * True if this variable was added with an xsl:with-param or
- * is added via setParameter.
- */
- private boolean m_isFromWithParam;
-
- /**
- * Tell if this variable is a parameter passed with a with-param or as
- * a top-level parameter.
- */
- public boolean isFromWithParam()
- {
- return m_isFromWithParam;
- }
-
- /**
- * True if this variable is currently visible. To be visible,
- * a variable needs to come either from xsl:variable or be
- * a "received" parameter, ie one for which an xsl:param has
- * been encountered.
- * Set at the time the object is constructed and updated as needed.
- */
- private boolean m_isVisible;
-
- /**
- * Tell if this variable is currently visible.
- */
- public boolean isVisible()
- {
- return m_isVisible;
- }
-
- /**
- * Update visibility status of this variable.
- */
- public void setIsVisible(boolean b)
- {
- m_isVisible = b;
- }
-
- /**
- * Construct a dummy parameter argument, with no QName and no
- * value (either expression string or value XObject). isVisible
- * defaults to true.
- */
- public Arg()
- {
-
- m_qname = new QName("");
- // so that string compares can be done.
- m_val = null;
- m_expression = null;
- m_isVisible = true;
- m_isFromWithParam = false;
- }
-
- /**
- * Construct a parameter argument that contains an expression.
- *
- * @param qname Name of the argument, expressed as a QName object.
- * @param expression String to be stored as this argument's value expression.
- * @param isFromWithParam True if this is a parameter variable.
- */
- public Arg(QName qname, String expression, boolean isFromWithParam)
- {
-
- m_qname = qname;
- m_val = null;
- m_expression = expression;
- m_isFromWithParam = isFromWithParam;
- m_isVisible = !isFromWithParam;
- }
-
- /**
- * Construct a parameter argument which has an XObject value.
- * isVisible defaults to true.
- *
- * @param qname Name of the argument, expressed as a QName object.
- * @param val Value of the argument, expressed as an XObject
- */
- public Arg(QName qname, XObject val)
- {
-
- m_qname = qname;
- m_val = val;
- m_isVisible = true;
- m_isFromWithParam = false;
- m_expression = null;
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(this.m_qname);
- }
-
- /**
- * Equality function specialized for the variable name. If the argument
- * is not a qname, it will deligate to the super class.
- *
- * @param obj the reference object with which to compare.
- * @return <code>true</code> if this object is the same as the obj
- * argument; <code>false</code> otherwise.
- */
- @Override
- public boolean equals(Object obj)
- {
- if(obj instanceof QName)
- {
- return m_qname.equals(obj);
- }
- else
- return super.equals(obj);
- }
-
- /**
- * Construct a parameter argument.
- *
- * @param qname Name of the argument, expressed as a QName object.
- * @param val Value of the argument, expressed as an XObject
- * @param isFromWithParam True if this is a parameter variable.
- */
- public Arg(QName qname, XObject val, boolean isFromWithParam)
- {
-
- m_qname = qname;
- m_val = val;
- m_isFromWithParam = isFromWithParam;
- m_isVisible = !isFromWithParam;
- m_expression = null;
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/CachedXPathAPI.java b/src/com/sun/org/apache/xpath/internal/CachedXPathAPI.java
deleted file mode 100644
index 219591c..0000000
--- a/src/com/sun/org/apache/xpath/internal/CachedXPathAPI.java
+++ /dev/null
@@ -1,337 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: CachedXPathAPI.java,v 1.2.4.1 2005/09/10 03:47:42 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal;
-
-import javax.xml.transform.TransformerException;
-
-import com.sun.org.apache.xml.internal.utils.PrefixResolver;
-import com.sun.org.apache.xml.internal.utils.PrefixResolverDefault;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.traversal.NodeIterator;
-
-/**
- * The methods in this class are convenience methods into the
- * low-level XPath API.
- *
- * These functions tend to be a little slow, since a number of objects must be
- * created for each evaluation. A faster way is to precompile the
- * XPaths using the low-level API, and then just use the XPaths
- * over and over.
- *
- * This is an alternative for the old XPathAPI class, which provided
- * static methods for the purpose but had the drawback of
- * instantiating a new XPathContext (and thus building a new DTMManager,
- * and new DTMs) each time it was called. XPathAPIObject instead retains
- * its context as long as the object persists, reusing the DTMs. This
- * does have a downside: if you've changed your source document, you should
- * obtain a new XPathAPIObject to continue searching it, since trying to use
- * the old DTMs will probably yield bad results or malfunction outright... and
- * the cached DTMs may consume memory until this object and its context are
- * returned to the heap. Essentially, it's the caller's responsibility to
- * decide when to discard the cache.
- *
- * @see <a href="http://www.w3.org/TR/xpath">XPath Specification</a>
- * */
-public class CachedXPathAPI
-{
- /** XPathContext, and thus the document model system (DTMs), persists through multiple
- calls to this object. This is set in the constructor.
- */
- protected XPathContext xpathSupport;
-
- /**
- * <p>Default constructor. Establishes its own {@link XPathContext}, and hence
- * its own {@link com.sun.org.apache.xml.internal.dtm.DTMManager}.
- * Good choice for simple uses.</p>
- * <p>Note that any particular instance of {@link CachedXPathAPI} must not be
- * operated upon by multiple threads without synchronization; we do
- * not currently support multithreaded access to a single
- * {@link com.sun.org.apache.xml.internal.dtm.DTM}.</p>
- */
- public CachedXPathAPI()
- {
- xpathSupport = new XPathContext();
- }
-
- /**
- * <p>This constructor shares its {@link XPathContext} with a pre-existing
- * {@link CachedXPathAPI}. That allows sharing document models
- * ({@link com.sun.org.apache.xml.internal.dtm.DTM}) and previously established location
- * state.</p>
- * <p>Note that the original {@link CachedXPathAPI} and the new one should
- * not be operated upon concurrently; we do not support multithreaded access
- * to a single {@link com.sun.org.apache.xml.internal.dtm.DTM} at this time. Similarly,
- * any particular instance of {@link CachedXPathAPI} must not be operated
- * upon by multiple threads without synchronization.</p>
- * <p>%REVIEW% Should this instead do a clone-and-reset on the XPathSupport object?</p>
- *
- */
- public CachedXPathAPI(CachedXPathAPI priorXPathAPI)
- {
- xpathSupport = priorXPathAPI.xpathSupport;
- }
-
-
- /** Returns the XPathSupport object used in this CachedXPathAPI
- *
- * %REVIEW% I'm somewhat concerned about the loss of encapsulation
- * this causes, but the xml-security folks say they need it.
- * */
- public XPathContext getXPathContext()
- {
- return this.xpathSupport;
- }
-
-
- /**
- * Use an XPath string to select a single node. XPath namespace
- * prefixes are resolved from the context node, which may not
- * be what you want (see the next method).
- *
- * @param contextNode The node to start searching from.
- * @param str A valid XPath string.
- * @return The first node found that matches the XPath, or null.
- *
- * @throws TransformerException
- */
- public Node selectSingleNode(Node contextNode, String str)
- throws TransformerException
- {
- return selectSingleNode(contextNode, str, contextNode);
- }
-
- /**
- * Use an XPath string to select a single node.
- * XPath namespace prefixes are resolved from the namespaceNode.
- *
- * @param contextNode The node to start searching from.
- * @param str A valid XPath string.
- * @param namespaceNode The node from which prefixes in the XPath will be resolved to namespaces.
- * @return The first node found that matches the XPath, or null.
- *
- * @throws TransformerException
- */
- public Node selectSingleNode(
- Node contextNode, String str, Node namespaceNode)
- throws TransformerException
- {
-
- // Have the XObject return its result as a NodeSetDTM.
- NodeIterator nl = selectNodeIterator(contextNode, str, namespaceNode);
-
- // Return the first node, or null
- return nl.nextNode();
- }
-
- /**
- * Use an XPath string to select a nodelist.
- * XPath namespace prefixes are resolved from the contextNode.
- *
- * @param contextNode The node to start searching from.
- * @param str A valid XPath string.
- * @return A NodeIterator, should never be null.
- *
- * @throws TransformerException
- */
- public NodeIterator selectNodeIterator(Node contextNode, String str)
- throws TransformerException
- {
- return selectNodeIterator(contextNode, str, contextNode);
- }
-
- /**
- * Use an XPath string to select a nodelist.
- * XPath namespace prefixes are resolved from the namespaceNode.
- *
- * @param contextNode The node to start searching from.
- * @param str A valid XPath string.
- * @param namespaceNode The node from which prefixes in the XPath will be resolved to namespaces.
- * @return A NodeIterator, should never be null.
- *
- * @throws TransformerException
- */
- public NodeIterator selectNodeIterator(
- Node contextNode, String str, Node namespaceNode)
- throws TransformerException
- {
-
- // Execute the XPath, and have it return the result
- XObject list = eval(contextNode, str, namespaceNode);
-
- // Have the XObject return its result as a NodeSetDTM.
- return list.nodeset();
- }
-
- /**
- * Use an XPath string to select a nodelist.
- * XPath namespace prefixes are resolved from the contextNode.
- *
- * @param contextNode The node to start searching from.
- * @param str A valid XPath string.
- * @return A NodeIterator, should never be null.
- *
- * @throws TransformerException
- */
- public NodeList selectNodeList(Node contextNode, String str)
- throws TransformerException
- {
- return selectNodeList(contextNode, str, contextNode);
- }
-
- /**
- * Use an XPath string to select a nodelist.
- * XPath namespace prefixes are resolved from the namespaceNode.
- *
- * @param contextNode The node to start searching from.
- * @param str A valid XPath string.
- * @param namespaceNode The node from which prefixes in the XPath will be resolved to namespaces.
- * @return A NodeIterator, should never be null.
- *
- * @throws TransformerException
- */
- public NodeList selectNodeList(
- Node contextNode, String str, Node namespaceNode)
- throws TransformerException
- {
-
- // Execute the XPath, and have it return the result
- XObject list = eval(contextNode, str, namespaceNode);
-
- // Return a NodeList.
- return list.nodelist();
- }
-
- /**
- * Evaluate XPath string to an XObject. Using this method,
- * XPath namespace prefixes will be resolved from the namespaceNode.
- * @param contextNode The node to start searching from.
- * @param str A valid XPath string.
- * @return An XObject, which can be used to obtain a string, number, nodelist, etc, should never be null.
- * @see com.sun.org.apache.xpath.internal.objects.XObject
- * @see com.sun.org.apache.xpath.internal.objects.XNull
- * @see com.sun.org.apache.xpath.internal.objects.XBoolean
- * @see com.sun.org.apache.xpath.internal.objects.XNumber
- * @see com.sun.org.apache.xpath.internal.objects.XString
- * @see com.sun.org.apache.xpath.internal.objects.XRTreeFrag
- *
- * @throws TransformerException
- */
- public XObject eval(Node contextNode, String str)
- throws TransformerException
- {
- return eval(contextNode, str, contextNode);
- }
-
- /**
- * Evaluate XPath string to an XObject.
- * XPath namespace prefixes are resolved from the namespaceNode.
- * The implementation of this is a little slow, since it creates
- * a number of objects each time it is called. This could be optimized
- * to keep the same objects around, but then thread-safety issues would arise.
- *
- * @param contextNode The node to start searching from.
- * @param str A valid XPath string.
- * @param namespaceNode The node from which prefixes in the XPath will be resolved to namespaces.
- * @return An XObject, which can be used to obtain a string, number, nodelist, etc, should never be null.
- * @see com.sun.org.apache.xpath.internal.objects.XObject
- * @see com.sun.org.apache.xpath.internal.objects.XNull
- * @see com.sun.org.apache.xpath.internal.objects.XBoolean
- * @see com.sun.org.apache.xpath.internal.objects.XNumber
- * @see com.sun.org.apache.xpath.internal.objects.XString
- * @see com.sun.org.apache.xpath.internal.objects.XRTreeFrag
- *
- * @throws TransformerException
- */
- public XObject eval(Node contextNode, String str, Node namespaceNode)
- throws TransformerException
- {
-
- // Since we don't have a XML Parser involved here, install some default support
- // for things like namespaces, etc.
- // (Changed from: XPathContext xpathSupport = new XPathContext();
- // because XPathContext is weak in a number of areas... perhaps
- // XPathContext should be done away with.)
-
- // Create an object to resolve namespace prefixes.
- // XPath namespaces are resolved from the input context node's document element
- // if it is a root node, or else the current context node (for lack of a better
- // resolution space, given the simplicity of this sample code).
- PrefixResolverDefault prefixResolver = new PrefixResolverDefault(
- (namespaceNode.getNodeType() == Node.DOCUMENT_NODE)
- ? ((Document) namespaceNode).getDocumentElement() : namespaceNode);
-
- // Create the XPath object.
- XPath xpath = new XPath(str, null, prefixResolver, XPath.SELECT, null);
-
- // Execute the XPath, and have it return the result
- // return xpath.execute(xpathSupport, contextNode, prefixResolver);
- int ctxtNode = xpathSupport.getDTMHandleFromNode(contextNode);
-
- return xpath.execute(xpathSupport, ctxtNode, prefixResolver);
- }
-
- /**
- * Evaluate XPath string to an XObject.
- * XPath namespace prefixes are resolved from the namespaceNode.
- * The implementation of this is a little slow, since it creates
- * a number of objects each time it is called. This could be optimized
- * to keep the same objects around, but then thread-safety issues would arise.
- *
- * @param contextNode The node to start searching from.
- * @param str A valid XPath string.
- * @param prefixResolver Will be called if the parser encounters namespace
- * prefixes, to resolve the prefixes to URLs.
- * @return An XObject, which can be used to obtain a string, number, nodelist, etc, should never be null.
- * @see com.sun.org.apache.xpath.internal.objects.XObject
- * @see com.sun.org.apache.xpath.internal.objects.XNull
- * @see com.sun.org.apache.xpath.internal.objects.XBoolean
- * @see com.sun.org.apache.xpath.internal.objects.XNumber
- * @see com.sun.org.apache.xpath.internal.objects.XString
- * @see com.sun.org.apache.xpath.internal.objects.XRTreeFrag
- *
- * @throws TransformerException
- */
- public XObject eval(
- Node contextNode, String str, PrefixResolver prefixResolver)
- throws TransformerException
- {
-
- // Since we don't have a XML Parser involved here, install some default support
- // for things like namespaces, etc.
- // (Changed from: XPathContext xpathSupport = new XPathContext();
- // because XPathContext is weak in a number of areas... perhaps
- // XPathContext should be done away with.)
- // Create the XPath object.
- XPath xpath = new XPath(str, null, prefixResolver, XPath.SELECT, null);
-
- // Execute the XPath, and have it return the result
- XPathContext xpathSupport = new XPathContext();
- int ctxtNode = xpathSupport.getDTMHandleFromNode(contextNode);
-
- return xpath.execute(xpathSupport, ctxtNode, prefixResolver);
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/Expression.java b/src/com/sun/org/apache/xpath/internal/Expression.java
deleted file mode 100644
index a16d137..0000000
--- a/src/com/sun/org/apache/xpath/internal/Expression.java
+++ /dev/null
@@ -1,591 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Expression.java,v 1.2.4.2 2005/09/14 19:50:20 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal;
-
-import javax.xml.transform.ErrorListener;
-import javax.xml.transform.TransformerException;
-
-import com.sun.org.apache.xalan.internal.res.XSLMessages;
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMIterator;
-import com.sun.org.apache.xml.internal.utils.XMLString;
-import com.sun.org.apache.xpath.internal.objects.XNodeSet;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
-
-import org.xml.sax.ContentHandler;
-
-/**
- * This abstract class serves as the base for all expression objects. An
- * Expression can be executed to return a {@link com.sun.org.apache.xpath.internal.objects.XObject},
- * normally has a location within a document or DOM, can send error and warning
- * events, and normally do not hold state and are meant to be immutable once
- * construction has completed. An exception to the immutibility rule is iterators
- * and walkers, which must be cloned in order to be used -- the original must
- * still be immutable.
- */
-public abstract class Expression implements java.io.Serializable, ExpressionNode, XPathVisitable
-{
- static final long serialVersionUID = 565665869777906902L;
- /**
- * The location where this expression was built from. Need for diagnostic
- * messages. May be null.
- * @serial
- */
- private ExpressionNode m_parent;
-
- /**
- * Tell if this expression or it's subexpressions can traverse outside
- * the current subtree.
- *
- * @return true if traversal outside the context node's subtree can occur.
- */
- public boolean canTraverseOutsideSubtree()
- {
- return false;
- }
-
-// /**
-// * Set the location where this expression was built from.
-// *
-// *
-// * @param locator the location where this expression was built from, may be
-// * null.
-// */
-// public void setSourceLocator(SourceLocator locator)
-// {
-// m_slocator = locator;
-// }
-
- /**
- * Execute an expression in the XPath runtime context, and return the
- * result of the expression.
- *
- *
- * @param xctxt The XPath runtime context.
- * @param currentNode The currentNode.
- *
- * @return The result of the expression in the form of a <code>XObject</code>.
- *
- * @throws javax.xml.transform.TransformerException if a runtime exception
- * occurs.
- */
- public XObject execute(XPathContext xctxt, int currentNode)
- throws javax.xml.transform.TransformerException
- {
-
- // For now, the current node is already pushed.
- return execute(xctxt);
- }
-
- /**
- * Execute an expression in the XPath runtime context, and return the
- * result of the expression.
- *
- *
- * @param xctxt The XPath runtime context.
- * @param currentNode The currentNode.
- * @param dtm The DTM of the current node.
- * @param expType The expanded type ID of the current node.
- *
- * @return The result of the expression in the form of a <code>XObject</code>.
- *
- * @throws javax.xml.transform.TransformerException if a runtime exception
- * occurs.
- */
- public XObject execute(
- XPathContext xctxt, int currentNode, DTM dtm, int expType)
- throws javax.xml.transform.TransformerException
- {
-
- // For now, the current node is already pushed.
- return execute(xctxt);
- }
-
- /**
- * Execute an expression in the XPath runtime context, and return the
- * result of the expression.
- *
- *
- * @param xctxt The XPath runtime context.
- *
- * @return The result of the expression in the form of a <code>XObject</code>.
- *
- * @throws javax.xml.transform.TransformerException if a runtime exception
- * occurs.
- */
- public abstract XObject execute(XPathContext xctxt)
- throws javax.xml.transform.TransformerException;
-
- /**
- * Execute an expression in the XPath runtime context, and return the
- * result of the expression, but tell that a "safe" object doesn't have
- * to be returned. The default implementation just calls execute(xctxt).
- *
- *
- * @param xctxt The XPath runtime context.
- * @param destructiveOK true if a "safe" object doesn't need to be returned.
- *
- * @return The result of the expression in the form of a <code>XObject</code>.
- *
- * @throws javax.xml.transform.TransformerException if a runtime exception
- * occurs.
- */
- public XObject execute(XPathContext xctxt, boolean destructiveOK)
- throws javax.xml.transform.TransformerException
- {
- return execute(xctxt);
- }
-
-
- /**
- * Evaluate expression to a number.
- *
- *
- * @param xctxt The XPath runtime context.
- * @return The expression evaluated as a double.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public double num(XPathContext xctxt)
- throws javax.xml.transform.TransformerException
- {
- return execute(xctxt).num();
- }
-
- /**
- * Evaluate expression to a boolean.
- *
- *
- * @param xctxt The XPath runtime context.
- * @return false
- *
- * @throws javax.xml.transform.TransformerException
- */
- public boolean bool(XPathContext xctxt)
- throws javax.xml.transform.TransformerException
- {
- return execute(xctxt).bool();
- }
-
- /**
- * Cast result object to a string.
- *
- *
- * @param xctxt The XPath runtime context.
- * @return The string this wraps or the empty string if null
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XMLString xstr(XPathContext xctxt)
- throws javax.xml.transform.TransformerException
- {
- return execute(xctxt).xstr();
- }
-
- /**
- * Tell if the expression is a nodeset expression. In other words, tell
- * if you can execute {@link #asNode(XPathContext) asNode} without an exception.
- * @return true if the expression can be represented as a nodeset.
- */
- public boolean isNodesetExpr()
- {
- return false;
- }
-
- /**
- * Return the first node out of the nodeset, if this expression is
- * a nodeset expression.
- * @param xctxt The XPath runtime context.
- * @return the first node out of the nodeset, or DTM.NULL.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public int asNode(XPathContext xctxt)
- throws javax.xml.transform.TransformerException
- {
- DTMIterator iter = execute(xctxt).iter();
- return iter.nextNode();
- }
-
- /**
- * Given an select expression and a context, evaluate the XPath
- * and return the resulting iterator.
- *
- * @param xctxt The execution context.
- * @param contextNode The node that "." expresses.
- *
- *
- * @return A valid DTMIterator.
- * @throws TransformerException thrown if the active ProblemListener decides
- * the error condition is severe enough to halt processing.
- *
- * @throws javax.xml.transform.TransformerException
- * @xsl.usage experimental
- */
- public DTMIterator asIterator(XPathContext xctxt, int contextNode)
- throws javax.xml.transform.TransformerException
- {
-
- try
- {
- xctxt.pushCurrentNodeAndExpression(contextNode, contextNode);
-
- return execute(xctxt).iter();
- }
- finally
- {
- xctxt.popCurrentNodeAndExpression();
- }
- }
-
- /**
- * Given an select expression and a context, evaluate the XPath
- * and return the resulting iterator, but do not clone.
- *
- * @param xctxt The execution context.
- * @param contextNode The node that "." expresses.
- *
- *
- * @return A valid DTMIterator.
- * @throws TransformerException thrown if the active ProblemListener decides
- * the error condition is severe enough to halt processing.
- *
- * @throws javax.xml.transform.TransformerException
- * @xsl.usage experimental
- */
- public DTMIterator asIteratorRaw(XPathContext xctxt, int contextNode)
- throws javax.xml.transform.TransformerException
- {
-
- try
- {
- xctxt.pushCurrentNodeAndExpression(contextNode, contextNode);
-
- XNodeSet nodeset = (XNodeSet)execute(xctxt);
- return nodeset.iterRaw();
- }
- finally
- {
- xctxt.popCurrentNodeAndExpression();
- }
- }
-
-
- /**
- * Execute an expression in the XPath runtime context, and return the
- * result of the expression.
- *
- *
- * @param xctxt The XPath runtime context.
- * NEEDSDOC @param handler
- *
- * @return The result of the expression in the form of a <code>XObject</code>.
- *
- * @throws javax.xml.transform.TransformerException if a runtime exception
- * occurs.
- * @throws org.xml.sax.SAXException
- */
- public void executeCharsToContentHandler(
- XPathContext xctxt, ContentHandler handler)
- throws javax.xml.transform.TransformerException,
- org.xml.sax.SAXException
- {
-
- XObject obj = execute(xctxt);
-
- obj.dispatchCharactersEvents(handler);
- obj.detach();
- }
-
- /**
- * Tell if this expression returns a stable number that will not change during
- * iterations within the expression. This is used to determine if a proximity
- * position predicate can indicate that no more searching has to occur.
- *
- *
- * @return true if the expression represents a stable number.
- */
- public boolean isStableNumber()
- {
- return false;
- }
-
- /**
- * This function is used to fixup variables from QNames to stack frame
- * indexes at stylesheet build time.
- * @param vars List of QNames that correspond to variables. This list
- * should be searched backwards for the first qualified name that
- * corresponds to the variable reference qname. The position of the
- * QName in the vector from the start of the vector will be its position
- * in the stack frame (but variables above the globalsTop value will need
- * to be offset to the current stack frame).
- * NEEDSDOC @param globalsSize
- */
- public abstract void fixupVariables(java.util.Vector vars, int globalsSize);
-
- /**
- * Compare this object with another object and see
- * if they are equal, include the sub heararchy.
- *
- * @param expr Another expression object.
- * @return true if this objects class and the expr
- * object's class are the same, and the data contained
- * within both objects are considered equal.
- */
- public abstract boolean deepEquals(Expression expr);
-
- /**
- * This is a utility method to tell if the passed in
- * class is the same class as this. It is to be used by
- * the deepEquals method. I'm bottlenecking it here
- * because I'm not totally confident that comparing the
- * class objects is the best way to do this.
- * @return true of the passed in class is the exact same
- * class as this class.
- */
- protected final boolean isSameClass(Expression expr)
- {
- if(null == expr)
- return false;
-
- return (getClass() == expr.getClass());
- }
-
- /**
- * Warn the user of an problem.
- *
- * @param xctxt The XPath runtime context.
- * @param msg An error msgkey that corresponds to one of the conststants found
- * in {@link com.sun.org.apache.xpath.internal.res.XPATHErrorResources}, which is
- * a key for a format string.
- * @param args An array of arguments represented in the format string, which
- * may be null.
- *
- * @throws TransformerException if the current ErrorListoner determines to
- * throw an exception.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public void warn(XPathContext xctxt, String msg, Object[] args)
- throws javax.xml.transform.TransformerException
- {
-
- java.lang.String fmsg = XSLMessages.createXPATHWarning(msg, args);
-
- if (null != xctxt)
- {
- ErrorListener eh = xctxt.getErrorListener();
-
- // TO DO: Need to get stylesheet Locator from here.
- eh.warning(new TransformerException(fmsg, xctxt.getSAXLocator()));
- }
- }
-
- /**
- * Tell the user of an assertion error, and probably throw an
- * exception.
- *
- * @param b If false, a runtime exception will be thrown.
- * @param msg The assertion message, which should be informative.
- *
- * @throws RuntimeException if the b argument is false.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public void assertion(boolean b, java.lang.String msg)
- {
-
- if (!b)
- {
- java.lang.String fMsg = XSLMessages.createXPATHMessage(
- XPATHErrorResources.ER_INCORRECT_PROGRAMMER_ASSERTION,
- new Object[]{ msg });
-
- throw new RuntimeException(fMsg);
- }
- }
-
- /**
- * Tell the user of an error, and probably throw an
- * exception.
- *
- * @param xctxt The XPath runtime context.
- * @param msg An error msgkey that corresponds to one of the constants found
- * in {@link com.sun.org.apache.xpath.internal.res.XPATHErrorResources}, which is
- * a key for a format string.
- * @param args An array of arguments represented in the format string, which
- * may be null.
- *
- * @throws TransformerException if the current ErrorListoner determines to
- * throw an exception.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public void error(XPathContext xctxt, String msg, Object[] args)
- throws javax.xml.transform.TransformerException
- {
-
- java.lang.String fmsg = XSLMessages.createXPATHMessage(msg, args);
-
- if (null != xctxt)
- {
- ErrorListener eh = xctxt.getErrorListener();
- TransformerException te = new TransformerException(fmsg, this);
-
- eh.fatalError(te);
- }
- }
-
- /**
- * Get the first non-Expression parent of this node.
- * @return null or first ancestor that is not an Expression.
- */
- public ExpressionNode getExpressionOwner()
- {
- ExpressionNode parent = exprGetParent();
- while((null != parent) && (parent instanceof Expression))
- parent = parent.exprGetParent();
- return parent;
- }
-
- //=============== ExpressionNode methods ================
-
- /** This pair of methods are used to inform the node of its
- parent. */
- public void exprSetParent(ExpressionNode n)
- {
- assertion(n != this, "Can not parent an expression to itself!");
- m_parent = n;
- }
-
- public ExpressionNode exprGetParent()
- {
- return m_parent;
- }
-
- /** This method tells the node to add its argument to the node's
- list of children. */
- public void exprAddChild(ExpressionNode n, int i)
- {
- assertion(false, "exprAddChild method not implemented!");
- }
-
- /** This method returns a child node. The children are numbered
- from zero, left to right. */
- public ExpressionNode exprGetChild(int i)
- {
- return null;
- }
-
- /** Return the number of children the node has. */
- public int exprGetNumChildren()
- {
- return 0;
- }
-
- //=============== SourceLocator methods ================
-
- /**
- * Return the public identifier for the current document event.
- *
- * <p>The return value is the public identifier of the document
- * entity or of the external parsed entity in which the markup that
- * triggered the event appears.</p>
- *
- * @return A string containing the public identifier, or
- * null if none is available.
- * @see #getSystemId
- */
- public String getPublicId()
- {
- if(null == m_parent)
- return null;
- return m_parent.getPublicId();
- }
-
- /**
- * Return the system identifier for the current document event.
- *
- * <p>The return value is the system identifier of the document
- * entity or of the external parsed entity in which the markup that
- * triggered the event appears.</p>
- *
- * <p>If the system identifier is a URL, the parser must resolve it
- * fully before passing it to the application.</p>
- *
- * @return A string containing the system identifier, or null
- * if none is available.
- * @see #getPublicId
- */
- public String getSystemId()
- {
- if(null == m_parent)
- return null;
- return m_parent.getSystemId();
- }
-
- /**
- * Return the line number where the current document event ends.
- *
- * <p><strong>Warning:</strong> The return value from the method
- * is intended only as an approximation for the sake of error
- * reporting; it is not intended to provide sufficient information
- * to edit the character content of the original XML document.</p>
- *
- * <p>The return value is an approximation of the line number
- * in the document entity or external parsed entity where the
- * markup that triggered the event appears.</p>
- *
- * @return The line number, or -1 if none is available.
- * @see #getColumnNumber
- */
- public int getLineNumber()
- {
- if(null == m_parent)
- return 0;
- return m_parent.getLineNumber();
- }
-
- /**
- * Return the character position where the current document event ends.
- *
- * <p><strong>Warning:</strong> The return value from the method
- * is intended only as an approximation for the sake of error
- * reporting; it is not intended to provide sufficient information
- * to edit the character content of the original XML document.</p>
- *
- * <p>The return value is an approximation of the column number
- * in the document entity or external parsed entity where the
- * markup that triggered the event appears.</p>
- *
- * @return The column number, or -1 if none is available.
- * @see #getLineNumber
- */
- public int getColumnNumber()
- {
- if(null == m_parent)
- return 0;
- return m_parent.getColumnNumber();
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/ExpressionNode.java b/src/com/sun/org/apache/xpath/internal/ExpressionNode.java
deleted file mode 100644
index 591cc5e..0000000
--- a/src/com/sun/org/apache/xpath/internal/ExpressionNode.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ExpressionNode.java,v 1.1.2.1 2005/08/01 01:30:15 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal;
-
-import javax.xml.transform.SourceLocator;
-
-/**
- * A class that implements this interface can construct expressions,
- * give information about child and parent expressions,
- * and give the originating source information. A class that implements
- * this interface does not lay any claim to being directly executable.
- *
- * <p>Note: This interface should not be considered stable. Only exprSetParent
- * and exprGetParent can be counted on to work reliably. Work in progress.</p>
- */
-public interface ExpressionNode extends SourceLocator
-{
- /** This pair of methods are used to inform the node of its
- parent. */
- public void exprSetParent(ExpressionNode n);
- public ExpressionNode exprGetParent();
-
- /** This method tells the node to add its argument to the node's
- list of children. */
- public void exprAddChild(ExpressionNode n, int i);
-
- /** This method returns a child node. The children are numbered
- from zero, left to right. */
- public ExpressionNode exprGetChild(int i);
-
- /** Return the number of children the node has. */
- public int exprGetNumChildren();
-}
diff --git a/src/com/sun/org/apache/xpath/internal/ExpressionOwner.java b/src/com/sun/org/apache/xpath/internal/ExpressionOwner.java
deleted file mode 100644
index dfca47c..0000000
--- a/src/com/sun/org/apache/xpath/internal/ExpressionOwner.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ExpressionOwner.java,v 1.1.2.1 2005/08/01 01:30:12 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal;
-
-/**
- * Classes that implement this interface own an expression, which
- * can be rewritten.
- */
-public interface ExpressionOwner
-{
- /**
- * Get the raw Expression object that this class wraps.
- *
- * @return the raw Expression object, which should not normally be null.
- */
- public Expression getExpression();
-
- /**
- * Set the raw expression object for this object.
- *
- * @param exp the raw Expression object, which should not normally be null.
- */
- public void setExpression(Expression exp);
-
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/ExtensionsProvider.java b/src/com/sun/org/apache/xpath/internal/ExtensionsProvider.java
deleted file mode 100644
index b949385..0000000
--- a/src/com/sun/org/apache/xpath/internal/ExtensionsProvider.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ExtensionsProvider.java,v 1.1.2.1 2005/08/01 01:30:08 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal;
-
-import java.util.Vector;
-
-import com.sun.org.apache.xpath.internal.functions.FuncExtFunction;
-
-/**
- * Interface that XPath objects can call to obtain access to an
- * ExtensionsTable.
- *
- */
-public interface ExtensionsProvider
-{
- /**
- * Is the extension function available?
- */
-
- public boolean functionAvailable(String ns, String funcName)
- throws javax.xml.transform.TransformerException;
-
- /**
- * Is the extension element available?
- */
- public boolean elementAvailable(String ns, String elemName)
- throws javax.xml.transform.TransformerException;
-
- /**
- * Execute the extension function.
- */
- public Object extFunction(String ns, String funcName,
- Vector argVec, Object methodKey)
- throws javax.xml.transform.TransformerException;
-
- /**
- * Execute the extension function.
- */
- public Object extFunction(FuncExtFunction extFunction,
- Vector argVec)
- throws javax.xml.transform.TransformerException;
-}
diff --git a/src/com/sun/org/apache/xpath/internal/FoundIndex.java b/src/com/sun/org/apache/xpath/internal/FoundIndex.java
deleted file mode 100644
index a6f2a47..0000000
--- a/src/com/sun/org/apache/xpath/internal/FoundIndex.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FoundIndex.java,v 1.2.4.1 2005/09/14 19:50:20 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal;
-
-/**
- * Class to let us know when it's time to do
- * a search from the parent because of indexing.
- * @xsl.usage internal
- */
-public class FoundIndex extends RuntimeException
-{
- static final long serialVersionUID = -4643975335243078270L;
-
- /**
- * Constructor FoundIndex
- *
- */
- public FoundIndex(){}
-}
diff --git a/src/com/sun/org/apache/xpath/internal/NodeSet.java b/src/com/sun/org/apache/xpath/internal/NodeSet.java
deleted file mode 100644
index 3409e7f..0000000
--- a/src/com/sun/org/apache/xpath/internal/NodeSet.java
+++ /dev/null
@@ -1,1372 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: NodeSet.java,v 1.2.4.1 2005/09/10 17:39:49 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal;
-
-import com.sun.org.apache.xalan.internal.res.XSLMessages;
-import com.sun.org.apache.xml.internal.utils.DOM2Helper;
-import com.sun.org.apache.xpath.internal.axes.ContextNodeList;
-import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
-
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.traversal.NodeFilter;
-import org.w3c.dom.traversal.NodeIterator;
-
-
-/**
- * <p>The NodeSet class can act as either a NodeVector,
- * NodeList, or NodeIterator. However, in order for it to
- * act as a NodeVector or NodeList, it's required that
- * setShouldCacheNodes(true) be called before the first
- * nextNode() is called, in order that nodes can be added
- * as they are fetched. Derived classes that implement iterators
- * must override runTo(int index), in order that they may
- * run the iteration to the given index. </p>
- *
- * <p>Note that we directly implement the DOM's NodeIterator
- * interface. We do not emulate all the behavior of the
- * standard NodeIterator. In particular, we do not guarantee
- * to present a "live view" of the document ... but in XSLT,
- * the source document should never be mutated, so this should
- * never be an issue.</p>
- *
- * <p>Thought: Should NodeSet really implement NodeList and NodeIterator,
- * or should there be specific subclasses of it which do so? The
- * advantage of doing it all here is that all NodeSets will respond
- * to the same calls; the disadvantage is that some of them may return
- * less-than-enlightening results when you do so.</p>
- * @xsl.usage advanced
- */
-public class NodeSet
- implements NodeList, NodeIterator, Cloneable, ContextNodeList
-{
-
- /**
- * Create an empty nodelist.
- */
- public NodeSet()
- {
- m_blocksize = 32;
- m_mapSize = 0;
- }
-
- /**
- * Create an empty, using the given block size.
- *
- * @param blocksize Size of blocks to allocate
- */
- public NodeSet(int blocksize)
- {
- m_blocksize = blocksize;
- m_mapSize = 0;
- }
-
- /**
- * Create a NodeSet, and copy the members of the
- * given nodelist into it.
- *
- * @param nodelist List of Nodes to be made members of the new set.
- */
- public NodeSet(NodeList nodelist)
- {
-
- this(32);
-
- addNodes(nodelist);
- }
-
- /**
- * Create a NodeSet, and copy the members of the
- * given NodeSet into it.
- *
- * @param nodelist Set of Nodes to be made members of the new set.
- */
- public NodeSet(NodeSet nodelist)
- {
-
- this(32);
-
- addNodes((NodeIterator) nodelist);
- }
-
- /**
- * Create a NodeSet, and copy the members of the
- * given NodeIterator into it.
- *
- * @param ni Iterator which yields Nodes to be made members of the new set.
- */
- public NodeSet(NodeIterator ni)
- {
-
- this(32);
-
- addNodes(ni);
- }
-
- /**
- * Create a NodeSet which contains the given Node.
- *
- * @param node Single node to be added to the new set.
- */
- public NodeSet(Node node)
- {
-
- this(32);
-
- addNode(node);
- }
-
- /**
- * @return The root node of the Iterator, as specified when it was created.
- * For non-Iterator NodeSets, this will be null.
- */
- public Node getRoot()
- {
- return null;
- }
-
- /**
- * Get a cloned Iterator, and reset its state to the beginning of the
- * iteration.
- *
- * @return a new NodeSet of the same type, having the same state...
- * except that the reset() operation has been called.
- *
- * @throws CloneNotSupportedException if this subclass of NodeSet
- * does not support the clone() operation.
- */
- public NodeIterator cloneWithReset() throws CloneNotSupportedException
- {
-
- NodeSet clone = (NodeSet) clone();
-
- clone.reset();
-
- return clone;
- }
-
- /**
- * Reset the iterator. May have no effect on non-iterator Nodesets.
- */
- public void reset()
- {
- m_next = 0;
- }
-
- /**
- * This attribute determines which node types are presented via the
- * iterator. The available set of constants is defined in the
- * <code>NodeFilter</code> interface. For NodeSets, the mask has been
- * hardcoded to show all nodes except EntityReference nodes, which have
- * no equivalent in the XPath data model.
- *
- * @return integer used as a bit-array, containing flags defined in
- * the DOM's NodeFilter class. The value will be
- * <code>SHOW_ALL & ~SHOW_ENTITY_REFERENCE</code>, meaning that
- * only entity references are suppressed.
- */
- public int getWhatToShow()
- {
- return NodeFilter.SHOW_ALL & ~NodeFilter.SHOW_ENTITY_REFERENCE;
- }
-
- /**
- * The filter object used to screen nodes. Filters are applied to
- * further reduce (and restructure) the NodeIterator's view of the
- * document. In our case, we will be using hardcoded filters built
- * into our iterators... but getFilter() is part of the DOM's
- * NodeIterator interface, so we have to support it.
- *
- * @return null, which is slightly misleading. True, there is no
- * user-written filter object, but in fact we are doing some very
- * sophisticated custom filtering. A DOM purist might suggest
- * returning a placeholder object just to indicate that this is
- * not going to return all nodes selected by whatToShow.
- */
- public NodeFilter getFilter()
- {
- return null;
- }
-
- /**
- * The value of this flag determines whether the children of entity
- * reference nodes are visible to the iterator. If false, they will be
- * skipped over.
- * <br> To produce a view of the document that has entity references
- * expanded and does not expose the entity reference node itself, use the
- * whatToShow flags to hide the entity reference node and set
- * expandEntityReferences to true when creating the iterator. To produce
- * a view of the document that has entity reference nodes but no entity
- * expansion, use the whatToShow flags to show the entity reference node
- * and set expandEntityReferences to false.
- *
- * @return true for all iterators based on NodeSet, meaning that the
- * contents of EntityRefrence nodes may be returned (though whatToShow
- * says that the EntityReferences themselves are not shown.)
- */
- public boolean getExpandEntityReferences()
- {
- return true;
- }
-
- /**
- * Returns the next node in the set and advances the position of the
- * iterator in the set. After a NodeIterator is created, the first call
- * to nextNode() returns the first node in the set.
- * @return The next <code>Node</code> in the set being iterated over, or
- * <code>null</code> if there are no more members in that set.
- * @throws DOMException
- * INVALID_STATE_ERR: Raised if this method is called after the
- * <code>detach</code> method was invoked.
- */
- public Node nextNode() throws DOMException
- {
-
- if ((m_next) < this.size())
- {
- Node next = this.elementAt(m_next);
-
- m_next++;
-
- return next;
- }
- else
- return null;
- }
-
- /**
- * Returns the previous node in the set and moves the position of the
- * iterator backwards in the set.
- * @return The previous <code>Node</code> in the set being iterated over,
- * or<code>null</code> if there are no more members in that set.
- * @throws DOMException
- * INVALID_STATE_ERR: Raised if this method is called after the
- * <code>detach</code> method was invoked.
- * @throws RuntimeException thrown if this NodeSet is not of
- * a cached type, and hence doesn't know what the previous node was.
- */
- public Node previousNode() throws DOMException
- {
-
- if (!m_cacheNodes)
- throw new RuntimeException(
- XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_CANNOT_ITERATE, null)); //"This NodeSet can not iterate to a previous node!");
-
- if ((m_next - 1) > 0)
- {
- m_next--;
-
- return this.elementAt(m_next);
- }
- else
- return null;
- }
-
- /**
- * Detaches the iterator from the set which it iterated over, releasing
- * any computational resources and placing the iterator in the INVALID
- * state. After<code>detach</code> has been invoked, calls to
- * <code>nextNode</code> or<code>previousNode</code> will raise the
- * exception INVALID_STATE_ERR.
- * <p>
- * This operation is a no-op in NodeSet, and will not cause
- * INVALID_STATE_ERR to be raised by later operations.
- * </p>
- */
- public void detach(){}
-
- /**
- * Tells if this NodeSet is "fresh", in other words, if
- * the first nextNode() that is called will return the
- * first node in the set.
- *
- * @return true if nextNode() would return the first node in the set,
- * false if it would return a later one.
- */
- public boolean isFresh()
- {
- return (m_next == 0);
- }
-
- /**
- * If an index is requested, NodeSet will call this method
- * to run the iterator to the index. By default this sets
- * m_next to the index. If the index argument is -1, this
- * signals that the iterator should be run to the end.
- *
- * @param index Position to advance (or retreat) to, with
- * 0 requesting the reset ("fresh") position and -1 (or indeed
- * any out-of-bounds value) requesting the final position.
- * @throws RuntimeException thrown if this NodeSet is not
- * one of the types which supports indexing/counting.
- */
- public void runTo(int index)
- {
-
- if (!m_cacheNodes)
- throw new RuntimeException(
- XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_CANNOT_INDEX, null)); //"This NodeSet can not do indexing or counting functions!");
-
- if ((index >= 0) && (m_next < m_firstFree))
- m_next = index;
- else
- m_next = m_firstFree - 1;
- }
-
- /**
- * Returns the <code>index</code>th item in the collection. If
- * <code>index</code> is greater than or equal to the number of nodes in
- * the list, this returns <code>null</code>.
- *
- * TODO: What happens if index is out of range?
- *
- * @param index Index into the collection.
- * @return The node at the <code>index</code>th position in the
- * <code>NodeList</code>, or <code>null</code> if that is not a valid
- * index.
- */
- public Node item(int index)
- {
-
- runTo(index);
-
- return (Node) this.elementAt(index);
- }
-
- /**
- * The number of nodes in the list. The range of valid child node indices is
- * 0 to <code>length-1</code> inclusive. Note that this operation requires
- * finding all the matching nodes, which may defeat attempts to defer
- * that work.
- *
- * @return integer indicating how many nodes are represented by this list.
- */
- public int getLength()
- {
-
- runTo(-1);
-
- return this.size();
- }
-
- /**
- * Add a node to the NodeSet. Not all types of NodeSets support this
- * operation
- *
- * @param n Node to be added
- * @throws RuntimeException thrown if this NodeSet is not of
- * a mutable type.
- */
- public void addNode(Node n)
- {
-
- if (!m_mutable)
- throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");
-
- this.addElement(n);
- }
-
- /**
- * Insert a node at a given position.
- *
- * @param n Node to be added
- * @param pos Offset at which the node is to be inserted,
- * with 0 being the first position.
- * @throws RuntimeException thrown if this NodeSet is not of
- * a mutable type.
- */
- public void insertNode(Node n, int pos)
- {
-
- if (!m_mutable)
- throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");
-
- insertElementAt(n, pos);
- }
-
- /**
- * Remove a node.
- *
- * @param n Node to be added
- * @throws RuntimeException thrown if this NodeSet is not of
- * a mutable type.
- */
- public void removeNode(Node n)
- {
-
- if (!m_mutable)
- throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");
-
- this.removeElement(n);
- }
-
- /**
- * Copy NodeList members into this nodelist, adding in
- * document order. If a node is null, don't add it.
- *
- * @param nodelist List of nodes which should now be referenced by
- * this NodeSet.
- * @throws RuntimeException thrown if this NodeSet is not of
- * a mutable type.
- */
- public void addNodes(NodeList nodelist)
- {
-
- if (!m_mutable)
- throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");
-
- if (null != nodelist) // defensive to fix a bug that Sanjiva reported.
- {
- int nChildren = nodelist.getLength();
-
- for (int i = 0; i < nChildren; i++)
- {
- Node obj = nodelist.item(i);
-
- if (null != obj)
- {
- addElement(obj);
- }
- }
- }
-
- // checkDups();
- }
-
- /**
- * <p>Copy NodeList members into this nodelist, adding in
- * document order. Only genuine node references will be copied;
- * nulls appearing in the source NodeSet will
- * not be added to this one. </p>
- *
- * <p> In case you're wondering why this function is needed: NodeSet
- * implements both NodeIterator and NodeList. If this method isn't
- * provided, Java can't decide which of those to use when addNodes()
- * is invoked. Providing the more-explicit match avoids that
- * ambiguity.)</p>
- *
- * @param ns NodeSet whose members should be merged into this NodeSet.
- * @throws RuntimeException thrown if this NodeSet is not of
- * a mutable type.
- */
- public void addNodes(NodeSet ns)
- {
-
- if (!m_mutable)
- throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");
-
- addNodes((NodeIterator) ns);
- }
-
- /**
- * Copy NodeList members into this nodelist, adding in
- * document order. Null references are not added.
- *
- * @param iterator NodeIterator which yields the nodes to be added.
- * @throws RuntimeException thrown if this NodeSet is not of
- * a mutable type.
- */
- public void addNodes(NodeIterator iterator)
- {
-
- if (!m_mutable)
- throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");
-
- if (null != iterator) // defensive to fix a bug that Sanjiva reported.
- {
- Node obj;
-
- while (null != (obj = iterator.nextNode()))
- {
- addElement(obj);
- }
- }
-
- // checkDups();
- }
-
- /**
- * Copy NodeList members into this nodelist, adding in
- * document order. If a node is null, don't add it.
- *
- * @param nodelist List of nodes to be added
- * @param support The XPath runtime context.
- * @throws RuntimeException thrown if this NodeSet is not of
- * a mutable type.
- */
- public void addNodesInDocOrder(NodeList nodelist, XPathContext support)
- {
-
- if (!m_mutable)
- throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");
-
- int nChildren = nodelist.getLength();
-
- for (int i = 0; i < nChildren; i++)
- {
- Node node = nodelist.item(i);
-
- if (null != node)
- {
- addNodeInDocOrder(node, support);
- }
- }
- }
-
- /**
- * Copy NodeList members into this nodelist, adding in
- * document order. If a node is null, don't add it.
- *
- * @param iterator NodeIterator which yields the nodes to be added.
- * @param support The XPath runtime context.
- * @throws RuntimeException thrown if this NodeSet is not of
- * a mutable type.
- */
- public void addNodesInDocOrder(NodeIterator iterator, XPathContext support)
- {
-
- if (!m_mutable)
- throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");
-
- Node node;
-
- while (null != (node = iterator.nextNode()))
- {
- addNodeInDocOrder(node, support);
- }
- }
-
- /**
- * Add the node list to this node set in document order.
- *
- * @param start index.
- * @param end index.
- * @param testIndex index.
- * @param nodelist The nodelist to add.
- * @param support The XPath runtime context.
- *
- * @return false always.
- * @throws RuntimeException thrown if this NodeSet is not of
- * a mutable type.
- */
- private boolean addNodesInDocOrder(int start, int end, int testIndex,
- NodeList nodelist, XPathContext support)
- {
-
- if (!m_mutable)
- throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");
-
- boolean foundit = false;
- int i;
- Node node = nodelist.item(testIndex);
-
- for (i = end; i >= start; i--)
- {
- Node child = (Node) elementAt(i);
-
- if (child == node)
- {
- i = -2; // Duplicate, suppress insert
-
- break;
- }
-
- if (!DOM2Helper.isNodeAfter(node, child))
- {
- insertElementAt(node, i + 1);
-
- testIndex--;
-
- if (testIndex > 0)
- {
- boolean foundPrev = addNodesInDocOrder(0, i, testIndex, nodelist,
- support);
-
- if (!foundPrev)
- {
- addNodesInDocOrder(i, size() - 1, testIndex, nodelist, support);
- }
- }
-
- break;
- }
- }
-
- if (i == -1)
- {
- insertElementAt(node, 0);
- }
-
- return foundit;
- }
-
- /**
- * Add the node into a vector of nodes where it should occur in
- * document order.
- * @param node The node to be added.
- * @param test true if we should test for doc order
- * @param support The XPath runtime context.
- * @return insertIndex.
- * @throws RuntimeException thrown if this NodeSet is not of
- * a mutable type.
- */
- public int addNodeInDocOrder(Node node, boolean test, XPathContext support)
- {
-
- if (!m_mutable)
- throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");
-
- int insertIndex = -1;
-
- if (test)
- {
-
- // This needs to do a binary search, but a binary search
- // is somewhat tough because the sequence test involves
- // two nodes.
- int size = size(), i;
-
- for (i = size - 1; i >= 0; i--)
- {
- Node child = (Node) elementAt(i);
-
- if (child == node)
- {
- i = -2; // Duplicate, suppress insert
-
- break;
- }
-
- if (!DOM2Helper.isNodeAfter(node, child))
- {
- break;
- }
- }
-
- if (i != -2)
- {
- insertIndex = i + 1;
-
- insertElementAt(node, insertIndex);
- }
- }
- else
- {
- insertIndex = this.size();
-
- boolean foundit = false;
-
- for (int i = 0; i < insertIndex; i++)
- {
- if (this.item(i).equals(node))
- {
- foundit = true;
-
- break;
- }
- }
-
- if (!foundit)
- addElement(node);
- }
-
- // checkDups();
- return insertIndex;
- } // end addNodeInDocOrder(Vector v, Object obj)
-
- /**
- * Add the node into a vector of nodes where it should occur in
- * document order.
- * @param node The node to be added.
- * @param support The XPath runtime context.
- *
- * @return The index where it was inserted.
- * @throws RuntimeException thrown if this NodeSet is not of
- * a mutable type.
- */
- public int addNodeInDocOrder(Node node, XPathContext support)
- {
-
- if (!m_mutable)
- throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");
-
- return addNodeInDocOrder(node, true, support);
- } // end addNodeInDocOrder(Vector v, Object obj)
-
-
- /** If this node is being used as an iterator, the next index that nextNode()
- * will return. */
- transient protected int m_next = 0;
-
- /**
- * Get the current position, which is one less than
- * the next nextNode() call will retrieve. i.e. if
- * you call getCurrentPos() and the return is 0, the next
- * fetch will take place at index 1.
- *
- * @return The the current position index.
- */
- public int getCurrentPos()
- {
- return m_next;
- }
-
- /**
- * Set the current position in the node set.
- * @param i Must be a valid index.
- * @throws RuntimeException thrown if this NodeSet is not of
- * a cached type, and thus doesn't permit indexed access.
- */
- public void setCurrentPos(int i)
- {
-
- if (!m_cacheNodes)
- throw new RuntimeException(
- XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_CANNOT_INDEX, null)); //"This NodeSet can not do indexing or counting functions!");
-
- m_next = i;
- }
-
- /**
- * Return the last fetched node. Needed to support the UnionPathIterator.
- *
- * @return the last fetched node.
- * @throws RuntimeException thrown if this NodeSet is not of
- * a cached type, and thus doesn't permit indexed access.
- */
- public Node getCurrentNode()
- {
-
- if (!m_cacheNodes)
- throw new RuntimeException(
- XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_CANNOT_INDEX, null)); //"This NodeSet can not do indexing or counting functions!");
-
- int saved = m_next;
- Node n = (m_next < m_firstFree) ? elementAt(m_next) : null;
- m_next = saved; // HACK: I think this is a bit of a hack. -sb
- return n;
- }
-
- /** True if this list can be mutated. */
- transient protected boolean m_mutable = true;
-
- /** True if this list is cached.
- * @serial */
- transient protected boolean m_cacheNodes = true;
-
- /**
- * Get whether or not this is a cached node set.
- *
- *
- * @return True if this list is cached.
- */
- public boolean getShouldCacheNodes()
- {
- return m_cacheNodes;
- }
-
- /**
- * If setShouldCacheNodes(true) is called, then nodes will
- * be cached. They are not cached by default. This switch must
- * be set before the first call to nextNode is made, to ensure
- * that all nodes are cached.
- *
- * @param b true if this node set should be cached.
- * @throws RuntimeException thrown if an attempt is made to
- * request caching after we've already begun stepping through the
- * nodes in this set.
- */
- public void setShouldCacheNodes(boolean b)
- {
-
- if (!isFresh())
- throw new RuntimeException(
- XSLMessages.createXPATHMessage(XPATHErrorResources.ER_CANNOT_CALL_SETSHOULDCACHENODE, null)); //"Can not call setShouldCacheNodes after nextNode has been called!");
-
- m_cacheNodes = b;
- m_mutable = true;
- }
-
-
- transient private int m_last = 0;
-
- public int getLast()
- {
- return m_last;
- }
-
- public void setLast(int last)
- {
- m_last = last;
- }
-
- /** Size of blocks to allocate.
- * @serial */
- private int m_blocksize;
-
- /** Array of nodes this points to.
- * @serial */
- Node m_map[];
-
- /** Number of nodes in this NodeVector.
- * @serial */
- protected int m_firstFree = 0;
-
- /** Size of the array this points to.
- * @serial */
- private int m_mapSize; // lazy initialization
-
- /**
- * Get a cloned LocPathIterator.
- *
- * @return A clone of this
- *
- * @throws CloneNotSupportedException
- */
- public Object clone() throws CloneNotSupportedException
- {
-
- NodeSet clone = (NodeSet) super.clone();
-
- if ((null != this.m_map) && (this.m_map == clone.m_map))
- {
- clone.m_map = new Node[this.m_map.length];
-
- System.arraycopy(this.m_map, 0, clone.m_map, 0, this.m_map.length);
- }
-
- return clone;
- }
-
- /**
- * Get the length of the list.
- *
- * @return Number of nodes in this NodeVector
- */
- public int size()
- {
- return m_firstFree;
- }
-
- /**
- * Append a Node onto the vector.
- *
- * @param value Node to add to the vector
- */
- public void addElement(Node value)
- {
- if (!m_mutable)
- throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");
-
- if ((m_firstFree + 1) >= m_mapSize)
- {
- if (null == m_map)
- {
- m_map = new Node[m_blocksize];
- m_mapSize = m_blocksize;
- }
- else
- {
- m_mapSize += m_blocksize;
-
- Node newMap[] = new Node[m_mapSize];
-
- System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);
-
- m_map = newMap;
- }
- }
-
- m_map[m_firstFree] = value;
-
- m_firstFree++;
- }
-
- /**
- * Append a Node onto the vector.
- *
- * @param value Node to add to the vector
- */
- public final void push(Node value)
- {
-
- int ff = m_firstFree;
-
- if ((ff + 1) >= m_mapSize)
- {
- if (null == m_map)
- {
- m_map = new Node[m_blocksize];
- m_mapSize = m_blocksize;
- }
- else
- {
- m_mapSize += m_blocksize;
-
- Node newMap[] = new Node[m_mapSize];
-
- System.arraycopy(m_map, 0, newMap, 0, ff + 1);
-
- m_map = newMap;
- }
- }
-
- m_map[ff] = value;
-
- ff++;
-
- m_firstFree = ff;
- }
-
- /**
- * Pop a node from the tail of the vector and return the result.
- *
- * @return the node at the tail of the vector
- */
- public final Node pop()
- {
-
- m_firstFree--;
-
- Node n = m_map[m_firstFree];
-
- m_map[m_firstFree] = null;
-
- return n;
- }
-
- /**
- * Pop a node from the tail of the vector and return the
- * top of the stack after the pop.
- *
- * @return The top of the stack after it's been popped
- */
- public final Node popAndTop()
- {
-
- m_firstFree--;
-
- m_map[m_firstFree] = null;
-
- return (m_firstFree == 0) ? null : m_map[m_firstFree - 1];
- }
-
- /**
- * Pop a node from the tail of the vector.
- */
- public final void popQuick()
- {
-
- m_firstFree--;
-
- m_map[m_firstFree] = null;
- }
-
- /**
- * Return the node at the top of the stack without popping the stack.
- * Special purpose method for TransformerImpl, pushElemTemplateElement.
- * Performance critical.
- *
- * @return Node at the top of the stack or null if stack is empty.
- */
- public final Node peepOrNull()
- {
- return ((null != m_map) && (m_firstFree > 0))
- ? m_map[m_firstFree - 1] : null;
- }
-
- /**
- * Push a pair of nodes into the stack.
- * Special purpose method for TransformerImpl, pushElemTemplateElement.
- * Performance critical.
- *
- * @param v1 First node to add to vector
- * @param v2 Second node to add to vector
- */
- public final void pushPair(Node v1, Node v2)
- {
-
- if (null == m_map)
- {
- m_map = new Node[m_blocksize];
- m_mapSize = m_blocksize;
- }
- else
- {
- if ((m_firstFree + 2) >= m_mapSize)
- {
- m_mapSize += m_blocksize;
-
- Node newMap[] = new Node[m_mapSize];
-
- System.arraycopy(m_map, 0, newMap, 0, m_firstFree);
-
- m_map = newMap;
- }
- }
-
- m_map[m_firstFree] = v1;
- m_map[m_firstFree + 1] = v2;
- m_firstFree += 2;
- }
-
- /**
- * Pop a pair of nodes from the tail of the stack.
- * Special purpose method for TransformerImpl, pushElemTemplateElement.
- * Performance critical.
- */
- public final void popPair()
- {
-
- m_firstFree -= 2;
- m_map[m_firstFree] = null;
- m_map[m_firstFree + 1] = null;
- }
-
- /**
- * Set the tail of the stack to the given node.
- * Special purpose method for TransformerImpl, pushElemTemplateElement.
- * Performance critical.
- *
- * @param n Node to set at the tail of vector
- */
- public final void setTail(Node n)
- {
- m_map[m_firstFree - 1] = n;
- }
-
- /**
- * Set the given node one position from the tail.
- * Special purpose method for TransformerImpl, pushElemTemplateElement.
- * Performance critical.
- *
- * @param n Node to set
- */
- public final void setTailSub1(Node n)
- {
- m_map[m_firstFree - 2] = n;
- }
-
- /**
- * Return the node at the tail of the vector without popping
- * Special purpose method for TransformerImpl, pushElemTemplateElement.
- * Performance critical.
- *
- * @return Node at the tail of the vector
- */
- public final Node peepTail()
- {
- return m_map[m_firstFree - 1];
- }
-
- /**
- * Return the node one position from the tail without popping.
- * Special purpose method for TransformerImpl, pushElemTemplateElement.
- * Performance critical.
- *
- * @return Node one away from the tail
- */
- public final Node peepTailSub1()
- {
- return m_map[m_firstFree - 2];
- }
-
- /**
- * Inserts the specified node in this vector at the specified index.
- * Each component in this vector with an index greater or equal to
- * the specified index is shifted upward to have an index one greater
- * than the value it had previously.
- *
- * @param value Node to insert
- * @param at Position where to insert
- */
- public void insertElementAt(Node value, int at)
- {
- if (!m_mutable)
- throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");
-
- if (null == m_map)
- {
- m_map = new Node[m_blocksize];
- m_mapSize = m_blocksize;
- }
- else if ((m_firstFree + 1) >= m_mapSize)
- {
- m_mapSize += m_blocksize;
-
- Node newMap[] = new Node[m_mapSize];
-
- System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);
-
- m_map = newMap;
- }
-
- if (at <= (m_firstFree - 1))
- {
- System.arraycopy(m_map, at, m_map, at + 1, m_firstFree - at);
- }
-
- m_map[at] = value;
-
- m_firstFree++;
- }
-
- /**
- * Append the nodes to the list.
- *
- * @param nodes NodeVector to append to this list
- */
- public void appendNodes(NodeSet nodes)
- {
-
- int nNodes = nodes.size();
-
- if (null == m_map)
- {
- m_mapSize = nNodes + m_blocksize;
- m_map = new Node[m_mapSize];
- }
- else if ((m_firstFree + nNodes) >= m_mapSize)
- {
- m_mapSize += (nNodes + m_blocksize);
-
- Node newMap[] = new Node[m_mapSize];
-
- System.arraycopy(m_map, 0, newMap, 0, m_firstFree + nNodes);
-
- m_map = newMap;
- }
-
- System.arraycopy(nodes.m_map, 0, m_map, m_firstFree, nNodes);
-
- m_firstFree += nNodes;
- }
-
- /**
- * Inserts the specified node in this vector at the specified index.
- * Each component in this vector with an index greater or equal to
- * the specified index is shifted upward to have an index one greater
- * than the value it had previously.
- */
- public void removeAllElements()
- {
-
- if (null == m_map)
- return;
-
- for (int i = 0; i < m_firstFree; i++)
- {
- m_map[i] = null;
- }
-
- m_firstFree = 0;
- }
-
- /**
- * Removes the first occurrence of the argument from this vector.
- * If the object is found in this vector, each component in the vector
- * with an index greater or equal to the object's index is shifted
- * downward to have an index one smaller than the value it had
- * previously.
- *
- * @param s Node to remove from the list
- *
- * @return True if the node was successfully removed
- */
- public boolean removeElement(Node s)
- {
- if (!m_mutable)
- throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");
-
- if (null == m_map)
- return false;
-
- for (int i = 0; i < m_firstFree; i++)
- {
- Node node = m_map[i];
-
- if ((null != node) && node.equals(s))
- {
- if (i < m_firstFree - 1)
- System.arraycopy(m_map, i + 1, m_map, i, m_firstFree - i - 1);
-
- m_firstFree--;
- m_map[m_firstFree] = null;
-
- return true;
- }
- }
-
- return false;
- }
-
- /**
- * Deletes the component at the specified index. Each component in
- * this vector with an index greater or equal to the specified
- * index is shifted downward to have an index one smaller than
- * the value it had previously.
- *
- * @param i Index of node to remove
- */
- public void removeElementAt(int i)
- {
-
- if (null == m_map)
- return;
-
- if (i >= m_firstFree)
- throw new ArrayIndexOutOfBoundsException(i + " >= " + m_firstFree);
- else if (i < 0)
- throw new ArrayIndexOutOfBoundsException(i);
-
- if (i < m_firstFree - 1)
- System.arraycopy(m_map, i + 1, m_map, i, m_firstFree - i - 1);
-
- m_firstFree--;
- m_map[m_firstFree] = null;
- }
-
- /**
- * Sets the component at the specified index of this vector to be the
- * specified object. The previous component at that position is discarded.
- *
- * The index must be a value greater than or equal to 0 and less
- * than the current size of the vector.
- *
- * @param node Node to set
- * @param index Index of where to set the node
- */
- public void setElementAt(Node node, int index)
- {
- if (!m_mutable)
- throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");
-
- if (null == m_map)
- {
- m_map = new Node[m_blocksize];
- m_mapSize = m_blocksize;
- }
-
- m_map[index] = node;
- }
-
- /**
- * Get the nth element.
- *
- * @param i Index of node to get
- *
- * @return Node at specified index
- */
- public Node elementAt(int i)
- {
-
- if (null == m_map)
- return null;
-
- return m_map[i];
- }
-
- /**
- * Tell if the table contains the given node.
- *
- * @param s Node to look for
- *
- * @return True if the given node was found.
- */
- public boolean contains(Node s)
- {
- runTo(-1);
-
- if (null == m_map)
- return false;
-
- for (int i = 0; i < m_firstFree; i++)
- {
- Node node = m_map[i];
-
- if ((null != node) && node.equals(s))
- return true;
- }
-
- return false;
- }
-
- /**
- * Searches for the first occurence of the given argument,
- * beginning the search at index, and testing for equality
- * using the equals method.
- *
- * @param elem Node to look for
- * @param index Index of where to start the search
- * @return the index of the first occurrence of the object
- * argument in this vector at position index or later in the
- * vector; returns -1 if the object is not found.
- */
- public int indexOf(Node elem, int index)
- {
- runTo(-1);
-
- if (null == m_map)
- return -1;
-
- for (int i = index; i < m_firstFree; i++)
- {
- Node node = m_map[i];
-
- if ((null != node) && node.equals(elem))
- return i;
- }
-
- return -1;
- }
-
- /**
- * Searches for the first occurence of the given argument,
- * beginning the search at index, and testing for equality
- * using the equals method.
- *
- * @param elem Node to look for
- * @return the index of the first occurrence of the object
- * argument in this vector at position index or later in the
- * vector; returns -1 if the object is not found.
- */
- public int indexOf(Node elem)
- {
- runTo(-1);
-
- if (null == m_map)
- return -1;
-
- for (int i = 0; i < m_firstFree; i++)
- {
- Node node = m_map[i];
-
- if ((null != node) && node.equals(elem))
- return i;
- }
-
- return -1;
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/NodeSetDTM.java b/src/com/sun/org/apache/xpath/internal/NodeSetDTM.java
deleted file mode 100644
index cc987d8..0000000
--- a/src/com/sun/org/apache/xpath/internal/NodeSetDTM.java
+++ /dev/null
@@ -1,1249 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: NodeSetDTM.java,v 1.2.4.2 2005/09/14 20:30:06 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal;
-
-import com.sun.org.apache.xalan.internal.res.XSLMessages;
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMFilter;
-import com.sun.org.apache.xml.internal.dtm.DTMIterator;
-import com.sun.org.apache.xml.internal.dtm.DTMManager;
-import com.sun.org.apache.xml.internal.utils.NodeVector;
-import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.traversal.NodeIterator;
-
-
-/**
- * <p>The NodeSetDTM class can act as either a NodeVector,
- * NodeList, or NodeIterator. However, in order for it to
- * act as a NodeVector or NodeList, it's required that
- * setShouldCacheNodes(true) be called before the first
- * nextNode() is called, in order that nodes can be added
- * as they are fetched. Derived classes that implement iterators
- * must override runTo(int index), in order that they may
- * run the iteration to the given index. </p>
- *
- * <p>Note that we directly implement the DOM's NodeIterator
- * interface. We do not emulate all the behavior of the
- * standard NodeIterator. In particular, we do not guarantee
- * to present a "live view" of the document ... but in XSLT,
- * the source document should never be mutated, so this should
- * never be an issue.</p>
- *
- * <p>Thought: Should NodeSetDTM really implement NodeList and NodeIterator,
- * or should there be specific subclasses of it which do so? The
- * advantage of doing it all here is that all NodeSetDTMs will respond
- * to the same calls; the disadvantage is that some of them may return
- * less-than-enlightening results when you do so.</p>
- * @xsl.usage advanced
- */
-public class NodeSetDTM extends NodeVector
- implements /* NodeList, NodeIterator, */ DTMIterator,
- Cloneable
-{
- static final long serialVersionUID = 7686480133331317070L;
-
- /**
- * Create an empty nodelist.
- */
- public NodeSetDTM(DTMManager dtmManager)
- {
- super();
- m_manager = dtmManager;
- }
-
- /**
- * Create an empty, using the given block size.
- *
- * @param blocksize Size of blocks to allocate
- * @param dummy pass zero for right now...
- */
- public NodeSetDTM(int blocksize, int dummy, DTMManager dtmManager)
- {
- super(blocksize);
- m_manager = dtmManager;
- }
-
- // %TBD%
-// /**
-// * Create a NodeSetDTM, and copy the members of the
-// * given nodelist into it.
-// *
-// * @param nodelist List of Nodes to be made members of the new set.
-// */
-// public NodeSetDTM(NodeList nodelist)
-// {
-//
-// super();
-//
-// addNodes(nodelist);
-// }
-
- /**
- * Create a NodeSetDTM, and copy the members of the
- * given NodeSetDTM into it.
- *
- * @param nodelist Set of Nodes to be made members of the new set.
- */
- public NodeSetDTM(NodeSetDTM nodelist)
- {
-
- super();
- m_manager = nodelist.getDTMManager();
- m_root = nodelist.getRoot();
-
- addNodes((DTMIterator) nodelist);
- }
-
- /**
- * Create a NodeSetDTM, and copy the members of the
- * given DTMIterator into it.
- *
- * @param ni Iterator which yields Nodes to be made members of the new set.
- */
- public NodeSetDTM(DTMIterator ni)
- {
-
- super();
-
- m_manager = ni.getDTMManager();
- m_root = ni.getRoot();
- addNodes(ni);
- }
-
- /**
- * Create a NodeSetDTM, and copy the members of the
- * given DTMIterator into it.
- *
- * @param iterator Iterator which yields Nodes to be made members of the new set.
- */
- public NodeSetDTM(NodeIterator iterator, XPathContext xctxt)
- {
-
- super();
-
- Node node;
- m_manager = xctxt.getDTMManager();
-
- while (null != (node = iterator.nextNode()))
- {
- int handle = xctxt.getDTMHandleFromNode(node);
- addNodeInDocOrder(handle, xctxt);
- }
- }
-
- /**
- * Create a NodeSetDTM, and copy the members of the
- * given DTMIterator into it.
- *
- */
- public NodeSetDTM(NodeList nodeList, XPathContext xctxt)
- {
-
- super();
-
- m_manager = xctxt.getDTMManager();
-
- int n = nodeList.getLength();
- for (int i = 0; i < n; i++)
- {
- Node node = nodeList.item(i);
- int handle = xctxt.getDTMHandleFromNode(node);
- // Do not reorder or strip duplicate nodes from the given DOM nodelist
- addNode(handle); // addNodeInDocOrder(handle, xctxt);
- }
- }
-
-
- /**
- * Create a NodeSetDTM which contains the given Node.
- *
- * @param node Single node to be added to the new set.
- */
- public NodeSetDTM(int node, DTMManager dtmManager)
- {
-
- super();
- m_manager = dtmManager;
-
- addNode(node);
- }
-
- /**
- * Set the environment in which this iterator operates, which should provide:
- * a node (the context node... same value as "root" defined below)
- * a pair of non-zero positive integers (the context position and the context size)
- * a set of variable bindings
- * a function library
- * the set of namespace declarations in scope for the expression.
- *
- * <p>At this time the exact implementation of this environment is application
- * dependent. Probably a proper interface will be created fairly soon.</p>
- *
- * @param environment The environment object.
- */
- public void setEnvironment(Object environment)
- {
- // no-op
- }
-
-
- /**
- * @return The root node of the Iterator, as specified when it was created.
- * For non-Iterator NodeSetDTMs, this will be null.
- */
- public int getRoot()
- {
- if(DTM.NULL == m_root)
- {
- if(size() > 0)
- return item(0);
- else
- return DTM.NULL;
- }
- else
- return m_root;
- }
-
- /**
- * Initialize the context values for this expression
- * after it is cloned.
- *
- * @param context The XPath runtime context for this
- * transformation.
- */
- public void setRoot(int context, Object environment)
- {
- // no-op, I guess... (-sb)
- }
-
- /**
- * Clone this NodeSetDTM.
- * At this time, we only expect this to be used with LocPathIterators;
- * it may not work with other kinds of NodeSetDTMs.
- *
- * @return a new NodeSetDTM of the same type, having the same state...
- * though unless overridden in the subclasses, it may not copy all
- * the state information.
- *
- * @throws CloneNotSupportedException if this subclass of NodeSetDTM
- * does not support the clone() operation.
- */
- public Object clone() throws CloneNotSupportedException
- {
-
- NodeSetDTM clone = (NodeSetDTM) super.clone();
-
- return clone;
- }
-
- /**
- * Get a cloned Iterator, and reset its state to the beginning of the
- * iteration.
- *
- * @return a new NodeSetDTM of the same type, having the same state...
- * except that the reset() operation has been called.
- *
- * @throws CloneNotSupportedException if this subclass of NodeSetDTM
- * does not support the clone() operation.
- */
- public DTMIterator cloneWithReset() throws CloneNotSupportedException
- {
-
- NodeSetDTM clone = (NodeSetDTM) clone();
-
- clone.reset();
-
- return clone;
- }
-
- /**
- * Reset the iterator. May have no effect on non-iterator Nodesets.
- */
- public void reset()
- {
- m_next = 0;
- }
-
- /**
- * This attribute determines which node types are presented via the
- * iterator. The available set of constants is defined in the
- * <code>DTMFilter</code> interface. For NodeSetDTMs, the mask has been
- * hardcoded to show all nodes except EntityReference nodes, which have
- * no equivalent in the XPath data model.
- *
- * @return integer used as a bit-array, containing flags defined in
- * the DOM's DTMFilter class. The value will be
- * <code>SHOW_ALL & ~SHOW_ENTITY_REFERENCE</code>, meaning that
- * only entity references are suppressed.
- */
- public int getWhatToShow()
- {
- return DTMFilter.SHOW_ALL & ~DTMFilter.SHOW_ENTITY_REFERENCE;
- }
-
- /**
- * The filter object used to screen nodes. Filters are applied to
- * further reduce (and restructure) the DTMIterator's view of the
- * document. In our case, we will be using hardcoded filters built
- * into our iterators... but getFilter() is part of the DOM's
- * DTMIterator interface, so we have to support it.
- *
- * @return null, which is slightly misleading. True, there is no
- * user-written filter object, but in fact we are doing some very
- * sophisticated custom filtering. A DOM purist might suggest
- * returning a placeholder object just to indicate that this is
- * not going to return all nodes selected by whatToShow.
- */
- public DTMFilter getFilter()
- {
- return null;
- }
-
- /**
- * The value of this flag determines whether the children of entity
- * reference nodes are visible to the iterator. If false, they will be
- * skipped over.
- * <br> To produce a view of the document that has entity references
- * expanded and does not expose the entity reference node itself, use the
- * whatToShow flags to hide the entity reference node and set
- * expandEntityReferences to true when creating the iterator. To produce
- * a view of the document that has entity reference nodes but no entity
- * expansion, use the whatToShow flags to show the entity reference node
- * and set expandEntityReferences to false.
- *
- * @return true for all iterators based on NodeSetDTM, meaning that the
- * contents of EntityRefrence nodes may be returned (though whatToShow
- * says that the EntityReferences themselves are not shown.)
- */
- public boolean getExpandEntityReferences()
- {
- return true;
- }
-
- /**
- * Get an instance of a DTM that "owns" a node handle. Since a node
- * iterator may be passed without a DTMManager, this allows the
- * caller to easily get the DTM using just the iterator.
- *
- * @param nodeHandle the nodeHandle.
- *
- * @return a non-null DTM reference.
- */
- public DTM getDTM(int nodeHandle)
- {
-
- return m_manager.getDTM(nodeHandle);
- }
-
- /* An instance of the DTMManager. */
- DTMManager m_manager;
-
- /**
- * Get an instance of the DTMManager. Since a node
- * iterator may be passed without a DTMManager, this allows the
- * caller to easily get the DTMManager using just the iterator.
- *
- * @return a non-null DTMManager reference.
- */
- public DTMManager getDTMManager()
- {
-
- return m_manager;
- }
-
- /**
- * Returns the next node in the set and advances the position of the
- * iterator in the set. After a DTMIterator is created, the first call
- * to nextNode() returns the first node in the set.
- * @return The next <code>Node</code> in the set being iterated over, or
- * <code>DTM.NULL</code> if there are no more members in that set.
- * @throws DOMException
- * INVALID_STATE_ERR: Raised if this method is called after the
- * <code>detach</code> method was invoked.
- */
- public int nextNode()
- {
-
- if ((m_next) < this.size())
- {
- int next = this.elementAt(m_next);
-
- m_next++;
-
- return next;
- }
- else
- return DTM.NULL;
- }
-
- /**
- * Returns the previous node in the set and moves the position of the
- * iterator backwards in the set.
- * @return The previous <code>Node</code> in the set being iterated over,
- * or<code>DTM.NULL</code> if there are no more members in that set.
- * @throws DOMException
- * INVALID_STATE_ERR: Raised if this method is called after the
- * <code>detach</code> method was invoked.
- * @throws RuntimeException thrown if this NodeSetDTM is not of
- * a cached type, and hence doesn't know what the previous node was.
- */
- public int previousNode()
- {
-
- if (!m_cacheNodes)
- throw new RuntimeException(
- XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_CANNOT_ITERATE, null)); //"This NodeSetDTM can not iterate to a previous node!");
-
- if ((m_next - 1) > 0)
- {
- m_next--;
-
- return this.elementAt(m_next);
- }
- else
- return DTM.NULL;
- }
-
- /**
- * Detaches the iterator from the set which it iterated over, releasing
- * any computational resources and placing the iterator in the INVALID
- * state. After<code>detach</code> has been invoked, calls to
- * <code>nextNode</code> or<code>previousNode</code> will raise the
- * exception INVALID_STATE_ERR.
- * <p>
- * This operation is a no-op in NodeSetDTM, and will not cause
- * INVALID_STATE_ERR to be raised by later operations.
- * </p>
- */
- public void detach(){}
-
- /**
- * Specify if it's OK for detach to release the iterator for reuse.
- *
- * @param allowRelease true if it is OK for detach to release this iterator
- * for pooling.
- */
- public void allowDetachToRelease(boolean allowRelease)
- {
- // no action for right now.
- }
-
-
- /**
- * Tells if this NodeSetDTM is "fresh", in other words, if
- * the first nextNode() that is called will return the
- * first node in the set.
- *
- * @return true if nextNode() would return the first node in the set,
- * false if it would return a later one.
- */
- public boolean isFresh()
- {
- return (m_next == 0);
- }
-
- /**
- * If an index is requested, NodeSetDTM will call this method
- * to run the iterator to the index. By default this sets
- * m_next to the index. If the index argument is -1, this
- * signals that the iterator should be run to the end.
- *
- * @param index Position to advance (or retreat) to, with
- * 0 requesting the reset ("fresh") position and -1 (or indeed
- * any out-of-bounds value) requesting the final position.
- * @throws RuntimeException thrown if this NodeSetDTM is not
- * one of the types which supports indexing/counting.
- */
- public void runTo(int index)
- {
-
- if (!m_cacheNodes)
- throw new RuntimeException(
- XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_CANNOT_INDEX, null)); //"This NodeSetDTM can not do indexing or counting functions!");
-
- if ((index >= 0) && (m_next < m_firstFree))
- m_next = index;
- else
- m_next = m_firstFree - 1;
- }
-
- /**
- * Returns the <code>index</code>th item in the collection. If
- * <code>index</code> is greater than or equal to the number of nodes in
- * the list, this returns <code>null</code>.
- *
- * TODO: What happens if index is out of range?
- *
- * @param index Index into the collection.
- * @return The node at the <code>index</code>th position in the
- * <code>NodeList</code>, or <code>null</code> if that is not a valid
- * index.
- */
- public int item(int index)
- {
-
- runTo(index);
-
- return this.elementAt(index);
- }
-
- /**
- * The number of nodes in the list. The range of valid child node indices is
- * 0 to <code>length-1</code> inclusive. Note that this operation requires
- * finding all the matching nodes, which may defeat attempts to defer
- * that work.
- *
- * @return integer indicating how many nodes are represented by this list.
- */
- public int getLength()
- {
-
- runTo(-1);
-
- return this.size();
- }
-
- /**
- * Add a node to the NodeSetDTM. Not all types of NodeSetDTMs support this
- * operation
- *
- * @param n Node to be added
- * @throws RuntimeException thrown if this NodeSetDTM is not of
- * a mutable type.
- */
- public void addNode(int n)
- {
-
- if (!m_mutable)
- throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");
-
- this.addElement(n);
- }
-
- /**
- * Insert a node at a given position.
- *
- * @param n Node to be added
- * @param pos Offset at which the node is to be inserted,
- * with 0 being the first position.
- * @throws RuntimeException thrown if this NodeSetDTM is not of
- * a mutable type.
- */
- public void insertNode(int n, int pos)
- {
-
- if (!m_mutable)
- throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");
-
- insertElementAt(n, pos);
- }
-
- /**
- * Remove a node.
- *
- * @param n Node to be added
- * @throws RuntimeException thrown if this NodeSetDTM is not of
- * a mutable type.
- */
- public void removeNode(int n)
- {
-
- if (!m_mutable)
- throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");
-
- this.removeElement(n);
- }
-
- // %TBD%
-// /**
-// * Copy NodeList members into this nodelist, adding in
-// * document order. If a node is null, don't add it.
-// *
-// * @param nodelist List of nodes which should now be referenced by
-// * this NodeSetDTM.
-// * @throws RuntimeException thrown if this NodeSetDTM is not of
-// * a mutable type.
-// */
-// public void addNodes(NodeList nodelist)
-// {
-//
-// if (!m_mutable)
-// throw new RuntimeException("This NodeSetDTM is not mutable!");
-//
-// if (null != nodelist) // defensive to fix a bug that Sanjiva reported.
-// {
-// int nChildren = nodelist.getLength();
-//
-// for (int i = 0; i < nChildren; i++)
-// {
-// int obj = nodelist.item(i);
-//
-// if (null != obj)
-// {
-// addElement(obj);
-// }
-// }
-// }
-//
-// // checkDups();
-// }
-
- // %TBD%
-// /**
-// * <p>Copy NodeList members into this nodelist, adding in
-// * document order. Only genuine node references will be copied;
-// * nulls appearing in the source NodeSetDTM will
-// * not be added to this one. </p>
-// *
-// * <p> In case you're wondering why this function is needed: NodeSetDTM
-// * implements both DTMIterator and NodeList. If this method isn't
-// * provided, Java can't decide which of those to use when addNodes()
-// * is invoked. Providing the more-explicit match avoids that
-// * ambiguity.)</p>
-// *
-// * @param ns NodeSetDTM whose members should be merged into this NodeSetDTM.
-// * @throws RuntimeException thrown if this NodeSetDTM is not of
-// * a mutable type.
-// */
-// public void addNodes(NodeSetDTM ns)
-// {
-//
-// if (!m_mutable)
-// throw new RuntimeException("This NodeSetDTM is not mutable!");
-//
-// addNodes((DTMIterator) ns);
-// }
-
- /**
- * Copy NodeList members into this nodelist, adding in
- * document order. Null references are not added.
- *
- * @param iterator DTMIterator which yields the nodes to be added.
- * @throws RuntimeException thrown if this NodeSetDTM is not of
- * a mutable type.
- */
- public void addNodes(DTMIterator iterator)
- {
-
- if (!m_mutable)
- throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");
-
- if (null != iterator) // defensive to fix a bug that Sanjiva reported.
- {
- int obj;
-
- while (DTM.NULL != (obj = iterator.nextNode()))
- {
- addElement(obj);
- }
- }
-
- // checkDups();
- }
-
- // %TBD%
-// /**
-// * Copy NodeList members into this nodelist, adding in
-// * document order. If a node is null, don't add it.
-// *
-// * @param nodelist List of nodes to be added
-// * @param support The XPath runtime context.
-// * @throws RuntimeException thrown if this NodeSetDTM is not of
-// * a mutable type.
-// */
-// public void addNodesInDocOrder(NodeList nodelist, XPathContext support)
-// {
-//
-// if (!m_mutable)
-// throw new RuntimeException("This NodeSetDTM is not mutable!");
-//
-// int nChildren = nodelist.getLength();
-//
-// for (int i = 0; i < nChildren; i++)
-// {
-// int node = nodelist.item(i);
-//
-// if (null != node)
-// {
-// addNodeInDocOrder(node, support);
-// }
-// }
-// }
-
- /**
- * Copy NodeList members into this nodelist, adding in
- * document order. If a node is null, don't add it.
- *
- * @param iterator DTMIterator which yields the nodes to be added.
- * @param support The XPath runtime context.
- * @throws RuntimeException thrown if this NodeSetDTM is not of
- * a mutable type.
- */
- public void addNodesInDocOrder(DTMIterator iterator, XPathContext support)
- {
-
- if (!m_mutable)
- throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");
-
- int node;
-
- while (DTM.NULL != (node = iterator.nextNode()))
- {
- addNodeInDocOrder(node, support);
- }
- }
-
- // %TBD%
-// /**
-// * Add the node list to this node set in document order.
-// *
-// * @param start index.
-// * @param end index.
-// * @param testIndex index.
-// * @param nodelist The nodelist to add.
-// * @param support The XPath runtime context.
-// *
-// * @return false always.
-// * @throws RuntimeException thrown if this NodeSetDTM is not of
-// * a mutable type.
-// */
-// private boolean addNodesInDocOrder(int start, int end, int testIndex,
-// NodeList nodelist, XPathContext support)
-// {
-//
-// if (!m_mutable)
-// throw new RuntimeException("This NodeSetDTM is not mutable!");
-//
-// boolean foundit = false;
-// int i;
-// int node = nodelist.item(testIndex);
-//
-// for (i = end; i >= start; i--)
-// {
-// int child = elementAt(i);
-//
-// if (child == node)
-// {
-// i = -2; // Duplicate, suppress insert
-//
-// break;
-// }
-//
-// if (!support.getDOMHelper().isNodeAfter(node, child))
-// {
-// insertElementAt(node, i + 1);
-//
-// testIndex--;
-//
-// if (testIndex > 0)
-// {
-// boolean foundPrev = addNodesInDocOrder(0, i, testIndex, nodelist,
-// support);
-//
-// if (!foundPrev)
-// {
-// addNodesInDocOrder(i, size() - 1, testIndex, nodelist, support);
-// }
-// }
-//
-// break;
-// }
-// }
-//
-// if (i == -1)
-// {
-// insertElementAt(node, 0);
-// }
-//
-// return foundit;
-// }
-
- /**
- * Add the node into a vector of nodes where it should occur in
- * document order.
- * @param node The node to be added.
- * @param test true if we should test for doc order
- * @param support The XPath runtime context.
- * @return insertIndex.
- * @throws RuntimeException thrown if this NodeSetDTM is not of
- * a mutable type.
- */
- public int addNodeInDocOrder(int node, boolean test, XPathContext support)
- {
-
- if (!m_mutable)
- throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");
-
- int insertIndex = -1;
-
- if (test)
- {
-
- // This needs to do a binary search, but a binary search
- // is somewhat tough because the sequence test involves
- // two nodes.
- int size = size(), i;
-
- for (i = size - 1; i >= 0; i--)
- {
- int child = elementAt(i);
-
- if (child == node)
- {
- i = -2; // Duplicate, suppress insert
-
- break;
- }
-
- DTM dtm = support.getDTM(node);
- if (!dtm.isNodeAfter(node, child))
- {
- break;
- }
- }
-
- if (i != -2)
- {
- insertIndex = i + 1;
-
- insertElementAt(node, insertIndex);
- }
- }
- else
- {
- insertIndex = this.size();
-
- boolean foundit = false;
-
- for (int i = 0; i < insertIndex; i++)
- {
- if (i == node)
- {
- foundit = true;
-
- break;
- }
- }
-
- if (!foundit)
- addElement(node);
- }
-
- // checkDups();
- return insertIndex;
- } // end addNodeInDocOrder(Vector v, Object obj)
-
- /**
- * Add the node into a vector of nodes where it should occur in
- * document order.
- * @param node The node to be added.
- * @param support The XPath runtime context.
- *
- * @return The index where it was inserted.
- * @throws RuntimeException thrown if this NodeSetDTM is not of
- * a mutable type.
- */
- public int addNodeInDocOrder(int node, XPathContext support)
- {
-
- if (!m_mutable)
- throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");
-
- return addNodeInDocOrder(node, true, support);
- } // end addNodeInDocOrder(Vector v, Object obj)
-
- /**
- * Get the length of the list.
- *
- * @return The size of this node set.
- */
- public int size()
- {
- return super.size();
- }
-
- /**
- * Append a Node onto the vector.
- *
- * @param value The node to be added.
- * @throws RuntimeException thrown if this NodeSetDTM is not of
- * a mutable type.
- */
- public void addElement(int value)
- {
-
- if (!m_mutable)
- throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");
-
- super.addElement(value);
- }
-
- /**
- * Inserts the specified node in this vector at the specified index.
- * Each component in this vector with an index greater or equal to
- * the specified index is shifted upward to have an index one greater
- * than the value it had previously.
- *
- * @param value The node to be inserted.
- * @param at The index where the insert should occur.
- * @throws RuntimeException thrown if this NodeSetDTM is not of
- * a mutable type.
- */
- public void insertElementAt(int value, int at)
- {
-
- if (!m_mutable)
- throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");
-
- super.insertElementAt(value, at);
- }
-
- /**
- * Append the nodes to the list.
- *
- * @param nodes The nodes to be appended to this node set.
- * @throws RuntimeException thrown if this NodeSetDTM is not of
- * a mutable type.
- */
- public void appendNodes(NodeVector nodes)
- {
-
- if (!m_mutable)
- throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");
-
- super.appendNodes(nodes);
- }
-
- /**
- * Inserts the specified node in this vector at the specified index.
- * Each component in this vector with an index greater or equal to
- * the specified index is shifted upward to have an index one greater
- * than the value it had previously.
- * @throws RuntimeException thrown if this NodeSetDTM is not of
- * a mutable type.
- */
- public void removeAllElements()
- {
-
- if (!m_mutable)
- throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");
-
- super.removeAllElements();
- }
-
- /**
- * Removes the first occurrence of the argument from this vector.
- * If the object is found in this vector, each component in the vector
- * with an index greater or equal to the object's index is shifted
- * downward to have an index one smaller than the value it had
- * previously.
- *
- * @param s The node to be removed.
- *
- * @return True if the node was successfully removed
- * @throws RuntimeException thrown if this NodeSetDTM is not of
- * a mutable type.
- */
- public boolean removeElement(int s)
- {
-
- if (!m_mutable)
- throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");
-
- return super.removeElement(s);
- }
-
- /**
- * Deletes the component at the specified index. Each component in
- * this vector with an index greater or equal to the specified
- * index is shifted downward to have an index one smaller than
- * the value it had previously.
- *
- * @param i The index of the node to be removed.
- * @throws RuntimeException thrown if this NodeSetDTM is not of
- * a mutable type.
- */
- public void removeElementAt(int i)
- {
-
- if (!m_mutable)
- throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");
-
- super.removeElementAt(i);
- }
-
- /**
- * Sets the component at the specified index of this vector to be the
- * specified object. The previous component at that position is discarded.
- *
- * The index must be a value greater than or equal to 0 and less
- * than the current size of the vector.
- *
- * @param node The node to be set.
- * @param index The index of the node to be replaced.
- * @throws RuntimeException thrown if this NodeSetDTM is not of
- * a mutable type.
- */
- public void setElementAt(int node, int index)
- {
-
- if (!m_mutable)
- throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");
-
- super.setElementAt(node, index);
- }
-
- /**
- * Same as setElementAt.
- *
- * @param node The node to be set.
- * @param index The index of the node to be replaced.
- * @throws RuntimeException thrown if this NodeSetDTM is not of
- * a mutable type.
- */
- public void setItem(int node, int index)
- {
-
- if (!m_mutable)
- throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");
-
- super.setElementAt(node, index);
- }
-
- /**
- * Get the nth element.
- *
- * @param i The index of the requested node.
- *
- * @return Node at specified index.
- */
- public int elementAt(int i)
- {
-
- runTo(i);
-
- return super.elementAt(i);
- }
-
- /**
- * Tell if the table contains the given node.
- *
- * @param s Node to look for
- *
- * @return True if the given node was found.
- */
- public boolean contains(int s)
- {
-
- runTo(-1);
-
- return super.contains(s);
- }
-
- /**
- * Searches for the first occurence of the given argument,
- * beginning the search at index, and testing for equality
- * using the equals method.
- *
- * @param elem Node to look for
- * @param index Index of where to start the search
- * @return the index of the first occurrence of the object
- * argument in this vector at position index or later in the
- * vector; returns -1 if the object is not found.
- */
- public int indexOf(int elem, int index)
- {
-
- runTo(-1);
-
- return super.indexOf(elem, index);
- }
-
- /**
- * Searches for the first occurence of the given argument,
- * beginning the search at index, and testing for equality
- * using the equals method.
- *
- * @param elem Node to look for
- * @return the index of the first occurrence of the object
- * argument in this vector at position index or later in the
- * vector; returns -1 if the object is not found.
- */
- public int indexOf(int elem)
- {
-
- runTo(-1);
-
- return super.indexOf(elem);
- }
-
- /** If this node is being used as an iterator, the next index that nextNode()
- * will return. */
- transient protected int m_next = 0;
-
- /**
- * Get the current position, which is one less than
- * the next nextNode() call will retrieve. i.e. if
- * you call getCurrentPos() and the return is 0, the next
- * fetch will take place at index 1.
- *
- * @return The the current position index.
- */
- public int getCurrentPos()
- {
- return m_next;
- }
-
- /**
- * Set the current position in the node set.
- * @param i Must be a valid index.
- * @throws RuntimeException thrown if this NodeSetDTM is not of
- * a cached type, and thus doesn't permit indexed access.
- */
- public void setCurrentPos(int i)
- {
-
- if (!m_cacheNodes)
- throw new RuntimeException(
- XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_CANNOT_INDEX, null)); //"This NodeSetDTM can not do indexing or counting functions!");
-
- m_next = i;
- }
-
- /**
- * Return the last fetched node. Needed to support the UnionPathIterator.
- *
- * @return the last fetched node.
- * @throws RuntimeException thrown if this NodeSetDTM is not of
- * a cached type, and thus doesn't permit indexed access.
- */
- public int getCurrentNode()
- {
-
- if (!m_cacheNodes)
- throw new RuntimeException(
- "This NodeSetDTM can not do indexing or counting functions!");
-
- int saved = m_next;
- // because nextNode always increments
- // But watch out for copy29, where the root iterator didn't
- // have nextNode called on it.
- int current = (m_next > 0) ? m_next-1 : m_next;
- int n = (current < m_firstFree) ? elementAt(current) : DTM.NULL;
- m_next = saved; // HACK: I think this is a bit of a hack. -sb
- return n;
- }
-
- /** True if this list can be mutated. */
- transient protected boolean m_mutable = true;
-
- /** True if this list is cached.
- * @serial */
- transient protected boolean m_cacheNodes = true;
-
- /** The root of the iteration, if available. */
- protected int m_root = DTM.NULL;
-
- /**
- * Get whether or not this is a cached node set.
- *
- *
- * @return True if this list is cached.
- */
- public boolean getShouldCacheNodes()
- {
- return m_cacheNodes;
- }
-
- /**
- * If setShouldCacheNodes(true) is called, then nodes will
- * be cached. They are not cached by default. This switch must
- * be set before the first call to nextNode is made, to ensure
- * that all nodes are cached.
- *
- * @param b true if this node set should be cached.
- * @throws RuntimeException thrown if an attempt is made to
- * request caching after we've already begun stepping through the
- * nodes in this set.
- */
- public void setShouldCacheNodes(boolean b)
- {
-
- if (!isFresh())
- throw new RuntimeException(
- XSLMessages.createXPATHMessage(XPATHErrorResources.ER_CANNOT_CALL_SETSHOULDCACHENODE, null)); //"Can not call setShouldCacheNodes after nextNode has been called!");
-
- m_cacheNodes = b;
- m_mutable = true;
- }
-
- /**
- * Tells if this iterator can have nodes added to it or set via
- * the <code>setItem(int node, int index)</code> method.
- *
- * @return True if the nodelist can be mutated.
- */
- public boolean isMutable()
- {
- return m_mutable;
- }
-
- transient private int m_last = 0;
-
- public int getLast()
- {
- return m_last;
- }
-
- public void setLast(int last)
- {
- m_last = last;
- }
-
- /**
- * Returns true if all the nodes in the iteration well be returned in document
- * order.
- *
- * @return true as a default.
- */
- public boolean isDocOrdered()
- {
- return true;
- }
-
- /**
- * Returns the axis being iterated, if it is known.
- *
- * @return Axis.CHILD, etc., or -1 if the axis is not known or is of multiple
- * types.
- */
- public int getAxis()
- {
- return -1;
- }
-
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/SourceTree.java b/src/com/sun/org/apache/xpath/internal/SourceTree.java
deleted file mode 100644
index 7a1cc0a..0000000
--- a/src/com/sun/org/apache/xpath/internal/SourceTree.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: SourceTree.java,v 1.1.2.1 2005/08/01 01:30:15 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal;
-
-
-/**
- * This object represents a Source Tree, and any associated
- * information.
- * @xsl.usage internal
- */
-public class SourceTree
-{
-
- /**
- * Constructor SourceTree
- *
- *
- * @param root The root of the source tree, which may or may not be a
- * {@link org.w3c.dom.Document} node.
- * @param url The URI of the source tree.
- */
- public SourceTree(int root, String url)
- {
- m_root = root;
- m_url = url;
- }
-
- /** The URI of the source tree. */
- public String m_url;
-
- /** The root of the source tree, which may or may not be a
- * {@link org.w3c.dom.Document} node. */
- public int m_root;
-}
diff --git a/src/com/sun/org/apache/xpath/internal/SourceTreeManager.java b/src/com/sun/org/apache/xpath/internal/SourceTreeManager.java
deleted file mode 100644
index b9c4770..0000000
--- a/src/com/sun/org/apache/xpath/internal/SourceTreeManager.java
+++ /dev/null
@@ -1,392 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: SourceTreeManager.java,v 1.2.4.1 2005/09/10 18:14:09 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal;
-
-import java.io.IOException;
-import java.util.Vector;
-
-import javax.xml.transform.Source;
-import javax.xml.transform.SourceLocator;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.URIResolver;
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.transform.stream.StreamSource;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.utils.SystemIDResolver;
-
-import org.xml.sax.XMLReader;
-import org.xml.sax.helpers.XMLReaderFactory;
-
-/**
- * This class bottlenecks all management of source trees. The methods
- * in this class should allow easy garbage collection of source
- * trees (not yet!), and should centralize parsing for those source trees.
- */
-public class SourceTreeManager
-{
-
- /** Vector of SourceTree objects that this manager manages. */
- private Vector m_sourceTree = new Vector();
-
- /**
- * Reset the list of SourceTree objects that this manager manages.
- *
- */
- public void reset()
- {
- m_sourceTree = new Vector();
- }
-
- /** The TrAX URI resolver used to obtain source trees. */
- URIResolver m_uriResolver;
-
- /**
- * Set an object that will be used to resolve URIs used in
- * document(), etc.
- * @param resolver An object that implements the URIResolver interface,
- * or null.
- */
- public void setURIResolver(URIResolver resolver)
- {
- m_uriResolver = resolver;
- }
-
- /**
- * Get the object that will be used to resolve URIs used in
- * document(), etc.
- * @return An object that implements the URIResolver interface,
- * or null.
- */
- public URIResolver getURIResolver()
- {
- return m_uriResolver;
- }
-
- /**
- * Given a document, find the URL associated with that document.
- * @param owner Document that was previously processed by this liaison.
- *
- * @return The base URI of the owner argument.
- */
- public String findURIFromDoc(int owner)
- {
- int n = m_sourceTree.size();
-
- for (int i = 0; i < n; i++)
- {
- SourceTree sTree = (SourceTree) m_sourceTree.elementAt(i);
-
- if (owner == sTree.m_root)
- return sTree.m_url;
- }
-
- return null;
- }
-
- /**
- * This will be called by the processor when it encounters
- * an xsl:include, xsl:import, or document() function.
- *
- * @param base The base URI that should be used.
- * @param urlString Value from an xsl:import or xsl:include's href attribute,
- * or a URI specified in the document() function.
- *
- * @return a Source that can be used to process the resource.
- *
- * @throws IOException
- * @throws TransformerException
- */
- public Source resolveURI(
- String base, String urlString, SourceLocator locator)
- throws TransformerException, IOException
- {
-
- Source source = null;
-
- if (null != m_uriResolver)
- {
- source = m_uriResolver.resolve(urlString, base);
- }
-
- if (null == source)
- {
- String uri = SystemIDResolver.getAbsoluteURI(urlString, base);
-
- source = new StreamSource(uri);
- }
-
- return source;
- }
-
- /** JJK: Support <?xalan:doc_cache_off?> kluge in ElemForEach.
- * TODO: This function is highly dangerous. Cache management must be improved.
- *
- * @param n The node to remove.
- */
- public void removeDocumentFromCache(int n)
- {
- if(DTM.NULL ==n)
- return;
- for(int i=m_sourceTree.size()-1;i>=0;--i)
- {
- SourceTree st=(SourceTree)m_sourceTree.elementAt(i);
- if(st!=null && st.m_root==n)
- {
- m_sourceTree.removeElementAt(i);
- return;
- }
- }
- }
-
-
-
- /**
- * Put the source tree root node in the document cache.
- * TODO: This function needs to be a LOT more sophisticated.
- *
- * @param n The node to cache.
- * @param source The Source object to cache.
- */
- public void putDocumentInCache(int n, Source source)
- {
-
- int cachedNode = getNode(source);
-
- if (DTM.NULL != cachedNode)
- {
- if (!(cachedNode == n))
- throw new RuntimeException(
- "Programmer's Error! "
- + "putDocumentInCache found reparse of doc: "
- + source.getSystemId());
- return;
- }
- if (null != source.getSystemId())
- {
- m_sourceTree.addElement(new SourceTree(n, source.getSystemId()));
- }
- }
-
- /**
- * Given a Source object, find the node associated with it.
- *
- * @param source The Source object to act as the key.
- *
- * @return The node that is associated with the Source, or null if not found.
- */
- public int getNode(Source source)
- {
-
-// if (source instanceof DOMSource)
-// return ((DOMSource) source).getNode();
-
- // TODO: Not sure if the BaseID is really the same thing as the ID.
- String url = source.getSystemId();
-
- if (null == url)
- return DTM.NULL;
-
- int n = m_sourceTree.size();
-
- // System.out.println("getNode: "+n);
- for (int i = 0; i < n; i++)
- {
- SourceTree sTree = (SourceTree) m_sourceTree.elementAt(i);
-
- // System.out.println("getNode - url: "+url);
- // System.out.println("getNode - sTree.m_url: "+sTree.m_url);
- if (url.equals(sTree.m_url))
- return sTree.m_root;
- }
-
- // System.out.println("getNode - returning: "+node);
- return DTM.NULL;
- }
-
- /**
- * Get the source tree from the a base URL and a URL string.
- *
- * @param base The base URI to use if the urlString is relative.
- * @param urlString An absolute or relative URL string.
- * @param locator The location of the caller, for diagnostic purposes.
- *
- * @return should be a non-null reference to the node identified by the
- * base and urlString.
- *
- * @throws TransformerException If the URL can not resolve to a node.
- */
- public int getSourceTree(
- String base, String urlString, SourceLocator locator, XPathContext xctxt)
- throws TransformerException
- {
-
- // System.out.println("getSourceTree");
- try
- {
- Source source = this.resolveURI(base, urlString, locator);
-
- // System.out.println("getSourceTree - base: "+base+", urlString: "+urlString+", source: "+source.getSystemId());
- return getSourceTree(source, locator, xctxt);
- }
- catch (IOException ioe)
- {
- throw new TransformerException(ioe.getMessage(), locator, ioe);
- }
-
- /* catch (TransformerException te)
- {
- throw new TransformerException(te.getMessage(), locator, te);
- }*/
- }
-
- /**
- * Get the source tree from the input source.
- *
- * @param source The Source object that should identify the desired node.
- * @param locator The location of the caller, for diagnostic purposes.
- *
- * @return non-null reference to a node.
- *
- * @throws TransformerException if the Source argument can't be resolved to
- * a node.
- */
- public int getSourceTree(Source source, SourceLocator locator, XPathContext xctxt)
- throws TransformerException
- {
-
- int n = getNode(source);
-
- if (DTM.NULL != n)
- return n;
-
- n = parseToNode(source, locator, xctxt);
-
- if (DTM.NULL != n)
- putDocumentInCache(n, source);
-
- return n;
- }
-
- /**
- * Try to create a DOM source tree from the input source.
- *
- * @param source The Source object that identifies the source node.
- * @param locator The location of the caller, for diagnostic purposes.
- *
- * @return non-null reference to node identified by the source argument.
- *
- * @throws TransformerException if the source argument can not be resolved
- * to a source node.
- */
- public int parseToNode(Source source, SourceLocator locator, XPathContext xctxt)
- throws TransformerException
- {
-
- try
- {
- Object xowner = xctxt.getOwnerObject();
- DTM dtm;
- if(null != xowner && xowner instanceof com.sun.org.apache.xml.internal.dtm.DTMWSFilter)
- {
- dtm = xctxt.getDTM(source, false,
- (com.sun.org.apache.xml.internal.dtm.DTMWSFilter)xowner, false, true);
- }
- else
- {
- dtm = xctxt.getDTM(source, false, null, false, true);
- }
- return dtm.getDocument();
- }
- catch (Exception e)
- {
- //e.printStackTrace();
- throw new TransformerException(e.getMessage(), locator, e);
- }
-
- }
-
- /**
- * This method returns the SAX2 parser to use with the InputSource
- * obtained from this URI.
- * It may return null if any SAX2-conformant XML parser can be used,
- * or if getInputSource() will also return null. The parser must
- * be free for use (i.e.
- * not currently in use for another parse().
- *
- * @param inputSource The value returned from the URIResolver.
- * @return a SAX2 XMLReader to use to resolve the inputSource argument.
- * @param locator The location of the original caller, for diagnostic purposes.
- *
- * @throws TransformerException if the reader can not be created.
- */
- public static XMLReader getXMLReader(Source inputSource, SourceLocator locator)
- throws TransformerException
- {
-
- try
- {
- XMLReader reader = (inputSource instanceof SAXSource)
- ? ((SAXSource) inputSource).getXMLReader() : null;
-
- if (null == reader)
- {
- try {
- javax.xml.parsers.SAXParserFactory factory=
- javax.xml.parsers.SAXParserFactory.newInstance();
- factory.setNamespaceAware( true );
- javax.xml.parsers.SAXParser jaxpParser=
- factory.newSAXParser();
- reader=jaxpParser.getXMLReader();
-
- } catch( javax.xml.parsers.ParserConfigurationException ex ) {
- throw new org.xml.sax.SAXException( ex );
- } catch( javax.xml.parsers.FactoryConfigurationError ex1 ) {
- throw new org.xml.sax.SAXException( ex1.toString() );
- } catch( NoSuchMethodError ex2 ) {
- }
- catch (AbstractMethodError ame){}
- if(null == reader)
- reader = XMLReaderFactory.createXMLReader();
- }
-
- try
- {
- reader.setFeature("http://xml.org/sax/features/namespace-prefixes",
- true);
- }
- catch (org.xml.sax.SAXException se)
- {
-
- // What can we do?
- // TODO: User diagnostics.
- }
-
- return reader;
- }
- catch (org.xml.sax.SAXException se)
- {
- throw new TransformerException(se.getMessage(), locator, se);
- }
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/VariableStack.java b/src/com/sun/org/apache/xpath/internal/VariableStack.java
deleted file mode 100644
index d219a18..0000000
--- a/src/com/sun/org/apache/xpath/internal/VariableStack.java
+++ /dev/null
@@ -1,520 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: VariableStack.java,v 1.2.4.1 2005/09/10 18:16:22 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal;
-
-import javax.xml.transform.TransformerException;
-
-import com.sun.org.apache.xalan.internal.res.XSLMessages;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
-
-/**
- * Defines a class to keep track of a stack for
- * template arguments and variables.
- *
- * <p>This has been changed from the previous incarnations of this
- * class to be fairly low level.</p>
- * @xsl.usage internal
- */
-public class VariableStack implements Cloneable
-{
- /**
- * limitation for 1K
- */
- public static final int CLEARLIMITATION= 1024;
-
- /**
- * Constructor for a variable stack.
- */
- public VariableStack()
- {
- reset();
- }
-
- /**
- * Returns a clone of this variable stack.
- *
- * @return a clone of this variable stack.
- *
- * @throws CloneNotSupportedException
- */
- public synchronized Object clone() throws CloneNotSupportedException
- {
-
- VariableStack vs = (VariableStack) super.clone();
-
- // I *think* I can get away with a shallow clone here?
- vs._stackFrames = (XObject[]) _stackFrames.clone();
- vs._links = (int[]) _links.clone();
-
- return vs;
- }
-
- /**
- * The stack frame where all variables and params will be kept.
- * @serial
- */
- XObject[] _stackFrames = new XObject[XPathContext.RECURSIONLIMIT * 2];
-
- /**
- * The top of the stack frame (<code>_stackFrames</code>).
- * @serial
- */
- int _frameTop;
-
- /**
- * The bottom index of the current frame (relative to <code>_stackFrames</code>).
- * @serial
- */
- private int _currentFrameBottom;
-
- /**
- * The stack of frame positions. I call 'em links because of distant
- * <a href="http://math.millikin.edu/mprogers/Courses/currentCourses/CS481-ComputerArchitecture/cs481.Motorola68000.html">
- * Motorola 68000 assembler</a> memories. :-)
- * @serial
- */
- int[] _links = new int[XPathContext.RECURSIONLIMIT];
-
- /**
- * The top of the links stack.
- */
- int _linksTop;
-
- /**
- * Get the element at the given index, regardless of stackframe.
- *
- * @param i index from zero.
- *
- * @return The item at the given index.
- */
- public XObject elementAt(final int i)
- {
- return _stackFrames[i];
- }
-
- /**
- * Get size of the stack.
- *
- * @return the total size of the execution stack.
- */
- public int size()
- {
- return _frameTop;
- }
-
- /**
- * Reset the stack to a start position.
- *
- * @return the total size of the execution stack.
- */
- public void reset()
- {
-
- _frameTop = 0;
- _linksTop = 0;
-
- // Adding one here to the stack of frame positions will allow us always
- // to look one under without having to check if we're at zero.
- // (As long as the caller doesn't screw up link/unlink.)
- _links[_linksTop++] = 0;
- _stackFrames = new XObject[_stackFrames.length];
- }
-
- /**
- * Set the current stack frame.
- *
- * @param sf The new stack frame position.
- */
- public void setStackFrame(int sf)
- {
- _currentFrameBottom = sf;
- }
-
- /**
- * Get the position from where the search should start,
- * which is either the searchStart property, or the top
- * of the stack if that value is -1.
- *
- * @return The current stack frame position.
- */
- public int getStackFrame()
- {
- return _currentFrameBottom;
- }
-
- /**
- * Allocates memory (called a stackframe) on the stack; used to store
- * local variables and parameter arguments.
- *
- * <p>I use the link/unlink concept because of distant
- * <a href="http://math.millikin.edu/mprogers/Courses/currentCourses/CS481-ComputerArchitecture/cs481.Motorola68000.html">
- * Motorola 68000 assembler</a> memories.</p>
- *
- * @param size The size of the stack frame allocation. This ammount should
- * normally be the maximum number of variables that you can have allocated
- * at one time in the new stack frame.
- *
- * @return The bottom of the stack frame, from where local variable addressing
- * should start from.
- */
- public int link(final int size)
- {
-
- _currentFrameBottom = _frameTop;
- _frameTop += size;
-
- if (_frameTop >= _stackFrames.length)
- {
- XObject newsf[] = new XObject[_stackFrames.length + XPathContext.RECURSIONLIMIT + size];
-
- System.arraycopy(_stackFrames, 0, newsf, 0, _stackFrames.length);
-
- _stackFrames = newsf;
- }
-
- if (_linksTop + 1 >= _links.length)
- {
- int newlinks[] = new int[_links.length + (CLEARLIMITATION * 2)];
-
- System.arraycopy(_links, 0, newlinks, 0, _links.length);
-
- _links = newlinks;
- }
-
- _links[_linksTop++] = _currentFrameBottom;
-
- return _currentFrameBottom;
- }
-
- /**
- * Free up the stack frame that was last allocated with
- * {@link #link(int size)}.
- */
- public void unlink()
- {
- _frameTop = _links[--_linksTop];
- _currentFrameBottom = _links[_linksTop - 1];
- }
-
- /**
- * Free up the stack frame that was last allocated with
- * {@link #link(int size)}.
- * @param currentFrame The current frame to set to
- * after the unlink.
- */
- public void unlink(int currentFrame)
- {
- _frameTop = _links[--_linksTop];
- _currentFrameBottom = currentFrame;
- }
-
- /**
- * Set a local variable or parameter in the current stack frame.
- *
- *
- * @param index Local variable index relative to the current stack
- * frame bottom.
- *
- * @param val The value of the variable that is being set.
- */
- public void setLocalVariable(int index, XObject val)
- {
- _stackFrames[index + _currentFrameBottom] = val;
- }
-
- /**
- * Set a local variable or parameter in the specified stack frame.
- *
- *
- * @param index Local variable index relative to the current stack
- * frame bottom.
- * NEEDSDOC @param stackFrame
- *
- * @param val The value of the variable that is being set.
- */
- public void setLocalVariable(int index, XObject val, int stackFrame)
- {
- _stackFrames[index + stackFrame] = val;
- }
-
- /**
- * Get a local variable or parameter in the current stack frame.
- *
- *
- * @param xctxt The XPath context, which must be passed in order to
- * lazy evaluate variables.
- *
- * @param index Local variable index relative to the current stack
- * frame bottom.
- *
- * @return The value of the variable.
- *
- * @throws TransformerException
- */
- public XObject getLocalVariable(XPathContext xctxt, int index)
- throws TransformerException
- {
-
- index += _currentFrameBottom;
-
- XObject val = _stackFrames[index];
-
- if(null == val)
- throw new TransformerException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_VARIABLE_ACCESSED_BEFORE_BIND, null),
- xctxt.getSAXLocator());
- // "Variable accessed before it is bound!", xctxt.getSAXLocator());
-
- // Lazy execution of variables.
- if (val.getType() == XObject.CLASS_UNRESOLVEDVARIABLE)
- return (_stackFrames[index] = val.execute(xctxt));
-
- return val;
- }
-
- /**
- * Get a local variable or parameter in the current stack frame.
- *
- *
- * @param index Local variable index relative to the given
- * frame bottom.
- * NEEDSDOC @param frame
- *
- * @return The value of the variable.
- *
- * @throws TransformerException
- */
- public XObject getLocalVariable(int index, int frame)
- throws TransformerException
- {
-
- index += frame;
-
- XObject val = _stackFrames[index];
-
- return val;
- }
-
- /**
- * Get a local variable or parameter in the current stack frame.
- *
- *
- * @param xctxt The XPath context, which must be passed in order to
- * lazy evaluate variables.
- *
- * @param index Local variable index relative to the current stack
- * frame bottom.
- *
- * @return The value of the variable.
- *
- * @throws TransformerException
- */
- public XObject getLocalVariable(XPathContext xctxt, int index, boolean destructiveOK)
- throws TransformerException
- {
-
- index += _currentFrameBottom;
-
- XObject val = _stackFrames[index];
-
- if(null == val)
- throw new TransformerException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_VARIABLE_ACCESSED_BEFORE_BIND, null),
- xctxt.getSAXLocator());
- // "Variable accessed before it is bound!", xctxt.getSAXLocator());
-
- // Lazy execution of variables.
- if (val.getType() == XObject.CLASS_UNRESOLVEDVARIABLE)
- return (_stackFrames[index] = val.execute(xctxt));
-
- return destructiveOK ? val : val.getFresh();
- }
-
- /**
- * Tell if a local variable has been set or not.
- *
- * @param index Local variable index relative to the current stack
- * frame bottom.
- *
- * @return true if the value at the index is not null.
- *
- * @throws TransformerException
- */
- public boolean isLocalSet(int index) throws TransformerException
- {
- return (_stackFrames[index + _currentFrameBottom] != null);
- }
-
- /** NEEDSDOC Field m_nulls */
- private static XObject[] m_nulls = new XObject[CLEARLIMITATION];
-
- /**
- * Use this to clear the variables in a section of the stack. This is
- * used to clear the parameter section of the stack, so that default param
- * values can tell if they've already been set. It is important to note that
- * this function has a 1K limitation.
- *
- * @param start The start position, relative to the current local stack frame.
- * @param len The number of slots to be cleared.
- */
- public void clearLocalSlots(int start, int len)
- {
-
- start += _currentFrameBottom;
-
- System.arraycopy(m_nulls, 0, _stackFrames, start, len);
- }
-
- /**
- * Set a global variable or parameter in the global stack frame.
- *
- *
- * @param index Local variable index relative to the global stack frame
- * bottom.
- *
- * @param val The value of the variable that is being set.
- */
- public void setGlobalVariable(final int index, final XObject val)
- {
- _stackFrames[index] = val;
- }
-
- /**
- * Get a global variable or parameter from the global stack frame.
- *
- *
- * @param xctxt The XPath context, which must be passed in order to
- * lazy evaluate variables.
- *
- * @param index Global variable index relative to the global stack
- * frame bottom.
- *
- * @return The value of the variable.
- *
- * @throws TransformerException
- */
- public XObject getGlobalVariable(XPathContext xctxt, final int index)
- throws TransformerException
- {
-
- XObject val = _stackFrames[index];
-
- // Lazy execution of variables.
- if (val.getType() == XObject.CLASS_UNRESOLVEDVARIABLE)
- return (_stackFrames[index] = val.execute(xctxt));
-
- return val;
- }
-
- /**
- * Get a global variable or parameter from the global stack frame.
- *
- *
- * @param xctxt The XPath context, which must be passed in order to
- * lazy evaluate variables.
- *
- * @param index Global variable index relative to the global stack
- * frame bottom.
- *
- * @return The value of the variable.
- *
- * @throws TransformerException
- */
- public XObject getGlobalVariable(XPathContext xctxt, final int index, boolean destructiveOK)
- throws TransformerException
- {
-
- XObject val = _stackFrames[index];
-
- // Lazy execution of variables.
- if (val.getType() == XObject.CLASS_UNRESOLVEDVARIABLE)
- return (_stackFrames[index] = val.execute(xctxt));
-
- return destructiveOK ? val : val.getFresh();
- }
-
- /**
- * Get a variable based on it's qualified name.
- * This is for external use only.
- *
- * @param xctxt The XPath context, which must be passed in order to
- * lazy evaluate variables.
- *
- * @param qname The qualified name of the variable.
- *
- * @return The evaluated value of the variable.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject getVariableOrParam(
- XPathContext xctxt, com.sun.org.apache.xml.internal.utils.QName qname)
- throws javax.xml.transform.TransformerException
- {
-
- // J2SE does not support Xalan interpretive
- /*
- com.sun.org.apache.xml.internal.utils.PrefixResolver prefixResolver =
- xctxt.getNamespaceContext();
-
- // Get the current ElemTemplateElement, which must be pushed in as the
- // prefix resolver, and then walk backwards in document order, searching
- // for an xsl:param element or xsl:variable element that matches our
- // qname. If we reach the top level, use the StylesheetRoot's composed
- // list of top level variables and parameters.
-
- if (prefixResolver instanceof com.sun.org.apache.xalan.internal.templates.ElemTemplateElement)
- {
-
- com.sun.org.apache.xalan.internal.templates.ElemVariable vvar;
-
- com.sun.org.apache.xalan.internal.templates.ElemTemplateElement prev =
- (com.sun.org.apache.xalan.internal.templates.ElemTemplateElement) prefixResolver;
-
- if (!(prev instanceof com.sun.org.apache.xalan.internal.templates.Stylesheet))
- {
- while ( !(prev.getParentNode() instanceof com.sun.org.apache.xalan.internal.templates.Stylesheet) )
- {
- com.sun.org.apache.xalan.internal.templates.ElemTemplateElement savedprev = prev;
-
- while (null != (prev = prev.getPreviousSiblingElem()))
- {
- if (prev instanceof com.sun.org.apache.xalan.internal.templates.ElemVariable)
- {
- vvar = (com.sun.org.apache.xalan.internal.templates.ElemVariable) prev;
-
- if (vvar.getName().equals(qname))
- return getLocalVariable(xctxt, vvar.getIndex());
- }
- }
- prev = savedprev.getParentElem();
- }
- }
-
- vvar = prev.getStylesheetRoot().getVariableOrParamComposed(qname);
- if (null != vvar)
- return getGlobalVariable(xctxt, vvar.getIndex());
- }
- */
-
- throw new javax.xml.transform.TransformerException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_VAR_NOT_RESOLVABLE, new Object[]{qname.toString()})); //"Variable not resolvable: " + qname);
- }
-} // end VariableStack
diff --git a/src/com/sun/org/apache/xpath/internal/WhitespaceStrippingElementMatcher.java b/src/com/sun/org/apache/xpath/internal/WhitespaceStrippingElementMatcher.java
deleted file mode 100644
index dc5d975..0000000
--- a/src/com/sun/org/apache/xpath/internal/WhitespaceStrippingElementMatcher.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: WhitespaceStrippingElementMatcher.java,v 1.1.2.1 2005/08/01 01:30:15 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal;
-
-import javax.xml.transform.TransformerException;
-
-import org.w3c.dom.Element;
-
-/**
- * A class that implements this interface can tell if a given element should
- * strip whitespace nodes from it's children.
- */
-public interface WhitespaceStrippingElementMatcher
-{
- /**
- * Get information about whether or not an element should strip whitespace.
- * @see <a href="http://www.w3.org/TR/xslt#strip">strip in XSLT Specification</a>
- *
- * @param support The XPath runtime state.
- * @param targetElement Element to check
- *
- * @return true if the whitespace should be stripped.
- *
- * @throws TransformerException
- */
- public boolean shouldStripWhiteSpace(
- XPathContext support, Element targetElement) throws TransformerException;
-
- /**
- * Get information about whether or not whitespace can be stripped.
- * @see <a href="http://www.w3.org/TR/xslt#strip">strip in XSLT Specification</a>
- *
- * @return true if the whitespace can be stripped.
- */
- public boolean canStripWhiteSpace();
-}
diff --git a/src/com/sun/org/apache/xpath/internal/XPath.java b/src/com/sun/org/apache/xpath/internal/XPath.java
deleted file mode 100644
index 1601ae1..0000000
--- a/src/com/sun/org/apache/xpath/internal/XPath.java
+++ /dev/null
@@ -1,645 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XPath.java,v 1.2.4.1 2005/09/15 01:41:57 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal;
-
-import java.io.Serializable;
-
-import javax.xml.transform.ErrorListener;
-import javax.xml.transform.SourceLocator;
-import javax.xml.transform.TransformerException;
-
-import com.sun.org.apache.xalan.internal.res.XSLMessages;
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.utils.PrefixResolver;
-import com.sun.org.apache.xml.internal.utils.SAXSourceLocator;
-import com.sun.org.apache.xpath.internal.compiler.Compiler;
-import com.sun.org.apache.xpath.internal.compiler.FunctionTable;
-import com.sun.org.apache.xpath.internal.compiler.XPathParser;
-import com.sun.org.apache.xpath.internal.functions.Function;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
-
-/**
- * The XPath class wraps an expression object and provides general services
- * for execution of that expression.
- * @xsl.usage advanced
- */
-public class XPath implements Serializable, ExpressionOwner
-{
- static final long serialVersionUID = 3976493477939110553L;
-
- /** The top of the expression tree.
- * @serial */
- private Expression m_mainExp;
-
- /**
- * The function table for xpath build-in functions
- */
- private transient FunctionTable m_funcTable = null;
-
- /**
- * initial the function table
- */
- private void initFunctionTable(){
- m_funcTable = new FunctionTable();
- }
-
- /**
- * Get the raw Expression object that this class wraps.
- *
- *
- * @return the raw Expression object, which should not normally be null.
- */
- public Expression getExpression()
- {
- return m_mainExp;
- }
-
- /**
- * This function is used to fixup variables from QNames to stack frame
- * indexes at stylesheet build time.
- * @param vars List of QNames that correspond to variables. This list
- * should be searched backwards for the first qualified name that
- * corresponds to the variable reference qname. The position of the
- * QName in the vector from the start of the vector will be its position
- * in the stack frame (but variables above the globalsTop value will need
- * to be offset to the current stack frame).
- */
- public void fixupVariables(java.util.Vector vars, int globalsSize)
- {
- m_mainExp.fixupVariables(vars, globalsSize);
- }
-
- /**
- * Set the raw expression object for this object.
- *
- *
- * @param exp the raw Expression object, which should not normally be null.
- */
- public void setExpression(Expression exp)
- {
- if(null != m_mainExp)
- exp.exprSetParent(m_mainExp.exprGetParent()); // a bit bogus
- m_mainExp = exp;
- }
-
- /**
- * Get the SourceLocator on the expression object.
- *
- *
- * @return the SourceLocator on the expression object, which may be null.
- */
- public SourceLocator getLocator()
- {
- return m_mainExp;
- }
-
-// /**
-// * Set the SourceLocator on the expression object.
-// *
-// *
-// * @param l the SourceLocator on the expression object, which may be null.
-// */
-// public void setLocator(SourceLocator l)
-// {
-// // Note potential hazards -- l may not be serializable, or may be changed
-// // after being assigned here.
-// m_mainExp.setSourceLocator(l);
-// }
-
- /** The pattern string, mainly kept around for diagnostic purposes.
- * @serial */
- String m_patternString;
-
- /**
- * Return the XPath string associated with this object.
- *
- *
- * @return the XPath string associated with this object.
- */
- public String getPatternString()
- {
- return m_patternString;
- }
-
- /** Represents a select type expression. */
- public static final int SELECT = 0;
-
- /** Represents a match type expression. */
- public static final int MATCH = 1;
-
- /**
- * Construct an XPath object.
- *
- * (Needs review -sc) This method initializes an XPathParser/
- * Compiler and compiles the expression.
- * @param exprString The XPath expression.
- * @param locator The location of the expression, may be null.
- * @param prefixResolver A prefix resolver to use to resolve prefixes to
- * namespace URIs.
- * @param type one of {@link #SELECT} or {@link #MATCH}.
- * @param errorListener The error listener, or null if default should be used.
- *
- * @throws javax.xml.transform.TransformerException if syntax or other error.
- */
- public XPath(
- String exprString, SourceLocator locator, PrefixResolver prefixResolver, int type,
- ErrorListener errorListener)
- throws javax.xml.transform.TransformerException
- {
- initFunctionTable();
- if(null == errorListener)
- errorListener = new com.sun.org.apache.xml.internal.utils.DefaultErrorHandler();
-
- m_patternString = exprString;
-
- XPathParser parser = new XPathParser(errorListener, locator);
- Compiler compiler = new Compiler(errorListener, locator, m_funcTable);
-
- if (SELECT == type)
- parser.initXPath(compiler, exprString, prefixResolver);
- else if (MATCH == type)
- parser.initMatchPattern(compiler, exprString, prefixResolver);
- else
- throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_CANNOT_DEAL_XPATH_TYPE, new Object[]{Integer.toString(type)})); //"Can not deal with XPath type: " + type);
-
- // System.out.println("----------------");
- Expression expr = compiler.compile(0);
-
- // System.out.println("expr: "+expr);
- this.setExpression(expr);
-
- if((null != locator) && locator instanceof ExpressionNode)
- {
- expr.exprSetParent((ExpressionNode)locator);
- }
-
- }
-
- /**
- * Construct an XPath object.
- *
- * (Needs review -sc) This method initializes an XPathParser/
- * Compiler and compiles the expression.
- * @param exprString The XPath expression.
- * @param locator The location of the expression, may be null.
- * @param prefixResolver A prefix resolver to use to resolve prefixes to
- * namespace URIs.
- * @param type one of {@link #SELECT} or {@link #MATCH}.
- * @param errorListener The error listener, or null if default should be used.
- *
- * @throws javax.xml.transform.TransformerException if syntax or other error.
- */
- public XPath(
- String exprString, SourceLocator locator,
- PrefixResolver prefixResolver, int type,
- ErrorListener errorListener, FunctionTable aTable)
- throws javax.xml.transform.TransformerException
- {
- m_funcTable = aTable;
- if(null == errorListener)
- errorListener = new com.sun.org.apache.xml.internal.utils.DefaultErrorHandler();
-
- m_patternString = exprString;
-
- XPathParser parser = new XPathParser(errorListener, locator);
- Compiler compiler = new Compiler(errorListener, locator, m_funcTable);
-
- if (SELECT == type)
- parser.initXPath(compiler, exprString, prefixResolver);
- else if (MATCH == type)
- parser.initMatchPattern(compiler, exprString, prefixResolver);
- else
- throw new RuntimeException(XSLMessages.createXPATHMessage(
- XPATHErrorResources.ER_CANNOT_DEAL_XPATH_TYPE,
- new Object[]{Integer.toString(type)}));
- //"Can not deal with XPath type: " + type);
-
- // System.out.println("----------------");
- Expression expr = compiler.compile(0);
-
- // System.out.println("expr: "+expr);
- this.setExpression(expr);
-
- if((null != locator) && locator instanceof ExpressionNode)
- {
- expr.exprSetParent((ExpressionNode)locator);
- }
-
- }
-
- /**
- * Construct an XPath object.
- *
- * (Needs review -sc) This method initializes an XPathParser/
- * Compiler and compiles the expression.
- * @param exprString The XPath expression.
- * @param locator The location of the expression, may be null.
- * @param prefixResolver A prefix resolver to use to resolve prefixes to
- * namespace URIs.
- * @param type one of {@link #SELECT} or {@link #MATCH}.
- *
- * @throws javax.xml.transform.TransformerException if syntax or other error.
- */
- public XPath(
- String exprString, SourceLocator locator, PrefixResolver prefixResolver, int type)
- throws javax.xml.transform.TransformerException
- {
- this(exprString, locator, prefixResolver, type, null);
- }
-
- /**
- * Construct an XPath object.
- *
- * @param expr The Expression object.
- *
- * @throws javax.xml.transform.TransformerException if syntax or other error.
- */
- public XPath(Expression expr)
- {
- this.setExpression(expr);
- initFunctionTable();
- }
-
- /**
- * Given an expression and a context, evaluate the XPath
- * and return the result.
- *
- * @param xctxt The execution context.
- * @param contextNode The node that "." expresses.
- * @param namespaceContext The context in which namespaces in the
- * XPath are supposed to be expanded.
- *
- * @return The result of the XPath or null if callbacks are used.
- * @throws TransformerException thrown if
- * the error condition is severe enough to halt processing.
- *
- * @throws javax.xml.transform.TransformerException
- * @xsl.usage experimental
- */
- public XObject execute(
- XPathContext xctxt, org.w3c.dom.Node contextNode,
- PrefixResolver namespaceContext)
- throws javax.xml.transform.TransformerException
- {
- return execute(
- xctxt, xctxt.getDTMHandleFromNode(contextNode),
- namespaceContext);
- }
-
-
- /**
- * Given an expression and a context, evaluate the XPath
- * and return the result.
- *
- * @param xctxt The execution context.
- * @param contextNode The node that "." expresses.
- * @param namespaceContext The context in which namespaces in the
- * XPath are supposed to be expanded.
- *
- * @throws TransformerException thrown if the active ProblemListener decides
- * the error condition is severe enough to halt processing.
- *
- * @throws javax.xml.transform.TransformerException
- * @xsl.usage experimental
- */
- public XObject execute(
- XPathContext xctxt, int contextNode, PrefixResolver namespaceContext)
- throws javax.xml.transform.TransformerException
- {
-
- xctxt.pushNamespaceContext(namespaceContext);
-
- xctxt.pushCurrentNodeAndExpression(contextNode, contextNode);
-
- XObject xobj = null;
-
- try
- {
- xobj = m_mainExp.execute(xctxt);
- }
- catch (TransformerException te)
- {
- te.setLocator(this.getLocator());
- ErrorListener el = xctxt.getErrorListener();
- if(null != el) // defensive, should never happen.
- {
- el.error(te);
- }
- else
- throw te;
- }
- catch (Exception e)
- {
- while (e instanceof com.sun.org.apache.xml.internal.utils.WrappedRuntimeException)
- {
- e = ((com.sun.org.apache.xml.internal.utils.WrappedRuntimeException) e).getException();
- }
- // e.printStackTrace();
-
- String msg = e.getMessage();
-
- if (msg == null || msg.length() == 0) {
- msg = XSLMessages.createXPATHMessage(
- XPATHErrorResources.ER_XPATH_ERROR, null);
-
- }
- TransformerException te = new TransformerException(msg,
- getLocator(), e);
- ErrorListener el = xctxt.getErrorListener();
- // te.printStackTrace();
- if(null != el) // defensive, should never happen.
- {
- el.fatalError(te);
- }
- else
- throw te;
- }
- finally
- {
- xctxt.popNamespaceContext();
-
- xctxt.popCurrentNodeAndExpression();
- }
-
- return xobj;
- }
-
- /**
- * Given an expression and a context, evaluate the XPath
- * and return the result.
- *
- * @param xctxt The execution context.
- * @param contextNode The node that "." expresses.
- * @param namespaceContext The context in which namespaces in the
- * XPath are supposed to be expanded.
- *
- * @throws TransformerException thrown if the active ProblemListener decides
- * the error condition is severe enough to halt processing.
- *
- * @throws javax.xml.transform.TransformerException
- * @xsl.usage experimental
- */
- public boolean bool(
- XPathContext xctxt, int contextNode, PrefixResolver namespaceContext)
- throws javax.xml.transform.TransformerException
- {
-
- xctxt.pushNamespaceContext(namespaceContext);
-
- xctxt.pushCurrentNodeAndExpression(contextNode, contextNode);
-
- try
- {
- return m_mainExp.bool(xctxt);
- }
- catch (TransformerException te)
- {
- te.setLocator(this.getLocator());
- ErrorListener el = xctxt.getErrorListener();
- if(null != el) // defensive, should never happen.
- {
- el.error(te);
- }
- else
- throw te;
- }
- catch (Exception e)
- {
- while (e instanceof com.sun.org.apache.xml.internal.utils.WrappedRuntimeException)
- {
- e = ((com.sun.org.apache.xml.internal.utils.WrappedRuntimeException) e).getException();
- }
- // e.printStackTrace();
-
- String msg = e.getMessage();
-
- if (msg == null || msg.length() == 0) {
- msg = XSLMessages.createXPATHMessage(
- XPATHErrorResources.ER_XPATH_ERROR, null);
-
- }
-
- TransformerException te = new TransformerException(msg,
- getLocator(), e);
- ErrorListener el = xctxt.getErrorListener();
- // te.printStackTrace();
- if(null != el) // defensive, should never happen.
- {
- el.fatalError(te);
- }
- else
- throw te;
- }
- finally
- {
- xctxt.popNamespaceContext();
-
- xctxt.popCurrentNodeAndExpression();
- }
-
- return false;
- }
-
- /** Set to true to get diagnostic messages about the result of
- * match pattern testing. */
- private static final boolean DEBUG_MATCHES = false;
-
- /**
- * Get the match score of the given node.
- *
- * @param xctxt XPath runtime context.
- * @param context The current source tree context node.
- *
- * @return score, one of {@link #MATCH_SCORE_NODETEST},
- * {@link #MATCH_SCORE_NONE}, {@link #MATCH_SCORE_OTHER},
- * or {@link #MATCH_SCORE_QNAME}.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public double getMatchScore(XPathContext xctxt, int context)
- throws javax.xml.transform.TransformerException
- {
-
- xctxt.pushCurrentNode(context);
- xctxt.pushCurrentExpressionNode(context);
-
- try
- {
- XObject score = m_mainExp.execute(xctxt);
-
- if (DEBUG_MATCHES)
- {
- DTM dtm = xctxt.getDTM(context);
- System.out.println("score: " + score.num() + " for "
- + dtm.getNodeName(context) + " for xpath "
- + this.getPatternString());
- }
-
- return score.num();
- }
- finally
- {
- xctxt.popCurrentNode();
- xctxt.popCurrentExpressionNode();
- }
-
- // return XPath.MATCH_SCORE_NONE;
- }
-
-
- /**
- * Warn the user of an problem.
- *
- * @param xctxt The XPath runtime context.
- * @param sourceNode Not used.
- * @param msg An error msgkey that corresponds to one of the constants found
- * in {@link com.sun.org.apache.xpath.internal.res.XPATHErrorResources}, which is
- * a key for a format string.
- * @param args An array of arguments represented in the format string, which
- * may be null.
- *
- * @throws TransformerException if the current ErrorListoner determines to
- * throw an exception.
- */
- public void warn(
- XPathContext xctxt, int sourceNode, String msg, Object[] args)
- throws javax.xml.transform.TransformerException
- {
-
- String fmsg = XSLMessages.createXPATHWarning(msg, args);
- ErrorListener ehandler = xctxt.getErrorListener();
-
- if (null != ehandler)
- {
-
- // TO DO: Need to get stylesheet Locator from here.
- ehandler.warning(new TransformerException(fmsg, (SAXSourceLocator)xctxt.getSAXLocator()));
- }
- }
-
- /**
- * Tell the user of an assertion error, and probably throw an
- * exception.
- *
- * @param b If false, a runtime exception will be thrown.
- * @param msg The assertion message, which should be informative.
- *
- * @throws RuntimeException if the b argument is false.
- */
- public void assertion(boolean b, String msg)
- {
-
- if (!b)
- {
- String fMsg = XSLMessages.createXPATHMessage(
- XPATHErrorResources.ER_INCORRECT_PROGRAMMER_ASSERTION,
- new Object[]{ msg });
-
- throw new RuntimeException(fMsg);
- }
- }
-
- /**
- * Tell the user of an error, and probably throw an
- * exception.
- *
- * @param xctxt The XPath runtime context.
- * @param sourceNode Not used.
- * @param msg An error msgkey that corresponds to one of the constants found
- * in {@link com.sun.org.apache.xpath.internal.res.XPATHErrorResources}, which is
- * a key for a format string.
- * @param args An array of arguments represented in the format string, which
- * may be null.
- *
- * @throws TransformerException if the current ErrorListoner determines to
- * throw an exception.
- */
- public void error(
- XPathContext xctxt, int sourceNode, String msg, Object[] args)
- throws javax.xml.transform.TransformerException
- {
-
- String fmsg = XSLMessages.createXPATHMessage(msg, args);
- ErrorListener ehandler = xctxt.getErrorListener();
-
- if (null != ehandler)
- {
- ehandler.fatalError(new TransformerException(fmsg,
- (SAXSourceLocator)xctxt.getSAXLocator()));
- }
- else
- {
- SourceLocator slocator = xctxt.getSAXLocator();
- System.out.println(fmsg + "; file " + slocator.getSystemId()
- + "; line " + slocator.getLineNumber() + "; column "
- + slocator.getColumnNumber());
- }
- }
-
- /**
- * This will traverse the heararchy, calling the visitor for
- * each member. If the called visitor method returns
- * false, the subtree should not be called.
- *
- * @param owner The owner of the visitor, where that path may be
- * rewritten if needed.
- * @param visitor The visitor whose appropriate method will be called.
- */
- public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)
- {
- m_mainExp.callVisitors(this, visitor);
- }
-
- /**
- * The match score if no match is made.
- * @xsl.usage advanced
- */
- public static final double MATCH_SCORE_NONE = Double.NEGATIVE_INFINITY;
-
- /**
- * The match score if the pattern has the form
- * of a QName optionally preceded by an @ character.
- * @xsl.usage advanced
- */
- public static final double MATCH_SCORE_QNAME = 0.0;
-
- /**
- * The match score if the pattern pattern has the form NCName:*.
- * @xsl.usage advanced
- */
- public static final double MATCH_SCORE_NSWILD = -0.25;
-
- /**
- * The match score if the pattern consists of just a NodeTest.
- * @xsl.usage advanced
- */
- public static final double MATCH_SCORE_NODETEST = -0.5;
-
- /**
- * The match score if the pattern consists of something
- * other than just a NodeTest or just a qname.
- * @xsl.usage advanced
- */
- public static final double MATCH_SCORE_OTHER = 0.5;
-}
diff --git a/src/com/sun/org/apache/xpath/internal/XPathAPI.java b/src/com/sun/org/apache/xpath/internal/XPathAPI.java
deleted file mode 100644
index fb91d90..0000000
--- a/src/com/sun/org/apache/xpath/internal/XPathAPI.java
+++ /dev/null
@@ -1,285 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XPathAPI.java,v 1.2.4.1 2005/09/10 18:18:23 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal;
-
-import javax.xml.transform.TransformerException;
-
-import com.sun.org.apache.xml.internal.utils.PrefixResolver;
-import com.sun.org.apache.xml.internal.utils.PrefixResolverDefault;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.traversal.NodeIterator;
-
-/**
- * The methods in this class are convenience methods into the
- * low-level XPath API.
- * These functions tend to be a little slow, since a number of objects must be
- * created for each evaluation. A faster way is to precompile the
- * XPaths using the low-level API, and then just use the XPaths
- * over and over.
- *
- * NOTE: In particular, each call to this method will create a new
- * XPathContext, a new DTMManager... and thus a new DTM. That's very
- * safe, since it guarantees that you're always processing against a
- * fully up-to-date view of your document. But it's also portentially
- * very expensive, since you're rebuilding the DTM every time. You should
- * consider using an instance of CachedXPathAPI rather than these static
- * methods.
- *
- * @see <a href="http://www.w3.org/TR/xpath">XPath Specification</a>
- * */
-public class XPathAPI
-{
-
- /**
- * Use an XPath string to select a single node. XPath namespace
- * prefixes are resolved from the context node, which may not
- * be what you want (see the next method).
- *
- * @param contextNode The node to start searching from.
- * @param str A valid XPath string.
- * @return The first node found that matches the XPath, or null.
- *
- * @throws TransformerException
- */
- public static Node selectSingleNode(Node contextNode, String str)
- throws TransformerException
- {
- return selectSingleNode(contextNode, str, contextNode);
- }
-
- /**
- * Use an XPath string to select a single node.
- * XPath namespace prefixes are resolved from the namespaceNode.
- *
- * @param contextNode The node to start searching from.
- * @param str A valid XPath string.
- * @param namespaceNode The node from which prefixes in the XPath will be resolved to namespaces.
- * @return The first node found that matches the XPath, or null.
- *
- * @throws TransformerException
- */
- public static Node selectSingleNode(
- Node contextNode, String str, Node namespaceNode)
- throws TransformerException
- {
-
- // Have the XObject return its result as a NodeSetDTM.
- NodeIterator nl = selectNodeIterator(contextNode, str, namespaceNode);
-
- // Return the first node, or null
- return nl.nextNode();
- }
-
- /**
- * Use an XPath string to select a nodelist.
- * XPath namespace prefixes are resolved from the contextNode.
- *
- * @param contextNode The node to start searching from.
- * @param str A valid XPath string.
- * @return A NodeIterator, should never be null.
- *
- * @throws TransformerException
- */
- public static NodeIterator selectNodeIterator(Node contextNode, String str)
- throws TransformerException
- {
- return selectNodeIterator(contextNode, str, contextNode);
- }
-
- /**
- * Use an XPath string to select a nodelist.
- * XPath namespace prefixes are resolved from the namespaceNode.
- *
- * @param contextNode The node to start searching from.
- * @param str A valid XPath string.
- * @param namespaceNode The node from which prefixes in the XPath will be resolved to namespaces.
- * @return A NodeIterator, should never be null.
- *
- * @throws TransformerException
- */
- public static NodeIterator selectNodeIterator(
- Node contextNode, String str, Node namespaceNode)
- throws TransformerException
- {
-
- // Execute the XPath, and have it return the result
- XObject list = eval(contextNode, str, namespaceNode);
-
- // Have the XObject return its result as a NodeSetDTM.
- return list.nodeset();
- }
-
- /**
- * Use an XPath string to select a nodelist.
- * XPath namespace prefixes are resolved from the contextNode.
- *
- * @param contextNode The node to start searching from.
- * @param str A valid XPath string.
- * @return A NodeIterator, should never be null.
- *
- * @throws TransformerException
- */
- public static NodeList selectNodeList(Node contextNode, String str)
- throws TransformerException
- {
- return selectNodeList(contextNode, str, contextNode);
- }
-
- /**
- * Use an XPath string to select a nodelist.
- * XPath namespace prefixes are resolved from the namespaceNode.
- *
- * @param contextNode The node to start searching from.
- * @param str A valid XPath string.
- * @param namespaceNode The node from which prefixes in the XPath will be resolved to namespaces.
- * @return A NodeIterator, should never be null.
- *
- * @throws TransformerException
- */
- public static NodeList selectNodeList(
- Node contextNode, String str, Node namespaceNode)
- throws TransformerException
- {
-
- // Execute the XPath, and have it return the result
- XObject list = eval(contextNode, str, namespaceNode);
-
- // Return a NodeList.
- return list.nodelist();
- }
-
- /**
- * Evaluate XPath string to an XObject. Using this method,
- * XPath namespace prefixes will be resolved from the namespaceNode.
- * @param contextNode The node to start searching from.
- * @param str A valid XPath string.
- * @return An XObject, which can be used to obtain a string, number, nodelist, etc, should never be null.
- * @see com.sun.org.apache.xpath.internal.objects.XObject
- * @see com.sun.org.apache.xpath.internal.objects.XNull
- * @see com.sun.org.apache.xpath.internal.objects.XBoolean
- * @see com.sun.org.apache.xpath.internal.objects.XNumber
- * @see com.sun.org.apache.xpath.internal.objects.XString
- * @see com.sun.org.apache.xpath.internal.objects.XRTreeFrag
- *
- * @throws TransformerException
- */
- public static XObject eval(Node contextNode, String str)
- throws TransformerException
- {
- return eval(contextNode, str, contextNode);
- }
-
- /**
- * Evaluate XPath string to an XObject.
- * XPath namespace prefixes are resolved from the namespaceNode.
- * The implementation of this is a little slow, since it creates
- * a number of objects each time it is called. This could be optimized
- * to keep the same objects around, but then thread-safety issues would arise.
- *
- * @param contextNode The node to start searching from.
- * @param str A valid XPath string.
- * @param namespaceNode The node from which prefixes in the XPath will be resolved to namespaces.
- * @return An XObject, which can be used to obtain a string, number, nodelist, etc, should never be null.
- * @see com.sun.org.apache.xpath.internal.objects.XObject
- * @see com.sun.org.apache.xpath.internal.objects.XNull
- * @see com.sun.org.apache.xpath.internal.objects.XBoolean
- * @see com.sun.org.apache.xpath.internal.objects.XNumber
- * @see com.sun.org.apache.xpath.internal.objects.XString
- * @see com.sun.org.apache.xpath.internal.objects.XRTreeFrag
- *
- * @throws TransformerException
- */
- public static XObject eval(Node contextNode, String str, Node namespaceNode)
- throws TransformerException
- {
-
- // Since we don't have a XML Parser involved here, install some default support
- // for things like namespaces, etc.
- // (Changed from: XPathContext xpathSupport = new XPathContext();
- // because XPathContext is weak in a number of areas... perhaps
- // XPathContext should be done away with.)
- XPathContext xpathSupport = new XPathContext();
-
- // Create an object to resolve namespace prefixes.
- // XPath namespaces are resolved from the input context node's document element
- // if it is a root node, or else the current context node (for lack of a better
- // resolution space, given the simplicity of this sample code).
- PrefixResolverDefault prefixResolver = new PrefixResolverDefault(
- (namespaceNode.getNodeType() == Node.DOCUMENT_NODE)
- ? ((Document) namespaceNode).getDocumentElement() : namespaceNode);
-
- // Create the XPath object.
- XPath xpath = new XPath(str, null, prefixResolver, XPath.SELECT, null);
-
- // Execute the XPath, and have it return the result
- // return xpath.execute(xpathSupport, contextNode, prefixResolver);
- int ctxtNode = xpathSupport.getDTMHandleFromNode(contextNode);
-
- return xpath.execute(xpathSupport, ctxtNode, prefixResolver);
- }
-
- /**
- * Evaluate XPath string to an XObject.
- * XPath namespace prefixes are resolved from the namespaceNode.
- * The implementation of this is a little slow, since it creates
- * a number of objects each time it is called. This could be optimized
- * to keep the same objects around, but then thread-safety issues would arise.
- *
- * @param contextNode The node to start searching from.
- * @param str A valid XPath string.
- * @param prefixResolver Will be called if the parser encounters namespace
- * prefixes, to resolve the prefixes to URLs.
- * @return An XObject, which can be used to obtain a string, number, nodelist, etc, should never be null.
- * @see com.sun.org.apache.xpath.internal.objects.XObject
- * @see com.sun.org.apache.xpath.internal.objects.XNull
- * @see com.sun.org.apache.xpath.internal.objects.XBoolean
- * @see com.sun.org.apache.xpath.internal.objects.XNumber
- * @see com.sun.org.apache.xpath.internal.objects.XString
- * @see com.sun.org.apache.xpath.internal.objects.XRTreeFrag
- *
- * @throws TransformerException
- */
- public static XObject eval(
- Node contextNode, String str, PrefixResolver prefixResolver)
- throws TransformerException
- {
-
- // Since we don't have a XML Parser involved here, install some default support
- // for things like namespaces, etc.
- // (Changed from: XPathContext xpathSupport = new XPathContext();
- // because XPathContext is weak in a number of areas... perhaps
- // XPathContext should be done away with.)
- // Create the XPath object.
- XPath xpath = new XPath(str, null, prefixResolver, XPath.SELECT, null);
-
- // Execute the XPath, and have it return the result
- XPathContext xpathSupport = new XPathContext();
- int ctxtNode = xpathSupport.getDTMHandleFromNode(contextNode);
-
- return xpath.execute(xpathSupport, ctxtNode, prefixResolver);
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/XPathContext.java b/src/com/sun/org/apache/xpath/internal/XPathContext.java
deleted file mode 100644
index fd5db6f..0000000
--- a/src/com/sun/org/apache/xpath/internal/XPathContext.java
+++ /dev/null
@@ -1,1324 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XPathContext.java,v 1.2.4.2 2005/09/15 01:37:55 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal;
-
-import com.sun.org.apache.xalan.internal.extensions.ExpressionContext;
-import com.sun.org.apache.xalan.internal.res.XSLMessages;
-import com.sun.org.apache.xml.internal.dtm.Axis;
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMFilter;
-import com.sun.org.apache.xml.internal.dtm.DTMIterator;
-import com.sun.org.apache.xml.internal.dtm.DTMManager;
-import com.sun.org.apache.xml.internal.dtm.DTMWSFilter;
-import com.sun.org.apache.xml.internal.dtm.ref.sax2dtm.SAX2RTFDTM;
-import com.sun.org.apache.xml.internal.utils.IntStack;
-import com.sun.org.apache.xml.internal.utils.NodeVector;
-import com.sun.org.apache.xml.internal.utils.ObjectStack;
-import com.sun.org.apache.xml.internal.utils.PrefixResolver;
-import com.sun.org.apache.xml.internal.utils.XMLString;
-import com.sun.org.apache.xpath.internal.axes.SubContextList;
-import com.sun.org.apache.xpath.internal.objects.DTMXRTreeFrag;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-import com.sun.org.apache.xpath.internal.objects.XString;
-import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
-import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Stack;
-import java.util.Vector;
-import javax.xml.transform.ErrorListener;
-import javax.xml.transform.SourceLocator;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.URIResolver;
-import org.xml.sax.XMLReader;
-
-/**
- * Default class for the runtime execution context for XPath.
- *
- * <p>This class extends DTMManager but does not directly implement it.</p>
- * @xsl.usage advanced
- */
-public class XPathContext extends DTMManager // implements ExpressionContext
-{
- IntStack m_last_pushed_rtfdtm=new IntStack();
- /**
- * Stack of cached "reusable" DTMs for Result Tree Fragments.
- * This is a kluge to handle the problem of starting an RTF before
- * the old one is complete.
- *
- * %REVIEW% I'm using a Vector rather than Stack so we can reuse
- * the DTMs if the problem occurs multiple times. I'm not sure that's
- * really a net win versus discarding the DTM and starting a new one...
- * but the retained RTF DTM will have been tail-pruned so should be small.
- */
- private Vector m_rtfdtm_stack=null;
- /** Index of currently active RTF DTM in m_rtfdtm_stack */
- private int m_which_rtfdtm=-1;
-
- /**
- * Most recent "reusable" DTM for Global Result Tree Fragments. No stack is
- * required since we're never going to pop these.
- */
- private SAX2RTFDTM m_global_rtfdtm=null;
-
- /**
- * HashMap of cached the DTMXRTreeFrag objects, which are identified by DTM IDs.
- * The object are just wrappers for DTMs which are used in XRTreeFrag.
- */
- private HashMap m_DTMXRTreeFrags = null;
-
- /**
- * state of the secure processing feature.
- */
- private boolean m_isSecureProcessing = false;
-
- private boolean m_useServicesMechanism = true;
-
- /**
- * Though XPathContext context extends
- * the DTMManager, it really is a proxy for this object, which
- * is the real DTMManager.
- */
- protected DTMManager m_dtmManager = null;
-
- /**
- * Return the DTMManager object. Though XPathContext context extends
- * the DTMManager, it really is a proxy for the real DTMManager. If a
- * caller needs to make a lot of calls to the DTMManager, it is faster
- * if it gets the real one from this function.
- */
- public DTMManager getDTMManager()
- {
- return m_dtmManager;
- }
-
- /**
- * Set the state of the secure processing feature
- */
- public void setSecureProcessing(boolean flag)
- {
- m_isSecureProcessing = flag;
- }
-
- /**
- * Return the state of the secure processing feature
- */
- public boolean isSecureProcessing()
- {
- return m_isSecureProcessing;
- }
-
- /**
- * Get an instance of a DTM, loaded with the content from the
- * specified source. If the unique flag is true, a new instance will
- * always be returned. Otherwise it is up to the DTMManager to return a
- * new instance or an instance that it already created and may be being used
- * by someone else.
- * (I think more parameters will need to be added for error handling, and entity
- * resolution).
- *
- * @param source the specification of the source object, which may be null,
- * in which case it is assumed that node construction will take
- * by some other means.
- * @param unique true if the returned DTM must be unique, probably because it
- * is going to be mutated.
- * @param wsfilter Enables filtering of whitespace nodes, and may be null.
- * @param incremental true if the construction should try and be incremental.
- * @param doIndexing true if the caller considers it worth it to use
- * indexing schemes.
- *
- * @return a non-null DTM reference.
- */
- public DTM getDTM(javax.xml.transform.Source source, boolean unique,
- DTMWSFilter wsfilter,
- boolean incremental,
- boolean doIndexing)
- {
- return m_dtmManager.getDTM(source, unique, wsfilter,
- incremental, doIndexing);
- }
-
- /**
- * Get an instance of a DTM that "owns" a node handle.
- *
- * @param nodeHandle the nodeHandle.
- *
- * @return a non-null DTM reference.
- */
- public DTM getDTM(int nodeHandle)
- {
- return m_dtmManager.getDTM(nodeHandle);
- }
-
- /**
- * Given a W3C DOM node, try and return a DTM handle.
- * Note: calling this may be non-optimal.
- *
- * @param node Non-null reference to a DOM node.
- *
- * @return a valid DTM handle.
- */
- public int getDTMHandleFromNode(org.w3c.dom.Node node)
- {
- return m_dtmManager.getDTMHandleFromNode(node);
- }
-//
-//
- /**
- * %TBD% Doc
- */
- public int getDTMIdentity(DTM dtm)
- {
- return m_dtmManager.getDTMIdentity(dtm);
- }
-//
- /**
- * Creates an empty <code>DocumentFragment</code> object.
- * @return A new <code>DocumentFragment handle</code>.
- */
- public DTM createDocumentFragment()
- {
- return m_dtmManager.createDocumentFragment();
- }
-//
- /**
- * Release a DTM either to a lru pool, or completely remove reference.
- * DTMs without system IDs are always hard deleted.
- * State: experimental.
- *
- * @param dtm The DTM to be released.
- * @param shouldHardDelete True if the DTM should be removed no matter what.
- * @return true if the DTM was removed, false if it was put back in a lru pool.
- */
- public boolean release(DTM dtm, boolean shouldHardDelete)
- {
- // %REVIEW% If it's a DTM which may contain multiple Result Tree
- // Fragments, we can't discard it unless we know not only that it
- // is empty, but that the XPathContext itself is going away. So do
- // _not_ accept the request. (May want to do it as part of
- // reset(), though.)
- if(m_rtfdtm_stack!=null && m_rtfdtm_stack.contains(dtm))
- {
- return false;
- }
-
- return m_dtmManager.release(dtm, shouldHardDelete);
- }
-
- /**
- * Create a new <code>DTMIterator</code> based on an XPath
- * <a href="http://www.w3.org/TR/xpath#NT-LocationPath>LocationPath</a> or
- * a <a href="http://www.w3.org/TR/xpath#NT-UnionExpr">UnionExpr</a>.
- *
- * @param xpathCompiler ??? Somehow we need to pass in a subpart of the
- * expression. I hate to do this with strings, since the larger expression
- * has already been parsed.
- *
- * @param pos The position in the expression.
- * @return The newly created <code>DTMIterator</code>.
- */
- public DTMIterator createDTMIterator(Object xpathCompiler, int pos)
- {
- return m_dtmManager.createDTMIterator(xpathCompiler, pos);
- }
-//
- /**
- * Create a new <code>DTMIterator</code> based on an XPath
- * <a href="http://www.w3.org/TR/xpath#NT-LocationPath>LocationPath</a> or
- * a <a href="http://www.w3.org/TR/xpath#NT-UnionExpr">UnionExpr</a>.
- *
- * @param xpathString Must be a valid string expressing a
- * <a href="http://www.w3.org/TR/xpath#NT-LocationPath>LocationPath</a> or
- * a <a href="http://www.w3.org/TR/xpath#NT-UnionExpr">UnionExpr</a>.
- *
- * @param presolver An object that can resolve prefixes to namespace URLs.
- *
- * @return The newly created <code>DTMIterator</code>.
- */
- public DTMIterator createDTMIterator(String xpathString,
- PrefixResolver presolver)
- {
- return m_dtmManager.createDTMIterator(xpathString, presolver);
- }
-//
- /**
- * Create a new <code>DTMIterator</code> based only on a whatToShow and
- * a DTMFilter. The traversal semantics are defined as the descendant
- * access.
- *
- * @param whatToShow This flag specifies which node types may appear in
- * the logical view of the tree presented by the iterator. See the
- * description of <code>NodeFilter</code> for the set of possible
- * <code>SHOW_</code> values.These flags can be combined using
- * <code>OR</code>.
- * @param filter The <code>NodeFilter</code> to be used with this
- * <code>TreeWalker</code>, or <code>null</code> to indicate no filter.
- * @param entityReferenceExpansion The value of this flag determines
- * whether entity reference nodes are expanded.
- *
- * @return The newly created <code>NodeIterator</code>.
- */
- public DTMIterator createDTMIterator(int whatToShow,
- DTMFilter filter, boolean entityReferenceExpansion)
- {
- return m_dtmManager.createDTMIterator(whatToShow, filter, entityReferenceExpansion);
- }
-
- /**
- * Create a new <code>DTMIterator</code> that holds exactly one node.
- *
- * @param node The node handle that the DTMIterator will iterate to.
- *
- * @return The newly created <code>DTMIterator</code>.
- */
- public DTMIterator createDTMIterator(int node)
- {
- // DescendantIterator iter = new DescendantIterator();
- DTMIterator iter = new com.sun.org.apache.xpath.internal.axes.OneStepIteratorForward(Axis.SELF);
- iter.setRoot(node, this);
- return iter;
- // return m_dtmManager.createDTMIterator(node);
- }
-
- /**
- * Create an XPathContext instance.
- */
- public XPathContext()
- {
- this(true);
- }
-
- public XPathContext(boolean useServicesMechanism) {
- init(useServicesMechanism);
- }
- /**
- **This constructor doesn't seem to be used anywhere -- huizhe wang**
- * Create an XPathContext instance.
- * @param owner Value that can be retrieved via the getOwnerObject() method.
- * @see #getOwnerObject
- */
- public XPathContext(Object owner)
- {
- m_owner = owner;
- try {
- m_ownerGetErrorListener = m_owner.getClass().getMethod("getErrorListener", new Class[] {});
- }
- catch (NoSuchMethodException nsme) {}
- init(true);
- }
-
- private void init(boolean useServicesMechanism) {
- m_prefixResolvers.push(null);
- m_currentNodes.push(DTM.NULL);
- m_currentExpressionNodes.push(DTM.NULL);
- m_saxLocations.push(null);
- m_useServicesMechanism = useServicesMechanism;
- m_dtmManager = DTMManager.newInstance(
- com.sun.org.apache.xpath.internal.objects.XMLStringFactoryImpl.getFactory()
- );
- }
-
- /**
- * Reset for new run.
- */
- public void reset()
- {
- releaseDTMXRTreeFrags();
- // These couldn't be disposed of earlier (see comments in release()); zap them now.
- if(m_rtfdtm_stack!=null)
- for (java.util.Enumeration e = m_rtfdtm_stack.elements() ; e.hasMoreElements() ;)
- m_dtmManager.release((DTM)e.nextElement(), true);
-
- m_rtfdtm_stack=null; // drop our references too
- m_which_rtfdtm=-1;
-
- if(m_global_rtfdtm!=null)
- m_dtmManager.release(m_global_rtfdtm,true);
- m_global_rtfdtm=null;
-
-
- m_dtmManager = DTMManager.newInstance(
- com.sun.org.apache.xpath.internal.objects.XMLStringFactoryImpl.getFactory()
- );
-
- m_saxLocations.removeAllElements();
- m_axesIteratorStack.removeAllElements();
- m_contextNodeLists.removeAllElements();
- m_currentExpressionNodes.removeAllElements();
- m_currentNodes.removeAllElements();
- m_iteratorRoots.RemoveAllNoClear();
- m_predicatePos.removeAllElements();
- m_predicateRoots.RemoveAllNoClear();
- m_prefixResolvers.removeAllElements();
-
- m_prefixResolvers.push(null);
- m_currentNodes.push(DTM.NULL);
- m_currentExpressionNodes.push(DTM.NULL);
- m_saxLocations.push(null);
- }
-
- /** The current stylesheet locator. */
- ObjectStack m_saxLocations = new ObjectStack(RECURSIONLIMIT);
-
- /**
- * Set the current locater in the stylesheet.
- *
- * @param location The location within the stylesheet.
- */
- public void setSAXLocator(SourceLocator location)
- {
- m_saxLocations.setTop(location);
- }
-
- /**
- * Set the current locater in the stylesheet.
- *
- * @param location The location within the stylesheet.
- */
- public void pushSAXLocator(SourceLocator location)
- {
- m_saxLocations.push(location);
- }
-
- /**
- * Push a slot on the locations stack so that setSAXLocator can be
- * repeatedly called.
- *
- */
- public void pushSAXLocatorNull()
- {
- m_saxLocations.push(null);
- }
-
-
- /**
- * Pop the current locater.
- */
- public void popSAXLocator()
- {
- m_saxLocations.pop();
- }
-
- /**
- * Get the current locater in the stylesheet.
- *
- * @return The location within the stylesheet, or null if not known.
- */
- public SourceLocator getSAXLocator()
- {
- return (SourceLocator) m_saxLocations.peek();
- }
-
- /** The owner context of this XPathContext. In the case of XSLT, this will be a
- * Transformer object.
- */
- private Object m_owner;
-
- /** The owner context of this XPathContext. In the case of XSLT, this will be a
- * Transformer object.
- */
- private Method m_ownerGetErrorListener;
-
- /**
- * Get the "owner" context of this context, which should be,
- * in the case of XSLT, the Transformer object. This is needed
- * so that XSLT functions can get the Transformer.
- * @return The owner object passed into the constructor, or null.
- */
- public Object getOwnerObject()
- {
- return m_owner;
- }
-
- // ================ VarStack ===================
-
- /**
- * The stack of Variable stacks. A VariableStack will be
- * pushed onto this stack for each template invocation.
- */
- private VariableStack m_variableStacks = new VariableStack();
-
- /**
- * Get the variable stack, which is in charge of variables and
- * parameters.
- *
- * @return the variable stack, which should not be null.
- */
- public final VariableStack getVarStack()
- {
- return m_variableStacks;
- }
-
- /**
- * Get the variable stack, which is in charge of variables and
- * parameters.
- *
- * @param varStack non-null reference to the variable stack.
- */
- public final void setVarStack(VariableStack varStack)
- {
- m_variableStacks = varStack;
- }
-
- // ================ SourceTreeManager ===================
-
- /** The source tree manager, which associates Source objects to source
- * tree nodes. */
- private SourceTreeManager m_sourceTreeManager = new SourceTreeManager();
-
- /**
- * Get the SourceTreeManager associated with this execution context.
- *
- * @return the SourceTreeManager associated with this execution context.
- */
- public final SourceTreeManager getSourceTreeManager()
- {
- return m_sourceTreeManager;
- }
-
- /**
- * Set the SourceTreeManager associated with this execution context.
- *
- * @param mgr the SourceTreeManager to be associated with this
- * execution context.
- */
- public void setSourceTreeManager(SourceTreeManager mgr)
- {
- m_sourceTreeManager = mgr;
- }
-
- // =================================================
-
- /** The ErrorListener where errors and warnings are to be reported. */
- private ErrorListener m_errorListener;
-
- /** A default ErrorListener in case our m_errorListener was not specified and our
- * owner either does not have an ErrorListener or has a null one.
- */
- private ErrorListener m_defaultErrorListener;
-
- /**
- * Get the ErrorListener where errors and warnings are to be reported.
- *
- * @return A non-null ErrorListener reference.
- */
- public final ErrorListener getErrorListener()
- {
-
- if (null != m_errorListener)
- return m_errorListener;
-
- ErrorListener retval = null;
-
- try {
- if (null != m_ownerGetErrorListener)
- retval = (ErrorListener) m_ownerGetErrorListener.invoke(m_owner, new Object[] {});
- }
- catch (Exception e) {}
-
- if (null == retval)
- {
- if (null == m_defaultErrorListener)
- m_defaultErrorListener = new com.sun.org.apache.xml.internal.utils.DefaultErrorHandler();
- retval = m_defaultErrorListener;
- }
-
- return retval;
- }
-
- /**
- * Set the ErrorListener where errors and warnings are to be reported.
- *
- * @param listener A non-null ErrorListener reference.
- */
- public void setErrorListener(ErrorListener listener) throws IllegalArgumentException
- {
- if (listener == null)
- throw new IllegalArgumentException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_ERROR_HANDLER, null)); //"Null error handler");
- m_errorListener = listener;
- }
-
-
- // =================================================
-
- /** The TrAX URI Resolver for resolving URIs from the document(...)
- * function to source tree nodes. */
- private URIResolver m_uriResolver;
-
- /**
- * Get the URIResolver associated with this execution context.
- *
- * @return a URI resolver, which may be null.
- */
- public final URIResolver getURIResolver()
- {
- return m_uriResolver;
- }
-
- /**
- * Set the URIResolver associated with this execution context.
- *
- * @param resolver the URIResolver to be associated with this
- * execution context, may be null to clear an already set resolver.
- */
- public void setURIResolver(URIResolver resolver)
- {
- m_uriResolver = resolver;
- }
-
- // =================================================
-
- /** The reader of the primary source tree. */
- public XMLReader m_primaryReader;
-
- /**
- * Get primary XMLReader associated with this execution context.
- *
- * @return The reader of the primary source tree.
- */
- public final XMLReader getPrimaryReader()
- {
- return m_primaryReader;
- }
-
- /**
- * Set primary XMLReader associated with this execution context.
- *
- * @param reader The reader of the primary source tree.
- */
- public void setPrimaryReader(XMLReader reader)
- {
- m_primaryReader = reader;
- }
-
- // =================================================
-
-
- /** Misnamed string manager for XPath messages. */
- // private static XSLMessages m_XSLMessages = new XSLMessages();
-
- //==========================================================
- // SECTION: Execution context state tracking
- //==========================================================
-
- /**
- * The current context node list.
- */
- private Stack m_contextNodeLists = new Stack();
-
- public Stack getContextNodeListsStack() { return m_contextNodeLists; }
- public void setContextNodeListsStack(Stack s) { m_contextNodeLists = s; }
-
- /**
- * Get the current context node list.
- *
- * @return the <a href="http://www.w3.org/TR/xslt#dt-current-node-list">current node list</a>,
- * also referred to here as a <term>context node list</term>.
- */
- public final DTMIterator getContextNodeList()
- {
-
- if (m_contextNodeLists.size() > 0)
- return (DTMIterator) m_contextNodeLists.peek();
- else
- return null;
- }
-
- /**
- * Set the current context node list.
- *
- * @param nl the <a href="http://www.w3.org/TR/xslt#dt-current-node-list">current node list</a>,
- * also referred to here as a <term>context node list</term>.
- * @xsl.usage internal
- */
- public final void pushContextNodeList(DTMIterator nl)
- {
- m_contextNodeLists.push(nl);
- }
-
- /**
- * Pop the current context node list.
- * @xsl.usage internal
- */
- public final void popContextNodeList()
- {
- if(m_contextNodeLists.isEmpty())
- System.err.println("Warning: popContextNodeList when stack is empty!");
- else
- m_contextNodeLists.pop();
- }
-
- /**
- * The amount to use for stacks that record information during the
- * recursive execution.
- */
- public static final int RECURSIONLIMIT = (1024*4);
-
- /** The stack of <a href="http://www.w3.org/TR/xslt#dt-current-node">current node</a> objects.
- * Not to be confused with the current node list. %REVIEW% Note that there
- * are no bounds check and resize for this stack, so if it is blown, it's all
- * over. */
- private IntStack m_currentNodes = new IntStack(RECURSIONLIMIT);
-
-// private NodeVector m_currentNodes = new NodeVector();
-
- public IntStack getCurrentNodeStack() {return m_currentNodes; }
- public void setCurrentNodeStack(IntStack nv) { m_currentNodes = nv; }
-
- /**
- * Get the current context node.
- *
- * @return the <a href="http://www.w3.org/TR/xslt#dt-current-node">current node</a>.
- */
- public final int getCurrentNode()
- {
- return m_currentNodes.peek();
- }
-
- /**
- * Set the current context node and expression node.
- *
- * @param cn the <a href="http://www.w3.org/TR/xslt#dt-current-node">current node</a>.
- * @param en the sub-expression context node.
- */
- public final void pushCurrentNodeAndExpression(int cn, int en)
- {
- m_currentNodes.push(cn);
- m_currentExpressionNodes.push(cn);
- }
-
- /**
- * Set the current context node.
- */
- public final void popCurrentNodeAndExpression()
- {
- m_currentNodes.quickPop(1);
- m_currentExpressionNodes.quickPop(1);
- }
-
- /**
- * Push the current context node, expression node, and prefix resolver.
- *
- * @param cn the <a href="http://www.w3.org/TR/xslt#dt-current-node">current node</a>.
- * @param en the sub-expression context node.
- * @param nc the namespace context (prefix resolver.
- */
- public final void pushExpressionState(int cn, int en, PrefixResolver nc)
- {
- m_currentNodes.push(cn);
- m_currentExpressionNodes.push(cn);
- m_prefixResolvers.push(nc);
- }
-
- /**
- * Pop the current context node, expression node, and prefix resolver.
- */
- public final void popExpressionState()
- {
- m_currentNodes.quickPop(1);
- m_currentExpressionNodes.quickPop(1);
- m_prefixResolvers.pop();
- }
-
-
-
- /**
- * Set the current context node.
- *
- * @param n the <a href="http://www.w3.org/TR/xslt#dt-current-node">current node</a>.
- */
- public final void pushCurrentNode(int n)
- {
- m_currentNodes.push(n);
- }
-
- /**
- * Pop the current context node.
- */
- public final void popCurrentNode()
- {
- m_currentNodes.quickPop(1);
- }
-
- /**
- * Set the current predicate root.
- */
- public final void pushPredicateRoot(int n)
- {
- m_predicateRoots.push(n);
- }
-
- /**
- * Pop the current predicate root.
- */
- public final void popPredicateRoot()
- {
- m_predicateRoots.popQuick();
- }
-
- /**
- * Get the current predicate root.
- */
- public final int getPredicateRoot()
- {
- return m_predicateRoots.peepOrNull();
- }
-
- /**
- * Set the current location path iterator root.
- */
- public final void pushIteratorRoot(int n)
- {
- m_iteratorRoots.push(n);
- }
-
- /**
- * Pop the current location path iterator root.
- */
- public final void popIteratorRoot()
- {
- m_iteratorRoots.popQuick();
- }
-
- /**
- * Get the current location path iterator root.
- */
- public final int getIteratorRoot()
- {
- return m_iteratorRoots.peepOrNull();
- }
-
- /** A stack of the current sub-expression nodes. */
- private NodeVector m_iteratorRoots = new NodeVector();
-
- /** A stack of the current sub-expression nodes. */
- private NodeVector m_predicateRoots = new NodeVector();
-
- /** A stack of the current sub-expression nodes. */
- private IntStack m_currentExpressionNodes = new IntStack(RECURSIONLIMIT);
-
-
- public IntStack getCurrentExpressionNodeStack() { return m_currentExpressionNodes; }
- public void setCurrentExpressionNodeStack(IntStack nv) { m_currentExpressionNodes = nv; }
-
- private IntStack m_predicatePos = new IntStack();
-
- public final int getPredicatePos()
- {
- return m_predicatePos.peek();
- }
-
- public final void pushPredicatePos(int n)
- {
- m_predicatePos.push(n);
- }
-
- public final void popPredicatePos()
- {
- m_predicatePos.pop();
- }
-
- /**
- * Get the current node that is the expression's context (i.e. for current() support).
- *
- * @return The current sub-expression node.
- */
- public final int getCurrentExpressionNode()
- {
- return m_currentExpressionNodes.peek();
- }
-
- /**
- * Set the current node that is the expression's context (i.e. for current() support).
- *
- * @param n The sub-expression node to be current.
- */
- public final void pushCurrentExpressionNode(int n)
- {
- m_currentExpressionNodes.push(n);
- }
-
- /**
- * Pop the current node that is the expression's context
- * (i.e. for current() support).
- */
- public final void popCurrentExpressionNode()
- {
- m_currentExpressionNodes.quickPop(1);
- }
-
- private ObjectStack m_prefixResolvers
- = new ObjectStack(RECURSIONLIMIT);
-
- /**
- * Get the current namespace context for the xpath.
- *
- * @return the current prefix resolver for resolving prefixes to
- * namespace URLs.
- */
- public final PrefixResolver getNamespaceContext()
- {
- return (PrefixResolver) m_prefixResolvers.peek();
- }
-
- /**
- * Get the current namespace context for the xpath.
- *
- * @param pr the prefix resolver to be used for resolving prefixes to
- * namespace URLs.
- */
- public final void setNamespaceContext(PrefixResolver pr)
- {
- m_prefixResolvers.setTop(pr);
- }
-
- /**
- * Push a current namespace context for the xpath.
- *
- * @param pr the prefix resolver to be used for resolving prefixes to
- * namespace URLs.
- */
- public final void pushNamespaceContext(PrefixResolver pr)
- {
- m_prefixResolvers.push(pr);
- }
-
- /**
- * Just increment the namespace contest stack, so that setNamespaceContext
- * can be used on the slot.
- */
- public final void pushNamespaceContextNull()
- {
- m_prefixResolvers.push(null);
- }
-
- /**
- * Pop the current namespace context for the xpath.
- */
- public final void popNamespaceContext()
- {
- m_prefixResolvers.pop();
- }
-
- //==========================================================
- // SECTION: Current TreeWalker contexts (for internal use)
- //==========================================================
-
- /**
- * Stack of AxesIterators.
- */
- private Stack m_axesIteratorStack = new Stack();
-
- public Stack getAxesIteratorStackStacks() { return m_axesIteratorStack; }
- public void setAxesIteratorStackStacks(Stack s) { m_axesIteratorStack = s; }
-
- /**
- * Push a TreeWalker on the stack.
- *
- * @param iter A sub-context AxesWalker.
- * @xsl.usage internal
- */
- public final void pushSubContextList(SubContextList iter)
- {
- m_axesIteratorStack.push(iter);
- }
-
- /**
- * Pop the last pushed axes iterator.
- * @xsl.usage internal
- */
- public final void popSubContextList()
- {
- m_axesIteratorStack.pop();
- }
-
- /**
- * Get the current axes iterator, or return null if none.
- *
- * @return the sub-context node list.
- * @xsl.usage internal
- */
- public SubContextList getSubContextList()
- {
- return m_axesIteratorStack.isEmpty()
- ? null : (SubContextList) m_axesIteratorStack.peek();
- }
-
- /**
- * Get the <a href="http://www.w3.org/TR/xslt#dt-current-node-list">current node list</a>
- * as defined by the XSLT spec.
- *
- * @return the <a href="http://www.w3.org/TR/xslt#dt-current-node-list">current node list</a>.
- * @xsl.usage internal
- */
-
- public com.sun.org.apache.xpath.internal.axes.SubContextList getCurrentNodeList()
- {
- return m_axesIteratorStack.isEmpty()
- ? null : (SubContextList) m_axesIteratorStack.elementAt(0);
- }
- //==========================================================
- // SECTION: Implementation of ExpressionContext interface
- //==========================================================
-
- /**
- * Get the current context node.
- * @return The current context node.
- */
- public final int getContextNode()
- {
- return this.getCurrentNode();
- }
-
- /**
- * Get the current context node list.
- * @return An iterator for the current context list, as
- * defined in XSLT.
- */
- public final DTMIterator getContextNodes()
- {
-
- try
- {
- DTMIterator cnl = getContextNodeList();
-
- if (null != cnl)
- return cnl.cloneWithReset();
- else
- return null; // for now... this might ought to be an empty iterator.
- }
- catch (CloneNotSupportedException cnse)
- {
- return null; // error reporting?
- }
- }
-
- XPathExpressionContext expressionContext = new XPathExpressionContext();
-
- /**
- * The the expression context for extensions for this context.
- *
- * @return An object that implements the ExpressionContext.
- */
- public ExpressionContext getExpressionContext()
- {
- return expressionContext;
- }
-
- public class XPathExpressionContext implements ExpressionContext
- {
- /**
- * Return the XPathContext associated with this XPathExpressionContext.
- * Extensions should use this judiciously and only when special processing
- * requirements cannot be met another way. Consider requesting an enhancement
- * to the ExpressionContext interface to avoid having to call this method.
- * @return the XPathContext associated with this XPathExpressionContext.
- */
- public XPathContext getXPathContext()
- {
- return XPathContext.this;
- }
-
- /**
- * Return the DTMManager object. Though XPathContext context extends
- * the DTMManager, it really is a proxy for the real DTMManager. If a
- * caller needs to make a lot of calls to the DTMManager, it is faster
- * if it gets the real one from this function.
- */
- public DTMManager getDTMManager()
- {
- return m_dtmManager;
- }
-
- /**
- * Get the current context node.
- * @return The current context node.
- */
- public org.w3c.dom.Node getContextNode()
- {
- int context = getCurrentNode();
-
- return getDTM(context).getNode(context);
- }
-
- /**
- * Get the current context node list.
- * @return An iterator for the current context list, as
- * defined in XSLT.
- */
- public org.w3c.dom.traversal.NodeIterator getContextNodes()
- {
- return new com.sun.org.apache.xml.internal.dtm.ref.DTMNodeIterator(getContextNodeList());
- }
-
- /**
- * Get the error listener.
- * @return The registered error listener.
- */
- public ErrorListener getErrorListener()
- {
- return XPathContext.this.getErrorListener();
- }
- /**
- * Return the state of the services mechanism feature.
- */
- public boolean useServicesMechnism() {
- return m_useServicesMechanism;
- }
-
- /**
- * Set the state of the services mechanism feature.
- */
- public void setServicesMechnism(boolean flag) {
- m_useServicesMechanism = flag;
- }
-
- /**
- * Get the value of a node as a number.
- * @param n Node to be converted to a number. May be null.
- * @return value of n as a number.
- */
- public double toNumber(org.w3c.dom.Node n)
- {
- // %REVIEW% You can't get much uglier than this...
- int nodeHandle = getDTMHandleFromNode(n);
- DTM dtm = getDTM(nodeHandle);
- XString xobj = (XString)dtm.getStringValue(nodeHandle);
- return xobj.num();
- }
-
- /**
- * Get the value of a node as a string.
- * @param n Node to be converted to a string. May be null.
- * @return value of n as a string, or an empty string if n is null.
- */
- public String toString(org.w3c.dom.Node n)
- {
- // %REVIEW% You can't get much uglier than this...
- int nodeHandle = getDTMHandleFromNode(n);
- DTM dtm = getDTM(nodeHandle);
- XMLString strVal = dtm.getStringValue(nodeHandle);
- return strVal.toString();
- }
-
- /**
- * Get a variable based on it's qualified name.
- * @param qname The qualified name of the variable.
- * @return The evaluated value of the variable.
- * @throws javax.xml.transform.TransformerException
- */
-
- public final XObject getVariableOrParam(com.sun.org.apache.xml.internal.utils.QName qname)
- throws javax.xml.transform.TransformerException
- {
- return m_variableStacks.getVariableOrParam(XPathContext.this, qname);
- }
-
- }
-
- /**
- * Get a DTM to be used as a container for a global Result Tree
- * Fragment. This will always be an instance of (derived from? equivalent to?)
- * SAX2DTM, since each RTF is constructed by temporarily redirecting our SAX
- * output to it. It may be a single DTM containing for multiple fragments,
- * if the implementation supports that.
- *
- * Note: The distinction between this method and getRTFDTM() is that the latter
- * allocates space from the dynamic variable stack (m_rtfdtm_stack), which may
- * be pruned away again as the templates which defined those variables are exited.
- * Global variables may be bound late (see XUnresolvedVariable), and never want to
- * be discarded, hence we need to allocate them separately and don't actually need
- * a stack to track them.
- *
- * @return a non-null DTM reference.
- */
- public DTM getGlobalRTFDTM()
- {
- // We probably should _NOT_ be applying whitespace filtering at this stage!
- //
- // Some magic has been applied in DTMManagerDefault to recognize this set of options
- // and generate an instance of DTM which can contain multiple documents
- // (SAX2RTFDTM). Perhaps not the optimal way of achieving that result, but
- // I didn't want to change the manager API at this time, or expose
- // too many dependencies on its internals. (Ideally, I'd like to move
- // isTreeIncomplete all the way up to DTM, so we wouldn't need to explicitly
- // specify the subclass here.)
-
- // If it doesn't exist, or if the one already existing is in the middle of
- // being constructed, we need to obtain a new DTM to write into. I'm not sure
- // the latter will ever arise, but I'd rather be just a bit paranoid..
- if( m_global_rtfdtm==null || m_global_rtfdtm.isTreeIncomplete() )
- {
- m_global_rtfdtm=(SAX2RTFDTM)m_dtmManager.getDTM(null,true,null,false,false);
- }
- return m_global_rtfdtm;
- }
-
-
-
-
- /**
- * Get a DTM to be used as a container for a dynamic Result Tree
- * Fragment. This will always be an instance of (derived from? equivalent to?)
- * SAX2DTM, since each RTF is constructed by temporarily redirecting our SAX
- * output to it. It may be a single DTM containing for multiple fragments,
- * if the implementation supports that.
- *
- * @return a non-null DTM reference.
- */
- public DTM getRTFDTM()
- {
- SAX2RTFDTM rtfdtm;
-
- // We probably should _NOT_ be applying whitespace filtering at this stage!
- //
- // Some magic has been applied in DTMManagerDefault to recognize this set of options
- // and generate an instance of DTM which can contain multiple documents
- // (SAX2RTFDTM). Perhaps not the optimal way of achieving that result, but
- // I didn't want to change the manager API at this time, or expose
- // too many dependencies on its internals. (Ideally, I'd like to move
- // isTreeIncomplete all the way up to DTM, so we wouldn't need to explicitly
- // specify the subclass here.)
-
- if(m_rtfdtm_stack==null)
- {
- m_rtfdtm_stack=new Vector();
- rtfdtm=(SAX2RTFDTM)m_dtmManager.getDTM(null,true,null,false,false);
- m_rtfdtm_stack.addElement(rtfdtm);
- ++m_which_rtfdtm;
- }
- else if(m_which_rtfdtm<0)
- {
- rtfdtm=(SAX2RTFDTM)m_rtfdtm_stack.elementAt(++m_which_rtfdtm);
- }
- else
- {
- rtfdtm=(SAX2RTFDTM)m_rtfdtm_stack.elementAt(m_which_rtfdtm);
-
- // It might already be under construction -- the classic example would be
- // an xsl:variable which uses xsl:call-template as part of its value. To
- // handle this recursion, we have to start a new RTF DTM, pushing the old
- // one onto a stack so we can return to it. This is not as uncommon a case
- // as we might wish, unfortunately, as some folks insist on coding XSLT
- // as if it were a procedural language...
- if(rtfdtm.isTreeIncomplete())
- {
- if(++m_which_rtfdtm < m_rtfdtm_stack.size())
- rtfdtm=(SAX2RTFDTM)m_rtfdtm_stack.elementAt(m_which_rtfdtm);
- else
- {
- rtfdtm=(SAX2RTFDTM)m_dtmManager.getDTM(null,true,null,false,false);
- m_rtfdtm_stack.addElement(rtfdtm);
- }
- }
- }
-
- return rtfdtm;
- }
-
- /** Push the RTFDTM's context mark, to allows discarding RTFs added after this
- * point. (If it doesn't exist we don't push, since we might still be able to
- * get away with not creating it. That requires that excessive pops be harmless.)
- * */
- public void pushRTFContext()
- {
- m_last_pushed_rtfdtm.push(m_which_rtfdtm);
- if(null!=m_rtfdtm_stack)
- ((SAX2RTFDTM)(getRTFDTM())).pushRewindMark();
- }
-
- /** Pop the RTFDTM's context mark. This discards any RTFs added after the last
- * mark was set.
- *
- * If there is no RTF DTM, there's nothing to pop so this
- * becomes a no-op. If pushes were issued before this was called, we count on
- * the fact that popRewindMark is defined such that overpopping just resets
- * to empty.
- *
- * Complicating factor: We need to handle the case of popping back to a previous
- * RTF DTM, if one of the weird produce-an-RTF-to-build-an-RTF cases arose.
- * Basically: If pop says this DTM is now empty, then return to the previous
- * if one exists, in whatever state we left it in. UGLY, but hopefully the
- * situation which forces us to consider this will arise exceedingly rarely.
- * */
- public void popRTFContext()
- {
- int previous=m_last_pushed_rtfdtm.pop();
- if(null==m_rtfdtm_stack)
- return;
-
- if(m_which_rtfdtm==previous)
- {
- if(previous>=0) // guard against none-active
- {
- boolean isEmpty=((SAX2RTFDTM)(m_rtfdtm_stack.elementAt(previous))).popRewindMark();
- }
- }
- else while(m_which_rtfdtm!=previous)
- {
- // Empty each DTM before popping, so it's ready for reuse
- // _DON'T_ pop the previous, since it's still open (which is why we
- // stacked up more of these) and did not receive a mark.
- boolean isEmpty=((SAX2RTFDTM)(m_rtfdtm_stack.elementAt(m_which_rtfdtm))).popRewindMark();
- --m_which_rtfdtm;
- }
- }
-
- /**
- * Gets DTMXRTreeFrag object if one has already been created.
- * Creates new DTMXRTreeFrag object and adds to m_DTMXRTreeFrags HashMap,
- * otherwise.
- * @param dtmIdentity
- * @return DTMXRTreeFrag
- */
- public DTMXRTreeFrag getDTMXRTreeFrag(int dtmIdentity){
- if(m_DTMXRTreeFrags == null){
- m_DTMXRTreeFrags = new HashMap();
- }
-
- if(m_DTMXRTreeFrags.containsKey(new Integer(dtmIdentity))){
- return (DTMXRTreeFrag)m_DTMXRTreeFrags.get(new Integer(dtmIdentity));
- }else{
- final DTMXRTreeFrag frag = new DTMXRTreeFrag(dtmIdentity,this);
- m_DTMXRTreeFrags.put(new Integer(dtmIdentity),frag);
- return frag ;
- }
- }
-
- /**
- * Cleans DTMXRTreeFrag objects by removing references
- * to DTM and XPathContext objects.
- */
- private final void releaseDTMXRTreeFrags(){
- if(m_DTMXRTreeFrags == null){
- return;
- }
- final Iterator iter = (m_DTMXRTreeFrags.values()).iterator();
- while(iter.hasNext()){
- DTMXRTreeFrag frag = (DTMXRTreeFrag)iter.next();
- frag.destruct();
- iter.remove();
- }
- m_DTMXRTreeFrags = null;
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/XPathException.java b/src/com/sun/org/apache/xpath/internal/XPathException.java
deleted file mode 100644
index ef1f8bb..0000000
--- a/src/com/sun/org/apache/xpath/internal/XPathException.java
+++ /dev/null
@@ -1,330 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XPathException.java,v 1.3 2005/09/28 13:49:30 pvedula Exp $
- */
-package com.sun.org.apache.xpath.internal;
-
-import javax.xml.transform.TransformerException;
-
-import org.w3c.dom.Node;
-
-/**
- * This class implements an exception object that all
- * XPath classes will throw in case of an error. This class
- * extends TransformerException, and may hold other exceptions. In the
- * case of nested exceptions, printStackTrace will dump
- * all the traces of the nested exceptions, not just the trace
- * of this object.
- * @xsl.usage general
- */
-public class XPathException extends TransformerException
-{
- static final long serialVersionUID = 4263549717619045963L;
-
- /** The home of the expression that caused the error.
- * @serial */
- Object m_styleNode = null;
-
- /**
- * Get the stylesheet node from where this error originated.
- * @return The stylesheet node from where this error originated, or null.
- */
- public Object getStylesheetNode()
- {
- return m_styleNode;
- }
-
- /**
- * Set the stylesheet node from where this error originated.
- * @param styleNode The stylesheet node from where this error originated, or null.
- */
- public void setStylesheetNode(Object styleNode)
- {
- m_styleNode = styleNode;
- }
-
-
- /** A nested exception.
- * @serial */
- protected Exception m_exception;
-
- /**
- * Create an XPathException object that holds
- * an error message.
- * @param message The error message.
- */
- public XPathException(String message, ExpressionNode ex)
- {
- super(message);
- this.setLocator(ex);
- setStylesheetNode(getStylesheetNode(ex));
- }
-
- /**
- * Create an XPathException object that holds
- * an error message.
- * @param message The error message.
- */
- public XPathException(String message)
- {
- super(message);
- }
-
-
- /**
- * Get the XSLT ElemVariable that this sub-expression references. In order for
- * this to work, the SourceLocator must be the owning ElemTemplateElement.
- * @return The dereference to the ElemVariable, or null if not found.
- */
- public org.w3c.dom.Node getStylesheetNode(ExpressionNode ex)
- {
-
- ExpressionNode owner = getExpressionOwner(ex);
-
- if (null != owner && owner instanceof org.w3c.dom.Node)
- {
- return ((org.w3c.dom.Node)owner);
- }
- return null;
-
- }
-
- /**
- * Get the first non-Expression parent of this node.
- * @return null or first ancestor that is not an Expression.
- */
- protected ExpressionNode getExpressionOwner(ExpressionNode ex)
- {
- ExpressionNode parent = ex.exprGetParent();
- while((null != parent) && (parent instanceof Expression))
- parent = parent.exprGetParent();
- return parent;
- }
-
-
-
- /**
- * Create an XPathException object that holds
- * an error message and the stylesheet node that
- * the error originated from.
- * @param message The error message.
- * @param styleNode The stylesheet node that the error originated from.
- */
- public XPathException(String message, Object styleNode)
- {
-
- super(message);
-
- m_styleNode = styleNode;
- }
-
- /**
- * Create an XPathException object that holds
- * an error message, the stylesheet node that
- * the error originated from, and another exception
- * that caused this exception.
- * @param message The error message.
- * @param styleNode The stylesheet node that the error originated from.
- * @param e The exception that caused this exception.
- */
- public XPathException(String message, Node styleNode, Exception e)
- {
-
- super(message);
-
- m_styleNode = styleNode;
- this.m_exception = e;
- }
-
- /**
- * Create an XPathException object that holds
- * an error message, and another exception
- * that caused this exception.
- * @param message The error message.
- * @param e The exception that caused this exception.
- */
- public XPathException(String message, Exception e)
- {
-
- super(message);
-
- this.m_exception = e;
- }
-
- /**
- * Print the the trace of methods from where the error
- * originated. This will trace all nested exception
- * objects, as well as this object.
- * @param s The stream where the dump will be sent to.
- */
- public void printStackTrace(java.io.PrintStream s)
- {
-
- if (s == null)
- s = System.err;
-
- try
- {
- super.printStackTrace(s);
- }
- catch (Exception e){}
-
- Throwable exception = m_exception;
-
- for (int i = 0; (i < 10) && (null != exception); i++)
- {
- s.println("---------");
- exception.printStackTrace(s);
-
- if (exception instanceof TransformerException)
- {
- TransformerException se = (TransformerException) exception;
- Throwable prev = exception;
-
- exception = se.getException();
-
- if (prev == exception)
- break;
- }
- else
- {
- exception = null;
- }
- }
- }
-
- /**
- * Find the most contained message.
- *
- * @return The error message of the originating exception.
- */
- public String getMessage()
- {
-
- String lastMessage = super.getMessage();
- Throwable exception = m_exception;
-
- while (null != exception)
- {
- String nextMessage = exception.getMessage();
-
- if (null != nextMessage)
- lastMessage = nextMessage;
-
- if (exception instanceof TransformerException)
- {
- TransformerException se = (TransformerException) exception;
- Throwable prev = exception;
-
- exception = se.getException();
-
- if (prev == exception)
- break;
- }
- else
- {
- exception = null;
- }
- }
-
- return (null != lastMessage) ? lastMessage : "";
- }
-
- /**
- * Print the the trace of methods from where the error
- * originated. This will trace all nested exception
- * objects, as well as this object.
- * @param s The writer where the dump will be sent to.
- */
- public void printStackTrace(java.io.PrintWriter s)
- {
-
- if (s == null)
- s = new java.io.PrintWriter(System.err);
-
- try
- {
- super.printStackTrace(s);
- }
- catch (Exception e){}
-
-
- boolean isJdk14OrHigher = false;
- try {
- Throwable.class.getMethod("getCause", (Class[]) null);
- isJdk14OrHigher = true;
- } catch (NoSuchMethodException nsme) {
- // do nothing
- }
-
- // The printStackTrace method of the Throwable class in jdk 1.4
- // and higher will include the cause when printing the backtrace.
- // The following code is only required when using jdk 1.3 or lower
- if (!isJdk14OrHigher) {
-
- Throwable exception = m_exception;
-
- for (int i = 0; (i < 10) && (null != exception); i++)
- {
- s.println("---------");
-
- try
- {
- exception.printStackTrace(s);
- }
- catch (Exception e)
- {
- s.println("Could not print stack trace...");
- }
-
- if (exception instanceof TransformerException)
- {
- TransformerException se = (TransformerException) exception;
- Throwable prev = exception;
-
- exception = se.getException();
-
- if (prev == exception)
- {
- exception = null;
-
- break;
- }
- }
- else
- {
- exception = null;
- }
- }
- }
- }
-
- /**
- * Return the embedded exception, if any.
- * Overrides javax.xml.transform.TransformerException.getException().
- *
- * @return The embedded exception, or null if there is none.
- */
- public Throwable getException()
- {
- return m_exception;
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/XPathFactory.java b/src/com/sun/org/apache/xpath/internal/XPathFactory.java
deleted file mode 100644
index bb5061b..0000000
--- a/src/com/sun/org/apache/xpath/internal/XPathFactory.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XPathFactory.java,v 1.1.2.1 2005/08/01 01:30:14 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal;
-
-import javax.xml.transform.SourceLocator;
-
-import com.sun.org.apache.xml.internal.utils.PrefixResolver;
-
-/**
- * Factory class for creating an XPath. Implementors of XPath derivatives
- * will need to make a derived class of this.
- * @xsl.usage advanced
- */
-public interface XPathFactory
-{
-
- /**
- * Create an XPath.
- *
- * @param exprString The XPath expression string.
- * @param locator The location of the expression string, mainly for diagnostic
- * purposes.
- * @param prefixResolver This will be called in order to resolve prefixes
- * to namespace URIs.
- * @param type One of {@link com.sun.org.apache.xpath.internal.XPath#SELECT} or
- * {@link com.sun.org.apache.xpath.internal.XPath#MATCH}.
- *
- * @return an XPath ready for execution.
- */
- XPath create(String exprString, SourceLocator locator,
- PrefixResolver prefixResolver, int type);
-}
diff --git a/src/com/sun/org/apache/xpath/internal/XPathProcessorException.java b/src/com/sun/org/apache/xpath/internal/XPathProcessorException.java
deleted file mode 100644
index f7728ee..0000000
--- a/src/com/sun/org/apache/xpath/internal/XPathProcessorException.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XPathProcessorException.java,v 1.2.4.1 2005/09/15 01:42:45 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal;
-
-/**
- * Derived from XPathException in order that XPath processor
- * exceptions may be specifically caught.
- * @xsl.usage general
- */
-public class XPathProcessorException extends XPathException
-{
- static final long serialVersionUID = 1215509418326642603L;
-
- /**
- * Create an XPathProcessorException object that holds
- * an error message.
- * @param message The error message.
- */
- public XPathProcessorException(String message)
- {
- super(message);
- }
-
-
- /**
- * Create an XPathProcessorException object that holds
- * an error message, and another exception
- * that caused this exception.
- * @param message The error message.
- * @param e The exception that caused this exception.
- */
- public XPathProcessorException(String message, Exception e)
- {
- super(message, e);
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/XPathVisitable.java b/src/com/sun/org/apache/xpath/internal/XPathVisitable.java
deleted file mode 100644
index bfa8470..0000000
--- a/src/com/sun/org/apache/xpath/internal/XPathVisitable.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2002-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XPathVisitable.java,v 1.1.2.1 2005/08/01 01:30:13 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal;
-
-/**
- * A class that implements this interface will call a XPathVisitor
- * for itself and members within it's heararchy. If the XPathVisitor's
- * method returns false, the sub-member heararchy will not be
- * traversed.
- */
-public interface XPathVisitable
-{
- /**
- * This will traverse the heararchy, calling the visitor for
- * each member. If the called visitor method returns
- * false, the subtree should not be called.
- *
- * @param owner The owner of the visitor, where that path may be
- * rewritten if needed.
- * @param visitor The visitor whose appropriate method will be called.
- */
- public void callVisitors(ExpressionOwner owner, XPathVisitor visitor);
-}
diff --git a/src/com/sun/org/apache/xpath/internal/XPathVisitor.java b/src/com/sun/org/apache/xpath/internal/XPathVisitor.java
deleted file mode 100644
index 8a909eb..0000000
--- a/src/com/sun/org/apache/xpath/internal/XPathVisitor.java
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2002-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XPathVisitor.java,v 1.1.2.1 2005/08/01 01:30:11 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal;
-
-import com.sun.org.apache.xpath.internal.axes.LocPathIterator;
-import com.sun.org.apache.xpath.internal.axes.UnionPathIterator;
-import com.sun.org.apache.xpath.internal.functions.Function;
-import com.sun.org.apache.xpath.internal.objects.XNumber;
-import com.sun.org.apache.xpath.internal.objects.XString;
-import com.sun.org.apache.xpath.internal.operations.Operation;
-import com.sun.org.apache.xpath.internal.operations.UnaryOperation;
-import com.sun.org.apache.xpath.internal.operations.Variable;
-import com.sun.org.apache.xpath.internal.patterns.NodeTest;
-import com.sun.org.apache.xpath.internal.patterns.StepPattern;
-import com.sun.org.apache.xpath.internal.patterns.UnionPattern;
-
-/**
- * A derivation from this class can be passed to a class that implements
- * the XPathVisitable interface, to have the appropriate method called
- * for each component of the XPath. Aside from possible other uses, the
- * main intention is to provide a reasonable means to perform expression
- * rewriting.
- *
- * <p>Each method has the form
- * <code>boolean visitComponentType(ExpressionOwner owner, ComponentType compType)</code>.
- * The ExpressionOwner argument is the owner of the component, and can
- * be used to reset the expression for rewriting. If a method returns
- * false, the sub hierarchy will not be traversed.</p>
- *
- * <p>This class is meant to be a base class that will be derived by concrete classes,
- * and doesn't much except return true for each method.</p>
- */
-public class XPathVisitor
-{
- /**
- * Visit a LocationPath.
- * @param owner The owner of the expression, to which the expression can
- * be reset if rewriting takes place.
- * @param path The LocationPath object.
- * @return true if the sub expressions should be traversed.
- */
- public boolean visitLocationPath(ExpressionOwner owner, LocPathIterator path)
- {
- return true;
- }
-
- /**
- * Visit a UnionPath.
- * @param owner The owner of the expression, to which the expression can
- * be reset if rewriting takes place.
- * @param path The UnionPath object.
- * @return true if the sub expressions should be traversed.
- */
- public boolean visitUnionPath(ExpressionOwner owner, UnionPathIterator path)
- {
- return true;
- }
-
- /**
- * Visit a step within a location path.
- * @param owner The owner of the expression, to which the expression can
- * be reset if rewriting takes place.
- * @param step The Step object.
- * @return true if the sub expressions should be traversed.
- */
- public boolean visitStep(ExpressionOwner owner, NodeTest step)
- {
- return true;
- }
-
- /**
- * Visit a predicate within a location path. Note that there isn't a
- * proper unique component for predicates, and that the expression will
- * be called also for whatever type Expression is.
- *
- * @param owner The owner of the expression, to which the expression can
- * be reset if rewriting takes place.
- * @param pred The predicate object.
- * @return true if the sub expressions should be traversed.
- */
- public boolean visitPredicate(ExpressionOwner owner, Expression pred)
- {
- return true;
- }
-
- /**
- * Visit a binary operation.
- * @param owner The owner of the expression, to which the expression can
- * be reset if rewriting takes place.
- * @param op The operation object.
- * @return true if the sub expressions should be traversed.
- */
- public boolean visitBinaryOperation(ExpressionOwner owner, Operation op)
- {
- return true;
- }
-
- /**
- * Visit a unary operation.
- * @param owner The owner of the expression, to which the expression can
- * be reset if rewriting takes place.
- * @param op The operation object.
- * @return true if the sub expressions should be traversed.
- */
- public boolean visitUnaryOperation(ExpressionOwner owner, UnaryOperation op)
- {
- return true;
- }
-
- /**
- * Visit a variable reference.
- * @param owner The owner of the expression, to which the expression can
- * be reset if rewriting takes place.
- * @param var The variable reference object.
- * @return true if the sub expressions should be traversed.
- */
- public boolean visitVariableRef(ExpressionOwner owner, Variable var)
- {
- return true;
- }
-
- /**
- * Visit a function.
- * @param owner The owner of the expression, to which the expression can
- * be reset if rewriting takes place.
- * @param func The function reference object.
- * @return true if the sub expressions should be traversed.
- */
- public boolean visitFunction(ExpressionOwner owner, Function func)
- {
- return true;
- }
-
- /**
- * Visit a match pattern.
- * @param owner The owner of the expression, to which the expression can
- * be reset if rewriting takes place.
- * @param pattern The match pattern object.
- * @return true if the sub expressions should be traversed.
- */
- public boolean visitMatchPattern(ExpressionOwner owner, StepPattern pattern)
- {
- return true;
- }
-
- /**
- * Visit a union pattern.
- * @param owner The owner of the expression, to which the expression can
- * be reset if rewriting takes place.
- * @param pattern The union pattern object.
- * @return true if the sub expressions should be traversed.
- */
- public boolean visitUnionPattern(ExpressionOwner owner, UnionPattern pattern)
- {
- return true;
- }
-
- /**
- * Visit a string literal.
- * @param owner The owner of the expression, to which the expression can
- * be reset if rewriting takes place.
- * @param str The string literal object.
- * @return true if the sub expressions should be traversed.
- */
- public boolean visitStringLiteral(ExpressionOwner owner, XString str)
- {
- return true;
- }
-
-
- /**
- * Visit a number literal.
- * @param owner The owner of the expression, to which the expression can
- * be reset if rewriting takes place.
- * @param num The number literal object.
- * @return true if the sub expressions should be traversed.
- */
- public boolean visitNumberLiteral(ExpressionOwner owner, XNumber num)
- {
- return true;
- }
-
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/axes/AttributeIterator.java b/src/com/sun/org/apache/xpath/internal/axes/AttributeIterator.java
deleted file mode 100644
index 8f08afa..0000000
--- a/src/com/sun/org/apache/xpath/internal/axes/AttributeIterator.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: AttributeIterator.java,v 1.2.4.1 2005/09/14 19:45:22 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.axes;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xpath.internal.compiler.Compiler;
-
-/**
- * This class implements an optimized iterator for
- * attribute axes patterns.
- * @see com.sun.org.apache.xpath.internal.axes#ChildTestIterator
- * @xsl.usage advanced
- */
-public class AttributeIterator extends ChildTestIterator
-{
- static final long serialVersionUID = -8417986700712229686L;
-
- /**
- * Create a AttributeIterator object.
- *
- * @param compiler A reference to the Compiler that contains the op map.
- * @param opPos The position within the op map, which contains the
- * location path expression for this itterator.
- *
- * @throws javax.xml.transform.TransformerException
- */
- AttributeIterator(Compiler compiler, int opPos, int analysis)
- throws javax.xml.transform.TransformerException
- {
- super(compiler, opPos, analysis);
- }
-
- /**
- * Get the next node via getFirstAttribute && getNextAttribute.
- */
- protected int getNextNode()
- {
- m_lastFetched = (DTM.NULL == m_lastFetched)
- ? m_cdtm.getFirstAttribute(m_context)
- : m_cdtm.getNextAttribute(m_lastFetched);
- return m_lastFetched;
- }
-
- /**
- * Returns the axis being iterated, if it is known.
- *
- * @return Axis.CHILD, etc., or -1 if the axis is not known or is of multiple
- * types.
- */
- public int getAxis()
- {
- return com.sun.org.apache.xml.internal.dtm.Axis.ATTRIBUTE;
- }
-
-
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/axes/AxesWalker.java b/src/com/sun/org/apache/xpath/internal/axes/AxesWalker.java
deleted file mode 100644
index 1834264..0000000
--- a/src/com/sun/org/apache/xpath/internal/axes/AxesWalker.java
+++ /dev/null
@@ -1,592 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: AxesWalker.java,v 1.2.4.1 2005/09/14 19:45:22 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.axes;
-
-import java.util.Vector;
-
-import com.sun.org.apache.xalan.internal.res.XSLMessages;
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMAxisTraverser;
-import com.sun.org.apache.xml.internal.dtm.DTMIterator;
-import com.sun.org.apache.xpath.internal.Expression;
-import com.sun.org.apache.xpath.internal.ExpressionOwner;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.XPathVisitor;
-import com.sun.org.apache.xpath.internal.compiler.Compiler;
-import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
-
-/**
- * Serves as common interface for axes Walkers, and stores common
- * state variables.
- */
-public class AxesWalker extends PredicatedNodeTest
- implements Cloneable, PathComponent, ExpressionOwner
-{
- static final long serialVersionUID = -2966031951306601247L;
-
- /**
- * Construct an AxesWalker using a LocPathIterator.
- *
- * @param locPathIterator non-null reference to the parent iterator.
- */
- public AxesWalker(LocPathIterator locPathIterator, int axis)
- {
- super( locPathIterator );
- m_axis = axis;
- }
-
- public final WalkingIterator wi()
- {
- return (WalkingIterator)m_lpi;
- }
-
- /**
- * Initialize an AxesWalker during the parse of the XPath expression.
- *
- * @param compiler The Compiler object that has information about this
- * walker in the op map.
- * @param opPos The op code position of this location step.
- * @param stepType The type of location step.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public void init(Compiler compiler, int opPos, int stepType)
- throws javax.xml.transform.TransformerException
- {
-
- initPredicateInfo(compiler, opPos);
-
- // int testType = compiler.getOp(nodeTestOpPos);
- }
-
- /**
- * Get a cloned AxesWalker.
- *
- * @return A new AxesWalker that can be used without mutating this one.
- *
- * @throws CloneNotSupportedException
- */
- public Object clone() throws CloneNotSupportedException
- {
- // Do not access the location path itterator during this operation!
-
- AxesWalker clone = (AxesWalker) super.clone();
-
- //clone.setCurrentNode(clone.m_root);
-
- // clone.m_isFresh = true;
-
- return clone;
- }
-
- /**
- * Do a deep clone of this walker, including next and previous walkers.
- * If the this AxesWalker is on the clone list, don't clone but
- * return the already cloned version.
- *
- * @param cloneOwner non-null reference to the cloned location path
- * iterator to which this clone will be added.
- * @param cloneList non-null vector of sources in odd elements, and the
- * corresponding clones in even vectors.
- *
- * @return non-null clone, which may be a new clone, or may be a clone
- * contained on the cloneList.
- */
- AxesWalker cloneDeep(WalkingIterator cloneOwner, Vector cloneList)
- throws CloneNotSupportedException
- {
- AxesWalker clone = findClone(this, cloneList);
- if(null != clone)
- return clone;
- clone = (AxesWalker)this.clone();
- clone.setLocPathIterator(cloneOwner);
- if(null != cloneList)
- {
- cloneList.addElement(this);
- cloneList.addElement(clone);
- }
-
- if(wi().m_lastUsedWalker == this)
- cloneOwner.m_lastUsedWalker = clone;
-
- if(null != m_nextWalker)
- clone.m_nextWalker = m_nextWalker.cloneDeep(cloneOwner, cloneList);
-
- // If you don't check for the cloneList here, you'll go into an
- // recursive infinate loop.
- if(null != cloneList)
- {
- if(null != m_prevWalker)
- clone.m_prevWalker = m_prevWalker.cloneDeep(cloneOwner, cloneList);
- }
- else
- {
- if(null != m_nextWalker)
- clone.m_nextWalker.m_prevWalker = clone;
- }
- return clone;
- }
-
- /**
- * Find a clone that corresponds to the key argument.
- *
- * @param key The original AxesWalker for which there may be a clone.
- * @param cloneList vector of sources in odd elements, and the
- * corresponding clones in even vectors, may be null.
- *
- * @return A clone that corresponds to the key, or null if key not found.
- */
- static AxesWalker findClone(AxesWalker key, Vector cloneList)
- {
- if(null != cloneList)
- {
- // First, look for clone on list.
- int n = cloneList.size();
- for (int i = 0; i < n; i+=2)
- {
- if(key == cloneList.elementAt(i))
- return (AxesWalker)cloneList.elementAt(i+1);
- }
- }
- return null;
- }
-
- /**
- * Detaches the walker from the set which it iterated over, releasing
- * any computational resources and placing the iterator in the INVALID
- * state.
- */
- public void detach()
- {
- m_currentNode = DTM.NULL;
- m_dtm = null;
- m_traverser = null;
- m_isFresh = true;
- m_root = DTM.NULL;
- }
-
- //=============== TreeWalker Implementation ===============
-
- /**
- * The root node of the TreeWalker, as specified in setRoot(int root).
- * Note that this may actually be below the current node.
- *
- * @return The context node of the step.
- */
- public int getRoot()
- {
- return m_root;
- }
-
- /**
- * Get the analysis bits for this walker, as defined in the WalkerFactory.
- * @return One of WalkerFactory#BIT_DESCENDANT, etc.
- */
- public int getAnalysisBits()
- {
- int axis = getAxis();
- int bit = WalkerFactory.getAnalysisBitFromAxes(axis);
- return bit;
- }
-
- /**
- * Set the root node of the TreeWalker.
- * (Not part of the DOM2 TreeWalker interface).
- *
- * @param root The context node of this step.
- */
- public void setRoot(int root)
- {
- // %OPT% Get this directly from the lpi.
- XPathContext xctxt = wi().getXPathContext();
- m_dtm = xctxt.getDTM(root);
- m_traverser = m_dtm.getAxisTraverser(m_axis);
- m_isFresh = true;
- m_foundLast = false;
- m_root = root;
- m_currentNode = root;
-
- if (DTM.NULL == root)
- {
- throw new RuntimeException(
- XSLMessages.createXPATHMessage(XPATHErrorResources.ER_SETTING_WALKER_ROOT_TO_NULL, null)); //"\n !!!! Error! Setting the root of a walker to null!!!");
- }
-
- resetProximityPositions();
- }
-
- /**
- * The node at which the TreeWalker is currently positioned.
- * <br> The value must not be null. Alterations to the DOM tree may cause
- * the current node to no longer be accepted by the TreeWalker's
- * associated filter. currentNode may also be explicitly set to any node,
- * whether or not it is within the subtree specified by the root node or
- * would be accepted by the filter and whatToShow flags. Further
- * traversal occurs relative to currentNode even if it is not part of the
- * current view by applying the filters in the requested direction (not
- * changing currentNode where no traversal is possible).
- *
- * @return The node at which the TreeWalker is currently positioned, only null
- * if setRoot has not yet been called.
- */
- public final int getCurrentNode()
- {
- return m_currentNode;
- }
-
- /**
- * Set the next walker in the location step chain.
- *
- *
- * @param walker Reference to AxesWalker derivative, or may be null.
- */
- public void setNextWalker(AxesWalker walker)
- {
- m_nextWalker = walker;
- }
-
- /**
- * Get the next walker in the location step chain.
- *
- *
- * @return Reference to AxesWalker derivative, or null.
- */
- public AxesWalker getNextWalker()
- {
- return m_nextWalker;
- }
-
- /**
- * Set or clear the previous walker reference in the location step chain.
- *
- *
- * @param walker Reference to previous walker reference in the location
- * step chain, or null.
- */
- public void setPrevWalker(AxesWalker walker)
- {
- m_prevWalker = walker;
- }
-
- /**
- * Get the previous walker reference in the location step chain.
- *
- *
- * @return Reference to previous walker reference in the location
- * step chain, or null.
- */
- public AxesWalker getPrevWalker()
- {
- return m_prevWalker;
- }
-
- /**
- * This is simply a way to bottle-neck the return of the next node, for
- * diagnostic purposes.
- *
- * @param n Node to return, or null.
- *
- * @return The argument.
- */
- private int returnNextNode(int n)
- {
-
- return n;
- }
-
- /**
- * Get the next node in document order on the axes.
- *
- * @return the next node in document order on the axes, or null.
- */
- protected int getNextNode()
- {
- if (m_foundLast)
- return DTM.NULL;
-
- if (m_isFresh)
- {
- m_currentNode = m_traverser.first(m_root);
- m_isFresh = false;
- }
- // I shouldn't have to do this the check for current node, I think.
- // numbering\numbering24.xsl fails if I don't do this. I think
- // it occurs as the walkers are backing up. -sb
- else if(DTM.NULL != m_currentNode)
- {
- m_currentNode = m_traverser.next(m_root, m_currentNode);
- }
-
- if (DTM.NULL == m_currentNode)
- this.m_foundLast = true;
-
- return m_currentNode;
- }
-
- /**
- * Moves the <code>TreeWalker</code> to the next visible node in document
- * order relative to the current node, and returns the new node. If the
- * current node has no next node, or if the search for nextNode attempts
- * to step upward from the TreeWalker's root node, returns
- * <code>null</code> , and retains the current node.
- * @return The new node, or <code>null</code> if the current node has no
- * next node in the TreeWalker's logical view.
- */
- public int nextNode()
- {
- int nextNode = DTM.NULL;
- AxesWalker walker = wi().getLastUsedWalker();
-
- while (true)
- {
- if (null == walker)
- break;
-
- nextNode = walker.getNextNode();
-
- if (DTM.NULL == nextNode)
- {
-
- walker = walker.m_prevWalker;
- }
- else
- {
- if (walker.acceptNode(nextNode) != DTMIterator.FILTER_ACCEPT)
- {
- continue;
- }
-
- if (null == walker.m_nextWalker)
- {
- wi().setLastUsedWalker(walker);
-
- // return walker.returnNextNode(nextNode);
- break;
- }
- else
- {
- AxesWalker prev = walker;
-
- walker = walker.m_nextWalker;
-
- walker.setRoot(nextNode);
-
- walker.m_prevWalker = prev;
-
- continue;
- }
- } // if(null != nextNode)
- } // while(null != walker)
-
- return nextNode;
- }
-
- //============= End TreeWalker Implementation =============
-
- /**
- * Get the index of the last node that can be itterated to.
- *
- *
- * @param xctxt XPath runtime context.
- *
- * @return the index of the last node that can be itterated to.
- */
- public int getLastPos(XPathContext xctxt)
- {
-
- int pos = getProximityPosition();
-
- AxesWalker walker;
-
- try
- {
- walker = (AxesWalker) clone();
- }
- catch (CloneNotSupportedException cnse)
- {
- return -1;
- }
-
- walker.setPredicateCount(m_predicateIndex);
- walker.setNextWalker(null);
- walker.setPrevWalker(null);
-
- WalkingIterator lpi = wi();
- AxesWalker savedWalker = lpi.getLastUsedWalker();
-
- try
- {
- lpi.setLastUsedWalker(walker);
-
- int next;
-
- while (DTM.NULL != (next = walker.nextNode()))
- {
- pos++;
- }
-
- // TODO: Should probably save this in the iterator.
- }
- finally
- {
- lpi.setLastUsedWalker(savedWalker);
- }
-
- // System.out.println("pos: "+pos);
- return pos;
- }
-
- //============= State Data =============
-
- /**
- * The DTM for the root. This can not be used, or must be changed,
- * for the filter walker, or any walker that can have nodes
- * from multiple documents.
- * Never, ever, access this value without going through getDTM(int node).
- */
- private DTM m_dtm;
-
- /**
- * Set the DTM for this walker.
- *
- * @param dtm Non-null reference to a DTM.
- */
- public void setDefaultDTM(DTM dtm)
- {
- m_dtm = dtm;
- }
-
- /**
- * Get the DTM for this walker.
- *
- * @return Non-null reference to a DTM.
- */
- public DTM getDTM(int node)
- {
- //
- return wi().getXPathContext().getDTM(node);
- }
-
- /**
- * Returns true if all the nodes in the iteration well be returned in document
- * order.
- * Warning: This can only be called after setRoot has been called!
- *
- * @return true as a default.
- */
- public boolean isDocOrdered()
- {
- return true;
- }
-
- /**
- * Returns the axis being iterated, if it is known.
- *
- * @return Axis.CHILD, etc., or -1 if the axis is not known or is of multiple
- * types.
- */
- public int getAxis()
- {
- return m_axis;
- }
-
- /**
- * This will traverse the heararchy, calling the visitor for
- * each member. If the called visitor method returns
- * false, the subtree should not be called.
- *
- * @param owner The owner of the visitor, where that path may be
- * rewritten if needed.
- * @param visitor The visitor whose appropriate method will be called.
- */
- public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)
- {
- if(visitor.visitStep(owner, this))
- {
- callPredicateVisitors(visitor);
- if(null != m_nextWalker)
- {
- m_nextWalker.callVisitors(this, visitor);
- }
- }
- }
-
- /**
- * @see ExpressionOwner#getExpression()
- */
- public Expression getExpression()
- {
- return m_nextWalker;
- }
-
- /**
- * @see ExpressionOwner#setExpression(Expression)
- */
- public void setExpression(Expression exp)
- {
- exp.exprSetParent(this);
- m_nextWalker = (AxesWalker)exp;
- }
-
- /**
- * @see Expression#deepEquals(Expression)
- */
- public boolean deepEquals(Expression expr)
- {
- if (!super.deepEquals(expr))
- return false;
-
- AxesWalker walker = (AxesWalker)expr;
- if(this.m_axis != walker.m_axis)
- return false;
-
- return true;
- }
-
- /**
- * The root node of the TreeWalker, as specified when it was created.
- */
- transient int m_root = DTM.NULL;
-
- /**
- * The node at which the TreeWalker is currently positioned.
- */
- private transient int m_currentNode = DTM.NULL;
-
- /** True if an itteration has not begun. */
- transient boolean m_isFresh;
-
- /** The next walker in the location step chain.
- * @serial */
- protected AxesWalker m_nextWalker;
-
- /** The previous walker in the location step chain, or null.
- * @serial */
- AxesWalker m_prevWalker;
-
- /** The traversal axis from where the nodes will be filtered. */
- protected int m_axis = -1;
-
- /** The DTM inner traversal class, that corresponds to the super axis. */
- protected DTMAxisTraverser m_traverser;
-}
diff --git a/src/com/sun/org/apache/xpath/internal/axes/BasicTestIterator.java b/src/com/sun/org/apache/xpath/internal/axes/BasicTestIterator.java
deleted file mode 100644
index cbea6db..0000000
--- a/src/com/sun/org/apache/xpath/internal/axes/BasicTestIterator.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: BasicTestIterator.java,v 1.2.4.1 2005/09/14 19:45:20 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.axes;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMFilter;
-import com.sun.org.apache.xml.internal.dtm.DTMIterator;
-import com.sun.org.apache.xml.internal.utils.PrefixResolver;
-import com.sun.org.apache.xpath.internal.compiler.Compiler;
-import com.sun.org.apache.xpath.internal.compiler.OpMap;
-
-/**
- * Base for iterators that handle predicates. Does the basic next
- * node logic, so all the derived iterator has to do is get the
- * next node.
- */
-public abstract class BasicTestIterator extends LocPathIterator
-{
- static final long serialVersionUID = 3505378079378096623L;
- /**
- * Create a LocPathIterator object.
- *
- * @param nscontext The namespace context for this iterator,
- * should be OK if null.
- */
- protected BasicTestIterator()
- {
- }
-
-
- /**
- * Create a LocPathIterator object.
- *
- * @param nscontext The namespace context for this iterator,
- * should be OK if null.
- */
- protected BasicTestIterator(PrefixResolver nscontext)
- {
-
- super(nscontext);
- }
-
- /**
- * Create a LocPathIterator object, including creation
- * of step walkers from the opcode list, and call back
- * into the Compiler to create predicate expressions.
- *
- * @param compiler The Compiler which is creating
- * this expression.
- * @param opPos The position of this iterator in the
- * opcode list from the compiler.
- *
- * @throws javax.xml.transform.TransformerException
- */
- protected BasicTestIterator(Compiler compiler, int opPos, int analysis)
- throws javax.xml.transform.TransformerException
- {
- super(compiler, opPos, analysis, false);
-
- int firstStepPos = OpMap.getFirstChildPos(opPos);
- int whatToShow = compiler.getWhatToShow(firstStepPos);
-
- if ((0 == (whatToShow
- & (DTMFilter.SHOW_ATTRIBUTE
- | DTMFilter.SHOW_NAMESPACE
- | DTMFilter.SHOW_ELEMENT
- | DTMFilter.SHOW_PROCESSING_INSTRUCTION)))
- || (whatToShow == DTMFilter.SHOW_ALL))
- initNodeTest(whatToShow);
- else
- {
- initNodeTest(whatToShow, compiler.getStepNS(firstStepPos),
- compiler.getStepLocalName(firstStepPos));
- }
- initPredicateInfo(compiler, firstStepPos);
- }
-
- /**
- * Create a LocPathIterator object, including creation
- * of step walkers from the opcode list, and call back
- * into the Compiler to create predicate expressions.
- *
- * @param compiler The Compiler which is creating
- * this expression.
- * @param opPos The position of this iterator in the
- * opcode list from the compiler.
- * @param shouldLoadWalkers True if walkers should be
- * loaded, or false if this is a derived iterator and
- * it doesn't wish to load child walkers.
- *
- * @throws javax.xml.transform.TransformerException
- */
- protected BasicTestIterator(
- Compiler compiler, int opPos, int analysis, boolean shouldLoadWalkers)
- throws javax.xml.transform.TransformerException
- {
- super(compiler, opPos, analysis, shouldLoadWalkers);
- }
-
-
- /**
- * Get the next node via getNextXXX. Bottlenecked for derived class override.
- * @return The next node on the axis, or DTM.NULL.
- */
- protected abstract int getNextNode();
-
- /**
- * Returns the next node in the set and advances the position of the
- * iterator in the set. After a NodeIterator is created, the first call
- * to nextNode() returns the first node in the set.
- *
- * @return The next <code>Node</code> in the set being iterated over, or
- * <code>null</code> if there are no more members in that set.
- */
- public int nextNode()
- {
- if(m_foundLast)
- {
- m_lastFetched = DTM.NULL;
- return DTM.NULL;
- }
-
- if(DTM.NULL == m_lastFetched)
- {
- resetProximityPositions();
- }
-
- int next;
-
- com.sun.org.apache.xpath.internal.VariableStack vars;
- int savedStart;
- if (-1 != m_stackFrame)
- {
- vars = m_execContext.getVarStack();
-
- // These three statements need to be combined into one operation.
- savedStart = vars.getStackFrame();
-
- vars.setStackFrame(m_stackFrame);
- }
- else
- {
- // Yuck. Just to shut up the compiler!
- vars = null;
- savedStart = 0;
- }
-
- try
- {
- do
- {
- next = getNextNode();
-
- if (DTM.NULL != next)
- {
- if(DTMIterator.FILTER_ACCEPT == acceptNode(next))
- break;
- else
- continue;
- }
- else
- break;
- }
- while (next != DTM.NULL);
-
- if (DTM.NULL != next)
- {
- m_pos++;
- return next;
- }
- else
- {
- m_foundLast = true;
-
- return DTM.NULL;
- }
- }
- finally
- {
- if (-1 != m_stackFrame)
- {
- // These two statements need to be combined into one operation.
- vars.setStackFrame(savedStart);
- }
- }
- }
-
- /**
- * Get a cloned Iterator that is reset to the beginning
- * of the query.
- *
- * @return A cloned NodeIterator set of the start of the query.
- *
- * @throws CloneNotSupportedException
- */
- public DTMIterator cloneWithReset() throws CloneNotSupportedException
- {
-
- ChildTestIterator clone = (ChildTestIterator) super.cloneWithReset();
-
- clone.resetProximityPositions();
-
- return clone;
- }
-
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/axes/ChildIterator.java b/src/com/sun/org/apache/xpath/internal/axes/ChildIterator.java
deleted file mode 100644
index be53200..0000000
--- a/src/com/sun/org/apache/xpath/internal/axes/ChildIterator.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ChildIterator.java,v 1.2.4.2 2005/09/14 19:45:20 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.axes;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMFilter;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.compiler.Compiler;
-
-/**
- * This class implements an optimized iterator for
- * "node()" patterns, that is, any children of the
- * context node.
- * @see com.sun.org.apache.xpath.internal.axes.LocPathIterator
- * @xsl.usage advanced
- */
-public class ChildIterator extends LocPathIterator
-{
- static final long serialVersionUID = -6935428015142993583L;
-
- /**
- * Create a ChildIterator object.
- *
- * @param compiler A reference to the Compiler that contains the op map.
- * @param opPos The position within the op map, which contains the
- * location path expression for this itterator.
- * @param analysis Analysis bits of the entire pattern.
- *
- * @throws javax.xml.transform.TransformerException
- */
- ChildIterator(Compiler compiler, int opPos, int analysis)
- throws javax.xml.transform.TransformerException
- {
- super(compiler, opPos, analysis, false);
-
- // This iterator matches all kinds of nodes
- initNodeTest(DTMFilter.SHOW_ALL);
- }
-
- /**
- * Return the first node out of the nodeset, if this expression is
- * a nodeset expression. This is the default implementation for
- * nodesets.
- * <p>WARNING: Do not mutate this class from this function!</p>
- * @param xctxt The XPath runtime context.
- * @return the first node out of the nodeset, or DTM.NULL.
- */
- public int asNode(XPathContext xctxt)
- throws javax.xml.transform.TransformerException
- {
- int current = xctxt.getCurrentNode();
-
- DTM dtm = xctxt.getDTM(current);
-
- return dtm.getFirstChild(current);
- }
-
- /**
- * Returns the next node in the set and advances the position of the
- * iterator in the set. After a NodeIterator is created, the first call
- * to nextNode() returns the first node in the set.
- *
- * @return The next <code>Node</code> in the set being iterated over, or
- * <code>null</code> if there are no more members in that set.
- */
- public int nextNode()
- {
- if(m_foundLast)
- return DTM.NULL;
-
- int next;
-
- m_lastFetched = next = (DTM.NULL == m_lastFetched)
- ? m_cdtm.getFirstChild(m_context)
- : m_cdtm.getNextSibling(m_lastFetched);
-
- // m_lastFetched = next;
- if (DTM.NULL != next)
- {
- m_pos++;
- return next;
- }
- else
- {
- m_foundLast = true;
-
- return DTM.NULL;
- }
- }
-
- /**
- * Returns the axis being iterated, if it is known.
- *
- * @return Axis.CHILD, etc., or -1 if the axis is not known or is of multiple
- * types.
- */
- public int getAxis()
- {
- return com.sun.org.apache.xml.internal.dtm.Axis.CHILD;
- }
-
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/axes/ChildTestIterator.java b/src/com/sun/org/apache/xpath/internal/axes/ChildTestIterator.java
deleted file mode 100644
index ebbf9b6..0000000
--- a/src/com/sun/org/apache/xpath/internal/axes/ChildTestIterator.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ChildTestIterator.java,v 1.2.4.2 2005/09/14 19:45:20 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.axes;
-
-import com.sun.org.apache.xml.internal.dtm.Axis;
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMAxisTraverser;
-import com.sun.org.apache.xml.internal.dtm.DTMIterator;
-import com.sun.org.apache.xpath.internal.compiler.Compiler;
-
-/**
- * This class implements an optimized iterator for
- * children patterns that have a node test, and possibly a predicate.
- * @see com.sun.org.apache.xpath.internal.axes.BasicTestIterator
- * @xsl.usage advanced
- */
-public class ChildTestIterator extends BasicTestIterator
-{
- static final long serialVersionUID = -7936835957960705722L;
- /** The traverser to use to navigate over the descendants. */
- transient protected DTMAxisTraverser m_traverser;
-
- /** The extended type ID, not set until setRoot. */
-// protected int m_extendedTypeID;
-
-
- /**
- * Create a ChildTestIterator object.
- *
- * @param compiler A reference to the Compiler that contains the op map.
- * @param opPos The position within the op map, which contains the
- * location path expression for this itterator.
- *
- * @throws javax.xml.transform.TransformerException
- */
- ChildTestIterator(Compiler compiler, int opPos, int analysis)
- throws javax.xml.transform.TransformerException
- {
- super(compiler, opPos, analysis);
- }
-
- /**
- * Create a ChildTestIterator object.
- *
- * @param traverser Traverser that tells how the KeyIterator is to be handled.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public ChildTestIterator(DTMAxisTraverser traverser)
- {
-
- super(null);
-
- m_traverser = traverser;
- }
-
- /**
- * Get the next node via getNextXXX. Bottlenecked for derived class override.
- * @return The next node on the axis, or DTM.NULL.
- */
- protected int getNextNode()
- {
- if(true /* 0 == m_extendedTypeID */)
- {
- m_lastFetched = (DTM.NULL == m_lastFetched)
- ? m_traverser.first(m_context)
- : m_traverser.next(m_context, m_lastFetched);
- }
-// else
-// {
-// m_lastFetched = (DTM.NULL == m_lastFetched)
-// ? m_traverser.first(m_context, m_extendedTypeID)
-// : m_traverser.next(m_context, m_lastFetched,
-// m_extendedTypeID);
-// }
-
- return m_lastFetched;
- }
-
-
- /**
- * Get a cloned Iterator that is reset to the beginning
- * of the query.
- *
- * @return A cloned NodeIterator set of the start of the query.
- *
- * @throws CloneNotSupportedException
- */
- public DTMIterator cloneWithReset() throws CloneNotSupportedException
- {
-
- ChildTestIterator clone = (ChildTestIterator) super.cloneWithReset();
- clone.m_traverser = m_traverser;
-
- return clone;
- }
-
-
- /**
- * Initialize the context values for this expression
- * after it is cloned.
- *
- * @param context The XPath runtime context for this
- * transformation.
- */
- public void setRoot(int context, Object environment)
- {
- super.setRoot(context, environment);
- m_traverser = m_cdtm.getAxisTraverser(Axis.CHILD);
-
-// String localName = getLocalName();
-// String namespace = getNamespace();
-// int what = m_whatToShow;
-// // System.out.println("what: ");
-// // NodeTest.debugWhatToShow(what);
-// if(DTMFilter.SHOW_ALL == what ||
-// ((DTMFilter.SHOW_ELEMENT & what) == 0)
-// || localName == NodeTest.WILD
-// || namespace == NodeTest.WILD)
-// {
-// m_extendedTypeID = 0;
-// }
-// else
-// {
-// int type = getNodeTypeTest(what);
-// m_extendedTypeID = m_cdtm.getExpandedTypeID(namespace, localName, type);
-// }
-
- }
-
- /**
- * Returns the axis being iterated, if it is known.
- *
- * @return Axis.CHILD, etc., or -1 if the axis is not known or is of multiple
- * types.
- */
- public int getAxis()
- {
- return com.sun.org.apache.xml.internal.dtm.Axis.CHILD;
- }
-
- /**
- * Detaches the iterator from the set which it iterated over, releasing
- * any computational resources and placing the iterator in the INVALID
- * state. After<code>detach</code> has been invoked, calls to
- * <code>nextNode</code> or<code>previousNode</code> will raise the
- * exception INVALID_STATE_ERR.
- */
- public void detach()
- {
- if(m_allowDetach)
- {
- m_traverser = null;
-
- // Always call the superclass detach last!
- super.detach();
- }
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/axes/ContextNodeList.java b/src/com/sun/org/apache/xpath/internal/axes/ContextNodeList.java
deleted file mode 100644
index 0c4924c..0000000
--- a/src/com/sun/org/apache/xpath/internal/axes/ContextNodeList.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ContextNodeList.java,v 1.1.2.1 2005/08/01 01:30:20 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.axes;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.traversal.NodeIterator;
-
-/**
- * Classes who implement this interface can be a
- * <a href="http://www.w3.org/TR/xslt#dt-current-node-list">current node list</a>,
- * also refered to here as a <term>context node list</term>.
- * @xsl.usage advanced
- */
-public interface ContextNodeList
-{
-
- /**
- * Get the <a href="http://www.w3.org/TR/xslt#dt-current-node">current node</a>.
- *
- *
- * @return The current node, or null.
- */
- public Node getCurrentNode();
-
- /**
- * Get the current position, which is one less than
- * the next nextNode() call will retrieve. i.e. if
- * you call getCurrentPos() and the return is 0, the next
- * fetch will take place at index 1.
- *
- * @return The position of the
- * <a href="http://www.w3.org/TR/xslt#dt-current-node">current node</a>
- * in the <a href="http://www.w3.org/TR/xslt#dt-current-node-list">current node list</a>.
- */
- public int getCurrentPos();
-
- /**
- * Reset the iterator.
- */
- public void reset();
-
- /**
- * If setShouldCacheNodes(true) is called, then nodes will
- * be cached. They are not cached by default.
- *
- * @param b true if the nodes should be cached.
- */
- public void setShouldCacheNodes(boolean b);
-
- /**
- * If an index is requested, NodeSetDTM will call this method
- * to run the iterator to the index. By default this sets
- * m_next to the index. If the index argument is -1, this
- * signals that the iterator should be run to the end.
- *
- * @param index The index to run to, or -1 if the iterator should be run
- * to the end.
- */
- public void runTo(int index);
-
- /**
- * Set the current position in the node set.
- * @param i Must be a valid index.
- */
- public void setCurrentPos(int i);
-
- /**
- * Get the length of the list.
- *
- * @return The number of nodes in this node list.
- */
- public int size();
-
- /**
- * Tells if this NodeSetDTM is "fresh", in other words, if
- * the first nextNode() that is called will return the
- * first node in the set.
- *
- * @return true if the iteration of this list has not yet begun.
- */
- public boolean isFresh();
-
- /**
- * Get a cloned Iterator that is reset to the start of the iteration.
- *
- * @return A clone of this iteration that has been reset.
- *
- * @throws CloneNotSupportedException
- */
- public NodeIterator cloneWithReset() throws CloneNotSupportedException;
-
- /**
- * Get a clone of this iterator. Be aware that this operation may be
- * somewhat expensive.
- *
- *
- * @return A clone of this object.
- *
- * @throws CloneNotSupportedException
- */
- public Object clone() throws CloneNotSupportedException;
-
- /**
- * Get the index of the last node in this list.
- *
- *
- * @return the index of the last node in this list.
- */
- public int getLast();
-
- /**
- * Set the index of the last node in this list.
- *
- *
- * @param last the index of the last node in this list.
- */
- public void setLast(int last);
-}
diff --git a/src/com/sun/org/apache/xpath/internal/axes/DescendantIterator.java b/src/com/sun/org/apache/xpath/internal/axes/DescendantIterator.java
deleted file mode 100644
index 729f89d..0000000
--- a/src/com/sun/org/apache/xpath/internal/axes/DescendantIterator.java
+++ /dev/null
@@ -1,383 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: DescendantIterator.java,v 1.2.4.2 2005/09/14 19:45:21 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.axes;
-
-import com.sun.org.apache.xml.internal.dtm.Axis;
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMAxisTraverser;
-import com.sun.org.apache.xml.internal.dtm.DTMFilter;
-import com.sun.org.apache.xml.internal.dtm.DTMIterator;
-import com.sun.org.apache.xpath.internal.Expression;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.compiler.Compiler;
-import com.sun.org.apache.xpath.internal.compiler.OpCodes;
-import com.sun.org.apache.xpath.internal.compiler.OpMap;
-import com.sun.org.apache.xpath.internal.patterns.NodeTest;
-import org.w3c.dom.DOMException;
-
-/**
- * This class implements an optimized iterator for
- * descendant, descendant-or-self, or "//foo" patterns.
- * @see com.sun.org.apache.xpath.internal.axes.LocPathIterator
- * @xsl.usage advanced
- */
-public class DescendantIterator extends LocPathIterator
-{
- static final long serialVersionUID = -1190338607743976938L;
- /**
- * Create a DescendantIterator object.
- *
- * @param compiler A reference to the Compiler that contains the op map.
- * @param opPos The position within the op map, which contains the
- * location path expression for this itterator.
- *
- * @throws javax.xml.transform.TransformerException
- */
- DescendantIterator(Compiler compiler, int opPos, int analysis)
- throws javax.xml.transform.TransformerException
- {
-
- super(compiler, opPos, analysis, false);
-
- int firstStepPos = OpMap.getFirstChildPos(opPos);
- int stepType = compiler.getOp(firstStepPos);
-
- boolean orSelf = (OpCodes.FROM_DESCENDANTS_OR_SELF == stepType);
- boolean fromRoot = false;
- if (OpCodes.FROM_SELF == stepType)
- {
- orSelf = true;
- // firstStepPos += 8;
- }
- else if(OpCodes.FROM_ROOT == stepType)
- {
- fromRoot = true;
- // Ugly code... will go away when AST work is done.
- int nextStepPos = compiler.getNextStepPos(firstStepPos);
- if(compiler.getOp(nextStepPos) == OpCodes.FROM_DESCENDANTS_OR_SELF)
- orSelf = true;
- // firstStepPos += 8;
- }
-
- // Find the position of the last step.
- int nextStepPos = firstStepPos;
- while(true)
- {
- nextStepPos = compiler.getNextStepPos(nextStepPos);
- if(nextStepPos > 0)
- {
- int stepOp = compiler.getOp(nextStepPos);
- if(OpCodes.ENDOP != stepOp)
- firstStepPos = nextStepPos;
- else
- break;
- }
- else
- break;
-
- }
-
- // Fix for http://nagoya.apache.org/bugzilla/show_bug.cgi?id=1336
- if((analysis & WalkerFactory.BIT_CHILD) != 0)
- orSelf = false;
-
- if(fromRoot)
- {
- if(orSelf)
- m_axis = Axis.DESCENDANTSORSELFFROMROOT;
- else
- m_axis = Axis.DESCENDANTSFROMROOT;
- }
- else if(orSelf)
- m_axis = Axis.DESCENDANTORSELF;
- else
- m_axis = Axis.DESCENDANT;
-
- int whatToShow = compiler.getWhatToShow(firstStepPos);
-
- if ((0 == (whatToShow
- & (DTMFilter.SHOW_ATTRIBUTE | DTMFilter.SHOW_ELEMENT
- | DTMFilter.SHOW_PROCESSING_INSTRUCTION))) ||
- (whatToShow == DTMFilter.SHOW_ALL))
- initNodeTest(whatToShow);
- else
- {
- initNodeTest(whatToShow, compiler.getStepNS(firstStepPos),
- compiler.getStepLocalName(firstStepPos));
- }
- initPredicateInfo(compiler, firstStepPos);
- }
-
- /**
- * Create a DescendantIterator object.
- *
- */
- public DescendantIterator()
- {
- super(null);
- m_axis = Axis.DESCENDANTSORSELFFROMROOT;
- int whatToShow = DTMFilter.SHOW_ALL;
- initNodeTest(whatToShow);
- }
-
-
- /**
- * Get a cloned Iterator that is reset to the beginning
- * of the query.
- *
- * @return A cloned NodeIterator set of the start of the query.
- *
- * @throws CloneNotSupportedException
- */
- public DTMIterator cloneWithReset() throws CloneNotSupportedException
- {
-
- DescendantIterator clone = (DescendantIterator) super.cloneWithReset();
- clone.m_traverser = m_traverser;
-
- clone.resetProximityPositions();
-
- return clone;
- }
-
- /**
- * Returns the next node in the set and advances the position of the
- * iterator in the set. After a NodeIterator is created, the first call
- * to nextNode() returns the first node in the set.
- *
- * @return The next <code>Node</code> in the set being iterated over, or
- * <code>null</code> if there are no more members in that set.
- *
- * @throws DOMException
- * INVALID_STATE_ERR: Raised if this method is called after the
- * <code>detach</code> method was invoked.
- */
- public int nextNode()
- {
- if(m_foundLast)
- return DTM.NULL;
-
- if(DTM.NULL == m_lastFetched)
- {
- resetProximityPositions();
- }
-
- int next;
-
- com.sun.org.apache.xpath.internal.VariableStack vars;
- int savedStart;
- if (-1 != m_stackFrame)
- {
- vars = m_execContext.getVarStack();
-
- // These three statements need to be combined into one operation.
- savedStart = vars.getStackFrame();
-
- vars.setStackFrame(m_stackFrame);
- }
- else
- {
- // Yuck. Just to shut up the compiler!
- vars = null;
- savedStart = 0;
- }
-
- try
- {
- do
- {
- if(0 == m_extendedTypeID)
- {
- next = m_lastFetched = (DTM.NULL == m_lastFetched)
- ? m_traverser.first(m_context)
- : m_traverser.next(m_context, m_lastFetched);
- }
- else
- {
- next = m_lastFetched = (DTM.NULL == m_lastFetched)
- ? m_traverser.first(m_context, m_extendedTypeID)
- : m_traverser.next(m_context, m_lastFetched,
- m_extendedTypeID);
- }
-
- if (DTM.NULL != next)
- {
- if(DTMIterator.FILTER_ACCEPT == acceptNode(next))
- break;
- else
- continue;
- }
- else
- break;
- }
- while (next != DTM.NULL);
-
- if (DTM.NULL != next)
- {
- m_pos++;
- return next;
- }
- else
- {
- m_foundLast = true;
-
- return DTM.NULL;
- }
- }
- finally
- {
- if (-1 != m_stackFrame)
- {
- // These two statements need to be combined into one operation.
- vars.setStackFrame(savedStart);
- }
- }
- }
-
- /**
- * Initialize the context values for this expression
- * after it is cloned.
- *
- * @param context The XPath runtime context for this
- * transformation.
- */
- public void setRoot(int context, Object environment)
- {
- super.setRoot(context, environment);
- m_traverser = m_cdtm.getAxisTraverser(m_axis);
-
- String localName = getLocalName();
- String namespace = getNamespace();
- int what = m_whatToShow;
- // System.out.println("what: ");
- // NodeTest.debugWhatToShow(what);
- if(DTMFilter.SHOW_ALL == what
- || NodeTest.WILD.equals(localName)
- || NodeTest.WILD.equals(namespace))
- {
- m_extendedTypeID = 0;
- }
- else
- {
- int type = getNodeTypeTest(what);
- m_extendedTypeID = m_cdtm.getExpandedTypeID(namespace, localName, type);
- }
-
- }
-
- /**
- * Return the first node out of the nodeset, if this expression is
- * a nodeset expression. This is the default implementation for
- * nodesets.
- * <p>WARNING: Do not mutate this class from this function!</p>
- * @param xctxt The XPath runtime context.
- * @return the first node out of the nodeset, or DTM.NULL.
- */
- public int asNode(XPathContext xctxt)
- throws javax.xml.transform.TransformerException
- {
- if(getPredicateCount() > 0)
- return super.asNode(xctxt);
-
- int current = xctxt.getCurrentNode();
-
- DTM dtm = xctxt.getDTM(current);
- DTMAxisTraverser traverser = dtm.getAxisTraverser(m_axis);
-
- String localName = getLocalName();
- String namespace = getNamespace();
- int what = m_whatToShow;
-
- // System.out.print(" (DescendantIterator) ");
-
- // System.out.println("what: ");
- // NodeTest.debugWhatToShow(what);
- if(DTMFilter.SHOW_ALL == what
- || localName == NodeTest.WILD
- || namespace == NodeTest.WILD)
- {
- return traverser.first(current);
- }
- else
- {
- int type = getNodeTypeTest(what);
- int extendedType = dtm.getExpandedTypeID(namespace, localName, type);
- return traverser.first(current, extendedType);
- }
- }
-
- /**
- * Detaches the iterator from the set which it iterated over, releasing
- * any computational resources and placing the iterator in the INVALID
- * state. After<code>detach</code> has been invoked, calls to
- * <code>nextNode</code> or<code>previousNode</code> will raise the
- * exception INVALID_STATE_ERR.
- */
- public void detach()
- {
- if (m_allowDetach) {
- m_traverser = null;
- m_extendedTypeID = 0;
-
- // Always call the superclass detach last!
- super.detach();
- }
- }
-
- /**
- * Returns the axis being iterated, if it is known.
- *
- * @return Axis.CHILD, etc., or -1 if the axis is not known or is of multiple
- * types.
- */
- public int getAxis()
- {
- return m_axis;
- }
-
-
- /** The traverser to use to navigate over the descendants. */
- transient protected DTMAxisTraverser m_traverser;
-
- /** The axis that we are traversing. */
- protected int m_axis;
-
- /** The extended type ID, not set until setRoot. */
- protected int m_extendedTypeID;
-
- /**
- * @see Expression#deepEquals(Expression)
- */
- public boolean deepEquals(Expression expr)
- {
- if(!super.deepEquals(expr))
- return false;
-
- if(m_axis != ((DescendantIterator)expr).m_axis)
- return false;
-
- return true;
- }
-
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/axes/FilterExprIterator.java b/src/com/sun/org/apache/xpath/internal/axes/FilterExprIterator.java
deleted file mode 100644
index d749273..0000000
--- a/src/com/sun/org/apache/xpath/internal/axes/FilterExprIterator.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FilterExprIterator.java,v 1.2.4.2 2005/09/14 19:45:22 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.axes;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xpath.internal.Expression;
-import com.sun.org.apache.xpath.internal.ExpressionOwner;
-import com.sun.org.apache.xpath.internal.XPathVisitor;
-import com.sun.org.apache.xpath.internal.objects.XNodeSet;
-
-public class FilterExprIterator extends BasicTestIterator
-{
- static final long serialVersionUID = 2552176105165737614L;
- /** The contained expression. Should be non-null.
- * @serial */
- private Expression m_expr;
-
- /** The result of executing m_expr. Needs to be deep cloned on clone op. */
- transient private XNodeSet m_exprObj;
-
- private boolean m_mustHardReset = false;
- private boolean m_canDetachNodeset = true;
-
- /**
- * Create a FilterExprIterator object.
- *
- */
- public FilterExprIterator()
- {
- super(null);
- }
-
- /**
- * Create a FilterExprIterator object.
- *
- */
- public FilterExprIterator(Expression expr)
- {
- super(null);
- m_expr = expr;
- }
-
- /**
- * Initialize the context values for this expression
- * after it is cloned.
- *
- * @param context The XPath runtime context for this
- * transformation.
- */
- public void setRoot(int context, Object environment)
- {
- super.setRoot(context, environment);
-
- m_exprObj = FilterExprIteratorSimple.executeFilterExpr(context,
- m_execContext, getPrefixResolver(),
- getIsTopLevel(), m_stackFrame, m_expr);
- }
-
-
- /**
- * Get the next node via getNextXXX. Bottlenecked for derived class override.
- * @return The next node on the axis, or DTM.NULL.
- */
- protected int getNextNode()
- {
- if (null != m_exprObj)
- {
- m_lastFetched = m_exprObj.nextNode();
- }
- else
- m_lastFetched = DTM.NULL;
-
- return m_lastFetched;
- }
-
- /**
- * Detaches the walker from the set which it iterated over, releasing
- * any computational resources and placing the iterator in the INVALID
- * state.
- */
- public void detach()
- {
- super.detach();
- m_exprObj.detach();
- m_exprObj = null;
- }
-
- /**
- * This function is used to fixup variables from QNames to stack frame
- * indexes at stylesheet build time.
- * @param vars List of QNames that correspond to variables. This list
- * should be searched backwards for the first qualified name that
- * corresponds to the variable reference qname. The position of the
- * QName in the vector from the start of the vector will be its position
- * in the stack frame (but variables above the globalsTop value will need
- * to be offset to the current stack frame).
- */
- public void fixupVariables(java.util.Vector vars, int globalsSize)
- {
- super.fixupVariables(vars, globalsSize);
- m_expr.fixupVariables(vars, globalsSize);
- }
-
- /**
- * Get the inner contained expression of this filter.
- */
- public Expression getInnerExpression()
- {
- return m_expr;
- }
-
- /**
- * Set the inner contained expression of this filter.
- */
- public void setInnerExpression(Expression expr)
- {
- expr.exprSetParent(this);
- m_expr = expr;
- }
-
- /**
- * Get the analysis bits for this walker, as defined in the WalkerFactory.
- * @return One of WalkerFactory#BIT_DESCENDANT, etc.
- */
- public int getAnalysisBits()
- {
- if (null != m_expr && m_expr instanceof PathComponent)
- {
- return ((PathComponent) m_expr).getAnalysisBits();
- }
- return WalkerFactory.BIT_FILTER;
- }
-
- /**
- * Returns true if all the nodes in the iteration well be returned in document
- * order.
- * Warning: This can only be called after setRoot has been called!
- *
- * @return true as a default.
- */
- public boolean isDocOrdered()
- {
- return m_exprObj.isDocOrdered();
- }
-
- class filterExprOwner implements ExpressionOwner
- {
- /**
- * @see ExpressionOwner#getExpression()
- */
- public Expression getExpression()
- {
- return m_expr;
- }
-
- /**
- * @see ExpressionOwner#setExpression(Expression)
- */
- public void setExpression(Expression exp)
- {
- exp.exprSetParent(FilterExprIterator.this);
- m_expr = exp;
- }
-
- }
-
- /**
- * This will traverse the heararchy, calling the visitor for
- * each member. If the called visitor method returns
- * false, the subtree should not be called.
- *
- * @param visitor The visitor whose appropriate method will be called.
- */
- public void callPredicateVisitors(XPathVisitor visitor)
- {
- m_expr.callVisitors(new filterExprOwner(), visitor);
-
- super.callPredicateVisitors(visitor);
- }
-
- /**
- * @see Expression#deepEquals(Expression)
- */
- public boolean deepEquals(Expression expr)
- {
- if (!super.deepEquals(expr))
- return false;
-
- FilterExprIterator fet = (FilterExprIterator) expr;
- if (!m_expr.deepEquals(fet.m_expr))
- return false;
-
- return true;
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/axes/FilterExprIteratorSimple.java b/src/com/sun/org/apache/xpath/internal/axes/FilterExprIteratorSimple.java
deleted file mode 100644
index 29b064e..0000000
--- a/src/com/sun/org/apache/xpath/internal/axes/FilterExprIteratorSimple.java
+++ /dev/null
@@ -1,316 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FilterExprIteratorSimple.java,v 1.2.4.2 2005/09/14 19:45:21 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.axes;
-
-import com.sun.org.apache.xml.internal.dtm.Axis;
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.utils.PrefixResolver;
-import com.sun.org.apache.xpath.internal.Expression;
-import com.sun.org.apache.xpath.internal.ExpressionOwner;
-import com.sun.org.apache.xpath.internal.VariableStack;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.XPathVisitor;
-import com.sun.org.apache.xpath.internal.objects.XNodeSet;
-
-/**
- * Class to use for one-step iteration that doesn't have a predicate, and
- * doesn't need to set the context.
- */
-public class FilterExprIteratorSimple extends LocPathIterator
-{
- static final long serialVersionUID = -6978977187025375579L;
- /** The contained expression. Should be non-null.
- * @serial */
- private Expression m_expr;
-
- /** The result of executing m_expr. Needs to be deep cloned on clone op. */
- transient private XNodeSet m_exprObj;
-
- private boolean m_mustHardReset = false;
- private boolean m_canDetachNodeset = true;
-
- /**
- * Create a FilterExprIteratorSimple object.
- *
- */
- public FilterExprIteratorSimple()
- {
- super(null);
- }
-
- /**
- * Create a FilterExprIteratorSimple object.
- *
- */
- public FilterExprIteratorSimple(Expression expr)
- {
- super(null);
- m_expr = expr;
- }
-
- /**
- * Initialize the context values for this expression
- * after it is cloned.
- *
- * @param context The XPath runtime context for this
- * transformation.
- */
- public void setRoot(int context, Object environment)
- {
- super.setRoot(context, environment);
- m_exprObj = executeFilterExpr(context, m_execContext, getPrefixResolver(),
- getIsTopLevel(), m_stackFrame, m_expr);
- }
-
- /**
- * Execute the expression. Meant for reuse by other FilterExpr iterators
- * that are not derived from this object.
- */
- public static XNodeSet executeFilterExpr(int context, XPathContext xctxt,
- PrefixResolver prefixResolver,
- boolean isTopLevel,
- int stackFrame,
- Expression expr )
- throws com.sun.org.apache.xml.internal.utils.WrappedRuntimeException
- {
- PrefixResolver savedResolver = xctxt.getNamespaceContext();
- XNodeSet result = null;
-
- try
- {
- xctxt.pushCurrentNode(context);
- xctxt.setNamespaceContext(prefixResolver);
-
- // The setRoot operation can take place with a reset operation,
- // and so we may not be in the context of LocPathIterator#nextNode,
- // so we have to set up the variable context, execute the expression,
- // and then restore the variable context.
-
- if (isTopLevel)
- {
- // System.out.println("calling m_expr.execute(getXPathContext())");
- VariableStack vars = xctxt.getVarStack();
-
- // These three statements need to be combined into one operation.
- int savedStart = vars.getStackFrame();
- vars.setStackFrame(stackFrame);
-
- result = (com.sun.org.apache.xpath.internal.objects.XNodeSet) expr.execute(xctxt);
- result.setShouldCacheNodes(true);
-
- // These two statements need to be combined into one operation.
- vars.setStackFrame(savedStart);
- }
- else
- result = (com.sun.org.apache.xpath.internal.objects.XNodeSet) expr.execute(xctxt);
-
- }
- catch (javax.xml.transform.TransformerException se)
- {
-
- // TODO: Fix...
- throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(se);
- }
- finally
- {
- xctxt.popCurrentNode();
- xctxt.setNamespaceContext(savedResolver);
- }
- return result;
- }
-
- /**
- * Returns the next node in the set and advances the position of the
- * iterator in the set. After a NodeIterator is created, the first call
- * to nextNode() returns the first node in the set.
- *
- * @return The next <code>Node</code> in the set being iterated over, or
- * <code>null</code> if there are no more members in that set.
- */
- public int nextNode()
- {
- if(m_foundLast)
- return DTM.NULL;
-
- int next;
-
- if (null != m_exprObj)
- {
- m_lastFetched = next = m_exprObj.nextNode();
- }
- else
- m_lastFetched = next = DTM.NULL;
-
- // m_lastFetched = next;
- if (DTM.NULL != next)
- {
- m_pos++;
- return next;
- }
- else
- {
- m_foundLast = true;
-
- return DTM.NULL;
- }
- }
-
- /**
- * Detaches the walker from the set which it iterated over, releasing
- * any computational resources and placing the iterator in the INVALID
- * state.
- */
- public void detach()
- {
- if(m_allowDetach)
- {
- super.detach();
- m_exprObj.detach();
- m_exprObj = null;
- }
- }
-
- /**
- * This function is used to fixup variables from QNames to stack frame
- * indexes at stylesheet build time.
- * @param vars List of QNames that correspond to variables. This list
- * should be searched backwards for the first qualified name that
- * corresponds to the variable reference qname. The position of the
- * QName in the vector from the start of the vector will be its position
- * in the stack frame (but variables above the globalsTop value will need
- * to be offset to the current stack frame).
- */
- public void fixupVariables(java.util.Vector vars, int globalsSize)
- {
- super.fixupVariables(vars, globalsSize);
- m_expr.fixupVariables(vars, globalsSize);
- }
-
- /**
- * Get the inner contained expression of this filter.
- */
- public Expression getInnerExpression()
- {
- return m_expr;
- }
-
- /**
- * Set the inner contained expression of this filter.
- */
- public void setInnerExpression(Expression expr)
- {
- expr.exprSetParent(this);
- m_expr = expr;
- }
-
- /**
- * Get the analysis bits for this walker, as defined in the WalkerFactory.
- * @return One of WalkerFactory#BIT_DESCENDANT, etc.
- */
- public int getAnalysisBits()
- {
- if (null != m_expr && m_expr instanceof PathComponent)
- {
- return ((PathComponent) m_expr).getAnalysisBits();
- }
- return WalkerFactory.BIT_FILTER;
- }
-
- /**
- * Returns true if all the nodes in the iteration well be returned in document
- * order.
- * Warning: This can only be called after setRoot has been called!
- *
- * @return true as a default.
- */
- public boolean isDocOrdered()
- {
- return m_exprObj.isDocOrdered();
- }
-
- class filterExprOwner implements ExpressionOwner
- {
- /**
- * @see ExpressionOwner#getExpression()
- */
- public Expression getExpression()
- {
- return m_expr;
- }
-
- /**
- * @see ExpressionOwner#setExpression(Expression)
- */
- public void setExpression(Expression exp)
- {
- exp.exprSetParent(FilterExprIteratorSimple.this);
- m_expr = exp;
- }
-
- }
-
- /**
- * This will traverse the heararchy, calling the visitor for
- * each member. If the called visitor method returns
- * false, the subtree should not be called.
- *
- * @param visitor The visitor whose appropriate method will be called.
- */
- public void callPredicateVisitors(XPathVisitor visitor)
- {
- m_expr.callVisitors(new filterExprOwner(), visitor);
-
- super.callPredicateVisitors(visitor);
- }
-
- /**
- * @see Expression#deepEquals(Expression)
- */
- public boolean deepEquals(Expression expr)
- {
- if (!super.deepEquals(expr))
- return false;
-
- FilterExprIteratorSimple fet = (FilterExprIteratorSimple) expr;
- if (!m_expr.deepEquals(fet.m_expr))
- return false;
-
- return true;
- }
-
- /**
- * Returns the axis being iterated, if it is known.
- *
- * @return Axis.CHILD, etc., or -1 if the axis is not known or is of multiple
- * types.
- */
- public int getAxis()
- {
- if(null != m_exprObj)
- return m_exprObj.getAxis();
- else
- return Axis.FILTEREDLIST;
- }
-
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/axes/FilterExprWalker.java b/src/com/sun/org/apache/xpath/internal/axes/FilterExprWalker.java
deleted file mode 100644
index 40638e6..0000000
--- a/src/com/sun/org/apache/xpath/internal/axes/FilterExprWalker.java
+++ /dev/null
@@ -1,352 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FilterExprWalker.java,v 1.2.4.2 2005/09/14 19:45:23 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.axes;
-
-import com.sun.org.apache.xml.internal.dtm.Axis;
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMIterator;
-import com.sun.org.apache.xpath.internal.Expression;
-import com.sun.org.apache.xpath.internal.ExpressionOwner;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.XPathVisitor;
-import com.sun.org.apache.xpath.internal.compiler.Compiler;
-import com.sun.org.apache.xpath.internal.compiler.OpCodes;
-import com.sun.org.apache.xpath.internal.objects.XNodeSet;
-
-/**
- * Walker for the OP_VARIABLE, or OP_EXTFUNCTION, or OP_FUNCTION, or OP_GROUP,
- * op codes.
- * @see <a href="http://www.w3.org/TR/xpath#NT-FilterExpr">XPath FilterExpr descriptions</a>
- */
-public class FilterExprWalker extends AxesWalker
-{
- static final long serialVersionUID = 5457182471424488375L;
-
- /**
- * Construct a FilterExprWalker using a LocPathIterator.
- *
- * @param locPathIterator non-null reference to the parent iterator.
- */
- public FilterExprWalker(WalkingIterator locPathIterator)
- {
- super(locPathIterator, Axis.FILTEREDLIST);
- }
-
- /**
- * Init a FilterExprWalker.
- *
- * @param compiler non-null reference to the Compiler that is constructing.
- * @param opPos positive opcode position for this step.
- * @param stepType The type of step.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public void init(Compiler compiler, int opPos, int stepType)
- throws javax.xml.transform.TransformerException
- {
-
- super.init(compiler, opPos, stepType);
-
- // Smooth over an anomily in the opcode map...
- switch (stepType)
- {
- case OpCodes.OP_FUNCTION :
- case OpCodes.OP_EXTFUNCTION :
- m_mustHardReset = true;
- case OpCodes.OP_GROUP :
- case OpCodes.OP_VARIABLE :
- m_expr = compiler.compile(opPos);
- m_expr.exprSetParent(this);
- //if((OpCodes.OP_FUNCTION == stepType) && (m_expr instanceof com.sun.org.apache.xalan.internal.templates.FuncKey))
- if(m_expr instanceof com.sun.org.apache.xpath.internal.operations.Variable)
- {
- // hack/temp workaround
- m_canDetachNodeset = false;
- }
- break;
- default :
- m_expr = compiler.compile(opPos + 2);
- m_expr.exprSetParent(this);
- }
-// if(m_expr instanceof WalkingIterator)
-// {
-// WalkingIterator wi = (WalkingIterator)m_expr;
-// if(wi.getFirstWalker() instanceof FilterExprWalker)
-// {
-// FilterExprWalker fw = (FilterExprWalker)wi.getFirstWalker();
-// if(null == fw.getNextWalker())
-// {
-// m_expr = fw.m_expr;
-// m_expr.exprSetParent(this);
-// }
-// }
-//
-// }
- }
-
- /**
- * Detaches the walker from the set which it iterated over, releasing
- * any computational resources and placing the iterator in the INVALID
- * state.
- */
- public void detach()
- {
- super.detach();
- if (m_canDetachNodeset)
- {
- m_exprObj.detach();
- }
- m_exprObj = null;
- }
-
- /**
- * Set the root node of the TreeWalker.
- *
- * @param root non-null reference to the root, or starting point of
- * the query.
- */
- public void setRoot(int root)
- {
-
- super.setRoot(root);
-
- m_exprObj = FilterExprIteratorSimple.executeFilterExpr(root,
- m_lpi.getXPathContext(), m_lpi.getPrefixResolver(),
- m_lpi.getIsTopLevel(), m_lpi.m_stackFrame, m_expr);
-
- }
-
- /**
- * Get a cloned FilterExprWalker.
- *
- * @return A new FilterExprWalker that can be used without mutating this one.
- *
- * @throws CloneNotSupportedException
- */
- public Object clone() throws CloneNotSupportedException
- {
-
- FilterExprWalker clone = (FilterExprWalker) super.clone();
-
- // clone.m_expr = (Expression)((Expression)m_expr).clone();
- if (null != m_exprObj)
- clone.m_exprObj = (XNodeSet) m_exprObj.clone();
-
- return clone;
- }
-
- /**
- * This method needs to override AxesWalker.acceptNode because FilterExprWalkers
- * don't need to, and shouldn't, do a node test.
- * @param n The node to check to see if it passes the filter or not.
- * @return a constant to determine whether the node is accepted,
- * rejected, or skipped, as defined above .
- */
- public short acceptNode(int n)
- {
-
- try
- {
- if (getPredicateCount() > 0)
- {
- countProximityPosition(0);
-
- if (!executePredicates(n, m_lpi.getXPathContext()))
- return DTMIterator.FILTER_SKIP;
- }
-
- return DTMIterator.FILTER_ACCEPT;
- }
- catch (javax.xml.transform.TransformerException se)
- {
- throw new RuntimeException(se.getMessage());
- }
- }
-
- /**
- * Moves the <code>TreeWalker</code> to the next visible node in document
- * order relative to the current node, and returns the new node. If the
- * current node has no next node, or if the search for nextNode attempts
- * to step upward from the TreeWalker's root node, returns
- * <code>null</code> , and retains the current node.
- * @return The new node, or <code>null</code> if the current node has no
- * next node in the TreeWalker's logical view.
- */
- public int getNextNode()
- {
-
- if (null != m_exprObj)
- {
- int next = m_exprObj.nextNode();
- return next;
- }
- else
- return DTM.NULL;
- }
-
- /**
- * Get the index of the last node that can be itterated to.
- *
- *
- * @param xctxt XPath runtime context.
- *
- * @return the index of the last node that can be itterated to.
- */
- public int getLastPos(XPathContext xctxt)
- {
- return m_exprObj.getLength();
- }
-
- /** The contained expression. Should be non-null.
- * @serial */
- private Expression m_expr;
-
- /** The result of executing m_expr. Needs to be deep cloned on clone op. */
- transient private XNodeSet m_exprObj;
-
- private boolean m_mustHardReset = false;
- private boolean m_canDetachNodeset = true;
-
- /**
- * This function is used to fixup variables from QNames to stack frame
- * indexes at stylesheet build time.
- * @param vars List of QNames that correspond to variables. This list
- * should be searched backwards for the first qualified name that
- * corresponds to the variable reference qname. The position of the
- * QName in the vector from the start of the vector will be its position
- * in the stack frame (but variables above the globalsTop value will need
- * to be offset to the current stack frame).
- */
- public void fixupVariables(java.util.Vector vars, int globalsSize)
- {
- super.fixupVariables(vars, globalsSize);
- m_expr.fixupVariables(vars, globalsSize);
- }
-
- /**
- * Get the inner contained expression of this filter.
- */
- public Expression getInnerExpression()
- {
- return m_expr;
- }
-
- /**
- * Set the inner contained expression of this filter.
- */
- public void setInnerExpression(Expression expr)
- {
- expr.exprSetParent(this);
- m_expr = expr;
- }
-
-
- /**
- * Get the analysis bits for this walker, as defined in the WalkerFactory.
- * @return One of WalkerFactory#BIT_DESCENDANT, etc.
- */
- public int getAnalysisBits()
- {
- if (null != m_expr && m_expr instanceof PathComponent)
- {
- return ((PathComponent) m_expr).getAnalysisBits();
- }
- return WalkerFactory.BIT_FILTER;
- }
-
- /**
- * Returns true if all the nodes in the iteration well be returned in document
- * order.
- * Warning: This can only be called after setRoot has been called!
- *
- * @return true as a default.
- */
- public boolean isDocOrdered()
- {
- return m_exprObj.isDocOrdered();
- }
-
- /**
- * Returns the axis being iterated, if it is known.
- *
- * @return Axis.CHILD, etc., or -1 if the axis is not known or is of multiple
- * types.
- */
- public int getAxis()
- {
- return m_exprObj.getAxis();
- }
-
- class filterExprOwner implements ExpressionOwner
- {
- /**
- * @see ExpressionOwner#getExpression()
- */
- public Expression getExpression()
- {
- return m_expr;
- }
-
- /**
- * @see ExpressionOwner#setExpression(Expression)
- */
- public void setExpression(Expression exp)
- {
- exp.exprSetParent(FilterExprWalker.this);
- m_expr = exp;
- }
- }
-
- /**
- * This will traverse the heararchy, calling the visitor for
- * each member. If the called visitor method returns
- * false, the subtree should not be called.
- *
- * @param visitor The visitor whose appropriate method will be called.
- */
- public void callPredicateVisitors(XPathVisitor visitor)
- {
- m_expr.callVisitors(new filterExprOwner(), visitor);
-
- super.callPredicateVisitors(visitor);
- }
-
-
- /**
- * @see Expression#deepEquals(Expression)
- */
- public boolean deepEquals(Expression expr)
- {
- if (!super.deepEquals(expr))
- return false;
-
- FilterExprWalker walker = (FilterExprWalker)expr;
- if(!m_expr.deepEquals(walker.m_expr))
- return false;
-
- return true;
- }
-
-
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/axes/HasPositionalPredChecker.java b/src/com/sun/org/apache/xpath/internal/axes/HasPositionalPredChecker.java
deleted file mode 100644
index b089ec0..0000000
--- a/src/com/sun/org/apache/xpath/internal/axes/HasPositionalPredChecker.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: HasPositionalPredChecker.java,v 1.1.2.1 2005/08/01 01:30:24 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.axes;
-
-import com.sun.org.apache.xpath.internal.Expression;
-import com.sun.org.apache.xpath.internal.ExpressionOwner;
-import com.sun.org.apache.xpath.internal.XPathVisitor;
-import com.sun.org.apache.xpath.internal.functions.FuncLast;
-import com.sun.org.apache.xpath.internal.functions.FuncPosition;
-import com.sun.org.apache.xpath.internal.functions.Function;
-import com.sun.org.apache.xpath.internal.objects.XNumber;
-import com.sun.org.apache.xpath.internal.operations.Div;
-import com.sun.org.apache.xpath.internal.operations.Minus;
-import com.sun.org.apache.xpath.internal.operations.Mod;
-import com.sun.org.apache.xpath.internal.operations.Mult;
-import com.sun.org.apache.xpath.internal.operations.Plus;
-import com.sun.org.apache.xpath.internal.operations.Quo;
-import com.sun.org.apache.xpath.internal.operations.Variable;
-
-public class HasPositionalPredChecker extends XPathVisitor
-{
- private boolean m_hasPositionalPred = false;
- private int m_predDepth = 0;
-
- /**
- * Process the LocPathIterator to see if it contains variables
- * or functions that may make it context dependent.
- * @param path LocPathIterator that is assumed to be absolute, but needs checking.
- * @return true if the path is confirmed to be absolute, false if it
- * may contain context dependencies.
- */
- public static boolean check(LocPathIterator path)
- {
- HasPositionalPredChecker hppc = new HasPositionalPredChecker();
- path.callVisitors(null, hppc);
- return hppc.m_hasPositionalPred;
- }
-
- /**
- * Visit a function.
- * @param owner The owner of the expression, to which the expression can
- * be reset if rewriting takes place.
- * @param func The function reference object.
- * @return true if the sub expressions should be traversed.
- */
- public boolean visitFunction(ExpressionOwner owner, Function func)
- {
- if((func instanceof FuncPosition) ||
- (func instanceof FuncLast))
- m_hasPositionalPred = true;
- return true;
- }
-
-// /**
-// * Visit a variable reference.
-// * @param owner The owner of the expression, to which the expression can
-// * be reset if rewriting takes place.
-// * @param var The variable reference object.
-// * @return true if the sub expressions should be traversed.
-// */
-// public boolean visitVariableRef(ExpressionOwner owner, Variable var)
-// {
-// m_hasPositionalPred = true;
-// return true;
-// }
-
- /**
- * Visit a predicate within a location path. Note that there isn't a
- * proper unique component for predicates, and that the expression will
- * be called also for whatever type Expression is.
- *
- * @param owner The owner of the expression, to which the expression can
- * be reset if rewriting takes place.
- * @param pred The predicate object.
- * @return true if the sub expressions should be traversed.
- */
- public boolean visitPredicate(ExpressionOwner owner, Expression pred)
- {
- m_predDepth++;
-
- if(m_predDepth == 1)
- {
- if((pred instanceof Variable) ||
- (pred instanceof XNumber) ||
- (pred instanceof Div) ||
- (pred instanceof Plus) ||
- (pred instanceof Minus) ||
- (pred instanceof Mod) ||
- (pred instanceof Quo) ||
- (pred instanceof Mult) ||
- (pred instanceof com.sun.org.apache.xpath.internal.operations.Number) ||
- (pred instanceof Function))
- m_hasPositionalPred = true;
- else
- pred.callVisitors(owner, this);
- }
-
- m_predDepth--;
-
- // Don't go have the caller go any further down the subtree.
- return false;
- }
-
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/axes/IteratorPool.java b/src/com/sun/org/apache/xpath/internal/axes/IteratorPool.java
deleted file mode 100644
index ccaca31..0000000
--- a/src/com/sun/org/apache/xpath/internal/axes/IteratorPool.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: IteratorPool.java,v 1.2.4.1 2005/09/14 19:45:19 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.axes;
-
-import java.util.ArrayList;
-
-import com.sun.org.apache.xml.internal.dtm.DTMIterator;
-import com.sun.org.apache.xml.internal.utils.WrappedRuntimeException;
-
-/**
- * Pool of object of a given type to pick from to help memory usage
- * @xsl.usage internal
- */
-public final class IteratorPool implements java.io.Serializable
-{
- static final long serialVersionUID = -460927331149566998L;
-
- /**
- * Type of objects in this pool.
- */
- private final DTMIterator m_orig;
-
- /**
- * Stack of given objects this points to.
- */
- private final ArrayList m_freeStack;
-
- /**
- * Constructor IteratorPool
- *
- * @param original The original iterator from which all others will be cloned.
- */
- public IteratorPool(DTMIterator original)
- {
- m_orig = original;
- m_freeStack = new ArrayList();
- }
-
- /**
- * Get an instance of the given object in this pool
- *
- * @return An instance of the given object
- */
- public synchronized DTMIterator getInstanceOrThrow()
- throws CloneNotSupportedException
- {
- // Check if the pool is empty.
- if (m_freeStack.isEmpty())
- {
-
- // Create a new object if so.
- return (DTMIterator)m_orig.clone();
- }
- else
- {
- // Remove object from end of free pool.
- DTMIterator result = (DTMIterator)m_freeStack.remove(m_freeStack.size() - 1);
- return result;
- }
- }
-
- /**
- * Get an instance of the given object in this pool
- *
- * @return An instance of the given object
- */
- public synchronized DTMIterator getInstance()
- {
- // Check if the pool is empty.
- if (m_freeStack.isEmpty())
- {
-
- // Create a new object if so.
- try
- {
- return (DTMIterator)m_orig.clone();
- }
- catch (Exception ex)
- {
- throw new WrappedRuntimeException(ex);
- }
- }
- else
- {
- // Remove object from end of free pool.
- DTMIterator result = (DTMIterator)m_freeStack.remove(m_freeStack.size() - 1);
- return result;
- }
- }
-
- /**
- * Add an instance of the given object to the pool
- *
- *
- * @param obj Object to add.
- */
- public synchronized void freeInstance(DTMIterator obj)
- {
- m_freeStack.add(obj);
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/axes/LocPathIterator.java b/src/com/sun/org/apache/xpath/internal/axes/LocPathIterator.java
deleted file mode 100644
index 400e69d..0000000
--- a/src/com/sun/org/apache/xpath/internal/axes/LocPathIterator.java
+++ /dev/null
@@ -1,1035 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: LocPathIterator.java,v 1.2.4.2 2005/09/14 19:45:22 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.axes;
-
-import com.sun.org.apache.xalan.internal.res.XSLMessages;
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMFilter;
-import com.sun.org.apache.xml.internal.dtm.DTMIterator;
-import com.sun.org.apache.xml.internal.dtm.DTMManager;
-import com.sun.org.apache.xml.internal.utils.PrefixResolver;
-import com.sun.org.apache.xpath.internal.ExpressionOwner;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.XPathVisitor;
-import com.sun.org.apache.xpath.internal.compiler.Compiler;
-import com.sun.org.apache.xpath.internal.objects.XNodeSet;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
-
-/**
- * This class extends NodeSetDTM, which implements NodeIterator,
- * and fetches nodes one at a time in document order based on a XPath
- * <a href="http://www.w3.org/TR/xpath#NT-LocationPath>LocationPath</a>.
- *
- * <p>If setShouldCacheNodes(true) is called,
- * as each node is iterated via nextNode(), the node is also stored
- * in the NodeVector, so that previousNode() can easily be done, except in
- * the case where the LocPathIterator is "owned" by a UnionPathIterator,
- * in which case the UnionPathIterator will cache the nodes.</p>
- * @xsl.usage advanced
- */
-public abstract class LocPathIterator extends PredicatedNodeTest
- implements Cloneable, DTMIterator, java.io.Serializable, PathComponent
-{
- static final long serialVersionUID = -4602476357268405754L;
-
- /**
- * Create a LocPathIterator object.
- *
- */
- protected LocPathIterator()
- {
- }
-
-
- /**
- * Create a LocPathIterator object.
- *
- * @param nscontext The namespace context for this iterator,
- * should be OK if null.
- */
- protected LocPathIterator(PrefixResolver nscontext)
- {
-
- setLocPathIterator(this);
- m_prefixResolver = nscontext;
- }
-
- /**
- * Create a LocPathIterator object, including creation
- * of step walkers from the opcode list, and call back
- * into the Compiler to create predicate expressions.
- *
- * @param compiler The Compiler which is creating
- * this expression.
- * @param opPos The position of this iterator in the
- * opcode list from the compiler.
- *
- * @throws javax.xml.transform.TransformerException
- */
- protected LocPathIterator(Compiler compiler, int opPos, int analysis)
- throws javax.xml.transform.TransformerException
- {
- this(compiler, opPos, analysis, true);
- }
-
- /**
- * Create a LocPathIterator object, including creation
- * of step walkers from the opcode list, and call back
- * into the Compiler to create predicate expressions.
- *
- * @param compiler The Compiler which is creating
- * this expression.
- * @param opPos The position of this iterator in the
- * opcode list from the compiler.
- * @param shouldLoadWalkers True if walkers should be
- * loaded, or false if this is a derived iterator and
- * it doesn't wish to load child walkers.
- *
- * @throws javax.xml.transform.TransformerException
- */
- protected LocPathIterator(
- Compiler compiler, int opPos, int analysis, boolean shouldLoadWalkers)
- throws javax.xml.transform.TransformerException
- {
- setLocPathIterator(this);
- }
-
- /**
- * Get the analysis bits for this walker, as defined in the WalkerFactory.
- * @return One of WalkerFactory#BIT_DESCENDANT, etc.
- */
- public int getAnalysisBits()
- {
- int axis = getAxis();
- int bit = WalkerFactory.getAnalysisBitFromAxes(axis);
- return bit;
- }
-
- /**
- * Read the object from a serialization stream.
- *
- * @param stream Input stream to read from
- *
- * @throws java.io.IOException
- * @throws javax.xml.transform.TransformerException
- */
- private void readObject(java.io.ObjectInputStream stream)
- throws java.io.IOException, javax.xml.transform.TransformerException
- {
- try
- {
- stream.defaultReadObject();
- m_clones = new IteratorPool(this);
- }
- catch (ClassNotFoundException cnfe)
- {
- throw new javax.xml.transform.TransformerException(cnfe);
- }
- }
-
- /**
- * Set the environment in which this iterator operates, which should provide:
- * a node (the context node... same value as "root" defined below)
- * a pair of non-zero positive integers (the context position and the context size)
- * a set of variable bindings
- * a function library
- * the set of namespace declarations in scope for the expression.
- *
- * <p>At this time the exact implementation of this environment is application
- * dependent. Probably a proper interface will be created fairly soon.</p>
- *
- * @param environment The environment object.
- */
- public void setEnvironment(Object environment)
- {
- // no-op for now.
- }
-
- /**
- * Get an instance of a DTM that "owns" a node handle. Since a node
- * iterator may be passed without a DTMManager, this allows the
- * caller to easily get the DTM using just the iterator.
- *
- * @param nodeHandle the nodeHandle.
- *
- * @return a non-null DTM reference.
- */
- public DTM getDTM(int nodeHandle)
- {
- // %OPT%
- return m_execContext.getDTM(nodeHandle);
- }
-
- /**
- * Get an instance of the DTMManager. Since a node
- * iterator may be passed without a DTMManager, this allows the
- * caller to easily get the DTMManager using just the iterator.
- *
- * @return a non-null DTMManager reference.
- */
- public DTMManager getDTMManager()
- {
- return m_execContext.getDTMManager();
- }
-
- /**
- * Execute this iterator, meaning create a clone that can
- * store state, and initialize it for fast execution from
- * the current runtime state. When this is called, no actual
- * query from the current context node is performed.
- *
- * @param xctxt The XPath execution context.
- *
- * @return An XNodeSet reference that holds this iterator.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt)
- throws javax.xml.transform.TransformerException
- {
-
- XNodeSet iter = new XNodeSet((LocPathIterator)m_clones.getInstance());
-
- iter.setRoot(xctxt.getCurrentNode(), xctxt);
-
- return iter;
- }
-
- /**
- * Execute an expression in the XPath runtime context, and return the
- * result of the expression.
- *
- *
- * @param xctxt The XPath runtime context.
- * @param handler The target content handler.
- *
- * @return The result of the expression in the form of a <code>XObject</code>.
- *
- * @throws javax.xml.transform.TransformerException if a runtime exception
- * occurs.
- * @throws org.xml.sax.SAXException
- */
- public void executeCharsToContentHandler(
- XPathContext xctxt, org.xml.sax.ContentHandler handler)
- throws javax.xml.transform.TransformerException,
- org.xml.sax.SAXException
- {
- LocPathIterator clone = (LocPathIterator)m_clones.getInstance();
-
- int current = xctxt.getCurrentNode();
- clone.setRoot(current, xctxt);
-
- int node = clone.nextNode();
- DTM dtm = clone.getDTM(node);
- clone.detach();
-
- if(node != DTM.NULL)
- {
- dtm.dispatchCharactersEvents(node, handler, false);
- }
- }
-
- /**
- * Given an select expression and a context, evaluate the XPath
- * and return the resulting iterator.
- *
- * @param xctxt The execution context.
- * @param contextNode The node that "." expresses.
- * @throws TransformerException thrown if the active ProblemListener decides
- * the error condition is severe enough to halt processing.
- *
- * @throws javax.xml.transform.TransformerException
- * @xsl.usage experimental
- */
- public DTMIterator asIterator(
- XPathContext xctxt, int contextNode)
- throws javax.xml.transform.TransformerException
- {
- XNodeSet iter = new XNodeSet((LocPathIterator)m_clones.getInstance());
-
- iter.setRoot(contextNode, xctxt);
-
- return iter;
- }
-
-
- /**
- * Tell if the expression is a nodeset expression.
- *
- * @return true if the expression can be represented as a nodeset.
- */
- public boolean isNodesetExpr()
- {
- return true;
- }
-
- /**
- * Return the first node out of the nodeset, if this expression is
- * a nodeset expression. This is the default implementation for
- * nodesets. Derived classes should try and override this and return a
- * value without having to do a clone operation.
- * @param xctxt The XPath runtime context.
- * @return the first node out of the nodeset, or DTM.NULL.
- */
- public int asNode(XPathContext xctxt)
- throws javax.xml.transform.TransformerException
- {
- DTMIterator iter = (DTMIterator)m_clones.getInstance();
-
- int current = xctxt.getCurrentNode();
-
- iter.setRoot(current, xctxt);
-
- int next = iter.nextNode();
- // m_clones.freeInstance(iter);
- iter.detach();
- return next;
- }
-
- /**
- * Evaluate this operation directly to a boolean.
- *
- * @param xctxt The runtime execution context.
- *
- * @return The result of the operation as a boolean.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public boolean bool(XPathContext xctxt)
- throws javax.xml.transform.TransformerException
- {
- return (asNode(xctxt) != DTM.NULL);
- }
-
-
- /**
- * Set if this is an iterator at the upper level of
- * the XPath.
- *
- * @param b true if this location path is at the top level of the
- * expression.
- * @xsl.usage advanced
- */
- public void setIsTopLevel(boolean b)
- {
- m_isTopLevel = b;
- }
-
- /**
- * Get if this is an iterator at the upper level of
- * the XPath.
- *
- * @return true if this location path is at the top level of the
- * expression.
- * @xsl.usage advanced
- */
- public boolean getIsTopLevel()
- {
- return m_isTopLevel;
- }
-
- /**
- * Initialize the context values for this expression
- * after it is cloned.
- *
- * @param context The XPath runtime context for this
- * transformation.
- */
- public void setRoot(int context, Object environment)
- {
-
- m_context = context;
-
- XPathContext xctxt = (XPathContext)environment;
- m_execContext = xctxt;
- m_cdtm = xctxt.getDTM(context);
-
- m_currentContextNode = context; // only if top level?
-
- // Yech, shouldn't have to do this. -sb
- if(null == m_prefixResolver)
- m_prefixResolver = xctxt.getNamespaceContext();
-
- m_lastFetched = DTM.NULL;
- m_foundLast = false;
- m_pos = 0;
- m_length = -1;
-
- if (m_isTopLevel)
- this.m_stackFrame = xctxt.getVarStack().getStackFrame();
-
- // reset();
- }
-
- /**
- * Set the next position index of this iterator.
- *
- * @param next A value greater than or equal to zero that indicates the next
- * node position to fetch.
- */
- protected void setNextPosition(int next)
- {
- assertion(false, "setNextPosition not supported in this iterator!");
- }
-
- /**
- * Get the current position, which is one less than
- * the next nextNode() call will retrieve. i.e. if
- * you call getCurrentPos() and the return is 0, the next
- * fetch will take place at index 1.
- *
- * @return A value greater than or equal to zero that indicates the next
- * node position to fetch.
- */
- public final int getCurrentPos()
- {
- return m_pos;
- }
-
-
- /**
- * If setShouldCacheNodes(true) is called, then nodes will
- * be cached. They are not cached by default.
- *
- * @param b True if this iterator should cache nodes.
- */
- public void setShouldCacheNodes(boolean b)
- {
-
- assertion(false, "setShouldCacheNodes not supported by this iterater!");
- }
-
- /**
- * Tells if this iterator can have nodes added to it or set via
- * the <code>setItem(int node, int index)</code> method.
- *
- * @return True if the nodelist can be mutated.
- */
- public boolean isMutable()
- {
- return false;
- }
-
- /**
- * Set the current position in the node set.
- *
- * @param i Must be a valid index greater
- * than or equal to zero and less than m_cachedNodes.size().
- */
- public void setCurrentPos(int i)
- {
- assertion(false, "setCurrentPos not supported by this iterator!");
- }
-
- /**
- * Increment the current position in the node set.
- */
- public void incrementCurrentPos()
- {
- m_pos++;
- }
-
-
- /**
- * Get the length of the cached nodes.
- *
- * <p>Note: for the moment at least, this only returns
- * the size of the nodes that have been fetched to date,
- * it doesn't attempt to run to the end to make sure we
- * have found everything. This should be reviewed.</p>
- *
- * @return The size of the current cache list.
- */
- public int size()
- {
- assertion(false, "size() not supported by this iterator!");
- return 0;
- }
-
- /**
- * Returns the <code>index</code> th item in the collection. If
- * <code>index</code> is greater than or equal to the number of nodes in
- * the list, this returns <code>null</code> .
- * @param index Index into the collection.
- * @return The node at the <code>index</code> th position in the
- * <code>NodeList</code> , or <code>null</code> if that is not a valid
- * index.
- */
- public int item(int index)
- {
- assertion(false, "item(int index) not supported by this iterator!");
- return 0;
- }
-
- /**
- * Sets the node at the specified index of this vector to be the
- * specified node. The previous component at that position is discarded.
- *
- * <p>The index must be a value greater than or equal to 0 and less
- * than the current size of the vector.
- * The iterator must be in cached mode.</p>
- *
- * <p>Meant to be used for sorted iterators.</p>
- *
- * @param node Node to set
- * @param index Index of where to set the node
- */
- public void setItem(int node, int index)
- {
- assertion(false, "setItem not supported by this iterator!");
- }
-
- /**
- * The number of nodes in the list. The range of valid child node indices
- * is 0 to <code>length-1</code> inclusive.
- *
- * @return The number of nodes in the list, always greater or equal to zero.
- */
- public int getLength()
- {
- // Tell if this is being called from within a predicate.
- boolean isPredicateTest = (this == m_execContext.getSubContextList());
-
- // And get how many total predicates are part of this step.
- int predCount = getPredicateCount();
-
- // If we have already calculated the length, and the current predicate
- // is the first predicate, then return the length. We don't cache
- // the anything but the length of the list to the first predicate.
- if (-1 != m_length && isPredicateTest && m_predicateIndex < 1)
- return m_length;
-
- // I'm a bit worried about this one, since it doesn't have the
- // checks found above. I suspect it's fine. -sb
- if (m_foundLast)
- return m_pos;
-
- // Create a clone, and count from the current position to the end
- // of the list, not taking into account the current predicate and
- // predicates after the current one.
- int pos = (m_predicateIndex >= 0) ? getProximityPosition() : m_pos;
-
- LocPathIterator clone;
-
- try
- {
- clone = (LocPathIterator) clone();
- }
- catch (CloneNotSupportedException cnse)
- {
- return -1;
- }
-
- // We want to clip off the last predicate, but only if we are a sub
- // context node list, NOT if we are a context list. See pos68 test,
- // also test against bug4638.
- if (predCount > 0 && isPredicateTest)
- {
- // Don't call setPredicateCount, because it clones and is slower.
- clone.m_predCount = m_predicateIndex;
- // The line above used to be:
- // clone.m_predCount = predCount - 1;
- // ...which looks like a dumb bug to me. -sb
- }
-
- int next;
-
- while (DTM.NULL != (next = clone.nextNode()))
- {
- pos++;
- }
-
- if (isPredicateTest && m_predicateIndex < 1)
- m_length = pos;
-
- return pos;
- }
-
- /**
- * Tells if this NodeSetDTM is "fresh", in other words, if
- * the first nextNode() that is called will return the
- * first node in the set.
- *
- * @return true of nextNode has not been called.
- */
- public boolean isFresh()
- {
- return (m_pos == 0);
- }
-
- /**
- * Returns the previous node in the set and moves the position of the
- * iterator backwards in the set.
- * @return The previous <code>Node</code> in the set being iterated over,
- * or<code>null</code> if there are no more members in that set.
- */
- public int previousNode()
- {
- throw new RuntimeException(
- XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_CANNOT_ITERATE, null)); //"This NodeSetDTM can not iterate to a previous node!");
- }
-
- /**
- * This attribute determines which node types are presented via the
- * iterator. The available set of constants is defined in the
- * <code>NodeFilter</code> interface.
- *
- * <p>This is somewhat useless at this time, since it doesn't
- * really return information that tells what this iterator will
- * show. It is here only to fullfill the DOM NodeIterator
- * interface.</p>
- *
- * @return For now, always NodeFilter.SHOW_ALL & ~NodeFilter.SHOW_ENTITY_REFERENCE.
- * @see org.w3c.dom.traversal.NodeIterator
- */
- public int getWhatToShow()
- {
-
- // TODO: ??
- return DTMFilter.SHOW_ALL & ~DTMFilter.SHOW_ENTITY_REFERENCE;
- }
-
- /**
- * The filter used to screen nodes. Not used at this time,
- * this is here only to fullfill the DOM NodeIterator
- * interface.
- *
- * @return Always null.
- * @see org.w3c.dom.traversal.NodeIterator
- */
- public DTMFilter getFilter()
- {
- return null;
- }
-
- /**
- * The root node of the Iterator, as specified when it was created.
- *
- * @return The "root" of this iterator, which, in XPath terms,
- * is the node context for this iterator.
- */
- public int getRoot()
- {
- return m_context;
- }
-
- /**
- * The value of this flag determines whether the children of entity
- * reference nodes are visible to the iterator. If false, they will be
- * skipped over.
- * <br> To produce a view of the document that has entity references
- * expanded and does not expose the entity reference node itself, use the
- * whatToShow flags to hide the entity reference node and set
- * expandEntityReferences to true when creating the iterator. To produce
- * a view of the document that has entity reference nodes but no entity
- * expansion, use the whatToShow flags to show the entity reference node
- * and set expandEntityReferences to false.
- *
- * @return Always true, since entity reference nodes are not
- * visible in the XPath model.
- */
- public boolean getExpandEntityReferences()
- {
- return true;
- }
-
- /** Control over whether it is OK for detach to reset the iterator. */
- protected boolean m_allowDetach = true;
-
- /**
- * Specify if it's OK for detach to release the iterator for reuse.
- *
- * @param allowRelease true if it is OK for detach to release this iterator
- * for pooling.
- */
- public void allowDetachToRelease(boolean allowRelease)
- {
- m_allowDetach = allowRelease;
- }
-
- /**
- * Detaches the iterator from the set which it iterated over, releasing
- * any computational resources and placing the iterator in the INVALID
- * state. After<code>detach</code> has been invoked, calls to
- * <code>nextNode</code> or<code>previousNode</code> will raise the
- * exception INVALID_STATE_ERR.
- */
- public void detach()
- {
- if(m_allowDetach)
- {
- // sb: allow reusing of cached nodes when possible?
- // m_cachedNodes = null;
- m_execContext = null;
- // m_prefixResolver = null; sb: Why would this ever want to be null?
- m_cdtm = null;
- m_length = -1;
- m_pos = 0;
- m_lastFetched = DTM.NULL;
- m_context = DTM.NULL;
- m_currentContextNode = DTM.NULL;
-
- m_clones.freeInstance(this);
- }
- }
-
- /**
- * Reset the iterator.
- */
- public void reset()
- {
- assertion(false, "This iterator can not reset!");
- }
-
- /**
- * Get a cloned Iterator that is reset to the beginning
- * of the query.
- *
- * @return A cloned NodeIterator set of the start of the query.
- *
- * @throws CloneNotSupportedException
- */
- public DTMIterator cloneWithReset() throws CloneNotSupportedException
- {
- LocPathIterator clone;
-// clone = (LocPathIterator) clone();
- clone = (LocPathIterator)m_clones.getInstanceOrThrow();
- clone.m_execContext = m_execContext;
- clone.m_cdtm = m_cdtm;
-
- clone.m_context = m_context;
- clone.m_currentContextNode = m_currentContextNode;
- clone.m_stackFrame = m_stackFrame;
-
- // clone.reset();
-
- return clone;
- }
-
-// /**
-// * Get a cloned LocPathIterator that holds the same
-// * position as this iterator.
-// *
-// * @return A clone of this iterator that holds the same node position.
-// *
-// * @throws CloneNotSupportedException
-// */
-// public Object clone() throws CloneNotSupportedException
-// {
-//
-// LocPathIterator clone = (LocPathIterator) super.clone();
-//
-// return clone;
-// }
-
- /**
- * Returns the next node in the set and advances the position of the
- * iterator in the set. After a NodeIterator is created, the first call
- * to nextNode() returns the first node in the set.
- * @return The next <code>Node</code> in the set being iterated over, or
- * <code>null</code> if there are no more members in that set.
- */
- public abstract int nextNode();
-
- /**
- * Bottleneck the return of a next node, to make returns
- * easier from nextNode().
- *
- * @param nextNode The next node found, may be null.
- *
- * @return The same node that was passed as an argument.
- */
- protected int returnNextNode(int nextNode)
- {
-
- if (DTM.NULL != nextNode)
- {
- m_pos++;
- }
-
- m_lastFetched = nextNode;
-
- if (DTM.NULL == nextNode)
- m_foundLast = true;
-
- return nextNode;
- }
-
- /**
- * Return the last fetched node. Needed to support the UnionPathIterator.
- *
- * @return The last fetched node, or null if the last fetch was null.
- */
- public int getCurrentNode()
- {
- return m_lastFetched;
- }
-
- /**
- * If an index is requested, NodeSetDTM will call this method
- * to run the iterator to the index. By default this sets
- * m_next to the index. If the index argument is -1, this
- * signals that the iterator should be run to the end.
- *
- * @param index The index to run to, or -1 if the iterator
- * should run to the end.
- */
- public void runTo(int index)
- {
-
- if (m_foundLast || ((index >= 0) && (index <= getCurrentPos())))
- return;
-
- int n;
-
- if (-1 == index)
- {
- while (DTM.NULL != (n = nextNode()));
- }
- else
- {
- while (DTM.NULL != (n = nextNode()))
- {
- if (getCurrentPos() >= index)
- break;
- }
- }
- }
-
- /**
- * Tells if we've found the last node yet.
- *
- * @return true if the last nextNode returned null.
- */
- public final boolean getFoundLast()
- {
- return m_foundLast;
- }
-
- /**
- * The XPath execution context we are operating on.
- *
- * @return XPath execution context this iterator is operating on,
- * or null if setRoot has not been called.
- */
- public final XPathContext getXPathContext()
- {
- return m_execContext;
- }
-
- /**
- * The node context for the iterator.
- *
- * @return The node context, same as getRoot().
- */
- public final int getContext()
- {
- return m_context;
- }
-
- /**
- * The node context from where the expression is being
- * executed from (i.e. for current() support).
- *
- * @return The top-level node context of the entire expression.
- */
- public final int getCurrentContextNode()
- {
- return m_currentContextNode;
- }
-
- /**
- * Set the current context node for this iterator.
- *
- * @param n Must be a non-null reference to the node context.
- */
- public final void setCurrentContextNode(int n)
- {
- m_currentContextNode = n;
- }
-
-// /**
-// * Set the current context node for this iterator.
-// *
-// * @param n Must be a non-null reference to the node context.
-// */
-// public void setRoot(int n)
-// {
-// m_context = n;
-// m_cdtm = m_execContext.getDTM(n);
-// }
-
- /**
- * Return the saved reference to the prefix resolver that
- * was in effect when this iterator was created.
- *
- * @return The prefix resolver or this iterator, which may be null.
- */
- public final PrefixResolver getPrefixResolver()
- {
- if(null == m_prefixResolver)
- {
- m_prefixResolver = (PrefixResolver)getExpressionOwner();
- }
-
- return m_prefixResolver;
- }
-
-// /**
-// * Get the analysis pattern built by the WalkerFactory.
-// *
-// * @return The analysis pattern built by the WalkerFactory.
-// */
-// int getAnalysis()
-// {
-// return m_analysis;
-// }
-
-// /**
-// * Set the analysis pattern built by the WalkerFactory.
-// *
-// * @param a The analysis pattern built by the WalkerFactory.
-// */
-// void setAnalysis(int a)
-// {
-// m_analysis = a;
-// }
-
- /**
- * @see com.sun.org.apache.xpath.internal.XPathVisitable#callVisitors(ExpressionOwner, XPathVisitor)
- */
- public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)
- {
- if(visitor.visitLocationPath(owner, this))
- {
- visitor.visitStep(owner, this);
- callPredicateVisitors(visitor);
- }
- }
-
-
- //============= State Data =============
-
- /**
- * The pool for cloned iterators. Iterators need to be cloned
- * because the hold running state, and thus the original iterator
- * expression from the stylesheet pool can not be used.
- */
- transient protected IteratorPool m_clones = new IteratorPool(this);
-
- /**
- * The dtm of the context node. Careful about using this... it may not
- * be the dtm of the current node.
- */
- transient protected DTM m_cdtm;
-
- /**
- * The stack frame index for this iterator.
- */
- transient int m_stackFrame = -1;
-
- /**
- * Value determined at compile time, indicates that this is an
- * iterator at the top level of the expression, rather than inside
- * a predicate.
- * @serial
- */
- private boolean m_isTopLevel = false;
-
- /** The last node that was fetched, usually by nextNode. */
- transient public int m_lastFetched = DTM.NULL;
-
- /**
- * The context node for this iterator, which doesn't change through
- * the course of the iteration.
- */
- transient protected int m_context = DTM.NULL;
-
- /**
- * The node context from where the expression is being
- * executed from (i.e. for current() support). Different
- * from m_context in that this is the context for the entire
- * expression, rather than the context for the subexpression.
- */
- transient protected int m_currentContextNode = DTM.NULL;
-
- /**
- * The current position of the context node.
- */
- transient protected int m_pos = 0;
-
- transient protected int m_length = -1;
-
- /**
- * Fast access to the current prefix resolver. It isn't really
- * clear that this is needed.
- * @serial
- */
- private PrefixResolver m_prefixResolver;
-
- /**
- * The XPathContext reference, needed for execution of many
- * operations.
- */
- transient protected XPathContext m_execContext;
-
- /**
- * Returns true if all the nodes in the iteration well be returned in document
- * order.
- *
- * @return true as a default.
- */
- public boolean isDocOrdered()
- {
- return true;
- }
-
- /**
- * Returns the axis being iterated, if it is known.
- *
- * @return Axis.CHILD, etc., or -1 if the axis is not known or is of multiple
- * types.
- */
- public int getAxis()
- {
- return -1;
- }
-
-
-// /**
-// * The analysis pattern built by the WalkerFactory.
-// * TODO: Move to LocPathIterator.
-// * @see com.sun.org.apache.xpath.internal.axes.WalkerFactory
-// * @serial
-// */
-// protected int m_analysis = 0x00000000;
- /**
- * @see PredicatedNodeTest#getLastPos(XPathContext)
- */
- public int getLastPos(XPathContext xctxt)
- {
- return getLength();
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/axes/MatchPatternIterator.java b/src/com/sun/org/apache/xpath/internal/axes/MatchPatternIterator.java
deleted file mode 100644
index edba3a2..0000000
--- a/src/com/sun/org/apache/xpath/internal/axes/MatchPatternIterator.java
+++ /dev/null
@@ -1,333 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: MatchPatternIterator.java,v 1.2.4.2 2005/09/14 19:45:22 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.axes;
-
-import com.sun.org.apache.xml.internal.dtm.Axis;
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMAxisTraverser;
-import com.sun.org.apache.xml.internal.dtm.DTMIterator;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.compiler.Compiler;
-import com.sun.org.apache.xpath.internal.compiler.OpMap;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-import com.sun.org.apache.xpath.internal.patterns.NodeTest;
-import com.sun.org.apache.xpath.internal.patterns.StepPattern;
-
-/**
- * This class treats a
- * <a href="http://www.w3.org/TR/xpath#location-paths">LocationPath</a> as a
- * filtered iteration over the tree, evaluating each node in a super axis
- * traversal against the LocationPath interpreted as a match pattern. This
- * class is useful to find nodes in document order that are complex paths
- * whose steps probably criss-cross each other.
- */
-public class MatchPatternIterator extends LocPathIterator
-{
- static final long serialVersionUID = -5201153767396296474L;
-
- /** This is the select pattern, translated into a match pattern. */
- protected StepPattern m_pattern;
-
- /** The traversal axis from where the nodes will be filtered. */
- protected int m_superAxis = -1;
-
- /** The DTM inner traversal class, that corresponds to the super axis. */
- protected DTMAxisTraverser m_traverser;
-
- /** DEBUG flag for diagnostic dumps. */
- private static final boolean DEBUG = false;
-
-// protected int m_nsElemBase = DTM.NULL;
-
- /**
- * Create a LocPathIterator object, including creation
- * of step walkers from the opcode list, and call back
- * into the Compiler to create predicate expressions.
- *
- * @param compiler The Compiler which is creating
- * this expression.
- * @param opPos The position of this iterator in the
- * opcode list from the compiler.
- * @param analysis Analysis bits that give general information about the
- * LocationPath.
- *
- * @throws javax.xml.transform.TransformerException
- */
- MatchPatternIterator(Compiler compiler, int opPos, int analysis)
- throws javax.xml.transform.TransformerException
- {
-
- super(compiler, opPos, analysis, false);
-
- int firstStepPos = OpMap.getFirstChildPos(opPos);
-
- m_pattern = WalkerFactory.loadSteps(this, compiler, firstStepPos, 0);
-
- boolean fromRoot = false;
- boolean walkBack = false;
- boolean walkDescendants = false;
- boolean walkAttributes = false;
-
- if (0 != (analysis & (WalkerFactory.BIT_ROOT |
- WalkerFactory.BIT_ANY_DESCENDANT_FROM_ROOT)))
- fromRoot = true;
-
- if (0 != (analysis
- & (WalkerFactory.BIT_ANCESTOR
- | WalkerFactory.BIT_ANCESTOR_OR_SELF
- | WalkerFactory.BIT_PRECEDING
- | WalkerFactory.BIT_PRECEDING_SIBLING
- | WalkerFactory.BIT_FOLLOWING
- | WalkerFactory.BIT_FOLLOWING_SIBLING
- | WalkerFactory.BIT_PARENT | WalkerFactory.BIT_FILTER)))
- walkBack = true;
-
- if (0 != (analysis
- & (WalkerFactory.BIT_DESCENDANT_OR_SELF
- | WalkerFactory.BIT_DESCENDANT
- | WalkerFactory.BIT_CHILD)))
- walkDescendants = true;
-
- if (0 != (analysis
- & (WalkerFactory.BIT_ATTRIBUTE | WalkerFactory.BIT_NAMESPACE)))
- walkAttributes = true;
-
- if(false || DEBUG)
- {
- System.out.print("analysis: "+Integer.toBinaryString(analysis));
- System.out.println(", "+WalkerFactory.getAnalysisString(analysis));
- }
-
- if(fromRoot || walkBack)
- {
- if(walkAttributes)
- {
- m_superAxis = Axis.ALL;
- }
- else
- {
- m_superAxis = Axis.DESCENDANTSFROMROOT;
- }
- }
- else if(walkDescendants)
- {
- if(walkAttributes)
- {
- m_superAxis = Axis.ALLFROMNODE;
- }
- else
- {
- m_superAxis = Axis.DESCENDANTORSELF;
- }
- }
- else
- {
- m_superAxis = Axis.ALL;
- }
- if(false || DEBUG)
- {
- System.out.println("axis: "+Axis.getNames(m_superAxis));
- }
-
- }
-
-
- /**
- * Initialize the context values for this expression
- * after it is cloned.
- *
- * @param context The XPath runtime context for this
- * transformation.
- */
- public void setRoot(int context, Object environment)
- {
- super.setRoot(context, environment);
- m_traverser = m_cdtm.getAxisTraverser(m_superAxis);
- }
-
- /**
- * Detaches the iterator from the set which it iterated over, releasing
- * any computational resources and placing the iterator in the INVALID
- * state. After<code>detach</code> has been invoked, calls to
- * <code>nextNode</code> or<code>previousNode</code> will raise the
- * exception INVALID_STATE_ERR.
- */
- public void detach()
- {
- if(m_allowDetach)
- {
- m_traverser = null;
-
- // Always call the superclass detach last!
- super.detach();
- }
- }
-
- /**
- * Get the next node via getNextXXX. Bottlenecked for derived class override.
- * @return The next node on the axis, or DTM.NULL.
- */
- protected int getNextNode()
- {
- m_lastFetched = (DTM.NULL == m_lastFetched)
- ? m_traverser.first(m_context)
- : m_traverser.next(m_context, m_lastFetched);
- return m_lastFetched;
- }
-
- /**
- * Returns the next node in the set and advances the position of the
- * iterator in the set. After a NodeIterator is created, the first call
- * to nextNode() returns the first node in the set.
- * @return The next <code>Node</code> in the set being iterated over, or
- * <code>null</code> if there are no more members in that set.
- */
- public int nextNode()
- {
- if(m_foundLast)
- return DTM.NULL;
-
- int next;
-
- com.sun.org.apache.xpath.internal.VariableStack vars;
- int savedStart;
- if (-1 != m_stackFrame)
- {
- vars = m_execContext.getVarStack();
-
- // These three statements need to be combined into one operation.
- savedStart = vars.getStackFrame();
-
- vars.setStackFrame(m_stackFrame);
- }
- else
- {
- // Yuck. Just to shut up the compiler!
- vars = null;
- savedStart = 0;
- }
-
- try
- {
- if(DEBUG)
- System.out.println("m_pattern"+m_pattern.toString());
-
- do
- {
- next = getNextNode();
-
- if (DTM.NULL != next)
- {
- if(DTMIterator.FILTER_ACCEPT == acceptNode(next, m_execContext))
- break;
- else
- continue;
- }
- else
- break;
- }
- while (next != DTM.NULL);
-
- if (DTM.NULL != next)
- {
- if(DEBUG)
- {
- System.out.println("next: "+next);
- System.out.println("name: "+m_cdtm.getNodeName(next));
- }
- incrementCurrentPos();
-
- return next;
- }
- else
- {
- m_foundLast = true;
-
- return DTM.NULL;
- }
- }
- finally
- {
- if (-1 != m_stackFrame)
- {
- // These two statements need to be combined into one operation.
- vars.setStackFrame(savedStart);
- }
- }
-
- }
-
- /**
- * Test whether a specified node is visible in the logical view of a
- * TreeWalker or NodeIterator. This function will be called by the
- * implementation of TreeWalker and NodeIterator; it is not intended to
- * be called directly from user code.
- * @param n The node to check to see if it passes the filter or not.
- * @return a constant to determine whether the node is accepted,
- * rejected, or skipped, as defined above .
- */
- public short acceptNode(int n, XPathContext xctxt)
- {
-
- try
- {
- xctxt.pushCurrentNode(n);
- xctxt.pushIteratorRoot(m_context);
- if(DEBUG)
- {
- System.out.println("traverser: "+m_traverser);
- System.out.print("node: "+n);
- System.out.println(", "+m_cdtm.getNodeName(n));
- // if(m_cdtm.getNodeName(n).equals("near-east"))
- System.out.println("pattern: "+m_pattern.toString());
- m_pattern.debugWhatToShow(m_pattern.getWhatToShow());
- }
-
- XObject score = m_pattern.execute(xctxt);
-
- if(DEBUG)
- {
- // System.out.println("analysis: "+Integer.toBinaryString(m_analysis));
- System.out.println("score: "+score);
- System.out.println("skip: "+(score == NodeTest.SCORE_NONE));
- }
-
- // System.out.println("\n::acceptNode - score: "+score.num()+"::");
- return (score == NodeTest.SCORE_NONE) ? DTMIterator.FILTER_SKIP
- : DTMIterator.FILTER_ACCEPT;
- }
- catch (javax.xml.transform.TransformerException se)
- {
-
- // TODO: Fix this.
- throw new RuntimeException(se.getMessage());
- }
- finally
- {
- xctxt.popCurrentNode();
- xctxt.popIteratorRoot();
- }
-
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/axes/NodeSequence.java b/src/com/sun/org/apache/xpath/internal/axes/NodeSequence.java
deleted file mode 100644
index 53e5287..0000000
--- a/src/com/sun/org/apache/xpath/internal/axes/NodeSequence.java
+++ /dev/null
@@ -1,961 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2002-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: NodeSequence.java,v 1.6 2007/01/12 19:26:42 spericas Exp $
- */
-package com.sun.org.apache.xpath.internal.axes;
-
-import java.util.Vector;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMFilter;
-import com.sun.org.apache.xml.internal.dtm.DTMIterator;
-import com.sun.org.apache.xml.internal.dtm.DTMManager;
-import com.sun.org.apache.xml.internal.utils.NodeVector;
-import com.sun.org.apache.xpath.internal.NodeSetDTM;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-/**
- * This class is the dynamic wrapper for a Xalan DTMIterator instance, and
- * provides random access capabilities.
- */
-public class NodeSequence extends XObject
- implements DTMIterator, Cloneable, PathComponent
-{
- static final long serialVersionUID = 3866261934726581044L;
- /** The index of the last node in the iteration. */
- protected int m_last = -1;
-
- /**
- * The index of the next node to be fetched. Useful if this
- * is a cached iterator, and is being used as random access
- * NodeList.
- */
- protected int m_next = 0;
-
- /**
- * A cache of a list of nodes obtained from the iterator so far.
- * This list is appended to until the iterator is exhausted and
- * the cache is complete.
- * <p>
- * Multiple NodeSequence objects may share the same cache.
- */
- private IteratorCache m_cache;
-
- /**
- * If this iterator needs to cache nodes that are fetched, they
- * are stored in the Vector in the generic object.
- */
- protected NodeVector getVector() {
- NodeVector nv = (m_cache != null) ? m_cache.getVector() : null;
- return nv;
- }
-
- /**
- * Get the cache (if any) of nodes obtained from
- * the iterator so far. Note that the cache keeps
- * growing until the iterator is walked to exhaustion,
- * at which point the cache is "complete".
- */
- private IteratorCache getCache() {
- return m_cache;
- }
-
- /**
- * Set the vector where nodes will be cached.
- */
- protected void SetVector(NodeVector v)
- {
- setObject(v);
- }
-
-
- /**
- * If the iterator needs to cache nodes as they are fetched,
- * then this method returns true.
- */
- public boolean hasCache()
- {
- final NodeVector nv = getVector();
- return (nv != null);
- }
-
- /**
- * If this NodeSequence has a cache, and that cache is
- * fully populated then this method returns true, otherwise
- * if there is no cache or it is not complete it returns false.
- */
- private boolean cacheComplete() {
- final boolean complete;
- if (m_cache != null) {
- complete = m_cache.isComplete();
- } else {
- complete = false;
- }
- return complete;
- }
-
- /**
- * If this NodeSequence has a cache, mark that it is complete.
- * This method should be called after the iterator is exhausted.
- */
- private void markCacheComplete() {
- NodeVector nv = getVector();
- if (nv != null) {
- m_cache.setCacheComplete(true);
- }
- }
-
-
- /**
- * The functional iterator that fetches nodes.
- */
- protected DTMIterator m_iter;
-
- /**
- * Set the functional iterator that fetches nodes.
- * @param iter The iterator that is to be contained.
- */
- public final void setIter(DTMIterator iter)
- {
- m_iter = iter;
- }
-
- /**
- * Get the functional iterator that fetches nodes.
- * @return The contained iterator.
- */
- public final DTMIterator getContainedIter()
- {
- return m_iter;
- }
-
- /**
- * The DTMManager to use if we're using a NodeVector only.
- * We may well want to do away with this, and store it in the NodeVector.
- */
- protected DTMManager m_dtmMgr;
-
- // ==== Constructors ====
-
- /**
- * Create a new NodeSequence from a (already cloned) iterator.
- *
- * @param iter Cloned (not static) DTMIterator.
- * @param context The initial context node.
- * @param xctxt The execution context.
- * @param shouldCacheNodes True if this sequence can random access.
- */
- private NodeSequence(DTMIterator iter, int context, XPathContext xctxt, boolean shouldCacheNodes)
- {
- setIter(iter);
- setRoot(context, xctxt);
- setShouldCacheNodes(shouldCacheNodes);
- }
-
- /**
- * Create a new NodeSequence from a (already cloned) iterator.
- *
- * @param nodeVector
- */
- public NodeSequence(Object nodeVector)
- {
- super(nodeVector);
- if (nodeVector instanceof NodeVector) {
- SetVector((NodeVector) nodeVector);
- }
- if(null != nodeVector)
- {
- assertion(nodeVector instanceof NodeVector,
- "Must have a NodeVector as the object for NodeSequence!");
- if(nodeVector instanceof DTMIterator)
- {
- setIter((DTMIterator)nodeVector);
- m_last = ((DTMIterator)nodeVector).getLength();
- }
-
- }
- }
-
- /**
- * Construct an empty XNodeSet object. This is used to create a mutable
- * nodeset to which random nodes may be added.
- */
- private NodeSequence(DTMManager dtmMgr)
- {
- super(new NodeVector());
- m_last = 0;
- m_dtmMgr = dtmMgr;
- }
-
-
- /**
- * Create a new NodeSequence in an invalid (null) state.
- */
- public NodeSequence()
- {
- return;
- }
-
-
- /**
- * @see DTMIterator#getDTM(int)
- */
- public DTM getDTM(int nodeHandle)
- {
- DTMManager mgr = getDTMManager();
- if(null != mgr)
- return getDTMManager().getDTM(nodeHandle);
- else
- {
- assertion(false, "Can not get a DTM Unless a DTMManager has been set!");
- return null;
- }
- }
-
- /**
- * @see DTMIterator#getDTMManager()
- */
- public DTMManager getDTMManager()
- {
- return m_dtmMgr;
- }
-
- /**
- * @see DTMIterator#getRoot()
- */
- public int getRoot()
- {
- if(null != m_iter)
- return m_iter.getRoot();
- else
- {
- // NodeSetDTM will call this, and so it's not a good thing to throw
- // an assertion here.
- // assertion(false, "Can not get the root from a non-iterated NodeSequence!");
- return DTM.NULL;
- }
- }
-
- /**
- * @see DTMIterator#setRoot(int, Object)
- */
- public void setRoot(int nodeHandle, Object environment)
- {
- // If root is DTM.NULL, then something's wrong with the context
- if (nodeHandle == DTM.NULL)
- {
- throw new RuntimeException("Unable to evaluate expression using " +
- "this context");
- }
-
- if(null != m_iter)
- {
- XPathContext xctxt = (XPathContext)environment;
- m_dtmMgr = xctxt.getDTMManager();
- m_iter.setRoot(nodeHandle, environment);
- if(!m_iter.isDocOrdered())
- {
- if(!hasCache())
- setShouldCacheNodes(true);
- runTo(-1);
- m_next=0;
- }
- }
- else
- assertion(false, "Can not setRoot on a non-iterated NodeSequence!");
- }
-
- /**
- * @see DTMIterator#reset()
- */
- public void reset()
- {
- m_next = 0;
- // not resetting the iterator on purpose!!!
- }
-
- /**
- * @see DTMIterator#getWhatToShow()
- */
- public int getWhatToShow()
- {
- return hasCache() ? (DTMFilter.SHOW_ALL & ~DTMFilter.SHOW_ENTITY_REFERENCE)
- : m_iter.getWhatToShow();
- }
-
- /**
- * @see DTMIterator#getExpandEntityReferences()
- */
- public boolean getExpandEntityReferences()
- {
- if(null != m_iter)
- return m_iter.getExpandEntityReferences();
- else
- return true;
- }
-
- /**
- * @see DTMIterator#nextNode()
- */
- public int nextNode()
- {
- // If the cache is on, and the node has already been found, then
- // just return from the list.
- NodeVector vec = getVector();
- if (null != vec)
- {
- // There is a cache
- if(m_next < vec.size())
- {
- // The node is in the cache, so just return it.
- int next = vec.elementAt(m_next);
- m_next++;
- return next;
- }
- else if(cacheComplete() || (-1 != m_last) || (null == m_iter))
- {
- m_next++;
- return DTM.NULL;
- }
- }
-
- if (null == m_iter)
- return DTM.NULL;
-
- int next = m_iter.nextNode();
- if(DTM.NULL != next)
- {
- if(hasCache())
- {
- if(m_iter.isDocOrdered())
- {
- getVector().addElement(next);
- m_next++;
- }
- else
- {
- int insertIndex = addNodeInDocOrder(next);
- if(insertIndex >= 0)
- m_next++;
- }
- }
- else
- m_next++;
- }
- else
- {
- // We have exhausted the iterator, and if there is a cache
- // it must have all nodes in it by now, so let the cache
- // know that it is complete.
- markCacheComplete();
-
- m_last = m_next;
- m_next++;
- }
-
- return next;
- }
-
- /**
- * @see DTMIterator#previousNode()
- */
- public int previousNode()
- {
- if(hasCache())
- {
- if(m_next <= 0)
- return DTM.NULL;
- else
- {
- m_next--;
- return item(m_next);
- }
- }
- else
- {
- int n = m_iter.previousNode();
- m_next = m_iter.getCurrentPos();
- return m_next;
- }
- }
-
- /**
- * @see DTMIterator#detach()
- */
- public void detach()
- {
- if(null != m_iter)
- m_iter.detach();
- super.detach();
- }
-
- /**
- * Calling this with a value of false will cause the nodeset
- * to be cached.
- * @see DTMIterator#allowDetachToRelease(boolean)
- */
- public void allowDetachToRelease(boolean allowRelease)
- {
- if((false == allowRelease) && !hasCache())
- {
- setShouldCacheNodes(true);
- }
-
- if(null != m_iter)
- m_iter.allowDetachToRelease(allowRelease);
- super.allowDetachToRelease(allowRelease);
- }
-
- /**
- * @see DTMIterator#getCurrentNode()
- */
- public int getCurrentNode()
- {
- if(hasCache())
- {
- int currentIndex = m_next-1;
- NodeVector vec = getVector();
- if((currentIndex >= 0) && (currentIndex < vec.size()))
- return vec.elementAt(currentIndex);
- else
- return DTM.NULL;
- }
-
- if(null != m_iter)
- {
- return m_iter.getCurrentNode();
- }
- else
- return DTM.NULL;
- }
-
- /**
- * @see DTMIterator#isFresh()
- */
- public boolean isFresh()
- {
- return (0 == m_next);
- }
-
- /**
- * @see DTMIterator#setShouldCacheNodes(boolean)
- */
- public void setShouldCacheNodes(boolean b)
- {
- if (b)
- {
- if(!hasCache())
- {
- SetVector(new NodeVector());
- }
-// else
-// getVector().RemoveAllNoClear(); // Is this good?
- }
- else
- SetVector(null);
- }
-
- /**
- * @see DTMIterator#isMutable()
- */
- public boolean isMutable()
- {
- return hasCache(); // though may be surprising if it also has an iterator!
- }
-
- /**
- * @see DTMIterator#getCurrentPos()
- */
- public int getCurrentPos()
- {
- return m_next;
- }
-
- /**
- * @see DTMIterator#runTo(int)
- */
- public void runTo(int index)
- {
- int n;
-
- if (-1 == index)
- {
- int pos = m_next;
- while (DTM.NULL != (n = nextNode()));
- m_next = pos;
- }
- else if(m_next == index)
- {
- return;
- }
- else if(hasCache() && index < getVector().size())
- {
- m_next = index;
- }
- else if((null == getVector()) && (index < m_next))
- {
- while ((m_next >= index) && DTM.NULL != (n = previousNode()));
- }
- else
- {
- while ((m_next < index) && DTM.NULL != (n = nextNode()));
- }
-
- }
-
- /**
- * @see DTMIterator#setCurrentPos(int)
- */
- public void setCurrentPos(int i)
- {
- runTo(i);
- }
-
- /**
- * @see DTMIterator#item(int)
- */
- public int item(int index)
- {
- setCurrentPos(index);
- int n = nextNode();
- m_next = index;
- return n;
- }
-
- /**
- * @see DTMIterator#setItem(int, int)
- */
- public void setItem(int node, int index)
- {
- NodeVector vec = getVector();
- if(null != vec)
- {
- int oldNode = vec.elementAt(index);
- if (oldNode != node && m_cache.useCount() > 1) {
- /* If we are going to set the node at the given index
- * to a different value, and the cache is shared
- * (has a use count greater than 1)
- * then make a copy of the cache and use it
- * so we don't overwrite the value for other
- * users of the cache.
- */
- IteratorCache newCache = new IteratorCache();
- final NodeVector nv;
- try {
- nv = (NodeVector) vec.clone();
- } catch (CloneNotSupportedException e) {
- // This should never happen
- e.printStackTrace();
- RuntimeException rte = new RuntimeException(e.getMessage());
- throw rte;
- }
- newCache.setVector(nv);
- newCache.setCacheComplete(true);
- m_cache = newCache;
- vec = nv;
-
- // Keep our superclass informed of the current NodeVector
- super.setObject(nv);
-
- /* When we get to here the new cache has
- * a use count of 1 and when setting a
- * bunch of values on the same NodeSequence,
- * such as when sorting, we will keep setting
- * values in that same copy which has a use count of 1.
- */
- }
- vec.setElementAt(node, index);
- m_last = vec.size();
- }
- else
- m_iter.setItem(node, index);
- }
-
- /**
- * @see DTMIterator#getLength()
- */
- public int getLength()
- {
- IteratorCache cache = getCache();
-
- if(cache != null)
- {
- // Nodes from the iterator are cached
- if (cache.isComplete()) {
- // All of the nodes from the iterator are cached
- // so just return the number of nodes in the cache
- NodeVector nv = cache.getVector();
- return nv.size();
- }
-
- // If this NodeSequence wraps a mutable nodeset, then
- // m_last will not reflect the size of the nodeset if
- // it has been mutated...
- if (m_iter instanceof NodeSetDTM)
- {
- return m_iter.getLength();
- }
-
- if(-1 == m_last)
- {
- int pos = m_next;
- runTo(-1);
- m_next = pos;
- }
- return m_last;
- }
- else
- {
- return (-1 == m_last) ? (m_last = m_iter.getLength()) : m_last;
- }
- }
-
- /**
- * Note: Not a deep clone.
- * @see DTMIterator#cloneWithReset()
- */
- public DTMIterator cloneWithReset() throws CloneNotSupportedException
- {
- NodeSequence seq = (NodeSequence)super.clone();
- seq.m_next = 0;
- if (m_cache != null) {
- // In making this clone of an iterator we are making
- // another NodeSequence object it has a reference
- // to the same IteratorCache object as the original
- // so we need to remember that more than one
- // NodeSequence object shares the cache.
- m_cache.increaseUseCount();
- }
-
- return seq;
- }
-
- /**
- * Get a clone of this iterator, but don't reset the iteration in the
- * process, so that it may be used from the current position.
- * Note: Not a deep clone.
- *
- * @return A clone of this object.
- *
- * @throws CloneNotSupportedException
- */
- public Object clone() throws CloneNotSupportedException
- {
- NodeSequence clone = (NodeSequence) super.clone();
- if (null != m_iter) clone.m_iter = (DTMIterator) m_iter.clone();
- if (m_cache != null) {
- // In making this clone of an iterator we are making
- // another NodeSequence object it has a reference
- // to the same IteratorCache object as the original
- // so we need to remember that more than one
- // NodeSequence object shares the cache.
- m_cache.increaseUseCount();
- }
-
- return clone;
- }
-
-
- /**
- * @see DTMIterator#isDocOrdered()
- */
- public boolean isDocOrdered()
- {
- if(null != m_iter)
- return m_iter.isDocOrdered();
- else
- return true; // can't be sure?
- }
-
- /**
- * @see DTMIterator#getAxis()
- */
- public int getAxis()
- {
- if(null != m_iter)
- return m_iter.getAxis();
- else
- {
- assertion(false, "Can not getAxis from a non-iterated node sequence!");
- return 0;
- }
- }
-
- /**
- * @see PathComponent#getAnalysisBits()
- */
- public int getAnalysisBits()
- {
- if((null != m_iter) && (m_iter instanceof PathComponent))
- return ((PathComponent)m_iter).getAnalysisBits();
- else
- return 0;
- }
-
- /**
- * @see org.apache.xpath.Expression#fixupVariables(Vector, int)
- */
- public void fixupVariables(Vector vars, int globalsSize)
- {
- super.fixupVariables(vars, globalsSize);
- }
-
- /**
- * Add the node into a vector of nodes where it should occur in
- * document order.
- * @param node The node to be added.
- * @return insertIndex.
- * @throws RuntimeException thrown if this NodeSetDTM is not of
- * a mutable type.
- */
- protected int addNodeInDocOrder(int node)
- {
- assertion(hasCache(), "addNodeInDocOrder must be done on a mutable sequence!");
-
- int insertIndex = -1;
-
- NodeVector vec = getVector();
-
- // This needs to do a binary search, but a binary search
- // is somewhat tough because the sequence test involves
- // two nodes.
- int size = vec.size(), i;
-
- for (i = size - 1; i >= 0; i--)
- {
- int child = vec.elementAt(i);
-
- if (child == node)
- {
- i = -2; // Duplicate, suppress insert
-
- break;
- }
-
- DTM dtm = m_dtmMgr.getDTM(node);
- if (!dtm.isNodeAfter(node, child))
- {
- break;
- }
- }
-
- if (i != -2)
- {
- insertIndex = i + 1;
-
- vec.insertElementAt(node, insertIndex);
- }
-
- // checkDups();
- return insertIndex;
- } // end addNodeInDocOrder(Vector v, Object obj)
-
- /**
- * It used to be that many locations in the code simply
- * did an assignment to this.m_obj directly, rather than
- * calling the setObject(Object) method. The problem is
- * that our super-class would be updated on what the
- * cache associated with this NodeSequence, but
- * we wouldn't know ourselves.
- * <p>
- * All setting of m_obj is done through setObject() now,
- * and this method over-rides the super-class method.
- * So now we are in the loop have an opportunity
- * to update some caching information.
- *
- */
- protected void setObject(Object obj) {
- if (obj instanceof NodeVector) {
- // Keep our superclass informed of the current NodeVector
- // ... if we don't the smoketest fails (don't know why).
- super.setObject(obj);
-
- // A copy of the code of what SetVector() would do.
- NodeVector v = (NodeVector)obj;
- if (m_cache != null) {
- m_cache.setVector(v);
- } else if (v!=null) {
- m_cache = new IteratorCache();
- m_cache.setVector(v);
- }
- } else if (obj instanceof IteratorCache) {
- IteratorCache cache = (IteratorCache) obj;
- m_cache = cache;
- m_cache.increaseUseCount();
-
- // Keep our superclass informed of the current NodeVector
- super.setObject(cache.getVector());
- } else {
- super.setObject(obj);
- }
-
- }
-
- /**
- * Each NodeSequence object has an iterator which is "walked".
- * As an iterator is walked one obtains nodes from it.
- * As those nodes are obtained they may be cached, making
- * the next walking of a copy or clone of the iterator faster.
- * This field (m_cache) is a reference to such a cache,
- * which is populated as the iterator is walked.
- * <p>
- * Note that multiple NodeSequence objects may hold a
- * reference to the same cache, and also
- * (and this is important) the same iterator.
- * The iterator and its cache may be shared among
- * many NodeSequence objects.
- * <p>
- * If one of the NodeSequence objects walks ahead
- * of the others it fills in the cache.
- * As the others NodeSequence objects catch up they
- * get their values from
- * the cache rather than the iterator itself, so
- * the iterator is only ever walked once and everyone
- * benefits from the cache.
- * <p>
- * At some point the cache may be
- * complete due to walking to the end of one of
- * the copies of the iterator, and the cache is
- * then marked as "complete".
- * and the cache will have no more nodes added to it.
- * <p>
- * Its use-count is the number of NodeSequence objects that use it.
- */
- private final static class IteratorCache {
- /**
- * A list of nodes already obtained from the iterator.
- * As the iterator is walked the nodes obtained from
- * it are appended to this list.
- * <p>
- * Both an iterator and its corresponding cache can
- * be shared by multiple NodeSequence objects.
- * <p>
- * For example, consider three NodeSequence objects
- * ns1, ns2 and ns3 doing such sharing, and the
- * nodes to be obtaind from the iterator being
- * the sequence { 33, 11, 44, 22, 55 }.
- * <p>
- * If ns3.nextNode() is called 3 times the the
- * underlying iterator will have walked through
- * 33, 11, 55 and these three nodes will have been put
- * in the cache.
- * <p>
- * If ns2.nextNode() is called 2 times it will return
- * 33 and 11 from the cache, leaving the iterator alone.
- * <p>
- * If ns1.nextNode() is called 6 times it will return
- * 33 and 11 from the cache, then get 44, 22, 55 from
- * the iterator, and appending 44, 22, 55 to the cache.
- * On the sixth call it is found that the iterator is
- * exhausted and the cache is marked complete.
- * <p>
- * Should ns2 or ns3 have nextNode() called they will
- * know that the cache is complete, and they will
- * obtain all subsequent nodes from the cache.
- * <p>
- * Note that the underlying iterator, though shared
- * is only ever walked once.
- */
- private NodeVector m_vec2;
-
- /**
- * true if the associated iterator is exhausted and
- * all nodes obtained from it are in the cache.
- */
- private boolean m_isComplete2;
-
- private int m_useCount2;
-
- IteratorCache() {
- m_vec2 = null;
- m_isComplete2 = false;
- m_useCount2 = 1;
- return;
- }
-
- /**
- * Returns count of how many NodeSequence objects share this
- * IteratorCache object.
- */
- private int useCount() {
- return m_useCount2;
- }
-
- /**
- * This method is called when yet another
- * NodeSequence object uses, or shares
- * this same cache.
- *
- */
- private void increaseUseCount() {
- if (m_vec2 != null)
- m_useCount2++;
-
- }
-
- /**
- * Sets the NodeVector that holds the
- * growing list of nodes as they are appended
- * to the cached list.
- */
- private void setVector(NodeVector nv) {
- m_vec2 = nv;
- m_useCount2 = 1;
- }
-
- /**
- * Get the cached list of nodes obtained from
- * the iterator so far.
- */
- private NodeVector getVector() {
- return m_vec2;
- }
-
- /**
- * Call this method with 'true' if the
- * iterator is exhausted and the cached list
- * is complete, or no longer growing.
- */
- private void setCacheComplete(boolean b) {
- m_isComplete2 = b;
-
- }
-
- /**
- * Returns true if no cache is complete
- * and immutable.
- */
- private boolean isComplete() {
- return m_isComplete2;
- }
- }
-
- /**
- * Get the cached list of nodes appended with
- * values obtained from the iterator as
- * a NodeSequence is walked when its
- * nextNode() method is called.
- */
- protected IteratorCache getIteratorCache() {
- return m_cache;
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/axes/OneStepIterator.java b/src/com/sun/org/apache/xpath/internal/axes/OneStepIterator.java
deleted file mode 100644
index 5390684..0000000
--- a/src/com/sun/org/apache/xpath/internal/axes/OneStepIterator.java
+++ /dev/null
@@ -1,347 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: OneStepIterator.java,v 1.2.4.2 2005/09/14 19:45:22 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.axes;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
-import com.sun.org.apache.xml.internal.dtm.DTMFilter;
-import com.sun.org.apache.xml.internal.dtm.DTMIterator;
-import com.sun.org.apache.xpath.internal.Expression;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.compiler.Compiler;
-import com.sun.org.apache.xpath.internal.compiler.OpMap;
-
-/**
- * This class implements a general iterator for
- * those LocationSteps with only one step, and perhaps a predicate.
- * @see com.sun.org.apache.xpath.internal.axes#LocPathIterator
- * @xsl.usage advanced
- */
-public class OneStepIterator extends ChildTestIterator
-{
- static final long serialVersionUID = 4623710779664998283L;
- /** The traversal axis from where the nodes will be filtered. */
- protected int m_axis = -1;
-
- /** The DTM inner traversal class, that corresponds to the super axis. */
- protected DTMAxisIterator m_iterator;
-
- /**
- * Create a OneStepIterator object.
- *
- * @param compiler A reference to the Compiler that contains the op map.
- * @param opPos The position within the op map, which contains the
- * location path expression for this itterator.
- *
- * @throws javax.xml.transform.TransformerException
- */
- OneStepIterator(Compiler compiler, int opPos, int analysis)
- throws javax.xml.transform.TransformerException
- {
- super(compiler, opPos, analysis);
- int firstStepPos = OpMap.getFirstChildPos(opPos);
-
- m_axis = WalkerFactory.getAxisFromStep(compiler, firstStepPos);
-
- }
-
-
- /**
- * Create a OneStepIterator object.
- *
- * @param iterator The DTM iterator which this iterator will use.
- * @param axis One of Axis.Child, etc., or -1 if the axis is unknown.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public OneStepIterator(DTMAxisIterator iterator, int axis)
- throws javax.xml.transform.TransformerException
- {
- super(null);
-
- m_iterator = iterator;
- m_axis = axis;
- int whatToShow = DTMFilter.SHOW_ALL;
- initNodeTest(whatToShow);
- }
-
- /**
- * Initialize the context values for this expression
- * after it is cloned.
- *
- * @param context The XPath runtime context for this
- * transformation.
- */
- public void setRoot(int context, Object environment)
- {
- super.setRoot(context, environment);
- if(m_axis > -1)
- m_iterator = m_cdtm.getAxisIterator(m_axis);
- m_iterator.setStartNode(m_context);
- }
-
- /**
- * Detaches the iterator from the set which it iterated over, releasing
- * any computational resources and placing the iterator in the INVALID
- * state. After<code>detach</code> has been invoked, calls to
- * <code>nextNode</code> or<code>previousNode</code> will raise the
- * exception INVALID_STATE_ERR.
- */
- public void detach()
- {
- if(m_allowDetach)
- {
- if(m_axis > -1)
- m_iterator = null;
-
- // Always call the superclass detach last!
- super.detach();
- }
- }
-
- /**
- * Get the next node via getFirstAttribute && getNextAttribute.
- */
- protected int getNextNode()
- {
- return m_lastFetched = m_iterator.next();
- }
-
- /**
- * Get a cloned iterator.
- *
- * @return A new iterator that can be used without mutating this one.
- *
- * @throws CloneNotSupportedException
- */
- public Object clone() throws CloneNotSupportedException
- {
- // Do not access the location path itterator during this operation!
-
- OneStepIterator clone = (OneStepIterator) super.clone();
-
- if(m_iterator != null)
- {
- clone.m_iterator = m_iterator.cloneIterator();
- }
- return clone;
- }
-
- /**
- * Get a cloned Iterator that is reset to the beginning
- * of the query.
- *
- * @return A cloned NodeIterator set of the start of the query.
- *
- * @throws CloneNotSupportedException
- */
- public DTMIterator cloneWithReset() throws CloneNotSupportedException
- {
-
- OneStepIterator clone = (OneStepIterator) super.cloneWithReset();
- clone.m_iterator = m_iterator;
-
- return clone;
- }
-
-
-
- /**
- * Tells if this is a reverse axes. Overrides AxesWalker#isReverseAxes.
- *
- * @return true for this class.
- */
- public boolean isReverseAxes()
- {
- return m_iterator.isReverse();
- }
-
- /**
- * Get the current sub-context position. In order to do the
- * reverse axes count, for the moment this re-searches the axes
- * up to the predicate. An optimization on this is to cache
- * the nodes searched, but, for the moment, this case is probably
- * rare enough that the added complexity isn't worth it.
- *
- * @param predicateIndex The predicate index of the proximity position.
- *
- * @return The pridicate index, or -1.
- */
- protected int getProximityPosition(int predicateIndex)
- {
- if(!isReverseAxes())
- return super.getProximityPosition(predicateIndex);
-
- // A negative predicate index seems to occur with
- // (preceding-sibling::*|following-sibling::*)/ancestor::*[position()]/*[position()]
- // -sb
- if(predicateIndex < 0)
- return -1;
-
- if (m_proximityPositions[predicateIndex] <= 0)
- {
- XPathContext xctxt = getXPathContext();
- try
- {
- OneStepIterator clone = (OneStepIterator) this.clone();
-
- int root = getRoot();
- xctxt.pushCurrentNode(root);
- clone.setRoot(root, xctxt);
-
- // clone.setPredicateCount(predicateIndex);
- clone.m_predCount = predicateIndex;
-
- // Count 'em all
- int count = 1;
- int next;
-
- while (DTM.NULL != (next = clone.nextNode()))
- {
- count++;
- }
-
- m_proximityPositions[predicateIndex] += count;
- }
- catch (CloneNotSupportedException cnse)
- {
-
- // can't happen
- }
- finally
- {
- xctxt.popCurrentNode();
- }
- }
-
- return m_proximityPositions[predicateIndex];
- }
-
- /**
- * The number of nodes in the list. The range of valid child node indices
- * is 0 to <code>length-1</code> inclusive.
- *
- * @return The number of nodes in the list, always greater or equal to zero.
- */
- public int getLength()
- {
- if(!isReverseAxes())
- return super.getLength();
-
- // Tell if this is being called from within a predicate.
- boolean isPredicateTest = (this == m_execContext.getSubContextList());
-
- // And get how many total predicates are part of this step.
- int predCount = getPredicateCount();
-
- // If we have already calculated the length, and the current predicate
- // is the first predicate, then return the length. We don't cache
- // the anything but the length of the list to the first predicate.
- if (-1 != m_length && isPredicateTest && m_predicateIndex < 1)
- return m_length;
-
- int count = 0;
-
- XPathContext xctxt = getXPathContext();
- try
- {
- OneStepIterator clone = (OneStepIterator) this.cloneWithReset();
-
- int root = getRoot();
- xctxt.pushCurrentNode(root);
- clone.setRoot(root, xctxt);
-
- clone.m_predCount = m_predicateIndex;
-
- int next;
-
- while (DTM.NULL != (next = clone.nextNode()))
- {
- count++;
- }
- }
- catch (CloneNotSupportedException cnse)
- {
- // can't happen
- }
- finally
- {
- xctxt.popCurrentNode();
- }
- if (isPredicateTest && m_predicateIndex < 1)
- m_length = count;
-
- return count;
- }
-
- /**
- * Count backwards one proximity position.
- *
- * @param i The predicate index.
- */
- protected void countProximityPosition(int i)
- {
- if(!isReverseAxes())
- super.countProximityPosition(i);
- else if (i < m_proximityPositions.length)
- m_proximityPositions[i]--;
- }
-
- /**
- * Reset the iterator.
- */
- public void reset()
- {
-
- super.reset();
- if(null != m_iterator)
- m_iterator.reset();
- }
-
- /**
- * Returns the axis being iterated, if it is known.
- *
- * @return Axis.CHILD, etc., or -1 if the axis is not known or is of multiple
- * types.
- */
- public int getAxis()
- {
- return m_axis;
- }
-
- /**
- * @see Expression#deepEquals(Expression)
- */
- public boolean deepEquals(Expression expr)
- {
- if(!super.deepEquals(expr))
- return false;
-
- if(m_axis != ((OneStepIterator)expr).m_axis)
- return false;
-
- return true;
- }
-
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/axes/OneStepIteratorForward.java b/src/com/sun/org/apache/xpath/internal/axes/OneStepIteratorForward.java
deleted file mode 100644
index ea1a829..0000000
--- a/src/com/sun/org/apache/xpath/internal/axes/OneStepIteratorForward.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: OneStepIteratorForward.java,v 1.2.4.2 2005/09/14 19:45:22 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.axes;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMFilter;
-import com.sun.org.apache.xpath.internal.Expression;
-import com.sun.org.apache.xpath.internal.compiler.Compiler;
-import com.sun.org.apache.xpath.internal.compiler.OpMap;
-
-/**
- * This class implements a general iterator for
- * those LocationSteps with only one step, and perhaps a predicate,
- * that only go forward (i.e. it can not be used with ancestors,
- * preceding, etc.)
- * @see com.sun.org.apache.xpath.internal.axes#ChildTestIterator
- * @xsl.usage advanced
- */
-public class OneStepIteratorForward extends ChildTestIterator
-{
- static final long serialVersionUID = -1576936606178190566L;
- /** The traversal axis from where the nodes will be filtered. */
- protected int m_axis = -1;
-
- /**
- * Create a OneStepIterator object.
- *
- * @param compiler A reference to the Compiler that contains the op map.
- * @param opPos The position within the op map, which contains the
- * location path expression for this itterator.
- *
- * @throws javax.xml.transform.TransformerException
- */
- OneStepIteratorForward(Compiler compiler, int opPos, int analysis)
- throws javax.xml.transform.TransformerException
- {
- super(compiler, opPos, analysis);
- int firstStepPos = OpMap.getFirstChildPos(opPos);
-
- m_axis = WalkerFactory.getAxisFromStep(compiler, firstStepPos);
-
- }
-
- /**
- * Create a OneStepIterator object that will just traverse the self axes.
- *
- * @param axis One of the com.sun.org.apache.xml.internal.dtm.Axis integers.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public OneStepIteratorForward(int axis)
- {
- super(null);
-
- m_axis = axis;
- int whatToShow = DTMFilter.SHOW_ALL;
- initNodeTest(whatToShow);
- }
-
-
-
-
- /**
- * Initialize the context values for this expression
- * after it is cloned.
- *
- * @param context The XPath runtime context for this
- * transformation.
- */
- public void setRoot(int context, Object environment)
- {
- super.setRoot(context, environment);
- m_traverser = m_cdtm.getAxisTraverser(m_axis);
-
- }
-
-// /**
-// * Return the first node out of the nodeset, if this expression is
-// * a nodeset expression. This is the default implementation for
-// * nodesets.
-// * <p>WARNING: Do not mutate this class from this function!</p>
-// * @param xctxt The XPath runtime context.
-// * @return the first node out of the nodeset, or DTM.NULL.
-// */
-// public int asNode(XPathContext xctxt)
-// throws javax.xml.transform.TransformerException
-// {
-// if(getPredicateCount() > 0)
-// return super.asNode(xctxt);
-//
-// int current = xctxt.getCurrentNode();
-//
-// DTM dtm = xctxt.getDTM(current);
-// DTMAxisTraverser traverser = dtm.getAxisTraverser(m_axis);
-//
-// String localName = getLocalName();
-// String namespace = getNamespace();
-// int what = m_whatToShow;
-//
-// // System.out.println("what: ");
-// // NodeTest.debugWhatToShow(what);
-// if(DTMFilter.SHOW_ALL == what
-// || ((DTMFilter.SHOW_ELEMENT & what) == 0)
-// || localName == NodeTest.WILD
-// || namespace == NodeTest.WILD)
-// {
-// return traverser.first(current);
-// }
-// else
-// {
-// int type = getNodeTypeTest(what);
-// int extendedType = dtm.getExpandedTypeID(namespace, localName, type);
-// return traverser.first(current, extendedType);
-// }
-// }
-
- /**
- * Get the next node via getFirstAttribute && getNextAttribute.
- */
- protected int getNextNode()
- {
- m_lastFetched = (DTM.NULL == m_lastFetched)
- ? m_traverser.first(m_context)
- : m_traverser.next(m_context, m_lastFetched);
- return m_lastFetched;
- }
-
- /**
- * Returns the axis being iterated, if it is known.
- *
- * @return Axis.CHILD, etc., or -1 if the axis is not known or is of multiple
- * types.
- */
- public int getAxis()
- {
- return m_axis;
- }
-
- /**
- * @see Expression#deepEquals(Expression)
- */
- public boolean deepEquals(Expression expr)
- {
- if(!super.deepEquals(expr))
- return false;
-
- if(m_axis != ((OneStepIteratorForward)expr).m_axis)
- return false;
-
- return true;
- }
-
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/axes/PathComponent.java b/src/com/sun/org/apache/xpath/internal/axes/PathComponent.java
deleted file mode 100644
index a72829d..0000000
--- a/src/com/sun/org/apache/xpath/internal/axes/PathComponent.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: PathComponent.java,v 1.1.2.1 2005/08/01 01:30:27 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.axes;
-
-/**
- * Classes who implement this information provide information needed for
- * static analysis of a path component.
- */
-public interface PathComponent
-{
- /**
- * Get the analysis bits for this path component, as defined in the WalkerFactory.
- * @return One of WalkerFactory#BIT_DESCENDANT, etc.
- */
- public int getAnalysisBits();
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/axes/PredicatedNodeTest.java b/src/com/sun/org/apache/xpath/internal/axes/PredicatedNodeTest.java
deleted file mode 100644
index 965f3f3..0000000
--- a/src/com/sun/org/apache/xpath/internal/axes/PredicatedNodeTest.java
+++ /dev/null
@@ -1,649 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: PredicatedNodeTest.java,v 1.2.4.2 2005/09/14 19:45:20 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.axes;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMIterator;
-import com.sun.org.apache.xml.internal.utils.PrefixResolver;
-import com.sun.org.apache.xpath.internal.Expression;
-import com.sun.org.apache.xpath.internal.ExpressionOwner;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.XPathVisitor;
-import com.sun.org.apache.xpath.internal.compiler.Compiler;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-import com.sun.org.apache.xpath.internal.patterns.NodeTest;
-
-public abstract class PredicatedNodeTest extends NodeTest implements SubContextList
-{
- static final long serialVersionUID = -6193530757296377351L;
-
- /**
- * Construct an AxesWalker using a LocPathIterator.
- *
- * @param locPathIterator non-null reference to the parent iterator.
- */
- PredicatedNodeTest(LocPathIterator locPathIterator)
- {
- m_lpi = locPathIterator;
- }
-
- /**
- * Construct an AxesWalker. The location path iterator will have to be set
- * before use.
- */
- PredicatedNodeTest()
- {
- }
-
- /**
- * Read the object from a serialization stream.
- *
- * @param stream Input stream to read from
- *
- * @throws java.io.IOException
- * @throws javax.xml.transform.TransformerException
- */
- private void readObject(java.io.ObjectInputStream stream)
- throws java.io.IOException, javax.xml.transform.TransformerException
- {
- try
- {
- stream.defaultReadObject();
- m_predicateIndex = -1;
- resetProximityPositions();
- }
- catch (ClassNotFoundException cnfe)
- {
- throw new javax.xml.transform.TransformerException(cnfe);
- }
- }
-
- /**
- * Get a cloned PrdicatedNodeTest.
- *
- * @return A new PredicatedNodeTest that can be used without mutating this one.
- *
- * @throws CloneNotSupportedException
- */
- public Object clone() throws CloneNotSupportedException
- {
- // Do not access the location path itterator during this operation!
-
- PredicatedNodeTest clone = (PredicatedNodeTest) super.clone();
-
- if ((null != this.m_proximityPositions)
- && (this.m_proximityPositions == clone.m_proximityPositions))
- {
- clone.m_proximityPositions = new int[this.m_proximityPositions.length];
-
- System.arraycopy(this.m_proximityPositions, 0,
- clone.m_proximityPositions, 0,
- this.m_proximityPositions.length);
- }
-
- if(clone.m_lpi == this)
- clone.m_lpi = (LocPathIterator)clone;
-
- return clone;
- }
-
- // Only for clones for findLastPos. See bug4638.
- protected int m_predCount = -1;
-
- /**
- * Get the number of predicates that this walker has.
- *
- * @return the number of predicates that this walker has.
- */
- public int getPredicateCount()
- {
- if(-1 == m_predCount)
- return (null == m_predicates) ? 0 : m_predicates.length;
- else
- return m_predCount;
- }
-
- /**
- * Set the number of predicates that this walker has. This does more
- * that one would think, as it creates a new predicate array of the
- * size of the count argument, and copies count predicates into the new
- * one from the old, and then reassigns the predicates value. All this
- * to keep from having to have a predicate count value.
- *
- * @param count The number of predicates, which must be equal or less
- * than the existing count.
- */
- public void setPredicateCount(int count)
- {
- if(count > 0)
- {
- Expression[] newPredicates = new Expression[count];
- for (int i = 0; i < count; i++)
- {
- newPredicates[i] = m_predicates[i];
- }
- m_predicates = newPredicates;
- }
- else
- m_predicates = null;
-
- }
-
- /**
- * Init predicate info.
- *
- * @param compiler The Compiler object that has information about this
- * walker in the op map.
- * @param opPos The op code position of this location step.
- *
- * @throws javax.xml.transform.TransformerException
- */
- protected void initPredicateInfo(Compiler compiler, int opPos)
- throws javax.xml.transform.TransformerException
- {
-
- int pos = compiler.getFirstPredicateOpPos(opPos);
-
- if(pos > 0)
- {
- m_predicates = compiler.getCompiledPredicates(pos);
- if(null != m_predicates)
- {
- for(int i = 0; i < m_predicates.length; i++)
- {
- m_predicates[i].exprSetParent(this);
- }
- }
- }
- }
-
- /**
- * Get a predicate expression at the given index.
- *
- *
- * @param index Index of the predicate.
- *
- * @return A predicate expression.
- */
- public Expression getPredicate(int index)
- {
- return m_predicates[index];
- }
-
- /**
- * Get the current sub-context position.
- *
- * @return The node position of this walker in the sub-context node list.
- */
- public int getProximityPosition()
- {
-
- // System.out.println("getProximityPosition - m_predicateIndex: "+m_predicateIndex);
- return getProximityPosition(m_predicateIndex);
- }
-
- /**
- * Get the current sub-context position.
- *
- * @param xctxt The XPath runtime context.
- *
- * @return The node position of this walker in the sub-context node list.
- */
- public int getProximityPosition(XPathContext xctxt)
- {
- return getProximityPosition();
- }
-
- /**
- * Get the index of the last node that can be itterated to.
- *
- *
- * @param xctxt XPath runtime context.
- *
- * @return the index of the last node that can be itterated to.
- */
- public abstract int getLastPos(XPathContext xctxt);
-
- /**
- * Get the current sub-context position.
- *
- * @param predicateIndex The index of the predicate where the proximity
- * should be taken from.
- *
- * @return The node position of this walker in the sub-context node list.
- */
- protected int getProximityPosition(int predicateIndex)
- {
- return (predicateIndex >= 0) ? m_proximityPositions[predicateIndex] : 0;
- }
-
- /**
- * Reset the proximity positions counts.
- */
- public void resetProximityPositions()
- {
- int nPredicates = getPredicateCount();
- if (nPredicates > 0)
- {
- if (null == m_proximityPositions)
- m_proximityPositions = new int[nPredicates];
-
- for (int i = 0; i < nPredicates; i++)
- {
- try
- {
- initProximityPosition(i);
- }
- catch(Exception e)
- {
- // TODO: Fix this...
- throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(e);
- }
- }
- }
- }
-
- /**
- * Init the proximity position to zero for a forward axes.
- *
- * @param i The index into the m_proximityPositions array.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public void initProximityPosition(int i) throws javax.xml.transform.TransformerException
- {
- m_proximityPositions[i] = 0;
- }
-
- /**
- * Count forward one proximity position.
- *
- * @param i The index into the m_proximityPositions array, where the increment
- * will occur.
- */
- protected void countProximityPosition(int i)
- {
- // Note that in the case of a UnionChildIterator, this may be a
- // static object and so m_proximityPositions may indeed be null!
- int[] pp = m_proximityPositions;
- if ((null != pp) && (i < pp.length))
- pp[i]++;
- }
-
- /**
- * Tells if this is a reverse axes.
- *
- * @return false, unless a derived class overrides.
- */
- public boolean isReverseAxes()
- {
- return false;
- }
-
- /**
- * Get which predicate is executing.
- *
- * @return The current predicate index, or -1 if no predicate is executing.
- */
- public int getPredicateIndex()
- {
- return m_predicateIndex;
- }
-
- /**
- * Process the predicates.
- *
- * @param context The current context node.
- * @param xctxt The XPath runtime context.
- *
- * @return the result of executing the predicate expressions.
- *
- * @throws javax.xml.transform.TransformerException
- */
- boolean executePredicates(int context, XPathContext xctxt)
- throws javax.xml.transform.TransformerException
- {
-
- int nPredicates = getPredicateCount();
- // System.out.println("nPredicates: "+nPredicates);
- if (nPredicates == 0)
- return true;
-
- PrefixResolver savedResolver = xctxt.getNamespaceContext();
-
- try
- {
- m_predicateIndex = 0;
- xctxt.pushSubContextList(this);
- xctxt.pushNamespaceContext(m_lpi.getPrefixResolver());
- xctxt.pushCurrentNode(context);
-
- for (int i = 0; i < nPredicates; i++)
- {
- // System.out.println("Executing predicate expression - waiting count: "+m_lpi.getWaitingCount());
- XObject pred = m_predicates[i].execute(xctxt);
- // System.out.println("\nBack from executing predicate expression - waiting count: "+m_lpi.getWaitingCount());
- // System.out.println("pred.getType(): "+pred.getType());
- if (XObject.CLASS_NUMBER == pred.getType())
- {
- if (DEBUG_PREDICATECOUNTING)
- {
- System.out.flush();
- System.out.println("\n===== start predicate count ========");
- System.out.println("m_predicateIndex: " + m_predicateIndex);
- // System.out.println("getProximityPosition(m_predicateIndex): "
- // + getProximityPosition(m_predicateIndex));
- System.out.println("pred.num(): " + pred.num());
- }
-
- int proxPos = this.getProximityPosition(m_predicateIndex);
- int predIndex = (int) pred.num();
- if (proxPos != predIndex)
- {
- if (DEBUG_PREDICATECOUNTING)
- {
- System.out.println("\nnode context: "+nodeToString(context));
- System.out.println("index predicate is false: "+proxPos);
- System.out.println("\n===== end predicate count ========");
- }
- return false;
- }
- else if (DEBUG_PREDICATECOUNTING)
- {
- System.out.println("\nnode context: "+nodeToString(context));
- System.out.println("index predicate is true: "+proxPos);
- System.out.println("\n===== end predicate count ========");
- }
-
- // If there is a proximity index that will not change during the
- // course of itteration, then we know there can be no more true
- // occurances of this predicate, so flag that we're done after
- // this.
- //
- // bugzilla 14365
- // We can't set m_foundLast = true unless we're sure that -all-
- // remaining parameters are stable, or else last() fails. Fixed so
- // only sets m_foundLast if on the last predicate
- if(m_predicates[i].isStableNumber() && i == nPredicates - 1)
- {
- m_foundLast = true;
- }
- }
- else if (!pred.bool())
- return false;
-
- countProximityPosition(++m_predicateIndex);
- }
- }
- finally
- {
- xctxt.popCurrentNode();
- xctxt.popNamespaceContext();
- xctxt.popSubContextList();
- m_predicateIndex = -1;
- }
-
- return true;
- }
-
- /**
- * This function is used to fixup variables from QNames to stack frame
- * indexes at stylesheet build time.
- * @param vars List of QNames that correspond to variables. This list
- * should be searched backwards for the first qualified name that
- * corresponds to the variable reference qname. The position of the
- * QName in the vector from the start of the vector will be its position
- * in the stack frame (but variables above the globalsTop value will need
- * to be offset to the current stack frame).
- */
- public void fixupVariables(java.util.Vector vars, int globalsSize)
- {
- super.fixupVariables(vars, globalsSize);
-
- int nPredicates = getPredicateCount();
-
- for (int i = 0; i < nPredicates; i++)
- {
- m_predicates[i].fixupVariables(vars, globalsSize);
- }
- }
-
-
- /**
- * Diagnostics.
- *
- * @param n Node to give diagnostic information about, or null.
- *
- * @return Informative string about the argument.
- */
- protected String nodeToString(int n)
- {
- if(DTM.NULL != n)
- {
- DTM dtm = m_lpi.getXPathContext().getDTM(n);
- return dtm.getNodeName(n) + "{" + (n+1) + "}";
- }
- else
- {
- return "null";
- }
- }
-
- //=============== NodeFilter Implementation ===============
-
- /**
- * Test whether a specified node is visible in the logical view of a
- * TreeWalker or NodeIterator. This function will be called by the
- * implementation of TreeWalker and NodeIterator; it is not intended to
- * be called directly from user code.
- * @param n The node to check to see if it passes the filter or not.
- * @return a constant to determine whether the node is accepted,
- * rejected, or skipped, as defined above .
- */
- public short acceptNode(int n)
- {
-
- XPathContext xctxt = m_lpi.getXPathContext();
-
- try
- {
- xctxt.pushCurrentNode(n);
-
- XObject score = execute(xctxt, n);
-
- // System.out.println("\n::acceptNode - score: "+score.num()+"::");
- if (score != NodeTest.SCORE_NONE)
- {
- if (getPredicateCount() > 0)
- {
- countProximityPosition(0);
-
- if (!executePredicates(n, xctxt))
- return DTMIterator.FILTER_SKIP;
- }
-
- return DTMIterator.FILTER_ACCEPT;
- }
- }
- catch (javax.xml.transform.TransformerException se)
- {
-
- // TODO: Fix this.
- throw new RuntimeException(se.getMessage());
- }
- finally
- {
- xctxt.popCurrentNode();
- }
-
- return DTMIterator.FILTER_SKIP;
- }
-
-
- /**
- * Get the owning location path iterator.
- *
- * @return the owning location path iterator, which should not be null.
- */
- public LocPathIterator getLocPathIterator()
- {
- return m_lpi;
- }
-
- /**
- * Set the location path iterator owner for this walker. Besides
- * initialization, this function is called during cloning operations.
- *
- * @param li non-null reference to the owning location path iterator.
- */
- public void setLocPathIterator(LocPathIterator li)
- {
- m_lpi = li;
- if(this != li)
- li.exprSetParent(this);
- }
-
- /**
- * Tell if this expression or it's subexpressions can traverse outside
- * the current subtree.
- *
- * @return true if traversal outside the context node's subtree can occur.
- */
- public boolean canTraverseOutsideSubtree()
- {
- int n = getPredicateCount();
- for (int i = 0; i < n; i++)
- {
- if(getPredicate(i).canTraverseOutsideSubtree())
- return true;
- }
- return false;
- }
-
- /**
- * This will traverse the heararchy, calling the visitor for
- * each member. If the called visitor method returns
- * false, the subtree should not be called.
- *
- * @param visitor The visitor whose appropriate method will be called.
- */
- public void callPredicateVisitors(XPathVisitor visitor)
- {
- if (null != m_predicates)
- {
- int n = m_predicates.length;
- for (int i = 0; i < n; i++)
- {
- ExpressionOwner predOwner = new PredOwner(i);
- if (visitor.visitPredicate(predOwner, m_predicates[i]))
- {
- m_predicates[i].callVisitors(predOwner, visitor);
- }
-
- }
- }
- }
-
- /**
- * @see Expression#deepEquals(Expression)
- */
- public boolean deepEquals(Expression expr)
- {
- if (!super.deepEquals(expr))
- return false;
-
- PredicatedNodeTest pnt = (PredicatedNodeTest) expr;
- if (null != m_predicates)
- {
-
- int n = m_predicates.length;
- if ((null == pnt.m_predicates) || (pnt.m_predicates.length != n))
- return false;
- for (int i = 0; i < n; i++)
- {
- if (!m_predicates[i].deepEquals(pnt.m_predicates[i]))
- return false;
- }
- }
- else if (null != pnt.m_predicates)
- return false;
-
- return true;
- }
-
- /** This is true if nextNode returns null. */
- transient protected boolean m_foundLast = false;
-
- /** The owning location path iterator.
- * @serial */
- protected LocPathIterator m_lpi;
-
- /**
- * Which predicate we are executing.
- */
- transient int m_predicateIndex = -1;
-
- /** The list of predicate expressions. Is static and does not need
- * to be deep cloned.
- * @serial
- */
- private Expression[] m_predicates;
-
- /**
- * An array of counts that correspond to the number
- * of predicates the step contains.
- */
- transient protected int[] m_proximityPositions;
-
- /** If true, diagnostic messages about predicate execution will be posted. */
- static final boolean DEBUG_PREDICATECOUNTING = false;
-
- class PredOwner implements ExpressionOwner
- {
- int m_index;
-
- PredOwner(int index)
- {
- m_index = index;
- }
-
- /**
- * @see ExpressionOwner#getExpression()
- */
- public Expression getExpression()
- {
- return m_predicates[m_index];
- }
-
-
- /**
- * @see ExpressionOwner#setExpression(Expression)
- */
- public void setExpression(Expression exp)
- {
- exp.exprSetParent(PredicatedNodeTest.this);
- m_predicates[m_index] = exp;
- }
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/axes/RTFIterator.java b/src/com/sun/org/apache/xpath/internal/axes/RTFIterator.java
deleted file mode 100644
index 1f02064..0000000
--- a/src/com/sun/org/apache/xpath/internal/axes/RTFIterator.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: RTFIterator.java,v 1.2.4.1 2005/09/14 19:45:16 jeffsuttor Exp $
- */
-
-/**
- * This class implements an RTF Iterator. Currently exists for sole
- * purpose of enabling EXSLT object-type function to return "RTF".
- *
- * @xsl.usage advanced
- */
-package com.sun.org.apache.xpath.internal.axes;
-
-import com.sun.org.apache.xml.internal.dtm.DTMManager;
-import com.sun.org.apache.xpath.internal.NodeSetDTM;
-
-public class RTFIterator extends NodeSetDTM {
- static final long serialVersionUID = 7658117366258528996L;
-
- /**
- * Constructor for RTFIterator
- */
- public RTFIterator(int root, DTMManager manager) {
- super(root, manager);
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/axes/ReverseAxesWalker.java b/src/com/sun/org/apache/xpath/internal/axes/ReverseAxesWalker.java
deleted file mode 100644
index 419d6ef..0000000
--- a/src/com/sun/org/apache/xpath/internal/axes/ReverseAxesWalker.java
+++ /dev/null
@@ -1,249 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ReverseAxesWalker.java,v 1.2.4.1 2005/09/14 19:45:21 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.axes;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
-import com.sun.org.apache.xpath.internal.XPathContext;
-
-/**
- * Walker for a reverse axes.
- * @see <a href="http://www.w3.org/TR/xpath#predicates">XPath 2.4 Predicates</a>
- */
-public class ReverseAxesWalker extends AxesWalker
-{
- static final long serialVersionUID = 2847007647832768941L;
-
- /**
- * Construct an AxesWalker using a LocPathIterator.
- *
- * @param locPathIterator The location path iterator that 'owns' this walker.
- */
- ReverseAxesWalker(LocPathIterator locPathIterator, int axis)
- {
- super(locPathIterator, axis);
- }
-
- /**
- * Set the root node of the TreeWalker.
- * (Not part of the DOM2 TreeWalker interface).
- *
- * @param root The context node of this step.
- */
- public void setRoot(int root)
- {
- super.setRoot(root);
- m_iterator = getDTM(root).getAxisIterator(m_axis);
- m_iterator.setStartNode(root);
- }
-
- /**
- * Detaches the walker from the set which it iterated over, releasing
- * any computational resources and placing the iterator in the INVALID
- * state.
- */
- public void detach()
- {
- m_iterator = null;
- super.detach();
- }
-
- /**
- * Get the next node in document order on the axes.
- *
- * @return the next node in document order on the axes, or null.
- */
- protected int getNextNode()
- {
- if (m_foundLast)
- return DTM.NULL;
-
- int next = m_iterator.next();
-
- if (m_isFresh)
- m_isFresh = false;
-
- if (DTM.NULL == next)
- this.m_foundLast = true;
-
- return next;
- }
-
-
- /**
- * Tells if this is a reverse axes. Overrides AxesWalker#isReverseAxes.
- *
- * @return true for this class.
- */
- public boolean isReverseAxes()
- {
- return true;
- }
-
-// /**
-// * Set the root node of the TreeWalker.
-// *
-// * @param root The context node of this step.
-// */
-// public void setRoot(int root)
-// {
-// super.setRoot(root);
-// }
-
- /**
- * Get the current sub-context position. In order to do the
- * reverse axes count, for the moment this re-searches the axes
- * up to the predicate. An optimization on this is to cache
- * the nodes searched, but, for the moment, this case is probably
- * rare enough that the added complexity isn't worth it.
- *
- * @param predicateIndex The predicate index of the proximity position.
- *
- * @return The pridicate index, or -1.
- */
- protected int getProximityPosition(int predicateIndex)
- {
- // A negative predicate index seems to occur with
- // (preceding-sibling::*|following-sibling::*)/ancestor::*[position()]/*[position()]
- // -sb
- if(predicateIndex < 0)
- return -1;
-
- int count = m_proximityPositions[predicateIndex];
-
- if (count <= 0)
- {
- AxesWalker savedWalker = wi().getLastUsedWalker();
-
- try
- {
- ReverseAxesWalker clone = (ReverseAxesWalker) this.clone();
-
- clone.setRoot(this.getRoot());
-
- clone.setPredicateCount(predicateIndex);
-
- clone.setPrevWalker(null);
- clone.setNextWalker(null);
- wi().setLastUsedWalker(clone);
-
- // Count 'em all
- count++;
- int next;
-
- while (DTM.NULL != (next = clone.nextNode()))
- {
- count++;
- }
-
- m_proximityPositions[predicateIndex] = count;
- }
- catch (CloneNotSupportedException cnse)
- {
-
- // can't happen
- }
- finally
- {
- wi().setLastUsedWalker(savedWalker);
- }
- }
-
- return count;
- }
-
- /**
- * Count backwards one proximity position.
- *
- * @param i The predicate index.
- */
- protected void countProximityPosition(int i)
- {
- if (i < m_proximityPositions.length)
- m_proximityPositions[i]--;
- }
-
- /**
- * Get the number of nodes in this node list. The function is probably ill
- * named?
- *
- *
- * @param xctxt The XPath runtime context.
- *
- * @return the number of nodes in this node list.
- */
- public int getLastPos(XPathContext xctxt)
- {
-
- int count = 0;
- AxesWalker savedWalker = wi().getLastUsedWalker();
-
- try
- {
- ReverseAxesWalker clone = (ReverseAxesWalker) this.clone();
-
- clone.setRoot(this.getRoot());
-
- clone.setPredicateCount(this.getPredicateCount() - 1);
-
- clone.setPrevWalker(null);
- clone.setNextWalker(null);
- wi().setLastUsedWalker(clone);
-
- // Count 'em all
- // count = 1;
- int next;
-
- while (DTM.NULL != (next = clone.nextNode()))
- {
- count++;
- }
- }
- catch (CloneNotSupportedException cnse)
- {
-
- // can't happen
- }
- finally
- {
- wi().setLastUsedWalker(savedWalker);
- }
-
- return count;
- }
-
- /**
- * Returns true if all the nodes in the iteration well be returned in document
- * order.
- * Warning: This can only be called after setRoot has been called!
- *
- * @return false.
- */
- public boolean isDocOrdered()
- {
- return false; // I think.
- }
-
- /** The DTM inner traversal class, that corresponds to the super axis. */
- protected DTMAxisIterator m_iterator;
-}
diff --git a/src/com/sun/org/apache/xpath/internal/axes/SelfIteratorNoPredicate.java b/src/com/sun/org/apache/xpath/internal/axes/SelfIteratorNoPredicate.java
deleted file mode 100644
index f15c69f..0000000
--- a/src/com/sun/org/apache/xpath/internal/axes/SelfIteratorNoPredicate.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: SelfIteratorNoPredicate.java,v 1.2.4.2 2005/09/14 19:45:21 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.axes;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.compiler.Compiler;
-
-/**
- * This class implements an optimized iterator for
- * "." patterns, that is, the self axes without any predicates.
- * @see com.sun.org.apache.xpath.internal.axes.LocPathIterator
- * @xsl.usage advanced
- */
-public class SelfIteratorNoPredicate extends LocPathIterator
-{
- static final long serialVersionUID = -4226887905279814201L;
-
- /**
- * Create a SelfIteratorNoPredicate object.
- *
- * @param compiler A reference to the Compiler that contains the op map.
- * @param opPos The position within the op map, which contains the
- * location path expression for this itterator.
- * @param analysis Analysis bits.
- *
- * @throws javax.xml.transform.TransformerException
- */
- SelfIteratorNoPredicate(Compiler compiler, int opPos, int analysis)
- throws javax.xml.transform.TransformerException
- {
- super(compiler, opPos, analysis, false);
- }
-
- /**
- * Create a SelfIteratorNoPredicate object.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public SelfIteratorNoPredicate()
- throws javax.xml.transform.TransformerException
- {
- super(null);
- }
-
-
- /**
- * Returns the next node in the set and advances the position of the
- * iterator in the set. After a NodeIterator is created, the first call
- * to nextNode() returns the first node in the set.
- *
- * @return The next <code>Node</code> in the set being iterated over, or
- * <code>null</code> if there are no more members in that set.
- */
- public int nextNode()
- {
- if (m_foundLast)
- return DTM.NULL;
-
- int next;
- DTM dtm = m_cdtm;
-
- m_lastFetched = next = (DTM.NULL == m_lastFetched)
- ? m_context
- : DTM.NULL;
-
- // m_lastFetched = next;
- if (DTM.NULL != next)
- {
- m_pos++;
-
- return next;
- }
- else
- {
- m_foundLast = true;
-
- return DTM.NULL;
- }
- }
-
- /**
- * Return the first node out of the nodeset, if this expression is
- * a nodeset expression. This is the default implementation for
- * nodesets. Derived classes should try and override this and return a
- * value without having to do a clone operation.
- * @param xctxt The XPath runtime context.
- * @return the first node out of the nodeset, or DTM.NULL.
- */
- public int asNode(XPathContext xctxt)
- throws javax.xml.transform.TransformerException
- {
- return xctxt.getCurrentNode();
- }
-
- /**
- * Get the index of the last node that can be itterated to.
- * This probably will need to be overridded by derived classes.
- *
- * @param xctxt XPath runtime context.
- *
- * @return the index of the last node that can be itterated to.
- */
- public int getLastPos(XPathContext xctxt)
- {
- return 1;
- }
-
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/axes/SubContextList.java b/src/com/sun/org/apache/xpath/internal/axes/SubContextList.java
deleted file mode 100644
index e169743..0000000
--- a/src/com/sun/org/apache/xpath/internal/axes/SubContextList.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: SubContextList.java,v 1.1.2.1 2005/08/01 01:30:28 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.axes;
-
-import com.sun.org.apache.xpath.internal.XPathContext;
-
-/**
- * A class that implements this interface is a sub context node list, meaning it
- * is a node list for a location path step for a predicate.
- * @xsl.usage advanced
- */
-public interface SubContextList
-{
-
- /**
- * Get the number of nodes in the node list, which, in the XSLT 1 based
- * counting system, is the last index position.
- *
- *
- * @param xctxt The XPath runtime context.
- *
- * @return the number of nodes in the node list.
- */
- public int getLastPos(XPathContext xctxt);
-
- /**
- * Get the current sub-context position.
- *
- * @param xctxt The XPath runtime context.
- *
- * @return The position of the current node in the list.
- */
- public int getProximityPosition(XPathContext xctxt);
-}
diff --git a/src/com/sun/org/apache/xpath/internal/axes/UnionChildIterator.java b/src/com/sun/org/apache/xpath/internal/axes/UnionChildIterator.java
deleted file mode 100644
index 9afc2cf..0000000
--- a/src/com/sun/org/apache/xpath/internal/axes/UnionChildIterator.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: UnionChildIterator.java,v 1.2.4.1 2005/09/14 19:45:20 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.axes;
-
-import com.sun.org.apache.xml.internal.dtm.DTMIterator;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-import com.sun.org.apache.xpath.internal.patterns.NodeTest;
-
-/**
- * This class defines a simplified type of union iterator that only
- * tests along the child axes. If the conditions are right, it is
- * much faster than using a UnionPathIterator.
- */
-public class UnionChildIterator extends ChildTestIterator
-{
- static final long serialVersionUID = 3500298482193003495L;
- /**
- * Even though these may hold full LocPathIterators, this array does
- * not have to be cloned, since only the node test and predicate
- * portion are used, and these only need static information. However,
- * also note that index predicates can not be used!
- */
- private PredicatedNodeTest[] m_nodeTests = null;
-
- /**
- * Constructor for UnionChildIterator
- */
- public UnionChildIterator()
- {
- super(null);
- }
-
- /**
- * Add a node test to the union list.
- *
- * @param test reference to a NodeTest, which will be added
- * directly to the list of node tests (in other words, it will
- * not be cloned). The parent of this test will be set to
- * this object.
- */
- public void addNodeTest(PredicatedNodeTest test)
- {
-
- // Increase array size by only 1 at a time. Fix this
- // if it looks to be a problem.
- if (null == m_nodeTests)
- {
- m_nodeTests = new PredicatedNodeTest[1];
- m_nodeTests[0] = test;
- }
- else
- {
- PredicatedNodeTest[] tests = m_nodeTests;
- int len = m_nodeTests.length;
-
- m_nodeTests = new PredicatedNodeTest[len + 1];
-
- System.arraycopy(tests, 0, m_nodeTests, 0, len);
-
- m_nodeTests[len] = test;
- }
- test.exprSetParent(this);
- }
-
- /**
- * This function is used to fixup variables from QNames to stack frame
- * indexes at stylesheet build time.
- * @param vars List of QNames that correspond to variables. This list
- * should be searched backwards for the first qualified name that
- * corresponds to the variable reference qname. The position of the
- * QName in the vector from the start of the vector will be its position
- * in the stack frame (but variables above the globalsTop value will need
- * to be offset to the current stack frame).
- */
- public void fixupVariables(java.util.Vector vars, int globalsSize)
- {
- super.fixupVariables(vars, globalsSize);
- if (m_nodeTests != null) {
- for (int i = 0; i < m_nodeTests.length; i++) {
- m_nodeTests[i].fixupVariables(vars, globalsSize);
- }
- }
- }
-
- /**
- * Test whether a specified node is visible in the logical view of a
- * TreeWalker or NodeIterator. This function will be called by the
- * implementation of TreeWalker and NodeIterator; it is not intended to
- * be called directly from user code.
- * @param n The node to check to see if it passes the filter or not.
- * @return a constant to determine whether the node is accepted,
- * rejected, or skipped, as defined above .
- */
- public short acceptNode(int n)
- {
- XPathContext xctxt = getXPathContext();
- try
- {
- xctxt.pushCurrentNode(n);
- for (int i = 0; i < m_nodeTests.length; i++)
- {
- PredicatedNodeTest pnt = m_nodeTests[i];
- XObject score = pnt.execute(xctxt, n);
- if (score != NodeTest.SCORE_NONE)
- {
- // Note that we are assuming there are no positional predicates!
- if (pnt.getPredicateCount() > 0)
- {
- if (pnt.executePredicates(n, xctxt))
- return DTMIterator.FILTER_ACCEPT;
- }
- else
- return DTMIterator.FILTER_ACCEPT;
-
- }
- }
- }
- catch (javax.xml.transform.TransformerException se)
- {
-
- // TODO: Fix this.
- throw new RuntimeException(se.getMessage());
- }
- finally
- {
- xctxt.popCurrentNode();
- }
- return DTMIterator.FILTER_SKIP;
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/axes/UnionPathIterator.java b/src/com/sun/org/apache/xpath/internal/axes/UnionPathIterator.java
deleted file mode 100644
index c83f4e5..0000000
--- a/src/com/sun/org/apache/xpath/internal/axes/UnionPathIterator.java
+++ /dev/null
@@ -1,586 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: UnionPathIterator.java,v 1.2.4.1 2005/09/14 19:43:25 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.axes;
-
-import com.sun.org.apache.xml.internal.dtm.Axis;
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMIterator;
-import com.sun.org.apache.xpath.internal.Expression;
-import com.sun.org.apache.xpath.internal.ExpressionOwner;
-import com.sun.org.apache.xpath.internal.XPathVisitor;
-import com.sun.org.apache.xpath.internal.compiler.Compiler;
-import com.sun.org.apache.xpath.internal.compiler.OpCodes;
-import com.sun.org.apache.xpath.internal.compiler.OpMap;
-
-/**
- * This class extends NodeSetDTM, which implements DTMIterator,
- * and fetches nodes one at a time in document order based on a XPath
- * <a href="http://www.w3.org/TR/xpath#NT-UnionExpr">UnionExpr</a>.
- * As each node is iterated via nextNode(), the node is also stored
- * in the NodeVector, so that previousNode() can easily be done.
- * @xsl.usage advanced
- */
-public class UnionPathIterator extends LocPathIterator
- implements Cloneable, DTMIterator, java.io.Serializable, PathComponent
-{
- static final long serialVersionUID = -3910351546843826781L;
-
- /**
- * Constructor to create an instance which you can add location paths to.
- */
- public UnionPathIterator()
- {
-
- super();
-
- // m_mutable = false;
- // m_cacheNodes = false;
- m_iterators = null;
- m_exprs = null;
- }
-
- /**
- * Initialize the context values for this expression
- * after it is cloned.
- *
- * @param context The XPath runtime context for this
- * transformation.
- */
- public void setRoot(int context, Object environment)
- {
- super.setRoot(context, environment);
-
- try
- {
- if (null != m_exprs)
- {
- int n = m_exprs.length;
- DTMIterator newIters[] = new DTMIterator[n];
-
- for (int i = 0; i < n; i++)
- {
- DTMIterator iter = m_exprs[i].asIterator(m_execContext, context);
- newIters[i] = iter;
- iter.nextNode();
- }
- m_iterators = newIters;
- }
- }
- catch(Exception e)
- {
- throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(e);
- }
- }
-
- /**
- * Add an iterator to the union list.
- *
- * @param expr non-null reference to a location path iterator.
- */
- public void addIterator(DTMIterator expr)
- {
-
- // Increase array size by only 1 at a time. Fix this
- // if it looks to be a problem.
- if (null == m_iterators)
- {
- m_iterators = new DTMIterator[1];
- m_iterators[0] = expr;
- }
- else
- {
- DTMIterator[] exprs = m_iterators;
- int len = m_iterators.length;
-
- m_iterators = new DTMIterator[len + 1];
-
- System.arraycopy(exprs, 0, m_iterators, 0, len);
-
- m_iterators[len] = expr;
- }
- expr.nextNode();
- if(expr instanceof Expression)
- ((Expression)expr).exprSetParent(this);
- }
-
- /**
- * Detaches the iterator from the set which it iterated over, releasing
- * any computational resources and placing the iterator in the INVALID
- * state. After<code>detach</code> has been invoked, calls to
- * <code>nextNode</code> or<code>previousNode</code> will raise the
- * exception INVALID_STATE_ERR.
- */
- public void detach()
- {
- if(m_allowDetach && null != m_iterators){
- int n = m_iterators.length;
- for(int i = 0; i < n; i++)
- {
- m_iterators[i].detach();
- }
- m_iterators = null;
- }
- }
-
-
- /**
- * Create a UnionPathIterator object, including creation
- * of location path iterators from the opcode list, and call back
- * into the Compiler to create predicate expressions.
- *
- * @param compiler The Compiler which is creating
- * this expression.
- * @param opPos The position of this iterator in the
- * opcode list from the compiler.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public UnionPathIterator(Compiler compiler, int opPos)
- throws javax.xml.transform.TransformerException
- {
-
- super();
-
- opPos = OpMap.getFirstChildPos(opPos);
-
- loadLocationPaths(compiler, opPos, 0);
- }
-
- /**
- * This will return an iterator capable of handling the union of paths given.
- *
- * @param compiler The Compiler which is creating
- * this expression.
- * @param opPos The position of this iterator in the
- * opcode list from the compiler.
- *
- * @return Object that is derived from LocPathIterator.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public static LocPathIterator createUnionIterator(Compiler compiler, int opPos)
- throws javax.xml.transform.TransformerException
- {
- // For the moment, I'm going to first create a full UnionPathIterator, and
- // then see if I can reduce it to a UnionChildIterator. It would obviously
- // be more effecient to just test for the conditions for a UnionChildIterator,
- // and then create that directly.
- UnionPathIterator upi = new UnionPathIterator(compiler, opPos);
- int nPaths = upi.m_exprs.length;
- boolean isAllChildIterators = true;
- for(int i = 0; i < nPaths; i++)
- {
- LocPathIterator lpi = upi.m_exprs[i];
-
- if(lpi.getAxis() != Axis.CHILD)
- {
- isAllChildIterators = false;
- break;
- }
- else
- {
- // check for positional predicates or position function, which won't work.
- if(HasPositionalPredChecker.check(lpi))
- {
- isAllChildIterators = false;
- break;
- }
- }
- }
- if(isAllChildIterators)
- {
- UnionChildIterator uci = new UnionChildIterator();
-
- for(int i = 0; i < nPaths; i++)
- {
- PredicatedNodeTest lpi = upi.m_exprs[i];
- // I could strip the lpi down to a pure PredicatedNodeTest, but
- // I don't think it's worth it. Note that the test can be used
- // as a static object... so it doesn't have to be cloned.
- uci.addNodeTest(lpi);
- }
- return uci;
-
- }
- else
- return upi;
- }
-
- /**
- * Get the analysis bits for this walker, as defined in the WalkerFactory.
- * @return One of WalkerFactory#BIT_DESCENDANT, etc.
- */
- public int getAnalysisBits()
- {
- int bits = 0;
-
- if (m_exprs != null)
- {
- int n = m_exprs.length;
-
- for (int i = 0; i < n; i++)
- {
- int bit = m_exprs[i].getAnalysisBits();
- bits |= bit;
- }
- }
-
- return bits;
- }
-
- /**
- * Read the object from a serialization stream.
- *
- * @param stream Input stream to read from
- *
- * @throws java.io.IOException
- * @throws javax.xml.transform.TransformerException
- */
- private void readObject(java.io.ObjectInputStream stream)
- throws java.io.IOException, javax.xml.transform.TransformerException
- {
- try
- {
- stream.defaultReadObject();
- m_clones = new IteratorPool(this);
- }
- catch (ClassNotFoundException cnfe)
- {
- throw new javax.xml.transform.TransformerException(cnfe);
- }
- }
-
- /**
- * Get a cloned LocPathIterator that holds the same
- * position as this iterator.
- *
- * @return A clone of this iterator that holds the same node position.
- *
- * @throws CloneNotSupportedException
- */
- public Object clone() throws CloneNotSupportedException
- {
-
- UnionPathIterator clone = (UnionPathIterator) super.clone();
- if (m_iterators != null)
- {
- int n = m_iterators.length;
-
- clone.m_iterators = new DTMIterator[n];
-
- for (int i = 0; i < n; i++)
- {
- clone.m_iterators[i] = (DTMIterator)m_iterators[i].clone();
- }
- }
-
- return clone;
- }
-
-
- /**
- * Create a new location path iterator.
- *
- * @param compiler The Compiler which is creating
- * this expression.
- * @param opPos The position of this iterator in the
- *
- * @return New location path iterator.
- *
- * @throws javax.xml.transform.TransformerException
- */
- protected LocPathIterator createDTMIterator(
- Compiler compiler, int opPos) throws javax.xml.transform.TransformerException
- {
- LocPathIterator lpi = (LocPathIterator)WalkerFactory.newDTMIterator(compiler, opPos,
- (compiler.getLocationPathDepth() <= 0));
- return lpi;
- }
-
- /**
- * Initialize the location path iterators. Recursive.
- *
- * @param compiler The Compiler which is creating
- * this expression.
- * @param opPos The position of this iterator in the
- * opcode list from the compiler.
- * @param count The insert position of the iterator.
- *
- * @throws javax.xml.transform.TransformerException
- */
- protected void loadLocationPaths(Compiler compiler, int opPos, int count)
- throws javax.xml.transform.TransformerException
- {
-
- // TODO: Handle unwrapped FilterExpr
- int steptype = compiler.getOp(opPos);
-
- if (steptype == OpCodes.OP_LOCATIONPATH)
- {
- loadLocationPaths(compiler, compiler.getNextOpPos(opPos), count + 1);
-
- m_exprs[count] = createDTMIterator(compiler, opPos);
- m_exprs[count].exprSetParent(this);
- }
- else
- {
-
- // Have to check for unwrapped functions, which the LocPathIterator
- // doesn't handle.
- switch (steptype)
- {
- case OpCodes.OP_VARIABLE :
- case OpCodes.OP_EXTFUNCTION :
- case OpCodes.OP_FUNCTION :
- case OpCodes.OP_GROUP :
- loadLocationPaths(compiler, compiler.getNextOpPos(opPos), count + 1);
-
- WalkingIterator iter =
- new WalkingIterator(compiler.getNamespaceContext());
- iter.exprSetParent(this);
-
- if(compiler.getLocationPathDepth() <= 0)
- iter.setIsTopLevel(true);
-
- iter.m_firstWalker = new com.sun.org.apache.xpath.internal.axes.FilterExprWalker(iter);
-
- iter.m_firstWalker.init(compiler, opPos, steptype);
-
- m_exprs[count] = iter;
- break;
- default :
- m_exprs = new LocPathIterator[count];
- }
- }
- }
-
- /**
- * Returns the next node in the set and advances the position of the
- * iterator in the set. After a DTMIterator is created, the first call
- * to nextNode() returns the first node in the set.
- * @return The next <code>Node</code> in the set being iterated over, or
- * <code>null</code> if there are no more members in that set.
- */
- public int nextNode()
- {
- if(m_foundLast)
- return DTM.NULL;
-
- // Loop through the iterators getting the current fetched
- // node, and get the earliest occuring in document order
- int earliestNode = DTM.NULL;
-
- if (null != m_iterators)
- {
- int n = m_iterators.length;
- int iteratorUsed = -1;
-
- for (int i = 0; i < n; i++)
- {
- int node = m_iterators[i].getCurrentNode();
-
- if (DTM.NULL == node)
- continue;
- else if (DTM.NULL == earliestNode)
- {
- iteratorUsed = i;
- earliestNode = node;
- }
- else
- {
- if (node == earliestNode)
- {
-
- // Found a duplicate, so skip past it.
- m_iterators[i].nextNode();
- }
- else
- {
- DTM dtm = getDTM(node);
-
- if (dtm.isNodeAfter(node, earliestNode))
- {
- iteratorUsed = i;
- earliestNode = node;
- }
- }
- }
- }
-
- if (DTM.NULL != earliestNode)
- {
- m_iterators[iteratorUsed].nextNode();
-
- incrementCurrentPos();
- }
- else
- m_foundLast = true;
- }
-
- m_lastFetched = earliestNode;
-
- return earliestNode;
- }
-
- /**
- * This function is used to fixup variables from QNames to stack frame
- * indexes at stylesheet build time.
- * @param vars List of QNames that correspond to variables. This list
- * should be searched backwards for the first qualified name that
- * corresponds to the variable reference qname. The position of the
- * QName in the vector from the start of the vector will be its position
- * in the stack frame (but variables above the globalsTop value will need
- * to be offset to the current stack frame).
- */
- public void fixupVariables(java.util.Vector vars, int globalsSize)
- {
- for (int i = 0; i < m_exprs.length; i++)
- {
- m_exprs[i].fixupVariables(vars, globalsSize);
- }
-
- }
-
- /**
- * The location path iterators, one for each
- * <a href="http://www.w3.org/TR/xpath#NT-LocationPath">location
- * path</a> contained in the union expression.
- * @serial
- */
- protected LocPathIterator[] m_exprs;
-
-
- /**
- * The location path iterators, one for each
- * <a href="http://www.w3.org/TR/xpath#NT-LocationPath">location
- * path</a> contained in the union expression.
- * @serial
- */
- protected DTMIterator[] m_iterators;
-
- /**
- * Returns the axis being iterated, if it is known.
- *
- * @return Axis.CHILD, etc., or -1 if the axis is not known or is of multiple
- * types.
- */
- public int getAxis()
- {
- // Could be smarter.
- return -1;
- }
-
- class iterOwner implements ExpressionOwner
- {
- int m_index;
-
- iterOwner(int index)
- {
- m_index = index;
- }
-
- /**
- * @see ExpressionOwner#getExpression()
- */
- public Expression getExpression()
- {
- return m_exprs[m_index];
- }
-
- /**
- * @see ExpressionOwner#setExpression(Expression)
- */
- public void setExpression(Expression exp)
- {
-
- if(!(exp instanceof LocPathIterator))
- {
- // Yuck. Need FilterExprIter. Or make it so m_exprs can be just
- // plain expressions?
- WalkingIterator wi = new WalkingIterator(getPrefixResolver());
- FilterExprWalker few = new FilterExprWalker(wi);
- wi.setFirstWalker(few);
- few.setInnerExpression(exp);
- wi.exprSetParent(UnionPathIterator.this);
- few.exprSetParent(wi);
- exp.exprSetParent(few);
- exp = wi;
- }
- else
- exp.exprSetParent(UnionPathIterator.this);
- m_exprs[m_index] = (LocPathIterator)exp;
- }
-
- }
-
- /**
- * @see com.sun.org.apache.xpath.internal.XPathVisitable#callVisitors(ExpressionOwner, XPathVisitor)
- */
- public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)
- {
- if(visitor.visitUnionPath(owner, this))
- {
- if(null != m_exprs)
- {
- int n = m_exprs.length;
- for(int i = 0; i < n; i++)
- {
- m_exprs[i].callVisitors(new iterOwner(i), visitor);
- }
- }
- }
- }
-
- /**
- * @see Expression#deepEquals(Expression)
- */
- public boolean deepEquals(Expression expr)
- {
- if (!super.deepEquals(expr))
- return false;
-
- UnionPathIterator upi = (UnionPathIterator) expr;
-
- if (null != m_exprs)
- {
- int n = m_exprs.length;
-
- if((null == upi.m_exprs) || (upi.m_exprs.length != n))
- return false;
-
- for (int i = 0; i < n; i++)
- {
- if(!m_exprs[i].deepEquals(upi.m_exprs[i]))
- return false;
- }
- }
- else if (null != upi.m_exprs)
- {
- return false;
- }
-
- return true;
- }
-
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/axes/WalkerFactory.java b/src/com/sun/org/apache/xpath/internal/axes/WalkerFactory.java
deleted file mode 100644
index 2f05535..0000000
--- a/src/com/sun/org/apache/xpath/internal/axes/WalkerFactory.java
+++ /dev/null
@@ -1,1827 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: WalkerFactory.java,v 1.2.4.1 2005/09/10 03:42:19 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.axes;
-
-import com.sun.org.apache.xalan.internal.res.XSLMessages;
-import com.sun.org.apache.xml.internal.dtm.Axis;
-import com.sun.org.apache.xml.internal.dtm.DTMFilter;
-import com.sun.org.apache.xml.internal.dtm.DTMIterator;
-import com.sun.org.apache.xpath.internal.Expression;
-import com.sun.org.apache.xpath.internal.compiler.Compiler;
-import com.sun.org.apache.xpath.internal.compiler.FunctionTable;
-import com.sun.org.apache.xpath.internal.compiler.OpCodes;
-import com.sun.org.apache.xpath.internal.compiler.OpMap;
-import com.sun.org.apache.xpath.internal.objects.XNumber;
-import com.sun.org.apache.xpath.internal.patterns.ContextMatchStepPattern;
-import com.sun.org.apache.xpath.internal.patterns.FunctionPattern;
-import com.sun.org.apache.xpath.internal.patterns.NodeTest;
-import com.sun.org.apache.xpath.internal.patterns.StepPattern;
-import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
-
-/**
- * This class is both a factory for XPath location path expressions,
- * which are built from the opcode map output, and an analysis engine
- * for the location path expressions in order to provide optimization hints.
- */
-public class WalkerFactory
-{
-
- /**
- * This method is for building an array of possible levels
- * where the target element(s) could be found for a match.
- * @param lpi The owning location path iterator.
- * @param compiler non-null reference to compiler object that has processed
- * the XPath operations into an opcode map.
- * @param stepOpCodePos The opcode position for the step.
- *
- * @return non-null AxesWalker derivative.
- *
- * @throws javax.xml.transform.TransformerException
- * @xsl.usage advanced
- */
- static AxesWalker loadOneWalker(
- WalkingIterator lpi, Compiler compiler, int stepOpCodePos)
- throws javax.xml.transform.TransformerException
- {
-
- AxesWalker firstWalker = null;
- int stepType = compiler.getOp(stepOpCodePos);
-
- if (stepType != OpCodes.ENDOP)
- {
-
- // m_axesWalkers = new AxesWalker[1];
- // As we unwind from the recursion, create the iterators.
- firstWalker = createDefaultWalker(compiler, stepType, lpi, 0);
-
- firstWalker.init(compiler, stepOpCodePos, stepType);
- }
-
- return firstWalker;
- }
-
- /**
- * This method is for building an array of possible levels
- * where the target element(s) could be found for a match.
- * @param lpi The owning location path iterator object.
- * @param compiler non-null reference to compiler object that has processed
- * the XPath operations into an opcode map.
- * @param stepOpCodePos The opcode position for the step.
- * @param stepIndex The top-level step index withing the iterator.
- *
- * @return non-null AxesWalker derivative.
- *
- * @throws javax.xml.transform.TransformerException
- * @xsl.usage advanced
- */
- static AxesWalker loadWalkers(
- WalkingIterator lpi, Compiler compiler, int stepOpCodePos, int stepIndex)
- throws javax.xml.transform.TransformerException
- {
-
- int stepType;
- AxesWalker firstWalker = null;
- AxesWalker walker, prevWalker = null;
-
- int analysis = analyze(compiler, stepOpCodePos, stepIndex);
-
- while (OpCodes.ENDOP != (stepType = compiler.getOp(stepOpCodePos)))
- {
- walker = createDefaultWalker(compiler, stepOpCodePos, lpi, analysis);
-
- walker.init(compiler, stepOpCodePos, stepType);
- walker.exprSetParent(lpi);
-
- // walker.setAnalysis(analysis);
- if (null == firstWalker)
- {
- firstWalker = walker;
- }
- else
- {
- prevWalker.setNextWalker(walker);
- walker.setPrevWalker(prevWalker);
- }
-
- prevWalker = walker;
- stepOpCodePos = compiler.getNextStepPos(stepOpCodePos);
-
- if (stepOpCodePos < 0)
- break;
- }
-
- return firstWalker;
- }
-
- public static boolean isSet(int analysis, int bits)
- {
- return (0 != (analysis & bits));
- }
-
- public static void diagnoseIterator(String name, int analysis, Compiler compiler)
- {
- System.out.println(compiler.toString()+", "+name+", "
- + Integer.toBinaryString(analysis) + ", "
- + getAnalysisString(analysis));
- }
-
- /**
- * Create a new LocPathIterator iterator. The exact type of iterator
- * returned is based on an analysis of the XPath operations.
- *
- * @param compiler non-null reference to compiler object that has processed
- * the XPath operations into an opcode map.
- * @param opPos The position of the operation code for this itterator.
- *
- * @return non-null reference to a LocPathIterator or derivative.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public static DTMIterator newDTMIterator(
- Compiler compiler, int opPos,
- boolean isTopLevel)
- throws javax.xml.transform.TransformerException
- {
-
- int firstStepPos = OpMap.getFirstChildPos(opPos);
- int analysis = analyze(compiler, firstStepPos, 0);
- boolean isOneStep = isOneStep(analysis);
- DTMIterator iter;
-
- // Is the iteration a one-step attribute pattern (i.e. select="@foo")?
- if (isOneStep && walksSelfOnly(analysis) &&
- isWild(analysis) && !hasPredicate(analysis))
- {
- if (DEBUG_ITERATOR_CREATION)
- diagnoseIterator("SelfIteratorNoPredicate", analysis, compiler);
-
- // Then use a simple iteration of the attributes, with node test
- // and predicate testing.
- iter = new SelfIteratorNoPredicate(compiler, opPos, analysis);
- }
- // Is the iteration exactly one child step?
- else if (walksChildrenOnly(analysis) && isOneStep)
- {
-
- // Does the pattern specify *any* child with no predicate? (i.e. select="child::node()".
- if (isWild(analysis) && !hasPredicate(analysis))
- {
- if (DEBUG_ITERATOR_CREATION)
- diagnoseIterator("ChildIterator", analysis, compiler);
-
- // Use simple child iteration without any test.
- iter = new ChildIterator(compiler, opPos, analysis);
- }
- else
- {
- if (DEBUG_ITERATOR_CREATION)
- diagnoseIterator("ChildTestIterator", analysis, compiler);
-
- // Else use simple node test iteration with predicate test.
- iter = new ChildTestIterator(compiler, opPos, analysis);
- }
- }
- // Is the iteration a one-step attribute pattern (i.e. select="@foo")?
- else if (isOneStep && walksAttributes(analysis))
- {
- if (DEBUG_ITERATOR_CREATION)
- diagnoseIterator("AttributeIterator", analysis, compiler);
-
- // Then use a simple iteration of the attributes, with node test
- // and predicate testing.
- iter = new AttributeIterator(compiler, opPos, analysis);
- }
- else if(isOneStep && !walksFilteredList(analysis))
- {
- if( !walksNamespaces(analysis)
- && (walksInDocOrder(analysis) || isSet(analysis, BIT_PARENT)))
- {
- if (false || DEBUG_ITERATOR_CREATION)
- diagnoseIterator("OneStepIteratorForward", analysis, compiler);
-
- // Then use a simple iteration of the attributes, with node test
- // and predicate testing.
- iter = new OneStepIteratorForward(compiler, opPos, analysis);
- }
- else
- {
- if (false || DEBUG_ITERATOR_CREATION)
- diagnoseIterator("OneStepIterator", analysis, compiler);
-
- // Then use a simple iteration of the attributes, with node test
- // and predicate testing.
- iter = new OneStepIterator(compiler, opPos, analysis);
- }
- }
-
- // Analysis of "//center":
- // bits: 1001000000001010000000000000011
- // count: 3
- // root
- // child:node()
- // BIT_DESCENDANT_OR_SELF
- // It's highly possible that we should have a seperate bit set for
- // "//foo" patterns.
- // For at least the time being, we can't optimize patterns like
- // "//table[3]", because this has to be analyzed as
- // "/descendant-or-self::node()/table[3]" in order for the indexes
- // to work right.
- else if (isOptimizableForDescendantIterator(compiler, firstStepPos, 0)
- // && getStepCount(analysis) <= 3
- // && walksDescendants(analysis)
- // && walksSubtreeOnlyFromRootOrContext(analysis)
- )
- {
- if (DEBUG_ITERATOR_CREATION)
- diagnoseIterator("DescendantIterator", analysis, compiler);
-
- iter = new DescendantIterator(compiler, opPos, analysis);
- }
- else
- {
- if(isNaturalDocOrder(compiler, firstStepPos, 0, analysis))
- {
- if (false || DEBUG_ITERATOR_CREATION)
- {
- diagnoseIterator("WalkingIterator", analysis, compiler);
- }
-
- iter = new WalkingIterator(compiler, opPos, analysis, true);
- }
- else
- {
-// if (DEBUG_ITERATOR_CREATION)
-// diagnoseIterator("MatchPatternIterator", analysis, compiler);
-//
-// return new MatchPatternIterator(compiler, opPos, analysis);
- if (DEBUG_ITERATOR_CREATION)
- diagnoseIterator("WalkingIteratorSorted", analysis, compiler);
-
- iter = new WalkingIteratorSorted(compiler, opPos, analysis, true);
- }
- }
- if(iter instanceof LocPathIterator)
- ((LocPathIterator)iter).setIsTopLevel(isTopLevel);
-
- return iter;
- }
-
- /**
- * Special purpose function to see if we can optimize the pattern for
- * a DescendantIterator.
- *
- * @param compiler non-null reference to compiler object that has processed
- * the XPath operations into an opcode map.
- * @param stepOpCodePos The opcode position for the step.
- *
- * @return 32 bits as an integer that give information about the location
- * path as a whole.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public static int getAxisFromStep(
- Compiler compiler, int stepOpCodePos)
- throws javax.xml.transform.TransformerException
- {
-
- int stepType = compiler.getOp(stepOpCodePos);
-
- switch (stepType)
- {
- case OpCodes.FROM_FOLLOWING :
- return Axis.FOLLOWING;
- case OpCodes.FROM_FOLLOWING_SIBLINGS :
- return Axis.FOLLOWINGSIBLING;
- case OpCodes.FROM_PRECEDING :
- return Axis.PRECEDING;
- case OpCodes.FROM_PRECEDING_SIBLINGS :
- return Axis.PRECEDINGSIBLING;
- case OpCodes.FROM_PARENT :
- return Axis.PARENT;
- case OpCodes.FROM_NAMESPACE :
- return Axis.NAMESPACE;
- case OpCodes.FROM_ANCESTORS :
- return Axis.ANCESTOR;
- case OpCodes.FROM_ANCESTORS_OR_SELF :
- return Axis.ANCESTORORSELF;
- case OpCodes.FROM_ATTRIBUTES :
- return Axis.ATTRIBUTE;
- case OpCodes.FROM_ROOT :
- return Axis.ROOT;
- case OpCodes.FROM_CHILDREN :
- return Axis.CHILD;
- case OpCodes.FROM_DESCENDANTS_OR_SELF :
- return Axis.DESCENDANTORSELF;
- case OpCodes.FROM_DESCENDANTS :
- return Axis.DESCENDANT;
- case OpCodes.FROM_SELF :
- return Axis.SELF;
- case OpCodes.OP_EXTFUNCTION :
- case OpCodes.OP_FUNCTION :
- case OpCodes.OP_GROUP :
- case OpCodes.OP_VARIABLE :
- return Axis.FILTEREDLIST;
- }
-
- throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_ERROR_HANDLER, new Object[]{Integer.toString(stepType)})); //"Programmer's assertion: unknown opcode: "
- //+ stepType);
- }
-
- /**
- * Get a corresponding BIT_XXX from an axis.
- * @param axis One of Axis.ANCESTOR, etc.
- * @return One of BIT_ANCESTOR, etc.
- */
- static public int getAnalysisBitFromAxes(int axis)
- {
- switch (axis) // Generate new traverser
- {
- case Axis.ANCESTOR :
- return BIT_ANCESTOR;
- case Axis.ANCESTORORSELF :
- return BIT_ANCESTOR_OR_SELF;
- case Axis.ATTRIBUTE :
- return BIT_ATTRIBUTE;
- case Axis.CHILD :
- return BIT_CHILD;
- case Axis.DESCENDANT :
- return BIT_DESCENDANT;
- case Axis.DESCENDANTORSELF :
- return BIT_DESCENDANT_OR_SELF;
- case Axis.FOLLOWING :
- return BIT_FOLLOWING;
- case Axis.FOLLOWINGSIBLING :
- return BIT_FOLLOWING_SIBLING;
- case Axis.NAMESPACE :
- case Axis.NAMESPACEDECLS :
- return BIT_NAMESPACE;
- case Axis.PARENT :
- return BIT_PARENT;
- case Axis.PRECEDING :
- return BIT_PRECEDING;
- case Axis.PRECEDINGSIBLING :
- return BIT_PRECEDING_SIBLING;
- case Axis.SELF :
- return BIT_SELF;
- case Axis.ALLFROMNODE :
- return BIT_DESCENDANT_OR_SELF;
- // case Axis.PRECEDINGANDANCESTOR :
- case Axis.DESCENDANTSFROMROOT :
- case Axis.ALL :
- case Axis.DESCENDANTSORSELFFROMROOT :
- return BIT_ANY_DESCENDANT_FROM_ROOT;
- case Axis.ROOT :
- return BIT_ROOT;
- case Axis.FILTEREDLIST :
- return BIT_FILTER;
- default :
- return BIT_FILTER;
- }
- }
-
- static boolean functionProximateOrContainsProximate(Compiler compiler,
- int opPos)
- {
- int endFunc = opPos + compiler.getOp(opPos + 1) - 1;
- opPos = OpMap.getFirstChildPos(opPos);
- int funcID = compiler.getOp(opPos);
- // System.out.println("funcID: "+funcID);
- // System.out.println("opPos: "+opPos);
- // System.out.println("endFunc: "+endFunc);
- switch(funcID)
- {
- case FunctionTable.FUNC_LAST:
- case FunctionTable.FUNC_POSITION:
- return true;
- default:
- opPos++;
- int i = 0;
- for (int p = opPos; p < endFunc; p = compiler.getNextOpPos(p), i++)
- {
- int innerExprOpPos = p+2;
- int argOp = compiler.getOp(innerExprOpPos);
- boolean prox = isProximateInnerExpr(compiler, innerExprOpPos);
- if(prox)
- return true;
- }
-
- }
- return false;
- }
-
- static boolean isProximateInnerExpr(Compiler compiler, int opPos)
- {
- int op = compiler.getOp(opPos);
- int innerExprOpPos = opPos+2;
- switch(op)
- {
- case OpCodes.OP_ARGUMENT:
- if(isProximateInnerExpr(compiler, innerExprOpPos))
- return true;
- break;
- case OpCodes.OP_VARIABLE:
- case OpCodes.OP_NUMBERLIT:
- case OpCodes.OP_LITERAL:
- case OpCodes.OP_LOCATIONPATH:
- break; // OK
- case OpCodes.OP_FUNCTION:
- boolean isProx = functionProximateOrContainsProximate(compiler, opPos);
- if(isProx)
- return true;
- break;
- case OpCodes.OP_GT:
- case OpCodes.OP_GTE:
- case OpCodes.OP_LT:
- case OpCodes.OP_LTE:
- case OpCodes.OP_EQUALS:
- int leftPos = OpMap.getFirstChildPos(op);
- int rightPos = compiler.getNextOpPos(leftPos);
- isProx = isProximateInnerExpr(compiler, leftPos);
- if(isProx)
- return true;
- isProx = isProximateInnerExpr(compiler, rightPos);
- if(isProx)
- return true;
- break;
- default:
- return true; // be conservative...
- }
- return false;
- }
-
- /**
- * Tell if the predicates need to have proximity knowledge.
- */
- public static boolean mightBeProximate(Compiler compiler, int opPos, int stepType)
- throws javax.xml.transform.TransformerException
- {
-
- boolean mightBeProximate = false;
- int argLen;
-
- switch (stepType)
- {
- case OpCodes.OP_VARIABLE :
- case OpCodes.OP_EXTFUNCTION :
- case OpCodes.OP_FUNCTION :
- case OpCodes.OP_GROUP :
- argLen = compiler.getArgLength(opPos);
- break;
- default :
- argLen = compiler.getArgLengthOfStep(opPos);
- }
-
- int predPos = compiler.getFirstPredicateOpPos(opPos);
- int count = 0;
-
- while (OpCodes.OP_PREDICATE == compiler.getOp(predPos))
- {
- count++;
-
- int innerExprOpPos = predPos+2;
- int predOp = compiler.getOp(innerExprOpPos);
-
- switch(predOp)
- {
- case OpCodes.OP_VARIABLE:
- return true; // Would need more smarts to tell if this could be a number or not!
- case OpCodes.OP_LOCATIONPATH:
- // OK.
- break;
- case OpCodes.OP_NUMBER:
- case OpCodes.OP_NUMBERLIT:
- return true; // that's all she wrote!
- case OpCodes.OP_FUNCTION:
- boolean isProx
- = functionProximateOrContainsProximate(compiler, innerExprOpPos);
- if(isProx)
- return true;
- break;
- case OpCodes.OP_GT:
- case OpCodes.OP_GTE:
- case OpCodes.OP_LT:
- case OpCodes.OP_LTE:
- case OpCodes.OP_EQUALS:
- int leftPos = OpMap.getFirstChildPos(innerExprOpPos);
- int rightPos = compiler.getNextOpPos(leftPos);
- isProx = isProximateInnerExpr(compiler, leftPos);
- if(isProx)
- return true;
- isProx = isProximateInnerExpr(compiler, rightPos);
- if(isProx)
- return true;
- break;
- default:
- return true; // be conservative...
- }
-
- predPos = compiler.getNextOpPos(predPos);
- }
-
- return mightBeProximate;
- }
-
- /**
- * Special purpose function to see if we can optimize the pattern for
- * a DescendantIterator.
- *
- * @param compiler non-null reference to compiler object that has processed
- * the XPath operations into an opcode map.
- * @param stepOpCodePos The opcode position for the step.
- * @param stepIndex The top-level step index withing the iterator.
- *
- * @return 32 bits as an integer that give information about the location
- * path as a whole.
- *
- * @throws javax.xml.transform.TransformerException
- */
- private static boolean isOptimizableForDescendantIterator(
- Compiler compiler, int stepOpCodePos, int stepIndex)
- throws javax.xml.transform.TransformerException
- {
-
- int stepType;
- int stepCount = 0;
- boolean foundDorDS = false;
- boolean foundSelf = false;
- boolean foundDS = false;
-
- int nodeTestType = OpCodes.NODETYPE_NODE;
-
- while (OpCodes.ENDOP != (stepType = compiler.getOp(stepOpCodePos)))
- {
- // The DescendantIterator can only do one node test. If there's more
- // than one, use another iterator.
- if(nodeTestType != OpCodes.NODETYPE_NODE && nodeTestType != OpCodes.NODETYPE_ROOT)
- return false;
-
- stepCount++;
- if(stepCount > 3)
- return false;
-
- boolean mightBeProximate = mightBeProximate(compiler, stepOpCodePos, stepType);
- if(mightBeProximate)
- return false;
-
- switch (stepType)
- {
- case OpCodes.FROM_FOLLOWING :
- case OpCodes.FROM_FOLLOWING_SIBLINGS :
- case OpCodes.FROM_PRECEDING :
- case OpCodes.FROM_PRECEDING_SIBLINGS :
- case OpCodes.FROM_PARENT :
- case OpCodes.OP_VARIABLE :
- case OpCodes.OP_EXTFUNCTION :
- case OpCodes.OP_FUNCTION :
- case OpCodes.OP_GROUP :
- case OpCodes.FROM_NAMESPACE :
- case OpCodes.FROM_ANCESTORS :
- case OpCodes.FROM_ANCESTORS_OR_SELF :
- case OpCodes.FROM_ATTRIBUTES :
- case OpCodes.MATCH_ATTRIBUTE :
- case OpCodes.MATCH_ANY_ANCESTOR :
- case OpCodes.MATCH_IMMEDIATE_ANCESTOR :
- return false;
- case OpCodes.FROM_ROOT :
- if(1 != stepCount)
- return false;
- break;
- case OpCodes.FROM_CHILDREN :
- if(!foundDS && !(foundDorDS && foundSelf))
- return false;
- break;
- case OpCodes.FROM_DESCENDANTS_OR_SELF :
- foundDS = true;
- case OpCodes.FROM_DESCENDANTS :
- if(3 == stepCount)
- return false;
- foundDorDS = true;
- break;
- case OpCodes.FROM_SELF :
- if(1 != stepCount)
- return false;
- foundSelf = true;
- break;
- default :
- throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_ERROR_HANDLER, new Object[]{Integer.toString(stepType)})); //"Programmer's assertion: unknown opcode: "
- // + stepType);
- }
-
- nodeTestType = compiler.getStepTestType(stepOpCodePos);
-
- int nextStepOpCodePos = compiler.getNextStepPos(stepOpCodePos);
-
- if (nextStepOpCodePos < 0)
- break;
-
- if(OpCodes.ENDOP != compiler.getOp(nextStepOpCodePos))
- {
- if(compiler.countPredicates(stepOpCodePos) > 0)
- {
- return false;
- }
- }
-
- stepOpCodePos = nextStepOpCodePos;
- }
-
- return true;
- }
-
- /**
- * Analyze the location path and return 32 bits that give information about
- * the location path as a whole. See the BIT_XXX constants for meaning about
- * each of the bits.
- *
- * @param compiler non-null reference to compiler object that has processed
- * the XPath operations into an opcode map.
- * @param stepOpCodePos The opcode position for the step.
- * @param stepIndex The top-level step index withing the iterator.
- *
- * @return 32 bits as an integer that give information about the location
- * path as a whole.
- *
- * @throws javax.xml.transform.TransformerException
- */
- private static int analyze(
- Compiler compiler, int stepOpCodePos, int stepIndex)
- throws javax.xml.transform.TransformerException
- {
-
- int stepType;
- int stepCount = 0;
- int analysisResult = 0x00000000; // 32 bits of analysis
-
- while (OpCodes.ENDOP != (stepType = compiler.getOp(stepOpCodePos)))
- {
- stepCount++;
-
- // String namespace = compiler.getStepNS(stepOpCodePos);
- // boolean isNSWild = (null != namespace)
- // ? namespace.equals(NodeTest.WILD) : false;
- // String localname = compiler.getStepLocalName(stepOpCodePos);
- // boolean isWild = (null != localname) ? localname.equals(NodeTest.WILD) : false;
- boolean predAnalysis = analyzePredicate(compiler, stepOpCodePos,
- stepType);
-
- if (predAnalysis)
- analysisResult |= BIT_PREDICATE;
-
- switch (stepType)
- {
- case OpCodes.OP_VARIABLE :
- case OpCodes.OP_EXTFUNCTION :
- case OpCodes.OP_FUNCTION :
- case OpCodes.OP_GROUP :
- analysisResult |= BIT_FILTER;
- break;
- case OpCodes.FROM_ROOT :
- analysisResult |= BIT_ROOT;
- break;
- case OpCodes.FROM_ANCESTORS :
- analysisResult |= BIT_ANCESTOR;
- break;
- case OpCodes.FROM_ANCESTORS_OR_SELF :
- analysisResult |= BIT_ANCESTOR_OR_SELF;
- break;
- case OpCodes.FROM_ATTRIBUTES :
- analysisResult |= BIT_ATTRIBUTE;
- break;
- case OpCodes.FROM_NAMESPACE :
- analysisResult |= BIT_NAMESPACE;
- break;
- case OpCodes.FROM_CHILDREN :
- analysisResult |= BIT_CHILD;
- break;
- case OpCodes.FROM_DESCENDANTS :
- analysisResult |= BIT_DESCENDANT;
- break;
- case OpCodes.FROM_DESCENDANTS_OR_SELF :
-
- // Use a special bit to to make sure we get the right analysis of "//foo".
- if (2 == stepCount && BIT_ROOT == analysisResult)
- {
- analysisResult |= BIT_ANY_DESCENDANT_FROM_ROOT;
- }
-
- analysisResult |= BIT_DESCENDANT_OR_SELF;
- break;
- case OpCodes.FROM_FOLLOWING :
- analysisResult |= BIT_FOLLOWING;
- break;
- case OpCodes.FROM_FOLLOWING_SIBLINGS :
- analysisResult |= BIT_FOLLOWING_SIBLING;
- break;
- case OpCodes.FROM_PRECEDING :
- analysisResult |= BIT_PRECEDING;
- break;
- case OpCodes.FROM_PRECEDING_SIBLINGS :
- analysisResult |= BIT_PRECEDING_SIBLING;
- break;
- case OpCodes.FROM_PARENT :
- analysisResult |= BIT_PARENT;
- break;
- case OpCodes.FROM_SELF :
- analysisResult |= BIT_SELF;
- break;
- case OpCodes.MATCH_ATTRIBUTE :
- analysisResult |= (BIT_MATCH_PATTERN | BIT_ATTRIBUTE);
- break;
- case OpCodes.MATCH_ANY_ANCESTOR :
- analysisResult |= (BIT_MATCH_PATTERN | BIT_ANCESTOR);
- break;
- case OpCodes.MATCH_IMMEDIATE_ANCESTOR :
- analysisResult |= (BIT_MATCH_PATTERN | BIT_PARENT);
- break;
- default :
- throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_ERROR_HANDLER, new Object[]{Integer.toString(stepType)})); //"Programmer's assertion: unknown opcode: "
- //+ stepType);
- }
-
- if (OpCodes.NODETYPE_NODE == compiler.getOp(stepOpCodePos + 3)) // child::node()
- {
- analysisResult |= BIT_NODETEST_ANY;
- }
-
- stepOpCodePos = compiler.getNextStepPos(stepOpCodePos);
-
- if (stepOpCodePos < 0)
- break;
- }
-
- analysisResult |= (stepCount & BITS_COUNT);
-
- return analysisResult;
- }
-
- /**
- * Tell if the given axis goes downword. Bogus name, if you can think of
- * a better one, please do tell. This really has to do with inverting
- * attribute axis.
- * @param axis One of Axis.XXX.
- * @return true if the axis is not a child axis and does not go up from
- * the axis root.
- */
- public static boolean isDownwardAxisOfMany(int axis)
- {
- return ((Axis.DESCENDANTORSELF == axis) ||
- (Axis.DESCENDANT == axis)
- || (Axis.FOLLOWING == axis)
-// || (Axis.FOLLOWINGSIBLING == axis)
- || (Axis.PRECEDING == axis)
-// || (Axis.PRECEDINGSIBLING == axis)
- );
- }
-
- /**
- * Read a <a href="http://www.w3.org/TR/xpath#location-paths">LocationPath</a>
- * as a generalized match pattern. What this means is that the LocationPath
- * is read backwards, as a test on a given node, to see if it matches the
- * criteria of the selection, and ends up at the context node. Essentially,
- * this is a backwards query from a given node, to find the context node.
- * <p>So, the selection "foo/daz[2]" is, in non-abreviated expanded syntax,
- * "self::node()/following-sibling::foo/child::daz[position()=2]".
- * Taking this as a match pattern for a probable node, it works out to
- * "self::daz/parent::foo[child::daz[position()=2 and isPrevStepNode()]
- * precedingSibling::node()[isContextNodeOfLocationPath()]", adding magic
- * isPrevStepNode and isContextNodeOfLocationPath operations. Predicates in
- * the location path have to be executed by the following step,
- * because they have to know the context of their execution.
- *
- * @param mpi The MatchPatternIterator to which the steps will be attached.
- * @param compiler The compiler that holds the syntax tree/op map to
- * construct from.
- * @param stepOpCodePos The current op code position within the opmap.
- * @param stepIndex The top-level step index withing the iterator.
- *
- * @return A StepPattern object, which may contain relative StepPatterns.
- *
- * @throws javax.xml.transform.TransformerException
- */
- static StepPattern loadSteps(
- MatchPatternIterator mpi, Compiler compiler, int stepOpCodePos,
- int stepIndex)
- throws javax.xml.transform.TransformerException
- {
- if (DEBUG_PATTERN_CREATION)
- {
- System.out.println("================");
- System.out.println("loadSteps for: "+compiler.getPatternString());
- }
- int stepType;
- StepPattern step = null;
- StepPattern firstStep = null, prevStep = null;
- int analysis = analyze(compiler, stepOpCodePos, stepIndex);
-
- while (OpCodes.ENDOP != (stepType = compiler.getOp(stepOpCodePos)))
- {
- step = createDefaultStepPattern(compiler, stepOpCodePos, mpi, analysis,
- firstStep, prevStep);
-
- if (null == firstStep)
- {
- firstStep = step;
- }
- else
- {
-
- //prevStep.setNextWalker(step);
- step.setRelativePathPattern(prevStep);
- }
-
- prevStep = step;
- stepOpCodePos = compiler.getNextStepPos(stepOpCodePos);
-
- if (stepOpCodePos < 0)
- break;
- }
-
- int axis = Axis.SELF;
- int paxis = Axis.SELF;
- StepPattern tail = step;
- for (StepPattern pat = step; null != pat;
- pat = pat.getRelativePathPattern())
- {
- int nextAxis = pat.getAxis();
- //int nextPaxis = pat.getPredicateAxis();
- pat.setAxis(axis);
-
- // The predicate axis can't be moved!!! Test Axes103
- // pat.setPredicateAxis(paxis);
-
- // If we have an attribute or namespace axis that went up, then
- // it won't find the attribute in the inverse, since the select-to-match
- // axes are not invertable (an element is a parent of an attribute, but
- // and attribute is not a child of an element).
- // If we don't do the magic below, then "@*/ancestor-or-self::*" gets
- // inverted for match to "self::*/descendant-or-self::@*/parent::node()",
- // which obviously won't work.
- // So we will rewrite this as:
- // "self::*/descendant-or-self::*/attribute::*/parent::node()"
- // Child has to be rewritten a little differently:
- // select: "@*/parent::*"
- // inverted match: "self::*/child::@*/parent::node()"
- // rewrite: "self::*/attribute::*/parent::node()"
- // Axes that go down in the select, do not have to have special treatment
- // in the rewrite. The following inverted match will still not select
- // anything.
- // select: "@*/child::*"
- // inverted match: "self::*/parent::@*/parent::node()"
- // Lovely business, this.
- // -sb
- int whatToShow = pat.getWhatToShow();
- if(whatToShow == DTMFilter.SHOW_ATTRIBUTE ||
- whatToShow == DTMFilter.SHOW_NAMESPACE)
- {
- int newAxis = (whatToShow == DTMFilter.SHOW_ATTRIBUTE) ?
- Axis.ATTRIBUTE : Axis.NAMESPACE;
- if(isDownwardAxisOfMany(axis))
- {
- StepPattern attrPat = new StepPattern(whatToShow,
- pat.getNamespace(),
- pat.getLocalName(),
- //newAxis, pat.getPredicateAxis);
- newAxis, 0); // don't care about the predicate axis
- XNumber score = pat.getStaticScore();
- pat.setNamespace(null);
- pat.setLocalName(NodeTest.WILD);
- attrPat.setPredicates(pat.getPredicates());
- pat.setPredicates(null);
- pat.setWhatToShow(DTMFilter.SHOW_ELEMENT);
- StepPattern rel = pat.getRelativePathPattern();
- pat.setRelativePathPattern(attrPat);
- attrPat.setRelativePathPattern(rel);
- attrPat.setStaticScore(score);
-
- // This is needed to inverse a following pattern, because of the
- // wacky Xalan rules for following from an attribute. See axes108.
- // By these rules, following from an attribute is not strictly
- // inverseable.
- if(Axis.PRECEDING == pat.getAxis())
- pat.setAxis(Axis.PRECEDINGANDANCESTOR);
-
- else if(Axis.DESCENDANT == pat.getAxis())
- pat.setAxis(Axis.DESCENDANTORSELF);
-
- pat = attrPat;
- }
- else if(Axis.CHILD == pat.getAxis())
- {
- // In this case just change the axis.
- // pat.setWhatToShow(whatToShow);
- pat.setAxis(Axis.ATTRIBUTE);
- }
- }
- axis = nextAxis;
- //paxis = nextPaxis;
- tail = pat;
- }
-
- if(axis < Axis.ALL)
- {
- StepPattern selfPattern = new ContextMatchStepPattern(axis, paxis);
- // We need to keep the new nodetest from affecting the score...
- XNumber score = tail.getStaticScore();
- tail.setRelativePathPattern(selfPattern);
- tail.setStaticScore(score);
- selfPattern.setStaticScore(score);
- }
-
- if (DEBUG_PATTERN_CREATION)
- {
- System.out.println("Done loading steps: "+step.toString());
-
- System.out.println("");
- }
- return step; // start from last pattern?? //firstStep;
- }
-
- /**
- * Create a StepPattern that is contained within a LocationPath.
- *
- *
- * @param compiler The compiler that holds the syntax tree/op map to
- * construct from.
- * @param stepOpCodePos The current op code position within the opmap.
- * @param mpi The MatchPatternIterator to which the steps will be attached.
- * @param analysis 32 bits of analysis, from which the type of AxesWalker
- * may be influenced.
- * @param tail The step that is the first step analyzed, but the last
- * step in the relative match linked list, i.e. the tail.
- * May be null.
- * @param head The step that is the current head of the relative
- * match step linked list.
- * May be null.
- *
- * @return the head of the list.
- *
- * @throws javax.xml.transform.TransformerException
- */
- private static StepPattern createDefaultStepPattern(
- Compiler compiler, int opPos, MatchPatternIterator mpi,
- int analysis, StepPattern tail, StepPattern head)
- throws javax.xml.transform.TransformerException
- {
-
- int stepType = compiler.getOp(opPos);
- boolean simpleInit = false;
- boolean prevIsOneStepDown = true;
-
- int whatToShow = compiler.getWhatToShow(opPos);
- StepPattern ai = null;
- int axis, predicateAxis;
-
- switch (stepType)
- {
- case OpCodes.OP_VARIABLE :
- case OpCodes.OP_EXTFUNCTION :
- case OpCodes.OP_FUNCTION :
- case OpCodes.OP_GROUP :
- prevIsOneStepDown = false;
-
- Expression expr;
-
- switch (stepType)
- {
- case OpCodes.OP_VARIABLE :
- case OpCodes.OP_EXTFUNCTION :
- case OpCodes.OP_FUNCTION :
- case OpCodes.OP_GROUP :
- expr = compiler.compile(opPos);
- break;
- default :
- expr = compiler.compile(opPos + 2);
- }
-
- axis = Axis.FILTEREDLIST;
- predicateAxis = Axis.FILTEREDLIST;
- ai = new FunctionPattern(expr, axis, predicateAxis);
- simpleInit = true;
- break;
- case OpCodes.FROM_ROOT :
- whatToShow = DTMFilter.SHOW_DOCUMENT
- | DTMFilter.SHOW_DOCUMENT_FRAGMENT;
-
- axis = Axis.ROOT;
- predicateAxis = Axis.ROOT;
- ai = new StepPattern(DTMFilter.SHOW_DOCUMENT |
- DTMFilter.SHOW_DOCUMENT_FRAGMENT,
- axis, predicateAxis);
- break;
- case OpCodes.FROM_ATTRIBUTES :
- whatToShow = DTMFilter.SHOW_ATTRIBUTE;
- axis = Axis.PARENT;
- predicateAxis = Axis.ATTRIBUTE;
- // ai = new StepPattern(whatToShow, Axis.SELF, Axis.SELF);
- break;
- case OpCodes.FROM_NAMESPACE :
- whatToShow = DTMFilter.SHOW_NAMESPACE;
- axis = Axis.PARENT;
- predicateAxis = Axis.NAMESPACE;
- // ai = new StepPattern(whatToShow, axis, predicateAxis);
- break;
- case OpCodes.FROM_ANCESTORS :
- axis = Axis.DESCENDANT;
- predicateAxis = Axis.ANCESTOR;
- break;
- case OpCodes.FROM_CHILDREN :
- axis = Axis.PARENT;
- predicateAxis = Axis.CHILD;
- break;
- case OpCodes.FROM_ANCESTORS_OR_SELF :
- axis = Axis.DESCENDANTORSELF;
- predicateAxis = Axis.ANCESTORORSELF;
- break;
- case OpCodes.FROM_SELF :
- axis = Axis.SELF;
- predicateAxis = Axis.SELF;
- break;
- case OpCodes.FROM_PARENT :
- axis = Axis.CHILD;
- predicateAxis = Axis.PARENT;
- break;
- case OpCodes.FROM_PRECEDING_SIBLINGS :
- axis = Axis.FOLLOWINGSIBLING;
- predicateAxis = Axis.PRECEDINGSIBLING;
- break;
- case OpCodes.FROM_PRECEDING :
- axis = Axis.FOLLOWING;
- predicateAxis = Axis.PRECEDING;
- break;
- case OpCodes.FROM_FOLLOWING_SIBLINGS :
- axis = Axis.PRECEDINGSIBLING;
- predicateAxis = Axis.FOLLOWINGSIBLING;
- break;
- case OpCodes.FROM_FOLLOWING :
- axis = Axis.PRECEDING;
- predicateAxis = Axis.FOLLOWING;
- break;
- case OpCodes.FROM_DESCENDANTS_OR_SELF :
- axis = Axis.ANCESTORORSELF;
- predicateAxis = Axis.DESCENDANTORSELF;
- break;
- case OpCodes.FROM_DESCENDANTS :
- axis = Axis.ANCESTOR;
- predicateAxis = Axis.DESCENDANT;
- break;
- default :
- throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_ERROR_HANDLER, new Object[]{Integer.toString(stepType)})); //"Programmer's assertion: unknown opcode: "
- //+ stepType);
- }
- if(null == ai)
- {
- whatToShow = compiler.getWhatToShow(opPos); // %REVIEW%
- ai = new StepPattern(whatToShow, compiler.getStepNS(opPos),
- compiler.getStepLocalName(opPos),
- axis, predicateAxis);
- }
-
- if (false || DEBUG_PATTERN_CREATION)
- {
- System.out.print("new step: "+ ai);
- System.out.print(", axis: " + Axis.getNames(ai.getAxis()));
- System.out.print(", predAxis: " + Axis.getNames(ai.getAxis()));
- System.out.print(", what: ");
- System.out.print(" ");
- ai.debugWhatToShow(ai.getWhatToShow());
- }
-
- int argLen = compiler.getFirstPredicateOpPos(opPos);
-
- ai.setPredicates(compiler.getCompiledPredicates(argLen));
-
- return ai;
- }
-
- /**
- * Analyze a step and give information about it's predicates. Right now this
- * just returns true or false if the step has a predicate.
- *
- * @param compiler non-null reference to compiler object that has processed
- * the XPath operations into an opcode map.
- * @param opPos The opcode position for the step.
- * @param stepType The type of step, one of OP_GROUP, etc.
- *
- * @return true if step has a predicate.
- *
- * @throws javax.xml.transform.TransformerException
- */
- static boolean analyzePredicate(Compiler compiler, int opPos, int stepType)
- throws javax.xml.transform.TransformerException
- {
-
- int argLen;
-
- switch (stepType)
- {
- case OpCodes.OP_VARIABLE :
- case OpCodes.OP_EXTFUNCTION :
- case OpCodes.OP_FUNCTION :
- case OpCodes.OP_GROUP :
- argLen = compiler.getArgLength(opPos);
- break;
- default :
- argLen = compiler.getArgLengthOfStep(opPos);
- }
-
- int pos = compiler.getFirstPredicateOpPos(opPos);
- int nPredicates = compiler.countPredicates(pos);
-
- return (nPredicates > 0) ? true : false;
- }
-
- /**
- * Create the proper Walker from the axes type.
- *
- * @param compiler non-null reference to compiler object that has processed
- * the XPath operations into an opcode map.
- * @param opPos The opcode position for the step.
- * @param lpi The owning location path iterator.
- * @param analysis 32 bits of analysis, from which the type of AxesWalker
- * may be influenced.
- *
- * @return non-null reference to AxesWalker derivative.
- * @throws RuntimeException if the input is bad.
- */
- private static AxesWalker createDefaultWalker(Compiler compiler, int opPos,
- WalkingIterator lpi, int analysis)
- {
-
- AxesWalker ai = null;
- int stepType = compiler.getOp(opPos);
-
- /*
- System.out.println("0: "+compiler.getOp(opPos));
- System.out.println("1: "+compiler.getOp(opPos+1));
- System.out.println("2: "+compiler.getOp(opPos+2));
- System.out.println("3: "+compiler.getOp(opPos+3));
- System.out.println("4: "+compiler.getOp(opPos+4));
- System.out.println("5: "+compiler.getOp(opPos+5));
- */
- boolean simpleInit = false;
- int totalNumberWalkers = (analysis & BITS_COUNT);
- boolean prevIsOneStepDown = true;
-
- switch (stepType)
- {
- case OpCodes.OP_VARIABLE :
- case OpCodes.OP_EXTFUNCTION :
- case OpCodes.OP_FUNCTION :
- case OpCodes.OP_GROUP :
- prevIsOneStepDown = false;
-
- if (DEBUG_WALKER_CREATION)
- System.out.println("new walker: FilterExprWalker: " + analysis
- + ", " + compiler.toString());
-
- ai = new FilterExprWalker(lpi);
- simpleInit = true;
- break;
- case OpCodes.FROM_ROOT :
- ai = new AxesWalker(lpi, Axis.ROOT);
- break;
- case OpCodes.FROM_ANCESTORS :
- prevIsOneStepDown = false;
- ai = new ReverseAxesWalker(lpi, Axis.ANCESTOR);
- break;
- case OpCodes.FROM_ANCESTORS_OR_SELF :
- prevIsOneStepDown = false;
- ai = new ReverseAxesWalker(lpi, Axis.ANCESTORORSELF);
- break;
- case OpCodes.FROM_ATTRIBUTES :
- ai = new AxesWalker(lpi, Axis.ATTRIBUTE);
- break;
- case OpCodes.FROM_NAMESPACE :
- ai = new AxesWalker(lpi, Axis.NAMESPACE);
- break;
- case OpCodes.FROM_CHILDREN :
- ai = new AxesWalker(lpi, Axis.CHILD);
- break;
- case OpCodes.FROM_DESCENDANTS :
- prevIsOneStepDown = false;
- ai = new AxesWalker(lpi, Axis.DESCENDANT);
- break;
- case OpCodes.FROM_DESCENDANTS_OR_SELF :
- prevIsOneStepDown = false;
- ai = new AxesWalker(lpi, Axis.DESCENDANTORSELF);
- break;
- case OpCodes.FROM_FOLLOWING :
- prevIsOneStepDown = false;
- ai = new AxesWalker(lpi, Axis.FOLLOWING);
- break;
- case OpCodes.FROM_FOLLOWING_SIBLINGS :
- prevIsOneStepDown = false;
- ai = new AxesWalker(lpi, Axis.FOLLOWINGSIBLING);
- break;
- case OpCodes.FROM_PRECEDING :
- prevIsOneStepDown = false;
- ai = new ReverseAxesWalker(lpi, Axis.PRECEDING);
- break;
- case OpCodes.FROM_PRECEDING_SIBLINGS :
- prevIsOneStepDown = false;
- ai = new ReverseAxesWalker(lpi, Axis.PRECEDINGSIBLING);
- break;
- case OpCodes.FROM_PARENT :
- prevIsOneStepDown = false;
- ai = new ReverseAxesWalker(lpi, Axis.PARENT);
- break;
- case OpCodes.FROM_SELF :
- ai = new AxesWalker(lpi, Axis.SELF);
- break;
- default :
- throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_ERROR_HANDLER, new Object[]{Integer.toString(stepType)})); //"Programmer's assertion: unknown opcode: "
- //+ stepType);
- }
-
- if (simpleInit)
- {
- ai.initNodeTest(DTMFilter.SHOW_ALL);
- }
- else
- {
- int whatToShow = compiler.getWhatToShow(opPos);
-
- /*
- System.out.print("construct: ");
- NodeTest.debugWhatToShow(whatToShow);
- System.out.println("or stuff: "+(whatToShow & (DTMFilter.SHOW_ATTRIBUTE
- | DTMFilter.SHOW_ELEMENT
- | DTMFilter.SHOW_PROCESSING_INSTRUCTION)));
- */
- if ((0 == (whatToShow
- & (DTMFilter.SHOW_ATTRIBUTE | DTMFilter.SHOW_NAMESPACE | DTMFilter.SHOW_ELEMENT
- | DTMFilter.SHOW_PROCESSING_INSTRUCTION))) || (whatToShow == DTMFilter.SHOW_ALL))
- ai.initNodeTest(whatToShow);
- else
- {
- ai.initNodeTest(whatToShow, compiler.getStepNS(opPos),
- compiler.getStepLocalName(opPos));
- }
- }
-
- return ai;
- }
-
- public static String getAnalysisString(int analysis)
- {
- StringBuffer buf = new StringBuffer();
- buf.append("count: ").append(getStepCount(analysis)).append(' ');
- if((analysis & BIT_NODETEST_ANY) != 0)
- {
- buf.append("NTANY|");
- }
- if((analysis & BIT_PREDICATE) != 0)
- {
- buf.append("PRED|");
- }
- if((analysis & BIT_ANCESTOR) != 0)
- {
- buf.append("ANC|");
- }
- if((analysis & BIT_ANCESTOR_OR_SELF) != 0)
- {
- buf.append("ANCOS|");
- }
- if((analysis & BIT_ATTRIBUTE) != 0)
- {
- buf.append("ATTR|");
- }
- if((analysis & BIT_CHILD) != 0)
- {
- buf.append("CH|");
- }
- if((analysis & BIT_DESCENDANT) != 0)
- {
- buf.append("DESC|");
- }
- if((analysis & BIT_DESCENDANT_OR_SELF) != 0)
- {
- buf.append("DESCOS|");
- }
- if((analysis & BIT_FOLLOWING) != 0)
- {
- buf.append("FOL|");
- }
- if((analysis & BIT_FOLLOWING_SIBLING) != 0)
- {
- buf.append("FOLS|");
- }
- if((analysis & BIT_NAMESPACE) != 0)
- {
- buf.append("NS|");
- }
- if((analysis & BIT_PARENT) != 0)
- {
- buf.append("P|");
- }
- if((analysis & BIT_PRECEDING) != 0)
- {
- buf.append("PREC|");
- }
- if((analysis & BIT_PRECEDING_SIBLING) != 0)
- {
- buf.append("PRECS|");
- }
- if((analysis & BIT_SELF) != 0)
- {
- buf.append(".|");
- }
- if((analysis & BIT_FILTER) != 0)
- {
- buf.append("FLT|");
- }
- if((analysis & BIT_ROOT) != 0)
- {
- buf.append("R|");
- }
- return buf.toString();
- }
-
- /** Set to true for diagnostics about walker creation */
- static final boolean DEBUG_PATTERN_CREATION = false;
-
- /** Set to true for diagnostics about walker creation */
- static final boolean DEBUG_WALKER_CREATION = false;
-
- /** Set to true for diagnostics about iterator creation */
- static final boolean DEBUG_ITERATOR_CREATION = false;
-
- public static boolean hasPredicate(int analysis)
- {
- return (0 != (analysis & BIT_PREDICATE));
- }
-
- public static boolean isWild(int analysis)
- {
- return (0 != (analysis & BIT_NODETEST_ANY));
- }
-
- public static boolean walksAncestors(int analysis)
- {
- return isSet(analysis, BIT_ANCESTOR | BIT_ANCESTOR_OR_SELF);
- }
-
- public static boolean walksAttributes(int analysis)
- {
- return (0 != (analysis & BIT_ATTRIBUTE));
- }
-
- public static boolean walksNamespaces(int analysis)
- {
- return (0 != (analysis & BIT_NAMESPACE));
- }
-
- public static boolean walksChildren(int analysis)
- {
- return (0 != (analysis & BIT_CHILD));
- }
-
- public static boolean walksDescendants(int analysis)
- {
- return isSet(analysis, BIT_DESCENDANT | BIT_DESCENDANT_OR_SELF);
- }
-
- public static boolean walksSubtree(int analysis)
- {
- return isSet(analysis, BIT_DESCENDANT | BIT_DESCENDANT_OR_SELF | BIT_CHILD);
- }
-
- public static boolean walksSubtreeOnlyMaybeAbsolute(int analysis)
- {
- return walksSubtree(analysis)
- && !walksExtraNodes(analysis)
- && !walksUp(analysis)
- && !walksSideways(analysis)
- ;
- }
-
- public static boolean walksSubtreeOnly(int analysis)
- {
- return walksSubtreeOnlyMaybeAbsolute(analysis)
- && !isAbsolute(analysis)
- ;
- }
-
- public static boolean walksFilteredList(int analysis)
- {
- return isSet(analysis, BIT_FILTER);
- }
-
- public static boolean walksSubtreeOnlyFromRootOrContext(int analysis)
- {
- return walksSubtree(analysis)
- && !walksExtraNodes(analysis)
- && !walksUp(analysis)
- && !walksSideways(analysis)
- && !isSet(analysis, BIT_FILTER)
- ;
- }
-
- public static boolean walksInDocOrder(int analysis)
- {
- return (walksSubtreeOnlyMaybeAbsolute(analysis)
- || walksExtraNodesOnly(analysis)
- || walksFollowingOnlyMaybeAbsolute(analysis))
- && !isSet(analysis, BIT_FILTER)
- ;
- }
-
- public static boolean walksFollowingOnlyMaybeAbsolute(int analysis)
- {
- return isSet(analysis, BIT_SELF | BIT_FOLLOWING_SIBLING | BIT_FOLLOWING)
- && !walksSubtree(analysis)
- && !walksUp(analysis)
- && !walksSideways(analysis)
- ;
- }
-
- public static boolean walksUp(int analysis)
- {
- return isSet(analysis, BIT_PARENT | BIT_ANCESTOR | BIT_ANCESTOR_OR_SELF);
- }
-
- public static boolean walksSideways(int analysis)
- {
- return isSet(analysis, BIT_FOLLOWING | BIT_FOLLOWING_SIBLING |
- BIT_PRECEDING | BIT_PRECEDING_SIBLING);
- }
-
- public static boolean walksExtraNodes(int analysis)
- {
- return isSet(analysis, BIT_NAMESPACE | BIT_ATTRIBUTE);
- }
-
- public static boolean walksExtraNodesOnly(int analysis)
- {
- return walksExtraNodes(analysis)
- && !isSet(analysis, BIT_SELF)
- && !walksSubtree(analysis)
- && !walksUp(analysis)
- && !walksSideways(analysis)
- && !isAbsolute(analysis)
- ;
- }
-
- public static boolean isAbsolute(int analysis)
- {
- return isSet(analysis, BIT_ROOT | BIT_FILTER);
- }
-
- public static boolean walksChildrenOnly(int analysis)
- {
- return walksChildren(analysis)
- && !isSet(analysis, BIT_SELF)
- && !walksExtraNodes(analysis)
- && !walksDescendants(analysis)
- && !walksUp(analysis)
- && !walksSideways(analysis)
- && (!isAbsolute(analysis) || isSet(analysis, BIT_ROOT))
- ;
- }
-
- public static boolean walksChildrenAndExtraAndSelfOnly(int analysis)
- {
- return walksChildren(analysis)
- && !walksDescendants(analysis)
- && !walksUp(analysis)
- && !walksSideways(analysis)
- && (!isAbsolute(analysis) || isSet(analysis, BIT_ROOT))
- ;
- }
-
- public static boolean walksDescendantsAndExtraAndSelfOnly(int analysis)
- {
- return !walksChildren(analysis)
- && walksDescendants(analysis)
- && !walksUp(analysis)
- && !walksSideways(analysis)
- && (!isAbsolute(analysis) || isSet(analysis, BIT_ROOT))
- ;
- }
-
- public static boolean walksSelfOnly(int analysis)
- {
- return isSet(analysis, BIT_SELF)
- && !walksSubtree(analysis)
- && !walksUp(analysis)
- && !walksSideways(analysis)
- && !isAbsolute(analysis)
- ;
- }
-
-
- public static boolean walksUpOnly(int analysis)
- {
- return !walksSubtree(analysis)
- && walksUp(analysis)
- && !walksSideways(analysis)
- && !isAbsolute(analysis)
- ;
- }
-
- public static boolean walksDownOnly(int analysis)
- {
- return walksSubtree(analysis)
- && !walksUp(analysis)
- && !walksSideways(analysis)
- && !isAbsolute(analysis)
- ;
- }
-
- public static boolean walksDownExtraOnly(int analysis)
- {
- return walksSubtree(analysis) && walksExtraNodes(analysis)
- && !walksUp(analysis)
- && !walksSideways(analysis)
- && !isAbsolute(analysis)
- ;
- }
-
- public static boolean canSkipSubtrees(int analysis)
- {
- return isSet(analysis, BIT_CHILD) | walksSideways(analysis);
- }
-
- public static boolean canCrissCross(int analysis)
- {
- // This could be done faster. Coded for clarity.
- if(walksSelfOnly(analysis))
- return false;
- else if(walksDownOnly(analysis) && !canSkipSubtrees(analysis))
- return false;
- else if(walksChildrenAndExtraAndSelfOnly(analysis))
- return false;
- else if(walksDescendantsAndExtraAndSelfOnly(analysis))
- return false;
- else if(walksUpOnly(analysis))
- return false;
- else if(walksExtraNodesOnly(analysis))
- return false;
- else if(walksSubtree(analysis)
- && (walksSideways(analysis)
- || walksUp(analysis)
- || canSkipSubtrees(analysis)))
- return true;
- else
- return false;
- }
-
- /**
- * Tell if the pattern can be 'walked' with the iteration steps in natural
- * document order, without duplicates.
- *
- * @param analysis The general analysis of the pattern.
- *
- * @return true if the walk can be done in natural order.
- *
- * @throws javax.xml.transform.TransformerException
- */
- static public boolean isNaturalDocOrder(int analysis)
- {
- if(canCrissCross(analysis) || isSet(analysis, BIT_NAMESPACE) ||
- walksFilteredList(analysis))
- return false;
-
- if(walksInDocOrder(analysis))
- return true;
-
- return false;
- }
-
- /**
- * Tell if the pattern can be 'walked' with the iteration steps in natural
- * document order, without duplicates.
- *
- * @param compiler non-null reference to compiler object that has processed
- * the XPath operations into an opcode map.
- * @param stepOpCodePos The opcode position for the step.
- * @param stepIndex The top-level step index withing the iterator.
- * @param analysis The general analysis of the pattern.
- *
- * @return true if the walk can be done in natural order.
- *
- * @throws javax.xml.transform.TransformerException
- */
- private static boolean isNaturalDocOrder(
- Compiler compiler, int stepOpCodePos, int stepIndex, int analysis)
- throws javax.xml.transform.TransformerException
- {
- if(canCrissCross(analysis))
- return false;
-
- // Namespaces can present some problems, so just punt if we're looking for
- // these.
- if(isSet(analysis, BIT_NAMESPACE))
- return false;
-
- // The following, preceding, following-sibling, and preceding sibling can
- // be found in doc order if we get to this point, but if they occur
- // together, they produce
- // duplicates, so it's better for us to eliminate this case so we don't
- // have to check for duplicates during runtime if we're using a
- // WalkingIterator.
- if(isSet(analysis, BIT_FOLLOWING | BIT_FOLLOWING_SIBLING) &&
- isSet(analysis, BIT_PRECEDING | BIT_PRECEDING_SIBLING))
- return false;
-
- // OK, now we have to check for select="@*/axis::*" patterns, which
- // can also cause duplicates to happen. But select="axis*/@::*" patterns
- // are OK, as are select="@foo/axis::*" patterns.
- // Unfortunately, we can't do this just via the analysis bits.
-
- int stepType;
- int stepCount = 0;
- boolean foundWildAttribute = false;
-
- // Steps that can traverse anything other than down a
- // subtree or that can produce duplicates when used in
- // combonation are counted with this variable.
- int potentialDuplicateMakingStepCount = 0;
-
- while (OpCodes.ENDOP != (stepType = compiler.getOp(stepOpCodePos)))
- {
- stepCount++;
-
- switch (stepType)
- {
- case OpCodes.FROM_ATTRIBUTES :
- case OpCodes.MATCH_ATTRIBUTE :
- if(foundWildAttribute) // Maybe not needed, but be safe.
- return false;
-
- // This doesn't seem to work as a test for wild card. Hmph.
- // int nodeTestType = compiler.getStepTestType(stepOpCodePos);
-
- String localName = compiler.getStepLocalName(stepOpCodePos);
- // System.err.println("localName: "+localName);
- if(localName.equals("*"))
- {
- foundWildAttribute = true;
- }
- break;
- case OpCodes.FROM_FOLLOWING :
- case OpCodes.FROM_FOLLOWING_SIBLINGS :
- case OpCodes.FROM_PRECEDING :
- case OpCodes.FROM_PRECEDING_SIBLINGS :
- case OpCodes.FROM_PARENT :
- case OpCodes.OP_VARIABLE :
- case OpCodes.OP_EXTFUNCTION :
- case OpCodes.OP_FUNCTION :
- case OpCodes.OP_GROUP :
- case OpCodes.FROM_NAMESPACE :
- case OpCodes.FROM_ANCESTORS :
- case OpCodes.FROM_ANCESTORS_OR_SELF :
- case OpCodes.MATCH_ANY_ANCESTOR :
- case OpCodes.MATCH_IMMEDIATE_ANCESTOR :
- case OpCodes.FROM_DESCENDANTS_OR_SELF :
- case OpCodes.FROM_DESCENDANTS :
- if(potentialDuplicateMakingStepCount > 0)
- return false;
- potentialDuplicateMakingStepCount++;
- case OpCodes.FROM_ROOT :
- case OpCodes.FROM_CHILDREN :
- case OpCodes.FROM_SELF :
- if(foundWildAttribute)
- return false;
- break;
- default :
- throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_ERROR_HANDLER, new Object[]{Integer.toString(stepType)})); //"Programmer's assertion: unknown opcode: "
- // + stepType);
- }
-
- int nextStepOpCodePos = compiler.getNextStepPos(stepOpCodePos);
-
- if (nextStepOpCodePos < 0)
- break;
-
- stepOpCodePos = nextStepOpCodePos;
- }
-
- return true;
- }
-
- public static boolean isOneStep(int analysis)
- {
- return (analysis & BITS_COUNT) == 0x00000001;
- }
-
- public static int getStepCount(int analysis)
- {
- return (analysis & BITS_COUNT);
- }
-
- /**
- * First 8 bits are the number of top-level location steps. Hopefully
- * there will never be more that 255 location steps!!!
- */
- public static final int BITS_COUNT = 0x000000FF;
-
- /** 4 bits are reserved for future use. */
- public static final int BITS_RESERVED = 0x00000F00;
-
- /** Bit is on if the expression contains a top-level predicate. */
- public static final int BIT_PREDICATE = (0x00001000);
-
- /** Bit is on if any of the walkers contain an ancestor step. */
- public static final int BIT_ANCESTOR = (0x00001000 << 1);
-
- /** Bit is on if any of the walkers contain an ancestor-or-self step. */
- public static final int BIT_ANCESTOR_OR_SELF = (0x00001000 << 2);
-
- /** Bit is on if any of the walkers contain an attribute step. */
- public static final int BIT_ATTRIBUTE = (0x00001000 << 3);
-
- /** Bit is on if any of the walkers contain a child step. */
- public static final int BIT_CHILD = (0x00001000 << 4);
-
- /** Bit is on if any of the walkers contain a descendant step. */
- public static final int BIT_DESCENDANT = (0x00001000 << 5);
-
- /** Bit is on if any of the walkers contain a descendant-or-self step. */
- public static final int BIT_DESCENDANT_OR_SELF = (0x00001000 << 6);
-
- /** Bit is on if any of the walkers contain a following step. */
- public static final int BIT_FOLLOWING = (0x00001000 << 7);
-
- /** Bit is on if any of the walkers contain a following-sibiling step. */
- public static final int BIT_FOLLOWING_SIBLING = (0x00001000 << 8);
-
- /** Bit is on if any of the walkers contain a namespace step. */
- public static final int BIT_NAMESPACE = (0x00001000 << 9);
-
- /** Bit is on if any of the walkers contain a parent step. */
- public static final int BIT_PARENT = (0x00001000 << 10);
-
- /** Bit is on if any of the walkers contain a preceding step. */
- public static final int BIT_PRECEDING = (0x00001000 << 11);
-
- /** Bit is on if any of the walkers contain a preceding-sibling step. */
- public static final int BIT_PRECEDING_SIBLING = (0x00001000 << 12);
-
- /** Bit is on if any of the walkers contain a self step. */
- public static final int BIT_SELF = (0x00001000 << 13);
-
- /**
- * Bit is on if any of the walkers contain a filter (i.e. id(), extension
- * function, etc.) step.
- */
- public static final int BIT_FILTER = (0x00001000 << 14);
-
- /** Bit is on if any of the walkers contain a root step. */
- public static final int BIT_ROOT = (0x00001000 << 15);
-
- /**
- * If any of these bits are on, the expression may likely traverse outside
- * the given subtree.
- */
- public static final int BITMASK_TRAVERSES_OUTSIDE_SUBTREE = (BIT_NAMESPACE // ??
- | BIT_PRECEDING_SIBLING
- | BIT_PRECEDING
- | BIT_FOLLOWING_SIBLING
- | BIT_FOLLOWING
- | BIT_PARENT // except parent of attrs.
- | BIT_ANCESTOR_OR_SELF
- | BIT_ANCESTOR
- | BIT_FILTER
- | BIT_ROOT);
-
- /**
- * Bit is on if any of the walkers can go backwards in document
- * order from the context node.
- */
- public static final int BIT_BACKWARDS_SELF = (0x00001000 << 16);
-
- /** Found "//foo" pattern */
- public static final int BIT_ANY_DESCENDANT_FROM_ROOT = (0x00001000 << 17);
-
- /**
- * Bit is on if any of the walkers contain an node() test. This is
- * really only useful if the count is 1.
- */
- public static final int BIT_NODETEST_ANY = (0x00001000 << 18);
-
- // can't go higher than 18!
-
- /** Bit is on if the expression is a match pattern. */
- public static final int BIT_MATCH_PATTERN = (0x00001000 << 19);
-}
diff --git a/src/com/sun/org/apache/xpath/internal/axes/WalkingIterator.java b/src/com/sun/org/apache/xpath/internal/axes/WalkingIterator.java
deleted file mode 100644
index 08502fe..0000000
--- a/src/com/sun/org/apache/xpath/internal/axes/WalkingIterator.java
+++ /dev/null
@@ -1,365 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: WalkingIterator.java,v 1.2.4.2 2005/09/14 19:45:19 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.axes;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.utils.PrefixResolver;
-import com.sun.org.apache.xpath.internal.Expression;
-import com.sun.org.apache.xpath.internal.ExpressionOwner;
-import com.sun.org.apache.xpath.internal.VariableStack;
-import com.sun.org.apache.xpath.internal.XPathVisitor;
-import com.sun.org.apache.xpath.internal.compiler.Compiler;
-import com.sun.org.apache.xpath.internal.compiler.OpMap;
-
-/**
- * Location path iterator that uses Walkers.
- */
-
-public class WalkingIterator extends LocPathIterator implements ExpressionOwner
-{
- static final long serialVersionUID = 9110225941815665906L;
- /**
- * Create a WalkingIterator iterator, including creation
- * of step walkers from the opcode list, and call back
- * into the Compiler to create predicate expressions.
- *
- * @param compiler The Compiler which is creating
- * this expression.
- * @param opPos The position of this iterator in the
- * opcode list from the compiler.
- * @param shouldLoadWalkers True if walkers should be
- * loaded, or false if this is a derived iterator and
- * it doesn't wish to load child walkers.
- *
- * @throws javax.xml.transform.TransformerException
- */
- WalkingIterator(
- Compiler compiler, int opPos, int analysis, boolean shouldLoadWalkers)
- throws javax.xml.transform.TransformerException
- {
- super(compiler, opPos, analysis, shouldLoadWalkers);
-
- int firstStepPos = OpMap.getFirstChildPos(opPos);
-
- if (shouldLoadWalkers)
- {
- m_firstWalker = WalkerFactory.loadWalkers(this, compiler, firstStepPos, 0);
- m_lastUsedWalker = m_firstWalker;
- }
- }
-
- /**
- * Create a WalkingIterator object.
- *
- * @param nscontext The namespace context for this iterator,
- * should be OK if null.
- */
- public WalkingIterator(PrefixResolver nscontext)
- {
-
- super(nscontext);
- }
-
-
- /**
- * Get the analysis bits for this walker, as defined in the WalkerFactory.
- * @return One of WalkerFactory#BIT_DESCENDANT, etc.
- */
- public int getAnalysisBits()
- {
- int bits = 0;
- if (null != m_firstWalker)
- {
- AxesWalker walker = m_firstWalker;
-
- while (null != walker)
- {
- int bit = walker.getAnalysisBits();
- bits |= bit;
- walker = walker.getNextWalker();
- }
- }
- return bits;
- }
-
- /**
- * Get a cloned WalkingIterator that holds the same
- * position as this iterator.
- *
- * @return A clone of this iterator that holds the same node position.
- *
- * @throws CloneNotSupportedException
- */
- public Object clone() throws CloneNotSupportedException
- {
-
- WalkingIterator clone = (WalkingIterator) super.clone();
-
- // clone.m_varStackPos = this.m_varStackPos;
- // clone.m_varStackContext = this.m_varStackContext;
- if (null != m_firstWalker)
- {
- clone.m_firstWalker = m_firstWalker.cloneDeep(clone, null);
- }
-
- return clone;
- }
-
- /**
- * Reset the iterator.
- */
- public void reset()
- {
-
- super.reset();
-
- if (null != m_firstWalker)
- {
- m_lastUsedWalker = m_firstWalker;
-
- m_firstWalker.setRoot(m_context);
- }
-
- }
-
- /**
- * Initialize the context values for this expression
- * after it is cloned.
- *
- * @param context The XPath runtime context for this
- * transformation.
- */
- public void setRoot(int context, Object environment)
- {
-
- super.setRoot(context, environment);
-
- if(null != m_firstWalker)
- {
- m_firstWalker.setRoot(context);
- m_lastUsedWalker = m_firstWalker;
- }
- }
-
- /**
- * Returns the next node in the set and advances the position of the
- * iterator in the set. After a NodeIterator is created, the first call
- * to nextNode() returns the first node in the set.
- * @return The next <code>Node</code> in the set being iterated over, or
- * <code>null</code> if there are no more members in that set.
- */
- public int nextNode()
- {
- if(m_foundLast)
- return DTM.NULL;
-
- // If the variable stack position is not -1, we'll have to
- // set our position in the variable stack, so our variable access
- // will be correct. Iterators that are at the top level of the
- // expression need to reset the variable stack, while iterators
- // in predicates do not need to, and should not, since their execution
- // may be much later than top-level iterators.
- // m_varStackPos is set in setRoot, which is called
- // from the execute method.
- if (-1 == m_stackFrame)
- {
- return returnNextNode(m_firstWalker.nextNode());
- }
- else
- {
- VariableStack vars = m_execContext.getVarStack();
-
- // These three statements need to be combined into one operation.
- int savedStart = vars.getStackFrame();
-
- vars.setStackFrame(m_stackFrame);
-
- int n = returnNextNode(m_firstWalker.nextNode());
-
- // These two statements need to be combined into one operation.
- vars.setStackFrame(savedStart);
-
- return n;
- }
- }
-
-
- /**
- * Get the head of the walker list.
- *
- * @return The head of the walker list, or null
- * if this iterator does not implement walkers.
- * @xsl.usage advanced
- */
- public final AxesWalker getFirstWalker()
- {
- return m_firstWalker;
- }
-
- /**
- * Set the head of the walker list.
- *
- * @param walker Should be a valid AxesWalker.
- * @xsl.usage advanced
- */
- public final void setFirstWalker(AxesWalker walker)
- {
- m_firstWalker = walker;
- }
-
-
- /**
- * Set the last used walker.
- *
- * @param walker The last used walker, or null.
- * @xsl.usage advanced
- */
- public final void setLastUsedWalker(AxesWalker walker)
- {
- m_lastUsedWalker = walker;
- }
-
- /**
- * Get the last used walker.
- *
- * @return The last used walker, or null.
- * @xsl.usage advanced
- */
- public final AxesWalker getLastUsedWalker()
- {
- return m_lastUsedWalker;
- }
-
- /**
- * Detaches the iterator from the set which it iterated over, releasing
- * any computational resources and placing the iterator in the INVALID
- * state. After<code>detach</code> has been invoked, calls to
- * <code>nextNode</code> or<code>previousNode</code> will raise the
- * exception INVALID_STATE_ERR.
- */
- public void detach()
- {
- if(m_allowDetach)
- {
- AxesWalker walker = m_firstWalker;
- while (null != walker)
- {
- walker.detach();
- walker = walker.getNextWalker();
- }
-
- m_lastUsedWalker = null;
-
- // Always call the superclass detach last!
- super.detach();
- }
- }
-
- /**
- * This function is used to fixup variables from QNames to stack frame
- * indexes at stylesheet build time.
- * @param vars List of QNames that correspond to variables. This list
- * should be searched backwards for the first qualified name that
- * corresponds to the variable reference qname. The position of the
- * QName in the vector from the start of the vector will be its position
- * in the stack frame (but variables above the globalsTop value will need
- * to be offset to the current stack frame).
- */
- public void fixupVariables(java.util.Vector vars, int globalsSize)
- {
- m_predicateIndex = -1;
-
- AxesWalker walker = m_firstWalker;
-
- while (null != walker)
- {
- walker.fixupVariables(vars, globalsSize);
- walker = walker.getNextWalker();
- }
- }
-
- /**
- * @see com.sun.org.apache.xpath.internal.XPathVisitable#callVisitors(ExpressionOwner, XPathVisitor)
- */
- public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)
- {
- if(visitor.visitLocationPath(owner, this))
- {
- if(null != m_firstWalker)
- {
- m_firstWalker.callVisitors(this, visitor);
- }
- }
- }
-
-
- /** The last used step walker in the walker list.
- * @serial */
- protected AxesWalker m_lastUsedWalker;
-
- /** The head of the step walker list.
- * @serial */
- protected AxesWalker m_firstWalker;
-
- /**
- * @see ExpressionOwner#getExpression()
- */
- public Expression getExpression()
- {
- return m_firstWalker;
- }
-
- /**
- * @see ExpressionOwner#setExpression(Expression)
- */
- public void setExpression(Expression exp)
- {
- exp.exprSetParent(this);
- m_firstWalker = (AxesWalker)exp;
- }
-
- /**
- * @see Expression#deepEquals(Expression)
- */
- public boolean deepEquals(Expression expr)
- {
- if (!super.deepEquals(expr))
- return false;
-
- AxesWalker walker1 = m_firstWalker;
- AxesWalker walker2 = ((WalkingIterator)expr).m_firstWalker;
- while ((null != walker1) && (null != walker2))
- {
- if(!walker1.deepEquals(walker2))
- return false;
- walker1 = walker1.getNextWalker();
- walker2 = walker2.getNextWalker();
- }
-
- if((null != walker1) || (null != walker2))
- return false;
-
- return true;
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/axes/WalkingIteratorSorted.java b/src/com/sun/org/apache/xpath/internal/axes/WalkingIteratorSorted.java
deleted file mode 100644
index 1a1fe94..0000000
--- a/src/com/sun/org/apache/xpath/internal/axes/WalkingIteratorSorted.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: WalkingIteratorSorted.java,v 1.2.4.1 2005/09/14 19:45:23 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.axes;
-
-import com.sun.org.apache.xml.internal.dtm.Axis;
-import com.sun.org.apache.xml.internal.utils.PrefixResolver;
-import com.sun.org.apache.xpath.internal.compiler.Compiler;
-
-/**
- * This class iterates over set of nodes that needs to be sorted.
- * @xsl.usage internal
- */
-public class WalkingIteratorSorted extends WalkingIterator
-{
- static final long serialVersionUID = -4512512007542368213L;
-
-// /** True if the nodes will be found in document order */
-// protected boolean m_inNaturalOrder = false;
-
- /** True if the nodes will be found in document order, and this can
- * be determined statically. */
- protected boolean m_inNaturalOrderStatic = false;
-
- /**
- * Create a WalkingIteratorSorted object.
- *
- * @param nscontext The namespace context for this iterator,
- * should be OK if null.
- */
- public WalkingIteratorSorted(PrefixResolver nscontext)
- {
- super(nscontext);
- }
-
- /**
- * Create a WalkingIterator iterator, including creation
- * of step walkers from the opcode list, and call back
- * into the Compiler to create predicate expressions.
- *
- * @param compiler The Compiler which is creating
- * this expression.
- * @param opPos The position of this iterator in the
- * opcode list from the compiler.
- * @param shouldLoadWalkers True if walkers should be
- * loaded, or false if this is a derived iterator and
- * it doesn't wish to load child walkers.
- *
- * @throws javax.xml.transform.TransformerException
- */
- WalkingIteratorSorted(
- Compiler compiler, int opPos, int analysis, boolean shouldLoadWalkers)
- throws javax.xml.transform.TransformerException
- {
- super(compiler, opPos, analysis, shouldLoadWalkers);
- }
-
- /**
- * Returns true if all the nodes in the iteration well be returned in document
- * order.
- *
- * @return true as a default.
- */
- public boolean isDocOrdered()
- {
- return m_inNaturalOrderStatic;
- }
-
-
- /**
- * Tell if the nodeset can be walked in doc order, via static analysis.
- *
- *
- * @return true if the nodeset can be walked in doc order, without sorting.
- */
- boolean canBeWalkedInNaturalDocOrderStatic()
- {
-
- if (null != m_firstWalker)
- {
- AxesWalker walker = m_firstWalker;
- int prevAxis = -1;
- boolean prevIsSimpleDownAxis = true;
-
- for(int i = 0; null != walker; i++)
- {
- int axis = walker.getAxis();
-
- if(walker.isDocOrdered())
- {
- boolean isSimpleDownAxis = ((axis == Axis.CHILD)
- || (axis == Axis.SELF)
- || (axis == Axis.ROOT));
- // Catching the filtered list here is only OK because
- // FilterExprWalker#isDocOrdered() did the right thing.
- if(isSimpleDownAxis || (axis == -1))
- walker = walker.getNextWalker();
- else
- {
- boolean isLastWalker = (null == walker.getNextWalker());
- if(isLastWalker)
- {
- if(walker.isDocOrdered() && (axis == Axis.DESCENDANT ||
- axis == Axis.DESCENDANTORSELF || axis == Axis.DESCENDANTSFROMROOT
- || axis == Axis.DESCENDANTSORSELFFROMROOT) || (axis == Axis.ATTRIBUTE))
- return true;
- }
- return false;
- }
- }
- else
- return false;
- }
- return true;
- }
- return false;
- }
-
-
-// /**
-// * NEEDSDOC Method canBeWalkedInNaturalDocOrder
-// *
-// *
-// * NEEDSDOC (canBeWalkedInNaturalDocOrder) @return
-// */
-// boolean canBeWalkedInNaturalDocOrder()
-// {
-//
-// if (null != m_firstWalker)
-// {
-// AxesWalker walker = m_firstWalker;
-// int prevAxis = -1;
-// boolean prevIsSimpleDownAxis = true;
-//
-// for(int i = 0; null != walker; i++)
-// {
-// int axis = walker.getAxis();
-//
-// if(walker.isDocOrdered())
-// {
-// boolean isSimpleDownAxis = ((axis == Axis.CHILD)
-// || (axis == Axis.SELF)
-// || (axis == Axis.ROOT));
-// // Catching the filtered list here is only OK because
-// // FilterExprWalker#isDocOrdered() did the right thing.
-// if(isSimpleDownAxis || (axis == -1))
-// walker = walker.getNextWalker();
-// else
-// {
-// boolean isLastWalker = (null == walker.getNextWalker());
-// if(isLastWalker)
-// {
-// if(walker.isDocOrdered() && (axis == Axis.DESCENDANT ||
-// axis == Axis.DESCENDANTORSELF || axis == Axis.DESCENDANTSFROMROOT
-// || axis == Axis.DESCENDANTSORSELFFROMROOT) || (axis == Axis.ATTRIBUTE))
-// return true;
-// }
-// return false;
-// }
-// }
-// else
-// return false;
-// }
-// return true;
-// }
-// return false;
-// }
-
- /**
- * This function is used to perform some extra analysis of the iterator.
- *
- * @param vars List of QNames that correspond to variables. This list
- * should be searched backwards for the first qualified name that
- * corresponds to the variable reference qname. The position of the
- * QName in the vector from the start of the vector will be its position
- * in the stack frame (but variables above the globalsTop value will need
- * to be offset to the current stack frame).
- */
- public void fixupVariables(java.util.Vector vars, int globalsSize)
- {
- super.fixupVariables(vars, globalsSize);
-
- int analysis = getAnalysisBits();
- if(WalkerFactory.isNaturalDocOrder(analysis))
- {
- m_inNaturalOrderStatic = true;
- }
- else
- {
- m_inNaturalOrderStatic = false;
- // System.out.println("Setting natural doc order to false: "+
- // WalkerFactory.getAnalysisString(analysis));
- }
-
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/axes/package.html b/src/com/sun/org/apache/xpath/internal/axes/package.html
deleted file mode 100644
index d37c7e2..0000000
--- a/src/com/sun/org/apache/xpath/internal/axes/package.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<!--
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
--->
-<!--
- * Copyright 2000-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
--->
-<!-- $Id: package.html,v 1.1.2.1 2005/08/01 01:30:22 jeffsuttor Exp $ -->
-<html>
- <title>XPath LocationPath support.</title>
- <body>
- <p>Implementation of XPath LocationPath support -- primary classes are
- LocPathIterator and UnionPathIterator.<p>
- </body>
-</html>
-
-
diff --git a/src/com/sun/org/apache/xpath/internal/compiler/Compiler.java b/src/com/sun/org/apache/xpath/internal/compiler/Compiler.java
deleted file mode 100644
index fd2fbae..0000000
--- a/src/com/sun/org/apache/xpath/internal/compiler/Compiler.java
+++ /dev/null
@@ -1,1270 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Compiler.java,v 1.2.4.1 2005/09/14 19:47:10 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.compiler;
-
-import javax.xml.transform.ErrorListener;
-import javax.xml.transform.SourceLocator;
-import javax.xml.transform.TransformerException;
-
-import com.sun.org.apache.xalan.internal.res.XSLMessages;
-import com.sun.org.apache.xml.internal.dtm.Axis;
-import com.sun.org.apache.xml.internal.dtm.DTMFilter;
-import com.sun.org.apache.xml.internal.dtm.DTMIterator;
-import com.sun.org.apache.xml.internal.utils.PrefixResolver;
-import com.sun.org.apache.xml.internal.utils.QName;
-import com.sun.org.apache.xml.internal.utils.SAXSourceLocator;
-import com.sun.org.apache.xpath.internal.Expression;
-import com.sun.org.apache.xpath.internal.axes.UnionPathIterator;
-import com.sun.org.apache.xpath.internal.axes.WalkerFactory;
-import com.sun.org.apache.xpath.internal.functions.FuncExtFunction;
-import com.sun.org.apache.xpath.internal.functions.FuncExtFunctionAvailable;
-import com.sun.org.apache.xpath.internal.functions.Function;
-import com.sun.org.apache.xpath.internal.functions.WrongNumberArgsException;
-import com.sun.org.apache.xpath.internal.objects.XNumber;
-import com.sun.org.apache.xpath.internal.objects.XString;
-import com.sun.org.apache.xpath.internal.operations.And;
-import com.sun.org.apache.xpath.internal.operations.Div;
-import com.sun.org.apache.xpath.internal.operations.Equals;
-import com.sun.org.apache.xpath.internal.operations.Gt;
-import com.sun.org.apache.xpath.internal.operations.Gte;
-import com.sun.org.apache.xpath.internal.operations.Lt;
-import com.sun.org.apache.xpath.internal.operations.Lte;
-import com.sun.org.apache.xpath.internal.operations.Minus;
-import com.sun.org.apache.xpath.internal.operations.Mod;
-import com.sun.org.apache.xpath.internal.operations.Mult;
-import com.sun.org.apache.xpath.internal.operations.Neg;
-import com.sun.org.apache.xpath.internal.operations.NotEquals;
-import com.sun.org.apache.xpath.internal.operations.Operation;
-import com.sun.org.apache.xpath.internal.operations.Or;
-import com.sun.org.apache.xpath.internal.operations.Plus;
-import com.sun.org.apache.xpath.internal.operations.UnaryOperation;
-import com.sun.org.apache.xpath.internal.operations.Variable;
-import com.sun.org.apache.xpath.internal.patterns.FunctionPattern;
-import com.sun.org.apache.xpath.internal.patterns.NodeTest;
-import com.sun.org.apache.xpath.internal.patterns.StepPattern;
-import com.sun.org.apache.xpath.internal.patterns.UnionPattern;
-import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
-
-/**
- * An instance of this class compiles an XPath string expression into
- * a Expression object. This class compiles the string into a sequence
- * of operation codes (op map) and then builds from that into an Expression
- * tree.
- * @xsl.usage advanced
- */
-public class Compiler extends OpMap
-{
-
- /**
- * Construct a Compiler object with a specific ErrorListener and
- * SourceLocator where the expression is located.
- *
- * @param errorHandler Error listener where messages will be sent, or null
- * if messages should be sent to System err.
- * @param locator The location object where the expression lives, which
- * may be null, but which, if not null, must be valid over
- * the long haul, in other words, it will not be cloned.
- * @param fTable The FunctionTable object where the xpath build-in
- * functions are stored.
- */
- public Compiler(ErrorListener errorHandler, SourceLocator locator,
- FunctionTable fTable)
- {
- m_errorHandler = errorHandler;
- m_locator = locator;
- m_functionTable = fTable;
- }
-
- /**
- * Construct a Compiler instance that has a null error listener and a
- * null source locator.
- */
- public Compiler()
- {
- m_errorHandler = null;
- m_locator = null;
- }
-
- /**
- * Execute the XPath object from a given opcode position.
- * @param opPos The current position in the xpath.m_opMap array.
- * @return The result of the XPath.
- *
- * @throws TransformerException if there is a syntax or other error.
- * @xsl.usage advanced
- */
- public Expression compile(int opPos) throws TransformerException
- {
-
- int op = getOp(opPos);
-
- Expression expr = null;
- // System.out.println(getPatternString()+"op: "+op);
- switch (op)
- {
- case OpCodes.OP_XPATH :
- expr = compile(opPos + 2); break;
- case OpCodes.OP_OR :
- expr = or(opPos); break;
- case OpCodes.OP_AND :
- expr = and(opPos); break;
- case OpCodes.OP_NOTEQUALS :
- expr = notequals(opPos); break;
- case OpCodes.OP_EQUALS :
- expr = equals(opPos); break;
- case OpCodes.OP_LTE :
- expr = lte(opPos); break;
- case OpCodes.OP_LT :
- expr = lt(opPos); break;
- case OpCodes.OP_GTE :
- expr = gte(opPos); break;
- case OpCodes.OP_GT :
- expr = gt(opPos); break;
- case OpCodes.OP_PLUS :
- expr = plus(opPos); break;
- case OpCodes.OP_MINUS :
- expr = minus(opPos); break;
- case OpCodes.OP_MULT :
- expr = mult(opPos); break;
- case OpCodes.OP_DIV :
- expr = div(opPos); break;
- case OpCodes.OP_MOD :
- expr = mod(opPos); break;
-// case OpCodes.OP_QUO :
-// expr = quo(opPos); break;
- case OpCodes.OP_NEG :
- expr = neg(opPos); break;
- case OpCodes.OP_STRING :
- expr = string(opPos); break;
- case OpCodes.OP_BOOL :
- expr = bool(opPos); break;
- case OpCodes.OP_NUMBER :
- expr = number(opPos); break;
- case OpCodes.OP_UNION :
- expr = union(opPos); break;
- case OpCodes.OP_LITERAL :
- expr = literal(opPos); break;
- case OpCodes.OP_VARIABLE :
- expr = variable(opPos); break;
- case OpCodes.OP_GROUP :
- expr = group(opPos); break;
- case OpCodes.OP_NUMBERLIT :
- expr = numberlit(opPos); break;
- case OpCodes.OP_ARGUMENT :
- expr = arg(opPos); break;
- case OpCodes.OP_EXTFUNCTION :
- expr = compileExtension(opPos); break;
- case OpCodes.OP_FUNCTION :
- expr = compileFunction(opPos); break;
- case OpCodes.OP_LOCATIONPATH :
- expr = locationPath(opPos); break;
- case OpCodes.OP_PREDICATE :
- expr = null; break; // should never hit this here.
- case OpCodes.OP_MATCHPATTERN :
- expr = matchPattern(opPos + 2); break;
- case OpCodes.OP_LOCATIONPATHPATTERN :
- expr = locationPathPattern(opPos); break;
- case OpCodes.OP_QUO:
- error(XPATHErrorResources.ER_UNKNOWN_OPCODE,
- new Object[]{ "quo" }); //"ERROR! Unknown op code: "+m_opMap[opPos]);
- break;
- default :
- error(XPATHErrorResources.ER_UNKNOWN_OPCODE,
- new Object[]{ Integer.toString(getOp(opPos)) }); //"ERROR! Unknown op code: "+m_opMap[opPos]);
- }
-// if(null != expr)
-// expr.setSourceLocator(m_locator);
-
- return expr;
- }
-
- /**
- * Bottle-neck compilation of an operation with left and right operands.
- *
- * @param operation non-null reference to parent operation.
- * @param opPos The op map position of the parent operation.
- *
- * @return reference to {@link com.sun.org.apache.xpath.internal.operations.Operation} instance.
- *
- * @throws TransformerException if there is a syntax or other error.
- */
- private Expression compileOperation(Operation operation, int opPos)
- throws TransformerException
- {
-
- int leftPos = getFirstChildPos(opPos);
- int rightPos = getNextOpPos(leftPos);
-
- operation.setLeftRight(compile(leftPos), compile(rightPos));
-
- return operation;
- }
-
- /**
- * Bottle-neck compilation of a unary operation.
- *
- * @param unary The parent unary operation.
- * @param opPos The position in the op map of the parent operation.
- *
- * @return The unary argument.
- *
- * @throws TransformerException if syntax or other error occurs.
- */
- private Expression compileUnary(UnaryOperation unary, int opPos)
- throws TransformerException
- {
-
- int rightPos = getFirstChildPos(opPos);
-
- unary.setRight(compile(rightPos));
-
- return unary;
- }
-
- /**
- * Compile an 'or' operation.
- *
- * @param opPos The current position in the m_opMap array.
- *
- * @return reference to {@link com.sun.org.apache.xpath.internal.operations.Or} instance.
- *
- * @throws TransformerException if a error occurs creating the Expression.
- */
- protected Expression or(int opPos) throws TransformerException
- {
- return compileOperation(new Or(), opPos);
- }
-
- /**
- * Compile an 'and' operation.
- *
- * @param opPos The current position in the m_opMap array.
- *
- * @return reference to {@link com.sun.org.apache.xpath.internal.operations.And} instance.
- *
- * @throws TransformerException if a error occurs creating the Expression.
- */
- protected Expression and(int opPos) throws TransformerException
- {
- return compileOperation(new And(), opPos);
- }
-
- /**
- * Compile a '!=' operation.
- *
- * @param opPos The current position in the m_opMap array.
- *
- * @return reference to {@link com.sun.org.apache.xpath.internal.operations.NotEquals} instance.
- *
- * @throws TransformerException if a error occurs creating the Expression.
- */
- protected Expression notequals(int opPos) throws TransformerException
- {
- return compileOperation(new NotEquals(), opPos);
- }
-
- /**
- * Compile a '=' operation.
- *
- * @param opPos The current position in the m_opMap array.
- *
- * @return reference to {@link com.sun.org.apache.xpath.internal.operations.Equals} instance.
- *
- * @throws TransformerException if a error occurs creating the Expression.
- */
- protected Expression equals(int opPos) throws TransformerException
- {
- return compileOperation(new Equals(), opPos);
- }
-
- /**
- * Compile a '<=' operation.
- *
- * @param opPos The current position in the m_opMap array.
- *
- * @return reference to {@link com.sun.org.apache.xpath.internal.operations.Lte} instance.
- *
- * @throws TransformerException if a error occurs creating the Expression.
- */
- protected Expression lte(int opPos) throws TransformerException
- {
- return compileOperation(new Lte(), opPos);
- }
-
- /**
- * Compile a '<' operation.
- *
- * @param opPos The current position in the m_opMap array.
- *
- * @return reference to {@link com.sun.org.apache.xpath.internal.operations.Lt} instance.
- *
- * @throws TransformerException if a error occurs creating the Expression.
- */
- protected Expression lt(int opPos) throws TransformerException
- {
- return compileOperation(new Lt(), opPos);
- }
-
- /**
- * Compile a '>=' operation.
- *
- * @param opPos The current position in the m_opMap array.
- *
- * @return reference to {@link com.sun.org.apache.xpath.internal.operations.Gte} instance.
- *
- * @throws TransformerException if a error occurs creating the Expression.
- */
- protected Expression gte(int opPos) throws TransformerException
- {
- return compileOperation(new Gte(), opPos);
- }
-
- /**
- * Compile a '>' operation.
- *
- * @param opPos The current position in the m_opMap array.
- *
- * @return reference to {@link com.sun.org.apache.xpath.internal.operations.Gt} instance.
- *
- * @throws TransformerException if a error occurs creating the Expression.
- */
- protected Expression gt(int opPos) throws TransformerException
- {
- return compileOperation(new Gt(), opPos);
- }
-
- /**
- * Compile a '+' operation.
- *
- * @param opPos The current position in the m_opMap array.
- *
- * @return reference to {@link com.sun.org.apache.xpath.internal.operations.Plus} instance.
- *
- * @throws TransformerException if a error occurs creating the Expression.
- */
- protected Expression plus(int opPos) throws TransformerException
- {
- return compileOperation(new Plus(), opPos);
- }
-
- /**
- * Compile a '-' operation.
- *
- * @param opPos The current position in the m_opMap array.
- *
- * @return reference to {@link com.sun.org.apache.xpath.internal.operations.Minus} instance.
- *
- * @throws TransformerException if a error occurs creating the Expression.
- */
- protected Expression minus(int opPos) throws TransformerException
- {
- return compileOperation(new Minus(), opPos);
- }
-
- /**
- * Compile a '*' operation.
- *
- * @param opPos The current position in the m_opMap array.
- *
- * @return reference to {@link com.sun.org.apache.xpath.internal.operations.Mult} instance.
- *
- * @throws TransformerException if a error occurs creating the Expression.
- */
- protected Expression mult(int opPos) throws TransformerException
- {
- return compileOperation(new Mult(), opPos);
- }
-
- /**
- * Compile a 'div' operation.
- *
- * @param opPos The current position in the m_opMap array.
- *
- * @return reference to {@link com.sun.org.apache.xpath.internal.operations.Div} instance.
- *
- * @throws TransformerException if a error occurs creating the Expression.
- */
- protected Expression div(int opPos) throws TransformerException
- {
- return compileOperation(new Div(), opPos);
- }
-
- /**
- * Compile a 'mod' operation.
- *
- * @param opPos The current position in the m_opMap array.
- *
- * @return reference to {@link com.sun.org.apache.xpath.internal.operations.Mod} instance.
- *
- * @throws TransformerException if a error occurs creating the Expression.
- */
- protected Expression mod(int opPos) throws TransformerException
- {
- return compileOperation(new Mod(), opPos);
- }
-
- /*
- * Compile a 'quo' operation.
- *
- * @param opPos The current position in the m_opMap array.
- *
- * @return reference to {@link com.sun.org.apache.xpath.internal.operations.Quo} instance.
- *
- * @throws TransformerException if a error occurs creating the Expression.
- */
-// protected Expression quo(int opPos) throws TransformerException
-// {
-// return compileOperation(new Quo(), opPos);
-// }
-
- /**
- * Compile a unary '-' operation.
- *
- * @param opPos The current position in the m_opMap array.
- *
- * @return reference to {@link com.sun.org.apache.xpath.internal.operations.Neg} instance.
- *
- * @throws TransformerException if a error occurs creating the Expression.
- */
- protected Expression neg(int opPos) throws TransformerException
- {
- return compileUnary(new Neg(), opPos);
- }
-
- /**
- * Compile a 'string(...)' operation.
- *
- * @param opPos The current position in the m_opMap array.
- *
- * @return reference to {@link com.sun.org.apache.xpath.internal.operations.String} instance.
- *
- * @throws TransformerException if a error occurs creating the Expression.
- */
- protected Expression string(int opPos) throws TransformerException
- {
- return compileUnary(new com.sun.org.apache.xpath.internal.operations.String(), opPos);
- }
-
- /**
- * Compile a 'boolean(...)' operation.
- *
- * @param opPos The current position in the m_opMap array.
- *
- * @return reference to {@link com.sun.org.apache.xpath.internal.operations.Bool} instance.
- *
- * @throws TransformerException if a error occurs creating the Expression.
- */
- protected Expression bool(int opPos) throws TransformerException
- {
- return compileUnary(new com.sun.org.apache.xpath.internal.operations.Bool(), opPos);
- }
-
- /**
- * Compile a 'number(...)' operation.
- *
- * @param opPos The current position in the m_opMap array.
- *
- * @return reference to {@link com.sun.org.apache.xpath.internal.operations.Number} instance.
- *
- * @throws TransformerException if a error occurs creating the Expression.
- */
- protected Expression number(int opPos) throws TransformerException
- {
- return compileUnary(new com.sun.org.apache.xpath.internal.operations.Number(), opPos);
- }
-
- /**
- * Compile a literal string value.
- *
- * @param opPos The current position in the m_opMap array.
- *
- * @return reference to {@link com.sun.org.apache.xpath.internal.objects.XString} instance.
- *
- * @throws TransformerException if a error occurs creating the Expression.
- */
- protected Expression literal(int opPos)
- {
-
- opPos = getFirstChildPos(opPos);
-
- return (XString) getTokenQueue().elementAt(getOp(opPos));
- }
-
- /**
- * Compile a literal number value.
- *
- * @param opPos The current position in the m_opMap array.
- *
- * @return reference to {@link com.sun.org.apache.xpath.internal.objects.XNumber} instance.
- *
- * @throws TransformerException if a error occurs creating the Expression.
- */
- protected Expression numberlit(int opPos)
- {
-
- opPos = getFirstChildPos(opPos);
-
- return (XNumber) getTokenQueue().elementAt(getOp(opPos));
- }
-
- /**
- * Compile a variable reference.
- *
- * @param opPos The current position in the m_opMap array.
- *
- * @return reference to {@link com.sun.org.apache.xpath.internal.operations.Variable} instance.
- *
- * @throws TransformerException if a error occurs creating the Expression.
- */
- protected Expression variable(int opPos) throws TransformerException
- {
-
- Variable var = new Variable();
-
- opPos = getFirstChildPos(opPos);
-
- int nsPos = getOp(opPos);
- java.lang.String namespace
- = (OpCodes.EMPTY == nsPos) ? null
- : (java.lang.String) getTokenQueue().elementAt(nsPos);
- java.lang.String localname
- = (java.lang.String) getTokenQueue().elementAt(getOp(opPos+1));
- QName qname = new QName(namespace, localname);
-
- var.setQName(qname);
-
- return var;
- }
-
- /**
- * Compile an expression group.
- *
- * @param opPos The current position in the m_opMap array.
- *
- * @return reference to the contained expression.
- *
- * @throws TransformerException if a error occurs creating the Expression.
- */
- protected Expression group(int opPos) throws TransformerException
- {
-
- // no-op
- return compile(opPos + 2);
- }
-
- /**
- * Compile a function argument.
- *
- * @param opPos The current position in the m_opMap array.
- *
- * @return reference to the argument expression.
- *
- * @throws TransformerException if a error occurs creating the Expression.
- */
- protected Expression arg(int opPos) throws TransformerException
- {
-
- // no-op
- return compile(opPos + 2);
- }
-
- /**
- * Compile a location path union. The UnionPathIterator itself may create
- * {@link com.sun.org.apache.xpath.internal.axes.LocPathIterator} children.
- *
- * @param opPos The current position in the m_opMap array.
- *
- * @return reference to {@link com.sun.org.apache.xpath.internal.axes.LocPathIterator} instance.
- *
- * @throws TransformerException if a error occurs creating the Expression.
- */
- protected Expression union(int opPos) throws TransformerException
- {
- locPathDepth++;
- try
- {
- return UnionPathIterator.createUnionIterator(this, opPos);
- }
- finally
- {
- locPathDepth--;
- }
- }
-
- private int locPathDepth = -1;
-
- /**
- * Get the level of the location path or union being constructed.
- * @return 0 if it is a top-level path.
- */
- public int getLocationPathDepth()
- {
- return locPathDepth;
- }
-
- /**
- * Get the function table
- */
- FunctionTable getFunctionTable()
- {
- return m_functionTable;
- }
-
- /**
- * Compile a location path. The LocPathIterator itself may create
- * {@link com.sun.org.apache.xpath.internal.axes.AxesWalker} children.
- *
- * @param opPos The current position in the m_opMap array.
- *
- * @return reference to {@link com.sun.org.apache.xpath.internal.axes.LocPathIterator} instance.
- *
- * @throws TransformerException if a error occurs creating the Expression.
- */
- public Expression locationPath(int opPos) throws TransformerException
- {
- locPathDepth++;
- try
- {
- DTMIterator iter = WalkerFactory.newDTMIterator(this, opPos, (locPathDepth == 0));
- return (Expression)iter; // cast OK, I guess.
- }
- finally
- {
- locPathDepth--;
- }
- }
-
- /**
- * Compile a location step predicate expression.
- *
- * @param opPos The current position in the m_opMap array.
- *
- * @return the contained predicate expression.
- *
- * @throws TransformerException if a error occurs creating the Expression.
- */
- public Expression predicate(int opPos) throws TransformerException
- {
- return compile(opPos + 2);
- }
-
- /**
- * Compile an entire match pattern expression.
- *
- * @param opPos The current position in the m_opMap array.
- *
- * @return reference to {@link com.sun.org.apache.xpath.internal.patterns.UnionPattern} instance.
- *
- * @throws TransformerException if a error occurs creating the Expression.
- */
- protected Expression matchPattern(int opPos) throws TransformerException
- {
- locPathDepth++;
- try
- {
- // First, count...
- int nextOpPos = opPos;
- int i;
-
- for (i = 0; getOp(nextOpPos) == OpCodes.OP_LOCATIONPATHPATTERN; i++)
- {
- nextOpPos = getNextOpPos(nextOpPos);
- }
-
- if (i == 1)
- return compile(opPos);
-
- UnionPattern up = new UnionPattern();
- StepPattern[] patterns = new StepPattern[i];
-
- for (i = 0; getOp(opPos) == OpCodes.OP_LOCATIONPATHPATTERN; i++)
- {
- nextOpPos = getNextOpPos(opPos);
- patterns[i] = (StepPattern) compile(opPos);
- opPos = nextOpPos;
- }
-
- up.setPatterns(patterns);
-
- return up;
- }
- finally
- {
- locPathDepth--;
- }
- }
-
- /**
- * Compile a location match pattern unit expression.
- *
- * @param opPos The current position in the m_opMap array.
- *
- * @return reference to {@link com.sun.org.apache.xpath.internal.patterns.StepPattern} instance.
- *
- * @throws TransformerException if a error occurs creating the Expression.
- */
- public Expression locationPathPattern(int opPos)
- throws TransformerException
- {
-
- opPos = getFirstChildPos(opPos);
-
- return stepPattern(opPos, 0, null);
- }
-
- /**
- * Get a {@link org.w3c.dom.traversal.NodeFilter} bit set that tells what
- * to show for a given node test.
- *
- * @param opPos the op map position for the location step.
- *
- * @return {@link org.w3c.dom.traversal.NodeFilter} bit set that tells what
- * to show for a given node test.
- */
- public int getWhatToShow(int opPos)
- {
-
- int axesType = getOp(opPos);
- int testType = getOp(opPos + 3);
-
- // System.out.println("testType: "+testType);
- switch (testType)
- {
- case OpCodes.NODETYPE_COMMENT :
- return DTMFilter.SHOW_COMMENT;
- case OpCodes.NODETYPE_TEXT :
-// return DTMFilter.SHOW_TEXT | DTMFilter.SHOW_COMMENT;
- return DTMFilter.SHOW_TEXT | DTMFilter.SHOW_CDATA_SECTION ;
- case OpCodes.NODETYPE_PI :
- return DTMFilter.SHOW_PROCESSING_INSTRUCTION;
- case OpCodes.NODETYPE_NODE :
-// return DTMFilter.SHOW_ALL;
- switch (axesType)
- {
- case OpCodes.FROM_NAMESPACE:
- return DTMFilter.SHOW_NAMESPACE;
- case OpCodes.FROM_ATTRIBUTES :
- case OpCodes.MATCH_ATTRIBUTE :
- return DTMFilter.SHOW_ATTRIBUTE;
- case OpCodes.FROM_SELF:
- case OpCodes.FROM_ANCESTORS_OR_SELF:
- case OpCodes.FROM_DESCENDANTS_OR_SELF:
- return DTMFilter.SHOW_ALL;
- default:
- if (getOp(0) == OpCodes.OP_MATCHPATTERN)
- return ~DTMFilter.SHOW_ATTRIBUTE
- & ~DTMFilter.SHOW_DOCUMENT
- & ~DTMFilter.SHOW_DOCUMENT_FRAGMENT;
- else
- return ~DTMFilter.SHOW_ATTRIBUTE;
- }
- case OpCodes.NODETYPE_ROOT :
- return DTMFilter.SHOW_DOCUMENT | DTMFilter.SHOW_DOCUMENT_FRAGMENT;
- case OpCodes.NODETYPE_FUNCTEST :
- return NodeTest.SHOW_BYFUNCTION;
- case OpCodes.NODENAME :
- switch (axesType)
- {
- case OpCodes.FROM_NAMESPACE :
- return DTMFilter.SHOW_NAMESPACE;
- case OpCodes.FROM_ATTRIBUTES :
- case OpCodes.MATCH_ATTRIBUTE :
- return DTMFilter.SHOW_ATTRIBUTE;
-
- // break;
- case OpCodes.MATCH_ANY_ANCESTOR :
- case OpCodes.MATCH_IMMEDIATE_ANCESTOR :
- return DTMFilter.SHOW_ELEMENT;
-
- // break;
- default :
- return DTMFilter.SHOW_ELEMENT;
- }
- default :
- // System.err.println("We should never reach here.");
- return DTMFilter.SHOW_ALL;
- }
- }
-
-private static final boolean DEBUG = false;
-
- /**
- * Compile a step pattern unit expression, used for both location paths
- * and match patterns.
- *
- * @param opPos The current position in the m_opMap array.
- * @param stepCount The number of steps to expect.
- * @param ancestorPattern The owning StepPattern, which may be null.
- *
- * @return reference to {@link com.sun.org.apache.xpath.internal.patterns.StepPattern} instance.
- *
- * @throws TransformerException if a error occurs creating the Expression.
- */
- protected StepPattern stepPattern(
- int opPos, int stepCount, StepPattern ancestorPattern)
- throws TransformerException
- {
-
- int startOpPos = opPos;
- int stepType = getOp(opPos);
-
- if (OpCodes.ENDOP == stepType)
- {
- return null;
- }
-
- boolean addMagicSelf = true;
-
- int endStep = getNextOpPos(opPos);
-
- // int nextStepType = getOpMap()[endStep];
- StepPattern pattern;
-
- // boolean isSimple = ((OpCodes.ENDOP == nextStepType) && (stepCount == 0));
- int argLen;
-
- switch (stepType)
- {
- case OpCodes.OP_FUNCTION :
- if(DEBUG)
- System.out.println("MATCH_FUNCTION: "+m_currentPattern);
- addMagicSelf = false;
- argLen = getOp(opPos + OpMap.MAPINDEX_LENGTH);
- pattern = new FunctionPattern(compileFunction(opPos), Axis.PARENT, Axis.CHILD);
- break;
- case OpCodes.FROM_ROOT :
- if(DEBUG)
- System.out.println("FROM_ROOT, "+m_currentPattern);
- addMagicSelf = false;
- argLen = getArgLengthOfStep(opPos);
- opPos = getFirstChildPosOfStep(opPos);
- pattern = new StepPattern(DTMFilter.SHOW_DOCUMENT |
- DTMFilter.SHOW_DOCUMENT_FRAGMENT,
- Axis.PARENT, Axis.CHILD);
- break;
- case OpCodes.MATCH_ATTRIBUTE :
- if(DEBUG)
- System.out.println("MATCH_ATTRIBUTE: "+getStepLocalName(startOpPos)+", "+m_currentPattern);
- argLen = getArgLengthOfStep(opPos);
- opPos = getFirstChildPosOfStep(opPos);
- pattern = new StepPattern(DTMFilter.SHOW_ATTRIBUTE,
- getStepNS(startOpPos),
- getStepLocalName(startOpPos),
- Axis.PARENT, Axis.ATTRIBUTE);
- break;
- case OpCodes.MATCH_ANY_ANCESTOR :
- if(DEBUG)
- System.out.println("MATCH_ANY_ANCESTOR: "+getStepLocalName(startOpPos)+", "+m_currentPattern);
- argLen = getArgLengthOfStep(opPos);
- opPos = getFirstChildPosOfStep(opPos);
- int what = getWhatToShow(startOpPos);
- // bit-o-hackery, but this code is due for the morgue anyway...
- if(0x00000500 == what)
- addMagicSelf = false;
- pattern = new StepPattern(getWhatToShow(startOpPos),
- getStepNS(startOpPos),
- getStepLocalName(startOpPos),
- Axis.ANCESTOR, Axis.CHILD);
- break;
- case OpCodes.MATCH_IMMEDIATE_ANCESTOR :
- if(DEBUG)
- System.out.println("MATCH_IMMEDIATE_ANCESTOR: "+getStepLocalName(startOpPos)+", "+m_currentPattern);
- argLen = getArgLengthOfStep(opPos);
- opPos = getFirstChildPosOfStep(opPos);
- pattern = new StepPattern(getWhatToShow(startOpPos),
- getStepNS(startOpPos),
- getStepLocalName(startOpPos),
- Axis.PARENT, Axis.CHILD);
- break;
- default :
- error(XPATHErrorResources.ER_UNKNOWN_MATCH_OPERATION, null); //"unknown match operation!");
-
- return null;
- }
-
- pattern.setPredicates(getCompiledPredicates(opPos + argLen));
- if(null == ancestorPattern)
- {
- // This is the magic and invisible "." at the head of every
- // match pattern, and corresponds to the current node in the context
- // list, from where predicates are counted.
- // So, in order to calculate "foo[3]", it has to count from the
- // current node in the context list, so, from that current node,
- // the full pattern is really "self::node()/child::foo[3]". If you
- // translate this to a select pattern from the node being tested,
- // which is really how we're treating match patterns, it works out to
- // self::foo/parent::node[child::foo[3]]", or close enough.
- /* if(addMagicSelf && pattern.getPredicateCount() > 0)
- {
- StepPattern selfPattern = new StepPattern(DTMFilter.SHOW_ALL,
- Axis.PARENT, Axis.CHILD);
- // We need to keep the new nodetest from affecting the score...
- XNumber score = pattern.getStaticScore();
- pattern.setRelativePathPattern(selfPattern);
- pattern.setStaticScore(score);
- selfPattern.setStaticScore(score);
- }*/
- }
- else
- {
- // System.out.println("Setting "+ancestorPattern+" as relative to "+pattern);
- pattern.setRelativePathPattern(ancestorPattern);
- }
-
- StepPattern relativePathPattern = stepPattern(endStep, stepCount + 1,
- pattern);
-
- return (null != relativePathPattern) ? relativePathPattern : pattern;
- }
-
- /**
- * Compile a zero or more predicates for a given match pattern.
- *
- * @param opPos The position of the first predicate the m_opMap array.
- *
- * @return reference to array of {@link com.sun.org.apache.xpath.internal.Expression} instances.
- *
- * @throws TransformerException if a error occurs creating the Expression.
- */
- public Expression[] getCompiledPredicates(int opPos)
- throws TransformerException
- {
-
- int count = countPredicates(opPos);
-
- if (count > 0)
- {
- Expression[] predicates = new Expression[count];
-
- compilePredicates(opPos, predicates);
-
- return predicates;
- }
-
- return null;
- }
-
- /**
- * Count the number of predicates in the step.
- *
- * @param opPos The position of the first predicate the m_opMap array.
- *
- * @return The number of predicates for this step.
- *
- * @throws TransformerException if a error occurs creating the Expression.
- */
- public int countPredicates(int opPos) throws TransformerException
- {
-
- int count = 0;
-
- while (OpCodes.OP_PREDICATE == getOp(opPos))
- {
- count++;
-
- opPos = getNextOpPos(opPos);
- }
-
- return count;
- }
-
- /**
- * Compiles predicates in the step.
- *
- * @param opPos The position of the first predicate the m_opMap array.
- * @param predicates An empty pre-determined array of
- * {@link com.sun.org.apache.xpath.internal.Expression}s, that will be filled in.
- *
- * @throws TransformerException
- */
- private void compilePredicates(int opPos, Expression[] predicates)
- throws TransformerException
- {
-
- for (int i = 0; OpCodes.OP_PREDICATE == getOp(opPos); i++)
- {
- predicates[i] = predicate(opPos);
- opPos = getNextOpPos(opPos);
- }
- }
-
- /**
- * Compile a built-in XPath function.
- *
- * @param opPos The current position in the m_opMap array.
- *
- * @return reference to {@link com.sun.org.apache.xpath.internal.functions.Function} instance.
- *
- * @throws TransformerException if a error occurs creating the Expression.
- */
- Expression compileFunction(int opPos) throws TransformerException
- {
-
- int endFunc = opPos + getOp(opPos + 1) - 1;
-
- opPos = getFirstChildPos(opPos);
-
- int funcID = getOp(opPos);
-
- opPos++;
-
- if (-1 != funcID)
- {
- Function func = m_functionTable.getFunction(funcID);
-
- /**
- * It is a trick for function-available. Since the function table is an
- * instance field, insert this table at compilation time for later usage
- */
-
- if (func instanceof FuncExtFunctionAvailable)
- ((FuncExtFunctionAvailable) func).setFunctionTable(m_functionTable);
-
- func.postCompileStep(this);
-
- try
- {
- int i = 0;
-
- for (int p = opPos; p < endFunc; p = getNextOpPos(p), i++)
- {
-
- // System.out.println("argPos: "+ p);
- // System.out.println("argCode: "+ m_opMap[p]);
- func.setArg(compile(p), i);
- }
-
- func.checkNumberArgs(i);
- }
- catch (WrongNumberArgsException wnae)
- {
- java.lang.String name = m_functionTable.getFunctionName(funcID);
-
- m_errorHandler.fatalError( new TransformerException(
- XSLMessages.createXPATHMessage(XPATHErrorResources.ER_ONLY_ALLOWS,
- new Object[]{name, wnae.getMessage()}), m_locator));
- //"name + " only allows " + wnae.getMessage() + " arguments", m_locator));
- }
-
- return func;
- }
- else
- {
- error(XPATHErrorResources.ER_FUNCTION_TOKEN_NOT_FOUND, null); //"function token not found.");
-
- return null;
- }
- }
-
- // The current id for extension functions.
- private static long s_nextMethodId = 0;
-
- /**
- * Get the next available method id
- */
- synchronized private long getNextMethodId()
- {
- if (s_nextMethodId == Long.MAX_VALUE)
- s_nextMethodId = 0;
-
- return s_nextMethodId++;
- }
-
- /**
- * Compile an extension function.
- *
- * @param opPos The current position in the m_opMap array.
- *
- * @return reference to {@link com.sun.org.apache.xpath.internal.functions.FuncExtFunction} instance.
- *
- * @throws TransformerException if a error occurs creating the Expression.
- */
- private Expression compileExtension(int opPos)
- throws TransformerException
- {
-
- int endExtFunc = opPos + getOp(opPos + 1) - 1;
-
- opPos = getFirstChildPos(opPos);
-
- java.lang.String ns = (java.lang.String) getTokenQueue().elementAt(getOp(opPos));
-
- opPos++;
-
- java.lang.String funcName =
- (java.lang.String) getTokenQueue().elementAt(getOp(opPos));
-
- opPos++;
-
- // We create a method key to uniquely identify this function so that we
- // can cache the object needed to invoke it. This way, we only pay the
- // reflection overhead on the first call.
-
- Function extension = new FuncExtFunction(ns, funcName, String.valueOf(getNextMethodId()));
-
- try
- {
- int i = 0;
-
- while (opPos < endExtFunc)
- {
- int nextOpPos = getNextOpPos(opPos);
-
- extension.setArg(this.compile(opPos), i);
-
- opPos = nextOpPos;
-
- i++;
- }
- }
- catch (WrongNumberArgsException wnae)
- {
- ; // should never happen
- }
-
- return extension;
- }
-
- /**
- * Warn the user of an problem.
- *
- * @param msg An error msgkey that corresponds to one of the constants found
- * in {@link com.sun.org.apache.xpath.internal.res.XPATHErrorResources}, which is
- * a key for a format string.
- * @param args An array of arguments represented in the format string, which
- * may be null.
- *
- * @throws TransformerException if the current ErrorListoner determines to
- * throw an exception.
- */
- public void warn(String msg, Object[] args) throws TransformerException
- {
-
- java.lang.String fmsg = XSLMessages.createXPATHWarning(msg, args);
-
- if (null != m_errorHandler)
- {
- m_errorHandler.warning(new TransformerException(fmsg, m_locator));
- }
- else
- {
- System.out.println(fmsg
- +"; file "+m_locator.getSystemId()
- +"; line "+m_locator.getLineNumber()
- +"; column "+m_locator.getColumnNumber());
- }
- }
-
- /**
- * Tell the user of an assertion error, and probably throw an
- * exception.
- *
- * @param b If false, a runtime exception will be thrown.
- * @param msg The assertion message, which should be informative.
- *
- * @throws RuntimeException if the b argument is false.
- */
- public void assertion(boolean b, java.lang.String msg)
- {
-
- if (!b)
- {
- java.lang.String fMsg = XSLMessages.createXPATHMessage(
- XPATHErrorResources.ER_INCORRECT_PROGRAMMER_ASSERTION,
- new Object[]{ msg });
-
- throw new RuntimeException(fMsg);
- }
- }
-
- /**
- * Tell the user of an error, and probably throw an
- * exception.
- *
- * @param msg An error msgkey that corresponds to one of the constants found
- * in {@link com.sun.org.apache.xpath.internal.res.XPATHErrorResources}, which is
- * a key for a format string.
- * @param args An array of arguments represented in the format string, which
- * may be null.
- *
- * @throws TransformerException if the current ErrorListoner determines to
- * throw an exception.
- */
- public void error(String msg, Object[] args) throws TransformerException
- {
-
- java.lang.String fmsg = XSLMessages.createXPATHMessage(msg, args);
-
-
- if (null != m_errorHandler)
- {
- m_errorHandler.fatalError(new TransformerException(fmsg, m_locator));
- }
- else
- {
-
- // System.out.println(te.getMessage()
- // +"; file "+te.getSystemId()
- // +"; line "+te.getLineNumber()
- // +"; column "+te.getColumnNumber());
- throw new TransformerException(fmsg, (SAXSourceLocator)m_locator);
- }
- }
-
- /**
- * The current prefixResolver for the execution context.
- */
- private PrefixResolver m_currentPrefixResolver = null;
-
- /**
- * Get the current namespace context for the xpath.
- *
- * @return The current prefix resolver, *may* be null, though hopefully not.
- */
- public PrefixResolver getNamespaceContext()
- {
- return m_currentPrefixResolver;
- }
-
- /**
- * Set the current namespace context for the xpath.
- *
- * @param pr The resolver for prefixes in the XPath expression.
- */
- public void setNamespaceContext(PrefixResolver pr)
- {
- m_currentPrefixResolver = pr;
- }
-
- /** The error listener where errors will be sent. If this is null, errors
- * and warnings will be sent to System.err. May be null. */
- ErrorListener m_errorHandler;
-
- /** The source locator for the expression being compiled. May be null. */
- SourceLocator m_locator;
-
- /**
- * The FunctionTable for all xpath build-in functions
- */
- private FunctionTable m_functionTable;
-}
diff --git a/src/com/sun/org/apache/xpath/internal/compiler/FuncLoader.java b/src/com/sun/org/apache/xpath/internal/compiler/FuncLoader.java
deleted file mode 100644
index 683472a..0000000
--- a/src/com/sun/org/apache/xpath/internal/compiler/FuncLoader.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FuncLoader.java,v 1.1.2.1 2005/08/01 01:30:35 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.compiler;
-
-import javax.xml.transform.TransformerException;
-
-import com.sun.org.apache.xpath.internal.functions.Function;
-import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
-import com.sun.org.apache.xalan.internal.utils.ConfigurationError;
-
-/**
- * Lazy load of functions into the function table as needed, so we don't
- * have to load all the functions allowed in XPath and XSLT on startup.
- * @xsl.usage advanced
- */
-public class FuncLoader
-{
-
- /** The function ID, which may correspond to one of the FUNC_XXX values
- * found in {@link com.sun.org.apache.xpath.internal.compiler.FunctionTable}, but may
- * be a value installed by an external module. */
- private int m_funcID;
-
- /** The class name of the function. Must not be null. */
- private String m_funcName;
-
- /**
- * Get the local class name of the function class. If function name does
- * not have a '.' in it, it is assumed to be relative to
- * 'com.sun.org.apache.xpath.internal.functions'.
- *
- * @return The class name of the {com.sun.org.apache.xpath.internal.functions.Function} class.
- */
- public String getName()
- {
- return m_funcName;
- }
-
- /**
- * Construct a function loader
- *
- * @param funcName The class name of the {com.sun.org.apache.xpath.internal.functions.Function}
- * class, which, if it does not have a '.' in it, is assumed to
- * be relative to 'com.sun.org.apache.xpath.internal.functions'.
- * @param funcID The function ID, which may correspond to one of the FUNC_XXX
- * values found in {@link com.sun.org.apache.xpath.internal.compiler.FunctionTable}, but may
- * be a value installed by an external module.
- */
- public FuncLoader(String funcName, int funcID)
- {
-
- super();
-
- m_funcID = funcID;
- m_funcName = funcName;
- }
-
- /**
- * Get a Function instance that this instance is liaisoning for.
- *
- * @return non-null reference to Function derivative.
- *
- * @throws javax.xml.transform.TransformerException if ClassNotFoundException,
- * IllegalAccessException, or InstantiationException is thrown.
- */
- Function getFunction() throws TransformerException
- {
- try
- {
- String className = m_funcName;
- if (className.indexOf(".") < 0) {
- className = "com.sun.org.apache.xpath.internal.functions." + className;
- }
- //hack for loading only built-in function classes.
- String subString = className.substring(0,className.lastIndexOf('.'));
- if(!(subString.equals ("com.sun.org.apache.xalan.internal.templates") ||
- subString.equals ("com.sun.org.apache.xpath.internal.functions"))) {
- throw new TransformerException("Application can't install his own xpath function.");
- }
-
- return (Function) ObjectFactory.newInstance(className, true);
-
- }
- catch (ConfigurationError e)
- {
- throw new TransformerException(e.getException());
- }
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/compiler/FunctionTable.java b/src/com/sun/org/apache/xpath/internal/compiler/FunctionTable.java
deleted file mode 100644
index 2b653ac..0000000
--- a/src/com/sun/org/apache/xpath/internal/compiler/FunctionTable.java
+++ /dev/null
@@ -1,410 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FunctionTable.java,v 1.3 2005/09/28 13:49:34 pvedula Exp $
- */
-package com.sun.org.apache.xpath.internal.compiler;
-
-import com.sun.org.apache.xpath.internal.Expression;
-import com.sun.org.apache.xpath.internal.functions.Function;
-import java.util.HashMap;
-import javax.xml.transform.TransformerException;
-
-/**
- * The function table for XPath.
- */
-public class FunctionTable
-{
-
- /** The 'current()' id. */
- public static final int FUNC_CURRENT = 0;
-
- /** The 'last()' id. */
- public static final int FUNC_LAST = 1;
-
- /** The 'position()' id. */
- public static final int FUNC_POSITION = 2;
-
- /** The 'count()' id. */
- public static final int FUNC_COUNT = 3;
-
- /** The 'id()' id. */
- public static final int FUNC_ID = 4;
-
- /** The 'key()' id (XSLT). */
- public static final int FUNC_KEY = 5;
-
- /** The 'local-name()' id. */
- public static final int FUNC_LOCAL_PART = 7;
-
- /** The 'namespace-uri()' id. */
- public static final int FUNC_NAMESPACE = 8;
-
- /** The 'name()' id. */
- public static final int FUNC_QNAME = 9;
-
- /** The 'generate-id()' id. */
- public static final int FUNC_GENERATE_ID = 10;
-
- /** The 'not()' id. */
- public static final int FUNC_NOT = 11;
-
- /** The 'true()' id. */
- public static final int FUNC_TRUE = 12;
-
- /** The 'false()' id. */
- public static final int FUNC_FALSE = 13;
-
- /** The 'boolean()' id. */
- public static final int FUNC_BOOLEAN = 14;
-
- /** The 'number()' id. */
- public static final int FUNC_NUMBER = 15;
-
- /** The 'floor()' id. */
- public static final int FUNC_FLOOR = 16;
-
- /** The 'ceiling()' id. */
- public static final int FUNC_CEILING = 17;
-
- /** The 'round()' id. */
- public static final int FUNC_ROUND = 18;
-
- /** The 'sum()' id. */
- public static final int FUNC_SUM = 19;
-
- /** The 'string()' id. */
- public static final int FUNC_STRING = 20;
-
- /** The 'starts-with()' id. */
- public static final int FUNC_STARTS_WITH = 21;
-
- /** The 'contains()' id. */
- public static final int FUNC_CONTAINS = 22;
-
- /** The 'substring-before()' id. */
- public static final int FUNC_SUBSTRING_BEFORE = 23;
-
- /** The 'substring-after()' id. */
- public static final int FUNC_SUBSTRING_AFTER = 24;
-
- /** The 'normalize-space()' id. */
- public static final int FUNC_NORMALIZE_SPACE = 25;
-
- /** The 'translate()' id. */
- public static final int FUNC_TRANSLATE = 26;
-
- /** The 'concat()' id. */
- public static final int FUNC_CONCAT = 27;
-
- /** The 'substring()' id. */
- public static final int FUNC_SUBSTRING = 29;
-
- /** The 'string-length()' id. */
- public static final int FUNC_STRING_LENGTH = 30;
-
- /** The 'system-property()' id. */
- public static final int FUNC_SYSTEM_PROPERTY = 31;
-
- /** The 'lang()' id. */
- public static final int FUNC_LANG = 32;
-
- /** The 'function-available()' id (XSLT). */
- public static final int FUNC_EXT_FUNCTION_AVAILABLE = 33;
-
- /** The 'element-available()' id (XSLT). */
- public static final int FUNC_EXT_ELEM_AVAILABLE = 34;
-
- /** The 'unparsed-entity-uri()' id (XSLT). */
- public static final int FUNC_UNPARSED_ENTITY_URI = 36;
-
- // Proprietary
-
- /** The 'document-location()' id (Proprietary). */
- public static final int FUNC_DOCLOCATION = 35;
-
- /**
- * The function table.
- */
- private static Class m_functions[];
-
- /** Table of function name to function ID associations. */
- private static HashMap m_functionID = new HashMap();
-
- /**
- * The function table contains customized functions
- */
- private Class m_functions_customer[] = new Class[NUM_ALLOWABLE_ADDINS];
-
- /**
- * Table of function name to function ID associations for customized functions
- */
- private HashMap m_functionID_customer = new HashMap();
-
- /**
- * Number of built in functions. Be sure to update this as
- * built-in functions are added.
- */
- private static final int NUM_BUILT_IN_FUNCS = 37;
-
- /**
- * Number of built-in functions that may be added.
- */
- private static final int NUM_ALLOWABLE_ADDINS = 30;
-
- /**
- * The index to the next free function index.
- */
- private int m_funcNextFreeIndex = NUM_BUILT_IN_FUNCS;
-
- static
- {
- m_functions = new Class[NUM_BUILT_IN_FUNCS];
- m_functions[FUNC_CURRENT] = com.sun.org.apache.xpath.internal.functions.FuncCurrent.class;
- m_functions[FUNC_LAST] = com.sun.org.apache.xpath.internal.functions.FuncLast.class;
- m_functions[FUNC_POSITION] = com.sun.org.apache.xpath.internal.functions.FuncPosition.class;
- m_functions[FUNC_COUNT] = com.sun.org.apache.xpath.internal.functions.FuncCount.class;
- m_functions[FUNC_ID] = com.sun.org.apache.xpath.internal.functions.FuncId.class;
- // J2SE does not support Xalan interpretive
- // m_functions[FUNC_KEY] =
- // com.sun.org.apache.xalan.internal.templates.FuncKey.class;
- m_functions[FUNC_LOCAL_PART] =
- com.sun.org.apache.xpath.internal.functions.FuncLocalPart.class;
- m_functions[FUNC_NAMESPACE] =
- com.sun.org.apache.xpath.internal.functions.FuncNamespace.class;
- m_functions[FUNC_QNAME] = com.sun.org.apache.xpath.internal.functions.FuncQname.class;
- m_functions[FUNC_GENERATE_ID] =
- com.sun.org.apache.xpath.internal.functions.FuncGenerateId.class;
- m_functions[FUNC_NOT] = com.sun.org.apache.xpath.internal.functions.FuncNot.class;
- m_functions[FUNC_TRUE] = com.sun.org.apache.xpath.internal.functions.FuncTrue.class;
- m_functions[FUNC_FALSE] = com.sun.org.apache.xpath.internal.functions.FuncFalse.class;
- m_functions[FUNC_BOOLEAN] = com.sun.org.apache.xpath.internal.functions.FuncBoolean.class;
- m_functions[FUNC_LANG] = com.sun.org.apache.xpath.internal.functions.FuncLang.class;
- m_functions[FUNC_NUMBER] = com.sun.org.apache.xpath.internal.functions.FuncNumber.class;
- m_functions[FUNC_FLOOR] = com.sun.org.apache.xpath.internal.functions.FuncFloor.class;
- m_functions[FUNC_CEILING] = com.sun.org.apache.xpath.internal.functions.FuncCeiling.class;
- m_functions[FUNC_ROUND] = com.sun.org.apache.xpath.internal.functions.FuncRound.class;
- m_functions[FUNC_SUM] = com.sun.org.apache.xpath.internal.functions.FuncSum.class;
- m_functions[FUNC_STRING] = com.sun.org.apache.xpath.internal.functions.FuncString.class;
- m_functions[FUNC_STARTS_WITH] =
- com.sun.org.apache.xpath.internal.functions.FuncStartsWith.class;
- m_functions[FUNC_CONTAINS] = com.sun.org.apache.xpath.internal.functions.FuncContains.class;
- m_functions[FUNC_SUBSTRING_BEFORE] =
- com.sun.org.apache.xpath.internal.functions.FuncSubstringBefore.class;
- m_functions[FUNC_SUBSTRING_AFTER] =
- com.sun.org.apache.xpath.internal.functions.FuncSubstringAfter.class;
- m_functions[FUNC_NORMALIZE_SPACE] =
- com.sun.org.apache.xpath.internal.functions.FuncNormalizeSpace.class;
- m_functions[FUNC_TRANSLATE] =
- com.sun.org.apache.xpath.internal.functions.FuncTranslate.class;
- m_functions[FUNC_CONCAT] = com.sun.org.apache.xpath.internal.functions.FuncConcat.class;
- m_functions[FUNC_SYSTEM_PROPERTY] =
- com.sun.org.apache.xpath.internal.functions.FuncSystemProperty.class;
- m_functions[FUNC_EXT_FUNCTION_AVAILABLE] =
- com.sun.org.apache.xpath.internal.functions.FuncExtFunctionAvailable.class;
- m_functions[FUNC_EXT_ELEM_AVAILABLE] =
- com.sun.org.apache.xpath.internal.functions.FuncExtElementAvailable.class;
- m_functions[FUNC_SUBSTRING] =
- com.sun.org.apache.xpath.internal.functions.FuncSubstring.class;
- m_functions[FUNC_STRING_LENGTH] =
- com.sun.org.apache.xpath.internal.functions.FuncStringLength.class;
- m_functions[FUNC_DOCLOCATION] =
- com.sun.org.apache.xpath.internal.functions.FuncDoclocation.class;
- m_functions[FUNC_UNPARSED_ENTITY_URI] =
- com.sun.org.apache.xpath.internal.functions.FuncUnparsedEntityURI.class;
- }
-
- static{
- m_functionID.put(Keywords.FUNC_CURRENT_STRING,
- new Integer(FunctionTable.FUNC_CURRENT));
- m_functionID.put(Keywords.FUNC_LAST_STRING,
- new Integer(FunctionTable.FUNC_LAST));
- m_functionID.put(Keywords.FUNC_POSITION_STRING,
- new Integer(FunctionTable.FUNC_POSITION));
- m_functionID.put(Keywords.FUNC_COUNT_STRING,
- new Integer(FunctionTable.FUNC_COUNT));
- m_functionID.put(Keywords.FUNC_ID_STRING,
- new Integer(FunctionTable.FUNC_ID));
- m_functionID.put(Keywords.FUNC_KEY_STRING,
- new Integer(FunctionTable.FUNC_KEY));
- m_functionID.put(Keywords.FUNC_LOCAL_PART_STRING,
- new Integer(FunctionTable.FUNC_LOCAL_PART));
- m_functionID.put(Keywords.FUNC_NAMESPACE_STRING,
- new Integer(FunctionTable.FUNC_NAMESPACE));
- m_functionID.put(Keywords.FUNC_NAME_STRING,
- new Integer(FunctionTable.FUNC_QNAME));
- m_functionID.put(Keywords.FUNC_GENERATE_ID_STRING,
- new Integer(FunctionTable.FUNC_GENERATE_ID));
- m_functionID.put(Keywords.FUNC_NOT_STRING,
- new Integer(FunctionTable.FUNC_NOT));
- m_functionID.put(Keywords.FUNC_TRUE_STRING,
- new Integer(FunctionTable.FUNC_TRUE));
- m_functionID.put(Keywords.FUNC_FALSE_STRING,
- new Integer(FunctionTable.FUNC_FALSE));
- m_functionID.put(Keywords.FUNC_BOOLEAN_STRING,
- new Integer(FunctionTable.FUNC_BOOLEAN));
- m_functionID.put(Keywords.FUNC_LANG_STRING,
- new Integer(FunctionTable.FUNC_LANG));
- m_functionID.put(Keywords.FUNC_NUMBER_STRING,
- new Integer(FunctionTable.FUNC_NUMBER));
- m_functionID.put(Keywords.FUNC_FLOOR_STRING,
- new Integer(FunctionTable.FUNC_FLOOR));
- m_functionID.put(Keywords.FUNC_CEILING_STRING,
- new Integer(FunctionTable.FUNC_CEILING));
- m_functionID.put(Keywords.FUNC_ROUND_STRING,
- new Integer(FunctionTable.FUNC_ROUND));
- m_functionID.put(Keywords.FUNC_SUM_STRING,
- new Integer(FunctionTable.FUNC_SUM));
- m_functionID.put(Keywords.FUNC_STRING_STRING,
- new Integer(FunctionTable.FUNC_STRING));
- m_functionID.put(Keywords.FUNC_STARTS_WITH_STRING,
- new Integer(FunctionTable.FUNC_STARTS_WITH));
- m_functionID.put(Keywords.FUNC_CONTAINS_STRING,
- new Integer(FunctionTable.FUNC_CONTAINS));
- m_functionID.put(Keywords.FUNC_SUBSTRING_BEFORE_STRING,
- new Integer(FunctionTable.FUNC_SUBSTRING_BEFORE));
- m_functionID.put(Keywords.FUNC_SUBSTRING_AFTER_STRING,
- new Integer(FunctionTable.FUNC_SUBSTRING_AFTER));
- m_functionID.put(Keywords.FUNC_NORMALIZE_SPACE_STRING,
- new Integer(FunctionTable.FUNC_NORMALIZE_SPACE));
- m_functionID.put(Keywords.FUNC_TRANSLATE_STRING,
- new Integer(FunctionTable.FUNC_TRANSLATE));
- m_functionID.put(Keywords.FUNC_CONCAT_STRING,
- new Integer(FunctionTable.FUNC_CONCAT));
- m_functionID.put(Keywords.FUNC_SYSTEM_PROPERTY_STRING,
- new Integer(FunctionTable.FUNC_SYSTEM_PROPERTY));
- m_functionID.put(Keywords.FUNC_EXT_FUNCTION_AVAILABLE_STRING,
- new Integer(FunctionTable.FUNC_EXT_FUNCTION_AVAILABLE));
- m_functionID.put(Keywords.FUNC_EXT_ELEM_AVAILABLE_STRING,
- new Integer(FunctionTable.FUNC_EXT_ELEM_AVAILABLE));
- m_functionID.put(Keywords.FUNC_SUBSTRING_STRING,
- new Integer(FunctionTable.FUNC_SUBSTRING));
- m_functionID.put(Keywords.FUNC_STRING_LENGTH_STRING,
- new Integer(FunctionTable.FUNC_STRING_LENGTH));
- m_functionID.put(Keywords.FUNC_UNPARSED_ENTITY_URI_STRING,
- new Integer(FunctionTable.FUNC_UNPARSED_ENTITY_URI));
- m_functionID.put(Keywords.FUNC_DOCLOCATION_STRING,
- new Integer(FunctionTable.FUNC_DOCLOCATION));
- }
-
- public FunctionTable(){
- }
-
- /**
- * Return the name of the a function in the static table. Needed to avoid
- * making the table publicly available.
- */
- String getFunctionName(int funcID) {
- if (funcID < NUM_BUILT_IN_FUNCS) return m_functions[funcID].getName();
- else return m_functions_customer[funcID - NUM_BUILT_IN_FUNCS].getName();
- }
-
- /**
- * Obtain a new Function object from a function ID.
- *
- * @param which The function ID, which may correspond to one of the FUNC_XXX
- * values found in {@link com.sun.org.apache.xpath.internal.compiler.FunctionTable}, but may
- * be a value installed by an external module.
- *
- * @return a a new Function instance.
- *
- * @throws javax.xml.transform.TransformerException if ClassNotFoundException,
- * IllegalAccessException, or InstantiationException is thrown.
- */
- Function getFunction(int which)
- throws javax.xml.transform.TransformerException
- {
- try{
- if (which < NUM_BUILT_IN_FUNCS)
- return (Function) m_functions[which].newInstance();
- else
- return (Function) m_functions_customer[
- which-NUM_BUILT_IN_FUNCS].newInstance();
- }catch (IllegalAccessException ex){
- throw new TransformerException(ex.getMessage());
- }catch (InstantiationException ex){
- throw new TransformerException(ex.getMessage());
- }
- }
-
- /**
- * Obtain a function ID from a given function name
- * @param key the function name in a java.lang.String format.
- * @return a function ID, which may correspond to one of the FUNC_XXX values
- * found in {@link com.sun.org.apache.xpath.internal.compiler.FunctionTable}, but may be a
- * value installed by an external module.
- */
- Object getFunctionID(String key){
- Object id = m_functionID_customer.get(key);
- if (null == id) id = m_functionID.get(key);
- return id;
- }
-
- /**
- * Install a built-in function.
- * @param name The unqualified name of the function, must not be null
- * @param func A Implementation of an XPath Function object.
- * @return the position of the function in the internal index.
- */
- public int installFunction(String name, Class func)
- {
-
- int funcIndex;
- Object funcIndexObj = getFunctionID(name);
-
- if (null != funcIndexObj)
- {
- funcIndex = ((Integer) funcIndexObj).intValue();
-
- if (funcIndex < NUM_BUILT_IN_FUNCS){
- funcIndex = m_funcNextFreeIndex++;
- m_functionID_customer.put(name, new Integer(funcIndex));
- }
- m_functions_customer[funcIndex - NUM_BUILT_IN_FUNCS] = func;
- }
- else
- {
- funcIndex = m_funcNextFreeIndex++;
-
- m_functions_customer[funcIndex-NUM_BUILT_IN_FUNCS] = func;
-
- m_functionID_customer.put(name,
- new Integer(funcIndex));
- }
- return funcIndex;
- }
-
- /**
- * Tell if a built-in, non-namespaced function is available.
- *
- * @param methName The local name of the function.
- *
- * @return True if the function can be executed.
- */
- public boolean functionAvailable(String methName)
- {
- Object tblEntry = m_functionID.get(methName);
- if (null != tblEntry) return true;
- else{
- tblEntry = m_functionID_customer.get(methName);
- return (null != tblEntry)? true : false;
- }
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/compiler/Keywords.java b/src/com/sun/org/apache/xpath/internal/compiler/Keywords.java
deleted file mode 100644
index b910b4d..0000000
--- a/src/com/sun/org/apache/xpath/internal/compiler/Keywords.java
+++ /dev/null
@@ -1,390 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Keywords.java,v 1.2.4.1 2005/09/14 19:46:01 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.compiler;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Table of strings to operation code lookups.
- *
- * @xsl.usage internal
- */
-public class Keywords {
-
- /**
- * Table of keywords to opcode associations.
- */
- private static final Map<String, Integer> m_keywords;
-
- /**
- * Table of axes names to opcode associations.
- */
- private static final Map<String, Integer> m_axisnames;
-
- /**
- * Table of function name to function ID associations.
- */
- private static final Map<String, Integer> m_nodetests;
-
- /**
- * Table of node type strings to opcode associations.
- */
- private static final Map<String, Integer> m_nodetypes;
-
- /**
- * ancestor axes string.
- */
- private static final String FROM_ANCESTORS_STRING = "ancestor";
-
- /**
- * ancestor-or-self axes string.
- */
- private static final String FROM_ANCESTORS_OR_SELF_STRING
- = "ancestor-or-self";
-
- /**
- * attribute axes string.
- */
- private static final String FROM_ATTRIBUTES_STRING = "attribute";
-
- /**
- * child axes string.
- */
- private static final String FROM_CHILDREN_STRING = "child";
-
- /**
- * descendant-or-self axes string.
- */
- private static final String FROM_DESCENDANTS_STRING = "descendant";
-
- /**
- * ancestor axes string.
- */
- private static final String FROM_DESCENDANTS_OR_SELF_STRING
- = "descendant-or-self";
-
- /**
- * following axes string.
- */
- private static final String FROM_FOLLOWING_STRING = "following";
-
- /**
- * following-sibling axes string.
- */
- private static final String FROM_FOLLOWING_SIBLINGS_STRING
- = "following-sibling";
-
- /**
- * parent axes string.
- */
- private static final String FROM_PARENT_STRING = "parent";
-
- /**
- * preceding axes string.
- */
- private static final String FROM_PRECEDING_STRING = "preceding";
-
- /**
- * preceding-sibling axes string.
- */
- private static final String FROM_PRECEDING_SIBLINGS_STRING
- = "preceding-sibling";
-
- /**
- * self axes string.
- */
- private static final String FROM_SELF_STRING = "self";
-
- /**
- * namespace axes string.
- */
- private static final String FROM_NAMESPACE_STRING = "namespace";
-
- /**
- * self axes abreviated string.
- */
- private static final String FROM_SELF_ABBREVIATED_STRING = ".";
-
- /**
- * comment node test string.
- */
- private static final String NODETYPE_COMMENT_STRING = "comment";
-
- /**
- * text node test string.
- */
- private static final String NODETYPE_TEXT_STRING = "text";
-
- /**
- * processing-instruction node test string.
- */
- private static final String NODETYPE_PI_STRING = "processing-instruction";
-
- /**
- * Any node test string.
- */
- private static final String NODETYPE_NODE_STRING = "node";
-
- /**
- * Wildcard element string.
- */
- private static final String NODETYPE_ANYELEMENT_STRING = "*";
-
- /**
- * current function string.
- */
- public static final String FUNC_CURRENT_STRING = "current";
-
- /**
- * last function string.
- */
- public static final String FUNC_LAST_STRING = "last";
-
- /**
- * position function string.
- */
- public static final String FUNC_POSITION_STRING = "position";
-
- /**
- * count function string.
- */
- public static final String FUNC_COUNT_STRING = "count";
-
- /**
- * id function string.
- */
- static final String FUNC_ID_STRING = "id";
-
- /**
- * key function string (XSLT).
- */
- public static final String FUNC_KEY_STRING = "key";
-
- /**
- * local-name function string.
- */
- public static final String FUNC_LOCAL_PART_STRING = "local-name";
-
- /**
- * namespace-uri function string.
- */
- public static final String FUNC_NAMESPACE_STRING = "namespace-uri";
-
- /**
- * name function string.
- */
- public static final String FUNC_NAME_STRING = "name";
-
- /**
- * generate-id function string (XSLT).
- */
- public static final String FUNC_GENERATE_ID_STRING = "generate-id";
-
- /**
- * not function string.
- */
- public static final String FUNC_NOT_STRING = "not";
-
- /**
- * true function string.
- */
- public static final String FUNC_TRUE_STRING = "true";
-
- /**
- * false function string.
- */
- public static final String FUNC_FALSE_STRING = "false";
-
- /**
- * boolean function string.
- */
- public static final String FUNC_BOOLEAN_STRING = "boolean";
-
- /**
- * lang function string.
- */
- public static final String FUNC_LANG_STRING = "lang";
-
- /**
- * number function string.
- */
- public static final String FUNC_NUMBER_STRING = "number";
-
- /**
- * floor function string.
- */
- public static final String FUNC_FLOOR_STRING = "floor";
-
- /**
- * ceiling function string.
- */
- public static final String FUNC_CEILING_STRING = "ceiling";
-
- /**
- * round function string.
- */
- public static final String FUNC_ROUND_STRING = "round";
-
- /**
- * sum function string.
- */
- public static final String FUNC_SUM_STRING = "sum";
-
- /**
- * string function string.
- */
- public static final String FUNC_STRING_STRING = "string";
-
- /**
- * starts-with function string.
- */
- public static final String FUNC_STARTS_WITH_STRING = "starts-with";
-
- /**
- * contains function string.
- */
- public static final String FUNC_CONTAINS_STRING = "contains";
-
- /**
- * substring-before function string.
- */
- public static final String FUNC_SUBSTRING_BEFORE_STRING
- = "substring-before";
-
- /**
- * substring-after function string.
- */
- public static final String FUNC_SUBSTRING_AFTER_STRING = "substring-after";
-
- /**
- * normalize-space function string.
- */
- public static final String FUNC_NORMALIZE_SPACE_STRING = "normalize-space";
-
- /**
- * translate function string.
- */
- public static final String FUNC_TRANSLATE_STRING = "translate";
-
- /**
- * concat function string.
- */
- public static final String FUNC_CONCAT_STRING = "concat";
-
- /**
- * system-property function string.
- */
- public static final String FUNC_SYSTEM_PROPERTY_STRING = "system-property";
-
- /**
- * function-available function string (XSLT).
- */
- public static final String FUNC_EXT_FUNCTION_AVAILABLE_STRING
- = "function-available";
-
- /**
- * element-available function string (XSLT).
- */
- public static final String FUNC_EXT_ELEM_AVAILABLE_STRING
- = "element-available";
-
- /**
- * substring function string.
- */
- public static final String FUNC_SUBSTRING_STRING = "substring";
-
- /**
- * string-length function string.
- */
- public static final String FUNC_STRING_LENGTH_STRING = "string-length";
-
- /**
- * unparsed-entity-uri function string (XSLT).
- */
- public static final String FUNC_UNPARSED_ENTITY_URI_STRING
- = "unparsed-entity-uri";
-
- // Proprietary, built in functions
- /**
- * current function string (Proprietary).
- */
- public static final String FUNC_DOCLOCATION_STRING = "document-location";
-
- static {
- Map<String, Integer> keywords = new HashMap<>();
- Map<String, Integer> axisnames = new HashMap<>();
- Map<String, Integer> nodetests = new HashMap<>();
- Map<String, Integer> nodetypes = new HashMap<>();
-
- axisnames.put(FROM_ANCESTORS_STRING, OpCodes.FROM_ANCESTORS);
- axisnames.put(FROM_ANCESTORS_OR_SELF_STRING, OpCodes.FROM_ANCESTORS_OR_SELF);
- axisnames.put(FROM_ATTRIBUTES_STRING, OpCodes.FROM_ATTRIBUTES);
- axisnames.put(FROM_CHILDREN_STRING, OpCodes.FROM_CHILDREN);
- axisnames.put(FROM_DESCENDANTS_STRING, OpCodes.FROM_DESCENDANTS);
- axisnames.put(FROM_DESCENDANTS_OR_SELF_STRING, OpCodes.FROM_DESCENDANTS_OR_SELF);
- axisnames.put(FROM_FOLLOWING_STRING, OpCodes.FROM_FOLLOWING);
- axisnames.put(FROM_FOLLOWING_SIBLINGS_STRING, OpCodes.FROM_FOLLOWING_SIBLINGS);
- axisnames.put(FROM_PARENT_STRING, OpCodes.FROM_PARENT);
- axisnames.put(FROM_PRECEDING_STRING, OpCodes.FROM_PRECEDING);
- axisnames.put(FROM_PRECEDING_SIBLINGS_STRING, OpCodes.FROM_PRECEDING_SIBLINGS);
- axisnames.put(FROM_SELF_STRING, OpCodes.FROM_SELF);
- axisnames.put(FROM_NAMESPACE_STRING, OpCodes.FROM_NAMESPACE);
- m_axisnames = Collections.unmodifiableMap(axisnames);
-
- nodetypes.put(NODETYPE_COMMENT_STRING, OpCodes.NODETYPE_COMMENT);
- nodetypes.put(NODETYPE_TEXT_STRING, OpCodes.NODETYPE_TEXT);
- nodetypes.put(NODETYPE_PI_STRING, OpCodes.NODETYPE_PI);
- nodetypes.put(NODETYPE_NODE_STRING, OpCodes.NODETYPE_NODE);
- nodetypes.put(NODETYPE_ANYELEMENT_STRING, OpCodes.NODETYPE_ANYELEMENT);
- m_nodetypes = Collections.unmodifiableMap(nodetypes);
-
- keywords.put(FROM_SELF_ABBREVIATED_STRING, OpCodes.FROM_SELF);
- keywords.put(FUNC_ID_STRING, FunctionTable.FUNC_ID);
- keywords.put(FUNC_KEY_STRING, FunctionTable.FUNC_KEY);
- m_keywords = Collections.unmodifiableMap(keywords);
-
- nodetests.put(NODETYPE_COMMENT_STRING, OpCodes.NODETYPE_COMMENT);
- nodetests.put(NODETYPE_TEXT_STRING, OpCodes.NODETYPE_TEXT);
- nodetests.put(NODETYPE_PI_STRING, OpCodes.NODETYPE_PI);
- nodetests.put(NODETYPE_NODE_STRING, OpCodes.NODETYPE_NODE);
- m_nodetests = Collections.unmodifiableMap(nodetests);
- }
-
- static Integer getAxisName(String key) {
- return m_axisnames.get(key);
- }
-
- static Integer lookupNodeTest(String key) {
- return m_nodetests.get(key);
- }
-
- static Integer getKeyWord(String key) {
- return m_keywords.get(key);
- }
-
- static Integer getNodeType(String key) {
- return m_nodetypes.get(key);
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/compiler/Lexer.java b/src/com/sun/org/apache/xpath/internal/compiler/Lexer.java
deleted file mode 100644
index 5af6f18..0000000
--- a/src/com/sun/org/apache/xpath/internal/compiler/Lexer.java
+++ /dev/null
@@ -1,664 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Lexer.java,v 1.2.4.1 2005/09/10 03:55:45 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.compiler;
-
-import java.util.Vector;
-
-import com.sun.org.apache.xml.internal.utils.PrefixResolver;
-import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
-
-/**
- * This class is in charge of lexical processing of the XPath
- * expression into tokens.
- */
-class Lexer
-{
-
- /**
- * The target XPath.
- */
- private Compiler m_compiler;
-
- /**
- * The prefix resolver to map prefixes to namespaces in the XPath.
- */
- PrefixResolver m_namespaceContext;
-
- /**
- * The XPath processor object.
- */
- XPathParser m_processor;
-
- /**
- * This value is added to each element name in the TARGETEXTRA
- * that is a 'target' (right-most top-level element name).
- */
- static final int TARGETEXTRA = 10000;
-
- /**
- * Ignore this, it is going away.
- * This holds a map to the m_tokenQueue that tells where the top-level elements are.
- * It is used for pattern matching so the m_tokenQueue can be walked backwards.
- * Each element that is a 'target', (right-most top level element name) has
- * TARGETEXTRA added to it.
- *
- */
- private int m_patternMap[] = new int[100];
-
- /**
- * Ignore this, it is going away.
- * The number of elements that m_patternMap maps;
- */
- private int m_patternMapSize;
-
- /**
- * Create a Lexer object.
- *
- * @param compiler The owning compiler for this lexer.
- * @param resolver The prefix resolver for mapping qualified name prefixes
- * to namespace URIs.
- * @param xpathProcessor The parser that is processing strings to opcodes.
- */
- Lexer(Compiler compiler, PrefixResolver resolver,
- XPathParser xpathProcessor)
- {
-
- m_compiler = compiler;
- m_namespaceContext = resolver;
- m_processor = xpathProcessor;
- }
-
- /**
- * Walk through the expression and build a token queue, and a map of the top-level
- * elements.
- * @param pat XSLT Expression.
- *
- * @throws javax.xml.transform.TransformerException
- */
- void tokenize(String pat) throws javax.xml.transform.TransformerException
- {
- tokenize(pat, null);
- }
-
- /**
- * Walk through the expression and build a token queue, and a map of the top-level
- * elements.
- * @param pat XSLT Expression.
- * @param targetStrings Vector to hold Strings, may be null.
- *
- * @throws javax.xml.transform.TransformerException
- */
- void tokenize(String pat, Vector targetStrings)
- throws javax.xml.transform.TransformerException
- {
-
- m_compiler.m_currentPattern = pat;
- m_patternMapSize = 0;
-
- // This needs to grow too.
- m_compiler.m_opMap = new OpMapVector(OpMap.MAXTOKENQUEUESIZE * 5, OpMap.BLOCKTOKENQUEUESIZE * 5, OpMap.MAPINDEX_LENGTH);
-
- int nChars = pat.length();
- int startSubstring = -1;
- int posOfNSSep = -1;
- boolean isStartOfPat = true;
- boolean isAttrName = false;
- boolean isNum = false;
-
- // Nesting of '[' so we can know if the given element should be
- // counted inside the m_patternMap.
- int nesting = 0;
-
- // char[] chars = pat.toCharArray();
- for (int i = 0; i < nChars; i++)
- {
- char c = pat.charAt(i);
-
- switch (c)
- {
- case '\"' :
- {
- if (startSubstring != -1)
- {
- isNum = false;
- isStartOfPat = mapPatternElemPos(nesting, isStartOfPat, isAttrName);
- isAttrName = false;
-
- if (-1 != posOfNSSep)
- {
- posOfNSSep = mapNSTokens(pat, startSubstring, posOfNSSep, i);
- }
- else
- {
- addToTokenQueue(pat.substring(startSubstring, i));
- }
- }
-
- startSubstring = i;
-
- for (i++; (i < nChars) && ((c = pat.charAt(i)) != '\"'); i++);
-
- if (c == '\"' && i < nChars)
- {
- addToTokenQueue(pat.substring(startSubstring, i + 1));
-
- startSubstring = -1;
- }
- else
- {
- m_processor.error(XPATHErrorResources.ER_EXPECTED_DOUBLE_QUOTE,
- null); //"misquoted literal... expected double quote!");
- }
- }
- break;
- case '\'' :
- if (startSubstring != -1)
- {
- isNum = false;
- isStartOfPat = mapPatternElemPos(nesting, isStartOfPat, isAttrName);
- isAttrName = false;
-
- if (-1 != posOfNSSep)
- {
- posOfNSSep = mapNSTokens(pat, startSubstring, posOfNSSep, i);
- }
- else
- {
- addToTokenQueue(pat.substring(startSubstring, i));
- }
- }
-
- startSubstring = i;
-
- for (i++; (i < nChars) && ((c = pat.charAt(i)) != '\''); i++);
-
- if (c == '\'' && i < nChars)
- {
- addToTokenQueue(pat.substring(startSubstring, i + 1));
-
- startSubstring = -1;
- }
- else
- {
- m_processor.error(XPATHErrorResources.ER_EXPECTED_SINGLE_QUOTE,
- null); //"misquoted literal... expected single quote!");
- }
- break;
- case 0x0A :
- case 0x0D :
- case ' ' :
- case '\t' :
- if (startSubstring != -1)
- {
- isNum = false;
- isStartOfPat = mapPatternElemPos(nesting, isStartOfPat, isAttrName);
- isAttrName = false;
-
- if (-1 != posOfNSSep)
- {
- posOfNSSep = mapNSTokens(pat, startSubstring, posOfNSSep, i);
- }
- else
- {
- addToTokenQueue(pat.substring(startSubstring, i));
- }
-
- startSubstring = -1;
- }
- break;
- case '@' :
- isAttrName = true;
-
- // fall-through on purpose
- case '-' :
- if ('-' == c)
- {
- if (!(isNum || (startSubstring == -1)))
- {
- break;
- }
-
- isNum = false;
- }
-
- // fall-through on purpose
- case '(' :
- case '[' :
- case ')' :
- case ']' :
- case '|' :
- case '/' :
- case '*' :
- case '+' :
- case '=' :
- case ',' :
- case '\\' : // Unused at the moment
- case '^' : // Unused at the moment
- case '!' : // Unused at the moment
- case '$' :
- case '<' :
- case '>' :
- if (startSubstring != -1)
- {
- isNum = false;
- isStartOfPat = mapPatternElemPos(nesting, isStartOfPat, isAttrName);
- isAttrName = false;
-
- if (-1 != posOfNSSep)
- {
- posOfNSSep = mapNSTokens(pat, startSubstring, posOfNSSep, i);
- }
- else
- {
- addToTokenQueue(pat.substring(startSubstring, i));
- }
-
- startSubstring = -1;
- }
- else if (('/' == c) && isStartOfPat)
- {
- isStartOfPat = mapPatternElemPos(nesting, isStartOfPat, isAttrName);
- }
- else if ('*' == c)
- {
- isStartOfPat = mapPatternElemPos(nesting, isStartOfPat, isAttrName);
- isAttrName = false;
- }
-
- if (0 == nesting)
- {
- if ('|' == c)
- {
- if (null != targetStrings)
- {
- recordTokenString(targetStrings);
- }
-
- isStartOfPat = true;
- }
- }
-
- if ((')' == c) || (']' == c))
- {
- nesting--;
- }
- else if (('(' == c) || ('[' == c))
- {
- nesting++;
- }
-
- addToTokenQueue(pat.substring(i, i + 1));
- break;
- case ':' :
- if (i>0)
- {
- if (posOfNSSep == (i - 1))
- {
- if (startSubstring != -1)
- {
- if (startSubstring < (i - 1))
- addToTokenQueue(pat.substring(startSubstring, i - 1));
- }
-
- isNum = false;
- isAttrName = false;
- startSubstring = -1;
- posOfNSSep = -1;
-
- addToTokenQueue(pat.substring(i - 1, i + 1));
-
- break;
- }
- else
- {
- posOfNSSep = i;
- }
- }
-
- // fall through on purpose
- default :
- if (-1 == startSubstring)
- {
- startSubstring = i;
- isNum = Character.isDigit(c);
- }
- else if (isNum)
- {
- isNum = Character.isDigit(c);
- }
- }
- }
-
- if (startSubstring != -1)
- {
- isNum = false;
- isStartOfPat = mapPatternElemPos(nesting, isStartOfPat, isAttrName);
-
- if ((-1 != posOfNSSep) ||
- ((m_namespaceContext != null) && (m_namespaceContext.handlesNullPrefixes())))
- {
- posOfNSSep = mapNSTokens(pat, startSubstring, posOfNSSep, nChars);
- }
- else
- {
- addToTokenQueue(pat.substring(startSubstring, nChars));
- }
- }
-
- if (0 == m_compiler.getTokenQueueSize())
- {
- m_processor.error(XPATHErrorResources.ER_EMPTY_EXPRESSION, null); //"Empty expression!");
- }
- else if (null != targetStrings)
- {
- recordTokenString(targetStrings);
- }
-
- m_processor.m_queueMark = 0;
- }
-
- /**
- * Record the current position on the token queue as long as
- * this is a top-level element. Must be called before the
- * next token is added to the m_tokenQueue.
- *
- * @param nesting The nesting count for the pattern element.
- * @param isStart true if this is the start of a pattern.
- * @param isAttrName true if we have determined that this is an attribute name.
- *
- * @return true if this is the start of a pattern.
- */
- private boolean mapPatternElemPos(int nesting, boolean isStart,
- boolean isAttrName)
- {
-
- if (0 == nesting)
- {
- if(m_patternMapSize >= m_patternMap.length)
- {
- int patternMap[] = m_patternMap;
- int len = m_patternMap.length;
- m_patternMap = new int[m_patternMapSize + 100];
- System.arraycopy(patternMap, 0, m_patternMap, 0, len);
- }
- if (!isStart)
- {
- m_patternMap[m_patternMapSize - 1] -= TARGETEXTRA;
- }
- m_patternMap[m_patternMapSize] =
- (m_compiler.getTokenQueueSize() - (isAttrName ? 1 : 0)) + TARGETEXTRA;
-
- m_patternMapSize++;
-
- isStart = false;
- }
-
- return isStart;
- }
-
- /**
- * Given a map pos, return the corresponding token queue pos.
- *
- * @param i The index in the m_patternMap.
- *
- * @return the token queue position.
- */
- private int getTokenQueuePosFromMap(int i)
- {
-
- int pos = m_patternMap[i];
-
- return (pos >= TARGETEXTRA) ? (pos - TARGETEXTRA) : pos;
- }
-
- /**
- * Reset token queue mark and m_token to a
- * given position.
- * @param mark The new position.
- */
- private final void resetTokenMark(int mark)
- {
-
- int qsz = m_compiler.getTokenQueueSize();
-
- m_processor.m_queueMark = (mark > 0)
- ? ((mark <= qsz) ? mark - 1 : mark) : 0;
-
- if (m_processor.m_queueMark < qsz)
- {
- m_processor.m_token =
- (String) m_compiler.getTokenQueue().elementAt(m_processor.m_queueMark++);
- m_processor.m_tokenChar = m_processor.m_token.charAt(0);
- }
- else
- {
- m_processor.m_token = null;
- m_processor.m_tokenChar = 0;
- }
- }
-
- /**
- * Given a string, return the corresponding keyword token.
- *
- * @param key The keyword.
- *
- * @return An opcode value.
- */
- final int getKeywordToken(String key)
- {
-
- int tok;
-
- try
- {
- Integer itok = (Integer) Keywords.getKeyWord(key);
-
- tok = (null != itok) ? itok.intValue() : 0;
- }
- catch (NullPointerException npe)
- {
- tok = 0;
- }
- catch (ClassCastException cce)
- {
- tok = 0;
- }
-
- return tok;
- }
-
- /**
- * Record the current token in the passed vector.
- *
- * @param targetStrings Vector of string.
- */
- private void recordTokenString(Vector targetStrings)
- {
-
- int tokPos = getTokenQueuePosFromMap(m_patternMapSize - 1);
-
- resetTokenMark(tokPos + 1);
-
- if (m_processor.lookahead('(', 1))
- {
- int tok = getKeywordToken(m_processor.m_token);
-
- switch (tok)
- {
- case OpCodes.NODETYPE_COMMENT :
- targetStrings.addElement(PsuedoNames.PSEUDONAME_COMMENT);
- break;
- case OpCodes.NODETYPE_TEXT :
- targetStrings.addElement(PsuedoNames.PSEUDONAME_TEXT);
- break;
- case OpCodes.NODETYPE_NODE :
- targetStrings.addElement(PsuedoNames.PSEUDONAME_ANY);
- break;
- case OpCodes.NODETYPE_ROOT :
- targetStrings.addElement(PsuedoNames.PSEUDONAME_ROOT);
- break;
- case OpCodes.NODETYPE_ANYELEMENT :
- targetStrings.addElement(PsuedoNames.PSEUDONAME_ANY);
- break;
- case OpCodes.NODETYPE_PI :
- targetStrings.addElement(PsuedoNames.PSEUDONAME_ANY);
- break;
- default :
- targetStrings.addElement(PsuedoNames.PSEUDONAME_ANY);
- }
- }
- else
- {
- if (m_processor.tokenIs('@'))
- {
- tokPos++;
-
- resetTokenMark(tokPos + 1);
- }
-
- if (m_processor.lookahead(':', 1))
- {
- tokPos += 2;
- }
-
- targetStrings.addElement(m_compiler.getTokenQueue().elementAt(tokPos));
- }
- }
-
- /**
- * Add a token to the token queue.
- *
- *
- * @param s The token.
- */
- private final void addToTokenQueue(String s)
- {
- m_compiler.getTokenQueue().addElement(s);
- }
-
- /**
- * When a seperator token is found, see if there's a element name or
- * the like to map.
- *
- * @param pat The XPath name string.
- * @param startSubstring The start of the name string.
- * @param posOfNSSep The position of the namespace seperator (':').
- * @param posOfScan The end of the name index.
- *
- * @throws javax.xml.transform.TransformerException
- *
- * @return -1 always.
- */
- private int mapNSTokens(String pat, int startSubstring, int posOfNSSep,
- int posOfScan)
- throws javax.xml.transform.TransformerException
- {
-
- String prefix = "";
-
- if ((startSubstring >= 0) && (posOfNSSep >= 0))
- {
- prefix = pat.substring(startSubstring, posOfNSSep);
- }
- String uName;
-
- if ((null != m_namespaceContext) &&!prefix.equals("*")
- &&!prefix.equals("xmlns"))
- {
- try
- {
- if (prefix.length() > 0)
- uName = ((PrefixResolver) m_namespaceContext).getNamespaceForPrefix(
- prefix);
- else
- {
-
- // Assume last was wildcard. This is not legal according
- // to the draft. Set the below to true to make namespace
- // wildcards work.
- if (false)
- {
- addToTokenQueue(":");
-
- String s = pat.substring(posOfNSSep + 1, posOfScan);
-
- if (s.length() > 0)
- addToTokenQueue(s);
-
- return -1;
- }
- else
- {
- uName =
- ((PrefixResolver) m_namespaceContext).getNamespaceForPrefix(
- prefix);
- }
- }
- }
- catch (ClassCastException cce)
- {
- uName = m_namespaceContext.getNamespaceForPrefix(prefix);
- }
- }
- else
- {
- uName = prefix;
- }
-
- if ((null != uName) && (uName.length() > 0))
- {
- addToTokenQueue(uName);
- addToTokenQueue(":");
-
- String s = pat.substring(posOfNSSep + 1, posOfScan);
-
- if (s.length() > 0)
- addToTokenQueue(s);
- }
- else
- {
- // To older XPath code it doesn't matter if
- // error() is called or errorForDOM3().
- m_processor.errorForDOM3(XPATHErrorResources.ER_PREFIX_MUST_RESOLVE,
- new String[] {prefix}); //"Prefix must resolve to a namespace: {0}";
-
-/** old code commented out 17-Sep-2004
-// error("Could not locate namespace for prefix: "+prefix);
-// m_processor.error(XPATHErrorResources.ER_PREFIX_MUST_RESOLVE,
-// new String[] {prefix}); //"Prefix must resolve to a namespace: {0}";
-*/
-
- /*** Old code commented out 10-Jan-2001
- addToTokenQueue(prefix);
- addToTokenQueue(":");
-
- String s = pat.substring(posOfNSSep + 1, posOfScan);
-
- if (s.length() > 0)
- addToTokenQueue(s);
- ***/
- }
-
- return -1;
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/compiler/OpCodes.java b/src/com/sun/org/apache/xpath/internal/compiler/OpCodes.java
deleted file mode 100644
index 1384c2a..0000000
--- a/src/com/sun/org/apache/xpath/internal/compiler/OpCodes.java
+++ /dev/null
@@ -1,634 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: OpCodes.java,v 1.1.2.1 2005/08/01 01:30:33 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.compiler;
-
-/**
- * Operations codes for XPath.
- *
- * Code for the descriptions of the operations codes:
- * [UPPER CASE] indicates a literal value,
- * [lower case] is a description of a value,
- * ([length] always indicates the length of the operation,
- * including the operations code and the length integer.)
- * {UPPER CASE} indicates the given production,
- * {description} is the description of a new production,
- * (For instance, {boolean expression} means some expression
- * that should be resolved to a boolean.)
- * * means that it occurs zero or more times,
- * + means that it occurs one or more times,
- * ? means that it is optional.
- *
- * returns: indicates what the production should return.
- */
-public class OpCodes
-{
-
- /**
- * [ENDOP]
- * Some operators may like to have a terminator.
- * @xsl.usage advanced
- */
- public static final int ENDOP = -1;
-
- /**
- * [EMPTY]
- * Empty slot to indicate NULL.
- */
- public static final int EMPTY = -2;
-
- /**
- * [ELEMWILDCARD]
- * Means ELEMWILDCARD ("*"), used instead
- * of string index in some places.
- * @xsl.usage advanced
- */
- public static final int ELEMWILDCARD = -3;
-
- /**
- * [OP_XPATH]
- * [length]
- * {expression}
- *
- * returns:
- * XNodeSet
- * XNumber
- * XString
- * XBoolean
- * XRTree
- * XObject
- * @xsl.usage advanced
- */
- public static final int OP_XPATH = 1;
-
- /**
- * [OP_OR]
- * [length]
- * {boolean expression}
- * {boolean expression}
- *
- * returns:
- * XBoolean
- * @xsl.usage advanced
- */
- public static final int OP_OR = 2;
-
- /**
- * [OP_AND]
- * [length]
- * {boolean expression}
- * {boolean expression}
- *
- * returns:
- * XBoolean
- * @xsl.usage advanced
- */
- public static final int OP_AND = 3;
-
- /**
- * [OP_NOTEQUALS]
- * [length]
- * {expression}
- * {expression}
- *
- * returns:
- * XBoolean
- * @xsl.usage advanced
- */
- public static final int OP_NOTEQUALS = 4;
-
- /**
- * [OP_EQUALS]
- * [length]
- * {expression}
- * {expression}
- *
- * returns:
- * XBoolean
- * @xsl.usage advanced
- */
- public static final int OP_EQUALS = 5;
-
- /**
- * [OP_LTE] (less-than-or-equals)
- * [length]
- * {number expression}
- * {number expression}
- *
- * returns:
- * XBoolean
- * @xsl.usage advanced
- */
- public static final int OP_LTE = 6;
-
- /**
- * [OP_LT] (less-than)
- * [length]
- * {number expression}
- * {number expression}
- *
- * returns:
- * XBoolean
- * @xsl.usage advanced
- */
- public static final int OP_LT = 7;
-
- /**
- * [OP_GTE] (greater-than-or-equals)
- * [length]
- * {number expression}
- * {number expression}
- *
- * returns:
- * XBoolean
- * @xsl.usage advanced
- */
- public static final int OP_GTE = 8;
-
- /**
- * [OP_GT] (greater-than)
- * [length]
- * {number expression}
- * {number expression}
- *
- * returns:
- * XBoolean
- * @xsl.usage advanced
- */
- public static final int OP_GT = 9;
-
- /**
- * [OP_PLUS]
- * [length]
- * {number expression}
- * {number expression}
- *
- * returns:
- * XNumber
- * @xsl.usage advanced
- */
- public static final int OP_PLUS = 10;
-
- /**
- * [OP_MINUS]
- * [length]
- * {number expression}
- * {number expression}
- *
- * returns:
- * XNumber
- * @xsl.usage advanced
- */
- public static final int OP_MINUS = 11;
-
- /**
- * [OP_MULT]
- * [length]
- * {number expression}
- * {number expression}
- *
- * returns:
- * XNumber
- * @xsl.usage advanced
- */
- public static final int OP_MULT = 12;
-
- /**
- * [OP_DIV]
- * [length]
- * {number expression}
- * {number expression}
- *
- * returns:
- * XNumber
- * @xsl.usage advanced
- */
- public static final int OP_DIV = 13;
-
- /**
- * [OP_MOD]
- * [length]
- * {number expression}
- * {number expression}
- *
- * returns:
- * XNumber
- * @xsl.usage advanced
- */
- public static final int OP_MOD = 14;
-
- /**
- * [OP_QUO]
- * [length]
- * {number expression}
- * {number expression}
- *
- * returns:
- * XNumber
- * @xsl.usage advanced
- */
- public static final int OP_QUO = 15;
-
- /**
- * [OP_NEG]
- * [length]
- * {number expression}
- *
- * returns:
- * XNumber
- * @xsl.usage advanced
- */
- public static final int OP_NEG = 16;
-
- /**
- * [OP_STRING] (cast operation)
- * [length]
- * {expression}
- *
- * returns:
- * XString
- * @xsl.usage advanced
- */
- public static final int OP_STRING = 17;
-
- /**
- * [OP_BOOL] (cast operation)
- * [length]
- * {expression}
- *
- * returns:
- * XBoolean
- * @xsl.usage advanced
- */
- public static final int OP_BOOL = 18;
-
- /**
- * [OP_NUMBER] (cast operation)
- * [length]
- * {expression}
- *
- * returns:
- * XBoolean
- * @xsl.usage advanced
- */
- public static final int OP_NUMBER = 19;
-
- /**
- * [OP_UNION]
- * [length]
- * {PathExpr}+
- *
- * returns:
- * XNodeSet
- * @xsl.usage advanced
- */
- public static final int OP_UNION = 20;
-
- /**
- * [OP_LITERAL]
- * [3]
- * [index to token]
- *
- * returns:
- * XString
- * @xsl.usage advanced
- */
- public static final int OP_LITERAL = 21;
-
- /** The low opcode for nodesets, needed by getFirstPredicateOpPos and
- * getNextStepPos. */
- static final int FIRST_NODESET_OP = 22;
-
- /**
- * [OP_VARIABLE]
- * [4]
- * [index to namespace token, or EMPTY]
- * [index to function name token]
- *
- * returns:
- * XString
- * @xsl.usage advanced
- */
- public static final int OP_VARIABLE = 22;
-
- /**
- * [OP_GROUP]
- * [length]
- * {expression}
- *
- * returns:
- * XNodeSet
- * XNumber
- * XString
- * XBoolean
- * XRTree
- * XObject
- * @xsl.usage advanced
- */
- public static final int OP_GROUP = 23;
-
- /**
- * [OP_EXTFUNCTION] (Extension function.)
- * [length]
- * [index to namespace token]
- * [index to function name token]
- * {OP_ARGUMENT}
- *
- * returns:
- * XNodeSet
- * XNumber
- * XString
- * XBoolean
- * XRTree
- * XObject
- * @xsl.usage advanced
- */
- public static final int OP_EXTFUNCTION = 24;
-
- /**
- * [OP_FUNCTION]
- * [length]
- * [FUNC_name]
- * {OP_ARGUMENT}
- * [ENDOP]
- *
- * returns:
- * XNodeSet
- * XNumber
- * XString
- * XBoolean
- * XRTree
- * XObject
- * @xsl.usage advanced
- */
- public static final int OP_FUNCTION = 25;
-
- /** The last opcode for stuff that can be a nodeset. */
- static final int LAST_NODESET_OP = 25;
-
- /**
- * [OP_ARGUMENT] (Function argument.)
- * [length]
- * {expression}
- *
- * returns:
- * XNodeSet
- * XNumber
- * XString
- * XBoolean
- * XRTree
- * XObject
- * @xsl.usage advanced
- */
- public static final int OP_ARGUMENT = 26;
-
- /**
- * [OP_NUMBERLIT] (Number literal.)
- * [3]
- * [index to token]
- *
- * returns:
- * XString
- * @xsl.usage advanced
- */
- public static final int OP_NUMBERLIT = 27;
-
- /**
- * [OP_LOCATIONPATH]
- * [length]
- * {FROM_stepType}
- * | {function}
- * {predicate}
- * [ENDOP]
- *
- * (Note that element and attribute namespaces and
- * names can be wildcarded '*'.)
- *
- * returns:
- * XNodeSet
- * @xsl.usage advanced
- */
- public static final int OP_LOCATIONPATH = 28;
-
- // public static final int LOCATIONPATHEX_MASK = 0x0000FFFF;
- // public static final int LOCATIONPATHEX_ISSIMPLE = 0x00010000;
- // public static final int OP_LOCATIONPATH_EX = (28 | 0x00010000);
-
- /**
- * [OP_PREDICATE]
- * [length]
- * {expression}
- * [ENDOP] (For safety)
- *
- * returns:
- * XBoolean or XNumber
- * @xsl.usage advanced
- */
- public static final int OP_PREDICATE = 29;
-
- /**
- * [OP_MATCHPATTERN]
- * [length]
- * {PathExpr}+
- *
- * returns:
- * XNodeSet
- * @xsl.usage advanced
- */
- public static final int OP_MATCHPATTERN = 30;
-
- /**
- * [OP_LOCATIONPATHPATTERN]
- * [length]
- * {FROM_stepType}
- * | {function}{predicate}
- * [ENDOP]
- * returns:
- * XNodeSet
- * @xsl.usage advanced
- */
- public static final int OP_LOCATIONPATHPATTERN = 31;
-
- /**
- * [NODETYPE_COMMENT]
- * No size or arguments.
- * Note: must not overlap function OP number!
- *
- * returns:
- * XBoolean
- * @xsl.usage advanced
- */
- public static final int NODETYPE_COMMENT = 1030;
-
- /**
- * [NODETYPE_TEXT]
- * No size or arguments.
- * Note: must not overlap function OP number!
- *
- * returns:
- * XBoolean
- * @xsl.usage advanced
- */
- public static final int NODETYPE_TEXT = 1031;
-
- /**
- * [NODETYPE_PI]
- * [index to token]
- * Note: must not overlap function OP number!
- *
- * returns:
- * XBoolean
- * @xsl.usage advanced
- */
- public static final int NODETYPE_PI = 1032;
-
- /**
- * [NODETYPE_NODE]
- * No size or arguments.
- * Note: must not overlap function OP number!
- *
- * returns:
- * XBoolean
- * @xsl.usage advanced
- */
- public static final int NODETYPE_NODE = 1033;
-
- /**
- * [NODENAME]
- * [index to ns token or EMPTY]
- * [index to name token]
- *
- * returns:
- * XBoolean
- * @xsl.usage advanced
- */
- public static final int NODENAME = 34;
-
- /**
- * [NODETYPE_ROOT]
- * No size or arguments.
- *
- * returns:
- * XBoolean
- * @xsl.usage advanced
- */
- public static final int NODETYPE_ROOT = 35;
-
- /**
- * [NODETYPE_ANY]
- * No size or arguments.
- *
- * returns:
- * XBoolean
- * @xsl.usage advanced
- */
- public static final int NODETYPE_ANYELEMENT = 36;
-
- /**
- * [NODETYPE_ANY]
- * No size or arguments.
- *
- * returns:
- * XBoolean
- * @xsl.usage advanced
- */
- public static final int NODETYPE_FUNCTEST = 1034;
-
- /**
- * [FROM_stepType]
- * [length, including predicates]
- * [length of just the step, without the predicates]
- * {node test}
- * {predicates}?
- *
- * returns:
- * XBoolean
- * @xsl.usage advanced
- */
- public static final int AXES_START_TYPES = 37;
-
- /** ancestor axes opcode. */
- public static final int FROM_ANCESTORS = 37;
-
- /** ancestor-or-self axes opcode. */
- public static final int FROM_ANCESTORS_OR_SELF = 38;
-
- /** attribute axes opcode. */
- public static final int FROM_ATTRIBUTES = 39;
-
- /** children axes opcode. */
- public static final int FROM_CHILDREN = 40;
-
- /** descendants axes opcode. */
- public static final int FROM_DESCENDANTS = 41;
-
- /** descendants-of-self axes opcode. */
- public static final int FROM_DESCENDANTS_OR_SELF = 42;
-
- /** following axes opcode. */
- public static final int FROM_FOLLOWING = 43;
-
- /** following-siblings axes opcode. */
- public static final int FROM_FOLLOWING_SIBLINGS = 44;
-
- /** parent axes opcode. */
- public static final int FROM_PARENT = 45;
-
- /** preceding axes opcode. */
- public static final int FROM_PRECEDING = 46;
-
- /** preceding-sibling axes opcode. */
- public static final int FROM_PRECEDING_SIBLINGS = 47;
-
- /** self axes opcode. */
- public static final int FROM_SELF = 48;
-
- /** namespace axes opcode. */
- public static final int FROM_NAMESPACE = 49;
-
- /** '/' axes opcode. */
- public static final int FROM_ROOT = 50;
-
- /**
- * For match patterns.
- * @xsl.usage advanced
- */
- public static final int MATCH_ATTRIBUTE = 51;
-
- /**
- * For match patterns.
- * @xsl.usage advanced
- */
- public static final int MATCH_ANY_ANCESTOR = 52;
-
- /**
- * For match patterns.
- * @xsl.usage advanced
- */
- public static final int MATCH_IMMEDIATE_ANCESTOR = 53;
-
- /** The end of the axes types. */
- public static final int AXES_END_TYPES = 53;
-
- /** The next free ID. Please keep this up to date. */
- private static final int NEXT_FREE_ID = 99;
-}
diff --git a/src/com/sun/org/apache/xpath/internal/compiler/OpMap.java b/src/com/sun/org/apache/xpath/internal/compiler/OpMap.java
deleted file mode 100644
index f0cfa94..0000000
--- a/src/com/sun/org/apache/xpath/internal/compiler/OpMap.java
+++ /dev/null
@@ -1,457 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: OpMap.java,v 1.1.2.1 2005/08/01 01:30:31 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.compiler;
-
-import com.sun.org.apache.xalan.internal.res.XSLMessages;
-import com.sun.org.apache.xml.internal.utils.ObjectVector;
-import com.sun.org.apache.xpath.internal.patterns.NodeTest;
-import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
-
-/**
- * This class represents the data structure basics of the XPath
- * object.
- */
-public class OpMap
-{
-
- /**
- * The current pattern string, for diagnostics purposes
- */
- protected String m_currentPattern;
-
- /**
- * Return the expression as a string for diagnostics.
- *
- * @return The expression string.
- */
- public String toString()
- {
- return m_currentPattern;
- }
-
- /**
- * Return the expression as a string for diagnostics.
- *
- * @return The expression string.
- */
- public String getPatternString()
- {
- return m_currentPattern;
- }
-
- /**
- * The starting size of the token queue.
- */
- static final int MAXTOKENQUEUESIZE = 500;
-
- /*
- * Amount to grow token queue when it becomes full
- */
- static final int BLOCKTOKENQUEUESIZE = 500;
-
- /**
- * TokenStack is the queue of used tokens. The current token is the token at the
- * end of the m_tokenQueue. The idea is that the queue can be marked and a sequence
- * of tokens can be reused.
- */
- ObjectVector m_tokenQueue = new ObjectVector(MAXTOKENQUEUESIZE, BLOCKTOKENQUEUESIZE);
-
- /**
- * Get the XPath as a list of tokens.
- *
- * @return ObjectVector of tokens.
- */
- public ObjectVector getTokenQueue()
- {
- return m_tokenQueue;
- }
-
- /**
- * Get the XPath as a list of tokens.
- *
- * @param pos index into token queue.
- *
- * @return The token, normally a string.
- */
- public Object getToken(int pos)
- {
- return m_tokenQueue.elementAt(pos);
- }
-
- /**
- * The current size of the token queue.
- */
-// public int m_tokenQueueSize = 0;
-
- /**
- * Get size of the token queue.
- *
- * @return The size of the token queue.
- */
- public int getTokenQueueSize()
- {
- return m_tokenQueue.size();
-
- }
-
- /**
- * An operations map is used instead of a proper parse tree. It contains
- * operations codes and indexes into the m_tokenQueue.
- * I use an array instead of a full parse tree in order to cut down
- * on the number of objects created.
- */
- OpMapVector m_opMap = null;
-
- /**
- * Get the opcode list that describes the XPath operations. It contains
- * operations codes and indexes into the m_tokenQueue.
- * I use an array instead of a full parse tree in order to cut down
- * on the number of objects created.
- *
- * @return An IntVector that is the opcode list that describes the XPath operations.
- */
- public OpMapVector getOpMap()
- {
- return m_opMap;
- }
-
- // Position indexes
-
- /**
- * The length is always the opcode position + 1.
- * Length is always expressed as the opcode+length bytes,
- * so it is always 2 or greater.
- */
- public static final int MAPINDEX_LENGTH = 1;
-
- /**
- * Replace the large arrays
- * with a small array.
- */
- void shrink()
- {
-
- int n = m_opMap.elementAt(MAPINDEX_LENGTH);
- m_opMap.setToSize(n + 4);
-
- m_opMap.setElementAt(0,n);
- m_opMap.setElementAt(0,n+1);
- m_opMap.setElementAt(0,n+2);
-
-
- n = m_tokenQueue.size();
- m_tokenQueue.setToSize(n + 4);
-
- m_tokenQueue.setElementAt(null,n);
- m_tokenQueue.setElementAt(null,n + 1);
- m_tokenQueue.setElementAt(null,n + 2);
- }
-
- /**
- * Given an operation position, return the current op.
- *
- * @param opPos index into op map.
- * @return the op that corresponds to the opPos argument.
- */
- public int getOp(int opPos)
- {
- return m_opMap.elementAt(opPos);
- }
-
- /**
- * Set the op at index to the given int.
- *
- * @param opPos index into op map.
- * @param value Value to set
- */
- public void setOp(int opPos, int value)
- {
- m_opMap.setElementAt(value,opPos);
- }
-
- /**
- * Given an operation position, return the end position, i.e. the
- * beginning of the next operation.
- *
- * @param opPos An op position of an operation for which there is a size
- * entry following.
- * @return position of next operation in m_opMap.
- */
- public int getNextOpPos(int opPos)
- {
- return opPos + m_opMap.elementAt(opPos + 1);
- }
-
- /**
- * Given a location step position, return the end position, i.e. the
- * beginning of the next step.
- *
- * @param opPos the position of a location step.
- * @return the position of the next location step.
- */
- public int getNextStepPos(int opPos)
- {
-
- int stepType = getOp(opPos);
-
- if ((stepType >= OpCodes.AXES_START_TYPES)
- && (stepType <= OpCodes.AXES_END_TYPES))
- {
- return getNextOpPos(opPos);
- }
- else if ((stepType >= OpCodes.FIRST_NODESET_OP)
- && (stepType <= OpCodes.LAST_NODESET_OP))
- {
- int newOpPos = getNextOpPos(opPos);
-
- while (OpCodes.OP_PREDICATE == getOp(newOpPos))
- {
- newOpPos = getNextOpPos(newOpPos);
- }
-
- stepType = getOp(newOpPos);
-
- if (!((stepType >= OpCodes.AXES_START_TYPES)
- && (stepType <= OpCodes.AXES_END_TYPES)))
- {
- return OpCodes.ENDOP;
- }
-
- return newOpPos;
- }
- else
- {
- throw new RuntimeException(
- XSLMessages.createXPATHMessage(XPATHErrorResources.ER_UNKNOWN_STEP, new Object[]{String.valueOf(stepType)}));
- //"Programmer's assertion in getNextStepPos: unknown stepType: " + stepType);
- }
- }
-
- /**
- * Given an operation position, return the end position, i.e. the
- * beginning of the next operation.
- *
- * @param opMap The operations map.
- * @param opPos index to operation, for which there is a size entry following.
- * @return position of next operation in m_opMap.
- */
- public static int getNextOpPos(int[] opMap, int opPos)
- {
- return opPos + opMap[opPos + 1];
- }
-
- /**
- * Given an FROM_stepType position, return the position of the
- * first predicate, if there is one, or else this will point
- * to the end of the FROM_stepType.
- * Example:
- * int posOfPredicate = xpath.getNextOpPos(stepPos);
- * boolean hasPredicates =
- * OpCodes.OP_PREDICATE == xpath.getOp(posOfPredicate);
- *
- * @param opPos position of FROM_stepType op.
- * @return position of predicate in FROM_stepType structure.
- */
- public int getFirstPredicateOpPos(int opPos)
- throws javax.xml.transform.TransformerException
- {
-
- int stepType = m_opMap.elementAt(opPos);
-
- if ((stepType >= OpCodes.AXES_START_TYPES)
- && (stepType <= OpCodes.AXES_END_TYPES))
- {
- return opPos + m_opMap.elementAt(opPos + 2);
- }
- else if ((stepType >= OpCodes.FIRST_NODESET_OP)
- && (stepType <= OpCodes.LAST_NODESET_OP))
- {
- return opPos + m_opMap.elementAt(opPos + 1);
- }
- else if(-2 == stepType)
- {
- return -2;
- }
- else
- {
- error(com.sun.org.apache.xpath.internal.res.XPATHErrorResources.ER_UNKNOWN_OPCODE,
- new Object[]{ String.valueOf(stepType) }); //"ERROR! Unknown op code: "+m_opMap[opPos]);
- return -1;
- }
- }
-
- /**
- * Tell the user of an error, and probably throw an
- * exception.
- *
- * @param msg An error msgkey that corresponds to one of the constants found
- * in {@link com.sun.org.apache.xpath.internal.res.XPATHErrorResources}, which is
- * a key for a format string.
- * @param args An array of arguments represented in the format string, which
- * may be null.
- *
- * @throws TransformerException if the current ErrorListoner determines to
- * throw an exception.
- */
- public void error(String msg, Object[] args) throws javax.xml.transform.TransformerException
- {
-
- java.lang.String fmsg = com.sun.org.apache.xalan.internal.res.XSLMessages.createXPATHMessage(msg, args);
-
-
- throw new javax.xml.transform.TransformerException(fmsg);
- }
-
-
- /**
- * Go to the first child of a given operation.
- *
- * @param opPos position of operation.
- *
- * @return The position of the first child of the operation.
- */
- public static int getFirstChildPos(int opPos)
- {
- return opPos + 2;
- }
-
- /**
- * Get the length of an operation.
- *
- * @param opPos The position of the operation in the op map.
- *
- * @return The size of the operation.
- */
- public int getArgLength(int opPos)
- {
- return m_opMap.elementAt(opPos + MAPINDEX_LENGTH);
- }
-
- /**
- * Given a location step, get the length of that step.
- *
- * @param opPos Position of location step in op map.
- *
- * @return The length of the step.
- */
- public int getArgLengthOfStep(int opPos)
- {
- return m_opMap.elementAt(opPos + MAPINDEX_LENGTH + 1) - 3;
- }
-
- /**
- * Get the first child position of a given location step.
- *
- * @param opPos Position of location step in the location map.
- *
- * @return The first child position of the step.
- */
- public static int getFirstChildPosOfStep(int opPos)
- {
- return opPos + 3;
- }
-
- /**
- * Get the test type of the step, i.e. NODETYPE_XXX value.
- *
- * @param opPosOfStep The position of the FROM_XXX step.
- *
- * @return NODETYPE_XXX value.
- */
- public int getStepTestType(int opPosOfStep)
- {
- return m_opMap.elementAt(opPosOfStep + 3); // skip past op, len, len without predicates
- }
-
- /**
- * Get the namespace of the step.
- *
- * @param opPosOfStep The position of the FROM_XXX step.
- *
- * @return The step's namespace, NodeTest.WILD, or null for null namespace.
- */
- public String getStepNS(int opPosOfStep)
- {
-
- int argLenOfStep = getArgLengthOfStep(opPosOfStep);
-
- // System.out.println("getStepNS.argLenOfStep: "+argLenOfStep);
- if (argLenOfStep == 3)
- {
- int index = m_opMap.elementAt(opPosOfStep + 4);
-
- if (index >= 0)
- return (String) m_tokenQueue.elementAt(index);
- else if (OpCodes.ELEMWILDCARD == index)
- return NodeTest.WILD;
- else
- return null;
- }
- else
- return null;
- }
-
- /**
- * Get the local name of the step.
- * @param opPosOfStep The position of the FROM_XXX step.
- *
- * @return OpCodes.EMPTY, OpCodes.ELEMWILDCARD, or the local name.
- */
- public String getStepLocalName(int opPosOfStep)
- {
-
- int argLenOfStep = getArgLengthOfStep(opPosOfStep);
-
- // System.out.println("getStepLocalName.argLenOfStep: "+argLenOfStep);
- int index;
-
- switch (argLenOfStep)
- {
- case 0 :
- index = OpCodes.EMPTY;
- break;
- case 1 :
- index = OpCodes.ELEMWILDCARD;
- break;
- case 2 :
- index = m_opMap.elementAt(opPosOfStep + 4);
- break;
- case 3 :
- index = m_opMap.elementAt(opPosOfStep + 5);
- break;
- default :
- index = OpCodes.EMPTY;
- break; // Should assert error
- }
-
- // int index = (argLenOfStep == 3) ? m_opMap[opPosOfStep+5]
- // : ((argLenOfStep == 1) ? -3 : -2);
- if (index >= 0)
- return (String) m_tokenQueue.elementAt(index).toString();
- else if (OpCodes.ELEMWILDCARD == index)
- return NodeTest.WILD;
- else
- return null;
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/compiler/OpMapVector.java b/src/com/sun/org/apache/xpath/internal/compiler/OpMapVector.java
deleted file mode 100644
index 7cfa86e..0000000
--- a/src/com/sun/org/apache/xpath/internal/compiler/OpMapVector.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2002-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: OpMapVector.java,v 1.2.4.1 2005/09/10 03:57:14 jeffsuttor Exp $
- */
-
-package com.sun.org.apache.xpath.internal.compiler;
-
-/**
- *
- * Like IntVector, but used only for the OpMap array. Length of array
- * is kept in the m_lengthPos position of the array. Only the required methods
- * are in included here.
- * @xsl.usage internal
- */
-public class OpMapVector {
-
- /** Size of blocks to allocate */
- protected int m_blocksize;
-
- /** Array of ints */
- protected int m_map[]; // IntStack is trying to see this directly
-
- /** Position where size of array is kept */
- protected int m_lengthPos = 0;
-
- /** Size of array */
- protected int m_mapSize;
-
- /**
- * Construct a OpMapVector, using the given block size.
- *
- * @param blocksize Size of block to allocate
- */
- public OpMapVector(int blocksize, int increaseSize, int lengthPos)
- {
-
- m_blocksize = increaseSize;
- m_mapSize = blocksize;
- m_lengthPos = lengthPos;
- m_map = new int[blocksize];
- }
-
- /**
- * Get the nth element.
- *
- * @param i index of object to get
- *
- * @return object at given index
- */
- public final int elementAt(int i)
- {
- return m_map[i];
- }
-
- /**
- * Sets the component at the specified index of this vector to be the
- * specified object. The previous component at that position is discarded.
- *
- * The index must be a value greater than or equal to 0 and less
- * than the current size of the vector.
- *
- * @param value object to set
- * @param index Index of where to set the object
- */
- public final void setElementAt(int value, int index)
- {
- if (index >= m_mapSize)
- {
- int oldSize = m_mapSize;
-
- m_mapSize += m_blocksize;
-
- int newMap[] = new int[m_mapSize];
-
- System.arraycopy(m_map, 0, newMap, 0, oldSize);
-
- m_map = newMap;
- }
-
- m_map[index] = value;
- }
-
-
- /*
- * Reset the array to the supplied size. No checking is done.
- *
- * @param size The size to trim to.
- */
- public final void setToSize(int size) {
-
- int newMap[] = new int[size];
-
- System.arraycopy(m_map, 0, newMap, 0, m_map[m_lengthPos]);
-
- m_mapSize = size;
- m_map = newMap;
-
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/compiler/PsuedoNames.java b/src/com/sun/org/apache/xpath/internal/compiler/PsuedoNames.java
deleted file mode 100644
index e603cbf..0000000
--- a/src/com/sun/org/apache/xpath/internal/compiler/PsuedoNames.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: PsuedoNames.java,v 1.1.2.1 2005/08/01 01:30:33 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.compiler;
-
-/**
- * This is used to represent names of nodes that may not be named, like a
- * comment node.
- */
-public class PsuedoNames
-{
-
- /**
- * Psuedo name for a wild card pattern ('*').
- */
- public static final String PSEUDONAME_ANY = "*";
-
- /**
- * Psuedo name for the root node.
- */
- public static final String PSEUDONAME_ROOT = "/";
-
- /**
- * Psuedo name for a text node.
- */
- public static final String PSEUDONAME_TEXT = "#text";
-
- /**
- * Psuedo name for a comment node.
- */
- public static final String PSEUDONAME_COMMENT = "#comment";
-
- /**
- * Psuedo name for a processing instruction node.
- */
- public static final String PSEUDONAME_PI = "#pi";
-
- /**
- * Psuedo name for an unknown type value.
- */
- public static final String PSEUDONAME_OTHER = "*";
-}
diff --git a/src/com/sun/org/apache/xpath/internal/compiler/XPathDumper.java b/src/com/sun/org/apache/xpath/internal/compiler/XPathDumper.java
deleted file mode 100644
index e5266cb..0000000
--- a/src/com/sun/org/apache/xpath/internal/compiler/XPathDumper.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XPathDumper.java,v 1.1.2.1 2005/08/01 01:30:31 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.compiler;
-
-
-/**
- * Class for XPath diagnostic functions.
- */
-public class XPathDumper
-{
-
- // deleted for the time being.
-}
diff --git a/src/com/sun/org/apache/xpath/internal/compiler/XPathParser.java b/src/com/sun/org/apache/xpath/internal/compiler/XPathParser.java
deleted file mode 100644
index 1b55599..0000000
--- a/src/com/sun/org/apache/xpath/internal/compiler/XPathParser.java
+++ /dev/null
@@ -1,2403 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XPathParser.java,v 1.2.4.1 2005/09/14 19:46:02 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.compiler;
-
-import javax.xml.transform.ErrorListener;
-import javax.xml.transform.TransformerException;
-
-import com.sun.org.apache.xalan.internal.res.XSLMessages;
-import com.sun.org.apache.xml.internal.utils.PrefixResolver;
-import com.sun.org.apache.xpath.internal.XPathProcessorException;
-import com.sun.org.apache.xpath.internal.domapi.XPathStylesheetDOM3Exception;
-import com.sun.org.apache.xpath.internal.objects.XNumber;
-import com.sun.org.apache.xpath.internal.objects.XString;
-import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
-
-/**
- * Tokenizes and parses XPath expressions. This should really be named
- * XPathParserImpl, and may be renamed in the future.
- * @xsl.usage general
- */
-public class XPathParser
-{
- // %REVIEW% Is there a better way of doing this?
- // Upside is minimum object churn. Downside is that we don't have a useful
- // backtrace in the exception itself -- but we don't expect to need one.
- static public final String CONTINUE_AFTER_FATAL_ERROR="CONTINUE_AFTER_FATAL_ERROR";
-
- /**
- * The XPath to be processed.
- */
- private OpMap m_ops;
-
- /**
- * The next token in the pattern.
- */
- transient String m_token;
-
- /**
- * The first char in m_token, the theory being that this
- * is an optimization because we won't have to do charAt(0) as
- * often.
- */
- transient char m_tokenChar = 0;
-
- /**
- * The position in the token queue is tracked by m_queueMark.
- */
- int m_queueMark = 0;
-
- /**
- * Results from checking FilterExpr syntax
- */
- protected final static int FILTER_MATCH_FAILED = 0;
- protected final static int FILTER_MATCH_PRIMARY = 1;
- protected final static int FILTER_MATCH_PREDICATES = 2;
-
- /**
- * The parser constructor.
- */
- public XPathParser(ErrorListener errorListener, javax.xml.transform.SourceLocator sourceLocator)
- {
- m_errorListener = errorListener;
- m_sourceLocator = sourceLocator;
- }
-
- /**
- * The prefix resolver to map prefixes to namespaces in the OpMap.
- */
- PrefixResolver m_namespaceContext;
-
- /**
- * Given an string, init an XPath object for selections,
- * in order that a parse doesn't
- * have to be done each time the expression is evaluated.
- *
- * @param compiler The compiler object.
- * @param expression A string conforming to the XPath grammar.
- * @param namespaceContext An object that is able to resolve prefixes in
- * the XPath to namespaces.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public void initXPath(
- Compiler compiler, String expression, PrefixResolver namespaceContext)
- throws javax.xml.transform.TransformerException
- {
-
- m_ops = compiler;
- m_namespaceContext = namespaceContext;
- m_functionTable = compiler.getFunctionTable();
-
- Lexer lexer = new Lexer(compiler, namespaceContext, this);
-
- lexer.tokenize(expression);
-
- m_ops.setOp(0,OpCodes.OP_XPATH);
- m_ops.setOp(OpMap.MAPINDEX_LENGTH,2);
-
-
- // Patch for Christine's gripe. She wants her errorHandler to return from
- // a fatal error and continue trying to parse, rather than throwing an exception.
- // Without the patch, that put us into an endless loop.
- //
- // %REVIEW% Is there a better way of doing this?
- // %REVIEW% Are there any other cases which need the safety net?
- // (and if so do we care right now, or should we rewrite the XPath
- // grammar engine and can fix it at that time?)
- try {
-
- nextToken();
- Expr();
-
- if (null != m_token)
- {
- String extraTokens = "";
-
- while (null != m_token)
- {
- extraTokens += "'" + m_token + "'";
-
- nextToken();
-
- if (null != m_token)
- extraTokens += ", ";
- }
-
- error(XPATHErrorResources.ER_EXTRA_ILLEGAL_TOKENS,
- new Object[]{ extraTokens }); //"Extra illegal tokens: "+extraTokens);
- }
-
- }
- catch (com.sun.org.apache.xpath.internal.XPathProcessorException e)
- {
- if(CONTINUE_AFTER_FATAL_ERROR.equals(e.getMessage()))
- {
- // What I _want_ to do is null out this XPath.
- // I doubt this has the desired effect, but I'm not sure what else to do.
- // %REVIEW%!!!
- initXPath(compiler, "/..", namespaceContext);
- }
- else
- throw e;
- }
-
- compiler.shrink();
- }
-
- /**
- * Given an string, init an XPath object for pattern matches,
- * in order that a parse doesn't
- * have to be done each time the expression is evaluated.
- * @param compiler The XPath object to be initialized.
- * @param expression A String representing the XPath.
- * @param namespaceContext An object that is able to resolve prefixes in
- * the XPath to namespaces.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public void initMatchPattern(
- Compiler compiler, String expression, PrefixResolver namespaceContext)
- throws javax.xml.transform.TransformerException
- {
-
- m_ops = compiler;
- m_namespaceContext = namespaceContext;
- m_functionTable = compiler.getFunctionTable();
-
- Lexer lexer = new Lexer(compiler, namespaceContext, this);
-
- lexer.tokenize(expression);
-
- m_ops.setOp(0, OpCodes.OP_MATCHPATTERN);
- m_ops.setOp(OpMap.MAPINDEX_LENGTH, 2);
-
- nextToken();
- Pattern();
-
- if (null != m_token)
- {
- String extraTokens = "";
-
- while (null != m_token)
- {
- extraTokens += "'" + m_token + "'";
-
- nextToken();
-
- if (null != m_token)
- extraTokens += ", ";
- }
-
- error(XPATHErrorResources.ER_EXTRA_ILLEGAL_TOKENS,
- new Object[]{ extraTokens }); //"Extra illegal tokens: "+extraTokens);
- }
-
- // Terminate for safety.
- m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), OpCodes.ENDOP);
- m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH)+1);
-
- m_ops.shrink();
- }
-
- /** The error listener where syntax errors are to be sent.
- */
- private ErrorListener m_errorListener;
-
- /** The source location of the XPath. */
- javax.xml.transform.SourceLocator m_sourceLocator;
-
- /** The table contains build-in functions and customized functions */
- private FunctionTable m_functionTable;
-
- /**
- * Allow an application to register an error event handler, where syntax
- * errors will be sent. If the error listener is not set, syntax errors
- * will be sent to System.err.
- *
- * @param handler Reference to error listener where syntax errors will be
- * sent.
- */
- public void setErrorHandler(ErrorListener handler)
- {
- m_errorListener = handler;
- }
-
- /**
- * Return the current error listener.
- *
- * @return The error listener, which should not normally be null, but may be.
- */
- public ErrorListener getErrorListener()
- {
- return m_errorListener;
- }
-
- /**
- * Check whether m_token matches the target string.
- *
- * @param s A string reference or null.
- *
- * @return If m_token is null, returns false (or true if s is also null), or
- * return true if the current token matches the string, else false.
- */
- final boolean tokenIs(String s)
- {
- return (m_token != null) ? (m_token.equals(s)) : (s == null);
- }
-
- /**
- * Check whether m_tokenChar==c.
- *
- * @param c A character to be tested.
- *
- * @return If m_token is null, returns false, or return true if c matches
- * the current token.
- */
- final boolean tokenIs(char c)
- {
- return (m_token != null) ? (m_tokenChar == c) : false;
- }
-
- /**
- * Look ahead of the current token in order to
- * make a branching decision.
- *
- * @param c the character to be tested for.
- * @param n number of tokens to look ahead. Must be
- * greater than 1.
- *
- * @return true if the next token matches the character argument.
- */
- final boolean lookahead(char c, int n)
- {
-
- int pos = (m_queueMark + n);
- boolean b;
-
- if ((pos <= m_ops.getTokenQueueSize()) && (pos > 0)
- && (m_ops.getTokenQueueSize() != 0))
- {
- String tok = ((String) m_ops.m_tokenQueue.elementAt(pos - 1));
-
- b = (tok.length() == 1) ? (tok.charAt(0) == c) : false;
- }
- else
- {
- b = false;
- }
-
- return b;
- }
-
- /**
- * Look behind the first character of the current token in order to
- * make a branching decision.
- *
- * @param c the character to compare it to.
- * @param n number of tokens to look behind. Must be
- * greater than 1. Note that the look behind terminates
- * at either the beginning of the string or on a '|'
- * character. Because of this, this method should only
- * be used for pattern matching.
- *
- * @return true if the token behind the current token matches the character
- * argument.
- */
- private final boolean lookbehind(char c, int n)
- {
-
- boolean isToken;
- int lookBehindPos = m_queueMark - (n + 1);
-
- if (lookBehindPos >= 0)
- {
- String lookbehind = (String) m_ops.m_tokenQueue.elementAt(lookBehindPos);
-
- if (lookbehind.length() == 1)
- {
- char c0 = (lookbehind == null) ? '|' : lookbehind.charAt(0);
-
- isToken = (c0 == '|') ? false : (c0 == c);
- }
- else
- {
- isToken = false;
- }
- }
- else
- {
- isToken = false;
- }
-
- return isToken;
- }
-
- /**
- * look behind the current token in order to
- * see if there is a useable token.
- *
- * @param n number of tokens to look behind. Must be
- * greater than 1. Note that the look behind terminates
- * at either the beginning of the string or on a '|'
- * character. Because of this, this method should only
- * be used for pattern matching.
- *
- * @return true if look behind has a token, false otherwise.
- */
- private final boolean lookbehindHasToken(int n)
- {
-
- boolean hasToken;
-
- if ((m_queueMark - n) > 0)
- {
- String lookbehind = (String) m_ops.m_tokenQueue.elementAt(m_queueMark - (n - 1));
- char c0 = (lookbehind == null) ? '|' : lookbehind.charAt(0);
-
- hasToken = (c0 == '|') ? false : true;
- }
- else
- {
- hasToken = false;
- }
-
- return hasToken;
- }
-
- /**
- * Look ahead of the current token in order to
- * make a branching decision.
- *
- * @param s the string to compare it to.
- * @param n number of tokens to lookahead. Must be
- * greater than 1.
- *
- * @return true if the token behind the current token matches the string
- * argument.
- */
- private final boolean lookahead(String s, int n)
- {
-
- boolean isToken;
-
- if ((m_queueMark + n) <= m_ops.getTokenQueueSize())
- {
- String lookahead = (String) m_ops.m_tokenQueue.elementAt(m_queueMark + (n - 1));
-
- isToken = (lookahead != null) ? lookahead.equals(s) : (s == null);
- }
- else
- {
- isToken = (null == s);
- }
-
- return isToken;
- }
-
- /**
- * Retrieve the next token from the command and
- * store it in m_token string.
- */
- private final void nextToken()
- {
-
- if (m_queueMark < m_ops.getTokenQueueSize())
- {
- m_token = (String) m_ops.m_tokenQueue.elementAt(m_queueMark++);
- m_tokenChar = m_token.charAt(0);
- }
- else
- {
- m_token = null;
- m_tokenChar = 0;
- }
- }
-
- /**
- * Retrieve a token relative to the current token.
- *
- * @param i Position relative to current token.
- *
- * @return The string at the given index, or null if the index is out
- * of range.
- */
- private final String getTokenRelative(int i)
- {
-
- String tok;
- int relative = m_queueMark + i;
-
- if ((relative > 0) && (relative < m_ops.getTokenQueueSize()))
- {
- tok = (String) m_ops.m_tokenQueue.elementAt(relative);
- }
- else
- {
- tok = null;
- }
-
- return tok;
- }
-
- /**
- * Retrieve the previous token from the command and
- * store it in m_token string.
- */
- private final void prevToken()
- {
-
- if (m_queueMark > 0)
- {
- m_queueMark--;
-
- m_token = (String) m_ops.m_tokenQueue.elementAt(m_queueMark);
- m_tokenChar = m_token.charAt(0);
- }
- else
- {
- m_token = null;
- m_tokenChar = 0;
- }
- }
-
- /**
- * Consume an expected token, throwing an exception if it
- * isn't there.
- *
- * @param expected The string to be expected.
- *
- * @throws javax.xml.transform.TransformerException
- */
- private final void consumeExpected(String expected)
- throws javax.xml.transform.TransformerException
- {
-
- if (tokenIs(expected))
- {
- nextToken();
- }
- else
- {
- error(XPATHErrorResources.ER_EXPECTED_BUT_FOUND, new Object[]{ expected,
- m_token }); //"Expected "+expected+", but found: "+m_token);
-
- // Patch for Christina's gripe. She wants her errorHandler to return from
- // this error and continue trying to parse, rather than throwing an exception.
- // Without the patch, that put us into an endless loop.
- throw new XPathProcessorException(CONTINUE_AFTER_FATAL_ERROR);
- }
- }
-
- /**
- * Consume an expected token, throwing an exception if it
- * isn't there.
- *
- * @param expected the character to be expected.
- *
- * @throws javax.xml.transform.TransformerException
- */
- private final void consumeExpected(char expected)
- throws javax.xml.transform.TransformerException
- {
-
- if (tokenIs(expected))
- {
- nextToken();
- }
- else
- {
- error(XPATHErrorResources.ER_EXPECTED_BUT_FOUND,
- new Object[]{ String.valueOf(expected),
- m_token }); //"Expected "+expected+", but found: "+m_token);
-
- // Patch for Christina's gripe. She wants her errorHandler to return from
- // this error and continue trying to parse, rather than throwing an exception.
- // Without the patch, that put us into an endless loop.
- throw new XPathProcessorException(CONTINUE_AFTER_FATAL_ERROR);
- }
- }
-
- /**
- * Warn the user of a problem.
- *
- * @param msg An error msgkey that corresponds to one of the constants found
- * in {@link com.sun.org.apache.xpath.internal.res.XPATHErrorResources}, which is
- * a key for a format string.
- * @param args An array of arguments represented in the format string, which
- * may be null.
- *
- * @throws TransformerException if the current ErrorListoner determines to
- * throw an exception.
- */
- void warn(String msg, Object[] args) throws TransformerException
- {
-
- String fmsg = XSLMessages.createXPATHWarning(msg, args);
- ErrorListener ehandler = this.getErrorListener();
-
- if (null != ehandler)
- {
- // TO DO: Need to get stylesheet Locator from here.
- ehandler.warning(new TransformerException(fmsg, m_sourceLocator));
- }
- else
- {
- // Should never happen.
- System.err.println(fmsg);
- }
- }
-
- /**
- * Notify the user of an assertion error, and probably throw an
- * exception.
- *
- * @param b If false, a runtime exception will be thrown.
- * @param msg The assertion message, which should be informative.
- *
- * @throws RuntimeException if the b argument is false.
- */
- private void assertion(boolean b, String msg)
- {
-
- if (!b)
- {
- String fMsg = XSLMessages.createXPATHMessage(
- XPATHErrorResources.ER_INCORRECT_PROGRAMMER_ASSERTION,
- new Object[]{ msg });
-
- throw new RuntimeException(fMsg);
- }
- }
-
- /**
- * Notify the user of an error, and probably throw an
- * exception.
- *
- * @param msg An error msgkey that corresponds to one of the constants found
- * in {@link com.sun.org.apache.xpath.internal.res.XPATHErrorResources}, which is
- * a key for a format string.
- * @param args An array of arguments represented in the format string, which
- * may be null.
- *
- * @throws TransformerException if the current ErrorListoner determines to
- * throw an exception.
- */
- void error(String msg, Object[] args) throws TransformerException
- {
-
- String fmsg = XSLMessages.createXPATHMessage(msg, args);
- ErrorListener ehandler = this.getErrorListener();
-
- TransformerException te = new TransformerException(fmsg, m_sourceLocator);
- if (null != ehandler)
- {
- // TO DO: Need to get stylesheet Locator from here.
- ehandler.fatalError(te);
- }
- else
- {
- // System.err.println(fmsg);
- throw te;
- }
- }
-
- /**
- * This method is added to support DOM 3 XPath API.
- * <p>
- * This method is exactly like error(String, Object[]); except that
- * the underlying TransformerException is
- * XpathStylesheetDOM3Exception (which extends TransformerException).
- * <p>
- * So older XPath code in Xalan is not affected by this. To older XPath code
- * the behavior of whether error() or errorForDOM3() is called because it is
- * always catching TransformerException objects and is oblivious to
- * the new subclass of XPathStylesheetDOM3Exception. Older XPath code
- * runs as before.
- * <p>
- * However, newer DOM3 XPath code upon catching a TransformerException can
- * can check if the exception is an instance of XPathStylesheetDOM3Exception
- * and take appropriate action.
- *
- * @param msg An error msgkey that corresponds to one of the constants found
- * in {@link com.sun.org.apache.xpath.internal.res.XPATHErrorResources}, which is
- * a key for a format string.
- * @param args An array of arguments represented in the format string, which
- * may be null.
- *
- * @throws TransformerException if the current ErrorListoner determines to
- * throw an exception.
- */
- void errorForDOM3(String msg, Object[] args) throws TransformerException
- {
-
- String fmsg = XSLMessages.createXPATHMessage(msg, args);
- ErrorListener ehandler = this.getErrorListener();
-
- TransformerException te = new XPathStylesheetDOM3Exception(fmsg, m_sourceLocator);
- if (null != ehandler)
- {
- // TO DO: Need to get stylesheet Locator from here.
- ehandler.fatalError(te);
- }
- else
- {
- // System.err.println(fmsg);
- throw te;
- }
- }
- /**
- * Dump the remaining token queue.
- * Thanks to Craig for this.
- *
- * @return A dump of the remaining token queue, which may be appended to
- * an error message.
- */
- protected String dumpRemainingTokenQueue()
- {
-
- int q = m_queueMark;
- String returnMsg;
-
- if (q < m_ops.getTokenQueueSize())
- {
- String msg = "\n Remaining tokens: (";
-
- while (q < m_ops.getTokenQueueSize())
- {
- String t = (String) m_ops.m_tokenQueue.elementAt(q++);
-
- msg += (" '" + t + "'");
- }
-
- returnMsg = msg + ")";
- }
- else
- {
- returnMsg = "";
- }
-
- return returnMsg;
- }
-
- /**
- * Given a string, return the corresponding function token.
- *
- * @param key A local name of a function.
- *
- * @return The function ID, which may correspond to one of the FUNC_XXX
- * values found in {@link com.sun.org.apache.xpath.internal.compiler.FunctionTable}, but may
- * be a value installed by an external module.
- */
- final int getFunctionToken(String key)
- {
-
- int tok;
-
- Object id;
-
- try
- {
- // These are nodetests, xpathparser treats them as functions when parsing
- // a FilterExpr.
- id = Keywords.lookupNodeTest(key);
- if (null == id) id = m_functionTable.getFunctionID(key);
- tok = ((Integer) id).intValue();
- }
- catch (NullPointerException npe)
- {
- tok = -1;
- }
- catch (ClassCastException cce)
- {
- tok = -1;
- }
-
- return tok;
- }
-
- /**
- * Insert room for operation. This will NOT set
- * the length value of the operation, but will update
- * the length value for the total expression.
- *
- * @param pos The position where the op is to be inserted.
- * @param length The length of the operation space in the op map.
- * @param op The op code to the inserted.
- */
- void insertOp(int pos, int length, int op)
- {
-
- int totalLen = m_ops.getOp(OpMap.MAPINDEX_LENGTH);
-
- for (int i = totalLen - 1; i >= pos; i--)
- {
- m_ops.setOp(i + length, m_ops.getOp(i));
- }
-
- m_ops.setOp(pos,op);
- m_ops.setOp(OpMap.MAPINDEX_LENGTH,totalLen + length);
- }
-
- /**
- * Insert room for operation. This WILL set
- * the length value of the operation, and will update
- * the length value for the total expression.
- *
- * @param length The length of the operation.
- * @param op The op code to the inserted.
- */
- void appendOp(int length, int op)
- {
-
- int totalLen = m_ops.getOp(OpMap.MAPINDEX_LENGTH);
-
- m_ops.setOp(totalLen, op);
- m_ops.setOp(totalLen + OpMap.MAPINDEX_LENGTH, length);
- m_ops.setOp(OpMap.MAPINDEX_LENGTH, totalLen + length);
- }
-
- // ============= EXPRESSIONS FUNCTIONS =================
-
- /**
- *
- *
- * Expr ::= OrExpr
- *
- *
- * @throws javax.xml.transform.TransformerException
- */
- protected void Expr() throws javax.xml.transform.TransformerException
- {
- OrExpr();
- }
-
- /**
- *
- *
- * OrExpr ::= AndExpr
- * | OrExpr 'or' AndExpr
- *
- *
- * @throws javax.xml.transform.TransformerException
- */
- protected void OrExpr() throws javax.xml.transform.TransformerException
- {
-
- int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH);
-
- AndExpr();
-
- if ((null != m_token) && tokenIs("or"))
- {
- nextToken();
- insertOp(opPos, 2, OpCodes.OP_OR);
- OrExpr();
-
- m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH,
- m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos);
- }
- }
-
- /**
- *
- *
- * AndExpr ::= EqualityExpr
- * | AndExpr 'and' EqualityExpr
- *
- *
- * @throws javax.xml.transform.TransformerException
- */
- protected void AndExpr() throws javax.xml.transform.TransformerException
- {
-
- int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH);
-
- EqualityExpr(-1);
-
- if ((null != m_token) && tokenIs("and"))
- {
- nextToken();
- insertOp(opPos, 2, OpCodes.OP_AND);
- AndExpr();
-
- m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH,
- m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos);
- }
- }
-
- /**
- *
- * @returns an Object which is either a String, a Number, a Boolean, or a vector
- * of nodes.
- *
- * EqualityExpr ::= RelationalExpr
- * | EqualityExpr '=' RelationalExpr
- *
- *
- * @param addPos Position where expression is to be added, or -1 for append.
- *
- * @return the position at the end of the equality expression.
- *
- * @throws javax.xml.transform.TransformerException
- */
- protected int EqualityExpr(int addPos) throws javax.xml.transform.TransformerException
- {
-
- int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH);
-
- if (-1 == addPos)
- addPos = opPos;
-
- RelationalExpr(-1);
-
- if (null != m_token)
- {
- if (tokenIs('!') && lookahead('=', 1))
- {
- nextToken();
- nextToken();
- insertOp(addPos, 2, OpCodes.OP_NOTEQUALS);
-
- int opPlusLeftHandLen = m_ops.getOp(OpMap.MAPINDEX_LENGTH) - addPos;
-
- addPos = EqualityExpr(addPos);
- m_ops.setOp(addPos + OpMap.MAPINDEX_LENGTH,
- m_ops.getOp(addPos + opPlusLeftHandLen + 1) + opPlusLeftHandLen);
- addPos += 2;
- }
- else if (tokenIs('='))
- {
- nextToken();
- insertOp(addPos, 2, OpCodes.OP_EQUALS);
-
- int opPlusLeftHandLen = m_ops.getOp(OpMap.MAPINDEX_LENGTH) - addPos;
-
- addPos = EqualityExpr(addPos);
- m_ops.setOp(addPos + OpMap.MAPINDEX_LENGTH,
- m_ops.getOp(addPos + opPlusLeftHandLen + 1) + opPlusLeftHandLen);
- addPos += 2;
- }
- }
-
- return addPos;
- }
-
- /**
- * .
- * @returns an Object which is either a String, a Number, a Boolean, or a vector
- * of nodes.
- *
- * RelationalExpr ::= AdditiveExpr
- * | RelationalExpr '<' AdditiveExpr
- * | RelationalExpr '>' AdditiveExpr
- * | RelationalExpr '<=' AdditiveExpr
- * | RelationalExpr '>=' AdditiveExpr
- *
- *
- * @param addPos Position where expression is to be added, or -1 for append.
- *
- * @return the position at the end of the relational expression.
- *
- * @throws javax.xml.transform.TransformerException
- */
- protected int RelationalExpr(int addPos) throws javax.xml.transform.TransformerException
- {
-
- int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH);
-
- if (-1 == addPos)
- addPos = opPos;
-
- AdditiveExpr(-1);
-
- if (null != m_token)
- {
- if (tokenIs('<'))
- {
- nextToken();
-
- if (tokenIs('='))
- {
- nextToken();
- insertOp(addPos, 2, OpCodes.OP_LTE);
- }
- else
- {
- insertOp(addPos, 2, OpCodes.OP_LT);
- }
-
- int opPlusLeftHandLen = m_ops.getOp(OpMap.MAPINDEX_LENGTH) - addPos;
-
- addPos = RelationalExpr(addPos);
- m_ops.setOp(addPos + OpMap.MAPINDEX_LENGTH,
- m_ops.getOp(addPos + opPlusLeftHandLen + 1) + opPlusLeftHandLen);
- addPos += 2;
- }
- else if (tokenIs('>'))
- {
- nextToken();
-
- if (tokenIs('='))
- {
- nextToken();
- insertOp(addPos, 2, OpCodes.OP_GTE);
- }
- else
- {
- insertOp(addPos, 2, OpCodes.OP_GT);
- }
-
- int opPlusLeftHandLen = m_ops.getOp(OpMap.MAPINDEX_LENGTH) - addPos;
-
- addPos = RelationalExpr(addPos);
- m_ops.setOp(addPos + OpMap.MAPINDEX_LENGTH,
- m_ops.getOp(addPos + opPlusLeftHandLen + 1) + opPlusLeftHandLen);
- addPos += 2;
- }
- }
-
- return addPos;
- }
-
- /**
- * This has to handle construction of the operations so that they are evaluated
- * in pre-fix order. So, for 9+7-6, instead of |+|9|-|7|6|, this needs to be
- * evaluated as |-|+|9|7|6|.
- *
- * AdditiveExpr ::= MultiplicativeExpr
- * | AdditiveExpr '+' MultiplicativeExpr
- * | AdditiveExpr '-' MultiplicativeExpr
- *
- *
- * @param addPos Position where expression is to be added, or -1 for append.
- *
- * @return the position at the end of the equality expression.
- *
- * @throws javax.xml.transform.TransformerException
- */
- protected int AdditiveExpr(int addPos) throws javax.xml.transform.TransformerException
- {
-
- int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH);
-
- if (-1 == addPos)
- addPos = opPos;
-
- MultiplicativeExpr(-1);
-
- if (null != m_token)
- {
- if (tokenIs('+'))
- {
- nextToken();
- insertOp(addPos, 2, OpCodes.OP_PLUS);
-
- int opPlusLeftHandLen = m_ops.getOp(OpMap.MAPINDEX_LENGTH) - addPos;
-
- addPos = AdditiveExpr(addPos);
- m_ops.setOp(addPos + OpMap.MAPINDEX_LENGTH,
- m_ops.getOp(addPos + opPlusLeftHandLen + 1) + opPlusLeftHandLen);
- addPos += 2;
- }
- else if (tokenIs('-'))
- {
- nextToken();
- insertOp(addPos, 2, OpCodes.OP_MINUS);
-
- int opPlusLeftHandLen = m_ops.getOp(OpMap.MAPINDEX_LENGTH) - addPos;
-
- addPos = AdditiveExpr(addPos);
- m_ops.setOp(addPos + OpMap.MAPINDEX_LENGTH,
- m_ops.getOp(addPos + opPlusLeftHandLen + 1) + opPlusLeftHandLen);
- addPos += 2;
- }
- }
-
- return addPos;
- }
-
- /**
- * This has to handle construction of the operations so that they are evaluated
- * in pre-fix order. So, for 9+7-6, instead of |+|9|-|7|6|, this needs to be
- * evaluated as |-|+|9|7|6|.
- *
- * MultiplicativeExpr ::= UnaryExpr
- * | MultiplicativeExpr MultiplyOperator UnaryExpr
- * | MultiplicativeExpr 'div' UnaryExpr
- * | MultiplicativeExpr 'mod' UnaryExpr
- * | MultiplicativeExpr 'quo' UnaryExpr
- *
- * @param addPos Position where expression is to be added, or -1 for append.
- *
- * @return the position at the end of the equality expression.
- *
- * @throws javax.xml.transform.TransformerException
- */
- protected int MultiplicativeExpr(int addPos) throws javax.xml.transform.TransformerException
- {
-
- int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH);
-
- if (-1 == addPos)
- addPos = opPos;
-
- UnaryExpr();
-
- if (null != m_token)
- {
- if (tokenIs('*'))
- {
- nextToken();
- insertOp(addPos, 2, OpCodes.OP_MULT);
-
- int opPlusLeftHandLen = m_ops.getOp(OpMap.MAPINDEX_LENGTH) - addPos;
-
- addPos = MultiplicativeExpr(addPos);
- m_ops.setOp(addPos + OpMap.MAPINDEX_LENGTH,
- m_ops.getOp(addPos + opPlusLeftHandLen + 1) + opPlusLeftHandLen);
- addPos += 2;
- }
- else if (tokenIs("div"))
- {
- nextToken();
- insertOp(addPos, 2, OpCodes.OP_DIV);
-
- int opPlusLeftHandLen = m_ops.getOp(OpMap.MAPINDEX_LENGTH) - addPos;
-
- addPos = MultiplicativeExpr(addPos);
- m_ops.setOp(addPos + OpMap.MAPINDEX_LENGTH,
- m_ops.getOp(addPos + opPlusLeftHandLen + 1) + opPlusLeftHandLen);
- addPos += 2;
- }
- else if (tokenIs("mod"))
- {
- nextToken();
- insertOp(addPos, 2, OpCodes.OP_MOD);
-
- int opPlusLeftHandLen = m_ops.getOp(OpMap.MAPINDEX_LENGTH) - addPos;
-
- addPos = MultiplicativeExpr(addPos);
- m_ops.setOp(addPos + OpMap.MAPINDEX_LENGTH,
- m_ops.getOp(addPos + opPlusLeftHandLen + 1) + opPlusLeftHandLen);
- addPos += 2;
- }
- else if (tokenIs("quo"))
- {
- nextToken();
- insertOp(addPos, 2, OpCodes.OP_QUO);
-
- int opPlusLeftHandLen = m_ops.getOp(OpMap.MAPINDEX_LENGTH) - addPos;
-
- addPos = MultiplicativeExpr(addPos);
- m_ops.setOp(addPos + OpMap.MAPINDEX_LENGTH,
- m_ops.getOp(addPos + opPlusLeftHandLen + 1) + opPlusLeftHandLen);
- addPos += 2;
- }
- }
-
- return addPos;
- }
-
- /**
- *
- * UnaryExpr ::= UnionExpr
- * | '-' UnaryExpr
- *
- *
- * @throws javax.xml.transform.TransformerException
- */
- protected void UnaryExpr() throws javax.xml.transform.TransformerException
- {
-
- int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH);
- boolean isNeg = false;
-
- if (m_tokenChar == '-')
- {
- nextToken();
- appendOp(2, OpCodes.OP_NEG);
-
- isNeg = true;
- }
-
- UnionExpr();
-
- if (isNeg)
- m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH,
- m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos);
- }
-
- /**
- *
- * StringExpr ::= Expr
- *
- *
- * @throws javax.xml.transform.TransformerException
- */
- protected void StringExpr() throws javax.xml.transform.TransformerException
- {
-
- int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH);
-
- appendOp(2, OpCodes.OP_STRING);
- Expr();
-
- m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH,
- m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos);
- }
-
- /**
- *
- *
- * StringExpr ::= Expr
- *
- *
- * @throws javax.xml.transform.TransformerException
- */
- protected void BooleanExpr() throws javax.xml.transform.TransformerException
- {
-
- int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH);
-
- appendOp(2, OpCodes.OP_BOOL);
- Expr();
-
- int opLen = m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos;
-
- if (opLen == 2)
- {
- error(XPATHErrorResources.ER_BOOLEAN_ARG_NO_LONGER_OPTIONAL, null); //"boolean(...) argument is no longer optional with 19990709 XPath draft.");
- }
-
- m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH, opLen);
- }
-
- /**
- *
- *
- * NumberExpr ::= Expr
- *
- *
- * @throws javax.xml.transform.TransformerException
- */
- protected void NumberExpr() throws javax.xml.transform.TransformerException
- {
-
- int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH);
-
- appendOp(2, OpCodes.OP_NUMBER);
- Expr();
-
- m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH,
- m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos);
- }
-
- /**
- * The context of the right hand side expressions is the context of the
- * left hand side expression. The results of the right hand side expressions
- * are node sets. The result of the left hand side UnionExpr is the union
- * of the results of the right hand side expressions.
- *
- *
- * UnionExpr ::= PathExpr
- * | UnionExpr '|' PathExpr
- *
- *
- * @throws javax.xml.transform.TransformerException
- */
- protected void UnionExpr() throws javax.xml.transform.TransformerException
- {
-
- int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH);
- boolean continueOrLoop = true;
- boolean foundUnion = false;
-
- do
- {
- PathExpr();
-
- if (tokenIs('|'))
- {
- if (false == foundUnion)
- {
- foundUnion = true;
-
- insertOp(opPos, 2, OpCodes.OP_UNION);
- }
-
- nextToken();
- }
- else
- {
- break;
- }
-
- // this.m_testForDocOrder = true;
- }
- while (continueOrLoop);
-
- m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH,
- m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos);
- }
-
- /**
- * PathExpr ::= LocationPath
- * | FilterExpr
- * | FilterExpr '/' RelativeLocationPath
- * | FilterExpr '//' RelativeLocationPath
- *
- * @throws XSLProcessorException thrown if the active ProblemListener and XPathContext decide
- * the error condition is severe enough to halt processing.
- *
- * @throws javax.xml.transform.TransformerException
- */
- protected void PathExpr() throws javax.xml.transform.TransformerException
- {
-
- int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH);
-
- int filterExprMatch = FilterExpr();
-
- if (filterExprMatch != FILTER_MATCH_FAILED)
- {
- // If FilterExpr had Predicates, a OP_LOCATIONPATH opcode would already
- // have been inserted.
- boolean locationPathStarted = (filterExprMatch==FILTER_MATCH_PREDICATES);
-
- if (tokenIs('/'))
- {
- nextToken();
-
- if (!locationPathStarted)
- {
- // int locationPathOpPos = opPos;
- insertOp(opPos, 2, OpCodes.OP_LOCATIONPATH);
-
- locationPathStarted = true;
- }
-
- if (!RelativeLocationPath())
- {
- // "Relative location path expected following '/' or '//'"
- error(XPATHErrorResources.ER_EXPECTED_REL_LOC_PATH, null);
- }
-
- }
-
- // Terminate for safety.
- if (locationPathStarted)
- {
- m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), OpCodes.ENDOP);
- m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1);
- m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH,
- m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos);
- }
- }
- else
- {
- LocationPath();
- }
- }
-
- /**
- *
- *
- * FilterExpr ::= PrimaryExpr
- * | FilterExpr Predicate
- *
- * @throws XSLProcessorException thrown if the active ProblemListener and XPathContext decide
- * the error condition is severe enough to halt processing.
- *
- * @return FILTER_MATCH_PREDICATES, if this method successfully matched a
- * FilterExpr with one or more Predicates;
- * FILTER_MATCH_PRIMARY, if this method successfully matched a
- * FilterExpr that was just a PrimaryExpr; or
- * FILTER_MATCH_FAILED, if this method did not match a FilterExpr
- *
- * @throws javax.xml.transform.TransformerException
- */
- protected int FilterExpr() throws javax.xml.transform.TransformerException
- {
-
- int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH);
-
- int filterMatch;
-
- if (PrimaryExpr())
- {
- if (tokenIs('['))
- {
-
- // int locationPathOpPos = opPos;
- insertOp(opPos, 2, OpCodes.OP_LOCATIONPATH);
-
- while (tokenIs('['))
- {
- Predicate();
- }
-
- filterMatch = FILTER_MATCH_PREDICATES;
- }
- else
- {
- filterMatch = FILTER_MATCH_PRIMARY;
- }
- }
- else
- {
- filterMatch = FILTER_MATCH_FAILED;
- }
-
- return filterMatch;
-
- /*
- * if(tokenIs('['))
- * {
- * Predicate();
- * m_ops.m_opMap[opPos + OpMap.MAPINDEX_LENGTH] = m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - opPos;
- * }
- */
- }
-
- /**
- *
- * PrimaryExpr ::= VariableReference
- * | '(' Expr ')'
- * | Literal
- * | Number
- * | FunctionCall
- *
- * @return true if this method successfully matched a PrimaryExpr
- *
- * @throws javax.xml.transform.TransformerException
- *
- */
- protected boolean PrimaryExpr() throws javax.xml.transform.TransformerException
- {
-
- boolean matchFound;
- int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH);
-
- if ((m_tokenChar == '\'') || (m_tokenChar == '"'))
- {
- appendOp(2, OpCodes.OP_LITERAL);
- Literal();
-
- m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH,
- m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos);
-
- matchFound = true;
- }
- else if (m_tokenChar == '$')
- {
- nextToken(); // consume '$'
- appendOp(2, OpCodes.OP_VARIABLE);
- QName();
-
- m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH,
- m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos);
-
- matchFound = true;
- }
- else if (m_tokenChar == '(')
- {
- nextToken();
- appendOp(2, OpCodes.OP_GROUP);
- Expr();
- consumeExpected(')');
-
- m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH,
- m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos);
-
- matchFound = true;
- }
- else if ((null != m_token) && ((('.' == m_tokenChar) && (m_token.length() > 1) && Character.isDigit(
- m_token.charAt(1))) || Character.isDigit(m_tokenChar)))
- {
- appendOp(2, OpCodes.OP_NUMBERLIT);
- Number();
-
- m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH,
- m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos);
-
- matchFound = true;
- }
- else if (lookahead('(', 1) || (lookahead(':', 1) && lookahead('(', 3)))
- {
- matchFound = FunctionCall();
- }
- else
- {
- matchFound = false;
- }
-
- return matchFound;
- }
-
- /**
- *
- * Argument ::= Expr
- *
- *
- * @throws javax.xml.transform.TransformerException
- */
- protected void Argument() throws javax.xml.transform.TransformerException
- {
-
- int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH);
-
- appendOp(2, OpCodes.OP_ARGUMENT);
- Expr();
-
- m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH,
- m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos);
- }
-
- /**
- *
- * FunctionCall ::= FunctionName '(' ( Argument ( ',' Argument)*)? ')'
- *
- * @return true if, and only if, a FunctionCall was matched
- *
- * @throws javax.xml.transform.TransformerException
- */
- protected boolean FunctionCall() throws javax.xml.transform.TransformerException
- {
-
- int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH);
-
- if (lookahead(':', 1))
- {
- appendOp(4, OpCodes.OP_EXTFUNCTION);
-
- m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH + 1, m_queueMark - 1);
-
- nextToken();
- consumeExpected(':');
-
- m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH + 2, m_queueMark - 1);
-
- nextToken();
- }
- else
- {
- int funcTok = getFunctionToken(m_token);
-
- if (-1 == funcTok)
- {
- error(XPATHErrorResources.ER_COULDNOT_FIND_FUNCTION,
- new Object[]{ m_token }); //"Could not find function: "+m_token+"()");
- }
-
- switch (funcTok)
- {
- case OpCodes.NODETYPE_PI :
- case OpCodes.NODETYPE_COMMENT :
- case OpCodes.NODETYPE_TEXT :
- case OpCodes.NODETYPE_NODE :
- // Node type tests look like function calls, but they're not
- return false;
- default :
- appendOp(3, OpCodes.OP_FUNCTION);
-
- m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH + 1, funcTok);
- }
-
- nextToken();
- }
-
- consumeExpected('(');
-
- while (!tokenIs(')') && m_token != null)
- {
- if (tokenIs(','))
- {
- error(XPATHErrorResources.ER_FOUND_COMMA_BUT_NO_PRECEDING_ARG, null); //"Found ',' but no preceding argument!");
- }
-
- Argument();
-
- if (!tokenIs(')'))
- {
- consumeExpected(',');
-
- if (tokenIs(')'))
- {
- error(XPATHErrorResources.ER_FOUND_COMMA_BUT_NO_FOLLOWING_ARG,
- null); //"Found ',' but no following argument!");
- }
- }
- }
-
- consumeExpected(')');
-
- // Terminate for safety.
- m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), OpCodes.ENDOP);
- m_ops.setOp(OpMap.MAPINDEX_LENGTH,m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1);
- m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH,
- m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos);
-
- return true;
- }
-
- // ============= GRAMMAR FUNCTIONS =================
-
- /**
- *
- * LocationPath ::= RelativeLocationPath
- * | AbsoluteLocationPath
- *
- *
- * @throws javax.xml.transform.TransformerException
- */
- protected void LocationPath() throws javax.xml.transform.TransformerException
- {
-
- int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH);
-
- // int locationPathOpPos = opPos;
- appendOp(2, OpCodes.OP_LOCATIONPATH);
-
- boolean seenSlash = tokenIs('/');
-
- if (seenSlash)
- {
- appendOp(4, OpCodes.FROM_ROOT);
-
- // Tell how long the step is without the predicate
- m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH) - 2, 4);
- m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH) - 1, OpCodes.NODETYPE_ROOT);
-
- nextToken();
- } else if (m_token == null) {
- error(XPATHErrorResources.ER_EXPECTED_LOC_PATH_AT_END_EXPR, null);
- }
-
- if (m_token != null)
- {
- if (!RelativeLocationPath() && !seenSlash)
- {
- // Neither a '/' nor a RelativeLocationPath - i.e., matched nothing
- // "Location path expected, but found "+m_token+" was encountered."
- error(XPATHErrorResources.ER_EXPECTED_LOC_PATH,
- new Object [] {m_token});
- }
- }
-
- // Terminate for safety.
- m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), OpCodes.ENDOP);
- m_ops.setOp(OpMap.MAPINDEX_LENGTH,m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1);
- m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH,
- m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos);
- }
-
- /**
- *
- * RelativeLocationPath ::= Step
- * | RelativeLocationPath '/' Step
- * | AbbreviatedRelativeLocationPath
- *
- * @returns true if, and only if, a RelativeLocationPath was matched
- *
- * @throws javax.xml.transform.TransformerException
- */
- protected boolean RelativeLocationPath()
- throws javax.xml.transform.TransformerException
- {
- if (!Step())
- {
- return false;
- }
-
- while (tokenIs('/'))
- {
- nextToken();
-
- if (!Step())
- {
- // RelativeLocationPath can't end with a trailing '/'
- // "Location step expected following '/' or '//'"
- error(XPATHErrorResources.ER_EXPECTED_LOC_STEP, null);
- }
- }
-
- return true;
- }
-
- /**
- *
- * Step ::= Basis Predicate
- * | AbbreviatedStep
- *
- * @returns false if step was empty (or only a '/'); true, otherwise
- *
- * @throws javax.xml.transform.TransformerException
- */
- protected boolean Step() throws javax.xml.transform.TransformerException
- {
- int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH);
-
- boolean doubleSlash = tokenIs('/');
-
- // At most a single '/' before each Step is consumed by caller; if the
- // first thing is a '/', that means we had '//' and the Step must not
- // be empty.
- if (doubleSlash)
- {
- nextToken();
-
- appendOp(2, OpCodes.FROM_DESCENDANTS_OR_SELF);
-
- // Have to fix up for patterns such as '//@foo' or '//attribute::foo',
- // which translate to 'descendant-or-self::node()/attribute::foo'.
- // notice I leave the '/' on the queue, so the next will be processed
- // by a regular step pattern.
-
- // Make room for telling how long the step is without the predicate
- m_ops.setOp(OpMap.MAPINDEX_LENGTH,m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1);
- m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), OpCodes.NODETYPE_NODE);
- m_ops.setOp(OpMap.MAPINDEX_LENGTH,m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1);
-
- // Tell how long the step is without the predicate
- m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH + 1,
- m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos);
-
- // Tell how long the step is with the predicate
- m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH,
- m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos);
-
- opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH);
- }
-
- if (tokenIs("."))
- {
- nextToken();
-
- if (tokenIs('['))
- {
- error(XPATHErrorResources.ER_PREDICATE_ILLEGAL_SYNTAX, null); //"'..[predicate]' or '.[predicate]' is illegal syntax. Use 'self::node()[predicate]' instead.");
- }
-
- appendOp(4, OpCodes.FROM_SELF);
-
- // Tell how long the step is without the predicate
- m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH) - 2,4);
- m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH) - 1, OpCodes.NODETYPE_NODE);
- }
- else if (tokenIs(".."))
- {
- nextToken();
- appendOp(4, OpCodes.FROM_PARENT);
-
- // Tell how long the step is without the predicate
- m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH) - 2,4);
- m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH) - 1, OpCodes.NODETYPE_NODE);
- }
-
- // There is probably a better way to test for this
- // transition... but it gets real hairy if you try
- // to do it in basis().
- else if (tokenIs('*') || tokenIs('@') || tokenIs('_')
- || (m_token!= null && Character.isLetter(m_token.charAt(0))))
- {
- Basis();
-
- while (tokenIs('['))
- {
- Predicate();
- }
-
- // Tell how long the entire step is.
- m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH,
- m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos);
- }
- else
- {
- // No Step matched - that's an error if previous thing was a '//'
- if (doubleSlash)
- {
- // "Location step expected following '/' or '//'"
- error(XPATHErrorResources.ER_EXPECTED_LOC_STEP, null);
- }
-
- return false;
- }
-
- return true;
- }
-
- /**
- *
- * Basis ::= AxisName '::' NodeTest
- * | AbbreviatedBasis
- *
- * @throws javax.xml.transform.TransformerException
- */
- protected void Basis() throws javax.xml.transform.TransformerException
- {
-
- int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH);
- int axesType;
-
- // The next blocks guarantee that a FROM_XXX will be added.
- if (lookahead("::", 1))
- {
- axesType = AxisName();
-
- nextToken();
- nextToken();
- }
- else if (tokenIs('@'))
- {
- axesType = OpCodes.FROM_ATTRIBUTES;
-
- appendOp(2, axesType);
- nextToken();
- }
- else
- {
- axesType = OpCodes.FROM_CHILDREN;
-
- appendOp(2, axesType);
- }
-
- // Make room for telling how long the step is without the predicate
- m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1);
-
- NodeTest(axesType);
-
- // Tell how long the step is without the predicate
- m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH + 1,
- m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos);
- }
-
- /**
- *
- * Basis ::= AxisName '::' NodeTest
- * | AbbreviatedBasis
- *
- * @return FROM_XXX axes type, found in {@link com.sun.org.apache.xpath.internal.compiler.Keywords}.
- *
- * @throws javax.xml.transform.TransformerException
- */
- protected int AxisName() throws javax.xml.transform.TransformerException
- {
-
- Object val = Keywords.getAxisName(m_token);
-
- if (null == val)
- {
- error(XPATHErrorResources.ER_ILLEGAL_AXIS_NAME,
- new Object[]{ m_token }); //"illegal axis name: "+m_token);
- }
-
- int axesType = ((Integer) val).intValue();
-
- appendOp(2, axesType);
-
- return axesType;
- }
-
- /**
- *
- * NodeTest ::= WildcardName
- * | NodeType '(' ')'
- * | 'processing-instruction' '(' Literal ')'
- *
- * @param axesType FROM_XXX axes type, found in {@link com.sun.org.apache.xpath.internal.compiler.Keywords}.
- *
- * @throws javax.xml.transform.TransformerException
- */
- protected void NodeTest(int axesType) throws javax.xml.transform.TransformerException
- {
-
- if (lookahead('(', 1))
- {
- Object nodeTestOp = Keywords.getNodeType(m_token);
-
- if (null == nodeTestOp)
- {
- error(XPATHErrorResources.ER_UNKNOWN_NODETYPE,
- new Object[]{ m_token }); //"Unknown nodetype: "+m_token);
- }
- else
- {
- nextToken();
-
- int nt = ((Integer) nodeTestOp).intValue();
-
- m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), nt);
- m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1);
-
- consumeExpected('(');
-
- if (OpCodes.NODETYPE_PI == nt)
- {
- if (!tokenIs(')'))
- {
- Literal();
- }
- }
-
- consumeExpected(')');
- }
- }
- else
- {
-
- // Assume name of attribute or element.
- m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), OpCodes.NODENAME);
- m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1);
-
- if (lookahead(':', 1))
- {
- if (tokenIs('*'))
- {
- m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), OpCodes.ELEMWILDCARD);
- }
- else
- {
- m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), m_queueMark - 1);
-
- // Minimalist check for an NCName - just check first character
- // to distinguish from other possible tokens
- if (!Character.isLetter(m_tokenChar) && !tokenIs('_'))
- {
- // "Node test that matches either NCName:* or QName was expected."
- error(XPATHErrorResources.ER_EXPECTED_NODE_TEST, null);
- }
- }
-
- nextToken();
- consumeExpected(':');
- }
- else
- {
- m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), OpCodes.EMPTY);
- }
-
- m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1);
-
- if (tokenIs('*'))
- {
- m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), OpCodes.ELEMWILDCARD);
- }
- else
- {
- m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), m_queueMark - 1);
-
- // Minimalist check for an NCName - just check first character
- // to distinguish from other possible tokens
- if (!Character.isLetter(m_tokenChar) && !tokenIs('_'))
- {
- // "Node test that matches either NCName:* or QName was expected."
- error(XPATHErrorResources.ER_EXPECTED_NODE_TEST, null);
- }
- }
-
- m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1);
-
- nextToken();
- }
- }
-
- /**
- *
- * Predicate ::= '[' PredicateExpr ']'
- *
- *
- * @throws javax.xml.transform.TransformerException
- */
- protected void Predicate() throws javax.xml.transform.TransformerException
- {
-
- if (tokenIs('['))
- {
- nextToken();
- PredicateExpr();
- consumeExpected(']');
- }
- }
-
- /**
- *
- * PredicateExpr ::= Expr
- *
- *
- * @throws javax.xml.transform.TransformerException
- */
- protected void PredicateExpr() throws javax.xml.transform.TransformerException
- {
-
- int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH);
-
- appendOp(2, OpCodes.OP_PREDICATE);
- Expr();
-
- // Terminate for safety.
- m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), OpCodes.ENDOP);
- m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1);
- m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH,
- m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos);
- }
-
- /**
- * QName ::= (Prefix ':')? LocalPart
- * Prefix ::= NCName
- * LocalPart ::= NCName
- *
- * @throws javax.xml.transform.TransformerException
- */
- protected void QName() throws javax.xml.transform.TransformerException
- {
- // Namespace
- if(lookahead(':', 1))
- {
- m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), m_queueMark - 1);
- m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1);
-
- nextToken();
- consumeExpected(':');
- }
- else
- {
- m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), OpCodes.EMPTY);
- m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1);
- }
-
- // Local name
- m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), m_queueMark - 1);
- m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1);
-
- nextToken();
- }
-
- /**
- * NCName ::= (Letter | '_') (NCNameChar)
- * NCNameChar ::= Letter | Digit | '.' | '-' | '_' | CombiningChar | Extender
- */
- protected void NCName()
- {
-
- m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), m_queueMark - 1);
- m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1);
-
- nextToken();
- }
-
- /**
- * The value of the Literal is the sequence of characters inside
- * the " or ' characters>.
- *
- * Literal ::= '"' [^"]* '"'
- * | "'" [^']* "'"
- *
- *
- * @throws javax.xml.transform.TransformerException
- */
- protected void Literal() throws javax.xml.transform.TransformerException
- {
-
- int last = m_token.length() - 1;
- char c0 = m_tokenChar;
- char cX = m_token.charAt(last);
-
- if (((c0 == '\"') && (cX == '\"')) || ((c0 == '\'') && (cX == '\'')))
- {
-
- // Mutate the token to remove the quotes and have the XString object
- // already made.
- int tokenQueuePos = m_queueMark - 1;
-
- m_ops.m_tokenQueue.setElementAt(null,tokenQueuePos);
-
- Object obj = new XString(m_token.substring(1, last));
-
- m_ops.m_tokenQueue.setElementAt(obj,tokenQueuePos);
-
- // lit = m_token.substring(1, last);
- m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), tokenQueuePos);
- m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1);
-
- nextToken();
- }
- else
- {
- error(XPATHErrorResources.ER_PATTERN_LITERAL_NEEDS_BE_QUOTED,
- new Object[]{ m_token }); //"Pattern literal ("+m_token+") needs to be quoted!");
- }
- }
-
- /**
- *
- * Number ::= [0-9]+('.'[0-9]+)? | '.'[0-9]+
- *
- *
- * @throws javax.xml.transform.TransformerException
- */
- protected void Number() throws javax.xml.transform.TransformerException
- {
-
- if (null != m_token)
- {
-
- // Mutate the token to remove the quotes and have the XNumber object
- // already made.
- double num;
-
- try
- {
- // XPath 1.0 does not support number in exp notation
- if ((m_token.indexOf('e') > -1)||(m_token.indexOf('E') > -1))
- throw new NumberFormatException();
- num = Double.valueOf(m_token).doubleValue();
- }
- catch (NumberFormatException nfe)
- {
- num = 0.0; // to shut up compiler.
-
- error(XPATHErrorResources.ER_COULDNOT_BE_FORMATTED_TO_NUMBER,
- new Object[]{ m_token }); //m_token+" could not be formatted to a number!");
- }
-
- m_ops.m_tokenQueue.setElementAt(new XNumber(num),m_queueMark - 1);
- m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), m_queueMark - 1);
- m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1);
-
- nextToken();
- }
- }
-
- // ============= PATTERN FUNCTIONS =================
-
- /**
- *
- * Pattern ::= LocationPathPattern
- * | Pattern '|' LocationPathPattern
- *
- *
- * @throws javax.xml.transform.TransformerException
- */
- protected void Pattern() throws javax.xml.transform.TransformerException
- {
-
- while (true)
- {
- LocationPathPattern();
-
- if (tokenIs('|'))
- {
- nextToken();
- }
- else
- {
- break;
- }
- }
- }
-
- /**
- *
- *
- * LocationPathPattern ::= '/' RelativePathPattern?
- * | IdKeyPattern (('/' | '//') RelativePathPattern)?
- * | '//'? RelativePathPattern
- *
- *
- * @throws javax.xml.transform.TransformerException
- */
- protected void LocationPathPattern() throws javax.xml.transform.TransformerException
- {
-
- int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH);
-
- final int RELATIVE_PATH_NOT_PERMITTED = 0;
- final int RELATIVE_PATH_PERMITTED = 1;
- final int RELATIVE_PATH_REQUIRED = 2;
-
- int relativePathStatus = RELATIVE_PATH_NOT_PERMITTED;
-
- appendOp(2, OpCodes.OP_LOCATIONPATHPATTERN);
-
- if (lookahead('(', 1)
- && (tokenIs(Keywords.FUNC_ID_STRING)
- || tokenIs(Keywords.FUNC_KEY_STRING)))
- {
- IdKeyPattern();
-
- if (tokenIs('/'))
- {
- nextToken();
-
- if (tokenIs('/'))
- {
- appendOp(4, OpCodes.MATCH_ANY_ANCESTOR);
-
- nextToken();
- }
- else
- {
- appendOp(4, OpCodes.MATCH_IMMEDIATE_ANCESTOR);
- }
-
- // Tell how long the step is without the predicate
- m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH) - 2, 4);
- m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH) - 1, OpCodes.NODETYPE_FUNCTEST);
-
- relativePathStatus = RELATIVE_PATH_REQUIRED;
- }
- }
- else if (tokenIs('/'))
- {
- if (lookahead('/', 1))
- {
- appendOp(4, OpCodes.MATCH_ANY_ANCESTOR);
-
- // Added this to fix bug reported by Myriam for match="//x/a"
- // patterns. If you don't do this, the 'x' step will think it's part
- // of a '//' pattern, and so will cause 'a' to be matched when it has
- // any ancestor that is 'x'.
- nextToken();
-
- relativePathStatus = RELATIVE_PATH_REQUIRED;
- }
- else
- {
- appendOp(4, OpCodes.FROM_ROOT);
-
- relativePathStatus = RELATIVE_PATH_PERMITTED;
- }
-
-
- // Tell how long the step is without the predicate
- m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH) - 2, 4);
- m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH) - 1, OpCodes.NODETYPE_ROOT);
-
- nextToken();
- }
- else
- {
- relativePathStatus = RELATIVE_PATH_REQUIRED;
- }
-
- if (relativePathStatus != RELATIVE_PATH_NOT_PERMITTED)
- {
- if (!tokenIs('|') && (null != m_token))
- {
- RelativePathPattern();
- }
- else if (relativePathStatus == RELATIVE_PATH_REQUIRED)
- {
- // "A relative path pattern was expected."
- error(XPATHErrorResources.ER_EXPECTED_REL_PATH_PATTERN, null);
- }
- }
-
- // Terminate for safety.
- m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), OpCodes.ENDOP);
- m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1);
- m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH,
- m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos);
- }
-
- /**
- *
- * IdKeyPattern ::= 'id' '(' Literal ')'
- * | 'key' '(' Literal ',' Literal ')'
- * (Also handle doc())
- *
- *
- * @throws javax.xml.transform.TransformerException
- */
- protected void IdKeyPattern() throws javax.xml.transform.TransformerException
- {
- FunctionCall();
- }
-
- /**
- *
- * RelativePathPattern ::= StepPattern
- * | RelativePathPattern '/' StepPattern
- * | RelativePathPattern '//' StepPattern
- *
- * @throws javax.xml.transform.TransformerException
- */
- protected void RelativePathPattern()
- throws javax.xml.transform.TransformerException
- {
-
- // Caller will have consumed any '/' or '//' preceding the
- // RelativePathPattern, so let StepPattern know it can't begin with a '/'
- boolean trailingSlashConsumed = StepPattern(false);
-
- while (tokenIs('/'))
- {
- nextToken();
-
- // StepPattern() may consume first slash of pair in "a//b" while
- // processing StepPattern "a". On next iteration, let StepPattern know
- // that happened, so it doesn't match ill-formed patterns like "a///b".
- trailingSlashConsumed = StepPattern(!trailingSlashConsumed);
- }
- }
-
- /**
- *
- * StepPattern ::= AbbreviatedNodeTestStep
- *
- * @param isLeadingSlashPermitted a boolean indicating whether a slash can
- * appear at the start of this step
- *
- * @return boolean indicating whether a slash following the step was consumed
- *
- * @throws javax.xml.transform.TransformerException
- */
- protected boolean StepPattern(boolean isLeadingSlashPermitted)
- throws javax.xml.transform.TransformerException
- {
- return AbbreviatedNodeTestStep(isLeadingSlashPermitted);
- }
-
- /**
- *
- * AbbreviatedNodeTestStep ::= '@'? NodeTest Predicate
- *
- * @param isLeadingSlashPermitted a boolean indicating whether a slash can
- * appear at the start of this step
- *
- * @return boolean indicating whether a slash following the step was consumed
- *
- * @throws javax.xml.transform.TransformerException
- */
- protected boolean AbbreviatedNodeTestStep(boolean isLeadingSlashPermitted)
- throws javax.xml.transform.TransformerException
- {
-
- int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH);
- int axesType;
-
- // The next blocks guarantee that a MATCH_XXX will be added.
- int matchTypePos = -1;
-
- if (tokenIs('@'))
- {
- axesType = OpCodes.MATCH_ATTRIBUTE;
-
- appendOp(2, axesType);
- nextToken();
- }
- else if (this.lookahead("::", 1))
- {
- if (tokenIs("attribute"))
- {
- axesType = OpCodes.MATCH_ATTRIBUTE;
-
- appendOp(2, axesType);
- }
- else if (tokenIs("child"))
- {
- matchTypePos = m_ops.getOp(OpMap.MAPINDEX_LENGTH);
- axesType = OpCodes.MATCH_IMMEDIATE_ANCESTOR;
-
- appendOp(2, axesType);
- }
- else
- {
- axesType = -1;
-
- this.error(XPATHErrorResources.ER_AXES_NOT_ALLOWED,
- new Object[]{ this.m_token });
- }
-
- nextToken();
- nextToken();
- }
- else if (tokenIs('/'))
- {
- if (!isLeadingSlashPermitted)
- {
- // "A step was expected in the pattern, but '/' was encountered."
- error(XPATHErrorResources.ER_EXPECTED_STEP_PATTERN, null);
- }
- axesType = OpCodes.MATCH_ANY_ANCESTOR;
-
- appendOp(2, axesType);
- nextToken();
- }
- else
- {
- matchTypePos = m_ops.getOp(OpMap.MAPINDEX_LENGTH);
- axesType = OpCodes.MATCH_IMMEDIATE_ANCESTOR;
-
- appendOp(2, axesType);
- }
-
- // Make room for telling how long the step is without the predicate
- m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1);
-
- NodeTest(axesType);
-
- // Tell how long the step is without the predicate
- m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH + 1,
- m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos);
-
- while (tokenIs('['))
- {
- Predicate();
- }
-
- boolean trailingSlashConsumed;
-
- // For "a//b", where "a" is current step, we need to mark operation of
- // current step as "MATCH_ANY_ANCESTOR". Then we'll consume the first
- // slash and subsequent step will be treated as a MATCH_IMMEDIATE_ANCESTOR
- // (unless it too is followed by '//'.)
- //
- // %REVIEW% Following is what happens today, but I'm not sure that's
- // %REVIEW% correct behaviour. Perhaps no valid case could be constructed
- // %REVIEW% where it would matter?
- //
- // If current step is on the attribute axis (e.g., "@x//b"), we won't
- // change the current step, and let following step be marked as
- // MATCH_ANY_ANCESTOR on next call instead.
- if ((matchTypePos > -1) && tokenIs('/') && lookahead('/', 1))
- {
- m_ops.setOp(matchTypePos, OpCodes.MATCH_ANY_ANCESTOR);
-
- nextToken();
-
- trailingSlashConsumed = true;
- }
- else
- {
- trailingSlashConsumed = false;
- }
-
- // Tell how long the entire step is.
- m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH,
- m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos);
-
- return trailingSlashConsumed;
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/compiler/package.html b/src/com/sun/org/apache/xpath/internal/compiler/package.html
deleted file mode 100644
index 0eb145f..0000000
--- a/src/com/sun/org/apache/xpath/internal/compiler/package.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!--
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
--->
-<!--
- * Copyright 2000-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
--->
-<html>
- <title>XPath parsing and compilation support Package.</title>
- <body>
- <p>Implements an XPath parser which produces an OpMap, and a so-called Compiler
- which produces an expression tree for fast evaluation.<p>
- </body>
-</html>
-
-
diff --git a/src/com/sun/org/apache/xpath/internal/domapi/XPathEvaluatorImpl.java b/src/com/sun/org/apache/xpath/internal/domapi/XPathEvaluatorImpl.java
deleted file mode 100644
index 096a232..0000000
--- a/src/com/sun/org/apache/xpath/internal/domapi/XPathEvaluatorImpl.java
+++ /dev/null
@@ -1,273 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2002-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XPathEvaluatorImpl.java,v 1.2.4.1 2005/09/10 04:04:07 jeffsuttor Exp $
- */
-
-package com.sun.org.apache.xpath.internal.domapi;
-
-import javax.xml.transform.TransformerException;
-
-import com.sun.org.apache.xml.internal.utils.PrefixResolver;
-import com.sun.org.apache.xpath.internal.XPath;
-import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
-import com.sun.org.apache.xpath.internal.res.XPATHMessages;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.xpath.XPathEvaluator;
-import org.w3c.dom.xpath.XPathException;
-import org.w3c.dom.xpath.XPathExpression;
-import org.w3c.dom.xpath.XPathNSResolver;
-
-/**
- *
- * The class provides an implementation of XPathEvaluator according
- * to the DOM L3 XPath Specification, Working Group Note 26 February 2004.
- *
- * <p>See also the <a href='http://www.w3.org/TR/2004/NOTE-DOM-Level-3-XPath-20040226'>Document Object Model (DOM) Level 3 XPath Specification</a>.</p>
- *
- * </p>The evaluation of XPath expressions is provided by
- * <code>XPathEvaluator</code>, which will provide evaluation of XPath 1.0
- * expressions with no specialized extension functions or variables. It is
- * expected that the <code>XPathEvaluator</code> interface will be
- * implemented on the same object which implements the <code>Document</code>
- * interface in an implementation which supports the XPath DOM module.
- * <code>XPathEvaluator</code> implementations may be available from other
- * sources that may provide support for special extension functions or
- * variables which are not defined in this specification.</p>
- *
- * @see org.w3c.dom.xpath.XPathEvaluator
- *
- * @xsl.usage internal
- */
-public final class XPathEvaluatorImpl implements XPathEvaluator {
-
- /**
- * This prefix resolver is created whenever null is passed to the
- * evaluate method. Its purpose is to satisfy the DOM L3 XPath API
- * requirement that if a null prefix resolver is used, an exception
- * should only be thrown when an attempt is made to resolve a prefix.
- */
- private class DummyPrefixResolver implements PrefixResolver {
-
- /**
- * Constructor for DummyPrefixResolver.
- */
- DummyPrefixResolver() {}
-
- /**
- * @exception DOMException
- * NAMESPACE_ERR: Always throws this exceptionn
- *
- * @see com.sun.org.apache.xml.internal.utils.PrefixResolver#getNamespaceForPrefix(String, Node)
- */
- public String getNamespaceForPrefix(String prefix, Node context) {
- String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_RESOLVER, null);
- throw new DOMException(DOMException.NAMESPACE_ERR, fmsg); // Unable to resolve prefix with null prefix resolver.
- }
-
- /**
- * @exception DOMException
- * NAMESPACE_ERR: Always throws this exceptionn
- *
- * @see com.sun.org.apache.xml.internal.utils.PrefixResolver#getNamespaceForPrefix(String)
- */
- public String getNamespaceForPrefix(String prefix) {
- return getNamespaceForPrefix(prefix,null);
- }
-
- /**
- * @see com.sun.org.apache.xml.internal.utils.PrefixResolver#handlesNullPrefixes()
- */
- public boolean handlesNullPrefixes() {
- return false;
- }
-
- /**
- * @see com.sun.org.apache.xml.internal.utils.PrefixResolver#getBaseIdentifier()
- */
- public String getBaseIdentifier() {
- return null;
- }
-
- }
-
- /**
- * The document to be searched to parallel the case where the XPathEvaluator
- * is obtained by casting a Document.
- */
- private final Document m_doc;
-
- /**
- * Constructor for XPathEvaluatorImpl.
- *
- * @param doc The document to be searched, to parallel the case where''
- * the XPathEvaluator is obtained by casting the document.
- */
- public XPathEvaluatorImpl(Document doc) {
- m_doc = doc;
- }
-
- /**
- * Constructor in the case that the XPath expression can be evaluated
- * without needing an XML document at all.
- *
- */
- public XPathEvaluatorImpl() {
- m_doc = null;
- }
-
- /**
- * Creates a parsed XPath expression with resolved namespaces. This is
- * useful when an expression will be reused in an application since it
- * makes it possible to compile the expression string into a more
- * efficient internal form and preresolve all namespace prefixes which
- * occur within the expression.
- *
- * @param expression The XPath expression string to be parsed.
- * @param resolver The <code>resolver</code> permits translation of
- * prefixes within the XPath expression into appropriate namespace URIs
- * . If this is specified as <code>null</code>, any namespace prefix
- * within the expression will result in <code>DOMException</code>
- * being thrown with the code <code>NAMESPACE_ERR</code>.
- * @return The compiled form of the XPath expression.
- * @exception XPathException
- * INVALID_EXPRESSION_ERR: Raised if the expression is not legal
- * according to the rules of the <code>XPathEvaluator</code>i
- * @exception DOMException
- * NAMESPACE_ERR: Raised if the expression contains namespace prefixes
- * which cannot be resolved by the specified
- * <code>XPathNSResolver</code>.
- *
- * @see org.w3c.dom.xpath.XPathEvaluator#createExpression(String, XPathNSResolver)
- */
- public XPathExpression createExpression(
- String expression,
- XPathNSResolver resolver)
- throws XPathException, DOMException {
-
- try {
-
- // If the resolver is null, create a dummy prefix resolver
- XPath xpath = new XPath(expression,null,
- ((null == resolver) ? new DummyPrefixResolver() : ((PrefixResolver)resolver)),
- XPath.SELECT);
-
- return new XPathExpressionImpl(xpath, m_doc);
-
- } catch (TransformerException e) {
- // Need to pass back exception code DOMException.NAMESPACE_ERR also.
- // Error found in DOM Level 3 XPath Test Suite.
- if(e instanceof XPathStylesheetDOM3Exception)
- throw new DOMException(DOMException.NAMESPACE_ERR,e.getMessageAndLocation());
- else
- throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,e.getMessageAndLocation());
-
- }
- }
-
- /**
- * Adapts any DOM node to resolve namespaces so that an XPath expression
- * can be easily evaluated relative to the context of the node where it
- * appeared within the document. This adapter works like the DOM Level 3
- * method <code>lookupNamespaceURI</code> on nodes in resolving the
- * namespaceURI from a given prefix using the current information available
- * in the node's hierarchy at the time lookupNamespaceURI is called, also
- * correctly resolving the implicit xml prefix.
- *
- * @param nodeResolver The node to be used as a context for namespace
- * resolution.
- * @return <code>XPathNSResolver</code> which resolves namespaces with
- * respect to the definitions in scope for a specified node.
- *
- * @see org.w3c.dom.xpath.XPathEvaluator#createNSResolver(Node)
- */
- public XPathNSResolver createNSResolver(Node nodeResolver) {
-
- return new XPathNSResolverImpl((nodeResolver.getNodeType() == Node.DOCUMENT_NODE)
- ? ((Document) nodeResolver).getDocumentElement() : nodeResolver);
- }
-
- /**
- * Evaluates an XPath expression string and returns a result of the
- * specified type if possible.
- *
- * @param expression The XPath expression string to be parsed and
- * evaluated.
- * @param contextNode The <code>context</code> is context node for the
- * evaluation of this XPath expression. If the XPathEvaluator was
- * obtained by casting the <code>Document</code> then this must be
- * owned by the same document and must be a <code>Document</code>,
- * <code>Element</code>, <code>Attribute</code>, <code>Text</code>,
- * <code>CDATASection</code>, <code>Comment</code>,
- * <code>ProcessingInstruction</code>, or <code>XPathNamespace</code>
- * node. If the context node is a <code>Text</code> or a
- * <code>CDATASection</code>, then the context is interpreted as the
- * whole logical text node as seen by XPath, unless the node is empty
- * in which case it may not serve as the XPath context.
- * @param resolver The <code>resolver</code> permits translation of
- * prefixes within the XPath expression into appropriate namespace URIs
- * . If this is specified as <code>null</code>, any namespace prefix
- * within the expression will result in <code>DOMException</code>
- * being thrown with the code <code>NAMESPACE_ERR</code>.
- * @param type If a specific <code>type</code> is specified, then the
- * result will be coerced to return the specified type relying on
- * XPath type conversions and fail if the desired coercion is not
- * possible. This must be one of the type codes of
- * <code>XPathResult</code>.
- * @param result The <code>result</code> specifies a specific result
- * object which may be reused and returned by this method. If this is
- * specified as <code>null</code>or the implementation does not reuse
- * the specified result, a new result object will be constructed and
- * returned.For XPath 1.0 results, this object will be of type
- * <code>XPathResult</code>.
- * @return The result of the evaluation of the XPath expression.For XPath
- * 1.0 results, this object will be of type <code>XPathResult</code>.
- * @exception XPathException
- * INVALID_EXPRESSION_ERR: Raised if the expression is not legal
- * according to the rules of the <code>XPathEvaluator</code>i
- * <br>TYPE_ERR: Raised if the result cannot be converted to return the
- * specified type.
- * @exception DOMException
- * NAMESPACE_ERR: Raised if the expression contains namespace prefixes
- * which cannot be resolved by the specified
- * <code>XPathNSResolver</code>.
- * <br>WRONG_DOCUMENT_ERR: The Node is from a document that is not
- * supported by this XPathEvaluator.
- * <br>NOT_SUPPORTED_ERR: The Node is not a type permitted as an XPath
- * context node.
- *
- * @see org.w3c.dom.xpath.XPathEvaluator#evaluate(String, Node, XPathNSResolver, short, XPathResult)
- */
- public Object evaluate(
- String expression,
- Node contextNode,
- XPathNSResolver resolver,
- short type,
- Object result)
- throws XPathException, DOMException {
-
- XPathExpression xpathExpression = createExpression(expression, resolver);
-
- return xpathExpression.evaluate(contextNode, type, result);
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/domapi/XPathExpressionImpl.java b/src/com/sun/org/apache/xpath/internal/domapi/XPathExpressionImpl.java
deleted file mode 100644
index 5c92d59..0000000
--- a/src/com/sun/org/apache/xpath/internal/domapi/XPathExpressionImpl.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2002-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XPathExpressionImpl.java,v 1.2.4.1 2005/09/10 04:06:55 jeffsuttor Exp $
- */
-
-
-package com.sun.org.apache.xpath.internal.domapi;
-
-import javax.xml.transform.TransformerException;
-
-import com.sun.org.apache.xpath.internal.XPath;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
-import com.sun.org.apache.xpath.internal.res.XPATHMessages;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.xpath.XPathException;
-import org.w3c.dom.xpath.XPathExpression;
-import org.w3c.dom.xpath.XPathNamespace;
-
-/**
- *
- * The class provides an implementation of XPathExpression according
- * to the DOM L3 XPath Specification, Working Group Note 26 February 2004.
- *
- * <p>See also the <a href='http://www.w3.org/TR/2004/NOTE-DOM-Level-3-XPath-20040226'>Document Object Model (DOM) Level 3 XPath Specification</a>.</p>
- *
- * <p>The <code>XPathExpression</code> interface represents a parsed and resolved
- * XPath expression.</p>
- *
- * @see org.w3c.dom.xpath.XPathExpression
- *
- * @xsl.usage internal
- */
-class XPathExpressionImpl implements XPathExpression {
-
- /**
- * The xpath object that this expression wraps
- */
- final private XPath m_xpath;
-
- /**
- * The document to be searched to parallel the case where the XPathEvaluator
- * is obtained by casting a Document.
- */
- final private Document m_doc;
-
- /**
- * Constructor for XPathExpressionImpl.
- *
- * @param xpath The wrapped XPath object.
- * @param doc The document to be searched, to parallel the case where''
- * the XPathEvaluator is obtained by casting the document.
- */
- XPathExpressionImpl(XPath xpath, Document doc) {
- m_xpath = xpath;
- m_doc = doc;
- }
-
- /**
- *
- * This method provides an implementation XPathResult.evaluate according
- * to the DOM L3 XPath Specification, Working Group Note 26 February 2004.
- *
- * <p>See also the <a href='http://www.w3.org/TR/2004/NOTE-DOM-Level-3-XPath-20040226'>Document Object Model (DOM) Level 3 XPath Specification</a>.</p>
- *
- * <p>Evaluates this XPath expression and returns a result.</p>
- * @param contextNode The <code>context</code> is context node for the
- * evaluation of this XPath expression.If the XPathEvaluator was
- * obtained by casting the <code>Document</code> then this must be
- * owned by the same document and must be a <code>Document</code>,
- * <code>Element</code>, <code>Attribute</code>, <code>Text</code>,
- * <code>CDATASection</code>, <code>Comment</code>,
- * <code>ProcessingInstruction</code>, or <code>XPathNamespace</code>
- * node.If the context node is a <code>Text</code> or a
- * <code>CDATASection</code>, then the context is interpreted as the
- * whole logical text node as seen by XPath, unless the node is empty
- * in which case it may not serve as the XPath context.
- * @param type If a specific <code>type</code> is specified, then the
- * result will be coerced to return the specified type relying on
- * XPath conversions and fail if the desired coercion is not possible.
- * This must be one of the type codes of <code>XPathResult</code>.
- * @param result The <code>result</code> specifies a specific result
- * object which may be reused and returned by this method. If this is
- * specified as <code>null</code>or the implementation does not reuse
- * the specified result, a new result object will be constructed and
- * returned.For XPath 1.0 results, this object will be of type
- * <code>XPathResult</code>.
- * @return The result of the evaluation of the XPath expression.For XPath
- * 1.0 results, this object will be of type <code>XPathResult</code>.
- * @exception XPathException
- * TYPE_ERR: Raised if the result cannot be converted to return the
- * specified type.
- * @exception DOMException
- * WRONG_DOCUMENT_ERR: The Node is from a document that is not supported
- * by the XPathEvaluator that created this
- * <code>XPathExpression</code>.
- * <br>NOT_SUPPORTED_ERR: The Node is not a type permitted as an XPath
- * context node.
- *
- * @see org.w3c.dom.xpath.XPathExpression#evaluate(Node, short, XPathResult)
- * @xsl.usage internal
- */
- public Object evaluate(
- Node contextNode,
- short type,
- Object result)
- throws XPathException, DOMException {
-
- // If the XPathEvaluator was determined by "casting" the document
- if (m_doc != null) {
-
- // Check that the context node is owned by the same document
- if ((contextNode != m_doc) && (!contextNode.getOwnerDocument().equals(m_doc))) {
- String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_WRONG_DOCUMENT, null);
- throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, fmsg);
- }
-
- // Check that the context node is an acceptable node type
- short nodeType = contextNode.getNodeType();
- if ((nodeType != Document.DOCUMENT_NODE) &&
- (nodeType != Document.ELEMENT_NODE) &&
- (nodeType != Document.ATTRIBUTE_NODE) &&
- (nodeType != Document.TEXT_NODE) &&
- (nodeType != Document.CDATA_SECTION_NODE) &&
- (nodeType != Document.COMMENT_NODE) &&
- (nodeType != Document.PROCESSING_INSTRUCTION_NODE) &&
- (nodeType != XPathNamespace.XPATH_NAMESPACE_NODE)) {
- String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_WRONG_NODETYPE, null);
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR, fmsg);
- }
- }
-
- //
- // If the type is not a supported type, throw an exception and be
- // done with it!
- if (!XPathResultImpl.isValidType(type)) {
- String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_INVALID_XPATH_TYPE, new Object[] {new Integer(type)});
- throw new XPathException(XPathException.TYPE_ERR,fmsg); // Invalid XPath type argument: {0}
- }
-
- // Cache xpath context?
- XPathContext xpathSupport = new XPathContext();
-
- // if m_document is not null, build the DTM from the document
- if (null != m_doc) {
- xpathSupport.getDTMHandleFromNode(m_doc);
- }
-
- XObject xobj = null;
- try {
- xobj = m_xpath.execute(xpathSupport, contextNode, null);
- } catch (TransformerException te) {
- // What should we do here?
- throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,te.getMessageAndLocation());
- }
-
- // Create a new XPathResult object
- // Reuse result object passed in?
- // The constructor will check the compatibility of type and xobj and
- // throw an exception if they are not compatible.
- return new XPathResultImpl(type,xobj,contextNode, m_xpath);
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/domapi/XPathNSResolverImpl.java b/src/com/sun/org/apache/xpath/internal/domapi/XPathNSResolverImpl.java
deleted file mode 100644
index 6c11060..0000000
--- a/src/com/sun/org/apache/xpath/internal/domapi/XPathNSResolverImpl.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2002-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XPathNSResolverImpl.java,v 1.2.4.1 2005/09/10 04:13:19 jeffsuttor Exp $
- */
-
-package com.sun.org.apache.xpath.internal.domapi;
-
-import com.sun.org.apache.xml.internal.utils.PrefixResolverDefault;
-import org.w3c.dom.Node;
-import org.w3c.dom.xpath.XPathNSResolver;
-
-/**
- *
- * The class provides an implementation XPathNSResolver according
- * to the DOM L3 XPath Specification, Working Group Note 26 February 2004.
- *
- * <p>See also the <a href='http://www.w3.org/TR/2004/NOTE-DOM-Level-3-XPath-20040226'>Document Object Model (DOM) Level 3 XPath Specification</a>.</p>
- *
- * <p>The <code>XPathNSResolver</code> interface permit <code>prefix</code>
- * strings in the expression to be properly bound to
- * <code>namespaceURI</code> strings. <code>XPathEvaluator</code> can
- * construct an implementation of <code>XPathNSResolver</code> from a node,
- * or the interface may be implemented by any application.</p>
- *
- * @see org.w3c.dom.xpath.XPathNSResolver
- * @xsl.usage internal
- */
-class XPathNSResolverImpl extends PrefixResolverDefault implements XPathNSResolver {
-
- /**
- * Constructor for XPathNSResolverImpl.
- * @param xpathExpressionContext
- */
- public XPathNSResolverImpl(Node xpathExpressionContext) {
- super(xpathExpressionContext);
- }
-
- /**
- * @see org.w3c.dom.xpath.XPathNSResolver#lookupNamespaceURI(String)
- */
- public String lookupNamespaceURI(String prefix) {
- return super.getNamespaceForPrefix(prefix);
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/domapi/XPathNamespaceImpl.java b/src/com/sun/org/apache/xpath/internal/domapi/XPathNamespaceImpl.java
deleted file mode 100644
index 41a1d16..0000000
--- a/src/com/sun/org/apache/xpath/internal/domapi/XPathNamespaceImpl.java
+++ /dev/null
@@ -1,324 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2002-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XPathNamespaceImpl.java,v 1.2.4.1 2005/09/10 04:10:02 jeffsuttor Exp $
- */
-
-
-package com.sun.org.apache.xpath.internal.domapi;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.xpath.XPathNamespace;
-
-import org.w3c.dom.UserDataHandler;
-
-/**
- *
- *
- * The <code>XPathNamespace</code> interface is returned by
- * <code>XPathResult</code> interfaces to represent the XPath namespace node
- * type that DOM lacks. There is no public constructor for this node type.
- * Attempts to place it into a hierarchy or a NamedNodeMap result in a
- * <code>DOMException</code> with the code <code>HIERARCHY_REQUEST_ERR</code>
- * . This node is read only, so methods or setting of attributes that would
- * mutate the node result in a DOMException with the code
- * <code>NO_MODIFICATION_ALLOWED_ERR</code>.
- * <p>The core specification describes attributes of the <code>Node</code>
- * interface that are different for different node node types but does not
- * describe <code>XPATH_NAMESPACE_NODE</code>, so here is a description of
- * those attributes for this node type. All attributes of <code>Node</code>
- * not described in this section have a <code>null</code> or
- * <code>false</code> value.
- * <p><code>ownerDocument</code> matches the <code>ownerDocument</code> of the
- * <code>ownerElement</code> even if the element is later adopted.
- * <p><code>prefix</code> is the prefix of the namespace represented by the
- * node.
- * <p><code>nodeName</code> is the same as <code>prefix</code>.
- * <p><code>nodeType</code> is equal to <code>XPATH_NAMESPACE_NODE</code>.
- * <p><code>namespaceURI</code> is the namespace URI of the namespace
- * represented by the node.
- * <p><code>adoptNode</code>, <code>cloneNode</code>, and
- * <code>importNode</code> fail on this node type by raising a
- * <code>DOMException</code> with the code <code>NOT_SUPPORTED_ERR</code>.In
- * future versions of the XPath specification, the definition of a namespace
- * node may be changed incomatibly, in which case incompatible changes to
- * field values may be required to implement versions beyond XPath 1.0.
- * <p>See also the <a href='http://www.w3.org/TR/2004/NOTE-DOM-Level-3-XPath-20040226'>Document Object Model (DOM) Level 3 XPath Specification</a>.
- *
- * This implementation wraps the DOM attribute node that contained the
- * namespace declaration.
- * @xsl.usage internal
- */
-
-class XPathNamespaceImpl implements XPathNamespace {
-
- // Node that XPathNamespaceImpl wraps
- final private Node m_attributeNode;
-
- /**
- * Constructor for XPathNamespaceImpl.
- */
- XPathNamespaceImpl(Node node) {
- m_attributeNode = node;
- }
-
- /**
- * @see com.sun.org.apache.xalan.internal.dom3.xpath.XPathNamespace#getOwnerElement()
- */
- public Element getOwnerElement() {
- return ((Attr)m_attributeNode).getOwnerElement();
- }
-
- /**
- * @see org.w3c.dom.Node#getNodeName()
- */
- public String getNodeName() {
- return "#namespace";
- }
-
- /**
- * @see org.w3c.dom.Node#getNodeValue()
- */
- public String getNodeValue() throws DOMException {
- return m_attributeNode.getNodeValue();
- }
-
- /**
- * @see org.w3c.dom.Node#setNodeValue(String)
- */
- public void setNodeValue(String arg0) throws DOMException {
- }
-
- /**
- * @see org.w3c.dom.Node#getNodeType()
- */
- public short getNodeType() {
- return XPathNamespace.XPATH_NAMESPACE_NODE;
- }
-
- /**
- * @see org.w3c.dom.Node#getParentNode()
- */
- public Node getParentNode() {
- return m_attributeNode.getParentNode();
- }
-
- /**
- * @see org.w3c.dom.Node#getChildNodes()
- */
- public NodeList getChildNodes() {
- return m_attributeNode.getChildNodes();
- }
-
- /**
- * @see org.w3c.dom.Node#getFirstChild()
- */
- public Node getFirstChild() {
- return m_attributeNode.getFirstChild();
- }
-
- /**
- * @see org.w3c.dom.Node#getLastChild()
- */
- public Node getLastChild() {
- return m_attributeNode.getLastChild();
- }
-
- /**
- * @see org.w3c.dom.Node#getPreviousSibling()
- */
- public Node getPreviousSibling() {
- return m_attributeNode.getPreviousSibling();
- }
-
- /**
- * @see org.w3c.dom.Node#getNextSibling()
- */
- public Node getNextSibling() {
- return m_attributeNode.getNextSibling();
- }
-
- /**
- * @see org.w3c.dom.Node#getAttributes()
- */
- public NamedNodeMap getAttributes() {
- return m_attributeNode.getAttributes();
- }
-
- /**
- * @see org.w3c.dom.Node#getOwnerDocument()
- */
- public Document getOwnerDocument() {
- return m_attributeNode.getOwnerDocument();
- }
-
- /**
- * @see org.w3c.dom.Node#insertBefore(Node, Node)
- */
- public Node insertBefore(Node arg0, Node arg1) throws DOMException {
- return null;
- }
-
- /**
- * @see org.w3c.dom.Node#replaceChild(Node, Node)
- */
- public Node replaceChild(Node arg0, Node arg1) throws DOMException {
- return null;
- }
-
- /**
- * @see org.w3c.dom.Node#removeChild(Node)
- */
- public Node removeChild(Node arg0) throws DOMException {
- return null;
- }
-
- /**
- * @see org.w3c.dom.Node#appendChild(Node)
- */
- public Node appendChild(Node arg0) throws DOMException {
- return null;
- }
-
- /**
- * @see org.w3c.dom.Node#hasChildNodes()
- */
- public boolean hasChildNodes() {
- return false;
- }
-
- /**
- * @see org.w3c.dom.Node#cloneNode(boolean)
- */
- public Node cloneNode(boolean arg0) {
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR,null);
- }
-
- /**
- * @see org.w3c.dom.Node#normalize()
- */
- public void normalize() {
- m_attributeNode.normalize();
- }
-
- /**
- * @see org.w3c.dom.Node#isSupported(String, String)
- */
- public boolean isSupported(String arg0, String arg1) {
- return m_attributeNode.isSupported(arg0, arg1);
- }
-
- /**
- * @see org.w3c.dom.Node#getNamespaceURI()
- */
- public String getNamespaceURI() {
-
- // For namespace node, the namespaceURI is the namespace URI
- // of the namespace represented by the node.
- return m_attributeNode.getNodeValue();
- }
-
- /**
- * @see org.w3c.dom.Node#getPrefix()
- */
- public String getPrefix() {
- return m_attributeNode.getPrefix();
- }
-
- /**
- * @see org.w3c.dom.Node#setPrefix(String)
- */
- public void setPrefix(String arg0) throws DOMException {
- }
-
- /**
- * @see org.w3c.dom.Node#getLocalName()
- */
- public String getLocalName() {
-
- // For namespace node, the local name is the same as the prefix
- return m_attributeNode.getPrefix();
- }
-
- /**
- * @see org.w3c.dom.Node#hasAttributes()
- */
- public boolean hasAttributes() {
- return m_attributeNode.hasAttributes();
- }
-
- public String getBaseURI ( ) {
- return null;
- }
-
- public short compareDocumentPosition(Node other) throws DOMException {
- return 0;
- }
-
- private String textContent;
-
- public String getTextContent() throws DOMException {
- return textContent;
- }
-
- public void setTextContent(String textContent) throws DOMException {
- this.textContent = textContent;
- }
-
- public boolean isSameNode(Node other) {
- return false;
- }
-
- public String lookupPrefix(String namespaceURI) {
- return ""; //PENDING
- }
-
- public boolean isDefaultNamespace(String namespaceURI) {
- return false;
- }
-
- public String lookupNamespaceURI(String prefix) {
- return null;
- }
-
- public boolean isEqualNode(Node arg) {
- return false;
- }
-
- public Object getFeature(String feature, String version) {
- return null; //PENDING
- }
-
- public Object setUserData(String key,
- Object data,
- UserDataHandler handler) {
- return null; //PENDING
- }
-
- public Object getUserData(String key) {
- return null;
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/domapi/XPathResultImpl.java b/src/com/sun/org/apache/xpath/internal/domapi/XPathResultImpl.java
deleted file mode 100644
index 76576f4..0000000
--- a/src/com/sun/org/apache/xpath/internal/domapi/XPathResultImpl.java
+++ /dev/null
@@ -1,512 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2002-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XPathResultImpl.java,v 1.2.4.1 2005/09/10 04:18:54 jeffsuttor Exp $
- */
-
-
-package com.sun.org.apache.xpath.internal.domapi;
-
-import javax.xml.transform.TransformerException;
-
-import com.sun.org.apache.xpath.internal.XPath;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
-import com.sun.org.apache.xpath.internal.res.XPATHMessages;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.events.Event;
-import org.w3c.dom.events.EventListener;
-import org.w3c.dom.events.EventTarget;
-import org.w3c.dom.traversal.NodeIterator;
-import org.w3c.dom.xpath.XPathException;
-import org.w3c.dom.xpath.XPathResult;
-
-/**
- *
- * The class provides an implementation XPathResult according
- * to the DOM L3 XPath Specification, Working Group Note 26 February 2004.
- *
- * <p>See also the <a href='http://www.w3.org/TR/2004/NOTE-DOM-Level-3-XPath-20040226'>Document Object Model (DOM) Level 3 XPath Specification</a>.</p>
- *
- * <p>The <code>XPathResult</code> interface represents the result of the
- * evaluation of an XPath expression within the context of a particular
- * node. Since evaluation of an XPath expression can result in various
- * result types, this object makes it possible to discover and manipulate
- * the type and value of the result.</p>
- *
- * <p>This implementation wraps an <code>XObject</code>.
- *
- * @see com.sun.org.apache.xpath.internal.objects.XObject
- * @see org.w3c.dom.xpath.XPathResult
- *
- * @xsl.usage internal
- */
-class XPathResultImpl implements XPathResult, EventListener {
-
- /**
- * The wrapped XObject
- */
- final private XObject m_resultObj;
-
- /**
- * The xpath object that wraps the expression used for this result.
- */
- final private XPath m_xpath;
-
- /**
- * This the type specified by the user during construction. Typically
- * the constructor will be called by com.sun.org.apache.xpath.internal.XPath.evaluate().
- */
- final private short m_resultType;
-
- private boolean m_isInvalidIteratorState = false;
-
- /**
- * Only used to attach a mutation event handler when specified
- * type is an iterator type.
- */
- final private Node m_contextNode;
-
- /**
- * The iterator, if this is an iterator type.
- */
- private NodeIterator m_iterator = null;;
-
- /**
- * The list, if this is a snapshot type.
- */
- private NodeList m_list = null;
-
-
- /**
- * Constructor for XPathResultImpl.
- *
- * For internal use only.
- */
- XPathResultImpl(short type, XObject result, Node contextNode, XPath xpath) {
- // Check that the type is valid
- if (!isValidType(type)) {
- String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_INVALID_XPATH_TYPE, new Object[] {new Integer(type)});
- throw new XPathException(XPathException.TYPE_ERR,fmsg); // Invalid XPath type argument: {0}
- }
-
- // Result object should never be null!
- if (null == result) {
- String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_EMPTY_XPATH_RESULT, null);
- throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,fmsg); // Empty XPath result object
- }
-
- this.m_resultObj = result;
- this.m_contextNode = contextNode;
- this.m_xpath = xpath;
-
- // If specified result was ANY_TYPE, determine XObject type
- if (type == ANY_TYPE) {
- this.m_resultType = getTypeFromXObject(result);
- } else {
- this.m_resultType = type;
- }
-
- // If the context node supports DOM Events and the type is one of the iterator
- // types register this result as an event listener
- if (((m_resultType == XPathResult.ORDERED_NODE_ITERATOR_TYPE) ||
- (m_resultType == XPathResult.UNORDERED_NODE_ITERATOR_TYPE))) {
- addEventListener();
-
- }// else can we handle iterator types if contextNode doesn't support EventTarget??
-
- // If this is an iterator type get the iterator
- if ((m_resultType == ORDERED_NODE_ITERATOR_TYPE) ||
- (m_resultType == UNORDERED_NODE_ITERATOR_TYPE) ||
- (m_resultType == ANY_UNORDERED_NODE_TYPE) ||
- (m_resultType == FIRST_ORDERED_NODE_TYPE)) {
-
- try {
- m_iterator = m_resultObj.nodeset();
- } catch (TransformerException te) {
- // probably not a node type
- String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_INCOMPATIBLE_TYPES, new Object[] {m_xpath.getPatternString(), getTypeString(getTypeFromXObject(m_resultObj)),getTypeString(m_resultType)});
- throw new XPathException(XPathException.TYPE_ERR, fmsg); // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be coerced into the specified XPathResultType of {2}."},
- }
-
- // If user requested ordered nodeset and result is unordered
- // need to sort...TODO
- // if ((m_resultType == ORDERED_NODE_ITERATOR_TYPE) &&
- // (!(((DTMNodeIterator)m_iterator).getDTMIterator().isDocOrdered()))) {
- //
- // }
-
- // If it's a snapshot type, get the nodelist
- } else if ((m_resultType == UNORDERED_NODE_SNAPSHOT_TYPE) ||
- (m_resultType == ORDERED_NODE_SNAPSHOT_TYPE)) {
- try {
- m_list = m_resultObj.nodelist();
- } catch (TransformerException te) {
- // probably not a node type
- String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_INCOMPATIBLE_TYPES, new Object[] {m_xpath.getPatternString(), getTypeString(getTypeFromXObject(m_resultObj)),getTypeString(m_resultType)});
- throw new XPathException(XPathException.TYPE_ERR, fmsg); // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be coerced into the specified XPathResultType of {2}."},
- }
- }
- }
-
- /**
- * @see org.w3c.dom.xpath.XPathResult#getResultType()
- */
- public short getResultType() {
- return m_resultType;
- }
-
- /**
- * The value of this number result.
- * @exception XPathException
- * TYPE_ERR: raised if <code>resultType</code> is not
- * <code>NUMBER_TYPE</code>.
- * @see org.w3c.dom.xpath.XPathResult#getNumberValue()
- */
- public double getNumberValue() throws XPathException {
- if (getResultType() != NUMBER_TYPE) {
- String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_CANT_CONVERT_XPATHRESULTTYPE_TO_NUMBER, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)});
- throw new XPathException(XPathException.TYPE_ERR,fmsg);
-// "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be converted to a number"
- } else {
- try {
- return m_resultObj.num();
- } catch (Exception e) {
- // Type check above should prevent this exception from occurring.
- throw new XPathException(XPathException.TYPE_ERR,e.getMessage());
- }
- }
- }
-
- /**
- * The value of this string result.
- * @exception XPathException
- * TYPE_ERR: raised if <code>resultType</code> is not
- * <code>STRING_TYPE</code>.
- *
- * @see org.w3c.dom.xpath.XPathResult#getStringValue()
- */
- public String getStringValue() throws XPathException {
- if (getResultType() != STRING_TYPE) {
- String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_CANT_CONVERT_TO_STRING, new Object[] {m_xpath.getPatternString(), m_resultObj.getTypeString()});
- throw new XPathException(XPathException.TYPE_ERR,fmsg);
-// "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be converted to a string."
- } else {
- try {
- return m_resultObj.str();
- } catch (Exception e) {
- // Type check above should prevent this exception from occurring.
- throw new XPathException(XPathException.TYPE_ERR,e.getMessage());
- }
- }
- }
-
- /**
- * @see org.w3c.dom.xpath.XPathResult#getBooleanValue()
- */
- public boolean getBooleanValue() throws XPathException {
- if (getResultType() != BOOLEAN_TYPE) {
- String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_CANT_CONVERT_TO_BOOLEAN, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)});
- throw new XPathException(XPathException.TYPE_ERR,fmsg);
-// "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be converted to a boolean."
- } else {
- try {
- return m_resultObj.bool();
- } catch (TransformerException e) {
- // Type check above should prevent this exception from occurring.
- throw new XPathException(XPathException.TYPE_ERR,e.getMessage());
- }
- }
- }
-
- /**
- * The value of this single node result, which may be <code>null</code>.
- * @exception XPathException
- * TYPE_ERR: raised if <code>resultType</code> is not
- * <code>ANY_UNORDERED_NODE_TYPE</code> or
- * <code>FIRST_ORDERED_NODE_TYPE</code>.
- *
- * @see org.w3c.dom.xpath.XPathResult#getSingleNodeValue()
- */
- public Node getSingleNodeValue() throws XPathException {
-
- if ((m_resultType != ANY_UNORDERED_NODE_TYPE) &&
- (m_resultType != FIRST_ORDERED_NODE_TYPE)) {
- String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_CANT_CONVERT_TO_SINGLENODE, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)});
- throw new XPathException(XPathException.TYPE_ERR,fmsg);
-// "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be converted to a single node.
-// This method applies only to types ANY_UNORDERED_NODE_TYPE and FIRST_ORDERED_NODE_TYPE."
- }
-
- NodeIterator result = null;
- try {
- result = m_resultObj.nodeset();
- } catch (TransformerException te) {
- throw new XPathException(XPathException.TYPE_ERR,te.getMessage());
- }
-
- if (null == result) return null;
-
- Node node = result.nextNode();
-
- // Wrap "namespace node" in an XPathNamespace
- if (isNamespaceNode(node)) {
- return new XPathNamespaceImpl(node);
- } else {
- return node;
- }
- }
-
- /**
- * @see org.w3c.dom.xpath.XPathResult#getInvalidIteratorState()
- */
- public boolean getInvalidIteratorState() {
- return m_isInvalidIteratorState;
- }
-
- /**
- * The number of nodes in the result snapshot. Valid values for
- * snapshotItem indices are <code>0</code> to
- * <code>snapshotLength-1</code> inclusive.
- * @exception XPathException
- * TYPE_ERR: raised if <code>resultType</code> is not
- * <code>UNORDERED_NODE_SNAPSHOT_TYPE</code> or
- * <code>ORDERED_NODE_SNAPSHOT_TYPE</code>.
- *
- * @see org.w3c.dom.xpath.XPathResult#getSnapshotLength()
- */
- public int getSnapshotLength() throws XPathException {
-
- if ((m_resultType != UNORDERED_NODE_SNAPSHOT_TYPE) &&
- (m_resultType != ORDERED_NODE_SNAPSHOT_TYPE)) {
- String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_CANT_GET_SNAPSHOT_LENGTH, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)});
- throw new XPathException(XPathException.TYPE_ERR,fmsg);
-// "The method getSnapshotLength cannot be called on the XPathResult of XPath expression {0} because its XPathResultType is {1}.
- }
-
- return m_list.getLength();
- }
-
- /**
- * Iterates and returns the next node from the node set or
- * <code>null</code>if there are no more nodes.
- * @return Returns the next node.
- * @exception XPathException
- * TYPE_ERR: raised if <code>resultType</code> is not
- * <code>UNORDERED_NODE_ITERATOR_TYPE</code> or
- * <code>ORDERED_NODE_ITERATOR_TYPE</code>.
- * @exception DOMException
- * INVALID_STATE_ERR: The document has been mutated since the result was
- * returned.
- * @see org.w3c.dom.xpath.XPathResult#iterateNext()
- */
- public Node iterateNext() throws XPathException, DOMException {
- if ((m_resultType != UNORDERED_NODE_ITERATOR_TYPE) &&
- (m_resultType != ORDERED_NODE_ITERATOR_TYPE)) {
- String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_NON_ITERATOR_TYPE, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)});
- throw new XPathException(XPathException.TYPE_ERR, fmsg);
-// "The method iterateNext cannot be called on the XPathResult of XPath expression {0} because its XPathResultType is {1}.
-// This method applies only to types UNORDERED_NODE_ITERATOR_TYPE and ORDERED_NODE_ITERATOR_TYPE."},
- }
-
- if (getInvalidIteratorState()) {
- String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_DOC_MUTATED, null);
- throw new DOMException(DOMException.INVALID_STATE_ERR,fmsg); // Document mutated since result was returned. Iterator is invalid.
- }
-
- Node node = m_iterator.nextNode();
- if(null == node)
- removeEventListener(); // JIRA 1673
- // Wrap "namespace node" in an XPathNamespace
- if (isNamespaceNode(node)) {
- return new XPathNamespaceImpl(node);
- } else {
- return node;
- }
- }
-
- /**
- * Returns the <code>index</code>th item in the snapshot collection. If
- * <code>index</code> is greater than or equal to the number of nodes in
- * the list, this method returns <code>null</code>. Unlike the iterator
- * result, the snapshot does not become invalid, but may not correspond
- * to the current document if it is mutated.
- * @param index Index into the snapshot collection.
- * @return The node at the <code>index</code>th position in the
- * <code>NodeList</code>, or <code>null</code> if that is not a valid
- * index.
- * @exception XPathException
- * TYPE_ERR: raised if <code>resultType</code> is not
- * <code>UNORDERED_NODE_SNAPSHOT_TYPE</code> or
- * <code>ORDERED_NODE_SNAPSHOT_TYPE</code>.
- *
- * @see org.w3c.dom.xpath.XPathResult#snapshotItem(int)
- */
- public Node snapshotItem(int index) throws XPathException {
-
- if ((m_resultType != UNORDERED_NODE_SNAPSHOT_TYPE) &&
- (m_resultType != ORDERED_NODE_SNAPSHOT_TYPE)) {
- String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_NON_SNAPSHOT_TYPE, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)});
- throw new XPathException(XPathException.TYPE_ERR, fmsg);
-// "The method snapshotItem cannot be called on the XPathResult of XPath expression {0} because its XPathResultType is {1}.
-// This method applies only to types UNORDERED_NODE_SNAPSHOT_TYPE and ORDERED_NODE_SNAPSHOT_TYPE."},
- }
-
- Node node = m_list.item(index);
-
- // Wrap "namespace node" in an XPathNamespace
- if (isNamespaceNode(node)) {
- return new XPathNamespaceImpl(node);
- } else {
- return node;
- }
- }
-
-
- /**
- * Check if the specified type is one of the supported types.
- * @param type The specified type
- *
- * @return true If the specified type is supported; otherwise, returns false.
- */
- static boolean isValidType( short type ) {
- switch (type) {
- case ANY_TYPE:
- case NUMBER_TYPE:
- case STRING_TYPE:
- case BOOLEAN_TYPE:
- case UNORDERED_NODE_ITERATOR_TYPE:
- case ORDERED_NODE_ITERATOR_TYPE:
- case UNORDERED_NODE_SNAPSHOT_TYPE:
- case ORDERED_NODE_SNAPSHOT_TYPE:
- case ANY_UNORDERED_NODE_TYPE:
- case FIRST_ORDERED_NODE_TYPE: return true;
- default: return false;
- }
- }
-
- /**
- * @see org.w3c.dom.events.EventListener#handleEvent(Event)
- */
- public void handleEvent(Event event) {
-
- if (event.getType().equals("DOMSubtreeModified")) {
- // invalidate the iterator
- m_isInvalidIteratorState = true;
-
- // deregister as a listener to reduce computational load
- removeEventListener();
- }
- }
-
- /**
- * Given a request type, return the equivalent string.
- * For diagnostic purposes.
- *
- * @return type string
- */
- private String getTypeString(int type)
- {
- switch (type) {
- case ANY_TYPE: return "ANY_TYPE";
- case ANY_UNORDERED_NODE_TYPE: return "ANY_UNORDERED_NODE_TYPE";
- case BOOLEAN_TYPE: return "BOOLEAN";
- case FIRST_ORDERED_NODE_TYPE: return "FIRST_ORDERED_NODE_TYPE";
- case NUMBER_TYPE: return "NUMBER_TYPE";
- case ORDERED_NODE_ITERATOR_TYPE: return "ORDERED_NODE_ITERATOR_TYPE";
- case ORDERED_NODE_SNAPSHOT_TYPE: return "ORDERED_NODE_SNAPSHOT_TYPE";
- case STRING_TYPE: return "STRING_TYPE";
- case UNORDERED_NODE_ITERATOR_TYPE: return "UNORDERED_NODE_ITERATOR_TYPE";
- case UNORDERED_NODE_SNAPSHOT_TYPE: return "UNORDERED_NODE_SNAPSHOT_TYPE";
- default: return "#UNKNOWN";
- }
- }
-
- /**
- * Given an XObject, determine the corresponding DOM XPath type
- *
- * @return type string
- */
- private short getTypeFromXObject(XObject object) {
- switch (object.getType()) {
- case XObject.CLASS_BOOLEAN: return BOOLEAN_TYPE;
- case XObject.CLASS_NODESET: return UNORDERED_NODE_ITERATOR_TYPE;
- case XObject.CLASS_NUMBER: return NUMBER_TYPE;
- case XObject.CLASS_STRING: return STRING_TYPE;
- // XPath 2.0 types
-// case XObject.CLASS_DATE:
-// case XObject.CLASS_DATETIME:
-// case XObject.CLASS_DTDURATION:
-// case XObject.CLASS_GDAY:
-// case XObject.CLASS_GMONTH:
-// case XObject.CLASS_GMONTHDAY:
-// case XObject.CLASS_GYEAR:
-// case XObject.CLASS_GYEARMONTH:
-// case XObject.CLASS_TIME:
-// case XObject.CLASS_YMDURATION: return STRING_TYPE; // treat all date types as strings?
-
- case XObject.CLASS_RTREEFRAG: return UNORDERED_NODE_ITERATOR_TYPE;
- case XObject.CLASS_NULL: return ANY_TYPE; // throw exception ?
- default: return ANY_TYPE; // throw exception ?
- }
-
- }
-
-/**
- * Given a node, determine if it is a namespace node.
- *
- * @param node
- *
- * @return boolean Returns true if this is a namespace node; otherwise, returns false.
- */
- private boolean isNamespaceNode(Node node) {
-
- if ((null != node) &&
- (node.getNodeType() == Node.ATTRIBUTE_NODE) &&
- (node.getNodeName().startsWith("xmlns:") || node.getNodeName().equals("xmlns"))) {
- return true;
- } else {
- return false;
- }
- }
-
-/**
- * Add m_contextNode to Event Listner to listen for Mutations Events
- *
- */
- private void addEventListener(){
- if(m_contextNode instanceof EventTarget)
- ((EventTarget)m_contextNode).addEventListener("DOMSubtreeModified",this,true);
-
- }
-
-
-/**
- * Remove m_contextNode to Event Listner to listen for Mutations Events
- *
- */
-private void removeEventListener(){
- if(m_contextNode instanceof EventTarget)
- ((EventTarget)m_contextNode).removeEventListener("DOMSubtreeModified",this,true);
-}
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/domapi/XPathStylesheetDOM3Exception.java b/src/com/sun/org/apache/xpath/internal/domapi/XPathStylesheetDOM3Exception.java
deleted file mode 100644
index c232003..0000000
--- a/src/com/sun/org/apache/xpath/internal/domapi/XPathStylesheetDOM3Exception.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2002 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package com.sun.org.apache.xpath.internal.domapi;
-
-import javax.xml.transform.SourceLocator;
-import javax.xml.transform.TransformerException;
-
-/**
- *
- * A new exception to add support for DOM Level 3 XPath API.
- * This class is needed to throw a org.w3c.dom.DOMException with proper error code in
- * createExpression method of XPathEvaluatorImpl (a DOM Level 3 class).
- *
- * This class extends TransformerException because the error message includes information
- * about where the XPath problem is in the stylesheet as well as the XPath expression itself.
- *
- * @xsl.usage internal
- */
-final public class XPathStylesheetDOM3Exception extends TransformerException {
- public XPathStylesheetDOM3Exception(String msg, SourceLocator arg1)
- {
- super(msg, arg1);
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/domapi/package.html b/src/com/sun/org/apache/xpath/internal/domapi/package.html
deleted file mode 100644
index f70d0c4..0000000
--- a/src/com/sun/org/apache/xpath/internal/domapi/package.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!--
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
--->
-<!--
- * Copyright 2000-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
--->
-<!-- $Id: package.html,v 1.1.4.1 2005/09/07 22:27:28 jeffsuttor Exp $ -->
-<html>
- <title>XPath domapi Package.</title>
- <body>
- <p>Implements DOM Level 3 XPath API<p>
- </body>
-</html>
-
-
diff --git a/src/com/sun/org/apache/xpath/internal/functions/FuncBoolean.java b/src/com/sun/org/apache/xpath/internal/functions/FuncBoolean.java
deleted file mode 100644
index 628bf22..0000000
--- a/src/com/sun/org/apache/xpath/internal/functions/FuncBoolean.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FuncBoolean.java,v 1.2.4.1 2005/09/14 19:53:45 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.functions;
-
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XBoolean;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-/**
- * Execute the Boolean() function.
- * @xsl.usage advanced
- */
-public class FuncBoolean extends FunctionOneArg
-{
- static final long serialVersionUID = 4328660760070034592L;
-
- /**
- * Execute the function. The function must return
- * a valid object.
- * @param xctxt The current execution context.
- * @return A valid XObject.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
- {
- return m_arg0.execute(xctxt).bool() ? XBoolean.S_TRUE : XBoolean.S_FALSE;
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/functions/FuncCeiling.java b/src/com/sun/org/apache/xpath/internal/functions/FuncCeiling.java
deleted file mode 100644
index 82cd45c..0000000
--- a/src/com/sun/org/apache/xpath/internal/functions/FuncCeiling.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FuncCeiling.java,v 1.2.4.1 2005/09/14 19:53:44 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.functions;
-
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XNumber;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-/**
- * Execute the Ceiling() function.
- * @xsl.usage advanced
- */
-public class FuncCeiling extends FunctionOneArg
-{
- static final long serialVersionUID = -1275988936390464739L;
-
- /**
- * Execute the function. The function must return
- * a valid object.
- * @param xctxt The current execution context.
- * @return A valid XObject.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
- {
- return new XNumber(Math.ceil(m_arg0.execute(xctxt).num()));
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/functions/FuncConcat.java b/src/com/sun/org/apache/xpath/internal/functions/FuncConcat.java
deleted file mode 100644
index 6f2a173..0000000
--- a/src/com/sun/org/apache/xpath/internal/functions/FuncConcat.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FuncConcat.java,v 1.2.4.1 2005/09/14 19:53:44 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.functions;
-
-import com.sun.org.apache.xalan.internal.res.XSLMessages;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-import com.sun.org.apache.xpath.internal.objects.XString;
-
-/**
- * Execute the Concat() function.
- * @xsl.usage advanced
- */
-public class FuncConcat extends FunctionMultiArgs
-{
- static final long serialVersionUID = 1737228885202314413L;
-
- /**
- * Execute the function. The function must return
- * a valid object.
- * @param xctxt The current execution context.
- * @return A valid XObject.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
- {
-
- StringBuffer sb = new StringBuffer();
-
- // Compiler says we must have at least two arguments.
- sb.append(m_arg0.execute(xctxt).str());
- sb.append(m_arg1.execute(xctxt).str());
-
- if (null != m_arg2)
- sb.append(m_arg2.execute(xctxt).str());
-
- if (null != m_args)
- {
- for (int i = 0; i < m_args.length; i++)
- {
- sb.append(m_args[i].execute(xctxt).str());
- }
- }
-
- return new XString(sb.toString());
- }
-
- /**
- * Check that the number of arguments passed to this function is correct.
- *
- *
- * @param argNum The number of arguments that is being passed to the function.
- *
- * @throws WrongNumberArgsException
- */
- public void checkNumberArgs(int argNum) throws WrongNumberArgsException
- {
- if (argNum < 2)
- reportWrongNumberArgs();
- }
-
- /**
- * Constructs and throws a WrongNumberArgException with the appropriate
- * message for this function object.
- *
- * @throws WrongNumberArgsException
- */
- protected void reportWrongNumberArgs() throws WrongNumberArgsException {
- throw new WrongNumberArgsException(XSLMessages.createXPATHMessage("gtone", null));
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/functions/FuncContains.java b/src/com/sun/org/apache/xpath/internal/functions/FuncContains.java
deleted file mode 100644
index e7ca3aa..0000000
--- a/src/com/sun/org/apache/xpath/internal/functions/FuncContains.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FuncContains.java,v 1.2.4.1 2005/09/14 19:53:44 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.functions;
-
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XBoolean;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-/**
- * Execute the Contains() function.
- * @xsl.usage advanced
- */
-public class FuncContains extends Function2Args
-{
- static final long serialVersionUID = 5084753781887919723L;
-
- /**
- * Execute the function. The function must return
- * a valid object.
- * @param xctxt The current execution context.
- * @return A valid XObject.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
- {
-
- String s1 = m_arg0.execute(xctxt).str();
- String s2 = m_arg1.execute(xctxt).str();
-
- // Add this check for JDK consistency for empty strings.
- if (s1.length() == 0 && s2.length() == 0)
- return XBoolean.S_TRUE;
-
- int index = s1.indexOf(s2);
-
- return (index > -1) ? XBoolean.S_TRUE : XBoolean.S_FALSE;
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/functions/FuncCount.java b/src/com/sun/org/apache/xpath/internal/functions/FuncCount.java
deleted file mode 100644
index b9b1326..0000000
--- a/src/com/sun/org/apache/xpath/internal/functions/FuncCount.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FuncCount.java,v 1.2.4.1 2005/09/14 19:53:45 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.functions;
-
-import com.sun.org.apache.xml.internal.dtm.DTMIterator;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XNumber;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-/**
- * Execute the Count() function.
- * @xsl.usage advanced
- */
-public class FuncCount extends FunctionOneArg
-{
- static final long serialVersionUID = -7116225100474153751L;
-
- /**
- * Execute the function. The function must return
- * a valid object.
- * @param xctxt The current execution context.
- * @return A valid XObject.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
- {
-
-// DTMIterator nl = m_arg0.asIterator(xctxt, xctxt.getCurrentNode());
-
-// // We should probably make a function on the iterator for this,
-// // as a given implementation could optimize.
-// int i = 0;
-//
-// while (DTM.NULL != nl.nextNode())
-// {
-// i++;
-// }
-// nl.detach();
- DTMIterator nl = m_arg0.asIterator(xctxt, xctxt.getCurrentNode());
- int i = nl.getLength();
- nl.detach();
-
- return new XNumber((double) i);
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/functions/FuncCurrent.java b/src/com/sun/org/apache/xpath/internal/functions/FuncCurrent.java
deleted file mode 100644
index b384549..0000000
--- a/src/com/sun/org/apache/xpath/internal/functions/FuncCurrent.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FuncCurrent.java,v 1.2.4.1 2005/09/14 19:53:44 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.functions;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMIterator;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.axes.LocPathIterator;
-import com.sun.org.apache.xpath.internal.axes.PredicatedNodeTest;
-import com.sun.org.apache.xpath.internal.objects.XNodeSet;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-import com.sun.org.apache.xpath.internal.axes.SubContextList;
-import com.sun.org.apache.xpath.internal.patterns.StepPattern;
-import com.sun.org.apache.xalan.internal.res.XSLMessages;
-import com.sun.org.apache.xalan.internal.res.XSLTErrorResources;
-
-
-/**
- * Execute the current() function.
- * @xsl.usage advanced
- */
-public class FuncCurrent extends Function
-{
- static final long serialVersionUID = 5715316804877715008L;
-
- /**
- * Execute the function. The function must return
- * a valid object.
- * @param xctxt The current execution context.
- * @return A valid XObject.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
- {
-
- SubContextList subContextList = xctxt.getCurrentNodeList();
- int currentNode = DTM.NULL;
-
- if (null != subContextList) {
- if (subContextList instanceof PredicatedNodeTest) {
- LocPathIterator iter = ((PredicatedNodeTest)subContextList)
- .getLocPathIterator();
- currentNode = iter.getCurrentContextNode();
- } else if(subContextList instanceof StepPattern) {
- throw new RuntimeException(XSLMessages.createMessage(
- XSLTErrorResources.ER_PROCESSOR_ERROR,null));
- }
- } else {
- // not predicate => ContextNode == CurrentNode
- currentNode = xctxt.getContextNode();
- }
- return new XNodeSet(currentNode, xctxt.getDTMManager());
- }
-
- /**
- * No arguments to process, so this does nothing.
- */
- public void fixupVariables(java.util.Vector vars, int globalsSize)
- {
- // no-op
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/functions/FuncDoclocation.java b/src/com/sun/org/apache/xpath/internal/functions/FuncDoclocation.java
deleted file mode 100644
index 1217af7..0000000
--- a/src/com/sun/org/apache/xpath/internal/functions/FuncDoclocation.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FuncDoclocation.java,v 1.2.4.1 2005/09/14 19:53:44 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.functions;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-import com.sun.org.apache.xpath.internal.objects.XString;
-
-/**
- * Execute the proprietary document-location() function, which returns
- * a node set of documents.
- * @xsl.usage advanced
- */
-public class FuncDoclocation extends FunctionDef1Arg
-{
- static final long serialVersionUID = 7469213946343568769L;
-
- /**
- * Execute the function. The function must return
- * a valid object.
- * @param xctxt The current execution context.
- * @return A valid XObject.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
- {
-
- int whereNode = getArg0AsNode(xctxt);
- String fileLocation = null;
-
- if (DTM.NULL != whereNode)
- {
- DTM dtm = xctxt.getDTM(whereNode);
-
- // %REVIEW%
- if (DTM.DOCUMENT_FRAGMENT_NODE == dtm.getNodeType(whereNode))
- {
- whereNode = dtm.getFirstChild(whereNode);
- }
-
- if (DTM.NULL != whereNode)
- {
- fileLocation = dtm.getDocumentBaseURI();
-// int owner = dtm.getDocument();
-// fileLocation = xctxt.getSourceTreeManager().findURIFromDoc(owner);
- }
- }
-
- return new XString((null != fileLocation) ? fileLocation : "");
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/functions/FuncExtElementAvailable.java b/src/com/sun/org/apache/xpath/internal/functions/FuncExtElementAvailable.java
deleted file mode 100644
index bc4585a..0000000
--- a/src/com/sun/org/apache/xpath/internal/functions/FuncExtElementAvailable.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FuncExtElementAvailable.java,v 1.2.4.1 2005/09/14 19:58:32 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.functions;
-
-import com.sun.org.apache.xalan.internal.templates.Constants;
-// J2SE does not support Xalan interpretive
-/*
-import com.sun.org.apache.xalan.internal.transformer.TransformerImpl;
-*/
-import com.sun.org.apache.xml.internal.utils.QName;
-import com.sun.org.apache.xpath.internal.ExtensionsProvider;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XBoolean;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-/**
- * Execute the ExtElementAvailable() function.
- * @xsl.usage advanced
- */
-public class FuncExtElementAvailable extends FunctionOneArg
-{
- static final long serialVersionUID = -472533699257968546L;
-
- /**
- * Execute the function. The function must return
- * a valid object.
- * @param xctxt The current execution context.
- * @return A valid XObject.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
- {
-
- String prefix;
- String namespace;
- String methName;
-
- String fullName = m_arg0.execute(xctxt).str();
- int indexOfNSSep = fullName.indexOf(':');
-
- if (indexOfNSSep < 0)
- {
- prefix = "";
- namespace = Constants.S_XSLNAMESPACEURL;
- methName = fullName;
- }
- else
- {
- prefix = fullName.substring(0, indexOfNSSep);
- namespace = xctxt.getNamespaceContext().getNamespaceForPrefix(prefix);
- if (null == namespace)
- return XBoolean.S_FALSE;
- methName= fullName.substring(indexOfNSSep + 1);
- }
-
- if (namespace.equals(Constants.S_XSLNAMESPACEURL)
- || namespace.equals(Constants.S_BUILTIN_EXTENSIONS_URL)) {
-
- // J2SE does not support Xalan interpretive
- /*
- try {
- TransformerImpl transformer = (TransformerImpl) xctxt.getOwnerObject();
- return transformer.getStylesheet().getAvailableElements().containsKey(
- new QName(namespace, methName))
- ? XBoolean.S_TRUE : XBoolean.S_FALSE;
- } catch (Exception e) {
- return XBoolean.S_FALSE;
- }
- */
- return XBoolean.S_FALSE;
- } else {
- //dml
- ExtensionsProvider extProvider = (ExtensionsProvider)xctxt.getOwnerObject();
- return extProvider.elementAvailable(namespace, methName)
- ? XBoolean.S_TRUE : XBoolean.S_FALSE;
- }
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/functions/FuncExtFunction.java b/src/com/sun/org/apache/xpath/internal/functions/FuncExtFunction.java
deleted file mode 100644
index 5eaa4c4..0000000
--- a/src/com/sun/org/apache/xpath/internal/functions/FuncExtFunction.java
+++ /dev/null
@@ -1,342 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FuncExtFunction.java,v 1.2.4.2 2005/09/14 20:18:43 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.functions;
-
-import java.util.Vector;
-
-import com.sun.org.apache.xalan.internal.res.XSLMessages;
-import com.sun.org.apache.xpath.internal.Expression;
-import com.sun.org.apache.xpath.internal.ExpressionNode;
-import com.sun.org.apache.xpath.internal.ExpressionOwner;
-import com.sun.org.apache.xpath.internal.ExtensionsProvider;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.XPathVisitor;
-import com.sun.org.apache.xpath.internal.objects.XNull;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
-import com.sun.org.apache.xpath.internal.res.XPATHMessages;
-
-/**
- * An object of this class represents an extension call expression. When
- * the expression executes, it calls ExtensionsTable#extFunction, and then
- * converts the result to the appropriate XObject.
- * @xsl.usage advanced
- */
-public class FuncExtFunction extends Function
-{
- static final long serialVersionUID = 5196115554693708718L;
-
- /**
- * The namespace for the extension function, which should not normally
- * be null or empty.
- * @serial
- */
- String m_namespace;
-
- /**
- * The local name of the extension.
- * @serial
- */
- String m_extensionName;
-
- /**
- * Unique method key, which is passed to ExtensionsTable#extFunction in
- * order to allow caching of the method.
- * @serial
- */
- Object m_methodKey;
-
- /**
- * Array of static expressions which represent the parameters to the
- * function.
- * @serial
- */
- Vector m_argVec = new Vector();
-
- /**
- * This function is used to fixup variables from QNames to stack frame
- * indexes at stylesheet build time.
- * @param vars List of QNames that correspond to variables. This list
- * should be searched backwards for the first qualified name that
- * corresponds to the variable reference qname. The position of the
- * QName in the vector from the start of the vector will be its position
- * in the stack frame (but variables above the globalsTop value will need
- * to be offset to the current stack frame).
- * NEEDSDOC @param globalsSize
- */
- public void fixupVariables(java.util.Vector vars, int globalsSize)
- {
-
- if (null != m_argVec)
- {
- int nArgs = m_argVec.size();
-
- for (int i = 0; i < nArgs; i++)
- {
- Expression arg = (Expression) m_argVec.elementAt(i);
-
- arg.fixupVariables(vars, globalsSize);
- }
- }
- }
-
- /**
- * Return the namespace of the extension function.
- *
- * @return The namespace of the extension function.
- */
- public String getNamespace()
- {
- return m_namespace;
- }
-
- /**
- * Return the name of the extension function.
- *
- * @return The name of the extension function.
- */
- public String getFunctionName()
- {
- return m_extensionName;
- }
-
- /**
- * Return the method key of the extension function.
- *
- * @return The method key of the extension function.
- */
- public Object getMethodKey()
- {
- return m_methodKey;
- }
-
- /**
- * Return the nth argument passed to the extension function.
- *
- * @param n The argument number index.
- * @return The Expression object at the given index.
- */
- public Expression getArg(int n) {
- if (n >= 0 && n < m_argVec.size())
- return (Expression) m_argVec.elementAt(n);
- else
- return null;
- }
-
- /**
- * Return the number of arguments that were passed
- * into this extension function.
- *
- * @return The number of arguments.
- */
- public int getArgCount() {
- return m_argVec.size();
- }
-
- /**
- * Create a new FuncExtFunction based on the qualified name of the extension,
- * and a unique method key.
- *
- * @param namespace The namespace for the extension function, which should
- * not normally be null or empty.
- * @param extensionName The local name of the extension.
- * @param methodKey Unique method key, which is passed to
- * ExtensionsTable#extFunction in order to allow caching
- * of the method.
- */
- public FuncExtFunction(java.lang.String namespace,
- java.lang.String extensionName, Object methodKey)
- {
- //try{throw new Exception("FuncExtFunction() " + namespace + " " + extensionName);} catch (Exception e){e.printStackTrace();}
- m_namespace = namespace;
- m_extensionName = extensionName;
- m_methodKey = methodKey;
- }
-
- /**
- * Execute the function. The function must return
- * a valid object.
- * @param xctxt The current execution context.
- * @return A valid XObject.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt)
- throws javax.xml.transform.TransformerException
- {
- if (xctxt.isSecureProcessing())
- throw new javax.xml.transform.TransformerException(
- XPATHMessages.createXPATHMessage(
- XPATHErrorResources.ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED,
- new Object[] {toString()}));
-
- XObject result;
- Vector argVec = new Vector();
- int nArgs = m_argVec.size();
-
- for (int i = 0; i < nArgs; i++)
- {
- Expression arg = (Expression) m_argVec.elementAt(i);
-
- XObject xobj = arg.execute(xctxt);
- /*
- * Should cache the arguments for func:function
- */
- xobj.allowDetachToRelease(false);
- argVec.addElement(xobj);
- }
- //dml
- ExtensionsProvider extProvider = (ExtensionsProvider)xctxt.getOwnerObject();
- Object val = extProvider.extFunction(this, argVec);
-
- if (null != val)
- {
- result = XObject.create(val, xctxt);
- }
- else
- {
- result = new XNull();
- }
-
- return result;
- }
-
- /**
- * Set an argument expression for a function. This method is called by the
- * XPath compiler.
- *
- * @param arg non-null expression that represents the argument.
- * @param argNum The argument number index.
- *
- * @throws WrongNumberArgsException If the argNum parameter is beyond what
- * is specified for this function.
- */
- public void setArg(Expression arg, int argNum)
- throws WrongNumberArgsException
- {
- m_argVec.addElement(arg);
- arg.exprSetParent(this);
- }
-
- /**
- * Check that the number of arguments passed to this function is correct.
- *
- *
- * @param argNum The number of arguments that is being passed to the function.
- *
- * @throws WrongNumberArgsException
- */
- public void checkNumberArgs(int argNum) throws WrongNumberArgsException{}
-
-
- class ArgExtOwner implements ExpressionOwner
- {
-
- Expression m_exp;
-
- ArgExtOwner(Expression exp)
- {
- m_exp = exp;
- }
-
- /**
- * @see ExpressionOwner#getExpression()
- */
- public Expression getExpression()
- {
- return m_exp;
- }
-
-
- /**
- * @see ExpressionOwner#setExpression(Expression)
- */
- public void setExpression(Expression exp)
- {
- exp.exprSetParent(FuncExtFunction.this);
- m_exp = exp;
- }
- }
-
-
- /**
- * Call the visitors for the function arguments.
- */
- public void callArgVisitors(XPathVisitor visitor)
- {
- for (int i = 0; i < m_argVec.size(); i++)
- {
- Expression exp = (Expression)m_argVec.elementAt(i);
- exp.callVisitors(new ArgExtOwner(exp), visitor);
- }
-
- }
-
- /**
- * Set the parent node.
- * For an extension function, we also need to set the parent
- * node for all argument expressions.
- *
- * @param n The parent node
- */
- public void exprSetParent(ExpressionNode n)
- {
-
- super.exprSetParent(n);
-
- int nArgs = m_argVec.size();
-
- for (int i = 0; i < nArgs; i++)
- {
- Expression arg = (Expression) m_argVec.elementAt(i);
-
- arg.exprSetParent(n);
- }
- }
-
- /**
- * Constructs and throws a WrongNumberArgException with the appropriate
- * message for this function object. This class supports an arbitrary
- * number of arguments, so this method must never be called.
- *
- * @throws WrongNumberArgsException
- */
- protected void reportWrongNumberArgs() throws WrongNumberArgsException {
- String fMsg = XSLMessages.createXPATHMessage(
- XPATHErrorResources.ER_INCORRECT_PROGRAMMER_ASSERTION,
- new Object[]{ "Programmer's assertion: the method FunctionMultiArgs.reportWrongNumberArgs() should never be called." });
-
- throw new RuntimeException(fMsg);
- }
-
- /**
- * Return the name of the extesion function in string format
- */
- public String toString()
- {
- if (m_namespace != null && m_namespace.length() > 0)
- return "{" + m_namespace + "}" + m_extensionName;
- else
- return m_extensionName;
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/functions/FuncExtFunctionAvailable.java b/src/com/sun/org/apache/xpath/internal/functions/FuncExtFunctionAvailable.java
deleted file mode 100644
index f474901..0000000
--- a/src/com/sun/org/apache/xpath/internal/functions/FuncExtFunctionAvailable.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FuncExtFunctionAvailable.java,v 1.2.4.1 2005/09/14 20:05:08 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.functions;
-
-import com.sun.org.apache.xalan.internal.templates.Constants;
-import com.sun.org.apache.xpath.internal.ExtensionsProvider;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.compiler.FunctionTable;
-import com.sun.org.apache.xpath.internal.objects.XBoolean;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-/**
- * Execute the ExtFunctionAvailable() function.
- * @xsl.usage advanced
- */
-public class FuncExtFunctionAvailable extends FunctionOneArg
-{
- static final long serialVersionUID = 5118814314918592241L;
-
- transient private FunctionTable m_functionTable = null;
-
- /**
- * Execute the function. The function must return
- * a valid object.
- * @param xctxt The current execution context.
- * @return A valid XObject.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
- {
-
- String prefix;
- String namespace;
- String methName;
-
- String fullName = m_arg0.execute(xctxt).str();
- int indexOfNSSep = fullName.indexOf(':');
-
- if (indexOfNSSep < 0)
- {
- prefix = "";
- namespace = Constants.S_XSLNAMESPACEURL;
- methName = fullName;
- }
- else
- {
- prefix = fullName.substring(0, indexOfNSSep);
- namespace = xctxt.getNamespaceContext().getNamespaceForPrefix(prefix);
- if (null == namespace)
- return XBoolean.S_FALSE;
- methName = fullName.substring(indexOfNSSep + 1);
- }
-
- if (namespace.equals(Constants.S_XSLNAMESPACEURL))
- {
- try
- {
- if (null == m_functionTable) m_functionTable = new FunctionTable();
- return m_functionTable.functionAvailable(methName) ? XBoolean.S_TRUE : XBoolean.S_FALSE;
- }
- catch (Exception e)
- {
- return XBoolean.S_FALSE;
- }
- }
- else
- {
- //dml
- ExtensionsProvider extProvider = (ExtensionsProvider)xctxt.getOwnerObject();
- return extProvider.functionAvailable(namespace, methName)
- ? XBoolean.S_TRUE : XBoolean.S_FALSE;
- }
- }
-
- /**
- * The function table is an instance field. In order to access this instance
- * field during evaluation, this method is called at compilation time to
- * insert function table information for later usage. It should only be used
- * during compiling of XPath expressions.
- * @param aTable an instance of the function table
- */
- public void setFunctionTable(FunctionTable aTable){
- m_functionTable = aTable;
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/functions/FuncFalse.java b/src/com/sun/org/apache/xpath/internal/functions/FuncFalse.java
deleted file mode 100644
index 7f1c975..0000000
--- a/src/com/sun/org/apache/xpath/internal/functions/FuncFalse.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FuncFalse.java,v 1.2.4.1 2005/09/14 20:18:46 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.functions;
-
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XBoolean;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-/**
- * Execute the False() function.
- * @xsl.usage advanced
- */
-public class FuncFalse extends Function
-{
- static final long serialVersionUID = 6150918062759769887L;
-
- /**
- * Execute the function. The function must return
- * a valid object.
- * @param xctxt The current execution context.
- * @return A valid XObject.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
- {
- return XBoolean.S_FALSE;
- }
-
- /**
- * No arguments to process, so this does nothing.
- */
- public void fixupVariables(java.util.Vector vars, int globalsSize)
- {
- // no-op
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/functions/FuncFloor.java b/src/com/sun/org/apache/xpath/internal/functions/FuncFloor.java
deleted file mode 100644
index 1e9c335..0000000
--- a/src/com/sun/org/apache/xpath/internal/functions/FuncFloor.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FuncFloor.java,v 1.2.4.1 2005/09/14 20:18:42 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.functions;
-
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XNumber;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-/**
- * Execute the Floor() function.
- * @xsl.usage advanced
- */
-public class FuncFloor extends FunctionOneArg
-{
- static final long serialVersionUID = 2326752233236309265L;
-
- /**
- * Execute the function. The function must return
- * a valid object.
- * @param xctxt The current execution context.
- * @return A valid XObject.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
- {
- return new XNumber(java.lang.Math.floor(m_arg0.execute(xctxt).num()));
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/functions/FuncGenerateId.java b/src/com/sun/org/apache/xpath/internal/functions/FuncGenerateId.java
deleted file mode 100644
index c06ea82..0000000
--- a/src/com/sun/org/apache/xpath/internal/functions/FuncGenerateId.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FuncGenerateId.java,v 1.2.4.1 2005/09/14 20:18:45 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.functions;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-import com.sun.org.apache.xpath.internal.objects.XString;
-
-/**
- * Execute the GenerateId() function.
- * @xsl.usage advanced
- */
-public class FuncGenerateId extends FunctionDef1Arg
-{
- static final long serialVersionUID = 973544842091724273L;
-
- /**
- * Execute the function. The function must return
- * a valid object.
- * @param xctxt The current execution context.
- * @return A valid XObject.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
- {
-
- int which = getArg0AsNode(xctxt);
-
- if (DTM.NULL != which)
- {
- // Note that this is a different value than in previous releases
- // of Xalan. It's sensitive to the exact encoding of the node
- // handle anyway, so fighting to maintain backward compatability
- // really didn't make sense; it may change again as we continue
- // to experiment with balancing document and node numbers within
- // that value.
- return new XString("N" + Integer.toHexString(which).toUpperCase());
- }
- else
- return XString.EMPTYSTRING;
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/functions/FuncId.java b/src/com/sun/org/apache/xpath/internal/functions/FuncId.java
deleted file mode 100644
index 10cfa68..0000000
--- a/src/com/sun/org/apache/xpath/internal/functions/FuncId.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FuncId.java,v 1.2.4.1 2005/09/14 20:18:45 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.functions;
-
-import java.util.StringTokenizer;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMIterator;
-import com.sun.org.apache.xml.internal.utils.StringVector;
-import com.sun.org.apache.xpath.internal.NodeSetDTM;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XNodeSet;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
-
-/**
- * Execute the Id() function.
- * @xsl.usage advanced
- */
-public class FuncId extends FunctionOneArg
-{
- static final long serialVersionUID = 8930573966143567310L;
-
- /**
- * Fill in a list with nodes that match a space delimited list if ID
- * ID references.
- *
- * @param xctxt The runtime XPath context.
- * @param docContext The document where the nodes are being looked for.
- * @param refval A space delimited list of ID references.
- * @param usedrefs List of references for which nodes were found.
- * @param nodeSet Node set where the nodes will be added to.
- * @param mayBeMore true if there is another set of nodes to be looked for.
- *
- * @return The usedrefs value.
- */
- private StringVector getNodesByID(XPathContext xctxt, int docContext,
- String refval, StringVector usedrefs,
- NodeSetDTM nodeSet, boolean mayBeMore)
- {
-
- if (null != refval)
- {
- String ref = null;
-// DOMHelper dh = xctxt.getDOMHelper();
- StringTokenizer tokenizer = new StringTokenizer(refval);
- boolean hasMore = tokenizer.hasMoreTokens();
- DTM dtm = xctxt.getDTM(docContext);
-
- while (hasMore)
- {
- ref = tokenizer.nextToken();
- hasMore = tokenizer.hasMoreTokens();
-
- if ((null != usedrefs) && usedrefs.contains(ref))
- {
- ref = null;
-
- continue;
- }
-
- int node = dtm.getElementById(ref);
-
- if (DTM.NULL != node)
- nodeSet.addNodeInDocOrder(node, xctxt);
-
- if ((null != ref) && (hasMore || mayBeMore))
- {
- if (null == usedrefs)
- usedrefs = new StringVector();
-
- usedrefs.addElement(ref);
- }
- }
- }
-
- return usedrefs;
- }
-
- /**
- * Execute the function. The function must return
- * a valid object.
- * @param xctxt The current execution context.
- * @return A valid XObject.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
- {
-
- int context = xctxt.getCurrentNode();
- DTM dtm = xctxt.getDTM(context);
- int docContext = dtm.getDocument();
-
- if (DTM.NULL == docContext)
- error(xctxt, XPATHErrorResources.ER_CONTEXT_HAS_NO_OWNERDOC, null);
-
- XObject arg = m_arg0.execute(xctxt);
- int argType = arg.getType();
- XNodeSet nodes = new XNodeSet(xctxt.getDTMManager());
- NodeSetDTM nodeSet = nodes.mutableNodeset();
-
- if (XObject.CLASS_NODESET == argType)
- {
- DTMIterator ni = arg.iter();
- StringVector usedrefs = null;
- int pos = ni.nextNode();
-
- while (DTM.NULL != pos)
- {
- DTM ndtm = ni.getDTM(pos);
- String refval = ndtm.getStringValue(pos).toString();
-
- pos = ni.nextNode();
- usedrefs = getNodesByID(xctxt, docContext, refval, usedrefs, nodeSet,
- DTM.NULL != pos);
- }
- // ni.detach();
- }
- else if (XObject.CLASS_NULL == argType)
- {
- return nodes;
- }
- else
- {
- String refval = arg.str();
-
- getNodesByID(xctxt, docContext, refval, null, nodeSet, false);
- }
-
- return nodes;
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/functions/FuncLang.java b/src/com/sun/org/apache/xpath/internal/functions/FuncLang.java
deleted file mode 100644
index 869b08f..0000000
--- a/src/com/sun/org/apache/xpath/internal/functions/FuncLang.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FuncLang.java,v 1.2.4.1 2005/09/14 20:18:44 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.functions;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XBoolean;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-/**
- * Execute the Lang() function.
- * @xsl.usage advanced
- */
-public class FuncLang extends FunctionOneArg
-{
- static final long serialVersionUID = -7868705139354872185L;
-
- /**
- * Execute the function. The function must return
- * a valid object.
- * @param xctxt The current execution context.
- * @return A valid XObject.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
- {
-
- String lang = m_arg0.execute(xctxt).str();
- int parent = xctxt.getCurrentNode();
- boolean isLang = false;
- DTM dtm = xctxt.getDTM(parent);
-
- while (DTM.NULL != parent)
- {
- if (DTM.ELEMENT_NODE == dtm.getNodeType(parent))
- {
- int langAttr = dtm.getAttributeNode(parent, "http://www.w3.org/XML/1998/namespace", "lang");
-
- if (DTM.NULL != langAttr)
- {
- String langVal = dtm.getNodeValue(langAttr);
- // %OPT%
- if (langVal.toLowerCase().startsWith(lang.toLowerCase()))
- {
- int valLen = lang.length();
-
- if ((langVal.length() == valLen)
- || (langVal.charAt(valLen) == '-'))
- {
- isLang = true;
- }
- }
-
- break;
- }
- }
-
- parent = dtm.getParent(parent);
- }
-
- return isLang ? XBoolean.S_TRUE : XBoolean.S_FALSE;
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/functions/FuncLast.java b/src/com/sun/org/apache/xpath/internal/functions/FuncLast.java
deleted file mode 100644
index 9172855..0000000
--- a/src/com/sun/org/apache/xpath/internal/functions/FuncLast.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FuncLast.java,v 1.2.4.1 2005/09/14 20:18:43 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.functions;
-
-import com.sun.org.apache.xml.internal.dtm.DTMIterator;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.axes.SubContextList;
-import com.sun.org.apache.xpath.internal.compiler.Compiler;
-import com.sun.org.apache.xpath.internal.objects.XNumber;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-
-/**
- * Execute the Last() function.
- * @xsl.usage advanced
- */
-public class FuncLast extends Function
-{
- static final long serialVersionUID = 9205812403085432943L;
-
- private boolean m_isTopLevel;
-
- /**
- * Figure out if we're executing a toplevel expression.
- * If so, we can't be inside of a predicate.
- */
- public void postCompileStep(Compiler compiler)
- {
- m_isTopLevel = compiler.getLocationPathDepth() == -1;
- }
-
- /**
- * Get the position in the current context node list.
- *
- * @param xctxt non-null reference to XPath runtime context.
- *
- * @return The number of nodes in the list.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public int getCountOfContextNodeList(XPathContext xctxt)
- throws javax.xml.transform.TransformerException
- {
-
- // assert(null != m_contextNodeList, "m_contextNodeList must be non-null");
- // If we're in a predicate, then this will return non-null.
- SubContextList iter = m_isTopLevel ? null : xctxt.getSubContextList();
-
- // System.out.println("iter: "+iter);
- if (null != iter)
- return iter.getLastPos(xctxt);
-
- DTMIterator cnl = xctxt.getContextNodeList();
- int count;
- if(null != cnl)
- {
- count = cnl.getLength();
- // System.out.println("count: "+count);
- }
- else
- count = 0;
- return count;
- }
-
- /**
- * Execute the function. The function must return
- * a valid object.
- * @param xctxt The current execution context.
- * @return A valid XObject.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
- {
- XNumber xnum = new XNumber((double) getCountOfContextNodeList(xctxt));
- // System.out.println("last: "+xnum.num());
- return xnum;
- }
-
- /**
- * No arguments to process, so this does nothing.
- */
- public void fixupVariables(java.util.Vector vars, int globalsSize)
- {
- // no-op
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/functions/FuncLocalPart.java b/src/com/sun/org/apache/xpath/internal/functions/FuncLocalPart.java
deleted file mode 100644
index b4e1a97..0000000
--- a/src/com/sun/org/apache/xpath/internal/functions/FuncLocalPart.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FuncLocalPart.java,v 1.2.4.1 2005/09/14 20:18:44 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.functions;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-import com.sun.org.apache.xpath.internal.objects.XString;
-
-/**
- * Execute the LocalPart() function.
- * @xsl.usage advanced
- */
-public class FuncLocalPart extends FunctionDef1Arg
-{
- static final long serialVersionUID = 7591798770325814746L;
-
- /**
- * Execute the function. The function must return
- * a valid object.
- * @param xctxt The current execution context.
- * @return A valid XObject.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
- {
-
- int context = getArg0AsNode(xctxt);
- if(DTM.NULL == context)
- return XString.EMPTYSTRING;
- DTM dtm = xctxt.getDTM(context);
- String s = (context != DTM.NULL) ? dtm.getLocalName(context) : "";
- if(s.startsWith("#") || s.equals("xmlns"))
- return XString.EMPTYSTRING;
-
- return new XString(s);
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/functions/FuncNamespace.java b/src/com/sun/org/apache/xpath/internal/functions/FuncNamespace.java
deleted file mode 100644
index 9e85e26..0000000
--- a/src/com/sun/org/apache/xpath/internal/functions/FuncNamespace.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FuncNamespace.java,v 1.2.4.1 2005/09/14 20:18:46 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.functions;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-import com.sun.org.apache.xpath.internal.objects.XString;
-
-/**
- * Execute the Namespace() function.
- * @xsl.usage advanced
- */
-public class FuncNamespace extends FunctionDef1Arg
-{
- static final long serialVersionUID = -4695674566722321237L;
-
- /**
- * Execute the function. The function must return
- * a valid object.
- * @param xctxt The current execution context.
- * @return A valid XObject.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
- {
-
- int context = getArg0AsNode(xctxt);
-
- String s;
- if(context != DTM.NULL)
- {
- DTM dtm = xctxt.getDTM(context);
- int t = dtm.getNodeType(context);
- if(t == DTM.ELEMENT_NODE)
- {
- s = dtm.getNamespaceURI(context);
- }
- else if(t == DTM.ATTRIBUTE_NODE)
- {
-
- // This function always returns an empty string for namespace nodes.
- // We check for those here. Fix inspired by Davanum Srinivas.
-
- s = dtm.getNodeName(context);
- if(s.startsWith("xmlns:") || s.equals("xmlns"))
- return XString.EMPTYSTRING;
-
- s = dtm.getNamespaceURI(context);
- }
- else
- return XString.EMPTYSTRING;
- }
- else
- return XString.EMPTYSTRING;
-
- return ((null == s) ? XString.EMPTYSTRING : new XString(s));
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/functions/FuncNormalizeSpace.java b/src/com/sun/org/apache/xpath/internal/functions/FuncNormalizeSpace.java
deleted file mode 100644
index 9be6259..0000000
--- a/src/com/sun/org/apache/xpath/internal/functions/FuncNormalizeSpace.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FuncNormalizeSpace.java,v 1.2.4.1 2005/09/14 20:18:46 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.functions;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.utils.XMLString;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-import com.sun.org.apache.xpath.internal.objects.XString;
-import org.xml.sax.ContentHandler;
-
-/**
- * Execute the normalize-space() function.
- * @xsl.usage advanced
- */
-public class FuncNormalizeSpace extends FunctionDef1Arg
-{
- static final long serialVersionUID = -3377956872032190880L;
-
- /**
- * Execute the function. The function must return
- * a valid object.
- * @param xctxt The current execution context.
- * @return A valid XObject.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
- {
- XMLString s1 = getArg0AsString(xctxt);
-
- return (XString)s1.fixWhiteSpace(true, true, false);
- }
-
- /**
- * Execute an expression in the XPath runtime context, and return the
- * result of the expression.
- *
- *
- * @param xctxt The XPath runtime context.
- *
- * @return The result of the expression in the form of a <code>XObject</code>.
- *
- * @throws javax.xml.transform.TransformerException if a runtime exception
- * occurs.
- */
- public void executeCharsToContentHandler(XPathContext xctxt,
- ContentHandler handler)
- throws javax.xml.transform.TransformerException,
- org.xml.sax.SAXException
- {
- if(Arg0IsNodesetExpr())
- {
- int node = getArg0AsNode(xctxt);
- if(DTM.NULL != node)
- {
- DTM dtm = xctxt.getDTM(node);
- dtm.dispatchCharactersEvents(node, handler, true);
- }
- }
- else
- {
- XObject obj = execute(xctxt);
- obj.dispatchCharactersEvents(handler);
- }
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/functions/FuncNot.java b/src/com/sun/org/apache/xpath/internal/functions/FuncNot.java
deleted file mode 100644
index 476d432..0000000
--- a/src/com/sun/org/apache/xpath/internal/functions/FuncNot.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FuncNot.java,v 1.2.4.1 2005/09/14 20:18:44 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.functions;
-
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XBoolean;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-/**
- * Execute the Not() function.
- * @xsl.usage advanced
- */
-public class FuncNot extends FunctionOneArg
-{
- static final long serialVersionUID = 7299699961076329790L;
-
- /**
- * Execute the function. The function must return
- * a valid object.
- * @param xctxt The current execution context.
- * @return A valid XObject.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
- {
- return m_arg0.execute(xctxt).bool() ? XBoolean.S_FALSE : XBoolean.S_TRUE;
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/functions/FuncNumber.java b/src/com/sun/org/apache/xpath/internal/functions/FuncNumber.java
deleted file mode 100644
index 87c3808..0000000
--- a/src/com/sun/org/apache/xpath/internal/functions/FuncNumber.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FuncNumber.java,v 1.2.4.1 2005/09/14 20:18:44 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.functions;
-
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XNumber;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-/**
- * Execute the Number() function.
- * @xsl.usage advanced
- */
-public class FuncNumber extends FunctionDef1Arg
-{
- static final long serialVersionUID = 7266745342264153076L;
-
- /**
- * Execute the function. The function must return
- * a valid object.
- * @param xctxt The current execution context.
- * @return A valid XObject.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
- {
- return new XNumber(getArg0AsNumber(xctxt));
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/functions/FuncPosition.java b/src/com/sun/org/apache/xpath/internal/functions/FuncPosition.java
deleted file mode 100644
index 719cece..0000000
--- a/src/com/sun/org/apache/xpath/internal/functions/FuncPosition.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FuncPosition.java,v 1.2.4.1 2005/09/14 20:18:45 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.functions;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMIterator;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.axes.SubContextList;
-import com.sun.org.apache.xpath.internal.compiler.Compiler;
-import com.sun.org.apache.xpath.internal.objects.XNumber;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-/**
- * Execute the Position() function.
- * @xsl.usage advanced
- */
-public class FuncPosition extends Function
-{
- static final long serialVersionUID = -9092846348197271582L;
- private boolean m_isTopLevel;
-
- /**
- * Figure out if we're executing a toplevel expression.
- * If so, we can't be inside of a predicate.
- */
- public void postCompileStep(Compiler compiler)
- {
- m_isTopLevel = compiler.getLocationPathDepth() == -1;
- }
-
- /**
- * Get the position in the current context node list.
- *
- * @param xctxt Runtime XPath context.
- *
- * @return The current position of the itteration in the context node list,
- * or -1 if there is no active context node list.
- */
- public int getPositionInContextNodeList(XPathContext xctxt)
- {
-
- // System.out.println("FuncPosition- entry");
- // If we're in a predicate, then this will return non-null.
- SubContextList iter = m_isTopLevel ? null : xctxt.getSubContextList();
-
- if (null != iter)
- {
- int prox = iter.getProximityPosition(xctxt);
-
- // System.out.println("FuncPosition- prox: "+prox);
- return prox;
- }
-
- DTMIterator cnl = xctxt.getContextNodeList();
-
- if (null != cnl)
- {
- int n = cnl.getCurrentNode();
- if(n == DTM.NULL)
- {
- if(cnl.getCurrentPos() == 0)
- return 0;
-
- // Then I think we're in a sort. See sort21.xsl. So the iterator has
- // already been spent, and is not on the node we're processing.
- // It's highly possible that this is an issue for other context-list
- // functions. Shouldn't be a problem for last(), and it shouldn't be
- // a problem for current().
- try
- {
- cnl = cnl.cloneWithReset();
- }
- catch(CloneNotSupportedException cnse)
- {
- throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(cnse);
- }
- int currentNode = xctxt.getContextNode();
- // System.out.println("currentNode: "+currentNode);
- while(DTM.NULL != (n = cnl.nextNode()))
- {
- if(n == currentNode)
- break;
- }
- }
- // System.out.println("n: "+n);
- // System.out.println("FuncPosition- cnl.getCurrentPos(): "+cnl.getCurrentPos());
- return cnl.getCurrentPos();
- }
-
- // System.out.println("FuncPosition - out of guesses: -1");
- return -1;
- }
-
- /**
- * Execute the function. The function must return
- * a valid object.
- * @param xctxt The current execution context.
- * @return A valid XObject.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
- {
- double pos = (double) getPositionInContextNodeList(xctxt);
-
- return new XNumber(pos);
- }
-
- /**
- * No arguments to process, so this does nothing.
- */
- public void fixupVariables(java.util.Vector vars, int globalsSize)
- {
- // no-op
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/functions/FuncQname.java b/src/com/sun/org/apache/xpath/internal/functions/FuncQname.java
deleted file mode 100644
index 834d73f..0000000
--- a/src/com/sun/org/apache/xpath/internal/functions/FuncQname.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FuncQname.java,v 1.2.4.1 2005/09/14 20:18:46 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.functions;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-import com.sun.org.apache.xpath.internal.objects.XString;
-
-/**
- * Execute the Qname() function.
- * @xsl.usage advanced
- */
-public class FuncQname extends FunctionDef1Arg
-{
- static final long serialVersionUID = -1532307875532617380L;
-
- /**
- * Execute the function. The function must return
- * a valid object.
- * @param xctxt The current execution context.
- * @return A valid XObject.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
- {
-
- int context = getArg0AsNode(xctxt);
- XObject val;
-
- if (DTM.NULL != context)
- {
- DTM dtm = xctxt.getDTM(context);
- String qname = dtm.getNodeNameX(context);
- val = (null == qname) ? XString.EMPTYSTRING : new XString(qname);
- }
- else
- {
- val = XString.EMPTYSTRING;
- }
-
- return val;
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/functions/FuncRound.java b/src/com/sun/org/apache/xpath/internal/functions/FuncRound.java
deleted file mode 100644
index ef23ecc..0000000
--- a/src/com/sun/org/apache/xpath/internal/functions/FuncRound.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FuncRound.java,v 1.2.4.1 2005/09/14 20:18:42 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.functions;
-
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XNumber;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-/**
- * Execute the round() function.
- * @xsl.usage advanced
- */
-public class FuncRound extends FunctionOneArg
-{
- static final long serialVersionUID = -7970583902573826611L;
-
- /**
- * Execute the function. The function must return
- * a valid object.
- * @param xctxt The current execution context.
- * @return A valid XObject.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
- {
- final XObject obj = m_arg0.execute(xctxt);
- final double val= obj.num();
- if (val >= -0.5 && val < 0) return new XNumber(-0.0);
- if (val == 0.0) return new XNumber(val);
- return new XNumber(java.lang.Math.floor(val
- + 0.5));
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/functions/FuncStartsWith.java b/src/com/sun/org/apache/xpath/internal/functions/FuncStartsWith.java
deleted file mode 100644
index 43b7661..0000000
--- a/src/com/sun/org/apache/xpath/internal/functions/FuncStartsWith.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FuncStartsWith.java,v 1.2.4.1 2005/09/14 20:18:43 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.functions;
-
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XBoolean;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-/**
- * Execute the StartsWith() function.
- * @xsl.usage advanced
- */
-public class FuncStartsWith extends Function2Args
-{
- static final long serialVersionUID = 2194585774699567928L;
-
- /**
- * Execute the function. The function must return
- * a valid object.
- * @param xctxt The current execution context.
- * @return A valid XObject.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
- {
- return m_arg0.execute(xctxt).xstr().startsWith(m_arg1.execute(xctxt).xstr())
- ? XBoolean.S_TRUE : XBoolean.S_FALSE;
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/functions/FuncString.java b/src/com/sun/org/apache/xpath/internal/functions/FuncString.java
deleted file mode 100644
index 75b1085..0000000
--- a/src/com/sun/org/apache/xpath/internal/functions/FuncString.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FuncString.java,v 1.2.4.1 2005/09/14 20:18:44 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.functions;
-
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-import com.sun.org.apache.xpath.internal.objects.XString;
-
-/**
- * Execute the String() function.
- * @xsl.usage advanced
- */
-public class FuncString extends FunctionDef1Arg
-{
- static final long serialVersionUID = -2206677149497712883L;
-
- /**
- * Execute the function. The function must return
- * a valid object.
- * @param xctxt The current execution context.
- * @return A valid XObject.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
- {
- return (XString)getArg0AsString(xctxt);
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/functions/FuncStringLength.java b/src/com/sun/org/apache/xpath/internal/functions/FuncStringLength.java
deleted file mode 100644
index 5d69ba3..0000000
--- a/src/com/sun/org/apache/xpath/internal/functions/FuncStringLength.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FuncStringLength.java,v 1.2.4.1 2005/09/14 20:18:44 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.functions;
-
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XNumber;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-/**
- * Execute the StringLength() function.
- * @xsl.usage advanced
- */
-public class FuncStringLength extends FunctionDef1Arg
-{
- static final long serialVersionUID = -159616417996519839L;
-
- /**
- * Execute the function. The function must return
- * a valid object.
- * @param xctxt The current execution context.
- * @return A valid XObject.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
- {
- return new XNumber(getArg0AsString(xctxt).length());
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/functions/FuncSubstring.java b/src/com/sun/org/apache/xpath/internal/functions/FuncSubstring.java
deleted file mode 100644
index 98aedf7..0000000
--- a/src/com/sun/org/apache/xpath/internal/functions/FuncSubstring.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FuncSubstring.java,v 1.2.4.1 2005/09/14 20:18:45 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.functions;
-
-import com.sun.org.apache.xalan.internal.res.XSLMessages;
-import com.sun.org.apache.xml.internal.utils.XMLString;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-import com.sun.org.apache.xpath.internal.objects.XString;
-import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
-
-/**
- * Execute the Substring() function.
- * @xsl.usage advanced
- */
-public class FuncSubstring extends Function3Args
-{
- static final long serialVersionUID = -5996676095024715502L;
-
- /**
- * Execute the function. The function must return
- * a valid object.
- * @param xctxt The current execution context.
- * @return A valid XObject.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
- {
-
- XMLString s1 = m_arg0.execute(xctxt).xstr();
- double start = m_arg1.execute(xctxt).num();
- int lenOfS1 = s1.length();
- XMLString substr;
-
- if (lenOfS1 <= 0)
- return XString.EMPTYSTRING;
- else
- {
- int startIndex;
-
- if (Double.isNaN(start))
- {
-
- // Double.MIN_VALUE doesn't work with math below
- // so just use a big number and hope I never get caught.
- start = -1000000;
- startIndex = 0;
- }
- else
- {
- start = Math.round(start);
- startIndex = (start > 0) ? (int) start - 1 : 0;
- }
-
- if (null != m_arg2)
- {
- double len = m_arg2.num(xctxt);
- int end = (int) (Math.round(len) + start) - 1;
-
- // Normalize end index.
- if (end < 0)
- end = 0;
- else if (end > lenOfS1)
- end = lenOfS1;
-
- if (startIndex > lenOfS1)
- startIndex = lenOfS1;
-
- substr = s1.substring(startIndex, end);
- }
- else
- {
- if (startIndex > lenOfS1)
- startIndex = lenOfS1;
- substr = s1.substring(startIndex);
- }
- }
-
- return (XString)substr; // cast semi-safe
- }
-
- /**
- * Check that the number of arguments passed to this function is correct.
- *
- *
- * @param argNum The number of arguments that is being passed to the function.
- *
- * @throws WrongNumberArgsException
- */
- public void checkNumberArgs(int argNum) throws WrongNumberArgsException
- {
- if (argNum < 2)
- reportWrongNumberArgs();
- }
-
- /**
- * Constructs and throws a WrongNumberArgException with the appropriate
- * message for this function object.
- *
- * @throws WrongNumberArgsException
- */
- protected void reportWrongNumberArgs() throws WrongNumberArgsException {
- throw new WrongNumberArgsException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_TWO_OR_THREE, null)); //"2 or 3");
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/functions/FuncSubstringAfter.java b/src/com/sun/org/apache/xpath/internal/functions/FuncSubstringAfter.java
deleted file mode 100644
index 9ab8906..0000000
--- a/src/com/sun/org/apache/xpath/internal/functions/FuncSubstringAfter.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FuncSubstringAfter.java,v 1.2.4.1 2005/09/14 20:18:43 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.functions;
-
-import com.sun.org.apache.xml.internal.utils.XMLString;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-import com.sun.org.apache.xpath.internal.objects.XString;
-
-/**
- * Execute the SubstringAfter() function.
- * @xsl.usage advanced
- */
-public class FuncSubstringAfter extends Function2Args
-{
- static final long serialVersionUID = -8119731889862512194L;
-
- /**
- * Execute the function. The function must return
- * a valid object.
- * @param xctxt The current execution context.
- * @return A valid XObject.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
- {
-
- XMLString s1 = m_arg0.execute(xctxt).xstr();
- XMLString s2 = m_arg1.execute(xctxt).xstr();
- int index = s1.indexOf(s2);
-
- return (-1 == index)
- ? XString.EMPTYSTRING
- : (XString)s1.substring(index + s2.length());
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/functions/FuncSubstringBefore.java b/src/com/sun/org/apache/xpath/internal/functions/FuncSubstringBefore.java
deleted file mode 100644
index dccc868..0000000
--- a/src/com/sun/org/apache/xpath/internal/functions/FuncSubstringBefore.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FuncSubstringBefore.java,v 1.2.4.1 2005/09/14 20:18:47 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.functions;
-
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-import com.sun.org.apache.xpath.internal.objects.XString;
-
-/**
- * Execute the SubstringBefore() function.
- * @xsl.usage advanced
- */
-public class FuncSubstringBefore extends Function2Args
-{
- static final long serialVersionUID = 4110547161672431775L;
-
- /**
- * Execute the function. The function must return
- * a valid object.
- * @param xctxt The current execution context.
- * @return A valid XObject.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
- {
-
- String s1 = m_arg0.execute(xctxt).str();
- String s2 = m_arg1.execute(xctxt).str();
- int index = s1.indexOf(s2);
-
- return (-1 == index)
- ? XString.EMPTYSTRING : new XString(s1.substring(0, index));
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/functions/FuncSum.java b/src/com/sun/org/apache/xpath/internal/functions/FuncSum.java
deleted file mode 100644
index f1a6d1d..0000000
--- a/src/com/sun/org/apache/xpath/internal/functions/FuncSum.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FuncSum.java,v 1.2.4.1 2005/09/14 20:18:46 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.functions;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMIterator;
-import com.sun.org.apache.xml.internal.utils.XMLString;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XNumber;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-/**
- * Execute the Sum() function.
- * @xsl.usage advanced
- */
-public class FuncSum extends FunctionOneArg
-{
- static final long serialVersionUID = -2719049259574677519L;
-
- /**
- * Execute the function. The function must return
- * a valid object.
- * @param xctxt The current execution context.
- * @return A valid XObject.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
- {
-
- DTMIterator nodes = m_arg0.asIterator(xctxt, xctxt.getCurrentNode());
- double sum = 0.0;
- int pos;
-
- while (DTM.NULL != (pos = nodes.nextNode()))
- {
- DTM dtm = nodes.getDTM(pos);
- XMLString s = dtm.getStringValue(pos);
-
- if (null != s)
- sum += s.toDouble();
- }
- nodes.detach();
-
- return new XNumber(sum);
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/functions/FuncSystemProperty.java b/src/com/sun/org/apache/xpath/internal/functions/FuncSystemProperty.java
deleted file mode 100644
index 4f9a968..0000000
--- a/src/com/sun/org/apache/xpath/internal/functions/FuncSystemProperty.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FuncSystemProperty.java,v 1.2.4.2 2005/09/14 20:18:45 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.functions;
-
-import java.io.BufferedInputStream;
-import java.io.InputStream;
-import java.util.Properties;
-
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XNumber;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-import com.sun.org.apache.xpath.internal.objects.XString;
-import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
-import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
-import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
-
-/**
- * Execute the SystemProperty() function.
- * @xsl.usage advanced
- */
-public class FuncSystemProperty extends FunctionOneArg
-{
- static final long serialVersionUID = 3694874980992204867L;
- /**
- * The path/filename of the property file: XSLTInfo.properties
- * Maintenance note: see also
- * com.sun.org.apache.xalan.internal.processor.TransformerFactoryImpl.XSLT_PROPERTIES
- */
- static final String XSLT_PROPERTIES =
- "com/sun/org/apache/xalan/internal/res/XSLTInfo.properties";
-
- /**
- * Execute the function. The function must return
- * a valid object.
- * @param xctxt The current execution context.
- * @return A valid XObject.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
- {
-
- String fullName = m_arg0.execute(xctxt).str();
- int indexOfNSSep = fullName.indexOf(':');
- String result;
- String propName = "";
-
- // List of properties where the name of the
- // property argument is to be looked for.
- Properties xsltInfo = new Properties();
-
- loadPropertyFile(XSLT_PROPERTIES, xsltInfo);
-
- if (indexOfNSSep > 0)
- {
- String prefix = (indexOfNSSep >= 0)
- ? fullName.substring(0, indexOfNSSep) : "";
- String namespace;
-
- namespace = xctxt.getNamespaceContext().getNamespaceForPrefix(prefix);
- propName = (indexOfNSSep < 0)
- ? fullName : fullName.substring(indexOfNSSep + 1);
-
- if (namespace.startsWith("http://www.w3.org/XSL/Transform")
- || namespace.equals("http://www.w3.org/1999/XSL/Transform"))
- {
- result = xsltInfo.getProperty(propName);
-
- if (null == result)
- {
- warn(xctxt, XPATHErrorResources.WG_PROPERTY_NOT_SUPPORTED,
- new Object[]{ fullName }); //"XSL Property not supported: "+fullName);
-
- return XString.EMPTYSTRING;
- }
- }
- else
- {
- warn(xctxt, XPATHErrorResources.WG_DONT_DO_ANYTHING_WITH_NS,
- new Object[]{ namespace,
- fullName }); //"Don't currently do anything with namespace "+namespace+" in property: "+fullName);
-
- try
- {
- result = SecuritySupport.getSystemProperty(propName);
-
- if (null == result)
- {
-
- // result = System.getenv(propName);
- return XString.EMPTYSTRING;
- }
- }
- catch (SecurityException se)
- {
- warn(xctxt, XPATHErrorResources.WG_SECURITY_EXCEPTION,
- new Object[]{ fullName }); //"SecurityException when trying to access XSL system property: "+fullName);
-
- return XString.EMPTYSTRING;
- }
- }
- }
- else
- {
- try
- {
- result = SecuritySupport.getSystemProperty(fullName);
-
- if (null == result)
- {
-
- // result = System.getenv(fullName);
- return XString.EMPTYSTRING;
- }
- }
- catch (SecurityException se)
- {
- warn(xctxt, XPATHErrorResources.WG_SECURITY_EXCEPTION,
- new Object[]{ fullName }); //"SecurityException when trying to access XSL system property: "+fullName);
-
- return XString.EMPTYSTRING;
- }
- }
-
- if (propName.equals("version") && result.length() > 0)
- {
- try
- {
- // Needs to return the version number of the spec we conform to.
- return new XString("1.0");
- }
- catch (Exception ex)
- {
- return new XString(result);
- }
- }
- else
- return new XString(result);
- }
-
- /**
- * Retrieve a propery bundle from a specified file
- *
- * @param file The string name of the property file. The name
- * should already be fully qualified as path/filename
- * @param target The target property bag the file will be placed into.
- */
- public void loadPropertyFile(String file, Properties target)
- {
- try
- {
- // Use SecuritySupport class to provide priveleged access to property file
- InputStream is = SecuritySupport.getResourceAsStream(ObjectFactory.findClassLoader(),
- file);
-
- // get a buffered version
- BufferedInputStream bis = new BufferedInputStream(is);
-
- target.load(bis); // and load up the property bag from this
- bis.close(); // close out after reading
- }
- catch (Exception ex)
- {
- // ex.printStackTrace();
- throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(ex);
- }
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/functions/FuncTranslate.java b/src/com/sun/org/apache/xpath/internal/functions/FuncTranslate.java
deleted file mode 100644
index 9878195..0000000
--- a/src/com/sun/org/apache/xpath/internal/functions/FuncTranslate.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FuncTranslate.java,v 1.2.4.1 2005/09/14 20:18:45 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.functions;
-
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-import com.sun.org.apache.xpath.internal.objects.XString;
-
-/**
- * Execute the Translate() function.
- * @xsl.usage advanced
- */
-public class FuncTranslate extends Function3Args
-{
- static final long serialVersionUID = -1672834340026116482L;
-
- /**
- * Execute the function. The function must return
- * a valid object.
- * @param xctxt The current execution context.
- * @return A valid XObject.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
- {
-
- String theFirstString = m_arg0.execute(xctxt).str();
- String theSecondString = m_arg1.execute(xctxt).str();
- String theThirdString = m_arg2.execute(xctxt).str();
- int theFirstStringLength = theFirstString.length();
- int theThirdStringLength = theThirdString.length();
-
- // A vector to contain the new characters. We'll use it to construct
- // the result string.
- StringBuffer sbuffer = new StringBuffer();
-
- for (int i = 0; i < theFirstStringLength; i++)
- {
- char theCurrentChar = theFirstString.charAt(i);
- int theIndex = theSecondString.indexOf(theCurrentChar);
-
- if (theIndex < 0)
- {
-
- // Didn't find the character in the second string, so it
- // is not translated.
- sbuffer.append(theCurrentChar);
- }
- else if (theIndex < theThirdStringLength)
- {
-
- // OK, there's a corresponding character in the
- // third string, so do the translation...
- sbuffer.append(theThirdString.charAt(theIndex));
- }
- else
- {
-
- // There's no corresponding character in the
- // third string, since it's shorter than the
- // second string. In this case, the character
- // is removed from the output string, so don't
- // do anything.
- }
- }
-
- return new XString(sbuffer.toString());
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/functions/FuncTrue.java b/src/com/sun/org/apache/xpath/internal/functions/FuncTrue.java
deleted file mode 100644
index 9c09bc5..0000000
--- a/src/com/sun/org/apache/xpath/internal/functions/FuncTrue.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FuncTrue.java,v 1.2.4.1 2005/09/14 20:18:44 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.functions;
-
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XBoolean;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-/**
- * Execute the True() function.
- * @xsl.usage advanced
- */
-public class FuncTrue extends Function
-{
- static final long serialVersionUID = 5663314547346339447L;
-
- /**
- * Execute the function. The function must return
- * a valid object.
- * @param xctxt The current execution context.
- * @return A valid XObject.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
- {
- return XBoolean.S_TRUE;
- }
-
- /**
- * No arguments to process, so this does nothing.
- */
- public void fixupVariables(java.util.Vector vars, int globalsSize)
- {
- // no-op
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/functions/FuncUnparsedEntityURI.java b/src/com/sun/org/apache/xpath/internal/functions/FuncUnparsedEntityURI.java
deleted file mode 100644
index a2a587d..0000000
--- a/src/com/sun/org/apache/xpath/internal/functions/FuncUnparsedEntityURI.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FuncUnparsedEntityURI.java,v 1.2.4.1 2005/09/14 20:18:46 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.functions;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-import com.sun.org.apache.xpath.internal.objects.XString;
-
-/**
- * @xsl.usage advanced
- */
-public class FuncUnparsedEntityURI extends FunctionOneArg
-{
- static final long serialVersionUID = 845309759097448178L;
-
- /**
- * Execute the function. The function must return
- * a valid object.
- * @param xctxt The current execution context.
- * @return A valid XObject.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
- {
-
- String name = m_arg0.execute(xctxt).str();
- int context = xctxt.getCurrentNode();
- DTM dtm = xctxt.getDTM(context);
- int doc = dtm.getDocument();
-
- String uri = dtm.getUnparsedEntityURI(name);
-
- return new XString(uri);
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/functions/Function.java b/src/com/sun/org/apache/xpath/internal/functions/Function.java
deleted file mode 100644
index 3aab9ef..0000000
--- a/src/com/sun/org/apache/xpath/internal/functions/Function.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Function.java,v 1.2.4.1 2005/09/14 20:18:43 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.functions;
-
-import com.sun.org.apache.xalan.internal.res.XSLMessages;
-import com.sun.org.apache.xpath.internal.Expression;
-import com.sun.org.apache.xpath.internal.ExpressionOwner;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.XPathVisitor;
-import com.sun.org.apache.xpath.internal.compiler.Compiler;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-/**
- * This is a superclass of all XPath functions. This allows two
- * ways for the class to be called. One method is that the
- * super class processes the arguments and hands the results to
- * the derived class, the other method is that the derived
- * class may process it's own arguments, which is faster since
- * the arguments don't have to be added to an array, but causes
- * a larger code footprint.
- * @xsl.usage advanced
- */
-public abstract class Function extends Expression
-{
- static final long serialVersionUID = 6927661240854599768L;
-
- /**
- * Set an argument expression for a function. This method is called by the
- * XPath compiler.
- *
- * @param arg non-null expression that represents the argument.
- * @param argNum The argument number index.
- *
- * @throws WrongNumberArgsException If the argNum parameter is beyond what
- * is specified for this function.
- */
- public void setArg(Expression arg, int argNum)
- throws WrongNumberArgsException
- {
- // throw new WrongNumberArgsException(XSLMessages.createXPATHMessage("zero", null));
- reportWrongNumberArgs();
- }
-
- /**
- * Check that the number of arguments passed to this function is correct.
- * This method is meant to be overloaded by derived classes, to check for
- * the number of arguments for a specific function type. This method is
- * called by the compiler for static number of arguments checking.
- *
- * @param argNum The number of arguments that is being passed to the function.
- *
- * @throws WrongNumberArgsException
- */
- public void checkNumberArgs(int argNum) throws WrongNumberArgsException
- {
- if (argNum != 0)
- reportWrongNumberArgs();
- }
-
- /**
- * Constructs and throws a WrongNumberArgException with the appropriate
- * message for this function object. This method is meant to be overloaded
- * by derived classes so that the message will be as specific as possible.
- *
- * @throws WrongNumberArgsException
- */
- protected void reportWrongNumberArgs() throws WrongNumberArgsException {
- throw new WrongNumberArgsException(XSLMessages.createXPATHMessage("zero", null));
- }
-
- /**
- * Execute an XPath function object. The function must return
- * a valid object.
- * @param xctxt The execution current context.
- * @return A valid XObject.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
- {
-
- // Programmer's assert. (And, no, I don't want the method to be abstract).
- System.out.println("Error! Function.execute should not be called!");
-
- return null;
- }
-
- /**
- * Call the visitors for the function arguments.
- */
- public void callArgVisitors(XPathVisitor visitor)
- {
- }
-
-
- /**
- * @see com.sun.org.apache.xpath.internal.XPathVisitable#callVisitors(ExpressionOwner, XPathVisitor)
- */
- public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)
- {
- if(visitor.visitFunction(owner, this))
- {
- callArgVisitors(visitor);
- }
- }
-
- /**
- * @see Expression#deepEquals(Expression)
- */
- public boolean deepEquals(Expression expr)
- {
- if(!isSameClass(expr))
- return false;
-
- return true;
- }
-
- /**
- * This function is currently only being used by Position()
- * and Last(). See respective functions for more detail.
- */
- public void postCompileStep(Compiler compiler)
- {
- // no default action
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/functions/Function2Args.java b/src/com/sun/org/apache/xpath/internal/functions/Function2Args.java
deleted file mode 100644
index 64f8e7f..0000000
--- a/src/com/sun/org/apache/xpath/internal/functions/Function2Args.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Function2Args.java,v 1.2.4.1 2005/09/14 20:18:46 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.functions;
-
-import com.sun.org.apache.xalan.internal.res.XSLMessages;
-import com.sun.org.apache.xpath.internal.Expression;
-import com.sun.org.apache.xpath.internal.ExpressionOwner;
-import com.sun.org.apache.xpath.internal.XPathVisitor;
-
-/**
- * Base class for functions that accept two arguments.
- * @xsl.usage advanced
- */
-public class Function2Args extends FunctionOneArg
-{
- static final long serialVersionUID = 5574294996842710641L;
-
- /** The second argument passed to the function (at index 1).
- * @serial */
- Expression m_arg1;
-
- /**
- * Return the second argument passed to the function (at index 1).
- *
- * @return An expression that represents the second argument passed to the
- * function.
- */
- public Expression getArg1()
- {
- return m_arg1;
- }
-
- /**
- * This function is used to fixup variables from QNames to stack frame
- * indexes at stylesheet build time.
- * @param vars List of QNames that correspond to variables. This list
- * should be searched backwards for the first qualified name that
- * corresponds to the variable reference qname. The position of the
- * QName in the vector from the start of the vector will be its position
- * in the stack frame (but variables above the globalsTop value will need
- * to be offset to the current stack frame).
- */
- public void fixupVariables(java.util.Vector vars, int globalsSize)
- {
- super.fixupVariables(vars, globalsSize);
- if(null != m_arg1)
- m_arg1.fixupVariables(vars, globalsSize);
- }
-
-
- /**
- * Set an argument expression for a function. This method is called by the
- * XPath compiler.
- *
- * @param arg non-null expression that represents the argument.
- * @param argNum The argument number index.
- *
- * @throws WrongNumberArgsException If the argNum parameter is greater than 1.
- */
- public void setArg(Expression arg, int argNum)
- throws WrongNumberArgsException
- {
-
- // System.out.println("argNum: "+argNum);
- if (argNum == 0)
- super.setArg(arg, argNum);
- else if (1 == argNum)
- {
- m_arg1 = arg;
- arg.exprSetParent(this);
- }
- else
- reportWrongNumberArgs();
- }
-
- /**
- * Check that the number of arguments passed to this function is correct.
- *
- *
- * @param argNum The number of arguments that is being passed to the function.
- *
- * @throws WrongNumberArgsException
- */
- public void checkNumberArgs(int argNum) throws WrongNumberArgsException
- {
- if (argNum != 2)
- reportWrongNumberArgs();
- }
-
- /**
- * Constructs and throws a WrongNumberArgException with the appropriate
- * message for this function object.
- *
- * @throws WrongNumberArgsException
- */
- protected void reportWrongNumberArgs() throws WrongNumberArgsException {
- throw new WrongNumberArgsException(XSLMessages.createXPATHMessage("two", null));
- }
-
- /**
- * Tell if this expression or it's subexpressions can traverse outside
- * the current subtree.
- *
- * @return true if traversal outside the context node's subtree can occur.
- */
- public boolean canTraverseOutsideSubtree()
- {
- return super.canTraverseOutsideSubtree()
- ? true : m_arg1.canTraverseOutsideSubtree();
- }
-
- class Arg1Owner implements ExpressionOwner
- {
- /**
- * @see ExpressionOwner#getExpression()
- */
- public Expression getExpression()
- {
- return m_arg1;
- }
-
-
- /**
- * @see ExpressionOwner#setExpression(Expression)
- */
- public void setExpression(Expression exp)
- {
- exp.exprSetParent(Function2Args.this);
- m_arg1 = exp;
- }
- }
-
-
- /**
- * @see com.sun.org.apache.xpath.internal.XPathVisitable#callVisitors(ExpressionOwner, XPathVisitor)
- */
- public void callArgVisitors(XPathVisitor visitor)
- {
- super.callArgVisitors(visitor);
- if(null != m_arg1)
- m_arg1.callVisitors(new Arg1Owner(), visitor);
- }
-
- /**
- * @see Expression#deepEquals(Expression)
- */
- public boolean deepEquals(Expression expr)
- {
- if(!super.deepEquals(expr))
- return false;
-
- if(null != m_arg1)
- {
- if(null == ((Function2Args)expr).m_arg1)
- return false;
-
- if(!m_arg1.deepEquals(((Function2Args)expr).m_arg1))
- return false;
- }
- else if(null != ((Function2Args)expr).m_arg1)
- return false;
-
- return true;
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/functions/Function3Args.java b/src/com/sun/org/apache/xpath/internal/functions/Function3Args.java
deleted file mode 100644
index fd75784..0000000
--- a/src/com/sun/org/apache/xpath/internal/functions/Function3Args.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Function3Args.java,v 1.2.4.1 2005/09/14 20:18:42 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.functions;
-
-import com.sun.org.apache.xalan.internal.res.XSLMessages;
-import com.sun.org.apache.xpath.internal.Expression;
-import com.sun.org.apache.xpath.internal.ExpressionOwner;
-import com.sun.org.apache.xpath.internal.XPathVisitor;
-
-/**
- * Base class for functions that accept three arguments.
- * @xsl.usage advanced
- */
-public class Function3Args extends Function2Args
-{
- static final long serialVersionUID = 7915240747161506646L;
-
- /** The third argument passed to the function (at index 2).
- * @serial */
- Expression m_arg2;
-
- /**
- * Return the third argument passed to the function (at index 2).
- *
- * @return An expression that represents the third argument passed to the
- * function.
- */
- public Expression getArg2()
- {
- return m_arg2;
- }
-
- /**
- * This function is used to fixup variables from QNames to stack frame
- * indexes at stylesheet build time.
- * @param vars List of QNames that correspond to variables. This list
- * should be searched backwards for the first qualified name that
- * corresponds to the variable reference qname. The position of the
- * QName in the vector from the start of the vector will be its position
- * in the stack frame (but variables above the globalsTop value will need
- * to be offset to the current stack frame).
- */
- public void fixupVariables(java.util.Vector vars, int globalsSize)
- {
- super.fixupVariables(vars, globalsSize);
- if(null != m_arg2)
- m_arg2.fixupVariables(vars, globalsSize);
- }
-
- /**
- * Set an argument expression for a function. This method is called by the
- * XPath compiler.
- *
- * @param arg non-null expression that represents the argument.
- * @param argNum The argument number index.
- *
- * @throws WrongNumberArgsException If the argNum parameter is greater than 2.
- */
- public void setArg(Expression arg, int argNum)
- throws WrongNumberArgsException
- {
-
- if (argNum < 2)
- super.setArg(arg, argNum);
- else if (2 == argNum)
- {
- m_arg2 = arg;
- arg.exprSetParent(this);
- }
- else
- reportWrongNumberArgs();
- }
-
- /**
- * Check that the number of arguments passed to this function is correct.
- *
- *
- * @param argNum The number of arguments that is being passed to the function.
- *
- * @throws WrongNumberArgsException
- */
- public void checkNumberArgs(int argNum) throws WrongNumberArgsException
- {
- if (argNum != 3)
- reportWrongNumberArgs();
- }
-
- /**
- * Constructs and throws a WrongNumberArgException with the appropriate
- * message for this function object.
- *
- * @throws WrongNumberArgsException
- */
- protected void reportWrongNumberArgs() throws WrongNumberArgsException {
- throw new WrongNumberArgsException(XSLMessages.createXPATHMessage("three", null));
- }
-
- /**
- * Tell if this expression or it's subexpressions can traverse outside
- * the current subtree.
- *
- * @return true if traversal outside the context node's subtree can occur.
- */
- public boolean canTraverseOutsideSubtree()
- {
- return super.canTraverseOutsideSubtree()
- ? true : m_arg2.canTraverseOutsideSubtree();
- }
-
- class Arg2Owner implements ExpressionOwner
- {
- /**
- * @see ExpressionOwner#getExpression()
- */
- public Expression getExpression()
- {
- return m_arg2;
- }
-
-
- /**
- * @see ExpressionOwner#setExpression(Expression)
- */
- public void setExpression(Expression exp)
- {
- exp.exprSetParent(Function3Args.this);
- m_arg2 = exp;
- }
- }
-
-
- /**
- * @see com.sun.org.apache.xpath.internal.XPathVisitable#callVisitors(ExpressionOwner, XPathVisitor)
- */
- public void callArgVisitors(XPathVisitor visitor)
- {
- super.callArgVisitors(visitor);
- if(null != m_arg2)
- m_arg2.callVisitors(new Arg2Owner(), visitor);
- }
-
- /**
- * @see Expression#deepEquals(Expression)
- */
- public boolean deepEquals(Expression expr)
- {
- if(!super.deepEquals(expr))
- return false;
-
- if(null != m_arg2)
- {
- if(null == ((Function3Args)expr).m_arg2)
- return false;
-
- if(!m_arg2.deepEquals(((Function3Args)expr).m_arg2))
- return false;
- }
- else if (null != ((Function3Args)expr).m_arg2)
- return false;
-
- return true;
- }
-
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/functions/FunctionDef1Arg.java b/src/com/sun/org/apache/xpath/internal/functions/FunctionDef1Arg.java
deleted file mode 100644
index 01574fa..0000000
--- a/src/com/sun/org/apache/xpath/internal/functions/FunctionDef1Arg.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FunctionDef1Arg.java,v 1.2.4.1 2005/09/14 20:18:42 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.functions;
-
-import com.sun.org.apache.xalan.internal.res.XSLMessages;
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.utils.XMLString;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XString;
-import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
-
-/**
- * Base class for functions that accept one argument that can be defaulted if
- * not specified.
- * @xsl.usage advanced
- */
-public class FunctionDef1Arg extends FunctionOneArg
-{
- static final long serialVersionUID = 2325189412814149264L;
-
- /**
- * Execute the first argument expression that is expected to return a
- * nodeset. If the argument is null, then return the current context node.
- *
- * @param xctxt Runtime XPath context.
- *
- * @return The first node of the executed nodeset, or the current context
- * node if the first argument is null.
- *
- * @throws javax.xml.transform.TransformerException if an error occurs while
- * executing the argument expression.
- */
- protected int getArg0AsNode(XPathContext xctxt)
- throws javax.xml.transform.TransformerException
- {
-
- return (null == m_arg0)
- ? xctxt.getCurrentNode() : m_arg0.asNode(xctxt);
- }
-
- /**
- * Tell if the expression is a nodeset expression.
- * @return true if the expression can be represented as a nodeset.
- */
- public boolean Arg0IsNodesetExpr()
- {
- return (null == m_arg0) ? true : m_arg0.isNodesetExpr();
- }
-
- /**
- * Execute the first argument expression that is expected to return a
- * string. If the argument is null, then get the string value from the
- * current context node.
- *
- * @param xctxt Runtime XPath context.
- *
- * @return The string value of the first argument, or the string value of the
- * current context node if the first argument is null.
- *
- * @throws javax.xml.transform.TransformerException if an error occurs while
- * executing the argument expression.
- */
- protected XMLString getArg0AsString(XPathContext xctxt)
- throws javax.xml.transform.TransformerException
- {
- if(null == m_arg0)
- {
- int currentNode = xctxt.getCurrentNode();
- if(DTM.NULL == currentNode)
- return XString.EMPTYSTRING;
- else
- {
- DTM dtm = xctxt.getDTM(currentNode);
- return dtm.getStringValue(currentNode);
- }
-
- }
- else
- return m_arg0.execute(xctxt).xstr();
- }
-
- /**
- * Execute the first argument expression that is expected to return a
- * number. If the argument is null, then get the number value from the
- * current context node.
- *
- * @param xctxt Runtime XPath context.
- *
- * @return The number value of the first argument, or the number value of the
- * current context node if the first argument is null.
- *
- * @throws javax.xml.transform.TransformerException if an error occurs while
- * executing the argument expression.
- */
- protected double getArg0AsNumber(XPathContext xctxt)
- throws javax.xml.transform.TransformerException
- {
-
- if(null == m_arg0)
- {
- int currentNode = xctxt.getCurrentNode();
- if(DTM.NULL == currentNode)
- return 0;
- else
- {
- DTM dtm = xctxt.getDTM(currentNode);
- XMLString str = dtm.getStringValue(currentNode);
- return str.toDouble();
- }
-
- }
- else
- return m_arg0.execute(xctxt).num();
- }
-
- /**
- * Check that the number of arguments passed to this function is correct.
- *
- * @param argNum The number of arguments that is being passed to the function.
- *
- * @throws WrongNumberArgsException if the number of arguments is not 0 or 1.
- */
- public void checkNumberArgs(int argNum) throws WrongNumberArgsException
- {
- if (argNum > 1)
- reportWrongNumberArgs();
- }
-
- /**
- * Constructs and throws a WrongNumberArgException with the appropriate
- * message for this function object.
- *
- * @throws WrongNumberArgsException
- */
- protected void reportWrongNumberArgs() throws WrongNumberArgsException {
- throw new WrongNumberArgsException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_ZERO_OR_ONE, null)); //"0 or 1");
- }
-
- /**
- * Tell if this expression or it's subexpressions can traverse outside
- * the current subtree.
- *
- * @return true if traversal outside the context node's subtree can occur.
- */
- public boolean canTraverseOutsideSubtree()
- {
- return (null == m_arg0) ? false : super.canTraverseOutsideSubtree();
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/functions/FunctionMultiArgs.java b/src/com/sun/org/apache/xpath/internal/functions/FunctionMultiArgs.java
deleted file mode 100644
index c78f3a6..0000000
--- a/src/com/sun/org/apache/xpath/internal/functions/FunctionMultiArgs.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FunctionMultiArgs.java,v 1.2.4.1 2005/09/14 20:18:43 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.functions;
-
-import com.sun.org.apache.xalan.internal.res.XSLMessages;
-import com.sun.org.apache.xpath.internal.Expression;
-import com.sun.org.apache.xpath.internal.ExpressionOwner;
-import com.sun.org.apache.xpath.internal.XPathVisitor;
-import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
-
-/**
- * Base class for functions that accept an undetermined number of multiple
- * arguments.
- * @xsl.usage advanced
- */
-public class FunctionMultiArgs extends Function3Args
-{
- static final long serialVersionUID = 7117257746138417181L;
-
- /** Argument expressions that are at index 3 or greater.
- * @serial */
- Expression[] m_args;
-
- /**
- * Return an expression array containing arguments at index 3 or greater.
- *
- * @return An array that contains the arguments at index 3 or greater.
- */
- public Expression[] getArgs()
- {
- return m_args;
- }
-
- /**
- * Set an argument expression for a function. This method is called by the
- * XPath compiler.
- *
- * @param arg non-null expression that represents the argument.
- * @param argNum The argument number index.
- *
- * @throws WrongNumberArgsException If a derived class determines that the
- * number of arguments is incorrect.
- */
- public void setArg(Expression arg, int argNum)
- throws WrongNumberArgsException
- {
-
- if (argNum < 3)
- super.setArg(arg, argNum);
- else
- {
- if (null == m_args)
- {
- m_args = new Expression[1];
- m_args[0] = arg;
- }
- else
- {
-
- // Slow but space conservative.
- Expression[] args = new Expression[m_args.length + 1];
-
- System.arraycopy(m_args, 0, args, 0, m_args.length);
-
- args[m_args.length] = arg;
- m_args = args;
- }
- arg.exprSetParent(this);
- }
- }
-
- /**
- * This function is used to fixup variables from QNames to stack frame
- * indexes at stylesheet build time.
- * @param vars List of QNames that correspond to variables. This list
- * should be searched backwards for the first qualified name that
- * corresponds to the variable reference qname. The position of the
- * QName in the vector from the start of the vector will be its position
- * in the stack frame (but variables above the globalsTop value will need
- * to be offset to the current stack frame).
- */
- public void fixupVariables(java.util.Vector vars, int globalsSize)
- {
- super.fixupVariables(vars, globalsSize);
- if(null != m_args)
- {
- for (int i = 0; i < m_args.length; i++)
- {
- m_args[i].fixupVariables(vars, globalsSize);
- }
- }
- }
-
- /**
- * Check that the number of arguments passed to this function is correct.
- *
- *
- * @param argNum The number of arguments that is being passed to the function.
- *
- * @throws WrongNumberArgsException
- */
- public void checkNumberArgs(int argNum) throws WrongNumberArgsException{}
-
- /**
- * Constructs and throws a WrongNumberArgException with the appropriate
- * message for this function object. This class supports an arbitrary
- * number of arguments, so this method must never be called.
- *
- * @throws WrongNumberArgsException
- */
- protected void reportWrongNumberArgs() throws WrongNumberArgsException {
- String fMsg = XSLMessages.createXPATHMessage(
- XPATHErrorResources.ER_INCORRECT_PROGRAMMER_ASSERTION,
- new Object[]{ "Programmer's assertion: the method FunctionMultiArgs.reportWrongNumberArgs() should never be called." });
-
- throw new RuntimeException(fMsg);
- }
-
- /**
- * Tell if this expression or it's subexpressions can traverse outside
- * the current subtree.
- *
- * @return true if traversal outside the context node's subtree can occur.
- */
- public boolean canTraverseOutsideSubtree()
- {
-
- if (super.canTraverseOutsideSubtree())
- return true;
- else
- {
- int n = m_args.length;
-
- for (int i = 0; i < n; i++)
- {
- if (m_args[i].canTraverseOutsideSubtree())
- return true;
- }
-
- return false;
- }
- }
-
- class ArgMultiOwner implements ExpressionOwner
- {
- int m_argIndex;
-
- ArgMultiOwner(int index)
- {
- m_argIndex = index;
- }
-
- /**
- * @see ExpressionOwner#getExpression()
- */
- public Expression getExpression()
- {
- return m_args[m_argIndex];
- }
-
-
- /**
- * @see ExpressionOwner#setExpression(Expression)
- */
- public void setExpression(Expression exp)
- {
- exp.exprSetParent(FunctionMultiArgs.this);
- m_args[m_argIndex] = exp;
- }
- }
-
-
- /**
- * @see com.sun.org.apache.xpath.internal.XPathVisitable#callVisitors(ExpressionOwner, XPathVisitor)
- */
- public void callArgVisitors(XPathVisitor visitor)
- {
- super.callArgVisitors(visitor);
- if (null != m_args)
- {
- int n = m_args.length;
- for (int i = 0; i < n; i++)
- {
- m_args[i].callVisitors(new ArgMultiOwner(i), visitor);
- }
- }
- }
-
- /**
- * @see Expression#deepEquals(Expression)
- */
- public boolean deepEquals(Expression expr)
- {
- if (!super.deepEquals(expr))
- return false;
-
- FunctionMultiArgs fma = (FunctionMultiArgs) expr;
- if (null != m_args)
- {
- int n = m_args.length;
- if ((null == fma) || (fma.m_args.length != n))
- return false;
-
- for (int i = 0; i < n; i++)
- {
- if (!m_args[i].deepEquals(fma.m_args[i]))
- return false;
- }
-
- }
- else if (null != fma.m_args)
- {
- return false;
- }
-
- return true;
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/functions/FunctionOneArg.java b/src/com/sun/org/apache/xpath/internal/functions/FunctionOneArg.java
deleted file mode 100644
index 12debe6..0000000
--- a/src/com/sun/org/apache/xpath/internal/functions/FunctionOneArg.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FunctionOneArg.java,v 1.2.4.1 2005/09/14 20:18:45 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.functions;
-
-import com.sun.org.apache.xalan.internal.res.XSLMessages;
-import com.sun.org.apache.xpath.internal.Expression;
-import com.sun.org.apache.xpath.internal.ExpressionOwner;
-import com.sun.org.apache.xpath.internal.XPathVisitor;
-
-/**
- * Base class for functions that accept one argument.
- * @xsl.usage advanced
- */
-public class FunctionOneArg extends Function implements ExpressionOwner
-{
- static final long serialVersionUID = -5180174180765609758L;
-
- /** The first argument passed to the function (at index 0).
- * @serial */
- Expression m_arg0;
-
- /**
- * Return the first argument passed to the function (at index 0).
- *
- * @return An expression that represents the first argument passed to the
- * function.
- */
- public Expression getArg0()
- {
- return m_arg0;
- }
-
- /**
- * Set an argument expression for a function. This method is called by the
- * XPath compiler.
- *
- * @param arg non-null expression that represents the argument.
- * @param argNum The argument number index.
- *
- * @throws WrongNumberArgsException If the argNum parameter is greater than 0.
- */
- public void setArg(Expression arg, int argNum)
- throws WrongNumberArgsException
- {
-
- if (0 == argNum)
- {
- m_arg0 = arg;
- arg.exprSetParent(this);
- }
- else
- reportWrongNumberArgs();
- }
-
- /**
- * Check that the number of arguments passed to this function is correct.
- *
- *
- * @param argNum The number of arguments that is being passed to the function.
- *
- * @throws WrongNumberArgsException
- */
- public void checkNumberArgs(int argNum) throws WrongNumberArgsException
- {
- if (argNum != 1)
- reportWrongNumberArgs();
- }
-
- /**
- * Constructs and throws a WrongNumberArgException with the appropriate
- * message for this function object.
- *
- * @throws WrongNumberArgsException
- */
- protected void reportWrongNumberArgs() throws WrongNumberArgsException {
- throw new WrongNumberArgsException(XSLMessages.createXPATHMessage("one", null));
- }
-
- /**
- * Tell if this expression or it's subexpressions can traverse outside
- * the current subtree.
- *
- * @return true if traversal outside the context node's subtree can occur.
- */
- public boolean canTraverseOutsideSubtree()
- {
- return m_arg0.canTraverseOutsideSubtree();
- }
-
- /**
- * This function is used to fixup variables from QNames to stack frame
- * indexes at stylesheet build time.
- * @param vars List of QNames that correspond to variables. This list
- * should be searched backwards for the first qualified name that
- * corresponds to the variable reference qname. The position of the
- * QName in the vector from the start of the vector will be its position
- * in the stack frame (but variables above the globalsTop value will need
- * to be offset to the current stack frame).
- */
- public void fixupVariables(java.util.Vector vars, int globalsSize)
- {
- if(null != m_arg0)
- m_arg0.fixupVariables(vars, globalsSize);
- }
-
- /**
- * @see com.sun.org.apache.xpath.internal.XPathVisitable#callVisitors(ExpressionOwner, XPathVisitor)
- */
- public void callArgVisitors(XPathVisitor visitor)
- {
- if(null != m_arg0)
- m_arg0.callVisitors(this, visitor);
- }
-
-
- /**
- * @see ExpressionOwner#getExpression()
- */
- public Expression getExpression()
- {
- return m_arg0;
- }
-
- /**
- * @see ExpressionOwner#setExpression(Expression)
- */
- public void setExpression(Expression exp)
- {
- exp.exprSetParent(this);
- m_arg0 = exp;
- }
-
- /**
- * @see Expression#deepEquals(Expression)
- */
- public boolean deepEquals(Expression expr)
- {
- if(!super.deepEquals(expr))
- return false;
-
- if(null != m_arg0)
- {
- if(null == ((FunctionOneArg)expr).m_arg0)
- return false;
-
- if(!m_arg0.deepEquals(((FunctionOneArg)expr).m_arg0))
- return false;
- }
- else if(null != ((FunctionOneArg)expr).m_arg0)
- return false;
-
- return true;
- }
-
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/functions/WrongNumberArgsException.java b/src/com/sun/org/apache/xpath/internal/functions/WrongNumberArgsException.java
deleted file mode 100644
index f16347e..0000000
--- a/src/com/sun/org/apache/xpath/internal/functions/WrongNumberArgsException.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: WrongNumberArgsException.java,v 1.2.4.1 2005/09/14 20:27:04 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.functions;
-
-/**
- * An exception that is thrown if the wrong number of arguments to an exception
- * are specified by the stylesheet.
- * @xsl.usage advanced
- */
-public class WrongNumberArgsException extends Exception
-{
- static final long serialVersionUID = -4551577097576242432L;
-
- /**
- * Constructor WrongNumberArgsException
- *
- * @param argsExpected Error message that tells the number of arguments that
- * were expected.
- */
- public WrongNumberArgsException(String argsExpected)
- {
-
- super(argsExpected);
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/functions/package.html b/src/com/sun/org/apache/xpath/internal/functions/package.html
deleted file mode 100644
index 9ed8ee9..0000000
--- a/src/com/sun/org/apache/xpath/internal/functions/package.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<!--
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
--->
-<!--
- * Copyright 2000-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
--->
-<!-- $Id: package.html,v 1.1.2.1 2005/08/01 01:29:38 jeffsuttor Exp $ -->
-<html>
- <title>XPath functions Package.</title>
- <body>
- <p>Implements XPath functions -- each function is derived from Function,
- FunctionOneArg, Function2Args, etc, with number-of-arguments checking being
- applied mainly at compile time -- this package only implements XPath functions,
- XSLT functions are found in the "templates" package.<p>
- </body>
-</html>
-
-
diff --git a/src/com/sun/org/apache/xpath/internal/jaxp/JAXPExtensionsProvider.java b/src/com/sun/org/apache/xpath/internal/jaxp/JAXPExtensionsProvider.java
deleted file mode 100644
index fee057f..0000000
--- a/src/com/sun/org/apache/xpath/internal/jaxp/JAXPExtensionsProvider.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// $Id: JAXPExtensionsProvider.java,v 1.1.2.1 2005/08/01 01:30:17 jeffsuttor Exp $
-
-package com.sun.org.apache.xpath.internal.jaxp;
-
-import javax.xml.transform.TransformerException;
-import javax.xml.xpath.XPathFunctionResolver;
-import javax.xml.xpath.XPathFunction;
-import javax.xml.xpath.XPathFunctionException;
-
-import com.sun.org.apache.xpath.internal.ExtensionsProvider;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-import com.sun.org.apache.xpath.internal.objects.XNodeSet;
-import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
-import com.sun.org.apache.xalan.internal.res.XSLMessages;
-import com.sun.org.apache.xalan.internal.utils.FeatureManager;
-
-import com.sun.org.apache.xpath.internal.functions.FuncExtFunction;
-import java.util.Vector;
-import java.util.ArrayList;
-import javax.xml.namespace.QName;
-
-/**
- *
- * @author Ramesh Mandava ( ramesh.mandava@sun.com )
- */
-public class JAXPExtensionsProvider implements ExtensionsProvider {
-
- private final XPathFunctionResolver resolver;
- private boolean extensionInvocationDisabled = false;
-
- public JAXPExtensionsProvider(XPathFunctionResolver resolver) {
- this.resolver = resolver;
- this.extensionInvocationDisabled = false;
- }
-
- public JAXPExtensionsProvider(XPathFunctionResolver resolver,
- boolean featureSecureProcessing, FeatureManager featureManager ) {
- this.resolver = resolver;
- if (featureSecureProcessing &&
- !featureManager.isFeatureEnabled(FeatureManager.Feature.ORACLE_ENABLE_EXTENSION_FUNCTION)) {
- this.extensionInvocationDisabled = true;
- }
- }
-
- /**
- * Is the extension function available?
- */
-
- public boolean functionAvailable(String ns, String funcName)
- throws javax.xml.transform.TransformerException {
- try {
- if ( funcName == null ) {
- String fmsg = XSLMessages.createXPATHMessage(
- XPATHErrorResources.ER_ARG_CANNOT_BE_NULL,
- new Object[] {"Function Name"} );
- throw new NullPointerException ( fmsg );
- }
- //Find the XPathFunction corresponding to namespace and funcName
- javax.xml.namespace.QName myQName = new QName( ns, funcName );
- javax.xml.xpath.XPathFunction xpathFunction =
- resolver.resolveFunction ( myQName, 0 );
- if ( xpathFunction == null ) {
- return false;
- }
- return true;
- } catch ( Exception e ) {
- return false;
- }
-
-
- }
-
-
- /**
- * Is the extension element available?
- */
- public boolean elementAvailable(String ns, String elemName)
- throws javax.xml.transform.TransformerException {
- return false;
- }
-
- /**
- * Execute the extension function.
- */
- public Object extFunction(String ns, String funcName, Vector argVec,
- Object methodKey) throws javax.xml.transform.TransformerException {
- try {
-
- if ( funcName == null ) {
- String fmsg = XSLMessages.createXPATHMessage(
- XPATHErrorResources.ER_ARG_CANNOT_BE_NULL,
- new Object[] {"Function Name"} );
- throw new NullPointerException ( fmsg );
- }
- //Find the XPathFunction corresponding to namespace and funcName
- javax.xml.namespace.QName myQName = new QName( ns, funcName );
-
- // JAXP 1.3 spec says When XMLConstants.FEATURE_SECURE_PROCESSING
- // feature is set then invocation of extension functions need to
- // throw XPathFunctionException
- if ( extensionInvocationDisabled ) {
- String fmsg = XSLMessages.createXPATHMessage(
- XPATHErrorResources.ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED,
- new Object[] { myQName.toString() } );
- throw new XPathFunctionException ( fmsg );
- }
-
- // Assuming user is passing all the needed parameters ( including
- // default values )
- int arity = argVec.size();
-
- javax.xml.xpath.XPathFunction xpathFunction =
- resolver.resolveFunction ( myQName, arity );
-
- // not using methodKey
- ArrayList argList = new ArrayList( arity);
- for ( int i=0; i<arity; i++ ) {
- Object argument = argVec.elementAt( i );
- // XNodeSet object() returns NodeVector and not NodeList
- // Explicitly getting NodeList by using nodelist()
- if ( argument instanceof XNodeSet ) {
- argList.add ( i, ((XNodeSet)argument).nodelist() );
- } else if ( argument instanceof XObject ) {
- Object passedArgument = ((XObject)argument).object();
- argList.add ( i, passedArgument );
- } else {
- argList.add ( i, argument );
- }
- }
-
- return ( xpathFunction.evaluate ( argList ));
- } catch ( XPathFunctionException xfe ) {
- // If we get XPathFunctionException then we want to terminate
- // further execution by throwing WrappedRuntimeException
- throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException ( xfe );
- } catch ( Exception e ) {
- throw new javax.xml.transform.TransformerException ( e );
- }
-
- }
-
- /**
- * Execute the extension function.
- */
- public Object extFunction(FuncExtFunction extFunction,
- Vector argVec)
- throws javax.xml.transform.TransformerException {
- try {
- String namespace = extFunction.getNamespace();
- String functionName = extFunction.getFunctionName();
- int arity = extFunction.getArgCount();
- javax.xml.namespace.QName myQName =
- new javax.xml.namespace.QName( namespace, functionName );
-
- // JAXP 1.3 spec says When XMLConstants.FEATURE_SECURE_PROCESSING
- // feature is set then invocation of extension functions need to
- // throw XPathFunctionException
- if ( extensionInvocationDisabled ) {
- String fmsg = XSLMessages.createXPATHMessage(
- XPATHErrorResources.ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED, new Object[] { myQName.toString() } );
- throw new XPathFunctionException ( fmsg );
- }
-
- XPathFunction xpathFunction =
- resolver.resolveFunction( myQName, arity );
-
- ArrayList argList = new ArrayList( arity);
- for ( int i=0; i<arity; i++ ) {
- Object argument = argVec.elementAt( i );
- // XNodeSet object() returns NodeVector and not NodeList
- // Explicitly getting NodeList by using nodelist()
- if ( argument instanceof XNodeSet ) {
- argList.add ( i, ((XNodeSet)argument).nodelist() );
- } else if ( argument instanceof XObject ) {
- Object passedArgument = ((XObject)argument).object();
- argList.add ( i, passedArgument );
- } else {
- argList.add ( i, argument );
- }
- }
-
- return ( xpathFunction.evaluate ( argList ));
-
- } catch ( XPathFunctionException xfe ) {
- // If we get XPathFunctionException then we want to terminate
- // further execution by throwing WrappedRuntimeException
- throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException ( xfe );
- } catch ( Exception e ) {
- throw new javax.xml.transform.TransformerException ( e );
- }
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/jaxp/JAXPPrefixResolver.java b/src/com/sun/org/apache/xpath/internal/jaxp/JAXPPrefixResolver.java
deleted file mode 100644
index 20c6678..0000000
--- a/src/com/sun/org/apache/xpath/internal/jaxp/JAXPPrefixResolver.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-// $Id: JAXPPrefixResolver.java,v 1.1.2.1 2005/08/01 01:30:18 jeffsuttor Exp $
-
-package com.sun.org.apache.xpath.internal.jaxp;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NamedNodeMap;
-import com.sun.org.apache.xml.internal.utils.PrefixResolver;
-
-import javax.xml.namespace.NamespaceContext;
-
-/**
- * <meta name="usage" content="general"/>
- * This class implements a Default PrefixResolver which
- * can be used to perform prefix-to-namespace lookup
- * for the XPath object.
- * This class delegates the resolution to the passed NamespaceContext
- */
-public class JAXPPrefixResolver implements PrefixResolver
-{
-
- private NamespaceContext namespaceContext;
-
-
- public JAXPPrefixResolver ( NamespaceContext nsContext ) {
- this.namespaceContext = nsContext;
- }
-
-
- public String getNamespaceForPrefix( String prefix ) {
- return namespaceContext.getNamespaceURI( prefix );
- }
-
- /**
- * Return the base identifier.
- *
- * @return null
- */
- public String getBaseIdentifier() {
- return null;
- }
-
- /**
- * @see PrefixResolver#handlesNullPrefixes()
- */
- public boolean handlesNullPrefixes() {
- return false;
- }
-
-
- /**
- * The URI for the XML namespace.
- * (Duplicate of that found in com.sun.org.apache.xpath.internal.XPathContext).
- */
-
- public static final String S_XMLNAMESPACEURI =
- "http://www.w3.org/XML/1998/namespace";
-
-
- /**
- * Given a prefix and a Context Node, get the corresponding namespace.
- * Warning: This will not work correctly if namespaceContext
- * is an attribute node.
- * @param prefix Prefix to resolve.
- * @param namespaceContext Node from which to start searching for a
- * xmlns attribute that binds a prefix to a namespace.
- * @return Namespace that prefix resolves to, or null if prefix
- * is not bound.
- */
- public String getNamespaceForPrefix(String prefix,
- org.w3c.dom.Node namespaceContext) {
- Node parent = namespaceContext;
- String namespace = null;
-
- if (prefix.equals("xml")) {
- namespace = S_XMLNAMESPACEURI;
- } else {
- int type;
-
- while ((null != parent) && (null == namespace)
- && (((type = parent.getNodeType()) == Node.ELEMENT_NODE)
- || (type == Node.ENTITY_REFERENCE_NODE))) {
-
- if (type == Node.ELEMENT_NODE) {
- NamedNodeMap nnm = parent.getAttributes();
-
- for (int i = 0; i < nnm.getLength(); i++) {
- Node attr = nnm.item(i);
- String aname = attr.getNodeName();
- boolean isPrefix = aname.startsWith("xmlns:");
-
- if (isPrefix || aname.equals("xmlns")) {
- int index = aname.indexOf(':');
- String p =isPrefix ?aname.substring(index + 1) :"";
-
- if (p.equals(prefix)) {
- namespace = attr.getNodeValue();
- break;
- }
- }
- }
- }
-
- parent = parent.getParentNode();
- }
- }
- return namespace;
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/jaxp/JAXPVariableStack.java b/src/com/sun/org/apache/xpath/internal/jaxp/JAXPVariableStack.java
deleted file mode 100644
index 9d9f19d..0000000
--- a/src/com/sun/org/apache/xpath/internal/jaxp/JAXPVariableStack.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-// $Id: JAXPVariableStack.java,v 1.1.2.1 2005/08/01 01:30:17 jeffsuttor Exp $
-
-package com.sun.org.apache.xpath.internal.jaxp;
-
-import javax.xml.transform.TransformerException;
-import javax.xml.xpath.XPathVariableResolver;
-
-import com.sun.org.apache.xml.internal.utils.QName;
-import com.sun.org.apache.xpath.internal.VariableStack;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
-import com.sun.org.apache.xalan.internal.res.XSLMessages;
-
-
-/**
- * Overrides {@link VariableStack} and delegates the call to
- * {@link javax.xml.xpath.XPathVariableResolver}.
- *
- * @author Ramesh Mandava ( ramesh.mandava@sun.com )
- */
-public class JAXPVariableStack extends VariableStack {
-
- private final XPathVariableResolver resolver;
-
- public JAXPVariableStack(XPathVariableResolver resolver) {
- this.resolver = resolver;
- }
-
- public XObject getVariableOrParam(XPathContext xctxt, QName qname)
- throws TransformerException,IllegalArgumentException {
- if ( qname == null ) {
- //JAXP 1.3 spec says that if variable name is null then
- // we need to through IllegalArgumentException
- String fmsg = XSLMessages.createXPATHMessage(
- XPATHErrorResources.ER_ARG_CANNOT_BE_NULL,
- new Object[] {"Variable qname"} );
- throw new IllegalArgumentException( fmsg );
- }
- javax.xml.namespace.QName name =
- new javax.xml.namespace.QName(
- qname.getNamespace(),
- qname.getLocalPart());
- Object varValue = resolver.resolveVariable( name );
- if ( varValue == null ) {
- String fmsg = XSLMessages.createXPATHMessage(
- XPATHErrorResources.ER_RESOLVE_VARIABLE_RETURNS_NULL,
- new Object[] { name.toString()} );
- throw new TransformerException( fmsg );
- }
- return XObject.create( varValue, xctxt );
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/jaxp/XPathExpressionImpl.java b/src/com/sun/org/apache/xpath/internal/jaxp/XPathExpressionImpl.java
deleted file mode 100644
index 925ce9c..0000000
--- a/src/com/sun/org/apache/xpath/internal/jaxp/XPathExpressionImpl.java
+++ /dev/null
@@ -1,380 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-// $Id: XPathExpressionImpl.java,v 1.3 2005/09/27 09:40:43 sunithareddy Exp $
-
-package com.sun.org.apache.xpath.internal.jaxp;
-
-import com.sun.org.apache.xpath.internal.*;
-import javax.xml.transform.TransformerException;
-
-import com.sun.org.apache.xpath.internal.objects.XObject;
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.utils.PrefixResolver;
-import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
-import com.sun.org.apache.xalan.internal.res.XSLMessages;
-import com.sun.org.apache.xalan.internal.utils.FactoryImpl;
-import com.sun.org.apache.xalan.internal.utils.FeatureManager;
-
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.namespace.QName;
-import javax.xml.xpath.XPathExpressionException;
-import javax.xml.xpath.XPathConstants;
-import javax.xml.xpath.XPathFunctionResolver;
-import javax.xml.xpath.XPathVariableResolver;
-import javax.xml.xpath.XPathConstants;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.Document;
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.traversal.NodeIterator;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.DocumentBuilder;
-
-import org.xml.sax.InputSource;
-
-/**
- * The XPathExpression interface encapsulates a (compiled) XPath expression.
- *
- * @version $Revision: 1.10 $
- * @author Ramesh Mandava
- */
-public class XPathExpressionImpl implements javax.xml.xpath.XPathExpression{
-
- private XPathFunctionResolver functionResolver;
- private XPathVariableResolver variableResolver;
- private JAXPPrefixResolver prefixResolver;
- private com.sun.org.apache.xpath.internal.XPath xpath;
-
- // By default Extension Functions are allowed in XPath Expressions. If
- // Secure Processing Feature is set on XPathFactory then the invocation of
- // extensions function need to throw XPathFunctionException
- private boolean featureSecureProcessing = false;
-
- private boolean useServicesMechanism = true;
-
- private final FeatureManager featureManager;
-
- /** Protected constructor to prevent direct instantiation; use compile()
- * from the context.
- */
- protected XPathExpressionImpl() {
- this(null, null, null, null,
- false, true, new FeatureManager());
- };
-
- protected XPathExpressionImpl(com.sun.org.apache.xpath.internal.XPath xpath,
- JAXPPrefixResolver prefixResolver,
- XPathFunctionResolver functionResolver,
- XPathVariableResolver variableResolver ) {
- this(xpath, prefixResolver, functionResolver, variableResolver,
- false, true, new FeatureManager());
- };
-
- protected XPathExpressionImpl(com.sun.org.apache.xpath.internal.XPath xpath,
- JAXPPrefixResolver prefixResolver,XPathFunctionResolver functionResolver,
- XPathVariableResolver variableResolver, boolean featureSecureProcessing,
- boolean useServicesMechanism, FeatureManager featureManager ) {
- this.xpath = xpath;
- this.prefixResolver = prefixResolver;
- this.functionResolver = functionResolver;
- this.variableResolver = variableResolver;
- this.featureSecureProcessing = featureSecureProcessing;
- this.useServicesMechanism = useServicesMechanism;
- this.featureManager = featureManager;
- };
-
- public void setXPath (com.sun.org.apache.xpath.internal.XPath xpath ) {
- this.xpath = xpath;
- }
-
- public Object eval(Object item, QName returnType)
- throws javax.xml.transform.TransformerException {
- XObject resultObject = eval ( item );
- return getResultAsType( resultObject, returnType );
- }
-
- private XObject eval ( Object contextItem )
- throws javax.xml.transform.TransformerException {
- com.sun.org.apache.xpath.internal.XPathContext xpathSupport = null;
- if ( functionResolver != null ) {
- JAXPExtensionsProvider jep = new JAXPExtensionsProvider(
- functionResolver, featureSecureProcessing, featureManager );
- xpathSupport = new com.sun.org.apache.xpath.internal.XPathContext( jep );
- } else {
- xpathSupport = new com.sun.org.apache.xpath.internal.XPathContext();
- }
-
- xpathSupport.setVarStack(new JAXPVariableStack(variableResolver));
- XObject xobj = null;
-
- Node contextNode = (Node)contextItem;
- // We always need to have a ContextNode with Xalan XPath implementation
- // To allow simple expression evaluation like 1+1 we are setting
- // dummy Document as Context Node
-
- if ( contextNode == null )
- xobj = xpath.execute(xpathSupport, DTM.NULL, prefixResolver);
- else
- xobj = xpath.execute(xpathSupport, contextNode, prefixResolver);
-
- return xobj;
- }
-
-
- /**
- * <p>Evaluate the compiled XPath expression in the specified context and
- * return the result as the specified type.</p>
- *
- * <p>See "Evaluation of XPath Expressions" section of JAXP 1.3 spec
- * for context item evaluation,
- * variable, function and QName resolution and return type conversion.</p>
- *
- * <p>If <code>returnType</code> is not one of the types defined
- * in {@link XPathConstants},
- * then an <code>IllegalArgumentException</code> is thrown.</p>
- *
- * <p>If a <code>null</code> value is provided for
- * <code>item</code>, an empty document will be used for the
- * context.
- * If <code>returnType</code> is <code>null</code>, then a
- * <code>NullPointerException</code> is thrown.</p>
- *
- * @param item The starting context (node or node list, for example).
- * @param returnType The desired return type.
- *
- * @return The <code>Object</code> that is the result of evaluating the
- * expression and converting the result to
- * <code>returnType</code>.
- *
- * @throws XPathExpressionException If the expression cannot be evaluated.
- * @throws IllegalArgumentException If <code>returnType</code> is not one
- * of the types defined in {@link XPathConstants}.
- * @throws NullPointerException If <code>returnType</code> is
- * <code>null</code>.
- */
- public Object evaluate(Object item, QName returnType)
- throws XPathExpressionException {
- //Validating parameters to enforce constraints defined by JAXP spec
- if ( returnType == null ) {
- //Throwing NullPointerException as defined in spec
- String fmsg = XSLMessages.createXPATHMessage(
- XPATHErrorResources.ER_ARG_CANNOT_BE_NULL,
- new Object[] {"returnType"} );
- throw new NullPointerException( fmsg );
- }
- // Checking if requested returnType is supported. returnType need to be
- // defined in XPathConstants
- if ( !isSupported ( returnType ) ) {
- String fmsg = XSLMessages.createXPATHMessage(
- XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE,
- new Object[] { returnType.toString() } );
- throw new IllegalArgumentException ( fmsg );
- }
- try {
- return eval( item, returnType);
- } catch ( java.lang.NullPointerException npe ) {
- // If VariableResolver returns null Or if we get
- // NullPointerException at this stage for some other reason
- // then we have to reurn XPathException
- throw new XPathExpressionException ( npe );
- } catch ( javax.xml.transform.TransformerException te ) {
- Throwable nestedException = te.getException();
- if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) {
- throw (javax.xml.xpath.XPathFunctionException)nestedException;
- } else {
- // For any other exceptions we need to throw
- // XPathExpressionException ( as per spec )
- throw new XPathExpressionException( te);
- }
- }
-
- }
-
- /**
- * <p>Evaluate the compiled XPath expression in the specified context and
- * return the result as a <code>String</code>.</p>
- *
- * <p>This method calls {@link #evaluate(Object item, QName returnType)}
- * with a <code>returnType</code> of
- * {@link XPathConstants#STRING}.</p>
- *
- * <p>See "Evaluation of XPath Expressions" section of JAXP 1.3 spec
- * for context item evaluation,
- * variable, function and QName resolution and return type conversion.</p>
- *
- * <p>If a <code>null</code> value is provided for
- * <code>item</code>, an empty document will be used for the
- * context.
- *
- * @param item The starting context (node or node list, for example).
- *
- * @return The <code>String</code> that is the result of evaluating the
- * expression and converting the result to a
- * <code>String</code>.
- *
- * @throws XPathExpressionException If the expression cannot be evaluated.
- */
- public String evaluate(Object item)
- throws XPathExpressionException {
- return (String)this.evaluate( item, XPathConstants.STRING );
- }
-
-
-
- static DocumentBuilderFactory dbf = null;
- static DocumentBuilder db = null;
- static Document d = null;
-
- /**
- * <p>Evaluate the compiled XPath expression in the context of the
- * specified <code>InputSource</code> and return the result as the
- * specified type.</p>
- *
- * <p>This method builds a data model for the {@link InputSource} and calls
- * {@link #evaluate(Object item, QName returnType)} on the resulting
- * document object.</p>
- *
- * <p>See "Evaluation of XPath Expressions" section of JAXP 1.3 spec
- * for context item evaluation,
- * variable, function and QName resolution and return type conversion.</p>
- *
- * <p>If <code>returnType</code> is not one of the types defined in
- * {@link XPathConstants},
- * then an <code>IllegalArgumentException</code> is thrown.</p>
- *
- *<p>If <code>source</code> or <code>returnType</code> is <code>null</code>,
- * then a <code>NullPointerException</code> is thrown.</p>
- *
- * @param source The <code>InputSource</code> of the document to evaluate
- * over.
- * @param returnType The desired return type.
- *
- * @return The <code>Object</code> that is the result of evaluating the
- * expression and converting the result to
- * <code>returnType</code>.
- *
- * @throws XPathExpressionException If the expression cannot be evaluated.
- * @throws IllegalArgumentException If <code>returnType</code> is not one
- * of the types defined in {@link XPathConstants}.
- * @throws NullPointerException If <code>source</code> or
- * <code>returnType</code> is <code>null</code>.
- */
- public Object evaluate(InputSource source, QName returnType)
- throws XPathExpressionException {
- if ( ( source == null ) || ( returnType == null ) ) {
- String fmsg = XSLMessages.createXPATHMessage(
- XPATHErrorResources.ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL,
- null );
- throw new NullPointerException ( fmsg );
- }
- // Checking if requested returnType is supported. returnType need to be
- // defined in XPathConstants
- if ( !isSupported ( returnType ) ) {
- String fmsg = XSLMessages.createXPATHMessage(
- XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE,
- new Object[] { returnType.toString() } );
- throw new IllegalArgumentException ( fmsg );
- }
- try {
- if ( dbf == null ) {
- dbf = FactoryImpl.getDOMFactory(useServicesMechanism);
- dbf.setNamespaceAware( true );
- dbf.setValidating( false );
- }
- db = dbf.newDocumentBuilder();
- Document document = db.parse( source );
- return eval( document, returnType );
- } catch ( Exception e ) {
- throw new XPathExpressionException ( e );
- }
- }
-
- /**
- * <p>Evaluate the compiled XPath expression in the context of the specified <code>InputSource</code> and return the result as a
- * <code>String</code>.</p>
- *
- * <p>This method calls {@link #evaluate(InputSource source, QName returnType)} with a <code>returnType</code> of
- * {@link XPathConstants#STRING}.</p>
- *
- * <p>See "Evaluation of XPath Expressions" section of JAXP 1.3 spec
- * for context item evaluation,
- * variable, function and QName resolution and return type conversion.</p>
- *
- * <p>If <code>source</code> is <code>null</code>, then a <code>NullPointerException</code> is thrown.</p>
- *
- * @param source The <code>InputSource</code> of the document to evaluate over.
- *
- * @return The <code>String</code> that is the result of evaluating the expression and converting the result to a
- * <code>String</code>.
- *
- * @throws XPathExpressionException If the expression cannot be evaluated.
- * @throws NullPointerException If <code>source</code> is <code>null</code>.
- */
- public String evaluate(InputSource source)
- throws XPathExpressionException {
- return (String)this.evaluate( source, XPathConstants.STRING );
- }
-
- private boolean isSupported( QName returnType ) {
- // XPathConstants.STRING
- if ( ( returnType.equals( XPathConstants.STRING ) ) ||
- ( returnType.equals( XPathConstants.NUMBER ) ) ||
- ( returnType.equals( XPathConstants.BOOLEAN ) ) ||
- ( returnType.equals( XPathConstants.NODE ) ) ||
- ( returnType.equals( XPathConstants.NODESET ) ) ) {
-
- return true;
- }
- return false;
- }
-
- private Object getResultAsType( XObject resultObject, QName returnType )
- throws javax.xml.transform.TransformerException {
- // XPathConstants.STRING
- if ( returnType.equals( XPathConstants.STRING ) ) {
- return resultObject.str();
- }
- // XPathConstants.NUMBER
- if ( returnType.equals( XPathConstants.NUMBER ) ) {
- return new Double ( resultObject.num());
- }
- // XPathConstants.BOOLEAN
- if ( returnType.equals( XPathConstants.BOOLEAN ) ) {
- return new Boolean( resultObject.bool());
- }
- // XPathConstants.NODESET ---ORdered, UNOrdered???
- if ( returnType.equals( XPathConstants.NODESET ) ) {
- return resultObject.nodelist();
- }
- // XPathConstants.NODE
- if ( returnType.equals( XPathConstants.NODE ) ) {
- NodeIterator ni = resultObject.nodeset();
- //Return the first node, or null
- return ni.nextNode();
- }
- // If isSupported check is already done then the execution path
- // shouldn't come here. Being defensive
- String fmsg = XSLMessages.createXPATHMessage(
- XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE,
- new Object[] { returnType.toString()});
- throw new IllegalArgumentException ( fmsg );
- }
-
- }
diff --git a/src/com/sun/org/apache/xpath/internal/jaxp/XPathFactoryImpl.java b/src/com/sun/org/apache/xpath/internal/jaxp/XPathFactoryImpl.java
deleted file mode 100644
index b050af4..0000000
--- a/src/com/sun/org/apache/xpath/internal/jaxp/XPathFactoryImpl.java
+++ /dev/null
@@ -1,328 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-// $Id: XPathFactoryImpl.java,v 1.2 2005/08/16 22:41:13 jeffsuttor Exp $
-
-package com.sun.org.apache.xpath.internal.jaxp;
-
-import com.sun.org.apache.xalan.internal.XalanConstants;
-import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
-import com.sun.org.apache.xalan.internal.res.XSLMessages;
-import com.sun.org.apache.xalan.internal.utils.FeatureManager;
-import com.sun.org.apache.xalan.internal.utils.FeaturePropertyBase;
-
-import javax.xml.XMLConstants;
-import javax.xml.xpath.XPathFactory;
-import javax.xml.xpath.XPathFactoryConfigurationException;
-import javax.xml.xpath.XPathFunctionResolver;
-import javax.xml.xpath.XPathVariableResolver;
-
-/**
- * The XPathFactory builds XPaths.
- *
- * @version $Revision: 1.11 $
- * @author Ramesh Mandava
- */
-public class XPathFactoryImpl extends XPathFactory {
-
- /**
- * <p>Name of class as a constant to use for debugging.</p>
- */
- private static final String CLASS_NAME = "XPathFactoryImpl";
-
- /**
- *<p>XPathFunctionResolver for this XPathFactory and created XPaths.</p>
- */
- private XPathFunctionResolver xPathFunctionResolver = null;
-
- /**
- * <p>XPathVariableResolver for this XPathFactory and created XPaths</p>
- */
- private XPathVariableResolver xPathVariableResolver = null;
-
- /**
- * <p>State of secure processing feature.</p>
- */
- private boolean _isNotSecureProcessing = true;
- /**
- * <p>State of secure mode.</p>
- */
- private boolean _isSecureMode = false;
- /**
- * javax.xml.xpath.XPathFactory implementation.
- */
-
- private boolean _useServicesMechanism = true;
-
- private final FeatureManager _featureManager;
-
- public XPathFactoryImpl() {
- this(true);
- }
-
- public static XPathFactory newXPathFactoryNoServiceLoader() {
- return new XPathFactoryImpl(false);
- }
-
- public XPathFactoryImpl(boolean useServicesMechanism) {
- _featureManager = new FeatureManager();
- if (System.getSecurityManager() != null) {
- _isSecureMode = true;
- _isNotSecureProcessing = false;
- _featureManager.setValue(FeatureManager.Feature.ORACLE_ENABLE_EXTENSION_FUNCTION,
- FeaturePropertyBase.State.FSP, XalanConstants.FEATURE_FALSE);
- }
- this._useServicesMechanism = useServicesMechanism;
- }
- /**
- * <p>Is specified object model supported by this
- * <code>XPathFactory</code>?</p>
- *
- * @param objectModel Specifies the object model which the returned
- * <code>XPathFactory</code> will understand.
- *
- * @return <code>true</code> if <code>XPathFactory</code> supports
- * <code>objectModel</code>, else <code>false</code>.
- *
- * @throws NullPointerException If <code>objectModel</code> is <code>null</code>.
- * @throws IllegalArgumentException If <code>objectModel.length() == 0</code>.
- */
- public boolean isObjectModelSupported(String objectModel) {
-
- if (objectModel == null) {
- String fmsg = XSLMessages.createXPATHMessage(
- XPATHErrorResources.ER_OBJECT_MODEL_NULL,
- new Object[] { this.getClass().getName() } );
-
- throw new NullPointerException( fmsg );
- }
-
- if (objectModel.length() == 0) {
- String fmsg = XSLMessages.createXPATHMessage(
- XPATHErrorResources.ER_OBJECT_MODEL_EMPTY,
- new Object[] { this.getClass().getName() } );
- throw new IllegalArgumentException( fmsg );
- }
-
- // know how to support default object model, W3C DOM
- if (objectModel.equals(XPathFactory.DEFAULT_OBJECT_MODEL_URI)) {
- return true;
- }
-
- // don't know how to support anything else
- return false;
- }
-
- /**
- * <p>Returns a new <code>XPath</code> object using the underlying
- * object model determined when the factory was instantiated.</p>
- *
- * @return New <code>XPath</code>
- */
- public javax.xml.xpath.XPath newXPath() {
- return new com.sun.org.apache.xpath.internal.jaxp.XPathImpl(
- xPathVariableResolver, xPathFunctionResolver,
- !_isNotSecureProcessing, _useServicesMechanism,
- _featureManager );
- }
-
- /**
- * <p>Set a feature for this <code>XPathFactory</code> and
- * <code>XPath</code>s created by this factory.</p>
- *
- * <p>
- * Feature names are fully qualified {@link java.net.URI}s.
- * Implementations may define their own features.
- * An {@link XPathFactoryConfigurationException} is thrown if this
- * <code>XPathFactory</code> or the <code>XPath</code>s
- * it creates cannot support the feature.
- * It is possible for an <code>XPathFactory</code> to expose a feature
- * value but be unable to change its state.
- * </p>
- *
- * <p>See {@link javax.xml.xpath.XPathFactory} for full documentation
- * of specific features.</p>
- *
- * @param name Feature name.
- * @param value Is feature state <code>true</code> or <code>false</code>.
- *
- * @throws XPathFactoryConfigurationException if this
- * <code>XPathFactory</code> or the <code>XPath</code>s
- * it creates cannot support this feature.
- * @throws NullPointerException if <code>name</code> is
- * <code>null</code>.
- */
- public void setFeature(String name, boolean value)
- throws XPathFactoryConfigurationException {
-
- // feature name cannot be null
- if (name == null) {
- String fmsg = XSLMessages.createXPATHMessage(
- XPATHErrorResources.ER_FEATURE_NAME_NULL,
- new Object[] { CLASS_NAME, new Boolean( value) } );
- throw new NullPointerException( fmsg );
- }
-
- // secure processing?
- if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
- if ((_isSecureMode) && (!value)) {
- String fmsg = XSLMessages.createXPATHMessage(
- XPATHErrorResources.ER_SECUREPROCESSING_FEATURE,
- new Object[] { name, CLASS_NAME, new Boolean(value) } );
- throw new XPathFactoryConfigurationException( fmsg );
- }
-
- _isNotSecureProcessing = !value;
- if (value && _featureManager != null) {
- _featureManager.setValue(FeatureManager.Feature.ORACLE_ENABLE_EXTENSION_FUNCTION,
- FeaturePropertyBase.State.FSP, XalanConstants.FEATURE_FALSE);
- }
-
- // all done processing feature
- return;
- }
- if (name.equals(XalanConstants.ORACLE_FEATURE_SERVICE_MECHANISM)) {
- //in secure mode, let _useServicesMechanism be determined by the constructor
- if (!_isSecureMode)
- _useServicesMechanism = value;
- return;
- }
-
- if (_featureManager != null &&
- _featureManager.setValue(name, FeaturePropertyBase.State.APIPROPERTY, value)) {
- return;
- }
-
- // unknown feature
- String fmsg = XSLMessages.createXPATHMessage(
- XPATHErrorResources.ER_FEATURE_UNKNOWN,
- new Object[] { name, CLASS_NAME, new Boolean(value) } );
- throw new XPathFactoryConfigurationException( fmsg );
- }
-
- /**
- * <p>Get the state of the named feature.</p>
- *
- * <p>
- * Feature names are fully qualified {@link java.net.URI}s.
- * Implementations may define their own features.
- * An {@link XPathFactoryConfigurationException} is thrown if this
- * <code>XPathFactory</code> or the <code>XPath</code>s
- * it creates cannot support the feature.
- * It is possible for an <code>XPathFactory</code> to expose a feature
- * value but be unable to change its state.
- * </p>
- *
- * @param name Feature name.
- *
- * @return State of the named feature.
- *
- * @throws XPathFactoryConfigurationException if this
- * <code>XPathFactory</code> or the <code>XPath</code>s
- * it creates cannot support this feature.
- * @throws NullPointerException if <code>name</code> is
- * <code>null</code>.
- */
- public boolean getFeature(String name)
- throws XPathFactoryConfigurationException {
-
- // feature name cannot be null
- if (name == null) {
- String fmsg = XSLMessages.createXPATHMessage(
- XPATHErrorResources.ER_GETTING_NULL_FEATURE,
- new Object[] { CLASS_NAME } );
- throw new NullPointerException( fmsg );
- }
-
- // secure processing?
- if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
- return !_isNotSecureProcessing;
- }
- if (name.equals(XalanConstants.ORACLE_FEATURE_SERVICE_MECHANISM)) {
- return _useServicesMechanism;
- }
-
- /** Check to see if the property is managed by the security manager **/
- String propertyValue = (_featureManager != null) ?
- _featureManager.getValueAsString(name) : null;
- if (propertyValue != null) {
- return _featureManager.isFeatureEnabled(name);
- }
-
- // unknown feature
- String fmsg = XSLMessages.createXPATHMessage(
- XPATHErrorResources.ER_GETTING_UNKNOWN_FEATURE,
- new Object[] { name, CLASS_NAME } );
-
- throw new XPathFactoryConfigurationException( fmsg );
- }
-
- /**
- * <p>Establish a default function resolver.</p>
- *
- * <p>Any <code>XPath</code> objects constructed from this factory will use
- * the specified resolver by default.</p>
- *
- * <p>A <code>NullPointerException</code> is thrown if
- * <code>resolver</code> is <code>null</code>.</p>
- *
- * @param resolver XPath function resolver.
- *
- * @throws NullPointerException If <code>resolver</code> is
- * <code>null</code>.
- */
- public void setXPathFunctionResolver(XPathFunctionResolver resolver) {
-
- // resolver cannot be null
- if (resolver == null) {
- String fmsg = XSLMessages.createXPATHMessage(
- XPATHErrorResources.ER_NULL_XPATH_FUNCTION_RESOLVER,
- new Object[] { CLASS_NAME } );
- throw new NullPointerException( fmsg );
- }
-
- xPathFunctionResolver = resolver;
- }
-
- /**
- * <p>Establish a default variable resolver.</p>
- *
- * <p>Any <code>XPath</code> objects constructed from this factory will use
- * the specified resolver by default.</p>
- *
- * <p>A <code>NullPointerException</code> is thrown if <code>resolver</code> is <code>null</code>.</p>
- *
- * @param resolver Variable resolver.
- *
- * @throws NullPointerException If <code>resolver</code> is
- * <code>null</code>.
- */
- public void setXPathVariableResolver(XPathVariableResolver resolver) {
-
- // resolver cannot be null
- if (resolver == null) {
- String fmsg = XSLMessages.createXPATHMessage(
- XPATHErrorResources.ER_NULL_XPATH_VARIABLE_RESOLVER,
- new Object[] { CLASS_NAME } );
- throw new NullPointerException( fmsg );
- }
-
- xPathVariableResolver = resolver;
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/jaxp/XPathImpl.java b/src/com/sun/org/apache/xpath/internal/jaxp/XPathImpl.java
deleted file mode 100644
index af82f37..0000000
--- a/src/com/sun/org/apache/xpath/internal/jaxp/XPathImpl.java
+++ /dev/null
@@ -1,537 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-// $Id: XPathImpl.java,v 1.2 2005/08/16 22:41:08 jeffsuttor Exp $
-
-package com.sun.org.apache.xpath.internal.jaxp;
-
-import javax.xml.namespace.QName;
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.xpath.XPathExpressionException;
-import javax.xml.xpath.XPathConstants;
-import javax.xml.xpath.XPathFunctionResolver;
-import javax.xml.xpath.XPathVariableResolver;
-import javax.xml.xpath.XPathExpression;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xpath.internal.*;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
-import com.sun.org.apache.xalan.internal.res.XSLMessages;
-import com.sun.org.apache.xalan.internal.utils.FactoryImpl;
-import com.sun.org.apache.xalan.internal.utils.FeatureManager;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.Document;
-import org.w3c.dom.traversal.NodeIterator;
-
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
-import javax.xml.parsers.*;
-
-import java.io.IOException;
-
-/**
- * The XPathImpl class provides implementation for the methods defined in
- * javax.xml.xpath.XPath interface. This provide simple access to the results
- * of an XPath expression.
- *
- *
- * @version $Revision: 1.10 $
- * @author Ramesh Mandava
- */
-public class XPathImpl implements javax.xml.xpath.XPath {
-
- // Private variables
- private XPathVariableResolver variableResolver;
- private XPathFunctionResolver functionResolver;
- private XPathVariableResolver origVariableResolver;
- private XPathFunctionResolver origFunctionResolver;
- private NamespaceContext namespaceContext=null;
- private JAXPPrefixResolver prefixResolver;
- // By default Extension Functions are allowed in XPath Expressions. If
- // Secure Processing Feature is set on XPathFactory then the invocation of
- // extensions function need to throw XPathFunctionException
- private boolean featureSecureProcessing = false;
- private boolean useServiceMechanism = true;
- private final FeatureManager featureManager;
-
- XPathImpl( XPathVariableResolver vr, XPathFunctionResolver fr ) {
- this(vr, fr, false, true, new FeatureManager());
- }
-
- XPathImpl( XPathVariableResolver vr, XPathFunctionResolver fr,
- boolean featureSecureProcessing, boolean useServiceMechanism,
- FeatureManager featureManager) {
- this.origVariableResolver = this.variableResolver = vr;
- this.origFunctionResolver = this.functionResolver = fr;
- this.featureSecureProcessing = featureSecureProcessing;
- this.useServiceMechanism = useServiceMechanism;
- this.featureManager = featureManager;
- }
-
- /**
- * <p>Establishes a variable resolver.</p>
- *
- * @param resolver Variable Resolver
- */
- public void setXPathVariableResolver(XPathVariableResolver resolver) {
- if ( resolver == null ) {
- String fmsg = XSLMessages.createXPATHMessage(
- XPATHErrorResources.ER_ARG_CANNOT_BE_NULL,
- new Object[] {"XPathVariableResolver"} );
- throw new NullPointerException( fmsg );
- }
- this.variableResolver = resolver;
- }
-
- /**
- * <p>Returns the current variable resolver.</p>
- *
- * @return Current variable resolver
- */
- public XPathVariableResolver getXPathVariableResolver() {
- return variableResolver;
- }
-
- /**
- * <p>Establishes a function resolver.</p>
- *
- * @param resolver XPath function resolver
- */
- public void setXPathFunctionResolver(XPathFunctionResolver resolver) {
- if ( resolver == null ) {
- String fmsg = XSLMessages.createXPATHMessage(
- XPATHErrorResources.ER_ARG_CANNOT_BE_NULL,
- new Object[] {"XPathFunctionResolver"} );
- throw new NullPointerException( fmsg );
- }
- this.functionResolver = resolver;
- }
-
- /**
- * <p>Returns the current function resolver.</p>
- *
- * @return Current function resolver
- */
- public XPathFunctionResolver getXPathFunctionResolver() {
- return functionResolver;
- }
-
- /**
- * <p>Establishes a namespace context.</p>
- *
- * @param nsContext Namespace context to use
- */
- public void setNamespaceContext(NamespaceContext nsContext) {
- if ( nsContext == null ) {
- String fmsg = XSLMessages.createXPATHMessage(
- XPATHErrorResources.ER_ARG_CANNOT_BE_NULL,
- new Object[] {"NamespaceContext"} );
- throw new NullPointerException( fmsg );
- }
- this.namespaceContext = nsContext;
- this.prefixResolver = new JAXPPrefixResolver ( nsContext );
- }
-
- /**
- * <p>Returns the current namespace context.</p>
- *
- * @return Current Namespace context
- */
- public NamespaceContext getNamespaceContext() {
- return namespaceContext;
- }
-
- private static Document d = null;
-
- private DocumentBuilder getParser() {
- try {
- // we'd really like to cache those DocumentBuilders, but we can't because:
- // 1. thread safety. parsers are not thread-safe, so at least
- // we need one instance per a thread.
- // 2. parsers are non-reentrant, so now we are looking at having a
- // pool of parsers.
- // 3. then the class loading issue. The look-up procedure of
- // DocumentBuilderFactory.newInstance() depends on context class loader
- // and system properties, which may change during the execution of JVM.
- //
- // so we really have to create a fresh DocumentBuilder every time we need one
- // - KK
- DocumentBuilderFactory dbf = FactoryImpl.getDOMFactory(useServiceMechanism);
- dbf.setNamespaceAware( true );
- dbf.setValidating( false );
- return dbf.newDocumentBuilder();
- } catch (ParserConfigurationException e) {
- // this should never happen with a well-behaving JAXP implementation.
- throw new Error(e);
- }
- }
-
-
- private XObject eval(String expression, Object contextItem)
- throws javax.xml.transform.TransformerException {
- com.sun.org.apache.xpath.internal.XPath xpath = new com.sun.org.apache.xpath.internal.XPath( expression,
- null, prefixResolver, com.sun.org.apache.xpath.internal.XPath.SELECT );
- com.sun.org.apache.xpath.internal.XPathContext xpathSupport = null;
- if ( functionResolver != null ) {
- JAXPExtensionsProvider jep = new JAXPExtensionsProvider(
- functionResolver, featureSecureProcessing, featureManager );
- xpathSupport = new com.sun.org.apache.xpath.internal.XPathContext( jep );
- } else {
- xpathSupport = new com.sun.org.apache.xpath.internal.XPathContext();
- }
-
- XObject xobj = null;
-
- xpathSupport.setVarStack(new JAXPVariableStack(variableResolver));
-
- // If item is null, then we will create a a Dummy contextNode
- if ( contextItem instanceof Node ) {
- xobj = xpath.execute (xpathSupport, (Node)contextItem,
- prefixResolver );
- } else {
- xobj = xpath.execute ( xpathSupport, DTM.NULL, prefixResolver );
- }
-
- return xobj;
- }
-
- /**
- * <p>Evaluate an <code>XPath</code> expression in the specified context and return the result as the specified type.</p>
- *
- * <p>See "Evaluation of XPath Expressions" section of JAXP 1.3 spec
- * for context item evaluation,
- * variable, function and <code>QName</code> resolution and return type conversion.</p>
- *
- * <p>If <code>returnType</code> is not one of the types defined in {@link XPathConstants} (
- * {@link XPathConstants#NUMBER NUMBER},
- * {@link XPathConstants#STRING STRING},
- * {@link XPathConstants#BOOLEAN BOOLEAN},
- * {@link XPathConstants#NODE NODE} or
- * {@link XPathConstants#NODESET NODESET})
- * then an <code>IllegalArgumentException</code> is thrown.</p>
- *
- * <p>If a <code>null</code> value is provided for
- * <code>item</code>, an empty document will be used for the
- * context.
- * If <code>expression</code> or <code>returnType</code> is <code>null</code>, then a
- * <code>NullPointerException</code> is thrown.</p>
- *
- * @param expression The XPath expression.
- * @param item The starting context (node or node list, for example).
- * @param returnType The desired return type.
- *
- * @return Result of evaluating an XPath expression as an <code>Object</code> of <code>returnType</code>.
- *
- * @throws XPathExpressionException If <code>expression</code> cannot be evaluated.
- * @throws IllegalArgumentException If <code>returnType</code> is not one of the types defined in {@link XPathConstants}.
- * @throws NullPointerException If <code>expression</code> or <code>returnType</code> is <code>null</code>.
- */
- public Object evaluate(String expression, Object item, QName returnType)
- throws XPathExpressionException {
- if ( expression == null ) {
- String fmsg = XSLMessages.createXPATHMessage(
- XPATHErrorResources.ER_ARG_CANNOT_BE_NULL,
- new Object[] {"XPath expression"} );
- throw new NullPointerException ( fmsg );
- }
- if ( returnType == null ) {
- String fmsg = XSLMessages.createXPATHMessage(
- XPATHErrorResources.ER_ARG_CANNOT_BE_NULL,
- new Object[] {"returnType"} );
- throw new NullPointerException ( fmsg );
- }
- // Checking if requested returnType is supported. returnType need to
- // be defined in XPathConstants
- if ( !isSupported ( returnType ) ) {
- String fmsg = XSLMessages.createXPATHMessage(
- XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE,
- new Object[] { returnType.toString() } );
- throw new IllegalArgumentException ( fmsg );
- }
-
- try {
-
- XObject resultObject = eval( expression, item );
- return getResultAsType( resultObject, returnType );
- } catch ( java.lang.NullPointerException npe ) {
- // If VariableResolver returns null Or if we get
- // NullPointerException at this stage for some other reason
- // then we have to reurn XPathException
- throw new XPathExpressionException ( npe );
- } catch ( javax.xml.transform.TransformerException te ) {
- Throwable nestedException = te.getException();
- if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) {
- throw (javax.xml.xpath.XPathFunctionException)nestedException;
- } else {
- // For any other exceptions we need to throw
- // XPathExpressionException ( as per spec )
- throw new XPathExpressionException ( te );
- }
- }
-
- }
-
- private boolean isSupported( QName returnType ) {
- if ( ( returnType.equals( XPathConstants.STRING ) ) ||
- ( returnType.equals( XPathConstants.NUMBER ) ) ||
- ( returnType.equals( XPathConstants.BOOLEAN ) ) ||
- ( returnType.equals( XPathConstants.NODE ) ) ||
- ( returnType.equals( XPathConstants.NODESET ) ) ) {
-
- return true;
- }
- return false;
- }
-
- private Object getResultAsType( XObject resultObject, QName returnType )
- throws javax.xml.transform.TransformerException {
- // XPathConstants.STRING
- if ( returnType.equals( XPathConstants.STRING ) ) {
- return resultObject.str();
- }
- // XPathConstants.NUMBER
- if ( returnType.equals( XPathConstants.NUMBER ) ) {
- return new Double ( resultObject.num());
- }
- // XPathConstants.BOOLEAN
- if ( returnType.equals( XPathConstants.BOOLEAN ) ) {
- return new Boolean( resultObject.bool());
- }
- // XPathConstants.NODESET ---ORdered, UNOrdered???
- if ( returnType.equals( XPathConstants.NODESET ) ) {
- return resultObject.nodelist();
- }
- // XPathConstants.NODE
- if ( returnType.equals( XPathConstants.NODE ) ) {
- NodeIterator ni = resultObject.nodeset();
- //Return the first node, or null
- return ni.nextNode();
- }
- String fmsg = XSLMessages.createXPATHMessage(
- XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE,
- new Object[] { returnType.toString()});
- throw new IllegalArgumentException( fmsg );
- }
-
-
-
- /**
- * <p>Evaluate an XPath expression in the specified context and return the result as a <code>String</code>.</p>
- *
- * <p>This method calls {@link #evaluate(String expression, Object item, QName returnType)} with a <code>returnType</code> of
- * {@link XPathConstants#STRING}.</p>
- *
- * <p>See "Evaluation of XPath Expressions" of JAXP 1.3 spec
- * for context item evaluation,
- * variable, function and QName resolution and return type conversion.</p>
- *
- * <p>If a <code>null</code> value is provided for
- * <code>item</code>, an empty document will be used for the
- * context.
- * If <code>expression</code> is <code>null</code>, then a <code>NullPointerException</code> is thrown.</p>
- *
- * @param expression The XPath expression.
- * @param item The starting context (node or node list, for example).
- *
- * @return The <code>String</code> that is the result of evaluating the expression and
- * converting the result to a <code>String</code>.
- *
- * @throws XPathExpressionException If <code>expression</code> cannot be evaluated.
- * @throws NullPointerException If <code>expression</code> is <code>null</code>.
- */
- public String evaluate(String expression, Object item)
- throws XPathExpressionException {
- return (String)this.evaluate( expression, item, XPathConstants.STRING );
- }
-
- /**
- * <p>Compile an XPath expression for later evaluation.</p>
- *
- * <p>If <code>expression</code> contains any {@link XPathFunction}s,
- * they must be available via the {@link XPathFunctionResolver}.
- * An {@link XPathExpressionException} will be thrown if the <code>XPathFunction</code>
- * cannot be resovled with the <code>XPathFunctionResolver</code>.</p>
- *
- * <p>If <code>expression</code> is <code>null</code>, a <code>NullPointerException</code> is thrown.</p>
- *
- * @param expression The XPath expression.
- *
- * @return Compiled XPath expression.
-
- * @throws XPathExpressionException If <code>expression</code> cannot be compiled.
- * @throws NullPointerException If <code>expression</code> is <code>null</code>.
- */
- public XPathExpression compile(String expression)
- throws XPathExpressionException {
- if ( expression == null ) {
- String fmsg = XSLMessages.createXPATHMessage(
- XPATHErrorResources.ER_ARG_CANNOT_BE_NULL,
- new Object[] {"XPath expression"} );
- throw new NullPointerException ( fmsg );
- }
- try {
- com.sun.org.apache.xpath.internal.XPath xpath = new XPath (expression, null,
- prefixResolver, com.sun.org.apache.xpath.internal.XPath.SELECT );
- // Can have errorListener
- XPathExpressionImpl ximpl = new XPathExpressionImpl (xpath,
- prefixResolver, functionResolver, variableResolver,
- featureSecureProcessing, useServiceMechanism, featureManager );
- return ximpl;
- } catch ( javax.xml.transform.TransformerException te ) {
- throw new XPathExpressionException ( te ) ;
- }
- }
-
-
- /**
- * <p>Evaluate an XPath expression in the context of the specified <code>InputSource</code>
- * and return the result as the specified type.</p>
- *
- * <p>This method builds a data model for the {@link InputSource} and calls
- * {@link #evaluate(String expression, Object item, QName returnType)} on the resulting document object.</p>
- *
- * <p>See "Evaluation of XPath Expressions" section of JAXP 1.3 spec
- * for context item evaluation,
- * variable, function and QName resolution and return type conversion.</p>
- *
- * <p>If <code>returnType</code> is not one of the types defined in {@link XPathConstants},
- * then an <code>IllegalArgumentException</code> is thrown.</p>
- *
- * <p>If <code>expression</code>, <code>source</code> or <code>returnType</code> is <code>null</code>,
- * then a <code>NullPointerException</code> is thrown.</p>
- *
- * @param expression The XPath expression.
- * @param source The input source of the document to evaluate over.
- * @param returnType The desired return type.
- *
- * @return The <code>Object</code> that encapsulates the result of evaluating the expression.
- *
- * @throws XPathExpressionException If expression cannot be evaluated.
- * @throws IllegalArgumentException If <code>returnType</code> is not one of the types defined in {@link XPathConstants}.
- * @throws NullPointerException If <code>expression</code>, <code>source</code> or <code>returnType</code>
- * is <code>null</code>.
- */
- public Object evaluate(String expression, InputSource source,
- QName returnType) throws XPathExpressionException {
- // Checking validity of different parameters
- if( source== null ) {
- String fmsg = XSLMessages.createXPATHMessage(
- XPATHErrorResources.ER_ARG_CANNOT_BE_NULL,
- new Object[] {"source"} );
- throw new NullPointerException ( fmsg );
- }
- if ( expression == null ) {
- String fmsg = XSLMessages.createXPATHMessage(
- XPATHErrorResources.ER_ARG_CANNOT_BE_NULL,
- new Object[] {"XPath expression"} );
- throw new NullPointerException ( fmsg );
- }
- if ( returnType == null ) {
- String fmsg = XSLMessages.createXPATHMessage(
- XPATHErrorResources.ER_ARG_CANNOT_BE_NULL,
- new Object[] {"returnType"} );
- throw new NullPointerException ( fmsg );
- }
-
- //Checking if requested returnType is supported.
- //returnType need to be defined in XPathConstants
- if ( !isSupported ( returnType ) ) {
- String fmsg = XSLMessages.createXPATHMessage(
- XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE,
- new Object[] { returnType.toString() } );
- throw new IllegalArgumentException ( fmsg );
- }
-
- try {
-
- Document document = getParser().parse( source );
-
- XObject resultObject = eval( expression, document );
- return getResultAsType( resultObject, returnType );
- } catch ( SAXException e ) {
- throw new XPathExpressionException ( e );
- } catch( IOException e ) {
- throw new XPathExpressionException ( e );
- } catch ( javax.xml.transform.TransformerException te ) {
- Throwable nestedException = te.getException();
- if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) {
- throw (javax.xml.xpath.XPathFunctionException)nestedException;
- } else {
- throw new XPathExpressionException ( te );
- }
- }
-
- }
-
-
-
-
- /**
- * <p>Evaluate an XPath expression in the context of the specified <code>InputSource</code>
- * and return the result as a <code>String</code>.</p>
- *
- * <p>This method calls {@link #evaluate(String expression, InputSource source, QName returnType)} with a
- * <code>returnType</code> of {@link XPathConstants#STRING}.</p>
- *
- * <p>See "Evaluation of XPath Expressions" section of JAXP 1.3 spec
- * for context item evaluation,
- * variable, function and QName resolution and return type conversion.</p>
- *
- * <p>If <code>expression</code> or <code>source</code> is <code>null</code>,
- * then a <code>NullPointerException</code> is thrown.</p>
- *
- * @param expression The XPath expression.
- * @param source The <code>InputSource</code> of the document to evaluate over.
- *
- * @return The <code>String</code> that is the result of evaluating the expression and
- * converting the result to a <code>String</code>.
- *
- * @throws XPathExpressionException If expression cannot be evaluated.
- * @throws NullPointerException If <code>expression</code> or <code>source</code> is <code>null</code>.
- */
- public String evaluate(String expression, InputSource source)
- throws XPathExpressionException {
- return (String)this.evaluate( expression, source, XPathConstants.STRING );
- }
-
- /**
- * <p>Reset this <code>XPath</code> to its original configuration.</p>
- *
- * <p><code>XPath</code> is reset to the same state as when it was created with
- * {@link XPathFactory#newXPath()}.
- * <code>reset()</code> is designed to allow the reuse of existing <code>XPath</code>s
- * thus saving resources associated with the creation of new <code>XPath</code>s.</p>
- *
- * <p>The reset <code>XPath</code> is not guaranteed to have the same
- * {@link XPathFunctionResolver}, {@link XPathVariableResolver}
- * or {@link NamespaceContext} <code>Object</code>s, e.g. {@link Object#equals(Object obj)}.
- * It is guaranteed to have a functionally equal <code>XPathFunctionResolver</code>,
- * <code>XPathVariableResolver</code>
- * and <code>NamespaceContext</code>.</p>
- */
- public void reset() {
- this.variableResolver = this.origVariableResolver;
- this.functionResolver = this.origFunctionResolver;
- this.namespaceContext = null;
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/objects/DTMXRTreeFrag.java b/src/com/sun/org/apache/xpath/internal/objects/DTMXRTreeFrag.java
deleted file mode 100644
index 2b321a9..0000000
--- a/src/com/sun/org/apache/xpath/internal/objects/DTMXRTreeFrag.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.org.apache.xpath.internal.objects;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xpath.internal.XPathContext;
-/*
- *
- * @author igorh
- *
- * Simple wrapper to DTM and XPathContext objects.
- * Used in XRTreeFrag for caching references to the objects.
- */
- public final class DTMXRTreeFrag {
- private DTM m_dtm;
- private int m_dtmIdentity = DTM.NULL;
- private XPathContext m_xctxt;
-
- public DTMXRTreeFrag(int dtmIdentity, XPathContext xctxt){
- m_xctxt = xctxt;
- m_dtmIdentity = dtmIdentity;
- m_dtm = xctxt.getDTM(dtmIdentity);
- }
-
- public final void destruct(){
- m_dtm = null;
- m_xctxt = null;
- }
-
-final DTM getDTM(){return m_dtm;}
-public final int getDTMIdentity(){return m_dtmIdentity;}
-final XPathContext getXPathContext(){return m_xctxt;}
-
-public final int hashCode() { return m_dtmIdentity; }
-public final boolean equals(Object obj) {
- if (obj instanceof DTMXRTreeFrag) {
- return (m_dtmIdentity == ((DTMXRTreeFrag)obj).getDTMIdentity());
- }
- return false;
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/objects/XBoolean.java b/src/com/sun/org/apache/xpath/internal/objects/XBoolean.java
deleted file mode 100644
index 61caef4..0000000
--- a/src/com/sun/org/apache/xpath/internal/objects/XBoolean.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XBoolean.java,v 1.2.4.2 2005/09/14 20:34:45 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.objects;
-
-/**
- * This class represents an XPath boolean object, and is capable of
- * converting the boolean to other types, such as a string.
- * @xsl.usage advanced
- */
-public class XBoolean extends XObject
-{
- static final long serialVersionUID = -2964933058866100881L;
-
- /**
- * A true boolean object so we don't have to keep creating them.
- * @xsl.usage internal
- */
- public static final XBoolean S_TRUE = new XBooleanStatic(true);
-
- /**
- * A true boolean object so we don't have to keep creating them.
- * @xsl.usage internal
- */
- public static final XBoolean S_FALSE = new XBooleanStatic(false);
-
- /** Value of the object.
- * @serial */
- private final boolean m_val;
-
- /**
- * Construct a XBoolean object.
- *
- * @param b Value of the boolean object
- */
- public XBoolean(boolean b)
- {
-
- super();
-
- m_val = b;
- }
-
- /**
- * Construct a XBoolean object.
- *
- * @param b Value of the boolean object
- */
- public XBoolean(Boolean b)
- {
-
- super();
-
- m_val = b.booleanValue();
- setObject(b);
- }
-
-
- /**
- * Tell that this is a CLASS_BOOLEAN.
- *
- * @return type of CLASS_BOOLEAN
- */
- public int getType()
- {
- return CLASS_BOOLEAN;
- }
-
- /**
- * Given a request type, return the equivalent string.
- * For diagnostic purposes.
- *
- * @return type string "#BOOLEAN"
- */
- public String getTypeString()
- {
- return "#BOOLEAN";
- }
-
- /**
- * Cast result object to a number.
- *
- * @return numeric value of the object value
- */
- public double num()
- {
- return m_val ? 1.0 : 0.0;
- }
-
- /**
- * Cast result object to a boolean.
- *
- * @return The object value as a boolean
- */
- public boolean bool()
- {
- return m_val;
- }
-
- /**
- * Cast result object to a string.
- *
- * @return The object's value as a string
- */
- public String str()
- {
- return m_val ? "true" : "false";
- }
-
- /**
- * Return a java object that's closest to the representation
- * that should be handed to an extension.
- *
- * @return The object's value as a java object
- */
- public Object object()
- {
- if(null == m_obj)
- setObject(new Boolean(m_val));
- return m_obj;
- }
-
- /**
- * Tell if two objects are functionally equal.
- *
- * @param obj2 Object to compare to this
- *
- * @return True if the two objects are equal
- *
- * @throws javax.xml.transform.TransformerException
- */
- public boolean equals(XObject obj2)
- {
-
- // In order to handle the 'all' semantics of
- // nodeset comparisons, we always call the
- // nodeset function.
- if (obj2.getType() == XObject.CLASS_NODESET)
- return obj2.equals(this);
-
- try
- {
- return m_val == obj2.bool();
- }
- catch(javax.xml.transform.TransformerException te)
- {
- throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(te);
- }
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/objects/XBooleanStatic.java b/src/com/sun/org/apache/xpath/internal/objects/XBooleanStatic.java
deleted file mode 100644
index 7168f08..0000000
--- a/src/com/sun/org/apache/xpath/internal/objects/XBooleanStatic.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XBooleanStatic.java,v 1.2.4.2 2005/09/14 20:34:46 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.objects;
-
-/**
- * This class doesn't have any XPathContext, so override
- * whatever to ensure it works OK.
- * @xsl.usage internal
- */
-public class XBooleanStatic extends XBoolean
-{
- static final long serialVersionUID = -8064147275772687409L;
-
- /** The value of the object.
- * @serial */
- private final boolean m_val;
-
- /**
- * Construct a XBooleanStatic object.
- *
- * @param b The value of the object
- */
- public XBooleanStatic(boolean b)
- {
-
- super(b);
-
- m_val = b;
- }
-
- /**
- * Tell if two objects are functionally equal.
- *
- * @param obj2 Object to compare to this
- *
- * @return True if the two objects are equal
- *
- * @throws javax.xml.transform.TransformerException
- */
- public boolean equals(XObject obj2)
- {
- try
- {
- return m_val == obj2.bool();
- }
- catch(javax.xml.transform.TransformerException te)
- {
- throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(te);
- }
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/objects/XMLStringFactoryImpl.java b/src/com/sun/org/apache/xpath/internal/objects/XMLStringFactoryImpl.java
deleted file mode 100644
index f475e7d..0000000
--- a/src/com/sun/org/apache/xpath/internal/objects/XMLStringFactoryImpl.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XMLStringFactoryImpl.java,v 1.2.4.1 2005/09/10 17:44:29 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.objects;
-
-import com.sun.org.apache.xml.internal.utils.FastStringBuffer;
-import com.sun.org.apache.xml.internal.utils.XMLString;
-import com.sun.org.apache.xml.internal.utils.XMLStringFactory;
-
-/**
- * Class XMLStringFactoryImpl creates XString versions of XMLStrings.
- * @xsl.usage internal
- */
-public class XMLStringFactoryImpl extends XMLStringFactory
-{
- /** The XMLStringFactory to pass to DTM construction. */
- private static XMLStringFactory m_xstringfactory =
- new XMLStringFactoryImpl();
-
- /**
- * Get the XMLStringFactory to pass to DTM construction.
- *
- *
- * @return A never-null static reference to a String factory.
- */
- public static XMLStringFactory getFactory()
- {
- return m_xstringfactory;
- }
-
- /**
- * Create a new XMLString from a Java string.
- *
- *
- * @param string Java String reference, which must be non-null.
- *
- * @return An XMLString object that wraps the String reference.
- */
- public XMLString newstr(String string)
- {
- return new XString(string);
- }
-
- /**
- * Create a XMLString from a FastStringBuffer.
- *
- *
- * @param fsb FastStringBuffer reference, which must be non-null.
- * @param start The start position in the array.
- * @param length The number of characters to read from the array.
- *
- * @return An XMLString object that wraps the FastStringBuffer reference.
- */
- public XMLString newstr(FastStringBuffer fsb, int start, int length)
- {
- return new XStringForFSB(fsb, start, length);
- }
-
- /**
- * Create a XMLString from a FastStringBuffer.
- *
- *
- * @param string FastStringBuffer reference, which must be non-null.
- * @param start The start position in the array.
- * @param length The number of characters to read from the array.
- *
- * @return An XMLString object that wraps the FastStringBuffer reference.
- */
- public XMLString newstr(char[] string, int start, int length)
- {
- return new XStringForChars(string, start, length);
- }
-
- /**
- * Get a cheap representation of an empty string.
- *
- * @return An non-null reference to an XMLString that represents "".
- */
- public XMLString emptystr()
- {
- return XString.EMPTYSTRING;
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/objects/XNodeSet.java b/src/com/sun/org/apache/xpath/internal/objects/XNodeSet.java
deleted file mode 100644
index 07dabc3..0000000
--- a/src/com/sun/org/apache/xpath/internal/objects/XNodeSet.java
+++ /dev/null
@@ -1,971 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XNodeSet.java,v 1.2.4.2 2005/09/14 20:34:45 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.objects;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMIterator;
-import com.sun.org.apache.xml.internal.dtm.DTMManager;
-import com.sun.org.apache.xml.internal.utils.XMLString;
-import com.sun.org.apache.xpath.internal.NodeSetDTM;
-import com.sun.org.apache.xpath.internal.axes.NodeSequence;
-
-import org.w3c.dom.NodeList;
-import org.w3c.dom.traversal.NodeIterator;
-
-/**
- * This class represents an XPath nodeset object, and is capable of
- * converting the nodeset to other types, such as a string.
- * @xsl.usage general
- */
-public class XNodeSet extends NodeSequence
-{
- static final long serialVersionUID = 1916026368035639667L;
- /**
- * Default constructor for derived objects.
- */
- protected XNodeSet()
- {
- }
-
- /**
- * Construct a XNodeSet object.
- *
- * @param val Value of the XNodeSet object
- */
- public XNodeSet(DTMIterator val)
- {
- super();
- if(val instanceof XNodeSet)
- {
- final XNodeSet nodeSet = (XNodeSet) val;
- setIter(nodeSet.m_iter);
- m_dtmMgr = nodeSet.m_dtmMgr;
- m_last = nodeSet.m_last;
- // First make sure the DTMIterator val has a cache,
- // so if it doesn't have one, make one.
- if(!nodeSet.hasCache())
- nodeSet.setShouldCacheNodes(true);
-
- // Get the cache from val and use it ourselves (we share it).
- setObject(nodeSet.getIteratorCache());
- }
- else
- setIter(val);
- }
-
- /**
- * Construct a XNodeSet object.
- *
- * @param val Value of the XNodeSet object
- */
- public XNodeSet(XNodeSet val)
- {
- super();
- setIter(val.m_iter);
- m_dtmMgr = val.m_dtmMgr;
- m_last = val.m_last;
- if(!val.hasCache())
- val.setShouldCacheNodes(true);
- setObject(val.m_obj);
- }
-
-
- /**
- * Construct an empty XNodeSet object. This is used to create a mutable
- * nodeset to which random nodes may be added.
- */
- public XNodeSet(DTMManager dtmMgr)
- {
- this(DTM.NULL,dtmMgr);
- }
-
- /**
- * Construct a XNodeSet object for one node.
- *
- * @param n Node to add to the new XNodeSet object
- */
- public XNodeSet(int n, DTMManager dtmMgr)
- {
-
- super(new NodeSetDTM(dtmMgr));
- m_dtmMgr = dtmMgr;
-
- if (DTM.NULL != n)
- {
- ((NodeSetDTM) m_obj).addNode(n);
- m_last = 1;
- }
- else
- m_last = 0;
- }
-
- /**
- * Tell that this is a CLASS_NODESET.
- *
- * @return type CLASS_NODESET
- */
- public int getType()
- {
- return CLASS_NODESET;
- }
-
- /**
- * Given a request type, return the equivalent string.
- * For diagnostic purposes.
- *
- * @return type string "#NODESET"
- */
- public String getTypeString()
- {
- return "#NODESET";
- }
-
- /**
- * Get numeric value of the string conversion from a single node.
- *
- * @param n Node to convert
- *
- * @return numeric value of the string conversion from a single node.
- */
- public double getNumberFromNode(int n)
- {
- XMLString xstr = m_dtmMgr.getDTM(n).getStringValue(n);
- return xstr.toDouble();
- }
-
- /**
- * Cast result object to a number.
- *
- * @return numeric value of the string conversion from the
- * next node in the NodeSetDTM, or NAN if no node was found
- */
- public double num()
- {
-
- int node = item(0);
- return (node != DTM.NULL) ? getNumberFromNode(node) : Double.NaN;
- }
-
- /**
- * Cast result object to a number, but allow side effects, such as the
- * incrementing of an iterator.
- *
- * @return numeric value of the string conversion from the
- * next node in the NodeSetDTM, or NAN if no node was found
- */
- public double numWithSideEffects()
- {
- int node = nextNode();
-
- return (node != DTM.NULL) ? getNumberFromNode(node) : Double.NaN;
- }
-
-
- /**
- * Cast result object to a boolean.
- *
- * @return True if there is a next node in the nodeset
- */
- public boolean bool()
- {
- return (item(0) != DTM.NULL);
- }
-
- /**
- * Cast result object to a boolean, but allow side effects, such as the
- * incrementing of an iterator.
- *
- * @return True if there is a next node in the nodeset
- */
- public boolean boolWithSideEffects()
- {
- return (nextNode() != DTM.NULL);
- }
-
-
- /**
- * Get the string conversion from a single node.
- *
- * @param n Node to convert
- *
- * @return the string conversion from a single node.
- */
- public XMLString getStringFromNode(int n)
- {
- // %OPT%
- // I guess we'll have to get a static instance of the DTM manager...
- if(DTM.NULL != n)
- {
- return m_dtmMgr.getDTM(n).getStringValue(n);
- }
- else
- {
- return com.sun.org.apache.xpath.internal.objects.XString.EMPTYSTRING;
- }
- }
-
- /**
- * Directly call the
- * characters method on the passed ContentHandler for the
- * string-value. Multiple calls to the
- * ContentHandler's characters methods may well occur for a single call to
- * this method.
- *
- * @param ch A non-null reference to a ContentHandler.
- *
- * @throws org.xml.sax.SAXException
- */
- public void dispatchCharactersEvents(org.xml.sax.ContentHandler ch)
- throws org.xml.sax.SAXException
- {
- int node = item(0);
-
- if(node != DTM.NULL)
- {
- m_dtmMgr.getDTM(node).dispatchCharactersEvents(node, ch, false);
- }
-
- }
-
- /**
- * Cast result object to an XMLString.
- *
- * @return The document fragment node data or the empty string.
- */
- public XMLString xstr()
- {
- int node = item(0);
- return (node != DTM.NULL) ? getStringFromNode(node) : XString.EMPTYSTRING;
- }
-
- /**
- * Cast result object to a string.
- *
- * @return The string this wraps or the empty string if null
- */
- public void appendToFsb(com.sun.org.apache.xml.internal.utils.FastStringBuffer fsb)
- {
- XString xstring = (XString)xstr();
- xstring.appendToFsb(fsb);
- }
-
-
- /**
- * Cast result object to a string.
- *
- * @return the string conversion from the next node in the nodeset
- * or "" if there is no next node
- */
- public String str()
- {
- int node = item(0);
- return (node != DTM.NULL) ? getStringFromNode(node).toString() : "";
- }
-
- /**
- * Return a java object that's closest to the representation
- * that should be handed to an extension.
- *
- * @return The object that this class wraps
- */
- public Object object()
- {
- if(null == m_obj)
- return this;
- else
- return m_obj;
- }
-
- // %REVIEW%
- // hmmm...
-// /**
-// * Cast result object to a result tree fragment.
-// *
-// * @param support The XPath context to use for the conversion
-// *
-// * @return the nodeset as a result tree fragment.
-// */
-// public DocumentFragment rtree(XPathContext support)
-// {
-// DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
-// DocumentBuilder db = dbf.newDocumentBuilder();
-// Document myDoc = db.newDocument();
-//
-// DocumentFragment docFrag = myDoc.createDocumentFragment();
-//
-// DTMIterator nl = iter();
-// int node;
-//
-// while (DTM.NULL != (node = nl.nextNode()))
-// {
-// frag.appendChild(node, true, true);
-// }
-//
-// return frag.getDocument();
-// }
-
- /**
- * Cast result object to a nodelist.
- *
- * @return a NodeIterator.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public NodeIterator nodeset() throws javax.xml.transform.TransformerException
- {
- return new com.sun.org.apache.xml.internal.dtm.ref.DTMNodeIterator(iter());
- }
-
- /**
- * Cast result object to a nodelist.
- *
- * @return a NodeList.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public NodeList nodelist() throws javax.xml.transform.TransformerException
- {
- com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList nodelist = new com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList(this);
- // Creating a DTMNodeList has the side-effect that it will create a clone
- // XNodeSet with cache and run m_iter to the end. You cannot get any node
- // from m_iter after this call. As a fix, we call SetVector() on the clone's
- // cache. See Bugzilla 14406.
- XNodeSet clone = (XNodeSet)nodelist.getDTMIterator();
- SetVector(clone.getVector());
- return nodelist;
- }
-
-
-// /**
-// * Return a java object that's closest to the representation
-// * that should be handed to an extension.
-// *
-// * @return The object that this class wraps
-// */
-// public Object object()
-// {
-// return new com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList(iter());
-// }
-
- /**
- * Return the iterator without cloning, etc.
- */
- public DTMIterator iterRaw()
- {
- return this;
- }
-
- public void release(DTMIterator iter)
- {
- }
-
- /**
- * Cast result object to a nodelist.
- *
- * @return The nodeset as a nodelist
- */
- public DTMIterator iter()
- {
- try
- {
- if(hasCache())
- return cloneWithReset();
- else
- return this; // don't bother to clone... won't do any good!
- }
- catch (CloneNotSupportedException cnse)
- {
- throw new RuntimeException(cnse.getMessage());
- }
- }
-
- /**
- * Get a fresh copy of the object. For use with variables.
- *
- * @return A fresh nodelist.
- */
- public XObject getFresh()
- {
- try
- {
- if(hasCache())
- return (XObject)cloneWithReset();
- else
- return this; // don't bother to clone... won't do any good!
- }
- catch (CloneNotSupportedException cnse)
- {
- throw new RuntimeException(cnse.getMessage());
- }
- }
-
- /**
- * Cast result object to a mutableNodeset.
- *
- * @return The nodeset as a mutableNodeset
- */
- public NodeSetDTM mutableNodeset()
- {
- NodeSetDTM mnl;
-
- if(m_obj instanceof NodeSetDTM)
- {
- mnl = (NodeSetDTM) m_obj;
- }
- else
- {
- mnl = new NodeSetDTM(iter());
- setObject(mnl);
- setCurrentPos(0);
- }
-
- return mnl;
- }
-
- /** Less than comparator */
- static final LessThanComparator S_LT = new LessThanComparator();
-
- /** Less than or equal comparator */
- static final LessThanOrEqualComparator S_LTE = new LessThanOrEqualComparator();
-
- /** Greater than comparator */
- static final GreaterThanComparator S_GT = new GreaterThanComparator();
-
- /** Greater than or equal comparator */
- static final GreaterThanOrEqualComparator S_GTE =
- new GreaterThanOrEqualComparator();
-
- /** Equal comparator */
- static final EqualComparator S_EQ = new EqualComparator();
-
- /** Not equal comparator */
- static final NotEqualComparator S_NEQ = new NotEqualComparator();
-
- /**
- * Tell if one object is less than the other.
- *
- * @param obj2 Object to compare this nodeset to
- * @param comparator Comparator to use
- *
- * @return See the comments below for each object type comparison
- *
- * @throws javax.xml.transform.TransformerException
- */
- public boolean compare(XObject obj2, Comparator comparator)
- throws javax.xml.transform.TransformerException
- {
-
- boolean result = false;
- int type = obj2.getType();
-
- if (XObject.CLASS_NODESET == type)
- {
- // %OPT% This should be XMLString based instead of string based...
-
- // From http://www.w3.org/TR/xpath:
- // If both objects to be compared are node-sets, then the comparison
- // will be true if and only if there is a node in the first node-set
- // and a node in the second node-set such that the result of performing
- // the comparison on the string-values of the two nodes is true.
- // Note this little gem from the draft:
- // NOTE: If $x is bound to a node-set, then $x="foo"
- // does not mean the same as not($x!="foo"): the former
- // is true if and only if some node in $x has the string-value
- // foo; the latter is true if and only if all nodes in $x have
- // the string-value foo.
- DTMIterator list1 = iterRaw();
- DTMIterator list2 = ((XNodeSet) obj2).iterRaw();
- int node1;
- java.util.Vector node2Strings = null;
-
- while (DTM.NULL != (node1 = list1.nextNode()))
- {
- XMLString s1 = getStringFromNode(node1);
-
- if (null == node2Strings)
- {
- int node2;
-
- while (DTM.NULL != (node2 = list2.nextNode()))
- {
- XMLString s2 = getStringFromNode(node2);
-
- if (comparator.compareStrings(s1, s2))
- {
- result = true;
-
- break;
- }
-
- if (null == node2Strings)
- node2Strings = new java.util.Vector();
-
- node2Strings.addElement(s2);
- }
- }
- else
- {
- int n = node2Strings.size();
-
- for (int i = 0; i < n; i++)
- {
- if (comparator.compareStrings(s1, (XMLString)node2Strings.elementAt(i)))
- {
- result = true;
-
- break;
- }
- }
- }
- }
- list1.reset();
- list2.reset();
- }
- else if (XObject.CLASS_BOOLEAN == type)
- {
-
- // From http://www.w3.org/TR/xpath:
- // If one object to be compared is a node-set and the other is a boolean,
- // then the comparison will be true if and only if the result of
- // performing the comparison on the boolean and on the result of
- // converting the node-set to a boolean using the boolean function
- // is true.
- double num1 = bool() ? 1.0 : 0.0;
- double num2 = obj2.num();
-
- result = comparator.compareNumbers(num1, num2);
- }
- else if (XObject.CLASS_NUMBER == type)
- {
-
- // From http://www.w3.org/TR/xpath:
- // If one object to be compared is a node-set and the other is a number,
- // then the comparison will be true if and only if there is a
- // node in the node-set such that the result of performing the
- // comparison on the number to be compared and on the result of
- // converting the string-value of that node to a number using
- // the number function is true.
- DTMIterator list1 = iterRaw();
- double num2 = obj2.num();
- int node;
-
- while (DTM.NULL != (node = list1.nextNode()))
- {
- double num1 = getNumberFromNode(node);
-
- if (comparator.compareNumbers(num1, num2))
- {
- result = true;
-
- break;
- }
- }
- list1.reset();
- }
- else if (XObject.CLASS_RTREEFRAG == type)
- {
- XMLString s2 = obj2.xstr();
- DTMIterator list1 = iterRaw();
- int node;
-
- while (DTM.NULL != (node = list1.nextNode()))
- {
- XMLString s1 = getStringFromNode(node);
-
- if (comparator.compareStrings(s1, s2))
- {
- result = true;
-
- break;
- }
- }
- list1.reset();
- }
- else if (XObject.CLASS_STRING == type)
- {
-
- // From http://www.w3.org/TR/xpath:
- // If one object to be compared is a node-set and the other is a
- // string, then the comparison will be true if and only if there
- // is a node in the node-set such that the result of performing
- // the comparison on the string-value of the node and the other
- // string is true.
- XMLString s2 = obj2.xstr();
- DTMIterator list1 = iterRaw();
- int node;
-
- while (DTM.NULL != (node = list1.nextNode()))
- {
- XMLString s1 = getStringFromNode(node);
- if (comparator.compareStrings(s1, s2))
- {
- result = true;
-
- break;
- }
- }
- list1.reset();
- }
- else
- {
- result = comparator.compareNumbers(this.num(), obj2.num());
- }
-
- return result;
- }
-
- /**
- * Tell if one object is less than the other.
- *
- * @param obj2 object to compare this nodeset to
- *
- * @return see this.compare(...)
- *
- * @throws javax.xml.transform.TransformerException
- */
- public boolean lessThan(XObject obj2) throws javax.xml.transform.TransformerException
- {
- return compare(obj2, S_LT);
- }
-
- /**
- * Tell if one object is less than or equal to the other.
- *
- * @param obj2 object to compare this nodeset to
- *
- * @return see this.compare(...)
- *
- * @throws javax.xml.transform.TransformerException
- */
- public boolean lessThanOrEqual(XObject obj2) throws javax.xml.transform.TransformerException
- {
- return compare(obj2, S_LTE);
- }
-
- /**
- * Tell if one object is less than the other.
- *
- * @param obj2 object to compare this nodeset to
- *
- * @return see this.compare(...)
- *
- * @throws javax.xml.transform.TransformerException
- */
- public boolean greaterThan(XObject obj2) throws javax.xml.transform.TransformerException
- {
- return compare(obj2, S_GT);
- }
-
- /**
- * Tell if one object is less than the other.
- *
- * @param obj2 object to compare this nodeset to
- *
- * @return see this.compare(...)
- *
- * @throws javax.xml.transform.TransformerException
- */
- public boolean greaterThanOrEqual(XObject obj2)
- throws javax.xml.transform.TransformerException
- {
- return compare(obj2, S_GTE);
- }
-
- /**
- * Tell if two objects are functionally equal.
- *
- * @param obj2 object to compare this nodeset to
- *
- * @return see this.compare(...)
- *
- * @throws javax.xml.transform.TransformerException
- */
- public boolean equals(XObject obj2)
- {
- try
- {
- return compare(obj2, S_EQ);
- }
- catch(javax.xml.transform.TransformerException te)
- {
- throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(te);
- }
- }
-
- /**
- * Tell if two objects are functionally not equal.
- *
- * @param obj2 object to compare this nodeset to
- *
- * @return see this.compare(...)
- *
- * @throws javax.xml.transform.TransformerException
- */
- public boolean notEquals(XObject obj2) throws javax.xml.transform.TransformerException
- {
- return compare(obj2, S_NEQ);
- }
-}
-
-/**
- * compares nodes for various boolean operations.
- */
-abstract class Comparator
-{
-
- /**
- * Compare two strings
- *
- *
- * @param s1 First string to compare
- * @param s2 Second String to compare
- *
- * @return Whether the strings are equal or not
- */
- abstract boolean compareStrings(XMLString s1, XMLString s2);
-
- /**
- * Compare two numbers
- *
- *
- * @param n1 First number to compare
- * @param n2 Second number to compare
- *
- * @return Whether the numbers are equal or not
- */
- abstract boolean compareNumbers(double n1, double n2);
-}
-
-/**
- * Compare strings or numbers for less than.
- */
-class LessThanComparator extends Comparator
-{
-
- /**
- * Compare two strings for less than.
- *
- *
- * @param s1 First string to compare
- * @param s2 Second String to compare
- *
- * @return True if s1 is less than s2
- */
- boolean compareStrings(XMLString s1, XMLString s2)
- {
- return (s1.toDouble() < s2.toDouble());
- // return s1.compareTo(s2) < 0;
- }
-
- /**
- * Compare two numbers for less than.
- *
- *
- * @param n1 First number to compare
- * @param n2 Second number to compare
- *
- * @return true if n1 is less than n2
- */
- boolean compareNumbers(double n1, double n2)
- {
- return n1 < n2;
- }
-}
-
-/**
- * Compare strings or numbers for less than or equal.
- */
-class LessThanOrEqualComparator extends Comparator
-{
-
- /**
- * Compare two strings for less than or equal.
- *
- *
- * @param s1 First string to compare
- * @param s2 Second String to compare
- *
- * @return true if s1 is less than or equal to s2
- */
- boolean compareStrings(XMLString s1, XMLString s2)
- {
- return (s1.toDouble() <= s2.toDouble());
- // return s1.compareTo(s2) <= 0;
- }
-
- /**
- * Compare two numbers for less than or equal.
- *
- *
- * @param n1 First number to compare
- * @param n2 Second number to compare
- *
- * @return true if n1 is less than or equal to n2
- */
- boolean compareNumbers(double n1, double n2)
- {
- return n1 <= n2;
- }
-}
-
-/**
- * Compare strings or numbers for greater than.
- */
-class GreaterThanComparator extends Comparator
-{
-
- /**
- * Compare two strings for greater than.
- *
- *
- * @param s1 First string to compare
- * @param s2 Second String to compare
- *
- * @return true if s1 is greater than s2
- */
- boolean compareStrings(XMLString s1, XMLString s2)
- {
- return (s1.toDouble() > s2.toDouble());
- // return s1.compareTo(s2) > 0;
- }
-
- /**
- * Compare two numbers for greater than.
- *
- *
- * @param n1 First number to compare
- * @param n2 Second number to compare
- *
- * @return true if n1 is greater than n2
- */
- boolean compareNumbers(double n1, double n2)
- {
- return n1 > n2;
- }
-}
-
-/**
- * Compare strings or numbers for greater than or equal.
- */
-class GreaterThanOrEqualComparator extends Comparator
-{
-
- /**
- * Compare two strings for greater than or equal.
- *
- *
- * @param s1 First string to compare
- * @param s2 Second String to compare
- *
- * @return true if s1 is greater than or equal to s2
- */
- boolean compareStrings(XMLString s1, XMLString s2)
- {
- return (s1.toDouble() >= s2.toDouble());
- // return s1.compareTo(s2) >= 0;
- }
-
- /**
- * Compare two numbers for greater than or equal.
- *
- *
- * @param n1 First number to compare
- * @param n2 Second number to compare
- *
- * @return true if n1 is greater than or equal to n2
- */
- boolean compareNumbers(double n1, double n2)
- {
- return n1 >= n2;
- }
-}
-
-/**
- * Compare strings or numbers for equality.
- */
-class EqualComparator extends Comparator
-{
-
- /**
- * Compare two strings for equality.
- *
- *
- * @param s1 First string to compare
- * @param s2 Second String to compare
- *
- * @return true if s1 is equal to s2
- */
- boolean compareStrings(XMLString s1, XMLString s2)
- {
- return s1.equals(s2);
- }
-
- /**
- * Compare two numbers for equality.
- *
- *
- * @param n1 First number to compare
- * @param n2 Second number to compare
- *
- * @return true if n1 is equal to n2
- */
- boolean compareNumbers(double n1, double n2)
- {
- return n1 == n2;
- }
-}
-
-/**
- * Compare strings or numbers for non-equality.
- */
-class NotEqualComparator extends Comparator
-{
-
- /**
- * Compare two strings for non-equality.
- *
- *
- * @param s1 First string to compare
- * @param s2 Second String to compare
- *
- * @return true if s1 is not equal to s2
- */
- boolean compareStrings(XMLString s1, XMLString s2)
- {
- return !s1.equals(s2);
- }
-
- /**
- * Compare two numbers for non-equality.
- *
- *
- * @param n1 First number to compare
- * @param n2 Second number to compare
- *
- * @return true if n1 is not equal to n2
- */
- boolean compareNumbers(double n1, double n2)
- {
- return n1 != n2;
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/objects/XNodeSetForDOM.java b/src/com/sun/org/apache/xpath/internal/objects/XNodeSetForDOM.java
deleted file mode 100644
index c7aac43..0000000
--- a/src/com/sun/org/apache/xpath/internal/objects/XNodeSetForDOM.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XNodeSetForDOM.java,v 1.2.4.1 2005/09/14 20:34:46 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.objects;
-
-import com.sun.org.apache.xml.internal.dtm.DTMManager;
-import com.sun.org.apache.xpath.internal.NodeSetDTM;
-import com.sun.org.apache.xpath.internal.XPathContext;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.traversal.NodeIterator;
-
-/**
- * This class overrides the XNodeSet#object() method to provide the original
- * Node object, NodeList object, or NodeIterator.
- */
-public class XNodeSetForDOM extends XNodeSet
-{
- static final long serialVersionUID = -8396190713754624640L;
- Object m_origObj;
-
- public XNodeSetForDOM(Node node, DTMManager dtmMgr)
- {
- m_dtmMgr = dtmMgr;
- m_origObj = node;
- int dtmHandle = dtmMgr.getDTMHandleFromNode(node);
- setObject(new NodeSetDTM(dtmMgr));
- ((NodeSetDTM) m_obj).addNode(dtmHandle);
- }
-
- /**
- * Construct a XNodeSet object.
- *
- * @param val Value of the XNodeSet object
- */
- public XNodeSetForDOM(XNodeSet val)
- {
- super(val);
- if(val instanceof XNodeSetForDOM)
- m_origObj = ((XNodeSetForDOM)val).m_origObj;
- }
-
- public XNodeSetForDOM(NodeList nodeList, XPathContext xctxt)
- {
- m_dtmMgr = xctxt.getDTMManager();
- m_origObj = nodeList;
-
- // JKESS 20020514: Longer-term solution is to force
- // folks to request length through an accessor, so we can defer this
- // retrieval... but that requires an API change.
- // m_obj=new com.sun.org.apache.xpath.internal.NodeSetDTM(nodeList, xctxt);
- com.sun.org.apache.xpath.internal.NodeSetDTM nsdtm=new com.sun.org.apache.xpath.internal.NodeSetDTM(nodeList, xctxt);
- m_last=nsdtm.getLength();
- setObject(nsdtm);
- }
-
- public XNodeSetForDOM(NodeIterator nodeIter, XPathContext xctxt)
- {
- m_dtmMgr = xctxt.getDTMManager();
- m_origObj = nodeIter;
-
- // JKESS 20020514: Longer-term solution is to force
- // folks to request length through an accessor, so we can defer this
- // retrieval... but that requires an API change.
- // m_obj = new com.sun.org.apache.xpath.internal.NodeSetDTM(nodeIter, xctxt);
- com.sun.org.apache.xpath.internal.NodeSetDTM nsdtm=new com.sun.org.apache.xpath.internal.NodeSetDTM(nodeIter, xctxt);
- m_last=nsdtm.getLength();
- setObject(nsdtm);
- }
-
- /**
- * Return the original DOM object that the user passed in. For use primarily
- * by the extension mechanism.
- *
- * @return The object that this class wraps
- */
- public Object object()
- {
- return m_origObj;
- }
-
- /**
- * Cast result object to a nodelist. Always issues an error.
- *
- * @return null
- *
- * @throws javax.xml.transform.TransformerException
- */
- public NodeIterator nodeset() throws javax.xml.transform.TransformerException
- {
- return (m_origObj instanceof NodeIterator)
- ? (NodeIterator)m_origObj : super.nodeset();
- }
-
- /**
- * Cast result object to a nodelist. Always issues an error.
- *
- * @return null
- *
- * @throws javax.xml.transform.TransformerException
- */
- public NodeList nodelist() throws javax.xml.transform.TransformerException
- {
- return (m_origObj instanceof NodeList)
- ? (NodeList)m_origObj : super.nodelist();
- }
-
-
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/objects/XNull.java b/src/com/sun/org/apache/xpath/internal/objects/XNull.java
deleted file mode 100644
index 3b91387..0000000
--- a/src/com/sun/org/apache/xpath/internal/objects/XNull.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XNull.java,v 1.2.4.1 2005/09/14 20:34:46 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.objects;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xpath.internal.XPathContext;
-
-/**
- * This class represents an XPath null object, and is capable of
- * converting the null to other types, such as a string.
- * @xsl.usage general
- */
-public class XNull extends XNodeSet
-{
- static final long serialVersionUID = -6841683711458983005L;
-
- /**
- * Create an XObject.
- */
- public XNull()
- {
- super();
- }
-
- /**
- * Tell what kind of class this is.
- *
- * @return type CLASS_NULL
- */
- public int getType()
- {
- return CLASS_NULL;
- }
-
- /**
- * Given a request type, return the equivalent string.
- * For diagnostic purposes.
- *
- * @return type string "#CLASS_NULL"
- */
- public String getTypeString()
- {
- return "#CLASS_NULL";
- }
-
- /**
- * Cast result object to a number.
- *
- * @return 0.0
- */
-
- public double num()
- {
- return 0.0;
- }
-
- /**
- * Cast result object to a boolean.
- *
- * @return false
- */
- public boolean bool()
- {
- return false;
- }
-
- /**
- * Cast result object to a string.
- *
- * @return empty string ""
- */
- public String str()
- {
- return "";
- }
-
- /**
- * Cast result object to a result tree fragment.
- *
- * @param support XPath context to use for the conversion
- *
- * @return The object as a result tree fragment.
- */
- public int rtf(XPathContext support)
- {
- // DTM frag = support.createDocumentFragment();
- // %REVIEW%
- return DTM.NULL;
- }
-
-// /**
-// * Cast result object to a nodelist.
-// *
-// * @return null
-// */
-// public DTMIterator iter()
-// {
-// return null;
-// }
-
- /**
- * Tell if two objects are functionally equal.
- *
- * @param obj2 Object to compare this to
- *
- * @return True if the given object is of type CLASS_NULL
- */
- public boolean equals(XObject obj2)
- {
- return obj2.getType() == CLASS_NULL;
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/objects/XNumber.java b/src/com/sun/org/apache/xpath/internal/objects/XNumber.java
deleted file mode 100644
index 5b6c6f2..0000000
--- a/src/com/sun/org/apache/xpath/internal/objects/XNumber.java
+++ /dev/null
@@ -1,439 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XNumber.java,v 1.2.4.2 2005/09/14 20:34:46 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.objects;
-
-import com.sun.org.apache.xpath.internal.ExpressionOwner;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.XPathVisitor;
-
-/**
- * This class represents an XPath number, and is capable of
- * converting the number to other types, such as a string.
- * @xsl.usage general
- */
-public class XNumber extends XObject
-{
- static final long serialVersionUID = -2720400709619020193L;
-
- /** Value of the XNumber object.
- * @serial */
- double m_val;
-
- /**
- * Construct a XNodeSet object.
- *
- * @param d Value of the object
- */
- public XNumber(double d)
- {
- super();
-
- m_val = d;
- }
-
- /**
- * Construct a XNodeSet object.
- *
- * @param num Value of the object
- */
- public XNumber(Number num)
- {
-
- super();
-
- m_val = num.doubleValue();
- setObject(num);
- }
-
- /**
- * Tell that this is a CLASS_NUMBER.
- *
- * @return node type CLASS_NUMBER
- */
- public int getType()
- {
- return CLASS_NUMBER;
- }
-
- /**
- * Given a request type, return the equivalent string.
- * For diagnostic purposes.
- *
- * @return type string "#NUMBER"
- */
- public String getTypeString()
- {
- return "#NUMBER";
- }
-
- /**
- * Cast result object to a number.
- *
- * @return the value of the XNumber object
- */
- public double num()
- {
- return m_val;
- }
-
- /**
- * Evaluate expression to a number.
- *
- * @return 0.0
- *
- * @throws javax.xml.transform.TransformerException
- */
- public double num(XPathContext xctxt)
- throws javax.xml.transform.TransformerException
- {
-
- return m_val;
- }
-
- /**
- * Cast result object to a boolean.
- *
- * @return false if the value is NaN or equal to 0.0
- */
- public boolean bool()
- {
- return (Double.isNaN(m_val) || (m_val == 0.0)) ? false : true;
- }
-
-// /**
-// * Cast result object to a string.
-// *
-// * @return "NaN" if the number is NaN, Infinity or -Infinity if
-// * the number is infinite or the string value of the number.
-// */
-// private static final int PRECISION = 16;
-// public String str()
-// {
-//
-// if (Double.isNaN(m_val))
-// {
-// return "NaN";
-// }
-// else if (Double.isInfinite(m_val))
-// {
-// if (m_val > 0)
-// return "Infinity";
-// else
-// return "-Infinity";
-// }
-//
-// long longVal = (long)m_val;
-// if ((double)longVal == m_val)
-// return Long.toString(longVal);
-//
-//
-// String s = Double.toString(m_val);
-// int len = s.length();
-//
-// if (s.charAt(len - 2) == '.' && s.charAt(len - 1) == '0')
-// {
-// return s.substring(0, len - 2);
-// }
-//
-// int exp = 0;
-// int e = s.indexOf('E');
-// if (e != -1)
-// {
-// exp = Integer.parseInt(s.substring(e + 1));
-// s = s.substring(0,e);
-// len = e;
-// }
-//
-// // Calculate Significant Digits:
-// // look from start of string for first digit
-// // look from end for last digit
-// // significant digits = end - start + (0 or 1 depending on decimal location)
-//
-// int decimalPos = -1;
-// int start = (s.charAt(0) == '-') ? 1 : 0;
-// findStart: for( ; start < len; start++ )
-// {
-// switch (s.charAt(start))
-// {
-// case '0':
-// break;
-// case '.':
-// decimalPos = start;
-// break;
-// default:
-// break findStart;
-// }
-// }
-// int end = s.length() - 1;
-// findEnd: for( ; end > start; end-- )
-// {
-// switch (s.charAt(end))
-// {
-// case '0':
-// break;
-// case '.':
-// decimalPos = end;
-// break;
-// default:
-// break findEnd;
-// }
-// }
-//
-// int sigDig = end - start;
-//
-// // clarify decimal location if it has not yet been found
-// if (decimalPos == -1)
-// decimalPos = s.indexOf('.');
-//
-// // if decimal is not between start and end, add one to sigDig
-// if (decimalPos < start || decimalPos > end)
-// ++sigDig;
-//
-// // reduce significant digits to PRECISION if necessary
-// if (sigDig > PRECISION)
-// {
-// // re-scale BigDecimal in order to get significant digits = PRECISION
-// BigDecimal num = new BigDecimal(s);
-// int newScale = num.scale() - (sigDig - PRECISION);
-// if (newScale < 0)
-// newScale = 0;
-// s = num.setScale(newScale, BigDecimal.ROUND_HALF_UP).toString();
-//
-// // remove trailing '0's; keep track of decimalPos
-// int truncatePoint = s.length();
-// while (s.charAt(--truncatePoint) == '0')
-// ;
-//
-// if (s.charAt(truncatePoint) == '.')
-// {
-// decimalPos = truncatePoint;
-// }
-// else
-// {
-// decimalPos = s.indexOf('.');
-// truncatePoint += 1;
-// }
-//
-// s = s.substring(0, truncatePoint);
-// len = s.length();
-// }
-//
-// // Account for exponent by adding zeros as needed
-// // and moving the decimal place
-//
-// if (exp == 0)
-// return s;
-//
-// start = 0;
-// String sign;
-// if (s.charAt(0) == '-')
-// {
-// sign = "-";
-// start++;
-// }
-// else
-// sign = "";
-//
-// String wholePart = s.substring(start, decimalPos);
-// String decimalPart = s.substring(decimalPos + 1);
-//
-// // get the number of digits right of the decimal
-// int decimalLen = decimalPart.length();
-//
-// if (exp >= decimalLen)
-// return sign + wholePart + decimalPart + zeros(exp - decimalLen);
-//
-// if (exp > 0)
-// return sign + wholePart + decimalPart.substring(0, exp) + "."
-// + decimalPart.substring(exp);
-//
-// return sign + "0." + zeros(-1 - exp) + wholePart + decimalPart;
-// }
-
- /**
- * Cast result object to a string.
- *
- * @return "NaN" if the number is NaN, Infinity or -Infinity if
- * the number is infinite or the string value of the number.
- */
- public String str()
- {
-
- if (Double.isNaN(m_val))
- {
- return "NaN";
- }
- else if (Double.isInfinite(m_val))
- {
- if (m_val > 0)
- return "Infinity";
- else
- return "-Infinity";
- }
-
- double num = m_val;
- String s = Double.toString(num);
- int len = s.length();
-
- if (s.charAt(len - 2) == '.' && s.charAt(len - 1) == '0')
- {
- s = s.substring(0, len - 2);
-
- if (s.equals("-0"))
- return "0";
-
- return s;
- }
-
- int e = s.indexOf('E');
-
- if (e < 0)
- {
- if (s.charAt(len - 1) == '0')
- return s.substring(0, len - 1);
- else
- return s;
- }
-
- int exp = Integer.parseInt(s.substring(e + 1));
- String sign;
-
- if (s.charAt(0) == '-')
- {
- sign = "-";
- s = s.substring(1);
-
- --e;
- }
- else
- sign = "";
-
- int nDigits = e - 2;
-
- if (exp >= nDigits)
- return sign + s.substring(0, 1) + s.substring(2, e)
- + zeros(exp - nDigits);
-
- // Eliminate trailing 0's - bugzilla 14241
- while (s.charAt(e-1) == '0')
- e--;
-
- if (exp > 0)
- return sign + s.substring(0, 1) + s.substring(2, 2 + exp) + "."
- + s.substring(2 + exp, e);
-
- return sign + "0." + zeros(-1 - exp) + s.substring(0, 1)
- + s.substring(2, e);
- }
-
-
- /**
- * Return a string of '0' of the given length
- *
- *
- * @param n Length of the string to be returned
- *
- * @return a string of '0' with the given length
- */
- static private String zeros(int n)
- {
- if (n < 1)
- return "";
-
- char[] buf = new char[n];
-
- for (int i = 0; i < n; i++)
- {
- buf[i] = '0';
- }
-
- return new String(buf);
- }
-
- /**
- * Return a java object that's closest to the representation
- * that should be handed to an extension.
- *
- * @return The value of this XNumber as a Double object
- */
- public Object object()
- {
- if(null == m_obj)
- setObject(new Double(m_val));
- return m_obj;
- }
-
- /**
- * Tell if two objects are functionally equal.
- *
- * @param obj2 Object to compare this to
- *
- * @return true if the two objects are equal
- *
- * @throws javax.xml.transform.TransformerException
- */
- public boolean equals(XObject obj2)
- {
-
- // In order to handle the 'all' semantics of
- // nodeset comparisons, we always call the
- // nodeset function.
- int t = obj2.getType();
- try
- {
- if (t == XObject.CLASS_NODESET)
- return obj2.equals(this);
- else if(t == XObject.CLASS_BOOLEAN)
- return obj2.bool() == bool();
- else
- return m_val == obj2.num();
- }
- catch(javax.xml.transform.TransformerException te)
- {
- throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(te);
- }
- }
-
- /**
- * Tell if this expression returns a stable number that will not change during
- * iterations within the expression. This is used to determine if a proximity
- * position predicate can indicate that no more searching has to occur.
- *
- *
- * @return true if the expression represents a stable number.
- */
- public boolean isStableNumber()
- {
- return true;
- }
-
- /**
- * @see com.sun.org.apache.xpath.internal.XPathVisitable#callVisitors(ExpressionOwner, XPathVisitor)
- */
- public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)
- {
- visitor.visitNumberLiteral(owner, this);
- }
-
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/objects/XObject.java b/src/com/sun/org/apache/xpath/internal/objects/XObject.java
deleted file mode 100644
index 80d2250..0000000
--- a/src/com/sun/org/apache/xpath/internal/objects/XObject.java
+++ /dev/null
@@ -1,761 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XObject.java,v 1.2.4.1 2005/09/14 20:34:45 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.objects;
-
-import java.io.Serializable;
-
-import com.sun.org.apache.xalan.internal.res.XSLMessages;
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMIterator;
-import com.sun.org.apache.xml.internal.utils.XMLString;
-import com.sun.org.apache.xpath.internal.Expression;
-import com.sun.org.apache.xpath.internal.ExpressionOwner;
-import com.sun.org.apache.xpath.internal.NodeSetDTM;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.XPathException;
-import com.sun.org.apache.xpath.internal.XPathVisitor;
-import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
-
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.traversal.NodeIterator;
-
-/**
- * This class represents an XPath object, and is capable of
- * converting the object to various types, such as a string.
- * This class acts as the base class to other XPath type objects,
- * such as XString, and provides polymorphic casting capabilities.
- * @xsl.usage general
- */
-public class XObject extends Expression implements Serializable, Cloneable
-{
- static final long serialVersionUID = -821887098985662951L;
-
- /**
- * The java object which this object wraps.
- * @serial
- */
- protected Object m_obj; // This may be NULL!!!
-
- /**
- * Create an XObject.
- */
- public XObject(){}
-
- /**
- * Create an XObject.
- *
- * @param obj Can be any object, should be a specific type
- * for derived classes, or null.
- */
- public XObject(Object obj)
- {
- setObject(obj);
- }
-
- protected void setObject(Object obj) {
- m_obj = obj;
- }
-
- /**
- * For support of literal objects in xpaths.
- *
- * @param xctxt The XPath execution context.
- *
- * @return This object.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt)
- throws javax.xml.transform.TransformerException
- {
- return this;
- }
-
- /**
- * Specify if it's OK for detach to release the iterator for reuse.
- * This function should be called with a value of false for objects that are
- * stored in variables.
- * Calling this with a value of false on a XNodeSet will cause the nodeset
- * to be cached.
- *
- * @param allowRelease true if it is OK for detach to release this iterator
- * for pooling.
- */
- public void allowDetachToRelease(boolean allowRelease){}
-
- /**
- * Detaches the <code>DTMIterator</code> from the set which it iterated
- * over, releasing any computational resources and placing the iterator
- * in the INVALID state. After <code>detach</code> has been invoked,
- * calls to <code>nextNode</code> or <code>previousNode</code> will
- * raise a runtime exception.
- */
- public void detach(){}
-
- /**
- * Forces the object to release it's resources. This is more harsh than
- * detach().
- */
- public void destruct()
- {
-
- if (null != m_obj)
- {
- allowDetachToRelease(true);
- detach();
-
- setObject(null);
- }
- }
-
- /**
- * Reset for fresh reuse.
- */
- public void reset()
- {
- }
-
- /**
- * Directly call the
- * characters method on the passed ContentHandler for the
- * string-value. Multiple calls to the
- * ContentHandler's characters methods may well occur for a single call to
- * this method.
- *
- * @param ch A non-null reference to a ContentHandler.
- *
- * @throws org.xml.sax.SAXException
- */
- public void dispatchCharactersEvents(org.xml.sax.ContentHandler ch)
- throws org.xml.sax.SAXException
- {
- xstr().dispatchCharactersEvents(ch);
- }
-
- /**
- * Create the right XObject based on the type of the object passed. This
- * function can not make an XObject that exposes DOM Nodes, NodeLists, and
- * NodeIterators to the XSLT stylesheet as node-sets.
- *
- * @param val The java object which this object will wrap.
- *
- * @return the right XObject based on the type of the object passed.
- */
- static public XObject create(Object val)
- {
- return XObjectFactory.create(val);
- }
-
- /**
- * Create the right XObject based on the type of the object passed.
- * This function <emph>can</emph> make an XObject that exposes DOM Nodes, NodeLists, and
- * NodeIterators to the XSLT stylesheet as node-sets.
- *
- * @param val The java object which this object will wrap.
- * @param xctxt The XPath context.
- *
- * @return the right XObject based on the type of the object passed.
- */
- static public XObject create(Object val, XPathContext xctxt)
- {
- return XObjectFactory.create(val, xctxt);
- }
-
- /** Constant for NULL object type */
- public static final int CLASS_NULL = -1;
-
- /** Constant for UNKNOWN object type */
- public static final int CLASS_UNKNOWN = 0;
-
- /** Constant for BOOLEAN object type */
- public static final int CLASS_BOOLEAN = 1;
-
- /** Constant for NUMBER object type */
- public static final int CLASS_NUMBER = 2;
-
- /** Constant for STRING object type */
- public static final int CLASS_STRING = 3;
-
- /** Constant for NODESET object type */
- public static final int CLASS_NODESET = 4;
-
- /** Constant for RESULT TREE FRAGMENT object type */
- public static final int CLASS_RTREEFRAG = 5;
-
- /** Represents an unresolved variable type as an integer. */
- public static final int CLASS_UNRESOLVEDVARIABLE = 600;
-
- /**
- * Tell what kind of class this is.
- *
- * @return CLASS_UNKNOWN
- */
- public int getType()
- {
- return CLASS_UNKNOWN;
- }
-
- /**
- * Given a request type, return the equivalent string.
- * For diagnostic purposes.
- *
- * @return type string "#UNKNOWN" + object class name
- */
- public String getTypeString()
- {
- return "#UNKNOWN (" + object().getClass().getName() + ")";
- }
-
- /**
- * Cast result object to a number. Always issues an error.
- *
- * @return 0.0
- *
- * @throws javax.xml.transform.TransformerException
- */
- public double num() throws javax.xml.transform.TransformerException
- {
-
- error(XPATHErrorResources.ER_CANT_CONVERT_TO_NUMBER,
- new Object[]{ getTypeString() }); //"Can not convert "+getTypeString()+" to a number");
-
- return 0.0;
- }
-
- /**
- * Cast result object to a number, but allow side effects, such as the
- * incrementing of an iterator.
- *
- * @return numeric value of the string conversion from the
- * next node in the NodeSetDTM, or NAN if no node was found
- */
- public double numWithSideEffects() throws javax.xml.transform.TransformerException
- {
- return num();
- }
-
- /**
- * Cast result object to a boolean. Always issues an error.
- *
- * @return false
- *
- * @throws javax.xml.transform.TransformerException
- */
- public boolean bool() throws javax.xml.transform.TransformerException
- {
-
- error(XPATHErrorResources.ER_CANT_CONVERT_TO_NUMBER,
- new Object[]{ getTypeString() }); //"Can not convert "+getTypeString()+" to a number");
-
- return false;
- }
-
- /**
- * Cast result object to a boolean, but allow side effects, such as the
- * incrementing of an iterator.
- *
- * @return True if there is a next node in the nodeset
- */
- public boolean boolWithSideEffects() throws javax.xml.transform.TransformerException
- {
- return bool();
- }
-
-
- /**
- * Cast result object to a string.
- *
- * @return The string this wraps or the empty string if null
- */
- public XMLString xstr()
- {
- return XMLStringFactoryImpl.getFactory().newstr(str());
- }
-
- /**
- * Cast result object to a string.
- *
- * @return The object as a string
- */
- public String str()
- {
- return (m_obj != null) ? m_obj.toString() : "";
- }
-
- /**
- * Return the string representation of the object
- *
- *
- * @return the string representation of the object
- */
- public String toString()
- {
- return str();
- }
-
- /**
- * Cast result object to a result tree fragment.
- *
- * @param support XPath context to use for the conversion
- *
- * @return the objec as a result tree fragment.
- */
- public int rtf(XPathContext support)
- {
-
- int result = rtf();
-
- if (DTM.NULL == result)
- {
- DTM frag = support.createDocumentFragment();
-
- // %OPT%
- frag.appendTextChild(str());
-
- result = frag.getDocument();
- }
-
- return result;
- }
-
- /**
- * Cast result object to a result tree fragment.
- *
- * @param support XPath context to use for the conversion
- *
- * @return the objec as a result tree fragment.
- */
- public DocumentFragment rtree(XPathContext support)
- {
- DocumentFragment docFrag = null;
- int result = rtf();
-
- if (DTM.NULL == result)
- {
- DTM frag = support.createDocumentFragment();
-
- // %OPT%
- frag.appendTextChild(str());
-
- docFrag = (DocumentFragment)frag.getNode(frag.getDocument());
- }
- else
- {
- DTM frag = support.getDTM(result);
- docFrag = (DocumentFragment)frag.getNode(frag.getDocument());
- }
-
- return docFrag;
- }
-
-
- /**
- * For functions to override.
- *
- * @return null
- */
- public DocumentFragment rtree()
- {
- return null;
- }
-
- /**
- * For functions to override.
- *
- * @return null
- */
- public int rtf()
- {
- return DTM.NULL;
- }
-
- /**
- * Return a java object that's closest to the representation
- * that should be handed to an extension.
- *
- * @return The object that this class wraps
- */
- public Object object()
- {
- return m_obj;
- }
-
- /**
- * Cast result object to a nodelist. Always issues an error.
- *
- * @return null
- *
- * @throws javax.xml.transform.TransformerException
- */
- public DTMIterator iter() throws javax.xml.transform.TransformerException
- {
-
- error(XPATHErrorResources.ER_CANT_CONVERT_TO_NODELIST,
- new Object[]{ getTypeString() }); //"Can not convert "+getTypeString()+" to a NodeList!");
-
- return null;
- }
-
- /**
- * Get a fresh copy of the object. For use with variables.
- *
- * @return This object, unless overridden by subclass.
- */
- public XObject getFresh()
- {
- return this;
- }
-
-
- /**
- * Cast result object to a nodelist. Always issues an error.
- *
- * @return null
- *
- * @throws javax.xml.transform.TransformerException
- */
- public NodeIterator nodeset() throws javax.xml.transform.TransformerException
- {
-
- error(XPATHErrorResources.ER_CANT_CONVERT_TO_NODELIST,
- new Object[]{ getTypeString() }); //"Can not convert "+getTypeString()+" to a NodeList!");
-
- return null;
- }
-
- /**
- * Cast result object to a nodelist. Always issues an error.
- *
- * @return null
- *
- * @throws javax.xml.transform.TransformerException
- */
- public NodeList nodelist() throws javax.xml.transform.TransformerException
- {
-
- error(XPATHErrorResources.ER_CANT_CONVERT_TO_NODELIST,
- new Object[]{ getTypeString() }); //"Can not convert "+getTypeString()+" to a NodeList!");
-
- return null;
- }
-
-
- /**
- * Cast result object to a nodelist. Always issues an error.
- *
- * @return The object as a NodeSetDTM.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public NodeSetDTM mutableNodeset()
- throws javax.xml.transform.TransformerException
- {
-
- error(XPATHErrorResources.ER_CANT_CONVERT_TO_MUTABLENODELIST,
- new Object[]{ getTypeString() }); //"Can not convert "+getTypeString()+" to a NodeSetDTM!");
-
- return (NodeSetDTM) m_obj;
- }
-
- /**
- * Cast object to type t.
- *
- * @param t Type of object to cast this to
- * @param support XPath context to use for the conversion
- *
- * @return This object as the given type t
- *
- * @throws javax.xml.transform.TransformerException
- */
- public Object castToType(int t, XPathContext support)
- throws javax.xml.transform.TransformerException
- {
-
- Object result;
-
- switch (t)
- {
- case CLASS_STRING :
- result = str();
- break;
- case CLASS_NUMBER :
- result = new Double(num());
- break;
- case CLASS_NODESET :
- result = iter();
- break;
- case CLASS_BOOLEAN :
- result = new Boolean(bool());
- break;
- case CLASS_UNKNOWN :
- result = m_obj;
- break;
-
- // %TBD% What to do here?
- // case CLASS_RTREEFRAG :
- // result = rtree(support);
- // break;
- default :
- error(XPATHErrorResources.ER_CANT_CONVERT_TO_TYPE,
- new Object[]{ getTypeString(),
- Integer.toString(t) }); //"Can not convert "+getTypeString()+" to a type#"+t);
-
- result = null;
- }
-
- return result;
- }
-
- /**
- * Tell if one object is less than the other.
- *
- * @param obj2 Object to compare this to
- *
- * @return True if this object is less than the given object
- *
- * @throws javax.xml.transform.TransformerException
- */
- public boolean lessThan(XObject obj2)
- throws javax.xml.transform.TransformerException
- {
-
- // In order to handle the 'all' semantics of
- // nodeset comparisons, we always call the
- // nodeset function. Because the arguments
- // are backwards, we call the opposite comparison
- // function.
- if (obj2.getType() == XObject.CLASS_NODESET)
- return obj2.greaterThan(this);
-
- return this.num() < obj2.num();
- }
-
- /**
- * Tell if one object is less than or equal to the other.
- *
- * @param obj2 Object to compare this to
- *
- * @return True if this object is less than or equal to the given object
- *
- * @throws javax.xml.transform.TransformerException
- */
- public boolean lessThanOrEqual(XObject obj2)
- throws javax.xml.transform.TransformerException
- {
-
- // In order to handle the 'all' semantics of
- // nodeset comparisons, we always call the
- // nodeset function. Because the arguments
- // are backwards, we call the opposite comparison
- // function.
- if (obj2.getType() == XObject.CLASS_NODESET)
- return obj2.greaterThanOrEqual(this);
-
- return this.num() <= obj2.num();
- }
-
- /**
- * Tell if one object is greater than the other.
- *
- * @param obj2 Object to compare this to
- *
- * @return True if this object is greater than the given object
- *
- * @throws javax.xml.transform.TransformerException
- */
- public boolean greaterThan(XObject obj2)
- throws javax.xml.transform.TransformerException
- {
-
- // In order to handle the 'all' semantics of
- // nodeset comparisons, we always call the
- // nodeset function. Because the arguments
- // are backwards, we call the opposite comparison
- // function.
- if (obj2.getType() == XObject.CLASS_NODESET)
- return obj2.lessThan(this);
-
- return this.num() > obj2.num();
- }
-
- /**
- * Tell if one object is greater than or equal to the other.
- *
- * @param obj2 Object to compare this to
- *
- * @return True if this object is greater than or equal to the given object
- *
- * @throws javax.xml.transform.TransformerException
- */
- public boolean greaterThanOrEqual(XObject obj2)
- throws javax.xml.transform.TransformerException
- {
-
- // In order to handle the 'all' semantics of
- // nodeset comparisons, we always call the
- // nodeset function. Because the arguments
- // are backwards, we call the opposite comparison
- // function.
- if (obj2.getType() == XObject.CLASS_NODESET)
- return obj2.lessThanOrEqual(this);
-
- return this.num() >= obj2.num();
- }
-
- /**
- * Tell if two objects are functionally equal.
- *
- * @param obj2 Object to compare this to
- *
- * @return True if this object is equal to the given object
- *
- * @throws javax.xml.transform.TransformerException
- */
- public boolean equals(XObject obj2)
- {
-
- // In order to handle the 'all' semantics of
- // nodeset comparisons, we always call the
- // nodeset function.
- if (obj2.getType() == XObject.CLASS_NODESET)
- return obj2.equals(this);
-
- if (null != m_obj)
- {
- return m_obj.equals(obj2.m_obj);
- }
- else
- {
- return obj2.m_obj == null;
- }
- }
-
- /**
- * Tell if two objects are functionally not equal.
- *
- * @param obj2 Object to compare this to
- *
- * @return True if this object is not equal to the given object
- *
- * @throws javax.xml.transform.TransformerException
- */
- public boolean notEquals(XObject obj2)
- throws javax.xml.transform.TransformerException
- {
-
- // In order to handle the 'all' semantics of
- // nodeset comparisons, we always call the
- // nodeset function.
- if (obj2.getType() == XObject.CLASS_NODESET)
- return obj2.notEquals(this);
-
- return !equals(obj2);
- }
-
- /**
- * Tell the user of an error, and probably throw an
- * exception.
- *
- * @param msg Error message to issue
- *
- * @throws javax.xml.transform.TransformerException
- */
- protected void error(String msg)
- throws javax.xml.transform.TransformerException
- {
- error(msg, null);
- }
-
- /**
- * Tell the user of an error, and probably throw an
- * exception.
- *
- * @param msg Error message to issue
- * @param args Arguments to use in the message
- *
- * @throws javax.xml.transform.TransformerException
- */
- protected void error(String msg, Object[] args)
- throws javax.xml.transform.TransformerException
- {
-
- String fmsg = XSLMessages.createXPATHMessage(msg, args);
-
- // boolean shouldThrow = support.problem(m_support.XPATHPROCESSOR,
- // m_support.ERROR,
- // null,
- // null, fmsg, 0, 0);
- // if(shouldThrow)
- {
- throw new XPathException(fmsg, this);
- }
- }
-
-
- /**
- * XObjects should not normally need to fix up variables.
- */
- public void fixupVariables(java.util.Vector vars, int globalsSize)
- {
- // no-op
- }
-
-
- /**
- * Cast result object to a string.
- *
- *
- * NEEDSDOC @param fsb
- * @return The string this wraps or the empty string if null
- */
- public void appendToFsb(com.sun.org.apache.xml.internal.utils.FastStringBuffer fsb)
- {
- fsb.append(str());
- }
-
- /**
- * @see com.sun.org.apache.xpath.internal.XPathVisitable#callVisitors(ExpressionOwner, XPathVisitor)
- */
- public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)
- {
- assertion(false, "callVisitors should not be called for this object!!!");
- }
- /**
- * @see Expression#deepEquals(Expression)
- */
- public boolean deepEquals(Expression expr)
- {
- if(!isSameClass(expr))
- return false;
-
- // If equals at the expression level calls deepEquals, I think we're
- // still safe from infinite recursion since this object overrides
- // equals. I hope.
- if(!this.equals((XObject)expr))
- return false;
-
- return true;
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/objects/XObjectFactory.java b/src/com/sun/org/apache/xpath/internal/objects/XObjectFactory.java
deleted file mode 100644
index bfd8303..0000000
--- a/src/com/sun/org/apache/xpath/internal/objects/XObjectFactory.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XObjectFactory.java,v 1.1.2.1 2005/08/01 01:29:30 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.objects;
-
-import com.sun.org.apache.xml.internal.dtm.Axis;
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
-import com.sun.org.apache.xml.internal.dtm.DTMIterator;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.axes.OneStepIterator;
-
-
-public class XObjectFactory
-{
-
- /**
- * Create the right XObject based on the type of the object passed. This
- * function can not make an XObject that exposes DOM Nodes, NodeLists, and
- * NodeIterators to the XSLT stylesheet as node-sets.
- *
- * @param val The java object which this object will wrap.
- *
- * @return the right XObject based on the type of the object passed.
- */
- static public XObject create(Object val)
- {
-
- XObject result;
-
- if (val instanceof XObject)
- {
- result = (XObject) val;
- }
- else if (val instanceof String)
- {
- result = new XString((String) val);
- }
- else if (val instanceof Boolean)
- {
- result = new XBoolean((Boolean)val);
- }
- else if (val instanceof Double)
- {
- result = new XNumber(((Double) val));
- }
- else
- {
- result = new XObject(val);
- }
-
- return result;
- }
-
- /**
- * Create the right XObject based on the type of the object passed.
- * This function <emph>can</emph> make an XObject that exposes DOM Nodes, NodeLists, and
- * NodeIterators to the XSLT stylesheet as node-sets.
- *
- * @param val The java object which this object will wrap.
- * @param xctxt The XPath context.
- *
- * @return the right XObject based on the type of the object passed.
- */
- static public XObject create(Object val, XPathContext xctxt)
- {
-
- XObject result;
-
- if (val instanceof XObject)
- {
- result = (XObject) val;
- }
- else if (val instanceof String)
- {
- result = new XString((String) val);
- }
- else if (val instanceof Boolean)
- {
- result = new XBoolean((Boolean)val);
- }
- else if (val instanceof Number)
- {
- result = new XNumber(((Number) val));
- }
- else if (val instanceof DTM)
- {
- DTM dtm = (DTM)val;
- try
- {
- int dtmRoot = dtm.getDocument();
- DTMAxisIterator iter = dtm.getAxisIterator(Axis.SELF);
- iter.setStartNode(dtmRoot);
- DTMIterator iterator = new OneStepIterator(iter, Axis.SELF);
- iterator.setRoot(dtmRoot, xctxt);
- result = new XNodeSet(iterator);
- }
- catch(Exception ex)
- {
- throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(ex);
- }
- }
- else if (val instanceof DTMAxisIterator)
- {
- DTMAxisIterator iter = (DTMAxisIterator)val;
- try
- {
- DTMIterator iterator = new OneStepIterator(iter, Axis.SELF);
- iterator.setRoot(iter.getStartNode(), xctxt);
- result = new XNodeSet(iterator);
- }
- catch(Exception ex)
- {
- throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(ex);
- }
- }
- else if (val instanceof DTMIterator)
- {
- result = new XNodeSet((DTMIterator) val);
- }
- // This next three instanceofs are a little worrysome, since a NodeList
- // might also implement a Node!
- else if (val instanceof org.w3c.dom.Node)
- {
- result = new XNodeSetForDOM((org.w3c.dom.Node)val, xctxt);
- }
- // This must come after org.w3c.dom.Node, since many Node implementations
- // also implement NodeList.
- else if (val instanceof org.w3c.dom.NodeList)
- {
- result = new XNodeSetForDOM((org.w3c.dom.NodeList)val, xctxt);
- }
- else if (val instanceof org.w3c.dom.traversal.NodeIterator)
- {
- result = new XNodeSetForDOM((org.w3c.dom.traversal.NodeIterator)val, xctxt);
- }
- else
- {
- result = new XObject(val);
- }
-
- return result;
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/objects/XRTreeFrag.java b/src/com/sun/org/apache/xpath/internal/objects/XRTreeFrag.java
deleted file mode 100644
index af776fc..0000000
--- a/src/com/sun/org/apache/xpath/internal/objects/XRTreeFrag.java
+++ /dev/null
@@ -1,303 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XRTreeFrag.java,v 1.2.4.1 2005/09/14 20:44:48 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.objects;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMIterator;
-import com.sun.org.apache.xml.internal.utils.XMLString;
-import com.sun.org.apache.xpath.internal.Expression;
-import com.sun.org.apache.xpath.internal.ExpressionNode;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.axes.RTFIterator;
-
-import org.w3c.dom.NodeList;
-
-/**
- * This class represents an XPath result tree fragment object, and is capable of
- * converting the RTF to other types, such as a string.
- * @xsl.usage general
- */
-public class XRTreeFrag extends XObject implements Cloneable
-{
- static final long serialVersionUID = -3201553822254911567L;
- private DTMXRTreeFrag m_DTMXRTreeFrag;
- private int m_dtmRoot = DTM.NULL;
- protected boolean m_allowRelease = false;
-
-
- /**
- * Create an XRTreeFrag Object.
- *
- */
- public XRTreeFrag(int root, XPathContext xctxt, ExpressionNode parent)
- {
- super(null);
- exprSetParent(parent);
- initDTM(root, xctxt);
- }
-
- /**
- * Create an XRTreeFrag Object.
- *
- */
- public XRTreeFrag(int root, XPathContext xctxt)
- {
- super(null);
- initDTM(root, xctxt);
- }
-
- private final void initDTM(int root, XPathContext xctxt){
- m_dtmRoot = root;
- final DTM dtm = xctxt.getDTM(root);
- if(dtm != null){
- m_DTMXRTreeFrag = xctxt.getDTMXRTreeFrag(xctxt.getDTMIdentity(dtm));
- }
- }
-
- /**
- * Return a java object that's closest to the representation
- * that should be handed to an extension.
- *
- * @return The object that this class wraps
- */
- public Object object()
- {
- if (m_DTMXRTreeFrag.getXPathContext() != null)
- return new com.sun.org.apache.xml.internal.dtm.ref.DTMNodeIterator((DTMIterator)(new com.sun.org.apache.xpath.internal.NodeSetDTM(m_dtmRoot, m_DTMXRTreeFrag.getXPathContext().getDTMManager())));
- else
- return super.object();
- }
-
- /**
- * Create an XRTreeFrag Object.
- *
- */
- public XRTreeFrag(Expression expr)
- {
- super(expr);
- }
-
- /**
- * Specify if it's OK for detach to release the iterator for reuse.
- *
- * @param allowRelease true if it is OK for detach to release this iterator
- * for pooling.
- */
- public void allowDetachToRelease(boolean allowRelease)
- {
- m_allowRelease = allowRelease;
- }
-
- /**
- * Detaches the <code>DTMIterator</code> from the set which it iterated
- * over, releasing any computational resources and placing the iterator
- * in the INVALID state. After <code>detach</code> has been invoked,
- * calls to <code>nextNode</code> or <code>previousNode</code> will
- * raise a runtime exception.
- *
- * In general, detach should only be called once on the object.
- */
- public void detach(){
- if(m_allowRelease){
- m_DTMXRTreeFrag.destruct();
- setObject(null);
- }
- }
-
- /**
- * Tell what kind of class this is.
- *
- * @return type CLASS_RTREEFRAG
- */
- public int getType()
- {
- return CLASS_RTREEFRAG;
- }
-
- /**
- * Given a request type, return the equivalent string.
- * For diagnostic purposes.
- *
- * @return type string "#RTREEFRAG"
- */
- public String getTypeString()
- {
- return "#RTREEFRAG";
- }
-
- /**
- * Cast result object to a number.
- *
- * @return The result tree fragment as a number or NaN
- */
- public double num()
- throws javax.xml.transform.TransformerException
- {
-
- XMLString s = xstr();
-
- return s.toDouble();
- }
-
- /**
- * Cast result object to a boolean. This always returns true for a RTreeFrag
- * because it is treated like a node-set with a single root node.
- *
- * @return true
- */
- public boolean bool()
- {
- return true;
- }
-
- private XMLString m_xmlStr = null;
-
- /**
- * Cast result object to an XMLString.
- *
- * @return The document fragment node data or the empty string.
- */
- public XMLString xstr()
- {
- if(null == m_xmlStr)
- m_xmlStr = m_DTMXRTreeFrag.getDTM().getStringValue(m_dtmRoot);
-
- return m_xmlStr;
- }
-
- /**
- * Cast result object to a string.
- *
- * @return The string this wraps or the empty string if null
- */
- public void appendToFsb(com.sun.org.apache.xml.internal.utils.FastStringBuffer fsb)
- {
- XString xstring = (XString)xstr();
- xstring.appendToFsb(fsb);
- }
-
-
- /**
- * Cast result object to a string.
- *
- * @return The document fragment node data or the empty string.
- */
- public String str()
- {
- String str = m_DTMXRTreeFrag.getDTM().getStringValue(m_dtmRoot).toString();
-
- return (null == str) ? "" : str;
- }
-
- /**
- * Cast result object to a result tree fragment.
- *
- * @return The document fragment this wraps
- */
- public int rtf()
- {
- return m_dtmRoot;
- }
-
- /**
- * Cast result object to a DTMIterator.
- * dml - modified to return an RTFIterator for
- * benefit of EXSLT object-type function in
- * {@link com.sun.org.apache.xalan.internal.lib.ExsltCommon}.
- * @return The document fragment as a DTMIterator
- */
- public DTMIterator asNodeIterator()
- {
- return new RTFIterator(m_dtmRoot, m_DTMXRTreeFrag.getXPathContext().getDTMManager());
- }
-
- /**
- * Cast result object to a nodelist. (special function).
- *
- * @return The document fragment as a nodelist
- */
- public NodeList convertToNodeset()
- {
-
- if (m_obj instanceof NodeList)
- return (NodeList) m_obj;
- else
- return new com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList(asNodeIterator());
- }
-
- /**
- * Tell if two objects are functionally equal.
- *
- * @param obj2 Object to compare this to
- *
- * @return True if the two objects are equal
- *
- * @throws javax.xml.transform.TransformerException
- */
- public boolean equals(XObject obj2)
- {
-
- try
- {
- if (XObject.CLASS_NODESET == obj2.getType())
- {
-
- // In order to handle the 'all' semantics of
- // nodeset comparisons, we always call the
- // nodeset function.
- return obj2.equals(this);
- }
- else if (XObject.CLASS_BOOLEAN == obj2.getType())
- {
- return bool() == obj2.bool();
- }
- else if (XObject.CLASS_NUMBER == obj2.getType())
- {
- return num() == obj2.num();
- }
- else if (XObject.CLASS_NODESET == obj2.getType())
- {
- return xstr().equals(obj2.xstr());
- }
- else if (XObject.CLASS_STRING == obj2.getType())
- {
- return xstr().equals(obj2.xstr());
- }
- else if (XObject.CLASS_RTREEFRAG == obj2.getType())
- {
-
- // Probably not so good. Think about this.
- return xstr().equals(obj2.xstr());
- }
- else
- {
- return super.equals(obj2);
- }
- }
- catch(javax.xml.transform.TransformerException te)
- {
- throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(te);
- }
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/objects/XRTreeFragSelectWrapper.java b/src/com/sun/org/apache/xpath/internal/objects/XRTreeFragSelectWrapper.java
deleted file mode 100644
index e618f75..0000000
--- a/src/com/sun/org/apache/xpath/internal/objects/XRTreeFragSelectWrapper.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XRTreeFragSelectWrapper.java,v 1.2.4.1 2005/09/15 02:02:35 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.objects;
-
-import com.sun.org.apache.xalan.internal.res.XSLMessages;
-import com.sun.org.apache.xml.internal.dtm.DTMIterator;
-import com.sun.org.apache.xml.internal.utils.XMLString;
-import com.sun.org.apache.xpath.internal.Expression;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
-
-/**
- * This class makes an select statement act like an result tree fragment.
- */
-public class XRTreeFragSelectWrapper extends XRTreeFrag implements Cloneable
-{
- static final long serialVersionUID = -6526177905590461251L;
- public XRTreeFragSelectWrapper(Expression expr)
- {
- super(expr);
- }
-
- /**
- * This function is used to fixup variables from QNames to stack frame
- * indexes at stylesheet build time.
- * @param vars List of QNames that correspond to variables. This list
- * should be searched backwards for the first qualified name that
- * corresponds to the variable reference qname. The position of the
- * QName in the vector from the start of the vector will be its position
- * in the stack frame (but variables above the globalsTop value will need
- * to be offset to the current stack frame).
- */
- public void fixupVariables(java.util.Vector vars, int globalsSize)
- {
- ((Expression)m_obj).fixupVariables(vars, globalsSize);
- }
-
- /**
- * For support of literal objects in xpaths.
- *
- * @param xctxt The XPath execution context.
- *
- * @return the result of executing the select expression
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt)
- throws javax.xml.transform.TransformerException
- {
- XObject m_selected;
- m_selected = ((Expression)m_obj).execute(xctxt);
- m_selected.allowDetachToRelease(m_allowRelease);
- if (m_selected.getType() == CLASS_STRING)
- return m_selected;
- else
- return new XString(m_selected.str());
- }
-
- /**
- * Detaches the <code>DTMIterator</code> from the set which it iterated
- * over, releasing any computational resources and placing the iterator
- * in the INVALID state. After <code>detach</code> has been invoked,
- * calls to <code>nextNode</code> or <code>previousNode</code> will
- * raise a runtime exception.
- *
- * In general, detach should only be called once on the object.
- */
- public void detach()
- {
- throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_DETACH_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER, null)); //"detach() not supported by XRTreeFragSelectWrapper!");
- }
-
- /**
- * Cast result object to a number.
- *
- * @return The result tree fragment as a number or NaN
- */
- public double num()
- throws javax.xml.transform.TransformerException
- {
-
- throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NUM_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER, null)); //"num() not supported by XRTreeFragSelectWrapper!");
- }
-
-
- /**
- * Cast result object to an XMLString.
- *
- * @return The document fragment node data or the empty string.
- */
- public XMLString xstr()
- {
- throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_XSTR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER, null)); //"xstr() not supported by XRTreeFragSelectWrapper!");
- }
-
- /**
- * Cast result object to a string.
- *
- * @return The document fragment node data or the empty string.
- */
- public String str()
- {
- throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_STR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER, null)); //"str() not supported by XRTreeFragSelectWrapper!");
- }
-
- /**
- * Tell what kind of class this is.
- *
- * @return the string type
- */
- public int getType()
- {
- return CLASS_STRING;
- }
-
- /**
- * Cast result object to a result tree fragment.
- *
- * @return The document fragment this wraps
- */
- public int rtf()
- {
- throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER, null)); //"rtf() not supported by XRTreeFragSelectWrapper!");
- }
-
- /**
- * Cast result object to a DTMIterator.
- *
- * @return The document fragment as a DTMIterator
- */
- public DTMIterator asNodeIterator()
- {
- throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER, null)); //"asNodeIterator() not supported by XRTreeFragSelectWrapper!");
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/objects/XString.java b/src/com/sun/org/apache/xpath/internal/objects/XString.java
deleted file mode 100644
index 0ff2b55..0000000
--- a/src/com/sun/org/apache/xpath/internal/objects/XString.java
+++ /dev/null
@@ -1,1124 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XString.java,v 1.2.4.1 2005/09/14 20:47:20 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.objects;
-
-import java.util.Locale;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.utils.XMLCharacterRecognizer;
-import com.sun.org.apache.xml.internal.utils.XMLString;
-import com.sun.org.apache.xml.internal.utils.XMLStringFactory;
-import com.sun.org.apache.xpath.internal.ExpressionOwner;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.XPathVisitor;
-
-/**
- * This class represents an XPath string object, and is capable of
- * converting the string to other types, such as a number.
- * @xsl.usage general
- */
-public class XString extends XObject implements XMLString
-{
- static final long serialVersionUID = 2020470518395094525L;
-
- /** Empty string XString object */
- public static final XString EMPTYSTRING = new XString("");
-
- /**
- * Construct a XString object. This constructor exists for derived classes.
- *
- * @param val String object this will wrap.
- */
- protected XString(Object val)
- {
- super(val);
- }
-
- /**
- * Construct a XNodeSet object.
- *
- * @param val String object this will wrap.
- */
- public XString(String val)
- {
- super(val);
- }
-
- /**
- * Tell that this is a CLASS_STRING.
- *
- * @return type CLASS_STRING
- */
- public int getType()
- {
- return CLASS_STRING;
- }
-
- /**
- * Given a request type, return the equivalent string.
- * For diagnostic purposes.
- *
- * @return type string "#STRING"
- */
- public String getTypeString()
- {
- return "#STRING";
- }
-
- /**
- * Tell if this object contains a java String object.
- *
- * @return true if this XMLString can return a string without creating one.
- */
- public boolean hasString()
- {
- return true;
- }
-
- /**
- * Cast result object to a number.
- *
- * @return 0.0 if this string is null, numeric value of this string
- * or NaN
- */
- public double num()
- {
- return toDouble();
- }
-
- /**
- * Convert a string to a double -- Allowed input is in fixed
- * notation ddd.fff.
- *
- * @return A double value representation of the string, or return Double.NaN
- * if the string can not be converted.
- */
- public double toDouble()
- {
- /* XMLCharacterRecognizer.isWhiteSpace(char c) methods treats the following
- * characters as white space characters.
- * ht - horizontal tab, nl - newline , cr - carriage return and sp - space
- * trim() methods by default also takes care of these white space characters
- * So trim() method is used to remove leading and trailing white spaces.
- */
- XMLString s = trim();
- double result = Double.NaN;
- for (int i = 0; i < s.length(); i++)
- {
- char c = s.charAt(i);
- if (c != '-' && c != '.' && ( c < 0X30 || c > 0x39)) {
- // The character is not a '-' or a '.' or a digit
- // then return NaN because something is wrong.
- return result;
- }
- }
- try
- {
- result = Double.parseDouble(s.toString());
- } catch (NumberFormatException e){}
-
- return result;
-}
-
- /**
- * Cast result object to a boolean.
- *
- * @return True if the length of this string object is greater
- * than 0.
- */
- public boolean bool()
- {
- return str().length() > 0;
- }
-
- /**
- * Cast result object to a string.
- *
- * @return The string this wraps or the empty string if null
- */
- public XMLString xstr()
- {
- return this;
- }
-
- /**
- * Cast result object to a string.
- *
- * @return The string this wraps or the empty string if null
- */
- public String str()
- {
- return (null != m_obj) ? ((String) m_obj) : "";
- }
-
- /**
- * Cast result object to a result tree fragment.
- *
- * @param support Xpath context to use for the conversion
- *
- * @return A document fragment with this string as a child node
- */
- public int rtf(XPathContext support)
- {
-
- DTM frag = support.createDocumentFragment();
-
- frag.appendTextChild(str());
-
- return frag.getDocument();
- }
-
- /**
- * Directly call the
- * characters method on the passed ContentHandler for the
- * string-value. Multiple calls to the
- * ContentHandler's characters methods may well occur for a single call to
- * this method.
- *
- * @param ch A non-null reference to a ContentHandler.
- *
- * @throws org.xml.sax.SAXException
- */
- public void dispatchCharactersEvents(org.xml.sax.ContentHandler ch)
- throws org.xml.sax.SAXException
- {
-
- String str = str();
-
- ch.characters(str.toCharArray(), 0, str.length());
- }
-
- /**
- * Directly call the
- * comment method on the passed LexicalHandler for the
- * string-value.
- *
- * @param lh A non-null reference to a LexicalHandler.
- *
- * @throws org.xml.sax.SAXException
- */
- public void dispatchAsComment(org.xml.sax.ext.LexicalHandler lh)
- throws org.xml.sax.SAXException
- {
-
- String str = str();
-
- lh.comment(str.toCharArray(), 0, str.length());
- }
-
- /**
- * Returns the length of this string.
- *
- * @return the length of the sequence of characters represented by this
- * object.
- */
- public int length()
- {
- return str().length();
- }
-
- /**
- * Returns the character at the specified index. An index ranges
- * from <code>0</code> to <code>length() - 1</code>. The first character
- * of the sequence is at index <code>0</code>, the next at index
- * <code>1</code>, and so on, as for array indexing.
- *
- * @param index the index of the character.
- * @return the character at the specified index of this string.
- * The first character is at index <code>0</code>.
- * @exception IndexOutOfBoundsException if the <code>index</code>
- * argument is negative or not less than the length of this
- * string.
- */
- public char charAt(int index)
- {
- return str().charAt(index);
- }
-
- /**
- * Copies characters from this string into the destination character
- * array.
- *
- * @param srcBegin index of the first character in the string
- * to copy.
- * @param srcEnd index after the last character in the string
- * to copy.
- * @param dst the destination array.
- * @param dstBegin the start offset in the destination array.
- * @exception IndexOutOfBoundsException If any of the following
- * is true:
- * <ul><li><code>srcBegin</code> is negative.
- * <li><code>srcBegin</code> is greater than <code>srcEnd</code>
- * <li><code>srcEnd</code> is greater than the length of this
- * string
- * <li><code>dstBegin</code> is negative
- * <li><code>dstBegin+(srcEnd-srcBegin)</code> is larger than
- * <code>dst.length</code></ul>
- * @exception NullPointerException if <code>dst</code> is <code>null</code>
- */
- public void getChars(int srcBegin, int srcEnd, char dst[], int dstBegin)
- {
- str().getChars(srcBegin, srcEnd, dst, dstBegin);
- }
-
- /**
- * Tell if two objects are functionally equal.
- *
- * @param obj2 Object to compare this to
- *
- * @return true if the two objects are equal
- *
- * @throws javax.xml.transform.TransformerException
- */
- public boolean equals(XObject obj2)
- {
-
- // In order to handle the 'all' semantics of
- // nodeset comparisons, we always call the
- // nodeset function.
- int t = obj2.getType();
- try
- {
- if (XObject.CLASS_NODESET == t)
- return obj2.equals(this);
- // If at least one object to be compared is a boolean, then each object
- // to be compared is converted to a boolean as if by applying the
- // boolean function.
- else if(XObject.CLASS_BOOLEAN == t)
- return obj2.bool() == bool();
- // Otherwise, if at least one object to be compared is a number, then each object
- // to be compared is converted to a number as if by applying the number function.
- else if(XObject.CLASS_NUMBER == t)
- return obj2.num() == num();
- }
- catch(javax.xml.transform.TransformerException te)
- {
- throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(te);
- }
-
- // Otherwise, both objects to be compared are converted to strings as
- // if by applying the string function.
- return xstr().equals(obj2.xstr());
- }
-
- /**
- * Compares this string to the specified <code>String</code>.
- * The result is <code>true</code> if and only if the argument is not
- * <code>null</code> and is a <code>String</code> object that represents
- * the same sequence of characters as this object.
- *
- * @param obj2 the object to compare this <code>String</code> against.
- * @return <code>true</code> if the <code>String</code>s are equal;
- * <code>false</code> otherwise.
- * @see java.lang.String#compareTo(java.lang.String)
- * @see java.lang.String#equalsIgnoreCase(java.lang.String)
- */
- public boolean equals(String obj2) {
- return str().equals(obj2);
- }
-
- /**
- * Compares this string to the specified object.
- * The result is <code>true</code> if and only if the argument is not
- * <code>null</code> and is a <code>String</code> object that represents
- * the same sequence of characters as this object.
- *
- * @param obj2 the object to compare this <code>String</code>
- * against.
- * @return <code>true</code> if the <code>String </code>are equal;
- * <code>false</code> otherwise.
- * @see java.lang.String#compareTo(java.lang.String)
- * @see java.lang.String#equalsIgnoreCase(java.lang.String)
- */
- public boolean equals(XMLString obj2)
- {
- if (obj2 != null) {
- if (!obj2.hasString()) {
- return obj2.equals(str());
- } else {
- return str().equals(obj2.toString());
- }
- }
- return false;
- }
-
- /**
- * Compares this string to the specified object.
- * The result is <code>true</code> if and only if the argument is not
- * <code>null</code> and is a <code>String</code> object that represents
- * the same sequence of characters as this object.
- *
- * @param obj2 the object to compare this <code>String</code>
- * against.
- * @return <code>true</code> if the <code>String </code>are equal;
- * <code>false</code> otherwise.
- * @see java.lang.String#compareTo(java.lang.String)
- * @see java.lang.String#equalsIgnoreCase(java.lang.String)
- */
- public boolean equals(Object obj2)
- {
-
- if (null == obj2)
- return false;
-
- // In order to handle the 'all' semantics of
- // nodeset comparisons, we always call the
- // nodeset function.
- else if (obj2 instanceof XNodeSet)
- return obj2.equals(this);
- else if(obj2 instanceof XNumber)
- return obj2.equals(this);
- else
- return str().equals(obj2.toString());
- }
-
- /**
- * Compares this <code>String</code> to another <code>String</code>,
- * ignoring case considerations. Two strings are considered equal
- * ignoring case if they are of the same length, and corresponding
- * characters in the two strings are equal ignoring case.
- *
- * @param anotherString the <code>String</code> to compare this
- * <code>String</code> against.
- * @return <code>true</code> if the argument is not <code>null</code>
- * and the <code>String</code>s are equal,
- * ignoring case; <code>false</code> otherwise.
- * @see #equals(Object)
- * @see java.lang.Character#toLowerCase(char)
- * @see java.lang.Character#toUpperCase(char)
- */
- public boolean equalsIgnoreCase(String anotherString)
- {
- return str().equalsIgnoreCase(anotherString);
- }
-
- /**
- * Compares two strings lexicographically.
- *
- * @param xstr the <code>String</code> to be compared.
- *
- * @return the value <code>0</code> if the argument string is equal to
- * this string; a value less than <code>0</code> if this string
- * is lexicographically less than the string argument; and a
- * value greater than <code>0</code> if this string is
- * lexicographically greater than the string argument.
- * @exception java.lang.NullPointerException if <code>anotherString</code>
- * is <code>null</code>.
- */
- public int compareTo(XMLString xstr)
- {
-
- int len1 = this.length();
- int len2 = xstr.length();
- int n = Math.min(len1, len2);
- int i = 0;
- int j = 0;
-
- while (n-- != 0)
- {
- char c1 = this.charAt(i);
- char c2 = xstr.charAt(j);
-
- if (c1 != c2)
- {
- return c1 - c2;
- }
-
- i++;
- j++;
- }
-
- return len1 - len2;
- }
-
- /**
- * Compares two strings lexicographically, ignoring case considerations.
- * This method returns an integer whose sign is that of
- * <code>this.toUpperCase().toLowerCase().compareTo(
- * str.toUpperCase().toLowerCase())</code>.
- * <p>
- * Note that this method does <em>not</em> take locale into account,
- * and will result in an unsatisfactory ordering for certain locales.
- * The java.text package provides <em>collators</em> to allow
- * locale-sensitive ordering.
- *
- * @param str the <code>String</code> to be compared.
- * @return a negative integer, zero, or a positive integer as the
- * the specified String is greater than, equal to, or less
- * than this String, ignoring case considerations.
- * @see java.text.Collator#compare(String, String)
- * @since 1.2
- */
- public int compareToIgnoreCase(XMLString str)
- {
- // %REVIEW% Like it says, @since 1.2. Doesn't exist in earlier
- // versions of Java, hence we can't yet shell out to it. We can implement
- // it as character-by-character compare, but doing so efficiently
- // is likely to be (ahem) interesting.
- //
- // However, since nobody is actually _using_ this method yet:
- // return str().compareToIgnoreCase(str.toString());
-
- throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(
- new java.lang.NoSuchMethodException(
- "Java 1.2 method, not yet implemented"));
- }
-
- /**
- * Tests if this string starts with the specified prefix beginning
- * a specified index.
- *
- * @param prefix the prefix.
- * @param toffset where to begin looking in the string.
- * @return <code>true</code> if the character sequence represented by the
- * argument is a prefix of the substring of this object starting
- * at index <code>toffset</code>; <code>false</code> otherwise.
- * The result is <code>false</code> if <code>toffset</code> is
- * negative or greater than the length of this
- * <code>String</code> object; otherwise the result is the same
- * as the result of the expression
- * <pre>
- * this.subString(toffset).startsWith(prefix)
- * </pre>
- * @exception java.lang.NullPointerException if <code>prefix</code> is
- * <code>null</code>.
- */
- public boolean startsWith(String prefix, int toffset)
- {
- return str().startsWith(prefix, toffset);
- }
-
- /**
- * Tests if this string starts with the specified prefix.
- *
- * @param prefix the prefix.
- * @return <code>true</code> if the character sequence represented by the
- * argument is a prefix of the character sequence represented by
- * this string; <code>false</code> otherwise.
- * Note also that <code>true</code> will be returned if the
- * argument is an empty string or is equal to this
- * <code>String</code> object as determined by the
- * {@link #equals(Object)} method.
- * @exception java.lang.NullPointerException if <code>prefix</code> is
- * <code>null</code>.
- */
- public boolean startsWith(String prefix)
- {
- return startsWith(prefix, 0);
- }
-
- /**
- * Tests if this string starts with the specified prefix beginning
- * a specified index.
- *
- * @param prefix the prefix.
- * @param toffset where to begin looking in the string.
- * @return <code>true</code> if the character sequence represented by the
- * argument is a prefix of the substring of this object starting
- * at index <code>toffset</code>; <code>false</code> otherwise.
- * The result is <code>false</code> if <code>toffset</code> is
- * negative or greater than the length of this
- * <code>String</code> object; otherwise the result is the same
- * as the result of the expression
- * <pre>
- * this.subString(toffset).startsWith(prefix)
- * </pre>
- * @exception java.lang.NullPointerException if <code>prefix</code> is
- * <code>null</code>.
- */
- public boolean startsWith(XMLString prefix, int toffset)
- {
-
- int to = toffset;
- int tlim = this.length();
- int po = 0;
- int pc = prefix.length();
-
- // Note: toffset might be near -1>>>1.
- if ((toffset < 0) || (toffset > tlim - pc))
- {
- return false;
- }
-
- while (--pc >= 0)
- {
- if (this.charAt(to) != prefix.charAt(po))
- {
- return false;
- }
-
- to++;
- po++;
- }
-
- return true;
- }
-
- /**
- * Tests if this string starts with the specified prefix.
- *
- * @param prefix the prefix.
- * @return <code>true</code> if the character sequence represented by the
- * argument is a prefix of the character sequence represented by
- * this string; <code>false</code> otherwise.
- * Note also that <code>true</code> will be returned if the
- * argument is an empty string or is equal to this
- * <code>String</code> object as determined by the
- * {@link #equals(Object)} method.
- * @exception java.lang.NullPointerException if <code>prefix</code> is
- * <code>null</code>.
- */
- public boolean startsWith(XMLString prefix)
- {
- return startsWith(prefix, 0);
- }
-
- /**
- * Tests if this string ends with the specified suffix.
- *
- * @param suffix the suffix.
- * @return <code>true</code> if the character sequence represented by the
- * argument is a suffix of the character sequence represented by
- * this object; <code>false</code> otherwise. Note that the
- * result will be <code>true</code> if the argument is the
- * empty string or is equal to this <code>String</code> object
- * as determined by the {@link #equals(Object)} method.
- * @exception java.lang.NullPointerException if <code>suffix</code> is
- * <code>null</code>.
- */
- public boolean endsWith(String suffix)
- {
- return str().endsWith(suffix);
- }
-
- /**
- * Returns a hashcode for this string. The hashcode for a
- * <code>String</code> object is computed as
- * <blockquote><pre>
- * s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1]
- * </pre></blockquote>
- * using <code>int</code> arithmetic, where <code>s[i]</code> is the
- * <i>i</i>th character of the string, <code>n</code> is the length of
- * the string, and <code>^</code> indicates exponentiation.
- * (The hash value of the empty string is zero.)
- *
- * @return a hash code value for this object.
- */
- public int hashCode()
- {
- return str().hashCode();
- }
-
- /**
- * Returns the index within this string of the first occurrence of the
- * specified character. If a character with value <code>ch</code> occurs
- * in the character sequence represented by this <code>String</code>
- * object, then the index of the first such occurrence is returned --
- * that is, the smallest value <i>k</i> such that:
- * <blockquote><pre>
- * this.charAt(<i>k</i>) == ch
- * </pre></blockquote>
- * is <code>true</code>. If no such character occurs in this string,
- * then <code>-1</code> is returned.
- *
- * @param ch a character.
- * @return the index of the first occurrence of the character in the
- * character sequence represented by this object, or
- * <code>-1</code> if the character does not occur.
- */
- public int indexOf(int ch)
- {
- return str().indexOf(ch);
- }
-
- /**
- * Returns the index within this string of the first occurrence of the
- * specified character, starting the search at the specified index.
- * <p>
- * If a character with value <code>ch</code> occurs in the character
- * sequence represented by this <code>String</code> object at an index
- * no smaller than <code>fromIndex</code>, then the index of the first
- * such occurrence is returned--that is, the smallest value <i>k</i>
- * such that:
- * <blockquote><pre>
- * (this.charAt(<i>k</i>) == ch) && (<i>k</i> >= fromIndex)
- * </pre></blockquote>
- * is true. If no such character occurs in this string at or after
- * position <code>fromIndex</code>, then <code>-1</code> is returned.
- * <p>
- * There is no restriction on the value of <code>fromIndex</code>. If it
- * is negative, it has the same effect as if it were zero: this entire
- * string may be searched. If it is greater than the length of this
- * string, it has the same effect as if it were equal to the length of
- * this string: <code>-1</code> is returned.
- *
- * @param ch a character.
- * @param fromIndex the index to start the search from.
- * @return the index of the first occurrence of the character in the
- * character sequence represented by this object that is greater
- * than or equal to <code>fromIndex</code>, or <code>-1</code>
- * if the character does not occur.
- */
- public int indexOf(int ch, int fromIndex)
- {
- return str().indexOf(ch, fromIndex);
- }
-
- /**
- * Returns the index within this string of the last occurrence of the
- * specified character. That is, the index returned is the largest
- * value <i>k</i> such that:
- * <blockquote><pre>
- * this.charAt(<i>k</i>) == ch
- * </pre></blockquote>
- * is true.
- * The String is searched backwards starting at the last character.
- *
- * @param ch a character.
- * @return the index of the last occurrence of the character in the
- * character sequence represented by this object, or
- * <code>-1</code> if the character does not occur.
- */
- public int lastIndexOf(int ch)
- {
- return str().lastIndexOf(ch);
- }
-
- /**
- * Returns the index within this string of the last occurrence of the
- * specified character, searching backward starting at the specified
- * index. That is, the index returned is the largest value <i>k</i>
- * such that:
- * <blockquote><pre>
- * this.charAt(k) == ch) && (k <= fromIndex)
- * </pre></blockquote>
- * is true.
- *
- * @param ch a character.
- * @param fromIndex the index to start the search from. There is no
- * restriction on the value of <code>fromIndex</code>. If it is
- * greater than or equal to the length of this string, it has
- * the same effect as if it were equal to one less than the
- * length of this string: this entire string may be searched.
- * If it is negative, it has the same effect as if it were -1:
- * -1 is returned.
- * @return the index of the last occurrence of the character in the
- * character sequence represented by this object that is less
- * than or equal to <code>fromIndex</code>, or <code>-1</code>
- * if the character does not occur before that point.
- */
- public int lastIndexOf(int ch, int fromIndex)
- {
- return str().lastIndexOf(ch, fromIndex);
- }
-
- /**
- * Returns the index within this string of the first occurrence of the
- * specified substring. The integer returned is the smallest value
- * <i>k</i> such that:
- * <blockquote><pre>
- * this.startsWith(str, <i>k</i>)
- * </pre></blockquote>
- * is <code>true</code>.
- *
- * @param str any string.
- * @return if the string argument occurs as a substring within this
- * object, then the index of the first character of the first
- * such substring is returned; if it does not occur as a
- * substring, <code>-1</code> is returned.
- * @exception java.lang.NullPointerException if <code>str</code> is
- * <code>null</code>.
- */
- public int indexOf(String str)
- {
- return str().indexOf(str);
- }
-
- /**
- * Returns the index within this string of the first occurrence of the
- * specified substring. The integer returned is the smallest value
- * <i>k</i> such that:
- * <blockquote><pre>
- * this.startsWith(str, <i>k</i>)
- * </pre></blockquote>
- * is <code>true</code>.
- *
- * @param str any string.
- * @return if the string argument occurs as a substring within this
- * object, then the index of the first character of the first
- * such substring is returned; if it does not occur as a
- * substring, <code>-1</code> is returned.
- * @exception java.lang.NullPointerException if <code>str</code> is
- * <code>null</code>.
- */
- public int indexOf(XMLString str)
- {
- return str().indexOf(str.toString());
- }
-
- /**
- * Returns the index within this string of the first occurrence of the
- * specified substring, starting at the specified index. The integer
- * returned is the smallest value <i>k</i> such that:
- * <blockquote><pre>
- * this.startsWith(str, <i>k</i>) && (<i>k</i> >= fromIndex)
- * </pre></blockquote>
- * is <code>true</code>.
- * <p>
- * There is no restriction on the value of <code>fromIndex</code>. If
- * it is negative, it has the same effect as if it were zero: this entire
- * string may be searched. If it is greater than the length of this
- * string, it has the same effect as if it were equal to the length of
- * this string: <code>-1</code> is returned.
- *
- * @param str the substring to search for.
- * @param fromIndex the index to start the search from.
- * @return If the string argument occurs as a substring within this
- * object at a starting index no smaller than
- * <code>fromIndex</code>, then the index of the first character
- * of the first such substring is returned. If it does not occur
- * as a substring starting at <code>fromIndex</code> or beyond,
- * <code>-1</code> is returned.
- * @exception java.lang.NullPointerException if <code>str</code> is
- * <code>null</code>
- */
- public int indexOf(String str, int fromIndex)
- {
- return str().indexOf(str, fromIndex);
- }
-
- /**
- * Returns the index within this string of the rightmost occurrence
- * of the specified substring. The rightmost empty string "" is
- * considered to occur at the index value <code>this.length()</code>.
- * The returned index is the largest value <i>k</i> such that
- * <blockquote><pre>
- * this.startsWith(str, k)
- * </pre></blockquote>
- * is true.
- *
- * @param str the substring to search for.
- * @return if the string argument occurs one or more times as a substring
- * within this object, then the index of the first character of
- * the last such substring is returned. If it does not occur as
- * a substring, <code>-1</code> is returned.
- * @exception java.lang.NullPointerException if <code>str</code> is
- * <code>null</code>.
- */
- public int lastIndexOf(String str)
- {
- return str().lastIndexOf(str);
- }
-
- /**
- * Returns the index within this string of the last occurrence of
- * the specified substring.
- *
- * @param str the substring to search for.
- * @param fromIndex the index to start the search from. There is no
- * restriction on the value of fromIndex. If it is greater than
- * the length of this string, it has the same effect as if it
- * were equal to the length of this string: this entire string
- * may be searched. If it is negative, it has the same effect
- * as if it were -1: -1 is returned.
- * @return If the string argument occurs one or more times as a substring
- * within this object at a starting index no greater than
- * <code>fromIndex</code>, then the index of the first character of
- * the last such substring is returned. If it does not occur as a
- * substring starting at <code>fromIndex</code> or earlier,
- * <code>-1</code> is returned.
- * @exception java.lang.NullPointerException if <code>str</code> is
- * <code>null</code>.
- */
- public int lastIndexOf(String str, int fromIndex)
- {
- return str().lastIndexOf(str, fromIndex);
- }
-
- /**
- * Returns a new string that is a substring of this string. The
- * substring begins with the character at the specified index and
- * extends to the end of this string. <p>
- * Examples:
- * <blockquote><pre>
- * "unhappy".substring(2) returns "happy"
- * "Harbison".substring(3) returns "bison"
- * "emptiness".substring(9) returns "" (an empty string)
- * </pre></blockquote>
- *
- * @param beginIndex the beginning index, inclusive.
- * @return the specified substring.
- * @exception IndexOutOfBoundsException if
- * <code>beginIndex</code> is negative or larger than the
- * length of this <code>String</code> object.
- */
- public XMLString substring(int beginIndex)
- {
- return new XString(str().substring(beginIndex));
- }
-
- /**
- * Returns a new string that is a substring of this string. The
- * substring begins at the specified <code>beginIndex</code> and
- * extends to the character at index <code>endIndex - 1</code>.
- * Thus the length of the substring is <code>endIndex-beginIndex</code>.
- *
- * @param beginIndex the beginning index, inclusive.
- * @param endIndex the ending index, exclusive.
- * @return the specified substring.
- * @exception IndexOutOfBoundsException if the
- * <code>beginIndex</code> is negative, or
- * <code>endIndex</code> is larger than the length of
- * this <code>String</code> object, or
- * <code>beginIndex</code> is larger than
- * <code>endIndex</code>.
- */
- public XMLString substring(int beginIndex, int endIndex)
- {
- return new XString(str().substring(beginIndex, endIndex));
- }
-
- /**
- * Concatenates the specified string to the end of this string.
- *
- * @param str the <code>String</code> that is concatenated to the end
- * of this <code>String</code>.
- * @return a string that represents the concatenation of this object's
- * characters followed by the string argument's characters.
- * @exception java.lang.NullPointerException if <code>str</code> is
- * <code>null</code>.
- */
- public XMLString concat(String str)
- {
-
- // %REVIEW% Make an FSB here?
- return new XString(str().concat(str));
- }
-
- /**
- * Converts all of the characters in this <code>String</code> to lower
- * case using the rules of the given <code>Locale</code>.
- *
- * @param locale use the case transformation rules for this locale
- * @return the String, converted to lowercase.
- * @see java.lang.Character#toLowerCase(char)
- * @see java.lang.String#toUpperCase(Locale)
- */
- public XMLString toLowerCase(Locale locale)
- {
- return new XString(str().toLowerCase(locale));
- }
-
- /**
- * Converts all of the characters in this <code>String</code> to lower
- * case using the rules of the default locale, which is returned
- * by <code>Locale.getDefault</code>.
- * <p>
- *
- * @return the string, converted to lowercase.
- * @see java.lang.Character#toLowerCase(char)
- * @see java.lang.String#toLowerCase(Locale)
- */
- public XMLString toLowerCase()
- {
- return new XString(str().toLowerCase());
- }
-
- /**
- * Converts all of the characters in this <code>String</code> to upper
- * case using the rules of the given locale.
- * @param locale use the case transformation rules for this locale
- * @return the String, converted to uppercase.
- * @see java.lang.Character#toUpperCase(char)
- * @see java.lang.String#toLowerCase(Locale)
- */
- public XMLString toUpperCase(Locale locale)
- {
- return new XString(str().toUpperCase(locale));
- }
-
- /**
- * Converts all of the characters in this <code>String</code> to upper
- * case using the rules of the default locale, which is returned
- * by <code>Locale.getDefault</code>.
- *
- * <p>
- * If no character in this string has a different uppercase version,
- * based on calling the <code>toUpperCase</code> method defined by
- * <code>Character</code>, then the original string is returned.
- * <p>
- * Otherwise, this method creates a new <code>String</code> object
- * representing a character sequence identical in length to the
- * character sequence represented by this <code>String</code> object and
- * with every character equal to the result of applying the method
- * <code>Character.toUpperCase</code> to the corresponding character of
- * this <code>String</code> object. <p>
- * Examples:
- * <blockquote><pre>
- * "Fahrvergn&uuml;gen".toUpperCase() returns "FAHRVERGN&Uuml;GEN"
- * "Visit Ljubinje!".toUpperCase() returns "VISIT LJUBINJE!"
- * </pre></blockquote>
- *
- * @return the string, converted to uppercase.
- * @see java.lang.Character#toUpperCase(char)
- * @see java.lang.String#toUpperCase(Locale)
- */
- public XMLString toUpperCase()
- {
- return new XString(str().toUpperCase());
- }
-
- /**
- * Removes white space from both ends of this string.
- *
- * @return this string, with white space removed from the front and end.
- */
- public XMLString trim()
- {
- return new XString(str().trim());
- }
-
- /**
- * Returns whether the specified <var>ch</var> conforms to the XML 1.0 definition
- * of whitespace. Refer to <A href="http://www.w3.org/TR/1998/REC-xml-19980210#NT-S">
- * the definition of <CODE>S</CODE></A> for details.
- * @param ch Character to check as XML whitespace.
- * @return =true if <var>ch</var> is XML whitespace; otherwise =false.
- */
- private static boolean isSpace(char ch)
- {
- return XMLCharacterRecognizer.isWhiteSpace(ch); // Take the easy way out for now.
- }
-
- /**
- * Conditionally trim all leading and trailing whitespace in the specified String.
- * All strings of white space are
- * replaced by a single space character (#x20), except spaces after punctuation which
- * receive double spaces if doublePunctuationSpaces is true.
- * This function may be useful to a formatter, but to get first class
- * results, the formatter should probably do it's own white space handling
- * based on the semantics of the formatting object.
- *
- * @param trimHead Trim leading whitespace?
- * @param trimTail Trim trailing whitespace?
- * @param doublePunctuationSpaces Use double spaces for punctuation?
- * @return The trimmed string.
- */
- public XMLString fixWhiteSpace(boolean trimHead, boolean trimTail,
- boolean doublePunctuationSpaces)
- {
-
- // %OPT% !!!!!!!
- int len = this.length();
- char[] buf = new char[len];
-
- this.getChars(0, len, buf, 0);
-
- boolean edit = false;
- int s;
-
- for (s = 0; s < len; s++)
- {
- if (isSpace(buf[s]))
- {
- break;
- }
- }
-
- /* replace S to ' '. and ' '+ -> single ' '. */
- int d = s;
- boolean pres = false;
-
- for (; s < len; s++)
- {
- char c = buf[s];
-
- if (isSpace(c))
- {
- if (!pres)
- {
- if (' ' != c)
- {
- edit = true;
- }
-
- buf[d++] = ' ';
-
- if (doublePunctuationSpaces && (s != 0))
- {
- char prevChar = buf[s - 1];
-
- if (!((prevChar == '.') || (prevChar == '!')
- || (prevChar == '?')))
- {
- pres = true;
- }
- }
- else
- {
- pres = true;
- }
- }
- else
- {
- edit = true;
- pres = true;
- }
- }
- else
- {
- buf[d++] = c;
- pres = false;
- }
- }
-
- if (trimTail && 1 <= d && ' ' == buf[d - 1])
- {
- edit = true;
-
- d--;
- }
-
- int start = 0;
-
- if (trimHead && 0 < d && ' ' == buf[0])
- {
- edit = true;
-
- start++;
- }
-
- XMLStringFactory xsf = XMLStringFactoryImpl.getFactory();
-
- return edit ? xsf.newstr(new String(buf, start, d - start)) : this;
- }
-
- /**
- * @see com.sun.org.apache.xpath.internal.XPathVisitable#callVisitors(ExpressionOwner, XPathVisitor)
- */
- public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)
- {
- visitor.visitStringLiteral(owner, this);
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/objects/XStringForChars.java b/src/com/sun/org/apache/xpath/internal/objects/XStringForChars.java
deleted file mode 100644
index 4fb7363..0000000
--- a/src/com/sun/org/apache/xpath/internal/objects/XStringForChars.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XStringForChars.java,v 1.2.4.1 2005/09/14 20:46:27 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.objects;
-
-import com.sun.org.apache.xalan.internal.res.XSLMessages;
-import com.sun.org.apache.xml.internal.utils.FastStringBuffer;
-import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
-
-
-/**
- * This class will wrap a FastStringBuffer and allow for
- */
-public class XStringForChars extends XString
-{
- static final long serialVersionUID = -2235248887220850467L;
- /** The start position in the fsb. */
- int m_start;
-
- /** The length of the string. */
- int m_length;
-
- protected String m_strCache = null;
-
- /**
- * Construct a XNodeSet object.
- *
- * @param val FastStringBuffer object this will wrap, must be non-null.
- * @param start The start position in the array.
- * @param length The number of characters to read from the array.
- */
- public XStringForChars(char[] val, int start, int length)
- {
- super(val);
- m_start = start;
- m_length = length;
- if(null == val)
- throw new IllegalArgumentException(
- XSLMessages.createXPATHMessage(XPATHErrorResources.ER_FASTSTRINGBUFFER_CANNOT_BE_NULL, null)); //"The FastStringBuffer argument can not be null!!");
- }
-
-
- /**
- * Construct a XNodeSet object.
- *
- * @param val String object this will wrap.
- */
- private XStringForChars(String val)
- {
- super(val);
- throw new IllegalArgumentException(
- XSLMessages.createXPATHMessage(XPATHErrorResources.ER_XSTRINGFORCHARS_CANNOT_TAKE_STRING, null)); //"XStringForChars can not take a string for an argument!");
- }
-
- /**
- * Cast result object to a string.
- *
- * @return The string this wraps or the empty string if null
- */
- public FastStringBuffer fsb()
- {
- throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_FSB_NOT_SUPPORTED_XSTRINGFORCHARS, null)); //"fsb() not supported for XStringForChars!");
- }
-
- /**
- * Cast result object to a string.
- *
- * @return The string this wraps or the empty string if null
- */
- public void appendToFsb(com.sun.org.apache.xml.internal.utils.FastStringBuffer fsb)
- {
- fsb.append((char[])m_obj, m_start, m_length);
- }
-
-
- /**
- * Tell if this object contains a java String object.
- *
- * @return true if this XMLString can return a string without creating one.
- */
- public boolean hasString()
- {
- return (null != m_strCache);
- }
-
-
- /**
- * Cast result object to a string.
- *
- * @return The string this wraps or the empty string if null
- */
- public String str()
- {
- if(null == m_strCache)
- m_strCache = new String((char[])m_obj, m_start, m_length);
-
- return m_strCache;
- }
-
-
- /**
- * Since this object is incomplete without the length and the offset, we
- * have to convert to a string when this function is called.
- *
- * @return The java String representation of this object.
- */
- public Object object()
- {
- return str();
- }
-
- /**
- * Directly call the
- * characters method on the passed ContentHandler for the
- * string-value. Multiple calls to the
- * ContentHandler's characters methods may well occur for a single call to
- * this method.
- *
- * @param ch A non-null reference to a ContentHandler.
- *
- * @throws org.xml.sax.SAXException
- */
- public void dispatchCharactersEvents(org.xml.sax.ContentHandler ch)
- throws org.xml.sax.SAXException
- {
- ch.characters((char[])m_obj, m_start, m_length);
- }
-
- /**
- * Directly call the
- * comment method on the passed LexicalHandler for the
- * string-value.
- *
- * @param lh A non-null reference to a LexicalHandler.
- *
- * @throws org.xml.sax.SAXException
- */
- public void dispatchAsComment(org.xml.sax.ext.LexicalHandler lh)
- throws org.xml.sax.SAXException
- {
- lh.comment((char[])m_obj, m_start, m_length);
- }
-
- /**
- * Returns the length of this string.
- *
- * @return the length of the sequence of characters represented by this
- * object.
- */
- public int length()
- {
- return m_length;
- }
-
- /**
- * Returns the character at the specified index. An index ranges
- * from <code>0</code> to <code>length() - 1</code>. The first character
- * of the sequence is at index <code>0</code>, the next at index
- * <code>1</code>, and so on, as for array indexing.
- *
- * @param index the index of the character.
- * @return the character at the specified index of this string.
- * The first character is at index <code>0</code>.
- * @exception IndexOutOfBoundsException if the <code>index</code>
- * argument is negative or not less than the length of this
- * string.
- */
- public char charAt(int index)
- {
- return ((char[])m_obj)[index+m_start];
- }
-
- /**
- * Copies characters from this string into the destination character
- * array.
- *
- * @param srcBegin index of the first character in the string
- * to copy.
- * @param srcEnd index after the last character in the string
- * to copy.
- * @param dst the destination array.
- * @param dstBegin the start offset in the destination array.
- * @exception IndexOutOfBoundsException If any of the following
- * is true:
- * <ul><li><code>srcBegin</code> is negative.
- * <li><code>srcBegin</code> is greater than <code>srcEnd</code>
- * <li><code>srcEnd</code> is greater than the length of this
- * string
- * <li><code>dstBegin</code> is negative
- * <li><code>dstBegin+(srcEnd-srcBegin)</code> is larger than
- * <code>dst.length</code></ul>
- * @exception NullPointerException if <code>dst</code> is <code>null</code>
- */
- public void getChars(int srcBegin, int srcEnd, char dst[], int dstBegin)
- {
- System.arraycopy((char[])m_obj, m_start+srcBegin, dst, dstBegin, srcEnd);
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/objects/XStringForFSB.java b/src/com/sun/org/apache/xpath/internal/objects/XStringForFSB.java
deleted file mode 100644
index d631064..0000000
--- a/src/com/sun/org/apache/xpath/internal/objects/XStringForFSB.java
+++ /dev/null
@@ -1,988 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XStringForFSB.java,v 1.2.4.2 2005/09/14 20:46:27 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.objects;
-
-import com.sun.org.apache.xalan.internal.res.XSLMessages;
-import com.sun.org.apache.xml.internal.utils.FastStringBuffer;
-import com.sun.org.apache.xml.internal.utils.XMLCharacterRecognizer;
-import com.sun.org.apache.xml.internal.utils.XMLString;
-import com.sun.org.apache.xml.internal.utils.XMLStringFactory;
-import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
-
-/**
- * This class will wrap a FastStringBuffer and allow for
- */
-public class XStringForFSB extends XString
-{
- static final long serialVersionUID = -1533039186550674548L;
-
- /** The start position in the fsb. */
- int m_start;
-
- /** The length of the string. */
- int m_length;
-
- /** If the str() function is called, the string will be cached here. */
- protected String m_strCache = null;
-
- /** cached hash code */
- protected int m_hash = 0;
-
- /**
- * Construct a XNodeSet object.
- *
- * @param val FastStringBuffer object this will wrap, must be non-null.
- * @param start The start position in the array.
- * @param length The number of characters to read from the array.
- */
- public XStringForFSB(FastStringBuffer val, int start, int length)
- {
-
- super(val);
-
- m_start = start;
- m_length = length;
-
- if (null == val)
- throw new IllegalArgumentException(
- XSLMessages.createXPATHMessage(XPATHErrorResources.ER_FASTSTRINGBUFFER_CANNOT_BE_NULL, null));
- }
-
- /**
- * Construct a XNodeSet object.
- *
- * @param val String object this will wrap.
- */
- private XStringForFSB(String val)
- {
-
- super(val);
-
- throw new IllegalArgumentException(
- XSLMessages.createXPATHMessage(XPATHErrorResources.ER_FSB_CANNOT_TAKE_STRING, null)); // "XStringForFSB can not take a string for an argument!");
- }
-
- /**
- * Cast result object to a string.
- *
- * @return The string this wraps or the empty string if null
- */
- public FastStringBuffer fsb()
- {
- return ((FastStringBuffer) m_obj);
- }
-
- /**
- * Cast result object to a string.
- *
- * @return The string this wraps or the empty string if null
- */
- public void appendToFsb(com.sun.org.apache.xml.internal.utils.FastStringBuffer fsb)
- {
- // %OPT% !!! FSB has to be updated to take partial fsb's for append.
- fsb.append(str());
- }
-
- /**
- * Tell if this object contains a java String object.
- *
- * @return true if this XMLString can return a string without creating one.
- */
- public boolean hasString()
- {
- return (null != m_strCache);
- }
-
-// /** NEEDSDOC Field strCount */
-// public static int strCount = 0;
-//
-// /** NEEDSDOC Field xtable */
-// static java.util.Hashtable xtable = new java.util.Hashtable();
-
- /**
- * Since this object is incomplete without the length and the offset, we
- * have to convert to a string when this function is called.
- *
- * @return The java String representation of this object.
- */
- public Object object()
- {
- return str();
- }
-
- /**
- * Cast result object to a string.
- *
- * @return The string this wraps or the empty string if null
- */
- public String str()
- {
-
- if (null == m_strCache)
- {
- m_strCache = fsb().getString(m_start, m_length);
-
-// strCount++;
-//
-// RuntimeException e = new RuntimeException("Bad! Bad!");
-// java.io.CharArrayWriter writer = new java.io.CharArrayWriter();
-// java.io.PrintWriter pw = new java.io.PrintWriter(writer);
-//
-// e.printStackTrace(pw);
-//
-// String str = writer.toString();
-//
-// str = str.substring(0, 600);
-//
-// if (null == xtable.get(str))
-// {
-// xtable.put(str, str);
-// System.out.println(str);
-// }
-// System.out.println("strCount: " + strCount);
-
-// throw e;
-// e.printStackTrace();
- // System.exit(-1);
- }
-
- return m_strCache;
- }
-
- /**
- * Directly call the
- * characters method on the passed ContentHandler for the
- * string-value. Multiple calls to the
- * ContentHandler's characters methods may well occur for a single call to
- * this method.
- *
- * @param ch A non-null reference to a ContentHandler.
- *
- * @throws org.xml.sax.SAXException
- */
- public void dispatchCharactersEvents(org.xml.sax.ContentHandler ch)
- throws org.xml.sax.SAXException
- {
- fsb().sendSAXcharacters(ch, m_start, m_length);
- }
-
- /**
- * Directly call the
- * comment method on the passed LexicalHandler for the
- * string-value.
- *
- * @param lh A non-null reference to a LexicalHandler.
- *
- * @throws org.xml.sax.SAXException
- */
- public void dispatchAsComment(org.xml.sax.ext.LexicalHandler lh)
- throws org.xml.sax.SAXException
- {
- fsb().sendSAXComment(lh, m_start, m_length);
- }
-
- /**
- * Returns the length of this string.
- *
- * @return the length of the sequence of characters represented by this
- * object.
- */
- public int length()
- {
- return m_length;
- }
-
- /**
- * Returns the character at the specified index. An index ranges
- * from <code>0</code> to <code>length() - 1</code>. The first character
- * of the sequence is at index <code>0</code>, the next at index
- * <code>1</code>, and so on, as for array indexing.
- *
- * @param index the index of the character.
- * @return the character at the specified index of this string.
- * The first character is at index <code>0</code>.
- * @exception IndexOutOfBoundsException if the <code>index</code>
- * argument is negative or not less than the length of this
- * string.
- */
- public char charAt(int index)
- {
- return fsb().charAt(m_start + index);
- }
-
- /**
- * Copies characters from this string into the destination character
- * array.
- *
- * @param srcBegin index of the first character in the string
- * to copy.
- * @param srcEnd index after the last character in the string
- * to copy.
- * @param dst the destination array.
- * @param dstBegin the start offset in the destination array.
- * @exception IndexOutOfBoundsException If any of the following
- * is true:
- * <ul><li><code>srcBegin</code> is negative.
- * <li><code>srcBegin</code> is greater than <code>srcEnd</code>
- * <li><code>srcEnd</code> is greater than the length of this
- * string
- * <li><code>dstBegin</code> is negative
- * <li><code>dstBegin+(srcEnd-srcBegin)</code> is larger than
- * <code>dst.length</code></ul>
- * @exception NullPointerException if <code>dst</code> is <code>null</code>
- */
- public void getChars(int srcBegin, int srcEnd, char dst[], int dstBegin)
- {
-
- // %OPT% Need to call this on FSB when it is implemented.
- // %UNTESTED% (I don't think anyone calls this yet?)
- int n = srcEnd - srcBegin;
-
- if (n > m_length)
- n = m_length;
-
- if (n > (dst.length - dstBegin))
- n = (dst.length - dstBegin);
-
- int end = srcBegin + m_start + n;
- int d = dstBegin;
- FastStringBuffer fsb = fsb();
-
- for (int i = srcBegin + m_start; i < end; i++)
- {
- dst[d++] = fsb.charAt(i);
- }
- }
-
- /**
- * Compares this string to the specified object.
- * The result is <code>true</code> if and only if the argument is not
- * <code>null</code> and is a <code>String</code> object that represents
- * the same sequence of characters as this object.
- *
- * @param obj2 the object to compare this <code>String</code>
- * against.
- *
- * @return <code>true</code> if the <code>String </code>are equal;
- * <code>false</code> otherwise.
- * @see java.lang.String#compareTo(java.lang.String)
- * @see java.lang.String#equalsIgnoreCase(java.lang.String)
- */
- public boolean equals(XMLString obj2)
- {
-
- if (this == obj2)
- {
- return true;
- }
-
- int n = m_length;
-
- if (n == obj2.length())
- {
- FastStringBuffer fsb = fsb();
- int i = m_start;
- int j = 0;
-
- while (n-- != 0)
- {
- if (fsb.charAt(i) != obj2.charAt(j))
- {
- return false;
- }
-
- i++;
- j++;
- }
-
- return true;
- }
-
- return false;
- }
-
- /**
- * Tell if two objects are functionally equal.
- *
- * @param obj2 Object to compare this to
- *
- * @return true if the two objects are equal
- *
- * @throws javax.xml.transform.TransformerException
- */
- public boolean equals(XObject obj2)
- {
-
- if (this == obj2)
- {
- return true;
- }
- if(obj2.getType() == XObject.CLASS_NUMBER)
- return obj2.equals(this);
-
- String str = obj2.str();
- int n = m_length;
-
- if (n == str.length())
- {
- FastStringBuffer fsb = fsb();
- int i = m_start;
- int j = 0;
-
- while (n-- != 0)
- {
- if (fsb.charAt(i) != str.charAt(j))
- {
- return false;
- }
-
- i++;
- j++;
- }
-
- return true;
- }
-
- return false;
- }
-
- /**
- * Tell if two objects are functionally equal.
- *
- * @param anotherString Object to compare this to
- *
- * @return true if the two objects are equal
- *
- * @throws javax.xml.transform.TransformerException
- */
- public boolean equals(String anotherString)
- {
-
- int n = m_length;
-
- if (n == anotherString.length())
- {
- FastStringBuffer fsb = fsb();
- int i = m_start;
- int j = 0;
-
- while (n-- != 0)
- {
- if (fsb.charAt(i) != anotherString.charAt(j))
- {
- return false;
- }
-
- i++;
- j++;
- }
-
- return true;
- }
-
- return false;
- }
-
- /**
- * Compares this string to the specified object.
- * The result is <code>true</code> if and only if the argument is not
- * <code>null</code> and is a <code>String</code> object that represents
- * the same sequence of characters as this object.
- *
- * @param obj2 the object to compare this <code>String</code>
- * against.
- *
- * @return <code>true</code> if the <code>String </code>are equal;
- * <code>false</code> otherwise.
- * @see java.lang.String#compareTo(java.lang.String)
- * @see java.lang.String#equalsIgnoreCase(java.lang.String)
- */
- public boolean equals(Object obj2)
- {
-
- if (null == obj2)
- return false;
-
- if(obj2 instanceof XNumber)
- return obj2.equals(this);
-
- // In order to handle the 'all' semantics of
- // nodeset comparisons, we always call the
- // nodeset function.
- else if (obj2 instanceof XNodeSet)
- return obj2.equals(this);
- else if (obj2 instanceof XStringForFSB)
- return equals((XMLString) obj2);
- else
- return equals(obj2.toString());
- }
-
- /**
- * Compares this <code>String</code> to another <code>String</code>,
- * ignoring case considerations. Two strings are considered equal
- * ignoring case if they are of the same length, and corresponding
- * characters in the two strings are equal ignoring case.
- *
- * @param anotherString the <code>String</code> to compare this
- * <code>String</code> against.
- * @return <code>true</code> if the argument is not <code>null</code>
- * and the <code>String</code>s are equal,
- * ignoring case; <code>false</code> otherwise.
- * @see #equals(Object)
- * @see java.lang.Character#toLowerCase(char)
- * @see java.lang.Character#toUpperCase(char)
- */
- public boolean equalsIgnoreCase(String anotherString)
- {
- return (m_length == anotherString.length())
- ? str().equalsIgnoreCase(anotherString) : false;
- }
-
- /**
- * Compares two strings lexicographically.
- *
- * @param xstr the <code>String</code> to be compared.
- *
- * @return the value <code>0</code> if the argument string is equal to
- * this string; a value less than <code>0</code> if this string
- * is lexicographically less than the string argument; and a
- * value greater than <code>0</code> if this string is
- * lexicographically greater than the string argument.
- * @exception java.lang.NullPointerException if <code>anotherString</code>
- * is <code>null</code>.
- */
- public int compareTo(XMLString xstr)
- {
-
- int len1 = m_length;
- int len2 = xstr.length();
- int n = Math.min(len1, len2);
- FastStringBuffer fsb = fsb();
- int i = m_start;
- int j = 0;
-
- while (n-- != 0)
- {
- char c1 = fsb.charAt(i);
- char c2 = xstr.charAt(j);
-
- if (c1 != c2)
- {
- return c1 - c2;
- }
-
- i++;
- j++;
- }
-
- return len1 - len2;
- }
-
- /**
- * Compares two strings lexicographically, ignoring case considerations.
- * This method returns an integer whose sign is that of
- * <code>this.toUpperCase().toLowerCase().compareTo(
- * str.toUpperCase().toLowerCase())</code>.
- * <p>
- * Note that this method does <em>not</em> take locale into account,
- * and will result in an unsatisfactory ordering for certain locales.
- * The java.text package provides <em>collators</em> to allow
- * locale-sensitive ordering.
- *
- * @param xstr the <code>String</code> to be compared.
- *
- * @return a negative integer, zero, or a positive integer as the
- * the specified String is greater than, equal to, or less
- * than this String, ignoring case considerations.
- * @see java.text.Collator#compare(String, String)
- * @since 1.2
- */
- public int compareToIgnoreCase(XMLString xstr)
- {
-
- int len1 = m_length;
- int len2 = xstr.length();
- int n = Math.min(len1, len2);
- FastStringBuffer fsb = fsb();
- int i = m_start;
- int j = 0;
-
- while (n-- != 0)
- {
- char c1 = Character.toLowerCase(fsb.charAt(i));
- char c2 = Character.toLowerCase(xstr.charAt(j));
-
- if (c1 != c2)
- {
- return c1 - c2;
- }
-
- i++;
- j++;
- }
-
- return len1 - len2;
- }
-
- /**
- * Returns a hashcode for this string. The hashcode for a
- * <code>String</code> object is computed as
- * <blockquote><pre>
- * s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1]
- * </pre></blockquote>
- * using <code>int</code> arithmetic, where <code>s[i]</code> is the
- * <i>i</i>th character of the string, <code>n</code> is the length of
- * the string, and <code>^</code> indicates exponentiation.
- * (The hash value of the empty string is zero.)
- *
- * @return a hash code value for this object.
- */
- public int hashCode()
- {
- // Commenting this out because in JDK1.1.8 and VJ++
- // we don't match XMLStrings. Defaulting to the super
- // causes us to create a string, but at this point
- // this only seems to get called in key processing.
- // Maybe we can live with it?
-
-/*
- int h = m_hash;
-
- if (h == 0)
- {
- int off = m_start;
- int len = m_length;
- FastStringBuffer fsb = fsb();
-
- for (int i = 0; i < len; i++)
- {
- h = 31 * h + fsb.charAt(off);
-
- off++;
- }
-
- m_hash = h;
- }
- */
-
- return super.hashCode(); // h;
- }
-
- /**
- * Tests if this string starts with the specified prefix beginning
- * a specified index.
- *
- * @param prefix the prefix.
- * @param toffset where to begin looking in the string.
- * @return <code>true</code> if the character sequence represented by the
- * argument is a prefix of the substring of this object starting
- * at index <code>toffset</code>; <code>false</code> otherwise.
- * The result is <code>false</code> if <code>toffset</code> is
- * negative or greater than the length of this
- * <code>String</code> object; otherwise the result is the same
- * as the result of the expression
- * <pre>
- * this.subString(toffset).startsWith(prefix)
- * </pre>
- * @exception java.lang.NullPointerException if <code>prefix</code> is
- * <code>null</code>.
- */
- public boolean startsWith(XMLString prefix, int toffset)
- {
-
- FastStringBuffer fsb = fsb();
- int to = m_start + toffset;
- int tlim = m_start + m_length;
- int po = 0;
- int pc = prefix.length();
-
- // Note: toffset might be near -1>>>1.
- if ((toffset < 0) || (toffset > m_length - pc))
- {
- return false;
- }
-
- while (--pc >= 0)
- {
- if (fsb.charAt(to) != prefix.charAt(po))
- {
- return false;
- }
-
- to++;
- po++;
- }
-
- return true;
- }
-
- /**
- * Tests if this string starts with the specified prefix.
- *
- * @param prefix the prefix.
- * @return <code>true</code> if the character sequence represented by the
- * argument is a prefix of the character sequence represented by
- * this string; <code>false</code> otherwise.
- * Note also that <code>true</code> will be returned if the
- * argument is an empty string or is equal to this
- * <code>String</code> object as determined by the
- * {@link #equals(Object)} method.
- * @exception java.lang.NullPointerException if <code>prefix</code> is
- * <code>null</code>.
- * @since JDK1. 0
- */
- public boolean startsWith(XMLString prefix)
- {
- return startsWith(prefix, 0);
- }
-
- /**
- * Returns the index within this string of the first occurrence of the
- * specified character. If a character with value <code>ch</code> occurs
- * in the character sequence represented by this <code>String</code>
- * object, then the index of the first such occurrence is returned --
- * that is, the smallest value <i>k</i> such that:
- * <blockquote><pre>
- * this.charAt(<i>k</i>) == ch
- * </pre></blockquote>
- * is <code>true</code>. If no such character occurs in this string,
- * then <code>-1</code> is returned.
- *
- * @param ch a character.
- * @return the index of the first occurrence of the character in the
- * character sequence represented by this object, or
- * <code>-1</code> if the character does not occur.
- */
- public int indexOf(int ch)
- {
- return indexOf(ch, 0);
- }
-
- /**
- * Returns the index within this string of the first occurrence of the
- * specified character, starting the search at the specified index.
- * <p>
- * If a character with value <code>ch</code> occurs in the character
- * sequence represented by this <code>String</code> object at an index
- * no smaller than <code>fromIndex</code>, then the index of the first
- * such occurrence is returned--that is, the smallest value <i>k</i>
- * such that:
- * <blockquote><pre>
- * (this.charAt(<i>k</i>) == ch) && (<i>k</i> >= fromIndex)
- * </pre></blockquote>
- * is true. If no such character occurs in this string at or after
- * position <code>fromIndex</code>, then <code>-1</code> is returned.
- * <p>
- * There is no restriction on the value of <code>fromIndex</code>. If it
- * is negative, it has the same effect as if it were zero: this entire
- * string may be searched. If it is greater than the length of this
- * string, it has the same effect as if it were equal to the length of
- * this string: <code>-1</code> is returned.
- *
- * @param ch a character.
- * @param fromIndex the index to start the search from.
- * @return the index of the first occurrence of the character in the
- * character sequence represented by this object that is greater
- * than or equal to <code>fromIndex</code>, or <code>-1</code>
- * if the character does not occur.
- */
- public int indexOf(int ch, int fromIndex)
- {
-
- int max = m_start + m_length;
- FastStringBuffer fsb = fsb();
-
- if (fromIndex < 0)
- {
- fromIndex = 0;
- }
- else if (fromIndex >= m_length)
- {
-
- // Note: fromIndex might be near -1>>>1.
- return -1;
- }
-
- for (int i = m_start + fromIndex; i < max; i++)
- {
- if (fsb.charAt(i) == ch)
- {
- return i - m_start;
- }
- }
-
- return -1;
- }
-
- /**
- * Returns a new string that is a substring of this string. The
- * substring begins with the character at the specified index and
- * extends to the end of this string. <p>
- * Examples:
- * <blockquote><pre>
- * "unhappy".substring(2) returns "happy"
- * "Harbison".substring(3) returns "bison"
- * "emptiness".substring(9) returns "" (an empty string)
- * </pre></blockquote>
- *
- * @param beginIndex the beginning index, inclusive.
- * @return the specified substring.
- * @exception IndexOutOfBoundsException if
- * <code>beginIndex</code> is negative or larger than the
- * length of this <code>String</code> object.
- */
- public XMLString substring(int beginIndex)
- {
-
- int len = m_length - beginIndex;
-
- if (len <= 0)
- return XString.EMPTYSTRING;
- else
- {
- int start = m_start + beginIndex;
-
- return new XStringForFSB(fsb(), start, len);
- }
- }
-
- /**
- * Returns a new string that is a substring of this string. The
- * substring begins at the specified <code>beginIndex</code> and
- * extends to the character at index <code>endIndex - 1</code>.
- * Thus the length of the substring is <code>endIndex-beginIndex</code>.
- *
- * @param beginIndex the beginning index, inclusive.
- * @param endIndex the ending index, exclusive.
- * @return the specified substring.
- * @exception IndexOutOfBoundsException if the
- * <code>beginIndex</code> is negative, or
- * <code>endIndex</code> is larger than the length of
- * this <code>String</code> object, or
- * <code>beginIndex</code> is larger than
- * <code>endIndex</code>.
- */
- public XMLString substring(int beginIndex, int endIndex)
- {
-
- int len = endIndex - beginIndex;
-
- if (len > m_length)
- len = m_length;
-
- if (len <= 0)
- return XString.EMPTYSTRING;
- else
- {
- int start = m_start + beginIndex;
-
- return new XStringForFSB(fsb(), start, len);
- }
- }
-
- /**
- * Concatenates the specified string to the end of this string.
- *
- * @param str the <code>String</code> that is concatenated to the end
- * of this <code>String</code>.
- * @return a string that represents the concatenation of this object's
- * characters followed by the string argument's characters.
- * @exception java.lang.NullPointerException if <code>str</code> is
- * <code>null</code>.
- */
- public XMLString concat(String str)
- {
-
- // %OPT% Make an FSB here?
- return new XString(str().concat(str));
- }
-
- /**
- * Removes white space from both ends of this string.
- *
- * @return this string, with white space removed from the front and end.
- */
- public XMLString trim()
- {
- return fixWhiteSpace(true, true, false);
- }
-
- /**
- * Returns whether the specified <var>ch</var> conforms to the XML 1.0 definition
- * of whitespace. Refer to <A href="http://www.w3.org/TR/1998/REC-xml-19980210#NT-S">
- * the definition of <CODE>S</CODE></A> for details.
- * @param ch Character to check as XML whitespace.
- * @return =true if <var>ch</var> is XML whitespace; otherwise =false.
- */
- private static boolean isSpace(char ch)
- {
- return XMLCharacterRecognizer.isWhiteSpace(ch); // Take the easy way out for now.
- }
-
- /**
- * Conditionally trim all leading and trailing whitespace in the specified String.
- * All strings of white space are
- * replaced by a single space character (#x20), except spaces after punctuation which
- * receive double spaces if doublePunctuationSpaces is true.
- * This function may be useful to a formatter, but to get first class
- * results, the formatter should probably do it's own white space handling
- * based on the semantics of the formatting object.
- *
- * @param trimHead Trim leading whitespace?
- * @param trimTail Trim trailing whitespace?
- * @param doublePunctuationSpaces Use double spaces for punctuation?
- * @return The trimmed string.
- */
- public XMLString fixWhiteSpace(boolean trimHead, boolean trimTail,
- boolean doublePunctuationSpaces)
- {
-
- int end = m_length + m_start;
- char[] buf = new char[m_length];
- FastStringBuffer fsb = fsb();
- boolean edit = false;
-
- /* replace S to ' '. and ' '+ -> single ' '. */
- int d = 0;
- boolean pres = false;
-
- for (int s = m_start; s < end; s++)
- {
- char c = fsb.charAt(s);
-
- if (isSpace(c))
- {
- if (!pres)
- {
- if (' ' != c)
- {
- edit = true;
- }
-
- buf[d++] = ' ';
-
- if (doublePunctuationSpaces && (d != 0))
- {
- char prevChar = buf[d - 1];
-
- if (!((prevChar == '.') || (prevChar == '!')
- || (prevChar == '?')))
- {
- pres = true;
- }
- }
- else
- {
- pres = true;
- }
- }
- else
- {
- edit = true;
- pres = true;
- }
- }
- else
- {
- buf[d++] = c;
- pres = false;
- }
- }
-
- if (trimTail && 1 <= d && ' ' == buf[d - 1])
- {
- edit = true;
-
- d--;
- }
-
- int start = 0;
-
- if (trimHead && 0 < d && ' ' == buf[0])
- {
- edit = true;
-
- start++;
- }
-
- XMLStringFactory xsf = XMLStringFactoryImpl.getFactory();
-
- return edit ? xsf.newstr(buf, start, d - start) : this;
- }
-
- /**
- * Convert a string to a double -- Allowed input is in fixed
- * notation ddd.fff.
- *
- * %OPT% CHECK PERFORMANCE against generating a Java String and
- * converting it to double. The advantage of running in native
- * machine code -- perhaps even microcode, on some systems -- may
- * more than make up for the cost of allocating and discarding the
- * additional object. We need to benchmark this.
- *
- * %OPT% More importantly, we need to decide whether we _care_ about
- * the performance of this operation. Does XString.toDouble constitute
- * any measurable percentage of our typical runtime? I suspect not!
- *
- * @return A double value representation of the string, or return Double.NaN
- * if the string can not be converted. */
- public double toDouble()
- {
- if(m_length == 0)
- return Double.NaN;
- int i;
- char c;
- String valueString = fsb().getString(m_start,m_length);
-
- // The following are permitted in the Double.valueOf, but not by the XPath spec:
- // - a plus sign
- // - The use of e or E to indicate exponents
- // - trailing f, F, d, or D
- // See function comments; not sure if this is slower than actually doing the
- // conversion ourselves (as was before).
-
- for (i=0;i<m_length;i++)
- if (!XMLCharacterRecognizer.isWhiteSpace(valueString.charAt(i)))
- break;
- if (i == m_length) return Double.NaN;
- if (valueString.charAt(i) == '-')
- i++;
- for (;i<m_length;i++) {
- c = valueString.charAt(i);
- if (c != '.' && (c < '0' || c > '9'))
- break;
- }
- for (;i<m_length;i++)
- if (!XMLCharacterRecognizer.isWhiteSpace(valueString.charAt(i)))
- break;
- if (i != m_length)
- return Double.NaN;
-
- try {
- return Double.parseDouble(valueString);
- } catch (NumberFormatException nfe) {
- // This should catch double periods, empty strings.
- return Double.NaN;
- }
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/objects/package.html b/src/com/sun/org/apache/xpath/internal/objects/package.html
deleted file mode 100644
index 07f2a32..0000000
--- a/src/com/sun/org/apache/xpath/internal/objects/package.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<!--
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
--->
-<!--
- * Copyright 2000-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
--->
-<!-- $Id: package.html,v 1.1.2.1 2005/08/01 01:29:30 jeffsuttor Exp $ -->
-<html>
- <title>XPath objects Package.</title>
- <body>
- <p>Implementation of XPath polymorphic type objects -- this package will grow
- as XPath objects are expanded to support XML Schema data types.<p>
- </body>
-</html>
-
-
diff --git a/src/com/sun/org/apache/xpath/internal/operations/And.java b/src/com/sun/org/apache/xpath/internal/operations/And.java
deleted file mode 100644
index f6fa0c8..0000000
--- a/src/com/sun/org/apache/xpath/internal/operations/And.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: And.java,v 1.2.4.1 2005/09/14 21:31:42 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.operations;
-
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XBoolean;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-/**
- * The 'and' operation expression executer.
- */
-public class And extends Operation
-{
- static final long serialVersionUID = 392330077126534022L;
-
- /**
- * AND two expressions and return the boolean result. Override
- * superclass method for optimization purposes.
- *
- * @param xctxt The runtime execution context.
- *
- * @return {@link com.sun.org.apache.xpath.internal.objects.XBoolean#S_TRUE} or
- * {@link com.sun.org.apache.xpath.internal.objects.XBoolean#S_FALSE}.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
- {
-
- XObject expr1 = m_left.execute(xctxt);
-
- if (expr1.bool())
- {
- XObject expr2 = m_right.execute(xctxt);
-
- return expr2.bool() ? XBoolean.S_TRUE : XBoolean.S_FALSE;
- }
- else
- return XBoolean.S_FALSE;
- }
-
- /**
- * Evaluate this operation directly to a boolean.
- *
- * @param xctxt The runtime execution context.
- *
- * @return The result of the operation as a boolean.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public boolean bool(XPathContext xctxt)
- throws javax.xml.transform.TransformerException
- {
- return (m_left.bool(xctxt) && m_right.bool(xctxt));
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/operations/Bool.java b/src/com/sun/org/apache/xpath/internal/operations/Bool.java
deleted file mode 100644
index fc65e5a..0000000
--- a/src/com/sun/org/apache/xpath/internal/operations/Bool.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Bool.java,v 1.2.4.1 2005/09/14 21:31:43 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.operations;
-
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XBoolean;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-/**
- * The 'boolean()' operation expression executer.
- */
-public class Bool extends UnaryOperation
-{
- static final long serialVersionUID = 44705375321914635L;
-
- /**
- * Apply the operation to two operands, and return the result.
- *
- *
- * @param right non-null reference to the evaluated right operand.
- *
- * @return non-null reference to the XObject that represents the result of the operation.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject operate(XObject right) throws javax.xml.transform.TransformerException
- {
-
- if (XObject.CLASS_BOOLEAN == right.getType())
- return right;
- else
- return right.bool() ? XBoolean.S_TRUE : XBoolean.S_FALSE;
- }
-
- /**
- * Evaluate this operation directly to a boolean.
- *
- * @param xctxt The runtime execution context.
- *
- * @return The result of the operation as a boolean.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public boolean bool(XPathContext xctxt)
- throws javax.xml.transform.TransformerException
- {
- return m_right.bool(xctxt);
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/operations/Div.java b/src/com/sun/org/apache/xpath/internal/operations/Div.java
deleted file mode 100644
index aa68598..0000000
--- a/src/com/sun/org/apache/xpath/internal/operations/Div.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Div.java,v 1.2.4.1 2005/09/14 21:31:45 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.operations;
-
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XNumber;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-/**
- * The 'div' operation expression executer.
- */
-public class Div extends Operation
-{
- static final long serialVersionUID = 6220756595959798135L;
-
- /**
- * Apply the operation to two operands, and return the result.
- *
- *
- * @param left non-null reference to the evaluated left operand.
- * @param right non-null reference to the evaluated right operand.
- *
- * @return non-null reference to the XObject that represents the result of the operation.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject operate(XObject left, XObject right)
- throws javax.xml.transform.TransformerException
- {
- return new XNumber(left.num() / right.num());
- }
-
- /**
- * Evaluate this operation directly to a double.
- *
- * @param xctxt The runtime execution context.
- *
- * @return The result of the operation as a double.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public double num(XPathContext xctxt)
- throws javax.xml.transform.TransformerException
- {
-
- return (m_left.num(xctxt) / m_right.num(xctxt));
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/operations/Equals.java b/src/com/sun/org/apache/xpath/internal/operations/Equals.java
deleted file mode 100644
index d8acef6..0000000
--- a/src/com/sun/org/apache/xpath/internal/operations/Equals.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Equals.java,v 1.2.4.1 2005/09/14 21:31:44 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.operations;
-
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XBoolean;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-/**
- * The '=' operation expression executer.
- */
-public class Equals extends Operation
-{
- static final long serialVersionUID = -2658315633903426134L;
-
- /**
- * Apply the operation to two operands, and return the result.
- *
- *
- * @param left non-null reference to the evaluated left operand.
- * @param right non-null reference to the evaluated right operand.
- *
- * @return non-null reference to the XObject that represents the result of the operation.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject operate(XObject left, XObject right)
- throws javax.xml.transform.TransformerException
- {
- return left.equals(right) ? XBoolean.S_TRUE : XBoolean.S_FALSE;
- }
-
- /**
- * Execute a binary operation by calling execute on each of the operands,
- * and then calling the operate method on the derived class.
- *
- *
- * @param xctxt The runtime execution context.
- *
- * @return The XObject result of the operation.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public boolean bool(XPathContext xctxt)
- throws javax.xml.transform.TransformerException
- {
- XObject left = m_left.execute(xctxt, true);
- XObject right = m_right.execute(xctxt, true);
-
- boolean result = left.equals(right) ? true : false;
- left.detach();
- right.detach();
- return result;
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/operations/Gt.java b/src/com/sun/org/apache/xpath/internal/operations/Gt.java
deleted file mode 100644
index b458d16..0000000
--- a/src/com/sun/org/apache/xpath/internal/operations/Gt.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Gt.java,v 1.2.4.1 2005/09/14 21:31:44 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.operations;
-
-import com.sun.org.apache.xpath.internal.objects.XBoolean;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-/**
- * The '>' operation expression executer.
- */
-public class Gt extends Operation
-{
- static final long serialVersionUID = 8927078751014375950L;
-
- /**
- * Apply the operation to two operands, and return the result.
- *
- *
- * @param left non-null reference to the evaluated left operand.
- * @param right non-null reference to the evaluated right operand.
- *
- * @return non-null reference to the XObject that represents the result of the operation.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject operate(XObject left, XObject right)
- throws javax.xml.transform.TransformerException
- {
- return left.greaterThan(right) ? XBoolean.S_TRUE : XBoolean.S_FALSE;
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/operations/Gte.java b/src/com/sun/org/apache/xpath/internal/operations/Gte.java
deleted file mode 100644
index 0f7b063..0000000
--- a/src/com/sun/org/apache/xpath/internal/operations/Gte.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Gte.java,v 1.2.4.1 2005/09/14 21:31:42 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.operations;
-
-import com.sun.org.apache.xpath.internal.objects.XBoolean;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-/**
- * The '>=' operation expression executer.
- */
-public class Gte extends Operation
-{
- static final long serialVersionUID = 9142945909906680220L;
-
- /**
- * Apply the operation to two operands, and return the result.
- *
- *
- * @param left non-null reference to the evaluated left operand.
- * @param right non-null reference to the evaluated right operand.
- *
- * @return non-null reference to the XObject that represents the result of the operation.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject operate(XObject left, XObject right)
- throws javax.xml.transform.TransformerException
- {
- return left.greaterThanOrEqual(right)
- ? XBoolean.S_TRUE : XBoolean.S_FALSE;
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/operations/Lt.java b/src/com/sun/org/apache/xpath/internal/operations/Lt.java
deleted file mode 100644
index fb28764..0000000
--- a/src/com/sun/org/apache/xpath/internal/operations/Lt.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Lt.java,v 1.2.4.1 2005/09/14 21:31:41 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.operations;
-
-import com.sun.org.apache.xpath.internal.objects.XBoolean;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-/**
- * The '<' operation expression executer.
- */
-public class Lt extends Operation
-{
- static final long serialVersionUID = 3388420509289359422L;
-
- /**
- * Apply the operation to two operands, and return the result.
- *
- *
- * @param left non-null reference to the evaluated left operand.
- * @param right non-null reference to the evaluated right operand.
- *
- * @return non-null reference to the XObject that represents the result of the operation.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject operate(XObject left, XObject right)
- throws javax.xml.transform.TransformerException
- {
- return left.lessThan(right) ? XBoolean.S_TRUE : XBoolean.S_FALSE;
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/operations/Lte.java b/src/com/sun/org/apache/xpath/internal/operations/Lte.java
deleted file mode 100644
index dd278e1..0000000
--- a/src/com/sun/org/apache/xpath/internal/operations/Lte.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Lte.java,v 1.2.4.1 2005/09/14 21:31:45 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.operations;
-
-import com.sun.org.apache.xpath.internal.objects.XBoolean;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-/**
- * The '<=' operation expression executer.
- */
-public class Lte extends Operation
-{
- static final long serialVersionUID = 6945650810527140228L;
-
- /**
- * Apply the operation to two operands, and return the result.
- *
- *
- * @param left non-null reference to the evaluated left operand.
- * @param right non-null reference to the evaluated right operand.
- *
- * @return non-null reference to the XObject that represents the result of the operation.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject operate(XObject left, XObject right)
- throws javax.xml.transform.TransformerException
- {
- return left.lessThanOrEqual(right) ? XBoolean.S_TRUE : XBoolean.S_FALSE;
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/operations/Minus.java b/src/com/sun/org/apache/xpath/internal/operations/Minus.java
deleted file mode 100644
index db404cd..0000000
--- a/src/com/sun/org/apache/xpath/internal/operations/Minus.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Minus.java,v 1.2.4.1 2005/09/14 21:31:44 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.operations;
-
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XNumber;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-/**
- * The binary '-' operation expression executer.
- */
-public class Minus extends Operation
-{
- static final long serialVersionUID = -5297672838170871043L;
-
- /**
- * Apply the operation to two operands, and return the result.
- *
- *
- * @param left non-null reference to the evaluated left operand.
- * @param right non-null reference to the evaluated right operand.
- *
- * @return non-null reference to the XObject that represents the
- * result of the operation.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject operate(XObject left, XObject right)
- throws javax.xml.transform.TransformerException
- {
- return new XNumber(left.num() - right.num());
- }
-
- /**
- * Evaluate this operation directly to a double.
- *
- * @param xctxt The runtime execution context.
- *
- * @return The result of the operation as a double.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public double num(XPathContext xctxt)
- throws javax.xml.transform.TransformerException
- {
-
- return (m_left.num(xctxt) - m_right.num(xctxt));
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/operations/Mod.java b/src/com/sun/org/apache/xpath/internal/operations/Mod.java
deleted file mode 100644
index f3a5d8b..0000000
--- a/src/com/sun/org/apache/xpath/internal/operations/Mod.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Mod.java,v 1.2.4.1 2005/09/14 21:31:45 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.operations;
-
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XNumber;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-/**
- * The 'mod' operation expression executer.
- */
-public class Mod extends Operation
-{
- static final long serialVersionUID = 5009471154238918201L;
-
- /**
- * Apply the operation to two operands, and return the result.
- *
- *
- * @param left non-null reference to the evaluated left operand.
- * @param right non-null reference to the evaluated right operand.
- *
- * @return non-null reference to the XObject that represents the result of the operation.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject operate(XObject left, XObject right)
- throws javax.xml.transform.TransformerException
- {
- return new XNumber(left.num() % right.num());
- }
-
- /**
- * Evaluate this operation directly to a double.
- *
- * @param xctxt The runtime execution context.
- *
- * @return The result of the operation as a double.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public double num(XPathContext xctxt)
- throws javax.xml.transform.TransformerException
- {
-
- return (m_left.num(xctxt) % m_right.num(xctxt));
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/operations/Mult.java b/src/com/sun/org/apache/xpath/internal/operations/Mult.java
deleted file mode 100644
index b9e4c2b..0000000
--- a/src/com/sun/org/apache/xpath/internal/operations/Mult.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Mult.java,v 1.2.4.1 2005/09/14 21:31:46 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.operations;
-
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XNumber;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-/**
- * The '*' operation expression executer.
- */
-public class Mult extends Operation
-{
- static final long serialVersionUID = -4956770147013414675L;
-
- /**
- * Apply the operation to two operands, and return the result.
- *
- *
- * @param left non-null reference to the evaluated left operand.
- * @param right non-null reference to the evaluated right operand.
- *
- * @return non-null reference to the XObject that represents the result of the operation.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject operate(XObject left, XObject right)
- throws javax.xml.transform.TransformerException
- {
- return new XNumber(left.num() * right.num());
- }
-
- /**
- * Evaluate this operation directly to a double.
- *
- * @param xctxt The runtime execution context.
- *
- * @return The result of the operation as a double.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public double num(XPathContext xctxt)
- throws javax.xml.transform.TransformerException
- {
- return (m_left.num(xctxt) * m_right.num(xctxt));
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/operations/Neg.java b/src/com/sun/org/apache/xpath/internal/operations/Neg.java
deleted file mode 100644
index df4c06e..0000000
--- a/src/com/sun/org/apache/xpath/internal/operations/Neg.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Neg.java,v 1.2.4.1 2005/09/14 21:31:45 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.operations;
-
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XNumber;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-/**
- * The unary '-' operation expression executer.
- */
-public class Neg extends UnaryOperation
-{
- static final long serialVersionUID = -6280607702375702291L;
-
- /**
- * Apply the operation to two operands, and return the result.
- *
- *
- * @param right non-null reference to the evaluated right operand.
- *
- * @return non-null reference to the XObject that represents the result of the operation.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject operate(XObject right) throws javax.xml.transform.TransformerException
- {
- return new XNumber(-right.num());
- }
-
- /**
- * Evaluate this operation directly to a double.
- *
- * @param xctxt The runtime execution context.
- *
- * @return The result of the operation as a double.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public double num(XPathContext xctxt)
- throws javax.xml.transform.TransformerException
- {
-
- return -(m_right.num(xctxt));
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/operations/NotEquals.java b/src/com/sun/org/apache/xpath/internal/operations/NotEquals.java
deleted file mode 100644
index 1880803..0000000
--- a/src/com/sun/org/apache/xpath/internal/operations/NotEquals.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: NotEquals.java,v 1.2.4.1 2005/09/14 21:31:44 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.operations;
-
-import com.sun.org.apache.xpath.internal.objects.XBoolean;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-/**
- * The '!=' operation expression executer.
- */
-public class NotEquals extends Operation
-{
- static final long serialVersionUID = -7869072863070586900L;
-
- /**
- * Apply the operation to two operands, and return the result.
- *
- *
- * @param left non-null reference to the evaluated left operand.
- * @param right non-null reference to the evaluated right operand.
- *
- * @return non-null reference to the XObject that represents the result of the operation.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject operate(XObject left, XObject right)
- throws javax.xml.transform.TransformerException
- {
- return (left.notEquals(right)) ? XBoolean.S_TRUE : XBoolean.S_FALSE;
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/operations/Number.java b/src/com/sun/org/apache/xpath/internal/operations/Number.java
deleted file mode 100644
index 244a1db..0000000
--- a/src/com/sun/org/apache/xpath/internal/operations/Number.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Number.java,v 1.2.4.1 2005/09/14 21:31:42 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.operations;
-
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XNumber;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-/**
- * The 'number()' operation expression executer.
- */
-public class Number extends UnaryOperation
-{
- static final long serialVersionUID = 7196954482871619765L;
-
- /**
- * Apply the operation to two operands, and return the result.
- *
- *
- * @param right non-null reference to the evaluated right operand.
- *
- * @return non-null reference to the XObject that represents the result of the operation.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject operate(XObject right) throws javax.xml.transform.TransformerException
- {
-
- if (XObject.CLASS_NUMBER == right.getType())
- return right;
- else
- return new XNumber(right.num());
- }
-
- /**
- * Evaluate this operation directly to a double.
- *
- * @param xctxt The runtime execution context.
- *
- * @return The result of the operation as a double.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public double num(XPathContext xctxt)
- throws javax.xml.transform.TransformerException
- {
-
- return m_right.num(xctxt);
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/operations/Operation.java b/src/com/sun/org/apache/xpath/internal/operations/Operation.java
deleted file mode 100644
index 84bdd32..0000000
--- a/src/com/sun/org/apache/xpath/internal/operations/Operation.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Operation.java,v 1.2.4.1 2005/09/14 21:31:42 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.operations;
-
-import com.sun.org.apache.xpath.internal.Expression;
-import com.sun.org.apache.xpath.internal.ExpressionOwner;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.XPathVisitor;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-/**
- * The baseclass for a binary operation.
- */
-public class Operation extends Expression implements ExpressionOwner
-{
- static final long serialVersionUID = -3037139537171050430L;
-
- /** The left operand expression.
- * @serial */
- protected Expression m_left;
-
- /** The right operand expression.
- * @serial */
- protected Expression m_right;
-
- /**
- * This function is used to fixup variables from QNames to stack frame
- * indexes at stylesheet build time.
- * @param vars List of QNames that correspond to variables. This list
- * should be searched backwards for the first qualified name that
- * corresponds to the variable reference qname. The position of the
- * QName in the vector from the start of the vector will be its position
- * in the stack frame (but variables above the globalsTop value will need
- * to be offset to the current stack frame).
- */
- public void fixupVariables(java.util.Vector vars, int globalsSize)
- {
- m_left.fixupVariables(vars, globalsSize);
- m_right.fixupVariables(vars, globalsSize);
- }
-
-
- /**
- * Tell if this expression or it's subexpressions can traverse outside
- * the current subtree.
- *
- * @return true if traversal outside the context node's subtree can occur.
- */
- public boolean canTraverseOutsideSubtree()
- {
-
- if (null != m_left && m_left.canTraverseOutsideSubtree())
- return true;
-
- if (null != m_right && m_right.canTraverseOutsideSubtree())
- return true;
-
- return false;
- }
-
- /**
- * Set the left and right operand expressions for this operation.
- *
- *
- * @param l The left expression operand.
- * @param r The right expression operand.
- */
- public void setLeftRight(Expression l, Expression r)
- {
- m_left = l;
- m_right = r;
- l.exprSetParent(this);
- r.exprSetParent(this);
- }
-
- /**
- * Execute a binary operation by calling execute on each of the operands,
- * and then calling the operate method on the derived class.
- *
- *
- * @param xctxt The runtime execution context.
- *
- * @return The XObject result of the operation.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt)
- throws javax.xml.transform.TransformerException
- {
-
- XObject left = m_left.execute(xctxt, true);
- XObject right = m_right.execute(xctxt, true);
-
- XObject result = operate(left, right);
- left.detach();
- right.detach();
- return result;
- }
-
- /**
- * Apply the operation to two operands, and return the result.
- *
- *
- * @param left non-null reference to the evaluated left operand.
- * @param right non-null reference to the evaluated right operand.
- *
- * @return non-null reference to the XObject that represents the result of the operation.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject operate(XObject left, XObject right)
- throws javax.xml.transform.TransformerException
- {
- return null; // no-op
- }
-
- /** @return the left operand of binary operation, as an Expression.
- */
- public Expression getLeftOperand(){
- return m_left;
- }
-
- /** @return the right operand of binary operation, as an Expression.
- */
- public Expression getRightOperand(){
- return m_right;
- }
-
- class LeftExprOwner implements ExpressionOwner
- {
- /**
- * @see ExpressionOwner#getExpression()
- */
- public Expression getExpression()
- {
- return m_left;
- }
-
- /**
- * @see ExpressionOwner#setExpression(Expression)
- */
- public void setExpression(Expression exp)
- {
- exp.exprSetParent(Operation.this);
- m_left = exp;
- }
- }
-
- /**
- * @see com.sun.org.apache.xpath.internal.XPathVisitable#callVisitors(ExpressionOwner, XPathVisitor)
- */
- public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)
- {
- if(visitor.visitBinaryOperation(owner, this))
- {
- m_left.callVisitors(new LeftExprOwner(), visitor);
- m_right.callVisitors(this, visitor);
- }
- }
-
- /**
- * @see ExpressionOwner#getExpression()
- */
- public Expression getExpression()
- {
- return m_right;
- }
-
- /**
- * @see ExpressionOwner#setExpression(Expression)
- */
- public void setExpression(Expression exp)
- {
- exp.exprSetParent(this);
- m_right = exp;
- }
-
- /**
- * @see Expression#deepEquals(Expression)
- */
- public boolean deepEquals(Expression expr)
- {
- if(!isSameClass(expr))
- return false;
-
- if(!m_left.deepEquals(((Operation)expr).m_left))
- return false;
-
- if(!m_right.deepEquals(((Operation)expr).m_right))
- return false;
-
- return true;
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/operations/Or.java b/src/com/sun/org/apache/xpath/internal/operations/Or.java
deleted file mode 100644
index 26e5b82..0000000
--- a/src/com/sun/org/apache/xpath/internal/operations/Or.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Or.java,v 1.2.4.1 2005/09/14 21:31:41 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.operations;
-
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XBoolean;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-/**
- * The 'or' operation expression executer.
- */
-public class Or extends Operation
-{
- static final long serialVersionUID = -644107191353853079L;
-
- /**
- * OR two expressions and return the boolean result. Override
- * superclass method for optimization purposes.
- *
- * @param xctxt The runtime execution context.
- *
- * @return {@link com.sun.org.apache.xpath.internal.objects.XBoolean#S_TRUE} or
- * {@link com.sun.org.apache.xpath.internal.objects.XBoolean#S_FALSE}.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
- {
-
- XObject expr1 = m_left.execute(xctxt);
-
- if (!expr1.bool())
- {
- XObject expr2 = m_right.execute(xctxt);
-
- return expr2.bool() ? XBoolean.S_TRUE : XBoolean.S_FALSE;
- }
- else
- return XBoolean.S_TRUE;
- }
-
- /**
- * Evaluate this operation directly to a boolean.
- *
- * @param xctxt The runtime execution context.
- *
- * @return The result of the operation as a boolean.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public boolean bool(XPathContext xctxt)
- throws javax.xml.transform.TransformerException
- {
- return (m_left.bool(xctxt) || m_right.bool(xctxt));
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/operations/Plus.java b/src/com/sun/org/apache/xpath/internal/operations/Plus.java
deleted file mode 100644
index e5b9853..0000000
--- a/src/com/sun/org/apache/xpath/internal/operations/Plus.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Plus.java,v 1.2.4.1 2005/09/14 21:31:43 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.operations;
-
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XNumber;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-/**
- * The '+' operation expression executer.
- */
-public class Plus extends Operation
-{
- static final long serialVersionUID = -4492072861616504256L;
-
- /**
- * Apply the operation to two operands, and return the result.
- *
- *
- * @param left non-null reference to the evaluated left operand.
- * @param right non-null reference to the evaluated right operand.
- *
- * @return non-null reference to the XObject that represents the result of the operation.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject operate(XObject left, XObject right)
- throws javax.xml.transform.TransformerException
- {
- return new XNumber(left.num() + right.num());
- }
-
- /**
- * Evaluate this operation directly to a double.
- *
- * @param xctxt The runtime execution context.
- *
- * @return The result of the operation as a double.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public double num(XPathContext xctxt)
- throws javax.xml.transform.TransformerException
- {
-
- return (m_right.num(xctxt) + m_left.num(xctxt));
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/operations/Quo.java b/src/com/sun/org/apache/xpath/internal/operations/Quo.java
deleted file mode 100644
index db6b882..0000000
--- a/src/com/sun/org/apache/xpath/internal/operations/Quo.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Quo.java,v 1.2.4.2 2005/09/14 21:31:44 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.operations;
-
-import com.sun.org.apache.xpath.internal.objects.XNumber;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-/**
- * The 'quo' operation expression executer. (no longer supported by XPath).
- * @deprecated
- */
-public class Quo extends Operation
-{
- static final long serialVersionUID = 693765299196169905L;
-
- // Actually, this is no longer supported by xpath...
-
- /**
- * Apply the operation to two operands, and return the result.
- *
- *
- * @param left non-null reference to the evaluated left operand.
- * @param right non-null reference to the evaluated right operand.
- *
- * @return non-null reference to the XObject that represents the result of the operation.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject operate(XObject left, XObject right)
- throws javax.xml.transform.TransformerException
- {
- return new XNumber((int) (left.num() / right.num()));
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/operations/String.java b/src/com/sun/org/apache/xpath/internal/operations/String.java
deleted file mode 100644
index 03714be..0000000
--- a/src/com/sun/org/apache/xpath/internal/operations/String.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: String.java,v 1.2.4.1 2005/09/14 21:31:44 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.operations;
-
-import com.sun.org.apache.xpath.internal.objects.XObject;
-import com.sun.org.apache.xpath.internal.objects.XString;
-
-/**
- * The 'string()' operation expression executer.
- */
-public class String extends UnaryOperation
-{
- static final long serialVersionUID = 2973374377453022888L;
-
- /**
- * Apply the operation to two operands, and return the result.
- *
- *
- * @param right non-null reference to the evaluated right operand.
- *
- * @return non-null reference to the XObject that represents the result of the operation.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject operate(XObject right) throws javax.xml.transform.TransformerException
- {
- return (XString)right.xstr(); // semi-safe cast.
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/operations/UnaryOperation.java b/src/com/sun/org/apache/xpath/internal/operations/UnaryOperation.java
deleted file mode 100644
index fd066a3..0000000
--- a/src/com/sun/org/apache/xpath/internal/operations/UnaryOperation.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: UnaryOperation.java,v 1.2.4.1 2005/09/14 21:31:44 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.operations;
-
-import com.sun.org.apache.xpath.internal.Expression;
-import com.sun.org.apache.xpath.internal.ExpressionOwner;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.XPathVisitor;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-/**
- * The unary operation base class.
- */
-public abstract class UnaryOperation extends Expression implements ExpressionOwner
-{
- static final long serialVersionUID = 6536083808424286166L;
-
- /** The operand for the operation.
- * @serial */
- protected Expression m_right;
-
- /**
- * This function is used to fixup variables from QNames to stack frame
- * indexes at stylesheet build time.
- * @param vars List of QNames that correspond to variables. This list
- * should be searched backwards for the first qualified name that
- * corresponds to the variable reference qname. The position of the
- * QName in the vector from the start of the vector will be its position
- * in the stack frame (but variables above the globalsTop value will need
- * to be offset to the current stack frame).
- */
- public void fixupVariables(java.util.Vector vars, int globalsSize)
- {
- m_right.fixupVariables(vars, globalsSize);
- }
-
- /**
- * Tell if this expression or it's subexpressions can traverse outside
- * the current subtree.
- *
- * @return true if traversal outside the context node's subtree can occur.
- */
- public boolean canTraverseOutsideSubtree()
- {
-
- if (null != m_right && m_right.canTraverseOutsideSubtree())
- return true;
-
- return false;
- }
-
- /**
- * Set the expression operand for the operation.
- *
- *
- * @param r The expression operand to which the unary operation will be
- * applied.
- */
- public void setRight(Expression r)
- {
- m_right = r;
- r.exprSetParent(this);
- }
-
- /**
- * Execute the operand and apply the unary operation to the result.
- *
- *
- * @param xctxt The runtime execution context.
- *
- * @return An XObject that represents the result of applying the unary
- * operation to the evaluated operand.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
- {
-
- return operate(m_right.execute(xctxt));
- }
-
- /**
- * Apply the operation to two operands, and return the result.
- *
- *
- * @param right non-null reference to the evaluated right operand.
- *
- * @return non-null reference to the XObject that represents the result of the operation.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public abstract XObject operate(XObject right)
- throws javax.xml.transform.TransformerException;
-
- /** @return the operand of unary operation, as an Expression.
- */
- public Expression getOperand(){
- return m_right;
- }
-
- /**
- * @see com.sun.org.apache.xpath.internal.XPathVisitable#callVisitors(ExpressionOwner, XPathVisitor)
- */
- public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)
- {
- if(visitor.visitUnaryOperation(owner, this))
- {
- m_right.callVisitors(this, visitor);
- }
- }
-
-
- /**
- * @see ExpressionOwner#getExpression()
- */
- public Expression getExpression()
- {
- return m_right;
- }
-
- /**
- * @see ExpressionOwner#setExpression(Expression)
- */
- public void setExpression(Expression exp)
- {
- exp.exprSetParent(this);
- m_right = exp;
- }
-
- /**
- * @see Expression#deepEquals(Expression)
- */
- public boolean deepEquals(Expression expr)
- {
- if(!isSameClass(expr))
- return false;
-
- if(!m_right.deepEquals(((UnaryOperation)expr).m_right))
- return false;
-
- return true;
- }
-
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/operations/Variable.java b/src/com/sun/org/apache/xpath/internal/operations/Variable.java
deleted file mode 100644
index 78554b7..0000000
--- a/src/com/sun/org/apache/xpath/internal/operations/Variable.java
+++ /dev/null
@@ -1,399 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Variable.java,v 1.2.4.1 2005/09/14 21:24:33 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.operations;
-
-import javax.xml.transform.TransformerException;
-
-import com.sun.org.apache.xalan.internal.res.XSLMessages;
-import com.sun.org.apache.xml.internal.utils.QName;
-import com.sun.org.apache.xpath.internal.Expression;
-import com.sun.org.apache.xpath.internal.ExpressionOwner;
-import com.sun.org.apache.xpath.internal.XPath;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.XPathVisitor;
-import com.sun.org.apache.xpath.internal.axes.PathComponent;
-import com.sun.org.apache.xpath.internal.axes.WalkerFactory;
-import com.sun.org.apache.xpath.internal.objects.XNodeSet;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
-
-
-/**
- * The variable reference expression executer.
- */
-public class Variable extends Expression implements PathComponent
-{
- static final long serialVersionUID = -4334975375609297049L;
- /** Tell if fixupVariables was called.
- * @serial */
- private boolean m_fixUpWasCalled = false;
-
- /** The qualified name of the variable.
- * @serial */
- protected QName m_qname;
-
- /**
- * The index of the variable, which is either an absolute index to a
- * global, or, if higher than the globals area, must be adjusted by adding
- * the offset to the current stack frame.
- */
- protected int m_index;
-
- /**
- * Set the index for the variable into the stack. For advanced use only. You
- * must know what you are doing to use this.
- *
- * @param index a global or local index.
- */
- public void setIndex(int index)
- {
- m_index = index;
- }
-
- /**
- * Set the index for the variable into the stack. For advanced use only.
- *
- * @return index a global or local index.
- */
- public int getIndex()
- {
- return m_index;
- }
-
- /**
- * Set whether or not this is a global reference. For advanced use only.
- *
- * @param isGlobal true if this should be a global variable reference.
- */
- public void setIsGlobal(boolean isGlobal)
- {
- m_isGlobal = isGlobal;
- }
-
- /**
- * Set the index for the variable into the stack. For advanced use only.
- *
- * @return true if this should be a global variable reference.
- */
- public boolean getGlobal()
- {
- return m_isGlobal;
- }
-
-
-
-
-
- protected boolean m_isGlobal = false;
-
- /**
- * This function is used to fixup variables from QNames to stack frame
- * indexes at stylesheet build time.
- * @param vars List of QNames that correspond to variables. This list
- * should be searched backwards for the first qualified name that
- * corresponds to the variable reference qname. The position of the
- * QName in the vector from the start of the vector will be its position
- * in the stack frame (but variables above the globalsTop value will need
- * to be offset to the current stack frame).
- */
- public void fixupVariables(java.util.Vector vars, int globalsSize)
- {
- m_fixUpWasCalled = true;
- int sz = vars.size();
-
- for (int i = vars.size()-1; i >= 0; i--)
- {
- QName qn = (QName)vars.elementAt(i);
- // System.out.println("qn: "+qn);
- if(qn.equals(m_qname))
- {
-
- if(i < globalsSize)
- {
- m_isGlobal = true;
- m_index = i;
- }
- else
- {
- m_index = i-globalsSize;
- }
-
- return;
- }
- }
-
- java.lang.String msg = XSLMessages.createXPATHMessage(XPATHErrorResources.ER_COULD_NOT_FIND_VAR,
- new Object[]{m_qname.toString()});
-
- TransformerException te = new TransformerException(msg, this);
-
- throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(te);
-
- }
-
-
- /**
- * Set the qualified name of the variable.
- *
- * @param qname Must be a non-null reference to a qualified name.
- */
- public void setQName(QName qname)
- {
- m_qname = qname;
- }
-
- /**
- * Get the qualified name of the variable.
- *
- * @return A non-null reference to a qualified name.
- */
- public QName getQName()
- {
- return m_qname;
- }
-
- /**
- * Execute an expression in the XPath runtime context, and return the
- * result of the expression.
- *
- *
- * @param xctxt The XPath runtime context.
- *
- * @return The result of the expression in the form of a <code>XObject</code>.
- *
- * @throws javax.xml.transform.TransformerException if a runtime exception
- * occurs.
- */
- public XObject execute(XPathContext xctxt)
- throws javax.xml.transform.TransformerException
- {
- return execute(xctxt, false);
- }
-
-
- /**
- * Dereference the variable, and return the reference value. Note that lazy
- * evaluation will occur. If a variable within scope is not found, a warning
- * will be sent to the error listener, and an empty nodeset will be returned.
- *
- *
- * @param xctxt The runtime execution context.
- *
- * @return The evaluated variable, or an empty nodeset if not found.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt, boolean destructiveOK) throws javax.xml.transform.TransformerException
- {
- com.sun.org.apache.xml.internal.utils.PrefixResolver xprefixResolver = xctxt.getNamespaceContext();
-
- XObject result;
- // Is the variable fetched always the same?
- // XObject result = xctxt.getVariable(m_qname);
- if(m_fixUpWasCalled)
- {
- if(m_isGlobal)
- result = xctxt.getVarStack().getGlobalVariable(xctxt, m_index, destructiveOK);
- else
- result = xctxt.getVarStack().getLocalVariable(xctxt, m_index, destructiveOK);
- }
- else {
- result = xctxt.getVarStack().getVariableOrParam(xctxt,m_qname);
- }
-
- if (null == result)
- {
- // This should now never happen...
- warn(xctxt, XPATHErrorResources.WG_ILLEGAL_VARIABLE_REFERENCE,
- new Object[]{ m_qname.getLocalPart() }); //"VariableReference given for variable out "+
- // (new RuntimeException()).printStackTrace();
- // error(xctxt, XPATHErrorResources.ER_COULDNOT_GET_VAR_NAMED,
- // new Object[]{ m_qname.getLocalPart() }); //"Could not get variable named "+varName);
-
- result = new XNodeSet(xctxt.getDTMManager());
- }
-
- return result;
-// }
-// else
-// {
-// // Hack city... big time. This is needed to evaluate xpaths from extensions,
-// // pending some bright light going off in my head. Some sort of callback?
-// synchronized(this)
-// {
-// com.sun.org.apache.xalan.internal.templates.ElemVariable vvar= getElemVariable();
-// if(null != vvar)
-// {
-// m_index = vvar.getIndex();
-// m_isGlobal = vvar.getIsTopLevel();
-// m_fixUpWasCalled = true;
-// return execute(xctxt);
-// }
-// }
-// throw new javax.xml.transform.TransformerException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_VAR_NOT_RESOLVABLE, new Object[]{m_qname.toString()})); //"Variable not resolvable: "+m_qname);
-// }
- }
-
- /**
- * Get the XSLT ElemVariable that this sub-expression references. In order for
- * this to work, the SourceLocator must be the owning ElemTemplateElement.
- * @return The dereference to the ElemVariable, or null if not found.
- */
- // J2SE does not support Xalan interpretive
- /*
- public com.sun.org.apache.xalan.internal.templates.ElemVariable getElemVariable()
- {
-
- // Get the current ElemTemplateElement, and then walk backwards in
- // document order, searching
- // for an xsl:param element or xsl:variable element that matches our
- // qname. If we reach the top level, use the StylesheetRoot's composed
- // list of top level variables and parameters.
-
- com.sun.org.apache.xalan.internal.templates.ElemVariable vvar = null;
- com.sun.org.apache.xpath.internal.ExpressionNode owner = getExpressionOwner();
-
- if (null != owner && owner instanceof com.sun.org.apache.xalan.internal.templates.ElemTemplateElement)
- {
-
- com.sun.org.apache.xalan.internal.templates.ElemTemplateElement prev =
- (com.sun.org.apache.xalan.internal.templates.ElemTemplateElement) owner;
-
- if (!(prev instanceof com.sun.org.apache.xalan.internal.templates.Stylesheet))
- {
- while ( prev != null && !(prev.getParentNode() instanceof com.sun.org.apache.xalan.internal.templates.Stylesheet) )
- {
- com.sun.org.apache.xalan.internal.templates.ElemTemplateElement savedprev = prev;
-
- while (null != (prev = prev.getPreviousSiblingElem()))
- {
- if(prev instanceof com.sun.org.apache.xalan.internal.templates.ElemVariable)
- {
- vvar = (com.sun.org.apache.xalan.internal.templates.ElemVariable) prev;
-
- if (vvar.getName().equals(m_qname))
- {
- return vvar;
- }
- vvar = null;
- }
- }
- prev = savedprev.getParentElem();
- }
- }
- if (prev != null)
- vvar = prev.getStylesheetRoot().getVariableOrParamComposed(m_qname);
- }
- return vvar;
-
- }
- */
- /**
- * Tell if this expression returns a stable number that will not change during
- * iterations within the expression. This is used to determine if a proximity
- * position predicate can indicate that no more searching has to occur.
- *
- *
- * @return true if the expression represents a stable number.
- */
- public boolean isStableNumber()
- {
- return true;
- }
-
- /**
- * Get the analysis bits for this walker, as defined in the WalkerFactory.
- * @return One of WalkerFactory#BIT_DESCENDANT, etc.
- */
- public int getAnalysisBits()
- {
-
- // J2SE does not support Xalan interpretive
- /*
- com.sun.org.apache.xalan.internal.templates.ElemVariable vvar = getElemVariable();
- if(null != vvar)
- {
- XPath xpath = vvar.getSelect();
- if(null != xpath)
- {
- Expression expr = xpath.getExpression();
- if(null != expr && expr instanceof PathComponent)
- {
- return ((PathComponent)expr).getAnalysisBits();
- }
- }
- }
- */
-
- return WalkerFactory.BIT_FILTER;
- }
-
-
- /**
- * @see com.sun.org.apache.xpath.internal.XPathVisitable#callVisitors(ExpressionOwner, XPathVisitor)
- */
- public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)
- {
- visitor.visitVariableRef(owner, this);
- }
- /**
- * @see Expression#deepEquals(Expression)
- */
- public boolean deepEquals(Expression expr)
- {
- if(!isSameClass(expr))
- return false;
-
- if(!m_qname.equals(((Variable)expr).m_qname))
- return false;
-
- // J2SE does not support Xalan interpretive
- /*
- // We have to make sure that the qname really references
- // the same variable element.
- if(getElemVariable() != ((Variable)expr).getElemVariable())
- return false;
- */
-
- return true;
- }
-
- static final java.lang.String PSUEDOVARNAMESPACE = "http://xml.apache.org/xalan/psuedovar";
-
- /**
- * Tell if this is a psuedo variable reference, declared by Xalan instead
- * of by the user.
- */
- public boolean isPsuedoVarRef()
- {
- java.lang.String ns = m_qname.getNamespaceURI();
- if((null != ns) && ns.equals(PSUEDOVARNAMESPACE))
- {
- if(m_qname.getLocalName().startsWith("#"))
- return true;
- }
- return false;
- }
-
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/operations/VariableSafeAbsRef.java b/src/com/sun/org/apache/xpath/internal/operations/VariableSafeAbsRef.java
deleted file mode 100644
index d85978d..0000000
--- a/src/com/sun/org/apache/xpath/internal/operations/VariableSafeAbsRef.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: VariableSafeAbsRef.java,v 1.2.4.1 2005/09/14 21:31:45 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.operations;
-
-import com.sun.org.apache.xml.internal.dtm.DTMManager;
-import com.sun.org.apache.xpath.internal.Expression;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.objects.XNodeSet;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-
-/**
- * This is a "smart" variable reference that is used in situations where
- * an absolute path is optimized into a variable reference, but may
- * be used in some situations where the document context may have changed.
- * For instance, in select="document(doc/@href)//name[//salary &gt; 7250]", the
- * root in the predicate will be different for each node in the set. While
- * this is easy to detect statically in this case, in other cases static
- * detection would be very hard or impossible. So, this class does a dynamic check
- * to make sure the document context of the referenced variable is the same as
- * the current document context, and, if it is not, execute the referenced variable's
- * expression with the current context instead.
- */
-public class VariableSafeAbsRef extends Variable
-{
- static final long serialVersionUID = -9174661990819967452L;
-
- /**
- * Dereference the variable, and return the reference value. Note that lazy
- * evaluation will occur. If a variable within scope is not found, a warning
- * will be sent to the error listener, and an empty nodeset will be returned.
- *
- *
- * @param xctxt The runtime execution context.
- *
- * @return The evaluated variable, or an empty nodeset if not found.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt, boolean destructiveOK)
- throws javax.xml.transform.TransformerException
- {
- XNodeSet xns = (XNodeSet)super.execute(xctxt, destructiveOK);
- DTMManager dtmMgr = xctxt.getDTMManager();
- int context = xctxt.getContextNode();
- if(dtmMgr.getDTM(xns.getRoot()).getDocument() !=
- dtmMgr.getDTM(context).getDocument())
- {
- Expression expr = (Expression)xns.getContainedIter();
- xns = (XNodeSet)expr.asIterator(xctxt, context);
- }
- return xns;
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/operations/package.html b/src/com/sun/org/apache/xpath/internal/operations/package.html
deleted file mode 100644
index 2fe8924..0000000
--- a/src/com/sun/org/apache/xpath/internal/operations/package.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!--
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
--->
-<!--
- * Copyright 2000-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
--->
-<!-- $Id: package.html,v 1.1.2.1 2005/08/01 01:30:07 jeffsuttor Exp $ -->
-<html>
- <title>Xalan XPath operations.</title>
- <body>
- <p>Support for XPath operations, such as +, -, string(), etc.<p>
- </body>
-</html>
-
-
diff --git a/src/com/sun/org/apache/xpath/internal/package.html b/src/com/sun/org/apache/xpath/internal/package.html
deleted file mode 100644
index 54e1c15..0000000
--- a/src/com/sun/org/apache/xpath/internal/package.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<!--
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
--->
-<!--
- * Copyright 2000-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
--->
-<!-- $Id: package.html,v 1.1.2.1 2005/08/01 01:30:14 jeffsuttor Exp $ -->
-<html>
- <title>XPath support Package.</title>
- <body>
- <p>Implementation of XPath; for the most part, only classes meant for public use are
- found at this root level of the XPath packages.<p>
- </body>
-</html>
-
-
diff --git a/src/com/sun/org/apache/xpath/internal/patterns/ContextMatchStepPattern.java b/src/com/sun/org/apache/xpath/internal/patterns/ContextMatchStepPattern.java
deleted file mode 100644
index f57f722..0000000
--- a/src/com/sun/org/apache/xpath/internal/patterns/ContextMatchStepPattern.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: ContextMatchStepPattern.java,v 1.2.4.2 2005/09/15 00:21:15 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.patterns;
-
-import com.sun.org.apache.xml.internal.dtm.Axis;
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMAxisTraverser;
-import com.sun.org.apache.xml.internal.dtm.DTMFilter;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.axes.WalkerFactory;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-/**
- * Special context node pattern matcher.
- */
-public class ContextMatchStepPattern extends StepPattern
-{
- static final long serialVersionUID = -1888092779313211942L;
-
- /**
- * Construct a ContextMatchStepPattern.
- *
- */
- public ContextMatchStepPattern(int axis, int paxis)
- {
- super(DTMFilter.SHOW_ALL, axis, paxis);
- }
-
- /**
- * Execute this pattern step, including predicates.
- *
- *
- * @param xctxt XPath runtime context.
- *
- * @return {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NODETEST},
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NONE},
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NSWILD},
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_QNAME}, or
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_OTHER}.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt)
- throws javax.xml.transform.TransformerException
- {
-
- if (xctxt.getIteratorRoot() == xctxt.getCurrentNode())
- return getStaticScore();
- else
- return this.SCORE_NONE;
- }
-
- /**
- * Execute the match pattern step relative to another step.
- *
- *
- * @param xctxt The XPath runtime context.
- * NEEDSDOC @param prevStep
- *
- * @return {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NODETEST},
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NONE},
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NSWILD},
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_QNAME}, or
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_OTHER}.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject executeRelativePathPattern(
- XPathContext xctxt, StepPattern prevStep)
- throws javax.xml.transform.TransformerException
- {
-
- XObject score = NodeTest.SCORE_NONE;
- int context = xctxt.getCurrentNode();
- DTM dtm = xctxt.getDTM(context);
-
- if (null != dtm)
- {
- int predContext = xctxt.getCurrentNode();
- DTMAxisTraverser traverser;
-
- int axis = m_axis;
-
- boolean needToTraverseAttrs = WalkerFactory.isDownwardAxisOfMany(axis);
- boolean iterRootIsAttr = (dtm.getNodeType(xctxt.getIteratorRoot())
- == DTM.ATTRIBUTE_NODE);
-
- if((Axis.PRECEDING == axis) && iterRootIsAttr)
- {
- axis = Axis.PRECEDINGANDANCESTOR;
- }
-
- traverser = dtm.getAxisTraverser(axis);
-
- for (int relative = traverser.first(context); DTM.NULL != relative;
- relative = traverser.next(context, relative))
- {
- try
- {
- xctxt.pushCurrentNode(relative);
-
- score = execute(xctxt);
-
- if (score != NodeTest.SCORE_NONE)
- {
- //score = executePredicates( xctxt, prevStep, SCORE_OTHER,
- // predContext, relative);
- if (executePredicates(xctxt, dtm, context))
- return score;
-
- score = NodeTest.SCORE_NONE;
- }
-
- if(needToTraverseAttrs && iterRootIsAttr
- && (DTM.ELEMENT_NODE == dtm.getNodeType(relative)))
- {
- int xaxis = Axis.ATTRIBUTE;
- for (int i = 0; i < 2; i++)
- {
- DTMAxisTraverser atraverser = dtm.getAxisTraverser(xaxis);
-
- for (int arelative = atraverser.first(relative);
- DTM.NULL != arelative;
- arelative = atraverser.next(relative, arelative))
- {
- try
- {
- xctxt.pushCurrentNode(arelative);
-
- score = execute(xctxt);
-
- if (score != NodeTest.SCORE_NONE)
- {
- //score = executePredicates( xctxt, prevStep, SCORE_OTHER,
- // predContext, arelative);
-
- if (score != NodeTest.SCORE_NONE)
- return score;
- }
- }
- finally
- {
- xctxt.popCurrentNode();
- }
- }
- xaxis = Axis.NAMESPACE;
- }
- }
-
- }
- finally
- {
- xctxt.popCurrentNode();
- }
- }
-
- }
-
- return score;
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/patterns/FunctionPattern.java b/src/com/sun/org/apache/xpath/internal/patterns/FunctionPattern.java
deleted file mode 100644
index 3d02023..0000000
--- a/src/com/sun/org/apache/xpath/internal/patterns/FunctionPattern.java
+++ /dev/null
@@ -1,250 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: FunctionPattern.java,v 1.2.4.2 2005/09/15 00:21:15 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.patterns;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMIterator;
-import com.sun.org.apache.xpath.internal.Expression;
-import com.sun.org.apache.xpath.internal.ExpressionOwner;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.XPathVisitor;
-import com.sun.org.apache.xpath.internal.objects.XNumber;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-/**
- * Match pattern step that contains a function.
- * @xsl.usage advanced
- */
-public class FunctionPattern extends StepPattern
-{
- static final long serialVersionUID = -5426793413091209944L;
-
- /**
- * Construct a FunctionPattern from a
- * {@link com.sun.org.apache.xpath.internal.functions.Function expression}.
- *
- * NEEDSDOC @param expr
- */
- public FunctionPattern(Expression expr, int axis, int predaxis)
- {
-
- super(0, null, null, axis, predaxis);
-
- m_functionExpr = expr;
- }
-
- /**
- * Static calc of match score.
- */
- public final void calcScore()
- {
-
- m_score = SCORE_OTHER;
-
- if (null == m_targetString)
- calcTargetString();
- }
-
- /**
- * Should be a {@link com.sun.org.apache.xpath.internal.functions.Function expression}.
- * @serial
- */
- Expression m_functionExpr;
-
- /**
- * This function is used to fixup variables from QNames to stack frame
- * indexes at stylesheet build time.
- * @param vars List of QNames that correspond to variables. This list
- * should be searched backwards for the first qualified name that
- * corresponds to the variable reference qname. The position of the
- * QName in the vector from the start of the vector will be its position
- * in the stack frame (but variables above the globalsTop value will need
- * to be offset to the current stack frame).
- */
- public void fixupVariables(java.util.Vector vars, int globalsSize)
- {
- super.fixupVariables(vars, globalsSize);
- m_functionExpr.fixupVariables(vars, globalsSize);
- }
-
-
- /**
- * Test a node to see if it matches the given node test.
- *
- * @param xctxt XPath runtime context.
- *
- * @return {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NODETEST},
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NONE},
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NSWILD},
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_QNAME}, or
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_OTHER}.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt, int context)
- throws javax.xml.transform.TransformerException
- {
-
- DTMIterator nl = m_functionExpr.asIterator(xctxt, context);
- XNumber score = SCORE_NONE;
-
- if (null != nl)
- {
- int n;
-
- while (DTM.NULL != (n = nl.nextNode()))
- {
- score = (n == context) ? SCORE_OTHER : SCORE_NONE;
-
- if (score == SCORE_OTHER)
- {
- context = n;
-
- break;
- }
- }
-
- // nl.detach();
- }
- nl.detach();
-
- return score;
- }
-
- /**
- * Test a node to see if it matches the given node test.
- *
- * @param xctxt XPath runtime context.
- *
- * @return {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NODETEST},
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NONE},
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NSWILD},
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_QNAME}, or
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_OTHER}.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt, int context,
- DTM dtm, int expType)
- throws javax.xml.transform.TransformerException
- {
-
- DTMIterator nl = m_functionExpr.asIterator(xctxt, context);
- XNumber score = SCORE_NONE;
-
- if (null != nl)
- {
- int n;
-
- while (DTM.NULL != (n = nl.nextNode()))
- {
- score = (n == context) ? SCORE_OTHER : SCORE_NONE;
-
- if (score == SCORE_OTHER)
- {
- context = n;
-
- break;
- }
- }
-
- nl.detach();
- }
-
- return score;
- }
-
- /**
- * Test a node to see if it matches the given node test.
- *
- * @param xctxt XPath runtime context.
- *
- * @return {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NODETEST},
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NONE},
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NSWILD},
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_QNAME}, or
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_OTHER}.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt)
- throws javax.xml.transform.TransformerException
- {
-
- int context = xctxt.getCurrentNode();
- DTMIterator nl = m_functionExpr.asIterator(xctxt, context);
- XNumber score = SCORE_NONE;
-
- if (null != nl)
- {
- int n;
-
- while (DTM.NULL != (n = nl.nextNode()))
- {
- score = (n == context) ? SCORE_OTHER : SCORE_NONE;
-
- if (score == SCORE_OTHER)
- {
- context = n;
-
- break;
- }
- }
-
- nl.detach();
- }
-
- return score;
- }
-
- class FunctionOwner implements ExpressionOwner
- {
- /**
- * @see ExpressionOwner#getExpression()
- */
- public Expression getExpression()
- {
- return m_functionExpr;
- }
-
-
- /**
- * @see ExpressionOwner#setExpression(Expression)
- */
- public void setExpression(Expression exp)
- {
- exp.exprSetParent(FunctionPattern.this);
- m_functionExpr = exp;
- }
- }
-
- /**
- * Call the visitor for the function.
- */
- protected void callSubtreeVisitors(XPathVisitor visitor)
- {
- m_functionExpr.callVisitors(new FunctionOwner(), visitor);
- super.callSubtreeVisitors(visitor);
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/patterns/NodeTest.java b/src/com/sun/org/apache/xpath/internal/patterns/NodeTest.java
deleted file mode 100644
index 5bb95fb..0000000
--- a/src/com/sun/org/apache/xpath/internal/patterns/NodeTest.java
+++ /dev/null
@@ -1,694 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: NodeTest.java,v 1.2.4.2 2005/09/15 00:21:14 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.patterns;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMFilter;
-import com.sun.org.apache.xpath.internal.Expression;
-import com.sun.org.apache.xpath.internal.ExpressionOwner;
-import com.sun.org.apache.xpath.internal.XPath;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.XPathVisitor;
-import com.sun.org.apache.xpath.internal.objects.XNumber;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-/**
- * This is the basic node test class for both match patterns and location path
- * steps.
- * @xsl.usage advanced
- */
-public class NodeTest extends Expression
-{
- static final long serialVersionUID = -5736721866747906182L;
-
- /**
- * The namespace or local name for node tests with a wildcard.
- * @see <a href="http://www.w3.org/TR/xpath#NT-NameTest">the XPath NameTest production.</a>
- */
- public static final String WILD = "*";
-
- /**
- * The URL to pass to the Node#supports method, to see if the
- * DOM has already been stripped of whitespace nodes.
- */
- public static final String SUPPORTS_PRE_STRIPPING =
- "http://xml.apache.org/xpath/features/whitespace-pre-stripping";
-
- /**
- * This attribute determines which node types are accepted.
- * @serial
- */
- protected int m_whatToShow;
-
- /**
- * Special bitmap for match patterns starting with a function.
- * Make sure this does not conflict with {@link org.w3c.dom.traversal.NodeFilter}.
- */
- public static final int SHOW_BYFUNCTION = 0x00010000;
-
- /**
- * This attribute determines which node types are accepted.
- * These constants are defined in the {@link org.w3c.dom.traversal.NodeFilter}
- * interface.
- *
- * @return bitset mainly defined in {@link org.w3c.dom.traversal.NodeFilter}.
- */
- public int getWhatToShow()
- {
- return m_whatToShow;
- }
-
- /**
- * This attribute determines which node types are accepted.
- * These constants are defined in the {@link org.w3c.dom.traversal.NodeFilter}
- * interface.
- *
- * @param what bitset mainly defined in {@link org.w3c.dom.traversal.NodeFilter}.
- */
- public void setWhatToShow(int what)
- {
- m_whatToShow = what;
- }
-
- /**
- * The namespace to be tested for, which may be null.
- * @serial
- */
- String m_namespace;
-
- /**
- * Return the namespace to be tested.
- *
- * @return The namespace to be tested for, or {@link #WILD}, or null.
- */
- public String getNamespace()
- {
- return m_namespace;
- }
-
- /**
- * Set the namespace to be tested.
- *
- * @param ns The namespace to be tested for, or {@link #WILD}, or null.
- */
- public void setNamespace(String ns)
- {
- m_namespace = ns;
- }
-
- /**
- * The local name to be tested for.
- * @serial
- */
- protected String m_name;
-
- /**
- * Return the local name to be tested.
- *
- * @return the local name to be tested, or {@link #WILD}, or an empty string.
- */
- public String getLocalName()
- {
- return (null == m_name) ? "" : m_name;
- }
-
- /**
- * Set the local name to be tested.
- *
- * @param name the local name to be tested, or {@link #WILD}, or an empty string.
- */
- public void setLocalName(String name)
- {
- m_name = name;
- }
-
- /**
- * Statically calculated score for this test. One of
- * {@link #SCORE_NODETEST},
- * {@link #SCORE_NONE},
- * {@link #SCORE_NSWILD},
- * {@link #SCORE_QNAME}, or
- * {@link #SCORE_OTHER}.
- * @serial
- */
- XNumber m_score;
-
- /**
- * The match score if the pattern consists of just a NodeTest.
- * @see <a href="http://www.w3.org/TR/xslt#conflict">XSLT Specification - 5.5 Conflict Resolution for Template Rules</a>
- */
- public static final XNumber SCORE_NODETEST =
- new XNumber(XPath.MATCH_SCORE_NODETEST);
-
- /**
- * The match score if the pattern pattern has the form NCName:*.
- * @see <a href="http://www.w3.org/TR/xslt#conflict">XSLT Specification - 5.5 Conflict Resolution for Template Rules</a>
- */
- public static final XNumber SCORE_NSWILD =
- new XNumber(XPath.MATCH_SCORE_NSWILD);
-
- /**
- * The match score if the pattern has the form
- * of a QName optionally preceded by an @ character.
- * @see <a href="http://www.w3.org/TR/xslt#conflict">XSLT Specification - 5.5 Conflict Resolution for Template Rules</a>
- */
- public static final XNumber SCORE_QNAME =
- new XNumber(XPath.MATCH_SCORE_QNAME);
-
- /**
- * The match score if the pattern consists of something
- * other than just a NodeTest or just a qname.
- * @see <a href="http://www.w3.org/TR/xslt#conflict">XSLT Specification - 5.5 Conflict Resolution for Template Rules</a>
- */
- public static final XNumber SCORE_OTHER =
- new XNumber(XPath.MATCH_SCORE_OTHER);
-
- /**
- * The match score if no match is made.
- * @see <a href="http://www.w3.org/TR/xslt#conflict">XSLT Specification - 5.5 Conflict Resolution for Template Rules</a>
- */
- public static final XNumber SCORE_NONE =
- new XNumber(XPath.MATCH_SCORE_NONE);
-
- /**
- * Construct an NodeTest that tests for namespaces and node names.
- *
- *
- * @param whatToShow Bit set defined mainly by {@link org.w3c.dom.traversal.NodeFilter}.
- * @param namespace The namespace to be tested.
- * @param name The local name to be tested.
- */
- public NodeTest(int whatToShow, String namespace, String name)
- {
- initNodeTest(whatToShow, namespace, name);
- }
-
- /**
- * Construct an NodeTest that doesn't test for node names.
- *
- *
- * @param whatToShow Bit set defined mainly by {@link org.w3c.dom.traversal.NodeFilter}.
- */
- public NodeTest(int whatToShow)
- {
- initNodeTest(whatToShow);
- }
-
- /**
- * @see Expression#deepEquals(Expression)
- */
- public boolean deepEquals(Expression expr)
- {
- if(!isSameClass(expr))
- return false;
-
- NodeTest nt = (NodeTest)expr;
-
- if(null != nt.m_name)
- {
- if(null == m_name)
- return false;
- else if(!nt.m_name.equals(m_name))
- return false;
- }
- else if(null != m_name)
- return false;
-
- if(null != nt.m_namespace)
- {
- if(null == m_namespace)
- return false;
- else if(!nt.m_namespace.equals(m_namespace))
- return false;
- }
- else if(null != m_namespace)
- return false;
-
- if(m_whatToShow != nt.m_whatToShow)
- return false;
-
- if(m_isTotallyWild != nt.m_isTotallyWild)
- return false;
-
- return true;
- }
-
- /**
- * Null argument constructor.
- */
- public NodeTest(){}
-
- /**
- * Initialize this node test by setting the whatToShow property, and
- * calculating the score that this test will return if a test succeeds.
- *
- *
- * @param whatToShow Bit set defined mainly by {@link org.w3c.dom.traversal.NodeFilter}.
- */
- public void initNodeTest(int whatToShow)
- {
-
- m_whatToShow = whatToShow;
-
- calcScore();
- }
-
- /**
- * Initialize this node test by setting the whatToShow property and the
- * namespace and local name, and
- * calculating the score that this test will return if a test succeeds.
- *
- *
- * @param whatToShow Bit set defined mainly by {@link org.w3c.dom.traversal.NodeFilter}.
- * @param namespace The namespace to be tested.
- * @param name The local name to be tested.
- */
- public void initNodeTest(int whatToShow, String namespace, String name)
- {
-
- m_whatToShow = whatToShow;
- m_namespace = namespace;
- m_name = name;
-
- calcScore();
- }
-
- /**
- * True if this test has a null namespace and a local name of {@link #WILD}.
- * @serial
- */
- private boolean m_isTotallyWild;
-
- /**
- * Get the static score for this node test.
- * @return Should be one of the SCORE_XXX constants.
- */
- public XNumber getStaticScore()
- {
- return m_score;
- }
-
- /**
- * Set the static score for this node test.
- * @param score Should be one of the SCORE_XXX constants.
- */
- public void setStaticScore(XNumber score)
- {
- m_score = score;
- }
-
- /**
- * Static calc of match score.
- */
- protected void calcScore()
- {
-
- if ((m_namespace == null) && (m_name == null))
- m_score = SCORE_NODETEST;
- else if (((m_namespace == WILD) || (m_namespace == null))
- && (m_name == WILD))
- m_score = SCORE_NODETEST;
- else if ((m_namespace != WILD) && (m_name == WILD))
- m_score = SCORE_NSWILD;
- else
- m_score = SCORE_QNAME;
-
- m_isTotallyWild = (m_namespace == null && m_name == WILD);
- }
-
- /**
- * Get the score that this test will return if a test succeeds.
- *
- *
- * @return the score that this test will return if a test succeeds.
- */
- public double getDefaultScore()
- {
- return m_score.num();
- }
-
- /**
- * Tell what node type to test, if not DTMFilter.SHOW_ALL.
- *
- * @param whatToShow Bit set defined mainly by
- * {@link com.sun.org.apache.xml.internal.dtm.DTMFilter}.
- * @return the node type for the whatToShow. Since whatToShow can specify
- * multiple types, it will return the first bit tested that is on,
- * so the caller of this function should take care that this is
- * the function they really want to call. If none of the known bits
- * are set, this function will return zero.
- */
- public static int getNodeTypeTest(int whatToShow)
- {
- // %REVIEW% Is there a better way?
- if (0 != (whatToShow & DTMFilter.SHOW_ELEMENT))
- return DTM.ELEMENT_NODE;
-
- if (0 != (whatToShow & DTMFilter.SHOW_ATTRIBUTE))
- return DTM.ATTRIBUTE_NODE;
-
- if (0 != (whatToShow & DTMFilter.SHOW_TEXT))
- return DTM.TEXT_NODE;
-
- if (0 != (whatToShow & DTMFilter.SHOW_DOCUMENT))
- return DTM.DOCUMENT_NODE;
-
- if (0 != (whatToShow & DTMFilter.SHOW_DOCUMENT_FRAGMENT))
- return DTM.DOCUMENT_FRAGMENT_NODE;
-
- if (0 != (whatToShow & DTMFilter.SHOW_NAMESPACE))
- return DTM.NAMESPACE_NODE;
-
- if (0 != (whatToShow & DTMFilter.SHOW_COMMENT))
- return DTM.COMMENT_NODE;
-
- if (0 != (whatToShow & DTMFilter.SHOW_PROCESSING_INSTRUCTION))
- return DTM.PROCESSING_INSTRUCTION_NODE;
-
- if (0 != (whatToShow & DTMFilter.SHOW_DOCUMENT_TYPE))
- return DTM.DOCUMENT_TYPE_NODE;
-
- if (0 != (whatToShow & DTMFilter.SHOW_ENTITY))
- return DTM.ENTITY_NODE;
-
- if (0 != (whatToShow & DTMFilter.SHOW_ENTITY_REFERENCE))
- return DTM.ENTITY_REFERENCE_NODE;
-
- if (0 != (whatToShow & DTMFilter.SHOW_NOTATION))
- return DTM.NOTATION_NODE;
-
- if (0 != (whatToShow & DTMFilter.SHOW_CDATA_SECTION))
- return DTM.CDATA_SECTION_NODE;
-
-
- return 0;
- }
-
-
- /**
- * Do a diagnostics dump of a whatToShow bit set.
- *
- *
- * @param whatToShow Bit set defined mainly by
- * {@link com.sun.org.apache.xml.internal.dtm.DTMFilter}.
- */
- public static void debugWhatToShow(int whatToShow)
- {
-
- java.util.Vector v = new java.util.Vector();
-
- if (0 != (whatToShow & DTMFilter.SHOW_ATTRIBUTE))
- v.addElement("SHOW_ATTRIBUTE");
-
- if (0 != (whatToShow & DTMFilter.SHOW_NAMESPACE))
- v.addElement("SHOW_NAMESPACE");
-
- if (0 != (whatToShow & DTMFilter.SHOW_CDATA_SECTION))
- v.addElement("SHOW_CDATA_SECTION");
-
- if (0 != (whatToShow & DTMFilter.SHOW_COMMENT))
- v.addElement("SHOW_COMMENT");
-
- if (0 != (whatToShow & DTMFilter.SHOW_DOCUMENT))
- v.addElement("SHOW_DOCUMENT");
-
- if (0 != (whatToShow & DTMFilter.SHOW_DOCUMENT_FRAGMENT))
- v.addElement("SHOW_DOCUMENT_FRAGMENT");
-
- if (0 != (whatToShow & DTMFilter.SHOW_DOCUMENT_TYPE))
- v.addElement("SHOW_DOCUMENT_TYPE");
-
- if (0 != (whatToShow & DTMFilter.SHOW_ELEMENT))
- v.addElement("SHOW_ELEMENT");
-
- if (0 != (whatToShow & DTMFilter.SHOW_ENTITY))
- v.addElement("SHOW_ENTITY");
-
- if (0 != (whatToShow & DTMFilter.SHOW_ENTITY_REFERENCE))
- v.addElement("SHOW_ENTITY_REFERENCE");
-
- if (0 != (whatToShow & DTMFilter.SHOW_NOTATION))
- v.addElement("SHOW_NOTATION");
-
- if (0 != (whatToShow & DTMFilter.SHOW_PROCESSING_INSTRUCTION))
- v.addElement("SHOW_PROCESSING_INSTRUCTION");
-
- if (0 != (whatToShow & DTMFilter.SHOW_TEXT))
- v.addElement("SHOW_TEXT");
-
- int n = v.size();
-
- for (int i = 0; i < n; i++)
- {
- if (i > 0)
- System.out.print(" | ");
-
- System.out.print(v.elementAt(i));
- }
-
- if (0 == n)
- System.out.print("empty whatToShow: " + whatToShow);
-
- System.out.println();
- }
-
- /**
- * Two names are equal if they and either both are null or
- * the name t is wild and the name p is non-null, or the two
- * strings are equal.
- *
- * @param p part string from the node.
- * @param t target string, which may be {@link #WILD}.
- *
- * @return true if the strings match according to the rules of this method.
- */
- private static final boolean subPartMatch(String p, String t)
- {
-
- // boolean b = (p == t) || ((null != p) && ((t == WILD) || p.equals(t)));
- // System.out.println("subPartMatch - p: "+p+", t: "+t+", result: "+b);
- return (p == t) || ((null != p) && ((t == WILD) || p.equals(t)));
- }
-
- /**
- * This is temporary to patch over Xerces issue with representing DOM
- * namespaces as "".
- *
- * @param p part string from the node, which may represent the null namespace
- * as null or as "".
- * @param t target string, which may be {@link #WILD}.
- *
- * @return true if the strings match according to the rules of this method.
- */
- private static final boolean subPartMatchNS(String p, String t)
- {
-
- return (p == t)
- || ((null != p)
- && ((p.length() > 0)
- ? ((t == WILD) || p.equals(t)) : null == t));
- }
-
- /**
- * Tell what the test score is for the given node.
- *
- *
- * @param xctxt XPath runtime context.
- * @param context The node being tested.
- *
- * @return {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NODETEST},
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NONE},
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NSWILD},
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_QNAME}, or
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_OTHER}.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt, int context)
- throws javax.xml.transform.TransformerException
- {
-
- DTM dtm = xctxt.getDTM(context);
- short nodeType = dtm.getNodeType(context);
-
- if (m_whatToShow == DTMFilter.SHOW_ALL)
- return m_score;
-
- int nodeBit = (m_whatToShow & (0x00000001 << (nodeType - 1)));
-
- switch (nodeBit)
- {
- case DTMFilter.SHOW_DOCUMENT_FRAGMENT :
- case DTMFilter.SHOW_DOCUMENT :
- return SCORE_OTHER;
- case DTMFilter.SHOW_COMMENT :
- return m_score;
- case DTMFilter.SHOW_CDATA_SECTION :
- case DTMFilter.SHOW_TEXT :
-
- // was:
- // return (!xctxt.getDOMHelper().shouldStripSourceNode(context))
- // ? m_score : SCORE_NONE;
- return m_score;
- case DTMFilter.SHOW_PROCESSING_INSTRUCTION :
- return subPartMatch(dtm.getNodeName(context), m_name)
- ? m_score : SCORE_NONE;
-
- // From the draft: "Two expanded names are equal if they
- // have the same local part, and either both have no URI or
- // both have the same URI."
- // "A node test * is true for any node of the principal node type.
- // For example, child::* will select all element children of the
- // context node, and attribute::* will select all attributes of
- // the context node."
- // "A node test can have the form NCName:*. In this case, the prefix
- // is expanded in the same way as with a QName using the context
- // namespace declarations. The node test will be true for any node
- // of the principal type whose expanded name has the URI to which
- // the prefix expands, regardless of the local part of the name."
- case DTMFilter.SHOW_NAMESPACE :
- {
- String ns = dtm.getLocalName(context);
-
- return (subPartMatch(ns, m_name)) ? m_score : SCORE_NONE;
- }
- case DTMFilter.SHOW_ATTRIBUTE :
- case DTMFilter.SHOW_ELEMENT :
- {
- return (m_isTotallyWild || (subPartMatchNS(dtm.getNamespaceURI(context), m_namespace) && subPartMatch(dtm.getLocalName(context), m_name)))
- ? m_score : SCORE_NONE;
- }
- default :
- return SCORE_NONE;
- } // end switch(testType)
- }
-
- /**
- * Tell what the test score is for the given node.
- *
- *
- * @param xctxt XPath runtime context.
- * @param context The node being tested.
- *
- * @return {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NODETEST},
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NONE},
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NSWILD},
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_QNAME}, or
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_OTHER}.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt, int context,
- DTM dtm, int expType)
- throws javax.xml.transform.TransformerException
- {
-
- if (m_whatToShow == DTMFilter.SHOW_ALL)
- return m_score;
-
- int nodeBit = (m_whatToShow & (0x00000001
- << ((dtm.getNodeType(context)) - 1)));
-
- switch (nodeBit)
- {
- case DTMFilter.SHOW_DOCUMENT_FRAGMENT :
- case DTMFilter.SHOW_DOCUMENT :
- return SCORE_OTHER;
- case DTMFilter.SHOW_COMMENT :
- return m_score;
- case DTMFilter.SHOW_CDATA_SECTION :
- case DTMFilter.SHOW_TEXT :
-
- // was:
- // return (!xctxt.getDOMHelper().shouldStripSourceNode(context))
- // ? m_score : SCORE_NONE;
- return m_score;
- case DTMFilter.SHOW_PROCESSING_INSTRUCTION :
- return subPartMatch(dtm.getNodeName(context), m_name)
- ? m_score : SCORE_NONE;
-
- // From the draft: "Two expanded names are equal if they
- // have the same local part, and either both have no URI or
- // both have the same URI."
- // "A node test * is true for any node of the principal node type.
- // For example, child::* will select all element children of the
- // context node, and attribute::* will select all attributes of
- // the context node."
- // "A node test can have the form NCName:*. In this case, the prefix
- // is expanded in the same way as with a QName using the context
- // namespace declarations. The node test will be true for any node
- // of the principal type whose expanded name has the URI to which
- // the prefix expands, regardless of the local part of the name."
- case DTMFilter.SHOW_NAMESPACE :
- {
- String ns = dtm.getLocalName(context);
-
- return (subPartMatch(ns, m_name)) ? m_score : SCORE_NONE;
- }
- case DTMFilter.SHOW_ATTRIBUTE :
- case DTMFilter.SHOW_ELEMENT :
- {
- return (m_isTotallyWild || (subPartMatchNS(dtm.getNamespaceURI(context), m_namespace) && subPartMatch(dtm.getLocalName(context), m_name)))
- ? m_score : SCORE_NONE;
- }
- default :
- return SCORE_NONE;
- } // end switch(testType)
- }
-
- /**
- * Test the current node to see if it matches the given node test.
- *
- * @param xctxt XPath runtime context.
- *
- * @return {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NODETEST},
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NONE},
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NSWILD},
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_QNAME}, or
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_OTHER}.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt)
- throws javax.xml.transform.TransformerException
- {
- return execute(xctxt, xctxt.getCurrentNode());
- }
-
- /**
- * Node tests by themselves do not need to fix up variables.
- */
- public void fixupVariables(java.util.Vector vars, int globalsSize)
- {
- // no-op
- }
-
- /**
- * @see com.sun.org.apache.xpath.internal.XPathVisitable#callVisitors(ExpressionOwner, XPathVisitor)
- */
- public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)
- {
- assertion(false, "callVisitors should not be called for this object!!!");
- }
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/patterns/NodeTestFilter.java b/src/com/sun/org/apache/xpath/internal/patterns/NodeTestFilter.java
deleted file mode 100644
index c532937..0000000
--- a/src/com/sun/org/apache/xpath/internal/patterns/NodeTestFilter.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: NodeTestFilter.java,v 1.1.2.1 2005/08/01 01:30:30 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.patterns;
-
-/**
- * This interface should be implemented by Nodes and/or iterators,
- * when they need to know what the node test is before they do
- * getNextChild, etc.
- */
-public interface NodeTestFilter
-{
-
- /**
- * Set the node test for this filter.
- *
- *
- * @param nodeTest Reference to a NodeTest that may be used to predetermine
- * what nodes to return.
- */
- void setNodeTest(NodeTest nodeTest);
-}
diff --git a/src/com/sun/org/apache/xpath/internal/patterns/StepPattern.java b/src/com/sun/org/apache/xpath/internal/patterns/StepPattern.java
deleted file mode 100644
index ce4b3af..0000000
--- a/src/com/sun/org/apache/xpath/internal/patterns/StepPattern.java
+++ /dev/null
@@ -1,1055 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: StepPattern.java,v 1.2.4.2 2005/09/15 00:21:16 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.patterns;
-
-import com.sun.org.apache.xml.internal.dtm.Axis;
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMAxisTraverser;
-import com.sun.org.apache.xml.internal.dtm.DTMFilter;
-import com.sun.org.apache.xpath.internal.Expression;
-import com.sun.org.apache.xpath.internal.ExpressionOwner;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.XPathVisitor;
-import com.sun.org.apache.xpath.internal.axes.SubContextList;
-import com.sun.org.apache.xpath.internal.compiler.PsuedoNames;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-/**
- * This class represents a single pattern match step.
- * @xsl.usage advanced
- */
-public class StepPattern extends NodeTest implements SubContextList, ExpressionOwner
-{
- static final long serialVersionUID = 9071668960168152644L;
-
- /** The axis for this test. */
- protected int m_axis;
-
- /**
- * Construct a StepPattern that tests for namespaces and node names.
- *
- *
- * @param whatToShow Bit set defined mainly by {@link org.w3c.dom.traversal.NodeFilter}.
- * @param namespace The namespace to be tested.
- * @param name The local name to be tested.
- * @param axis The Axis for this test, one of of Axes.ANCESTORORSELF, etc.
- * @param axisForPredicate No longer used.
- */
- public StepPattern(int whatToShow, String namespace, String name, int axis,
- int axisForPredicate)
- {
-
- super(whatToShow, namespace, name);
-
- m_axis = axis;
- }
-
- /**
- * Construct a StepPattern that doesn't test for node names.
- *
- *
- * @param whatToShow Bit set defined mainly by {@link org.w3c.dom.traversal.NodeFilter}.
- * @param axis The Axis for this test, one of of Axes.ANCESTORORSELF, etc.
- * @param axisForPredicate No longer used.
- */
- public StepPattern(int whatToShow, int axis, int axisForPredicate)
- {
-
- super(whatToShow);
-
- m_axis = axis;
- }
-
- /**
- * The target local name or psuedo name, for hash table lookup optimization.
- * @serial
- */
- String m_targetString; // only calculate on head
-
- /**
- * Calculate the local name or psuedo name of the node that this pattern will test,
- * for hash table lookup optimization.
- *
- * @see com.sun.org.apache.xpath.internal.compiler.PsuedoNames
- */
- public void calcTargetString()
- {
-
- int whatToShow = getWhatToShow();
-
- switch (whatToShow)
- {
- case DTMFilter.SHOW_COMMENT :
- m_targetString = PsuedoNames.PSEUDONAME_COMMENT;
- break;
- case DTMFilter.SHOW_TEXT :
- case DTMFilter.SHOW_CDATA_SECTION :
- case (DTMFilter.SHOW_TEXT | DTMFilter.SHOW_CDATA_SECTION) :
- m_targetString = PsuedoNames.PSEUDONAME_TEXT;
- break;
- case DTMFilter.SHOW_ALL :
- m_targetString = PsuedoNames.PSEUDONAME_ANY;
- break;
- case DTMFilter.SHOW_DOCUMENT :
- case DTMFilter.SHOW_DOCUMENT | DTMFilter.SHOW_DOCUMENT_FRAGMENT :
- m_targetString = PsuedoNames.PSEUDONAME_ROOT;
- break;
- case DTMFilter.SHOW_ELEMENT :
- if (this.WILD == m_name)
- m_targetString = PsuedoNames.PSEUDONAME_ANY;
- else
- m_targetString = m_name;
- break;
- default :
- m_targetString = PsuedoNames.PSEUDONAME_ANY;
- break;
- }
- }
-
- /**
- * Get the local name or psuedo name of the node that this pattern will test,
- * for hash table lookup optimization.
- *
- *
- * @return local name or psuedo name of the node.
- * @see com.sun.org.apache.xpath.internal.compiler.PsuedoNames
- */
- public String getTargetString()
- {
- return m_targetString;
- }
-
- /**
- * Reference to nodetest and predicate for
- * parent or ancestor.
- * @serial
- */
- StepPattern m_relativePathPattern;
-
- /**
- * This function is used to fixup variables from QNames to stack frame
- * indexes at stylesheet build time.
- * @param vars List of QNames that correspond to variables. This list
- * should be searched backwards for the first qualified name that
- * corresponds to the variable reference qname. The position of the
- * QName in the vector from the start of the vector will be its position
- * in the stack frame (but variables above the globalsTop value will need
- * to be offset to the current stack frame).
- * @param globalsSize The number of variables in the global variable area.
- */
- public void fixupVariables(java.util.Vector vars, int globalsSize)
- {
-
- super.fixupVariables(vars, globalsSize);
-
- if (null != m_predicates)
- {
- for (int i = 0; i < m_predicates.length; i++)
- {
- m_predicates[i].fixupVariables(vars, globalsSize);
- }
- }
-
- if (null != m_relativePathPattern)
- {
- m_relativePathPattern.fixupVariables(vars, globalsSize);
- }
- }
-
- /**
- * Set the reference to nodetest and predicate for
- * parent or ancestor.
- *
- *
- * @param expr The relative pattern expression.
- */
- public void setRelativePathPattern(StepPattern expr)
- {
-
- m_relativePathPattern = expr;
- expr.exprSetParent(this);
-
- calcScore();
- }
-
- /**
- * Get the reference to nodetest and predicate for
- * parent or ancestor.
- *
- *
- * @return The relative pattern expression.
- */
- public StepPattern getRelativePathPattern()
- {
- return m_relativePathPattern;
- }
-
- // /**
- // * Set the list of predicate expressions for this pattern step.
- // * @param predicates List of expression objects.
- // */
- // public void setPredicates(Expression[] predicates)
- // {
- // m_predicates = predicates;
- // }
-
- /**
- * Set the list of predicate expressions for this pattern step.
- * @return List of expression objects.
- */
- public Expression[] getPredicates()
- {
- return m_predicates;
- }
-
- /**
- * The list of predicate expressions for this pattern step.
- * @serial
- */
- Expression[] m_predicates;
-
- /**
- * Tell if this expression or it's subexpressions can traverse outside
- * the current subtree.
- *
- * NOTE: Ancestors tests with predicates are problematic, and will require
- * special treatment.
- *
- * @return true if traversal outside the context node's subtree can occur.
- */
- public boolean canTraverseOutsideSubtree()
- {
-
- int n = getPredicateCount();
-
- for (int i = 0; i < n; i++)
- {
- if (getPredicate(i).canTraverseOutsideSubtree())
- return true;
- }
-
- return false;
- }
-
- /**
- * Get a predicate expression.
- *
- *
- * @param i The index of the predicate.
- *
- * @return A predicate expression.
- */
- public Expression getPredicate(int i)
- {
- return m_predicates[i];
- }
-
- /**
- * Get the number of predicates for this match pattern step.
- *
- *
- * @return the number of predicates for this match pattern step.
- */
- public final int getPredicateCount()
- {
- return (null == m_predicates) ? 0 : m_predicates.length;
- }
-
- /**
- * Set the predicates for this match pattern step.
- *
- *
- * @param predicates An array of expressions that define predicates
- * for this step.
- */
- public void setPredicates(Expression[] predicates)
- {
-
- m_predicates = predicates;
- if(null != predicates)
- {
- for(int i = 0; i < predicates.length; i++)
- {
- predicates[i].exprSetParent(this);
- }
- }
-
- calcScore();
- }
-
- /**
- * Static calc of match score.
- */
- public void calcScore()
- {
-
- if ((getPredicateCount() > 0) || (null != m_relativePathPattern))
- {
- m_score = SCORE_OTHER;
- }
- else
- super.calcScore();
-
- if (null == m_targetString)
- calcTargetString();
- }
-
- /**
- * Execute this pattern step, including predicates.
- *
- *
- * @param xctxt XPath runtime context.
- * @param currentNode The current node context.
- *
- * @return {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NODETEST},
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NONE},
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NSWILD},
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_QNAME}, or
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_OTHER}.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt, int currentNode)
- throws javax.xml.transform.TransformerException
- {
-
- DTM dtm = xctxt.getDTM(currentNode);
-
- if (dtm != null)
- {
- int expType = dtm.getExpandedTypeID(currentNode);
-
- return execute(xctxt, currentNode, dtm, expType);
- }
-
- return NodeTest.SCORE_NONE;
- }
-
- /**
- * Execute this pattern step, including predicates.
- *
- *
- * @param xctxt XPath runtime context.
- *
- * @return {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NODETEST},
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NONE},
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NSWILD},
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_QNAME}, or
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_OTHER}.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt)
- throws javax.xml.transform.TransformerException
- {
- return execute(xctxt, xctxt.getCurrentNode());
- }
-
- /**
- * Execute an expression in the XPath runtime context, and return the
- * result of the expression.
- *
- *
- * @param xctxt The XPath runtime context.
- * @param currentNode The currentNode.
- * @param dtm The DTM of the current node.
- * @param expType The expanded type ID of the current node.
- *
- * @return The result of the expression in the form of a <code>XObject</code>.
- *
- * @throws javax.xml.transform.TransformerException if a runtime exception
- * occurs.
- */
- public XObject execute(
- XPathContext xctxt, int currentNode, DTM dtm, int expType)
- throws javax.xml.transform.TransformerException
- {
-
- if (m_whatToShow == NodeTest.SHOW_BYFUNCTION)
- {
- if (null != m_relativePathPattern)
- {
- return m_relativePathPattern.execute(xctxt);
- }
- else
- return NodeTest.SCORE_NONE;
- }
-
- XObject score;
-
- score = super.execute(xctxt, currentNode, dtm, expType);
-
- if (score == NodeTest.SCORE_NONE)
- return NodeTest.SCORE_NONE;
-
- if (getPredicateCount() != 0)
- {
- if (!executePredicates(xctxt, dtm, currentNode))
- return NodeTest.SCORE_NONE;
- }
-
- if (null != m_relativePathPattern)
- return m_relativePathPattern.executeRelativePathPattern(xctxt, dtm,
- currentNode);
-
- return score;
- }
-
- /**
- * New Method to check whether the current node satisfies a position predicate
- *
- * @param xctxt The XPath runtime context.
- * @param predPos Which predicate we're evaluating of foo[1][2][3].
- * @param dtm The DTM of the current node.
- * @param context The currentNode.
- * @param pos The position being requested, i.e. the value returned by
- * m_predicates[predPos].execute(xctxt).
- *
- * @return true of the position of the context matches pos, false otherwise.
- */
- private final boolean checkProximityPosition(XPathContext xctxt,
- int predPos, DTM dtm, int context, int pos)
- {
-
- try
- {
- DTMAxisTraverser traverser =
- dtm.getAxisTraverser(Axis.PRECEDINGSIBLING);
-
- for (int child = traverser.first(context); DTM.NULL != child;
- child = traverser.next(context, child))
- {
- try
- {
- xctxt.pushCurrentNode(child);
-
- if (NodeTest.SCORE_NONE != super.execute(xctxt, child))
- {
- boolean pass = true;
-
- try
- {
- xctxt.pushSubContextList(this);
-
- for (int i = 0; i < predPos; i++)
- {
- xctxt.pushPredicatePos(i);
- try
- {
- XObject pred = m_predicates[i].execute(xctxt);
-
- try
- {
- if (XObject.CLASS_NUMBER == pred.getType())
- {
- throw new Error("Why: Should never have been called");
- }
- else if (!pred.boolWithSideEffects())
- {
- pass = false;
-
- break;
- }
- }
- finally
- {
- pred.detach();
- }
- }
- finally
- {
- xctxt.popPredicatePos();
- }
- }
- }
- finally
- {
- xctxt.popSubContextList();
- }
-
- if (pass)
- pos--;
-
- if (pos < 1)
- return false;
- }
- }
- finally
- {
- xctxt.popCurrentNode();
- }
- }
- }
- catch (javax.xml.transform.TransformerException se)
- {
-
- // TODO: should keep throw sax exception...
- throw new java.lang.RuntimeException(se.getMessage());
- }
-
- return (pos == 1);
- }
-
- /**
- * Get the proximity position index of the current node based on this
- * node test.
- *
- *
- * @param xctxt XPath runtime context.
- * @param predPos Which predicate we're evaluating of foo[1][2][3].
- * @param findLast If true, don't terminate when the context node is found.
- *
- * @return the proximity position index of the current node based on the
- * node test.
- */
- private final int getProximityPosition(XPathContext xctxt, int predPos,
- boolean findLast)
- {
-
- int pos = 0;
- int context = xctxt.getCurrentNode();
- DTM dtm = xctxt.getDTM(context);
- int parent = dtm.getParent(context);
-
- try
- {
- DTMAxisTraverser traverser = dtm.getAxisTraverser(Axis.CHILD);
-
- for (int child = traverser.first(parent); DTM.NULL != child;
- child = traverser.next(parent, child))
- {
- try
- {
- xctxt.pushCurrentNode(child);
-
- if (NodeTest.SCORE_NONE != super.execute(xctxt, child))
- {
- boolean pass = true;
-
- try
- {
- xctxt.pushSubContextList(this);
-
- for (int i = 0; i < predPos; i++)
- {
- xctxt.pushPredicatePos(i);
- try
- {
- XObject pred = m_predicates[i].execute(xctxt);
-
- try
- {
- if (XObject.CLASS_NUMBER == pred.getType())
- {
- if ((pos + 1) != (int) pred.numWithSideEffects())
- {
- pass = false;
-
- break;
- }
- }
- else if (!pred.boolWithSideEffects())
- {
- pass = false;
-
- break;
- }
- }
- finally
- {
- pred.detach();
- }
- }
- finally
- {
- xctxt.popPredicatePos();
- }
- }
- }
- finally
- {
- xctxt.popSubContextList();
- }
-
- if (pass)
- pos++;
-
- if (!findLast && child == context)
- {
- return pos;
- }
- }
- }
- finally
- {
- xctxt.popCurrentNode();
- }
- }
- }
- catch (javax.xml.transform.TransformerException se)
- {
-
- // TODO: should keep throw sax exception...
- throw new java.lang.RuntimeException(se.getMessage());
- }
-
- return pos;
- }
-
- /**
- * Get the proximity position index of the current node based on this
- * node test.
- *
- *
- * @param xctxt XPath runtime context.
- *
- * @return the proximity position index of the current node based on the
- * node test.
- */
- public int getProximityPosition(XPathContext xctxt)
- {
- return getProximityPosition(xctxt, xctxt.getPredicatePos(), false);
- }
-
- /**
- * Get the count of the nodes that match the test, which is the proximity
- * position of the last node that can pass this test in the sub context
- * selection. In XSLT 1-based indexing, this count is the index of the last
- * node.
- *
- *
- * @param xctxt XPath runtime context.
- *
- * @return the count of the nodes that match the test.
- */
- public int getLastPos(XPathContext xctxt)
- {
- return getProximityPosition(xctxt, xctxt.getPredicatePos(), true);
- }
-
- /**
- * Execute the match pattern step relative to another step.
- *
- *
- * @param xctxt The XPath runtime context.
- * @param dtm The DTM of the current node.
- * @param currentNode The current node context.
- *
- * @return {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NODETEST},
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NONE},
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NSWILD},
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_QNAME}, or
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_OTHER}.
- *
- * @throws javax.xml.transform.TransformerException
- */
- protected final XObject executeRelativePathPattern(
- XPathContext xctxt, DTM dtm, int currentNode)
- throws javax.xml.transform.TransformerException
- {
-
- XObject score = NodeTest.SCORE_NONE;
- int context = currentNode;
- DTMAxisTraverser traverser;
-
- traverser = dtm.getAxisTraverser(m_axis);
-
- for (int relative = traverser.first(context); DTM.NULL != relative;
- relative = traverser.next(context, relative))
- {
- try
- {
- xctxt.pushCurrentNode(relative);
-
- score = execute(xctxt);
-
- if (score != NodeTest.SCORE_NONE)
- break;
- }
- finally
- {
- xctxt.popCurrentNode();
- }
- }
-
- return score;
- }
-
- /**
- * Execute the predicates on this step to determine if the current node
- * should be filtered or accepted.
- *
- * @param xctxt The XPath runtime context.
- * @param dtm The DTM of the current node.
- * @param currentNode The current node context.
- *
- * @return true if the node should be accepted, false otherwise.
- *
- * @throws javax.xml.transform.TransformerException
- */
- protected final boolean executePredicates(
- XPathContext xctxt, DTM dtm, int currentNode)
- throws javax.xml.transform.TransformerException
- {
-
- boolean result = true;
- boolean positionAlreadySeen = false;
- int n = getPredicateCount();
-
- try
- {
- xctxt.pushSubContextList(this);
-
- for (int i = 0; i < n; i++)
- {
- xctxt.pushPredicatePos(i);
-
- try
- {
- XObject pred = m_predicates[i].execute(xctxt);
-
- try
- {
- if (XObject.CLASS_NUMBER == pred.getType())
- {
- int pos = (int) pred.num();
-
- if (positionAlreadySeen)
- {
- result = (pos == 1);
-
- break;
- }
- else
- {
- positionAlreadySeen = true;
-
- if (!checkProximityPosition(xctxt, i, dtm, currentNode, pos))
- {
- result = false;
-
- break;
- }
- }
-
- }
- else if (!pred.boolWithSideEffects())
- {
- result = false;
-
- break;
- }
- }
- finally
- {
- pred.detach();
- }
- }
- finally
- {
- xctxt.popPredicatePos();
- }
- }
- }
- finally
- {
- xctxt.popSubContextList();
- }
-
- return result;
- }
-
- /**
- * Get the string represenentation of this step for diagnostic purposes.
- *
- *
- * @return A string representation of this step, built by reverse-engineering
- * the contained info.
- */
- public String toString()
- {
-
- StringBuffer buf = new StringBuffer();
-
- for (StepPattern pat = this; pat != null; pat = pat.m_relativePathPattern)
- {
- if (pat != this)
- buf.append("/");
-
- buf.append(Axis.getNames(pat.m_axis));
- buf.append("::");
-
- if (0x000005000 == pat.m_whatToShow)
- {
- buf.append("doc()");
- }
- else if (DTMFilter.SHOW_BYFUNCTION == pat.m_whatToShow)
- {
- buf.append("function()");
- }
- else if (DTMFilter.SHOW_ALL == pat.m_whatToShow)
- {
- buf.append("node()");
- }
- else if (DTMFilter.SHOW_TEXT == pat.m_whatToShow)
- {
- buf.append("text()");
- }
- else if (DTMFilter.SHOW_PROCESSING_INSTRUCTION == pat.m_whatToShow)
- {
- buf.append("processing-instruction(");
-
- if (null != pat.m_name)
- {
- buf.append(pat.m_name);
- }
-
- buf.append(")");
- }
- else if (DTMFilter.SHOW_COMMENT == pat.m_whatToShow)
- {
- buf.append("comment()");
- }
- else if (null != pat.m_name)
- {
- if (DTMFilter.SHOW_ATTRIBUTE == pat.m_whatToShow)
- {
- buf.append("@");
- }
-
- if (null != pat.m_namespace)
- {
- buf.append("{");
- buf.append(pat.m_namespace);
- buf.append("}");
- }
-
- buf.append(pat.m_name);
- }
- else if (DTMFilter.SHOW_ATTRIBUTE == pat.m_whatToShow)
- {
- buf.append("@");
- }
- else if ((DTMFilter.SHOW_DOCUMENT | DTMFilter.SHOW_DOCUMENT_FRAGMENT)
- == pat.m_whatToShow)
- {
- buf.append("doc-root()");
- }
- else
- {
- buf.append('?').append(Integer.toHexString(pat.m_whatToShow));
- }
-
- if (null != pat.m_predicates)
- {
- for (int i = 0; i < pat.m_predicates.length; i++)
- {
- buf.append("[");
- buf.append(pat.m_predicates[i]);
- buf.append("]");
- }
- }
- }
-
- return buf.toString();
- }
-
- /** Set to true to send diagnostics about pattern matches to the consol. */
- private static final boolean DEBUG_MATCHES = false;
-
- /**
- * Get the match score of the given node.
- *
- * @param xctxt The XPath runtime context.
- * @param context The node to be tested.
- *
- * @return {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NODETEST},
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NONE},
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NSWILD},
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_QNAME}, or
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_OTHER}.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public double getMatchScore(XPathContext xctxt, int context)
- throws javax.xml.transform.TransformerException
- {
-
- xctxt.pushCurrentNode(context);
- xctxt.pushCurrentExpressionNode(context);
-
- try
- {
- XObject score = execute(xctxt);
-
- return score.num();
- }
- finally
- {
- xctxt.popCurrentNode();
- xctxt.popCurrentExpressionNode();
- }
-
- // return XPath.MATCH_SCORE_NONE;
- }
-
- /**
- * Set the axis that this step should follow.
- *
- *
- * @param axis The Axis for this test, one of of Axes.ANCESTORORSELF, etc.
- */
- public void setAxis(int axis)
- {
- m_axis = axis;
- }
-
- /**
- * Get the axis that this step follows.
- *
- *
- * @return The Axis for this test, one of of Axes.ANCESTORORSELF, etc.
- */
- public int getAxis()
- {
- return m_axis;
- }
-
- class PredOwner implements ExpressionOwner
- {
- int m_index;
-
- PredOwner(int index)
- {
- m_index = index;
- }
-
- /**
- * @see ExpressionOwner#getExpression()
- */
- public Expression getExpression()
- {
- return m_predicates[m_index];
- }
-
-
- /**
- * @see ExpressionOwner#setExpression(Expression)
- */
- public void setExpression(Expression exp)
- {
- exp.exprSetParent(StepPattern.this);
- m_predicates[m_index] = exp;
- }
- }
-
- /**
- * @see com.sun.org.apache.xpath.internal.XPathVisitable#callVisitors(ExpressionOwner, XPathVisitor)
- */
- public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)
- {
- if(visitor.visitMatchPattern(owner, this))
- {
- callSubtreeVisitors(visitor);
- }
- }
-
- /**
- * Call the visitors on the subtree. Factored out from callVisitors
- * so it may be called by derived classes.
- */
- protected void callSubtreeVisitors(XPathVisitor visitor)
- {
- if (null != m_predicates)
- {
- int n = m_predicates.length;
- for (int i = 0; i < n; i++)
- {
- ExpressionOwner predOwner = new PredOwner(i);
- if (visitor.visitPredicate(predOwner, m_predicates[i]))
- {
- m_predicates[i].callVisitors(predOwner, visitor);
- }
- }
- }
- if (null != m_relativePathPattern)
- {
- m_relativePathPattern.callVisitors(this, visitor);
- }
- }
-
-
- /**
- * @see ExpressionOwner#getExpression()
- */
- public Expression getExpression()
- {
- return m_relativePathPattern;
- }
-
- /**
- * @see ExpressionOwner#setExpression(Expression)
- */
- public void setExpression(Expression exp)
- {
- exp.exprSetParent(this);
- m_relativePathPattern = (StepPattern)exp;
- }
-
- /**
- * @see Expression#deepEquals(Expression)
- */
- public boolean deepEquals(Expression expr)
- {
- if(!super.deepEquals(expr))
- return false;
-
- StepPattern sp = (StepPattern)expr;
-
- if (null != m_predicates)
- {
- int n = m_predicates.length;
- if ((null == sp.m_predicates) || (sp.m_predicates.length != n))
- return false;
- for (int i = 0; i < n; i++)
- {
- if (!m_predicates[i].deepEquals(sp.m_predicates[i]))
- return false;
- }
- }
- else if (null != sp.m_predicates)
- return false;
-
- if(null != m_relativePathPattern)
- {
- if(!m_relativePathPattern.deepEquals(sp.m_relativePathPattern))
- return false;
- }
- else if(sp.m_relativePathPattern != null)
- return false;
-
- return true;
- }
-
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/patterns/UnionPattern.java b/src/com/sun/org/apache/xpath/internal/patterns/UnionPattern.java
deleted file mode 100644
index 0199156..0000000
--- a/src/com/sun/org/apache/xpath/internal/patterns/UnionPattern.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: UnionPattern.java,v 1.2.4.1 2005/09/15 00:21:15 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.patterns;
-
-import com.sun.org.apache.xpath.internal.Expression;
-import com.sun.org.apache.xpath.internal.ExpressionOwner;
-import com.sun.org.apache.xpath.internal.XPathContext;
-import com.sun.org.apache.xpath.internal.XPathVisitor;
-import com.sun.org.apache.xpath.internal.objects.XObject;
-
-/**
- * This class represents a union pattern, which can have multiple individual
- * StepPattern patterns.
- * @xsl.usage advanced
- */
-public class UnionPattern extends Expression
-{
- static final long serialVersionUID = -6670449967116905820L;
-
- /** Array of the contained step patterns to be tested.
- * @serial */
- private StepPattern[] m_patterns;
-
- /**
- * No arguments to process, so this does nothing.
- */
- public void fixupVariables(java.util.Vector vars, int globalsSize)
- {
- for (int i = 0; i < m_patterns.length; i++)
- {
- m_patterns[i].fixupVariables(vars, globalsSize);
- }
- }
-
-
- /**
- * Tell if this expression or it's subexpressions can traverse outside
- * the current subtree.
- *
- * @return true if traversal outside the context node's subtree can occur.
- */
- public boolean canTraverseOutsideSubtree()
- {
- if(null != m_patterns)
- {
- int n = m_patterns.length;
- for (int i = 0; i < n; i++)
- {
- if(m_patterns[i].canTraverseOutsideSubtree())
- return true;
- }
- }
- return false;
- }
-
- /**
- * Set the contained step patterns to be tested.
- *
- *
- * @param patterns the contained step patterns to be tested.
- */
- public void setPatterns(StepPattern[] patterns)
- {
- m_patterns = patterns;
- if(null != patterns)
- {
- for(int i = 0; i < patterns.length; i++)
- {
- patterns[i].exprSetParent(this);
- }
- }
-
- }
-
- /**
- * Get the contained step patterns to be tested.
- *
- *
- * @return an array of the contained step patterns to be tested.
- */
- public StepPattern[] getPatterns()
- {
- return m_patterns;
- }
-
- /**
- * Test a node to see if it matches any of the patterns in the union.
- *
- * @param xctxt XPath runtime context.
- *
- * @return {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NODETEST},
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NONE},
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_NSWILD},
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_QNAME}, or
- * {@link com.sun.org.apache.xpath.internal.patterns.NodeTest#SCORE_OTHER}.
- *
- * @throws javax.xml.transform.TransformerException
- */
- public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
- {
-
- XObject bestScore = null;
- int n = m_patterns.length;
-
- for (int i = 0; i < n; i++)
- {
- XObject score = m_patterns[i].execute(xctxt);
-
- if (score != NodeTest.SCORE_NONE)
- {
- if (null == bestScore)
- bestScore = score;
- else if (score.num() > bestScore.num())
- bestScore = score;
- }
- }
-
- if (null == bestScore)
- {
- bestScore = NodeTest.SCORE_NONE;
- }
-
- return bestScore;
- }
-
- class UnionPathPartOwner implements ExpressionOwner
- {
- int m_index;
-
- UnionPathPartOwner(int index)
- {
- m_index = index;
- }
-
- /**
- * @see ExpressionOwner#getExpression()
- */
- public Expression getExpression()
- {
- return m_patterns[m_index];
- }
-
-
- /**
- * @see ExpressionOwner#setExpression(Expression)
- */
- public void setExpression(Expression exp)
- {
- exp.exprSetParent(UnionPattern.this);
- m_patterns[m_index] = (StepPattern)exp;
- }
- }
-
- /**
- * @see com.sun.org.apache.xpath.internal.XPathVisitable#callVisitors(ExpressionOwner, XPathVisitor)
- */
- public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)
- {
- visitor.visitUnionPattern(owner, this);
- if(null != m_patterns)
- {
- int n = m_patterns.length;
- for(int i = 0; i < n; i++)
- {
- m_patterns[i].callVisitors(new UnionPathPartOwner(i), visitor);
- }
- }
- }
-
- /**
- * @see Expression#deepEquals(Expression)
- */
- public boolean deepEquals(Expression expr)
- {
- if(!isSameClass(expr))
- return false;
-
- UnionPattern up = (UnionPattern)expr;
-
- if(null != m_patterns)
- {
- int n = m_patterns.length;
- if((null == up.m_patterns) || (up.m_patterns.length != n))
- return false;
-
- for(int i = 0; i < n; i++)
- {
- if(!m_patterns[i].deepEquals(up.m_patterns[i]))
- return false;
- }
- }
- else if(up.m_patterns != null)
- return false;
-
- return true;
-
- }
-
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/patterns/package.html b/src/com/sun/org/apache/xpath/internal/patterns/package.html
deleted file mode 100644
index 23b377e..0000000
--- a/src/com/sun/org/apache/xpath/internal/patterns/package.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!--
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
--->
-<!--
- * Copyright 2000-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
--->
-<!-- $Id: package.html,v 1.1.2.1 2005/08/01 01:30:29 jeffsuttor Exp $ -->
-<html>
- <title>XPath nodetest and XSLT pattern matching support.</title>
- <body>
- <p>Implementation of XPath nodeTest support, and XSLT pattern matching support.<p>
- </body>
-</html>
-
-
diff --git a/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources.java b/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources.java
deleted file mode 100644
index f96561b..0000000
--- a/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources.java
+++ /dev/null
@@ -1,936 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xpath.internal.res;
-
-import java.util.ListResourceBundle;
-
-/**
- * Set up error messages.
- * We build a two dimensional array of message keys and
- * message strings. In order to add a new message here,
- * you need to first add a Static string constant for the
- * Key and update the contents array with Key, Value pair
- * Also you need to update the count of messages(MAX_CODE)or
- * the count of warnings(MAX_WARNING) [ Information purpose only]
- * @xsl.usage advanced
- */
-public class XPATHErrorResources extends ListResourceBundle
-{
-
-/*
- * General notes to translators:
- *
- * This file contains error and warning messages related to XPath Error
- * Handling.
- *
- * 1) Xalan (or more properly, Xalan-interpretive) and XSLTC are names of
- * components.
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- * XSLTC is an acronym for XSLT Compiler.
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 5) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 6) "Translet" is an invented term that describes the class file that
- * results from compiling an XML stylesheet into a Java class.
- *
- * 7) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- * 8) The context node is the node in the document with respect to which an
- * XPath expression is being evaluated.
- *
- * 9) An iterator is an object that traverses nodes in the tree, one at a time.
- *
- * 10) NCName is an XML term used to describe a name that does not contain a
- * colon (a "no-colon name").
- *
- * 11) QName is an XML term meaning "qualified name".
- */
-
- /*
- * static variables
- */
- public static final String ERROR0000 = "ERROR0000";
- public static final String ER_CURRENT_NOT_ALLOWED_IN_MATCH =
- "ER_CURRENT_NOT_ALLOWED_IN_MATCH";
- public static final String ER_CURRENT_TAKES_NO_ARGS =
- "ER_CURRENT_TAKES_NO_ARGS";
- public static final String ER_DOCUMENT_REPLACED = "ER_DOCUMENT_REPLACED";
- public static final String ER_CONTEXT_HAS_NO_OWNERDOC =
- "ER_CONTEXT_HAS_NO_OWNERDOC";
- public static final String ER_LOCALNAME_HAS_TOO_MANY_ARGS =
- "ER_LOCALNAME_HAS_TOO_MANY_ARGS";
- public static final String ER_NAMESPACEURI_HAS_TOO_MANY_ARGS =
- "ER_NAMESPACEURI_HAS_TOO_MANY_ARGS";
- public static final String ER_NORMALIZESPACE_HAS_TOO_MANY_ARGS =
- "ER_NORMALIZESPACE_HAS_TOO_MANY_ARGS";
- public static final String ER_NUMBER_HAS_TOO_MANY_ARGS =
- "ER_NUMBER_HAS_TOO_MANY_ARGS";
- public static final String ER_NAME_HAS_TOO_MANY_ARGS =
- "ER_NAME_HAS_TOO_MANY_ARGS";
- public static final String ER_STRING_HAS_TOO_MANY_ARGS =
- "ER_STRING_HAS_TOO_MANY_ARGS";
- public static final String ER_STRINGLENGTH_HAS_TOO_MANY_ARGS =
- "ER_STRINGLENGTH_HAS_TOO_MANY_ARGS";
- public static final String ER_TRANSLATE_TAKES_3_ARGS =
- "ER_TRANSLATE_TAKES_3_ARGS";
- public static final String ER_UNPARSEDENTITYURI_TAKES_1_ARG =
- "ER_UNPARSEDENTITYURI_TAKES_1_ARG";
- public static final String ER_NAMESPACEAXIS_NOT_IMPLEMENTED =
- "ER_NAMESPACEAXIS_NOT_IMPLEMENTED";
- public static final String ER_UNKNOWN_AXIS = "ER_UNKNOWN_AXIS";
- public static final String ER_UNKNOWN_MATCH_OPERATION =
- "ER_UNKNOWN_MATCH_OPERATION";
- public static final String ER_INCORRECT_ARG_LENGTH ="ER_INCORRECT_ARG_LENGTH";
- public static final String ER_CANT_CONVERT_TO_NUMBER =
- "ER_CANT_CONVERT_TO_NUMBER";
- public static final String ER_CANT_CONVERT_XPATHRESULTTYPE_TO_NUMBER =
- "ER_CANT_CONVERT_XPATHRESULTTYPE_TO_NUMBER";
- public static final String ER_CANT_CONVERT_TO_NODELIST =
- "ER_CANT_CONVERT_TO_NODELIST";
- public static final String ER_CANT_CONVERT_TO_MUTABLENODELIST =
- "ER_CANT_CONVERT_TO_MUTABLENODELIST";
- public static final String ER_CANT_CONVERT_TO_TYPE ="ER_CANT_CONVERT_TO_TYPE";
- public static final String ER_EXPECTED_MATCH_PATTERN =
- "ER_EXPECTED_MATCH_PATTERN";
- public static final String ER_COULDNOT_GET_VAR_NAMED =
- "ER_COULDNOT_GET_VAR_NAMED";
- public static final String ER_UNKNOWN_OPCODE = "ER_UNKNOWN_OPCODE";
- public static final String ER_EXTRA_ILLEGAL_TOKENS ="ER_EXTRA_ILLEGAL_TOKENS";
- public static final String ER_EXPECTED_DOUBLE_QUOTE =
- "ER_EXPECTED_DOUBLE_QUOTE";
- public static final String ER_EXPECTED_SINGLE_QUOTE =
- "ER_EXPECTED_SINGLE_QUOTE";
- public static final String ER_EMPTY_EXPRESSION = "ER_EMPTY_EXPRESSION";
- public static final String ER_EXPECTED_BUT_FOUND = "ER_EXPECTED_BUT_FOUND";
- public static final String ER_INCORRECT_PROGRAMMER_ASSERTION =
- "ER_INCORRECT_PROGRAMMER_ASSERTION";
- public static final String ER_BOOLEAN_ARG_NO_LONGER_OPTIONAL =
- "ER_BOOLEAN_ARG_NO_LONGER_OPTIONAL";
- public static final String ER_FOUND_COMMA_BUT_NO_PRECEDING_ARG =
- "ER_FOUND_COMMA_BUT_NO_PRECEDING_ARG";
- public static final String ER_FOUND_COMMA_BUT_NO_FOLLOWING_ARG =
- "ER_FOUND_COMMA_BUT_NO_FOLLOWING_ARG";
- public static final String ER_PREDICATE_ILLEGAL_SYNTAX =
- "ER_PREDICATE_ILLEGAL_SYNTAX";
- public static final String ER_ILLEGAL_AXIS_NAME = "ER_ILLEGAL_AXIS_NAME";
- public static final String ER_UNKNOWN_NODETYPE = "ER_UNKNOWN_NODETYPE";
- public static final String ER_PATTERN_LITERAL_NEEDS_BE_QUOTED =
- "ER_PATTERN_LITERAL_NEEDS_BE_QUOTED";
- public static final String ER_COULDNOT_BE_FORMATTED_TO_NUMBER =
- "ER_COULDNOT_BE_FORMATTED_TO_NUMBER";
- public static final String ER_COULDNOT_CREATE_XMLPROCESSORLIAISON =
- "ER_COULDNOT_CREATE_XMLPROCESSORLIAISON";
- public static final String ER_DIDNOT_FIND_XPATH_SELECT_EXP =
- "ER_DIDNOT_FIND_XPATH_SELECT_EXP";
- public static final String ER_COULDNOT_FIND_ENDOP_AFTER_OPLOCATIONPATH =
- "ER_COULDNOT_FIND_ENDOP_AFTER_OPLOCATIONPATH";
- public static final String ER_ERROR_OCCURED = "ER_ERROR_OCCURED";
- public static final String ER_ILLEGAL_VARIABLE_REFERENCE =
- "ER_ILLEGAL_VARIABLE_REFERENCE";
- public static final String ER_AXES_NOT_ALLOWED = "ER_AXES_NOT_ALLOWED";
- public static final String ER_KEY_HAS_TOO_MANY_ARGS =
- "ER_KEY_HAS_TOO_MANY_ARGS";
- public static final String ER_COUNT_TAKES_1_ARG = "ER_COUNT_TAKES_1_ARG";
- public static final String ER_COULDNOT_FIND_FUNCTION =
- "ER_COULDNOT_FIND_FUNCTION";
- public static final String ER_UNSUPPORTED_ENCODING ="ER_UNSUPPORTED_ENCODING";
- public static final String ER_PROBLEM_IN_DTM_NEXTSIBLING =
- "ER_PROBLEM_IN_DTM_NEXTSIBLING";
- public static final String ER_CANNOT_WRITE_TO_EMPTYNODELISTIMPL =
- "ER_CANNOT_WRITE_TO_EMPTYNODELISTIMPL";
- public static final String ER_SETDOMFACTORY_NOT_SUPPORTED =
- "ER_SETDOMFACTORY_NOT_SUPPORTED";
- public static final String ER_PREFIX_MUST_RESOLVE = "ER_PREFIX_MUST_RESOLVE";
- public static final String ER_PARSE_NOT_SUPPORTED = "ER_PARSE_NOT_SUPPORTED";
- public static final String ER_SAX_API_NOT_HANDLED = "ER_SAX_API_NOT_HANDLED";
-public static final String ER_IGNORABLE_WHITESPACE_NOT_HANDLED =
- "ER_IGNORABLE_WHITESPACE_NOT_HANDLED";
- public static final String ER_DTM_CANNOT_HANDLE_NODES =
- "ER_DTM_CANNOT_HANDLE_NODES";
- public static final String ER_XERCES_CANNOT_HANDLE_NODES =
- "ER_XERCES_CANNOT_HANDLE_NODES";
- public static final String ER_XERCES_PARSE_ERROR_DETAILS =
- "ER_XERCES_PARSE_ERROR_DETAILS";
- public static final String ER_XERCES_PARSE_ERROR = "ER_XERCES_PARSE_ERROR";
- public static final String ER_INVALID_UTF16_SURROGATE =
- "ER_INVALID_UTF16_SURROGATE";
- public static final String ER_OIERROR = "ER_OIERROR";
- public static final String ER_CANNOT_CREATE_URL = "ER_CANNOT_CREATE_URL";
- public static final String ER_XPATH_READOBJECT = "ER_XPATH_READOBJECT";
- public static final String ER_FUNCTION_TOKEN_NOT_FOUND =
- "ER_FUNCTION_TOKEN_NOT_FOUND";
- public static final String ER_CANNOT_DEAL_XPATH_TYPE =
- "ER_CANNOT_DEAL_XPATH_TYPE";
- public static final String ER_NODESET_NOT_MUTABLE = "ER_NODESET_NOT_MUTABLE";
- public static final String ER_NODESETDTM_NOT_MUTABLE =
- "ER_NODESETDTM_NOT_MUTABLE";
- /** Variable not resolvable: */
- public static final String ER_VAR_NOT_RESOLVABLE = "ER_VAR_NOT_RESOLVABLE";
- /** Null error handler */
- public static final String ER_NULL_ERROR_HANDLER = "ER_NULL_ERROR_HANDLER";
- /** Programmer's assertion: unknown opcode */
- public static final String ER_PROG_ASSERT_UNKNOWN_OPCODE =
- "ER_PROG_ASSERT_UNKNOWN_OPCODE";
- /** 0 or 1 */
- public static final String ER_ZERO_OR_ONE = "ER_ZERO_OR_ONE";
- /** rtf() not supported by XRTreeFragSelectWrapper */
- public static final String ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** asNodeIterator() not supported by XRTreeFragSelectWrapper */
- public static final String ER_ASNODEITERATOR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER = "ER_ASNODEITERATOR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** fsb() not supported for XStringForChars */
- public static final String ER_FSB_NOT_SUPPORTED_XSTRINGFORCHARS =
- "ER_FSB_NOT_SUPPORTED_XSTRINGFORCHARS";
- /** Could not find variable with the name of */
- public static final String ER_COULD_NOT_FIND_VAR = "ER_COULD_NOT_FIND_VAR";
- /** XStringForChars can not take a string for an argument */
- public static final String ER_XSTRINGFORCHARS_CANNOT_TAKE_STRING =
- "ER_XSTRINGFORCHARS_CANNOT_TAKE_STRING";
- /** The FastStringBuffer argument can not be null */
- public static final String ER_FASTSTRINGBUFFER_CANNOT_BE_NULL =
- "ER_FASTSTRINGBUFFER_CANNOT_BE_NULL";
- /** 2 or 3 */
- public static final String ER_TWO_OR_THREE = "ER_TWO_OR_THREE";
- /** Variable accessed before it is bound! */
- public static final String ER_VARIABLE_ACCESSED_BEFORE_BIND =
- "ER_VARIABLE_ACCESSED_BEFORE_BIND";
- /** XStringForFSB can not take a string for an argument! */
- public static final String ER_FSB_CANNOT_TAKE_STRING =
- "ER_FSB_CANNOT_TAKE_STRING";
- /** Error! Setting the root of a walker to null! */
- public static final String ER_SETTING_WALKER_ROOT_TO_NULL =
- "ER_SETTING_WALKER_ROOT_TO_NULL";
- /** This NodeSetDTM can not iterate to a previous node! */
- public static final String ER_NODESETDTM_CANNOT_ITERATE =
- "ER_NODESETDTM_CANNOT_ITERATE";
- /** This NodeSet can not iterate to a previous node! */
- public static final String ER_NODESET_CANNOT_ITERATE =
- "ER_NODESET_CANNOT_ITERATE";
- /** This NodeSetDTM can not do indexing or counting functions! */
- public static final String ER_NODESETDTM_CANNOT_INDEX =
- "ER_NODESETDTM_CANNOT_INDEX";
- /** This NodeSet can not do indexing or counting functions! */
- public static final String ER_NODESET_CANNOT_INDEX =
- "ER_NODESET_CANNOT_INDEX";
- /** Can not call setShouldCacheNodes after nextNode has been called! */
- public static final String ER_CANNOT_CALL_SETSHOULDCACHENODE =
- "ER_CANNOT_CALL_SETSHOULDCACHENODE";
- /** {0} only allows {1} arguments */
- public static final String ER_ONLY_ALLOWS = "ER_ONLY_ALLOWS";
- /** Programmer's assertion in getNextStepPos: unknown stepType: {0} */
- public static final String ER_UNKNOWN_STEP = "ER_UNKNOWN_STEP";
- /** Problem with RelativeLocationPath */
- public static final String ER_EXPECTED_REL_LOC_PATH =
- "ER_EXPECTED_REL_LOC_PATH";
- /** Problem with LocationPath */
- public static final String ER_EXPECTED_LOC_PATH = "ER_EXPECTED_LOC_PATH";
- public static final String ER_EXPECTED_LOC_PATH_AT_END_EXPR =
- "ER_EXPECTED_LOC_PATH_AT_END_EXPR";
- /** Problem with Step */
- public static final String ER_EXPECTED_LOC_STEP = "ER_EXPECTED_LOC_STEP";
- /** Problem with NodeTest */
- public static final String ER_EXPECTED_NODE_TEST = "ER_EXPECTED_NODE_TEST";
- /** Expected step pattern */
- public static final String ER_EXPECTED_STEP_PATTERN =
- "ER_EXPECTED_STEP_PATTERN";
- /** Expected relative path pattern */
- public static final String ER_EXPECTED_REL_PATH_PATTERN =
- "ER_EXPECTED_REL_PATH_PATTERN";
- /** ER_CANT_CONVERT_XPATHRESULTTYPE_TO_BOOLEAN */
- public static final String ER_CANT_CONVERT_TO_BOOLEAN =
- "ER_CANT_CONVERT_TO_BOOLEAN";
- /** Field ER_CANT_CONVERT_TO_SINGLENODE */
- public static final String ER_CANT_CONVERT_TO_SINGLENODE =
- "ER_CANT_CONVERT_TO_SINGLENODE";
- /** Field ER_CANT_GET_SNAPSHOT_LENGTH */
- public static final String ER_CANT_GET_SNAPSHOT_LENGTH =
- "ER_CANT_GET_SNAPSHOT_LENGTH";
- /** Field ER_NON_ITERATOR_TYPE */
- public static final String ER_NON_ITERATOR_TYPE = "ER_NON_ITERATOR_TYPE";
- /** Field ER_DOC_MUTATED */
- public static final String ER_DOC_MUTATED = "ER_DOC_MUTATED";
- public static final String ER_INVALID_XPATH_TYPE = "ER_INVALID_XPATH_TYPE";
- public static final String ER_EMPTY_XPATH_RESULT = "ER_EMPTY_XPATH_RESULT";
- public static final String ER_INCOMPATIBLE_TYPES = "ER_INCOMPATIBLE_TYPES";
- public static final String ER_NULL_RESOLVER = "ER_NULL_RESOLVER";
- public static final String ER_CANT_CONVERT_TO_STRING =
- "ER_CANT_CONVERT_TO_STRING";
- public static final String ER_NON_SNAPSHOT_TYPE = "ER_NON_SNAPSHOT_TYPE";
- public static final String ER_WRONG_DOCUMENT = "ER_WRONG_DOCUMENT";
- /* Note to translators: The XPath expression cannot be evaluated with respect
- * to this type of node.
- */
- /** Field ER_WRONG_NODETYPE */
- public static final String ER_WRONG_NODETYPE = "ER_WRONG_NODETYPE";
- public static final String ER_XPATH_ERROR = "ER_XPATH_ERROR";
-
- //BEGIN: Keys needed for exception messages of JAXP 1.3 XPath API implementation
- public static final String ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED = "ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED";
- public static final String ER_RESOLVE_VARIABLE_RETURNS_NULL = "ER_RESOLVE_VARIABLE_RETURNS_NULL";
- public static final String ER_UNSUPPORTED_RETURN_TYPE = "ER_UNSUPPORTED_RETURN_TYPE";
- public static final String ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL = "ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL";
- public static final String ER_ARG_CANNOT_BE_NULL = "ER_ARG_CANNOT_BE_NULL";
-
- public static final String ER_OBJECT_MODEL_NULL = "ER_OBJECT_MODEL_NULL";
- public static final String ER_OBJECT_MODEL_EMPTY = "ER_OBJECT_MODEL_EMPTY";
- public static final String ER_FEATURE_NAME_NULL = "ER_FEATURE_NAME_NULL";
- public static final String ER_FEATURE_UNKNOWN = "ER_FEATURE_UNKNOWN";
- public static final String ER_GETTING_NULL_FEATURE = "ER_GETTING_NULL_FEATURE";
- public static final String ER_GETTING_UNKNOWN_FEATURE = "ER_GETTING_UNKNOWN_FEATURE";
- public static final String ER_SECUREPROCESSING_FEATURE = "ER_SECUREPROCESSING_FEATURE";
- public static final String ER_NULL_XPATH_FUNCTION_RESOLVER = "ER_NULL_XPATH_FUNCTION_RESOLVER";
- public static final String ER_NULL_XPATH_VARIABLE_RESOLVER = "ER_NULL_XPATH_VARIABLE_RESOLVER";
- //END: Keys needed for exception messages of JAXP 1.3 XPath API implementation
-
- public static final String WG_LOCALE_NAME_NOT_HANDLED =
- "WG_LOCALE_NAME_NOT_HANDLED";
- public static final String WG_PROPERTY_NOT_SUPPORTED =
- "WG_PROPERTY_NOT_SUPPORTED";
- public static final String WG_DONT_DO_ANYTHING_WITH_NS =
- "WG_DONT_DO_ANYTHING_WITH_NS";
- public static final String WG_SECURITY_EXCEPTION = "WG_SECURITY_EXCEPTION";
- public static final String WG_QUO_NO_LONGER_DEFINED =
- "WG_QUO_NO_LONGER_DEFINED";
- public static final String WG_NEED_DERIVED_OBJECT_TO_IMPLEMENT_NODETEST =
- "WG_NEED_DERIVED_OBJECT_TO_IMPLEMENT_NODETEST";
- public static final String WG_FUNCTION_TOKEN_NOT_FOUND =
- "WG_FUNCTION_TOKEN_NOT_FOUND";
- public static final String WG_COULDNOT_FIND_FUNCTION =
- "WG_COULDNOT_FIND_FUNCTION";
- public static final String WG_CANNOT_MAKE_URL_FROM ="WG_CANNOT_MAKE_URL_FROM";
- public static final String WG_EXPAND_ENTITIES_NOT_SUPPORTED =
- "WG_EXPAND_ENTITIES_NOT_SUPPORTED";
- public static final String WG_ILLEGAL_VARIABLE_REFERENCE =
- "WG_ILLEGAL_VARIABLE_REFERENCE";
- public static final String WG_UNSUPPORTED_ENCODING ="WG_UNSUPPORTED_ENCODING";
-
- /** detach() not supported by XRTreeFragSelectWrapper */
- public static final String ER_DETACH_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_DETACH_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** num() not supported by XRTreeFragSelectWrapper */
- public static final String ER_NUM_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_NUM_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** xstr() not supported by XRTreeFragSelectWrapper */
- public static final String ER_XSTR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_XSTR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** str() not supported by XRTreeFragSelectWrapper */
- public static final String ER_STR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_STR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
-
- // Error messages...
-
- private static final Object[][] _contents = new Object[][]{
-
- { "ERROR0000" , "{0}" },
-
- { ER_CURRENT_NOT_ALLOWED_IN_MATCH, "The current() function is not allowed in a match pattern!" },
-
- { ER_CURRENT_TAKES_NO_ARGS, "The current() function does not accept arguments!" },
-
- { ER_DOCUMENT_REPLACED,
- "document() function implementation has been replaced by com.sun.org.apache.xalan.internal.xslt.FuncDocument!"},
-
- { ER_CONTEXT_HAS_NO_OWNERDOC,
- "context does not have an owner document!"},
-
- { ER_LOCALNAME_HAS_TOO_MANY_ARGS,
- "local-name() has too many arguments."},
-
- { ER_NAMESPACEURI_HAS_TOO_MANY_ARGS,
- "namespace-uri() has too many arguments."},
-
- { ER_NORMALIZESPACE_HAS_TOO_MANY_ARGS,
- "normalize-space() has too many arguments."},
-
- { ER_NUMBER_HAS_TOO_MANY_ARGS,
- "number() has too many arguments."},
-
- { ER_NAME_HAS_TOO_MANY_ARGS,
- "name() has too many arguments."},
-
- { ER_STRING_HAS_TOO_MANY_ARGS,
- "string() has too many arguments."},
-
- { ER_STRINGLENGTH_HAS_TOO_MANY_ARGS,
- "string-length() has too many arguments."},
-
- { ER_TRANSLATE_TAKES_3_ARGS,
- "The translate() function takes three arguments!"},
-
- { ER_UNPARSEDENTITYURI_TAKES_1_ARG,
- "The unparsed-entity-uri function should take one argument!"},
-
- { ER_NAMESPACEAXIS_NOT_IMPLEMENTED,
- "namespace axis not implemented yet!"},
-
- { ER_UNKNOWN_AXIS,
- "unknown axis: {0}"},
-
- { ER_UNKNOWN_MATCH_OPERATION,
- "unknown match operation!"},
-
- { ER_INCORRECT_ARG_LENGTH,
- "Arg length of processing-instruction() node test is incorrect!"},
-
- { ER_CANT_CONVERT_TO_NUMBER,
- "Can not convert {0} to a number"},
-
- { ER_CANT_CONVERT_TO_NODELIST,
- "Can not convert {0} to a NodeList!"},
-
- { ER_CANT_CONVERT_TO_MUTABLENODELIST,
- "Can not convert {0} to a NodeSetDTM!"},
-
- { ER_CANT_CONVERT_TO_TYPE,
- "Can not convert {0} to a type#{1}"},
-
- { ER_EXPECTED_MATCH_PATTERN,
- "Expected match pattern in getMatchScore!"},
-
- { ER_COULDNOT_GET_VAR_NAMED,
- "Could not get variable named {0}"},
-
- { ER_UNKNOWN_OPCODE,
- "ERROR! Unknown op code: {0}"},
-
- { ER_EXTRA_ILLEGAL_TOKENS,
- "Extra illegal tokens: {0}"},
-
- { ER_EXPECTED_DOUBLE_QUOTE,
- "misquoted literal... expected double quote!"},
-
- { ER_EXPECTED_SINGLE_QUOTE,
- "misquoted literal... expected single quote!"},
-
- { ER_EMPTY_EXPRESSION,
- "Empty expression!"},
-
- { ER_EXPECTED_BUT_FOUND,
- "Expected {0}, but found: {1}"},
-
- { ER_INCORRECT_PROGRAMMER_ASSERTION,
- "Programmer assertion is incorrect! - {0}"},
-
- { ER_BOOLEAN_ARG_NO_LONGER_OPTIONAL,
- "boolean(...) argument is no longer optional with 19990709 XPath draft."},
-
- { ER_FOUND_COMMA_BUT_NO_PRECEDING_ARG,
- "Found ',' but no preceding argument!"},
-
- { ER_FOUND_COMMA_BUT_NO_FOLLOWING_ARG,
- "Found ',' but no following argument!"},
-
- { ER_PREDICATE_ILLEGAL_SYNTAX,
- "'..[predicate]' or '.[predicate]' is illegal syntax. Use 'self::node()[predicate]' instead."},
-
- { ER_ILLEGAL_AXIS_NAME,
- "illegal axis name: {0}"},
-
- { ER_UNKNOWN_NODETYPE,
- "Unknown nodetype: {0}"},
-
- { ER_PATTERN_LITERAL_NEEDS_BE_QUOTED,
- "Pattern literal ({0}) needs to be quoted!"},
-
- { ER_COULDNOT_BE_FORMATTED_TO_NUMBER,
- "{0} could not be formatted to a number!"},
-
- { ER_COULDNOT_CREATE_XMLPROCESSORLIAISON,
- "Could not create XML TransformerFactory Liaison: {0}"},
-
- { ER_DIDNOT_FIND_XPATH_SELECT_EXP,
- "Error! Did not find xpath select expression (-select)."},
-
- { ER_COULDNOT_FIND_ENDOP_AFTER_OPLOCATIONPATH,
- "ERROR! Could not find ENDOP after OP_LOCATIONPATH"},
-
- { ER_ERROR_OCCURED,
- "Error occured!"},
-
- { ER_ILLEGAL_VARIABLE_REFERENCE,
- "VariableReference given for variable out of context or without definition! Name = {0}"},
-
- { ER_AXES_NOT_ALLOWED,
- "Only child:: and attribute:: axes are allowed in match patterns! Offending axes = {0}"},
-
- { ER_KEY_HAS_TOO_MANY_ARGS,
- "key() has an incorrect number of arguments."},
-
- { ER_COUNT_TAKES_1_ARG,
- "The count function should take one argument!"},
-
- { ER_COULDNOT_FIND_FUNCTION,
- "Could not find function: {0}"},
-
- { ER_UNSUPPORTED_ENCODING,
- "Unsupported encoding: {0}"},
-
- { ER_PROBLEM_IN_DTM_NEXTSIBLING,
- "Problem occured in DTM in getNextSibling... trying to recover"},
-
- { ER_CANNOT_WRITE_TO_EMPTYNODELISTIMPL,
- "Programmer error: EmptyNodeList can not be written to."},
-
- { ER_SETDOMFACTORY_NOT_SUPPORTED,
- "setDOMFactory is not supported by XPathContext!"},
-
- { ER_PREFIX_MUST_RESOLVE,
- "Prefix must resolve to a namespace: {0}"},
-
- { ER_PARSE_NOT_SUPPORTED,
- "parse (InputSource source) not supported in XPathContext! Can not open {0}"},
-
- { ER_SAX_API_NOT_HANDLED,
- "SAX API characters(char ch[]... not handled by the DTM!"},
-
- { ER_IGNORABLE_WHITESPACE_NOT_HANDLED,
- "ignorableWhitespace(char ch[]... not handled by the DTM!"},
-
- { ER_DTM_CANNOT_HANDLE_NODES,
- "DTMLiaison can not handle nodes of type {0}"},
-
- { ER_XERCES_CANNOT_HANDLE_NODES,
- "DOM2Helper can not handle nodes of type {0}"},
-
- { ER_XERCES_PARSE_ERROR_DETAILS,
- "DOM2Helper.parse error: SystemID - {0} line - {1}"},
-
- { ER_XERCES_PARSE_ERROR,
- "DOM2Helper.parse error"},
-
- { ER_INVALID_UTF16_SURROGATE,
- "Invalid UTF-16 surrogate detected: {0} ?"},
-
- { ER_OIERROR,
- "IO error"},
-
- { ER_CANNOT_CREATE_URL,
- "Cannot create url for: {0}"},
-
- { ER_XPATH_READOBJECT,
- "In XPath.readObject: {0}"},
-
- { ER_FUNCTION_TOKEN_NOT_FOUND,
- "function token not found."},
-
- { ER_CANNOT_DEAL_XPATH_TYPE,
- "Can not deal with XPath type: {0}"},
-
- { ER_NODESET_NOT_MUTABLE,
- "This NodeSet is not mutable"},
-
- { ER_NODESETDTM_NOT_MUTABLE,
- "This NodeSetDTM is not mutable"},
-
- { ER_VAR_NOT_RESOLVABLE,
- "Variable not resolvable: {0}"},
-
- { ER_NULL_ERROR_HANDLER,
- "Null error handler"},
-
- { ER_PROG_ASSERT_UNKNOWN_OPCODE,
- "Programmer''s assertion: unknown opcode: {0}"},
-
- { ER_ZERO_OR_ONE,
- "0 or 1"},
-
- { ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "rtf() not supported by XRTreeFragSelectWrapper"},
-
- { ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "asNodeIterator() not supported by XRTreeFragSelectWrapper"},
-
- /** detach() not supported by XRTreeFragSelectWrapper */
- { ER_DETACH_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "detach() not supported by XRTreeFragSelectWrapper"},
-
- /** num() not supported by XRTreeFragSelectWrapper */
- { ER_NUM_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "num() not supported by XRTreeFragSelectWrapper"},
-
- /** xstr() not supported by XRTreeFragSelectWrapper */
- { ER_XSTR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "xstr() not supported by XRTreeFragSelectWrapper"},
-
- /** str() not supported by XRTreeFragSelectWrapper */
- { ER_STR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "str() not supported by XRTreeFragSelectWrapper"},
-
- { ER_FSB_NOT_SUPPORTED_XSTRINGFORCHARS,
- "fsb() not supported for XStringForChars"},
-
- { ER_COULD_NOT_FIND_VAR,
- "Could not find variable with the name of {0}"},
-
- { ER_XSTRINGFORCHARS_CANNOT_TAKE_STRING,
- "XStringForChars can not take a string for an argument"},
-
- { ER_FASTSTRINGBUFFER_CANNOT_BE_NULL,
- "The FastStringBuffer argument can not be null"},
-
- { ER_TWO_OR_THREE,
- "2 or 3"},
-
- { ER_VARIABLE_ACCESSED_BEFORE_BIND,
- "Variable accessed before it is bound!"},
-
- { ER_FSB_CANNOT_TAKE_STRING,
- "XStringForFSB can not take a string for an argument!"},
-
- { ER_SETTING_WALKER_ROOT_TO_NULL,
- "\n !!!! Error! Setting the root of a walker to null!!!"},
-
- { ER_NODESETDTM_CANNOT_ITERATE,
- "This NodeSetDTM can not iterate to a previous node!"},
-
- { ER_NODESET_CANNOT_ITERATE,
- "This NodeSet can not iterate to a previous node!"},
-
- { ER_NODESETDTM_CANNOT_INDEX,
- "This NodeSetDTM can not do indexing or counting functions!"},
-
- { ER_NODESET_CANNOT_INDEX,
- "This NodeSet can not do indexing or counting functions!"},
-
- { ER_CANNOT_CALL_SETSHOULDCACHENODE,
- "Can not call setShouldCacheNodes after nextNode has been called!"},
-
- { ER_ONLY_ALLOWS,
- "{0} only allows {1} arguments"},
-
- { ER_UNKNOWN_STEP,
- "Programmer''s assertion in getNextStepPos: unknown stepType: {0}"},
-
- //Note to translators: A relative location path is a form of XPath expression.
- // The message indicates that such an expression was expected following the
- // characters '/' or '//', but was not found.
- { ER_EXPECTED_REL_LOC_PATH,
- "A relative location path was expected following the '/' or '//' token."},
-
- // Note to translators: A location path is a form of XPath expression.
- // The message indicates that syntactically such an expression was expected,but
- // the characters specified by the substitution text were encountered instead.
- { ER_EXPECTED_LOC_PATH,
- "A location path was expected, but the following token was encountered\u003a {0}"},
-
- // Note to translators: A location path is a form of XPath expression.
- // The message indicates that syntactically such a subexpression was expected,
- // but no more characters were found in the expression.
- { ER_EXPECTED_LOC_PATH_AT_END_EXPR,
- "A location path was expected, but the end of the XPath expression was found instead."},
-
- // Note to translators: A location step is part of an XPath expression.
- // The message indicates that syntactically such an expression was expected
- // following the specified characters.
- { ER_EXPECTED_LOC_STEP,
- "A location step was expected following the '/' or '//' token."},
-
- // Note to translators: A node test is part of an XPath expression that is
- // used to test for particular kinds of nodes. In this case, a node test that
- // consists of an NCName followed by a colon and an asterisk or that consists
- // of a QName was expected, but was not found.
- { ER_EXPECTED_NODE_TEST,
- "A node test that matches either NCName:* or QName was expected."},
-
- // Note to translators: A step pattern is part of an XPath expression.
- // The message indicates that syntactically such an expression was expected,
- // but the specified character was found in the expression instead.
- { ER_EXPECTED_STEP_PATTERN,
- "A step pattern was expected, but '/' was encountered."},
-
- // Note to translators: A relative path pattern is part of an XPath expression.
- // The message indicates that syntactically such an expression was expected,
- // but was not found.
- { ER_EXPECTED_REL_PATH_PATTERN,
- "A relative path pattern was expected."},
-
- // Note to translators: The substitution text is the name of a data type. The
- // message indicates that a value of a particular type could not be converted
- // to a value of type boolean.
- { ER_CANT_CONVERT_TO_BOOLEAN,
- "The XPathResult of XPath expression ''{0}'' has an XPathResultType of {1} which cannot be converted to a boolean."},
-
- // Note to translators: Do not translate ANY_UNORDERED_NODE_TYPE and
- // FIRST_ORDERED_NODE_TYPE.
- { ER_CANT_CONVERT_TO_SINGLENODE,
- "The XPathResult of XPath expression ''{0}'' has an XPathResultType of {1} which cannot be converted to a single node. The method getSingleNodeValue applies only to types ANY_UNORDERED_NODE_TYPE and FIRST_ORDERED_NODE_TYPE."},
-
- // Note to translators: Do not translate UNORDERED_NODE_SNAPSHOT_TYPE and
- // ORDERED_NODE_SNAPSHOT_TYPE.
- { ER_CANT_GET_SNAPSHOT_LENGTH,
- "The method getSnapshotLength cannot be called on the XPathResult of XPath expression ''{0}'' because its XPathResultType is {1}. This method applies only to types UNORDERED_NODE_SNAPSHOT_TYPE and ORDERED_NODE_SNAPSHOT_TYPE."},
-
- { ER_NON_ITERATOR_TYPE,
- "The method iterateNext cannot be called on the XPathResult of XPath expression ''{0}'' because its XPathResultType is {1}. This method applies only to types UNORDERED_NODE_ITERATOR_TYPE and ORDERED_NODE_ITERATOR_TYPE."},
-
- // Note to translators: This message indicates that the document being operated
- // upon changed, so the iterator object that was being used to traverse the
- // document has now become invalid.
- { ER_DOC_MUTATED,
- "Document mutated since result was returned. Iterator is invalid."},
-
- { ER_INVALID_XPATH_TYPE,
- "Invalid XPath type argument: {0}"},
-
- { ER_EMPTY_XPATH_RESULT,
- "Empty XPath result object"},
-
- { ER_INCOMPATIBLE_TYPES,
- "The XPathResult of XPath expression ''{0}'' has an XPathResultType of {1} which cannot be coerced into the specified XPathResultType of {2}."},
-
- { ER_NULL_RESOLVER,
- "Unable to resolve prefix with null prefix resolver."},
-
- // Note to translators: The substitution text is the name of a data type. The
- // message indicates that a value of a particular type could not be converted
- // to a value of type string.
- { ER_CANT_CONVERT_TO_STRING,
- "The XPathResult of XPath expression ''{0}'' has an XPathResultType of {1} which cannot be converted to a string."},
-
- // Note to translators: Do not translate snapshotItem,
- // UNORDERED_NODE_SNAPSHOT_TYPE and ORDERED_NODE_SNAPSHOT_TYPE.
- { ER_NON_SNAPSHOT_TYPE,
- "The method snapshotItem cannot be called on the XPathResult of XPath expression ''{0}'' because its XPathResultType is {1}. This method applies only to types UNORDERED_NODE_SNAPSHOT_TYPE and ORDERED_NODE_SNAPSHOT_TYPE."},
-
- // Note to translators: XPathEvaluator is a Java interface name. An
- // XPathEvaluator is created with respect to a particular XML document, and in
- // this case the expression represented by this object was being evaluated with
- // respect to a context node from a different document.
- { ER_WRONG_DOCUMENT,
- "Context node does not belong to the document that is bound to this XPathEvaluator."},
-
- // Note to translators: The XPath expression cannot be evaluated with respect
- // to this type of node.
- { ER_WRONG_NODETYPE,
- "The context node type is not supported."},
-
- { ER_XPATH_ERROR,
- "Unknown error in XPath."},
-
- { ER_CANT_CONVERT_XPATHRESULTTYPE_TO_NUMBER,
- "The XPathResult of XPath expression ''{0}'' has an XPathResultType of {1} which cannot be converted to a number"},
-
- //BEGIN: Definitions of error keys used in exception messages of JAXP 1.3 XPath API implementation
-
- /** Field ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED */
-
- { ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED,
- "Extension function: ''{0}'' can not be invoked when the XMLConstants.FEATURE_SECURE_PROCESSING feature is set to true."},
-
- /** Field ER_RESOLVE_VARIABLE_RETURNS_NULL */
-
- { ER_RESOLVE_VARIABLE_RETURNS_NULL,
- "resolveVariable for variable {0} returning null"},
-
- /** Field ER_UNSUPPORTED_RETURN_TYPE */
-
- { ER_UNSUPPORTED_RETURN_TYPE,
- "UnSupported Return Type : {0}"},
-
- /** Field ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL */
-
- { ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL,
- "Source and/or Return Type can not be null"},
-
- /** Field ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL */
-
- { ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL,
- "Source and/or Return Type can not be null"},
-
- /** Field ER_ARG_CANNOT_BE_NULL */
-
- { ER_ARG_CANNOT_BE_NULL,
- "{0} argument can not be null"},
-
- /** Field ER_OBJECT_MODEL_NULL */
-
- { ER_OBJECT_MODEL_NULL,
- "{0}#isObjectModelSupported( String objectModel ) cannot be called with objectModel == null"},
-
- /** Field ER_OBJECT_MODEL_EMPTY */
-
- { ER_OBJECT_MODEL_EMPTY,
- "{0}#isObjectModelSupported( String objectModel ) cannot be called with objectModel == \"\""},
-
- /** Field ER_OBJECT_MODEL_EMPTY */
-
- { ER_FEATURE_NAME_NULL,
- "Trying to set a feature with a null name: {0}#setFeature( null, {1})"},
-
- /** Field ER_FEATURE_UNKNOWN */
-
- { ER_FEATURE_UNKNOWN,
- "Trying to set the unknown feature \"{0}\":{1}#setFeature({0},{2})"},
-
- /** Field ER_GETTING_NULL_FEATURE */
-
- { ER_GETTING_NULL_FEATURE,
- "Trying to get a feature with a null name: {0}#getFeature(null)"},
-
- /** Field ER_GETTING_NULL_FEATURE */
-
- { ER_GETTING_UNKNOWN_FEATURE,
- "Trying to get the unknown feature \"{0}\":{1}#getFeature({0})"},
-
- {ER_SECUREPROCESSING_FEATURE,
- "FEATURE_SECURE_PROCESSING: Cannot set the feature to false when security manager is present: {1}#setFeature({0},{2})"},
-
- /** Field ER_NULL_XPATH_FUNCTION_RESOLVER */
-
- { ER_NULL_XPATH_FUNCTION_RESOLVER,
- "Attempting to set a null XPathFunctionResolver:{0}#setXPathFunctionResolver(null)"},
-
- /** Field ER_NULL_XPATH_VARIABLE_RESOLVER */
-
- { ER_NULL_XPATH_VARIABLE_RESOLVER,
- "Attempting to set a null XPathVariableResolver:{0}#setXPathVariableResolver(null)"},
-
- //END: Definitions of error keys used in exception messages of JAXP 1.3 XPath API implementation
-
- // Warnings...
-
- { WG_LOCALE_NAME_NOT_HANDLED,
- "locale name in the format-number function not yet handled!"},
-
- { WG_PROPERTY_NOT_SUPPORTED,
- "XSL Property not supported: {0}"},
-
- { WG_DONT_DO_ANYTHING_WITH_NS,
- "Do not currently do anything with namespace {0} in property: {1}"},
-
- { WG_SECURITY_EXCEPTION,
- "SecurityException when trying to access XSL system property: {0}"},
-
- { WG_QUO_NO_LONGER_DEFINED,
- "Old syntax: quo(...) is no longer defined in XPath."},
-
- { WG_NEED_DERIVED_OBJECT_TO_IMPLEMENT_NODETEST,
- "XPath needs a derived object to implement nodeTest!"},
-
- { WG_FUNCTION_TOKEN_NOT_FOUND,
- "function token not found."},
-
- { WG_COULDNOT_FIND_FUNCTION,
- "Could not find function: {0}"},
-
- { WG_CANNOT_MAKE_URL_FROM,
- "Can not make URL from: {0}"},
-
- { WG_EXPAND_ENTITIES_NOT_SUPPORTED,
- "-E option not supported for DTM parser"},
-
- { WG_ILLEGAL_VARIABLE_REFERENCE,
- "VariableReference given for variable out of context or without definition! Name = {0}"},
-
- { WG_UNSUPPORTED_ENCODING,
- "Unsupported encoding: {0}"},
-
-
-
- // Other miscellaneous text used inside the code...
- { "ui_language", "en"},
- { "help_language", "en"},
- { "language", "en"},
- { "BAD_CODE", "Parameter to createMessage was out of bounds"},
- { "FORMAT_FAILED", "Exception thrown during messageFormat call"},
- { "version", ">>>>>>> Xalan Version "},
- { "version2", "<<<<<<<"},
- { "yes", "yes"},
- { "line", "Line #"},
- { "column", "Column #"},
- { "xsldone", "XSLProcessor: done"},
- { "xpath_option", "xpath options: "},
- { "optionIN", " [-in inputXMLURL]"},
- { "optionSelect", " [-select xpath expression]"},
- { "optionMatch", " [-match match pattern (for match diagnostics)]"},
- { "optionAnyExpr", "Or just an xpath expression will do a diagnostic dump"},
- { "noParsermsg1", "XSL Process was not successful."},
- { "noParsermsg2", "** Could not find parser **"},
- { "noParsermsg3", "Please check your classpath."},
- { "noParsermsg4", "If you don't have IBM's XML Parser for Java, you can download it from"},
- { "noParsermsg5", "IBM's AlphaWorks: http://www.alphaworks.ibm.com/formula/xml"},
- { "gtone", ">1" },
- { "zero", "0" },
- { "one", "1" },
- { "two" , "2" },
- { "three", "3" }
-
- };
-
- /**
- * Get the association list.
- *
- * @return The association list.
- */
- public Object[][] getContents()
- {
- return _contents;
- }
-
-
- // ================= INFRASTRUCTURE ======================
-
- /** Field BAD_CODE */
- public static final String BAD_CODE = "BAD_CODE";
-
- /** Field FORMAT_FAILED */
- public static final String FORMAT_FAILED = "FORMAT_FAILED";
-
- /** Field ERROR_RESOURCES */
- public static final String ERROR_RESOURCES =
- "com.sun.org.apache.xpath.internal.res.XPATHErrorResources";
-
- /** Field ERROR_STRING */
- public static final String ERROR_STRING = "#error";
-
- /** Field ERROR_HEADER */
- public static final String ERROR_HEADER = "Error: ";
-
- /** Field WARNING_HEADER */
- public static final String WARNING_HEADER = "Warning: ";
-
- /** Field XSL_HEADER */
- public static final String XSL_HEADER = "XSL ";
-
- /** Field XML_HEADER */
- public static final String XML_HEADER = "XML ";
-
- /** Field QUERY_HEADER */
- public static final String QUERY_HEADER = "PATTERN ";
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_de.java b/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_de.java
deleted file mode 100644
index e7624ef..0000000
--- a/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_de.java
+++ /dev/null
@@ -1,936 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xpath.internal.res;
-
-import java.util.ListResourceBundle;
-
-/**
- * Set up error messages.
- * We build a two dimensional array of message keys and
- * message strings. In order to add a new message here,
- * you need to first add a Static string constant for the
- * Key and update the contents array with Key, Value pair
- * Also you need to update the count of messages(MAX_CODE)or
- * the count of warnings(MAX_WARNING) [ Information purpose only]
- * @xsl.usage advanced
- */
-public class XPATHErrorResources_de extends ListResourceBundle
-{
-
-/*
- * General notes to translators:
- *
- * This file contains error and warning messages related to XPath Error
- * Handling.
- *
- * 1) Xalan (or more properly, Xalan-interpretive) and XSLTC are names of
- * components.
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- * XSLTC is an acronym for XSLT Compiler.
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 5) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 6) "Translet" is an invented term that describes the class file that
- * results from compiling an XML stylesheet into a Java class.
- *
- * 7) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- * 8) The context node is the node in the document with respect to which an
- * XPath expression is being evaluated.
- *
- * 9) An iterator is an object that traverses nodes in the tree, one at a time.
- *
- * 10) NCName is an XML term used to describe a name that does not contain a
- * colon (a "no-colon name").
- *
- * 11) QName is an XML term meaning "qualified name".
- */
-
- /*
- * static variables
- */
- public static final String ERROR0000 = "ERROR0000";
- public static final String ER_CURRENT_NOT_ALLOWED_IN_MATCH =
- "ER_CURRENT_NOT_ALLOWED_IN_MATCH";
- public static final String ER_CURRENT_TAKES_NO_ARGS =
- "ER_CURRENT_TAKES_NO_ARGS";
- public static final String ER_DOCUMENT_REPLACED = "ER_DOCUMENT_REPLACED";
- public static final String ER_CONTEXT_HAS_NO_OWNERDOC =
- "ER_CONTEXT_HAS_NO_OWNERDOC";
- public static final String ER_LOCALNAME_HAS_TOO_MANY_ARGS =
- "ER_LOCALNAME_HAS_TOO_MANY_ARGS";
- public static final String ER_NAMESPACEURI_HAS_TOO_MANY_ARGS =
- "ER_NAMESPACEURI_HAS_TOO_MANY_ARGS";
- public static final String ER_NORMALIZESPACE_HAS_TOO_MANY_ARGS =
- "ER_NORMALIZESPACE_HAS_TOO_MANY_ARGS";
- public static final String ER_NUMBER_HAS_TOO_MANY_ARGS =
- "ER_NUMBER_HAS_TOO_MANY_ARGS";
- public static final String ER_NAME_HAS_TOO_MANY_ARGS =
- "ER_NAME_HAS_TOO_MANY_ARGS";
- public static final String ER_STRING_HAS_TOO_MANY_ARGS =
- "ER_STRING_HAS_TOO_MANY_ARGS";
- public static final String ER_STRINGLENGTH_HAS_TOO_MANY_ARGS =
- "ER_STRINGLENGTH_HAS_TOO_MANY_ARGS";
- public static final String ER_TRANSLATE_TAKES_3_ARGS =
- "ER_TRANSLATE_TAKES_3_ARGS";
- public static final String ER_UNPARSEDENTITYURI_TAKES_1_ARG =
- "ER_UNPARSEDENTITYURI_TAKES_1_ARG";
- public static final String ER_NAMESPACEAXIS_NOT_IMPLEMENTED =
- "ER_NAMESPACEAXIS_NOT_IMPLEMENTED";
- public static final String ER_UNKNOWN_AXIS = "ER_UNKNOWN_AXIS";
- public static final String ER_UNKNOWN_MATCH_OPERATION =
- "ER_UNKNOWN_MATCH_OPERATION";
- public static final String ER_INCORRECT_ARG_LENGTH ="ER_INCORRECT_ARG_LENGTH";
- public static final String ER_CANT_CONVERT_TO_NUMBER =
- "ER_CANT_CONVERT_TO_NUMBER";
- public static final String ER_CANT_CONVERT_XPATHRESULTTYPE_TO_NUMBER =
- "ER_CANT_CONVERT_XPATHRESULTTYPE_TO_NUMBER";
- public static final String ER_CANT_CONVERT_TO_NODELIST =
- "ER_CANT_CONVERT_TO_NODELIST";
- public static final String ER_CANT_CONVERT_TO_MUTABLENODELIST =
- "ER_CANT_CONVERT_TO_MUTABLENODELIST";
- public static final String ER_CANT_CONVERT_TO_TYPE ="ER_CANT_CONVERT_TO_TYPE";
- public static final String ER_EXPECTED_MATCH_PATTERN =
- "ER_EXPECTED_MATCH_PATTERN";
- public static final String ER_COULDNOT_GET_VAR_NAMED =
- "ER_COULDNOT_GET_VAR_NAMED";
- public static final String ER_UNKNOWN_OPCODE = "ER_UNKNOWN_OPCODE";
- public static final String ER_EXTRA_ILLEGAL_TOKENS ="ER_EXTRA_ILLEGAL_TOKENS";
- public static final String ER_EXPECTED_DOUBLE_QUOTE =
- "ER_EXPECTED_DOUBLE_QUOTE";
- public static final String ER_EXPECTED_SINGLE_QUOTE =
- "ER_EXPECTED_SINGLE_QUOTE";
- public static final String ER_EMPTY_EXPRESSION = "ER_EMPTY_EXPRESSION";
- public static final String ER_EXPECTED_BUT_FOUND = "ER_EXPECTED_BUT_FOUND";
- public static final String ER_INCORRECT_PROGRAMMER_ASSERTION =
- "ER_INCORRECT_PROGRAMMER_ASSERTION";
- public static final String ER_BOOLEAN_ARG_NO_LONGER_OPTIONAL =
- "ER_BOOLEAN_ARG_NO_LONGER_OPTIONAL";
- public static final String ER_FOUND_COMMA_BUT_NO_PRECEDING_ARG =
- "ER_FOUND_COMMA_BUT_NO_PRECEDING_ARG";
- public static final String ER_FOUND_COMMA_BUT_NO_FOLLOWING_ARG =
- "ER_FOUND_COMMA_BUT_NO_FOLLOWING_ARG";
- public static final String ER_PREDICATE_ILLEGAL_SYNTAX =
- "ER_PREDICATE_ILLEGAL_SYNTAX";
- public static final String ER_ILLEGAL_AXIS_NAME = "ER_ILLEGAL_AXIS_NAME";
- public static final String ER_UNKNOWN_NODETYPE = "ER_UNKNOWN_NODETYPE";
- public static final String ER_PATTERN_LITERAL_NEEDS_BE_QUOTED =
- "ER_PATTERN_LITERAL_NEEDS_BE_QUOTED";
- public static final String ER_COULDNOT_BE_FORMATTED_TO_NUMBER =
- "ER_COULDNOT_BE_FORMATTED_TO_NUMBER";
- public static final String ER_COULDNOT_CREATE_XMLPROCESSORLIAISON =
- "ER_COULDNOT_CREATE_XMLPROCESSORLIAISON";
- public static final String ER_DIDNOT_FIND_XPATH_SELECT_EXP =
- "ER_DIDNOT_FIND_XPATH_SELECT_EXP";
- public static final String ER_COULDNOT_FIND_ENDOP_AFTER_OPLOCATIONPATH =
- "ER_COULDNOT_FIND_ENDOP_AFTER_OPLOCATIONPATH";
- public static final String ER_ERROR_OCCURED = "ER_ERROR_OCCURED";
- public static final String ER_ILLEGAL_VARIABLE_REFERENCE =
- "ER_ILLEGAL_VARIABLE_REFERENCE";
- public static final String ER_AXES_NOT_ALLOWED = "ER_AXES_NOT_ALLOWED";
- public static final String ER_KEY_HAS_TOO_MANY_ARGS =
- "ER_KEY_HAS_TOO_MANY_ARGS";
- public static final String ER_COUNT_TAKES_1_ARG = "ER_COUNT_TAKES_1_ARG";
- public static final String ER_COULDNOT_FIND_FUNCTION =
- "ER_COULDNOT_FIND_FUNCTION";
- public static final String ER_UNSUPPORTED_ENCODING ="ER_UNSUPPORTED_ENCODING";
- public static final String ER_PROBLEM_IN_DTM_NEXTSIBLING =
- "ER_PROBLEM_IN_DTM_NEXTSIBLING";
- public static final String ER_CANNOT_WRITE_TO_EMPTYNODELISTIMPL =
- "ER_CANNOT_WRITE_TO_EMPTYNODELISTIMPL";
- public static final String ER_SETDOMFACTORY_NOT_SUPPORTED =
- "ER_SETDOMFACTORY_NOT_SUPPORTED";
- public static final String ER_PREFIX_MUST_RESOLVE = "ER_PREFIX_MUST_RESOLVE";
- public static final String ER_PARSE_NOT_SUPPORTED = "ER_PARSE_NOT_SUPPORTED";
- public static final String ER_SAX_API_NOT_HANDLED = "ER_SAX_API_NOT_HANDLED";
-public static final String ER_IGNORABLE_WHITESPACE_NOT_HANDLED =
- "ER_IGNORABLE_WHITESPACE_NOT_HANDLED";
- public static final String ER_DTM_CANNOT_HANDLE_NODES =
- "ER_DTM_CANNOT_HANDLE_NODES";
- public static final String ER_XERCES_CANNOT_HANDLE_NODES =
- "ER_XERCES_CANNOT_HANDLE_NODES";
- public static final String ER_XERCES_PARSE_ERROR_DETAILS =
- "ER_XERCES_PARSE_ERROR_DETAILS";
- public static final String ER_XERCES_PARSE_ERROR = "ER_XERCES_PARSE_ERROR";
- public static final String ER_INVALID_UTF16_SURROGATE =
- "ER_INVALID_UTF16_SURROGATE";
- public static final String ER_OIERROR = "ER_OIERROR";
- public static final String ER_CANNOT_CREATE_URL = "ER_CANNOT_CREATE_URL";
- public static final String ER_XPATH_READOBJECT = "ER_XPATH_READOBJECT";
- public static final String ER_FUNCTION_TOKEN_NOT_FOUND =
- "ER_FUNCTION_TOKEN_NOT_FOUND";
- public static final String ER_CANNOT_DEAL_XPATH_TYPE =
- "ER_CANNOT_DEAL_XPATH_TYPE";
- public static final String ER_NODESET_NOT_MUTABLE = "ER_NODESET_NOT_MUTABLE";
- public static final String ER_NODESETDTM_NOT_MUTABLE =
- "ER_NODESETDTM_NOT_MUTABLE";
- /** Variable not resolvable: */
- public static final String ER_VAR_NOT_RESOLVABLE = "ER_VAR_NOT_RESOLVABLE";
- /** Null error handler */
- public static final String ER_NULL_ERROR_HANDLER = "ER_NULL_ERROR_HANDLER";
- /** Programmer's assertion: unknown opcode */
- public static final String ER_PROG_ASSERT_UNKNOWN_OPCODE =
- "ER_PROG_ASSERT_UNKNOWN_OPCODE";
- /** 0 or 1 */
- public static final String ER_ZERO_OR_ONE = "ER_ZERO_OR_ONE";
- /** rtf() not supported by XRTreeFragSelectWrapper */
- public static final String ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** asNodeIterator() not supported by XRTreeFragSelectWrapper */
- public static final String ER_ASNODEITERATOR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER = "ER_ASNODEITERATOR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** fsb() not supported for XStringForChars */
- public static final String ER_FSB_NOT_SUPPORTED_XSTRINGFORCHARS =
- "ER_FSB_NOT_SUPPORTED_XSTRINGFORCHARS";
- /** Could not find variable with the name of */
- public static final String ER_COULD_NOT_FIND_VAR = "ER_COULD_NOT_FIND_VAR";
- /** XStringForChars can not take a string for an argument */
- public static final String ER_XSTRINGFORCHARS_CANNOT_TAKE_STRING =
- "ER_XSTRINGFORCHARS_CANNOT_TAKE_STRING";
- /** The FastStringBuffer argument can not be null */
- public static final String ER_FASTSTRINGBUFFER_CANNOT_BE_NULL =
- "ER_FASTSTRINGBUFFER_CANNOT_BE_NULL";
- /** 2 or 3 */
- public static final String ER_TWO_OR_THREE = "ER_TWO_OR_THREE";
- /** Variable accessed before it is bound! */
- public static final String ER_VARIABLE_ACCESSED_BEFORE_BIND =
- "ER_VARIABLE_ACCESSED_BEFORE_BIND";
- /** XStringForFSB can not take a string for an argument! */
- public static final String ER_FSB_CANNOT_TAKE_STRING =
- "ER_FSB_CANNOT_TAKE_STRING";
- /** Error! Setting the root of a walker to null! */
- public static final String ER_SETTING_WALKER_ROOT_TO_NULL =
- "ER_SETTING_WALKER_ROOT_TO_NULL";
- /** This NodeSetDTM can not iterate to a previous node! */
- public static final String ER_NODESETDTM_CANNOT_ITERATE =
- "ER_NODESETDTM_CANNOT_ITERATE";
- /** This NodeSet can not iterate to a previous node! */
- public static final String ER_NODESET_CANNOT_ITERATE =
- "ER_NODESET_CANNOT_ITERATE";
- /** This NodeSetDTM can not do indexing or counting functions! */
- public static final String ER_NODESETDTM_CANNOT_INDEX =
- "ER_NODESETDTM_CANNOT_INDEX";
- /** This NodeSet can not do indexing or counting functions! */
- public static final String ER_NODESET_CANNOT_INDEX =
- "ER_NODESET_CANNOT_INDEX";
- /** Can not call setShouldCacheNodes after nextNode has been called! */
- public static final String ER_CANNOT_CALL_SETSHOULDCACHENODE =
- "ER_CANNOT_CALL_SETSHOULDCACHENODE";
- /** {0} only allows {1} arguments */
- public static final String ER_ONLY_ALLOWS = "ER_ONLY_ALLOWS";
- /** Programmer's assertion in getNextStepPos: unknown stepType: {0} */
- public static final String ER_UNKNOWN_STEP = "ER_UNKNOWN_STEP";
- /** Problem with RelativeLocationPath */
- public static final String ER_EXPECTED_REL_LOC_PATH =
- "ER_EXPECTED_REL_LOC_PATH";
- /** Problem with LocationPath */
- public static final String ER_EXPECTED_LOC_PATH = "ER_EXPECTED_LOC_PATH";
- public static final String ER_EXPECTED_LOC_PATH_AT_END_EXPR =
- "ER_EXPECTED_LOC_PATH_AT_END_EXPR";
- /** Problem with Step */
- public static final String ER_EXPECTED_LOC_STEP = "ER_EXPECTED_LOC_STEP";
- /** Problem with NodeTest */
- public static final String ER_EXPECTED_NODE_TEST = "ER_EXPECTED_NODE_TEST";
- /** Expected step pattern */
- public static final String ER_EXPECTED_STEP_PATTERN =
- "ER_EXPECTED_STEP_PATTERN";
- /** Expected relative path pattern */
- public static final String ER_EXPECTED_REL_PATH_PATTERN =
- "ER_EXPECTED_REL_PATH_PATTERN";
- /** ER_CANT_CONVERT_XPATHRESULTTYPE_TO_BOOLEAN */
- public static final String ER_CANT_CONVERT_TO_BOOLEAN =
- "ER_CANT_CONVERT_TO_BOOLEAN";
- /** Field ER_CANT_CONVERT_TO_SINGLENODE */
- public static final String ER_CANT_CONVERT_TO_SINGLENODE =
- "ER_CANT_CONVERT_TO_SINGLENODE";
- /** Field ER_CANT_GET_SNAPSHOT_LENGTH */
- public static final String ER_CANT_GET_SNAPSHOT_LENGTH =
- "ER_CANT_GET_SNAPSHOT_LENGTH";
- /** Field ER_NON_ITERATOR_TYPE */
- public static final String ER_NON_ITERATOR_TYPE = "ER_NON_ITERATOR_TYPE";
- /** Field ER_DOC_MUTATED */
- public static final String ER_DOC_MUTATED = "ER_DOC_MUTATED";
- public static final String ER_INVALID_XPATH_TYPE = "ER_INVALID_XPATH_TYPE";
- public static final String ER_EMPTY_XPATH_RESULT = "ER_EMPTY_XPATH_RESULT";
- public static final String ER_INCOMPATIBLE_TYPES = "ER_INCOMPATIBLE_TYPES";
- public static final String ER_NULL_RESOLVER = "ER_NULL_RESOLVER";
- public static final String ER_CANT_CONVERT_TO_STRING =
- "ER_CANT_CONVERT_TO_STRING";
- public static final String ER_NON_SNAPSHOT_TYPE = "ER_NON_SNAPSHOT_TYPE";
- public static final String ER_WRONG_DOCUMENT = "ER_WRONG_DOCUMENT";
- /* Note to translators: The XPath expression cannot be evaluated with respect
- * to this type of node.
- */
- /** Field ER_WRONG_NODETYPE */
- public static final String ER_WRONG_NODETYPE = "ER_WRONG_NODETYPE";
- public static final String ER_XPATH_ERROR = "ER_XPATH_ERROR";
-
- //BEGIN: Keys needed for exception messages of JAXP 1.3 XPath API implementation
- public static final String ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED = "ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED";
- public static final String ER_RESOLVE_VARIABLE_RETURNS_NULL = "ER_RESOLVE_VARIABLE_RETURNS_NULL";
- public static final String ER_UNSUPPORTED_RETURN_TYPE = "ER_UNSUPPORTED_RETURN_TYPE";
- public static final String ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL = "ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL";
- public static final String ER_ARG_CANNOT_BE_NULL = "ER_ARG_CANNOT_BE_NULL";
-
- public static final String ER_OBJECT_MODEL_NULL = "ER_OBJECT_MODEL_NULL";
- public static final String ER_OBJECT_MODEL_EMPTY = "ER_OBJECT_MODEL_EMPTY";
- public static final String ER_FEATURE_NAME_NULL = "ER_FEATURE_NAME_NULL";
- public static final String ER_FEATURE_UNKNOWN = "ER_FEATURE_UNKNOWN";
- public static final String ER_GETTING_NULL_FEATURE = "ER_GETTING_NULL_FEATURE";
- public static final String ER_GETTING_UNKNOWN_FEATURE = "ER_GETTING_UNKNOWN_FEATURE";
- public static final String ER_SECUREPROCESSING_FEATURE = "ER_SECUREPROCESSING_FEATURE";
- public static final String ER_NULL_XPATH_FUNCTION_RESOLVER = "ER_NULL_XPATH_FUNCTION_RESOLVER";
- public static final String ER_NULL_XPATH_VARIABLE_RESOLVER = "ER_NULL_XPATH_VARIABLE_RESOLVER";
- //END: Keys needed for exception messages of JAXP 1.3 XPath API implementation
-
- public static final String WG_LOCALE_NAME_NOT_HANDLED =
- "WG_LOCALE_NAME_NOT_HANDLED";
- public static final String WG_PROPERTY_NOT_SUPPORTED =
- "WG_PROPERTY_NOT_SUPPORTED";
- public static final String WG_DONT_DO_ANYTHING_WITH_NS =
- "WG_DONT_DO_ANYTHING_WITH_NS";
- public static final String WG_SECURITY_EXCEPTION = "WG_SECURITY_EXCEPTION";
- public static final String WG_QUO_NO_LONGER_DEFINED =
- "WG_QUO_NO_LONGER_DEFINED";
- public static final String WG_NEED_DERIVED_OBJECT_TO_IMPLEMENT_NODETEST =
- "WG_NEED_DERIVED_OBJECT_TO_IMPLEMENT_NODETEST";
- public static final String WG_FUNCTION_TOKEN_NOT_FOUND =
- "WG_FUNCTION_TOKEN_NOT_FOUND";
- public static final String WG_COULDNOT_FIND_FUNCTION =
- "WG_COULDNOT_FIND_FUNCTION";
- public static final String WG_CANNOT_MAKE_URL_FROM ="WG_CANNOT_MAKE_URL_FROM";
- public static final String WG_EXPAND_ENTITIES_NOT_SUPPORTED =
- "WG_EXPAND_ENTITIES_NOT_SUPPORTED";
- public static final String WG_ILLEGAL_VARIABLE_REFERENCE =
- "WG_ILLEGAL_VARIABLE_REFERENCE";
- public static final String WG_UNSUPPORTED_ENCODING ="WG_UNSUPPORTED_ENCODING";
-
- /** detach() not supported by XRTreeFragSelectWrapper */
- public static final String ER_DETACH_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_DETACH_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** num() not supported by XRTreeFragSelectWrapper */
- public static final String ER_NUM_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_NUM_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** xstr() not supported by XRTreeFragSelectWrapper */
- public static final String ER_XSTR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_XSTR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** str() not supported by XRTreeFragSelectWrapper */
- public static final String ER_STR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_STR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
-
- // Error messages...
-
- private static final Object[][] _contents = new Object[][]{
-
- { "ERROR0000" , "{0}" },
-
- { ER_CURRENT_NOT_ALLOWED_IN_MATCH, "current()-Funktion ist nicht zul\u00E4ssig in einem Vergleichsmuster." },
-
- { ER_CURRENT_TAKES_NO_ARGS, "current()-Funktion akzeptiert keine Argumente." },
-
- { ER_DOCUMENT_REPLACED,
- "document()-Funktionsimplementierung wurde durch com.sun.org.apache.xalan.internal.xslt.FuncDocument ersetzt."},
-
- { ER_CONTEXT_HAS_NO_OWNERDOC,
- "Kontext hat kein Eigent\u00FCmerdokument."},
-
- { ER_LOCALNAME_HAS_TOO_MANY_ARGS,
- "local-name() hat zu viele Argumente."},
-
- { ER_NAMESPACEURI_HAS_TOO_MANY_ARGS,
- "namespace-uri() hat zu viele Argumente."},
-
- { ER_NORMALIZESPACE_HAS_TOO_MANY_ARGS,
- "normalize-space() hat zu viele Argumente."},
-
- { ER_NUMBER_HAS_TOO_MANY_ARGS,
- "number() hat zu viele Argumente."},
-
- { ER_NAME_HAS_TOO_MANY_ARGS,
- "name() hat zu viele Argumente."},
-
- { ER_STRING_HAS_TOO_MANY_ARGS,
- "string() hat zu viele Argumente."},
-
- { ER_STRINGLENGTH_HAS_TOO_MANY_ARGS,
- "string-length() hat zu viele Argumente."},
-
- { ER_TRANSLATE_TAKES_3_ARGS,
- "translate()-Funktion akzeptiert drei Argumente."},
-
- { ER_UNPARSEDENTITYURI_TAKES_1_ARG,
- "unparsed-entity-uri-Funktion sollte ein Argument akzeptieren."},
-
- { ER_NAMESPACEAXIS_NOT_IMPLEMENTED,
- "Namespace-Achse noch nicht implementiert."},
-
- { ER_UNKNOWN_AXIS,
- "Unbekannte Achse: {0}"},
-
- { ER_UNKNOWN_MATCH_OPERATION,
- "Unbekannter Vergleichsvorgang."},
-
- { ER_INCORRECT_ARG_LENGTH,
- "Argumentl\u00E4nge von processing-instruction()-Knotentest ist falsch."},
-
- { ER_CANT_CONVERT_TO_NUMBER,
- "{0} kann nicht in eine Zahl konvertiert werden"},
-
- { ER_CANT_CONVERT_TO_NODELIST,
- "{0} kann nicht in eine NodeList konvertiert werden."},
-
- { ER_CANT_CONVERT_TO_MUTABLENODELIST,
- "{0} kann nicht in NodeSetDTM konvertiert werden."},
-
- { ER_CANT_CONVERT_TO_TYPE,
- "{0} kann nicht in type#{1} konvertiert werden"},
-
- { ER_EXPECTED_MATCH_PATTERN,
- "Vergleichsmuster in getMatchScore erwartet."},
-
- { ER_COULDNOT_GET_VAR_NAMED,
- "Variable mit Namen {0} kann nicht abgerufen werden"},
-
- { ER_UNKNOWN_OPCODE,
- "ERROR. Unbekannter Vorgangscode: {0}"},
-
- { ER_EXTRA_ILLEGAL_TOKENS,
- "Zus\u00E4tzliche ung\u00FCltige Tokens: {0}"},
-
- { ER_EXPECTED_DOUBLE_QUOTE,
- "Literal in falschen Anf\u00FChrungszeichen... Doppelte Anf\u00FChrungszeichen erwartet."},
-
- { ER_EXPECTED_SINGLE_QUOTE,
- "Literal in falschen Anf\u00FChrungszeichen... Einzelne Anf\u00FChrungszeichen erwartet."},
-
- { ER_EMPTY_EXPRESSION,
- "Leerer Ausdruck."},
-
- { ER_EXPECTED_BUT_FOUND,
- "{0} erwartet, aber {1} gefunden"},
-
- { ER_INCORRECT_PROGRAMMER_ASSERTION,
- "Programmierer-Assertion ist falsch. - {0}"},
-
- { ER_BOOLEAN_ARG_NO_LONGER_OPTIONAL,
- "boolean(...)-Argument ist nicht mehr optional bei 19990709 XPath-Entwurf."},
-
- { ER_FOUND_COMMA_BUT_NO_PRECEDING_ARG,
- "\",\" gefunden, aber kein vorausgehendes Argument vorhanden."},
-
- { ER_FOUND_COMMA_BUT_NO_FOLLOWING_ARG,
- "\",\" gefunden, aber kein folgendes Argument vorhanden."},
-
- { ER_PREDICATE_ILLEGAL_SYNTAX,
- "\"..[predicate]\" oder \".[predicate]\" ist ung\u00FCltige Syntax. Verwenden Sie stattdessen \"self::node()[predicate]\"."},
-
- { ER_ILLEGAL_AXIS_NAME,
- "Ung\u00FCltiger Achsenname: {0}"},
-
- { ER_UNKNOWN_NODETYPE,
- "Unbekannter Knotentyp: {0}"},
-
- { ER_PATTERN_LITERAL_NEEDS_BE_QUOTED,
- "Musterliteral ({0}) muss in Anf\u00FChrungszeichen gesetzt werden."},
-
- { ER_COULDNOT_BE_FORMATTED_TO_NUMBER,
- "{0} konnte nicht als Zahl formatiert werden."},
-
- { ER_COULDNOT_CREATE_XMLPROCESSORLIAISON,
- "XML-TransformerFactory-Liaison konnte nicht erstellt werden: {0}"},
-
- { ER_DIDNOT_FIND_XPATH_SELECT_EXP,
- "Fehler. xpath-SELECT-Ausdruck (-select) nicht gefunden."},
-
- { ER_COULDNOT_FIND_ENDOP_AFTER_OPLOCATIONPATH,
- "ERROR. ENDOP nach OP_LOCATIONPATH konnte nicht gefunden werden"},
-
- { ER_ERROR_OCCURED,
- "Fehler aufgetreten."},
-
- { ER_ILLEGAL_VARIABLE_REFERENCE,
- "VariableReference au\u00DFerhalb des Kontexts oder ohne Definition f\u00FCr Variable angegeben. Name = {0}"},
-
- { ER_AXES_NOT_ALLOWED,
- "Nur \"child::\"- und \"attribute::\"-Achsen sind in Vergleichsmustern zul\u00E4ssig. Betreffende Achsen = {0}"},
-
- { ER_KEY_HAS_TOO_MANY_ARGS,
- "key() hat eine falsche Anzahl Argumente."},
-
- { ER_COUNT_TAKES_1_ARG,
- "count-Funktion sollte ein Argument akzeptieren."},
-
- { ER_COULDNOT_FIND_FUNCTION,
- "Funktion konnte nicht gefunden werden: {0}"},
-
- { ER_UNSUPPORTED_ENCODING,
- "Nicht unterst\u00FCtzte Codierung: {0}"},
-
- { ER_PROBLEM_IN_DTM_NEXTSIBLING,
- "Problem in DTM in getNextSibling aufgetreten... Es wird versucht, das Problem zu beheben"},
-
- { ER_CANNOT_WRITE_TO_EMPTYNODELISTIMPL,
- "Programmiererfehler: Es kann nicht in EmptyNodeList geschrieben werden."},
-
- { ER_SETDOMFACTORY_NOT_SUPPORTED,
- "setDOMFactory wird nicht von XPathContext unterst\u00FCtzt."},
-
- { ER_PREFIX_MUST_RESOLVE,
- "Pr\u00E4fix muss als Namespace aufgel\u00F6st werden: {0}"},
-
- { ER_PARSE_NOT_SUPPORTED,
- "parse (InputSource-Quelle) nicht unterst\u00FCtzt in XPathContext. {0} kann nicht ge\u00F6ffnet werden"},
-
- { ER_SAX_API_NOT_HANDLED,
- "SAX-API-Zeichen(char ch[]... nicht verarbeitet von DTM."},
-
- { ER_IGNORABLE_WHITESPACE_NOT_HANDLED,
- "ignorableWhitespace(char ch[]... nicht verarbeitet von DTM."},
-
- { ER_DTM_CANNOT_HANDLE_NODES,
- "DTMLiaison kann keine Knoten des Typs {0} verarbeiten"},
-
- { ER_XERCES_CANNOT_HANDLE_NODES,
- "DOM2Helper kann keine Knoten des Typs {0} verarbeiten"},
-
- { ER_XERCES_PARSE_ERROR_DETAILS,
- "DOM2Helper.parse-Fehler: SystemID - {0} Zeile - {1}"},
-
- { ER_XERCES_PARSE_ERROR,
- "DOM2Helper.parse-Fehler"},
-
- { ER_INVALID_UTF16_SURROGATE,
- "Ung\u00FCltige UTF-16-Ersetzung festgestellt: {0}?"},
-
- { ER_OIERROR,
- "I/O-Fehler"},
-
- { ER_CANNOT_CREATE_URL,
- "URL f\u00FCr {0} kann nicht erstellt werden"},
-
- { ER_XPATH_READOBJECT,
- "In XPath.readObject: {0}"},
-
- { ER_FUNCTION_TOKEN_NOT_FOUND,
- "Funktionstoken nicht gefunden."},
-
- { ER_CANNOT_DEAL_XPATH_TYPE,
- "XPath-Typ {0} kann nicht bearbeitet werden"},
-
- { ER_NODESET_NOT_MUTABLE,
- "Dieses NodeSet ist nicht mutierbar"},
-
- { ER_NODESETDTM_NOT_MUTABLE,
- "Dieses NodeSetDTM ist nicht mutierbar"},
-
- { ER_VAR_NOT_RESOLVABLE,
- "Variable kann nicht aufgel\u00F6st werden: {0}"},
-
- { ER_NULL_ERROR_HANDLER,
- "Null-Error Handler"},
-
- { ER_PROG_ASSERT_UNKNOWN_OPCODE,
- "Programmierer-Assertion: Unbekannter Vorgangscode: {0}"},
-
- { ER_ZERO_OR_ONE,
- "0 oder 1"},
-
- { ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "rtf() nicht unterst\u00FCtzt von XRTreeFragSelectWrapper"},
-
- { ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "asNodeIterator() nicht unterst\u00FCtzt von XRTreeFragSelectWrapper"},
-
- /** detach() not supported by XRTreeFragSelectWrapper */
- { ER_DETACH_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "detach() nicht unterst\u00FCtzt von XRTreeFragSelectWrapper"},
-
- /** num() not supported by XRTreeFragSelectWrapper */
- { ER_NUM_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "num() nicht unterst\u00FCtzt von XRTreeFragSelectWrapper"},
-
- /** xstr() not supported by XRTreeFragSelectWrapper */
- { ER_XSTR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "xstr() nicht unterst\u00FCtzt von XRTreeFragSelectWrapper"},
-
- /** str() not supported by XRTreeFragSelectWrapper */
- { ER_STR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "str() nicht unterst\u00FCtzt von XRTreeFragSelectWrapper"},
-
- { ER_FSB_NOT_SUPPORTED_XSTRINGFORCHARS,
- "fsb() nicht unterst\u00FCtzt f\u00FCr XStringForChars"},
-
- { ER_COULD_NOT_FIND_VAR,
- "Variable mit Namen {0} konnte nicht gefunden werden"},
-
- { ER_XSTRINGFORCHARS_CANNOT_TAKE_STRING,
- "XStringForChars kann keine Zeichenfolge als Argument akzeptieren"},
-
- { ER_FASTSTRINGBUFFER_CANNOT_BE_NULL,
- "FastStringBuffer-Argument darf nicht null sein"},
-
- { ER_TWO_OR_THREE,
- "2 oder 3"},
-
- { ER_VARIABLE_ACCESSED_BEFORE_BIND,
- "Auf Variable wurde zugegriffen, bevor sie gebunden wurde."},
-
- { ER_FSB_CANNOT_TAKE_STRING,
- "XStringForFSB kann keine Zeichenfolge als Argument akzeptieren."},
-
- { ER_SETTING_WALKER_ROOT_TO_NULL,
- "\n !!!! Fehler. Root eines Walkers wird auf null gesetzt."},
-
- { ER_NODESETDTM_CANNOT_ITERATE,
- "NodeSetDTM kann nicht zu einem vorherigen Knoten iterieren."},
-
- { ER_NODESET_CANNOT_ITERATE,
- "NodeSet kann nicht zu einem vorherigen Knoten iterieren."},
-
- { ER_NODESETDTM_CANNOT_INDEX,
- "NodeSetDTM kann keine Indexierungs- oder Z\u00E4hlfunktionen ausf\u00FChren."},
-
- { ER_NODESET_CANNOT_INDEX,
- "NodeSet kann keine Indexierungs- oder Z\u00E4hlfunktionen ausf\u00FChren."},
-
- { ER_CANNOT_CALL_SETSHOULDCACHENODE,
- "setShouldCacheNodes kann nicht aufgerufen werden, nachdem nextNode aufgerufen wurde."},
-
- { ER_ONLY_ALLOWS,
- "{0} l\u00E4sst nur {1} Argumente zu"},
-
- { ER_UNKNOWN_STEP,
- "Programmierer-Assertion in getNextStepPos: Unbekannter stepType: {0}"},
-
- //Note to translators: A relative location path is a form of XPath expression.
- // The message indicates that such an expression was expected following the
- // characters '/' or '//', but was not found.
- { ER_EXPECTED_REL_LOC_PATH,
- "Nach dem Token \"/\" oder \"//\" wurde ein relativer Verzeichnispfad erwartet."},
-
- // Note to translators: A location path is a form of XPath expression.
- // The message indicates that syntactically such an expression was expected,but
- // the characters specified by the substitution text were encountered instead.
- { ER_EXPECTED_LOC_PATH,
- "Ein Verzeichnispfad wurde erwartet, aber das folgende Token wurde gefunden: {0}"},
-
- // Note to translators: A location path is a form of XPath expression.
- // The message indicates that syntactically such a subexpression was expected,
- // but no more characters were found in the expression.
- { ER_EXPECTED_LOC_PATH_AT_END_EXPR,
- "Ein Verzeichnispfad wurde erwartet, aber stattdessen wurde das Ende des XPath-Ausdrucks gefunden."},
-
- // Note to translators: A location step is part of an XPath expression.
- // The message indicates that syntactically such an expression was expected
- // following the specified characters.
- { ER_EXPECTED_LOC_STEP,
- "Nach dem Token \"/\" oder \"//\" wurde ein Verzeichnisschritt erwartet."},
-
- // Note to translators: A node test is part of an XPath expression that is
- // used to test for particular kinds of nodes. In this case, a node test that
- // consists of an NCName followed by a colon and an asterisk or that consists
- // of a QName was expected, but was not found.
- { ER_EXPECTED_NODE_TEST,
- "Es wurde ein Knotentest erwartet, der entweder NCName:* oder QName entspricht."},
-
- // Note to translators: A step pattern is part of an XPath expression.
- // The message indicates that syntactically such an expression was expected,
- // but the specified character was found in the expression instead.
- { ER_EXPECTED_STEP_PATTERN,
- "Ein Schrittmuster wurde erwartet, aber \"/\" wurde gefunden."},
-
- // Note to translators: A relative path pattern is part of an XPath expression.
- // The message indicates that syntactically such an expression was expected,
- // but was not found.
- { ER_EXPECTED_REL_PATH_PATTERN,
- "Ein relatives Pfadmuster wurde erwartet."},
-
- // Note to translators: The substitution text is the name of a data type. The
- // message indicates that a value of a particular type could not be converted
- // to a value of type boolean.
- { ER_CANT_CONVERT_TO_BOOLEAN,
- "XPathResult von XPath-Ausdruck \"{0}\" hat XPathResultType {1}, der nicht in einen booleschen Wert konvertiert werden kann."},
-
- // Note to translators: Do not translate ANY_UNORDERED_NODE_TYPE and
- // FIRST_ORDERED_NODE_TYPE.
- { ER_CANT_CONVERT_TO_SINGLENODE,
- "XPathResult von XPath-Ausdruck \"{0}\" hat XPathResultType {1}, der nicht in einen einzelnen Knoten konvertiert werden kann. Die Methode \"getSingleNodeValue\" gilt nur f\u00FCr die Typen ANY_UNORDERED_NODE_TYPE und FIRST_ORDERED_NODE_TYPE."},
-
- // Note to translators: Do not translate UNORDERED_NODE_SNAPSHOT_TYPE and
- // ORDERED_NODE_SNAPSHOT_TYPE.
- { ER_CANT_GET_SNAPSHOT_LENGTH,
- "Die Methode \"getSnapshotLength\" kann nicht f\u00FCr XPathResult von XPath-Ausdruck \"{0}\" aufgerufen werden, da der zugeh\u00F6rige XPathResultType {1} ist. Diese Methode gilt nur f\u00FCr die Typen UNORDERED_NODE_SNAPSHOT_TYPE und ORDERED_NODE_SNAPSHOT_TYPE."},
-
- { ER_NON_ITERATOR_TYPE,
- "Die Methode \"iterateNext\" kann nicht f\u00FCr XPathResult von XPath-Ausdruck \"{0}\" aufgerufen werden, da der zugeh\u00F6rige XPathResultType {1} ist. Diese Methode gilt nur f\u00FCr die Typen UNORDERED_NODE_ITERATOR_TYPE und ORDERED_NODE_ITERATOR_TYPE."},
-
- // Note to translators: This message indicates that the document being operated
- // upon changed, so the iterator object that was being used to traverse the
- // document has now become invalid.
- { ER_DOC_MUTATED,
- "Dokument ge\u00E4ndert, seit Ergebnis zur\u00FCckgegeben wurde. Iterator ist ung\u00FCltig."},
-
- { ER_INVALID_XPATH_TYPE,
- "Ung\u00FCltiges XPath-Typargument: {0}"},
-
- { ER_EMPTY_XPATH_RESULT,
- "Leeres XPath-Ergebnisobjekt"},
-
- { ER_INCOMPATIBLE_TYPES,
- "XPathResult von XPath-Ausdruck \"{0}\" hat XPathResultType {1}, der nicht in den angegebenen XPathResultType {2} ge\u00E4ndert werden kann."},
-
- { ER_NULL_RESOLVER,
- "Pr\u00E4fix kann nicht mit Null-Pr\u00E4fix-Resolver aufgel\u00F6st werden."},
-
- // Note to translators: The substitution text is the name of a data type. The
- // message indicates that a value of a particular type could not be converted
- // to a value of type string.
- { ER_CANT_CONVERT_TO_STRING,
- "XPathResult von XPath-Ausdruck \"{0}\" hat XPathResultType {1}, der nicht in eine Zeichenfolge konvertiert werden kann."},
-
- // Note to translators: Do not translate snapshotItem,
- // UNORDERED_NODE_SNAPSHOT_TYPE and ORDERED_NODE_SNAPSHOT_TYPE.
- { ER_NON_SNAPSHOT_TYPE,
- "Die Methode \"snapshotItem\" kann nicht f\u00FCr XPathResult von XPath-Ausdruck \"{0}\" aufgerufen werden, da der zugeh\u00F6rige XPathResultType {1} ist. Diese Methode gilt nur f\u00FCr die Typen UNORDERED_NODE_SNAPSHOT_TYPE und ORDERED_NODE_SNAPSHOT_TYPE."},
-
- // Note to translators: XPathEvaluator is a Java interface name. An
- // XPathEvaluator is created with respect to a particular XML document, and in
- // this case the expression represented by this object was being evaluated with
- // respect to a context node from a different document.
- { ER_WRONG_DOCUMENT,
- "Kontextknoten geh\u00F6rt nicht zum Dokument, das an diesen XPathEvaluator gebunden ist."},
-
- // Note to translators: The XPath expression cannot be evaluated with respect
- // to this type of node.
- { ER_WRONG_NODETYPE,
- "Kontextknotentyp wird nicht unterst\u00FCtzt."},
-
- { ER_XPATH_ERROR,
- "Unbekannter Fehler in XPath."},
-
- { ER_CANT_CONVERT_XPATHRESULTTYPE_TO_NUMBER,
- "XPathResult von XPath-Ausdruck \"{0}\" hat XPathResultType {1}, der nicht in eine Zahl konvertiert werden kann"},
-
- //BEGIN: Definitions of error keys used in exception messages of JAXP 1.3 XPath API implementation
-
- /** Field ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED */
-
- { ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED,
- "Erweiterungsfunktion \"{0}\" kann nicht aufgerufen werden, wenn das Feature \"XMLConstants.FEATURE_SECURE_PROCESSING\" auf \"true\" gesetzt ist."},
-
- /** Field ER_RESOLVE_VARIABLE_RETURNS_NULL */
-
- { ER_RESOLVE_VARIABLE_RETURNS_NULL,
- "resolveVariable f\u00FCr Variable {0} gibt null zur\u00FCck"},
-
- /** Field ER_UNSUPPORTED_RETURN_TYPE */
-
- { ER_UNSUPPORTED_RETURN_TYPE,
- "Nicht unterst\u00FCtzter R\u00FCckgabetyp: {0}"},
-
- /** Field ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL */
-
- { ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL,
- "Quelle und/oder R\u00FCckgabetyp d\u00FCrfen nicht null sein"},
-
- /** Field ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL */
-
- { ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL,
- "Quelle und/oder R\u00FCckgabetyp d\u00FCrfen nicht null sein"},
-
- /** Field ER_ARG_CANNOT_BE_NULL */
-
- { ER_ARG_CANNOT_BE_NULL,
- "{0}-Argument darf nicht null sein"},
-
- /** Field ER_OBJECT_MODEL_NULL */
-
- { ER_OBJECT_MODEL_NULL,
- "{0}#isObjectModelSupported( String objectModel ) kann nicht mit objectModel == null aufgerufen werden"},
-
- /** Field ER_OBJECT_MODEL_EMPTY */
-
- { ER_OBJECT_MODEL_EMPTY,
- "{0}#isObjectModelSupported( String objectModel ) kann nicht mit objectModel == \"\" aufgerufen werden"},
-
- /** Field ER_OBJECT_MODEL_EMPTY */
-
- { ER_FEATURE_NAME_NULL,
- "Es wird versucht, ein Feature mit einem Null-Namen festzulegen: {0}#setFeature( null, {1})"},
-
- /** Field ER_FEATURE_UNKNOWN */
-
- { ER_FEATURE_UNKNOWN,
- "Es wird versucht, ein unbekanntes Feature \"{0}\" festzulegen:{1}#setFeature({0},{2})"},
-
- /** Field ER_GETTING_NULL_FEATURE */
-
- { ER_GETTING_NULL_FEATURE,
- "Es wird versucht, ein Feature mit einem Null-Namen abzurufen: {0}#getFeature(null)"},
-
- /** Field ER_GETTING_NULL_FEATURE */
-
- { ER_GETTING_UNKNOWN_FEATURE,
- "Es wird versucht, das unbekannte Feature \"{0}\" abzurufen:{1}#getFeature({0})"},
-
- {ER_SECUREPROCESSING_FEATURE,
- "FEATURE_SECURE_PROCESSING: Feature kann nicht auf \"false\" gesetzt werden, wenn Security Manager vorhanden ist: {1}#setFeature({0},{2})"},
-
- /** Field ER_NULL_XPATH_FUNCTION_RESOLVER */
-
- { ER_NULL_XPATH_FUNCTION_RESOLVER,
- "Versuch, Null-XPathFunctionResolver festzulegen:{0}#setXPathFunctionResolver(null)"},
-
- /** Field ER_NULL_XPATH_VARIABLE_RESOLVER */
-
- { ER_NULL_XPATH_VARIABLE_RESOLVER,
- "Versuch, Null-XPathVariableResolver festzulegen:{0}#setXPathVariableResolver(null)"},
-
- //END: Definitions of error keys used in exception messages of JAXP 1.3 XPath API implementation
-
- // Warnings...
-
- { WG_LOCALE_NAME_NOT_HANDLED,
- "Gebietsschemaname in der format-number-Funktion wird noch nicht verarbeitet."},
-
- { WG_PROPERTY_NOT_SUPPORTED,
- "XSL-Eigenschaft nicht unterst\u00FCtzt: {0}"},
-
- { WG_DONT_DO_ANYTHING_WITH_NS,
- "Derzeit keine Aktion mit Namespace {0} in Eigenschaft {1} ausf\u00FChren"},
-
- { WG_SECURITY_EXCEPTION,
- "SecurityException beim Versuch, auf XSL-Systemeigenschaft {0} zuzugreifen"},
-
- { WG_QUO_NO_LONGER_DEFINED,
- "Alte Syntax: quo(...) nicht mehr definiert in XPath."},
-
- { WG_NEED_DERIVED_OBJECT_TO_IMPLEMENT_NODETEST,
- "XPath ben\u00F6tigt ein abgeleitetes Objekt, um nodeTest zu implementieren."},
-
- { WG_FUNCTION_TOKEN_NOT_FOUND,
- "Funktionstoken nicht gefunden."},
-
- { WG_COULDNOT_FIND_FUNCTION,
- "Funktion konnte nicht gefunden werden: {0}"},
-
- { WG_CANNOT_MAKE_URL_FROM,
- "URL kann nicht erstellt werden aus: {0}"},
-
- { WG_EXPAND_ENTITIES_NOT_SUPPORTED,
- "Option \"-E\" nicht unterst\u00FCtzt f\u00FCr DTM-Parser"},
-
- { WG_ILLEGAL_VARIABLE_REFERENCE,
- "VariableReference au\u00DFerhalb des Kontexts oder ohne Definition f\u00FCr Variable angegeben. Name = {0}"},
-
- { WG_UNSUPPORTED_ENCODING,
- "Nicht unterst\u00FCtzte Codierung: {0}"},
-
-
-
- // Other miscellaneous text used inside the code...
- { "ui_language", "de"},
- { "help_language", "de"},
- { "language", "de"},
- { "BAD_CODE", "Parameter f\u00FCr createMessage war au\u00DFerhalb des g\u00FCltigen Bereichs"},
- { "FORMAT_FAILED", "Ausnahme bei messageFormat-Aufruf ausgel\u00F6st"},
- { "version", ">>>>>>> Xalan-Version "},
- { "version2", "<<<<<<<"},
- { "yes", "Ja"},
- { "line", "Zeilennummer"},
- { "column", "Spaltennummer"},
- { "xsldone", "XSLProcessor: Fertig"},
- { "xpath_option", "xpath-Optionen: "},
- { "optionIN", " [-in inputXMLURL]"},
- { "optionSelect", " [-select xpath expression]"},
- { "optionMatch", " [-match match pattern (f\u00FCr Vergleichsdiagnose)]"},
- { "optionAnyExpr", "Oder nur ein XPath-Ausdruck f\u00FChrt einen Diagnosedump aus"},
- { "noParsermsg1", "XSL-Prozess war nicht erfolgreich."},
- { "noParsermsg2", "** Parser konnte nicht gefunden werden **"},
- { "noParsermsg3", "Pr\u00FCfen Sie den Classpath."},
- { "noParsermsg4", "Wenn Sie nicht \u00FCber den XML-Parser f\u00FCr Java von IBM verf\u00FCgen, k\u00F6nnen Sie ihn hier herunterladen:"},
- { "noParsermsg5", "IBMs AlphaWorks: http://www.alphaworks.ibm.com/formula/xml"},
- { "gtone", ">1" },
- { "zero", "0" },
- { "one", "1" },
- { "two" , "2" },
- { "three", "3" }
-
- };
-
- /**
- * Get the association list.
- *
- * @return The association list.
- */
- public Object[][] getContents()
- {
- return _contents;
- }
-
-
- // ================= INFRASTRUCTURE ======================
-
- /** Field BAD_CODE */
- public static final String BAD_CODE = "BAD_CODE";
-
- /** Field FORMAT_FAILED */
- public static final String FORMAT_FAILED = "FORMAT_FAILED";
-
- /** Field ERROR_RESOURCES */
- public static final String ERROR_RESOURCES =
- "com.sun.org.apache.xpath.internal.res.XPATHErrorResources";
-
- /** Field ERROR_STRING */
- public static final String ERROR_STRING = "#error";
-
- /** Field ERROR_HEADER */
- public static final String ERROR_HEADER = "Error: ";
-
- /** Field WARNING_HEADER */
- public static final String WARNING_HEADER = "Warning: ";
-
- /** Field XSL_HEADER */
- public static final String XSL_HEADER = "XSL ";
-
- /** Field XML_HEADER */
- public static final String XML_HEADER = "XML ";
-
- /** Field QUERY_HEADER */
- public static final String QUERY_HEADER = "PATTERN ";
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_en.java b/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_en.java
deleted file mode 100644
index 33f24bd..0000000
--- a/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_en.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XPATHErrorResources_en.java,v 1.1.2.1 2005/08/01 01:29:50 jeffsuttor Exp $
- */
-package com.sun.org.apache.xpath.internal.res;
-
-
-/**
- * Default implementation of XPATHErrorResources. This is just
- * an empty class.
- * @xsl.usage advanced
- */
-public class XPATHErrorResources_en extends XPATHErrorResources
-{
-}
diff --git a/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_es.java b/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_es.java
deleted file mode 100644
index 009a348..0000000
--- a/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_es.java
+++ /dev/null
@@ -1,936 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xpath.internal.res;
-
-import java.util.ListResourceBundle;
-
-/**
- * Set up error messages.
- * We build a two dimensional array of message keys and
- * message strings. In order to add a new message here,
- * you need to first add a Static string constant for the
- * Key and update the contents array with Key, Value pair
- * Also you need to update the count of messages(MAX_CODE)or
- * the count of warnings(MAX_WARNING) [ Information purpose only]
- * @xsl.usage advanced
- */
-public class XPATHErrorResources_es extends ListResourceBundle
-{
-
-/*
- * General notes to translators:
- *
- * This file contains error and warning messages related to XPath Error
- * Handling.
- *
- * 1) Xalan (or more properly, Xalan-interpretive) and XSLTC are names of
- * components.
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- * XSLTC is an acronym for XSLT Compiler.
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 5) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 6) "Translet" is an invented term that describes the class file that
- * results from compiling an XML stylesheet into a Java class.
- *
- * 7) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- * 8) The context node is the node in the document with respect to which an
- * XPath expression is being evaluated.
- *
- * 9) An iterator is an object that traverses nodes in the tree, one at a time.
- *
- * 10) NCName is an XML term used to describe a name that does not contain a
- * colon (a "no-colon name").
- *
- * 11) QName is an XML term meaning "qualified name".
- */
-
- /*
- * static variables
- */
- public static final String ERROR0000 = "ERROR0000";
- public static final String ER_CURRENT_NOT_ALLOWED_IN_MATCH =
- "ER_CURRENT_NOT_ALLOWED_IN_MATCH";
- public static final String ER_CURRENT_TAKES_NO_ARGS =
- "ER_CURRENT_TAKES_NO_ARGS";
- public static final String ER_DOCUMENT_REPLACED = "ER_DOCUMENT_REPLACED";
- public static final String ER_CONTEXT_HAS_NO_OWNERDOC =
- "ER_CONTEXT_HAS_NO_OWNERDOC";
- public static final String ER_LOCALNAME_HAS_TOO_MANY_ARGS =
- "ER_LOCALNAME_HAS_TOO_MANY_ARGS";
- public static final String ER_NAMESPACEURI_HAS_TOO_MANY_ARGS =
- "ER_NAMESPACEURI_HAS_TOO_MANY_ARGS";
- public static final String ER_NORMALIZESPACE_HAS_TOO_MANY_ARGS =
- "ER_NORMALIZESPACE_HAS_TOO_MANY_ARGS";
- public static final String ER_NUMBER_HAS_TOO_MANY_ARGS =
- "ER_NUMBER_HAS_TOO_MANY_ARGS";
- public static final String ER_NAME_HAS_TOO_MANY_ARGS =
- "ER_NAME_HAS_TOO_MANY_ARGS";
- public static final String ER_STRING_HAS_TOO_MANY_ARGS =
- "ER_STRING_HAS_TOO_MANY_ARGS";
- public static final String ER_STRINGLENGTH_HAS_TOO_MANY_ARGS =
- "ER_STRINGLENGTH_HAS_TOO_MANY_ARGS";
- public static final String ER_TRANSLATE_TAKES_3_ARGS =
- "ER_TRANSLATE_TAKES_3_ARGS";
- public static final String ER_UNPARSEDENTITYURI_TAKES_1_ARG =
- "ER_UNPARSEDENTITYURI_TAKES_1_ARG";
- public static final String ER_NAMESPACEAXIS_NOT_IMPLEMENTED =
- "ER_NAMESPACEAXIS_NOT_IMPLEMENTED";
- public static final String ER_UNKNOWN_AXIS = "ER_UNKNOWN_AXIS";
- public static final String ER_UNKNOWN_MATCH_OPERATION =
- "ER_UNKNOWN_MATCH_OPERATION";
- public static final String ER_INCORRECT_ARG_LENGTH ="ER_INCORRECT_ARG_LENGTH";
- public static final String ER_CANT_CONVERT_TO_NUMBER =
- "ER_CANT_CONVERT_TO_NUMBER";
- public static final String ER_CANT_CONVERT_XPATHRESULTTYPE_TO_NUMBER =
- "ER_CANT_CONVERT_XPATHRESULTTYPE_TO_NUMBER";
- public static final String ER_CANT_CONVERT_TO_NODELIST =
- "ER_CANT_CONVERT_TO_NODELIST";
- public static final String ER_CANT_CONVERT_TO_MUTABLENODELIST =
- "ER_CANT_CONVERT_TO_MUTABLENODELIST";
- public static final String ER_CANT_CONVERT_TO_TYPE ="ER_CANT_CONVERT_TO_TYPE";
- public static final String ER_EXPECTED_MATCH_PATTERN =
- "ER_EXPECTED_MATCH_PATTERN";
- public static final String ER_COULDNOT_GET_VAR_NAMED =
- "ER_COULDNOT_GET_VAR_NAMED";
- public static final String ER_UNKNOWN_OPCODE = "ER_UNKNOWN_OPCODE";
- public static final String ER_EXTRA_ILLEGAL_TOKENS ="ER_EXTRA_ILLEGAL_TOKENS";
- public static final String ER_EXPECTED_DOUBLE_QUOTE =
- "ER_EXPECTED_DOUBLE_QUOTE";
- public static final String ER_EXPECTED_SINGLE_QUOTE =
- "ER_EXPECTED_SINGLE_QUOTE";
- public static final String ER_EMPTY_EXPRESSION = "ER_EMPTY_EXPRESSION";
- public static final String ER_EXPECTED_BUT_FOUND = "ER_EXPECTED_BUT_FOUND";
- public static final String ER_INCORRECT_PROGRAMMER_ASSERTION =
- "ER_INCORRECT_PROGRAMMER_ASSERTION";
- public static final String ER_BOOLEAN_ARG_NO_LONGER_OPTIONAL =
- "ER_BOOLEAN_ARG_NO_LONGER_OPTIONAL";
- public static final String ER_FOUND_COMMA_BUT_NO_PRECEDING_ARG =
- "ER_FOUND_COMMA_BUT_NO_PRECEDING_ARG";
- public static final String ER_FOUND_COMMA_BUT_NO_FOLLOWING_ARG =
- "ER_FOUND_COMMA_BUT_NO_FOLLOWING_ARG";
- public static final String ER_PREDICATE_ILLEGAL_SYNTAX =
- "ER_PREDICATE_ILLEGAL_SYNTAX";
- public static final String ER_ILLEGAL_AXIS_NAME = "ER_ILLEGAL_AXIS_NAME";
- public static final String ER_UNKNOWN_NODETYPE = "ER_UNKNOWN_NODETYPE";
- public static final String ER_PATTERN_LITERAL_NEEDS_BE_QUOTED =
- "ER_PATTERN_LITERAL_NEEDS_BE_QUOTED";
- public static final String ER_COULDNOT_BE_FORMATTED_TO_NUMBER =
- "ER_COULDNOT_BE_FORMATTED_TO_NUMBER";
- public static final String ER_COULDNOT_CREATE_XMLPROCESSORLIAISON =
- "ER_COULDNOT_CREATE_XMLPROCESSORLIAISON";
- public static final String ER_DIDNOT_FIND_XPATH_SELECT_EXP =
- "ER_DIDNOT_FIND_XPATH_SELECT_EXP";
- public static final String ER_COULDNOT_FIND_ENDOP_AFTER_OPLOCATIONPATH =
- "ER_COULDNOT_FIND_ENDOP_AFTER_OPLOCATIONPATH";
- public static final String ER_ERROR_OCCURED = "ER_ERROR_OCCURED";
- public static final String ER_ILLEGAL_VARIABLE_REFERENCE =
- "ER_ILLEGAL_VARIABLE_REFERENCE";
- public static final String ER_AXES_NOT_ALLOWED = "ER_AXES_NOT_ALLOWED";
- public static final String ER_KEY_HAS_TOO_MANY_ARGS =
- "ER_KEY_HAS_TOO_MANY_ARGS";
- public static final String ER_COUNT_TAKES_1_ARG = "ER_COUNT_TAKES_1_ARG";
- public static final String ER_COULDNOT_FIND_FUNCTION =
- "ER_COULDNOT_FIND_FUNCTION";
- public static final String ER_UNSUPPORTED_ENCODING ="ER_UNSUPPORTED_ENCODING";
- public static final String ER_PROBLEM_IN_DTM_NEXTSIBLING =
- "ER_PROBLEM_IN_DTM_NEXTSIBLING";
- public static final String ER_CANNOT_WRITE_TO_EMPTYNODELISTIMPL =
- "ER_CANNOT_WRITE_TO_EMPTYNODELISTIMPL";
- public static final String ER_SETDOMFACTORY_NOT_SUPPORTED =
- "ER_SETDOMFACTORY_NOT_SUPPORTED";
- public static final String ER_PREFIX_MUST_RESOLVE = "ER_PREFIX_MUST_RESOLVE";
- public static final String ER_PARSE_NOT_SUPPORTED = "ER_PARSE_NOT_SUPPORTED";
- public static final String ER_SAX_API_NOT_HANDLED = "ER_SAX_API_NOT_HANDLED";
-public static final String ER_IGNORABLE_WHITESPACE_NOT_HANDLED =
- "ER_IGNORABLE_WHITESPACE_NOT_HANDLED";
- public static final String ER_DTM_CANNOT_HANDLE_NODES =
- "ER_DTM_CANNOT_HANDLE_NODES";
- public static final String ER_XERCES_CANNOT_HANDLE_NODES =
- "ER_XERCES_CANNOT_HANDLE_NODES";
- public static final String ER_XERCES_PARSE_ERROR_DETAILS =
- "ER_XERCES_PARSE_ERROR_DETAILS";
- public static final String ER_XERCES_PARSE_ERROR = "ER_XERCES_PARSE_ERROR";
- public static final String ER_INVALID_UTF16_SURROGATE =
- "ER_INVALID_UTF16_SURROGATE";
- public static final String ER_OIERROR = "ER_OIERROR";
- public static final String ER_CANNOT_CREATE_URL = "ER_CANNOT_CREATE_URL";
- public static final String ER_XPATH_READOBJECT = "ER_XPATH_READOBJECT";
- public static final String ER_FUNCTION_TOKEN_NOT_FOUND =
- "ER_FUNCTION_TOKEN_NOT_FOUND";
- public static final String ER_CANNOT_DEAL_XPATH_TYPE =
- "ER_CANNOT_DEAL_XPATH_TYPE";
- public static final String ER_NODESET_NOT_MUTABLE = "ER_NODESET_NOT_MUTABLE";
- public static final String ER_NODESETDTM_NOT_MUTABLE =
- "ER_NODESETDTM_NOT_MUTABLE";
- /** Variable not resolvable: */
- public static final String ER_VAR_NOT_RESOLVABLE = "ER_VAR_NOT_RESOLVABLE";
- /** Null error handler */
- public static final String ER_NULL_ERROR_HANDLER = "ER_NULL_ERROR_HANDLER";
- /** Programmer's assertion: unknown opcode */
- public static final String ER_PROG_ASSERT_UNKNOWN_OPCODE =
- "ER_PROG_ASSERT_UNKNOWN_OPCODE";
- /** 0 or 1 */
- public static final String ER_ZERO_OR_ONE = "ER_ZERO_OR_ONE";
- /** rtf() not supported by XRTreeFragSelectWrapper */
- public static final String ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** asNodeIterator() not supported by XRTreeFragSelectWrapper */
- public static final String ER_ASNODEITERATOR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER = "ER_ASNODEITERATOR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** fsb() not supported for XStringForChars */
- public static final String ER_FSB_NOT_SUPPORTED_XSTRINGFORCHARS =
- "ER_FSB_NOT_SUPPORTED_XSTRINGFORCHARS";
- /** Could not find variable with the name of */
- public static final String ER_COULD_NOT_FIND_VAR = "ER_COULD_NOT_FIND_VAR";
- /** XStringForChars can not take a string for an argument */
- public static final String ER_XSTRINGFORCHARS_CANNOT_TAKE_STRING =
- "ER_XSTRINGFORCHARS_CANNOT_TAKE_STRING";
- /** The FastStringBuffer argument can not be null */
- public static final String ER_FASTSTRINGBUFFER_CANNOT_BE_NULL =
- "ER_FASTSTRINGBUFFER_CANNOT_BE_NULL";
- /** 2 or 3 */
- public static final String ER_TWO_OR_THREE = "ER_TWO_OR_THREE";
- /** Variable accessed before it is bound! */
- public static final String ER_VARIABLE_ACCESSED_BEFORE_BIND =
- "ER_VARIABLE_ACCESSED_BEFORE_BIND";
- /** XStringForFSB can not take a string for an argument! */
- public static final String ER_FSB_CANNOT_TAKE_STRING =
- "ER_FSB_CANNOT_TAKE_STRING";
- /** Error! Setting the root of a walker to null! */
- public static final String ER_SETTING_WALKER_ROOT_TO_NULL =
- "ER_SETTING_WALKER_ROOT_TO_NULL";
- /** This NodeSetDTM can not iterate to a previous node! */
- public static final String ER_NODESETDTM_CANNOT_ITERATE =
- "ER_NODESETDTM_CANNOT_ITERATE";
- /** This NodeSet can not iterate to a previous node! */
- public static final String ER_NODESET_CANNOT_ITERATE =
- "ER_NODESET_CANNOT_ITERATE";
- /** This NodeSetDTM can not do indexing or counting functions! */
- public static final String ER_NODESETDTM_CANNOT_INDEX =
- "ER_NODESETDTM_CANNOT_INDEX";
- /** This NodeSet can not do indexing or counting functions! */
- public static final String ER_NODESET_CANNOT_INDEX =
- "ER_NODESET_CANNOT_INDEX";
- /** Can not call setShouldCacheNodes after nextNode has been called! */
- public static final String ER_CANNOT_CALL_SETSHOULDCACHENODE =
- "ER_CANNOT_CALL_SETSHOULDCACHENODE";
- /** {0} only allows {1} arguments */
- public static final String ER_ONLY_ALLOWS = "ER_ONLY_ALLOWS";
- /** Programmer's assertion in getNextStepPos: unknown stepType: {0} */
- public static final String ER_UNKNOWN_STEP = "ER_UNKNOWN_STEP";
- /** Problem with RelativeLocationPath */
- public static final String ER_EXPECTED_REL_LOC_PATH =
- "ER_EXPECTED_REL_LOC_PATH";
- /** Problem with LocationPath */
- public static final String ER_EXPECTED_LOC_PATH = "ER_EXPECTED_LOC_PATH";
- public static final String ER_EXPECTED_LOC_PATH_AT_END_EXPR =
- "ER_EXPECTED_LOC_PATH_AT_END_EXPR";
- /** Problem with Step */
- public static final String ER_EXPECTED_LOC_STEP = "ER_EXPECTED_LOC_STEP";
- /** Problem with NodeTest */
- public static final String ER_EXPECTED_NODE_TEST = "ER_EXPECTED_NODE_TEST";
- /** Expected step pattern */
- public static final String ER_EXPECTED_STEP_PATTERN =
- "ER_EXPECTED_STEP_PATTERN";
- /** Expected relative path pattern */
- public static final String ER_EXPECTED_REL_PATH_PATTERN =
- "ER_EXPECTED_REL_PATH_PATTERN";
- /** ER_CANT_CONVERT_XPATHRESULTTYPE_TO_BOOLEAN */
- public static final String ER_CANT_CONVERT_TO_BOOLEAN =
- "ER_CANT_CONVERT_TO_BOOLEAN";
- /** Field ER_CANT_CONVERT_TO_SINGLENODE */
- public static final String ER_CANT_CONVERT_TO_SINGLENODE =
- "ER_CANT_CONVERT_TO_SINGLENODE";
- /** Field ER_CANT_GET_SNAPSHOT_LENGTH */
- public static final String ER_CANT_GET_SNAPSHOT_LENGTH =
- "ER_CANT_GET_SNAPSHOT_LENGTH";
- /** Field ER_NON_ITERATOR_TYPE */
- public static final String ER_NON_ITERATOR_TYPE = "ER_NON_ITERATOR_TYPE";
- /** Field ER_DOC_MUTATED */
- public static final String ER_DOC_MUTATED = "ER_DOC_MUTATED";
- public static final String ER_INVALID_XPATH_TYPE = "ER_INVALID_XPATH_TYPE";
- public static final String ER_EMPTY_XPATH_RESULT = "ER_EMPTY_XPATH_RESULT";
- public static final String ER_INCOMPATIBLE_TYPES = "ER_INCOMPATIBLE_TYPES";
- public static final String ER_NULL_RESOLVER = "ER_NULL_RESOLVER";
- public static final String ER_CANT_CONVERT_TO_STRING =
- "ER_CANT_CONVERT_TO_STRING";
- public static final String ER_NON_SNAPSHOT_TYPE = "ER_NON_SNAPSHOT_TYPE";
- public static final String ER_WRONG_DOCUMENT = "ER_WRONG_DOCUMENT";
- /* Note to translators: The XPath expression cannot be evaluated with respect
- * to this type of node.
- */
- /** Field ER_WRONG_NODETYPE */
- public static final String ER_WRONG_NODETYPE = "ER_WRONG_NODETYPE";
- public static final String ER_XPATH_ERROR = "ER_XPATH_ERROR";
-
- //BEGIN: Keys needed for exception messages of JAXP 1.3 XPath API implementation
- public static final String ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED = "ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED";
- public static final String ER_RESOLVE_VARIABLE_RETURNS_NULL = "ER_RESOLVE_VARIABLE_RETURNS_NULL";
- public static final String ER_UNSUPPORTED_RETURN_TYPE = "ER_UNSUPPORTED_RETURN_TYPE";
- public static final String ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL = "ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL";
- public static final String ER_ARG_CANNOT_BE_NULL = "ER_ARG_CANNOT_BE_NULL";
-
- public static final String ER_OBJECT_MODEL_NULL = "ER_OBJECT_MODEL_NULL";
- public static final String ER_OBJECT_MODEL_EMPTY = "ER_OBJECT_MODEL_EMPTY";
- public static final String ER_FEATURE_NAME_NULL = "ER_FEATURE_NAME_NULL";
- public static final String ER_FEATURE_UNKNOWN = "ER_FEATURE_UNKNOWN";
- public static final String ER_GETTING_NULL_FEATURE = "ER_GETTING_NULL_FEATURE";
- public static final String ER_GETTING_UNKNOWN_FEATURE = "ER_GETTING_UNKNOWN_FEATURE";
- public static final String ER_SECUREPROCESSING_FEATURE = "ER_SECUREPROCESSING_FEATURE";
- public static final String ER_NULL_XPATH_FUNCTION_RESOLVER = "ER_NULL_XPATH_FUNCTION_RESOLVER";
- public static final String ER_NULL_XPATH_VARIABLE_RESOLVER = "ER_NULL_XPATH_VARIABLE_RESOLVER";
- //END: Keys needed for exception messages of JAXP 1.3 XPath API implementation
-
- public static final String WG_LOCALE_NAME_NOT_HANDLED =
- "WG_LOCALE_NAME_NOT_HANDLED";
- public static final String WG_PROPERTY_NOT_SUPPORTED =
- "WG_PROPERTY_NOT_SUPPORTED";
- public static final String WG_DONT_DO_ANYTHING_WITH_NS =
- "WG_DONT_DO_ANYTHING_WITH_NS";
- public static final String WG_SECURITY_EXCEPTION = "WG_SECURITY_EXCEPTION";
- public static final String WG_QUO_NO_LONGER_DEFINED =
- "WG_QUO_NO_LONGER_DEFINED";
- public static final String WG_NEED_DERIVED_OBJECT_TO_IMPLEMENT_NODETEST =
- "WG_NEED_DERIVED_OBJECT_TO_IMPLEMENT_NODETEST";
- public static final String WG_FUNCTION_TOKEN_NOT_FOUND =
- "WG_FUNCTION_TOKEN_NOT_FOUND";
- public static final String WG_COULDNOT_FIND_FUNCTION =
- "WG_COULDNOT_FIND_FUNCTION";
- public static final String WG_CANNOT_MAKE_URL_FROM ="WG_CANNOT_MAKE_URL_FROM";
- public static final String WG_EXPAND_ENTITIES_NOT_SUPPORTED =
- "WG_EXPAND_ENTITIES_NOT_SUPPORTED";
- public static final String WG_ILLEGAL_VARIABLE_REFERENCE =
- "WG_ILLEGAL_VARIABLE_REFERENCE";
- public static final String WG_UNSUPPORTED_ENCODING ="WG_UNSUPPORTED_ENCODING";
-
- /** detach() not supported by XRTreeFragSelectWrapper */
- public static final String ER_DETACH_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_DETACH_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** num() not supported by XRTreeFragSelectWrapper */
- public static final String ER_NUM_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_NUM_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** xstr() not supported by XRTreeFragSelectWrapper */
- public static final String ER_XSTR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_XSTR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** str() not supported by XRTreeFragSelectWrapper */
- public static final String ER_STR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_STR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
-
- // Error messages...
-
- private static final Object[][] _contents = new Object[][]{
-
- { "ERROR0000" , "{0}" },
-
- { ER_CURRENT_NOT_ALLOWED_IN_MATCH, "La funci\u00F3n current() no est\u00E1 permitida en un patr\u00F3n de coincidencia." },
-
- { ER_CURRENT_TAKES_NO_ARGS, "La funci\u00F3n current() no acepta argumentos." },
-
- { ER_DOCUMENT_REPLACED,
- "La implantaci\u00F3n de la funci\u00F3n document() se ha sustituido por com.sun.org.apache.xalan.internal.xslt.FuncDocument!"},
-
- { ER_CONTEXT_HAS_NO_OWNERDOC,
- "El contexto no tiene un documento de propietario."},
-
- { ER_LOCALNAME_HAS_TOO_MANY_ARGS,
- "local-name() tiene demasiados argumentos."},
-
- { ER_NAMESPACEURI_HAS_TOO_MANY_ARGS,
- "namespace-uri() tiene demasiados argumentos."},
-
- { ER_NORMALIZESPACE_HAS_TOO_MANY_ARGS,
- "normalize-space() tiene demasiados argumentos."},
-
- { ER_NUMBER_HAS_TOO_MANY_ARGS,
- "number() tiene demasiados argumentos."},
-
- { ER_NAME_HAS_TOO_MANY_ARGS,
- "name() tiene demasiados argumentos."},
-
- { ER_STRING_HAS_TOO_MANY_ARGS,
- "string() tiene demasiados argumentos."},
-
- { ER_STRINGLENGTH_HAS_TOO_MANY_ARGS,
- "string-length() tiene demasiados argumentos."},
-
- { ER_TRANSLATE_TAKES_3_ARGS,
- "La funci\u00F3n translate() necesita tres argumentos."},
-
- { ER_UNPARSEDENTITYURI_TAKES_1_ARG,
- "La funci\u00F3n unparsed-entity-uri necesita un argumento."},
-
- { ER_NAMESPACEAXIS_NOT_IMPLEMENTED,
- "El eje de espacio de nombres no se ha implantado a\u00FAn."},
-
- { ER_UNKNOWN_AXIS,
- "eje desconocido: {0}"},
-
- { ER_UNKNOWN_MATCH_OPERATION,
- "Operaci\u00F3n de coincidencia desconocida."},
-
- { ER_INCORRECT_ARG_LENGTH,
- "La longitud del argumento de la prueba del nodo processing-instruction() es incorrecta."},
-
- { ER_CANT_CONVERT_TO_NUMBER,
- "No se puede convertir {0} en un n\u00FAmero"},
-
- { ER_CANT_CONVERT_TO_NODELIST,
- "No se puede convertir {0} en una lista de nodos."},
-
- { ER_CANT_CONVERT_TO_MUTABLENODELIST,
- "No se puede convertir {0} en un DTM de juego de nodos."},
-
- { ER_CANT_CONVERT_TO_TYPE,
- "No se puede convertir {0} en el n\u00FAmero de tipo {1}"},
-
- { ER_EXPECTED_MATCH_PATTERN,
- "Patr\u00F3n de coincidencia esperado en getMatchScore."},
-
- { ER_COULDNOT_GET_VAR_NAMED,
- "No se ha encontrado la variable llamada {0}"},
-
- { ER_UNKNOWN_OPCODE,
- "ERROR. C\u00F3digo de operaci\u00F3n desconocido: {0}"},
-
- { ER_EXTRA_ILLEGAL_TOKENS,
- "Tokens no permitidos adicionales: {0}"},
-
- { ER_EXPECTED_DOUBLE_QUOTE,
- "literal con comillas incorrectas... se esperaban comillas dobles"},
-
- { ER_EXPECTED_SINGLE_QUOTE,
- "literal con comillas incorrectas... se esperaban comillas simples"},
-
- { ER_EMPTY_EXPRESSION,
- "Expresi\u00F3n vac\u00EDa"},
-
- { ER_EXPECTED_BUT_FOUND,
- "Se esperaba {0} pero se ha encontrado: {1}"},
-
- { ER_INCORRECT_PROGRAMMER_ASSERTION,
- "La afirmaci\u00F3n del programador es incorrecta - {0}"},
-
- { ER_BOOLEAN_ARG_NO_LONGER_OPTIONAL,
- "El argumento boolean(...) ya no es opcional con el borrador de XPath 19990709."},
-
- { ER_FOUND_COMMA_BUT_NO_PRECEDING_ARG,
- "Se han encontrado ',' pero no va seguido de ning\u00FAn argumento"},
-
- { ER_FOUND_COMMA_BUT_NO_FOLLOWING_ARG,
- "Se han encontrado ',' pero no le sigue ning\u00FAn argumento"},
-
- { ER_PREDICATE_ILLEGAL_SYNTAX,
- "'..[predicate]' o '.[predicate]' es una sintaxis no v\u00E1lida. Utilice 'self::node()[predicate]' en su lugar."},
-
- { ER_ILLEGAL_AXIS_NAME,
- "nombre de eje no permitido: {0}"},
-
- { ER_UNKNOWN_NODETYPE,
- "Tipo de nodo desconocido: {0}"},
-
- { ER_PATTERN_LITERAL_NEEDS_BE_QUOTED,
- "El patr\u00F3n literal ({0}) debe incluirse entre comillas"},
-
- { ER_COULDNOT_BE_FORMATTED_TO_NUMBER,
- "{0} no se ha podido formatear en un n\u00FAmero."},
-
- { ER_COULDNOT_CREATE_XMLPROCESSORLIAISON,
- "No se ha podido crear el enlace TransformerFactory XML: {0}"},
-
- { ER_DIDNOT_FIND_XPATH_SELECT_EXP,
- "Error. No se ha encontrado la expresi\u00F3n de selecci\u00F3n xpath (-select)."},
-
- { ER_COULDNOT_FIND_ENDOP_AFTER_OPLOCATIONPATH,
- "ERROR. No se ha encontrado ENDOP despu\u00E9s de OP_LOCATIONPATH"},
-
- { ER_ERROR_OCCURED,
- "Se ha producido un error."},
-
- { ER_ILLEGAL_VARIABLE_REFERENCE,
- "La referencia de variable proporcionada para la variable est\u00E1 fuera de contexto o no tiene definici\u00F3n. Nombre = {0}"},
-
- { ER_AXES_NOT_ALLOWED,
- "S\u00F3lo los ejes child:: y attribute:: est\u00E1n permitidos en los patrones de coincidencia. Ejes incorrectos = {0}"},
-
- { ER_KEY_HAS_TOO_MANY_ARGS,
- "key() tiene un n\u00FAmero incorrecto de argumentos."},
-
- { ER_COUNT_TAKES_1_ARG,
- "La funci\u00F3n count necesita un argumento."},
-
- { ER_COULDNOT_FIND_FUNCTION,
- "No se ha encontrado la funci\u00F3n: {0}"},
-
- { ER_UNSUPPORTED_ENCODING,
- "Codificaci\u00F3n no soportada: {0}"},
-
- { ER_PROBLEM_IN_DTM_NEXTSIBLING,
- "Se ha producido un problema en DTM en getNextSibling... intentando la recuperaci\u00F3n"},
-
- { ER_CANNOT_WRITE_TO_EMPTYNODELISTIMPL,
- "Error de programador: no se puede escribir en EmptyNodeList."},
-
- { ER_SETDOMFACTORY_NOT_SUPPORTED,
- "setDOMFactory no est\u00E1 soportado por XPathContext."},
-
- { ER_PREFIX_MUST_RESOLVE,
- "El prefijo se debe resolver en un espacio de nombres: {0}"},
-
- { ER_PARSE_NOT_SUPPORTED,
- "El an\u00E1lisis (origen de InputSource) no est\u00E1 soportado en XPathContext. No se puede abrir {0}"},
-
- { ER_SAX_API_NOT_HANDLED,
- "Los caracteres de API SAX (char ch[]... no los gestiona el DTM."},
-
- { ER_IGNORABLE_WHITESPACE_NOT_HANDLED,
- "ignorableWhitespace(char ch[]... no gestionado por DTM."},
-
- { ER_DTM_CANNOT_HANDLE_NODES,
- "DTMLiaison no puede gestionar los nodos de tipo {0}"},
-
- { ER_XERCES_CANNOT_HANDLE_NODES,
- "DOM2Helper no puede gestionar los nodos de tipo {0}"},
-
- { ER_XERCES_PARSE_ERROR_DETAILS,
- "Error de DOM2Helper.parse: identificador de sistema - {0} l\u00EDnea - {1}"},
-
- { ER_XERCES_PARSE_ERROR,
- "Error de DOM2Helper.parse"},
-
- { ER_INVALID_UTF16_SURROGATE,
- "\u00BFSe ha detectado un sustituto UTF-16 no v\u00E1lido: {0}?"},
-
- { ER_OIERROR,
- "Error de ES"},
-
- { ER_CANNOT_CREATE_URL,
- "No se puede crear la URL para: {0}"},
-
- { ER_XPATH_READOBJECT,
- "En XPath.readObject: {0}"},
-
- { ER_FUNCTION_TOKEN_NOT_FOUND,
- "No se ha encontrado el token de funci\u00F3n."},
-
- { ER_CANNOT_DEAL_XPATH_TYPE,
- "No se puede negociar con el tipo de XPath: {0}"},
-
- { ER_NODESET_NOT_MUTABLE,
- "Este juego de nodos no es modificable"},
-
- { ER_NODESETDTM_NOT_MUTABLE,
- "Este DTM de juego de nodos no es modificable"},
-
- { ER_VAR_NOT_RESOLVABLE,
- "La variable no se puede resolver: {0}"},
-
- { ER_NULL_ERROR_HANDLER,
- "Manejador de errores nulo"},
-
- { ER_PROG_ASSERT_UNKNOWN_OPCODE,
- "Afirmaci\u00F3n del programador: c\u00F3digo de operaci\u00F3n desconocido: {0}"},
-
- { ER_ZERO_OR_ONE,
- "0 o 1"},
-
- { ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "rtf() no soportado por XRTreeFragSelectWrapper"},
-
- { ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "asNodeIterator() no soportado por XRTreeFragSelectWrapper"},
-
- /** detach() not supported by XRTreeFragSelectWrapper */
- { ER_DETACH_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "detach() no soportado por XRTreeFragSelectWrapper"},
-
- /** num() not supported by XRTreeFragSelectWrapper */
- { ER_NUM_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "num() no soportado por XRTreeFragSelectWrapper"},
-
- /** xstr() not supported by XRTreeFragSelectWrapper */
- { ER_XSTR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "xstr() no soportado por XRTreeFragSelectWrapper"},
-
- /** str() not supported by XRTreeFragSelectWrapper */
- { ER_STR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "str() no soportado por XRTreeFragSelectWrapper"},
-
- { ER_FSB_NOT_SUPPORTED_XSTRINGFORCHARS,
- "fsb() no soportado para XStringForChars"},
-
- { ER_COULD_NOT_FIND_VAR,
- "No se ha encontrado la variable con el nombre de {0}"},
-
- { ER_XSTRINGFORCHARS_CANNOT_TAKE_STRING,
- "XStringForChars no puede utilizar una cadena para un argumento"},
-
- { ER_FASTSTRINGBUFFER_CANNOT_BE_NULL,
- "El argumento FastStringBuffer no puede ser nulo"},
-
- { ER_TWO_OR_THREE,
- "2 o 3"},
-
- { ER_VARIABLE_ACCESSED_BEFORE_BIND,
- "Se ha accedido a la variable antes de que se haya enlazado."},
-
- { ER_FSB_CANNOT_TAKE_STRING,
- "XStringForFSB no puede utilizar una cadena para un argumento."},
-
- { ER_SETTING_WALKER_ROOT_TO_NULL,
- "\n Error. Definici\u00F3n de una ra\u00EDz de un walker como nula."},
-
- { ER_NODESETDTM_CANNOT_ITERATE,
- "Este DTM de juego de nodos no puede iterarse en un nodo anterior."},
-
- { ER_NODESET_CANNOT_ITERATE,
- "Este juego de nodos no se puede iterar en un nodo anterior."},
-
- { ER_NODESETDTM_CANNOT_INDEX,
- "Este DTM de juego de nodos no puede realizar funciones de indexaci\u00F3n o recuento."},
-
- { ER_NODESET_CANNOT_INDEX,
- "Este juego de nodos no puede realizar funciones de indexaci\u00F3n o recuento."},
-
- { ER_CANNOT_CALL_SETSHOULDCACHENODE,
- "No se puede llamar a setShouldCacheNodes despu\u00E9s de haber llamado a nextNode."},
-
- { ER_ONLY_ALLOWS,
- "{0} s\u00F3lo permite {1} argumentos"},
-
- { ER_UNKNOWN_STEP,
- "Afirmaci\u00F3n del programador en getNextStepPos: tipo de paso desconocido: {0}"},
-
- //Note to translators: A relative location path is a form of XPath expression.
- // The message indicates that such an expression was expected following the
- // characters '/' or '//', but was not found.
- { ER_EXPECTED_REL_LOC_PATH,
- "Se esperaba una ruta de acceso de ubicaci\u00F3n relativa despu\u00E9s del token '/' o '//'."},
-
- // Note to translators: A location path is a form of XPath expression.
- // The message indicates that syntactically such an expression was expected,but
- // the characters specified by the substitution text were encountered instead.
- { ER_EXPECTED_LOC_PATH,
- "Se esperaba una ruta de acceso de ubicaci\u00F3n, pero se ha encontrado el siguiente token: {0}"},
-
- // Note to translators: A location path is a form of XPath expression.
- // The message indicates that syntactically such a subexpression was expected,
- // but no more characters were found in the expression.
- { ER_EXPECTED_LOC_PATH_AT_END_EXPR,
- "Se esperaba una ruta de acceso de ubicaci\u00F3n, pero se ha encontrado el final de la expresi\u00F3n XPath en su lugar."},
-
- // Note to translators: A location step is part of an XPath expression.
- // The message indicates that syntactically such an expression was expected
- // following the specified characters.
- { ER_EXPECTED_LOC_STEP,
- "Se esperaba un paso de ubicaci\u00F3n despu\u00E9s del token '/' o '//'."},
-
- // Note to translators: A node test is part of an XPath expression that is
- // used to test for particular kinds of nodes. In this case, a node test that
- // consists of an NCName followed by a colon and an asterisk or that consists
- // of a QName was expected, but was not found.
- { ER_EXPECTED_NODE_TEST,
- "Se esperaba una prueba de nodo que coincidiera con el NCName:* o QName."},
-
- // Note to translators: A step pattern is part of an XPath expression.
- // The message indicates that syntactically such an expression was expected,
- // but the specified character was found in the expression instead.
- { ER_EXPECTED_STEP_PATTERN,
- "Se esperaba un patr\u00F3n de paso, pero se ha encontrado '/'."},
-
- // Note to translators: A relative path pattern is part of an XPath expression.
- // The message indicates that syntactically such an expression was expected,
- // but was not found.
- { ER_EXPECTED_REL_PATH_PATTERN,
- "Se esperaba un patr\u00F3n de ruta de acceso relativa."},
-
- // Note to translators: The substitution text is the name of a data type. The
- // message indicates that a value of a particular type could not be converted
- // to a value of type boolean.
- { ER_CANT_CONVERT_TO_BOOLEAN,
- "El valor de XPathResult de la expresi\u00F3n XPath ''{0}'' tiene un valor de XPathResultType de {1} que no se puede convertir en un valor booleano."},
-
- // Note to translators: Do not translate ANY_UNORDERED_NODE_TYPE and
- // FIRST_ORDERED_NODE_TYPE.
- { ER_CANT_CONVERT_TO_SINGLENODE,
- "El valor de XPathResult de la expresi\u00F3n XPath ''{0}'' tiene un valor de XPathResultType de {1} que no se puede convertir a un nodo \u00FAnico. El m\u00E9todo getSingleNodeValue se aplica s\u00F3lo a los tipos ANY_UNORDERED_NODE_TYPE y FIRST_ORDERED_NODE_TYPE."},
-
- // Note to translators: Do not translate UNORDERED_NODE_SNAPSHOT_TYPE and
- // ORDERED_NODE_SNAPSHOT_TYPE.
- { ER_CANT_GET_SNAPSHOT_LENGTH,
- "No se puede llamar al m\u00E9todo getSnapshotLength en la expresi\u00F3n XPathResult de XPath ''{0}'' porque el valor de su XPathResultType es {1}. Este m\u00E9todo se aplica s\u00F3lo a los tipos UNORDERED_NODE_SNAPSHOT_TYPE y ORDERED_NODE_SNAPSHOT_TYPE."},
-
- { ER_NON_ITERATOR_TYPE,
- "No se puede llamar al m\u00E9todo iterateNext en el XPathResult de la expresi\u00F3n XPath ''{0}'' porque el valor de su XPathResultType es {1}. Este m\u00E9todo se aplica s\u00F3lo a los tipos UNORDERED_NODE_ITERATOR_TYPE y ORDERED_NODE_ITERATOR_TYPE."},
-
- // Note to translators: This message indicates that the document being operated
- // upon changed, so the iterator object that was being used to traverse the
- // document has now become invalid.
- { ER_DOC_MUTATED,
- "Documento mutado debido a que se ha devuelto el resultado. El iterador no es v\u00E1lido."},
-
- { ER_INVALID_XPATH_TYPE,
- "Argumento de tipo XPath no v\u00E1lido: {0}"},
-
- { ER_EMPTY_XPATH_RESULT,
- "Objeto de resultado XPath vac\u00EDo"},
-
- { ER_INCOMPATIBLE_TYPES,
- "El valor de XPathResult de la expresi\u00F3n XPath ''{0}'' tiene un valor de XPathResultType de {1} que no se puede forzar en el XPathResultType especificado de {2}."},
-
- { ER_NULL_RESOLVER,
- "No se ha podido resolver el prefijo con el sistema de resoluci\u00F3n de prefijos nulo."},
-
- // Note to translators: The substitution text is the name of a data type. The
- // message indicates that a value of a particular type could not be converted
- // to a value of type string.
- { ER_CANT_CONVERT_TO_STRING,
- "El valor de XPathResult de la expresi\u00F3n XPath ''{0}'' tiene un valor de XPathResultType de {1} que no se puede convertir en una cadena."},
-
- // Note to translators: Do not translate snapshotItem,
- // UNORDERED_NODE_SNAPSHOT_TYPE and ORDERED_NODE_SNAPSHOT_TYPE.
- { ER_NON_SNAPSHOT_TYPE,
- "No se puede llamar al m\u00E9todo snapshotItem en la expresi\u00F3n XPathResult de XPath ''{0}'' porque el valor de su XPathResultType es {1}. Este m\u00E9todo se aplica s\u00F3lo a los tipos UNORDERED_NODE_SNAPSHOT_TYPE y ORDERED_NODE_SNAPSHOT_TYPE."},
-
- // Note to translators: XPathEvaluator is a Java interface name. An
- // XPathEvaluator is created with respect to a particular XML document, and in
- // this case the expression represented by this object was being evaluated with
- // respect to a context node from a different document.
- { ER_WRONG_DOCUMENT,
- "El nodo de contexto no pertenece al documento que est\u00E1 enlazado a este XPathEvaluator."},
-
- // Note to translators: The XPath expression cannot be evaluated with respect
- // to this type of node.
- { ER_WRONG_NODETYPE,
- "El tipo de nodo de contexto no est\u00E1 soportado."},
-
- { ER_XPATH_ERROR,
- "Error desconocido en XPath."},
-
- { ER_CANT_CONVERT_XPATHRESULTTYPE_TO_NUMBER,
- "El valor de XPathResult de la expresi\u00F3n XPath ''{0}'' tiene un valor de XPathResultType de {1} que no se puede convertir en un n\u00FAmero"},
-
- //BEGIN: Definitions of error keys used in exception messages of JAXP 1.3 XPath API implementation
-
- /** Field ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED */
-
- { ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED,
- "Funci\u00F3n de extensi\u00F3n: no se puede llamar a ''{0}'' cuando la funci\u00F3n XMLConstants.FEATURE_SECURE_PROCESSING est\u00E1 definida en true."},
-
- /** Field ER_RESOLVE_VARIABLE_RETURNS_NULL */
-
- { ER_RESOLVE_VARIABLE_RETURNS_NULL,
- "resolveVariable para la variable {0} devuelve un valor nulo"},
-
- /** Field ER_UNSUPPORTED_RETURN_TYPE */
-
- { ER_UNSUPPORTED_RETURN_TYPE,
- "Tipo de retorno no soportado: {0}"},
-
- /** Field ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL */
-
- { ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL,
- "El tipo de origen y/o retorno no puede ser nulo"},
-
- /** Field ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL */
-
- { ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL,
- "El tipo de origen y/o retorno no puede ser nulo"},
-
- /** Field ER_ARG_CANNOT_BE_NULL */
-
- { ER_ARG_CANNOT_BE_NULL,
- "El argumento {0} no puede ser nulo"},
-
- /** Field ER_OBJECT_MODEL_NULL */
-
- { ER_OBJECT_MODEL_NULL,
- "{0}#isObjectModelSupported( Cadena objectModel ) no se puede llamar con objectModel == null"},
-
- /** Field ER_OBJECT_MODEL_EMPTY */
-
- { ER_OBJECT_MODEL_EMPTY,
- "{0}#isObjectModelSupported( Cadena objectModel ) no se puede llamar con objectModel == \"\""},
-
- /** Field ER_OBJECT_MODEL_EMPTY */
-
- { ER_FEATURE_NAME_NULL,
- "Intentando definir una funci\u00F3n con un nombre nulo: {0}#setFeature( null, {1})"},
-
- /** Field ER_FEATURE_UNKNOWN */
-
- { ER_FEATURE_UNKNOWN,
- "Intentando definir la funci\u00F3n desconocida \"{0}\":{1}#setFeature({0},{2})"},
-
- /** Field ER_GETTING_NULL_FEATURE */
-
- { ER_GETTING_NULL_FEATURE,
- "Intentando obtener una funci\u00F3n con un nombre nulo: {0}#getFeature(null)"},
-
- /** Field ER_GETTING_NULL_FEATURE */
-
- { ER_GETTING_UNKNOWN_FEATURE,
- "Intentando obtener la funci\u00F3n desconocida \"{0}\":{1}#getFeature({0})"},
-
- {ER_SECUREPROCESSING_FEATURE,
- "FEATURE_SECURE_PROCESSING: no se puede definir la funci\u00F3n en false cuando est\u00E1 presente el gestor de seguridad: {1}#setFeature({0},{2})"},
-
- /** Field ER_NULL_XPATH_FUNCTION_RESOLVER */
-
- { ER_NULL_XPATH_FUNCTION_RESOLVER,
- "Se est\u00E1 intentando definir un valor de XPathFunctionResolver nulo:{0}#setXPathFunctionResolver(null)"},
-
- /** Field ER_NULL_XPATH_VARIABLE_RESOLVER */
-
- { ER_NULL_XPATH_VARIABLE_RESOLVER,
- "Se est\u00E1 intentando definir un valor XPathVariableResolver nulo:{0}#setXPathVariableResolver(null)"},
-
- //END: Definitions of error keys used in exception messages of JAXP 1.3 XPath API implementation
-
- // Warnings...
-
- { WG_LOCALE_NAME_NOT_HANDLED,
- "El nombre de la configuraci\u00F3n regional en la funci\u00F3n format-number no se ha manejado a\u00FAn."},
-
- { WG_PROPERTY_NOT_SUPPORTED,
- "Propiedad XSL no soportada: {0}"},
-
- { WG_DONT_DO_ANYTHING_WITH_NS,
- "No realice ninguna acci\u00F3n con el espacio de nombres {0} en la propiedad: {1}"},
-
- { WG_SECURITY_EXCEPTION,
- "Excepci\u00F3n de seguridad al intentar acceder a la propiedad del sistema XSL: {0}"},
-
- { WG_QUO_NO_LONGER_DEFINED,
- "Sintaxis anterior: quo(...) ya no se define en XPath."},
-
- { WG_NEED_DERIVED_OBJECT_TO_IMPLEMENT_NODETEST,
- "XPath necesita un objeto derivado para implantar una prueba de nodo."},
-
- { WG_FUNCTION_TOKEN_NOT_FOUND,
- "No se ha encontrado el token de funci\u00F3n."},
-
- { WG_COULDNOT_FIND_FUNCTION,
- "No se ha encontrado la funci\u00F3n: {0}"},
-
- { WG_CANNOT_MAKE_URL_FROM,
- "No se puede crear la URL desde: {0}"},
-
- { WG_EXPAND_ENTITIES_NOT_SUPPORTED,
- "Opci\u00F3n -E no soportada para el analizador DTM"},
-
- { WG_ILLEGAL_VARIABLE_REFERENCE,
- "La referencia de variable proporcionada para la variable est\u00E1 fuera de contexto o no tiene definici\u00F3n. Nombre = {0}"},
-
- { WG_UNSUPPORTED_ENCODING,
- "Codificaci\u00F3n no soportada: {0}"},
-
-
-
- // Other miscellaneous text used inside the code...
- { "ui_language", "es"},
- { "help_language", "es"},
- { "language", "es"},
- { "BAD_CODE", "El par\u00E1metro para crear un mensaje est\u00E1 fuera de los l\u00EDmites"},
- { "FORMAT_FAILED", "Se ha emitido una excepci\u00F3n durante la llamada a messageFormat"},
- { "version", ">>>>>>> Versi\u00F3n Xalan "},
- { "version2", "<<<<<<<"},
- { "yes", "s\u00ED"},
- { "line", "N\u00BA de L\u00EDnea"},
- { "column", "N\u00BA de Columna"},
- { "xsldone", "XSLProcessor: listo"},
- { "xpath_option", "Opciones de xpath: "},
- { "optionIN", " [-in inputXMLURL]"},
- { "optionSelect", " [-select expresi\u00F3n xpath]"},
- { "optionMatch", " [-match patr\u00F3n de coincidencia (para diagn\u00F3sticos de coincidencia)]"},
- { "optionAnyExpr", "O s\u00F3lo una expresi\u00F3n xpath realizar\u00E1 un volcado de diagn\u00F3stico"},
- { "noParsermsg1", "El proceso XSL no se ha realizado correctamente."},
- { "noParsermsg2", "** No se ha encontrado el analizador **"},
- { "noParsermsg3", "Compruebe la classpath."},
- { "noParsermsg4", "Si no tiene un analizador XML de IBM para Java, puede descargarlo de"},
- { "noParsermsg5", "AlphaWorks de IBM: http://www.alphaworks.ibm.com/formula/xml"},
- { "gtone", ">1" },
- { "zero", "0" },
- { "one", "1" },
- { "two" , "2" },
- { "three", "3" }
-
- };
-
- /**
- * Get the association list.
- *
- * @return The association list.
- */
- public Object[][] getContents()
- {
- return _contents;
- }
-
-
- // ================= INFRASTRUCTURE ======================
-
- /** Field BAD_CODE */
- public static final String BAD_CODE = "BAD_CODE";
-
- /** Field FORMAT_FAILED */
- public static final String FORMAT_FAILED = "FORMAT_FAILED";
-
- /** Field ERROR_RESOURCES */
- public static final String ERROR_RESOURCES =
- "com.sun.org.apache.xpath.internal.res.XPATHErrorResources";
-
- /** Field ERROR_STRING */
- public static final String ERROR_STRING = "#error";
-
- /** Field ERROR_HEADER */
- public static final String ERROR_HEADER = "Error: ";
-
- /** Field WARNING_HEADER */
- public static final String WARNING_HEADER = "Warning: ";
-
- /** Field XSL_HEADER */
- public static final String XSL_HEADER = "XSL ";
-
- /** Field XML_HEADER */
- public static final String XML_HEADER = "XML ";
-
- /** Field QUERY_HEADER */
- public static final String QUERY_HEADER = "PATTERN ";
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_fr.java b/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_fr.java
deleted file mode 100644
index 1eb8318..0000000
--- a/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_fr.java
+++ /dev/null
@@ -1,936 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xpath.internal.res;
-
-import java.util.ListResourceBundle;
-
-/**
- * Set up error messages.
- * We build a two dimensional array of message keys and
- * message strings. In order to add a new message here,
- * you need to first add a Static string constant for the
- * Key and update the contents array with Key, Value pair
- * Also you need to update the count of messages(MAX_CODE)or
- * the count of warnings(MAX_WARNING) [ Information purpose only]
- * @xsl.usage advanced
- */
-public class XPATHErrorResources_fr extends ListResourceBundle
-{
-
-/*
- * General notes to translators:
- *
- * This file contains error and warning messages related to XPath Error
- * Handling.
- *
- * 1) Xalan (or more properly, Xalan-interpretive) and XSLTC are names of
- * components.
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- * XSLTC is an acronym for XSLT Compiler.
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 5) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 6) "Translet" is an invented term that describes the class file that
- * results from compiling an XML stylesheet into a Java class.
- *
- * 7) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- * 8) The context node is the node in the document with respect to which an
- * XPath expression is being evaluated.
- *
- * 9) An iterator is an object that traverses nodes in the tree, one at a time.
- *
- * 10) NCName is an XML term used to describe a name that does not contain a
- * colon (a "no-colon name").
- *
- * 11) QName is an XML term meaning "qualified name".
- */
-
- /*
- * static variables
- */
- public static final String ERROR0000 = "ERROR0000";
- public static final String ER_CURRENT_NOT_ALLOWED_IN_MATCH =
- "ER_CURRENT_NOT_ALLOWED_IN_MATCH";
- public static final String ER_CURRENT_TAKES_NO_ARGS =
- "ER_CURRENT_TAKES_NO_ARGS";
- public static final String ER_DOCUMENT_REPLACED = "ER_DOCUMENT_REPLACED";
- public static final String ER_CONTEXT_HAS_NO_OWNERDOC =
- "ER_CONTEXT_HAS_NO_OWNERDOC";
- public static final String ER_LOCALNAME_HAS_TOO_MANY_ARGS =
- "ER_LOCALNAME_HAS_TOO_MANY_ARGS";
- public static final String ER_NAMESPACEURI_HAS_TOO_MANY_ARGS =
- "ER_NAMESPACEURI_HAS_TOO_MANY_ARGS";
- public static final String ER_NORMALIZESPACE_HAS_TOO_MANY_ARGS =
- "ER_NORMALIZESPACE_HAS_TOO_MANY_ARGS";
- public static final String ER_NUMBER_HAS_TOO_MANY_ARGS =
- "ER_NUMBER_HAS_TOO_MANY_ARGS";
- public static final String ER_NAME_HAS_TOO_MANY_ARGS =
- "ER_NAME_HAS_TOO_MANY_ARGS";
- public static final String ER_STRING_HAS_TOO_MANY_ARGS =
- "ER_STRING_HAS_TOO_MANY_ARGS";
- public static final String ER_STRINGLENGTH_HAS_TOO_MANY_ARGS =
- "ER_STRINGLENGTH_HAS_TOO_MANY_ARGS";
- public static final String ER_TRANSLATE_TAKES_3_ARGS =
- "ER_TRANSLATE_TAKES_3_ARGS";
- public static final String ER_UNPARSEDENTITYURI_TAKES_1_ARG =
- "ER_UNPARSEDENTITYURI_TAKES_1_ARG";
- public static final String ER_NAMESPACEAXIS_NOT_IMPLEMENTED =
- "ER_NAMESPACEAXIS_NOT_IMPLEMENTED";
- public static final String ER_UNKNOWN_AXIS = "ER_UNKNOWN_AXIS";
- public static final String ER_UNKNOWN_MATCH_OPERATION =
- "ER_UNKNOWN_MATCH_OPERATION";
- public static final String ER_INCORRECT_ARG_LENGTH ="ER_INCORRECT_ARG_LENGTH";
- public static final String ER_CANT_CONVERT_TO_NUMBER =
- "ER_CANT_CONVERT_TO_NUMBER";
- public static final String ER_CANT_CONVERT_XPATHRESULTTYPE_TO_NUMBER =
- "ER_CANT_CONVERT_XPATHRESULTTYPE_TO_NUMBER";
- public static final String ER_CANT_CONVERT_TO_NODELIST =
- "ER_CANT_CONVERT_TO_NODELIST";
- public static final String ER_CANT_CONVERT_TO_MUTABLENODELIST =
- "ER_CANT_CONVERT_TO_MUTABLENODELIST";
- public static final String ER_CANT_CONVERT_TO_TYPE ="ER_CANT_CONVERT_TO_TYPE";
- public static final String ER_EXPECTED_MATCH_PATTERN =
- "ER_EXPECTED_MATCH_PATTERN";
- public static final String ER_COULDNOT_GET_VAR_NAMED =
- "ER_COULDNOT_GET_VAR_NAMED";
- public static final String ER_UNKNOWN_OPCODE = "ER_UNKNOWN_OPCODE";
- public static final String ER_EXTRA_ILLEGAL_TOKENS ="ER_EXTRA_ILLEGAL_TOKENS";
- public static final String ER_EXPECTED_DOUBLE_QUOTE =
- "ER_EXPECTED_DOUBLE_QUOTE";
- public static final String ER_EXPECTED_SINGLE_QUOTE =
- "ER_EXPECTED_SINGLE_QUOTE";
- public static final String ER_EMPTY_EXPRESSION = "ER_EMPTY_EXPRESSION";
- public static final String ER_EXPECTED_BUT_FOUND = "ER_EXPECTED_BUT_FOUND";
- public static final String ER_INCORRECT_PROGRAMMER_ASSERTION =
- "ER_INCORRECT_PROGRAMMER_ASSERTION";
- public static final String ER_BOOLEAN_ARG_NO_LONGER_OPTIONAL =
- "ER_BOOLEAN_ARG_NO_LONGER_OPTIONAL";
- public static final String ER_FOUND_COMMA_BUT_NO_PRECEDING_ARG =
- "ER_FOUND_COMMA_BUT_NO_PRECEDING_ARG";
- public static final String ER_FOUND_COMMA_BUT_NO_FOLLOWING_ARG =
- "ER_FOUND_COMMA_BUT_NO_FOLLOWING_ARG";
- public static final String ER_PREDICATE_ILLEGAL_SYNTAX =
- "ER_PREDICATE_ILLEGAL_SYNTAX";
- public static final String ER_ILLEGAL_AXIS_NAME = "ER_ILLEGAL_AXIS_NAME";
- public static final String ER_UNKNOWN_NODETYPE = "ER_UNKNOWN_NODETYPE";
- public static final String ER_PATTERN_LITERAL_NEEDS_BE_QUOTED =
- "ER_PATTERN_LITERAL_NEEDS_BE_QUOTED";
- public static final String ER_COULDNOT_BE_FORMATTED_TO_NUMBER =
- "ER_COULDNOT_BE_FORMATTED_TO_NUMBER";
- public static final String ER_COULDNOT_CREATE_XMLPROCESSORLIAISON =
- "ER_COULDNOT_CREATE_XMLPROCESSORLIAISON";
- public static final String ER_DIDNOT_FIND_XPATH_SELECT_EXP =
- "ER_DIDNOT_FIND_XPATH_SELECT_EXP";
- public static final String ER_COULDNOT_FIND_ENDOP_AFTER_OPLOCATIONPATH =
- "ER_COULDNOT_FIND_ENDOP_AFTER_OPLOCATIONPATH";
- public static final String ER_ERROR_OCCURED = "ER_ERROR_OCCURED";
- public static final String ER_ILLEGAL_VARIABLE_REFERENCE =
- "ER_ILLEGAL_VARIABLE_REFERENCE";
- public static final String ER_AXES_NOT_ALLOWED = "ER_AXES_NOT_ALLOWED";
- public static final String ER_KEY_HAS_TOO_MANY_ARGS =
- "ER_KEY_HAS_TOO_MANY_ARGS";
- public static final String ER_COUNT_TAKES_1_ARG = "ER_COUNT_TAKES_1_ARG";
- public static final String ER_COULDNOT_FIND_FUNCTION =
- "ER_COULDNOT_FIND_FUNCTION";
- public static final String ER_UNSUPPORTED_ENCODING ="ER_UNSUPPORTED_ENCODING";
- public static final String ER_PROBLEM_IN_DTM_NEXTSIBLING =
- "ER_PROBLEM_IN_DTM_NEXTSIBLING";
- public static final String ER_CANNOT_WRITE_TO_EMPTYNODELISTIMPL =
- "ER_CANNOT_WRITE_TO_EMPTYNODELISTIMPL";
- public static final String ER_SETDOMFACTORY_NOT_SUPPORTED =
- "ER_SETDOMFACTORY_NOT_SUPPORTED";
- public static final String ER_PREFIX_MUST_RESOLVE = "ER_PREFIX_MUST_RESOLVE";
- public static final String ER_PARSE_NOT_SUPPORTED = "ER_PARSE_NOT_SUPPORTED";
- public static final String ER_SAX_API_NOT_HANDLED = "ER_SAX_API_NOT_HANDLED";
-public static final String ER_IGNORABLE_WHITESPACE_NOT_HANDLED =
- "ER_IGNORABLE_WHITESPACE_NOT_HANDLED";
- public static final String ER_DTM_CANNOT_HANDLE_NODES =
- "ER_DTM_CANNOT_HANDLE_NODES";
- public static final String ER_XERCES_CANNOT_HANDLE_NODES =
- "ER_XERCES_CANNOT_HANDLE_NODES";
- public static final String ER_XERCES_PARSE_ERROR_DETAILS =
- "ER_XERCES_PARSE_ERROR_DETAILS";
- public static final String ER_XERCES_PARSE_ERROR = "ER_XERCES_PARSE_ERROR";
- public static final String ER_INVALID_UTF16_SURROGATE =
- "ER_INVALID_UTF16_SURROGATE";
- public static final String ER_OIERROR = "ER_OIERROR";
- public static final String ER_CANNOT_CREATE_URL = "ER_CANNOT_CREATE_URL";
- public static final String ER_XPATH_READOBJECT = "ER_XPATH_READOBJECT";
- public static final String ER_FUNCTION_TOKEN_NOT_FOUND =
- "ER_FUNCTION_TOKEN_NOT_FOUND";
- public static final String ER_CANNOT_DEAL_XPATH_TYPE =
- "ER_CANNOT_DEAL_XPATH_TYPE";
- public static final String ER_NODESET_NOT_MUTABLE = "ER_NODESET_NOT_MUTABLE";
- public static final String ER_NODESETDTM_NOT_MUTABLE =
- "ER_NODESETDTM_NOT_MUTABLE";
- /** Variable not resolvable: */
- public static final String ER_VAR_NOT_RESOLVABLE = "ER_VAR_NOT_RESOLVABLE";
- /** Null error handler */
- public static final String ER_NULL_ERROR_HANDLER = "ER_NULL_ERROR_HANDLER";
- /** Programmer's assertion: unknown opcode */
- public static final String ER_PROG_ASSERT_UNKNOWN_OPCODE =
- "ER_PROG_ASSERT_UNKNOWN_OPCODE";
- /** 0 or 1 */
- public static final String ER_ZERO_OR_ONE = "ER_ZERO_OR_ONE";
- /** rtf() not supported by XRTreeFragSelectWrapper */
- public static final String ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** asNodeIterator() not supported by XRTreeFragSelectWrapper */
- public static final String ER_ASNODEITERATOR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER = "ER_ASNODEITERATOR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** fsb() not supported for XStringForChars */
- public static final String ER_FSB_NOT_SUPPORTED_XSTRINGFORCHARS =
- "ER_FSB_NOT_SUPPORTED_XSTRINGFORCHARS";
- /** Could not find variable with the name of */
- public static final String ER_COULD_NOT_FIND_VAR = "ER_COULD_NOT_FIND_VAR";
- /** XStringForChars can not take a string for an argument */
- public static final String ER_XSTRINGFORCHARS_CANNOT_TAKE_STRING =
- "ER_XSTRINGFORCHARS_CANNOT_TAKE_STRING";
- /** The FastStringBuffer argument can not be null */
- public static final String ER_FASTSTRINGBUFFER_CANNOT_BE_NULL =
- "ER_FASTSTRINGBUFFER_CANNOT_BE_NULL";
- /** 2 or 3 */
- public static final String ER_TWO_OR_THREE = "ER_TWO_OR_THREE";
- /** Variable accessed before it is bound! */
- public static final String ER_VARIABLE_ACCESSED_BEFORE_BIND =
- "ER_VARIABLE_ACCESSED_BEFORE_BIND";
- /** XStringForFSB can not take a string for an argument! */
- public static final String ER_FSB_CANNOT_TAKE_STRING =
- "ER_FSB_CANNOT_TAKE_STRING";
- /** Error! Setting the root of a walker to null! */
- public static final String ER_SETTING_WALKER_ROOT_TO_NULL =
- "ER_SETTING_WALKER_ROOT_TO_NULL";
- /** This NodeSetDTM can not iterate to a previous node! */
- public static final String ER_NODESETDTM_CANNOT_ITERATE =
- "ER_NODESETDTM_CANNOT_ITERATE";
- /** This NodeSet can not iterate to a previous node! */
- public static final String ER_NODESET_CANNOT_ITERATE =
- "ER_NODESET_CANNOT_ITERATE";
- /** This NodeSetDTM can not do indexing or counting functions! */
- public static final String ER_NODESETDTM_CANNOT_INDEX =
- "ER_NODESETDTM_CANNOT_INDEX";
- /** This NodeSet can not do indexing or counting functions! */
- public static final String ER_NODESET_CANNOT_INDEX =
- "ER_NODESET_CANNOT_INDEX";
- /** Can not call setShouldCacheNodes after nextNode has been called! */
- public static final String ER_CANNOT_CALL_SETSHOULDCACHENODE =
- "ER_CANNOT_CALL_SETSHOULDCACHENODE";
- /** {0} only allows {1} arguments */
- public static final String ER_ONLY_ALLOWS = "ER_ONLY_ALLOWS";
- /** Programmer's assertion in getNextStepPos: unknown stepType: {0} */
- public static final String ER_UNKNOWN_STEP = "ER_UNKNOWN_STEP";
- /** Problem with RelativeLocationPath */
- public static final String ER_EXPECTED_REL_LOC_PATH =
- "ER_EXPECTED_REL_LOC_PATH";
- /** Problem with LocationPath */
- public static final String ER_EXPECTED_LOC_PATH = "ER_EXPECTED_LOC_PATH";
- public static final String ER_EXPECTED_LOC_PATH_AT_END_EXPR =
- "ER_EXPECTED_LOC_PATH_AT_END_EXPR";
- /** Problem with Step */
- public static final String ER_EXPECTED_LOC_STEP = "ER_EXPECTED_LOC_STEP";
- /** Problem with NodeTest */
- public static final String ER_EXPECTED_NODE_TEST = "ER_EXPECTED_NODE_TEST";
- /** Expected step pattern */
- public static final String ER_EXPECTED_STEP_PATTERN =
- "ER_EXPECTED_STEP_PATTERN";
- /** Expected relative path pattern */
- public static final String ER_EXPECTED_REL_PATH_PATTERN =
- "ER_EXPECTED_REL_PATH_PATTERN";
- /** ER_CANT_CONVERT_XPATHRESULTTYPE_TO_BOOLEAN */
- public static final String ER_CANT_CONVERT_TO_BOOLEAN =
- "ER_CANT_CONVERT_TO_BOOLEAN";
- /** Field ER_CANT_CONVERT_TO_SINGLENODE */
- public static final String ER_CANT_CONVERT_TO_SINGLENODE =
- "ER_CANT_CONVERT_TO_SINGLENODE";
- /** Field ER_CANT_GET_SNAPSHOT_LENGTH */
- public static final String ER_CANT_GET_SNAPSHOT_LENGTH =
- "ER_CANT_GET_SNAPSHOT_LENGTH";
- /** Field ER_NON_ITERATOR_TYPE */
- public static final String ER_NON_ITERATOR_TYPE = "ER_NON_ITERATOR_TYPE";
- /** Field ER_DOC_MUTATED */
- public static final String ER_DOC_MUTATED = "ER_DOC_MUTATED";
- public static final String ER_INVALID_XPATH_TYPE = "ER_INVALID_XPATH_TYPE";
- public static final String ER_EMPTY_XPATH_RESULT = "ER_EMPTY_XPATH_RESULT";
- public static final String ER_INCOMPATIBLE_TYPES = "ER_INCOMPATIBLE_TYPES";
- public static final String ER_NULL_RESOLVER = "ER_NULL_RESOLVER";
- public static final String ER_CANT_CONVERT_TO_STRING =
- "ER_CANT_CONVERT_TO_STRING";
- public static final String ER_NON_SNAPSHOT_TYPE = "ER_NON_SNAPSHOT_TYPE";
- public static final String ER_WRONG_DOCUMENT = "ER_WRONG_DOCUMENT";
- /* Note to translators: The XPath expression cannot be evaluated with respect
- * to this type of node.
- */
- /** Field ER_WRONG_NODETYPE */
- public static final String ER_WRONG_NODETYPE = "ER_WRONG_NODETYPE";
- public static final String ER_XPATH_ERROR = "ER_XPATH_ERROR";
-
- //BEGIN: Keys needed for exception messages of JAXP 1.3 XPath API implementation
- public static final String ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED = "ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED";
- public static final String ER_RESOLVE_VARIABLE_RETURNS_NULL = "ER_RESOLVE_VARIABLE_RETURNS_NULL";
- public static final String ER_UNSUPPORTED_RETURN_TYPE = "ER_UNSUPPORTED_RETURN_TYPE";
- public static final String ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL = "ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL";
- public static final String ER_ARG_CANNOT_BE_NULL = "ER_ARG_CANNOT_BE_NULL";
-
- public static final String ER_OBJECT_MODEL_NULL = "ER_OBJECT_MODEL_NULL";
- public static final String ER_OBJECT_MODEL_EMPTY = "ER_OBJECT_MODEL_EMPTY";
- public static final String ER_FEATURE_NAME_NULL = "ER_FEATURE_NAME_NULL";
- public static final String ER_FEATURE_UNKNOWN = "ER_FEATURE_UNKNOWN";
- public static final String ER_GETTING_NULL_FEATURE = "ER_GETTING_NULL_FEATURE";
- public static final String ER_GETTING_UNKNOWN_FEATURE = "ER_GETTING_UNKNOWN_FEATURE";
- public static final String ER_SECUREPROCESSING_FEATURE = "ER_SECUREPROCESSING_FEATURE";
- public static final String ER_NULL_XPATH_FUNCTION_RESOLVER = "ER_NULL_XPATH_FUNCTION_RESOLVER";
- public static final String ER_NULL_XPATH_VARIABLE_RESOLVER = "ER_NULL_XPATH_VARIABLE_RESOLVER";
- //END: Keys needed for exception messages of JAXP 1.3 XPath API implementation
-
- public static final String WG_LOCALE_NAME_NOT_HANDLED =
- "WG_LOCALE_NAME_NOT_HANDLED";
- public static final String WG_PROPERTY_NOT_SUPPORTED =
- "WG_PROPERTY_NOT_SUPPORTED";
- public static final String WG_DONT_DO_ANYTHING_WITH_NS =
- "WG_DONT_DO_ANYTHING_WITH_NS";
- public static final String WG_SECURITY_EXCEPTION = "WG_SECURITY_EXCEPTION";
- public static final String WG_QUO_NO_LONGER_DEFINED =
- "WG_QUO_NO_LONGER_DEFINED";
- public static final String WG_NEED_DERIVED_OBJECT_TO_IMPLEMENT_NODETEST =
- "WG_NEED_DERIVED_OBJECT_TO_IMPLEMENT_NODETEST";
- public static final String WG_FUNCTION_TOKEN_NOT_FOUND =
- "WG_FUNCTION_TOKEN_NOT_FOUND";
- public static final String WG_COULDNOT_FIND_FUNCTION =
- "WG_COULDNOT_FIND_FUNCTION";
- public static final String WG_CANNOT_MAKE_URL_FROM ="WG_CANNOT_MAKE_URL_FROM";
- public static final String WG_EXPAND_ENTITIES_NOT_SUPPORTED =
- "WG_EXPAND_ENTITIES_NOT_SUPPORTED";
- public static final String WG_ILLEGAL_VARIABLE_REFERENCE =
- "WG_ILLEGAL_VARIABLE_REFERENCE";
- public static final String WG_UNSUPPORTED_ENCODING ="WG_UNSUPPORTED_ENCODING";
-
- /** detach() not supported by XRTreeFragSelectWrapper */
- public static final String ER_DETACH_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_DETACH_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** num() not supported by XRTreeFragSelectWrapper */
- public static final String ER_NUM_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_NUM_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** xstr() not supported by XRTreeFragSelectWrapper */
- public static final String ER_XSTR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_XSTR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** str() not supported by XRTreeFragSelectWrapper */
- public static final String ER_STR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_STR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
-
- // Error messages...
-
- private static final Object[][] _contents = new Object[][]{
-
- { "ERROR0000" , "{0}" },
-
- { ER_CURRENT_NOT_ALLOWED_IN_MATCH, "La fonction current() n'est pas autoris\u00E9e dans un mod\u00E8le de recherche." },
-
- { ER_CURRENT_TAKES_NO_ARGS, "La fonction current() n'accepte pas d'argument." },
-
- { ER_DOCUMENT_REPLACED,
- "L'impl\u00E9mentation de la fonction document() a \u00E9t\u00E9 remplac\u00E9e par com.sun.org.apache.xalan.internal.xslt.FuncDocument."},
-
- { ER_CONTEXT_HAS_NO_OWNERDOC,
- "le contexte ne poss\u00E8de pas de document propri\u00E9taire."},
-
- { ER_LOCALNAME_HAS_TOO_MANY_ARGS,
- "local-name() poss\u00E8de trop d'arguments."},
-
- { ER_NAMESPACEURI_HAS_TOO_MANY_ARGS,
- "namespace-uri() poss\u00E8de trop d'arguments."},
-
- { ER_NORMALIZESPACE_HAS_TOO_MANY_ARGS,
- "normalize-space() poss\u00E8de trop d'arguments."},
-
- { ER_NUMBER_HAS_TOO_MANY_ARGS,
- "number() poss\u00E8de trop d'arguments."},
-
- { ER_NAME_HAS_TOO_MANY_ARGS,
- "name() poss\u00E8de trop d'arguments."},
-
- { ER_STRING_HAS_TOO_MANY_ARGS,
- "string() poss\u00E8de trop d'arguments."},
-
- { ER_STRINGLENGTH_HAS_TOO_MANY_ARGS,
- "string-length() poss\u00E8de trop d'arguments."},
-
- { ER_TRANSLATE_TAKES_3_ARGS,
- "La fonction translate() accepte trois arguments."},
-
- { ER_UNPARSEDENTITYURI_TAKES_1_ARG,
- "Un argument doit \u00EAtre fourni \u00E0 la fonction unparsed-entity-uri."},
-
- { ER_NAMESPACEAXIS_NOT_IMPLEMENTED,
- "l'axe de l'espace de noms n'est pas impl\u00E9ment\u00E9."},
-
- { ER_UNKNOWN_AXIS,
- "axe inconnu : {0}"},
-
- { ER_UNKNOWN_MATCH_OPERATION,
- "op\u00E9ration de correspondance inconnue."},
-
- { ER_INCORRECT_ARG_LENGTH,
- "La longueur d'argument du test du noeud processing-instruction() n'est pas correcte."},
-
- { ER_CANT_CONVERT_TO_NUMBER,
- "Impossible de convertir {0} en nombre"},
-
- { ER_CANT_CONVERT_TO_NODELIST,
- "Impossible de convertir {0} en NodeList."},
-
- { ER_CANT_CONVERT_TO_MUTABLENODELIST,
- "Impossible de convertir {0} en NodeSetDTM."},
-
- { ER_CANT_CONVERT_TO_TYPE,
- "Impossible de convertir {0} en type#{1}"},
-
- { ER_EXPECTED_MATCH_PATTERN,
- "Mod\u00E8le de recherche attendu dans getMatchScore."},
-
- { ER_COULDNOT_GET_VAR_NAMED,
- "Impossible d''obtenir la variable nomm\u00E9e {0}"},
-
- { ER_UNKNOWN_OPCODE,
- "ERREUR. Code d''op\u00E9ration inconnu : {0}"},
-
- { ER_EXTRA_ILLEGAL_TOKENS,
- "Jetons non admis suppl\u00E9mentaires : {0}"},
-
- { ER_EXPECTED_DOUBLE_QUOTE,
- "Erreur de guillemets dans un litt\u00E9ral... Guillemets obligatoires."},
-
- { ER_EXPECTED_SINGLE_QUOTE,
- "Erreur d'apostrophe dans un litt\u00E9ral... Apostrophe obligatoire."},
-
- { ER_EMPTY_EXPRESSION,
- "Expression vide."},
-
- { ER_EXPECTED_BUT_FOUND,
- "Valeur attendue : {0}, mais {1} a \u00E9t\u00E9 trouv\u00E9"},
-
- { ER_INCORRECT_PROGRAMMER_ASSERTION,
- "Assertion de programmeur incorrecte. - {0}"},
-
- { ER_BOOLEAN_ARG_NO_LONGER_OPTIONAL,
- "L'argument boolean(...) n'est plus facultatif avec le brouillon (draft) XPath 19990709."},
-
- { ER_FOUND_COMMA_BUT_NO_PRECEDING_ARG,
- "Caract\u00E8re ',' trouv\u00E9 sans argument le pr\u00E9c\u00E9dant."},
-
- { ER_FOUND_COMMA_BUT_NO_FOLLOWING_ARG,
- "Caract\u00E8re ',' trouv\u00E9 sans argument le suivant."},
-
- { ER_PREDICATE_ILLEGAL_SYNTAX,
- "Syntaxe '..[predicate]' ou '.[predicate]' non admise. Utilisez 'self::node()[predicate]' \u00E0 la place."},
-
- { ER_ILLEGAL_AXIS_NAME,
- "nom d''axe non admis : {0}"},
-
- { ER_UNKNOWN_NODETYPE,
- "Type de noeud inconnu : {0}"},
-
- { ER_PATTERN_LITERAL_NEEDS_BE_QUOTED,
- "Le litt\u00E9ral de mod\u00E8le ({0}) doit figurer entre guillemets."},
-
- { ER_COULDNOT_BE_FORMATTED_TO_NUMBER,
- "Impossible de formater {0} en nombre."},
-
- { ER_COULDNOT_CREATE_XMLPROCESSORLIAISON,
- "Impossible de cr\u00E9er la liaison XML TransformerFactory : {0}"},
-
- { ER_DIDNOT_FIND_XPATH_SELECT_EXP,
- "Erreur. Expression de s\u00E9lection XPath (-select) introuvable."},
-
- { ER_COULDNOT_FIND_ENDOP_AFTER_OPLOCATIONPATH,
- "ERREUR. ENDOP introuvable apr\u00E8s OP_LOCATIONPATH"},
-
- { ER_ERROR_OCCURED,
- "Une erreur est survenue."},
-
- { ER_ILLEGAL_VARIABLE_REFERENCE,
- "L''\u00E9l\u00E9ment VariableReference indiqu\u00E9 pour la variable est hors contexte ou sans d\u00E9finition. Nom = {0}"},
-
- { ER_AXES_NOT_ALLOWED,
- "Seuls les axes child:: et attribute:: sont autoris\u00E9s dans des mod\u00E8les de recherche. Axes en cause = {0}"},
-
- { ER_KEY_HAS_TOO_MANY_ARGS,
- "key() poss\u00E8de un nombre incorrect d'arguments."},
-
- { ER_COUNT_TAKES_1_ARG,
- "Un seul argument doit \u00EAtre fourni \u00E0 la fonction de d\u00E9compte."},
-
- { ER_COULDNOT_FIND_FUNCTION,
- "Impossible de trouver la fonction : {0}"},
-
- { ER_UNSUPPORTED_ENCODING,
- "Encodage non pris en charge : {0}"},
-
- { ER_PROBLEM_IN_DTM_NEXTSIBLING,
- "Une erreur est survenue dans le DTM de getNextSibling... Tentative de r\u00E9cup\u00E9ration"},
-
- { ER_CANNOT_WRITE_TO_EMPTYNODELISTIMPL,
- "Erreur de programmeur : \u00E9criture impossible dans EmptyNodeList."},
-
- { ER_SETDOMFACTORY_NOT_SUPPORTED,
- "SetDOMFactory n'est pas pris en charge par XPathContext."},
-
- { ER_PREFIX_MUST_RESOLVE,
- "Le pr\u00E9fixe doit produire un espace de noms : {0}"},
-
- { ER_PARSE_NOT_SUPPORTED,
- "analyse (source InputSource) non prise en charge dans XPathContext. Impossible d''ouvrir {0}"},
-
- { ER_SAX_API_NOT_HANDLED,
- "Caract\u00E8res (char ch[]...) de l'API SAX non pris en charge par le DTM."},
-
- { ER_IGNORABLE_WHITESPACE_NOT_HANDLED,
- "ignorableWhitespace(char ch[]... non pris en charge par le DTM."},
-
- { ER_DTM_CANNOT_HANDLE_NODES,
- "DTMLiaison ne prend pas en charge les noeuds de type {0}"},
-
- { ER_XERCES_CANNOT_HANDLE_NODES,
- "DOM2Helper ne prend pas en charge les noeuds de type {0}"},
-
- { ER_XERCES_PARSE_ERROR_DETAILS,
- "Erreur de DOM2Helper.parse : SystemID - {0} ligne - {1}"},
-
- { ER_XERCES_PARSE_ERROR,
- "Erreur de DOM2Helper.parse"},
-
- { ER_INVALID_UTF16_SURROGATE,
- "Substitut UTF-16 non valide d\u00E9tect\u00E9 : {0} ?"},
-
- { ER_OIERROR,
- "Erreur d'E/S"},
-
- { ER_CANNOT_CREATE_URL,
- "Impossible de cr\u00E9er une URL pour : {0}"},
-
- { ER_XPATH_READOBJECT,
- "Dans XPath.readObject : {0}"},
-
- { ER_FUNCTION_TOKEN_NOT_FOUND,
- "jeton de fonction introuvable."},
-
- { ER_CANNOT_DEAL_XPATH_TYPE,
- "Impossible de traiter le type XPath : {0}"},
-
- { ER_NODESET_NOT_MUTABLE,
- "NodeSet non mutable"},
-
- { ER_NODESETDTM_NOT_MUTABLE,
- "NodeSetDTM non mutable"},
-
- { ER_VAR_NOT_RESOLVABLE,
- "Impossible de r\u00E9soudre la variable : {0}"},
-
- { ER_NULL_ERROR_HANDLER,
- "Gestionnaire d'erreurs NULL"},
-
- { ER_PROG_ASSERT_UNKNOWN_OPCODE,
- "Assertion de programmeur : code d''op\u00E9ration inconnu : {0}"},
-
- { ER_ZERO_OR_ONE,
- "0 ou 1"},
-
- { ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "rtf() non pris en charge par XRTreeFragSelectWrapper"},
-
- { ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "asNodeIterator() non pris en charge par XRTreeFragSelectWrapper"},
-
- /** detach() not supported by XRTreeFragSelectWrapper */
- { ER_DETACH_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "detach() non pris en charge par XRTreeFragSelectWrapper"},
-
- /** num() not supported by XRTreeFragSelectWrapper */
- { ER_NUM_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "num() non pris en charge par XRTreeFragSelectWrapper"},
-
- /** xstr() not supported by XRTreeFragSelectWrapper */
- { ER_XSTR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "xstr() non pris en charge par XRTreeFragSelectWrapper"},
-
- /** str() not supported by XRTreeFragSelectWrapper */
- { ER_STR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "str() non pris en charge par XRTreeFragSelectWrapper"},
-
- { ER_FSB_NOT_SUPPORTED_XSTRINGFORCHARS,
- "fsb() non pris en charge pour XStringForChars"},
-
- { ER_COULD_NOT_FIND_VAR,
- "Impossible de trouver la variable portant le nom {0}"},
-
- { ER_XSTRINGFORCHARS_CANNOT_TAKE_STRING,
- "XStringForChars n'accepte pas de cha\u00EEne comme argument"},
-
- { ER_FASTSTRINGBUFFER_CANNOT_BE_NULL,
- "L'argument FastStringBuffer ne doit pas \u00EAtre NULL"},
-
- { ER_TWO_OR_THREE,
- "2 ou 3"},
-
- { ER_VARIABLE_ACCESSED_BEFORE_BIND,
- "L'acc\u00E8s \u00E0 la variable a pr\u00E9c\u00E9d\u00E9 la liaison de celle-ci."},
-
- { ER_FSB_CANNOT_TAKE_STRING,
- "XStringForFSB n'accepte pas de cha\u00EEne comme argument."},
-
- { ER_SETTING_WALKER_ROOT_TO_NULL,
- "\n Erreur. D\u00E9finition de la racine d'un composant d'exploration sur NULL."},
-
- { ER_NODESETDTM_CANNOT_ITERATE,
- "Ce NodeSetDTM ne permet pas d'it\u00E9ration vers un noeud pr\u00E9c\u00E9dent."},
-
- { ER_NODESET_CANNOT_ITERATE,
- "Ce NodeSet ne permet pas d'it\u00E9ration vers un noeud pr\u00E9c\u00E9dent."},
-
- { ER_NODESETDTM_CANNOT_INDEX,
- "Ce NodeSetDTM ne peut pas utiliser de fonctions d'indexation ou de d\u00E9compte."},
-
- { ER_NODESET_CANNOT_INDEX,
- "Ce NodeSet ne peut pas utiliser de fonctions d'indexation ou de d\u00E9compte."},
-
- { ER_CANNOT_CALL_SETSHOULDCACHENODE,
- "Impossible d'appeler setShouldCacheNodes apr\u00E8s nextNode."},
-
- { ER_ONLY_ALLOWS,
- "{0} accepte uniquement {1} arguments"},
-
- { ER_UNKNOWN_STEP,
- "Assertion du programmeur dans getNextStepPos : stepType inconnu : {0}"},
-
- //Note to translators: A relative location path is a form of XPath expression.
- // The message indicates that such an expression was expected following the
- // characters '/' or '//', but was not found.
- { ER_EXPECTED_REL_LOC_PATH,
- "Un chemin d'acc\u00E8s relatif \u00E9tait attendu apr\u00E8s le jeton '/' ou '//'."},
-
- // Note to translators: A location path is a form of XPath expression.
- // The message indicates that syntactically such an expression was expected,but
- // the characters specified by the substitution text were encountered instead.
- { ER_EXPECTED_LOC_PATH,
- "Un chemin d''acc\u00E8s \u00E9tait attendu, mais le jeton suivant a \u00E9t\u00E9 d\u00E9tect\u00E9 : {0}"},
-
- // Note to translators: A location path is a form of XPath expression.
- // The message indicates that syntactically such a subexpression was expected,
- // but no more characters were found in the expression.
- { ER_EXPECTED_LOC_PATH_AT_END_EXPR,
- "Un chemin d'acc\u00E8s \u00E9tait attendu, mais la fin de l'expression XPath a \u00E9t\u00E9 d\u00E9tect\u00E9e \u00E0 la place."},
-
- // Note to translators: A location step is part of an XPath expression.
- // The message indicates that syntactically such an expression was expected
- // following the specified characters.
- { ER_EXPECTED_LOC_STEP,
- "Une \u00E9tape d'emplacement \u00E9tait attendue apr\u00E8s le jeton '/' ou '//'."},
-
- // Note to translators: A node test is part of an XPath expression that is
- // used to test for particular kinds of nodes. In this case, a node test that
- // consists of an NCName followed by a colon and an asterisk or that consists
- // of a QName was expected, but was not found.
- { ER_EXPECTED_NODE_TEST,
- "Un test de noeud correspondant \u00E0 NCName:* ou QName \u00E9tait attendu."},
-
- // Note to translators: A step pattern is part of an XPath expression.
- // The message indicates that syntactically such an expression was expected,
- // but the specified character was found in the expression instead.
- { ER_EXPECTED_STEP_PATTERN,
- "Un mod\u00E8le d'\u00E9tape \u00E9tait attendu, mais '/' a \u00E9t\u00E9 d\u00E9tect\u00E9."},
-
- // Note to translators: A relative path pattern is part of an XPath expression.
- // The message indicates that syntactically such an expression was expected,
- // but was not found.
- { ER_EXPECTED_REL_PATH_PATTERN,
- "Un mod\u00E8le de chemin relatif \u00E9tait attendu."},
-
- // Note to translators: The substitution text is the name of a data type. The
- // message indicates that a value of a particular type could not be converted
- // to a value of type boolean.
- { ER_CANT_CONVERT_TO_BOOLEAN,
- "L''\u00E9l\u00E9ment XPathResult de l''expression XPath ''{0}'' comporte un \u00E9l\u00E9ment XPathResultType de {1} qui ne peut pas \u00EAtre converti en valeur bool\u00E9enne."},
-
- // Note to translators: Do not translate ANY_UNORDERED_NODE_TYPE and
- // FIRST_ORDERED_NODE_TYPE.
- { ER_CANT_CONVERT_TO_SINGLENODE,
- "L''\u00E9l\u00E9ment XPathResult de l''expression XPath ''{0}'' comporte un \u00E9l\u00E9ment XPathResultType de {1} qui ne peut pas \u00EAtre converti en noeud unique. La m\u00E9thode getSingleNodeValue est applicable uniquement aux types ANY_UNORDERED_NODE_TYPE et FIRST_ORDERED_NODE_TYPE."},
-
- // Note to translators: Do not translate UNORDERED_NODE_SNAPSHOT_TYPE and
- // ORDERED_NODE_SNAPSHOT_TYPE.
- { ER_CANT_GET_SNAPSHOT_LENGTH,
- "La m\u00E9thode getSnapshotLength ne peut pas \u00EAtre appel\u00E9e sur l''\u00E9l\u00E9ment XPathResult de l''expression XPath ''{0}'' car son \u00E9l\u00E9ment XPathResultType est {1}. Cette m\u00E9thode est applicable uniquement aux types UNORDERED_NODE_SNAPSHOT_TYPE et ORDERED_NODE_SNAPSHOT_TYPE."},
-
- { ER_NON_ITERATOR_TYPE,
- "La m\u00E9thode iterateNext ne peut pas \u00EAtre appel\u00E9e sur l''\u00E9l\u00E9ment XPathResult de l''expression XPath ''{0}'' car son \u00E9l\u00E9ment XPathResultType est {1}. Cette m\u00E9thode est applicable uniquement aux types UNORDERED_NODE_ITERATOR_TYPE et ORDERED_NODE_ITERATOR_TYPE."},
-
- // Note to translators: This message indicates that the document being operated
- // upon changed, so the iterator object that was being used to traverse the
- // document has now become invalid.
- { ER_DOC_MUTATED,
- "Mutation du document suite au renvoi du r\u00E9sultat. L'it\u00E9rateur est incorrect."},
-
- { ER_INVALID_XPATH_TYPE,
- "Argument de type XPath incorrect : {0}"},
-
- { ER_EMPTY_XPATH_RESULT,
- "Objet de r\u00E9sultat XPath vide"},
-
- { ER_INCOMPATIBLE_TYPES,
- "L''\u00E9l\u00E9ment XPathResult de l''expression XPath ''{0}'' comporte un \u00E9l\u00E9ment XPathResultType de {1} qui ne peut pas \u00EAtre forc\u00E9 dans l''\u00E9l\u00E9ment XPathResultType de {2} indiqu\u00E9."},
-
- { ER_NULL_RESOLVER,
- "Impossible de r\u00E9soudre le pr\u00E9fixe avec un r\u00E9solveur de pr\u00E9fixe NULL."},
-
- // Note to translators: The substitution text is the name of a data type. The
- // message indicates that a value of a particular type could not be converted
- // to a value of type string.
- { ER_CANT_CONVERT_TO_STRING,
- "L''\u00E9l\u00E9ment XPathResult de l''expression XPath ''{0}'' comporte un \u00E9l\u00E9ment XPathResultType de {1} qui ne peut pas \u00EAtre converti en cha\u00EEne."},
-
- // Note to translators: Do not translate snapshotItem,
- // UNORDERED_NODE_SNAPSHOT_TYPE and ORDERED_NODE_SNAPSHOT_TYPE.
- { ER_NON_SNAPSHOT_TYPE,
- "La m\u00E9thode snapshotItem ne peut pas \u00EAtre appel\u00E9e sur l''\u00E9l\u00E9ment XPathResult de l''expression XPath ''{0}'' car son \u00E9l\u00E9ment XPathResultType est {1}. Cette m\u00E9thode est applicable uniquement aux types UNORDERED_NODE_SNAPSHOT_TYPE et ORDERED_NODE_SNAPSHOT_TYPE."},
-
- // Note to translators: XPathEvaluator is a Java interface name. An
- // XPathEvaluator is created with respect to a particular XML document, and in
- // this case the expression represented by this object was being evaluated with
- // respect to a context node from a different document.
- { ER_WRONG_DOCUMENT,
- "Le noeud de contexte n'appartient pas au document li\u00E9 \u00E0 ce XPathEvaluator."},
-
- // Note to translators: The XPath expression cannot be evaluated with respect
- // to this type of node.
- { ER_WRONG_NODETYPE,
- "Le type de noeud de contexte n'est pas pris en charge."},
-
- { ER_XPATH_ERROR,
- "Erreur inconnue d\u00E9tect\u00E9e dans XPath."},
-
- { ER_CANT_CONVERT_XPATHRESULTTYPE_TO_NUMBER,
- "L''\u00E9l\u00E9ment XPathResult de l''expression XPath ''{0}'' comporte un \u00E9l\u00E9ment XPathResultType de {1} qui ne peut pas \u00EAtre converti en nombre"},
-
- //BEGIN: Definitions of error keys used in exception messages of JAXP 1.3 XPath API implementation
-
- /** Field ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED */
-
- { ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED,
- "La fonction d''extension ''{0}'' ne peut pas \u00EAtre appel\u00E9e lorsque la fonctionnalit\u00E9 XMLConstants.FEATURE_SECURE_PROCESSING est d\u00E9finie sur True."},
-
- /** Field ER_RESOLVE_VARIABLE_RETURNS_NULL */
-
- { ER_RESOLVE_VARIABLE_RETURNS_NULL,
- "resolveVariable pour la variable {0} renvoie la valeur NULL"},
-
- /** Field ER_UNSUPPORTED_RETURN_TYPE */
-
- { ER_UNSUPPORTED_RETURN_TYPE,
- "Type de retour non pris en charge : {0}"},
-
- /** Field ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL */
-
- { ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL,
- "Le type de source et/ou de retour ne peut pas \u00EAtre NULL"},
-
- /** Field ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL */
-
- { ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL,
- "Le type de source et/ou de retour ne peut pas \u00EAtre NULL"},
-
- /** Field ER_ARG_CANNOT_BE_NULL */
-
- { ER_ARG_CANNOT_BE_NULL,
- "L''argument {0} ne doit pas \u00EAtre NULL"},
-
- /** Field ER_OBJECT_MODEL_NULL */
-
- { ER_OBJECT_MODEL_NULL,
- "{0}#isObjectModelSupported(String objectModel) ne peut pas \u00EAtre appel\u00E9 avec objectModel == null"},
-
- /** Field ER_OBJECT_MODEL_EMPTY */
-
- { ER_OBJECT_MODEL_EMPTY,
- "{0}#isObjectModelSupported(String objectModel) ne peut pas \u00EAtre appel\u00E9 avec objectModel == \"\""},
-
- /** Field ER_OBJECT_MODEL_EMPTY */
-
- { ER_FEATURE_NAME_NULL,
- "Tentative de d\u00E9finition d''une fonctionnalit\u00E9 portant un nom NULL : {0}#setFeature(null, {1})"},
-
- /** Field ER_FEATURE_UNKNOWN */
-
- { ER_FEATURE_UNKNOWN,
- "Tentative de d\u00E9finition de la fonctionnalit\u00E9 inconnue \"{0}\" : {1}#setFeature({0},{2})"},
-
- /** Field ER_GETTING_NULL_FEATURE */
-
- { ER_GETTING_NULL_FEATURE,
- "Tentative d''obtention d''une fonctionnalit\u00E9 portant un nom NULL : {0}#getFeature(null)"},
-
- /** Field ER_GETTING_NULL_FEATURE */
-
- { ER_GETTING_UNKNOWN_FEATURE,
- "Tentative d''obtention de la fonctionnalit\u00E9 inconnue \"{0}\" : {1}#getFeature({0})"},
-
- {ER_SECUREPROCESSING_FEATURE,
- "FEATURE_SECURE_PROCESSING : impossible de d\u00E9finir la fonctionnalit\u00E9 sur False en pr\u00E9sence du gestionnaire de s\u00E9curit\u00E9 : {1}#setFeature({0},{2})"},
-
- /** Field ER_NULL_XPATH_FUNCTION_RESOLVER */
-
- { ER_NULL_XPATH_FUNCTION_RESOLVER,
- "Tentative de d\u00E9finition d''un \u00E9l\u00E9ment XPathFunctionResolver NULL : {0}#setXPathFunctionResolver(null)"},
-
- /** Field ER_NULL_XPATH_VARIABLE_RESOLVER */
-
- { ER_NULL_XPATH_VARIABLE_RESOLVER,
- "Tentative de d\u00E9finition d''un \u00E9l\u00E9ment XPathVariableResolver NULL : {0}#setXPathVariableResolver(null)"},
-
- //END: Definitions of error keys used in exception messages of JAXP 1.3 XPath API implementation
-
- // Warnings...
-
- { WG_LOCALE_NAME_NOT_HANDLED,
- "le nom d'environnement local de la fonction format-number n'est pas encore pris en charge."},
-
- { WG_PROPERTY_NOT_SUPPORTED,
- "Propri\u00E9t\u00E9 XSL non prise en charge : {0}"},
-
- { WG_DONT_DO_ANYTHING_WITH_NS,
- "Espace de noms {0} inexploitable dans la propri\u00E9t\u00E9 : {1}"},
-
- { WG_SECURITY_EXCEPTION,
- "Exception SecurityException g\u00E9n\u00E9r\u00E9e lors de la tentative d''acc\u00E8s \u00E0 la propri\u00E9t\u00E9 syst\u00E8me XSL : {0}"},
-
- { WG_QUO_NO_LONGER_DEFINED,
- "L'ancienne syntaxe quo(...) n'est plus d\u00E9finie dans XPath."},
-
- { WG_NEED_DERIVED_OBJECT_TO_IMPLEMENT_NODETEST,
- "XPath requiert un objet d\u00E9riv\u00E9 pour impl\u00E9menter nodeTest."},
-
- { WG_FUNCTION_TOKEN_NOT_FOUND,
- "jeton de fonction introuvable."},
-
- { WG_COULDNOT_FIND_FUNCTION,
- "Impossible de trouver la fonction : {0}"},
-
- { WG_CANNOT_MAKE_URL_FROM,
- "Impossible de cr\u00E9er l''URL \u00E0 partir de : {0}"},
-
- { WG_EXPAND_ENTITIES_NOT_SUPPORTED,
- "L'option -E n'est pas prise en charge pour l'analyseur DTM"},
-
- { WG_ILLEGAL_VARIABLE_REFERENCE,
- "L''\u00E9l\u00E9ment VariableReference indiqu\u00E9 pour la variable est hors contexte ou sans d\u00E9finition. Nom = {0}"},
-
- { WG_UNSUPPORTED_ENCODING,
- "Encodage non pris en charge : {0}"},
-
-
-
- // Other miscellaneous text used inside the code...
- { "ui_language", "fr"},
- { "help_language", "fr"},
- { "language", "fr"},
- { "BAD_CODE", "Le param\u00E8tre de createMessage est hors limites"},
- { "FORMAT_FAILED", "Exception g\u00E9n\u00E9r\u00E9e lors de l'appel de messageFormat"},
- { "version", ">>>>>>> Version de Xalan "},
- { "version2", "<<<<<<<"},
- { "yes", "oui"},
- { "line", "Ligne n\u00B0"},
- { "column", "Colonne n\u00B0"},
- { "xsldone", "XSLProcessor : termin\u00E9"},
- { "xpath_option", "options xpath : "},
- { "optionIN", " [-in inputXMLURL]"},
- { "optionSelect", " [-select xpath expression]"},
- { "optionMatch", " [-match match pattern (pour les diagnostics de correspondance)]"},
- { "optionAnyExpr", "Ou seulement une expression XPath g\u00E9n\u00E9rera un fichier dump de diagnostic"},
- { "noParsermsg1", "Echec du processus XSL."},
- { "noParsermsg2", "** Analyseur introuvable **"},
- { "noParsermsg3", "V\u00E9rifiez votre variable d'environnement CLASSPATH."},
- { "noParsermsg4", "Si vous ne disposez pas de l'analyseur XML pour Java d'IBM, vous pouvez le t\u00E9l\u00E9charger sur le site"},
- { "noParsermsg5", "AlphaWorks d'IBM : http://www.alphaworks.ibm.com/formula/xml"},
- { "gtone", ">1" },
- { "zero", "0" },
- { "one", "1" },
- { "two" , "2" },
- { "three", "3" }
-
- };
-
- /**
- * Get the association list.
- *
- * @return The association list.
- */
- public Object[][] getContents()
- {
- return _contents;
- }
-
-
- // ================= INFRASTRUCTURE ======================
-
- /** Field BAD_CODE */
- public static final String BAD_CODE = "BAD_CODE";
-
- /** Field FORMAT_FAILED */
- public static final String FORMAT_FAILED = "FORMAT_FAILED";
-
- /** Field ERROR_RESOURCES */
- public static final String ERROR_RESOURCES =
- "com.sun.org.apache.xpath.internal.res.XPATHErrorResources";
-
- /** Field ERROR_STRING */
- public static final String ERROR_STRING = "#error";
-
- /** Field ERROR_HEADER */
- public static final String ERROR_HEADER = "Error: ";
-
- /** Field WARNING_HEADER */
- public static final String WARNING_HEADER = "Warning: ";
-
- /** Field XSL_HEADER */
- public static final String XSL_HEADER = "XSL ";
-
- /** Field XML_HEADER */
- public static final String XML_HEADER = "XML ";
-
- /** Field QUERY_HEADER */
- public static final String QUERY_HEADER = "PATTERN ";
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_it.java b/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_it.java
deleted file mode 100644
index 2f27ddb..0000000
--- a/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_it.java
+++ /dev/null
@@ -1,936 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xpath.internal.res;
-
-import java.util.ListResourceBundle;
-
-/**
- * Set up error messages.
- * We build a two dimensional array of message keys and
- * message strings. In order to add a new message here,
- * you need to first add a Static string constant for the
- * Key and update the contents array with Key, Value pair
- * Also you need to update the count of messages(MAX_CODE)or
- * the count of warnings(MAX_WARNING) [ Information purpose only]
- * @xsl.usage advanced
- */
-public class XPATHErrorResources_it extends ListResourceBundle
-{
-
-/*
- * General notes to translators:
- *
- * This file contains error and warning messages related to XPath Error
- * Handling.
- *
- * 1) Xalan (or more properly, Xalan-interpretive) and XSLTC are names of
- * components.
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- * XSLTC is an acronym for XSLT Compiler.
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 5) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 6) "Translet" is an invented term that describes the class file that
- * results from compiling an XML stylesheet into a Java class.
- *
- * 7) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- * 8) The context node is the node in the document with respect to which an
- * XPath expression is being evaluated.
- *
- * 9) An iterator is an object that traverses nodes in the tree, one at a time.
- *
- * 10) NCName is an XML term used to describe a name that does not contain a
- * colon (a "no-colon name").
- *
- * 11) QName is an XML term meaning "qualified name".
- */
-
- /*
- * static variables
- */
- public static final String ERROR0000 = "ERROR0000";
- public static final String ER_CURRENT_NOT_ALLOWED_IN_MATCH =
- "ER_CURRENT_NOT_ALLOWED_IN_MATCH";
- public static final String ER_CURRENT_TAKES_NO_ARGS =
- "ER_CURRENT_TAKES_NO_ARGS";
- public static final String ER_DOCUMENT_REPLACED = "ER_DOCUMENT_REPLACED";
- public static final String ER_CONTEXT_HAS_NO_OWNERDOC =
- "ER_CONTEXT_HAS_NO_OWNERDOC";
- public static final String ER_LOCALNAME_HAS_TOO_MANY_ARGS =
- "ER_LOCALNAME_HAS_TOO_MANY_ARGS";
- public static final String ER_NAMESPACEURI_HAS_TOO_MANY_ARGS =
- "ER_NAMESPACEURI_HAS_TOO_MANY_ARGS";
- public static final String ER_NORMALIZESPACE_HAS_TOO_MANY_ARGS =
- "ER_NORMALIZESPACE_HAS_TOO_MANY_ARGS";
- public static final String ER_NUMBER_HAS_TOO_MANY_ARGS =
- "ER_NUMBER_HAS_TOO_MANY_ARGS";
- public static final String ER_NAME_HAS_TOO_MANY_ARGS =
- "ER_NAME_HAS_TOO_MANY_ARGS";
- public static final String ER_STRING_HAS_TOO_MANY_ARGS =
- "ER_STRING_HAS_TOO_MANY_ARGS";
- public static final String ER_STRINGLENGTH_HAS_TOO_MANY_ARGS =
- "ER_STRINGLENGTH_HAS_TOO_MANY_ARGS";
- public static final String ER_TRANSLATE_TAKES_3_ARGS =
- "ER_TRANSLATE_TAKES_3_ARGS";
- public static final String ER_UNPARSEDENTITYURI_TAKES_1_ARG =
- "ER_UNPARSEDENTITYURI_TAKES_1_ARG";
- public static final String ER_NAMESPACEAXIS_NOT_IMPLEMENTED =
- "ER_NAMESPACEAXIS_NOT_IMPLEMENTED";
- public static final String ER_UNKNOWN_AXIS = "ER_UNKNOWN_AXIS";
- public static final String ER_UNKNOWN_MATCH_OPERATION =
- "ER_UNKNOWN_MATCH_OPERATION";
- public static final String ER_INCORRECT_ARG_LENGTH ="ER_INCORRECT_ARG_LENGTH";
- public static final String ER_CANT_CONVERT_TO_NUMBER =
- "ER_CANT_CONVERT_TO_NUMBER";
- public static final String ER_CANT_CONVERT_XPATHRESULTTYPE_TO_NUMBER =
- "ER_CANT_CONVERT_XPATHRESULTTYPE_TO_NUMBER";
- public static final String ER_CANT_CONVERT_TO_NODELIST =
- "ER_CANT_CONVERT_TO_NODELIST";
- public static final String ER_CANT_CONVERT_TO_MUTABLENODELIST =
- "ER_CANT_CONVERT_TO_MUTABLENODELIST";
- public static final String ER_CANT_CONVERT_TO_TYPE ="ER_CANT_CONVERT_TO_TYPE";
- public static final String ER_EXPECTED_MATCH_PATTERN =
- "ER_EXPECTED_MATCH_PATTERN";
- public static final String ER_COULDNOT_GET_VAR_NAMED =
- "ER_COULDNOT_GET_VAR_NAMED";
- public static final String ER_UNKNOWN_OPCODE = "ER_UNKNOWN_OPCODE";
- public static final String ER_EXTRA_ILLEGAL_TOKENS ="ER_EXTRA_ILLEGAL_TOKENS";
- public static final String ER_EXPECTED_DOUBLE_QUOTE =
- "ER_EXPECTED_DOUBLE_QUOTE";
- public static final String ER_EXPECTED_SINGLE_QUOTE =
- "ER_EXPECTED_SINGLE_QUOTE";
- public static final String ER_EMPTY_EXPRESSION = "ER_EMPTY_EXPRESSION";
- public static final String ER_EXPECTED_BUT_FOUND = "ER_EXPECTED_BUT_FOUND";
- public static final String ER_INCORRECT_PROGRAMMER_ASSERTION =
- "ER_INCORRECT_PROGRAMMER_ASSERTION";
- public static final String ER_BOOLEAN_ARG_NO_LONGER_OPTIONAL =
- "ER_BOOLEAN_ARG_NO_LONGER_OPTIONAL";
- public static final String ER_FOUND_COMMA_BUT_NO_PRECEDING_ARG =
- "ER_FOUND_COMMA_BUT_NO_PRECEDING_ARG";
- public static final String ER_FOUND_COMMA_BUT_NO_FOLLOWING_ARG =
- "ER_FOUND_COMMA_BUT_NO_FOLLOWING_ARG";
- public static final String ER_PREDICATE_ILLEGAL_SYNTAX =
- "ER_PREDICATE_ILLEGAL_SYNTAX";
- public static final String ER_ILLEGAL_AXIS_NAME = "ER_ILLEGAL_AXIS_NAME";
- public static final String ER_UNKNOWN_NODETYPE = "ER_UNKNOWN_NODETYPE";
- public static final String ER_PATTERN_LITERAL_NEEDS_BE_QUOTED =
- "ER_PATTERN_LITERAL_NEEDS_BE_QUOTED";
- public static final String ER_COULDNOT_BE_FORMATTED_TO_NUMBER =
- "ER_COULDNOT_BE_FORMATTED_TO_NUMBER";
- public static final String ER_COULDNOT_CREATE_XMLPROCESSORLIAISON =
- "ER_COULDNOT_CREATE_XMLPROCESSORLIAISON";
- public static final String ER_DIDNOT_FIND_XPATH_SELECT_EXP =
- "ER_DIDNOT_FIND_XPATH_SELECT_EXP";
- public static final String ER_COULDNOT_FIND_ENDOP_AFTER_OPLOCATIONPATH =
- "ER_COULDNOT_FIND_ENDOP_AFTER_OPLOCATIONPATH";
- public static final String ER_ERROR_OCCURED = "ER_ERROR_OCCURED";
- public static final String ER_ILLEGAL_VARIABLE_REFERENCE =
- "ER_ILLEGAL_VARIABLE_REFERENCE";
- public static final String ER_AXES_NOT_ALLOWED = "ER_AXES_NOT_ALLOWED";
- public static final String ER_KEY_HAS_TOO_MANY_ARGS =
- "ER_KEY_HAS_TOO_MANY_ARGS";
- public static final String ER_COUNT_TAKES_1_ARG = "ER_COUNT_TAKES_1_ARG";
- public static final String ER_COULDNOT_FIND_FUNCTION =
- "ER_COULDNOT_FIND_FUNCTION";
- public static final String ER_UNSUPPORTED_ENCODING ="ER_UNSUPPORTED_ENCODING";
- public static final String ER_PROBLEM_IN_DTM_NEXTSIBLING =
- "ER_PROBLEM_IN_DTM_NEXTSIBLING";
- public static final String ER_CANNOT_WRITE_TO_EMPTYNODELISTIMPL =
- "ER_CANNOT_WRITE_TO_EMPTYNODELISTIMPL";
- public static final String ER_SETDOMFACTORY_NOT_SUPPORTED =
- "ER_SETDOMFACTORY_NOT_SUPPORTED";
- public static final String ER_PREFIX_MUST_RESOLVE = "ER_PREFIX_MUST_RESOLVE";
- public static final String ER_PARSE_NOT_SUPPORTED = "ER_PARSE_NOT_SUPPORTED";
- public static final String ER_SAX_API_NOT_HANDLED = "ER_SAX_API_NOT_HANDLED";
-public static final String ER_IGNORABLE_WHITESPACE_NOT_HANDLED =
- "ER_IGNORABLE_WHITESPACE_NOT_HANDLED";
- public static final String ER_DTM_CANNOT_HANDLE_NODES =
- "ER_DTM_CANNOT_HANDLE_NODES";
- public static final String ER_XERCES_CANNOT_HANDLE_NODES =
- "ER_XERCES_CANNOT_HANDLE_NODES";
- public static final String ER_XERCES_PARSE_ERROR_DETAILS =
- "ER_XERCES_PARSE_ERROR_DETAILS";
- public static final String ER_XERCES_PARSE_ERROR = "ER_XERCES_PARSE_ERROR";
- public static final String ER_INVALID_UTF16_SURROGATE =
- "ER_INVALID_UTF16_SURROGATE";
- public static final String ER_OIERROR = "ER_OIERROR";
- public static final String ER_CANNOT_CREATE_URL = "ER_CANNOT_CREATE_URL";
- public static final String ER_XPATH_READOBJECT = "ER_XPATH_READOBJECT";
- public static final String ER_FUNCTION_TOKEN_NOT_FOUND =
- "ER_FUNCTION_TOKEN_NOT_FOUND";
- public static final String ER_CANNOT_DEAL_XPATH_TYPE =
- "ER_CANNOT_DEAL_XPATH_TYPE";
- public static final String ER_NODESET_NOT_MUTABLE = "ER_NODESET_NOT_MUTABLE";
- public static final String ER_NODESETDTM_NOT_MUTABLE =
- "ER_NODESETDTM_NOT_MUTABLE";
- /** Variable not resolvable: */
- public static final String ER_VAR_NOT_RESOLVABLE = "ER_VAR_NOT_RESOLVABLE";
- /** Null error handler */
- public static final String ER_NULL_ERROR_HANDLER = "ER_NULL_ERROR_HANDLER";
- /** Programmer's assertion: unknown opcode */
- public static final String ER_PROG_ASSERT_UNKNOWN_OPCODE =
- "ER_PROG_ASSERT_UNKNOWN_OPCODE";
- /** 0 or 1 */
- public static final String ER_ZERO_OR_ONE = "ER_ZERO_OR_ONE";
- /** rtf() not supported by XRTreeFragSelectWrapper */
- public static final String ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** asNodeIterator() not supported by XRTreeFragSelectWrapper */
- public static final String ER_ASNODEITERATOR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER = "ER_ASNODEITERATOR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** fsb() not supported for XStringForChars */
- public static final String ER_FSB_NOT_SUPPORTED_XSTRINGFORCHARS =
- "ER_FSB_NOT_SUPPORTED_XSTRINGFORCHARS";
- /** Could not find variable with the name of */
- public static final String ER_COULD_NOT_FIND_VAR = "ER_COULD_NOT_FIND_VAR";
- /** XStringForChars can not take a string for an argument */
- public static final String ER_XSTRINGFORCHARS_CANNOT_TAKE_STRING =
- "ER_XSTRINGFORCHARS_CANNOT_TAKE_STRING";
- /** The FastStringBuffer argument can not be null */
- public static final String ER_FASTSTRINGBUFFER_CANNOT_BE_NULL =
- "ER_FASTSTRINGBUFFER_CANNOT_BE_NULL";
- /** 2 or 3 */
- public static final String ER_TWO_OR_THREE = "ER_TWO_OR_THREE";
- /** Variable accessed before it is bound! */
- public static final String ER_VARIABLE_ACCESSED_BEFORE_BIND =
- "ER_VARIABLE_ACCESSED_BEFORE_BIND";
- /** XStringForFSB can not take a string for an argument! */
- public static final String ER_FSB_CANNOT_TAKE_STRING =
- "ER_FSB_CANNOT_TAKE_STRING";
- /** Error! Setting the root of a walker to null! */
- public static final String ER_SETTING_WALKER_ROOT_TO_NULL =
- "ER_SETTING_WALKER_ROOT_TO_NULL";
- /** This NodeSetDTM can not iterate to a previous node! */
- public static final String ER_NODESETDTM_CANNOT_ITERATE =
- "ER_NODESETDTM_CANNOT_ITERATE";
- /** This NodeSet can not iterate to a previous node! */
- public static final String ER_NODESET_CANNOT_ITERATE =
- "ER_NODESET_CANNOT_ITERATE";
- /** This NodeSetDTM can not do indexing or counting functions! */
- public static final String ER_NODESETDTM_CANNOT_INDEX =
- "ER_NODESETDTM_CANNOT_INDEX";
- /** This NodeSet can not do indexing or counting functions! */
- public static final String ER_NODESET_CANNOT_INDEX =
- "ER_NODESET_CANNOT_INDEX";
- /** Can not call setShouldCacheNodes after nextNode has been called! */
- public static final String ER_CANNOT_CALL_SETSHOULDCACHENODE =
- "ER_CANNOT_CALL_SETSHOULDCACHENODE";
- /** {0} only allows {1} arguments */
- public static final String ER_ONLY_ALLOWS = "ER_ONLY_ALLOWS";
- /** Programmer's assertion in getNextStepPos: unknown stepType: {0} */
- public static final String ER_UNKNOWN_STEP = "ER_UNKNOWN_STEP";
- /** Problem with RelativeLocationPath */
- public static final String ER_EXPECTED_REL_LOC_PATH =
- "ER_EXPECTED_REL_LOC_PATH";
- /** Problem with LocationPath */
- public static final String ER_EXPECTED_LOC_PATH = "ER_EXPECTED_LOC_PATH";
- public static final String ER_EXPECTED_LOC_PATH_AT_END_EXPR =
- "ER_EXPECTED_LOC_PATH_AT_END_EXPR";
- /** Problem with Step */
- public static final String ER_EXPECTED_LOC_STEP = "ER_EXPECTED_LOC_STEP";
- /** Problem with NodeTest */
- public static final String ER_EXPECTED_NODE_TEST = "ER_EXPECTED_NODE_TEST";
- /** Expected step pattern */
- public static final String ER_EXPECTED_STEP_PATTERN =
- "ER_EXPECTED_STEP_PATTERN";
- /** Expected relative path pattern */
- public static final String ER_EXPECTED_REL_PATH_PATTERN =
- "ER_EXPECTED_REL_PATH_PATTERN";
- /** ER_CANT_CONVERT_XPATHRESULTTYPE_TO_BOOLEAN */
- public static final String ER_CANT_CONVERT_TO_BOOLEAN =
- "ER_CANT_CONVERT_TO_BOOLEAN";
- /** Field ER_CANT_CONVERT_TO_SINGLENODE */
- public static final String ER_CANT_CONVERT_TO_SINGLENODE =
- "ER_CANT_CONVERT_TO_SINGLENODE";
- /** Field ER_CANT_GET_SNAPSHOT_LENGTH */
- public static final String ER_CANT_GET_SNAPSHOT_LENGTH =
- "ER_CANT_GET_SNAPSHOT_LENGTH";
- /** Field ER_NON_ITERATOR_TYPE */
- public static final String ER_NON_ITERATOR_TYPE = "ER_NON_ITERATOR_TYPE";
- /** Field ER_DOC_MUTATED */
- public static final String ER_DOC_MUTATED = "ER_DOC_MUTATED";
- public static final String ER_INVALID_XPATH_TYPE = "ER_INVALID_XPATH_TYPE";
- public static final String ER_EMPTY_XPATH_RESULT = "ER_EMPTY_XPATH_RESULT";
- public static final String ER_INCOMPATIBLE_TYPES = "ER_INCOMPATIBLE_TYPES";
- public static final String ER_NULL_RESOLVER = "ER_NULL_RESOLVER";
- public static final String ER_CANT_CONVERT_TO_STRING =
- "ER_CANT_CONVERT_TO_STRING";
- public static final String ER_NON_SNAPSHOT_TYPE = "ER_NON_SNAPSHOT_TYPE";
- public static final String ER_WRONG_DOCUMENT = "ER_WRONG_DOCUMENT";
- /* Note to translators: The XPath expression cannot be evaluated with respect
- * to this type of node.
- */
- /** Field ER_WRONG_NODETYPE */
- public static final String ER_WRONG_NODETYPE = "ER_WRONG_NODETYPE";
- public static final String ER_XPATH_ERROR = "ER_XPATH_ERROR";
-
- //BEGIN: Keys needed for exception messages of JAXP 1.3 XPath API implementation
- public static final String ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED = "ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED";
- public static final String ER_RESOLVE_VARIABLE_RETURNS_NULL = "ER_RESOLVE_VARIABLE_RETURNS_NULL";
- public static final String ER_UNSUPPORTED_RETURN_TYPE = "ER_UNSUPPORTED_RETURN_TYPE";
- public static final String ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL = "ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL";
- public static final String ER_ARG_CANNOT_BE_NULL = "ER_ARG_CANNOT_BE_NULL";
-
- public static final String ER_OBJECT_MODEL_NULL = "ER_OBJECT_MODEL_NULL";
- public static final String ER_OBJECT_MODEL_EMPTY = "ER_OBJECT_MODEL_EMPTY";
- public static final String ER_FEATURE_NAME_NULL = "ER_FEATURE_NAME_NULL";
- public static final String ER_FEATURE_UNKNOWN = "ER_FEATURE_UNKNOWN";
- public static final String ER_GETTING_NULL_FEATURE = "ER_GETTING_NULL_FEATURE";
- public static final String ER_GETTING_UNKNOWN_FEATURE = "ER_GETTING_UNKNOWN_FEATURE";
- public static final String ER_SECUREPROCESSING_FEATURE = "ER_SECUREPROCESSING_FEATURE";
- public static final String ER_NULL_XPATH_FUNCTION_RESOLVER = "ER_NULL_XPATH_FUNCTION_RESOLVER";
- public static final String ER_NULL_XPATH_VARIABLE_RESOLVER = "ER_NULL_XPATH_VARIABLE_RESOLVER";
- //END: Keys needed for exception messages of JAXP 1.3 XPath API implementation
-
- public static final String WG_LOCALE_NAME_NOT_HANDLED =
- "WG_LOCALE_NAME_NOT_HANDLED";
- public static final String WG_PROPERTY_NOT_SUPPORTED =
- "WG_PROPERTY_NOT_SUPPORTED";
- public static final String WG_DONT_DO_ANYTHING_WITH_NS =
- "WG_DONT_DO_ANYTHING_WITH_NS";
- public static final String WG_SECURITY_EXCEPTION = "WG_SECURITY_EXCEPTION";
- public static final String WG_QUO_NO_LONGER_DEFINED =
- "WG_QUO_NO_LONGER_DEFINED";
- public static final String WG_NEED_DERIVED_OBJECT_TO_IMPLEMENT_NODETEST =
- "WG_NEED_DERIVED_OBJECT_TO_IMPLEMENT_NODETEST";
- public static final String WG_FUNCTION_TOKEN_NOT_FOUND =
- "WG_FUNCTION_TOKEN_NOT_FOUND";
- public static final String WG_COULDNOT_FIND_FUNCTION =
- "WG_COULDNOT_FIND_FUNCTION";
- public static final String WG_CANNOT_MAKE_URL_FROM ="WG_CANNOT_MAKE_URL_FROM";
- public static final String WG_EXPAND_ENTITIES_NOT_SUPPORTED =
- "WG_EXPAND_ENTITIES_NOT_SUPPORTED";
- public static final String WG_ILLEGAL_VARIABLE_REFERENCE =
- "WG_ILLEGAL_VARIABLE_REFERENCE";
- public static final String WG_UNSUPPORTED_ENCODING ="WG_UNSUPPORTED_ENCODING";
-
- /** detach() not supported by XRTreeFragSelectWrapper */
- public static final String ER_DETACH_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_DETACH_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** num() not supported by XRTreeFragSelectWrapper */
- public static final String ER_NUM_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_NUM_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** xstr() not supported by XRTreeFragSelectWrapper */
- public static final String ER_XSTR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_XSTR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** str() not supported by XRTreeFragSelectWrapper */
- public static final String ER_STR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_STR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
-
- // Error messages...
-
- private static final Object[][] _contents = new Object[][]{
-
- { "ERROR0000" , "{0}" },
-
- { ER_CURRENT_NOT_ALLOWED_IN_MATCH, "La funzione current() non \u00E8 consentita in un pattern di corrispondenza." },
-
- { ER_CURRENT_TAKES_NO_ARGS, "La funzione current() non accetta argomenti." },
-
- { ER_DOCUMENT_REPLACED,
- "L'implementazione della funzione document() \u00E8 stata sostituita da com.sun.org.apache.xalan.internal.xslt.FuncDocument."},
-
- { ER_CONTEXT_HAS_NO_OWNERDOC,
- "il contesto non dispone di un documento proprietario."},
-
- { ER_LOCALNAME_HAS_TOO_MANY_ARGS,
- "local-name() contiene troppi argomenti."},
-
- { ER_NAMESPACEURI_HAS_TOO_MANY_ARGS,
- "namespace-uri() contiene troppi argomenti."},
-
- { ER_NORMALIZESPACE_HAS_TOO_MANY_ARGS,
- "normalize-space() contiene troppi argomenti."},
-
- { ER_NUMBER_HAS_TOO_MANY_ARGS,
- "number() contiene troppi argomenti."},
-
- { ER_NAME_HAS_TOO_MANY_ARGS,
- "name() contiene troppi argomenti."},
-
- { ER_STRING_HAS_TOO_MANY_ARGS,
- "string() contiene troppi argomenti."},
-
- { ER_STRINGLENGTH_HAS_TOO_MANY_ARGS,
- "string-length() contiene troppi argomenti."},
-
- { ER_TRANSLATE_TAKES_3_ARGS,
- "La funzione translate() ha tre argomenti."},
-
- { ER_UNPARSEDENTITYURI_TAKES_1_ARG,
- "La funzione unparsed-entity-uri deve avere un solo argomento."},
-
- { ER_NAMESPACEAXIS_NOT_IMPLEMENTED,
- "l'asse dello spazio di nomi non \u00E8 ancora implementato."},
-
- { ER_UNKNOWN_AXIS,
- "asse sconosciuto: {0}"},
-
- { ER_UNKNOWN_MATCH_OPERATION,
- "operazione di corrispondenza sconosciuta."},
-
- { ER_INCORRECT_ARG_LENGTH,
- "La lunghezza degli argomenti del testo del nodo processing-instruction() \u00E8 errata."},
-
- { ER_CANT_CONVERT_TO_NUMBER,
- "Impossibile convertire {0} in un numero"},
-
- { ER_CANT_CONVERT_TO_NODELIST,
- "Impossibile convertire {0} in NodeList."},
-
- { ER_CANT_CONVERT_TO_MUTABLENODELIST,
- "Impossibile convertire {0} in NodeSetDTM."},
-
- { ER_CANT_CONVERT_TO_TYPE,
- "Impossibile convertire {0} in type#{1}"},
-
- { ER_EXPECTED_MATCH_PATTERN,
- "\u00C8 previsto un pattern di corrispondenza in getMatchScore."},
-
- { ER_COULDNOT_GET_VAR_NAMED,
- "Impossibile recuperare la variabile denominata {0}"},
-
- { ER_UNKNOWN_OPCODE,
- "ERRORE. Codice di operazione sconosciuto: {0}"},
-
- { ER_EXTRA_ILLEGAL_TOKENS,
- "Esistono altri token non validi: {0}"},
-
- { ER_EXPECTED_DOUBLE_QUOTE,
- "valore non tra apici... sono previste le virgolette."},
-
- { ER_EXPECTED_SINGLE_QUOTE,
- "valore non tra apici... \u00E8 previsto un apice."},
-
- { ER_EMPTY_EXPRESSION,
- "Espressione vuota."},
-
- { ER_EXPECTED_BUT_FOUND,
- "Previsto {0}, trovato {1}."},
-
- { ER_INCORRECT_PROGRAMMER_ASSERTION,
- "L''asserzione del programmatore \u00E8 errata - {0}"},
-
- { ER_BOOLEAN_ARG_NO_LONGER_OPTIONAL,
- "L'argomento boolean(...) non \u00E8 pi\u00F9 facoltativo nella bozza XPath 19990709."},
-
- { ER_FOUND_COMMA_BUT_NO_PRECEDING_ARG,
- "\u00C8 stata trovata la virgola (','), ma non l'argomento che la precede."},
-
- { ER_FOUND_COMMA_BUT_NO_FOLLOWING_ARG,
- "\u00C8 stata trovata la virgola (','), ma non l'argomento che la segue."},
-
- { ER_PREDICATE_ILLEGAL_SYNTAX,
- "'..[predicate]' o '.[predicate]' \u00E8 una sintassi non valida. Utilizzare 'self::node()[predicate]'."},
-
- { ER_ILLEGAL_AXIS_NAME,
- "nome asse non valido: {0}"},
-
- { ER_UNKNOWN_NODETYPE,
- "Tipo di nodo sconosciuto: {0}"},
-
- { ER_PATTERN_LITERAL_NEEDS_BE_QUOTED,
- "Il valore del pattern ({0}) deve essere compreso tra apici."},
-
- { ER_COULDNOT_BE_FORMATTED_TO_NUMBER,
- "Impossibile formattare {0} in un numero."},
-
- { ER_COULDNOT_CREATE_XMLPROCESSORLIAISON,
- "Impossibile creare la relazione TransformerFactory XML {0}"},
-
- { ER_DIDNOT_FIND_XPATH_SELECT_EXP,
- "Errore. L'espressione di selezione dell'xpath (-select) non \u00E8 stata trovata."},
-
- { ER_COULDNOT_FIND_ENDOP_AFTER_OPLOCATIONPATH,
- "ERRORE. Impossibile trovare ENDOP dopo OP_LOCATIONPATH."},
-
- { ER_ERROR_OCCURED,
- "Si \u00E8 verificato un errore."},
-
- { ER_ILLEGAL_VARIABLE_REFERENCE,
- "Il valore di VariableReference specificato per la variabile \u00E8 fuori contesto o senza definizione. Nome = {0}"},
-
- { ER_AXES_NOT_ALLOWED,
- "Solo gli assi child:: e attribute:: sono consentiti nei pattern di corrispondenza. Assi errati = {0}"},
-
- { ER_KEY_HAS_TOO_MANY_ARGS,
- "key() contiene un numero di argomenti errato."},
-
- { ER_COUNT_TAKES_1_ARG,
- "La funzione count deve avere un solo argomento."},
-
- { ER_COULDNOT_FIND_FUNCTION,
- "Impossibile trovare la funzione {0}"},
-
- { ER_UNSUPPORTED_ENCODING,
- "Codifica non supportata: {0}"},
-
- { ER_PROBLEM_IN_DTM_NEXTSIBLING,
- "Si \u00E8 verificato un problema in DTM in getNextSibling... Tentativo di recupero in corso."},
-
- { ER_CANNOT_WRITE_TO_EMPTYNODELISTIMPL,
- "Errore del programmatore: impossibile scrivere EmptyNodeList."},
-
- { ER_SETDOMFACTORY_NOT_SUPPORTED,
- "setDOMFactory non supportato da XPathContext"},
-
- { ER_PREFIX_MUST_RESOLVE,
- "Il prefisso deve essere risolto in uno spazio di nomi: {0}"},
-
- { ER_PARSE_NOT_SUPPORTED,
- "analisi (origine InputSource) non supportata in XPathContext. Impossibile aprire {0}."},
-
- { ER_SAX_API_NOT_HANDLED,
- "Caratteri API SAX (char ch[]... non gestiti da DTM."},
-
- { ER_IGNORABLE_WHITESPACE_NOT_HANDLED,
- "ignorableWhitespace(char ch[]... non gestito da DTM."},
-
- { ER_DTM_CANNOT_HANDLE_NODES,
- "DTMLiaison non pu\u00F2 gestire i nodi di tipo {0}"},
-
- { ER_XERCES_CANNOT_HANDLE_NODES,
- "DOM2Helper non pu\u00F2 gestire i nodi di tipo {0}"},
-
- { ER_XERCES_PARSE_ERROR_DETAILS,
- "Errore DOM2Helper.parse: SystemID - {0} Riga - {1}"},
-
- { ER_XERCES_PARSE_ERROR,
- "Errore DOM2Helper.parse"},
-
- { ER_INVALID_UTF16_SURROGATE,
- "Rilevato surrogato UTF-16 non valido: {0}?"},
-
- { ER_OIERROR,
- "Errore IO"},
-
- { ER_CANNOT_CREATE_URL,
- "Impossibile creare l''URL per {0}"},
-
- { ER_XPATH_READOBJECT,
- "In XPath.readObject: {0}"},
-
- { ER_FUNCTION_TOKEN_NOT_FOUND,
- "token di funzione non trovato."},
-
- { ER_CANNOT_DEAL_XPATH_TYPE,
- "Impossibile utilizzare il tipo XPath: {0}"},
-
- { ER_NODESET_NOT_MUTABLE,
- "Impossibile modificare questo NodeSet"},
-
- { ER_NODESETDTM_NOT_MUTABLE,
- "Impossibile modificare questo NodeSetDTM"},
-
- { ER_VAR_NOT_RESOLVABLE,
- "Impossibile risolvere la variabile: {0}"},
-
- { ER_NULL_ERROR_HANDLER,
- "Handler degli errori nullo"},
-
- { ER_PROG_ASSERT_UNKNOWN_OPCODE,
- "Asserzione del programmatore: opcode {0} sconosciuto"},
-
- { ER_ZERO_OR_ONE,
- "0 o 1"},
-
- { ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "rtf() non supportato da XRTreeFragSelectWrapper"},
-
- { ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "asNodeIterator() non supportato da XRTreeFragSelectWrapper"},
-
- /** detach() not supported by XRTreeFragSelectWrapper */
- { ER_DETACH_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "detach() non supportato da XRTreeFragSelectWrapper"},
-
- /** num() not supported by XRTreeFragSelectWrapper */
- { ER_NUM_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "num() non supportato da XRTreeFragSelectWrapper"},
-
- /** xstr() not supported by XRTreeFragSelectWrapper */
- { ER_XSTR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "xstr() non supportato da XRTreeFragSelectWrapper"},
-
- /** str() not supported by XRTreeFragSelectWrapper */
- { ER_STR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "str() non supportato da XRTreeFragSelectWrapper"},
-
- { ER_FSB_NOT_SUPPORTED_XSTRINGFORCHARS,
- "fsb() non supportato per XStringForChars"},
-
- { ER_COULD_NOT_FIND_VAR,
- "Impossibile trovare la variabile con nome {0}"},
-
- { ER_XSTRINGFORCHARS_CANNOT_TAKE_STRING,
- "XStringForChars non pu\u00F2 avere una stringa per un argomento"},
-
- { ER_FASTSTRINGBUFFER_CANNOT_BE_NULL,
- "L'argomento FastStringBuffer non pu\u00F2 essere nullo"},
-
- { ER_TWO_OR_THREE,
- "2 o 3"},
-
- { ER_VARIABLE_ACCESSED_BEFORE_BIND,
- "Accesso alla variabile eseguito prima che fosse associata."},
-
- { ER_FSB_CANNOT_TAKE_STRING,
- "XStringForFSB non pu\u00F2 avere una stringa per un argomento"},
-
- { ER_SETTING_WALKER_ROOT_TO_NULL,
- "\n !!!! Errore. Si sta impostando radice di un walker su un valore nullo."},
-
- { ER_NODESETDTM_CANNOT_ITERATE,
- "Questo NodeSetDTM non pu\u00F2 eseguire un'iterazione a un nodo precedente."},
-
- { ER_NODESET_CANNOT_ITERATE,
- "Questo NodeSet non pu\u00F2 eseguire un'iterazione a un nodo precedente."},
-
- { ER_NODESETDTM_CANNOT_INDEX,
- "Questo NodeSetDTM non pu\u00F2 eseguire l'indicizzazione o il conteggio delle funzioni."},
-
- { ER_NODESET_CANNOT_INDEX,
- "Questo NodeSet non pu\u00F2 eseguire l'indicizzazione o il conteggio delle funzioni."},
-
- { ER_CANNOT_CALL_SETSHOULDCACHENODE,
- "Impossibile richiamare setShouldCacheNodes dopo aver richiamato nextNode."},
-
- { ER_ONLY_ALLOWS,
- "{0} consente solo {1} argomenti"},
-
- { ER_UNKNOWN_STEP,
- "Asserzione del programmatore in getNextStepPos: stepType {0} sconosciuto"},
-
- //Note to translators: A relative location path is a form of XPath expression.
- // The message indicates that such an expression was expected following the
- // characters '/' or '//', but was not found.
- { ER_EXPECTED_REL_LOC_PATH,
- "\u00C8 previsto un percorso di posizione relativa dopo il token '/' o '//'."},
-
- // Note to translators: A location path is a form of XPath expression.
- // The message indicates that syntactically such an expression was expected,but
- // the characters specified by the substitution text were encountered instead.
- { ER_EXPECTED_LOC_PATH,
- "\u00C8 previsto un percorso di posizione, ma \u00E8 stato trovato il seguente token: {0}"},
-
- // Note to translators: A location path is a form of XPath expression.
- // The message indicates that syntactically such a subexpression was expected,
- // but no more characters were found in the expression.
- { ER_EXPECTED_LOC_PATH_AT_END_EXPR,
- "\u00C8 previsto un percorso di posizione, ma \u00E8 stata trovata la fine dell'espressione XPath."},
-
- // Note to translators: A location step is part of an XPath expression.
- // The message indicates that syntactically such an expression was expected
- // following the specified characters.
- { ER_EXPECTED_LOC_STEP,
- "\u00C8 previsto un passo di posizione dopo il token '/' o '//'."},
-
- // Note to translators: A node test is part of an XPath expression that is
- // used to test for particular kinds of nodes. In this case, a node test that
- // consists of an NCName followed by a colon and an asterisk or that consists
- // of a QName was expected, but was not found.
- { ER_EXPECTED_NODE_TEST,
- "\u00C8 previsto un test del nodo che corrisponda a NCName:* o a QName."},
-
- // Note to translators: A step pattern is part of an XPath expression.
- // The message indicates that syntactically such an expression was expected,
- // but the specified character was found in the expression instead.
- { ER_EXPECTED_STEP_PATTERN,
- "\u00C8 previsto un pattern di passo, ma \u00E8 stato trovato '/'."},
-
- // Note to translators: A relative path pattern is part of an XPath expression.
- // The message indicates that syntactically such an expression was expected,
- // but was not found.
- { ER_EXPECTED_REL_PATH_PATTERN,
- "\u00C8 previsto un pattern di percorso relativo."},
-
- // Note to translators: The substitution text is the name of a data type. The
- // message indicates that a value of a particular type could not be converted
- // to a value of type boolean.
- { ER_CANT_CONVERT_TO_BOOLEAN,
- "XPathResult dell''espressione XPath ''{0}'' a un valore di XPathResultType pari a {1} che non pu\u00F2 essere convertito in un valore booleano."},
-
- // Note to translators: Do not translate ANY_UNORDERED_NODE_TYPE and
- // FIRST_ORDERED_NODE_TYPE.
- { ER_CANT_CONVERT_TO_SINGLENODE,
- "XPathResult dell''espressione XPath ''{0}'' a un valore di XPathResultType pari a {1} che non pu\u00F2 essere convertito in un nodo singolo. Il metodo getSingleNodeValue \u00E8 valido solo per i tipi ANY_UNORDERED_NODE_TYPE e FIRST_ORDERED_NODE_TYPE."},
-
- // Note to translators: Do not translate UNORDERED_NODE_SNAPSHOT_TYPE and
- // ORDERED_NODE_SNAPSHOT_TYPE.
- { ER_CANT_GET_SNAPSHOT_LENGTH,
- "Impossibile richiamare il metodo getSnapshotLength nell''XPathResult dell''espressione XPath ''{0}'' poich\u00E9 il valore di XPathResultType \u00E8 {1}. Questo metodo \u00E8 valido solo per i tipi UNORDERED_NODE_SNAPSHOT_TYPE e ORDERED_NODE_SNAPSHOT_TYPE."},
-
- { ER_NON_ITERATOR_TYPE,
- "Impossibile richiamare il metodo iterateNext nell''XPathResult dell''espressione XPath ''{0}'' poich\u00E9 il valore di XPathResultType \u00E8 {1}. Questo metodo \u00E8 valido solo per i tipi UNORDERED_NODE_ITERATOR_TYPE e ORDERED_NODE_ITERATOR_TYPE."},
-
- // Note to translators: This message indicates that the document being operated
- // upon changed, so the iterator object that was being used to traverse the
- // document has now become invalid.
- { ER_DOC_MUTATED,
- "Il documento \u00E8 cambiato da quando \u00E8 stato restituito l'ultimo risultato. L'iteratore non \u00E8 valido."},
-
- { ER_INVALID_XPATH_TYPE,
- "Tipo di argomento XPath non valido: {0}"},
-
- { ER_EMPTY_XPATH_RESULT,
- "Oggetto risultati XPath vuoto"},
-
- { ER_INCOMPATIBLE_TYPES,
- "XPathResult dell''espressione XPath ''{0}'' a un valore di XPathResultType pari a {1} che non pu\u00F2 essere convertito forzatamente nel valore XPathResultType {2}."},
-
- { ER_NULL_RESOLVER,
- "Impossibile risolvere il prefisso con un resolver di prefissi nullo."},
-
- // Note to translators: The substitution text is the name of a data type. The
- // message indicates that a value of a particular type could not be converted
- // to a value of type string.
- { ER_CANT_CONVERT_TO_STRING,
- "XPathResult dell''espressione XPath ''{0}'' a un valore di XPathResultType pari a {1} che non pu\u00F2 essere convertito in una stringa."},
-
- // Note to translators: Do not translate snapshotItem,
- // UNORDERED_NODE_SNAPSHOT_TYPE and ORDERED_NODE_SNAPSHOT_TYPE.
- { ER_NON_SNAPSHOT_TYPE,
- "Impossibile richiamare il metodo snapshotItem nell''XPathResult dell''espressione XPath ''{0}'' poich\u00E9 il valore di XPathResultType \u00E8 {1}. Questo metodo \u00E8 valido solo per i tipi UNORDERED_NODE_SNAPSHOT_TYPE e ORDERED_NODE_SNAPSHOT_TYPE."},
-
- // Note to translators: XPathEvaluator is a Java interface name. An
- // XPathEvaluator is created with respect to a particular XML document, and in
- // this case the expression represented by this object was being evaluated with
- // respect to a context node from a different document.
- { ER_WRONG_DOCUMENT,
- "Il nodo di contesto non appartiene al documento associato a questo XPathEvaluator."},
-
- // Note to translators: The XPath expression cannot be evaluated with respect
- // to this type of node.
- { ER_WRONG_NODETYPE,
- "Il tipo di nodo di contesto non \u00E8 supportato."},
-
- { ER_XPATH_ERROR,
- "Errore sconosciuto nell'XPath."},
-
- { ER_CANT_CONVERT_XPATHRESULTTYPE_TO_NUMBER,
- "XPathResult dell''espressione XPath ''{0}'' a un valore di XPathResultType pari a {1} che non pu\u00F2 essere convertito in un numero."},
-
- //BEGIN: Definitions of error keys used in exception messages of JAXP 1.3 XPath API implementation
-
- /** Field ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED */
-
- { ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED,
- "Impossibile richiamare la funzione di estensione ''{0}'' se la funzione XMLConstants.FEATURE_SECURE_PROCESSING \u00E8 impostata su true."},
-
- /** Field ER_RESOLVE_VARIABLE_RETURNS_NULL */
-
- { ER_RESOLVE_VARIABLE_RETURNS_NULL,
- "resolveVariable per la variabile {0} ha restituito un valore nullo"},
-
- /** Field ER_UNSUPPORTED_RETURN_TYPE */
-
- { ER_UNSUPPORTED_RETURN_TYPE,
- "Tipo restituito non supportato: {0}"},
-
- /** Field ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL */
-
- { ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL,
- "Il tipo di origine e/o restituito non pu\u00F2 essere nullo"},
-
- /** Field ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL */
-
- { ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL,
- "Il tipo di origine e/o restituito non pu\u00F2 essere nullo"},
-
- /** Field ER_ARG_CANNOT_BE_NULL */
-
- { ER_ARG_CANNOT_BE_NULL,
- "L''argomento {0} non pu\u00F2 essere nullo"},
-
- /** Field ER_OBJECT_MODEL_NULL */
-
- { ER_OBJECT_MODEL_NULL,
- "{0}#isObjectModelSupported( String objectModel ) non pu\u00F2 essere richiamato se objectModel == null"},
-
- /** Field ER_OBJECT_MODEL_EMPTY */
-
- { ER_OBJECT_MODEL_EMPTY,
- "{0}#isObjectModelSupported( String objectModel ) non pu\u00F2 essere richiamato se objectModel == \"\""},
-
- /** Field ER_OBJECT_MODEL_EMPTY */
-
- { ER_FEATURE_NAME_NULL,
- "Tentativo di impostare una funzione con nome nullo: {0}#setFeature( null, {1})"},
-
- /** Field ER_FEATURE_UNKNOWN */
-
- { ER_FEATURE_UNKNOWN,
- "Tentativo di impostare la funzione sconosciuta \"{0}\":{1}#setFeature({0},{2})"},
-
- /** Field ER_GETTING_NULL_FEATURE */
-
- { ER_GETTING_NULL_FEATURE,
- "Tentativo di recuperare una funzione con nome nullo: {0}#getFeature(null)"},
-
- /** Field ER_GETTING_NULL_FEATURE */
-
- { ER_GETTING_UNKNOWN_FEATURE,
- "Tentativo di recuperare la funzione sconosciuta \"{0}\":{1}#getFeature({0})"},
-
- {ER_SECUREPROCESSING_FEATURE,
- "FEATURE_SECURE_PROCESSING: impossibile impostare la funzione su false se \u00E8 presente Security Manager: {1}#setFeature({0},{2})"},
-
- /** Field ER_NULL_XPATH_FUNCTION_RESOLVER */
-
- { ER_NULL_XPATH_FUNCTION_RESOLVER,
- "Tentativo di impostare un valore nullo per XPathFunctionResolver:{0}#setXPathFunctionResolver(null)"},
-
- /** Field ER_NULL_XPATH_VARIABLE_RESOLVER */
-
- { ER_NULL_XPATH_VARIABLE_RESOLVER,
- "Tentativo di impostare un valore nullo per XPathVariableResolver:{0}#setXPathVariableResolver(null)"},
-
- //END: Definitions of error keys used in exception messages of JAXP 1.3 XPath API implementation
-
- // Warnings...
-
- { WG_LOCALE_NAME_NOT_HANDLED,
- "il nome di impostazioni nazionali nella funzione format-number non \u00E8 ancora gestito."},
-
- { WG_PROPERTY_NOT_SUPPORTED,
- "Propriet\u00E0 XSL non supportata: {0}"},
-
- { WG_DONT_DO_ANYTHING_WITH_NS,
- "Non effettuare alcuna operazione sullo spazio di nomi {0} nella propriet\u00E0: {1}"},
-
- { WG_SECURITY_EXCEPTION,
- "SecurityException nel tentativo di accedere alla propriet\u00E0 di sistema XSL {0}"},
-
- { WG_QUO_NO_LONGER_DEFINED,
- "Sintassi obsoleta: quo(...) non \u00E8 pi\u00F9 definito nell'XPath."},
-
- { WG_NEED_DERIVED_OBJECT_TO_IMPLEMENT_NODETEST,
- "L'XPath richiede un oggetto derivato che implementi nodeTest."},
-
- { WG_FUNCTION_TOKEN_NOT_FOUND,
- "token di funzione non trovato."},
-
- { WG_COULDNOT_FIND_FUNCTION,
- "Impossibile trovare la funzione {0}"},
-
- { WG_CANNOT_MAKE_URL_FROM,
- "Impossibile creare un URL da {0}"},
-
- { WG_EXPAND_ENTITIES_NOT_SUPPORTED,
- "Opzione -E non supportata per il parser DTM"},
-
- { WG_ILLEGAL_VARIABLE_REFERENCE,
- "Il valore di VariableReference specificato per la variabile \u00E8 fuori contesto o senza definizione. Nome = {0}"},
-
- { WG_UNSUPPORTED_ENCODING,
- "Codifica non supportata: {0}"},
-
-
-
- // Other miscellaneous text used inside the code...
- { "ui_language", "it"},
- { "help_language", "it"},
- { "language", "it"},
- { "BAD_CODE", "Parametro per createMessage fuori limite"},
- { "FORMAT_FAILED", "Eccezione durante la chiamata messageFormat"},
- { "version", ">>>>>>> Versione Xalan "},
- { "version2", "<<<<<<<"},
- { "yes", "s\u00EC"},
- { "line", "N. riga"},
- { "column", "N. colonna"},
- { "xsldone", "XSLProcessor: operazione completata"},
- { "xpath_option", "opzioni xpath: "},
- { "optionIN", " [-in inputXMLURL]"},
- { "optionSelect", " [-select xpath expression]"},
- { "optionMatch", " [-match match pattern (per la diagnostica delle corrispondenze)]"},
- { "optionAnyExpr", "In alternativa, un'espressione xpath eseguir\u00E0 il dump della diagnostica."},
- { "noParsermsg1", "Processo XSL non riuscito."},
- { "noParsermsg2", "** Impossibile trovare il parser **"},
- { "noParsermsg3", "Controllare il classpath."},
- { "noParsermsg4", "Se non \u00E8 disponibile un parser XML di IBM per Java, \u00E8 possibile scaricarlo da"},
- { "noParsermsg5", "AlphaWorks di IBM: http://www.alphaworks.ibm.com/formula/xml"},
- { "gtone", ">1" },
- { "zero", "0" },
- { "one", "1" },
- { "two" , "2" },
- { "three", "3" }
-
- };
-
- /**
- * Get the association list.
- *
- * @return The association list.
- */
- public Object[][] getContents()
- {
- return _contents;
- }
-
-
- // ================= INFRASTRUCTURE ======================
-
- /** Field BAD_CODE */
- public static final String BAD_CODE = "BAD_CODE";
-
- /** Field FORMAT_FAILED */
- public static final String FORMAT_FAILED = "FORMAT_FAILED";
-
- /** Field ERROR_RESOURCES */
- public static final String ERROR_RESOURCES =
- "com.sun.org.apache.xpath.internal.res.XPATHErrorResources";
-
- /** Field ERROR_STRING */
- public static final String ERROR_STRING = "#error";
-
- /** Field ERROR_HEADER */
- public static final String ERROR_HEADER = "Error: ";
-
- /** Field WARNING_HEADER */
- public static final String WARNING_HEADER = "Warning: ";
-
- /** Field XSL_HEADER */
- public static final String XSL_HEADER = "XSL ";
-
- /** Field XML_HEADER */
- public static final String XML_HEADER = "XML ";
-
- /** Field QUERY_HEADER */
- public static final String QUERY_HEADER = "PATTERN ";
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_ja.java b/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_ja.java
deleted file mode 100644
index 9dcd026..0000000
--- a/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_ja.java
+++ /dev/null
@@ -1,936 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xpath.internal.res;
-
-import java.util.ListResourceBundle;
-
-/**
- * Set up error messages.
- * We build a two dimensional array of message keys and
- * message strings. In order to add a new message here,
- * you need to first add a Static string constant for the
- * Key and update the contents array with Key, Value pair
- * Also you need to update the count of messages(MAX_CODE)or
- * the count of warnings(MAX_WARNING) [ Information purpose only]
- * @xsl.usage advanced
- */
-public class XPATHErrorResources_ja extends ListResourceBundle
-{
-
-/*
- * General notes to translators:
- *
- * This file contains error and warning messages related to XPath Error
- * Handling.
- *
- * 1) Xalan (or more properly, Xalan-interpretive) and XSLTC are names of
- * components.
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- * XSLTC is an acronym for XSLT Compiler.
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 5) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 6) "Translet" is an invented term that describes the class file that
- * results from compiling an XML stylesheet into a Java class.
- *
- * 7) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- * 8) The context node is the node in the document with respect to which an
- * XPath expression is being evaluated.
- *
- * 9) An iterator is an object that traverses nodes in the tree, one at a time.
- *
- * 10) NCName is an XML term used to describe a name that does not contain a
- * colon (a "no-colon name").
- *
- * 11) QName is an XML term meaning "qualified name".
- */
-
- /*
- * static variables
- */
- public static final String ERROR0000 = "ERROR0000";
- public static final String ER_CURRENT_NOT_ALLOWED_IN_MATCH =
- "ER_CURRENT_NOT_ALLOWED_IN_MATCH";
- public static final String ER_CURRENT_TAKES_NO_ARGS =
- "ER_CURRENT_TAKES_NO_ARGS";
- public static final String ER_DOCUMENT_REPLACED = "ER_DOCUMENT_REPLACED";
- public static final String ER_CONTEXT_HAS_NO_OWNERDOC =
- "ER_CONTEXT_HAS_NO_OWNERDOC";
- public static final String ER_LOCALNAME_HAS_TOO_MANY_ARGS =
- "ER_LOCALNAME_HAS_TOO_MANY_ARGS";
- public static final String ER_NAMESPACEURI_HAS_TOO_MANY_ARGS =
- "ER_NAMESPACEURI_HAS_TOO_MANY_ARGS";
- public static final String ER_NORMALIZESPACE_HAS_TOO_MANY_ARGS =
- "ER_NORMALIZESPACE_HAS_TOO_MANY_ARGS";
- public static final String ER_NUMBER_HAS_TOO_MANY_ARGS =
- "ER_NUMBER_HAS_TOO_MANY_ARGS";
- public static final String ER_NAME_HAS_TOO_MANY_ARGS =
- "ER_NAME_HAS_TOO_MANY_ARGS";
- public static final String ER_STRING_HAS_TOO_MANY_ARGS =
- "ER_STRING_HAS_TOO_MANY_ARGS";
- public static final String ER_STRINGLENGTH_HAS_TOO_MANY_ARGS =
- "ER_STRINGLENGTH_HAS_TOO_MANY_ARGS";
- public static final String ER_TRANSLATE_TAKES_3_ARGS =
- "ER_TRANSLATE_TAKES_3_ARGS";
- public static final String ER_UNPARSEDENTITYURI_TAKES_1_ARG =
- "ER_UNPARSEDENTITYURI_TAKES_1_ARG";
- public static final String ER_NAMESPACEAXIS_NOT_IMPLEMENTED =
- "ER_NAMESPACEAXIS_NOT_IMPLEMENTED";
- public static final String ER_UNKNOWN_AXIS = "ER_UNKNOWN_AXIS";
- public static final String ER_UNKNOWN_MATCH_OPERATION =
- "ER_UNKNOWN_MATCH_OPERATION";
- public static final String ER_INCORRECT_ARG_LENGTH ="ER_INCORRECT_ARG_LENGTH";
- public static final String ER_CANT_CONVERT_TO_NUMBER =
- "ER_CANT_CONVERT_TO_NUMBER";
- public static final String ER_CANT_CONVERT_XPATHRESULTTYPE_TO_NUMBER =
- "ER_CANT_CONVERT_XPATHRESULTTYPE_TO_NUMBER";
- public static final String ER_CANT_CONVERT_TO_NODELIST =
- "ER_CANT_CONVERT_TO_NODELIST";
- public static final String ER_CANT_CONVERT_TO_MUTABLENODELIST =
- "ER_CANT_CONVERT_TO_MUTABLENODELIST";
- public static final String ER_CANT_CONVERT_TO_TYPE ="ER_CANT_CONVERT_TO_TYPE";
- public static final String ER_EXPECTED_MATCH_PATTERN =
- "ER_EXPECTED_MATCH_PATTERN";
- public static final String ER_COULDNOT_GET_VAR_NAMED =
- "ER_COULDNOT_GET_VAR_NAMED";
- public static final String ER_UNKNOWN_OPCODE = "ER_UNKNOWN_OPCODE";
- public static final String ER_EXTRA_ILLEGAL_TOKENS ="ER_EXTRA_ILLEGAL_TOKENS";
- public static final String ER_EXPECTED_DOUBLE_QUOTE =
- "ER_EXPECTED_DOUBLE_QUOTE";
- public static final String ER_EXPECTED_SINGLE_QUOTE =
- "ER_EXPECTED_SINGLE_QUOTE";
- public static final String ER_EMPTY_EXPRESSION = "ER_EMPTY_EXPRESSION";
- public static final String ER_EXPECTED_BUT_FOUND = "ER_EXPECTED_BUT_FOUND";
- public static final String ER_INCORRECT_PROGRAMMER_ASSERTION =
- "ER_INCORRECT_PROGRAMMER_ASSERTION";
- public static final String ER_BOOLEAN_ARG_NO_LONGER_OPTIONAL =
- "ER_BOOLEAN_ARG_NO_LONGER_OPTIONAL";
- public static final String ER_FOUND_COMMA_BUT_NO_PRECEDING_ARG =
- "ER_FOUND_COMMA_BUT_NO_PRECEDING_ARG";
- public static final String ER_FOUND_COMMA_BUT_NO_FOLLOWING_ARG =
- "ER_FOUND_COMMA_BUT_NO_FOLLOWING_ARG";
- public static final String ER_PREDICATE_ILLEGAL_SYNTAX =
- "ER_PREDICATE_ILLEGAL_SYNTAX";
- public static final String ER_ILLEGAL_AXIS_NAME = "ER_ILLEGAL_AXIS_NAME";
- public static final String ER_UNKNOWN_NODETYPE = "ER_UNKNOWN_NODETYPE";
- public static final String ER_PATTERN_LITERAL_NEEDS_BE_QUOTED =
- "ER_PATTERN_LITERAL_NEEDS_BE_QUOTED";
- public static final String ER_COULDNOT_BE_FORMATTED_TO_NUMBER =
- "ER_COULDNOT_BE_FORMATTED_TO_NUMBER";
- public static final String ER_COULDNOT_CREATE_XMLPROCESSORLIAISON =
- "ER_COULDNOT_CREATE_XMLPROCESSORLIAISON";
- public static final String ER_DIDNOT_FIND_XPATH_SELECT_EXP =
- "ER_DIDNOT_FIND_XPATH_SELECT_EXP";
- public static final String ER_COULDNOT_FIND_ENDOP_AFTER_OPLOCATIONPATH =
- "ER_COULDNOT_FIND_ENDOP_AFTER_OPLOCATIONPATH";
- public static final String ER_ERROR_OCCURED = "ER_ERROR_OCCURED";
- public static final String ER_ILLEGAL_VARIABLE_REFERENCE =
- "ER_ILLEGAL_VARIABLE_REFERENCE";
- public static final String ER_AXES_NOT_ALLOWED = "ER_AXES_NOT_ALLOWED";
- public static final String ER_KEY_HAS_TOO_MANY_ARGS =
- "ER_KEY_HAS_TOO_MANY_ARGS";
- public static final String ER_COUNT_TAKES_1_ARG = "ER_COUNT_TAKES_1_ARG";
- public static final String ER_COULDNOT_FIND_FUNCTION =
- "ER_COULDNOT_FIND_FUNCTION";
- public static final String ER_UNSUPPORTED_ENCODING ="ER_UNSUPPORTED_ENCODING";
- public static final String ER_PROBLEM_IN_DTM_NEXTSIBLING =
- "ER_PROBLEM_IN_DTM_NEXTSIBLING";
- public static final String ER_CANNOT_WRITE_TO_EMPTYNODELISTIMPL =
- "ER_CANNOT_WRITE_TO_EMPTYNODELISTIMPL";
- public static final String ER_SETDOMFACTORY_NOT_SUPPORTED =
- "ER_SETDOMFACTORY_NOT_SUPPORTED";
- public static final String ER_PREFIX_MUST_RESOLVE = "ER_PREFIX_MUST_RESOLVE";
- public static final String ER_PARSE_NOT_SUPPORTED = "ER_PARSE_NOT_SUPPORTED";
- public static final String ER_SAX_API_NOT_HANDLED = "ER_SAX_API_NOT_HANDLED";
-public static final String ER_IGNORABLE_WHITESPACE_NOT_HANDLED =
- "ER_IGNORABLE_WHITESPACE_NOT_HANDLED";
- public static final String ER_DTM_CANNOT_HANDLE_NODES =
- "ER_DTM_CANNOT_HANDLE_NODES";
- public static final String ER_XERCES_CANNOT_HANDLE_NODES =
- "ER_XERCES_CANNOT_HANDLE_NODES";
- public static final String ER_XERCES_PARSE_ERROR_DETAILS =
- "ER_XERCES_PARSE_ERROR_DETAILS";
- public static final String ER_XERCES_PARSE_ERROR = "ER_XERCES_PARSE_ERROR";
- public static final String ER_INVALID_UTF16_SURROGATE =
- "ER_INVALID_UTF16_SURROGATE";
- public static final String ER_OIERROR = "ER_OIERROR";
- public static final String ER_CANNOT_CREATE_URL = "ER_CANNOT_CREATE_URL";
- public static final String ER_XPATH_READOBJECT = "ER_XPATH_READOBJECT";
- public static final String ER_FUNCTION_TOKEN_NOT_FOUND =
- "ER_FUNCTION_TOKEN_NOT_FOUND";
- public static final String ER_CANNOT_DEAL_XPATH_TYPE =
- "ER_CANNOT_DEAL_XPATH_TYPE";
- public static final String ER_NODESET_NOT_MUTABLE = "ER_NODESET_NOT_MUTABLE";
- public static final String ER_NODESETDTM_NOT_MUTABLE =
- "ER_NODESETDTM_NOT_MUTABLE";
- /** Variable not resolvable: */
- public static final String ER_VAR_NOT_RESOLVABLE = "ER_VAR_NOT_RESOLVABLE";
- /** Null error handler */
- public static final String ER_NULL_ERROR_HANDLER = "ER_NULL_ERROR_HANDLER";
- /** Programmer's assertion: unknown opcode */
- public static final String ER_PROG_ASSERT_UNKNOWN_OPCODE =
- "ER_PROG_ASSERT_UNKNOWN_OPCODE";
- /** 0 or 1 */
- public static final String ER_ZERO_OR_ONE = "ER_ZERO_OR_ONE";
- /** rtf() not supported by XRTreeFragSelectWrapper */
- public static final String ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** asNodeIterator() not supported by XRTreeFragSelectWrapper */
- public static final String ER_ASNODEITERATOR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER = "ER_ASNODEITERATOR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** fsb() not supported for XStringForChars */
- public static final String ER_FSB_NOT_SUPPORTED_XSTRINGFORCHARS =
- "ER_FSB_NOT_SUPPORTED_XSTRINGFORCHARS";
- /** Could not find variable with the name of */
- public static final String ER_COULD_NOT_FIND_VAR = "ER_COULD_NOT_FIND_VAR";
- /** XStringForChars can not take a string for an argument */
- public static final String ER_XSTRINGFORCHARS_CANNOT_TAKE_STRING =
- "ER_XSTRINGFORCHARS_CANNOT_TAKE_STRING";
- /** The FastStringBuffer argument can not be null */
- public static final String ER_FASTSTRINGBUFFER_CANNOT_BE_NULL =
- "ER_FASTSTRINGBUFFER_CANNOT_BE_NULL";
- /** 2 or 3 */
- public static final String ER_TWO_OR_THREE = "ER_TWO_OR_THREE";
- /** Variable accessed before it is bound! */
- public static final String ER_VARIABLE_ACCESSED_BEFORE_BIND =
- "ER_VARIABLE_ACCESSED_BEFORE_BIND";
- /** XStringForFSB can not take a string for an argument! */
- public static final String ER_FSB_CANNOT_TAKE_STRING =
- "ER_FSB_CANNOT_TAKE_STRING";
- /** Error! Setting the root of a walker to null! */
- public static final String ER_SETTING_WALKER_ROOT_TO_NULL =
- "ER_SETTING_WALKER_ROOT_TO_NULL";
- /** This NodeSetDTM can not iterate to a previous node! */
- public static final String ER_NODESETDTM_CANNOT_ITERATE =
- "ER_NODESETDTM_CANNOT_ITERATE";
- /** This NodeSet can not iterate to a previous node! */
- public static final String ER_NODESET_CANNOT_ITERATE =
- "ER_NODESET_CANNOT_ITERATE";
- /** This NodeSetDTM can not do indexing or counting functions! */
- public static final String ER_NODESETDTM_CANNOT_INDEX =
- "ER_NODESETDTM_CANNOT_INDEX";
- /** This NodeSet can not do indexing or counting functions! */
- public static final String ER_NODESET_CANNOT_INDEX =
- "ER_NODESET_CANNOT_INDEX";
- /** Can not call setShouldCacheNodes after nextNode has been called! */
- public static final String ER_CANNOT_CALL_SETSHOULDCACHENODE =
- "ER_CANNOT_CALL_SETSHOULDCACHENODE";
- /** {0} only allows {1} arguments */
- public static final String ER_ONLY_ALLOWS = "ER_ONLY_ALLOWS";
- /** Programmer's assertion in getNextStepPos: unknown stepType: {0} */
- public static final String ER_UNKNOWN_STEP = "ER_UNKNOWN_STEP";
- /** Problem with RelativeLocationPath */
- public static final String ER_EXPECTED_REL_LOC_PATH =
- "ER_EXPECTED_REL_LOC_PATH";
- /** Problem with LocationPath */
- public static final String ER_EXPECTED_LOC_PATH = "ER_EXPECTED_LOC_PATH";
- public static final String ER_EXPECTED_LOC_PATH_AT_END_EXPR =
- "ER_EXPECTED_LOC_PATH_AT_END_EXPR";
- /** Problem with Step */
- public static final String ER_EXPECTED_LOC_STEP = "ER_EXPECTED_LOC_STEP";
- /** Problem with NodeTest */
- public static final String ER_EXPECTED_NODE_TEST = "ER_EXPECTED_NODE_TEST";
- /** Expected step pattern */
- public static final String ER_EXPECTED_STEP_PATTERN =
- "ER_EXPECTED_STEP_PATTERN";
- /** Expected relative path pattern */
- public static final String ER_EXPECTED_REL_PATH_PATTERN =
- "ER_EXPECTED_REL_PATH_PATTERN";
- /** ER_CANT_CONVERT_XPATHRESULTTYPE_TO_BOOLEAN */
- public static final String ER_CANT_CONVERT_TO_BOOLEAN =
- "ER_CANT_CONVERT_TO_BOOLEAN";
- /** Field ER_CANT_CONVERT_TO_SINGLENODE */
- public static final String ER_CANT_CONVERT_TO_SINGLENODE =
- "ER_CANT_CONVERT_TO_SINGLENODE";
- /** Field ER_CANT_GET_SNAPSHOT_LENGTH */
- public static final String ER_CANT_GET_SNAPSHOT_LENGTH =
- "ER_CANT_GET_SNAPSHOT_LENGTH";
- /** Field ER_NON_ITERATOR_TYPE */
- public static final String ER_NON_ITERATOR_TYPE = "ER_NON_ITERATOR_TYPE";
- /** Field ER_DOC_MUTATED */
- public static final String ER_DOC_MUTATED = "ER_DOC_MUTATED";
- public static final String ER_INVALID_XPATH_TYPE = "ER_INVALID_XPATH_TYPE";
- public static final String ER_EMPTY_XPATH_RESULT = "ER_EMPTY_XPATH_RESULT";
- public static final String ER_INCOMPATIBLE_TYPES = "ER_INCOMPATIBLE_TYPES";
- public static final String ER_NULL_RESOLVER = "ER_NULL_RESOLVER";
- public static final String ER_CANT_CONVERT_TO_STRING =
- "ER_CANT_CONVERT_TO_STRING";
- public static final String ER_NON_SNAPSHOT_TYPE = "ER_NON_SNAPSHOT_TYPE";
- public static final String ER_WRONG_DOCUMENT = "ER_WRONG_DOCUMENT";
- /* Note to translators: The XPath expression cannot be evaluated with respect
- * to this type of node.
- */
- /** Field ER_WRONG_NODETYPE */
- public static final String ER_WRONG_NODETYPE = "ER_WRONG_NODETYPE";
- public static final String ER_XPATH_ERROR = "ER_XPATH_ERROR";
-
- //BEGIN: Keys needed for exception messages of JAXP 1.3 XPath API implementation
- public static final String ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED = "ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED";
- public static final String ER_RESOLVE_VARIABLE_RETURNS_NULL = "ER_RESOLVE_VARIABLE_RETURNS_NULL";
- public static final String ER_UNSUPPORTED_RETURN_TYPE = "ER_UNSUPPORTED_RETURN_TYPE";
- public static final String ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL = "ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL";
- public static final String ER_ARG_CANNOT_BE_NULL = "ER_ARG_CANNOT_BE_NULL";
-
- public static final String ER_OBJECT_MODEL_NULL = "ER_OBJECT_MODEL_NULL";
- public static final String ER_OBJECT_MODEL_EMPTY = "ER_OBJECT_MODEL_EMPTY";
- public static final String ER_FEATURE_NAME_NULL = "ER_FEATURE_NAME_NULL";
- public static final String ER_FEATURE_UNKNOWN = "ER_FEATURE_UNKNOWN";
- public static final String ER_GETTING_NULL_FEATURE = "ER_GETTING_NULL_FEATURE";
- public static final String ER_GETTING_UNKNOWN_FEATURE = "ER_GETTING_UNKNOWN_FEATURE";
- public static final String ER_SECUREPROCESSING_FEATURE = "ER_SECUREPROCESSING_FEATURE";
- public static final String ER_NULL_XPATH_FUNCTION_RESOLVER = "ER_NULL_XPATH_FUNCTION_RESOLVER";
- public static final String ER_NULL_XPATH_VARIABLE_RESOLVER = "ER_NULL_XPATH_VARIABLE_RESOLVER";
- //END: Keys needed for exception messages of JAXP 1.3 XPath API implementation
-
- public static final String WG_LOCALE_NAME_NOT_HANDLED =
- "WG_LOCALE_NAME_NOT_HANDLED";
- public static final String WG_PROPERTY_NOT_SUPPORTED =
- "WG_PROPERTY_NOT_SUPPORTED";
- public static final String WG_DONT_DO_ANYTHING_WITH_NS =
- "WG_DONT_DO_ANYTHING_WITH_NS";
- public static final String WG_SECURITY_EXCEPTION = "WG_SECURITY_EXCEPTION";
- public static final String WG_QUO_NO_LONGER_DEFINED =
- "WG_QUO_NO_LONGER_DEFINED";
- public static final String WG_NEED_DERIVED_OBJECT_TO_IMPLEMENT_NODETEST =
- "WG_NEED_DERIVED_OBJECT_TO_IMPLEMENT_NODETEST";
- public static final String WG_FUNCTION_TOKEN_NOT_FOUND =
- "WG_FUNCTION_TOKEN_NOT_FOUND";
- public static final String WG_COULDNOT_FIND_FUNCTION =
- "WG_COULDNOT_FIND_FUNCTION";
- public static final String WG_CANNOT_MAKE_URL_FROM ="WG_CANNOT_MAKE_URL_FROM";
- public static final String WG_EXPAND_ENTITIES_NOT_SUPPORTED =
- "WG_EXPAND_ENTITIES_NOT_SUPPORTED";
- public static final String WG_ILLEGAL_VARIABLE_REFERENCE =
- "WG_ILLEGAL_VARIABLE_REFERENCE";
- public static final String WG_UNSUPPORTED_ENCODING ="WG_UNSUPPORTED_ENCODING";
-
- /** detach() not supported by XRTreeFragSelectWrapper */
- public static final String ER_DETACH_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_DETACH_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** num() not supported by XRTreeFragSelectWrapper */
- public static final String ER_NUM_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_NUM_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** xstr() not supported by XRTreeFragSelectWrapper */
- public static final String ER_XSTR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_XSTR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** str() not supported by XRTreeFragSelectWrapper */
- public static final String ER_STR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_STR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
-
- // Error messages...
-
- private static final Object[][] _contents = new Object[][]{
-
- { "ERROR0000" , "{0}" },
-
- { ER_CURRENT_NOT_ALLOWED_IN_MATCH, "current()\u95A2\u6570\u306F\u4E00\u81F4\u30D1\u30BF\u30FC\u30F3\u3067\u306F\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093\u3002" },
-
- { ER_CURRENT_TAKES_NO_ARGS, "current()\u95A2\u6570\u306F\u5F15\u6570\u3092\u53D7\u3051\u5165\u308C\u307E\u305B\u3093\u3002" },
-
- { ER_DOCUMENT_REPLACED,
- "document()\u95A2\u6570\u306E\u5B9F\u88C5\u306Fcom.sun.org.apache.xalan.internal.xslt.FuncDocument\u306B\u3088\u3063\u3066\u7F6E\u63DB\u3055\u308C\u307E\u3057\u305F\u3002"},
-
- { ER_CONTEXT_HAS_NO_OWNERDOC,
- "\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u306B\u6240\u6709\u8005\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u304C\u3042\u308A\u307E\u305B\u3093\u3002"},
-
- { ER_LOCALNAME_HAS_TOO_MANY_ARGS,
- "local-name()\u306E\u5F15\u6570\u304C\u591A\u3059\u304E\u307E\u3059\u3002"},
-
- { ER_NAMESPACEURI_HAS_TOO_MANY_ARGS,
- "namespace-uri()\u306E\u5F15\u6570\u304C\u591A\u3059\u304E\u307E\u3059\u3002"},
-
- { ER_NORMALIZESPACE_HAS_TOO_MANY_ARGS,
- "normalize-space()\u306E\u5F15\u6570\u304C\u591A\u3059\u304E\u307E\u3059\u3002"},
-
- { ER_NUMBER_HAS_TOO_MANY_ARGS,
- "number()\u306E\u5F15\u6570\u304C\u591A\u3059\u304E\u307E\u3059\u3002"},
-
- { ER_NAME_HAS_TOO_MANY_ARGS,
- "name()\u306E\u5F15\u6570\u304C\u591A\u3059\u304E\u307E\u3059\u3002"},
-
- { ER_STRING_HAS_TOO_MANY_ARGS,
- "string()\u306E\u5F15\u6570\u304C\u591A\u3059\u304E\u307E\u3059\u3002"},
-
- { ER_STRINGLENGTH_HAS_TOO_MANY_ARGS,
- "string-length()\u306E\u5F15\u6570\u304C\u591A\u3059\u304E\u307E\u3059\u3002"},
-
- { ER_TRANSLATE_TAKES_3_ARGS,
- "translate()\u95A2\u6570\u306F3\u3064\u306E\u5F15\u6570\u3092\u53D6\u308A\u307E\u3059\u3002"},
-
- { ER_UNPARSEDENTITYURI_TAKES_1_ARG,
- "unparsed-entity-uri\u95A2\u6570\u306F\u5F15\u6570\u30921\u3064\u53D6\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002"},
-
- { ER_NAMESPACEAXIS_NOT_IMPLEMENTED,
- "namespace\u8EF8\u306F\u307E\u3060\u5B9F\u88C5\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"},
-
- { ER_UNKNOWN_AXIS,
- "\u4E0D\u660E\u306A\u8EF8\u3067\u3059: {0}"},
-
- { ER_UNKNOWN_MATCH_OPERATION,
- "\u4E0D\u660E\u306A\u4E00\u81F4\u64CD\u4F5C\u3067\u3059\u3002"},
-
- { ER_INCORRECT_ARG_LENGTH,
- "processing-instruction()\u30CE\u30FC\u30C9\u30FB\u30C6\u30B9\u30C8\u306E\u5F15\u6570\u306E\u9577\u3055\u304C\u4E0D\u6B63\u3067\u3059\u3002"},
-
- { ER_CANT_CONVERT_TO_NUMBER,
- "{0}\u3092\u6570\u5024\u306B\u5909\u63DB\u3067\u304D\u307E\u305B\u3093"},
-
- { ER_CANT_CONVERT_TO_NODELIST,
- "{0}\u3092NodeList\u306B\u5909\u63DB\u3067\u304D\u307E\u305B\u3093\u3002"},
-
- { ER_CANT_CONVERT_TO_MUTABLENODELIST,
- "{0}\u3092NodeSetDTM\u306B\u5909\u63DB\u3067\u304D\u307E\u305B\u3093\u3002"},
-
- { ER_CANT_CONVERT_TO_TYPE,
- "{0}\u3092type#{1}\u306B\u5909\u63DB\u3067\u304D\u307E\u305B\u3093"},
-
- { ER_EXPECTED_MATCH_PATTERN,
- "getMatchScore\u306B\u4E00\u81F4\u30D1\u30BF\u30FC\u30F3\u304C\u5FC5\u8981\u3067\u3059\u3002"},
-
- { ER_COULDNOT_GET_VAR_NAMED,
- "\u540D\u524D{0}\u306E\u5909\u6570\u3092\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F"},
-
- { ER_UNKNOWN_OPCODE,
- "\u30A8\u30E9\u30FC\u3002\u4E0D\u660E\u306A\u64CD\u4F5C\u30B3\u30FC\u30C9: {0}"},
-
- { ER_EXTRA_ILLEGAL_TOKENS,
- "\u4F59\u5206\u306E\u4E0D\u6B63\u306A\u30C8\u30FC\u30AF\u30F3: {0}"},
-
- { ER_EXPECTED_DOUBLE_QUOTE,
- "\u30EA\u30C6\u30E9\u30EB\u306E\u5F15\u7528\u7B26\u304C\u4E0D\u6B63\u3067\u3059... \u4E8C\u91CD\u5F15\u7528\u7B26\u304C\u5FC5\u8981\u3067\u3059\u3002"},
-
- { ER_EXPECTED_SINGLE_QUOTE,
- "\u30EA\u30C6\u30E9\u30EB\u306E\u5F15\u7528\u7B26\u304C\u4E0D\u6B63\u3067\u3059... \u4E00\u91CD\u5F15\u7528\u7B26\u304C\u5FC5\u8981\u3067\u3059\u3002"},
-
- { ER_EMPTY_EXPRESSION,
- "\u5F0F\u304C\u7A7A\u3067\u3059\u3002"},
-
- { ER_EXPECTED_BUT_FOUND,
- "{0}\u3067\u306F\u306A\u304F{1}\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F"},
-
- { ER_INCORRECT_PROGRAMMER_ASSERTION,
- "\u30D7\u30ED\u30B0\u30E9\u30DE\u30FB\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3\u304C\u4E0D\u6B63\u3067\u3059\u3002- {0}"},
-
- { ER_BOOLEAN_ARG_NO_LONGER_OPTIONAL,
- "boolean(...)\u5F15\u6570\u306F\u300119990709 XPath\u30C9\u30E9\u30D5\u30C8\u306B\u3088\u3063\u3066\u30AA\u30D7\u30B7\u30E7\u30F3\u3067\u306A\u304F\u306A\u308A\u307E\u3057\u305F\u3002"},
-
- { ER_FOUND_COMMA_BUT_NO_PRECEDING_ARG,
- "','\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u304C\u524D\u306B\u5F15\u6570\u304C\u3042\u308A\u307E\u305B\u3093\u3002"},
-
- { ER_FOUND_COMMA_BUT_NO_FOLLOWING_ARG,
- "','\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u304C\u5F8C\u308D\u306B\u5F15\u6570\u304C\u3042\u308A\u307E\u305B\u3093\u3002"},
-
- { ER_PREDICATE_ILLEGAL_SYNTAX,
- "'..[predicate]'\u307E\u305F\u306F'.[predicate]'\u306F\u4E0D\u6B63\u306A\u69CB\u6587\u3067\u3059\u3002\u304B\u308F\u308A\u306B'self::node()[predicate]'\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
-
- { ER_ILLEGAL_AXIS_NAME,
- "\u4E0D\u6B63\u306A\u8EF8\u540D: {0}"},
-
- { ER_UNKNOWN_NODETYPE,
- "\u4E0D\u660E\u306Anodetype: {0}"},
-
- { ER_PATTERN_LITERAL_NEEDS_BE_QUOTED,
- "\u30D1\u30BF\u30FC\u30F3\u30FB\u30EA\u30C6\u30E9\u30EB({0})\u306B\u5F15\u7528\u7B26\u3092\u4ED8\u3051\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002"},
-
- { ER_COULDNOT_BE_FORMATTED_TO_NUMBER,
- "{0}\u3092\u6570\u5024\u306B\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002"},
-
- { ER_COULDNOT_CREATE_XMLPROCESSORLIAISON,
- "XML TransformerFactory Liaison\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F: {0}"},
-
- { ER_DIDNOT_FIND_XPATH_SELECT_EXP,
- "\u30A8\u30E9\u30FC\u3002xpath\u9078\u629E\u5F0F(-select)\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002"},
-
- { ER_COULDNOT_FIND_ENDOP_AFTER_OPLOCATIONPATH,
- "\u30A8\u30E9\u30FC\u3002OP_LOCATIONPATH\u306E\u5F8C\u306BENDOP\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F"},
-
- { ER_ERROR_OCCURED,
- "\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002"},
-
- { ER_ILLEGAL_VARIABLE_REFERENCE,
- "\u5909\u6570\u306B\u6307\u5B9A\u3057\u305FVariableReference\u304C\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u7BC4\u56F2\u5916\u304B\u5B9A\u7FA9\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u540D\u524D= {0}"},
-
- { ER_AXES_NOT_ALLOWED,
- "\u4E00\u81F4\u30D1\u30BF\u30FC\u30F3\u3067\u306F\u3001child::\u8EF8\u3068attribute::\u8EF8\u306E\u307F\u304C\u8A31\u53EF\u3055\u308C\u307E\u3059\u3002\u554F\u984C\u3068\u306A\u308B\u8EF8= {0}"},
-
- { ER_KEY_HAS_TOO_MANY_ARGS,
- "key()\u304C\u6301\u3064\u5F15\u6570\u306E\u6570\u304C\u4E0D\u6B63\u3067\u3059\u3002"},
-
- { ER_COUNT_TAKES_1_ARG,
- "\u30AB\u30A6\u30F3\u30C8\u95A2\u6570\u306F\u5F15\u6570\u30921\u3064\u53D6\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002"},
-
- { ER_COULDNOT_FIND_FUNCTION,
- "\u95A2\u6570{0}\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F"},
-
- { ER_UNSUPPORTED_ENCODING,
- "\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u306A\u3044\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u3067\u3059: {0}"},
-
- { ER_PROBLEM_IN_DTM_NEXTSIBLING,
- "getNextSibling\u306EDTM\u3067\u554F\u984C\u304C\u767A\u751F\u3057\u307E\u3057\u305F...\u5FA9\u5143\u306E\u8A66\u884C\u4E2D\u3067\u3059"},
-
- { ER_CANNOT_WRITE_TO_EMPTYNODELISTIMPL,
- "\u30D7\u30ED\u30B0\u30E9\u30DE\u30FB\u30A8\u30E9\u30FC: EmptyNodeList\u306B\u66F8\u304D\u8FBC\u3081\u307E\u305B\u3093\u3002"},
-
- { ER_SETDOMFACTORY_NOT_SUPPORTED,
- "setDOMFactory\u306FXPathContext\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"},
-
- { ER_PREFIX_MUST_RESOLVE,
- "\u63A5\u982D\u8F9E\u306F\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u306B\u89E3\u6C7A\u3055\u308C\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059: {0}"},
-
- { ER_PARSE_NOT_SUPPORTED,
- "\u89E3\u6790(InputSource\u30BD\u30FC\u30B9)\u306FXPathContext\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002{0}\u3092\u958B\u3051\u307E\u305B\u3093"},
-
- { ER_SAX_API_NOT_HANDLED,
- "SAX API characters(char ch[]...\u306FDTM\u306B\u3088\u3063\u3066\u51E6\u7406\u3055\u308C\u307E\u305B\u3093\u3002"},
-
- { ER_IGNORABLE_WHITESPACE_NOT_HANDLED,
- "ignorableWhitespace(char ch[]...\u306FDTM\u306B\u3088\u3063\u3066\u51E6\u7406\u3055\u308C\u307E\u305B\u3093\u3002"},
-
- { ER_DTM_CANNOT_HANDLE_NODES,
- "DTMLiaison\u306F\u30BF\u30A4\u30D7{0}\u306E\u30CE\u30FC\u30C9\u3092\u51E6\u7406\u3067\u304D\u307E\u305B\u3093"},
-
- { ER_XERCES_CANNOT_HANDLE_NODES,
- "DOM2Helper\u306F{0}\u30BF\u30A4\u30D7\u306E\u30CE\u30FC\u30C9\u3092\u51E6\u7406\u3067\u304D\u307E\u305B\u3093"},
-
- { ER_XERCES_PARSE_ERROR_DETAILS,
- "DOM2Helper.parse\u30A8\u30E9\u30FC: SystemID - {0} \u884C - {1}"},
-
- { ER_XERCES_PARSE_ERROR,
- "DOM2Helper.parse\u30A8\u30E9\u30FC"},
-
- { ER_INVALID_UTF16_SURROGATE,
- "\u7121\u52B9\u306AUTF-16\u30B5\u30ED\u30B2\u30FC\u30C8\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F: {0}\u3002"},
-
- { ER_OIERROR,
- "IO\u30A8\u30E9\u30FC"},
-
- { ER_CANNOT_CREATE_URL,
- "{0}\u306EURL\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093"},
-
- { ER_XPATH_READOBJECT,
- "XPath.readObject\u5185: {0}"},
-
- { ER_FUNCTION_TOKEN_NOT_FOUND,
- "\u95A2\u6570\u30C8\u30FC\u30AF\u30F3\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002"},
-
- { ER_CANNOT_DEAL_XPATH_TYPE,
- "XPath\u30BF\u30A4\u30D7\u3092\u51E6\u7406\u3067\u304D\u307E\u305B\u3093: {0}"},
-
- { ER_NODESET_NOT_MUTABLE,
- "\u3053\u306ENodeSet\u306F\u53EF\u5909\u3067\u306F\u3042\u308A\u307E\u305B\u3093"},
-
- { ER_NODESETDTM_NOT_MUTABLE,
- "\u3053\u306ENodeSetDTM\u306F\u53EF\u5909\u3067\u306F\u3042\u308A\u307E\u305B\u3093"},
-
- { ER_VAR_NOT_RESOLVABLE,
- "\u5909\u6570\u3092\u89E3\u6C7A\u3067\u304D\u307E\u305B\u3093: {0}"},
-
- { ER_NULL_ERROR_HANDLER,
- "Null\u306E\u30A8\u30E9\u30FC\u30FB\u30CF\u30F3\u30C9\u30E9"},
-
- { ER_PROG_ASSERT_UNKNOWN_OPCODE,
- "\u30D7\u30ED\u30B0\u30E9\u30DE\u306E\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3: \u4E0D\u660E\u306Aopcode: {0}"},
-
- { ER_ZERO_OR_ONE,
- "0\u307E\u305F\u306F1"},
-
- { ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "rtf()\u306FXRTreeFragSelectWrapper\u306B\u3088\u3063\u3066\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093"},
-
- { ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "asNodeIterator()\u306FXRTreeFragSelectWrapper\u306B\u3088\u3063\u3066\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093"},
-
- /** detach() not supported by XRTreeFragSelectWrapper */
- { ER_DETACH_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "detach()\u306FXRTreeFragSelectWrapper\u306B\u3088\u3063\u3066\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093"},
-
- /** num() not supported by XRTreeFragSelectWrapper */
- { ER_NUM_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "num()\u306FXRTreeFragSelectWrapper\u306B\u3088\u3063\u3066\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093"},
-
- /** xstr() not supported by XRTreeFragSelectWrapper */
- { ER_XSTR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "xstr()\u306FXRTreeFragSelectWrapper\u306B\u3088\u3063\u3066\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093"},
-
- /** str() not supported by XRTreeFragSelectWrapper */
- { ER_STR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "str()\u306FXRTreeFragSelectWrapper\u306B\u3088\u3063\u3066\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093"},
-
- { ER_FSB_NOT_SUPPORTED_XSTRINGFORCHARS,
- "fsb()\u306FXStringForChars\u7528\u306B\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093"},
-
- { ER_COULD_NOT_FIND_VAR,
- "\u540D\u524D{0}\u306E\u5909\u6570\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F"},
-
- { ER_XSTRINGFORCHARS_CANNOT_TAKE_STRING,
- "XStringForChars\u306F\u5F15\u6570\u306B\u3064\u3044\u3066\u6587\u5B57\u5217\u3092\u53D6\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u305B\u3093"},
-
- { ER_FASTSTRINGBUFFER_CANNOT_BE_NULL,
- "FastStringBuffer\u5F15\u6570\u306Fnull\u306B\u3067\u304D\u307E\u305B\u3093"},
-
- { ER_TWO_OR_THREE,
- "2\u307E\u305F\u306F3"},
-
- { ER_VARIABLE_ACCESSED_BEFORE_BIND,
- "\u5909\u6570\u304C\u30D0\u30A4\u30F3\u30C9\u3055\u308C\u308B\u524D\u306B\u30A2\u30AF\u30BB\u30B9\u3055\u308C\u307E\u3057\u305F\u3002"},
-
- { ER_FSB_CANNOT_TAKE_STRING,
- "XStringForFSB\u306F\u5F15\u6570\u306B\u3064\u3044\u3066\u6587\u5B57\u5217\u3092\u53D6\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u305B\u3093\u3002"},
-
- { ER_SETTING_WALKER_ROOT_TO_NULL,
- "\n \u30A8\u30E9\u30FC\u3002\u30A6\u30A9\u30FC\u30AB\u306E\u30EB\u30FC\u30C8\u3092null\u306B\u8A2D\u5B9A\u3057\u3066\u3044\u307E\u3059\u3002"},
-
- { ER_NODESETDTM_CANNOT_ITERATE,
- "\u3053\u306ENodeSetDTM\u306F\u524D\u306E\u30CE\u30FC\u30C9\u3092\u53CD\u5FA9\u3067\u304D\u307E\u305B\u3093\u3002"},
-
- { ER_NODESET_CANNOT_ITERATE,
- "\u3053\u306ENodeSet\u306F\u524D\u306E\u30CE\u30FC\u30C9\u3092\u53CD\u5FA9\u3067\u304D\u307E\u305B\u3093\u3002"},
-
- { ER_NODESETDTM_CANNOT_INDEX,
- "\u3053\u306ENodeSetDTM\u306F\u7D22\u5F15\u4ED8\u3051\u307E\u305F\u306F\u30AB\u30A6\u30F3\u30C8\u6A5F\u80FD\u3092\u5B9F\u884C\u3067\u304D\u307E\u305B\u3093\u3002"},
-
- { ER_NODESET_CANNOT_INDEX,
- "\u3053\u306ENodeSet\u306F\u7D22\u5F15\u4ED8\u3051\u307E\u305F\u306F\u30AB\u30A6\u30F3\u30C8\u6A5F\u80FD\u3092\u5B9F\u884C\u3067\u304D\u307E\u305B\u3093\u3002"},
-
- { ER_CANNOT_CALL_SETSHOULDCACHENODE,
- "nextNode\u3092\u547C\u3073\u51FA\u3057\u305F\u5F8C\u306BsetShouldCacheNodes\u3092\u547C\u3073\u51FA\u305B\u307E\u305B\u3093\u3002"},
-
- { ER_ONLY_ALLOWS,
- "{0}\u306F{1}\u500B\u306E\u5F15\u6570\u306E\u307F\u8A31\u53EF\u3057\u307E\u3059"},
-
- { ER_UNKNOWN_STEP,
- "getNextStepPos\u3067\u306E\u30D7\u30ED\u30B0\u30E9\u30DE\u306E\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3: \u4E0D\u660E\u306AstepType: {0}"},
-
- //Note to translators: A relative location path is a form of XPath expression.
- // The message indicates that such an expression was expected following the
- // characters '/' or '//', but was not found.
- { ER_EXPECTED_REL_LOC_PATH,
- "'/'\u307E\u305F\u306F'//'\u30C8\u30FC\u30AF\u30F3\u306E\u5F8C\u306B\u76F8\u5BFE\u30ED\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30D1\u30B9\u304C\u5FC5\u8981\u3067\u3059\u3002"},
-
- // Note to translators: A location path is a form of XPath expression.
- // The message indicates that syntactically such an expression was expected,but
- // the characters specified by the substitution text were encountered instead.
- { ER_EXPECTED_LOC_PATH,
- "\u30ED\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30D1\u30B9\u304C\u5FC5\u8981\u3067\u3059\u304C\u3001\u6B21\u306E\u30C8\u30FC\u30AF\u30F3\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F: {0}"},
-
- // Note to translators: A location path is a form of XPath expression.
- // The message indicates that syntactically such a subexpression was expected,
- // but no more characters were found in the expression.
- { ER_EXPECTED_LOC_PATH_AT_END_EXPR,
- "\u30ED\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30D1\u30B9\u304C\u5FC5\u8981\u3067\u3059\u304C\u3001\u304B\u308F\u308A\u306BXPath\u5F0F\u306E\u7D42\u308F\u308A\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F\u3002"},
-
- // Note to translators: A location step is part of an XPath expression.
- // The message indicates that syntactically such an expression was expected
- // following the specified characters.
- { ER_EXPECTED_LOC_STEP,
- "'/'\u307E\u305F\u306F'//'\u30C8\u30FC\u30AF\u30F3\u306E\u5F8C\u306B\u30ED\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30B9\u30C6\u30C3\u30D7\u304C\u5FC5\u8981\u3067\u3059\u3002"},
-
- // Note to translators: A node test is part of an XPath expression that is
- // used to test for particular kinds of nodes. In this case, a node test that
- // consists of an NCName followed by a colon and an asterisk or that consists
- // of a QName was expected, but was not found.
- { ER_EXPECTED_NODE_TEST,
- "NCName:*\u307E\u305F\u306FQName\u306B\u4E00\u81F4\u3059\u308B\u30CE\u30FC\u30C9\u30FB\u30C6\u30B9\u30C8\u304C\u3042\u308A\u307E\u305B\u3093\u3002"},
-
- // Note to translators: A step pattern is part of an XPath expression.
- // The message indicates that syntactically such an expression was expected,
- // but the specified character was found in the expression instead.
- { ER_EXPECTED_STEP_PATTERN,
- "\u30B9\u30C6\u30C3\u30D7\u30FB\u30D1\u30BF\u30FC\u30F3\u304C\u5FC5\u8981\u3067\u3059\u304C\u3001'/'\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F\u3002"},
-
- // Note to translators: A relative path pattern is part of an XPath expression.
- // The message indicates that syntactically such an expression was expected,
- // but was not found.
- { ER_EXPECTED_REL_PATH_PATTERN,
- "\u76F8\u5BFE\u30D1\u30B9\u30FB\u30D1\u30BF\u30FC\u30F3\u304C\u3042\u308A\u307E\u305B\u3093\u3002"},
-
- // Note to translators: The substitution text is the name of a data type. The
- // message indicates that a value of a particular type could not be converted
- // to a value of type boolean.
- { ER_CANT_CONVERT_TO_BOOLEAN,
- "XPath\u5F0F''{0}''\u306EXPathResult\u306F\u3001boolean\u306B\u5909\u63DB\u3067\u304D\u306A\u3044{1}\u306EXPathResultType\u3067\u3059\u3002"},
-
- // Note to translators: Do not translate ANY_UNORDERED_NODE_TYPE and
- // FIRST_ORDERED_NODE_TYPE.
- { ER_CANT_CONVERT_TO_SINGLENODE,
- "XPath\u5F0F''{0}''\u306EXPathResult\u306F\u3001\u5358\u4E00\u30CE\u30FC\u30C9\u306B\u5909\u63DB\u3067\u304D\u306A\u3044{1}\u306EXPathResultType\u3067\u3059\u3002\u30E1\u30BD\u30C3\u30C9getSingleNodeValue\u306F\u3001ANY_UNORDERED_NODE_TYPE\u30BF\u30A4\u30D7\u304A\u3088\u3073FIRST_ORDERED_NODE_TYPE\u30BF\u30A4\u30D7\u306B\u306E\u307F\u9069\u7528\u3055\u308C\u307E\u3059\u3002"},
-
- // Note to translators: Do not translate UNORDERED_NODE_SNAPSHOT_TYPE and
- // ORDERED_NODE_SNAPSHOT_TYPE.
- { ER_CANT_GET_SNAPSHOT_LENGTH,
- "XPathResultType\u304C{1}\u306E\u305F\u3081\u3001\u30E1\u30BD\u30C3\u30C9getSnapshotLength\u306FXPath\u5F0F''{0}''\u306EXPathResult\u3067\u547C\u3073\u51FA\u3059\u3053\u3068\u304C\u3067\u304D\u307E\u305B\u3093\u3002\u3053\u306E\u30E1\u30BD\u30C3\u30C9\u306F\u3001UNORDERED_NODE_SNAPSHOT_TYPE\u30BF\u30A4\u30D7\u304A\u3088\u3073ORDERED_NODE_SNAPSHOT_TYPE\u30BF\u30A4\u30D7\u306B\u306E\u307F\u9069\u7528\u3055\u308C\u307E\u3059\u3002"},
-
- { ER_NON_ITERATOR_TYPE,
- "XPathResultType\u304C{1}\u306E\u305F\u3081\u3001\u30E1\u30BD\u30C3\u30C9iterateNext\u306FXPath\u5F0F''{0}''\u306EXPathResult\u3067\u547C\u3073\u51FA\u3059\u3053\u3068\u304C\u3067\u304D\u307E\u305B\u3093\u3002\u3053\u306E\u30E1\u30BD\u30C3\u30C9\u306F\u3001UNORDERED_NODE_ITERATOR_TYPE\u30BF\u30A4\u30D7\u304A\u3088\u3073ORDERED_NODE_ITERATOR_TYPE\u30BF\u30A4\u30D7\u306B\u306E\u307F\u9069\u7528\u3055\u308C\u307E\u3059\u3002"},
-
- // Note to translators: This message indicates that the document being operated
- // upon changed, so the iterator object that was being used to traverse the
- // document has now become invalid.
- { ER_DOC_MUTATED,
- "\u7D50\u679C\u304C\u8FD4\u3055\u308C\u305F\u5F8C\u306B\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u304C\u5909\u66F4\u3055\u308C\u307E\u3057\u305F\u3002\u30A4\u30C6\u30EC\u30FC\u30BF\u304C\u7121\u52B9\u3067\u3059\u3002"},
-
- { ER_INVALID_XPATH_TYPE,
- "XPath\u30BF\u30A4\u30D7\u306E\u5F15\u6570{0}\u304C\u7121\u52B9\u3067\u3059"},
-
- { ER_EMPTY_XPATH_RESULT,
- "XPath\u7D50\u679C\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u304C\u7A7A\u3067\u3059"},
-
- { ER_INCOMPATIBLE_TYPES,
- "XPath\u5F0F''{0}''\u306EXPathResult\u306F\u3001{2}\u306E\u6307\u5B9A\u3055\u308C\u305FXPathResultType\u306B\u5F37\u5236\u5909\u63DB\u3067\u304D\u306A\u3044{1}\u306EXPathResultType\u3092\u6301\u3061\u307E\u3059\u3002"},
-
- { ER_NULL_RESOLVER,
- "null\u63A5\u982D\u8F9E\u30EA\u30BE\u30EB\u30D0\u3067\u63A5\u982D\u8F9E\u3092\u89E3\u6C7A\u3067\u304D\u307E\u305B\u3093\u3002"},
-
- // Note to translators: The substitution text is the name of a data type. The
- // message indicates that a value of a particular type could not be converted
- // to a value of type string.
- { ER_CANT_CONVERT_TO_STRING,
- "XPath\u5F0F''{0}''\u306EXPathResult\u306F\u3001\u6587\u5B57\u5217\u306B\u5909\u63DB\u3067\u304D\u306A\u3044{1}\u306EXPathResultType\u3092\u6301\u3061\u307E\u3059\u3002"},
-
- // Note to translators: Do not translate snapshotItem,
- // UNORDERED_NODE_SNAPSHOT_TYPE and ORDERED_NODE_SNAPSHOT_TYPE.
- { ER_NON_SNAPSHOT_TYPE,
- "XPathResultType\u304C{1}\u306E\u305F\u3081\u3001\u30E1\u30BD\u30C3\u30C9snapshotItem\u306FXPath\u5F0F''{0}''\u306EXPathResult\u3067\u547C\u3073\u51FA\u3059\u3053\u3068\u304C\u3067\u304D\u307E\u305B\u3093\u3002\u3053\u306E\u30E1\u30BD\u30C3\u30C9\u306F\u3001UNORDERED_NODE_SNAPSHOT_TYPE\u30BF\u30A4\u30D7\u304A\u3088\u3073ORDERED_NODE_SNAPSHOT_TYPE\u30BF\u30A4\u30D7\u306B\u306E\u307F\u9069\u7528\u3055\u308C\u307E\u3059\u3002"},
-
- // Note to translators: XPathEvaluator is a Java interface name. An
- // XPathEvaluator is created with respect to a particular XML document, and in
- // this case the expression represented by this object was being evaluated with
- // respect to a context node from a different document.
- { ER_WRONG_DOCUMENT,
- "\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30FB\u30CE\u30FC\u30C9\u306F\u3001\u3053\u306EXPathEvaluator\u306B\u30D0\u30A4\u30F3\u30C9\u3055\u308C\u305F\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306B\u5C5E\u3057\u307E\u305B\u3093\u3002"},
-
- // Note to translators: The XPath expression cannot be evaluated with respect
- // to this type of node.
- { ER_WRONG_NODETYPE,
- "\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30FB\u30CE\u30FC\u30C9\u30FB\u30BF\u30A4\u30D7\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"},
-
- { ER_XPATH_ERROR,
- "XPath\u306B\u4E0D\u660E\u306A\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002"},
-
- { ER_CANT_CONVERT_XPATHRESULTTYPE_TO_NUMBER,
- "XPath\u5F0F''{0}''\u306EXPathResult\u306F\u3001\u6570\u5024\u306B\u5909\u63DB\u3067\u304D\u306A\u3044{1}\u306EXPathResultType\u3092\u6301\u3061\u307E\u3059"},
-
- //BEGIN: Definitions of error keys used in exception messages of JAXP 1.3 XPath API implementation
-
- /** Field ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED */
-
- { ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED,
- "\u62E1\u5F35\u95A2\u6570: XMLConstants.FEATURE_SECURE_PROCESSING\u6A5F\u80FD\u304Ctrue\u306B\u8A2D\u5B9A\u3055\u308C\u308B\u3068''{0}''\u3092\u8D77\u52D5\u3067\u304D\u307E\u305B\u3093\u3002"},
-
- /** Field ER_RESOLVE_VARIABLE_RETURNS_NULL */
-
- { ER_RESOLVE_VARIABLE_RETURNS_NULL,
- "\u5909\u6570{0}\u306EresolveVariable\u304Cnull\u3092\u8FD4\u3057\u3066\u3044\u307E\u3059"},
-
- /** Field ER_UNSUPPORTED_RETURN_TYPE */
-
- { ER_UNSUPPORTED_RETURN_TYPE,
- "\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u306A\u3044\u623B\u308A\u578B: {0}"},
-
- /** Field ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL */
-
- { ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL,
- "\u30BD\u30FC\u30B9\u30FB\u30BF\u30A4\u30D7\u307E\u305F\u306F\u623B\u308A\u578B\u306Fnull\u306B\u3067\u304D\u307E\u305B\u3093"},
-
- /** Field ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL */
-
- { ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL,
- "\u30BD\u30FC\u30B9\u30FB\u30BF\u30A4\u30D7\u307E\u305F\u306F\u623B\u308A\u578B\u306Fnull\u306B\u3067\u304D\u307E\u305B\u3093"},
-
- /** Field ER_ARG_CANNOT_BE_NULL */
-
- { ER_ARG_CANNOT_BE_NULL,
- "{0}\u5F15\u6570\u306Fnull\u306B\u3067\u304D\u307E\u305B\u3093"},
-
- /** Field ER_OBJECT_MODEL_NULL */
-
- { ER_OBJECT_MODEL_NULL,
- "{0}#isObjectModelSupported( String objectModel )\u306FobjectModel == null\u3067\u547C\u3073\u51FA\u305B\u307E\u305B\u3093"},
-
- /** Field ER_OBJECT_MODEL_EMPTY */
-
- { ER_OBJECT_MODEL_EMPTY,
- "{0}#isObjectModelSupported( String objectModel )\u306FobjectModel == \"\"\u3067\u547C\u3073\u51FA\u305B\u307E\u305B\u3093"},
-
- /** Field ER_OBJECT_MODEL_EMPTY */
-
- { ER_FEATURE_NAME_NULL,
- "\u6A5F\u80FD\u306Bnull\u306E\u540D\u524D\u3092\u8A2D\u5B9A\u3057\u3088\u3046\u3068\u3057\u307E\u3057\u305F: {0}#setFeature( null, {1})"},
-
- /** Field ER_FEATURE_UNKNOWN */
-
- { ER_FEATURE_UNKNOWN,
- "\u4E0D\u660E\u306A\u6A5F\u80FD\"{0}\"\u3092\u8A2D\u5B9A\u3057\u3088\u3046\u3068\u3057\u307E\u3057\u305F: {1}#setFeature({0},{2})"},
-
- /** Field ER_GETTING_NULL_FEATURE */
-
- { ER_GETTING_NULL_FEATURE,
- "null\u540D\u306E\u6A5F\u80FD\u3092\u53D6\u5F97\u3057\u3088\u3046\u3068\u3057\u307E\u3057\u305F: {0}#getFeature(null)"},
-
- /** Field ER_GETTING_NULL_FEATURE */
-
- { ER_GETTING_UNKNOWN_FEATURE,
- "\u4E0D\u660E\u306A\u6A5F\u80FD\"{0}\"\u3092\u53D6\u5F97\u3057\u3088\u3046\u3068\u3057\u307E\u3057\u305F: {1}#getFeature({0})"},
-
- {ER_SECUREPROCESSING_FEATURE,
- "FEATURE_SECURE_PROCESSING: \u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u30FB\u30DE\u30CD\u30FC\u30B8\u30E3\u304C\u5B58\u5728\u3059\u308B\u3068\u304D\u3001\u6A5F\u80FD\u3092false\u306B\u8A2D\u5B9A\u3067\u304D\u307E\u305B\u3093: {1}#setFeature({0},{2})"},
-
- /** Field ER_NULL_XPATH_FUNCTION_RESOLVER */
-
- { ER_NULL_XPATH_FUNCTION_RESOLVER,
- "null\u306EXPathFunctionResolver\u3092\u8A2D\u5B9A\u3057\u3088\u3046\u3068\u3057\u307E\u3057\u305F: {0}#setXPathFunctionResolver(null)"},
-
- /** Field ER_NULL_XPATH_VARIABLE_RESOLVER */
-
- { ER_NULL_XPATH_VARIABLE_RESOLVER,
- "null\u306EXPathVariableResolver\u3092\u8A2D\u5B9A\u3057\u3088\u3046\u3068\u3057\u307E\u3057\u305F: {0}#setXPathVariableResolver(null)"},
-
- //END: Definitions of error keys used in exception messages of JAXP 1.3 XPath API implementation
-
- // Warnings...
-
- { WG_LOCALE_NAME_NOT_HANDLED,
- "format-number\u95A2\u6570\u306E\u30ED\u30B1\u30FC\u30EB\u540D\u304C\u672A\u51E6\u7406\u3067\u3059\u3002"},
-
- { WG_PROPERTY_NOT_SUPPORTED,
- "XSL\u30D7\u30ED\u30D1\u30C6\u30A3\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093: {0}"},
-
- { WG_DONT_DO_ANYTHING_WITH_NS,
- "\u30D7\u30ED\u30D1\u30C6\u30A3{1}\u5185\u306E\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9{0}\u3067\u306F\u73FE\u5728\u4F55\u3082\u5B9F\u884C\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044"},
-
- { WG_SECURITY_EXCEPTION,
- "XSL\u30B7\u30B9\u30C6\u30E0\u30FB\u30D7\u30ED\u30D1\u30C6\u30A3{0}\u306B\u30A2\u30AF\u30BB\u30B9\u3057\u3088\u3046\u3068\u3057\u305F\u3068\u304D\u306BSecurityException\u304C\u767A\u751F\u3057\u307E\u3057\u305F"},
-
- { WG_QUO_NO_LONGER_DEFINED,
- "\u53E4\u3044\u69CB\u6587: quo(...)\u306FXPath\u3067\u306F\u73FE\u5728\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"},
-
- { WG_NEED_DERIVED_OBJECT_TO_IMPLEMENT_NODETEST,
- "XPath\u306B\u306FnodeTest\u3092\u5B9F\u88C5\u3059\u308B\u305F\u3081\u306E\u5C0E\u51FA\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u304C\u5FC5\u8981\u3067\u3059\u3002"},
-
- { WG_FUNCTION_TOKEN_NOT_FOUND,
- "\u95A2\u6570\u30C8\u30FC\u30AF\u30F3\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002"},
-
- { WG_COULDNOT_FIND_FUNCTION,
- "\u95A2\u6570{0}\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F"},
-
- { WG_CANNOT_MAKE_URL_FROM,
- "{0}\u304B\u3089URL\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093"},
-
- { WG_EXPAND_ENTITIES_NOT_SUPPORTED,
- "-E\u30AA\u30D7\u30B7\u30E7\u30F3\u306FDTM\u30D1\u30FC\u30B5\u30FC\u3067\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093"},
-
- { WG_ILLEGAL_VARIABLE_REFERENCE,
- "\u5909\u6570\u306B\u6307\u5B9A\u3057\u305FVariableReference\u304C\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u7BC4\u56F2\u5916\u304B\u5B9A\u7FA9\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u540D\u524D= {0}"},
-
- { WG_UNSUPPORTED_ENCODING,
- "\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u306A\u3044\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u3067\u3059: {0}"},
-
-
-
- // Other miscellaneous text used inside the code...
- { "ui_language", "ja"},
- { "help_language", "ja"},
- { "language", "ja"},
- { "BAD_CODE", "createMessage\u306E\u30D1\u30E9\u30E1\u30FC\u30BF\u304C\u7BC4\u56F2\u5916\u3067\u3059"},
- { "FORMAT_FAILED", "messageFormat\u306E\u547C\u51FA\u3057\u4E2D\u306B\u4F8B\u5916\u304C\u30B9\u30ED\u30FC\u3055\u308C\u307E\u3057\u305F"},
- { "version", ">>>>>>> Xalan\u30D0\u30FC\u30B8\u30E7\u30F3 "},
- { "version2", "<<<<<<<"},
- { "yes", "yes"},
- { "line", "\u884C\u756A\u53F7"},
- { "column", "\u5217\u756A\u53F7"},
- { "xsldone", "XSLProcessor: \u5B8C\u4E86\u3057\u307E\u3057\u305F"},
- { "xpath_option", "xpath\u30AA\u30D7\u30B7\u30E7\u30F3: "},
- { "optionIN", " [-in inputXMLURL]"},
- { "optionSelect", " [-select xpath expression]"},
- { "optionMatch", " [-match match pattern (\u4E00\u81F4\u8A3A\u65AD\u7528)]"},
- { "optionAnyExpr", "\u307E\u305F\u306F\u3001xpath\u5F0F\u304C\u8A3A\u65AD\u30C0\u30F3\u30D7\u3092\u5B9F\u884C\u3057\u307E\u3059"},
- { "noParsermsg1", "XSL\u30D7\u30ED\u30BB\u30B9\u306F\u6210\u529F\u3057\u307E\u305B\u3093\u3067\u3057\u305F\u3002"},
- { "noParsermsg2", "** \u30D1\u30FC\u30B5\u30FC\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F **"},
- { "noParsermsg3", "\u30AF\u30E9\u30B9\u30D1\u30B9\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},
- { "noParsermsg4", "IBM\u306EJava\u7528XML\u30D1\u30FC\u30B5\u30FC\u304C\u306A\u3044\u5834\u5408\u3001\u6B21\u306E\u30B5\u30A4\u30C8\u304B\u3089\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u3067\u304D\u307E\u3059"},
- { "noParsermsg5", "IBM\u306EAlphaWorks: http://www.alphaworks.ibm.com/formula/xml"},
- { "gtone", ">1" },
- { "zero", "0" },
- { "one", "1" },
- { "two" , "2" },
- { "three", "3" }
-
- };
-
- /**
- * Get the association list.
- *
- * @return The association list.
- */
- public Object[][] getContents()
- {
- return _contents;
- }
-
-
- // ================= INFRASTRUCTURE ======================
-
- /** Field BAD_CODE */
- public static final String BAD_CODE = "BAD_CODE";
-
- /** Field FORMAT_FAILED */
- public static final String FORMAT_FAILED = "FORMAT_FAILED";
-
- /** Field ERROR_RESOURCES */
- public static final String ERROR_RESOURCES =
- "com.sun.org.apache.xpath.internal.res.XPATHErrorResources";
-
- /** Field ERROR_STRING */
- public static final String ERROR_STRING = "#error";
-
- /** Field ERROR_HEADER */
- public static final String ERROR_HEADER = "Error: ";
-
- /** Field WARNING_HEADER */
- public static final String WARNING_HEADER = "Warning: ";
-
- /** Field XSL_HEADER */
- public static final String XSL_HEADER = "XSL ";
-
- /** Field XML_HEADER */
- public static final String XML_HEADER = "XML ";
-
- /** Field QUERY_HEADER */
- public static final String QUERY_HEADER = "PATTERN ";
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_ko.java b/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_ko.java
deleted file mode 100644
index 9c8a7df..0000000
--- a/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_ko.java
+++ /dev/null
@@ -1,936 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xpath.internal.res;
-
-import java.util.ListResourceBundle;
-
-/**
- * Set up error messages.
- * We build a two dimensional array of message keys and
- * message strings. In order to add a new message here,
- * you need to first add a Static string constant for the
- * Key and update the contents array with Key, Value pair
- * Also you need to update the count of messages(MAX_CODE)or
- * the count of warnings(MAX_WARNING) [ Information purpose only]
- * @xsl.usage advanced
- */
-public class XPATHErrorResources_ko extends ListResourceBundle
-{
-
-/*
- * General notes to translators:
- *
- * This file contains error and warning messages related to XPath Error
- * Handling.
- *
- * 1) Xalan (or more properly, Xalan-interpretive) and XSLTC are names of
- * components.
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- * XSLTC is an acronym for XSLT Compiler.
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 5) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 6) "Translet" is an invented term that describes the class file that
- * results from compiling an XML stylesheet into a Java class.
- *
- * 7) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- * 8) The context node is the node in the document with respect to which an
- * XPath expression is being evaluated.
- *
- * 9) An iterator is an object that traverses nodes in the tree, one at a time.
- *
- * 10) NCName is an XML term used to describe a name that does not contain a
- * colon (a "no-colon name").
- *
- * 11) QName is an XML term meaning "qualified name".
- */
-
- /*
- * static variables
- */
- public static final String ERROR0000 = "ERROR0000";
- public static final String ER_CURRENT_NOT_ALLOWED_IN_MATCH =
- "ER_CURRENT_NOT_ALLOWED_IN_MATCH";
- public static final String ER_CURRENT_TAKES_NO_ARGS =
- "ER_CURRENT_TAKES_NO_ARGS";
- public static final String ER_DOCUMENT_REPLACED = "ER_DOCUMENT_REPLACED";
- public static final String ER_CONTEXT_HAS_NO_OWNERDOC =
- "ER_CONTEXT_HAS_NO_OWNERDOC";
- public static final String ER_LOCALNAME_HAS_TOO_MANY_ARGS =
- "ER_LOCALNAME_HAS_TOO_MANY_ARGS";
- public static final String ER_NAMESPACEURI_HAS_TOO_MANY_ARGS =
- "ER_NAMESPACEURI_HAS_TOO_MANY_ARGS";
- public static final String ER_NORMALIZESPACE_HAS_TOO_MANY_ARGS =
- "ER_NORMALIZESPACE_HAS_TOO_MANY_ARGS";
- public static final String ER_NUMBER_HAS_TOO_MANY_ARGS =
- "ER_NUMBER_HAS_TOO_MANY_ARGS";
- public static final String ER_NAME_HAS_TOO_MANY_ARGS =
- "ER_NAME_HAS_TOO_MANY_ARGS";
- public static final String ER_STRING_HAS_TOO_MANY_ARGS =
- "ER_STRING_HAS_TOO_MANY_ARGS";
- public static final String ER_STRINGLENGTH_HAS_TOO_MANY_ARGS =
- "ER_STRINGLENGTH_HAS_TOO_MANY_ARGS";
- public static final String ER_TRANSLATE_TAKES_3_ARGS =
- "ER_TRANSLATE_TAKES_3_ARGS";
- public static final String ER_UNPARSEDENTITYURI_TAKES_1_ARG =
- "ER_UNPARSEDENTITYURI_TAKES_1_ARG";
- public static final String ER_NAMESPACEAXIS_NOT_IMPLEMENTED =
- "ER_NAMESPACEAXIS_NOT_IMPLEMENTED";
- public static final String ER_UNKNOWN_AXIS = "ER_UNKNOWN_AXIS";
- public static final String ER_UNKNOWN_MATCH_OPERATION =
- "ER_UNKNOWN_MATCH_OPERATION";
- public static final String ER_INCORRECT_ARG_LENGTH ="ER_INCORRECT_ARG_LENGTH";
- public static final String ER_CANT_CONVERT_TO_NUMBER =
- "ER_CANT_CONVERT_TO_NUMBER";
- public static final String ER_CANT_CONVERT_XPATHRESULTTYPE_TO_NUMBER =
- "ER_CANT_CONVERT_XPATHRESULTTYPE_TO_NUMBER";
- public static final String ER_CANT_CONVERT_TO_NODELIST =
- "ER_CANT_CONVERT_TO_NODELIST";
- public static final String ER_CANT_CONVERT_TO_MUTABLENODELIST =
- "ER_CANT_CONVERT_TO_MUTABLENODELIST";
- public static final String ER_CANT_CONVERT_TO_TYPE ="ER_CANT_CONVERT_TO_TYPE";
- public static final String ER_EXPECTED_MATCH_PATTERN =
- "ER_EXPECTED_MATCH_PATTERN";
- public static final String ER_COULDNOT_GET_VAR_NAMED =
- "ER_COULDNOT_GET_VAR_NAMED";
- public static final String ER_UNKNOWN_OPCODE = "ER_UNKNOWN_OPCODE";
- public static final String ER_EXTRA_ILLEGAL_TOKENS ="ER_EXTRA_ILLEGAL_TOKENS";
- public static final String ER_EXPECTED_DOUBLE_QUOTE =
- "ER_EXPECTED_DOUBLE_QUOTE";
- public static final String ER_EXPECTED_SINGLE_QUOTE =
- "ER_EXPECTED_SINGLE_QUOTE";
- public static final String ER_EMPTY_EXPRESSION = "ER_EMPTY_EXPRESSION";
- public static final String ER_EXPECTED_BUT_FOUND = "ER_EXPECTED_BUT_FOUND";
- public static final String ER_INCORRECT_PROGRAMMER_ASSERTION =
- "ER_INCORRECT_PROGRAMMER_ASSERTION";
- public static final String ER_BOOLEAN_ARG_NO_LONGER_OPTIONAL =
- "ER_BOOLEAN_ARG_NO_LONGER_OPTIONAL";
- public static final String ER_FOUND_COMMA_BUT_NO_PRECEDING_ARG =
- "ER_FOUND_COMMA_BUT_NO_PRECEDING_ARG";
- public static final String ER_FOUND_COMMA_BUT_NO_FOLLOWING_ARG =
- "ER_FOUND_COMMA_BUT_NO_FOLLOWING_ARG";
- public static final String ER_PREDICATE_ILLEGAL_SYNTAX =
- "ER_PREDICATE_ILLEGAL_SYNTAX";
- public static final String ER_ILLEGAL_AXIS_NAME = "ER_ILLEGAL_AXIS_NAME";
- public static final String ER_UNKNOWN_NODETYPE = "ER_UNKNOWN_NODETYPE";
- public static final String ER_PATTERN_LITERAL_NEEDS_BE_QUOTED =
- "ER_PATTERN_LITERAL_NEEDS_BE_QUOTED";
- public static final String ER_COULDNOT_BE_FORMATTED_TO_NUMBER =
- "ER_COULDNOT_BE_FORMATTED_TO_NUMBER";
- public static final String ER_COULDNOT_CREATE_XMLPROCESSORLIAISON =
- "ER_COULDNOT_CREATE_XMLPROCESSORLIAISON";
- public static final String ER_DIDNOT_FIND_XPATH_SELECT_EXP =
- "ER_DIDNOT_FIND_XPATH_SELECT_EXP";
- public static final String ER_COULDNOT_FIND_ENDOP_AFTER_OPLOCATIONPATH =
- "ER_COULDNOT_FIND_ENDOP_AFTER_OPLOCATIONPATH";
- public static final String ER_ERROR_OCCURED = "ER_ERROR_OCCURED";
- public static final String ER_ILLEGAL_VARIABLE_REFERENCE =
- "ER_ILLEGAL_VARIABLE_REFERENCE";
- public static final String ER_AXES_NOT_ALLOWED = "ER_AXES_NOT_ALLOWED";
- public static final String ER_KEY_HAS_TOO_MANY_ARGS =
- "ER_KEY_HAS_TOO_MANY_ARGS";
- public static final String ER_COUNT_TAKES_1_ARG = "ER_COUNT_TAKES_1_ARG";
- public static final String ER_COULDNOT_FIND_FUNCTION =
- "ER_COULDNOT_FIND_FUNCTION";
- public static final String ER_UNSUPPORTED_ENCODING ="ER_UNSUPPORTED_ENCODING";
- public static final String ER_PROBLEM_IN_DTM_NEXTSIBLING =
- "ER_PROBLEM_IN_DTM_NEXTSIBLING";
- public static final String ER_CANNOT_WRITE_TO_EMPTYNODELISTIMPL =
- "ER_CANNOT_WRITE_TO_EMPTYNODELISTIMPL";
- public static final String ER_SETDOMFACTORY_NOT_SUPPORTED =
- "ER_SETDOMFACTORY_NOT_SUPPORTED";
- public static final String ER_PREFIX_MUST_RESOLVE = "ER_PREFIX_MUST_RESOLVE";
- public static final String ER_PARSE_NOT_SUPPORTED = "ER_PARSE_NOT_SUPPORTED";
- public static final String ER_SAX_API_NOT_HANDLED = "ER_SAX_API_NOT_HANDLED";
-public static final String ER_IGNORABLE_WHITESPACE_NOT_HANDLED =
- "ER_IGNORABLE_WHITESPACE_NOT_HANDLED";
- public static final String ER_DTM_CANNOT_HANDLE_NODES =
- "ER_DTM_CANNOT_HANDLE_NODES";
- public static final String ER_XERCES_CANNOT_HANDLE_NODES =
- "ER_XERCES_CANNOT_HANDLE_NODES";
- public static final String ER_XERCES_PARSE_ERROR_DETAILS =
- "ER_XERCES_PARSE_ERROR_DETAILS";
- public static final String ER_XERCES_PARSE_ERROR = "ER_XERCES_PARSE_ERROR";
- public static final String ER_INVALID_UTF16_SURROGATE =
- "ER_INVALID_UTF16_SURROGATE";
- public static final String ER_OIERROR = "ER_OIERROR";
- public static final String ER_CANNOT_CREATE_URL = "ER_CANNOT_CREATE_URL";
- public static final String ER_XPATH_READOBJECT = "ER_XPATH_READOBJECT";
- public static final String ER_FUNCTION_TOKEN_NOT_FOUND =
- "ER_FUNCTION_TOKEN_NOT_FOUND";
- public static final String ER_CANNOT_DEAL_XPATH_TYPE =
- "ER_CANNOT_DEAL_XPATH_TYPE";
- public static final String ER_NODESET_NOT_MUTABLE = "ER_NODESET_NOT_MUTABLE";
- public static final String ER_NODESETDTM_NOT_MUTABLE =
- "ER_NODESETDTM_NOT_MUTABLE";
- /** Variable not resolvable: */
- public static final String ER_VAR_NOT_RESOLVABLE = "ER_VAR_NOT_RESOLVABLE";
- /** Null error handler */
- public static final String ER_NULL_ERROR_HANDLER = "ER_NULL_ERROR_HANDLER";
- /** Programmer's assertion: unknown opcode */
- public static final String ER_PROG_ASSERT_UNKNOWN_OPCODE =
- "ER_PROG_ASSERT_UNKNOWN_OPCODE";
- /** 0 or 1 */
- public static final String ER_ZERO_OR_ONE = "ER_ZERO_OR_ONE";
- /** rtf() not supported by XRTreeFragSelectWrapper */
- public static final String ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** asNodeIterator() not supported by XRTreeFragSelectWrapper */
- public static final String ER_ASNODEITERATOR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER = "ER_ASNODEITERATOR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** fsb() not supported for XStringForChars */
- public static final String ER_FSB_NOT_SUPPORTED_XSTRINGFORCHARS =
- "ER_FSB_NOT_SUPPORTED_XSTRINGFORCHARS";
- /** Could not find variable with the name of */
- public static final String ER_COULD_NOT_FIND_VAR = "ER_COULD_NOT_FIND_VAR";
- /** XStringForChars can not take a string for an argument */
- public static final String ER_XSTRINGFORCHARS_CANNOT_TAKE_STRING =
- "ER_XSTRINGFORCHARS_CANNOT_TAKE_STRING";
- /** The FastStringBuffer argument can not be null */
- public static final String ER_FASTSTRINGBUFFER_CANNOT_BE_NULL =
- "ER_FASTSTRINGBUFFER_CANNOT_BE_NULL";
- /** 2 or 3 */
- public static final String ER_TWO_OR_THREE = "ER_TWO_OR_THREE";
- /** Variable accessed before it is bound! */
- public static final String ER_VARIABLE_ACCESSED_BEFORE_BIND =
- "ER_VARIABLE_ACCESSED_BEFORE_BIND";
- /** XStringForFSB can not take a string for an argument! */
- public static final String ER_FSB_CANNOT_TAKE_STRING =
- "ER_FSB_CANNOT_TAKE_STRING";
- /** Error! Setting the root of a walker to null! */
- public static final String ER_SETTING_WALKER_ROOT_TO_NULL =
- "ER_SETTING_WALKER_ROOT_TO_NULL";
- /** This NodeSetDTM can not iterate to a previous node! */
- public static final String ER_NODESETDTM_CANNOT_ITERATE =
- "ER_NODESETDTM_CANNOT_ITERATE";
- /** This NodeSet can not iterate to a previous node! */
- public static final String ER_NODESET_CANNOT_ITERATE =
- "ER_NODESET_CANNOT_ITERATE";
- /** This NodeSetDTM can not do indexing or counting functions! */
- public static final String ER_NODESETDTM_CANNOT_INDEX =
- "ER_NODESETDTM_CANNOT_INDEX";
- /** This NodeSet can not do indexing or counting functions! */
- public static final String ER_NODESET_CANNOT_INDEX =
- "ER_NODESET_CANNOT_INDEX";
- /** Can not call setShouldCacheNodes after nextNode has been called! */
- public static final String ER_CANNOT_CALL_SETSHOULDCACHENODE =
- "ER_CANNOT_CALL_SETSHOULDCACHENODE";
- /** {0} only allows {1} arguments */
- public static final String ER_ONLY_ALLOWS = "ER_ONLY_ALLOWS";
- /** Programmer's assertion in getNextStepPos: unknown stepType: {0} */
- public static final String ER_UNKNOWN_STEP = "ER_UNKNOWN_STEP";
- /** Problem with RelativeLocationPath */
- public static final String ER_EXPECTED_REL_LOC_PATH =
- "ER_EXPECTED_REL_LOC_PATH";
- /** Problem with LocationPath */
- public static final String ER_EXPECTED_LOC_PATH = "ER_EXPECTED_LOC_PATH";
- public static final String ER_EXPECTED_LOC_PATH_AT_END_EXPR =
- "ER_EXPECTED_LOC_PATH_AT_END_EXPR";
- /** Problem with Step */
- public static final String ER_EXPECTED_LOC_STEP = "ER_EXPECTED_LOC_STEP";
- /** Problem with NodeTest */
- public static final String ER_EXPECTED_NODE_TEST = "ER_EXPECTED_NODE_TEST";
- /** Expected step pattern */
- public static final String ER_EXPECTED_STEP_PATTERN =
- "ER_EXPECTED_STEP_PATTERN";
- /** Expected relative path pattern */
- public static final String ER_EXPECTED_REL_PATH_PATTERN =
- "ER_EXPECTED_REL_PATH_PATTERN";
- /** ER_CANT_CONVERT_XPATHRESULTTYPE_TO_BOOLEAN */
- public static final String ER_CANT_CONVERT_TO_BOOLEAN =
- "ER_CANT_CONVERT_TO_BOOLEAN";
- /** Field ER_CANT_CONVERT_TO_SINGLENODE */
- public static final String ER_CANT_CONVERT_TO_SINGLENODE =
- "ER_CANT_CONVERT_TO_SINGLENODE";
- /** Field ER_CANT_GET_SNAPSHOT_LENGTH */
- public static final String ER_CANT_GET_SNAPSHOT_LENGTH =
- "ER_CANT_GET_SNAPSHOT_LENGTH";
- /** Field ER_NON_ITERATOR_TYPE */
- public static final String ER_NON_ITERATOR_TYPE = "ER_NON_ITERATOR_TYPE";
- /** Field ER_DOC_MUTATED */
- public static final String ER_DOC_MUTATED = "ER_DOC_MUTATED";
- public static final String ER_INVALID_XPATH_TYPE = "ER_INVALID_XPATH_TYPE";
- public static final String ER_EMPTY_XPATH_RESULT = "ER_EMPTY_XPATH_RESULT";
- public static final String ER_INCOMPATIBLE_TYPES = "ER_INCOMPATIBLE_TYPES";
- public static final String ER_NULL_RESOLVER = "ER_NULL_RESOLVER";
- public static final String ER_CANT_CONVERT_TO_STRING =
- "ER_CANT_CONVERT_TO_STRING";
- public static final String ER_NON_SNAPSHOT_TYPE = "ER_NON_SNAPSHOT_TYPE";
- public static final String ER_WRONG_DOCUMENT = "ER_WRONG_DOCUMENT";
- /* Note to translators: The XPath expression cannot be evaluated with respect
- * to this type of node.
- */
- /** Field ER_WRONG_NODETYPE */
- public static final String ER_WRONG_NODETYPE = "ER_WRONG_NODETYPE";
- public static final String ER_XPATH_ERROR = "ER_XPATH_ERROR";
-
- //BEGIN: Keys needed for exception messages of JAXP 1.3 XPath API implementation
- public static final String ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED = "ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED";
- public static final String ER_RESOLVE_VARIABLE_RETURNS_NULL = "ER_RESOLVE_VARIABLE_RETURNS_NULL";
- public static final String ER_UNSUPPORTED_RETURN_TYPE = "ER_UNSUPPORTED_RETURN_TYPE";
- public static final String ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL = "ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL";
- public static final String ER_ARG_CANNOT_BE_NULL = "ER_ARG_CANNOT_BE_NULL";
-
- public static final String ER_OBJECT_MODEL_NULL = "ER_OBJECT_MODEL_NULL";
- public static final String ER_OBJECT_MODEL_EMPTY = "ER_OBJECT_MODEL_EMPTY";
- public static final String ER_FEATURE_NAME_NULL = "ER_FEATURE_NAME_NULL";
- public static final String ER_FEATURE_UNKNOWN = "ER_FEATURE_UNKNOWN";
- public static final String ER_GETTING_NULL_FEATURE = "ER_GETTING_NULL_FEATURE";
- public static final String ER_GETTING_UNKNOWN_FEATURE = "ER_GETTING_UNKNOWN_FEATURE";
- public static final String ER_SECUREPROCESSING_FEATURE = "ER_SECUREPROCESSING_FEATURE";
- public static final String ER_NULL_XPATH_FUNCTION_RESOLVER = "ER_NULL_XPATH_FUNCTION_RESOLVER";
- public static final String ER_NULL_XPATH_VARIABLE_RESOLVER = "ER_NULL_XPATH_VARIABLE_RESOLVER";
- //END: Keys needed for exception messages of JAXP 1.3 XPath API implementation
-
- public static final String WG_LOCALE_NAME_NOT_HANDLED =
- "WG_LOCALE_NAME_NOT_HANDLED";
- public static final String WG_PROPERTY_NOT_SUPPORTED =
- "WG_PROPERTY_NOT_SUPPORTED";
- public static final String WG_DONT_DO_ANYTHING_WITH_NS =
- "WG_DONT_DO_ANYTHING_WITH_NS";
- public static final String WG_SECURITY_EXCEPTION = "WG_SECURITY_EXCEPTION";
- public static final String WG_QUO_NO_LONGER_DEFINED =
- "WG_QUO_NO_LONGER_DEFINED";
- public static final String WG_NEED_DERIVED_OBJECT_TO_IMPLEMENT_NODETEST =
- "WG_NEED_DERIVED_OBJECT_TO_IMPLEMENT_NODETEST";
- public static final String WG_FUNCTION_TOKEN_NOT_FOUND =
- "WG_FUNCTION_TOKEN_NOT_FOUND";
- public static final String WG_COULDNOT_FIND_FUNCTION =
- "WG_COULDNOT_FIND_FUNCTION";
- public static final String WG_CANNOT_MAKE_URL_FROM ="WG_CANNOT_MAKE_URL_FROM";
- public static final String WG_EXPAND_ENTITIES_NOT_SUPPORTED =
- "WG_EXPAND_ENTITIES_NOT_SUPPORTED";
- public static final String WG_ILLEGAL_VARIABLE_REFERENCE =
- "WG_ILLEGAL_VARIABLE_REFERENCE";
- public static final String WG_UNSUPPORTED_ENCODING ="WG_UNSUPPORTED_ENCODING";
-
- /** detach() not supported by XRTreeFragSelectWrapper */
- public static final String ER_DETACH_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_DETACH_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** num() not supported by XRTreeFragSelectWrapper */
- public static final String ER_NUM_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_NUM_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** xstr() not supported by XRTreeFragSelectWrapper */
- public static final String ER_XSTR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_XSTR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** str() not supported by XRTreeFragSelectWrapper */
- public static final String ER_STR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_STR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
-
- // Error messages...
-
- private static final Object[][] _contents = new Object[][]{
-
- { "ERROR0000" , "{0}" },
-
- { ER_CURRENT_NOT_ALLOWED_IN_MATCH, "\uC77C\uCE58 \uD328\uD134\uC5D0\uC11C\uB294 current() \uD568\uC218\uAC00 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4!" },
-
- { ER_CURRENT_TAKES_NO_ARGS, "current() \uD568\uC218\uC5D0\uB294 \uC778\uC218\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4!" },
-
- { ER_DOCUMENT_REPLACED,
- "document() \uD568\uC218 \uAD6C\uD604\uC774 com.sun.org.apache.xalan.internal.xslt.FuncDocument\uB85C \uB300\uCCB4\uB418\uC5C8\uC2B5\uB2C8\uB2E4!"},
-
- { ER_CONTEXT_HAS_NO_OWNERDOC,
- "\uCEE8\uD14D\uC2A4\uD2B8\uC5D0 \uC18C\uC720\uC790 \uBB38\uC11C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4!"},
-
- { ER_LOCALNAME_HAS_TOO_MANY_ARGS,
- "local-name()\uC5D0 \uC778\uC218\uAC00 \uB108\uBB34 \uB9CE\uC2B5\uB2C8\uB2E4."},
-
- { ER_NAMESPACEURI_HAS_TOO_MANY_ARGS,
- "namespace-uri()\uC5D0 \uC778\uC218\uAC00 \uB108\uBB34 \uB9CE\uC2B5\uB2C8\uB2E4."},
-
- { ER_NORMALIZESPACE_HAS_TOO_MANY_ARGS,
- "normalize-space()\uC5D0 \uC778\uC218\uAC00 \uB108\uBB34 \uB9CE\uC2B5\uB2C8\uB2E4."},
-
- { ER_NUMBER_HAS_TOO_MANY_ARGS,
- "number()\uC5D0 \uC778\uC218\uAC00 \uB108\uBB34 \uB9CE\uC2B5\uB2C8\uB2E4."},
-
- { ER_NAME_HAS_TOO_MANY_ARGS,
- "name()\uC5D0 \uC778\uC218\uAC00 \uB108\uBB34 \uB9CE\uC2B5\uB2C8\uB2E4."},
-
- { ER_STRING_HAS_TOO_MANY_ARGS,
- "string()\uC5D0 \uC778\uC218\uAC00 \uB108\uBB34 \uB9CE\uC2B5\uB2C8\uB2E4."},
-
- { ER_STRINGLENGTH_HAS_TOO_MANY_ARGS,
- "string-length()\uC5D0 \uC778\uC218\uAC00 \uB108\uBB34 \uB9CE\uC2B5\uB2C8\uB2E4."},
-
- { ER_TRANSLATE_TAKES_3_ARGS,
- "translate() \uD568\uC218\uC5D0 \uC138 \uAC1C\uC758 \uC778\uC218\uAC00 \uC0AC\uC6A9\uB429\uB2C8\uB2E4!"},
-
- { ER_UNPARSEDENTITYURI_TAKES_1_ARG,
- "unparsed-entity-uri \uD568\uC218\uC5D0\uB294 \uD55C \uAC1C\uC758 \uC778\uC218\uAC00 \uC0AC\uC6A9\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4!"},
-
- { ER_NAMESPACEAXIS_NOT_IMPLEMENTED,
- "\uB124\uC784\uC2A4\uD398\uC774\uC2A4 \uCD95\uC774 \uC544\uC9C1 \uAD6C\uD604\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4!"},
-
- { ER_UNKNOWN_AXIS,
- "\uC54C \uC218 \uC5C6\uB294 \uCD95: {0}"},
-
- { ER_UNKNOWN_MATCH_OPERATION,
- "\uC54C \uC218 \uC5C6\uB294 \uC77C\uCE58 \uC791\uC5C5\uC785\uB2C8\uB2E4!"},
-
- { ER_INCORRECT_ARG_LENGTH,
- "processing-instruction() \uB178\uB4DC \uD14C\uC2A4\uD2B8\uC758 \uC778\uC218 \uAE38\uC774\uAC00 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4!"},
-
- { ER_CANT_CONVERT_TO_NUMBER,
- "{0}\uC744(\uB97C) \uC22B\uC790\uB85C \uBCC0\uD658\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_CANT_CONVERT_TO_NODELIST,
- "{0}\uC744(\uB97C) NodeList\uB85C \uBCC0\uD658\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4!"},
-
- { ER_CANT_CONVERT_TO_MUTABLENODELIST,
- "{0}\uC744(\uB97C) NodeSetDTM\uC73C\uB85C \uBCC0\uD658\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4!"},
-
- { ER_CANT_CONVERT_TO_TYPE,
- "{0}\uC744(\uB97C) type#{1}(\uC73C)\uB85C \uBCC0\uD658\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_EXPECTED_MATCH_PATTERN,
- "getMatchScore\uC5D0 \uC77C\uCE58 \uD328\uD134\uC774 \uD544\uC694\uD569\uB2C8\uB2E4!"},
-
- { ER_COULDNOT_GET_VAR_NAMED,
- "\uC774\uB984\uC774 {0}\uC778 \uBCC0\uC218\uB97C \uAC00\uC838\uC62C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_UNKNOWN_OPCODE,
- "\uC624\uB958! \uC54C \uC218 \uC5C6\uB294 \uC791\uC5C5 \uCF54\uB4DC: {0}"},
-
- { ER_EXTRA_ILLEGAL_TOKENS,
- "\uC798\uBABB\uB41C \uCD94\uAC00 \uD1A0\uD070: {0}"},
-
- { ER_EXPECTED_DOUBLE_QUOTE,
- "\uB9AC\uD130\uB7F4\uC758 \uB530\uC634\uD45C\uAC00 \uC798\uBABB \uC9C0\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uD070 \uB530\uC634\uD45C\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4!"},
-
- { ER_EXPECTED_SINGLE_QUOTE,
- "\uB9AC\uD130\uB7F4\uC758 \uB530\uC634\uD45C\uAC00 \uC798\uBABB \uC9C0\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uC791\uC740 \uB530\uC634\uD45C\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4!"},
-
- { ER_EMPTY_EXPRESSION,
- "\uD45C\uD604\uC2DD\uC774 \uBE44\uC5B4 \uC788\uC2B5\uB2C8\uB2E4!"},
-
- { ER_EXPECTED_BUT_FOUND,
- "{0}\uC774(\uAC00) \uD544\uC694\uD558\uC9C0\uB9CC {1}\uC774(\uAC00) \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
-
- { ER_INCORRECT_PROGRAMMER_ASSERTION,
- "\uD504\uB85C\uADF8\uB798\uBA38 \uAC80\uC99D\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC74C - {0}"},
-
- { ER_BOOLEAN_ARG_NO_LONGER_OPTIONAL,
- "19990709 XPath \uCD08\uC548\uC5D0\uC11C\uB294 boolean(...) \uC778\uC218\uAC00 \uB354 \uC774\uC0C1 \uC120\uD0DD\uC801 \uC778\uC218\uAC00 \uC544\uB2D9\uB2C8\uB2E4."},
-
- { ER_FOUND_COMMA_BUT_NO_PRECEDING_ARG,
- "','\uB97C \uCC3E\uC558\uC9C0\uB9CC \uC120\uD589 \uC778\uC218\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4!"},
-
- { ER_FOUND_COMMA_BUT_NO_FOLLOWING_ARG,
- "','\uB97C \uCC3E\uC558\uC9C0\uB9CC \uD6C4\uD589 \uC778\uC218\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4!"},
-
- { ER_PREDICATE_ILLEGAL_SYNTAX,
- "'..[predicate]' \uB610\uB294 '.[predicate]'\uB294 \uC798\uBABB\uB41C \uAD6C\uBB38\uC785\uB2C8\uB2E4. \uB300\uC2E0 'self::node()[predicate]'\uB97C \uC0AC\uC6A9\uD558\uC2ED\uC2DC\uC624."},
-
- { ER_ILLEGAL_AXIS_NAME,
- "\uC798\uBABB\uB41C \uCD95 \uC774\uB984: {0}"},
-
- { ER_UNKNOWN_NODETYPE,
- "\uC54C \uC218 \uC5C6\uB294 nodetype: {0}"},
-
- { ER_PATTERN_LITERAL_NEEDS_BE_QUOTED,
- "\uD328\uD134 \uB9AC\uD130\uB7F4({0})\uC5D0 \uB530\uC634\uD45C\uB97C \uC9C0\uC815\uD574\uC57C \uD569\uB2C8\uB2E4!"},
-
- { ER_COULDNOT_BE_FORMATTED_TO_NUMBER,
- "{0}\uC758 \uD615\uC2DD\uC744 \uC22B\uC790\uB85C \uC9C0\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4!"},
-
- { ER_COULDNOT_CREATE_XMLPROCESSORLIAISON,
- "XML TransformerFactory \uC5F0\uACB0\uC744 \uC0DD\uC131\uD560 \uC218 \uC5C6\uC74C: {0}"},
-
- { ER_DIDNOT_FIND_XPATH_SELECT_EXP,
- "\uC624\uB958: xpath select \uD45C\uD604\uC2DD(-select)\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_COULDNOT_FIND_ENDOP_AFTER_OPLOCATIONPATH,
- "\uC624\uB958! OP_LOCATIONPATH \uB4A4\uC5D0\uC11C ENDOP\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_ERROR_OCCURED,
- "\uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4!"},
-
- { ER_ILLEGAL_VARIABLE_REFERENCE,
- "\uBCC0\uC218\uC5D0 \uB300\uD574 \uC81C\uACF5\uB41C VariableReference\uAC00 \uCEE8\uD14D\uC2A4\uD2B8\uC5D0\uC11C \uBC97\uC5B4\uB098\uAC70\uB098 \uC815\uC758\uB97C \uD3EC\uD568\uD558\uC9C0 \uC5C6\uC2B5\uB2C8\uB2E4! \uC774\uB984 = {0}"},
-
- { ER_AXES_NOT_ALLOWED,
- "\uC77C\uCE58 \uD328\uD134\uC5D0\uC11C\uB294 child:: \uBC0F attribute:: \uCD95\uB9CC \uD5C8\uC6A9\uB429\uB2C8\uB2E4! \uC798\uBABB\uB41C \uCD95 = {0}"},
-
- { ER_KEY_HAS_TOO_MANY_ARGS,
- "key()\uC5D0 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC740 \uC218\uC758 \uC778\uC218\uAC00 \uC788\uC2B5\uB2C8\uB2E4."},
-
- { ER_COUNT_TAKES_1_ARG,
- "count \uD568\uC218\uC5D0\uB294 \uD55C \uAC1C\uC758 \uC778\uC218\uAC00 \uC0AC\uC6A9\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4!"},
-
- { ER_COULDNOT_FIND_FUNCTION,
- "\uD568\uC218\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC74C: {0}"},
-
- { ER_UNSUPPORTED_ENCODING,
- "\uC9C0\uC6D0\uB418\uC9C0 \uC54A\uB294 \uC778\uCF54\uB529: {0}"},
-
- { ER_PROBLEM_IN_DTM_NEXTSIBLING,
- "DTM\uC5D0\uC11C getNextSibling\uC5D0 \uBB38\uC81C\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. \uBCF5\uAD6C\uD558\uB824\uACE0 \uC2DC\uB3C4\uD558\uB294 \uC911"},
-
- { ER_CANNOT_WRITE_TO_EMPTYNODELISTIMPL,
- "\uD504\uB85C\uADF8\uB798\uBA38 \uC624\uB958: EmptyNodeList\uC5D0 \uC4F8 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_SETDOMFACTORY_NOT_SUPPORTED,
- "XPathContext\uC5D0\uC11C\uB294 setDOMFactory\uAC00 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4!"},
-
- { ER_PREFIX_MUST_RESOLVE,
- "\uC811\uB450\uC5B4\uB294 \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uB85C \uBD84\uC11D\uB418\uC5B4\uC57C \uD568: {0}"},
-
- { ER_PARSE_NOT_SUPPORTED,
- "XPathContext\uC5D0\uC11C\uB294 parse(InputSource \uC18C\uC2A4)\uAC00 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4! {0}\uC744(\uB97C) \uC5F4 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_SAX_API_NOT_HANDLED,
- "DTM\uC774 SAX API \uBB38\uC790(char ch[]...\uB97C \uCC98\uB9AC\uD558\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4!"},
-
- { ER_IGNORABLE_WHITESPACE_NOT_HANDLED,
- "DTM\uC774 ignorableWhitespace(char ch[]...\uB97C \uCC98\uB9AC\uD558\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4!"},
-
- { ER_DTM_CANNOT_HANDLE_NODES,
- "DTMLiaison\uC740 {0} \uC720\uD615\uC758 \uB178\uB4DC\uB97C \uCC98\uB9AC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_XERCES_CANNOT_HANDLE_NODES,
- "DOM2Helper\uB294 {0} \uC720\uD615\uC758 \uB178\uB4DC\uB97C \uCC98\uB9AC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_XERCES_PARSE_ERROR_DETAILS,
- "DOM2Helper.parse \uC624\uB958: SystemID - {0} \uD589 - {1}"},
-
- { ER_XERCES_PARSE_ERROR,
- "DOM2Helper.parse \uC624\uB958"},
-
- { ER_INVALID_UTF16_SURROGATE,
- "\uBD80\uC801\uD569\uD55C UTF-16 \uB300\uB9AC \uC694\uC18C\uAC00 \uAC10\uC9C0\uB428: {0}"},
-
- { ER_OIERROR,
- "IO \uC624\uB958"},
-
- { ER_CANNOT_CREATE_URL,
- "{0}\uC5D0 \uB300\uD55C URL\uC744 \uC0DD\uC131\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_XPATH_READOBJECT,
- "XPath.readObject\uC5D0 \uC624\uB958 \uBC1C\uC0DD: {0}"},
-
- { ER_FUNCTION_TOKEN_NOT_FOUND,
- "\uD568\uC218 \uD1A0\uD070\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_CANNOT_DEAL_XPATH_TYPE,
- "XPath \uC720\uD615\uC744 \uCC98\uB9AC\uD560 \uC218 \uC5C6\uC74C: {0}"},
-
- { ER_NODESET_NOT_MUTABLE,
- "\uC774 NodeSet\uB294 \uBCC0\uACBD\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_NODESETDTM_NOT_MUTABLE,
- "\uC774 NodeSetDTM\uC740 \uBCC0\uACBD\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_VAR_NOT_RESOLVABLE,
- "\uBCC0\uC218\uB97C \uBD84\uC11D\uD560 \uC218 \uC5C6\uC74C: {0}"},
-
- { ER_NULL_ERROR_HANDLER,
- "\uB110 \uC624\uB958 \uCC98\uB9AC\uAE30"},
-
- { ER_PROG_ASSERT_UNKNOWN_OPCODE,
- "\uD504\uB85C\uADF8\uB798\uBA38 \uAC80\uC99D: \uC54C \uC218 \uC5C6\uB294 opcode: {0}"},
-
- { ER_ZERO_OR_ONE,
- "0 \uB610\uB294 1"},
-
- { ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "XRTreeFragSelectWrapper\uB294 rtf()\uB97C \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
-
- { ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "XRTreeFragSelectWrapper\uB294 asNodeIterator()\uB97C \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
-
- /** detach() not supported by XRTreeFragSelectWrapper */
- { ER_DETACH_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "XRTreeFragSelectWrapper\uB294 detach()\uB97C \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
-
- /** num() not supported by XRTreeFragSelectWrapper */
- { ER_NUM_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "XRTreeFragSelectWrapper\uB294 num()\uC744 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
-
- /** xstr() not supported by XRTreeFragSelectWrapper */
- { ER_XSTR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "XRTreeFragSelectWrapper\uB294 xstr()\uC744 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
-
- /** str() not supported by XRTreeFragSelectWrapper */
- { ER_STR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "XRTreeFragSelectWrapper\uB294 str()\uC744 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
-
- { ER_FSB_NOT_SUPPORTED_XSTRINGFORCHARS,
- "fsb()\uB294 XStringForChars\uC5D0 \uB300\uD574 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
-
- { ER_COULD_NOT_FIND_VAR,
- "\uC774\uB984\uC774 {0}\uC778 \uBCC0\uC218\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_XSTRINGFORCHARS_CANNOT_TAKE_STRING,
- "XStringForChars\uB294 \uC778\uC218\uC5D0 \uBB38\uC790\uC5F4\uC744 \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_FASTSTRINGBUFFER_CANNOT_BE_NULL,
- "FastStringBuffer \uC778\uC218\uB294 \uB110\uC77C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { ER_TWO_OR_THREE,
- "2 \uB610\uB294 3"},
-
- { ER_VARIABLE_ACCESSED_BEFORE_BIND,
- "\uBCC0\uC218\uAC00 \uBC14\uC778\uB4DC\uB418\uAE30 \uC804\uC5D0 \uBCC0\uC218\uC5D0 \uC561\uC138\uC2A4\uB418\uC5C8\uC2B5\uB2C8\uB2E4!"},
-
- { ER_FSB_CANNOT_TAKE_STRING,
- "XStringForFSB\uB294 \uC778\uC218\uC5D0 \uBB38\uC790\uC5F4\uC744 \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4!"},
-
- { ER_SETTING_WALKER_ROOT_TO_NULL,
- "\n !!!! \uC624\uB958! \uC6CC\uCEE4\uC758 \uB8E8\uD2B8\uB97C null\uB85C \uC124\uC815\uD558\uB294 \uC911\uC785\uB2C8\uB2E4!"},
-
- { ER_NODESETDTM_CANNOT_ITERATE,
- "\uC774 NodeSetDTM\uC740 \uC774\uC804 \uB178\uB4DC\uB97C \uBC18\uBCF5\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4!"},
-
- { ER_NODESET_CANNOT_ITERATE,
- "\uC774 NodeSet\uB294 \uC774\uC804 \uB178\uB4DC\uB97C \uBC18\uBCF5\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4!"},
-
- { ER_NODESETDTM_CANNOT_INDEX,
- "\uC774 NodeSetDTM\uC740 \uD568\uC218\uB97C \uC778\uB371\uC2A4\uD654\uD558\uAC70\uB098 \uC9D1\uACC4\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4!"},
-
- { ER_NODESET_CANNOT_INDEX,
- "\uC774 NodeSet\uB294 \uD568\uC218\uB97C \uC778\uB371\uC2A4\uD654\uD558\uAC70\uB098 \uC9D1\uACC4\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4!"},
-
- { ER_CANNOT_CALL_SETSHOULDCACHENODE,
- "nextNode\uAC00 \uD638\uCD9C\uB41C \uD6C4\uC5D0\uB294 setShouldCacheNodes\uB97C \uD638\uCD9C\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4!"},
-
- { ER_ONLY_ALLOWS,
- "{0}\uC740(\uB294) {1}\uAC1C\uC758 \uC778\uC218\uB9CC \uD5C8\uC6A9\uD569\uB2C8\uB2E4."},
-
- { ER_UNKNOWN_STEP,
- "getNextStepPos\uC5D0 \uD504\uB85C\uADF8\uB798\uBA38 \uAC80\uC99D\uC774 \uC788\uC74C: \uC54C \uC218 \uC5C6\uB294 stepType: {0}"},
-
- //Note to translators: A relative location path is a form of XPath expression.
- // The message indicates that such an expression was expected following the
- // characters '/' or '//', but was not found.
- { ER_EXPECTED_REL_LOC_PATH,
- "'/' \uB610\uB294 '//' \uD1A0\uD070 \uB4A4\uC5D0 \uC0C1\uB300 \uC704\uCE58 \uACBD\uB85C\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4."},
-
- // Note to translators: A location path is a form of XPath expression.
- // The message indicates that syntactically such an expression was expected,but
- // the characters specified by the substitution text were encountered instead.
- { ER_EXPECTED_LOC_PATH,
- "\uC704\uCE58 \uACBD\uB85C\uAC00 \uD544\uC694\uD558\uC9C0\uB9CC {0} \uD1A0\uD070\uC774 \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
-
- // Note to translators: A location path is a form of XPath expression.
- // The message indicates that syntactically such a subexpression was expected,
- // but no more characters were found in the expression.
- { ER_EXPECTED_LOC_PATH_AT_END_EXPR,
- "\uC704\uCE58 \uACBD\uB85C\uAC00 \uD544\uC694\uD558\uC9C0\uB9CC XPath \uD45C\uD604\uC2DD \uB05D\uC774 \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
-
- // Note to translators: A location step is part of an XPath expression.
- // The message indicates that syntactically such an expression was expected
- // following the specified characters.
- { ER_EXPECTED_LOC_STEP,
- "'/' \uB610\uB294 '//' \uD1A0\uD070 \uB4A4\uC5D0 \uC704\uCE58 \uB2E8\uACC4\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4."},
-
- // Note to translators: A node test is part of an XPath expression that is
- // used to test for particular kinds of nodes. In this case, a node test that
- // consists of an NCName followed by a colon and an asterisk or that consists
- // of a QName was expected, but was not found.
- { ER_EXPECTED_NODE_TEST,
- "NCName:* \uB610\uB294 QName\uACFC \uC77C\uCE58\uD558\uB294 \uB178\uB4DC \uD14C\uC2A4\uD2B8\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4."},
-
- // Note to translators: A step pattern is part of an XPath expression.
- // The message indicates that syntactically such an expression was expected,
- // but the specified character was found in the expression instead.
- { ER_EXPECTED_STEP_PATTERN,
- "\uB2E8\uACC4 \uD328\uD134\uC774 \uD544\uC694\uD558\uC9C0\uB9CC '/'\uAC00 \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
-
- // Note to translators: A relative path pattern is part of an XPath expression.
- // The message indicates that syntactically such an expression was expected,
- // but was not found.
- { ER_EXPECTED_REL_PATH_PATTERN,
- "\uC0C1\uB300 \uACBD\uB85C \uD328\uD134\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."},
-
- // Note to translators: The substitution text is the name of a data type. The
- // message indicates that a value of a particular type could not be converted
- // to a value of type boolean.
- { ER_CANT_CONVERT_TO_BOOLEAN,
- "XPath \uD45C\uD604\uC2DD ''{0}''\uC5D0 \uB300\uD55C XPathResult\uC758 XPathResultType\uC774 \uBD80\uC6B8\uB85C \uBCC0\uD658\uB420 \uC218 \uC5C6\uB294 {1}\uC785\uB2C8\uB2E4."},
-
- // Note to translators: Do not translate ANY_UNORDERED_NODE_TYPE and
- // FIRST_ORDERED_NODE_TYPE.
- { ER_CANT_CONVERT_TO_SINGLENODE,
- "XPath \uD45C\uD604\uC2DD ''{0}''\uC5D0 \uB300\uD55C XPathResult\uC758 XPathResultType\uC774 \uB2E8\uC77C \uB178\uB4DC\uB85C \uBCC0\uD658\uB420 \uC218 \uC5C6\uB294 {1}\uC785\uB2C8\uB2E4. getSingleNodeValue \uBA54\uC18C\uB4DC\uB294 ANY_UNORDERED_NODE_TYPE \uBC0F FIRST_ORDERED_NODE_TYPE \uC720\uD615\uC5D0\uB9CC \uC801\uC6A9\uB429\uB2C8\uB2E4."},
-
- // Note to translators: Do not translate UNORDERED_NODE_SNAPSHOT_TYPE and
- // ORDERED_NODE_SNAPSHOT_TYPE.
- { ER_CANT_GET_SNAPSHOT_LENGTH,
- "XPathResultType\uC774 {1}\uC774\uBBC0\uB85C getSnapshotLength \uBA54\uC18C\uB4DC\uB294 XPath \uD45C\uD604\uC2DD ''{0}''\uC5D0 \uB300\uD55C XPathResult\uC5D0\uC11C \uD638\uCD9C\uB420 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uC774 \uBA54\uC18C\uB4DC\uB294 UNORDERED_NODE_SNAPSHOT_TYPE \uBC0F ORDERED_NODE_SNAPSHOT_TYPE \uC720\uD615\uC5D0\uB9CC \uC801\uC6A9\uB429\uB2C8\uB2E4."},
-
- { ER_NON_ITERATOR_TYPE,
- "XPathResultType\uC774 {1}\uC774\uBBC0\uB85C iterateNext \uBA54\uC18C\uB4DC\uB294 XPath \uD45C\uD604\uC2DD ''{0}''\uC5D0 \uB300\uD55C XPathResult\uC5D0\uC11C \uD638\uCD9C\uB420 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uC774 \uBA54\uC18C\uB4DC\uB294 UNORDERED_NODE_ITERATOR_TYPE \uBC0F ORDERED_NODE_ITERATOR_TYPE \uC720\uD615\uC5D0\uB9CC \uC801\uC6A9\uB429\uB2C8\uB2E4."},
-
- // Note to translators: This message indicates that the document being operated
- // upon changed, so the iterator object that was being used to traverse the
- // document has now become invalid.
- { ER_DOC_MUTATED,
- "\uACB0\uACFC\uAC00 \uBC18\uD658\uB41C \uD6C4 \uBB38\uC11C\uAC00 \uBCC0\uACBD\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uC774\uD130\uB808\uC774\uD130\uAC00 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4."},
-
- { ER_INVALID_XPATH_TYPE,
- "\uBD80\uC801\uD569\uD55C XPath \uC720\uD615 \uC778\uC218: {0}"},
-
- { ER_EMPTY_XPATH_RESULT,
- "XPath \uACB0\uACFC \uAC1D\uCCB4\uAC00 \uBE44\uC5B4 \uC788\uC2B5\uB2C8\uB2E4."},
-
- { ER_INCOMPATIBLE_TYPES,
- "XPath \uD45C\uD604\uC2DD ''{0}''\uC5D0 \uB300\uD55C XPathResult\uC758 XPathResultType\uC774 \uC9C0\uC815\uB41C XPathResultType {2}(\uC73C)\uB85C \uAC15\uC81C \uBCC0\uD658\uB420 \uC218 \uC5C6\uB294 {1}\uC785\uB2C8\uB2E4."},
-
- { ER_NULL_RESOLVER,
- "\uB110 \uC811\uB450\uC5B4 \uBD84\uC11D\uAE30\uB85C \uC811\uB450\uC5B4\uB97C \uBD84\uC11D\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- // Note to translators: The substitution text is the name of a data type. The
- // message indicates that a value of a particular type could not be converted
- // to a value of type string.
- { ER_CANT_CONVERT_TO_STRING,
- "XPath \uD45C\uD604\uC2DD ''{0}''\uC5D0 \uB300\uD55C XPathResult\uC758 XPathResultType\uC774 \uBB38\uC790\uC5F4\uB85C \uBCC0\uD658\uB420 \uC218 \uC5C6\uB294 {1}\uC785\uB2C8\uB2E4."},
-
- // Note to translators: Do not translate snapshotItem,
- // UNORDERED_NODE_SNAPSHOT_TYPE and ORDERED_NODE_SNAPSHOT_TYPE.
- { ER_NON_SNAPSHOT_TYPE,
- "XPathResultType\uC774 {1}\uC774\uBBC0\uB85C snapshotItem \uBA54\uC18C\uB4DC\uB294 XPath \uD45C\uD604\uC2DD ''{0}''\uC5D0 \uB300\uD55C XPathResult\uC5D0\uC11C \uD638\uCD9C\uB420 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uC774 \uBA54\uC18C\uB4DC\uB294 UNORDERED_NODE_SNAPSHOT_TYPE \uBC0F ORDERED_NODE_SNAPSHOT_TYPE \uC720\uD615\uC5D0\uB9CC \uC801\uC6A9\uB429\uB2C8\uB2E4."},
-
- // Note to translators: XPathEvaluator is a Java interface name. An
- // XPathEvaluator is created with respect to a particular XML document, and in
- // this case the expression represented by this object was being evaluated with
- // respect to a context node from a different document.
- { ER_WRONG_DOCUMENT,
- "\uCEE8\uD14D\uC2A4\uD2B8 \uB178\uB4DC\uAC00 \uC774 XPathEvaluator\uC5D0 \uBC14\uC778\uB4DC\uB41C \uBB38\uC11C\uC5D0 \uC18D\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
-
- // Note to translators: The XPath expression cannot be evaluated with respect
- // to this type of node.
- { ER_WRONG_NODETYPE,
- "\uCEE8\uD14D\uC2A4\uD2B8 \uB178\uB4DC \uC720\uD615\uC740 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
-
- { ER_XPATH_ERROR,
- "XPath\uC5D0 \uC54C \uC218 \uC5C6\uB294 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4."},
-
- { ER_CANT_CONVERT_XPATHRESULTTYPE_TO_NUMBER,
- "XPath \uD45C\uD604\uC2DD ''{0}''\uC5D0 \uB300\uD55C XPathResult\uC758 XPathResultType\uC774 \uC22B\uC790\uB85C \uBCC0\uD658\uB420 \uC218 \uC5C6\uB294 {1}\uC785\uB2C8\uB2E4."},
-
- //BEGIN: Definitions of error keys used in exception messages of JAXP 1.3 XPath API implementation
-
- /** Field ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED */
-
- { ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED,
- "XMLConstants.FEATURE_SECURE_PROCESSING \uAE30\uB2A5\uC774 true\uB85C \uC124\uC815\uB41C \uACBD\uC6B0 \uD655\uC7A5 \uD568\uC218 ''{0}''\uC744(\uB97C) \uD638\uCD9C\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- /** Field ER_RESOLVE_VARIABLE_RETURNS_NULL */
-
- { ER_RESOLVE_VARIABLE_RETURNS_NULL,
- "{0} \uBCC0\uC218\uC5D0 \uB300\uD55C resolveVariable\uC774 \uB110\uC744 \uBC18\uD658\uD569\uB2C8\uB2E4."},
-
- /** Field ER_UNSUPPORTED_RETURN_TYPE */
-
- { ER_UNSUPPORTED_RETURN_TYPE,
- "\uC9C0\uC6D0\uB418\uC9C0 \uC54A\uB294 \uBC18\uD658 \uC720\uD615: {0}"},
-
- /** Field ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL */
-
- { ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL,
- "\uC18C\uC2A4 \uBC0F/\uB610\uB294 \uBC18\uD658 \uC720\uD615\uC740 \uB110\uC77C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- /** Field ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL */
-
- { ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL,
- "\uC18C\uC2A4 \uBC0F/\uB610\uB294 \uBC18\uD658 \uC720\uD615\uC740 \uB110\uC77C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- /** Field ER_ARG_CANNOT_BE_NULL */
-
- { ER_ARG_CANNOT_BE_NULL,
- "{0} \uC778\uC218\uB294 \uB110\uC77C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- /** Field ER_OBJECT_MODEL_NULL */
-
- { ER_OBJECT_MODEL_NULL,
- "objectModel == null\uB85C {0}#isObjectModelSupported(String objectModel)\uB97C \uD638\uCD9C\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- /** Field ER_OBJECT_MODEL_EMPTY */
-
- { ER_OBJECT_MODEL_EMPTY,
- "objectModel == \"\"\uB85C {0}#isObjectModelSupported(String objectModel)\uB97C \uD638\uCD9C\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- /** Field ER_OBJECT_MODEL_EMPTY */
-
- { ER_FEATURE_NAME_NULL,
- "\uB110 \uC774\uB984\uC73C\uB85C \uAE30\uB2A5\uC744 \uC124\uC815\uD558\uB824\uACE0 \uC2DC\uB3C4\uD558\uB294 \uC911: {0}#setFeature(null, {1})"},
-
- /** Field ER_FEATURE_UNKNOWN */
-
- { ER_FEATURE_UNKNOWN,
- "\uC54C \uC218 \uC5C6\uB294 \uAE30\uB2A5 \"{0}\"\uC744(\uB97C) \uC124\uC815\uD558\uB824\uACE0 \uC2DC\uB3C4\uD558\uB294 \uC911: {1}#setFeature({0},{2})"},
-
- /** Field ER_GETTING_NULL_FEATURE */
-
- { ER_GETTING_NULL_FEATURE,
- "\uB110 \uC774\uB984\uC73C\uB85C \uAE30\uB2A5\uC744 \uAC00\uC838\uC624\uB824\uACE0 \uC2DC\uB3C4\uD558\uB294 \uC911: {0}#getFeature(null)"},
-
- /** Field ER_GETTING_NULL_FEATURE */
-
- { ER_GETTING_UNKNOWN_FEATURE,
- "\uC54C \uC218 \uC5C6\uB294 \uAE30\uB2A5 \"{0}\"\uC744(\uB97C) \uAC00\uC838\uC624\uB824\uACE0 \uC2DC\uB3C4\uD558\uB294 \uC911: {1}#getFeature({0})"},
-
- {ER_SECUREPROCESSING_FEATURE,
- "FEATURE_SECURE_PROCESSING: \uBCF4\uC548 \uAD00\uB9AC\uC790\uAC00 \uC788\uC744 \uACBD\uC6B0 \uAE30\uB2A5\uC744 false\uB85C \uC124\uC815\uD560 \uC218 \uC5C6\uC74C: {1}#setFeature({0},{2})"},
-
- /** Field ER_NULL_XPATH_FUNCTION_RESOLVER */
-
- { ER_NULL_XPATH_FUNCTION_RESOLVER,
- "\uB110 XPathFunctionResolver\uB97C \uC124\uC815\uD558\uB824\uACE0 \uC2DC\uB3C4\uD558\uB294 \uC911: {0}#setXPathFunctionResolver(null)"},
-
- /** Field ER_NULL_XPATH_VARIABLE_RESOLVER */
-
- { ER_NULL_XPATH_VARIABLE_RESOLVER,
- "\uB110 XPathVariableResolver\uB97C \uC124\uC815\uD558\uB824\uACE0 \uC2DC\uB3C4\uD558\uB294 \uC911: {0}#setXPathVariableResolver(null)"},
-
- //END: Definitions of error keys used in exception messages of JAXP 1.3 XPath API implementation
-
- // Warnings...
-
- { WG_LOCALE_NAME_NOT_HANDLED,
- "format-number \uD568\uC218\uC758 \uB85C\uCF00\uC77C \uC774\uB984\uC774 \uC544\uC9C1 \uCC98\uB9AC\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4!"},
-
- { WG_PROPERTY_NOT_SUPPORTED,
- "XSL \uC18D\uC131\uC774 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC74C: {0}"},
-
- { WG_DONT_DO_ANYTHING_WITH_NS,
- "\uC18D\uC131\uC758 {0} \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uC5D0 \uB300\uD574 \uD604\uC7AC \uC5B4\uB5A4 \uC791\uC5C5\uB3C4 \uC218\uD589\uD558\uC9C0 \uC54A\uC544\uC57C \uD568: {1}"},
-
- { WG_SECURITY_EXCEPTION,
- "XSL \uC2DC\uC2A4\uD15C \uC18D\uC131\uC5D0 \uC561\uC138\uC2A4\uD558\uB824\uACE0 \uC2DC\uB3C4\uD558\uB294 \uC911 SecurityException \uBC1C\uC0DD: {0}"},
-
- { WG_QUO_NO_LONGER_DEFINED,
- "\uC774\uC804 \uAD6C\uBB38: quo(...)\uAC00 XPath\uC5D0 \uB354 \uC774\uC0C1 \uC815\uC758\uB418\uC5B4 \uC788\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
-
- { WG_NEED_DERIVED_OBJECT_TO_IMPLEMENT_NODETEST,
- "nodeTest\uB97C \uAD6C\uD604\uD558\uB824\uBA74 XPath\uC5D0 \uD30C\uC0DD \uAC1D\uCCB4\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4!"},
-
- { WG_FUNCTION_TOKEN_NOT_FOUND,
- "\uD568\uC218 \uD1A0\uD070\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { WG_COULDNOT_FIND_FUNCTION,
- "\uD568\uC218\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC74C: {0}"},
-
- { WG_CANNOT_MAKE_URL_FROM,
- "{0}\uC5D0\uC11C URL\uC744 \uC0DD\uC131\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
-
- { WG_EXPAND_ENTITIES_NOT_SUPPORTED,
- "DTM \uAD6C\uBB38 \uBD84\uC11D\uAE30\uC5D0 \uB300\uD574\uC11C\uB294 -E \uC635\uC158\uC774 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."},
-
- { WG_ILLEGAL_VARIABLE_REFERENCE,
- "\uBCC0\uC218\uC5D0 \uB300\uD574 \uC81C\uACF5\uB41C VariableReference\uAC00 \uCEE8\uD14D\uC2A4\uD2B8\uC5D0\uC11C \uBC97\uC5B4\uB098\uAC70\uB098 \uC815\uC758\uB97C \uD3EC\uD568\uD558\uC9C0 \uC5C6\uC2B5\uB2C8\uB2E4! \uC774\uB984 = {0}"},
-
- { WG_UNSUPPORTED_ENCODING,
- "\uC9C0\uC6D0\uB418\uC9C0 \uC54A\uB294 \uC778\uCF54\uB529: {0}"},
-
-
-
- // Other miscellaneous text used inside the code...
- { "ui_language", "ko"},
- { "help_language", "ko"},
- { "language", "ko"},
- { "BAD_CODE", "createMessage\uC5D0 \uB300\uD55C \uB9E4\uAC1C\uBCC0\uC218\uAC00 \uBC94\uC704\uB97C \uBC97\uC5B4\uB0AC\uC2B5\uB2C8\uB2E4."},
- { "FORMAT_FAILED", "messageFormat \uD638\uCD9C \uC911 \uC608\uC678\uC0AC\uD56D\uC774 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4."},
- { "version", ">>>>>>> Xalan \uBC84\uC804 "},
- { "version2", "<<<<<<<"},
- { "yes", "\uC608"},
- { "line", "\uD589 \uBC88\uD638"},
- { "column", "\uC5F4 \uBC88\uD638"},
- { "xsldone", "XSLProcessor: \uC644\uB8CC"},
- { "xpath_option", "XPath \uC635\uC158: "},
- { "optionIN", " [-in inputXMLURL]"},
- { "optionSelect", " [-select XPath \uD45C\uD604\uC2DD]"},
- { "optionMatch", " [-match \uC77C\uCE58 \uD328\uD134(\uC77C\uCE58 \uC9C4\uB2E8\uC758 \uACBD\uC6B0)]"},
- { "optionAnyExpr", "\uB610\uB294 XPath \uD45C\uD604\uC2DD\uC774 \uC9C4\uB2E8 \uB364\uD504\uB97C \uC218\uD589\uD569\uB2C8\uB2E4."},
- { "noParsermsg1", "XSL \uD504\uB85C\uC138\uC2A4\uB97C \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4."},
- { "noParsermsg2", "** \uAD6C\uBB38 \uBD84\uC11D\uAE30\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC74C **"},
- { "noParsermsg3", "\uD074\uB798\uC2A4 \uACBD\uB85C\uB97C \uD655\uC778\uD558\uC2ED\uC2DC\uC624."},
- { "noParsermsg4", "IBM\uC758 Java\uC6A9 XML \uAD6C\uBB38 \uBD84\uC11D\uAE30\uAC00 \uC5C6\uC744 \uACBD\uC6B0 \uB2E4\uC74C \uC704\uCE58\uC5D0\uC11C \uB2E4\uC6B4\uB85C\uB4DC\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4."},
- { "noParsermsg5", "IBM AlphaWorks: http://www.alphaworks.ibm.com/formula/xml"},
- { "gtone", ">1" },
- { "zero", "0" },
- { "one", "1" },
- { "two" , "2" },
- { "three", "3" }
-
- };
-
- /**
- * Get the association list.
- *
- * @return The association list.
- */
- public Object[][] getContents()
- {
- return _contents;
- }
-
-
- // ================= INFRASTRUCTURE ======================
-
- /** Field BAD_CODE */
- public static final String BAD_CODE = "BAD_CODE";
-
- /** Field FORMAT_FAILED */
- public static final String FORMAT_FAILED = "FORMAT_FAILED";
-
- /** Field ERROR_RESOURCES */
- public static final String ERROR_RESOURCES =
- "com.sun.org.apache.xpath.internal.res.XPATHErrorResources";
-
- /** Field ERROR_STRING */
- public static final String ERROR_STRING = "#error";
-
- /** Field ERROR_HEADER */
- public static final String ERROR_HEADER = "Error: ";
-
- /** Field WARNING_HEADER */
- public static final String WARNING_HEADER = "Warning: ";
-
- /** Field XSL_HEADER */
- public static final String XSL_HEADER = "XSL ";
-
- /** Field XML_HEADER */
- public static final String XML_HEADER = "XML ";
-
- /** Field QUERY_HEADER */
- public static final String QUERY_HEADER = "PATTERN ";
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_pt_BR.java b/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_pt_BR.java
deleted file mode 100644
index 659e784..0000000
--- a/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_pt_BR.java
+++ /dev/null
@@ -1,936 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xpath.internal.res;
-
-import java.util.ListResourceBundle;
-
-/**
- * Set up error messages.
- * We build a two dimensional array of message keys and
- * message strings. In order to add a new message here,
- * you need to first add a Static string constant for the
- * Key and update the contents array with Key, Value pair
- * Also you need to update the count of messages(MAX_CODE)or
- * the count of warnings(MAX_WARNING) [ Information purpose only]
- * @xsl.usage advanced
- */
-public class XPATHErrorResources_pt_BR extends ListResourceBundle
-{
-
-/*
- * General notes to translators:
- *
- * This file contains error and warning messages related to XPath Error
- * Handling.
- *
- * 1) Xalan (or more properly, Xalan-interpretive) and XSLTC are names of
- * components.
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- * XSLTC is an acronym for XSLT Compiler.
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 5) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 6) "Translet" is an invented term that describes the class file that
- * results from compiling an XML stylesheet into a Java class.
- *
- * 7) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- * 8) The context node is the node in the document with respect to which an
- * XPath expression is being evaluated.
- *
- * 9) An iterator is an object that traverses nodes in the tree, one at a time.
- *
- * 10) NCName is an XML term used to describe a name that does not contain a
- * colon (a "no-colon name").
- *
- * 11) QName is an XML term meaning "qualified name".
- */
-
- /*
- * static variables
- */
- public static final String ERROR0000 = "ERROR0000";
- public static final String ER_CURRENT_NOT_ALLOWED_IN_MATCH =
- "ER_CURRENT_NOT_ALLOWED_IN_MATCH";
- public static final String ER_CURRENT_TAKES_NO_ARGS =
- "ER_CURRENT_TAKES_NO_ARGS";
- public static final String ER_DOCUMENT_REPLACED = "ER_DOCUMENT_REPLACED";
- public static final String ER_CONTEXT_HAS_NO_OWNERDOC =
- "ER_CONTEXT_HAS_NO_OWNERDOC";
- public static final String ER_LOCALNAME_HAS_TOO_MANY_ARGS =
- "ER_LOCALNAME_HAS_TOO_MANY_ARGS";
- public static final String ER_NAMESPACEURI_HAS_TOO_MANY_ARGS =
- "ER_NAMESPACEURI_HAS_TOO_MANY_ARGS";
- public static final String ER_NORMALIZESPACE_HAS_TOO_MANY_ARGS =
- "ER_NORMALIZESPACE_HAS_TOO_MANY_ARGS";
- public static final String ER_NUMBER_HAS_TOO_MANY_ARGS =
- "ER_NUMBER_HAS_TOO_MANY_ARGS";
- public static final String ER_NAME_HAS_TOO_MANY_ARGS =
- "ER_NAME_HAS_TOO_MANY_ARGS";
- public static final String ER_STRING_HAS_TOO_MANY_ARGS =
- "ER_STRING_HAS_TOO_MANY_ARGS";
- public static final String ER_STRINGLENGTH_HAS_TOO_MANY_ARGS =
- "ER_STRINGLENGTH_HAS_TOO_MANY_ARGS";
- public static final String ER_TRANSLATE_TAKES_3_ARGS =
- "ER_TRANSLATE_TAKES_3_ARGS";
- public static final String ER_UNPARSEDENTITYURI_TAKES_1_ARG =
- "ER_UNPARSEDENTITYURI_TAKES_1_ARG";
- public static final String ER_NAMESPACEAXIS_NOT_IMPLEMENTED =
- "ER_NAMESPACEAXIS_NOT_IMPLEMENTED";
- public static final String ER_UNKNOWN_AXIS = "ER_UNKNOWN_AXIS";
- public static final String ER_UNKNOWN_MATCH_OPERATION =
- "ER_UNKNOWN_MATCH_OPERATION";
- public static final String ER_INCORRECT_ARG_LENGTH ="ER_INCORRECT_ARG_LENGTH";
- public static final String ER_CANT_CONVERT_TO_NUMBER =
- "ER_CANT_CONVERT_TO_NUMBER";
- public static final String ER_CANT_CONVERT_XPATHRESULTTYPE_TO_NUMBER =
- "ER_CANT_CONVERT_XPATHRESULTTYPE_TO_NUMBER";
- public static final String ER_CANT_CONVERT_TO_NODELIST =
- "ER_CANT_CONVERT_TO_NODELIST";
- public static final String ER_CANT_CONVERT_TO_MUTABLENODELIST =
- "ER_CANT_CONVERT_TO_MUTABLENODELIST";
- public static final String ER_CANT_CONVERT_TO_TYPE ="ER_CANT_CONVERT_TO_TYPE";
- public static final String ER_EXPECTED_MATCH_PATTERN =
- "ER_EXPECTED_MATCH_PATTERN";
- public static final String ER_COULDNOT_GET_VAR_NAMED =
- "ER_COULDNOT_GET_VAR_NAMED";
- public static final String ER_UNKNOWN_OPCODE = "ER_UNKNOWN_OPCODE";
- public static final String ER_EXTRA_ILLEGAL_TOKENS ="ER_EXTRA_ILLEGAL_TOKENS";
- public static final String ER_EXPECTED_DOUBLE_QUOTE =
- "ER_EXPECTED_DOUBLE_QUOTE";
- public static final String ER_EXPECTED_SINGLE_QUOTE =
- "ER_EXPECTED_SINGLE_QUOTE";
- public static final String ER_EMPTY_EXPRESSION = "ER_EMPTY_EXPRESSION";
- public static final String ER_EXPECTED_BUT_FOUND = "ER_EXPECTED_BUT_FOUND";
- public static final String ER_INCORRECT_PROGRAMMER_ASSERTION =
- "ER_INCORRECT_PROGRAMMER_ASSERTION";
- public static final String ER_BOOLEAN_ARG_NO_LONGER_OPTIONAL =
- "ER_BOOLEAN_ARG_NO_LONGER_OPTIONAL";
- public static final String ER_FOUND_COMMA_BUT_NO_PRECEDING_ARG =
- "ER_FOUND_COMMA_BUT_NO_PRECEDING_ARG";
- public static final String ER_FOUND_COMMA_BUT_NO_FOLLOWING_ARG =
- "ER_FOUND_COMMA_BUT_NO_FOLLOWING_ARG";
- public static final String ER_PREDICATE_ILLEGAL_SYNTAX =
- "ER_PREDICATE_ILLEGAL_SYNTAX";
- public static final String ER_ILLEGAL_AXIS_NAME = "ER_ILLEGAL_AXIS_NAME";
- public static final String ER_UNKNOWN_NODETYPE = "ER_UNKNOWN_NODETYPE";
- public static final String ER_PATTERN_LITERAL_NEEDS_BE_QUOTED =
- "ER_PATTERN_LITERAL_NEEDS_BE_QUOTED";
- public static final String ER_COULDNOT_BE_FORMATTED_TO_NUMBER =
- "ER_COULDNOT_BE_FORMATTED_TO_NUMBER";
- public static final String ER_COULDNOT_CREATE_XMLPROCESSORLIAISON =
- "ER_COULDNOT_CREATE_XMLPROCESSORLIAISON";
- public static final String ER_DIDNOT_FIND_XPATH_SELECT_EXP =
- "ER_DIDNOT_FIND_XPATH_SELECT_EXP";
- public static final String ER_COULDNOT_FIND_ENDOP_AFTER_OPLOCATIONPATH =
- "ER_COULDNOT_FIND_ENDOP_AFTER_OPLOCATIONPATH";
- public static final String ER_ERROR_OCCURED = "ER_ERROR_OCCURED";
- public static final String ER_ILLEGAL_VARIABLE_REFERENCE =
- "ER_ILLEGAL_VARIABLE_REFERENCE";
- public static final String ER_AXES_NOT_ALLOWED = "ER_AXES_NOT_ALLOWED";
- public static final String ER_KEY_HAS_TOO_MANY_ARGS =
- "ER_KEY_HAS_TOO_MANY_ARGS";
- public static final String ER_COUNT_TAKES_1_ARG = "ER_COUNT_TAKES_1_ARG";
- public static final String ER_COULDNOT_FIND_FUNCTION =
- "ER_COULDNOT_FIND_FUNCTION";
- public static final String ER_UNSUPPORTED_ENCODING ="ER_UNSUPPORTED_ENCODING";
- public static final String ER_PROBLEM_IN_DTM_NEXTSIBLING =
- "ER_PROBLEM_IN_DTM_NEXTSIBLING";
- public static final String ER_CANNOT_WRITE_TO_EMPTYNODELISTIMPL =
- "ER_CANNOT_WRITE_TO_EMPTYNODELISTIMPL";
- public static final String ER_SETDOMFACTORY_NOT_SUPPORTED =
- "ER_SETDOMFACTORY_NOT_SUPPORTED";
- public static final String ER_PREFIX_MUST_RESOLVE = "ER_PREFIX_MUST_RESOLVE";
- public static final String ER_PARSE_NOT_SUPPORTED = "ER_PARSE_NOT_SUPPORTED";
- public static final String ER_SAX_API_NOT_HANDLED = "ER_SAX_API_NOT_HANDLED";
-public static final String ER_IGNORABLE_WHITESPACE_NOT_HANDLED =
- "ER_IGNORABLE_WHITESPACE_NOT_HANDLED";
- public static final String ER_DTM_CANNOT_HANDLE_NODES =
- "ER_DTM_CANNOT_HANDLE_NODES";
- public static final String ER_XERCES_CANNOT_HANDLE_NODES =
- "ER_XERCES_CANNOT_HANDLE_NODES";
- public static final String ER_XERCES_PARSE_ERROR_DETAILS =
- "ER_XERCES_PARSE_ERROR_DETAILS";
- public static final String ER_XERCES_PARSE_ERROR = "ER_XERCES_PARSE_ERROR";
- public static final String ER_INVALID_UTF16_SURROGATE =
- "ER_INVALID_UTF16_SURROGATE";
- public static final String ER_OIERROR = "ER_OIERROR";
- public static final String ER_CANNOT_CREATE_URL = "ER_CANNOT_CREATE_URL";
- public static final String ER_XPATH_READOBJECT = "ER_XPATH_READOBJECT";
- public static final String ER_FUNCTION_TOKEN_NOT_FOUND =
- "ER_FUNCTION_TOKEN_NOT_FOUND";
- public static final String ER_CANNOT_DEAL_XPATH_TYPE =
- "ER_CANNOT_DEAL_XPATH_TYPE";
- public static final String ER_NODESET_NOT_MUTABLE = "ER_NODESET_NOT_MUTABLE";
- public static final String ER_NODESETDTM_NOT_MUTABLE =
- "ER_NODESETDTM_NOT_MUTABLE";
- /** Variable not resolvable: */
- public static final String ER_VAR_NOT_RESOLVABLE = "ER_VAR_NOT_RESOLVABLE";
- /** Null error handler */
- public static final String ER_NULL_ERROR_HANDLER = "ER_NULL_ERROR_HANDLER";
- /** Programmer's assertion: unknown opcode */
- public static final String ER_PROG_ASSERT_UNKNOWN_OPCODE =
- "ER_PROG_ASSERT_UNKNOWN_OPCODE";
- /** 0 or 1 */
- public static final String ER_ZERO_OR_ONE = "ER_ZERO_OR_ONE";
- /** rtf() not supported by XRTreeFragSelectWrapper */
- public static final String ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** asNodeIterator() not supported by XRTreeFragSelectWrapper */
- public static final String ER_ASNODEITERATOR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER = "ER_ASNODEITERATOR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** fsb() not supported for XStringForChars */
- public static final String ER_FSB_NOT_SUPPORTED_XSTRINGFORCHARS =
- "ER_FSB_NOT_SUPPORTED_XSTRINGFORCHARS";
- /** Could not find variable with the name of */
- public static final String ER_COULD_NOT_FIND_VAR = "ER_COULD_NOT_FIND_VAR";
- /** XStringForChars can not take a string for an argument */
- public static final String ER_XSTRINGFORCHARS_CANNOT_TAKE_STRING =
- "ER_XSTRINGFORCHARS_CANNOT_TAKE_STRING";
- /** The FastStringBuffer argument can not be null */
- public static final String ER_FASTSTRINGBUFFER_CANNOT_BE_NULL =
- "ER_FASTSTRINGBUFFER_CANNOT_BE_NULL";
- /** 2 or 3 */
- public static final String ER_TWO_OR_THREE = "ER_TWO_OR_THREE";
- /** Variable accessed before it is bound! */
- public static final String ER_VARIABLE_ACCESSED_BEFORE_BIND =
- "ER_VARIABLE_ACCESSED_BEFORE_BIND";
- /** XStringForFSB can not take a string for an argument! */
- public static final String ER_FSB_CANNOT_TAKE_STRING =
- "ER_FSB_CANNOT_TAKE_STRING";
- /** Error! Setting the root of a walker to null! */
- public static final String ER_SETTING_WALKER_ROOT_TO_NULL =
- "ER_SETTING_WALKER_ROOT_TO_NULL";
- /** This NodeSetDTM can not iterate to a previous node! */
- public static final String ER_NODESETDTM_CANNOT_ITERATE =
- "ER_NODESETDTM_CANNOT_ITERATE";
- /** This NodeSet can not iterate to a previous node! */
- public static final String ER_NODESET_CANNOT_ITERATE =
- "ER_NODESET_CANNOT_ITERATE";
- /** This NodeSetDTM can not do indexing or counting functions! */
- public static final String ER_NODESETDTM_CANNOT_INDEX =
- "ER_NODESETDTM_CANNOT_INDEX";
- /** This NodeSet can not do indexing or counting functions! */
- public static final String ER_NODESET_CANNOT_INDEX =
- "ER_NODESET_CANNOT_INDEX";
- /** Can not call setShouldCacheNodes after nextNode has been called! */
- public static final String ER_CANNOT_CALL_SETSHOULDCACHENODE =
- "ER_CANNOT_CALL_SETSHOULDCACHENODE";
- /** {0} only allows {1} arguments */
- public static final String ER_ONLY_ALLOWS = "ER_ONLY_ALLOWS";
- /** Programmer's assertion in getNextStepPos: unknown stepType: {0} */
- public static final String ER_UNKNOWN_STEP = "ER_UNKNOWN_STEP";
- /** Problem with RelativeLocationPath */
- public static final String ER_EXPECTED_REL_LOC_PATH =
- "ER_EXPECTED_REL_LOC_PATH";
- /** Problem with LocationPath */
- public static final String ER_EXPECTED_LOC_PATH = "ER_EXPECTED_LOC_PATH";
- public static final String ER_EXPECTED_LOC_PATH_AT_END_EXPR =
- "ER_EXPECTED_LOC_PATH_AT_END_EXPR";
- /** Problem with Step */
- public static final String ER_EXPECTED_LOC_STEP = "ER_EXPECTED_LOC_STEP";
- /** Problem with NodeTest */
- public static final String ER_EXPECTED_NODE_TEST = "ER_EXPECTED_NODE_TEST";
- /** Expected step pattern */
- public static final String ER_EXPECTED_STEP_PATTERN =
- "ER_EXPECTED_STEP_PATTERN";
- /** Expected relative path pattern */
- public static final String ER_EXPECTED_REL_PATH_PATTERN =
- "ER_EXPECTED_REL_PATH_PATTERN";
- /** ER_CANT_CONVERT_XPATHRESULTTYPE_TO_BOOLEAN */
- public static final String ER_CANT_CONVERT_TO_BOOLEAN =
- "ER_CANT_CONVERT_TO_BOOLEAN";
- /** Field ER_CANT_CONVERT_TO_SINGLENODE */
- public static final String ER_CANT_CONVERT_TO_SINGLENODE =
- "ER_CANT_CONVERT_TO_SINGLENODE";
- /** Field ER_CANT_GET_SNAPSHOT_LENGTH */
- public static final String ER_CANT_GET_SNAPSHOT_LENGTH =
- "ER_CANT_GET_SNAPSHOT_LENGTH";
- /** Field ER_NON_ITERATOR_TYPE */
- public static final String ER_NON_ITERATOR_TYPE = "ER_NON_ITERATOR_TYPE";
- /** Field ER_DOC_MUTATED */
- public static final String ER_DOC_MUTATED = "ER_DOC_MUTATED";
- public static final String ER_INVALID_XPATH_TYPE = "ER_INVALID_XPATH_TYPE";
- public static final String ER_EMPTY_XPATH_RESULT = "ER_EMPTY_XPATH_RESULT";
- public static final String ER_INCOMPATIBLE_TYPES = "ER_INCOMPATIBLE_TYPES";
- public static final String ER_NULL_RESOLVER = "ER_NULL_RESOLVER";
- public static final String ER_CANT_CONVERT_TO_STRING =
- "ER_CANT_CONVERT_TO_STRING";
- public static final String ER_NON_SNAPSHOT_TYPE = "ER_NON_SNAPSHOT_TYPE";
- public static final String ER_WRONG_DOCUMENT = "ER_WRONG_DOCUMENT";
- /* Note to translators: The XPath expression cannot be evaluated with respect
- * to this type of node.
- */
- /** Field ER_WRONG_NODETYPE */
- public static final String ER_WRONG_NODETYPE = "ER_WRONG_NODETYPE";
- public static final String ER_XPATH_ERROR = "ER_XPATH_ERROR";
-
- //BEGIN: Keys needed for exception messages of JAXP 1.3 XPath API implementation
- public static final String ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED = "ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED";
- public static final String ER_RESOLVE_VARIABLE_RETURNS_NULL = "ER_RESOLVE_VARIABLE_RETURNS_NULL";
- public static final String ER_UNSUPPORTED_RETURN_TYPE = "ER_UNSUPPORTED_RETURN_TYPE";
- public static final String ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL = "ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL";
- public static final String ER_ARG_CANNOT_BE_NULL = "ER_ARG_CANNOT_BE_NULL";
-
- public static final String ER_OBJECT_MODEL_NULL = "ER_OBJECT_MODEL_NULL";
- public static final String ER_OBJECT_MODEL_EMPTY = "ER_OBJECT_MODEL_EMPTY";
- public static final String ER_FEATURE_NAME_NULL = "ER_FEATURE_NAME_NULL";
- public static final String ER_FEATURE_UNKNOWN = "ER_FEATURE_UNKNOWN";
- public static final String ER_GETTING_NULL_FEATURE = "ER_GETTING_NULL_FEATURE";
- public static final String ER_GETTING_UNKNOWN_FEATURE = "ER_GETTING_UNKNOWN_FEATURE";
- public static final String ER_SECUREPROCESSING_FEATURE = "ER_SECUREPROCESSING_FEATURE";
- public static final String ER_NULL_XPATH_FUNCTION_RESOLVER = "ER_NULL_XPATH_FUNCTION_RESOLVER";
- public static final String ER_NULL_XPATH_VARIABLE_RESOLVER = "ER_NULL_XPATH_VARIABLE_RESOLVER";
- //END: Keys needed for exception messages of JAXP 1.3 XPath API implementation
-
- public static final String WG_LOCALE_NAME_NOT_HANDLED =
- "WG_LOCALE_NAME_NOT_HANDLED";
- public static final String WG_PROPERTY_NOT_SUPPORTED =
- "WG_PROPERTY_NOT_SUPPORTED";
- public static final String WG_DONT_DO_ANYTHING_WITH_NS =
- "WG_DONT_DO_ANYTHING_WITH_NS";
- public static final String WG_SECURITY_EXCEPTION = "WG_SECURITY_EXCEPTION";
- public static final String WG_QUO_NO_LONGER_DEFINED =
- "WG_QUO_NO_LONGER_DEFINED";
- public static final String WG_NEED_DERIVED_OBJECT_TO_IMPLEMENT_NODETEST =
- "WG_NEED_DERIVED_OBJECT_TO_IMPLEMENT_NODETEST";
- public static final String WG_FUNCTION_TOKEN_NOT_FOUND =
- "WG_FUNCTION_TOKEN_NOT_FOUND";
- public static final String WG_COULDNOT_FIND_FUNCTION =
- "WG_COULDNOT_FIND_FUNCTION";
- public static final String WG_CANNOT_MAKE_URL_FROM ="WG_CANNOT_MAKE_URL_FROM";
- public static final String WG_EXPAND_ENTITIES_NOT_SUPPORTED =
- "WG_EXPAND_ENTITIES_NOT_SUPPORTED";
- public static final String WG_ILLEGAL_VARIABLE_REFERENCE =
- "WG_ILLEGAL_VARIABLE_REFERENCE";
- public static final String WG_UNSUPPORTED_ENCODING ="WG_UNSUPPORTED_ENCODING";
-
- /** detach() not supported by XRTreeFragSelectWrapper */
- public static final String ER_DETACH_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_DETACH_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** num() not supported by XRTreeFragSelectWrapper */
- public static final String ER_NUM_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_NUM_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** xstr() not supported by XRTreeFragSelectWrapper */
- public static final String ER_XSTR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_XSTR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** str() not supported by XRTreeFragSelectWrapper */
- public static final String ER_STR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_STR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
-
- // Error messages...
-
- private static final Object[][] _contents = new Object[][]{
-
- { "ERROR0000" , "{0}" },
-
- { ER_CURRENT_NOT_ALLOWED_IN_MATCH, "A fun\u00E7\u00E3o current() n\u00E3o \u00E9 permitida em um padr\u00E3o de correspond\u00EAncia!" },
-
- { ER_CURRENT_TAKES_NO_ARGS, "A fun\u00E7\u00E3o current() n\u00E3o aceita argumentos!" },
-
- { ER_DOCUMENT_REPLACED,
- "a implementa\u00E7\u00E3o da fun\u00E7\u00E3o document() foi substitu\u00EDda por com.sun.org.apache.xalan.internal.xslt.FuncDocument!"},
-
- { ER_CONTEXT_HAS_NO_OWNERDOC,
- "o contexto n\u00E3o tem um documento de propriet\u00E1rio!"},
-
- { ER_LOCALNAME_HAS_TOO_MANY_ARGS,
- "local-name() tem muitos argumentos."},
-
- { ER_NAMESPACEURI_HAS_TOO_MANY_ARGS,
- "namespace-uri() tem muitos argumentos."},
-
- { ER_NORMALIZESPACE_HAS_TOO_MANY_ARGS,
- "normalize-space() tem muitos argumentos."},
-
- { ER_NUMBER_HAS_TOO_MANY_ARGS,
- "number() tem muitos argumentos."},
-
- { ER_NAME_HAS_TOO_MANY_ARGS,
- "name() tem muitos argumentos."},
-
- { ER_STRING_HAS_TOO_MANY_ARGS,
- "string() tem muitos argumentos."},
-
- { ER_STRINGLENGTH_HAS_TOO_MANY_ARGS,
- "string-length() tem muitos argumentos."},
-
- { ER_TRANSLATE_TAKES_3_ARGS,
- "A fun\u00E7\u00E3o translate() tem tr\u00EAs argumentos!"},
-
- { ER_UNPARSEDENTITYURI_TAKES_1_ARG,
- "A fun\u00E7\u00E3o unparsed-entity-uri deve ter um argumento!"},
-
- { ER_NAMESPACEAXIS_NOT_IMPLEMENTED,
- "o eixo do namespace ainda n\u00E3o foi implementado!"},
-
- { ER_UNKNOWN_AXIS,
- "eixo desconhecido: {0}"},
-
- { ER_UNKNOWN_MATCH_OPERATION,
- "Opera\u00E7\u00E3o correspondente desconhecida!"},
-
- { ER_INCORRECT_ARG_LENGTH,
- "O tamanho do argumento do teste de n\u00F3 de processing-instruction() est\u00E1 incorreto!"},
-
- { ER_CANT_CONVERT_TO_NUMBER,
- "N\u00E3o \u00E9 poss\u00EDvel converter {0} em um n\u00FAmero"},
-
- { ER_CANT_CONVERT_TO_NODELIST,
- "N\u00E3o \u00E9 poss\u00EDvel converter {0} em uma NodeList!"},
-
- { ER_CANT_CONVERT_TO_MUTABLENODELIST,
- "N\u00E3o \u00E9 poss\u00EDvel converter {0} em um NodeSetDTM!"},
-
- { ER_CANT_CONVERT_TO_TYPE,
- "N\u00E3o \u00E9 poss\u00EDvel converter {0} em um tipo n\u00BA{1}"},
-
- { ER_EXPECTED_MATCH_PATTERN,
- "Padr\u00E3o de correspond\u00EAncia esperado em getMatchScore!"},
-
- { ER_COULDNOT_GET_VAR_NAMED,
- "N\u00E3o foi poss\u00EDvel obter a vari\u00E1vel com o nome {0}"},
-
- { ER_UNKNOWN_OPCODE,
- "ERRO! C\u00F3digo da opera\u00E7\u00E3o desconhecido: {0}"},
-
- { ER_EXTRA_ILLEGAL_TOKENS,
- "Tokens inv\u00E1lidos extras: {0}"},
-
- { ER_EXPECTED_DOUBLE_QUOTE,
- "literal com aspas incorretas... esperava-se aspas duplas!"},
-
- { ER_EXPECTED_SINGLE_QUOTE,
- "literal com aspas incorretas... esperava-se aspas simples!"},
-
- { ER_EMPTY_EXPRESSION,
- "Express\u00E3o vazia!"},
-
- { ER_EXPECTED_BUT_FOUND,
- "Esperava {0}, mas encontrou: {1}"},
-
- { ER_INCORRECT_PROGRAMMER_ASSERTION,
- "Asser\u00E7\u00E3o do programador incorreta! - {0}"},
-
- { ER_BOOLEAN_ARG_NO_LONGER_OPTIONAL,
- "O argumento boolean(...) n\u00E3o \u00E9 mais opcional com o rascunho XPath 19990709."},
-
- { ER_FOUND_COMMA_BUT_NO_PRECEDING_ARG,
- "Encontrou ',' mas sem um argumento precedente!"},
-
- { ER_FOUND_COMMA_BUT_NO_FOLLOWING_ARG,
- "Encontrou ',' mas sem o argumento a seguir!"},
-
- { ER_PREDICATE_ILLEGAL_SYNTAX,
- "'..[predicate]' ou '.[predicate]' \u00E9 uma sintaxe inv\u00E1lida. Use 'self::node()[predicate]'."},
-
- { ER_ILLEGAL_AXIS_NAME,
- "nome do eixo inv\u00E1lido: {0}"},
-
- { ER_UNKNOWN_NODETYPE,
- "Tipo de n\u00F3 desconhecido: {0}"},
-
- { ER_PATTERN_LITERAL_NEEDS_BE_QUOTED,
- "A literal padr\u00E3o ({0}) precisa estar entre aspas!"},
-
- { ER_COULDNOT_BE_FORMATTED_TO_NUMBER,
- "n\u00E3o foi poss\u00EDvel formatar {0} como um n\u00FAmero!"},
-
- { ER_COULDNOT_CREATE_XMLPROCESSORLIAISON,
- "N\u00E3o foi poss\u00EDvel criar a Liga\u00E7\u00E3o TransformerFactory XML: {0}"},
-
- { ER_DIDNOT_FIND_XPATH_SELECT_EXP,
- "Erro! N\u00E3o foi poss\u00EDvel localizar a express\u00E3o de sele\u00E7\u00E3o xpath (-select)."},
-
- { ER_COULDNOT_FIND_ENDOP_AFTER_OPLOCATIONPATH,
- "ERRO! N\u00E3o foi poss\u00EDvel localizar ENDOP ap\u00F3s OP_LOCATIONPATH"},
-
- { ER_ERROR_OCCURED,
- "Ocorreu um erro!"},
-
- { ER_ILLEGAL_VARIABLE_REFERENCE,
- "VariableReference fornecida para a vari\u00E1vel fora do contexto ou sem defini\u00E7\u00E3o! Nome = {0}"},
-
- { ER_AXES_NOT_ALLOWED,
- "Somente eixos filho:: e atributo:: s\u00E3o permitidos nos padr\u00F5es de correspond\u00EAncia! Eixos incorretos = {0}"},
-
- { ER_KEY_HAS_TOO_MANY_ARGS,
- "key() tem um n\u00FAmero incorreto de argumentos."},
-
- { ER_COUNT_TAKES_1_ARG,
- "A fun\u00E7\u00E3o count deve ter um argumento!"},
-
- { ER_COULDNOT_FIND_FUNCTION,
- "N\u00E3o foi poss\u00EDvel localizar a fun\u00E7\u00E3o: {0}"},
-
- { ER_UNSUPPORTED_ENCODING,
- "Codifica\u00E7\u00E3o n\u00E3o suportada: {0}"},
-
- { ER_PROBLEM_IN_DTM_NEXTSIBLING,
- "Ocorreu um problema no DTM em getNextSibling... tentando recuperar"},
-
- { ER_CANNOT_WRITE_TO_EMPTYNODELISTIMPL,
- "Erro do programador: EmptyNodeList n\u00E3o pode ser gravado."},
-
- { ER_SETDOMFACTORY_NOT_SUPPORTED,
- "setDOMFactory n\u00E3o suportado por XPathContext!"},
-
- { ER_PREFIX_MUST_RESOLVE,
- "O prefixo deve ser resolvido para um namespace: {0}"},
-
- { ER_PARSE_NOT_SUPPORTED,
- "parsing (InputSource source) n\u00E3o suportado em XPathContext! N\u00E3o \u00E9 poss\u00EDvel abrir {0}"},
-
- { ER_SAX_API_NOT_HANDLED,
- "Caracteres SAX API(char ch[]... n\u00E3o tratados por DTM!"},
-
- { ER_IGNORABLE_WHITESPACE_NOT_HANDLED,
- "ignorableWhitespace(char ch[]... n\u00E3o tratado pelo DTM!"},
-
- { ER_DTM_CANNOT_HANDLE_NODES,
- "DTMLiaison n\u00E3o pode tratar n\u00F3s do tipo {0}"},
-
- { ER_XERCES_CANNOT_HANDLE_NODES,
- "DOM2Helper n\u00E3o pode tratar n\u00F3s do tipo {0}"},
-
- { ER_XERCES_PARSE_ERROR_DETAILS,
- "Erro de DOM2Helper.parse: SystemID - {0} linha - {1}"},
-
- { ER_XERCES_PARSE_ERROR,
- "Erro de DOM2Helper.parse"},
-
- { ER_INVALID_UTF16_SURROGATE,
- "Foi detectado um substituto de UTF-16 inv\u00E1lido: {0} ?"},
-
- { ER_OIERROR,
- "Erro de E/S"},
-
- { ER_CANNOT_CREATE_URL,
- "N\u00E3o \u00E9 poss\u00EDvel criar o url para: {0}"},
-
- { ER_XPATH_READOBJECT,
- "No XPath.readObject: {0}"},
-
- { ER_FUNCTION_TOKEN_NOT_FOUND,
- "token da fun\u00E7\u00E3o n\u00E3o encontrado."},
-
- { ER_CANNOT_DEAL_XPATH_TYPE,
- "N\u00E3o \u00E9 poss\u00EDvel lidar com o tipo de XPath: {0}"},
-
- { ER_NODESET_NOT_MUTABLE,
- "Este NodeSet n\u00E3o \u00E9 mut\u00E1vel"},
-
- { ER_NODESETDTM_NOT_MUTABLE,
- "Este NodeSetDTM n\u00E3o \u00E9 mut\u00E1vel"},
-
- { ER_VAR_NOT_RESOLVABLE,
- "Vari\u00E1vel n\u00E3o resolv\u00EDvel: {0}"},
-
- { ER_NULL_ERROR_HANDLER,
- "Handler de erro nulo"},
-
- { ER_PROG_ASSERT_UNKNOWN_OPCODE,
- "Asser\u00E7\u00E3o do programador: opcode desconhecido: {0}"},
-
- { ER_ZERO_OR_ONE,
- "0 ou 1"},
-
- { ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "rtf() n\u00E3o suportado por XRTreeFragSelectWrapper"},
-
- { ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "asNodeIterator() n\u00E3o suportado por XRTreeFragSelectWrapper"},
-
- /** detach() not supported by XRTreeFragSelectWrapper */
- { ER_DETACH_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "detach() n\u00E3o suportado por XRTreeFragSelectWrapper"},
-
- /** num() not supported by XRTreeFragSelectWrapper */
- { ER_NUM_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "num() n\u00E3o suportado por XRTreeFragSelectWrapper"},
-
- /** xstr() not supported by XRTreeFragSelectWrapper */
- { ER_XSTR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "xstr() n\u00E3o suportado por XRTreeFragSelectWrapper"},
-
- /** str() not supported by XRTreeFragSelectWrapper */
- { ER_STR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "str() n\u00E3o suportado por XRTreeFragSelectWrapper"},
-
- { ER_FSB_NOT_SUPPORTED_XSTRINGFORCHARS,
- "fsb() n\u00E3o suportado para XStringForChars"},
-
- { ER_COULD_NOT_FIND_VAR,
- "N\u00E3o foi poss\u00EDvel localizar a vari\u00E1vel com o nome {0}"},
-
- { ER_XSTRINGFORCHARS_CANNOT_TAKE_STRING,
- "XStringForChars n\u00E3o pode ter uma string para um argumento"},
-
- { ER_FASTSTRINGBUFFER_CANNOT_BE_NULL,
- "O argumento FastStringBuffer n\u00E3o pode ser nulo"},
-
- { ER_TWO_OR_THREE,
- "2 ou 3"},
-
- { ER_VARIABLE_ACCESSED_BEFORE_BIND,
- "Vari\u00E1vel acessada antes de ser associada!"},
-
- { ER_FSB_CANNOT_TAKE_STRING,
- "XStringForFSB n\u00E3o pode obter uma string para um argumento!"},
-
- { ER_SETTING_WALKER_ROOT_TO_NULL,
- "\n !!!! Erro! Definindo a raiz de um walker como nula!!!"},
-
- { ER_NODESETDTM_CANNOT_ITERATE,
- "Este NodeSetDTM n\u00E3o pode fazer itera\u00E7\u00F5es para um n\u00F3 anterior!"},
-
- { ER_NODESET_CANNOT_ITERATE,
- "Este NodeSet n\u00E3o pode fazer itera\u00E7\u00F5es para um n\u00F3 anterior!"},
-
- { ER_NODESETDTM_CANNOT_INDEX,
- "Este NodeSetDTM n\u00E3o pode executar as fun\u00E7\u00F5es de indexa\u00E7\u00E3o ou de contagem!"},
-
- { ER_NODESET_CANNOT_INDEX,
- "Este NodeSet n\u00E3o pode executar as fun\u00E7\u00F5es de indexa\u00E7\u00E3o ou de contagem!"},
-
- { ER_CANNOT_CALL_SETSHOULDCACHENODE,
- "N\u00E3o \u00E9 poss\u00EDvel chamar setShouldCacheNodes depois de nextNode ter sido chamado!"},
-
- { ER_ONLY_ALLOWS,
- "{0} s\u00F3 permite {1} argumentos"},
-
- { ER_UNKNOWN_STEP,
- "Asser\u00E7\u00E3o do programador em getNextStepPos: stepType desconhecido: {0}"},
-
- //Note to translators: A relative location path is a form of XPath expression.
- // The message indicates that such an expression was expected following the
- // characters '/' or '//', but was not found.
- { ER_EXPECTED_REL_LOC_PATH,
- "Esperava-se um caminho de localiza\u00E7\u00E3o relativo, mas o seguinte token foi encontrado: '/' ou '//'."},
-
- // Note to translators: A location path is a form of XPath expression.
- // The message indicates that syntactically such an expression was expected,but
- // the characters specified by the substitution text were encountered instead.
- { ER_EXPECTED_LOC_PATH,
- "Esperava-se um caminho de localiza\u00E7\u00E3o, mas o seguinte token foi encontrado: {0}"},
-
- // Note to translators: A location path is a form of XPath expression.
- // The message indicates that syntactically such a subexpression was expected,
- // but no more characters were found in the expression.
- { ER_EXPECTED_LOC_PATH_AT_END_EXPR,
- "Esperava-se um caminho de localiza\u00E7\u00E3o, mas, em vez disso, o fim da express\u00E3o XPath foi encontrado."},
-
- // Note to translators: A location step is part of an XPath expression.
- // The message indicates that syntactically such an expression was expected
- // following the specified characters.
- { ER_EXPECTED_LOC_STEP,
- "Esperava-se uma etapa de localiza\u00E7\u00E3o seguinte ao token '/' ou '//'."},
-
- // Note to translators: A node test is part of an XPath expression that is
- // used to test for particular kinds of nodes. In this case, a node test that
- // consists of an NCName followed by a colon and an asterisk or that consists
- // of a QName was expected, but was not found.
- { ER_EXPECTED_NODE_TEST,
- "Esperava-se um teste de n\u00F3 que corresponde a NCName:* ou QName."},
-
- // Note to translators: A step pattern is part of an XPath expression.
- // The message indicates that syntactically such an expression was expected,
- // but the specified character was found in the expression instead.
- { ER_EXPECTED_STEP_PATTERN,
- "Esperava-se um padr\u00E3o da etapa, mas '/' foi encontrado."},
-
- // Note to translators: A relative path pattern is part of an XPath expression.
- // The message indicates that syntactically such an expression was expected,
- // but was not found.
- { ER_EXPECTED_REL_PATH_PATTERN,
- "Esperava-se um padr\u00E3o de caminho relativo."},
-
- // Note to translators: The substitution text is the name of a data type. The
- // message indicates that a value of a particular type could not be converted
- // to a value of type boolean.
- { ER_CANT_CONVERT_TO_BOOLEAN,
- "O XPathResult da express\u00E3o de XPath ''{0}'' tem um XPathResultType de {1} que n\u00E3o pode ser convertido em um booliano."},
-
- // Note to translators: Do not translate ANY_UNORDERED_NODE_TYPE and
- // FIRST_ORDERED_NODE_TYPE.
- { ER_CANT_CONVERT_TO_SINGLENODE,
- "O XPathResult da express\u00E3o de XPath ''{0}'' tem um XPathResultType de {1} que n\u00E3o pode ser convertido em um n\u00F3 simples. O m\u00E9todo getSingleNodeValue aplica-se somente aos tipos ANY_UNORDERED_NODE_TYPE e FIRST_ORDERED_NODE_TYPE."},
-
- // Note to translators: Do not translate UNORDERED_NODE_SNAPSHOT_TYPE and
- // ORDERED_NODE_SNAPSHOT_TYPE.
- { ER_CANT_GET_SNAPSHOT_LENGTH,
- "O m\u00E9todo getSnapshotLength n\u00E3o pode ser chamado no XPathResult da express\u00E3o XPath ''{0}'' porque seu XPathResultType \u00E9 {1}. Este m\u00E9todo se aplica somente a tipos UNORDERED_NODE_SNAPSHOT_TYPE e ORDERED_NODE_SNAPSHOT_TYPE."},
-
- { ER_NON_ITERATOR_TYPE,
- "O m\u00E9todo iterateNext n\u00E3o pode ser chamado no XPathResult da express\u00E3o XPath ''{0}'' porque seu XPathResultType \u00E9 {1}. Este m\u00E9todo se aplica somente a tipos UNORDERED_NODE_ITERATOR_TYPE e ORDERED_NODE_ITERATOR_TYPE."},
-
- // Note to translators: This message indicates that the document being operated
- // upon changed, so the iterator object that was being used to traverse the
- // document has now become invalid.
- { ER_DOC_MUTATED,
- "Documento alterado desde que o resultado foi devolvido. O iterador \u00E9 inv\u00E1lido."},
-
- { ER_INVALID_XPATH_TYPE,
- "Argumento de tipo XPath inv\u00E1lido: {0}"},
-
- { ER_EMPTY_XPATH_RESULT,
- "Objeto de resultado de XPath vazio"},
-
- { ER_INCOMPATIBLE_TYPES,
- "O XPathResult da express\u00E3o XPath ''{0}'' tem um XPathResultType {1} que n\u00E3o pode estar delimitado no XPathResultType especificado {2}."},
-
- { ER_NULL_RESOLVER,
- "N\u00E3o \u00E9 poss\u00EDvel resolver o prefixo com solucionador de prefixo nulo."},
-
- // Note to translators: The substitution text is the name of a data type. The
- // message indicates that a value of a particular type could not be converted
- // to a value of type string.
- { ER_CANT_CONVERT_TO_STRING,
- "O XPathResult da express\u00E3o XPath ''{0}'' tem um XPathResultType {1} que n\u00E3o pode ser convertido em string."},
-
- // Note to translators: Do not translate snapshotItem,
- // UNORDERED_NODE_SNAPSHOT_TYPE and ORDERED_NODE_SNAPSHOT_TYPE.
- { ER_NON_SNAPSHOT_TYPE,
- "O m\u00E9todo snapshotItem n\u00E3o pode ser chamado no XPathResult da express\u00E3o XPath ''{0}'' porque seu XPathResultType \u00E9 {1}. Este m\u00E9todo se aplica somente a tipos UNORDERED_NODE_SNAPSHOT_TYPE e ORDERED_NODE_SNAPSHOT_TYPE."},
-
- // Note to translators: XPathEvaluator is a Java interface name. An
- // XPathEvaluator is created with respect to a particular XML document, and in
- // this case the expression represented by this object was being evaluated with
- // respect to a context node from a different document.
- { ER_WRONG_DOCUMENT,
- "O n\u00F3 de contexto n\u00E3o pertence ao documento que est\u00E1 vinculado a este XPathEvaluator."},
-
- // Note to translators: The XPath expression cannot be evaluated with respect
- // to this type of node.
- { ER_WRONG_NODETYPE,
- "O tipo do n\u00F3 de contexto n\u00E3o \u00E9 suportado."},
-
- { ER_XPATH_ERROR,
- "Erro desconhecido no XPath."},
-
- { ER_CANT_CONVERT_XPATHRESULTTYPE_TO_NUMBER,
- "O XPathResult da express\u00E3o XPath ''{0}'' tem um XPathResultType {1} que n\u00E3o pode ser convertido em n\u00FAmero."},
-
- //BEGIN: Definitions of error keys used in exception messages of JAXP 1.3 XPath API implementation
-
- /** Field ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED */
-
- { ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED,
- "Fun\u00E7\u00E3o de extens\u00E3o: ''{0}'' n\u00E3o pode ser chamado quando o recurso XMLConstants.FEATURE_SECURE_PROCESSING estiver definido como verdadeiro."},
-
- /** Field ER_RESOLVE_VARIABLE_RETURNS_NULL */
-
- { ER_RESOLVE_VARIABLE_RETURNS_NULL,
- "resolveVariable da vari\u00E1vel {0} retornando nulo"},
-
- /** Field ER_UNSUPPORTED_RETURN_TYPE */
-
- { ER_UNSUPPORTED_RETURN_TYPE,
- "Tipo de Retorno N\u00E3o Suportado : {0}"},
-
- /** Field ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL */
-
- { ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL,
- "O Tipo de Origem e/ou Retorno n\u00E3o pode ser nulo"},
-
- /** Field ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL */
-
- { ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL,
- "O Tipo de Origem e/ou Retorno n\u00E3o pode ser nulo"},
-
- /** Field ER_ARG_CANNOT_BE_NULL */
-
- { ER_ARG_CANNOT_BE_NULL,
- "O argumento {0} n\u00E3o pode ser nulo"},
-
- /** Field ER_OBJECT_MODEL_NULL */
-
- { ER_OBJECT_MODEL_NULL,
- "{0}#isObjectModelSupported( String objectModel ) n\u00E3o pode ser chamado com objectModel == null"},
-
- /** Field ER_OBJECT_MODEL_EMPTY */
-
- { ER_OBJECT_MODEL_EMPTY,
- "{0}#isObjectModelSupported( String objectModel ) n\u00E3o pode ser chamado com objectModel == \"\""},
-
- /** Field ER_OBJECT_MODEL_EMPTY */
-
- { ER_FEATURE_NAME_NULL,
- "Tentativa de definir um recurso com um nome nulo: {0}#setFeature( null, {1})"},
-
- /** Field ER_FEATURE_UNKNOWN */
-
- { ER_FEATURE_UNKNOWN,
- "Tentativa de definir o recurso desconhecido \"{0}\":{1}#setFeature({0},{2})"},
-
- /** Field ER_GETTING_NULL_FEATURE */
-
- { ER_GETTING_NULL_FEATURE,
- "Tentativa de obter um recurso com um nome nulo: {0}#getFeature(null)"},
-
- /** Field ER_GETTING_NULL_FEATURE */
-
- { ER_GETTING_UNKNOWN_FEATURE,
- "Tentativa de obter o recurso desconhecido \"{0}\":{1}#getFeature({0})"},
-
- {ER_SECUREPROCESSING_FEATURE,
- "FEATURE_SECURE_PROCESSING: N\u00E3o \u00E9 poss\u00EDvel definir o recurso como falso quando o gerenciador de seguran\u00E7a est\u00E1 presente: {1}#setFeature({0},{2})"},
-
- /** Field ER_NULL_XPATH_FUNCTION_RESOLVER */
-
- { ER_NULL_XPATH_FUNCTION_RESOLVER,
- "Tentativa de definir um XPathFunctionResolver nulo:{0}#setXPathFunctionResolver(null)"},
-
- /** Field ER_NULL_XPATH_VARIABLE_RESOLVER */
-
- { ER_NULL_XPATH_VARIABLE_RESOLVER,
- "Tentativa de definir um XPathVariableResolver nulo:{0}#setXPathVariableResolver(null)"},
-
- //END: Definitions of error keys used in exception messages of JAXP 1.3 XPath API implementation
-
- // Warnings...
-
- { WG_LOCALE_NAME_NOT_HANDLED,
- "nome das configura\u00E7\u00F5es regionais na fun\u00E7\u00E3o format-number ainda n\u00E3o tratado!"},
-
- { WG_PROPERTY_NOT_SUPPORTED,
- "Propriedade XSL n\u00E3o suportada: {0}"},
-
- { WG_DONT_DO_ANYTHING_WITH_NS,
- "Nenhuma a\u00E7\u00E3o a ser tomada com o namespace {0} na propriedade: {1}"},
-
- { WG_SECURITY_EXCEPTION,
- "SecurityException ao tentar acessar a propriedade de sistema XSL: {0}"},
-
- { WG_QUO_NO_LONGER_DEFINED,
- "Sintaxe antiga: quo(...) n\u00E3o est\u00E1 mais definido no XPath."},
-
- { WG_NEED_DERIVED_OBJECT_TO_IMPLEMENT_NODETEST,
- "XPath requer um objeto derivado para implementar nodeTest!"},
-
- { WG_FUNCTION_TOKEN_NOT_FOUND,
- "token da fun\u00E7\u00E3o n\u00E3o encontrado."},
-
- { WG_COULDNOT_FIND_FUNCTION,
- "N\u00E3o foi poss\u00EDvel localizar a fun\u00E7\u00E3o: {0}"},
-
- { WG_CANNOT_MAKE_URL_FROM,
- "N\u00E3o \u00E9 poss\u00EDvel criar o URL de: {0}"},
-
- { WG_EXPAND_ENTITIES_NOT_SUPPORTED,
- "Op\u00E7\u00E3o -E n\u00E3o suportada para o parser DTM"},
-
- { WG_ILLEGAL_VARIABLE_REFERENCE,
- "VariableReference fornecida para a vari\u00E1vel fora do contexto ou sem defini\u00E7\u00E3o! Nome = {0}"},
-
- { WG_UNSUPPORTED_ENCODING,
- "Codifica\u00E7\u00E3o n\u00E3o suportada: {0}"},
-
-
-
- // Other miscellaneous text used inside the code...
- { "ui_language", "pt-BR"},
- { "help_language", "pt-BR"},
- { "language", "pt-BR"},
- { "BAD_CODE", "O par\u00E2metro para createMessage estava fora dos limites"},
- { "FORMAT_FAILED", "Exce\u00E7\u00E3o gerada durante a chamada messageFormat"},
- { "version", ">>>>>>> Vers\u00E3o do Xalan "},
- { "version2", "<<<<<<<"},
- { "yes", "sim"},
- { "line", "N\u00B0 da Linha"},
- { "column", "N\u00B0 da Coluna"},
- { "xsldone", "XSLProcessor: conclu\u00EDdo"},
- { "xpath_option", "op\u00E7\u00F5es de xpath: "},
- { "optionIN", " [-in inputXMLURL]"},
- { "optionSelect", " [-select xpath expression]"},
- { "optionMatch", " [-match match pattern (para diagn\u00F3sticos correspondentes)]"},
- { "optionAnyExpr", "Ou apenas uma express\u00E3o xpath far\u00E1 uma elimina\u00E7\u00E3o de diagn\u00F3sticos"},
- { "noParsermsg1", "Processo XSL malsucedido."},
- { "noParsermsg2", "** N\u00E3o foi poss\u00EDvel localizar o parser **"},
- { "noParsermsg3", "Verifique seu classpath."},
- { "noParsermsg4", "Se voc\u00EA n\u00E3o tiver um Parser XML da IBM para Java, poder\u00E1 fazer download dele em"},
- { "noParsermsg5", "AlphaWorks da IBM: http://www.alphaworks.ibm.com/formula/xml"},
- { "gtone", ">1" },
- { "zero", "0" },
- { "one", "1" },
- { "two" , "2" },
- { "three", "3" }
-
- };
-
- /**
- * Get the association list.
- *
- * @return The association list.
- */
- public Object[][] getContents()
- {
- return _contents;
- }
-
-
- // ================= INFRASTRUCTURE ======================
-
- /** Field BAD_CODE */
- public static final String BAD_CODE = "BAD_CODE";
-
- /** Field FORMAT_FAILED */
- public static final String FORMAT_FAILED = "FORMAT_FAILED";
-
- /** Field ERROR_RESOURCES */
- public static final String ERROR_RESOURCES =
- "com.sun.org.apache.xpath.internal.res.XPATHErrorResources";
-
- /** Field ERROR_STRING */
- public static final String ERROR_STRING = "#error";
-
- /** Field ERROR_HEADER */
- public static final String ERROR_HEADER = "Error: ";
-
- /** Field WARNING_HEADER */
- public static final String WARNING_HEADER = "Warning: ";
-
- /** Field XSL_HEADER */
- public static final String XSL_HEADER = "XSL ";
-
- /** Field XML_HEADER */
- public static final String XML_HEADER = "XML ";
-
- /** Field QUERY_HEADER */
- public static final String QUERY_HEADER = "PATTERN ";
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_sv.java b/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_sv.java
deleted file mode 100644
index 34ad0f1..0000000
--- a/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_sv.java
+++ /dev/null
@@ -1,936 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xpath.internal.res;
-
-import java.util.ListResourceBundle;
-
-/**
- * Set up error messages.
- * We build a two dimensional array of message keys and
- * message strings. In order to add a new message here,
- * you need to first add a Static string constant for the
- * Key and update the contents array with Key, Value pair
- * Also you need to update the count of messages(MAX_CODE)or
- * the count of warnings(MAX_WARNING) [ Information purpose only]
- * @xsl.usage advanced
- */
-public class XPATHErrorResources_sv extends ListResourceBundle
-{
-
-/*
- * General notes to translators:
- *
- * This file contains error and warning messages related to XPath Error
- * Handling.
- *
- * 1) Xalan (or more properly, Xalan-interpretive) and XSLTC are names of
- * components.
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- * XSLTC is an acronym for XSLT Compiler.
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 5) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 6) "Translet" is an invented term that describes the class file that
- * results from compiling an XML stylesheet into a Java class.
- *
- * 7) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- * 8) The context node is the node in the document with respect to which an
- * XPath expression is being evaluated.
- *
- * 9) An iterator is an object that traverses nodes in the tree, one at a time.
- *
- * 10) NCName is an XML term used to describe a name that does not contain a
- * colon (a "no-colon name").
- *
- * 11) QName is an XML term meaning "qualified name".
- */
-
- /*
- * static variables
- */
- public static final String ERROR0000 = "ERROR0000";
- public static final String ER_CURRENT_NOT_ALLOWED_IN_MATCH =
- "ER_CURRENT_NOT_ALLOWED_IN_MATCH";
- public static final String ER_CURRENT_TAKES_NO_ARGS =
- "ER_CURRENT_TAKES_NO_ARGS";
- public static final String ER_DOCUMENT_REPLACED = "ER_DOCUMENT_REPLACED";
- public static final String ER_CONTEXT_HAS_NO_OWNERDOC =
- "ER_CONTEXT_HAS_NO_OWNERDOC";
- public static final String ER_LOCALNAME_HAS_TOO_MANY_ARGS =
- "ER_LOCALNAME_HAS_TOO_MANY_ARGS";
- public static final String ER_NAMESPACEURI_HAS_TOO_MANY_ARGS =
- "ER_NAMESPACEURI_HAS_TOO_MANY_ARGS";
- public static final String ER_NORMALIZESPACE_HAS_TOO_MANY_ARGS =
- "ER_NORMALIZESPACE_HAS_TOO_MANY_ARGS";
- public static final String ER_NUMBER_HAS_TOO_MANY_ARGS =
- "ER_NUMBER_HAS_TOO_MANY_ARGS";
- public static final String ER_NAME_HAS_TOO_MANY_ARGS =
- "ER_NAME_HAS_TOO_MANY_ARGS";
- public static final String ER_STRING_HAS_TOO_MANY_ARGS =
- "ER_STRING_HAS_TOO_MANY_ARGS";
- public static final String ER_STRINGLENGTH_HAS_TOO_MANY_ARGS =
- "ER_STRINGLENGTH_HAS_TOO_MANY_ARGS";
- public static final String ER_TRANSLATE_TAKES_3_ARGS =
- "ER_TRANSLATE_TAKES_3_ARGS";
- public static final String ER_UNPARSEDENTITYURI_TAKES_1_ARG =
- "ER_UNPARSEDENTITYURI_TAKES_1_ARG";
- public static final String ER_NAMESPACEAXIS_NOT_IMPLEMENTED =
- "ER_NAMESPACEAXIS_NOT_IMPLEMENTED";
- public static final String ER_UNKNOWN_AXIS = "ER_UNKNOWN_AXIS";
- public static final String ER_UNKNOWN_MATCH_OPERATION =
- "ER_UNKNOWN_MATCH_OPERATION";
- public static final String ER_INCORRECT_ARG_LENGTH ="ER_INCORRECT_ARG_LENGTH";
- public static final String ER_CANT_CONVERT_TO_NUMBER =
- "ER_CANT_CONVERT_TO_NUMBER";
- public static final String ER_CANT_CONVERT_XPATHRESULTTYPE_TO_NUMBER =
- "ER_CANT_CONVERT_XPATHRESULTTYPE_TO_NUMBER";
- public static final String ER_CANT_CONVERT_TO_NODELIST =
- "ER_CANT_CONVERT_TO_NODELIST";
- public static final String ER_CANT_CONVERT_TO_MUTABLENODELIST =
- "ER_CANT_CONVERT_TO_MUTABLENODELIST";
- public static final String ER_CANT_CONVERT_TO_TYPE ="ER_CANT_CONVERT_TO_TYPE";
- public static final String ER_EXPECTED_MATCH_PATTERN =
- "ER_EXPECTED_MATCH_PATTERN";
- public static final String ER_COULDNOT_GET_VAR_NAMED =
- "ER_COULDNOT_GET_VAR_NAMED";
- public static final String ER_UNKNOWN_OPCODE = "ER_UNKNOWN_OPCODE";
- public static final String ER_EXTRA_ILLEGAL_TOKENS ="ER_EXTRA_ILLEGAL_TOKENS";
- public static final String ER_EXPECTED_DOUBLE_QUOTE =
- "ER_EXPECTED_DOUBLE_QUOTE";
- public static final String ER_EXPECTED_SINGLE_QUOTE =
- "ER_EXPECTED_SINGLE_QUOTE";
- public static final String ER_EMPTY_EXPRESSION = "ER_EMPTY_EXPRESSION";
- public static final String ER_EXPECTED_BUT_FOUND = "ER_EXPECTED_BUT_FOUND";
- public static final String ER_INCORRECT_PROGRAMMER_ASSERTION =
- "ER_INCORRECT_PROGRAMMER_ASSERTION";
- public static final String ER_BOOLEAN_ARG_NO_LONGER_OPTIONAL =
- "ER_BOOLEAN_ARG_NO_LONGER_OPTIONAL";
- public static final String ER_FOUND_COMMA_BUT_NO_PRECEDING_ARG =
- "ER_FOUND_COMMA_BUT_NO_PRECEDING_ARG";
- public static final String ER_FOUND_COMMA_BUT_NO_FOLLOWING_ARG =
- "ER_FOUND_COMMA_BUT_NO_FOLLOWING_ARG";
- public static final String ER_PREDICATE_ILLEGAL_SYNTAX =
- "ER_PREDICATE_ILLEGAL_SYNTAX";
- public static final String ER_ILLEGAL_AXIS_NAME = "ER_ILLEGAL_AXIS_NAME";
- public static final String ER_UNKNOWN_NODETYPE = "ER_UNKNOWN_NODETYPE";
- public static final String ER_PATTERN_LITERAL_NEEDS_BE_QUOTED =
- "ER_PATTERN_LITERAL_NEEDS_BE_QUOTED";
- public static final String ER_COULDNOT_BE_FORMATTED_TO_NUMBER =
- "ER_COULDNOT_BE_FORMATTED_TO_NUMBER";
- public static final String ER_COULDNOT_CREATE_XMLPROCESSORLIAISON =
- "ER_COULDNOT_CREATE_XMLPROCESSORLIAISON";
- public static final String ER_DIDNOT_FIND_XPATH_SELECT_EXP =
- "ER_DIDNOT_FIND_XPATH_SELECT_EXP";
- public static final String ER_COULDNOT_FIND_ENDOP_AFTER_OPLOCATIONPATH =
- "ER_COULDNOT_FIND_ENDOP_AFTER_OPLOCATIONPATH";
- public static final String ER_ERROR_OCCURED = "ER_ERROR_OCCURED";
- public static final String ER_ILLEGAL_VARIABLE_REFERENCE =
- "ER_ILLEGAL_VARIABLE_REFERENCE";
- public static final String ER_AXES_NOT_ALLOWED = "ER_AXES_NOT_ALLOWED";
- public static final String ER_KEY_HAS_TOO_MANY_ARGS =
- "ER_KEY_HAS_TOO_MANY_ARGS";
- public static final String ER_COUNT_TAKES_1_ARG = "ER_COUNT_TAKES_1_ARG";
- public static final String ER_COULDNOT_FIND_FUNCTION =
- "ER_COULDNOT_FIND_FUNCTION";
- public static final String ER_UNSUPPORTED_ENCODING ="ER_UNSUPPORTED_ENCODING";
- public static final String ER_PROBLEM_IN_DTM_NEXTSIBLING =
- "ER_PROBLEM_IN_DTM_NEXTSIBLING";
- public static final String ER_CANNOT_WRITE_TO_EMPTYNODELISTIMPL =
- "ER_CANNOT_WRITE_TO_EMPTYNODELISTIMPL";
- public static final String ER_SETDOMFACTORY_NOT_SUPPORTED =
- "ER_SETDOMFACTORY_NOT_SUPPORTED";
- public static final String ER_PREFIX_MUST_RESOLVE = "ER_PREFIX_MUST_RESOLVE";
- public static final String ER_PARSE_NOT_SUPPORTED = "ER_PARSE_NOT_SUPPORTED";
- public static final String ER_SAX_API_NOT_HANDLED = "ER_SAX_API_NOT_HANDLED";
-public static final String ER_IGNORABLE_WHITESPACE_NOT_HANDLED =
- "ER_IGNORABLE_WHITESPACE_NOT_HANDLED";
- public static final String ER_DTM_CANNOT_HANDLE_NODES =
- "ER_DTM_CANNOT_HANDLE_NODES";
- public static final String ER_XERCES_CANNOT_HANDLE_NODES =
- "ER_XERCES_CANNOT_HANDLE_NODES";
- public static final String ER_XERCES_PARSE_ERROR_DETAILS =
- "ER_XERCES_PARSE_ERROR_DETAILS";
- public static final String ER_XERCES_PARSE_ERROR = "ER_XERCES_PARSE_ERROR";
- public static final String ER_INVALID_UTF16_SURROGATE =
- "ER_INVALID_UTF16_SURROGATE";
- public static final String ER_OIERROR = "ER_OIERROR";
- public static final String ER_CANNOT_CREATE_URL = "ER_CANNOT_CREATE_URL";
- public static final String ER_XPATH_READOBJECT = "ER_XPATH_READOBJECT";
- public static final String ER_FUNCTION_TOKEN_NOT_FOUND =
- "ER_FUNCTION_TOKEN_NOT_FOUND";
- public static final String ER_CANNOT_DEAL_XPATH_TYPE =
- "ER_CANNOT_DEAL_XPATH_TYPE";
- public static final String ER_NODESET_NOT_MUTABLE = "ER_NODESET_NOT_MUTABLE";
- public static final String ER_NODESETDTM_NOT_MUTABLE =
- "ER_NODESETDTM_NOT_MUTABLE";
- /** Variable not resolvable: */
- public static final String ER_VAR_NOT_RESOLVABLE = "ER_VAR_NOT_RESOLVABLE";
- /** Null error handler */
- public static final String ER_NULL_ERROR_HANDLER = "ER_NULL_ERROR_HANDLER";
- /** Programmer's assertion: unknown opcode */
- public static final String ER_PROG_ASSERT_UNKNOWN_OPCODE =
- "ER_PROG_ASSERT_UNKNOWN_OPCODE";
- /** 0 or 1 */
- public static final String ER_ZERO_OR_ONE = "ER_ZERO_OR_ONE";
- /** rtf() not supported by XRTreeFragSelectWrapper */
- public static final String ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** asNodeIterator() not supported by XRTreeFragSelectWrapper */
- public static final String ER_ASNODEITERATOR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER = "ER_ASNODEITERATOR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** fsb() not supported for XStringForChars */
- public static final String ER_FSB_NOT_SUPPORTED_XSTRINGFORCHARS =
- "ER_FSB_NOT_SUPPORTED_XSTRINGFORCHARS";
- /** Could not find variable with the name of */
- public static final String ER_COULD_NOT_FIND_VAR = "ER_COULD_NOT_FIND_VAR";
- /** XStringForChars can not take a string for an argument */
- public static final String ER_XSTRINGFORCHARS_CANNOT_TAKE_STRING =
- "ER_XSTRINGFORCHARS_CANNOT_TAKE_STRING";
- /** The FastStringBuffer argument can not be null */
- public static final String ER_FASTSTRINGBUFFER_CANNOT_BE_NULL =
- "ER_FASTSTRINGBUFFER_CANNOT_BE_NULL";
- /** 2 or 3 */
- public static final String ER_TWO_OR_THREE = "ER_TWO_OR_THREE";
- /** Variable accessed before it is bound! */
- public static final String ER_VARIABLE_ACCESSED_BEFORE_BIND =
- "ER_VARIABLE_ACCESSED_BEFORE_BIND";
- /** XStringForFSB can not take a string for an argument! */
- public static final String ER_FSB_CANNOT_TAKE_STRING =
- "ER_FSB_CANNOT_TAKE_STRING";
- /** Error! Setting the root of a walker to null! */
- public static final String ER_SETTING_WALKER_ROOT_TO_NULL =
- "ER_SETTING_WALKER_ROOT_TO_NULL";
- /** This NodeSetDTM can not iterate to a previous node! */
- public static final String ER_NODESETDTM_CANNOT_ITERATE =
- "ER_NODESETDTM_CANNOT_ITERATE";
- /** This NodeSet can not iterate to a previous node! */
- public static final String ER_NODESET_CANNOT_ITERATE =
- "ER_NODESET_CANNOT_ITERATE";
- /** This NodeSetDTM can not do indexing or counting functions! */
- public static final String ER_NODESETDTM_CANNOT_INDEX =
- "ER_NODESETDTM_CANNOT_INDEX";
- /** This NodeSet can not do indexing or counting functions! */
- public static final String ER_NODESET_CANNOT_INDEX =
- "ER_NODESET_CANNOT_INDEX";
- /** Can not call setShouldCacheNodes after nextNode has been called! */
- public static final String ER_CANNOT_CALL_SETSHOULDCACHENODE =
- "ER_CANNOT_CALL_SETSHOULDCACHENODE";
- /** {0} only allows {1} arguments */
- public static final String ER_ONLY_ALLOWS = "ER_ONLY_ALLOWS";
- /** Programmer's assertion in getNextStepPos: unknown stepType: {0} */
- public static final String ER_UNKNOWN_STEP = "ER_UNKNOWN_STEP";
- /** Problem with RelativeLocationPath */
- public static final String ER_EXPECTED_REL_LOC_PATH =
- "ER_EXPECTED_REL_LOC_PATH";
- /** Problem with LocationPath */
- public static final String ER_EXPECTED_LOC_PATH = "ER_EXPECTED_LOC_PATH";
- public static final String ER_EXPECTED_LOC_PATH_AT_END_EXPR =
- "ER_EXPECTED_LOC_PATH_AT_END_EXPR";
- /** Problem with Step */
- public static final String ER_EXPECTED_LOC_STEP = "ER_EXPECTED_LOC_STEP";
- /** Problem with NodeTest */
- public static final String ER_EXPECTED_NODE_TEST = "ER_EXPECTED_NODE_TEST";
- /** Expected step pattern */
- public static final String ER_EXPECTED_STEP_PATTERN =
- "ER_EXPECTED_STEP_PATTERN";
- /** Expected relative path pattern */
- public static final String ER_EXPECTED_REL_PATH_PATTERN =
- "ER_EXPECTED_REL_PATH_PATTERN";
- /** ER_CANT_CONVERT_XPATHRESULTTYPE_TO_BOOLEAN */
- public static final String ER_CANT_CONVERT_TO_BOOLEAN =
- "ER_CANT_CONVERT_TO_BOOLEAN";
- /** Field ER_CANT_CONVERT_TO_SINGLENODE */
- public static final String ER_CANT_CONVERT_TO_SINGLENODE =
- "ER_CANT_CONVERT_TO_SINGLENODE";
- /** Field ER_CANT_GET_SNAPSHOT_LENGTH */
- public static final String ER_CANT_GET_SNAPSHOT_LENGTH =
- "ER_CANT_GET_SNAPSHOT_LENGTH";
- /** Field ER_NON_ITERATOR_TYPE */
- public static final String ER_NON_ITERATOR_TYPE = "ER_NON_ITERATOR_TYPE";
- /** Field ER_DOC_MUTATED */
- public static final String ER_DOC_MUTATED = "ER_DOC_MUTATED";
- public static final String ER_INVALID_XPATH_TYPE = "ER_INVALID_XPATH_TYPE";
- public static final String ER_EMPTY_XPATH_RESULT = "ER_EMPTY_XPATH_RESULT";
- public static final String ER_INCOMPATIBLE_TYPES = "ER_INCOMPATIBLE_TYPES";
- public static final String ER_NULL_RESOLVER = "ER_NULL_RESOLVER";
- public static final String ER_CANT_CONVERT_TO_STRING =
- "ER_CANT_CONVERT_TO_STRING";
- public static final String ER_NON_SNAPSHOT_TYPE = "ER_NON_SNAPSHOT_TYPE";
- public static final String ER_WRONG_DOCUMENT = "ER_WRONG_DOCUMENT";
- /* Note to translators: The XPath expression cannot be evaluated with respect
- * to this type of node.
- */
- /** Field ER_WRONG_NODETYPE */
- public static final String ER_WRONG_NODETYPE = "ER_WRONG_NODETYPE";
- public static final String ER_XPATH_ERROR = "ER_XPATH_ERROR";
-
- //BEGIN: Keys needed for exception messages of JAXP 1.3 XPath API implementation
- public static final String ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED = "ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED";
- public static final String ER_RESOLVE_VARIABLE_RETURNS_NULL = "ER_RESOLVE_VARIABLE_RETURNS_NULL";
- public static final String ER_UNSUPPORTED_RETURN_TYPE = "ER_UNSUPPORTED_RETURN_TYPE";
- public static final String ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL = "ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL";
- public static final String ER_ARG_CANNOT_BE_NULL = "ER_ARG_CANNOT_BE_NULL";
-
- public static final String ER_OBJECT_MODEL_NULL = "ER_OBJECT_MODEL_NULL";
- public static final String ER_OBJECT_MODEL_EMPTY = "ER_OBJECT_MODEL_EMPTY";
- public static final String ER_FEATURE_NAME_NULL = "ER_FEATURE_NAME_NULL";
- public static final String ER_FEATURE_UNKNOWN = "ER_FEATURE_UNKNOWN";
- public static final String ER_GETTING_NULL_FEATURE = "ER_GETTING_NULL_FEATURE";
- public static final String ER_GETTING_UNKNOWN_FEATURE = "ER_GETTING_UNKNOWN_FEATURE";
- public static final String ER_SECUREPROCESSING_FEATURE = "ER_SECUREPROCESSING_FEATURE";
- public static final String ER_NULL_XPATH_FUNCTION_RESOLVER = "ER_NULL_XPATH_FUNCTION_RESOLVER";
- public static final String ER_NULL_XPATH_VARIABLE_RESOLVER = "ER_NULL_XPATH_VARIABLE_RESOLVER";
- //END: Keys needed for exception messages of JAXP 1.3 XPath API implementation
-
- public static final String WG_LOCALE_NAME_NOT_HANDLED =
- "WG_LOCALE_NAME_NOT_HANDLED";
- public static final String WG_PROPERTY_NOT_SUPPORTED =
- "WG_PROPERTY_NOT_SUPPORTED";
- public static final String WG_DONT_DO_ANYTHING_WITH_NS =
- "WG_DONT_DO_ANYTHING_WITH_NS";
- public static final String WG_SECURITY_EXCEPTION = "WG_SECURITY_EXCEPTION";
- public static final String WG_QUO_NO_LONGER_DEFINED =
- "WG_QUO_NO_LONGER_DEFINED";
- public static final String WG_NEED_DERIVED_OBJECT_TO_IMPLEMENT_NODETEST =
- "WG_NEED_DERIVED_OBJECT_TO_IMPLEMENT_NODETEST";
- public static final String WG_FUNCTION_TOKEN_NOT_FOUND =
- "WG_FUNCTION_TOKEN_NOT_FOUND";
- public static final String WG_COULDNOT_FIND_FUNCTION =
- "WG_COULDNOT_FIND_FUNCTION";
- public static final String WG_CANNOT_MAKE_URL_FROM ="WG_CANNOT_MAKE_URL_FROM";
- public static final String WG_EXPAND_ENTITIES_NOT_SUPPORTED =
- "WG_EXPAND_ENTITIES_NOT_SUPPORTED";
- public static final String WG_ILLEGAL_VARIABLE_REFERENCE =
- "WG_ILLEGAL_VARIABLE_REFERENCE";
- public static final String WG_UNSUPPORTED_ENCODING ="WG_UNSUPPORTED_ENCODING";
-
- /** detach() not supported by XRTreeFragSelectWrapper */
- public static final String ER_DETACH_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_DETACH_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** num() not supported by XRTreeFragSelectWrapper */
- public static final String ER_NUM_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_NUM_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** xstr() not supported by XRTreeFragSelectWrapper */
- public static final String ER_XSTR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_XSTR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** str() not supported by XRTreeFragSelectWrapper */
- public static final String ER_STR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_STR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
-
- // Error messages...
-
- private static final Object[][] _contents = new Object[][]{
-
- { "ERROR0000" , "{0}" },
-
- { ER_CURRENT_NOT_ALLOWED_IN_MATCH, "Funktionen current() \u00E4r inte till\u00E5ten i ett matchningsm\u00F6nster!" },
-
- { ER_CURRENT_TAKES_NO_ARGS, "Funktionen current() tar inte emot argument!" },
-
- { ER_DOCUMENT_REPLACED,
- "Implementeringen av funktionen document() har inte ersatts av com.sun.org.apache.xalan.internal.xslt.FuncDocument!"},
-
- { ER_CONTEXT_HAS_NO_OWNERDOC,
- "context har inget \u00E4gardokument!"},
-
- { ER_LOCALNAME_HAS_TOO_MANY_ARGS,
- "local-name() har f\u00F6r m\u00E5nga argument."},
-
- { ER_NAMESPACEURI_HAS_TOO_MANY_ARGS,
- "namespace-uri() har f\u00F6r m\u00E5nga argument."},
-
- { ER_NORMALIZESPACE_HAS_TOO_MANY_ARGS,
- "normalize-space() har f\u00F6r m\u00E5nga argument."},
-
- { ER_NUMBER_HAS_TOO_MANY_ARGS,
- "number() har f\u00F6r m\u00E5nga argument."},
-
- { ER_NAME_HAS_TOO_MANY_ARGS,
- "name() har f\u00F6r m\u00E5nga argument."},
-
- { ER_STRING_HAS_TOO_MANY_ARGS,
- "string() har f\u00F6r m\u00E5nga argument."},
-
- { ER_STRINGLENGTH_HAS_TOO_MANY_ARGS,
- "string-length() har f\u00F6r m\u00E5nga argument."},
-
- { ER_TRANSLATE_TAKES_3_ARGS,
- "Funktionen translate() tar emot tre argument!"},
-
- { ER_UNPARSEDENTITYURI_TAKES_1_ARG,
- "Funktionen unparsed-entity-uri borde ta emot ett argument!"},
-
- { ER_NAMESPACEAXIS_NOT_IMPLEMENTED,
- "namnrymdsaxeln \u00E4r inte implementerad \u00E4n!"},
-
- { ER_UNKNOWN_AXIS,
- "ok\u00E4nd axel: {0}"},
-
- { ER_UNKNOWN_MATCH_OPERATION,
- "ok\u00E4nd matchnings\u00E5tg\u00E4rd!"},
-
- { ER_INCORRECT_ARG_LENGTH,
- "Felaktig argumentl\u00E4ngd p\u00E5 nodtest f\u00F6r processing-instruction()!"},
-
- { ER_CANT_CONVERT_TO_NUMBER,
- "Kan inte konvertera {0} till ett tal"},
-
- { ER_CANT_CONVERT_TO_NODELIST,
- "Kan inte konvertera {0} till NodeList!"},
-
- { ER_CANT_CONVERT_TO_MUTABLENODELIST,
- "Kan inte konvertera {0} till NodeSetDTM!"},
-
- { ER_CANT_CONVERT_TO_TYPE,
- "Kan inte konvertera {0} till type#{1}"},
-
- { ER_EXPECTED_MATCH_PATTERN,
- "F\u00F6rv\u00E4ntat matchningsm\u00F6nster i getMatchScore!"},
-
- { ER_COULDNOT_GET_VAR_NAMED,
- "Kunde inte h\u00E4mta variabeln {0}"},
-
- { ER_UNKNOWN_OPCODE,
- "FEL! Ok\u00E4nd op-kod: {0}"},
-
- { ER_EXTRA_ILLEGAL_TOKENS,
- "Extra otill\u00E5tna tecken: {0}"},
-
- { ER_EXPECTED_DOUBLE_QUOTE,
- "Litteral omges av fel sorts citattecken... dubbla citattecken f\u00F6rv\u00E4ntade!"},
-
- { ER_EXPECTED_SINGLE_QUOTE,
- "Litteral omges av fel sorts citattecken... enkla citattecken f\u00F6rv\u00E4ntade!"},
-
- { ER_EMPTY_EXPRESSION,
- "Tomt uttryck!"},
-
- { ER_EXPECTED_BUT_FOUND,
- "F\u00F6rv\u00E4ntade {0}, men hittade: {1}"},
-
- { ER_INCORRECT_PROGRAMMER_ASSERTION,
- "Programmerarens utsaga \u00E4r inte korrekt! - {0}"},
-
- { ER_BOOLEAN_ARG_NO_LONGER_OPTIONAL,
- "Argumentet boolean(...) \u00E4r inte l\u00E4ngre valfritt med 19990709 XPath-utkast."},
-
- { ER_FOUND_COMMA_BUT_NO_PRECEDING_ARG,
- "Hittade ',' utan f\u00F6reg\u00E5ende argument!"},
-
- { ER_FOUND_COMMA_BUT_NO_FOLLOWING_ARG,
- "Hittade ',' utan efterf\u00F6ljande argument!"},
-
- { ER_PREDICATE_ILLEGAL_SYNTAX,
- "'..[predikat]' eller '.[predikat]' \u00E4r otill\u00E5ten syntax. Anv\u00E4nd 'self::node()[predikat]' ist\u00E4llet."},
-
- { ER_ILLEGAL_AXIS_NAME,
- "otill\u00E5tet axelnamn: {0}"},
-
- { ER_UNKNOWN_NODETYPE,
- "Ok\u00E4nd nodtyp: {0}"},
-
- { ER_PATTERN_LITERAL_NEEDS_BE_QUOTED,
- "M\u00F6nsterlitteralen ({0}) m\u00E5ste omges av citattecken!"},
-
- { ER_COULDNOT_BE_FORMATTED_TO_NUMBER,
- "{0} kunde inte formateras till ett tal!"},
-
- { ER_COULDNOT_CREATE_XMLPROCESSORLIAISON,
- "Kunde inte skapa XML TransformerFactory Liaison: {0}"},
-
- { ER_DIDNOT_FIND_XPATH_SELECT_EXP,
- "Fel! Hittade inte xpath select-uttryck (-select)."},
-
- { ER_COULDNOT_FIND_ENDOP_AFTER_OPLOCATIONPATH,
- "FEL! Hittade inte ENDOP efter OP_LOCATIONPATH"},
-
- { ER_ERROR_OCCURED,
- "Ett fel har intr\u00E4ffat!"},
-
- { ER_ILLEGAL_VARIABLE_REFERENCE,
- "VariableReference angiven f\u00F6r variabel som \u00E4r utanf\u00F6r kontext eller som saknar definition! Namn = {0}"},
-
- { ER_AXES_NOT_ALLOWED,
- "Endast underordnade:: och attribut::-axlar \u00E4r till\u00E5tna i matchningsm\u00F6nster! Regelvidriga axlar = {0}"},
-
- { ER_KEY_HAS_TOO_MANY_ARGS,
- "key() har felaktigt antal argument."},
-
- { ER_COUNT_TAKES_1_ARG,
- "Funktionen count borde ta emot ett argument!"},
-
- { ER_COULDNOT_FIND_FUNCTION,
- "Hittade inte funktionen: {0}"},
-
- { ER_UNSUPPORTED_ENCODING,
- "Kodning utan st\u00F6d: {0}"},
-
- { ER_PROBLEM_IN_DTM_NEXTSIBLING,
- "Problem intr\u00E4ffade i DTM i getNextSibling... f\u00F6rs\u00F6ker \u00E5terskapa"},
-
- { ER_CANNOT_WRITE_TO_EMPTYNODELISTIMPL,
- "Programmerarfel: kan inte skriva till EmptyNodeList."},
-
- { ER_SETDOMFACTORY_NOT_SUPPORTED,
- "setDOMFactory st\u00F6ds inte i XPathContext!"},
-
- { ER_PREFIX_MUST_RESOLVE,
- "Prefix m\u00E5ste matchas till en namnrymd: {0}"},
-
- { ER_PARSE_NOT_SUPPORTED,
- "tolkning (InputSource-k\u00E4lla) st\u00F6ds inte i XPathContext! Kan inte \u00F6ppna {0}"},
-
- { ER_SAX_API_NOT_HANDLED,
- "SAX API-tecken(char ch[]... hanteras inte av DTM!"},
-
- { ER_IGNORABLE_WHITESPACE_NOT_HANDLED,
- "ignorableWhitespace(char ch[]... hanteras inte av DTM!"},
-
- { ER_DTM_CANNOT_HANDLE_NODES,
- "DTMLiaison kan inte hantera noder av typ {0}"},
-
- { ER_XERCES_CANNOT_HANDLE_NODES,
- "DOM2Helper kan inte hantera noder av typ {0}"},
-
- { ER_XERCES_PARSE_ERROR_DETAILS,
- "Fel i DOM2Helper.parse: SystemID - {0} rad - {1}"},
-
- { ER_XERCES_PARSE_ERROR,
- "Fel i DOM2Helper.parse"},
-
- { ER_INVALID_UTF16_SURROGATE,
- "Ogiltigt UTF-16-surrogat uppt\u00E4ckt: {0} ?"},
-
- { ER_OIERROR,
- "IO-fel"},
-
- { ER_CANNOT_CREATE_URL,
- "Kan inte skapa URL f\u00F6r: {0}"},
-
- { ER_XPATH_READOBJECT,
- "I XPath.readObject: {0}"},
-
- { ER_FUNCTION_TOKEN_NOT_FOUND,
- "funktionstecken hittades inte."},
-
- { ER_CANNOT_DEAL_XPATH_TYPE,
- "Kan inte hantera XPath-typ: {0}"},
-
- { ER_NODESET_NOT_MUTABLE,
- "Detta NodeSet \u00E4r of\u00F6r\u00E4nderligt"},
-
- { ER_NODESETDTM_NOT_MUTABLE,
- "Detta NodeSetDTM \u00E4r of\u00F6r\u00E4nderligt"},
-
- { ER_VAR_NOT_RESOLVABLE,
- "Variabeln kan inte matchas: {0}"},
-
- { ER_NULL_ERROR_HANDLER,
- "Felhanterare med v\u00E4rde null"},
-
- { ER_PROG_ASSERT_UNKNOWN_OPCODE,
- "Programmerarens utsaga: ok\u00E4nd op-kod: {0}"},
-
- { ER_ZERO_OR_ONE,
- "0 eller 1"},
-
- { ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "rtf() st\u00F6ds inte av XRTreeFragSelectWrapper"},
-
- { ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "asNodeIterator() st\u00F6ds inte av XRTreeFragSelectWrapper"},
-
- /** detach() not supported by XRTreeFragSelectWrapper */
- { ER_DETACH_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "detach() st\u00F6ds inte av XRTreeFragSelectWrapper"},
-
- /** num() not supported by XRTreeFragSelectWrapper */
- { ER_NUM_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "num() st\u00F6ds inte av XRTreeFragSelectWrapper"},
-
- /** xstr() not supported by XRTreeFragSelectWrapper */
- { ER_XSTR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "xstr() st\u00F6ds inte av XRTreeFragSelectWrapper"},
-
- /** str() not supported by XRTreeFragSelectWrapper */
- { ER_STR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "str() st\u00F6ds inte av XRTreeFragSelectWrapper"},
-
- { ER_FSB_NOT_SUPPORTED_XSTRINGFORCHARS,
- "fsb() st\u00F6ds inte f\u00F6r XStringForChars"},
-
- { ER_COULD_NOT_FIND_VAR,
- "Hittade inte variabel med namnet {0}"},
-
- { ER_XSTRINGFORCHARS_CANNOT_TAKE_STRING,
- "XStringForChars kan inte ta emot en str\u00E4ng f\u00F6r argument"},
-
- { ER_FASTSTRINGBUFFER_CANNOT_BE_NULL,
- "FastStringBuffer-argumentet f\u00E5r inte vara null"},
-
- { ER_TWO_OR_THREE,
- "2 eller 3"},
-
- { ER_VARIABLE_ACCESSED_BEFORE_BIND,
- "\u00C5tkomst till variabel innan den \u00E4r bunden!"},
-
- { ER_FSB_CANNOT_TAKE_STRING,
- "XStringForFSB kan inte ta emot en str\u00E4ng f\u00F6r argument!"},
-
- { ER_SETTING_WALKER_ROOT_TO_NULL,
- "\n !!!! Fel! Anger roten f\u00F6r en ''walker'' som null!!!"},
-
- { ER_NODESETDTM_CANNOT_ITERATE,
- "Detta NodeSetDTM kan inte iterera till en tidigare nod!"},
-
- { ER_NODESET_CANNOT_ITERATE,
- "Detta NodeSet kan inte iterera till en tidigare nod!"},
-
- { ER_NODESETDTM_CANNOT_INDEX,
- "Detta NodeSetDTM kan inte utf\u00F6ra funktioner som indexerar eller r\u00E4knar!"},
-
- { ER_NODESET_CANNOT_INDEX,
- "Detta NodeSet kan inte utf\u00F6ra funktioner som indexerar eller r\u00E4knar!"},
-
- { ER_CANNOT_CALL_SETSHOULDCACHENODE,
- "Kan inte anropa setShouldCacheNodes efter anropat nextNode!"},
-
- { ER_ONLY_ALLOWS,
- "{0} till\u00E5ter endast {1} argument"},
-
- { ER_UNKNOWN_STEP,
- "Programmerarens utsaga i getNextStepPos: ok\u00E4nt stepType: {0}"},
-
- //Note to translators: A relative location path is a form of XPath expression.
- // The message indicates that such an expression was expected following the
- // characters '/' or '//', but was not found.
- { ER_EXPECTED_REL_LOC_PATH,
- "En relativ s\u00F6kv\u00E4g f\u00F6rv\u00E4ntades efter tecknet '/' eller '//'."},
-
- // Note to translators: A location path is a form of XPath expression.
- // The message indicates that syntactically such an expression was expected,but
- // the characters specified by the substitution text were encountered instead.
- { ER_EXPECTED_LOC_PATH,
- "En s\u00F6kv\u00E4g f\u00F6rv\u00E4ntades, men f\u00F6ljande tecken p\u00E5tr\u00E4ffades: {0}"},
-
- // Note to translators: A location path is a form of XPath expression.
- // The message indicates that syntactically such a subexpression was expected,
- // but no more characters were found in the expression.
- { ER_EXPECTED_LOC_PATH_AT_END_EXPR,
- "En s\u00F6kv\u00E4g f\u00F6rv\u00E4ntades, men slutet av XPath-uttrycket hittades ist\u00E4llet."},
-
- // Note to translators: A location step is part of an XPath expression.
- // The message indicates that syntactically such an expression was expected
- // following the specified characters.
- { ER_EXPECTED_LOC_STEP,
- "Ett platssteg f\u00F6rv\u00E4ntades efter tecknet '/' eller '//'."},
-
- // Note to translators: A node test is part of an XPath expression that is
- // used to test for particular kinds of nodes. In this case, a node test that
- // consists of an NCName followed by a colon and an asterisk or that consists
- // of a QName was expected, but was not found.
- { ER_EXPECTED_NODE_TEST,
- "Ett nodtest som matchar antingen NCName:* eller QName f\u00F6rv\u00E4ntades."},
-
- // Note to translators: A step pattern is part of an XPath expression.
- // The message indicates that syntactically such an expression was expected,
- // but the specified character was found in the expression instead.
- { ER_EXPECTED_STEP_PATTERN,
- "Ett stegm\u00F6nster f\u00F6rv\u00E4ntades, men '/' p\u00E5tr\u00E4ffades."},
-
- // Note to translators: A relative path pattern is part of an XPath expression.
- // The message indicates that syntactically such an expression was expected,
- // but was not found.
- { ER_EXPECTED_REL_PATH_PATTERN,
- "Ett m\u00F6nster f\u00F6r relativ s\u00F6kv\u00E4g f\u00F6rv\u00E4ntades."},
-
- // Note to translators: The substitution text is the name of a data type. The
- // message indicates that a value of a particular type could not be converted
- // to a value of type boolean.
- { ER_CANT_CONVERT_TO_BOOLEAN,
- "XPathResult i XPath-uttrycket ''{0}'' inneh\u00E5ller XPathResultType {1} som inte kan konverteras till booleskt v\u00E4rde."},
-
- // Note to translators: Do not translate ANY_UNORDERED_NODE_TYPE and
- // FIRST_ORDERED_NODE_TYPE.
- { ER_CANT_CONVERT_TO_SINGLENODE,
- "XPathResult i XPath-uttrycket ''{0}'' inneh\u00E5ller XPathResultType {1} som inte kan konverteras till enskild nod. Metoden getSingleNodeValue anv\u00E4nds endast till typ ANY_UNORDERED_NODE_TYPE och FIRST_ORDERED_NODE_TYPE."},
-
- // Note to translators: Do not translate UNORDERED_NODE_SNAPSHOT_TYPE and
- // ORDERED_NODE_SNAPSHOT_TYPE.
- { ER_CANT_GET_SNAPSHOT_LENGTH,
- "Metoden getSnapshotLength kan inte anropas vid XPathResult fr\u00E5n XPath-uttrycket ''{0}'' eftersom XPathResultType \u00E4r {1}. Metoden anv\u00E4nds endast till typ UNORDERED_NODE_SNAPSHOT_TYPE och ORDERED_NODE_SNAPSHOT_TYPE."},
-
- { ER_NON_ITERATOR_TYPE,
- "Metoden iterateNext kan inte anropas vid XPathResult fr\u00E5n XPath-uttrycket ''{0}'' eftersom XPathResultType \u00E4r {1}. Metoden anv\u00E4nds endast till typ UNORDERED_NODE_ITERATOR_TYPE och ORDERED_NODE_ITERATOR_TYPE."},
-
- // Note to translators: This message indicates that the document being operated
- // upon changed, so the iterator object that was being used to traverse the
- // document has now become invalid.
- { ER_DOC_MUTATED,
- "Dokumentet har muterats sedan resultatet genererades. Iteratorn \u00E4r ogiltig."},
-
- { ER_INVALID_XPATH_TYPE,
- "Ogiltigt XPath-typargument: {0}"},
-
- { ER_EMPTY_XPATH_RESULT,
- "Tomt XPath-resultatobjekt"},
-
- { ER_INCOMPATIBLE_TYPES,
- "XPathResult i XPath-uttrycket ''{0}'' inneh\u00E5ller XPathResultType {1} som inte kan tvingas till angiven XPathResultType {2}."},
-
- { ER_NULL_RESOLVER,
- "Kan inte matcha prefix med prefixmatchning som \u00E4r null."},
-
- // Note to translators: The substitution text is the name of a data type. The
- // message indicates that a value of a particular type could not be converted
- // to a value of type string.
- { ER_CANT_CONVERT_TO_STRING,
- "XPathResult i XPath-uttrycket ''{0}'' inneh\u00E5ller XPathResultType {1} som inte kan konverteras till en str\u00E4ng."},
-
- // Note to translators: Do not translate snapshotItem,
- // UNORDERED_NODE_SNAPSHOT_TYPE and ORDERED_NODE_SNAPSHOT_TYPE.
- { ER_NON_SNAPSHOT_TYPE,
- "Metoden snapshotItem kan inte anropas vid XPathResult fr\u00E5n XPath-uttrycket ''{0}'' eftersom XPathResultType \u00E4r {1}. Metoden anv\u00E4nds endast till typ UNORDERED_NODE_SNAPSHOT_TYPE och ORDERED_NODE_SNAPSHOT_TYPE."},
-
- // Note to translators: XPathEvaluator is a Java interface name. An
- // XPathEvaluator is created with respect to a particular XML document, and in
- // this case the expression represented by this object was being evaluated with
- // respect to a context node from a different document.
- { ER_WRONG_DOCUMENT,
- "Kontextnoden tillh\u00F6r inte dokumentet som \u00E4r bundet till denna XPathEvaluator."},
-
- // Note to translators: The XPath expression cannot be evaluated with respect
- // to this type of node.
- { ER_WRONG_NODETYPE,
- "Kontextnodtypen st\u00F6ds inte."},
-
- { ER_XPATH_ERROR,
- "Ok\u00E4nt fel i XPath."},
-
- { ER_CANT_CONVERT_XPATHRESULTTYPE_TO_NUMBER,
- "XPathResult i XPath-uttrycket ''{0}'' inneh\u00E5ller XPathResultType {1} som inte kan konverteras till ett tal."},
-
- //BEGIN: Definitions of error keys used in exception messages of JAXP 1.3 XPath API implementation
-
- /** Field ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED */
-
- { ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED,
- "Till\u00E4ggsfunktion: ''{0}'' kan inte anropas om funktionen XMLConstants.FEATURE_SECURE_PROCESSING anges som true."},
-
- /** Field ER_RESOLVE_VARIABLE_RETURNS_NULL */
-
- { ER_RESOLVE_VARIABLE_RETURNS_NULL,
- "resolveVariable f\u00F6r variabeln {0} returnerar null"},
-
- /** Field ER_UNSUPPORTED_RETURN_TYPE */
-
- { ER_UNSUPPORTED_RETURN_TYPE,
- "Det finns inget st\u00F6d f\u00F6r returtypen: {0}"},
-
- /** Field ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL */
-
- { ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL,
- "K\u00E4lla och/eller returtyp f\u00E5r inte vara null"},
-
- /** Field ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL */
-
- { ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL,
- "K\u00E4lla och/eller returtyp f\u00E5r inte vara null"},
-
- /** Field ER_ARG_CANNOT_BE_NULL */
-
- { ER_ARG_CANNOT_BE_NULL,
- "Argumentet {0} kan inte vara null"},
-
- /** Field ER_OBJECT_MODEL_NULL */
-
- { ER_OBJECT_MODEL_NULL,
- "{0}#isObjectModelSupported( String objectModel ) kan inte anropas med objectModel == null"},
-
- /** Field ER_OBJECT_MODEL_EMPTY */
-
- { ER_OBJECT_MODEL_EMPTY,
- "{0}#isObjectModelSupported( String objectModel ) kan inte anropas med objectModel == \"\""},
-
- /** Field ER_OBJECT_MODEL_EMPTY */
-
- { ER_FEATURE_NAME_NULL,
- "F\u00F6rs\u00F6ker ange en funktion med null-namn: {0}#setFeature( null, {1})"},
-
- /** Field ER_FEATURE_UNKNOWN */
-
- { ER_FEATURE_UNKNOWN,
- "F\u00F6rs\u00F6ker ange en ok\u00E4nd funktion \"{0}\":{1}#setFeature({0},{2})"},
-
- /** Field ER_GETTING_NULL_FEATURE */
-
- { ER_GETTING_NULL_FEATURE,
- "F\u00F6rs\u00F6ker h\u00E4mta en funktion med null-namn: {0}#getFeature(null)"},
-
- /** Field ER_GETTING_NULL_FEATURE */
-
- { ER_GETTING_UNKNOWN_FEATURE,
- "F\u00F6rs\u00F6ker h\u00E4mta en ok\u00E4nd funktion \"{0}\":{1}#getFeature({0})"},
-
- {ER_SECUREPROCESSING_FEATURE,
- "FEATURE_SECURE_PROCESSING: Kan inte ange funktionen som false om s\u00E4kerhetshanteraren anv\u00E4nds: {1}#setFeature({0},{2})"},
-
- /** Field ER_NULL_XPATH_FUNCTION_RESOLVER */
-
- { ER_NULL_XPATH_FUNCTION_RESOLVER,
- "F\u00F6rs\u00F6ker ange nullv\u00E4rde f\u00F6r XPathFunctionResolver:{0}#setXPathFunctionResolver(null)"},
-
- /** Field ER_NULL_XPATH_VARIABLE_RESOLVER */
-
- { ER_NULL_XPATH_VARIABLE_RESOLVER,
- "F\u00F6rs\u00F6ker ange nullv\u00E4rde f\u00F6r XPathVariableResolver:{0}#setXPathVariableResolver(null)"},
-
- //END: Definitions of error keys used in exception messages of JAXP 1.3 XPath API implementation
-
- // Warnings...
-
- { WG_LOCALE_NAME_NOT_HANDLED,
- "spr\u00E5kkonventionsnamnet i funktionen format-number har \u00E4nnu inte hanterats!"},
-
- { WG_PROPERTY_NOT_SUPPORTED,
- "XSL-egenskapen st\u00F6ds inte: {0}"},
-
- { WG_DONT_DO_ANYTHING_WITH_NS,
- "G\u00F6r f\u00F6r n\u00E4rvarande inte n\u00E5gonting med namnrymden {0} i egenskap: {1}"},
-
- { WG_SECURITY_EXCEPTION,
- "SecurityException vid f\u00F6rs\u00F6k att f\u00E5 \u00E5tkomst till XSL-systemegenskap: {0}"},
-
- { WG_QUO_NO_LONGER_DEFINED,
- "Gammal syntax: quo(...) definieras inte l\u00E4ngre i XPath."},
-
- { WG_NEED_DERIVED_OBJECT_TO_IMPLEMENT_NODETEST,
- "XPath beh\u00F6ver ett h\u00E4rledningsobjekt f\u00F6r att implementera nodeTest!"},
-
- { WG_FUNCTION_TOKEN_NOT_FOUND,
- "funktionstecken hittades inte."},
-
- { WG_COULDNOT_FIND_FUNCTION,
- "Hittade inte funktionen: {0}"},
-
- { WG_CANNOT_MAKE_URL_FROM,
- "Kan inte skapa URL fr\u00E5n: {0}"},
-
- { WG_EXPAND_ENTITIES_NOT_SUPPORTED,
- "Alternativet -E st\u00F6ds inte i DTM-parser"},
-
- { WG_ILLEGAL_VARIABLE_REFERENCE,
- "VariableReference angiven f\u00F6r variabel som \u00E4r utanf\u00F6r kontext eller som saknar definition! Namn = {0}"},
-
- { WG_UNSUPPORTED_ENCODING,
- "Kodning utan st\u00F6d: {0}"},
-
-
-
- // Other miscellaneous text used inside the code...
- { "ui_language", "en"},
- { "help_language", "en"},
- { "language", "en"},
- { "BAD_CODE", "Parameter f\u00F6r createMessage ligger utanf\u00F6r gr\u00E4nsv\u00E4rdet"},
- { "FORMAT_FAILED", "Undantag utl\u00F6st vid messageFormat-anrop"},
- { "version", ">>>>>>> Xalan version "},
- { "version2", "<<<<<<<"},
- { "yes", "ja"},
- { "line", "Rad nr"},
- { "column", "Kolumn nr"},
- { "xsldone", "XSLProcessor: utf\u00F6rd"},
- { "xpath_option", "xpath-alternativ: "},
- { "optionIN", " [-in inputXMLURL]"},
- { "optionSelect", " [-select xpath-uttryck]"},
- { "optionMatch", " [-match matchningsm\u00F6nster (f\u00F6r matchningsdiagnostik)]"},
- { "optionAnyExpr", "Eller bara ett xpath-uttryck skapar en diagnostikdump"},
- { "noParsermsg1", "XSL-processen utf\u00F6rdes inte."},
- { "noParsermsg2", "** Hittade inte parser **"},
- { "noParsermsg3", "Kontrollera klass\u00F6kv\u00E4gen."},
- { "noParsermsg4", "Om du inte har IBMs XML Parser f\u00F6r Java kan du ladda ned den fr\u00E5n"},
- { "noParsermsg5", "IBMs AlphaWorks: http://www.alphaworks.ibm.com/formula/xml"},
- { "gtone", ">1" },
- { "zero", "0" },
- { "one", "1" },
- { "two" , "2" },
- { "three", "3" }
-
- };
-
- /**
- * Get the association list.
- *
- * @return The association list.
- */
- public Object[][] getContents()
- {
- return _contents;
- }
-
-
- // ================= INFRASTRUCTURE ======================
-
- /** Field BAD_CODE */
- public static final String BAD_CODE = "BAD_CODE";
-
- /** Field FORMAT_FAILED */
- public static final String FORMAT_FAILED = "FORMAT_FAILED";
-
- /** Field ERROR_RESOURCES */
- public static final String ERROR_RESOURCES =
- "com.sun.org.apache.xpath.internal.res.XPATHErrorResources";
-
- /** Field ERROR_STRING */
- public static final String ERROR_STRING = "#error";
-
- /** Field ERROR_HEADER */
- public static final String ERROR_HEADER = "Error: ";
-
- /** Field WARNING_HEADER */
- public static final String WARNING_HEADER = "Warning: ";
-
- /** Field XSL_HEADER */
- public static final String XSL_HEADER = "XSL ";
-
- /** Field XML_HEADER */
- public static final String XML_HEADER = "XML ";
-
- /** Field QUERY_HEADER */
- public static final String QUERY_HEADER = "PATTERN ";
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_zh_CN.java b/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_zh_CN.java
deleted file mode 100644
index b0233b1..0000000
--- a/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_zh_CN.java
+++ /dev/null
@@ -1,936 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xpath.internal.res;
-
-import java.util.ListResourceBundle;
-
-/**
- * Set up error messages.
- * We build a two dimensional array of message keys and
- * message strings. In order to add a new message here,
- * you need to first add a Static string constant for the
- * Key and update the contents array with Key, Value pair
- * Also you need to update the count of messages(MAX_CODE)or
- * the count of warnings(MAX_WARNING) [ Information purpose only]
- * @xsl.usage advanced
- */
-public class XPATHErrorResources_zh_CN extends ListResourceBundle
-{
-
-/*
- * General notes to translators:
- *
- * This file contains error and warning messages related to XPath Error
- * Handling.
- *
- * 1) Xalan (or more properly, Xalan-interpretive) and XSLTC are names of
- * components.
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- * XSLTC is an acronym for XSLT Compiler.
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 5) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 6) "Translet" is an invented term that describes the class file that
- * results from compiling an XML stylesheet into a Java class.
- *
- * 7) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- * 8) The context node is the node in the document with respect to which an
- * XPath expression is being evaluated.
- *
- * 9) An iterator is an object that traverses nodes in the tree, one at a time.
- *
- * 10) NCName is an XML term used to describe a name that does not contain a
- * colon (a "no-colon name").
- *
- * 11) QName is an XML term meaning "qualified name".
- */
-
- /*
- * static variables
- */
- public static final String ERROR0000 = "ERROR0000";
- public static final String ER_CURRENT_NOT_ALLOWED_IN_MATCH =
- "ER_CURRENT_NOT_ALLOWED_IN_MATCH";
- public static final String ER_CURRENT_TAKES_NO_ARGS =
- "ER_CURRENT_TAKES_NO_ARGS";
- public static final String ER_DOCUMENT_REPLACED = "ER_DOCUMENT_REPLACED";
- public static final String ER_CONTEXT_HAS_NO_OWNERDOC =
- "ER_CONTEXT_HAS_NO_OWNERDOC";
- public static final String ER_LOCALNAME_HAS_TOO_MANY_ARGS =
- "ER_LOCALNAME_HAS_TOO_MANY_ARGS";
- public static final String ER_NAMESPACEURI_HAS_TOO_MANY_ARGS =
- "ER_NAMESPACEURI_HAS_TOO_MANY_ARGS";
- public static final String ER_NORMALIZESPACE_HAS_TOO_MANY_ARGS =
- "ER_NORMALIZESPACE_HAS_TOO_MANY_ARGS";
- public static final String ER_NUMBER_HAS_TOO_MANY_ARGS =
- "ER_NUMBER_HAS_TOO_MANY_ARGS";
- public static final String ER_NAME_HAS_TOO_MANY_ARGS =
- "ER_NAME_HAS_TOO_MANY_ARGS";
- public static final String ER_STRING_HAS_TOO_MANY_ARGS =
- "ER_STRING_HAS_TOO_MANY_ARGS";
- public static final String ER_STRINGLENGTH_HAS_TOO_MANY_ARGS =
- "ER_STRINGLENGTH_HAS_TOO_MANY_ARGS";
- public static final String ER_TRANSLATE_TAKES_3_ARGS =
- "ER_TRANSLATE_TAKES_3_ARGS";
- public static final String ER_UNPARSEDENTITYURI_TAKES_1_ARG =
- "ER_UNPARSEDENTITYURI_TAKES_1_ARG";
- public static final String ER_NAMESPACEAXIS_NOT_IMPLEMENTED =
- "ER_NAMESPACEAXIS_NOT_IMPLEMENTED";
- public static final String ER_UNKNOWN_AXIS = "ER_UNKNOWN_AXIS";
- public static final String ER_UNKNOWN_MATCH_OPERATION =
- "ER_UNKNOWN_MATCH_OPERATION";
- public static final String ER_INCORRECT_ARG_LENGTH ="ER_INCORRECT_ARG_LENGTH";
- public static final String ER_CANT_CONVERT_TO_NUMBER =
- "ER_CANT_CONVERT_TO_NUMBER";
- public static final String ER_CANT_CONVERT_XPATHRESULTTYPE_TO_NUMBER =
- "ER_CANT_CONVERT_XPATHRESULTTYPE_TO_NUMBER";
- public static final String ER_CANT_CONVERT_TO_NODELIST =
- "ER_CANT_CONVERT_TO_NODELIST";
- public static final String ER_CANT_CONVERT_TO_MUTABLENODELIST =
- "ER_CANT_CONVERT_TO_MUTABLENODELIST";
- public static final String ER_CANT_CONVERT_TO_TYPE ="ER_CANT_CONVERT_TO_TYPE";
- public static final String ER_EXPECTED_MATCH_PATTERN =
- "ER_EXPECTED_MATCH_PATTERN";
- public static final String ER_COULDNOT_GET_VAR_NAMED =
- "ER_COULDNOT_GET_VAR_NAMED";
- public static final String ER_UNKNOWN_OPCODE = "ER_UNKNOWN_OPCODE";
- public static final String ER_EXTRA_ILLEGAL_TOKENS ="ER_EXTRA_ILLEGAL_TOKENS";
- public static final String ER_EXPECTED_DOUBLE_QUOTE =
- "ER_EXPECTED_DOUBLE_QUOTE";
- public static final String ER_EXPECTED_SINGLE_QUOTE =
- "ER_EXPECTED_SINGLE_QUOTE";
- public static final String ER_EMPTY_EXPRESSION = "ER_EMPTY_EXPRESSION";
- public static final String ER_EXPECTED_BUT_FOUND = "ER_EXPECTED_BUT_FOUND";
- public static final String ER_INCORRECT_PROGRAMMER_ASSERTION =
- "ER_INCORRECT_PROGRAMMER_ASSERTION";
- public static final String ER_BOOLEAN_ARG_NO_LONGER_OPTIONAL =
- "ER_BOOLEAN_ARG_NO_LONGER_OPTIONAL";
- public static final String ER_FOUND_COMMA_BUT_NO_PRECEDING_ARG =
- "ER_FOUND_COMMA_BUT_NO_PRECEDING_ARG";
- public static final String ER_FOUND_COMMA_BUT_NO_FOLLOWING_ARG =
- "ER_FOUND_COMMA_BUT_NO_FOLLOWING_ARG";
- public static final String ER_PREDICATE_ILLEGAL_SYNTAX =
- "ER_PREDICATE_ILLEGAL_SYNTAX";
- public static final String ER_ILLEGAL_AXIS_NAME = "ER_ILLEGAL_AXIS_NAME";
- public static final String ER_UNKNOWN_NODETYPE = "ER_UNKNOWN_NODETYPE";
- public static final String ER_PATTERN_LITERAL_NEEDS_BE_QUOTED =
- "ER_PATTERN_LITERAL_NEEDS_BE_QUOTED";
- public static final String ER_COULDNOT_BE_FORMATTED_TO_NUMBER =
- "ER_COULDNOT_BE_FORMATTED_TO_NUMBER";
- public static final String ER_COULDNOT_CREATE_XMLPROCESSORLIAISON =
- "ER_COULDNOT_CREATE_XMLPROCESSORLIAISON";
- public static final String ER_DIDNOT_FIND_XPATH_SELECT_EXP =
- "ER_DIDNOT_FIND_XPATH_SELECT_EXP";
- public static final String ER_COULDNOT_FIND_ENDOP_AFTER_OPLOCATIONPATH =
- "ER_COULDNOT_FIND_ENDOP_AFTER_OPLOCATIONPATH";
- public static final String ER_ERROR_OCCURED = "ER_ERROR_OCCURED";
- public static final String ER_ILLEGAL_VARIABLE_REFERENCE =
- "ER_ILLEGAL_VARIABLE_REFERENCE";
- public static final String ER_AXES_NOT_ALLOWED = "ER_AXES_NOT_ALLOWED";
- public static final String ER_KEY_HAS_TOO_MANY_ARGS =
- "ER_KEY_HAS_TOO_MANY_ARGS";
- public static final String ER_COUNT_TAKES_1_ARG = "ER_COUNT_TAKES_1_ARG";
- public static final String ER_COULDNOT_FIND_FUNCTION =
- "ER_COULDNOT_FIND_FUNCTION";
- public static final String ER_UNSUPPORTED_ENCODING ="ER_UNSUPPORTED_ENCODING";
- public static final String ER_PROBLEM_IN_DTM_NEXTSIBLING =
- "ER_PROBLEM_IN_DTM_NEXTSIBLING";
- public static final String ER_CANNOT_WRITE_TO_EMPTYNODELISTIMPL =
- "ER_CANNOT_WRITE_TO_EMPTYNODELISTIMPL";
- public static final String ER_SETDOMFACTORY_NOT_SUPPORTED =
- "ER_SETDOMFACTORY_NOT_SUPPORTED";
- public static final String ER_PREFIX_MUST_RESOLVE = "ER_PREFIX_MUST_RESOLVE";
- public static final String ER_PARSE_NOT_SUPPORTED = "ER_PARSE_NOT_SUPPORTED";
- public static final String ER_SAX_API_NOT_HANDLED = "ER_SAX_API_NOT_HANDLED";
-public static final String ER_IGNORABLE_WHITESPACE_NOT_HANDLED =
- "ER_IGNORABLE_WHITESPACE_NOT_HANDLED";
- public static final String ER_DTM_CANNOT_HANDLE_NODES =
- "ER_DTM_CANNOT_HANDLE_NODES";
- public static final String ER_XERCES_CANNOT_HANDLE_NODES =
- "ER_XERCES_CANNOT_HANDLE_NODES";
- public static final String ER_XERCES_PARSE_ERROR_DETAILS =
- "ER_XERCES_PARSE_ERROR_DETAILS";
- public static final String ER_XERCES_PARSE_ERROR = "ER_XERCES_PARSE_ERROR";
- public static final String ER_INVALID_UTF16_SURROGATE =
- "ER_INVALID_UTF16_SURROGATE";
- public static final String ER_OIERROR = "ER_OIERROR";
- public static final String ER_CANNOT_CREATE_URL = "ER_CANNOT_CREATE_URL";
- public static final String ER_XPATH_READOBJECT = "ER_XPATH_READOBJECT";
- public static final String ER_FUNCTION_TOKEN_NOT_FOUND =
- "ER_FUNCTION_TOKEN_NOT_FOUND";
- public static final String ER_CANNOT_DEAL_XPATH_TYPE =
- "ER_CANNOT_DEAL_XPATH_TYPE";
- public static final String ER_NODESET_NOT_MUTABLE = "ER_NODESET_NOT_MUTABLE";
- public static final String ER_NODESETDTM_NOT_MUTABLE =
- "ER_NODESETDTM_NOT_MUTABLE";
- /** Variable not resolvable: */
- public static final String ER_VAR_NOT_RESOLVABLE = "ER_VAR_NOT_RESOLVABLE";
- /** Null error handler */
- public static final String ER_NULL_ERROR_HANDLER = "ER_NULL_ERROR_HANDLER";
- /** Programmer's assertion: unknown opcode */
- public static final String ER_PROG_ASSERT_UNKNOWN_OPCODE =
- "ER_PROG_ASSERT_UNKNOWN_OPCODE";
- /** 0 or 1 */
- public static final String ER_ZERO_OR_ONE = "ER_ZERO_OR_ONE";
- /** rtf() not supported by XRTreeFragSelectWrapper */
- public static final String ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** asNodeIterator() not supported by XRTreeFragSelectWrapper */
- public static final String ER_ASNODEITERATOR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER = "ER_ASNODEITERATOR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** fsb() not supported for XStringForChars */
- public static final String ER_FSB_NOT_SUPPORTED_XSTRINGFORCHARS =
- "ER_FSB_NOT_SUPPORTED_XSTRINGFORCHARS";
- /** Could not find variable with the name of */
- public static final String ER_COULD_NOT_FIND_VAR = "ER_COULD_NOT_FIND_VAR";
- /** XStringForChars can not take a string for an argument */
- public static final String ER_XSTRINGFORCHARS_CANNOT_TAKE_STRING =
- "ER_XSTRINGFORCHARS_CANNOT_TAKE_STRING";
- /** The FastStringBuffer argument can not be null */
- public static final String ER_FASTSTRINGBUFFER_CANNOT_BE_NULL =
- "ER_FASTSTRINGBUFFER_CANNOT_BE_NULL";
- /** 2 or 3 */
- public static final String ER_TWO_OR_THREE = "ER_TWO_OR_THREE";
- /** Variable accessed before it is bound! */
- public static final String ER_VARIABLE_ACCESSED_BEFORE_BIND =
- "ER_VARIABLE_ACCESSED_BEFORE_BIND";
- /** XStringForFSB can not take a string for an argument! */
- public static final String ER_FSB_CANNOT_TAKE_STRING =
- "ER_FSB_CANNOT_TAKE_STRING";
- /** Error! Setting the root of a walker to null! */
- public static final String ER_SETTING_WALKER_ROOT_TO_NULL =
- "ER_SETTING_WALKER_ROOT_TO_NULL";
- /** This NodeSetDTM can not iterate to a previous node! */
- public static final String ER_NODESETDTM_CANNOT_ITERATE =
- "ER_NODESETDTM_CANNOT_ITERATE";
- /** This NodeSet can not iterate to a previous node! */
- public static final String ER_NODESET_CANNOT_ITERATE =
- "ER_NODESET_CANNOT_ITERATE";
- /** This NodeSetDTM can not do indexing or counting functions! */
- public static final String ER_NODESETDTM_CANNOT_INDEX =
- "ER_NODESETDTM_CANNOT_INDEX";
- /** This NodeSet can not do indexing or counting functions! */
- public static final String ER_NODESET_CANNOT_INDEX =
- "ER_NODESET_CANNOT_INDEX";
- /** Can not call setShouldCacheNodes after nextNode has been called! */
- public static final String ER_CANNOT_CALL_SETSHOULDCACHENODE =
- "ER_CANNOT_CALL_SETSHOULDCACHENODE";
- /** {0} only allows {1} arguments */
- public static final String ER_ONLY_ALLOWS = "ER_ONLY_ALLOWS";
- /** Programmer's assertion in getNextStepPos: unknown stepType: {0} */
- public static final String ER_UNKNOWN_STEP = "ER_UNKNOWN_STEP";
- /** Problem with RelativeLocationPath */
- public static final String ER_EXPECTED_REL_LOC_PATH =
- "ER_EXPECTED_REL_LOC_PATH";
- /** Problem with LocationPath */
- public static final String ER_EXPECTED_LOC_PATH = "ER_EXPECTED_LOC_PATH";
- public static final String ER_EXPECTED_LOC_PATH_AT_END_EXPR =
- "ER_EXPECTED_LOC_PATH_AT_END_EXPR";
- /** Problem with Step */
- public static final String ER_EXPECTED_LOC_STEP = "ER_EXPECTED_LOC_STEP";
- /** Problem with NodeTest */
- public static final String ER_EXPECTED_NODE_TEST = "ER_EXPECTED_NODE_TEST";
- /** Expected step pattern */
- public static final String ER_EXPECTED_STEP_PATTERN =
- "ER_EXPECTED_STEP_PATTERN";
- /** Expected relative path pattern */
- public static final String ER_EXPECTED_REL_PATH_PATTERN =
- "ER_EXPECTED_REL_PATH_PATTERN";
- /** ER_CANT_CONVERT_XPATHRESULTTYPE_TO_BOOLEAN */
- public static final String ER_CANT_CONVERT_TO_BOOLEAN =
- "ER_CANT_CONVERT_TO_BOOLEAN";
- /** Field ER_CANT_CONVERT_TO_SINGLENODE */
- public static final String ER_CANT_CONVERT_TO_SINGLENODE =
- "ER_CANT_CONVERT_TO_SINGLENODE";
- /** Field ER_CANT_GET_SNAPSHOT_LENGTH */
- public static final String ER_CANT_GET_SNAPSHOT_LENGTH =
- "ER_CANT_GET_SNAPSHOT_LENGTH";
- /** Field ER_NON_ITERATOR_TYPE */
- public static final String ER_NON_ITERATOR_TYPE = "ER_NON_ITERATOR_TYPE";
- /** Field ER_DOC_MUTATED */
- public static final String ER_DOC_MUTATED = "ER_DOC_MUTATED";
- public static final String ER_INVALID_XPATH_TYPE = "ER_INVALID_XPATH_TYPE";
- public static final String ER_EMPTY_XPATH_RESULT = "ER_EMPTY_XPATH_RESULT";
- public static final String ER_INCOMPATIBLE_TYPES = "ER_INCOMPATIBLE_TYPES";
- public static final String ER_NULL_RESOLVER = "ER_NULL_RESOLVER";
- public static final String ER_CANT_CONVERT_TO_STRING =
- "ER_CANT_CONVERT_TO_STRING";
- public static final String ER_NON_SNAPSHOT_TYPE = "ER_NON_SNAPSHOT_TYPE";
- public static final String ER_WRONG_DOCUMENT = "ER_WRONG_DOCUMENT";
- /* Note to translators: The XPath expression cannot be evaluated with respect
- * to this type of node.
- */
- /** Field ER_WRONG_NODETYPE */
- public static final String ER_WRONG_NODETYPE = "ER_WRONG_NODETYPE";
- public static final String ER_XPATH_ERROR = "ER_XPATH_ERROR";
-
- //BEGIN: Keys needed for exception messages of JAXP 1.3 XPath API implementation
- public static final String ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED = "ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED";
- public static final String ER_RESOLVE_VARIABLE_RETURNS_NULL = "ER_RESOLVE_VARIABLE_RETURNS_NULL";
- public static final String ER_UNSUPPORTED_RETURN_TYPE = "ER_UNSUPPORTED_RETURN_TYPE";
- public static final String ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL = "ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL";
- public static final String ER_ARG_CANNOT_BE_NULL = "ER_ARG_CANNOT_BE_NULL";
-
- public static final String ER_OBJECT_MODEL_NULL = "ER_OBJECT_MODEL_NULL";
- public static final String ER_OBJECT_MODEL_EMPTY = "ER_OBJECT_MODEL_EMPTY";
- public static final String ER_FEATURE_NAME_NULL = "ER_FEATURE_NAME_NULL";
- public static final String ER_FEATURE_UNKNOWN = "ER_FEATURE_UNKNOWN";
- public static final String ER_GETTING_NULL_FEATURE = "ER_GETTING_NULL_FEATURE";
- public static final String ER_GETTING_UNKNOWN_FEATURE = "ER_GETTING_UNKNOWN_FEATURE";
- public static final String ER_SECUREPROCESSING_FEATURE = "ER_SECUREPROCESSING_FEATURE";
- public static final String ER_NULL_XPATH_FUNCTION_RESOLVER = "ER_NULL_XPATH_FUNCTION_RESOLVER";
- public static final String ER_NULL_XPATH_VARIABLE_RESOLVER = "ER_NULL_XPATH_VARIABLE_RESOLVER";
- //END: Keys needed for exception messages of JAXP 1.3 XPath API implementation
-
- public static final String WG_LOCALE_NAME_NOT_HANDLED =
- "WG_LOCALE_NAME_NOT_HANDLED";
- public static final String WG_PROPERTY_NOT_SUPPORTED =
- "WG_PROPERTY_NOT_SUPPORTED";
- public static final String WG_DONT_DO_ANYTHING_WITH_NS =
- "WG_DONT_DO_ANYTHING_WITH_NS";
- public static final String WG_SECURITY_EXCEPTION = "WG_SECURITY_EXCEPTION";
- public static final String WG_QUO_NO_LONGER_DEFINED =
- "WG_QUO_NO_LONGER_DEFINED";
- public static final String WG_NEED_DERIVED_OBJECT_TO_IMPLEMENT_NODETEST =
- "WG_NEED_DERIVED_OBJECT_TO_IMPLEMENT_NODETEST";
- public static final String WG_FUNCTION_TOKEN_NOT_FOUND =
- "WG_FUNCTION_TOKEN_NOT_FOUND";
- public static final String WG_COULDNOT_FIND_FUNCTION =
- "WG_COULDNOT_FIND_FUNCTION";
- public static final String WG_CANNOT_MAKE_URL_FROM ="WG_CANNOT_MAKE_URL_FROM";
- public static final String WG_EXPAND_ENTITIES_NOT_SUPPORTED =
- "WG_EXPAND_ENTITIES_NOT_SUPPORTED";
- public static final String WG_ILLEGAL_VARIABLE_REFERENCE =
- "WG_ILLEGAL_VARIABLE_REFERENCE";
- public static final String WG_UNSUPPORTED_ENCODING ="WG_UNSUPPORTED_ENCODING";
-
- /** detach() not supported by XRTreeFragSelectWrapper */
- public static final String ER_DETACH_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_DETACH_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** num() not supported by XRTreeFragSelectWrapper */
- public static final String ER_NUM_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_NUM_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** xstr() not supported by XRTreeFragSelectWrapper */
- public static final String ER_XSTR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_XSTR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** str() not supported by XRTreeFragSelectWrapper */
- public static final String ER_STR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_STR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
-
- // Error messages...
-
- private static final Object[][] _contents = new Object[][]{
-
- { "ERROR0000" , "{0}" },
-
- { ER_CURRENT_NOT_ALLOWED_IN_MATCH, "\u5339\u914D\u6A21\u5F0F\u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528 current() \u51FD\u6570!" },
-
- { ER_CURRENT_TAKES_NO_ARGS, "current() \u51FD\u6570\u4E0D\u63A5\u53D7\u53C2\u6570!" },
-
- { ER_DOCUMENT_REPLACED,
- "document() \u51FD\u6570\u5B9E\u73B0\u5DF2\u66FF\u6362\u4E3A com.sun.org.apache.xalan.internal.xslt.FuncDocument!"},
-
- { ER_CONTEXT_HAS_NO_OWNERDOC,
- "\u4E0A\u4E0B\u6587\u6CA1\u6709\u6240\u6709\u8005\u6587\u6863!"},
-
- { ER_LOCALNAME_HAS_TOO_MANY_ARGS,
- "local-name() \u5177\u6709\u592A\u591A\u53C2\u6570\u3002"},
-
- { ER_NAMESPACEURI_HAS_TOO_MANY_ARGS,
- "namespace-uri() \u5177\u6709\u592A\u591A\u53C2\u6570\u3002"},
-
- { ER_NORMALIZESPACE_HAS_TOO_MANY_ARGS,
- "normalize-space() \u5177\u6709\u592A\u591A\u53C2\u6570\u3002"},
-
- { ER_NUMBER_HAS_TOO_MANY_ARGS,
- "number() \u5177\u6709\u592A\u591A\u53C2\u6570\u3002"},
-
- { ER_NAME_HAS_TOO_MANY_ARGS,
- "name() \u5177\u6709\u592A\u591A\u53C2\u6570\u3002"},
-
- { ER_STRING_HAS_TOO_MANY_ARGS,
- "string() \u5177\u6709\u592A\u591A\u53C2\u6570\u3002"},
-
- { ER_STRINGLENGTH_HAS_TOO_MANY_ARGS,
- "string-length() \u5177\u6709\u592A\u591A\u53C2\u6570\u3002"},
-
- { ER_TRANSLATE_TAKES_3_ARGS,
- "translate() \u51FD\u6570\u91C7\u7528\u4E09\u4E2A\u53C2\u6570!"},
-
- { ER_UNPARSEDENTITYURI_TAKES_1_ARG,
- "unparsed-entity-uri \u51FD\u6570\u5E94\u91C7\u7528\u4E00\u4E2A\u53C2\u6570!"},
-
- { ER_NAMESPACEAXIS_NOT_IMPLEMENTED,
- "\u5C1A\u672A\u5B9E\u73B0\u540D\u79F0\u7A7A\u95F4\u8F74!"},
-
- { ER_UNKNOWN_AXIS,
- "\u8F74\u672A\u77E5: {0}"},
-
- { ER_UNKNOWN_MATCH_OPERATION,
- "\u5339\u914D\u64CD\u4F5C\u672A\u77E5!"},
-
- { ER_INCORRECT_ARG_LENGTH,
- "processing-instruction() \u8282\u70B9\u6D4B\u8BD5\u7684\u53C2\u6570\u957F\u5EA6\u4E0D\u6B63\u786E!"},
-
- { ER_CANT_CONVERT_TO_NUMBER,
- "\u65E0\u6CD5\u5C06{0}\u8F6C\u6362\u4E3A\u6570\u5B57"},
-
- { ER_CANT_CONVERT_TO_NODELIST,
- "\u65E0\u6CD5\u5C06{0}\u8F6C\u6362\u4E3A NodeList!"},
-
- { ER_CANT_CONVERT_TO_MUTABLENODELIST,
- "\u65E0\u6CD5\u5C06{0}\u8F6C\u6362\u4E3A NodeSetDTM!"},
-
- { ER_CANT_CONVERT_TO_TYPE,
- "\u65E0\u6CD5\u5C06{0}\u8F6C\u6362\u4E3A type#{1}"},
-
- { ER_EXPECTED_MATCH_PATTERN,
- "getMatchScore \u4E2D\u9700\u8981\u5339\u914D\u6A21\u5F0F!"},
-
- { ER_COULDNOT_GET_VAR_NAMED,
- "\u65E0\u6CD5\u83B7\u53D6\u540D\u4E3A{0}\u7684\u53D8\u91CF"},
-
- { ER_UNKNOWN_OPCODE,
- "\u9519\u8BEF! \u64CD\u4F5C\u7801\u672A\u77E5: {0}"},
-
- { ER_EXTRA_ILLEGAL_TOKENS,
- "\u9644\u52A0\u975E\u6CD5\u6807\u8BB0: {0}"},
-
- { ER_EXPECTED_DOUBLE_QUOTE,
- "\u9519\u8BEF\u5F15\u7528\u7684\u6587\u5B57... \u9700\u8981\u53CC\u5F15\u53F7!"},
-
- { ER_EXPECTED_SINGLE_QUOTE,
- "\u9519\u8BEF\u5F15\u7528\u7684\u6587\u5B57... \u9700\u8981\u5355\u5F15\u53F7!"},
-
- { ER_EMPTY_EXPRESSION,
- "\u7A7A\u8868\u8FBE\u5F0F!"},
-
- { ER_EXPECTED_BUT_FOUND,
- "\u9700\u8981{0}, \u4F46\u627E\u5230: {1}"},
-
- { ER_INCORRECT_PROGRAMMER_ASSERTION,
- "\u7A0B\u5E8F\u5458\u65AD\u8A00\u9519\u8BEF! - {0}"},
-
- { ER_BOOLEAN_ARG_NO_LONGER_OPTIONAL,
- "\u5728 19990709 XPath \u8349\u7A3F\u4E2D, boolean(...) \u53C2\u6570\u4E0D\u518D\u662F\u53EF\u9009\u7684\u3002"},
-
- { ER_FOUND_COMMA_BUT_NO_PRECEDING_ARG,
- "\u5DF2\u627E\u5230 ',', \u4F46\u524D\u9762\u6CA1\u6709\u53C2\u6570!"},
-
- { ER_FOUND_COMMA_BUT_NO_FOLLOWING_ARG,
- "\u5DF2\u627E\u5230 ',', \u4F46\u540E\u9762\u6CA1\u6709\u53C2\u6570!"},
-
- { ER_PREDICATE_ILLEGAL_SYNTAX,
- "'..[predicate]' \u6216 '.[predicate]' \u662F\u975E\u6CD5\u8BED\u6CD5\u3002\u8BF7\u6539\u7528 'self::node()[predicate]'\u3002"},
-
- { ER_ILLEGAL_AXIS_NAME,
- "\u975E\u6CD5\u8F74\u540D\u79F0: {0}"},
-
- { ER_UNKNOWN_NODETYPE,
- "\u672A\u77E5\u8282\u70B9\u7C7B\u578B: {0}"},
-
- { ER_PATTERN_LITERAL_NEEDS_BE_QUOTED,
- "\u9700\u8981\u7528\u5F15\u53F7\u5C06\u6A21\u5F0F\u6587\u5B57 ({0}) \u5F15\u8D77\u6765!"},
-
- { ER_COULDNOT_BE_FORMATTED_TO_NUMBER,
- "\u65E0\u6CD5\u5C06{0}\u7684\u683C\u5F0F\u8BBE\u7F6E\u4E3A\u6570\u5B57!"},
-
- { ER_COULDNOT_CREATE_XMLPROCESSORLIAISON,
- "\u65E0\u6CD5\u521B\u5EFA XML TransformerFactory Liaison: {0}"},
-
- { ER_DIDNOT_FIND_XPATH_SELECT_EXP,
- "\u9519\u8BEF! \u627E\u4E0D\u5230 xpath \u9009\u62E9\u8868\u8FBE\u5F0F (-select)\u3002"},
-
- { ER_COULDNOT_FIND_ENDOP_AFTER_OPLOCATIONPATH,
- "\u9519\u8BEF! \u5728 OP_LOCATIONPATH \u540E\u627E\u4E0D\u5230 ENDOP"},
-
- { ER_ERROR_OCCURED,
- "\u51FA\u73B0\u9519\u8BEF!"},
-
- { ER_ILLEGAL_VARIABLE_REFERENCE,
- "\u4E3A\u53D8\u91CF\u7ED9\u5B9A\u7684 VariableReference \u8131\u79BB\u4E0A\u4E0B\u6587\u6216\u6CA1\u6709\u5B9A\u4E49! \u540D\u79F0 = {0}"},
-
- { ER_AXES_NOT_ALLOWED,
- "\u5339\u914D\u6A21\u5F0F\u4E2D\u4EC5\u5141\u8BB8\u4F7F\u7528 child:: \u548C attribute:: \u8F74\u3002\u8FDD\u89C4\u8F74 = {0}"},
-
- { ER_KEY_HAS_TOO_MANY_ARGS,
- "key() \u7684\u53C2\u6570\u6570\u76EE\u4E0D\u6B63\u786E\u3002"},
-
- { ER_COUNT_TAKES_1_ARG,
- "count \u51FD\u6570\u5E94\u91C7\u7528\u4E00\u4E2A\u53C2\u6570!"},
-
- { ER_COULDNOT_FIND_FUNCTION,
- "\u627E\u4E0D\u5230\u51FD\u6570: {0}"},
-
- { ER_UNSUPPORTED_ENCODING,
- "\u4E0D\u652F\u6301\u7F16\u7801: {0}"},
-
- { ER_PROBLEM_IN_DTM_NEXTSIBLING,
- "getNextSibling \u65F6 DTM \u4E2D\u51FA\u73B0\u95EE\u9898... \u6B63\u5728\u5C1D\u8BD5\u6062\u590D"},
-
- { ER_CANNOT_WRITE_TO_EMPTYNODELISTIMPL,
- "\u7A0B\u5E8F\u5458\u9519\u8BEF: \u65E0\u6CD5\u5199\u5165 EmptyNodeList\u3002"},
-
- { ER_SETDOMFACTORY_NOT_SUPPORTED,
- "XPathContext \u4E0D\u652F\u6301 setDOMFactory!"},
-
- { ER_PREFIX_MUST_RESOLVE,
- "\u524D\u7F00\u5FC5\u987B\u89E3\u6790\u4E3A\u540D\u79F0\u7A7A\u95F4: {0}"},
-
- { ER_PARSE_NOT_SUPPORTED,
- "XPathContext \u4E2D\u4E0D\u652F\u6301 parse (InputSource source)! \u65E0\u6CD5\u6253\u5F00{0}"},
-
- { ER_SAX_API_NOT_HANDLED,
- "DTM \u672A\u5904\u7406 SAX API characters(char ch[]...!"},
-
- { ER_IGNORABLE_WHITESPACE_NOT_HANDLED,
- "DTM \u672A\u5904\u7406 ignorableWhitespace(char ch[]...!"},
-
- { ER_DTM_CANNOT_HANDLE_NODES,
- "DTMLiaison \u65E0\u6CD5\u5904\u7406{0}\u7C7B\u578B\u7684\u8282\u70B9"},
-
- { ER_XERCES_CANNOT_HANDLE_NODES,
- "DOM2Helper \u65E0\u6CD5\u5904\u7406{0}\u7C7B\u578B\u7684\u8282\u70B9"},
-
- { ER_XERCES_PARSE_ERROR_DETAILS,
- "DOM2Helper.parse \u9519\u8BEF: SystemID - \u7B2C {0} \u884C - {1}"},
-
- { ER_XERCES_PARSE_ERROR,
- "DOM2Helper.parse \u9519\u8BEF"},
-
- { ER_INVALID_UTF16_SURROGATE,
- "\u68C0\u6D4B\u5230\u65E0\u6548\u7684 UTF-16 \u4EE3\u7406: {0}?"},
-
- { ER_OIERROR,
- "IO \u9519\u8BEF"},
-
- { ER_CANNOT_CREATE_URL,
- "\u65E0\u6CD5\u4E3A{0}\u521B\u5EFA url"},
-
- { ER_XPATH_READOBJECT,
- "\u5728 XPath.readObject \u4E2D: {0}"},
-
- { ER_FUNCTION_TOKEN_NOT_FOUND,
- "\u627E\u4E0D\u5230\u51FD\u6570\u6807\u8BB0\u3002"},
-
- { ER_CANNOT_DEAL_XPATH_TYPE,
- "\u65E0\u6CD5\u5904\u7406 XPath \u7C7B\u578B: {0}"},
-
- { ER_NODESET_NOT_MUTABLE,
- "\u6B64 NodeSet \u4E0D\u53EF\u53D8"},
-
- { ER_NODESETDTM_NOT_MUTABLE,
- "\u6B64 NodeSetDTM \u4E0D\u53EF\u53D8"},
-
- { ER_VAR_NOT_RESOLVABLE,
- "\u65E0\u6CD5\u89E3\u6790\u53D8\u91CF: {0}"},
-
- { ER_NULL_ERROR_HANDLER,
- "\u7A7A\u9519\u8BEF\u5904\u7406\u7A0B\u5E8F"},
-
- { ER_PROG_ASSERT_UNKNOWN_OPCODE,
- "\u7A0B\u5E8F\u5458\u65AD\u8A00: \u64CD\u4F5C\u7801\u672A\u77E5: {0}"},
-
- { ER_ZERO_OR_ONE,
- "0 \u6216 1"},
-
- { ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "XRTreeFragSelectWrapper \u4E0D\u652F\u6301 rtf()"},
-
- { ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "XRTreeFragSelectWrapper \u4E0D\u652F\u6301 asNodeIterator()"},
-
- /** detach() not supported by XRTreeFragSelectWrapper */
- { ER_DETACH_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "XRTreeFragSelectWrapper \u4E0D\u652F\u6301 detach()"},
-
- /** num() not supported by XRTreeFragSelectWrapper */
- { ER_NUM_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "XRTreeFragSelectWrapper \u4E0D\u652F\u6301 num()"},
-
- /** xstr() not supported by XRTreeFragSelectWrapper */
- { ER_XSTR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "XRTreeFragSelectWrapper \u4E0D\u652F\u6301 xstr()"},
-
- /** str() not supported by XRTreeFragSelectWrapper */
- { ER_STR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "XRTreeFragSelectWrapper \u4E0D\u652F\u6301 str()"},
-
- { ER_FSB_NOT_SUPPORTED_XSTRINGFORCHARS,
- "XStringForChars \u4E0D\u652F\u6301 fsb()"},
-
- { ER_COULD_NOT_FIND_VAR,
- "\u627E\u4E0D\u5230\u540D\u4E3A{0}\u7684\u53D8\u91CF"},
-
- { ER_XSTRINGFORCHARS_CANNOT_TAKE_STRING,
- "XStringForChars \u65E0\u6CD5\u91C7\u7528\u5B57\u7B26\u4E32\u4F5C\u4E3A\u53C2\u6570"},
-
- { ER_FASTSTRINGBUFFER_CANNOT_BE_NULL,
- "FastStringBuffer \u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A\u503C"},
-
- { ER_TWO_OR_THREE,
- "2 \u6216 3"},
-
- { ER_VARIABLE_ACCESSED_BEFORE_BIND,
- "\u5DF2\u5728\u7ED1\u5B9A\u53D8\u91CF\u524D\u8BBF\u95EE\u6B64\u53D8\u91CF!"},
-
- { ER_FSB_CANNOT_TAKE_STRING,
- "XStringForFSB \u65E0\u6CD5\u91C7\u7528\u5B57\u7B26\u4E32\u4F5C\u4E3A\u53C2\u6570!"},
-
- { ER_SETTING_WALKER_ROOT_TO_NULL,
- "\n !!!! \u9519\u8BEF! \u5C06 walker \u7684\u6839\u8BBE\u7F6E\u4E3A\u7A7A\u503C!!!"},
-
- { ER_NODESETDTM_CANNOT_ITERATE,
- "\u6B64 NodeSetDTM \u65E0\u6CD5\u8FED\u4EE3\u5230\u4E0A\u4E00\u4E2A\u8282\u70B9!"},
-
- { ER_NODESET_CANNOT_ITERATE,
- "\u6B64 NodeSet \u65E0\u6CD5\u8FED\u4EE3\u5230\u4E0A\u4E00\u4E2A\u8282\u70B9!"},
-
- { ER_NODESETDTM_CANNOT_INDEX,
- "\u6B64 NodeSetDTM \u65E0\u6CD5\u6267\u884C indexing \u6216 counting \u51FD\u6570!"},
-
- { ER_NODESET_CANNOT_INDEX,
- "\u6B64 NodeSet \u65E0\u6CD5\u6267\u884C indexing \u6216 counting \u51FD\u6570!"},
-
- { ER_CANNOT_CALL_SETSHOULDCACHENODE,
- "\u65E0\u6CD5\u5728\u8C03\u7528 nextNode \u4E4B\u540E\u8C03\u7528 setShouldCacheNodes!"},
-
- { ER_ONLY_ALLOWS,
- "{0}\u4EC5\u5141\u8BB8\u4F7F\u7528{1}\u53C2\u6570"},
-
- { ER_UNKNOWN_STEP,
- "getNextStepPos \u4E2D\u7684\u7A0B\u5E8F\u5458\u65AD\u8A00: stepType \u672A\u77E5: {0}"},
-
- //Note to translators: A relative location path is a form of XPath expression.
- // The message indicates that such an expression was expected following the
- // characters '/' or '//', but was not found.
- { ER_EXPECTED_REL_LOC_PATH,
- "\u76F8\u5BF9\u4F4D\u7F6E\u8DEF\u5F84\u5E94\u4F4D\u4E8E '/' \u6216 '//' \u6807\u8BB0\u4E4B\u540E\u3002"},
-
- // Note to translators: A location path is a form of XPath expression.
- // The message indicates that syntactically such an expression was expected,but
- // the characters specified by the substitution text were encountered instead.
- { ER_EXPECTED_LOC_PATH,
- "\u9700\u8981\u4F4D\u7F6E\u8DEF\u5F84, \u4F46\u9047\u5230\u4EE5\u4E0B\u6807\u8BB0: {0}"},
-
- // Note to translators: A location path is a form of XPath expression.
- // The message indicates that syntactically such a subexpression was expected,
- // but no more characters were found in the expression.
- { ER_EXPECTED_LOC_PATH_AT_END_EXPR,
- "\u9700\u8981\u4F4D\u7F6E\u8DEF\u5F84, \u4F46\u627E\u5230 XPath \u8868\u8FBE\u5F0F\u7684\u672B\u5C3E\u3002"},
-
- // Note to translators: A location step is part of an XPath expression.
- // The message indicates that syntactically such an expression was expected
- // following the specified characters.
- { ER_EXPECTED_LOC_STEP,
- "\u4F4D\u7F6E\u6B65\u9AA4\u5E94\u4F4D\u4E8E '/' \u6216 '//' \u6807\u8BB0\u4E4B\u540E\u3002"},
-
- // Note to translators: A node test is part of an XPath expression that is
- // used to test for particular kinds of nodes. In this case, a node test that
- // consists of an NCName followed by a colon and an asterisk or that consists
- // of a QName was expected, but was not found.
- { ER_EXPECTED_NODE_TEST,
- "\u9700\u8981\u4E0E NCName:* \u6216 QName \u5339\u914D\u7684\u8282\u70B9\u6D4B\u8BD5\u3002"},
-
- // Note to translators: A step pattern is part of an XPath expression.
- // The message indicates that syntactically such an expression was expected,
- // but the specified character was found in the expression instead.
- { ER_EXPECTED_STEP_PATTERN,
- "\u9700\u8981\u6B65\u9AA4\u6A21\u5F0F, \u4F46\u9047\u5230 '/'\u3002"},
-
- // Note to translators: A relative path pattern is part of an XPath expression.
- // The message indicates that syntactically such an expression was expected,
- // but was not found.
- { ER_EXPECTED_REL_PATH_PATTERN,
- "\u9700\u8981\u76F8\u5BF9\u8DEF\u5F84\u6A21\u5F0F\u3002"},
-
- // Note to translators: The substitution text is the name of a data type. The
- // message indicates that a value of a particular type could not be converted
- // to a value of type boolean.
- { ER_CANT_CONVERT_TO_BOOLEAN,
- "XPath \u8868\u8FBE\u5F0F ''{0}'' \u7684 XPathResult \u5177\u6709{1}\u7C7B\u578B\u7684 XPathResultType, \u65E0\u6CD5\u5C06\u6B64 XPathResultType \u8F6C\u6362\u4E3A boolean\u3002"},
-
- // Note to translators: Do not translate ANY_UNORDERED_NODE_TYPE and
- // FIRST_ORDERED_NODE_TYPE.
- { ER_CANT_CONVERT_TO_SINGLENODE,
- "XPath \u8868\u8FBE\u5F0F ''{0}'' \u7684 XPathResult \u5177\u6709{1}\u7C7B\u578B\u7684 XPathResultType, \u65E0\u6CD5\u5C06\u6B64 XPathResultType \u8F6C\u6362\u4E3A\u5355\u4E00\u8282\u70B9\u3002\u65B9\u6CD5 getSingleNodeValue \u4EC5\u9002\u7528\u4E8E\u7C7B\u578B ANY_UNORDERED_NODE_TYPE \u548C FIRST_ORDERED_NODE_TYPE\u3002"},
-
- // Note to translators: Do not translate UNORDERED_NODE_SNAPSHOT_TYPE and
- // ORDERED_NODE_SNAPSHOT_TYPE.
- { ER_CANT_GET_SNAPSHOT_LENGTH,
- "\u65E0\u6CD5\u5728 XPath \u8868\u8FBE\u5F0F ''{0}'' \u7684 XPathResult \u4E2D\u8C03\u7528\u65B9\u6CD5 getSnapshotLength, \u8FD9\u662F\u56E0\u4E3A\u5176 XPathResultType \u4E3A{1}\u3002\u6B64\u65B9\u6CD5\u4EC5\u9002\u7528\u4E8E\u7C7B\u578B UNORDERED_NODE_SNAPSHOT_TYPE \u548C ORDERED_NODE_SNAPSHOT_TYPE\u3002"},
-
- { ER_NON_ITERATOR_TYPE,
- "\u65E0\u6CD5\u5728 XPath \u8868\u8FBE\u5F0F ''{0}'' \u7684 XPathResult \u4E2D\u8C03\u7528\u65B9\u6CD5 iterateNext, \u8FD9\u662F\u56E0\u4E3A\u5176 XPathResultType \u4E3A{1}\u3002\u6B64\u65B9\u6CD5\u4EC5\u9002\u7528\u4E8E\u7C7B\u578B UNORDERED_NODE_ITERATOR_TYPE \u548C ORDERED_NODE_ITERATOR_TYPE\u3002"},
-
- // Note to translators: This message indicates that the document being operated
- // upon changed, so the iterator object that was being used to traverse the
- // document has now become invalid.
- { ER_DOC_MUTATED,
- "\u7531\u4E8E\u5DF2\u8FD4\u56DE\u7ED3\u679C, \u6587\u6863\u53D1\u751F\u53D8\u66F4\u3002\u8FED\u4EE3\u5668\u65E0\u6548\u3002"},
-
- { ER_INVALID_XPATH_TYPE,
- "XPath \u7C7B\u578B\u53C2\u6570\u65E0\u6548: {0}"},
-
- { ER_EMPTY_XPATH_RESULT,
- "\u7A7A XPath \u7ED3\u679C\u5BF9\u8C61"},
-
- { ER_INCOMPATIBLE_TYPES,
- "XPath \u8868\u8FBE\u5F0F ''{0}'' \u7684 XPathResult \u5177\u6709{1}\u7C7B\u578B\u7684 XPathResultType, \u65E0\u6CD5\u5C06\u6B64 XPathResultType \u5F3A\u5236\u4E3A{2}\u7C7B\u578B\u7684\u6307\u5B9A XPathResultType\u3002"},
-
- { ER_NULL_RESOLVER,
- "\u65E0\u6CD5\u4F7F\u7528\u7A7A\u524D\u7F00\u89E3\u6790\u5668\u89E3\u6790\u524D\u7F00\u3002"},
-
- // Note to translators: The substitution text is the name of a data type. The
- // message indicates that a value of a particular type could not be converted
- // to a value of type string.
- { ER_CANT_CONVERT_TO_STRING,
- "XPath \u8868\u8FBE\u5F0F ''{0}'' \u7684 XPathResult \u5177\u6709{1}\u7C7B\u578B\u7684 XPathResultType, \u65E0\u6CD5\u5C06\u6B64 XPathResultType \u8F6C\u6362\u4E3A\u5B57\u7B26\u4E32\u3002"},
-
- // Note to translators: Do not translate snapshotItem,
- // UNORDERED_NODE_SNAPSHOT_TYPE and ORDERED_NODE_SNAPSHOT_TYPE.
- { ER_NON_SNAPSHOT_TYPE,
- "\u65E0\u6CD5\u5728 XPath \u8868\u8FBE\u5F0F ''{0}'' \u7684 XPathResult \u4E2D\u8C03\u7528\u65B9\u6CD5 snapshotItem, \u8FD9\u662F\u56E0\u4E3A\u5176 XPathResultType \u4E3A{1}\u3002\u6B64\u65B9\u6CD5\u4EC5\u9002\u7528\u4E8E\u7C7B\u578B UNORDERED_NODE_SNAPSHOT_TYPE \u548C ORDERED_NODE_SNAPSHOT_TYPE\u3002"},
-
- // Note to translators: XPathEvaluator is a Java interface name. An
- // XPathEvaluator is created with respect to a particular XML document, and in
- // this case the expression represented by this object was being evaluated with
- // respect to a context node from a different document.
- { ER_WRONG_DOCUMENT,
- "\u4E0A\u4E0B\u6587\u8282\u70B9\u4E0D\u5C5E\u4E8E\u7ED1\u5B9A\u5230\u6B64 XPathEvaluator \u7684\u6587\u6863\u3002"},
-
- // Note to translators: The XPath expression cannot be evaluated with respect
- // to this type of node.
- { ER_WRONG_NODETYPE,
- "\u4E0D\u652F\u6301\u4E0A\u4E0B\u6587\u8282\u70B9\u7C7B\u578B\u3002"},
-
- { ER_XPATH_ERROR,
- "XPath \u4E2D\u5B58\u5728\u672A\u77E5\u9519\u8BEF\u3002"},
-
- { ER_CANT_CONVERT_XPATHRESULTTYPE_TO_NUMBER,
- "XPath \u8868\u8FBE\u5F0F ''{0}'' \u7684 XPathResult \u5177\u6709{1}\u7C7B\u578B\u7684 XPathResultType, \u65E0\u6CD5\u5C06\u6B64 XPathResultType \u8F6C\u6362\u4E3A\u6570\u5B57"},
-
- //BEGIN: Definitions of error keys used in exception messages of JAXP 1.3 XPath API implementation
-
- /** Field ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED */
-
- { ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED,
- "\u5F53 XMLConstants.FEATURE_SECURE_PROCESSING \u529F\u80FD\u8BBE\u7F6E\u4E3A\u201C\u771F\u201D\u65F6, \u4E0D\u80FD\u8C03\u7528\u6269\u5C55\u51FD\u6570 ''{0}''\u3002"},
-
- /** Field ER_RESOLVE_VARIABLE_RETURNS_NULL */
-
- { ER_RESOLVE_VARIABLE_RETURNS_NULL,
- "\u53D8\u91CF{0}\u7684 resolveVariable \u8FD4\u56DE\u7A7A\u503C"},
-
- /** Field ER_UNSUPPORTED_RETURN_TYPE */
-
- { ER_UNSUPPORTED_RETURN_TYPE,
- "\u4E0D\u652F\u6301\u8BE5\u8FD4\u56DE\u7C7B\u578B: {0}"},
-
- /** Field ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL */
-
- { ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL,
- "\u6E90\u548C/\u6216\u8FD4\u56DE\u7C7B\u578B\u4E0D\u80FD\u4E3A\u7A7A\u503C"},
-
- /** Field ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL */
-
- { ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL,
- "\u6E90\u548C/\u6216\u8FD4\u56DE\u7C7B\u578B\u4E0D\u80FD\u4E3A\u7A7A\u503C"},
-
- /** Field ER_ARG_CANNOT_BE_NULL */
-
- { ER_ARG_CANNOT_BE_NULL,
- "{0}\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A\u503C"},
-
- /** Field ER_OBJECT_MODEL_NULL */
-
- { ER_OBJECT_MODEL_NULL,
- "\u4E0D\u80FD\u5728 objectModel == \u7A7A\u503C\u7684\u60C5\u51B5\u4E0B\u8C03\u7528 {0}#isObjectModelSupported(String objectModel)"},
-
- /** Field ER_OBJECT_MODEL_EMPTY */
-
- { ER_OBJECT_MODEL_EMPTY,
- "\u4E0D\u80FD\u5728 objectModel == \"\" \u7684\u60C5\u51B5\u4E0B\u8C03\u7528 {0}#isObjectModelSupported(String objectModel)"},
-
- /** Field ER_OBJECT_MODEL_EMPTY */
-
- { ER_FEATURE_NAME_NULL,
- "\u5C1D\u8BD5\u8BBE\u7F6E\u5177\u6709\u7A7A\u540D\u79F0\u7684\u529F\u80FD: {0}#setFeature(null, {1})"},
-
- /** Field ER_FEATURE_UNKNOWN */
-
- { ER_FEATURE_UNKNOWN,
- "\u5C1D\u8BD5\u8BBE\u7F6E\u672A\u77E5\u529F\u80FD \"{0}\":{1}#setFeature({0},{2})"},
-
- /** Field ER_GETTING_NULL_FEATURE */
-
- { ER_GETTING_NULL_FEATURE,
- "\u5C1D\u8BD5\u83B7\u53D6\u5177\u6709\u7A7A\u540D\u79F0\u7684\u529F\u80FD: {0}#getFeature(null)"},
-
- /** Field ER_GETTING_NULL_FEATURE */
-
- { ER_GETTING_UNKNOWN_FEATURE,
- "\u5C1D\u8BD5\u83B7\u53D6\u672A\u77E5\u529F\u80FD \"{0}\":{1}#getFeature({0})"},
-
- {ER_SECUREPROCESSING_FEATURE,
- "FEATURE_SECURE_PROCESSING: \u5B58\u5728 Security Manager \u65F6, \u65E0\u6CD5\u5C06\u6B64\u529F\u80FD\u8BBE\u7F6E\u4E3A\u201C\u5047\u201D: {1}#setFeature({0},{2})"},
-
- /** Field ER_NULL_XPATH_FUNCTION_RESOLVER */
-
- { ER_NULL_XPATH_FUNCTION_RESOLVER,
- "\u5C1D\u8BD5\u8BBE\u7F6E\u7A7A XPathFunctionResolver:{0}#setXPathFunctionResolver(null)"},
-
- /** Field ER_NULL_XPATH_VARIABLE_RESOLVER */
-
- { ER_NULL_XPATH_VARIABLE_RESOLVER,
- "\u5C1D\u8BD5\u8BBE\u7F6E\u7A7A XPathVariableResolver:{0}#setXPathVariableResolver(null)"},
-
- //END: Definitions of error keys used in exception messages of JAXP 1.3 XPath API implementation
-
- // Warnings...
-
- { WG_LOCALE_NAME_NOT_HANDLED,
- "\u5C1A\u672A\u5904\u7406 format-number \u51FD\u6570\u4E2D\u7684\u533A\u57DF\u8BBE\u7F6E\u540D\u79F0!"},
-
- { WG_PROPERTY_NOT_SUPPORTED,
- "\u4E0D\u652F\u6301 XSL \u5C5E\u6027: {0}"},
-
- { WG_DONT_DO_ANYTHING_WITH_NS,
- "\u76EE\u524D\u4E0D\u8981\u4F7F\u7528\u5C5E\u6027{1}\u4E2D\u7684\u540D\u79F0\u7A7A\u95F4{0}\u6267\u884C\u4EFB\u4F55\u64CD\u4F5C"},
-
- { WG_SECURITY_EXCEPTION,
- "\u5C1D\u8BD5\u8BBF\u95EE XSL \u7CFB\u7EDF\u5C5E\u6027\u65F6\u51FA\u73B0 SecurityException: {0}"},
-
- { WG_QUO_NO_LONGER_DEFINED,
- "\u65E7\u8BED\u6CD5: XPath \u4E2D\u4E0D\u518D\u5B9A\u4E49 quo(...)\u3002"},
-
- { WG_NEED_DERIVED_OBJECT_TO_IMPLEMENT_NODETEST,
- "XPath \u9700\u8981\u6D3E\u751F\u5BF9\u8C61\u624D\u80FD\u5B9E\u73B0 nodeTest!"},
-
- { WG_FUNCTION_TOKEN_NOT_FOUND,
- "\u627E\u4E0D\u5230\u51FD\u6570\u6807\u8BB0\u3002"},
-
- { WG_COULDNOT_FIND_FUNCTION,
- "\u627E\u4E0D\u5230\u51FD\u6570: {0}"},
-
- { WG_CANNOT_MAKE_URL_FROM,
- "\u65E0\u6CD5\u6839\u636E{0}\u751F\u6210 URL"},
-
- { WG_EXPAND_ENTITIES_NOT_SUPPORTED,
- "DTM \u89E3\u6790\u5668\u4E0D\u652F\u6301 -E \u9009\u9879"},
-
- { WG_ILLEGAL_VARIABLE_REFERENCE,
- "\u4E3A\u53D8\u91CF\u7ED9\u5B9A\u7684 VariableReference \u8131\u79BB\u4E0A\u4E0B\u6587\u6216\u6CA1\u6709\u5B9A\u4E49! \u540D\u79F0 = {0}"},
-
- { WG_UNSUPPORTED_ENCODING,
- "\u4E0D\u652F\u6301\u7F16\u7801: {0}"},
-
-
-
- // Other miscellaneous text used inside the code...
- { "ui_language", "en"},
- { "help_language", "en"},
- { "language", "en"},
- { "BAD_CODE", "createMessage \u7684\u53C2\u6570\u8D85\u51FA\u8303\u56F4"},
- { "FORMAT_FAILED", "\u8C03\u7528 messageFormat \u65F6\u629B\u51FA\u5F02\u5E38\u9519\u8BEF"},
- { "version", ">>>>>>> Xalan \u7248\u672C "},
- { "version2", "<<<<<<<"},
- { "yes", "\u662F"},
- { "line", "\u884C\u53F7"},
- { "column", "\u5217\u53F7"},
- { "xsldone", "XSLProcessor: \u5B8C\u6210"},
- { "xpath_option", "xpath \u9009\u9879: "},
- { "optionIN", " [-in inputXMLURL]"},
- { "optionSelect", " [-select xpath expression]"},
- { "optionMatch", " [-match match pattern (for match diagnostics)]"},
- { "optionAnyExpr", "\u6216\u8005\u4EC5 xpath \u8868\u8FBE\u5F0F\u6267\u884C\u8BCA\u65AD\u8F6C\u50A8"},
- { "noParsermsg1", "XSL \u8FDB\u7A0B\u672A\u6210\u529F\u3002"},
- { "noParsermsg2", "** \u627E\u4E0D\u5230\u89E3\u6790\u5668 **"},
- { "noParsermsg3", "\u8BF7\u68C0\u67E5\u60A8\u7684\u7C7B\u8DEF\u5F84\u3002"},
- { "noParsermsg4", "\u5982\u679C\u6CA1\u6709 IBM \u63D0\u4F9B\u7684 XML Parser for Java, \u5219\u53EF\u4EE5\u4ECE"},
- { "noParsermsg5", "IBM AlphaWorks \u8FDB\u884C\u4E0B\u8F7D, \u7F51\u5740\u4E3A: http://www.alphaworks.ibm.com/formula/xml"},
- { "gtone", ">1" },
- { "zero", "0" },
- { "one", "1" },
- { "two" , "2" },
- { "three", "3" }
-
- };
-
- /**
- * Get the association list.
- *
- * @return The association list.
- */
- public Object[][] getContents()
- {
- return _contents;
- }
-
-
- // ================= INFRASTRUCTURE ======================
-
- /** Field BAD_CODE */
- public static final String BAD_CODE = "BAD_CODE";
-
- /** Field FORMAT_FAILED */
- public static final String FORMAT_FAILED = "FORMAT_FAILED";
-
- /** Field ERROR_RESOURCES */
- public static final String ERROR_RESOURCES =
- "com.sun.org.apache.xpath.internal.res.XPATHErrorResources";
-
- /** Field ERROR_STRING */
- public static final String ERROR_STRING = "#error";
-
- /** Field ERROR_HEADER */
- public static final String ERROR_HEADER = "Error: ";
-
- /** Field WARNING_HEADER */
- public static final String WARNING_HEADER = "Warning: ";
-
- /** Field XSL_HEADER */
- public static final String XSL_HEADER = "XSL ";
-
- /** Field XML_HEADER */
- public static final String XML_HEADER = "XML ";
-
- /** Field QUERY_HEADER */
- public static final String QUERY_HEADER = "PATTERN ";
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_zh_TW.java b/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_zh_TW.java
deleted file mode 100644
index b1e4a8a..0000000
--- a/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_zh_TW.java
+++ /dev/null
@@ -1,936 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.org.apache.xpath.internal.res;
-
-import java.util.ListResourceBundle;
-
-/**
- * Set up error messages.
- * We build a two dimensional array of message keys and
- * message strings. In order to add a new message here,
- * you need to first add a Static string constant for the
- * Key and update the contents array with Key, Value pair
- * Also you need to update the count of messages(MAX_CODE)or
- * the count of warnings(MAX_WARNING) [ Information purpose only]
- * @xsl.usage advanced
- */
-public class XPATHErrorResources_zh_TW extends ListResourceBundle
-{
-
-/*
- * General notes to translators:
- *
- * This file contains error and warning messages related to XPath Error
- * Handling.
- *
- * 1) Xalan (or more properly, Xalan-interpretive) and XSLTC are names of
- * components.
- * XSLT is an acronym for "XML Stylesheet Language: Transformations".
- * XSLTC is an acronym for XSLT Compiler.
- *
- * 2) A stylesheet is a description of how to transform an input XML document
- * into a resultant XML document (or HTML document or text). The
- * stylesheet itself is described in the form of an XML document.
- *
- * 3) A template is a component of a stylesheet that is used to match a
- * particular portion of an input document and specifies the form of the
- * corresponding portion of the output document.
- *
- * 4) An element is a mark-up tag in an XML document; an attribute is a
- * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
- * "elem" is an element name, "attr" and "attr2" are attribute names with
- * the values "val" and "val2", respectively.
- *
- * 5) A namespace declaration is a special attribute that is used to associate
- * a prefix with a URI (the namespace). The meanings of element names and
- * attribute names that use that prefix are defined with respect to that
- * namespace.
- *
- * 6) "Translet" is an invented term that describes the class file that
- * results from compiling an XML stylesheet into a Java class.
- *
- * 7) XPath is a specification that describes a notation for identifying
- * nodes in a tree-structured representation of an XML document. An
- * instance of that notation is referred to as an XPath expression.
- *
- * 8) The context node is the node in the document with respect to which an
- * XPath expression is being evaluated.
- *
- * 9) An iterator is an object that traverses nodes in the tree, one at a time.
- *
- * 10) NCName is an XML term used to describe a name that does not contain a
- * colon (a "no-colon name").
- *
- * 11) QName is an XML term meaning "qualified name".
- */
-
- /*
- * static variables
- */
- public static final String ERROR0000 = "ERROR0000";
- public static final String ER_CURRENT_NOT_ALLOWED_IN_MATCH =
- "ER_CURRENT_NOT_ALLOWED_IN_MATCH";
- public static final String ER_CURRENT_TAKES_NO_ARGS =
- "ER_CURRENT_TAKES_NO_ARGS";
- public static final String ER_DOCUMENT_REPLACED = "ER_DOCUMENT_REPLACED";
- public static final String ER_CONTEXT_HAS_NO_OWNERDOC =
- "ER_CONTEXT_HAS_NO_OWNERDOC";
- public static final String ER_LOCALNAME_HAS_TOO_MANY_ARGS =
- "ER_LOCALNAME_HAS_TOO_MANY_ARGS";
- public static final String ER_NAMESPACEURI_HAS_TOO_MANY_ARGS =
- "ER_NAMESPACEURI_HAS_TOO_MANY_ARGS";
- public static final String ER_NORMALIZESPACE_HAS_TOO_MANY_ARGS =
- "ER_NORMALIZESPACE_HAS_TOO_MANY_ARGS";
- public static final String ER_NUMBER_HAS_TOO_MANY_ARGS =
- "ER_NUMBER_HAS_TOO_MANY_ARGS";
- public static final String ER_NAME_HAS_TOO_MANY_ARGS =
- "ER_NAME_HAS_TOO_MANY_ARGS";
- public static final String ER_STRING_HAS_TOO_MANY_ARGS =
- "ER_STRING_HAS_TOO_MANY_ARGS";
- public static final String ER_STRINGLENGTH_HAS_TOO_MANY_ARGS =
- "ER_STRINGLENGTH_HAS_TOO_MANY_ARGS";
- public static final String ER_TRANSLATE_TAKES_3_ARGS =
- "ER_TRANSLATE_TAKES_3_ARGS";
- public static final String ER_UNPARSEDENTITYURI_TAKES_1_ARG =
- "ER_UNPARSEDENTITYURI_TAKES_1_ARG";
- public static final String ER_NAMESPACEAXIS_NOT_IMPLEMENTED =
- "ER_NAMESPACEAXIS_NOT_IMPLEMENTED";
- public static final String ER_UNKNOWN_AXIS = "ER_UNKNOWN_AXIS";
- public static final String ER_UNKNOWN_MATCH_OPERATION =
- "ER_UNKNOWN_MATCH_OPERATION";
- public static final String ER_INCORRECT_ARG_LENGTH ="ER_INCORRECT_ARG_LENGTH";
- public static final String ER_CANT_CONVERT_TO_NUMBER =
- "ER_CANT_CONVERT_TO_NUMBER";
- public static final String ER_CANT_CONVERT_XPATHRESULTTYPE_TO_NUMBER =
- "ER_CANT_CONVERT_XPATHRESULTTYPE_TO_NUMBER";
- public static final String ER_CANT_CONVERT_TO_NODELIST =
- "ER_CANT_CONVERT_TO_NODELIST";
- public static final String ER_CANT_CONVERT_TO_MUTABLENODELIST =
- "ER_CANT_CONVERT_TO_MUTABLENODELIST";
- public static final String ER_CANT_CONVERT_TO_TYPE ="ER_CANT_CONVERT_TO_TYPE";
- public static final String ER_EXPECTED_MATCH_PATTERN =
- "ER_EXPECTED_MATCH_PATTERN";
- public static final String ER_COULDNOT_GET_VAR_NAMED =
- "ER_COULDNOT_GET_VAR_NAMED";
- public static final String ER_UNKNOWN_OPCODE = "ER_UNKNOWN_OPCODE";
- public static final String ER_EXTRA_ILLEGAL_TOKENS ="ER_EXTRA_ILLEGAL_TOKENS";
- public static final String ER_EXPECTED_DOUBLE_QUOTE =
- "ER_EXPECTED_DOUBLE_QUOTE";
- public static final String ER_EXPECTED_SINGLE_QUOTE =
- "ER_EXPECTED_SINGLE_QUOTE";
- public static final String ER_EMPTY_EXPRESSION = "ER_EMPTY_EXPRESSION";
- public static final String ER_EXPECTED_BUT_FOUND = "ER_EXPECTED_BUT_FOUND";
- public static final String ER_INCORRECT_PROGRAMMER_ASSERTION =
- "ER_INCORRECT_PROGRAMMER_ASSERTION";
- public static final String ER_BOOLEAN_ARG_NO_LONGER_OPTIONAL =
- "ER_BOOLEAN_ARG_NO_LONGER_OPTIONAL";
- public static final String ER_FOUND_COMMA_BUT_NO_PRECEDING_ARG =
- "ER_FOUND_COMMA_BUT_NO_PRECEDING_ARG";
- public static final String ER_FOUND_COMMA_BUT_NO_FOLLOWING_ARG =
- "ER_FOUND_COMMA_BUT_NO_FOLLOWING_ARG";
- public static final String ER_PREDICATE_ILLEGAL_SYNTAX =
- "ER_PREDICATE_ILLEGAL_SYNTAX";
- public static final String ER_ILLEGAL_AXIS_NAME = "ER_ILLEGAL_AXIS_NAME";
- public static final String ER_UNKNOWN_NODETYPE = "ER_UNKNOWN_NODETYPE";
- public static final String ER_PATTERN_LITERAL_NEEDS_BE_QUOTED =
- "ER_PATTERN_LITERAL_NEEDS_BE_QUOTED";
- public static final String ER_COULDNOT_BE_FORMATTED_TO_NUMBER =
- "ER_COULDNOT_BE_FORMATTED_TO_NUMBER";
- public static final String ER_COULDNOT_CREATE_XMLPROCESSORLIAISON =
- "ER_COULDNOT_CREATE_XMLPROCESSORLIAISON";
- public static final String ER_DIDNOT_FIND_XPATH_SELECT_EXP =
- "ER_DIDNOT_FIND_XPATH_SELECT_EXP";
- public static final String ER_COULDNOT_FIND_ENDOP_AFTER_OPLOCATIONPATH =
- "ER_COULDNOT_FIND_ENDOP_AFTER_OPLOCATIONPATH";
- public static final String ER_ERROR_OCCURED = "ER_ERROR_OCCURED";
- public static final String ER_ILLEGAL_VARIABLE_REFERENCE =
- "ER_ILLEGAL_VARIABLE_REFERENCE";
- public static final String ER_AXES_NOT_ALLOWED = "ER_AXES_NOT_ALLOWED";
- public static final String ER_KEY_HAS_TOO_MANY_ARGS =
- "ER_KEY_HAS_TOO_MANY_ARGS";
- public static final String ER_COUNT_TAKES_1_ARG = "ER_COUNT_TAKES_1_ARG";
- public static final String ER_COULDNOT_FIND_FUNCTION =
- "ER_COULDNOT_FIND_FUNCTION";
- public static final String ER_UNSUPPORTED_ENCODING ="ER_UNSUPPORTED_ENCODING";
- public static final String ER_PROBLEM_IN_DTM_NEXTSIBLING =
- "ER_PROBLEM_IN_DTM_NEXTSIBLING";
- public static final String ER_CANNOT_WRITE_TO_EMPTYNODELISTIMPL =
- "ER_CANNOT_WRITE_TO_EMPTYNODELISTIMPL";
- public static final String ER_SETDOMFACTORY_NOT_SUPPORTED =
- "ER_SETDOMFACTORY_NOT_SUPPORTED";
- public static final String ER_PREFIX_MUST_RESOLVE = "ER_PREFIX_MUST_RESOLVE";
- public static final String ER_PARSE_NOT_SUPPORTED = "ER_PARSE_NOT_SUPPORTED";
- public static final String ER_SAX_API_NOT_HANDLED = "ER_SAX_API_NOT_HANDLED";
-public static final String ER_IGNORABLE_WHITESPACE_NOT_HANDLED =
- "ER_IGNORABLE_WHITESPACE_NOT_HANDLED";
- public static final String ER_DTM_CANNOT_HANDLE_NODES =
- "ER_DTM_CANNOT_HANDLE_NODES";
- public static final String ER_XERCES_CANNOT_HANDLE_NODES =
- "ER_XERCES_CANNOT_HANDLE_NODES";
- public static final String ER_XERCES_PARSE_ERROR_DETAILS =
- "ER_XERCES_PARSE_ERROR_DETAILS";
- public static final String ER_XERCES_PARSE_ERROR = "ER_XERCES_PARSE_ERROR";
- public static final String ER_INVALID_UTF16_SURROGATE =
- "ER_INVALID_UTF16_SURROGATE";
- public static final String ER_OIERROR = "ER_OIERROR";
- public static final String ER_CANNOT_CREATE_URL = "ER_CANNOT_CREATE_URL";
- public static final String ER_XPATH_READOBJECT = "ER_XPATH_READOBJECT";
- public static final String ER_FUNCTION_TOKEN_NOT_FOUND =
- "ER_FUNCTION_TOKEN_NOT_FOUND";
- public static final String ER_CANNOT_DEAL_XPATH_TYPE =
- "ER_CANNOT_DEAL_XPATH_TYPE";
- public static final String ER_NODESET_NOT_MUTABLE = "ER_NODESET_NOT_MUTABLE";
- public static final String ER_NODESETDTM_NOT_MUTABLE =
- "ER_NODESETDTM_NOT_MUTABLE";
- /** Variable not resolvable: */
- public static final String ER_VAR_NOT_RESOLVABLE = "ER_VAR_NOT_RESOLVABLE";
- /** Null error handler */
- public static final String ER_NULL_ERROR_HANDLER = "ER_NULL_ERROR_HANDLER";
- /** Programmer's assertion: unknown opcode */
- public static final String ER_PROG_ASSERT_UNKNOWN_OPCODE =
- "ER_PROG_ASSERT_UNKNOWN_OPCODE";
- /** 0 or 1 */
- public static final String ER_ZERO_OR_ONE = "ER_ZERO_OR_ONE";
- /** rtf() not supported by XRTreeFragSelectWrapper */
- public static final String ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** asNodeIterator() not supported by XRTreeFragSelectWrapper */
- public static final String ER_ASNODEITERATOR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER = "ER_ASNODEITERATOR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** fsb() not supported for XStringForChars */
- public static final String ER_FSB_NOT_SUPPORTED_XSTRINGFORCHARS =
- "ER_FSB_NOT_SUPPORTED_XSTRINGFORCHARS";
- /** Could not find variable with the name of */
- public static final String ER_COULD_NOT_FIND_VAR = "ER_COULD_NOT_FIND_VAR";
- /** XStringForChars can not take a string for an argument */
- public static final String ER_XSTRINGFORCHARS_CANNOT_TAKE_STRING =
- "ER_XSTRINGFORCHARS_CANNOT_TAKE_STRING";
- /** The FastStringBuffer argument can not be null */
- public static final String ER_FASTSTRINGBUFFER_CANNOT_BE_NULL =
- "ER_FASTSTRINGBUFFER_CANNOT_BE_NULL";
- /** 2 or 3 */
- public static final String ER_TWO_OR_THREE = "ER_TWO_OR_THREE";
- /** Variable accessed before it is bound! */
- public static final String ER_VARIABLE_ACCESSED_BEFORE_BIND =
- "ER_VARIABLE_ACCESSED_BEFORE_BIND";
- /** XStringForFSB can not take a string for an argument! */
- public static final String ER_FSB_CANNOT_TAKE_STRING =
- "ER_FSB_CANNOT_TAKE_STRING";
- /** Error! Setting the root of a walker to null! */
- public static final String ER_SETTING_WALKER_ROOT_TO_NULL =
- "ER_SETTING_WALKER_ROOT_TO_NULL";
- /** This NodeSetDTM can not iterate to a previous node! */
- public static final String ER_NODESETDTM_CANNOT_ITERATE =
- "ER_NODESETDTM_CANNOT_ITERATE";
- /** This NodeSet can not iterate to a previous node! */
- public static final String ER_NODESET_CANNOT_ITERATE =
- "ER_NODESET_CANNOT_ITERATE";
- /** This NodeSetDTM can not do indexing or counting functions! */
- public static final String ER_NODESETDTM_CANNOT_INDEX =
- "ER_NODESETDTM_CANNOT_INDEX";
- /** This NodeSet can not do indexing or counting functions! */
- public static final String ER_NODESET_CANNOT_INDEX =
- "ER_NODESET_CANNOT_INDEX";
- /** Can not call setShouldCacheNodes after nextNode has been called! */
- public static final String ER_CANNOT_CALL_SETSHOULDCACHENODE =
- "ER_CANNOT_CALL_SETSHOULDCACHENODE";
- /** {0} only allows {1} arguments */
- public static final String ER_ONLY_ALLOWS = "ER_ONLY_ALLOWS";
- /** Programmer's assertion in getNextStepPos: unknown stepType: {0} */
- public static final String ER_UNKNOWN_STEP = "ER_UNKNOWN_STEP";
- /** Problem with RelativeLocationPath */
- public static final String ER_EXPECTED_REL_LOC_PATH =
- "ER_EXPECTED_REL_LOC_PATH";
- /** Problem with LocationPath */
- public static final String ER_EXPECTED_LOC_PATH = "ER_EXPECTED_LOC_PATH";
- public static final String ER_EXPECTED_LOC_PATH_AT_END_EXPR =
- "ER_EXPECTED_LOC_PATH_AT_END_EXPR";
- /** Problem with Step */
- public static final String ER_EXPECTED_LOC_STEP = "ER_EXPECTED_LOC_STEP";
- /** Problem with NodeTest */
- public static final String ER_EXPECTED_NODE_TEST = "ER_EXPECTED_NODE_TEST";
- /** Expected step pattern */
- public static final String ER_EXPECTED_STEP_PATTERN =
- "ER_EXPECTED_STEP_PATTERN";
- /** Expected relative path pattern */
- public static final String ER_EXPECTED_REL_PATH_PATTERN =
- "ER_EXPECTED_REL_PATH_PATTERN";
- /** ER_CANT_CONVERT_XPATHRESULTTYPE_TO_BOOLEAN */
- public static final String ER_CANT_CONVERT_TO_BOOLEAN =
- "ER_CANT_CONVERT_TO_BOOLEAN";
- /** Field ER_CANT_CONVERT_TO_SINGLENODE */
- public static final String ER_CANT_CONVERT_TO_SINGLENODE =
- "ER_CANT_CONVERT_TO_SINGLENODE";
- /** Field ER_CANT_GET_SNAPSHOT_LENGTH */
- public static final String ER_CANT_GET_SNAPSHOT_LENGTH =
- "ER_CANT_GET_SNAPSHOT_LENGTH";
- /** Field ER_NON_ITERATOR_TYPE */
- public static final String ER_NON_ITERATOR_TYPE = "ER_NON_ITERATOR_TYPE";
- /** Field ER_DOC_MUTATED */
- public static final String ER_DOC_MUTATED = "ER_DOC_MUTATED";
- public static final String ER_INVALID_XPATH_TYPE = "ER_INVALID_XPATH_TYPE";
- public static final String ER_EMPTY_XPATH_RESULT = "ER_EMPTY_XPATH_RESULT";
- public static final String ER_INCOMPATIBLE_TYPES = "ER_INCOMPATIBLE_TYPES";
- public static final String ER_NULL_RESOLVER = "ER_NULL_RESOLVER";
- public static final String ER_CANT_CONVERT_TO_STRING =
- "ER_CANT_CONVERT_TO_STRING";
- public static final String ER_NON_SNAPSHOT_TYPE = "ER_NON_SNAPSHOT_TYPE";
- public static final String ER_WRONG_DOCUMENT = "ER_WRONG_DOCUMENT";
- /* Note to translators: The XPath expression cannot be evaluated with respect
- * to this type of node.
- */
- /** Field ER_WRONG_NODETYPE */
- public static final String ER_WRONG_NODETYPE = "ER_WRONG_NODETYPE";
- public static final String ER_XPATH_ERROR = "ER_XPATH_ERROR";
-
- //BEGIN: Keys needed for exception messages of JAXP 1.3 XPath API implementation
- public static final String ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED = "ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED";
- public static final String ER_RESOLVE_VARIABLE_RETURNS_NULL = "ER_RESOLVE_VARIABLE_RETURNS_NULL";
- public static final String ER_UNSUPPORTED_RETURN_TYPE = "ER_UNSUPPORTED_RETURN_TYPE";
- public static final String ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL = "ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL";
- public static final String ER_ARG_CANNOT_BE_NULL = "ER_ARG_CANNOT_BE_NULL";
-
- public static final String ER_OBJECT_MODEL_NULL = "ER_OBJECT_MODEL_NULL";
- public static final String ER_OBJECT_MODEL_EMPTY = "ER_OBJECT_MODEL_EMPTY";
- public static final String ER_FEATURE_NAME_NULL = "ER_FEATURE_NAME_NULL";
- public static final String ER_FEATURE_UNKNOWN = "ER_FEATURE_UNKNOWN";
- public static final String ER_GETTING_NULL_FEATURE = "ER_GETTING_NULL_FEATURE";
- public static final String ER_GETTING_UNKNOWN_FEATURE = "ER_GETTING_UNKNOWN_FEATURE";
- public static final String ER_SECUREPROCESSING_FEATURE = "ER_SECUREPROCESSING_FEATURE";
- public static final String ER_NULL_XPATH_FUNCTION_RESOLVER = "ER_NULL_XPATH_FUNCTION_RESOLVER";
- public static final String ER_NULL_XPATH_VARIABLE_RESOLVER = "ER_NULL_XPATH_VARIABLE_RESOLVER";
- //END: Keys needed for exception messages of JAXP 1.3 XPath API implementation
-
- public static final String WG_LOCALE_NAME_NOT_HANDLED =
- "WG_LOCALE_NAME_NOT_HANDLED";
- public static final String WG_PROPERTY_NOT_SUPPORTED =
- "WG_PROPERTY_NOT_SUPPORTED";
- public static final String WG_DONT_DO_ANYTHING_WITH_NS =
- "WG_DONT_DO_ANYTHING_WITH_NS";
- public static final String WG_SECURITY_EXCEPTION = "WG_SECURITY_EXCEPTION";
- public static final String WG_QUO_NO_LONGER_DEFINED =
- "WG_QUO_NO_LONGER_DEFINED";
- public static final String WG_NEED_DERIVED_OBJECT_TO_IMPLEMENT_NODETEST =
- "WG_NEED_DERIVED_OBJECT_TO_IMPLEMENT_NODETEST";
- public static final String WG_FUNCTION_TOKEN_NOT_FOUND =
- "WG_FUNCTION_TOKEN_NOT_FOUND";
- public static final String WG_COULDNOT_FIND_FUNCTION =
- "WG_COULDNOT_FIND_FUNCTION";
- public static final String WG_CANNOT_MAKE_URL_FROM ="WG_CANNOT_MAKE_URL_FROM";
- public static final String WG_EXPAND_ENTITIES_NOT_SUPPORTED =
- "WG_EXPAND_ENTITIES_NOT_SUPPORTED";
- public static final String WG_ILLEGAL_VARIABLE_REFERENCE =
- "WG_ILLEGAL_VARIABLE_REFERENCE";
- public static final String WG_UNSUPPORTED_ENCODING ="WG_UNSUPPORTED_ENCODING";
-
- /** detach() not supported by XRTreeFragSelectWrapper */
- public static final String ER_DETACH_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_DETACH_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** num() not supported by XRTreeFragSelectWrapper */
- public static final String ER_NUM_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_NUM_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** xstr() not supported by XRTreeFragSelectWrapper */
- public static final String ER_XSTR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_XSTR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
- /** str() not supported by XRTreeFragSelectWrapper */
- public static final String ER_STR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER =
- "ER_STR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER";
-
- // Error messages...
-
- private static final Object[][] _contents = new Object[][]{
-
- { "ERROR0000" , "{0}" },
-
- { ER_CURRENT_NOT_ALLOWED_IN_MATCH, "\u914D\u5C0D\u6A23\u5F0F\u4E2D\u4E0D\u5141\u8A31 current() \u51FD\u6578\uFF01" },
-
- { ER_CURRENT_TAKES_NO_ARGS, "current() \u51FD\u6578\u4E0D\u63A5\u53D7\u5F15\u6578\uFF01" },
-
- { ER_DOCUMENT_REPLACED,
- "document() \u51FD\u6578\u5BE6\u884C\u5DF2\u7531 com.sun.org.apache.xalan.internal.xslt.FuncDocument \u53D6\u4EE3\u3002"},
-
- { ER_CONTEXT_HAS_NO_OWNERDOC,
- "\u76F8\u95DC\u8CC7\u8A0A\u74B0\u5883\u4E0D\u5177\u6709\u64C1\u6709\u8005\u6587\u4EF6\uFF01"},
-
- { ER_LOCALNAME_HAS_TOO_MANY_ARGS,
- "local-name() \u5177\u6709\u904E\u591A\u7684\u5F15\u6578\u3002"},
-
- { ER_NAMESPACEURI_HAS_TOO_MANY_ARGS,
- "namespace-uri() \u5177\u6709\u904E\u591A\u7684\u5F15\u6578\u3002"},
-
- { ER_NORMALIZESPACE_HAS_TOO_MANY_ARGS,
- "normalize-space() \u5177\u6709\u904E\u591A\u7684\u5F15\u6578\u3002"},
-
- { ER_NUMBER_HAS_TOO_MANY_ARGS,
- "number() \u5177\u6709\u904E\u591A\u7684\u5F15\u6578\u3002"},
-
- { ER_NAME_HAS_TOO_MANY_ARGS,
- "name() \u5177\u6709\u904E\u591A\u7684\u5F15\u6578\u3002"},
-
- { ER_STRING_HAS_TOO_MANY_ARGS,
- "string() \u5177\u6709\u904E\u591A\u7684\u5F15\u6578\u3002"},
-
- { ER_STRINGLENGTH_HAS_TOO_MANY_ARGS,
- "string-length() \u5177\u6709\u904E\u591A\u7684\u5F15\u6578\u3002"},
-
- { ER_TRANSLATE_TAKES_3_ARGS,
- "translate() \u51FD\u6578\u63A5\u53D7\u4E09\u500B\u5F15\u6578\uFF01"},
-
- { ER_UNPARSEDENTITYURI_TAKES_1_ARG,
- "unparsed-entity-uri \u51FD\u6578\u61C9\u63A5\u53D7\u4E00\u500B\u5F15\u6578\uFF01"},
-
- { ER_NAMESPACEAXIS_NOT_IMPLEMENTED,
- "\u5C1A\u672A\u5BE6\u884C\u547D\u540D\u7A7A\u9593\u8EF8\uFF01"},
-
- { ER_UNKNOWN_AXIS,
- "\u4E0D\u660E\u7684\u8EF8: {0}"},
-
- { ER_UNKNOWN_MATCH_OPERATION,
- "\u4E0D\u660E\u7684\u914D\u5C0D\u4F5C\u696D\uFF01"},
-
- { ER_INCORRECT_ARG_LENGTH,
- "processing-instruction() \u7BC0\u9EDE\u7684\u5F15\u6578\u9577\u5EA6\u4E0D\u6B63\u78BA\uFF01"},
-
- { ER_CANT_CONVERT_TO_NUMBER,
- "\u7121\u6CD5\u8F49\u63DB {0} \u70BA\u6578\u5B57"},
-
- { ER_CANT_CONVERT_TO_NODELIST,
- "\u7121\u6CD5\u8F49\u63DB {0} \u70BA NodeList\uFF01"},
-
- { ER_CANT_CONVERT_TO_MUTABLENODELIST,
- "\u7121\u6CD5\u8F49\u63DB {0} \u70BA NodeSetDTM\uFF01"},
-
- { ER_CANT_CONVERT_TO_TYPE,
- "\u7121\u6CD5\u8F49\u63DB {0} \u70BA type#{1}"},
-
- { ER_EXPECTED_MATCH_PATTERN,
- "\u5728 getMatchScore \u4E2D\u9810\u671F\u914D\u5C0D\u6A23\u5F0F"},
-
- { ER_COULDNOT_GET_VAR_NAMED,
- "\u7121\u6CD5\u53D6\u5F97\u540D\u7A31\u70BA {0} \u7684\u8B8A\u6578"},
-
- { ER_UNKNOWN_OPCODE,
- "\u932F\u8AA4\uFF01\u4E0D\u660E\u7684\u4F5C\u696D\u4EE3\u78BC: {0}"},
-
- { ER_EXTRA_ILLEGAL_TOKENS,
- "\u984D\u5916\u7684\u7121\u6548\u8A18\u865F: {0}"},
-
- { ER_EXPECTED_DOUBLE_QUOTE,
- "\u5F15\u865F\u932F\u8AA4\u7684\u6587\u5B57... \u9810\u671F\u96D9\u5F15\u865F\uFF01"},
-
- { ER_EXPECTED_SINGLE_QUOTE,
- "\u5F15\u865F\u932F\u8AA4\u7684\u6587\u5B57... \u9810\u671F\u55AE\u5F15\u865F\uFF01"},
-
- { ER_EMPTY_EXPRESSION,
- "\u7A7A\u767D\u8868\u793A\u5F0F\uFF01"},
-
- { ER_EXPECTED_BUT_FOUND,
- "\u9810\u671F {0}\uFF0C\u4F46\u627E\u5230: {1}"},
-
- { ER_INCORRECT_PROGRAMMER_ASSERTION,
- "\u7A0B\u5F0F\u8A2D\u8A08\u4EBA\u54E1\u5BA3\u544A\u4E0D\u6B63\u78BA\uFF01- {0}"},
-
- { ER_BOOLEAN_ARG_NO_LONGER_OPTIONAL,
- "\u6839\u64DA 19990709 XPath \u8349\u6848\uFF0Cboolean(...) \u4E0D\u518D\u662F\u9078\u64C7\u6027\u5F15\u6578\u3002"},
-
- { ER_FOUND_COMMA_BUT_NO_PRECEDING_ARG,
- "\u627E\u5230 ',' \u4F46\u6C92\u6709\u5148\u524D\u7684\u5F15\u6578\uFF01"},
-
- { ER_FOUND_COMMA_BUT_NO_FOLLOWING_ARG,
- "\u627E\u5230 ',' \u4F46\u6C92\u6709\u5F8C\u7E8C\u7684\u5F15\u6578\uFF01"},
-
- { ER_PREDICATE_ILLEGAL_SYNTAX,
- "'..[predicate]' \u6216 '.[predicate]' \u662F\u7121\u6548\u7684\u8A9E\u6CD5\u3002\u8ACB\u6539\u7528 'self::node()[predicate]'\u3002"},
-
- { ER_ILLEGAL_AXIS_NAME,
- "\u7121\u6548\u7684\u8EF8\u540D\u7A31: {0}"},
-
- { ER_UNKNOWN_NODETYPE,
- "\u4E0D\u660E\u7684 nodetype: {0}"},
-
- { ER_PATTERN_LITERAL_NEEDS_BE_QUOTED,
- "\u6A23\u5F0F\u6587\u5B57 ({0}) \u9700\u8981\u52A0\u4E0A\u5F15\u865F\uFF01"},
-
- { ER_COULDNOT_BE_FORMATTED_TO_NUMBER,
- "{0} \u7121\u6CD5\u683C\u5F0F\u5316\u70BA\u6578\u5B57\uFF01"},
-
- { ER_COULDNOT_CREATE_XMLPROCESSORLIAISON,
- "\u7121\u6CD5\u5EFA\u7ACB XML TransformerFactory Liaison: {0}"},
-
- { ER_DIDNOT_FIND_XPATH_SELECT_EXP,
- "\u932F\u8AA4\uFF01\u627E\u4E0D\u5230 xpath \u9078\u53D6\u8868\u793A\u5F0F (-select)\u3002"},
-
- { ER_COULDNOT_FIND_ENDOP_AFTER_OPLOCATIONPATH,
- "\u932F\u8AA4\uFF01\u5728 OP_LOCATIONPATH \u4E4B\u5F8C\u627E\u4E0D\u5230 ENDOP"},
-
- { ER_ERROR_OCCURED,
- "\u767C\u751F\u932F\u8AA4\uFF01"},
-
- { ER_ILLEGAL_VARIABLE_REFERENCE,
- "\u70BA\u8B8A\u6578\u6307\u5B9A\u7684 VariableReference \u8D85\u51FA\u76F8\u95DC\u8CC7\u8A0A\u74B0\u5883\u6216\u6C92\u6709\u5B9A\u7FA9\uFF01\u540D\u7A31 = {0}"},
-
- { ER_AXES_NOT_ALLOWED,
- "\u914D\u5C0D\u6A23\u5F0F\u4E2D\u50C5\u5141\u8A31 child:: \u8207 attribute:: \u8EF8\uFF01\u9055\u53CD\u7684\u8EF8 = {0}"},
-
- { ER_KEY_HAS_TOO_MANY_ARGS,
- "key() \u5177\u6709\u4E0D\u6B63\u78BA\u7684\u5F15\u6578\u6578\u76EE\u3002"},
-
- { ER_COUNT_TAKES_1_ARG,
- "count \u51FD\u6578\u61C9\u63A5\u53D7\u4E00\u500B\u5F15\u6578\uFF01"},
-
- { ER_COULDNOT_FIND_FUNCTION,
- "\u627E\u4E0D\u5230\u51FD\u6578: {0}"},
-
- { ER_UNSUPPORTED_ENCODING,
- "\u4E0D\u652F\u63F4\u7684\u7DE8\u78BC: {0}"},
-
- { ER_PROBLEM_IN_DTM_NEXTSIBLING,
- "\u5728 getNextSibling \u7684 DTM \u4E2D\u767C\u751F\u554F\u984C... \u6B63\u5728\u5617\u8A66\u5FA9\u539F"},
-
- { ER_CANNOT_WRITE_TO_EMPTYNODELISTIMPL,
- "\u7A0B\u5F0F\u8A2D\u8A08\u4EBA\u54E1\u932F\u8AA4: \u7121\u6CD5\u5BEB\u5165 EmptyNodeList\u3002"},
-
- { ER_SETDOMFACTORY_NOT_SUPPORTED,
- "XPathContext \u4E0D\u652F\u63F4 setDOMFactory\uFF01"},
-
- { ER_PREFIX_MUST_RESOLVE,
- "\u524D\u7F6E\u78BC\u5FC5\u9808\u89E3\u6790\u70BA\u547D\u540D\u7A7A\u9593: {0}"},
-
- { ER_PARSE_NOT_SUPPORTED,
- "XPathContext \u4E2D\u4E0D\u652F\u63F4 parse (InputSource \u4F86\u6E90)\u3002\u7121\u6CD5\u958B\u555F {0}"},
-
- { ER_SAX_API_NOT_HANDLED,
- "SAX API characters(char ch[]... \u4E26\u975E\u7531 DTM \u8655\u7406\uFF01"},
-
- { ER_IGNORABLE_WHITESPACE_NOT_HANDLED,
- "ignorableWhitespace(char ch[]... \u4E26\u975E\u7531 DTM \u8655\u7406\uFF01"},
-
- { ER_DTM_CANNOT_HANDLE_NODES,
- "DTMLiaison \u7121\u6CD5\u8655\u7406\u985E\u578B {0} \u7684\u63A7\u5236\u4EE3\u78BC\u7BC0\u9EDE"},
-
- { ER_XERCES_CANNOT_HANDLE_NODES,
- "DOM2Helper \u7121\u6CD5\u8655\u7406\u985E\u578B {0} \u7684\u63A7\u5236\u4EE3\u78BC\u7BC0\u9EDE"},
-
- { ER_XERCES_PARSE_ERROR_DETAILS,
- "DOM2Helper.parse \u932F\u8AA4: SystemID - {0} \u884C - {1}"},
-
- { ER_XERCES_PARSE_ERROR,
- "DOM2Helper.parse \u932F\u8AA4"},
-
- { ER_INVALID_UTF16_SURROGATE,
- "\u5075\u6E2C\u5230\u7121\u6548\u7684 UTF-16 \u4EE3\u7406: {0}\uFF1F"},
-
- { ER_OIERROR,
- "IO \u932F\u8AA4"},
-
- { ER_CANNOT_CREATE_URL,
- "\u7121\u6CD5\u70BA {0} \u5EFA\u7ACB url"},
-
- { ER_XPATH_READOBJECT,
- "\u5728 XPath.readObject \u4E2D: {0}"},
-
- { ER_FUNCTION_TOKEN_NOT_FOUND,
- "\u627E\u4E0D\u5230\u51FD\u6578\u8A18\u865F\u3002"},
-
- { ER_CANNOT_DEAL_XPATH_TYPE,
- "\u7121\u6CD5\u8655\u7406 XPath \u985E\u578B: {0}"},
-
- { ER_NODESET_NOT_MUTABLE,
- "\u6B64 NodeSet \u4E0D\u53EF\u8B8A\u66F4"},
-
- { ER_NODESETDTM_NOT_MUTABLE,
- "\u6B64 NodeSetDTM \u4E0D\u53EF\u8B8A\u66F4"},
-
- { ER_VAR_NOT_RESOLVABLE,
- "\u8B8A\u6578\u7121\u6CD5\u89E3\u6790: {0}"},
-
- { ER_NULL_ERROR_HANDLER,
- "\u7A7A\u503C\u932F\u8AA4\u8655\u7406\u7A0B\u5F0F"},
-
- { ER_PROG_ASSERT_UNKNOWN_OPCODE,
- "\u7A0B\u5F0F\u8A2D\u8A08\u4EBA\u54E1\u5BA3\u544A: \u4E0D\u660E\u7684 opcode: {0}"},
-
- { ER_ZERO_OR_ONE,
- "0 \u6216 1"},
-
- { ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "XRTreeFragSelectWrapper \u4E0D\u652F\u63F4 rtf()"},
-
- { ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "XRTreeFragSelectWrapper \u4E0D\u652F\u63F4 asNodeIterator()"},
-
- /** detach() not supported by XRTreeFragSelectWrapper */
- { ER_DETACH_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "XRTreeFragSelectWrapper \u4E0D\u652F\u63F4 detach()"},
-
- /** num() not supported by XRTreeFragSelectWrapper */
- { ER_NUM_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "XRTreeFragSelectWrapper \u4E0D\u652F\u63F4 num()"},
-
- /** xstr() not supported by XRTreeFragSelectWrapper */
- { ER_XSTR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "XRTreeFragSelectWrapper \u4E0D\u652F\u63F4 xstr()"},
-
- /** str() not supported by XRTreeFragSelectWrapper */
- { ER_STR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER,
- "XRTreeFragSelectWrapper \u4E0D\u652F\u63F4 str()"},
-
- { ER_FSB_NOT_SUPPORTED_XSTRINGFORCHARS,
- "XStringForChars \u4E0D\u652F\u63F4 fsb()"},
-
- { ER_COULD_NOT_FIND_VAR,
- "\u627E\u4E0D\u5230\u540D\u7A31\u70BA {0} \u7684\u8B8A\u6578"},
-
- { ER_XSTRINGFORCHARS_CANNOT_TAKE_STRING,
- "XStringForChars \u7121\u6CD5\u63A5\u53D7\u5B57\u4E32\u4F5C\u70BA\u5F15\u6578"},
-
- { ER_FASTSTRINGBUFFER_CANNOT_BE_NULL,
- "FastStringBuffer \u5F15\u6578\u4E0D\u53EF\u70BA\u7A7A\u503C"},
-
- { ER_TWO_OR_THREE,
- "2 \u6216 3"},
-
- { ER_VARIABLE_ACCESSED_BEFORE_BIND,
- "\u8B8A\u6578\u9023\u7D50\u4E4B\u524D\u4FBF\u9032\u884C\u5B58\u53D6\uFF01"},
-
- { ER_FSB_CANNOT_TAKE_STRING,
- "XStringForFSB \u7121\u6CD5\u63A5\u53D7\u5B57\u4E32\u4F5C\u70BA\u5F15\u6578\uFF01"},
-
- { ER_SETTING_WALKER_ROOT_TO_NULL,
- "\n \u932F\u8AA4\uFF01\u5C07\u8490\u96C6\u7A0B\u5F0F\u7684\u6839\u8A2D\u5B9A\u70BA\u7A7A\u503C\uFF01"},
-
- { ER_NODESETDTM_CANNOT_ITERATE,
- "\u6B64 NodeSetDTM \u7121\u6CD5\u91CD\u8907\u5148\u524D\u7684\u7BC0\u9EDE\uFF01"},
-
- { ER_NODESET_CANNOT_ITERATE,
- "\u6B64 NodeSet \u7121\u6CD5\u91CD\u8907\u5148\u524D\u7684\u7BC0\u9EDE\uFF01"},
-
- { ER_NODESETDTM_CANNOT_INDEX,
- "\u6B64 NodeSetDTM \u7121\u6CD5\u57F7\u884C\u88FD\u4F5C\u7D22\u5F15\u6216\u8A08\u6578\u529F\u80FD\uFF01"},
-
- { ER_NODESET_CANNOT_INDEX,
- "\u6B64 NodeSet \u7121\u6CD5\u57F7\u884C\u88FD\u4F5C\u7D22\u5F15\u6216\u8A08\u6578\u529F\u80FD\uFF01"},
-
- { ER_CANNOT_CALL_SETSHOULDCACHENODE,
- "\u547C\u53EB nextNode \u4E4B\u5F8C\uFF0C\u7121\u6CD5\u547C\u53EB setShouldCacheNodes\uFF01"},
-
- { ER_ONLY_ALLOWS,
- "{0} \u50C5\u5141\u8A31 {1} \u500B\u5F15\u6578"},
-
- { ER_UNKNOWN_STEP,
- "\u5728 getNextStepPos \u4E2D\u7A0B\u5F0F\u8A2D\u8A08\u4EBA\u54E1\u7684\u5BA3\u544A: \u4E0D\u660E\u7684 stepType: {0}"},
-
- //Note to translators: A relative location path is a form of XPath expression.
- // The message indicates that such an expression was expected following the
- // characters '/' or '//', but was not found.
- { ER_EXPECTED_REL_LOC_PATH,
- "'/' \u6216 '//' \u8A18\u865F\u4E4B\u5F8C\uFF0C\u9810\u671F\u76F8\u5C0D\u4F4D\u7F6E\u8DEF\u5F91\u3002"},
-
- // Note to translators: A location path is a form of XPath expression.
- // The message indicates that syntactically such an expression was expected,but
- // the characters specified by the substitution text were encountered instead.
- { ER_EXPECTED_LOC_PATH,
- "\u9810\u671F\u4F4D\u7F6E\u8DEF\u5F91\uFF0C\u4F46\u51FA\u73FE\u4E0B\u5217\u8A18\u865F: {0}"},
-
- // Note to translators: A location path is a form of XPath expression.
- // The message indicates that syntactically such a subexpression was expected,
- // but no more characters were found in the expression.
- { ER_EXPECTED_LOC_PATH_AT_END_EXPR,
- "\u9810\u671F\u4F4D\u7F6E\u8DEF\u5F91\uFF0C\u4F46\u51FA\u73FE XPath \u8868\u793A\u5F0F\u7684\u7D50\u5C3E\u3002"},
-
- // Note to translators: A location step is part of an XPath expression.
- // The message indicates that syntactically such an expression was expected
- // following the specified characters.
- { ER_EXPECTED_LOC_STEP,
- "'/' \u6216 '//' \u8A18\u865F\u4E4B\u5F8C\uFF0C\u9810\u671F\u4F4D\u7F6E\u6B65\u9A5F\u3002"},
-
- // Note to translators: A node test is part of an XPath expression that is
- // used to test for particular kinds of nodes. In this case, a node test that
- // consists of an NCName followed by a colon and an asterisk or that consists
- // of a QName was expected, but was not found.
- { ER_EXPECTED_NODE_TEST,
- "\u9810\u671F\u7B26\u5408 NCName:* \u6216 QName \u7684\u7BC0\u9EDE\u6E2C\u8A66\u3002"},
-
- // Note to translators: A step pattern is part of an XPath expression.
- // The message indicates that syntactically such an expression was expected,
- // but the specified character was found in the expression instead.
- { ER_EXPECTED_STEP_PATTERN,
- "\u9810\u671F\u6B65\u9A5F\u6A23\u5F0F\uFF0C\u4F46\u51FA\u73FE '/'\u3002"},
-
- // Note to translators: A relative path pattern is part of an XPath expression.
- // The message indicates that syntactically such an expression was expected,
- // but was not found.
- { ER_EXPECTED_REL_PATH_PATTERN,
- "\u9810\u671F\u76F8\u5C0D\u8DEF\u5F91\u6A23\u5F0F\u3002"},
-
- // Note to translators: The substitution text is the name of a data type. The
- // message indicates that a value of a particular type could not be converted
- // to a value of type boolean.
- { ER_CANT_CONVERT_TO_BOOLEAN,
- "XPath \u8868\u793A\u5F0F ''{0}'' \u7684 XPathResult \u5177\u6709 XPathResultType \u7684 {1}\uFF0C\u5B83\u7121\u6CD5\u8F49\u63DB\u70BA\u5E03\u6797\u503C\u3002"},
-
- // Note to translators: Do not translate ANY_UNORDERED_NODE_TYPE and
- // FIRST_ORDERED_NODE_TYPE.
- { ER_CANT_CONVERT_TO_SINGLENODE,
- "XPath \u8868\u793A\u5F0F ''{0}'' \u7684 XPathResult \u5177\u6709 XPathResultType \u7684 {1}\uFF0C\u5B83\u7121\u6CD5\u8F49\u63DB\u70BA\u55AE\u4E00\u7BC0\u9EDE\u3002\u65B9\u6CD5 getSingleNodeValue \u50C5\u9069\u7528\u65BC\u985E\u578B ANY_UNORDERED_NODE_TYPE \u8207 FIRST_ORDERED_NODE_TYPE\u3002"},
-
- // Note to translators: Do not translate UNORDERED_NODE_SNAPSHOT_TYPE and
- // ORDERED_NODE_SNAPSHOT_TYPE.
- { ER_CANT_GET_SNAPSHOT_LENGTH,
- "\u7121\u6CD5\u5728 XPath \u8868\u793A\u5F0F ''{0}'' \u7684 XPathResult \u4E0A\u547C\u53EB\u65B9\u6CD5 getSnapshotLength\uFF0C\u56E0\u70BA\u5B83\u7684 XPathResultType \u662F {1}\u3002\u6B64\u65B9\u6CD5\u50C5\u9069\u7528\u65BC\u985E\u578B UNORDERED_NODE_SNAPSHOT_TYPE \u8207 ORDERED_NODE_SNAPSHOT_TYPE\u3002"},
-
- { ER_NON_ITERATOR_TYPE,
- "\u7121\u6CD5\u5728 XPath \u8868\u793A\u5F0F ''{0}'' \u7684 XPathResult \u4E0A\u547C\u53EB\u65B9\u6CD5 iterateNext\uFF0C\u56E0\u70BA\u5B83\u7684 XPathResultType \u662F {1}\u3002\u6B64\u65B9\u6CD5\u50C5\u9069\u7528\u65BC\u985E\u578B UNORDERED_NODE_ITERATOR_TYPE \u8207 ORDERED_NODE_ITERATOR_TYPE\u3002"},
-
- // Note to translators: This message indicates that the document being operated
- // upon changed, so the iterator object that was being used to traverse the
- // document has now become invalid.
- { ER_DOC_MUTATED,
- "\u7D50\u679C\u50B3\u56DE\u5F8C\u6587\u4EF6\u5DF2\u8B8A\u66F4\u3002\u91CD\u8907\u7A0B\u5F0F\u7121\u6548\u3002"},
-
- { ER_INVALID_XPATH_TYPE,
- "\u7121\u6548\u7684 XPath \u985E\u578B\u5F15\u6578: {0}"},
-
- { ER_EMPTY_XPATH_RESULT,
- "\u7A7A\u767D\u7684 XPath \u7D50\u679C\u7269\u4EF6"},
-
- { ER_INCOMPATIBLE_TYPES,
- "XPath \u8868\u793A\u5F0F ''{0}'' \u7684 XPathResult \u5177\u6709 XPathResultType \u7684 {1}\uFF0C\u5B83\u7121\u6CD5\u5F37\u5236\u8F49\u6210 {2} \u6307\u5B9A\u7684 XPathResultType\u3002"},
-
- { ER_NULL_RESOLVER,
- "\u7121\u6CD5\u4EE5\u7A7A\u503C\u524D\u7F6E\u78BC\u89E3\u6790\u5668\u4F86\u89E3\u6790\u524D\u7F6E\u78BC\u3002"},
-
- // Note to translators: The substitution text is the name of a data type. The
- // message indicates that a value of a particular type could not be converted
- // to a value of type string.
- { ER_CANT_CONVERT_TO_STRING,
- "XPath \u8868\u793A\u5F0F ''{0}'' \u7684 XPathResult \u5177\u6709 XPathResultType \u7684 {1}\uFF0C\u5B83\u7121\u6CD5\u8F49\u63DB\u70BA\u5B57\u4E32\u3002"},
-
- // Note to translators: Do not translate snapshotItem,
- // UNORDERED_NODE_SNAPSHOT_TYPE and ORDERED_NODE_SNAPSHOT_TYPE.
- { ER_NON_SNAPSHOT_TYPE,
- "\u7121\u6CD5\u5728 XPath \u8868\u793A\u5F0F ''{0}'' \u7684 XPathResult \u4E0A\u547C\u53EB\u65B9\u6CD5 snapshotItem\uFF0C\u56E0\u70BA\u5B83\u7684 XPathResultType \u662F {1}\u3002\u6B64\u65B9\u6CD5\u50C5\u9069\u7528\u65BC\u985E\u578B UNORDERED_NODE_SNAPSHOT_TYPE \u8207 ORDERED_NODE_SNAPSHOT_TYPE\u3002"},
-
- // Note to translators: XPathEvaluator is a Java interface name. An
- // XPathEvaluator is created with respect to a particular XML document, and in
- // this case the expression represented by this object was being evaluated with
- // respect to a context node from a different document.
- { ER_WRONG_DOCUMENT,
- "\u76F8\u95DC\u8CC7\u8A0A\u74B0\u5883\u7BC0\u9EDE\u4E0D\u5C6C\u65BC\u9023\u7D50\u81F3\u6B64 XPathEvaluator \u7684\u6587\u4EF6\u3002"},
-
- // Note to translators: The XPath expression cannot be evaluated with respect
- // to this type of node.
- { ER_WRONG_NODETYPE,
- "\u4E0D\u652F\u63F4\u76F8\u95DC\u8CC7\u8A0A\u74B0\u5883\u7BC0\u9EDE\u985E\u578B\u3002"},
-
- { ER_XPATH_ERROR,
- "XPath \u767C\u751F\u4E0D\u660E\u7684\u932F\u8AA4\u3002"},
-
- { ER_CANT_CONVERT_XPATHRESULTTYPE_TO_NUMBER,
- "XPath \u8868\u793A\u5F0F ''{0}'' \u7684 XPathResult \u5177\u6709 XPathResultType \u7684 {1}\uFF0C\u5B83\u7121\u6CD5\u8F49\u63DB\u70BA\u6578\u5B57\u3002"},
-
- //BEGIN: Definitions of error keys used in exception messages of JAXP 1.3 XPath API implementation
-
- /** Field ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED */
-
- { ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED,
- "\u7576 XMLConstants.FEATURE_SECURE_PROCESSING \u529F\u80FD\u8A2D\u70BA\u771F\u6642\uFF0C\u7121\u6CD5\u547C\u53EB\u64F4\u5145\u51FD\u6578: ''{0}''\u3002"},
-
- /** Field ER_RESOLVE_VARIABLE_RETURNS_NULL */
-
- { ER_RESOLVE_VARIABLE_RETURNS_NULL,
- "\u8B8A\u6578 {0} \u7684 resolveVariable \u50B3\u56DE\u7A7A\u503C"},
-
- /** Field ER_UNSUPPORTED_RETURN_TYPE */
-
- { ER_UNSUPPORTED_RETURN_TYPE,
- "\u4E0D\u652F\u63F4\u7684\u50B3\u56DE\u985E\u578B: {0}"},
-
- /** Field ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL */
-
- { ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL,
- "\u4F86\u6E90\u548C (\u6216) \u50B3\u56DE\u985E\u578B\u4E0D\u53EF\u70BA\u7A7A\u503C"},
-
- /** Field ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL */
-
- { ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL,
- "\u4F86\u6E90\u548C (\u6216) \u50B3\u56DE\u985E\u578B\u4E0D\u53EF\u70BA\u7A7A\u503C"},
-
- /** Field ER_ARG_CANNOT_BE_NULL */
-
- { ER_ARG_CANNOT_BE_NULL,
- "{0} \u5F15\u6578\u4E0D\u53EF\u70BA\u7A7A\u503C"},
-
- /** Field ER_OBJECT_MODEL_NULL */
-
- { ER_OBJECT_MODEL_NULL,
- "{0}#isObjectModelSupported( String objectModel ) \u7121\u6CD5\u4F7F\u7528 objectModel == null \u4F86\u547C\u53EB"},
-
- /** Field ER_OBJECT_MODEL_EMPTY */
-
- { ER_OBJECT_MODEL_EMPTY,
- "{0}#isObjectModelSupported( String objectModel ) \u7121\u6CD5\u4F7F\u7528 objectModel == \"\" \u4F86\u547C\u53EB"},
-
- /** Field ER_OBJECT_MODEL_EMPTY */
-
- { ER_FEATURE_NAME_NULL,
- "\u5617\u8A66\u4EE5\u7A7A\u503C\u540D\u7A31\u8A2D\u5B9A\u529F\u80FD: {0}#setFeature( null, {1})"},
-
- /** Field ER_FEATURE_UNKNOWN */
-
- { ER_FEATURE_UNKNOWN,
- "\u5617\u8A66\u8A2D\u5B9A\u4E0D\u660E\u7684\u529F\u80FD \"{0}\":{1}#setFeature({0},{2})"},
-
- /** Field ER_GETTING_NULL_FEATURE */
-
- { ER_GETTING_NULL_FEATURE,
- "\u5617\u8A66\u4EE5\u7A7A\u503C\u540D\u7A31\u53D6\u5F97\u529F\u80FD: {0}#getFeature(null)"},
-
- /** Field ER_GETTING_NULL_FEATURE */
-
- { ER_GETTING_UNKNOWN_FEATURE,
- "\u5617\u8A66\u53D6\u5F97\u4E0D\u660E\u7684\u529F\u80FD \"{0}\":{1}#getFeature({0})"},
-
- {ER_SECUREPROCESSING_FEATURE,
- "FEATURE_SECURE_PROCESSING: \u5B89\u5168\u7BA1\u7406\u7A0B\u5F0F\u5B58\u5728\u6642\uFF0C\u7121\u6CD5\u5C07\u529F\u80FD\u8A2D\u70BA\u507D: {1}#setFeature({0},{2})"},
-
- /** Field ER_NULL_XPATH_FUNCTION_RESOLVER */
-
- { ER_NULL_XPATH_FUNCTION_RESOLVER,
- "\u5617\u8A66\u8A2D\u5B9A\u7A7A\u503C XPathFunctionResolver:{0}#setXPathFunctionResolver(null)"},
-
- /** Field ER_NULL_XPATH_VARIABLE_RESOLVER */
-
- { ER_NULL_XPATH_VARIABLE_RESOLVER,
- "\u5617\u8A66\u8A2D\u5B9A\u7A7A\u503C XPathVariableResolver:{0}#setXPathVariableResolver(null)"},
-
- //END: Definitions of error keys used in exception messages of JAXP 1.3 XPath API implementation
-
- // Warnings...
-
- { WG_LOCALE_NAME_NOT_HANDLED,
- "\u5C1A\u672A\u8655\u7406 format-number \u51FD\u6578\u4E2D\u7684\u5730\u5340\u8A2D\u5B9A\u540D\u7A31\uFF01"},
-
- { WG_PROPERTY_NOT_SUPPORTED,
- "\u4E0D\u652F\u63F4 XSL \u5C6C\u6027: {0}"},
-
- { WG_DONT_DO_ANYTHING_WITH_NS,
- "\u76EE\u524D\u4E0D\u6703\u8655\u7406\u5C6C\u6027\u4E2D\u7684\u547D\u540D\u7A7A\u9593 {0}: {1}"},
-
- { WG_SECURITY_EXCEPTION,
- "\u5617\u8A66\u5B58\u53D6 XSL \u7CFB\u7D71\u5C6C\u6027\u6642\u767C\u751F SecurityException: {0}"},
-
- { WG_QUO_NO_LONGER_DEFINED,
- "\u820A\u8A9E\u6CD5: XPath \u4E2D\u4E0D\u518D\u5B9A\u7FA9 quo(...)\u3002"},
-
- { WG_NEED_DERIVED_OBJECT_TO_IMPLEMENT_NODETEST,
- "XPath \u9700\u8981\u884D\u751F\u7684\u7269\u4EF6\u4F86\u5BE6\u884C nodeTest\uFF01"},
-
- { WG_FUNCTION_TOKEN_NOT_FOUND,
- "\u627E\u4E0D\u5230\u51FD\u6578\u8A18\u865F\u3002"},
-
- { WG_COULDNOT_FIND_FUNCTION,
- "\u627E\u4E0D\u5230\u51FD\u6578: {0}"},
-
- { WG_CANNOT_MAKE_URL_FROM,
- "\u7121\u6CD5\u5F9E {0} \u5EFA\u7ACB URL"},
-
- { WG_EXPAND_ENTITIES_NOT_SUPPORTED,
- "DTM \u5256\u6790\u5668\u4E0D\u652F\u63F4 -E \u9078\u9805"},
-
- { WG_ILLEGAL_VARIABLE_REFERENCE,
- "\u70BA\u8B8A\u6578\u6307\u5B9A\u7684 VariableReference \u8D85\u51FA\u76F8\u95DC\u8CC7\u8A0A\u74B0\u5883\u6216\u6C92\u6709\u5B9A\u7FA9\uFF01\u540D\u7A31 = {0}"},
-
- { WG_UNSUPPORTED_ENCODING,
- "\u4E0D\u652F\u63F4\u7684\u7DE8\u78BC: {0}"},
-
-
-
- // Other miscellaneous text used inside the code...
- { "ui_language", "tw"},
- { "help_language", "tw"},
- { "language", "tw"},
- { "BAD_CODE", "createMessage \u7684\u53C3\u6578\u8D85\u51FA\u7BC4\u570D"},
- { "FORMAT_FAILED", "messageFormat \u547C\u53EB\u671F\u9593\u767C\u751F\u7570\u5E38\u72C0\u6CC1"},
- { "version", ">>>>>>> Xalan \u7248\u672C "},
- { "version2", "<<<<<<<"},
- { "yes", "\u662F"},
- { "line", "\u884C\u865F"},
- { "column", "\u8CC7\u6599\u6B04\u7DE8\u865F"},
- { "xsldone", "XSLProcessor: \u5B8C\u6210"},
- { "xpath_option", "xpath \u9078\u9805: "},
- { "optionIN", " [-in inputXMLURL]"},
- { "optionSelect", " [-select xpath \u8868\u793A\u5F0F]"},
- { "optionMatch", " [-match \u914D\u5C0D\u6A23\u5F0F (\u91DD\u5C0D\u914D\u5C0D\u8A3A\u65B7)]"},
- { "optionAnyExpr", "\u6216\u8005\uFF0C\u53EA\u6709 xpath \u8868\u793A\u5F0F\u6642\u5C07\u9032\u884C\u8A3A\u65B7\u50BE\u5370"},
- { "noParsermsg1", "XSL \u8655\u7406\u4F5C\u696D\u5931\u6557\u3002"},
- { "noParsermsg2", "** \u627E\u4E0D\u5230\u5256\u6790\u5668 **"},
- { "noParsermsg3", "\u8ACB\u6AA2\u67E5\u985E\u5225\u8DEF\u5F91\u3002"},
- { "noParsermsg4", "\u82E5\u7121 IBM \u7684 XML Parser for Java\uFF0C\u53EF\u4E0B\u8F09\u81EA"},
- { "noParsermsg5", "IBM \u7684 AlphaWorks: http://www.alphaworks.ibm.com/formula/xml"},
- { "gtone", ">1" },
- { "zero", "0" },
- { "one", "1" },
- { "two" , "2" },
- { "three", "3" }
-
- };
-
- /**
- * Get the association list.
- *
- * @return The association list.
- */
- public Object[][] getContents()
- {
- return _contents;
- }
-
-
- // ================= INFRASTRUCTURE ======================
-
- /** Field BAD_CODE */
- public static final String BAD_CODE = "BAD_CODE";
-
- /** Field FORMAT_FAILED */
- public static final String FORMAT_FAILED = "FORMAT_FAILED";
-
- /** Field ERROR_RESOURCES */
- public static final String ERROR_RESOURCES =
- "com.sun.org.apache.xpath.internal.res.XPATHErrorResources";
-
- /** Field ERROR_STRING */
- public static final String ERROR_STRING = "#error";
-
- /** Field ERROR_HEADER */
- public static final String ERROR_HEADER = "Error: ";
-
- /** Field WARNING_HEADER */
- public static final String WARNING_HEADER = "Warning: ";
-
- /** Field XSL_HEADER */
- public static final String XSL_HEADER = "XSL ";
-
- /** Field XML_HEADER */
- public static final String XML_HEADER = "XML ";
-
- /** Field QUERY_HEADER */
- public static final String QUERY_HEADER = "PATTERN ";
-
-}
diff --git a/src/com/sun/org/apache/xpath/internal/res/XPATHMessages.java b/src/com/sun/org/apache/xpath/internal/res/XPATHMessages.java
deleted file mode 100644
index 1d0fe6f..0000000
--- a/src/com/sun/org/apache/xpath/internal/res/XPATHMessages.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XPATHMessages.java,v 1.2.4.1 2005/09/01 14:57:34 pvedula Exp $
- */
-package com.sun.org.apache.xpath.internal.res;
-
-import com.sun.org.apache.bcel.internal.util.SecuritySupport;
-import com.sun.org.apache.xml.internal.res.XMLMessages;
-import java.util.ListResourceBundle;
-
-/**
- * A utility class for issuing XPath error messages.
- *
- * @xsl.usage internal
- */
-public class XPATHMessages extends XMLMessages {
-
- /**
- * The language specific resource object for XPath messages.
- */
- private static ListResourceBundle XPATHBundle = null;
- /**
- * The class name of the XPath error message string table.
- */
- private static final String XPATH_ERROR_RESOURCES =
- "com.sun.org.apache.xpath.internal.res.XPATHErrorResources";
-
- /**
- * Creates a message from the specified key and replacement arguments,
- * localized to the given locale.
- *
- * @param msgKey The key for the message text.
- * @param args The arguments to be used as replacement text in the message
- * created.
- *
- * @return The formatted message string.
- */
- public static final String createXPATHMessage(String msgKey, Object args[]) //throws Exception
- {
- if (XPATHBundle == null) {
- XPATHBundle = SecuritySupport.getResourceBundle(XPATH_ERROR_RESOURCES);
- }
-
- if (XPATHBundle != null) {
- return createXPATHMsg(XPATHBundle, msgKey, args);
- } else {
- return "Could not load any resource bundles.";
- }
- }
-
- /**
- * Creates a message from the specified key and replacement arguments,
- * localized to the given locale.
- *
- * @param msgKey The key for the message text.
- * @param args The arguments to be used as replacement text in the message
- * created.
- *
- * @return The formatted warning string.
- */
- public static final String createXPATHWarning(String msgKey, Object args[]) //throws Exception
- {
- if (XPATHBundle == null) {
- XPATHBundle = SecuritySupport.getResourceBundle(XPATH_ERROR_RESOURCES);
- }
-
- if (XPATHBundle != null) {
- return createXPATHMsg(XPATHBundle, msgKey, args);
- } else {
- return "Could not load any resource bundles.";
- }
- }
-
- /**
- * Creates a message from the specified key and replacement arguments,
- * localized to the given locale.
- *
- * @param fResourceBundle The resource bundle to use.
- * @param msgKey The message key to use.
- * @param args The arguments to be used as replacement text in the message
- * created.
- *
- * @return The formatted message string.
- */
- public static final String createXPATHMsg(ListResourceBundle fResourceBundle,
- String msgKey, Object args[]) //throws Exception
- {
-
- String fmsg = null;
- boolean throwex = false;
- String msg = null;
-
- if (msgKey != null) {
- msg = fResourceBundle.getString(msgKey);
- }
-
- if (msg == null) {
- msg = fResourceBundle.getString(XPATHErrorResources.BAD_CODE);
- throwex = true;
- }
-
- if (args != null) {
- try {
-
- // Do this to keep format from crying.
- // This is better than making a bunch of conditional
- // code all over the place.
- int n = args.length;
-
- for (int i = 0; i < n; i++) {
- if (null == args[i]) {
- args[i] = "";
- }
- }
-
- fmsg = java.text.MessageFormat.format(msg, args);
- } catch (Exception e) {
- fmsg = fResourceBundle.getString(XPATHErrorResources.FORMAT_FAILED);
- fmsg += " " + msg;
- }
- } else {
- fmsg = msg;
- }
-
- if (throwex) {
- throw new RuntimeException(fmsg);
- }
-
- return fmsg;
- }
-}
diff --git a/src/com/sun/org/apache/xpath/internal/res/package.html b/src/com/sun/org/apache/xpath/internal/res/package.html
deleted file mode 100644
index cb21905..0000000
--- a/src/com/sun/org/apache/xpath/internal/res/package.html
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-<!--
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
--->
-<!--
- * Copyright 2000-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
--->
-<!-- $Id: package.html,v 1.1.2.1 2005/08/01 01:29:51 jeffsuttor Exp $ -->
-<html>
- <title>XPath resources.</title>
- <body>
- <p>Contains strings for XPath support that require internationalization.<p>
- </body>
-</html>
-
-
diff --git a/src/com/sun/xml/internal/stream/Entity.java b/src/com/sun/xml/internal/stream/Entity.java
deleted file mode 100644
index 9c2a8ad..0000000
--- a/src/com/sun/xml/internal/stream/Entity.java
+++ /dev/null
@@ -1,475 +0,0 @@
-/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
- */
-
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.xml.internal.stream;
-
-import java.io.InputStream;
-import java.io.Reader;
-import java.io.IOException;
-
-import com.sun.xml.internal.stream.util.BufferAllocator;
-import com.sun.xml.internal.stream.util.ThreadLocalBufferAllocator;
-import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
-
-/**
- * Entity information.
- *
- * @author
- */
-public abstract class Entity {
-
- //
- // Data
- //
-
- //xxx why dont we declare the type of entities, like assign integer for external/ internal etc..
-
- /** Entity name. */
- public String name;
-
- // whether this entity's declaration was found in the internal
- // or external subset
- public boolean inExternalSubset;
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- public Entity() {
- clear();
- } // <init>()
-
- /** Constructs an entity. */
- public Entity(String name, boolean inExternalSubset) {
- this.name = name;
- this.inExternalSubset = inExternalSubset;
- } // <init>(String)
-
- //
- // Public methods
- //
-
- /** Returns true if this entity was declared in the external subset. */
- public boolean isEntityDeclInExternalSubset() {
- return inExternalSubset;
- }
-
- /** Returns true if this is an external entity. */
- public abstract boolean isExternal();
-
- /** Returns true if this is an unparsed entity. */
- public abstract boolean isUnparsed();
-
- /** Clears the entity. */
- public void clear() {
- name = null;
- inExternalSubset = false;
- } // clear()
-
- /** Sets the values of the entity. */
- public void setValues(Entity entity) {
- name = entity.name;
- inExternalSubset = entity.inExternalSubset;
- } // setValues(Entity)
-
-
- /**
- * Internal entity.
- *
- * @author nb131165
- */
- public static class InternalEntity
- extends Entity {
-
- //
- // Data
- //
-
- /** Text value of entity. */
- public String text;
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- public InternalEntity() {
- clear();
- } // <init>()
-
- /** Constructs an internal entity. */
- public InternalEntity(String name, String text, boolean inExternalSubset) {
- super(name,inExternalSubset);
- this.text = text;
- } // <init>(String,String)
-
- //
- // Entity methods
- //
-
- /** Returns true if this is an external entity. */
- public final boolean isExternal() {
- return false;
- } // isExternal():boolean
-
- /** Returns true if this is an unparsed entity. */
- public final boolean isUnparsed() {
- return false;
- } // isUnparsed():boolean
-
- /** Clears the entity. */
- public void clear() {
- super.clear();
- text = null;
- } // clear()
-
- /** Sets the values of the entity. */
- public void setValues(Entity entity) {
- super.setValues(entity);
- text = null;
- } // setValues(Entity)
-
- /** Sets the values of the entity. */
- public void setValues(InternalEntity entity) {
- super.setValues(entity);
- text = entity.text;
- } // setValues(InternalEntity)
-
- } // class InternalEntity
-
- /**
- * External entity.
- *
- * @author nb131165
- */
- public static class ExternalEntity
- extends Entity {
-
- //
- // Data
- //
-
- /** container for all relevant entity location information. */
- public XMLResourceIdentifier entityLocation;
-
- /** Notation name for unparsed entity. */
- public String notation;
-
- //
- // Constructors
- //
-
- /** Default constructor. */
- public ExternalEntity() {
- clear();
- } // <init>()
-
- /** Constructs an internal entity. */
- public ExternalEntity(String name, XMLResourceIdentifier entityLocation,
- String notation, boolean inExternalSubset) {
- super(name,inExternalSubset);
- this.entityLocation = entityLocation;
- this.notation = notation;
- } // <init>(String,XMLResourceIdentifier, String)
-
- //
- // Entity methods
- //
-
- /** Returns true if this is an external entity. */
- public final boolean isExternal() {
- return true;
- } // isExternal():boolean
-
- /** Returns true if this is an unparsed entity. */
- public final boolean isUnparsed() {
- return notation != null;
- } // isUnparsed():boolean
-
- /** Clears the entity. */
- public void clear() {
- super.clear();
- entityLocation = null;
- notation = null;
- } // clear()
-
- /** Sets the values of the entity. */
- public void setValues(Entity entity) {
- super.setValues(entity);
- entityLocation = null;
- notation = null;
- } // setValues(Entity)
-
- /** Sets the values of the entity. */
- public void setValues(ExternalEntity entity) {
- super.setValues(entity);
- entityLocation = entity.entityLocation;
- notation = entity.notation;
- } // setValues(ExternalEntity)
-
- } // class ExternalEntity
-
- /**
- * Entity state.
- *
- * @author nb131165
- */
- public static class ScannedEntity
- extends Entity {
-
-
- /** Default buffer size (4096). */
- public static final int DEFAULT_BUFFER_SIZE = 8192;
- //4096;
-
- /**
- * Buffer size. We get this value from a property. The default size
- * is used if the input buffer size property is not specified.
- * REVISIT: do we need a property for internal entity buffer size?
- */
- public int fBufferSize = DEFAULT_BUFFER_SIZE;
-
- /** Default buffer size before we've finished with the XMLDecl: */
- public static final int DEFAULT_XMLDECL_BUFFER_SIZE = 28;
-
- /** Default internal entity buffer size (1024). */
- public static final int DEFAULT_INTERNAL_BUFFER_SIZE = 1024;
-
- //
- // Data
- //
-
- // i/o
-
- /** XXX let these field remain public right now, though we have defined methods for them.
- * Input stream. */
- public InputStream stream;
-
- /** XXX let these field remain public right now, though we have defined methods for them.
- * Reader. */
- public Reader reader;
-
- // locator information
-
- /** entity location information */
- public XMLResourceIdentifier entityLocation;
-
- // encoding
-
- /** Auto-detected encoding. */
- public String encoding;
-
- // status
-
- /** True if in a literal. */
- public boolean literal;
-
- // whether this is an external or internal scanned entity
- public boolean isExternal;
-
- //each 'external' parsed entity may have xml/text declaration containing version information
- public String version ;
-
- // buffer
-
- /** Character buffer. */
- public char[] ch = null;
-
- /** Position in character buffer at any point of time. */
- public int position;
-
- /** Count of characters present in buffer. */
- public int count;
-
- /** Line number. */
- public int lineNumber = 1;
-
- /** Column number. */
- public int columnNumber = 1;
-
- /** Encoding has been set externally for eg: using DOMInput*/
- boolean declaredEncoding = false;
-
- // status
-
- /**
- * Encoding has been set externally, for example
- * using a SAX InputSource or a DOM LSInput.
- */
- boolean externallySpecifiedEncoding = false;
-
- /** XML version. **/
- public String xmlVersion = "1.0";
-
- /** This variable is used to calculate the current position in the XML stream.
- * Note that fCurrentEntity.position maintains the position relative to
- * the buffer.
- * At any point of time absolute position in the XML stream can be calculated
- * as fTotalCountTillLastLoad + fCurrentEntity.position
- */
- public int fTotalCountTillLastLoad ;
-
- /** This variable stores the number of characters read during the load()
- * operation. It is used to calculate fTotalCountTillLastLoad
- */
- public int fLastCount ;
-
- /** Base character offset for computing absolute character offset. */
- public int baseCharOffset;
-
- /** Start position in character buffer. */
- public int startPosition;
-
- // to allow the reader/inputStream to behave efficiently:
- public boolean mayReadChunks;
-
- // to know that prolog is read
- public boolean xmlDeclChunkRead = false;
-
- // flag to indicate whether the Entity is a General Entity
- public boolean isGE = false;
-
- /** returns the name of the current encoding
- * @return current encoding name
- */
- public String getEncodingName(){
- return encoding ;
- }
-
- /**each 'external' parsed entity may have xml/text declaration containing version information
- * @return String version of the enity, for an internal entity version would be null
- */
- public String getEntityVersion(){
- return version ;
- }
-
- /** each 'external' parsed entity may have xml/text declaration containing version information
- * @param String version of the external parsed entity
- */
- public void setEntityVersion(String version){
- this.version = version ;
- }
-
- /** Returns the java.io.Reader associated with this entity.Readers are used
- * to read from the file. Readers wrap any particular InputStream that was
- * used to open the entity.
- * @return java.io.Reader Reader associated with this entity
- */
- public Reader getEntityReader(){
- return reader;
- }
-
-
- /** if entity was opened using the stream, return the associated inputstream
- * with this entity
- *@return java.io.InputStream InputStream associated with this entity
- */
- public InputStream getEntityInputStream(){
- return stream;
- }
-
- //
- // Constructors
- //
-
- /** Constructs a scanned entity. */
- public ScannedEntity(boolean isGE, String name,
- XMLResourceIdentifier entityLocation,
- InputStream stream, Reader reader,
- String encoding, boolean literal, boolean mayReadChunks, boolean isExternal) {
- this.isGE = isGE;
- this.name = name ;
- this.entityLocation = entityLocation;
- this.stream = stream;
- this.reader = reader;
- this.encoding = encoding;
- this.literal = literal;
- this.mayReadChunks = mayReadChunks;
- this.isExternal = isExternal;
- final int size = isExternal ? fBufferSize : DEFAULT_INTERNAL_BUFFER_SIZE;
- BufferAllocator ba = ThreadLocalBufferAllocator.getBufferAllocator();
- ch = ba.getCharBuffer(size);
- if (ch == null) {
- this.ch = new char[size];
- }
- } // <init>(StringXMLResourceIdentifier,InputStream,Reader,String,boolean, boolean)
-
- /**
- * Release any resources associated with this entity.
- */
- public void close() throws IOException {
- BufferAllocator ba = ThreadLocalBufferAllocator.getBufferAllocator();
- ba.returnCharBuffer(ch);
- ch = null;
- reader.close();
- }
-
- //
- // Entity methods
- //
-
- /** Returns whether the encoding of this entity was externally specified. **/
- public boolean isEncodingExternallySpecified() {
- return externallySpecifiedEncoding;
- }
-
- /** Sets whether the encoding of this entity was externally specified. **/
- public void setEncodingExternallySpecified(boolean value) {
- externallySpecifiedEncoding = value;
- }
-
- public boolean isDeclaredEncoding() {
- return declaredEncoding;
- }
-
- public void setDeclaredEncoding(boolean value) {
- declaredEncoding = value;
- }
-
- /** Returns true if this is an external entity. */
- public final boolean isExternal() {
- return isExternal;
- } // isExternal():boolean
-
- /** Returns true if this is an unparsed entity. */
- public final boolean isUnparsed() {
- return false;
- } // isUnparsed():boolean
-
- //
- // Object methods
- //
-
- /** Returns a string representation of this object. */
- public String toString() {
-
- StringBuffer str = new StringBuffer();
- str.append("name=\""+name+'"');
- str.append(",ch="+ new String(ch));
- str.append(",position="+position);
- str.append(",count="+count);
- return str.toString();
-
- } // toString():String
-
- } // class ScannedEntity
-
-} // class Entity
diff --git a/src/com/sun/xml/internal/stream/EventFilterSupport.java b/src/com/sun/xml/internal/stream/EventFilterSupport.java
deleted file mode 100644
index 6c354a5..0000000
--- a/src/com/sun/xml/internal/stream/EventFilterSupport.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.xml.internal.stream;
-
-import java.util.NoSuchElementException;
-import javax.xml.stream.EventFilter;
-import javax.xml.stream.XMLEventReader;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.events.XMLEvent;
-import javax.xml.stream.util.EventReaderDelegate;
-
-/**
- *
- * @author Neeraj Bajaj, Sun Microsystems
- *
- */
-public class EventFilterSupport extends EventReaderDelegate {
-
- //maintain a reference to EventFilter
- EventFilter fEventFilter ;
- /** Creates a new instance of EventFilterSupport */
- public EventFilterSupport(XMLEventReader eventReader, EventFilter eventFilter) {
- setParent(eventReader);
- fEventFilter = eventFilter;
- }
-
- public Object next(){
- try{
- return nextEvent();
- }catch(XMLStreamException ex){
- throw new NoSuchElementException();
- }
- }
-
- public boolean hasNext(){
- try{
- return peek() != null ? true : false ;
- }catch(XMLStreamException ex){
- return false;
- }
- }
-
- public XMLEvent nextEvent()throws XMLStreamException{
- if(super.hasNext()){
- //get the next event by calling XMLEventReader
- XMLEvent event = super.nextEvent();
-
- //if this filter accepts this event then return this event
- if(fEventFilter.accept(event)){
- return event;
- }
- else{
- return nextEvent();
- }
- }else{
- throw new NoSuchElementException();
- }
- }//nextEvent()
-
- public XMLEvent nextTag() throws XMLStreamException{
- if(super.hasNext()){
- XMLEvent event = super.nextTag();
- //if the filter accepts this event return this event.
- if(fEventFilter.accept(event)){
- return event;
- }
- else{
- return nextTag();
- }
- }else{
- throw new NoSuchElementException();
- }
- }
-
- public XMLEvent peek() throws XMLStreamException{
- while (true) {
- XMLEvent event = super.peek();
- if(event == null)return null;
- //if the filter accepts this event return this event.
- if(fEventFilter.accept(event)){
- return event;
- }
- //call super.next(), and then peek again.
- super.next();
- }
- }
-
-}//EventFilterSupport
diff --git a/src/com/sun/xml/internal/stream/StaxEntityResolverWrapper.java b/src/com/sun/xml/internal/stream/StaxEntityResolverWrapper.java
deleted file mode 100644
index 01c5d25..0000000
--- a/src/com/sun/xml/internal/stream/StaxEntityResolverWrapper.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.xml.internal.stream;
-
-import java.io.InputStream;
-import javax.xml.stream.XMLEventReader;
-import javax.xml.stream.XMLResolver;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-
-/**
- *
- * @author Neeraj Bajaj
- */
-public class StaxEntityResolverWrapper {
-
- XMLResolver fStaxResolver ;
-
- /** Creates a new instance of StaxEntityResolverWrapper */
- public StaxEntityResolverWrapper(XMLResolver resolver) {
- fStaxResolver = resolver ;
- }
-
- public void setStaxEntityResolver(XMLResolver resolver ){
- fStaxResolver = resolver ;
- }
-
- public XMLResolver getStaxEntityResolver(){
- return fStaxResolver ;
- }
-
- public StaxXMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier)
- throws XNIException, java.io.IOException {
- Object object = null ;
- try{
- object = fStaxResolver.resolveEntity(resourceIdentifier.getPublicId(), resourceIdentifier.getLiteralSystemId(),
- resourceIdentifier.getBaseSystemId(), null);
- return getStaxInputSource(object) ;
- }catch(XMLStreamException streamException){
- throw new XNIException(streamException) ;
- }
- }
-
- StaxXMLInputSource getStaxInputSource(Object object){
- if(object == null) return null ;
-
- if(object instanceof java.io.InputStream){
- return new StaxXMLInputSource(new XMLInputSource(null, null, null, (InputStream)object, null));
- }
- else if(object instanceof XMLStreamReader){
- return new StaxXMLInputSource((XMLStreamReader)object) ;
- }else if(object instanceof XMLEventReader){
- return new StaxXMLInputSource((XMLEventReader)object) ;
- }
-
- return null ;
- }
-}//class StaxEntityResolverWrapper
diff --git a/src/com/sun/xml/internal/stream/StaxErrorReporter.java b/src/com/sun/xml/internal/stream/StaxErrorReporter.java
deleted file mode 100644
index e48ae7b..0000000
--- a/src/com/sun/xml/internal/stream/StaxErrorReporter.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.xml.internal.stream;
-
-
-
-import javax.xml.stream.Location;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLReporter;
-import javax.xml.stream.XMLStreamException;
-import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter;
-import com.sun.org.apache.xerces.internal.util.MessageFormatter;
-import com.sun.org.apache.xerces.internal.xni.XMLLocator;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-
-import com.sun.org.apache.xerces.internal.impl.PropertyManager;
-import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
-
-/**
- *
- * @author neeraj
- */
-
-public class StaxErrorReporter extends XMLErrorReporter {
-
- protected XMLReporter fXMLReporter = null ;
-
- /** Creates a new instance of StaxErrorReporter */
- public StaxErrorReporter(PropertyManager propertyManager) {
- super();
- putMessageFormatter(XMLMessageFormatter.XML_DOMAIN, new XMLMessageFormatter());
- reset(propertyManager);
- }
-
- /** Creates a new instance of StaxErrorReporter
- * If this constructor is used to create the object, one must invoke reset() on this object.
- */
- public StaxErrorReporter() {
- super();
- putMessageFormatter(XMLMessageFormatter.XML_DOMAIN, new XMLMessageFormatter());
- }
-
- /**
- *One must call reset before using any of the function.
- */
- public void reset(PropertyManager propertyManager){
- fXMLReporter = (XMLReporter)propertyManager.getProperty(XMLInputFactory.REPORTER);
- }
- /**
- * Reports an error at a specific location.
- *
- * @param location The error location.
- * @param domain The error domain.
- * @param key The key of the error message.
- * @param arguments The replacement arguments for the error message,
- * if needed.
- * @param severity The severity of the error.
- *
- * @see #SEVERITY_WARNING
- * @see #SEVERITY_ERROR
- * @see #SEVERITY_FATAL_ERROR
- */
- public String reportError(XMLLocator location,
- String domain, String key, Object[] arguments,
- short severity) throws XNIException {
- // format error message and create parse exception
- MessageFormatter messageFormatter = getMessageFormatter(domain);
- String message;
- if (messageFormatter != null) {
- message = messageFormatter.formatMessage(fLocale, key, arguments);
- }
- else {
- StringBuffer str = new StringBuffer();
- str.append(domain);
- str.append('#');
- str.append(key);
- int argCount = arguments != null ? arguments.length : 0;
- if (argCount > 0) {
- str.append('?');
- for (int i = 0; i < argCount; i++) {
- str.append(arguments[i]);
- if (i < argCount -1) {
- str.append('&');
- }
- }
- }
- message = str.toString();
- }
-
-
-
- //no reporter was specified
- /**
- * if (reporter == null) {
- * reporter = new DefaultStaxErrorReporter();
- * }
- */
-
- // call error handler
- switch (severity) {
- case SEVERITY_WARNING: {
- try{
- if(fXMLReporter!= null){
- fXMLReporter.report(message, "WARNING", null, convertToStaxLocation(location) );
- }
- }catch(XMLStreamException ex){
- //what we should be doing ?? if the user throws XMLStreamException
- //REVISIT:
- throw new XNIException(ex);
- }
- break;
- }
- case SEVERITY_ERROR: {
- try{
- if(fXMLReporter!= null){
- fXMLReporter.report(message, "ERROR", null, convertToStaxLocation(location) );
- }
- }catch(XMLStreamException ex){
- //what we should be doing ?? if the user throws XMLStreamException
- //REVISIT:
- throw new XNIException(ex);
- }
- break;
- }
- case SEVERITY_FATAL_ERROR: {
- if (!fContinueAfterFatalError) {
- throw new XNIException(message);
- }
- break;
- }
- }
- return message;
- }
-
-
- Location convertToStaxLocation(final XMLLocator location){
- return new Location(){
- public int getColumnNumber(){
- return location.getColumnNumber();
- }
-
- public int getLineNumber(){
- return location.getLineNumber();
- }
-
- public String getPublicId(){
- return location.getPublicId();
- }
-
- public String getSystemId(){
- return location.getLiteralSystemId();
- }
-
- public int getCharacterOffset(){
- return location.getCharacterOffset();
- }
- public String getLocationURI(){
- return "";
- }
-
- };
- }
-
-}
diff --git a/src/com/sun/xml/internal/stream/StaxXMLInputSource.java b/src/com/sun/xml/internal/stream/StaxXMLInputSource.java
deleted file mode 100644
index 65f852c..0000000
--- a/src/com/sun/xml/internal/stream/StaxXMLInputSource.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.xml.internal.stream;
-
-import javax.xml.stream.XMLEventReader;
-import javax.xml.stream.XMLStreamReader;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-
-/**
- *
- * @author Neeraj
- *
- * This class wraps XMLInputSource and is also capable of telling wether application
- * returned XMLStreamReader or not when XMLResolver.resolveEnity
- * was called.
- */
-public class StaxXMLInputSource {
-
- XMLStreamReader fStreamReader ;
- XMLEventReader fEventReader ;
- XMLInputSource fInputSource ;
-
- //indicate if the source is resolved by a resolver
- boolean fHasResolver = false;
-
- /** Creates a new instance of StaxXMLInputSource */
- public StaxXMLInputSource(XMLStreamReader streamReader) {
- fStreamReader = streamReader ;
- }
-
- /** Creates a new instance of StaxXMLInputSource */
- public StaxXMLInputSource(XMLEventReader eventReader) {
- fEventReader = eventReader ;
- }
-
- public StaxXMLInputSource(XMLInputSource inputSource){
- fInputSource = inputSource ;
-
- }
-
- public StaxXMLInputSource(XMLInputSource inputSource, boolean hasResolver){
- fInputSource = inputSource ;
- fHasResolver = hasResolver;
- }
-
- public XMLStreamReader getXMLStreamReader(){
- return fStreamReader ;
- }
-
- public XMLEventReader getXMLEventReader(){
- return fEventReader ;
- }
-
- public XMLInputSource getXMLInputSource(){
- return fInputSource ;
- }
-
- public boolean hasXMLStreamOrXMLEventReader(){
- return (fStreamReader == null) && (fEventReader == null) ? false : true ;
- }
-
- public boolean hasResolver() {
- return fHasResolver;
- }
-}
diff --git a/src/com/sun/xml/internal/stream/XMLBufferListener.java b/src/com/sun/xml/internal/stream/XMLBufferListener.java
deleted file mode 100644
index 33c9812..0000000
--- a/src/com/sun/xml/internal/stream/XMLBufferListener.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.xml.internal.stream;
-
-/**
- * XMLBufferListerner should be implemented by classes which wish to receive
- * call backs from XMLEntityReader.
- *
- * @author k.venugopal@sun.com,
- * @author Neeraj.bajaj@sun.com
- */
-public interface XMLBufferListener {
-
- /**
- * Will be invoked by XMLEntityReader before it tries to resize,load new data
- * into current ScannedEntities buffer.
- */
- public void refresh();
-
- /**
- * receives callbacks from {@link XMLEntityReader } when buffer
- * is being changed.
- * @param refreshPosition
- */
- public void refresh(int loadPosition);
-
-}
diff --git a/src/com/sun/xml/internal/stream/XMLEntityReader.java b/src/com/sun/xml/internal/stream/XMLEntityReader.java
deleted file mode 100644
index 521c009..0000000
--- a/src/com/sun/xml/internal/stream/XMLEntityReader.java
+++ /dev/null
@@ -1,302 +0,0 @@
-/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
- */
-
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.xml.internal.stream;
-
-import java.io.IOException;
-
-import com.sun.org.apache.xerces.internal.util.XMLStringBuffer;
-import com.sun.org.apache.xerces.internal.xni.*;
-
-/**
- * This class allows various parser scanners to scan basic XML constructs
- * from entities. This class works directly with the entity manager to
- * provide this functionality.
- * <p>
- * There is only one entity scanner and entity manager per parser. The
- * entity manager <em>could</em> implement the methods to perform entity
- * scanning, but the entity scanner class allows a cleaner separation
- * between entity management API and entity scanning.
- *
- * @author Andy Clark, IBM
- * @author Neeraj Bajaj Sun Microsystems
- * @author K.Venugopal Sun Microsystems
- *
- * @see XMLEntityHandler
- * @see XMLEntityManager
- */
-public abstract class XMLEntityReader implements XMLLocator {
-
- //
- // Public methods
- //
-
-
- /**
- * Sets the encoding of the scanner. This method is used by the
- * scanners if the XMLDecl or TextDecl line contains an encoding
- * pseudo-attribute.
- * <p>
- * <strong>Note:</strong> The underlying character reader on the
- * current entity will be changed to accomodate the new encoding.
- * However, the new encoding is ignored if the current reader was
- * not constructed from an input stream (e.g. an external entity
- * that is resolved directly to the appropriate java.io.Reader
- * object).
- *
- * @param encoding The IANA encoding name of the new encoding.
- *
- * @throws IOException Thrown if the new encoding is not supported.
- *
- * @see com.sun.org.apache.xerces.internal.util.EncodingMap
- * @see com.sun.org.apache.xerces.internal.util.XMLChar#isValidIANAEncoding
- * @see com.sun.org.apache.xerces.internal.util.XMLChar#isValidJavaEncoding
- */
- public abstract void setEncoding(String encoding)
- throws IOException;
-
- public abstract String getEncoding() ;
-
- public abstract int getCharacterOffset() ;
-
- /** the version of the current entity being scanned or the version of the entity on which reader is operating */
- public abstract void setVersion(String version) ;
-
- /** get the version of the entity on which reader is operating */
- public abstract String getVersion() ;
-
- /** Returns true if the current entity being scanned is external. */
- public abstract boolean isExternal();
-
- /**
- * Returns the next character on the input.
- * <p>
- * <strong>Note:</strong> The character is <em>not</em> consumed.
- *
- * @throws IOException Thrown if i/o error occurs.
- * @throws EOFException Thrown on end of file.
- */
- public abstract int peekChar() throws IOException;
-
- /**
- * Returns the next character on the input.
- * <p>
- * <strong>Note:</strong> The character is consumed.
- *
- * @throws IOException Thrown if i/o error occurs.
- * @throws EOFException Thrown on end of file.
- */
- public abstract int scanChar() throws IOException;
-
- /**
- * Returns a string matching the NMTOKEN production appearing immediately
- * on the input as a symbol, or null if NMTOKEN Name string is present.
- * <p>
- * <strong>Note:</strong> The NMTOKEN characters are consumed.
- * <p>
- * <strong>Note:</strong> The string returned must be a symbol. The
- * SymbolTable can be used for this purpose.
- *
- * @throws IOException Thrown if i/o error occurs.
- * @throws EOFException Thrown on end of file.
- *
- * @see com.sun.org.apache.xerces.internal.util.SymbolTable
- * @see com.sun.org.apache.xerces.internal.util.XMLChar#isName
- */
- public abstract String scanNmtoken() throws IOException;
-
- /**
- * Returns a string matching the Name production appearing immediately
- * on the input as a symbol, or null if no Name string is present.
- * <p>
- * <strong>Note:</strong> The Name characters are consumed.
- * <p>
- * <strong>Note:</strong> The string returned must be a symbol. The
- * SymbolTable can be used for this purpose.
- *
- * @throws IOException Thrown if i/o error occurs.
- * @throws EOFException Thrown on end of file.
- *
- * @see com.sun.org.apache.xerces.internal.util.SymbolTable
- * @see com.sun.org.apache.xerces.internal.util.XMLChar#isName
- * @see com.sun.org.apache.xerces.internal.util.XMLChar#isNameStart
- */
- public abstract String scanName() throws IOException;
-
- /**
- * Scans a qualified name from the input, setting the fields of the
- * QName structure appropriately.
- * <p>
- * <strong>Note:</strong> The qualified name characters are consumed.
- * <p>
- * <strong>Note:</strong> The strings used to set the values of the
- * QName structure must be symbols. The SymbolTable can be used for
- * this purpose.
- *
- * @param qname The qualified name structure to fill.
- *
- * @return Returns true if a qualified name appeared immediately on
- * the input and was scanned, false otherwise.
- *
- * @throws IOException Thrown if i/o error occurs.
- * @throws EOFException Thrown on end of file.
- *
- * @see com.sun.org.apache.xerces.internal.util.SymbolTable
- * @see com.sun.org.apache.xerces.internal.util.XMLChar#isName
- * @see com.sun.org.apache.xerces.internal.util.XMLChar#isNameStart
- */
- public abstract boolean scanQName(QName qname) throws IOException;
-
- /**
- * CHANGED:
- * Scans a range of parsed character data, This function appends the character data to
- * the supplied buffer.
- * <p>
- * <strong>Note:</strong> The characters are consumed.
- * <p>
- * <strong>Note:</strong> This method does not guarantee to return
- * the longest run of parsed character data. This method may return
- * before markup due to reaching the end of the input buffer or any
- * other reason.
- * <p>
- *
- * @param content The content structure to fill.
- *
- * @return Returns the next character on the input, if known. This
- * value may be -1 but this does <em>note</em> designate
- * end of file.
- *
- * @throws IOException Thrown if i/o error occurs.
- * @throws EOFException Thrown on end of file.
- */
- public abstract int scanContent(XMLString content) throws IOException;
-
- /**
- * Scans a range of attribute value data, setting the fields of the
- * XMLString structure, appropriately.
- * <p>
- * <strong>Note:</strong> The characters are consumed.
- * <p>
- * <strong>Note:</strong> This method does not guarantee to return
- * the longest run of attribute value data. This method may return
- * before the quote character due to reaching the end of the input
- * buffer or any other reason.
- * <p>
- * <strong>Note:</strong> The fields contained in the XMLString
- * structure are not guaranteed to remain valid upon subsequent calls
- * to the entity scanner. Therefore, the caller is responsible for
- * immediately using the returned character data or making a copy of
- * the character data.
- *
- * @param quote The quote character that signifies the end of the
- * attribute value data.
- * @param content The content structure to fill.
- *
- * @return Returns the next character on the input, if known. This
- * value may be -1 but this does <em>note</em> designate
- * end of file.
- *
- * @throws IOException Thrown if i/o error occurs.
- * @throws EOFException Thrown on end of file.
- */
- public abstract int scanLiteral(int quote, XMLString content)
- throws IOException;
-
- /**
- * Scans a range of character data up to the specicied delimiter,
- * setting the fields of the XMLString structure, appropriately.
- * <p>
- * <strong>Note:</strong> The characters are consumed.
- * <p>
- * <strong>Note:</strong> This assumes that the internal buffer is
- * at least the same size, or bigger, than the length of the delimiter
- * and that the delimiter contains at least one character.
- * <p>
- * <strong>Note:</strong> This method does not guarantee to return
- * the longest run of character data. This method may return before
- * the delimiter due to reaching the end of the input buffer or any
- * other reason.
- * <p>
- * <strong>Note:</strong> The fields contained in the XMLString
- * structure are not guaranteed to remain valid upon subsequent calls
- * to the entity scanner. Therefore, the caller is responsible for
- * immediately using the returned character data or making a copy of
- * the character data.
- *
- * @param delimiter The string that signifies the end of the character
- * data to be scanned.
- * @param data The data structure to fill.
- *
- * @return Returns true if there is more data to scan, false otherwise.
- *
- * @throws IOException Thrown if i/o error occurs.
- * @throws EOFException Thrown on end of file.
- */
- public abstract boolean scanData(String delimiter, XMLStringBuffer data)
- throws IOException;
-
- /**
- * Skips a character appearing immediately on the input.
- * <p>
- * <strong>Note:</strong> The character is consumed only if it matches
- * the specified character.
- *
- * @param c The character to skip.
- *
- * @return Returns true if the character was skipped.
- *
- * @throws IOException Thrown if i/o error occurs.
- * @throws EOFException Thrown on end of file.
- */
- public abstract boolean skipChar(int c) throws IOException;
-
- /**
- * Skips space characters appearing immediately on the input.
- * <p>
- * <strong>Note:</strong> The characters are consumed only if they are
- * space characters.
- *
- * @return Returns true if at least one space character was skipped.
- *
- * @throws IOException Thrown if i/o error occurs.
- * @throws EOFException Thrown on end of file.
- *
- * @see com.sun.org.apache.xerces.internal.util.XMLChar#isSpace
- */
- public abstract boolean skipSpaces() throws IOException;
-
- /**
- * Skips the specified string appearing immediately on the input.
- * <p>
- * <strong>Note:</strong> The characters are consumed only if they are
- * space characters.
- *
- * @param s The string to skip.
- *
- * @return Returns true if the string was skipped.
- *
- * @throws IOException Thrown if i/o error occurs.
- * @throws EOFException Thrown on end of file.
- */
- public abstract boolean skipString(String s) throws IOException;
-
- public abstract void registerListener(XMLBufferListener listener);
-
-} // class XMLEntityScanner
diff --git a/src/com/sun/xml/internal/stream/XMLEntityStorage.java b/src/com/sun/xml/internal/stream/XMLEntityStorage.java
deleted file mode 100644
index 6252f22..0000000
--- a/src/com/sun/xml/internal/stream/XMLEntityStorage.java
+++ /dev/null
@@ -1,625 +0,0 @@
-/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.xml.internal.stream;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.PropertyManager;
-import com.sun.org.apache.xerces.internal.impl.XMLEntityManager;
-import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
-import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter;
-import com.sun.org.apache.xerces.internal.util.URI;
-import com.sun.org.apache.xerces.internal.util.XMLResourceIdentifierImpl;
-import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- *
- * @author K.Venugopal SUN Microsystems
- * @author Neeraj Bajaj SUN Microsystems
- * @author Andy Clark, IBM
- *
- */
-public class XMLEntityStorage {
-
- /** Property identifier: error reporter. */
- protected static final String ERROR_REPORTER =
- Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY;
-
- /** Feature identifier: warn on duplicate EntityDef */
- protected static final String WARN_ON_DUPLICATE_ENTITYDEF =
- Constants.XERCES_FEATURE_PREFIX +Constants.WARN_ON_DUPLICATE_ENTITYDEF_FEATURE;
-
- /** warn on duplicate Entity declaration.
- * http://apache.org/xml/features/warn-on-duplicate-entitydef
- */
- protected boolean fWarnDuplicateEntityDef;
-
- /** Entities. */
- protected Map<String, Entity> fEntities = new HashMap<>();
-
- protected Entity.ScannedEntity fCurrentEntity ;
-
- private XMLEntityManager fEntityManager;
- /**
- * Error reporter. This property identifier is:
- * http://apache.org/xml/properties/internal/error-reporter
- */
- protected XMLErrorReporter fErrorReporter;
- protected PropertyManager fPropertyManager ;
-
- /* To keep track whether an entity is declared in external or internal subset*/
- protected boolean fInExternalSubset = false;
-
- /** Creates a new instance of XMLEntityStorage */
- public XMLEntityStorage(PropertyManager propertyManager) {
- fPropertyManager = propertyManager ;
- }
-
- /** Creates a new instance of XMLEntityStorage */
- /*public XMLEntityStorage(Entity.ScannedEntity currentEntity) {
- fCurrentEntity = currentEntity ;*/
- public XMLEntityStorage(XMLEntityManager entityManager) {
- fEntityManager = entityManager;
- }
-
- public void reset(PropertyManager propertyManager){
-
- fErrorReporter = (XMLErrorReporter)propertyManager.getProperty(Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY);
- fEntities.clear();
- fCurrentEntity = null;
-
- }
-
- public void reset(){
- fEntities.clear();
- fCurrentEntity = null;
- }
- /**
- * Resets the component. The component can query the component manager
- * about any features and properties that affect the operation of the
- * component.
- *
- * @param componentManager The component manager.
- *
- * @throws SAXException Thrown by component on initialization error.
- * For example, if a feature or property is
- * required for the operation of the component, the
- * component manager may throw a
- * SAXNotRecognizedException or a
- * SAXNotSupportedException.
- */
- public void reset(XMLComponentManager componentManager)
- throws XMLConfigurationException {
-
-
- // xerces features
-
- fWarnDuplicateEntityDef = componentManager.getFeature(WARN_ON_DUPLICATE_ENTITYDEF, false);
-
- fErrorReporter = (XMLErrorReporter)componentManager.getProperty(ERROR_REPORTER);
-
- fEntities.clear();
- fCurrentEntity = null;
-
- } // reset(XMLComponentManager)
-
- /**
- * Returns entity declaration.
- *
- * @param name The name of the entity.
- *
- * @see SymbolTable
- */
- public Entity getEntity(String name) {
- return fEntities.get(name);
- } // getEntity(String)
-
- public boolean hasEntities() {
- return (fEntities!=null);
- } // getEntity(String)
-
- public int getEntitySize() {
- return fEntities.size();
- } // getEntity(String)
-
- public Enumeration getEntityKeys() {
- return Collections.enumeration(fEntities.keySet());
- }
- /**
- * Adds an internal entity declaration.
- * <p>
- * <strong>Note:</strong> This method ignores subsequent entity
- * declarations.
- * <p>
- * <strong>Note:</strong> The name should be a unique symbol. The
- * SymbolTable can be used for this purpose.
- *
- * @param name The name of the entity.
- * @param text The text of the entity.
- *
- * @see SymbolTable
- */
- public void addInternalEntity(String name, String text) {
- if (!fEntities.containsKey(name)) {
- Entity entity = new Entity.InternalEntity(name, text, fInExternalSubset);
- fEntities.put(name, entity);
- }
- else{
- if(fWarnDuplicateEntityDef){
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "MSG_DUPLICATE_ENTITY_DEFINITION",
- new Object[]{ name },
- XMLErrorReporter.SEVERITY_WARNING );
- }
- }
- } // addInternalEntity(String,String)
-
- /**
- * Adds an external entity declaration.
- * <p>
- * <strong>Note:</strong> This method ignores subsequent entity
- * declarations.
- * <p>
- * <strong>Note:</strong> The name should be a unique symbol. The
- * SymbolTable can be used for this purpose.
- *
- * @param name The name of the entity.
- * @param publicId The public identifier of the entity.
- * @param literalSystemId The system identifier of the entity.
- * @param baseSystemId The base system identifier of the entity.
- * This is the system identifier of the entity
- * where <em>the entity being added</em> and
- * is used to expand the system identifier when
- * the system identifier is a relative URI.
- * When null the system identifier of the first
- * external entity on the stack is used instead.
- *
- * @see SymbolTable
- */
- public void addExternalEntity(String name,
- String publicId, String literalSystemId,
- String baseSystemId) {
- if (!fEntities.containsKey(name)) {
- if (baseSystemId == null) {
- // search for the first external entity on the stack
- //xxx commenting the 'size' variable..
- /**
- * int size = fEntityStack.size();
- * if (size == 0 && fCurrentEntity != null && fCurrentEntity.entityLocation != null) {
- * baseSystemId = fCurrentEntity.entityLocation.getExpandedSystemId();
- * }
- */
-
- //xxx we need to have information about the current entity.
- if (fCurrentEntity != null && fCurrentEntity.entityLocation != null) {
- baseSystemId = fCurrentEntity.entityLocation.getExpandedSystemId();
- }
- /**
- * for (int i = size - 1; i >= 0 ; i--) {
- * ScannedEntity externalEntity =
- * (ScannedEntity)fEntityStack.elementAt(i);
- * if (externalEntity.entityLocation != null && externalEntity.entityLocation.getExpandedSystemId() != null) {
- * baseSystemId = externalEntity.entityLocation.getExpandedSystemId();
- * break;
- * }
- * }
- */
- }
-
- fCurrentEntity = fEntityManager.getCurrentEntity();
- Entity entity = new Entity.ExternalEntity(name,
- new XMLResourceIdentifierImpl(publicId, literalSystemId,
- baseSystemId, expandSystemId(literalSystemId, baseSystemId)),
- null, fInExternalSubset);
- //TODO :: Forced to pass true above remove it.
- //(fCurrentEntity == null) ? fasle : fCurrentEntity.isEntityDeclInExternalSubset());
- // null, fCurrentEntity.isEntityDeclInExternalSubset());
- fEntities.put(name, entity);
- }
- else{
- if(fWarnDuplicateEntityDef){
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "MSG_DUPLICATE_ENTITY_DEFINITION",
- new Object[]{ name },
- XMLErrorReporter.SEVERITY_WARNING );
- }
- }
-
- } // addExternalEntity(String,String,String,String)
-
- /**
- * Checks whether an entity given by name is external.
- *
- * @param entityName The name of the entity to check.
- * @returns True if the entity is external, false otherwise
- * (including when the entity is not declared).
- */
- public boolean isExternalEntity(String entityName) {
-
- Entity entity = fEntities.get(entityName);
- if (entity == null) {
- return false;
- }
- return entity.isExternal();
- }
-
- /**
- * Checks whether the declaration of an entity given by name is
- * // in the external subset.
- *
- * @param entityName The name of the entity to check.
- * @returns True if the entity was declared in the external subset, false otherwise
- * (including when the entity is not declared).
- */
- public boolean isEntityDeclInExternalSubset(String entityName) {
-
- Entity entity = fEntities.get(entityName);
- if (entity == null) {
- return false;
- }
- return entity.isEntityDeclInExternalSubset();
- }
-
- /**
- * Adds an unparsed entity declaration.
- * <p>
- * <strong>Note:</strong> This method ignores subsequent entity
- * declarations.
- * <p>
- * <strong>Note:</strong> The name should be a unique symbol. The
- * SymbolTable can be used for this purpose.
- *
- * @param name The name of the entity.
- * @param publicId The public identifier of the entity.
- * @param systemId The system identifier of the entity.
- * @param notation The name of the notation.
- *
- * @see SymbolTable
- */
- public void addUnparsedEntity(String name,
- String publicId, String systemId,
- String baseSystemId, String notation) {
-
- fCurrentEntity = fEntityManager.getCurrentEntity();
- if (!fEntities.containsKey(name)) {
- Entity entity = new Entity.ExternalEntity(name, new XMLResourceIdentifierImpl(publicId, systemId, baseSystemId, null), notation, fInExternalSubset);
- // (fCurrentEntity == null) ? fasle : fCurrentEntity.isEntityDeclInExternalSubset());
- // fCurrentEntity.isEntityDeclInExternalSubset());
- fEntities.put(name, entity);
- }
- else{
- if(fWarnDuplicateEntityDef){
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "MSG_DUPLICATE_ENTITY_DEFINITION",
- new Object[]{ name },
- XMLErrorReporter.SEVERITY_WARNING );
- }
- }
- } // addUnparsedEntity(String,String,String,String)
-
- /**
- * Checks whether an entity given by name is unparsed.
- *
- * @param entityName The name of the entity to check.
- * @returns True if the entity is unparsed, false otherwise
- * (including when the entity is not declared).
- */
- public boolean isUnparsedEntity(String entityName) {
-
- Entity entity = fEntities.get(entityName);
- if (entity == null) {
- return false;
- }
- return entity.isUnparsed();
- }
-
- /**
- * Checks whether an entity given by name is declared.
- *
- * @param entityName The name of the entity to check.
- * @returns True if the entity is declared, false otherwise.
- */
- public boolean isDeclaredEntity(String entityName) {
-
- Entity entity = fEntities.get(entityName);
- return entity != null;
- }
- /**
- * Expands a system id and returns the system id as a URI, if
- * it can be expanded. A return value of null means that the
- * identifier is already expanded. An exception thrown
- * indicates a failure to expand the id.
- *
- * @param systemId The systemId to be expanded.
- *
- * @return Returns the URI string representing the expanded system
- * identifier. A null value indicates that the given
- * system identifier is already expanded.
- *
- */
- public static String expandSystemId(String systemId) {
- return expandSystemId(systemId, null);
- } // expandSystemId(String):String
-
- // current value of the "user.dir" property
- private static String gUserDir;
- // escaped value of the current "user.dir" property
- private static String gEscapedUserDir;
- // which ASCII characters need to be escaped
- private static boolean gNeedEscaping[] = new boolean[128];
- // the first hex character if a character needs to be escaped
- private static char gAfterEscaping1[] = new char[128];
- // the second hex character if a character needs to be escaped
- private static char gAfterEscaping2[] = new char[128];
- private static char[] gHexChs = {'0', '1', '2', '3', '4', '5', '6', '7',
- '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
- // initialize the above 3 arrays
- static {
- for (int i = 0; i <= 0x1f; i++) {
- gNeedEscaping[i] = true;
- gAfterEscaping1[i] = gHexChs[i >> 4];
- gAfterEscaping2[i] = gHexChs[i & 0xf];
- }
- gNeedEscaping[0x7f] = true;
- gAfterEscaping1[0x7f] = '7';
- gAfterEscaping2[0x7f] = 'F';
- char[] escChs = {' ', '<', '>', '#', '%', '"', '{', '}',
- '|', '\\', '^', '~', '[', ']', '`'};
- int len = escChs.length;
- char ch;
- for (int i = 0; i < len; i++) {
- ch = escChs[i];
- gNeedEscaping[ch] = true;
- gAfterEscaping1[ch] = gHexChs[ch >> 4];
- gAfterEscaping2[ch] = gHexChs[ch & 0xf];
- }
- }
- // To escape the "user.dir" system property, by using %HH to represent
- // special ASCII characters: 0x00~0x1F, 0x7F, ' ', '<', '>', '#', '%'
- // and '"'. It's a static method, so needs to be synchronized.
- // this method looks heavy, but since the system property isn't expected
- // to change often, so in most cases, we only need to return the string
- // that was escaped before.
- // According to the URI spec, non-ASCII characters (whose value >= 128)
- // need to be escaped too.
- // REVISIT: don't know how to escape non-ASCII characters, especially
- // which encoding to use. Leave them for now.
- private static synchronized String getUserDir() {
- // get the user.dir property
- String userDir = "";
- try {
- userDir = SecuritySupport.getSystemProperty("user.dir");
- }
- catch (SecurityException se) {
- }
-
- // return empty string if property value is empty string.
- if (userDir.length() == 0)
- return "";
-
- // compute the new escaped value if the new property value doesn't
- // match the previous one
- if (userDir.equals(gUserDir)) {
- return gEscapedUserDir;
- }
-
- // record the new value as the global property value
- gUserDir = userDir;
-
- char separator = java.io.File.separatorChar;
- userDir = userDir.replace(separator, '/');
-
- int len = userDir.length(), ch;
- StringBuffer buffer = new StringBuffer(len*3);
- // change C:/blah to /C:/blah
- if (len >= 2 && userDir.charAt(1) == ':') {
- ch = Character.toUpperCase(userDir.charAt(0));
- if (ch >= 'A' && ch <= 'Z') {
- buffer.append('/');
- }
- }
-
- // for each character in the path
- int i = 0;
- for (; i < len; i++) {
- ch = userDir.charAt(i);
- // if it's not an ASCII character, break here, and use UTF-8 encoding
- if (ch >= 128)
- break;
- if (gNeedEscaping[ch]) {
- buffer.append('%');
- buffer.append(gAfterEscaping1[ch]);
- buffer.append(gAfterEscaping2[ch]);
- // record the fact that it's escaped
- }
- else {
- buffer.append((char)ch);
- }
- }
-
- // we saw some non-ascii character
- if (i < len) {
- // get UTF-8 bytes for the remaining sub-string
- byte[] bytes = null;
- byte b;
- try {
- bytes = userDir.substring(i).getBytes("UTF-8");
- } catch (java.io.UnsupportedEncodingException e) {
- // should never happen
- return userDir;
- }
- len = bytes.length;
-
- // for each byte
- for (i = 0; i < len; i++) {
- b = bytes[i];
- // for non-ascii character: make it positive, then escape
- if (b < 0) {
- ch = b + 256;
- buffer.append('%');
- buffer.append(gHexChs[ch >> 4]);
- buffer.append(gHexChs[ch & 0xf]);
- }
- else if (gNeedEscaping[b]) {
- buffer.append('%');
- buffer.append(gAfterEscaping1[b]);
- buffer.append(gAfterEscaping2[b]);
- }
- else {
- buffer.append((char)b);
- }
- }
- }
-
- // change blah/blah to blah/blah/
- if (!userDir.endsWith("/"))
- buffer.append('/');
-
- gEscapedUserDir = buffer.toString();
-
- return gEscapedUserDir;
- }
-
- /**
- * Expands a system id and returns the system id as a URI, if
- * it can be expanded. A return value of null means that the
- * identifier is already expanded. An exception thrown
- * indicates a failure to expand the id.
- *
- * @param systemId The systemId to be expanded.
- *
- * @return Returns the URI string representing the expanded system
- * identifier. A null value indicates that the given
- * system identifier is already expanded.
- *
- */
- public static String expandSystemId(String systemId, String baseSystemId) {
-
- // check for bad parameters id
- if (systemId == null || systemId.length() == 0) {
- return systemId;
- }
- // if id already expanded, return
- try {
- new URI(systemId);
- return systemId;
- } catch (URI.MalformedURIException e) {
- // continue on...
- }
- // normalize id
- String id = fixURI(systemId);
-
- // normalize base
- URI base = null;
- URI uri = null;
- try {
- if (baseSystemId == null || baseSystemId.length() == 0 ||
- baseSystemId.equals(systemId)) {
- String dir = getUserDir();
- base = new URI("file", "", dir, null, null);
- }
- else {
- try {
- base = new URI(fixURI(baseSystemId));
- }
- catch (URI.MalformedURIException e) {
- if (baseSystemId.indexOf(':') != -1) {
- // for xml schemas we might have baseURI with
- // a specified drive
- base = new URI("file", "", fixURI(baseSystemId), null, null);
- }
- else {
- String dir = getUserDir();
- dir = dir + fixURI(baseSystemId);
- base = new URI("file", "", dir, null, null);
- }
- }
- }
- // expand id
- uri = new URI(base, id);
- }
- catch (Exception e) {
- // let it go through
-
- }
-
- if (uri == null) {
- return systemId;
- }
- return uri.toString();
-
- } // expandSystemId(String,String):String
- //
- // Protected static methods
- //
-
- /**
- * Fixes a platform dependent filename to standard URI form.
- *
- * @param str The string to fix.
- *
- * @return Returns the fixed URI string.
- */
- protected static String fixURI(String str) {
-
- // handle platform dependent strings
- str = str.replace(java.io.File.separatorChar, '/');
-
- // Windows fix
- if (str.length() >= 2) {
- char ch1 = str.charAt(1);
- // change "C:blah" to "/C:blah"
- if (ch1 == ':') {
- char ch0 = Character.toUpperCase(str.charAt(0));
- if (ch0 >= 'A' && ch0 <= 'Z') {
- str = "/" + str;
- }
- }
- // change "//blah" to "file://blah"
- else if (ch1 == '/' && str.charAt(0) == '/') {
- str = "file:" + str;
- }
- }
-
- // done
- return str;
-
- } // fixURI(String):String
-
- // indicate start of external subset
- public void startExternalSubset() {
- fInExternalSubset = true;
- }
-
- public void endExternalSubset() {
- fInExternalSubset = false;
- }
-}
diff --git a/src/com/sun/xml/internal/stream/XMLEventReaderImpl.java b/src/com/sun/xml/internal/stream/XMLEventReaderImpl.java
deleted file mode 100644
index ee4103a..0000000
--- a/src/com/sun/xml/internal/stream/XMLEventReaderImpl.java
+++ /dev/null
@@ -1,287 +0,0 @@
-/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.xml.internal.stream;
-
-import com.sun.xml.internal.stream.events.XMLEventAllocatorImpl;
-import java.util.NoSuchElementException;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.events.EntityReference;
-import javax.xml.stream.events.XMLEvent;
-import javax.xml.stream.util.XMLEventAllocator;
-
-/**
- * @author @author Neeraj Bajaj Sun Microsystems
- *
- */
-
-public class XMLEventReaderImpl implements javax.xml.stream.XMLEventReader{
-
- protected XMLStreamReader fXMLReader ;
- protected XMLEventAllocator fXMLEventAllocator;
-
- //only constructor will do because we delegate everything to underlying XMLStreamReader
- public XMLEventReaderImpl(XMLStreamReader reader) throws XMLStreamException {
- fXMLReader = reader ;
- fXMLEventAllocator = (XMLEventAllocator)reader.getProperty(XMLInputFactory.ALLOCATOR);
- if(fXMLEventAllocator == null){
- fXMLEventAllocator = new XMLEventAllocatorImpl();
- }
- fPeekedEvent = fXMLEventAllocator.allocate(fXMLReader);
- }
-
-
- public boolean hasNext() {
- //if we have the peeked event return 'true'
- if(fPeekedEvent != null)return true;
- //this is strange XMLStreamReader throws XMLStreamException
- //XMLEventReader doesn't throw XMLStreamException
- boolean next = false ;
- try{
- next = fXMLReader.hasNext();
- }catch(XMLStreamException ex){
- return false;
- }
- return next ;
- }
-
-
- public XMLEvent nextEvent() throws XMLStreamException {
- //if application peeked return the peeked event
- if(fPeekedEvent != null){
- fLastEvent = fPeekedEvent ;
- fPeekedEvent = null;
- return fLastEvent ;
- }
- else if(fXMLReader.hasNext()){
- //advance the reader to next state.
- fXMLReader.next();
- return fLastEvent = fXMLEventAllocator.allocate(fXMLReader);
- }
- else{
- fLastEvent = null;
- throw new NoSuchElementException();
- }
- }
-
- public void remove(){
- //remove of the event is not supported.
- throw new java.lang.UnsupportedOperationException();
- }
-
-
- public void close() throws XMLStreamException {
- fXMLReader.close();
- }
-
- /** Reads the content of a text-only element. Precondition:
- * the current event is START_ELEMENT. Postcondition:
- * The current event is the corresponding END_ELEMENT.
- * @throws XMLStreamException if the current event is not a START_ELEMENT
- * or if a non text element is encountered
- */
- public String getElementText() throws XMLStreamException {
- //we have to keep reference to the 'last event' of the stream to be able
- //to make this check - is there another way ? - nb.
- if(fLastEvent.getEventType() != XMLEvent.START_ELEMENT){
- throw new XMLStreamException(
- "parser must be on START_ELEMENT to read next text", fLastEvent.getLocation());
- }
-
- // STag content ETag
- //[43] content ::= CharData? ((element | Reference | CDSect | PI | Comment) CharData?)*
-
- //<foo>....some long text say in KB and underlying parser reports multiple character
- // but getElementText() events....</foo>
-
- String data = null;
- //having a peeked event makes things really worse -- we have to test the first event
- if(fPeekedEvent != null){
- XMLEvent event = fPeekedEvent ;
- fPeekedEvent = null;
- int type = event.getEventType();
-
- if( type == XMLEvent.CHARACTERS || type == XMLEvent.SPACE ||
- type == XMLEvent.CDATA){
- data = event.asCharacters().getData();
- }
- else if(type == XMLEvent.ENTITY_REFERENCE){
- data = ((EntityReference)event).getDeclaration().getReplacementText();
- }
- else if(type == XMLEvent.COMMENT || type == XMLEvent.PROCESSING_INSTRUCTION){
- //ignore
- } else if(type == XMLEvent.START_ELEMENT) {
- throw new XMLStreamException(
- "elementGetText() function expects text only elment but START_ELEMENT was encountered.", event.getLocation());
- }else if(type == XMLEvent.END_ELEMENT){
- return "";
- }
-
- //create the string buffer and add initial data
- StringBuffer buffer = new StringBuffer();
- if(data != null && data.length() > 0 ) {
- buffer.append(data);
- }
- //get the next event -- we should stop at END_ELEMENT but it can be any thing
- //things are worse when implementing this function in XMLEventReader because
- //there isn't any function called getText() which can get values for
- //space, cdata, characters and entity reference
- //nextEvent() would also set the last event.
- event = nextEvent();
- while(event.getEventType() != XMLEvent.END_ELEMENT){
- if( type == XMLEvent.CHARACTERS || type == XMLEvent.SPACE ||
- type == XMLEvent.CDATA){
- data = event.asCharacters().getData();
- }
- else if(type == XMLEvent.ENTITY_REFERENCE){
- data = ((EntityReference)event).getDeclaration().getReplacementText();
- }
- else if(type == XMLEvent.COMMENT || type == XMLEvent.PROCESSING_INSTRUCTION){
- //ignore
- } else if(type == XMLEvent.END_DOCUMENT) {
- throw new XMLStreamException("unexpected end of document when reading element text content");
- } else if(type == XMLEvent.START_ELEMENT) {
- throw new XMLStreamException(
- "elementGetText() function expects text only elment but START_ELEMENT was encountered.", event.getLocation());
- } else {
- throw new XMLStreamException(
- "Unexpected event type "+ type, event.getLocation());
- }
- //add the data to the buffer
- if(data != null && data.length() > 0 ) {
- buffer.append(data);
- }
- event = nextEvent();
- }
- return buffer.toString();
- }//if (fPeekedEvent != null)
-
- //if there was no peeked, delegate everything to fXMLReader
- //update the last event before returning the text
- data = fXMLReader.getElementText();
- fLastEvent = fXMLEventAllocator.allocate(fXMLReader);
- return data;
- }
-
- /** Get the value of a feature/property from the underlying implementation
- * @param name The name of the property
- * @return The value of the property
- * @throws IllegalArgumentException if the property is not supported
- */
- public Object getProperty(java.lang.String name) throws java.lang.IllegalArgumentException {
- return fXMLReader.getProperty(name) ;
- }
-
- /** Skips any insignificant space events until a START_ELEMENT or
- * END_ELEMENT is reached. If anything other than space characters are
- * encountered, an exception is thrown. This method should
- * be used when processing element-only content because
- * the parser is not able to recognize ignorable whitespace if
- * the DTD is missing or not interpreted.
- * @throws XMLStreamException if anything other than space characters are encountered
- */
- public XMLEvent nextTag() throws XMLStreamException {
- //its really a pain if there is peeked event before calling nextTag()
- if(fPeekedEvent != null){
- //check the peeked event first.
- XMLEvent event = fPeekedEvent;
- fPeekedEvent = null ;
- int eventType = event.getEventType();
- //if peeked event is whitespace move to the next event
- //if peeked event is PI or COMMENT move to the next event
- if( (event.isCharacters() && event.asCharacters().isWhiteSpace())
- || eventType == XMLStreamConstants.PROCESSING_INSTRUCTION
- || eventType == XMLStreamConstants.COMMENT
- || eventType == XMLStreamConstants.START_DOCUMENT){
- event = nextEvent();
- eventType = event.getEventType();
- }
-
- //we have to have the while loop because there can be many PI or comment event in sucession
- while((event.isCharacters() && event.asCharacters().isWhiteSpace())
- || eventType == XMLStreamConstants.PROCESSING_INSTRUCTION
- || eventType == XMLStreamConstants.COMMENT){
-
- event = nextEvent();
- eventType = event.getEventType();
- }
-
- if (eventType != XMLStreamConstants.START_ELEMENT && eventType != XMLStreamConstants.END_ELEMENT) {
- throw new XMLStreamException("expected start or end tag", event.getLocation());
- }
- return event;
- }
-
- //if there is no peeked event -- delegate the work of getting next event to fXMLReader
- fXMLReader.nextTag();
- return (fLastEvent = fXMLEventAllocator.allocate(fXMLReader));
- }
-
- public Object next() {
- Object object = null;
- try{
- object = nextEvent();
- }catch(XMLStreamException streamException){
- fLastEvent = null ;
- //don't swallow the cause
- NoSuchElementException e = new NoSuchElementException(streamException.getMessage());
- e.initCause(streamException.getCause());
- throw e;
-
- }
- return object;
- }
-
- public XMLEvent peek() throws XMLStreamException{
- //if someone call peek() two times we should just return the peeked event
- //this is reset if we call next() or nextEvent()
- if(fPeekedEvent != null) return fPeekedEvent;
-
- if(hasNext()){
- //revisit: we can implement peek() by calling underlying reader to advance
- // the stream and returning the event without the knowledge of the user
- // that the stream was advanced but the point is we are advancing the stream
- //here. -- nb.
-
- // Is there any application that relies on this behavior ?
- //Can it be an application knows that there is particularly very large 'comment' section
- //or character data which it doesn't want to read or to be returned as event
- //But as of now we are creating every event but it can be optimized not to create
- // the event.
- fXMLReader.next();
- fPeekedEvent = fXMLEventAllocator.allocate(fXMLReader);
- return fPeekedEvent;
- }else{
- return null;
- }
- }//peek()
-
- private XMLEvent fPeekedEvent;
- private XMLEvent fLastEvent;
-
-}//XMLEventReaderImpl
diff --git a/src/com/sun/xml/internal/stream/XMLInputFactoryImpl.java b/src/com/sun/xml/internal/stream/XMLInputFactoryImpl.java
deleted file mode 100644
index 6f09e0f..0000000
--- a/src/com/sun/xml/internal/stream/XMLInputFactoryImpl.java
+++ /dev/null
@@ -1,305 +0,0 @@
-/*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.xml.internal.stream;
-
-import java.io.InputStream;
-import java.io.Reader;
-
-import javax.xml.stream.*;
-import javax.xml.stream.util.XMLEventAllocator ;
-import javax.xml.transform.Source;
-import javax.xml.transform.stream.StreamSource;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
-import com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl;
-import com.sun.org.apache.xerces.internal.impl.PropertyManager;
-import com.sun.org.apache.xerces.internal.impl.XMLStreamFilterImpl;
-import com.sun.org.apache.xerces.internal.impl.Constants;
-
-/** Factory Implementation for XMLInputFactory.
- * @author Neeraj Bajaj Sun Microsystems
- * @author K.Venugopal Sun Microsystems
- */
-
-//xxx: Should we be reusing the XMLInputSource object
-public class XMLInputFactoryImpl extends javax.xml.stream.XMLInputFactory {
-
-
- //List of supported properties and default values.
- private PropertyManager fPropertyManager = new PropertyManager(PropertyManager.CONTEXT_READER) ;
- private static final boolean DEBUG = false;
-
- //Maintain a reference to last reader instantiated.
- private XMLStreamReaderImpl fTempReader = null ;
-
- boolean fPropertyChanged = false;
- //no reader reuse by default
- boolean fReuseInstance = false;
-
- /** Creates a new instance of ZephryParserFactory */
- public XMLInputFactoryImpl() {
-
- }
-
- void initEventReader(){
- fPropertyChanged = true;
- }
-
- /**
- * @param inputstream
- * @throws XMLStreamException
- * @return
- */
- public XMLEventReader createXMLEventReader(InputStream inputstream) throws XMLStreamException {
- initEventReader();
- //delegate everything to XMLStreamReader
- return new XMLEventReaderImpl(createXMLStreamReader(inputstream));
- }
-
- public XMLEventReader createXMLEventReader(Reader reader) throws XMLStreamException {
- initEventReader();
- //delegate everything to XMLStreamReader
- return new XMLEventReaderImpl(createXMLStreamReader(reader));
- }
-
- public XMLEventReader createXMLEventReader(Source source) throws XMLStreamException {
- initEventReader();
- //delegate everything to XMLStreamReader
- return new XMLEventReaderImpl(createXMLStreamReader(source));
- }
-
- public XMLEventReader createXMLEventReader(String systemId, InputStream inputstream) throws XMLStreamException {
- initEventReader();
- //delegate everything to XMLStreamReader
- return new XMLEventReaderImpl(createXMLStreamReader(systemId, inputstream));
- }
-
- public XMLEventReader createXMLEventReader(java.io.InputStream stream, String encoding) throws XMLStreamException {
- initEventReader();
- //delegate everything to XMLStreamReader
- return new XMLEventReaderImpl(createXMLStreamReader(stream, encoding));
- }
-
- public XMLEventReader createXMLEventReader(String systemId, Reader reader) throws XMLStreamException {
- initEventReader();
- //delegate everything to XMLStreamReader
- return new XMLEventReaderImpl(createXMLStreamReader(systemId, reader));
- }
-
- /** Create a new XMLEventReader from an XMLStreamReader. After being used
- * to construct the XMLEventReader instance returned from this method
- * the XMLStreamReader must not be used.
- * @param reader the XMLStreamReader to read from (may not be modified)
- * @return a new XMLEventReader
- * @throws XMLStreamException
- */
- public XMLEventReader createXMLEventReader(XMLStreamReader reader) throws XMLStreamException {
-
- //xxx: what do we do now -- instance is passed from the application
- //probably we should check if the state is at the start document,
- //eventreader call to next() should return START_DOCUMENT and
- //then delegate every call to underlying streamReader
- return new XMLEventReaderImpl(reader) ;
- }
-
- public XMLStreamReader createXMLStreamReader(InputStream inputstream) throws XMLStreamException {
- XMLInputSource inputSource = new XMLInputSource(null, null, null, inputstream, null);
- return getXMLStreamReaderImpl(inputSource);
- }
-
- public XMLStreamReader createXMLStreamReader(Reader reader) throws XMLStreamException {
- XMLInputSource inputSource = new XMLInputSource(null, null, null, reader, null);
- return getXMLStreamReaderImpl(inputSource);
- }
-
- public XMLStreamReader createXMLStreamReader(String systemId, Reader reader) throws XMLStreamException {
- XMLInputSource inputSource = new XMLInputSource(null,systemId,null,reader,null);
- return getXMLStreamReaderImpl(inputSource);
- }
-
- public XMLStreamReader createXMLStreamReader(Source source) throws XMLStreamException {
- return new XMLStreamReaderImpl(jaxpSourcetoXMLInputSource(source),
- new PropertyManager(fPropertyManager));
- }
-
- public XMLStreamReader createXMLStreamReader(String systemId, InputStream inputstream) throws XMLStreamException {
- XMLInputSource inputSource = new XMLInputSource(null,systemId,null,inputstream,null);
- return getXMLStreamReaderImpl(inputSource);
- }
-
-
- public XMLStreamReader createXMLStreamReader(InputStream inputstream, String encoding) throws XMLStreamException {
- XMLInputSource inputSource = new XMLInputSource(null,null,null,inputstream,encoding);
- return getXMLStreamReaderImpl(inputSource);
- }
-
- public XMLEventAllocator getEventAllocator() {
- return (XMLEventAllocator)getProperty(XMLInputFactory.ALLOCATOR);
- }
-
- public XMLReporter getXMLReporter() {
- return (XMLReporter)fPropertyManager.getProperty(XMLInputFactory.REPORTER);
- }
-
- public XMLResolver getXMLResolver() {
- Object object = fPropertyManager.getProperty(XMLInputFactory.RESOLVER);
- return (XMLResolver)object;
- //return (XMLResolver)fPropertyManager.getProperty(XMLInputFactory.RESOLVER);
- }
-
- public void setXMLReporter(XMLReporter xmlreporter) {
- fPropertyManager.setProperty(XMLInputFactory.REPORTER, xmlreporter);
- }
-
- public void setXMLResolver(XMLResolver xmlresolver) {
- fPropertyManager.setProperty(XMLInputFactory.RESOLVER, xmlresolver);
- }
-
- /** Create a filtered event reader that wraps the filter around the event reader
- * @param reader the event reader to wrap
- * @param filter the filter to apply to the event reader
- * @throws XMLStreamException
- */
- public XMLEventReader createFilteredReader(XMLEventReader reader, EventFilter filter) throws XMLStreamException {
- return new EventFilterSupport(reader, filter);
- }
-
- /** Create a filtered reader that wraps the filter around the reader
- * @param reader the reader to filter
- * @param filter the filter to apply to the reader
- * @throws XMLStreamException
- */
- public XMLStreamReader createFilteredReader(XMLStreamReader reader, StreamFilter filter) throws XMLStreamException {
- if( reader != null && filter != null )
- return new XMLStreamFilterImpl(reader,filter);
-
- return null;
- }
-
-
-
- /** Get the value of a feature/property from the underlying implementation
- * @param name The name of the property (may not be null)
- * @return The value of the property
- * @throws IllegalArgumentException if the property is not supported
- */
- public Object getProperty(java.lang.String name) throws java.lang.IllegalArgumentException {
- if(name == null){
- throw new IllegalArgumentException("Property not supported");
- }
- if(fPropertyManager.containsProperty(name))
- return fPropertyManager.getProperty(name);
- throw new IllegalArgumentException("Property not supported");
- }
-
- /** Query the set of fProperties that this factory supports.
- *
- * @param name The name of the property (may not be null)
- * @return true if the property is supported and false otherwise
- */
- public boolean isPropertySupported(String name) {
- if(name == null)
- return false ;
- else
- return fPropertyManager.containsProperty(name);
- }
-
- /** Set a user defined event allocator for events
- * @param allocator the user defined allocator
- */
- public void setEventAllocator(XMLEventAllocator allocator) {
- fPropertyManager.setProperty(XMLInputFactory.ALLOCATOR, allocator);
- }
-
- /** Allows the user to set specific feature/property on the underlying implementation. The underlying implementation
- * is not required to support every setting of every property in the specification and may use IllegalArgumentException
- * to signal that an unsupported property may not be set with the specified value.
- * @param name The name of the property (may not be null)
- * @param value The value of the property
- * @throws java.lang.IllegalArgumentException if the property is not supported
- */
- public void setProperty(java.lang.String name, Object value) throws java.lang.IllegalArgumentException {
-
- if(name == null || value == null || !fPropertyManager.containsProperty(name) ){
- throw new IllegalArgumentException("Property "+name+" is not supported");
- }
- if(name == Constants.REUSE_INSTANCE || name.equals(Constants.REUSE_INSTANCE)){
- fReuseInstance = ((Boolean)value).booleanValue();
- if(DEBUG)System.out.println("fReuseInstance is set to " + fReuseInstance);
- }else{//for any other property set the flag
- //REVISIT: Even in this case instance can be reused, by passing PropertyManager
- fPropertyChanged = true;
- }
- fPropertyManager.setProperty(name,value);
- }
-
- XMLStreamReader getXMLStreamReaderImpl(XMLInputSource inputSource) throws javax.xml.stream.XMLStreamException{
- //1. if the temp reader is null -- create the instance and return
- if(fTempReader == null){
- fPropertyChanged = false;
- return fTempReader = new XMLStreamReaderImpl(inputSource,
- new PropertyManager(fPropertyManager));
- }
- //if factory is configured to reuse the instance & this instance can be reused
- //& the setProperty() hasn't been called
- if(fReuseInstance && fTempReader.canReuse() && !fPropertyChanged){
- if(DEBUG)System.out.println("Reusing the instance");
- //we can make setInputSource() call reset() and this way there wont be two function calls
- fTempReader.reset();
- fTempReader.setInputSource(inputSource);
- fPropertyChanged = false;
- return fTempReader;
- }else{
- fPropertyChanged = false;
- //just return the new instance.. note that we are not setting fTempReader to the newly created instance
- return fTempReader = new XMLStreamReaderImpl(inputSource,
- new PropertyManager(fPropertyManager));
- }
- }
-
- XMLInputSource jaxpSourcetoXMLInputSource(Source source){
- if(source instanceof StreamSource){
- StreamSource stSource = (StreamSource)source;
- String systemId = stSource.getSystemId();
- String publicId = stSource.getPublicId();
- InputStream istream = stSource.getInputStream();
- Reader reader = stSource.getReader();
-
- if(istream != null){
- return new XMLInputSource(publicId, systemId, null, istream, null);
- }
- else if(reader != null){
- return new XMLInputSource(publicId, systemId,null, reader, null);
- }else{
- return new XMLInputSource(publicId, systemId, null);
- }
- }
-
- throw new UnsupportedOperationException("Cannot create " +
- "XMLStreamReader or XMLEventReader from a " +
- source.getClass().getName());
- }
-
-}//XMLInputFactoryImpl
diff --git a/src/com/sun/xml/internal/stream/XMLOutputFactoryImpl.java b/src/com/sun/xml/internal/stream/XMLOutputFactoryImpl.java
deleted file mode 100644
index 9e26638..0000000
--- a/src/com/sun/xml/internal/stream/XMLOutputFactoryImpl.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.xml.internal.stream;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.Writer;
-
-import javax.xml.stream.XMLOutputFactory ;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.transform.Result;
-import javax.xml.transform.dom.DOMResult;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.stax.StAXResult;
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.PropertyManager;
-
-import com.sun.xml.internal.stream.writers.XMLDOMWriterImpl;
-import com.sun.xml.internal.stream.writers.XMLEventWriterImpl;
-import com.sun.xml.internal.stream.writers.XMLStreamWriterImpl;
-
-/**
- * This class provides the implementation of XMLOutputFactory.
- *
- * @author Neeraj Bajaj,
- * @author k.venugopal@sun.com
- */
-public class XMLOutputFactoryImpl extends XMLOutputFactory {
-
- //List of supported properties and default values.
- private PropertyManager fPropertyManager = new PropertyManager(PropertyManager.CONTEXT_WRITER);
-
- //cache the instance of XMLStreamWriterImpl
- private XMLStreamWriterImpl fStreamWriter = null;
-
- /**
- * TODO: at the current time, XMLStreamWriters are not Thread safe.
- */
- boolean fReuseInstance = false;
-
- /** Creates a new instance of XMLOutputFactory */
- public XMLOutputFactoryImpl() {
- }
-
- public javax.xml.stream.XMLEventWriter createXMLEventWriter(java.io.OutputStream outputStream) throws javax.xml.stream.XMLStreamException {
- return createXMLEventWriter(outputStream, null);
- }
-
- public javax.xml.stream.XMLEventWriter createXMLEventWriter(java.io.OutputStream outputStream, String encoding) throws javax.xml.stream.XMLStreamException {
- return new XMLEventWriterImpl(createXMLStreamWriter(outputStream, encoding));
- }
-
- public javax.xml.stream.XMLEventWriter createXMLEventWriter(javax.xml.transform.Result result) throws javax.xml.stream.XMLStreamException {
-
- if (result instanceof StAXResult && ((StAXResult)result).getXMLEventWriter() != null)
- return ((StAXResult)result).getXMLEventWriter();
-
- return new XMLEventWriterImpl(createXMLStreamWriter(result));
- }
-
- public javax.xml.stream.XMLEventWriter createXMLEventWriter(java.io.Writer writer) throws javax.xml.stream.XMLStreamException {
- return new XMLEventWriterImpl(createXMLStreamWriter(writer));
- }
-
- public javax.xml.stream.XMLStreamWriter createXMLStreamWriter(javax.xml.transform.Result result) throws javax.xml.stream.XMLStreamException {
-
- if (result instanceof StreamResult) {
- return createXMLStreamWriter((StreamResult) result, null);
- } else if (result instanceof DOMResult) {
- return new XMLDOMWriterImpl((DOMResult) result);
- } else if (result instanceof StAXResult) {
- if (((StAXResult) result).getXMLStreamWriter() != null) {
- return ((StAXResult) result).getXMLStreamWriter();
- } else {
- throw new java.lang.UnsupportedOperationException("Result of type " + result + " is not supported");
- }
- } else {
- if (result.getSystemId() !=null) {
- //this is not correct impl of SAXResult. Keep it for now for compatibility
- return createXMLStreamWriter(new StreamResult(result.getSystemId()));
- } else {
- throw new java.lang.UnsupportedOperationException("Result of type " + result + " is not supported. " +
- "Supported result types are: DOMResult, StAXResult and StreamResult.");
- }
- }
-
- }
-
- public javax.xml.stream.XMLStreamWriter createXMLStreamWriter(java.io.Writer writer) throws javax.xml.stream.XMLStreamException {
- return createXMLStreamWriter(toStreamResult(null, writer, null) , null);
- }
-
- public javax.xml.stream.XMLStreamWriter createXMLStreamWriter(java.io.OutputStream outputStream) throws javax.xml.stream.XMLStreamException {
- return createXMLStreamWriter(outputStream, null);
- }
-
- public javax.xml.stream.XMLStreamWriter createXMLStreamWriter(java.io.OutputStream outputStream, String encoding) throws javax.xml.stream.XMLStreamException {
- return createXMLStreamWriter(toStreamResult(outputStream, null, null) , encoding);
- }
-
- public Object getProperty(String name) throws java.lang.IllegalArgumentException {
- if(name == null){
- throw new IllegalArgumentException("Property not supported");
- }
- if(fPropertyManager.containsProperty(name))
- return fPropertyManager.getProperty(name);
- throw new IllegalArgumentException("Property not supported");
- }
-
- public boolean isPropertySupported(String name) {
- if(name == null){
- return false ;
- }
- else{
- return fPropertyManager.containsProperty(name);
- }
- }
-
- public void setProperty(String name, Object value) throws java.lang.IllegalArgumentException {
- if(name == null || value == null || !fPropertyManager.containsProperty(name) ){
- throw new IllegalArgumentException("Property "+name+"is not supported");
- }
- if(name == Constants.REUSE_INSTANCE || name.equals(Constants.REUSE_INSTANCE)){
- fReuseInstance = ((Boolean)value).booleanValue();
- if(DEBUG)System.out.println("fReuseInstance is set to " + fReuseInstance);
-
- // TODO: XMLStreamWriters are not Thread safe,
- // don't let application think it is optimizing
- if (fReuseInstance) {
- throw new IllegalArgumentException(
- "Property "
- + name
- + " is not supported: XMLStreamWriters are not Thread safe");
- }
- }else{//for any other property set the flag
- //REVISIT: Even in this case instance can be reused, by passing PropertyManager
- fPropertyChanged = true;
- }
- fPropertyManager.setProperty(name,value);
- }
-
- /** StreamResult object is re-used and the values are set appropriately.
- */
- StreamResult toStreamResult(OutputStream os, Writer writer, String systemId){
- StreamResult sr = new StreamResult();
- sr.setOutputStream(os);
- sr.setWriter(writer);
- sr.setSystemId(systemId);
- return sr;
- }
-
- javax.xml.stream.XMLStreamWriter createXMLStreamWriter(javax.xml.transform.stream.StreamResult sr, String encoding) throws javax.xml.stream.XMLStreamException {
- //if factory is configured to reuse the instance & this instance can be reused
- //& the setProperty() hasn't been called
- try{
- if(fReuseInstance && fStreamWriter != null && fStreamWriter.canReuse() && !fPropertyChanged){
- fStreamWriter.reset();
- fStreamWriter.setOutput(sr, encoding);
- if(DEBUG)System.out.println("reusing instance, object id : " + fStreamWriter);
- return fStreamWriter;
- }
- return fStreamWriter = new XMLStreamWriterImpl(sr, encoding, new PropertyManager(fPropertyManager));
- }catch(java.io.IOException io){
- throw new XMLStreamException(io);
- }
- }//createXMLStreamWriter(StreamResult,String)
-
- private static final boolean DEBUG = false;
-
- /** This flag indicates the change of property. If true,
- * <code>PropertyManager</code> should be passed when creating
- * <code>XMLStreamWriterImpl</code> */
- private boolean fPropertyChanged ;
-}//XMLOutputFactory
diff --git a/src/com/sun/xml/internal/stream/dtd/DTDGrammarUtil.java b/src/com/sun/xml/internal/stream/dtd/DTDGrammarUtil.java
deleted file mode 100644
index b1331b5..0000000
--- a/src/com/sun/xml/internal/stream/dtd/DTDGrammarUtil.java
+++ /dev/null
@@ -1,498 +0,0 @@
-/*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
- */
-
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.xml.internal.stream.dtd;
-import com.sun.xml.internal.stream.dtd.nonvalidating.DTDGrammar;
-import com.sun.xml.internal.stream.dtd.nonvalidating.XMLAttributeDecl;
-import com.sun.xml.internal.stream.dtd.nonvalidating.XMLElementDecl;
-import com.sun.xml.internal.stream.dtd.nonvalidating.XMLSimpleType;
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.XMLEntityManager;
-import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.util.XMLChar;
-import com.sun.org.apache.xerces.internal.util.XMLSymbols;
-import com.sun.org.apache.xerces.internal.xni.Augmentations;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
-import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
-import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
-import com.sun.org.apache.xerces.internal.xni.XMLLocator;
-import com.sun.org.apache.xerces.internal.xni.XMLString;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource;
-import javax.xml.XMLConstants;
-
- /*
- * @author Eric Ye, IBM
- * @author Andy Clark, IBM
- * @author Jeffrey Rodriguez IBM
- * @author Neil Graham, IBM
- * @author Sunitha Reddy, Sun Microsystems
- */
-
-public class DTDGrammarUtil {
-
-
- /** Property identifier: symbol table. */
- protected static final String SYMBOL_TABLE =
- Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY;
-
- protected static final String NAMESPACES =
- Constants.SAX_FEATURE_PREFIX + Constants.NAMESPACES_FEATURE;
-
-
- /** Compile to true to debug attributes. */
- private static final boolean DEBUG_ATTRIBUTES = false;
-
- /** Compile to true to debug element children. */
- private static final boolean DEBUG_ELEMENT_CHILDREN = false;
-
- protected DTDGrammar fDTDGrammar = null;
- /** Namespaces. */
- protected boolean fNamespaces;
-
- /** Symbol table. */
- protected SymbolTable fSymbolTable = null;
-
- /** Current element index. */
- private int fCurrentElementIndex = -1;
-
- /** Current content spec type. */
- private int fCurrentContentSpecType = -1;
-
- /** Content spec type stack. */
- private boolean[] fElementContentState = new boolean[8];
-
- /** Element depth. */
- private int fElementDepth = -1;
-
- /** True if inside of element content. */
- private boolean fInElementContent = false;
-
- /** Temporary atribute declaration. */
- private XMLAttributeDecl fTempAttDecl = new XMLAttributeDecl();
-
- /** Temporary qualified name. */
- private QName fTempQName = new QName();
-
- /** Temporary string buffers. */
- private StringBuffer fBuffer = new StringBuffer();
-
- private NamespaceContext fNamespaceContext = null;
-
- /** Default constructor. */
- public DTDGrammarUtil(SymbolTable symbolTable) {
- fSymbolTable = symbolTable;
- }
-
- public DTDGrammarUtil(DTDGrammar grammar, SymbolTable symbolTable) {
- fDTDGrammar = grammar;
- fSymbolTable = symbolTable;
- }
-
- public DTDGrammarUtil(DTDGrammar grammar, SymbolTable symbolTable,
- NamespaceContext namespaceContext) {
- fDTDGrammar = grammar;
- fSymbolTable = symbolTable;
- fNamespaceContext = namespaceContext;
- }
-
- /*
- * Resets the component. The component can query the component manager
- * about any features and properties that affect the operation of the
- * component.
- *
- * @param componentManager The component manager.
- *
- * @throws SAXException Thrown by component on finitialization error.
- * For example, if a feature or property is
- * required for the operation of the component, the
- * component manager may throw a
- * SAXNotRecognizedException or a
- * SAXNotSupportedException.
- */
- public void reset(XMLComponentManager componentManager)
- throws XMLConfigurationException {
-
- fDTDGrammar = null;
- fInElementContent = false;
- fCurrentElementIndex = -1;
- fCurrentContentSpecType = -1;
- fNamespaces = componentManager.getFeature(NAMESPACES, true);
- fSymbolTable = (SymbolTable) componentManager.getProperty(
- Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY);
- fElementDepth = -1;
- }
-
-
- /**
- * The start of an element.
- *
- * @param element The name of the element.
- * @param attributes The element attributes.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startElement(QName element, XMLAttributes attributes) throws XNIException {
- handleStartElement(element, attributes);
- }
-
- /**
- * The end of an element.
- *
- * @param element The name of the element.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endElement(QName element) throws XNIException {
- handleEndElement(element);
- }
-
- /**
- * The start of a CDATA section.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startCDATA(Augmentations augs) throws XNIException {
- }
-
- /**
- * The end of a CDATA section.
- * @param augs Additional information that may include infoset augmentations
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endCDATA(Augmentations augs) throws XNIException {
- }
-
-
-
- /** Add default attributes and validate. */
- public void addDTDDefaultAttrs(QName elementName, XMLAttributes attributes)
- throws XNIException {
-
- int elementIndex;
- elementIndex = fDTDGrammar.getElementDeclIndex(elementName);
- // is there anything to do?
- if (elementIndex == -1 || fDTDGrammar == null) {
- return;
- }
-
- //
- // Check after all specified attrs are scanned
- // (1) report error for REQUIRED attrs that are missing (V_TAGc)
- // (2) add default attrs (FIXED and NOT_FIXED)
- //
- int attlistIndex = fDTDGrammar.getFirstAttributeDeclIndex(elementIndex);
-
- while (attlistIndex != -1) {
-
- fDTDGrammar.getAttributeDecl(attlistIndex, fTempAttDecl);
-
- if (DEBUG_ATTRIBUTES) {
- if (fTempAttDecl != null) {
- XMLElementDecl elementDecl = new XMLElementDecl();
- fDTDGrammar.getElementDecl(elementIndex, elementDecl);
- System.out.println("element: " + (elementDecl.name.localpart));
- System.out.println("attlistIndex " + attlistIndex + "\n" +
- "attName : '" + (fTempAttDecl.name.localpart) + "'\n"
- + "attType : " + fTempAttDecl.simpleType.type + "\n"
- + "attDefaultType : " + fTempAttDecl.simpleType.defaultType + "\n"
- + "attDefaultValue : '" + fTempAttDecl.simpleType.defaultValue + "'\n"
- + attributes.getLength() + "\n"
- );
- }
- }
- String attPrefix = fTempAttDecl.name.prefix;
- String attLocalpart = fTempAttDecl.name.localpart;
- String attRawName = fTempAttDecl.name.rawname;
- String attType = getAttributeTypeName(fTempAttDecl);
- int attDefaultType = fTempAttDecl.simpleType.defaultType;
- String attValue = null;
-
- if (fTempAttDecl.simpleType.defaultValue != null) {
- attValue = fTempAttDecl.simpleType.defaultValue;
- }
- boolean specified = false;
- boolean required = attDefaultType == XMLSimpleType.DEFAULT_TYPE_REQUIRED;
- boolean cdata = attType == XMLSymbols.fCDATASymbol;
-
- if (!cdata || required || attValue != null) {
-
- //check whether attribute is a namespace declaration
- if (fNamespaceContext != null && attRawName.startsWith(XMLConstants.XMLNS_ATTRIBUTE)) {
- String prefix = "";
- int pos = attRawName.indexOf(':');
- if (pos != -1) {
- prefix = attRawName.substring(0, pos);
- } else {
- prefix = attRawName;
- }
- prefix = fSymbolTable.addSymbol(prefix);
- if (!((com.sun.org.apache.xerces.internal.util.
- NamespaceSupport) fNamespaceContext).
- containsPrefixInCurrentContext(prefix)) {
- fNamespaceContext.declarePrefix(prefix, attValue);
- }
- specified = true;
- } else {
-
- int attrCount = attributes.getLength();
- for (int i = 0; i < attrCount; i++) {
- if (attributes.getQName(i) == attRawName) {
- specified = true;
- break;
- }
- }
-
- }
-
- }
-
- if (!specified) {
- if (attValue != null) {
- if (fNamespaces) {
- int index = attRawName.indexOf(':');
- if (index != -1) {
- attPrefix = attRawName.substring(0, index);
- attPrefix = fSymbolTable.addSymbol(attPrefix);
- attLocalpart = attRawName.substring(index + 1);
- attLocalpart = fSymbolTable.addSymbol(attLocalpart);
- }
- }
- fTempQName.setValues(attPrefix, attLocalpart, attRawName,
- fTempAttDecl.name.uri);
- int newAttr = attributes.addAttribute(fTempQName, attType,
- attValue);
- }
- }
- attlistIndex = fDTDGrammar.getNextAttributeDeclIndex(attlistIndex);
- }
-
- // now iterate through the expanded attributes for
- // 1. if every attribute seen is declared in the DTD
- // 2. check if the VC: default_fixed holds
- // 3. validate every attribute.
- int attrCount = attributes.getLength();
- for (int i = 0; i < attrCount; i++) {
- String attrRawName = attributes.getQName(i);
- boolean declared = false;
- int position =
- fDTDGrammar.getFirstAttributeDeclIndex(elementIndex);
- while (position != -1) {
- fDTDGrammar.getAttributeDecl(position, fTempAttDecl);
- if (fTempAttDecl.name.rawname == attrRawName) {
- // found the match att decl,
- declared = true;
- break;
- }
- position = fDTDGrammar.getNextAttributeDeclIndex(position);
- }
- if (!declared) {
- continue;
- }
-
- String type = getAttributeTypeName(fTempAttDecl);
- attributes.setType(i, type);
-
- boolean changedByNormalization = false;
- if (attributes.isSpecified(i) && type != XMLSymbols.fCDATASymbol) {
- changedByNormalization = normalizeAttrValue(attributes, i);
- }
- } // for all attributes
-
- } // addDTDDefaultAttrsAndValidate(int,XMLAttrList)
-
-
- /**
- * Normalize the attribute value of a non CDATA attributes collapsing
- * sequences of space characters (x20)
- *
- * @param attributes The list of attributes
- * @param index The index of the attribute to normalize
- */
- private boolean normalizeAttrValue(XMLAttributes attributes, int index) {
- // vars
- boolean leadingSpace = true;
- boolean spaceStart = false;
- boolean readingNonSpace = false;
- int count = 0;
- int eaten = 0;
- String attrValue = attributes.getValue(index);
- char[] attValue = new char[attrValue.length()];
-
- fBuffer.setLength(0);
- attrValue.getChars(0, attrValue.length(), attValue, 0);
- for (int i = 0; i < attValue.length; i++) {
-
- if (attValue[i] == ' ') {
-
- // now the tricky part
- if (readingNonSpace) {
- spaceStart = true;
- readingNonSpace = false;
- }
-
- if (spaceStart && !leadingSpace) {
- spaceStart = false;
- fBuffer.append(attValue[i]);
- count++;
- } else {
- if (leadingSpace || !spaceStart) {
- eaten++;
- }
- }
-
- } else {
- readingNonSpace = true;
- spaceStart = false;
- leadingSpace = false;
- fBuffer.append(attValue[i]);
- count++;
- }
- }
-
- // check if the last appended character is a space.
- if (count > 0 && fBuffer.charAt(count - 1) == ' ') {
- fBuffer.setLength(count - 1);
-
- }
- String newValue = fBuffer.toString();
- attributes.setValue(index, newValue);
- return !attrValue.equals(newValue);
- }
-
-
-
- /** convert attribute type from ints to strings */
- private String getAttributeTypeName(XMLAttributeDecl attrDecl) {
-
- switch (attrDecl.simpleType.type) {
- case XMLSimpleType.TYPE_ENTITY: {
- return attrDecl.simpleType.list ? XMLSymbols.fENTITIESSymbol :
- XMLSymbols.fENTITYSymbol;
- }
- case XMLSimpleType.TYPE_ENUMERATION: {
- StringBuffer buffer = new StringBuffer();
- buffer.append('(');
- for (int i = 0; i < attrDecl.simpleType.enumeration.length; i++) {
- if (i > 0) {
- buffer.append("|");
- }
- buffer.append(attrDecl.simpleType.enumeration[i]);
- }
- buffer.append(')');
- return fSymbolTable.addSymbol(buffer.toString());
- }
- case XMLSimpleType.TYPE_ID: {
- return XMLSymbols.fIDSymbol;
- }
- case XMLSimpleType.TYPE_IDREF: {
- return attrDecl.simpleType.list ? XMLSymbols.fIDREFSSymbol :
- XMLSymbols.fIDREFSymbol;
- }
- case XMLSimpleType.TYPE_NMTOKEN: {
- return attrDecl.simpleType.list ? XMLSymbols.fNMTOKENSSymbol :
- XMLSymbols.fNMTOKENSymbol;
- }
- case XMLSimpleType.TYPE_NOTATION: {
- return XMLSymbols.fNOTATIONSymbol;
- }
- }
- return XMLSymbols.fCDATASymbol;
-
- }
-
-
- /** ensure element stack capacity */
- private void ensureStackCapacity(int newElementDepth) {
- if (newElementDepth == fElementContentState.length) {
- boolean[] newStack = new boolean[newElementDepth * 2];
- System.arraycopy(this.fElementContentState, 0, newStack, 0,
- newElementDepth);
- fElementContentState = newStack;
- }
- }
-
-
-
- /** Handle element
- * @return true if validator is removed from the pipeline
- */
- protected void handleStartElement(QName element, XMLAttributes attributes) throws XNIException {
-
- if (fDTDGrammar == null) {
- fCurrentElementIndex = -1;
- fCurrentContentSpecType = -1;
- fInElementContent = false;
- return;
- } else {
- fCurrentElementIndex = fDTDGrammar.getElementDeclIndex(element);
- fCurrentContentSpecType = fDTDGrammar.getContentSpecType(
- fCurrentElementIndex);
- //handleDTDDefaultAttrs(element,attributes);
- addDTDDefaultAttrs(element, attributes);
- }
-
- fInElementContent = fCurrentContentSpecType == XMLElementDecl.TYPE_CHILDREN;
- fElementDepth++;
- ensureStackCapacity(fElementDepth);
- fElementContentState[fElementDepth] = fInElementContent;
- }
-
-
- /** Handle end element. */
- protected void handleEndElement(QName element) throws XNIException {
- if (fDTDGrammar == null) return;
- fElementDepth--;
- if (fElementDepth < -1) {
- throw new RuntimeException("FWK008 Element stack underflow");
- }
- if (fElementDepth < 0) {
- fCurrentElementIndex = -1;
- fCurrentContentSpecType = -1;
- fInElementContent = false;
- return;
- }
- fInElementContent = fElementContentState[fElementDepth];
- }
-
- public boolean isInElementContent() {
- return fInElementContent;
- }
-
- public boolean isIgnorableWhiteSpace(XMLString text) {
- if (isInElementContent()) {
- for (int i = text.offset; i < text.offset + text.length; i++) {
- if (!XMLChar.isSpace(text.ch[i])) {
- return false;
- }
- }
- return true;
- }
- return false;
- }
-}
diff --git a/src/com/sun/xml/internal/stream/dtd/nonvalidating/DTDGrammar.java b/src/com/sun/xml/internal/stream/dtd/nonvalidating/DTDGrammar.java
deleted file mode 100644
index a389735..0000000
--- a/src/com/sun/xml/internal/stream/dtd/nonvalidating/DTDGrammar.java
+++ /dev/null
@@ -1,878 +0,0 @@
-/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.xml.internal.stream.dtd.nonvalidating;
-
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.util.XMLSymbols;
-import com.sun.org.apache.xerces.internal.xni.Augmentations;
-import com.sun.org.apache.xerces.internal.xni.QName;
-import com.sun.org.apache.xerces.internal.xni.XMLLocator;
-import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
-import com.sun.org.apache.xerces.internal.xni.XMLString;
-import com.sun.org.apache.xerces.internal.xni.XNIException;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDContentModelSource;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDSource;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * A DTD grammar. This class implements the XNI handler interfaces
- * for DTD information so that it can build the approprate validation
- * structures automatically from the callbacks.
- *
- * @author Eric Ye, IBM
- * @author Jeffrey Rodriguez, IBM
- * @author Andy Clark, IBM
- * @author Neil Graham, IBM
- *
- */
-public class DTDGrammar {
-
-
- /** Top level scope (-1). */
- public static final int TOP_LEVEL_SCOPE = -1;
-
- // private
-
- /** Chunk shift (8). */
- private static final int CHUNK_SHIFT = 8; // 2^8 = 256
-
- /** Chunk size (1 << CHUNK_SHIFT). */
- private static final int CHUNK_SIZE = (1 << CHUNK_SHIFT);
-
- /** Chunk mask (CHUNK_SIZE - 1). */
- private static final int CHUNK_MASK = CHUNK_SIZE - 1;
-
- /** Initial chunk count (1 << (10 - CHUNK_SHIFT)). */
- private static final int INITIAL_CHUNK_COUNT = (1 << (10 - CHUNK_SHIFT)); // 2^10 = 1k
-
- /** List flag (0x80). */
- private static final short LIST_FLAG = 0x80;
-
- /** List mask (~LIST_FLAG). */
- private static final short LIST_MASK = ~LIST_FLAG;
-
- // debugging
-
- /** Debug DTDGrammar. */
- private static final boolean DEBUG = false;
-
- //
- // Data
- //
-
- protected XMLDTDSource fDTDSource = null;
- protected XMLDTDContentModelSource fDTDContentModelSource = null;
-
- /** Current element index. */
- protected int fCurrentElementIndex;
-
- /** Current attribute index. */
- protected int fCurrentAttributeIndex;
-
- /** fReadingExternalDTD */
- protected boolean fReadingExternalDTD = false;
-
- /** Symbol table. */
- private SymbolTable fSymbolTable;
- private ArrayList notationDecls = new ArrayList();
-
- // element declarations
-
- /** Number of element declarations. */
- private int fElementDeclCount = 0;
-
- /** Element declaration name. */
- private QName fElementDeclName[][] = new QName[INITIAL_CHUNK_COUNT][];
-
- /**
- * Element declaration type.
- * @see XMLElementDecl
- */
- private short fElementDeclType[][] = new short[INITIAL_CHUNK_COUNT][];
-
-
- /** First attribute declaration of an element declaration. */
- private int fElementDeclFirstAttributeDeclIndex[][] = new int[INITIAL_CHUNK_COUNT][];
-
- /** Last attribute declaration of an element declaration. */
- private int fElementDeclLastAttributeDeclIndex[][] = new int[INITIAL_CHUNK_COUNT][];
-
- // attribute declarations
-
- /** Number of attribute declarations. */
- private int fAttributeDeclCount = 0 ;
-
- /** Attribute declaration name. */
- private QName fAttributeDeclName[][] = new QName[INITIAL_CHUNK_COUNT][];
-
- /**
- * Attribute declaration type.
- * @see XMLAttributeDecl
- */
- private short fAttributeDeclType[][] = new short[INITIAL_CHUNK_COUNT][];
-
- /** Attribute declaration enumeration values. */
- private String[] fAttributeDeclEnumeration[][] = new String[INITIAL_CHUNK_COUNT][][];
- private short fAttributeDeclDefaultType[][] = new short[INITIAL_CHUNK_COUNT][];
- private String fAttributeDeclDefaultValue[][] = new String[INITIAL_CHUNK_COUNT][];
- private String fAttributeDeclNonNormalizedDefaultValue[][] = new String[INITIAL_CHUNK_COUNT][];
- private int fAttributeDeclNextAttributeDeclIndex[][] = new int[INITIAL_CHUNK_COUNT][];
-
- /** Element index mapping table. */
- private final Map<String, Integer> fElementIndexMap = new HashMap<>();
-
- /** Temporary qualified name. */
- private final QName fQName = new QName();
-
- /** Temporary Attribute decl. */
- protected XMLAttributeDecl fAttributeDecl = new XMLAttributeDecl();
-
- /** Element declaration. */
- private XMLElementDecl fElementDecl = new XMLElementDecl();
-
- /** Simple type. */
- private XMLSimpleType fSimpleType = new XMLSimpleType();
-
-
- /** table of XMLElementDecl */
- Map<String, XMLElementDecl> fElementDeclTab = new HashMap<>();
-
- /** Default constructor. */
- public DTDGrammar(SymbolTable symbolTable) {
- fSymbolTable = symbolTable;
- }
-
- public int getAttributeDeclIndex(int elementDeclIndex, String attributeDeclName) {
- if (elementDeclIndex == -1) {
- return -1;
- }
- int attDefIndex = getFirstAttributeDeclIndex(elementDeclIndex);
- while (attDefIndex != -1) {
- getAttributeDecl(attDefIndex, fAttributeDecl);
-
- if (fAttributeDecl.name.rawname == attributeDeclName
- || attributeDeclName.equals(fAttributeDecl.name.rawname) ) {
- return attDefIndex;
- }
- attDefIndex = getNextAttributeDeclIndex(attDefIndex);
- }
- return -1;
- }
-
- /**
- * The start of the DTD.
- *
- * @param locator The document locator, or null if the document
- * location cannot be reported during the parsing of
- * the document DTD. However, it is <em>strongly</em>
- * recommended that a locator be supplied that can
- * at least report the base system identifier of the
- * DTD.
- *
- * @param augs Additional information that may include infoset
- * augmentations.
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void startDTD(XMLLocator locator, Augmentations augs) throws XNIException {
- } // startDTD(XMLLocator)
-
- // startExternalSubset(Augmentations)
-
- // endExternalSubset(Augmentations)
-
- /**
- * An element declaration.
- *
- * @param name The name of the element.
- * @param contentModel The element content model.
- * @param augs Additional information that may include infoset
- * augmentations.
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void elementDecl(String name, String contentModel, Augmentations augs)
- throws XNIException {
-
- XMLElementDecl tmpElementDecl = fElementDeclTab.get(name) ;
- if ( tmpElementDecl != null ) {
- if (tmpElementDecl.type == -1) {
- fCurrentElementIndex = getElementDeclIndex(name);
- }
- else {
- // duplicate element, ignored.
- return;
- }
- }
- else {
- fCurrentElementIndex = createElementDecl();//create element decl
- }
-
- XMLElementDecl elementDecl = new XMLElementDecl();
- QName elementName = new QName(null, name, name, null);
-
- elementDecl.name.setValues(elementName);
- elementDecl.scope= -1;
- if (contentModel.equals("EMPTY")) {
- elementDecl.type = XMLElementDecl.TYPE_EMPTY;
- }
- else if (contentModel.equals("ANY")) {
- elementDecl.type = XMLElementDecl.TYPE_ANY;
- }
- else if (contentModel.startsWith("(") ) {
- if (contentModel.indexOf("#PCDATA") > 0 ) {
- elementDecl.type = XMLElementDecl.TYPE_MIXED;
- }
- else {
- elementDecl.type = XMLElementDecl.TYPE_CHILDREN;
- }
- }
-
-
- //add(or set) this elementDecl to the local cache
- this.fElementDeclTab.put(name, elementDecl );
-
- fElementDecl = elementDecl;
-
-
- if ( DEBUG ) {
- System.out.println( "name = " + fElementDecl.name.localpart );
- System.out.println( "Type = " + fElementDecl.type );
- }
-
- setElementDecl(fCurrentElementIndex, fElementDecl );//set internal structure
-
- int chunk = fCurrentElementIndex >> CHUNK_SHIFT;
- ensureElementDeclCapacity(chunk);
- }
-
- /**
- * An attribute declaration.
- *
- * @param elementName The name of the element that this attribute
- * is associated with.
- * @param attributeName The name of the attribute.
- * @param type The attribute type. This value will be one of
- * the following: "CDATA", "ENTITY", "ENTITIES",
- * "ENUMERATION", "ID", "IDREF", "IDREFS",
- * "NMTOKEN", "NMTOKENS", or "NOTATION".
- * @param enumeration If the type has the value "ENUMERATION", this
- * array holds the allowed attribute values;
- * otherwise, this array is null.
- * @param defaultType The attribute default type. This value will be
- * one of the following: "#FIXED", "#IMPLIED",
- * "#REQUIRED", or null.
- * @param defaultValue The attribute default value, or null if no
- * default value is specified.
- * @param nonNormalizedDefaultValue The attribute default value with no normalization
- * performed, or null if no default value is specified.
- *
- * @param augs Additional information that may include infoset
- * augmentations.
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void attributeDecl(String elementName, String attributeName,
- String type, String[] enumeration,
- String defaultType, XMLString defaultValue,
- XMLString nonNormalizedDefaultValue, Augmentations augs) throws XNIException {
-
- if (type != XMLSymbols.fCDATASymbol && defaultValue != null) {
- normalizeDefaultAttrValue(defaultValue);
- }
-
- if ( this.fElementDeclTab.containsKey(elementName)) {
- //if ElementDecl has already being created in the Grammar then remove from table,
- //this.fElementDeclTab.remove( (String) elementName );
- }
- // then it is forward reference to a element decl, create the elementDecl first.
- else {
- fCurrentElementIndex = createElementDecl();//create element decl
-
- XMLElementDecl elementDecl = new XMLElementDecl();
- elementDecl.name.setValues(null, elementName, elementName, null);
-
- elementDecl.scope= -1;
-
- //add(or set) this elementDecl to the local cache
- this.fElementDeclTab.put(elementName, elementDecl );
-
- //set internal structure
- setElementDecl(fCurrentElementIndex, elementDecl );
- }
-
- //Get Grammar index to grammar array
- int elementIndex = getElementDeclIndex(elementName);
-
- //return, when more than one definition is provided for the same attribute of given element type
- //only the first declaration is binding and later declarations are ignored
- if (getAttributeDeclIndex(elementIndex, attributeName) != -1) {
- return;
- }
-
- fCurrentAttributeIndex = createAttributeDecl();// Create current Attribute Decl
-
- fSimpleType.clear();
- if ( defaultType != null ) {
- if ( defaultType.equals( "#FIXED") ) {
- fSimpleType.defaultType = fSimpleType.DEFAULT_TYPE_FIXED;
- } else if ( defaultType.equals( "#IMPLIED") ) {
- fSimpleType.defaultType = fSimpleType.DEFAULT_TYPE_IMPLIED;
- } else if ( defaultType.equals( "#REQUIRED") ) {
- fSimpleType.defaultType = fSimpleType.DEFAULT_TYPE_REQUIRED;
- }
- }
- if ( DEBUG ) {
- System.out.println("defaultvalue = " + defaultValue.toString() );
- }
- fSimpleType.defaultValue = defaultValue!=null ? defaultValue.toString() : null;
- fSimpleType.nonNormalizedDefaultValue = nonNormalizedDefaultValue!=null ? nonNormalizedDefaultValue.toString() : null;
- fSimpleType.enumeration = enumeration;
-
- if (type.equals("CDATA")) {
- fSimpleType.type = XMLSimpleType.TYPE_CDATA;
- }
- else if ( type.equals("ID") ) {
- fSimpleType.type = XMLSimpleType.TYPE_ID;
- }
- else if ( type.startsWith("IDREF") ) {
- fSimpleType.type = XMLSimpleType.TYPE_IDREF;
- if (type.indexOf("S") > 0) {
- fSimpleType.list = true;
- }
- }
- else if (type.equals("ENTITIES")) {
- fSimpleType.type = XMLSimpleType.TYPE_ENTITY;
- fSimpleType.list = true;
- }
- else if (type.equals("ENTITY")) {
- fSimpleType.type = XMLSimpleType.TYPE_ENTITY;
- }
- else if (type.equals("NMTOKENS")) {
- fSimpleType.type = XMLSimpleType.TYPE_NMTOKEN;
- fSimpleType.list = true;
- }
- else if (type.equals("NMTOKEN")) {
- fSimpleType.type = XMLSimpleType.TYPE_NMTOKEN;
- }
- else if (type.startsWith("NOTATION") ) {
- fSimpleType.type = XMLSimpleType.TYPE_NOTATION;
- }
- else if (type.startsWith("ENUMERATION") ) {
- fSimpleType.type = XMLSimpleType.TYPE_ENUMERATION;
- }
- else {
- // REVISIT: Report error message. -Ac
- System.err.println("!!! unknown attribute type "+type);
- }
- // REVISIT: The datatype should be stored with the attribute value
- // and not special-cased in the XMLValidator. -Ac
- //fSimpleType.datatypeValidator = fDatatypeValidatorFactory.createDatatypeValidator(type, null, facets, fSimpleType.list);
-
- fQName.setValues(null, attributeName, attributeName, null);
- fAttributeDecl.setValues( fQName, fSimpleType, false );
-
- setAttributeDecl(elementIndex, fCurrentAttributeIndex, fAttributeDecl);
-
- int chunk = fCurrentAttributeIndex >> CHUNK_SHIFT;
- ensureAttributeDeclCapacity(chunk);
- } // attributeDecl(String,String,String,String[],String,XMLString,XMLString, Augmentations)
-
- /** Returns the symbol table. */
- public SymbolTable getSymbolTable() {
- return fSymbolTable;
- } // getSymbolTable():SymbolTable
-
- /**
- * Returns the index of the first element declaration. This index
- * is then used to query more information about the element declaration.
- *
- * @see #getNextElementDeclIndex
- * @see #getElementDecl
- */
- public int getFirstElementDeclIndex() {
- return fElementDeclCount >= 0 ? 0 : -1;
- } // getFirstElementDeclIndex():int
-
- /**
- * Returns the next index of the element declaration following the
- * specified element declaration.
- *
- * @param elementDeclIndex The element declaration index.
- */
- public int getNextElementDeclIndex(int elementDeclIndex) {
- return elementDeclIndex < fElementDeclCount - 1
- ? elementDeclIndex + 1 : -1;
- } // getNextElementDeclIndex(int):int
-
- /**
- * getElementDeclIndex
- *
- * @param elementDeclName
- *
- * @return index of the elementDeclName in scope
- */
- public int getElementDeclIndex(String elementDeclName) {
- Integer mapping = fElementIndexMap.get(elementDeclName);
- if (mapping == null) {
- mapping = -1;
- }
- //System.out.println("getElementDeclIndex("+elementDeclName+") -> "+mapping);
- return mapping;
- } // getElementDeclIndex(String):int
-
- /** Returns the element decl index.
- * @param elementDeclQName qualilfied name of the element
- */
- public int getElementDeclIndex(QName elementDeclQName) {
- return getElementDeclIndex(elementDeclQName.rawname);
- } // getElementDeclIndex(QName):int
-
- /** make separate function for getting contentSpecType of element.
- * we can avoid setting of the element values.
- */
-
- public short getContentSpecType(int elementIndex){
- if (elementIndex < 0 || elementIndex >= fElementDeclCount) {
- return -1 ;
- }
-
- int chunk = elementIndex >> CHUNK_SHIFT;
- int index = elementIndex & CHUNK_MASK;
-
- if(fElementDeclType[chunk][index] == -1){
- return -1 ;
- }
- else{
- return (short) (fElementDeclType[chunk][index] & LIST_MASK);
- }
- }
-
- /**
- * getElementDecl
- *
- * @param elementDeclIndex
- * @param elementDecl The values of this structure are set by this call.
- *
- * @return True if find the element, False otherwise.
- */
- public boolean getElementDecl(int elementDeclIndex,
- XMLElementDecl elementDecl) {
-
- if (elementDeclIndex < 0 || elementDeclIndex >= fElementDeclCount) {
- return false;
- }
-
- int chunk = elementDeclIndex >> CHUNK_SHIFT;
- int index = elementDeclIndex & CHUNK_MASK;
-
- elementDecl.name.setValues(fElementDeclName[chunk][index]);
-
- if (fElementDeclType[chunk][index] == -1) {
- elementDecl.type = -1;
- elementDecl.simpleType.list = false;
- } else {
- elementDecl.type = (short) (fElementDeclType[chunk][index] & LIST_MASK);
- elementDecl.simpleType.list = (fElementDeclType[chunk][index] & LIST_FLAG) != 0;
- }
-
- elementDecl.simpleType.defaultType = -1;
- elementDecl.simpleType.defaultValue = null;
- return true;
-
- }
-
- // REVISIT: Make this getAttributeDeclCount/getAttributeDeclAt. -Ac
-
- /**
- * getFirstAttributeDeclIndex
- *
- * @param elementDeclIndex
- *
- * @return index of the first attribute for element declaration elementDeclIndex
- */
- public int getFirstAttributeDeclIndex(int elementDeclIndex) {
- int chunk = elementDeclIndex >> CHUNK_SHIFT;
- int index = elementDeclIndex & CHUNK_MASK;
-
- return fElementDeclFirstAttributeDeclIndex[chunk][index];
- } // getFirstAttributeDeclIndex
-
- /**
- * getNextAttributeDeclIndex
- *
- * @param attributeDeclIndex
- *
- * @return index of the next attribute of the attribute at attributeDeclIndex
- */
- public int getNextAttributeDeclIndex(int attributeDeclIndex) {
- int chunk = attributeDeclIndex >> CHUNK_SHIFT;
- int index = attributeDeclIndex & CHUNK_MASK;
-
- return fAttributeDeclNextAttributeDeclIndex[chunk][index];
- }
-
- /**
- * getAttributeDecl
- *
- * @param attributeDeclIndex
- * @param attributeDecl The values of this structure are set by this call.
- *
- * @return true if getAttributeDecl was able to fill in the value of attributeDecl
- */
- public boolean getAttributeDecl(int attributeDeclIndex, XMLAttributeDecl attributeDecl) {
- if (attributeDeclIndex < 0 || attributeDeclIndex >= fAttributeDeclCount) {
- return false;
- }
- int chunk = attributeDeclIndex >> CHUNK_SHIFT;
- int index = attributeDeclIndex & CHUNK_MASK;
-
- attributeDecl.name.setValues(fAttributeDeclName[chunk][index]);
-
- short attributeType;
- boolean isList;
-
- if (fAttributeDeclType[chunk][index] == -1) {
-
- attributeType = -1;
- isList = false;
- } else {
- attributeType = (short) (fAttributeDeclType[chunk][index] & LIST_MASK);
- isList = (fAttributeDeclType[chunk][index] & LIST_FLAG) != 0;
- }
- attributeDecl.simpleType.setValues(attributeType,fAttributeDeclName[chunk][index].localpart,
- fAttributeDeclEnumeration[chunk][index],
- isList, fAttributeDeclDefaultType[chunk][index],
- fAttributeDeclDefaultValue[chunk][index],
- fAttributeDeclNonNormalizedDefaultValue[chunk][index]);
- return true;
-
- } // getAttributeDecl
-
-
- /**
- * Returns whether the given attribute is of type CDATA or not
- *
- * @param elName The element name.
- * @param atName The attribute name.
- *
- * @return true if the attribute is of type CDATA
- */
- public boolean isCDATAAttribute(QName elName, QName atName) {
- int elDeclIdx = getElementDeclIndex(elName);
- if (getAttributeDecl(elDeclIdx, fAttributeDecl)
- && fAttributeDecl.simpleType.type != XMLSimpleType.TYPE_CDATA){
- return false;
- }
- return true;
- }
-
-
-
- public void printElements( ) {
- int elementDeclIndex = 0;
- XMLElementDecl elementDecl = new XMLElementDecl();
- while (getElementDecl(elementDeclIndex++, elementDecl)) {
-
- System.out.println("element decl: "+elementDecl.name+
- ", "+ elementDecl.name.rawname );
-
- }
- }
-
- public void printAttributes(int elementDeclIndex) {
- int attributeDeclIndex = getFirstAttributeDeclIndex(elementDeclIndex);
- System.out.print(elementDeclIndex);
- System.out.print(" [");
- while (attributeDeclIndex != -1) {
- System.out.print(' ');
- System.out.print(attributeDeclIndex);
- printAttribute(attributeDeclIndex);
- attributeDeclIndex = getNextAttributeDeclIndex(attributeDeclIndex);
- if (attributeDeclIndex != -1) {
- System.out.print(",");
- }
- }
- System.out.println(" ]");
- }
-
-
- protected int createElementDecl() {
- int chunk = fElementDeclCount >> CHUNK_SHIFT;
- int index = fElementDeclCount & CHUNK_MASK;
- ensureElementDeclCapacity(chunk);
- fElementDeclName[chunk][index] = new QName();
- fElementDeclType[chunk][index] = -1;
- fElementDeclFirstAttributeDeclIndex[chunk][index] = -1;
- fElementDeclLastAttributeDeclIndex[chunk][index] = -1;
- return fElementDeclCount++;
- }
-
- protected void setElementDecl(int elementDeclIndex, XMLElementDecl elementDecl) {
- if (elementDeclIndex < 0 || elementDeclIndex >= fElementDeclCount) {
- return;
- }
- int chunk = elementDeclIndex >> CHUNK_SHIFT;
- int index = elementDeclIndex & CHUNK_MASK;
-
- int scope = elementDecl.scope;
-
-
- fElementDeclName[chunk][index].setValues(elementDecl.name);
- fElementDeclType[chunk][index] = elementDecl.type;
-
-
-
- if (elementDecl.simpleType.list == true ) {
- fElementDeclType[chunk][index] |= LIST_FLAG;
- }
-
- fElementIndexMap.put(elementDecl.name.rawname, elementDeclIndex);
- }
-
-
-
-
- protected void setFirstAttributeDeclIndex(int elementDeclIndex, int newFirstAttrIndex){
-
- if (elementDeclIndex < 0 || elementDeclIndex >= fElementDeclCount) {
- return;
- }
-
- int chunk = elementDeclIndex >> CHUNK_SHIFT;
- int index = elementDeclIndex & CHUNK_MASK;
-
- fElementDeclFirstAttributeDeclIndex[chunk][index] = newFirstAttrIndex;
- }
-
-
- protected int createAttributeDecl() {
- int chunk = fAttributeDeclCount >> CHUNK_SHIFT;
- int index = fAttributeDeclCount & CHUNK_MASK;
-
- ensureAttributeDeclCapacity(chunk);
- fAttributeDeclName[chunk][index] = new QName();
- fAttributeDeclType[chunk][index] = -1;
- fAttributeDeclEnumeration[chunk][index] = null;
- fAttributeDeclDefaultType[chunk][index] = XMLSimpleType.DEFAULT_TYPE_IMPLIED;
- fAttributeDeclDefaultValue[chunk][index] = null;
- fAttributeDeclNonNormalizedDefaultValue[chunk][index] = null;
- fAttributeDeclNextAttributeDeclIndex[chunk][index] = -1;
- return fAttributeDeclCount++;
- }
-
-
- protected void setAttributeDecl(int elementDeclIndex, int attributeDeclIndex,
- XMLAttributeDecl attributeDecl) {
- int attrChunk = attributeDeclIndex >> CHUNK_SHIFT;
- int attrIndex = attributeDeclIndex & CHUNK_MASK;
- fAttributeDeclName[attrChunk][attrIndex].setValues(attributeDecl.name);
- fAttributeDeclType[attrChunk][attrIndex] = attributeDecl.simpleType.type;
-
- if (attributeDecl.simpleType.list) {
- fAttributeDeclType[attrChunk][attrIndex] |= LIST_FLAG;
- }
- fAttributeDeclEnumeration[attrChunk][attrIndex] = attributeDecl.simpleType.enumeration;
- fAttributeDeclDefaultType[attrChunk][attrIndex] = attributeDecl.simpleType.defaultType;
-
- fAttributeDeclDefaultValue[attrChunk][attrIndex] = attributeDecl.simpleType.defaultValue;
- fAttributeDeclNonNormalizedDefaultValue[attrChunk][attrIndex] = attributeDecl.simpleType.nonNormalizedDefaultValue;
-
- int elemChunk = elementDeclIndex >> CHUNK_SHIFT;
- int elemIndex = elementDeclIndex & CHUNK_MASK;
- int index = fElementDeclFirstAttributeDeclIndex[elemChunk][elemIndex];
- while (index != -1) {
- if (index == attributeDeclIndex) {
- break;
- }
- attrChunk = index >> CHUNK_SHIFT;
- attrIndex = index & CHUNK_MASK;
- index = fAttributeDeclNextAttributeDeclIndex[attrChunk][attrIndex];
- }
- if (index == -1) {
- if (fElementDeclFirstAttributeDeclIndex[elemChunk][elemIndex] == -1) {
- fElementDeclFirstAttributeDeclIndex[elemChunk][elemIndex] = attributeDeclIndex;
- } else {
- index = fElementDeclLastAttributeDeclIndex[elemChunk][elemIndex];
- attrChunk = index >> CHUNK_SHIFT;
- attrIndex = index & CHUNK_MASK;
- fAttributeDeclNextAttributeDeclIndex[attrChunk][attrIndex] = attributeDeclIndex;
- }
- fElementDeclLastAttributeDeclIndex[elemChunk][elemIndex] = attributeDeclIndex;
- }
- }
-
- public void notationDecl(String name, XMLResourceIdentifier identifier,
- Augmentations augs) throws XNIException {
-
-
- XMLNotationDecl notationDecl = new XMLNotationDecl();
- notationDecl.setValues(name,identifier.getPublicId(),identifier.getLiteralSystemId(),
- identifier.getBaseSystemId());
- notationDecls.add(notationDecl);
- }
-
- public List getNotationDecls(){
- return notationDecls;
- }
-
- //
- // Private methods
- //
- private void printAttribute(int attributeDeclIndex) {
-
- XMLAttributeDecl attributeDecl = new XMLAttributeDecl();
- if (getAttributeDecl(attributeDeclIndex, attributeDecl)) {
- System.out.print(" { ");
- System.out.print(attributeDecl.name.localpart);
- System.out.print(" }");
- }
-
- } // printAttribute(int)
-
-
-
- private void ensureElementDeclCapacity(int chunk) {
- if (chunk >= fElementDeclName.length) {
-
- fElementDeclName = resize(fElementDeclName, fElementDeclName.length * 2);
- fElementDeclType = resize(fElementDeclType, fElementDeclType.length * 2);
- fElementDeclFirstAttributeDeclIndex = resize(fElementDeclFirstAttributeDeclIndex, fElementDeclFirstAttributeDeclIndex.length * 2);
- fElementDeclLastAttributeDeclIndex = resize(fElementDeclLastAttributeDeclIndex, fElementDeclLastAttributeDeclIndex.length * 2);
- }
- else if (fElementDeclName[chunk] != null) {
- return;
- }
-
- fElementDeclName[chunk] = new QName[CHUNK_SIZE];
- fElementDeclType[chunk] = new short[CHUNK_SIZE];
- fElementDeclFirstAttributeDeclIndex[chunk] = new int[CHUNK_SIZE];
- fElementDeclLastAttributeDeclIndex[chunk] = new int[CHUNK_SIZE];
- return;
- }
-
- private void ensureAttributeDeclCapacity(int chunk) {
-
- if (chunk >= fAttributeDeclName.length) {
- fAttributeDeclName = resize(fAttributeDeclName, fAttributeDeclName.length * 2);
- fAttributeDeclType = resize(fAttributeDeclType, fAttributeDeclType.length * 2);
- fAttributeDeclEnumeration = resize(fAttributeDeclEnumeration, fAttributeDeclEnumeration.length * 2);
- fAttributeDeclDefaultType = resize(fAttributeDeclDefaultType, fAttributeDeclDefaultType.length * 2);
- fAttributeDeclDefaultValue = resize(fAttributeDeclDefaultValue, fAttributeDeclDefaultValue.length * 2);
- fAttributeDeclNonNormalizedDefaultValue = resize(fAttributeDeclNonNormalizedDefaultValue, fAttributeDeclNonNormalizedDefaultValue.length * 2);
- fAttributeDeclNextAttributeDeclIndex = resize(fAttributeDeclNextAttributeDeclIndex, fAttributeDeclNextAttributeDeclIndex.length * 2);
- }
- else if (fAttributeDeclName[chunk] != null) {
- return;
- }
-
- fAttributeDeclName[chunk] = new QName[CHUNK_SIZE];
- fAttributeDeclType[chunk] = new short[CHUNK_SIZE];
- fAttributeDeclEnumeration[chunk] = new String[CHUNK_SIZE][];
- fAttributeDeclDefaultType[chunk] = new short[CHUNK_SIZE];
- fAttributeDeclDefaultValue[chunk] = new String[CHUNK_SIZE];
- fAttributeDeclNonNormalizedDefaultValue[chunk] = new String[CHUNK_SIZE];
- fAttributeDeclNextAttributeDeclIndex[chunk] = new int[CHUNK_SIZE];
- return;
- }
-
-
- // resize chunks
-
- private static short[][] resize(short array[][], int newsize) {
- short newarray[][] = new short[newsize][];
- System.arraycopy(array, 0, newarray, 0, array.length);
- return newarray;
- }
-
- private static int[][] resize(int array[][], int newsize) {
- int newarray[][] = new int[newsize][];
- System.arraycopy(array, 0, newarray, 0, array.length);
- return newarray;
- }
-
- private static QName[][] resize(QName array[][], int newsize) {
- QName newarray[][] = new QName[newsize][];
- System.arraycopy(array, 0, newarray, 0, array.length);
- return newarray;
- }
-
- private static String[][] resize(String array[][], int newsize) {
- String newarray[][] = new String[newsize][];
- System.arraycopy(array, 0, newarray, 0, array.length);
- return newarray;
- }
-
- private static String[][][] resize(String array[][][], int newsize) {
- String newarray[][][] = new String[newsize] [][];
- System.arraycopy(array, 0, newarray, 0, array.length);
- return newarray;
- }
-
- /**
- * Normalize the attribute value of a non CDATA default attribute
- * collapsing sequences of space characters (x20)
- *
- * @param value The value to normalize
- * @return Whether the value was changed or not.
- */
- private boolean normalizeDefaultAttrValue(XMLString value) {
-
- int oldLength = value.length;
-
- boolean skipSpace = true; // skip leading spaces
- int current = value.offset;
- int end = value.offset + value.length;
- for (int i = value.offset; i < end; i++) {
- if (value.ch[i] == ' ') {
- if (!skipSpace) {
- // take the first whitespace as a space and skip the others
- value.ch[current++] = ' ';
- skipSpace = true;
- }
- else {
- // just skip it.
- }
- }
- else {
- // simply shift non space chars if needed
- if (current != i) {
- value.ch[current] = value.ch[i];
- }
- current++;
- skipSpace = false;
- }
- }
- if (current != end) {
- if (skipSpace) {
- // if we finished on a space trim it
- current--;
- }
- // set the new value length
- value.length = current - value.offset;
- return true;
- }
- return false;
- }
- public void endDTD(Augmentations augs) throws XNIException {
-
- }
-}
diff --git a/src/com/sun/xml/internal/stream/dtd/nonvalidating/XMLAttributeDecl.java b/src/com/sun/xml/internal/stream/dtd/nonvalidating/XMLAttributeDecl.java
deleted file mode 100644
index b3e8f5a..0000000
--- a/src/com/sun/xml/internal/stream/dtd/nonvalidating/XMLAttributeDecl.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
- */
-
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.xml.internal.stream.dtd.nonvalidating;
-
-import com.sun.org.apache.xerces.internal.xni.QName;
-
-/**
- */
-public class XMLAttributeDecl {
-
-
- /** name */
- public final QName name = new QName();
-
- /** simpleType */
- public final XMLSimpleType simpleType = new XMLSimpleType();
-
- /** optional */
- public boolean optional;
-
-
- /**
- * setValues
- *
- * @param name
- * @param simpleType
- * @param optional
- */
- public void setValues(QName name, XMLSimpleType simpleType, boolean optional) {
- this.name.setValues(name);
- this.simpleType.setValues(simpleType);
- this.optional = optional;
- }
-
- /**
- * clear
- */
- public void clear() {
- this.name.clear();
- this.simpleType.clear();
- this.optional = false;
- }
-
-}
diff --git a/src/com/sun/xml/internal/stream/dtd/nonvalidating/XMLElementDecl.java b/src/com/sun/xml/internal/stream/dtd/nonvalidating/XMLElementDecl.java
deleted file mode 100644
index d0d950f..0000000
--- a/src/com/sun/xml/internal/stream/dtd/nonvalidating/XMLElementDecl.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
- */
-
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.xml.internal.stream.dtd.nonvalidating;
-
-import com.sun.org.apache.xerces.internal.xni.QName;
-/**
- */
-public class XMLElementDecl {
-
- /** TYPE_ANY */
- public static final short TYPE_ANY = 0;
-
- /** TYPE_EMPTY */
- public static final short TYPE_EMPTY = 1;
-
- /** TYPE_MIXED */
- public static final short TYPE_MIXED = 2;
-
- /** TYPE_CHILDREN */
- public static final short TYPE_CHILDREN = 3;
-
- /** TYPE_SIMPLE */
- public static final short TYPE_SIMPLE = 4;
-
-
- /** name */
- public final QName name = new QName();
-
- /** scope */
- public int scope = -1;
-
- /** type */
- public short type = -1;
-
-
- /** simpleType */
- public final XMLSimpleType simpleType = new XMLSimpleType();
-
- /**
- * setValues
- *
- * @param name
- * @param scope
- * @param type
- * @param contentModelValidator
- * @param simpleType
- */
- public void setValues(QName name, int scope, short type, XMLSimpleType simpleType) {
- this.name.setValues(name);
- this.scope = scope;
- this.type = type;
- this.simpleType.setValues(simpleType);
- } // setValues
-
- /**
- * clear
- */
- public void clear() {
- this.name.clear();
- this.type = -1;
- this.scope = -1;
- this.simpleType.clear();
- } // clear
-
-} // class XMLElementDecl
diff --git a/src/com/sun/xml/internal/stream/dtd/nonvalidating/XMLNotationDecl.java b/src/com/sun/xml/internal/stream/dtd/nonvalidating/XMLNotationDecl.java
deleted file mode 100644
index a164583..0000000
--- a/src/com/sun/xml/internal/stream/dtd/nonvalidating/XMLNotationDecl.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
- */
-
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.xml.internal.stream.dtd.nonvalidating;
-
-/**
- */
-public class XMLNotationDecl {
-
- //
- // Data
- //
-
- /** name */
- public String name;
-
- /** publicId */
- public String publicId;
-
- /** systemId */
- public String systemId;
-
- /** base systemId */
- public String baseSystemId;
-
- //
- // Methods
- //
-
- /**
- * setValues
- *
- * @param name
- * @param publicId
- * @param systemId
- */
- public void setValues(String name, String publicId, String systemId, String baseSystemId) {
- this.name = name;
- this.publicId = publicId;
- this.systemId = systemId;
- this.baseSystemId = baseSystemId;
- } // setValues
-
- /**
- * clear
- */
- public void clear() {
- this.name = null;
- this.publicId = null;
- this.systemId = null;
- this.baseSystemId = null;
- } // clear
-
-} // class XMLNotationDecl
diff --git a/src/com/sun/xml/internal/stream/dtd/nonvalidating/XMLSimpleType.java b/src/com/sun/xml/internal/stream/dtd/nonvalidating/XMLSimpleType.java
deleted file mode 100644
index 31ae534..0000000
--- a/src/com/sun/xml/internal/stream/dtd/nonvalidating/XMLSimpleType.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- */
-
-/*
- * Copyright 2005 The Apache Software Foundation.
- */
-
-package com.sun.xml.internal.stream.dtd.nonvalidating;
-/**
- */
-public class XMLSimpleType {
-
- //
- // Constants
- //
-
- /** TYPE_CDATA */
- public static final short TYPE_CDATA = 0;
-
- /** TYPE_ENTITY */
- public static final short TYPE_ENTITY = 1;
-
- /** TYPE_ENUMERATION */
- public static final short TYPE_ENUMERATION = 2;
-
- /** TYPE_ID */
- public static final short TYPE_ID = 3;
-
- /** TYPE_IDREF */
- public static final short TYPE_IDREF = 4;
-
- /** TYPE_NMTOKEN */
- public static final short TYPE_NMTOKEN = 5;
-
- /** TYPE_NOTATION */
- public static final short TYPE_NOTATION = 6;
-
- /** TYPE_NAMED */
- public static final short TYPE_NAMED = 7;
-
- /** DEFAULT_TYPE_DEFAULT */
- public static final short DEFAULT_TYPE_DEFAULT = 3;
-
- /** DEFAULT_TYPE_FIXED */
- public static final short DEFAULT_TYPE_FIXED = 1;
-
- /** DEFAULT_TYPE_IMPLIED */
- public static final short DEFAULT_TYPE_IMPLIED = 0;
-
- /** DEFAULT_TYPE_REQUIRED */
- public static final short DEFAULT_TYPE_REQUIRED = 2;
-
- //
- // Data
- //
-
- /** type */
- public short type;
-
- /** name */
- public String name;
-
- /** enumeration */
- public String[] enumeration;
-
- /** list */
- public boolean list;
-
- /** defaultType */
- public short defaultType;
-
- /** defaultValue */
- public String defaultValue;
-
- /** non-normalized defaultValue */
- public String nonNormalizedDefaultValue;
-
-
- //
- // Methods
- //
-
- /**
- * setValues
- *
- * @param type
- * @param name
- * @param enumeration
- * @param list
- * @param defaultType
- * @param defaultValue
- * @param nonNormalizedDefaultValue
- * @param datatypeValidator
- */
- public void setValues(short type, String name, String[] enumeration,
- boolean list, short defaultType,
- String defaultValue, String nonNormalizedDefaultValue){
-
- this.type = type;
- this.name = name;
- // REVISIT: Should this be a copy? -Ac
- if (enumeration != null && enumeration.length > 0) {
- this.enumeration = new String[enumeration.length];
- System.arraycopy(enumeration, 0, this.enumeration, 0, this.enumeration.length);
- }
- else {
- this.enumeration = null;
- }
- this.list = list;
- this.defaultType = defaultType;
- this.defaultValue = defaultValue;
- this.nonNormalizedDefaultValue = nonNormalizedDefaultValue;
-
- } // setValues(short,String,String[],boolean,short,String,String,DatatypeValidator)
-
- /** Set values. */
- public void setValues(XMLSimpleType simpleType) {
-
- type = simpleType.type;
- name = simpleType.name;
- // REVISIT: Should this be a copy? -Ac
- if (simpleType.enumeration != null && simpleType.enumeration.length > 0) {
- enumeration = new String[simpleType.enumeration.length];
- System.arraycopy(simpleType.enumeration, 0, enumeration, 0, enumeration.length);
- }
- else {
- enumeration = null;
- }
- list = simpleType.list;
- defaultType = simpleType.defaultType;
- defaultValue = simpleType.defaultValue;
- nonNormalizedDefaultValue = simpleType.nonNormalizedDefaultValue;
-
- } // setValues(XMLSimpleType)
-
- /**
- * clear
- */
- public void clear() {
- this.type = -1;
- this.name = null;
- this.enumeration = null;
- this.list = false;
- this.defaultType = -1;
- this.defaultValue = null;
- this.nonNormalizedDefaultValue = null;
- }
-
-} // class XMLSimpleType
diff --git a/src/com/sun/xml/internal/stream/events/AttributeImpl.java b/src/com/sun/xml/internal/stream/events/AttributeImpl.java
deleted file mode 100644
index 372b2ce..0000000
--- a/src/com/sun/xml/internal/stream/events/AttributeImpl.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.xml.internal.stream.events;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.events.Attribute;
-import java.io.Writer;
-import javax.xml.stream.events.XMLEvent;
-
-
-//xxx: AttributeEvent is not really a first order event. Should we be renaming the class to AttributeImpl for consistent
-//naming convention.
-
-/**
- * Implementation of Attribute Event.
- *
- *@author Neeraj Bajaj, Sun Microsystems
- *@author K.Venugopal, Sun Microsystems
- *
- */
-
-public class AttributeImpl extends DummyEvent implements Attribute
-
-{
- //attribute value
- private String fValue;
- private String fNonNormalizedvalue;
-
- //name of the attribute
- private QName fQName;
- //attribute type
- private String fAttributeType = "CDATA";
-
-
- //A flag indicating whether this attribute was actually specified in the start-tag
- //of its element or was defaulted from the schema.
- private boolean fIsSpecified;
-
- public AttributeImpl(){
- init();
- }
- public AttributeImpl(String name, String value) {
- init();
- fQName = new QName(name);
- fValue = value;
- }
-
- public AttributeImpl(String prefix, String name, String value) {
- this(prefix, null,name, value, null,null,false );
- }
-
- public AttributeImpl(String prefix, String uri, String localPart, String value, String type) {
- this(prefix, uri, localPart, value, null, type, false);
- }
-
- public AttributeImpl(String prefix, String uri, String localPart, String value, String nonNormalizedvalue, String type, boolean isSpecified) {
- this(new QName(uri, localPart, prefix), value, nonNormalizedvalue, type, isSpecified);
- }
-
-
- public AttributeImpl(QName qname, String value, String nonNormalizedvalue, String type, boolean isSpecified) {
- init();
- fQName = qname ;
- fValue = value ;
- if(type != null && !type.equals(""))
- fAttributeType = type;
-
- fNonNormalizedvalue = nonNormalizedvalue;
- fIsSpecified = isSpecified ;
-
- }
-
- public String toString() {
- if( fQName.getPrefix() != null && fQName.getPrefix().length() > 0 )
- return fQName.getPrefix() + ":" + fQName.getLocalPart() + "='" + fValue + "'";
- else
- return fQName.getLocalPart() + "='" + fValue + "'";
- }
-
- public void setName(QName name){
- fQName = name ;
- }
-
- public QName getName() {
- return fQName;
- }
-
- public void setValue(String value){
- fValue = value;
- }
-
- public String getValue() {
- return fValue;
- }
-
- public void setNonNormalizedValue(String nonNormalizedvalue){
- fNonNormalizedvalue = nonNormalizedvalue;
- }
-
- public String getNonNormalizedValue(){
- return fNonNormalizedvalue ;
- }
-
- public void setAttributeType(String attributeType){
- fAttributeType = attributeType ;
- }
-
- /** Gets the type of this attribute, default is "CDATA */
- // We dont need to take care of default value.. implementation takes care of it.
- public String getDTDType() {
- return fAttributeType;
- }
-
- /** is this attribute is specified in the instance document */
-
- public void setSpecified(boolean isSpecified){
- fIsSpecified = isSpecified ;
- }
-
- public boolean isSpecified() {
- return fIsSpecified ;
- }
-
- protected void writeAsEncodedUnicodeEx(java.io.Writer writer)
- throws java.io.IOException
- {
- writer.write(toString());
- }
-
-
- protected void init(){
- setEventType(XMLEvent.ATTRIBUTE);
- }
-
-
-
-
-}//AttributeImpl
diff --git a/src/com/sun/xml/internal/stream/events/CharacterEvent.java b/src/com/sun/xml/internal/stream/events/CharacterEvent.java
deleted file mode 100644
index 217d90e..0000000
--- a/src/com/sun/xml/internal/stream/events/CharacterEvent.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.xml.internal.stream.events ;
-
-import javax.xml.stream.events.Characters;
-import java.io.Writer;
-import java.io.IOException;
-import javax.xml.stream.events.XMLEvent;
-import com.sun.org.apache.xerces.internal.util.XMLChar;
-
-/** Implementation of Character event.
- *
- *@author Neeraj Bajaj, Sun Microsystems
- *@author K.Venugopal, Sun Microsystems
- *
- */
-
-public class CharacterEvent extends DummyEvent
-implements Characters {
- /* data */
- private String fData;
- /*true if fData is CData */
- private boolean fIsCData;
- /* true if fData is ignorableWhitespace*/
- private boolean fIsIgnorableWhitespace;
- /* true if fData contet is whitespace*/
- private boolean fIsSpace = false;
- /*used to prevent scanning of data multiple times */
- private boolean fCheckIfSpaceNeeded = true;
-
- public CharacterEvent() {
- fIsCData = false;
- init();
- }
-
- /**
- *
- * @param data Character Data.
- */
- public CharacterEvent(String data) {
- fIsCData = false;
- init();
- fData = data;
- }
-
- /**
- *
- * @param data Character Data.
- * @param flag true if CData
- */
- public CharacterEvent(String data, boolean flag) {
- init();
- fData = data;
- fIsCData = flag;
- }
-
- /**
- *
- * @param data Character Data.
- * @param flag true if CData
- * @param isIgnorableWhiteSpace true if data is ignorable whitespace.
- */
- public CharacterEvent(String data, boolean flag, boolean isIgnorableWhiteSpace) {
- init();
- fData = data;
- fIsCData = flag;
- fIsIgnorableWhitespace = isIgnorableWhiteSpace ;
- }
-
- protected void init() {
- setEventType(XMLEvent.CHARACTERS);
- }
-
- /**
- *
- * @return return data.
- */
- public String getData() {
- return fData;
- }
-
- /**
- *
- * @param String data
- */
- public void setData(String data){
- fData = data;
- fCheckIfSpaceNeeded = true;
- }
-
- /**
- *
- * @return boolean returns true if the data is CData
- */
- public boolean isCData() {
- return fIsCData;
- }
-
- /**
- *
- * @return String return the String representation of this event.
- */
- public String toString() {
- if(fIsCData)
- return "<![CDATA[" + getData() + "]]>";
- else
- return fData;
- }
-
- /** This method will write the XMLEvent as per the XML 1.0 specification as Unicode characters.
- * No indentation or whitespace should be outputted.
- *
- * Any user defined event type SHALL have this method
- * called when being written to on an output stream.
- * Built in Event types MUST implement this method,
- * but implementations MAY choose not call these methods
- * for optimizations reasons when writing out built in
- * Events to an output stream.
- * The output generated MUST be equivalent in terms of the
- * infoset expressed.
- *
- * @param writer The writer that will output the data
- * @throws XMLStreamException if there is a fatal error writing the event
- */
- protected void writeAsEncodedUnicodeEx(Writer writer) throws IOException
- {
- if (fIsCData) {
- writer.write("<![CDATA[" + getData() + "]]>");
- } else {
- charEncode(writer, fData);
- }
- }
-
- /**
- * Return true if this is ignorableWhiteSpace. If
- * this event is ignorableWhiteSpace its event type will
- * be SPACE.
- * @return
- */
- public boolean isIgnorableWhiteSpace() {
- return fIsIgnorableWhitespace;
- }
-
- /**
- * Returns true if this set of Characters
- * is all whitespace. Whitspace inside a document
- * is reported as CHARACTERS. This method allows
- * checking of CHARACTERS events to see if they
- * are composed of only whitespace characters
- * @return
- */
- public boolean isWhiteSpace() {
- //no synchronization checks made.
- if(fCheckIfSpaceNeeded){
- checkWhiteSpace();
- fCheckIfSpaceNeeded = false;
- }
- return fIsSpace;
- }
-
- private void checkWhiteSpace(){
- //for now - remove dependancy of XMLChar
- if(fData != null && fData.length() >0 ){
- fIsSpace = true;
- for(int i=0;i<fData.length();i++){
- if(!XMLChar.isSpace(fData.charAt(i))){
- fIsSpace = false;
- break;
- }
- }
- }
- }
-}
diff --git a/src/com/sun/xml/internal/stream/events/CommentEvent.java b/src/com/sun/xml/internal/stream/events/CommentEvent.java
deleted file mode 100644
index 617b3d2..0000000
--- a/src/com/sun/xml/internal/stream/events/CommentEvent.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.xml.internal.stream.events ;
-
-import javax.xml.stream.events.Comment;
-import javax.xml.stream.events.XMLEvent;
-
-/**
- * This class contains information about Comment event.
- *
- * @author Neeraj Bajaj, Sun Microsystems.
- */
-public class CommentEvent extends DummyEvent implements Comment {
-
- /* String data for this event */
- private String fText ;
-
- public CommentEvent() {
- init();
- }
-
- public CommentEvent(String text) {
- init();
- fText = text;
- }
-
- protected void init() {
- setEventType(XMLEvent.COMMENT);
- }
-
- /**
- * @return String String representation of this event
- */
- public String toString() {
- return "<!--" + getText() + "-->";
- }
-
-
- /** Return the string data of the comment, returns empty string if it
- * does not exist
- * @return String
- */
- public String getText() {
- return fText ;
- }
-
- protected void writeAsEncodedUnicodeEx(java.io.Writer writer)
- throws java.io.IOException
- {
- writer.write("<!--" + getText() + "-->");
- }
-
-}
diff --git a/src/com/sun/xml/internal/stream/events/DTDEvent.java b/src/com/sun/xml/internal/stream/events/DTDEvent.java
deleted file mode 100644
index 9b81520..0000000
--- a/src/com/sun/xml/internal/stream/events/DTDEvent.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.xml.internal.stream.events;
-
-import javax.xml.stream.events.DTD;
-import javax.xml.stream.events.XMLEvent;
-
-/**
- *
- * @author Neeraj Bajaj, Sun Microsystesm.
- *
- */
-public class DTDEvent extends DummyEvent implements DTD{
-
- private String fDoctypeDeclaration;
- private java.util.List fNotations;
- private java.util.List fEntities;
-
- /** Creates a new instance of DTDEvent */
- public DTDEvent() {
- init();
- }
-
- public DTDEvent(String doctypeDeclaration){
- init();
- fDoctypeDeclaration = doctypeDeclaration;
- }
-
- public void setDocumentTypeDeclaration(String doctypeDeclaration){
- fDoctypeDeclaration = doctypeDeclaration;
- }
-
- public String getDocumentTypeDeclaration() {
- return fDoctypeDeclaration;
- }
-
- //xxx: we can change the signature if the implementation doesn't store the entities in List Datatype.
- //and then convert that DT to list format here. That way callee dont need to bother about conversion
-
- public void setEntities(java.util.List entites){
- fEntities = entites;
- }
-
- public java.util.List getEntities() {
- return fEntities;
- }
-
- //xxx: we can change the signature if the implementation doesn't store the entities in List Datatype.
- //and then convert that DT to list format here. That way callee dont need to bother about conversion
-
- public void setNotations(java.util.List notations){
- fNotations = notations;
- }
-
- public java.util.List getNotations() {
- return fNotations;
- }
-
- /**
- *Returns an implementation defined representation of the DTD.
- * This method may return null if no representation is available.
- *
- */
- public Object getProcessedDTD() {
- return null;
- }
-
- protected void init(){
- setEventType(XMLEvent.DTD);
- }
-
- public String toString(){
- return fDoctypeDeclaration ;
- }
-
- protected void writeAsEncodedUnicodeEx(java.io.Writer writer)
- throws java.io.IOException
- {
- writer.write(fDoctypeDeclaration);
- }
-}
diff --git a/src/com/sun/xml/internal/stream/events/DummyEvent.java b/src/com/sun/xml/internal/stream/events/DummyEvent.java
deleted file mode 100644
index a918a9c..0000000
--- a/src/com/sun/xml/internal/stream/events/DummyEvent.java
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.xml.internal.stream.events ;
-
-import java.io.IOException;
-import java.io.Writer;
-import javax.xml.stream.events.XMLEvent;
-import javax.xml.stream.events.Characters;
-import javax.xml.stream.events.EndElement;
-import javax.xml.stream.events.StartElement;
-import javax.xml.namespace.QName;
-import javax.xml.stream.Location;
-import javax.xml.stream.XMLStreamException;
-
-/** DummyEvent is an abstract class. It provides functionality for most of the
- * function of XMLEvent.
- *
- * @author Neeraj Bajaj Sun Microsystems,Inc.
- * @author K.Venugopal Sun Microsystems,Inc.
- *
- */
-
-public abstract class DummyEvent implements XMLEvent {
- // Make sure that getLocation() never returns null. Instead, return this dummy location
- // that indicates "nowhere" as effectively as possible.
- private static DummyLocation nowhere = new DummyLocation();
-
- /* Event type this event corresponds to */
- private int fEventType;
- protected Location fLocation = (Location) nowhere;
-
- public DummyEvent() {
- }
-
- public DummyEvent(int i) {
- fEventType = i;
- }
-
- public int getEventType() {
- return fEventType;
- }
-
- protected void setEventType(int eventType){
- fEventType = eventType;
- }
-
-
- public boolean isStartElement() {
- return fEventType == XMLEvent.START_ELEMENT;
- }
-
- public boolean isEndElement() {
- return fEventType == XMLEvent.END_ELEMENT;
- }
-
- public boolean isEntityReference() {
- return fEventType == XMLEvent.ENTITY_REFERENCE;
- }
-
- public boolean isProcessingInstruction() {
- return fEventType == XMLEvent.PROCESSING_INSTRUCTION;
- }
-
- public boolean isCharacterData() {
- return fEventType == XMLEvent.CHARACTERS;
- }
-
- public boolean isStartDocument() {
- return fEventType == XMLEvent.START_DOCUMENT;
- }
-
- public boolean isEndDocument() {
- return fEventType == XMLEvent.END_DOCUMENT;
- }
-
- public Location getLocation(){
- return fLocation;
- }
-
- void setLocation(Location loc){
- if (loc == null) {
- fLocation = nowhere;
- } else {
- fLocation = loc;
- }
- }
-
- /** Returns this event as Characters, may result in
- * a class cast exception if this event is not Characters.
- */
- public Characters asCharacters() {
- return (Characters)this;
- }
-
- /** Returns this event as an end element event, may result in
- * a class cast exception if this event is not a end element.
- */
- public EndElement asEndElement() {
- return (EndElement)this;
- }
-
- /** Returns this event as a start element event, may result in
- * a class cast exception if this event is not a start element.
- */
- public StartElement asStartElement() {
- return (StartElement)this;
- }
-
- /** This method is provided for implementations to provide
- * optional type information about the associated event.
- * It is optional and will return null if no information
- * is available.
- */
- public QName getSchemaType() {
- //Base class will take care of providing extra information about this event.
- return null;
- }
-
- /** A utility function to check if this event is an Attribute.
- * @see Attribute
- */
- public boolean isAttribute() {
- return fEventType == XMLEvent.ATTRIBUTE;
- }
-
- /** A utility function to check if this event is Characters.
- * @see Characters
- */
- public boolean isCharacters() {
- return fEventType == XMLEvent.CHARACTERS;
- }
-
- /** A utility function to check if this event is a Namespace.
- * @see Namespace
- */
- public boolean isNamespace() {
- return fEventType == XMLEvent.NAMESPACE;
- }
-
- /** This method will write the XMLEvent as per the XML 1.0 specification as Unicode characters.
- * No indentation or whitespace should be outputted.
- *
- * Any user defined event type SHALL have this method
- * called when being written to on an output stream.
- * Built in Event types MUST implement this method,
- * but implementations MAY choose not call these methods
- * for optimizations reasons when writing out built in
- * Events to an output stream.
- * The output generated MUST be equivalent in terms of the
- * infoset expressed.
- *
- * @param writer The writer that will output the data
- * @throws XMLStreamException if there is a fatal error writing the event
- */
- public void writeAsEncodedUnicode(Writer writer) throws XMLStreamException {
- try {
- writeAsEncodedUnicodeEx(writer);
- } catch (IOException e) {
- throw new XMLStreamException(e);
- }
- }
- /** Helper method in order to expose IOException.
- * @param writer The writer that will output the data
- * @throws XMLStreamException if there is a fatal error writing the event
- * @throws IOException if there is an IO error
- */
- protected abstract void writeAsEncodedUnicodeEx(Writer writer)
- throws IOException, XMLStreamException;
-
- /** Helper method to escape < > & for characters event and
- * quotes, lt and amps for Entity
- */
- protected void charEncode(Writer writer, String data)
- throws IOException
- {
- if (data == null || data == "") return;
- int i = 0, start = 0;
- int len = data.length();
-
- loop:
- for (; i < len; ++i) {
- switch (data.charAt(i)) {
- case '<':
- writer.write(data, start, i - start);
- writer.write("&lt;");
- start = i + 1;
- break;
-
- case '&':
- writer.write(data, start, i - start);
- writer.write("&amp;");
- start = i + 1;
- break;
-
- case '>':
- writer.write(data, start, i - start);
- writer.write("&gt;");
- start = i + 1;
- break;
- case '"':
- writer.write(data, start, i - start);
- writer.write("&quot;");
- start = i + 1;
- break;
- }
- }
- // Write any pending data
- writer.write(data, start, len - start);
- }
-
- static class DummyLocation implements Location {
- public DummyLocation() {
- }
-
- public int getCharacterOffset() {
- return -1;
- }
-
- public int getColumnNumber() {
- return -1;
- }
-
- public int getLineNumber() {
- return -1;
- }
-
- public String getPublicId() {
- return null;
- }
-
- public String getSystemId() {
- return null;
- }
- }
-}
diff --git a/src/com/sun/xml/internal/stream/events/EndDocumentEvent.java b/src/com/sun/xml/internal/stream/events/EndDocumentEvent.java
deleted file mode 100644
index 12a91c2..0000000
--- a/src/com/sun/xml/internal/stream/events/EndDocumentEvent.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.xml.internal.stream.events ;
-
-import javax.xml.stream.events.EndDocument;
-import java.io.Writer;
-import javax.xml.stream.XMLStreamConstants;
-
-/**
- * This class contains information about EndDocument event.
- *
- * @author Neeraj Bajaj, Sun Microsystems.
- */
-
-
-public class EndDocumentEvent extends DummyEvent
-implements EndDocument {
-
- public EndDocumentEvent() {
- init();
- }
-
- protected void init() {
- setEventType(XMLStreamConstants.END_DOCUMENT);
- }
-
- public String toString() {
- return "ENDDOCUMENT";
- }
-
- protected void writeAsEncodedUnicodeEx(java.io.Writer writer)
- throws java.io.IOException
- {
- //end document
- }
-
-
-}
diff --git a/src/com/sun/xml/internal/stream/events/EndElementEvent.java b/src/com/sun/xml/internal/stream/events/EndElementEvent.java
deleted file mode 100644
index c441d42..0000000
--- a/src/com/sun/xml/internal/stream/events/EndElementEvent.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.xml.internal.stream.events ;
-
-import java.util.List;
-import java.util.ArrayList;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.events.EndElement;
-import javax.xml.stream.events.Namespace;
-import java.io.Writer;
-import java.util.Iterator;
-import javax.xml.stream.events.XMLEvent;
-import com.sun.xml.internal.stream.util.ReadOnlyIterator;
-
-/** Implementation of EndElement event.
- *
- * @author Neeraj Bajaj Sun Microsystems,Inc.
- * @author K.Venugopal Sun Microsystems,Inc.
- */
-
-public class EndElementEvent extends DummyEvent
-implements EndElement {
-
- List fNamespaces = null;
- QName fQName ;
-
- public EndElementEvent() {
- init();
- }
-
- protected void init() {
- setEventType(XMLEvent.END_ELEMENT);
- fNamespaces = new ArrayList();
- }
-
-
- public EndElementEvent(String prefix, String uri, String localpart) {
- this(new QName(uri,localpart,prefix));
- }
-
- public EndElementEvent(QName qname) {
- this.fQName = qname;
- init();
- }
-
- public QName getName() {
- return fQName;
- }
-
- public void setName(QName qname) {
- this.fQName = qname;
- }
-
- protected void writeAsEncodedUnicodeEx(java.io.Writer writer)
- throws java.io.IOException
- {
- writer.write("</");
- String prefix = fQName.getPrefix();
- if (prefix != null && prefix.length() > 0) {
- writer.write(prefix);
- writer.write(':');
- }
- writer.write(fQName.getLocalPart());
- writer.write('>');
- }
-
- /** Returns an Iterator of namespaces that have gone out
- * of scope. Returns an empty iterator if no namespaces have gone
- * out of scope.
- * @return an Iterator over Namespace interfaces, or an
- * empty iterator
- */
- public Iterator getNamespaces() {
- if(fNamespaces != null)
- fNamespaces.iterator();
- return new ReadOnlyIterator();
- }
-
- void addNamespace(Namespace attr){
- if(attr != null){
- fNamespaces.add(attr);
- }
- }
-
- public String toString() {
- String s = "</" + nameAsString();
- s = s + ">";
- return s;
- }
-
- public String nameAsString() {
- if("".equals(fQName.getNamespaceURI()))
- return fQName.getLocalPart();
- if(fQName.getPrefix() != null)
- return "['" + fQName.getNamespaceURI() + "']:" + fQName.getPrefix() + ":" + fQName.getLocalPart();
- else
- return "['" + fQName.getNamespaceURI() + "']:" + fQName.getLocalPart();
- }
-
-}
diff --git a/src/com/sun/xml/internal/stream/events/EntityDeclarationImpl.java b/src/com/sun/xml/internal/stream/events/EntityDeclarationImpl.java
deleted file mode 100644
index e4b36ec..0000000
--- a/src/com/sun/xml/internal/stream/events/EntityDeclarationImpl.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.xml.internal.stream.events;
-
-import javax.xml.stream.events.EntityDeclaration;
-import javax.xml.stream.events.XMLEvent;
-import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
-
-/**
- *
- * This class store all the information for a particular EntityDeclaration. EntityDeclaration interface
- * has various get* functiosn to retirve information about a particular EntityDeclaration.
- *
- * @author Neeraj Bajaj, Sun Microsystems.
- */
-public class EntityDeclarationImpl extends DummyEvent implements EntityDeclaration {
-
- private XMLResourceIdentifier fXMLResourceIdentifier ;
- private String fEntityName;
- private String fReplacementText;
- private String fNotationName;
-
- /** Creates a new instance of EntityDeclarationImpl */
- public EntityDeclarationImpl() {
- init();
- }
-
- public EntityDeclarationImpl(String entityName , String replacementText){
- this(entityName,replacementText,null);
-
- }
-
- public EntityDeclarationImpl(String entityName, String replacementText, XMLResourceIdentifier resourceIdentifier){
- init();
- fEntityName = entityName;
- fReplacementText = replacementText;
- fXMLResourceIdentifier = resourceIdentifier;
- }
-
- public void setEntityName(String entityName){
- fEntityName = entityName;
- }
-
- public String getEntityName(){
- return fEntityName;
- }
-
- public void setEntityReplacementText(String replacementText){
- fReplacementText = replacementText;
- }
-
- public void setXMLResourceIdentifier(XMLResourceIdentifier resourceIdentifier){
- fXMLResourceIdentifier = resourceIdentifier ;
- }
-
- public XMLResourceIdentifier getXMLResourceIdentifier(){
- return fXMLResourceIdentifier;
- }
-
- public String getSystemId(){
- if(fXMLResourceIdentifier != null)
- return fXMLResourceIdentifier.getLiteralSystemId();
- return null;
- }
-
- public String getPublicId(){
- if(fXMLResourceIdentifier != null)
- return fXMLResourceIdentifier.getPublicId();
-
- return null;
- }
-
- public String getBaseURI() {
- if(fXMLResourceIdentifier != null)
- return fXMLResourceIdentifier.getBaseSystemId();
- return null;
- }
-
- public String getName(){
- return fEntityName;
- }
-
- public String getNotationName() {
- return fNotationName;
- }
-
- public void setNotationName(String notationName){
- fNotationName = notationName;
- }
-
- public String getReplacementText() {
- return fReplacementText;
- }
-
- protected void init(){
- setEventType(XMLEvent.ENTITY_DECLARATION);
- }
-
- protected void writeAsEncodedUnicodeEx(java.io.Writer writer)
- throws java.io.IOException
- {
- writer.write("<!ENTITY ");
- writer.write(fEntityName);
- if (fReplacementText != null) {
- //internal entity
- //escape quotes, lt and amps
- writer.write(" \"");
- charEncode(writer, fReplacementText);
- } else {
- //external entity
- String pubId = getPublicId();
- if (pubId != null) {
- writer.write(" PUBLIC \"");
- writer.write(pubId);
- } else {
- writer.write(" SYSTEM \"");
- writer.write(getSystemId());
- }
- }
- writer.write("\"");
- if (fNotationName != null) {
- writer.write(" NDATA ");
- writer.write(fNotationName);
- }
- writer.write(">");
- }
-}
diff --git a/src/com/sun/xml/internal/stream/events/EntityReferenceEvent.java b/src/com/sun/xml/internal/stream/events/EntityReferenceEvent.java
deleted file mode 100644
index ac6abd6..0000000
--- a/src/com/sun/xml/internal/stream/events/EntityReferenceEvent.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.xml.internal.stream.events ;
-
-import javax.xml.stream.events.EntityReference;
-import java.io.Writer;
-import javax.xml.stream.events.EntityDeclaration;
-import javax.xml.stream.events.XMLEvent;
-
-/** Implements EntityReference event.
- *
- *@author Neeraj Bajaj, Sun Microsystems,
- */
-public class EntityReferenceEvent extends DummyEvent
-implements EntityReference {
- private EntityDeclaration fEntityDeclaration ;
- private String fEntityName;
-
- public EntityReferenceEvent() {
- init();
- }
-
- public EntityReferenceEvent(String entityName , EntityDeclaration entityDeclaration) {
- init();
- fEntityName = entityName;
- fEntityDeclaration = entityDeclaration ;
- }
-
- public String getName() {
- return fEntityName;
- }
-
- public String toString() {
- String text = fEntityDeclaration.getReplacementText();
- if(text == null)
- text = "";
- return "&" + getName() + ";='" + text + "'";
- }
-
- protected void writeAsEncodedUnicodeEx(java.io.Writer writer)
- throws java.io.IOException
- {
- writer.write('&');
- writer.write(getName());
- writer.write(';');
- }
-
- public EntityDeclaration getDeclaration(){
- return fEntityDeclaration ;
- }
-
- protected void init() {
- setEventType(XMLEvent.ENTITY_REFERENCE);
- }
-
-
-}
diff --git a/src/com/sun/xml/internal/stream/events/LocationImpl.java b/src/com/sun/xml/internal/stream/events/LocationImpl.java
deleted file mode 100644
index a4b9b32..0000000
--- a/src/com/sun/xml/internal/stream/events/LocationImpl.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.xml.internal.stream.events;
-
-import javax.xml.stream.Location;
-
-/**
- *Implementation of Location interface to be used by
- *event readers.
- *@author Neeraj.bajaj@sun.com,k.venugopal@sun.com
- */
-public class LocationImpl implements Location{
- String systemId;
- String publicId;
- int colNo;
- int lineNo;
- int charOffset;
- LocationImpl(Location loc){
- systemId = loc.getSystemId();
- publicId = loc.getPublicId();
- lineNo = loc.getLineNumber();
- colNo = loc.getColumnNumber();
- charOffset = loc.getCharacterOffset();
- }
-
- public int getCharacterOffset(){
- return charOffset;
- }
-
- public int getColumnNumber() {
- return colNo;
- }
-
- public int getLineNumber(){
- return lineNo;
- }
-
- public String getPublicId(){
- return publicId;
- }
-
- public String getSystemId(){
- return systemId;
- }
-
- public String toString(){
- StringBuffer sbuffer = new StringBuffer() ;
- sbuffer.append("Line number = " + getLineNumber());
- sbuffer.append("\n") ;
- sbuffer.append("Column number = " + getColumnNumber());
- sbuffer.append("\n") ;
- sbuffer.append("System Id = " + getSystemId());
- sbuffer.append("\n") ;
- sbuffer.append("Public Id = " + getPublicId());
- sbuffer.append("\n") ;
- sbuffer.append("CharacterOffset = " + getCharacterOffset());
- sbuffer.append("\n") ;
- return sbuffer.toString();
- }
-
-}
diff --git a/src/com/sun/xml/internal/stream/events/NamedEvent.java b/src/com/sun/xml/internal/stream/events/NamedEvent.java
deleted file mode 100644
index f1488a9..0000000
--- a/src/com/sun/xml/internal/stream/events/NamedEvent.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.xml.internal.stream.events ;
-
-import javax.xml.namespace.QName;
-/**
- *
- *@author Neeraj Bajaj, Sun Microsystems
- *
- */
-public class NamedEvent extends DummyEvent {
-
- private QName name;
-
- public NamedEvent() {
- }
-
-
- public NamedEvent(QName qname) {
- this.name = qname;
- }
-
-
- public NamedEvent(String prefix, String uri, String localpart) {
- this.name = new QName(uri, localpart, prefix);
- }
-
- public String getPrefix() {
- return this.name.getPrefix();
- }
-
-
- public QName getName() {
- return name;
- }
-
- public void setName(QName qname) {
- this.name = qname;
- }
-
- public String nameAsString() {
- if("".equals(name.getNamespaceURI()))
- return name.getLocalPart();
- if(name.getPrefix() != null)
- return "['" + name.getNamespaceURI() + "']:" + getPrefix() + ":" + name.getLocalPart();
- else
- return "['" + name.getNamespaceURI() + "']:" + name.getLocalPart();
- }
-
- public String getNamespace(){
- return name.getNamespaceURI();
- }
-
- protected void writeAsEncodedUnicodeEx(java.io.Writer writer)
- throws java.io.IOException
- {
- writer.write(nameAsString());
- }
-
-}
diff --git a/src/com/sun/xml/internal/stream/events/NamespaceImpl.java b/src/com/sun/xml/internal/stream/events/NamespaceImpl.java
deleted file mode 100644
index 814bea1..0000000
--- a/src/com/sun/xml/internal/stream/events/NamespaceImpl.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.xml.internal.stream.events;
-
-import javax.xml.stream.events.Namespace;
-import javax.xml.stream.events.XMLEvent;
-import javax.xml.namespace.QName;
-
-import javax.xml.XMLConstants;
-/**
- *
- * @author Neeraj Bajaj,K.Venugopal@sun.com Sun Microsystems.
- */
-public class NamespaceImpl extends AttributeImpl implements Namespace{
-
- public NamespaceImpl( ) {
- init();
- }
-
- /** Creates a new instance of NamespaceImpl */
- public NamespaceImpl(String namespaceURI) {
- super(XMLConstants.XMLNS_ATTRIBUTE,XMLConstants.XMLNS_ATTRIBUTE_NS_URI,XMLConstants.DEFAULT_NS_PREFIX,namespaceURI,null);
- init();
- }
-
- public NamespaceImpl(String prefix, String namespaceURI){
- super(XMLConstants.XMLNS_ATTRIBUTE,XMLConstants.XMLNS_ATTRIBUTE_NS_URI,prefix,namespaceURI,null);
- init();
- }
-
- public boolean isDefaultNamespaceDeclaration() {
- QName name = this.getName();
-
- if(name != null && (name.getLocalPart().equals(XMLConstants.DEFAULT_NS_PREFIX)))
- return true;
- return false;
- }
-
- void setPrefix(String prefix){
- if(prefix == null)
- setName(new QName(XMLConstants.XMLNS_ATTRIBUTE_NS_URI,XMLConstants.DEFAULT_NS_PREFIX,XMLConstants.XMLNS_ATTRIBUTE));
- else// new QName(uri, localpart, prefix)
- setName(new QName(XMLConstants.XMLNS_ATTRIBUTE_NS_URI,prefix,XMLConstants.XMLNS_ATTRIBUTE));
- }
-
- public String getPrefix() {
- //for a namespace declaration xmlns:prefix="uri" to get the prefix we have to get the
- //local name if this declaration is stored as QName.
- QName name = this.getName();
- if(name != null)
- return name.getLocalPart();
- return null;
- }
-
- public String getNamespaceURI() {
- //we are treating namespace declaration as attribute -- so URI is stored as value
- //xmlns:prefix="Value"
- return this.getValue();
- }
-
- void setNamespaceURI(String uri) {
- //we are treating namespace declaration as attribute -- so URI is stored as value
- //xmlns:prefix="Value"
- this.setValue(uri);
- }
-
- protected void init(){
- setEventType(XMLEvent.NAMESPACE);
- }
-
- public int getEventType(){
- return XMLEvent.NAMESPACE;
- }
-
- public boolean isNamespace(){
- return true;
- }
-}
diff --git a/src/com/sun/xml/internal/stream/events/NotationDeclarationImpl.java b/src/com/sun/xml/internal/stream/events/NotationDeclarationImpl.java
deleted file mode 100644
index af3d949..0000000
--- a/src/com/sun/xml/internal/stream/events/NotationDeclarationImpl.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.xml.internal.stream.events;
-
-import javax.xml.stream.events.NotationDeclaration;
-import javax.xml.stream.events.XMLEvent;
-import com.sun.xml.internal.stream.dtd.nonvalidating.XMLNotationDecl;
-
-/**
- * Implementation of NotationDeclaration event.
- *
- * @author k.venugopal@sun.com
- */
-public class NotationDeclarationImpl extends DummyEvent implements NotationDeclaration {
-
- String fName = null;
- String fPublicId = null;
- String fSystemId = null;
-
- /** Creates a new instance of NotationDeclarationImpl */
- public NotationDeclarationImpl() {
- setEventType(XMLEvent.NOTATION_DECLARATION);
- }
-
- public NotationDeclarationImpl(String name,String publicId,String systemId){
- this.fName = name;
- this.fPublicId = publicId;
- this.fSystemId = systemId;
- setEventType(XMLEvent.NOTATION_DECLARATION);
- }
-
- public NotationDeclarationImpl(XMLNotationDecl notation){
- this.fName = notation.name;
- this.fPublicId = notation.publicId;
- this.fSystemId = notation.systemId;
- setEventType(XMLEvent.NOTATION_DECLARATION);
- }
-
- public String getName() {
- return fName;
- }
-
- public String getPublicId() {
- return fPublicId;
- }
-
- public String getSystemId() {
- return fSystemId;
- }
-
- void setPublicId(String publicId){
- this.fPublicId = publicId;
- }
-
- void setSystemId(String systemId){
- this.fSystemId = systemId;
- }
-
- void setName(String name){
- this.fName = name;
- }
-
- protected void writeAsEncodedUnicodeEx(java.io.Writer writer)
- throws java.io.IOException
- {
- writer.write("<!NOTATION ");
- writer.write(getName());
- if (fPublicId != null) {
- writer.write(" PUBLIC \"");
- writer.write(fPublicId);
- writer.write("\"");
- } else if (fSystemId != null) {
- writer.write(" SYSTEM");
- writer.write(" \"");
- writer.write(fSystemId);
- writer.write("\"");
- }
- writer.write('>');
- }
-}
diff --git a/src/com/sun/xml/internal/stream/events/ProcessingInstructionEvent.java b/src/com/sun/xml/internal/stream/events/ProcessingInstructionEvent.java
deleted file mode 100644
index e1952b2..0000000
--- a/src/com/sun/xml/internal/stream/events/ProcessingInstructionEvent.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.xml.internal.stream.events ;
-
-import java.io.Writer;
-import javax.xml.stream.Location;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.events.ProcessingInstruction;
-
-/** Implements Processing Instruction Event
- *
- *@author Neeraj Bajaj, Sun Microsystems.
- *
- */
-
-
-public class ProcessingInstructionEvent extends DummyEvent
-implements ProcessingInstruction {
-
- /** Processing Instruction Name */
- private String fName;
- /** Processsing instruction content */
- private String fContent;
-
- public ProcessingInstructionEvent() {
- init();
- }
-
- public ProcessingInstructionEvent(String targetName, String data) {
- this(targetName,data,null);
- }
-
- public ProcessingInstructionEvent(String targetName, String data,Location loc) {
- init();
- this.fName = targetName;
- fContent = data;
- setLocation(loc);
- }
-
- protected void init() {
- setEventType(XMLStreamConstants.PROCESSING_INSTRUCTION);
- }
-
- public String getTarget() {
- return fName;
- }
-
- public void setTarget(String targetName) {
- fName = targetName;
- }
-
- public void setData(String data) {
- fContent = data;
- }
-
- public String getData() {
- return fContent;
- }
-
- public String toString() {
- if(fContent != null && fName != null)
- return "<?" + fName + " " + fContent + "?>";
- if(fName != null)
- return "<?" + fName + "?>";
- if(fContent != null)
- return "<?" + fContent + "?>";
- else
- return "<??>";
- }
-
- protected void writeAsEncodedUnicodeEx(java.io.Writer writer)
- throws java.io.IOException
- {
- writer.write(toString());
- }
-
-}
diff --git a/src/com/sun/xml/internal/stream/events/StartDocumentEvent.java b/src/com/sun/xml/internal/stream/events/StartDocumentEvent.java
deleted file mode 100644
index 0fd16b3..0000000
--- a/src/com/sun/xml/internal/stream/events/StartDocumentEvent.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.xml.internal.stream.events ;
-
-import javax.xml.stream.events.StartDocument;
-import javax.xml.stream.Location;
-import javax.xml.stream.XMLStreamConstants;
-
-/** Implementation of StartDocumentEvent.
- *
- * @author Neeraj Bajaj Sun Microsystems,Inc.
- * @author K.Venugopal Sun Microsystems,Inc.
- *
- */
-
-public class StartDocumentEvent extends DummyEvent
-implements StartDocument {
-
- protected String fSystemId;
- protected String fEncodingScheam;
- protected boolean fStandalone;
- protected String fVersion;
- private boolean fEncodingSchemeSet = false;
- private boolean fStandaloneSet = false;
- private boolean nestedCall = false;
-
- public StartDocumentEvent() {
- init("UTF-8","1.0",true,null);
- }
-
- public StartDocumentEvent(String encoding){
- init(encoding,"1.0",true,null);
- }
-
- public StartDocumentEvent(String encoding, String version){
- init(encoding,version,true,null);
- }
-
- public StartDocumentEvent(String encoding, String version, boolean standalone){
- this.fStandaloneSet = true;
- init(encoding,version,standalone,null);
- }
-
- public StartDocumentEvent(String encoding, String version, boolean standalone,Location loc){
- this.fStandaloneSet = true;
- init(encoding, version, standalone, loc);
- }
- protected void init(String encoding, String version, boolean standalone,Location loc) {
- setEventType(XMLStreamConstants.START_DOCUMENT);
- this.fEncodingScheam = encoding;
- this.fVersion = version;
- this.fStandalone = standalone;
- if (encoding != null && !encoding.equals(""))
- this.fEncodingSchemeSet = true;
- else {
- this.fEncodingSchemeSet = false;
- this.fEncodingScheam = "UTF-8";
- }
- this.fLocation = loc;
- }
-
- public String getSystemId() {
- if(fLocation == null )
- return "";
- else
- return fLocation.getSystemId();
- }
-
-
- public String getCharacterEncodingScheme() {
- return fEncodingScheam;
- }
-
- public boolean isStandalone() {
- return fStandalone;
- }
-
- public String getVersion() {
- return fVersion;
- }
-
- public void setStandalone(boolean flag) {
- fStandaloneSet = true;
- fStandalone = flag;
- }
-
- public void setStandalone(String s) {
- fStandaloneSet = true;
- if(s == null) {
- fStandalone = true;
- return;
- }
- if(s.equals("yes"))
- fStandalone = true;
- else
- fStandalone = false;
- }
-
- public boolean encodingSet() {
- return fEncodingSchemeSet;
- }
-
- public boolean standaloneSet() {
- return fStandaloneSet;
- }
-
- public void setEncoding(String encoding) {
- fEncodingScheam = encoding;
- }
-
- void setDeclaredEncoding(boolean value){
- fEncodingSchemeSet = value;
- }
-
- public void setVersion(String s) {
- fVersion = s;
- }
-
- void clear() {
- fEncodingScheam = "UTF-8";
- fStandalone = true;
- fVersion = "1.0";
- fEncodingSchemeSet = false;
- fStandaloneSet = false;
- }
-
- public String toString() {
- String s = "<?xml version=\"" + fVersion + "\"";
- s = s + " encoding='" + fEncodingScheam + "'";
- if(fStandaloneSet) {
- if(fStandalone)
- s = s + " standalone='yes'?>";
- else
- s = s + " standalone='no'?>";
- } else {
- s = s + "?>";
- }
- return s;
- }
-
- public boolean isStartDocument() {
- return true;
- }
-
- protected void writeAsEncodedUnicodeEx(java.io.Writer writer)
- throws java.io.IOException
- {
- writer.write(toString());
- }
-}
diff --git a/src/com/sun/xml/internal/stream/events/StartElementEvent.java b/src/com/sun/xml/internal/stream/events/StartElementEvent.java
deleted file mode 100644
index 71f6989..0000000
--- a/src/com/sun/xml/internal/stream/events/StartElementEvent.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.xml.internal.stream.events ;
-
-import java.util.List;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.ArrayList;
-import java.util.Collection;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.events.StartElement;
-import javax.xml.stream.events.Attribute;
-import javax.xml.namespace.NamespaceContext;
-import java.io.Writer;
-import com.sun.xml.internal.stream.util.ReadOnlyIterator;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.events.Namespace;
-
-/** Implementation of StartElementEvent.
- *
- * @author Neeraj Bajaj Sun Microsystems,Inc.
- * @author K.Venugopal Sun Microsystems,Inc.
- */
-
-public class StartElementEvent extends DummyEvent
-implements StartElement {
-
- private Map fAttributes;
- private List fNamespaces;
- private NamespaceContext fNamespaceContext = null;
- private QName fQName;
-
- public StartElementEvent(String prefix, String uri, String localpart) {
- this(new QName(uri, localpart, prefix));
- }
-
- public StartElementEvent(QName qname) {
- fQName = qname;
- init();
- }
-
- public StartElementEvent(StartElement startelement) {
- this(startelement.getName());
- addAttributes(startelement.getAttributes());
- addNamespaceAttributes(startelement.getNamespaces());
- }
-
- protected void init() {
- setEventType(XMLStreamConstants.START_ELEMENT);
- fAttributes = new HashMap();
- fNamespaces = new ArrayList();
- }
-
- public QName getName() {
- return fQName;
- }
-
- public void setName(QName qname) {
- this.fQName = qname;
- }
-
- public Iterator getAttributes() {
- if(fAttributes != null){
- Collection coll = fAttributes.values();
- return new ReadOnlyIterator(coll.iterator());
- }
- return new ReadOnlyIterator();
- }
-
- public Iterator getNamespaces() {
- if(fNamespaces != null){
- return new ReadOnlyIterator(fNamespaces.iterator());
- }
- return new ReadOnlyIterator();
- }
-
- public Attribute getAttributeByName(QName qname) {
- if(qname == null)
- return null;
- return (Attribute)fAttributes.get(qname);
- }
-
- public String getNamespace(){
- return fQName.getNamespaceURI();
- }
-
- public String getNamespaceURI(String prefix) {
- //check that URI was supplied when creating this startElement event and prefix matches
- if( getNamespace() != null && fQName.getPrefix().equals(prefix)) return getNamespace();
- //else check the namespace context
- if(fNamespaceContext != null)
- return fNamespaceContext.getNamespaceURI(prefix);
- return null;
- }
-
- /**
- * <p>Return a <code>String</code> representation of this
- * <code>StartElement</code> formatted as XML.</p>
- *
- * @return <code>String</code> representation of this
- * <code>StartElement</code> formatted as XML.
- */
- public String toString() {
-
- StringBuffer startElement = new StringBuffer();
-
- // open element
- startElement.append("<");
- startElement.append(nameAsString());
-
- // add any attributes
- if (fAttributes != null) {
- Iterator it = this.getAttributes();
- Attribute attr = null;
- while (it.hasNext()) {
- attr = (Attribute) it.next();
- startElement.append(" ");
- startElement.append(attr.toString());
- }
- }
-
- // add any namespaces
- if (fNamespaces != null) {
- Iterator it = fNamespaces.iterator();
- Namespace attr = null;
- while (it.hasNext()) {
- attr = (Namespace) it.next();
- startElement.append(" ");
- startElement.append(attr.toString());
- }
- }
-
- // close start tag
- startElement.append(">");
-
- // return StartElement as a String
- return startElement.toString();
- }
-
- /** Return this event as String
- * @return String Event returned as string.
- */
- public String nameAsString() {
- if("".equals(fQName.getNamespaceURI()))
- return fQName.getLocalPart();
- if(fQName.getPrefix() != null)
- return "['" + fQName.getNamespaceURI() + "']:" + fQName.getPrefix() + ":" + fQName.getLocalPart();
- else
- return "['" + fQName.getNamespaceURI() + "']:" + fQName.getLocalPart();
- }
-
-
- /** Gets a read-only namespace context. If no context is
- * available this method will return an empty namespace context.
- * The NamespaceContext contains information about all namespaces
- * in scope for this StartElement.
- *
- * @return the current namespace context
- */
- public NamespaceContext getNamespaceContext() {
- return fNamespaceContext;
- }
-
- public void setNamespaceContext(NamespaceContext nc) {
- fNamespaceContext = nc;
- }
-
- protected void writeAsEncodedUnicodeEx(java.io.Writer writer)
- throws java.io.IOException
- {
- writer.write(toString());
- }
-
- void addAttribute(Attribute attr){
- if(attr.isNamespace()){
- fNamespaces.add(attr);
- }else{
- fAttributes.put(attr.getName(),attr);
- }
- }
-
- void addAttributes(Iterator attrs){
- if(attrs == null)
- return;
- while(attrs.hasNext()){
- Attribute attr = (Attribute)attrs.next();
- fAttributes.put(attr.getName(),attr);
- }
- }
-
- void addNamespaceAttribute(Namespace attr){
- if(attr == null)
- return;
- fNamespaces.add(attr);
- }
-
- void addNamespaceAttributes(Iterator attrs){
- if(attrs == null)
- return;
- while(attrs.hasNext()){
- Namespace attr = (Namespace)attrs.next();
- fNamespaces.add(attr);
- }
- }
-
-}
diff --git a/src/com/sun/xml/internal/stream/events/XMLEventAllocatorImpl.java b/src/com/sun/xml/internal/stream/events/XMLEventAllocatorImpl.java
deleted file mode 100644
index 065a7cd..0000000
--- a/src/com/sun/xml/internal/stream/events/XMLEventAllocatorImpl.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.xml.internal.stream.events;
-
-import com.sun.org.apache.xerces.internal.impl.PropertyManager;
-import java.util.List;
-import javax.xml.stream.util.XMLEventAllocator;
-import javax.xml.stream.*;
-import javax.xml.stream.events.*;
-import javax.xml.XMLConstants;
-import javax.xml.namespace.QName;
-import com.sun.org.apache.xerces.internal.util.NamespaceContextWrapper;
-import com.sun.org.apache.xerces.internal.util.NamespaceSupport;
-
-/**
- * Implementation of XMLEvent Allocator.
- * @author Neeraj.bajaj@sun.com, k.venugopal@sun.com
- */
-public class XMLEventAllocatorImpl implements XMLEventAllocator {
-
- /** Creates a new instance of XMLEventAllocator */
- public XMLEventAllocatorImpl() {
- }
-
- public javax.xml.stream.events.XMLEvent allocate(javax.xml.stream.XMLStreamReader xMLStreamReader) throws javax.xml.stream.XMLStreamException {
- if(xMLStreamReader == null )
- throw new XMLStreamException("Reader cannot be null");
- // allocate is not supposed to change the state of the reader so we shouldn't be calling next.
- // return getNextEvent(xMLStreamReader);
- return getXMLEvent(xMLStreamReader);
- }
-
- public void allocate(javax.xml.stream.XMLStreamReader xMLStreamReader, javax.xml.stream.util.XMLEventConsumer xMLEventConsumer) throws javax.xml.stream.XMLStreamException {
- XMLEvent currentEvent = getXMLEvent(xMLStreamReader);
- if(currentEvent != null )
- xMLEventConsumer.add(currentEvent);
-
- return;
- }
-
- public javax.xml.stream.util.XMLEventAllocator newInstance() {
- return new XMLEventAllocatorImpl();
- }
-
- //REVISIT: shouldn't we be using XMLEventFactory to create events.
- XMLEvent getXMLEvent(XMLStreamReader streamReader){
- XMLEvent event = null;
- //returns the current event
- int eventType = streamReader.getEventType();
- switch(eventType){
-
- case XMLEvent.START_ELEMENT:{
- StartElementEvent startElementEvent = new StartElementEvent(getQName(streamReader));
- fillAttributes(startElementEvent,streamReader);
- //we might have different XMLStreamReader so check every time for the namespace aware property
- //we should be setting namespace related values only when isNamespaceAware is 'true'
- if( ((Boolean)streamReader.getProperty(XMLInputFactory.IS_NAMESPACE_AWARE)).booleanValue() ){
- fillNamespaceAttributes(startElementEvent, streamReader);
- setNamespaceContext(startElementEvent,streamReader);
- }
-
- startElementEvent.setLocation(streamReader.getLocation());
- event = startElementEvent ;
- break;
- }
- case XMLEvent.END_ELEMENT:{
- EndElementEvent endElementEvent = new EndElementEvent(getQName(streamReader));
- endElementEvent.setLocation(streamReader.getLocation());
-
- if( ((Boolean)streamReader.getProperty(XMLInputFactory.IS_NAMESPACE_AWARE)).booleanValue() ){
- fillNamespaceAttributes(endElementEvent,streamReader);
- }
- event = endElementEvent ;
- break;
- }
- case XMLEvent.PROCESSING_INSTRUCTION:{
- ProcessingInstructionEvent piEvent = new ProcessingInstructionEvent(streamReader.getPITarget(),streamReader.getPIData());
- piEvent.setLocation(streamReader.getLocation());
- event = piEvent ;
- break;
- }
- case XMLEvent.CHARACTERS:{
- CharacterEvent cDataEvent = new CharacterEvent(streamReader.getText());
- cDataEvent.setLocation(streamReader.getLocation());
- event = cDataEvent ;
- break;
- }
- case XMLEvent.COMMENT:{
- CommentEvent commentEvent = new CommentEvent(streamReader.getText());
- commentEvent.setLocation(streamReader.getLocation());
- event = commentEvent ;
- break;
- }
- case XMLEvent.START_DOCUMENT:{
- StartDocumentEvent sdEvent = new StartDocumentEvent();
- sdEvent.setVersion(streamReader.getVersion());
- sdEvent.setEncoding(streamReader.getEncoding());
- if(streamReader.getCharacterEncodingScheme() != null){
- sdEvent.setDeclaredEncoding(true);
- }else{
- sdEvent.setDeclaredEncoding(false);
- }
- sdEvent.setStandalone(streamReader.isStandalone());
- sdEvent.setLocation(streamReader.getLocation());
- event = sdEvent ;
- break;
- }
- case XMLEvent.END_DOCUMENT:{
- EndDocumentEvent endDocumentEvent = new EndDocumentEvent() ;
- endDocumentEvent.setLocation(streamReader.getLocation());
- event = endDocumentEvent ;
- break;
- }
- case XMLEvent.ENTITY_REFERENCE:{
- EntityReferenceEvent entityEvent = new EntityReferenceEvent(streamReader.getLocalName(), new EntityDeclarationImpl(streamReader.getLocalName(),streamReader.getText()));
- entityEvent.setLocation(streamReader.getLocation());
- event = entityEvent;
- break;
-
- }
- case XMLEvent.ATTRIBUTE:{
- event = null ;
- break;
- }
- case XMLEvent.DTD:{
- DTDEvent dtdEvent = new DTDEvent(streamReader.getText());
- dtdEvent.setLocation(streamReader.getLocation());
- List entities = (List)streamReader.getProperty(PropertyManager.STAX_ENTITIES);
- if (entities != null && entities.size() != 0) dtdEvent.setEntities(entities);
- List notations = (List)streamReader.getProperty(PropertyManager.STAX_NOTATIONS);
- if (notations != null && notations.size() != 0) dtdEvent.setNotations(notations);
- event = dtdEvent;
- break;
- }
- case XMLEvent.CDATA:{
- CharacterEvent cDataEvent = new CharacterEvent(streamReader.getText(),true);
- cDataEvent.setLocation(streamReader.getLocation());
- event = cDataEvent ;
- break;
- }
- case XMLEvent.SPACE:{
- CharacterEvent spaceEvent = new CharacterEvent(streamReader.getText(),false,true);
- spaceEvent.setLocation(streamReader.getLocation());
- event = spaceEvent ;
- break;
- }
- }
- return event ;
- }
-
- //this function is not used..
- protected XMLEvent getNextEvent(XMLStreamReader streamReader) throws XMLStreamException{
- //advance the reader to next event.
- streamReader.next();
- return getXMLEvent(streamReader);
- }
-
- protected void fillAttributes(StartElementEvent event,XMLStreamReader xmlr){
-
- int len = xmlr.getAttributeCount();
- QName qname = null;
- AttributeImpl attr = null;
- NamespaceImpl nattr = null;
- for(int i=0; i<len ;i++){
- qname = xmlr.getAttributeName(i);
- //this method doesn't include namespace declarations
- //so we can be sure that there wont be any namespace declaration as part of this function call
- //we can avoid this check - nb.
- /**
- * prefix = qname.getPrefix();
- * localpart = qname.getLocalPart();
- * if (prefix.equals(XMLConstants.XMLNS_ATTRIBUTE) ) {
- * attr = new NamespaceImpl(localpart,xmlr.getAttributeValue(i));
- * }else if (prefix.equals(XMLConstants.DEFAULT_NS_PREFIX)){
- * attr = new NamespaceImpl(xmlr.getAttributeValue(i));
- * }else{
- * attr = new AttributeImpl();
- * attr.setName(qname);
- * }
- **/
- attr = new AttributeImpl();
- attr.setName(qname);
- attr.setAttributeType(xmlr.getAttributeType(i));
- attr.setSpecified(xmlr.isAttributeSpecified(i));
- attr.setValue(xmlr.getAttributeValue(i));
- event.addAttribute(attr);
- }
- }
-
- protected void fillNamespaceAttributes(StartElementEvent event,XMLStreamReader xmlr){
- int count = xmlr.getNamespaceCount();
- String uri = null;
- String prefix = null;
- NamespaceImpl attr = null;
- for(int i=0;i< count;i++){
- uri = xmlr.getNamespaceURI(i);
- prefix = xmlr.getNamespacePrefix(i);
- if(prefix == null){
- prefix = XMLConstants.DEFAULT_NS_PREFIX;
- }
- attr = new NamespaceImpl(prefix,uri);
- event.addNamespaceAttribute(attr);
- }
- }
-
- protected void fillNamespaceAttributes(EndElementEvent event,XMLStreamReader xmlr){
- int count = xmlr.getNamespaceCount();
- String uri = null;
- String prefix = null;
- NamespaceImpl attr = null;
- for(int i=0;i< count;i++){
- uri = xmlr.getNamespaceURI(i);
- prefix = xmlr.getNamespacePrefix(i);
- if(prefix == null){
- prefix = XMLConstants.DEFAULT_NS_PREFIX;
- }
- attr = new NamespaceImpl(prefix,uri);
- event.addNamespace(attr);
- }
- }
-
- //Revisit : Creating a new Namespacecontext for now.
- //see if we can do better job.
- private void setNamespaceContext(StartElementEvent event , XMLStreamReader xmlr){
- NamespaceContextWrapper contextWrapper =(NamespaceContextWrapper) xmlr.getNamespaceContext();
- NamespaceSupport ns = new NamespaceSupport(contextWrapper.getNamespaceContext());
- event.setNamespaceContext(new NamespaceContextWrapper(ns));
- }
-
- private QName getQName(XMLStreamReader xmlr) {
- return new QName(xmlr.getNamespaceURI(), xmlr.getLocalName(),
- xmlr.getPrefix());
- }
-}
diff --git a/src/com/sun/xml/internal/stream/events/XMLEventFactoryImpl.java b/src/com/sun/xml/internal/stream/events/XMLEventFactoryImpl.java
deleted file mode 100644
index 669546b..0000000
--- a/src/com/sun/xml/internal/stream/events/XMLEventFactoryImpl.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.xml.internal.stream.events;
-
-import javax.xml.stream.XMLEventFactory;
-import javax.xml.stream.Location;
-import javax.xml.stream.events.Namespace;
-import javax.xml.stream.events.EntityDeclaration;
-
-
-/**
- *
- * @author Neeraj Bajaj, k.venugopal@sun.com
- */
-public class XMLEventFactoryImpl extends XMLEventFactory {
-
- Location location = null;
- /** Creates a new instance of XMLEventFactory */
- public XMLEventFactoryImpl() {
- }
-
- public javax.xml.stream.events.Attribute createAttribute(String localName, String value) {
- AttributeImpl attr = new AttributeImpl(localName, value);
- if(location != null)attr.setLocation(location);
- return attr;
- }
-
- public javax.xml.stream.events.Attribute createAttribute(javax.xml.namespace.QName name, String value) {
- return createAttribute(name.getPrefix(), name.getNamespaceURI(), name.getLocalPart(), value);
- }
-
- public javax.xml.stream.events.Attribute createAttribute(String prefix, String namespaceURI, String localName, String value) {
- AttributeImpl attr = new AttributeImpl(prefix, namespaceURI, localName, value, null);
- if(location != null)attr.setLocation(location);
- return attr;
- }
-
- public javax.xml.stream.events.Characters createCData(String content) {
- //stax doesn't have separate CDATA event. This is taken care by
- //CHRACTERS event setting the cdata flag to true.
- CharacterEvent charEvent = new CharacterEvent(content, true);
- if(location != null)charEvent.setLocation(location);
- return charEvent;
- }
-
- public javax.xml.stream.events.Characters createCharacters(String content) {
- CharacterEvent charEvent = new CharacterEvent(content);
- if(location != null)charEvent.setLocation(location);
- return charEvent;
- }
-
- public javax.xml.stream.events.Comment createComment(String text) {
- CommentEvent charEvent = new CommentEvent(text);
- if(location != null)charEvent.setLocation(location);
- return charEvent;
- }
-
- public javax.xml.stream.events.DTD createDTD(String dtd) {
- DTDEvent dtdEvent = new DTDEvent(dtd);
- if(location != null)dtdEvent.setLocation(location);
- return dtdEvent;
- }
-
- public javax.xml.stream.events.EndDocument createEndDocument() {
- EndDocumentEvent event =new EndDocumentEvent();
- if(location != null)event.setLocation(location);
- return event;
- }
-
- public javax.xml.stream.events.EndElement createEndElement(javax.xml.namespace.QName name, java.util.Iterator namespaces) {
- return createEndElement(name.getPrefix(), name.getNamespaceURI(), name.getLocalPart());
- }
-
- public javax.xml.stream.events.EndElement createEndElement(String prefix, String namespaceUri, String localName) {
- EndElementEvent event = new EndElementEvent(prefix, namespaceUri, localName);
- if(location != null)event.setLocation(location);
- return event;
- }
-
- public javax.xml.stream.events.EndElement createEndElement(String prefix, String namespaceUri, String localName, java.util.Iterator namespaces) {
-
- EndElementEvent event = new EndElementEvent(prefix, namespaceUri, localName);
- if(namespaces!=null){
- while(namespaces.hasNext())
- event.addNamespace((Namespace)namespaces.next());
- }
- if(location != null)event.setLocation(location);
- return event;
- }
-
- public javax.xml.stream.events.EntityReference createEntityReference(String name, EntityDeclaration entityDeclaration) {
- EntityReferenceEvent event = new EntityReferenceEvent(name, entityDeclaration);
- if(location != null)event.setLocation(location);
- return event;
- }
-
- public javax.xml.stream.events.Characters createIgnorableSpace(String content) {
- CharacterEvent event = new CharacterEvent(content, false, true);
- if(location != null)event.setLocation(location);
- return event;
- }
-
- public javax.xml.stream.events.Namespace createNamespace(String namespaceURI) {
- NamespaceImpl event = new NamespaceImpl(namespaceURI);
- if(location != null)event.setLocation(location);
- return event;
- }
-
- public javax.xml.stream.events.Namespace createNamespace(String prefix, String namespaceURI) {
- NamespaceImpl event = new NamespaceImpl(prefix, namespaceURI);
- if(location != null)event.setLocation(location);
- return event;
- }
-
- public javax.xml.stream.events.ProcessingInstruction createProcessingInstruction(String target, String data) {
- ProcessingInstructionEvent event = new ProcessingInstructionEvent(target, data);
- if(location != null)event.setLocation(location);
- return event;
- }
-
- public javax.xml.stream.events.Characters createSpace(String content) {
- CharacterEvent event = new CharacterEvent(content);
- if(location != null)event.setLocation(location);
- return event;
- }
-
- public javax.xml.stream.events.StartDocument createStartDocument() {
- StartDocumentEvent event = new StartDocumentEvent();
- if(location != null)event.setLocation(location);
- return event;
- }
-
- public javax.xml.stream.events.StartDocument createStartDocument(String encoding) {
- StartDocumentEvent event = new StartDocumentEvent(encoding);
- if(location != null)event.setLocation(location);
- return event;
- }
-
- public javax.xml.stream.events.StartDocument createStartDocument(String encoding, String version) {
- StartDocumentEvent event = new StartDocumentEvent(encoding, version);
- if(location != null)event.setLocation(location);
- return event;
- }
-
- public javax.xml.stream.events.StartDocument createStartDocument(String encoding, String version, boolean standalone) {
- StartDocumentEvent event = new StartDocumentEvent(encoding, version, standalone);
- if(location != null)event.setLocation(location);
- return event;
- }
-
- public javax.xml.stream.events.StartElement createStartElement(javax.xml.namespace.QName name, java.util.Iterator attributes, java.util.Iterator namespaces) {
- return createStartElement(name.getPrefix(), name.getNamespaceURI(), name.getLocalPart(), attributes, namespaces);
- }
-
- public javax.xml.stream.events.StartElement createStartElement(String prefix, String namespaceUri, String localName) {
- StartElementEvent event = new StartElementEvent(prefix, namespaceUri, localName);
- if(location != null)event.setLocation(location);
- return event;
- }
-
- public javax.xml.stream.events.StartElement createStartElement(String prefix, String namespaceUri, String localName, java.util.Iterator attributes, java.util.Iterator namespaces) {
- return createStartElement(prefix, namespaceUri, localName, attributes, namespaces, null);
- }
-
- public javax.xml.stream.events.StartElement createStartElement(String prefix, String namespaceUri, String localName, java.util.Iterator attributes, java.util.Iterator namespaces, javax.xml.namespace.NamespaceContext context) {
- StartElementEvent elem = new StartElementEvent(prefix, namespaceUri, localName);
- elem.addAttributes(attributes);
- elem.addNamespaceAttributes(namespaces);
- elem.setNamespaceContext(context);
- if(location != null)elem.setLocation(location);
- return elem;
- }
-
- public void setLocation(javax.xml.stream.Location location) {
- this.location = location;
- }
-
-}
diff --git a/src/com/sun/xml/internal/stream/javax.xml.stream.XMLEventFactory b/src/com/sun/xml/internal/stream/javax.xml.stream.XMLEventFactory
deleted file mode 100644
index adc26b3..0000000
--- a/src/com/sun/xml/internal/stream/javax.xml.stream.XMLEventFactory
+++ /dev/null
@@ -1 +0,0 @@
-com.sun.xml.internal.stream.events.XMLEventFactoryImpl
diff --git a/src/com/sun/xml/internal/stream/javax.xml.stream.XMLInputFactory b/src/com/sun/xml/internal/stream/javax.xml.stream.XMLInputFactory
deleted file mode 100644
index 456882c..0000000
--- a/src/com/sun/xml/internal/stream/javax.xml.stream.XMLInputFactory
+++ /dev/null
@@ -1 +0,0 @@
-com.sun.xml.internal.stream.XMLInputFactoryImpl
diff --git a/src/com/sun/xml/internal/stream/javax.xml.stream.XMLOutputFactory b/src/com/sun/xml/internal/stream/javax.xml.stream.XMLOutputFactory
deleted file mode 100644
index 3de5190..0000000
--- a/src/com/sun/xml/internal/stream/javax.xml.stream.XMLOutputFactory
+++ /dev/null
@@ -1 +0,0 @@
-com.sun.xml.internal.stream.XMLOutputFactoryImpl
diff --git a/src/com/sun/xml/internal/stream/util/BufferAllocator.java b/src/com/sun/xml/internal/stream/util/BufferAllocator.java
deleted file mode 100644
index 1362692..0000000
--- a/src/com/sun/xml/internal/stream/util/BufferAllocator.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.xml.internal.stream.util;
-
-import java.lang.ref.*;
-
-/**
- * Buffer allocator for buffers of sizes 128 B, 2 KB and 8 KB. Includes
- * methods for allocating and freeing buffers.
- *
- * @author Binu.John@sun.com
- * @author Santiago.PericasGeertsen@sun.com
- */
-public class BufferAllocator {
- public static int SMALL_SIZE_LIMIT = 128;
- public static int MEDIUM_SIZE_LIMIT = 2048;
- public static int LARGE_SIZE_LIMIT = 8192;
-
- char[] smallCharBuffer;
- char[] mediumCharBuffer;
- char[] largeCharBuffer;
-
- byte[] smallByteBuffer;
- byte[] mediumByteBuffer;
- byte[] largeByteBuffer;
-
- public BufferAllocator() {
- }
-
- public char[] getCharBuffer(int size) {
- if (size <= SMALL_SIZE_LIMIT) {
- char[] buffer = smallCharBuffer;
- smallCharBuffer = null;
- return buffer;
- }
- else if (size <= MEDIUM_SIZE_LIMIT) {
- char[] buffer = mediumCharBuffer;
- mediumCharBuffer = null;
- return buffer;
- }
- else if (size <= LARGE_SIZE_LIMIT) {
- char[] buffer = largeCharBuffer;
- largeCharBuffer = null;
- return buffer;
- }
- return null;
- }
-
- public void returnCharBuffer(char[] c) {
- if (c == null) {
- return;
- }
- if (c.length <= SMALL_SIZE_LIMIT) {
- smallCharBuffer = c;
- }
- else if (c.length <= MEDIUM_SIZE_LIMIT) {
- mediumCharBuffer = c;
- }
- else if (c.length <= LARGE_SIZE_LIMIT) {
- largeCharBuffer = c;
- }
- }
-
- public byte[] getByteBuffer(int size) {
- if (size <= SMALL_SIZE_LIMIT) {
- byte[] buffer = smallByteBuffer;
- smallByteBuffer = null;
- return buffer;
- }
- else if (size <= MEDIUM_SIZE_LIMIT) {
- byte[] buffer = mediumByteBuffer;
- mediumByteBuffer = null;
- return buffer;
- }
- else if (size <= LARGE_SIZE_LIMIT) {
- byte[] buffer = largeByteBuffer;
- largeByteBuffer = null;
- return buffer;
- }
- return null;
- }
-
- public void returnByteBuffer(byte[] b) {
- if (b == null) {
- return;
- }
- if (b.length <= SMALL_SIZE_LIMIT) {
- smallByteBuffer = b;
- }
- else if (b.length <= MEDIUM_SIZE_LIMIT) {
- mediumByteBuffer = b;
- }
- else if (b.length <= LARGE_SIZE_LIMIT) {
- largeByteBuffer = b;
- }
- }
-
-}
diff --git a/src/com/sun/xml/internal/stream/util/ReadOnlyIterator.java b/src/com/sun/xml/internal/stream/util/ReadOnlyIterator.java
deleted file mode 100644
index c1fd3c7..0000000
--- a/src/com/sun/xml/internal/stream/util/ReadOnlyIterator.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.xml.internal.stream.util;
-/**
- *
- * @author K.Venugopal ,Neeraj Bajaj Sun Microsystems.
- */
-
-import java.util.Iterator;
-
-public class ReadOnlyIterator implements Iterator {
-
- Iterator iterator = null;
-
- public ReadOnlyIterator(){
- }
-
- public ReadOnlyIterator(Iterator itr){
- iterator = itr;
- }
-
- /**
- * @return
- */
- public boolean hasNext() {
- if(iterator != null)
- return iterator.hasNext();
- return false;
- }
-
- /**
- * @return
- */
- public Object next() {
- if(iterator != null)
- return iterator.next();
- return null;
- }
-
- public void remove() {
- throw new UnsupportedOperationException("Remove operation is not supported");
- }
-
-}
diff --git a/src/com/sun/xml/internal/stream/util/ThreadLocalBufferAllocator.java b/src/com/sun/xml/internal/stream/util/ThreadLocalBufferAllocator.java
deleted file mode 100644
index 25bdf6b..0000000
--- a/src/com/sun/xml/internal/stream/util/ThreadLocalBufferAllocator.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.xml.internal.stream.util;
-
-import java.lang.ref.*;
-
-/**
- * This is a Singleton class that allows you to allocate buffer that
- * are stored in ThreadLocal. This class stores 3 types of char
- * buffers - small (< 128 bytes), medium (<2K) and large (> 2K) as
- * well as three byte buffers - small, medium and large.
- * The local storage is activated on the return of the buffer.
- * The buffer returns null if it is already allocated.
- *
- * @author Binu.John@sun.com
- * @author Santiago.PericasGeertsen@sun.com
- */
-public class ThreadLocalBufferAllocator {
- private static ThreadLocal tlba = new ThreadLocal();
-
- public static BufferAllocator getBufferAllocator() {
- SoftReference bAllocatorRef = (SoftReference) tlba.get();
- if (bAllocatorRef == null || bAllocatorRef.get() == null) {
- bAllocatorRef = new SoftReference(new BufferAllocator());
- tlba.set(bAllocatorRef);
- }
-
- return (BufferAllocator) bAllocatorRef.get();
- }
-}
diff --git a/src/com/sun/xml/internal/stream/writers/UTF8OutputStreamWriter.java b/src/com/sun/xml/internal/stream/writers/UTF8OutputStreamWriter.java
deleted file mode 100644
index 552e030..0000000
--- a/src/com/sun/xml/internal/stream/writers/UTF8OutputStreamWriter.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.xml.internal.stream.writers;
-
-import java.io.Writer;
-import java.io.OutputStream;
-import java.io.IOException;
-
-import com.sun.org.apache.xerces.internal.util.XMLChar;
-
-/**
- * <p>This class is used to write a stream of chars as a stream of
- * bytes using the UTF8 encoding. It assumes that the underlying
- * output stream is buffered or does not need additional buffering.</p>
- *
- * <p>It is more efficient than using a <code>java.io.OutputStreamWriter</code>
- * because it does not need to be wrapped in a
- * <code>java.io.BufferedWriter</code>. Creating multiple instances
- * of <code>java.io.BufferedWriter</code> has been shown to be very
- * expensive in JAX-WS.</p>
- *
- * @author Santiago.PericasGeertsen@sun.com
- */
-public final class UTF8OutputStreamWriter extends Writer {
-
- /**
- * Undelying output stream. This class assumes that this
- * output stream does not need buffering.
- */
- OutputStream out;
-
- /**
- * Java represents chars that are not in the Basic Multilingual
- * Plane (BMP) in UTF-16. This int stores the first code unit
- * for a code point encoded in two UTF-16 code units.
- */
- int lastUTF16CodePoint = 0;
-
- public UTF8OutputStreamWriter(OutputStream out) {
- this.out = out;
- }
-
- public String getEncoding() {
- return "UTF-8";
- }
-
- public void write(int c) throws IOException {
- // Check in we are encoding at high and low surrogates
- if (lastUTF16CodePoint != 0) {
- final int uc =
- (((lastUTF16CodePoint & 0x3ff) << 10) | (c & 0x3ff)) + 0x10000;
-
- if (uc < 0 || uc >= 0x200000) {
- throw new IOException("Atttempting to write invalid Unicode code point '" + uc + "'");
- }
-
- out.write(0xF0 | (uc >> 18));
- out.write(0x80 | ((uc >> 12) & 0x3F));
- out.write(0x80 | ((uc >> 6) & 0x3F));
- out.write(0x80 | (uc & 0x3F));
-
- lastUTF16CodePoint = 0;
- return;
- }
-
- // Otherwise, encode char as defined in UTF-8
- if (c < 0x80) {
- // 1 byte, 7 bits
- out.write((int) c);
- }
- else if (c < 0x800) {
- // 2 bytes, 11 bits
- out.write(0xC0 | (c >> 6)); // first 5
- out.write(0x80 | (c & 0x3F)); // second 6
- }
- else if (c <= '\uFFFF') {
- if (!XMLChar.isHighSurrogate(c) && !XMLChar.isLowSurrogate(c)) {
- // 3 bytes, 16 bits
- out.write(0xE0 | (c >> 12)); // first 4
- out.write(0x80 | ((c >> 6) & 0x3F)); // second 6
- out.write(0x80 | (c & 0x3F)); // third 6
- }
- else {
- lastUTF16CodePoint = c;
- }
- }
- }
-
- public void write(char cbuf[]) throws IOException {
- for (int i = 0; i < cbuf.length; i++) {
- write(cbuf[i]);
- }
- }
-
- public void write(char cbuf[], int off, int len) throws IOException {
- for (int i = 0; i < len; i++) {
- write(cbuf[off + i]);
- }
- }
-
- public void write(String str) throws IOException {
- final int len = str.length();
- for (int i = 0; i < len; i++) {
- write(str.charAt(i));
- }
- }
-
- public void write(String str, int off, int len) throws IOException {
- for (int i = 0; i < len; i++) {
- write(str.charAt(off + i));
- }
- }
-
- public void flush() throws IOException {
- out.flush();
- }
-
- public void close() throws IOException {
- if (lastUTF16CodePoint != 0) {
- throw new IllegalStateException("Attempting to close a UTF8OutputStreamWriter"
- + " while awaiting for a UTF-16 code unit");
- }
- out.close();
- }
-
-}
diff --git a/src/com/sun/xml/internal/stream/writers/WriterUtility.java b/src/com/sun/xml/internal/stream/writers/WriterUtility.java
deleted file mode 100644
index 7017ed5..0000000
--- a/src/com/sun/xml/internal/stream/writers/WriterUtility.java
+++ /dev/null
@@ -1,254 +0,0 @@
-/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.xml.internal.stream.writers;
-
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.nio.charset.Charset;
-import java.nio.charset.CharsetEncoder;
-import com.sun.org.apache.xerces.internal.util.XMLChar;
-import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
-
-/**
- * Implements common xml writer functions.
- *
- * @author Neeraj Bajaj,K.Venugopal Sun Microsystems.
- */
-
-public class WriterUtility {
-
-
- public static final String START_COMMENT = "<!--";
- public static final String END_COMMENT = "-->";
- public static final String DEFAULT_ENCODING = " encoding=\"utf-8\"";
- public static final String DEFAULT_XMLDECL ="<?xml version=\"1.0\" ?>";
- public static final String DEFAULT_XML_VERSION ="1.0";
- public static final char CLOSE_START_TAG = '>';
- public static final char OPEN_START_TAG = '<';
- public static final String OPEN_END_TAG ="</";
- public static final char CLOSE_END_TAG = '>';
- public static final String START_CDATA = "<![CDATA[";
- public static final String END_CDATA = "]]>";
- public static final String CLOSE_EMPTY_ELEMENT = "/>";
- public static final String SPACE = " ";
- public static final String UTF_8 = "utf-8";
-
- static final boolean DEBUG_XML_CONTENT = false;
-
- /**XXX: This feature is only used when writing element content values.
- * default value is 'true' however, if the feature is set to false
- * characters wont be escaped.
- * This feature has no effect when writing Attribute values, character would still be escaped.
- * I can't think of any reason why this would be useful when writing attribute values.
- * However, this can be reconsidered if there is any usecase.
- */
- boolean fEscapeCharacters = true ;
-
- /** Writer object*/
- Writer fWriter = null;
-
- //CharsetEncoder
- CharsetEncoder fEncoder ;
-
- public WriterUtility(){
- fEncoder = getDefaultEncoder();
- }
-
-
- /** Creates a new instance of WriterUtility */
- public WriterUtility(Writer writer) {
- fWriter = writer;
- if(writer instanceof OutputStreamWriter){
- String charset = ((OutputStreamWriter)writer).getEncoding();
- if(charset != null){
- fEncoder = Charset.forName(charset).newEncoder();
- }
- }else if(writer instanceof FileWriter){
- String charset = ((FileWriter)writer).getEncoding();
- if(charset != null){
- fEncoder = Charset.forName(charset).newEncoder();
- }
- }
- else{
- //attempt to retreive default fEncoderoder
- fEncoder = getDefaultEncoder();
- }
- }
-
- /**
- * sets the writer object
- * @param writer file to write into
- */
- public void setWriter(Writer writer){
- fWriter = writer;
- }
-
- public void setEscapeCharacters(boolean escape){
- fEscapeCharacters = escape ;
- }
-
- public boolean getEscapeCharacters(){
- return fEscapeCharacters;
- }
-
- /**
- * writes xml content (characters and element content
- * @param content
- */
- public void writeXMLContent(char[] content, int start, int length) throws IOException{
- writeXMLContent(content, start, length, getEscapeCharacters());
- }
-
- /**
- * writes xml content (characters and element content
- * @param content
- */
- private void writeXMLContent(char[] content, int start, int length, boolean escapeCharacter) throws IOException{
- if(DEBUG_XML_CONTENT){
- System.out.println("content to write is " + new String(content, start, length));
- }
- int index;
- char ch;
- int sc;
- final int end = start + length ;
- //define startWritePos to track the position from where the character array data needs to be written
- //initialize this variable to start pos. indicating that no data has been written
- int startWritePos = start;
-
- for ( index = start ; index < end ; index++ ) {
- ch = content[ index ];
-
- if(fEncoder != null && !fEncoder.canEncode(ch)){
- //- write the data to the point we get this character
- fWriter.write(content, startWritePos, index - startWritePos );
-
- //escape this character
- fWriter.write( "&#x" );
- fWriter.write(Integer.toHexString(ch));
- fWriter.write( ';' );
- //increase the startWritePos by 1 indicating that next write should start from
- //one position ahead
- startWritePos = index + 1;
-
- }
- if(DEBUG_XML_CONTENT){
- System.out.println("startWritePos = " + startWritePos);
- System.out.println("index = " + index);
- System.out.println("start = " + start);
- System.out.println("end = " + end);
- }
-
- switch(ch){
- case '<' :{
- if(escapeCharacter){
- //this character needs to be escaped, write the data from the last write pos
- fWriter.write(content, startWritePos, index - startWritePos);
- fWriter.write("&lt;");
- if(DEBUG_XML_CONTENT){
- System.out.print(new String(content, startWritePos, index - startWritePos));
- System.out.println("&lt;");
- }
- //increase the startWritePos by 1 indicating that next write should start from
- //one position ahead
- startWritePos = index + 1;
- }
- break;
- }
- case '&' :{
- if(escapeCharacter){
- //this character needs to be escaped, write the data from the last write pos
- fWriter.write(content, startWritePos, index - startWritePos);
- fWriter.write("&amp;");
- if(DEBUG_XML_CONTENT){
- System.out.print(new String(content,startWritePos, index - startWritePos));
- System.out.println("&amp;");
- }
- //increase the startWritePos by 1 indicating that next write should start from
- //one position ahead
- startWritePos = index + 1;
- }
- break;
- }
-
- case '>': {
- if(escapeCharacter){
- //this character needs to be escaped, write the data from the last write pos
- fWriter.write(content, startWritePos, index - startWritePos);
- fWriter.write("&gt;");
- if(DEBUG_XML_CONTENT){
- System.out.print(new String(content,startWritePos, index - startWritePos));
- System.out.println("&gt;");
- }
- //increase the startWritePos by 1 indicating that next write should start from
- //one position ahead
- startWritePos = index + 1;
- }
- break;
- }
- }
- }
- if(DEBUG_XML_CONTENT){
- System.out.println("out of the loop, writing " + new String(content, startWritePos, end - startWritePos));
- }
- //write any pending data
- fWriter.write(content, startWritePos, end - startWritePos);
- }
-
- /**
- * writes xml content (characters and element content
- * @param content
- */
- public void writeXMLContent(String content) throws IOException{
- if(content == null || content.length() == 0) return ;
- writeXMLContent(content.toCharArray(), 0, content.length());
- }
-
-
- /**
- * Write Attribute value to the underlying stream.
- *
- * @param value
- */
-
- public void writeXMLAttributeValue(String value)throws IOException{
- writeXMLContent(value.toCharArray(), 0, value.length(), true);
- }
-
- private CharsetEncoder getDefaultEncoder(){
- try{
- String encoding = SecuritySupport.getSystemProperty("file.encoding");
- if(encoding != null){
- return Charset.forName(encoding).newEncoder();
- }
- }
- catch(Exception ex){
- //for any exception thrown , catch and continue
- }
- return null;
- }
-}
diff --git a/src/com/sun/xml/internal/stream/writers/XMLDOMWriterImpl.java b/src/com/sun/xml/internal/stream/writers/XMLDOMWriterImpl.java
deleted file mode 100644
index 6ab58d4..0000000
--- a/src/com/sun/xml/internal/stream/writers/XMLDOMWriterImpl.java
+++ /dev/null
@@ -1,742 +0,0 @@
-/*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.xml.internal.stream.writers;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import javax.xml.XMLConstants;
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamWriter;
-import javax.xml.transform.dom.DOMResult;
-import org.w3c.dom.Attr;
-import org.w3c.dom.CDATASection;
-import org.w3c.dom.Comment;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.EntityReference;
-import org.w3c.dom.Node;
-import org.w3c.dom.ProcessingInstruction;
-import org.w3c.dom.Text;
-import org.xml.sax.helpers.NamespaceSupport;
-
-/**
- * This class provides support to build a DOM tree using XMLStreamWriter API's.
- * @author K.Venugopal@sun.com
- */
-
-/*
- * TODO : -Venu
- * Internal NamespaceManagement
- * setPrefix
- * support for isRepairNamespace property.
- * Some Unsupported Methods.
- * Change StringBuffer to StringBuilder, when JDK 1.5 will be minimum requirement for SJSXP.
- */
-
-public class XMLDOMWriterImpl implements XMLStreamWriter {
-
-
- private Document ownerDoc = null;
- private Node currentNode = null;
- private Node node = null;
- private NamespaceSupport namespaceContext = null;
- private Method mXmlVersion = null;
- private boolean [] needContextPop = null;
- private StringBuffer stringBuffer = null;
- private int resizeValue = 20;
- private int depth = 0;
- /**
- * Creates a new instance of XMLDOMwriterImpl
- * @param result DOMResult object @javax.xml.transform.dom.DOMResult
- */
- public XMLDOMWriterImpl(DOMResult result) {
-
- node = result.getNode();
- if( node.getNodeType() == Node.DOCUMENT_NODE){
- ownerDoc = (Document)node;
- currentNode = ownerDoc;
- }else{
- ownerDoc = node.getOwnerDocument();
- currentNode = node;
- }
- getDLThreeMethods();
- stringBuffer = new StringBuffer();
- needContextPop = new boolean[resizeValue];
- namespaceContext = new NamespaceSupport();
- }
-
- private void getDLThreeMethods(){
- try{
- mXmlVersion = ownerDoc.getClass().getMethod("setXmlVersion",new Class[] {String.class});
- }catch(NoSuchMethodException mex){
- //log these errors at fine level.
- mXmlVersion = null;
- }catch(SecurityException se){
- //log these errors at fine level.
- mXmlVersion = null;
- }
- }
-
-
- /**
- * This method has no effect when called.
- * @throws javax.xml.stream.XMLStreamException {@inheritDoc}
- */
- public void close() throws XMLStreamException {
- //no-op
- }
-
- /**
- * This method has no effect when called.
- * @throws javax.xml.stream.XMLStreamException {@inheritDoc}
- */
- public void flush() throws XMLStreamException {
- //no-op
- }
-
- /**
- * {@inheritDoc}
- * @return {@inheritDoc}
- */
- public javax.xml.namespace.NamespaceContext getNamespaceContext() {
- return null;
- }
-
- /**
- * {@inheritDoc}
- * @param namespaceURI {@inheritDoc}
- * @throws javax.xml.stream.XMLStreamException {@inheritDoc}
- * @return {@inheritDoc}
- */
- public String getPrefix(String namespaceURI) throws XMLStreamException {
- String prefix = null;
- if(this.namespaceContext != null){
- prefix = namespaceContext.getPrefix(namespaceURI);
- }
- return prefix;
- }
-
- /**
- * Is not supported in this implementation.
- * @param str {@inheritDoc}
- * @throws java.lang.IllegalArgumentException {@inheritDoc}
- * @return {@inheritDoc}
- */
- public Object getProperty(String str) throws IllegalArgumentException {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Is not supported in this version of the implementation.
- * @param uri {@inheritDoc}
- * @throws javax.xml.stream.XMLStreamException {@inheritDoc}
- */
- public void setDefaultNamespace(String uri) throws XMLStreamException {
- namespaceContext.declarePrefix(XMLConstants.DEFAULT_NS_PREFIX, uri);
- if(!needContextPop[depth]){
- needContextPop[depth] = true;
- }
- }
-
- /**
- * {@inheritDoc}
- * @param namespaceContext {@inheritDoc}
- * @throws javax.xml.stream.XMLStreamException {@inheritDoc}
- */
- public void setNamespaceContext(javax.xml.namespace.NamespaceContext namespaceContext) throws XMLStreamException {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Is not supported in this version of the implementation.
- * @param prefix {@inheritDoc}
- * @param uri {@inheritDoc}
- * @throws javax.xml.stream.XMLStreamException {@inheritDoc}
- */
- public void setPrefix(String prefix, String uri) throws XMLStreamException {
- if(prefix == null){
- throw new XMLStreamException("Prefix cannot be null");
- }
- namespaceContext.declarePrefix(prefix, uri);
- if(!needContextPop[depth]){
- needContextPop[depth] = true;
- }
- }
-
- /**
- * Creates a DOM Atrribute @see org.w3c.dom.Node and associates it with the current DOM element @see org.w3c.dom.Node.
- * @param localName {@inheritDoc}
- * @param value {@inheritDoc}
- * @throws javax.xml.stream.XMLStreamException {@inheritDoc}
- */
- public void writeAttribute(String localName, String value) throws XMLStreamException {
-
- if(currentNode.getNodeType() == Node.ELEMENT_NODE){
- Attr attr = ownerDoc.createAttribute(localName);
- attr.setValue(value);
- ((Element)currentNode).setAttributeNode(attr);
- }else{
- //Convert node type to String
- throw new IllegalStateException("Current DOM Node type is "+ currentNode.getNodeType() +
- "and does not allow attributes to be set ");
- }
- }
-
- /**
- * Creates a DOM Atrribute @see org.w3c.dom.Node and associates it with the current DOM element @see org.w3c.dom.Node.
- * @param namespaceURI {@inheritDoc}
- * @param localName {@inheritDoc}
- * @param value {@inheritDoc}
- * @throws javax.xml.stream.XMLStreamException {@inheritDoc}
- */
- public void writeAttribute(String namespaceURI,String localName,String value)throws XMLStreamException {
- if(currentNode.getNodeType() == Node.ELEMENT_NODE){
- String prefix = null;
- if(namespaceURI == null ){
- throw new XMLStreamException("NamespaceURI cannot be null");
- }
- if(localName == null){
- throw new XMLStreamException("Local name cannot be null");
- }
- if(namespaceContext != null){
- prefix = namespaceContext.getPrefix(namespaceURI);
- }
-
- if(prefix == null){
- throw new XMLStreamException("Namespace URI "+namespaceURI +
- "is not bound to any prefix" );
- }
-
- String qualifiedName = null;
- if(prefix.equals("")){
- qualifiedName = localName;
- }else{
- qualifiedName = getQName(prefix,localName);
- }
- Attr attr = ownerDoc.createAttributeNS(namespaceURI, qualifiedName);
- attr.setValue(value);
- ((Element)currentNode).setAttributeNode(attr);
- }else{
- //Convert node type to String
- throw new IllegalStateException("Current DOM Node type is "+ currentNode.getNodeType() +
- "and does not allow attributes to be set ");
- }
- }
-
- /**
- * Creates a DOM Atrribute @see org.w3c.dom.Node and associates it with the current DOM element @see org.w3c.dom.Node.
- * @param prefix {@inheritDoc}
- * @param namespaceURI {@inheritDoc}
- * @param localName {@inheritDoc}
- * @param value {@inheritDoc}
- * @throws javax.xml.stream.XMLStreamException {@inheritDoc}
- */
- public void writeAttribute(String prefix,String namespaceURI,String localName,String value)throws XMLStreamException {
- if(currentNode.getNodeType() == Node.ELEMENT_NODE){
- if(namespaceURI == null ){
- throw new XMLStreamException("NamespaceURI cannot be null");
- }
- if(localName == null){
- throw new XMLStreamException("Local name cannot be null");
- }
- if(prefix == null){
- throw new XMLStreamException("prefix cannot be null");
- }
- String qualifiedName = null;
- if(prefix.equals("")){
- qualifiedName = localName;
- }else{
-
- qualifiedName = getQName(prefix,localName);
- }
- Attr attr = ownerDoc.createAttributeNS(namespaceURI, qualifiedName);
- attr.setValue(value);
- ((Element)currentNode).setAttributeNodeNS(attr);
- }else{
- //Convert node type to String
- throw new IllegalStateException("Current DOM Node type is "+ currentNode.getNodeType() +
- "and does not allow attributes to be set ");
- }
-
- }
-
- /**
- * Creates a CDATA object @see org.w3c.dom.CDATASection.
- * @param data {@inheritDoc}
- * @throws javax.xml.stream.XMLStreamException {@inheritDoc}
- */
- public void writeCData(String data) throws XMLStreamException {
- if(data == null){
- throw new XMLStreamException("CDATA cannot be null");
- }
-
- CDATASection cdata = ownerDoc.createCDATASection(data);
- getNode().appendChild(cdata);
- }
-
- /**
- * Creates a character object @see org.w3c.dom.Text and appends it to the current
- * element in the DOM tree.
- * @param charData {@inheritDoc}
- * @throws javax.xml.stream.XMLStreamException {@inheritDoc}
- */
- public void writeCharacters(String charData) throws XMLStreamException {
- Text text = ownerDoc.createTextNode(charData);
- currentNode.appendChild(text);
- }
-
- /**
- * Creates a character object @see org.w3c.dom.Text and appends it to the current
- * element in the DOM tree.
- * @param values {@inheritDoc}
- * @param param {@inheritDoc}
- * @param param2 {@inheritDoc}
- * @throws javax.xml.stream.XMLStreamException {@inheritDoc}
- */
- public void writeCharacters(char[] values, int param, int param2) throws XMLStreamException {
-
- Text text = ownerDoc.createTextNode(new String(values,param,param2));
- currentNode.appendChild(text);
- }
-
- /**
- * Creates a Comment object @see org.w3c.dom.Comment and appends it to the current
- * element in the DOM tree.
- * @param str {@inheritDoc}
- * @throws javax.xml.stream.XMLStreamException {@inheritDoc}
- */
- public void writeComment(String str) throws XMLStreamException {
- Comment comment = ownerDoc.createComment(str);
- getNode().appendChild(comment);
- }
-
- /**
- * This method is not supported in this implementation.
- * @param str {@inheritDoc}
- * @throws javax.xml.stream.XMLStreamException {@inheritDoc}
- */
- public void writeDTD(String str) throws XMLStreamException {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Creates a DOM attribute and adds it to the current element in the DOM tree.
- * @param namespaceURI {@inheritDoc}
- * @throws javax.xml.stream.XMLStreamException {@inheritDoc}
- */
- public void writeDefaultNamespace(String namespaceURI) throws XMLStreamException {
- if(currentNode.getNodeType() == Node.ELEMENT_NODE){
- String qname = XMLConstants.XMLNS_ATTRIBUTE;
- ((Element)currentNode).setAttributeNS(XMLConstants.XMLNS_ATTRIBUTE_NS_URI,qname, namespaceURI);
- }else{
- //Convert node type to String
- throw new IllegalStateException("Current DOM Node type is "+ currentNode.getNodeType() +
- "and does not allow attributes to be set ");
- }
- }
-
- /**
- * creates a DOM Element and appends it to the current element in the tree.
- * @param localName {@inheritDoc}
- * @throws javax.xml.stream.XMLStreamException {@inheritDoc}
- */
- public void writeEmptyElement(String localName) throws XMLStreamException {
- if(ownerDoc != null){
- Element element = ownerDoc.createElement(localName);
- if(currentNode!=null){
- currentNode.appendChild(element);
- }else{
- ownerDoc.appendChild(element);
- }
- }
-
- }
-
- /**
- * creates a DOM Element and appends it to the current element in the tree.
- * @param namespaceURI {@inheritDoc}
- * @param localName {@inheritDoc}
- * @throws javax.xml.stream.XMLStreamException {@inheritDoc}
- */
- public void writeEmptyElement(String namespaceURI, String localName) throws XMLStreamException {
- if(ownerDoc != null){
- String qualifiedName = null;
- String prefix = null;
- if(namespaceURI == null ){
- throw new XMLStreamException("NamespaceURI cannot be null");
- }
- if(localName == null){
- throw new XMLStreamException("Local name cannot be null");
- }
-
- if(namespaceContext != null){
- prefix = namespaceContext.getPrefix(namespaceURI);
- }
- if(prefix == null){
- throw new XMLStreamException("Namespace URI "+namespaceURI +
- "is not bound to any prefix" );
- }
- if("".equals(prefix)){
- qualifiedName = localName;
- }else{
-
- qualifiedName = getQName(prefix,localName);
-
- }
- Element element = ownerDoc.createElementNS(namespaceURI, qualifiedName);
- if(currentNode!=null){
- currentNode.appendChild(element);
- }else{
- ownerDoc.appendChild(element);
- }
- //currentNode = element;
- }
- }
-
- /**
- * creates a DOM Element and appends it to the current element in the tree.
- * @param prefix {@inheritDoc}
- * @param localName {@inheritDoc}
- * @param namespaceURI {@inheritDoc}
- * @throws javax.xml.stream.XMLStreamException {@inheritDoc}
- */
- public void writeEmptyElement(String prefix, String localName, String namespaceURI) throws XMLStreamException {
- if(ownerDoc != null){
- if(namespaceURI == null ){
- throw new XMLStreamException("NamespaceURI cannot be null");
- }
- if(localName == null){
- throw new XMLStreamException("Local name cannot be null");
- }
- if(prefix == null){
- throw new XMLStreamException("Prefix cannot be null");
- }
- String qualifiedName = null;
- if("".equals(prefix)){
- qualifiedName = localName;
- }else{
- qualifiedName = getQName(prefix,localName);
- }
- Element el = ownerDoc.createElementNS(namespaceURI,qualifiedName);
- if(currentNode!=null){
- currentNode.appendChild(el);
- }else{
- ownerDoc.appendChild(el);
- }
-
- }
- }
-
- /**
- * Will reset current Node pointer maintained by the implementation.
- * @throws javax.xml.stream.XMLStreamException {@inheritDoc}
- */
- public void writeEndDocument() throws XMLStreamException {
- //What do you want me to do eh! :)
- currentNode = null;
- for(int i=0; i< depth;i++){
- if(needContextPop[depth]){
- needContextPop[depth] = false;
- namespaceContext.popContext();
- }
- depth--;
- }
- depth =0;
- }
-
- /**
- * Internal current Node pointer will point to the parent of the current Node.
- * @throws javax.xml.stream.XMLStreamException {@inheritDoc}
- */
- public void writeEndElement() throws XMLStreamException {
- Node node= currentNode.getParentNode();
- if(currentNode.getNodeType() == Node.DOCUMENT_NODE){
- currentNode = null;
- }else{
- currentNode = node;
- }
- if(needContextPop[depth]){
- needContextPop[depth] = false;
- namespaceContext.popContext();
- }
- depth--;
- }
-
- /**
- * Is not supported in this implementation.
- * @param name {@inheritDoc}
- * @throws javax.xml.stream.XMLStreamException {@inheritDoc}
- */
- public void writeEntityRef(String name) throws XMLStreamException {
- EntityReference er = ownerDoc.createEntityReference(name);
- currentNode.appendChild(er);
- }
-
- /**
- * creates a namespace attribute and will associate it with the current element in
- * the DOM tree.
- * @param prefix {@inheritDoc}
- * @param namespaceURI {@inheritDoc}
- * @throws javax.xml.stream.XMLStreamException {@inheritDoc}
- */
- public void writeNamespace(String prefix, String namespaceURI) throws XMLStreamException {
-
- if (prefix == null) {
- throw new XMLStreamException("prefix cannot be null");
- }
-
- if (namespaceURI == null) {
- throw new XMLStreamException("NamespaceURI cannot be null");
- }
-
- String qname = null;
-
- if (prefix.equals("")) {
- qname = XMLConstants.XMLNS_ATTRIBUTE;
- } else {
- qname = getQName(XMLConstants.XMLNS_ATTRIBUTE,prefix);
- }
-
- ((Element)currentNode).setAttributeNS(XMLConstants.XMLNS_ATTRIBUTE_NS_URI,qname, namespaceURI);
- }
-
- /**
- * is not supported in this release.
- * @param target {@inheritDoc}
- * @throws javax.xml.stream.XMLStreamException {@inheritDoc}
- */
- public void writeProcessingInstruction(String target) throws XMLStreamException {
- if(target == null){
- throw new XMLStreamException("Target cannot be null");
- }
- ProcessingInstruction pi = ownerDoc.createProcessingInstruction(target, "");
- currentNode.appendChild(pi);
- }
-
- /**
- * is not supported in this release.
- * @param target {@inheritDoc}
- * @param data {@inheritDoc}
- * @throws javax.xml.stream.XMLStreamException {@inheritDoc}
- */
- public void writeProcessingInstruction(String target, String data) throws XMLStreamException {
- if(target == null){
- throw new XMLStreamException("Target cannot be null");
- }
- ProcessingInstruction pi = ownerDoc.createProcessingInstruction(target, data);
- currentNode.appendChild(pi);
- }
-
- /**
- * will set version on the Document object when the DOM Node passed to this implementation
- * supports DOM Level3 API's.
- * @throws javax.xml.stream.XMLStreamException {@inheritDoc}
- */
- public void writeStartDocument() throws XMLStreamException {
- try{
- if(mXmlVersion != null){
- mXmlVersion.invoke(ownerDoc, new Object[] {"1.0"});
- }
- }catch(IllegalAccessException iae){
- throw new XMLStreamException(iae);
- }catch(InvocationTargetException ite){
- throw new XMLStreamException(ite);
- }
- }
-
- /**
- * will set version on the Document object when the DOM Node passed to this implementation
- * supports DOM Level3 API's.
- * @param version {@inheritDoc}
- * @throws javax.xml.stream.XMLStreamException {@inheritDoc}
- */
- public void writeStartDocument(String version) throws XMLStreamException {
- try{
- if(mXmlVersion != null){
- mXmlVersion.invoke(ownerDoc, new Object[] {version});
- }
- }catch(IllegalAccessException iae){
- throw new XMLStreamException(iae);
- }catch(InvocationTargetException ite){
- throw new XMLStreamException(ite);
- }
- }
-
- /**
- * will set version on the Document object when the DOM Node passed to this implementation
- * supports DOM Level3 API's.
- * @param encoding {@inheritDoc}
- * @param version {@inheritDoc}
- * @throws javax.xml.stream.XMLStreamException {@inheritDoc}
- */
- public void writeStartDocument(String encoding, String version) throws XMLStreamException {
- try{
- if(mXmlVersion != null){
- mXmlVersion.invoke(ownerDoc, new Object[] {version});
- }
- }catch(IllegalAccessException iae){
- throw new XMLStreamException(iae);
- }catch(InvocationTargetException ite){
- throw new XMLStreamException(ite);
- }
- //TODO: What to do with encoding.-Venu
- }
-
- /**
- * creates a DOM Element and appends it to the current element in the tree.
- * @param localName {@inheritDoc}
- * @throws javax.xml.stream.XMLStreamException {@inheritDoc}
- */
- public void writeStartElement(String localName) throws XMLStreamException {
- if(ownerDoc != null){
- Element element = ownerDoc.createElement(localName);
- if(currentNode!=null){
- currentNode.appendChild(element);
- }else{
- ownerDoc.appendChild(element);
- }
- currentNode = element;
- }
- if(needContextPop[depth]){
- namespaceContext.pushContext();
- }
- incDepth();
- }
-
- /**
- * creates a DOM Element and appends it to the current element in the tree.
- * @param namespaceURI {@inheritDoc}
- * @param localName {@inheritDoc}
- * @throws javax.xml.stream.XMLStreamException {@inheritDoc}
- */
- public void writeStartElement(String namespaceURI, String localName) throws XMLStreamException {
- if(ownerDoc != null){
- String qualifiedName = null;
- String prefix = null;
-
- if(namespaceURI == null ){
- throw new XMLStreamException("NamespaceURI cannot be null");
- }
- if(localName == null){
- throw new XMLStreamException("Local name cannot be null");
- }
-
- if(namespaceContext != null){
- prefix = namespaceContext.getPrefix(namespaceURI);
- }
- if(prefix == null){
- throw new XMLStreamException("Namespace URI "+namespaceURI +
- "is not bound to any prefix" );
- }
- if("".equals(prefix)){
- qualifiedName = localName;
- }else{
- qualifiedName = getQName(prefix,localName);
- }
-
- Element element = ownerDoc.createElementNS(namespaceURI, qualifiedName);
-
- if(currentNode!=null){
- currentNode.appendChild(element);
- }else{
- ownerDoc.appendChild(element);
- }
- currentNode = element;
- }
- if(needContextPop[depth]){
- namespaceContext.pushContext();
- }
- incDepth();
- }
-
- /**
- * creates a DOM Element and appends it to the current element in the tree.
- * @param prefix {@inheritDoc}
- * @param localName {@inheritDoc}
- * @param namespaceURI {@inheritDoc}
- * @throws javax.xml.stream.XMLStreamException {@inheritDoc}
- */
- public void writeStartElement(String prefix, String localName, String namespaceURI) throws XMLStreamException {
-
- if(ownerDoc != null){
- String qname = null;
- if(namespaceURI == null ){
- throw new XMLStreamException("NamespaceURI cannot be null");
- }
- if(localName == null){
- throw new XMLStreamException("Local name cannot be null");
- }
- if(prefix == null){
- throw new XMLStreamException("Prefix cannot be null");
- }
-
- if(prefix.equals("")){
- qname = localName;
- }else{
- qname = getQName(prefix,localName);
- }
-
- Element el = ownerDoc.createElementNS(namespaceURI,qname);
-
- if(currentNode!=null){
- currentNode.appendChild(el);
- }else{
- ownerDoc.appendChild(el);
- }
- currentNode = el;
- if(needContextPop[depth]){
- namespaceContext.pushContext();
- }
- incDepth();
-
- }
- }
-
- private String getQName(String prefix , String localName){
- stringBuffer.setLength(0);
- stringBuffer.append(prefix);
- stringBuffer.append(":");
- stringBuffer.append(localName);
- return stringBuffer.toString();
- }
-
- private Node getNode(){
- if(currentNode == null){
- return ownerDoc;
- } else{
- return currentNode;
- }
- }
- private void incDepth() {
- depth++;
- if (depth == needContextPop.length) {
- boolean[] array = new boolean[depth + resizeValue];
- System.arraycopy(needContextPop, 0, array, 0, depth);
- needContextPop = array;
- }
- }
-}
diff --git a/src/com/sun/xml/internal/stream/writers/XMLEventWriterImpl.java b/src/com/sun/xml/internal/stream/writers/XMLEventWriterImpl.java
deleted file mode 100644
index 8acbd32..0000000
--- a/src/com/sun/xml/internal/stream/writers/XMLEventWriterImpl.java
+++ /dev/null
@@ -1,261 +0,0 @@
-/*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.xml.internal.stream.writers;
-
-import java.util.Iterator;
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLEventWriter;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.events.Attribute;
-import javax.xml.stream.events.Characters;
-import javax.xml.stream.events.Comment;
-import javax.xml.stream.events.DTD;
-import javax.xml.stream.events.EntityReference;
-import javax.xml.stream.events.Namespace;
-import javax.xml.stream.events.ProcessingInstruction;
-import javax.xml.stream.events.StartDocument;
-import javax.xml.stream.events.StartElement;
-import javax.xml.stream.events.XMLEvent;
-import javax.xml.stream.XMLStreamWriter;
-
-/**
- *
- * @author Neeraj Bajaj, Sun Microsystems.
- *
- */
-public class XMLEventWriterImpl implements XMLEventWriter{
-
- //delegate everything to XMLStreamWriter..
- private XMLStreamWriter fStreamWriter ;
- private static final boolean DEBUG = false;
- /**
- *
- * @param streamWriter
- */
- public XMLEventWriterImpl(XMLStreamWriter streamWriter){
- fStreamWriter = streamWriter;
- }
-
- /**
- *
- * @param xMLEventReader
- * @throws XMLStreamException
- */
- public void add(javax.xml.stream.XMLEventReader xMLEventReader) throws javax.xml.stream.XMLStreamException {
- if(xMLEventReader == null) throw new XMLStreamException("Event reader shouldn't be null");
- while(xMLEventReader.hasNext()){
- add(xMLEventReader.nextEvent());
- }
- }
-
- /**
- *
- * @param xMLEvent
- * @throws XMLStreamException
- */
- public void add(javax.xml.stream.events.XMLEvent xMLEvent) throws javax.xml.stream.XMLStreamException {
- int type = xMLEvent.getEventType();
- switch(type){
- case XMLEvent.DTD:{
- DTD dtd = (DTD)xMLEvent ;
- if (DEBUG)System.out.println("Adding DTD = " + dtd.toString());
- fStreamWriter.writeDTD(dtd.getDocumentTypeDeclaration());
- break;
- }
- case XMLEvent.START_DOCUMENT :{
- StartDocument startDocument = (StartDocument)xMLEvent ;
- if (DEBUG)System.out.println("Adding StartDocument = " + startDocument.toString());
- try {
- fStreamWriter.writeStartDocument(startDocument.getCharacterEncodingScheme(), startDocument.getVersion());
- }catch(XMLStreamException e) {
- fStreamWriter.writeStartDocument(startDocument.getVersion());
- }
- break;
- }
- case XMLEvent.START_ELEMENT :{
- StartElement startElement = xMLEvent.asStartElement() ;
- if (DEBUG)System.out.println("Adding startelement = " + startElement.toString());
- QName qname = startElement.getName();
- fStreamWriter.writeStartElement(qname.getPrefix(), qname.getLocalPart(), qname.getNamespaceURI());
-
- //getNamespaces() Returns an Iterator of namespaces declared on this element. This Iterator does not contain
- //previously declared namespaces unless they appear on the current START_ELEMENT. Therefore
- //this list may contain redeclared namespaces and duplicate namespace declarations. Use the
- //getNamespaceContext() method to get the current context of namespace declarations.
-
- //so we should be using getNamespaces() to write namespace declarations for this START_ELEMENT
- Iterator iterator = startElement.getNamespaces();
- while(iterator.hasNext()){
- Namespace namespace = (Namespace)iterator.next();
- fStreamWriter.writeNamespace(namespace.getPrefix(), namespace.getNamespaceURI());
- }
- //REVISIT: What about writing attributes ?
- Iterator attributes = startElement.getAttributes();
- while(attributes.hasNext()){
- Attribute attribute = (Attribute)attributes.next();
- QName aqname = attribute.getName();
- fStreamWriter.writeAttribute(aqname.getPrefix(), aqname.getNamespaceURI(), aqname.getLocalPart(),attribute.getValue());
- }
- break;
- }
- case XMLEvent.NAMESPACE:{
- Namespace namespace = (Namespace)xMLEvent;
- if (DEBUG)System.out.println("Adding namespace = " + namespace.toString());
- fStreamWriter.writeNamespace(namespace.getPrefix(), namespace.getNamespaceURI());
- break ;
- }
- case XMLEvent.COMMENT: {
- Comment comment = (Comment)xMLEvent ;
- if (DEBUG)System.out.println("Adding comment = " + comment.toString());
- fStreamWriter.writeComment(comment.getText());
- break;
- }
- case XMLEvent.PROCESSING_INSTRUCTION:{
- ProcessingInstruction processingInstruction = (ProcessingInstruction)xMLEvent ;
- if (DEBUG)System.out.println("Adding processing instruction = " + processingInstruction.toString());
- fStreamWriter.writeProcessingInstruction(processingInstruction.getTarget(), processingInstruction.getData());
- break;
- }
- case XMLEvent.CHARACTERS:{
- Characters characters = xMLEvent.asCharacters();
- if (DEBUG)System.out.println("Adding characters = " + characters.toString());
- //check if the CHARACTERS are CDATA
- if(characters.isCData()){
- fStreamWriter.writeCData(characters.getData());
- }
- else{
- fStreamWriter.writeCharacters(characters.getData());
- }
- break;
- }
- case XMLEvent.ENTITY_REFERENCE:{
- EntityReference entityReference = (EntityReference)xMLEvent ;
- if (DEBUG)System.out.println("Adding Entity Reference = "+ entityReference.toString());
- fStreamWriter.writeEntityRef(entityReference.getName());
- break;
- }
- case XMLEvent.ATTRIBUTE:{
- Attribute attribute = (Attribute)xMLEvent;
- if (DEBUG)System.out.println("Adding Attribute = " + attribute.toString());
- QName qname = attribute.getName();
- fStreamWriter.writeAttribute(qname.getPrefix(), qname.getNamespaceURI(), qname.getLocalPart(),attribute.getValue());
- break;
- }
- case XMLEvent.CDATA:{
- //there is no separate CDATA datatype but CDATA event can be reported
- //by using vendor specific CDATA property.
- Characters characters = (Characters)xMLEvent;
- if (DEBUG)System.out.println("Adding characters = " + characters.toString());
- if(characters.isCData()){
- fStreamWriter.writeCData(characters.getData());
- }
- break;
- }
- //xxx: Why there isn't any event called Notation.
- //case XMLEvent.NOTATION_DECLARATION:{
- //}
-
- case XMLEvent.END_ELEMENT:{
- //we dont need to typecast it.. just call writeEndElement() and fStreamWriter will take care of it.
- //EndElement endElement = (EndElement)xMLEvent;
- fStreamWriter.writeEndElement();
- break;
- }
- case XMLEvent.END_DOCUMENT:{
- //we dont need to typecast just call writeEndDocument() and fStreamWriter will take care rest.
- //EndDocument endDocument = (EndDocument)xMLEvent;
- fStreamWriter.writeEndDocument();
- break;
- }
- //throw new XMLStreamException("Unknown Event type = " + type);
- };
-
- }
-
- /**
- *
- * @throws XMLStreamException
- */
- public void close() throws javax.xml.stream.XMLStreamException {
- fStreamWriter.close();
- }
-
- /**
- *
- * @throws XMLStreamException will inturn call flush on the stream to which data is being
- * written.
- */
- public void flush() throws javax.xml.stream.XMLStreamException {
- fStreamWriter.flush();
- }
-
- /**
- *
- * @return
- */
- public javax.xml.namespace.NamespaceContext getNamespaceContext() {
- return fStreamWriter.getNamespaceContext();
- }
-
- /**
- *
- * @param namespaceURI Namespace URI
- * @throws XMLStreamException
- * @return prefix associated with the URI.
- */
- public String getPrefix(String namespaceURI) throws javax.xml.stream.XMLStreamException {
- return fStreamWriter.getPrefix(namespaceURI);
- }
-
- /**
- *
- * @param uri Namespace URI
- * @throws XMLStreamException
- */
- public void setDefaultNamespace(String uri) throws javax.xml.stream.XMLStreamException {
- fStreamWriter.setDefaultNamespace(uri);
- }
-
- /**
- *
- * @param namespaceContext Namespace Context
- * @throws XMLStreamException
- */
- public void setNamespaceContext(javax.xml.namespace.NamespaceContext namespaceContext) throws javax.xml.stream.XMLStreamException {
- fStreamWriter.setNamespaceContext(namespaceContext);
- }
-
- /**
- *
- * @param prefix namespace prefix associated with the uri.
- * @param uri Namespace URI
- * @throws XMLStreamException
- */
- public void setPrefix(String prefix, String uri) throws javax.xml.stream.XMLStreamException {
- fStreamWriter.setPrefix(prefix, uri);
- }
-
-}//XMLEventWriterImpl
diff --git a/src/com/sun/xml/internal/stream/writers/XMLOutputSource.java b/src/com/sun/xml/internal/stream/writers/XMLOutputSource.java
deleted file mode 100644
index 5a2c55a..0000000
--- a/src/com/sun/xml/internal/stream/writers/XMLOutputSource.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.xml.internal.stream.writers;
-
-import java.io.OutputStream;
-import java.io.Writer;
-
-/**
- * XMLOutputSource.
- *
- * Encapuslates the information about the source where
- * XML output needs to be written.
- *
- * @author Neeraj Bajaj
- */
-public class XMLOutputSource {
-
- /** Creates a new instance of XMLOutputSource */
- public XMLOutputSource() {
- }
-
-}
diff --git a/src/com/sun/xml/internal/stream/writers/XMLStreamWriterImpl.java b/src/com/sun/xml/internal/stream/writers/XMLStreamWriterImpl.java
deleted file mode 100644
index f3b9b50..0000000
--- a/src/com/sun/xml/internal/stream/writers/XMLStreamWriterImpl.java
+++ /dev/null
@@ -1,2206 +0,0 @@
-/*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.xml.internal.stream.writers;
-
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.nio.charset.Charset;
-import java.nio.charset.CharsetEncoder;
-import java.util.AbstractMap;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Random;
-import java.util.Vector;
-import java.util.Set;
-import java.util.Iterator;
-
-import javax.xml.XMLConstants;
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.stream.XMLOutputFactory;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamWriter;
-import javax.xml.transform.stream.StreamResult;
-
-import com.sun.org.apache.xerces.internal.impl.Constants;
-import com.sun.org.apache.xerces.internal.impl.PropertyManager;
-import com.sun.org.apache.xerces.internal.util.NamespaceSupport;
-import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
-import com.sun.org.apache.xerces.internal.xni.QName;
-
-import com.sun.xml.internal.stream.util.ReadOnlyIterator;
-
-/**
- * This class implements a StAX XMLStreamWriter. It extends
- * <code>AbstractMap</code> in order to support a getter for
- * implementation-specific properties. For example, you can get
- * the underlying <code>OutputStream</code> by casting an instance
- * of this class to <code>Map</code> and calling
- * <code>getProperty(OUTPUTSTREAM_PROPERTY)</code>.
- *
- * @author Neeraj Bajaj
- * @author K.Venugopal
- * @author Santiago.Pericas-Geertsen@sun.com
- * @author Sunitha.Reddy@sun.com
- */
-public final class XMLStreamWriterImpl extends AbstractMap implements XMLStreamWriter {
-
- public static final String START_COMMENT = "<!--";
- public static final String END_COMMENT = "-->";
- public static final String DEFAULT_ENCODING = " encoding=\"utf-8\"";
- public static final String DEFAULT_XMLDECL = "<?xml version=\"1.0\" ?>";
- public static final String DEFAULT_XML_VERSION = "1.0";
- public static final char CLOSE_START_TAG = '>';
- public static final char OPEN_START_TAG = '<';
- public static final String OPEN_END_TAG = "</";
- public static final char CLOSE_END_TAG = '>';
- public static final String START_CDATA = "<![CDATA[";
- public static final String END_CDATA = "]]>";
- public static final String CLOSE_EMPTY_ELEMENT = "/>";
- public static final String SPACE = " ";
- public static final String UTF_8 = "UTF-8";
-
- public static final String OUTPUTSTREAM_PROPERTY = "sjsxp-outputstream";
-
- /**
- * This flag can be used to turn escaping off for content. It does
- * not apply to attribute content.
- */
- boolean fEscapeCharacters = true;
-
- /**
- * Flag for the value of repairNamespace property
- */
- private boolean fIsRepairingNamespace = false;
-
- /**
- * Underlying Writer to which characters are written.
- */
- private Writer fWriter;
-
- /**
- * Underlying OutputStream to which <code>fWriter</code>
- * writes to. May be null if unknown.
- */
- private OutputStream fOutputStream = null;
-
- /**
- * Collects attributes when the writer is in reparing mode.
- */
- private ArrayList fAttributeCache;
-
- /**
- * Collects namespace declarations when the writer is in reparing mode.
- */
- private ArrayList fNamespaceDecls;
-
- /**
- * Namespace context encapsulating user specified context
- * and context built by the writer
- */
- private NamespaceContextImpl fNamespaceContext = null;
-
- private NamespaceSupport fInternalNamespaceContext = null;
-
- private Random fPrefixGen = null;
-
- /**
- * Reference to PropertyManager
- */
- private PropertyManager fPropertyManager = null;
-
- /**
- * Flag to track if start tag is opened
- */
- private boolean fStartTagOpened = false;
-
- /**
- * Boolean flag to indicate, if instance can be reused
- */
- private boolean fReuse;
-
- private SymbolTable fSymbolTable = new SymbolTable();
-
- private ElementStack fElementStack = new ElementStack(); //Change this .-Venu
-
- final private String DEFAULT_PREFIX = fSymbolTable.addSymbol("");
-
- private final ReadOnlyIterator fReadOnlyIterator = new ReadOnlyIterator();
-
- /**
- * In some cases, this charset encoder is used to determine if a char is
- * encodable by underlying writer. For example, an 8-bit char from the
- * extended ASCII set is not encodable by 7-bit ASCII encoder. Unencodable
- * chars are escaped using XML numeric entities.
- */
- private CharsetEncoder fEncoder = null;
-
- /**
- * This is used to hold the namespace for attributes which happen to have
- * the same uri as the default namespace; It's added to avoid changing the
- * current impl. which has many redundant code for the repair mode
- */
- HashMap fAttrNamespace = null;
-
- /**
- * Creates a new instance of XMLStreamWriterImpl. Uses platform's default
- * encoding.
- *
- * @param outputStream Underlying stream to write the bytes to
- * @param props Properties used by this writer
- */
- public XMLStreamWriterImpl(OutputStream outputStream, PropertyManager props)
- throws IOException {
-
- // cannot call this(outputStream, null, props); for constructor,
- // OutputStreamWriter charsetName cannot be null
-
- // use default encoding
- this(new OutputStreamWriter(outputStream), props);
- }
-
- /**
- * Creates a new instance of XMLStreamWriterImpl.
- *
- * @param outputStream Underlying stream to write the bytes
- * @param encoding Encoding used to convert chars into bytes
- * @param props Properties used by this writer
- */
- public XMLStreamWriterImpl(OutputStream outputStream, String encoding,
- PropertyManager props) throws java.io.IOException {
- this(new StreamResult(outputStream), encoding, props);
- }
-
- /**
- * Creates a new instance of XMLStreamWriterImpl using a Writer.
- *
- * @param writer Underlying writer to which chars are written
- * @param props Properties used by this writer
- */
- public XMLStreamWriterImpl(Writer writer, PropertyManager props)
- throws java.io.IOException {
- this(new StreamResult(writer), null, props);
- }
-
- /**
- * Creates a new instance of XMLStreamWriterImpl using a StreamResult.
- * A StreamResult encasupates an OutputStream, a Writer or a SystemId.
- *
- * @param writer Underlying writer to which chars are written
- * @param props Properties used by this writer
- */
- public XMLStreamWriterImpl(StreamResult sr, String encoding,
- PropertyManager props) throws java.io.IOException {
- setOutput(sr, encoding);
- fPropertyManager = props;
- init();
- }
-
- /**
- * Initialize an instance of this XMLStreamWriter. Allocate new instances
- * for all the data structures. Set internal flags based on property values.
- */
- private void init() {
- fReuse = false;
- fNamespaceDecls = new ArrayList();
- fPrefixGen = new Random();
- fAttributeCache = new ArrayList();
- fInternalNamespaceContext = new NamespaceSupport();
- fInternalNamespaceContext.reset();
- fNamespaceContext = new NamespaceContextImpl();
- fNamespaceContext.internalContext = fInternalNamespaceContext;
-
- // Set internal state based on property values
- Boolean ob = (Boolean) fPropertyManager.getProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES);
- fIsRepairingNamespace = ob.booleanValue();
- ob = (Boolean) fPropertyManager.getProperty(Constants.ESCAPE_CHARACTERS);
- setEscapeCharacters(ob.booleanValue());
- }
-
- /**
- * Reset this instance so that it can be re-used. Do not read properties
- * again. The method <code>setOutput(StreamResult, encoding)</code> must
- * be called after this one.
- */
- public void reset() {
- reset(false);
- }
-
- /**
- * Reset this instance so that it can be re-used. Clears but does not
- * re-allocate internal data structures.
- *
- * @param resetProperties Indicates if properties should be read again
- */
- void reset(boolean resetProperties) {
- if (!fReuse) {
- throw new java.lang.IllegalStateException(
- "close() Must be called before calling reset()");
- }
-
- fReuse = false;
- fNamespaceDecls.clear();
- fAttributeCache.clear();
-
- // reset Element/NamespaceContext stacks
- fElementStack.clear();
- fInternalNamespaceContext.reset();
-
- fStartTagOpened = false;
- fNamespaceContext.userContext = null;
-
- if (resetProperties) {
- Boolean ob = (Boolean) fPropertyManager.getProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES);
- fIsRepairingNamespace = ob.booleanValue();
- ob = (Boolean) fPropertyManager.getProperty(Constants.ESCAPE_CHARACTERS);
- setEscapeCharacters(ob.booleanValue());
- }
- }
-
- /**
- * Use a StreamResult to initialize the output for this XMLStreamWriter. Check
- * for OutputStream, Writer and then systemId, in that order.
- *
- * @param sr StreamResult encapsulating output information
- * @param encoding Encoding to be used except when a Writer is available
- */
- public void setOutput(StreamResult sr, String encoding)
- throws IOException {
-
- if (sr.getOutputStream() != null) {
- setOutputUsingStream(sr.getOutputStream(), encoding);
- }
- else if (sr.getWriter() != null) {
- setOutputUsingWriter(sr.getWriter());
- }
- else if (sr.getSystemId() != null) {
- setOutputUsingStream(new FileOutputStream(sr.getSystemId()),
- encoding);
- }
- }
-
- private void setOutputUsingWriter(Writer writer)
- throws IOException
- {
- fWriter = writer;
-
- if (writer instanceof OutputStreamWriter) {
- String charset = ((OutputStreamWriter) writer).getEncoding();
- if (charset != null && !charset.equalsIgnoreCase("utf-8")) {
- fEncoder = Charset.forName(charset).newEncoder();
- }
- }
- }
-
- /**
- * Utility method to create a writer when passed an OutputStream. Make
- * sure to wrap an <code>OutputStreamWriter</code> using an
- * <code>XMLWriter</code> for performance reasons.
- *
- * @param os Underlying OutputStream
- * @param encoding Encoding used to convert chars into bytes
- */
- private void setOutputUsingStream(OutputStream os, String encoding)
- throws IOException {
- fOutputStream = os;
-
- if (encoding != null) {
- if (encoding.equalsIgnoreCase("utf-8")) {
- fWriter = new UTF8OutputStreamWriter(os);
- }
- else {
- fWriter = new XMLWriter(new OutputStreamWriter(os, encoding));
- fEncoder = Charset.forName(encoding).newEncoder();
- }
- } else {
- encoding = SecuritySupport.getSystemProperty("file.encoding");
- if (encoding != null && encoding.equalsIgnoreCase("utf-8")) {
- fWriter = new UTF8OutputStreamWriter(os);
- } else {
- fWriter = new XMLWriter(new OutputStreamWriter(os));
- }
- }
- }
-
- /** Can this instance be reused
- *
- * @return boolean boolean value to indicate if this instance can be reused or not
- */
- public boolean canReuse() {
- return fReuse;
- }
-
- public void setEscapeCharacters(boolean escape) {
- fEscapeCharacters = escape;
- }
-
- public boolean getEscapeCharacters() {
- return fEscapeCharacters;
- }
-
- /**
- * Close this XMLStreamWriter by closing underlying writer.
- */
- public void close() throws XMLStreamException {
- if (fWriter != null) {
- try {
- //fWriter.close();
- fWriter.flush();
- } catch (IOException e) {
- throw new XMLStreamException(e);
- }
- }
- fWriter = null;
- fOutputStream = null;
- fNamespaceDecls.clear();
- fAttributeCache.clear();
- fElementStack.clear();
- fInternalNamespaceContext.reset();
- fReuse = true;
- fStartTagOpened = false;
- fNamespaceContext.userContext = null;
- }
-
- /**
- * Flush this XMLStreamWriter by flushin underlying writer.
- */
- public void flush() throws XMLStreamException {
- try {
- fWriter.flush();
- } catch (IOException e) {
- throw new XMLStreamException(e);
- }
- }
-
- /**
- * Return <code>NamespaceContext</code> being used by the writer.
- *
- * @return NamespaceContext
- */
- public NamespaceContext getNamespaceContext() {
- return fNamespaceContext;
- }
-
- /**
- * Return a prefix associated with specified uri, or null if the
- * uri is unknown.
- *
- * @param uri The namespace uri
- * @throws XMLStreamException if uri specified is "" or null
- */
- public String getPrefix(String uri) throws XMLStreamException {
- return fNamespaceContext.getPrefix(uri);
- }
-
- /**
- * Returns value associated with the specified property name.
- *
- * @param str Property name
- * @throws IllegalArgumentException if the specified property is not supported
- * @return value associated with the specified property.
- */
- public Object getProperty(String str)
- throws IllegalArgumentException {
- if (str == null) {
- throw new NullPointerException();
- }
-
- if (!fPropertyManager.containsProperty(str)) {
- throw new IllegalArgumentException("Property '" + str +
- "' is not supported");
- }
-
- return fPropertyManager.getProperty(str);
- }
-
- /**
- * Set the specified URI as default namespace in the current namespace context.
- *
- * @param uri Namespace URI
- */
- public void setDefaultNamespace(String uri) throws XMLStreamException {
- if (uri != null) {
- uri = fSymbolTable.addSymbol(uri);
- }
-
- if (fIsRepairingNamespace) {
- if (isDefaultNamespace(uri)) {
- return;
- }
-
- QName qname = new QName();
- qname.setValues(DEFAULT_PREFIX, "xmlns", null, uri);
- fNamespaceDecls.add(qname);
- } else {
- fInternalNamespaceContext.declarePrefix(DEFAULT_PREFIX, uri);
- }
- }
-
- /**
- * Sets the current <code>NamespaceContext</code> for prefix and uri bindings.
- * This context becomes the root namespace context for writing and
- * will replace the current root namespace context. Subsequent calls
- * to setPrefix and setDefaultNamespace will bind namespaces using
- * the context passed to the method as the root context for resolving
- * namespaces. This method may only be called once at the start of the
- * document. It does not cause the namespaces to be declared. If a
- * namespace URI to prefix mapping is found in the namespace context
- * it is treated as declared and the prefix may be used by the
- * <code>XMLStreamWriter</code>.
- *
- * @param namespaceContext the namespace context to use for this writer, may not be null
- * @throws XMLStreamException
- */
- public void setNamespaceContext(NamespaceContext namespaceContext)
- throws XMLStreamException {
- fNamespaceContext.userContext = namespaceContext;
- }
-
- /**
- * Sets the prefix the uri is bound to. This prefix is bound in the scope of
- * the current START_ELEMENT / END_ELEMENT pair. If this method is called before
- * a START_ELEMENT has been written the prefix is bound in the root scope.
- *
- * @param prefix
- * @param uri
- * @throws XMLStreamException
- */
- public void setPrefix(String prefix, String uri) throws XMLStreamException {
-
- if (prefix == null) {
- throw new XMLStreamException("Prefix cannot be null");
- }
-
- if (uri == null) {
- throw new XMLStreamException("URI cannot be null");
- }
-
- prefix = fSymbolTable.addSymbol(prefix);
- uri = fSymbolTable.addSymbol(uri);
-
- if (fIsRepairingNamespace) {
- String tmpURI = fInternalNamespaceContext.getURI(prefix);
-
- if ((tmpURI != null) && (tmpURI == uri)) {
- return;
- }
-
- if(checkUserNamespaceContext(prefix,uri))
- return;
- QName qname = new QName();
- qname.setValues(prefix,XMLConstants.XMLNS_ATTRIBUTE, null,uri);
- fNamespaceDecls.add(qname);
-
- return;
- }
-
- fInternalNamespaceContext.declarePrefix(prefix, uri);
- }
-
- public void writeAttribute(String localName, String value)
- throws XMLStreamException {
- try {
- if (!fStartTagOpened) {
- throw new XMLStreamException(
- "Attribute not associated with any element");
- }
-
- if (fIsRepairingNamespace) {
- Attribute attr = new Attribute(value); // Revisit:Dont create new one's. Reuse.-Venu
- attr.setValues(null, localName, null, null);
- fAttributeCache.add(attr);
-
- return;
- }
-
- fWriter.write(" ");
- fWriter.write(localName);
- fWriter.write("=\"");
- writeXMLContent(
- value,
- true, // true = escapeChars
- true); // true = escapeDoubleQuotes
- fWriter.write("\"");
- } catch (IOException e) {
- throw new XMLStreamException(e);
- }
- }
-
- public void writeAttribute(String namespaceURI, String localName,
- String value) throws XMLStreamException {
- try {
- if (!fStartTagOpened) {
- throw new XMLStreamException(
- "Attribute not associated with any element");
- }
-
- if (namespaceURI == null) {
- throw new XMLStreamException("NamespaceURI cannot be null");
- }
-
- namespaceURI = fSymbolTable.addSymbol(namespaceURI);
-
- String prefix = fInternalNamespaceContext.getPrefix(namespaceURI);
-
- if (!fIsRepairingNamespace) {
- if (prefix == null) {
- throw new XMLStreamException("Prefix cannot be null");
- }
-
- writeAttributeWithPrefix(prefix, localName, value);
- } else {
- Attribute attr = new Attribute(value);
- attr.setValues(null, localName, null, namespaceURI);
- fAttributeCache.add(attr);
- }
- } catch (IOException e) {
- throw new XMLStreamException(e);
- }
- }
-
- private void writeAttributeWithPrefix(String prefix, String localName,
- String value) throws IOException {
- fWriter.write(SPACE);
-
- if ((prefix != null) && (prefix != XMLConstants.DEFAULT_NS_PREFIX)) {
- fWriter.write(prefix);
- fWriter.write(":");
- }
-
- fWriter.write(localName);
- fWriter.write("=\"");
- writeXMLContent(value,
- true, // true = escapeChars
- true); // true = escapeDoubleQuotes
- fWriter.write("\"");
- }
-
- public void writeAttribute(String prefix, String namespaceURI,
- String localName, String value) throws XMLStreamException {
- try {
- if (!fStartTagOpened) {
- throw new XMLStreamException(
- "Attribute not associated with any element");
- }
-
- if (namespaceURI == null) {
- throw new XMLStreamException("NamespaceURI cannot be null");
- }
-
- if (localName == null) {
- throw new XMLStreamException("Local name cannot be null");
- }
-
- if (!fIsRepairingNamespace) {
- if (prefix == null || prefix.equals("")){
- if (!namespaceURI.equals("")) {
- throw new XMLStreamException("prefix cannot be null or empty");
- } else {
- writeAttributeWithPrefix(null, localName, value);
- return;
- }
- }
-
- if (!prefix.equals(XMLConstants.XML_NS_PREFIX) || !namespaceURI.equals(XMLConstants.XML_NS_URI)) {
-
- prefix = fSymbolTable.addSymbol(prefix);
- namespaceURI = fSymbolTable.addSymbol(namespaceURI);
-
- if (fInternalNamespaceContext.containsPrefixInCurrentContext(prefix)){
-
- String tmpURI = fInternalNamespaceContext.getURI(prefix);
-
- if (tmpURI != null && tmpURI != namespaceURI){
- throw new XMLStreamException("Prefix "+prefix+" is " +
- "already bound to "+tmpURI+
- ". Trying to rebind it to "+namespaceURI+" is an error.");
- }
- }
- fInternalNamespaceContext.declarePrefix(prefix, namespaceURI);
- }
- writeAttributeWithPrefix(prefix, localName, value);
- } else {
- if (prefix != null) {
- prefix = fSymbolTable.addSymbol(prefix);
- }
-
- namespaceURI = fSymbolTable.addSymbol(namespaceURI);
-
- Attribute attr = new Attribute(value);
- attr.setValues(prefix, localName, null, namespaceURI);
- fAttributeCache.add(attr);
- }
- } catch (IOException e) {
- throw new XMLStreamException(e);
- }
- }
-
- public void writeCData(String cdata) throws XMLStreamException {
- try {
- if (cdata == null) {
- throw new XMLStreamException("cdata cannot be null");
- }
-
- if (fStartTagOpened) {
- closeStartTag();
- }
-
- fWriter.write(START_CDATA);
- fWriter.write(cdata);
- fWriter.write(END_CDATA);
- } catch (IOException e) {
- throw new XMLStreamException(e);
- }
- }
-
- public void writeCharacters(String data) throws XMLStreamException {
- try {
- if (fStartTagOpened) {
- closeStartTag();
- }
-
- writeXMLContent(data);
- } catch (IOException e) {
- throw new XMLStreamException(e);
- }
- }
-
- public void writeCharacters(char[] data, int start, int len)
- throws XMLStreamException {
- try {
- if (fStartTagOpened) {
- closeStartTag();
- }
-
- writeXMLContent(data, start, len, fEscapeCharacters);
- } catch (IOException e) {
- throw new XMLStreamException(e);
- }
- }
-
- public void writeComment(String comment) throws XMLStreamException {
- try {
- if (fStartTagOpened) {
- closeStartTag();
- }
-
- fWriter.write(START_COMMENT);
-
- if (comment != null) {
- fWriter.write(comment);
- }
-
- fWriter.write(END_COMMENT);
- } catch (IOException e) {
- throw new XMLStreamException(e);
- }
- }
-
- public void writeDTD(String dtd) throws XMLStreamException {
- try {
- if (fStartTagOpened) {
- closeStartTag();
- }
-
- fWriter.write(dtd);
- } catch (IOException e) {
- throw new XMLStreamException(e);
- }
- }
-
- /*
- * Write default Namespace.
- *
- * If namespaceURI == null,
- * then it is assumed to be equivilent to {@link XMLConstants.NULL_NS_URI},
- * i.e. there is no Namespace.
- *
- * @param namespaceURI NamespaceURI to declare.
- *
- * @throws XMLStreamException
- *
- * @see <a href="http://www.w3.org/TR/REC-xml-names/#defaulting">
- * Namespaces in XML, 5.2 Namespace Defaulting</a>
- */
- public void writeDefaultNamespace(String namespaceURI)
- throws XMLStreamException {
-
- // normalize namespaceURI
- String namespaceURINormalized = null;
- if (namespaceURI == null) {
- namespaceURINormalized = ""; // XMLConstants.NULL_NS_URI
- } else {
- namespaceURINormalized = namespaceURI;
- }
-
- try {
- if (!fStartTagOpened) {
- throw new IllegalStateException(
- "Namespace Attribute not associated with any element");
- }
-
- if (fIsRepairingNamespace) {
- QName qname = new QName();
- qname.setValues(XMLConstants.DEFAULT_NS_PREFIX,
- XMLConstants.XMLNS_ATTRIBUTE, null, namespaceURINormalized);
- fNamespaceDecls.add(qname);
-
- return;
- }
-
- namespaceURINormalized = fSymbolTable.addSymbol(namespaceURINormalized);
-
- if (fInternalNamespaceContext.containsPrefixInCurrentContext("")){
-
- String tmp = fInternalNamespaceContext.getURI("");
-
- if (tmp != null && tmp != namespaceURINormalized) {
- throw new XMLStreamException(
- "xmlns has been already bound to " +tmp +
- ". Rebinding it to "+ namespaceURINormalized +
- " is an error");
- }
- }
- fInternalNamespaceContext.declarePrefix("", namespaceURINormalized);
-
- // use common namespace code with a prefix == null for xmlns="..."
- writenamespace(null, namespaceURINormalized);
- } catch (IOException e) {
- throw new XMLStreamException(e);
- }
- }
-
- public void writeEmptyElement(String localName) throws XMLStreamException {
- try {
- if (fStartTagOpened) {
- closeStartTag();
- }
-
- openStartTag();
- fElementStack.push(null, localName, null, null, true);
- fInternalNamespaceContext.pushContext();
-
- if (!fIsRepairingNamespace) {
- fWriter.write(localName);
- }
- } catch (IOException e) {
- throw new XMLStreamException(e);
- }
- }
-
- public void writeEmptyElement(String namespaceURI, String localName)
- throws XMLStreamException {
- if (namespaceURI == null) {
- throw new XMLStreamException("NamespaceURI cannot be null");
- }
-
- namespaceURI = fSymbolTable.addSymbol(namespaceURI);
-
- String prefix = fNamespaceContext.getPrefix(namespaceURI);
- writeEmptyElement(prefix, localName, namespaceURI);
- }
-
- public void writeEmptyElement(String prefix, String localName,
- String namespaceURI) throws XMLStreamException {
- try {
- if (localName == null) {
- throw new XMLStreamException("Local Name cannot be null");
- }
-
- if (namespaceURI == null) {
- throw new XMLStreamException("NamespaceURI cannot be null");
- }
-
- if (prefix != null) {
- prefix = fSymbolTable.addSymbol(prefix);
- }
-
- namespaceURI = fSymbolTable.addSymbol(namespaceURI);
-
- if (fStartTagOpened) {
- closeStartTag();
- }
-
- openStartTag();
-
- fElementStack.push(prefix, localName, null, namespaceURI, true);
- fInternalNamespaceContext.pushContext();
-
- if (!fIsRepairingNamespace) {
- if (prefix == null) {
- throw new XMLStreamException("NamespaceURI " +
- namespaceURI + " has not been bound to any prefix");
- }
- } else {
- return;
- }
-
- if ((prefix != null) && (prefix != XMLConstants.DEFAULT_NS_PREFIX)) {
- fWriter.write(prefix);
- fWriter.write(":");
- }
-
- fWriter.write(localName);
- } catch (IOException e) {
- throw new XMLStreamException(e);
- }
- }
-
- public void writeEndDocument() throws XMLStreamException {
- try {
- if (fStartTagOpened) {
- closeStartTag();
- }
-
- ElementState elem = null;
-
- while (!fElementStack.empty()) {
- elem = (ElementState) fElementStack.pop();
- fInternalNamespaceContext.popContext();
-
- if (elem.isEmpty) {
- //fWriter.write(CLOSE_EMPTY_ELEMENT);
- } else {
- fWriter.write(OPEN_END_TAG);
-
- if ((elem.prefix != null) && !(elem.prefix).equals("")) {
- fWriter.write(elem.prefix);
- fWriter.write(":");
- }
-
- fWriter.write(elem.localpart);
- fWriter.write(CLOSE_END_TAG);
- }
- }
- } catch (IOException e) {
- throw new XMLStreamException(e);
- } catch (ArrayIndexOutOfBoundsException e) {
- throw new XMLStreamException("No more elements to write");
- }
- }
-
- public void writeEndElement() throws XMLStreamException {
- try {
- if (fStartTagOpened) {
- closeStartTag();
- }
-
- ElementState currentElement = (ElementState) fElementStack.pop();
-
- if (currentElement == null) {
- throw new XMLStreamException("No element was found to write");
- }
-
- if (currentElement.isEmpty) {
- //fWriter.write(CLOSE_EMPTY_ELEMENT);
- return;
- }
-
- fWriter.write(OPEN_END_TAG);
-
- if ((currentElement.prefix != null) &&
- !(currentElement.prefix).equals("")) {
- fWriter.write(currentElement.prefix);
- fWriter.write(":");
- }
-
- fWriter.write(currentElement.localpart);
- fWriter.write(CLOSE_END_TAG);
- fInternalNamespaceContext.popContext();
- } catch (IOException e) {
- throw new XMLStreamException(e);
- } catch (ArrayIndexOutOfBoundsException e) {
- throw new XMLStreamException(
- "No element was found to write: "
- + e.toString(), e);
- }
- }
-
- public void writeEntityRef(String refName) throws XMLStreamException {
- try {
- if (fStartTagOpened) {
- closeStartTag();
- }
-
- fWriter.write('&');
- fWriter.write(refName);
- fWriter.write(';');
- } catch (IOException e) {
- throw new XMLStreamException(e);
- }
- }
-
- /**
- * Write a Namespace declaration.
- *
- * If namespaceURI == null,
- * then it is assumed to be equivilent to {@link XMLConstants.NULL_NS_URI},
- * i.e. there is no Namespace.
- *
- * @param prefix Prefix to bind.
- * @param namespaceURI NamespaceURI to declare.
- *
- * @throws XMLStreamException
- *
- * @see <a href="http://www.w3.org/TR/REC-xml-names/#defaulting">
- * Namespaces in XML, 5.2 Namespace Defaulting</a>
- */
- public void writeNamespace(String prefix, String namespaceURI)
- throws XMLStreamException {
-
- // normalize namespaceURI
- String namespaceURINormalized = null;
- if (namespaceURI == null) {
- namespaceURINormalized = ""; // XMLConstants.NULL_NS_URI
- } else {
- namespaceURINormalized = namespaceURI;
- }
-
- try {
- QName qname = null;
-
- if (!fStartTagOpened) {
- throw new IllegalStateException(
- "Invalid state: start tag is not opened at writeNamespace("
- + prefix
- + ", "
- + namespaceURINormalized
- + ")");
- }
-
- // is this the default Namespace?
- if (prefix == null
- || prefix.equals(XMLConstants.DEFAULT_NS_PREFIX)
- || prefix.equals(XMLConstants.XMLNS_ATTRIBUTE)) {
- writeDefaultNamespace(namespaceURINormalized);
- return;
- }
-
- if (prefix.equals(XMLConstants.XML_NS_PREFIX) && namespaceURINormalized.equals(XMLConstants.XML_NS_URI))
- return;
-
- prefix = fSymbolTable.addSymbol(prefix);
- namespaceURINormalized = fSymbolTable.addSymbol(namespaceURINormalized);
-
- if (fIsRepairingNamespace) {
- String tmpURI = fInternalNamespaceContext.getURI(prefix);
-
- if ((tmpURI != null) && (tmpURI == namespaceURINormalized)) {
- return;
- }
-
- qname = new QName();
- qname.setValues(prefix, XMLConstants.XMLNS_ATTRIBUTE, null,
- namespaceURINormalized);
- fNamespaceDecls.add(qname);
-
- return;
- }
-
-
- if (fInternalNamespaceContext.containsPrefixInCurrentContext(prefix)){
-
- String tmp = fInternalNamespaceContext.getURI(prefix);
-
- if (tmp != null && tmp != namespaceURINormalized) {
-
- throw new XMLStreamException("prefix "+prefix+
- " has been already bound to " +tmp +
- ". Rebinding it to "+ namespaceURINormalized+
- " is an error");
- }
- }
-
- fInternalNamespaceContext.declarePrefix(prefix, namespaceURINormalized);
- writenamespace(prefix, namespaceURINormalized);
-
- } catch (IOException e) {
- throw new XMLStreamException(e);
- }
- }
-
- private void writenamespace(String prefix, String namespaceURI)
- throws IOException {
- fWriter.write(" xmlns");
-
- if ((prefix != null) && (prefix != XMLConstants.DEFAULT_NS_PREFIX)) {
- fWriter.write(":");
- fWriter.write(prefix);
- }
-
- fWriter.write("=\"");
- writeXMLContent(
- namespaceURI,
- true, // true = escapeChars
- true); // true = escapeDoubleQuotes
- fWriter.write("\"");
- }
-
- public void writeProcessingInstruction(String target)
- throws XMLStreamException {
- try {
- if (fStartTagOpened) {
- closeStartTag();
- }
-
- if (target != null) {
- fWriter.write("<?");
- fWriter.write(target);
- fWriter.write("?>");
-
- return;
- }
- } catch (IOException e) {
- throw new XMLStreamException(e);
- }
-
- throw new XMLStreamException("PI target cannot be null");
- }
-
- /**
- * @param target
- * @param data
- * @throws XMLStreamException
- */
- public void writeProcessingInstruction(String target, String data)
- throws XMLStreamException {
- try {
- if (fStartTagOpened) {
- closeStartTag();
- }
-
- if ((target == null) || (data == null)) {
- throw new XMLStreamException("PI target cannot be null");
- }
-
- fWriter.write("<?");
- fWriter.write(target);
- fWriter.write(SPACE);
- fWriter.write(data);
- fWriter.write("?>");
- } catch (IOException e) {
- throw new XMLStreamException(e);
- }
- }
-
- /**
- * @throws XMLStreamException
- */
- public void writeStartDocument() throws XMLStreamException {
- try {
- fWriter.write(DEFAULT_XMLDECL);
- } catch (IOException ex) {
- throw new XMLStreamException(ex);
- }
- }
-
- /**
- * @param version
- * @throws XMLStreamException
- */
- public void writeStartDocument(String version) throws XMLStreamException {
- try {
- if ((version == null) || version.equals("")) {
- writeStartDocument();
-
- return;
- }
-
- fWriter.write("<?xml version=\"");
- fWriter.write(version);
- fWriter.write("\"");
-
- //fWriter.write(DEFAULT_ENCODING);
- fWriter.write("?>");
- } catch (IOException ex) {
- throw new XMLStreamException(ex);
- }
- }
-
- /**
- * @param encoding
- * @param version
- * @throws XMLStreamException
- */
- public void writeStartDocument(String encoding, String version)
- throws XMLStreamException {
- //Revisit : What about standalone ?
- try {
- if ((encoding == null) && (version == null)) {
- writeStartDocument();
-
- return;
- }
-
- if (encoding == null) {
- writeStartDocument(version);
-
- return;
- }
-
- String streamEncoding = null;
- if (fWriter instanceof OutputStreamWriter) {
- streamEncoding = ((OutputStreamWriter) fWriter).getEncoding();
- }
- else if (fWriter instanceof UTF8OutputStreamWriter) {
- streamEncoding = ((UTF8OutputStreamWriter) fWriter).getEncoding();
- }
- else if (fWriter instanceof XMLWriter) {
- streamEncoding = ((OutputStreamWriter) ((XMLWriter)fWriter).getWriter()).getEncoding();
- }
-
- if (streamEncoding != null && !streamEncoding.equalsIgnoreCase(encoding)) {
- // If the equality check failed, check for charset encoding aliases
- boolean foundAlias = false;
- Set aliases = Charset.forName(encoding).aliases();
- for (Iterator it = aliases.iterator(); !foundAlias && it.hasNext(); ) {
- if (streamEncoding.equalsIgnoreCase((String) it.next())) {
- foundAlias = true;
- }
- }
- // If no alias matches the encoding name, then report error
- if (!foundAlias) {
- throw new XMLStreamException("Underlying stream encoding '"
- + streamEncoding
- + "' and input paramter for writeStartDocument() method '"
- + encoding + "' do not match.");
- }
- }
-
-
- fWriter.write("<?xml version=\"");
-
- if ((version == null) || version.equals("")) {
- fWriter.write(DEFAULT_XML_VERSION);
- } else {
- fWriter.write(version);
- }
-
- if (!encoding.equals("")) {
- fWriter.write("\" encoding=\"");
- fWriter.write(encoding);
- }
-
- fWriter.write("\"?>");
- } catch (IOException ex) {
- throw new XMLStreamException(ex);
- }
- }
-
- /**
- * @param localName
- * @throws XMLStreamException
- */
- public void writeStartElement(String localName) throws XMLStreamException {
- try {
- if (localName == null) {
- throw new XMLStreamException("Local Name cannot be null");
- }
-
- if (fStartTagOpened) {
- closeStartTag();
- }
-
- openStartTag();
- fElementStack.push(null, localName, null, null, false);
- fInternalNamespaceContext.pushContext();
-
- if (fIsRepairingNamespace) {
- return;
- }
-
- fWriter.write(localName);
- } catch (IOException ex) {
- throw new XMLStreamException(ex);
- }
- }
-
- /**
- * @param namespaceURI
- * @param localName
- * @throws XMLStreamException
- */
- public void writeStartElement(String namespaceURI, String localName)
- throws XMLStreamException {
- if (localName == null) {
- throw new XMLStreamException("Local Name cannot be null");
- }
-
- if (namespaceURI == null) {
- throw new XMLStreamException("NamespaceURI cannot be null");
- }
-
- namespaceURI = fSymbolTable.addSymbol(namespaceURI);
-
- String prefix = null;
-
- if (!fIsRepairingNamespace) {
- prefix = fNamespaceContext.getPrefix(namespaceURI);
-
- if (prefix != null) {
- prefix = fSymbolTable.addSymbol(prefix);
- }
- }
-
- writeStartElement(prefix, localName, namespaceURI);
- }
-
- /**
- * @param prefix
- * @param localName
- * @param namespaceURI
- * @throws XMLStreamException
- */
- public void writeStartElement(String prefix, String localName,
- String namespaceURI) throws XMLStreamException {
- try {
- if (localName == null) {
- throw new XMLStreamException("Local Name cannot be null");
- }
-
- if (namespaceURI == null) {
- throw new XMLStreamException("NamespaceURI cannot be null");
- }
-
- if (!fIsRepairingNamespace) {
- if (prefix == null) {
- throw new XMLStreamException("Prefix cannot be null");
- }
- }
-
- if (fStartTagOpened) {
- closeStartTag();
- }
-
- openStartTag();
- namespaceURI = fSymbolTable.addSymbol(namespaceURI);
-
- if (prefix != null) {
- prefix = fSymbolTable.addSymbol(prefix);
- }
-
- fElementStack.push(prefix, localName, null, namespaceURI, false);
- fInternalNamespaceContext.pushContext();
-
- String tmpPrefix = fNamespaceContext.getPrefix(namespaceURI);
-
-
- if ((prefix != null) &&
- ((tmpPrefix == null) || !prefix.equals(tmpPrefix))) {
- fInternalNamespaceContext.declarePrefix(prefix, namespaceURI);
-
- }
-
- if (fIsRepairingNamespace) {
- if ((prefix == null) ||
- ((tmpPrefix != null) && prefix.equals(tmpPrefix))) {
- return;
- }
-
- QName qname = new QName();
- qname.setValues(prefix, XMLConstants.XMLNS_ATTRIBUTE, null,
- namespaceURI);
- fNamespaceDecls.add(qname);
-
- return;
- }
-
- if ((prefix != null) && (prefix != XMLConstants.DEFAULT_NS_PREFIX)) {
- fWriter.write(prefix);
- fWriter.write(":");
- }
-
- fWriter.write(localName);
-
- } catch (IOException ex) {
- throw new XMLStreamException(ex);
- }
- }
-
- /**
- * Writes character reference in hex format.
- */
- private void writeCharRef(int codePoint) throws IOException {
- fWriter.write( "&#x" );
- fWriter.write( Integer.toHexString(codePoint) );
- fWriter.write( ';' );
- }
-
- /**
- * Writes XML content to underlying writer. Escapes characters unless
- * escaping character feature is turned off.
- */
- private void writeXMLContent(char[] content, int start, int length,
- boolean escapeChars) throws IOException {
- if (!escapeChars) {
- fWriter.write(content, start, length);
-
- return;
- }
-
- // Index of the next char to be written
- int startWritePos = start;
-
- final int end = start + length;
-
- for (int index = start; index < end; index++) {
- char ch = content[index];
-
- if (fEncoder != null && !fEncoder.canEncode(ch)){
- fWriter.write(content, startWritePos, index - startWritePos );
-
- // Check if current and next characters forms a surrogate pair
- // and escape it to avoid generation of invalid xml content
- if ( index != end - 1 && Character.isSurrogatePair(ch, content[index+1])) {
- writeCharRef(Character.toCodePoint(ch, content[index+1]));
- index++;
- } else {
- writeCharRef(ch);
- }
- startWritePos = index + 1;
- continue;
- }
-
- switch (ch) {
- case '<':
- fWriter.write(content, startWritePos, index - startWritePos);
- fWriter.write("&lt;");
- startWritePos = index + 1;
-
- break;
-
- case '&':
- fWriter.write(content, startWritePos, index - startWritePos);
- fWriter.write("&amp;");
- startWritePos = index + 1;
-
- break;
-
- case '>':
- fWriter.write(content, startWritePos, index - startWritePos);
- fWriter.write("&gt;");
- startWritePos = index + 1;
-
- break;
- }
- }
-
- // Write any pending data
- fWriter.write(content, startWritePos, end - startWritePos);
- }
-
- private void writeXMLContent(String content) throws IOException {
- if ((content != null) && (content.length() > 0)) {
- writeXMLContent(content,
- fEscapeCharacters, // boolean = escapeChars
- false); // false = escapeDoubleQuotes
- }
- }
-
- /**
- * Writes XML content to underlying writer. Escapes characters unless
- * escaping character feature is turned off.
- */
- private void writeXMLContent(
- String content,
- boolean escapeChars,
- boolean escapeDoubleQuotes)
- throws IOException {
-
- if (!escapeChars) {
- fWriter.write(content);
-
- return;
- }
-
- // Index of the next char to be written
- int startWritePos = 0;
-
- final int end = content.length();
-
- for (int index = 0; index < end; index++) {
- char ch = content.charAt(index);
-
- if (fEncoder != null && !fEncoder.canEncode(ch)){
- fWriter.write(content, startWritePos, index - startWritePos );
-
- // Check if current and next characters forms a surrogate pair
- // and escape it to avoid generation of invalid xml content
- if ( index != end - 1 && Character.isSurrogatePair(ch, content.charAt(index+1))) {
- writeCharRef(Character.toCodePoint(ch, content.charAt(index+1)));
- index++;
- } else {
- writeCharRef(ch);
- }
-
- startWritePos = index + 1;
- continue;
- }
-
- switch (ch) {
- case '<':
- fWriter.write(content, startWritePos, index - startWritePos);
- fWriter.write("&lt;");
- startWritePos = index + 1;
-
- break;
-
- case '&':
- fWriter.write(content, startWritePos, index - startWritePos);
- fWriter.write("&amp;");
- startWritePos = index + 1;
-
- break;
-
- case '>':
- fWriter.write(content, startWritePos, index - startWritePos);
- fWriter.write("&gt;");
- startWritePos = index + 1;
-
- break;
-
- case '"':
- fWriter.write(content, startWritePos, index - startWritePos);
- if (escapeDoubleQuotes) {
- fWriter.write("&quot;");
- } else {
- fWriter.write('"');
- }
- startWritePos = index + 1;
-
- break;
- }
- }
-
- // Write any pending data
- fWriter.write(content, startWritePos, end - startWritePos);
- }
-
- /**
- * marks close of start tag and writes the same into the writer.
- */
- private void closeStartTag() throws XMLStreamException {
- try {
- ElementState currentElement = fElementStack.peek();
-
- if (fIsRepairingNamespace) {
- repair();
- correctPrefix(currentElement, XMLStreamConstants.START_ELEMENT);
-
- if ((currentElement.prefix != null) &&
- (currentElement.prefix != XMLConstants.DEFAULT_NS_PREFIX)) {
- fWriter.write(currentElement.prefix);
- fWriter.write(":");
- }
-
- fWriter.write(currentElement.localpart);
-
- int len = fNamespaceDecls.size();
- QName qname = null;
-
- for (int i = 0; i < len; i++) {
- qname = (QName) fNamespaceDecls.get(i);
-
- if (qname != null) {
- if (fInternalNamespaceContext.declarePrefix(qname.prefix,
- qname.uri)) {
- writenamespace(qname.prefix, qname.uri);
- }
- }
- }
-
- fNamespaceDecls.clear();
-
- Attribute attr = null;
-
- for (int j = 0; j < fAttributeCache.size(); j++) {
- attr = (Attribute) fAttributeCache.get(j);
-
- if ((attr.prefix != null) && (attr.uri != null)) {
- if (!attr.prefix.equals("") && !attr.uri.equals("") ) {
- String tmp = fInternalNamespaceContext.getPrefix(attr.uri);
-
- if ((tmp == null) || (tmp != attr.prefix)) {
- tmp = getAttrPrefix(attr.uri);
- if (tmp == null) {
- if (fInternalNamespaceContext.declarePrefix(attr.prefix,
- attr.uri)) {
- writenamespace(attr.prefix, attr.uri);
- }
- } else {
- writenamespace(attr.prefix, attr.uri);
- }
- }
- }
- }
-
- writeAttributeWithPrefix(attr.prefix, attr.localpart,
- attr.value);
- }
- fAttrNamespace = null;
- fAttributeCache.clear();
- }
-
- if (currentElement.isEmpty) {
- fElementStack.pop();
- fInternalNamespaceContext.popContext();
- fWriter.write(CLOSE_EMPTY_ELEMENT);
- } else {
- fWriter.write(CLOSE_START_TAG);
- }
-
- fStartTagOpened = false;
- } catch (IOException ex) {
- fStartTagOpened = false;
- throw new XMLStreamException(ex);
- }
- }
-
- /**
- * marks open of start tag and writes the same into the writer.
- */
- private void openStartTag() throws IOException {
- fStartTagOpened = true;
- fWriter.write(OPEN_START_TAG);
- }
-
- /**
- *
- * @param uri
- * @return
- */
- private void correctPrefix(QName attr, int type) {
- String tmpPrefix = null;
- String prefix;
- String uri;
- prefix = attr.prefix;
- uri = attr.uri;
- boolean isSpecialCaseURI = false;
-
- if (prefix == null || prefix.equals("")) {
- if (uri == null) {
- return;
- }
-
- if (prefix == XMLConstants.DEFAULT_NS_PREFIX && uri == XMLConstants.DEFAULT_NS_PREFIX)
- return;
-
- uri = fSymbolTable.addSymbol(uri);
-
- QName decl = null;
-
- for (int i = 0; i < fNamespaceDecls.size(); i++) {
- decl = (QName) fNamespaceDecls.get(i);
-
- if ((decl != null) && (decl.uri == attr.uri)) {
- attr.prefix = decl.prefix;
-
- return;
- }
- }
-
- tmpPrefix = fNamespaceContext.getPrefix(uri);
-
- if (tmpPrefix == XMLConstants.DEFAULT_NS_PREFIX) {
- if (type == XMLStreamConstants.START_ELEMENT) {
- return;
- }
- else if (type == XMLStreamConstants.ATTRIBUTE) {
- //the uri happens to be the same as that of the default namespace
- tmpPrefix = getAttrPrefix(uri);
- isSpecialCaseURI = true;
- }
- }
-
- if (tmpPrefix == null) {
- StringBuffer genPrefix = new StringBuffer("zdef");
-
- for (int i = 0; i < 1; i++) {
- genPrefix.append(fPrefixGen.nextInt());
- }
-
- prefix = genPrefix.toString();
- prefix = fSymbolTable.addSymbol(prefix);
- } else {
- prefix = fSymbolTable.addSymbol(tmpPrefix);
- }
-
- if (tmpPrefix == null) {
- if (isSpecialCaseURI) {
- addAttrNamespace(prefix, uri);
- } else {
- QName qname = new QName();
- qname.setValues(prefix, XMLConstants.XMLNS_ATTRIBUTE, null, uri);
- fNamespaceDecls.add(qname);
- fInternalNamespaceContext.declarePrefix(fSymbolTable.addSymbol(
- prefix), uri);
- }
- }
- }
-
- attr.prefix = prefix;
- }
-
- /**
- * return the prefix if the attribute has an uri the same as that of the default namespace
- */
- private String getAttrPrefix(String uri) {
- if (fAttrNamespace != null) {
- return (String)fAttrNamespace.get(uri);
- }
- return null;
- }
- private void addAttrNamespace(String prefix, String uri) {
- if (fAttrNamespace == null) {
- fAttrNamespace = new HashMap();
- }
- fAttrNamespace.put(prefix, uri);
- }
- /**
- * @param uri
- * @return
- */
- private boolean isDefaultNamespace(String uri) {
- String defaultNamespace = fInternalNamespaceContext.getURI(DEFAULT_PREFIX);
-
- if (uri == defaultNamespace) {
- return true;
- }
-
- return false;
- }
-
- /**
- * @param prefix
- * @param uri
- * @return
- */
- private boolean checkUserNamespaceContext(String prefix, String uri) {
- if (fNamespaceContext.userContext != null) {
- String tmpURI = fNamespaceContext.userContext.getNamespaceURI(prefix);
-
- if ((tmpURI != null) && tmpURI.equals(uri)) {
- return true;
- }
- }
-
- return false;
- }
-
- /**
- * Correct's namespaces as per requirements of isReparisingNamespace property.
- */
- protected void repair() {
- Attribute attr = null;
- Attribute attr2 = null;
- ElementState currentElement = fElementStack.peek();
- removeDuplicateDecls();
-
- for(int i=0 ; i< fAttributeCache.size();i++){
- attr = (Attribute)fAttributeCache.get(i);
- if((attr.prefix != null && !attr.prefix.equals("")) || (attr.uri != null && !attr.uri.equals(""))) {
- correctPrefix(currentElement,attr);
- }
- }
-
- if (!isDeclared(currentElement)) {
- if ((currentElement.prefix != null) &&
- (currentElement.uri != null)) {
- if ((!currentElement.prefix.equals("")) && (!currentElement.uri.equals(""))) {
- fNamespaceDecls.add(currentElement);
- }
- }
- }
-
- for(int i=0 ; i< fAttributeCache.size();i++){
- attr = (Attribute)fAttributeCache.get(i);
- for(int j=i+1;j<fAttributeCache.size();j++){
- attr2 = (Attribute)fAttributeCache.get(j);
- if(!"".equals(attr.prefix)&& !"".equals(attr2.prefix)){
- correctPrefix(attr,attr2);
- }
- }
- }
-
- repairNamespaceDecl(currentElement);
-
- int i = 0;
-
- for (i = 0; i < fAttributeCache.size(); i++) {
- attr = (Attribute) fAttributeCache.get(i);
- /* If 'attr' is an attribute and it is in no namespace(which means that prefix="", uri=""), attr's
- namespace should not be redinded. See [http://www.w3.org/TR/REC-xml-names/#defaulting].
- */
- if (attr.prefix != null && attr.prefix.equals("") && attr.uri != null && attr.uri.equals("")){
- repairNamespaceDecl(attr);
- }
- }
-
- QName qname = null;
-
- for (i = 0; i < fNamespaceDecls.size(); i++) {
- qname = (QName) fNamespaceDecls.get(i);
-
- if (qname != null) {
- fInternalNamespaceContext.declarePrefix(qname.prefix, qname.uri);
- }
- }
-
- for (i = 0; i < fAttributeCache.size(); i++) {
- attr = (Attribute) fAttributeCache.get(i);
- correctPrefix(attr, XMLStreamConstants.ATTRIBUTE);
- }
- }
-
- /*
- *If element and/or attribute names in the same start or empty-element tag
- *are bound to different namespace URIs and are using the same prefix then
- *the element or the first occurring attribute retains the original prefix
- *and the following attributes have their prefixes replaced with a new prefix
- *that is bound to the namespace URIs of those attributes.
- */
- void correctPrefix(QName attr1, QName attr2) {
- String tmpPrefix = null;
- QName decl = null;
- boolean done = false;
-
- checkForNull(attr1);
- checkForNull(attr2);
-
- if(attr1.prefix.equals(attr2.prefix) && !(attr1.uri.equals(attr2.uri))){
-
- tmpPrefix = fNamespaceContext.getPrefix(attr2.uri);
-
- if (tmpPrefix != null) {
- attr2.prefix = fSymbolTable.addSymbol(tmpPrefix);
- } else {
- decl = null;
- for(int n=0;n<fNamespaceDecls.size();n++){
- decl = (QName)fNamespaceDecls.get(n);
- if(decl != null && (decl.uri == attr2.uri)){
- attr2.prefix = decl.prefix;
-
- return;
- }
- }
-
- //No namespace mapping found , so declare prefix.
- StringBuffer genPrefix = new StringBuffer("zdef");
-
- for (int k = 0; k < 1; k++) {
- genPrefix.append(fPrefixGen.nextInt());
- }
-
- tmpPrefix = genPrefix.toString();
- tmpPrefix = fSymbolTable.addSymbol(tmpPrefix);
- attr2.prefix = tmpPrefix;
-
- QName qname = new QName();
- qname.setValues(tmpPrefix, XMLConstants.XMLNS_ATTRIBUTE, null,
- attr2.uri);
- fNamespaceDecls.add(qname);
- }
- }
- }
-
- void checkForNull(QName attr) {
- if (attr.prefix == null) attr.prefix = XMLConstants.DEFAULT_NS_PREFIX;
- if (attr.uri == null) attr.uri = XMLConstants.DEFAULT_NS_PREFIX;
- }
-
- void removeDuplicateDecls(){
- QName decl1,decl2;
- for(int i =0;i<fNamespaceDecls.size();i++){
- decl1 = (QName)fNamespaceDecls.get(i);
- if(decl1!=null) {
- for(int j=i+1;j<fNamespaceDecls.size();j++){
- decl2 = (QName)fNamespaceDecls.get(j);
- // QName.equals relies on identity equality, so we can't use it,
- // because prefixes aren't interned
- if(decl2!=null && decl1.prefix.equals(decl2.prefix) && decl1.uri.equals(decl2.uri))
- fNamespaceDecls.remove(j);
- }
- }
- }
- }
-
- /*
- *If an element or attribute name is bound to a prefix and there is a namespace
- *declaration that binds that prefix to a different URI then that namespace declaration
- *is either removed if the correct mapping is inherited from the parent context of that element,
- *or changed to the namespace URI of the element or attribute using that prefix.
- *
- */
- void repairNamespaceDecl(QName attr) {
- QName decl = null;
- String tmpURI;
-
- //check for null prefix.
- for (int j = 0; j < fNamespaceDecls.size(); j++) {
- decl = (QName) fNamespaceDecls.get(j);
-
- if (decl != null) {
- if ((attr.prefix != null) &&
- (attr.prefix.equals(decl.prefix) &&
- !(attr.uri.equals(decl.uri)))) {
- tmpURI = fNamespaceContext.getNamespaceURI(attr.prefix);
-
- //see if you need to add to symbole table.
- if (tmpURI != null) {
- if (tmpURI.equals(attr.uri)) {
- fNamespaceDecls.set(j, null);
- } else {
- decl.uri = attr.uri;
- }
- }
- }
- }
- }
- }
-
- boolean isDeclared(QName attr) {
- QName decl = null;
-
- for (int n = 0; n < fNamespaceDecls.size(); n++) {
- decl = (QName) fNamespaceDecls.get(n);
-
- if ((attr.prefix != null) &&
- ((attr.prefix == decl.prefix) && (decl.uri == attr.uri))) {
- return true;
- }
- }
-
- if (attr.uri != null) {
- if (fNamespaceContext.getPrefix(attr.uri) != null) {
- return true;
- }
- }
-
- return false;
- }
-
- /*
- * Start of Internal classes.
- *
- */
- protected class ElementStack {
- /** The stack data. */
- protected ElementState[] fElements;
-
- /** The size of the stack. */
- protected short fDepth;
-
- /** Default constructor. */
- public ElementStack() {
- fElements = new ElementState[10];
-
- for (int i = 0; i < fElements.length; i++) {
- fElements[i] = new ElementState();
- }
- }
-
- /**
- * Pushes an element on the stack.
- * <p>
- * <strong>Note:</strong> The QName values are copied into the
- * stack. In other words, the caller does <em>not</em> orphan
- * the element to the stack. Also, the QName object returned
- * is <em>not</em> orphaned to the caller. It should be
- * considered read-only.
- *
- * @param element The element to push onto the stack.
- *
- * @return Returns the actual QName object that stores the
- */
- public ElementState push(ElementState element) {
- if (fDepth == fElements.length) {
- ElementState[] array = new ElementState[fElements.length * 2];
- System.arraycopy(fElements, 0, array, 0, fDepth);
- fElements = array;
-
- for (int i = fDepth; i < fElements.length; i++) {
- fElements[i] = new ElementState();
- }
- }
-
- fElements[fDepth].setValues(element);
-
- return fElements[fDepth++];
- }
-
- /**
- *
- * @param prefix
- * @param localpart
- * @param rawname
- * @param uri
- * @param isEmpty
- * @return
- */
- public ElementState push(String prefix, String localpart,
- String rawname, String uri, boolean isEmpty) {
- if (fDepth == fElements.length) {
- ElementState[] array = new ElementState[fElements.length * 2];
- System.arraycopy(fElements, 0, array, 0, fDepth);
- fElements = array;
-
- for (int i = fDepth; i < fElements.length; i++) {
- fElements[i] = new ElementState();
- }
- }
-
- fElements[fDepth].setValues(prefix, localpart, rawname, uri, isEmpty);
-
- return fElements[fDepth++];
- }
-
- /**
- * Pops an element off of the stack by setting the values of
- * the specified QName.
- * <p>
- * <strong>Note:</strong> The object returned is <em>not</em>
- * orphaned to the caller. Therefore, the caller should consider
- * the object to be read-only.
- */
- public ElementState pop() {
- return fElements[--fDepth];
- }
-
- /** Clears the stack without throwing away existing QName objects. */
- public void clear() {
- fDepth = 0;
- }
-
- /**
- * This function is as a result of optimization done for endElement --
- * we dont need to set the value for every end element we encouter.
- * For Well formedness checks we can have the same QName object that was pushed.
- * the values will be set only if application need to know about the endElement
- * -- neeraj.bajaj@sun.com
- */
- public ElementState peek() {
- return fElements[fDepth - 1];
- }
-
- /**
- *
- * @return
- */
- public boolean empty() {
- return (fDepth > 0) ? false : true;
- }
- }
-
- /**
- * Maintains element state . localName for now.
- */
- class ElementState extends QName {
- public boolean isEmpty = false;
-
- public ElementState() {}
-
- public ElementState(String prefix, String localpart, String rawname,
- String uri) {
- super(prefix, localpart, rawname, uri);
- }
-
- public void setValues(String prefix, String localpart, String rawname,
- String uri, boolean isEmpty) {
- super.setValues(prefix, localpart, rawname, uri);
- this.isEmpty = isEmpty;
- }
- }
-
- /**
- * Attributes
- */
- class Attribute extends QName {
- String value;
-
- Attribute(String value) {
- super();
- this.value = value;
- }
- }
-
- /**
- * Implementation of NamespaceContext .
- *
- */
- class NamespaceContextImpl implements NamespaceContext {
- //root namespace context set by user.
- NamespaceContext userContext = null;
-
- //context built by the writer.
- NamespaceSupport internalContext = null;
-
- public String getNamespaceURI(String prefix) {
- String uri = null;
-
- if (prefix != null) {
- prefix = fSymbolTable.addSymbol(prefix);
- }
-
- if (internalContext != null) {
- uri = internalContext.getURI(prefix);
-
- if (uri != null) {
- return uri;
- }
- }
-
- if (userContext != null) {
- uri = userContext.getNamespaceURI(prefix);
-
- return uri;
- }
-
- return null;
- }
-
- public String getPrefix(String uri) {
- String prefix = null;
-
- if (uri != null) {
- uri = fSymbolTable.addSymbol(uri);
- }
-
- if (internalContext != null) {
- prefix = internalContext.getPrefix(uri);
-
- if (prefix != null) {
- return prefix;
- }
- }
-
- if (userContext != null) {
- return userContext.getPrefix(uri);
- }
-
- return null;
- }
-
- public java.util.Iterator getPrefixes(String uri) {
- Vector prefixes = null;
- Iterator itr = null;
-
- if (uri != null) {
- uri = fSymbolTable.addSymbol(uri);
- }
-
- if (userContext != null) {
- itr = userContext.getPrefixes(uri);
- }
-
- if (internalContext != null) {
- prefixes = internalContext.getPrefixes(uri);
- }
-
- if ((prefixes == null) && (itr != null)) {
- return itr;
- } else if ((prefixes != null) && (itr == null)) {
- return new ReadOnlyIterator(prefixes.iterator());
- } else if ((prefixes != null) && (itr != null)) {
- String ob = null;
-
- while (itr.hasNext()) {
- ob = (String) itr.next();
-
- if (ob != null) {
- ob = fSymbolTable.addSymbol(ob);
- }
-
- if (!prefixes.contains(ob)) {
- prefixes.add(ob);
- }
- }
-
- return new ReadOnlyIterator(prefixes.iterator());
- }
-
- return fReadOnlyIterator;
- }
- }
-
- // -- Map Interface --------------------------------------------------
-
- public int size() {
- return 1;
- }
-
- public boolean isEmpty() {
- return false;
- }
-
- public boolean containsKey(Object key) {
- return key.equals(OUTPUTSTREAM_PROPERTY);
- }
-
- /**
- * Returns the value associated to an implementation-specific
- * property.
- */
- public Object get(Object key) {
- if (key.equals(OUTPUTSTREAM_PROPERTY)) {
- return fOutputStream;
- }
- return null;
- }
-
- public java.util.Set entrySet() {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Overrides the method defined in AbstractMap which is
- * not completely implemented. Calling toString() in
- * AbstractMap would cause an unsupported exection to
- * be thrown.
- */
- public String toString() {
- return getClass().getName() + "@" + Integer.toHexString(hashCode());
- }
-
- /**
- * Overrides the method defined in AbstractMap
- * This is required by the toString() method
- */
- public int hashCode() {
- return fElementStack.hashCode();
- }
- /**
- * Overrides the method defined in AbstractMap
- * This is required to satisfy the contract for hashCode.
- */
- public boolean equals(Object obj) {
- return (this == obj);
- }
-}
diff --git a/src/com/sun/xml/internal/stream/writers/XMLWriter.java b/src/com/sun/xml/internal/stream/writers/XMLWriter.java
deleted file mode 100644
index ade4eaf..0000000
--- a/src/com/sun/xml/internal/stream/writers/XMLWriter.java
+++ /dev/null
@@ -1,260 +0,0 @@
-/*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.xml.internal.stream.writers;
-
-import java.io.IOException;
-import java.io.Writer;
-import com.sun.org.apache.xerces.internal.util.XMLStringBuffer;
-
-/**
- * XMLWriter
- *
- * <code>XMLWriter</code> is not thread safe.
- *
- * For efficiency this writer buffers the input. Use <code>flush()</code> function
- * to explicitly write the data to underlying stream.
- *
- * This writer is designed in such a way that it atleast buffers the input to the
- * <code>size</code> specified. Unless <code>flush</code> is called, it guarantees that
- * data in chunks of size equal to or more than <code>size</code> specified will be written.
- *
- *
- * <code>XMLWriter</code> instance can be reused. <code>setWriter()</code> internally clears the
- * buffer and stores the reference to newly supplied <code>Writer</code> instance.
- *
- * @author Neeraj Bajaj Sun Microsystems, inc.
- */
-public class XMLWriter extends Writer {
-
- private Writer writer ;
- private int size ;
- //keep the size of internal buffer more than 'size' required to avoid resizing
- private XMLStringBuffer buffer = new XMLStringBuffer(6 * (1 << 11) ); // 6 KB
- private static final int THRESHHOLD_LENGTH = 1 << 12 ; // 4 KB
- private static final boolean DEBUG = false;
-
- /** Creates the instance of <code>XMLWriter</code>
- */
-
- public XMLWriter(Writer writer){
- this(writer, THRESHHOLD_LENGTH);
- }
-
- /**
- * Creates the instnace of <code>XMLWriter</code>.
- *
- * atleast buffers the input to the
- * <code>size</code> specified.
- */
- public XMLWriter(Writer writer, int size){
- this.writer = writer ;
- this.size = size;
- }
-
- /**
- * Write a single character. The character to be written is contained in
- * the 16 low-order bits of the given integer value; the 16 high-order bits
- * are ignored.
- *
- * <p> Subclasses that intend to support efficient single-character output
- * should override this method.
- *
- * @param c int specifying a character to be written.
- * @exception IOException If an I/O error occurs
- */
-
- public void write(int c) throws IOException {
- ensureOpen();
- buffer.append((char)c);
- conditionalWrite();
- }
-
- /**
- * Write an array of characters.
- *
- * @param cbuf Array of characters to be written
- *
- * @exception IOException If an I/O error occurs
- */
-
- public void write(char cbuf[]) throws IOException {
- write(cbuf, 0, cbuf.length);
- }
-
- /**
- * Write a portion of an array of characters.
- *
- * @param cbuf Array of characters
- * @param off Offset from which to start writing characters
- * @param len Number of characters to write
- *
- * @exception IOException If an I/O error occurs
- */
-
- public void write(char cbuf[], int off, int len) throws IOException{
- ensureOpen();
- //optimization: if data size to be written is more than the 'size' specified,
- //do not buffer the data but write the data straight to the underlying stream
- if(len > size){
- //first write the data that may be present in the buffer
- writeBufferedData();
- //write directly to stream
- writer.write(cbuf, off, len);
- }else{
- buffer.append(cbuf, off, len);
- conditionalWrite();
- }
- }
-
- /**
- * Write a portion of a string.
- *
- * @param str A String
- * @param off Offset from which to start writing characters
- * @param len Number of characters to write
- *
- * @exception IOException If an I/O error occurs
- */
- public void write(String str, int off, int len) throws IOException {
- write(str.toCharArray(), off, len);
- }
-
- /**
- * Write a string.
- *
- * @param str String to be written
- *
- * @exception IOException If an I/O error occurs
- */
- public void write(String str) throws IOException {
- //optimization: if data size to be written is more than the 'size' specified,
- //do not buffer the data but write the data straight to the underlying stream - nb.
- if(str.length() > size){
- //first write the data that may be present in the buffer
- writeBufferedData();
- //write directly to stream
- writer.write(str);
- }else{
- buffer.append(str);
- conditionalWrite();
- }
- }
-
- /**
- * Close the stream, flushing it first. Once a stream has been closed,
- * further write() or flush() invocations will cause an IOException to be
- * thrown. Closing a previously-closed stream, however, has no effect.
- *
- * @exception IOException If an I/O error occurs
- */
- public void close() throws IOException {
- if(writer == null) return;
- //flush it first
- flush();
- writer.close();
- writer = null ;
- }
-
- /**
- * Flush the stream. If the stream has saved any characters from the
- * various write() methods in a buffer, write them immediately to their
- * intended destination. Then, if that destination is another character or
- * byte stream, flush it. Thus one flush() invocation will flush all the
- * buffers in a chain of Writers and OutputStreams.
- *
- * @exception IOException If an I/O error occurs
- */
-
- public void flush() throws IOException {
- ensureOpen();
- //write current data present in the buffer
- writeBufferedData();
- writer.flush();
- }
-
- /** Reset this Writer.
- *
- * see @setWriter()
- */
- public void reset(){
- this.writer = null;
- buffer.clear();
- this.size = THRESHHOLD_LENGTH;
- }
-
- /**
- * Set the given <code>Writer</code>.
- *
- * @param Writer Writer.
- */
- public void setWriter(Writer writer){
- this.writer = writer;
- buffer.clear();
- this.size = THRESHHOLD_LENGTH;
- }
-
- /** Set the given <code>Writer</code>
- *
- * @param Writer Writer.
- * @param int Writer will buffer the character data size, after that data is written to stream.
- */
- public void setWriter(Writer writer, int size){
- this.writer = writer;
- this.size = size;
- }
-
- /**
- * Returns underlying <code>Writer</code>
- */
- protected Writer getWriter() {
- return writer;
- }
-
- /** write the buffer data, if the buffer size has increased the size specified
- */
- private void conditionalWrite() throws IOException {
- if(buffer.length > size){
- if(DEBUG){
- System.out.println("internal buffer length " + buffer.length + " increased size limit : " + size);
- System.out.println("Data: ('" + new String(buffer.ch, buffer.offset, buffer.length) + "')");
- }
- writeBufferedData();
- }
- }
-
- /** Write the data present in the buffer to the writer.
- * buffer is cleared after write operation.
- */
- private void writeBufferedData() throws IOException {
- writer.write(buffer.ch, buffer.offset, buffer.length);
- buffer.clear();
- }
-
- /** Check to make sure that the stream has not been closed */
- private void ensureOpen() throws IOException {
- if (writer == null)throw new IOException("Stream closed");
- }
-}
diff --git a/src/javax/xml/XMLConstants.java b/src/javax/xml/XMLConstants.java
deleted file mode 100644
index 8e805ec..0000000
--- a/src/javax/xml/XMLConstants.java
+++ /dev/null
@@ -1,392 +0,0 @@
-/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml;
-
-/**
- * <p>Utility class to contain basic XML values as constants.</p>
- *
- * @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a>
- * @version $Revision: 1.8 $, $Date: 2010/05/25 16:19:45 $
- * @see <a href="http://www.w3.org/TR/xml11/">Extensible Markup Language (XML) 1.1</a>
- * @see <a href="http://www.w3.org/TR/REC-xml">Extensible Markup Language (XML) 1.0 (Second Edition)</a>
- * @see <a href="http://www.w3.org/XML/xml-V10-2e-errata">XML 1.0 Second Edition Specification Errata</a>
- * @see <a href="http://www.w3.org/TR/xml-names11/">Namespaces in XML 1.1</a>
- * @see <a href="http://www.w3.org/TR/REC-xml-names">Namespaces in XML</a>
- * @see <a href="http://www.w3.org/XML/xml-names-19990114-errata">Namespaces in XML Errata</a>
- * @see <a href="http://www.w3.org/TR/xmlschema-1/">XML Schema Part 1: Structures</a>
- * @since 1.5
- **/
-
-public final class XMLConstants {
-
- /**
- * <p>Private constructor to prevent instantiation.</p>
- */
- private XMLConstants() {
- }
-
- /**
- * <p>Namespace URI to use to represent that there is no Namespace.</p>
- *
- * <p>Defined by the Namespace specification to be "".</p>
- *
- * @see <a href="http://www.w3.org/TR/REC-xml-names/#defaulting">
- * Namespaces in XML, 5.2 Namespace Defaulting</a>
- */
- public static final String NULL_NS_URI = "";
-
- /**
- * <p>Prefix to use to represent the default XML Namespace.</p>
- *
- * <p>Defined by the XML specification to be "".</p>
- *
- * @see <a
- * href="http://www.w3.org/TR/REC-xml-names/#ns-qualnames">
- * Namespaces in XML, 3. Qualified Names</a>
- */
- public static final String DEFAULT_NS_PREFIX = "";
-
- /**
- * <p>The official XML Namespace name URI.</p>
- *
- * <p>Defined by the XML specification to be
- * "{@code http://www.w3.org/XML/1998/namespace}".</p>
- *
- * @see <a
- * href="http://www.w3.org/TR/REC-xml-names/#ns-qualnames">
- * Namespaces in XML, 3. Qualified Names</a>
- */
- public static final String XML_NS_URI =
- "http://www.w3.org/XML/1998/namespace";
-
- /**
- * <p>The official XML Namespace prefix.</p>
- *
- * <p>Defined by the XML specification to be "{@code xml}".</p>
- *
- * @see <a
- * href="http://www.w3.org/TR/REC-xml-names/#ns-qualnames">
- * Namespaces in XML, 3. Qualified Names<</a>
- */
- public static final String XML_NS_PREFIX = "xml";
-
- /**
- * <p>The official XML attribute used for specifying XML Namespace
- * declarations, {@link #XMLNS_ATTRIBUTE
- * XMLConstants.XMLNS_ATTRIBUTE}, Namespace name URI.</p>
- *
- * <p>Defined by the XML specification to be
- * "{@code http://www.w3.org/2000/xmlns/}".</p>
- *
- * @see <a
- * href="http://www.w3.org/TR/REC-xml-names/#ns-qualnames">
- * Namespaces in XML, 3. Qualified Names</a>
- * @see <a
- * href="http://www.w3.org/XML/xml-names-19990114-errata">
- * Namespaces in XML Errata</a>
- */
- public static final String XMLNS_ATTRIBUTE_NS_URI =
- "http://www.w3.org/2000/xmlns/";
-
- /**
- * <p>The official XML attribute used for specifying XML Namespace
- * declarations.</p>
- *
- * <p>It is <strong><em>NOT</em></strong> valid to use as a
- * prefix. Defined by the XML specification to be
- * "{@code xmlns}".</p>
- *
- * @see <a
- * href="http://www.w3.org/TR/REC-xml-names/#ns-qualnames">
- * Namespaces in XML, 3. Qualified Names</a>
- */
- public static final String XMLNS_ATTRIBUTE = "xmlns";
-
- /**
- * <p>W3C XML Schema Namespace URI.</p>
- *
- * <p>Defined to be "{@code http://www.w3.org/2001/XMLSchema}".
- *
- * @see <a href=
- * "http://www.w3.org/TR/xmlschema-1/#Instance_Document_Constructions">
- * XML Schema Part 1:
- * Structures, 2.6 Schema-Related Markup in Documents Being Validated</a>
- */
- public static final String W3C_XML_SCHEMA_NS_URI =
- "http://www.w3.org/2001/XMLSchema";
-
- /**
- * <p>W3C XML Schema Instance Namespace URI.</p>
- *
- * <p>Defined to be "{@code http://www.w3.org/2001/XMLSchema-instance}".</p>
- *
- * @see <a href=
- * "http://www.w3.org/TR/xmlschema-1/#Instance_Document_Constructions">
- * XML Schema Part 1:
- * Structures, 2.6 Schema-Related Markup in Documents Being Validated</a>
- */
- public static final String W3C_XML_SCHEMA_INSTANCE_NS_URI =
- "http://www.w3.org/2001/XMLSchema-instance";
-
- /**
- * <p>W3C XPath Datatype Namespace URI.</p>
- *
- * <p>Defined to be "{@code http://www.w3.org/2003/11/xpath-datatypes}".</p>
- *
- * @see <a href="http://www.w3.org/TR/xpath-datamodel">XQuery 1.0 and XPath 2.0 Data Model</a>
- */
- public static final String W3C_XPATH_DATATYPE_NS_URI = "http://www.w3.org/2003/11/xpath-datatypes";
-
- /**
- * <p>XML Document Type Declaration Namespace URI as an arbitrary value.</p>
- *
- * <p>Since not formally defined by any existing standard, arbitrarily define to be "{@code http://www.w3.org/TR/REC-xml}".
- */
- public static final String XML_DTD_NS_URI = "http://www.w3.org/TR/REC-xml";
-
- /**
- * <p>RELAX NG Namespace URI.</p>
- *
- * <p>Defined to be "{@code http://relaxng.org/ns/structure/1.0}".</p>
- *
- * @see <a href="http://relaxng.org/spec-20011203.html">RELAX NG Specification</a>
- */
- public static final String RELAXNG_NS_URI = "http://relaxng.org/ns/structure/1.0";
-
- /**
- * <p>Feature for secure processing.</p>
- *
- * <ul>
- * <li>
- * {@code true} instructs the implementation to process XML securely.
- * This may set limits on XML constructs to avoid conditions such as denial of service attacks.
- * </li>
- * <li>
- * {@code false} instructs the implementation to process XML in accordance with the XML specifications
- * ignoring security issues such as limits on XML constructs to avoid conditions such as denial of service attacks.
- * </li>
- * </ul>
- */
- public static final String FEATURE_SECURE_PROCESSING = "http://javax.xml.XMLConstants/feature/secure-processing";
-
-
- /**
- * <p>Property: accessExternalDTD</p>
- *
- * <p>
- * Restrict access to external DTDs and external Entity References to the protocols specified.
- * If access is denied due to the restriction of this property, a runtime exception that
- * is specific to the context is thrown. In the case of {@link javax.xml.parsers.SAXParser}
- * for example, {@link org.xml.sax.SAXException} is thrown.
- * </p>
- *
- * <p>
- * <b>Value: </b> a list of protocols separated by comma. A protocol is the scheme portion of a
- * {@link java.net.URI}, or in the case of the JAR protocol, "jar" plus the scheme portion
- * separated by colon.
- * A scheme is defined as:
- *
- * <blockquote>
- * scheme = alpha *( alpha | digit | "+" | "-" | "." )<br>
- * where alpha = a-z and A-Z.<br><br>
- *
- * And the JAR protocol:<br>
- *
- * jar[:scheme]<br><br>
- *
- * Protocols including the keyword "jar" are case-insensitive. Any whitespaces as defined by
- * {@link java.lang.Character#isSpaceChar } in the value will be ignored.
- * Examples of protocols are file, http, jar:file.
- *
- * </blockquote>
- *</p>
- *
- *<p>
- * <b>Default value:</b> The default value is implementation specific and therefore not specified.
- * The following options are provided for consideration:
- * <blockquote>
- * <UL>
- * <LI>an empty string to deny all access to external references;</LI>
- * <LI>a specific protocol, such as file, to give permission to only the protocol;</LI>
- * <LI>the keyword "all" to grant permission to all protocols.</LI>
- *</UL><br>
- * When FEATURE_SECURE_PROCESSING is enabled, it is recommended that implementations
- * restrict external connections by default, though this may cause problems for applications
- * that process XML/XSD/XSL with external references.
- * </blockquote>
- * </p>
- *
- * <p>
- * <b>Granting all access:</b> the keyword "all" grants permission to all protocols.
- * </p>
- * <p>
- * <b>System Property:</b> The value of this property can be set or overridden by
- * system property {@code javax.xml.accessExternalDTD}.
- * </p>
- *
- * <p>
- * <b>${JAVA_HOME}/lib/jaxp.properties:</b> This configuration file is in standard
- * {@link java.util.Properties} format. If the file exists and the system property is specified,
- * its value will be used to override the default of the property.
- * </p>
- *
- * <p>
- *
- * </p>
- * @since 1.7
- */
- public static final String ACCESS_EXTERNAL_DTD = "http://javax.xml.XMLConstants/property/accessExternalDTD";
-
- /**
- * <p>Property: accessExternalSchema</p>
- *
- * <p>
- * Restrict access to the protocols specified for external reference set by the
- * schemaLocation attribute, Import and Include element. If access is denied
- * due to the restriction of this property, a runtime exception that is specific
- * to the context is thrown. In the case of {@link javax.xml.validation.SchemaFactory}
- * for example, org.xml.sax.SAXException is thrown.
- * </p>
- * <p>
- * <b>Value:</b> a list of protocols separated by comma. A protocol is the scheme portion of a
- * {@link java.net.URI}, or in the case of the JAR protocol, "jar" plus the scheme portion
- * separated by colon.
- * A scheme is defined as:
- *
- * <blockquote>
- * scheme = alpha *( alpha | digit | "+" | "-" | "." )<br>
- * where alpha = a-z and A-Z.<br><br>
- *
- * And the JAR protocol:<br>
- *
- * jar[:scheme]<br><br>
- *
- * Protocols including the keyword "jar" are case-insensitive. Any whitespaces as defined by
- * {@link java.lang.Character#isSpaceChar } in the value will be ignored.
- * Examples of protocols are file, http, jar:file.
- *
- * </blockquote>
- *</p>
- *
- *<p>
- * <b>Default value:</b> The default value is implementation specific and therefore not specified.
- * The following options are provided for consideration:
- * <blockquote>
- * <UL>
- * <LI>an empty string to deny all access to external references;</LI>
- * <LI>a specific protocol, such as file, to give permission to only the protocol;</LI>
- * <LI>the keyword "all" to grant permission to all protocols.</LI>
- *</UL><br>
- * When FEATURE_SECURE_PROCESSING is enabled, it is recommended that implementations
- * restrict external connections by default, though this may cause problems for applications
- * that process XML/XSD/XSL with external references.
- * </blockquote>
- * </p>
- * <p>
- * <b>Granting all access:</b> the keyword "all" grants permission to all protocols.
- * </p>
- *
- * <p>
- * <b>System Property:</b> The value of this property can be set or overridden by
- * system property {@code javax.xml.accessExternalSchema}
- * </p>
- *
- * <p>
- * <b>${JAVA_HOME}/lib/jaxp.properties:</b> This configuration file is in standard
- * java.util.Properties format. If the file exists and the system property is specified,
- * its value will be used to override the default of the property.
- *
- * @since 1.7
- * </p>
- */
- public static final String ACCESS_EXTERNAL_SCHEMA = "http://javax.xml.XMLConstants/property/accessExternalSchema";
-
- /**
- * <p>Property: accessExternalStylesheet</p>
- *
- * <p>
- * Restrict access to the protocols specified for external references set by the
- * stylesheet processing instruction, Import and Include element, and document function.
- * If access is denied due to the restriction of this property, a runtime exception
- * that is specific to the context is thrown. In the case of constructing new
- * {@link javax.xml.transform.Transformer} for example,
- * {@link javax.xml.transform.TransformerConfigurationException}
- * will be thrown by the {@link javax.xml.transform.TransformerFactory}.
- * </p>
- * <p>
- * <b>Value:</b> a list of protocols separated by comma. A protocol is the scheme portion of a
- * {@link java.net.URI}, or in the case of the JAR protocol, "jar" plus the scheme portion
- * separated by colon.
- * A scheme is defined as:
- *
- * <blockquote>
- * scheme = alpha *( alpha | digit | "+" | "-" | "." )<br>
- * where alpha = a-z and A-Z.<br><br>
- *
- * And the JAR protocol:<br>
- *
- * jar[:scheme]<br><br>
- *
- * Protocols including the keyword "jar" are case-insensitive. Any whitespaces as defined by
- * {@link java.lang.Character#isSpaceChar } in the value will be ignored.
- * Examples of protocols are file, http, jar:file.
- *
- * </blockquote>
- *</p>
- *
- *<p>
- * <b>Default value:</b> The default value is implementation specific and therefore not specified.
- * The following options are provided for consideration:
- * <blockquote>
- * <UL>
- * <LI>an empty string to deny all access to external references;</LI>
- * <LI>a specific protocol, such as file, to give permission to only the protocol;</LI>
- * <LI>the keyword "all" to grant permission to all protocols.</LI>
- *</UL><br>
- * When FEATURE_SECURE_PROCESSING is enabled, it is recommended that implementations
- * restrict external connections by default, though this may cause problems for applications
- * that process XML/XSD/XSL with external references.
- * </blockquote>
- * </p>
- * <p>
- * <b>Granting all access:</b> the keyword "all" grants permission to all protocols.
- * </p>
- *
- * <p>
- * <b>System Property:</b> The value of this property can be set or overridden by
- * system property {@code javax.xml.accessExternalStylesheet}
- * </p>
- *
- * <p>
- * <b>${JAVA_HOME}/lib/jaxp.properties: </b> This configuration file is in standard
- * java.util.Properties format. If the file exists and the system property is specified,
- * its value will be used to override the default of the property.
- *
- * @since 1.7
- */
- public static final String ACCESS_EXTERNAL_STYLESHEET = "http://javax.xml.XMLConstants/property/accessExternalStylesheet";
-
-}
diff --git a/src/javax/xml/datatype/DatatypeConfigurationException.java b/src/javax/xml/datatype/DatatypeConfigurationException.java
deleted file mode 100644
index 7f96ce9..0000000
--- a/src/javax/xml/datatype/DatatypeConfigurationException.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.datatype;
-
-/**
- * <p>Indicates a serious configuration error.</p>
- *
- * @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a>
- * @since 1.5
- */
-
-public class DatatypeConfigurationException extends Exception {
-
- /**
- * <p>Create a new <code>DatatypeConfigurationException</code> with
- * no specified detail mesage and cause.</p>
- */
-
- public DatatypeConfigurationException() {
- super();
- }
-
- /**
- * <p>Create a new <code>DatatypeConfigurationException</code> with
- * the specified detail message.</p>
- *
- * @param message The detail message.
- */
-
- public DatatypeConfigurationException(String message) {
- super(message);
- }
-
- /**
- * <p>Create a new <code>DatatypeConfigurationException</code> with
- * the specified detail message and cause.</p>
- *
- * @param message The detail message.
- * @param cause The cause. A <code>null</code> value is permitted, and indicates that the cause is nonexistent or unknown.
- */
-
- public DatatypeConfigurationException(String message, Throwable cause) {
- super(message, cause);
- }
-
- /**
- * <p>Create a new <code>DatatypeConfigurationException</code> with
- * the specified cause.</p>
- *
- * @param cause The cause. A <code>null</code> value is permitted, and indicates that the cause is nonexistent or unknown.
- */
-
- public DatatypeConfigurationException(Throwable cause) {
- super(cause);
- }
-}
diff --git a/src/javax/xml/datatype/DatatypeConstants.java b/src/javax/xml/datatype/DatatypeConstants.java
deleted file mode 100644
index 519d81d..0000000
--- a/src/javax/xml/datatype/DatatypeConstants.java
+++ /dev/null
@@ -1,274 +0,0 @@
-/*
- * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.datatype;
-
-import javax.xml.XMLConstants;
-import javax.xml.namespace.QName;
-
-/**
- * <p>Utility class to contain basic Datatype values as constants.</p>
- *
- * @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a>
- * @since 1.5
- */
-
-public final class DatatypeConstants {
-
- /**
- * <p>Private constructor to prevent instantiation.</p>
- */
- private DatatypeConstants() {
- }
-
- /**
- * Value for first month of year.
- */
- public static final int JANUARY = 1;
-
- /**
- * Value for second month of year.
- */
- public static final int FEBRUARY = 2;
-
- /**
- * Value for third month of year.
- */
- public static final int MARCH = 3;
-
- /**
- * Value for fourth month of year.
- */
- public static final int APRIL = 4;
-
- /**
- * Value for fifth month of year.
- */
- public static final int MAY = 5;
-
- /**
- * Value for sixth month of year.
- */
- public static final int JUNE = 6;
-
- /**
- * Value for seventh month of year.
- */
- public static final int JULY = 7;
-
- /**
- * Value for eighth month of year.
- */
- public static final int AUGUST = 8;
-
- /**
- * Value for ninth month of year.
- */
- public static final int SEPTEMBER = 9;
-
- /**
- * Value for tenth month of year.
- */
- public static final int OCTOBER = 10;
-
- /**
- * Value for eleven month of year.
- */
- public static final int NOVEMBER = 11;
-
- /**
- * Value for twelve month of year.
- */
- public static final int DECEMBER = 12;
-
- /**
- * <p>Comparison result.</p>
- */
- public static final int LESSER = -1;
-
- /**
- * <p>Comparison result.</p>
- */
- public static final int EQUAL = 0;
-
- /**
- * <p>Comparison result.</p>
- */
- public static final int GREATER = 1;
-
- /**
- * <p>Comparison result.</p>
- */
- public static final int INDETERMINATE = 2;
-
- /**
- * Designation that an "int" field is not set.
- */
- public static final int FIELD_UNDEFINED = Integer.MIN_VALUE;
-
- /**
- * <p>A constant that represents the years field.</p>
- */
- public static final Field YEARS = new Field("YEARS", 0);
-
- /**
- * <p>A constant that represents the months field.</p>
- */
- public static final Field MONTHS = new Field("MONTHS", 1);
-
- /**
- * <p>A constant that represents the days field.</p>
- */
- public static final Field DAYS = new Field("DAYS", 2);
-
- /**
- * <p>A constant that represents the hours field.</p>
- */
- public static final Field HOURS = new Field("HOURS", 3);
-
- /**
- * <p>A constant that represents the minutes field.</p>
- */
- public static final Field MINUTES = new Field("MINUTES", 4);
-
- /**
- * <p>A constant that represents the seconds field.</p>
- */
- public static final Field SECONDS = new Field("SECONDS", 5);
-
- /**
- * Type-safe enum class that represents six fields
- * of the {@link Duration} class.
- * @since 1.5
- */
- public static final class Field {
-
- /**
- * <p><code>String</code> representation of <code>Field</code>.</p>
- */
- private final String str;
- /**
- * <p>Unique id of the field.</p>
- *
- * <p>This value allows the {@link Duration} class to use switch
- * statements to process fields.</p>
- */
- private final int id;
-
- /**
- * <p>Construct a <code>Field</code> with specified values.</p>
- * @param str <code>String</code> representation of <code>Field</code>
- * @param id <code>int</code> representation of <code>Field</code>
- */
- private Field(final String str, final int id) {
- this.str = str;
- this.id = id;
- }
- /**
- * Returns a field name in English. This method
- * is intended to be used for debugging/diagnosis
- * and not for display to end-users.
- *
- * @return
- * a non-null valid String constant.
- */
- public String toString() { return str; }
-
- /**
- * <p>Get id of this Field.</p>
- *
- * @return Id of field.
- */
- public int getId() {
- return id;
- }
- }
-
- /**
- * <p>Fully qualified name for W3C XML Schema 1.0 datatype <code>dateTime</code>.</p>
- */
- public static final QName DATETIME = new QName(XMLConstants.W3C_XML_SCHEMA_NS_URI, "dateTime");
-
- /**
- * <p>Fully qualified name for W3C XML Schema 1.0 datatype <code>time</code>.</p>
- */
- public static final QName TIME = new QName(XMLConstants.W3C_XML_SCHEMA_NS_URI, "time");
-
- /**
- * <p>Fully qualified name for W3C XML Schema 1.0 datatype <code>date</code>.</p>
- */
- public static final QName DATE = new QName(XMLConstants.W3C_XML_SCHEMA_NS_URI, "date");
-
- /**
- * <p>Fully qualified name for W3C XML Schema 1.0 datatype <code>gYearMonth</code>.</p>
- */
- public static final QName GYEARMONTH = new QName(XMLConstants.W3C_XML_SCHEMA_NS_URI, "gYearMonth");
-
- /**
- * <p>Fully qualified name for W3C XML Schema 1.0 datatype <code>gMonthDay</code>.</p>
- */
- public static final QName GMONTHDAY = new QName(XMLConstants.W3C_XML_SCHEMA_NS_URI, "gMonthDay");
-
- /**
- * <p>Fully qualified name for W3C XML Schema 1.0 datatype <code>gYear</code>.</p>
- */
- public static final QName GYEAR = new QName(XMLConstants.W3C_XML_SCHEMA_NS_URI, "gYear");
-
- /**
- * <p>Fully qualified name for W3C XML Schema 1.0 datatype <code>gMonth</code>.</p>
- */
- public static final QName GMONTH = new QName(XMLConstants.W3C_XML_SCHEMA_NS_URI, "gMonth");
-
- /**
- * <p>Fully qualified name for W3C XML Schema 1.0 datatype <code>gDay</code>.</p>
- */
- public static final QName GDAY = new QName(XMLConstants.W3C_XML_SCHEMA_NS_URI, "gDay");
-
- /**
- * <p>Fully qualified name for W3C XML Schema datatype <code>duration</code>.</p>
- */
- public static final QName DURATION = new QName(XMLConstants.W3C_XML_SCHEMA_NS_URI, "duration");
-
- /**
- * <p>Fully qualified name for XQuery 1.0 and XPath 2.0 datatype <code>dayTimeDuration</code>.</p>
- */
- public static final QName DURATION_DAYTIME = new QName(XMLConstants.W3C_XPATH_DATATYPE_NS_URI, "dayTimeDuration");
-
- /**
- * <p>Fully qualified name for XQuery 1.0 and XPath 2.0 datatype <code>yearMonthDuration</code>.</p>
- */
- public static final QName DURATION_YEARMONTH = new QName(XMLConstants.W3C_XPATH_DATATYPE_NS_URI, "yearMonthDuration");
-
- /**
- * W3C XML Schema max timezone offset is -14:00. Zone offset is in minutes.
- */
- public static final int MAX_TIMEZONE_OFFSET = -14 * 60;
-
- /**
- * W3C XML Schema min timezone offset is +14:00. Zone offset is in minutes.
- */
- public static final int MIN_TIMEZONE_OFFSET = 14 * 60;
-
-}
diff --git a/src/javax/xml/datatype/DatatypeFactory.java b/src/javax/xml/datatype/DatatypeFactory.java
deleted file mode 100644
index 56c796b..0000000
--- a/src/javax/xml/datatype/DatatypeFactory.java
+++ /dev/null
@@ -1,1074 +0,0 @@
-/*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.datatype;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.util.GregorianCalendar;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * <p>Factory that creates new <code>javax.xml.datatype</code> <code>Object</code>s that map XML to/from Java <code>Object</code>s.</p>
- *
- * <p>A new instance of the <code>DatatypeFactory</code> is created through the {@link #newInstance()} method
- * that uses the following implementation resolution mechanisms to determine an implementation:</p>
- * <ol>
- * <li>
- * If the system property specified by {@link #DATATYPEFACTORY_PROPERTY}, "<code>javax.xml.datatype.DatatypeFactory</code>",
- * exists, a class with the name of the property value is instantiated.
- * Any Exception thrown during the instantiation process is wrapped as a {@link DatatypeConfigurationException}.
- * </li>
- * <li>
- * If the file ${JAVA_HOME}/lib/jaxp.properties exists, it is loaded in a {@link java.util.Properties} <code>Object</code>.
- * The <code>Properties</code> <code>Object </code> is then queried for the property as documented in the prior step
- * and processed as documented in the prior step.
- * </li>
- * <li>
- * Uses the service-provider loading facilities, defined by the {@link java.util.ServiceLoader} class, to attempt
- * to locate and load an implementation of the service using the {@linkplain
- * java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}:
- * the service-provider loading facility will use the {@linkplain
- * java.lang.Thread#getContextClassLoader() current thread's context class loader}
- * to attempt to load the service. If the context class
- * loader is null, the {@linkplain
- * ClassLoader#getSystemClassLoader() system class loader} will be used.
- * <br>
- * In case of {@link java.util.ServiceConfigurationError service
- * configuration error} a {@link javax.xml.datatype.DatatypeConfigurationException}
- * will be thrown.
- * </li>
- * <li>
- * The final mechanism is to attempt to instantiate the <code>Class</code> specified by
- * {@link #DATATYPEFACTORY_IMPLEMENTATION_CLASS}.
- * Any Exception thrown during the instantiation process is wrapped as a {@link DatatypeConfigurationException}.
- * </li>
- * </ol>
- *
- * @author <a href="mailto:Joseph.Fialli@Sun.COM">Joseph Fialli</a>
- * @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a>
- * @author <a href="mailto:Neeraj.Bajaj@sun.com">Neeraj Bajaj</a>
- *
- * @version $Revision: 1.13 $, $Date: 2010/03/11 23:10:53 $
- * @since 1.5
- */
-public abstract class DatatypeFactory {
-
- /**
- * <p>Default property name as defined in JSR 206: Java(TM) API for XML Processing (JAXP) 1.3.</p>
- *
- * <p>Default value is <code>javax.xml.datatype.DatatypeFactory</code>.</p>
- */
- public static final String DATATYPEFACTORY_PROPERTY =
- // We use a String constant here, rather than calling
- // DatatypeFactory.class.getName() - in order to make javadoc
- // generate a See Also: Constant Field Value link.
- "javax.xml.datatype.DatatypeFactory";
-
- /**
- * <p>Default implementation class name as defined in
- * <em>JSR 206: Java(TM) API for XML Processing (JAXP) 1.3</em>.</p>
- *
- * <p>Implementers should specify the name of an appropriate class
- * to be instantiated if no other implementation resolution mechanism
- * succeeds.</p>
- *
- * <p>Users should not refer to this field; it is intended only to
- * document a factory implementation detail.
- * </p>
- */
- public static final String DATATYPEFACTORY_IMPLEMENTATION_CLASS =
- // We use new String() here to prevent javadoc from generating
- // a See Also: Constant Field Value link.
- new String("com.sun.org.apache.xerces.internal.jaxp.datatype.DatatypeFactoryImpl");
-
- /**
- * http://www.w3.org/TR/xpath-datamodel/#xdtschema defines two regexps
- * to constrain the value space of dayTimeDuration ([^YM]*[DT].*)
- * and yearMonthDuration ([^DT]*). Note that these expressions rely on
- * the fact that the value must be an xs:Duration, they simply exclude
- * some Durations.
- */
- private static final Pattern XDTSCHEMA_YMD =
- Pattern.compile("[^DT]*");
-
- private static final Pattern XDTSCHEMA_DTD =
- Pattern.compile("[^YM]*[DT].*");
-
- /**
- * <p>Protected constructor to prevent instaniation outside of package.</p>
- *
- * <p>Use {@link #newInstance()} to create a <code>DatatypeFactory</code>.</p>
- */
- protected DatatypeFactory() {
- }
-
- /**
- * <p>Obtain a new instance of a <code>DatatypeFactory</code>.</p>
- *
- * <p>The implementation resolution mechanisms are <a href="#DatatypeFactory.newInstance">defined</a> in this
- * <code>Class</code>'s documentation.</p>
- *
- * @return New instance of a <code>DatatypeFactory</code>
- *
- * @throws DatatypeConfigurationException If the implementation is not
- * available or cannot be instantiated.
- *
- * @see #newInstance(String factoryClassName, ClassLoader classLoader)
- */
- public static DatatypeFactory newInstance()
- throws DatatypeConfigurationException {
-
- return FactoryFinder.find(
- /* The default property name according to the JAXP spec */
- DatatypeFactory.class,
- /* The fallback implementation class name */
- DATATYPEFACTORY_IMPLEMENTATION_CLASS);
- }
-
- /**
- * <p>Obtain a new instance of a <code>DatatypeFactory</code> from class name.
- * This function is useful when there are multiple providers in the classpath.
- * It gives more control to the application as it can specify which provider
- * should be loaded.</p>
- *
- * <p>Once an application has obtained a reference to a <code>DatatypeFactory</code>
- * it can use the factory to configure and obtain datatype instances.</P>
- *
- *
- * <h2>Tip for Trouble-shooting</h2>
- * <p>Setting the <code>jaxp.debug</code> system property will cause
- * this method to print a lot of debug messages
- * to <code>System.err</code> about what it is doing and where it is looking at.</p>
- *
- * <p> If you have problems try:</p>
- * <pre>
- * java -Djaxp.debug=1 YourProgram ....
- * </pre>
- *
- * @param factoryClassName fully qualified factory class name that provides implementation of <code>javax.xml.datatype.DatatypeFactory</code>.
- *
- * @param classLoader <code>ClassLoader</code> used to load the factory class. If <code>null</code>
- * current <code>Thread</code>'s context classLoader is used to load the factory class.
- *
- * @return New instance of a <code>DatatypeFactory</code>
- *
- * @throws DatatypeConfigurationException if <code>factoryClassName</code> is <code>null</code>, or
- * the factory class cannot be loaded, instantiated.
- *
- * @see #newInstance()
- *
- * @since 1.6
- */
- public static DatatypeFactory newInstance(String factoryClassName, ClassLoader classLoader)
- throws DatatypeConfigurationException {
- return FactoryFinder.newInstance(DatatypeFactory.class,
- factoryClassName, classLoader, false);
- }
-
- /**
- * <p>Obtain a new instance of a <code>Duration</code>
- * specifying the <code>Duration</code> as its string representation, "PnYnMnDTnHnMnS",
- * as defined in XML Schema 1.0 section 3.2.6.1.</p>
- *
- * <p>XML Schema Part 2: Datatypes, 3.2.6 duration, defines <code>duration</code> as:</p>
- * <blockquote>
- * duration represents a duration of time.
- * The value space of duration is a six-dimensional space where the coordinates designate the
- * Gregorian year, month, day, hour, minute, and second components defined in Section 5.5.3.2 of [ISO 8601], respectively.
- * These components are ordered in their significance by their order of appearance i.e. as
- * year, month, day, hour, minute, and second.
- * </blockquote>
- * <p>All six values are set and available from the created {@link Duration}</p>
- *
- * <p>The XML Schema specification states that values can be of an arbitrary size.
- * Implementations may chose not to or be incapable of supporting arbitrarily large and/or small values.
- * An {@link UnsupportedOperationException} will be thrown with a message indicating implementation limits
- * if implementation capacities are exceeded.</p>
- *
- * @param lexicalRepresentation <code>String</code> representation of a <code>Duration</code>.
- *
- * @return New <code>Duration</code> created from parsing the <code>lexicalRepresentation</code>.
- *
- * @throws IllegalArgumentException If <code>lexicalRepresentation</code> is not a valid representation of a <code>Duration</code>.
- * @throws UnsupportedOperationException If implementation cannot support requested values.
- * @throws NullPointerException if <code>lexicalRepresentation</code> is <code>null</code>.
- */
- public abstract Duration newDuration(final String lexicalRepresentation);
-
- /**
- * <p>Obtain a new instance of a <code>Duration</code>
- * specifying the <code>Duration</code> as milliseconds.</p>
- *
- * <p>XML Schema Part 2: Datatypes, 3.2.6 duration, defines <code>duration</code> as:</p>
- * <blockquote>
- * duration represents a duration of time.
- * The value space of duration is a six-dimensional space where the coordinates designate the
- * Gregorian year, month, day, hour, minute, and second components defined in Section 5.5.3.2 of [ISO 8601], respectively.
- * These components are ordered in their significance by their order of appearance i.e. as
- * year, month, day, hour, minute, and second.
- * </blockquote>
- * <p>All six values are set by computing their values from the specified milliseconds
- * and are available using the <code>get</code> methods of the created {@link Duration}.
- * The values conform to and are defined by:</p>
- * <ul>
- * <li>ISO 8601:2000(E) Section 5.5.3.2 Alternative format</li>
- * <li><a href="http://www.w3.org/TR/xmlschema-2/#isoformats">
- * W3C XML Schema 1.0 Part 2, Appendix D, ISO 8601 Date and Time Formats</a>
- * </li>
- * <li>{@link XMLGregorianCalendar} Date/Time Datatype Field Mapping Between XML Schema 1.0 and Java Representation</li>
- * </ul>
- *
- * <p>The default start instance is defined by {@link GregorianCalendar}'s use of the start of the epoch: i.e.,
- * {@link java.util.Calendar#YEAR} = 1970,
- * {@link java.util.Calendar#MONTH} = {@link java.util.Calendar#JANUARY},
- * {@link java.util.Calendar#DATE} = 1, etc.
- * This is important as there are variations in the Gregorian Calendar,
- * e.g. leap years have different days in the month = {@link java.util.Calendar#FEBRUARY}
- * so the result of {@link Duration#getMonths()} and {@link Duration#getDays()} can be influenced.</p>
- *
- * @param durationInMilliSeconds Duration in milliseconds to create.
- *
- * @return New <code>Duration</code> representing <code>durationInMilliSeconds</code>.
- */
- public abstract Duration newDuration(final long durationInMilliSeconds);
-
- /**
- * <p>Obtain a new instance of a <code>Duration</code>
- * specifying the <code>Duration</code> as isPositive, years, months, days, hours, minutes, seconds.</p>
- *
- * <p>The XML Schema specification states that values can be of an arbitrary size.
- * Implementations may chose not to or be incapable of supporting arbitrarily large and/or small values.
- * An {@link UnsupportedOperationException} will be thrown with a message indicating implementation limits
- * if implementation capacities are exceeded.</p>
- *
- * <p>A <code>null</code> value indicates that field is not set.</p>
- *
- * @param isPositive Set to <code>false</code> to create a negative duration. When the length
- * of the duration is zero, this parameter will be ignored.
- * @param years of this <code>Duration</code>
- * @param months of this <code>Duration</code>
- * @param days of this <code>Duration</code>
- * @param hours of this <code>Duration</code>
- * @param minutes of this <code>Duration</code>
- * @param seconds of this <code>Duration</code>
- *
- * @return New <code>Duration</code> created from the specified values.
- *
- * @throws IllegalArgumentException If the values are not a valid representation of a
- * <code>Duration</code>: if all the fields (years, months, ...) are null or
- * if any of the fields is negative.
- * @throws UnsupportedOperationException If implementation cannot support requested values.
- */
- public abstract Duration newDuration(
- final boolean isPositive,
- final BigInteger years,
- final BigInteger months,
- final BigInteger days,
- final BigInteger hours,
- final BigInteger minutes,
- final BigDecimal seconds);
-
- /**
- * <p>Obtain a new instance of a <code>Duration</code>
- * specifying the <code>Duration</code> as isPositive, years, months, days, hours, minutes, seconds.</p>
- *
- * <p>A {@link DatatypeConstants#FIELD_UNDEFINED} value indicates that field is not set.</p>
- *
- * @param isPositive Set to <code>false</code> to create a negative duration. When the length
- * of the duration is zero, this parameter will be ignored.
- * @param years of this <code>Duration</code>
- * @param months of this <code>Duration</code>
- * @param days of this <code>Duration</code>
- * @param hours of this <code>Duration</code>
- * @param minutes of this <code>Duration</code>
- * @param seconds of this <code>Duration</code>
- *
- * @return New <code>Duration</code> created from the specified values.
- *
- * @throws IllegalArgumentException If the values are not a valid representation of a
- * <code>Duration</code>: if any of the fields is negative.
- *
- * @see #newDuration(
- * boolean isPositive,
- * BigInteger years,
- * BigInteger months,
- * BigInteger days,
- * BigInteger hours,
- * BigInteger minutes,
- * BigDecimal seconds)
- */
- public Duration newDuration(
- final boolean isPositive,
- final int years,
- final int months,
- final int days,
- final int hours,
- final int minutes,
- final int seconds) {
-
- // years may not be set
- BigInteger realYears = (years != DatatypeConstants.FIELD_UNDEFINED) ? BigInteger.valueOf((long) years) : null;
-
- // months may not be set
- BigInteger realMonths = (months != DatatypeConstants.FIELD_UNDEFINED) ? BigInteger.valueOf((long) months) : null;
-
- // days may not be set
- BigInteger realDays = (days != DatatypeConstants.FIELD_UNDEFINED) ? BigInteger.valueOf((long) days) : null;
-
- // hours may not be set
- BigInteger realHours = (hours != DatatypeConstants.FIELD_UNDEFINED) ? BigInteger.valueOf((long) hours) : null;
-
- // minutes may not be set
- BigInteger realMinutes = (minutes != DatatypeConstants.FIELD_UNDEFINED) ? BigInteger.valueOf((long) minutes) : null;
-
- // seconds may not be set
- BigDecimal realSeconds = (seconds != DatatypeConstants.FIELD_UNDEFINED) ? BigDecimal.valueOf((long) seconds) : null;
-
- return newDuration(
- isPositive,
- realYears,
- realMonths,
- realDays,
- realHours,
- realMinutes,
- realSeconds
- );
- }
-
- /**
- * <p>Create a <code>Duration</code> of type <code>xdt:dayTimeDuration</code> by parsing its <code>String</code> representation,
- * "<em>PnDTnHnMnS</em>", <a href="http://www.w3.org/TR/xpath-datamodel#dayTimeDuration">
- * XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration</a>.</p>
- *
- * <p>The datatype <code>xdt:dayTimeDuration</code> is a subtype of <code>xs:duration</code>
- * whose lexical representation contains only day, hour, minute, and second components.
- * This datatype resides in the namespace <code>http://www.w3.org/2003/11/xpath-datatypes</code>.</p>
- *
- * <p>All four values are set and available from the created {@link Duration}</p>
- *
- * <p>The XML Schema specification states that values can be of an arbitrary size.
- * Implementations may chose not to or be incapable of supporting arbitrarily large and/or small values.
- * An {@link UnsupportedOperationException} will be thrown with a message indicating implementation limits
- * if implementation capacities are exceeded.</p>
- *
- * @param lexicalRepresentation Lexical representation of a duration.
- *
- * @return New <code>Duration</code> created using the specified <code>lexicalRepresentation</code>.
- *
- * @throws IllegalArgumentException If <code>lexicalRepresentation</code> is not a valid representation of a <code>Duration</code> expressed only in terms of days and time.
- * @throws UnsupportedOperationException If implementation cannot support requested values.
- * @throws NullPointerException If <code>lexicalRepresentation</code> is <code>null</code>.
- */
- public Duration newDurationDayTime(final String lexicalRepresentation) {
- // lexicalRepresentation must be non-null
- if (lexicalRepresentation == null) {
- throw new NullPointerException(
- "Trying to create an xdt:dayTimeDuration with an invalid"
- + " lexical representation of \"null\"");
- }
-
- // test lexicalRepresentation against spec regex
- Matcher matcher = XDTSCHEMA_DTD.matcher(lexicalRepresentation);
- if (!matcher.matches()) {
- throw new IllegalArgumentException(
- "Trying to create an xdt:dayTimeDuration with an invalid"
- + " lexical representation of \"" + lexicalRepresentation
- + "\", data model requires years and months only.");
- }
-
- return newDuration(lexicalRepresentation);
- }
-
- /**
- * <p>Create a <code>Duration</code> of type <code>xdt:dayTimeDuration</code> using the specified milliseconds as defined in
- * <a href="http://www.w3.org/TR/xpath-datamodel#dayTimeDuration">
- * XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration</a>.</p>
- *
- * <p>The datatype <code>xdt:dayTimeDuration</code> is a subtype of <code>xs:duration</code>
- * whose lexical representation contains only day, hour, minute, and second components.
- * This datatype resides in the namespace <code>http://www.w3.org/2003/11/xpath-datatypes</code>.</p>
- *
- * <p>All four values are set by computing their values from the specified milliseconds
- * and are available using the <code>get</code> methods of the created {@link Duration}.
- * The values conform to and are defined by:</p>
- * <ul>
- * <li>ISO 8601:2000(E) Section 5.5.3.2 Alternative format</li>
- * <li><a href="http://www.w3.org/TR/xmlschema-2/#isoformats">
- * W3C XML Schema 1.0 Part 2, Appendix D, ISO 8601 Date and Time Formats</a>
- * </li>
- * <li>{@link XMLGregorianCalendar} Date/Time Datatype Field Mapping Between XML Schema 1.0 and Java Representation</li>
- * </ul>
- *
- * <p>The default start instance is defined by {@link GregorianCalendar}'s use of the start of the epoch: i.e.,
- * {@link java.util.Calendar#YEAR} = 1970,
- * {@link java.util.Calendar#MONTH} = {@link java.util.Calendar#JANUARY},
- * {@link java.util.Calendar#DATE} = 1, etc.
- * This is important as there are variations in the Gregorian Calendar,
- * e.g. leap years have different days in the month = {@link java.util.Calendar#FEBRUARY}
- * so the result of {@link Duration#getDays()} can be influenced.</p>
- *
- * <p>Any remaining milliseconds after determining the day, hour, minute and second are discarded.</p>
- *
- * @param durationInMilliseconds Milliseconds of <code>Duration</code> to create.
- *
- * @return New <code>Duration</code> created with the specified <code>durationInMilliseconds</code>.
- *
- * @see <a href="http://www.w3.org/TR/xpath-datamodel#dayTimeDuration">
- * XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration</a>
- */
- public Duration newDurationDayTime(final long durationInMilliseconds) {
-
- return newDuration(durationInMilliseconds);
- }
-
- /**
- * <p>Create a <code>Duration</code> of type <code>xdt:dayTimeDuration</code> using the specified
- * <code>day</code>, <code>hour</code>, <code>minute</code> and <code>second</code> as defined in
- * <a href="http://www.w3.org/TR/xpath-datamodel#dayTimeDuration">
- * XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration</a>.</p>
- *
- * <p>The datatype <code>xdt:dayTimeDuration</code> is a subtype of <code>xs:duration</code>
- * whose lexical representation contains only day, hour, minute, and second components.
- * This datatype resides in the namespace <code>http://www.w3.org/2003/11/xpath-datatypes</code>.</p>
- *
- * <p>The XML Schema specification states that values can be of an arbitrary size.
- * Implementations may chose not to or be incapable of supporting arbitrarily large and/or small values.
- * An {@link UnsupportedOperationException} will be thrown with a message indicating implementation limits
- * if implementation capacities are exceeded.</p>
- *
- * <p>A <code>null</code> value indicates that field is not set.</p>
- *
- * @param isPositive Set to <code>false</code> to create a negative duration. When the length
- * of the duration is zero, this parameter will be ignored.
- * @param day Day of <code>Duration</code>.
- * @param hour Hour of <code>Duration</code>.
- * @param minute Minute of <code>Duration</code>.
- * @param second Second of <code>Duration</code>.
- *
- * @return New <code>Duration</code> created with the specified <code>day</code>, <code>hour</code>, <code>minute</code>
- * and <code>second</code>.
- *
- * @throws IllegalArgumentException If the values are not a valid representation of a
- * <code>Duration</code>: if all the fields (day, hour, ...) are null or
- * if any of the fields is negative.
- * @throws UnsupportedOperationException If implementation cannot support requested values.
- */
- public Duration newDurationDayTime(
- final boolean isPositive,
- final BigInteger day,
- final BigInteger hour,
- final BigInteger minute,
- final BigInteger second) {
-
- return newDuration(
- isPositive,
- null, // years
- null, // months
- day,
- hour,
- minute,
- (second != null)? new BigDecimal(second):null
- );
- }
-
- /**
- * <p>Create a <code>Duration</code> of type <code>xdt:dayTimeDuration</code> using the specified
- * <code>day</code>, <code>hour</code>, <code>minute</code> and <code>second</code> as defined in
- * <a href="http://www.w3.org/TR/xpath-datamodel#dayTimeDuration">
- * XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration</a>.</p>
- *
- * <p>The datatype <code>xdt:dayTimeDuration</code> is a subtype of <code>xs:duration</code>
- * whose lexical representation contains only day, hour, minute, and second components.
- * This datatype resides in the namespace <code>http://www.w3.org/2003/11/xpath-datatypes</code>.</p>
- *
- * <p>A {@link DatatypeConstants#FIELD_UNDEFINED} value indicates that field is not set.</p>
- *
- * @param isPositive Set to <code>false</code> to create a negative duration. When the length
- * of the duration is zero, this parameter will be ignored.
- * @param day Day of <code>Duration</code>.
- * @param hour Hour of <code>Duration</code>.
- * @param minute Minute of <code>Duration</code>.
- * @param second Second of <code>Duration</code>.
- *
- * @return New <code>Duration</code> created with the specified <code>day</code>, <code>hour</code>, <code>minute</code>
- * and <code>second</code>.
- *
- * @throws IllegalArgumentException If the values are not a valid representation of a
- * <code>Duration</code>: if any of the fields (day, hour, ...) is negative.
- */
- public Duration newDurationDayTime(
- final boolean isPositive,
- final int day,
- final int hour,
- final int minute,
- final int second) {
-
- return newDurationDayTime(
- isPositive,
- BigInteger.valueOf((long) day),
- BigInteger.valueOf((long) hour),
- BigInteger.valueOf((long) minute),
- BigInteger.valueOf((long) second)
- );
- }
-
- /**
- * <p>Create a <code>Duration</code> of type <code>xdt:yearMonthDuration</code> by parsing its <code>String</code> representation,
- * "<em>PnYnM</em>", <a href="http://www.w3.org/TR/xpath-datamodel#yearMonthDuration">
- * XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration</a>.</p>
- *
- * <p>The datatype <code>xdt:yearMonthDuration</code> is a subtype of <code>xs:duration</code>
- * whose lexical representation contains only year and month components.
- * This datatype resides in the namespace {@link javax.xml.XMLConstants#W3C_XPATH_DATATYPE_NS_URI}.</p>
- *
- * <p>Both values are set and available from the created {@link Duration}</p>
- *
- * <p>The XML Schema specification states that values can be of an arbitrary size.
- * Implementations may chose not to or be incapable of supporting arbitrarily large and/or small values.
- * An {@link UnsupportedOperationException} will be thrown with a message indicating implementation limits
- * if implementation capacities are exceeded.</p>
- *
- * @param lexicalRepresentation Lexical representation of a duration.
- *
- * @return New <code>Duration</code> created using the specified <code>lexicalRepresentation</code>.
- *
- * @throws IllegalArgumentException If <code>lexicalRepresentation</code> is not a valid representation of a <code>Duration</code> expressed only in terms of years and months.
- * @throws UnsupportedOperationException If implementation cannot support requested values.
- * @throws NullPointerException If <code>lexicalRepresentation</code> is <code>null</code>.
- */
- public Duration newDurationYearMonth(
- final String lexicalRepresentation) {
-
- // lexicalRepresentation must be non-null
- if (lexicalRepresentation == null) {
- throw new NullPointerException(
- "Trying to create an xdt:yearMonthDuration with an invalid"
- + " lexical representation of \"null\"");
- }
-
- // test lexicalRepresentation against spec regex
- Matcher matcher = XDTSCHEMA_YMD.matcher(lexicalRepresentation);
- if (!matcher.matches()) {
- throw new IllegalArgumentException(
- "Trying to create an xdt:yearMonthDuration with an invalid"
- + " lexical representation of \"" + lexicalRepresentation
- + "\", data model requires days and times only.");
- }
-
- return newDuration(lexicalRepresentation);
- }
-
- /**
- * <p>Create a <code>Duration</code> of type <code>xdt:yearMonthDuration</code> using the specified milliseconds as defined in
- * <a href="http://www.w3.org/TR/xpath-datamodel#yearMonthDuration">
- * XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration</a>.</p>
- *
- * <p>The datatype <code>xdt:yearMonthDuration</code> is a subtype of <code>xs:duration</code>
- * whose lexical representation contains only year and month components.
- * This datatype resides in the namespace {@link javax.xml.XMLConstants#W3C_XPATH_DATATYPE_NS_URI}.</p>
- *
- * <p>Both values are set by computing their values from the specified milliseconds
- * and are available using the <code>get</code> methods of the created {@link Duration}.
- * The values conform to and are defined by:</p>
- * <ul>
- * <li>ISO 8601:2000(E) Section 5.5.3.2 Alternative format</li>
- * <li><a href="http://www.w3.org/TR/xmlschema-2/#isoformats">
- * W3C XML Schema 1.0 Part 2, Appendix D, ISO 8601 Date and Time Formats</a>
- * </li>
- * <li>{@link XMLGregorianCalendar} Date/Time Datatype Field Mapping Between XML Schema 1.0 and Java Representation</li>
- * </ul>
- *
- * <p>The default start instance is defined by {@link GregorianCalendar}'s use of the start of the epoch: i.e.,
- * {@link java.util.Calendar#YEAR} = 1970,
- * {@link java.util.Calendar#MONTH} = {@link java.util.Calendar#JANUARY},
- * {@link java.util.Calendar#DATE} = 1, etc.
- * This is important as there are variations in the Gregorian Calendar,
- * e.g. leap years have different days in the month = {@link java.util.Calendar#FEBRUARY}
- * so the result of {@link Duration#getMonths()} can be influenced.</p>
- *
- * <p>Any remaining milliseconds after determining the year and month are discarded.</p>
- *
- * @param durationInMilliseconds Milliseconds of <code>Duration</code> to create.
- *
- * @return New <code>Duration</code> created using the specified <code>durationInMilliseconds</code>.
- */
- public Duration newDurationYearMonth(
- final long durationInMilliseconds) {
-
- // create a Duration that only has sign, year & month
- // Duration is immutable, so need to create a new Duration
- // implementations may override this method in a more efficient way
- Duration fullDuration = newDuration(durationInMilliseconds);
- boolean isPositive = (fullDuration.getSign() == -1) ? false : true;
- BigInteger years =
- (BigInteger) fullDuration.getField(DatatypeConstants.YEARS);
- if (years == null) { years = BigInteger.ZERO; }
- BigInteger months =
- (BigInteger) fullDuration.getField(DatatypeConstants.MONTHS);
- if (months == null) { months = BigInteger.ZERO; }
-
- return newDurationYearMonth(isPositive, years, months);
- }
-
- /**
- * <p>Create a <code>Duration</code> of type <code>xdt:yearMonthDuration</code> using the specified
- * <code>year</code> and <code>month</code> as defined in
- * <a href="http://www.w3.org/TR/xpath-datamodel#yearMonthDuration">
- * XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration</a>.</p>
- *
- * <p>The XML Schema specification states that values can be of an arbitrary size.
- * Implementations may chose not to or be incapable of supporting arbitrarily large and/or small values.
- * An {@link UnsupportedOperationException} will be thrown with a message indicating implementation limits
- * if implementation capacities are exceeded.</p>
- *
- * <p>A <code>null</code> value indicates that field is not set.</p>
- *
- * @param isPositive Set to <code>false</code> to create a negative duration. When the length
- * of the duration is zero, this parameter will be ignored.
- * @param year Year of <code>Duration</code>.
- * @param month Month of <code>Duration</code>.
- *
- * @return New <code>Duration</code> created using the specified <code>year</code> and <code>month</code>.
- *
- * @throws IllegalArgumentException If the values are not a valid representation of a
- * <code>Duration</code>: if all of the fields (year, month) are null or
- * if any of the fields is negative.
- * @throws UnsupportedOperationException If implementation cannot support requested values.
- */
- public Duration newDurationYearMonth(
- final boolean isPositive,
- final BigInteger year,
- final BigInteger month) {
-
- return newDuration(
- isPositive,
- year,
- month,
- null, // days
- null, // hours
- null, // minutes
- null // seconds
- );
- }
-
- /**
- * <p>Create a <code>Duration</code> of type <code>xdt:yearMonthDuration</code> using the specified
- * <code>year</code> and <code>month</code> as defined in
- * <a href="http://www.w3.org/TR/xpath-datamodel#yearMonthDuration">
- * XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration</a>.</p>
- *
- * <p>A {@link DatatypeConstants#FIELD_UNDEFINED} value indicates that field is not set.</p>
- *
- * @param isPositive Set to <code>false</code> to create a negative duration. When the length
- * of the duration is zero, this parameter will be ignored.
- * @param year Year of <code>Duration</code>.
- * @param month Month of <code>Duration</code>.
- *
- * @return New <code>Duration</code> created using the specified <code>year</code> and <code>month</code>.
- *
- * @throws IllegalArgumentException If the values are not a valid representation of a
- * <code>Duration</code>: if any of the fields (year, month) is negative.
- */
- public Duration newDurationYearMonth(
- final boolean isPositive,
- final int year,
- final int month) {
-
- return newDurationYearMonth(
- isPositive,
- BigInteger.valueOf((long) year),
- BigInteger.valueOf((long) month));
- }
-
- /**
- * <p>Create a new instance of an <code>XMLGregorianCalendar</code>.</p>
- *
- * <p>All date/time datatype fields set to {@link DatatypeConstants#FIELD_UNDEFINED} or null.</p>
- *
- * @return New <code>XMLGregorianCalendar</code> with all date/time datatype fields set to
- * {@link DatatypeConstants#FIELD_UNDEFINED} or null.
- */
- public abstract XMLGregorianCalendar newXMLGregorianCalendar();
-
- /**
- * <p>Create a new XMLGregorianCalendar by parsing the String as a lexical representation.</p>
- *
- * <p>Parsing the lexical string representation is defined in
- * <a href="http://www.w3.org/TR/xmlschema-2/#dateTime-order">XML Schema 1.0 Part 2, Section 3.2.[7-14].1,
- * <em>Lexical Representation</em>.</a></p>
- *
- * <p>The string representation may not have any leading and trailing whitespaces.</p>
- *
- * <p>The parsing is done field by field so that
- * the following holds for any lexically correct String x:</p>
- * <pre>
- * newXMLGregorianCalendar(x).toXMLFormat().equals(x)
- * </pre>
- * <p>Except for the noted lexical/canonical representation mismatches
- * listed in <a href="http://www.w3.org/2001/05/xmlschema-errata#e2-45">
- * XML Schema 1.0 errata, Section 3.2.7.2</a>.</p>
- *
- * @param lexicalRepresentation Lexical representation of one the eight XML Schema date/time datatypes.
- *
- * @return <code>XMLGregorianCalendar</code> created from the <code>lexicalRepresentation</code>.
- *
- * @throws IllegalArgumentException If the <code>lexicalRepresentation</code> is not a valid <code>XMLGregorianCalendar</code>.
- * @throws NullPointerException If <code>lexicalRepresentation</code> is <code>null</code>.
- */
- public abstract XMLGregorianCalendar newXMLGregorianCalendar(final String lexicalRepresentation);
-
- /**
- * <p>Create an <code>XMLGregorianCalendar</code> from a {@link GregorianCalendar}.</p>
- *
- * <table border="2" rules="all" cellpadding="2">
- * <thead>
- * <tr>
- * <th align="center" colspan="2">
- * Field by Field Conversion from
- * {@link GregorianCalendar} to an {@link XMLGregorianCalendar}
- * </th>
- * </tr>
- * <tr>
- * <th><code>java.util.GregorianCalendar</code> field</th>
- * <th><code>javax.xml.datatype.XMLGregorianCalendar</code> field</th>
- * </tr>
- * </thead>
- * <tbody>
- * <tr>
- * <td><code>ERA == GregorianCalendar.BC ? -YEAR : YEAR</code></td>
- * <td>{@link XMLGregorianCalendar#setYear(int year)}</td>
- * </tr>
- * <tr>
- * <td><code>MONTH + 1</code></td>
- * <td>{@link XMLGregorianCalendar#setMonth(int month)}</td>
- * </tr>
- * <tr>
- * <td><code>DAY_OF_MONTH</code></td>
- * <td>{@link XMLGregorianCalendar#setDay(int day)}</td>
- * </tr>
- * <tr>
- * <td><code>HOUR_OF_DAY, MINUTE, SECOND, MILLISECOND</code></td>
- * <td>{@link XMLGregorianCalendar#setTime(int hour, int minute, int second, BigDecimal fractional)}</td>
- * </tr>
- * <tr>
- * <td>
- * <code>(ZONE_OFFSET + DST_OFFSET) / (60*1000)</code><br/>
- * <em>(in minutes)</em>
- * </td>
- * <td>{@link XMLGregorianCalendar#setTimezone(int offset)}<sup><em>*</em></sup>
- * </td>
- * </tr>
- * </tbody>
- * </table>
- * <p><em>*</em>conversion loss of information. It is not possible to represent
- * a <code>java.util.GregorianCalendar</code> daylight savings timezone id in the
- * XML Schema 1.0 date/time datatype representation.</p>
- *
- * <p>To compute the return value's <code>TimeZone</code> field,
- * <ul>
- * <li>when <code>this.getTimezone() != FIELD_UNDEFINED</code>,
- * create a <code>java.util.TimeZone</code> with a custom timezone id
- * using the <code>this.getTimezone()</code>.</li>
- * <li>else use the <code>GregorianCalendar</code> default timezone value
- * for the host is defined as specified by
- * <code>java.util.TimeZone.getDefault()</code>.</li></p>
- *
- * @param cal <code>java.util.GregorianCalendar</code> used to create <code>XMLGregorianCalendar</code>
- *
- * @return <code>XMLGregorianCalendar</code> created from <code>java.util.GregorianCalendar</code>
- *
- * @throws NullPointerException If <code>cal</code> is <code>null</code>.
- */
- public abstract XMLGregorianCalendar newXMLGregorianCalendar(final GregorianCalendar cal);
-
- /**
- * <p>Constructor allowing for complete value spaces allowed by
- * W3C XML Schema 1.0 recommendation for xsd:dateTime and related
- * builtin datatypes. Note that <code>year</code> parameter supports
- * arbitrarily large numbers and fractionalSecond has infinite
- * precision.</p>
- *
- * <p>A <code>null</code> value indicates that field is not set.</p>
- *
- * @param year of <code>XMLGregorianCalendar</code> to be created.
- * @param month of <code>XMLGregorianCalendar</code> to be created.
- * @param day of <code>XMLGregorianCalendar</code> to be created.
- * @param hour of <code>XMLGregorianCalendar</code> to be created.
- * @param minute of <code>XMLGregorianCalendar</code> to be created.
- * @param second of <code>XMLGregorianCalendar</code> to be created.
- * @param fractionalSecond of <code>XMLGregorianCalendar</code> to be created.
- * @param timezone of <code>XMLGregorianCalendar</code> to be created.
- *
- * @return <code>XMLGregorianCalendar</code> created from specified values.
- *
- * @throws IllegalArgumentException If any individual parameter's value is outside the maximum value constraint for the field
- * as determined by the Date/Time Data Mapping table in {@link XMLGregorianCalendar}
- * or if the composite values constitute an invalid <code>XMLGregorianCalendar</code> instance
- * as determined by {@link XMLGregorianCalendar#isValid()}.
- */
- public abstract XMLGregorianCalendar newXMLGregorianCalendar(
- final BigInteger year,
- final int month,
- final int day,
- final int hour,
- final int minute,
- final int second,
- final BigDecimal fractionalSecond,
- final int timezone);
-
- /**
- * <p>Constructor of value spaces that a
- * <code>java.util.GregorianCalendar</code> instance would need to convert to an
- * <code>XMLGregorianCalendar</code> instance.</p>
- *
- * <p><code>XMLGregorianCalendar eon</code> and
- * <code>fractionalSecond</code> are set to <code>null</code></p>
- *
- * <p>A {@link DatatypeConstants#FIELD_UNDEFINED} value indicates that field is not set.</p>
- *
- * @param year of <code>XMLGregorianCalendar</code> to be created.
- * @param month of <code>XMLGregorianCalendar</code> to be created.
- * @param day of <code>XMLGregorianCalendar</code> to be created.
- * @param hour of <code>XMLGregorianCalendar</code> to be created.
- * @param minute of <code>XMLGregorianCalendar</code> to be created.
- * @param second of <code>XMLGregorianCalendar</code> to be created.
- * @param millisecond of <code>XMLGregorianCalendar</code> to be created.
- * @param timezone of <code>XMLGregorianCalendar</code> to be created.
- *
- * @return <code>XMLGregorianCalendar</code> created from specified values.
- *
- * @throws IllegalArgumentException If any individual parameter's value is outside the maximum value constraint for the field
- * as determined by the Date/Time Data Mapping table in {@link XMLGregorianCalendar}
- * or if the composite values constitute an invalid <code>XMLGregorianCalendar</code> instance
- * as determined by {@link XMLGregorianCalendar#isValid()}.
- */
- public XMLGregorianCalendar newXMLGregorianCalendar(
- final int year,
- final int month,
- final int day,
- final int hour,
- final int minute,
- final int second,
- final int millisecond,
- final int timezone) {
-
- // year may be undefined
- BigInteger realYear = (year != DatatypeConstants.FIELD_UNDEFINED) ? BigInteger.valueOf((long) year) : null;
-
- // millisecond may be undefined
- // millisecond must be >= 0 millisecond <= 1000
- BigDecimal realMillisecond = null; // undefined value
- if (millisecond != DatatypeConstants.FIELD_UNDEFINED) {
- if (millisecond < 0 || millisecond > 1000) {
- throw new IllegalArgumentException(
- "javax.xml.datatype.DatatypeFactory#newXMLGregorianCalendar("
- + "int year, int month, int day, int hour, int minute, int second, int millisecond, int timezone)"
- + "with invalid millisecond: " + millisecond
- );
- }
-
- realMillisecond = BigDecimal.valueOf((long) millisecond).movePointLeft(3);
- }
-
- return newXMLGregorianCalendar(
- realYear,
- month,
- day,
- hour,
- minute,
- second,
- realMillisecond,
- timezone
- );
- }
-
- /**
- * <p>Create a Java representation of XML Schema builtin datatype <code>date</code> or <code>g*</code>.</p>
- *
- * <p>For example, an instance of <code>gYear</code> can be created invoking this factory
- * with <code>month</code> and <code>day</code> parameters set to
- * {@link DatatypeConstants#FIELD_UNDEFINED}.</p>
- *
- * <p>A {@link DatatypeConstants#FIELD_UNDEFINED} value indicates that field is not set.</p>
- *
- * @param year of <code>XMLGregorianCalendar</code> to be created.
- * @param month of <code>XMLGregorianCalendar</code> to be created.
- * @param day of <code>XMLGregorianCalendar</code> to be created.
- * @param timezone offset in minutes. {@link DatatypeConstants#FIELD_UNDEFINED} indicates optional field is not set.
- *
- * @return <code>XMLGregorianCalendar</code> created from parameter values.
- *
- * @see DatatypeConstants#FIELD_UNDEFINED
- *
- * @throws IllegalArgumentException If any individual parameter's value is outside the maximum value constraint for the field
- * as determined by the Date/Time Data Mapping table in {@link XMLGregorianCalendar}
- * or if the composite values constitute an invalid <code>XMLGregorianCalendar</code> instance
- * as determined by {@link XMLGregorianCalendar#isValid()}.
- */
- public XMLGregorianCalendar newXMLGregorianCalendarDate(
- final int year,
- final int month,
- final int day,
- final int timezone) {
-
- return newXMLGregorianCalendar(
- year,
- month,
- day,
- DatatypeConstants.FIELD_UNDEFINED, // hour
- DatatypeConstants.FIELD_UNDEFINED, // minute
- DatatypeConstants.FIELD_UNDEFINED, // second
- DatatypeConstants.FIELD_UNDEFINED, // millisecond
- timezone);
- }
-
- /**
- * <p>Create a Java instance of XML Schema builtin datatype <code>time</code>.</p>
- *
- * <p>A {@link DatatypeConstants#FIELD_UNDEFINED} value indicates that field is not set.</p>
- *
- * @param hours number of hours
- * @param minutes number of minutes
- * @param seconds number of seconds
- * @param timezone offset in minutes. {@link DatatypeConstants#FIELD_UNDEFINED} indicates optional field is not set.
- *
- * @return <code>XMLGregorianCalendar</code> created from parameter values.
- *
- * @throws IllegalArgumentException If any individual parameter's value is outside the maximum value constraint for the field
- * as determined by the Date/Time Data Mapping table in {@link XMLGregorianCalendar}
- * or if the composite values constitute an invalid <code>XMLGregorianCalendar</code> instance
- * as determined by {@link XMLGregorianCalendar#isValid()}.
- *
- * @see DatatypeConstants#FIELD_UNDEFINED
- */
- public XMLGregorianCalendar newXMLGregorianCalendarTime(
- final int hours,
- final int minutes,
- final int seconds,
- final int timezone) {
-
- return newXMLGregorianCalendar(
- DatatypeConstants.FIELD_UNDEFINED, // Year
- DatatypeConstants.FIELD_UNDEFINED, // Month
- DatatypeConstants.FIELD_UNDEFINED, // Day
- hours,
- minutes,
- seconds,
- DatatypeConstants.FIELD_UNDEFINED, //Millisecond
- timezone);
- }
-
- /**
- * <p>Create a Java instance of XML Schema builtin datatype time.</p>
- *
- * <p>A <code>null</code> value indicates that field is not set.</p>
- * <p>A {@link DatatypeConstants#FIELD_UNDEFINED} value indicates that field is not set.</p>
- *
- * @param hours number of hours
- * @param minutes number of minutes
- * @param seconds number of seconds
- * @param fractionalSecond value of <code>null</code> indicates that this optional field is not set.
- * @param timezone offset in minutes. {@link DatatypeConstants#FIELD_UNDEFINED} indicates optional field is not set.
- *
- * @return <code>XMLGregorianCalendar</code> created from parameter values.
- *
- * @see DatatypeConstants#FIELD_UNDEFINED
- *
- * @throws IllegalArgumentException If any individual parameter's value is outside the maximum value constraint for the field
- * as determined by the Date/Time Data Mapping table in {@link XMLGregorianCalendar}
- * or if the composite values constitute an invalid <code>XMLGregorianCalendar</code> instance
- * as determined by {@link XMLGregorianCalendar#isValid()}.
- */
- public XMLGregorianCalendar newXMLGregorianCalendarTime(
- final int hours,
- final int minutes,
- final int seconds,
- final BigDecimal fractionalSecond,
- final int timezone) {
-
- return newXMLGregorianCalendar(
- null, // year
- DatatypeConstants.FIELD_UNDEFINED, // month
- DatatypeConstants.FIELD_UNDEFINED, // day
- hours,
- minutes,
- seconds,
- fractionalSecond,
- timezone);
- }
-
- /**
- * <p>Create a Java instance of XML Schema builtin datatype time.</p>
- *
- * <p>A {@link DatatypeConstants#FIELD_UNDEFINED} value indicates that field is not set.</p>
- *
- * @param hours number of hours
- * @param minutes number of minutes
- * @param seconds number of seconds
- * @param milliseconds number of milliseconds
- * @param timezone offset in minutes. {@link DatatypeConstants#FIELD_UNDEFINED} indicates optional field is not set.
- *
- * @return <code>XMLGregorianCalendar</code> created from parameter values.
- *
- * @see DatatypeConstants#FIELD_UNDEFINED
- *
- * @throws IllegalArgumentException If any individual parameter's value is outside the maximum value constraint for the field
- * as determined by the Date/Time Data Mapping table in {@link XMLGregorianCalendar}
- * or if the composite values constitute an invalid <code>XMLGregorianCalendar</code> instance
- * as determined by {@link XMLGregorianCalendar#isValid()}.
- */
- public XMLGregorianCalendar newXMLGregorianCalendarTime(
- final int hours,
- final int minutes,
- final int seconds,
- final int milliseconds,
- final int timezone) {
-
- // millisecond may be undefined
- // millisecond must be >= 0 millisecond <= 1000
- BigDecimal realMilliseconds = null; // undefined value
- if (milliseconds != DatatypeConstants.FIELD_UNDEFINED) {
- if (milliseconds < 0 || milliseconds > 1000) {
- throw new IllegalArgumentException(
- "javax.xml.datatype.DatatypeFactory#newXMLGregorianCalendarTime("
- + "int hours, int minutes, int seconds, int milliseconds, int timezone)"
- + "with invalid milliseconds: " + milliseconds
- );
- }
-
- realMilliseconds = BigDecimal.valueOf((long) milliseconds).movePointLeft(3);
- }
-
- return newXMLGregorianCalendarTime(
- hours,
- minutes,
- seconds,
- realMilliseconds,
- timezone
- );
- }
-}
diff --git a/src/javax/xml/datatype/Duration.java b/src/javax/xml/datatype/Duration.java
deleted file mode 100644
index 350f4af..0000000
--- a/src/javax/xml/datatype/Duration.java
+++ /dev/null
@@ -1,988 +0,0 @@
-/*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.datatype;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.GregorianCalendar;
-
-import javax.xml.namespace.QName;
-
-/**
- * <p>Immutable representation of a time span as defined in
- * the W3C XML Schema 1.0 specification.</p>
- *
- * <p>A Duration object represents a period of Gregorian time,
- * which consists of six fields (years, months, days, hours,
- * minutes, and seconds) plus a sign (+/-) field.</p>
- *
- * <p>The first five fields have non-negative (>=0) integers or null
- * (which represents that the field is not set),
- * and the seconds field has a non-negative decimal or null.
- * A negative sign indicates a negative duration.</p>
- *
- * <p>This class provides a number of methods that make it easy
- * to use for the duration datatype of XML Schema 1.0 with
- * the errata.</p>
- *
- * <h2>Order relationship</h2>
- * <p>Duration objects only have partial order, where two values A and B
- * maybe either:</p>
- * <ol>
- * <li>A&lt;B (A is shorter than B)
- * <li>A&gt;B (A is longer than B)
- * <li>A==B (A and B are of the same duration)
- * <li>A&lt;>B (Comparison between A and B is indeterminate)
- * </ol>
- *
- * <p>For example, 30 days cannot be meaningfully compared to one month.
- * The {@link #compare(Duration duration)} method implements this
- * relationship.</p>
- *
- * <p>See the {@link #isLongerThan(Duration)} method for details about
- * the order relationship among <code>Duration</code> objects.</p>
- *
- * <h2>Operations over Duration</h2>
- * <p>This class provides a set of basic arithmetic operations, such
- * as addition, subtraction and multiplication.
- * Because durations don't have total order, an operation could
- * fail for some combinations of operations. For example, you cannot
- * subtract 15 days from 1 month. See the javadoc of those methods
- * for detailed conditions where this could happen.</p>
- *
- * <p>Also, division of a duration by a number is not provided because
- * the <code>Duration</code> class can only deal with finite precision
- * decimal numbers. For example, one cannot represent 1 sec divided by 3.</p>
- *
- * <p>However, you could substitute a division by 3 with multiplying
- * by numbers such as 0.3 or 0.333.</p>
- *
- * <h2>Range of allowed values</h2>
- * <p>
- * Because some operations of <code>Duration</code> rely on {@link Calendar}
- * even though {@link Duration} can hold very large or very small values,
- * some of the methods may not work correctly on such <code>Duration</code>s.
- * The impacted methods document their dependency on {@link Calendar}.
- *
- * @author <a href="mailto:Joseph.Fialli@Sun.COM">Joseph Fialli</a>
- * @author <a href="mailto:Kohsuke.Kawaguchi@Sun.com">Kohsuke Kawaguchi</a>
- * @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a>
- * @author <a href="mailto:Sunitha.Reddy@Sun.com">Sunitha Reddy</a>
- * @see XMLGregorianCalendar#add(Duration)
- * @since 1.5
- */
-public abstract class Duration {
-
- /**
- * <p>Debugging <code>true</code> or <code>false</code>.</p>
- */
- private static final boolean DEBUG = true;
-
- /**
- * Default no-arg constructor.
- *
- * <p>Note: Always use the {@link DatatypeFactory} to
- * construct an instance of <code>Duration</code>.
- * The constructor on this class cannot be guaranteed to
- * produce an object with a consistent state and may be
- * removed in the future.</p>
- */
- public Duration() {
- }
-
- /**
- * <p>Return the name of the XML Schema date/time type that this instance
- * maps to. Type is computed based on fields that are set,
- * i.e. {@link #isSet(DatatypeConstants.Field field)} == <code>true</code>.</p>
- *
- * <table border="2" rules="all" cellpadding="2">
- * <thead>
- * <tr>
- * <th align="center" colspan="7">
- * Required fields for XML Schema 1.0 Date/Time Datatypes.<br/>
- * <i>(timezone is optional for all date/time datatypes)</i>
- * </th>
- * </tr>
- * </thead>
- * <tbody>
- * <tr>
- * <td>Datatype</td>
- * <td>year</td>
- * <td>month</td>
- * <td>day</td>
- * <td>hour</td>
- * <td>minute</td>
- * <td>second</td>
- * </tr>
- * <tr>
- * <td>{@link DatatypeConstants#DURATION}</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * </tr>
- * <tr>
- * <td>{@link DatatypeConstants#DURATION_DAYTIME}</td>
- * <td></td>
- * <td></td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * </tr>
- * <tr>
- * <td>{@link DatatypeConstants#DURATION_YEARMONTH}</td>
- * <td>X</td>
- * <td>X</td>
- * <td></td>
- * <td></td>
- * <td></td>
- * <td></td>
- * </tr>
- * </tbody>
- * </table>
- *
- * @return one of the following constants:
- * {@link DatatypeConstants#DURATION},
- * {@link DatatypeConstants#DURATION_DAYTIME} or
- * {@link DatatypeConstants#DURATION_YEARMONTH}.
- *
- * @throws IllegalStateException If the combination of set fields does not match one of the XML Schema date/time datatypes.
- */
- public QName getXMLSchemaType() {
-
- boolean yearSet = isSet(DatatypeConstants.YEARS);
- boolean monthSet = isSet(DatatypeConstants.MONTHS);
- boolean daySet = isSet(DatatypeConstants.DAYS);
- boolean hourSet = isSet(DatatypeConstants.HOURS);
- boolean minuteSet = isSet(DatatypeConstants.MINUTES);
- boolean secondSet = isSet(DatatypeConstants.SECONDS);
-
- // DURATION
- if (yearSet
- && monthSet
- && daySet
- && hourSet
- && minuteSet
- && secondSet) {
- return DatatypeConstants.DURATION;
- }
-
- // DURATION_DAYTIME
- if (!yearSet
- && !monthSet
- && daySet
- && hourSet
- && minuteSet
- && secondSet) {
- return DatatypeConstants.DURATION_DAYTIME;
- }
-
- // DURATION_YEARMONTH
- if (yearSet
- && monthSet
- && !daySet
- && !hourSet
- && !minuteSet
- && !secondSet) {
- return DatatypeConstants.DURATION_YEARMONTH;
- }
-
- // nothing matches
- throw new IllegalStateException(
- "javax.xml.datatype.Duration#getXMLSchemaType():"
- + " this Duration does not match one of the XML Schema date/time datatypes:"
- + " year set = " + yearSet
- + " month set = " + monthSet
- + " day set = " + daySet
- + " hour set = " + hourSet
- + " minute set = " + minuteSet
- + " second set = " + secondSet
- );
- }
-
- /**
- * Returns the sign of this duration in -1,0, or 1.
- *
- * @return
- * -1 if this duration is negative, 0 if the duration is zero,
- * and 1 if the duration is positive.
- */
- public abstract int getSign();
-
- /**
- * <p>Get the years value of this <code>Duration</code> as an <code>int</code> or <code>0</code> if not present.</p>
- *
- * <p><code>getYears()</code> is a convenience method for
- * {@link #getField(DatatypeConstants.Field field) getField(DatatypeConstants.YEARS)}.</p>
- *
- * <p>As the return value is an <code>int</code>, an incorrect value will be returned for <code>Duration</code>s
- * with years that go beyond the range of an <code>int</code>.
- * Use {@link #getField(DatatypeConstants.Field field) getField(DatatypeConstants.YEARS)} to avoid possible loss of precision.</p>
- *
- * @return If the years field is present, return its value as an <code>int</code>, else return <code>0</code>.
- */
- public int getYears() {
- return getField(DatatypeConstants.YEARS).intValue();
- }
-
- /**
- * Obtains the value of the MONTHS field as an integer value,
- * or 0 if not present.
- *
- * This method works just like {@link #getYears()} except
- * that this method works on the MONTHS field.
- *
- * @return Months of this <code>Duration</code>.
- */
- public int getMonths() {
- return getField(DatatypeConstants.MONTHS).intValue();
- }
-
- /**
- * Obtains the value of the DAYS field as an integer value,
- * or 0 if not present.
- *
- * This method works just like {@link #getYears()} except
- * that this method works on the DAYS field.
- *
- * @return Days of this <code>Duration</code>.
- */
- public int getDays() {
- return getField(DatatypeConstants.DAYS).intValue();
- }
-
- /**
- * Obtains the value of the HOURS field as an integer value,
- * or 0 if not present.
- *
- * This method works just like {@link #getYears()} except
- * that this method works on the HOURS field.
- *
- * @return Hours of this <code>Duration</code>.
- *
- */
- public int getHours() {
- return getField(DatatypeConstants.HOURS).intValue();
- }
-
- /**
- * Obtains the value of the MINUTES field as an integer value,
- * or 0 if not present.
- *
- * This method works just like {@link #getYears()} except
- * that this method works on the MINUTES field.
- *
- * @return Minutes of this <code>Duration</code>.
- *
- */
- public int getMinutes() {
- return getField(DatatypeConstants.MINUTES).intValue();
- }
-
- /**
- * Obtains the value of the SECONDS field as an integer value,
- * or 0 if not present.
- *
- * This method works just like {@link #getYears()} except
- * that this method works on the SECONDS field.
- *
- * @return seconds in the integer value. The fraction of seconds
- * will be discarded (for example, if the actual value is 2.5,
- * this method returns 2)
- */
- public int getSeconds() {
- return getField(DatatypeConstants.SECONDS).intValue();
- }
-
- /**
- * <p>Returns the length of the duration in milli-seconds.</p>
- *
- * <p>If the seconds field carries more digits than milli-second order,
- * those will be simply discarded (or in other words, rounded to zero.)
- * For example, for any Calendar value <code>x</code>,</p>
- * <pre>
- * <code>new Duration("PT10.00099S").getTimeInMills(x) == 10000</code>.
- * <code>new Duration("-PT10.00099S").getTimeInMills(x) == -10000</code>.
- * </pre>
- *
- * <p>
- * Note that this method uses the {@link #addTo(Calendar)} method,
- * which may work incorrectly with <code>Duration</code> objects with
- * very large values in its fields. See the {@link #addTo(Calendar)}
- * method for details.
- *
- * @param startInstant
- * The length of a month/year varies. The <code>startInstant</code> is
- * used to disambiguate this variance. Specifically, this method
- * returns the difference between <code>startInstant</code> and
- * <code>startInstant+duration</code>
- *
- * @return milliseconds between <code>startInstant</code> and
- * <code>startInstant</code> plus this <code>Duration</code>
- *
- * @throws NullPointerException if <code>startInstant</code> parameter
- * is null.
- *
- */
- public long getTimeInMillis(final Calendar startInstant) {
- Calendar cal = (Calendar) startInstant.clone();
- addTo(cal);
- return getCalendarTimeInMillis(cal)
- - getCalendarTimeInMillis(startInstant);
- }
-
- /**
- * <p>Returns the length of the duration in milli-seconds.</p>
- *
- * <p>If the seconds field carries more digits than milli-second order,
- * those will be simply discarded (or in other words, rounded to zero.)
- * For example, for any <code>Date</code> value <code>x</code>,</p>
- * <pre>
- * <code>new Duration("PT10.00099S").getTimeInMills(x) == 10000</code>.
- * <code>new Duration("-PT10.00099S").getTimeInMills(x) == -10000</code>.
- * </pre>
- *
- * <p>
- * Note that this method uses the {@link #addTo(Date)} method,
- * which may work incorrectly with <code>Duration</code> objects with
- * very large values in its fields. See the {@link #addTo(Date)}
- * method for details.
- *
- * @param startInstant
- * The length of a month/year varies. The <code>startInstant</code> is
- * used to disambiguate this variance. Specifically, this method
- * returns the difference between <code>startInstant</code> and
- * <code>startInstant+duration</code>.
- *
- * @throws NullPointerException
- * If the startInstant parameter is null.
- *
- * @return milliseconds between <code>startInstant</code> and
- * <code>startInstant</code> plus this <code>Duration</code>
- *
- * @see #getTimeInMillis(Calendar)
- */
- public long getTimeInMillis(final Date startInstant) {
- Calendar cal = new GregorianCalendar();
- cal.setTime(startInstant);
- this.addTo(cal);
- return getCalendarTimeInMillis(cal) - startInstant.getTime();
- }
-
- /**
- * Gets the value of a field.
- *
- * Fields of a duration object may contain arbitrary large value.
- * Therefore this method is designed to return a {@link Number} object.
- *
- * In case of YEARS, MONTHS, DAYS, HOURS, and MINUTES, the returned
- * number will be a non-negative integer. In case of seconds,
- * the returned number may be a non-negative decimal value.
- *
- * @param field
- * one of the six Field constants (YEARS,MONTHS,DAYS,HOURS,
- * MINUTES, or SECONDS.)
- * @return
- * If the specified field is present, this method returns
- * a non-null non-negative {@link Number} object that
- * represents its value. If it is not present, return null.
- * For YEARS, MONTHS, DAYS, HOURS, and MINUTES, this method
- * returns a {@link java.math.BigInteger} object. For SECONDS, this
- * method returns a {@link java.math.BigDecimal}.
- *
- * @throws NullPointerException If the <code>field</code> is <code>null</code>.
- */
- public abstract Number getField(final DatatypeConstants.Field field);
-
- /**
- * Checks if a field is set.
- *
- * A field of a duration object may or may not be present.
- * This method can be used to test if a field is present.
- *
- * @param field
- * one of the six Field constants (YEARS,MONTHS,DAYS,HOURS,
- * MINUTES, or SECONDS.)
- * @return
- * true if the field is present. false if not.
- *
- * @throws NullPointerException
- * If the field parameter is null.
- */
- public abstract boolean isSet(final DatatypeConstants.Field field);
-
- /**
- * <p>Computes a new duration whose value is <code>this+rhs</code>.</p>
- *
- * <p>For example,</p>
- * <pre>
- * "1 day" + "-3 days" = "-2 days"
- * "1 year" + "1 day" = "1 year and 1 day"
- * "-(1 hour,50 minutes)" + "-20 minutes" = "-(1 hours,70 minutes)"
- * "15 hours" + "-3 days" = "-(2 days,9 hours)"
- * "1 year" + "-1 day" = IllegalStateException
- * </pre>
- *
- * <p>Since there's no way to meaningfully subtract 1 day from 1 month,
- * there are cases where the operation fails in
- * {@link IllegalStateException}.</p>
- *
- * <p>
- * Formally, the computation is defined as follows.</p>
- * <p>
- * Firstly, we can assume that two <code>Duration</code>s to be added
- * are both positive without losing generality (i.e.,
- * <code>(-X)+Y=Y-X</code>, <code>X+(-Y)=X-Y</code>,
- * <code>(-X)+(-Y)=-(X+Y)</code>)
- *
- * <p>
- * Addition of two positive <code>Duration</code>s are simply defined as
- * field by field addition where missing fields are treated as 0.
- * <p>
- * A field of the resulting <code>Duration</code> will be unset if and
- * only if respective fields of two input <code>Duration</code>s are unset.
- * <p>
- * Note that <code>lhs.add(rhs)</code> will be always successful if
- * <code>lhs.signum()*rhs.signum()!=-1</code> or both of them are
- * normalized.</p>
- *
- * @param rhs <code>Duration</code> to add to this <code>Duration</code>
- *
- * @return
- * non-null valid Duration object.
- *
- * @throws NullPointerException
- * If the rhs parameter is null.
- * @throws IllegalStateException
- * If two durations cannot be meaningfully added. For
- * example, adding negative one day to one month causes
- * this exception.
- *
- *
- * @see #subtract(Duration)
- */
- public abstract Duration add(final Duration rhs);
-
- /**
- * Adds this duration to a {@link Calendar} object.
- *
- * <p>
- * Calls {@link java.util.Calendar#add(int,int)} in the
- * order of YEARS, MONTHS, DAYS, HOURS, MINUTES, SECONDS, and MILLISECONDS
- * if those fields are present. Because the {@link Calendar} class
- * uses int to hold values, there are cases where this method
- * won't work correctly (for example if values of fields
- * exceed the range of int.)
- * </p>
- *
- * <p>
- * Also, since this duration class is a Gregorian duration, this
- * method will not work correctly if the given {@link Calendar}
- * object is based on some other calendar systems.
- * </p>
- *
- * <p>
- * Any fractional parts of this <code>Duration</code> object
- * beyond milliseconds will be simply ignored. For example, if
- * this duration is "P1.23456S", then 1 is added to SECONDS,
- * 234 is added to MILLISECONDS, and the rest will be unused.
- * </p>
- *
- * <p>
- * Note that because {@link Calendar#add(int, int)} is using
- * <code>int</code>, <code>Duration</code> with values beyond the
- * range of <code>int</code> in its fields
- * will cause overflow/underflow to the given {@link Calendar}.
- * {@link XMLGregorianCalendar#add(Duration)} provides the same
- * basic operation as this method while avoiding
- * the overflow/underflow issues.
- *
- * @param calendar
- * A calendar object whose value will be modified.
- * @throws NullPointerException
- * if the calendar parameter is null.
- */
- public abstract void addTo(Calendar calendar);
-
- /**
- * Adds this duration to a {@link Date} object.
- *
- * <p>
- * The given date is first converted into
- * a {@link java.util.GregorianCalendar}, then the duration
- * is added exactly like the {@link #addTo(Calendar)} method.
- *
- * <p>
- * The updated time instant is then converted back into a
- * {@link Date} object and used to update the given {@link Date} object.
- *
- * <p>
- * This somewhat redundant computation is necessary to unambiguously
- * determine the duration of months and years.
- *
- * @param date
- * A date object whose value will be modified.
- * @throws NullPointerException
- * if the date parameter is null.
- */
- public void addTo(Date date) {
-
- // check data parameter
- if (date == null) {
- throw new NullPointerException(
- "Cannot call "
- + this.getClass().getName()
- + "#addTo(Date date) with date == null."
- );
- }
-
- Calendar cal = new GregorianCalendar();
- cal.setTime(date);
- this.addTo(cal);
- date.setTime(getCalendarTimeInMillis(cal));
- }
-
- /**
- * <p>Computes a new duration whose value is <code>this-rhs</code>.</p>
- *
- * <p>For example:</p>
- * <pre>
- * "1 day" - "-3 days" = "4 days"
- * "1 year" - "1 day" = IllegalStateException
- * "-(1 hour,50 minutes)" - "-20 minutes" = "-(1hours,30 minutes)"
- * "15 hours" - "-3 days" = "3 days and 15 hours"
- * "1 year" - "-1 day" = "1 year and 1 day"
- * </pre>
- *
- * <p>Since there's no way to meaningfully subtract 1 day from 1 month,
- * there are cases where the operation fails in {@link IllegalStateException}.</p>
- *
- * <p>Formally the computation is defined as follows.
- * First, we can assume that two <code>Duration</code>s are both positive
- * without losing generality. (i.e.,
- * <code>(-X)-Y=-(X+Y)</code>, <code>X-(-Y)=X+Y</code>,
- * <code>(-X)-(-Y)=-(X-Y)</code>)</p>
- *
- * <p>Then two durations are subtracted field by field.
- * If the sign of any non-zero field <code>F</code> is different from
- * the sign of the most significant field,
- * 1 (if <code>F</code> is negative) or -1 (otherwise)
- * will be borrowed from the next bigger unit of <code>F</code>.</p>
- *
- * <p>This process is repeated until all the non-zero fields have
- * the same sign.</p>
- *
- * <p>If a borrow occurs in the days field (in other words, if
- * the computation needs to borrow 1 or -1 month to compensate
- * days), then the computation fails by throwing an
- * {@link IllegalStateException}.</p>
- *
- * @param rhs <code>Duration</code> to subtract from this <code>Duration</code>.
- *
- * @return New <code>Duration</code> created from subtracting <code>rhs</code> from this <code>Duration</code>.
- *
- * @throws IllegalStateException
- * If two durations cannot be meaningfully subtracted. For
- * example, subtracting one day from one month causes
- * this exception.
- *
- * @throws NullPointerException
- * If the rhs parameter is null.
- *
- * @see #add(Duration)
- */
- public Duration subtract(final Duration rhs) {
- return add(rhs.negate());
- }
-
- /**
- * <p>Computes a new duration whose value is <code>factor</code> times
- * longer than the value of this duration.</p>
- *
- * <p>This method is provided for the convenience.
- * It is functionally equivalent to the following code:</p>
- * <pre>
- * multiply(new BigDecimal(String.valueOf(factor)))
- * </pre>
- *
- * @param factor Factor times longer of new <code>Duration</code> to create.
- *
- * @return New <code>Duration</code> that is <code>factor</code>times longer than this <code>Duration</code>.
- *
- * @see #multiply(BigDecimal)
- */
- public Duration multiply(int factor) {
- return multiply(new BigDecimal(String.valueOf(factor)));
- }
-
- /**
- * Computes a new duration whose value is <code>factor</code> times
- * longer than the value of this duration.
- *
- * <p>
- * For example,
- * <pre>
- * "P1M" (1 month) * "12" = "P12M" (12 months)
- * "PT1M" (1 min) * "0.3" = "PT18S" (18 seconds)
- * "P1M" (1 month) * "1.5" = IllegalStateException
- * </pre>
- *
- * <p>
- * Since the <code>Duration</code> class is immutable, this method
- * doesn't change the value of this object. It simply computes
- * a new Duration object and returns it.
- *
- * <p>
- * The operation will be performed field by field with the precision
- * of {@link BigDecimal}. Since all the fields except seconds are
- * restricted to hold integers,
- * any fraction produced by the computation will be
- * carried down toward the next lower unit. For example,
- * if you multiply "P1D" (1 day) with "0.5", then it will be 0.5 day,
- * which will be carried down to "PT12H" (12 hours).
- * When fractions of month cannot be meaningfully carried down
- * to days, or year to months, this will cause an
- * {@link IllegalStateException} to be thrown.
- * For example if you multiple one month by 0.5.</p>
- *
- * <p>
- * To avoid {@link IllegalStateException}, use
- * the {@link #normalizeWith(Calendar)} method to remove the years
- * and months fields.
- *
- * @param factor to multiply by
- *
- * @return
- * returns a non-null valid <code>Duration</code> object
- *
- * @throws IllegalStateException if operation produces fraction in
- * the months field.
- *
- * @throws NullPointerException if the <code>factor</code> parameter is
- * <code>null</code>.
- *
- */
- public abstract Duration multiply(final BigDecimal factor);
-
- /**
- * Returns a new <code>Duration</code> object whose
- * value is <code>-this</code>.
- *
- * <p>
- * Since the <code>Duration</code> class is immutable, this method
- * doesn't change the value of this object. It simply computes
- * a new Duration object and returns it.
- *
- * @return
- * always return a non-null valid <code>Duration</code> object.
- */
- public abstract Duration negate();
-
- /**
- * <p>Converts the years and months fields into the days field
- * by using a specific time instant as the reference point.</p>
- *
- * <p>For example, duration of one month normalizes to 31 days
- * given the start time instance "July 8th 2003, 17:40:32".</p>
- *
- * <p>Formally, the computation is done as follows:</p>
- * <ol>
- * <li>the given Calendar object is cloned</li>
- * <li>the years, months and days fields will be added to the {@link Calendar} object
- * by using the {@link Calendar#add(int,int)} method</li>
- * <li>the difference between the two Calendars in computed in milliseconds and converted to days,
- * if a remainder occurs due to Daylight Savings Time, it is discarded</li>
- * <li>the computed days, along with the hours, minutes and seconds
- * fields of this duration object is used to construct a new
- * Duration object.</li>
- * </ol>
- *
- * <p>Note that since the Calendar class uses <code>int</code> to
- * hold the value of year and month, this method may produce
- * an unexpected result if this duration object holds
- * a very large value in the years or months fields.</p>
- *
- * @param startTimeInstant <code>Calendar</code> reference point.
- *
- * @return <code>Duration</code> of years and months of this <code>Duration</code> as days.
- *
- * @throws NullPointerException If the startTimeInstant parameter is null.
- */
- public abstract Duration normalizeWith(final Calendar startTimeInstant);
-
- /**
- * <p>Partial order relation comparison with this <code>Duration</code> instance.</p>
- *
- * <p>Comparison result must be in accordance with
- * <a href="http://www.w3.org/TR/xmlschema-2/#duration-order">W3C XML Schema 1.0 Part 2, Section 3.2.7.6.2,
- * <i>Order relation on duration</i></a>.</p>
- *
- * <p>Return:</p>
- * <ul>
- * <li>{@link DatatypeConstants#LESSER} if this <code>Duration</code> is shorter than <code>duration</code> parameter</li>
- * <li>{@link DatatypeConstants#EQUAL} if this <code>Duration</code> is equal to <code>duration</code> parameter</li>
- * <li>{@link DatatypeConstants#GREATER} if this <code>Duration</code> is longer than <code>duration</code> parameter</li>
- * <li>{@link DatatypeConstants#INDETERMINATE} if a conclusive partial order relation cannot be determined</li>
- * </ul>
- *
- * @param duration to compare
- *
- * @return the relationship between <code>this</code> <code>Duration</code>and <code>duration</code> parameter as
- * {@link DatatypeConstants#LESSER}, {@link DatatypeConstants#EQUAL}, {@link DatatypeConstants#GREATER}
- * or {@link DatatypeConstants#INDETERMINATE}.
- *
- * @throws UnsupportedOperationException If the underlying implementation
- * cannot reasonably process the request, e.g. W3C XML Schema allows for
- * arbitrarily large/small/precise values, the request may be beyond the
- * implementations capability.
- * @throws NullPointerException if <code>duration</code> is <code>null</code>.
- *
- * @see #isShorterThan(Duration)
- * @see #isLongerThan(Duration)
- */
- public abstract int compare(final Duration duration);
-
- /**
- * <p>Checks if this duration object is strictly longer than
- * another <code>Duration</code> object.</p>
- *
- * <p>Duration X is "longer" than Y if and only if X>Y
- * as defined in the section 3.2.6.2 of the XML Schema 1.0
- * specification.</p>
- *
- * <p>For example, "P1D" (one day) > "PT12H" (12 hours) and
- * "P2Y" (two years) > "P23M" (23 months).</p>
- *
- * @param duration <code>Duration</code> to test this <code>Duration</code> against.
- *
- * @throws UnsupportedOperationException If the underlying implementation
- * cannot reasonably process the request, e.g. W3C XML Schema allows for
- * arbitrarily large/small/precise values, the request may be beyond the
- * implementations capability.
- * @throws NullPointerException If <code>duration</code> is null.
- *
- * @return
- * true if the duration represented by this object
- * is longer than the given duration. false otherwise.
- *
- * @see #isShorterThan(Duration)
- * @see #compare(Duration duration)
- */
- public boolean isLongerThan(final Duration duration) {
- return compare(duration) == DatatypeConstants.GREATER;
- }
-
- /**
- * <p>Checks if this duration object is strictly shorter than
- * another <code>Duration</code> object.</p>
- *
- * @param duration <code>Duration</code> to test this <code>Duration</code> against.
- *
- * @return <code>true</code> if <code>duration</code> parameter is shorter than this <code>Duration</code>,
- * else <code>false</code>.
- *
- * @throws UnsupportedOperationException If the underlying implementation
- * cannot reasonably process the request, e.g. W3C XML Schema allows for
- * arbitrarily large/small/precise values, the request may be beyond the
- * implementations capability.
- * @throws NullPointerException if <code>duration</code> is null.
- *
- * @see #isLongerThan(Duration duration)
- * @see #compare(Duration duration)
- */
- public boolean isShorterThan(final Duration duration) {
- return compare(duration) == DatatypeConstants.LESSER;
- }
-
- /**
- * <p>Checks if this duration object has the same duration
- * as another <code>Duration</code> object.</p>
- *
- * <p>For example, "P1D" (1 day) is equal to "PT24H" (24 hours).</p>
- *
- * <p>Duration X is equal to Y if and only if time instant
- * t+X and t+Y are the same for all the test time instants
- * specified in the section 3.2.6.2 of the XML Schema 1.0
- * specification.</p>
- *
- * <p>Note that there are cases where two <code>Duration</code>s are
- * "incomparable" to each other, like one month and 30 days.
- * For example,</p>
- * <pre>
- * !new Duration("P1M").isShorterThan(new Duration("P30D"))
- * !new Duration("P1M").isLongerThan(new Duration("P30D"))
- * !new Duration("P1M").equals(new Duration("P30D"))
- * </pre>
- *
- * @param duration
- * The object to compare this <code>Duration</code> against.
- *
- * @return
- * <code>true</code> if this duration is the same length as
- * <code>duration</code>.
- * <code>false</code> if <code>duration</code> is <code>null</code>,
- * is not a
- * <code>Duration</code> object,
- * or its length is different from this duration.
- *
- * @throws UnsupportedOperationException If the underlying implementation
- * cannot reasonably process the request, e.g. W3C XML Schema allows for
- * arbitrarily large/small/precise values, the request may be beyond the
- * implementations capability.
- *
- * @see #compare(Duration duration)
- */
- public boolean equals(final Object duration) {
-
- if (duration == null || !(duration instanceof Duration)) {
- return false;
- }
-
- return compare((Duration) duration) == DatatypeConstants.EQUAL;
- }
-
- /**
- * Returns a hash code consistent with the definition of the equals method.
- *
- * @see Object#hashCode()
- */
- public abstract int hashCode();
-
- /**
- * <p>Returns a <code>String</code> representation of this <code>Duration</code> <code>Object</code>.</p>
- *
- * <p>The result is formatted according to the XML Schema 1.0 spec and can be always parsed back later into the
- * equivalent <code>Duration</code> <code>Object</code> by {@link DatatypeFactory#newDuration(String lexicalRepresentation)}.</p>
- *
- * <p>Formally, the following holds for any <code>Duration</code>
- * <code>Object</code> x:</p>
- * <pre>
- * new Duration(x.toString()).equals(x)
- * </pre>
- *
- * @return A non-<code>null</code> valid <code>String</code> representation of this <code>Duration</code>.
- */
- public String toString() {
-
- StringBuffer buf = new StringBuffer();
-
- if (getSign() < 0) {
- buf.append('-');
- }
- buf.append('P');
-
- BigInteger years = (BigInteger) getField(DatatypeConstants.YEARS);
- if (years != null) {
- buf.append(years + "Y");
- }
-
- BigInteger months = (BigInteger) getField(DatatypeConstants.MONTHS);
- if (months != null) {
- buf.append(months + "M");
- }
-
- BigInteger days = (BigInteger) getField(DatatypeConstants.DAYS);
- if (days != null) {
- buf.append(days + "D");
- }
-
- BigInteger hours = (BigInteger) getField(DatatypeConstants.HOURS);
- BigInteger minutes = (BigInteger) getField(DatatypeConstants.MINUTES);
- BigDecimal seconds = (BigDecimal) getField(DatatypeConstants.SECONDS);
- if (hours != null || minutes != null || seconds != null) {
- buf.append('T');
- if (hours != null) {
- buf.append(hours + "H");
- }
- if (minutes != null) {
- buf.append(minutes + "M");
- }
- if (seconds != null) {
- buf.append(toString(seconds) + "S");
- }
- }
-
- return buf.toString();
- }
-
- /**
- * <p>Turns {@link BigDecimal} to a string representation.</p>
- *
- * <p>Due to a behavior change in the {@link BigDecimal#toString()}
- * method in JDK1.5, this had to be implemented here.</p>
- *
- * @param bd <code>BigDecimal</code> to format as a <code>String</code>
- *
- * @return <code>String</code> representation of <code>BigDecimal</code>
- */
- private String toString(BigDecimal bd) {
- String intString = bd.unscaledValue().toString();
- int scale = bd.scale();
-
- if (scale == 0) {
- return intString;
- }
-
- /* Insert decimal point */
- StringBuffer buf;
- int insertionPoint = intString.length() - scale;
- if (insertionPoint == 0) { /* Point goes right before intVal */
- return "0." + intString;
- } else if (insertionPoint > 0) { /* Point goes inside intVal */
- buf = new StringBuffer(intString);
- buf.insert(insertionPoint, '.');
- } else { /* We must insert zeros between point and intVal */
- buf = new StringBuffer(3 - insertionPoint + intString.length());
- buf.append("0.");
- for (int i = 0; i < -insertionPoint; i++) {
- buf.append('0');
- }
- buf.append(intString);
- }
- return buf.toString();
- }
-
-
- /**
- * <p>Calls the {@link Calendar#getTimeInMillis} method.
- * Prior to JDK1.4, this method was protected and therefore
- * cannot be invoked directly.</p>
- *
- * <p>TODO: In future, this should be replaced by <code>cal.getTimeInMillis()</code>.</p>
- *
- * @param cal <code>Calendar</code> to get time in milliseconds.
- *
- * @return Milliseconds of <code>cal</code>.
- */
- private static long getCalendarTimeInMillis(final Calendar cal) {
- return cal.getTime().getTime();
- }
-}
diff --git a/src/javax/xml/datatype/FactoryFinder.java b/src/javax/xml/datatype/FactoryFinder.java
deleted file mode 100644
index ce98215..0000000
--- a/src/javax/xml/datatype/FactoryFinder.java
+++ /dev/null
@@ -1,311 +0,0 @@
-/*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.datatype;
-
-import java.io.File;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.Iterator;
-import java.util.Properties;
-import java.util.ServiceConfigurationError;
-import java.util.ServiceLoader;
-
-/**
- * <p>Implements pluggable Datatypes.</p>
- *
- * <p>This class is duplicated for each JAXP subpackage so keep it in
- * sync. It is package private for secure class loading.</p>
- *
- * @author Santiago.PericasGeertsen@sun.com
- */
-class FactoryFinder {
- private static final String DEFAULT_PACKAGE = "com.sun.org.apache.xerces.internal";
-
- /**
- * Internal debug flag.
- */
- private static boolean debug = false;
-
- /**
- * Cache for properties in java.home/lib/jaxp.properties
- */
- private final static Properties cacheProps = new Properties();
-
- /**
- * Flag indicating if properties from java.home/lib/jaxp.properties
- * have been cached.
- */
- private static volatile boolean firstTime = true;
-
- /**
- * Security support class use to check access control before
- * getting certain system resources.
- */
- private final static SecuritySupport ss = new SecuritySupport();
-
- // Define system property "jaxp.debug" to get output
- static {
- // Use try/catch block to support applets, which throws
- // SecurityException out of this code.
- try {
- String val = ss.getSystemProperty("jaxp.debug");
- // Allow simply setting the prop to turn on debug
- debug = val != null && !"false".equals(val);
- }
- catch (SecurityException se) {
- debug = false;
- }
- }
-
- private static void dPrint(String msg) {
- if (debug) {
- System.err.println("JAXP: " + msg);
- }
- }
-
- /**
- * Attempt to load a class using the class loader supplied. If that fails
- * and fall back is enabled, the current (i.e. bootstrap) class loader is
- * tried.
- *
- * If the class loader supplied is <code>null</code>, first try using the
- * context class loader followed by the current (i.e. bootstrap) class
- * loader.
- *
- * Use bootstrap classLoader if cl = null and useBSClsLoader is true
- */
- static private Class<?> getProviderClass(String className, ClassLoader cl,
- boolean doFallback, boolean useBSClsLoader) throws ClassNotFoundException
- {
- try {
- if (cl == null) {
- if (useBSClsLoader) {
- return Class.forName(className, false, FactoryFinder.class.getClassLoader());
- } else {
- cl = ss.getContextClassLoader();
- if (cl == null) {
- throw new ClassNotFoundException();
- }
- else {
- return Class.forName(className, false, cl);
- }
- }
- }
- else {
- return Class.forName(className, false, cl);
- }
- }
- catch (ClassNotFoundException e1) {
- if (doFallback) {
- // Use current class loader - should always be bootstrap CL
- return Class.forName(className, false, FactoryFinder.class.getClassLoader());
- }
- else {
- throw e1;
- }
- }
- }
-
- /**
- * Create an instance of a class. Delegates to method
- * <code>getProviderClass()</code> in order to load the class.
- *
- * @param type Base class / Service interface of the factory to
- * instantiate.
- *
- * @param className Name of the concrete class corresponding to the
- * service provider
- *
- * @param cl <code>ClassLoader</code> used to load the factory class. If <code>null</code>
- * current <code>Thread</code>'s context classLoader is used to load the factory class.
- *
- * @param doFallback True if the current ClassLoader should be tried as
- * a fallback if the class is not found using cl
- */
- static <T> T newInstance(Class<T> type, String className, ClassLoader cl, boolean doFallback)
- throws DatatypeConfigurationException
- {
- return newInstance(type, className, cl, doFallback, false);
- }
-
- /**
- * Create an instance of a class. Delegates to method
- * <code>getProviderClass()</code> in order to load the class.
- *
- * @param type Base class / Service interface of the factory to
- * instantiate.
- *
- * @param className Name of the concrete class corresponding to the
- * service provider
- *
- * @param cl ClassLoader to use to load the class, null means to use
- * the bootstrap ClassLoader
- *
- * @param doFallback True if the current ClassLoader should be tried as
- * a fallback if the class is not found using cl
- *
- * @param useBSClsLoader True if cl=null actually meant bootstrap classLoader. This parameter
- * is needed since DocumentBuilderFactory/SAXParserFactory defined null as context classLoader.
- */
- static <T> T newInstance(Class<T> type, String className, ClassLoader cl,
- boolean doFallback, boolean useBSClsLoader)
- throws DatatypeConfigurationException
- {
- assert type != null;
-
- // make sure we have access to restricted packages
- if (System.getSecurityManager() != null) {
- if (className != null && className.startsWith(DEFAULT_PACKAGE)) {
- cl = null;
- useBSClsLoader = true;
- }
- }
-
- try {
- Class<?> providerClass = getProviderClass(className, cl, doFallback, useBSClsLoader);
- if (!type.isAssignableFrom(providerClass)) {
- throw new ClassCastException(className + " cannot be cast to " + type.getName());
- }
- Object instance = providerClass.newInstance();
- if (debug) { // Extra check to avoid computing cl strings
- dPrint("created new instance of " + providerClass +
- " using ClassLoader: " + cl);
- }
- return type.cast(instance);
- }
- catch (ClassNotFoundException x) {
- throw new DatatypeConfigurationException(
- "Provider " + className + " not found", x);
- }
- catch (Exception x) {
- throw new DatatypeConfigurationException(
- "Provider " + className + " could not be instantiated: " + x,
- x);
- }
- }
-
- /**
- * Finds the implementation Class object in the specified order. Main
- * entry point.
- * @return Class object of factory, never null
- *
- * @param type Base class / Service interface of the
- * factory to find.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * Package private so this code can be shared.
- */
- static <T> T find(Class<T> type, String fallbackClassName)
- throws DatatypeConfigurationException
- {
- final String factoryId = type.getName();
- dPrint("find factoryId =" + factoryId);
-
- // Use the system property first
- try {
- String systemProp = ss.getSystemProperty(factoryId);
- if (systemProp != null) {
- dPrint("found system property, value=" + systemProp);
- return newInstance(type, systemProp, null, true);
- }
- }
- catch (SecurityException se) {
- if (debug) se.printStackTrace();
- }
-
- // try to read from $java.home/lib/jaxp.properties
- try {
- if (firstTime) {
- synchronized (cacheProps) {
- if (firstTime) {
- String configFile = ss.getSystemProperty("java.home") + File.separator +
- "lib" + File.separator + "jaxp.properties";
- File f = new File(configFile);
- firstTime = false;
- if (ss.doesFileExist(f)) {
- dPrint("Read properties file "+f);
- cacheProps.load(ss.getFileInputStream(f));
- }
- }
- }
- }
- final String factoryClassName = cacheProps.getProperty(factoryId);
-
- if (factoryClassName != null) {
- dPrint("found in $java.home/jaxp.properties, value=" + factoryClassName);
- return newInstance(type, factoryClassName, null, true);
- }
- }
- catch (Exception ex) {
- if (debug) ex.printStackTrace();
- }
-
- // Try Jar Service Provider Mechanism
- final T provider = findServiceProvider(type);
- if (provider != null) {
- return provider;
- }
- if (fallbackClassName == null) {
- throw new DatatypeConfigurationException(
- "Provider for " + factoryId + " cannot be found");
- }
-
- dPrint("loaded from fallback value: " + fallbackClassName);
- return newInstance(type, fallbackClassName, null, true);
- }
-
- /*
- * Try to find provider using the ServiceLoader API
- *
- * @param type Base class / Service interface of the factory to find.
- *
- * @return instance of provider class if found or null
- */
- private static <T> T findServiceProvider(final Class<T> type)
- throws DatatypeConfigurationException
- {
- try {
- return AccessController.doPrivileged(new PrivilegedAction<T>() {
- public T run() {
- final ServiceLoader<T> serviceLoader = ServiceLoader.load(type);
- final Iterator<T> iterator = serviceLoader.iterator();
- if (iterator.hasNext()) {
- return iterator.next();
- } else {
- return null;
- }
- }
- });
- } catch(ServiceConfigurationError e) {
- final DatatypeConfigurationException error =
- new DatatypeConfigurationException(
- "Provider for " + type + " cannot be found", e);
- throw error;
- }
- }
-
-}
diff --git a/src/javax/xml/datatype/SecuritySupport.java b/src/javax/xml/datatype/SecuritySupport.java
deleted file mode 100644
index 127db22..0000000
--- a/src/javax/xml/datatype/SecuritySupport.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.datatype;
-
-import java.security.*;
-import java.net.*;
-import java.io.*;
-import java.util.*;
-
-/**
- * This class is duplicated for each JAXP subpackage so keep it in sync.
- * It is package private and therefore is not exposed as part of the JAXP
- * API.
- *
- * Security related methods that only work on J2SE 1.2 and newer.
- */
-class SecuritySupport {
-
-
- ClassLoader getContextClassLoader() {
- return (ClassLoader)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- ClassLoader cl = null;
- try {
- cl = Thread.currentThread().getContextClassLoader();
- } catch (SecurityException ex) { }
- return cl;
- }
- });
- }
-
- String getSystemProperty(final String propName) {
- return (String)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return System.getProperty(propName);
- }
- });
- }
-
- FileInputStream getFileInputStream(final File file)
- throws FileNotFoundException
- {
- try {
- return (FileInputStream)
- AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws FileNotFoundException {
- return new FileInputStream(file);
- }
- });
- } catch (PrivilegedActionException e) {
- throw (FileNotFoundException)e.getException();
- }
- }
-
- InputStream getResourceAsStream(final ClassLoader cl,
- final String name)
- {
- return (InputStream)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- InputStream ris;
- if (cl == null) {
- ris = Object.class.getResourceAsStream(name);
- } else {
- ris = cl.getResourceAsStream(name);
- }
- return ris;
- }
- });
- }
-
- boolean doesFileExist(final File f) {
- return ((Boolean)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return new Boolean(f.exists());
- }
- })).booleanValue();
- }
-
-}
diff --git a/src/javax/xml/datatype/XMLGregorianCalendar.java b/src/javax/xml/datatype/XMLGregorianCalendar.java
deleted file mode 100644
index ce16b9c..0000000
--- a/src/javax/xml/datatype/XMLGregorianCalendar.java
+++ /dev/null
@@ -1,1062 +0,0 @@
-/*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.datatype;
-
-import javax.xml.namespace.QName;
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.util.TimeZone;
-import java.util.GregorianCalendar;
-
-/**
- * <p>Representation for W3C XML Schema 1.0 date/time datatypes.
- * Specifically, these date/time datatypes are
- * {@link DatatypeConstants#DATETIME},
- * {@link DatatypeConstants#TIME},
- * {@link DatatypeConstants#DATE},
- * {@link DatatypeConstants#GYEARMONTH},
- * {@link DatatypeConstants#GMONTHDAY},
- * {@link DatatypeConstants#GYEAR},
- * {@link DatatypeConstants#GMONTH}, and
- * {@link DatatypeConstants#GDAY}
- * defined in the XML Namespace
- * <code>"http://www.w3.org/2001/XMLSchema"</code>.
- * These datatypes are normatively defined in
- * <a href="http://www.w3.org/TR/xmlschema-2/#dateTime">W3C XML Schema 1.0 Part 2, Section 3.2.7-14</a>.</p>
- *
- * <p>The table below defines the mapping between XML Schema 1.0
- * date/time datatype fields and this class' fields. It also summarizes
- * the value constraints for the date and time fields defined in
- * <a href="http://www.w3.org/TR/xmlschema-2/#isoformats">W3C XML Schema 1.0 Part 2, Appendix D,
- * <i>ISO 8601 Date and Time Formats</i></a>.</p>
- *
- * <a name="datetimefieldmapping"/>
- * <table border="2" rules="all" cellpadding="2">
- * <thead>
- * <tr>
- * <th align="center" colspan="3">
- * Date/Time Datatype Field Mapping Between XML Schema 1.0 and Java Representation
- * </th>
- * </tr>
- * </thead>
- * <tbody>
- * <tr>
- * <th>XML Schema 1.0<br/>
- * datatype<br/>
- * field</th>
- * <th>Related<br/>XMLGregorianCalendar<br/>Accessor(s)</th>
- * <th>Value Range</th>
- * </tr>
- * <tr>
- * <td><a name="datetimefield-year"/>year</td>
- * <td> {@link #getYear()} + {@link #getEon()} or<br/>
- * {@link #getEonAndYear}
- * </td>
- * <td> <code>getYear()</code> is a value between -(10^9-1) to (10^9)-1
- * or {@link DatatypeConstants#FIELD_UNDEFINED}.<br/>
- * {@link #getEon()} is high order year value in billion of years.<br/>
- * <code>getEon()</code> has values greater than or equal to (10^9) or less than or equal to -(10^9).
- * A value of null indicates field is undefined.</br>
- * Given that <a href="http://www.w3.org/2001/05/xmlschema-errata#e2-63">XML Schema 1.0 errata</a> states that the year zero
- * will be a valid lexical value in a future version of XML Schema,
- * this class allows the year field to be set to zero. Otherwise,
- * the year field value is handled exactly as described
- * in the errata and [ISO-8601-1988]. Note that W3C XML Schema 1.0
- * validation does not allow for the year field to have a value of zero.
- * </td>
- * </tr>
- * <tr>
- * <td><a name="datetimefield-month"/>month</td>
- * <td> {@link #getMonth()} </td>
- * <td> 1 to 12 or {@link DatatypeConstants#FIELD_UNDEFINED} </td>
- * </tr>
- * <tr>
- * <td><a name="datetimefield-day"/>day</td>
- * <td> {@link #getDay()} </td>
- * <td> Independent of month, max range is 1 to 31 or {@link DatatypeConstants#FIELD_UNDEFINED}.<br/>
- * The normative value constraint stated relative to month
- * field's value is in <a href="http://www.w3.org/TR/xmlschema-2/#isoformats">W3C XML Schema 1.0 Part 2, Appendix D</a>.
- * </td>
- * </tr>
- * <tr>
- * <td><a name="datetimefield-hour"/>hour</td>
- * <td>{@link #getHour()}</td>
- * <td>
- * 0 to 23 or {@link DatatypeConstants#FIELD_UNDEFINED}.
- * An hour value of 24 is allowed to be set in the lexical space provided the minute and second
- * field values are zero. However, an hour value of 24 is not allowed in value space and will be
- * transformed to represent the value of the first instance of the following day as per
- * <a href="http://www.w3.org/TR/xmlschema-2/#built-in-primitive-datatypes">
- * XML Schema Part 2: Datatypes Second Edition, 3.2 Primitive datatypes</a>.
- * </td>
- * </tr>
- * <tr>
- * <td><a name="datetimefield-minute"/>minute</td>
- * <td> {@link #getMinute()} </td>
- * <td> 0 to 59 or {@link DatatypeConstants#FIELD_UNDEFINED} </td>
- * </tr>
- * <tr>
- * <td><a name="datetimefield-second"/>second</td>
- * <td>
- * {@link #getSecond()} + {@link #getMillisecond()}/1000 or<br/>
- * {@link #getSecond()} + {@link #getFractionalSecond()}
- * </td>
- * <td>
- * {@link #getSecond()} from 0 to 60 or {@link DatatypeConstants#FIELD_UNDEFINED}.<br/>
- * <i>(Note: 60 only allowable for leap second.)</i><br/>
- * {@link #getFractionalSecond()} allows for infinite precision over the range from 0.0 to 1.0 when
- * the {@link #getSecond()} is defined.<br/>
- * <code>FractionalSecond</code> is optional and has a value of <code>null</code> when it is undefined.<br />
- * {@link #getMillisecond()} is the convenience
- * millisecond precision of value of {@link #getFractionalSecond()}.
- * </td>
- * </tr>
- * <tr>
- * <td><a name="datetimefield-timezone"/>timezone</td>
- * <td> {@link #getTimezone()} </td>
- * <td> Number of minutes or {@link DatatypeConstants#FIELD_UNDEFINED}.
- * Value range from -14 hours (-14 * 60 minutes) to 14 hours (14 * 60 minutes).
- * </td>
- * </tr>
- * </tbody>
- * </table>
- *
- * <p>All maximum value space constraints listed for the fields in the table
- * above are checked by factory methods, @{link DatatypeFactory},
- * setter methods and parse methods of
- * this class. <code>IllegalArgumentException</code> is thrown when a
- * parameter's value is outside the value constraint for the field or
- * if the composite
- * values constitute an invalid XMLGregorianCalendar instance (for example, if
- * the 31st of June is specified).
- * </p>
- *
- * <p>The following operations are defined for this class:
- * <ul>
- * <li>accessors/mutators for independent date/time fields</li>
- * <li>conversion between this class and W3C XML Schema 1.0 lexical representation,
- * {@link #toString()}, {@link DatatypeFactory#newXMLGregorianCalendar(String lexicalRepresentation)}</li>
- * <li>conversion between this class and {@link GregorianCalendar},
- * {@link #toGregorianCalendar(java.util.TimeZone timezone, java.util.Locale aLocale, XMLGregorianCalendar defaults)},
- * {@link DatatypeFactory}</li>
- * <li>partial order relation comparator method, {@link #compare(XMLGregorianCalendar xmlGregorianCalendar)}</li>
- * <li>{@link #equals(Object)} defined relative to {@link #compare(XMLGregorianCalendar xmlGregorianCalendar)}.</li>
- * <li>addition operation with {@link Duration}
- * instance as defined in <a href="http://www.w3.org/TR/xmlschema-2/#adding-durations-to-dateTimes">
- * W3C XML Schema 1.0 Part 2, Appendix E, <i>Adding durations to dateTimes</i></a>.
- * </li>
- * </ul>
- * </p>
- *
- * @author <a href="mailto:Joseph.Fialli@Sun.com">Joseph Fialli</a>
- * @author <a href="mailto:Kohsuke.Kawaguchi@Sun.com">Kohsuke Kawaguchi</a>
- * @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a>
- * @author <a href="mailto:Sunitha.Reddy@Sun.com">Sunitha Reddy</a>
- * @see Duration
- * @see DatatypeFactory
- * @since 1.5
- */
-
-public abstract class XMLGregorianCalendar
- implements Cloneable {
-
- /**
- * Default no-arg constructor.
- *
- * <p>Note: Always use the {@link DatatypeFactory} to
- * construct an instance of <code>XMLGregorianCalendar</code>.
- * The constructor on this class cannot be guaranteed to
- * produce an object with a consistent state and may be
- * removed in the future.</p>
- */
- public XMLGregorianCalendar() {
- }
-
- /**
- * <p>Unset all fields to undefined.</p>
- *
- * <p>Set all int fields to {@link DatatypeConstants#FIELD_UNDEFINED} and reference fields
- * to null.</p>
- */
- public abstract void clear();
-
- /**
- * <p>Reset this <code>XMLGregorianCalendar</code> to its original values.</p>
- *
- * <p><code>XMLGregorianCalendar</code> is reset to the same values as when it was created with
- * {@link DatatypeFactory#newXMLGregorianCalendar()},
- * {@link DatatypeFactory#newXMLGregorianCalendar(String lexicalRepresentation)},
- * {@link DatatypeFactory#newXMLGregorianCalendar(
- * BigInteger year,
- * int month,
- * int day,
- * int hour,
- * int minute,
- * int second,
- * BigDecimal fractionalSecond,
- * int timezone)},
- * {@link DatatypeFactory#newXMLGregorianCalendar(
- * int year,
- * int month,
- * int day,
- * int hour,
- * int minute,
- * int second,
- * int millisecond,
- * int timezone)},
- * {@link DatatypeFactory#newXMLGregorianCalendar(GregorianCalendar cal)},
- * {@link DatatypeFactory#newXMLGregorianCalendarDate(
- * int year,
- * int month,
- * int day,
- * int timezone)},
- * {@link DatatypeFactory#newXMLGregorianCalendarTime(
- * int hours,
- * int minutes,
- * int seconds,
- * int timezone)},
- * {@link DatatypeFactory#newXMLGregorianCalendarTime(
- * int hours,
- * int minutes,
- * int seconds,
- * BigDecimal fractionalSecond,
- * int timezone)} or
- * {@link DatatypeFactory#newXMLGregorianCalendarTime(
- * int hours,
- * int minutes,
- * int seconds,
- * int milliseconds,
- * int timezone)}.
- * </p>
- *
- * <p><code>reset()</code> is designed to allow the reuse of existing <code>XMLGregorianCalendar</code>s
- * thus saving resources associated with the creation of new <code>XMLGregorianCalendar</code>s.</p>
- */
- public abstract void reset();
-
- /**
- * <p>Set low and high order component of XSD <code>dateTime</code> year field.</p>
- *
- * <p>Unset this field by invoking the setter with a parameter value of <code>null</code>.</p>
- *
- * @param year value constraints summarized in <a href="#datetimefield-year">year field of date/time field mapping table</a>.
- *
- * @throws IllegalArgumentException if <code>year</code> parameter is
- * outside value constraints for the field as specified in
- * <a href="#datetimefieldmapping">date/time field mapping table</a>.
- */
- public abstract void setYear(BigInteger year);
-
- /**
- * <p>Set year of XSD <code>dateTime</code> year field.</p>
- *
- * <p>Unset this field by invoking the setter with a parameter value of
- * {@link DatatypeConstants#FIELD_UNDEFINED}.</p>
- *
- * <p>Note: if the absolute value of the <code>year</code> parameter
- * is less than 10^9, the eon component of the XSD year field is set to
- * <code>null</code> by this method.</p>
- *
- * @param year value constraints are summarized in <a href="#datetimefield-year">year field of date/time field mapping table</a>.
- * If year is {@link DatatypeConstants#FIELD_UNDEFINED}, then eon is set to <code>null</code>.
- */
- public abstract void setYear(int year);
-
- /**
- * <p>Set month.</p>
- *
- * <p>Unset this field by invoking the setter with a parameter value of {@link DatatypeConstants#FIELD_UNDEFINED}.</p>
- *
- * @param month value constraints summarized in <a href="#datetimefield-month">month field of date/time field mapping table</a>.
- *
- * @throws IllegalArgumentException if <code>month</code> parameter is
- * outside value constraints for the field as specified in
- * <a href="#datetimefieldmapping">date/time field mapping table</a>.
- */
- public abstract void setMonth(int month);
-
- /**
- * <p>Set days in month.</p>
- *
- * <p>Unset this field by invoking the setter with a parameter value of {@link DatatypeConstants#FIELD_UNDEFINED}.</p>
- *
- * @param day value constraints summarized in <a href="#datetimefield-day">day field of date/time field mapping table</a>.
- *
- * @throws IllegalArgumentException if <code>day</code> parameter is
- * outside value constraints for the field as specified in
- * <a href="#datetimefieldmapping">date/time field mapping table</a>.
- */
- public abstract void setDay(int day);
-
- /**
- * <p>Set the number of minutes in the timezone offset.</p>
- *
- * <p>Unset this field by invoking the setter with a parameter value of {@link DatatypeConstants#FIELD_UNDEFINED}.</p>
- *
- * @param offset value constraints summarized in <a href="#datetimefield-timezone">
- * timezone field of date/time field mapping table</a>.
- *
- * @throws IllegalArgumentException if <code>offset</code> parameter is
- * outside value constraints for the field as specified in
- * <a href="#datetimefieldmapping">date/time field mapping table</a>.
- */
- public abstract void setTimezone(int offset);
-
- /**
- * <p>Set time as one unit.</p>
- *
- * @param hour value constraints are summarized in
- * <a href="#datetimefield-hour">hour field of date/time field mapping table</a>.
- * @param minute value constraints are summarized in
- * <a href="#datetimefield-minute">minute field of date/time field mapping table</a>.
- * @param second value constraints are summarized in
- * <a href="#datetimefield-second">second field of date/time field mapping table</a>.
- *
- * @see #setTime(int, int, int, BigDecimal)
- *
- * @throws IllegalArgumentException if any parameter is
- * outside value constraints for the field as specified in
- * <a href="#datetimefieldmapping">date/time field mapping table</a>.
- */
- public void setTime(int hour, int minute, int second) {
-
- setTime(
- hour,
- minute,
- second,
- null // fractional
- );
- }
-
- /**
- * <p>Set hours.</p>
- *
- * <p>Unset this field by invoking the setter with a parameter value of {@link DatatypeConstants#FIELD_UNDEFINED}.</p>
- *
- * @param hour value constraints summarized in <a href="#datetimefield-hour">hour field of date/time field mapping table</a>.
- *
- * @throws IllegalArgumentException if <code>hour</code> parameter is outside value constraints for the field as specified in
- * <a href="#datetimefieldmapping">date/time field mapping table</a>.
- */
- public abstract void setHour(int hour);
-
- /**
- * <p>Set minutes.</p>
- *
- * <p>Unset this field by invoking the setter with a parameter value of {@link DatatypeConstants#FIELD_UNDEFINED}.</p>
- *
- * @param minute value constraints summarized in <a href="#datetimefield-minute">minute field of date/time field mapping table</a>.
- *
- * @throws IllegalArgumentException if <code>minute</code> parameter is outside value constraints for the field as specified in
- * <a href="#datetimefieldmapping">date/time field mapping table</a>.
- */
- public abstract void setMinute(int minute);
-
- /**
- * <p>Set seconds.</p>
- *
- * <p>Unset this field by invoking the setter with a parameter value of {@link DatatypeConstants#FIELD_UNDEFINED}.</p>
- *
- * @param second value constraints summarized in <a href="#datetimefield-second">second field of date/time field mapping table</a>.
- *
- * @throws IllegalArgumentException if <code>second</code> parameter is outside value constraints for the field as specified in
- * <a href="#datetimefieldmapping">date/time field mapping table</a>.
- */
- public abstract void setSecond(int second);
-
- /**
- * <p>Set milliseconds.</p>
- *
- * <p>Unset this field by invoking the setter with a parameter value of {@link DatatypeConstants#FIELD_UNDEFINED}.</p>
- *
- * @param millisecond value constraints summarized in
- * <a href="#datetimefield-second">second field of date/time field mapping table</a>.
- *
- * @throws IllegalArgumentException if <code>millisecond</code> parameter is outside value constraints for the field as specified
- * in <a href="#datetimefieldmapping">date/time field mapping table</a>.
- */
- public abstract void setMillisecond(int millisecond);
-
- /**
- * <p>Set fractional seconds.</p>
- *
- * <p>Unset this field by invoking the setter with a parameter value of <code>null</code>.</p>
- *
- * @param fractional value constraints summarized in
- * <a href="#datetimefield-second">second field of date/time field mapping table</a>.
- *
- * @throws IllegalArgumentException if <code>fractional</code> parameter is outside value constraints for the field as specified
- * in <a href="#datetimefieldmapping">date/time field mapping table</a>.
- */
- public abstract void setFractionalSecond(BigDecimal fractional);
-
-
- /**
- * <p>Set time as one unit, including the optional infinite precision
- * fractional seconds.</p>
- *
- * @param hour value constraints are summarized in
- * <a href="#datetimefield-hour">hour field of date/time field mapping table</a>.
- * @param minute value constraints are summarized in
- * <a href="#datetimefield-minute">minute field of date/time field mapping table</a>.
- * @param second value constraints are summarized in
- * <a href="#datetimefield-second">second field of date/time field mapping table</a>.
- * @param fractional value of <code>null</code> indicates this optional
- * field is not set.
- *
- * @throws IllegalArgumentException if any parameter is
- * outside value constraints for the field as specified in
- * <a href="#datetimefieldmapping">date/time field mapping table</a>.
- */
- public void setTime(
- int hour,
- int minute,
- int second,
- BigDecimal fractional) {
-
- setHour(hour);
- setMinute(minute);
- setSecond(second);
- setFractionalSecond(fractional);
- }
-
-
- /**
- * <p>Set time as one unit, including optional milliseconds.</p>
- *
- * @param hour value constraints are summarized in
- * <a href="#datetimefield-hour">hour field of date/time field mapping table</a>.
- * @param minute value constraints are summarized in
- * <a href="#datetimefield-minute">minute field of date/time field mapping table</a>.
- * @param second value constraints are summarized in
- * <a href="#datetimefield-second">second field of date/time field mapping table</a>.
- * @param millisecond value of {@link DatatypeConstants#FIELD_UNDEFINED} indicates this
- * optional field is not set.
- *
- * @throws IllegalArgumentException if any parameter is
- * outside value constraints for the field as specified in
- * <a href="#datetimefieldmapping">date/time field mapping table</a>.
- */
- public void setTime(int hour, int minute, int second, int millisecond) {
-
- setHour(hour);
- setMinute(minute);
- setSecond(second);
- setMillisecond(millisecond);
- }
-
- /**
- * <p>Return high order component for XML Schema 1.0 dateTime datatype field for
- * <code>year</code>.
- * <code>null</code> if this optional part of the year field is not defined.</p>
- *
- * <p>Value constraints for this value are summarized in
- * <a href="#datetimefield-year">year field of date/time field mapping table</a>.</p>
- * @return eon of this <code>XMLGregorianCalendar</code>. The value
- * returned is an integer multiple of 10^9.
- *
- * @see #getYear()
- * @see #getEonAndYear()
- */
- public abstract BigInteger getEon();
-
- /**
- * <p>Return low order component for XML Schema 1.0 dateTime datatype field for
- * <code>year</code> or {@link DatatypeConstants#FIELD_UNDEFINED}.</p>
- *
- * <p>Value constraints for this value are summarized in
- * <a href="#datetimefield-year">year field of date/time field mapping table</a>.</p>
- *
- * @return year of this <code>XMLGregorianCalendar</code>.
- *
- * @see #getEon()
- * @see #getEonAndYear()
- */
- public abstract int getYear();
-
- /**
- * <p>Return XML Schema 1.0 dateTime datatype field for
- * <code>year</code>.</p>
- *
- * <p>Value constraints for this value are summarized in
- * <a href="#datetimefield-year">year field of date/time field mapping table</a>.</p>
- *
- * @return sum of <code>eon</code> and <code>BigInteger.valueOf(year)</code>
- * when both fields are defined. When only <code>year</code> is defined,
- * return it. When both <code>eon</code> and <code>year</code> are not
- * defined, return <code>null</code>.
- *
- * @see #getEon()
- * @see #getYear()
- */
- public abstract BigInteger getEonAndYear();
-
- /**
- * <p>Return number of month or {@link DatatypeConstants#FIELD_UNDEFINED}.</p>
- *
- * <p>Value constraints for this value are summarized in
- * <a href="#datetimefield-month">month field of date/time field mapping table</a>.</p>
- *
- * @return year of this <code>XMLGregorianCalendar</code>.
- *
- */
- public abstract int getMonth();
-
- /**
- * Return day in month or {@link DatatypeConstants#FIELD_UNDEFINED}.</p>
- *
- * <p>Value constraints for this value are summarized in
- * <a href="#datetimefield-day">day field of date/time field mapping table</a>.</p>
- *
- * @see #setDay(int)
- */
- public abstract int getDay();
-
- /**
- * Return timezone offset in minutes or
- * {@link DatatypeConstants#FIELD_UNDEFINED} if this optional field is not defined.
- *
- * <p>Value constraints for this value are summarized in
- * <a href="#datetimefield-timezone">timezone field of date/time field mapping table</a>.</p>
- *
- * @see #setTimezone(int)
- */
- public abstract int getTimezone();
-
- /**
- * Return hours or {@link DatatypeConstants#FIELD_UNDEFINED}.
- * Returns {@link DatatypeConstants#FIELD_UNDEFINED} if this field is not defined.
- *
- * <p>Value constraints for this value are summarized in
- * <a href="#datetimefield-hour">hour field of date/time field mapping table</a>.</p>
- * @see #setTime(int, int, int)
- */
- public abstract int getHour();
-
- /**
- * Return minutes or {@link DatatypeConstants#FIELD_UNDEFINED}.</p>
- * Returns {@link DatatypeConstants#FIELD_UNDEFINED} if this field is not defined.
- *
- * <p>Value constraints for this value are summarized in
- * <a href="#datetimefield-minute">minute field of date/time field mapping table</a>.</p>
- * @see #setTime(int, int, int)
- */
- public abstract int getMinute();
-
- /**
- * <p>Return seconds or {@link DatatypeConstants#FIELD_UNDEFINED}.</p>
- *
- * <p>Returns {@link DatatypeConstants#FIELD_UNDEFINED} if this field is not defined.
- * When this field is not defined, the optional xs:dateTime
- * fractional seconds field, represented by
- * {@link #getFractionalSecond()} and {@link #getMillisecond()},
- * must not be defined.</p>
- *
- * <p>Value constraints for this value are summarized in
- * <a href="#datetimefield-second">second field of date/time field mapping table</a>.</p>
- *
- * @return Second of this <code>XMLGregorianCalendar</code>.
- *
- * @see #getFractionalSecond()
- * @see #getMillisecond()
- * @see #setTime(int, int, int)
- */
- public abstract int getSecond();
-
- /**
- * <p>Return millisecond precision of {@link #getFractionalSecond()}.</p>
- *
- * <p>This method represents a convenience accessor to infinite
- * precision fractional second value returned by
- * {@link #getFractionalSecond()}. The returned value is the rounded
- * down to milliseconds value of
- * {@link #getFractionalSecond()}. When {@link #getFractionalSecond()}
- * returns <code>null</code>, this method must return
- * {@link DatatypeConstants#FIELD_UNDEFINED}.</p>
- *
- * <p>Value constraints for this value are summarized in
- * <a href="#datetimefield-second">second field of date/time field mapping table</a>.</p>
- *
- * @return Millisecond of this <code>XMLGregorianCalendar</code>.
- *
- * @see #getFractionalSecond()
- * @see #setTime(int, int, int)
- */
- public int getMillisecond() {
-
- BigDecimal fractionalSeconds = getFractionalSecond();
-
- // is field undefined?
- if (fractionalSeconds == null) {
- return DatatypeConstants.FIELD_UNDEFINED;
- }
-
- return getFractionalSecond().movePointRight(3).intValue();
- }
-
- /**
- * <p>Return fractional seconds.</p>
- *
- * <p><code>null</code> is returned when this optional field is not defined.</p>
- *
- * <p>Value constraints are detailed in
- * <a href="#datetimefield-second">second field of date/time field mapping table</a>.</p>
- *
- * <p>This optional field can only have a defined value when the
- * xs:dateTime second field, represented by {@link #getSecond()},
- * does not return {@link DatatypeConstants#FIELD_UNDEFINED}.</p>
- *
- * @return fractional seconds of this <code>XMLGregorianCalendar</code>.
- *
- * @see #getSecond()
- * @see #setTime(int, int, int, BigDecimal)
- */
- public abstract BigDecimal getFractionalSecond();
-
- // comparisons
- /**
- * <p>Compare two instances of W3C XML Schema 1.0 date/time datatypes
- * according to partial order relation defined in
- * <a href="http://www.w3.org/TR/xmlschema-2/#dateTime-order">W3C XML Schema 1.0 Part 2, Section 3.2.7.3,
- * <i>Order relation on dateTime</i></a>.</p>
- *
- * <p><code>xsd:dateTime</code> datatype field mapping to accessors of
- * this class are defined in
- * <a href="#datetimefieldmapping">date/time field mapping table</a>.</p>
- *
- * @param xmlGregorianCalendar Instance of <code>XMLGregorianCalendar</code> to compare
- *
- * @return The relationship between <code>this</code> <code>XMLGregorianCalendar</code> and
- * the specified <code>xmlGregorianCalendar</code> as
- * {@link DatatypeConstants#LESSER},
- * {@link DatatypeConstants#EQUAL},
- * {@link DatatypeConstants#GREATER} or
- * {@link DatatypeConstants#INDETERMINATE}.
- *
- * @throws NullPointerException if <code>xmlGregorianCalendar</code> is null.
- */
- public abstract int compare(XMLGregorianCalendar xmlGregorianCalendar);
-
- /**
- * <p>Normalize this instance to UTC.</p>
- *
- * <p>2000-03-04T23:00:00+03:00 normalizes to 2000-03-04T20:00:00Z</p>
- * <p>Implements W3C XML Schema Part 2, Section 3.2.7.3 (A).</p>
- *
- * @return <code>this</code> <code>XMLGregorianCalendar</code> normalized to UTC.
- */
- public abstract XMLGregorianCalendar normalize();
-
- /**
- * <p>Compares this calendar to the specified object. The result is
- * <code>true</code> if and only if the argument is not null and is an
- * <code>XMLGregorianCalendar</code> object that represents the same
- * instant in time as this object.</p>
- *
- * @param obj to compare.
- *
- * @return <code>true</code> when <code>obj</code> is an instance of
- * <code>XMLGregorianCalendar</code> and
- * {@link #compare(XMLGregorianCalendar obj)}
- * returns {@link DatatypeConstants#EQUAL},
- * otherwise <code>false</code>.
- */
- public boolean equals(Object obj) {
-
- if (obj == null || !(obj instanceof XMLGregorianCalendar)) {
- return false;
- }
- return compare((XMLGregorianCalendar) obj) == DatatypeConstants.EQUAL;
- }
-
- /**
- * <p>Returns a hash code consistent with the definition of the equals method.</p>
- *
- * @return hash code of this object.
- */
- public int hashCode() {
-
- // Following two dates compare to EQUALS since in different timezones.
- // 2000-01-15T12:00:00-05:00 == 2000-01-15T13:00:00-04:00
- //
- // Must ensure both instances generate same hashcode by normalizing
- // this to UTC timezone.
- int timezone = getTimezone();
- if (timezone == DatatypeConstants.FIELD_UNDEFINED) {
- timezone = 0;
- }
- XMLGregorianCalendar gc = this;
- if (timezone != 0) {
- gc = this.normalize();
- }
- return gc.getYear()
- + gc.getMonth()
- + gc.getDay()
- + gc.getHour()
- + gc.getMinute()
- + gc.getSecond();
- }
-
- /**
- * <p>Return the lexical representation of <code>this</code> instance.
- * The format is specified in
- * <a href="http://www.w3.org/TR/xmlschema-2/#dateTime-order">XML Schema 1.0 Part 2, Section 3.2.[7-14].1,
- * <i>Lexical Representation</i>".</a></p>
- *
- * <p>Specific target lexical representation format is determined by
- * {@link #getXMLSchemaType()}.</p>
- *
- * @return XML, as <code>String</code>, representation of this <code>XMLGregorianCalendar</code>
- *
- * @throws IllegalStateException if the combination of set fields
- * does not match one of the eight defined XML Schema builtin date/time datatypes.
- */
- public abstract String toXMLFormat();
-
- /**
- * <p>Return the name of the XML Schema date/time type that this instance
- * maps to. Type is computed based on fields that are set.</p>
- *
- * <table border="2" rules="all" cellpadding="2">
- * <thead>
- * <tr>
- * <th align="center" colspan="7">
- * Required fields for XML Schema 1.0 Date/Time Datatypes.<br/>
- * <i>(timezone is optional for all date/time datatypes)</i>
- * </th>
- * </tr>
- * </thead>
- * <tbody>
- * <tr>
- * <td>Datatype</td>
- * <td>year</td>
- * <td>month</td>
- * <td>day</td>
- * <td>hour</td>
- * <td>minute</td>
- * <td>second</td>
- * </tr>
- * <tr>
- * <td>{@link DatatypeConstants#DATETIME}</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * </tr>
- * <tr>
- * <td>{@link DatatypeConstants#DATE}</td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * <td></td>
- * <td></td>
- * <td></td>
- * </tr>
- * <tr>
- * <td>{@link DatatypeConstants#TIME}</td>
- * <td></td>
- * <td></td>
- * <td></td>
- * <td>X</td>
- * <td>X</td>
- * <td>X</td>
- * </tr>
- * <tr>
- * <td>{@link DatatypeConstants#GYEARMONTH}</td>
- * <td>X</td>
- * <td>X</td>
- * <td></td>
- * <td></td>
- * <td></td>
- * <td></td>
- * </tr>
- * <tr>
- * <td>{@link DatatypeConstants#GMONTHDAY}</td>
- * <td></td>
- * <td>X</td>
- * <td>X</td>
- * <td></td>
- * <td></td>
- * <td></td>
- * </tr>
- * <tr>
- * <td>{@link DatatypeConstants#GYEAR}</td>
- * <td>X</td>
- * <td></td>
- * <td></td>
- * <td></td>
- * <td></td>
- * <td></td>
- * </tr>
- * <tr>
- * <td>{@link DatatypeConstants#GMONTH}</td>
- * <td></td>
- * <td>X</td>
- * <td></td>
- * <td></td>
- * <td></td>
- * <td></td>
- * </tr>
- * <tr>
- * <td>{@link DatatypeConstants#GDAY}</td>
- * <td></td>
- * <td></td>
- * <td>X</td>
- * <td></td>
- * <td></td>
- * <td></td>
- * </tr>
- * </tbody>
- * </table>
- *
- * @throws java.lang.IllegalStateException if the combination of set fields
- * does not match one of the eight defined XML Schema builtin
- * date/time datatypes.
- * @return One of the following class constants:
- * {@link DatatypeConstants#DATETIME},
- * {@link DatatypeConstants#TIME},
- * {@link DatatypeConstants#DATE},
- * {@link DatatypeConstants#GYEARMONTH},
- * {@link DatatypeConstants#GMONTHDAY},
- * {@link DatatypeConstants#GYEAR},
- * {@link DatatypeConstants#GMONTH} or
- * {@link DatatypeConstants#GDAY}.
- */
- public abstract QName getXMLSchemaType();
-
- /**
- * <p>Returns a <code>String</code> representation of this <code>XMLGregorianCalendar</code> <code>Object</code>.</p>
- *
- * <p>The result is a lexical representation generated by {@link #toXMLFormat()}.</p>
- *
- * @return A non-<code>null</code> valid <code>String</code> representation of this <code>XMLGregorianCalendar</code>.
- *
- * @throws IllegalStateException if the combination of set fields
- * does not match one of the eight defined XML Schema builtin date/time datatypes.
- *
- * @see #toXMLFormat()
- */
- public String toString() {
-
- return toXMLFormat();
- }
-
- /**
- * Validate instance by <code>getXMLSchemaType()</code> constraints.
- * @return true if data values are valid.
- */
- public abstract boolean isValid();
-
- /**
- * <p>Add <code>duration</code> to this instance.</p>
- *
- * <p>The computation is specified in
- * <a href="http://www.w3.org/TR/xmlschema-2/#adding-durations-to-dateTimes">XML Schema 1.0 Part 2, Appendix E,
- * <i>Adding durations to dateTimes</i>></a>.
- * <a href="#datetimefieldmapping">date/time field mapping table</a>
- * defines the mapping from XML Schema 1.0 <code>dateTime</code> fields
- * to this class' representation of those fields.</p>
- *
- * @param duration Duration to add to this <code>XMLGregorianCalendar</code>.
- *
- * @throws NullPointerException when <code>duration</code> parameter is <code>null</code>.
- */
- public abstract void add(Duration duration);
-
- /**
- * <p>Convert this <code>XMLGregorianCalendar</code> to a {@link GregorianCalendar}.</p>
- *
- * <p>When <code>this</code> instance has an undefined field, this
- * conversion relies on the <code>java.util.GregorianCalendar</code> default
- * for its corresponding field. A notable difference between
- * XML Schema 1.0 date/time datatypes and <code>java.util.GregorianCalendar</code>
- * is that Timezone value is optional for date/time datatypes and it is
- * a required field for <code>java.util.GregorianCalendar</code>. See javadoc
- * for <code>java.util.TimeZone.getDefault()</code> on how the default
- * is determined. To explicitly specify the <code>TimeZone</code>
- * instance, see
- * {@link #toGregorianCalendar(TimeZone, Locale, XMLGregorianCalendar)}.</p>
- *
- * <table border="2" rules="all" cellpadding="2">
- * <thead>
- * <tr>
- * <th align="center" colspan="2">
- * Field by Field Conversion from this class to
- * <code>java.util.GregorianCalendar</code>
- * </th>
- * </tr>
- * </thead>
- * <tbody>
- * <tr>
- * <td><code>java.util.GregorianCalendar</code> field</td>
- * <td><code>javax.xml.datatype.XMLGregorianCalendar</code> field</td>
- * </tr>
- * <tr>
- * <td><code>ERA</code></td>
- * <td>{@link #getEonAndYear()}<code>.signum() < 0 ? GregorianCalendar.BC : GregorianCalendar.AD</code></td>
- * </tr>
- * <tr>
- * <td><code>YEAR</code></td>
- * <td>{@link #getEonAndYear()}<code>.abs().intValue()</code><i>*</i></td>
- * </tr>
- * <tr>
- * <td><code>MONTH</code></td>
- * <td>{@link #getMonth()} - {@link DatatypeConstants#JANUARY} + {@link GregorianCalendar#JANUARY}</td>
- * </tr>
- * <tr>
- * <td><code>DAY_OF_MONTH</code></td>
- * <td>{@link #getDay()}</td>
- * </tr>
- * <tr>
- * <td><code>HOUR_OF_DAY</code></td>
- * <td>{@link #getHour()}</td>
- * </tr>
- * <tr>
- * <td><code>MINUTE</code></td>
- * <td>{@link #getMinute()}</td>
- * </tr>
- * <tr>
- * <td><code>SECOND</code></td>
- * <td>{@link #getSecond()}</td>
- * </tr>
- * <tr>
- * <td><code>MILLISECOND</code></td>
- * <td>get millisecond order from {@link #getFractionalSecond()}<i>*</i> </td>
- * </tr>
- * <tr>
- * <td><code>GregorianCalendar.setTimeZone(TimeZone)</code></td>
- * <td>{@link #getTimezone()} formatted into Custom timezone id</td>
- * </tr>
- * </tbody>
- * </table>
- * <i>*</i> designates possible loss of precision during the conversion due
- * to source datatype having higher precision than target datatype.
- *
- * <p>To ensure consistency in conversion implementations, the new
- * <code>GregorianCalendar</code> should be instantiated in following
- * manner.
- * <ul>
- * <li>Using <code>timeZone</code> value as defined above, create a new
- * <code>java.util.GregorianCalendar(timeZone,Locale.getDefault())</code>.
- * </li>
- * <li>Initialize all GregorianCalendar fields by calling {@link java.util.GregorianCalendar#clear()}.</li>
- * <li>Obtain a pure Gregorian Calendar by invoking
- * <code>GregorianCalendar.setGregorianChange(
- * new Date(Long.MIN_VALUE))</code>.</li>
- * <li>Its fields ERA, YEAR, MONTH, DAY_OF_MONTH, HOUR_OF_DAY,
- * MINUTE, SECOND and MILLISECOND are set using the method
- * <code>Calendar.set(int,int)</code></li>
- * </ul>
- * </p>
- *
- * @see #toGregorianCalendar(java.util.TimeZone, java.util.Locale, XMLGregorianCalendar)
- */
- public abstract GregorianCalendar toGregorianCalendar();
-
- /**
- * <p>Convert this <code>XMLGregorianCalendar</code> along with provided parameters
- * to a {@link GregorianCalendar} instance.</p>
- *
- * <p> Since XML Schema 1.0 date/time datetypes has no concept of
- * timezone ids or daylight savings timezone ids, this conversion operation
- * allows the user to explicitly specify one with
- * <code>timezone</code> parameter.</p>
- *
- * <p>To compute the return value's <code>TimeZone</code> field,
- * <ul>
- * <li>when parameter <code>timeZone</code> is non-null,
- * it is the timezone field.</li>
- * <li>else when <code>this.getTimezone() != FIELD_UNDEFINED</code>,
- * create a <code>java.util.TimeZone</code> with a custom timezone id
- * using the <code>this.getTimezone()</code>.</li>
- * <li>else when <code>defaults.getTimezone() != FIELD_UNDEFINED</code>,
- * create a <code>java.util.TimeZone</code> with a custom timezone id
- * using <code>defaults.getTimezone()</code>.</li>
- * <li>else use the <code>GregorianCalendar</code> default timezone value
- * for the host is defined as specified by
- * <code>java.util.TimeZone.getDefault()</code>.</li></p>
- *
- * <p>To ensure consistency in conversion implementations, the new
- * <code>GregorianCalendar</code> should be instantiated in following
- * manner.
- * <ul>
- * <li>Create a new <code>java.util.GregorianCalendar(TimeZone,
- * Locale)</code> with TimeZone set as specified above and the
- * <code>Locale</code> parameter.
- * </li>
- * <li>Initialize all GregorianCalendar fields by calling {@link GregorianCalendar#clear()}</li>
- * <li>Obtain a pure Gregorian Calendar by invoking
- * <code>GregorianCalendar.setGregorianChange(
- * new Date(Long.MIN_VALUE))</code>.</li>
- * <li>Its fields ERA, YEAR, MONTH, DAY_OF_MONTH, HOUR_OF_DAY,
- * MINUTE, SECOND and MILLISECOND are set using the method
- * <code>Calendar.set(int,int)</code></li>
- * </ul>
- *
- * @param timezone provide Timezone. <code>null</code> is a legal value.
- * @param aLocale provide explicit Locale. Use default GregorianCalendar locale if
- * value is <code>null</code>.
- * @param defaults provide default field values to use when corresponding
- * field for this instance is FIELD_UNDEFINED or null.
- * If <code>defaults</code>is <code>null</code> or a field
- * within the specified <code>defaults</code> is undefined,
- * just use <code>java.util.GregorianCalendar</code> defaults.
- * @return a java.util.GregorianCalendar conversion of this instance.
- */
- public abstract GregorianCalendar toGregorianCalendar(
- java.util.TimeZone timezone,
- java.util.Locale aLocale,
- XMLGregorianCalendar defaults);
-
- /**
- * <p>Returns a <code>java.util.TimeZone</code> for this class.</p>
- *
- * <p>If timezone field is defined for this instance,
- * returns TimeZone initialized with custom timezone id
- * of zoneoffset. If timezone field is undefined,
- * try the defaultZoneoffset that was passed in.
- * If defaultZoneoffset is FIELD_UNDEFINED, return
- * default timezone for this host.
- * (Same default as java.util.GregorianCalendar).</p>
- *
- * @param defaultZoneoffset default zoneoffset if this zoneoffset is
- * {@link DatatypeConstants#FIELD_UNDEFINED}.
- *
- * @return TimeZone for this.
- */
- public abstract TimeZone getTimeZone(int defaultZoneoffset);
-
-
-
- /**
- * <p>Creates and returns a copy of this object.</p>
- *
- * @return copy of this <code>Object</code>
- */
- public abstract Object clone();
-}
diff --git a/src/javax/xml/datatype/package.html b/src/javax/xml/datatype/package.html
deleted file mode 100644
index af81454..0000000
--- a/src/javax/xml/datatype/package.html
+++ /dev/null
@@ -1,170 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation. Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-
- <head>
- <title>javax.xml.xpath</title>
-
- <meta name="@author" content="mailto:Jeff.Suttor@Sun.com" />
- <meta name="@version" content="$Revision: 1.2 $, $Date: 2005/06/10 03:50:27 $" />
- <meta name="@see" content='<a href="http://www.w3.org/TR/xmlschema-2/#dateTime">W3C XML Schema 1.0 Part 2, Section 3.2.7-14</a>' />
- <meta name="@see" content='<a href="http://www.w3.org/TR/xpath-datamodel#dt-dayTimeDuration">XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration</a>' />
- <meta name="@see" content='<a href="http://www.w3.org/TR/xpath-datamodel#dt-yearMonthDuration">XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration</a>' />
- <meta name="@since" content="1.5" />
- </head>
-
- <body>
-
- <p>XML/Java Type Mappings.</p>
-
- <p><code>javax.xml.datatype</code>API provides XML/Java type mappings.</p>
-
- <p>The following XML standards apply:</p>
- <ul>
- <li><a href="http://www.w3.org/TR/xmlschema-2/#dateTime">W3C XML Schema 1.0 Part 2, Section 3.2.7-14</a></li>
- <li><a href="http://www.w3.org/TR/xpath-datamodel#dt-dayTimeDuration">XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration</a></li>
- <li><a href="http://www.w3.org/TR/xpath-datamodel#dt-yearMonthDuration">XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration</a></li>
- </ul>
-
- <hr />
-
- <table border="1" cellpadding="2">
- <thead>
- <tr>
- <th>W3C XML Schema Data Type</th>
- <th>Java Data Type</th>
- </tr>
- </thead>
-
- <tbody>
- <tr>
- <td>xs:date</td>
- <td>{@link javax.xml.datatype.XMLGregorianCalendar}</td>
- </tr>
- <tr>
- <td>xs:dateTime</td>
- <td>{@link javax.xml.datatype.XMLGregorianCalendar}</td>
- </tr>
- <tr>
- <td>xs:duration</td>
- <td>{@link javax.xml.datatype.Duration}</td>
- </tr>
- <tr>
- <td>xs:gDay</td>
- <td>{@link javax.xml.datatype.XMLGregorianCalendar}</td>
- </tr>
- <tr>
- <td>xs:gMonth </td>
- <td>{@link javax.xml.datatype.XMLGregorianCalendar}</td>
- </tr>
- <tr>
- <td>xs:gMonthDay</td>
- <td>{@link javax.xml.datatype.XMLGregorianCalendar}</td>
- </tr>
- <tr>
- <td>xs:gYear</td>
- <td>{@link javax.xml.datatype.XMLGregorianCalendar}</td>
- </tr>
- <tr>
- <td>xs:gYearMonth</td>
- <td>{@link javax.xml.datatype.XMLGregorianCalendar}</td>
- </tr>
- <tr>
- <td>xs:time</td>
- <td>{@link javax.xml.datatype.XMLGregorianCalendar}</td>
- </tr>
-
- </tbody>
- </table>
-
- <hr />
-
-
- <table border="1" cellpadding="2">
- <thead>
- <tr>
- <th>XQuery 1.0 and XPath 2.0 Data Model</th>
- <th>Java Data Type</th>
- </tr>
- </thead>
-
- <tbody>
- <tr>
- <td>xdt:dayTimeDuration</td>
- <td>{@link javax.xml.datatype.Duration}</td>
- </tr>
- <tr>
- <td>xdt:yearMonthDuration</td>
- <td>{@link javax.xml.datatype.Duration}</td>
- </tr>
- </tbody>
- </table>
-
- <hr />
-
- <p>
- W3C XML Schema data types that have a "<em>natural</em>" mapping to Java types are defined by
- JSR 31: Java&trade; Architecture for XML Binding (JAXB) Specification, Binding XML Schema to Java Representations.
- JAXB defined mappings for XML Schema built-in data types include:
- </p>
- <ul>
- <li>xs:anySimpleType</li>
- <li>xs:base64Binary</li>
- <li>xs:boolean</li>
- <li>xs:byte</li>
- <li>xs:decimal</li>
- <li>xs:double</li>
- <li>xs:float</li>
- <li>xs:hexBinary</li>
- <li>xs:int</li>
- <li>xs:integer</li>
- <li>xs:long</li>
- <li>xs:QName</li>
- <li>xs:short</li>
- <li>xs:string</li>
- <li>xs:unsignedByte</li>
- <li>xs:unsignedInt</li>
- <li>xs:unsignedShort</li>
- </ul>
-
- <hr />
-
-
- <ul>
- <li>Author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a></li>
- <li>See <a href="http://www.w3.org/TR/xmlschema-2/#dateTime">W3C XML Schema 1.0 Part 2, Section 3.2.7-14</a></li>
- <li>See <a href="http://www.w3.org/TR/xpath-datamodel#dt-dayTimeDuration">XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration</a></li>
- <li>See <a href="http://www.w3.org/TR/xpath-datamodel#dt-yearMonthDuration">XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration</a></li>
- <li>Since 1.5</li>
- </ul>
-
- <hr />
-
-
- </body>
-</html>
diff --git a/src/javax/xml/namespace/NamespaceContext.java b/src/javax/xml/namespace/NamespaceContext.java
deleted file mode 100644
index f1ce693..0000000
--- a/src/javax/xml/namespace/NamespaceContext.java
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.namespace;
-
-import java.util.Iterator;
-
-/**
- * <p>Interface for read only XML Namespace context processing.</p>
- *
- * <p>An XML Namespace has the properties:</p>
- * <ul>
- * <li>Namespace URI:
- * Namespace name expressed as a URI to which the prefix is bound</li>
- * <li>prefix: syntactically, this is the part of the attribute name
- * following the <code>XMLConstants.XMLNS_ATTRIBUTE</code>
- * ("xmlns") in the Namespace declaration</li>
- * </ul>
- * <p>example:
- * <code>&lt;element xmlns:prefix="http://Namespace-name-URI"&gt;</code></p>
- *
- * <p>All <code>get*(*)</code> methods operate in the current scope
- * for Namespace URI and prefix resolution.</p>
- *
- * <p>Note that a Namespace URI can be bound to
- * <strong>multiple</strong> prefixes in the current scope. This can
- * occur when multiple <code>XMLConstants.XMLNS_ATTRIBUTE</code>
- * ("xmlns") Namespace declarations occur in the same Start-Tag and
- * refer to the same Namespace URI. e.g.<br />
- * <pre>
- * &lt;element xmlns:prefix1="http://Namespace-name-URI"
- * xmlns:prefix2="http://Namespace-name-URI"&gt;
- * </pre>
- * This can also occur when the same Namespace URI is used in multiple
- * <code>XMLConstants.XMLNS_ATTRIBUTE</code> ("xmlns") Namespace
- * declarations in the logical parent element hierarchy. e.g.<br />
- * <pre>
- * &lt;parent xmlns:prefix1="http://Namespace-name-URI">
- * &lt;child xmlns:prefix2="http://Namespace-name-URI"&gt;
- * ...
- * &lt;/child&gt;
- * &lt;/parent&gt;
- * </pre></p>
- *
- * <p>A prefix can only be bound to a <strong>single</strong>
- * Namespace URI in the current scope.</p>
- *
- * @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a>
- * @see javax.xml.XMLConstants
- * javax.xml.XMLConstants for declarations of common XML values
- * @see <a href="http://www.w3.org/TR/xmlschema-2/#QName">
- * XML Schema Part2: Datatypes</a>
- * @see <a href="http://www.w3.org/TR/REC-xml-names/#ns-qualnames">
- * Namespaces in XML</a>
- * @see <a href="http://www.w3.org/XML/xml-names-19990114-errata">
- * Namespaces in XML Errata</a>
- * @since 1.5
- */
-
-public interface NamespaceContext {
-
- /**
- * <p>Get Namespace URI bound to a prefix in the current scope.</p>
- *
- * <p>When requesting a Namespace URI by prefix, the following
- * table describes the returned Namespace URI value for all
- * possible prefix values:</p>
- *
- * <table border="2" rules="all" cellpadding="4">
- * <thead>
- * <tr>
- * <td align="center" colspan="2">
- * <code>getNamespaceURI(prefix)</code>
- * return value for specified prefixes
- * </td>
- * </tr>
- * <tr>
- * <td>prefix parameter</td>
- * <td>Namespace URI return value</td>
- * </tr>
- * </thead>
- * <tbody>
- * <tr>
- * <td><code>DEFAULT_NS_PREFIX</code> ("")</td>
- * <td>default Namespace URI in the current scope or
- * <code>{@link
- * javax.xml.XMLConstants#NULL_NS_URI XMLConstants.NULL_NS_URI("")}
- * </code>
- * when there is no default Namespace URI in the current scope</td>
- * </tr>
- * <tr>
- * <td>bound prefix</td>
- * <td>Namespace URI bound to prefix in current scope</td>
- * </tr>
- * <tr>
- * <td>unbound prefix</td>
- * <td>
- * <code>{@link
- * javax.xml.XMLConstants#NULL_NS_URI XMLConstants.NULL_NS_URI("")}
- * </code>
- * </td>
- * </tr>
- * <tr>
- * <td><code>XMLConstants.XML_NS_PREFIX</code> ("xml")</td>
- * <td><code>XMLConstants.XML_NS_URI</code>
- * ("http://www.w3.org/XML/1998/namespace")</td>
- * </tr>
- * <tr>
- * <td><code>XMLConstants.XMLNS_ATTRIBUTE</code> ("xmlns")</td>
- * <td><code>XMLConstants.XMLNS_ATTRIBUTE_NS_URI</code>
- * ("http://www.w3.org/2000/xmlns/")</td>
- * </tr>
- * <tr>
- * <td><code>null</code></td>
- * <td><code>IllegalArgumentException</code> is thrown</td>
- * </tr>
- * </tbody>
- * </table>
- *
- * @param prefix prefix to look up
- *
- * @return Namespace URI bound to prefix in the current scope
- *
- * @throws IllegalArgumentException When <code>prefix</code> is
- * <code>null</code>
- */
- String getNamespaceURI(String prefix);
-
- /**
- * <p>Get prefix bound to Namespace URI in the current scope.</p>
- *
- * <p>To get all prefixes bound to a Namespace URI in the current
- * scope, use {@link #getPrefixes(String namespaceURI)}.</p>
- *
- * <p>When requesting a prefix by Namespace URI, the following
- * table describes the returned prefix value for all Namespace URI
- * values:</p>
- *
- * <table border="2" rules="all" cellpadding="4">
- * <thead>
- * <tr>
- * <th align="center" colspan="2">
- * <code>getPrefix(namespaceURI)</code> return value for
- * specified Namespace URIs
- * </th>
- * </tr>
- * <tr>
- * <th>Namespace URI parameter</th>
- * <th>prefix value returned</th>
- * </tr>
- * </thead>
- * <tbody>
- * <tr>
- * <td>&lt;default Namespace URI&gt;</td>
- * <td><code>XMLConstants.DEFAULT_NS_PREFIX</code> ("")
- * </td>
- * </tr>
- * <tr>
- * <td>bound Namespace URI</td>
- * <td>prefix bound to Namespace URI in the current scope,
- * if multiple prefixes are bound to the Namespace URI in
- * the current scope, a single arbitrary prefix, whose
- * choice is implementation dependent, is returned</td>
- * </tr>
- * <tr>
- * <td>unbound Namespace URI</td>
- * <td><code>null</code></td>
- * </tr>
- * <tr>
- * <td><code>XMLConstants.XML_NS_URI</code>
- * ("http://www.w3.org/XML/1998/namespace")</td>
- * <td><code>XMLConstants.XML_NS_PREFIX</code> ("xml")</td>
- * </tr>
- * <tr>
- * <td><code>XMLConstants.XMLNS_ATTRIBUTE_NS_URI</code>
- * ("http://www.w3.org/2000/xmlns/")</td>
- * <td><code>XMLConstants.XMLNS_ATTRIBUTE</code> ("xmlns")</td>
- * </tr>
- * <tr>
- * <td><code>null</code></td>
- * <td><code>IllegalArgumentException</code> is thrown</td>
- * </tr>
- * </tbody>
- * </table>
- *
- * @param namespaceURI URI of Namespace to lookup
- *
- * @return prefix bound to Namespace URI in current context
- *
- * @throws IllegalArgumentException When <code>namespaceURI</code> is
- * <code>null</code>
- */
- String getPrefix(String namespaceURI);
-
- /**
- * <p>Get all prefixes bound to a Namespace URI in the current
- * scope.</p>
- *
- * <p>An Iterator over String elements is returned in an arbitrary,
- * <strong>implementation dependent</strong>, order.</p>
- *
- * <p><strong>The <code>Iterator</code> is
- * <em>not</em> modifiable. e.g. the
- * <code>remove()</code> method will throw
- * <code>UnsupportedOperationException</code>.</strong></p>
- *
- * <p>When requesting prefixes by Namespace URI, the following
- * table describes the returned prefixes value for all Namespace
- * URI values:</p>
- *
- * <table border="2" rules="all" cellpadding="4">
- * <thead>
- * <tr>
- * <th align="center" colspan="2"><code>
- * getPrefixes(namespaceURI)</code> return value for
- * specified Namespace URIs</th>
- * </tr>
- * <tr>
- * <th>Namespace URI parameter</th>
- * <th>prefixes value returned</th>
- * </tr>
- * </thead>
- * <tbody>
- * <tr>
- * <td>bound Namespace URI,
- * including the &lt;default Namespace URI&gt;</td>
- * <td>
- * <code>Iterator</code> over prefixes bound to Namespace URI in
- * the current scope in an arbitrary,
- * <strong>implementation dependent</strong>,
- * order
- * </td>
- * </tr>
- * <tr>
- * <td>unbound Namespace URI</td>
- * <td>empty <code>Iterator</code></td>
- * </tr>
- * <tr>
- * <td><code>XMLConstants.XML_NS_URI</code>
- * ("http://www.w3.org/XML/1998/namespace")</td>
- * <td><code>Iterator</code> with one element set to
- * <code>XMLConstants.XML_NS_PREFIX</code> ("xml")</td>
- * </tr>
- * <tr>
- * <td><code>XMLConstants.XMLNS_ATTRIBUTE_NS_URI</code>
- * ("http://www.w3.org/2000/xmlns/")</td>
- * <td><code>Iterator</code> with one element set to
- * <code>XMLConstants.XMLNS_ATTRIBUTE</code> ("xmlns")</td>
- * </tr>
- * <tr>
- * <td><code>null</code></td>
- * <td><code>IllegalArgumentException</code> is thrown</td>
- * </tr>
- * </tbody>
- * </table>
- *
- * @param namespaceURI URI of Namespace to lookup
- *
- * @return <code>Iterator</code> for all prefixes bound to the
- * Namespace URI in the current scope
- *
- * @throws IllegalArgumentException When <code>namespaceURI</code> is
- * <code>null</code>
- */
- Iterator getPrefixes(String namespaceURI);
-}
diff --git a/src/javax/xml/namespace/QName.java b/src/javax/xml/namespace/QName.java
deleted file mode 100644
index 981a8b2..0000000
--- a/src/javax/xml/namespace/QName.java
+++ /dev/null
@@ -1,516 +0,0 @@
-/*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.namespace;
-
-import java.io.Serializable;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-import javax.xml.XMLConstants;
-
-/**
- * <p><code>QName</code> represents a <strong>qualified name</strong>
- * as defined in the XML specifications: <a
- * href="http://www.w3.org/TR/xmlschema-2/#QName">XML Schema Part2:
- * Datatypes specification</a>, <a
- * href="http://www.w3.org/TR/REC-xml-names/#ns-qualnames">Namespaces
- * in XML</a>, <a
- * href="http://www.w3.org/XML/xml-names-19990114-errata">Namespaces
- * in XML Errata</a>.</p>
- *
- * <p>The value of a <code>QName</code> contains a <strong>Namespace
- * URI</strong>, <strong>local part</strong> and
- * <strong>prefix</strong>.</p>
- *
- * <p>The prefix is included in <code>QName</code> to retain lexical
- * information <strong><em>when present</em></strong> in an {@link
- * javax.xml.transform.Source XML input source}. The prefix is
- * <strong><em>NOT</em></strong> used in {@link #equals(Object)
- * QName.equals(Object)} or to compute the {@link #hashCode()
- * QName.hashCode()}. Equality and the hash code are defined using
- * <strong><em>only</em></strong> the Namespace URI and local part.</p>
- *
- * <p>If not specified, the Namespace URI is set to {@link
- * javax.xml.XMLConstants#NULL_NS_URI XMLConstants.NULL_NS_URI}.
- * If not specified, the prefix is set to {@link
- * javax.xml.XMLConstants#DEFAULT_NS_PREFIX
- * XMLConstants.DEFAULT_NS_PREFIX}.</p>
- *
- * <p><code>QName</code> is immutable.</p>
- *
- * @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a>
- * @version $Revision: 1.8 $, $Date: 2010/03/18 03:06:17 $
- * @see <a href="http://www.w3.org/TR/xmlschema-2/#QName">
- * XML Schema Part2: Datatypes specification</a>
- * @see <a href="http://www.w3.org/TR/REC-xml-names/#ns-qualnames">
- * Namespaces in XML</a>
- * @see <a href="http://www.w3.org/XML/xml-names-19990114-errata">
- * Namespaces in XML Errata</a>
- * @since 1.5
- */
-
-public class QName implements Serializable {
-
- /**
- * <p>Stream Unique Identifier.</p>
- *
- * <p>Due to a historical defect, QName was released with multiple
- * serialVersionUID values even though its serialization was the
- * same.</p>
- *
- * <p>To workaround this issue, serialVersionUID is set with either
- * a default value or a compatibility value. To use the
- * compatiblity value, set the system property:</p>
- *
- * <code>com.sun.xml.namespace.QName.useCompatibleSerialVersionUID=1.0</code>
- *
- * <p>This workaround was inspired by classes in the javax.management
- * package, e.g. ObjectName, etc.
- * See CR6267224 for original defect report.</p>
- */
- private static final long serialVersionUID;
- /**
- * <p>Default <code>serialVersionUID</code> value.</p>
- */
- private static final long defaultSerialVersionUID = -9120448754896609940L;
- /**
- * <p>Compatibility <code>serialVersionUID</code> value.</p>
- */
- private static final long compatibleSerialVersionUID = 4418622981026545151L;
- /**
- * <p>Flag to use default or campatible serialVersionUID.</p>
- */
- private static boolean useDefaultSerialVersionUID = true;
- static {
- try {
- // use a privileged block as reading a system property
- String valueUseCompatibleSerialVersionUID = (String) AccessController.doPrivileged(
- new PrivilegedAction() {
- public Object run() {
- return System.getProperty("com.sun.xml.namespace.QName.useCompatibleSerialVersionUID");
- }
- }
- );
- useDefaultSerialVersionUID = (valueUseCompatibleSerialVersionUID != null && valueUseCompatibleSerialVersionUID.equals("1.0")) ? false : true;
- } catch (Exception exception) {
- // use default if any Exceptions
- useDefaultSerialVersionUID = true;
- }
-
- // set serialVersionUID to desired value
- if (useDefaultSerialVersionUID) {
- serialVersionUID = defaultSerialVersionUID;
- } else {
- serialVersionUID = compatibleSerialVersionUID;
- }
- }
-
- /**
- * <p>Namespace URI of this <code>QName</code>.</p>
- */
- private final String namespaceURI;
-
- /**
- * <p>local part of this <code>QName</code>.</p>
- */
- private final String localPart;
-
- /**
- * <p>prefix of this <code>QName</code>.</p>
- */
- private final String prefix;
-
- /**
- * <p><code>QName</code> constructor specifying the Namespace URI
- * and local part.</p>
- *
- * <p>If the Namespace URI is <code>null</code>, it is set to
- * {@link javax.xml.XMLConstants#NULL_NS_URI
- * XMLConstants.NULL_NS_URI}. This value represents no
- * explicitly defined Namespace as defined by the <a
- * href="http://www.w3.org/TR/REC-xml-names/#ns-qualnames">Namespaces
- * in XML</a> specification. This action preserves compatible
- * behavior with QName 1.0. Explicitly providing the {@link
- * javax.xml.XMLConstants#NULL_NS_URI
- * XMLConstants.NULL_NS_URI} value is the preferred coding
- * style.</p>
- *
- * <p>If the local part is <code>null</code> an
- * <code>IllegalArgumentException</code> is thrown.
- * A local part of "" is allowed to preserve
- * compatible behavior with QName 1.0. </p>
- *
- * <p>When using this constructor, the prefix is set to {@link
- * javax.xml.XMLConstants#DEFAULT_NS_PREFIX
- * XMLConstants.DEFAULT_NS_PREFIX}.</p>
- *
- * <p>The Namespace URI is not validated as a
- * <a href="http://www.ietf.org/rfc/rfc2396.txt">URI reference</a>.
- * The local part is not validated as a
- * <a href="http://www.w3.org/TR/REC-xml-names/#NT-NCName">NCName</a>
- * as specified in <a href="http://www.w3.org/TR/REC-xml-names/">Namespaces
- * in XML</a>.</p>
- *
- * @param namespaceURI Namespace URI of the <code>QName</code>
- * @param localPart local part of the <code>QName</code>
- *
- * @throws IllegalArgumentException When <code>localPart</code> is
- * <code>null</code>
- *
- * @see #QName(String namespaceURI, String localPart, String
- * prefix) QName(String namespaceURI, String localPart, String
- * prefix)
- */
- public QName(final String namespaceURI, final String localPart) {
- this(namespaceURI, localPart, XMLConstants.DEFAULT_NS_PREFIX);
- }
-
- /**
- * <p><code>QName</code> constructor specifying the Namespace URI,
- * local part and prefix.</p>
- *
- * <p>If the Namespace URI is <code>null</code>, it is set to
- * {@link javax.xml.XMLConstants#NULL_NS_URI
- * XMLConstants.NULL_NS_URI}. This value represents no
- * explicitly defined Namespace as defined by the <a
- * href="http://www.w3.org/TR/REC-xml-names/#ns-qualnames">Namespaces
- * in XML</a> specification. This action preserves compatible
- * behavior with QName 1.0. Explicitly providing the {@link
- * javax.xml.XMLConstants#NULL_NS_URI
- * XMLConstants.NULL_NS_URI} value is the preferred coding
- * style.</p>
- *
- * <p>If the local part is <code>null</code> an
- * <code>IllegalArgumentException</code> is thrown.
- * A local part of "" is allowed to preserve
- * compatible behavior with QName 1.0. </p>
- *
- * <p>If the prefix is <code>null</code>, an
- * <code>IllegalArgumentException</code> is thrown. Use {@link
- * javax.xml.XMLConstants#DEFAULT_NS_PREFIX
- * XMLConstants.DEFAULT_NS_PREFIX} to explicitly indicate that no
- * prefix is present or the prefix is not relevant.</p>
- *
- * <p>The Namespace URI is not validated as a
- * <a href="http://www.ietf.org/rfc/rfc2396.txt">URI reference</a>.
- * The local part and prefix are not validated as a
- * <a href="http://www.w3.org/TR/REC-xml-names/#NT-NCName">NCName</a>
- * as specified in <a href="http://www.w3.org/TR/REC-xml-names/">Namespaces
- * in XML</a>.</p>
- *
- * @param namespaceURI Namespace URI of the <code>QName</code>
- * @param localPart local part of the <code>QName</code>
- * @param prefix prefix of the <code>QName</code>
- *
- * @throws IllegalArgumentException When <code>localPart</code>
- * or <code>prefix</code> is <code>null</code>
- */
- public QName(String namespaceURI, String localPart, String prefix) {
-
- // map null Namespace URI to default
- // to preserve compatibility with QName 1.0
- if (namespaceURI == null) {
- this.namespaceURI = XMLConstants.NULL_NS_URI;
- } else {
- this.namespaceURI = namespaceURI;
- }
-
- // local part is required.
- // "" is allowed to preserve compatibility with QName 1.0
- if (localPart == null) {
- throw new IllegalArgumentException(
- "local part cannot be \"null\" when creating a QName");
- }
- this.localPart = localPart;
-
- // prefix is required
- if (prefix == null) {
- throw new IllegalArgumentException(
- "prefix cannot be \"null\" when creating a QName");
- }
- this.prefix = prefix;
- }
-
- /**
- * <p><code>QName</code> constructor specifying the local part.</p>
- *
- * <p>If the local part is <code>null</code> an
- * <code>IllegalArgumentException</code> is thrown.
- * A local part of "" is allowed to preserve
- * compatible behavior with QName 1.0. </p>
- *
- * <p>When using this constructor, the Namespace URI is set to
- * {@link javax.xml.XMLConstants#NULL_NS_URI
- * XMLConstants.NULL_NS_URI} and the prefix is set to {@link
- * javax.xml.XMLConstants#DEFAULT_NS_PREFIX
- * XMLConstants.DEFAULT_NS_PREFIX}.</p>
- *
- * <p><em>In an XML context, all Element and Attribute names exist
- * in the context of a Namespace. Making this explicit during the
- * construction of a <code>QName</code> helps prevent hard to
- * diagnosis XML validity errors. The constructors {@link
- * #QName(String namespaceURI, String localPart) QName(String
- * namespaceURI, String localPart)} and
- * {@link #QName(String namespaceURI, String localPart, String prefix)}
- * are preferred.</em></p>
- *
- * <p>The local part is not validated as a
- * <a href="http://www.w3.org/TR/REC-xml-names/#NT-NCName">NCName</a>
- * as specified in <a href="http://www.w3.org/TR/REC-xml-names/">Namespaces
- * in XML</a>.</p>
- *
- * @param localPart local part of the <code>QName</code>
- *
- * @throws IllegalArgumentException When <code>localPart</code> is
- * <code>null</code>
- *
- * @see #QName(String namespaceURI, String localPart) QName(String
- * namespaceURI, String localPart)
- * @see #QName(String namespaceURI, String localPart, String
- * prefix) QName(String namespaceURI, String localPart, String
- * prefix)
- */
- public QName(String localPart) {
- this(
- XMLConstants.NULL_NS_URI,
- localPart,
- XMLConstants.DEFAULT_NS_PREFIX);
- }
-
- /**
- * <p>Get the Namespace URI of this <code>QName</code>.</p>
- *
- * @return Namespace URI of this <code>QName</code>
- */
- public String getNamespaceURI() {
- return namespaceURI;
- }
-
- /**
- * <p>Get the local part of this <code>QName</code>.</p>
- *
- * @return local part of this <code>QName</code>
- */
- public String getLocalPart() {
- return localPart;
- }
-
- /**
- * <p>Get the prefix of this <code>QName</code>.</p>
- *
- * <p>The prefix assigned to a <code>QName</code> might
- * <strong><em>NOT</em></strong> be valid in a different
- * context. For example, a <code>QName</code> may be assigned a
- * prefix in the context of parsing a document but that prefix may
- * be invalid in the context of a different document.</p>
- *
- * @return prefix of this <code>QName</code>
- */
- public String getPrefix() {
- return prefix;
- }
-
- /**
- * <p>Test this <code>QName</code> for equality with another
- * <code>Object</code>.</p>
- *
- * <p>If the <code>Object</code> to be tested is not a
- * <code>QName</code> or is <code>null</code>, then this method
- * returns <code>false</code>.</p>
- *
- * <p>Two <code>QName</code>s are considered equal if and only if
- * both the Namespace URI and local part are equal. This method
- * uses <code>String.equals()</code> to check equality of the
- * Namespace URI and local part. The prefix is
- * <strong><em>NOT</em></strong> used to determine equality.</p>
- *
- * <p>This method satisfies the general contract of {@link
- * java.lang.Object#equals(Object) Object.equals(Object)}</p>
- *
- * @param objectToTest the <code>Object</code> to test for
- * equality with this <code>QName</code>
- * @return <code>true</code> if the given <code>Object</code> is
- * equal to this <code>QName</code> else <code>false</code>
- */
- public final boolean equals(Object objectToTest) {
- if (objectToTest == this) {
- return true;
- }
-
- if (objectToTest == null || !(objectToTest instanceof QName)) {
- return false;
- }
-
- QName qName = (QName) objectToTest;
-
- return localPart.equals(qName.localPart)
- && namespaceURI.equals(qName.namespaceURI);
- }
-
- /**
- * <p>Generate the hash code for this <code>QName</code>.</p>
- *
- * <p>The hash code is calculated using both the Namespace URI and
- * the local part of the <code>QName</code>. The prefix is
- * <strong><em>NOT</em></strong> used to calculate the hash
- * code.</p>
- *
- * <p>This method satisfies the general contract of {@link
- * java.lang.Object#hashCode() Object.hashCode()}.</p>
- *
- * @return hash code for this <code>QName</code> <code>Object</code>
- */
- public final int hashCode() {
- return namespaceURI.hashCode() ^ localPart.hashCode();
- }
-
- /**
- * <p><code>String</code> representation of this
- * <code>QName</code>.</p>
- *
- * <p>The commonly accepted way of representing a <code>QName</code>
- * as a <code>String</code> was
- * <a href="http://jclark.com/xml/xmlns.htm">defined</a>
- * by James Clark. Although this is not a <em>standard</em>
- * specification, it is in common use, e.g. {@link
- * javax.xml.transform.Transformer#setParameter(String name, Object value)}.
- * This implementation represents a <code>QName</code> as:
- * "{" + Namespace URI + "}" + local part. If the Namespace URI
- * <code>.equals(XMLConstants.NULL_NS_URI)</code>, only the
- * local part is returned. An appropriate use of this method is
- * for debugging or logging for human consumption.</p>
- *
- * <p>Note the prefix value is <strong><em>NOT</em></strong>
- * returned as part of the <code>String</code> representation.</p>
- *
- * <p>This method satisfies the general contract of {@link
- * java.lang.Object#toString() Object.toString()}.</p>
- *
- * @return <code>String</code> representation of this <code>QName</code>
- */
- public String toString() {
- if (namespaceURI.equals(XMLConstants.NULL_NS_URI)) {
- return localPart;
- } else {
- return "{" + namespaceURI + "}" + localPart;
- }
- }
-
- /**
- * <p><code>QName</code> derived from parsing the formatted
- * <code>String</code>.</p>
- *
- * <p>If the <code>String</code> is <code>null</code> or does not conform to
- * {@link #toString() QName.toString()} formatting, an
- * <code>IllegalArgumentException</code> is thrown.</p>
- *
- * <p><em>The <code>String</code> <strong>MUST</strong> be in the
- * form returned by {@link #toString() QName.toString()}.</em></p>
- *
- * <p>The commonly accepted way of representing a <code>QName</code>
- * as a <code>String</code> was
- * <a href="http://jclark.com/xml/xmlns.htm">defined</a>
- * by James Clark. Although this is not a <em>standard</em>
- * specification, it is in common use, e.g. {@link
- * javax.xml.transform.Transformer#setParameter(String name, Object value)}.
- * This implementation parses a <code>String</code> formatted
- * as: "{" + Namespace URI + "}" + local part. If the Namespace
- * URI <code>.equals(XMLConstants.NULL_NS_URI)</code>, only the
- * local part should be provided.</p>
- *
- * <p>The prefix value <strong><em>CANNOT</em></strong> be
- * represented in the <code>String</code> and will be set to
- * {@link javax.xml.XMLConstants#DEFAULT_NS_PREFIX
- * XMLConstants.DEFAULT_NS_PREFIX}.</p>
- *
- * <p>This method does not do full validation of the resulting
- * <code>QName</code>.
- * <p>The Namespace URI is not validated as a
- * <a href="http://www.ietf.org/rfc/rfc2396.txt">URI reference</a>.
- * The local part is not validated as a
- * <a href="http://www.w3.org/TR/REC-xml-names/#NT-NCName">NCName</a>
- * as specified in
- * <a href="http://www.w3.org/TR/REC-xml-names/">Namespaces in XML</a>.</p>
- *
- * @param qNameAsString <code>String</code> representation
- * of the <code>QName</code>
- *
- * @throws IllegalArgumentException When <code>qNameAsString</code> is
- * <code>null</code> or malformed
- *
- * @return <code>QName</code> corresponding to the given <code>String</code>
- * @see #toString() QName.toString()
- */
- public static QName valueOf(String qNameAsString) {
-
- // null is not valid
- if (qNameAsString == null) {
- throw new IllegalArgumentException(
- "cannot create QName from \"null\" or \"\" String");
- }
-
- // "" local part is valid to preserve compatible behavior with QName 1.0
- if (qNameAsString.length() == 0) {
- return new QName(
- XMLConstants.NULL_NS_URI,
- qNameAsString,
- XMLConstants.DEFAULT_NS_PREFIX);
- }
-
- // local part only?
- if (qNameAsString.charAt(0) != '{') {
- return new QName(
- XMLConstants.NULL_NS_URI,
- qNameAsString,
- XMLConstants.DEFAULT_NS_PREFIX);
- }
-
- // Namespace URI improperly specified?
- if (qNameAsString.startsWith("{" + XMLConstants.NULL_NS_URI + "}")) {
- throw new IllegalArgumentException(
- "Namespace URI .equals(XMLConstants.NULL_NS_URI), "
- + ".equals(\"" + XMLConstants.NULL_NS_URI + "\"), "
- + "only the local part, "
- + "\""
- + qNameAsString.substring(2 + XMLConstants.NULL_NS_URI.length())
- + "\", "
- + "should be provided.");
- }
-
- // Namespace URI and local part specified
- int endOfNamespaceURI = qNameAsString.indexOf('}');
- if (endOfNamespaceURI == -1) {
- throw new IllegalArgumentException(
- "cannot create QName from \""
- + qNameAsString
- + "\", missing closing \"}\"");
- }
- return new QName(
- qNameAsString.substring(1, endOfNamespaceURI),
- qNameAsString.substring(endOfNamespaceURI + 1),
- XMLConstants.DEFAULT_NS_PREFIX);
- }
-}
diff --git a/src/javax/xml/namespace/package.html b/src/javax/xml/namespace/package.html
deleted file mode 100644
index b5b02ed..0000000
--- a/src/javax/xml/namespace/package.html
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation. Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-
-<!DOCTYPE html
- PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml">
-
-<head>
- <title>javax.xml.namespace</title>
-
- <meta name="CVS"
- content="$Id: package.html,v 1.2 2005/06/10 03:50:28 jeffsuttor Exp $" />
- <meta name="AUTHOR"
- content="Jeff.Suttor@Sun.com" />
-</head>
-
-<body>
-
-<p>XML Namespace processing.</p>
-
-<p>The following XML standards apply:</p>
-<ul>
- <li><a href="http://www.w3.org/TR/xmlschema-2/#QName">XML Schema Part2: Datatypes specification</a></li>
- <li><a href="http://www.w3.org/TR/REC-xml-names/#ns-qualnames">Namespaces in XML</a></li>
- <li><a href="http://www.w3.org/XML/xml-names-19990114-errata">Namespaces in XML Errata</a></li>
-</ul>
-
-</body>
-</html>
diff --git a/src/javax/xml/parsers/DocumentBuilder.java b/src/javax/xml/parsers/DocumentBuilder.java
deleted file mode 100644
index 33c325d..0000000
--- a/src/javax/xml/parsers/DocumentBuilder.java
+++ /dev/null
@@ -1,348 +0,0 @@
-/*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.parsers;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-
-import javax.xml.validation.Schema;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.DOMImplementation;
-
-import org.xml.sax.EntityResolver;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
-/**
- * Defines the API to obtain DOM Document instances from an XML
- * document. Using this class, an application programmer can obtain a
- * {@link Document} from XML.<p>
- *
- * An instance of this class can be obtained from the
- * {@link DocumentBuilderFactory#newDocumentBuilder()} method. Once
- * an instance of this class is obtained, XML can be parsed from a
- * variety of input sources. These input sources are InputStreams,
- * Files, URLs, and SAX InputSources.<p>
- *
- * Note that this class reuses several classes from the SAX API. This
- * does not require that the implementor of the underlying DOM
- * implementation use a SAX parser to parse XML document into a
- * <code>Document</code>. It merely requires that the implementation
- * communicate with the application using these existing APIs.
- *
- * @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a>
- */
-
-public abstract class DocumentBuilder {
-
-
- /** Protected constructor */
- protected DocumentBuilder () {
- }
-
- /**
- * <p>Reset this <code>DocumentBuilder</code> to its original configuration.</p>
- *
- * <p><code>DocumentBuilder</code> is reset to the same state as when it was created with
- * {@link DocumentBuilderFactory#newDocumentBuilder()}.
- * <code>reset()</code> is designed to allow the reuse of existing <code>DocumentBuilder</code>s
- * thus saving resources associated with the creation of new <code>DocumentBuilder</code>s.</p>
- *
- * <p>The reset <code>DocumentBuilder</code> is not guaranteed to have the same {@link EntityResolver} or {@link ErrorHandler}
- * <code>Object</code>s, e.g. {@link Object#equals(Object obj)}. It is guaranteed to have a functionally equal
- * <code>EntityResolver</code> and <code>ErrorHandler</code>.</p>
- *
- * @throws UnsupportedOperationException When implementation does not
- * override this method.
- *
- * @since 1.5
- */
- public void reset() {
-
- // implementors should override this method
- throw new UnsupportedOperationException(
- "This DocumentBuilder, \"" + this.getClass().getName() + "\", does not support the reset functionality."
- + " Specification \"" + this.getClass().getPackage().getSpecificationTitle() + "\""
- + " version \"" + this.getClass().getPackage().getSpecificationVersion() + "\""
- );
- }
-
- /**
- * Parse the content of the given <code>InputStream</code> as an XML
- * document and return a new DOM {@link Document} object.
- * An <code>IllegalArgumentException</code> is thrown if the
- * <code>InputStream</code> is null.
- *
- * @param is InputStream containing the content to be parsed.
- *
- * @return <code>Document</code> result of parsing the
- * <code>InputStream</code>
- *
- * @throws IOException If any IO errors occur.
- * @throws SAXException If any parse errors occur.
- * @throws IllegalArgumentException When <code>is</code> is <code>null</code>
- *
- * @see org.xml.sax.DocumentHandler
- */
-
- public Document parse(InputStream is)
- throws SAXException, IOException {
- if (is == null) {
- throw new IllegalArgumentException("InputStream cannot be null");
- }
-
- InputSource in = new InputSource(is);
- return parse(in);
- }
-
- /**
- * Parse the content of the given <code>InputStream</code> as an
- * XML document and return a new DOM {@link Document} object.
- * An <code>IllegalArgumentException</code> is thrown if the
- * <code>InputStream</code> is null.
- *
- * @param is InputStream containing the content to be parsed.
- * @param systemId Provide a base for resolving relative URIs.
- *
- * @return A new DOM Document object.
- *
- * @throws IOException If any IO errors occur.
- * @throws SAXException If any parse errors occur.
- * @throws IllegalArgumentException When <code>is</code> is <code>null</code>
- *
- * @see org.xml.sax.DocumentHandler
- */
-
- public Document parse(InputStream is, String systemId)
- throws SAXException, IOException {
- if (is == null) {
- throw new IllegalArgumentException("InputStream cannot be null");
- }
-
- InputSource in = new InputSource(is);
- in.setSystemId(systemId);
- return parse(in);
- }
-
- /**
- * Parse the content of the given URI as an XML document
- * and return a new DOM {@link Document} object.
- * An <code>IllegalArgumentException</code> is thrown if the
- * URI is <code>null</code> null.
- *
- * @param uri The location of the content to be parsed.
- *
- * @return A new DOM Document object.
- *
- * @throws IOException If any IO errors occur.
- * @throws SAXException If any parse errors occur.
- * @throws IllegalArgumentException When <code>uri</code> is <code>null</code>
- *
- * @see org.xml.sax.DocumentHandler
- */
-
- public Document parse(String uri)
- throws SAXException, IOException {
- if (uri == null) {
- throw new IllegalArgumentException("URI cannot be null");
- }
-
- InputSource in = new InputSource(uri);
- return parse(in);
- }
-
- /**
- * Parse the content of the given file as an XML document
- * and return a new DOM {@link Document} object.
- * An <code>IllegalArgumentException</code> is thrown if the
- * <code>File</code> is <code>null</code> null.
- *
- * @param f The file containing the XML to parse.
- *
- * @throws IOException If any IO errors occur.
- * @throws SAXException If any parse errors occur.
- * @throws IllegalArgumentException When <code>f</code> is <code>null</code>
- *
- * @see org.xml.sax.DocumentHandler
- * @return A new DOM Document object.
- */
-
- public Document parse(File f) throws SAXException, IOException {
- if (f == null) {
- throw new IllegalArgumentException("File cannot be null");
- }
-
- //convert file to appropriate URI, f.toURI().toASCIIString()
- //converts the URI to string as per rule specified in
- //RFC 2396,
- InputSource in = new InputSource(f.toURI().toASCIIString());
- return parse(in);
- }
-
- /**
- * Parse the content of the given input source as an XML document
- * and return a new DOM {@link Document} object.
- * An <code>IllegalArgumentException</code> is thrown if the
- * <code>InputSource</code> is <code>null</code> null.
- *
- * @param is InputSource containing the content to be parsed.
- *
- * @return A new DOM Document object.
- *
- * @throws IOException If any IO errors occur.
- * @throws SAXException If any parse errors occur.
- * @throws IllegalArgumentException When <code>is</code> is <code>null</code>
- *
- * @see org.xml.sax.DocumentHandler
- */
-
- public abstract Document parse(InputSource is)
- throws SAXException, IOException;
-
-
- /**
- * Indicates whether or not this parser is configured to
- * understand namespaces.
- *
- * @return true if this parser is configured to understand
- * namespaces; false otherwise.
- */
-
- public abstract boolean isNamespaceAware();
-
- /**
- * Indicates whether or not this parser is configured to
- * validate XML documents.
- *
- * @return true if this parser is configured to validate
- * XML documents; false otherwise.
- */
-
- public abstract boolean isValidating();
-
- /**
- * Specify the {@link EntityResolver} to be used to resolve
- * entities present in the XML document to be parsed. Setting
- * this to <code>null</code> will result in the underlying
- * implementation using it's own default implementation and
- * behavior.
- *
- * @param er The <code>EntityResolver</code> to be used to resolve entities
- * present in the XML document to be parsed.
- */
-
- public abstract void setEntityResolver(EntityResolver er);
-
- /**
- * Specify the {@link ErrorHandler} to be used by the parser.
- * Setting this to <code>null</code> will result in the underlying
- * implementation using it's own default implementation and
- * behavior.
- *
- * @param eh The <code>ErrorHandler</code> to be used by the parser.
- */
-
- public abstract void setErrorHandler(ErrorHandler eh);
-
- /**
- * Obtain a new instance of a DOM {@link Document} object
- * to build a DOM tree with.
- *
- * @return A new instance of a DOM Document object.
- */
-
- public abstract Document newDocument();
-
- /**
- * Obtain an instance of a {@link DOMImplementation} object.
- *
- * @return A new instance of a <code>DOMImplementation</code>.
- */
-
- public abstract DOMImplementation getDOMImplementation();
-
- /** <p>Get current state of canonicalization.</p>
- *
- * @return current state canonicalization control
- */
- /*
- public boolean getCanonicalization() {
- return canonicalState;
- }
- */
-
- /** <p>Get a reference to the the {@link Schema} being used by
- * the XML processor.</p>
- *
- * <p>If no schema is being used, <code>null</code> is returned.</p>
- *
- * @return {@link Schema} being used or <code>null</code>
- * if none in use
- *
- * @throws UnsupportedOperationException When implementation does not
- * override this method
- *
- * @since 1.5
- */
- public Schema getSchema() {
- throw new UnsupportedOperationException(
- "This parser does not support specification \""
- + this.getClass().getPackage().getSpecificationTitle()
- + "\" version \""
- + this.getClass().getPackage().getSpecificationVersion()
- + "\""
- );
- }
-
-
- /**
- * <p>Get the XInclude processing mode for this parser.</p>
- *
- * @return
- * the return value of
- * the {@link DocumentBuilderFactory#isXIncludeAware()}
- * when this parser was created from factory.
- *
- * @throws UnsupportedOperationException When implementation does not
- * override this method
- *
- * @since 1.5
- *
- * @see DocumentBuilderFactory#setXIncludeAware(boolean)
- */
- public boolean isXIncludeAware() {
- throw new UnsupportedOperationException(
- "This parser does not support specification \""
- + this.getClass().getPackage().getSpecificationTitle()
- + "\" version \""
- + this.getClass().getPackage().getSpecificationVersion()
- + "\""
- );
- }
-}
diff --git a/src/javax/xml/parsers/DocumentBuilderFactory.java b/src/javax/xml/parsers/DocumentBuilderFactory.java
deleted file mode 100644
index 04265f6..0000000
--- a/src/javax/xml/parsers/DocumentBuilderFactory.java
+++ /dev/null
@@ -1,607 +0,0 @@
-/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.parsers;
-
-import javax.xml.validation.Schema;
-
-/**
- * Defines a factory API that enables applications to obtain a
- * parser that produces DOM object trees from XML documents.
- *
- * @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a>
- * @author <a href="mailto:Neeraj.Bajaj@sun.com">Neeraj Bajaj</a>
- *
- * @version $Revision: 1.9 $, $Date: 2010/05/25 16:19:44 $
-
- */
-
-public abstract class DocumentBuilderFactory {
-
- private boolean validating = false;
- private boolean namespaceAware = false;
- private boolean whitespace = false;
- private boolean expandEntityRef = true;
- private boolean ignoreComments = false;
- private boolean coalescing = false;
-
- /**
- * <p>Protected constructor to prevent instantiation.
- * Use {@link #newInstance()}.</p>
- */
- protected DocumentBuilderFactory () {
- }
-
- /**
- * Obtain a new instance of a
- * <code>DocumentBuilderFactory</code>. This static method creates
- * a new factory instance.
- * This method uses the following ordered lookup procedure to determine
- * the <code>DocumentBuilderFactory</code> implementation class to
- * load:
- * <ul>
- * <li>
- * Use the <code>javax.xml.parsers.DocumentBuilderFactory</code> system
- * property.
- * </li>
- * <li>
- * Use the properties file "lib/jaxp.properties" in the JRE directory.
- * This configuration file is in standard <code>java.util.Properties
- * </code> format and contains the fully qualified name of the
- * implementation class with the key being the system property defined
- * above.
- *
- * The jaxp.properties file is read only once by the JAXP implementation
- * and it's values are then cached for future use. If the file does not exist
- * when the first attempt is made to read from it, no further attempts are
- * made to check for its existence. It is not possible to change the value
- * of any property in jaxp.properties after it has been read for the first time.
- * </li>
- * <li>
- * Uses the service-provider loading facilities, defined by the
- * {@link java.util.ServiceLoader} class, to attempt to locate and load an
- * implementation of the service using the {@linkplain
- * java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}:
- * the service-provider loading facility will use the {@linkplain
- * java.lang.Thread#getContextClassLoader() current thread's context class loader}
- * to attempt to load the service. If the context class
- * loader is null, the {@linkplain
- * ClassLoader#getSystemClassLoader() system class loader} will be used.
- * </li>
- * <li>
- * Otherwise, the system-default implementation is returned.
- * </li>
- * </ul>
- *
- * Once an application has obtained a reference to a
- * <code>DocumentBuilderFactory</code> it can use the factory to
- * configure and obtain parser instances.
- *
- *
- * <h2>Tip for Trouble-shooting</h2>
- * <p>Setting the <code>jaxp.debug</code> system property will cause
- * this method to print a lot of debug messages
- * to <code>System.err</code> about what it is doing and where it is looking at.</p>
- *
- * <p> If you have problems loading {@link DocumentBuilder}s, try:</p>
- * <pre>
- * java -Djaxp.debug=1 YourProgram ....
- * </pre>
- *
- * @return New instance of a <code>DocumentBuilderFactory</code>
- *
- * @throws FactoryConfigurationError in case of {@linkplain
- * java.util.ServiceConfigurationError service configuration error} or if
- * the implementation is not available or cannot be instantiated.
- */
- public static DocumentBuilderFactory newInstance() {
- return FactoryFinder.find(
- /* The default property name according to the JAXP spec */
- DocumentBuilderFactory.class, // "javax.xml.parsers.DocumentBuilderFactory"
- /* The fallback implementation class name */
- "com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl");
- }
-
- /**
- * <p>Obtain a new instance of a <code>DocumentBuilderFactory</code> from class name.
- * This function is useful when there are multiple providers in the classpath.
- * It gives more control to the application as it can specify which provider
- * should be loaded.</p>
- *
- * <p>Once an application has obtained a reference to a <code>DocumentBuilderFactory</code>
- * it can use the factory to configure and obtain parser instances.</p>
- *
- *
- * <h2>Tip for Trouble-shooting</h2>
- * <p>Setting the <code>jaxp.debug</code> system property will cause
- * this method to print a lot of debug messages
- * to <code>System.err</code> about what it is doing and where it is looking at.</p>
- *
- * <p> If you have problems try:</p>
- * <pre>
- * java -Djaxp.debug=1 YourProgram ....
- * </pre>
- *
- * @param factoryClassName fully qualified factory class name that provides implementation of <code>javax.xml.parsers.DocumentBuilderFactory</code>.
- *
- * @param classLoader <code>ClassLoader</code> used to load the factory class. If <code>null</code>
- * current <code>Thread</code>'s context classLoader is used to load the factory class.
- *
- * @return New instance of a <code>DocumentBuilderFactory</code>
- *
- * @throws FactoryConfigurationError if <code>factoryClassName</code> is <code>null</code>, or
- * the factory class cannot be loaded, instantiated.
- *
- * @see #newInstance()
- *
- * @since 1.6
- */
- public static DocumentBuilderFactory newInstance(String factoryClassName, ClassLoader classLoader){
- //do not fallback if given classloader can't find the class, throw exception
- return FactoryFinder.newInstance(DocumentBuilderFactory.class,
- factoryClassName, classLoader, false);
- }
-
- /**
- * Creates a new instance of a {@link javax.xml.parsers.DocumentBuilder}
- * using the currently configured parameters.
- *
- * @return A new instance of a DocumentBuilder.
- *
- * @throws ParserConfigurationException if a DocumentBuilder
- * cannot be created which satisfies the configuration requested.
- */
-
- public abstract DocumentBuilder newDocumentBuilder()
- throws ParserConfigurationException;
-
-
- /**
- * Specifies that the parser produced by this code will
- * provide support for XML namespaces. By default the value of this is set
- * to <code>false</code>
- *
- * @param awareness true if the parser produced will provide support
- * for XML namespaces; false otherwise.
- */
-
- public void setNamespaceAware(boolean awareness) {
- this.namespaceAware = awareness;
- }
-
- /**
- * Specifies that the parser produced by this code will
- * validate documents as they are parsed. By default the value of this
- * is set to <code>false</code>.
- *
- * <p>
- * Note that "the validation" here means
- * <a href="http://www.w3.org/TR/REC-xml#proc-types">a validating
- * parser</a> as defined in the XML recommendation.
- * In other words, it essentially just controls the DTD validation.
- * (except the legacy two properties defined in JAXP 1.2.)
- * </p>
- *
- * <p>
- * To use modern schema languages such as W3C XML Schema or
- * RELAX NG instead of DTD, you can configure your parser to be
- * a non-validating parser by leaving the {@link #setValidating(boolean)}
- * method <code>false</code>, then use the {@link #setSchema(Schema)}
- * method to associate a schema to a parser.
- * </p>
- *
- * @param validating true if the parser produced will validate documents
- * as they are parsed; false otherwise.
- */
-
- public void setValidating(boolean validating) {
- this.validating = validating;
- }
-
- /**
- * Specifies that the parsers created by this factory must eliminate
- * whitespace in element content (sometimes known loosely as
- * 'ignorable whitespace') when parsing XML documents (see XML Rec
- * 2.10). Note that only whitespace which is directly contained within
- * element content that has an element only content model (see XML
- * Rec 3.2.1) will be eliminated. Due to reliance on the content model
- * this setting requires the parser to be in validating mode. By default
- * the value of this is set to <code>false</code>.
- *
- * @param whitespace true if the parser created must eliminate whitespace
- * in the element content when parsing XML documents;
- * false otherwise.
- */
-
- public void setIgnoringElementContentWhitespace(boolean whitespace) {
- this.whitespace = whitespace;
- }
-
- /**
- * Specifies that the parser produced by this code will
- * expand entity reference nodes. By default the value of this is set to
- * <code>true</code>
- *
- * @param expandEntityRef true if the parser produced will expand entity
- * reference nodes; false otherwise.
- */
-
- public void setExpandEntityReferences(boolean expandEntityRef) {
- this.expandEntityRef = expandEntityRef;
- }
-
- /**
- * <p>Specifies that the parser produced by this code will
- * ignore comments. By default the value of this is set to <code>false
- * </code>.</p>
- *
- * @param ignoreComments <code>boolean</code> value to ignore comments during processing
- */
-
- public void setIgnoringComments(boolean ignoreComments) {
- this.ignoreComments = ignoreComments;
- }
-
- /**
- * Specifies that the parser produced by this code will
- * convert CDATA nodes to Text nodes and append it to the
- * adjacent (if any) text node. By default the value of this is set to
- * <code>false</code>
- *
- * @param coalescing true if the parser produced will convert CDATA nodes
- * to Text nodes and append it to the adjacent (if any)
- * text node; false otherwise.
- */
-
- public void setCoalescing(boolean coalescing) {
- this.coalescing = coalescing;
- }
-
- /**
- * Indicates whether or not the factory is configured to produce
- * parsers which are namespace aware.
- *
- * @return true if the factory is configured to produce parsers which
- * are namespace aware; false otherwise.
- */
-
- public boolean isNamespaceAware() {
- return namespaceAware;
- }
-
- /**
- * Indicates whether or not the factory is configured to produce
- * parsers which validate the XML content during parse.
- *
- * @return true if the factory is configured to produce parsers
- * which validate the XML content during parse; false otherwise.
- */
-
- public boolean isValidating() {
- return validating;
- }
-
- /**
- * Indicates whether or not the factory is configured to produce
- * parsers which ignore ignorable whitespace in element content.
- *
- * @return true if the factory is configured to produce parsers
- * which ignore ignorable whitespace in element content;
- * false otherwise.
- */
-
- public boolean isIgnoringElementContentWhitespace() {
- return whitespace;
- }
-
- /**
- * Indicates whether or not the factory is configured to produce
- * parsers which expand entity reference nodes.
- *
- * @return true if the factory is configured to produce parsers
- * which expand entity reference nodes; false otherwise.
- */
-
- public boolean isExpandEntityReferences() {
- return expandEntityRef;
- }
-
- /**
- * Indicates whether or not the factory is configured to produce
- * parsers which ignores comments.
- *
- * @return true if the factory is configured to produce parsers
- * which ignores comments; false otherwise.
- */
-
- public boolean isIgnoringComments() {
- return ignoreComments;
- }
-
- /**
- * Indicates whether or not the factory is configured to produce
- * parsers which converts CDATA nodes to Text nodes and appends it to
- * the adjacent (if any) Text node.
- *
- * @return true if the factory is configured to produce parsers
- * which converts CDATA nodes to Text nodes and appends it to
- * the adjacent (if any) Text node; false otherwise.
- */
-
- public boolean isCoalescing() {
- return coalescing;
- }
-
- /**
- * Allows the user to set specific attributes on the underlying
- * implementation.
- * <p>
- * All implementations that implement JAXP 1.5 or newer are required to
- * support the {@link javax.xml.XMLConstants#ACCESS_EXTERNAL_DTD} and
- * {@link javax.xml.XMLConstants#ACCESS_EXTERNAL_SCHEMA} properties.
- * </p>
- * <ul>
- * <li>
- * <p>
- * Setting the {@link javax.xml.XMLConstants#ACCESS_EXTERNAL_DTD} property
- * restricts the access to external DTDs, external Entity References to the
- * protocols specified by the property.
- * If access is denied during parsing due to the restriction of this property,
- * {@link org.xml.sax.SAXException} will be thrown by the parse methods defined by
- * {@link javax.xml.parsers.DocumentBuilder}.
- * </p>
- * <p>
- * Setting the {@link javax.xml.XMLConstants#ACCESS_EXTERNAL_SCHEMA} property
- * restricts the access to external Schema set by the schemaLocation attribute to
- * the protocols specified by the property. If access is denied during parsing
- * due to the restriction of this property, {@link org.xml.sax.SAXException}
- * will be thrown by the parse methods defined by
- * {@link javax.xml.parsers.DocumentBuilder}.
- * </p>
- * </li>
- * </ul>
- *
- * @param name The name of the attribute.
- * @param value The value of the attribute.
- *
- * @throws IllegalArgumentException thrown if the underlying
- * implementation doesn't recognize the attribute.
- */
- public abstract void setAttribute(String name, Object value)
- throws IllegalArgumentException;
-
- /**
- * Allows the user to retrieve specific attributes on the underlying
- * implementation.
- *
- * @param name The name of the attribute.
- *
- * @return value The value of the attribute.
- *
- * @throws IllegalArgumentException thrown if the underlying
- * implementation doesn't recognize the attribute.
- */
- public abstract Object getAttribute(String name)
- throws IllegalArgumentException;
-
- /**
- * <p>Set a feature for this <code>DocumentBuilderFactory</code> and <code>DocumentBuilder</code>s created by this factory.</p>
- *
- * <p>
- * Feature names are fully qualified {@link java.net.URI}s.
- * Implementations may define their own features.
- * A {@link ParserConfigurationException} is thrown if this <code>DocumentBuilderFactory</code> or the
- * <code>DocumentBuilder</code>s it creates cannot support the feature.
- * It is possible for a <code>DocumentBuilderFactory</code> to expose a feature value but be unable to change its state.
- * </p>
- *
- * <p>
- * All implementations are required to support the {@link javax.xml.XMLConstants#FEATURE_SECURE_PROCESSING} feature.
- * When the feature is:</p>
- * <ul>
- * <li>
- * <code>true</code>: the implementation will limit XML processing to conform to implementation limits.
- * Examples include enity expansion limits and XML Schema constructs that would consume large amounts of resources.
- * If XML processing is limited for security reasons, it will be reported via a call to the registered
- * {@link org.xml.sax.ErrorHandler#fatalError(SAXParseException exception)}.
- * See {@link DocumentBuilder#setErrorHandler(org.xml.sax.ErrorHandler errorHandler)}.
- * </li>
- * <li>
- * <code>false</code>: the implementation will processing XML according to the XML specifications without
- * regard to possible implementation limits.
- * </li>
- * </ul>
- *
- * @param name Feature name.
- * @param value Is feature state <code>true</code> or <code>false</code>.
- *
- * @throws ParserConfigurationException if this <code>DocumentBuilderFactory</code> or the <code>DocumentBuilder</code>s
- * it creates cannot support this feature.
- * @throws NullPointerException If the <code>name</code> parameter is null.
- */
- public abstract void setFeature(String name, boolean value)
- throws ParserConfigurationException;
-
- /**
- * <p>Get the state of the named feature.</p>
- *
- * <p>
- * Feature names are fully qualified {@link java.net.URI}s.
- * Implementations may define their own features.
- * An {@link ParserConfigurationException} is thrown if this <code>DocumentBuilderFactory</code> or the
- * <code>DocumentBuilder</code>s it creates cannot support the feature.
- * It is possible for an <code>DocumentBuilderFactory</code> to expose a feature value but be unable to change its state.
- * </p>
- *
- * @param name Feature name.
- *
- * @return State of the named feature.
- *
- * @throws ParserConfigurationException if this <code>DocumentBuilderFactory</code>
- * or the <code>DocumentBuilder</code>s it creates cannot support this feature.
- */
- public abstract boolean getFeature(String name)
- throws ParserConfigurationException;
-
-
- /**
- * Gets the {@link Schema} object specified through
- * the {@link #setSchema(Schema schema)} method.
- *
- * @return
- * the {@link Schema} object that was last set through
- * the {@link #setSchema(Schema)} method, or null
- * if the method was not invoked since a {@link DocumentBuilderFactory}
- * is created.
- *
- * @throws UnsupportedOperationException When implementation does not
- * override this method.
- *
- * @since 1.5
- */
- public Schema getSchema() {
- throw new UnsupportedOperationException(
- "This parser does not support specification \""
- + this.getClass().getPackage().getSpecificationTitle()
- + "\" version \""
- + this.getClass().getPackage().getSpecificationVersion()
- + "\""
- );
-
- }
-
- /**
- * <p>Set the {@link Schema} to be used by parsers created
- * from this factory.
- *
- * <p>
- * When a {@link Schema} is non-null, a parser will use a validator
- * created from it to validate documents before it passes information
- * down to the application.
- *
- * <p>When errors are found by the validator, the parser is responsible
- * to report them to the user-specified {@link org.xml.sax.ErrorHandler}
- * (or if the error handler is not set, ignore them or throw them), just
- * like any other errors found by the parser itself.
- * In other words, if the user-specified {@link org.xml.sax.ErrorHandler}
- * is set, it must receive those errors, and if not, they must be
- * treated according to the implementation specific
- * default error handling rules.
- *
- * <p>
- * A validator may modify the outcome of a parse (for example by
- * adding default values that were missing in documents), and a parser
- * is responsible to make sure that the application will receive
- * modified DOM trees.
- *
- * <p>
- * Initialy, null is set as the {@link Schema}.
- *
- * <p>
- * This processing will take effect even if
- * the {@link #isValidating()} method returns <code>false</code>.
- *
- * <p>It is an error to use
- * the <code>http://java.sun.com/xml/jaxp/properties/schemaSource</code>
- * property and/or the <code>http://java.sun.com/xml/jaxp/properties/schemaLanguage</code>
- * property in conjunction with a {@link Schema} object.
- * Such configuration will cause a {@link ParserConfigurationException}
- * exception when the {@link #newDocumentBuilder()} is invoked.</p>
- *
- *
- * <h4>Note for implmentors</h4>
- *
- * <p>
- * A parser must be able to work with any {@link Schema}
- * implementation. However, parsers and schemas are allowed
- * to use implementation-specific custom mechanisms
- * as long as they yield the result described in the specification.
- * </p>
- *
- * @param schema <code>Schema</code> to use or <code>null</code>
- * to remove a schema.
- *
- * @throws UnsupportedOperationException When implementation does not
- * override this method.
- *
- * @since 1.5
- */
- public void setSchema(Schema schema) {
- throw new UnsupportedOperationException(
- "This parser does not support specification \""
- + this.getClass().getPackage().getSpecificationTitle()
- + "\" version \""
- + this.getClass().getPackage().getSpecificationVersion()
- + "\""
- );
- }
-
-
-
- /**
- * <p>Set state of XInclude processing.</p>
- *
- * <p>If XInclude markup is found in the document instance, should it be
- * processed as specified in <a href="http://www.w3.org/TR/xinclude/">
- * XML Inclusions (XInclude) Version 1.0</a>.</p>
- *
- * <p>XInclude processing defaults to <code>false</code>.</p>
- *
- * @param state Set XInclude processing to <code>true</code> or
- * <code>false</code>
- *
- * @throws UnsupportedOperationException When implementation does not
- * override this method.
- *
- * @since 1.5
- */
- public void setXIncludeAware(final boolean state) {
- if (state) {
- throw new UnsupportedOperationException(" setXIncludeAware " +
- "is not supported on this JAXP" +
- " implementation or earlier: " + this.getClass());
- }
- }
-
- /**
- * <p>Get state of XInclude processing.</p>
- *
- * @return current state of XInclude processing
- *
- * @throws UnsupportedOperationException When implementation does not
- * override this method.
- *
- * @since 1.5
- */
- public boolean isXIncludeAware() {
- throw new UnsupportedOperationException(
- "This parser does not support specification \""
- + this.getClass().getPackage().getSpecificationTitle()
- + "\" version \""
- + this.getClass().getPackage().getSpecificationVersion()
- + "\""
- );
- }
-}
diff --git a/src/javax/xml/parsers/FactoryConfigurationError.java b/src/javax/xml/parsers/FactoryConfigurationError.java
deleted file mode 100644
index c70e4ae..0000000
--- a/src/javax/xml/parsers/FactoryConfigurationError.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.parsers;
-
-/**
- * Thrown when a problem with configuration with the Parser Factories
- * exists. This error will typically be thrown when the class of a
- * parser factory specified in the system properties cannot be found
- * or instantiated.
- *
- * @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a>
- * @version $Revision: 1.7 $, $Date: 2010-11-01 04:36:09 $
- */
-
-public class FactoryConfigurationError extends Error {
- private static final long serialVersionUID = -827108682472263355L;
-
- /**
- *<code>Exception</code> that represents the error.
- */
- private Exception exception;
-
- /**
- * Create a new <code>FactoryConfigurationError</code> with no
- * detail mesage.
- */
-
- public FactoryConfigurationError() {
- super();
- this.exception = null;
- }
-
- /**
- * Create a new <code>FactoryConfigurationError</code> with
- * the <code>String </code> specified as an error message.
- *
- * @param msg The error message for the exception.
- */
-
- public FactoryConfigurationError(String msg) {
- super(msg);
- this.exception = null;
- }
-
-
- /**
- * Create a new <code>FactoryConfigurationError</code> with a
- * given <code>Exception</code> base cause of the error.
- *
- * @param e The exception to be encapsulated in a
- * FactoryConfigurationError.
- */
-
- public FactoryConfigurationError(Exception e) {
- super(e.toString());
- this.exception = e;
- }
-
- /**
- * Create a new <code>FactoryConfigurationError</code> with the
- * given <code>Exception</code> base cause and detail message.
- *
- * @param e The exception to be encapsulated in a
- * FactoryConfigurationError
- * @param msg The detail message.
- */
-
- public FactoryConfigurationError(Exception e, String msg) {
- super(msg);
- this.exception = e;
- }
-
-
- /**
- * Return the message (if any) for this error . If there is no
- * message for the exception and there is an encapsulated
- * exception then the message of that exception, if it exists will be
- * returned. Else the name of the encapsulated exception will be
- * returned.
- *
- * @return The error message.
- */
-
- public String getMessage () {
- String message = super.getMessage ();
-
- if (message == null && exception != null) {
- return exception.getMessage();
- }
-
- return message;
- }
-
- /**
- * Return the actual exception (if any) that caused this exception to
- * be raised.
- *
- * @return The encapsulated exception, or null if there is none.
- */
-
- public Exception getException () {
- return exception;
- }
-
- /**
- * use the exception chaining mechanism of JDK1.4
- */
- @Override
- public Throwable getCause() {
- return exception;
- }
-}
diff --git a/src/javax/xml/parsers/FactoryFinder.java b/src/javax/xml/parsers/FactoryFinder.java
deleted file mode 100644
index 9e186f5..0000000
--- a/src/javax/xml/parsers/FactoryFinder.java
+++ /dev/null
@@ -1,316 +0,0 @@
-/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.parsers;
-
-import java.io.File;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.Iterator;
-import java.util.Properties;
-import java.util.ServiceConfigurationError;
-import java.util.ServiceLoader;
-
-/**
- * <p>Implements pluggable Parsers.</p>
- *
- * <p>This class is duplicated for each JAXP subpackage so keep it in
- * sync. It is package private for secure class loading.</p>
- *
- * @author Santiago.PericasGeertsen@sun.com
- * @author Huizhe.Wang@oracle.com
- */
-class FactoryFinder {
- private static final String DEFAULT_PACKAGE = "com.sun.org.apache.xerces.internal";
- /**
- * Internal debug flag.
- */
- private static boolean debug = false;
-
- /**
- * Cache for properties in java.home/lib/jaxp.properties
- */
- private static final Properties cacheProps = new Properties();
-
- /**
- * Flag indicating if properties from java.home/lib/jaxp.properties
- * have been cached.
- */
- static volatile boolean firstTime = true;
-
- /**
- * Security support class use to check access control before
- * getting certain system resources.
- */
- private static final SecuritySupport ss = new SecuritySupport();
-
- // Define system property "jaxp.debug" to get output
- static {
- // Use try/catch block to support applets, which throws
- // SecurityException out of this code.
- try {
- String val = ss.getSystemProperty("jaxp.debug");
- // Allow simply setting the prop to turn on debug
- debug = val != null && !"false".equals(val);
- }
- catch (SecurityException se) {
- debug = false;
- }
- }
-
- private static void dPrint(String msg) {
- if (debug) {
- System.err.println("JAXP: " + msg);
- }
- }
-
- /**
- * Attempt to load a class using the class loader supplied. If that fails
- * and fall back is enabled, the current (i.e. bootstrap) class loader is
- * tried.
- *
- * If the class loader supplied is <code>null</code>, first try using the
- * context class loader followed by the current (i.e. bootstrap) class
- * loader.
- *
- * Use bootstrap classLoader if cl = null and useBSClsLoader is true
- */
- static private Class<?> getProviderClass(String className, ClassLoader cl,
- boolean doFallback, boolean useBSClsLoader) throws ClassNotFoundException
- {
- try {
- if (cl == null) {
- if (useBSClsLoader) {
- return Class.forName(className, false, FactoryFinder.class.getClassLoader());
- } else {
- cl = ss.getContextClassLoader();
- if (cl == null) {
- throw new ClassNotFoundException();
- }
- else {
- return Class.forName(className, false, cl);
- }
- }
- }
- else {
- return Class.forName(className, false, cl);
- }
- }
- catch (ClassNotFoundException e1) {
- if (doFallback) {
- // Use current class loader - should always be bootstrap CL
- return Class.forName(className, false, FactoryFinder.class.getClassLoader());
- }
- else {
- throw e1;
- }
- }
- }
-
- /**
- * Create an instance of a class. Delegates to method
- * <code>getProviderClass()</code> in order to load the class.
- *
- * @param type Base class / Service interface of the factory to
- * instantiate.
- *
- * @param className Name of the concrete class corresponding to the
- * service provider
- *
- * @param cl <code>ClassLoader</code> used to load the factory class. If <code>null</code>
- * current <code>Thread</code>'s context classLoader is used to load the factory class.
- *
- * @param doFallback True if the current ClassLoader should be tried as
- * a fallback if the class is not found using cl
- */
- static <T> T newInstance(Class<T> type, String className, ClassLoader cl,
- boolean doFallback)
- throws FactoryConfigurationError
- {
- return newInstance(type, className, cl, doFallback, false);
- }
-
- /**
- * Create an instance of a class. Delegates to method
- * <code>getProviderClass()</code> in order to load the class.
- *
- * @param type Base class / Service interface of the factory to
- * instantiate.
- *
- * @param className Name of the concrete class corresponding to the
- * service provider
- *
- * @param cl <code>ClassLoader</code> used to load the factory class. If <code>null</code>
- * current <code>Thread</code>'s context classLoader is used to load the factory class.
- *
- * @param doFallback True if the current ClassLoader should be tried as
- * a fallback if the class is not found using cl
- *
- * @param useBSClsLoader True if cl=null actually meant bootstrap classLoader. This parameter
- * is needed since DocumentBuilderFactory/SAXParserFactory defined null as context classLoader.
- */
- static <T> T newInstance(Class<T> type, String className, ClassLoader cl,
- boolean doFallback, boolean useBSClsLoader)
- throws FactoryConfigurationError
- {
- assert type != null;
- // make sure we have access to restricted packages
- if (System.getSecurityManager() != null) {
- if (className != null && className.startsWith(DEFAULT_PACKAGE)) {
- cl = null;
- useBSClsLoader = true;
- }
- }
-
- try {
- Class<?> providerClass = getProviderClass(className, cl, doFallback, useBSClsLoader);
- if (!type.isAssignableFrom(providerClass)) {
- throw new ClassCastException(className + " cannot be cast to " + type.getName());
- }
- Object instance = providerClass.newInstance();
- if (debug) { // Extra check to avoid computing cl strings
- dPrint("created new instance of " + providerClass +
- " using ClassLoader: " + cl);
- }
- return type.cast(instance);
- }
- catch (ClassNotFoundException x) {
- throw new FactoryConfigurationError(x,
- "Provider " + className + " not found");
- }
- catch (Exception x) {
- throw new FactoryConfigurationError(x,
- "Provider " + className + " could not be instantiated: " + x);
- }
- }
-
- /**
- * Finds the implementation Class object in the specified order. Main
- * entry point.
- * @return Class object of factory, never null
- *
- * @param type Base class / Service interface of the
- * factory to find.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * Package private so this code can be shared.
- */
- static <T> T find(Class<T> type, String fallbackClassName)
- throws FactoryConfigurationError
- {
- final String factoryId = type.getName();
- dPrint("find factoryId =" + factoryId);
-
- // Use the system property first
- try {
- String systemProp = ss.getSystemProperty(factoryId);
- if (systemProp != null) {
- dPrint("found system property, value=" + systemProp);
- return newInstance(type, systemProp, null, true);
- }
- }
- catch (SecurityException se) {
- if (debug) se.printStackTrace();
- }
-
- // try to read from $java.home/lib/jaxp.properties
- try {
- if (firstTime) {
- synchronized (cacheProps) {
- if (firstTime) {
- String configFile = ss.getSystemProperty("java.home") + File.separator +
- "lib" + File.separator + "jaxp.properties";
- File f = new File(configFile);
- firstTime = false;
- if (ss.doesFileExist(f)) {
- dPrint("Read properties file "+f);
- cacheProps.load(ss.getFileInputStream(f));
- }
- }
- }
- }
- final String factoryClassName = cacheProps.getProperty(factoryId);
-
- if (factoryClassName != null) {
- dPrint("found in $java.home/jaxp.properties, value=" + factoryClassName);
- return newInstance(type, factoryClassName, null, true);
- }
- }
- catch (Exception ex) {
- if (debug) ex.printStackTrace();
- }
-
- // Try Jar Service Provider Mechanism
- T provider = findServiceProvider(type);
- if (provider != null) {
- return provider;
- }
- if (fallbackClassName == null) {
- throw new FactoryConfigurationError(
- "Provider for " + factoryId + " cannot be found");
- }
-
- dPrint("loaded from fallback value: " + fallbackClassName);
- return newInstance(type, fallbackClassName, null, true);
- }
-
- /*
- * Try to find provider using the ServiceLoader API
- *
- * @param type Base class / Service interface of the factory to find.
- *
- * @return instance of provider class if found or null
- */
- private static <T> T findServiceProvider(final Class<T> type) {
- try {
- return AccessController.doPrivileged(new PrivilegedAction<T>() {
- public T run() {
- final ServiceLoader<T> serviceLoader = ServiceLoader.load(type);
- final Iterator<T> iterator = serviceLoader.iterator();
- if (iterator.hasNext()) {
- return iterator.next();
- } else {
- return null;
- }
- }
- });
- } catch(ServiceConfigurationError e) {
- // It is not possible to wrap an error directly in
- // FactoryConfigurationError - so we need to wrap the
- // ServiceConfigurationError in a RuntimeException.
- // The alternative would be to modify the logic in
- // FactoryConfigurationError to allow setting a
- // Throwable as the cause, but that could cause
- // compatibility issues down the road.
- final RuntimeException x = new RuntimeException(
- "Provider for " + type + " cannot be created", e);
- final FactoryConfigurationError error =
- new FactoryConfigurationError(x, x.getMessage());
- throw error;
- }
- }
-
-}
diff --git a/src/javax/xml/parsers/ParserConfigurationException.java b/src/javax/xml/parsers/ParserConfigurationException.java
deleted file mode 100644
index 0467ca0..0000000
--- a/src/javax/xml/parsers/ParserConfigurationException.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.parsers;
-
-/**
- * Indicates a serious configuration error.
- *
- * @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a>
- */
-
-public class ParserConfigurationException extends Exception {
-
- /**
- * Create a new <code>ParserConfigurationException</code> with no
- * detail mesage.
- */
-
- public ParserConfigurationException() {
- super();
- }
-
- /**
- * Create a new <code>ParserConfigurationException</code> with
- * the <code>String</code> specified as an error message.
- *
- * @param msg The error message for the exception.
- */
-
- public ParserConfigurationException(String msg) {
- super(msg);
- }
-
-}
diff --git a/src/javax/xml/parsers/SAXParser.java b/src/javax/xml/parsers/SAXParser.java
deleted file mode 100644
index 5accd12..0000000
--- a/src/javax/xml/parsers/SAXParser.java
+++ /dev/null
@@ -1,555 +0,0 @@
-/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.parsers;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-
-import javax.xml.validation.Schema;
-
-import org.xml.sax.HandlerBase;
-import org.xml.sax.InputSource;
-import org.xml.sax.Parser;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.helpers.DefaultHandler;
-
-
-/**
- * Defines the API that wraps an {@link org.xml.sax.XMLReader}
- * implementation class. In JAXP 1.0, this class wrapped the
- * {@link org.xml.sax.Parser} interface, however this interface was
- * replaced by the {@link org.xml.sax.XMLReader}. For ease
- * of transition, this class continues to support the same name
- * and interface as well as supporting new methods.
- *
- * An instance of this class can be obtained from the
- * {@link javax.xml.parsers.SAXParserFactory#newSAXParser()} method.
- * Once an instance of this class is obtained, XML can be parsed from
- * a variety of input sources. These input sources are InputStreams,
- * Files, URLs, and SAX InputSources.<p>
- *
- * This static method creates a new factory instance based
- * on a system property setting or uses the platform default
- * if no property has been defined.<p>
- *
- * The system property that controls which Factory implementation
- * to create is named <code>&quot;javax.xml.parsers.SAXParserFactory&quot;</code>.
- * This property names a class that is a concrete subclass of this
- * abstract class. If no property is defined, a platform default
- * will be used.</p>
- *
- * As the content is parsed by the underlying parser, methods of the
- * given {@link org.xml.sax.HandlerBase} or the
- * {@link org.xml.sax.helpers.DefaultHandler} are called.<p>
- *
- * Implementors of this class which wrap an underlaying implementation
- * can consider using the {@link org.xml.sax.helpers.ParserAdapter}
- * class to initially adapt their SAX1 implementation to work under
- * this revised class.
- *
- * @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a>
- */
-public abstract class SAXParser {
-
- /**
- * <p>Protected constructor to prevent instaniation.
- * Use {@link javax.xml.parsers.SAXParserFactory#newSAXParser()}.</p>
- */
- protected SAXParser () {
-
- }
-
- /**
- * <p>Reset this <code>SAXParser</code> to its original configuration.</p>
- *
- * <p><code>SAXParser</code> is reset to the same state as when it was created with
- * {@link SAXParserFactory#newSAXParser()}.
- * <code>reset()</code> is designed to allow the reuse of existing <code>SAXParser</code>s
- * thus saving resources associated with the creation of new <code>SAXParser</code>s.</p>
- *
- * <p>The reset <code>SAXParser</code> is not guaranteed to have the same {@link Schema}
- * <code>Object</code>, e.g. {@link Object#equals(Object obj)}. It is guaranteed to have a functionally equal
- * <code>Schema</code>.</p>
- *
- * @throws UnsupportedOperationException When Implementations do not
- * override this method
- *
- * @since 1.5
- */
- public void reset() {
-
- // implementors should override this method
- throw new UnsupportedOperationException(
- "This SAXParser, \"" + this.getClass().getName() + "\", does not support the reset functionality."
- + " Specification \"" + this.getClass().getPackage().getSpecificationTitle() + "\""
- + " version \"" + this.getClass().getPackage().getSpecificationVersion() + "\""
- );
- }
-
- /**
- * <p>Parse the content of the given {@link java.io.InputStream}
- * instance as XML using the specified {@link org.xml.sax.HandlerBase}.
- * <i> Use of the DefaultHandler version of this method is recommended as
- * the HandlerBase class has been deprecated in SAX 2.0</i>.</p>
- *
- * @param is InputStream containing the content to be parsed.
- * @param hb The SAX HandlerBase to use.
- *
- * @throws IllegalArgumentException If the given InputStream is null.
- * @throws SAXException If parse produces a SAX error.
- * @throws IOException If an IO error occurs interacting with the
- * <code>InputStream</code>.
- *
- * @see org.xml.sax.DocumentHandler
- */
- public void parse(InputStream is, HandlerBase hb)
- throws SAXException, IOException {
- if (is == null) {
- throw new IllegalArgumentException("InputStream cannot be null");
- }
-
- InputSource input = new InputSource(is);
- this.parse(input, hb);
- }
-
- /**
- * <p>Parse the content of the given {@link java.io.InputStream}
- * instance as XML using the specified {@link org.xml.sax.HandlerBase}.
- * <i> Use of the DefaultHandler version of this method is recommended as
- * the HandlerBase class has been deprecated in SAX 2.0</i>.</p>
- *
- * @param is InputStream containing the content to be parsed.
- * @param hb The SAX HandlerBase to use.
- * @param systemId The systemId which is needed for resolving relative URIs.
- *
- * @throws IllegalArgumentException If the given <code>InputStream</code> is
- * <code>null</code>.
- * @throws IOException If any IO error occurs interacting with the
- * <code>InputStream</code>.
- * @throws SAXException If any SAX errors occur during processing.
- *
- * @see org.xml.sax.DocumentHandler version of this method instead.
- */
- public void parse(
- InputStream is,
- HandlerBase hb,
- String systemId)
- throws SAXException, IOException {
- if (is == null) {
- throw new IllegalArgumentException("InputStream cannot be null");
- }
-
- InputSource input = new InputSource(is);
- input.setSystemId(systemId);
- this.parse(input, hb);
- }
-
- /**
- * Parse the content of the given {@link java.io.InputStream}
- * instance as XML using the specified
- * {@link org.xml.sax.helpers.DefaultHandler}.
- *
- * @param is InputStream containing the content to be parsed.
- * @param dh The SAX DefaultHandler to use.
- *
- * @throws IllegalArgumentException If the given InputStream is null.
- * @throws IOException If any IO errors occur.
- * @throws SAXException If any SAX errors occur during processing.
- *
- * @see org.xml.sax.DocumentHandler
- */
- public void parse(InputStream is, DefaultHandler dh)
- throws SAXException, IOException {
- if (is == null) {
- throw new IllegalArgumentException("InputStream cannot be null");
- }
-
- InputSource input = new InputSource(is);
- this.parse(input, dh);
- }
-
- /**
- * Parse the content of the given {@link java.io.InputStream}
- * instance as XML using the specified
- * {@link org.xml.sax.helpers.DefaultHandler}.
- *
- * @param is InputStream containing the content to be parsed.
- * @param dh The SAX DefaultHandler to use.
- * @param systemId The systemId which is needed for resolving relative URIs.
- *
- * @throws IllegalArgumentException If the given InputStream is null.
- * @throws IOException If any IO errors occur.
- * @throws SAXException If any SAX errors occur during processing.
- *
- * @see org.xml.sax.DocumentHandler version of this method instead.
- */
- public void parse(
- InputStream is,
- DefaultHandler dh,
- String systemId)
- throws SAXException, IOException {
- if (is == null) {
- throw new IllegalArgumentException("InputStream cannot be null");
- }
-
- InputSource input = new InputSource(is);
- input.setSystemId(systemId);
- this.parse(input, dh);
- }
-
- /**
- * Parse the content described by the giving Uniform Resource
- * Identifier (URI) as XML using the specified
- * {@link org.xml.sax.HandlerBase}.
- * <i> Use of the DefaultHandler version of this method is recommended as
- * the <code>HandlerBase</code> class has been deprecated in SAX 2.0</i>
- *
- * @param uri The location of the content to be parsed.
- * @param hb The SAX HandlerBase to use.
- *
- * @throws IllegalArgumentException If the uri is null.
- * @throws IOException If any IO errors occur.
- * @throws SAXException If any SAX errors occur during processing.
- *
- * @see org.xml.sax.DocumentHandler
- */
- public void parse(String uri, HandlerBase hb)
- throws SAXException, IOException {
- if (uri == null) {
- throw new IllegalArgumentException("uri cannot be null");
- }
-
- InputSource input = new InputSource(uri);
- this.parse(input, hb);
- }
-
- /**
- * Parse the content described by the giving Uniform Resource
- * Identifier (URI) as XML using the specified
- * {@link org.xml.sax.helpers.DefaultHandler}.
- *
- * @param uri The location of the content to be parsed.
- * @param dh The SAX DefaultHandler to use.
- *
- * @throws IllegalArgumentException If the uri is null.
- * @throws IOException If any IO errors occur.
- * @throws SAXException If any SAX errors occur during processing.
- *
- * @see org.xml.sax.DocumentHandler
- */
- public void parse(String uri, DefaultHandler dh)
- throws SAXException, IOException {
- if (uri == null) {
- throw new IllegalArgumentException("uri cannot be null");
- }
-
- InputSource input = new InputSource(uri);
- this.parse(input, dh);
- }
-
- /**
- * Parse the content of the file specified as XML using the
- * specified {@link org.xml.sax.HandlerBase}.
- * <i> Use of the DefaultHandler version of this method is recommended as
- * the HandlerBase class has been deprecated in SAX 2.0</i>
- *
- * @param f The file containing the XML to parse
- * @param hb The SAX HandlerBase to use.
- *
- * @throws IllegalArgumentException If the File object is null.
- * @throws IOException If any IO errors occur.
- * @throws SAXException If any SAX errors occur during processing.
- *
- * @see org.xml.sax.DocumentHandler
- */
- public void parse(File f, HandlerBase hb)
- throws SAXException, IOException {
- if (f == null) {
- throw new IllegalArgumentException("File cannot be null");
- }
-
- //convert file to appropriate URI, f.toURI().toASCIIString()
- //converts the URI to string as per rule specified in
- //RFC 2396,
- InputSource input = new InputSource(f.toURI().toASCIIString());
- this.parse(input, hb);
- }
-
- /**
- * Parse the content of the file specified as XML using the
- * specified {@link org.xml.sax.helpers.DefaultHandler}.
- *
- * @param f The file containing the XML to parse
- * @param dh The SAX DefaultHandler to use.
- *
- * @throws IllegalArgumentException If the File object is null.
- * @throws IOException If any IO errors occur.
- * @throws SAXException If any SAX errors occur during processing.
- *
- * @see org.xml.sax.DocumentHandler
- */
- public void parse(File f, DefaultHandler dh)
- throws SAXException, IOException {
- if (f == null) {
- throw new IllegalArgumentException("File cannot be null");
- }
-
- //convert file to appropriate URI, f.toURI().toASCIIString()
- //converts the URI to string as per rule specified in
- //RFC 2396,
- InputSource input = new InputSource(f.toURI().toASCIIString());
- this.parse(input, dh);
- }
-
- /**
- * Parse the content given {@link org.xml.sax.InputSource}
- * as XML using the specified
- * {@link org.xml.sax.HandlerBase}.
- * <i> Use of the DefaultHandler version of this method is recommended as
- * the HandlerBase class has been deprecated in SAX 2.0</i>
- *
- * @param is The InputSource containing the content to be parsed.
- * @param hb The SAX HandlerBase to use.
- *
- * @throws IllegalArgumentException If the <code>InputSource</code> object
- * is <code>null</code>.
- * @throws IOException If any IO errors occur.
- * @throws SAXException If any SAX errors occur during processing.
- *
- * @see org.xml.sax.DocumentHandler
- */
- public void parse(InputSource is, HandlerBase hb)
- throws SAXException, IOException {
- if (is == null) {
- throw new IllegalArgumentException("InputSource cannot be null");
- }
-
- Parser parser = this.getParser();
- if (hb != null) {
- parser.setDocumentHandler(hb);
- parser.setEntityResolver(hb);
- parser.setErrorHandler(hb);
- parser.setDTDHandler(hb);
- }
- parser.parse(is);
- }
-
- /**
- * Parse the content given {@link org.xml.sax.InputSource}
- * as XML using the specified
- * {@link org.xml.sax.helpers.DefaultHandler}.
- *
- * @param is The InputSource containing the content to be parsed.
- * @param dh The SAX DefaultHandler to use.
- *
- * @throws IllegalArgumentException If the <code>InputSource</code> object
- * is <code>null</code>.
- * @throws IOException If any IO errors occur.
- * @throws SAXException If any SAX errors occur during processing.
- *
- * @see org.xml.sax.DocumentHandler
- */
- public void parse(InputSource is, DefaultHandler dh)
- throws SAXException, IOException {
- if (is == null) {
- throw new IllegalArgumentException("InputSource cannot be null");
- }
-
- XMLReader reader = this.getXMLReader();
- if (dh != null) {
- reader.setContentHandler(dh);
- reader.setEntityResolver(dh);
- reader.setErrorHandler(dh);
- reader.setDTDHandler(dh);
- }
- reader.parse(is);
- }
-
- /**
- * Returns the SAX parser that is encapsultated by the
- * implementation of this class.
- *
- * @return The SAX parser that is encapsultated by the
- * implementation of this class.
- *
- * @throws SAXException If any SAX errors occur during processing.
- */
- public abstract org.xml.sax.Parser getParser() throws SAXException;
-
- /**
- * Returns the {@link org.xml.sax.XMLReader} that is encapsulated by the
- * implementation of this class.
- *
- * @return The XMLReader that is encapsulated by the
- * implementation of this class.
- *
- * @throws SAXException If any SAX errors occur during processing.
- */
-
- public abstract org.xml.sax.XMLReader getXMLReader() throws SAXException;
-
- /**
- * Indicates whether or not this parser is configured to
- * understand namespaces.
- *
- * @return true if this parser is configured to
- * understand namespaces; false otherwise.
- */
-
- public abstract boolean isNamespaceAware();
-
- /**
- * Indicates whether or not this parser is configured to
- * validate XML documents.
- *
- * @return true if this parser is configured to
- * validate XML documents; false otherwise.
- */
-
- public abstract boolean isValidating();
-
- /**
- * <p>Sets the particular property in the underlying implementation of
- * {@link org.xml.sax.XMLReader}.
- * A list of the core features and properties can be found at
- * <a href="http://sax.sourceforge.net/?selected=get-set">
- * http://sax.sourceforge.net/?selected=get-set</a>.</p>
- * <p>
- * All implementations that implement JAXP 1.5 or newer are required to
- * support the {@link javax.xml.XMLConstants#ACCESS_EXTERNAL_DTD} and
- * {@link javax.xml.XMLConstants#ACCESS_EXTERNAL_SCHEMA} properties.
- * </p>
- * <ul>
- * <li>
- * <p>
- * Setting the {@link javax.xml.XMLConstants#ACCESS_EXTERNAL_DTD} property
- * restricts the access to external DTDs, external Entity References to
- * the protocols specified by the property. If access is denied during parsing
- * due to the restriction of this property, {@link org.xml.sax.SAXException}
- * will be thrown by the parse methods defined by {@link javax.xml.parsers.SAXParser}.
- * </p>
- * <p>
- * Setting the {@link javax.xml.XMLConstants#ACCESS_EXTERNAL_SCHEMA} property
- * restricts the access to external Schema set by the schemaLocation attribute to
- * the protocols specified by the property. If access is denied during parsing
- * due to the restriction of this property, {@link org.xml.sax.SAXException}
- * will be thrown by the parse methods defined by the {@link javax.xml.parsers.SAXParser}.
- * </p>
- * </li>
- * </ul>
- *
- * @param name The name of the property to be set.
- * @param value The value of the property to be set.
- *
- * @throws SAXNotRecognizedException When the underlying XMLReader does
- * not recognize the property name.
- * @throws SAXNotSupportedException When the underlying XMLReader
- * recognizes the property name but doesn't support the property.
- *
- * @see org.xml.sax.XMLReader#setProperty
- */
- public abstract void setProperty(String name, Object value)
- throws SAXNotRecognizedException, SAXNotSupportedException;
-
- /**
- * <p>Returns the particular property requested for in the underlying
- * implementation of {@link org.xml.sax.XMLReader}.</p>
- *
- * @param name The name of the property to be retrieved.
- * @return Value of the requested property.
- *
- * @throws SAXNotRecognizedException When the underlying XMLReader does
- * not recognize the property name.
- * @throws SAXNotSupportedException When the underlying XMLReader
- * recognizes the property name but doesn't support the property.
- *
- * @see org.xml.sax.XMLReader#getProperty
- */
- public abstract Object getProperty(String name)
- throws SAXNotRecognizedException, SAXNotSupportedException;
-
- /** <p>Get current state of canonicalization.</p>
- *
- * @return current state canonicalization control
- */
- /*
- public boolean getCanonicalization() {
- return canonicalState;
- }
- */
-
- /** <p>Get a reference to the the {@link Schema} being used by
- * the XML processor.</p>
- *
- * <p>If no schema is being used, <code>null</code> is returned.</p>
- *
- * @return {@link Schema} being used or <code>null</code>
- * if none in use
- *
- * @throws UnsupportedOperationException When implementation does not
- * override this method
- *
- * @since 1.5
- */
- public Schema getSchema() {
- throw new UnsupportedOperationException(
- "This parser does not support specification \""
- + this.getClass().getPackage().getSpecificationTitle()
- + "\" version \""
- + this.getClass().getPackage().getSpecificationVersion()
- + "\""
- );
- }
-
- /**
- * <p>Get the XInclude processing mode for this parser.</p>
- *
- * @return
- * the return value of
- * the {@link SAXParserFactory#isXIncludeAware()}
- * when this parser was created from factory.
- *
- * @throws UnsupportedOperationException When implementation does not
- * override this method
- *
- * @since 1.5
- *
- * @see SAXParserFactory#setXIncludeAware(boolean)
- */
- public boolean isXIncludeAware() {
- throw new UnsupportedOperationException(
- "This parser does not support specification \""
- + this.getClass().getPackage().getSpecificationTitle()
- + "\" version \""
- + this.getClass().getPackage().getSpecificationVersion()
- + "\""
- );
- }
-}
diff --git a/src/javax/xml/parsers/SAXParserFactory.java b/src/javax/xml/parsers/SAXParserFactory.java
deleted file mode 100644
index 7163456..0000000
--- a/src/javax/xml/parsers/SAXParserFactory.java
+++ /dev/null
@@ -1,443 +0,0 @@
-/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.parsers;
-
-import javax.xml.validation.Schema;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
-
-/**
- * Defines a factory API that enables applications to configure and
- * obtain a SAX based parser to parse XML documents.
- *
- * @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a>
- * @author <a href="mailto:Neeraj.Bajaj@sun.com">Neeraj Bajaj</a>
- *
- * @version $Revision: 1.9 $, $Date: 2010/05/25 16:19:44 $
- *
- */
-public abstract class SAXParserFactory {
-
- /**
- * <p>Should Parsers be validating?</p>
- */
- private boolean validating = false;
-
- /**
- * <p>Should Parsers be namespace aware?</p>
- */
- private boolean namespaceAware = false;
-
- /**
- * <p>Protected constructor to force use of {@link #newInstance()}.</p>
- */
- protected SAXParserFactory () {
-
- }
-
- /**
- * Obtain a new instance of a <code>SAXParserFactory</code>. This
- * static method creates a new factory instance
- * This method uses the following ordered lookup procedure to determine
- * the <code>SAXParserFactory</code> implementation class to
- * load:
- * <ul>
- * <li>
- * Use the <code>javax.xml.parsers.SAXParserFactory</code> system
- * property.
- * </li>
- * <li>
- * Use the properties file "lib/jaxp.properties" in the JRE directory.
- * This configuration file is in standard <code>java.util.Properties
- * </code> format and contains the fully qualified name of the
- * implementation class with the key being the system property defined
- * above.
- *
- * The jaxp.properties file is read only once by the JAXP implementation
- * and it's values are then cached for future use. If the file does not exist
- * when the first attempt is made to read from it, no further attempts are
- * made to check for its existence. It is not possible to change the value
- * of any property in jaxp.properties after it has been read for the first time.
- * </li>
- * <li>
- * Use the service-provider loading facilities, defined by the
- * {@link java.util.ServiceLoader} class, to attempt to locate and load an
- * implementation of the service using the {@linkplain
- * java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}:
- * the service-provider loading facility will use the {@linkplain
- * java.lang.Thread#getContextClassLoader() current thread's context class loader}
- * to attempt to load the service. If the context class
- * loader is null, the {@linkplain
- * ClassLoader#getSystemClassLoader() system class loader} will be used.
- * </li>
- * <li>
- * Otherwise the system-default implementation is returned.
- * </li>
- * </ul>
- *
- * Once an application has obtained a reference to a
- * <code>SAXParserFactory</code> it can use the factory to
- * configure and obtain parser instances.
- *
- *
- *
- * <h2>Tip for Trouble-shooting</h2>
- * <p>Setting the <code>jaxp.debug</code> system property will cause
- * this method to print a lot of debug messages
- * to <code>System.err</code> about what it is doing and where it is looking at.</p>
- *
- * <p> If you have problems loading {@link SAXParser}s, try:</p>
- * <pre>
- * java -Djaxp.debug=1 YourProgram ....
- * </pre>
- *
- *
- * @return A new instance of a SAXParserFactory.
- *
- * @throws FactoryConfigurationError in case of {@linkplain
- * java.util.ServiceConfigurationError service configuration error} or if
- * the implementation is not available or cannot be instantiated.
- */
-
- public static SAXParserFactory newInstance() {
- return FactoryFinder.find(
- /* The default property name according to the JAXP spec */
- SAXParserFactory.class,
- /* The fallback implementation class name */
- "com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl");
- }
-
- /**
- * <p>Obtain a new instance of a <code>SAXParserFactory</code> from class name.
- * This function is useful when there are multiple providers in the classpath.
- * It gives more control to the application as it can specify which provider
- * should be loaded.</p>
- *
- * <p>Once an application has obtained a reference to a <code>SAXParserFactory</code>
- * it can use the factory to configure and obtain parser instances.</p>
- *
- *
- * <h2>Tip for Trouble-shooting</h2>
- * <p>Setting the <code>jaxp.debug</code> system property will cause
- * this method to print a lot of debug messages
- * to <code>System.err</code> about what it is doing and where it is looking at.</p>
- *
- * <p> If you have problems, try:</p>
- * <pre>
- * java -Djaxp.debug=1 YourProgram ....
- * </pre>
- *
- * @param factoryClassName fully qualified factory class name that provides implementation of <code>javax.xml.parsers.SAXParserFactory</code>.
- *
- * @param classLoader <code>ClassLoader</code> used to load the factory class. If <code>null</code>
- * current <code>Thread</code>'s context classLoader is used to load the factory class.
- *
- * @return New instance of a <code>SAXParserFactory</code>
- *
- * @throws FactoryConfigurationError if <code>factoryClassName</code> is <code>null</code>, or
- * the factory class cannot be loaded, instantiated.
- *
- * @see #newInstance()
- *
- * @since 1.6
- */
- public static SAXParserFactory newInstance(String factoryClassName, ClassLoader classLoader){
- //do not fallback if given classloader can't find the class, throw exception
- return FactoryFinder.newInstance(SAXParserFactory.class,
- factoryClassName, classLoader, false);
- }
-
- /**
- * <p>Creates a new instance of a SAXParser using the currently
- * configured factory parameters.</p>
- *
- * @return A new instance of a SAXParser.
- *
- * @throws ParserConfigurationException if a parser cannot
- * be created which satisfies the requested configuration.
- * @throws SAXException for SAX errors.
- */
-
- public abstract SAXParser newSAXParser()
- throws ParserConfigurationException, SAXException;
-
-
- /**
- * Specifies that the parser produced by this code will
- * provide support for XML namespaces. By default the value of this is set
- * to <code>false</code>.
- *
- * @param awareness true if the parser produced by this code will
- * provide support for XML namespaces; false otherwise.
- */
-
- public void setNamespaceAware(boolean awareness) {
- this.namespaceAware = awareness;
- }
-
- /**
- * Specifies that the parser produced by this code will
- * validate documents as they are parsed. By default the value of this is
- * set to <code>false</code>.
- *
- * <p>
- * Note that "the validation" here means
- * <a href="http://www.w3.org/TR/REC-xml#proc-types">a validating
- * parser</a> as defined in the XML recommendation.
- * In other words, it essentially just controls the DTD validation.
- * (except the legacy two properties defined in JAXP 1.2.)
- * </p>
- *
- * <p>
- * To use modern schema languages such as W3C XML Schema or
- * RELAX NG instead of DTD, you can configure your parser to be
- * a non-validating parser by leaving the {@link #setValidating(boolean)}
- * method <code>false</code>, then use the {@link #setSchema(Schema)}
- * method to associate a schema to a parser.
- * </p>
- *
- * @param validating true if the parser produced by this code will
- * validate documents as they are parsed; false otherwise.
- */
-
- public void setValidating(boolean validating) {
- this.validating = validating;
- }
-
- /**
- * Indicates whether or not the factory is configured to produce
- * parsers which are namespace aware.
- *
- * @return true if the factory is configured to produce
- * parsers which are namespace aware; false otherwise.
- */
-
- public boolean isNamespaceAware() {
- return namespaceAware;
- }
-
- /**
- * Indicates whether or not the factory is configured to produce
- * parsers which validate the XML content during parse.
- *
- * @return true if the factory is configured to produce parsers which validate
- * the XML content during parse; false otherwise.
- */
-
- public boolean isValidating() {
- return validating;
- }
-
- /**
- *
- * <p>Sets the particular feature in the underlying implementation of
- * org.xml.sax.XMLReader.
- * A list of the core features and properties can be found at
- * <a href="http://www.saxproject.org/">http://www.saxproject.org/</a></p>
- *
- * <p>All implementations are required to support the {@link javax.xml.XMLConstants#FEATURE_SECURE_PROCESSING} feature.
- * When the feature is</p>
- * <ul>
- * <li>
- * <code>true</code>: the implementation will limit XML processing to conform to implementation limits.
- * Examples include entity expansion limits and XML Schema constructs that would consume large amounts of resources.
- * If XML processing is limited for security reasons, it will be reported via a call to the registered
- * {@link org.xml.sax.ErrorHandler#fatalError(SAXParseException exception)}.
- * See {@link SAXParser} <code>parse</code> methods for handler specification.
- * </li>
- * <li>
- * When the feature is <code>false</code>, the implementation will processing XML according to the XML specifications without
- * regard to possible implementation limits.
- * </li>
- * </ul>
- *
- * @param name The name of the feature to be set.
- * @param value The value of the feature to be set.
- *
- * @throws ParserConfigurationException if a parser cannot
- * be created which satisfies the requested configuration.
- * @throws SAXNotRecognizedException When the underlying XMLReader does
- * not recognize the property name.
- * @throws SAXNotSupportedException When the underlying XMLReader
- * recognizes the property name but doesn't support the
- * property.
- * @throws NullPointerException If the <code>name</code> parameter is null.
- *
- * @see org.xml.sax.XMLReader#setFeature
- */
- public abstract void setFeature(String name, boolean value)
- throws ParserConfigurationException, SAXNotRecognizedException,
- SAXNotSupportedException;
-
- /**
- *
- * <p>Returns the particular property requested for in the underlying
- * implementation of org.xml.sax.XMLReader.</p>
- *
- * @param name The name of the property to be retrieved.
- *
- * @return Value of the requested property.
- *
- * @throws ParserConfigurationException if a parser cannot be created which satisfies the requested configuration.
- * @throws SAXNotRecognizedException When the underlying XMLReader does not recognize the property name.
- * @throws SAXNotSupportedException When the underlying XMLReader recognizes the property name but doesn't support the property.
- *
- * @see org.xml.sax.XMLReader#getProperty
- */
- public abstract boolean getFeature(String name)
- throws ParserConfigurationException, SAXNotRecognizedException,
- SAXNotSupportedException;
-
-
- /**
- * Gets the {@link Schema} object specified through
- * the {@link #setSchema(Schema schema)} method.
- *
- *
- * @throws UnsupportedOperationException When implementation does not
- * override this method
- *
- * @return
- * the {@link Schema} object that was last set through
- * the {@link #setSchema(Schema)} method, or null
- * if the method was not invoked since a {@link SAXParserFactory}
- * is created.
- *
- * @since 1.5
- */
- public Schema getSchema() {
- throw new UnsupportedOperationException(
- "This parser does not support specification \""
- + this.getClass().getPackage().getSpecificationTitle()
- + "\" version \""
- + this.getClass().getPackage().getSpecificationVersion()
- + "\""
- );
- }
-
- /**
- * <p>Set the {@link Schema} to be used by parsers created
- * from this factory.</p>
- *
- * <p>When a {@link Schema} is non-null, a parser will use a validator
- * created from it to validate documents before it passes information
- * down to the application.</p>
- *
- * <p>When warnings/errors/fatal errors are found by the validator, the parser must
- * handle them as if those errors were found by the parser itself.
- * In other words, if the user-specified {@link org.xml.sax.ErrorHandler}
- * is set, it must receive those errors, and if not, they must be
- * treated according to the implementation specific
- * default error handling rules.
- *
- * <p>A validator may modify the SAX event stream (for example by
- * adding default values that were missing in documents), and a parser
- * is responsible to make sure that the application will receive
- * those modified event stream.</p>
- *
- * <p>Initialy, <code>null</code> is set as the {@link Schema}.</p>
- *
- * <p>This processing will take effect even if
- * the {@link #isValidating()} method returns <code>false</code>.
- *
- * <p>It is an error to use
- * the <code>http://java.sun.com/xml/jaxp/properties/schemaSource</code>
- * property and/or the <code>http://java.sun.com/xml/jaxp/properties/schemaLanguage</code>
- * property in conjunction with a non-null {@link Schema} object.
- * Such configuration will cause a {@link SAXException}
- * exception when those properties are set on a {@link SAXParser}.</p>
- *
- * <h4>Note for implementors</h4>
- * <p>
- * A parser must be able to work with any {@link Schema}
- * implementation. However, parsers and schemas are allowed
- * to use implementation-specific custom mechanisms
- * as long as they yield the result described in the specification.
- * </p>
- *
- * @param schema <code>Schema</code> to use, <code>null</code> to remove a schema.
- *
- * @throws UnsupportedOperationException When implementation does not
- * override this method
- *
- * @since 1.5
- */
- public void setSchema(Schema schema) {
- throw new UnsupportedOperationException(
- "This parser does not support specification \""
- + this.getClass().getPackage().getSpecificationTitle()
- + "\" version \""
- + this.getClass().getPackage().getSpecificationVersion()
- + "\""
- );
- }
-
- /**
- * <p>Set state of XInclude processing.</p>
- *
- * <p>If XInclude markup is found in the document instance, should it be
- * processed as specified in <a href="http://www.w3.org/TR/xinclude/">
- * XML Inclusions (XInclude) Version 1.0</a>.</p>
- *
- * <p>XInclude processing defaults to <code>false</code>.</p>
- *
- * @param state Set XInclude processing to <code>true</code> or
- * <code>false</code>
- *
- * @throws UnsupportedOperationException When implementation does not
- * override this method
- *
- * @since 1.5
- */
- public void setXIncludeAware(final boolean state) {
- if (state) {
- throw new UnsupportedOperationException(" setXIncludeAware " +
- "is not supported on this JAXP" +
- " implementation or earlier: " + this.getClass());
- }
- }
-
- /**
- * <p>Get state of XInclude processing.</p>
- *
- * @return current state of XInclude processing
- *
- * @throws UnsupportedOperationException When implementation does not
- * override this method
- *
- * @since 1.5
- */
- public boolean isXIncludeAware() {
- throw new UnsupportedOperationException(
- "This parser does not support specification \""
- + this.getClass().getPackage().getSpecificationTitle()
- + "\" version \""
- + this.getClass().getPackage().getSpecificationVersion()
- + "\""
- );
- }
-}
diff --git a/src/javax/xml/parsers/SecuritySupport.java b/src/javax/xml/parsers/SecuritySupport.java
deleted file mode 100644
index a2878ca..0000000
--- a/src/javax/xml/parsers/SecuritySupport.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.parsers;
-
-import java.security.*;
-import java.net.*;
-import java.io.*;
-import java.util.*;
-
-/**
- * This class is duplicated for each JAXP subpackage so keep it in sync.
- * It is package private and therefore is not exposed as part of the JAXP
- * API.
- *
- * Security related methods that only work on J2SE 1.2 and newer.
- */
-class SecuritySupport {
-
-
- ClassLoader getContextClassLoader() throws SecurityException{
- return (ClassLoader)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- ClassLoader cl = null;
- //try {
- cl = Thread.currentThread().getContextClassLoader();
- //} catch (SecurityException ex) { }
-
- if (cl == null)
- cl = ClassLoader.getSystemClassLoader();
-
- return cl;
- }
- });
- }
-
- String getSystemProperty(final String propName) {
- return (String)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return System.getProperty(propName);
- }
- });
- }
-
- FileInputStream getFileInputStream(final File file)
- throws FileNotFoundException
- {
- try {
- return (FileInputStream)
- AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws FileNotFoundException {
- return new FileInputStream(file);
- }
- });
- } catch (PrivilegedActionException e) {
- throw (FileNotFoundException)e.getException();
- }
- }
-
- InputStream getResourceAsStream(final ClassLoader cl,
- final String name)
- {
- return (InputStream)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- InputStream ris;
- if (cl == null) {
- ris = Object.class.getResourceAsStream(name);
- } else {
- ris = cl.getResourceAsStream(name);
- }
- return ris;
- }
- });
- }
-
- boolean doesFileExist(final File f) {
- return ((Boolean)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return new Boolean(f.exists());
- }
- })).booleanValue();
- }
-
-}
diff --git a/src/javax/xml/parsers/package.html b/src/javax/xml/parsers/package.html
deleted file mode 100644
index 5209211..0000000
--- a/src/javax/xml/parsers/package.html
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation. Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-
-<!DOCTYPE html
- PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml">
-
-<head>
- <title>javax.xml.parsers</title>
-
- <meta name="CVS"
- content="$Id: package.html,v 1.2 2005/06/10 03:50:29 jeffsuttor Exp $" />
- <meta name="AUTHOR"
- content="Jeff.Suttor@Sun.com" />
-</head>
-<body>
- <p>
- Provides classes allowing the processing of XML documents. Two types
- of plugable parsers are supported:
- </p>
- <ul>
- <li>SAX (Simple API for XML)</li>
- <li>DOM (Document Object Model)</li>
- </ul>
-</body>
-</html>
diff --git a/src/javax/xml/stream/EventFilter.java b/src/javax/xml/stream/EventFilter.java
deleted file mode 100644
index 61feecb..0000000
--- a/src/javax/xml/stream/EventFilter.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- */
-
-package javax.xml.stream;
-
-import javax.xml.stream.events.XMLEvent;
-
-/**
- * This interface declares a simple filter interface that one can
- * create to filter XMLEventReaders
- * @version 1.0
- * @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- * @since 1.6
- */
-public interface EventFilter {
- /**
- * Tests whether this event is part of this stream. This method
- * will return true if this filter accepts this event and false
- * otherwise.
- *
- * @param event the event to test
- * @return true if this filter accepts this event, false otherwise
- */
- public boolean accept(XMLEvent event);
-}
diff --git a/src/javax/xml/stream/FactoryConfigurationError.java b/src/javax/xml/stream/FactoryConfigurationError.java
deleted file mode 100644
index 6192f3d..0000000
--- a/src/javax/xml/stream/FactoryConfigurationError.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- */
-
-package javax.xml.stream;
-
-/**
- * An error class for reporting factory configuration errors.
- *
- * @version 1.0
- * @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- * @since 1.6
- */
-public class FactoryConfigurationError extends Error {
- private static final long serialVersionUID = -2994412584589975744L;
-
- Exception nested;
-
- /**
- * Default constructor
- */
- public FactoryConfigurationError(){}
-
- /**
- * Construct an exception with a nested inner exception
- *
- * @param e the exception to nest
- */
- public FactoryConfigurationError(java.lang.Exception e){
- nested = e;
- }
-
- /**
- * Construct an exception with a nested inner exception
- * and a message
- *
- * @param e the exception to nest
- * @param msg the message to report
- */
- public FactoryConfigurationError(java.lang.Exception e, java.lang.String msg){
- super(msg);
- nested = e;
- }
-
- /**
- * Construct an exception with a nested inner exception
- * and a message
- *
- * @param msg the message to report
- * @param e the exception to nest
- */
- public FactoryConfigurationError(java.lang.String msg, java.lang.Exception e){
- super(msg);
- nested = e;
- }
-
- /**
- * Construct an exception with associated message
- *
- * @param msg the message to report
- */
- public FactoryConfigurationError(java.lang.String msg) {
- super(msg);
- }
-
- /**
- * Return the nested exception (if any)
- *
- * @return the nested exception or null
- */
- public Exception getException() {
- return nested;
- }
- /**
- * use the exception chaining mechanism of JDK1.4
- */
- @Override
- public Throwable getCause() {
- return nested;
- }
-
- /**
- * Report the message associated with this error
- *
- * @return the string value of the message
- */
- public String getMessage() {
- String msg = super.getMessage();
- if(msg != null)
- return msg;
- if(nested != null){
- msg = nested.getMessage();
- if(msg == null)
- msg = nested.getClass().toString();
- }
- return msg;
- }
-
-
-
-}
diff --git a/src/javax/xml/stream/FactoryFinder.java b/src/javax/xml/stream/FactoryFinder.java
deleted file mode 100644
index f34d0f8..0000000
--- a/src/javax/xml/stream/FactoryFinder.java
+++ /dev/null
@@ -1,375 +0,0 @@
-/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.stream;
-
-import java.io.File;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.Iterator;
-import java.util.Properties;
-import java.util.ServiceConfigurationError;
-import java.util.ServiceLoader;
-
-/**
- * <p>Implements pluggable streams.</p>
- *
- * <p>This class is duplicated for each JAXP subpackage so keep it in
- * sync. It is package private for secure class loading.</p>
- *
- * @author Santiago.PericasGeertsen@sun.com
- */
-class FactoryFinder {
- // Check we have access to package.
- private static final String DEFAULT_PACKAGE = "com.sun.xml.internal.";
-
- /**
- * Internal debug flag.
- */
- private static boolean debug = false;
-
- /**
- * Cache for properties in java.home/lib/jaxp.properties
- */
- final private static Properties cacheProps = new Properties();
-
- /**
- * Flag indicating if properties from java.home/lib/jaxp.properties
- * have been cached.
- */
- private static volatile boolean firstTime = true;
-
- /**
- * Security support class use to check access control before
- * getting certain system resources.
- */
- final private static SecuritySupport ss = new SecuritySupport();
-
- // Define system property "jaxp.debug" to get output
- static {
- // Use try/catch block to support applets, which throws
- // SecurityException out of this code.
- try {
- String val = ss.getSystemProperty("jaxp.debug");
- // Allow simply setting the prop to turn on debug
- debug = val != null && !"false".equals(val);
- }
- catch (SecurityException se) {
- debug = false;
- }
- }
-
- private static void dPrint(String msg) {
- if (debug) {
- System.err.println("JAXP: " + msg);
- }
- }
-
- /**
- * Attempt to load a class using the class loader supplied. If that fails
- * and fall back is enabled, the current (i.e. bootstrap) class loader is
- * tried.
- *
- * If the class loader supplied is <code>null</code>, first try using the
- * context class loader followed by the current (i.e. bootstrap) class
- * loader.
- *
- * Use bootstrap classLoader if cl = null and useBSClsLoader is true
- */
- static private Class getProviderClass(String className, ClassLoader cl,
- boolean doFallback, boolean useBSClsLoader) throws ClassNotFoundException
- {
- try {
- if (cl == null) {
- if (useBSClsLoader) {
- return Class.forName(className, false, FactoryFinder.class.getClassLoader());
- } else {
- cl = ss.getContextClassLoader();
- if (cl == null) {
- throw new ClassNotFoundException();
- }
- else {
- return Class.forName(className, false, cl);
- }
- }
- }
- else {
- return Class.forName(className, false, cl);
- }
- }
- catch (ClassNotFoundException e1) {
- if (doFallback) {
- // Use current class loader - should always be bootstrap CL
- return Class.forName(className, false, FactoryFinder.class.getClassLoader());
- }
- else {
- throw e1;
- }
- }
- }
-
- /**
- * Create an instance of a class. Delegates to method
- * <code>getProviderClass()</code> in order to load the class.
- *
- * @param type Base class / Service interface of the factory to
- * instantiate.
- *
- * @param className Name of the concrete class corresponding to the
- * service provider
- *
- * @param cl <code>ClassLoader</code> used to load the factory class. If <code>null</code>
- * current <code>Thread</code>'s context classLoader is used to load the factory class.
- *
- * @param doFallback True if the current ClassLoader should be tried as
- * a fallback if the class is not found using cl
- */
- static <T> T newInstance(Class<T> type, String className, ClassLoader cl, boolean doFallback)
- throws FactoryConfigurationError
- {
- return newInstance(type, className, cl, doFallback, false);
- }
-
- /**
- * Create an instance of a class. Delegates to method
- * <code>getProviderClass()</code> in order to load the class.
- *
- * @param type Base class / Service interface of the factory to
- * instantiate.
- *
- * @param className Name of the concrete class corresponding to the
- * service provider
- *
- * @param cl <code>ClassLoader</code> used to load the factory class. If <code>null</code>
- * current <code>Thread</code>'s context classLoader is used to load the factory class.
- *
- * @param doFallback True if the current ClassLoader should be tried as
- * a fallback if the class is not found using cl
- *
- * @param useBSClsLoader True if cl=null actually meant bootstrap classLoader. This parameter
- * is needed since DocumentBuilderFactory/SAXParserFactory defined null as context classLoader.
- */
- static <T> T newInstance(Class<T> type, String className, ClassLoader cl,
- boolean doFallback, boolean useBSClsLoader)
- throws FactoryConfigurationError
- {
- assert type != null;
-
- // make sure we have access to restricted packages
- if (System.getSecurityManager() != null) {
- if (className != null && className.startsWith(DEFAULT_PACKAGE)) {
- cl = null;
- useBSClsLoader = true;
- }
- }
-
- try {
- Class<?> providerClass = getProviderClass(className, cl, doFallback, useBSClsLoader);
- if (!type.isAssignableFrom(providerClass)) {
- throw new ClassCastException(className + " cannot be cast to " + type.getName());
- }
- Object instance = providerClass.newInstance();
- if (debug) { // Extra check to avoid computing cl strings
- dPrint("created new instance of " + providerClass +
- " using ClassLoader: " + cl);
- }
- return type.cast(instance);
- }
- catch (ClassNotFoundException x) {
- throw new FactoryConfigurationError(
- "Provider " + className + " not found", x);
- }
- catch (Exception x) {
- throw new FactoryConfigurationError(
- "Provider " + className + " could not be instantiated: " + x,
- x);
- }
- }
-
- /**
- * Finds the implementation Class object in the specified order.
- *
- * @return Class object of factory, never null
- *
- * @param type Base class / Service interface of the
- * factory to find.
- *
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * Package private so this code can be shared.
- */
- static <T> T find(Class<T> type, String fallbackClassName)
- throws FactoryConfigurationError
- {
- return find(type, type.getName(), null, fallbackClassName);
- }
-
- /**
- * Finds the implementation Class object in the specified order. Main
- * entry point.
- * @return Class object of factory, never null
- *
- * @param type Base class / Service interface of the
- * factory to find.
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- *
- * @param cl ClassLoader to be used to load the class, null means to use
- * the bootstrap ClassLoader
- *
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * Package private so this code can be shared.
- */
- static <T> T find(Class<T> type, String factoryId, ClassLoader cl, String fallbackClassName)
- throws FactoryConfigurationError
- {
- dPrint("find factoryId =" + factoryId);
-
- // Use the system property first
- try {
-
- final String systemProp;
- if (type.getName().equals(factoryId)) {
- systemProp = ss.getSystemProperty(factoryId);
- } else {
- systemProp = System.getProperty(factoryId);
- }
- if (systemProp != null) {
- dPrint("found system property, value=" + systemProp);
- return newInstance(type, systemProp, cl, true);
- }
- }
- catch (SecurityException se) {
- throw new FactoryConfigurationError(
- "Failed to read factoryId '" + factoryId + "'", se);
- }
-
- // Try read $java.home/lib/stax.properties followed by
- // $java.home/lib/jaxp.properties if former not present
- String configFile = null;
- try {
- if (firstTime) {
- synchronized (cacheProps) {
- if (firstTime) {
- configFile = ss.getSystemProperty("java.home") + File.separator +
- "lib" + File.separator + "stax.properties";
- File f = new File(configFile);
- firstTime = false;
- if (ss.doesFileExist(f)) {
- dPrint("Read properties file "+f);
- cacheProps.load(ss.getFileInputStream(f));
- }
- else {
- configFile = ss.getSystemProperty("java.home") + File.separator +
- "lib" + File.separator + "jaxp.properties";
- f = new File(configFile);
- if (ss.doesFileExist(f)) {
- dPrint("Read properties file "+f);
- cacheProps.load(ss.getFileInputStream(f));
- }
- }
- }
- }
- }
- final String factoryClassName = cacheProps.getProperty(factoryId);
-
- if (factoryClassName != null) {
- dPrint("found in " + configFile + " value=" + factoryClassName);
- return newInstance(type, factoryClassName, cl, true);
- }
- }
- catch (Exception ex) {
- if (debug) ex.printStackTrace();
- }
-
- if (type.getName().equals(factoryId)) {
- // Try Jar Service Provider Mechanism
- final T provider = findServiceProvider(type, cl);
- if (provider != null) {
- return provider;
- }
- } else {
- // We're in the case where a 'custom' factoryId was provided,
- // and in every case where that happens, we expect that
- // fallbackClassName will be null.
- assert fallbackClassName == null;
- }
- if (fallbackClassName == null) {
- throw new FactoryConfigurationError(
- "Provider for " + factoryId + " cannot be found", null);
- }
-
- dPrint("loaded from fallback value: " + fallbackClassName);
- return newInstance(type, fallbackClassName, cl, true);
- }
-
- /*
- * Try to find provider using the ServiceLoader API
- *
- * @param type Base class / Service interface of the factory to find.
- *
- * @return instance of provider class if found or null
- */
- private static <T> T findServiceProvider(final Class<T> type, final ClassLoader cl) {
- try {
- return AccessController.doPrivileged(new PrivilegedAction<T>() {
- @Override
- public T run() {
- final ServiceLoader<T> serviceLoader;
- if (cl == null) {
- //the current thread's context class loader
- serviceLoader = ServiceLoader.load(type);
- } else {
- serviceLoader = ServiceLoader.load(type, cl);
- }
- final Iterator<T> iterator = serviceLoader.iterator();
- if (iterator.hasNext()) {
- return iterator.next();
- } else {
- return null;
- }
- }
- });
- } catch(ServiceConfigurationError e) {
- // It is not possible to wrap an error directly in
- // FactoryConfigurationError - so we need to wrap the
- // ServiceConfigurationError in a RuntimeException.
- // The alternative would be to modify the logic in
- // FactoryConfigurationError to allow setting a
- // Throwable as the cause, but that could cause
- // compatibility issues down the road.
- final RuntimeException x = new RuntimeException(
- "Provider for " + type + " cannot be created", e);
- final FactoryConfigurationError error =
- new FactoryConfigurationError(x, x.getMessage());
- throw error;
- }
- }
-
-}
diff --git a/src/javax/xml/stream/Location.java b/src/javax/xml/stream/Location.java
deleted file mode 100644
index 74a25f3..0000000
--- a/src/javax/xml/stream/Location.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- */
-
-package javax.xml.stream;
-
-/**
- * Provides information on the location of an event.
- *
- * All the information provided by a Location is optional. For example
- * an application may only report line numbers.
- *
- * @version 1.0
- * @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- * @since 1.6
- */
-public interface Location {
- /**
- * Return the line number where the current event ends,
- * returns -1 if none is available.
- * @return the current line number
- */
- int getLineNumber();
-
- /**
- * Return the column number where the current event ends,
- * returns -1 if none is available.
- * @return the current column number
- */
- int getColumnNumber();
-
- /**
- * Return the byte or character offset into the input source this location
- * is pointing to. If the input source is a file or a byte stream then
- * this is the byte offset into that stream, but if the input source is
- * a character media then the offset is the character offset.
- * Returns -1 if there is no offset available.
- * @return the current offset
- */
- int getCharacterOffset();
-
- /**
- * Returns the public ID of the XML
- * @return the public ID, or null if not available
- */
- public String getPublicId();
-
- /**
- * Returns the system ID of the XML
- * @return the system ID, or null if not available
- */
- public String getSystemId();
-}
diff --git a/src/javax/xml/stream/SecuritySupport.java b/src/javax/xml/stream/SecuritySupport.java
deleted file mode 100644
index 500aa9a..0000000
--- a/src/javax/xml/stream/SecuritySupport.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.stream;
-
-import java.security.*;
-import java.net.*;
-import java.io.*;
-import java.util.*;
-
-/**
- * This class is duplicated for each JAXP subpackage so keep it in sync.
- * It is package private and therefore is not exposed as part of the JAXP
- * API.
- *
- * Security related methods that only work on J2SE 1.2 and newer.
- */
-class SecuritySupport {
-
-
- ClassLoader getContextClassLoader() throws SecurityException{
- return (ClassLoader)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- ClassLoader cl = null;
- //try {
- cl = Thread.currentThread().getContextClassLoader();
- //} catch (SecurityException ex) { }
-
- if (cl == null)
- cl = ClassLoader.getSystemClassLoader();
-
- return cl;
- }
- });
- }
-
- String getSystemProperty(final String propName) {
- return (String)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return System.getProperty(propName);
- }
- });
- }
-
- FileInputStream getFileInputStream(final File file)
- throws FileNotFoundException
- {
- try {
- return (FileInputStream)
- AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws FileNotFoundException {
- return new FileInputStream(file);
- }
- });
- } catch (PrivilegedActionException e) {
- throw (FileNotFoundException)e.getException();
- }
- }
-
- InputStream getResourceAsStream(final ClassLoader cl,
- final String name)
- {
- return (InputStream)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- InputStream ris;
- if (cl == null) {
- ris = Object.class.getResourceAsStream(name);
- } else {
- ris = cl.getResourceAsStream(name);
- }
- return ris;
- }
- });
- }
-
- boolean doesFileExist(final File f) {
- return ((Boolean)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return new Boolean(f.exists());
- }
- })).booleanValue();
- }
-
-}
diff --git a/src/javax/xml/stream/StreamFilter.java b/src/javax/xml/stream/StreamFilter.java
deleted file mode 100644
index d248d6d..0000000
--- a/src/javax/xml/stream/StreamFilter.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- */
-
-package javax.xml.stream;
-
-/**
- * This interface declares a simple filter interface that one can
- * create to filter XMLStreamReaders
- * @version 1.0
- * @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- * @since 1.6
- */
-public interface StreamFilter {
-
- /**
- * Tests whether the current state is part of this stream. This method
- * will return true if this filter accepts this event and false otherwise.
- *
- * The method should not change the state of the reader when accepting
- * a state.
- *
- * @param reader the event to test
- * @return true if this filter accepts this event, false otherwise
- */
- public boolean accept(XMLStreamReader reader);
-}
diff --git a/src/javax/xml/stream/XMLEventFactory.java b/src/javax/xml/stream/XMLEventFactory.java
deleted file mode 100644
index 548feeb..0000000
--- a/src/javax/xml/stream/XMLEventFactory.java
+++ /dev/null
@@ -1,464 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Copyright (c) 2009, 2013, by Oracle Corporation. All Rights Reserved.
- */
-
-package javax.xml.stream;
-import java.util.Iterator;
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.namespace.QName;
-import javax.xml.stream.events.*;
-/**
- * This interface defines a utility class for creating instances of
- * XMLEvents
- * @version 1.2
- * @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- * @see javax.xml.stream.events.StartElement
- * @see javax.xml.stream.events.EndElement
- * @see javax.xml.stream.events.ProcessingInstruction
- * @see javax.xml.stream.events.Comment
- * @see javax.xml.stream.events.Characters
- * @see javax.xml.stream.events.StartDocument
- * @see javax.xml.stream.events.EndDocument
- * @see javax.xml.stream.events.DTD
- * @since 1.6
- */
-public abstract class XMLEventFactory {
- protected XMLEventFactory(){}
-
- static final String JAXPFACTORYID = "javax.xml.stream.XMLEventFactory";
- static final String DEFAULIMPL = "com.sun.xml.internal.stream.events.XMLEventFactoryImpl";
-
-
- /**
- * Creates a new instance of the factory in exactly the same manner as the
- * {@link #newFactory()} method.
- * @throws FactoryConfigurationError if an instance of this factory cannot be loaded
- */
- public static XMLEventFactory newInstance()
- throws FactoryConfigurationError
- {
- return FactoryFinder.find(XMLEventFactory.class, DEFAULIMPL);
- }
-
- /**
- * Create a new instance of the factory.
- * <p>
- * This static method creates a new factory instance.
- * This method uses the following ordered lookup procedure to determine
- * the XMLEventFactory implementation class to load:
- * </p>
- * <ul>
- * <li>
- * Use the javax.xml.stream.XMLEventFactory system property.
- * </li>
- * <li>
- * Use the properties file "lib/stax.properties" in the JRE directory.
- * This configuration file is in standard java.util.Properties format
- * and contains the fully qualified name of the implementation class
- * with the key being the system property defined above.
- * </li>
- * <li>
- * Use the service-provider loading facilities, defined by the
- * {@link java.util.ServiceLoader} class, to attempt to locate and load an
- * implementation of the service using the {@linkplain
- * java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}:
- * the service-provider loading facility will use the {@linkplain
- * java.lang.Thread#getContextClassLoader() current thread's context class loader}
- * to attempt to load the service. If the context class
- * loader is null, the {@linkplain
- * ClassLoader#getSystemClassLoader() system class loader} will be used.
- * </li>
- * <li>
- * Otherwise, the system-default implementation is returned.
- * </li>
- * </ul>
- * <p>
- * Once an application has obtained a reference to a XMLEventFactory it
- * can use the factory to configure and obtain stream instances.
- * </p>
- * <p>
- * Note that this is a new method that replaces the deprecated newInstance() method.
- * No changes in behavior are defined by this replacement method relative to
- * the deprecated method.
- * </p>
- * @throws FactoryConfigurationError in case of {@linkplain
- * java.util.ServiceConfigurationError service configuration error} or if
- * the implementation is not available or cannot be instantiated.
- */
- public static XMLEventFactory newFactory()
- throws FactoryConfigurationError
- {
- return FactoryFinder.find(XMLEventFactory.class, DEFAULIMPL);
- }
-
- /**
- * Create a new instance of the factory
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param classLoader classLoader to use
- * @return the factory implementation
- * @throws FactoryConfigurationError if an instance of this factory cannot be loaded
- *
- * @deprecated This method has been deprecated to maintain API consistency.
- * All newInstance methods have been replaced with corresponding
- * newFactory methods. The replacement {@link
- * #newFactory(java.lang.String, java.lang.ClassLoader)}
- * method defines no changes in behavior.
- */
- public static XMLEventFactory newInstance(String factoryId,
- ClassLoader classLoader)
- throws FactoryConfigurationError {
- //do not fallback if given classloader can't find the class, throw exception
- return FactoryFinder.find(XMLEventFactory.class, factoryId, classLoader, null);
- }
-
- /**
- * Create a new instance of the factory.
- * If the classLoader argument is null, then the ContextClassLoader is used.
- * <p>
- * This method uses the following ordered lookup procedure to determine
- * the XMLEventFactory implementation class to load:
- * </p>
- * <ul>
- * <li>
- * Use the value of the system property identified by {@code factoryId}.
- * </li>
- * <li>
- * Use the properties file "lib/stax.properties" in the JRE directory.
- * This configuration file is in standard java.util.Properties format
- * and contains the fully qualified name of the implementation class
- * with the key being the given {@code factoryId}.
- * </li>
- * <li>
- * If {@code factoryId} is "javax.xml.stream.XMLEventFactory",
- * use the service-provider loading facilities, defined by the
- * {@link java.util.ServiceLoader} class, to attempt to {@linkplain
- * java.util.ServiceLoader#load(java.lang.Class, java.lang.ClassLoader) locate and load}
- * an implementation of the service using the specified {@code ClassLoader}.
- * If {@code classLoader} is null, the {@linkplain
- * java.util.ServiceLoader#load(java.lang.Class) default loading mechanism} will apply:
- * That is, the service-provider loading facility will use the {@linkplain
- * java.lang.Thread#getContextClassLoader() current thread's context class loader}
- * to attempt to load the service. If the context class
- * loader is null, the {@linkplain
- * ClassLoader#getSystemClassLoader() system class loader} will be used.
- * </li>
- * <li>
- * Otherwise, throws a {@link FactoryConfigurationError}.
- * </li>
- * </ul>
- *
- * <p>
- * Note that this is a new method that replaces the deprecated
- * {@link #newInstance(java.lang.String, java.lang.ClassLoader)
- * newInstance(String factoryId, ClassLoader classLoader)} method.
- * No changes in behavior are defined by this replacement method relative
- * to the deprecated method.
- * </p>
- *
- * @apiNote The parameter factoryId defined here is inconsistent with that
- * of other JAXP factories where the first parameter is fully qualified
- * factory class name that provides implementation of the factory.
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param classLoader classLoader to use
- * @return the factory implementation
- * @throws FactoryConfigurationError in case of {@linkplain
- * java.util.ServiceConfigurationError service configuration error} or if
- * the implementation is not available or cannot be instantiated.
- */
- public static XMLEventFactory newFactory(String factoryId,
- ClassLoader classLoader)
- throws FactoryConfigurationError {
- //do not fallback if given classloader can't find the class, throw exception
- return FactoryFinder.find(XMLEventFactory.class, factoryId, classLoader, null);
- }
-
- /**
- * This method allows setting of the Location on each event that
- * is created by this factory. The values are copied by value into
- * the events created by this factory. To reset the location
- * information set the location to null.
- * @param location the location to set on each event created
- */
- public abstract void setLocation(Location location);
-
- /**
- * Create a new Attribute
- * @param prefix the prefix of this attribute, may not be null
- * @param namespaceURI the attribute value is set to this value, may not be null
- * @param localName the local name of the XML name of the attribute, localName cannot be null
- * @param value the attribute value to set, may not be null
- * @return the Attribute with specified values
- */
- public abstract Attribute createAttribute(String prefix, String namespaceURI, String localName, String value);
-
- /**
- * Create a new Attribute
- * @param localName the local name of the XML name of the attribute, localName cannot be null
- * @param value the attribute value to set, may not be null
- * @return the Attribute with specified values
- */
- public abstract Attribute createAttribute(String localName, String value);
-
- /**
- * Create a new Attribute
- * @param name the qualified name of the attribute, may not be null
- * @param value the attribute value to set, may not be null
- * @return the Attribute with specified values
- */
- public abstract Attribute createAttribute(QName name, String value);
-
- /**
- * Create a new default Namespace
- * @param namespaceURI the default namespace uri
- * @return the Namespace with the specified value
- */
- public abstract Namespace createNamespace(String namespaceURI);
-
- /**
- * Create a new Namespace
- * @param prefix the prefix of this namespace, may not be null
- * @param namespaceUri the attribute value is set to this value, may not be null
- * @return the Namespace with the specified values
- */
- public abstract Namespace createNamespace(String prefix, String namespaceUri);
-
- /**
- * Create a new StartElement. Namespaces can be added to this StartElement
- * by passing in an Iterator that walks over a set of Namespace interfaces.
- * Attributes can be added to this StartElement by passing an iterator
- * that walks over a set of Attribute interfaces.
- *
- * @param name the qualified name of the attribute, may not be null
- * @param attributes an optional unordered set of objects that
- * implement Attribute to add to the new StartElement, may be null
- * @param namespaces an optional unordered set of objects that
- * implement Namespace to add to the new StartElement, may be null
- * @return an instance of the requested StartElement
- */
- public abstract StartElement createStartElement(QName name,
- Iterator attributes,
- Iterator namespaces);
-
- /**
- * Create a new StartElement. This defaults the NamespaceContext to
- * an empty NamespaceContext. Querying this event for its namespaces or
- * attributes will result in an empty iterator being returned.
- *
- * @param namespaceUri the uri of the QName of the new StartElement
- * @param localName the local name of the QName of the new StartElement
- * @param prefix the prefix of the QName of the new StartElement
- * @return an instance of the requested StartElement
- */
- public abstract StartElement createStartElement(String prefix,
- String namespaceUri,
- String localName);
- /**
- * Create a new StartElement. Namespaces can be added to this StartElement
- * by passing in an Iterator that walks over a set of Namespace interfaces.
- * Attributes can be added to this StartElement by passing an iterator
- * that walks over a set of Attribute interfaces.
- *
- * @param namespaceUri the uri of the QName of the new StartElement
- * @param localName the local name of the QName of the new StartElement
- * @param prefix the prefix of the QName of the new StartElement
- * @param attributes an unordered set of objects that implement
- * Attribute to add to the new StartElement
- * @param namespaces an unordered set of objects that implement
- * Namespace to add to the new StartElement
- * @return an instance of the requested StartElement
- */
- public abstract StartElement createStartElement(String prefix,
- String namespaceUri,
- String localName,
- Iterator attributes,
- Iterator namespaces
- );
- /**
- * Create a new StartElement. Namespaces can be added to this StartElement
- * by passing in an Iterator that walks over a set of Namespace interfaces.
- * Attributes can be added to this StartElement by passing an iterator
- * that walks over a set of Attribute interfaces.
- *
- * @param namespaceUri the uri of the QName of the new StartElement
- * @param localName the local name of the QName of the new StartElement
- * @param prefix the prefix of the QName of the new StartElement
- * @param attributes an unordered set of objects that implement
- * Attribute to add to the new StartElement, may be null
- * @param namespaces an unordered set of objects that implement
- * Namespace to add to the new StartElement, may be null
- * @param context the namespace context of this element
- * @return an instance of the requested StartElement
- */
- public abstract StartElement createStartElement(String prefix,
- String namespaceUri,
- String localName,
- Iterator attributes,
- Iterator namespaces,
- NamespaceContext context
- );
-
- /**
- * Create a new EndElement
- * @param name the qualified name of the EndElement
- * @param namespaces an optional unordered set of objects that
- * implement Namespace that have gone out of scope, may be null
- * @return an instance of the requested EndElement
- */
- public abstract EndElement createEndElement(QName name,
- Iterator namespaces);
-
- /**
- * Create a new EndElement
- * @param namespaceUri the uri of the QName of the new StartElement
- * @param localName the local name of the QName of the new StartElement
- * @param prefix the prefix of the QName of the new StartElement
- * @return an instance of the requested EndElement
- */
- public abstract EndElement createEndElement(String prefix,
- String namespaceUri,
- String localName);
- /**
- * Create a new EndElement
- * @param namespaceUri the uri of the QName of the new StartElement
- * @param localName the local name of the QName of the new StartElement
- * @param prefix the prefix of the QName of the new StartElement
- * @param namespaces an unordered set of objects that implement
- * Namespace that have gone out of scope, may be null
- * @return an instance of the requested EndElement
- */
- public abstract EndElement createEndElement(String prefix,
- String namespaceUri,
- String localName,
- Iterator namespaces);
-
- /**
- * Create a Characters event, this method does not check if the content
- * is all whitespace. To create a space event use #createSpace(String)
- * @param content the string to create
- * @return a Characters event
- */
- public abstract Characters createCharacters(String content);
-
- /**
- * Create a Characters event with the CData flag set to true
- * @param content the string to create
- * @return a Characters event
- */
- public abstract Characters createCData(String content);
-
- /**
- * Create a Characters event with the isSpace flag set to true
- * @param content the content of the space to create
- * @return a Characters event
- */
- public abstract Characters createSpace(String content);
- /**
- * Create an ignorable space
- * @param content the space to create
- * @return a Characters event
- */
- public abstract Characters createIgnorableSpace(String content);
-
- /**
- * Creates a new instance of a StartDocument event
- * @return a StartDocument event
- */
- public abstract StartDocument createStartDocument();
-
- /**
- * Creates a new instance of a StartDocument event
- *
- * @param encoding the encoding style
- * @param version the XML version
- * @param standalone the status of standalone may be set to "true" or "false"
- * @return a StartDocument event
- */
- public abstract StartDocument createStartDocument(String encoding,
- String version,
- boolean standalone);
-
- /**
- * Creates a new instance of a StartDocument event
- *
- * @param encoding the encoding style
- * @param version the XML version
- * @return a StartDocument event
- */
- public abstract StartDocument createStartDocument(String encoding,
- String version);
-
- /**
- * Creates a new instance of a StartDocument event
- *
- * @param encoding the encoding style
- * @return a StartDocument event
- */
- public abstract StartDocument createStartDocument(String encoding);
-
- /**
- * Creates a new instance of an EndDocument event
- * @return an EndDocument event
- */
- public abstract EndDocument createEndDocument();
-
- /** Creates a new instance of a EntityReference event
- *
- * @param name The name of the reference
- * @param declaration the declaration for the event
- * @return an EntityReference event
- */
- public abstract EntityReference createEntityReference(String name,
- EntityDeclaration declaration);
- /**
- * Create a comment
- * @param text The text of the comment
- * a Comment event
- */
- public abstract Comment createComment(String text);
-
- /**
- * Create a processing instruction
- * @param target The target of the processing instruction
- * @param data The text of the processing instruction
- * @return a ProcessingInstruction event
- */
- public abstract ProcessingInstruction createProcessingInstruction(String target,
- String data);
-
- /**
- * Create a document type definition event
- * This string contains the entire document type declaration that matches
- * the doctypedecl in the XML 1.0 specification
- * @param dtd the text of the document type definition
- * @return a DTD event
- */
- public abstract DTD createDTD(String dtd);
-}
diff --git a/src/javax/xml/stream/XMLEventReader.java b/src/javax/xml/stream/XMLEventReader.java
deleted file mode 100644
index 97d2076..0000000
--- a/src/javax/xml/stream/XMLEventReader.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- */
-
-package javax.xml.stream;
-
-import javax.xml.stream.events.XMLEvent;
-
-import java.util.Iterator;
-
-/**
- *
- * This is the top level interface for parsing XML Events. It provides
- * the ability to peek at the next event and returns configuration
- * information through the property interface.
- *
- * @version 1.0
- * @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- * @see XMLInputFactory
- * @see XMLEventWriter
- * @since 1.6
- */
-public interface XMLEventReader extends Iterator {
- /**
- * Get the next XMLEvent
- * @see XMLEvent
- * @throws XMLStreamException if there is an error with the underlying XML.
- * @throws NoSuchElementException iteration has no more elements.
- */
- public XMLEvent nextEvent() throws XMLStreamException;
-
- /**
- * Check if there are more events.
- * Returns true if there are more events and false otherwise.
- * @return true if the event reader has more events, false otherwise
- */
- public boolean hasNext();
-
- /**
- * Check the next XMLEvent without reading it from the stream.
- * Returns null if the stream is at EOF or has no more XMLEvents.
- * A call to peek() will be equal to the next return of next().
- * @see XMLEvent
- * @throws XMLStreamException
- */
- public XMLEvent peek() throws XMLStreamException;
-
- /**
- * Reads the content of a text-only element. Precondition:
- * the current event is START_ELEMENT. Postcondition:
- * The current event is the corresponding END_ELEMENT.
- * @throws XMLStreamException if the current event is not a START_ELEMENT
- * or if a non text element is encountered
- */
- public String getElementText() throws XMLStreamException;
-
- /**
- * Skips any insignificant space events until a START_ELEMENT or
- * END_ELEMENT is reached. If anything other than space characters are
- * encountered, an exception is thrown. This method should
- * be used when processing element-only content because
- * the parser is not able to recognize ignorable whitespace if
- * the DTD is missing or not interpreted.
- * @throws XMLStreamException if anything other than space characters are encountered
- */
- public XMLEvent nextTag() throws XMLStreamException;
-
- /**
- * Get the value of a feature/property from the underlying implementation
- * @param name The name of the property
- * @return The value of the property
- * @throws IllegalArgumentException if the property is not supported
- */
- public Object getProperty(java.lang.String name) throws java.lang.IllegalArgumentException;
-
- /**
- * Frees any resources associated with this Reader. This method does not close the
- * underlying input source.
- * @throws XMLStreamException if there are errors freeing associated resources
- */
- public void close() throws XMLStreamException;
-}
diff --git a/src/javax/xml/stream/XMLEventWriter.java b/src/javax/xml/stream/XMLEventWriter.java
deleted file mode 100644
index f389da6..0000000
--- a/src/javax/xml/stream/XMLEventWriter.java
+++ /dev/null
@@ -1,256 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- */
-
-package javax.xml.stream;
-
-import javax.xml.stream.events.*;
-import javax.xml.stream.util.XMLEventConsumer;
-import javax.xml.namespace.NamespaceContext;
-
-/**
- *
- * This is the top level interface for writing XML documents.
- *
- * Instances of this interface are not required to validate the
- * form of the XML.
- *
- * @version 1.0
- * @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- * @see XMLEventReader
- * @see javax.xml.stream.events.XMLEvent
- * @see javax.xml.stream.events.Characters
- * @see javax.xml.stream.events.ProcessingInstruction
- * @see javax.xml.stream.events.StartElement
- * @see javax.xml.stream.events.EndElement
- * @since 1.6
- */
-public interface XMLEventWriter extends XMLEventConsumer {
-
- /**
- * Writes any cached events to the underlying output mechanism
- * @throws XMLStreamException
- */
- public void flush() throws XMLStreamException;
-
- /**
- * Frees any resources associated with this stream
- * @throws XMLStreamException
- */
- public void close() throws XMLStreamException;
-
- /**
- * Add an event to the output stream
- * Adding a START_ELEMENT will open a new namespace scope that
- * will be closed when the corresponding END_ELEMENT is written.
- * <table border="2" rules="all" cellpadding="4">
- * <thead>
- * <tr>
- * <th align="center" colspan="2">
- * Required and optional fields for events added to the writer
- * </th>
- * </tr>
- * </thead>
- * <tbody>
- * <tr>
- * <th>Event Type</th>
- * <th>Required Fields</th>
- * <th>Optional Fields</th>
- * <th>Required Behavior</th>
- * </tr>
- * <tr>
- * <td> START_ELEMENT </td>
- * <td> QName name </td>
- * <td> namespaces , attributes </td>
- * <td> A START_ELEMENT will be written by writing the name,
- * namespaces, and attributes of the event in XML 1.0 valid
- * syntax for START_ELEMENTs.
- * The name is written by looking up the prefix for
- * the namespace uri. The writer can be configured to
- * respect prefixes of QNames. If the writer is respecting
- * prefixes it must use the prefix set on the QName. The
- * default behavior is to lookup the value for the prefix
- * on the EventWriter's internal namespace context.
- * Each attribute (if any)
- * is written using the behavior specified in the attribute
- * section of this table. Each namespace (if any) is written
- * using the behavior specified in the namespace section of this
- * table.
- * </td>
- * </tr>
- * <tr>
- * <td> END_ELEMENT </td>
- * <td> Qname name </td>
- * <td> None </td>
- * <td> A well formed END_ELEMENT tag is written.
- * The name is written by looking up the prefix for
- * the namespace uri. The writer can be configured to
- * respect prefixes of QNames. If the writer is respecting
- * prefixes it must use the prefix set on the QName. The
- * default behavior is to lookup the value for the prefix
- * on the EventWriter's internal namespace context.
- * If the END_ELEMENT name does not match the START_ELEMENT
- * name an XMLStreamException is thrown.
- * </td>
- * </tr>
- * <tr>
- * <td> ATTRIBUTE </td>
- * <td> QName name , String value </td>
- * <td> QName type </td>
- * <td> An attribute is written using the same algorithm
- * to find the lexical form as used in START_ELEMENT.
- * The default is to use double quotes to wrap attribute
- * values and to escape any double quotes found in the
- * value. The type value is ignored.
- * </td>
- * </tr>
- * <tr>
- * <td> NAMESPACE </td>
- * <td> String prefix, String namespaceURI,
- * boolean isDefaultNamespaceDeclaration
- * </td>
- * <td> None </td>
- * <td> A namespace declaration is written. If the
- * namespace is a default namespace declaration
- * (isDefault is true) then xmlns="$namespaceURI"
- * is written and the prefix is optional. If
- * isDefault is false, the prefix must be declared
- * and the writer must prepend xmlns to the prefix
- * and write out a standard prefix declaration.
- * </td>
- * </tr>
- * <tr>
- * <td> PROCESSING_INSTRUCTION </td>
- * <td> None</td>
- * <td> String target, String data</td>
- * <td> The data does not need to be present and may be
- * null. Target is required and many not be null.
- * The writer
- * will write data section
- * directly after the target,
- * enclosed in appropriate XML 1.0 syntax
- * </td>
- * </tr>
- * <tr>
- * <td> COMMENT </td>
- * <td> None </td>
- * <td> String comment </td>
- * <td> If the comment is present (not null) it is written, otherwise an
- * an empty comment is written
- * </td>
- * </tr>
- * <tr>
- * <td> START_DOCUMENT </td>
- * <td> None </td>
- * <td> String encoding , boolean standalone, String version </td>
- * <td> A START_DOCUMENT event is not required to be written to the
- * stream. If present the attributes are written inside
- * the appropriate XML declaration syntax
- * </td>
- * </tr>
- * <tr>
- * <td> END_DOCUMENT </td>
- * <td> None </td>
- * <td> None </td>
- * <td> Nothing is written to the output </td>
- * </tr>
- * <tr>
- * <td> DTD </td>
- * <td> String DocumentTypeDefinition </td>
- * <td> None </td>
- * <td> The DocumentTypeDefinition is written to the output </td>
- * </tr>
- * </tbody>
- * </table>
- * @param event the event to be added
- * @throws XMLStreamException
- */
- public void add(XMLEvent event) throws XMLStreamException;
-
- /**
- * Adds an entire stream to an output stream,
- * calls next() on the inputStream argument until hasNext() returns false
- * This should be treated as a convenience method that will
- * perform the following loop over all the events in an
- * event reader and call add on each event.
- *
- * @param reader the event stream to add to the output
- * @throws XMLStreamException
- */
-
- public void add(XMLEventReader reader) throws XMLStreamException;
-
- /**
- * Gets the prefix the uri is bound to
- * @param uri the uri to look up
- * @throws XMLStreamException
- */
- public String getPrefix(String uri) throws XMLStreamException;
-
- /**
- * Sets the prefix the uri is bound to. This prefix is bound
- * in the scope of the current START_ELEMENT / END_ELEMENT pair.
- * If this method is called before a START_ELEMENT has been written
- * the prefix is bound in the root scope.
- * @param prefix the prefix to bind to the uri
- * @param uri the uri to bind to the prefix
- * @throws XMLStreamException
- */
- public void setPrefix(String prefix, String uri) throws XMLStreamException;
-
- /**
- * Binds a URI to the default namespace
- * This URI is bound
- * in the scope of the current START_ELEMENT / END_ELEMENT pair.
- * If this method is called before a START_ELEMENT has been written
- * the uri is bound in the root scope.
- * @param uri the uri to bind to the default namespace
- * @throws XMLStreamException
- */
- public void setDefaultNamespace(String uri) throws XMLStreamException;
-
- /**
- * Sets the current namespace context for prefix and uri bindings.
- * This context becomes the root namespace context for writing and
- * will replace the current root namespace context. Subsequent calls
- * to setPrefix and setDefaultNamespace will bind namespaces using
- * the context passed to the method as the root context for resolving
- * namespaces.
- * @param context the namespace context to use for this writer
- * @throws XMLStreamException
- */
- public void setNamespaceContext(NamespaceContext context)
- throws XMLStreamException;
-
- /**
- * Returns the current namespace context.
- * @return the current namespace context
- */
- public NamespaceContext getNamespaceContext();
-
-
-}
diff --git a/src/javax/xml/stream/XMLInputFactory.java b/src/javax/xml/stream/XMLInputFactory.java
deleted file mode 100644
index 20af7a0..0000000
--- a/src/javax/xml/stream/XMLInputFactory.java
+++ /dev/null
@@ -1,510 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Copyright (c) 2009, 2013, by Oracle Corporation. All Rights Reserved.
- */
-
-package javax.xml.stream;
-
-import javax.xml.stream.util.XMLEventAllocator;
-import javax.xml.transform.Source;
-
-/**
- * Defines an abstract implementation of a factory for getting streams.
- *
- * The following table defines the standard properties of this specification.
- * Each property varies in the level of support required by each implementation.
- * The level of support required is described in the 'Required' column.
- *
- * <table border="2" rules="all" cellpadding="4">
- * <thead>
- * <tr>
- * <th align="center" colspan="5">
- * Configuration parameters
- * </th>
- * </tr>
- * </thead>
- * <tbody>
- * <tr>
- * <th>Property Name</th>
- * <th>Behavior</th>
- * <th>Return type</th>
- * <th>Default Value</th>
- * <th>Required</th>
- * </tr>
- * <tr><td>javax.xml.stream.isValidating</td><td>Turns on/off implementation specific DTD validation</td><td>Boolean</td><td>False</td><td>No</td></tr>
- * <tr><td>javax.xml.stream.isNamespaceAware</td><td>Turns on/off namespace processing for XML 1.0 support</td><td>Boolean</td><td>True</td><td>True (required) / False (optional)</td></tr>
- * <tr><td>javax.xml.stream.isCoalescing</td><td>Requires the processor to coalesce adjacent character data</td><td>Boolean</td><td>False</td><td>Yes</td></tr>
- * <tr><td>javax.xml.stream.isReplacingEntityReferences</td><td>replace internal entity references with their replacement text and report them as characters</td><td>Boolean</td><td>True</td><td>Yes</td></tr>
- *<tr><td>javax.xml.stream.isSupportingExternalEntities</td><td>Resolve external parsed entities</td><td>Boolean</td><td>Unspecified</td><td>Yes</td></tr>
- *<tr><td>javax.xml.stream.supportDTD</td><td>Use this property to request processors that do not support DTDs</td><td>Boolean</td><td>True</td><td>Yes</td></tr>
- *<tr><td>javax.xml.stream.reporter</td><td>sets/gets the impl of the XMLReporter </td><td>javax.xml.stream.XMLReporter</td><td>Null</td><td>Yes</td></tr>
- *<tr><td>javax.xml.stream.resolver</td><td>sets/gets the impl of the XMLResolver interface</td><td>javax.xml.stream.XMLResolver</td><td>Null</td><td>Yes</td></tr>
- *<tr><td>javax.xml.stream.allocator</td><td>sets/gets the impl of the XMLEventAllocator interface</td><td>javax.xml.stream.util.XMLEventAllocator</td><td>Null</td><td>Yes</td></tr>
- * </tbody>
- * </table>
- *
- *
- * @version 1.2
- * @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- * @see XMLOutputFactory
- * @see XMLEventReader
- * @see XMLStreamReader
- * @see EventFilter
- * @see XMLReporter
- * @see XMLResolver
- * @see javax.xml.stream.util.XMLEventAllocator
- * @since 1.6
- */
-
-public abstract class XMLInputFactory {
- /**
- * The property used to turn on/off namespace support,
- * this is to support XML 1.0 documents,
- * only the true setting must be supported
- */
- public static final String IS_NAMESPACE_AWARE=
- "javax.xml.stream.isNamespaceAware";
-
- /**
- * The property used to turn on/off implementation specific validation
- */
- public static final String IS_VALIDATING=
- "javax.xml.stream.isValidating";
-
- /**
- * The property that requires the parser to coalesce adjacent character data sections
- */
- public static final String IS_COALESCING=
- "javax.xml.stream.isCoalescing";
-
- /**
- * Requires the parser to replace internal
- * entity references with their replacement
- * text and report them as characters
- */
- public static final String IS_REPLACING_ENTITY_REFERENCES=
- "javax.xml.stream.isReplacingEntityReferences";
-
- /**
- * The property that requires the parser to resolve external parsed entities
- */
- public static final String IS_SUPPORTING_EXTERNAL_ENTITIES=
- "javax.xml.stream.isSupportingExternalEntities";
-
- /**
- * The property that requires the parser to support DTDs
- */
- public static final String SUPPORT_DTD=
- "javax.xml.stream.supportDTD";
-
- /**
- * The property used to
- * set/get the implementation of the XMLReporter interface
- */
- public static final String REPORTER=
- "javax.xml.stream.reporter";
-
- /**
- * The property used to set/get the implementation of the XMLResolver
- */
- public static final String RESOLVER=
- "javax.xml.stream.resolver";
-
- /**
- * The property used to set/get the implementation of the allocator
- */
- public static final String ALLOCATOR=
- "javax.xml.stream.allocator";
-
- static final String DEFAULIMPL = "com.sun.xml.internal.stream.XMLInputFactoryImpl";
-
- protected XMLInputFactory(){}
-
- /**
- * Creates a new instance of the factory in exactly the same manner as the
- * {@link #newFactory()} method.
- * @throws FactoryConfigurationError if an instance of this factory cannot be loaded
- */
- public static XMLInputFactory newInstance()
- throws FactoryConfigurationError
- {
- return FactoryFinder.find(XMLInputFactory.class, DEFAULIMPL);
- }
-
- /**
- * Create a new instance of the factory.
- * <p>
- * This static method creates a new factory instance.
- * This method uses the following ordered lookup procedure to determine
- * the XMLInputFactory implementation class to load:
- * </p>
- * <ul>
- * <li>
- * Use the javax.xml.stream.XMLInputFactory system property.
- * </li>
- * <li>
- * Use the properties file "lib/stax.properties" in the JRE directory.
- * This configuration file is in standard java.util.Properties format
- * and contains the fully qualified name of the implementation class
- * with the key being the system property defined above.
- * </li>
- * <li>
- * Use the service-provider loading facilities, defined by the
- * {@link java.util.ServiceLoader} class, to attempt to locate and load an
- * implementation of the service using the {@linkplain
- * java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}:
- * the service-provider loading facility will use the {@linkplain
- * java.lang.Thread#getContextClassLoader() current thread's context class loader}
- * to attempt to load the service. If the context class
- * loader is null, the {@linkplain
- * ClassLoader#getSystemClassLoader() system class loader} will be used.
- * </li>
- * <li>
- * Otherwise, the system-default implementation is returned.
- * </li>
- * </ul>
- * <p>
- * Once an application has obtained a reference to a XMLInputFactory it
- * can use the factory to configure and obtain stream instances.
- * </p>
- * <p>
- * Note that this is a new method that replaces the deprecated newInstance() method.
- * No changes in behavior are defined by this replacement method relative to
- * the deprecated method.
- * </p>
- * @throws FactoryConfigurationError in case of {@linkplain
- * java.util.ServiceConfigurationError service configuration error} or if
- * the implementation is not available or cannot be instantiated.
- */
- public static XMLInputFactory newFactory()
- throws FactoryConfigurationError
- {
- return FactoryFinder.find(XMLInputFactory.class, DEFAULIMPL);
- }
-
- /**
- * Create a new instance of the factory
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param classLoader classLoader to use
- * @return the factory implementation
- * @throws FactoryConfigurationError if an instance of this factory cannot be loaded
- *
- * @deprecated This method has been deprecated to maintain API consistency.
- * All newInstance methods have been replaced with corresponding
- * newFactory methods. The replacement {@link
- * #newFactory(java.lang.String, java.lang.ClassLoader)} method
- * defines no changes in behavior.
- */
- public static XMLInputFactory newInstance(String factoryId,
- ClassLoader classLoader)
- throws FactoryConfigurationError {
- //do not fallback if given classloader can't find the class, throw exception
- return FactoryFinder.find(XMLInputFactory.class, factoryId, classLoader, null);
- }
-
- /**
- * Create a new instance of the factory.
- * If the classLoader argument is null, then the ContextClassLoader is used.
- * <p>
- * This method uses the following ordered lookup procedure to determine
- * the XMLInputFactory implementation class to load:
- * </p>
- * <ul>
- * <li>
- * Use the value of the system property identified by {@code factoryId}.
- * </li>
- * <li>
- * Use the properties file "lib/stax.properties" in the JRE directory.
- * This configuration file is in standard java.util.Properties format
- * and contains the fully qualified name of the implementation class
- * with the key being the given {@code factoryId}.
- * </li>
- * <li>
- * If {@code factoryId} is "javax.xml.stream.XMLInputFactory",
- * use the service-provider loading facilities, defined by the
- * {@link java.util.ServiceLoader} class, to attempt to {@linkplain
- * java.util.ServiceLoader#load(java.lang.Class, java.lang.ClassLoader) locate and load}
- * an implementation of the service using the specified {@code ClassLoader}.
- * If {@code classLoader} is null, the {@linkplain
- * java.util.ServiceLoader#load(java.lang.Class) default loading mechanism} will apply:
- * That is, the service-provider loading facility will use the {@linkplain
- * java.lang.Thread#getContextClassLoader() current thread's context class loader}
- * to attempt to load the service. If the context class
- * loader is null, the {@linkplain
- * ClassLoader#getSystemClassLoader() system class loader} will be used.
- * </li>
- * <li>
- * Otherwise, throws a {@link FactoryConfigurationError}.
- * </li>
- * </ul>
- *
- * <p>
- * Note that this is a new method that replaces the deprecated
- * {@link #newInstance(java.lang.String, java.lang.ClassLoader)
- * newInstance(String factoryId, ClassLoader classLoader)} method.
- * No changes in behavior are defined by this replacement method relative
- * to the deprecated method.
- * </p>
- *
- * @apiNote The parameter factoryId defined here is inconsistent with that
- * of other JAXP factories where the first parameter is fully qualified
- * factory class name that provides implementation of the factory.
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param classLoader classLoader to use
- * @return the factory implementation
- * @throws FactoryConfigurationError in case of {@linkplain
- * java.util.ServiceConfigurationError service configuration error} or if
- * the implementation is not available or cannot be instantiated.
- * @throws FactoryConfigurationError if an instance of this factory cannot be loaded
- */
- public static XMLInputFactory newFactory(String factoryId,
- ClassLoader classLoader)
- throws FactoryConfigurationError {
- //do not fallback if given classloader can't find the class, throw exception
- return FactoryFinder.find(XMLInputFactory.class, factoryId, classLoader, null);
- }
-
- /**
- * Create a new XMLStreamReader from a reader
- * @param reader the XML data to read from
- * @throws XMLStreamException
- */
- public abstract XMLStreamReader createXMLStreamReader(java.io.Reader reader)
- throws XMLStreamException;
-
- /**
- * Create a new XMLStreamReader from a JAXP source. This method is optional.
- * @param source the source to read from
- * @throws UnsupportedOperationException if this method is not
- * supported by this XMLInputFactory
- * @throws XMLStreamException
- */
- public abstract XMLStreamReader createXMLStreamReader(Source source)
- throws XMLStreamException;
-
- /**
- * Create a new XMLStreamReader from a java.io.InputStream
- * @param stream the InputStream to read from
- * @throws XMLStreamException
- */
- public abstract XMLStreamReader createXMLStreamReader(java.io.InputStream stream)
- throws XMLStreamException;
-
- /**
- * Create a new XMLStreamReader from a java.io.InputStream
- * @param stream the InputStream to read from
- * @param encoding the character encoding of the stream
- * @throws XMLStreamException
- */
- public abstract XMLStreamReader createXMLStreamReader(java.io.InputStream stream, String encoding)
- throws XMLStreamException;
-
- /**
- * Create a new XMLStreamReader from a java.io.InputStream
- * @param systemId the system ID of the stream
- * @param stream the InputStream to read from
- */
- public abstract XMLStreamReader createXMLStreamReader(String systemId, java.io.InputStream stream)
- throws XMLStreamException;
-
- /**
- * Create a new XMLStreamReader from a java.io.InputStream
- * @param systemId the system ID of the stream
- * @param reader the InputStream to read from
- */
- public abstract XMLStreamReader createXMLStreamReader(String systemId, java.io.Reader reader)
- throws XMLStreamException;
-
- /**
- * Create a new XMLEventReader from a reader
- * @param reader the XML data to read from
- * @throws XMLStreamException
- */
- public abstract XMLEventReader createXMLEventReader(java.io.Reader reader)
- throws XMLStreamException;
-
- /**
- * Create a new XMLEventReader from a reader
- * @param systemId the system ID of the input
- * @param reader the XML data to read from
- * @throws XMLStreamException
- */
- public abstract XMLEventReader createXMLEventReader(String systemId, java.io.Reader reader)
- throws XMLStreamException;
-
- /**
- * Create a new XMLEventReader from an XMLStreamReader. After being used
- * to construct the XMLEventReader instance returned from this method
- * the XMLStreamReader must not be used.
- * @param reader the XMLStreamReader to read from (may not be modified)
- * @return a new XMLEventReader
- * @throws XMLStreamException
- */
- public abstract XMLEventReader createXMLEventReader(XMLStreamReader reader)
- throws XMLStreamException;
-
- /**
- * Create a new XMLEventReader from a JAXP source.
- * Support of this method is optional.
- * @param source the source to read from
- * @throws UnsupportedOperationException if this method is not
- * supported by this XMLInputFactory
- */
- public abstract XMLEventReader createXMLEventReader(Source source)
- throws XMLStreamException;
-
- /**
- * Create a new XMLEventReader from a java.io.InputStream
- * @param stream the InputStream to read from
- * @throws XMLStreamException
- */
- public abstract XMLEventReader createXMLEventReader(java.io.InputStream stream)
- throws XMLStreamException;
-
- /**
- * Create a new XMLEventReader from a java.io.InputStream
- * @param stream the InputStream to read from
- * @param encoding the character encoding of the stream
- * @throws XMLStreamException
- */
- public abstract XMLEventReader createXMLEventReader(java.io.InputStream stream, String encoding)
- throws XMLStreamException;
-
- /**
- * Create a new XMLEventReader from a java.io.InputStream
- * @param systemId the system ID of the stream
- * @param stream the InputStream to read from
- * @throws XMLStreamException
- */
- public abstract XMLEventReader createXMLEventReader(String systemId, java.io.InputStream stream)
- throws XMLStreamException;
-
- /**
- * Create a filtered reader that wraps the filter around the reader
- * @param reader the reader to filter
- * @param filter the filter to apply to the reader
- * @throws XMLStreamException
- */
- public abstract XMLStreamReader createFilteredReader(XMLStreamReader reader, StreamFilter filter)
- throws XMLStreamException;
-
- /**
- * Create a filtered event reader that wraps the filter around the event reader
- * @param reader the event reader to wrap
- * @param filter the filter to apply to the event reader
- * @throws XMLStreamException
- */
- public abstract XMLEventReader createFilteredReader(XMLEventReader reader, EventFilter filter)
- throws XMLStreamException;
-
- /**
- * The resolver that will be set on any XMLStreamReader or XMLEventReader created
- * by this factory instance.
- */
- public abstract XMLResolver getXMLResolver();
-
- /**
- * The resolver that will be set on any XMLStreamReader or XMLEventReader created
- * by this factory instance.
- * @param resolver the resolver to use to resolve references
- */
- public abstract void setXMLResolver(XMLResolver resolver);
-
- /**
- * The reporter that will be set on any XMLStreamReader or XMLEventReader created
- * by this factory instance.
- */
- public abstract XMLReporter getXMLReporter();
-
- /**
- * The reporter that will be set on any XMLStreamReader or XMLEventReader created
- * by this factory instance.
- * @param reporter the resolver to use to report non fatal errors
- */
- public abstract void setXMLReporter(XMLReporter reporter);
-
- /**
- * Allows the user to set specific feature/property on the underlying
- * implementation. The underlying implementation is not required to support
- * every setting of every property in the specification and may use
- * IllegalArgumentException to signal that an unsupported property may not be
- * set with the specified value.
- * <p>
- * All implementations that implement JAXP 1.5 or newer are required to
- * support the {@link javax.xml.XMLConstants#ACCESS_EXTERNAL_DTD} property.
- * </p>
- * <ul>
- * <li>
- * <p>
- * Access to external DTDs, external Entity References is restricted to the
- * protocols specified by the property. If access is denied during parsing
- * due to the restriction of this property, {@link javax.xml.stream.XMLStreamException}
- * will be thrown by the {@link javax.xml.stream.XMLStreamReader#next()} or
- * {@link javax.xml.stream.XMLEventReader#nextEvent()} method.
- * </p>
- * </li>
- * </ul>
- * @param name The name of the property (may not be null)
- * @param value The value of the property
- * @throws java.lang.IllegalArgumentException if the property is not supported
- */
- public abstract void setProperty(java.lang.String name, Object value)
- throws java.lang.IllegalArgumentException;
-
- /**
- * Get the value of a feature/property from the underlying implementation
- * @param name The name of the property (may not be null)
- * @return The value of the property
- * @throws IllegalArgumentException if the property is not supported
- */
- public abstract Object getProperty(java.lang.String name)
- throws java.lang.IllegalArgumentException;
-
-
- /**
- * Query the set of properties that this factory supports.
- *
- * @param name The name of the property (may not be null)
- * @return true if the property is supported and false otherwise
- */
- public abstract boolean isPropertySupported(String name);
-
- /**
- * Set a user defined event allocator for events
- * @param allocator the user defined allocator
- */
- public abstract void setEventAllocator(XMLEventAllocator allocator);
-
- /**
- * Gets the allocator used by streams created with this factory
- */
- public abstract XMLEventAllocator getEventAllocator();
-
-}
diff --git a/src/javax/xml/stream/XMLOutputFactory.java b/src/javax/xml/stream/XMLOutputFactory.java
deleted file mode 100644
index e875ac2..0000000
--- a/src/javax/xml/stream/XMLOutputFactory.java
+++ /dev/null
@@ -1,359 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Copyright (c) 2009, 2013, by Oracle Corporation. All Rights Reserved.
- */
-
-package javax.xml.stream;
-
-import javax.xml.transform.Result;
-
-/**
- * Defines an abstract implementation of a factory for
- * getting XMLEventWriters and XMLStreamWriters.
- *
- * The following table defines the standard properties of this specification.
- * Each property varies in the level of support required by each implementation.
- * The level of support required is described in the 'Required' column.
- *
- * <table border="2" rules="all" cellpadding="4">
- * <thead>
- * <tr>
- * <th align="center" colspan="2">
- * Configuration parameters
- * </th>
- * </tr>
- * </thead>
- * <tbody>
- * <tr>
- * <th>Property Name</th>
- * <th>Behavior</th>
- * <th>Return type</th>
- * <th>Default Value</th>
- * <th>Required</th>
- * </tr>
- * <tr><td>javax.xml.stream.isRepairingNamespaces</td><td>defaults prefixes on the output side</td><td>Boolean</td><td>False</td><td>Yes</td></tr>
- * </tbody>
- * </table>
- *
- * <p>The following paragraphs describe the namespace and prefix repair algorithm:</p>
- *
- * <p>The property can be set with the following code line:
- * <code>setProperty("javax.xml.stream.isRepairingNamespaces",new Boolean(true|false));</code></p>
- *
- * <p>This property specifies that the writer default namespace prefix declarations.
- * The default value is false. </p>
- *
- * <p>If a writer isRepairingNamespaces it will create a namespace declaration
- * on the current StartElement for
- * any attribute that does not
- * currently have a namespace declaration in scope. If the StartElement
- * has a uri but no prefix specified a prefix will be assigned, if the prefix
- * has not been declared in a parent of the current StartElement it will be declared
- * on the current StartElement. If the defaultNamespace is bound and in scope
- * and the default namespace matches the URI of the attribute or StartElement
- * QName no prefix will be assigned.</p>
- *
- * <p>If an element or attribute name has a prefix, but is not
- * bound to any namespace URI, then the prefix will be removed
- * during serialization.</p>
- *
- * <p>If element and/or attribute names in the same start or
- * empty-element tag are bound to different namespace URIs and
- * are using the same prefix then the element or the first
- * occurring attribute retains the original prefix and the
- * following attributes have their prefixes replaced with a
- * new prefix that is bound to the namespace URIs of those
- * attributes. </p>
- *
- * <p>If an element or attribute name uses a prefix that is
- * bound to a different URI than that inherited from the
- * namespace context of the parent of that element and there
- * is no namespace declaration in the context of the current
- * element then such a namespace declaration is added. </p>
- *
- * <p>If an element or attribute name is bound to a prefix and
- * there is a namespace declaration that binds that prefix
- * to a different URI then that namespace declaration is
- * either removed if the correct mapping is inherited from
- * the parent context of that element, or changed to the
- * namespace URI of the element or attribute using that prefix.</p>
- *
- * @version 1.2
- * @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- * @see XMLInputFactory
- * @see XMLEventWriter
- * @see XMLStreamWriter
- * @since 1.6
- */
-public abstract class XMLOutputFactory {
- /**
- * Property used to set prefix defaulting on the output side
- */
- public static final String IS_REPAIRING_NAMESPACES=
- "javax.xml.stream.isRepairingNamespaces";
-
- static final String DEFAULIMPL = "com.sun.xml.internal.stream.XMLOutputFactoryImpl";
-
- protected XMLOutputFactory(){}
-
- /**
- * Creates a new instance of the factory in exactly the same manner as the
- * {@link #newFactory()} method.
- * @throws FactoryConfigurationError if an instance of this factory cannot be loaded
- */
- public static XMLOutputFactory newInstance()
- throws FactoryConfigurationError
- {
- return FactoryFinder.find(XMLOutputFactory.class, DEFAULIMPL);
- }
-
- /**
- * Create a new instance of the factory.
- * <p>
- * This static method creates a new factory instance. This method uses the
- * following ordered lookup procedure to determine the XMLOutputFactory
- * implementation class to load:
- * </p>
- * <ul>
- * <li>
- * Use the javax.xml.stream.XMLOutputFactory system property.
- * </li>
- * <li>
- * Use the properties file "lib/stax.properties" in the JRE directory.
- * This configuration file is in standard java.util.Properties format
- * and contains the fully qualified name of the implementation class
- * with the key being the system property defined above.
- * </li>
- * <li>
- * Use the service-provider loading facilities, defined by the
- * {@link java.util.ServiceLoader} class, to attempt to locate and load an
- * implementation of the service using the {@linkplain
- * java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}:
- * the service-provider loading facility will use the {@linkplain
- * java.lang.Thread#getContextClassLoader() current thread's context class loader}
- * to attempt to load the service. If the context class
- * loader is null, the {@linkplain
- * ClassLoader#getSystemClassLoader() system class loader} will be used.
- * </li>
- * <li>
- * Otherwise, the system-default implementation is returned.
- * </li>
- * <p>
- * Once an application has obtained a reference to a XMLOutputFactory it
- * can use the factory to configure and obtain stream instances.
- * </p>
- * <p>
- * Note that this is a new method that replaces the deprecated newInstance() method.
- * No changes in behavior are defined by this replacement method relative to the
- * deprecated method.
- * </p>
- * @throws FactoryConfigurationError in case of {@linkplain
- * java.util.ServiceConfigurationError service configuration error} or if
- * the implementation is not available or cannot be instantiated.
- */
- public static XMLOutputFactory newFactory()
- throws FactoryConfigurationError
- {
- return FactoryFinder.find(XMLOutputFactory.class, DEFAULIMPL);
- }
-
- /**
- * Create a new instance of the factory.
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param classLoader classLoader to use
- * @return the factory implementation
- * @throws FactoryConfigurationError if an instance of this factory cannot be loaded
- *
- * @deprecated This method has been deprecated because it returns an
- * instance of XMLInputFactory, which is of the wrong class.
- * Use the new method {@link #newFactory(java.lang.String,
- * java.lang.ClassLoader)} instead.
- */
- public static XMLInputFactory newInstance(String factoryId,
- ClassLoader classLoader)
- throws FactoryConfigurationError {
- //do not fallback if given classloader can't find the class, throw exception
- return FactoryFinder.find(XMLInputFactory.class, factoryId, classLoader, null);
- }
-
- /**
- * Create a new instance of the factory.
- * If the classLoader argument is null, then the ContextClassLoader is used.
- * <p>
- * This method uses the following ordered lookup procedure to determine
- * the XMLOutputFactory implementation class to load:
- * </p>
- * <ul>
- * <li>
- * Use the value of the system property identified by {@code factoryId}.
- * </li>
- * <li>
- * Use the properties file "lib/stax.properties" in the JRE directory.
- * This configuration file is in standard java.util.Properties format
- * and contains the fully qualified name of the implementation class
- * with the key being the given {@code factoryId}.
- * </li>
- * <li>
- * If {@code factoryId} is "javax.xml.stream.XMLOutputFactory",
- * use the service-provider loading facilities, defined by the
- * {@link java.util.ServiceLoader} class, to attempt to {@linkplain
- * java.util.ServiceLoader#load(java.lang.Class, java.lang.ClassLoader) locate and load}
- * an implementation of the service using the specified {@code ClassLoader}.
- * If {@code classLoader} is null, the {@linkplain
- * java.util.ServiceLoader#load(java.lang.Class) default loading mechanism} will apply:
- * That is, the service-provider loading facility will use the {@linkplain
- * java.lang.Thread#getContextClassLoader() current thread's context class loader}
- * to attempt to load the service. If the context class
- * loader is null, the {@linkplain
- * ClassLoader#getSystemClassLoader() system class loader} will be used.
- * </li>
- * <li>
- * Otherwise, throws a {@link FactoryConfigurationError}.
- * </li>
- * </ul>
- *
- * @apiNote The parameter factoryId defined here is inconsistent with that
- * of other JAXP factories where the first parameter is fully qualified
- * factory class name that provides implementation of the factory.
- *
- * <p>
- * Note that this is a new method that replaces the deprecated
- * {@link #newInstance(java.lang.String, java.lang.ClassLoader)
- * newInstance(String factoryId, ClassLoader classLoader)} method.
- * The original method was incorrectly defined to return XMLInputFactory.
- * </p>
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param classLoader classLoader to use
- * @return the factory implementation
- * @throws FactoryConfigurationError in case of {@linkplain
- * java.util.ServiceConfigurationError service configuration error} or if
- * the implementation is not available or cannot be instantiated.
- */
- public static XMLOutputFactory newFactory(String factoryId,
- ClassLoader classLoader)
- throws FactoryConfigurationError {
- //do not fallback if given classloader can't find the class, throw exception
- return FactoryFinder.find(XMLOutputFactory.class, factoryId, classLoader, null);
- }
-
- /**
- * Create a new XMLStreamWriter that writes to a writer
- * @param stream the writer to write to
- * @throws XMLStreamException
- */
- public abstract XMLStreamWriter createXMLStreamWriter(java.io.Writer stream) throws XMLStreamException;
-
- /**
- * Create a new XMLStreamWriter that writes to a stream
- * @param stream the stream to write to
- * @throws XMLStreamException
- */
- public abstract XMLStreamWriter createXMLStreamWriter(java.io.OutputStream stream) throws XMLStreamException;
-
- /**
- * Create a new XMLStreamWriter that writes to a stream
- * @param stream the stream to write to
- * @param encoding the encoding to use
- * @throws XMLStreamException
- */
- public abstract XMLStreamWriter createXMLStreamWriter(java.io.OutputStream stream,
- String encoding) throws XMLStreamException;
-
- /**
- * Create a new XMLStreamWriter that writes to a JAXP result. This method is optional.
- * @param result the result to write to
- * @throws UnsupportedOperationException if this method is not
- * supported by this XMLOutputFactory
- * @throws XMLStreamException
- */
- public abstract XMLStreamWriter createXMLStreamWriter(Result result) throws XMLStreamException;
-
-
- /**
- * Create a new XMLEventWriter that writes to a JAXP result. This method is optional.
- * @param result the result to write to
- * @throws UnsupportedOperationException if this method is not
- * supported by this XMLOutputFactory
- * @throws XMLStreamException
- */
- public abstract XMLEventWriter createXMLEventWriter(Result result) throws XMLStreamException;
-
- /**
- * Create a new XMLEventWriter that writes to a stream
- * @param stream the stream to write to
- * @throws XMLStreamException
- */
- public abstract XMLEventWriter createXMLEventWriter(java.io.OutputStream stream) throws XMLStreamException;
-
-
-
- /**
- * Create a new XMLEventWriter that writes to a stream
- * @param stream the stream to write to
- * @param encoding the encoding to use
- * @throws XMLStreamException
- */
- public abstract XMLEventWriter createXMLEventWriter(java.io.OutputStream stream,
- String encoding) throws XMLStreamException;
-
- /**
- * Create a new XMLEventWriter that writes to a writer
- * @param stream the stream to write to
- * @throws XMLStreamException
- */
- public abstract XMLEventWriter createXMLEventWriter(java.io.Writer stream) throws XMLStreamException;
-
- /**
- * Allows the user to set specific features/properties on the underlying implementation.
- * @param name The name of the property
- * @param value The value of the property
- * @throws java.lang.IllegalArgumentException if the property is not supported
- */
- public abstract void setProperty(java.lang.String name,
- Object value)
- throws IllegalArgumentException;
-
- /**
- * Get a feature/property on the underlying implementation
- * @param name The name of the property
- * @return The value of the property
- * @throws java.lang.IllegalArgumentException if the property is not supported
- */
- public abstract Object getProperty(java.lang.String name)
- throws IllegalArgumentException;
-
- /**
- * Query the set of properties that this factory supports.
- *
- * @param name The name of the property (may not be null)
- * @return true if the property is supported and false otherwise
- */
- public abstract boolean isPropertySupported(String name);
-}
diff --git a/src/javax/xml/stream/XMLReporter.java b/src/javax/xml/stream/XMLReporter.java
deleted file mode 100644
index f78648e..0000000
--- a/src/javax/xml/stream/XMLReporter.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- */
-
-package javax.xml.stream;
-
-/**
- * This interface is used to report non-fatal errors.
- * Only warnings should be echoed through this interface.
- * @version 1.0
- * @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- * @since 1.6
- */
-public interface XMLReporter {
-
- /**
-
- * Report the desired message in an application specific format.
-
- * Only warnings and non-fatal errors should be reported through
-
- * this interface.
-
- * Fatal errors should be thrown as XMLStreamException.
-
- *
-
- * @param message the error message
-
- * @param errorType an implementation defined error type
-
- * @param relatedInformation information related to the error, if available
-
- * @param location the location of the error, if available
-
- * @throws XMLStreamException
-
- */
- public void report(String message, String errorType, Object relatedInformation, Location location)
- throws XMLStreamException;
-}
diff --git a/src/javax/xml/stream/XMLResolver.java b/src/javax/xml/stream/XMLResolver.java
deleted file mode 100644
index dbb177b..0000000
--- a/src/javax/xml/stream/XMLResolver.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- */
-
-package javax.xml.stream;
-
-/**
- * This interface is used to resolve resources during an XML parse. If an application wishes to
- * perform custom entity resolution it must register an instance of this interface with
- * the XMLInputFactory using the setXMLResolver method.
- *
- * @version 1.0
- * @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- * @since 1.6
- */
-public interface XMLResolver {
-
- /**
- * Retrieves a resource. This resource can be of the following three return types:
- * (1) java.io.InputStream (2) javax.xml.stream.XMLStreamReader (3) java.xml.stream.XMLEventReader.
- * If this method returns null the processor will attempt to resolve the entity using its
- * default mechanism.
- *
- * @param publicID The public identifier of the external entity being referenced, or null if none was supplied.
- * @param systemID The system identifier of the external entity being referenced.
- * @param baseURI Absolute base URI associated with systemId.
- * @param namespace The namespace of the entity to resolve.
- * @return The resource requested or null.
- * @throws XMLStreamException if there was a failure attempting to resolve the resource.
- */
- public Object resolveEntity(String publicID,
- String systemID,
- String baseURI,
- String namespace)
- throws XMLStreamException;
-}
diff --git a/src/javax/xml/stream/XMLStreamConstants.java b/src/javax/xml/stream/XMLStreamConstants.java
deleted file mode 100644
index 6ceb1c6..0000000
--- a/src/javax/xml/stream/XMLStreamConstants.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.stream;
-
-/**
- * This interface declares the constants used in this API.
- * Numbers in the range 0 to 256 are reserved for the specification,
- * user defined events must use event codes outside that range.
- *
- * @since 1.6
- */
-
-public interface XMLStreamConstants {
- /**
- * Indicates an event is a start element
- * @see javax.xml.stream.events.StartElement
- */
- public static final int START_ELEMENT=1;
- /**
- * Indicates an event is an end element
- * @see javax.xml.stream.events.EndElement
- */
- public static final int END_ELEMENT=2;
- /**
- * Indicates an event is a processing instruction
- * @see javax.xml.stream.events.ProcessingInstruction
- */
- public static final int PROCESSING_INSTRUCTION=3;
-
- /**
- * Indicates an event is characters
- * @see javax.xml.stream.events.Characters
- */
- public static final int CHARACTERS=4;
-
- /**
- * Indicates an event is a comment
- * @see javax.xml.stream.events.Comment
- */
- public static final int COMMENT=5;
-
- /**
- * The characters are white space
- * (see [XML], 2.10 "White Space Handling").
- * Events are only reported as SPACE if they are ignorable white
- * space. Otherwise they are reported as CHARACTERS.
- * @see javax.xml.stream.events.Characters
- */
- public static final int SPACE=6;
-
- /**
- * Indicates an event is a start document
- * @see javax.xml.stream.events.StartDocument
- */
- public static final int START_DOCUMENT=7;
-
- /**
- * Indicates an event is an end document
- * @see javax.xml.stream.events.EndDocument
- */
- public static final int END_DOCUMENT=8;
-
- /**
- * Indicates an event is an entity reference
- * @see javax.xml.stream.events.EntityReference
- */
- public static final int ENTITY_REFERENCE=9;
-
- /**
- * Indicates an event is an attribute
- * @see javax.xml.stream.events.Attribute
- */
- public static final int ATTRIBUTE=10;
-
- /**
- * Indicates an event is a DTD
- * @see javax.xml.stream.events.DTD
- */
- public static final int DTD=11;
-
- /**
- * Indicates an event is a CDATA section
- * @see javax.xml.stream.events.Characters
- */
- public static final int CDATA=12;
-
- /**
- * Indicates the event is a namespace declaration
- *
- * @see javax.xml.stream.events.Namespace
- */
- public static final int NAMESPACE=13;
-
- /**
- * Indicates a Notation
- * @see javax.xml.stream.events.NotationDeclaration
- */
- public static final int NOTATION_DECLARATION=14;
-
- /**
- * Indicates a Entity Declaration
- * @see javax.xml.stream.events.NotationDeclaration
- */
- public static final int ENTITY_DECLARATION=15;
-}
diff --git a/src/javax/xml/stream/XMLStreamException.java b/src/javax/xml/stream/XMLStreamException.java
deleted file mode 100644
index 48e510c..0000000
--- a/src/javax/xml/stream/XMLStreamException.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- */
-
-package javax.xml.stream;
-
-/**
- * The base exception for unexpected processing errors. This Exception
- * class is used to report well-formedness errors as well as unexpected
- * processing conditions.
- * @version 1.0
- * @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- * @since 1.6
- */
-
-public class XMLStreamException extends Exception {
-
- protected Throwable nested;
- protected Location location;
-
- /**
- * Default constructor
- */
- public XMLStreamException(){
- super();
- }
-
- /**
- * Construct an exception with the assocated message.
- *
- * @param msg the message to report
- */
- public XMLStreamException(String msg) {
- super(msg);
- }
-
- /**
- * Construct an exception with the assocated exception
- *
- * @param th a nested exception
- */
- public XMLStreamException(Throwable th) {
- super(th);
- nested = th;
- }
-
- /**
- * Construct an exception with the assocated message and exception
- *
- * @param th a nested exception
- * @param msg the message to report
- */
- public XMLStreamException(String msg, Throwable th) {
- super(msg, th);
- nested = th;
- }
-
- /**
- * Construct an exception with the assocated message, exception and location.
- *
- * @param th a nested exception
- * @param msg the message to report
- * @param location the location of the error
- */
- public XMLStreamException(String msg, Location location, Throwable th) {
- super("ParseError at [row,col]:["+location.getLineNumber()+","+
- location.getColumnNumber()+"]\n"+
- "Message: "+msg);
- nested = th;
- this.location = location;
- }
-
- /**
- * Construct an exception with the assocated message, exception and location.
- *
- * @param msg the message to report
- * @param location the location of the error
- */
- public XMLStreamException(String msg,
- Location location) {
- super("ParseError at [row,col]:["+location.getLineNumber()+","+
- location.getColumnNumber()+"]\n"+
- "Message: "+msg);
- this.location = location;
- }
-
-
- /**
- * Gets the nested exception.
- *
- * @return Nested exception
- */
- public Throwable getNestedException() {
- return nested;
- }
-
- /**
- * Gets the location of the exception
- *
- * @return the location of the exception, may be null if none is available
- */
- public Location getLocation() {
- return location;
- }
-
-}
diff --git a/src/javax/xml/stream/XMLStreamReader.java b/src/javax/xml/stream/XMLStreamReader.java
deleted file mode 100644
index fd15819..0000000
--- a/src/javax/xml/stream/XMLStreamReader.java
+++ /dev/null
@@ -1,704 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- */
-
-package javax.xml.stream;
-
-import java.io.Reader;
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.namespace.QName;
-
-/**
- * The XMLStreamReader interface allows forward, read-only access to XML.
- * It is designed to be the lowest level and most efficient way to
- * read XML data.
- *
- * <p> The XMLStreamReader is designed to iterate over XML using
- * next() and hasNext(). The data can be accessed using methods such as getEventType(),
- * getNamespaceURI(), getLocalName() and getText();
- *
- * <p> The <a href="#next()">next()</a> method causes the reader to read the next parse event.
- * The next() method returns an integer which identifies the type of event just read.
- * <p> The event type can be determined using <a href="#getEventType()">getEventType()</a>.
- * <p> Parsing events are defined as the XML Declaration, a DTD,
- * start tag, character data, white space, end tag, comment,
- * or processing instruction. An attribute or namespace event may be encountered
- * at the root level of a document as the result of a query operation.
- *
- * <p>For XML 1.0 compliance an XML processor must pass the
- * identifiers of declared unparsed entities, notation declarations and their
- * associated identifiers to the application. This information is
- * provided through the property API on this interface.
- * The following two properties allow access to this information:
- * javax.xml.stream.notations and javax.xml.stream.entities.
- * When the current event is a DTD the following call will return a
- * list of Notations
- * <code>List l = (List) getProperty("javax.xml.stream.notations");</code>
- * The following call will return a list of entity declarations:
- * <code>List l = (List) getProperty("javax.xml.stream.entities");</code>
- * These properties can only be accessed during a DTD event and
- * are defined to return null if the information is not available.
- *
- * <p>The following table describes which methods are valid in what state.
- * If a method is called in an invalid state the method will throw a
- * java.lang.IllegalStateException.
- *
- * <table border="2" rules="all" cellpadding="4">
- * <thead>
- * <tr>
- * <th align="center" colspan="2">
- * Valid methods for each state
- * </th>
- * </tr>
- * </thead>
- * <tbody>
- * <tr>
- * <th>Event Type</th>
- * <th>Valid Methods</th>
- * </tr>
- * <tr>
- * <td> All States </td>
- * <td> getProperty(), hasNext(), require(), close(),
- * getNamespaceURI(), isStartElement(),
- * isEndElement(), isCharacters(), isWhiteSpace(),
- * getNamespaceContext(), getEventType(),getLocation(),
- * hasText(), hasName()
- * </td>
- * </tr>
- * <tr>
- * <td> START_ELEMENT </td>
- * <td> next(), getName(), getLocalName(), hasName(), getPrefix(),
- * getAttributeXXX(), isAttributeSpecified(),
- * getNamespaceXXX(),
- * getElementText(), nextTag()
- * </td>
- * </tr>
- * <td> ATTRIBUTE </td>
- * <td> next(), nextTag()
- * getAttributeXXX(), isAttributeSpecified(),
- * </td>
- * </tr>
- * </tr>
- * <td> NAMESPACE </td>
- * <td> next(), nextTag()
- * getNamespaceXXX()
- * </td>
- * </tr>
- * <tr>
- * <td> END_ELEMENT </td>
- * <td> next(), getName(), getLocalName(), hasName(), getPrefix(),
- * getNamespaceXXX(), nextTag()
- * </td>
- * </tr>
- * <tr>
- * <td> CHARACTERS </td>
- * <td> next(), getTextXXX(), nextTag() </td>
- * </tr>
- * <tr>
- * <td> CDATA </td>
- * <td> next(), getTextXXX(), nextTag() </td>
- * </tr>
- * <tr>
- * <td> COMMENT </td>
- * <td> next(), getTextXXX(), nextTag() </td>
- * </tr>
- * <tr>
- * <td> SPACE </td>
- * <td> next(), getTextXXX(), nextTag() </td>
- * </tr>
- * <tr>
- * <td> START_DOCUMENT </td>
- * <td> next(), getEncoding(), getVersion(), isStandalone(), standaloneSet(),
- * getCharacterEncodingScheme(), nextTag()</td>
- * </tr>
- * <tr>
- * <td> END_DOCUMENT </td>
- * <td> close()</td>
- * </tr>
- * <tr>
- * <td> PROCESSING_INSTRUCTION </td>
- * <td> next(), getPITarget(), getPIData(), nextTag() </td>
- * </tr>
- * <tr>
- * <td> ENTITY_REFERENCE </td>
- * <td> next(), getLocalName(), getText(), nextTag() </td>
- * </tr>
- * <tr>
- * <td> DTD </td>
- * <td> next(), getText(), nextTag() </td>
- * </tr>
- * </tbody>
- * </table>
- *
- * @version 1.0
- * @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- * @see javax.xml.stream.events.XMLEvent
- * @see XMLInputFactory
- * @see XMLStreamWriter
- * @since 1.6
- */
-public interface XMLStreamReader extends XMLStreamConstants {
- /**
- * Get the value of a feature/property from the underlying implementation
- * @param name The name of the property, may not be null
- * @return The value of the property
- * @throws IllegalArgumentException if name is null
- */
- public Object getProperty(java.lang.String name) throws java.lang.IllegalArgumentException;
-
- /**
- * Get next parsing event - a processor may return all contiguous
- * character data in a single chunk, or it may split it into several chunks.
- * If the property javax.xml.stream.isCoalescing is set to true
- * element content must be coalesced and only one CHARACTERS event
- * must be returned for contiguous element content or
- * CDATA Sections.
- *
- * By default entity references must be
- * expanded and reported transparently to the application.
- * An exception will be thrown if an entity reference cannot be expanded.
- * If element content is empty (i.e. content is "") then no CHARACTERS event will be reported.
- *
- * <p>Given the following XML:<br>
- * &lt;foo>&lt;!--description-->content text&lt;![CDATA[&lt;greeting>Hello&lt;/greeting>]]>other content&lt;/foo><br>
- * The behavior of calling next() when being on foo will be:<br>
- * 1- the comment (COMMENT)<br>
- * 2- then the characters section (CHARACTERS)<br>
- * 3- then the CDATA section (another CHARACTERS)<br>
- * 4- then the next characters section (another CHARACTERS)<br>
- * 5- then the END_ELEMENT<br>
- *
- * <p><b>NOTE:</b> empty element (such as &lt;tag/>) will be reported
- * with two separate events: START_ELEMENT, END_ELEMENT - This preserves
- * parsing equivalency of empty element to &lt;tag>&lt;/tag>.
- *
- * This method will throw an IllegalStateException if it is called after hasNext() returns false.
- * @see javax.xml.stream.events.XMLEvent
- * @return the integer code corresponding to the current parse event
- * @throws NoSuchElementException if this is called when hasNext() returns false
- * @throws XMLStreamException if there is an error processing the underlying XML source
- */
- public int next() throws XMLStreamException;
-
- /**
- * Test if the current event is of the given type and if the namespace and name match the current
- * namespace and name of the current event. If the namespaceURI is null it is not checked for equality,
- * if the localName is null it is not checked for equality.
- * @param type the event type
- * @param namespaceURI the uri of the event, may be null
- * @param localName the localName of the event, may be null
- * @throws XMLStreamException if the required values are not matched.
- */
- public void require(int type, String namespaceURI, String localName) throws XMLStreamException;
-
- /**
- * Reads the content of a text-only element, an exception is thrown if this is
- * not a text-only element.
- * Regardless of value of javax.xml.stream.isCoalescing this method always returns coalesced content.
- * <br /> Precondition: the current event is START_ELEMENT.
- * <br /> Postcondition: the current event is the corresponding END_ELEMENT.
- *
- * <br />The method does the following (implementations are free to optimized
- * but must do equivalent processing):
- * <pre>
- * if(getEventType() != XMLStreamConstants.START_ELEMENT) {
- * throw new XMLStreamException(
- * "parser must be on START_ELEMENT to read next text", getLocation());
- * }
- * int eventType = next();
- * StringBuffer content = new StringBuffer();
- * while(eventType != XMLStreamConstants.END_ELEMENT ) {
- * if(eventType == XMLStreamConstants.CHARACTERS
- * || eventType == XMLStreamConstants.CDATA
- * || eventType == XMLStreamConstants.SPACE
- * || eventType == XMLStreamConstants.ENTITY_REFERENCE) {
- * buf.append(getText());
- * } else if(eventType == XMLStreamConstants.PROCESSING_INSTRUCTION
- * || eventType == XMLStreamConstants.COMMENT) {
- * // skipping
- * } else if(eventType == XMLStreamConstants.END_DOCUMENT) {
- * throw new XMLStreamException(
- * "unexpected end of document when reading element text content", this);
- * } else if(eventType == XMLStreamConstants.START_ELEMENT) {
- * throw new XMLStreamException(
- * "element text content may not contain START_ELEMENT", getLocation());
- * } else {
- * throw new XMLStreamException(
- * "Unexpected event type "+eventType, getLocation());
- * }
- * eventType = next();
- * }
- * return buf.toString();
- * </pre>
- *
- * @throws XMLStreamException if the current event is not a START_ELEMENT
- * or if a non text element is encountered
- */
- public String getElementText() throws XMLStreamException;
-
- /**
- * Skips any white space (isWhiteSpace() returns true), COMMENT,
- * or PROCESSING_INSTRUCTION,
- * until a START_ELEMENT or END_ELEMENT is reached.
- * If other than white space characters, COMMENT, PROCESSING_INSTRUCTION, START_ELEMENT, END_ELEMENT
- * are encountered, an exception is thrown. This method should
- * be used when processing element-only content seperated by white space.
- *
- * <br /> Precondition: none
- * <br /> Postcondition: the current event is START_ELEMENT or END_ELEMENT
- * and cursor may have moved over any whitespace event.
- *
- * <br />Essentially it does the following (implementations are free to optimized
- * but must do equivalent processing):
- * <pre>
- * int eventType = next();
- * while((eventType == XMLStreamConstants.CHARACTERS &amp;&amp; isWhiteSpace()) // skip whitespace
- * || (eventType == XMLStreamConstants.CDATA &amp;&amp; isWhiteSpace())
- * // skip whitespace
- * || eventType == XMLStreamConstants.SPACE
- * || eventType == XMLStreamConstants.PROCESSING_INSTRUCTION
- * || eventType == XMLStreamConstants.COMMENT
- * ) {
- * eventType = next();
- * }
- * if (eventType != XMLStreamConstants.START_ELEMENT &amp;&amp; eventType != XMLStreamConstants.END_ELEMENT) {
- * throw new String XMLStreamException("expected start or end tag", getLocation());
- * }
- * return eventType;
- * </pre>
- *
- * @return the event type of the element read (START_ELEMENT or END_ELEMENT)
- * @throws XMLStreamException if the current event is not white space, PROCESSING_INSTRUCTION,
- * START_ELEMENT or END_ELEMENT
- * @throws NoSuchElementException if this is called when hasNext() returns false
- */
- public int nextTag() throws XMLStreamException;
-
- /**
- * Returns true if there are more parsing events and false
- * if there are no more events. This method will return
- * false if the current state of the XMLStreamReader is
- * END_DOCUMENT
- * @return true if there are more events, false otherwise
- * @throws XMLStreamException if there is a fatal error detecting the next state
- */
- public boolean hasNext() throws XMLStreamException;
-
- /**
- * Frees any resources associated with this Reader. This method does not close the
- * underlying input source.
- * @throws XMLStreamException if there are errors freeing associated resources
- */
- public void close() throws XMLStreamException;
-
- /**
- * Return the uri for the given prefix.
- * The uri returned depends on the current state of the processor.
- *
- * <p><strong>NOTE:</strong>The 'xml' prefix is bound as defined in
- * <a href="http://www.w3.org/TR/REC-xml-names/#ns-using">Namespaces in XML</a>
- * specification to "http://www.w3.org/XML/1998/namespace".
- *
- * <p><strong>NOTE:</strong> The 'xmlns' prefix must be resolved to following namespace
- * <a href="http://www.w3.org/2000/xmlns/">http://www.w3.org/2000/xmlns/</a>
- * @param prefix The prefix to lookup, may not be null
- * @return the uri bound to the given prefix or null if it is not bound
- * @throws IllegalArgumentException if the prefix is null
- */
- public String getNamespaceURI(String prefix);
-
- /**
- * Returns true if the cursor points to a start tag (otherwise false)
- * @return true if the cursor points to a start tag, false otherwise
- */
- public boolean isStartElement();
-
- /**
- * Returns true if the cursor points to an end tag (otherwise false)
- * @return true if the cursor points to an end tag, false otherwise
- */
- public boolean isEndElement();
-
- /**
- * Returns true if the cursor points to a character data event
- * @return true if the cursor points to character data, false otherwise
- */
- public boolean isCharacters();
-
- /**
- * Returns true if the cursor points to a character data event
- * that consists of all whitespace
- * @return true if the cursor points to all whitespace, false otherwise
- */
- public boolean isWhiteSpace();
-
-
- /**
- * Returns the normalized attribute value of the
- * attribute with the namespace and localName
- * If the namespaceURI is null the namespace
- * is not checked for equality
- * @param namespaceURI the namespace of the attribute
- * @param localName the local name of the attribute, cannot be null
- * @return returns the value of the attribute , returns null if not found
- * @throws IllegalStateException if this is not a START_ELEMENT or ATTRIBUTE
- */
- public String getAttributeValue(String namespaceURI,
- String localName);
-
- /**
- * Returns the count of attributes on this START_ELEMENT,
- * this method is only valid on a START_ELEMENT or ATTRIBUTE. This
- * count excludes namespace definitions. Attribute indices are
- * zero-based.
- * @return returns the number of attributes
- * @throws IllegalStateException if this is not a START_ELEMENT or ATTRIBUTE
- */
- public int getAttributeCount();
-
- /** Returns the qname of the attribute at the provided index
- *
- * @param index the position of the attribute
- * @return the QName of the attribute
- * @throws IllegalStateException if this is not a START_ELEMENT or ATTRIBUTE
- */
- public QName getAttributeName(int index);
-
- /**
- * Returns the namespace of the attribute at the provided
- * index
- * @param index the position of the attribute
- * @return the namespace URI (can be null)
- * @throws IllegalStateException if this is not a START_ELEMENT or ATTRIBUTE
- */
- public String getAttributeNamespace(int index);
-
- /**
- * Returns the localName of the attribute at the provided
- * index
- * @param index the position of the attribute
- * @return the localName of the attribute
- * @throws IllegalStateException if this is not a START_ELEMENT or ATTRIBUTE
- */
- public String getAttributeLocalName(int index);
-
- /**
- * Returns the prefix of this attribute at the
- * provided index
- * @param index the position of the attribute
- * @return the prefix of the attribute
- * @throws IllegalStateException if this is not a START_ELEMENT or ATTRIBUTE
- */
- public String getAttributePrefix(int index);
-
- /**
- * Returns the XML type of the attribute at the provided
- * index
- * @param index the position of the attribute
- * @return the XML type of the attribute
- * @throws IllegalStateException if this is not a START_ELEMENT or ATTRIBUTE
- */
- public String getAttributeType(int index);
-
- /**
- * Returns the value of the attribute at the
- * index
- * @param index the position of the attribute
- * @return the attribute value
- * @throws IllegalStateException if this is not a START_ELEMENT or ATTRIBUTE
- */
- public String getAttributeValue(int index);
-
- /**
- * Returns a boolean which indicates if this
- * attribute was created by default
- * @param index the position of the attribute
- * @return true if this is a default attribute
- * @throws IllegalStateException if this is not a START_ELEMENT or ATTRIBUTE
- */
- public boolean isAttributeSpecified(int index);
-
- /**
- * Returns the count of namespaces declared on this START_ELEMENT or END_ELEMENT,
- * this method is only valid on a START_ELEMENT, END_ELEMENT or NAMESPACE. On
- * an END_ELEMENT the count is of the namespaces that are about to go
- * out of scope. This is the equivalent of the information reported
- * by SAX callback for an end element event.
- * @return returns the number of namespace declarations on this specific element
- * @throws IllegalStateException if this is not a START_ELEMENT, END_ELEMENT or NAMESPACE
- */
- public int getNamespaceCount();
-
- /**
- * Returns the prefix for the namespace declared at the
- * index. Returns null if this is the default namespace
- * declaration
- *
- * @param index the position of the namespace declaration
- * @return returns the namespace prefix
- * @throws IllegalStateException if this is not a START_ELEMENT, END_ELEMENT or NAMESPACE
- */
- public String getNamespacePrefix(int index);
-
- /**
- * Returns the uri for the namespace declared at the
- * index.
- *
- * @param index the position of the namespace declaration
- * @return returns the namespace uri
- * @throws IllegalStateException if this is not a START_ELEMENT, END_ELEMENT or NAMESPACE
- */
- public String getNamespaceURI(int index);
-
- /**
- * Returns a read only namespace context for the current
- * position. The context is transient and only valid until
- * a call to next() changes the state of the reader.
- * @return return a namespace context
- */
- public NamespaceContext getNamespaceContext();
-
- /**
- * Returns a reader that points to the current start element
- * and all of its contents. Throws an XMLStreamException if the
- * cursor does not point to a START_ELEMENT.<p>
- * The sub stream is read from it MUST be read before the parent stream is
- * moved on, if not any call on the sub stream will cause an XMLStreamException to be
- * thrown. The parent stream will always return the same result from next()
- * whatever is done to the sub stream.
- * @return an XMLStreamReader which points to the next element
- */
- // public XMLStreamReader subReader() throws XMLStreamException;
-
- /**
- * Allows the implementation to reset and reuse any underlying tables
- */
- // public void recycle() throws XMLStreamException;
-
- /**
- * Returns an integer code that indicates the type
- * of the event the cursor is pointing to.
- */
- public int getEventType();
-
- /**
- * Returns the current value of the parse event as a string,
- * this returns the string value of a CHARACTERS event,
- * returns the value of a COMMENT, the replacement value
- * for an ENTITY_REFERENCE, the string value of a CDATA section,
- * the string value for a SPACE event,
- * or the String value of the internal subset of the DTD.
- * If an ENTITY_REFERENCE has been resolved, any character data
- * will be reported as CHARACTERS events.
- * @return the current text or null
- * @throws java.lang.IllegalStateException if this state is not
- * a valid text state.
- */
- public String getText();
-
- /**
- * Returns an array which contains the characters from this event.
- * This array should be treated as read-only and transient. I.e. the array will
- * contain the text characters until the XMLStreamReader moves on to the next event.
- * Attempts to hold onto the character array beyond that time or modify the
- * contents of the array are breaches of the contract for this interface.
- * @return the current text or an empty array
- * @throws java.lang.IllegalStateException if this state is not
- * a valid text state.
- */
- public char[] getTextCharacters();
-
- /**
- * Gets the the text associated with a CHARACTERS, SPACE or CDATA event.
- * Text starting a "sourceStart" is copied into "target" starting at "targetStart".
- * Up to "length" characters are copied. The number of characters actually copied is returned.
- *
- * The "sourceStart" argument must be greater or equal to 0 and less than or equal to
- * the number of characters associated with the event. Usually, one requests text starting at a "sourceStart" of 0.
- * If the number of characters actually copied is less than the "length", then there is no more text.
- * Otherwise, subsequent calls need to be made until all text has been retrieved. For example:
- *
- *<code>
- * int length = 1024;
- * char[] myBuffer = new char[ length ];
- *
- * for ( int sourceStart = 0 ; ; sourceStart += length )
- * {
- * int nCopied = stream.getTextCharacters( sourceStart, myBuffer, 0, length );
- *
- * if (nCopied < length)
- * break;
- * }
- * </code>
- * XMLStreamException may be thrown if there are any XML errors in the underlying source.
- * The "targetStart" argument must be greater than or equal to 0 and less than the length of "target",
- * Length must be greater than 0 and "targetStart + length" must be less than or equal to length of "target".
- *
- * @param sourceStart the index of the first character in the source array to copy
- * @param target the destination array
- * @param targetStart the start offset in the target array
- * @param length the number of characters to copy
- * @return the number of characters actually copied
- * @throws XMLStreamException if the underlying XML source is not well-formed
- * @throws IndexOutOfBoundsException if targetStart < 0 or > than the length of target
- * @throws IndexOutOfBoundsException if length < 0 or targetStart + length > length of target
- * @throws UnsupportedOperationException if this method is not supported
- * @throws NullPointerException is if target is null
- */
- public int getTextCharacters(int sourceStart, char[] target, int targetStart, int length)
- throws XMLStreamException;
-
- /**
- * Gets the text associated with a CHARACTERS, SPACE or CDATA event. Allows the underlying
- * implementation to return the text as a stream of characters. The reference to the
- * Reader returned by this method is only valid until next() is called.
- *
- * All characters must have been checked for well-formedness.
- *
- * <p> This method is optional and will throw UnsupportedOperationException if it is not supported.
- * @throws UnsupportedOperationException if this method is not supported
- * @throws IllegalStateException if this is not a valid text state
- */
- //public Reader getTextStream();
-
- /**
- * Returns the offset into the text character array where the first
- * character (of this text event) is stored.
- * @throws java.lang.IllegalStateException if this state is not
- * a valid text state.
- */
- public int getTextStart();
-
- /**
- * Returns the length of the sequence of characters for this
- * Text event within the text character array.
- * @throws java.lang.IllegalStateException if this state is not
- * a valid text state.
- */
- public int getTextLength();
-
- /**
- * Return input encoding if known or null if unknown.
- * @return the encoding of this instance or null
- */
- public String getEncoding();
-
- /**
- * Return true if the current event has text, false otherwise
- * The following events have text:
- * CHARACTERS,DTD ,ENTITY_REFERENCE, COMMENT, SPACE
- */
- public boolean hasText();
-
- /**
- * Return the current location of the processor.
- * If the Location is unknown the processor should return
- * an implementation of Location that returns -1 for the
- * location and null for the publicId and systemId.
- * The location information is only valid until next() is
- * called.
- */
- public Location getLocation();
-
- /**
- * Returns a QName for the current START_ELEMENT or END_ELEMENT event
- * @return the QName for the current START_ELEMENT or END_ELEMENT event
- * @throws IllegalStateException if this is not a START_ELEMENT or
- * END_ELEMENT
- */
- public QName getName();
-
- /**
- * Returns the (local) name of the current event.
- * For START_ELEMENT or END_ELEMENT returns the (local) name of the current element.
- * For ENTITY_REFERENCE it returns entity name.
- * The current event must be START_ELEMENT or END_ELEMENT,
- * or ENTITY_REFERENCE
- * @return the localName
- * @throws IllegalStateException if this not a START_ELEMENT,
- * END_ELEMENT or ENTITY_REFERENCE
- */
- public String getLocalName();
-
- /**
- * returns true if the current event has a name (is a START_ELEMENT or END_ELEMENT)
- * returns false otherwise
- */
- public boolean hasName();
-
- /**
- * If the current event is a START_ELEMENT or END_ELEMENT this method
- * returns the URI of the prefix or the default namespace.
- * Returns null if the event does not have a prefix.
- * @return the URI bound to this elements prefix, the default namespace, or null
- */
- public String getNamespaceURI();
-
- /**
- * Returns the prefix of the current event or null if the event does not have a prefix
- * @return the prefix or null
- */
- public String getPrefix();
-
- /**
- * Get the xml version declared on the xml declaration
- * Returns null if none was declared
- * @return the XML version or null
- */
- public String getVersion();
-
- /**
- * Get the standalone declaration from the xml declaration
- * @return true if this is standalone, or false otherwise
- */
- public boolean isStandalone();
-
- /**
- * Checks if standalone was set in the document
- * @return true if standalone was set in the document, or false otherwise
- */
- public boolean standaloneSet();
-
- /**
- * Returns the character encoding declared on the xml declaration
- * Returns null if none was declared
- * @return the encoding declared in the document or null
- */
- public String getCharacterEncodingScheme();
-
- /**
- * Get the target of a processing instruction
- * @return the target or null
- */
- public String getPITarget();
-
- /**
- * Get the data section of a processing instruction
- * @return the data or null
- */
- public String getPIData();
-}
diff --git a/src/javax/xml/stream/XMLStreamWriter.java b/src/javax/xml/stream/XMLStreamWriter.java
deleted file mode 100644
index f361589..0000000
--- a/src/javax/xml/stream/XMLStreamWriter.java
+++ /dev/null
@@ -1,528 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- */
-
-package javax.xml.stream;
-
-import javax.xml.namespace.NamespaceContext;
-
-/**
- * The XMLStreamWriter interface specifies how to write XML. The XMLStreamWriter does
- * not perform well formedness checking on its input. However
- * the writeCharacters method is required to escape &amp; , &lt; and &gt;
- * For attribute values the writeAttribute method will escape the
- * above characters plus &quot; to ensure that all character content
- * and attribute values are well formed.
- *
- * Each NAMESPACE
- * and ATTRIBUTE must be individually written.
- *
- * <table border="1" cellpadding="2" cellspacing="0">
- * <thead>
- * <tr>
- * <th colspan="5">XML Namespaces, <code>javax.xml.stream.isRepairingNamespaces</code> and write method behaviour</th>
- * </tr>
- * <tr>
- * <th>Method</th> <!-- method -->
- * <th colspan="2"><code>isRepairingNamespaces</code> == true</th>
- * <th colspan="2"><code>isRepairingNamespaces</code> == false</th>
- * </tr>
- * <tr>
- * <th></th> <!-- method -->
- * <th>namespaceURI bound</th>
- * <th>namespaceURI unbound</th>
- * <th>namespaceURI bound</th>
- * <th>namespaceURI unbound</th>
- * </tr>
- * </thead>
- *
- * <tbody>
- * <tr>
- * <th><code>writeAttribute(namespaceURI, localName, value)</code></th>
- * <!-- isRepairingNamespaces == true -->
- * <td>
- * <!-- namespaceURI bound -->
- * prefix:localName="value"&nbsp;<sup>[1]</sup>
- * </td>
- * <td>
- * <!-- namespaceURI unbound -->
- * xmlns:{generated}="namespaceURI" {generated}:localName="value"
- * </td>
- * <!-- isRepairingNamespaces == false -->
- * <td>
- * <!-- namespaceURI bound -->
- * prefix:localName="value"&nbsp;<sup>[1]</sup>
- * </td>
- * <td>
- * <!-- namespaceURI unbound -->
- * <code>XMLStreamException</code>
- * </td>
- * </tr>
- *
- * <tr>
- * <th><code>writeAttribute(prefix, namespaceURI, localName, value)</code></th>
- * <!-- isRepairingNamespaces == true -->
- * <td>
- * <!-- namespaceURI bound -->
- * bound to same prefix:<br />
- * prefix:localName="value"&nbsp;<sup>[1]</sup><br />
- * <br />
- * bound to different prefix:<br />
- * xmlns:{generated}="namespaceURI" {generated}:localName="value"
- * </td>
- * <td>
- * <!-- namespaceURI unbound -->
- * xmlns:prefix="namespaceURI" prefix:localName="value"&nbsp;<sup>[3]</sup>
- * </td>
- * <!-- isRepairingNamespaces == false -->
- * <td>
- * <!-- namespaceURI bound -->
- * bound to same prefix:<br />
- * prefix:localName="value"&nbsp;<sup>[1][2]</sup><br />
- * <br />
- * bound to different prefix:<br />
- * <code>XMLStreamException</code><sup>[2]</sup>
- * </td>
- * <td>
- * <!-- namespaceURI unbound -->
- * xmlns:prefix="namespaceURI" prefix:localName="value"&nbsp;<sup>[2][5]</sup>
- * </td>
- * </tr>
- *
- * <tr>
- * <th><code>writeStartElement(namespaceURI, localName)</code><br />
- * <br />
- * <code>writeEmptyElement(namespaceURI, localName)</code></th>
- * <!-- isRepairingNamespaces == true -->
- * <td >
- * <!-- namespaceURI bound -->
- * &lt;prefix:localName&gt;&nbsp;<sup>[1]</sup>
- * </td>
- * <td>
- * <!-- namespaceURI unbound -->
- * &lt;{generated}:localName xmlns:{generated}="namespaceURI"&gt;
- * </td>
- * <!-- isRepairingNamespaces == false -->
- * <td>
- * <!-- namespaceURI bound -->
- * &lt;prefix:localName&gt;&nbsp;<sup>[1]</sup>
- * </td>
- * <td>
- * <!-- namespaceURI unbound -->
- * <code>XMLStreamException</code>
- * </td>
- * </tr>
- *
- * <tr>
- * <th><code>writeStartElement(prefix, localName, namespaceURI)</code><br />
- * <br />
- * <code>writeEmptyElement(prefix, localName, namespaceURI)</code></th>
- * <!-- isRepairingNamespaces == true -->
- * <td>
- * <!-- namespaceURI bound -->
- * bound to same prefix:<br />
- * &lt;prefix:localName&gt;&nbsp;<sup>[1]</sup><br />
- * <br />
- * bound to different prefix:<br />
- * &lt;{generated}:localName xmlns:{generated}="namespaceURI"&gt;
- * </td>
- * <td>
- * <!-- namespaceURI unbound -->
- * &lt;prefix:localName xmlns:prefix="namespaceURI"&gt;&nbsp;<sup>[4]</sup>
- * </td>
- * <!-- isRepairingNamespaces == false -->
- * <td>
- * <!-- namespaceURI bound -->
- * bound to same prefix:<br />
- * &lt;prefix:localName&gt;&nbsp;<sup>[1]</sup><br />
- * <br />
- * bound to different prefix:<br />
- * <code>XMLStreamException</code>
- * </td>
- * <td>
- * <!-- namespaceURI unbound -->
- * &lt;prefix:localName&gt;&nbsp;
- * </td>
- * </tr>
- * </tbody>
- * <tfoot>
- * <tr>
- * <td colspan="5">
- * Notes:
- * <ul>
- * <li>[1] if namespaceURI == default Namespace URI, then no prefix is written</li>
- * <li>[2] if prefix == "" || null && namespaceURI == "", then no prefix or Namespace declaration is generated or written</li>
- * <li>[3] if prefix == "" || null, then a prefix is randomly generated</li>
- * <li>[4] if prefix == "" || null, then it is treated as the default Namespace and no prefix is generated or written, an xmlns declaration is generated and written if the namespaceURI is unbound</li>
- * <li>[5] if prefix == "" || null, then it is treated as an invalid attempt to define the default Namespace and an XMLStreamException is thrown</li>
- * </ul>
- * </td>
- * </tr>
- * </tfoot>
- * </table>
- *
- * @version 1.0
- * @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- * @see XMLOutputFactory
- * @see XMLStreamReader
- * @since 1.6
- */
-public interface XMLStreamWriter {
-
- /**
- * Writes a start tag to the output. All writeStartElement methods
- * open a new scope in the internal namespace context. Writing the
- * corresponding EndElement causes the scope to be closed.
- * @param localName local name of the tag, may not be null
- * @throws XMLStreamException
- */
- public void writeStartElement(String localName)
- throws XMLStreamException;
-
- /**
- * Writes a start tag to the output
- * @param namespaceURI the namespaceURI of the prefix to use, may not be null
- * @param localName local name of the tag, may not be null
- * @throws XMLStreamException if the namespace URI has not been bound to a prefix and
- * javax.xml.stream.isRepairingNamespaces has not been set to true
- */
- public void writeStartElement(String namespaceURI, String localName)
- throws XMLStreamException;
-
- /**
- * Writes a start tag to the output
- * @param localName local name of the tag, may not be null
- * @param prefix the prefix of the tag, may not be null
- * @param namespaceURI the uri to bind the prefix to, may not be null
- * @throws XMLStreamException
- */
- public void writeStartElement(String prefix,
- String localName,
- String namespaceURI)
- throws XMLStreamException;
-
- /**
- * Writes an empty element tag to the output
- * @param namespaceURI the uri to bind the tag to, may not be null
- * @param localName local name of the tag, may not be null
- * @throws XMLStreamException if the namespace URI has not been bound to a prefix and
- * javax.xml.stream.isRepairingNamespaces has not been set to true
- */
- public void writeEmptyElement(String namespaceURI, String localName)
- throws XMLStreamException;
-
- /**
- * Writes an empty element tag to the output
- * @param prefix the prefix of the tag, may not be null
- * @param localName local name of the tag, may not be null
- * @param namespaceURI the uri to bind the tag to, may not be null
- * @throws XMLStreamException
- */
- public void writeEmptyElement(String prefix, String localName, String namespaceURI)
- throws XMLStreamException;
-
- /**
- * Writes an empty element tag to the output
- * @param localName local name of the tag, may not be null
- * @throws XMLStreamException
- */
- public void writeEmptyElement(String localName)
- throws XMLStreamException;
-
- /**
- * Writes string data to the output without checking for well formedness.
- * The data is opaque to the XMLStreamWriter, i.e. the characters are written
- * blindly to the underlying output. If the method cannot be supported
- * in the currrent writing context the implementation may throw a
- * UnsupportedOperationException. For example note that any
- * namespace declarations, end tags, etc. will be ignored and could
- * interfere with proper maintanence of the writers internal state.
- *
- * @param data the data to write
- */
- // public void writeRaw(String data) throws XMLStreamException;
-
- /**
- * Writes an end tag to the output relying on the internal
- * state of the writer to determine the prefix and local name
- * of the event.
- * @throws XMLStreamException
- */
- public void writeEndElement()
- throws XMLStreamException;
-
- /**
- * Closes any start tags and writes corresponding end tags.
- * @throws XMLStreamException
- */
- public void writeEndDocument()
- throws XMLStreamException;
-
- /**
- * Close this writer and free any resources associated with the
- * writer. This must not close the underlying output stream.
- * @throws XMLStreamException
- */
- public void close()
- throws XMLStreamException;
-
- /**
- * Write any cached data to the underlying output mechanism.
- * @throws XMLStreamException
- */
- public void flush()
- throws XMLStreamException;
-
- /**
- * Writes an attribute to the output stream without
- * a prefix.
- * @param localName the local name of the attribute
- * @param value the value of the attribute
- * @throws IllegalStateException if the current state does not allow Attribute writing
- * @throws XMLStreamException
- */
- public void writeAttribute(String localName, String value)
- throws XMLStreamException;
-
- /**
- * Writes an attribute to the output stream
- * @param prefix the prefix for this attribute
- * @param namespaceURI the uri of the prefix for this attribute
- * @param localName the local name of the attribute
- * @param value the value of the attribute
- * @throws IllegalStateException if the current state does not allow Attribute writing
- * @throws XMLStreamException if the namespace URI has not been bound to a prefix and
- * javax.xml.stream.isRepairingNamespaces has not been set to true
- */
-
- public void writeAttribute(String prefix,
- String namespaceURI,
- String localName,
- String value)
- throws XMLStreamException;
-
- /**
- * Writes an attribute to the output stream
- * @param namespaceURI the uri of the prefix for this attribute
- * @param localName the local name of the attribute
- * @param value the value of the attribute
- * @throws IllegalStateException if the current state does not allow Attribute writing
- * @throws XMLStreamException if the namespace URI has not been bound to a prefix and
- * javax.xml.stream.isRepairingNamespaces has not been set to true
- */
- public void writeAttribute(String namespaceURI,
- String localName,
- String value)
- throws XMLStreamException;
-
- /**
- * Writes a namespace to the output stream
- * If the prefix argument to this method is the empty string,
- * "xmlns", or null this method will delegate to writeDefaultNamespace
- *
- * @param prefix the prefix to bind this namespace to
- * @param namespaceURI the uri to bind the prefix to
- * @throws IllegalStateException if the current state does not allow Namespace writing
- * @throws XMLStreamException
- */
- public void writeNamespace(String prefix, String namespaceURI)
- throws XMLStreamException;
-
- /**
- * Writes the default namespace to the stream
- * @param namespaceURI the uri to bind the default namespace to
- * @throws IllegalStateException if the current state does not allow Namespace writing
- * @throws XMLStreamException
- */
- public void writeDefaultNamespace(String namespaceURI)
- throws XMLStreamException;
-
- /**
- * Writes an xml comment with the data enclosed
- * @param data the data contained in the comment, may be null
- * @throws XMLStreamException
- */
- public void writeComment(String data)
- throws XMLStreamException;
-
- /**
- * Writes a processing instruction
- * @param target the target of the processing instruction, may not be null
- * @throws XMLStreamException
- */
- public void writeProcessingInstruction(String target)
- throws XMLStreamException;
-
- /**
- * Writes a processing instruction
- * @param target the target of the processing instruction, may not be null
- * @param data the data contained in the processing instruction, may not be null
- * @throws XMLStreamException
- */
- public void writeProcessingInstruction(String target,
- String data)
- throws XMLStreamException;
-
- /**
- * Writes a CData section
- * @param data the data contained in the CData Section, may not be null
- * @throws XMLStreamException
- */
- public void writeCData(String data)
- throws XMLStreamException;
-
- /**
- * Write a DTD section. This string represents the entire doctypedecl production
- * from the XML 1.0 specification.
- *
- * @param dtd the DTD to be written
- * @throws XMLStreamException
- */
- public void writeDTD(String dtd)
- throws XMLStreamException;
-
- /**
- * Writes an entity reference
- * @param name the name of the entity
- * @throws XMLStreamException
- */
- public void writeEntityRef(String name)
- throws XMLStreamException;
-
- /**
- * Write the XML Declaration. Defaults the XML version to 1.0, and the encoding to utf-8
- * @throws XMLStreamException
- */
- public void writeStartDocument()
- throws XMLStreamException;
-
- /**
- * Write the XML Declaration. Defaults the XML version to 1.0
- * @param version version of the xml document
- * @throws XMLStreamException
- */
- public void writeStartDocument(String version)
- throws XMLStreamException;
-
- /**
- * Write the XML Declaration. Note that the encoding parameter does
- * not set the actual encoding of the underlying output. That must
- * be set when the instance of the XMLStreamWriter is created using the
- * XMLOutputFactory
- * @param encoding encoding of the xml declaration
- * @param version version of the xml document
- * @throws XMLStreamException If given encoding does not match encoding
- * of the underlying stream
- */
- public void writeStartDocument(String encoding,
- String version)
- throws XMLStreamException;
-
- /**
- * Write text to the output
- * @param text the value to write
- * @throws XMLStreamException
- */
- public void writeCharacters(String text)
- throws XMLStreamException;
-
- /**
- * Write text to the output
- * @param text the value to write
- * @param start the starting position in the array
- * @param len the number of characters to write
- * @throws XMLStreamException
- */
- public void writeCharacters(char[] text, int start, int len)
- throws XMLStreamException;
-
- /**
- * Gets the prefix the uri is bound to
- * @return the prefix or null
- * @throws XMLStreamException
- */
- public String getPrefix(String uri)
- throws XMLStreamException;
-
- /**
- * Sets the prefix the uri is bound to. This prefix is bound
- * in the scope of the current START_ELEMENT / END_ELEMENT pair.
- * If this method is called before a START_ELEMENT has been written
- * the prefix is bound in the root scope.
- * @param prefix the prefix to bind to the uri, may not be null
- * @param uri the uri to bind to the prefix, may be null
- * @throws XMLStreamException
- */
- public void setPrefix(String prefix, String uri)
- throws XMLStreamException;
-
-
- /**
- * Binds a URI to the default namespace
- * This URI is bound
- * in the scope of the current START_ELEMENT / END_ELEMENT pair.
- * If this method is called before a START_ELEMENT has been written
- * the uri is bound in the root scope.
- * @param uri the uri to bind to the default namespace, may be null
- * @throws XMLStreamException
- */
- public void setDefaultNamespace(String uri)
- throws XMLStreamException;
-
- /**
- * Sets the current namespace context for prefix and uri bindings.
- * This context becomes the root namespace context for writing and
- * will replace the current root namespace context. Subsequent calls
- * to setPrefix and setDefaultNamespace will bind namespaces using
- * the context passed to the method as the root context for resolving
- * namespaces. This method may only be called once at the start of
- * the document. It does not cause the namespaces to be declared.
- * If a namespace URI to prefix mapping is found in the namespace
- * context it is treated as declared and the prefix may be used
- * by the StreamWriter.
- * @param context the namespace context to use for this writer, may not be null
- * @throws XMLStreamException
- */
- public void setNamespaceContext(NamespaceContext context)
- throws XMLStreamException;
-
- /**
- * Returns the current namespace context.
- * @return the current NamespaceContext
- */
- public NamespaceContext getNamespaceContext();
-
- /**
- * Get the value of a feature/property from the underlying implementation
- * @param name The name of the property, may not be null
- * @return The value of the property
- * @throws IllegalArgumentException if the property is not supported
- * @throws NullPointerException if the name is null
- */
- public Object getProperty(java.lang.String name) throws IllegalArgumentException;
-
-}
diff --git a/src/javax/xml/stream/events/Attribute.java b/src/javax/xml/stream/events/Attribute.java
deleted file mode 100644
index 248d060..0000000
--- a/src/javax/xml/stream/events/Attribute.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- */
-
-package javax.xml.stream.events;
-
-import javax.xml.namespace.QName;
-
-/**
- * An interface that contains information about an attribute. Attributes are reported
- * as a set of events accessible from a StartElement. Other applications may report
- * Attributes as first-order events, for example as the results of an XPath expression.
- *
- * @version 1.0
- * @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- * @see StartElement
- * @since 1.6
- */
-public interface Attribute extends XMLEvent {
-
- /**
- * Returns the QName for this attribute
- */
- QName getName();
-
- /**
- * Gets the normalized value of this attribute
- */
- public String getValue();
-
- /**
- * Gets the type of this attribute, default is
- * the String "CDATA"
- * @return the type as a String, default is "CDATA"
- */
- public String getDTDType();
-
- /**
- * A flag indicating whether this attribute was actually
- * specified in the start-tag of its element, or was defaulted from the schema.
- * @return returns true if this was specified in the start element
- */
- public boolean isSpecified();
-
-}
diff --git a/src/javax/xml/stream/events/Characters.java b/src/javax/xml/stream/events/Characters.java
deleted file mode 100644
index 76dab7f..0000000
--- a/src/javax/xml/stream/events/Characters.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- */
-
-package javax.xml.stream.events;
-
-/**
- * This describes the interface to Characters events.
- * All text events get reported as Characters events.
- * Content, CData and whitespace are all reported as
- * Characters events. IgnorableWhitespace, in most cases,
- * will be set to false unless an element declaration of element
- * content is present for the current element.
- *
- * @version 1.0
- * @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- * @since 1.6
- */
-public interface Characters extends XMLEvent {
- /**
- * Get the character data of this event
- */
- public String getData();
-
- /**
- * Returns true if this set of Characters
- * is all whitespace. Whitespace inside a document
- * is reported as CHARACTERS. This method allows
- * checking of CHARACTERS events to see if they
- * are composed of only whitespace characters
- */
- public boolean isWhiteSpace();
-
- /**
- * Returns true if this is a CData section. If this
- * event is CData its event type will be CDATA
- *
- * If javax.xml.stream.isCoalescing is set to true CDATA Sections
- * that are surrounded by non CDATA characters will be reported
- * as a single Characters event. This method will return false
- * in this case.
- */
- public boolean isCData();
-
- /**
- * Return true if this is ignorableWhiteSpace. If
- * this event is ignorableWhiteSpace its event type will
- * be SPACE.
- */
- public boolean isIgnorableWhiteSpace();
-
-}
diff --git a/src/javax/xml/stream/events/Comment.java b/src/javax/xml/stream/events/Comment.java
deleted file mode 100644
index 8ed0929..0000000
--- a/src/javax/xml/stream/events/Comment.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- */
-
-package javax.xml.stream.events;
-
-/**
- * An interface for comment events
- *
- * @version 1.0
- * @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- * @since 1.6
- */
-public interface Comment extends XMLEvent {
-
- /**
- * Return the string data of the comment, returns empty string if it
- * does not exist
- */
- public String getText();
-}
diff --git a/src/javax/xml/stream/events/DTD.java b/src/javax/xml/stream/events/DTD.java
deleted file mode 100644
index 3b0bb9f..0000000
--- a/src/javax/xml/stream/events/DTD.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- */
-
-package javax.xml.stream.events;
-
-import java.util.List;
-
-/**
- * This is the top level interface for events dealing with DTDs
- *
- * @version 1.0
- * @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- * @since 1.6
- */
-public interface DTD extends XMLEvent {
-
- /**
- * Returns the entire Document Type Declaration as a string, including
- * the internal DTD subset.
- * This may be null if there is not an internal subset.
- * If it is not null it must return the entire
- * Document Type Declaration which matches the doctypedecl
- * production in the XML 1.0 specification
- */
- String getDocumentTypeDeclaration();
-
- /**
- * Returns an implementation defined representation of the DTD.
- * This method may return null if no representation is available.
- */
- Object getProcessedDTD();
-
- /**
- * Return a List containing the notations declared in the DTD.
- * This list must contain NotationDeclaration events.
- * @see NotationDeclaration
- * @return an unordered list of NotationDeclaration events
- */
- List getNotations();
-
- /**
- * Return a List containing the general entities,
- * both external and internal, declared in the DTD.
- * This list must contain EntityDeclaration events.
- * @see EntityDeclaration
- * @return an unordered list of EntityDeclaration events
- */
- List getEntities();
-}
diff --git a/src/javax/xml/stream/events/EndDocument.java b/src/javax/xml/stream/events/EndDocument.java
deleted file mode 100644
index 0e7ab31..0000000
--- a/src/javax/xml/stream/events/EndDocument.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- */
-
-package javax.xml.stream.events;
-
-/**
- * A marker interface for the end of the document
- *
- * @version 1.0
- * @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- * @since 1.6
- */
-public interface EndDocument extends XMLEvent {
- /**
- * No methods are defined in this interface.
- */
-}
diff --git a/src/javax/xml/stream/events/EndElement.java b/src/javax/xml/stream/events/EndElement.java
deleted file mode 100644
index fd6d5f2..0000000
--- a/src/javax/xml/stream/events/EndElement.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- */
-
-package javax.xml.stream.events;
-
-import java.util.Iterator;
-import javax.xml.namespace.QName;
-/**
- * An interface for the end element event. An EndElement is reported
- * for each End Tag in the document.
- *
- * @version 1.0
- * @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- * @see XMLEvent
- * @since 1.6
- */
-public interface EndElement extends XMLEvent {
-
- /**
- * Get the name of this event
- * @return the qualified name of this event
- */
- public QName getName();
-
- /**
- * Returns an Iterator of namespaces that have gone out
- * of scope. Returns an empty iterator if no namespaces have gone
- * out of scope.
- * @return an Iterator over Namespace interfaces, or an
- * empty iterator
- */
- public Iterator getNamespaces();
-
-}
diff --git a/src/javax/xml/stream/events/EntityDeclaration.java b/src/javax/xml/stream/events/EntityDeclaration.java
deleted file mode 100644
index 74610da..0000000
--- a/src/javax/xml/stream/events/EntityDeclaration.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- */
-
-package javax.xml.stream.events;
-/**
- * An interface for handling Entity Declarations
- *
- * This interface is used to record and report unparsed entity declarations.
- *
- * @version 1.0
- * @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- * @since 1.6
- */
-public interface EntityDeclaration extends XMLEvent {
-
- /**
- * The entity's public identifier, or null if none was given
- * @return the public ID for this declaration or null
- */
- String getPublicId();
-
- /**
- * The entity's system identifier.
- * @return the system ID for this declaration or null
- */
- String getSystemId();
-
- /**
- * The entity's name
- * @return the name, may not be null
- */
- String getName();
-
- /**
- * The name of the associated notation.
- * @return the notation name
- */
- String getNotationName();
-
- /**
- * The replacement text of the entity.
- * This method will only return non-null
- * if this is an internal entity.
- * @return null or the replacment text
- */
- String getReplacementText();
-
- /**
- * Get the base URI for this reference
- * or null if this information is not available
- * @return the base URI or null
- */
- String getBaseURI();
-
-}
diff --git a/src/javax/xml/stream/events/EntityReference.java b/src/javax/xml/stream/events/EntityReference.java
deleted file mode 100644
index 8871460..0000000
--- a/src/javax/xml/stream/events/EntityReference.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- */
-
-package javax.xml.stream.events;
-/**
- * An interface for handling Entity events.
- *
- * This event reports entities that have not been resolved
- * and reports their replacement text unprocessed (if
- * available). This event will be reported if javax.xml.stream.isReplacingEntityReferences
- * is set to false. If javax.xml.stream.isReplacingEntityReferences is set to true
- * entity references will be resolved transparently.
- *
- * Entities are handled in two possible ways:
- *
- * (1) If javax.xml.stream.isReplacingEntityReferences is set to true
- * all entity references are resolved and reported as markup transparently.
- * (2) If javax.xml.stream.isReplacingEntityReferences is set to false
- * Entity references are reported as an EntityReference Event.
- *
- * @version 1.0
- * @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- * @since 1.6
- */
-public interface EntityReference extends XMLEvent {
-
- /**
- * Return the declaration of this entity.
- */
- EntityDeclaration getDeclaration();
-
- /**
- * The name of the entity
- * @return the entity's name, may not be null
- */
- String getName();
-}
diff --git a/src/javax/xml/stream/events/Namespace.java b/src/javax/xml/stream/events/Namespace.java
deleted file mode 100644
index df5e6bd..0000000
--- a/src/javax/xml/stream/events/Namespace.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- */
-
-package javax.xml.stream.events;
-
-import javax.xml.namespace.QName;
-
-/**
- * An interface that contains information about a namespace.
- * Namespaces are accessed from a StartElement.
- *
- * @version 1.0
- * @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- * @see StartElement
- * @since 1.6
- */
-public interface Namespace extends Attribute {
-
- /**
- * Gets the prefix, returns "" if this is a default
- * namespace declaration.
- */
- public String getPrefix();
-
- /**
- * Gets the uri bound to the prefix of this namespace
- */
- public String getNamespaceURI();
-
- /**
- * returns true if this attribute declares the default namespace
- */
- public boolean isDefaultNamespaceDeclaration();
-}
diff --git a/src/javax/xml/stream/events/NotationDeclaration.java b/src/javax/xml/stream/events/NotationDeclaration.java
deleted file mode 100644
index fc5f790..0000000
--- a/src/javax/xml/stream/events/NotationDeclaration.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- */
-
-package javax.xml.stream.events;
-/**
- * An interface for handling Notation Declarations
- *
- * Receive notification of a notation declaration event.
- * It is up to the application to record the notation for later reference,
- * At least one of publicId and systemId must be non-null.
- * There is no guarantee that the notation declaration
- * will be reported before any unparsed entities that use it.
- *
- * @version 1.0
- * @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- * @since 1.6
- */
-public interface NotationDeclaration extends XMLEvent {
- /**
- * The notation name.
- */
- String getName();
-
- /**
- * The notation's public identifier, or null if none was given.
- */
- String getPublicId();
-
- /**
- * The notation's system identifier, or null if none was given.
- */
- String getSystemId();
-}
diff --git a/src/javax/xml/stream/events/ProcessingInstruction.java b/src/javax/xml/stream/events/ProcessingInstruction.java
deleted file mode 100644
index 9ee77d8..0000000
--- a/src/javax/xml/stream/events/ProcessingInstruction.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- */
-
-package javax.xml.stream.events;
-/**
- * An interface that describes the data found in processing instructions
- *
- * @version 1.0
- * @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- * @since 1.6
- */
-public interface ProcessingInstruction extends XMLEvent {
-
- /**
- * The target section of the processing instruction
- *
- * @return the String value of the PI or null
- */
- public String getTarget();
-
- /**
- * The data section of the processing instruction
- *
- * @return the String value of the PI's data or null
- */
- public String getData();
-}
diff --git a/src/javax/xml/stream/events/StartDocument.java b/src/javax/xml/stream/events/StartDocument.java
deleted file mode 100644
index d46c070..0000000
--- a/src/javax/xml/stream/events/StartDocument.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- */
-
-package javax.xml.stream.events;
-/**
- * An interface for the start document event
- *
- * @version 1.0
- * @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- * @since 1.6
- */
-public interface StartDocument extends XMLEvent {
-
- /**
- * Returns the system ID of the XML data
- * @return the system ID, defaults to ""
- */
- public String getSystemId();
-
- /**
- * Returns the encoding style of the XML data
- * @return the character encoding, defaults to "UTF-8"
- */
- public String getCharacterEncodingScheme();
-
- /**
- * Returns true if CharacterEncodingScheme was set in
- * the encoding declaration of the document
- */
- public boolean encodingSet();
-
- /**
- * Returns if this XML is standalone
- * @return the standalone state of XML, defaults to "no"
- */
- public boolean isStandalone();
-
- /**
- * Returns true if the standalone attribute was set in
- * the encoding declaration of the document.
- */
- public boolean standaloneSet();
-
- /**
- * Returns the version of XML of this XML stream
- * @return the version of XML, defaults to "1.0"
- */
- public String getVersion();
-}
diff --git a/src/javax/xml/stream/events/StartElement.java b/src/javax/xml/stream/events/StartElement.java
deleted file mode 100644
index 9b286a6..0000000
--- a/src/javax/xml/stream/events/StartElement.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- */
-
-package javax.xml.stream.events;
-
-import javax.xml.namespace.QName;
-import javax.xml.namespace.NamespaceContext;
-
-import java.util.Map;
-import java.util.Iterator;
-
-/**
- * The StartElement interface provides access to information about
- * start elements. A StartElement is reported for each Start Tag
- * in the document.
- *
- * @version 1.0
- * @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- * @since 1.6
- */
-public interface StartElement extends XMLEvent {
-
- /**
- * Get the name of this event
- * @return the qualified name of this event
- */
- public QName getName();
-
- /**
- * Returns an Iterator of non-namespace declared attributes declared on
- * this START_ELEMENT,
- * returns an empty iterator if there are no attributes. The
- * iterator must contain only implementations of the javax.xml.stream.Attribute
- * interface. Attributes are fundamentally unordered and may not be reported
- * in any order.
- *
- * @return a readonly Iterator over Attribute interfaces, or an
- * empty iterator
- */
- public Iterator getAttributes();
-
- /**
- * Returns an Iterator of namespaces declared on this element.
- * This Iterator does not contain previously declared namespaces
- * unless they appear on the current START_ELEMENT.
- * Therefore this list may contain redeclared namespaces and duplicate namespace
- * declarations. Use the getNamespaceContext() method to get the
- * current context of namespace declarations.
- *
- * <p>The iterator must contain only implementations of the
- * javax.xml.stream.Namespace interface.
- *
- * <p>A Namespace isA Attribute. One
- * can iterate over a list of namespaces as a list of attributes.
- * However this method returns only the list of namespaces
- * declared on this START_ELEMENT and does not
- * include the attributes declared on this START_ELEMENT.
- *
- * Returns an empty iterator if there are no namespaces.
- *
- * @return a readonly Iterator over Namespace interfaces, or an
- * empty iterator
- *
- */
- public Iterator getNamespaces();
-
- /**
- * Returns the attribute referred to by this name
- * @param name the qname of the desired name
- * @return the attribute corresponding to the name value or null
- */
- public Attribute getAttributeByName(QName name);
-
- /**
- * Gets a read-only namespace context. If no context is
- * available this method will return an empty namespace context.
- * The NamespaceContext contains information about all namespaces
- * in scope for this StartElement.
- *
- * @return the current namespace context
- */
- public NamespaceContext getNamespaceContext();
-
- /**
- * Gets the value that the prefix is bound to in the
- * context of this element. Returns null if
- * the prefix is not bound in this context
- * @param prefix the prefix to lookup
- * @return the uri bound to the prefix or null
- */
- public String getNamespaceURI(String prefix);
-}
diff --git a/src/javax/xml/stream/events/XMLEvent.java b/src/javax/xml/stream/events/XMLEvent.java
deleted file mode 100644
index 4f98012..0000000
--- a/src/javax/xml/stream/events/XMLEvent.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- */
-
-package javax.xml.stream.events;
-
-import java.io.Writer;
-import javax.xml.namespace.QName;
-/**
- * This is the base event interface for handling markup events.
- * Events are value objects that are used to communicate the
- * XML 1.0 InfoSet to the Application. Events may be cached
- * and referenced after the parse has completed.
- *
- * @version 1.0
- * @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- * @see javax.xml.stream.XMLEventReader
- * @see Characters
- * @see ProcessingInstruction
- * @see StartElement
- * @see EndElement
- * @see StartDocument
- * @see EndDocument
- * @see EntityReference
- * @see EntityDeclaration
- * @see NotationDeclaration
- * @since 1.6
- */
-public interface XMLEvent extends javax.xml.stream.XMLStreamConstants {
-
- /**
- * Returns an integer code for this event.
- * @see #START_ELEMENT
- * @see #END_ELEMENT
- * @see #CHARACTERS
- * @see #ATTRIBUTE
- * @see #NAMESPACE
- * @see #PROCESSING_INSTRUCTION
- * @see #COMMENT
- * @see #START_DOCUMENT
- * @see #END_DOCUMENT
- * @see #DTD
- */
- public int getEventType();
-
- /**
- * Return the location of this event. The Location
- * returned from this method is non-volatile and
- * will retain its information.
- * @see javax.xml.stream.Location
- */
- javax.xml.stream.Location getLocation();
-
- /**
- * A utility function to check if this event is a StartElement.
- * @see StartElement
- */
- public boolean isStartElement();
-
- /**
- * A utility function to check if this event is an Attribute.
- * @see Attribute
- */
- public boolean isAttribute();
-
- /**
- * A utility function to check if this event is a Namespace.
- * @see Namespace
- */
- public boolean isNamespace();
-
-
- /**
- * A utility function to check if this event is a EndElement.
- * @see EndElement
- */
- public boolean isEndElement();
-
- /**
- * A utility function to check if this event is an EntityReference.
- * @see EntityReference
- */
- public boolean isEntityReference();
-
- /**
- * A utility function to check if this event is a ProcessingInstruction.
- * @see ProcessingInstruction
- */
- public boolean isProcessingInstruction();
-
- /**
- * A utility function to check if this event is Characters.
- * @see Characters
- */
- public boolean isCharacters();
-
- /**
- * A utility function to check if this event is a StartDocument.
- * @see StartDocument
- */
- public boolean isStartDocument();
-
- /**
- * A utility function to check if this event is an EndDocument.
- * @see EndDocument
- */
- public boolean isEndDocument();
-
- /**
- * Returns this event as a start element event, may result in
- * a class cast exception if this event is not a start element.
- */
- public StartElement asStartElement();
-
- /**
- * Returns this event as an end element event, may result in
- * a class cast exception if this event is not a end element.
- */
- public EndElement asEndElement();
-
- /**
- * Returns this event as Characters, may result in
- * a class cast exception if this event is not Characters.
- */
- public Characters asCharacters();
-
- /**
- * This method is provided for implementations to provide
- * optional type information about the associated event.
- * It is optional and will return null if no information
- * is available.
- */
- public QName getSchemaType();
-
- /**
- * This method will write the XMLEvent as per the XML 1.0 specification as Unicode characters.
- * No indentation or whitespace should be outputted.
- *
- * Any user defined event type SHALL have this method
- * called when being written to on an output stream.
- * Built in Event types MUST implement this method,
- * but implementations MAY choose not call these methods
- * for optimizations reasons when writing out built in
- * Events to an output stream.
- * The output generated MUST be equivalent in terms of the
- * infoset expressed.
- *
- * @param writer The writer that will output the data
- * @throws XMLStreamException if there is a fatal error writing the event
- */
- public void writeAsEncodedUnicode(Writer writer)
- throws javax.xml.stream.XMLStreamException;
-
-}
diff --git a/src/javax/xml/stream/util/EventReaderDelegate.java b/src/javax/xml/stream/util/EventReaderDelegate.java
deleted file mode 100644
index 9e2fbd3..0000000
--- a/src/javax/xml/stream/util/EventReaderDelegate.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- */
-
-package javax.xml.stream.util;
-
-import javax.xml.namespace.QName;
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.stream.XMLEventReader;
-import javax.xml.stream.events.XMLEvent;
-import javax.xml.stream.Location;
-import javax.xml.stream.XMLStreamException;
-
-/**
- * This is the base class for deriving an XMLEventReader
- * filter.
- *
- * This class is designed to sit between an XMLEventReader and an
- * application's XMLEventReader. By default each method
- * does nothing but call the corresponding method on the
- * parent interface.
- *
- * @version 1.0
- * @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- * @see javax.xml.stream.XMLEventReader
- * @see StreamReaderDelegate
- * @since 1.6
- */
-
-public class EventReaderDelegate implements XMLEventReader {
- private XMLEventReader reader;
-
- /**
- * Construct an empty filter with no parent.
- */
- public EventReaderDelegate(){}
-
- /**
- * Construct an filter with the specified parent.
- * @param reader the parent
- */
- public EventReaderDelegate(XMLEventReader reader) {
- this.reader = reader;
- }
-
- /**
- * Set the parent of this instance.
- * @param reader the new parent
- */
- public void setParent(XMLEventReader reader) {
- this.reader = reader;
- }
-
- /**
- * Get the parent of this instance.
- * @return the parent or null if none is set
- */
- public XMLEventReader getParent() {
- return reader;
- }
-
- public XMLEvent nextEvent()
- throws XMLStreamException
- {
- return reader.nextEvent();
- }
-
- public Object next() {
- return reader.next();
- }
-
- public boolean hasNext()
- {
- return reader.hasNext();
- }
-
- public XMLEvent peek()
- throws XMLStreamException
- {
- return reader.peek();
- }
-
- public void close()
- throws XMLStreamException
- {
- reader.close();
- }
-
- public String getElementText()
- throws XMLStreamException
- {
- return reader.getElementText();
- }
-
- public XMLEvent nextTag()
- throws XMLStreamException
- {
- return reader.nextTag();
- }
-
- public Object getProperty(java.lang.String name)
- throws java.lang.IllegalArgumentException
- {
- return reader.getProperty(name);
- }
-
- public void remove() {
- reader.remove();
- }
-}
diff --git a/src/javax/xml/stream/util/StreamReaderDelegate.java b/src/javax/xml/stream/util/StreamReaderDelegate.java
deleted file mode 100644
index f04a985..0000000
--- a/src/javax/xml/stream/util/StreamReaderDelegate.java
+++ /dev/null
@@ -1,287 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- */
-
-package javax.xml.stream.util;
-
-import java.io.Reader;
-import javax.xml.namespace.QName;
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.Location;
-import javax.xml.stream.XMLStreamException;
-
-/**
- * This is the base class for deriving an XMLStreamReader filter
- *
- * This class is designed to sit between an XMLStreamReader and an
- * application's XMLStreamReader. By default each method
- * does nothing but call the corresponding method on the
- * parent interface.
- *
- * @version 1.0
- * @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- * @see javax.xml.stream.XMLStreamReader
- * @see EventReaderDelegate
- * @since 1.6
- */
-
-public class StreamReaderDelegate implements XMLStreamReader {
- private XMLStreamReader reader;
-
- /**
- * Construct an empty filter with no parent.
- */
- public StreamReaderDelegate(){}
-
- /**
- * Construct an filter with the specified parent.
- * @param reader the parent
- */
- public StreamReaderDelegate(XMLStreamReader reader) {
- this.reader = reader;
- }
-
- /**
- * Set the parent of this instance.
- * @param reader the new parent
- */
- public void setParent(XMLStreamReader reader) {
- this.reader = reader;
- }
-
- /**
- * Get the parent of this instance.
- * @return the parent or null if none is set
- */
- public XMLStreamReader getParent() {
- return reader;
- }
-
- public int next()
- throws XMLStreamException
- {
- return reader.next();
- }
-
- public int nextTag()
- throws XMLStreamException
- {
- return reader.nextTag();
- }
-
- public String getElementText()
- throws XMLStreamException
- {
- return reader.getElementText();
- }
-
- public void require(int type, String namespaceURI, String localName)
- throws XMLStreamException
- {
- reader.require(type,namespaceURI,localName);
- }
-
- public boolean hasNext()
- throws XMLStreamException
- {
- return reader.hasNext();
- }
-
- public void close()
- throws XMLStreamException
- {
- reader.close();
- }
-
- public String getNamespaceURI(String prefix)
- {
- return reader.getNamespaceURI(prefix);
- }
-
- public NamespaceContext getNamespaceContext() {
- return reader.getNamespaceContext();
- }
-
- public boolean isStartElement() {
- return reader.isStartElement();
- }
-
- public boolean isEndElement() {
- return reader.isEndElement();
- }
-
- public boolean isCharacters() {
- return reader.isCharacters();
- }
-
- public boolean isWhiteSpace() {
- return reader.isWhiteSpace();
- }
-
- public String getAttributeValue(String namespaceUri,
- String localName)
- {
- return reader.getAttributeValue(namespaceUri,localName);
- }
-
- public int getAttributeCount() {
- return reader.getAttributeCount();
- }
-
- public QName getAttributeName(int index) {
- return reader.getAttributeName(index);
- }
-
- public String getAttributePrefix(int index) {
- return reader.getAttributePrefix(index);
- }
-
- public String getAttributeNamespace(int index) {
- return reader.getAttributeNamespace(index);
- }
-
- public String getAttributeLocalName(int index) {
- return reader.getAttributeLocalName(index);
- }
-
- public String getAttributeType(int index) {
- return reader.getAttributeType(index);
- }
-
- public String getAttributeValue(int index) {
- return reader.getAttributeValue(index);
- }
-
- public boolean isAttributeSpecified(int index) {
- return reader.isAttributeSpecified(index);
- }
-
- public int getNamespaceCount() {
- return reader.getNamespaceCount();
- }
-
- public String getNamespacePrefix(int index) {
- return reader.getNamespacePrefix(index);
- }
-
- public String getNamespaceURI(int index) {
- return reader.getNamespaceURI(index);
- }
-
- public int getEventType() {
- return reader.getEventType();
- }
-
- public String getText() {
- return reader.getText();
- }
-
- public int getTextCharacters(int sourceStart,
- char[] target,
- int targetStart,
- int length)
- throws XMLStreamException {
- return reader.getTextCharacters(sourceStart,
- target,
- targetStart,
- length);
- }
-
-
- public char[] getTextCharacters() {
- return reader.getTextCharacters();
- }
-
- public int getTextStart() {
- return reader.getTextStart();
- }
-
- public int getTextLength() {
- return reader.getTextLength();
- }
-
- public String getEncoding() {
- return reader.getEncoding();
- }
-
- public boolean hasText() {
- return reader.hasText();
- }
-
- public Location getLocation() {
- return reader.getLocation();
- }
-
- public QName getName() {
- return reader.getName();
- }
-
- public String getLocalName() {
- return reader.getLocalName();
- }
-
- public boolean hasName() {
- return reader.hasName();
- }
-
- public String getNamespaceURI() {
- return reader.getNamespaceURI();
- }
-
- public String getPrefix() {
- return reader.getPrefix();
- }
-
- public String getVersion() {
- return reader.getVersion();
- }
-
- public boolean isStandalone() {
- return reader.isStandalone();
- }
-
- public boolean standaloneSet() {
- return reader.standaloneSet();
- }
-
- public String getCharacterEncodingScheme() {
- return reader.getCharacterEncodingScheme();
- }
-
- public String getPITarget() {
- return reader.getPITarget();
- }
-
- public String getPIData() {
- return reader.getPIData();
- }
-
- public Object getProperty(String name) {
- return reader.getProperty(name);
- }
-}
diff --git a/src/javax/xml/stream/util/XMLEventAllocator.java b/src/javax/xml/stream/util/XMLEventAllocator.java
deleted file mode 100644
index 11e6e7c..0000000
--- a/src/javax/xml/stream/util/XMLEventAllocator.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- */
-
-package javax.xml.stream.util;
-
-import javax.xml.stream.events.XMLEvent;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamException;
-
-/**
- * This interface defines a class that allows a user to register
- * a way to allocate events given an XMLStreamReader. An implementation
- * is not required to use the XMLEventFactory implementation but this
- * is recommended. The XMLEventAllocator can be set on an XMLInputFactory
- * using the property "javax.xml.stream.allocator"
- *
- * @version 1.0
- * @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- * @see javax.xml.stream.XMLInputFactory
- * @see javax.xml.stream.XMLEventFactory
- * @since 1.6
- */
-public interface XMLEventAllocator {
-
- /**
- * This method creates an instance of the XMLEventAllocator. This
- * allows the XMLInputFactory to allocate a new instance per reader.
- */
- public XMLEventAllocator newInstance();
-
- /**
- * This method allocates an event given the current
- * state of the XMLStreamReader. If this XMLEventAllocator
- * does not have a one-to-one mapping between reader states
- * and events this method will return null. This method
- * must not modify the state of the XMLStreamReader.
- * @param reader The XMLStreamReader to allocate from
- * @return the event corresponding to the current reader state
- */
- public XMLEvent allocate(XMLStreamReader reader)
- throws XMLStreamException;
-
- /**
- * This method allocates an event or set of events
- * given the current
- * state of the XMLStreamReader and adds the event
- * or set of events to the
- * consumer that was passed in. This method can be used
- * to expand or contract reader states into event states.
- * This method may modify the state of the XMLStreamReader.
- * @param reader The XMLStreamReader to allocate from
- * @param consumer The XMLEventConsumer to add to.
- */
- public void allocate(XMLStreamReader reader, XMLEventConsumer consumer)
- throws XMLStreamException;
-
-}
diff --git a/src/javax/xml/stream/util/XMLEventConsumer.java b/src/javax/xml/stream/util/XMLEventConsumer.java
deleted file mode 100644
index 062f706..0000000
--- a/src/javax/xml/stream/util/XMLEventConsumer.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- */
-
-package javax.xml.stream.util;
-
-import javax.xml.stream.events.XMLEvent;
-import javax.xml.stream.XMLStreamException;
-
-/**
- * This interface defines an event consumer interface. The contract of the
- * of a consumer is to accept the event. This interface can be used to
- * mark an object as able to receive events. Add may be called several
- * times in immediate succession so a consumer must be able to cache
- * events it hasn't processed yet.
- *
- * @version 1.0
- * @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
- * @since 1.6
- */
-public interface XMLEventConsumer {
-
- /**
- * This method adds an event to the consumer. Calling this method
- * invalidates the event parameter. The client application should
- * discard all references to this event upon calling add.
- * The behavior of an application that continues to use such references
- * is undefined.
- *
- * @param event the event to add, may not be null
- */
- public void add(XMLEvent event)
- throws XMLStreamException;
-}
diff --git a/src/javax/xml/transform/ErrorListener.java b/src/javax/xml/transform/ErrorListener.java
deleted file mode 100644
index bc28823..0000000
--- a/src/javax/xml/transform/ErrorListener.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.transform;
-
-/**
- * <p>To provide customized error handling, implement this interface and
- * use the <code>setErrorListener</code> method to register an instance of the
- * implmentation with the {@link javax.xml.transform.Transformer}. The
- * <code>Transformer</code> then reports all errors and warnings through this
- * interface.</p>
- *
- * <p>If an application does <em>not</em> register its own custom
- * <code>ErrorListener</code>, the default <code>ErrorListener</code>
- * is used which reports all warnings and errors to <code>System.err</code>
- * and does not throw any <code>Exception</code>s.
- * Applications are <em>strongly</em> encouraged to register and use
- * <code>ErrorListener</code>s that insure proper behavior for warnings and
- * errors.</p>
- *
- * <p>For transformation errors, a <code>Transformer</code> must use this
- * interface instead of throwing an <code>Exception</code>: it is up to the
- * application to decide whether to throw an <code>Exception</code> for
- * different types of errors and warnings. Note however that the
- * <code>Transformer</code> is not required to continue with the transformation
- * after a call to {@link #fatalError(TransformerException exception)}.</p>
- *
- * <p><code>Transformer</code>s may use this mechanism to report XML parsing
- * errors as well as transformation errors.</p>
- */
-public interface ErrorListener {
-
- /**
- * Receive notification of a warning.
- *
- * <p>{@link javax.xml.transform.Transformer} can use this method to report
- * conditions that are not errors or fatal errors. The default behaviour
- * is to take no action.</p>
- *
- * <p>After invoking this method, the Transformer must continue with
- * the transformation. It should still be possible for the
- * application to process the document through to the end.</p>
- *
- * @param exception The warning information encapsulated in a
- * transformer exception.
- *
- * @throws javax.xml.transform.TransformerException if the application
- * chooses to discontinue the transformation.
- *
- * @see javax.xml.transform.TransformerException
- */
- public abstract void warning(TransformerException exception)
- throws TransformerException;
-
- /**
- * Receive notification of a recoverable error.
- *
- * <p>The transformer must continue to try and provide normal transformation
- * after invoking this method. It should still be possible for the
- * application to process the document through to the end if no other errors
- * are encountered.</p>
- *
- * @param exception The error information encapsulated in a
- * transformer exception.
- *
- * @throws javax.xml.transform.TransformerException if the application
- * chooses to discontinue the transformation.
- *
- * @see javax.xml.transform.TransformerException
- */
- public abstract void error(TransformerException exception)
- throws TransformerException;
-
- /**
- * <p>Receive notification of a non-recoverable error.</p>
- *
- * <p>The processor may choose to continue, but will not normally
- * proceed to a successful completion.</p>
- *
- * <p>The method should throw an exception if it is unable to
- * process the error, or if it wishes execution to terminate
- * immediately. The processor will not necessarily honor this
- * request.</p>
- *
- * @param exception The error information encapsulated in a
- * <code>TransformerException</code>.
- *
- * @throws javax.xml.transform.TransformerException if the application
- * chooses to discontinue the transformation.
- *
- * @see javax.xml.transform.TransformerException
- */
- public abstract void fatalError(TransformerException exception)
- throws TransformerException;
-}
diff --git a/src/javax/xml/transform/FactoryFinder.java b/src/javax/xml/transform/FactoryFinder.java
deleted file mode 100644
index 4ae6568..0000000
--- a/src/javax/xml/transform/FactoryFinder.java
+++ /dev/null
@@ -1,349 +0,0 @@
-/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.transform;
-
-import java.io.File;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.Iterator;
-import java.util.Properties;
-import java.util.ServiceConfigurationError;
-import java.util.ServiceLoader;
-
-/**
- * <p>Implements pluggable Datatypes.</p>
- *
- * <p>This class is duplicated for each JAXP subpackage so keep it in
- * sync. It is package private for secure class loading.</p>
- *
- * @author Santiago.PericasGeertsen@sun.com
- * @author Huizhe.Wang@oracle.com
- */
-class FactoryFinder {
- private static final String DEFAULT_PACKAGE = "com.sun.org.apache.xalan.internal.";
-
- /**
- * Internal debug flag.
- */
- private static boolean debug = false;
-
- /**
- * Cache for properties in java.home/lib/jaxp.properties
- */
- private final static Properties cacheProps = new Properties();
-
- /**
- * Flag indicating if properties from java.home/lib/jaxp.properties
- * have been cached.
- */
- static volatile boolean firstTime = true;
-
- /**
- * Security support class use to check access control before
- * getting certain system resources.
- */
- private final static SecuritySupport ss = new SecuritySupport();
-
- // Define system property "jaxp.debug" to get output
- static {
- // Use try/catch block to support applets, which throws
- // SecurityException out of this code.
- try {
- String val = ss.getSystemProperty("jaxp.debug");
- // Allow simply setting the prop to turn on debug
- debug = val != null && !"false".equals(val);
- }
- catch (SecurityException se) {
- debug = false;
- }
- }
-
- private static void dPrint(String msg) {
- if (debug) {
- System.err.println("JAXP: " + msg);
- }
- }
-
- /**
- * Attempt to load a class using the class loader supplied. If that fails
- * and fall back is enabled, the current (i.e. bootstrap) class loader is
- * tried.
- *
- * If the class loader supplied is <code>null</code>, first try using the
- * context class loader followed by the current (i.e. bootstrap) class
- * loader.
- *
- * Use bootstrap classLoader if cl = null and useBSClsLoader is true
- */
- static private Class<?> getProviderClass(String className, ClassLoader cl,
- boolean doFallback, boolean useBSClsLoader) throws ClassNotFoundException
- {
- try {
- if (cl == null) {
- if (useBSClsLoader) {
- return Class.forName(className, false, FactoryFinder.class.getClassLoader());
- } else {
- cl = ss.getContextClassLoader();
- if (cl == null) {
- throw new ClassNotFoundException();
- }
- else {
- return Class.forName(className, false, cl);
- }
- }
- }
- else {
- return Class.forName(className, false, cl);
- }
- }
- catch (ClassNotFoundException e1) {
- if (doFallback) {
- // Use current class loader - should always be bootstrap CL
- return Class.forName(className, false, FactoryFinder.class.getClassLoader());
- }
- else {
- throw e1;
- }
- }
- }
-
- /**
- * Create an instance of a class. Delegates to method
- * <code>getProviderClass()</code> in order to load the class.
- *
- * @param type Base class / Service interface of the factory to
- * instantiate.
- *
- * @param className Name of the concrete class corresponding to the
- * service provider
- *
- * @param cl <code>ClassLoader</code> used to load the factory class. If <code>null</code>
- * current <code>Thread</code>'s context classLoader is used to load the factory class.
- *
- * @param doFallback True if the current ClassLoader should be tried as
- * a fallback if the class is not found using cl
- *
- * @param useServicesMechanism True use services mechanism
- */
- static <T> T newInstance(Class<T> type, String className, ClassLoader cl,
- boolean doFallback, boolean useServicesMechanism)
- throws TransformerFactoryConfigurationError
- {
- assert type != null;
-
- boolean useBSClsLoader = false;
- // make sure we have access to restricted packages
- if (System.getSecurityManager() != null) {
- if (className != null && className.startsWith(DEFAULT_PACKAGE)) {
- cl = null;
- useBSClsLoader = true;
- }
- }
-
- try {
- Class<?> providerClass = getProviderClass(className, cl, doFallback, useBSClsLoader);
- if (!type.isAssignableFrom(providerClass)) {
- throw new ClassCastException(className + " cannot be cast to " + type.getName());
- }
- Object instance = null;
- if (!useServicesMechanism) {
- instance = newInstanceNoServiceLoader(type, providerClass);
- }
- if (instance == null) {
- instance = providerClass.newInstance();
- }
- if (debug) { // Extra check to avoid computing cl strings
- dPrint("created new instance of " + providerClass +
- " using ClassLoader: " + cl);
- }
- return type.cast(instance);
- }
- catch (ClassNotFoundException x) {
- throw new TransformerFactoryConfigurationError(x,
- "Provider " + className + " not found");
- }
- catch (Exception x) {
- throw new TransformerFactoryConfigurationError(x,
- "Provider " + className + " could not be instantiated: " + x);
- }
- }
-
- /**
- * Try to construct using newTransformerFactoryNoServiceLoader
- * method if available.
- */
- private static <T> T newInstanceNoServiceLoader(Class<T> type, Class<?> providerClass) {
- // Retain maximum compatibility if no security manager.
- if (System.getSecurityManager() == null) {
- return null;
- }
- try {
- final Method creationMethod =
- providerClass.getDeclaredMethod(
- "newTransformerFactoryNoServiceLoader"
- );
- final int modifiers = creationMethod.getModifiers();
-
- // Do not call the method if it's not public static.
- if (!Modifier.isPublic(modifiers) || !Modifier.isStatic(modifiers)) {
- return null;
- }
-
- // Only call the method if it's declared to return an instance of
- // TransformerFactory
- final Class<?> returnType = creationMethod.getReturnType();
- if (type.isAssignableFrom(returnType)) {
- final Object result = creationMethod.invoke(null, (Object[])null);
- return type.cast(result);
- } else {
- // This should not happen, as
- // TransformerFactoryImpl.newTransformerFactoryNoServiceLoader is
- // declared to return TransformerFactory.
- throw new ClassCastException(returnType + " cannot be cast to " + type);
- }
- } catch (ClassCastException e) {
- throw new TransformerFactoryConfigurationError(e, e.getMessage());
- } catch (NoSuchMethodException exc) {
- return null;
- } catch (Exception exc) {
- return null;
- }
- }
-
- /**
- * Finds the implementation Class object in the specified order. Main
- * entry point.
- * @return Class object of factory, never null
- *
- * @param type Base class / Service interface of the
- * factory to find.
- *
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * Package private so this code can be shared.
- */
- static <T> T find(Class<T> type, String fallbackClassName)
- throws TransformerFactoryConfigurationError
- {
- assert type != null;
-
- final String factoryId = type.getName();
-
- dPrint("find factoryId =" + factoryId);
- // Use the system property first
- try {
- String systemProp = ss.getSystemProperty(factoryId);
- if (systemProp != null) {
- dPrint("found system property, value=" + systemProp);
- return newInstance(type, systemProp, null, true, true);
- }
- }
- catch (SecurityException se) {
- if (debug) se.printStackTrace();
- }
-
- // try to read from $java.home/lib/jaxp.properties
- try {
- if (firstTime) {
- synchronized (cacheProps) {
- if (firstTime) {
- String configFile = ss.getSystemProperty("java.home") + File.separator +
- "lib" + File.separator + "jaxp.properties";
- File f = new File(configFile);
- firstTime = false;
- if (ss.doesFileExist(f)) {
- dPrint("Read properties file "+f);
- cacheProps.load(ss.getFileInputStream(f));
- }
- }
- }
- }
- final String factoryClassName = cacheProps.getProperty(factoryId);
-
- if (factoryClassName != null) {
- dPrint("found in $java.home/jaxp.properties, value=" + factoryClassName);
- return newInstance(type, factoryClassName, null, true, true);
- }
- }
- catch (Exception ex) {
- if (debug) ex.printStackTrace();
- }
-
- // Try Jar Service Provider Mechanism
- T provider = findServiceProvider(type);
- if (provider != null) {
- return provider;
- }
- if (fallbackClassName == null) {
- throw new TransformerFactoryConfigurationError(null,
- "Provider for " + factoryId + " cannot be found");
- }
-
- dPrint("loaded from fallback value: " + fallbackClassName);
- return newInstance(type, fallbackClassName, null, true, true);
- }
-
- /*
- * Try to find provider using the ServiceLoader.
- *
- * @param type Base class / Service interface of the factory to find.
- *
- * @return instance of provider class if found or null
- */
- private static <T> T findServiceProvider(final Class<T> type)
- throws TransformerFactoryConfigurationError
- {
- try {
- return AccessController.doPrivileged(new PrivilegedAction<T>() {
- public T run() {
- final ServiceLoader<T> serviceLoader = ServiceLoader.load(type);
- final Iterator<T> iterator = serviceLoader.iterator();
- if (iterator.hasNext()) {
- return iterator.next();
- } else {
- return null;
- }
- }
- });
- } catch(ServiceConfigurationError e) {
- // It is not possible to wrap an error directly in
- // FactoryConfigurationError - so we need to wrap the
- // ServiceConfigurationError in a RuntimeException.
- // The alternative would be to modify the logic in
- // FactoryConfigurationError to allow setting a
- // Throwable as the cause, but that could cause
- // compatibility issues down the road.
- final RuntimeException x = new RuntimeException(
- "Provider for " + type + " cannot be created", e);
- final TransformerFactoryConfigurationError error =
- new TransformerFactoryConfigurationError(x, x.getMessage());
- throw error;
- }
- }
-}
diff --git a/src/javax/xml/transform/OutputKeys.java b/src/javax/xml/transform/OutputKeys.java
deleted file mode 100644
index 3c0fc35..0000000
--- a/src/javax/xml/transform/OutputKeys.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.transform;
-
-/**
- * Provides string constants that can be used to set
- * output properties for a Transformer, or to retrieve
- * output properties from a Transformer or Templates object.
- * <p>All the fields in this class are read-only.</p>
- *
- * @see <a href="http://www.w3.org/TR/xslt#output">
- * section 16 of the XSL Transformations (XSLT) W3C Recommendation</a>
- */
-public class OutputKeys {
-
- /**
- * Default constructor is private on purpose. This class is
- * only for static variable access, and should never be constructed.
- */
- private OutputKeys() { }
-
- /**
- * method = "xml" | "html" | "text" | <var>expanded name</var>.
- *
- * <p>The value of the method property identifies the overall method that
- * should be used for outputting the result tree. Other non-namespaced
- * values may be used, such as "xhtml", but, if accepted, the handling
- * of such values is implementation defined. If any of the method values
- * are not accepted and are not namespace qualified,
- * then {@link javax.xml.transform.Transformer#setOutputProperty}
- * or {@link javax.xml.transform.Transformer#setOutputProperties} will
- * throw a {@link java.lang.IllegalArgumentException}.</p>
- *
- * @see <a href="http://www.w3.org/TR/xslt#output">
- * section 16 of the XSL Transformations (XSLT) W3C Recommendation</a>
- */
- public static final String METHOD = "method";
-
- /**
- * version = <var>nmtoken</var>.
- *
- * <p><code>version</code> specifies the version of the output
- * method.</p>
- * <p>When the output method is "xml", the version value specifies the
- * version of XML to be used for outputting the result tree. The default
- * value for the xml output method is 1.0. When the output method is
- * "html", the version value indicates the version of the HTML.
- * The default value for the xml output method is 4.0, which specifies
- * that the result should be output as HTML conforming to the HTML 4.0
- * Recommendation [HTML]. If the output method is "text", the version
- * property is ignored.</p>
- * @see <a href="http://www.w3.org/TR/xslt#output">
- * section 16 of the XSL Transformations (XSLT) W3C Recommendation</a>
- */
- public static final String VERSION = "version";
-
- /**
- * encoding = <var>string</var>.
- *
- * <p><code>encoding</code> specifies the preferred character
- * encoding that the Transformer should use to encode sequences of
- * characters as sequences of bytes. The value of the encoding property should be
- * treated case-insensitively. The value must only contain characters in
- * the range #x21 to #x7E (i.e., printable ASCII characters). The value
- * should either be a <code>charset</code> registered with the Internet
- * Assigned Numbers Authority <a href="http://www.iana.org/">[IANA]</a>,
- * <a href="http://www.ietf.org/rfc/rfc2278.txt">[RFC2278]</a>
- * or start with <code>X-</code>.</p>
- * @see <a href="http://www.w3.org/TR/xslt#output">
- * section 16 of the XSL Transformations (XSLT) W3C Recommendation</a>
- */
- public static final String ENCODING = "encoding";
-
- /**
- * omit-xml-declaration = "yes" | "no".
- *
- * <p><code>omit-xml-declaration</code> specifies whether the XSLT
- * processor should output an XML declaration; the value must be
- * <code>yes</code> or <code>no</code>.</p>
- * @see <a href="http://www.w3.org/TR/xslt#output">
- * section 16 of the XSL Transformations (XSLT) W3C Recommendation</a>
- */
- public static final String OMIT_XML_DECLARATION = "omit-xml-declaration";
-
- /**
- * standalone = "yes" | "no".
- *
- * <p><code>standalone</code> specifies whether the Transformer
- * should output a standalone document declaration; the value must be
- * <code>yes</code> or <code>no</code>.</p>
- * @see <a href="http://www.w3.org/TR/xslt#output">
- * section 16 of the XSL Transformations (XSLT) W3C Recommendation</a>
- */
- public static final String STANDALONE = "standalone";
-
- /**
- * doctype-public = <var>string</var>.
- * <p>See the documentation for the {@link #DOCTYPE_SYSTEM} property
- * for a description of what the value of the key should be.</p>
- *
- * @see <a href="http://www.w3.org/TR/xslt#output">
- * section 16 of the XSL Transformations (XSLT) W3C Recommendation</a>
- */
- public static final String DOCTYPE_PUBLIC = "doctype-public";
-
- /**
- * doctype-system = <var>string</var>.
- * <p><code>doctype-system</code> specifies the system identifier
- * to be used in the document type declaration.</p>
- * <p>If the doctype-system property is specified, the xml output method
- * should output a document type declaration immediately before the first
- * element. The name following &lt;!DOCTYPE should be the name of the first
- * element. If doctype-public property is also specified, then the xml
- * output method should output PUBLIC followed by the public identifier
- * and then the system identifier; otherwise, it should output SYSTEM
- * followed by the system identifier. The internal subset should be empty.
- * The value of the doctype-public property should be ignored unless the doctype-system
- * property is specified.</p>
- * <p>If the doctype-public or doctype-system properties are specified,
- * then the html output method should output a document type declaration
- * immediately before the first element. The name following &lt;!DOCTYPE
- * should be HTML or html. If the doctype-public property is specified,
- * then the output method should output PUBLIC followed by the specified
- * public identifier; if the doctype-system property is also specified,
- * it should also output the specified system identifier following the
- * public identifier. If the doctype-system property is specified but
- * the doctype-public property is not specified, then the output method
- * should output SYSTEM followed by the specified system identifier.</p>
- *
- * <p><code>doctype-system</code> specifies the system identifier
- * to be used in the document type declaration.</p>
- * @see <a href="http://www.w3.org/TR/xslt#output">
- * section 16 of the XSL Transformations (XSLT) W3C Recommendation</a>
- */
- public static final String DOCTYPE_SYSTEM = "doctype-system";
-
- /**
- * cdata-section-elements = <var>expanded names</var>.
- *
- * <p><code>cdata-section-elements</code> specifies a whitespace delimited
- * list of the names of elements whose text node children should be output
- * using CDATA sections. Note that these names must use the format
- * described in the section Qualfied Name Representation in
- * {@link javax.xml.transform}.</p>
- *
- * @see <a href="http://www.w3.org/TR/xslt#output">
- * section 16 of the XSL Transformations (XSLT) W3C Recommendation.</a>
- */
- public static final String CDATA_SECTION_ELEMENTS =
- "cdata-section-elements";
-
- /**
- * indent = "yes" | "no".
- *
- * <p><code>indent</code> specifies whether the Transformer may
- * add additional whitespace when outputting the result tree; the value
- * must be <code>yes</code> or <code>no</code>. </p>
- * @see <a href="http://www.w3.org/TR/xslt#output">
- * section 16 of the XSL Transformations (XSLT) W3C Recommendation</a>
- */
- public static final String INDENT = "indent";
-
- /**
- * media-type = <var>string</var>.
- *
- * <p><code>media-type</code> specifies the media type (MIME
- * content type) of the data that results from outputting the result
- * tree. The <code>charset</code> parameter should not be specified
- * explicitly; instead, when the top-level media type is
- * <code>text</code>, a <code>charset</code> parameter should be added
- * according to the character encoding actually used by the output
- * method. </p>
- * @see <a href="http://www.w3.org/TR/xslt#output">s
- * ection 16 of the XSL Transformations (XSLT) W3C Recommendation</a>
- */
- public static final String MEDIA_TYPE = "media-type";
-}
diff --git a/src/javax/xml/transform/Result.java b/src/javax/xml/transform/Result.java
deleted file mode 100644
index 4747285..0000000
--- a/src/javax/xml/transform/Result.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.transform;
-
-/**
- * <p>An object that implements this interface contains the information
- * needed to build a transformation result tree.</p>
- *
- * @author <a href="Jeff.Suttor@Sun.com">Jeff Suttor</a>
- */
-public interface Result {
-
- /**
- * The name of the processing instruction that is sent if the
- * result tree disables output escaping.
- *
- * <p>Normally, result tree serialization escapes & and < (and
- * possibly other characters) when outputting text nodes.
- * This ensures that the output is well-formed XML. However,
- * it is sometimes convenient to be able to produce output that is
- * almost, but not quite well-formed XML; for example,
- * the output may include ill-formed sections that will
- * be transformed into well-formed XML by a subsequent non-XML aware
- * process. If a processing instruction is sent with this name,
- * serialization should be output without any escaping. </p>
- *
- * <p>Result DOM trees may also have PI_DISABLE_OUTPUT_ESCAPING and
- * PI_ENABLE_OUTPUT_ESCAPING inserted into the tree.</p>
- *
- * @see <a href="http://www.w3.org/TR/xslt#disable-output-escaping">disable-output-escaping in XSLT Specification</a>
- */
- public static final String PI_DISABLE_OUTPUT_ESCAPING =
- "javax.xml.transform.disable-output-escaping";
-
- /**
- * The name of the processing instruction that is sent
- * if the result tree enables output escaping at some point after having
- * received a PI_DISABLE_OUTPUT_ESCAPING processing instruction.
- *
- * @see <a href="http://www.w3.org/TR/xslt#disable-output-escaping">disable-output-escaping in XSLT Specification</a>
- */
- public static final String PI_ENABLE_OUTPUT_ESCAPING =
- "javax.xml.transform.enable-output-escaping";
-
- /**
- * Set the system identifier for this Result.
- *
- * <p>If the Result is not to be written to a file, the system identifier is optional.
- * The application may still want to provide one, however, for use in error messages
- * and warnings, or to resolve relative output identifiers.</p>
- *
- * @param systemId The system identifier as a URI string.
- */
- public void setSystemId(String systemId);
-
- /**
- * Get the system identifier that was set with setSystemId.
- *
- * @return The system identifier that was set with setSystemId,
- * or null if setSystemId was not called.
- */
- public String getSystemId();
-}
diff --git a/src/javax/xml/transform/SecuritySupport.java b/src/javax/xml/transform/SecuritySupport.java
deleted file mode 100644
index e5f1bb0..0000000
--- a/src/javax/xml/transform/SecuritySupport.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.transform;
-
-import java.security.*;
-import java.net.*;
-import java.io.*;
-import java.util.*;
-
-/**
- * This class is duplicated for each JAXP subpackage so keep it in sync.
- * It is package private and therefore is not exposed as part of the JAXP
- * API.
- *
- * Security related methods that only work on J2SE 1.2 and newer.
- */
-class SecuritySupport {
-
-
- ClassLoader getContextClassLoader() throws SecurityException{
- return (ClassLoader)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- ClassLoader cl = null;
- //try {
- cl = Thread.currentThread().getContextClassLoader();
- //} catch (SecurityException ex) { }
- if (cl == null)
- cl = ClassLoader.getSystemClassLoader();
- return cl;
- }
- });
- }
-
- String getSystemProperty(final String propName) {
- return (String)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return System.getProperty(propName);
- }
- });
- }
-
- FileInputStream getFileInputStream(final File file)
- throws FileNotFoundException
- {
- try {
- return (FileInputStream)
- AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws FileNotFoundException {
- return new FileInputStream(file);
- }
- });
- } catch (PrivilegedActionException e) {
- throw (FileNotFoundException)e.getException();
- }
- }
-
- InputStream getResourceAsStream(final ClassLoader cl,
- final String name)
- {
- return (InputStream)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- InputStream ris;
- if (cl == null) {
- ris = Object.class.getResourceAsStream(name);
- } else {
- ris = cl.getResourceAsStream(name);
- }
- return ris;
- }
- });
- }
-
- boolean doesFileExist(final File f) {
- return ((Boolean)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return new Boolean(f.exists());
- }
- })).booleanValue();
- }
-
-}
diff --git a/src/javax/xml/transform/Source.java b/src/javax/xml/transform/Source.java
deleted file mode 100644
index 3af6969..0000000
--- a/src/javax/xml/transform/Source.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.transform;
-
-/**
- * An object that implements this interface contains the information
- * needed to act as source input (XML source or transformation instructions).
- */
-public interface Source {
-
- /**
- * Set the system identifier for this Source.
- *
- * <p>The system identifier is optional if the source does not
- * get its data from a URL, but it may still be useful to provide one.
- * The application can use a system identifier, for example, to resolve
- * relative URIs and to include in error messages and warnings.</p>
- *
- * @param systemId The system identifier as a URL string.
- */
- public void setSystemId(String systemId);
-
- /**
- * Get the system identifier that was set with setSystemId.
- *
- * @return The system identifier that was set with setSystemId, or null
- * if setSystemId was not called.
- */
- public String getSystemId();
-}
diff --git a/src/javax/xml/transform/SourceLocator.java b/src/javax/xml/transform/SourceLocator.java
deleted file mode 100644
index 475e654..0000000
--- a/src/javax/xml/transform/SourceLocator.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.transform;
-
-/**
- * This interface is primarily for the purposes of reporting where
- * an error occurred in the XML source or transformation instructions.
- */
-public interface SourceLocator {
-
- /**
- * Return the public identifier for the current document event.
- *
- * <p>The return value is the public identifier of the document
- * entity or of the external parsed entity in which the markup that
- * triggered the event appears.</p>
- *
- * @return A string containing the public identifier, or
- * null if none is available.
- * @see #getSystemId
- */
- public String getPublicId();
-
- /**
- * Return the system identifier for the current document event.
- *
- * <p>The return value is the system identifier of the document
- * entity or of the external parsed entity in which the markup that
- * triggered the event appears.</p>
- *
- * <p>If the system identifier is a URL, the parser must resolve it
- * fully before passing it to the application.</p>
- *
- * @return A string containing the system identifier, or null
- * if none is available.
- * @see #getPublicId
- */
- public String getSystemId();
-
- /**
- * Return the line number where the current document event ends.
- *
- * <p><strong>Warning:</strong> The return value from the method
- * is intended only as an approximation for the sake of error
- * reporting; it is not intended to provide sufficient information
- * to edit the character content of the original XML document.</p>
- *
- * <p>The return value is an approximation of the line number
- * in the document entity or external parsed entity where the
- * markup that triggered the event appears.</p>
- *
- * @return The line number, or -1 if none is available.
- * @see #getColumnNumber
- */
- public int getLineNumber();
-
- /**
- * Return the character position where the current document event ends.
- *
- * <p><strong>Warning:</strong> The return value from the method
- * is intended only as an approximation for the sake of error
- * reporting; it is not intended to provide sufficient information
- * to edit the character content of the original XML document.</p>
- *
- * <p>The return value is an approximation of the column number
- * in the document entity or external parsed entity where the
- * markup that triggered the event appears.</p>
- *
- * @return The column number, or -1 if none is available.
- * @see #getLineNumber
- */
- public int getColumnNumber();
-}
diff --git a/src/javax/xml/transform/Templates.java b/src/javax/xml/transform/Templates.java
deleted file mode 100644
index 9952368..0000000
--- a/src/javax/xml/transform/Templates.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.transform;
-
-import java.util.Properties;
-
-
-
-
-/**
- * An object that implements this interface is the runtime representation of processed
- * transformation instructions.
- *
- * <p>Templates must be threadsafe for a given instance
- * over multiple threads running concurrently, and may
- * be used multiple times in a given session.</p>
- */
-public interface Templates {
-
- /**
- * Create a new transformation context for this Templates object.
- *
- * @return A valid non-null instance of a Transformer.
- *
- * @throws TransformerConfigurationException if a Transformer can not be created.
- */
- Transformer newTransformer() throws TransformerConfigurationException;
-
- /**
- * Get the properties corresponding to the effective xsl:output element.
- * The object returned will
- * be a clone of the internal values. Accordingly, it can be mutated
- * without mutating the Templates object, and then handed in to
- * {@link javax.xml.transform.Transformer#setOutputProperties}.
- *
- * <p>The properties returned should contain properties set by the stylesheet,
- * and these properties are "defaulted" by default properties specified by
- * <a href="http://www.w3.org/TR/xslt#output">section 16 of the
- * XSL Transformations (XSLT) W3C Recommendation</a>. The properties that
- * were specifically set by the stylesheet should be in the base
- * Properties list, while the XSLT default properties that were not
- * specifically set should be in the "default" Properties list. Thus,
- * getOutputProperties().getProperty(String key) will obtain any
- * property in that was set by the stylesheet, <em>or</em> the default
- * properties, while
- * getOutputProperties().get(String key) will only retrieve properties
- * that were explicitly set in the stylesheet.</p>
- *
- * <p>For XSLT,
- * <a href="http://www.w3.org/TR/xslt#attribute-value-templates">Attribute
- * Value Templates</a> attribute values will
- * be returned unexpanded (since there is no context at this point). The
- * namespace prefixes inside Attribute Value Templates will be unexpanded,
- * so that they remain valid XPath values.</p>
- *
- * @return A Properties object, never null.
- */
- Properties getOutputProperties();
-}
diff --git a/src/javax/xml/transform/Transformer.java b/src/javax/xml/transform/Transformer.java
deleted file mode 100644
index 783e87a..0000000
--- a/src/javax/xml/transform/Transformer.java
+++ /dev/null
@@ -1,339 +0,0 @@
-/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.transform;
-
-import java.util.Properties;
-
-/**
- * An instance of this abstract class can transform a
- * source tree into a result tree.
- *
- * <p>An instance of this class can be obtained with the
- * {@link TransformerFactory#newTransformer TransformerFactory.newTransformer}
- * method. This instance may then be used to process XML from a
- * variety of sources and write the transformation output to a
- * variety of sinks.</p>
- *
- * <p>An object of this class may not be used in multiple threads
- * running concurrently. Different Transformers may be used
- * concurrently by different threads.</p>
- *
- * <p>A <code>Transformer</code> may be used multiple times. Parameters and
- * output properties are preserved across transformations.</p>
- *
- * @author <a href="Jeff.Suttor@Sun.com">Jeff Suttor</a>
- */
-public abstract class Transformer {
-
- /**
- * Default constructor is protected on purpose.
- */
- protected Transformer() { }
-
- /**
- * <p>Reset this <code>Transformer</code> to its original configuration.</p>
- *
- * <p><code>Transformer</code> is reset to the same state as when it was created with
- * {@link TransformerFactory#newTransformer()},
- * {@link TransformerFactory#newTransformer(Source source)} or
- * {@link Templates#newTransformer()}.
- * <code>reset()</code> is designed to allow the reuse of existing <code>Transformer</code>s
- * thus saving resources associated with the creation of new <code>Transformer</code>s.</p>
- *
- * <p>The reset <code>Transformer</code> is not guaranteed to have the same {@link URIResolver}
- * or {@link ErrorListener} <code>Object</code>s, e.g. {@link Object#equals(Object obj)}.
- * It is guaranteed to have a functionally equal <code>URIResolver</code>
- * and <code>ErrorListener</code>.</p>
- *
- * @throws UnsupportedOperationException When implementation does not
- * override this method.
- *
- * @since 1.5
- */
- public void reset() {
-
- // implementors should override this method
- throw new UnsupportedOperationException(
- "This Transformer, \"" + this.getClass().getName() + "\", does not support the reset functionality."
- + " Specification \"" + this.getClass().getPackage().getSpecificationTitle() + "\""
- + " version \"" + this.getClass().getPackage().getSpecificationVersion() + "\""
- );
- }
-
- /**
- * <p>Transform the XML <code>Source</code> to a <code>Result</code>.
- * Specific transformation behavior is determined by the settings of the
- * <code>TransformerFactory</code> in effect when the
- * <code>Transformer</code> was instantiated and any modifications made to
- * the <code>Transformer</code> instance.</p>
- *
- * <p>An empty <code>Source</code> is represented as an empty document
- * as constructed by {@link javax.xml.parsers.DocumentBuilder#newDocument()}.
- * The result of transforming an empty <code>Source</code> depends on
- * the transformation behavior; it is not always an empty
- * <code>Result</code>.</p>
- *
- * @param xmlSource The XML input to transform.
- * @param outputTarget The <code>Result</code> of transforming the
- * <code>xmlSource</code>.
- *
- * @throws TransformerException If an unrecoverable error occurs
- * during the course of the transformation.
- */
- public abstract void transform(Source xmlSource, Result outputTarget)
- throws TransformerException;
-
- /**
- * Add a parameter for the transformation.
- *
- * <p>Pass a qualified name as a two-part string, the namespace URI
- * enclosed in curly braces ({}), followed by the local name. If the
- * name has a null URL, the String only contain the local name. An
- * application can safely check for a non-null URI by testing to see if the
- * first character of the name is a '{' character.</p>
- * <p>For example, if a URI and local name were obtained from an element
- * defined with &lt;xyz:foo
- * xmlns:xyz="http://xyz.foo.com/yada/baz.html"/&gt;,
- * then the qualified name would be "{http://xyz.foo.com/yada/baz.html}foo".
- * Note that no prefix is used.</p>
- *
- * @param name The name of the parameter, which may begin with a
- * namespace URI in curly braces ({}).
- * @param value The value object. This can be any valid Java object. It is
- * up to the processor to provide the proper object coersion or to simply
- * pass the object on for use in an extension.
- *
- * @throws NullPointerException If value is null.
- */
- public abstract void setParameter(String name, Object value);
-
- /**
- * Get a parameter that was explicitly set with setParameter.
- *
- * <p>This method does not return a default parameter value, which
- * cannot be determined until the node context is evaluated during
- * the transformation process.
- *
- * @param name of <code>Object</code> to get
- *
- * @return A parameter that has been set with setParameter.
- */
- public abstract Object getParameter(String name);
-
- /**
- * <p>Set a list of parameters.</p>
- *
- * <p>Note that the list of parameters is specified as a
- * <code>Properties</code> <code>Object</code> which limits the parameter
- * values to <code>String</code>s. Multiple calls to
- * {@link #setParameter(String name, Object value)} should be used when the
- * desired values are non-<code>String</code> <code>Object</code>s.
- * The parameter names should conform as specified in
- * {@link #setParameter(String name, Object value)}.
- * An <code>IllegalArgumentException</code> is thrown if any names do not
- * conform.</p>
- *
- * <p>New parameters in the list are added to any existing parameters.
- * If the name of a new parameter is equal to the name of an existing
- * parameter as determined by {@link java.lang.Object#equals(Object obj)},
- * the existing parameter is set to the new value.</p>
- *
- * @param params Parameters to set.
- *
- * @throws IllegalArgumentException If any parameter names do not conform
- * to the naming rules.
- */
-
- /**
- * Clear all parameters set with setParameter.
- */
- public abstract void clearParameters();
-
- /**
- * Set an object that will be used to resolve URIs used in
- * document().
- *
- * <p>If the resolver argument is null, the URIResolver value will
- * be cleared and the transformer will no longer have a resolver.</p>
- *
- * @param resolver An object that implements the URIResolver interface,
- * or null.
- */
- public abstract void setURIResolver(URIResolver resolver);
-
- /**
- * Get an object that will be used to resolve URIs used in
- * document().
- *
- * @return An object that implements the URIResolver interface,
- * or null.
- */
- public abstract URIResolver getURIResolver();
-
- /**
- * Set the output properties for the transformation. These
- * properties will override properties set in the Templates
- * with xsl:output.
- *
- * <p>If argument to this function is null, any properties
- * previously set are removed, and the value will revert to the value
- * defined in the templates object.</p>
- *
- * <p>Pass a qualified property key name as a two-part string, the namespace
- * URI enclosed in curly braces ({}), followed by the local name. If the
- * name has a null URL, the String only contain the local name. An
- * application can safely check for a non-null URI by testing to see if the
- * first character of the name is a '{' character.</p>
- * <p>For example, if a URI and local name were obtained from an element
- * defined with &lt;xyz:foo
- * xmlns:xyz="http://xyz.foo.com/yada/baz.html"/&gt;,
- * then the qualified name would be "{http://xyz.foo.com/yada/baz.html}foo".
- * Note that no prefix is used.</p>
- * An <code>IllegalArgumentException</code> is thrown if any of the
- * argument keys are not recognized and are not namespace qualified.
- *
- * @param oformat A set of output properties that will be
- * used to override any of the same properties in affect
- * for the transformation.
- *
- * @throws IllegalArgumentException When keys are not recognized and
- * are not namespace qualified.
- *
- * @see javax.xml.transform.OutputKeys
- * @see java.util.Properties
- *
- */
- public abstract void setOutputProperties(Properties oformat);
-
- /**
- * <p>Get a copy of the output properties for the transformation.</p>
- *
- * <p>The properties returned should contain properties set by the user,
- * and properties set by the stylesheet, and these properties
- * are "defaulted" by default properties specified by
- * <a href="http://www.w3.org/TR/xslt#output">section 16 of the
- * XSL Transformations (XSLT) W3C Recommendation</a>. The properties that
- * were specifically set by the user or the stylesheet should be in the base
- * Properties list, while the XSLT default properties that were not
- * specifically set should be the default Properties list. Thus,
- * getOutputProperties().getProperty(String key) will obtain any
- * property in that was set by {@link #setOutputProperty},
- * {@link #setOutputProperties}, in the stylesheet, <em>or</em> the default
- * properties, while
- * getOutputProperties().get(String key) will only retrieve properties
- * that were explicitly set by {@link #setOutputProperty},
- * {@link #setOutputProperties}, or in the stylesheet.</p>
- *
- * <p>Note that mutation of the Properties object returned will not
- * effect the properties that the transformer contains.</p>
- *
- * <p>If any of the argument keys are not recognized and are not
- * namespace qualified, the property will be ignored and not returned.
- * In other words the behaviour is not orthogonal with
- * {@link #setOutputProperties setOutputProperties}.</p>
- *
- * @return A copy of the set of output properties in effect for
- * the next transformation.
- *
- * @see javax.xml.transform.OutputKeys
- * @see java.util.Properties
- * @see <a href="http://www.w3.org/TR/xslt#output">
- * XSL Transformations (XSLT) Version 1.0</a>
- */
- public abstract Properties getOutputProperties();
-
- /**
- * Set an output property that will be in effect for the
- * transformation.
- *
- * <p>Pass a qualified property name as a two-part string, the namespace URI
- * enclosed in curly braces ({}), followed by the local name. If the
- * name has a null URL, the String only contain the local name. An
- * application can safely check for a non-null URI by testing to see if the
- * first character of the name is a '{' character.</p>
- * <p>For example, if a URI and local name were obtained from an element
- * defined with &lt;xyz:foo
- * xmlns:xyz="http://xyz.foo.com/yada/baz.html"/&gt;,
- * then the qualified name would be "{http://xyz.foo.com/yada/baz.html}foo".
- * Note that no prefix is used.</p>
- *
- * <p>The Properties object that was passed to {@link #setOutputProperties}
- * won't be effected by calling this method.</p>
- *
- * @param name A non-null String that specifies an output
- * property name, which may be namespace qualified.
- * @param value The non-null string value of the output property.
- *
- * @throws IllegalArgumentException If the property is not supported, and is
- * not qualified with a namespace.
- *
- * @see javax.xml.transform.OutputKeys
- */
- public abstract void setOutputProperty(String name, String value)
- throws IllegalArgumentException;
-
- /**
- * <p>Get an output property that is in effect for the transformer.</p>
- *
- * <p>If a property has been set using {@link #setOutputProperty},
- * that value will be returned. Otherwise, if a property is explicitly
- * specified in the stylesheet, that value will be returned. If
- * the value of the property has been defaulted, that is, if no
- * value has been set explicitly either with {@link #setOutputProperty} or
- * in the stylesheet, the result may vary depending on
- * implementation and input stylesheet.</p>
- *
- * @param name A non-null String that specifies an output
- * property name, which may be namespace qualified.
- *
- * @return The string value of the output property, or null
- * if no property was found.
- *
- * @throws IllegalArgumentException If the property is not supported.
- *
- * @see javax.xml.transform.OutputKeys
- */
- public abstract String getOutputProperty(String name)
- throws IllegalArgumentException;
-
- /**
- * Set the error event listener in effect for the transformation.
- *
- * @param listener The new error listener.
- *
- * @throws IllegalArgumentException if listener is null.
- */
- public abstract void setErrorListener(ErrorListener listener)
- throws IllegalArgumentException;
-
- /**
- * Get the error event handler in effect for the transformation.
- * Implementations must provide a default error listener.
- *
- * @return The current error handler, which should never be null.
- */
- public abstract ErrorListener getErrorListener();
-}
diff --git a/src/javax/xml/transform/TransformerConfigurationException.java b/src/javax/xml/transform/TransformerConfigurationException.java
deleted file mode 100644
index 9e2f3af..0000000
--- a/src/javax/xml/transform/TransformerConfigurationException.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.transform;
-
-/**
- * Indicates a serious configuration error.
- */
-public class TransformerConfigurationException extends TransformerException {
-
- /**
- * Create a new <code>TransformerConfigurationException</code> with no
- * detail mesage.
- */
- public TransformerConfigurationException() {
- super("Configuration Error");
- }
-
- /**
- * Create a new <code>TransformerConfigurationException</code> with
- * the <code>String </code> specified as an error message.
- *
- * @param msg The error message for the exception.
- */
- public TransformerConfigurationException(String msg) {
- super(msg);
- }
-
- /**
- * Create a new <code>TransformerConfigurationException</code> with a
- * given <code>Exception</code> base cause of the error.
- *
- * @param e The exception to be encapsulated in a
- * TransformerConfigurationException.
- */
- public TransformerConfigurationException(Throwable e) {
- super(e);
- }
-
- /**
- * Create a new <code>TransformerConfigurationException</code> with the
- * given <code>Exception</code> base cause and detail message.
- *
- * @param e The exception to be encapsulated in a
- * TransformerConfigurationException
- * @param msg The detail message.
- */
- public TransformerConfigurationException(String msg, Throwable e) {
- super(msg, e);
- }
-
- /**
- * Create a new TransformerConfigurationException from a message and a Locator.
- *
- * <p>This constructor is especially useful when an application is
- * creating its own exception from within a DocumentHandler
- * callback.</p>
- *
- * @param message The error or warning message.
- * @param locator The locator object for the error or warning.
- */
- public TransformerConfigurationException(String message,
- SourceLocator locator) {
- super(message, locator);
- }
-
- /**
- * Wrap an existing exception in a TransformerConfigurationException.
- *
- * @param message The error or warning message, or null to
- * use the message from the embedded exception.
- * @param locator The locator object for the error or warning.
- * @param e Any exception.
- */
- public TransformerConfigurationException(String message,
- SourceLocator locator,
- Throwable e) {
- super(message, locator, e);
- }
-}
diff --git a/src/javax/xml/transform/TransformerException.java b/src/javax/xml/transform/TransformerException.java
deleted file mode 100644
index 0985ebb..0000000
--- a/src/javax/xml/transform/TransformerException.java
+++ /dev/null
@@ -1,370 +0,0 @@
-/*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.transform;
-
-import java.lang.reflect.Method;
-import java.lang.reflect.InvocationTargetException;
-
-/**
- * This class specifies an exceptional condition that occured
- * during the transformation process.
- */
-public class TransformerException extends Exception {
-
- /** Field locator specifies where the error occured */
- SourceLocator locator;
-
- /**
- * Method getLocator retrieves an instance of a SourceLocator
- * object that specifies where an error occured.
- *
- * @return A SourceLocator object, or null if none was specified.
- */
- public SourceLocator getLocator() {
- return locator;
- }
-
- /**
- * Method setLocator sets an instance of a SourceLocator
- * object that specifies where an error occured.
- *
- * @param location A SourceLocator object, or null to clear the location.
- */
- public void setLocator(SourceLocator location) {
- locator = location;
- }
-
- /** Field containedException specifies a wrapped exception. May be null. */
- Throwable containedException;
-
- /**
- * This method retrieves an exception that this exception wraps.
- *
- * @return An Throwable object, or null.
- * @see #getCause
- */
- public Throwable getException() {
- return containedException;
- }
-
- /**
- * Returns the cause of this throwable or <code>null</code> if the
- * cause is nonexistent or unknown. (The cause is the throwable that
- * caused this throwable to get thrown.)
- */
- public Throwable getCause() {
-
- return ((containedException == this)
- ? null
- : containedException);
- }
-
- /**
- * Initializes the <i>cause</i> of this throwable to the specified value.
- * (The cause is the throwable that caused this throwable to get thrown.)
- *
- * <p>This method can be called at most once. It is generally called from
- * within the constructor, or immediately after creating the
- * throwable. If this throwable was created
- * with {@link #TransformerException(Throwable)} or
- * {@link #TransformerException(String,Throwable)}, this method cannot be called
- * even once.
- *
- * @param cause the cause (which is saved for later retrieval by the
- * {@link #getCause()} method). (A <code>null</code> value is
- * permitted, and indicates that the cause is nonexistent or
- * unknown.)
- * @return a reference to this <code>Throwable</code> instance.
- * @throws IllegalArgumentException if <code>cause</code> is this
- * throwable. (A throwable cannot
- * be its own cause.)
- * @throws IllegalStateException if this throwable was
- * created with {@link #TransformerException(Throwable)} or
- * {@link #TransformerException(String,Throwable)}, or this method has already
- * been called on this throwable.
- */
- public synchronized Throwable initCause(Throwable cause) {
-
- if (this.containedException != null) {
- throw new IllegalStateException("Can't overwrite cause");
- }
-
- if (cause == this) {
- throw new IllegalArgumentException(
- "Self-causation not permitted");
- }
-
- this.containedException = cause;
-
- return this;
- }
-
- /**
- * Create a new TransformerException.
- *
- * @param message The error or warning message.
- */
- public TransformerException(String message) {
-
- super(message);
-
- this.containedException = null;
- this.locator = null;
- }
-
- /**
- * Create a new TransformerException wrapping an existing exception.
- *
- * @param e The exception to be wrapped.
- */
- public TransformerException(Throwable e) {
-
- super(e.toString());
-
- this.containedException = e;
- this.locator = null;
- }
-
- /**
- * Wrap an existing exception in a TransformerException.
- *
- * <p>This is used for throwing processor exceptions before
- * the processing has started.</p>
- *
- * @param message The error or warning message, or null to
- * use the message from the embedded exception.
- * @param e Any exception
- */
- public TransformerException(String message, Throwable e) {
-
- super(((message == null) || (message.length() == 0))
- ? e.toString()
- : message);
-
- this.containedException = e;
- this.locator = null;
- }
-
- /**
- * Create a new TransformerException from a message and a Locator.
- *
- * <p>This constructor is especially useful when an application is
- * creating its own exception from within a DocumentHandler
- * callback.</p>
- *
- * @param message The error or warning message.
- * @param locator The locator object for the error or warning.
- */
- public TransformerException(String message, SourceLocator locator) {
-
- super(message);
-
- this.containedException = null;
- this.locator = locator;
- }
-
- /**
- * Wrap an existing exception in a TransformerException.
- *
- * @param message The error or warning message, or null to
- * use the message from the embedded exception.
- * @param locator The locator object for the error or warning.
- * @param e Any exception
- */
- public TransformerException(String message, SourceLocator locator,
- Throwable e) {
-
- super(message);
-
- this.containedException = e;
- this.locator = locator;
- }
-
- /**
- * Get the error message with location information
- * appended.
- *
- * @return A <code>String</code> representing the error message with
- * location information appended.
- */
- public String getMessageAndLocation() {
-
- StringBuffer sbuffer = new StringBuffer();
- String message = super.getMessage();
-
- if (null != message) {
- sbuffer.append(message);
- }
-
- if (null != locator) {
- String systemID = locator.getSystemId();
- int line = locator.getLineNumber();
- int column = locator.getColumnNumber();
-
- if (null != systemID) {
- sbuffer.append("; SystemID: ");
- sbuffer.append(systemID);
- }
-
- if (0 != line) {
- sbuffer.append("; Line#: ");
- sbuffer.append(line);
- }
-
- if (0 != column) {
- sbuffer.append("; Column#: ");
- sbuffer.append(column);
- }
- }
-
- return sbuffer.toString();
- }
-
- /**
- * Get the location information as a string.
- *
- * @return A string with location info, or null
- * if there is no location information.
- */
- public String getLocationAsString() {
-
- if (null != locator) {
- StringBuffer sbuffer = new StringBuffer();
- String systemID = locator.getSystemId();
- int line = locator.getLineNumber();
- int column = locator.getColumnNumber();
-
- if (null != systemID) {
- sbuffer.append("; SystemID: ");
- sbuffer.append(systemID);
- }
-
- if (0 != line) {
- sbuffer.append("; Line#: ");
- sbuffer.append(line);
- }
-
- if (0 != column) {
- sbuffer.append("; Column#: ");
- sbuffer.append(column);
- }
-
- return sbuffer.toString();
- } else {
- return null;
- }
- }
-
- /**
- * Print the the trace of methods from where the error
- * originated. This will trace all nested exception
- * objects, as well as this object.
- */
- public void printStackTrace() {
- printStackTrace(new java.io.PrintWriter(System.err, true));
- }
-
- /**
- * Print the the trace of methods from where the error
- * originated. This will trace all nested exception
- * objects, as well as this object.
- * @param s The stream where the dump will be sent to.
- */
- public void printStackTrace(java.io.PrintStream s) {
- printStackTrace(new java.io.PrintWriter(s));
- }
-
- /**
- * Print the the trace of methods from where the error
- * originated. This will trace all nested exception
- * objects, as well as this object.
- * @param s The writer where the dump will be sent to.
- */
- public void printStackTrace(java.io.PrintWriter s) {
-
- if (s == null) {
- s = new java.io.PrintWriter(System.err, true);
- }
-
- try {
- String locInfo = getLocationAsString();
-
- if (null != locInfo) {
- s.println(locInfo);
- }
-
- super.printStackTrace(s);
- } catch (Throwable e) {}
-
- Throwable exception = getException();
-
- for (int i = 0; (i < 10) && (null != exception); i++) {
- s.println("---------");
-
- try {
- if (exception instanceof TransformerException) {
- String locInfo =
- ((TransformerException) exception)
- .getLocationAsString();
-
- if (null != locInfo) {
- s.println(locInfo);
- }
- }
-
- exception.printStackTrace(s);
- } catch (Throwable e) {
- s.println("Could not print stack trace...");
- }
-
- try {
- Method meth =
- ((Object) exception).getClass().getMethod("getException",
- (Class[]) null);
-
- if (null != meth) {
- Throwable prev = exception;
-
- exception = (Throwable) meth.invoke(exception, (Object[]) null);
-
- if (prev == exception) {
- break;
- }
- } else {
- exception = null;
- }
- } catch (InvocationTargetException ite) {
- exception = null;
- } catch (IllegalAccessException iae) {
- exception = null;
- } catch (NoSuchMethodException nsme) {
- exception = null;
- }
- }
- // insure output is written
- s.flush();
- }
-}
diff --git a/src/javax/xml/transform/TransformerFactory.java b/src/javax/xml/transform/TransformerFactory.java
deleted file mode 100644
index cde66de..0000000
--- a/src/javax/xml/transform/TransformerFactory.java
+++ /dev/null
@@ -1,419 +0,0 @@
-/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.transform;
-
-/**
- * <p>A TransformerFactory instance can be used to create
- * {@link javax.xml.transform.Transformer} and
- * {@link javax.xml.transform.Templates} objects.</p>
- *
- * <p>The system property that determines which Factory implementation
- * to create is named <code>"javax.xml.transform.TransformerFactory"</code>.
- * This property names a concrete subclass of the
- * <code>TransformerFactory</code> abstract class. If the property is not
- * defined, a platform default is be used.</p>
- *
- * @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a>
- * @author <a href="mailto:Neeraj.Bajaj@sun.com">Neeraj Bajaj</a>
- *
- * @since 1.5
- */
-public abstract class TransformerFactory {
-
- /**
- * Default constructor is protected on purpose.
- */
- protected TransformerFactory() { }
-
-
-
- /**
- * <p>Obtain a new instance of a <code>TransformerFactory</code>.
- * This static method creates a new factory instance.</p>
- * <p>This method uses the following ordered lookup procedure to determine
- * the <code>TransformerFactory</code> implementation class to
- * load:</p>
- * <ul>
- * <li>
- * Use the <code>javax.xml.transform.TransformerFactory</code> system
- * property.
- * </li>
- * <li>
- * Use the properties file "lib/jaxp.properties" in the JRE directory.
- * This configuration file is in standard <code>java.util.Properties
- * </code> format and contains the fully qualified name of the
- * implementation class with the key being the system property defined
- * above.
- * <br>
- * The jaxp.properties file is read only once by the JAXP implementation
- * and it's values are then cached for future use. If the file does not exist
- * when the first attempt is made to read from it, no further attempts are
- * made to check for its existence. It is not possible to change the value
- * of any property in jaxp.properties after it has been read for the first time.
- * </li>
- * <li>
- * Use the service-provider loading facilities, defined by the
- * {@link java.util.ServiceLoader} class, to attempt to locate and load an
- * implementation of the service using the {@linkplain
- * java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}:
- * the service-provider loading facility will use the {@linkplain
- * java.lang.Thread#getContextClassLoader() current thread's context class loader}
- * to attempt to load the service. If the context class
- * loader is null, the {@linkplain
- * ClassLoader#getSystemClassLoader() system class loader} will be used.
- * </li>
- * <li>
- * Otherwise, the system-default implementation is returned.
- * </li>
- * </ul>
- *
- * <p>Once an application has obtained a reference to a <code>
- * TransformerFactory</code> it can use the factory to configure
- * and obtain transformer instances.</p>
- *
- * @return new TransformerFactory instance, never null.
- *
- * @throws TransformerFactoryConfigurationError Thrown in case of {@linkplain
- * java.util.ServiceConfigurationError service configuration error} or if
- * the implementation is not available or cannot be instantiated.
- */
- public static TransformerFactory newInstance()
- throws TransformerFactoryConfigurationError {
-
- return FactoryFinder.find(
- /* The default property name according to the JAXP spec */
- TransformerFactory.class,
- /* The fallback implementation class name, XSLTC */
- "com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl");
- }
-
- /**
- * <p>Obtain a new instance of a <code>TransformerFactory</code> from factory class name.
- * This function is useful when there are multiple providers in the classpath.
- * It gives more control to the application as it can specify which provider
- * should be loaded.</p>
- *
- * <p>Once an application has obtained a reference to a <code>
- * TransformerFactory</code> it can use the factory to configure
- * and obtain transformer instances.</p>
- *
- * <h2>Tip for Trouble-shooting</h2>
- * <p>Setting the <code>jaxp.debug</code> system property will cause
- * this method to print a lot of debug messages
- * to <code>System.err</code> about what it is doing and where it is looking at.</p>
- *
- * <p> If you have problems try:</p>
- * <pre>
- * java -Djaxp.debug=1 YourProgram ....
- * </pre>
- *
- * @param factoryClassName fully qualified factory class name that provides implementation of <code>javax.xml.transform.TransformerFactory</code>.
- *
- * @param classLoader <code>ClassLoader</code> used to load the factory class. If <code>null</code>
- * current <code>Thread</code>'s context classLoader is used to load the factory class.
- *
- * @return new TransformerFactory instance, never null.
- *
- * @throws TransformerFactoryConfigurationError
- * if <code>factoryClassName</code> is <code>null</code>, or
- * the factory class cannot be loaded, instantiated.
- *
- * @see #newInstance()
- *
- * @since 1.6
- */
- public static TransformerFactory newInstance(String factoryClassName, ClassLoader classLoader)
- throws TransformerFactoryConfigurationError{
-
- //do not fallback if given classloader can't find the class, throw exception
- return FactoryFinder.newInstance(TransformerFactory.class,
- factoryClassName, classLoader, false, false);
- }
- /**
- * <p>Process the <code>Source</code> into a <code>Transformer</code>
- * <code>Object</code>. The <code>Source</code> is an XSLT document that
- * conforms to <a href="http://www.w3.org/TR/xslt">
- * XSL Transformations (XSLT) Version 1.0</a>. Care must
- * be taken not to use this <code>Transformer</code> in multiple
- * <code>Thread</code>s running concurrently.
- * Different <code>TransformerFactories</code> can be used concurrently by
- * different <code>Thread</code>s.</p>
- *
- * @param source <code>Source </code> of XSLT document used to create
- * <code>Transformer</code>.
- * Examples of XML <code>Source</code>s include
- * {@link javax.xml.transform.dom.DOMSource DOMSource},
- * {@link javax.xml.transform.sax.SAXSource SAXSource}, and
- * {@link javax.xml.transform.stream.StreamSource StreamSource}.
- *
- * @return A <code>Transformer</code> object that may be used to perform
- * a transformation in a single <code>Thread</code>, never
- * <code>null</code>.
- *
- * @throws TransformerConfigurationException Thrown if there are errors when
- * parsing the <code>Source</code> or it is not possible to create a
- * <code>Transformer</code> instance.
- *
- * @see <a href="http://www.w3.org/TR/xslt">
- * XSL Transformations (XSLT) Version 1.0</a>
- */
- public abstract Transformer newTransformer(Source source)
- throws TransformerConfigurationException;
-
- /**
- * <p>Create a new <code>Transformer</code> that performs a copy
- * of the <code>Source</code> to the <code>Result</code>.
- * i.e. the "<em>identity transform</em>".</p>
- *
- * @return A Transformer object that may be used to perform a transformation
- * in a single thread, never null.
- *
- * @throws TransformerConfigurationException When it is not
- * possible to create a <code>Transformer</code> instance.
- */
- public abstract Transformer newTransformer()
- throws TransformerConfigurationException;
-
- /**
- * Process the Source into a Templates object, which is a
- * a compiled representation of the source. This Templates object
- * may then be used concurrently across multiple threads. Creating
- * a Templates object allows the TransformerFactory to do detailed
- * performance optimization of transformation instructions, without
- * penalizing runtime transformation.
- *
- * @param source An object that holds a URL, input stream, etc.
- *
- * @return A Templates object capable of being used for transformation
- * purposes, never <code>null</code>.
- *
- * @throws TransformerConfigurationException When parsing to
- * construct the Templates object fails.
- */
- public abstract Templates newTemplates(Source source)
- throws TransformerConfigurationException;
-
- /**
- * <p>Get the stylesheet specification(s) associated with the
- * XML <code>Source</code> document via the
- * <a href="http://www.w3.org/TR/xml-stylesheet/">
- * xml-stylesheet processing instruction</a> that match the given criteria.
- * Note that it is possible to return several stylesheets, in which case
- * they are applied as if they were a list of imports or cascades in a
- * single stylesheet.</p>
- *
- * @param source The XML source document.
- * @param media The media attribute to be matched. May be null, in which
- * case the prefered templates will be used (i.e. alternate = no).
- * @param title The value of the title attribute to match. May be null.
- * @param charset The value of the charset attribute to match. May be null.
- *
- * @return A <code>Source</code> <code>Object</code> suitable for passing
- * to the <code>TransformerFactory</code>.
- *
- * @throws TransformerConfigurationException An <code>Exception</code>
- * is thrown if an error occurings during parsing of the
- * <code>source</code>.
- *
- * @see <a href="http://www.w3.org/TR/xml-stylesheet/">
- * Associating Style Sheets with XML documents Version 1.0</a>
- */
- public abstract Source getAssociatedStylesheet(
- Source source,
- String media,
- String title,
- String charset)
- throws TransformerConfigurationException;
-
- /**
- * Set an object that is used by default during the transformation
- * to resolve URIs used in document(), xsl:import, or xsl:include.
- *
- * @param resolver An object that implements the URIResolver interface,
- * or null.
- */
- public abstract void setURIResolver(URIResolver resolver);
-
- /**
- * Get the object that is used by default during the transformation
- * to resolve URIs used in document(), xsl:import, or xsl:include.
- *
- * @return The URIResolver that was set with setURIResolver.
- */
- public abstract URIResolver getURIResolver();
-
- //======= CONFIGURATION METHODS =======
-
- /**
- * <p>Set a feature for this <code>TransformerFactory</code> and <code>Transformer</code>s
- * or <code>Template</code>s created by this factory.</p>
- *
- * <p>
- * Feature names are fully qualified {@link java.net.URI}s.
- * Implementations may define their own features.
- * An {@link TransformerConfigurationException} is thrown if this <code>TransformerFactory</code> or the
- * <code>Transformer</code>s or <code>Template</code>s it creates cannot support the feature.
- * It is possible for an <code>TransformerFactory</code> to expose a feature value but be unable to change its state.
- * </p>
- *
- * <p>All implementations are required to support the {@link javax.xml.XMLConstants#FEATURE_SECURE_PROCESSING} feature.
- * When the feature is:</p>
- * <ul>
- * <li>
- * <code>true</code>: the implementation will limit XML processing to conform to implementation limits
- * and behave in a secure fashion as defined by the implementation.
- * Examples include resolving user defined style sheets and functions.
- * If XML processing is limited for security reasons, it will be reported via a call to the registered
- * {@link ErrorListener#fatalError(TransformerException exception)}.
- * See {@link #setErrorListener(ErrorListener listener)}.
- * </li>
- * <li>
- * <code>false</code>: the implementation will processing XML according to the XML specifications without
- * regard to possible implementation limits.
- * </li>
- * </ul>
- *
- * @param name Feature name.
- * @param value Is feature state <code>true</code> or <code>false</code>.
- *
- * @throws TransformerConfigurationException if this <code>TransformerFactory</code>
- * or the <code>Transformer</code>s or <code>Template</code>s it creates cannot support this feature.
- * @throws NullPointerException If the <code>name</code> parameter is null.
- */
- public abstract void setFeature(String name, boolean value)
- throws TransformerConfigurationException;
-
- /**
- * Look up the value of a feature.
- *
- * <p>
- * Feature names are fully qualified {@link java.net.URI}s.
- * Implementations may define their own features.
- * <code>false</code> is returned if this <code>TransformerFactory</code> or the
- * <code>Transformer</code>s or <code>Template</code>s it creates cannot support the feature.
- * It is possible for an <code>TransformerFactory</code> to expose a feature value but be unable to change its state.
- * </p>
- *
- * @param name Feature name.
- *
- * @return The current state of the feature, <code>true</code> or <code>false</code>.
- *
- * @throws NullPointerException If the <code>name</code> parameter is null.
- */
- public abstract boolean getFeature(String name);
-
- /**
- * Allows the user to set specific attributes on the underlying
- * implementation. An attribute in this context is defined to
- * be an option that the implementation provides.
- * An <code>IllegalArgumentException</code> is thrown if the underlying
- * implementation doesn't recognize the attribute.
- * <p>
- * All implementations that implement JAXP 1.5 or newer are required to
- * support the {@link javax.xml.XMLConstants#ACCESS_EXTERNAL_DTD} and
- * {@link javax.xml.XMLConstants#ACCESS_EXTERNAL_STYLESHEET} properties.
- * </p>
- * <ul>
- * <li>
- * <p>
- * Access to external DTDs in the source file is restricted to the protocols
- * specified by the {@link javax.xml.XMLConstants#ACCESS_EXTERNAL_DTD} property.
- * If access is denied during transformation due to the restriction of this property,
- * {@link javax.xml.transform.TransformerException} will be thrown by
- * {@link javax.xml.transform.Transformer#transform(Source, Result)}.
- * </p>
- * <p>
- * Access to external DTDs in the stylesheet is restricted to the protocols
- * specified by the {@link javax.xml.XMLConstants#ACCESS_EXTERNAL_DTD} property.
- * If access is denied during the creation of a new transformer due to the
- * restriction of this property,
- * {@link javax.xml.transform.TransformerConfigurationException} will be thrown
- * by the {@link #newTransformer(Source)} method.
- * </p>
- * <p>
- * Access to external reference set by the stylesheet processing instruction,
- * Import and Include element is restricted to the protocols specified by the
- * {@link javax.xml.XMLConstants#ACCESS_EXTERNAL_STYLESHEET} property.
- * If access is denied during the creation of a new transformer due to the
- * restriction of this property,
- * {@link javax.xml.transform.TransformerConfigurationException} will be thrown
- * by the {@link #newTransformer(Source)} method.
- * </p>
- * <p>
- * Access to external document through XSLT document function is restricted
- * to the protocols specified by the property. If access is denied during
- * the transformation due to the restriction of this property,
- * {@link javax.xml.transform.TransformerException} will be thrown by the
- * {@link javax.xml.transform.Transformer#transform(Source, Result)} method.
- * </p>
- * </li>
- * </ul>
- *
- * @param name The name of the attribute.
- * @param value The value of the attribute.
- *
- * @throws IllegalArgumentException When implementation does not
- * recognize the attribute.
- */
- public abstract void setAttribute(String name, Object value);
-
- /**
- * Allows the user to retrieve specific attributes on the underlying
- * implementation.
- * An <code>IllegalArgumentException</code> is thrown if the underlying
- * implementation doesn't recognize the attribute.
- *
- * @param name The name of the attribute.
- *
- * @return value The value of the attribute.
- *
- * @throws IllegalArgumentException When implementation does not
- * recognize the attribute.
- */
- public abstract Object getAttribute(String name);
-
- /**
- * Set the error event listener for the TransformerFactory, which
- * is used for the processing of transformation instructions,
- * and not for the transformation itself.
- * An <code>IllegalArgumentException</code> is thrown if the
- * <code>ErrorListener</code> listener is <code>null</code>.
- *
- * @param listener The new error listener.
- *
- * @throws IllegalArgumentException When <code>listener</code> is
- * <code>null</code>
- */
- public abstract void setErrorListener(ErrorListener listener);
-
- /**
- * Get the error event handler for the TransformerFactory.
- *
- * @return The current error handler, which should never be null.
- */
- public abstract ErrorListener getErrorListener();
-
-}
diff --git a/src/javax/xml/transform/TransformerFactoryConfigurationError.java b/src/javax/xml/transform/TransformerFactoryConfigurationError.java
deleted file mode 100644
index fb060b0..0000000
--- a/src/javax/xml/transform/TransformerFactoryConfigurationError.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.transform;
-
-/**
- * Thrown when a problem with configuration with the Transformer Factories
- * exists. This error will typically be thrown when the class of a
- * transformation factory specified in the system properties cannot be found
- * or instantiated.
- */
-public class TransformerFactoryConfigurationError extends Error {
- private static final long serialVersionUID = -6527718720676281516L;
-
- /**
- * <code>Exception</code> for the
- * <code>TransformerFactoryConfigurationError</code>.
- */
- private Exception exception;
-
- /**
- * Create a new <code>TransformerFactoryConfigurationError</code> with no
- * detail mesage.
- */
- public TransformerFactoryConfigurationError() {
-
- super();
-
- this.exception = null;
- }
-
- /**
- * Create a new <code>TransformerFactoryConfigurationError</code> with
- * the <code>String</code> specified as an error message.
- *
- * @param msg The error message for the exception.
- */
- public TransformerFactoryConfigurationError(String msg) {
-
- super(msg);
-
- this.exception = null;
- }
-
- /**
- * Create a new <code>TransformerFactoryConfigurationError</code> with a
- * given <code>Exception</code> base cause of the error.
- *
- * @param e The exception to be encapsulated in a
- * TransformerFactoryConfigurationError.
- */
- public TransformerFactoryConfigurationError(Exception e) {
-
- super(e.toString());
-
- this.exception = e;
- }
-
- /**
- * Create a new <code>TransformerFactoryConfigurationError</code> with the
- * given <code>Exception</code> base cause and detail message.
- *
- * @param e The exception to be encapsulated in a
- * TransformerFactoryConfigurationError
- * @param msg The detail message.
- */
- public TransformerFactoryConfigurationError(Exception e, String msg) {
-
- super(msg);
-
- this.exception = e;
- }
-
- /**
- * Return the message (if any) for this error . If there is no
- * message for the exception and there is an encapsulated
- * exception then the message of that exception will be returned.
- *
- * @return The error message.
- */
- public String getMessage() {
-
- String message = super.getMessage();
-
- if ((message == null) && (exception != null)) {
- return exception.getMessage();
- }
-
- return message;
- }
-
- /**
- * Return the actual exception (if any) that caused this exception to
- * be raised.
- *
- * @return The encapsulated exception, or null if there is none.
- */
- public Exception getException() {
- return exception;
- }
- /**
- * use the exception chaining mechanism of JDK1.4
- */
- @Override
- public Throwable getCause() {
- return exception;
- }
-}
diff --git a/src/javax/xml/transform/URIResolver.java b/src/javax/xml/transform/URIResolver.java
deleted file mode 100644
index a4ea4c0..0000000
--- a/src/javax/xml/transform/URIResolver.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.transform;
-
-/**
- * <p>An object that implements this interface that can be called by the processor
- * to turn a URI used in document(), xsl:import, or xsl:include into a Source object.
- */
-public interface URIResolver {
-
- /**
- * Called by the processor when it encounters
- * an xsl:include, xsl:import, or document() function.
- *
- * @param href An href attribute, which may be relative or absolute.
- * @param base The base URI against which the first argument will be made
- * absolute if the absolute URI is required.
- *
- * @return A Source object, or null if the href cannot be resolved,
- * and the processor should try to resolve the URI itself.
- *
- * @throws TransformerException if an error occurs when trying to
- * resolve the URI.
- */
- public Source resolve(String href, String base)
- throws TransformerException;
-}
diff --git a/src/javax/xml/transform/dom/DOMLocator.java b/src/javax/xml/transform/dom/DOMLocator.java
deleted file mode 100644
index 13a7446..0000000
--- a/src/javax/xml/transform/dom/DOMLocator.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.transform.dom;
-
-import javax.xml.transform.SourceLocator;
-
-import org.w3c.dom.Node;
-
-
-/**
- * Indicates the position of a node in a source DOM, intended
- * primarily for error reporting. To use a DOMLocator, the receiver of an
- * error must downcast the {@link javax.xml.transform.SourceLocator}
- * object returned by an exception. A {@link javax.xml.transform.Transformer}
- * may use this object for purposes other than error reporting, for instance,
- * to indicate the source node that originated a result node.
- */
-public interface DOMLocator extends SourceLocator {
-
- /**
- * Return the node where the event occurred.
- *
- * @return The node that is the location for the event.
- */
- public Node getOriginatingNode();
-}
diff --git a/src/javax/xml/transform/dom/DOMResult.java b/src/javax/xml/transform/dom/DOMResult.java
deleted file mode 100644
index c7adfc4..0000000
--- a/src/javax/xml/transform/dom/DOMResult.java
+++ /dev/null
@@ -1,362 +0,0 @@
-/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.transform.dom;
-
-import javax.xml.transform.Result;
-import org.w3c.dom.Node;
-
-/**
- * <p>Acts as a holder for a transformation result tree in the form of a Document Object Model (DOM) tree.</p>
- *
- * <p>If no output DOM source is set, the transformation will create a Document node as the holder for the result of the transformation,
- * which may be retrieved with {@link #getNode()}.</p>
- *
- * @author <a href="Jeff.Suttor@Sun.com">Jeff Suttor</a>
- */
-public class DOMResult implements Result {
-
- /** <p>If {@link javax.xml.transform.TransformerFactory#getFeature}
- * returns <code>true</code> when passed this value as an argument,
- * the <code>Transformer</code> supports <code>Result</code> output of this type.</p>
- */
- public static final String FEATURE = "http://javax.xml.transform.dom.DOMResult/feature";
-
- /**
- * <p>Zero-argument default constructor.</p>
- *
- * <p><code>node</code>,
- * <code>siblingNode</code> and
- * <code>systemId</code>
- * will be set to <code>null</code>.</p>
- */
- public DOMResult() {
- setNode(null);
- setNextSibling(null);
- setSystemId(null);
- }
-
- /**
- * <p>Use a DOM node to create a new output target.</p>
- *
- * <p>In practice, the node should be
- * a {@link org.w3c.dom.Document} node,
- * a {@link org.w3c.dom.DocumentFragment} node, or
- * a {@link org.w3c.dom.Element} node.
- * In other words, a node that accepts children.</p>
- *
- * <p><code>siblingNode</code> and
- * <code>systemId</code>
- * will be set to <code>null</code>.</p>
- *
- * @param node The DOM node that will contain the result tree.
- */
- public DOMResult(Node node) {
- setNode(node);
- setNextSibling(null);
- setSystemId(null);
- }
-
- /**
- * <p>Use a DOM node to create a new output target with the specified System ID.<p>
- *
- * <p>In practice, the node should be
- * a {@link org.w3c.dom.Document} node,
- * a {@link org.w3c.dom.DocumentFragment} node, or
- * a {@link org.w3c.dom.Element} node.
- * In other words, a node that accepts children.</p>
- *
- * <p><code>siblingNode</code> will be set to <code>null</code>.</p>
- *
- * @param node The DOM node that will contain the result tree.
- * @param systemId The system identifier which may be used in association with this node.
- */
- public DOMResult(Node node, String systemId) {
- setNode(node);
- setNextSibling(null);
- setSystemId(systemId);
- }
-
- /**
- * <p>Use a DOM node to create a new output target specifying the child node where the result nodes should be inserted before.</p>
- *
- * <p>In practice, <code>node</code> and <code>nextSibling</code> should be
- * a {@link org.w3c.dom.Document} node,
- * a {@link org.w3c.dom.DocumentFragment} node, or
- * a {@link org.w3c.dom.Element} node.
- * In other words, a node that accepts children.</p>
- *
- * <p>Use <code>nextSibling</code> to specify the child node
- * where the result nodes should be inserted before.
- * If <code>nextSibling</code> is not a sibling of <code>node</code>,
- * then an <code>IllegalArgumentException</code> is thrown.
- * If <code>node</code> is <code>null</code> and <code>nextSibling</code> is not <code>null</code>,
- * then an <code>IllegalArgumentException</code> is thrown.
- * If <code>nextSibling</code> is <code>null</code>,
- * then the behavior is the same as calling {@link #DOMResult(Node node)},
- * i.e. append the result nodes as the last child of the specified <code>node</code>.</p>
- *
- * <p><code>systemId</code> will be set to <code>null</code>.</p>
- *
- * @param node The DOM node that will contain the result tree.
- * @param nextSibling The child node where the result nodes should be inserted before.
- *
- * @throws IllegalArgumentException If <code>nextSibling</code> is not a sibling of <code>node</code> or
- * <code>node</code> is <code>null</code> and <code>nextSibling</code>
- * is not <code>null</code>.
- *
- * @since 1.5
- */
- public DOMResult(Node node, Node nextSibling) {
-
- // does the corrent parent/child relationship exist?
- if (nextSibling != null) {
- // cannot be a sibling of a null node
- if (node == null) {
- throw new IllegalArgumentException("Cannot create a DOMResult when the nextSibling is contained by the \"null\" node.");
- }
-
- // nextSibling contained by node?
- if ((node.compareDocumentPosition(nextSibling)&Node.DOCUMENT_POSITION_CONTAINED_BY)==0) {
- throw new IllegalArgumentException("Cannot create a DOMResult when the nextSibling is not contained by the node.");
- }
- }
-
- setNode(node);
- setNextSibling(nextSibling);
- setSystemId(null);
- }
-
- /**
- * <p>Use a DOM node to create a new output target specifying the child node where the result nodes should be inserted before and
- * the specified System ID.</p>
- *
- * <p>In practice, <code>node</code> and <code>nextSibling</code> should be
- * a {@link org.w3c.dom.Document} node,
- * a {@link org.w3c.dom.DocumentFragment} node, or a
- * {@link org.w3c.dom.Element} node.
- * In other words, a node that accepts children.</p>
- *
- * <p>Use <code>nextSibling</code> to specify the child node
- * where the result nodes should be inserted before.
- * If <code>nextSibling</code> is not a sibling of <code>node</code>,
- * then an <code>IllegalArgumentException</code> is thrown.
- * If <code>node</code> is <code>null</code> and <code>nextSibling</code> is not <code>null</code>,
- * then an <code>IllegalArgumentException</code> is thrown.
- * If <code>nextSibling</code> is <code>null</code>,
- * then the behavior is the same as calling {@link #DOMResult(Node node, String systemId)},
- * i.e. append the result nodes as the last child of the specified node and use the specified System ID.</p>
- *
- * @param node The DOM node that will contain the result tree.
- * @param nextSibling The child node where the result nodes should be inserted before.
- * @param systemId The system identifier which may be used in association with this node.
- *
- * @throws IllegalArgumentException If <code>nextSibling</code> is not a
- * sibling of <code>node</code> or
- * <code>node</code> is <code>null</code> and <code>nextSibling</code>
- * is not <code>null</code>.
- *
- * @since 1.5
- */
- public DOMResult(Node node, Node nextSibling, String systemId) {
-
- // does the corrent parent/child relationship exist?
- if (nextSibling != null) {
- // cannot be a sibling of a null node
- if (node == null) {
- throw new IllegalArgumentException("Cannot create a DOMResult when the nextSibling is contained by the \"null\" node.");
- }
-
- // nextSibling contained by node?
- if ((node.compareDocumentPosition(nextSibling)&Node.DOCUMENT_POSITION_CONTAINED_BY)==0) {
- throw new IllegalArgumentException("Cannot create a DOMResult when the nextSibling is not contained by the node.");
- }
- }
-
- setNode(node);
- setNextSibling(nextSibling);
- setSystemId(systemId);
- }
-
- /**
- * <p>Set the node that will contain the result DOM tree.<p>
- *
- * <p>In practice, the node should be
- * a {@link org.w3c.dom.Document} node,
- * a {@link org.w3c.dom.DocumentFragment} node, or
- * a {@link org.w3c.dom.Element} node.
- * In other words, a node that accepts children.</p>
- *
- * <p>An <code>IllegalStateException</code> is thrown if
- * <code>nextSibling</code> is not <code>null</code> and
- * <code>node</code> is not a parent of <code>nextSibling</code>.
- * An <code>IllegalStateException</code> is thrown if <code>node</code> is <code>null</code> and
- * <code>nextSibling</code> is not <code>null</code>.</p>
- *
- * @param node The node to which the transformation will be appended.
- *
- * @throws IllegalStateException If <code>nextSibling</code> is not
- * <code>null</code> and
- * <code>nextSibling</code> is not a child of <code>node</code> or
- * <code>node</code> is <code>null</code> and
- * <code>nextSibling</code> is not <code>null</code>.
- */
- public void setNode(Node node) {
- // does the corrent parent/child relationship exist?
- if (nextSibling != null) {
- // cannot be a sibling of a null node
- if (node == null) {
- throw new IllegalStateException("Cannot create a DOMResult when the nextSibling is contained by the \"null\" node.");
- }
-
- // nextSibling contained by node?
- if ((node.compareDocumentPosition(nextSibling)&Node.DOCUMENT_POSITION_CONTAINED_BY)==0) {
- throw new IllegalArgumentException("Cannot create a DOMResult when the nextSibling is not contained by the node.");
- }
- }
-
- this.node = node;
- }
-
- /**
- * <p>Get the node that will contain the result DOM tree.</p>
- *
- * <p>If no node was set via
- * {@link #DOMResult(Node node)},
- * {@link #DOMResult(Node node, String systeId)},
- * {@link #DOMResult(Node node, Node nextSibling)},
- * {@link #DOMResult(Node node, Node nextSibling, String systemId)} or
- * {@link #setNode(Node node)},
- * then the node will be set by the transformation, and may be obtained from this method once the transformation is complete.
- * Calling this method before the transformation will return <code>null</code>.</p>
- *
- * @return The node to which the transformation will be appended.
- */
- public Node getNode() {
- return node;
- }
-
- /**
- * <p>Set the child node before which the result nodes will be inserted.</p>
- *
- * <p>Use <code>nextSibling</code> to specify the child node
- * before which the result nodes should be inserted.
- * If <code>nextSibling</code> is not a descendant of <code>node</code>,
- * then an <code>IllegalArgumentException</code> is thrown.
- * If <code>node</code> is <code>null</code> and <code>nextSibling</code> is not <code>null</code>,
- * then an <code>IllegalStateException</code> is thrown.
- * If <code>nextSibling</code> is <code>null</code>,
- * then the behavior is the same as calling {@link #DOMResult(Node node)},
- * i.e. append the result nodes as the last child of the specified <code>node</code>.</p>
- *
- * @param nextSibling The child node before which the result nodes will be inserted.
- *
- * @throws IllegalArgumentException If <code>nextSibling</code> is not a
- * descendant of <code>node</code>.
- * @throws IllegalStateException If <code>node</code> is <code>null</code>
- * and <code>nextSibling</code> is not <code>null</code>.
- *
- * @since 1.5
- */
- public void setNextSibling(Node nextSibling) {
-
- // does the corrent parent/child relationship exist?
- if (nextSibling != null) {
- // cannot be a sibling of a null node
- if (node == null) {
- throw new IllegalStateException("Cannot create a DOMResult when the nextSibling is contained by the \"null\" node.");
- }
-
- // nextSibling contained by node?
- if ((node.compareDocumentPosition(nextSibling)&Node.DOCUMENT_POSITION_CONTAINED_BY)==0) {
- throw new IllegalArgumentException("Cannot create a DOMResult when the nextSibling is not contained by the node.");
- }
- }
-
- this.nextSibling = nextSibling;
- }
-
- /**
- * <p>Get the child node before which the result nodes will be inserted.</p>
- *
- * <p>If no node was set via
- * {@link #DOMResult(Node node, Node nextSibling)},
- * {@link #DOMResult(Node node, Node nextSibling, String systemId)} or
- * {@link #setNextSibling(Node nextSibling)},
- * then <code>null</code> will be returned.</p>
- *
- * @return The child node before which the result nodes will be inserted.
- *
- * @since 1.5
- */
- public Node getNextSibling() {
- return nextSibling;
- }
-
- /**
- * <p>Set the systemId that may be used in association with the node.</p>
- *
- * @param systemId The system identifier as a URI string.
- */
- public void setSystemId(String systemId) {
- this.systemId = systemId;
- }
-
- /**
- * <p>Get the System Identifier.</p>
- *
- * <p>If no System ID was set via
- * {@link #DOMResult(Node node, String systemId)},
- * {@link #DOMResult(Node node, Node nextSibling, String systemId)} or
- * {@link #setSystemId(String systemId)},
- * then <code>null</code> will be returned.</p>
- *
- * @return The system identifier.
- */
- public String getSystemId() {
- return systemId;
- }
-
- //////////////////////////////////////////////////////////////////////
- // Internal state.
- //////////////////////////////////////////////////////////////////////
-
- /**
- * <p>The node to which the transformation will be appended.</p>
- */
- private Node node = null;
-
- /**
- * <p>The child node before which the result nodes will be inserted.</p>
- *
- * @since 1.5
- */
- private Node nextSibling = null;
-
- /**
- * <p>The System ID that may be used in association with the node.</p>
- */
- private String systemId = null;
-}
diff --git a/src/javax/xml/transform/dom/DOMSource.java b/src/javax/xml/transform/dom/DOMSource.java
deleted file mode 100644
index 83e64fd..0000000
--- a/src/javax/xml/transform/dom/DOMSource.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.transform.dom;
-
-import javax.xml.transform.Source;
-
-import org.w3c.dom.Node;
-
-/**
- * <p>Acts as a holder for a transformation Source tree in the
- * form of a Document Object Model (DOM) tree.</p>
- *
- * <p>Note that XSLT requires namespace support. Attempting to transform a DOM
- * that was not contructed with a namespace-aware parser may result in errors.
- * Parsers can be made namespace aware by calling
- * {@link javax.xml.parsers.DocumentBuilderFactory#setNamespaceAware(boolean awareness)}.</p>
- *
- * @author <a href="Jeff.Suttor@Sun.com">Jeff Suttor</a>
- * @see <a href="http://www.w3.org/TR/DOM-Level-2">Document Object Model (DOM) Level 2 Specification</a>
- */
-public class DOMSource implements Source {
-
- /**
- * <p><code>Node</code> to serve as DOM source.</p>
- */
- private Node node;
-
- /**
- * <p>The base ID (URL or system ID) from where URLs
- * will be resolved.</p>
- */
- private String systemID;
-
- /** If {@link javax.xml.transform.TransformerFactory#getFeature}
- * returns true when passed this value as an argument,
- * the Transformer supports Source input of this type.
- */
- public static final String FEATURE =
- "http://javax.xml.transform.dom.DOMSource/feature";
-
- /**
- * <p>Zero-argument default constructor. If this constructor is used, and
- * no DOM source is set using {@link #setNode(Node node)} , then the
- * <code>Transformer</code> will
- * create an empty source {@link org.w3c.dom.Document} using
- * {@link javax.xml.parsers.DocumentBuilder#newDocument()}.</p>
- *
- * @see javax.xml.transform.Transformer#transform(Source xmlSource, Result outputTarget)
- */
- public DOMSource() { }
-
- /**
- * Create a new input source with a DOM node. The operation
- * will be applied to the subtree rooted at this node. In XSLT,
- * a "/" pattern still means the root of the tree (not the subtree),
- * and the evaluation of global variables and parameters is done
- * from the root node also.
- *
- * @param n The DOM node that will contain the Source tree.
- */
- public DOMSource(Node n) {
- setNode(n);
- }
-
- /**
- * Create a new input source with a DOM node, and with the
- * system ID also passed in as the base URI.
- *
- * @param node The DOM node that will contain the Source tree.
- * @param systemID Specifies the base URI associated with node.
- */
- public DOMSource(Node node, String systemID) {
- setNode(node);
- setSystemId(systemID);
- }
-
- /**
- * Set the node that will represents a Source DOM tree.
- *
- * @param node The node that is to be transformed.
- */
- public void setNode(Node node) {
- this.node = node;
- }
-
- /**
- * Get the node that represents a Source DOM tree.
- *
- * @return The node that is to be transformed.
- */
- public Node getNode() {
- return node;
- }
-
- /**
- * Set the base ID (URL or system ID) from where URLs
- * will be resolved.
- *
- * @param systemID Base URL for this DOM tree.
- */
- public void setSystemId(String systemID) {
- this.systemID = systemID;
- }
-
- /**
- * Get the base ID (URL or system ID) from where URLs
- * will be resolved.
- *
- * @return Base URL for this DOM tree.
- */
- public String getSystemId() {
- return this.systemID;
- }
-}
diff --git a/src/javax/xml/transform/dom/package.html b/src/javax/xml/transform/dom/package.html
deleted file mode 100644
index 09cb812..0000000
--- a/src/javax/xml/transform/dom/package.html
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation. Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-
-<!DOCTYPE html
- PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml">
-
-<head>
- <title>javax.xml.transform.dom</title>
-
- <meta name="CVS"
- content="$Id: package.html,v 1.2 2005/06/10 03:50:40 jeffsuttor Exp $" />
- <meta name="AUTHOR"
- content="Jeff.Suttor@Sun.com" />
-</head>
-<body>
-<p>This package implements DOM-specific transformation APIs.</p>
-<p>The {@link javax.xml.transform.dom.DOMSource} class allows the
-client of the implementation of this API to specify a DOM
-{@link org.w3c.dom.Node} as the source of the input tree. The model of
-how the Transformer deals with the DOM tree in terms of mismatches with the
-<A href="http://www.w3.org/TR/xslt#data-model">XSLT data model</A> or
-other data models is beyond the scope of this document. Any of the nodes
-derived from {@link org.w3c.dom.Node} are legal input.</p>
-<p>The {@link javax.xml.transform.dom.DOMResult} class allows
-a {@link org.w3c.dom.Node} to be specified to which result DOM nodes will
-be appended. If an output node is not specified, the transformer will use
-{@link javax.xml.parsers.DocumentBuilder#newDocument} to create an
-output {@link org.w3c.dom.Document} node. If a node is specified, it
-should be one of the following: {@link org.w3c.dom.Document},
-{@link org.w3c.dom.Element}, or
-{@link org.w3c.dom.DocumentFragment}. Specification of any other node
-type is implementation dependent and undefined by this API. If the result is a
-{@link org.w3c.dom.Document}, the output of the transformation must have
-a single element root to set as the document element.</p>
-<p>The {@link javax.xml.transform.dom.DOMLocator} node may be passed
-to {@link javax.xml.transform.TransformerException} objects, and
-retrieved by trying to cast the result of the
-{@link javax.xml.transform.TransformerException#getLocator()} method.
-The implementation has no responsibility to use a DOMLocator instead of a
-{@link javax.xml.transform.SourceLocator} (though line numbers and the
-like do not make much sense for a DOM), so the result of getLocator must always
-be tested with an instanceof. </p>
-</body>
-</html>
diff --git a/src/javax/xml/transform/overview.html b/src/javax/xml/transform/overview.html
deleted file mode 100644
index 1ad906a..0000000
--- a/src/javax/xml/transform/overview.html
+++ /dev/null
@@ -1,291 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation. Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-
-<!DOCTYPE html
- PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml">
-
-<head>
- <title>Transformation API For XML</title>
-
- <meta name="CVS"
- content="$Id: overview.html,v 1.2 2005/06/10 03:50:39 jeffsuttor Exp $" />
- <meta name="AUTHOR"
- content="Jeff.Suttor@Sun.com" />
-</head>
-<body>
-
-<h2>Transformation API For XML</h2>
-
-
-<h3>Introduction</h3>
-
-<p>This overview describes the set of APIs contained in
- javax.xml.transform. For the sake of brevity, these interfaces are referred to
- as TrAX (Transformations for XML). </p>
-
-<p>There is a broad need for Java applications to be able to transform XML
- and related tree-shaped data structures. In fact, XML is not normally very
- useful to an application without going through some sort of transformation,
- unless the semantic structure is used directly as data. Almost all XML-related
- applications need to perform transformations. Transformations may be described
- by Java code, Perl code, <A href="http://www.w3.org/TR/xslt">XSLT</A>
- Stylesheets, other types of script, or by proprietary formats. The inputs, one
- or multiple, to a transformation, may be a URL, XML stream, a DOM tree, SAX
- Events, or a proprietary format or data structure. The output types are the
- pretty much the same types as the inputs, but different inputs may need to be
- combined with different outputs.</p>
-
-<p>The great challenge of a transformation API is how to deal with all the
- possible combinations of inputs and outputs, without becoming specialized for
- any of the given types.</p>
-
-<p>The Java community will greatly benefit from a common API that will
- allow them to understand and apply a single model, write to consistent
- interfaces, and apply the transformations polymorphically. TrAX attempts to
- define a model that is clean and generic, yet fills general application
- requirements across a wide variety of uses. </p>
-
-
-<h3>General Terminology</h3>
-
-<p>This section will explain some general terminology used in this
- document. Technical terminology will be explained in the Model section. In many
- cases, the general terminology overlaps with the technical terminology.</p>
-
-<ul>
-<li>
-<p>
-<b>Tree</b>
-<br>This term, as used within this document, describes an
- abstract structure that consists of nodes or events that may be produced by
- XML. A Tree physically may be a DOM tree, a series of well balanced parse
- events (such as those coming from a SAX2 ContentHander), a series of requests
- (the result of which can describe a tree), or a stream of marked-up
- characters.</p>
-</li>
-<li>
-<p>
-<b>Source Tree(s)</b>
-<br>One or more trees that are the inputs to the
- transformation.</p>
-</li>
-<li>
-<p>
-<b>Result Tree(s)</b>
-<br>One or more trees that are the output of the
- transformation.</p>
-</li>
-<li>
-<p>
-<b>Transformation</b>
-<br>The processor of consuming a stream or tree to produce
- another stream or tree.</p>
-</li>
-<li>
-<p>
-<b>Identity (or Copy) Transformation</b>
-<br>The process of transformation from a source to a result,
- making as few structural changes as possible and no informational changes. The
- term is somewhat loosely used, as the process is really a copy. from one
- "format" (such as a DOM tree, stream, or set of SAX events) to
- another.</p>
-</li>
-<li>
-<p>
-<b>Serialization</b>
-<br>The process of taking a tree and turning it into a stream. In
- some sense, a serialization is a specialized transformation.</p>
-</li>
-<li>
-<p>
-<b>Parsing</b>
-<br>The process of taking a stream and turning it into a tree. In
- some sense, parsing is a specialized transformation.</p>
-</li>
-<li>
-<p>
-<b>Transformer</b>
-<br>A Transformer is the object that executes the transformation.
- </p>
-</li>
-<li>
-<p>
-<b>Transformation instructions</b>
-<br>Describes the transformation. A form of code, script, or
- simply a declaration or series of declarations.</p>
-</li>
-<li>
-<p>
-<b>Stylesheet</b>
-<br>The same as "transformation instructions," except it is
- likely to be used in conjunction with <A href="http://www.w3.org/TR/xslt">XSLT</A>.</p>
-</li>
-<li>
-<p>
-<b>Templates</b>
-<br>Another form of "transformation instructions." In the TrAX
- interface, this term is used to describe processed or compiled transformation
- instructions. The Source flows through a Templates object to be formed into the
- Result.</p>
-</li>
-<li>
-<p>
-<b>Processor</b>
-<br>A general term for the thing that may both process the
- transformation instructions, and perform the transformation.</p>
-</li>
-<li>
-<p>
-<b>DOM</b>
-<br>Document Object Model, specifically referring to the
- <A href="#http://www.w3.org/TR/DOM-Level-2%20">Document Object Model
- (DOM) Level 2 Specification</A>.</p>
-</li>
-<li>
- <p>
- <b>SAX</b><br>
- Simple API for XML, specifically referring to the <a href="http://sax.sourceforge.net/">SAX 2.0.2 release</a>.
- </p>
-</li>
-</ul>
-
-
-
-<h3>Model</h3>
-
-<p>The section defines the abstract model for TrAX, apart from the details
- of the interfaces.</p>
-
-<p>A TRaX <A href="#pattern-TransformerFactory">TransformerFactory</A> is an object
- that processes transformation instructions, and produces
- <A href="#pattern-Templates">Templates</A> (in the technical
- terminology). A <A href="#pattern-Templates">Templates</A>
- object provides a <A href="#pattern-Transformer">Transformer</A>, which transforms one or
- more <A href="#pattern-Source">Source</A>s into one or more
- <A href="#pattern-Result">Result</A>s.</p>
-
-<p>To use the TRaX interface, you create a
- <A href="#pattern-TransformerFactory">TransformerFactory</A>,
- which may directly provide a <A href="#pattern-Transformers">Transformers</A>, or which can provide
- <A href="#pattern-Templates">Templates</A> from a variety of
- <A href="#pattern-Source">Source</A>s. The
- <A href="#pattern-Templates">Templates</A> object is a processed
- or compiled representation of the transformation instructions, and provides a
- <A href="#pattern-Transformer">Transformer</A>. The
- <A href="#pattern-Transformer">Transformer</A> processes a
- <A href="#pattern-Transformer">Source</A> according to the
- instructions found in the <A href="#pattern-Templates">Templates</A>, and produces a
- <A href="#pattern-Result">Result</A>.</p>
-
-<p>The process of transformation from a tree, either in the form of an
- object model, or in the form of parse events, into a stream, is known as
- <code>serialization</code>. We believe this is the most suitable term for
- this process, despite the overlap with Java object serialization.</p>
-
-<H3>TRaX Patterns</H3>
-<ul>
-<p>
-<b><a name="pattern-Processor">Processor</a></b>
-<br>
-<br>
-<i>Intent: </i>Generic concept for the
- set of objects that implement the TrAX interfaces.<br>
-<i>Responsibilities: </i>Create compiled transformation instructions, transform
- sources, and manage transformation parameters and
- properties.<br>
-<i>Thread safety: </i>Only the Templates object can be
- used concurrently in multiple threads. The rest of the processor does not do
- synchronized blocking, and so may not be used to perform multiple concurrent
- operations. Different Processors can be used concurrently by different
- threads.</p>
-<p>
-<b><a name="pattern-TransformerFactory">TransformerFactory</a></b>
-<br>
-<br>
-<i>Intent: </i>Serve as a vendor-neutral Processor interface for
- <A href="http://www.w3.org/TR/xslt">XSLT</A> and similar
- processors.<br>
-<i>Responsibilities: </i>Serve as a factory for a concrete
- implementation of an TransformerFactory, serve as a direct factory for
- Transformer objects, serve as a factory for Templates objects, and manage
- processor specific features.<br>
-<i>Thread safety: </i>A
- TransformerFactory may not perform mulitple concurrent
- operations.</p>
-<p>
-<b><a name="pattern-Templates">Templates</a></b>
-<br>
-<br>
-<i>Intent: </i>The
- runtime representation of the transformation instructions.<br>
-<i>Responsibilities: </i>A data bag for transformation instructions; act as a factory
- for Transformers.<br>
-<i>Thread safety: </i>Threadsafe for concurrent
- usage over multiple threads once construction is complete.</p>
-<p>
-<b><a name="pattern-Transformer">Transformer</a></b>
-<br>
-<br>
-<i>Intent: </i>Act as a per-thread
- execution context for transformations, act as an interface for performing the
- transformation.<br>
-<i>Responsibilities: </i>Perform the
- transformation.<br>
-<i>Thread safety: </i>Only one instance per thread
- is safe.<br>
-<i>Notes: </i>The Transformer is bound to the Templates
- object that created it.</p>
-<p>
-<b><a name="pattern-Source">Source</a></b>
-<br>
-<br>
-<i>Intent: </i>Serve as a
- single vendor-neutral object for multiple types of input.<br>
-<i>Responsibilities: </i>Act as simple data holder for System IDs, DOM nodes, streams,
- etc.<br>
-<i>Thread safety: </i>Threadsafe concurrently over multiple
- threads for read-only operations; must be synchronized for edit
- operations.</p>
-<p>
-<b><a name="pattern-Result">Result</a></b>
-<br>
-<br>
-<i>Potential alternate name: </i>ResultTarget<br>
-<i>Intent: </i>Serve
- as a single object for multiple types of output, so there can be simple process
- method signatures.<br>
-<i>Responsibilities: </i>Act as simple data holder for
- output stream, DOM node, ContentHandler, etc.<br>
-<i>Thread safety: </i>Threadsafe concurrently over multiple threads for read-only,
- must be synchronized for edit.</p>
-</ul>
-
-
-</body>
-</html>
diff --git a/src/javax/xml/transform/package.html b/src/javax/xml/transform/package.html
deleted file mode 100644
index 45c2d78..0000000
--- a/src/javax/xml/transform/package.html
+++ /dev/null
@@ -1,233 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation. Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-
-<!DOCTYPE html
- PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml">
-
-<head>
- <title>javax.xml.transform</title>
-
- <meta name="CVS"
- content="$Id: package.html,v 1.2 2005/06/10 03:50:39 jeffsuttor Exp $" />
- <meta name="AUTHOR"
- content="Jeff.Suttor@Sun.com" />
-</head>
-
-<body>
-<p>This package defines the generic APIs for processing transformation
-instructions, and performing a transformation from source to result. These
-interfaces have no dependencies on SAX or the DOM standard, and try to make as
-few assumptions as possible about the details of the source and result of a
-transformation. It achieves this by defining
-{@link javax.xml.transform.Source} and
-{@link javax.xml.transform.Result} interfaces.
-</p>
-
-<p>To define concrete classes for the user, the API defines specializations
-of the interfaces found at the root level. These interfaces are found in
-{@link javax.xml.transform.sax}, {@link javax.xml.transform.dom},
-and {@link javax.xml.transform.stream}.
-</p>
-
-
-<h3>Creating Objects</h3>
-
-<p>The API allows a concrete
-{@link javax.xml.transform.TransformerFactory} object to be created from
-the static function
-{@link javax.xml.transform.TransformerFactory#newInstance}.
-</p>
-
-
-<h3>Specification of Inputs and Outputs</h3>
-
-<p>This API defines two interface objects called
-{@link javax.xml.transform.Source} and
-{@link javax.xml.transform.Result}. In order to pass Source and Result
-objects to the interfaces, concrete classes must be used.
-Three concrete representations are defined for each of these
-objects:
-{@link javax.xml.transform.stream.StreamSource} and
-{@link javax.xml.transform.stream.StreamResult},
-{@link javax.xml.transform.sax.SAXSource} and
-{@link javax.xml.transform.sax.SAXResult}, and
-{@link javax.xml.transform.dom.DOMSource} and
-{@link javax.xml.transform.dom.DOMResult}. Each of these objects defines
-a FEATURE string (which is i the form of a URL), which can be passed into
-{@link javax.xml.transform.TransformerFactory#getFeature} to see if the
-given type of Source or Result object is supported. For instance, to test if a
-DOMSource and a StreamResult is supported, you can apply the following
-test.
-</p>
-
-<pre>
-<code>
-TransformerFactory tfactory = TransformerFactory.newInstance();
-if (tfactory.getFeature(DOMSource.FEATURE) &amp;&amp; tfactory.getFeature(StreamResult.FEATURE)) {
-...
-}
-</code>
-</pre>
-
-
-<h3>
-<a name="qname-delimiter">Qualified Name Representation</a>
-</h3>
-
-<p><a href="http://www.w3.org/TR/REC-xml-names">Namespaces</a>
-present something of a problem area when dealing with XML objects. Qualified
-Names appear in XML markup as prefixed names. But the prefixes themselves do
-not hold identity. Rather, it is the URIs that they contextually map to that
-hold the identity. Therefore, when passing a Qualified Name like "xyz:foo"
-among Java programs, one must provide a means to map "xyz" to a namespace.
-</p>
-
-<p>One solution has been to create a "QName" object that holds the
-namespace URI, as well as the prefix and local name, but this is not always an
-optimal solution, as when, for example, you want to use unique strings as keys
-in a dictionary object. Not having a string representation also makes it
-difficult to specify a namespaced identity outside the context of an XML
-document.
-</p>
-
-<p>In order to pass namespaced values to transformations,
-for
-instance when setting a property or a parameter on a
-{@link javax.xml.transform.Transformer} object,
-this specification defines that a
-String "qname" object parameter be passed as two-part string, the namespace URI
-enclosed in curly braces ({}), followed by the local name. If the qname has a
-null URI, then the String object only contains the local name. An application
-can safely check for a non-null URI by testing to see if the first character of
-the name is a '{' character.
-</p>
-
-<p>For example, if a URI and local name were obtained from an element
-defined with &lt;xyz:foo xmlns:xyz="http://xyz.foo.com/yada/baz.html"/&gt;,
-then the Qualified Name would be "{http://xyz.foo.com/yada/baz.html}foo".
-Note that the prefix is lost.
-</p>
-
-
-<h3>Result Tree Serialization</h3>
-
-<p>Serialization of the result tree to a stream can be controlled with
-the {@link javax.xml.transform.Transformer#setOutputProperties} and the
-{@link javax.xml.transform.Transformer#setOutputProperty} methods.
-These properties only apply to stream results, they have no effect when
-the result is a DOM tree or SAX event stream.</p>
-
-<p>Strings that match the <a href="http://www.w3.org/TR/xslt#output">XSLT
-specification for xsl:output attributes</a> can be referenced from the
-{@link javax.xml.transform.OutputKeys} class. Other strings can be
-specified as well.
-If the transformer does not recognize an output key, a
-{@link java.lang.IllegalArgumentException} is thrown, unless the
-key name is <a href="#qname-delimiter">namespace qualified</a>. Output key names
-that are namespace qualified are always allowed, although they may be
-ignored by some implementations.</p>
-
-<p>If all that is desired is the simple identity transformation of a
-source to a result, then {@link javax.xml.transform.TransformerFactory}
-provides a
-{@link javax.xml.transform.TransformerFactory#newTransformer()} method
-with no arguments. This method creates a Transformer that effectively copies
-the source to the result. This method may be used to create a DOM from SAX
-events or to create an XML or HTML stream from a DOM or SAX events. </p>
-
-<h3>Exceptions and Error Reporting</h3>
-
-<p>The transformation API throw three types of specialized exceptions. A
-{@link javax.xml.transform.TransformerFactoryConfigurationError} is parallel to
-the {@link javax.xml.parsers.FactoryConfigurationError}, and is thrown
-when a configuration problem with the TransformerFactory exists. This error
-will typically be thrown when the transformation factory class specified with
-the "javax.xml.transform.TransformerFactory" system property cannot be found or
-instantiated.</p>
-
-<p>A {@link javax.xml.transform.TransformerConfigurationException}
-may be thrown if for any reason a Transformer can not be created. A
-TransformerConfigurationException may be thrown if there is a syntax error in
-the transformation instructions, for example when
-{@link javax.xml.transform.TransformerFactory#newTransformer} is
-called.</p>
-
-<p>{@link javax.xml.transform.TransformerException} is a general
-exception that occurs during the course of a transformation. A transformer
-exception may wrap another exception, and if any of the
-{@link javax.xml.transform.TransformerException#printStackTrace()}
-methods are called on it, it will produce a list of stack dumps, starting from
-the most recent. The transformer exception also provides a
-{@link javax.xml.transform.SourceLocator} object which indicates where
-in the source tree or transformation instructions the error occurred.
-{@link javax.xml.transform.TransformerException#getMessageAndLocation()}
-may be called to get an error message with location info, and
-{@link javax.xml.transform.TransformerException#getLocationAsString()}
-may be called to get just the location string.</p>
-
-<p>Transformation warnings and errors are sent to an
-{@link javax.xml.transform.ErrorListener}, at which point the
-application may decide to report the error or warning, and may decide to throw
-an <code>Exception</code> for a non-fatal error. The <code>ErrorListener</code> may be set via
-{@link javax.xml.transform.TransformerFactory#setErrorListener} for
-reporting errors that have to do with syntax errors in the transformation
-instructions, or via
-{@link javax.xml.transform.Transformer#setErrorListener} to report
-errors that occur during the transformation. The <code>ErrorListener</code> on both objects
-will always be valid and non-<code>null</code>, whether set by the application or a default
-implementation provided by the processor.
-The default implementation provided by the processor will report all warnings and errors to <code>System.err</code>
-and does not throw any <code>Exception</code>s.
-Applications are <em>strongly</em> encouraged to register and use
-<code>ErrorListener</code>s that insure proper behavior for warnings and
-errors.
-</p>
-
-
-<h3>Resolution of URIs within a transformation</h3>
-
-<p>The API provides a way for URIs referenced from within the stylesheet
-instructions or within the transformation to be resolved by the calling
-application. This can be done by creating a class that implements the
-{@link javax.xml.transform.URIResolver} interface, with its one method,
-{@link javax.xml.transform.URIResolver#resolve}, and use this class to
-set the URI resolution for the transformation instructions or transformation
-with {@link javax.xml.transform.TransformerFactory#setURIResolver} or
-{@link javax.xml.transform.Transformer#setURIResolver}. The
-<code>URIResolver.resolve</code> method takes two String arguments, the URI found in the
-stylesheet instructions or built as part of the transformation process, and the
-base URI
-against which the first argument will be made absolute if the
-absolute URI is required.
-The returned {@link javax.xml.transform.Source} object must be usable by
-the transformer, as specified in its implemented features.</p>
-
-
-</body>
-</html>
diff --git a/src/javax/xml/transform/sax/SAXResult.java b/src/javax/xml/transform/sax/SAXResult.java
deleted file mode 100644
index b0158b3..0000000
--- a/src/javax/xml/transform/sax/SAXResult.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.transform.sax;
-
-import javax.xml.transform.Result;
-
-import org.xml.sax.ContentHandler;
-import org.xml.sax.ext.LexicalHandler;
-
-/**
- * <p>Acts as an holder for a transformation Result.</p>
- *
- * @author <a href="Jeff.Suttor@Sun.com">Jeff Suttor</a>
- */
-public class SAXResult implements Result {
-
- /**
- * If {@link javax.xml.transform.TransformerFactory#getFeature}
- * returns true when passed this value as an argument,
- * the Transformer supports Result output of this type.
- */
- public static final String FEATURE =
- "http://javax.xml.transform.sax.SAXResult/feature";
-
- /**
- * Zero-argument default constructor.
- */
- public SAXResult() {
- }
-
- /**
- * Create a SAXResult that targets a SAX2 {@link org.xml.sax.ContentHandler}.
- *
- * @param handler Must be a non-null ContentHandler reference.
- */
- public SAXResult(ContentHandler handler) {
- setHandler(handler);
- }
-
- /**
- * Set the target to be a SAX2 {@link org.xml.sax.ContentHandler}.
- *
- * @param handler Must be a non-null ContentHandler reference.
- */
- public void setHandler(ContentHandler handler) {
- this.handler = handler;
- }
-
- /**
- * Get the {@link org.xml.sax.ContentHandler} that is the Result.
- *
- * @return The ContentHandler that is to be transformation output.
- */
- public ContentHandler getHandler() {
- return handler;
- }
-
- /**
- * Set the SAX2 {@link org.xml.sax.ext.LexicalHandler} for the output.
- *
- * <p>This is needed to handle XML comments and the like. If the
- * lexical handler is not set, an attempt should be made by the
- * transformer to cast the {@link org.xml.sax.ContentHandler} to a
- * <code>LexicalHandler</code>.</p>
- *
- * @param handler A non-null <code>LexicalHandler</code> for
- * handling lexical parse events.
- */
- public void setLexicalHandler(LexicalHandler handler) {
- this.lexhandler = handler;
- }
-
- /**
- * Get a SAX2 {@link org.xml.sax.ext.LexicalHandler} for the output.
- *
- * @return A <code>LexicalHandler</code>, or null.
- */
- public LexicalHandler getLexicalHandler() {
- return lexhandler;
- }
-
- /**
- * Method setSystemId Set the systemID that may be used in association
- * with the {@link org.xml.sax.ContentHandler}.
- *
- * @param systemId The system identifier as a URI string.
- */
- public void setSystemId(String systemId) {
- this.systemId = systemId;
- }
-
- /**
- * Get the system identifier that was set with setSystemId.
- *
- * @return The system identifier that was set with setSystemId, or null
- * if setSystemId was not called.
- */
- public String getSystemId() {
- return systemId;
- }
-
- //////////////////////////////////////////////////////////////////////
- // Internal state.
- //////////////////////////////////////////////////////////////////////
-
- /**
- * The handler for parse events.
- */
- private ContentHandler handler;
-
- /**
- * The handler for lexical events.
- */
- private LexicalHandler lexhandler;
-
- /**
- * The systemID that may be used in association
- * with the node.
- */
- private String systemId;
-}
diff --git a/src/javax/xml/transform/sax/SAXSource.java b/src/javax/xml/transform/sax/SAXSource.java
deleted file mode 100644
index 5231564..0000000
--- a/src/javax/xml/transform/sax/SAXSource.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.transform.sax;
-
-import javax.xml.transform.Source;
-import javax.xml.transform.stream.StreamSource;
-
-import org.xml.sax.InputSource;
-import org.xml.sax.XMLReader;
-
-/**
- * <p>Acts as an holder for SAX-style Source.</p>
- *
- * <p>Note that XSLT requires namespace support. Attempting to transform an
- * input source that is not
- * generated with a namespace-aware parser may result in errors.
- * Parsers can be made namespace aware by calling the
- * {@link javax.xml.parsers.SAXParserFactory#setNamespaceAware(boolean awareness)} method.</p>
- *
- * @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a>
- */
-public class SAXSource implements Source {
-
- /**
- * If {@link javax.xml.transform.TransformerFactory#getFeature}
- * returns true when passed this value as an argument,
- * the Transformer supports Source input of this type.
- */
- public static final String FEATURE =
- "http://javax.xml.transform.sax.SAXSource/feature";
-
- /**
- * <p>Zero-argument default constructor. If this constructor is used, and
- * no SAX source is set using
- * {@link #setInputSource(InputSource inputSource)} , then the
- * <code>Transformer</code> will
- * create an empty source {@link org.xml.sax.InputSource} using
- * {@link org.xml.sax.InputSource#InputSource() new InputSource()}.</p>
- *
- * @see javax.xml.transform.Transformer#transform(Source xmlSource, Result outputTarget)
- */
- public SAXSource() { }
-
- /**
- * Create a <code>SAXSource</code>, using an {@link org.xml.sax.XMLReader}
- * and a SAX InputSource. The {@link javax.xml.transform.Transformer}
- * or {@link javax.xml.transform.sax.SAXTransformerFactory} will set itself
- * to be the reader's {@link org.xml.sax.ContentHandler}, and then will call
- * reader.parse(inputSource).
- *
- * @param reader An XMLReader to be used for the parse.
- * @param inputSource A SAX input source reference that must be non-null
- * and that will be passed to the reader parse method.
- */
- public SAXSource(XMLReader reader, InputSource inputSource) {
- this.reader = reader;
- this.inputSource = inputSource;
- }
-
- /**
- * Create a <code>SAXSource</code>, using a SAX <code>InputSource</code>.
- * The {@link javax.xml.transform.Transformer} or
- * {@link javax.xml.transform.sax.SAXTransformerFactory} creates a
- * reader via {@link org.xml.sax.helpers.XMLReaderFactory}
- * (if setXMLReader is not used), sets itself as
- * the reader's {@link org.xml.sax.ContentHandler}, and calls
- * reader.parse(inputSource).
- *
- * @param inputSource An input source reference that must be non-null
- * and that will be passed to the parse method of the reader.
- */
- public SAXSource(InputSource inputSource) {
- this.inputSource = inputSource;
- }
-
- /**
- * Set the XMLReader to be used for the Source.
- *
- * @param reader A valid XMLReader or XMLFilter reference.
- */
- public void setXMLReader(XMLReader reader) {
- this.reader = reader;
- }
-
- /**
- * Get the XMLReader to be used for the Source.
- *
- * @return A valid XMLReader or XMLFilter reference, or null.
- */
- public XMLReader getXMLReader() {
- return reader;
- }
-
- /**
- * Set the SAX InputSource to be used for the Source.
- *
- * @param inputSource A valid InputSource reference.
- */
- public void setInputSource(InputSource inputSource) {
- this.inputSource = inputSource;
- }
-
- /**
- * Get the SAX InputSource to be used for the Source.
- *
- * @return A valid InputSource reference, or null.
- */
- public InputSource getInputSource() {
- return inputSource;
- }
-
- /**
- * Set the system identifier for this Source. If an input source
- * has already been set, it will set the system ID or that
- * input source, otherwise it will create a new input source.
- *
- * <p>The system identifier is optional if there is a byte stream
- * or a character stream, but it is still useful to provide one,
- * since the application can use it to resolve relative URIs
- * and can include it in error messages and warnings (the parser
- * will attempt to open a connection to the URI only if
- * no byte stream or character stream is specified).</p>
- *
- * @param systemId The system identifier as a URI string.
- */
- public void setSystemId(String systemId) {
-
- if (null == inputSource) {
- inputSource = new InputSource(systemId);
- } else {
- inputSource.setSystemId(systemId);
- }
- }
-
- /**
- * <p>Get the base ID (URI or system ID) from where URIs
- * will be resolved.</p>
- *
- * @return Base URL for the <code>Source</code>, or <code>null</code>.
- */
- public String getSystemId() {
-
- if (inputSource == null) {
- return null;
- } else {
- return inputSource.getSystemId();
- }
- }
-
- /**
- * The XMLReader to be used for the source tree input. May be null.
- */
- private XMLReader reader;
-
- /**
- * <p>The SAX InputSource to be used for the source tree input.
- * Should not be <code>null</code>.</p>
- */
- private InputSource inputSource;
-
- /**
- * Attempt to obtain a SAX InputSource object from a Source
- * object.
- *
- * @param source Must be a non-null Source reference.
- *
- * @return An InputSource, or null if Source can not be converted.
- */
- public static InputSource sourceToInputSource(Source source) {
-
- if (source instanceof SAXSource) {
- return ((SAXSource) source).getInputSource();
- } else if (source instanceof StreamSource) {
- StreamSource ss = (StreamSource) source;
- InputSource isource = new InputSource(ss.getSystemId());
-
- isource.setByteStream(ss.getInputStream());
- isource.setCharacterStream(ss.getReader());
- isource.setPublicId(ss.getPublicId());
-
- return isource;
- } else {
- return null;
- }
- }
-}
diff --git a/src/javax/xml/transform/sax/SAXTransformerFactory.java b/src/javax/xml/transform/sax/SAXTransformerFactory.java
deleted file mode 100644
index 777e0bf..0000000
--- a/src/javax/xml/transform/sax/SAXTransformerFactory.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.transform.sax;
-
-import javax.xml.transform.*;
-
-import org.xml.sax.XMLFilter;
-
-/**
- * This class extends TransformerFactory to provide SAX-specific
- * factory methods. It provides two types of ContentHandlers,
- * one for creating Transformers, the other for creating Templates
- * objects.
- *
- * <p>If an application wants to set the ErrorHandler or EntityResolver
- * for an XMLReader used during a transformation, it should use a URIResolver
- * to return the SAXSource which provides (with getXMLReader) a reference to
- * the XMLReader.</p>
- */
-public abstract class SAXTransformerFactory extends TransformerFactory {
-
- /** If {@link javax.xml.transform.TransformerFactory#getFeature}
- * returns true when passed this value as an argument,
- * the TransformerFactory returned from
- * {@link javax.xml.transform.TransformerFactory#newInstance} may
- * be safely cast to a SAXTransformerFactory.
- */
- public static final String FEATURE =
- "http://javax.xml.transform.sax.SAXTransformerFactory/feature";
-
- /** If {@link javax.xml.transform.TransformerFactory#getFeature}
- * returns true when passed this value as an argument,
- * the {@link #newXMLFilter(Source src)}
- * and {@link #newXMLFilter(Templates templates)} methods are supported.
- */
- public static final String FEATURE_XMLFILTER =
- "http://javax.xml.transform.sax.SAXTransformerFactory/feature/xmlfilter";
-
- /**
- * The default constructor is protected on purpose.
- */
- protected SAXTransformerFactory() {}
-
- /**
- * Get a TransformerHandler object that can process SAX
- * ContentHandler events into a Result, based on the transformation
- * instructions specified by the argument.
- *
- * @param src The Source of the transformation instructions.
- *
- * @return TransformerHandler ready to transform SAX events.
- *
- * @throws TransformerConfigurationException If for some reason the
- * TransformerHandler can not be created.
- */
- public abstract TransformerHandler newTransformerHandler(Source src)
- throws TransformerConfigurationException;
-
- /**
- * Get a TransformerHandler object that can process SAX
- * ContentHandler events into a Result, based on the Templates argument.
- *
- * @param templates The compiled transformation instructions.
- *
- * @return TransformerHandler ready to transform SAX events.
- *
- * @throws TransformerConfigurationException If for some reason the
- * TransformerHandler can not be created.
- */
- public abstract TransformerHandler newTransformerHandler(
- Templates templates) throws TransformerConfigurationException;
-
- /**
- * Get a TransformerHandler object that can process SAX
- * ContentHandler events into a Result. The transformation
- * is defined as an identity (or copy) transformation, for example
- * to copy a series of SAX parse events into a DOM tree.
- *
- * @return A non-null reference to a TransformerHandler, that may
- * be used as a ContentHandler for SAX parse events.
- *
- * @throws TransformerConfigurationException If for some reason the
- * TransformerHandler cannot be created.
- */
- public abstract TransformerHandler newTransformerHandler()
- throws TransformerConfigurationException;
-
- /**
- * Get a TemplatesHandler object that can process SAX
- * ContentHandler events into a Templates object.
- *
- * @return A non-null reference to a TransformerHandler, that may
- * be used as a ContentHandler for SAX parse events.
- *
- * @throws TransformerConfigurationException If for some reason the
- * TemplatesHandler cannot be created.
- */
- public abstract TemplatesHandler newTemplatesHandler()
- throws TransformerConfigurationException;
-
- /**
- * Create an XMLFilter that uses the given Source as the
- * transformation instructions.
- *
- * @param src The Source of the transformation instructions.
- *
- * @return An XMLFilter object, or null if this feature is not supported.
- *
- * @throws TransformerConfigurationException If for some reason the
- * TemplatesHandler cannot be created.
- */
- public abstract XMLFilter newXMLFilter(Source src)
- throws TransformerConfigurationException;
-
- /**
- * Create an XMLFilter, based on the Templates argument..
- *
- * @param templates The compiled transformation instructions.
- *
- * @return An XMLFilter object, or null if this feature is not supported.
- *
- * @throws TransformerConfigurationException If for some reason the
- * TemplatesHandler cannot be created.
- */
- public abstract XMLFilter newXMLFilter(Templates templates)
- throws TransformerConfigurationException;
-}
diff --git a/src/javax/xml/transform/sax/TemplatesHandler.java b/src/javax/xml/transform/sax/TemplatesHandler.java
deleted file mode 100644
index 34b5ba2..0000000
--- a/src/javax/xml/transform/sax/TemplatesHandler.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.transform.sax;
-
-import javax.xml.transform.*;
-
-import org.xml.sax.ContentHandler;
-
-/**
- * A SAX ContentHandler that may be used to process SAX
- * parse events (parsing transformation instructions) into a Templates object.
- *
- * <p>Note that TemplatesHandler does not need to implement LexicalHandler.</p>
- */
-public interface TemplatesHandler extends ContentHandler {
-
- /**
- * When a TemplatesHandler object is used as a ContentHandler
- * for the parsing of transformation instructions, it creates a Templates object,
- * which the caller can get once the SAX events have been completed.
- *
- * @return The Templates object that was created during
- * the SAX event process, or null if no Templates object has
- * been created.
- *
- */
- public Templates getTemplates();
-
- /**
- * Set the base ID (URI or system ID) for the Templates object
- * created by this builder. This must be set in order to
- * resolve relative URIs in the stylesheet. This must be
- * called before the startDocument event.
- *
- * @param systemID Base URI for this stylesheet.
- */
- public void setSystemId(String systemID);
-
- /**
- * Get the base ID (URI or system ID) from where relative
- * URLs will be resolved.
- * @return The systemID that was set with {@link #setSystemId}.
- */
- public String getSystemId();
-}
diff --git a/src/javax/xml/transform/sax/TransformerHandler.java b/src/javax/xml/transform/sax/TransformerHandler.java
deleted file mode 100644
index 8bced5e..0000000
--- a/src/javax/xml/transform/sax/TransformerHandler.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.transform.sax;
-
-import javax.xml.transform.Result;
-import javax.xml.transform.Transformer;
-
-import org.xml.sax.ContentHandler;
-import org.xml.sax.DTDHandler;
-import org.xml.sax.ext.LexicalHandler;
-
-/**
- * A TransformerHandler
- * listens for SAX ContentHandler parse events and transforms
- * them to a Result.
- */
-public interface TransformerHandler
- extends ContentHandler, LexicalHandler, DTDHandler {
-
- /**
- * <p>Set the <code>Result</code> associated with this
- * <code>TransformerHandler</code> to be used for the transformation.</p>
- *
- * @param result A <code>Result</code> instance, should not be
- * <code>null</code>.
- *
- * @throws IllegalArgumentException if result is invalid for some reason.
- */
- public void setResult(Result result) throws IllegalArgumentException;
-
- /**
- * Set the base ID (URI or system ID) from where relative
- * URLs will be resolved.
- * @param systemID Base URI for the source tree.
- */
- public void setSystemId(String systemID);
-
- /**
- * Get the base ID (URI or system ID) from where relative
- * URLs will be resolved.
- * @return The systemID that was set with {@link #setSystemId}.
- */
- public String getSystemId();
-
- /**
- * <p>Get the <code>Transformer</code> associated with this handler, which
- * is needed in order to set parameters and output properties.</p>
- *
- * @return <code>Transformer</code> associated with this
- * <code>TransformerHandler</code>.
- */
- public Transformer getTransformer();
-}
diff --git a/src/javax/xml/transform/sax/package.html b/src/javax/xml/transform/sax/package.html
deleted file mode 100644
index 97dce46..0000000
--- a/src/javax/xml/transform/sax/package.html
+++ /dev/null
@@ -1,104 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation. Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-
-<!DOCTYPE html
- PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml">
-
-<head>
- <title>javax.xml.transform.sax</title>
-
- <meta name="CVS"
- content="$Id: package.html,v 1.2 2005/06/10 03:50:41 jeffsuttor Exp $" />
- <meta name="AUTHOR"
- content="Jeff.Suttor@Sun.com" />
-</head>
-
-<body>
-<p>This package implements SAX2-specific transformation APIs. It provides
- classes which allow input from {@link org.xml.sax.ContentHandler}
- events, and also classes that produce org.xml.sax.ContentHandler events. It
- also provides methods to set the input source as an
- {@link org.xml.sax.XMLReader}, or to use a
- {@link org.xml.sax.InputSource} as the source. It also allows the
- creation of a {@link org.xml.sax.XMLFilter}, which enables
- transformations to "pull" from other transformations, and lets the transformer
- to be used polymorphically as an {@link org.xml.sax.XMLReader}.</p>
-<p>The {@link javax.xml.transform.sax.SAXSource} class allows the
- setting of an {@link org.xml.sax.XMLReader} to be used for "pulling"
- parse events, and an {@link org.xml.sax.InputSource} that may be used to
- specify the SAX source.</p>
-<p>The {@link javax.xml.transform.sax.SAXResult} class allows the
- setting of a {@link org.xml.sax.ContentHandler} to be the receiver of
- SAX2 events from the transformation.
-<p>The {@link javax.xml.transform.sax.SAXTransformerFactory} extends
- {@link javax.xml.transform.TransformerFactory} to provide factory
- methods for creating {@link javax.xml.transform.sax.TemplatesHandler},
- {@link javax.xml.transform.sax.TransformerHandler}, and
- {@link org.xml.sax.XMLReader} instances.</p>
-<p>To obtain a {@link javax.xml.transform.sax.SAXTransformerFactory},
- the caller must cast the {@link javax.xml.transform.TransformerFactory}
- instance returned from
- {@link javax.xml.transform.TransformerFactory#newInstance}.
-
-<p>The {@link javax.xml.transform.sax.TransformerHandler} interface
- allows a transformation to be created from SAX2 parse events, which is a "push"
- model rather than the "pull" model that normally occurs for a transformation.
- Normal parse events are received through the
- {@link org.xml.sax.ContentHandler} interface, lexical events such as
- startCDATA and endCDATA are received through the
- {@link org.xml.sax.ext.LexicalHandler} interface, and events that signal
- the start or end of disabling output escaping are received via
- {@link org.xml.sax.ContentHandler#processingInstruction}, with the
- target parameter being
- {@link javax.xml.transform.Result#PI_DISABLE_OUTPUT_ESCAPING} and
- {@link javax.xml.transform.Result#PI_ENABLE_OUTPUT_ESCAPING}. If
- parameters, output properties, or other features need to be set on the
- Transformer handler, a {@link javax.xml.transform.Transformer} reference
- will need to be obtained from
- {@link javax.xml.transform.sax.TransformerHandler#getTransformer}, and
- the methods invoked from that reference.
-
-<p>The {@link javax.xml.transform.sax.TemplatesHandler} interface
- allows the creation of {@link javax.xml.transform.Templates} objects
- from SAX2 parse events. Once the {@link org.xml.sax.ContentHandler}
- events are complete, the Templates object may be obtained from
- {@link javax.xml.transform.sax.TemplatesHandler#getTemplates}. Note that
- {@link javax.xml.transform.sax.TemplatesHandler#setSystemId} should
- normally be called in order to establish a base system ID from which relative
- URLs may be resolved.
-<p>The
- {@link javax.xml.transform.sax.SAXTransformerFactory#newXMLFilter}
- method allows the creation of a {@link org.xml.sax.XMLFilter}, which
- encapsulates the SAX2 notion of a "pull" transformation. The following
- illustrates several transformations chained together. Each filter points to a
- parent {@link org.xml.sax.XMLReader}, and the final transformation is
- caused by invoking {@link org.xml.sax.XMLReader#parse} on the final
- reader in the chain.</p>
-</body>
-</html>
diff --git a/src/javax/xml/transform/stax/StAXResult.java b/src/javax/xml/transform/stax/StAXResult.java
deleted file mode 100644
index 9bed77a..0000000
--- a/src/javax/xml/transform/stax/StAXResult.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.transform.stax;
-
-import javax.xml.stream.XMLEventWriter;
-import javax.xml.stream.XMLStreamWriter;
-import javax.xml.transform.Result;
-
-/**
- * <p>Acts as a holder for an XML {@link Result} in the
- * form of a StAX writer,i.e.
- * {@link XMLStreamWriter} or {@link XMLEventWriter}.
- * <code>StAXResult</code> can be used in all cases that accept
- * a <code>Result</code>, e.g. {@link javax.xml.transform.Transformer},
- * {@link javax.xml.validation.Validator} which accept
- * <code>Result</code> as input.
- *
- * @author <a href="mailto:Neeraj.Bajaj@Sun.com">Neeraj Bajaj</a>
- * @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a>
- *
- * @see <a href="http://jcp.org/en/jsr/detail?id=173">
- * JSR 173: Streaming API for XML</a>
- * @see XMLStreamWriter
- * @see XMLEventWriter
- *
- * @since 1.6
- */
-public class StAXResult implements Result {
- /** If {@link javax.xml.transform.TransformerFactory#getFeature(String name)}
- * returns true when passed this value as an argument,
- * the Transformer supports Result output of this type.
- */
- public static final String FEATURE =
- "http://javax.xml.transform.stax.StAXResult/feature";
-
- /**
- * <p><code>XMLEventWriter</code> to be used for
- * <code>Result</code> output.</p>
- */
- private XMLEventWriter xmlEventWriter = null;
-
- /**
- * <p><code>XMLStreamWriter</code> to be used for
- * <code>Result</code> output.</p>
- */
- private XMLStreamWriter xmlStreamWriter = null;
-
- /** <p>System identifier for this <code>StAXResult</code>.<p> */
- private String systemId = null;
-
- /**
- * <p>Creates a new instance of a <code>StAXResult</code>
- * by supplying an {@link XMLEventWriter}.</p>
- *
- * <p><code>XMLEventWriter</code> must be a
- * non-<code>null</code> reference.</p>
- *
- * @param xmlEventWriter <code>XMLEventWriter</code> used to create
- * this <code>StAXResult</code>.
- *
- * @throws IllegalArgumentException If <code>xmlEventWriter</code> ==
- * <code>null</code>.
- */
- public StAXResult(final XMLEventWriter xmlEventWriter) {
-
- if (xmlEventWriter == null) {
- throw new IllegalArgumentException(
- "StAXResult(XMLEventWriter) with XMLEventWriter == null");
- }
-
- this.xmlEventWriter = xmlEventWriter;
- }
-
- /**
- * <p>Creates a new instance of a <code>StAXResult</code>
- * by supplying an {@link XMLStreamWriter}.</p>
- *
- * <p><code>XMLStreamWriter</code> must be a
- * non-<code>null</code> reference.</p>
- *
- * @param xmlStreamWriter <code>XMLStreamWriter</code> used to create
- * this <code>StAXResult</code>.
- *
- * @throws IllegalArgumentException If <code>xmlStreamWriter</code> ==
- * <code>null</code>.
- */
- public StAXResult(final XMLStreamWriter xmlStreamWriter) {
-
- if (xmlStreamWriter == null) {
- throw new IllegalArgumentException(
- "StAXResult(XMLStreamWriter) with XMLStreamWriter == null");
- }
-
- this.xmlStreamWriter = xmlStreamWriter;
- }
-
- /**
- * <p>Get the <code>XMLEventWriter</code> used by this
- * <code>StAXResult</code>.</p>
- *
- * <p><code>XMLEventWriter</code> will be <code>null</code>
- * if this <code>StAXResult</code> was created with a
- * <code>XMLStreamWriter</code>.</p>
- *
- * @return <code>XMLEventWriter</code> used by this
- * <code>StAXResult</code>.
- */
- public XMLEventWriter getXMLEventWriter() {
-
- return xmlEventWriter;
- }
-
- /**
- * <p>Get the <code>XMLStreamWriter</code> used by this
- * <code>StAXResult</code>.</p>
- *
- * <p><code>XMLStreamWriter</code> will be <code>null</code>
- * if this <code>StAXResult</code> was created with a
- * <code>XMLEventWriter</code>.</p>
- *
- * @return <code>XMLStreamWriter</code> used by this
- * <code>StAXResult</code>.
- */
- public XMLStreamWriter getXMLStreamWriter() {
-
- return xmlStreamWriter;
- }
-
- /**
- * <p>In the context of a <code>StAXResult</code>, it is not appropriate
- * to explicitly set the system identifier.
- * The <code>XMLEventWriter</code> or <code>XMLStreamWriter</code>
- * used to construct this <code>StAXResult</code> determines the
- * system identifier of the XML result.</p>
- *
- * <p>An {@link UnsupportedOperationException} is <strong>always</strong>
- * thrown by this method.</p>
- *
- * @param systemId Ignored.
- *
- * @throws UnsupportedOperationException Is <strong>always</strong>
- * thrown by this method.
- */
- public void setSystemId(final String systemId) {
-
- throw new UnsupportedOperationException(
- "StAXResult#setSystemId(systemId) cannot set the "
- + "system identifier for a StAXResult");
- }
-
- /**
- * <p>The returned system identifier is always <code>null</code>.</p>
- *
- * @return The returned system identifier is always <code>null</code>.
- */
- public String getSystemId() {
-
- return null;
- }
-}
diff --git a/src/javax/xml/transform/stax/StAXSource.java b/src/javax/xml/transform/stax/StAXSource.java
deleted file mode 100644
index dd04b63..0000000
--- a/src/javax/xml/transform/stax/StAXSource.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.transform.stax;
-
-import javax.xml.stream.XMLEventReader;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.events.XMLEvent;
-import javax.xml.transform.Source;
-
-/**
- * <p>Acts as a holder for an XML {@link Source} in the
- * form of a StAX reader,i.e.
- * {@link XMLStreamReader} or {@link XMLEventReader}.
- * <code>StAXSource</code> can be used in all cases that accept
- * a <code>Source</code>, e.g. {@link javax.xml.transform.Transformer},
- * {@link javax.xml.validation.Validator} which accept
- * <code>Source</code> as input.
- *
- * <p><code>StAXSource</code>s are consumed during processing
- * and are not reusable.</p>
- *
- * @author <a href="mailto:Neeraj.Bajaj@Sun.com">Neeraj Bajaj</a>
- * @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a>
- *
- * @see <a href="http://jcp.org/en/jsr/detail?id=173">
- * JSR 173: Streaming API for XML</a>
- * @see XMLStreamReader
- * @see XMLEventReader
- *
- * @since 1.6
- */
-public class StAXSource implements Source {
-
- /** If {@link javax.xml.transform.TransformerFactory#getFeature(String name)}
- * returns true when passed this value as an argument,
- * the Transformer supports Source input of this type.
- */
- public static final String FEATURE =
- "http://javax.xml.transform.stax.StAXSource/feature";
-
- /** <p><code>XMLEventReader</code> to be used for source input.</p> */
- private XMLEventReader xmlEventReader = null;
-
- /** <p><code>XMLStreamReader</code> to be used for source input.</p> */
- private XMLStreamReader xmlStreamReader = null;
-
- /** <p>System identifier of source input.</p> */
- private String systemId = null;
-
- /**
- * <p>Creates a new instance of a <code>StAXSource</code>
- * by supplying an {@link XMLEventReader}.</p>
- *
- * <p><code>XMLEventReader</code> must be a
- * non-<code>null</code> reference.</p>
- *
- * <p><code>XMLEventReader</code> must be in
- * {@link XMLStreamConstants#START_DOCUMENT} or
- * {@link XMLStreamConstants#START_ELEMENT} state.</p>
- *
- * @param xmlEventReader <code>XMLEventReader</code> used to create
- * this <code>StAXSource</code>.
- *
- * @throws XMLStreamException If <code>xmlEventReader</code> access
- * throws an <code>Exception</code>.
- * @throws IllegalArgumentException If <code>xmlEventReader</code> ==
- * <code>null</code>.
- * @throws IllegalStateException If <code>xmlEventReader</code>
- * is not in <code>XMLStreamConstants.START_DOCUMENT</code> or
- * <code>XMLStreamConstants.START_ELEMENT</code> state.
- */
- public StAXSource(final XMLEventReader xmlEventReader)
- throws XMLStreamException {
-
- if (xmlEventReader == null) {
- throw new IllegalArgumentException(
- "StAXSource(XMLEventReader) with XMLEventReader == null");
- }
-
- // TODO: This is ugly ...
- // there is no way to know the current position(event) of
- // XMLEventReader. peek() is the only way to know the next event.
- // The next event on the input stream should be
- // XMLStreamConstants.START_DOCUMENT or
- // XMLStreamConstants.START_ELEMENT.
- XMLEvent event = xmlEventReader.peek();
- int eventType = event.getEventType();
- if (eventType != XMLStreamConstants.START_DOCUMENT
- && eventType != XMLStreamConstants.START_ELEMENT) {
- throw new IllegalStateException(
- "StAXSource(XMLEventReader) with XMLEventReader "
- + "not in XMLStreamConstants.START_DOCUMENT or "
- + "XMLStreamConstants.START_ELEMENT state");
- }
-
- this.xmlEventReader = xmlEventReader;
- systemId = event.getLocation().getSystemId();
- }
-
- /**
- * <p>Creates a new instance of a <code>StAXSource</code>
- * by supplying an {@link XMLStreamReader}.</p>
- *
- * <p><code>XMLStreamReader</code> must be a
- * non-<code>null</code> reference.</p>
- *
- * <p><code>XMLStreamReader</code> must be in
- * {@link XMLStreamConstants#START_DOCUMENT} or
- * {@link XMLStreamConstants#START_ELEMENT} state.</p>
- *
- * @param xmlStreamReader <code>XMLStreamReader</code> used to create
- * this <code>StAXSource</code>.
- *
- * @throws IllegalArgumentException If <code>xmlStreamReader</code> ==
- * <code>null</code>.
- * @throws IllegalStateException If <code>xmlStreamReader</code>
- * is not in <code>XMLStreamConstants.START_DOCUMENT</code> or
- * <code>XMLStreamConstants.START_ELEMENT</code> state.
- */
- public StAXSource(final XMLStreamReader xmlStreamReader) {
-
- if (xmlStreamReader == null) {
- throw new IllegalArgumentException(
- "StAXSource(XMLStreamReader) with XMLStreamReader == null");
- }
-
- int eventType = xmlStreamReader.getEventType();
- if (eventType != XMLStreamConstants.START_DOCUMENT
- && eventType != XMLStreamConstants.START_ELEMENT) {
- throw new IllegalStateException(
- "StAXSource(XMLStreamReader) with XMLStreamReader"
- + "not in XMLStreamConstants.START_DOCUMENT or "
- + "XMLStreamConstants.START_ELEMENT state");
- }
-
- this.xmlStreamReader = xmlStreamReader;
- systemId = xmlStreamReader.getLocation().getSystemId();
- }
-
- /**
- * <p>Get the <code>XMLEventReader</code> used by this
- * <code>StAXSource</code>.</p>
- *
- * <p><code>XMLEventReader</code> will be <code>null</code>.
- * if this <code>StAXSource</code> was created with a
- * <code>XMLStreamReader</code>.</p>
- *
- * @return <code>XMLEventReader</code> used by this
- * <code>StAXSource</code>.
- */
- public XMLEventReader getXMLEventReader() {
-
- return xmlEventReader;
- }
-
- /**
- * <p>Get the <code>XMLStreamReader</code> used by this
- * <code>StAXSource</code>.</p>
- *
- * <p><code>XMLStreamReader</code> will be <code>null</code>
- * if this <code>StAXSource</code> was created with a
- * <code>XMLEventReader</code>.</p>
- *
- * @return <code>XMLStreamReader</code> used by this
- * <code>StAXSource</code>.
- */
- public XMLStreamReader getXMLStreamReader() {
-
- return xmlStreamReader;
- }
-
- /**
- * <p>In the context of a <code>StAXSource</code>, it is not appropriate
- * to explicitly set the system identifier.
- * The <code>XMLStreamReader</code> or <code>XMLEventReader</code>
- * used to construct this <code>StAXSource</code> determines the
- * system identifier of the XML source.</p>
- *
- * <p>An {@link UnsupportedOperationException} is <strong>always</strong>
- * thrown by this method.</p>
- *
- * @param systemId Ignored.
- *
- * @throws UnsupportedOperationException Is <strong>always</strong>
- * thrown by this method.
- */
- public void setSystemId(final String systemId) {
-
- throw new UnsupportedOperationException(
- "StAXSource#setSystemId(systemId) cannot set the "
- + "system identifier for a StAXSource");
- }
-
- /**
- * <p>Get the system identifier used by this
- * <code>StAXSource</code>.</p>
- *
- * <p>The <code>XMLStreamReader</code> or <code>XMLEventReader</code>
- * used to construct this <code>StAXSource</code> is queried to determine
- * the system identifier of the XML source.</p>
- *
- * <p>The system identifier may be <code>null</code> or
- * an empty <code>""</code> <code>String</code>.</p>
- *
- * @return System identifier used by this <code>StAXSource</code>.
- */
- public String getSystemId() {
-
- return systemId;
- }
-}
diff --git a/src/javax/xml/transform/stax/package.html b/src/javax/xml/transform/stax/package.html
deleted file mode 100644
index d07e037..0000000
--- a/src/javax/xml/transform/stax/package.html
+++ /dev/null
@@ -1,73 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
-Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation. Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
-
--->
-
-<!DOCTYPE html
- PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>javax.xml.transform.stax</title>
-
- <meta name="CVS"
- content="$Id: package.html,v 1.2 2005/11/03 19:34:28 jeffsuttor Exp $" />
- <meta name="AUTHOR"
- content="Jeff.Suttor@Sun.com" />
- <meta name="AUTHOR"
- content="Neeraj.Bajaj@Sun.com" />
- </head>
- <body>
- <p>
- Provides for StAX-specific transformation APIs.
- TODO: better description(s).
- </p>
-
- <h2>Package Specification</h2>
- <ul>
- <li><a href="http://jcp.org/en/jsr/detail?id=173">JSR 173: Streaming API for XML</a></li>
- </ul>
-
- <h2>Related Documentation</h2>
-
- <p>For overviews, tutorials, examples, guides, and tool documentation, please see:</p>
- <ul>
- <li><a href="">TODO: Refer to non-spec documentation</a></li>
- </ul>
-
- <!-- Put @see and @since tags down here. -->
- <ul>
- <li>@see XMLStreamReader</li>
- <li>@see XMLEventReader</li>
- </ul>
-
- <p>
- @since 1.6
- </p>
-
- </body>
-</html>
diff --git a/src/javax/xml/transform/stream/StreamResult.java b/src/javax/xml/transform/stream/StreamResult.java
deleted file mode 100644
index 39df253..0000000
--- a/src/javax/xml/transform/stream/StreamResult.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.transform.stream;
-
-import javax.xml.transform.Result;
-
-import java.io.File;
-import java.io.OutputStream;
-import java.io.Writer;
-import java.net.MalformedURLException;
-
-/**
- * <p>Acts as an holder for a transformation result,
- * which may be XML, plain Text, HTML, or some other form of markup.</p>
- *
- * @author <a href="Jeff.Suttor@Sun.com">Jeff Suttor</a>
- */
-public class StreamResult implements Result {
-
- /** If {@link javax.xml.transform.TransformerFactory#getFeature}
- * returns true when passed this value as an argument,
- * the Transformer supports Result output of this type.
- */
- public static final String FEATURE =
- "http://javax.xml.transform.stream.StreamResult/feature";
-
- /**
- * Zero-argument default constructor.
- */
- public StreamResult() {
- }
-
- /**
- * Construct a StreamResult from a byte stream. Normally,
- * a stream should be used rather than a reader, so that
- * the transformer may use instructions contained in the
- * transformation instructions to control the encoding.
- *
- * @param outputStream A valid OutputStream reference.
- */
- public StreamResult(OutputStream outputStream) {
- setOutputStream(outputStream);
- }
-
- /**
- * Construct a StreamResult from a character stream. Normally,
- * a stream should be used rather than a reader, so that
- * the transformer may use instructions contained in the
- * transformation instructions to control the encoding. However,
- * there are times when it is useful to write to a character
- * stream, such as when using a StringWriter.
- *
- * @param writer A valid Writer reference.
- */
- public StreamResult(Writer writer) {
- setWriter(writer);
- }
-
- /**
- * Construct a StreamResult from a URL.
- *
- * @param systemId Must be a String that conforms to the URI syntax.
- */
- public StreamResult(String systemId) {
- this.systemId = systemId;
- }
-
- /**
- * Construct a StreamResult from a File.
- *
- * @param f Must a non-null File reference.
- */
- public StreamResult(File f) {
- //convert file to appropriate URI, f.toURI().toASCIIString()
- //converts the URI to string as per rule specified in
- //RFC 2396,
- setSystemId(f.toURI().toASCIIString());
- }
-
- /**
- * Set the ByteStream that is to be written to. Normally,
- * a stream should be used rather than a reader, so that
- * the transformer may use instructions contained in the
- * transformation instructions to control the encoding.
- *
- * @param outputStream A valid OutputStream reference.
- */
- public void setOutputStream(OutputStream outputStream) {
- this.outputStream = outputStream;
- }
-
- /**
- * Get the byte stream that was set with setOutputStream.
- *
- * @return The byte stream that was set with setOutputStream, or null
- * if setOutputStream or the ByteStream constructor was not called.
- */
- public OutputStream getOutputStream() {
- return outputStream;
- }
-
- /**
- * Set the writer that is to receive the result. Normally,
- * a stream should be used rather than a writer, so that
- * the transformer may use instructions contained in the
- * transformation instructions to control the encoding. However,
- * there are times when it is useful to write to a writer,
- * such as when using a StringWriter.
- *
- * @param writer A valid Writer reference.
- */
- public void setWriter(Writer writer) {
- this.writer = writer;
- }
-
- /**
- * Get the character stream that was set with setWriter.
- *
- * @return The character stream that was set with setWriter, or null
- * if setWriter or the Writer constructor was not called.
- */
- public Writer getWriter() {
- return writer;
- }
-
- /**
- * Set the systemID that may be used in association
- * with the byte or character stream, or, if neither is set, use
- * this value as a writeable URI (probably a file name).
- *
- * @param systemId The system identifier as a URI string.
- */
- public void setSystemId(String systemId) {
- this.systemId = systemId;
- }
-
- /**
- * <p>Set the system ID from a <code>File</code> reference.</p>
- *
- *
- * @param f Must a non-null File reference.
- */
- public void setSystemId(File f) {
- //convert file to appropriate URI, f.toURI().toASCIIString()
- //converts the URI to string as per rule specified in
- //RFC 2396,
- this.systemId = f.toURI().toASCIIString();
- }
-
- /**
- * Get the system identifier that was set with setSystemId.
- *
- * @return The system identifier that was set with setSystemId, or null
- * if setSystemId was not called.
- */
- public String getSystemId() {
- return systemId;
- }
-
- //////////////////////////////////////////////////////////////////////
- // Internal state.
- //////////////////////////////////////////////////////////////////////
-
- /**
- * The systemID that may be used in association
- * with the byte or character stream, or, if neither is set, use
- * this value as a writeable URI (probably a file name).
- */
- private String systemId;
-
- /**
- * The byte stream that is to be written to.
- */
- private OutputStream outputStream;
-
- /**
- * The character stream that is to be written to.
- */
- private Writer writer;
-}
diff --git a/src/javax/xml/transform/stream/StreamSource.java b/src/javax/xml/transform/stream/StreamSource.java
deleted file mode 100644
index ad41b9d..0000000
--- a/src/javax/xml/transform/stream/StreamSource.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.transform.stream;
-
-import java.io.File;
-import java.io.InputStream;
-import java.io.Reader;
-
-import javax.xml.transform.Source;
-
-/**
- * <p>Acts as an holder for a transformation Source in the form
- * of a stream of XML markup.</p>
- *
- * <p><em>Note:</em> Due to their internal use of either a {@link Reader} or {@link InputStream} instance,
- * <code>StreamSource</code> instances may only be used once.</p>
- *
- * @author <a href="Jeff.Suttor@Sun.com">Jeff Suttor</a>
- */
-public class StreamSource implements Source {
-
- /** If {@link javax.xml.transform.TransformerFactory#getFeature}
- * returns true when passed this value as an argument,
- * the Transformer supports Source input of this type.
- */
- public static final String FEATURE =
- "http://javax.xml.transform.stream.StreamSource/feature";
-
- /**
- * <p>Zero-argument default constructor. If this constructor is used, and
- * no Stream source is set using
- * {@link #setInputStream(java.io.InputStream inputStream)} or
- * {@link #setReader(java.io.Reader reader)}, then the
- * <code>Transformer</code> will
- * create an empty source {@link java.io.InputStream} using
- * {@link java.io.InputStream#InputStream() new InputStream()}.</p>
- *
- * @see javax.xml.transform.Transformer#transform(Source xmlSource, Result outputTarget)
- */
- public StreamSource() { }
-
- /**
- * Construct a StreamSource from a byte stream. Normally,
- * a stream should be used rather than a reader, so
- * the XML parser can resolve character encoding specified
- * by the XML declaration.
- *
- * <p>If this constructor is used to process a stylesheet, normally
- * setSystemId should also be called, so that relative URI references
- * can be resolved.</p>
- *
- * @param inputStream A valid InputStream reference to an XML stream.
- */
- public StreamSource(InputStream inputStream) {
- setInputStream(inputStream);
- }
-
- /**
- * Construct a StreamSource from a byte stream. Normally,
- * a stream should be used rather than a reader, so that
- * the XML parser can resolve character encoding specified
- * by the XML declaration.
- *
- * <p>This constructor allows the systemID to be set in addition
- * to the input stream, which allows relative URIs
- * to be processed.</p>
- *
- * @param inputStream A valid InputStream reference to an XML stream.
- * @param systemId Must be a String that conforms to the URI syntax.
- */
- public StreamSource(InputStream inputStream, String systemId) {
- setInputStream(inputStream);
- setSystemId(systemId);
- }
-
- /**
- * Construct a StreamSource from a character reader. Normally,
- * a stream should be used rather than a reader, so that
- * the XML parser can resolve character encoding specified
- * by the XML declaration. However, in many cases the encoding
- * of the input stream is already resolved, as in the case of
- * reading XML from a StringReader.
- *
- * @param reader A valid Reader reference to an XML character stream.
- */
- public StreamSource(Reader reader) {
- setReader(reader);
- }
-
- /**
- * Construct a StreamSource from a character reader. Normally,
- * a stream should be used rather than a reader, so that
- * the XML parser may resolve character encoding specified
- * by the XML declaration. However, in many cases the encoding
- * of the input stream is already resolved, as in the case of
- * reading XML from a StringReader.
- *
- * @param reader A valid Reader reference to an XML character stream.
- * @param systemId Must be a String that conforms to the URI syntax.
- */
- public StreamSource(Reader reader, String systemId) {
- setReader(reader);
- setSystemId(systemId);
- }
-
- /**
- * Construct a StreamSource from a URL.
- *
- * @param systemId Must be a String that conforms to the URI syntax.
- */
- public StreamSource(String systemId) {
- this.systemId = systemId;
- }
-
- /**
- * Construct a StreamSource from a File.
- *
- * @param f Must a non-null File reference.
- */
- public StreamSource(File f) {
- //convert file to appropriate URI, f.toURI().toASCIIString()
- //converts the URI to string as per rule specified in
- //RFC 2396,
- setSystemId(f.toURI().toASCIIString());
- }
-
- /**
- * Set the byte stream to be used as input. Normally,
- * a stream should be used rather than a reader, so that
- * the XML parser can resolve character encoding specified
- * by the XML declaration.
- *
- * <p>If this Source object is used to process a stylesheet, normally
- * setSystemId should also be called, so that relative URL references
- * can be resolved.</p>
- *
- * @param inputStream A valid InputStream reference to an XML stream.
- */
- public void setInputStream(InputStream inputStream) {
- this.inputStream = inputStream;
- }
-
- /**
- * Get the byte stream that was set with setByteStream.
- *
- * @return The byte stream that was set with setByteStream, or null
- * if setByteStream or the ByteStream constructor was not called.
- */
- public InputStream getInputStream() {
- return inputStream;
- }
-
- /**
- * Set the input to be a character reader. Normally,
- * a stream should be used rather than a reader, so that
- * the XML parser can resolve character encoding specified
- * by the XML declaration. However, in many cases the encoding
- * of the input stream is already resolved, as in the case of
- * reading XML from a StringReader.
- *
- * @param reader A valid Reader reference to an XML CharacterStream.
- */
- public void setReader(Reader reader) {
- this.reader = reader;
- }
-
- /**
- * Get the character stream that was set with setReader.
- *
- * @return The character stream that was set with setReader, or null
- * if setReader or the Reader constructor was not called.
- */
- public Reader getReader() {
- return reader;
- }
-
- /**
- * Set the public identifier for this Source.
- *
- * <p>The public identifier is always optional: if the application
- * writer includes one, it will be provided as part of the
- * location information.</p>
- *
- * @param publicId The public identifier as a string.
- */
- public void setPublicId(String publicId) {
- this.publicId = publicId;
- }
-
- /**
- * Get the public identifier that was set with setPublicId.
- *
- * @return The public identifier that was set with setPublicId, or null
- * if setPublicId was not called.
- */
- public String getPublicId() {
- return publicId;
- }
-
- /**
- * Set the system identifier for this Source.
- *
- * <p>The system identifier is optional if there is a byte stream
- * or a character stream, but it is still useful to provide one,
- * since the application can use it to resolve relative URIs
- * and can include it in error messages and warnings (the parser
- * will attempt to open a connection to the URI only if
- * there is no byte stream or character stream specified).</p>
- *
- * @param systemId The system identifier as a URL string.
- */
- public void setSystemId(String systemId) {
- this.systemId = systemId;
- }
-
- /**
- * Get the system identifier that was set with setSystemId.
- *
- * @return The system identifier that was set with setSystemId, or null
- * if setSystemId was not called.
- */
- public String getSystemId() {
- return systemId;
- }
-
- /**
- * Set the system ID from a File reference.
- *
- * @param f Must a non-null File reference.
- */
- public void setSystemId(File f) {
- //convert file to appropriate URI, f.toURI().toASCIIString()
- //converts the URI to string as per rule specified in
- //RFC 2396,
- this.systemId = f.toURI().toASCIIString();
- }
-
- //////////////////////////////////////////////////////////////////////
- // Internal state.
- //////////////////////////////////////////////////////////////////////
-
- /**
- * The public identifier for this input source, or null.
- */
- private String publicId;
-
- /**
- * The system identifier as a URL string, or null.
- */
- private String systemId;
-
- /**
- * The byte stream for this Source, or null.
- */
- private InputStream inputStream;
-
- /**
- * The character stream for this Source, or null.
- */
- private Reader reader;
-}
diff --git a/src/javax/xml/transform/stream/package.html b/src/javax/xml/transform/stream/package.html
deleted file mode 100644
index ea52ecb..0000000
--- a/src/javax/xml/transform/stream/package.html
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation. Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-
-<!DOCTYPE html
- PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml">
-
-<head>
- <title>javax.xml.transform.stream</title>
-
- <meta name="CVS"
- content="$Id: package.html,v 1.2 2005/06/10 03:50:42 jeffsuttor Exp $" />
- <meta name="AUTHOR"
- content="Jeff.Suttor@Sun.com" />
-</head>
-<body>
-<p>This package implements stream- and URI- specific transformation APIs.
- </p>
-<p>The {@link javax.xml.transform.stream.StreamSource} class
- provides methods for specifying {@link java.io.InputStream} input,
- {@link java.io.Reader} input, and URL input in the form of strings. Even
- if an input stream or reader is specified as the source,
- {@link javax.xml.transform.stream.StreamSource#setSystemId} should still
- be called, so that the transformer can know from where it should resolve
- relative URIs. The public identifier is always optional: if the application
- writer includes one, it will be provided as part of the
- {@link javax.xml.transform.SourceLocator} information.</p>
-<p>The {@link javax.xml.transform.stream.StreamResult} class
- provides methods for specifying {@link java.io.OutputStream},
- {@link java.io.Writer}, or an output system ID, as the output of the
- transformation result.</p>
-<p>Normally streams should be used rather than readers or writers, for
- both the Source and Result, since readers and writers already have the encoding
- established to and from the internal Unicode format. However, there are times
- when it is useful to write to a character stream, such as when using a
- StringWriter in order to write to a String, or in the case of reading source
- XML from a StringReader.</p>
-</body>
-</html>
diff --git a/src/javax/xml/validation/Schema.java b/src/javax/xml/validation/Schema.java
deleted file mode 100644
index 05c445a..0000000
--- a/src/javax/xml/validation/Schema.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.validation;
-
-/**
- * Immutable in-memory representation of grammar.
- *
- * <p>
- * This object represents a set of constraints that can be checked/
- * enforced against an XML document.
- *
- * <p>
- * A {@link Schema} object is thread safe and applications are
- * encouraged to share it across many parsers in many threads.
- *
- * <p>
- * A {@link Schema} object is immutable in the sense that it shouldn't
- * change the set of constraints once it is created. In other words,
- * if an application validates the same document twice against the same
- * {@link Schema}, it must always produce the same result.
- *
- * <p>
- * A {@link Schema} object is usually created from {@link SchemaFactory}.
- *
- * <p>
- * Two kinds of validators can be created from a {@link Schema} object.
- * One is {@link Validator}, which provides highly-level validation
- * operations that cover typical use cases. The other is
- * {@link ValidatorHandler}, which works on top of SAX for better
- * modularity.
- *
- * <p>
- * This specification does not refine
- * the {@link java.lang.Object#equals(java.lang.Object)} method.
- * In other words, if you parse the same schema twice, you may
- * still get <code>!schemaA.equals(schemaB)</code>.
- *
- * @author <a href="mailto:Kohsuke.Kawaguchi@Sun.com">Kohsuke Kawaguchi</a>
- * @see <a href="http://www.w3.org/TR/xmlschema-1/">XML Schema Part 1: Structures</a>
- * @see <a href="http://www.w3.org/TR/xml11/">Extensible Markup Language (XML) 1.1</a>
- * @see <a href="http://www.w3.org/TR/REC-xml">Extensible Markup Language (XML) 1.0 (Second Edition)</a>
- * @since 1.5
- */
-public abstract class Schema {
-
- /**
- * Constructor for the derived class.
- *
- * <p>
- * The constructor does nothing.
- */
- protected Schema() {
- }
-
- /**
- * Creates a new {@link Validator} for this {@link Schema}.
- *
- * <p>A validator enforces/checks the set of constraints this object
- * represents.</p>
- *
- * <p>Implementors should assure that the properties set on the
- * {@link SchemaFactory} that created this {@link Schema} are also
- * set on the {@link Validator} constructed.</p>
- *
- * @return
- * Always return a non-null valid object.
- */
- public abstract Validator newValidator();
-
- /**
- * Creates a new {@link ValidatorHandler} for this {@link Schema}.
- *
- * <p>Implementors should assure that the properties set on the
- * {@link SchemaFactory} that created this {@link Schema} are also
- * set on the {@link ValidatorHandler} constructed.</p>
- *
- * @return
- * Always return a non-null valid object.
- */
- public abstract ValidatorHandler newValidatorHandler();
-}
diff --git a/src/javax/xml/validation/SchemaFactory.java b/src/javax/xml/validation/SchemaFactory.java
deleted file mode 100644
index ebbbe40..0000000
--- a/src/javax/xml/validation/SchemaFactory.java
+++ /dev/null
@@ -1,800 +0,0 @@
-/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.validation;
-
-import java.io.File;
-import java.net.URL;
-import javax.xml.transform.Source;
-import javax.xml.transform.stream.StreamSource;
-import org.w3c.dom.ls.LSResourceResolver;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
-import org.xml.sax.SAXParseException;
-
-/**
- * Factory that creates {@link Schema} objects&#x2E; Entry-point to
- * the validation API.
- *
- * <p>
- * {@link SchemaFactory} is a schema compiler. It reads external
- * representations of schemas and prepares them for validation.
- *
- * <p>
- * The {@link SchemaFactory} class is not thread-safe. In other words,
- * it is the application's responsibility to ensure that at most
- * one thread is using a {@link SchemaFactory} object at any
- * given moment. Implementations are encouraged to mark methods
- * as <code>synchronized</code> to protect themselves from broken clients.
- *
- * <p>
- * {@link SchemaFactory} is not re-entrant. While one of the
- * <code>newSchema</code> methods is being invoked, applications
- * may not attempt to recursively invoke the <code>newSchema</code> method,
- * even from the same thread.
- *
- * <h2><a name="schemaLanguage"></a>Schema Language</h2>
- * <p>
- * This spec uses a namespace URI to designate a schema language.
- * The following table shows the values defined by this specification.
- * <p>
- * To be compliant with the spec, the implementation
- * is only required to support W3C XML Schema 1.0. However,
- * if it chooses to support other schema languages listed here,
- * it must conform to the relevant behaviors described in this spec.
- *
- * <p>
- * Schema languages not listed here are expected to
- * introduce their own URIs to represent themselves.
- * The {@link SchemaFactory} class is capable of locating other
- * implementations for other schema languages at run-time.
- *
- * <p>
- * Note that because the XML DTD is strongly tied to the parsing process
- * and has a significant effect on the parsing process, it is impossible
- * to define the DTD validation as a process independent from parsing.
- * For this reason, this specification does not define the semantics for
- * the XML DTD. This doesn't prohibit implementors from implementing it
- * in a way they see fit, but <em>users are warned that any DTD
- * validation implemented on this interface necessarily deviate from
- * the XML DTD semantics as defined in the XML 1.0</em>.
- *
- * <table border="1" cellpadding="2">
- * <thead>
- * <tr>
- * <th>value</th>
- * <th>language</th>
- * </tr>
- * </thead>
- * <tbody>
- * <tr>
- * <td>{@link javax.xml.XMLConstants#W3C_XML_SCHEMA_NS_URI} ("<code>http://www.w3.org/2001/XMLSchema</code>")</td>
- * <td><a href="http://www.w3.org/TR/xmlschema-1">W3C XML Schema 1.0</a></td>
- * </tr>
- * <tr>
- * <td>{@link javax.xml.XMLConstants#RELAXNG_NS_URI} ("<code>http://relaxng.org/ns/structure/1.0</code>")</td>
- * <td><a href="http://www.relaxng.org/">RELAX NG 1.0</a></td>
- * </tr>
- * </tbody>
- * </table>
- *
- * @author <a href="mailto:Kohsuke.Kawaguchi@Sun.com">Kohsuke Kawaguchi</a>
- * @author <a href="mailto:Neeraj.Bajaj@sun.com">Neeraj Bajaj</a>
- *
- * @since 1.5
- */
-public abstract class SchemaFactory {
-
- private static SecuritySupport ss = new SecuritySupport();
-
- /**
- * <p>Constructor for derived classes.</p>
- *
- * <p>The constructor does nothing.</p>
- *
- * <p>Derived classes must create {@link SchemaFactory} objects that have
- * <code>null</code> {@link ErrorHandler} and
- * <code>null</code> {@link LSResourceResolver}.</p>
- */
- protected SchemaFactory() {
- }
-
- /**
- * <p>Lookup an implementation of the <code>SchemaFactory</code> that supports the specified
- * schema language and return it.</p>
- *
- * <p>To find a <code>SchemaFactory</code> object for a given schema language,
- * this method looks the following places in the following order
- * where "the class loader" refers to the context class loader:</p>
- * <ol>
- * <li>
- * If the system property
- * <code>"javax.xml.validation.SchemaFactory:<i>schemaLanguage</i>"</code>
- * is present (where <i>schemaLanguage</i> is the parameter
- * to this method), then its value is read
- * as a class name. The method will try to
- * create a new instance of this class by using the class loader,
- * and returns it if it is successfully created.
- * </li>
- * <li>
- * <code>$java.home/lib/jaxp.properties</code> is read and
- * the value associated with the key being the system property above
- * is looked for. If present, the value is processed just like above.
- * </li>
- * <li>
- * Use the service-provider loading facilities, defined by the
- * {@link java.util.ServiceLoader} class, to attempt to locate and load an
- * implementation of the service using the {@linkplain
- * java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}:
- * the service-provider loading facility will use the {@linkplain
- * java.lang.Thread#getContextClassLoader() current thread's context class loader}
- * to attempt to load the service. If the context class
- * loader is null, the {@linkplain
- * ClassLoader#getSystemClassLoader() system class loader} will be used.
- * <br>
- * Each potential service provider is required to implement the method
- * {@link #isSchemaLanguageSupported(String schemaLanguage)}.
- * <br>
- * The first service provider found that supports the specified schema
- * language is returned.
- * <br>
- * In case of {@link java.util.ServiceConfigurationError} a
- * {@link SchemaFactoryConfigurationError} will be thrown.
- * </li>
- * <li>
- * Platform default <code>SchemaFactory</code> is located
- * in a implementation specific way. There must be a platform default
- * <code>SchemaFactory</code> for W3C XML Schema.
- * </li>
- * </ol>
- *
- * <p>If everything fails, {@link IllegalArgumentException} will be thrown.</p>
- *
- * <p><strong>Tip for Trouble-shooting:</strong></p>
- * <p>See {@link java.util.Properties#load(java.io.InputStream)} for
- * exactly how a property file is parsed. In particular, colons ':'
- * need to be escaped in a property file, so make sure schema language
- * URIs are properly escaped in it. For example:</p>
- * <pre>
- * http\://www.w3.org/2001/XMLSchema=org.acme.foo.XSSchemaFactory
- * </pre>
- *
- * @param schemaLanguage
- * Specifies the schema language which the returned
- * SchemaFactory will understand. See
- * <a href="#schemaLanguage">the list of available
- * schema languages</a> for the possible values.
- *
- * @return New instance of a <code>SchemaFactory</code>
- *
- * @throws IllegalArgumentException
- * If no implementation of the schema language is available.
- * @throws NullPointerException
- * If the <code>schemaLanguage</code> parameter is null.
- * @throws SchemaFactoryConfigurationError
- * If a configuration error is encountered.
- *
- * @see #newInstance(String schemaLanguage, String factoryClassName, ClassLoader classLoader)
- */
- public static SchemaFactory newInstance(String schemaLanguage) {
- ClassLoader cl;
- cl = ss.getContextClassLoader();
-
- if (cl == null) {
- //cl = ClassLoader.getSystemClassLoader();
- //use the current class loader
- cl = SchemaFactory.class.getClassLoader();
- }
-
- SchemaFactory f = new SchemaFactoryFinder(cl).newFactory(schemaLanguage);
- if (f == null) {
- throw new IllegalArgumentException(
- "No SchemaFactory"
- + " that implements the schema language specified by: " + schemaLanguage
- + " could be loaded");
- }
- return f;
- }
-
- /**
- * <p>Obtain a new instance of a <code>SchemaFactory</code> from class name. <code>SchemaFactory</code>
- * is returned if specified factory class name supports the specified schema language.
- * This function is useful when there are multiple providers in the classpath.
- * It gives more control to the application as it can specify which provider
- * should be loaded.</p>
- *
- * <h2>Tip for Trouble-shooting</h2>
- * <p>Setting the <code>jaxp.debug</code> system property will cause
- * this method to print a lot of debug messages
- * to <code>System.err</code> about what it is doing and where it is looking at.</p>
- *
- * <p> If you have problems try:</p>
- * <pre>
- * java -Djaxp.debug=1 YourProgram ....
- * </pre>
- *
- * @param schemaLanguage Specifies the schema language which the returned
- * <code>SchemaFactory</code> will understand. See
- * <a href="#schemaLanguage">the list of available
- * schema languages</a> for the possible values.
- *
- * @param factoryClassName fully qualified factory class name that provides implementation of <code>javax.xml.validation.SchemaFactory</code>.
- *
- * @param classLoader <code>ClassLoader</code> used to load the factory class. If <code>null</code>
- * current <code>Thread</code>'s context classLoader is used to load the factory class.
- *
- * @return New instance of a <code>SchemaFactory</code>
- *
- * @throws IllegalArgumentException
- * if <code>factoryClassName</code> is <code>null</code>, or
- * the factory class cannot be loaded, instantiated or doesn't
- * support the schema language specified in <code>schemLanguage</code>
- * parameter.
- *
- * @throws NullPointerException
- * If the <code>schemaLanguage</code> parameter is null.
- *
- * @see #newInstance(String schemaLanguage)
- *
- * @since 1.6
- */
- public static SchemaFactory newInstance(String schemaLanguage, String factoryClassName, ClassLoader classLoader){
- ClassLoader cl = classLoader;
-
- if (cl == null) {
- cl = ss.getContextClassLoader();
- }
-
- SchemaFactory f = new SchemaFactoryFinder(cl).createInstance(factoryClassName);
- if (f == null) {
- throw new IllegalArgumentException(
- "Factory " + factoryClassName
- + " could not be loaded to implement the schema language specified by: " + schemaLanguage);
- }
- //if this factory supports the given schemalanguage return this factory else thrown exception
- if(f.isSchemaLanguageSupported(schemaLanguage)){
- return f;
- }else{
- throw new IllegalArgumentException(
- "Factory " + f.getClass().getName()
- + " does not implement the schema language specified by: " + schemaLanguage);
- }
-
- }
-
- /**
- * <p>Is specified schema supported by this <code>SchemaFactory</code>?</p>
- *
- * @param schemaLanguage Specifies the schema language which the returned <code>SchemaFactory</code> will understand.
- * <code>schemaLanguage</code> must specify a <a href="#schemaLanguage">valid</a> schema language.
- *
- * @return <code>true</code> if <code>SchemaFactory</code> supports <code>schemaLanguage</code>, else <code>false</code>.
- *
- * @throws NullPointerException If <code>schemaLanguage</code> is <code>null</code>.
- * @throws IllegalArgumentException If <code>schemaLanguage.length() == 0</code>
- * or <code>schemaLanguage</code> does not specify a <a href="#schemaLanguage">valid</a> schema language.
- */
- public abstract boolean isSchemaLanguageSupported(String schemaLanguage);
-
- /**
- * Look up the value of a feature flag.
- *
- * <p>The feature name is any fully-qualified URI. It is
- * possible for a {@link SchemaFactory} to recognize a feature name but
- * temporarily be unable to return its value.
- *
- * <p>Implementors are free (and encouraged) to invent their own features,
- * using names built on their own URIs.</p>
- *
- * @param name The feature name, which is a non-null fully-qualified URI.
- *
- * @return The current value of the feature (true or false).
- *
- * @throws SAXNotRecognizedException If the feature
- * value can't be assigned or retrieved.
- * @throws SAXNotSupportedException When the
- * {@link SchemaFactory} recognizes the feature name but
- * cannot determine its value at this time.
- * @throws NullPointerException If <code>name</code> is <code>null</code>.
- *
- * @see #setFeature(String, boolean)
- */
- public boolean getFeature(String name)
- throws SAXNotRecognizedException, SAXNotSupportedException {
-
- if (name == null) {
- throw new NullPointerException("the name parameter is null");
- }
- throw new SAXNotRecognizedException(name);
- }
-
- /**
- * <p>Set a feature for this <code>SchemaFactory</code>,
- * {@link Schema}s created by this factory, and by extension,
- * {@link Validator}s and {@link ValidatorHandler}s created by
- * those {@link Schema}s.
- * </p>
- *
- * <p>Implementors and developers should pay particular attention
- * to how the special {@link Schema} object returned by {@link
- * #newSchema()} is processed. In some cases, for example, when the
- * <code>SchemaFactory</code> and the class actually loading the
- * schema come from different implementations, it may not be possible
- * for <code>SchemaFactory</code> features to be inherited automatically.
- * Developers should
- * make sure that features, such as secure processing, are explicitly
- * set in both places.</p>
- *
- * <p>The feature name is any fully-qualified URI. It is
- * possible for a {@link SchemaFactory} to expose a feature value but
- * to be unable to change the current value.</p>
- *
- * <p>All implementations are required to support the {@link javax.xml.XMLConstants#FEATURE_SECURE_PROCESSING} feature.
- * When the feature is:</p>
- * <ul>
- * <li>
- * <code>true</code>: the implementation will limit XML processing to conform to implementation limits.
- * Examples include enity expansion limits and XML Schema constructs that would consume large amounts of resources.
- * If XML processing is limited for security reasons, it will be reported via a call to the registered
- * {@link ErrorHandler#fatalError(SAXParseException exception)}.
- * See {@link #setErrorHandler(ErrorHandler errorHandler)}.
- * </li>
- * <li>
- * <code>false</code>: the implementation will processing XML according to the XML specifications without
- * regard to possible implementation limits.
- * </li>
- * </ul>
- *
- * @param name The feature name, which is a non-null fully-qualified URI.
- * @param value The requested value of the feature (true or false).
- *
- * @throws SAXNotRecognizedException If the feature
- * value can't be assigned or retrieved.
- * @throws SAXNotSupportedException When the
- * {@link SchemaFactory} recognizes the feature name but
- * cannot set the requested value.
- * @throws NullPointerException If <code>name</code> is <code>null</code>.
- *
- * @see #getFeature(String)
- */
- public void setFeature(String name, boolean value)
- throws SAXNotRecognizedException, SAXNotSupportedException {
-
- if (name == null) {
- throw new NullPointerException("the name parameter is null");
- }
- throw new SAXNotRecognizedException(name);
- }
-
- /**
- * Set the value of a property.
- *
- * <p>The property name is any fully-qualified URI. It is
- * possible for a {@link SchemaFactory} to recognize a property name but
- * to be unable to change the current value.</p>
- *
- * <p>
- * All implementations that implement JAXP 1.5 or newer are required to
- * support the {@link javax.xml.XMLConstants#ACCESS_EXTERNAL_DTD} and
- * {@link javax.xml.XMLConstants#ACCESS_EXTERNAL_SCHEMA} properties.
- * </p>
- * <ul>
- * <li>
- * <p>Access to external DTDs in Schema files is restricted to the protocols
- * specified by the {@link javax.xml.XMLConstants#ACCESS_EXTERNAL_DTD} property.
- * If access is denied during the creation of new Schema due to the restriction
- * of this property, {@link org.xml.sax.SAXException} will be thrown by the
- * {@link #newSchema(Source)} or {@link #newSchema(File)}
- * or {@link #newSchema(URL)} or or {@link #newSchema(Source[])} method.</p>
- *
- * <p>Access to external DTDs in xml source files is restricted to the protocols
- * specified by the {@link javax.xml.XMLConstants#ACCESS_EXTERNAL_DTD} property.
- * If access is denied during validation due to the restriction
- * of this property, {@link org.xml.sax.SAXException} will be thrown by the
- * {@link javax.xml.validation.Validator#validate(Source)} or
- * {@link javax.xml.validation.Validator#validate(Source, Result)} method.</p>
- *
- * <p>Access to external reference set by the schemaLocation attribute is
- * restricted to the protocols specified by the
- * {@link javax.xml.XMLConstants#ACCESS_EXTERNAL_SCHEMA} property.
- * If access is denied during validation due to the restriction of this property,
- * {@link org.xml.sax.SAXException} will be thrown by the
- * {@link javax.xml.validation.Validator#validate(Source)} or
- * {@link javax.xml.validation.Validator#validate(Source, Result)} method.</p>
- *
- * <p>Access to external reference set by the Import
- * and Include element is restricted to the protocols specified by the
- * {@link javax.xml.XMLConstants#ACCESS_EXTERNAL_SCHEMA} property.
- * If access is denied during the creation of new Schema due to the restriction
- * of this property, {@link org.xml.sax.SAXException} will be thrown by the
- * {@link #newSchema(Source)} or {@link #newSchema(File)}
- * or {@link #newSchema(URL)} or {@link #newSchema(Source[])} method.</p>
- * </li>
- * </ul>
- *
- * @param name The property name, which is a non-null fully-qualified URI.
- * @param object The requested value for the property.
- *
- * @throws SAXNotRecognizedException If the property
- * value can't be assigned or retrieved.
- * @throws SAXNotSupportedException When the
- * {@link SchemaFactory} recognizes the property name but
- * cannot set the requested value.
- * @throws NullPointerException If <code>name</code> is <code>null</code>.
- */
- public void setProperty(String name, Object object)
- throws SAXNotRecognizedException, SAXNotSupportedException {
-
- if (name == null) {
- throw new NullPointerException("the name parameter is null");
- }
- throw new SAXNotRecognizedException(name);
- }
-
- /**
- * Look up the value of a property.
- *
- * <p>The property name is any fully-qualified URI. It is
- * possible for a {@link SchemaFactory} to recognize a property name but
- * temporarily be unable to return its value.</p>
- *
- * <p>{@link SchemaFactory}s are not required to recognize any specific
- * property names.</p>
- *
- * <p>Implementors are free (and encouraged) to invent their own properties,
- * using names built on their own URIs.</p>
- *
- * @param name The property name, which is a non-null fully-qualified URI.
- *
- * @return The current value of the property.
- *
- * @throws SAXNotRecognizedException If the property
- * value can't be assigned or retrieved.
- * @throws SAXNotSupportedException When the
- * XMLReader recognizes the property name but
- * cannot determine its value at this time.
- * @throws NullPointerException If <code>name</code> is <code>null</code>.
- *
- * @see #setProperty(String, Object)
- */
- public Object getProperty(String name)
- throws SAXNotRecognizedException, SAXNotSupportedException {
-
- if (name == null) {
- throw new NullPointerException("the name parameter is null");
- }
- throw new SAXNotRecognizedException(name);
- }
-
- /**
- * Sets the {@link ErrorHandler} to receive errors encountered
- * during the <code>newSchema</code> method invocation.
- *
- * <p>
- * Error handler can be used to customize the error handling process
- * during schema parsing. When an {@link ErrorHandler} is set,
- * errors found during the parsing of schemas will be first sent
- * to the {@link ErrorHandler}.
- *
- * <p>
- * The error handler can abort the parsing of a schema immediately
- * by throwing {@link SAXException} from the handler. Or for example
- * it can print an error to the screen and try to continue the
- * processing by returning normally from the {@link ErrorHandler}
- *
- * <p>
- * If any {@link Throwable} (or instances of its derived classes)
- * is thrown from an {@link ErrorHandler},
- * the caller of the <code>newSchema</code> method will be thrown
- * the same {@link Throwable} object.
- *
- * <p>
- * {@link SchemaFactory} is not allowed to
- * throw {@link SAXException} without first reporting it to
- * {@link ErrorHandler}.
- *
- * <p>
- * Applications can call this method even during a {@link Schema}
- * is being parsed.
- *
- * <p>
- * When the {@link ErrorHandler} is null, the implementation will
- * behave as if the following {@link ErrorHandler} is set:
- * <pre>
- * class DraconianErrorHandler implements {@link ErrorHandler} {
- * public void fatalError( {@link org.xml.sax.SAXParseException} e ) throws {@link SAXException} {
- * throw e;
- * }
- * public void error( {@link org.xml.sax.SAXParseException} e ) throws {@link SAXException} {
- * throw e;
- * }
- * public void warning( {@link org.xml.sax.SAXParseException} e ) throws {@link SAXException} {
- * // noop
- * }
- * }
- * </pre>
- *
- * <p>
- * When a new {@link SchemaFactory} object is created, initially
- * this field is set to null. This field will <em>NOT</em> be
- * inherited to {@link Schema}s, {@link Validator}s, or
- * {@link ValidatorHandler}s that are created from this {@link SchemaFactory}.
- *
- * @param errorHandler A new error handler to be set.
- * This parameter can be <code>null</code>.
- */
- public abstract void setErrorHandler(ErrorHandler errorHandler);
-
- /**
- * Gets the current {@link ErrorHandler} set to this {@link SchemaFactory}.
- *
- * @return
- * This method returns the object that was last set through
- * the {@link #setErrorHandler(ErrorHandler)} method, or null
- * if that method has never been called since this {@link SchemaFactory}
- * has created.
- *
- * @see #setErrorHandler(ErrorHandler)
- */
- public abstract ErrorHandler getErrorHandler();
-
- /**
- * Sets the {@link LSResourceResolver} to customize
- * resource resolution when parsing schemas.
- *
- * <p>
- * {@link SchemaFactory} uses a {@link LSResourceResolver}
- * when it needs to locate external resources while parsing schemas,
- * although exactly what constitutes "locating external resources" is
- * up to each schema language. For example, for W3C XML Schema,
- * this includes files <code>&lt;include></code>d or <code>&lt;import></code>ed,
- * and DTD referenced from schema files, etc.
- *
- * <p>
- * Applications can call this method even during a {@link Schema}
- * is being parsed.
- *
- * <p>
- * When the {@link LSResourceResolver} is null, the implementation will
- * behave as if the following {@link LSResourceResolver} is set:
- * <pre>
- * class DumbDOMResourceResolver implements {@link LSResourceResolver} {
- * public {@link org.w3c.dom.ls.LSInput} resolveResource(
- * String publicId, String systemId, String baseURI) {
- *
- * return null; // always return null
- * }
- * }
- * </pre>
- *
- * <p>
- * If a {@link LSResourceResolver} throws a {@link RuntimeException}
- * (or instances of its derived classes),
- * then the {@link SchemaFactory} will abort the parsing and
- * the caller of the <code>newSchema</code> method will receive
- * the same {@link RuntimeException}.
- *
- * <p>
- * When a new {@link SchemaFactory} object is created, initially
- * this field is set to null. This field will <em>NOT</em> be
- * inherited to {@link Schema}s, {@link Validator}s, or
- * {@link ValidatorHandler}s that are created from this {@link SchemaFactory}.
- *
- * @param resourceResolver
- * A new resource resolver to be set. This parameter can be null.
- */
- public abstract void setResourceResolver(LSResourceResolver resourceResolver);
-
- /**
- * Gets the current {@link LSResourceResolver} set to this {@link SchemaFactory}.
- *
- * @return
- * This method returns the object that was last set through
- * the {@link #setResourceResolver(LSResourceResolver)} method, or null
- * if that method has never been called since this {@link SchemaFactory}
- * has created.
- *
- * @see #setErrorHandler(ErrorHandler)
- */
- public abstract LSResourceResolver getResourceResolver();
-
- /**
- * <p>Parses the specified source as a schema and returns it as a schema.</p>
- *
- * <p>This is a convenience method for {@link #newSchema(Source[] schemas)}.</p>
- *
- * @param schema Source that represents a schema.
- *
- * @return New <code>Schema</code> from parsing <code>schema</code>.
- *
- * @throws SAXException If a SAX error occurs during parsing.
- * @throws NullPointerException if <code>schema</code> is null.
- */
- public Schema newSchema(Source schema) throws SAXException {
- return newSchema(new Source[]{schema});
- }
-
- /**
- * <p>Parses the specified <code>File</code> as a schema and returns it as a <code>Schema</code>.</p>
- *
- * <p>This is a convenience method for {@link #newSchema(Source schema)}.</p>
- *
- * @param schema File that represents a schema.
- *
- * @return New <code>Schema</code> from parsing <code>schema</code>.
- *
- * @throws SAXException If a SAX error occurs during parsing.
- * @throws NullPointerException if <code>schema</code> is null.
- */
- public Schema newSchema(File schema) throws SAXException {
- return newSchema(new StreamSource(schema));
- }
-
- /**
- * <p>Parses the specified <code>URL</code> as a schema and returns it as a <code>Schema</code>.</p>
- *
- * <p>This is a convenience method for {@link #newSchema(Source schema)}.</p>
- *
- * @param schema <code>URL</code> that represents a schema.
- *
- * @return New <code>Schema</code> from parsing <code>schema</code>.
- *
- * @throws SAXException If a SAX error occurs during parsing.
- * @throws NullPointerException if <code>schema</code> is null.
- */
- public Schema newSchema(URL schema) throws SAXException {
- return newSchema(new StreamSource(schema.toExternalForm()));
- }
-
- /**
- * Parses the specified source(s) as a schema and returns it as a schema.
- *
- * <p>
- * The callee will read all the {@link Source}s and combine them into a
- * single schema. The exact semantics of the combination depends on the schema
- * language that this {@link SchemaFactory} object is created for.
- *
- * <p>
- * When an {@link ErrorHandler} is set, the callee will report all the errors
- * found in sources to the handler. If the handler throws an exception, it will
- * abort the schema compilation and the same exception will be thrown from
- * this method. Also, after an error is reported to a handler, the callee is allowed
- * to abort the further processing by throwing it. If an error handler is not set,
- * the callee will throw the first error it finds in the sources.
- *
- * <h2>W3C XML Schema 1.0</h2>
- * <p>
- * The resulting schema contains components from the specified sources.
- * The same result would be achieved if all these sources were
- * imported, using appropriate values for schemaLocation and namespace,
- * into a single schema document with a different targetNamespace
- * and no components of its own, if the import elements were given
- * in the same order as the sources. Section 4.2.3 of the XML Schema
- * recommendation describes the options processors have in this
- * regard. While a processor should be consistent in its treatment of
- * JAXP schema sources and XML Schema imports, the behaviour between
- * JAXP-compliant parsers may vary; in particular, parsers may choose
- * to ignore all but the first &lt;import> for a given namespace,
- * regardless of information provided in schemaLocation.
- *
- * <p>
- * If the parsed set of schemas includes error(s) as
- * specified in the section 5.1 of the XML Schema spec, then
- * the error must be reported to the {@link ErrorHandler}.
- *
- * <h2>RELAX NG</h2>
- *
- * <p>For RELAX NG, this method must throw {@link UnsupportedOperationException}
- * if <code>schemas.length!=1</code>.
- *
- *
- * @param schemas
- * inputs to be parsed. {@link SchemaFactory} is required
- * to recognize {@link javax.xml.transform.sax.SAXSource},
- * {@link StreamSource},
- * {@link javax.xml.transform.stax.StAXSource},
- * and {@link javax.xml.transform.dom.DOMSource}.
- * Input schemas must be XML documents or
- * XML elements and must not be null. For backwards compatibility,
- * the results of passing anything other than
- * a document or element are implementation-dependent.
- * Implementations must either recognize and process the input
- * or thrown an IllegalArgumentException.
- *
- * @return
- * Always return a non-null valid {@link Schema} object.
- * Note that when an error has been reported, there is no
- * guarantee that the returned {@link Schema} object is
- * meaningful.
- *
- * @throws SAXException
- * If an error is found during processing the specified inputs.
- * When an {@link ErrorHandler} is set, errors are reported to
- * there first. See {@link #setErrorHandler(ErrorHandler)}.
- * @throws NullPointerException
- * If the <code>schemas</code> parameter itself is null or
- * any item in the array is null.
- * @throws IllegalArgumentException
- * If any item in the array is not recognized by this method.
- * @throws UnsupportedOperationException
- * If the schema language doesn't support this operation.
- */
- public abstract Schema newSchema(Source[] schemas) throws SAXException;
-
- /**
- * Creates a special {@link Schema} object.
- *
- * <p>The exact semantics of the returned {@link Schema} object
- * depend on the schema language for which this {@link SchemaFactory}
- * is created.
- *
- * <p>Also, implementations are allowed to use implementation-specific
- * property/feature to alter the semantics of this method.</p>
- *
- * <p>Implementors and developers should pay particular attention
- * to how the features set on this {@link SchemaFactory} are
- * processed by this special {@link Schema}.
- * In some cases, for example, when the
- * {@link SchemaFactory} and the class actually loading the
- * schema come from different implementations, it may not be possible
- * for {@link SchemaFactory} features to be inherited automatically.
- * Developers should
- * make sure that features, such as secure processing, are explicitly
- * set in both places.</p>
- *
- * <h2>W3C XML Schema 1.0</h2>
- * <p>
- * For XML Schema, this method creates a {@link Schema} object that
- * performs validation by using location hints specified in documents.
- *
- * <p>
- * The returned {@link Schema} object assumes that if documents
- * refer to the same URL in the schema location hints,
- * they will always resolve to the same schema document. This
- * asusmption allows implementations to reuse parsed results of
- * schema documents so that multiple validations against the same
- * schema will run faster.
- *
- * <p>
- * Note that the use of schema location hints introduces a
- * vulnerability to denial-of-service attacks.
- *
- *
- * <h2>RELAX NG</h2>
- * <p>
- * RELAX NG does not support this operation.
- *
- * @return
- * Always return non-null valid {@link Schema} object.
- *
- * @throws UnsupportedOperationException
- * If this operation is not supported by the callee.
- * @throws SAXException
- * If this operation is supported but failed for some reason.
- */
- public abstract Schema newSchema() throws SAXException;
-}
diff --git a/src/javax/xml/validation/SchemaFactoryConfigurationError.java b/src/javax/xml/validation/SchemaFactoryConfigurationError.java
deleted file mode 100644
index 47c4dda..0000000
--- a/src/javax/xml/validation/SchemaFactoryConfigurationError.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.validation;
-
-/**
- * Thrown when a problem with configuration with the Schema Factories
- * exists. This error will typically be thrown when the class of a
- * schema factory specified in the system properties cannot be found
- * or instantiated.
- * @since 1.8
- */
-public final class SchemaFactoryConfigurationError extends Error {
-
- static final long serialVersionUID = 3531438703147750126L;
-
- /**
- * Create a new <code>SchemaFactoryConfigurationError</code> with no
- * detail message.
- */
- public SchemaFactoryConfigurationError() {
- }
-
-
- /**
- * Create a new <code>SchemaFactoryConfigurationError</code> with
- * the <code>String</code> specified as an error message.
- *
- * @param message The error message for the exception.
- */
- public SchemaFactoryConfigurationError(String message) {
- super(message);
- }
-
- /**
- * Create a new <code>SchemaFactoryConfigurationError</code> with the
- * given <code>Throwable</code> base cause.
- *
- * @param cause The exception or error to be encapsulated in a
- * SchemaFactoryConfigurationError.
- */
- public SchemaFactoryConfigurationError(Throwable cause) {
- super(cause);
- }
-
- /**
- * Create a new <code>SchemaFactoryConfigurationError</code> with the
- * given <code>Throwable</code> base cause and detail message.
- *
- * @param cause The exception or error to be encapsulated in a
- * SchemaFactoryConfigurationError.
- * @param message The detail message.
- */
- public SchemaFactoryConfigurationError(String message, Throwable cause) {
- super(message, cause);
- }
-
-}
diff --git a/src/javax/xml/validation/SchemaFactoryFinder.java b/src/javax/xml/validation/SchemaFactoryFinder.java
deleted file mode 100644
index 907e67a..0000000
--- a/src/javax/xml/validation/SchemaFactoryFinder.java
+++ /dev/null
@@ -1,448 +0,0 @@
-/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.validation;
-
-import java.io.File;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.net.URL;
-import java.security.AccessControlContext;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.Properties;
-import java.util.ServiceConfigurationError;
-import java.util.ServiceLoader;
-
-/**
- * Implementation of {@link SchemaFactory#newInstance(String)}.
- *
- * @author <a href="Kohsuke.Kawaguchi@Sun.com">Kohsuke Kawaguchi</a>
- * @version $Revision: 1.8 $, $Date: 2010-11-01 04:36:13 $
- * @since 1.5
- */
-class SchemaFactoryFinder {
-
- /** debug support code. */
- private static boolean debug = false;
- /**
- *<p> Take care of restrictions imposed by java security model </p>
- */
- private static final SecuritySupport ss = new SecuritySupport();
- private static final String DEFAULT_PACKAGE = "com.sun.org.apache.xerces.internal";
- /**
- * <p>Cache properties for performance.</p>
- */
- private static final Properties cacheProps = new Properties();
-
- /**
- * <p>First time requires initialization overhead.</p>
- */
- private static volatile boolean firstTime = true;
-
- static {
- // Use try/catch block to support applets
- try {
- debug = ss.getSystemProperty("jaxp.debug") != null;
- } catch (Exception unused) {
- debug = false;
- }
- }
-
- /**
- * <p>Conditional debug printing.</p>
- *
- * @param msg to print
- */
- private static void debugPrintln(String msg) {
- if (debug) {
- System.err.println("JAXP: " + msg);
- }
- }
-
- /**
- * <p><code>ClassLoader</code> to use to find <code>SchemaFactory</code>.</p>
- */
- private final ClassLoader classLoader;
-
- /**
- * <p>Constructor that specifies <code>ClassLoader</code> to use
- * to find <code>SchemaFactory</code>.</p>
- *
- * @param loader
- * to be used to load resource, {@link SchemaFactory}, and
- * {@link SchemaFactoryLoader} implementations during
- * the resolution process.
- * If this parameter is null, the default system class loader
- * will be used.
- */
- public SchemaFactoryFinder(ClassLoader loader) {
- this.classLoader = loader;
- if( debug ) {
- debugDisplayClassLoader();
- }
- }
-
- private void debugDisplayClassLoader() {
- try {
- if( classLoader == ss.getContextClassLoader() ) {
- debugPrintln("using thread context class loader ("+classLoader+") for search");
- return;
- }
- } catch( Throwable unused ) {
- // getContextClassLoader() undefined in JDK1.1
- }
-
- if( classLoader==ClassLoader.getSystemClassLoader() ) {
- debugPrintln("using system class loader ("+classLoader+") for search");
- return;
- }
-
- debugPrintln("using class loader ("+classLoader+") for search");
- }
-
- /**
- * <p>Creates a new {@link SchemaFactory} object for the specified
- * schema language.</p>
- *
- * @param schemaLanguage
- * See {@link SchemaFactory Schema Language} table in <code>SchemaFactory</code>
- * for the list of available schema languages.
- *
- * @return <code>null</code> if the callee fails to create one.
- *
- * @throws NullPointerException
- * If the <code>schemaLanguage</code> parameter is null.
- * @throws SchemaFactoryConfigurationError
- * If a configuration error is encountered.
- */
- public SchemaFactory newFactory(String schemaLanguage) {
- if(schemaLanguage==null) {
- throw new NullPointerException();
- }
- SchemaFactory f = _newFactory(schemaLanguage);
- if (f != null) {
- debugPrintln("factory '" + f.getClass().getName() + "' was found for " + schemaLanguage);
- } else {
- debugPrintln("unable to find a factory for " + schemaLanguage);
- }
- return f;
- }
-
- /**
- * <p>Lookup a <code>SchemaFactory</code> for the given <code>schemaLanguage</code>.</p>
- *
- * @param schemaLanguage Schema language to lookup <code>SchemaFactory</code> for.
- *
- * @return <code>SchemaFactory</code> for the given <code>schemaLanguage</code>.
- */
- private SchemaFactory _newFactory(String schemaLanguage) {
- SchemaFactory sf;
-
- String propertyName = SERVICE_CLASS.getName() + ":" + schemaLanguage;
-
- // system property look up
- try {
- debugPrintln("Looking up system property '"+propertyName+"'" );
- String r = ss.getSystemProperty(propertyName);
- if(r!=null) {
- debugPrintln("The value is '"+r+"'");
- sf = createInstance(r, true);
- if(sf!=null) return sf;
- } else
- debugPrintln("The property is undefined.");
- } catch( Throwable t ) {
- if( debug ) {
- debugPrintln("failed to look up system property '"+propertyName+"'" );
- t.printStackTrace();
- }
- }
-
- String javah = ss.getSystemProperty( "java.home" );
- String configFile = javah + File.separator +
- "lib" + File.separator + "jaxp.properties";
-
-
- // try to read from $java.home/lib/jaxp.properties
- try {
- if(firstTime){
- synchronized(cacheProps){
- if(firstTime){
- File f=new File( configFile );
- firstTime = false;
- if(ss.doesFileExist(f)){
- debugPrintln("Read properties file " + f);
- cacheProps.load(ss.getFileInputStream(f));
- }
- }
- }
- }
- final String factoryClassName = cacheProps.getProperty(propertyName);
- debugPrintln("found " + factoryClassName + " in $java.home/jaxp.properties");
-
- if (factoryClassName != null) {
- sf = createInstance(factoryClassName, true);
- if(sf != null){
- return sf;
- }
- }
- } catch (Exception ex) {
- if (debug) {
- ex.printStackTrace();
- }
- }
-
- // Try with ServiceLoader
- final SchemaFactory factoryImpl = findServiceProvider(schemaLanguage);
-
- // The following assertion should always be true.
- // Uncomment it, recompile, and run with -ea in case of doubts:
- // assert factoryImpl == null || factoryImpl.isSchemaLanguageSupported(schemaLanguage);
-
- if (factoryImpl != null) {
- return factoryImpl;
- }
-
- // platform default
- if(schemaLanguage.equals("http://www.w3.org/2001/XMLSchema")) {
- debugPrintln("attempting to use the platform default XML Schema validator");
- return createInstance("com.sun.org.apache.xerces.internal.jaxp.validation.XMLSchemaFactory", true);
- }
-
- debugPrintln("all things were tried, but none was found. bailing out.");
- return null;
- }
-
- /** <p>Create class using appropriate ClassLoader.</p>
- *
- * @param className Name of class to create.
- * @return Created class or <code>null</code>.
- */
- private Class<?> createClass(String className) {
- Class<?> clazz;
- // make sure we have access to restricted packages
- boolean internal = false;
- if (System.getSecurityManager() != null) {
- if (className != null && className.startsWith(DEFAULT_PACKAGE)) {
- internal = true;
- }
- }
-
- try {
- if (classLoader != null && !internal) {
- clazz = Class.forName(className, false, classLoader);
- } else {
- clazz = Class.forName(className);
- }
- } catch (Throwable t) {
- if(debug) {
- t.printStackTrace();
- }
- return null;
- }
-
- return clazz;
- }
-
- /**
- * <p>Creates an instance of the specified and returns it.</p>
- *
- * @param className
- * fully qualified class name to be instantiated.
- *
- * @return null
- * if it fails. Error messages will be printed by this method.
- */
- SchemaFactory createInstance( String className ) {
- return createInstance( className, false );
- }
-
- SchemaFactory createInstance( String className, boolean useServicesMechanism ) {
- SchemaFactory schemaFactory = null;
-
- debugPrintln("createInstance(" + className + ")");
-
- // get Class from className
- Class<?> clazz = createClass(className);
- if (clazz == null) {
- debugPrintln("failed to getClass(" + className + ")");
- return null;
- }
- debugPrintln("loaded " + className + " from " + which(clazz));
-
- // instantiate Class as a SchemaFactory
- try {
- if (!SchemaFactory.class.isAssignableFrom(clazz)) {
- throw new ClassCastException(clazz.getName()
- + " cannot be cast to " + SchemaFactory.class);
- }
- if (!useServicesMechanism) {
- schemaFactory = newInstanceNoServiceLoader(clazz);
- }
- if (schemaFactory == null) {
- schemaFactory = (SchemaFactory) clazz.newInstance();
- }
- } catch (ClassCastException classCastException) {
- debugPrintln("could not instantiate " + clazz.getName());
- if (debug) {
- classCastException.printStackTrace();
- }
- return null;
- } catch (IllegalAccessException illegalAccessException) {
- debugPrintln("could not instantiate " + clazz.getName());
- if (debug) {
- illegalAccessException.printStackTrace();
- }
- return null;
- } catch (InstantiationException instantiationException) {
- debugPrintln("could not instantiate " + clazz.getName());
- if (debug) {
- instantiationException.printStackTrace();
- }
- return null;
- }
-
- return schemaFactory;
- }
-
- /**
- * Try to construct using newXMLSchemaFactoryNoServiceLoader
- * method if available.
- */
- private static SchemaFactory newInstanceNoServiceLoader(
- Class<?> providerClass
- ) {
- // Retain maximum compatibility if no security manager.
- if (System.getSecurityManager() == null) {
- return null;
- }
- try {
- final Method creationMethod =
- providerClass.getDeclaredMethod(
- "newXMLSchemaFactoryNoServiceLoader"
- );
- final int modifiers = creationMethod.getModifiers();
-
- // Do not call the method if it's not public static.
- if (!Modifier.isStatic(modifiers) || !Modifier.isPublic(modifiers)) {
- return null;
- }
-
- // Only calls "newXMLSchemaFactoryNoServiceLoader" if it's
- // declared to return an instance of SchemaFactory.
- final Class<?> returnType = creationMethod.getReturnType();
- if (SERVICE_CLASS.isAssignableFrom(returnType)) {
- return SERVICE_CLASS.cast(creationMethod.invoke(null, (Object[])null));
- } else {
- // Should not happen since
- // XMLSchemaFactory.newXMLSchemaFactoryNoServiceLoader is
- // declared to return XMLSchemaFactory.
- throw new ClassCastException(returnType
- + " cannot be cast to " + SERVICE_CLASS);
- }
- } catch(ClassCastException e) {
- throw new SchemaFactoryConfigurationError(e.getMessage(), e);
- } catch (NoSuchMethodException exc) {
- return null;
- } catch (Exception exc) {
- return null;
- }
- }
-
- // Call isSchemaLanguageSupported with initial context.
- private boolean isSchemaLanguageSupportedBy(final SchemaFactory factory,
- final String schemaLanguage,
- AccessControlContext acc) {
- return AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
- public Boolean run() {
- return factory.isSchemaLanguageSupported(schemaLanguage);
- }
- }, acc);
- }
-
- /**
- * Finds a service provider subclass of SchemaFactory that supports the
- * given schema language using the ServiceLoader.
- *
- * @param schemaLanguage The schema language for which we seek a factory.
- * @return A SchemaFactory supporting the specified schema language, or null
- * if none is found.
- * @throws SchemaFactoryConfigurationError if a configuration error is found.
- */
- private SchemaFactory findServiceProvider(final String schemaLanguage) {
- assert schemaLanguage != null;
- // store current context.
- final AccessControlContext acc = AccessController.getContext();
- try {
- return AccessController.doPrivileged(new PrivilegedAction<SchemaFactory>() {
- public SchemaFactory run() {
- final ServiceLoader<SchemaFactory> loader =
- ServiceLoader.load(SERVICE_CLASS);
- for (SchemaFactory factory : loader) {
- // restore initial context to call
- // factory.isSchemaLanguageSupported
- if (isSchemaLanguageSupportedBy(factory, schemaLanguage, acc)) {
- return factory;
- }
- }
- return null; // no factory found.
- }
- });
- } catch (ServiceConfigurationError error) {
- throw new SchemaFactoryConfigurationError(
- "Provider for " + SERVICE_CLASS + " cannot be created", error);
- }
- }
-
- private static final Class<SchemaFactory> SERVICE_CLASS = SchemaFactory.class;
-
-
- private static String which( Class<?> clazz ) {
- return which( clazz.getName(), clazz.getClassLoader() );
- }
-
- /**
- * <p>Search the specified classloader for the given classname.</p>
- *
- * @param classname the fully qualified name of the class to search for
- * @param loader the classloader to search
- *
- * @return the source location of the resource, or null if it wasn't found
- */
- private static String which(String classname, ClassLoader loader) {
-
- String classnameAsResource = classname.replace('.', '/') + ".class";
-
- if( loader==null ) loader = ClassLoader.getSystemClassLoader();
-
- //URL it = loader.getResource(classnameAsResource);
- URL it = ss.getResourceAsURL(loader, classnameAsResource);
- if (it != null) {
- return it.toString();
- } else {
- return null;
- }
- }
-}
diff --git a/src/javax/xml/validation/SchemaFactoryLoader.java b/src/javax/xml/validation/SchemaFactoryLoader.java
deleted file mode 100644
index f617d99..0000000
--- a/src/javax/xml/validation/SchemaFactoryLoader.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.validation;
-
-/**
- * <p>Factory that creates {@link SchemaFactory}.</p>
- *
- * <p><b>DO NOT USE THIS CLASS</b></p>
- *
- * <p>
- * This class was introduced as a part of an early proposal during the
- * JSR-206 standardization process. The proposal was eventually abandoned
- * but this class accidentally remained in the source tree, and made its
- * way into the final version.
- * </p><p>
- * This class does not participate in any JAXP 1.3 or JAXP 1.4 processing.
- * It must not be used by users or JAXP implementations.
- * </p>
- *
- * @author <a href="Kohsuke.Kawaguchi@Sun.com">Kohsuke Kawaguchi</a>
- * @since 1.5
- */
-public abstract class SchemaFactoryLoader {
-
- /**
- * A do-nothing constructor.
- */
- protected SchemaFactoryLoader() {
- }
-
- /**
- * Creates a new {@link SchemaFactory} object for the specified
- * schema language.
- *
- * @param schemaLanguage
- * See <a href="SchemaFactory.html#schemaLanguage">
- * the list of available schema languages</a>.
- *
- * @throws NullPointerException
- * If the <tt>schemaLanguage</tt> parameter is null.
- *
- * @return <code>null</code> if the callee fails to create one.
- */
- public abstract SchemaFactory newFactory(String schemaLanguage);
-}
diff --git a/src/javax/xml/validation/SecuritySupport.java b/src/javax/xml/validation/SecuritySupport.java
deleted file mode 100644
index e11ff64..0000000
--- a/src/javax/xml/validation/SecuritySupport.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.validation;
-
-import java.io.IOException;
-import java.net.URL;
-import java.security.*;
-import java.net.*;
-import java.io.*;
-import java.util.*;
-
-/**
- * This class is duplicated for each JAXP subpackage so keep it in sync.
- * It is package private and therefore is not exposed as part of the JAXP
- * API.
- *
- * Security related methods that only work on J2SE 1.2 and newer.
- */
-class SecuritySupport {
-
-
- ClassLoader getContextClassLoader() {
- return (ClassLoader)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- ClassLoader cl = null;
- //try {
- cl = Thread.currentThread().getContextClassLoader();
- //} catch (SecurityException ex) { }
- if (cl == null)
- cl = ClassLoader.getSystemClassLoader();
- return cl;
- }
- });
- }
-
- String getSystemProperty(final String propName) {
- return (String)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return System.getProperty(propName);
- }
- });
- }
-
- FileInputStream getFileInputStream(final File file)
- throws FileNotFoundException
- {
- try {
- return (FileInputStream)
- AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws FileNotFoundException {
- return new FileInputStream(file);
- }
- });
- } catch (PrivilegedActionException e) {
- throw (FileNotFoundException)e.getException();
- }
- }
-
- InputStream getURLInputStream(final URL url)
- throws IOException
- {
- try {
- return (InputStream)
- AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws IOException {
- return url.openStream();
- }
- });
- } catch (PrivilegedActionException e) {
- throw (IOException)e.getException();
- }
- }
-
- URL getResourceAsURL(final ClassLoader cl,
- final String name)
- {
- return (URL)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- URL url;
- if (cl == null) {
- url = Object.class.getResource(name);
- } else {
- url = cl.getResource(name);
- }
- return url;
- }
- });
- }
-
- Enumeration getResources(final ClassLoader cl,
- final String name) throws IOException
- {
- try{
- return (Enumeration)
- AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws IOException{
- Enumeration enumeration;
- if (cl == null) {
- enumeration = ClassLoader.getSystemResources(name);
- } else {
- enumeration = cl.getResources(name);
- }
- return enumeration;
- }
- });
- }catch(PrivilegedActionException e){
- throw (IOException)e.getException();
- }
- }
-
- InputStream getResourceAsStream(final ClassLoader cl,
- final String name)
- {
- return (InputStream)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- InputStream ris;
- if (cl == null) {
- ris = Object.class.getResourceAsStream(name);
- } else {
- ris = cl.getResourceAsStream(name);
- }
- return ris;
- }
- });
- }
-
- boolean doesFileExist(final File f) {
- return ((Boolean)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return new Boolean(f.exists());
- }
- })).booleanValue();
- }
-
-}
diff --git a/src/javax/xml/validation/TypeInfoProvider.java b/src/javax/xml/validation/TypeInfoProvider.java
deleted file mode 100644
index 6b4c7b4..0000000
--- a/src/javax/xml/validation/TypeInfoProvider.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.validation;
-
-import org.w3c.dom.TypeInfo;
-
-/**
- * This class provides access to the type information determined
- * by {@link ValidatorHandler}.
- *
- * <p>
- * Some schema languages, such as W3C XML Schema, encourages a validator
- * to report the "type" it assigns to each attribute/element.
- * Those applications who wish to access this type information can invoke
- * methods defined on this "interface" to access such type information.
- *
- * <p>
- * Implementation of this "interface" can be obtained through the
- * {@link ValidatorHandler#getTypeInfoProvider()} method.
- *
- * @author <a href="mailto:Kohsuke.Kawaguchi@Sun.com">Kohsuke Kawaguchi</a>
- * @see org.w3c.dom.TypeInfo
- * @since 1.5
- */
-public abstract class TypeInfoProvider {
-
- /**
- * Constructor for the derived class.
- *
- * <p>
- * The constructor does nothing.
- */
- protected TypeInfoProvider() {
- }
-
- /**
- * <p>Returns the immutable {@link TypeInfo} object for the current
- * element.</p>
- *
- * <p>The method may only be called by the startElement event
- * or the endElement event
- * of the {@link org.xml.sax.ContentHandler} that the application sets to
- * the {@link ValidatorHandler}.</p>
- *
- * <p>When W3C XML Schema validation is being performed, in the
- * case where an element has a union type, the {@link TypeInfo}
- * returned by a call to <code>getElementTypeInfo()</code> from the
- * startElement
- * event will be the union type. The <code>TypeInfo</code>
- * returned by a call
- * from the endElement event will be the actual member type used
- * to validate the element.</p>
- *
- * @throws IllegalStateException
- * If this method is called from other {@link org.xml.sax.ContentHandler}
- * methods.
- * @return
- * An immutable {@link TypeInfo} object that represents the
- * type of the current element.
- * Note that the caller can keep references to the obtained
- * {@link TypeInfo} longer than the callback scope.
- *
- * Otherwise, this method returns
- * null if the validator is unable to
- * determine the type of the current element for some reason
- * (for example, if the validator is recovering from
- * an earlier error.)
- *
- */
- public abstract TypeInfo getElementTypeInfo();
-
- /**
- * Returns the immutable {@link TypeInfo} object for the specified
- * attribute of the current element.
- *
- * <p>
- * The method may only be called by the startElement event of
- * the {@link org.xml.sax.ContentHandler} that the application sets to the
- * {@link ValidatorHandler}.</p>
- *
- * @param index
- * The index of the attribute. The same index for
- * the {@link org.xml.sax.Attributes} object passed to the
- * <code>startElement</code> callback.
- *
- * @throws IndexOutOfBoundsException
- * If the index is invalid.
- * @throws IllegalStateException
- * If this method is called from other {@link org.xml.sax.ContentHandler}
- * methods.
- *
- * @return
- * An immutable {@link TypeInfo} object that represents the
- * type of the specified attribute.
- * Note that the caller can keep references to the obtained
- * {@link TypeInfo} longer than the callback scope.
- *
- * Otherwise, this method returns
- * null if the validator is unable to
- * determine the type.
- */
- public abstract TypeInfo getAttributeTypeInfo(int index);
-
- /**
- * Returns <code>true</code> if the specified attribute is determined
- * to be ID.
- *
- * <p>
- * Exacly how an attribute is "determined to be ID" is up to the
- * schema language. In case of W3C XML Schema, this means
- * that the actual type of the attribute is the built-in ID type
- * or its derived type.
- *
- * <p>
- * A {@link javax.xml.parsers.DocumentBuilder} uses this information
- * to properly implement {@link org.w3c.dom.Attr#isId()}.
- *
- * <p>
- * The method may only be called by the startElement event of
- * the {@link org.xml.sax.ContentHandler} that the application sets to the
- * {@link ValidatorHandler}.
- *
- * @param index
- * The index of the attribute. The same index for
- * the {@link org.xml.sax.Attributes} object passed to the
- * <code>startElement</code> callback.
- *
- * @throws IndexOutOfBoundsException
- * If the index is invalid.
- * @throws IllegalStateException
- * If this method is called from other {@link org.xml.sax.ContentHandler}
- * methods.
- *
- * @return true
- * if the type of the specified attribute is ID.
- */
- public abstract boolean isIdAttribute(int index);
-
- /**
- * Returns <code>false</code> if the attribute was added by the validator.
- *
- * <p>
- * This method provides information necessary for
- * a {@link javax.xml.parsers.DocumentBuilder} to determine what
- * the DOM tree should return from the {@link org.w3c.dom.Attr#getSpecified()} method.
- *
- * <p>
- * The method may only be called by the startElement event of
- * the {@link org.xml.sax.ContentHandler} that the application sets to the
- * {@link ValidatorHandler}.
- *
- * <p>
- * A general guideline for validators is to return true if
- * the attribute was originally present in the pipeline, and
- * false if it was added by the validator.
- *
- * @param index
- * The index of the attribute. The same index for
- * the {@link org.xml.sax.Attributes} object passed to the
- * <code>startElement</code> callback.
- *
- * @throws IndexOutOfBoundsException
- * If the index is invalid.
- * @throws IllegalStateException
- * If this method is called from other {@link org.xml.sax.ContentHandler}
- * methods.
- *
- * @return
- * <code>true</code> if the attribute was present before the validator
- * processes input. <code>false</code> if the attribute was added
- * by the validator.
- */
- public abstract boolean isSpecified(int index);
-}
diff --git a/src/javax/xml/validation/Validator.java b/src/javax/xml/validation/Validator.java
deleted file mode 100644
index 4983e03..0000000
--- a/src/javax/xml/validation/Validator.java
+++ /dev/null
@@ -1,524 +0,0 @@
-/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.validation;
-
-import java.io.IOException;
-
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-
-import org.w3c.dom.ls.LSResourceResolver;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
-
-/**
- * <p>A processor that checks an XML document against {@link Schema}.</p>
- *
- * <p>
- * A validator object is not thread-safe and not reentrant.
- * In other words, it is the application's responsibility to make
- * sure that one {@link Validator} object is not used from
- * more than one thread at any given time, and while the <code>validate</code>
- * method is invoked, applications may not recursively call
- * the <code>validate</code> method.
- * <p>
- *
- *
- * @author <a href="mailto:Kohsuke.Kawaguchi@Sun.com">Kohsuke Kawaguchi</a>
- * @since 1.5
- */
-public abstract class Validator {
-
- /**
- * Constructor for derived classes.
- *
- * <p>The constructor does nothing.</p>
- *
- * <p>Derived classes must create {@link Validator} objects that have
- * <code>null</code> {@link ErrorHandler} and
- * <code>null</code> {@link LSResourceResolver}.
- * </p>
- */
- protected Validator() {
- }
-
- /**
- * <p>Reset this <code>Validator</code> to its original configuration.</p>
- *
- * <p><code>Validator</code> is reset to the same state as when it was created with
- * {@link Schema#newValidator()}.
- * <code>reset()</code> is designed to allow the reuse of existing <code>Validator</code>s
- * thus saving resources associated with the creation of new <code>Validator</code>s.</p>
- *
- * <p>The reset <code>Validator</code> is not guaranteed to have the same {@link LSResourceResolver} or {@link ErrorHandler}
- * <code>Object</code>s, e.g. {@link Object#equals(Object obj)}. It is guaranteed to have a functionally equal
- * <code>LSResourceResolver</code> and <code>ErrorHandler</code>.</p>
- */
- public abstract void reset();
-
- /**
- * Validates the specified input.
- *
- * <p>This is just a convenience method for
- * {@link #validate(Source source, Result result)}
- * with <code>result</code> of <code>null</code>.</p>
- *
- * @param source
- * XML to be validated. Must be an XML document or
- * XML element and must not be null. For backwards compatibility,
- * the results of attempting to validate anything other than
- * a document or element are implementation-dependent.
- * Implementations must either recognize and process the input
- * or throw an IllegalArgumentException.
- *
- * @throws IllegalArgumentException
- * If the <code>Source</code>
- * is an XML artifact that the implementation cannot
- * validate (for example, a processing instruction).
- *
- * @throws SAXException
- * If the {@link ErrorHandler} throws a {@link SAXException} or
- * if a fatal error is found and the {@link ErrorHandler} returns
- * normally.
- *
- * @throws IOException
- * If the validator is processing a
- * {@link javax.xml.transform.sax.SAXSource} and the
- * underlying {@link org.xml.sax.XMLReader} throws an
- * {@link IOException}.
- *
- *
- * @throws NullPointerException If <code>source</code> is
- * <code>null</code>.
- *
- * @see #validate(Source source, Result result)
- */
- public void validate(Source source)
- throws SAXException, IOException {
-
- validate(source, null);
- }
-
- /**
- * <p>Validates the specified input and send the augmented validation
- * result to the specified output.</p>
- *
- * <p>This method places the following restrictions on the types of
- * the {@link Source}/{@link Result} accepted.</p>
- *
- * <table border=1>
- * <thead>
- * <tr>
- * <th colspan="5"><code>Source</code> / <code>Result</code> Accepted</th>
- * </tr>
- * <tr>
- * <th></th>
- * <th>{@link javax.xml.transform.stream.StreamSource}</th>
- * <th>{@link javax.xml.transform.sax.SAXSource}</th>
- * <th>{@link javax.xml.transform.dom.DOMSource}</th>
- * <th>{@link javax.xml.transform.stax.StAXSource}</th>
- * </tr>
- * </thead>
- * <tbody align="center">
- * <tr>
- * <td><code>null</code></td>
- * <td>OK</td>
- * <td>OK</td>
- * <td>OK</td>
- * <td>OK</td>
- * </tr>
- * <tr>
- * <th>{@link javax.xml.transform.stream.StreamResult}</th>
- * <td>OK</td>
- * <td><code>IllegalArgumentException</code></td>
- * <td><code>IllegalArgumentException</code></td>
- * <td><code>IllegalArgumentException</code></td>
- * </tr>
- * <tr>
- * <th>{@link javax.xml.transform.sax.SAXResult}</th>
- * <td><code>IllegalArgumentException</code></td>
- * <td>OK</td>
- * <td><code>IllegalArgumentException</code></td>
- * <td><code>IllegalArgumentException</code></td>
- * </tr>
- * <tr>
- * <th>{@link javax.xml.transform.dom.DOMResult}</th>
- * <td><code>IllegalArgumentException</code></td>
- * <td><code>IllegalArgumentException</code></td>
- * <td>OK</td>
- * <td><code>IllegalArgumentException</code></td>
- * </tr>
- * <tr>
- * <th>{@link javax.xml.transform.stax.StAXResult}</th>
- * <td><code>IllegalArgumentException</code></td>
- * <td><code>IllegalArgumentException</code></td>
- * <td><code>IllegalArgumentException</code></td>
- * <td>OK</td>
- * </tr>
- * </tbody>
- * </table>
- *
- * <p>To validate one <code>Source</code> into another kind of
- * <code>Result</code>, use the identity transformer (see
- * {@link javax.xml.transform.TransformerFactory#newTransformer()}).</p>
- *
- * <p>Errors found during the validation is sent to the specified
- * {@link ErrorHandler}.</p>
- *
- * <p>If a document is valid, or if a document contains some errors
- * but none of them were fatal and the <code>ErrorHandler</code> didn't
- * throw any exception, then the method returns normally.</p>
- *
- * @param source
- * XML to be validated. Must be an XML document or
- * XML element and must not be null. For backwards compatibility,
- * the results of attempting to validate anything other than
- * a document or element are implementation-dependent.
- * Implementations must either recognize and process the input
- * or throw an IllegalArgumentException.
- *
- * @param result
- * The <code>Result</code> object that receives (possibly augmented)
- * XML. This parameter can be null if the caller is not interested
- * in it.
- *
- * Note that when a <code>DOMResult</code> is used,
- * a validator might just pass the same DOM node from
- * <code>DOMSource</code> to <code>DOMResult</code>
- * (in which case <code>source.getNode()==result.getNode()</code>),
- * it might copy the entire DOM tree, or it might alter the
- * node given by the source.
- *
- * @throws IllegalArgumentException
- * If the <code>Result</code> type doesn't match the
- * <code>Source</code> type of if the <code>Source</code>
- * is an XML artifact that the implementation cannot
- * validate (for example, a processing instruction).
- * @throws SAXException
- * If the <code>ErrorHandler</code> throws a
- * <code>SAXException</code> or
- * if a fatal error is found and the <code>ErrorHandler</code> returns
- * normally.
- * @throws IOException
- * If the validator is processing a
- * <code>SAXSource</code> and the
- * underlying {@link org.xml.sax.XMLReader} throws an
- * <code>IOException</code>.
- * @throws NullPointerException
- * If the <code>source</code> parameter is <code>null</code>.
- *
- * @see #validate(Source source)
- */
- public abstract void validate(Source source, Result result)
- throws SAXException, IOException;
-
- /**
- * Sets the {@link ErrorHandler} to receive errors encountered
- * during the <code>validate</code> method invocation.
- *
- * <p>
- * Error handler can be used to customize the error handling process
- * during a validation. When an {@link ErrorHandler} is set,
- * errors found during the validation will be first sent
- * to the {@link ErrorHandler}.
- *
- * <p>
- * The error handler can abort further validation immediately
- * by throwing {@link SAXException} from the handler. Or for example
- * it can print an error to the screen and try to continue the
- * validation by returning normally from the {@link ErrorHandler}
- *
- * <p>
- * If any {@link Throwable} is thrown from an {@link ErrorHandler},
- * the caller of the <code>validate</code> method will be thrown
- * the same {@link Throwable} object.
- *
- * <p>
- * {@link Validator} is not allowed to
- * throw {@link SAXException} without first reporting it to
- * {@link ErrorHandler}.
- *
- * <p>
- * When the {@link ErrorHandler} is null, the implementation will
- * behave as if the following {@link ErrorHandler} is set:
- * <pre>
- * class DraconianErrorHandler implements {@link ErrorHandler} {
- * public void fatalError( {@link org.xml.sax.SAXParseException} e ) throws {@link SAXException} {
- * throw e;
- * }
- * public void error( {@link org.xml.sax.SAXParseException} e ) throws {@link SAXException} {
- * throw e;
- * }
- * public void warning( {@link org.xml.sax.SAXParseException} e ) throws {@link SAXException} {
- * // noop
- * }
- * }
- * </pre>
- *
- * <p>
- * When a new {@link Validator} object is created, initially
- * this field is set to null.
- *
- * @param errorHandler
- * A new error handler to be set. This parameter can be null.
- */
- public abstract void setErrorHandler(ErrorHandler errorHandler);
-
- /**
- * Gets the current {@link ErrorHandler} set to this {@link Validator}.
- *
- * @return
- * This method returns the object that was last set through
- * the {@link #setErrorHandler(ErrorHandler)} method, or null
- * if that method has never been called since this {@link Validator}
- * has created.
- *
- * @see #setErrorHandler(ErrorHandler)
- */
- public abstract ErrorHandler getErrorHandler();
-
- /**
- * Sets the {@link LSResourceResolver} to customize
- * resource resolution while in a validation episode.
- *
- * <p>
- * {@link Validator} uses a {@link LSResourceResolver}
- * when it needs to locate external resources while a validation,
- * although exactly what constitutes "locating external resources" is
- * up to each schema language.
- *
- * <p>
- * When the {@link LSResourceResolver} is null, the implementation will
- * behave as if the following {@link LSResourceResolver} is set:
- * <pre>
- * class DumbLSResourceResolver implements {@link LSResourceResolver} {
- * public {@link org.w3c.dom.ls.LSInput} resolveResource(
- * String publicId, String systemId, String baseURI) {
- *
- * return null; // always return null
- * }
- * }
- * </pre>
- *
- * <p>
- * If a {@link LSResourceResolver} throws a {@link RuntimeException}
- * (or instances of its derived classes),
- * then the {@link Validator} will abort the parsing and
- * the caller of the <code>validate</code> method will receive
- * the same {@link RuntimeException}.
- *
- * <p>
- * When a new {@link Validator} object is created, initially
- * this field is set to null.
- *
- * @param resourceResolver
- * A new resource resolver to be set. This parameter can be null.
- */
- public abstract void setResourceResolver(LSResourceResolver resourceResolver);
-
- /**
- * Gets the current {@link LSResourceResolver} set to this {@link Validator}.
- *
- * @return
- * This method returns the object that was last set through
- * the {@link #setResourceResolver(LSResourceResolver)} method, or null
- * if that method has never been called since this {@link Validator}
- * has created.
- *
- * @see #setErrorHandler(ErrorHandler)
- */
- public abstract LSResourceResolver getResourceResolver();
-
-
-
- /**
- * Look up the value of a feature flag.
- *
- * <p>The feature name is any fully-qualified URI. It is
- * possible for a {@link Validator} to recognize a feature name but
- * temporarily be unable to return its value.
- * Some feature values may be available only in specific
- * contexts, such as before, during, or after a validation.
- *
- * <p>Implementors are free (and encouraged) to invent their own features,
- * using names built on their own URIs.</p>
- *
- * @param name The feature name, which is a non-null fully-qualified URI.
- *
- * @return The current value of the feature (true or false).
- *
- * @throws SAXNotRecognizedException If the feature
- * value can't be assigned or retrieved.
- * @throws SAXNotSupportedException When the
- * {@link Validator} recognizes the feature name but
- * cannot determine its value at this time.
- * @throws NullPointerException
- * When the name parameter is null.
- *
- * @see #setFeature(String, boolean)
- */
- public boolean getFeature(String name)
- throws SAXNotRecognizedException, SAXNotSupportedException {
-
- if (name == null) {
- throw new NullPointerException("the name parameter is null");
- }
-
- throw new SAXNotRecognizedException(name);
- }
-
- /**
- * Set the value of a feature flag.
- *
- * <p>
- * Feature can be used to control the way a {@link Validator}
- * parses schemas, although {@link Validator}s are not required
- * to recognize any specific feature names.</p>
- *
- * <p>The feature name is any fully-qualified URI. It is
- * possible for a {@link Validator} to expose a feature value but
- * to be unable to change the current value.
- * Some feature values may be immutable or mutable only
- * in specific contexts, such as before, during, or after
- * a validation.</p>
- *
- * @param name The feature name, which is a non-null fully-qualified URI.
- * @param value The requested value of the feature (true or false).
- *
- * @throws SAXNotRecognizedException If the feature
- * value can't be assigned or retrieved.
- * @throws SAXNotSupportedException When the
- * {@link Validator} recognizes the feature name but
- * cannot set the requested value.
- * @throws NullPointerException
- * When the name parameter is null.
- *
- * @see #getFeature(String)
- */
- public void setFeature(String name, boolean value)
- throws SAXNotRecognizedException, SAXNotSupportedException {
-
- if (name == null) {
- throw new NullPointerException("the name parameter is null");
- }
-
- throw new SAXNotRecognizedException(name);
- }
-
- /**
- * Set the value of a property.
- *
- * <p>The property name is any fully-qualified URI. It is
- * possible for a {@link Validator} to recognize a property name but
- * to be unable to change the current value.
- * Some property values may be immutable or mutable only
- * in specific contexts, such as before, during, or after
- * a validation.</p>
- *
- * <p>
- * All implementations that implement JAXP 1.5 or newer are required to
- * support the {@link javax.xml.XMLConstants#ACCESS_EXTERNAL_DTD} and
- * {@link javax.xml.XMLConstants#ACCESS_EXTERNAL_SCHEMA} properties.
- * </p>
- * <ul>
- * <li>
- * <p>Access to external DTDs in source or Schema file is restricted to
- * the protocols specified by the {@link javax.xml.XMLConstants#ACCESS_EXTERNAL_DTD}
- * property. If access is denied during validation due to the restriction
- * of this property, {@link org.xml.sax.SAXException} will be thrown by the
- * {@link #validate(Source)} method.</p>
- *
- * <p>Access to external reference set by the schemaLocation attribute is
- * restricted to the protocols specified by the
- * {@link javax.xml.XMLConstants#ACCESS_EXTERNAL_SCHEMA} property.
- * If access is denied during validation due to the restriction of this property,
- * {@link org.xml.sax.SAXException} will be thrown by the
- * {@link #validate(Source)} method.</p>
- * </li>
- * </ul>
- *
- * @param name The property name, which is a non-null fully-qualified URI.
- * @param object The requested value for the property.
- *
- * @throws SAXNotRecognizedException If the property
- * value can't be assigned or retrieved.
- * @throws SAXNotSupportedException When the
- * {@link Validator} recognizes the property name but
- * cannot set the requested value.
- * @throws NullPointerException
- * When the name parameter is null.
- */
- public void setProperty(String name, Object object)
- throws SAXNotRecognizedException, SAXNotSupportedException {
-
- if (name == null) {
- throw new NullPointerException("the name parameter is null");
- }
-
- throw new SAXNotRecognizedException(name);
- }
-
- /**
- * Look up the value of a property.
- *
- * <p>The property name is any fully-qualified URI. It is
- * possible for a {@link Validator} to recognize a property name but
- * temporarily be unable to return its value.
- * Some property values may be available only in specific
- * contexts, such as before, during, or after a validation.</p>
- *
- * <p>{@link Validator}s are not required to recognize any specific
- * property names.</p>
- *
- * <p>Implementors are free (and encouraged) to invent their own properties,
- * using names built on their own URIs.</p>
- *
- * @param name The property name, which is a non-null fully-qualified URI.
- *
- * @return The current value of the property.
- *
- * @throws SAXNotRecognizedException If the property
- * value can't be assigned or retrieved.
- * @throws SAXNotSupportedException When the
- * XMLReader recognizes the property name but
- * cannot determine its value at this time.
- * @throws NullPointerException
- * When the name parameter is null.
- *
- * @see #setProperty(String, Object)
- */
- public Object getProperty(String name)
- throws SAXNotRecognizedException, SAXNotSupportedException {
-
- if (name == null) {
- throw new NullPointerException("the name parameter is null");
- }
-
- throw new SAXNotRecognizedException(name);
- }
-}
diff --git a/src/javax/xml/validation/ValidatorHandler.java b/src/javax/xml/validation/ValidatorHandler.java
deleted file mode 100644
index 2aa2cc1..0000000
--- a/src/javax/xml/validation/ValidatorHandler.java
+++ /dev/null
@@ -1,485 +0,0 @@
-/*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.validation;
-
-import org.w3c.dom.ls.LSResourceResolver;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
-
-/**
- * Streaming validator that works on SAX stream.
- *
- * <p>
- * A {@link ValidatorHandler} object is not thread-safe and not reentrant.
- * In other words, it is the application's responsibility to make
- * sure that one {@link ValidatorHandler} object is not used from
- * more than one thread at any given time.
- *
- * <p>
- * {@link ValidatorHandler} checks if the SAX events follow
- * the set of constraints described in the associated {@link Schema},
- * and additionally it may modify the SAX events (for example
- * by adding default values, etc.)
- *
- * <p>
- * {@link ValidatorHandler} extends from {@link ContentHandler},
- * but it refines the underlying {@link ContentHandler} in
- * the following way:
- * <ol>
- * <li>startElement/endElement events must receive non-null String
- * for <code>uri</code>, <code>localName</code>, and <code>qname</code>,
- * even though SAX allows some of them to be null.
- * Similarly, the user-specified {@link ContentHandler} will receive non-null
- * Strings for all three parameters.
- *
- * <li>Applications must ensure that {@link ValidatorHandler}'s
- * {@link ContentHandler#startPrefixMapping(String,String)} and
- * {@link ContentHandler#endPrefixMapping(String)} are invoked
- * properly. Similarly, the user-specified {@link ContentHandler}
- * will receive startPrefixMapping/endPrefixMapping events.
- * If the {@link ValidatorHandler} introduces additional namespace
- * bindings, the user-specified {@link ContentHandler} will receive
- * additional startPrefixMapping/endPrefixMapping events.
- *
- * <li>{@link org.xml.sax.Attributes} for the
- * {@link ContentHandler#startElement(String,String,String,Attributes)} method
- * may or may not include xmlns* attributes.
- * </ol>
- *
- * <p>
- * A {@link ValidatorHandler} is automatically reset every time
- * the startDocument method is invoked.
- *
- * <h2>Recognized Properties and Features</h2>
- * <p>
- * This spec defines the following feature that must be recognized
- * by all {@link ValidatorHandler} implementations.
- *
- * <h3><code>http://xml.org/sax/features/namespace-prefixes</code></h3>
- * <p>
- * This feature controls how a {@link ValidatorHandler} introduces
- * namespace bindings that were not present in the original SAX event
- * stream.
- * When this feature is set to true, it must make
- * sure that the user's {@link ContentHandler} will see
- * the corresponding <code>xmlns*</code> attribute in
- * the {@link org.xml.sax.Attributes} object of the
- * {@link ContentHandler#startElement(String,String,String,Attributes)}
- * callback. Otherwise, <code>xmlns*</code> attributes must not be
- * added to {@link org.xml.sax.Attributes} that's passed to the
- * user-specified {@link ContentHandler}.
- * <p>
- * (Note that regardless of this switch, namespace bindings are
- * always notified to applications through
- * {@link ContentHandler#startPrefixMapping(String,String)} and
- * {@link ContentHandler#endPrefixMapping(String)} methods of the
- * {@link ContentHandler} specified by the user.)
- *
- * <p>
- * Note that this feature does <em>NOT</em> affect the way
- * a {@link ValidatorHandler} receives SAX events. It merely
- * changes the way it augments SAX events.
- *
- * <p>This feature is set to <code>false</code> by default.</p>
- *
- * @author <a href="mailto:Kohsuke.Kawaguchi@Sun.com">Kohsuke Kawaguchi</a>
- * @since 1.5
- */
-public abstract class ValidatorHandler implements ContentHandler {
-
- /**
- * <p>Constructor for derived classes.</p>
- *
- * <p>The constructor does nothing.</p>
- *
- * <p>Derived classes must create {@link ValidatorHandler} objects that have
- * <code>null</code> {@link ErrorHandler} and
- * <code>null</code> {@link LSResourceResolver}.</p>
- */
- protected ValidatorHandler() {
- }
-
- /**
- * Sets the {@link ContentHandler} which receives
- * the augmented validation result.
- *
- * <p>
- * When a {@link ContentHandler} is specified, a
- * {@link ValidatorHandler} will work as a filter
- * and basically copy the incoming events to the
- * specified {@link ContentHandler}.
- *
- * <p>
- * In doing so, a {@link ValidatorHandler} may modify
- * the events, for example by adding defaulted attributes.
- *
- * <p>
- * A {@link ValidatorHandler} may buffer events to certain
- * extent, but to allow {@link ValidatorHandler} to be used
- * by a parser, the following requirement has to be met.
- *
- * <ol>
- * <li>When
- * {@link ContentHandler#startElement(String, String, String, Attributes)},
- * {@link ContentHandler#endElement(String, String, String)},
- * {@link ContentHandler#startDocument()}, or
- * {@link ContentHandler#endDocument()}
- * are invoked on a {@link ValidatorHandler},
- * the same method on the user-specified {@link ContentHandler}
- * must be invoked for the same event before the callback
- * returns.
- * <li>{@link ValidatorHandler} may not introduce new elements that
- * were not present in the input.
- *
- * <li>{@link ValidatorHandler} may not remove attributes that were
- * present in the input.
- * </ol>
- *
- * <p>
- * When a callback method on the specified {@link ContentHandler}
- * throws an exception, the same exception object must be thrown
- * from the {@link ValidatorHandler}. The {@link ErrorHandler}
- * should not be notified of such an exception.
- *
- * <p>
- * This method can be called even during a middle of a validation.
- *
- * @param receiver
- * A {@link ContentHandler} or a null value.
- */
- public abstract void setContentHandler(ContentHandler receiver);
-
- /**
- * Gets the {@link ContentHandler} which receives the
- * augmented validation result.
- *
- * @return
- * This method returns the object that was last set through
- * the {@link #getContentHandler()} method, or null
- * if that method has never been called since this {@link ValidatorHandler}
- * has created.
- *
- * @see #setContentHandler(ContentHandler)
- */
- public abstract ContentHandler getContentHandler();
-
- /**
- * Sets the {@link ErrorHandler} to receive errors encountered
- * during the validation.
- *
- * <p>
- * Error handler can be used to customize the error handling process
- * during a validation. When an {@link ErrorHandler} is set,
- * errors found during the validation will be first sent
- * to the {@link ErrorHandler}.
- *
- * <p>
- * The error handler can abort further validation immediately
- * by throwing {@link org.xml.sax.SAXException} from the handler. Or for example
- * it can print an error to the screen and try to continue the
- * validation by returning normally from the {@link ErrorHandler}
- *
- * <p>
- * If any {@link Throwable} is thrown from an {@link ErrorHandler},
- * the same {@link Throwable} object will be thrown toward the
- * root of the call stack.
- *
- * <p>
- * {@link ValidatorHandler} is not allowed to
- * throw {@link org.xml.sax.SAXException} without first reporting it to
- * {@link ErrorHandler}.
- *
- * <p>
- * When the {@link ErrorHandler} is null, the implementation will
- * behave as if the following {@link ErrorHandler} is set:
- * <pre>
- * class DraconianErrorHandler implements {@link ErrorHandler} {
- * public void fatalError( {@link org.xml.sax.SAXParseException} e ) throws {@link org.xml.sax.SAXException} {
- * throw e;
- * }
- * public void error( {@link org.xml.sax.SAXParseException} e ) throws {@link org.xml.sax.SAXException} {
- * throw e;
- * }
- * public void warning( {@link org.xml.sax.SAXParseException} e ) throws {@link org.xml.sax.SAXException} {
- * // noop
- * }
- * }
- * </pre>
- *
- * <p>
- * When a new {@link ValidatorHandler} object is created, initially
- * this field is set to null.
- *
- * @param errorHandler
- * A new error handler to be set. This parameter can be null.
- */
- public abstract void setErrorHandler(ErrorHandler errorHandler);
-
- /**
- * Gets the current {@link ErrorHandler} set to this {@link ValidatorHandler}.
- *
- * @return
- * This method returns the object that was last set through
- * the {@link #setErrorHandler(ErrorHandler)} method, or null
- * if that method has never been called since this {@link ValidatorHandler}
- * has created.
- *
- * @see #setErrorHandler(ErrorHandler)
- */
- public abstract ErrorHandler getErrorHandler();
-
- /**
- * Sets the {@link LSResourceResolver} to customize
- * resource resolution while in a validation episode.
- *
- * <p>
- * {@link ValidatorHandler} uses a {@link LSResourceResolver}
- * when it needs to locate external resources while a validation,
- * although exactly what constitutes "locating external resources" is
- * up to each schema language.
- *
- * <p>
- * When the {@link LSResourceResolver} is null, the implementation will
- * behave as if the following {@link LSResourceResolver} is set:
- * <pre>
- * class DumbLSResourceResolver implements {@link LSResourceResolver} {
- * public {@link org.w3c.dom.ls.LSInput} resolveResource(
- * String publicId, String systemId, String baseURI) {
- *
- * return null; // always return null
- * }
- * }
- * </pre>
- *
- * <p>
- * If a {@link LSResourceResolver} throws a {@link RuntimeException}
- * (or instances of its derived classes),
- * then the {@link ValidatorHandler} will abort the parsing and
- * the caller of the <code>validate</code> method will receive
- * the same {@link RuntimeException}.
- *
- * <p>
- * When a new {@link ValidatorHandler} object is created, initially
- * this field is set to null.
- *
- * @param resourceResolver
- * A new resource resolver to be set. This parameter can be null.
- */
- public abstract void setResourceResolver(LSResourceResolver resourceResolver);
-
- /**
- * Gets the current {@link LSResourceResolver} set to this {@link ValidatorHandler}.
- *
- * @return
- * This method returns the object that was last set through
- * the {@link #setResourceResolver(LSResourceResolver)} method, or null
- * if that method has never been called since this {@link ValidatorHandler}
- * has created.
- *
- * @see #setErrorHandler(ErrorHandler)
- */
- public abstract LSResourceResolver getResourceResolver();
-
- /**
- * Obtains the {@link TypeInfoProvider} implementation of this
- * {@link ValidatorHandler}.
- *
- * <p>
- * The obtained {@link TypeInfoProvider} can be queried during a parse
- * to access the type information determined by the validator.
- *
- * <p>
- * Some schema languages do not define the notion of type,
- * for those languages, this method may not be supported.
- * However, to be compliant with this specification, implementations
- * for W3C XML Schema 1.0 must support this operation.
- *
- * @return
- * null if the validator / schema language does not support
- * the notion of {@link org.w3c.dom.TypeInfo}.
- * Otherwise a non-null valid {@link TypeInfoProvider}.
- */
- public abstract TypeInfoProvider getTypeInfoProvider();
-
-
- /**
- * Look up the value of a feature flag.
- *
- * <p>The feature name is any fully-qualified URI. It is
- * possible for a {@link ValidatorHandler} to recognize a feature name but
- * temporarily be unable to return its value.
- * Some feature values may be available only in specific
- * contexts, such as before, during, or after a validation.
- *
- * <p>Implementors are free (and encouraged) to invent their own features,
- * using names built on their own URIs.</p>
- *
- * @param name The feature name, which is a non-null fully-qualified URI.
- *
- * @return The current value of the feature (true or false).
- *
- * @throws SAXNotRecognizedException If the feature
- * value can't be assigned or retrieved.
- * @throws SAXNotSupportedException When the
- * {@link ValidatorHandler} recognizes the feature name but
- * cannot determine its value at this time.
- * @throws NullPointerException When <code>name</code> is <code>null</code>.
- *
- * @see #setFeature(String, boolean)
- */
- public boolean getFeature(String name)
- throws SAXNotRecognizedException, SAXNotSupportedException {
-
- if (name == null) {
- throw new NullPointerException();
- }
-
- throw new SAXNotRecognizedException(name);
- }
-
- /**
- * <p>Set a feature for this <code>ValidatorHandler</code>.</p>
- *
- * <p>Feature can be used to control the way a
- * {@link ValidatorHandler} parses schemas. The feature name is
- * any fully-qualified URI. It is possible for a
- * {@link SchemaFactory} to
- * expose a feature value but to be unable to change the current
- * value. Some feature values may be immutable or mutable only in
- * specific contexts, such as before, during, or after a
- * validation.</p>
- *
- * <p>All implementations are required to support the {@link javax.xml.XMLConstants#FEATURE_SECURE_PROCESSING} feature.
- * When the feature is:</p>
- * <ul>
- * <li>
- * <code>true</code>: the implementation will limit XML processing to conform to implementation limits.
- * Examples include enity expansion limits and XML Schema constructs that would consume large amounts of resources.
- * If XML processing is limited for security reasons, it will be reported via a call to the registered
- * {@link ErrorHandler#fatalError(SAXParseException exception)}.
- * See {@link #setErrorHandler(ErrorHandler errorHandler)}.
- * </li>
- * <li>
- * <code>false</code>: the implementation will processing XML according to the XML specifications without
- * regard to possible implementation limits.
- * </li>
- * </ul>
- *
- * @param name The feature name, which is a non-null fully-qualified URI.
- * @param value The requested value of the feature (true or false).
- *
- * @throws SAXNotRecognizedException If the feature
- * value can't be assigned or retrieved.
- * @throws SAXNotSupportedException When the
- * {@link ValidatorHandler} recognizes the feature name but
- * cannot set the requested value.
- * @throws NullPointerException When <code>name</code> is <code>null</code>.
- *
- * @see #getFeature(String)
- */
- public void setFeature(String name, boolean value)
- throws SAXNotRecognizedException, SAXNotSupportedException {
-
- if (name == null) {
- throw new NullPointerException();
- }
-
- throw new SAXNotRecognizedException(name);
- }
-
- /**
- * Set the value of a property.
- *
- * <p>The property name is any fully-qualified URI. It is
- * possible for a {@link ValidatorHandler} to recognize a property name but
- * to be unable to change the current value.
- * Some property values may be immutable or mutable only
- * in specific contexts, such as before, during, or after
- * a validation.</p>
- *
- * <p>{@link ValidatorHandler}s are not required to recognize setting
- * any specific property names.</p>
- *
- * @param name The property name, which is a non-null fully-qualified URI.
- * @param object The requested value for the property.
- *
- * @throws SAXNotRecognizedException If the property
- * value can't be assigned or retrieved.
- * @throws SAXNotSupportedException When the
- * {@link ValidatorHandler} recognizes the property name but
- * cannot set the requested value.
- * @throws NullPointerException When <code>name</code> is <code>null</code>.
- */
- public void setProperty(String name, Object object)
- throws SAXNotRecognizedException, SAXNotSupportedException {
-
- if (name == null) {
- throw new NullPointerException();
- }
-
- throw new SAXNotRecognizedException(name);
- }
-
- /**
- * Look up the value of a property.
- *
- * <p>The property name is any fully-qualified URI. It is
- * possible for a {@link ValidatorHandler} to recognize a property name but
- * temporarily be unable to return its value.
- * Some property values may be available only in specific
- * contexts, such as before, during, or after a validation.</p>
- *
- * <p>{@link ValidatorHandler}s are not required to recognize any specific
- * property names.</p>
- *
- * <p>Implementors are free (and encouraged) to invent their own properties,
- * using names built on their own URIs.</p>
- *
- * @param name The property name, which is a non-null fully-qualified URI.
- *
- * @return The current value of the property.
- *
- * @throws SAXNotRecognizedException If the property
- * value can't be assigned or retrieved.
- * @throws SAXNotSupportedException When the
- * XMLReader recognizes the property name but
- * cannot determine its value at this time.
- * @throws NullPointerException When <code>name</code> is <code>null</code>.
- *
- * @see #setProperty(String, Object)
- */
- public Object getProperty(String name)
- throws SAXNotRecognizedException, SAXNotSupportedException {
-
- if (name == null) {
- throw new NullPointerException();
- }
-
- throw new SAXNotRecognizedException(name);
- }
-}
diff --git a/src/javax/xml/validation/package.html b/src/javax/xml/validation/package.html
deleted file mode 100644
index 2dd06b3..0000000
--- a/src/javax/xml/validation/package.html
+++ /dev/null
@@ -1,124 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation. Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-
-<!DOCTYPE html
- PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml">
-
-<head>
- <title>javax.xml.validation</title>
-
- <meta name="CVS"
- content="$Id: package.html,v 1.2 2005/06/10 03:50:43 jeffsuttor Exp $" />
- <meta name="AUTHOR"
- content="Jeff.Suttor@Sun.com" />
-</head>
- <body>
- <p>
- This package provides an API for validation of XML documents. <em>Validation</em> is the process of verifying
- that an XML document is an instance of a specified XML <em>schema</em>. An XML schema defines the
- content model (also called a <em>grammar</em> or <em>vocabulary</em>) that its instance documents
- will represent.
- </p>
- <p>
- There are a number of popular technologies available for creating an XML schema. Some of the most
- popular include:
- </p>
- <ul>
- <li><strong>Document Type Definition (DTD)</strong> - XML's built-in schema language.</li>
- <li><strong><a href="http://www.w3.org/XML/Schema">W3C XML Schema (WXS)</a></strong> - an object-oriented XML schema
- language. WXS also provides a type system for constraining the character data of an XML document.
- WXS is maintained by the <a href="http://www.w3.org">World Wide Web Consortium (W3C)</a> and is a W3C
- Recommendation (that is, a ratified W3C standard specification).</li>
- <li><strong><a href="http://www.relaxng.org">RELAX NG (RNG)</a></strong> - a pattern-based,
- user-friendly XML schema language. RNG schemas may also use types to constrain XML character data.
- RNG is maintained by the <a href="http://www.oasis-open.org">Organization for the Advancement of
- Structured Information Standards (OASIS)</a> and is both an OASIS and an
- <a href="http://www.iso.org">ISO (International Organization for Standardization)</a> standard.</li>
- <li><strong><a href="http://www.schematron.com/">Schematron</a></strong> - a rules-based XML schema
- language. Whereas DTD, WXS, and RNG are designed to express the structure of a content model,
- Schematron is designed to enforce individual rules that are difficult or impossible to express
- with other schema languages. Schematron is intended to supplement a schema written in
- structural schema language such as the aforementioned. Schematron is in the process
- of becoming an ISO standard.</li>
- </ul>
- <p>
- Previous versions of JAXP supported validation as a feature of an XML parser, represented by
- either a {@link javax.xml.parsers.SAXParser} or {@link javax.xml.parsers.DocumentBuilder} instance.
- </p>
- <p>
- The JAXP validation API decouples the validation of an instance document from the parsing of an
- XML document. This is advantageous for several reasons, some of which are:
- </p>
- <ul>
- <li><strong>Support for additional schema langauges.</strong> As of JDK 1.5, the two most
- popular JAXP parser implementations, Crimson and Xerces, only support a subset of the available
- XML schema languages. The Validation API provides a standard mechanism through which applications
- may take of advantage of specialization validation libraries which support additional schema
- languages.</li>
- <li><strong>Easy runtime coupling of an XML instance and schema.</strong> Specifying the location
- of a schema to use for validation with JAXP parsers can be confusing. The Validation API makes this
- process simple (see <a href="#example-1">example</a> below).</li>
- </ul>
- <p>
- <a name="example-1"><strong>Usage example</strong>.</a> The following example demonstrates validating
- an XML document with the Validation API (for readability, some exception handling is not shown):
- </p>
- <pre>
-
- // parse an XML document into a DOM tree
- DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
- Document document = parser.parse(new File("instance.xml"));
-
- // create a SchemaFactory capable of understanding WXS schemas
- SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
-
- // load a WXS schema, represented by a Schema instance
- Source schemaFile = new StreamSource(new File("mySchema.xsd"));
- Schema schema = factory.newSchema(schemaFile);
-
- // create a Validator instance, which can be used to validate an instance document
- Validator validator = schema.newValidator();
-
- // validate the DOM tree
- try {
- validator.validate(new DOMSource(document));
- } catch (SAXException e) {
- // instance document is invalid!
- }
-</pre>
- <p>
- The JAXP parsing API has been integrated with the Validation API. Applications may create a {@link javax.xml.validation.Schema} with the validation API
- and associate it with a {@link javax.xml.parsers.DocumentBuilderFactory} or a {@link javax.xml.parsers.SAXParserFactory} instance
- by using the {@link javax.xml.parsers.DocumentBuilderFactory#setSchema(Schema)} and {@link javax.xml.parsers.SAXParserFactory#setSchema(Schema)}
- methods. <strong>You should not</strong> both set a schema and call <code>setValidating(true)</code> on a parser factory. The former technique
- will cause parsers to use the new validation API; the latter will cause parsers to use their own internal validation
- facilities. <strong>Turning on both of these options simultaneously will cause either redundant behavior or error conditions.</strong>
- </p>
- </body>
-</html>
diff --git a/src/javax/xml/xpath/SecuritySupport.java b/src/javax/xml/xpath/SecuritySupport.java
deleted file mode 100644
index 5859c95..0000000
--- a/src/javax/xml/xpath/SecuritySupport.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.xpath;
-
-import java.net.URL;
-import java.security.*;
-import java.net.*;
-import java.io.*;
-import java.util.*;
-
-/**
- * This class is duplicated for each JAXP subpackage so keep it in sync.
- * It is package private and therefore is not exposed as part of the JAXP
- * API.
- *
- * Security related methods that only work on J2SE 1.2 and newer.
- */
-class SecuritySupport {
-
-
- ClassLoader getContextClassLoader() {
- return (ClassLoader)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- ClassLoader cl = null;
- try {
- cl = Thread.currentThread().getContextClassLoader();
- } catch (SecurityException ex) { }
- return cl;
- }
- });
- }
-
- String getSystemProperty(final String propName) {
- return (String)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return System.getProperty(propName);
- }
- });
- }
-
- FileInputStream getFileInputStream(final File file)
- throws FileNotFoundException
- {
- try {
- return (FileInputStream)
- AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws FileNotFoundException {
- return new FileInputStream(file);
- }
- });
- } catch (PrivilegedActionException e) {
- throw (FileNotFoundException)e.getException();
- }
- }
-
- InputStream getURLInputStream(final URL url)
- throws IOException
- {
- try {
- return (InputStream)
- AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws IOException {
- return url.openStream();
- }
- });
- } catch (PrivilegedActionException e) {
- throw (IOException)e.getException();
- }
- }
-
- URL getResourceAsURL(final ClassLoader cl,
- final String name)
- {
- return (URL)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- URL url;
- if (cl == null) {
- url = Object.class.getResource(name);
- } else {
- url = cl.getResource(name);
- }
- return url;
- }
- });
- }
-
- Enumeration getResources(final ClassLoader cl,
- final String name) throws IOException
- {
- try{
- return (Enumeration)
- AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws IOException{
- Enumeration enumeration;
- if (cl == null) {
- enumeration = ClassLoader.getSystemResources(name);
- } else {
- enumeration = cl.getResources(name);
- }
- return enumeration;
- }
- });
- }catch(PrivilegedActionException e){
- throw (IOException)e.getException();
- }
- }
-
- InputStream getResourceAsStream(final ClassLoader cl,
- final String name)
- {
- return (InputStream)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- InputStream ris;
- if (cl == null) {
- ris = Object.class.getResourceAsStream(name);
- } else {
- ris = cl.getResourceAsStream(name);
- }
- return ris;
- }
- });
- }
-
- boolean doesFileExist(final File f) {
- return ((Boolean)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return new Boolean(f.exists());
- }
- })).booleanValue();
- }
-
-}
diff --git a/src/javax/xml/xpath/XPath.java b/src/javax/xml/xpath/XPath.java
deleted file mode 100644
index 90ba4fe..0000000
--- a/src/javax/xml/xpath/XPath.java
+++ /dev/null
@@ -1,319 +0,0 @@
-/*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.xpath;
-
-import org.xml.sax.InputSource;
-import javax.xml.namespace.QName;
-import javax.xml.namespace.NamespaceContext;
-
-/**
- * <p><code>XPath</code> provides access to the XPath evaluation environment and expressions.</p>
- *
- * <a name="XPath-evaluation"/>
- * <table border="1" cellpadding="2">
- * <thead>
- * <tr>
- * <th colspan="2">Evaluation of XPath Expressions.</th>
- * </tr>
- * </thead>
- * <tbody>
- * <tr>
- * <td>context</td>
- * <td>
- * If a request is made to evaluate the expression in the absence
- * of a context item, an empty document node will be used for the context.
- * For the purposes of evaluating XPath expressions, a DocumentFragment
- * is treated like a Document node.
- * </td>
- * </tr>
- * <tr>
- * <td>variables</td>
- * <td>
- * If the expression contains a variable reference, its value will be found through the {@link XPathVariableResolver}
- * set with {@link #setXPathVariableResolver(XPathVariableResolver resolver)}.
- * An {@link XPathExpressionException} is raised if the variable resolver is undefined or
- * the resolver returns <code>null</code> for the variable.
- * The value of a variable must be immutable through the course of any single evaluation.</p>
- * </td>
- * </tr>
- * <tr>
- * <td>functions</td>
- * <td>
- * If the expression contains a function reference, the function will be found through the {@link XPathFunctionResolver}
- * set with {@link #setXPathFunctionResolver(XPathFunctionResolver resolver)}.
- * An {@link XPathExpressionException} is raised if the function resolver is undefined or
- * the function resolver returns <code>null</code> for the function.</p>
- * </td>
- * </tr>
- * <tr>
- * <td>QNames</td>
- * <td>
- * QNames in the expression are resolved against the XPath namespace context
- * set with {@link #setNamespaceContext(NamespaceContext nsContext)}.
- * </td>
- * </tr>
- * <tr>
- * <td>result</td>
- * <td>
- * This result of evaluating an expression is converted to an instance of the desired return type.
- * Valid return types are defined in {@link XPathConstants}.
- * Conversion to the return type follows XPath conversion rules.</p>
- * </td>
- * </tr>
- * </table>
- *
- * <p>An XPath object is not thread-safe and not reentrant.
- * In other words, it is the application's responsibility to make
- * sure that one {@link XPath} object is not used from
- * more than one thread at any given time, and while the <code>evaluate</code>
- * method is invoked, applications may not recursively call
- * the <code>evaluate</code> method.
- * <p>
- *
- * @author <a href="Norman.Walsh@Sun.com">Norman Walsh</a>
- * @author <a href="Jeff.Suttor@Sun.com">Jeff Suttor</a>
- * @see <a href="http://www.w3.org/TR/xpath">XML Path Language (XPath) Version 1.0</a>
- * @since 1.5
- */
-public interface XPath {
-
- /**
- * <p>Reset this <code>XPath</code> to its original configuration.</p>
- *
- * <p><code>XPath</code> is reset to the same state as when it was created with
- * {@link XPathFactory#newXPath()}.
- * <code>reset()</code> is designed to allow the reuse of existing <code>XPath</code>s
- * thus saving resources associated with the creation of new <code>XPath</code>s.</p>
- *
- * <p>The reset <code>XPath</code> is not guaranteed to have the same {@link XPathFunctionResolver}, {@link XPathVariableResolver}
- * or {@link NamespaceContext} <code>Object</code>s, e.g. {@link Object#equals(Object obj)}.
- * It is guaranteed to have a functionally equal <code>XPathFunctionResolver</code>, <code>XPathVariableResolver</code>
- * and <code>NamespaceContext</code>.</p>
- */
- public void reset();
-
- /**
- * <p>Establish a variable resolver.</p>
- *
- * <p>A <code>NullPointerException</code> is thrown if <code>resolver</code> is <code>null</code>.</p>
- *
- * @param resolver Variable resolver.
- *
- * @throws NullPointerException If <code>resolver</code> is <code>null</code>.
- */
- public void setXPathVariableResolver(XPathVariableResolver resolver);
-
- /**
- * <p>Return the current variable resolver.</p>
- *
- * <p><code>null</code> is returned in no variable resolver is in effect.</p>
- *
- * @return Current variable resolver.
- */
- public XPathVariableResolver getXPathVariableResolver();
-
- /**
- * <p>Establish a function resolver.</p>
- *
- * <p>A <code>NullPointerException</code> is thrown if <code>resolver</code> is <code>null</code>.</p>
- *
- * @param resolver XPath function resolver.
- *
- * @throws NullPointerException If <code>resolver</code> is <code>null</code>.
- */
- public void setXPathFunctionResolver(XPathFunctionResolver resolver);
-
- /**
- * <p>Return the current function resolver.</p>
- *
- * <p><code>null</code> is returned in no function resolver is in effect.</p>
- *
- * @return Current function resolver.
- */
- public XPathFunctionResolver getXPathFunctionResolver();
-
- /**
- * <p>Establish a namespace context.</p>
- *
- * <p>A <code>NullPointerException</code> is thrown if <code>nsContext</code> is <code>null</code>.</p>
- *
- * @param nsContext Namespace context to use.
- *
- * @throws NullPointerException If <code>nsContext</code> is <code>null</code>.
- */
- public void setNamespaceContext(NamespaceContext nsContext);
-
- /**
- * <p>Return the current namespace context.</p>
- *
- * <p><code>null</code> is returned in no namespace context is in effect.</p>
- *
- * @return Current Namespace context.
- */
- public NamespaceContext getNamespaceContext();
-
- /**
- * <p>Compile an XPath expression for later evaluation.</p>
- *
- * <p>If <code>expression</code> contains any {@link XPathFunction}s,
- * they must be available via the {@link XPathFunctionResolver}.
- * An {@link XPathExpressionException} will be thrown if the
- * <code>XPathFunction</code>
- * cannot be resovled with the <code>XPathFunctionResolver</code>.</p>
- *
- * <p>If <code>expression</code> contains any variables, the
- * {@link XPathVariableResolver} in effect
- * <strong>at compile time</strong> will be used to resolve them.</p>
- *
- * <p>If <code>expression</code> is <code>null</code>, a <code>NullPointerException</code> is thrown.</p>
- *
- * @param expression The XPath expression.
- *
- * @return Compiled XPath expression.
-
- * @throws XPathExpressionException If <code>expression</code> cannot be compiled.
- * @throws NullPointerException If <code>expression</code> is <code>null</code>.
- */
- public XPathExpression compile(String expression)
- throws XPathExpressionException;
-
- /**
- * <p>Evaluate an <code>XPath</code> expression in the specified context and return the result as the specified type.</p>
- *
- * <p>See <a href="#XPath-evaluation">Evaluation of XPath Expressions</a> for context item evaluation,
- * variable, function and <code>QName</code> resolution and return type conversion.</p>
- *
- * <p>If <code>returnType</code> is not one of the types defined in {@link XPathConstants} (
- * {@link XPathConstants#NUMBER NUMBER},
- * {@link XPathConstants#STRING STRING},
- * {@link XPathConstants#BOOLEAN BOOLEAN},
- * {@link XPathConstants#NODE NODE} or
- * {@link XPathConstants#NODESET NODESET})
- * then an <code>IllegalArgumentException</code> is thrown.</p>
- *
- * <p>If a <code>null</code> value is provided for
- * <code>item</code>, an empty document will be used for the
- * context.
- * If <code>expression</code> or <code>returnType</code> is <code>null</code>, then a
- * <code>NullPointerException</code> is thrown.</p>
- *
- * @param expression The XPath expression.
- * @param item The starting context (a node, for example).
- * @param returnType The desired return type.
- *
- * @return Result of evaluating an XPath expression as an <code>Object</code> of <code>returnType</code>.
- *
- * @throws XPathExpressionException If <code>expression</code> cannot be evaluated.
- * @throws IllegalArgumentException If <code>returnType</code> is not one of the types defined in {@link XPathConstants}.
- * @throws NullPointerException If <code>expression</code> or <code>returnType</code> is <code>null</code>.
- */
- public Object evaluate(String expression, Object item, QName returnType)
- throws XPathExpressionException;
-
- /**
- * <p>Evaluate an XPath expression in the specified context and return the result as a <code>String</code>.</p>
- *
- * <p>This method calls {@link #evaluate(String expression, Object item, QName returnType)} with a <code>returnType</code> of
- * {@link XPathConstants#STRING}.</p>
- *
- * <p>See <a href="#XPath-evaluation">Evaluation of XPath Expressions</a> for context item evaluation,
- * variable, function and QName resolution and return type conversion.</p>
- *
- * <p>If a <code>null</code> value is provided for
- * <code>item</code>, an empty document will be used for the
- * context.
- * If <code>expression</code> is <code>null</code>, then a <code>NullPointerException</code> is thrown.</p>
- *
- * @param expression The XPath expression.
- * @param item The starting context (a node, for example).
- *
- * @return The <code>String</code> that is the result of evaluating the expression and
- * converting the result to a <code>String</code>.
- *
- * @throws XPathExpressionException If <code>expression</code> cannot be evaluated.
- * @throws NullPointerException If <code>expression</code> is <code>null</code>.
- */
- public String evaluate(String expression, Object item)
- throws XPathExpressionException;
-
- /**
- * <p>Evaluate an XPath expression in the context of the specified <code>InputSource</code>
- * and return the result as the specified type.</p>
- *
- * <p>This method builds a data model for the {@link InputSource} and calls
- * {@link #evaluate(String expression, Object item, QName returnType)} on the resulting document object.</p>
- *
- * <p>See <a href="#XPath-evaluation">Evaluation of XPath Expressions</a> for context item evaluation,
- * variable, function and QName resolution and return type conversion.</p>
- *
- * <p>If <code>returnType</code> is not one of the types defined in {@link XPathConstants},
- * then an <code>IllegalArgumentException</code> is thrown.</p>
- *
- * <p>If <code>expression</code>, <code>source</code> or <code>returnType</code> is <code>null</code>,
- * then a <code>NullPointerException</code> is thrown.</p>
- *
- * @param expression The XPath expression.
- * @param source The input source of the document to evaluate over.
- * @param returnType The desired return type.
- *
- * @return The <code>Object</code> that encapsulates the result of evaluating the expression.
- *
- * @throws XPathExpressionException If expression cannot be evaluated.
- * @throws IllegalArgumentException If <code>returnType</code> is not one of the types defined in {@link XPathConstants}.
- * @throws NullPointerException If <code>expression</code>, <code>source</code> or <code>returnType</code>
- * is <code>null</code>.
- */
- public Object evaluate(
- String expression,
- InputSource source,
- QName returnType)
- throws XPathExpressionException;
-
- /**
- * <p>Evaluate an XPath expression in the context of the specified <code>InputSource</code>
- * and return the result as a <code>String</code>.</p>
- *
- * <p>This method calls {@link #evaluate(String expression, InputSource source, QName returnType)} with a
- * <code>returnType</code> of {@link XPathConstants#STRING}.</p>
- *
- * <p>See <a href="#XPath-evaluation">Evaluation of XPath Expressions</a> for context item evaluation,
- * variable, function and QName resolution and return type conversion.</p>
- *
- * <p>If <code>expression</code> or <code>source</code> is <code>null</code>,
- * then a <code>NullPointerException</code> is thrown.</p>
- *
- * @param expression The XPath expression.
- * @param source The <code>InputSource</code> of the document to evaluate over.
- *
- * @return The <code>String</code> that is the result of evaluating the expression and
- * converting the result to a <code>String</code>.
- *
- * @throws XPathExpressionException If expression cannot be evaluated.
- * @throws NullPointerException If <code>expression</code> or <code>source</code> is <code>null</code>.
- */
- public String evaluate(String expression, InputSource source)
- throws XPathExpressionException;
-}
diff --git a/src/javax/xml/xpath/XPathConstants.java b/src/javax/xml/xpath/XPathConstants.java
deleted file mode 100644
index 205e041..0000000
--- a/src/javax/xml/xpath/XPathConstants.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.xpath;
-
-import javax.xml.namespace.QName;
-
-/**
- * <p>XPath constants.</p>
- *
- * @author <a href="mailto:Norman.Walsh@Sun.COM">Norman Walsh</a>
- * @author <a href="mailto:Jeff.Suttor@Sun.COM">Jeff Suttor</a>
- * @see <a href="http://www.w3.org/TR/xpath">XML Path Language (XPath) Version 1.0</a>
- * @since 1.5
- */
-public class XPathConstants {
-
- /**
- * <p>Private constructor to prevent instantiation.</p>
- */
- private XPathConstants() { }
-
- /**
- * <p>The XPath 1.0 number data type.</p>
- *
- * <p>Maps to Java {@link Double}.</p>
- */
- public static final QName NUMBER = new QName("http://www.w3.org/1999/XSL/Transform", "NUMBER");
-
- /**
- * <p>The XPath 1.0 string data type.</p>
- *
- * <p>Maps to Java {@link String}.</p>
- */
- public static final QName STRING = new QName("http://www.w3.org/1999/XSL/Transform", "STRING");
-
- /**
- * <p>The XPath 1.0 boolean data type.</p>
- *
- * <p>Maps to Java {@link Boolean}.</p>
- */
- public static final QName BOOLEAN = new QName("http://www.w3.org/1999/XSL/Transform", "BOOLEAN");
-
- /**
- * <p>The XPath 1.0 NodeSet data type.</p>
- *
- * <p>Maps to Java {@link org.w3c.dom.NodeList}.</p>
- */
- public static final QName NODESET = new QName("http://www.w3.org/1999/XSL/Transform", "NODESET");
-
- /**
- * <p>The XPath 1.0 NodeSet data type.
- *
- * <p>Maps to Java {@link org.w3c.dom.Node}.</p>
- */
- public static final QName NODE = new QName("http://www.w3.org/1999/XSL/Transform", "NODE");
-
- /**
- * <p>The URI for the DOM object model, "http://java.sun.com/jaxp/xpath/dom".</p>
- */
- public static final String DOM_OBJECT_MODEL = "http://java.sun.com/jaxp/xpath/dom";
-}
diff --git a/src/javax/xml/xpath/XPathException.java b/src/javax/xml/xpath/XPathException.java
deleted file mode 100644
index ee68028..0000000
--- a/src/javax/xml/xpath/XPathException.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.xpath;
-
-import java.io.PrintWriter;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.ObjectStreamField;
-import java.io.InvalidClassException;
-
-/**
- * <code>XPathException</code> represents a generic XPath exception.</p>
- *
- * @author <a href="Norman.Walsh@Sun.com">Norman Walsh</a>
- * @author <a href="mailto:Jeff.Suttor@Sun.COM">Jeff Suttor</a>
- * @since 1.5
- */
-public class XPathException extends Exception {
-
- private static final ObjectStreamField[] serialPersistentFields = {
- new ObjectStreamField( "cause", Throwable.class )
- };
-
- /**
- * <p>Stream Unique Identifier.</p>
- */
- private static final long serialVersionUID = -1837080260374986980L;
-
- /**
- * <p>Constructs a new <code>XPathException</code>
- * with the specified detail <code>message</code>.</p>
- *
- * <p>The <code>cause</code> is not initialized.</p>
- *
- * <p>If <code>message</code> is <code>null</code>,
- * then a <code>NullPointerException</code> is thrown.</p>
- *
- * @param message The detail message.
- *
- * @throws NullPointerException When <code>message</code> is
- * <code>null</code>.
- */
- public XPathException(String message) {
- super(message);
- if ( message == null ) {
- throw new NullPointerException ( "message can't be null");
- }
- }
-
- /**
- * <p>Constructs a new <code>XPathException</code>
- * with the specified <code>cause</code>.</p>
- *
- * <p>If <code>cause</code> is <code>null</code>,
- * then a <code>NullPointerException</code> is thrown.</p>
- *
- * @param cause The cause.
- *
- * @throws NullPointerException if <code>cause</code> is <code>null</code>.
- */
- public XPathException(Throwable cause) {
- super(cause);
- if ( cause == null ) {
- throw new NullPointerException ( "cause can't be null");
- }
- }
-
- /**
- * <p>Get the cause of this XPathException.</p>
- *
- * @return Cause of this XPathException.
- */
- public Throwable getCause() {
- return super.getCause();
- }
-
- /**
- * Writes "cause" field to the stream.
- * The cause is got from the parent class.
- *
- * @param out stream used for serialization.
- * @throws IOException thrown by <code>ObjectOutputStream</code>
- *
- */
- private void writeObject(ObjectOutputStream out)
- throws IOException
- {
- ObjectOutputStream.PutField fields = out.putFields();
- fields.put("cause", (Throwable) super.getCause());
- out.writeFields();
- }
-
- /**
- * Reads the "cause" field from the stream.
- * And initializes the "cause" if it wasn't
- * done before.
- *
- * @param in stream used for deserialization
- * @throws IOException thrown by <code>ObjectInputStream</code>
- * @throws ClassNotFoundException thrown by <code>ObjectInputStream</code>
- */
- private void readObject(ObjectInputStream in)
- throws IOException, ClassNotFoundException
- {
- ObjectInputStream.GetField fields = in.readFields();
- Throwable scause = (Throwable) fields.get("cause", null);
-
- if (super.getCause() == null && scause != null) {
- try {
- super.initCause(scause);
- } catch(IllegalStateException e) {
- throw new InvalidClassException("Inconsistent state: two causes");
- }
- }
- }
-
- /**
- * <p>Print stack trace to specified <code>PrintStream</code>.</p>
- *
- * @param s Print stack trace to this <code>PrintStream</code>.
- */
- public void printStackTrace(java.io.PrintStream s) {
- if (getCause() != null) {
- getCause().printStackTrace(s);
- s.println("--------------- linked to ------------------");
- }
-
- super.printStackTrace(s);
- }
-
- /**
- * <p>Print stack trace to <code>System.err</code>.</p>
- */
- public void printStackTrace() {
- printStackTrace(System.err);
- }
-
- /**
- * <p>Print stack trace to specified <code>PrintWriter</code>.</p>
- *
- * @param s Print stack trace to this <code>PrintWriter</code>.
- */
- public void printStackTrace(PrintWriter s) {
-
- if (getCause() != null) {
- getCause().printStackTrace(s);
- s.println("--------------- linked to ------------------");
- }
-
- super.printStackTrace(s);
- }
-}
diff --git a/src/javax/xml/xpath/XPathExpression.java b/src/javax/xml/xpath/XPathExpression.java
deleted file mode 100644
index 0f980f6..0000000
--- a/src/javax/xml/xpath/XPathExpression.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.xpath;
-
-import org.xml.sax.InputSource;
-import javax.xml.namespace.QName;
-
-/**
- * <p><code>XPathExpression</code> provides access to compiled XPath expressions.</p>
- *
- * <a name="XPathExpression-evaluation"/>
- * <table border="1" cellpadding="2">
- * <thead>
- * <tr>
- * <th colspan="2">Evaluation of XPath Expressions.</th>
- * </tr>
- * </thead>
- * <tbody>
- * <tr>
- * <td>context</td>
- * <td>
- * If a request is made to evaluate the expression in the absence
- * of a context item, an empty document node will be used for the context.
- * For the purposes of evaluating XPath expressions, a DocumentFragment
- * is treated like a Document node.
- * </td>
- * </tr>
- * <tr>
- * <td>variables</td>
- * <td>
- * If the expression contains a variable reference, its value will be found through the {@link XPathVariableResolver}.
- * An {@link XPathExpressionException} is raised if the variable resolver is undefined or
- * the resolver returns <code>null</code> for the variable.
- * The value of a variable must be immutable through the course of any single evaluation.</p>
- * </td>
- * </tr>
- * <tr>
- * <td>functions</td>
- * <td>
- * If the expression contains a function reference, the function will be found through the {@link XPathFunctionResolver}.
- * An {@link XPathExpressionException} is raised if the function resolver is undefined or
- * the function resolver returns <code>null</code> for the function.</p>
- * </td>
- * </tr>
- * <tr>
- * <td>QNames</td>
- * <td>
- * QNames in the expression are resolved against the XPath namespace context.
- * </td>
- * </tr>
- * <tr>
- * <td>result</td>
- * <td>
- * This result of evaluating an expression is converted to an instance of the desired return type.
- * Valid return types are defined in {@link XPathConstants}.
- * Conversion to the return type follows XPath conversion rules.</p>
- * </td>
- * </tr>
- * </table>
- *
- * <p>An XPath expression is not thread-safe and not reentrant.
- * In other words, it is the application's responsibility to make
- * sure that one {@link XPathExpression} object is not used from
- * more than one thread at any given time, and while the <code>evaluate</code>
- * method is invoked, applications may not recursively call
- * the <code>evaluate</code> method.
- * <p>
- *
- * @author <a href="mailto:Norman.Walsh@Sun.com">Norman Walsh</a>
- * @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a>
- * @see <a href="http://www.w3.org/TR/xpath#section-Expressions">XML Path Language (XPath) Version 1.0, Expressions</a>
- * @since 1.5
- */
-public interface XPathExpression {
-
- /**
- * <p>Evaluate the compiled XPath expression in the specified context and return the result as the specified type.</p>
- *
- * <p>See <a href="#XPathExpression-evaluation">Evaluation of XPath Expressions</a> for context item evaluation,
- * variable, function and QName resolution and return type conversion.</p>
- *
- * <p>If <code>returnType</code> is not one of the types defined in {@link XPathConstants},
- * then an <code>IllegalArgumentException</code> is thrown.</p>
- *
- * <p>If a <code>null</code> value is provided for
- * <code>item</code>, an empty document will be used for the
- * context.
- * If <code>returnType</code> is <code>null</code>, then a <code>NullPointerException</code> is thrown.</p>
- *
- * @param item The starting context (a node, for example).
- * @param returnType The desired return type.
- *
- * @return The <code>Object</code> that is the result of evaluating the expression and converting the result to
- * <code>returnType</code>.
- *
- * @throws XPathExpressionException If the expression cannot be evaluated.
- * @throws IllegalArgumentException If <code>returnType</code> is not one of the types defined in {@link XPathConstants}.
- * @throws NullPointerException If <code>returnType</code> is <code>null</code>.
- */
- public Object evaluate(Object item, QName returnType)
- throws XPathExpressionException;
-
- /**
- * <p>Evaluate the compiled XPath expression in the specified context and return the result as a <code>String</code>.</p>
- *
- * <p>This method calls {@link #evaluate(Object item, QName returnType)} with a <code>returnType</code> of
- * {@link XPathConstants#STRING}.</p>
- *
- * <p>See <a href="#XPathExpression-evaluation">Evaluation of XPath Expressions</a> for context item evaluation,
- * variable, function and QName resolution and return type conversion.</p>
- *
- * <p>If a <code>null</code> value is provided for
- * <code>item</code>, an empty document will be used for the
- * context.
- *
- * @param item The starting context (a node, for example).
- *
- * @return The <code>String</code> that is the result of evaluating the expression and converting the result to a
- * <code>String</code>.
- *
- * @throws XPathExpressionException If the expression cannot be evaluated.
- */
- public String evaluate(Object item)
- throws XPathExpressionException;
-
- /**
- * <p>Evaluate the compiled XPath expression in the context of the specified <code>InputSource</code> and return the result as the
- * specified type.</p>
- *
- * <p>This method builds a data model for the {@link InputSource} and calls
- * {@link #evaluate(Object item, QName returnType)} on the resulting document object.</p>
- *
- * <p>See <a href="#XPathExpression-evaluation">Evaluation of XPath Expressions</a> for context item evaluation,
- * variable, function and QName resolution and return type conversion.</p>
- *
- * <p>If <code>returnType</code> is not one of the types defined in {@link XPathConstants},
- * then an <code>IllegalArgumentException</code> is thrown.</p>
- *
- * <p>If <code>source</code> or <code>returnType</code> is <code>null</code>,
- * then a <code>NullPointerException</code> is thrown.</p>
- *
- * @param source The <code>InputSource</code> of the document to evaluate over.
- * @param returnType The desired return type.
- *
- * @return The <code>Object</code> that is the result of evaluating the expression and converting the result to
- * <code>returnType</code>.
- *
- * @throws XPathExpressionException If the expression cannot be evaluated.
- * @throws IllegalArgumentException If <code>returnType</code> is not one of the types defined in {@link XPathConstants}.
- * @throws NullPointerException If <code>source</code> or <code>returnType</code> is <code>null</code>.
- */
- public Object evaluate(InputSource source, QName returnType)
- throws XPathExpressionException;
-
- /**
- * <p>Evaluate the compiled XPath expression in the context of the specified <code>InputSource</code> and return the result as a
- * <code>String</code>.</p>
- *
- * <p>This method calls {@link #evaluate(InputSource source, QName returnType)} with a <code>returnType</code> of
- * {@link XPathConstants#STRING}.</p>
- *
- * <p>See <a href="#XPathExpression-evaluation">Evaluation of XPath Expressions</a> for context item evaluation,
- * variable, function and QName resolution and return type conversion.</p>
- *
- * <p>If <code>source</code> is <code>null</code>, then a <code>NullPointerException</code> is thrown.</p>
- *
- * @param source The <code>InputSource</code> of the document to evaluate over.
- *
- * @return The <code>String</code> that is the result of evaluating the expression and converting the result to a
- * <code>String</code>.
- *
- * @throws XPathExpressionException If the expression cannot be evaluated.
- * @throws NullPointerException If <code>source</code> is <code>null</code>.
- */
- public String evaluate(InputSource source)
- throws XPathExpressionException;
-}
diff --git a/src/javax/xml/xpath/XPathExpressionException.java b/src/javax/xml/xpath/XPathExpressionException.java
deleted file mode 100644
index 0219078..0000000
--- a/src/javax/xml/xpath/XPathExpressionException.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.xpath;
-
-/**
- * <code>XPathExpressionException</code> represents an error in an XPath expression.</p>
- *
- * @author <a href="mailto:Norman.Walsh@Sun.com">Norman Walsh</a>
- * @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a>
- * @since 1.5
- */
-public class XPathExpressionException extends XPathException {
-
- /**
- * <p>Stream Unique Identifier.</p>
- */
- private static final long serialVersionUID = -1837080260374986980L;
-
- /**
- * <p>Constructs a new <code>XPathExpressionException</code>
- * with the specified detail <code>message</code>.</p>
- *
- * <p>The <code>cause</code> is not initialized.</p>
- *
- * <p>If <code>message</code> is <code>null</code>,
- * then a <code>NullPointerException</code> is thrown.</p>
- *
- * @param message The detail message.
- *
- * @throws NullPointerException When <code>message</code> is
- * <code>null</code>.
- */
- public XPathExpressionException(String message) {
- super(message);
- }
-
- /**
- * <p>Constructs a new <code>XPathExpressionException</code>
- * with the specified <code>cause</code>.</p>
- *
- * <p>If <code>cause</code> is <code>null</code>,
- * then a <code>NullPointerException</code> is thrown.</p>
- *
- * @param cause The cause.
- *
- * @throws NullPointerException if <code>cause</code> is <code>null</code>.
- */
- public XPathExpressionException(Throwable cause) {
- super(cause);
- }
-}
diff --git a/src/javax/xml/xpath/XPathFactory.java b/src/javax/xml/xpath/XPathFactory.java
deleted file mode 100644
index ea7370e..0000000
--- a/src/javax/xml/xpath/XPathFactory.java
+++ /dev/null
@@ -1,390 +0,0 @@
-/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.xpath;
-
-/**
- * <p>An <code>XPathFactory</code> instance can be used to create
- * {@link javax.xml.xpath.XPath} objects.</p>
- *
- *<p>See {@link #newInstance(String uri)} for lookup mechanism.</p>
- *
- * <p>The {@link XPathFactory} class is not thread-safe. In other words,
- * it is the application's responsibility to ensure that at most
- * one thread is using a {@link XPathFactory} object at any
- * given moment. Implementations are encouraged to mark methods
- * as <code>synchronized</code> to protect themselves from broken clients.
- *
- * <p>{@link XPathFactory} is not re-entrant. While one of the
- * <code>newInstance</code> methods is being invoked, applications
- * may not attempt to recursively invoke a <code>newInstance</code> method,
- * even from the same thread.
- *
- * @author <a href="mailto:Norman.Walsh@Sun.com">Norman Walsh</a>
- * @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a>
- *
- * @since 1.5
- */
-public abstract class XPathFactory {
-
-
- /**
- * <p>The default property name according to the JAXP spec.</p>
- */
- public static final String DEFAULT_PROPERTY_NAME = "javax.xml.xpath.XPathFactory";
-
- /**
- * <p>Default Object Model URI.</p>
- */
- public static final String DEFAULT_OBJECT_MODEL_URI = "http://java.sun.com/jaxp/xpath/dom";
-
- /**
- *<p> Take care of restrictions imposed by java security model </p>
- */
- private static SecuritySupport ss = new SecuritySupport() ;
-
- /**
- * <p>Protected constructor as {@link #newInstance()} or {@link #newInstance(String uri)}
- * or {@link #newInstance(String uri, String factoryClassName, ClassLoader classLoader)}
- * should be used to create a new instance of an <code>XPathFactory</code>.</p>
- */
- protected XPathFactory() {
- }
-
- /**
- * <p>Get a new <code>XPathFactory</code> instance using the default object model,
- * {@link #DEFAULT_OBJECT_MODEL_URI},
- * the W3C DOM.</p>
- *
- * <p>This method is functionally equivalent to:</p>
- * <pre>
- * newInstance(DEFAULT_OBJECT_MODEL_URI)
- * </pre>
- *
- * <p>Since the implementation for the W3C DOM is always available, this method will never fail.</p>
- *
- * @return Instance of an <code>XPathFactory</code>.
- *
- * @throws RuntimeException When there is a failure in creating an
- * <code>XPathFactory</code> for the default object model.
- */
- public static XPathFactory newInstance() {
-
- try {
- return newInstance(DEFAULT_OBJECT_MODEL_URI);
- } catch (XPathFactoryConfigurationException xpathFactoryConfigurationException) {
- throw new RuntimeException(
- "XPathFactory#newInstance() failed to create an XPathFactory for the default object model: "
- + DEFAULT_OBJECT_MODEL_URI
- + " with the XPathFactoryConfigurationException: "
- + xpathFactoryConfigurationException.toString()
- );
- }
- }
-
- /**
- * <p>Get a new <code>XPathFactory</code> instance using the specified object model.</p>
- *
- * <p>To find a <code>XPathFactory</code> object,
- * this method looks the following places in the following order where "the class loader" refers to the context class loader:</p>
- * <ol>
- * <li>
- * If the system property {@link #DEFAULT_PROPERTY_NAME} + ":uri" is present,
- * where uri is the parameter to this method, then its value is read as a class name.
- * The method will try to create a new instance of this class by using the class loader,
- * and returns it if it is successfully created.
- * </li>
- * <li>
- * ${java.home}/lib/jaxp.properties is read and the value associated with the key being the system property above is looked for.
- * If present, the value is processed just like above.
- * </li>
- * <li>
- * Use the service-provider loading facilities, defined by the
- * {@link java.util.ServiceLoader} class, to attempt to locate and load an
- * implementation of the service using the {@linkplain
- * java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}:
- * the service-provider loading facility will use the {@linkplain
- * java.lang.Thread#getContextClassLoader() current thread's context class loader}
- * to attempt to load the service. If the context class
- * loader is null, the {@linkplain
- * ClassLoader#getSystemClassLoader() system class loader} will be used.
- * <br>
- * Each potential service provider is required to implement the method
- * {@link #isObjectModelSupported(String objectModel)}.
- * The first service provider found that supports the specified object
- * model is returned.
- * <br>
- * In case of {@link java.util.ServiceConfigurationError} an
- * {@link XPathFactoryConfigurationException} will be thrown.
- * </li>
- * <li>
- * Platform default <code>XPathFactory</code> is located in a platform specific way.
- * There must be a platform default XPathFactory for the W3C DOM, i.e. {@link #DEFAULT_OBJECT_MODEL_URI}.
- * </li>
- * </ol>
- * <p>If everything fails, an <code>XPathFactoryConfigurationException</code> will be thrown.</p>
- *
- * <p>Tip for Trouble-shooting:</p>
- * <p>See {@link java.util.Properties#load(java.io.InputStream)} for exactly how a property file is parsed.
- * In particular, colons ':' need to be escaped in a property file, so make sure the URIs are properly escaped in it.
- * For example:</p>
- * <pre>
- * http\://java.sun.com/jaxp/xpath/dom=org.acme.DomXPathFactory
- * </pre>
- *
- * @param uri Identifies the underlying object model.
- * The specification only defines the URI {@link #DEFAULT_OBJECT_MODEL_URI},
- * <code>http://java.sun.com/jaxp/xpath/dom</code> for the W3C DOM,
- * the org.w3c.dom package, and implementations are free to introduce other URIs for other object models.
- *
- * @return Instance of an <code>XPathFactory</code>.
- *
- * @throws XPathFactoryConfigurationException If the specified object model
- * is unavailable, or if there is a configuration error.
- * @throws NullPointerException If <code>uri</code> is <code>null</code>.
- * @throws IllegalArgumentException If <code>uri</code> is <code>null</code>
- * or <code>uri.length() == 0</code>.
- */
- public static XPathFactory newInstance(final String uri)
- throws XPathFactoryConfigurationException {
-
- if (uri == null) {
- throw new NullPointerException(
- "XPathFactory#newInstance(String uri) cannot be called with uri == null");
- }
-
- if (uri.length() == 0) {
- throw new IllegalArgumentException(
- "XPathFactory#newInstance(String uri) cannot be called with uri == \"\"");
- }
-
- ClassLoader classLoader = ss.getContextClassLoader();
-
- if (classLoader == null) {
- //use the current class loader
- classLoader = XPathFactory.class.getClassLoader();
- }
-
- XPathFactory xpathFactory = new XPathFactoryFinder(classLoader).newFactory(uri);
-
- if (xpathFactory == null) {
- throw new XPathFactoryConfigurationException(
- "No XPathFactory implementation found for the object model: "
- + uri);
- }
-
- return xpathFactory;
- }
-
- /**
- * <p>Obtain a new instance of a <code>XPathFactory</code> from a factory class name. <code>XPathFactory</code>
- * is returned if specified factory class supports the specified object model.
- * This function is useful when there are multiple providers in the classpath.
- * It gives more control to the application as it can specify which provider
- * should be loaded.</p>
- *
- *
- * <h2>Tip for Trouble-shooting</h2>
- * <p>Setting the <code>jaxp.debug</code> system property will cause
- * this method to print a lot of debug messages
- * to <code>System.err</code> about what it is doing and where it is looking at.</p>
- *
- * <p> If you have problems try:</p>
- * <pre>
- * java -Djaxp.debug=1 YourProgram ....
- * </pre>
- *
- * @param uri Identifies the underlying object model. The specification only defines the URI
- * {@link #DEFAULT_OBJECT_MODEL_URI},<code>http://java.sun.com/jaxp/xpath/dom</code>
- * for the W3C DOM, the org.w3c.dom package, and implementations are free to introduce
- * other URIs for other object models.
- *
- * @param factoryClassName fully qualified factory class name that provides implementation of <code>javax.xml.xpath.XPathFactory</code>.
- *
- * @param classLoader <code>ClassLoader</code> used to load the factory class. If <code>null</code>
- * current <code>Thread</code>'s context classLoader is used to load the factory class.
- *
- *
- * @return New instance of a <code>XPathFactory</code>
- *
- * @throws XPathFactoryConfigurationException
- * if <code>factoryClassName</code> is <code>null</code>, or
- * the factory class cannot be loaded, instantiated
- * or the factory class does not support the object model specified
- * in the <code>uri</code> parameter.
- *
- * @throws NullPointerException If <code>uri</code> is <code>null</code>.
- * @throws IllegalArgumentException If <code>uri</code> is <code>null</code>
- * or <code>uri.length() == 0</code>.
- *
- * @see #newInstance()
- * @see #newInstance(String uri)
- *
- * @since 1.6
- */
- public static XPathFactory newInstance(String uri, String factoryClassName, ClassLoader classLoader)
- throws XPathFactoryConfigurationException{
- ClassLoader cl = classLoader;
-
- if (uri == null) {
- throw new NullPointerException(
- "XPathFactory#newInstance(String uri) cannot be called with uri == null");
- }
-
- if (uri.length() == 0) {
- throw new IllegalArgumentException(
- "XPathFactory#newInstance(String uri) cannot be called with uri == \"\"");
- }
-
- if (cl == null) {
- cl = ss.getContextClassLoader();
- }
-
- XPathFactory f = new XPathFactoryFinder(cl).createInstance(factoryClassName);
-
- if (f == null) {
- throw new XPathFactoryConfigurationException(
- "No XPathFactory implementation found for the object model: "
- + uri);
- }
- //if this factory supports the given schemalanguage return this factory else thrown exception
- if (f.isObjectModelSupported(uri)) {
- return f;
- } else {
- throw new XPathFactoryConfigurationException("Factory "
- + factoryClassName + " doesn't support given " + uri
- + " object model");
- }
-
- }
-
- /**
- * <p>Is specified object model supported by this <code>XPathFactory</code>?</p>
- *
- * @param objectModel Specifies the object model which the returned <code>XPathFactory</code> will understand.
- *
- * @return <code>true</code> if <code>XPathFactory</code> supports <code>objectModel</code>, else <code>false</code>.
- *
- * @throws NullPointerException If <code>objectModel</code> is <code>null</code>.
- * @throws IllegalArgumentException If <code>objectModel.length() == 0</code>.
- */
- public abstract boolean isObjectModelSupported(String objectModel);
-
- /**
- * <p>Set a feature for this <code>XPathFactory</code> and
- * <code>XPath</code>s created by this factory.</p>
- *
- * <p>
- * Feature names are fully qualified {@link java.net.URI}s.
- * Implementations may define their own features.
- * An {@link XPathFactoryConfigurationException} is thrown if this
- * <code>XPathFactory</code> or the <code>XPath</code>s
- * it creates cannot support the feature.
- * It is possible for an <code>XPathFactory</code> to expose a feature value
- * but be unable to change its state.
- * </p>
- *
- * <p>
- * All implementations are required to support the {@link javax.xml.XMLConstants#FEATURE_SECURE_PROCESSING} feature.
- * When the feature is <code>true</code>, any reference to an external function is an error.
- * Under these conditions, the implementation must not call the {@link XPathFunctionResolver}
- * and must throw an {@link XPathFunctionException}.
- * </p>
- *
- * @param name Feature name.
- * @param value Is feature state <code>true</code> or <code>false</code>.
- *
- * @throws XPathFactoryConfigurationException if this <code>XPathFactory</code> or the <code>XPath</code>s
- * it creates cannot support this feature.
- * @throws NullPointerException if <code>name</code> is <code>null</code>.
- */
- public abstract void setFeature(String name, boolean value)
- throws XPathFactoryConfigurationException;
-
- /**
- * <p>Get the state of the named feature.</p>
- *
- * <p>
- * Feature names are fully qualified {@link java.net.URI}s.
- * Implementations may define their own features.
- * An {@link XPathFactoryConfigurationException} is thrown if this
- * <code>XPathFactory</code> or the <code>XPath</code>s
- * it creates cannot support the feature.
- * It is possible for an <code>XPathFactory</code> to expose a feature value
- * but be unable to change its state.
- * </p>
- *
- * @param name Feature name.
- *
- * @return State of the named feature.
- *
- * @throws XPathFactoryConfigurationException if this
- * <code>XPathFactory</code> or the <code>XPath</code>s
- * it creates cannot support this feature.
- * @throws NullPointerException if <code>name</code> is <code>null</code>.
- */
- public abstract boolean getFeature(String name)
- throws XPathFactoryConfigurationException;
-
- /**
- * <p>Establish a default variable resolver.</p>
- *
- * <p>Any <code>XPath</code> objects constructed from this factory will use
- * the specified resolver by default.</p>
- *
- * <p>A <code>NullPointerException</code> is thrown if <code>resolver</code>
- * is <code>null</code>.</p>
- *
- * @param resolver Variable resolver.
- *
- * @throws NullPointerException If <code>resolver</code> is
- * <code>null</code>.
- */
- public abstract void setXPathVariableResolver(XPathVariableResolver resolver);
-
- /**
- * <p>Establish a default function resolver.</p>
- *
- * <p>Any <code>XPath</code> objects constructed from this factory will
- * use the specified resolver by default.</p>
- *
- * <p>A <code>NullPointerException</code> is thrown if
- * <code>resolver</code> is <code>null</code>.</p>
- *
- * @param resolver XPath function resolver.
- *
- * @throws NullPointerException If <code>resolver</code> is
- * <code>null</code>.
- */
- public abstract void setXPathFunctionResolver(XPathFunctionResolver resolver);
-
- /**
- * <p>Return a new <code>XPath</code> using the underlying object
- * model determined when the <code>XPathFactory</code> was instantiated.</p>
- *
- * @return New instance of an <code>XPath</code>.
- */
- public abstract XPath newXPath();
-}
diff --git a/src/javax/xml/xpath/XPathFactoryConfigurationException.java b/src/javax/xml/xpath/XPathFactoryConfigurationException.java
deleted file mode 100644
index cd3ebdf..0000000
--- a/src/javax/xml/xpath/XPathFactoryConfigurationException.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.xpath;
-
-/**
- * <code>XPathFactoryConfigurationException</code> represents a configuration error in a <code>XPathFactory</code> environment.</p>
- *
- * @author <a href="mailto:Norman.Walsh@Sun.com">Norman Walsh</a>
- * @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a>
- * @since 1.5
- */
-public class XPathFactoryConfigurationException extends XPathException {
-
- /**
- * <p>Stream Unique Identifier.</p>
- */
- private static final long serialVersionUID = -1837080260374986980L;
-
- /**
- * <p>Constructs a new <code>XPathFactoryConfigurationException</code> with the specified detail <code>message</code>.</p>
- *
- * <p>The <code>cause</code> is not initialized.</p>
- *
- * <p>If <code>message</code> is <code>null</code>,
- * then a <code>NullPointerException</code> is thrown.</p>
- *
- * @param message The detail message.
- *
- * @throws NullPointerException When <code>message</code> is
- * <code>null</code>.
- */
- public XPathFactoryConfigurationException(String message) {
- super(message);
- }
-
- /**
- * <p>Constructs a new <code>XPathFactoryConfigurationException</code>
- * with the specified <code>cause</code>.</p>
- *
- * <p>If <code>cause</code> is <code>null</code>,
- * then a <code>NullPointerException</code> is thrown.</p>
- *
- * @param cause The cause.
- *
- * @throws NullPointerException if <code>cause</code> is <code>null</code>.
- */
- public XPathFactoryConfigurationException(Throwable cause) {
- super(cause);
- }
-}
diff --git a/src/javax/xml/xpath/XPathFactoryFinder.java b/src/javax/xml/xpath/XPathFactoryFinder.java
deleted file mode 100644
index f99ddc8..0000000
--- a/src/javax/xml/xpath/XPathFactoryFinder.java
+++ /dev/null
@@ -1,444 +0,0 @@
-/*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.xpath;
-
-import java.io.File;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.net.URL;
-import java.security.AccessControlContext;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.Properties;
-import java.util.ServiceConfigurationError;
-import java.util.ServiceLoader;
-
-/**
- * Implementation of {@link XPathFactory#newInstance(String)}.
- *
- * @author <a href="Kohsuke.Kawaguchi@Sun.com">Kohsuke Kawaguchi</a>
- * @version $Revision: 1.7 $, $Date: 2010-11-01 04:36:14 $
- * @since 1.5
- */
-class XPathFactoryFinder {
- private static final String DEFAULT_PACKAGE = "com.sun.org.apache.xpath.internal";
-
- private static final SecuritySupport ss = new SecuritySupport() ;
- /** debug support code. */
- private static boolean debug = false;
- static {
- // Use try/catch block to support applets
- try {
- debug = ss.getSystemProperty("jaxp.debug") != null;
- } catch (Exception unused) {
- debug = false;
- }
- }
-
- /**
- * <p>Cache properties for performance.</p>
- */
- private static final Properties cacheProps = new Properties();
-
- /**
- * <p>First time requires initialization overhead.</p>
- */
- private volatile static boolean firstTime = true;
-
- /**
- * <p>Conditional debug printing.</p>
- *
- * @param msg to print
- */
- private static void debugPrintln(String msg) {
- if (debug) {
- System.err.println("JAXP: " + msg);
- }
- }
-
- /**
- * <p><code>ClassLoader</code> to use to find <code>XPathFactory</code>.</p>
- */
- private final ClassLoader classLoader;
-
- /**
- * <p>Constructor that specifies <code>ClassLoader</code> to use
- * to find <code>XPathFactory</code>.</p>
- *
- * @param loader
- * to be used to load resource and {@link XPathFactory}
- * implementations during the resolution process.
- * If this parameter is null, the default system class loader
- * will be used.
- */
- public XPathFactoryFinder(ClassLoader loader) {
- this.classLoader = loader;
- if( debug ) {
- debugDisplayClassLoader();
- }
- }
-
- private void debugDisplayClassLoader() {
- try {
- if( classLoader == ss.getContextClassLoader() ) {
- debugPrintln("using thread context class loader ("+classLoader+") for search");
- return;
- }
- } catch( Throwable unused ) {
- // getContextClassLoader() undefined in JDK1.1
- }
-
- if( classLoader==ClassLoader.getSystemClassLoader() ) {
- debugPrintln("using system class loader ("+classLoader+") for search");
- return;
- }
-
- debugPrintln("using class loader ("+classLoader+") for search");
- }
-
- /**
- * <p>Creates a new {@link XPathFactory} object for the specified
- * object model.</p>
- *
- * @param uri
- * Identifies the underlying object model.
- *
- * @return <code>null</code> if the callee fails to create one.
- *
- * @throws NullPointerException
- * If the parameter is null.
- */
- public XPathFactory newFactory(String uri) throws XPathFactoryConfigurationException {
- if (uri == null) {
- throw new NullPointerException();
- }
- XPathFactory f = _newFactory(uri);
- if (f != null) {
- debugPrintln("factory '" + f.getClass().getName() + "' was found for " + uri);
- } else {
- debugPrintln("unable to find a factory for " + uri);
- }
- return f;
- }
-
- /**
- * <p>Lookup a {@link XPathFactory} for the given object model.</p>
- *
- * @param uri identifies the object model.
- *
- * @return {@link XPathFactory} for the given object model.
- */
- private XPathFactory _newFactory(String uri) throws XPathFactoryConfigurationException {
- XPathFactory xpathFactory = null;
-
- String propertyName = SERVICE_CLASS.getName() + ":" + uri;
-
- // system property look up
- try {
- debugPrintln("Looking up system property '"+propertyName+"'" );
- String r = ss.getSystemProperty(propertyName);
- if(r!=null) {
- debugPrintln("The value is '"+r+"'");
- xpathFactory = createInstance(r, true);
- if (xpathFactory != null) {
- return xpathFactory;
- }
- } else
- debugPrintln("The property is undefined.");
- } catch( Throwable t ) {
- if( debug ) {
- debugPrintln("failed to look up system property '"+propertyName+"'" );
- t.printStackTrace();
- }
- }
-
- String javah = ss.getSystemProperty( "java.home" );
- String configFile = javah + File.separator +
- "lib" + File.separator + "jaxp.properties";
-
- // try to read from $java.home/lib/jaxp.properties
- try {
- if(firstTime){
- synchronized(cacheProps){
- if(firstTime){
- File f=new File( configFile );
- firstTime = false;
- if(ss.doesFileExist(f)){
- debugPrintln("Read properties file " + f);
- cacheProps.load(ss.getFileInputStream(f));
- }
- }
- }
- }
- final String factoryClassName = cacheProps.getProperty(propertyName);
- debugPrintln("found " + factoryClassName + " in $java.home/jaxp.properties");
-
- if (factoryClassName != null) {
- xpathFactory = createInstance(factoryClassName, true);
- if(xpathFactory != null){
- return xpathFactory;
- }
- }
- } catch (Exception ex) {
- if (debug) {
- ex.printStackTrace();
- }
- }
-
- // Try with ServiceLoader
- assert xpathFactory == null;
- xpathFactory = findServiceProvider(uri);
-
- // The following assertion should always be true.
- // Uncomment it, recompile, and run with -ea in case of doubts:
- // assert xpathFactory == null || xpathFactory.isObjectModelSupported(uri);
-
- if (xpathFactory != null) {
- return xpathFactory;
- }
-
- // platform default
- if(uri.equals(XPathFactory.DEFAULT_OBJECT_MODEL_URI)) {
- debugPrintln("attempting to use the platform default W3C DOM XPath lib");
- return createInstance("com.sun.org.apache.xpath.internal.jaxp.XPathFactoryImpl", true);
- }
-
- debugPrintln("all things were tried, but none was found. bailing out.");
- return null;
- }
-
- /** <p>Create class using appropriate ClassLoader.</p>
- *
- * @param className Name of class to create.
- * @return Created class or <code>null</code>.
- */
- private Class<?> createClass(String className) {
- Class clazz;
- // make sure we have access to restricted packages
- boolean internal = false;
- if (System.getSecurityManager() != null) {
- if (className != null && className.startsWith(DEFAULT_PACKAGE)) {
- internal = true;
- }
- }
-
- // use approprite ClassLoader
- try {
- if (classLoader != null && !internal) {
- clazz = Class.forName(className, false, classLoader);
- } else {
- clazz = Class.forName(className);
- }
- } catch (Throwable t) {
- if(debug) {
- t.printStackTrace();
- }
- return null;
- }
-
- return clazz;
- }
-
- /**
- * <p>Creates an instance of the specified and returns it.</p>
- *
- * @param className
- * fully qualified class name to be instantiated.
- *
- * @return null
- * if it fails. Error messages will be printed by this method.
- */
- XPathFactory createInstance( String className )
- throws XPathFactoryConfigurationException
- {
- return createInstance( className, false );
- }
-
- XPathFactory createInstance( String className, boolean useServicesMechanism )
- throws XPathFactoryConfigurationException
- {
- XPathFactory xPathFactory = null;
-
- debugPrintln("createInstance(" + className + ")");
-
- // get Class from className
- Class<?> clazz = createClass(className);
- if (clazz == null) {
- debugPrintln("failed to getClass(" + className + ")");
- return null;
- }
- debugPrintln("loaded " + className + " from " + which(clazz));
-
- // instantiate Class as a XPathFactory
- try {
- if (!useServicesMechanism) {
- xPathFactory = newInstanceNoServiceLoader(clazz);
- }
- if (xPathFactory == null) {
- xPathFactory = (XPathFactory) clazz.newInstance();
- }
- } catch (ClassCastException classCastException) {
- debugPrintln("could not instantiate " + clazz.getName());
- if (debug) {
- classCastException.printStackTrace();
- }
- return null;
- } catch (IllegalAccessException illegalAccessException) {
- debugPrintln("could not instantiate " + clazz.getName());
- if (debug) {
- illegalAccessException.printStackTrace();
- }
- return null;
- } catch (InstantiationException instantiationException) {
- debugPrintln("could not instantiate " + clazz.getName());
- if (debug) {
- instantiationException.printStackTrace();
- }
- return null;
- }
-
- return xPathFactory;
- }
- /**
- * Try to construct using newXPathFactoryNoServiceLoader
- * method if available.
- */
- private static XPathFactory newInstanceNoServiceLoader(
- Class<?> providerClass
- ) throws XPathFactoryConfigurationException {
- // Retain maximum compatibility if no security manager.
- if (System.getSecurityManager() == null) {
- return null;
- }
- try {
- Method creationMethod =
- providerClass.getDeclaredMethod(
- "newXPathFactoryNoServiceLoader"
- );
- final int modifiers = creationMethod.getModifiers();
-
- // Do not call "newXPathFactoryNoServiceLoader" if it's
- // not public static.
- if (!Modifier.isStatic(modifiers) || !Modifier.isPublic(modifiers)) {
- return null;
- }
-
- // Only calls "newXPathFactoryNoServiceLoader" if it's
- // declared to return an instance of XPathFactory.
- final Class<?> returnType = creationMethod.getReturnType();
- if (SERVICE_CLASS.isAssignableFrom(returnType)) {
- return SERVICE_CLASS.cast(creationMethod.invoke(null, (Object[])null));
- } else {
- // Should not happen since
- // XPathFactoryImpl.newXPathFactoryNoServiceLoader is
- // declared to return XPathFactory.
- throw new ClassCastException(returnType
- + " cannot be cast to " + SERVICE_CLASS);
- }
- } catch (ClassCastException e) {
- throw new XPathFactoryConfigurationException(e);
- } catch (NoSuchMethodException exc) {
- return null;
- } catch (Exception exc) {
- return null;
- }
- }
-
- // Call isObjectModelSupportedBy with initial context.
- private boolean isObjectModelSupportedBy(final XPathFactory factory,
- final String objectModel,
- AccessControlContext acc) {
- return AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
- public Boolean run() {
- return factory.isObjectModelSupported(objectModel);
- }
- }, acc);
- }
-
- /**
- * Finds a service provider subclass of XPathFactory that supports the
- * given object model using the ServiceLoader.
- *
- * @param objectModel URI of object model to support.
- * @return An XPathFactory supporting the specified object model, or null
- * if none is found.
- * @throws XPathFactoryConfigurationException if a configuration error is found.
- */
- private XPathFactory findServiceProvider(final String objectModel)
- throws XPathFactoryConfigurationException {
-
- assert objectModel != null;
- // store current context.
- final AccessControlContext acc = AccessController.getContext();
- try {
- return AccessController.doPrivileged(new PrivilegedAction<XPathFactory>() {
- public XPathFactory run() {
- final ServiceLoader<XPathFactory> loader =
- ServiceLoader.load(SERVICE_CLASS);
- for (XPathFactory factory : loader) {
- // restore initial context to call
- // factory.isObjectModelSupportedBy
- if (isObjectModelSupportedBy(factory, objectModel, acc)) {
- return factory;
- }
- }
- return null; // no factory found.
- }
- });
- } catch (ServiceConfigurationError error) {
- throw new XPathFactoryConfigurationException(error);
- }
- }
-
- private static final Class<XPathFactory> SERVICE_CLASS = XPathFactory.class;
-
- private static String which( Class clazz ) {
- return which( clazz.getName(), clazz.getClassLoader() );
- }
-
- /**
- * <p>Search the specified classloader for the given classname.</p>
- *
- * @param classname the fully qualified name of the class to search for
- * @param loader the classloader to search
- *
- * @return the source location of the resource, or null if it wasn't found
- */
- private static String which(String classname, ClassLoader loader) {
-
- String classnameAsResource = classname.replace('.', '/') + ".class";
-
- if( loader==null ) loader = ClassLoader.getSystemClassLoader();
-
- //URL it = loader.getResource(classnameAsResource);
- URL it = ss.getResourceAsURL(loader, classnameAsResource);
- if (it != null) {
- return it.toString();
- } else {
- return null;
- }
- }
-}
diff --git a/src/javax/xml/xpath/XPathFunction.java b/src/javax/xml/xpath/XPathFunction.java
deleted file mode 100644
index bc3b544..0000000
--- a/src/javax/xml/xpath/XPathFunction.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.xpath;
-
-import java.util.List;
-
-/**
- * <p><code>XPathFunction</code> provides access to XPath functions.</p>
- *
- * <p>Functions are identified by QName and arity in XPath.</p>
- *
- * @author <a href="mailto:Norman.Walsh@Sun.com">Norman Walsh</a>
- * @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a>
- * @since 1.5
- */
-public interface XPathFunction {
- /**
- * <p>Evaluate the function with the specified arguments.</p>
- *
- * <p>To the greatest extent possible, side-effects should be avoided in the
- * definition of extension functions. The implementation evaluating an
- * XPath expression is under no obligation to call extension functions in
- * any particular order or any particular number of times.</p>
- *
- * @param args The arguments, <code>null</code> is a valid value.
- *
- * @return The result of evaluating the <code>XPath</code> function as an <code>Object</code>.
- *
- * @throws XPathFunctionException If <code>args</code> cannot be evaluated with this <code>XPath</code> function.
- */
- public Object evaluate(List args)
- throws XPathFunctionException;
-}
diff --git a/src/javax/xml/xpath/XPathFunctionException.java b/src/javax/xml/xpath/XPathFunctionException.java
deleted file mode 100644
index 398fe7c..0000000
--- a/src/javax/xml/xpath/XPathFunctionException.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.xpath;
-
-/**
- * <code>XPathFunctionException</code> represents an error with an XPath function.</p>
- *
- * @author <a href="mailto:Norman.Walsh@Sun.com">Norman Walsh</a>
- * @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a>
- * @since 1.5
- */
-public class XPathFunctionException extends XPathExpressionException {
-
- /**
- * <p>Stream Unique Identifier.</p>
- */
- private static final long serialVersionUID = -1837080260374986980L;
-
- /**
- * <p>Constructs a new <code>XPathFunctionException</code> with the specified detail <code>message</code>.</p>
- *
- * <p>The <code>cause</code> is not initialized.</p>
- *
- * <p>If <code>message</code> is <code>null</code>,
- * then a <code>NullPointerException</code> is thrown.</p>
- *
- * @param message The detail message.
- *
- * @throws NullPointerException When <code>message</code> is
- * <code>null</code>.
- */
- public XPathFunctionException(String message) {
- super(message);
- }
-
- /**
- * <p>Constructs a new <code>XPathFunctionException</code> with the specified <code>cause</code>.</p>
- *
- * <p>If <code>cause</code> is <code>null</code>,
- * then a <code>NullPointerException</code> is thrown.</p>
- *
- * @param cause The cause.
- *
- * @throws NullPointerException if <code>cause</code> is <code>null</code>.
- */
- public XPathFunctionException(Throwable cause) {
- super(cause);
- }
-}
diff --git a/src/javax/xml/xpath/XPathFunctionResolver.java b/src/javax/xml/xpath/XPathFunctionResolver.java
deleted file mode 100644
index 0c3786b..0000000
--- a/src/javax/xml/xpath/XPathFunctionResolver.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.xpath;
-
-import javax.xml.namespace.QName;
-
-/**
- * <p><code>XPathFunctionResolver</code> provides access to the set of user defined <code>XPathFunction</code>s.</p>
- *
- * <p>XPath functions are resolved by name and arity.
- * The resolver is not needed for XPath built-in functions and the resolver
- * <strong><em>cannot</em></strong> be used to override those functions.</p>
- *
- * <p>In particular, the resolver is only called for functions in an another
- * namespace (functions with an explicit prefix). This means that you cannot
- * use the <code>XPathFunctionResolver</code> to implement specifications
- * like <a href="http://www.w3.org/TR/xmldsig-core/">XML-Signature Syntax
- * and Processing</a> which extend the function library of XPath 1.0 in the
- * same namespace. This is a consequence of the design of the resolver.</p>
- *
- * <p>If you wish to implement additional built-in functions, you will have to
- * extend the underlying implementation directly.</p>
- *
- * @author <a href="mailto:Norman.Walsh@Sun.com">Norman Walsh</a>
- * @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a>
- * @see <a href="http://www.w3.org/TR/xpath#corelib">XML Path Language (XPath) Version 1.0, Core Function Library</a>
- * @since 1.5
- */
-public interface XPathFunctionResolver {
- /**
- * <p>Find a function in the set of available functions.</p>
- *
- * <p>If <code>functionName</code> or <code>arity</code> is <code>null</code>, then a <code>NullPointerException</code> is thrown.</p>
- *
- * @param functionName The function name.
- * @param arity The number of arguments that the returned function must accept.
- *
- * @return The function or <code>null</code> if no function named <code>functionName</code> with <code>arity</code> arguments exists.
- *
- * @throws NullPointerException If <code>functionName</code> or <code>arity</code> is <code>null</code>.
- */
- public XPathFunction resolveFunction(QName functionName, int arity);
-}
diff --git a/src/javax/xml/xpath/XPathVariableResolver.java b/src/javax/xml/xpath/XPathVariableResolver.java
deleted file mode 100644
index 0957c28..0000000
--- a/src/javax/xml/xpath/XPathVariableResolver.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.xml.xpath;
-
-import javax.xml.namespace.QName;
-
-/**
- * <p><code>XPathVariableResolver</code> provides access to the set of user defined XPath variables.</p>
- *
- * <p>The <code>XPathVariableResolver</code> and the XPath evaluator must adhere to a contract that
- * cannot be directly enforced by the API. Although variables may be mutable,
- * that is, an application may wish to evaluate the same XPath expression more
- * than once with different variable values, in the course of evaluating any
- * single XPath expression, a variable's value <strong><em>must</em></strong>
- * not change.</p>
- *
- * @author <a href="mailto:Norman.Walsh@Sun.com">Norman Walsh</a>
- * @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a>
- * @since 1.5
- */
-public interface XPathVariableResolver {
- /**
- * <p>Find a variable in the set of available variables.</p>
- *
- * <p>If <code>variableName</code> is <code>null</code>, then a <code>NullPointerException</code> is thrown.</p>
- *
- * @param variableName The <code>QName</code> of the variable name.
- *
- * @return The variables value, or <code>null</code> if no variable named <code>variableName</code>
- * exists. The value returned must be of a type appropriate for the underlying object model.
- *
- * @throws NullPointerException If <code>variableName</code> is <code>null</code>.
- */
- public Object resolveVariable(QName variableName);
-}
diff --git a/src/javax/xml/xpath/package.html b/src/javax/xml/xpath/package.html
deleted file mode 100644
index 6f49222..0000000
--- a/src/javax/xml/xpath/package.html
+++ /dev/null
@@ -1,282 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation. Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<title>javax.xml.xpath</title>
-<meta name="@author" content="mailto:Ben@galbraiths.org" />
-<meta name="@author" content="mailto:Norman.Walsh@Sun.com" />
-<meta name="@author" content="mailto:Jeff.Suttor@Sun.com" />
-<meta name="@version" content="$Revision: 1.3 $, $Date: 2005/11/03 19:34:17 $" />
-<meta name="@see" content="http://www.w3.org/TR/xpath" />
-<meta name="@since" content="1.5" />
-</head>
-
-<body>
-
-<p>This package provides an <em>object-model neutral</em> API for the
-evaluation of XPath expressions and access to the evaluation
-environment.
-</p>
-
-<p>The following XML standards apply:</p>
-
-<ul>
-<li><a href="http://www.w3.org/TR/xpath">XML Path Language (XPath) Version 1.0</a></li>
-</ul>
-
-<hr />
-
-<h2>XPath Overview</h2>
-
-<p>The XPath language provides a simple, concise syntax for selecting
-nodes from an XML document. XPath also provides rules for converting a
-node in an XML document object model (DOM) tree to a boolean, double,
-or string value. XPath is a W3C-defined language and an official W3C
-recommendation; the W3C hosts the XML Path Language (XPath) Version
-1.0 specification.
-</p>
-
-<p>XPath started in life in 1999 as a supplement to the XSLT and
-XPointer languages, but has more recently become popular as a
-stand-alone language, as a single XPath expression can be used to
-replace many lines of DOM API code.
-</p>
-
-<h3>XPath Expressions</h3>
-
-<p>An XPath <em>expression</em> is composed of a <em>location
-path</em> and one or more optional <em>predicates</em>. Expressions
-may also include XPath variables.
-</p>
-
-<p>The following is an example of a simple XPath expression:</p>
-
-<pre>
-/foo/bar
-</pre>
-
-<p>This example would select the <code>&lt;bar&gt;</code> element in
-an XML document such as the following:</p>
-
-<pre>
-&lt;foo&gt;
-&lt;bar/&gt;
-&lt;/foo&gt;
-</pre>
-
-<p>The expression <code>/foo/bar</code> is an example of a location
-path. While XPath location paths resemble Unix-style file system
-paths, an important distinction is that XPath expressions return
-<em>all</em> nodes that match the expression. Thus, all three
-<code>&lt;bar&gt;</code> elements in the following document would be
-selected by the <code>/foo/bar</code> expression:</p>
-
-<pre>
-&lt;foo&gt;
-&lt;bar/&gt;
-&lt;bar/&gt;
-&lt;bar/&gt;
-&lt;/foo&gt;
-</pre>
-
-<p>A special location path operator, <code>//</code>, selects nodes at
-any depth in an XML document. The following example selects all
-<code>&lt;bar&gt;</code> elements regardless of their location in a
-document:</p>
-
-<pre>
-//bar
-</pre>
-
-<p>A wildcard operator, *, causes all element nodes to be selected.
-The following example selects all children elements of a
-<code>&lt;foo&gt;</code> element:</p>
-
-<pre>
-/foo/*
-</pre>
-
-<p>In addition to element nodes, XPath location paths may also address
-attribute nodes, text nodes, comment nodes, and processing instruction
-nodes. The following table gives examples of location paths for each
-of these node types:</p>
-
-<table border="1">
-<tr>
-<td>Location Path</td>
-<td>Description</td>
-</tr>
-<tr>
-<td>
-<code>/foo/bar/<strong>@id</strong></code>
-</td>
-<td>Selects the attribute <code>id</code> of the <code>&lt;bar&gt;</code> element
-</td>
-</tr>
-<tr>
-<td><code>/foo/bar/<strong>text()</strong></code>
-</td>
-<td>Selects the text nodes of the <code>&lt;bar&gt;</code> element. No
-distinction is made between escaped and non-escaped character data.
-</td>
-</tr>
-<tr>
-<td><code>/foo/bar/<strong>comment()</strong></code>
-</td>
-<td>Selects all comment nodes contained in the <code>&lt;bar&gt;</code> element.
-</td>
-</tr>
-<tr>
-<td><code>/foo/bar/<strong>processing-instruction()</strong></code>
-</td>
-<td>Selects all processing-instruction nodes contained in the
-<code>&lt;bar&gt;</code> element.
-</td>
-</tr>
-</table>
-
-<p>Predicates allow for refining the nodes selected by an XPath
-location path. Predicates are of the form
-<code>[<em>expression</em>]</code>. The following example selects all
-<code>&lt;foo&gt;</code> elements that contain an <code>include</code>
-attribute with the value of <code>true</code>:</p>
-
-<pre>
-//foo[@include='true']
-</pre>
-
-<p>Predicates may be appended to each other to further refine an
-expression, such as:</p>
-
-<pre>
-//foo[@include='true'][@mode='bar']
-</pre>
-
-<h3>Using the XPath API</h3>
-
-<p>
-The following example demonstrates using the XPath API to select one
-or more nodes from an XML document:</p>
-
-<pre>
-XPath xpath = XPathFactory.newInstance().newXPath();
-String expression = "/widgets/widget";
-InputSource inputSource = new InputSource("widgets.xml");
-NodeList nodes = (NodeList) xpath.evaluate(expression, inputSource, XPathConstants.NODESET);
-</pre>
-
-<h3>XPath Expressions and Types</h3>
-
-<p>While XPath expressions select nodes in the XML document, the XPath
-API allows the selected nodes to be coalesced into one of the
-following other data types:</p>
-
-<ul>
-<li><code>Boolean</code></li>
-<li><code>Number</code></li>
-<li><code>String</code></li>
-</ul>
-
-<p>The desired return type is specified by a {@link
-javax.xml.namespace.QName} parameter in method call used to evaluate
-the expression, which is either a call to
-<code>XPathExpression.evalute(...)</code> or to one of the
-<code>XPath.evaluate(...)</code> convenience methods. The allowed
-QName values are specified as constants in the {@link
-javax.xml.xpath.XPathConstants} class; they are:</p>
-
-<ul>
-<li>{@link javax.xml.xpath.XPathConstants#NODESET}</li>
-<li>{@link javax.xml.xpath.XPathConstants#NODE}</li>
-<li>{@link javax.xml.xpath.XPathConstants#STRING}</li>
-<li>{@link javax.xml.xpath.XPathConstants#BOOLEAN}</li>
-<li>{@link javax.xml.xpath.XPathConstants#NUMBER}</li>
-</ul>
-
-<p>When a <code>Boolean</code> return type is requested,
-<code>Boolean.TRUE</code> is returned if one or more nodes were
-selected; otherwise, <code>Boolean.FALSE</code> is returned.</p>
-
-<p>The <code>String</code> return type is a convenience for retrieving
-the character data from a text node, attribute node, comment node, or
-processing-instruction node. When used on an element node, the value
-of the child text nodes is returned.
-</p>
-
-<p>The <code>Number</code> return type attempts to coalesce the text
-of a node to a <code>double</code> data type.
-</p>
-
-<h3>XPath Context</h3>
-
-<p>XPath location paths may be relative to a particular node in the
-document, known as the <code>context</code>. Consider the following
-XML document:</p>
-
-<pre>
-&lt;widgets&gt;
-&lt;widget&gt;
-&lt;manufacturer/&gt;
-&lt;dimensions/&gt;
-&lt;/widget&gt;
-&lt;/widgets&gt;
-</pre>
-
-<p>The <code>&lt;widget&gt;</code> element can be selected with the
-following XPath API code:</p>
-
-<pre>
-// parse the XML as a W3C Document
-DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
-Document document = builder.parse(new File("/widgets.xml"));
-
-XPath xpath = XPathFactory.newInstance().newXPath();
-String expression = "/widgets/widget";
-Node widgetNode = (Node) xpath.evaluate(expression, document, XPathConstants.NODE);
-</pre>
-
-<p>With a reference to the <code>&lt;widget&gt;</code> element, a
-relative XPath expression can now written to select the
-<code>&lt;manufacturer&gt;</code> child element:</p>
-
-<pre>
-XPath xpath = XPathFactory.newInstance().newXPath();
-<strong>String expression = "manufacturer";</strong>
-Node manufacturerNode = (Node) xpath.evaluate(expression, <strong>widgetNode</strong>, XPathConstants.NODE);
-</pre>
-
-<ul>
-<li>Author <a href="mailto:Ben@galbraiths.org">Ben Galbraith</a></li>
-<li>Author <a href="mailto:Norman.Walsh@Sun.com">Norman Walsh</a></li>
-<li>Author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a></li>
-<li>See <a href="http://www.w3.org/TR/xpath">XML Path Language (XPath) Version 1.0</a></li>
-<li>Since 1.5</li>
-</ul>
-</body>
-</html>
diff --git a/src/org/w3c/dom/Attr.java b/src/org/w3c/dom/Attr.java
deleted file mode 100644
index 8231a54..0000000
--- a/src/org/w3c/dom/Attr.java
+++ /dev/null
@@ -1,304 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] in the hope that
- * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * The <code>Attr</code> interface represents an attribute in an
- * <code>Element</code> object. Typically the allowable values for the
- * attribute are defined in a schema associated with the document.
- * <p><code>Attr</code> objects inherit the <code>Node</code> interface, but
- * since they are not actually child nodes of the element they describe, the
- * DOM does not consider them part of the document tree. Thus, the
- * <code>Node</code> attributes <code>parentNode</code>,
- * <code>previousSibling</code>, and <code>nextSibling</code> have a
- * <code>null</code> value for <code>Attr</code> objects. The DOM takes the
- * view that attributes are properties of elements rather than having a
- * separate identity from the elements they are associated with; this should
- * make it more efficient to implement such features as default attributes
- * associated with all elements of a given type. Furthermore,
- * <code>Attr</code> nodes may not be immediate children of a
- * <code>DocumentFragment</code>. However, they can be associated with
- * <code>Element</code> nodes contained within a
- * <code>DocumentFragment</code>. In short, users and implementors of the
- * DOM need to be aware that <code>Attr</code> nodes have some things in
- * common with other objects inheriting the <code>Node</code> interface, but
- * they also are quite distinct.
- * <p>The attribute's effective value is determined as follows: if this
- * attribute has been explicitly assigned any value, that value is the
- * attribute's effective value; otherwise, if there is a declaration for
- * this attribute, and that declaration includes a default value, then that
- * default value is the attribute's effective value; otherwise, the
- * attribute does not exist on this element in the structure model until it
- * has been explicitly added. Note that the <code>Node.nodeValue</code>
- * attribute on the <code>Attr</code> instance can also be used to retrieve
- * the string version of the attribute's value(s).
- * <p> If the attribute was not explicitly given a value in the instance
- * document but has a default value provided by the schema associated with
- * the document, an attribute node will be created with
- * <code>specified</code> set to <code>false</code>. Removing attribute
- * nodes for which a default value is defined in the schema generates a new
- * attribute node with the default value and <code>specified</code> set to
- * <code>false</code>. If validation occurred while invoking
- * <code>Document.normalizeDocument()</code>, attribute nodes with
- * <code>specified</code> equals to <code>false</code> are recomputed
- * according to the default attribute values provided by the schema. If no
- * default value is associate with this attribute in the schema, the
- * attribute node is discarded.
- * <p>In XML, where the value of an attribute can contain entity references,
- * the child nodes of the <code>Attr</code> node may be either
- * <code>Text</code> or <code>EntityReference</code> nodes (when these are
- * in use; see the description of <code>EntityReference</code> for
- * discussion).
- * <p>The DOM Core represents all attribute values as simple strings, even if
- * the DTD or schema associated with the document declares them of some
- * specific type such as tokenized.
- * <p>The way attribute value normalization is performed by the DOM
- * implementation depends on how much the implementation knows about the
- * schema in use. Typically, the <code>value</code> and
- * <code>nodeValue</code> attributes of an <code>Attr</code> node initially
- * returns the normalized value given by the parser. It is also the case
- * after <code>Document.normalizeDocument()</code> is called (assuming the
- * right options have been set). But this may not be the case after
- * mutation, independently of whether the mutation is performed by setting
- * the string value directly or by changing the <code>Attr</code> child
- * nodes. In particular, this is true when <a href='http://www.w3.org/TR/2004/REC-xml-20040204#dt-charref'>character
- * references</a> are involved, given that they are not represented in the DOM and they
- * impact attribute value normalization. On the other hand, if the
- * implementation knows about the schema in use when the attribute value is
- * changed, and it is of a different type than CDATA, it may normalize it
- * again at that time. This is especially true of specialized DOM
- * implementations, such as SVG DOM implementations, which store attribute
- * values in an internal form different from a string.
- * <p>The following table gives some examples of the relations between the
- * attribute value in the original document (parsed attribute), the value as
- * exposed in the DOM, and the serialization of the value:
- * <table border='1' cellpadding='3'>
- * <tr>
- * <th>Examples</th>
- * <th>Parsed
- * attribute value</th>
- * <th>Initial <code>Attr.value</code></th>
- * <th>Serialized attribute value</th>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>
- * Character reference</td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <pre>"x&amp;#178;=5"</pre>
- * </td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <pre>"x\u00b2=5"</pre>
- * </td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <pre>"x&amp;#178;=5"</pre>
- * </td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>Built-in
- * character entity</td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <pre>"y&amp;lt;6"</pre>
- * </td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <pre>"y&lt;6"</pre>
- * </td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <pre>"y&amp;lt;6"</pre>
- * </td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>Literal newline between</td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <pre>
- * "x=5&amp;#10;y=6"</pre>
- * </td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <pre>"x=5 y=6"</pre>
- * </td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <pre>"x=5&amp;#10;y=6"</pre>
- * </td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>Normalized newline between</td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <pre>"x=5
- * y=6"</pre>
- * </td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <pre>"x=5 y=6"</pre>
- * </td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <pre>"x=5 y=6"</pre>
- * </td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>Entity <code>e</code> with literal newline</td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <pre>
- * &lt;!ENTITY e '...&amp;#10;...'&gt; [...]&gt; "x=5&amp;e;y=6"</pre>
- * </td>
- * <td valign='top' rowspan='1' colspan='1'><em>Dependent on Implementation and Load Options</em></td>
- * <td valign='top' rowspan='1' colspan='1'><em>Dependent on Implementation and Load/Save Options</em></td>
- * </tr>
- * </table>
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- */
-public interface Attr extends Node {
- /**
- * Returns the name of this attribute. If <code>Node.localName</code> is
- * different from <code>null</code>, this attribute is a qualified name.
- */
- public String getName();
-
- /**
- * <code>True</code> if this attribute was explicitly given a value in
- * the instance document, <code>false</code> otherwise. If the
- * application changed the value of this attribute node (even if it ends
- * up having the same value as the default value) then it is set to
- * <code>true</code>. The implementation may handle attributes with
- * default values from other schemas similarly but applications should
- * use <code>Document.normalizeDocument()</code> to guarantee this
- * information is up-to-date.
- */
- public boolean getSpecified();
-
- /**
- * On retrieval, the value of the attribute is returned as a string.
- * Character and general entity references are replaced with their
- * values. See also the method <code>getAttribute</code> on the
- * <code>Element</code> interface.
- * <br>On setting, this creates a <code>Text</code> node with the unparsed
- * contents of the string, i.e. any characters that an XML processor
- * would recognize as markup are instead treated as literal text. See
- * also the method <code>Element.setAttribute()</code>.
- * <br> Some specialized implementations, such as some [<a href='http://www.w3.org/TR/2003/REC-SVG11-20030114/'>SVG 1.1</a>]
- * implementations, may do normalization automatically, even after
- * mutation; in such case, the value on retrieval may differ from the
- * value on setting.
- */
- public String getValue();
- /**
- * On retrieval, the value of the attribute is returned as a string.
- * Character and general entity references are replaced with their
- * values. See also the method <code>getAttribute</code> on the
- * <code>Element</code> interface.
- * <br>On setting, this creates a <code>Text</code> node with the unparsed
- * contents of the string, i.e. any characters that an XML processor
- * would recognize as markup are instead treated as literal text. See
- * also the method <code>Element.setAttribute()</code>.
- * <br> Some specialized implementations, such as some [<a href='http://www.w3.org/TR/2003/REC-SVG11-20030114/'>SVG 1.1</a>]
- * implementations, may do normalization automatically, even after
- * mutation; in such case, the value on retrieval may differ from the
- * value on setting.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
- */
- public void setValue(String value)
- throws DOMException;
-
- /**
- * The <code>Element</code> node this attribute is attached to or
- * <code>null</code> if this attribute is not in use.
- * @since DOM Level 2
- */
- public Element getOwnerElement();
-
- /**
- * The type information associated with this attribute. While the type
- * information contained in this attribute is guarantee to be correct
- * after loading the document or invoking
- * <code>Document.normalizeDocument()</code>, <code>schemaTypeInfo</code>
- * may not be reliable if the node was moved.
- * @since DOM Level 3
- */
- public TypeInfo getSchemaTypeInfo();
-
- /**
- * Returns whether this attribute is known to be of type ID (i.e. to
- * contain an identifier for its owner element) or not. When it is and
- * its value is unique, the <code>ownerElement</code> of this attribute
- * can be retrieved using the method <code>Document.getElementById</code>
- * . The implementation could use several ways to determine if an
- * attribute node is known to contain an identifier:
- * <ul>
- * <li> If validation
- * occurred using an XML Schema [<a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/'>XML Schema Part 1</a>]
- * while loading the document or while invoking
- * <code>Document.normalizeDocument()</code>, the post-schema-validation
- * infoset contributions (PSVI contributions) values are used to
- * determine if this attribute is a schema-determined ID attribute using
- * the <a href='http://www.w3.org/TR/2003/REC-xptr-framework-20030325/#term-sdi'>
- * schema-determined ID</a> definition in [<a href='http://www.w3.org/TR/2003/REC-xptr-framework-20030325/'>XPointer</a>]
- * .
- * </li>
- * <li> If validation occurred using a DTD while loading the document or
- * while invoking <code>Document.normalizeDocument()</code>, the infoset <b>[type definition]</b> value is used to determine if this attribute is a DTD-determined ID
- * attribute using the <a href='http://www.w3.org/TR/2003/REC-xptr-framework-20030325/#term-ddi'>
- * DTD-determined ID</a> definition in [<a href='http://www.w3.org/TR/2003/REC-xptr-framework-20030325/'>XPointer</a>]
- * .
- * </li>
- * <li> from the use of the methods <code>Element.setIdAttribute()</code>,
- * <code>Element.setIdAttributeNS()</code>, or
- * <code>Element.setIdAttributeNode()</code>, i.e. it is an
- * user-determined ID attribute;
- * <p ><b>Note:</b> XPointer framework (see section 3.2 in [<a href='http://www.w3.org/TR/2003/REC-xptr-framework-20030325/'>XPointer</a>]
- * ) consider the DOM user-determined ID attribute as being part of the
- * XPointer externally-determined ID definition.
- * </li>
- * <li> using mechanisms that
- * are outside the scope of this specification, it is then an
- * externally-determined ID attribute. This includes using schema
- * languages different from XML schema and DTD.
- * </li>
- * </ul>
- * <br> If validation occurred while invoking
- * <code>Document.normalizeDocument()</code>, all user-determined ID
- * attributes are reset and all attribute nodes ID information are then
- * reevaluated in accordance to the schema used. As a consequence, if
- * the <code>Attr.schemaTypeInfo</code> attribute contains an ID type,
- * <code>isId</code> will always return true.
- * @since DOM Level 3
- */
- public boolean isId();
-
-}
diff --git a/src/org/w3c/dom/CDATASection.java b/src/org/w3c/dom/CDATASection.java
deleted file mode 100644
index 57559ae..0000000
--- a/src/org/w3c/dom/CDATASection.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] in the hope that
- * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * CDATA sections are used to escape blocks of text containing characters that
- * would otherwise be regarded as markup. The only delimiter that is
- * recognized in a CDATA section is the "]]&gt;" string that ends the CDATA
- * section. CDATA sections cannot be nested. Their primary purpose is for
- * including material such as XML fragments, without needing to escape all
- * the delimiters.
- * <p>The <code>CharacterData.data</code> attribute holds the text that is
- * contained by the CDATA section. Note that this <em>may</em> contain characters that need to be escaped outside of CDATA sections and
- * that, depending on the character encoding ("charset") chosen for
- * serialization, it may be impossible to write out some characters as part
- * of a CDATA section.
- * <p>The <code>CDATASection</code> interface inherits from the
- * <code>CharacterData</code> interface through the <code>Text</code>
- * interface. Adjacent <code>CDATASection</code> nodes are not merged by use
- * of the <code>normalize</code> method of the <code>Node</code> interface.
- * <p> No lexical check is done on the content of a CDATA section and it is
- * therefore possible to have the character sequence <code>"]]&gt;"</code>
- * in the content, which is illegal in a CDATA section per section 2.7 of [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>]. The
- * presence of this character sequence must generate a fatal error during
- * serialization or the cdata section must be splitted before the
- * serialization (see also the parameter <code>"split-cdata-sections"</code>
- * in the <code>DOMConfiguration</code> interface).
- * <p ><b>Note:</b> Because no markup is recognized within a
- * <code>CDATASection</code>, character numeric references cannot be used as
- * an escape mechanism when serializing. Therefore, action needs to be taken
- * when serializing a <code>CDATASection</code> with a character encoding
- * where some of the contained characters cannot be represented. Failure to
- * do so would not produce well-formed XML.
- * <p ><b>Note:</b> One potential solution in the serialization process is to
- * end the CDATA section before the character, output the character using a
- * character reference or entity reference, and open a new CDATA section for
- * any further characters in the text node. Note, however, that some code
- * conversion libraries at the time of writing do not return an error or
- * exception when a character is missing from the encoding, making the task
- * of ensuring that data is not corrupted on serialization more difficult.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- */
-public interface CDATASection extends Text {
-}
diff --git a/src/org/w3c/dom/CharacterData.java b/src/org/w3c/dom/CharacterData.java
deleted file mode 100644
index 46618c8..0000000
--- a/src/org/w3c/dom/CharacterData.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] in the hope that
- * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * The <code>CharacterData</code> interface extends Node with a set of
- * attributes and methods for accessing character data in the DOM. For
- * clarity this set is defined here rather than on each object that uses
- * these attributes and methods. No DOM objects correspond directly to
- * <code>CharacterData</code>, though <code>Text</code> and others do
- * inherit the interface from it. All <code>offsets</code> in this interface
- * start from <code>0</code>.
- * <p>As explained in the <code>DOMString</code> interface, text strings in
- * the DOM are represented in UTF-16, i.e. as a sequence of 16-bit units. In
- * the following, the term 16-bit units is used whenever necessary to
- * indicate that indexing on CharacterData is done in 16-bit units.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- */
-public interface CharacterData extends Node {
- /**
- * The character data of the node that implements this interface. The DOM
- * implementation may not put arbitrary limits on the amount of data
- * that may be stored in a <code>CharacterData</code> node. However,
- * implementation limits may mean that the entirety of a node's data may
- * not fit into a single <code>DOMString</code>. In such cases, the user
- * may call <code>substringData</code> to retrieve the data in
- * appropriately sized pieces.
- * @exception DOMException
- * DOMSTRING_SIZE_ERR: Raised when it would return more characters than
- * fit in a <code>DOMString</code> variable on the implementation
- * platform.
- */
- public String getData()
- throws DOMException;
- /**
- * The character data of the node that implements this interface. The DOM
- * implementation may not put arbitrary limits on the amount of data
- * that may be stored in a <code>CharacterData</code> node. However,
- * implementation limits may mean that the entirety of a node's data may
- * not fit into a single <code>DOMString</code>. In such cases, the user
- * may call <code>substringData</code> to retrieve the data in
- * appropriately sized pieces.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
- */
- public void setData(String data)
- throws DOMException;
-
- /**
- * The number of 16-bit units that are available through <code>data</code>
- * and the <code>substringData</code> method below. This may have the
- * value zero, i.e., <code>CharacterData</code> nodes may be empty.
- */
- public int getLength();
-
- /**
- * Extracts a range of data from the node.
- * @param offset Start offset of substring to extract.
- * @param count The number of 16-bit units to extract.
- * @return The specified substring. If the sum of <code>offset</code> and
- * <code>count</code> exceeds the <code>length</code>, then all 16-bit
- * units to the end of the data are returned.
- * @exception DOMException
- * INDEX_SIZE_ERR: Raised if the specified <code>offset</code> is
- * negative or greater than the number of 16-bit units in
- * <code>data</code>, or if the specified <code>count</code> is
- * negative.
- * <br>DOMSTRING_SIZE_ERR: Raised if the specified range of text does
- * not fit into a <code>DOMString</code>.
- */
- public String substringData(int offset,
- int count)
- throws DOMException;
-
- /**
- * Append the string to the end of the character data of the node. Upon
- * success, <code>data</code> provides access to the concatenation of
- * <code>data</code> and the <code>DOMString</code> specified.
- * @param arg The <code>DOMString</code> to append.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- */
- public void appendData(String arg)
- throws DOMException;
-
- /**
- * Insert a string at the specified 16-bit unit offset.
- * @param offset The character offset at which to insert.
- * @param arg The <code>DOMString</code> to insert.
- * @exception DOMException
- * INDEX_SIZE_ERR: Raised if the specified <code>offset</code> is
- * negative or greater than the number of 16-bit units in
- * <code>data</code>.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- */
- public void insertData(int offset,
- String arg)
- throws DOMException;
-
- /**
- * Remove a range of 16-bit units from the node. Upon success,
- * <code>data</code> and <code>length</code> reflect the change.
- * @param offset The offset from which to start removing.
- * @param count The number of 16-bit units to delete. If the sum of
- * <code>offset</code> and <code>count</code> exceeds
- * <code>length</code> then all 16-bit units from <code>offset</code>
- * to the end of the data are deleted.
- * @exception DOMException
- * INDEX_SIZE_ERR: Raised if the specified <code>offset</code> is
- * negative or greater than the number of 16-bit units in
- * <code>data</code>, or if the specified <code>count</code> is
- * negative.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- */
- public void deleteData(int offset,
- int count)
- throws DOMException;
-
- /**
- * Replace the characters starting at the specified 16-bit unit offset
- * with the specified string.
- * @param offset The offset from which to start replacing.
- * @param count The number of 16-bit units to replace. If the sum of
- * <code>offset</code> and <code>count</code> exceeds
- * <code>length</code>, then all 16-bit units to the end of the data
- * are replaced; (i.e., the effect is the same as a <code>remove</code>
- * method call with the same range, followed by an <code>append</code>
- * method invocation).
- * @param arg The <code>DOMString</code> with which the range must be
- * replaced.
- * @exception DOMException
- * INDEX_SIZE_ERR: Raised if the specified <code>offset</code> is
- * negative or greater than the number of 16-bit units in
- * <code>data</code>, or if the specified <code>count</code> is
- * negative.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- */
- public void replaceData(int offset,
- int count,
- String arg)
- throws DOMException;
-
-}
diff --git a/src/org/w3c/dom/Comment.java b/src/org/w3c/dom/Comment.java
deleted file mode 100644
index a8d07a5..0000000
--- a/src/org/w3c/dom/Comment.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] in the hope that
- * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * This interface inherits from <code>CharacterData</code> and represents the
- * content of a comment, i.e., all the characters between the starting '
- * <code>&lt;!--</code>' and ending '<code>--&gt;</code>'. Note that this is
- * the definition of a comment in XML, and, in practice, HTML, although some
- * HTML tools may implement the full SGML comment structure.
- * <p> No lexical check is done on the content of a comment and it is
- * therefore possible to have the character sequence <code>"--"</code>
- * (double-hyphen) in the content, which is illegal in a comment per section
- * 2.5 of [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>]. The
- * presence of this character sequence must generate a fatal error during
- * serialization.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- */
-public interface Comment extends CharacterData {
-}
diff --git a/src/org/w3c/dom/DOMConfiguration.java b/src/org/w3c/dom/DOMConfiguration.java
deleted file mode 100644
index 4a3e66b..0000000
--- a/src/org/w3c/dom/DOMConfiguration.java
+++ /dev/null
@@ -1,442 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] in the hope that
- * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * The <code>DOMConfiguration</code> interface represents the configuration
- * of a document and maintains a table of recognized parameters. Using the
- * configuration, it is possible to change
- * <code>Document.normalizeDocument()</code> behavior, such as replacing the
- * <code>CDATASection</code> nodes with <code>Text</code> nodes or
- * specifying the type of the schema that must be used when the validation
- * of the <code>Document</code> is requested. <code>DOMConfiguration</code>
- * objects are also used in [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407'>DOM Level 3 Load and Save</a>]
- * in the <code>DOMParser</code> and <code>DOMSerializer</code> interfaces.
- * <p> The parameter names used by the <code>DOMConfiguration</code> object
- * are defined throughout the DOM Level 3 specifications. Names are
- * case-insensitive. To avoid possible conflicts, as a convention, names
- * referring to parameters defined outside the DOM specification should be
- * made unique. Because parameters are exposed as properties in names
- * are recommended to follow the section 5.16 Identifiers of [Unicode] with the addition of the character '-' (HYPHEN-MINUS) but it is not
- * enforced by the DOM implementation. DOM Level 3 Core Implementations are
- * required to recognize all parameters defined in this specification. Some
- * parameter values may also be required to be supported by the
- * implementation. Refer to the definition of the parameter to know if a
- * value must be supported or not.
- * <p ><b>Note:</b> Parameters are similar to features and properties used in
- * SAX2 [<a href='http://www.saxproject.org/'>SAX</a>].
- * <p> The following list of parameters defined in the DOM:
- * <dl>
- * <dt>
- * <code>"canonical-form"</code></dt>
- * <dd>
- * <dl>
- * <dt><code>true</code></dt>
- * <dd>[<em>optional</em>] Canonicalize the document according to the rules specified in [<a href='http://www.w3.org/TR/2001/REC-xml-c14n-20010315'>Canonical XML</a>],
- * such as removing the <code>DocumentType</code> node (if any) from the
- * tree, or removing superfluous namespace declarations from each element.
- * Note that this is limited to what can be represented in the DOM; in
- * particular, there is no way to specify the order of the attributes in the
- * DOM. In addition, Setting this parameter to <code>true</code> will also
- * set the state of the parameters listed below. Later changes to the state
- * of one of those parameters will revert "canonical-form" back to
- * <code>false</code>. Parameters set to <code>false</code>: "entities", "
- * normalize-characters", "cdata-sections". Parameters set to
- * <code>true</code>: "namespaces", "namespace-declarations", "well-formed",
- * "element-content-whitespace". Other parameters are not changed unless
- * explicitly specified in the description of the parameters.</dd>
- * <dt>
- * <code>false</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>)Do not canonicalize the document.</dd>
- * </dl></dd>
- * <dt><code>"cdata-sections"</code></dt>
- * <dd>
- * <dl>
- * <dt>
- * <code>true</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>)Keep <code>CDATASection</code> nodes in the document.</dd>
- * <dt><code>false</code></dt>
- * <dd>[<em>required</em>]Transform <code>CDATASection</code> nodes in the document into
- * <code>Text</code> nodes. The new <code>Text</code> node is then combined
- * with any adjacent <code>Text</code> node.</dd>
- * </dl></dd>
- * <dt>
- * <code>"check-character-normalization"</code></dt>
- * <dd>
- * <dl>
- * <dt><code>true</code></dt>
- * <dd>[<em>optional</em>] Check if the characters in the document are <a href='http://www.w3.org/TR/2004/REC-xml11-20040204/#dt-fullnorm'>fully
- * normalized</a>, as defined in appendix B of [<a href='http://www.w3.org/TR/2004/REC-xml11-20040204/'>XML 1.1</a>]. When a
- * sequence of characters is encountered that fails normalization checking,
- * an error with the <code>DOMError.type</code> equals to
- * "check-character-normalization-failure" is issued. </dd>
- * <dt><code>false</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>)Do not check if characters are normalized.</dd>
- * </dl></dd>
- * <dt><code>"comments"</code></dt>
- * <dd>
- * <dl>
- * <dt>
- * <code>true</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>)Keep <code>Comment</code> nodes in the document.</dd>
- * <dt><code>false</code></dt>
- * <dd>[<em>required</em>]Discard <code>Comment</code> nodes in the document.</dd>
- * </dl></dd>
- * <dt>
- * <code>"datatype-normalization"</code></dt>
- * <dd>
- * <dl>
- * <dt><code>true</code></dt>
- * <dd>[<em>optional</em>] Expose schema normalized values in the tree, such as <a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/#key-nv'>XML
- * Schema normalized values</a> in the case of XML Schema. Since this parameter requires to have schema
- * information, the "validate" parameter will also be set to
- * <code>true</code>. Having this parameter activated when "validate" is
- * <code>false</code> has no effect and no schema-normalization will happen.
- * <p ><b>Note:</b> Since the document contains the result of the XML 1.0
- * processing, this parameter does not apply to attribute value
- * normalization as defined in section 3.3.3 of [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>] and is only
- * meant for schema languages other than Document Type Definition (DTD). </dd>
- * <dt>
- * <code>false</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>) Do not perform schema normalization on the tree. </dd>
- * </dl></dd>
- * <dt>
- * <code>"element-content-whitespace"</code></dt>
- * <dd>
- * <dl>
- * <dt><code>true</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>)Keep all whitespaces in the document.</dd>
- * <dt><code>false</code></dt>
- * <dd>[<em>optional</em>] Discard all <code>Text</code> nodes that contain whitespaces in element
- * content, as described in <a href='http://www.w3.org/TR/2004/REC-xml-infoset-20040204#infoitem.character'>
- * [element content whitespace]</a>. The implementation is expected to use the attribute
- * <code>Text.isElementContentWhitespace</code> to determine if a
- * <code>Text</code> node should be discarded or not.</dd>
- * </dl></dd>
- * <dt><code>"entities"</code></dt>
- * <dd>
- * <dl>
- * <dt>
- * <code>true</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>)Keep <code>EntityReference</code> nodes in the document.</dd>
- * <dt>
- * <code>false</code></dt>
- * <dd>[<em>required</em>] Remove all <code>EntityReference</code> nodes from the document,
- * putting the entity expansions directly in their place. <code>Text</code>
- * nodes are normalized, as defined in <code>Node.normalize</code>. Only <a href='http://www.w3.org/TR/2004/REC-xml-infoset-20040204/#infoitem.rse'>
- * unexpanded entity references</a> are kept in the document. </dd>
- * </dl>
- * <p ><b>Note:</b> This parameter does not affect <code>Entity</code> nodes. </dd>
- * <dt>
- * <code>"error-handler"</code></dt>
- * <dd>[<em>required</em>] Contains a <code>DOMErrorHandler</code> object. If an error is
- * encountered in the document, the implementation will call back the
- * <code>DOMErrorHandler</code> registered using this parameter. The
- * implementation may provide a default <code>DOMErrorHandler</code> object.
- * When called, <code>DOMError.relatedData</code> will contain the closest
- * node to where the error occurred. If the implementation is unable to
- * determine the node where the error occurs,
- * <code>DOMError.relatedData</code> will contain the <code>Document</code>
- * node. Mutations to the document from within an error handler will result
- * in implementation dependent behavior. </dd>
- * <dt><code>"infoset"</code></dt>
- * <dd>
- * <dl>
- * <dt>
- * <code>true</code></dt>
- * <dd>[<em>required</em>]Keep in the document the information defined in the XML Information Set [<a href='http://www.w3.org/TR/2004/REC-xml-infoset-20040204/'>XML Information Set</a>]
- * .This forces the following parameters to <code>false</code>: "
- * validate-if-schema", "entities", "datatype-normalization", "cdata-sections
- * ".This forces the following parameters to <code>true</code>: "
- * namespace-declarations", "well-formed", "element-content-whitespace", "
- * comments", "namespaces".Other parameters are not changed unless
- * explicitly specified in the description of the parameters. Note that
- * querying this parameter with <code>getParameter</code> returns
- * <code>true</code> only if the individual parameters specified above are
- * appropriately set.</dd>
- * <dt><code>false</code></dt>
- * <dd>Setting <code>infoset</code> to
- * <code>false</code> has no effect.</dd>
- * </dl></dd>
- * <dt><code>"namespaces"</code></dt>
- * <dd>
- * <dl>
- * <dt>
- * <code>true</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>) Perform the namespace processing as defined in . </dd>
- * <dt><code>false</code></dt>
- * <dd>[<em>optional</em>] Do not perform the namespace processing. </dd>
- * </dl></dd>
- * <dt>
- * <code>"namespace-declarations"</code></dt>
- * <dd> This parameter has no effect if the
- * parameter "namespaces" is set to <code>false</code>.
- * <dl>
- * <dt><code>true</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>) Include namespace declaration attributes, specified or defaulted from
- * the schema, in the document. See also the sections "Declaring Namespaces"
- * in [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>]
- * and [<a href='http://www.w3.org/TR/2004/REC-xml-names11-20040204/'>XML Namespaces 1.1</a>]
- * .</dd>
- * <dt><code>false</code></dt>
- * <dd>[<em>required</em>]Discard all namespace declaration attributes. The namespace prefixes (
- * <code>Node.prefix</code>) are retained even if this parameter is set to
- * <code>false</code>.</dd>
- * </dl></dd>
- * <dt><code>"normalize-characters"</code></dt>
- * <dd>
- * <dl>
- * <dt><code>true</code></dt>
- * <dd>[<em>optional</em>] <a href='http://www.w3.org/TR/2004/REC-xml11-20040204/#dt-fullnorm'>Fully
- * normalized</a> the characters in the document as defined in appendix B of [<a href='http://www.w3.org/TR/2004/REC-xml11-20040204/'>XML 1.1</a>]. </dd>
- * <dt>
- * <code>false</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>)Do not perform character normalization.</dd>
- * </dl></dd>
- * <dt><code>"schema-location"</code></dt>
- * <dd>[<em>optional</em>] Represent a <code>DOMString</code> object containing a list of URIs,
- * separated by whitespaces (characters matching the <a href='http://www.w3.org/TR/2004/REC-xml-20040204#NT-S'>nonterminal
- * production S</a> defined in section 2.3 [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>]), that
- * represents the schemas against which validation should occur, i.e. the
- * current schema. The types of schemas referenced in this list must match
- * the type specified with <code>schema-type</code>, otherwise the behavior
- * of an implementation is undefined. The schemas specified using this
- * property take precedence to the schema information specified in the
- * document itself. For namespace aware schema, if a schema specified using
- * this property and a schema specified in the document instance (i.e. using
- * the <code>schemaLocation</code> attribute) in a schema document (i.e.
- * using schema <code>import</code> mechanisms) share the same
- * <code>targetNamespace</code>, the schema specified by the user using this
- * property will be used. If two schemas specified using this property share
- * the same <code>targetNamespace</code> or have no namespace, the behavior
- * is implementation dependent. If no location has been provided, this
- * parameter is <code>null</code>.
- * <p ><b>Note:</b> The <code>"schema-location"</code> parameter is ignored
- * unless the "schema-type" parameter value is set. It is strongly
- * recommended that <code>Document.documentURI</code> will be set so that an
- * implementation can successfully resolve any external entities referenced. </dd>
- * <dt>
- * <code>"schema-type"</code></dt>
- * <dd>[<em>optional</em>] Represent a <code>DOMString</code> object containing an absolute URI
- * and representing the type of the schema language used to validate a
- * document against. Note that no lexical checking is done on the absolute
- * URI. If this parameter is not set, a default value may be provided by
- * the implementation, based on the schema languages supported and on the
- * schema language used at load time. If no value is provided, this
- * parameter is <code>null</code>.
- * <p ><b>Note:</b> For XML Schema [<a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/'>XML Schema Part 1</a>]
- * , applications must use the value
- * <code>"http://www.w3.org/2001/XMLSchema"</code>. For XML DTD [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>],
- * applications must use the value
- * <code>"http://www.w3.org/TR/REC-xml"</code>. Other schema languages are
- * outside the scope of the W3C and therefore should recommend an absolute
- * URI in order to use this method. </dd>
- * <dt><code>"split-cdata-sections"</code></dt>
- * <dd>
- * <dl>
- * <dt>
- * <code>true</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>)Split CDATA sections containing the CDATA section termination marker
- * ']]&gt;'. When a CDATA section is split a warning is issued with a
- * <code>DOMError.type</code> equals to
- * <code>"cdata-sections-splitted"</code> and
- * <code>DOMError.relatedData</code> equals to the first
- * <code>CDATASection</code> node in document order resulting from the split.</dd>
- * <dt>
- * <code>false</code></dt>
- * <dd>[<em>required</em>]Signal an error if a <code>CDATASection</code> contains an
- * unrepresentable character.</dd>
- * </dl></dd>
- * <dt><code>"validate"</code></dt>
- * <dd>
- * <dl>
- * <dt><code>true</code></dt>
- * <dd>[<em>optional</em>] Require the validation against a schema (i.e. XML schema, DTD, any
- * other type or representation of schema) of the document as it is being
- * normalized as defined by [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>]. If
- * validation errors are found, or no schema was found, the error handler is
- * notified. Schema-normalized values will not be exposed according to the
- * schema in used unless the parameter "datatype-normalization" is
- * <code>true</code>. This parameter will reevaluate:
- * <ul>
- * <li> Attribute nodes with
- * <code>Attr.specified</code> equals to <code>false</code>, as specified in
- * the description of the <code>Attr</code> interface;
- * </li>
- * <li> The value of the
- * attribute <code>Text.isElementContentWhitespace</code> for all
- * <code>Text</code> nodes;
- * </li>
- * <li> The value of the attribute
- * <code>Attr.isId</code> for all <code>Attr</code> nodes;
- * </li>
- * <li> The attributes
- * <code>Element.schemaTypeInfo</code> and <code>Attr.schemaTypeInfo</code>.
- * </li>
- * </ul>
- * <p ><b>Note:</b> "validate-if-schema" and "validate" are mutually
- * exclusive, setting one of them to <code>true</code> will set the other
- * one to <code>false</code>. Applications should also consider setting the
- * parameter "well-formed" to <code>true</code>, which is the default for
- * that option, when validating the document. </dd>
- * <dt><code>false</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>) Do not accomplish schema processing, including the internal subset
- * processing. Default attribute values information are kept. Note that
- * validation might still happen if "validate-if-schema" is <code>true</code>
- * . </dd>
- * </dl></dd>
- * <dt><code>"validate-if-schema"</code></dt>
- * <dd>
- * <dl>
- * <dt><code>true</code></dt>
- * <dd>[<em>optional</em>]Enable validation only if a declaration for the document element can be
- * found in a schema (independently of where it is found, i.e. XML schema,
- * DTD, or any other type or representation of schema). If validation is
- * enabled, this parameter has the same behavior as the parameter "validate"
- * set to <code>true</code>.
- * <p ><b>Note:</b> "validate-if-schema" and "validate" are mutually
- * exclusive, setting one of them to <code>true</code> will set the other
- * one to <code>false</code>. </dd>
- * <dt><code>false</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>) No schema processing should be performed if the document has a schema,
- * including internal subset processing. Default attribute values
- * information are kept. Note that validation must still happen if "validate
- * " is <code>true</code>. </dd>
- * </dl></dd>
- * <dt><code>"well-formed"</code></dt>
- * <dd>
- * <dl>
- * <dt><code>true</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>) Check if all nodes are XML well formed according to the XML version in
- * use in <code>Document.xmlVersion</code>:
- * <ul>
- * <li> check if the attribute
- * <code>Node.nodeName</code> contains invalid characters according to its
- * node type and generate a <code>DOMError</code> of type
- * <code>"wf-invalid-character-in-node-name"</code>, with a
- * <code>DOMError.SEVERITY_ERROR</code> severity, if necessary;
- * </li>
- * <li> check if
- * the text content inside <code>Attr</code>, <code>Element</code>,
- * <code>Comment</code>, <code>Text</code>, <code>CDATASection</code> nodes
- * for invalid characters and generate a <code>DOMError</code> of type
- * <code>"wf-invalid-character"</code>, with a
- * <code>DOMError.SEVERITY_ERROR</code> severity, if necessary;
- * </li>
- * <li> check if
- * the data inside <code>ProcessingInstruction</code> nodes for invalid
- * characters and generate a <code>DOMError</code> of type
- * <code>"wf-invalid-character"</code>, with a
- * <code>DOMError.SEVERITY_ERROR</code> severity, if necessary;
- * </li>
- * </ul></dd>
- * <dt>
- * <code>false</code></dt>
- * <dd>[<em>optional</em>] Do not check for XML well-formedness. </dd>
- * </dl></dd>
- * </dl>
- * <p> The resolution of the system identifiers associated with entities is
- * done using <code>Document.documentURI</code>. However, when the feature
- * "LS" defined in [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407'>DOM Level 3 Load and Save</a>]
- * is supported by the DOM implementation, the parameter
- * "resource-resolver" can also be used on <code>DOMConfiguration</code>
- * objects attached to <code>Document</code> nodes. If this parameter is
- * set, <code>Document.normalizeDocument()</code> will invoke the resource
- * resolver instead of using <code>Document.documentURI</code>.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- * @since DOM Level 3
- */
-public interface DOMConfiguration {
- /**
- * Set the value of a parameter.
- * @param name The name of the parameter to set.
- * @param value The new value or <code>null</code> if the user wishes to
- * unset the parameter. While the type of the value parameter is
- * defined as <code>DOMUserData</code>, the object type must match the
- * type defined by the definition of the parameter. For example, if
- * the parameter is "error-handler", the value must be of type
- * <code>DOMErrorHandler</code>.
- * @exception DOMException
- * NOT_FOUND_ERR: Raised when the parameter name is not recognized.
- * <br> NOT_SUPPORTED_ERR: Raised when the parameter name is recognized
- * but the requested value cannot be set.
- * <br> TYPE_MISMATCH_ERR: Raised if the value type for this parameter
- * name is incompatible with the expected value type.
- */
- public void setParameter(String name,
- Object value)
- throws DOMException;
-
- /**
- * Return the value of a parameter if known.
- * @param name The name of the parameter.
- * @return The current object associated with the specified parameter or
- * <code>null</code> if no object has been associated or if the
- * parameter is not supported.
- * @exception DOMException
- * NOT_FOUND_ERR: Raised when the parameter name is not recognized.
- */
- public Object getParameter(String name)
- throws DOMException;
-
- /**
- * Check if setting a parameter to a specific value is supported.
- * @param name The name of the parameter to check.
- * @param value An object. if <code>null</code>, the returned value is
- * <code>true</code>.
- * @return <code>true</code> if the parameter could be successfully set
- * to the specified value, or <code>false</code> if the parameter is
- * not recognized or the requested value is not supported. This does
- * not change the current value of the parameter itself.
- */
- public boolean canSetParameter(String name,
- Object value);
-
- /**
- * The list of the parameters supported by this
- * <code>DOMConfiguration</code> object and for which at least one value
- * can be set by the application. Note that this list can also contain
- * parameter names defined outside this specification.
- */
- public DOMStringList getParameterNames();
-
-}
diff --git a/src/org/w3c/dom/DOMError.java b/src/org/w3c/dom/DOMError.java
deleted file mode 100644
index 15821c8..0000000
--- a/src/org/w3c/dom/DOMError.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] in the hope that
- * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * <code>DOMError</code> is an interface that describes an error.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- * @since DOM Level 3
- */
-public interface DOMError {
- // ErrorSeverity
- /**
- * The severity of the error described by the <code>DOMError</code> is
- * warning. A <code>SEVERITY_WARNING</code> will not cause the
- * processing to stop, unless <code>DOMErrorHandler.handleError()</code>
- * returns <code>false</code>.
- */
- public static final short SEVERITY_WARNING = 1;
- /**
- * The severity of the error described by the <code>DOMError</code> is
- * error. A <code>SEVERITY_ERROR</code> may not cause the processing to
- * stop if the error can be recovered, unless
- * <code>DOMErrorHandler.handleError()</code> returns <code>false</code>.
- */
- public static final short SEVERITY_ERROR = 2;
- /**
- * The severity of the error described by the <code>DOMError</code> is
- * fatal error. A <code>SEVERITY_FATAL_ERROR</code> will cause the
- * normal processing to stop. The return value of
- * <code>DOMErrorHandler.handleError()</code> is ignored unless the
- * implementation chooses to continue, in which case the behavior
- * becomes undefined.
- */
- public static final short SEVERITY_FATAL_ERROR = 3;
-
- /**
- * The severity of the error, either <code>SEVERITY_WARNING</code>,
- * <code>SEVERITY_ERROR</code>, or <code>SEVERITY_FATAL_ERROR</code>.
- */
- public short getSeverity();
-
- /**
- * An implementation specific string describing the error that occurred.
- */
- public String getMessage();
-
- /**
- * A <code>DOMString</code> indicating which related data is expected in
- * <code>relatedData</code>. Users should refer to the specification of
- * the error in order to find its <code>DOMString</code> type and
- * <code>relatedData</code> definitions if any.
- * <p ><b>Note:</b> As an example,
- * <code>Document.normalizeDocument()</code> does generate warnings when
- * the "split-cdata-sections" parameter is in use. Therefore, the method
- * generates a <code>SEVERITY_WARNING</code> with <code>type</code>
- * <code>"cdata-sections-splitted"</code> and the first
- * <code>CDATASection</code> node in document order resulting from the
- * split is returned by the <code>relatedData</code> attribute.
- */
- public String getType();
-
- /**
- * The related platform dependent exception if any.
- */
- public Object getRelatedException();
-
- /**
- * The related <code>DOMError.type</code> dependent data if any.
- */
- public Object getRelatedData();
-
- /**
- * The location of the error.
- */
- public DOMLocator getLocation();
-
-}
diff --git a/src/org/w3c/dom/DOMErrorHandler.java b/src/org/w3c/dom/DOMErrorHandler.java
deleted file mode 100644
index 1de0cb9..0000000
--- a/src/org/w3c/dom/DOMErrorHandler.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] in the hope that
- * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * <code>DOMErrorHandler</code> is a callback interface that the DOM
- * implementation can call when reporting errors that happens while
- * processing XML data, or when doing some other processing (e.g. validating
- * a document). A <code>DOMErrorHandler</code> object can be attached to a
- * <code>Document</code> using the "error-handler" on the
- * <code>DOMConfiguration</code> interface. If more than one error needs to
- * be reported during an operation, the sequence and numbers of the errors
- * passed to the error handler are implementation dependent.
- * <p> The application that is using the DOM implementation is expected to
- * implement this interface.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- * @since DOM Level 3
- */
-public interface DOMErrorHandler {
- /**
- * This method is called on the error handler when an error occurs.
- * <br> If an exception is thrown from this method, it is considered to be
- * equivalent of returning <code>true</code>.
- * @param error The error object that describes the error. This object
- * may be reused by the DOM implementation across multiple calls to
- * the <code>handleError</code> method.
- * @return If the <code>handleError</code> method returns
- * <code>false</code>, the DOM implementation should stop the current
- * processing when possible. If the method returns <code>true</code>,
- * the processing may continue depending on
- * <code>DOMError.severity</code>.
- */
- public boolean handleError(DOMError error);
-
-}
diff --git a/src/org/w3c/dom/DOMException.java b/src/org/w3c/dom/DOMException.java
deleted file mode 100644
index b351b7b..0000000
--- a/src/org/w3c/dom/DOMException.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] in the hope that
- * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * DOM operations only raise exceptions in "exceptional" circumstances, i.e.,
- * when an operation is impossible to perform (either for logical reasons,
- * because data is lost, or because the implementation has become unstable).
- * In general, DOM methods return specific error values in ordinary
- * processing situations, such as out-of-bound errors when using
- * <code>NodeList</code>.
- * <p>Implementations should raise other exceptions under other circumstances.
- * For example, implementations should raise an implementation-dependent
- * exception if a <code>null</code> argument is passed when <code>null</code>
- * was not expected.
- * <p>Some languages and object systems do not support the concept of
- * exceptions. For such systems, error conditions may be indicated using
- * native error reporting mechanisms. For some bindings, for example,
- * methods may return error codes similar to those listed in the
- * corresponding method descriptions.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- */
-public class DOMException extends RuntimeException {
- public DOMException(short code, String message) {
- super(message);
- this.code = code;
- }
- public short code;
- // ExceptionCode
- /**
- * If index or size is negative, or greater than the allowed value.
- */
- public static final short INDEX_SIZE_ERR = 1;
- /**
- * If the specified range of text does not fit into a
- * <code>DOMString</code>.
- */
- public static final short DOMSTRING_SIZE_ERR = 2;
- /**
- * If any <code>Node</code> is inserted somewhere it doesn't belong.
- */
- public static final short HIERARCHY_REQUEST_ERR = 3;
- /**
- * If a <code>Node</code> is used in a different document than the one
- * that created it (that doesn't support it).
- */
- public static final short WRONG_DOCUMENT_ERR = 4;
- /**
- * If an invalid or illegal character is specified, such as in an XML name.
- */
- public static final short INVALID_CHARACTER_ERR = 5;
- /**
- * If data is specified for a <code>Node</code> which does not support
- * data.
- */
- public static final short NO_DATA_ALLOWED_ERR = 6;
- /**
- * If an attempt is made to modify an object where modifications are not
- * allowed.
- */
- public static final short NO_MODIFICATION_ALLOWED_ERR = 7;
- /**
- * If an attempt is made to reference a <code>Node</code> in a context
- * where it does not exist.
- */
- public static final short NOT_FOUND_ERR = 8;
- /**
- * If the implementation does not support the requested type of object or
- * operation.
- */
- public static final short NOT_SUPPORTED_ERR = 9;
- /**
- * If an attempt is made to add an attribute that is already in use
- * elsewhere.
- */
- public static final short INUSE_ATTRIBUTE_ERR = 10;
- /**
- * If an attempt is made to use an object that is not, or is no longer,
- * usable.
- * @since DOM Level 2
- */
- public static final short INVALID_STATE_ERR = 11;
- /**
- * If an invalid or illegal string is specified.
- * @since DOM Level 2
- */
- public static final short SYNTAX_ERR = 12;
- /**
- * If an attempt is made to modify the type of the underlying object.
- * @since DOM Level 2
- */
- public static final short INVALID_MODIFICATION_ERR = 13;
- /**
- * If an attempt is made to create or change an object in a way which is
- * incorrect with regard to namespaces.
- * @since DOM Level 2
- */
- public static final short NAMESPACE_ERR = 14;
- /**
- * If a parameter or an operation is not supported by the underlying
- * object.
- * @since DOM Level 2
- */
- public static final short INVALID_ACCESS_ERR = 15;
- /**
- * If a call to a method such as <code>insertBefore</code> or
- * <code>removeChild</code> would make the <code>Node</code> invalid
- * with respect to "partial validity", this exception would be raised
- * and the operation would not be done. This code is used in [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Val-20040127/'>DOM Level 3 Validation</a>]
- * . Refer to this specification for further information.
- * @since DOM Level 3
- */
- public static final short VALIDATION_ERR = 16;
- /**
- * If the type of an object is incompatible with the expected type of the
- * parameter associated to the object.
- * @since DOM Level 3
- */
- public static final short TYPE_MISMATCH_ERR = 17;
-
- // Added serialVersionUID to preserve binary compatibility
- static final long serialVersionUID = 6627732366795969916L;
-}
diff --git a/src/org/w3c/dom/DOMImplementation.java b/src/org/w3c/dom/DOMImplementation.java
deleted file mode 100644
index acf79fe..0000000
--- a/src/org/w3c/dom/DOMImplementation.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] in the hope that
- * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * The <code>DOMImplementation</code> interface provides a number of methods
- * for performing operations that are independent of any particular instance
- * of the document object model.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- */
-public interface DOMImplementation {
- /**
- * Test if the DOM implementation implements a specific feature and
- * version, as specified in <a href="http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#DOMFeatures">DOM Features</a>.
- * @param feature The name of the feature to test.
- * @param version This is the version number of the feature to test.
- * @return <code>true</code> if the feature is implemented in the
- * specified version, <code>false</code> otherwise.
- */
- public boolean hasFeature(String feature,
- String version);
-
- /**
- * Creates an empty <code>DocumentType</code> node. Entity declarations
- * and notations are not made available. Entity reference expansions and
- * default attribute additions do not occur..
- * @param qualifiedName The qualified name of the document type to be
- * created.
- * @param publicId The external subset public identifier.
- * @param systemId The external subset system identifier.
- * @return A new <code>DocumentType</code> node with
- * <code>Node.ownerDocument</code> set to <code>null</code>.
- * @exception DOMException
- * INVALID_CHARACTER_ERR: Raised if the specified qualified name is not
- * an XML name according to [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>].
- * <br>NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is
- * malformed.
- * <br>NOT_SUPPORTED_ERR: May be raised if the implementation does not
- * support the feature "XML" and the language exposed through the
- * Document does not support XML Namespaces (such as [<a href='http://www.w3.org/TR/1999/REC-html401-19991224/'>HTML 4.01</a>]).
- * @since DOM Level 2
- */
- public DocumentType createDocumentType(String qualifiedName,
- String publicId,
- String systemId)
- throws DOMException;
-
- /**
- * Creates a DOM Document object of the specified type with its document
- * element.
- * <br>Note that based on the <code>DocumentType</code> given to create
- * the document, the implementation may instantiate specialized
- * <code>Document</code> objects that support additional features than
- * the "Core", such as "HTML" [<a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>DOM Level 2 HTML</a>]
- * . On the other hand, setting the <code>DocumentType</code> after the
- * document was created makes this very unlikely to happen.
- * Alternatively, specialized <code>Document</code> creation methods,
- * such as <code>createHTMLDocument</code> [<a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>DOM Level 2 HTML</a>]
- * , can be used to obtain specific types of <code>Document</code>
- * objects.
- * @param namespaceURI The namespace URI of the document element to
- * create or <code>null</code>.
- * @param qualifiedName The qualified name of the document element to be
- * created or <code>null</code>.
- * @param doctype The type of document to be created or <code>null</code>.
- * When <code>doctype</code> is not <code>null</code>, its
- * <code>Node.ownerDocument</code> attribute is set to the document
- * being created.
- * @return A new <code>Document</code> object with its document element.
- * If the <code>NamespaceURI</code>, <code>qualifiedName</code>, and
- * <code>doctype</code> are <code>null</code>, the returned
- * <code>Document</code> is empty with no document element.
- * @exception DOMException
- * INVALID_CHARACTER_ERR: Raised if the specified qualified name is not
- * an XML name according to [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>].
- * <br>NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is
- * malformed, if the <code>qualifiedName</code> has a prefix and the
- * <code>namespaceURI</code> is <code>null</code>, or if the
- * <code>qualifiedName</code> is <code>null</code> and the
- * <code>namespaceURI</code> is different from <code>null</code>, or
- * if the <code>qualifiedName</code> has a prefix that is "xml" and
- * the <code>namespaceURI</code> is different from "<a href='http://www.w3.org/XML/1998/namespace'>
- * http://www.w3.org/XML/1998/namespace</a>" [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>]
- * , or if the DOM implementation does not support the
- * <code>"XML"</code> feature but a non-null namespace URI was
- * provided, since namespaces were defined by XML.
- * <br>WRONG_DOCUMENT_ERR: Raised if <code>doctype</code> has already
- * been used with a different document or was created from a different
- * implementation.
- * <br>NOT_SUPPORTED_ERR: May be raised if the implementation does not
- * support the feature "XML" and the language exposed through the
- * Document does not support XML Namespaces (such as [<a href='http://www.w3.org/TR/1999/REC-html401-19991224/'>HTML 4.01</a>]).
- * @since DOM Level 2
- */
- public Document createDocument(String namespaceURI,
- String qualifiedName,
- DocumentType doctype)
- throws DOMException;
-
- /**
- * This method returns a specialized object which implements the
- * specialized APIs of the specified feature and version, as specified
- * in <a href="http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#DOMFeatures">DOM Features</a>. The specialized object may also be obtained by using
- * binding-specific casting methods but is not necessarily expected to,
- * as discussed in . This method also allow the implementation to
- * provide specialized objects which do not support the
- * <code>DOMImplementation</code> interface.
- * @param feature The name of the feature requested. Note that any plus
- * sign "+" prepended to the name of the feature will be ignored since
- * it is not significant in the context of this method.
- * @param version This is the version number of the feature to test.
- * @return Returns an object which implements the specialized APIs of
- * the specified feature and version, if any, or <code>null</code> if
- * there is no object which implements interfaces associated with that
- * feature. If the <code>DOMObject</code> returned by this method
- * implements the <code>DOMImplementation</code> interface, it must
- * delegate to the primary core <code>DOMImplementation</code> and not
- * return results inconsistent with the primary core
- * <code>DOMImplementation</code> such as <code>hasFeature</code>,
- * <code>getFeature</code>, etc.
- * @since DOM Level 3
- */
- public Object getFeature(String feature,
- String version);
-
-}
diff --git a/src/org/w3c/dom/DOMImplementationList.java b/src/org/w3c/dom/DOMImplementationList.java
deleted file mode 100644
index d7712f2..0000000
--- a/src/org/w3c/dom/DOMImplementationList.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] in the hope that
- * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * The <code>DOMImplementationList</code> interface provides the abstraction
- * of an ordered collection of DOM implementations, without defining or
- * constraining how this collection is implemented. The items in the
- * <code>DOMImplementationList</code> are accessible via an integral index,
- * starting from 0.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- * @since DOM Level 3
- */
-public interface DOMImplementationList {
- /**
- * Returns the <code>index</code>th item in the collection. If
- * <code>index</code> is greater than or equal to the number of
- * <code>DOMImplementation</code>s in the list, this returns
- * <code>null</code>.
- * @param index Index into the collection.
- * @return The <code>DOMImplementation</code> at the <code>index</code>
- * th position in the <code>DOMImplementationList</code>, or
- * <code>null</code> if that is not a valid index.
- */
- public DOMImplementation item(int index);
-
- /**
- * The number of <code>DOMImplementation</code>s in the list. The range
- * of valid child node indices is 0 to <code>length-1</code> inclusive.
- */
- public int getLength();
-
-}
diff --git a/src/org/w3c/dom/DOMImplementationSource.java b/src/org/w3c/dom/DOMImplementationSource.java
deleted file mode 100644
index 41aa1ab..0000000
--- a/src/org/w3c/dom/DOMImplementationSource.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] in the hope that
- * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * This interface permits a DOM implementer to supply one or more
- * implementations, based upon requested features and versions, as specified
- * in <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#DOMFeatures'>DOM
- * Features</a>. Each implemented <code>DOMImplementationSource</code> object is
- * listed in the binding-specific list of available sources so that its
- * <code>DOMImplementation</code> objects are made available.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- * @since DOM Level 3
- */
-public interface DOMImplementationSource {
- /**
- * A method to request the first DOM implementation that supports the
- * specified features.
- * @param features A string that specifies which features and versions
- * are required. This is a space separated list in which each feature
- * is specified by its name optionally followed by a space and a
- * version number. This method returns the first item of the list
- * returned by <code>getDOMImplementationList</code>. As an example,
- * the string <code>"XML 3.0 Traversal +Events 2.0"</code> will
- * request a DOM implementation that supports the module "XML" for its
- * 3.0 version, a module that support of the "Traversal" module for
- * any version, and the module "Events" for its 2.0 version. The
- * module "Events" must be accessible using the method
- * <code>Node.getFeature()</code> and
- * <code>DOMImplementation.getFeature()</code>.
- * @return The first DOM implementation that support the desired
- * features, or <code>null</code> if this source has none.
- */
- public DOMImplementation getDOMImplementation(String features);
-
- /**
- * A method to request a list of DOM implementations that support the
- * specified features and versions, as specified in .
- * @param features A string that specifies which features and versions
- * are required. This is a space separated list in which each feature
- * is specified by its name optionally followed by a space and a
- * version number. This is something like: "XML 3.0 Traversal +Events
- * 2.0"
- * @return A list of DOM implementations that support the desired
- * features.
- */
- public DOMImplementationList getDOMImplementationList(String features);
-
-}
diff --git a/src/org/w3c/dom/DOMLocator.java b/src/org/w3c/dom/DOMLocator.java
deleted file mode 100644
index 9104976..0000000
--- a/src/org/w3c/dom/DOMLocator.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] in the hope that
- * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * <code>DOMLocator</code> is an interface that describes a location (e.g.
- * where an error occurred).
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- * @since DOM Level 3
- */
-public interface DOMLocator {
- /**
- * The line number this locator is pointing to, or <code>-1</code> if
- * there is no column number available.
- */
- public int getLineNumber();
-
- /**
- * The column number this locator is pointing to, or <code>-1</code> if
- * there is no column number available.
- */
- public int getColumnNumber();
-
- /**
- * The byte offset into the input source this locator is pointing to or
- * <code>-1</code> if there is no byte offset available.
- */
- public int getByteOffset();
-
- /**
- * The UTF-16, as defined in [Unicode] and Amendment 1 of [ISO/IEC 10646], offset into the input source this locator is pointing to or
- * <code>-1</code> if there is no UTF-16 offset available.
- */
- public int getUtf16Offset();
-
- /**
- * The node this locator is pointing to, or <code>null</code> if no node
- * is available.
- */
- public Node getRelatedNode();
-
- /**
- * The URI this locator is pointing to, or <code>null</code> if no URI is
- * available.
- */
- public String getUri();
-
-}
diff --git a/src/org/w3c/dom/DOMStringList.java b/src/org/w3c/dom/DOMStringList.java
deleted file mode 100644
index 670bdd0..0000000
--- a/src/org/w3c/dom/DOMStringList.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] in the hope that
- * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * The <code>DOMStringList</code> interface provides the abstraction of an
- * ordered collection of <code>DOMString</code> values, without defining or
- * constraining how this collection is implemented. The items in the
- * <code>DOMStringList</code> are accessible via an integral index, starting
- * from 0.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- * @since DOM Level 3
- */
-public interface DOMStringList {
- /**
- * Returns the <code>index</code>th item in the collection. If
- * <code>index</code> is greater than or equal to the number of
- * <code>DOMString</code>s in the list, this returns <code>null</code>.
- * @param index Index into the collection.
- * @return The <code>DOMString</code> at the <code>index</code>th
- * position in the <code>DOMStringList</code>, or <code>null</code> if
- * that is not a valid index.
- */
- public String item(int index);
-
- /**
- * The number of <code>DOMString</code>s in the list. The range of valid
- * child node indices is 0 to <code>length-1</code> inclusive.
- */
- public int getLength();
-
- /**
- * Test if a string is part of this <code>DOMStringList</code>.
- * @param str The string to look for.
- * @return <code>true</code> if the string has been found,
- * <code>false</code> otherwise.
- */
- public boolean contains(String str);
-
-}
diff --git a/src/org/w3c/dom/Document.java b/src/org/w3c/dom/Document.java
deleted file mode 100644
index 5e489ac..0000000
--- a/src/org/w3c/dom/Document.java
+++ /dev/null
@@ -1,844 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] in the hope that
- * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * The <code>Document</code> interface represents the entire HTML or XML
- * document. Conceptually, it is the root of the document tree, and provides
- * the primary access to the document's data.
- * <p>Since elements, text nodes, comments, processing instructions, etc.
- * cannot exist outside the context of a <code>Document</code>, the
- * <code>Document</code> interface also contains the factory methods needed
- * to create these objects. The <code>Node</code> objects created have a
- * <code>ownerDocument</code> attribute which associates them with the
- * <code>Document</code> within whose context they were created.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- */
-public interface Document extends Node {
- /**
- * The Document Type Declaration (see <code>DocumentType</code>)
- * associated with this document. For XML documents without a document
- * type declaration this returns <code>null</code>. For HTML documents,
- * a <code>DocumentType</code> object may be returned, independently of
- * the presence or absence of document type declaration in the HTML
- * document.
- * <br>This provides direct access to the <code>DocumentType</code> node,
- * child node of this <code>Document</code>. This node can be set at
- * document creation time and later changed through the use of child
- * nodes manipulation methods, such as <code>Node.insertBefore</code>,
- * or <code>Node.replaceChild</code>. Note, however, that while some
- * implementations may instantiate different types of
- * <code>Document</code> objects supporting additional features than the
- * "Core", such as "HTML" [<a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>DOM Level 2 HTML</a>]
- * , based on the <code>DocumentType</code> specified at creation time,
- * changing it afterwards is very unlikely to result in a change of the
- * features supported.
- *
- * @since DOM Level 3
- */
- public DocumentType getDoctype();
-
- /**
- * The <code>DOMImplementation</code> object that handles this document. A
- * DOM application may use objects from multiple implementations.
- */
- public DOMImplementation getImplementation();
-
- /**
- * This is a convenience attribute that allows direct access to the child
- * node that is the document element of the document.
- */
- public Element getDocumentElement();
-
- /**
- * Creates an element of the type specified. Note that the instance
- * returned implements the <code>Element</code> interface, so attributes
- * can be specified directly on the returned object.
- * <br>In addition, if there are known attributes with default values,
- * <code>Attr</code> nodes representing them are automatically created
- * and attached to the element.
- * <br>To create an element with a qualified name and namespace URI, use
- * the <code>createElementNS</code> method.
- * @param tagName The name of the element type to instantiate. For XML,
- * this is case-sensitive, otherwise it depends on the
- * case-sensitivity of the markup language in use. In that case, the
- * name is mapped to the canonical form of that markup by the DOM
- * implementation.
- * @return A new <code>Element</code> object with the
- * <code>nodeName</code> attribute set to <code>tagName</code>, and
- * <code>localName</code>, <code>prefix</code>, and
- * <code>namespaceURI</code> set to <code>null</code>.
- * @exception DOMException
- * INVALID_CHARACTER_ERR: Raised if the specified name is not an XML
- * name according to the XML version in use specified in the
- * <code>Document.xmlVersion</code> attribute.
- */
- public Element createElement(String tagName)
- throws DOMException;
-
- /**
- * Creates an empty <code>DocumentFragment</code> object.
- * @return A new <code>DocumentFragment</code>.
- */
- public DocumentFragment createDocumentFragment();
-
- /**
- * Creates a <code>Text</code> node given the specified string.
- * @param data The data for the node.
- * @return The new <code>Text</code> object.
- */
- public Text createTextNode(String data);
-
- /**
- * Creates a <code>Comment</code> node given the specified string.
- * @param data The data for the node.
- * @return The new <code>Comment</code> object.
- */
- public Comment createComment(String data);
-
- /**
- * Creates a <code>CDATASection</code> node whose value is the specified
- * string.
- * @param data The data for the <code>CDATASection</code> contents.
- * @return The new <code>CDATASection</code> object.
- * @exception DOMException
- * NOT_SUPPORTED_ERR: Raised if this document is an HTML document.
- */
- public CDATASection createCDATASection(String data)
- throws DOMException;
-
- /**
- * Creates a <code>ProcessingInstruction</code> node given the specified
- * name and data strings.
- * @param target The target part of the processing instruction.Unlike
- * <code>Document.createElementNS</code> or
- * <code>Document.createAttributeNS</code>, no namespace well-formed
- * checking is done on the target name. Applications should invoke
- * <code>Document.normalizeDocument()</code> with the parameter "
- * namespaces" set to <code>true</code> in order to ensure that the
- * target name is namespace well-formed.
- * @param data The data for the node.
- * @return The new <code>ProcessingInstruction</code> object.
- * @exception DOMException
- * INVALID_CHARACTER_ERR: Raised if the specified target is not an XML
- * name according to the XML version in use specified in the
- * <code>Document.xmlVersion</code> attribute.
- * <br>NOT_SUPPORTED_ERR: Raised if this document is an HTML document.
- */
- public ProcessingInstruction createProcessingInstruction(String target,
- String data)
- throws DOMException;
-
- /**
- * Creates an <code>Attr</code> of the given name. Note that the
- * <code>Attr</code> instance can then be set on an <code>Element</code>
- * using the <code>setAttributeNode</code> method.
- * <br>To create an attribute with a qualified name and namespace URI, use
- * the <code>createAttributeNS</code> method.
- * @param name The name of the attribute.
- * @return A new <code>Attr</code> object with the <code>nodeName</code>
- * attribute set to <code>name</code>, and <code>localName</code>,
- * <code>prefix</code>, and <code>namespaceURI</code> set to
- * <code>null</code>. The value of the attribute is the empty string.
- * @exception DOMException
- * INVALID_CHARACTER_ERR: Raised if the specified name is not an XML
- * name according to the XML version in use specified in the
- * <code>Document.xmlVersion</code> attribute.
- */
- public Attr createAttribute(String name)
- throws DOMException;
-
- /**
- * Creates an <code>EntityReference</code> object. In addition, if the
- * referenced entity is known, the child list of the
- * <code>EntityReference</code> node is made the same as that of the
- * corresponding <code>Entity</code> node.
- * <p ><b>Note:</b> If any descendant of the <code>Entity</code> node has
- * an unbound namespace prefix, the corresponding descendant of the
- * created <code>EntityReference</code> node is also unbound; (its
- * <code>namespaceURI</code> is <code>null</code>). The DOM Level 2 and
- * 3 do not support any mechanism to resolve namespace prefixes in this
- * case.
- * @param name The name of the entity to reference.Unlike
- * <code>Document.createElementNS</code> or
- * <code>Document.createAttributeNS</code>, no namespace well-formed
- * checking is done on the entity name. Applications should invoke
- * <code>Document.normalizeDocument()</code> with the parameter "
- * namespaces" set to <code>true</code> in order to ensure that the
- * entity name is namespace well-formed.
- * @return The new <code>EntityReference</code> object.
- * @exception DOMException
- * INVALID_CHARACTER_ERR: Raised if the specified name is not an XML
- * name according to the XML version in use specified in the
- * <code>Document.xmlVersion</code> attribute.
- * <br>NOT_SUPPORTED_ERR: Raised if this document is an HTML document.
- */
- public EntityReference createEntityReference(String name)
- throws DOMException;
-
- /**
- * Returns a <code>NodeList</code> of all the <code>Elements</code> in
- * document order with a given tag name and are contained in the
- * document.
- * @param tagname The name of the tag to match on. The special value "*"
- * matches all tags. For XML, the <code>tagname</code> parameter is
- * case-sensitive, otherwise it depends on the case-sensitivity of the
- * markup language in use.
- * @return A new <code>NodeList</code> object containing all the matched
- * <code>Elements</code>.
- */
- public NodeList getElementsByTagName(String tagname);
-
- /**
- * Imports a node from another document to this document, without altering
- * or removing the source node from the original document; this method
- * creates a new copy of the source node. The returned node has no
- * parent; (<code>parentNode</code> is <code>null</code>).
- * <br>For all nodes, importing a node creates a node object owned by the
- * importing document, with attribute values identical to the source
- * node's <code>nodeName</code> and <code>nodeType</code>, plus the
- * attributes related to namespaces (<code>prefix</code>,
- * <code>localName</code>, and <code>namespaceURI</code>). As in the
- * <code>cloneNode</code> operation, the source node is not altered.
- * User data associated to the imported node is not carried over.
- * However, if any <code>UserDataHandlers</code> has been specified
- * along with the associated data these handlers will be called with the
- * appropriate parameters before this method returns.
- * <br>Additional information is copied as appropriate to the
- * <code>nodeType</code>, attempting to mirror the behavior expected if
- * a fragment of XML or HTML source was copied from one document to
- * another, recognizing that the two documents may have different DTDs
- * in the XML case. The following list describes the specifics for each
- * type of node.
- * <dl>
- * <dt>ATTRIBUTE_NODE</dt>
- * <dd>The <code>ownerElement</code> attribute
- * is set to <code>null</code> and the <code>specified</code> flag is
- * set to <code>true</code> on the generated <code>Attr</code>. The
- * descendants of the source <code>Attr</code> are recursively imported
- * and the resulting nodes reassembled to form the corresponding subtree.
- * Note that the <code>deep</code> parameter has no effect on
- * <code>Attr</code> nodes; they always carry their children with them
- * when imported.</dd>
- * <dt>DOCUMENT_FRAGMENT_NODE</dt>
- * <dd>If the <code>deep</code> option
- * was set to <code>true</code>, the descendants of the source
- * <code>DocumentFragment</code> are recursively imported and the
- * resulting nodes reassembled under the imported
- * <code>DocumentFragment</code> to form the corresponding subtree.
- * Otherwise, this simply generates an empty
- * <code>DocumentFragment</code>.</dd>
- * <dt>DOCUMENT_NODE</dt>
- * <dd><code>Document</code>
- * nodes cannot be imported.</dd>
- * <dt>DOCUMENT_TYPE_NODE</dt>
- * <dd><code>DocumentType</code>
- * nodes cannot be imported.</dd>
- * <dt>ELEMENT_NODE</dt>
- * <dd><em>Specified</em> attribute nodes of the source element are imported, and the generated
- * <code>Attr</code> nodes are attached to the generated
- * <code>Element</code>. Default attributes are <em>not</em> copied, though if the document being imported into defines default
- * attributes for this element name, those are assigned. If the
- * <code>importNode</code> <code>deep</code> parameter was set to
- * <code>true</code>, the descendants of the source element are
- * recursively imported and the resulting nodes reassembled to form the
- * corresponding subtree.</dd>
- * <dt>ENTITY_NODE</dt>
- * <dd><code>Entity</code> nodes can be
- * imported, however in the current release of the DOM the
- * <code>DocumentType</code> is readonly. Ability to add these imported
- * nodes to a <code>DocumentType</code> will be considered for addition
- * to a future release of the DOM.On import, the <code>publicId</code>,
- * <code>systemId</code>, and <code>notationName</code> attributes are
- * copied. If a <code>deep</code> import is requested, the descendants
- * of the the source <code>Entity</code> are recursively imported and
- * the resulting nodes reassembled to form the corresponding subtree.</dd>
- * <dt>
- * ENTITY_REFERENCE_NODE</dt>
- * <dd>Only the <code>EntityReference</code> itself is
- * copied, even if a <code>deep</code> import is requested, since the
- * source and destination documents might have defined the entity
- * differently. If the document being imported into provides a
- * definition for this entity name, its value is assigned.</dd>
- * <dt>NOTATION_NODE</dt>
- * <dd>
- * <code>Notation</code> nodes can be imported, however in the current
- * release of the DOM the <code>DocumentType</code> is readonly. Ability
- * to add these imported nodes to a <code>DocumentType</code> will be
- * considered for addition to a future release of the DOM.On import, the
- * <code>publicId</code> and <code>systemId</code> attributes are copied.
- * Note that the <code>deep</code> parameter has no effect on this type
- * of nodes since they cannot have any children.</dd>
- * <dt>
- * PROCESSING_INSTRUCTION_NODE</dt>
- * <dd>The imported node copies its
- * <code>target</code> and <code>data</code> values from those of the
- * source node.Note that the <code>deep</code> parameter has no effect
- * on this type of nodes since they cannot have any children.</dd>
- * <dt>TEXT_NODE,
- * CDATA_SECTION_NODE, COMMENT_NODE</dt>
- * <dd>These three types of nodes inheriting
- * from <code>CharacterData</code> copy their <code>data</code> and
- * <code>length</code> attributes from those of the source node.Note
- * that the <code>deep</code> parameter has no effect on these types of
- * nodes since they cannot have any children.</dd>
- * </dl>
- * @param importedNode The node to import.
- * @param deep If <code>true</code>, recursively import the subtree under
- * the specified node; if <code>false</code>, import only the node
- * itself, as explained above. This has no effect on nodes that cannot
- * have any children, and on <code>Attr</code>, and
- * <code>EntityReference</code> nodes.
- * @return The imported node that belongs to this <code>Document</code>.
- * @exception DOMException
- * NOT_SUPPORTED_ERR: Raised if the type of node being imported is not
- * supported.
- * <br>INVALID_CHARACTER_ERR: Raised if one of the imported names is not
- * an XML name according to the XML version in use specified in the
- * <code>Document.xmlVersion</code> attribute. This may happen when
- * importing an XML 1.1 [<a href='http://www.w3.org/TR/2004/REC-xml11-20040204/'>XML 1.1</a>] element
- * into an XML 1.0 document, for instance.
- * @since DOM Level 2
- */
- public Node importNode(Node importedNode,
- boolean deep)
- throws DOMException;
-
- /**
- * Creates an element of the given qualified name and namespace URI.
- * <br>Per [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>]
- * , applications must use the value <code>null</code> as the
- * namespaceURI parameter for methods if they wish to have no namespace.
- * @param namespaceURI The namespace URI of the element to create.
- * @param qualifiedName The qualified name of the element type to
- * instantiate.
- * @return A new <code>Element</code> object with the following
- * attributes:
- * <table border='1' cellpadding='3'>
- * <tr>
- * <th>Attribute</th>
- * <th>Value</th>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'><code>Node.nodeName</code></td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <code>qualifiedName</code></td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'><code>Node.namespaceURI</code></td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <code>namespaceURI</code></td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'><code>Node.prefix</code></td>
- * <td valign='top' rowspan='1' colspan='1'>prefix, extracted
- * from <code>qualifiedName</code>, or <code>null</code> if there is
- * no prefix</td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'><code>Node.localName</code></td>
- * <td valign='top' rowspan='1' colspan='1'>local name, extracted from
- * <code>qualifiedName</code></td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'><code>Element.tagName</code></td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <code>qualifiedName</code></td>
- * </tr>
- * </table>
- * @exception DOMException
- * INVALID_CHARACTER_ERR: Raised if the specified
- * <code>qualifiedName</code> is not an XML name according to the XML
- * version in use specified in the <code>Document.xmlVersion</code>
- * attribute.
- * <br>NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is a
- * malformed qualified name, if the <code>qualifiedName</code> has a
- * prefix and the <code>namespaceURI</code> is <code>null</code>, or
- * if the <code>qualifiedName</code> has a prefix that is "xml" and
- * the <code>namespaceURI</code> is different from "<a href='http://www.w3.org/XML/1998/namespace'>
- * http://www.w3.org/XML/1998/namespace</a>" [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>]
- * , or if the <code>qualifiedName</code> or its prefix is "xmlns" and
- * the <code>namespaceURI</code> is different from "<a href='http://www.w3.org/2000/xmlns/'>http://www.w3.org/2000/xmlns/</a>", or if the <code>namespaceURI</code> is "<a href='http://www.w3.org/2000/xmlns/'>http://www.w3.org/2000/xmlns/</a>" and neither the <code>qualifiedName</code> nor its prefix is "xmlns".
- * <br>NOT_SUPPORTED_ERR: Always thrown if the current document does not
- * support the <code>"XML"</code> feature, since namespaces were
- * defined by XML.
- * @since DOM Level 2
- */
- public Element createElementNS(String namespaceURI,
- String qualifiedName)
- throws DOMException;
-
- /**
- * Creates an attribute of the given qualified name and namespace URI.
- * <br>Per [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>]
- * , applications must use the value <code>null</code> as the
- * <code>namespaceURI</code> parameter for methods if they wish to have
- * no namespace.
- * @param namespaceURI The namespace URI of the attribute to create.
- * @param qualifiedName The qualified name of the attribute to
- * instantiate.
- * @return A new <code>Attr</code> object with the following attributes:
- * <table border='1' cellpadding='3'>
- * <tr>
- * <th>
- * Attribute</th>
- * <th>Value</th>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'><code>Node.nodeName</code></td>
- * <td valign='top' rowspan='1' colspan='1'>qualifiedName</td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>
- * <code>Node.namespaceURI</code></td>
- * <td valign='top' rowspan='1' colspan='1'><code>namespaceURI</code></td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>
- * <code>Node.prefix</code></td>
- * <td valign='top' rowspan='1' colspan='1'>prefix, extracted from
- * <code>qualifiedName</code>, or <code>null</code> if there is no
- * prefix</td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'><code>Node.localName</code></td>
- * <td valign='top' rowspan='1' colspan='1'>local name, extracted from
- * <code>qualifiedName</code></td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'><code>Attr.name</code></td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <code>qualifiedName</code></td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'><code>Node.nodeValue</code></td>
- * <td valign='top' rowspan='1' colspan='1'>the empty
- * string</td>
- * </tr>
- * </table>
- * @exception DOMException
- * INVALID_CHARACTER_ERR: Raised if the specified
- * <code>qualifiedName</code> is not an XML name according to the XML
- * version in use specified in the <code>Document.xmlVersion</code>
- * attribute.
- * <br>NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is a
- * malformed qualified name, if the <code>qualifiedName</code> has a
- * prefix and the <code>namespaceURI</code> is <code>null</code>, if
- * the <code>qualifiedName</code> has a prefix that is "xml" and the
- * <code>namespaceURI</code> is different from "<a href='http://www.w3.org/XML/1998/namespace'>
- * http://www.w3.org/XML/1998/namespace</a>", if the <code>qualifiedName</code> or its prefix is "xmlns" and the
- * <code>namespaceURI</code> is different from "<a href='http://www.w3.org/2000/xmlns/'>http://www.w3.org/2000/xmlns/</a>", or if the <code>namespaceURI</code> is "<a href='http://www.w3.org/2000/xmlns/'>http://www.w3.org/2000/xmlns/</a>" and neither the <code>qualifiedName</code> nor its prefix is "xmlns".
- * <br>NOT_SUPPORTED_ERR: Always thrown if the current document does not
- * support the <code>"XML"</code> feature, since namespaces were
- * defined by XML.
- * @since DOM Level 2
- */
- public Attr createAttributeNS(String namespaceURI,
- String qualifiedName)
- throws DOMException;
-
- /**
- * Returns a <code>NodeList</code> of all the <code>Elements</code> with a
- * given local name and namespace URI in document order.
- * @param namespaceURI The namespace URI of the elements to match on. The
- * special value <code>"*"</code> matches all namespaces.
- * @param localName The local name of the elements to match on. The
- * special value "*" matches all local names.
- * @return A new <code>NodeList</code> object containing all the matched
- * <code>Elements</code>.
- * @since DOM Level 2
- */
- public NodeList getElementsByTagNameNS(String namespaceURI,
- String localName);
-
- /**
- * Returns the <code>Element</code> that has an ID attribute with the
- * given value. If no such element exists, this returns <code>null</code>
- * . If more than one element has an ID attribute with that value, what
- * is returned is undefined.
- * <br> The DOM implementation is expected to use the attribute
- * <code>Attr.isId</code> to determine if an attribute is of type ID.
- * <p ><b>Note:</b> Attributes with the name "ID" or "id" are not of type
- * ID unless so defined.
- * @param elementId The unique <code>id</code> value for an element.
- * @return The matching element or <code>null</code> if there is none.
- * @since DOM Level 2
- */
- public Element getElementById(String elementId);
-
- /**
- * An attribute specifying the encoding used for this document at the time
- * of the parsing. This is <code>null</code> when it is not known, such
- * as when the <code>Document</code> was created in memory.
- * @since DOM Level 3
- */
- public String getInputEncoding();
-
- /**
- * An attribute specifying, as part of the <a href='http://www.w3.org/TR/2004/REC-xml-20040204#NT-XMLDecl'>XML declaration</a>, the encoding of this document. This is <code>null</code> when
- * unspecified or when it is not known, such as when the
- * <code>Document</code> was created in memory.
- * @since DOM Level 3
- */
- public String getXmlEncoding();
-
- /**
- * An attribute specifying, as part of the <a href='http://www.w3.org/TR/2004/REC-xml-20040204#NT-XMLDecl'>XML declaration</a>, whether this document is standalone. This is <code>false</code> when
- * unspecified.
- * <p ><b>Note:</b> No verification is done on the value when setting
- * this attribute. Applications should use
- * <code>Document.normalizeDocument()</code> with the "validate"
- * parameter to verify if the value matches the <a href='http://www.w3.org/TR/2004/REC-xml-20040204#sec-rmd'>validity
- * constraint for standalone document declaration</a> as defined in [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>].
- * @since DOM Level 3
- */
- public boolean getXmlStandalone();
- /**
- * An attribute specifying, as part of the <a href='http://www.w3.org/TR/2004/REC-xml-20040204#NT-XMLDecl'>XML declaration</a>, whether this document is standalone. This is <code>false</code> when
- * unspecified.
- * <p ><b>Note:</b> No verification is done on the value when setting
- * this attribute. Applications should use
- * <code>Document.normalizeDocument()</code> with the "validate"
- * parameter to verify if the value matches the <a href='http://www.w3.org/TR/2004/REC-xml-20040204#sec-rmd'>validity
- * constraint for standalone document declaration</a> as defined in [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>].
- * @exception DOMException
- * NOT_SUPPORTED_ERR: Raised if this document does not support the
- * "XML" feature.
- * @since DOM Level 3
- */
- public void setXmlStandalone(boolean xmlStandalone)
- throws DOMException;
-
- /**
- * An attribute specifying, as part of the <a href='http://www.w3.org/TR/2004/REC-xml-20040204#NT-XMLDecl'>XML declaration</a>, the version number of this document. If there is no declaration and if
- * this document supports the "XML" feature, the value is
- * <code>"1.0"</code>. If this document does not support the "XML"
- * feature, the value is always <code>null</code>. Changing this
- * attribute will affect methods that check for invalid characters in
- * XML names. Application should invoke
- * <code>Document.normalizeDocument()</code> in order to check for
- * invalid characters in the <code>Node</code>s that are already part of
- * this <code>Document</code>.
- * <br> DOM applications may use the
- * <code>DOMImplementation.hasFeature(feature, version)</code> method
- * with parameter values "XMLVersion" and "1.0" (respectively) to
- * determine if an implementation supports [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>]. DOM
- * applications may use the same method with parameter values
- * "XMLVersion" and "1.1" (respectively) to determine if an
- * implementation supports [<a href='http://www.w3.org/TR/2004/REC-xml11-20040204/'>XML 1.1</a>]. In both
- * cases, in order to support XML, an implementation must also support
- * the "XML" feature defined in this specification. <code>Document</code>
- * objects supporting a version of the "XMLVersion" feature must not
- * raise a <code>NOT_SUPPORTED_ERR</code> exception for the same version
- * number when using <code>Document.xmlVersion</code>.
- * @since DOM Level 3
- */
- public String getXmlVersion();
- /**
- * An attribute specifying, as part of the <a href='http://www.w3.org/TR/2004/REC-xml-20040204#NT-XMLDecl'>XML declaration</a>, the version number of this document. If there is no declaration and if
- * this document supports the "XML" feature, the value is
- * <code>"1.0"</code>. If this document does not support the "XML"
- * feature, the value is always <code>null</code>. Changing this
- * attribute will affect methods that check for invalid characters in
- * XML names. Application should invoke
- * <code>Document.normalizeDocument()</code> in order to check for
- * invalid characters in the <code>Node</code>s that are already part of
- * this <code>Document</code>.
- * <br> DOM applications may use the
- * <code>DOMImplementation.hasFeature(feature, version)</code> method
- * with parameter values "XMLVersion" and "1.0" (respectively) to
- * determine if an implementation supports [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>]. DOM
- * applications may use the same method with parameter values
- * "XMLVersion" and "1.1" (respectively) to determine if an
- * implementation supports [<a href='http://www.w3.org/TR/2004/REC-xml11-20040204/'>XML 1.1</a>]. In both
- * cases, in order to support XML, an implementation must also support
- * the "XML" feature defined in this specification. <code>Document</code>
- * objects supporting a version of the "XMLVersion" feature must not
- * raise a <code>NOT_SUPPORTED_ERR</code> exception for the same version
- * number when using <code>Document.xmlVersion</code>.
- * @exception DOMException
- * NOT_SUPPORTED_ERR: Raised if the version is set to a value that is
- * not supported by this <code>Document</code> or if this document
- * does not support the "XML" feature.
- * @since DOM Level 3
- */
- public void setXmlVersion(String xmlVersion)
- throws DOMException;
-
- /**
- * An attribute specifying whether error checking is enforced or not. When
- * set to <code>false</code>, the implementation is free to not test
- * every possible error case normally defined on DOM operations, and not
- * raise any <code>DOMException</code> on DOM operations or report
- * errors while using <code>Document.normalizeDocument()</code>. In case
- * of error, the behavior is undefined. This attribute is
- * <code>true</code> by default.
- * @since DOM Level 3
- */
- public boolean getStrictErrorChecking();
- /**
- * An attribute specifying whether error checking is enforced or not. When
- * set to <code>false</code>, the implementation is free to not test
- * every possible error case normally defined on DOM operations, and not
- * raise any <code>DOMException</code> on DOM operations or report
- * errors while using <code>Document.normalizeDocument()</code>. In case
- * of error, the behavior is undefined. This attribute is
- * <code>true</code> by default.
- * @since DOM Level 3
- */
- public void setStrictErrorChecking(boolean strictErrorChecking);
-
- /**
- * The location of the document or <code>null</code> if undefined or if
- * the <code>Document</code> was created using
- * <code>DOMImplementation.createDocument</code>. No lexical checking is
- * performed when setting this attribute; this could result in a
- * <code>null</code> value returned when using <code>Node.baseURI</code>
- * .
- * <br> Beware that when the <code>Document</code> supports the feature
- * "HTML" [<a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>DOM Level 2 HTML</a>]
- * , the href attribute of the HTML BASE element takes precedence over
- * this attribute when computing <code>Node.baseURI</code>.
- * @since DOM Level 3
- */
- public String getDocumentURI();
- /**
- * The location of the document or <code>null</code> if undefined or if
- * the <code>Document</code> was created using
- * <code>DOMImplementation.createDocument</code>. No lexical checking is
- * performed when setting this attribute; this could result in a
- * <code>null</code> value returned when using <code>Node.baseURI</code>
- * .
- * <br> Beware that when the <code>Document</code> supports the feature
- * "HTML" [<a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>DOM Level 2 HTML</a>]
- * , the href attribute of the HTML BASE element takes precedence over
- * this attribute when computing <code>Node.baseURI</code>.
- * @since DOM Level 3
- */
- public void setDocumentURI(String documentURI);
-
- /**
- * Attempts to adopt a node from another document to this document. If
- * supported, it changes the <code>ownerDocument</code> of the source
- * node, its children, as well as the attached attribute nodes if there
- * are any. If the source node has a parent it is first removed from the
- * child list of its parent. This effectively allows moving a subtree
- * from one document to another (unlike <code>importNode()</code> which
- * create a copy of the source node instead of moving it). When it
- * fails, applications should use <code>Document.importNode()</code>
- * instead. Note that if the adopted node is already part of this
- * document (i.e. the source and target document are the same), this
- * method still has the effect of removing the source node from the
- * child list of its parent, if any. The following list describes the
- * specifics for each type of node.
- * <dl>
- * <dt>ATTRIBUTE_NODE</dt>
- * <dd>The
- * <code>ownerElement</code> attribute is set to <code>null</code> and
- * the <code>specified</code> flag is set to <code>true</code> on the
- * adopted <code>Attr</code>. The descendants of the source
- * <code>Attr</code> are recursively adopted.</dd>
- * <dt>DOCUMENT_FRAGMENT_NODE</dt>
- * <dd>The
- * descendants of the source node are recursively adopted.</dd>
- * <dt>DOCUMENT_NODE</dt>
- * <dd>
- * <code>Document</code> nodes cannot be adopted.</dd>
- * <dt>DOCUMENT_TYPE_NODE</dt>
- * <dd>
- * <code>DocumentType</code> nodes cannot be adopted.</dd>
- * <dt>ELEMENT_NODE</dt>
- * <dd><em>Specified</em> attribute nodes of the source element are adopted. Default attributes
- * are discarded, though if the document being adopted into defines
- * default attributes for this element name, those are assigned. The
- * descendants of the source element are recursively adopted.</dd>
- * <dt>ENTITY_NODE</dt>
- * <dd>
- * <code>Entity</code> nodes cannot be adopted.</dd>
- * <dt>ENTITY_REFERENCE_NODE</dt>
- * <dd>Only
- * the <code>EntityReference</code> node itself is adopted, the
- * descendants are discarded, since the source and destination documents
- * might have defined the entity differently. If the document being
- * imported into provides a definition for this entity name, its value
- * is assigned.</dd>
- * <dt>NOTATION_NODE</dt>
- * <dd><code>Notation</code> nodes cannot be
- * adopted.</dd>
- * <dt>PROCESSING_INSTRUCTION_NODE, TEXT_NODE, CDATA_SECTION_NODE,
- * COMMENT_NODE</dt>
- * <dd>These nodes can all be adopted. No specifics.</dd>
- * </dl>
- * <p ><b>Note:</b> Since it does not create new nodes unlike the
- * <code>Document.importNode()</code> method, this method does not raise
- * an <code>INVALID_CHARACTER_ERR</code> exception, and applications
- * should use the <code>Document.normalizeDocument()</code> method to
- * check if an imported name is not an XML name according to the XML
- * version in use.
- * @param source The node to move into this document.
- * @return The adopted node, or <code>null</code> if this operation
- * fails, such as when the source node comes from a different
- * implementation.
- * @exception DOMException
- * NOT_SUPPORTED_ERR: Raised if the source node is of type
- * <code>DOCUMENT</code>, <code>DOCUMENT_TYPE</code>.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised when the source node is
- * readonly.
- * @since DOM Level 3
- */
- public Node adoptNode(Node source)
- throws DOMException;
-
- /**
- * The configuration used when <code>Document.normalizeDocument()</code>
- * is invoked.
- * @since DOM Level 3
- */
- public DOMConfiguration getDomConfig();
-
- /**
- * This method acts as if the document was going through a save and load
- * cycle, putting the document in a "normal" form. As a consequence,
- * this method updates the replacement tree of
- * <code>EntityReference</code> nodes and normalizes <code>Text</code>
- * nodes, as defined in the method <code>Node.normalize()</code>.
- * <br> Otherwise, the actual result depends on the features being set on
- * the <code>Document.domConfig</code> object and governing what
- * operations actually take place. Noticeably this method could also
- * make the document namespace well-formed according to the algorithm
- * described in , check the character normalization, remove the
- * <code>CDATASection</code> nodes, etc. See
- * <code>DOMConfiguration</code> for details.
- * <pre>// Keep in the document
- * the information defined // in the XML Information Set (Java example)
- * DOMConfiguration docConfig = myDocument.getDomConfig();
- * docConfig.setParameter("infoset", Boolean.TRUE);
- * myDocument.normalizeDocument();</pre>
- *
- * <br>Mutation events, when supported, are generated to reflect the
- * changes occurring on the document.
- * <br> If errors occur during the invocation of this method, such as an
- * attempt to update a read-only node or a <code>Node.nodeName</code>
- * contains an invalid character according to the XML version in use,
- * errors or warnings (<code>DOMError.SEVERITY_ERROR</code> or
- * <code>DOMError.SEVERITY_WARNING</code>) will be reported using the
- * <code>DOMErrorHandler</code> object associated with the "error-handler
- * " parameter. Note this method might also report fatal errors (
- * <code>DOMError.SEVERITY_FATAL_ERROR</code>) if an implementation
- * cannot recover from an error.
- * @since DOM Level 3
- */
- public void normalizeDocument();
-
- /**
- * Rename an existing node of type <code>ELEMENT_NODE</code> or
- * <code>ATTRIBUTE_NODE</code>.
- * <br>When possible this simply changes the name of the given node,
- * otherwise this creates a new node with the specified name and
- * replaces the existing node with the new node as described below.
- * <br>If simply changing the name of the given node is not possible, the
- * following operations are performed: a new node is created, any
- * registered event listener is registered on the new node, any user
- * data attached to the old node is removed from that node, the old node
- * is removed from its parent if it has one, the children are moved to
- * the new node, if the renamed node is an <code>Element</code> its
- * attributes are moved to the new node, the new node is inserted at the
- * position the old node used to have in its parent's child nodes list
- * if it has one, the user data that was attached to the old node is
- * attached to the new node.
- * <br>When the node being renamed is an <code>Element</code> only the
- * specified attributes are moved, default attributes originated from
- * the DTD are updated according to the new element name. In addition,
- * the implementation may update default attributes from other schemas.
- * Applications should use <code>Document.normalizeDocument()</code> to
- * guarantee these attributes are up-to-date.
- * <br>When the node being renamed is an <code>Attr</code> that is
- * attached to an <code>Element</code>, the node is first removed from
- * the <code>Element</code> attributes map. Then, once renamed, either
- * by modifying the existing node or creating a new one as described
- * above, it is put back.
- * <br>In addition,
- * <ul>
- * <li> a user data event <code>NODE_RENAMED</code> is fired,
- * </li>
- * <li>
- * when the implementation supports the feature "MutationNameEvents",
- * each mutation operation involved in this method fires the appropriate
- * event, and in the end the event {
- * <code>http://www.w3.org/2001/xml-events</code>,
- * <code>DOMElementNameChanged</code>} or {
- * <code>http://www.w3.org/2001/xml-events</code>,
- * <code>DOMAttributeNameChanged</code>} is fired.
- * </li>
- * </ul>
- * @param n The node to rename.
- * @param namespaceURI The new namespace URI.
- * @param qualifiedName The new qualified name.
- * @return The renamed node. This is either the specified node or the new
- * node that was created to replace the specified node.
- * @exception DOMException
- * NOT_SUPPORTED_ERR: Raised when the type of the specified node is
- * neither <code>ELEMENT_NODE</code> nor <code>ATTRIBUTE_NODE</code>,
- * or if the implementation does not support the renaming of the
- * document element.
- * <br>INVALID_CHARACTER_ERR: Raised if the new qualified name is not an
- * XML name according to the XML version in use specified in the
- * <code>Document.xmlVersion</code> attribute.
- * <br>WRONG_DOCUMENT_ERR: Raised when the specified node was created
- * from a different document than this document.
- * <br>NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is a
- * malformed qualified name, if the <code>qualifiedName</code> has a
- * prefix and the <code>namespaceURI</code> is <code>null</code>, or
- * if the <code>qualifiedName</code> has a prefix that is "xml" and
- * the <code>namespaceURI</code> is different from "<a href='http://www.w3.org/XML/1998/namespace'>
- * http://www.w3.org/XML/1998/namespace</a>" [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>]
- * . Also raised, when the node being renamed is an attribute, if the
- * <code>qualifiedName</code>, or its prefix, is "xmlns" and the
- * <code>namespaceURI</code> is different from "<a href='http://www.w3.org/2000/xmlns/'>http://www.w3.org/2000/xmlns/</a>".
- * @since DOM Level 3
- */
- public Node renameNode(Node n,
- String namespaceURI,
- String qualifiedName)
- throws DOMException;
-
-}
diff --git a/src/org/w3c/dom/DocumentFragment.java b/src/org/w3c/dom/DocumentFragment.java
deleted file mode 100644
index 01c35ef..0000000
--- a/src/org/w3c/dom/DocumentFragment.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] in the hope that
- * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * <code>DocumentFragment</code> is a "lightweight" or "minimal"
- * <code>Document</code> object. It is very common to want to be able to
- * extract a portion of a document's tree or to create a new fragment of a
- * document. Imagine implementing a user command like cut or rearranging a
- * document by moving fragments around. It is desirable to have an object
- * which can hold such fragments and it is quite natural to use a Node for
- * this purpose. While it is true that a <code>Document</code> object could
- * fulfill this role, a <code>Document</code> object can potentially be a
- * heavyweight object, depending on the underlying implementation. What is
- * really needed for this is a very lightweight object.
- * <code>DocumentFragment</code> is such an object.
- * <p>Furthermore, various operations -- such as inserting nodes as children
- * of another <code>Node</code> -- may take <code>DocumentFragment</code>
- * objects as arguments; this results in all the child nodes of the
- * <code>DocumentFragment</code> being moved to the child list of this node.
- * <p>The children of a <code>DocumentFragment</code> node are zero or more
- * nodes representing the tops of any sub-trees defining the structure of
- * the document. <code>DocumentFragment</code> nodes do not need to be
- * well-formed XML documents (although they do need to follow the rules
- * imposed upon well-formed XML parsed entities, which can have multiple top
- * nodes). For example, a <code>DocumentFragment</code> might have only one
- * child and that child node could be a <code>Text</code> node. Such a
- * structure model represents neither an HTML document nor a well-formed XML
- * document.
- * <p>When a <code>DocumentFragment</code> is inserted into a
- * <code>Document</code> (or indeed any other <code>Node</code> that may
- * take children) the children of the <code>DocumentFragment</code> and not
- * the <code>DocumentFragment</code> itself are inserted into the
- * <code>Node</code>. This makes the <code>DocumentFragment</code> very
- * useful when the user wishes to create nodes that are siblings; the
- * <code>DocumentFragment</code> acts as the parent of these nodes so that
- * the user can use the standard methods from the <code>Node</code>
- * interface, such as <code>Node.insertBefore</code> and
- * <code>Node.appendChild</code>.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- */
-public interface DocumentFragment extends Node {
-}
diff --git a/src/org/w3c/dom/DocumentType.java b/src/org/w3c/dom/DocumentType.java
deleted file mode 100644
index 3b687e3..0000000
--- a/src/org/w3c/dom/DocumentType.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] in the hope that
- * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * Each <code>Document</code> has a <code>doctype</code> attribute whose value
- * is either <code>null</code> or a <code>DocumentType</code> object. The
- * <code>DocumentType</code> interface in the DOM Core provides an interface
- * to the list of entities that are defined for the document, and little
- * else because the effect of namespaces and the various XML schema efforts
- * on DTD representation are not clearly understood as of this writing.
- * <p>DOM Level 3 doesn't support editing <code>DocumentType</code> nodes.
- * <code>DocumentType</code> nodes are read-only.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- */
-public interface DocumentType extends Node {
- /**
- * The name of DTD; i.e., the name immediately following the
- * <code>DOCTYPE</code> keyword.
- */
- public String getName();
-
- /**
- * A <code>NamedNodeMap</code> containing the general entities, both
- * external and internal, declared in the DTD. Parameter entities are
- * not contained. Duplicates are discarded. For example in:
- * <pre>&lt;!DOCTYPE
- * ex SYSTEM "ex.dtd" [ &lt;!ENTITY foo "foo"&gt; &lt;!ENTITY bar
- * "bar"&gt; &lt;!ENTITY bar "bar2"&gt; &lt;!ENTITY % baz "baz"&gt;
- * ]&gt; &lt;ex/&gt;</pre>
- * the interface provides access to <code>foo</code>
- * and the first declaration of <code>bar</code> but not the second
- * declaration of <code>bar</code> or <code>baz</code>. Every node in
- * this map also implements the <code>Entity</code> interface.
- * <br>The DOM Level 2 does not support editing entities, therefore
- * <code>entities</code> cannot be altered in any way.
- */
- public NamedNodeMap getEntities();
-
- /**
- * A <code>NamedNodeMap</code> containing the notations declared in the
- * DTD. Duplicates are discarded. Every node in this map also implements
- * the <code>Notation</code> interface.
- * <br>The DOM Level 2 does not support editing notations, therefore
- * <code>notations</code> cannot be altered in any way.
- */
- public NamedNodeMap getNotations();
-
- /**
- * The public identifier of the external subset.
- * @since DOM Level 2
- */
- public String getPublicId();
-
- /**
- * The system identifier of the external subset. This may be an absolute
- * URI or not.
- * @since DOM Level 2
- */
- public String getSystemId();
-
- /**
- * The internal subset as a string, or <code>null</code> if there is none.
- * This is does not contain the delimiting square brackets.
- * <p ><b>Note:</b> The actual content returned depends on how much
- * information is available to the implementation. This may vary
- * depending on various parameters, including the XML processor used to
- * build the document.
- * @since DOM Level 2
- */
- public String getInternalSubset();
-
-}
diff --git a/src/org/w3c/dom/Element.java b/src/org/w3c/dom/Element.java
deleted file mode 100644
index 195c71f..0000000
--- a/src/org/w3c/dom/Element.java
+++ /dev/null
@@ -1,468 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] in the hope that
- * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * The <code>Element</code> interface represents an element in an HTML or XML
- * document. Elements may have attributes associated with them; since the
- * <code>Element</code> interface inherits from <code>Node</code>, the
- * generic <code>Node</code> interface attribute <code>attributes</code> may
- * be used to retrieve the set of all attributes for an element. There are
- * methods on the <code>Element</code> interface to retrieve either an
- * <code>Attr</code> object by name or an attribute value by name. In XML,
- * where an attribute value may contain entity references, an
- * <code>Attr</code> object should be retrieved to examine the possibly
- * fairly complex sub-tree representing the attribute value. On the other
- * hand, in HTML, where all attributes have simple string values, methods to
- * directly access an attribute value can safely be used as a convenience.
- * <p ><b>Note:</b> In DOM Level 2, the method <code>normalize</code> is
- * inherited from the <code>Node</code> interface where it was moved.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- */
-public interface Element extends Node {
- /**
- * The name of the element. If <code>Node.localName</code> is different
- * from <code>null</code>, this attribute is a qualified name. For
- * example, in:
- * <pre> &lt;elementExample id="demo"&gt; ...
- * &lt;/elementExample&gt; , </pre>
- * <code>tagName</code> has the value
- * <code>"elementExample"</code>. Note that this is case-preserving in
- * XML, as are all of the operations of the DOM. The HTML DOM returns
- * the <code>tagName</code> of an HTML element in the canonical
- * uppercase form, regardless of the case in the source HTML document.
- */
- public String getTagName();
-
- /**
- * Retrieves an attribute value by name.
- * @param name The name of the attribute to retrieve.
- * @return The <code>Attr</code> value as a string, or the empty string
- * if that attribute does not have a specified or default value.
- */
- public String getAttribute(String name);
-
- /**
- * Adds a new attribute. If an attribute with that name is already present
- * in the element, its value is changed to be that of the value
- * parameter. This value is a simple string; it is not parsed as it is
- * being set. So any markup (such as syntax to be recognized as an
- * entity reference) is treated as literal text, and needs to be
- * appropriately escaped by the implementation when it is written out.
- * In order to assign an attribute value that contains entity
- * references, the user must create an <code>Attr</code> node plus any
- * <code>Text</code> and <code>EntityReference</code> nodes, build the
- * appropriate subtree, and use <code>setAttributeNode</code> to assign
- * it as the value of an attribute.
- * <br>To set an attribute with a qualified name and namespace URI, use
- * the <code>setAttributeNS</code> method.
- * @param name The name of the attribute to create or alter.
- * @param value Value to set in string form.
- * @exception DOMException
- * INVALID_CHARACTER_ERR: Raised if the specified name is not an XML
- * name according to the XML version in use specified in the
- * <code>Document.xmlVersion</code> attribute.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- */
- public void setAttribute(String name,
- String value)
- throws DOMException;
-
- /**
- * Removes an attribute by name. If a default value for the removed
- * attribute is defined in the DTD, a new attribute immediately appears
- * with the default value as well as the corresponding namespace URI,
- * local name, and prefix when applicable. The implementation may handle
- * default values from other schemas similarly but applications should
- * use <code>Document.normalizeDocument()</code> to guarantee this
- * information is up-to-date.
- * <br>If no attribute with this name is found, this method has no effect.
- * <br>To remove an attribute by local name and namespace URI, use the
- * <code>removeAttributeNS</code> method.
- * @param name The name of the attribute to remove.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- */
- public void removeAttribute(String name)
- throws DOMException;
-
- /**
- * Retrieves an attribute node by name.
- * <br>To retrieve an attribute node by qualified name and namespace URI,
- * use the <code>getAttributeNodeNS</code> method.
- * @param name The name (<code>nodeName</code>) of the attribute to
- * retrieve.
- * @return The <code>Attr</code> node with the specified name (
- * <code>nodeName</code>) or <code>null</code> if there is no such
- * attribute.
- */
- public Attr getAttributeNode(String name);
-
- /**
- * Adds a new attribute node. If an attribute with that name (
- * <code>nodeName</code>) is already present in the element, it is
- * replaced by the new one. Replacing an attribute node by itself has no
- * effect.
- * <br>To add a new attribute node with a qualified name and namespace
- * URI, use the <code>setAttributeNodeNS</code> method.
- * @param newAttr The <code>Attr</code> node to add to the attribute list.
- * @return If the <code>newAttr</code> attribute replaces an existing
- * attribute, the replaced <code>Attr</code> node is returned,
- * otherwise <code>null</code> is returned.
- * @exception DOMException
- * WRONG_DOCUMENT_ERR: Raised if <code>newAttr</code> was created from a
- * different document than the one that created the element.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- * <br>INUSE_ATTRIBUTE_ERR: Raised if <code>newAttr</code> is already an
- * attribute of another <code>Element</code> object. The DOM user must
- * explicitly clone <code>Attr</code> nodes to re-use them in other
- * elements.
- */
- public Attr setAttributeNode(Attr newAttr)
- throws DOMException;
-
- /**
- * Removes the specified attribute node. If a default value for the
- * removed <code>Attr</code> node is defined in the DTD, a new node
- * immediately appears with the default value as well as the
- * corresponding namespace URI, local name, and prefix when applicable.
- * The implementation may handle default values from other schemas
- * similarly but applications should use
- * <code>Document.normalizeDocument()</code> to guarantee this
- * information is up-to-date.
- * @param oldAttr The <code>Attr</code> node to remove from the attribute
- * list.
- * @return The <code>Attr</code> node that was removed.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- * <br>NOT_FOUND_ERR: Raised if <code>oldAttr</code> is not an attribute
- * of the element.
- */
- public Attr removeAttributeNode(Attr oldAttr)
- throws DOMException;
-
- /**
- * Returns a <code>NodeList</code> of all descendant <code>Elements</code>
- * with a given tag name, in document order.
- * @param name The name of the tag to match on. The special value "*"
- * matches all tags.
- * @return A list of matching <code>Element</code> nodes.
- */
- public NodeList getElementsByTagName(String name);
-
- /**
- * Retrieves an attribute value by local name and namespace URI.
- * <br>Per [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>]
- * , applications must use the value <code>null</code> as the
- * <code>namespaceURI</code> parameter for methods if they wish to have
- * no namespace.
- * @param namespaceURI The namespace URI of the attribute to retrieve.
- * @param localName The local name of the attribute to retrieve.
- * @return The <code>Attr</code> value as a string, or the empty string
- * if that attribute does not have a specified or default value.
- * @exception DOMException
- * NOT_SUPPORTED_ERR: May be raised if the implementation does not
- * support the feature <code>"XML"</code> and the language exposed
- * through the Document does not support XML Namespaces (such as [<a href='http://www.w3.org/TR/1999/REC-html401-19991224/'>HTML 4.01</a>]).
- * @since DOM Level 2
- */
- public String getAttributeNS(String namespaceURI,
- String localName)
- throws DOMException;
-
- /**
- * Adds a new attribute. If an attribute with the same local name and
- * namespace URI is already present on the element, its prefix is
- * changed to be the prefix part of the <code>qualifiedName</code>, and
- * its value is changed to be the <code>value</code> parameter. This
- * value is a simple string; it is not parsed as it is being set. So any
- * markup (such as syntax to be recognized as an entity reference) is
- * treated as literal text, and needs to be appropriately escaped by the
- * implementation when it is written out. In order to assign an
- * attribute value that contains entity references, the user must create
- * an <code>Attr</code> node plus any <code>Text</code> and
- * <code>EntityReference</code> nodes, build the appropriate subtree,
- * and use <code>setAttributeNodeNS</code> or
- * <code>setAttributeNode</code> to assign it as the value of an
- * attribute.
- * <br>Per [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>]
- * , applications must use the value <code>null</code> as the
- * <code>namespaceURI</code> parameter for methods if they wish to have
- * no namespace.
- * @param namespaceURI The namespace URI of the attribute to create or
- * alter.
- * @param qualifiedName The qualified name of the attribute to create or
- * alter.
- * @param value The value to set in string form.
- * @exception DOMException
- * INVALID_CHARACTER_ERR: Raised if the specified qualified name is not
- * an XML name according to the XML version in use specified in the
- * <code>Document.xmlVersion</code> attribute.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- * <br>NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is
- * malformed per the Namespaces in XML specification, if the
- * <code>qualifiedName</code> has a prefix and the
- * <code>namespaceURI</code> is <code>null</code>, if the
- * <code>qualifiedName</code> has a prefix that is "xml" and the
- * <code>namespaceURI</code> is different from "<a href='http://www.w3.org/XML/1998/namespace'>
- * http://www.w3.org/XML/1998/namespace</a>", if the <code>qualifiedName</code> or its prefix is "xmlns" and the
- * <code>namespaceURI</code> is different from "<a href='http://www.w3.org/2000/xmlns/'>http://www.w3.org/2000/xmlns/</a>", or if the <code>namespaceURI</code> is "<a href='http://www.w3.org/2000/xmlns/'>http://www.w3.org/2000/xmlns/</a>" and neither the <code>qualifiedName</code> nor its prefix is "xmlns".
- * <br>NOT_SUPPORTED_ERR: May be raised if the implementation does not
- * support the feature <code>"XML"</code> and the language exposed
- * through the Document does not support XML Namespaces (such as [<a href='http://www.w3.org/TR/1999/REC-html401-19991224/'>HTML 4.01</a>]).
- * @since DOM Level 2
- */
- public void setAttributeNS(String namespaceURI,
- String qualifiedName,
- String value)
- throws DOMException;
-
- /**
- * Removes an attribute by local name and namespace URI. If a default
- * value for the removed attribute is defined in the DTD, a new
- * attribute immediately appears with the default value as well as the
- * corresponding namespace URI, local name, and prefix when applicable.
- * The implementation may handle default values from other schemas
- * similarly but applications should use
- * <code>Document.normalizeDocument()</code> to guarantee this
- * information is up-to-date.
- * <br>If no attribute with this local name and namespace URI is found,
- * this method has no effect.
- * <br>Per [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>]
- * , applications must use the value <code>null</code> as the
- * <code>namespaceURI</code> parameter for methods if they wish to have
- * no namespace.
- * @param namespaceURI The namespace URI of the attribute to remove.
- * @param localName The local name of the attribute to remove.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- * <br>NOT_SUPPORTED_ERR: May be raised if the implementation does not
- * support the feature <code>"XML"</code> and the language exposed
- * through the Document does not support XML Namespaces (such as [<a href='http://www.w3.org/TR/1999/REC-html401-19991224/'>HTML 4.01</a>]).
- * @since DOM Level 2
- */
- public void removeAttributeNS(String namespaceURI,
- String localName)
- throws DOMException;
-
- /**
- * Retrieves an <code>Attr</code> node by local name and namespace URI.
- * <br>Per [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>]
- * , applications must use the value <code>null</code> as the
- * <code>namespaceURI</code> parameter for methods if they wish to have
- * no namespace.
- * @param namespaceURI The namespace URI of the attribute to retrieve.
- * @param localName The local name of the attribute to retrieve.
- * @return The <code>Attr</code> node with the specified attribute local
- * name and namespace URI or <code>null</code> if there is no such
- * attribute.
- * @exception DOMException
- * NOT_SUPPORTED_ERR: May be raised if the implementation does not
- * support the feature <code>"XML"</code> and the language exposed
- * through the Document does not support XML Namespaces (such as [<a href='http://www.w3.org/TR/1999/REC-html401-19991224/'>HTML 4.01</a>]).
- * @since DOM Level 2
- */
- public Attr getAttributeNodeNS(String namespaceURI,
- String localName)
- throws DOMException;
-
- /**
- * Adds a new attribute. If an attribute with that local name and that
- * namespace URI is already present in the element, it is replaced by
- * the new one. Replacing an attribute node by itself has no effect.
- * <br>Per [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>]
- * , applications must use the value <code>null</code> as the
- * <code>namespaceURI</code> parameter for methods if they wish to have
- * no namespace.
- * @param newAttr The <code>Attr</code> node to add to the attribute list.
- * @return If the <code>newAttr</code> attribute replaces an existing
- * attribute with the same local name and namespace URI, the replaced
- * <code>Attr</code> node is returned, otherwise <code>null</code> is
- * returned.
- * @exception DOMException
- * WRONG_DOCUMENT_ERR: Raised if <code>newAttr</code> was created from a
- * different document than the one that created the element.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- * <br>INUSE_ATTRIBUTE_ERR: Raised if <code>newAttr</code> is already an
- * attribute of another <code>Element</code> object. The DOM user must
- * explicitly clone <code>Attr</code> nodes to re-use them in other
- * elements.
- * <br>NOT_SUPPORTED_ERR: May be raised if the implementation does not
- * support the feature <code>"XML"</code> and the language exposed
- * through the Document does not support XML Namespaces (such as [<a href='http://www.w3.org/TR/1999/REC-html401-19991224/'>HTML 4.01</a>]).
- * @since DOM Level 2
- */
- public Attr setAttributeNodeNS(Attr newAttr)
- throws DOMException;
-
- /**
- * Returns a <code>NodeList</code> of all the descendant
- * <code>Elements</code> with a given local name and namespace URI in
- * document order.
- * @param namespaceURI The namespace URI of the elements to match on. The
- * special value "*" matches all namespaces.
- * @param localName The local name of the elements to match on. The
- * special value "*" matches all local names.
- * @return A new <code>NodeList</code> object containing all the matched
- * <code>Elements</code>.
- * @exception DOMException
- * NOT_SUPPORTED_ERR: May be raised if the implementation does not
- * support the feature <code>"XML"</code> and the language exposed
- * through the Document does not support XML Namespaces (such as [<a href='http://www.w3.org/TR/1999/REC-html401-19991224/'>HTML 4.01</a>]).
- * @since DOM Level 2
- */
- public NodeList getElementsByTagNameNS(String namespaceURI,
- String localName)
- throws DOMException;
-
- /**
- * Returns <code>true</code> when an attribute with a given name is
- * specified on this element or has a default value, <code>false</code>
- * otherwise.
- * @param name The name of the attribute to look for.
- * @return <code>true</code> if an attribute with the given name is
- * specified on this element or has a default value, <code>false</code>
- * otherwise.
- * @since DOM Level 2
- */
- public boolean hasAttribute(String name);
-
- /**
- * Returns <code>true</code> when an attribute with a given local name and
- * namespace URI is specified on this element or has a default value,
- * <code>false</code> otherwise.
- * <br>Per [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>]
- * , applications must use the value <code>null</code> as the
- * <code>namespaceURI</code> parameter for methods if they wish to have
- * no namespace.
- * @param namespaceURI The namespace URI of the attribute to look for.
- * @param localName The local name of the attribute to look for.
- * @return <code>true</code> if an attribute with the given local name
- * and namespace URI is specified or has a default value on this
- * element, <code>false</code> otherwise.
- * @exception DOMException
- * NOT_SUPPORTED_ERR: May be raised if the implementation does not
- * support the feature <code>"XML"</code> and the language exposed
- * through the Document does not support XML Namespaces (such as [<a href='http://www.w3.org/TR/1999/REC-html401-19991224/'>HTML 4.01</a>]).
- * @since DOM Level 2
- */
- public boolean hasAttributeNS(String namespaceURI,
- String localName)
- throws DOMException;
-
- /**
- * The type information associated with this element.
- * @since DOM Level 3
- */
- public TypeInfo getSchemaTypeInfo();
-
- /**
- * If the parameter <code>isId</code> is <code>true</code>, this method
- * declares the specified attribute to be a user-determined ID attribute
- * . This affects the value of <code>Attr.isId</code> and the behavior
- * of <code>Document.getElementById</code>, but does not change any
- * schema that may be in use, in particular this does not affect the
- * <code>Attr.schemaTypeInfo</code> of the specified <code>Attr</code>
- * node. Use the value <code>false</code> for the parameter
- * <code>isId</code> to undeclare an attribute for being a
- * user-determined ID attribute.
- * <br> To specify an attribute by local name and namespace URI, use the
- * <code>setIdAttributeNS</code> method.
- * @param name The name of the attribute.
- * @param isId Whether the attribute is a of type ID.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- * <br>NOT_FOUND_ERR: Raised if the specified node is not an attribute
- * of this element.
- * @since DOM Level 3
- */
- public void setIdAttribute(String name,
- boolean isId)
- throws DOMException;
-
- /**
- * If the parameter <code>isId</code> is <code>true</code>, this method
- * declares the specified attribute to be a user-determined ID attribute
- * . This affects the value of <code>Attr.isId</code> and the behavior
- * of <code>Document.getElementById</code>, but does not change any
- * schema that may be in use, in particular this does not affect the
- * <code>Attr.schemaTypeInfo</code> of the specified <code>Attr</code>
- * node. Use the value <code>false</code> for the parameter
- * <code>isId</code> to undeclare an attribute for being a
- * user-determined ID attribute.
- * @param namespaceURI The namespace URI of the attribute.
- * @param localName The local name of the attribute.
- * @param isId Whether the attribute is a of type ID.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- * <br>NOT_FOUND_ERR: Raised if the specified node is not an attribute
- * of this element.
- * @since DOM Level 3
- */
- public void setIdAttributeNS(String namespaceURI,
- String localName,
- boolean isId)
- throws DOMException;
-
- /**
- * If the parameter <code>isId</code> is <code>true</code>, this method
- * declares the specified attribute to be a user-determined ID attribute
- * . This affects the value of <code>Attr.isId</code> and the behavior
- * of <code>Document.getElementById</code>, but does not change any
- * schema that may be in use, in particular this does not affect the
- * <code>Attr.schemaTypeInfo</code> of the specified <code>Attr</code>
- * node. Use the value <code>false</code> for the parameter
- * <code>isId</code> to undeclare an attribute for being a
- * user-determined ID attribute.
- * @param idAttr The attribute node.
- * @param isId Whether the attribute is a of type ID.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- * <br>NOT_FOUND_ERR: Raised if the specified node is not an attribute
- * of this element.
- * @since DOM Level 3
- */
- public void setIdAttributeNode(Attr idAttr,
- boolean isId)
- throws DOMException;
-
-}
diff --git a/src/org/w3c/dom/Entity.java b/src/org/w3c/dom/Entity.java
deleted file mode 100644
index 2242fe1..0000000
--- a/src/org/w3c/dom/Entity.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] in the hope that
- * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * This interface represents a known entity, either parsed or unparsed, in an
- * XML document. Note that this models the entity itself <em>not</em> the entity declaration.
- * <p>The <code>nodeName</code> attribute that is inherited from
- * <code>Node</code> contains the name of the entity.
- * <p>An XML processor may choose to completely expand entities before the
- * structure model is passed to the DOM; in this case there will be no
- * <code>EntityReference</code> nodes in the document tree.
- * <p>XML does not mandate that a non-validating XML processor read and
- * process entity declarations made in the external subset or declared in
- * parameter entities. This means that parsed entities declared in the
- * external subset need not be expanded by some classes of applications, and
- * that the replacement text of the entity may not be available. When the <a href='http://www.w3.org/TR/2004/REC-xml-20040204#intern-replacement'>
- * replacement text</a> is available, the corresponding <code>Entity</code> node's child list
- * represents the structure of that replacement value. Otherwise, the child
- * list is empty.
- * <p>DOM Level 3 does not support editing <code>Entity</code> nodes; if a
- * user wants to make changes to the contents of an <code>Entity</code>,
- * every related <code>EntityReference</code> node has to be replaced in the
- * structure model by a clone of the <code>Entity</code>'s contents, and
- * then the desired changes must be made to each of those clones instead.
- * <code>Entity</code> nodes and all their descendants are readonly.
- * <p>An <code>Entity</code> node does not have any parent.
- * <p ><b>Note:</b> If the entity contains an unbound namespace prefix, the
- * <code>namespaceURI</code> of the corresponding node in the
- * <code>Entity</code> node subtree is <code>null</code>. The same is true
- * for <code>EntityReference</code> nodes that refer to this entity, when
- * they are created using the <code>createEntityReference</code> method of
- * the <code>Document</code> interface.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- */
-public interface Entity extends Node {
- /**
- * The public identifier associated with the entity if specified, and
- * <code>null</code> otherwise.
- */
- public String getPublicId();
-
- /**
- * The system identifier associated with the entity if specified, and
- * <code>null</code> otherwise. This may be an absolute URI or not.
- */
- public String getSystemId();
-
- /**
- * For unparsed entities, the name of the notation for the entity. For
- * parsed entities, this is <code>null</code>.
- */
- public String getNotationName();
-
- /**
- * An attribute specifying the encoding used for this entity at the time
- * of parsing, when it is an external parsed entity. This is
- * <code>null</code> if it an entity from the internal subset or if it
- * is not known.
- * @since DOM Level 3
- */
- public String getInputEncoding();
-
- /**
- * An attribute specifying, as part of the text declaration, the encoding
- * of this entity, when it is an external parsed entity. This is
- * <code>null</code> otherwise.
- * @since DOM Level 3
- */
- public String getXmlEncoding();
-
- /**
- * An attribute specifying, as part of the text declaration, the version
- * number of this entity, when it is an external parsed entity. This is
- * <code>null</code> otherwise.
- * @since DOM Level 3
- */
- public String getXmlVersion();
-
-}
diff --git a/src/org/w3c/dom/EntityReference.java b/src/org/w3c/dom/EntityReference.java
deleted file mode 100644
index 65aade6..0000000
--- a/src/org/w3c/dom/EntityReference.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] in the hope that
- * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * <code>EntityReference</code> nodes may be used to represent an entity
- * reference in the tree. Note that character references and references to
- * predefined entities are considered to be expanded by the HTML or XML
- * processor so that characters are represented by their Unicode equivalent
- * rather than by an entity reference. Moreover, the XML processor may
- * completely expand references to entities while building the
- * <code>Document</code>, instead of providing <code>EntityReference</code>
- * nodes. If it does provide such nodes, then for an
- * <code>EntityReference</code> node that represents a reference to a known
- * entity an <code>Entity</code> exists, and the subtree of the
- * <code>EntityReference</code> node is a copy of the <code>Entity</code>
- * node subtree. However, the latter may not be true when an entity contains
- * an unbound namespace prefix. In such a case, because the namespace prefix
- * resolution depends on where the entity reference is, the descendants of
- * the <code>EntityReference</code> node may be bound to different namespace
- * URIs. When an <code>EntityReference</code> node represents a reference to
- * an unknown entity, the node has no children and its replacement value,
- * when used by <code>Attr.value</code> for example, is empty.
- * <p>As for <code>Entity</code> nodes, <code>EntityReference</code> nodes and
- * all their descendants are readonly.
- * <p ><b>Note:</b> <code>EntityReference</code> nodes may cause element
- * content and attribute value normalization problems when, such as in XML
- * 1.0 and XML Schema, the normalization is performed after entity reference
- * are expanded.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- */
-public interface EntityReference extends Node {
-}
diff --git a/src/org/w3c/dom/NameList.java b/src/org/w3c/dom/NameList.java
deleted file mode 100644
index 01cfe10..0000000
--- a/src/org/w3c/dom/NameList.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] in the hope that
- * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * The <code>NameList</code> interface provides the abstraction of an ordered
- * collection of parallel pairs of name and namespace values (which could be
- * null values), without defining or constraining how this collection is
- * implemented. The items in the <code>NameList</code> are accessible via an
- * integral index, starting from 0.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- * @since DOM Level 3
- */
-public interface NameList {
- /**
- * Returns the <code>index</code>th name item in the collection.
- * @param index Index into the collection.
- * @return The name at the <code>index</code>th position in the
- * <code>NameList</code>, or <code>null</code> if there is no name for
- * the specified index or if the index is out of range.
- */
- public String getName(int index);
-
- /**
- * Returns the <code>index</code>th namespaceURI item in the collection.
- * @param index Index into the collection.
- * @return The namespace URI at the <code>index</code>th position in the
- * <code>NameList</code>, or <code>null</code> if there is no name for
- * the specified index or if the index is out of range.
- */
- public String getNamespaceURI(int index);
-
- /**
- * The number of pairs (name and namespaceURI) in the list. The range of
- * valid child node indices is 0 to <code>length-1</code> inclusive.
- */
- public int getLength();
-
- /**
- * Test if a name is part of this <code>NameList</code>.
- * @param str The name to look for.
- * @return <code>true</code> if the name has been found,
- * <code>false</code> otherwise.
- */
- public boolean contains(String str);
-
- /**
- * Test if the pair namespaceURI/name is part of this
- * <code>NameList</code>.
- * @param namespaceURI The namespace URI to look for.
- * @param name The name to look for.
- * @return <code>true</code> if the pair namespaceURI/name has been
- * found, <code>false</code> otherwise.
- */
- public boolean containsNS(String namespaceURI,
- String name);
-
-}
diff --git a/src/org/w3c/dom/NamedNodeMap.java b/src/org/w3c/dom/NamedNodeMap.java
deleted file mode 100644
index 00466c1..0000000
--- a/src/org/w3c/dom/NamedNodeMap.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] in the hope that
- * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * Objects implementing the <code>NamedNodeMap</code> interface are used to
- * represent collections of nodes that can be accessed by name. Note that
- * <code>NamedNodeMap</code> does not inherit from <code>NodeList</code>;
- * <code>NamedNodeMaps</code> are not maintained in any particular order.
- * Objects contained in an object implementing <code>NamedNodeMap</code> may
- * also be accessed by an ordinal index, but this is simply to allow
- * convenient enumeration of the contents of a <code>NamedNodeMap</code>,
- * and does not imply that the DOM specifies an order to these Nodes.
- * <p><code>NamedNodeMap</code> objects in the DOM are live.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- */
-public interface NamedNodeMap {
- /**
- * Retrieves a node specified by name.
- * @param name The <code>nodeName</code> of a node to retrieve.
- * @return A <code>Node</code> (of any type) with the specified
- * <code>nodeName</code>, or <code>null</code> if it does not identify
- * any node in this map.
- */
- public Node getNamedItem(String name);
-
- /**
- * Adds a node using its <code>nodeName</code> attribute. If a node with
- * that name is already present in this map, it is replaced by the new
- * one. Replacing a node by itself has no effect.
- * <br>As the <code>nodeName</code> attribute is used to derive the name
- * which the node must be stored under, multiple nodes of certain types
- * (those that have a "special" string value) cannot be stored as the
- * names would clash. This is seen as preferable to allowing nodes to be
- * aliased.
- * @param arg A node to store in this map. The node will later be
- * accessible using the value of its <code>nodeName</code> attribute.
- * @return If the new <code>Node</code> replaces an existing node the
- * replaced <code>Node</code> is returned, otherwise <code>null</code>
- * is returned.
- * @exception DOMException
- * WRONG_DOCUMENT_ERR: Raised if <code>arg</code> was created from a
- * different document than the one that created this map.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.
- * <br>INUSE_ATTRIBUTE_ERR: Raised if <code>arg</code> is an
- * <code>Attr</code> that is already an attribute of another
- * <code>Element</code> object. The DOM user must explicitly clone
- * <code>Attr</code> nodes to re-use them in other elements.
- * <br>HIERARCHY_REQUEST_ERR: Raised if an attempt is made to add a node
- * doesn't belong in this NamedNodeMap. Examples would include trying
- * to insert something other than an Attr node into an Element's map
- * of attributes, or a non-Entity node into the DocumentType's map of
- * Entities.
- */
- public Node setNamedItem(Node arg)
- throws DOMException;
-
- /**
- * Removes a node specified by name. When this map contains the attributes
- * attached to an element, if the removed attribute is known to have a
- * default value, an attribute immediately appears containing the
- * default value as well as the corresponding namespace URI, local name,
- * and prefix when applicable.
- * @param name The <code>nodeName</code> of the node to remove.
- * @return The node removed from this map if a node with such a name
- * exists.
- * @exception DOMException
- * NOT_FOUND_ERR: Raised if there is no node named <code>name</code> in
- * this map.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.
- */
- public Node removeNamedItem(String name)
- throws DOMException;
-
- /**
- * Returns the <code>index</code>th item in the map. If <code>index</code>
- * is greater than or equal to the number of nodes in this map, this
- * returns <code>null</code>.
- * @param index Index into this map.
- * @return The node at the <code>index</code>th position in the map, or
- * <code>null</code> if that is not a valid index.
- */
- public Node item(int index);
-
- /**
- * The number of nodes in this map. The range of valid child node indices
- * is <code>0</code> to <code>length-1</code> inclusive.
- */
- public int getLength();
-
- /**
- * Retrieves a node specified by local name and namespace URI.
- * <br>Per [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>]
- * , applications must use the value null as the namespaceURI parameter
- * for methods if they wish to have no namespace.
- * @param namespaceURI The namespace URI of the node to retrieve.
- * @param localName The local name of the node to retrieve.
- * @return A <code>Node</code> (of any type) with the specified local
- * name and namespace URI, or <code>null</code> if they do not
- * identify any node in this map.
- * @exception DOMException
- * NOT_SUPPORTED_ERR: May be raised if the implementation does not
- * support the feature "XML" and the language exposed through the
- * Document does not support XML Namespaces (such as [<a href='http://www.w3.org/TR/1999/REC-html401-19991224/'>HTML 4.01</a>]).
- * @since DOM Level 2
- */
- public Node getNamedItemNS(String namespaceURI,
- String localName)
- throws DOMException;
-
- /**
- * Adds a node using its <code>namespaceURI</code> and
- * <code>localName</code>. If a node with that namespace URI and that
- * local name is already present in this map, it is replaced by the new
- * one. Replacing a node by itself has no effect.
- * <br>Per [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>]
- * , applications must use the value null as the namespaceURI parameter
- * for methods if they wish to have no namespace.
- * @param arg A node to store in this map. The node will later be
- * accessible using the value of its <code>namespaceURI</code> and
- * <code>localName</code> attributes.
- * @return If the new <code>Node</code> replaces an existing node the
- * replaced <code>Node</code> is returned, otherwise <code>null</code>
- * is returned.
- * @exception DOMException
- * WRONG_DOCUMENT_ERR: Raised if <code>arg</code> was created from a
- * different document than the one that created this map.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.
- * <br>INUSE_ATTRIBUTE_ERR: Raised if <code>arg</code> is an
- * <code>Attr</code> that is already an attribute of another
- * <code>Element</code> object. The DOM user must explicitly clone
- * <code>Attr</code> nodes to re-use them in other elements.
- * <br>HIERARCHY_REQUEST_ERR: Raised if an attempt is made to add a node
- * doesn't belong in this NamedNodeMap. Examples would include trying
- * to insert something other than an Attr node into an Element's map
- * of attributes, or a non-Entity node into the DocumentType's map of
- * Entities.
- * <br>NOT_SUPPORTED_ERR: May be raised if the implementation does not
- * support the feature "XML" and the language exposed through the
- * Document does not support XML Namespaces (such as [<a href='http://www.w3.org/TR/1999/REC-html401-19991224/'>HTML 4.01</a>]).
- * @since DOM Level 2
- */
- public Node setNamedItemNS(Node arg)
- throws DOMException;
-
- /**
- * Removes a node specified by local name and namespace URI. A removed
- * attribute may be known to have a default value when this map contains
- * the attributes attached to an element, as returned by the attributes
- * attribute of the <code>Node</code> interface. If so, an attribute
- * immediately appears containing the default value as well as the
- * corresponding namespace URI, local name, and prefix when applicable.
- * <br>Per [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>]
- * , applications must use the value null as the namespaceURI parameter
- * for methods if they wish to have no namespace.
- * @param namespaceURI The namespace URI of the node to remove.
- * @param localName The local name of the node to remove.
- * @return The node removed from this map if a node with such a local
- * name and namespace URI exists.
- * @exception DOMException
- * NOT_FOUND_ERR: Raised if there is no node with the specified
- * <code>namespaceURI</code> and <code>localName</code> in this map.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.
- * <br>NOT_SUPPORTED_ERR: May be raised if the implementation does not
- * support the feature "XML" and the language exposed through the
- * Document does not support XML Namespaces (such as [<a href='http://www.w3.org/TR/1999/REC-html401-19991224/'>HTML 4.01</a>]).
- * @since DOM Level 2
- */
- public Node removeNamedItemNS(String namespaceURI,
- String localName)
- throws DOMException;
-
-}
diff --git a/src/org/w3c/dom/Node.java b/src/org/w3c/dom/Node.java
deleted file mode 100644
index 68404b9..0000000
--- a/src/org/w3c/dom/Node.java
+++ /dev/null
@@ -1,953 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] in the hope that
- * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * The <code>Node</code> interface is the primary datatype for the entire
- * Document Object Model. It represents a single node in the document tree.
- * While all objects implementing the <code>Node</code> interface expose
- * methods for dealing with children, not all objects implementing the
- * <code>Node</code> interface may have children. For example,
- * <code>Text</code> nodes may not have children, and adding children to
- * such nodes results in a <code>DOMException</code> being raised.
- * <p>The attributes <code>nodeName</code>, <code>nodeValue</code> and
- * <code>attributes</code> are included as a mechanism to get at node
- * information without casting down to the specific derived interface. In
- * cases where there is no obvious mapping of these attributes for a
- * specific <code>nodeType</code> (e.g., <code>nodeValue</code> for an
- * <code>Element</code> or <code>attributes</code> for a <code>Comment</code>
- * ), this returns <code>null</code>. Note that the specialized interfaces
- * may contain additional and more convenient mechanisms to get and set the
- * relevant information.
- * <p>The values of <code>nodeName</code>,
- * <code>nodeValue</code>, and <code>attributes</code> vary according to the
- * node type as follows:
- * <table border='1' cellpadding='3'>
- * <tr>
- * <th>Interface</th>
- * <th>nodeName</th>
- * <th>nodeValue</th>
- * <th>attributes</th>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>
- * <code>Attr</code></td>
- * <td valign='top' rowspan='1' colspan='1'>same as <code>Attr.name</code></td>
- * <td valign='top' rowspan='1' colspan='1'>same as
- * <code>Attr.value</code></td>
- * <td valign='top' rowspan='1' colspan='1'><code>null</code></td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'><code>CDATASection</code></td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <code>"#cdata-section"</code></td>
- * <td valign='top' rowspan='1' colspan='1'>same as <code>CharacterData.data</code>, the
- * content of the CDATA Section</td>
- * <td valign='top' rowspan='1' colspan='1'><code>null</code></td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'><code>Comment</code></td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <code>"#comment"</code></td>
- * <td valign='top' rowspan='1' colspan='1'>same as <code>CharacterData.data</code>, the
- * content of the comment</td>
- * <td valign='top' rowspan='1' colspan='1'><code>null</code></td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'><code>Document</code></td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <code>"#document"</code></td>
- * <td valign='top' rowspan='1' colspan='1'><code>null</code></td>
- * <td valign='top' rowspan='1' colspan='1'><code>null</code></td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>
- * <code>DocumentFragment</code></td>
- * <td valign='top' rowspan='1' colspan='1'><code>"#document-fragment"</code></td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <code>null</code></td>
- * <td valign='top' rowspan='1' colspan='1'><code>null</code></td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'><code>DocumentType</code></td>
- * <td valign='top' rowspan='1' colspan='1'>same as
- * <code>DocumentType.name</code></td>
- * <td valign='top' rowspan='1' colspan='1'><code>null</code></td>
- * <td valign='top' rowspan='1' colspan='1'><code>null</code></td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>
- * <code>Element</code></td>
- * <td valign='top' rowspan='1' colspan='1'>same as <code>Element.tagName</code></td>
- * <td valign='top' rowspan='1' colspan='1'><code>null</code></td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <code>NamedNodeMap</code></td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'><code>Entity</code></td>
- * <td valign='top' rowspan='1' colspan='1'>entity name</td>
- * <td valign='top' rowspan='1' colspan='1'><code>null</code></td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <code>null</code></td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'><code>EntityReference</code></td>
- * <td valign='top' rowspan='1' colspan='1'>name of entity referenced</td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <code>null</code></td>
- * <td valign='top' rowspan='1' colspan='1'><code>null</code></td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'><code>Notation</code></td>
- * <td valign='top' rowspan='1' colspan='1'>notation name</td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <code>null</code></td>
- * <td valign='top' rowspan='1' colspan='1'><code>null</code></td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'><code>ProcessingInstruction</code></td>
- * <td valign='top' rowspan='1' colspan='1'>same
- * as <code>ProcessingInstruction.target</code></td>
- * <td valign='top' rowspan='1' colspan='1'>same as
- * <code>ProcessingInstruction.data</code></td>
- * <td valign='top' rowspan='1' colspan='1'><code>null</code></td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'><code>Text</code></td>
- * <td valign='top' rowspan='1' colspan='1'>
- * <code>"#text"</code></td>
- * <td valign='top' rowspan='1' colspan='1'>same as <code>CharacterData.data</code>, the content
- * of the text node</td>
- * <td valign='top' rowspan='1' colspan='1'><code>null</code></td>
- * </tr>
- * </table>
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- */
-public interface Node {
- // NodeType
- /**
- * The node is an <code>Element</code>.
- */
- public static final short ELEMENT_NODE = 1;
- /**
- * The node is an <code>Attr</code>.
- */
- public static final short ATTRIBUTE_NODE = 2;
- /**
- * The node is a <code>Text</code> node.
- */
- public static final short TEXT_NODE = 3;
- /**
- * The node is a <code>CDATASection</code>.
- */
- public static final short CDATA_SECTION_NODE = 4;
- /**
- * The node is an <code>EntityReference</code>.
- */
- public static final short ENTITY_REFERENCE_NODE = 5;
- /**
- * The node is an <code>Entity</code>.
- */
- public static final short ENTITY_NODE = 6;
- /**
- * The node is a <code>ProcessingInstruction</code>.
- */
- public static final short PROCESSING_INSTRUCTION_NODE = 7;
- /**
- * The node is a <code>Comment</code>.
- */
- public static final short COMMENT_NODE = 8;
- /**
- * The node is a <code>Document</code>.
- */
- public static final short DOCUMENT_NODE = 9;
- /**
- * The node is a <code>DocumentType</code>.
- */
- public static final short DOCUMENT_TYPE_NODE = 10;
- /**
- * The node is a <code>DocumentFragment</code>.
- */
- public static final short DOCUMENT_FRAGMENT_NODE = 11;
- /**
- * The node is a <code>Notation</code>.
- */
- public static final short NOTATION_NODE = 12;
-
- /**
- * The name of this node, depending on its type; see the table above.
- */
- public String getNodeName();
-
- /**
- * The value of this node, depending on its type; see the table above.
- * When it is defined to be <code>null</code>, setting it has no effect,
- * including if the node is read-only.
- * @exception DOMException
- * DOMSTRING_SIZE_ERR: Raised when it would return more characters than
- * fit in a <code>DOMString</code> variable on the implementation
- * platform.
- */
- public String getNodeValue()
- throws DOMException;
- /**
- * The value of this node, depending on its type; see the table above.
- * When it is defined to be <code>null</code>, setting it has no effect,
- * including if the node is read-only.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly and if
- * it is not defined to be <code>null</code>.
- */
- public void setNodeValue(String nodeValue)
- throws DOMException;
-
- /**
- * A code representing the type of the underlying object, as defined above.
- */
- public short getNodeType();
-
- /**
- * The parent of this node. All nodes, except <code>Attr</code>,
- * <code>Document</code>, <code>DocumentFragment</code>,
- * <code>Entity</code>, and <code>Notation</code> may have a parent.
- * However, if a node has just been created and not yet added to the
- * tree, or if it has been removed from the tree, this is
- * <code>null</code>.
- */
- public Node getParentNode();
-
- /**
- * A <code>NodeList</code> that contains all children of this node. If
- * there are no children, this is a <code>NodeList</code> containing no
- * nodes.
- */
- public NodeList getChildNodes();
-
- /**
- * The first child of this node. If there is no such node, this returns
- * <code>null</code>.
- */
- public Node getFirstChild();
-
- /**
- * The last child of this node. If there is no such node, this returns
- * <code>null</code>.
- */
- public Node getLastChild();
-
- /**
- * The node immediately preceding this node. If there is no such node,
- * this returns <code>null</code>.
- */
- public Node getPreviousSibling();
-
- /**
- * The node immediately following this node. If there is no such node,
- * this returns <code>null</code>.
- */
- public Node getNextSibling();
-
- /**
- * A <code>NamedNodeMap</code> containing the attributes of this node (if
- * it is an <code>Element</code>) or <code>null</code> otherwise.
- */
- public NamedNodeMap getAttributes();
-
- /**
- * The <code>Document</code> object associated with this node. This is
- * also the <code>Document</code> object used to create new nodes. When
- * this node is a <code>Document</code> or a <code>DocumentType</code>
- * which is not used with any <code>Document</code> yet, this is
- * <code>null</code>.
- *
- * @since DOM Level 2
- */
- public Document getOwnerDocument();
-
- /**
- * Inserts the node <code>newChild</code> before the existing child node
- * <code>refChild</code>. If <code>refChild</code> is <code>null</code>,
- * insert <code>newChild</code> at the end of the list of children.
- * <br>If <code>newChild</code> is a <code>DocumentFragment</code> object,
- * all of its children are inserted, in the same order, before
- * <code>refChild</code>. If the <code>newChild</code> is already in the
- * tree, it is first removed.
- * <p ><b>Note:</b> Inserting a node before itself is implementation
- * dependent.
- * @param newChild The node to insert.
- * @param refChild The reference node, i.e., the node before which the
- * new node must be inserted.
- * @return The node being inserted.
- * @exception DOMException
- * HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not
- * allow children of the type of the <code>newChild</code> node, or if
- * the node to insert is one of this node's ancestors or this node
- * itself, or if this node is of type <code>Document</code> and the
- * DOM application attempts to insert a second
- * <code>DocumentType</code> or <code>Element</code> node.
- * <br>WRONG_DOCUMENT_ERR: Raised if <code>newChild</code> was created
- * from a different document than the one that created this node.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly or
- * if the parent of the node being inserted is readonly.
- * <br>NOT_FOUND_ERR: Raised if <code>refChild</code> is not a child of
- * this node.
- * <br>NOT_SUPPORTED_ERR: if this node is of type <code>Document</code>,
- * this exception might be raised if the DOM implementation doesn't
- * support the insertion of a <code>DocumentType</code> or
- * <code>Element</code> node.
- *
- * @since DOM Level 3
- */
- public Node insertBefore(Node newChild,
- Node refChild)
- throws DOMException;
-
- /**
- * Replaces the child node <code>oldChild</code> with <code>newChild</code>
- * in the list of children, and returns the <code>oldChild</code> node.
- * <br>If <code>newChild</code> is a <code>DocumentFragment</code> object,
- * <code>oldChild</code> is replaced by all of the
- * <code>DocumentFragment</code> children, which are inserted in the
- * same order. If the <code>newChild</code> is already in the tree, it
- * is first removed.
- * <p ><b>Note:</b> Replacing a node with itself is implementation
- * dependent.
- * @param newChild The new node to put in the child list.
- * @param oldChild The node being replaced in the list.
- * @return The node replaced.
- * @exception DOMException
- * HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not
- * allow children of the type of the <code>newChild</code> node, or if
- * the node to put in is one of this node's ancestors or this node
- * itself, or if this node is of type <code>Document</code> and the
- * result of the replacement operation would add a second
- * <code>DocumentType</code> or <code>Element</code> on the
- * <code>Document</code> node.
- * <br>WRONG_DOCUMENT_ERR: Raised if <code>newChild</code> was created
- * from a different document than the one that created this node.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node or the parent of
- * the new node is readonly.
- * <br>NOT_FOUND_ERR: Raised if <code>oldChild</code> is not a child of
- * this node.
- * <br>NOT_SUPPORTED_ERR: if this node is of type <code>Document</code>,
- * this exception might be raised if the DOM implementation doesn't
- * support the replacement of the <code>DocumentType</code> child or
- * <code>Element</code> child.
- *
- * @since DOM Level 3
- */
- public Node replaceChild(Node newChild,
- Node oldChild)
- throws DOMException;
-
- /**
- * Removes the child node indicated by <code>oldChild</code> from the list
- * of children, and returns it.
- * @param oldChild The node being removed.
- * @return The node removed.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- * <br>NOT_FOUND_ERR: Raised if <code>oldChild</code> is not a child of
- * this node.
- * <br>NOT_SUPPORTED_ERR: if this node is of type <code>Document</code>,
- * this exception might be raised if the DOM implementation doesn't
- * support the removal of the <code>DocumentType</code> child or the
- * <code>Element</code> child.
- *
- * @since DOM Level 3
- */
- public Node removeChild(Node oldChild)
- throws DOMException;
-
- /**
- * Adds the node <code>newChild</code> to the end of the list of children
- * of this node. If the <code>newChild</code> is already in the tree, it
- * is first removed.
- * @param newChild The node to add.If it is a
- * <code>DocumentFragment</code> object, the entire contents of the
- * document fragment are moved into the child list of this node
- * @return The node added.
- * @exception DOMException
- * HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not
- * allow children of the type of the <code>newChild</code> node, or if
- * the node to append is one of this node's ancestors or this node
- * itself, or if this node is of type <code>Document</code> and the
- * DOM application attempts to append a second
- * <code>DocumentType</code> or <code>Element</code> node.
- * <br>WRONG_DOCUMENT_ERR: Raised if <code>newChild</code> was created
- * from a different document than the one that created this node.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly or
- * if the previous parent of the node being inserted is readonly.
- * <br>NOT_SUPPORTED_ERR: if the <code>newChild</code> node is a child
- * of the <code>Document</code> node, this exception might be raised
- * if the DOM implementation doesn't support the removal of the
- * <code>DocumentType</code> child or <code>Element</code> child.
- *
- * @since DOM Level 3
- */
- public Node appendChild(Node newChild)
- throws DOMException;
-
- /**
- * Returns whether this node has any children.
- * @return Returns <code>true</code> if this node has any children,
- * <code>false</code> otherwise.
- */
- public boolean hasChildNodes();
-
- /**
- * Returns a duplicate of this node, i.e., serves as a generic copy
- * constructor for nodes. The duplicate node has no parent (
- * <code>parentNode</code> is <code>null</code>) and no user data. User
- * data associated to the imported node is not carried over. However, if
- * any <code>UserDataHandlers</code> has been specified along with the
- * associated data these handlers will be called with the appropriate
- * parameters before this method returns.
- * <br>Cloning an <code>Element</code> copies all attributes and their
- * values, including those generated by the XML processor to represent
- * defaulted attributes, but this method does not copy any children it
- * contains unless it is a deep clone. This includes text contained in
- * an the <code>Element</code> since the text is contained in a child
- * <code>Text</code> node. Cloning an <code>Attr</code> directly, as
- * opposed to be cloned as part of an <code>Element</code> cloning
- * operation, returns a specified attribute (<code>specified</code> is
- * <code>true</code>). Cloning an <code>Attr</code> always clones its
- * children, since they represent its value, no matter whether this is a
- * deep clone or not. Cloning an <code>EntityReference</code>
- * automatically constructs its subtree if a corresponding
- * <code>Entity</code> is available, no matter whether this is a deep
- * clone or not. Cloning any other type of node simply returns a copy of
- * this node.
- * <br>Note that cloning an immutable subtree results in a mutable copy,
- * but the children of an <code>EntityReference</code> clone are readonly
- * . In addition, clones of unspecified <code>Attr</code> nodes are
- * specified. And, cloning <code>Document</code>,
- * <code>DocumentType</code>, <code>Entity</code>, and
- * <code>Notation</code> nodes is implementation dependent.
- * @param deep If <code>true</code>, recursively clone the subtree under
- * the specified node; if <code>false</code>, clone only the node
- * itself (and its attributes, if it is an <code>Element</code>).
- * @return The duplicate node.
- */
- public Node cloneNode(boolean deep);
-
- /**
- * Puts all <code>Text</code> nodes in the full depth of the sub-tree
- * underneath this <code>Node</code>, including attribute nodes, into a
- * "normal" form where only structure (e.g., elements, comments,
- * processing instructions, CDATA sections, and entity references)
- * separates <code>Text</code> nodes, i.e., there are neither adjacent
- * <code>Text</code> nodes nor empty <code>Text</code> nodes. This can
- * be used to ensure that the DOM view of a document is the same as if
- * it were saved and re-loaded, and is useful when operations (such as
- * XPointer [<a href='http://www.w3.org/TR/2003/REC-xptr-framework-20030325/'>XPointer</a>]
- * lookups) that depend on a particular document tree structure are to
- * be used. If the parameter "normalize-characters" of the
- * <code>DOMConfiguration</code> object attached to the
- * <code>Node.ownerDocument</code> is <code>true</code>, this method
- * will also fully normalize the characters of the <code>Text</code>
- * nodes.
- * <p ><b>Note:</b> In cases where the document contains
- * <code>CDATASections</code>, the normalize operation alone may not be
- * sufficient, since XPointers do not differentiate between
- * <code>Text</code> nodes and <code>CDATASection</code> nodes.
- *
- * @since DOM Level 3
- */
- public void normalize();
-
- /**
- * Tests whether the DOM implementation implements a specific feature and
- * that feature is supported by this node, as specified in .
- * @param feature The name of the feature to test.
- * @param version This is the version number of the feature to test.
- * @return Returns <code>true</code> if the specified feature is
- * supported on this node, <code>false</code> otherwise.
- *
- * @since DOM Level 2
- */
- public boolean isSupported(String feature,
- String version);
-
- /**
- * The namespace URI of this node, or <code>null</code> if it is
- * unspecified (see ).
- * <br>This is not a computed value that is the result of a namespace
- * lookup based on an examination of the namespace declarations in
- * scope. It is merely the namespace URI given at creation time.
- * <br>For nodes of any type other than <code>ELEMENT_NODE</code> and
- * <code>ATTRIBUTE_NODE</code> and nodes created with a DOM Level 1
- * method, such as <code>Document.createElement()</code>, this is always
- * <code>null</code>.
- * <p ><b>Note:</b> Per the <em>Namespaces in XML</em> Specification [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>]
- * an attribute does not inherit its namespace from the element it is
- * attached to. If an attribute is not explicitly given a namespace, it
- * simply has no namespace.
- *
- * @since DOM Level 2
- */
- public String getNamespaceURI();
-
- /**
- * The namespace prefix of this node, or <code>null</code> if it is
- * unspecified. When it is defined to be <code>null</code>, setting it
- * has no effect, including if the node is read-only.
- * <br>Note that setting this attribute, when permitted, changes the
- * <code>nodeName</code> attribute, which holds the qualified name, as
- * well as the <code>tagName</code> and <code>name</code> attributes of
- * the <code>Element</code> and <code>Attr</code> interfaces, when
- * applicable.
- * <br>Setting the prefix to <code>null</code> makes it unspecified,
- * setting it to an empty string is implementation dependent.
- * <br>Note also that changing the prefix of an attribute that is known to
- * have a default value, does not make a new attribute with the default
- * value and the original prefix appear, since the
- * <code>namespaceURI</code> and <code>localName</code> do not change.
- * <br>For nodes of any type other than <code>ELEMENT_NODE</code> and
- * <code>ATTRIBUTE_NODE</code> and nodes created with a DOM Level 1
- * method, such as <code>createElement</code> from the
- * <code>Document</code> interface, this is always <code>null</code>.
- *
- * @since DOM Level 2
- */
- public String getPrefix();
- /**
- * The namespace prefix of this node, or <code>null</code> if it is
- * unspecified. When it is defined to be <code>null</code>, setting it
- * has no effect, including if the node is read-only.
- * <br>Note that setting this attribute, when permitted, changes the
- * <code>nodeName</code> attribute, which holds the qualified name, as
- * well as the <code>tagName</code> and <code>name</code> attributes of
- * the <code>Element</code> and <code>Attr</code> interfaces, when
- * applicable.
- * <br>Setting the prefix to <code>null</code> makes it unspecified,
- * setting it to an empty string is implementation dependent.
- * <br>Note also that changing the prefix of an attribute that is known to
- * have a default value, does not make a new attribute with the default
- * value and the original prefix appear, since the
- * <code>namespaceURI</code> and <code>localName</code> do not change.
- * <br>For nodes of any type other than <code>ELEMENT_NODE</code> and
- * <code>ATTRIBUTE_NODE</code> and nodes created with a DOM Level 1
- * method, such as <code>createElement</code> from the
- * <code>Document</code> interface, this is always <code>null</code>.
- * @exception DOMException
- * INVALID_CHARACTER_ERR: Raised if the specified prefix contains an
- * illegal character according to the XML version in use specified in
- * the <code>Document.xmlVersion</code> attribute.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- * <br>NAMESPACE_ERR: Raised if the specified <code>prefix</code> is
- * malformed per the Namespaces in XML specification, if the
- * <code>namespaceURI</code> of this node is <code>null</code>, if the
- * specified prefix is "xml" and the <code>namespaceURI</code> of this
- * node is different from "<a href='http://www.w3.org/XML/1998/namespace'>
- * http://www.w3.org/XML/1998/namespace</a>", if this node is an attribute and the specified prefix is "xmlns" and
- * the <code>namespaceURI</code> of this node is different from "<a href='http://www.w3.org/2000/xmlns/'>http://www.w3.org/2000/xmlns/</a>", or if this node is an attribute and the <code>qualifiedName</code> of
- * this node is "xmlns" [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>]
- * .
- *
- * @since DOM Level 2
- */
- public void setPrefix(String prefix)
- throws DOMException;
-
- /**
- * Returns the local part of the qualified name of this node.
- * <br>For nodes of any type other than <code>ELEMENT_NODE</code> and
- * <code>ATTRIBUTE_NODE</code> and nodes created with a DOM Level 1
- * method, such as <code>Document.createElement()</code>, this is always
- * <code>null</code>.
- *
- * @since DOM Level 2
- */
- public String getLocalName();
-
- /**
- * Returns whether this node (if it is an element) has any attributes.
- * @return Returns <code>true</code> if this node has any attributes,
- * <code>false</code> otherwise.
- *
- * @since DOM Level 2
- */
- public boolean hasAttributes();
-
- /**
- * The absolute base URI of this node or <code>null</code> if the
- * implementation wasn't able to obtain an absolute URI. This value is
- * computed as described in . However, when the <code>Document</code>
- * supports the feature "HTML" [<a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>DOM Level 2 HTML</a>]
- * , the base URI is computed using first the value of the href
- * attribute of the HTML BASE element if any, and the value of the
- * <code>documentURI</code> attribute from the <code>Document</code>
- * interface otherwise.
- *
- * @since DOM Level 3
- */
- public String getBaseURI();
-
- // DocumentPosition
- /**
- * The two nodes are disconnected. Order between disconnected nodes is
- * always implementation-specific.
- */
- public static final short DOCUMENT_POSITION_DISCONNECTED = 0x01;
- /**
- * The second node precedes the reference node.
- */
- public static final short DOCUMENT_POSITION_PRECEDING = 0x02;
- /**
- * The node follows the reference node.
- */
- public static final short DOCUMENT_POSITION_FOLLOWING = 0x04;
- /**
- * The node contains the reference node. A node which contains is always
- * preceding, too.
- */
- public static final short DOCUMENT_POSITION_CONTAINS = 0x08;
- /**
- * The node is contained by the reference node. A node which is contained
- * is always following, too.
- */
- public static final short DOCUMENT_POSITION_CONTAINED_BY = 0x10;
- /**
- * The determination of preceding versus following is
- * implementation-specific.
- */
- public static final short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20;
-
- /**
- * Compares the reference node, i.e. the node on which this method is
- * being called, with a node, i.e. the one passed as a parameter, with
- * regard to their position in the document and according to the
- * document order.
- * @param other The node to compare against the reference node.
- * @return Returns how the node is positioned relatively to the reference
- * node.
- * @exception DOMException
- * NOT_SUPPORTED_ERR: when the compared nodes are from different DOM
- * implementations that do not coordinate to return consistent
- * implementation-specific results.
- *
- * @since DOM Level 3
- */
- public short compareDocumentPosition(Node other)
- throws DOMException;
-
- /**
- * This attribute returns the text content of this node and its
- * descendants. When it is defined to be <code>null</code>, setting it
- * has no effect. On setting, any possible children this node may have
- * are removed and, if it the new string is not empty or
- * <code>null</code>, replaced by a single <code>Text</code> node
- * containing the string this attribute is set to.
- * <br> On getting, no serialization is performed, the returned string
- * does not contain any markup. No whitespace normalization is performed
- * and the returned string does not contain the white spaces in element
- * content (see the attribute
- * <code>Text.isElementContentWhitespace</code>). Similarly, on setting,
- * no parsing is performed either, the input string is taken as pure
- * textual content.
- * <br>The string returned is made of the text content of this node
- * depending on its type, as defined below:
- * <table border='1' cellpadding='3'>
- * <tr>
- * <th>Node type</th>
- * <th>Content</th>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>
- * ELEMENT_NODE, ATTRIBUTE_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE,
- * DOCUMENT_FRAGMENT_NODE</td>
- * <td valign='top' rowspan='1' colspan='1'>concatenation of the <code>textContent</code>
- * attribute value of every child node, excluding COMMENT_NODE and
- * PROCESSING_INSTRUCTION_NODE nodes. This is the empty string if the
- * node has no children.</td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE,
- * PROCESSING_INSTRUCTION_NODE</td>
- * <td valign='top' rowspan='1' colspan='1'><code>nodeValue</code></td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>DOCUMENT_NODE,
- * DOCUMENT_TYPE_NODE, NOTATION_NODE</td>
- * <td valign='top' rowspan='1' colspan='1'><em>null</em></td>
- * </tr>
- * </table>
- * @exception DOMException
- * DOMSTRING_SIZE_ERR: Raised when it would return more characters than
- * fit in a <code>DOMString</code> variable on the implementation
- * platform.
- *
- * @since DOM Level 3
- */
- public String getTextContent()
- throws DOMException;
- /**
- * This attribute returns the text content of this node and its
- * descendants. When it is defined to be <code>null</code>, setting it
- * has no effect. On setting, any possible children this node may have
- * are removed and, if it the new string is not empty or
- * <code>null</code>, replaced by a single <code>Text</code> node
- * containing the string this attribute is set to.
- * <br> On getting, no serialization is performed, the returned string
- * does not contain any markup. No whitespace normalization is performed
- * and the returned string does not contain the white spaces in element
- * content (see the attribute
- * <code>Text.isElementContentWhitespace</code>). Similarly, on setting,
- * no parsing is performed either, the input string is taken as pure
- * textual content.
- * <br>The string returned is made of the text content of this node
- * depending on its type, as defined below:
- * <table border='1' cellpadding='3'>
- * <tr>
- * <th>Node type</th>
- * <th>Content</th>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>
- * ELEMENT_NODE, ATTRIBUTE_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE,
- * DOCUMENT_FRAGMENT_NODE</td>
- * <td valign='top' rowspan='1' colspan='1'>concatenation of the <code>textContent</code>
- * attribute value of every child node, excluding COMMENT_NODE and
- * PROCESSING_INSTRUCTION_NODE nodes. This is the empty string if the
- * node has no children.</td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE,
- * PROCESSING_INSTRUCTION_NODE</td>
- * <td valign='top' rowspan='1' colspan='1'><code>nodeValue</code></td>
- * </tr>
- * <tr>
- * <td valign='top' rowspan='1' colspan='1'>DOCUMENT_NODE,
- * DOCUMENT_TYPE_NODE, NOTATION_NODE</td>
- * <td valign='top' rowspan='1' colspan='1'><em>null</em></td>
- * </tr>
- * </table>
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
- *
- * @since DOM Level 3
- */
- public void setTextContent(String textContent)
- throws DOMException;
-
- /**
- * Returns whether this node is the same node as the given one.
- * <br>This method provides a way to determine whether two
- * <code>Node</code> references returned by the implementation reference
- * the same object. When two <code>Node</code> references are references
- * to the same object, even if through a proxy, the references may be
- * used completely interchangeably, such that all attributes have the
- * same values and calling the same DOM method on either reference
- * always has exactly the same effect.
- * @param other The node to test against.
- * @return Returns <code>true</code> if the nodes are the same,
- * <code>false</code> otherwise.
- *
- * @since DOM Level 3
- */
- public boolean isSameNode(Node other);
-
- /**
- * Look up the prefix associated to the given namespace URI, starting from
- * this node. The default namespace declarations are ignored by this
- * method.
- * <br>See for details on the algorithm used by this method.
- * @param namespaceURI The namespace URI to look for.
- * @return Returns an associated namespace prefix if found or
- * <code>null</code> if none is found. If more than one prefix are
- * associated to the namespace prefix, the returned namespace prefix
- * is implementation dependent.
- *
- * @since DOM Level 3
- */
- public String lookupPrefix(String namespaceURI);
-
- /**
- * This method checks if the specified <code>namespaceURI</code> is the
- * default namespace or not.
- * @param namespaceURI The namespace URI to look for.
- * @return Returns <code>true</code> if the specified
- * <code>namespaceURI</code> is the default namespace,
- * <code>false</code> otherwise.
- *
- * @since DOM Level 3
- */
- public boolean isDefaultNamespace(String namespaceURI);
-
- /**
- * Look up the namespace URI associated to the given prefix, starting from
- * this node.
- * <br>See for details on the algorithm used by this method.
- * @param prefix The prefix to look for. If this parameter is
- * <code>null</code>, the method will return the default namespace URI
- * if any.
- * @return Returns the associated namespace URI or <code>null</code> if
- * none is found.
- *
- * @since DOM Level 3
- */
- public String lookupNamespaceURI(String prefix);
-
- /**
- * Tests whether two nodes are equal.
- * <br>This method tests for equality of nodes, not sameness (i.e.,
- * whether the two nodes are references to the same object) which can be
- * tested with <code>Node.isSameNode()</code>. All nodes that are the
- * same will also be equal, though the reverse may not be true.
- * <br>Two nodes are equal if and only if the following conditions are
- * satisfied:
- * <ul>
- * <li>The two nodes are of the same type.
- * </li>
- * <li>The following string
- * attributes are equal: <code>nodeName</code>, <code>localName</code>,
- * <code>namespaceURI</code>, <code>prefix</code>, <code>nodeValue</code>
- * . This is: they are both <code>null</code>, or they have the same
- * length and are character for character identical.
- * </li>
- * <li>The
- * <code>attributes</code> <code>NamedNodeMaps</code> are equal. This
- * is: they are both <code>null</code>, or they have the same length and
- * for each node that exists in one map there is a node that exists in
- * the other map and is equal, although not necessarily at the same
- * index.
- * </li>
- * <li>The <code>childNodes</code> <code>NodeLists</code> are equal.
- * This is: they are both <code>null</code>, or they have the same
- * length and contain equal nodes at the same index. Note that
- * normalization can affect equality; to avoid this, nodes should be
- * normalized before being compared.
- * </li>
- * </ul>
- * <br>For two <code>DocumentType</code> nodes to be equal, the following
- * conditions must also be satisfied:
- * <ul>
- * <li>The following string attributes
- * are equal: <code>publicId</code>, <code>systemId</code>,
- * <code>internalSubset</code>.
- * </li>
- * <li>The <code>entities</code>
- * <code>NamedNodeMaps</code> are equal.
- * </li>
- * <li>The <code>notations</code>
- * <code>NamedNodeMaps</code> are equal.
- * </li>
- * </ul>
- * <br>On the other hand, the following do not affect equality: the
- * <code>ownerDocument</code>, <code>baseURI</code>, and
- * <code>parentNode</code> attributes, the <code>specified</code>
- * attribute for <code>Attr</code> nodes, the <code>schemaTypeInfo</code>
- * attribute for <code>Attr</code> and <code>Element</code> nodes, the
- * <code>Text.isElementContentWhitespace</code> attribute for
- * <code>Text</code> nodes, as well as any user data or event listeners
- * registered on the nodes.
- * <p ><b>Note:</b> As a general rule, anything not mentioned in the
- * description above is not significant in consideration of equality
- * checking. Note that future versions of this specification may take
- * into account more attributes and implementations conform to this
- * specification are expected to be updated accordingly.
- * @param arg The node to compare equality with.
- * @return Returns <code>true</code> if the nodes are equal,
- * <code>false</code> otherwise.
- *
- * @since DOM Level 3
- */
- public boolean isEqualNode(Node arg);
-
- /**
- * This method returns a specialized object which implements the
- * specialized APIs of the specified feature and version, as specified
- * in . The specialized object may also be obtained by using
- * binding-specific casting methods but is not necessarily expected to,
- * as discussed in . This method also allow the implementation to
- * provide specialized objects which do not support the <code>Node</code>
- * interface.
- * @param feature The name of the feature requested. Note that any plus
- * sign "+" prepended to the name of the feature will be ignored since
- * it is not significant in the context of this method.
- * @param version This is the version number of the feature to test.
- * @return Returns an object which implements the specialized APIs of
- * the specified feature and version, if any, or <code>null</code> if
- * there is no object which implements interfaces associated with that
- * feature. If the <code>DOMObject</code> returned by this method
- * implements the <code>Node</code> interface, it must delegate to the
- * primary core <code>Node</code> and not return results inconsistent
- * with the primary core <code>Node</code> such as attributes,
- * childNodes, etc.
- *
- * @since DOM Level 3
- */
- public Object getFeature(String feature,
- String version);
-
- /**
- * Associate an object to a key on this node. The object can later be
- * retrieved from this node by calling <code>getUserData</code> with the
- * same key.
- * @param key The key to associate the object to.
- * @param data The object to associate to the given key, or
- * <code>null</code> to remove any existing association to that key.
- * @param handler The handler to associate to that key, or
- * <code>null</code>.
- * @return Returns the <code>DOMUserData</code> previously associated to
- * the given key on this node, or <code>null</code> if there was none.
- *
- * @since DOM Level 3
- */
- public Object setUserData(String key,
- Object data,
- UserDataHandler handler);
-
- /**
- * Retrieves the object associated to a key on a this node. The object
- * must first have been set to this node by calling
- * <code>setUserData</code> with the same key.
- * @param key The key the object is associated to.
- * @return Returns the <code>DOMUserData</code> associated to the given
- * key on this node, or <code>null</code> if there was none.
- *
- * @since DOM Level 3
- */
- public Object getUserData(String key);
-
-}
diff --git a/src/org/w3c/dom/NodeList.java b/src/org/w3c/dom/NodeList.java
deleted file mode 100644
index 20521f1..0000000
--- a/src/org/w3c/dom/NodeList.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] in the hope that
- * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * The <code>NodeList</code> interface provides the abstraction of an ordered
- * collection of nodes, without defining or constraining how this collection
- * is implemented. <code>NodeList</code> objects in the DOM are live.
- * <p>The items in the <code>NodeList</code> are accessible via an integral
- * index, starting from 0.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- */
-public interface NodeList {
- /**
- * Returns the <code>index</code>th item in the collection. If
- * <code>index</code> is greater than or equal to the number of nodes in
- * the list, this returns <code>null</code>.
- * @param index Index into the collection.
- * @return The node at the <code>index</code>th position in the
- * <code>NodeList</code>, or <code>null</code> if that is not a valid
- * index.
- */
- public Node item(int index);
-
- /**
- * The number of nodes in the list. The range of valid child node indices
- * is 0 to <code>length-1</code> inclusive.
- */
- public int getLength();
-
-}
diff --git a/src/org/w3c/dom/Notation.java b/src/org/w3c/dom/Notation.java
deleted file mode 100644
index 3b5db96..0000000
--- a/src/org/w3c/dom/Notation.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] in the hope that
- * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * This interface represents a notation declared in the DTD. A notation either
- * declares, by name, the format of an unparsed entity (see <a href='http://www.w3.org/TR/2004/REC-xml-20040204#Notations'>section 4.7</a> of the XML 1.0 specification [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>]), or is
- * used for formal declaration of processing instruction targets (see <a href='http://www.w3.org/TR/2004/REC-xml-20040204#sec-pi'>section 2.6</a> of the XML 1.0 specification [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>]). The
- * <code>nodeName</code> attribute inherited from <code>Node</code> is set
- * to the declared name of the notation.
- * <p>The DOM Core does not support editing <code>Notation</code> nodes; they
- * are therefore readonly.
- * <p>A <code>Notation</code> node does not have any parent.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- */
-public interface Notation extends Node {
- /**
- * The public identifier of this notation. If the public identifier was
- * not specified, this is <code>null</code>.
- */
- public String getPublicId();
-
- /**
- * The system identifier of this notation. If the system identifier was
- * not specified, this is <code>null</code>. This may be an absolute URI
- * or not.
- */
- public String getSystemId();
-
-}
diff --git a/src/org/w3c/dom/ProcessingInstruction.java b/src/org/w3c/dom/ProcessingInstruction.java
deleted file mode 100644
index a8ee739..0000000
--- a/src/org/w3c/dom/ProcessingInstruction.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] in the hope that
- * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * The <code>ProcessingInstruction</code> interface represents a "processing
- * instruction", used in XML as a way to keep processor-specific information
- * in the text of the document.
- * <p> No lexical check is done on the content of a processing instruction and
- * it is therefore possible to have the character sequence
- * <code>"?&gt;"</code> in the content, which is illegal a processing
- * instruction per section 2.6 of [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>]. The
- * presence of this character sequence must generate a fatal error during
- * serialization.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- */
-public interface ProcessingInstruction extends Node {
- /**
- * The target of this processing instruction. XML defines this as being
- * the first token following the markup that begins the processing
- * instruction.
- */
- public String getTarget();
-
- /**
- * The content of this processing instruction. This is from the first non
- * white space character after the target to the character immediately
- * preceding the <code>?&gt;</code>.
- */
- public String getData();
- /**
- * The content of this processing instruction. This is from the first non
- * white space character after the target to the character immediately
- * preceding the <code>?&gt;</code>.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
- */
- public void setData(String data)
- throws DOMException;
-
-}
diff --git a/src/org/w3c/dom/Text.java b/src/org/w3c/dom/Text.java
deleted file mode 100644
index f54d0ee..0000000
--- a/src/org/w3c/dom/Text.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] in the hope that
- * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * The <code>Text</code> interface inherits from <code>CharacterData</code>
- * and represents the textual content (termed <a href='http://www.w3.org/TR/2004/REC-xml-20040204#syntax'>character data</a> in XML) of an <code>Element</code> or <code>Attr</code>. If there is no
- * markup inside an element's content, the text is contained in a single
- * object implementing the <code>Text</code> interface that is the only
- * child of the element. If there is markup, it is parsed into the
- * information items (elements, comments, etc.) and <code>Text</code> nodes
- * that form the list of children of the element.
- * <p>When a document is first made available via the DOM, there is only one
- * <code>Text</code> node for each block of text. Users may create adjacent
- * <code>Text</code> nodes that represent the contents of a given element
- * without any intervening markup, but should be aware that there is no way
- * to represent the separations between these nodes in XML or HTML, so they
- * will not (in general) persist between DOM editing sessions. The
- * <code>Node.normalize()</code> method merges any such adjacent
- * <code>Text</code> objects into a single node for each block of text.
- * <p> No lexical check is done on the content of a <code>Text</code> node
- * and, depending on its position in the document, some characters must be
- * escaped during serialization using character references; e.g. the
- * characters "&lt;&amp;" if the textual content is part of an element or of
- * an attribute, the character sequence "]]&gt;" when part of an element,
- * the quotation mark character " or the apostrophe character ' when part of
- * an attribute.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- */
-public interface Text extends CharacterData {
- /**
- * Breaks this node into two nodes at the specified <code>offset</code>,
- * keeping both in the tree as siblings. After being split, this node
- * will contain all the content up to the <code>offset</code> point. A
- * new node of the same type, which contains all the content at and
- * after the <code>offset</code> point, is returned. If the original
- * node had a parent node, the new node is inserted as the next sibling
- * of the original node. When the <code>offset</code> is equal to the
- * length of this node, the new node has no data.
- * @param offset The 16-bit unit offset at which to split, starting from
- * <code>0</code>.
- * @return The new node, of the same type as this node.
- * @exception DOMException
- * INDEX_SIZE_ERR: Raised if the specified offset is negative or greater
- * than the number of 16-bit units in <code>data</code>.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- */
- public Text splitText(int offset)
- throws DOMException;
-
- /**
- * Returns whether this text node contains <a href='http://www.w3.org/TR/2004/REC-xml-infoset-20040204#infoitem.character'>
- * element content whitespace</a>, often abusively called "ignorable whitespace". The text node is
- * determined to contain whitespace in element content during the load
- * of the document or if validation occurs while using
- * <code>Document.normalizeDocument()</code>.
- * @since DOM Level 3
- */
- public boolean isElementContentWhitespace();
-
- /**
- * Returns all text of <code>Text</code> nodes logically-adjacent text
- * nodes to this node, concatenated in document order.
- * <br>For instance, in the example below <code>wholeText</code> on the
- * <code>Text</code> node that contains "bar" returns "barfoo", while on
- * the <code>Text</code> node that contains "foo" it returns "barfoo".
- *
- * <pre>
- * +-----+
- * | &lt;p&gt; |
- * +-----+
- * /\
- * / \
- * /-----\ +-------+
- * | bar | | &amp;ent; |
- * \-----/ +-------+
- * |
- * |
- * /-----\
- * | foo |
- * \-----/
- * </pre>
- * <em>Figure: barTextNode.wholeText value is "barfoo"</em>
- *
- * @since DOM Level 3
- */
- public String getWholeText();
-
- /**
- * Replaces the text of the current node and all logically-adjacent text
- * nodes with the specified text. All logically-adjacent text nodes are
- * removed including the current node unless it was the recipient of the
- * replacement text.
- * <p>This method returns the node which received the replacement text.
- * The returned node is:</p>
- * <ul>
- * <li><code>null</code>, when the replacement text is
- * the empty string;
- * </li>
- * <li>the current node, except when the current node is
- * read-only;
- * </li>
- * <li> a new <code>Text</code> node of the same type (
- * <code>Text</code> or <code>CDATASection</code>) as the current node
- * inserted at the location of the replacement.
- * </li>
- * </ul>
- * <p>For instance, in the above example calling
- * <code>replaceWholeText</code> on the <code>Text</code> node that
- * contains "bar" with "yo" in argument results in the following:</p>
- *
- * <pre>
- * +-----+
- * | &lt;p&gt; |
- * +-----+
- * |
- * |
- * /-----\
- * | yo |
- * \-----/
- * </pre>
- * <em>Figure: barTextNode.replaceWholeText("yo") modifies the
- * textual content of barTextNode with "yo"</em>
- *
- * <p>Where the nodes to be removed are read-only descendants of an
- * <code>EntityReference</code>, the <code>EntityReference</code> must
- * be removed instead of the read-only nodes. If any
- * <code>EntityReference</code> to be removed has descendants that are
- * not <code>EntityReference</code>, <code>Text</code>, or
- * <code>CDATASection</code> nodes, the <code>replaceWholeText</code>
- * method must fail before performing any modification of the document,
- * raising a <code>DOMException</code> with the code
- * <code>NO_MODIFICATION_ALLOWED_ERR</code>.</p>
- * <p>For instance, in the example below calling
- * <code>replaceWholeText</code> on the <code>Text</code> node that
- * contains "bar" fails, because the <code>EntityReference</code> node
- * "ent" contains an <code>Element</code> node which cannot be removed.</p>
- * @param content The content of the replacing <code>Text</code> node.
- * @return The <code>Text</code> node created with the specified content.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if one of the <code>Text</code>
- * nodes being replaced is readonly.
- * @since DOM Level 3
- */
- public Text replaceWholeText(String content)
- throws DOMException;
-
-}
diff --git a/src/org/w3c/dom/TypeInfo.java b/src/org/w3c/dom/TypeInfo.java
deleted file mode 100644
index 044ede0..0000000
--- a/src/org/w3c/dom/TypeInfo.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] in the hope that
- * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * The <code>TypeInfo</code> interface represents a type referenced from
- * <code>Element</code> or <code>Attr</code> nodes, specified in the schemas
- * associated with the document. The type is a pair of a namespace URI and
- * name properties, and depends on the document's schema.
- * <p> If the document's schema is an XML DTD [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>], the values
- * are computed as follows:
- * <ul>
- * <li> If this type is referenced from an
- * <code>Attr</code> node, <code>typeNamespace</code> is
- * <code>"http://www.w3.org/TR/REC-xml"</code> and <code>typeName</code>
- * represents the <b>[attribute type]</b> property in the [<a href='http://www.w3.org/TR/2004/REC-xml-infoset-20040204/'>XML Information Set</a>]
- * . If there is no declaration for the attribute, <code>typeNamespace</code>
- * and <code>typeName</code> are <code>null</code>.
- * </li>
- * <li> If this type is
- * referenced from an <code>Element</code> node, <code>typeNamespace</code>
- * and <code>typeName</code> are <code>null</code>.
- * </li>
- * </ul>
- * <p> If the document's schema is an XML Schema [<a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/'>XML Schema Part 1</a>]
- * , the values are computed as follows using the post-schema-validation
- * infoset contributions (also called PSVI contributions):
- * <ul>
- * <li> If the <b>[validity]</b> property exists AND is <em>"invalid"</em> or <em>"notKnown"</em>: the {target namespace} and {name} properties of the declared type if
- * available, otherwise <code>null</code>.
- * <p ><b>Note:</b> At the time of writing, the XML Schema specification does
- * not require exposing the declared type. Thus, DOM implementations might
- * choose not to provide type information if validity is not valid.
- * </li>
- * <li> If the <b>[validity]</b> property exists and is <em>"valid"</em>:
- * <ol>
- * <li> If <b>[member type definition]</b> exists:
- * <ol>
- * <li>If {name} is not absent, then expose {name} and {target
- * namespace} properties of the <b>[member type definition]</b> property;
- * </li>
- * <li>Otherwise, expose the namespace and local name of the
- * corresponding anonymous type name.
- * </li>
- * </ol>
- * </li>
- * <li> If the <b>[type definition]</b> property exists:
- * <ol>
- * <li>If {name} is not absent, then expose {name} and {target
- * namespace} properties of the <b>[type definition]</b> property;
- * </li>
- * <li>Otherwise, expose the namespace and local name of the
- * corresponding anonymous type name.
- * </li>
- * </ol>
- * </li>
- * <li> If the <b>[member type definition anonymous]</b> exists:
- * <ol>
- * <li>If it is false, then expose <b>[member type definition name]</b> and <b>[member type definition namespace]</b> properties;
- * </li>
- * <li>Otherwise, expose the namespace and local name of the
- * corresponding anonymous type name.
- * </li>
- * </ol>
- * </li>
- * <li> If the <b>[type definition anonymous]</b> exists:
- * <ol>
- * <li>If it is false, then expose <b>[type definition name]</b> and <b>[type definition namespace]</b> properties;
- * </li>
- * <li>Otherwise, expose the namespace and local name of the
- * corresponding anonymous type name.
- * </li>
- * </ol>
- * </li>
- * </ol>
- * </li>
- * </ul>
- * <p ><b>Note:</b> Other schema languages are outside the scope of the W3C
- * and therefore should define how to represent their type systems using
- * <code>TypeInfo</code>.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- * @since DOM Level 3
- */
-public interface TypeInfo {
- /**
- * The name of a type declared for the associated element or attribute,
- * or <code>null</code> if unknown.
- */
- public String getTypeName();
-
- /**
- * The namespace of the type declared for the associated element or
- * attribute or <code>null</code> if the element does not have
- * declaration or if no namespace information is available.
- */
- public String getTypeNamespace();
-
- // DerivationMethods
- /**
- * If the document's schema is an XML Schema [<a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/'>XML Schema Part 1</a>]
- * , this constant represents the derivation by <a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/#key-typeRestriction'>
- * restriction</a> if complex types are involved, or a <a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/#element-restriction'>
- * restriction</a> if simple types are involved.
- * <br> The reference type definition is derived by restriction from the
- * other type definition if the other type definition is the same as the
- * reference type definition, or if the other type definition can be
- * reached recursively following the {base type definition} property
- * from the reference type definition, and all the <em>derivation methods</em> involved are restriction.
- */
- public static final int DERIVATION_RESTRICTION = 0x00000001;
- /**
- * If the document's schema is an XML Schema [<a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/'>XML Schema Part 1</a>]
- * , this constant represents the derivation by <a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/#key-typeExtension'>
- * extension</a>.
- * <br> The reference type definition is derived by extension from the
- * other type definition if the other type definition can be reached
- * recursively following the {base type definition} property from the
- * reference type definition, and at least one of the <em>derivation methods</em> involved is an extension.
- */
- public static final int DERIVATION_EXTENSION = 0x00000002;
- /**
- * If the document's schema is an XML Schema [<a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/'>XML Schema Part 1</a>]
- * , this constant represents the <a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/#element-union'>
- * union</a> if simple types are involved.
- * <br> The reference type definition is derived by union from the other
- * type definition if there exists two type definitions T1 and T2 such
- * as the reference type definition is derived from T1 by
- * <code>DERIVATION_RESTRICTION</code> or
- * <code>DERIVATION_EXTENSION</code>, T2 is derived from the other type
- * definition by <code>DERIVATION_RESTRICTION</code>, T1 has {variety} <em>union</em>, and one of the {member type definitions} is T2. Note that T1 could be
- * the same as the reference type definition, and T2 could be the same
- * as the other type definition.
- */
- public static final int DERIVATION_UNION = 0x00000004;
- /**
- * If the document's schema is an XML Schema [<a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/'>XML Schema Part 1</a>]
- * , this constant represents the <a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/#element-list'>list</a>.
- * <br> The reference type definition is derived by list from the other
- * type definition if there exists two type definitions T1 and T2 such
- * as the reference type definition is derived from T1 by
- * <code>DERIVATION_RESTRICTION</code> or
- * <code>DERIVATION_EXTENSION</code>, T2 is derived from the other type
- * definition by <code>DERIVATION_RESTRICTION</code>, T1 has {variety} <em>list</em>, and T2 is the {item type definition}. Note that T1 could be the same as
- * the reference type definition, and T2 could be the same as the other
- * type definition.
- */
- public static final int DERIVATION_LIST = 0x00000008;
-
- /**
- * This method returns if there is a derivation between the reference
- * type definition, i.e. the <code>TypeInfo</code> on which the method
- * is being called, and the other type definition, i.e. the one passed
- * as parameters.
- * @param typeNamespaceArg the namespace of the other type definition.
- * @param typeNameArg the name of the other type definition.
- * @param derivationMethod the type of derivation and conditions applied
- * between two types, as described in the list of constants provided
- * in this interface.
- * @return If the document's schema is a DTD or no schema is associated
- * with the document, this method will always return <code>false</code>
- * . If the document's schema is an XML Schema, the method will return
- * <code>true</code> if the reference type definition is derived from
- * the other type definition according to the derivation parameter. If
- * the value of the parameter is <code>0</code> (no bit is set to
- * <code>1</code> for the <code>derivationMethod</code> parameter),
- * the method will return <code>true</code> if the other type
- * definition can be reached by recursing any combination of {base
- * type definition}, {item type definition}, or {member type
- * definitions} from the reference type definition.
- */
- public boolean isDerivedFrom(String typeNamespaceArg,
- String typeNameArg,
- int derivationMethod);
-
-}
diff --git a/src/org/w3c/dom/UserDataHandler.java b/src/org/w3c/dom/UserDataHandler.java
deleted file mode 100644
index a4ec6e8..0000000
--- a/src/org/w3c/dom/UserDataHandler.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] in the hope that
- * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * When associating an object to a key on a node using
- * <code>Node.setUserData()</code> the application can provide a handler
- * that gets called when the node the object is associated to is being
- * cloned, imported, or renamed. This can be used by the application to
- * implement various behaviors regarding the data it associates to the DOM
- * nodes. This interface defines that handler.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
- * @since DOM Level 3
- */
-public interface UserDataHandler {
- // OperationType
- /**
- * The node is cloned, using <code>Node.cloneNode()</code>.
- */
- public static final short NODE_CLONED = 1;
- /**
- * The node is imported, using <code>Document.importNode()</code>.
- */
- public static final short NODE_IMPORTED = 2;
- /**
- * The node is deleted.
- * <p ><b>Note:</b> This may not be supported or may not be reliable in
- * certain environments, such as Java, where the implementation has no
- * real control over when objects are actually deleted.
- */
- public static final short NODE_DELETED = 3;
- /**
- * The node is renamed, using <code>Document.renameNode()</code>.
- */
- public static final short NODE_RENAMED = 4;
- /**
- * The node is adopted, using <code>Document.adoptNode()</code>.
- */
- public static final short NODE_ADOPTED = 5;
-
- /**
- * This method is called whenever the node for which this handler is
- * registered is imported or cloned.
- * <br> DOM applications must not raise exceptions in a
- * <code>UserDataHandler</code>. The effect of throwing exceptions from
- * the handler is DOM implementation dependent.
- * @param operation Specifies the type of operation that is being
- * performed on the node.
- * @param key Specifies the key for which this handler is being called.
- * @param data Specifies the data for which this handler is being called.
- * @param src Specifies the node being cloned, adopted, imported, or
- * renamed. This is <code>null</code> when the node is being deleted.
- * @param dst Specifies the node newly created if any, or
- * <code>null</code>.
- */
- public void handle(short operation,
- String key,
- Object data,
- Node src,
- Node dst);
-
-}
diff --git a/src/org/w3c/dom/bootstrap/DOMImplementationRegistry.java b/src/org/w3c/dom/bootstrap/DOMImplementationRegistry.java
deleted file mode 100644
index cfeeeea..0000000
--- a/src/org/w3c/dom/bootstrap/DOMImplementationRegistry.java
+++ /dev/null
@@ -1,429 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] in the hope that
- * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-
-package org.w3c.dom.bootstrap;
-
-import java.util.StringTokenizer;
-import java.util.Vector;
-import org.w3c.dom.DOMImplementationSource;
-import org.w3c.dom.DOMImplementationList;
-import org.w3c.dom.DOMImplementation;
-import java.io.InputStream;
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-/**
- * A factory that enables applications to obtain instances of
- * <code>DOMImplementation</code>.
- *
- * <p>
- * Example:
- * </p>
- *
- * <pre class='example'>
- * // get an instance of the DOMImplementation registry
- * DOMImplementationRegistry registry =
- * DOMImplementationRegistry.newInstance();
- * // get a DOM implementation the Level 3 XML module
- * DOMImplementation domImpl =
- * registry.getDOMImplementation("XML 3.0");
- * </pre>
- *
- * <p>
- * This provides an application with an implementation-independent starting
- * point. DOM implementations may modify this class to meet new security
- * standards or to provide *additional* fallbacks for the list of
- * DOMImplementationSources.
- * </p>
- *
- * @see DOMImplementation
- * @see DOMImplementationSource
- * @since DOM Level 3
- */
-public final class DOMImplementationRegistry {
- /**
- * The system property to specify the
- * DOMImplementationSource class names.
- */
- public static final String PROPERTY =
- "org.w3c.dom.DOMImplementationSourceList";
-
- /**
- * Default columns per line.
- */
- private static final int DEFAULT_LINE_LENGTH = 80;
-
- /**
- * The list of DOMImplementationSources.
- */
- private Vector sources;
-
- /**
- * Default class name.
- */
- private static final String FALLBACK_CLASS =
- "com.sun.org.apache.xerces.internal.dom.DOMXSImplementationSourceImpl";
- private static final String DEFAULT_PACKAGE =
- "com.sun.org.apache.xerces.internal.dom";
- /**
- * Private constructor.
- * @param srcs Vector List of DOMImplementationSources
- */
- private DOMImplementationRegistry(final Vector srcs) {
- sources = srcs;
- }
-
- /**
- * Obtain a new instance of a <code>DOMImplementationRegistry</code>.
- *
-
- * The <code>DOMImplementationRegistry</code> is initialized by the
- * application or the implementation, depending on the context, by
- * first checking the value of the Java system property
- * <code>org.w3c.dom.DOMImplementationSourceList</code> and
- * the service provider whose contents are at
- * "<code>META_INF/services/org.w3c.dom.DOMImplementationSourceList</code>".
- * The value of this property is a white-space separated list of
- * names of availables classes implementing the
- * <code>DOMImplementationSource</code> interface. Each class listed
- * in the class name list is instantiated and any exceptions
- * encountered are thrown to the application.
- *
- * @return an initialized instance of DOMImplementationRegistry
- * @throws ClassNotFoundException
- * If any specified class can not be found
- * @throws InstantiationException
- * If any specified class is an interface or abstract class
- * @throws IllegalAccessException
- * If the default constructor of a specified class is not accessible
- * @throws ClassCastException
- * If any specified class does not implement
- * <code>DOMImplementationSource</code>
- */
- public static DOMImplementationRegistry newInstance()
- throws
- ClassNotFoundException,
- InstantiationException,
- IllegalAccessException,
- ClassCastException {
- Vector sources = new Vector();
-
- ClassLoader classLoader = getClassLoader();
- // fetch system property:
- String p = getSystemProperty(PROPERTY);
-
- //
- // if property is not specified then use contents of
- // META_INF/org.w3c.dom.DOMImplementationSourceList from classpath
- if (p == null) {
- p = getServiceValue(classLoader);
- }
- if (p == null) {
- //
- // DOM Implementations can modify here to add *additional* fallback
- // mechanisms to access a list of default DOMImplementationSources.
- //fall back to JAXP implementation class com.sun.org.apache.xerces.internal.dom.DOMXSImplementationSourceImpl
- p = FALLBACK_CLASS;
- }
- if (p != null) {
- StringTokenizer st = new StringTokenizer(p);
- while (st.hasMoreTokens()) {
- String sourceName = st.nextToken();
- // make sure we have access to restricted packages
- boolean internal = false;
- if (System.getSecurityManager() != null) {
- if (sourceName != null && sourceName.startsWith(DEFAULT_PACKAGE)) {
- internal = true;
- }
- }
- Class sourceClass = null;
- if (classLoader != null && !internal) {
- sourceClass = classLoader.loadClass(sourceName);
- } else {
- sourceClass = Class.forName(sourceName);
- }
- DOMImplementationSource source =
- (DOMImplementationSource) sourceClass.newInstance();
- sources.addElement(source);
- }
- }
- return new DOMImplementationRegistry(sources);
- }
-
- /**
- * Return the first implementation that has the desired
- * features, or <code>null</code> if none is found.
- *
- * @param features
- * A string that specifies which features are required. This is
- * a space separated list in which each feature is specified by
- * its name optionally followed by a space and a version number.
- * This is something like: "XML 1.0 Traversal +Events 2.0"
- * @return An implementation that has the desired features,
- * or <code>null</code> if none found.
- */
- public DOMImplementation getDOMImplementation(final String features) {
- int size = sources.size();
- String name = null;
- for (int i = 0; i < size; i++) {
- DOMImplementationSource source =
- (DOMImplementationSource) sources.elementAt(i);
- DOMImplementation impl = source.getDOMImplementation(features);
- if (impl != null) {
- return impl;
- }
- }
- return null;
- }
-
- /**
- * Return a list of implementations that support the
- * desired features.
- *
- * @param features
- * A string that specifies which features are required. This is
- * a space separated list in which each feature is specified by
- * its name optionally followed by a space and a version number.
- * This is something like: "XML 1.0 Traversal +Events 2.0"
- * @return A list of DOMImplementations that support the desired features.
- */
- public DOMImplementationList getDOMImplementationList(final String features) {
- final Vector implementations = new Vector();
- int size = sources.size();
- for (int i = 0; i < size; i++) {
- DOMImplementationSource source =
- (DOMImplementationSource) sources.elementAt(i);
- DOMImplementationList impls =
- source.getDOMImplementationList(features);
- for (int j = 0; j < impls.getLength(); j++) {
- DOMImplementation impl = impls.item(j);
- implementations.addElement(impl);
- }
- }
- return new DOMImplementationList() {
- public DOMImplementation item(final int index) {
- if (index >= 0 && index < implementations.size()) {
- try {
- return (DOMImplementation)
- implementations.elementAt(index);
- } catch (ArrayIndexOutOfBoundsException e) {
- return null;
- }
- }
- return null;
- }
-
- public int getLength() {
- return implementations.size();
- }
- };
- }
-
- /**
- * Register an implementation.
- *
- * @param s The source to be registered, may not be <code>null</code>
- */
- public void addSource(final DOMImplementationSource s) {
- if (s == null) {
- throw new NullPointerException();
- }
- if (!sources.contains(s)) {
- sources.addElement(s);
- }
- }
-
- /**
- *
- * Gets a class loader.
- *
- * @return A class loader, possibly <code>null</code>
- */
- private static ClassLoader getClassLoader() {
- try {
- ClassLoader contextClassLoader = getContextClassLoader();
-
- if (contextClassLoader != null) {
- return contextClassLoader;
- }
- } catch (Exception e) {
- // Assume that the DOM application is in a JRE 1.1, use the
- // current ClassLoader
- return DOMImplementationRegistry.class.getClassLoader();
- }
- return DOMImplementationRegistry.class.getClassLoader();
- }
-
- /**
- * This method attempts to return the first line of the resource
- * META_INF/services/org.w3c.dom.DOMImplementationSourceList
- * from the provided ClassLoader.
- *
- * @param classLoader classLoader, may not be <code>null</code>.
- * @return first line of resource, or <code>null</code>
- */
- private static String getServiceValue(final ClassLoader classLoader) {
- String serviceId = "META-INF/services/" + PROPERTY;
- // try to find services in CLASSPATH
- try {
- InputStream is = getResourceAsStream(classLoader, serviceId);
-
- if (is != null) {
- BufferedReader rd;
- try {
- rd =
- new BufferedReader(new InputStreamReader(is, "UTF-8"),
- DEFAULT_LINE_LENGTH);
- } catch (java.io.UnsupportedEncodingException e) {
- rd =
- new BufferedReader(new InputStreamReader(is),
- DEFAULT_LINE_LENGTH);
- }
- String serviceValue = rd.readLine();
- rd.close();
- if (serviceValue != null && serviceValue.length() > 0) {
- return serviceValue;
- }
- }
- } catch (Exception ex) {
- return null;
- }
- return null;
- }
-
- /**
- * A simple JRE (Java Runtime Environment) 1.1 test
- *
- * @return <code>true</code> if JRE 1.1
- */
- private static boolean isJRE11() {
- try {
- Class c = Class.forName("java.security.AccessController");
- // java.security.AccessController existed since 1.2 so, if no
- // exception was thrown, the DOM application is running in a JRE
- // 1.2 or higher
- return false;
- } catch (Exception ex) {
- // ignore
- }
- return true;
- }
-
- /**
- * This method returns the ContextClassLoader or <code>null</code> if
- * running in a JRE 1.1
- *
- * @return The Context Classloader
- */
- private static ClassLoader getContextClassLoader() {
- return isJRE11()
- ? null
- : (ClassLoader)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- ClassLoader classLoader = null;
- try {
- classLoader =
- Thread.currentThread().getContextClassLoader();
- } catch (SecurityException ex) {
- }
- return classLoader;
- }
- });
- }
-
- /**
- * This method returns the system property indicated by the specified name
- * after checking access control privileges. For a JRE 1.1, this check is
- * not done.
- *
- * @param name the name of the system property
- * @return the system property
- */
- private static String getSystemProperty(final String name) {
- return isJRE11()
- ? (String) System.getProperty(name)
- : (String) AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return System.getProperty(name);
- }
- });
- }
-
- /**
- * This method returns an Inputstream for the reading resource
- * META_INF/services/org.w3c.dom.DOMImplementationSourceList after checking
- * access control privileges. For a JRE 1.1, this check is not done.
- *
- * @param classLoader classLoader
- * @param name the resource
- * @return an Inputstream for the resource specified
- */
- private static InputStream getResourceAsStream(final ClassLoader classLoader,
- final String name) {
- if (isJRE11()) {
- InputStream ris;
- if (classLoader == null) {
- ris = ClassLoader.getSystemResourceAsStream(name);
- } else {
- ris = classLoader.getResourceAsStream(name);
- }
- return ris;
- } else {
- return (InputStream)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- InputStream ris;
- if (classLoader == null) {
- ris =
- ClassLoader.getSystemResourceAsStream(name);
- } else {
- ris = classLoader.getResourceAsStream(name);
- }
- return ris;
- }
- });
- }
- }
-}
diff --git a/src/org/w3c/dom/css/CSS2Properties.java b/src/org/w3c/dom/css/CSS2Properties.java
deleted file mode 100644
index d22de1d..0000000
--- a/src/org/w3c/dom/css/CSS2Properties.java
+++ /dev/null
@@ -1,1806 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.css;
-
-import org.w3c.dom.DOMException;
-
-/**
- * The <code>CSS2Properties</code> interface represents a convenience
- * mechanism for retrieving and setting properties within a
- * <code>CSSStyleDeclaration</code>. The attributes of this interface
- * correspond to all the properties specified in CSS2. Getting an attribute
- * of this interface is equivalent to calling the
- * <code>getPropertyValue</code> method of the
- * <code>CSSStyleDeclaration</code> interface. Setting an attribute of this
- * interface is equivalent to calling the <code>setProperty</code> method of
- * the <code>CSSStyleDeclaration</code> interface.
- * <p> A conformant implementation of the CSS module is not required to
- * implement the <code>CSS2Properties</code> interface. If an implementation
- * does implement this interface, the expectation is that language-specific
- * methods can be used to cast from an instance of the
- * <code>CSSStyleDeclaration</code> interface to the
- * <code>CSS2Properties</code> interface.
- * <p> If an implementation does implement this interface, it is expected to
- * understand the specific syntax of the shorthand properties, and apply
- * their semantics; when the <code>margin</code> property is set, for
- * example, the <code>marginTop</code>, <code>marginRight</code>,
- * <code>marginBottom</code> and <code>marginLeft</code> properties are
- * actually being set by the underlying implementation.
- * <p> When dealing with CSS "shorthand" properties, the shorthand properties
- * should be decomposed into their component longhand properties as
- * appropriate, and when querying for their value, the form returned should
- * be the shortest form exactly equivalent to the declarations made in the
- * ruleset. However, if there is no shorthand declaration that could be
- * added to the ruleset without changing in any way the rules already
- * declared in the ruleset (i.e., by adding longhand rules that were
- * previously not declared in the ruleset), then the empty string should be
- * returned for the shorthand property.
- * <p> For example, querying for the <code>font</code> property should not
- * return "normal normal normal 14pt/normal Arial, sans-serif", when "14pt
- * Arial, sans-serif" suffices. (The normals are initial values, and are
- * implied by use of the longhand property.)
- * <p> If the values for all the longhand properties that compose a particular
- * string are the initial values, then a string consisting of all the
- * initial values should be returned (e.g. a <code>border-width</code> value
- * of "medium" should be returned as such, not as "").
- * <p> For some shorthand properties that take missing values from other
- * sides, such as the <code>margin</code>, <code>padding</code>, and
- * <code>border-[width|style|color]</code> properties, the minimum number of
- * sides possible should be used; i.e., "0px 10px" will be returned instead
- * of "0px 10px 0px 10px".
- * <p> If the value of a shorthand property can not be decomposed into its
- * component longhand properties, as is the case for the <code>font</code>
- * property with a value of "menu", querying for the values of the component
- * longhand properties should return the empty string.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface CSS2Properties {
- /**
- * See the azimuth property definition in CSS2.
- */
- public String getAzimuth();
- /**
- * See the azimuth property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setAzimuth(String azimuth)
- throws DOMException;
-
- /**
- * See the background property definition in CSS2.
- */
- public String getBackground();
- /**
- * See the background property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBackground(String background)
- throws DOMException;
-
- /**
- * See the background-attachment property definition in CSS2.
- */
- public String getBackgroundAttachment();
- /**
- * See the background-attachment property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBackgroundAttachment(String backgroundAttachment)
- throws DOMException;
-
- /**
- * See the background-color property definition in CSS2.
- */
- public String getBackgroundColor();
- /**
- * See the background-color property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBackgroundColor(String backgroundColor)
- throws DOMException;
-
- /**
- * See the background-image property definition in CSS2.
- */
- public String getBackgroundImage();
- /**
- * See the background-image property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBackgroundImage(String backgroundImage)
- throws DOMException;
-
- /**
- * See the background-position property definition in CSS2.
- */
- public String getBackgroundPosition();
- /**
- * See the background-position property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBackgroundPosition(String backgroundPosition)
- throws DOMException;
-
- /**
- * See the background-repeat property definition in CSS2.
- */
- public String getBackgroundRepeat();
- /**
- * See the background-repeat property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBackgroundRepeat(String backgroundRepeat)
- throws DOMException;
-
- /**
- * See the border property definition in CSS2.
- */
- public String getBorder();
- /**
- * See the border property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBorder(String border)
- throws DOMException;
-
- /**
- * See the border-collapse property definition in CSS2.
- */
- public String getBorderCollapse();
- /**
- * See the border-collapse property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBorderCollapse(String borderCollapse)
- throws DOMException;
-
- /**
- * See the border-color property definition in CSS2.
- */
- public String getBorderColor();
- /**
- * See the border-color property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBorderColor(String borderColor)
- throws DOMException;
-
- /**
- * See the border-spacing property definition in CSS2.
- */
- public String getBorderSpacing();
- /**
- * See the border-spacing property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBorderSpacing(String borderSpacing)
- throws DOMException;
-
- /**
- * See the border-style property definition in CSS2.
- */
- public String getBorderStyle();
- /**
- * See the border-style property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBorderStyle(String borderStyle)
- throws DOMException;
-
- /**
- * See the border-top property definition in CSS2.
- */
- public String getBorderTop();
- /**
- * See the border-top property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBorderTop(String borderTop)
- throws DOMException;
-
- /**
- * See the border-right property definition in CSS2.
- */
- public String getBorderRight();
- /**
- * See the border-right property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBorderRight(String borderRight)
- throws DOMException;
-
- /**
- * See the border-bottom property definition in CSS2.
- */
- public String getBorderBottom();
- /**
- * See the border-bottom property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBorderBottom(String borderBottom)
- throws DOMException;
-
- /**
- * See the border-left property definition in CSS2.
- */
- public String getBorderLeft();
- /**
- * See the border-left property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBorderLeft(String borderLeft)
- throws DOMException;
-
- /**
- * See the border-top-color property definition in CSS2.
- */
- public String getBorderTopColor();
- /**
- * See the border-top-color property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBorderTopColor(String borderTopColor)
- throws DOMException;
-
- /**
- * See the border-right-color property definition in CSS2.
- */
- public String getBorderRightColor();
- /**
- * See the border-right-color property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBorderRightColor(String borderRightColor)
- throws DOMException;
-
- /**
- * See the border-bottom-color property definition in CSS2.
- */
- public String getBorderBottomColor();
- /**
- * See the border-bottom-color property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBorderBottomColor(String borderBottomColor)
- throws DOMException;
-
- /**
- * See the border-left-color property definition in CSS2.
- */
- public String getBorderLeftColor();
- /**
- * See the border-left-color property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBorderLeftColor(String borderLeftColor)
- throws DOMException;
-
- /**
- * See the border-top-style property definition in CSS2.
- */
- public String getBorderTopStyle();
- /**
- * See the border-top-style property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBorderTopStyle(String borderTopStyle)
- throws DOMException;
-
- /**
- * See the border-right-style property definition in CSS2.
- */
- public String getBorderRightStyle();
- /**
- * See the border-right-style property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBorderRightStyle(String borderRightStyle)
- throws DOMException;
-
- /**
- * See the border-bottom-style property definition in CSS2.
- */
- public String getBorderBottomStyle();
- /**
- * See the border-bottom-style property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBorderBottomStyle(String borderBottomStyle)
- throws DOMException;
-
- /**
- * See the border-left-style property definition in CSS2.
- */
- public String getBorderLeftStyle();
- /**
- * See the border-left-style property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBorderLeftStyle(String borderLeftStyle)
- throws DOMException;
-
- /**
- * See the border-top-width property definition in CSS2.
- */
- public String getBorderTopWidth();
- /**
- * See the border-top-width property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBorderTopWidth(String borderTopWidth)
- throws DOMException;
-
- /**
- * See the border-right-width property definition in CSS2.
- */
- public String getBorderRightWidth();
- /**
- * See the border-right-width property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBorderRightWidth(String borderRightWidth)
- throws DOMException;
-
- /**
- * See the border-bottom-width property definition in CSS2.
- */
- public String getBorderBottomWidth();
- /**
- * See the border-bottom-width property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBorderBottomWidth(String borderBottomWidth)
- throws DOMException;
-
- /**
- * See the border-left-width property definition in CSS2.
- */
- public String getBorderLeftWidth();
- /**
- * See the border-left-width property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBorderLeftWidth(String borderLeftWidth)
- throws DOMException;
-
- /**
- * See the border-width property definition in CSS2.
- */
- public String getBorderWidth();
- /**
- * See the border-width property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBorderWidth(String borderWidth)
- throws DOMException;
-
- /**
- * See the bottom property definition in CSS2.
- */
- public String getBottom();
- /**
- * See the bottom property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setBottom(String bottom)
- throws DOMException;
-
- /**
- * See the caption-side property definition in CSS2.
- */
- public String getCaptionSide();
- /**
- * See the caption-side property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setCaptionSide(String captionSide)
- throws DOMException;
-
- /**
- * See the clear property definition in CSS2.
- */
- public String getClear();
- /**
- * See the clear property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setClear(String clear)
- throws DOMException;
-
- /**
- * See the clip property definition in CSS2.
- */
- public String getClip();
- /**
- * See the clip property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setClip(String clip)
- throws DOMException;
-
- /**
- * See the color property definition in CSS2.
- */
- public String getColor();
- /**
- * See the color property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setColor(String color)
- throws DOMException;
-
- /**
- * See the content property definition in CSS2.
- */
- public String getContent();
- /**
- * See the content property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setContent(String content)
- throws DOMException;
-
- /**
- * See the counter-increment property definition in CSS2.
- */
- public String getCounterIncrement();
- /**
- * See the counter-increment property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setCounterIncrement(String counterIncrement)
- throws DOMException;
-
- /**
- * See the counter-reset property definition in CSS2.
- */
- public String getCounterReset();
- /**
- * See the counter-reset property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setCounterReset(String counterReset)
- throws DOMException;
-
- /**
- * See the cue property definition in CSS2.
- */
- public String getCue();
- /**
- * See the cue property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setCue(String cue)
- throws DOMException;
-
- /**
- * See the cue-after property definition in CSS2.
- */
- public String getCueAfter();
- /**
- * See the cue-after property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setCueAfter(String cueAfter)
- throws DOMException;
-
- /**
- * See the cue-before property definition in CSS2.
- */
- public String getCueBefore();
- /**
- * See the cue-before property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setCueBefore(String cueBefore)
- throws DOMException;
-
- /**
- * See the cursor property definition in CSS2.
- */
- public String getCursor();
- /**
- * See the cursor property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setCursor(String cursor)
- throws DOMException;
-
- /**
- * See the direction property definition in CSS2.
- */
- public String getDirection();
- /**
- * See the direction property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setDirection(String direction)
- throws DOMException;
-
- /**
- * See the display property definition in CSS2.
- */
- public String getDisplay();
- /**
- * See the display property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setDisplay(String display)
- throws DOMException;
-
- /**
- * See the elevation property definition in CSS2.
- */
- public String getElevation();
- /**
- * See the elevation property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setElevation(String elevation)
- throws DOMException;
-
- /**
- * See the empty-cells property definition in CSS2.
- */
- public String getEmptyCells();
- /**
- * See the empty-cells property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setEmptyCells(String emptyCells)
- throws DOMException;
-
- /**
- * See the float property definition in CSS2.
- */
- public String getCssFloat();
- /**
- * See the float property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setCssFloat(String cssFloat)
- throws DOMException;
-
- /**
- * See the font property definition in CSS2.
- */
- public String getFont();
- /**
- * See the font property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setFont(String font)
- throws DOMException;
-
- /**
- * See the font-family property definition in CSS2.
- */
- public String getFontFamily();
- /**
- * See the font-family property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setFontFamily(String fontFamily)
- throws DOMException;
-
- /**
- * See the font-size property definition in CSS2.
- */
- public String getFontSize();
- /**
- * See the font-size property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setFontSize(String fontSize)
- throws DOMException;
-
- /**
- * See the font-size-adjust property definition in CSS2.
- */
- public String getFontSizeAdjust();
- /**
- * See the font-size-adjust property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setFontSizeAdjust(String fontSizeAdjust)
- throws DOMException;
-
- /**
- * See the font-stretch property definition in CSS2.
- */
- public String getFontStretch();
- /**
- * See the font-stretch property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setFontStretch(String fontStretch)
- throws DOMException;
-
- /**
- * See the font-style property definition in CSS2.
- */
- public String getFontStyle();
- /**
- * See the font-style property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setFontStyle(String fontStyle)
- throws DOMException;
-
- /**
- * See the font-variant property definition in CSS2.
- */
- public String getFontVariant();
- /**
- * See the font-variant property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setFontVariant(String fontVariant)
- throws DOMException;
-
- /**
- * See the font-weight property definition in CSS2.
- */
- public String getFontWeight();
- /**
- * See the font-weight property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setFontWeight(String fontWeight)
- throws DOMException;
-
- /**
- * See the height property definition in CSS2.
- */
- public String getHeight();
- /**
- * See the height property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setHeight(String height)
- throws DOMException;
-
- /**
- * See the left property definition in CSS2.
- */
- public String getLeft();
- /**
- * See the left property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setLeft(String left)
- throws DOMException;
-
- /**
- * See the letter-spacing property definition in CSS2.
- */
- public String getLetterSpacing();
- /**
- * See the letter-spacing property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setLetterSpacing(String letterSpacing)
- throws DOMException;
-
- /**
- * See the line-height property definition in CSS2.
- */
- public String getLineHeight();
- /**
- * See the line-height property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setLineHeight(String lineHeight)
- throws DOMException;
-
- /**
- * See the list-style property definition in CSS2.
- */
- public String getListStyle();
- /**
- * See the list-style property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setListStyle(String listStyle)
- throws DOMException;
-
- /**
- * See the list-style-image property definition in CSS2.
- */
- public String getListStyleImage();
- /**
- * See the list-style-image property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setListStyleImage(String listStyleImage)
- throws DOMException;
-
- /**
- * See the list-style-position property definition in CSS2.
- */
- public String getListStylePosition();
- /**
- * See the list-style-position property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setListStylePosition(String listStylePosition)
- throws DOMException;
-
- /**
- * See the list-style-type property definition in CSS2.
- */
- public String getListStyleType();
- /**
- * See the list-style-type property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setListStyleType(String listStyleType)
- throws DOMException;
-
- /**
- * See the margin property definition in CSS2.
- */
- public String getMargin();
- /**
- * See the margin property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setMargin(String margin)
- throws DOMException;
-
- /**
- * See the margin-top property definition in CSS2.
- */
- public String getMarginTop();
- /**
- * See the margin-top property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setMarginTop(String marginTop)
- throws DOMException;
-
- /**
- * See the margin-right property definition in CSS2.
- */
- public String getMarginRight();
- /**
- * See the margin-right property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setMarginRight(String marginRight)
- throws DOMException;
-
- /**
- * See the margin-bottom property definition in CSS2.
- */
- public String getMarginBottom();
- /**
- * See the margin-bottom property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setMarginBottom(String marginBottom)
- throws DOMException;
-
- /**
- * See the margin-left property definition in CSS2.
- */
- public String getMarginLeft();
- /**
- * See the margin-left property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setMarginLeft(String marginLeft)
- throws DOMException;
-
- /**
- * See the marker-offset property definition in CSS2.
- */
- public String getMarkerOffset();
- /**
- * See the marker-offset property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setMarkerOffset(String markerOffset)
- throws DOMException;
-
- /**
- * See the marks property definition in CSS2.
- */
- public String getMarks();
- /**
- * See the marks property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setMarks(String marks)
- throws DOMException;
-
- /**
- * See the max-height property definition in CSS2.
- */
- public String getMaxHeight();
- /**
- * See the max-height property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setMaxHeight(String maxHeight)
- throws DOMException;
-
- /**
- * See the max-width property definition in CSS2.
- */
- public String getMaxWidth();
- /**
- * See the max-width property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setMaxWidth(String maxWidth)
- throws DOMException;
-
- /**
- * See the min-height property definition in CSS2.
- */
- public String getMinHeight();
- /**
- * See the min-height property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setMinHeight(String minHeight)
- throws DOMException;
-
- /**
- * See the min-width property definition in CSS2.
- */
- public String getMinWidth();
- /**
- * See the min-width property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setMinWidth(String minWidth)
- throws DOMException;
-
- /**
- * See the orphans property definition in CSS2.
- */
- public String getOrphans();
- /**
- * See the orphans property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setOrphans(String orphans)
- throws DOMException;
-
- /**
- * See the outline property definition in CSS2.
- */
- public String getOutline();
- /**
- * See the outline property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setOutline(String outline)
- throws DOMException;
-
- /**
- * See the outline-color property definition in CSS2.
- */
- public String getOutlineColor();
- /**
- * See the outline-color property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setOutlineColor(String outlineColor)
- throws DOMException;
-
- /**
- * See the outline-style property definition in CSS2.
- */
- public String getOutlineStyle();
- /**
- * See the outline-style property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setOutlineStyle(String outlineStyle)
- throws DOMException;
-
- /**
- * See the outline-width property definition in CSS2.
- */
- public String getOutlineWidth();
- /**
- * See the outline-width property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setOutlineWidth(String outlineWidth)
- throws DOMException;
-
- /**
- * See the overflow property definition in CSS2.
- */
- public String getOverflow();
- /**
- * See the overflow property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setOverflow(String overflow)
- throws DOMException;
-
- /**
- * See the padding property definition in CSS2.
- */
- public String getPadding();
- /**
- * See the padding property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setPadding(String padding)
- throws DOMException;
-
- /**
- * See the padding-top property definition in CSS2.
- */
- public String getPaddingTop();
- /**
- * See the padding-top property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setPaddingTop(String paddingTop)
- throws DOMException;
-
- /**
- * See the padding-right property definition in CSS2.
- */
- public String getPaddingRight();
- /**
- * See the padding-right property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setPaddingRight(String paddingRight)
- throws DOMException;
-
- /**
- * See the padding-bottom property definition in CSS2.
- */
- public String getPaddingBottom();
- /**
- * See the padding-bottom property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setPaddingBottom(String paddingBottom)
- throws DOMException;
-
- /**
- * See the padding-left property definition in CSS2.
- */
- public String getPaddingLeft();
- /**
- * See the padding-left property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setPaddingLeft(String paddingLeft)
- throws DOMException;
-
- /**
- * See the page property definition in CSS2.
- */
- public String getPage();
- /**
- * See the page property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setPage(String page)
- throws DOMException;
-
- /**
- * See the page-break-after property definition in CSS2.
- */
- public String getPageBreakAfter();
- /**
- * See the page-break-after property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setPageBreakAfter(String pageBreakAfter)
- throws DOMException;
-
- /**
- * See the page-break-before property definition in CSS2.
- */
- public String getPageBreakBefore();
- /**
- * See the page-break-before property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setPageBreakBefore(String pageBreakBefore)
- throws DOMException;
-
- /**
- * See the page-break-inside property definition in CSS2.
- */
- public String getPageBreakInside();
- /**
- * See the page-break-inside property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setPageBreakInside(String pageBreakInside)
- throws DOMException;
-
- /**
- * See the pause property definition in CSS2.
- */
- public String getPause();
- /**
- * See the pause property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setPause(String pause)
- throws DOMException;
-
- /**
- * See the pause-after property definition in CSS2.
- */
- public String getPauseAfter();
- /**
- * See the pause-after property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setPauseAfter(String pauseAfter)
- throws DOMException;
-
- /**
- * See the pause-before property definition in CSS2.
- */
- public String getPauseBefore();
- /**
- * See the pause-before property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setPauseBefore(String pauseBefore)
- throws DOMException;
-
- /**
- * See the pitch property definition in CSS2.
- */
- public String getPitch();
- /**
- * See the pitch property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setPitch(String pitch)
- throws DOMException;
-
- /**
- * See the pitch-range property definition in CSS2.
- */
- public String getPitchRange();
- /**
- * See the pitch-range property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setPitchRange(String pitchRange)
- throws DOMException;
-
- /**
- * See the play-during property definition in CSS2.
- */
- public String getPlayDuring();
- /**
- * See the play-during property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setPlayDuring(String playDuring)
- throws DOMException;
-
- /**
- * See the position property definition in CSS2.
- */
- public String getPosition();
- /**
- * See the position property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setPosition(String position)
- throws DOMException;
-
- /**
- * See the quotes property definition in CSS2.
- */
- public String getQuotes();
- /**
- * See the quotes property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setQuotes(String quotes)
- throws DOMException;
-
- /**
- * See the richness property definition in CSS2.
- */
- public String getRichness();
- /**
- * See the richness property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setRichness(String richness)
- throws DOMException;
-
- /**
- * See the right property definition in CSS2.
- */
- public String getRight();
- /**
- * See the right property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setRight(String right)
- throws DOMException;
-
- /**
- * See the size property definition in CSS2.
- */
- public String getSize();
- /**
- * See the size property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setSize(String size)
- throws DOMException;
-
- /**
- * See the speak property definition in CSS2.
- */
- public String getSpeak();
- /**
- * See the speak property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setSpeak(String speak)
- throws DOMException;
-
- /**
- * See the speak-header property definition in CSS2.
- */
- public String getSpeakHeader();
- /**
- * See the speak-header property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setSpeakHeader(String speakHeader)
- throws DOMException;
-
- /**
- * See the speak-numeral property definition in CSS2.
- */
- public String getSpeakNumeral();
- /**
- * See the speak-numeral property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setSpeakNumeral(String speakNumeral)
- throws DOMException;
-
- /**
- * See the speak-punctuation property definition in CSS2.
- */
- public String getSpeakPunctuation();
- /**
- * See the speak-punctuation property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setSpeakPunctuation(String speakPunctuation)
- throws DOMException;
-
- /**
- * See the speech-rate property definition in CSS2.
- */
- public String getSpeechRate();
- /**
- * See the speech-rate property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setSpeechRate(String speechRate)
- throws DOMException;
-
- /**
- * See the stress property definition in CSS2.
- */
- public String getStress();
- /**
- * See the stress property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setStress(String stress)
- throws DOMException;
-
- /**
- * See the table-layout property definition in CSS2.
- */
- public String getTableLayout();
- /**
- * See the table-layout property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setTableLayout(String tableLayout)
- throws DOMException;
-
- /**
- * See the text-align property definition in CSS2.
- */
- public String getTextAlign();
- /**
- * See the text-align property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setTextAlign(String textAlign)
- throws DOMException;
-
- /**
- * See the text-decoration property definition in CSS2.
- */
- public String getTextDecoration();
- /**
- * See the text-decoration property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setTextDecoration(String textDecoration)
- throws DOMException;
-
- /**
- * See the text-indent property definition in CSS2.
- */
- public String getTextIndent();
- /**
- * See the text-indent property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setTextIndent(String textIndent)
- throws DOMException;
-
- /**
- * See the text-shadow property definition in CSS2.
- */
- public String getTextShadow();
- /**
- * See the text-shadow property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setTextShadow(String textShadow)
- throws DOMException;
-
- /**
- * See the text-transform property definition in CSS2.
- */
- public String getTextTransform();
- /**
- * See the text-transform property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setTextTransform(String textTransform)
- throws DOMException;
-
- /**
- * See the top property definition in CSS2.
- */
- public String getTop();
- /**
- * See the top property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setTop(String top)
- throws DOMException;
-
- /**
- * See the unicode-bidi property definition in CSS2.
- */
- public String getUnicodeBidi();
- /**
- * See the unicode-bidi property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setUnicodeBidi(String unicodeBidi)
- throws DOMException;
-
- /**
- * See the vertical-align property definition in CSS2.
- */
- public String getVerticalAlign();
- /**
- * See the vertical-align property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setVerticalAlign(String verticalAlign)
- throws DOMException;
-
- /**
- * See the visibility property definition in CSS2.
- */
- public String getVisibility();
- /**
- * See the visibility property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setVisibility(String visibility)
- throws DOMException;
-
- /**
- * See the voice-family property definition in CSS2.
- */
- public String getVoiceFamily();
- /**
- * See the voice-family property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setVoiceFamily(String voiceFamily)
- throws DOMException;
-
- /**
- * See the volume property definition in CSS2.
- */
- public String getVolume();
- /**
- * See the volume property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setVolume(String volume)
- throws DOMException;
-
- /**
- * See the white-space property definition in CSS2.
- */
- public String getWhiteSpace();
- /**
- * See the white-space property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setWhiteSpace(String whiteSpace)
- throws DOMException;
-
- /**
- * See the widows property definition in CSS2.
- */
- public String getWidows();
- /**
- * See the widows property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setWidows(String widows)
- throws DOMException;
-
- /**
- * See the width property definition in CSS2.
- */
- public String getWidth();
- /**
- * See the width property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setWidth(String width)
- throws DOMException;
-
- /**
- * See the word-spacing property definition in CSS2.
- */
- public String getWordSpacing();
- /**
- * See the word-spacing property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setWordSpacing(String wordSpacing)
- throws DOMException;
-
- /**
- * See the z-index property definition in CSS2.
- */
- public String getZIndex();
- /**
- * See the z-index property definition in CSS2.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the new value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setZIndex(String zIndex)
- throws DOMException;
-
-}
diff --git a/src/org/w3c/dom/css/CSSCharsetRule.java b/src/org/w3c/dom/css/CSSCharsetRule.java
deleted file mode 100644
index 10a64ab..0000000
--- a/src/org/w3c/dom/css/CSSCharsetRule.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.css;
-
-import org.w3c.dom.DOMException;
-
-/**
- * The <code>CSSCharsetRule</code> interface represents a @charset rule in a
- * CSS style sheet. The value of the <code>encoding</code> attribute does
- * not affect the encoding of text data in the DOM objects; this encoding is
- * always UTF-16. After a stylesheet is loaded, the value of the
- * <code>encoding</code> attribute is the value found in the
- * <code>@charset</code> rule. If there was no <code>@charset</code> in the
- * original document, then no <code>CSSCharsetRule</code> is created. The
- * value of the <code>encoding</code> attribute may also be used as a hint
- * for the encoding used on serialization of the style sheet.
- * <p> The value of the @charset rule (and therefore of the
- * <code>CSSCharsetRule</code>) may not correspond to the encoding the
- * document actually came in; character encoding information e.g. in an HTTP
- * header, has priority (see CSS document representation) but this is not
- * reflected in the <code>CSSCharsetRule</code>.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface CSSCharsetRule extends CSSRule {
- /**
- * The encoding information used in this <code>@charset</code> rule.
- */
- public String getEncoding();
- /**
- * The encoding information used in this <code>@charset</code> rule.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the specified encoding value has a syntax error
- * and is unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this encoding rule is
- * readonly.
- */
- public void setEncoding(String encoding)
- throws DOMException;
-
-}
diff --git a/src/org/w3c/dom/css/CSSFontFaceRule.java b/src/org/w3c/dom/css/CSSFontFaceRule.java
deleted file mode 100644
index b4f6892..0000000
--- a/src/org/w3c/dom/css/CSSFontFaceRule.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.css;
-
-/**
- * The <code>CSSFontFaceRule</code> interface represents a @font-face rule in
- * a CSS style sheet. The <code>@font-face</code> rule is used to hold a set
- * of font descriptions.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface CSSFontFaceRule extends CSSRule {
- /**
- * The declaration-block of this rule.
- */
- public CSSStyleDeclaration getStyle();
-
-}
diff --git a/src/org/w3c/dom/css/CSSImportRule.java b/src/org/w3c/dom/css/CSSImportRule.java
deleted file mode 100644
index a9d321a..0000000
--- a/src/org/w3c/dom/css/CSSImportRule.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.css;
-
-import org.w3c.dom.stylesheets.MediaList;
-
-/**
- * The <code>CSSImportRule</code> interface represents a @import rule within
- * a CSS style sheet. The <code>@import</code> rule is used to import style
- * rules from other style sheets.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface CSSImportRule extends CSSRule {
- /**
- * The location of the style sheet to be imported. The attribute will not
- * contain the <code>"url(...)"</code> specifier around the URI.
- */
- public String getHref();
-
- /**
- * A list of media types for which this style sheet may be used.
- */
- public MediaList getMedia();
-
- /**
- * The style sheet referred to by this rule, if it has been loaded. The
- * value of this attribute is <code>null</code> if the style sheet has
- * not yet been loaded or if it will not be loaded (e.g. if the style
- * sheet is for a media type not supported by the user agent).
- */
- public CSSStyleSheet getStyleSheet();
-
-}
diff --git a/src/org/w3c/dom/css/CSSMediaRule.java b/src/org/w3c/dom/css/CSSMediaRule.java
deleted file mode 100644
index bf153d9..0000000
--- a/src/org/w3c/dom/css/CSSMediaRule.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.css;
-
-import org.w3c.dom.DOMException;
-import org.w3c.dom.stylesheets.MediaList;
-
-/**
- * The <code>CSSMediaRule</code> interface represents a @media rule in a CSS
- * style sheet. A <code>@media</code> rule can be used to delimit style
- * rules for specific media types.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface CSSMediaRule extends CSSRule {
- /**
- * A list of media types for this rule.
- */
- public MediaList getMedia();
-
- /**
- * A list of all CSS rules contained within the media block.
- */
- public CSSRuleList getCssRules();
-
- /**
- * Used to insert a new rule into the media block.
- * @param rule The parsable text representing the rule. For rule sets
- * this contains both the selector and the style declaration. For
- * at-rules, this specifies both the at-identifier and the rule
- * content.
- * @param index The index within the media block's rule collection of
- * the rule before which to insert the specified rule. If the
- * specified index is equal to the length of the media blocks's rule
- * collection, the rule will be added to the end of the media block.
- * @return The index within the media block's rule collection of the
- * newly inserted rule.
- * @exception DOMException
- * HIERARCHY_REQUEST_ERR: Raised if the rule cannot be inserted at the
- * specified index, e.g., if an <code>@import</code> rule is inserted
- * after a standard rule set or other at-rule.
- * <br>INDEX_SIZE_ERR: Raised if the specified index is not a valid
- * insertion point.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this media rule is
- * readonly.
- * <br>SYNTAX_ERR: Raised if the specified rule has a syntax error and
- * is unparsable.
- */
- public int insertRule(String rule,
- int index)
- throws DOMException;
-
- /**
- * Used to delete a rule from the media block.
- * @param index The index within the media block's rule collection of
- * the rule to remove.
- * @exception DOMException
- * INDEX_SIZE_ERR: Raised if the specified index does not correspond to
- * a rule in the media rule list.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this media rule is
- * readonly.
- */
- public void deleteRule(int index)
- throws DOMException;
-
-}
diff --git a/src/org/w3c/dom/css/CSSPageRule.java b/src/org/w3c/dom/css/CSSPageRule.java
deleted file mode 100644
index 773b746..0000000
--- a/src/org/w3c/dom/css/CSSPageRule.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.css;
-
-import org.w3c.dom.DOMException;
-
-/**
- * The <code>CSSPageRule</code> interface represents a @page rule within a
- * CSS style sheet. The <code>@page</code> rule is used to specify the
- * dimensions, orientation, margins, etc. of a page box for paged media.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface CSSPageRule extends CSSRule {
- /**
- * The parsable textual representation of the page selector for the rule.
- */
- public String getSelectorText();
- /**
- * The parsable textual representation of the page selector for the rule.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the specified CSS string value has a syntax
- * error and is unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this rule is readonly.
- */
- public void setSelectorText(String selectorText)
- throws DOMException;
-
- /**
- * The declaration-block of this rule.
- */
- public CSSStyleDeclaration getStyle();
-
-}
diff --git a/src/org/w3c/dom/css/CSSPrimitiveValue.java b/src/org/w3c/dom/css/CSSPrimitiveValue.java
deleted file mode 100644
index 3078d72..0000000
--- a/src/org/w3c/dom/css/CSSPrimitiveValue.java
+++ /dev/null
@@ -1,325 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.css;
-
-import org.w3c.dom.DOMException;
-
-/**
- * The <code>CSSPrimitiveValue</code> interface represents a single CSS value
- * . This interface may be used to determine the value of a specific style
- * property currently set in a block or to set a specific style property
- * explicitly within the block. An instance of this interface might be
- * obtained from the <code>getPropertyCSSValue</code> method of the
- * <code>CSSStyleDeclaration</code> interface. A
- * <code>CSSPrimitiveValue</code> object only occurs in a context of a CSS
- * property.
- * <p> Conversions are allowed between absolute values (from millimeters to
- * centimeters, from degrees to radians, and so on) but not between relative
- * values. (For example, a pixel value cannot be converted to a centimeter
- * value.) Percentage values can't be converted since they are relative to
- * the parent value (or another property value). There is one exception for
- * color percentage values: since a color percentage value is relative to
- * the range 0-255, a color percentage value can be converted to a number;
- * (see also the <code>RGBColor</code> interface).
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface CSSPrimitiveValue extends CSSValue {
- // UnitTypes
- /**
- * The value is not a recognized CSS2 value. The value can only be
- * obtained by using the <code>cssText</code> attribute.
- */
- public static final short CSS_UNKNOWN = 0;
- /**
- * The value is a simple number. The value can be obtained by using the
- * <code>getFloatValue</code> method.
- */
- public static final short CSS_NUMBER = 1;
- /**
- * The value is a percentage. The value can be obtained by using the
- * <code>getFloatValue</code> method.
- */
- public static final short CSS_PERCENTAGE = 2;
- /**
- * The value is a length (ems). The value can be obtained by using the
- * <code>getFloatValue</code> method.
- */
- public static final short CSS_EMS = 3;
- /**
- * The value is a length (exs). The value can be obtained by using the
- * <code>getFloatValue</code> method.
- */
- public static final short CSS_EXS = 4;
- /**
- * The value is a length (px). The value can be obtained by using the
- * <code>getFloatValue</code> method.
- */
- public static final short CSS_PX = 5;
- /**
- * The value is a length (cm). The value can be obtained by using the
- * <code>getFloatValue</code> method.
- */
- public static final short CSS_CM = 6;
- /**
- * The value is a length (mm). The value can be obtained by using the
- * <code>getFloatValue</code> method.
- */
- public static final short CSS_MM = 7;
- /**
- * The value is a length (in). The value can be obtained by using the
- * <code>getFloatValue</code> method.
- */
- public static final short CSS_IN = 8;
- /**
- * The value is a length (pt). The value can be obtained by using the
- * <code>getFloatValue</code> method.
- */
- public static final short CSS_PT = 9;
- /**
- * The value is a length (pc). The value can be obtained by using the
- * <code>getFloatValue</code> method.
- */
- public static final short CSS_PC = 10;
- /**
- * The value is an angle (deg). The value can be obtained by using the
- * <code>getFloatValue</code> method.
- */
- public static final short CSS_DEG = 11;
- /**
- * The value is an angle (rad). The value can be obtained by using the
- * <code>getFloatValue</code> method.
- */
- public static final short CSS_RAD = 12;
- /**
- * The value is an angle (grad). The value can be obtained by using the
- * <code>getFloatValue</code> method.
- */
- public static final short CSS_GRAD = 13;
- /**
- * The value is a time (ms). The value can be obtained by using the
- * <code>getFloatValue</code> method.
- */
- public static final short CSS_MS = 14;
- /**
- * The value is a time (s). The value can be obtained by using the
- * <code>getFloatValue</code> method.
- */
- public static final short CSS_S = 15;
- /**
- * The value is a frequency (Hz). The value can be obtained by using the
- * <code>getFloatValue</code> method.
- */
- public static final short CSS_HZ = 16;
- /**
- * The value is a frequency (kHz). The value can be obtained by using the
- * <code>getFloatValue</code> method.
- */
- public static final short CSS_KHZ = 17;
- /**
- * The value is a number with an unknown dimension. The value can be
- * obtained by using the <code>getFloatValue</code> method.
- */
- public static final short CSS_DIMENSION = 18;
- /**
- * The value is a STRING. The value can be obtained by using the
- * <code>getStringValue</code> method.
- */
- public static final short CSS_STRING = 19;
- /**
- * The value is a URI. The value can be obtained by using the
- * <code>getStringValue</code> method.
- */
- public static final short CSS_URI = 20;
- /**
- * The value is an identifier. The value can be obtained by using the
- * <code>getStringValue</code> method.
- */
- public static final short CSS_IDENT = 21;
- /**
- * The value is a attribute function. The value can be obtained by using
- * the <code>getStringValue</code> method.
- */
- public static final short CSS_ATTR = 22;
- /**
- * The value is a counter or counters function. The value can be obtained
- * by using the <code>getCounterValue</code> method.
- */
- public static final short CSS_COUNTER = 23;
- /**
- * The value is a rect function. The value can be obtained by using the
- * <code>getRectValue</code> method.
- */
- public static final short CSS_RECT = 24;
- /**
- * The value is a RGB color. The value can be obtained by using the
- * <code>getRGBColorValue</code> method.
- */
- public static final short CSS_RGBCOLOR = 25;
-
- /**
- * The type of the value as defined by the constants specified above.
- */
- public short getPrimitiveType();
-
- /**
- * A method to set the float value with a specified unit. If the property
- * attached with this value can not accept the specified unit or the
- * float value, the value will be unchanged and a
- * <code>DOMException</code> will be raised.
- * @param unitType A unit code as defined above. The unit code can only
- * be a float unit type (i.e. <code>CSS_NUMBER</code>,
- * <code>CSS_PERCENTAGE</code>, <code>CSS_EMS</code>,
- * <code>CSS_EXS</code>, <code>CSS_PX</code>, <code>CSS_CM</code>,
- * <code>CSS_MM</code>, <code>CSS_IN</code>, <code>CSS_PT</code>,
- * <code>CSS_PC</code>, <code>CSS_DEG</code>, <code>CSS_RAD</code>,
- * <code>CSS_GRAD</code>, <code>CSS_MS</code>, <code>CSS_S</code>,
- * <code>CSS_HZ</code>, <code>CSS_KHZ</code>,
- * <code>CSS_DIMENSION</code>).
- * @param floatValue The new float value.
- * @exception DOMException
- * INVALID_ACCESS_ERR: Raised if the attached property doesn't support
- * the float value or the unit type.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setFloatValue(short unitType,
- float floatValue)
- throws DOMException;
-
- /**
- * This method is used to get a float value in a specified unit. If this
- * CSS value doesn't contain a float value or can't be converted into
- * the specified unit, a <code>DOMException</code> is raised.
- * @param unitType A unit code to get the float value. The unit code can
- * only be a float unit type (i.e. <code>CSS_NUMBER</code>,
- * <code>CSS_PERCENTAGE</code>, <code>CSS_EMS</code>,
- * <code>CSS_EXS</code>, <code>CSS_PX</code>, <code>CSS_CM</code>,
- * <code>CSS_MM</code>, <code>CSS_IN</code>, <code>CSS_PT</code>,
- * <code>CSS_PC</code>, <code>CSS_DEG</code>, <code>CSS_RAD</code>,
- * <code>CSS_GRAD</code>, <code>CSS_MS</code>, <code>CSS_S</code>,
- * <code>CSS_HZ</code>, <code>CSS_KHZ</code>,
- * <code>CSS_DIMENSION</code>).
- * @return The float value in the specified unit.
- * @exception DOMException
- * INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a float
- * value or if the float value can't be converted into the specified
- * unit.
- */
- public float getFloatValue(short unitType)
- throws DOMException;
-
- /**
- * A method to set the string value with the specified unit. If the
- * property attached to this value can't accept the specified unit or
- * the string value, the value will be unchanged and a
- * <code>DOMException</code> will be raised.
- * @param stringType A string code as defined above. The string code can
- * only be a string unit type (i.e. <code>CSS_STRING</code>,
- * <code>CSS_URI</code>, <code>CSS_IDENT</code>, and
- * <code>CSS_ATTR</code>).
- * @param stringValue The new string value.
- * @exception DOMException
- * INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a string
- * value or if the string value can't be converted into the specified
- * unit.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
- */
- public void setStringValue(short stringType,
- String stringValue)
- throws DOMException;
-
- /**
- * This method is used to get the string value. If the CSS value doesn't
- * contain a string value, a <code>DOMException</code> is raised. Some
- * properties (like 'font-family' or 'voice-family') convert a
- * whitespace separated list of idents to a string.
- * @return The string value in the current unit. The current
- * <code>primitiveType</code> can only be a string unit type (i.e.
- * <code>CSS_STRING</code>, <code>CSS_URI</code>,
- * <code>CSS_IDENT</code> and <code>CSS_ATTR</code>).
- * @exception DOMException
- * INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a string
- * value.
- */
- public String getStringValue()
- throws DOMException;
-
- /**
- * This method is used to get the Counter value. If this CSS value
- * doesn't contain a counter value, a <code>DOMException</code> is
- * raised. Modification to the corresponding style property can be
- * achieved using the <code>Counter</code> interface.
- * @return The Counter value.
- * @exception DOMException
- * INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a
- * Counter value (e.g. this is not <code>CSS_COUNTER</code>).
- */
- public Counter getCounterValue()
- throws DOMException;
-
- /**
- * This method is used to get the Rect value. If this CSS value doesn't
- * contain a rect value, a <code>DOMException</code> is raised.
- * Modification to the corresponding style property can be achieved
- * using the <code>Rect</code> interface.
- * @return The Rect value.
- * @exception DOMException
- * INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a Rect
- * value. (e.g. this is not <code>CSS_RECT</code>).
- */
- public Rect getRectValue()
- throws DOMException;
-
- /**
- * This method is used to get the RGB color. If this CSS value doesn't
- * contain a RGB color value, a <code>DOMException</code> is raised.
- * Modification to the corresponding style property can be achieved
- * using the <code>RGBColor</code> interface.
- * @return the RGB color value.
- * @exception DOMException
- * INVALID_ACCESS_ERR: Raised if the attached property can't return a
- * RGB color value (e.g. this is not <code>CSS_RGBCOLOR</code>).
- */
- public RGBColor getRGBColorValue()
- throws DOMException;
-
-}
diff --git a/src/org/w3c/dom/css/CSSRule.java b/src/org/w3c/dom/css/CSSRule.java
deleted file mode 100644
index f81d0d5..0000000
--- a/src/org/w3c/dom/css/CSSRule.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.css;
-
-import org.w3c.dom.DOMException;
-
-/**
- * The <code>CSSRule</code> interface is the abstract base interface for any
- * type of CSS statement. This includes both rule sets and at-rules. An
- * implementation is expected to preserve all rules specified in a CSS style
- * sheet, even if the rule is not recognized by the parser. Unrecognized
- * rules are represented using the <code>CSSUnknownRule</code> interface.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface CSSRule {
- // RuleType
- /**
- * The rule is a <code>CSSUnknownRule</code>.
- */
- public static final short UNKNOWN_RULE = 0;
- /**
- * The rule is a <code>CSSStyleRule</code>.
- */
- public static final short STYLE_RULE = 1;
- /**
- * The rule is a <code>CSSCharsetRule</code>.
- */
- public static final short CHARSET_RULE = 2;
- /**
- * The rule is a <code>CSSImportRule</code>.
- */
- public static final short IMPORT_RULE = 3;
- /**
- * The rule is a <code>CSSMediaRule</code>.
- */
- public static final short MEDIA_RULE = 4;
- /**
- * The rule is a <code>CSSFontFaceRule</code>.
- */
- public static final short FONT_FACE_RULE = 5;
- /**
- * The rule is a <code>CSSPageRule</code>.
- */
- public static final short PAGE_RULE = 6;
-
- /**
- * The type of the rule, as defined above. The expectation is that
- * binding-specific casting methods can be used to cast down from an
- * instance of the <code>CSSRule</code> interface to the specific
- * derived interface implied by the <code>type</code>.
- */
- public short getType();
-
- /**
- * The parsable textual representation of the rule. This reflects the
- * current state of the rule and not its initial value.
- */
- public String getCssText();
- /**
- * The parsable textual representation of the rule. This reflects the
- * current state of the rule and not its initial value.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the specified CSS string value has a syntax
- * error and is unparsable.
- * <br>INVALID_MODIFICATION_ERR: Raised if the specified CSS string
- * value represents a different type of rule than the current one.
- * <br>HIERARCHY_REQUEST_ERR: Raised if the rule cannot be inserted at
- * this point in the style sheet.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if the rule is readonly.
- */
- public void setCssText(String cssText)
- throws DOMException;
-
- /**
- * The style sheet that contains this rule.
- */
- public CSSStyleSheet getParentStyleSheet();
-
- /**
- * If this rule is contained inside another rule (e.g. a style rule
- * inside an @media block), this is the containing rule. If this rule is
- * not nested inside any other rules, this returns <code>null</code>.
- */
- public CSSRule getParentRule();
-
-}
diff --git a/src/org/w3c/dom/css/CSSRuleList.java b/src/org/w3c/dom/css/CSSRuleList.java
deleted file mode 100644
index 33840ef..0000000
--- a/src/org/w3c/dom/css/CSSRuleList.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.css;
-
-/**
- * The <code>CSSRuleList</code> interface provides the abstraction of an
- * ordered collection of CSS rules.
- * <p> The items in the <code>CSSRuleList</code> are accessible via an
- * integral index, starting from 0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface CSSRuleList {
- /**
- * The number of <code>CSSRules</code> in the list. The range of valid
- * child rule indices is <code>0</code> to <code>length-1</code>
- * inclusive.
- */
- public int getLength();
-
- /**
- * Used to retrieve a CSS rule by ordinal index. The order in this
- * collection represents the order of the rules in the CSS style sheet.
- * If index is greater than or equal to the number of rules in the list,
- * this returns <code>null</code>.
- * @param index Index into the collection
- * @return The style rule at the <code>index</code> position in the
- * <code>CSSRuleList</code>, or <code>null</code> if that is not a
- * valid index.
- */
- public CSSRule item(int index);
-
-}
diff --git a/src/org/w3c/dom/css/CSSStyleDeclaration.java b/src/org/w3c/dom/css/CSSStyleDeclaration.java
deleted file mode 100644
index de63268..0000000
--- a/src/org/w3c/dom/css/CSSStyleDeclaration.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.css;
-
-import org.w3c.dom.DOMException;
-
-/**
- * The <code>CSSStyleDeclaration</code> interface represents a single CSS
- * declaration block. This interface may be used to determine the style
- * properties currently set in a block or to set style properties explicitly
- * within the block.
- * <p> While an implementation may not recognize all CSS properties within a
- * CSS declaration block, it is expected to provide access to all specified
- * properties in the style sheet through the <code>CSSStyleDeclaration</code>
- * interface. Furthermore, implementations that support a specific level of
- * CSS should correctly handle CSS shorthand properties for that level. For
- * a further discussion of shorthand properties, see the
- * <code>CSS2Properties</code> interface.
- * <p> This interface is also used to provide a read-only access to the
- * computed values of an element. See also the <code>ViewCSS</code>
- * interface. The CSS Object Model doesn't provide an access to the
- * specified or actual values of the CSS cascade.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface CSSStyleDeclaration {
- /**
- * The parsable textual representation of the declaration block
- * (excluding the surrounding curly braces). Setting this attribute will
- * result in the parsing of the new value and resetting of all the
- * properties in the declaration block including the removal or addition
- * of properties.
- */
- public String getCssText();
- /**
- * The parsable textual representation of the declaration block
- * (excluding the surrounding curly braces). Setting this attribute will
- * result in the parsing of the new value and resetting of all the
- * properties in the declaration block including the removal or addition
- * of properties.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the specified CSS string value has a syntax
- * error and is unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this declaration is
- * readonly or a property is readonly.
- */
- public void setCssText(String cssText)
- throws DOMException;
-
- /**
- * Used to retrieve the value of a CSS property if it has been explicitly
- * set within this declaration block.
- * @param propertyName The name of the CSS property. See the CSS
- * property index.
- * @return Returns the value of the property if it has been explicitly
- * set for this declaration block. Returns the empty string if the
- * property has not been set.
- */
- public String getPropertyValue(String propertyName);
-
- /**
- * Used to retrieve the object representation of the value of a CSS
- * property if it has been explicitly set within this declaration block.
- * This method returns <code>null</code> if the property is a shorthand
- * property. Shorthand property values can only be accessed and modified
- * as strings, using the <code>getPropertyValue</code> and
- * <code>setProperty</code> methods.
- * @param propertyName The name of the CSS property. See the CSS
- * property index.
- * @return Returns the value of the property if it has been explicitly
- * set for this declaration block. Returns <code>null</code> if the
- * property has not been set.
- */
- public CSSValue getPropertyCSSValue(String propertyName);
-
- /**
- * Used to remove a CSS property if it has been explicitly set within
- * this declaration block.
- * @param propertyName The name of the CSS property. See the CSS
- * property index.
- * @return Returns the value of the property if it has been explicitly
- * set for this declaration block. Returns the empty string if the
- * property has not been set or the property name does not correspond
- * to a known CSS property.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this declaration is readonly
- * or the property is readonly.
- */
- public String removeProperty(String propertyName)
- throws DOMException;
-
- /**
- * Used to retrieve the priority of a CSS property (e.g. the
- * <code>"important"</code> qualifier) if the priority has been
- * explicitly set in this declaration block.
- * @param propertyName The name of the CSS property. See the CSS
- * property index.
- * @return A string representing the priority (e.g.
- * <code>"important"</code>) if the property has been explicitly set
- * in this declaration block and has a priority specified. The empty
- * string otherwise.
- */
- public String getPropertyPriority(String propertyName);
-
- /**
- * Used to set a property value and priority within this declaration
- * block. <code>setProperty</code> permits to modify a property or add a
- * new one in the declaration block. Any call to this method may modify
- * the order of properties in the <code>item</code> method.
- * @param propertyName The name of the CSS property. See the CSS
- * property index.
- * @param value The new value of the property.
- * @param priority The new priority of the property (e.g.
- * <code>"important"</code>) or the empty string if none.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the specified value has a syntax error and is
- * unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this declaration is
- * readonly or the property is readonly.
- */
- public void setProperty(String propertyName,
- String value,
- String priority)
- throws DOMException;
-
- /**
- * The number of properties that have been explicitly set in this
- * declaration block. The range of valid indices is 0 to length-1
- * inclusive.
- */
- public int getLength();
-
- /**
- * Used to retrieve the properties that have been explicitly set in this
- * declaration block. The order of the properties retrieved using this
- * method does not have to be the order in which they were set. This
- * method can be used to iterate over all properties in this declaration
- * block.
- * @param index Index of the property name to retrieve.
- * @return The name of the property at this ordinal position. The empty
- * string if no property exists at this position.
- */
- public String item(int index);
-
- /**
- * The CSS rule that contains this declaration block or <code>null</code>
- * if this <code>CSSStyleDeclaration</code> is not attached to a
- * <code>CSSRule</code>.
- */
- public CSSRule getParentRule();
-
-}
diff --git a/src/org/w3c/dom/css/CSSStyleRule.java b/src/org/w3c/dom/css/CSSStyleRule.java
deleted file mode 100644
index e165cd1..0000000
--- a/src/org/w3c/dom/css/CSSStyleRule.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.css;
-
-import org.w3c.dom.DOMException;
-
-/**
- * The <code>CSSStyleRule</code> interface represents a single rule set in a
- * CSS style sheet.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface CSSStyleRule extends CSSRule {
- /**
- * The textual representation of the selector for the rule set. The
- * implementation may have stripped out insignificant whitespace while
- * parsing the selector.
- */
- public String getSelectorText();
- /**
- * The textual representation of the selector for the rule set. The
- * implementation may have stripped out insignificant whitespace while
- * parsing the selector.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the specified CSS string value has a syntax
- * error and is unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this rule is readonly.
- */
- public void setSelectorText(String selectorText)
- throws DOMException;
-
- /**
- * The declaration-block of this rule set.
- */
- public CSSStyleDeclaration getStyle();
-
-}
diff --git a/src/org/w3c/dom/css/CSSStyleSheet.java b/src/org/w3c/dom/css/CSSStyleSheet.java
deleted file mode 100644
index d3cf723..0000000
--- a/src/org/w3c/dom/css/CSSStyleSheet.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.css;
-
-import org.w3c.dom.DOMException;
-import org.w3c.dom.stylesheets.StyleSheet;
-
-/**
- * The <code>CSSStyleSheet</code> interface is a concrete interface used to
- * represent a CSS style sheet i.e., a style sheet whose content type is
- * "text/css".
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface CSSStyleSheet extends StyleSheet {
- /**
- * If this style sheet comes from an <code>@import</code> rule, the
- * <code>ownerRule</code> attribute will contain the
- * <code>CSSImportRule</code>. In that case, the <code>ownerNode</code>
- * attribute in the <code>StyleSheet</code> interface will be
- * <code>null</code>. If the style sheet comes from an element or a
- * processing instruction, the <code>ownerRule</code> attribute will be
- * <code>null</code> and the <code>ownerNode</code> attribute will
- * contain the <code>Node</code>.
- */
- public CSSRule getOwnerRule();
-
- /**
- * The list of all CSS rules contained within the style sheet. This
- * includes both rule sets and at-rules.
- */
- public CSSRuleList getCssRules();
-
- /**
- * Used to insert a new rule into the style sheet. The new rule now
- * becomes part of the cascade.
- * @param rule The parsable text representing the rule. For rule sets
- * this contains both the selector and the style declaration. For
- * at-rules, this specifies both the at-identifier and the rule
- * content.
- * @param index The index within the style sheet's rule list of the rule
- * before which to insert the specified rule. If the specified index
- * is equal to the length of the style sheet's rule collection, the
- * rule will be added to the end of the style sheet.
- * @return The index within the style sheet's rule collection of the
- * newly inserted rule.
- * @exception DOMException
- * HIERARCHY_REQUEST_ERR: Raised if the rule cannot be inserted at the
- * specified index e.g. if an <code>@import</code> rule is inserted
- * after a standard rule set or other at-rule.
- * <br>INDEX_SIZE_ERR: Raised if the specified index is not a valid
- * insertion point.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this style sheet is
- * readonly.
- * <br>SYNTAX_ERR: Raised if the specified rule has a syntax error and
- * is unparsable.
- */
- public int insertRule(String rule,
- int index)
- throws DOMException;
-
- /**
- * Used to delete a rule from the style sheet.
- * @param index The index within the style sheet's rule list of the rule
- * to remove.
- * @exception DOMException
- * INDEX_SIZE_ERR: Raised if the specified index does not correspond to
- * a rule in the style sheet's rule list.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this style sheet is
- * readonly.
- */
- public void deleteRule(int index)
- throws DOMException;
-
-}
diff --git a/src/org/w3c/dom/css/CSSUnknownRule.java b/src/org/w3c/dom/css/CSSUnknownRule.java
deleted file mode 100644
index 0b1d87b..0000000
--- a/src/org/w3c/dom/css/CSSUnknownRule.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.css;
-
-/**
- * The <code>CSSUnknownRule</code> interface represents an at-rule not
- * supported by this user agent.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface CSSUnknownRule extends CSSRule {
-}
diff --git a/src/org/w3c/dom/css/CSSValue.java b/src/org/w3c/dom/css/CSSValue.java
deleted file mode 100644
index ae4effa..0000000
--- a/src/org/w3c/dom/css/CSSValue.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.css;
-
-import org.w3c.dom.DOMException;
-
-/**
- * The <code>CSSValue</code> interface represents a simple or a complex
- * value. A <code>CSSValue</code> object only occurs in a context of a CSS
- * property.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface CSSValue {
- // UnitTypes
- /**
- * The value is inherited and the <code>cssText</code> contains "inherit".
- */
- public static final short CSS_INHERIT = 0;
- /**
- * The value is a primitive value and an instance of the
- * <code>CSSPrimitiveValue</code> interface can be obtained by using
- * binding-specific casting methods on this instance of the
- * <code>CSSValue</code> interface.
- */
- public static final short CSS_PRIMITIVE_VALUE = 1;
- /**
- * The value is a <code>CSSValue</code> list and an instance of the
- * <code>CSSValueList</code> interface can be obtained by using
- * binding-specific casting methods on this instance of the
- * <code>CSSValue</code> interface.
- */
- public static final short CSS_VALUE_LIST = 2;
- /**
- * The value is a custom value.
- */
- public static final short CSS_CUSTOM = 3;
-
- /**
- * A string representation of the current value.
- */
- public String getCssText();
- /**
- * A string representation of the current value.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the specified CSS string value has a syntax
- * error (according to the attached property) or is unparsable.
- * <br>INVALID_MODIFICATION_ERR: Raised if the specified CSS string
- * value represents a different type of values than the values allowed
- * by the CSS property.
- * <br> NO_MODIFICATION_ALLOWED_ERR: Raised if this value is readonly.
- */
- public void setCssText(String cssText)
- throws DOMException;
-
- /**
- * A code defining the type of the value as defined above.
- */
- public short getCssValueType();
-
-}
diff --git a/src/org/w3c/dom/css/CSSValueList.java b/src/org/w3c/dom/css/CSSValueList.java
deleted file mode 100644
index 1567399..0000000
--- a/src/org/w3c/dom/css/CSSValueList.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.css;
-
-/**
- * The <code>CSSValueList</code> interface provides the abstraction of an
- * ordered collection of CSS values.
- * <p> Some properties allow an empty list into their syntax. In that case,
- * these properties take the <code>none</code> identifier. So, an empty list
- * means that the property has the value <code>none</code>.
- * <p> The items in the <code>CSSValueList</code> are accessible via an
- * integral index, starting from 0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface CSSValueList extends CSSValue {
- /**
- * The number of <code>CSSValues</code> in the list. The range of valid
- * values of the indices is <code>0</code> to <code>length-1</code>
- * inclusive.
- */
- public int getLength();
-
- /**
- * Used to retrieve a <code>CSSValue</code> by ordinal index. The order in
- * this collection represents the order of the values in the CSS style
- * property. If index is greater than or equal to the number of values
- * in the list, this returns <code>null</code>.
- * @param index Index into the collection.
- * @return The <code>CSSValue</code> at the <code>index</code> position
- * in the <code>CSSValueList</code>, or <code>null</code> if that is
- * not a valid index.
- */
- public CSSValue item(int index);
-
-}
diff --git a/src/org/w3c/dom/css/Counter.java b/src/org/w3c/dom/css/Counter.java
deleted file mode 100644
index 44a2993..0000000
--- a/src/org/w3c/dom/css/Counter.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.css;
-
-/**
- * The <code>Counter</code> interface is used to represent any counter or
- * counters function value. This interface reflects the values in the
- * underlying style property.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface Counter {
- /**
- * This attribute is used for the identifier of the counter.
- */
- public String getIdentifier();
-
- /**
- * This attribute is used for the style of the list.
- */
- public String getListStyle();
-
- /**
- * This attribute is used for the separator of the nested counters.
- */
- public String getSeparator();
-
-}
diff --git a/src/org/w3c/dom/css/DOMImplementationCSS.java b/src/org/w3c/dom/css/DOMImplementationCSS.java
deleted file mode 100644
index 2aeb37e..0000000
--- a/src/org/w3c/dom/css/DOMImplementationCSS.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.css;
-
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.DOMException;
-
-/**
- * This interface allows the DOM user to create a <code>CSSStyleSheet</code>
- * outside the context of a document. There is no way to associate the new
- * <code>CSSStyleSheet</code> with a document in DOM Level 2.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface DOMImplementationCSS extends DOMImplementation {
- /**
- * Creates a new <code>CSSStyleSheet</code>.
- * @param title The advisory title. See also the section.
- * @param media The comma-separated list of media associated with the
- * new style sheet. See also the section.
- * @return A new CSS style sheet.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the specified media string value has a syntax
- * error and is unparsable.
- */
- public CSSStyleSheet createCSSStyleSheet(String title,
- String media)
- throws DOMException;
-
-}
diff --git a/src/org/w3c/dom/css/DocumentCSS.java b/src/org/w3c/dom/css/DocumentCSS.java
deleted file mode 100644
index 47399a7..0000000
--- a/src/org/w3c/dom/css/DocumentCSS.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.css;
-
-import org.w3c.dom.Element;
-import org.w3c.dom.stylesheets.DocumentStyle;
-
-/**
- * This interface represents a document with a CSS view.
- * <p> The <code>getOverrideStyle</code> method provides a mechanism through
- * which a DOM author could effect immediate change to the style of an
- * element without modifying the explicitly linked style sheets of a
- * document or the inline style of elements in the style sheets. This style
- * sheet comes after the author style sheet in the cascade algorithm and is
- * called override style sheet. The override style sheet takes precedence
- * over author style sheets. An "!important" declaration still takes
- * precedence over a normal declaration. Override, author, and user style
- * sheets all may contain "!important" declarations. User "!important" rules
- * take precedence over both override and author "!important" rules, and
- * override "!important" rules take precedence over author "!important"
- * rules.
- * <p> The expectation is that an instance of the <code>DocumentCSS</code>
- * interface can be obtained by using binding-specific casting methods on an
- * instance of the <code>Document</code> interface.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface DocumentCSS extends DocumentStyle {
- /**
- * This method is used to retrieve the override style declaration for a
- * specified element and a specified pseudo-element.
- * @param elt The element whose style is to be modified. This parameter
- * cannot be null.
- * @param pseudoElt The pseudo-element or <code>null</code> if none.
- * @return The override style declaration.
- */
- public CSSStyleDeclaration getOverrideStyle(Element elt,
- String pseudoElt);
-
-}
diff --git a/src/org/w3c/dom/css/ElementCSSInlineStyle.java b/src/org/w3c/dom/css/ElementCSSInlineStyle.java
deleted file mode 100644
index c7e7053..0000000
--- a/src/org/w3c/dom/css/ElementCSSInlineStyle.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.css;
-
-/**
- * Inline style information attached to elements is exposed through the
- * <code>style</code> attribute. This represents the contents of the STYLE
- * attribute for HTML elements (or elements in other schemas or DTDs which
- * use the STYLE attribute in the same way). The expectation is that an
- * instance of the ElementCSSInlineStyle interface can be obtained by using
- * binding-specific casting methods on an instance of the Element interface
- * when the element supports inline CSS style informations.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface ElementCSSInlineStyle {
- /**
- * The style attribute.
- */
- public CSSStyleDeclaration getStyle();
-
-}
diff --git a/src/org/w3c/dom/css/RGBColor.java b/src/org/w3c/dom/css/RGBColor.java
deleted file mode 100644
index 7d37458..0000000
--- a/src/org/w3c/dom/css/RGBColor.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.css;
-
-/**
- * The <code>RGBColor</code> interface is used to represent any RGB color
- * value. This interface reflects the values in the underlying style
- * property. Hence, modifications made to the <code>CSSPrimitiveValue</code>
- * objects modify the style property.
- * <p> A specified RGB color is not clipped (even if the number is outside the
- * range 0-255 or 0%-100%). A computed RGB color is clipped depending on the
- * device.
- * <p> Even if a style sheet can only contain an integer for a color value,
- * the internal storage of this integer is a float, and this can be used as
- * a float in the specified or the computed style.
- * <p> A color percentage value can always be converted to a number and vice
- * versa.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface RGBColor {
- /**
- * This attribute is used for the red value of the RGB color.
- */
- public CSSPrimitiveValue getRed();
-
- /**
- * This attribute is used for the green value of the RGB color.
- */
- public CSSPrimitiveValue getGreen();
-
- /**
- * This attribute is used for the blue value of the RGB color.
- */
- public CSSPrimitiveValue getBlue();
-
-}
diff --git a/src/org/w3c/dom/css/Rect.java b/src/org/w3c/dom/css/Rect.java
deleted file mode 100644
index b9e6956..0000000
--- a/src/org/w3c/dom/css/Rect.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.css;
-
-/**
- * The <code>Rect</code> interface is used to represent any rect value. This
- * interface reflects the values in the underlying style property. Hence,
- * modifications made to the <code>CSSPrimitiveValue</code> objects modify
- * the style property.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface Rect {
- /**
- * This attribute is used for the top of the rect.
- */
- public CSSPrimitiveValue getTop();
-
- /**
- * This attribute is used for the right of the rect.
- */
- public CSSPrimitiveValue getRight();
-
- /**
- * This attribute is used for the bottom of the rect.
- */
- public CSSPrimitiveValue getBottom();
-
- /**
- * This attribute is used for the left of the rect.
- */
- public CSSPrimitiveValue getLeft();
-
-}
diff --git a/src/org/w3c/dom/css/ViewCSS.java b/src/org/w3c/dom/css/ViewCSS.java
deleted file mode 100644
index 38b22b3..0000000
--- a/src/org/w3c/dom/css/ViewCSS.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.css;
-
-import org.w3c.dom.Element;
-import org.w3c.dom.views.AbstractView;
-
-/**
- * This interface represents a CSS view. The <code>getComputedStyle</code>
- * method provides a read only access to the computed values of an element.
- * <p> The expectation is that an instance of the <code>ViewCSS</code>
- * interface can be obtained by using binding-specific casting methods on an
- * instance of the <code>AbstractView</code> interface.
- * <p> Since a computed style is related to an <code>Element</code> node, if
- * this element is removed from the document, the associated
- * <code>CSSStyleDeclaration</code> and <code>CSSValue</code> related to
- * this declaration are no longer valid.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface ViewCSS extends AbstractView {
- /**
- * This method is used to get the computed style as it is defined in [<a href='http://www.w3.org/TR/1998/REC-CSS2-19980512'>CSS2</a>].
- * @param elt The element whose style is to be computed. This parameter
- * cannot be null.
- * @param pseudoElt The pseudo-element or <code>null</code> if none.
- * @return The computed style. The <code>CSSStyleDeclaration</code> is
- * read-only and contains only absolute values.
- */
- public CSSStyleDeclaration getComputedStyle(Element elt,
- String pseudoElt);
-
-}
diff --git a/src/org/w3c/dom/events/DocumentEvent.java b/src/org/w3c/dom/events/DocumentEvent.java
deleted file mode 100644
index cdbbb36..0000000
--- a/src/org/w3c/dom/events/DocumentEvent.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.events;
-
-import org.w3c.dom.DOMException;
-
-/**
- * The <code>DocumentEvent</code> interface provides a mechanism by which the
- * user can create an Event of a type supported by the implementation. It is
- * expected that the <code>DocumentEvent</code> interface will be
- * implemented on the same object which implements the <code>Document</code>
- * interface in an implementation which supports the Event model.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113'>Document Object Model (DOM) Level 2 Events Specification</a>.
- * @since DOM Level 2
- */
-public interface DocumentEvent {
- /**
- *
- * @param eventType The <code>eventType</code> parameter specifies the
- * type of <code>Event</code> interface to be created. If the
- * <code>Event</code> interface specified is supported by the
- * implementation this method will return a new <code>Event</code> of
- * the interface type requested. If the <code>Event</code> is to be
- * dispatched via the <code>dispatchEvent</code> method the
- * appropriate event init method must be called after creation in
- * order to initialize the <code>Event</code>'s values. As an example,
- * a user wishing to synthesize some kind of <code>UIEvent</code>
- * would call <code>createEvent</code> with the parameter "UIEvents".
- * The <code>initUIEvent</code> method could then be called on the
- * newly created <code>UIEvent</code> to set the specific type of
- * UIEvent to be dispatched and set its context information.The
- * <code>createEvent</code> method is used in creating
- * <code>Event</code>s when it is either inconvenient or unnecessary
- * for the user to create an <code>Event</code> themselves. In cases
- * where the implementation provided <code>Event</code> is
- * insufficient, users may supply their own <code>Event</code>
- * implementations for use with the <code>dispatchEvent</code> method.
- * @return The newly created <code>Event</code>
- * @exception DOMException
- * NOT_SUPPORTED_ERR: Raised if the implementation does not support the
- * type of <code>Event</code> interface requested
- */
- public Event createEvent(String eventType)
- throws DOMException;
-
-}
diff --git a/src/org/w3c/dom/events/Event.java b/src/org/w3c/dom/events/Event.java
deleted file mode 100644
index b1351e9..0000000
--- a/src/org/w3c/dom/events/Event.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.events;
-
-/**
- * The <code>Event</code> interface is used to provide contextual information
- * about an event to the handler processing the event. An object which
- * implements the <code>Event</code> interface is generally passed as the
- * first parameter to an event handler. More specific context information is
- * passed to event handlers by deriving additional interfaces from
- * <code>Event</code> which contain information directly relating to the
- * type of event they accompany. These derived interfaces are also
- * implemented by the object passed to the event listener.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113'>Document Object Model (DOM) Level 2 Events Specification</a>.
- * @since DOM Level 2
- */
-public interface Event {
- // PhaseType
- /**
- * The current event phase is the capturing phase.
- */
- public static final short CAPTURING_PHASE = 1;
- /**
- * The event is currently being evaluated at the target
- * <code>EventTarget</code>.
- */
- public static final short AT_TARGET = 2;
- /**
- * The current event phase is the bubbling phase.
- */
- public static final short BUBBLING_PHASE = 3;
-
- /**
- * The name of the event (case-insensitive). The name must be an XML name.
- */
- public String getType();
-
- /**
- * Used to indicate the <code>EventTarget</code> to which the event was
- * originally dispatched.
- */
- public EventTarget getTarget();
-
- /**
- * Used to indicate the <code>EventTarget</code> whose
- * <code>EventListeners</code> are currently being processed. This is
- * particularly useful during capturing and bubbling.
- */
- public EventTarget getCurrentTarget();
-
- /**
- * Used to indicate which phase of event flow is currently being
- * evaluated.
- */
- public short getEventPhase();
-
- /**
- * Used to indicate whether or not an event is a bubbling event. If the
- * event can bubble the value is true, else the value is false.
- */
- public boolean getBubbles();
-
- /**
- * Used to indicate whether or not an event can have its default action
- * prevented. If the default action can be prevented the value is true,
- * else the value is false.
- */
- public boolean getCancelable();
-
- /**
- * Used to specify the time (in milliseconds relative to the epoch) at
- * which the event was created. Due to the fact that some systems may
- * not provide this information the value of <code>timeStamp</code> may
- * be not available for all events. When not available, a value of 0
- * will be returned. Examples of epoch time are the time of the system
- * start or 0:0:0 UTC 1st January 1970.
- */
- public long getTimeStamp();
-
- /**
- * The <code>stopPropagation</code> method is used prevent further
- * propagation of an event during event flow. If this method is called
- * by any <code>EventListener</code> the event will cease propagating
- * through the tree. The event will complete dispatch to all listeners
- * on the current <code>EventTarget</code> before event flow stops. This
- * method may be used during any stage of event flow.
- */
- public void stopPropagation();
-
- /**
- * If an event is cancelable, the <code>preventDefault</code> method is
- * used to signify that the event is to be canceled, meaning any default
- * action normally taken by the implementation as a result of the event
- * will not occur. If, during any stage of event flow, the
- * <code>preventDefault</code> method is called the event is canceled.
- * Any default action associated with the event will not occur. Calling
- * this method for a non-cancelable event has no effect. Once
- * <code>preventDefault</code> has been called it will remain in effect
- * throughout the remainder of the event's propagation. This method may
- * be used during any stage of event flow.
- */
- public void preventDefault();
-
- /**
- * The <code>initEvent</code> method is used to initialize the value of an
- * <code>Event</code> created through the <code>DocumentEvent</code>
- * interface. This method may only be called before the
- * <code>Event</code> has been dispatched via the
- * <code>dispatchEvent</code> method, though it may be called multiple
- * times during that phase if necessary. If called multiple times the
- * final invocation takes precedence. If called from a subclass of
- * <code>Event</code> interface only the values specified in the
- * <code>initEvent</code> method are modified, all other attributes are
- * left unchanged.
- * @param eventTypeArg Specifies the event type. This type may be any
- * event type currently defined in this specification or a new event
- * type.. The string must be an XML name. Any new event type must not
- * begin with any upper, lower, or mixed case version of the string
- * "DOM". This prefix is reserved for future DOM event sets. It is
- * also strongly recommended that third parties adding their own
- * events use their own prefix to avoid confusion and lessen the
- * probability of conflicts with other new events.
- * @param canBubbleArg Specifies whether or not the event can bubble.
- * @param cancelableArg Specifies whether or not the event's default
- * action can be prevented.
- */
- public void initEvent(String eventTypeArg,
- boolean canBubbleArg,
- boolean cancelableArg);
-
-}
diff --git a/src/org/w3c/dom/events/EventException.java b/src/org/w3c/dom/events/EventException.java
deleted file mode 100644
index 6273f64..0000000
--- a/src/org/w3c/dom/events/EventException.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.events;
-
-/**
- * Event operations may throw an <code>EventException</code> as specified in
- * their method descriptions.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113'>Document Object Model (DOM) Level 2 Events Specification</a>.
- * @since DOM Level 2
- */
-public class EventException extends RuntimeException {
- public EventException(short code, String message) {
- super(message);
- this.code = code;
- }
- public short code;
- // EventExceptionCode
- /**
- * If the <code>Event</code>'s type was not specified by initializing the
- * event before the method was called. Specification of the Event's type
- * as <code>null</code> or an empty string will also trigger this
- * exception.
- */
- public static final short UNSPECIFIED_EVENT_TYPE_ERR = 0;
-
-}
diff --git a/src/org/w3c/dom/events/EventListener.java b/src/org/w3c/dom/events/EventListener.java
deleted file mode 100644
index 2adfe58..0000000
--- a/src/org/w3c/dom/events/EventListener.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.events;
-
-/**
- * The <code>EventListener</code> interface is the primary method for
- * handling events. Users implement the <code>EventListener</code> interface
- * and register their listener on an <code>EventTarget</code> using the
- * <code>AddEventListener</code> method. The users should also remove their
- * <code>EventListener</code> from its <code>EventTarget</code> after they
- * have completed using the listener.
- * <p> When a <code>Node</code> is copied using the <code>cloneNode</code>
- * method the <code>EventListener</code>s attached to the source
- * <code>Node</code> are not attached to the copied <code>Node</code>. If
- * the user wishes the same <code>EventListener</code>s to be added to the
- * newly created copy the user must add them manually.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113'>Document Object Model (DOM) Level 2 Events Specification</a>.
- * @since DOM Level 2
- */
-public interface EventListener {
- /**
- * This method is called whenever an event occurs of the type for which
- * the <code> EventListener</code> interface was registered.
- * @param evt The <code>Event</code> contains contextual information
- * about the event. It also contains the <code>stopPropagation</code>
- * and <code>preventDefault</code> methods which are used in
- * determining the event's flow and default action.
- */
- public void handleEvent(Event evt);
-
-}
diff --git a/src/org/w3c/dom/events/EventTarget.java b/src/org/w3c/dom/events/EventTarget.java
deleted file mode 100644
index 46ac1f6..0000000
--- a/src/org/w3c/dom/events/EventTarget.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.events;
-
-/**
- * The <code>EventTarget</code> interface is implemented by all
- * <code>Nodes</code> in an implementation which supports the DOM Event
- * Model. Therefore, this interface can be obtained by using
- * binding-specific casting methods on an instance of the <code>Node</code>
- * interface. The interface allows registration and removal of
- * <code>EventListeners</code> on an <code>EventTarget</code> and dispatch
- * of events to that <code>EventTarget</code>.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113'>Document Object Model (DOM) Level 2 Events Specification</a>.
- * @since DOM Level 2
- */
-public interface EventTarget {
- /**
- * This method allows the registration of event listeners on the event
- * target. If an <code>EventListener</code> is added to an
- * <code>EventTarget</code> while it is processing an event, it will not
- * be triggered by the current actions but may be triggered during a
- * later stage of event flow, such as the bubbling phase.
- * <br> If multiple identical <code>EventListener</code>s are registered
- * on the same <code>EventTarget</code> with the same parameters the
- * duplicate instances are discarded. They do not cause the
- * <code>EventListener</code> to be called twice and since they are
- * discarded they do not need to be removed with the
- * <code>removeEventListener</code> method.
- * @param type The event type for which the user is registering
- * @param listener The <code>listener</code> parameter takes an interface
- * implemented by the user which contains the methods to be called
- * when the event occurs.
- * @param useCapture If true, <code>useCapture</code> indicates that the
- * user wishes to initiate capture. After initiating capture, all
- * events of the specified type will be dispatched to the registered
- * <code>EventListener</code> before being dispatched to any
- * <code>EventTargets</code> beneath them in the tree. Events which
- * are bubbling upward through the tree will not trigger an
- * <code>EventListener</code> designated to use capture.
- */
- public void addEventListener(String type,
- EventListener listener,
- boolean useCapture);
-
- /**
- * This method allows the removal of event listeners from the event
- * target. If an <code>EventListener</code> is removed from an
- * <code>EventTarget</code> while it is processing an event, it will not
- * be triggered by the current actions. <code>EventListener</code>s can
- * never be invoked after being removed.
- * <br>Calling <code>removeEventListener</code> with arguments which do
- * not identify any currently registered <code>EventListener</code> on
- * the <code>EventTarget</code> has no effect.
- * @param type Specifies the event type of the <code>EventListener</code>
- * being removed.
- * @param listener The <code>EventListener</code> parameter indicates the
- * <code>EventListener </code> to be removed.
- * @param useCapture Specifies whether the <code>EventListener</code>
- * being removed was registered as a capturing listener or not. If a
- * listener was registered twice, one with capture and one without,
- * each must be removed separately. Removal of a capturing listener
- * does not affect a non-capturing version of the same listener, and
- * vice versa.
- */
- public void removeEventListener(String type,
- EventListener listener,
- boolean useCapture);
-
- /**
- * This method allows the dispatch of events into the implementations
- * event model. Events dispatched in this manner will have the same
- * capturing and bubbling behavior as events dispatched directly by the
- * implementation. The target of the event is the
- * <code> EventTarget</code> on which <code>dispatchEvent</code> is
- * called.
- * @param evt Specifies the event type, behavior, and contextual
- * information to be used in processing the event.
- * @return The return value of <code>dispatchEvent</code> indicates
- * whether any of the listeners which handled the event called
- * <code>preventDefault</code>. If <code>preventDefault</code> was
- * called the value is false, else the value is true.
- * @exception EventException
- * UNSPECIFIED_EVENT_TYPE_ERR: Raised if the <code>Event</code>'s type
- * was not specified by initializing the event before
- * <code>dispatchEvent</code> was called. Specification of the
- * <code>Event</code>'s type as <code>null</code> or an empty string
- * will also trigger this exception.
- */
- public boolean dispatchEvent(Event evt)
- throws EventException;
-
-}
diff --git a/src/org/w3c/dom/events/MouseEvent.java b/src/org/w3c/dom/events/MouseEvent.java
deleted file mode 100644
index dee4cda..0000000
--- a/src/org/w3c/dom/events/MouseEvent.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.events;
-
-import org.w3c.dom.views.AbstractView;
-
-/**
- * The <code>MouseEvent</code> interface provides specific contextual
- * information associated with Mouse events.
- * <p>The <code>detail</code> attribute inherited from <code>UIEvent</code>
- * indicates the number of times a mouse button has been pressed and
- * released over the same screen location during a user action. The
- * attribute value is 1 when the user begins this action and increments by 1
- * for each full sequence of pressing and releasing. If the user moves the
- * mouse between the mousedown and mouseup the value will be set to 0,
- * indicating that no click is occurring.
- * <p>In the case of nested elements mouse events are always targeted at the
- * most deeply nested element. Ancestors of the targeted element may use
- * bubbling to obtain notification of mouse events which occur within its
- * descendent elements.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113'>Document Object Model (DOM) Level 2 Events Specification</a>.
- * @since DOM Level 2
- */
-public interface MouseEvent extends UIEvent {
- /**
- * The horizontal coordinate at which the event occurred relative to the
- * origin of the screen coordinate system.
- */
- public int getScreenX();
-
- /**
- * The vertical coordinate at which the event occurred relative to the
- * origin of the screen coordinate system.
- */
- public int getScreenY();
-
- /**
- * The horizontal coordinate at which the event occurred relative to the
- * DOM implementation's client area.
- */
- public int getClientX();
-
- /**
- * The vertical coordinate at which the event occurred relative to the DOM
- * implementation's client area.
- */
- public int getClientY();
-
- /**
- * Used to indicate whether the 'ctrl' key was depressed during the firing
- * of the event.
- */
- public boolean getCtrlKey();
-
- /**
- * Used to indicate whether the 'shift' key was depressed during the
- * firing of the event.
- */
- public boolean getShiftKey();
-
- /**
- * Used to indicate whether the 'alt' key was depressed during the firing
- * of the event. On some platforms this key may map to an alternative
- * key name.
- */
- public boolean getAltKey();
-
- /**
- * Used to indicate whether the 'meta' key was depressed during the firing
- * of the event. On some platforms this key may map to an alternative
- * key name.
- */
- public boolean getMetaKey();
-
- /**
- * During mouse events caused by the depression or release of a mouse
- * button, <code>button</code> is used to indicate which mouse button
- * changed state. The values for <code>button</code> range from zero to
- * indicate the left button of the mouse, one to indicate the middle
- * button if present, and two to indicate the right button. For mice
- * configured for left handed use in which the button actions are
- * reversed the values are instead read from right to left.
- */
- public short getButton();
-
- /**
- * Used to identify a secondary <code>EventTarget</code> related to a UI
- * event. Currently this attribute is used with the mouseover event to
- * indicate the <code>EventTarget</code> which the pointing device
- * exited and with the mouseout event to indicate the
- * <code>EventTarget</code> which the pointing device entered.
- */
- public EventTarget getRelatedTarget();
-
- /**
- * The <code>initMouseEvent</code> method is used to initialize the value
- * of a <code>MouseEvent</code> created through the
- * <code>DocumentEvent</code> interface. This method may only be called
- * before the <code>MouseEvent</code> has been dispatched via the
- * <code>dispatchEvent</code> method, though it may be called multiple
- * times during that phase if necessary. If called multiple times, the
- * final invocation takes precedence.
- * @param typeArg Specifies the event type.
- * @param canBubbleArg Specifies whether or not the event can bubble.
- * @param cancelableArg Specifies whether or not the event's default
- * action can be prevented.
- * @param viewArg Specifies the <code>Event</code>'s
- * <code>AbstractView</code>.
- * @param detailArg Specifies the <code>Event</code>'s mouse click count.
- * @param screenXArg Specifies the <code>Event</code>'s screen x
- * coordinate
- * @param screenYArg Specifies the <code>Event</code>'s screen y
- * coordinate
- * @param clientXArg Specifies the <code>Event</code>'s client x
- * coordinate
- * @param clientYArg Specifies the <code>Event</code>'s client y
- * coordinate
- * @param ctrlKeyArg Specifies whether or not control key was depressed
- * during the <code>Event</code>.
- * @param altKeyArg Specifies whether or not alt key was depressed during
- * the <code>Event</code>.
- * @param shiftKeyArg Specifies whether or not shift key was depressed
- * during the <code>Event</code>.
- * @param metaKeyArg Specifies whether or not meta key was depressed
- * during the <code>Event</code>.
- * @param buttonArg Specifies the <code>Event</code>'s mouse button.
- * @param relatedTargetArg Specifies the <code>Event</code>'s related
- * <code>EventTarget</code>.
- */
- public void initMouseEvent(String typeArg,
- boolean canBubbleArg,
- boolean cancelableArg,
- AbstractView viewArg,
- int detailArg,
- int screenXArg,
- int screenYArg,
- int clientXArg,
- int clientYArg,
- boolean ctrlKeyArg,
- boolean altKeyArg,
- boolean shiftKeyArg,
- boolean metaKeyArg,
- short buttonArg,
- EventTarget relatedTargetArg);
-
-}
diff --git a/src/org/w3c/dom/events/MutationEvent.java b/src/org/w3c/dom/events/MutationEvent.java
deleted file mode 100644
index a520b6f..0000000
--- a/src/org/w3c/dom/events/MutationEvent.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.events;
-
-import org.w3c.dom.Node;
-
-/**
- * The <code>MutationEvent</code> interface provides specific contextual
- * information associated with Mutation events.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113'>Document Object Model (DOM) Level 2 Events Specification</a>.
- * @since DOM Level 2
- */
-public interface MutationEvent extends Event {
- // attrChangeType
- /**
- * The <code>Attr</code> was modified in place.
- */
- public static final short MODIFICATION = 1;
- /**
- * The <code>Attr</code> was just added.
- */
- public static final short ADDITION = 2;
- /**
- * The <code>Attr</code> was just removed.
- */
- public static final short REMOVAL = 3;
-
- /**
- * <code>relatedNode</code> is used to identify a secondary node related
- * to a mutation event. For example, if a mutation event is dispatched
- * to a node indicating that its parent has changed, the
- * <code>relatedNode</code> is the changed parent. If an event is
- * instead dispatched to a subtree indicating a node was changed within
- * it, the <code>relatedNode</code> is the changed node. In the case of
- * the DOMAttrModified event it indicates the <code>Attr</code> node
- * which was modified, added, or removed.
- */
- public Node getRelatedNode();
-
- /**
- * <code>prevValue</code> indicates the previous value of the
- * <code>Attr</code> node in DOMAttrModified events, and of the
- * <code>CharacterData</code> node in DOMCharacterDataModified events.
- */
- public String getPrevValue();
-
- /**
- * <code>newValue</code> indicates the new value of the <code>Attr</code>
- * node in DOMAttrModified events, and of the <code>CharacterData</code>
- * node in DOMCharacterDataModified events.
- */
- public String getNewValue();
-
- /**
- * <code>attrName</code> indicates the name of the changed
- * <code>Attr</code> node in a DOMAttrModified event.
- */
- public String getAttrName();
-
- /**
- * <code>attrChange</code> indicates the type of change which triggered
- * the DOMAttrModified event. The values can be <code>MODIFICATION</code>
- * , <code>ADDITION</code>, or <code>REMOVAL</code>.
- */
- public short getAttrChange();
-
- /**
- * The <code>initMutationEvent</code> method is used to initialize the
- * value of a <code>MutationEvent</code> created through the
- * <code>DocumentEvent</code> interface. This method may only be called
- * before the <code>MutationEvent</code> has been dispatched via the
- * <code>dispatchEvent</code> method, though it may be called multiple
- * times during that phase if necessary. If called multiple times, the
- * final invocation takes precedence.
- * @param typeArg Specifies the event type.
- * @param canBubbleArg Specifies whether or not the event can bubble.
- * @param cancelableArg Specifies whether or not the event's default
- * action can be prevented.
- * @param relatedNodeArg Specifies the <code>Event</code>'s related Node.
- * @param prevValueArg Specifies the <code>Event</code>'s
- * <code>prevValue</code> attribute. This value may be null.
- * @param newValueArg Specifies the <code>Event</code>'s
- * <code>newValue</code> attribute. This value may be null.
- * @param attrNameArg Specifies the <code>Event</code>'s
- * <code>attrName</code> attribute. This value may be null.
- * @param attrChangeArg Specifies the <code>Event</code>'s
- * <code>attrChange</code> attribute
- */
- public void initMutationEvent(String typeArg,
- boolean canBubbleArg,
- boolean cancelableArg,
- Node relatedNodeArg,
- String prevValueArg,
- String newValueArg,
- String attrNameArg,
- short attrChangeArg);
-
-}
diff --git a/src/org/w3c/dom/events/UIEvent.java b/src/org/w3c/dom/events/UIEvent.java
deleted file mode 100644
index 0931c5f..0000000
--- a/src/org/w3c/dom/events/UIEvent.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.events;
-
-import org.w3c.dom.views.AbstractView;
-
-/**
- * The <code>UIEvent</code> interface provides specific contextual information
- * associated with User Interface events.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113'>Document Object Model (DOM) Level 2 Events Specification</a>.
- * @since DOM Level 2
- */
-public interface UIEvent extends Event {
- /**
- * The <code>view</code> attribute identifies the <code>AbstractView</code>
- * from which the event was generated.
- */
- public AbstractView getView();
-
- /**
- * Specifies some detail information about the <code>Event</code>,
- * depending on the type of event.
- */
- public int getDetail();
-
- /**
- * The <code>initUIEvent</code> method is used to initialize the value of
- * a <code>UIEvent</code> created through the <code>DocumentEvent</code>
- * interface. This method may only be called before the
- * <code>UIEvent</code> has been dispatched via the
- * <code>dispatchEvent</code> method, though it may be called multiple
- * times during that phase if necessary. If called multiple times, the
- * final invocation takes precedence.
- * @param typeArg Specifies the event type.
- * @param canBubbleArg Specifies whether or not the event can bubble.
- * @param cancelableArg Specifies whether or not the event's default
- * action can be prevented.
- * @param viewArg Specifies the <code>Event</code>'s
- * <code>AbstractView</code>.
- * @param detailArg Specifies the <code>Event</code>'s detail.
- */
- public void initUIEvent(String typeArg,
- boolean canBubbleArg,
- boolean cancelableArg,
- AbstractView viewArg,
- int detailArg);
-
-}
diff --git a/src/org/w3c/dom/html/HTMLAnchorElement.java b/src/org/w3c/dom/html/HTMLAnchorElement.java
deleted file mode 100644
index 8e4f6e7..0000000
--- a/src/org/w3c/dom/html/HTMLAnchorElement.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-/**
- * The anchor element. See the A element definition in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLAnchorElement extends HTMLElement {
- /**
- * A single character access key to give access to the form control. See
- * the accesskey attribute definition in HTML 4.0.
- */
- public String getAccessKey();
- public void setAccessKey(String accessKey);
-
- /**
- * The character encoding of the linked resource. See the charset
- * attribute definition in HTML 4.0.
- */
- public String getCharset();
- public void setCharset(String charset);
-
- /**
- * Comma-separated list of lengths, defining an active region geometry.
- * See also <code>shape</code> for the shape of the region. See the
- * coords attribute definition in HTML 4.0.
- */
- public String getCoords();
- public void setCoords(String coords);
-
- /**
- * The URI of the linked resource. See the href attribute definition in
- * HTML 4.0.
- */
- public String getHref();
- public void setHref(String href);
-
- /**
- * Language code of the linked resource. See the hreflang attribute
- * definition in HTML 4.0.
- */
- public String getHreflang();
- public void setHreflang(String hreflang);
-
- /**
- * Anchor name. See the name attribute definition in HTML 4.0.
- */
- public String getName();
- public void setName(String name);
-
- /**
- * Forward link type. See the rel attribute definition in HTML 4.0.
- */
- public String getRel();
- public void setRel(String rel);
-
- /**
- * Reverse link type. See the rev attribute definition in HTML 4.0.
- */
- public String getRev();
- public void setRev(String rev);
-
- /**
- * The shape of the active area. The coordinates are given by
- * <code>coords</code> . See the shape attribute definition in HTML 4.0.
- */
- public String getShape();
- public void setShape(String shape);
-
- /**
- * Index that represents the element's position in the tabbing order. See
- * the tabindex attribute definition in HTML 4.0.
- */
- public int getTabIndex();
- public void setTabIndex(int tabIndex);
-
- /**
- * Frame to render the resource in. See the target attribute definition
- * in HTML 4.0.
- */
- public String getTarget();
- public void setTarget(String target);
-
- /**
- * Advisory content type. See the type attribute definition in HTML 4.0.
- */
- public String getType();
- public void setType(String type);
-
- /**
- * Removes keyboard focus from this element.
- */
- public void blur();
-
- /**
- * Gives keyboard focus to this element.
- */
- public void focus();
-
-}
diff --git a/src/org/w3c/dom/html/HTMLAppletElement.java b/src/org/w3c/dom/html/HTMLAppletElement.java
deleted file mode 100644
index d159319..0000000
--- a/src/org/w3c/dom/html/HTMLAppletElement.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-/**
- * An embedded Java applet. See the APPLET element definition in HTML 4.0.
- * This element is deprecated in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLAppletElement extends HTMLElement {
- /**
- * Aligns this object (vertically or horizontally) with respect to its
- * surrounding text. See the align attribute definition in HTML 4.0.
- * This attribute is deprecated in HTML 4.0.
- */
- public String getAlign();
- public void setAlign(String align);
-
- /**
- * Alternate text for user agents not rendering the normal content of
- * this element. See the alt attribute definition in HTML 4.0. This
- * attribute is deprecated in HTML 4.0.
- */
- public String getAlt();
- public void setAlt(String alt);
-
- /**
- * Comma-separated archive list. See the archive attribute definition in
- * HTML 4.0. This attribute is deprecated in HTML 4.0.
- */
- public String getArchive();
- public void setArchive(String archive);
-
- /**
- * Applet class file. See the code attribute definition in HTML 4.0.
- * This attribute is deprecated in HTML 4.0.
- */
- public String getCode();
- public void setCode(String code);
-
- /**
- * Optional base URI for applet. See the codebase attribute definition
- * in HTML 4.0. This attribute is deprecated in HTML 4.0.
- */
- public String getCodeBase();
- public void setCodeBase(String codeBase);
-
- /**
- * Override height. See the height attribute definition in HTML 4.0.
- * This attribute is deprecated in HTML 4.0.
- */
- public String getHeight();
- public void setHeight(String height);
-
- /**
- * Horizontal space to the left and right of this image, applet, or
- * object. See the hspace attribute definition in HTML 4.0. This
- * attribute is deprecated in HTML 4.0.
- */
- public String getHspace();
- public void setHspace(String hspace);
-
- /**
- * The name of the applet. See the name attribute definition in HTML
- * 4.0. This attribute is deprecated in HTML 4.0.
- */
- public String getName();
- public void setName(String name);
-
- /**
- * Serialized applet file. See the object attribute definition in HTML
- * 4.0. This attribute is deprecated in HTML 4.0.
- */
- public String getObject();
- public void setObject(String object);
-
- /**
- * Vertical space above and below this image, applet, or object. See the
- * vspace attribute definition in HTML 4.0. This attribute is deprecated
- * in HTML 4.0.
- */
- public String getVspace();
- public void setVspace(String vspace);
-
- /**
- * Override width. See the width attribute definition in HTML 4.0. This
- * attribute is deprecated in HTML 4.0.
- */
- public String getWidth();
- public void setWidth(String width);
-
-}
diff --git a/src/org/w3c/dom/html/HTMLAreaElement.java b/src/org/w3c/dom/html/HTMLAreaElement.java
deleted file mode 100644
index f51cc31..0000000
--- a/src/org/w3c/dom/html/HTMLAreaElement.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-/**
- * Client-side image map area definition. See the AREA element definition in
- * HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLAreaElement extends HTMLElement {
- /**
- * A single character access key to give access to the form control. See
- * the accesskey attribute definition in HTML 4.0.
- */
- public String getAccessKey();
- public void setAccessKey(String accessKey);
-
- /**
- * Alternate text for user agents not rendering the normal content of
- * this element. See the alt attribute definition in HTML 4.0.
- */
- public String getAlt();
- public void setAlt(String alt);
-
- /**
- * Comma-separated list of lengths, defining an active region geometry.
- * See also <code>shape</code> for the shape of the region. See the
- * coords attribute definition in HTML 4.0.
- */
- public String getCoords();
- public void setCoords(String coords);
-
- /**
- * The URI of the linked resource. See the href attribute definition in
- * HTML 4.0.
- */
- public String getHref();
- public void setHref(String href);
-
- /**
- * Specifies that this area is inactive, i.e., has no associated action.
- * See the nohref attribute definition in HTML 4.0.
- */
- public boolean getNoHref();
- public void setNoHref(boolean noHref);
-
- /**
- * The shape of the active area. The coordinates are given by
- * <code>coords</code> . See the shape attribute definition in HTML 4.0.
- */
- public String getShape();
- public void setShape(String shape);
-
- /**
- * Index that represents the element's position in the tabbing order. See
- * the tabindex attribute definition in HTML 4.0.
- */
- public int getTabIndex();
- public void setTabIndex(int tabIndex);
-
- /**
- * Frame to render the resource in. See the target attribute definition
- * in HTML 4.0.
- */
- public String getTarget();
- public void setTarget(String target);
-
-}
diff --git a/src/org/w3c/dom/html/HTMLBRElement.java b/src/org/w3c/dom/html/HTMLBRElement.java
deleted file mode 100644
index f35212f..0000000
--- a/src/org/w3c/dom/html/HTMLBRElement.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-/**
- * Force a line break. See the BR element definition in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLBRElement extends HTMLElement {
- /**
- * Control flow of text around floats. See the clear attribute definition
- * in HTML 4.0. This attribute is deprecated in HTML 4.0.
- */
- public String getClear();
- public void setClear(String clear);
-
-}
diff --git a/src/org/w3c/dom/html/HTMLBaseElement.java b/src/org/w3c/dom/html/HTMLBaseElement.java
deleted file mode 100644
index 69f518b..0000000
--- a/src/org/w3c/dom/html/HTMLBaseElement.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-/**
- * Document base URI. See the BASE element definition in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLBaseElement extends HTMLElement {
- /**
- * The base URI. See the href attribute definition in HTML 4.0.
- */
- public String getHref();
- public void setHref(String href);
-
- /**
- * The default target frame. See the target attribute definition in HTML
- * 4.0.
- */
- public String getTarget();
- public void setTarget(String target);
-
-}
diff --git a/src/org/w3c/dom/html/HTMLBaseFontElement.java b/src/org/w3c/dom/html/HTMLBaseFontElement.java
deleted file mode 100644
index 68ed611..0000000
--- a/src/org/w3c/dom/html/HTMLBaseFontElement.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-/**
- * Base font. See the BASEFONT element definition in HTML 4.0. This element
- * is deprecated in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLBaseFontElement extends HTMLElement {
- /**
- * Font color. See the color attribute definition in HTML 4.0. This
- * attribute is deprecated in HTML 4.0.
- */
- public String getColor();
- public void setColor(String color);
-
- /**
- * Font face identifier. See the face attribute definition in HTML 4.0.
- * This attribute is deprecated in HTML 4.0.
- */
- public String getFace();
- public void setFace(String face);
-
- /**
- * Font size. See the size attribute definition in HTML 4.0. This
- * attribute is deprecated in HTML 4.0.
- */
- public String getSize();
- public void setSize(String size);
-
-}
diff --git a/src/org/w3c/dom/html/HTMLBodyElement.java b/src/org/w3c/dom/html/HTMLBodyElement.java
deleted file mode 100644
index d0f2e45..0000000
--- a/src/org/w3c/dom/html/HTMLBodyElement.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-/**
- * The HTML document body. This element is always present in the DOM API,
- * even if the tags are not present in the source document. See the BODY
- * element definition in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLBodyElement extends HTMLElement {
- /**
- * Color of active links (after mouse-button down, but before
- * mouse-button up). See the alink attribute definition in HTML 4.0.
- * This attribute is deprecated in HTML 4.0.
- */
- public String getALink();
- public void setALink(String aLink);
-
- /**
- * URI of the background texture tile image. See the background
- * attribute definition in HTML 4.0. This attribute is deprecated in HTML
- * 4.0.
- */
- public String getBackground();
- public void setBackground(String background);
-
- /**
- * Document background color. See the bgcolor attribute definition in
- * HTML 4.0. This attribute is deprecated in HTML 4.0.
- */
- public String getBgColor();
- public void setBgColor(String bgColor);
-
- /**
- * Color of links that are not active and unvisited. See the link
- * attribute definition in HTML 4.0. This attribute is deprecated in HTML
- * 4.0.
- */
- public String getLink();
- public void setLink(String link);
-
- /**
- * Document text color. See the text attribute definition in HTML 4.0.
- * This attribute is deprecated in HTML 4.0.
- */
- public String getText();
- public void setText(String text);
-
- /**
- * Color of links that have been visited by the user. See the vlink
- * attribute definition in HTML 4.0. This attribute is deprecated in HTML
- * 4.0.
- */
- public String getVLink();
- public void setVLink(String vLink);
-
-}
diff --git a/src/org/w3c/dom/html/HTMLButtonElement.java b/src/org/w3c/dom/html/HTMLButtonElement.java
deleted file mode 100644
index 8d45dbf..0000000
--- a/src/org/w3c/dom/html/HTMLButtonElement.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-/**
- * Push button. See the BUTTON element definition in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLButtonElement extends HTMLElement {
- /**
- * Returns the <code>FORM</code> element containing this control. Returns
- * <code>null</code> if this control is not within the context of a form.
- */
- public HTMLFormElement getForm();
-
- /**
- * A single character access key to give access to the form control. See
- * the accesskey attribute definition in HTML 4.0.
- */
- public String getAccessKey();
- public void setAccessKey(String accessKey);
-
- /**
- * The control is unavailable in this context. See the disabled
- * attribute definition in HTML 4.0.
- */
- public boolean getDisabled();
- public void setDisabled(boolean disabled);
-
- /**
- * Form control or object name when submitted with a form. See the name
- * attribute definition in HTML 4.0.
- */
- public String getName();
- public void setName(String name);
-
- /**
- * Index that represents the element's position in the tabbing order. See
- * the tabindex attribute definition in HTML 4.0.
- */
- public int getTabIndex();
- public void setTabIndex(int tabIndex);
-
- /**
- * The type of button. See the type attribute definition in HTML 4.0.
- */
- public String getType();
-
- /**
- * The current form control value. See the value attribute definition in
- * HTML 4.0.
- */
- public String getValue();
- public void setValue(String value);
-
-}
diff --git a/src/org/w3c/dom/html/HTMLCollection.java b/src/org/w3c/dom/html/HTMLCollection.java
deleted file mode 100644
index 1c87fd9..0000000
--- a/src/org/w3c/dom/html/HTMLCollection.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-import org.w3c.dom.Node;
-
-/**
- * An <code>HTMLCollection</code> is a list of nodes. An individual node may
- * be accessed by either ordinal index or the node's<code>name</code> or
- * <code>id</code> attributes. Note: Collections in the HTML DOM are assumed
- * to be live meaning that they are automatically updated when the
- * underlying document is changed.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLCollection {
- /**
- * This attribute specifies the length or size of the list.
- */
- public int getLength();
-
- /**
- * This method retrieves a node specified by ordinal index. Nodes are
- * numbered in tree order (depth-first traversal order).
- * @param index The index of the node to be fetched. The index origin is
- * 0.
- * @return The <code>Node</code> at the corresponding position upon
- * success. A value of <code>null</code> is returned if the index is
- * out of range.
- */
- public Node item(int index);
-
- /**
- * This method retrieves a <code>Node</code> using a name. It first
- * searches for a <code>Node</code> with a matching <code>id</code>
- * attribute. If it doesn't find one, it then searches for a
- * <code>Node</code> with a matching <code>name</code> attribute, but
- * only on those elements that are allowed a name attribute.
- * @param name The name of the <code>Node</code> to be fetched.
- * @return The <code>Node</code> with a <code>name</code> or
- * <code>id</code> attribute whose value corresponds to the specified
- * string. Upon failure (e.g., no node with this name exists), returns
- * <code>null</code> .
- */
- public Node namedItem(String name);
-
-}
diff --git a/src/org/w3c/dom/html/HTMLDListElement.java b/src/org/w3c/dom/html/HTMLDListElement.java
deleted file mode 100644
index 8e0dad9..0000000
--- a/src/org/w3c/dom/html/HTMLDListElement.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-/**
- * Definition list. See the DL element definition in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLDListElement extends HTMLElement {
- /**
- * Reduce spacing between list items. See the compact attribute
- * definition in HTML 4.0. This attribute is deprecated in HTML 4.0.
- */
- public boolean getCompact();
- public void setCompact(boolean compact);
-
-}
diff --git a/src/org/w3c/dom/html/HTMLDOMImplementation.java b/src/org/w3c/dom/html/HTMLDOMImplementation.java
deleted file mode 100644
index 4d15541..0000000
--- a/src/org/w3c/dom/html/HTMLDOMImplementation.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-import org.w3c.dom.DOMImplementation;
-
-/**
- * The <code>HTMLDOMImplementation</code> interface extends the
- * <code>DOMImplementation</code> interface with a method for creating an
- * HTML document instance.
- * @since DOM Level 2
- */
-public interface HTMLDOMImplementation extends DOMImplementation {
- /**
- * Creates an <code>HTMLDocument</code> object with the minimal tree made
- * of the following elements: <code>HTML</code> , <code>HEAD</code> ,
- * <code>TITLE</code> , and <code>BODY</code> .
- * @param title The title of the document to be set as the content of the
- * <code>TITLE</code> element, through a child <code>Text</code> node.
- * @return A new <code>HTMLDocument</code> object.
- */
- public HTMLDocument createHTMLDocument(String title);
-
-}
diff --git a/src/org/w3c/dom/html/HTMLDirectoryElement.java b/src/org/w3c/dom/html/HTMLDirectoryElement.java
deleted file mode 100644
index 0fb3390..0000000
--- a/src/org/w3c/dom/html/HTMLDirectoryElement.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-/**
- * Directory list. See the DIR element definition in HTML 4.0. This element
- * is deprecated in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLDirectoryElement extends HTMLElement {
- /**
- * Reduce spacing between list items. See the compact attribute
- * definition in HTML 4.0. This attribute is deprecated in HTML 4.0.
- */
- public boolean getCompact();
- public void setCompact(boolean compact);
-
-}
diff --git a/src/org/w3c/dom/html/HTMLDivElement.java b/src/org/w3c/dom/html/HTMLDivElement.java
deleted file mode 100644
index ee1b727..0000000
--- a/src/org/w3c/dom/html/HTMLDivElement.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-/**
- * Generic block container. See the DIV element definition in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLDivElement extends HTMLElement {
- /**
- * Horizontal text alignment. See the align attribute definition in HTML
- * 4.0. This attribute is deprecated in HTML 4.0.
- */
- public String getAlign();
- public void setAlign(String align);
-
-}
diff --git a/src/org/w3c/dom/html/HTMLDocument.java b/src/org/w3c/dom/html/HTMLDocument.java
deleted file mode 100644
index 5116fc5..0000000
--- a/src/org/w3c/dom/html/HTMLDocument.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.NodeList;
-
-/**
- * An <code>HTMLDocument</code> is the root of the HTML hierarchy and holds
- * the entire content. Besides providing access to the hierarchy, it also
- * provides some convenience methods for accessing certain sets of
- * information from the document.
- * <p> The following properties have been deprecated in favor of the
- * corresponding ones for the <code>BODY</code> element: alinkColor background
- * bgColor fgColor linkColor vlinkColor In DOM Level 2, the method
- * <code>getElementById</code> is inherited from the <code>Document</code>
- * interface where it was moved.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLDocument extends Document {
- /**
- * The title of a document as specified by the <code>TITLE</code> element
- * in the head of the document.
- */
- public String getTitle();
- public void setTitle(String title);
-
- /**
- * Returns the URI of the page that linked to this page. The value is an
- * empty string if the user navigated to the page directly (not through a
- * link, but, for example, via a bookmark).
- */
- public String getReferrer();
-
- /**
- * The domain name of the server that served the document, or
- * <code>null</code> if the server cannot be identified by a domain name.
- */
- public String getDomain();
-
- /**
- * The complete URI of the document.
- */
- public String getURL();
-
- /**
- * The element that contains the content for the document. In documents
- * with <code>BODY</code> contents, returns the <code>BODY</code>
- * element. In frameset documents, this returns the outermost
- * <code>FRAMESET</code> element.
- */
- public HTMLElement getBody();
- public void setBody(HTMLElement body);
-
- /**
- * A collection of all the <code>IMG</code> elements in a document. The
- * behavior is limited to <code>IMG</code> elements for backwards
- * compatibility.
- */
- public HTMLCollection getImages();
-
- /**
- * A collection of all the <code>OBJECT</code> elements that include
- * applets and <code>APPLET</code> ( deprecated ) elements in a document.
- */
- public HTMLCollection getApplets();
-
- /**
- * A collection of all <code>AREA</code> elements and anchor (
- * <code>A</code> ) elements in a document with a value for the
- * <code>href</code> attribute.
- */
- public HTMLCollection getLinks();
-
- /**
- * A collection of all the forms of a document.
- */
- public HTMLCollection getForms();
-
- /**
- * A collection of all the anchor (<code>A</code> ) elements in a document
- * with a value for the <code>name</code> attribute. Note. For reasons
- * of backwards compatibility, the returned set of anchors only contains
- * those anchors created with the <code>name</code> attribute, not those
- * created with the <code>id</code> attribute.
- */
- public HTMLCollection getAnchors();
-
- /**
- * The cookies associated with this document. If there are none, the
- * value is an empty string. Otherwise, the value is a string: a
- * semicolon-delimited list of "name, value" pairs for all the cookies
- * associated with the page. For example,
- * <code>name=value;expires=date</code> .
- */
- public String getCookie();
- public void setCookie(String cookie);
-
- /**
- * Note. This method and the ones following allow a user to add to or
- * replace the structure model of a document using strings of unparsed
- * HTML. At the time of writing alternate methods for providing similar
- * functionality for both HTML and XML documents were being considered.
- * The following methods may be deprecated at some point in the future in
- * favor of a more general-purpose mechanism.
- * <br> Open a document stream for writing. If a document exists in the
- * target, this method clears it.
- */
- public void open();
-
- /**
- * Closes a document stream opened by <code>open()</code> and forces
- * rendering.
- */
- public void close();
-
- /**
- * Write a string of text to a document stream opened by
- * <code>open()</code> . The text is parsed into the document's structure
- * model.
- * @param text The string to be parsed into some structure in the
- * document structure model.
- */
- public void write(String text);
-
- /**
- * Write a string of text followed by a newline character to a document
- * stream opened by <code>open()</code> . The text is parsed into the
- * document's structure model.
- * @param text The string to be parsed into some structure in the
- * document structure model.
- */
- public void writeln(String text);
-
- /**
- * Returns the (possibly empty) collection of elements whose
- * <code>name</code> value is given by <code>elementName</code> .
- * @param elementName The <code>name</code> attribute value for an
- * element.
- * @return The matching elements.
- */
- public NodeList getElementsByName(String elementName);
-
-}
diff --git a/src/org/w3c/dom/html/HTMLElement.java b/src/org/w3c/dom/html/HTMLElement.java
deleted file mode 100644
index b5b178a..0000000
--- a/src/org/w3c/dom/html/HTMLElement.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-import org.w3c.dom.Element;
-
-/**
- * All HTML element interfaces derive from this class. Elements that only
- * expose the HTML core attributes are represented by the base
- * <code>HTMLElement</code> interface. These elements are as follows: HEAD
- * special: SUB, SUP, SPAN, BDO font: TT, I, B, U, S, STRIKE, BIG, SMALL
- * phrase: EM, STRONG, DFN, CODE, SAMP, KBD, VAR, CITE, ACRONYM, ABBR list:
- * DD, DT NOFRAMES, NOSCRIPT ADDRESS, CENTER The <code>style</code> attribute
- * of an HTML element is accessible through the
- * <code>ElementCSSInlineStyle</code> interface which is defined in the .
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLElement extends Element {
- /**
- * The element's identifier. See the id attribute definition in HTML 4.0.
- */
- public String getId();
- public void setId(String id);
-
- /**
- * The element's advisory title. See the title attribute definition in
- * HTML 4.0.
- */
- public String getTitle();
- public void setTitle(String title);
-
- /**
- * Language code defined in RFC 1766. See the lang attribute definition
- * in HTML 4.0.
- */
- public String getLang();
- public void setLang(String lang);
-
- /**
- * Specifies the base direction of directionally neutral text and the
- * directionality of tables. See the dir attribute definition in HTML
- * 4.0.
- */
- public String getDir();
- public void setDir(String dir);
-
- /**
- * The class attribute of the element. This attribute has been renamed
- * due to conflicts with the "class" keyword exposed by many languages.
- * See the class attribute definition in HTML 4.0.
- */
- public String getClassName();
- public void setClassName(String className);
-
-}
diff --git a/src/org/w3c/dom/html/HTMLFieldSetElement.java b/src/org/w3c/dom/html/HTMLFieldSetElement.java
deleted file mode 100644
index cb2c0bd..0000000
--- a/src/org/w3c/dom/html/HTMLFieldSetElement.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-/**
- * Organizes form controls into logical groups. See the FIELDSET element
- * definition in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLFieldSetElement extends HTMLElement {
- /**
- * Returns the <code>FORM</code> element containing this control. Returns
- * <code>null</code> if this control is not within the context of a form.
- */
- public HTMLFormElement getForm();
-
-}
diff --git a/src/org/w3c/dom/html/HTMLFontElement.java b/src/org/w3c/dom/html/HTMLFontElement.java
deleted file mode 100644
index c8fc157..0000000
--- a/src/org/w3c/dom/html/HTMLFontElement.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-/**
- * Local change to font. See the FONT element definition in HTML 4.0. This
- * element is deprecated in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLFontElement extends HTMLElement {
- /**
- * Font color. See the color attribute definition in HTML 4.0. This
- * attribute is deprecated in HTML 4.0.
- */
- public String getColor();
- public void setColor(String color);
-
- /**
- * Font face identifier. See the face attribute definition in HTML 4.0.
- * This attribute is deprecated in HTML 4.0.
- */
- public String getFace();
- public void setFace(String face);
-
- /**
- * Font size. See the size attribute definition in HTML 4.0. This
- * attribute is deprecated in HTML 4.0.
- */
- public String getSize();
- public void setSize(String size);
-
-}
diff --git a/src/org/w3c/dom/html/HTMLFormElement.java b/src/org/w3c/dom/html/HTMLFormElement.java
deleted file mode 100644
index 42e2edd..0000000
--- a/src/org/w3c/dom/html/HTMLFormElement.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-/**
- * The <code>FORM</code> element encompasses behavior similar to a collection
- * and an element. It provides direct access to the contained input elements
- * as well as the attributes of the form element. See the FORM element
- * definition in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLFormElement extends HTMLElement {
- /**
- * Returns a collection of all control elements in the form.
- */
- public HTMLCollection getElements();
-
- /**
- * The number of form controls in the form.
- */
- public int getLength();
-
- /**
- * Names the form.
- */
- public String getName();
- public void setName(String name);
-
- /**
- * List of character sets supported by the server. See the
- * accept-charset attribute definition in HTML 4.0.
- */
- public String getAcceptCharset();
- public void setAcceptCharset(String acceptCharset);
-
- /**
- * Server-side form handler. See the action attribute definition in HTML
- * 4.0.
- */
- public String getAction();
- public void setAction(String action);
-
- /**
- * The content type of the submitted form, generally
- * "application/x-www-form-urlencoded". See the enctype attribute
- * definition in HTML 4.0.
- */
- public String getEnctype();
- public void setEnctype(String enctype);
-
- /**
- * HTTP method used to submit form. See the method attribute definition
- * in HTML 4.0.
- */
- public String getMethod();
- public void setMethod(String method);
-
- /**
- * Frame to render the resource in. See the target attribute definition
- * in HTML 4.0.
- */
- public String getTarget();
- public void setTarget(String target);
-
- /**
- * Submits the form. It performs the same action as a submit button.
- */
- public void submit();
-
- /**
- * Restores a form element's default values. It performs the same action
- * as a reset button.
- */
- public void reset();
-
-}
diff --git a/src/org/w3c/dom/html/HTMLFrameElement.java b/src/org/w3c/dom/html/HTMLFrameElement.java
deleted file mode 100644
index 5ffa425..0000000
--- a/src/org/w3c/dom/html/HTMLFrameElement.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-import org.w3c.dom.Document;
-
-/**
- * Create a frame. See the FRAME element definition in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLFrameElement extends HTMLElement {
- /**
- * Request frame borders. See the frameborder attribute definition in
- * HTML 4.0.
- */
- public String getFrameBorder();
- public void setFrameBorder(String frameBorder);
-
- /**
- * URI designating a long description of this image or frame. See the
- * longdesc attribute definition in HTML 4.0.
- */
- public String getLongDesc();
- public void setLongDesc(String longDesc);
-
- /**
- * Frame margin height, in pixels. See the marginheight attribute
- * definition in HTML 4.0.
- */
- public String getMarginHeight();
- public void setMarginHeight(String marginHeight);
-
- /**
- * Frame margin width, in pixels. See the marginwidth attribute
- * definition in HTML 4.0.
- */
- public String getMarginWidth();
- public void setMarginWidth(String marginWidth);
-
- /**
- * The frame name (object of the <code>target</code> attribute). See the
- * name attribute definition in HTML 4.0.
- */
- public String getName();
- public void setName(String name);
-
- /**
- * When true, forbid user from resizing frame. See the noresize
- * attribute definition in HTML 4.0.
- */
- public boolean getNoResize();
- public void setNoResize(boolean noResize);
-
- /**
- * Specify whether or not the frame should have scrollbars. See the
- * scrolling attribute definition in HTML 4.0.
- */
- public String getScrolling();
- public void setScrolling(String scrolling);
-
- /**
- * A URI designating the initial frame contents. See the src attribute
- * definition in HTML 4.0.
- */
- public String getSrc();
- public void setSrc(String src);
-
- /**
- * The document this frame contains, if there is any and it is available,
- * or <code>null</code> otherwise.
- * @since DOM Level 2
- */
- public Document getContentDocument();
-
-}
diff --git a/src/org/w3c/dom/html/HTMLFrameSetElement.java b/src/org/w3c/dom/html/HTMLFrameSetElement.java
deleted file mode 100644
index fb6f7e9..0000000
--- a/src/org/w3c/dom/html/HTMLFrameSetElement.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-/**
- * Create a grid of frames. See the FRAMESET element definition in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLFrameSetElement extends HTMLElement {
- /**
- * The number of columns of frames in the frameset. See the cols
- * attribute definition in HTML 4.0.
- */
- public String getCols();
- public void setCols(String cols);
-
- /**
- * The number of rows of frames in the frameset. See the rows attribute
- * definition in HTML 4.0.
- */
- public String getRows();
- public void setRows(String rows);
-
-}
diff --git a/src/org/w3c/dom/html/HTMLHRElement.java b/src/org/w3c/dom/html/HTMLHRElement.java
deleted file mode 100644
index 334c04d..0000000
--- a/src/org/w3c/dom/html/HTMLHRElement.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-/**
- * Create a horizontal rule. See the HR element definition in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLHRElement extends HTMLElement {
- /**
- * Align the rule on the page. See the align attribute definition in
- * HTML 4.0. This attribute is deprecated in HTML 4.0.
- */
- public String getAlign();
- public void setAlign(String align);
-
- /**
- * Indicates to the user agent that there should be no shading in the
- * rendering of this element. See the noshade attribute definition in
- * HTML 4.0. This attribute is deprecated in HTML 4.0.
- */
- public boolean getNoShade();
- public void setNoShade(boolean noShade);
-
- /**
- * The height of the rule. See the size attribute definition in HTML
- * 4.0. This attribute is deprecated in HTML 4.0.
- */
- public String getSize();
- public void setSize(String size);
-
- /**
- * The width of the rule. See the width attribute definition in HTML
- * 4.0. This attribute is deprecated in HTML 4.0.
- */
- public String getWidth();
- public void setWidth(String width);
-
-}
diff --git a/src/org/w3c/dom/html/HTMLHeadElement.java b/src/org/w3c/dom/html/HTMLHeadElement.java
deleted file mode 100644
index 8894d32..0000000
--- a/src/org/w3c/dom/html/HTMLHeadElement.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-/**
- * Document head information. See the HEAD element definition in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLHeadElement extends HTMLElement {
- /**
- * URI designating a metadata profile. See the profile attribute
- * definition in HTML 4.0.
- */
- public String getProfile();
- public void setProfile(String profile);
-
-}
diff --git a/src/org/w3c/dom/html/HTMLHeadingElement.java b/src/org/w3c/dom/html/HTMLHeadingElement.java
deleted file mode 100644
index 0cd4efe..0000000
--- a/src/org/w3c/dom/html/HTMLHeadingElement.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-/**
- * For the <code>H1</code> to <code>H6</code> elements. See the H1 element
- * definition in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLHeadingElement extends HTMLElement {
- /**
- * Horizontal text alignment. See the align attribute definition in HTML
- * 4.0. This attribute is deprecated in HTML 4.0.
- */
- public String getAlign();
- public void setAlign(String align);
-
-}
diff --git a/src/org/w3c/dom/html/HTMLHtmlElement.java b/src/org/w3c/dom/html/HTMLHtmlElement.java
deleted file mode 100644
index a2fa379..0000000
--- a/src/org/w3c/dom/html/HTMLHtmlElement.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-/**
- * Root of an HTML document. See the HTML element definition in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLHtmlElement extends HTMLElement {
- /**
- * Version information about the document's DTD. See the version
- * attribute definition in HTML 4.0. This attribute is deprecated in HTML
- * 4.0.
- */
- public String getVersion();
- public void setVersion(String version);
-
-}
diff --git a/src/org/w3c/dom/html/HTMLIFrameElement.java b/src/org/w3c/dom/html/HTMLIFrameElement.java
deleted file mode 100644
index 08c1988..0000000
--- a/src/org/w3c/dom/html/HTMLIFrameElement.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-import org.w3c.dom.Document;
-
-/**
- * Inline subwindows. See the IFRAME element definition in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLIFrameElement extends HTMLElement {
- /**
- * Aligns this object (vertically or horizontally) with respect to its
- * surrounding text. See the align attribute definition in HTML 4.0.
- * This attribute is deprecated in HTML 4.0.
- */
- public String getAlign();
- public void setAlign(String align);
-
- /**
- * Request frame borders. See the frameborder attribute definition in
- * HTML 4.0.
- */
- public String getFrameBorder();
- public void setFrameBorder(String frameBorder);
-
- /**
- * Frame height. See the height attribute definition in HTML 4.0.
- */
- public String getHeight();
- public void setHeight(String height);
-
- /**
- * URI designating a long description of this image or frame. See the
- * longdesc attribute definition in HTML 4.0.
- */
- public String getLongDesc();
- public void setLongDesc(String longDesc);
-
- /**
- * Frame margin height, in pixels. See the marginheight attribute
- * definition in HTML 4.0.
- */
- public String getMarginHeight();
- public void setMarginHeight(String marginHeight);
-
- /**
- * Frame margin width, in pixels. See the marginwidth attribute
- * definition in HTML 4.0.
- */
- public String getMarginWidth();
- public void setMarginWidth(String marginWidth);
-
- /**
- * The frame name (object of the <code>target</code> attribute). See the
- * name attribute definition in HTML 4.0.
- */
- public String getName();
- public void setName(String name);
-
- /**
- * Specify whether or not the frame should have scrollbars. See the
- * scrolling attribute definition in HTML 4.0.
- */
- public String getScrolling();
- public void setScrolling(String scrolling);
-
- /**
- * A URI designating the initial frame contents. See the src attribute
- * definition in HTML 4.0.
- */
- public String getSrc();
- public void setSrc(String src);
-
- /**
- * Frame width. See the width attribute definition in HTML 4.0.
- */
- public String getWidth();
- public void setWidth(String width);
-
- /**
- * The document this frame contains, if there is any and it is available,
- * or <code>null</code> otherwise.
- * @since DOM Level 2
- */
- public Document getContentDocument();
-
-}
diff --git a/src/org/w3c/dom/html/HTMLImageElement.java b/src/org/w3c/dom/html/HTMLImageElement.java
deleted file mode 100644
index 7fced61..0000000
--- a/src/org/w3c/dom/html/HTMLImageElement.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-/**
- * Embedded image. See the IMG element definition in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLImageElement extends HTMLElement {
- /**
- * URI designating the source of this image, for low-resolution output.
- */
- public String getLowSrc();
- public void setLowSrc(String lowSrc);
-
- /**
- * The name of the element (for backwards compatibility).
- */
- public String getName();
- public void setName(String name);
-
- /**
- * Aligns this object (vertically or horizontally) with respect to its
- * surrounding text. See the align attribute definition in HTML 4.0.
- * This attribute is deprecated in HTML 4.0.
- */
- public String getAlign();
- public void setAlign(String align);
-
- /**
- * Alternate text for user agents not rendering the normal content of
- * this element. See the alt attribute definition in HTML 4.0.
- */
- public String getAlt();
- public void setAlt(String alt);
-
- /**
- * Width of border around image. See the border attribute definition in
- * HTML 4.0. This attribute is deprecated in HTML 4.0.
- */
- public String getBorder();
- public void setBorder(String border);
-
- /**
- * Override height. See the height attribute definition in HTML 4.0.
- */
- public String getHeight();
- public void setHeight(String height);
-
- /**
- * Horizontal space to the left and right of this image. See the hspace
- * attribute definition in HTML 4.0. This attribute is deprecated in HTML
- * 4.0.
- */
- public String getHspace();
- public void setHspace(String hspace);
-
- /**
- * Use server-side image map. See the ismap attribute definition in HTML
- * 4.0.
- */
- public boolean getIsMap();
- public void setIsMap(boolean isMap);
-
- /**
- * URI designating a long description of this image or frame. See the
- * longdesc attribute definition in HTML 4.0.
- */
- public String getLongDesc();
- public void setLongDesc(String longDesc);
-
- /**
- * URI designating the source of this image. See the src attribute
- * definition in HTML 4.0.
- */
- public String getSrc();
- public void setSrc(String src);
-
- /**
- * Use client-side image map. See the usemap attribute definition in
- * HTML 4.0.
- */
- public String getUseMap();
- public void setUseMap(String useMap);
-
- /**
- * Vertical space above and below this image. See the vspace attribute
- * definition in HTML 4.0. This attribute is deprecated in HTML 4.0.
- */
- public String getVspace();
- public void setVspace(String vspace);
-
- /**
- * Override width. See the width attribute definition in HTML 4.0.
- */
- public String getWidth();
- public void setWidth(String width);
-
-}
diff --git a/src/org/w3c/dom/html/HTMLInputElement.java b/src/org/w3c/dom/html/HTMLInputElement.java
deleted file mode 100644
index b58d8b8..0000000
--- a/src/org/w3c/dom/html/HTMLInputElement.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-/**
- * Form control. Note. Depending upon the environment in which the page is
- * being viewed, the value property may be read-only for the file upload
- * input type. For the "password" input type, the actual value returned may
- * be masked to prevent unauthorized use. See the INPUT element definition
- * in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLInputElement extends HTMLElement {
- /**
- * When the <code>type</code> attribute of the element has the value
- * "Text", "File" or "Password", this represents the HTML value attribute
- * of the element. The value of this attribute does not change if the
- * contents of the corresponding form control, in an interactive user
- * agent, changes. Changing this attribute, however, resets the contents
- * of the form control. See the value attribute definition in HTML 4.0.
- */
- public String getDefaultValue();
- public void setDefaultValue(String defaultValue);
-
- /**
- * When <code>type</code> has the value "Radio" or "Checkbox", this
- * represents the HTML checked attribute of the element. The value of
- * this attribute does not change if the state of the corresponding form
- * control, in an interactive user agent, changes. Changes to this
- * attribute, however, resets the state of the form control. See the
- * checked attribute definition in HTML 4.0.
- */
- public boolean getDefaultChecked();
- public void setDefaultChecked(boolean defaultChecked);
-
- /**
- * Returns the <code>FORM</code> element containing this control. Returns
- * <code>null</code> if this control is not within the context of a form.
- */
- public HTMLFormElement getForm();
-
- /**
- * A comma-separated list of content types that a server processing this
- * form will handle correctly. See the accept attribute definition in
- * HTML 4.0.
- */
- public String getAccept();
- public void setAccept(String accept);
-
- /**
- * A single character access key to give access to the form control. See
- * the accesskey attribute definition in HTML 4.0.
- */
- public String getAccessKey();
- public void setAccessKey(String accessKey);
-
- /**
- * Aligns this object (vertically or horizontally) with respect to its
- * surrounding text. See the align attribute definition in HTML 4.0.
- * This attribute is deprecated in HTML 4.0.
- */
- public String getAlign();
- public void setAlign(String align);
-
- /**
- * Alternate text for user agents not rendering the normal content of
- * this element. See the alt attribute definition in HTML 4.0.
- */
- public String getAlt();
- public void setAlt(String alt);
-
- /**
- * When the <code>type</code> attribute of the element has the value
- * "Radio" or "Checkbox", this represents the current state of the form
- * control, in an interactive user agent. Changes to this attribute
- * change the state of the form control, but do not change the value of
- * the HTML value attribute of the element.
- */
- public boolean getChecked();
- public void setChecked(boolean checked);
-
- /**
- * The control is unavailable in this context. See the disabled
- * attribute definition in HTML 4.0.
- */
- public boolean getDisabled();
- public void setDisabled(boolean disabled);
-
- /**
- * Maximum number of characters for text fields, when <code>type</code>
- * has the value "Text" or "Password". See the maxlength attribute
- * definition in HTML 4.0.
- */
- public int getMaxLength();
- public void setMaxLength(int maxLength);
-
- /**
- * Form control or object name when submitted with a form. See the name
- * attribute definition in HTML 4.0.
- */
- public String getName();
- public void setName(String name);
-
- /**
- * This control is read-only. Relevant only when <code>type</code> has
- * the value "Text" or "Password". See the readonly attribute definition
- * in HTML 4.0.
- */
- public boolean getReadOnly();
- public void setReadOnly(boolean readOnly);
-
- /**
- * Size information. The precise meaning is specific to each type of
- * field. See the size attribute definition in HTML 4.0.
- */
- public String getSize();
- public void setSize(String size);
-
- /**
- * When the <code>type</code> attribute has the value "Image", this
- * attribute specifies the location of the image to be used to decorate
- * the graphical submit button. See the src attribute definition in HTML
- * 4.0.
- */
- public String getSrc();
- public void setSrc(String src);
-
- /**
- * Index that represents the element's position in the tabbing order. See
- * the tabindex attribute definition in HTML 4.0.
- */
- public int getTabIndex();
- public void setTabIndex(int tabIndex);
-
- /**
- * The type of control created. See the type attribute definition in
- * HTML 4.0.
- */
- public String getType();
-
- /**
- * Use client-side image map. See the usemap attribute definition in
- * HTML 4.0.
- */
- public String getUseMap();
- public void setUseMap(String useMap);
-
- /**
- * When the <code>type</code> attribute of the element has the value
- * "Text", "File" or "Password", this represents the current contents of
- * the corresponding form control, in an interactive user agent. Changing
- * this attribute changes the contents of the form control, but does not
- * change the value of the HTML value attribute of the element. When the
- * <code>type</code> attribute of the element has the value "Button",
- * "Hidden", "Submit", "Reset", "Image", "Checkbox" or "Radio", this
- * represents the HTML value attribute of the element. See the value
- * attribute definition in HTML 4.0.
- */
- public String getValue();
- public void setValue(String value);
-
- /**
- * Removes keyboard focus from this element.
- */
- public void blur();
-
- /**
- * Gives keyboard focus to this element.
- */
- public void focus();
-
- /**
- * Select the contents of the text area. For <code>INPUT</code> elements
- * whose <code>type</code> attribute has one of the following values:
- * "Text", "File", or "Password".
- */
- public void select();
-
- /**
- * Simulate a mouse-click. For <code>INPUT</code> elements whose
- * <code>type</code> attribute has one of the following values: "Button",
- * "Checkbox", "Radio", "Reset", or "Submit".
- */
- public void click();
-
-}
diff --git a/src/org/w3c/dom/html/HTMLIsIndexElement.java b/src/org/w3c/dom/html/HTMLIsIndexElement.java
deleted file mode 100644
index 111edde..0000000
--- a/src/org/w3c/dom/html/HTMLIsIndexElement.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-/**
- * This element is used for single-line text input. See the ISINDEX element
- * definition in HTML 4.0. This element is deprecated in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLIsIndexElement extends HTMLElement {
- /**
- * Returns the <code>FORM</code> element containing this control. Returns
- * <code>null</code> if this control is not within the context of a form.
- */
- public HTMLFormElement getForm();
-
- /**
- * The prompt message. See the prompt attribute definition in HTML 4.0.
- * This attribute is deprecated in HTML 4.0.
- */
- public String getPrompt();
- public void setPrompt(String prompt);
-
-}
diff --git a/src/org/w3c/dom/html/HTMLLIElement.java b/src/org/w3c/dom/html/HTMLLIElement.java
deleted file mode 100644
index f4113f1..0000000
--- a/src/org/w3c/dom/html/HTMLLIElement.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-/**
- * List item. See the LI element definition in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLLIElement extends HTMLElement {
- /**
- * List item bullet style. See the type attribute definition in HTML
- * 4.0. This attribute is deprecated in HTML 4.0.
- */
- public String getType();
- public void setType(String type);
-
- /**
- * Reset sequence number when used in <code>OL</code> . See the value
- * attribute definition in HTML 4.0. This attribute is deprecated in HTML
- * 4.0.
- */
- public int getValue();
- public void setValue(int value);
-
-}
diff --git a/src/org/w3c/dom/html/HTMLLabelElement.java b/src/org/w3c/dom/html/HTMLLabelElement.java
deleted file mode 100644
index d3fd6be..0000000
--- a/src/org/w3c/dom/html/HTMLLabelElement.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-/**
- * Form field label text. See the LABEL element definition in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLLabelElement extends HTMLElement {
- /**
- * Returns the <code>FORM</code> element containing this control. Returns
- * <code>null</code> if this control is not within the context of a form.
- */
- public HTMLFormElement getForm();
-
- /**
- * A single character access key to give access to the form control. See
- * the accesskey attribute definition in HTML 4.0.
- */
- public String getAccessKey();
- public void setAccessKey(String accessKey);
-
- /**
- * This attribute links this label with another form control by
- * <code>id</code> attribute. See the for attribute definition in HTML
- * 4.0.
- */
- public String getHtmlFor();
- public void setHtmlFor(String htmlFor);
-
-}
diff --git a/src/org/w3c/dom/html/HTMLLegendElement.java b/src/org/w3c/dom/html/HTMLLegendElement.java
deleted file mode 100644
index ffe0816..0000000
--- a/src/org/w3c/dom/html/HTMLLegendElement.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-/**
- * Provides a caption for a <code>FIELDSET</code> grouping. See the LEGEND
- * element definition in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLLegendElement extends HTMLElement {
- /**
- * Returns the <code>FORM</code> element containing this control. Returns
- * <code>null</code> if this control is not within the context of a form.
- */
- public HTMLFormElement getForm();
-
- /**
- * A single character access key to give access to the form control. See
- * the accesskey attribute definition in HTML 4.0.
- */
- public String getAccessKey();
- public void setAccessKey(String accessKey);
-
- /**
- * Text alignment relative to <code>FIELDSET</code> . See the align
- * attribute definition in HTML 4.0. This attribute is deprecated in HTML
- * 4.0.
- */
- public String getAlign();
- public void setAlign(String align);
-
-}
diff --git a/src/org/w3c/dom/html/HTMLLinkElement.java b/src/org/w3c/dom/html/HTMLLinkElement.java
deleted file mode 100644
index cc03164..0000000
--- a/src/org/w3c/dom/html/HTMLLinkElement.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-/**
- * The <code>LINK</code> element specifies a link to an external resource,
- * and defines this document's relationship to that resource (or vice versa).
- * See the LINK element definition in HTML 4.0 (see also the
- * <code>LinkStyle</code> interface in the module).
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLLinkElement extends HTMLElement {
- /**
- * Enables/disables the link. This is currently only used for style sheet
- * links, and may be used to activate or deactivate style sheets.
- */
- public boolean getDisabled();
- public void setDisabled(boolean disabled);
-
- /**
- * The character encoding of the resource being linked to. See the
- * charset attribute definition in HTML 4.0.
- */
- public String getCharset();
- public void setCharset(String charset);
-
- /**
- * The URI of the linked resource. See the href attribute definition in
- * HTML 4.0.
- */
- public String getHref();
- public void setHref(String href);
-
- /**
- * Language code of the linked resource. See the hreflang attribute
- * definition in HTML 4.0.
- */
- public String getHreflang();
- public void setHreflang(String hreflang);
-
- /**
- * Designed for use with one or more target media. See the media
- * attribute definition in HTML 4.0.
- */
- public String getMedia();
- public void setMedia(String media);
-
- /**
- * Forward link type. See the rel attribute definition in HTML 4.0.
- */
- public String getRel();
- public void setRel(String rel);
-
- /**
- * Reverse link type. See the rev attribute definition in HTML 4.0.
- */
- public String getRev();
- public void setRev(String rev);
-
- /**
- * Frame to render the resource in. See the target attribute definition
- * in HTML 4.0.
- */
- public String getTarget();
- public void setTarget(String target);
-
- /**
- * Advisory content type. See the type attribute definition in HTML 4.0.
- */
- public String getType();
- public void setType(String type);
-
-}
diff --git a/src/org/w3c/dom/html/HTMLMapElement.java b/src/org/w3c/dom/html/HTMLMapElement.java
deleted file mode 100644
index f2b4222..0000000
--- a/src/org/w3c/dom/html/HTMLMapElement.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-/**
- * Client-side image map. See the MAP element definition in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLMapElement extends HTMLElement {
- /**
- * The list of areas defined for the image map.
- */
- public HTMLCollection getAreas();
-
- /**
- * Names the map (for use with <code>usemap</code> ). See the name
- * attribute definition in HTML 4.0.
- */
- public String getName();
- public void setName(String name);
-
-}
diff --git a/src/org/w3c/dom/html/HTMLMenuElement.java b/src/org/w3c/dom/html/HTMLMenuElement.java
deleted file mode 100644
index b579879..0000000
--- a/src/org/w3c/dom/html/HTMLMenuElement.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-/**
- * Menu list. See the MENU element definition in HTML 4.0. This element is
- * deprecated in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLMenuElement extends HTMLElement {
- /**
- * Reduce spacing between list items. See the compact attribute
- * definition in HTML 4.0. This attribute is deprecated in HTML 4.0.
- */
- public boolean getCompact();
- public void setCompact(boolean compact);
-
-}
diff --git a/src/org/w3c/dom/html/HTMLMetaElement.java b/src/org/w3c/dom/html/HTMLMetaElement.java
deleted file mode 100644
index 38920e4..0000000
--- a/src/org/w3c/dom/html/HTMLMetaElement.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-/**
- * This contains generic meta-information about the document. See the META
- * element definition in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLMetaElement extends HTMLElement {
- /**
- * Associated information. See the content attribute definition in HTML
- * 4.0.
- */
- public String getContent();
- public void setContent(String content);
-
- /**
- * HTTP response header name. See the http-equiv attribute definition in
- * HTML 4.0.
- */
- public String getHttpEquiv();
- public void setHttpEquiv(String httpEquiv);
-
- /**
- * Meta information name. See the name attribute definition in HTML 4.0.
- */
- public String getName();
- public void setName(String name);
-
- /**
- * Select form of content. See the scheme attribute definition in HTML
- * 4.0.
- */
- public String getScheme();
- public void setScheme(String scheme);
-
-}
diff --git a/src/org/w3c/dom/html/HTMLModElement.java b/src/org/w3c/dom/html/HTMLModElement.java
deleted file mode 100644
index cfd96a1..0000000
--- a/src/org/w3c/dom/html/HTMLModElement.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-/**
- * Notice of modification to part of a document. See the INS and DEL
- * element definitions in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLModElement extends HTMLElement {
- /**
- * A URI designating a document that describes the reason for the change.
- * See the cite attribute definition in HTML 4.0.
- */
- public String getCite();
- public void setCite(String cite);
-
- /**
- * The date and time of the change. See the datetime attribute definition
- * in HTML 4.0.
- */
- public String getDateTime();
- public void setDateTime(String dateTime);
-
-}
diff --git a/src/org/w3c/dom/html/HTMLOListElement.java b/src/org/w3c/dom/html/HTMLOListElement.java
deleted file mode 100644
index 728e760..0000000
--- a/src/org/w3c/dom/html/HTMLOListElement.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-/**
- * Ordered list. See the OL element definition in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLOListElement extends HTMLElement {
- /**
- * Reduce spacing between list items. See the compact attribute
- * definition in HTML 4.0. This attribute is deprecated in HTML 4.0.
- */
- public boolean getCompact();
- public void setCompact(boolean compact);
-
- /**
- * Starting sequence number. See the start attribute definition in HTML
- * 4.0. This attribute is deprecated in HTML 4.0.
- */
- public int getStart();
- public void setStart(int start);
-
- /**
- * Numbering style. See the type attribute definition in HTML 4.0. This
- * attribute is deprecated in HTML 4.0.
- */
- public String getType();
- public void setType(String type);
-
-}
diff --git a/src/org/w3c/dom/html/HTMLObjectElement.java b/src/org/w3c/dom/html/HTMLObjectElement.java
deleted file mode 100644
index 972091b..0000000
--- a/src/org/w3c/dom/html/HTMLObjectElement.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-import org.w3c.dom.Document;
-
-/**
- * Generic embedded object. Note. In principle, all properties on the object
- * element are read-write but in some environments some properties may be
- * read-only once the underlying object is instantiated. See the OBJECT
- * element definition in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLObjectElement extends HTMLElement {
- /**
- * Returns the <code>FORM</code> element containing this control. Returns
- * <code>null</code> if this control is not within the context of a form.
- */
- public HTMLFormElement getForm();
-
- /**
- * Applet class file. See the <code>code</code> attribute for
- * HTMLAppletElement.
- */
- public String getCode();
- public void setCode(String code);
-
- /**
- * Aligns this object (vertically or horizontally) with respect to its
- * surrounding text. See the align attribute definition in HTML 4.0.
- * This attribute is deprecated in HTML 4.0.
- */
- public String getAlign();
- public void setAlign(String align);
-
- /**
- * Space-separated list of archives. See the archive attribute definition
- * in HTML 4.0.
- */
- public String getArchive();
- public void setArchive(String archive);
-
- /**
- * Width of border around the object. See the border attribute definition
- * in HTML 4.0. This attribute is deprecated in HTML 4.0.
- */
- public String getBorder();
- public void setBorder(String border);
-
- /**
- * Base URI for <code>classid</code> , <code>data</code> , and
- * <code>archive</code> attributes. See the codebase attribute definition
- * in HTML 4.0.
- */
- public String getCodeBase();
- public void setCodeBase(String codeBase);
-
- /**
- * Content type for data downloaded via <code>classid</code> attribute.
- * See the codetype attribute definition in HTML 4.0.
- */
- public String getCodeType();
- public void setCodeType(String codeType);
-
- /**
- * A URI specifying the location of the object's data. See the data
- * attribute definition in HTML 4.0.
- */
- public String getData();
- public void setData(String data);
-
- /**
- * Declare (for future reference), but do not instantiate, this object.
- * See the declare attribute definition in HTML 4.0.
- */
- public boolean getDeclare();
- public void setDeclare(boolean declare);
-
- /**
- * Override height. See the height attribute definition in HTML 4.0.
- */
- public String getHeight();
- public void setHeight(String height);
-
- /**
- * Horizontal space to the left and right of this image, applet, or
- * object. See the hspace attribute definition in HTML 4.0. This
- * attribute is deprecated in HTML 4.0.
- */
- public String getHspace();
- public void setHspace(String hspace);
-
- /**
- * Form control or object name when submitted with a form. See the name
- * attribute definition in HTML 4.0.
- */
- public String getName();
- public void setName(String name);
-
- /**
- * Message to render while loading the object. See the standby attribute
- * definition in HTML 4.0.
- */
- public String getStandby();
- public void setStandby(String standby);
-
- /**
- * Index that represents the element's position in the tabbing order. See
- * the tabindex attribute definition in HTML 4.0.
- */
- public int getTabIndex();
- public void setTabIndex(int tabIndex);
-
- /**
- * Content type for data downloaded via <code>data</code> attribute. See
- * the type attribute definition in HTML 4.0.
- */
- public String getType();
- public void setType(String type);
-
- /**
- * Use client-side image map. See the usemap attribute definition in
- * HTML 4.0.
- */
- public String getUseMap();
- public void setUseMap(String useMap);
-
- /**
- * Vertical space above and below this image, applet, or object. See the
- * vspace attribute definition in HTML 4.0. This attribute is deprecated
- * in HTML 4.0.
- */
- public String getVspace();
- public void setVspace(String vspace);
-
- /**
- * Override width. See the width attribute definition in HTML 4.0.
- */
- public String getWidth();
- public void setWidth(String width);
-
- /**
- * The document this object contains, if there is any and it is
- * available, or <code>null</code> otherwise.
- * @since DOM Level 2
- */
- public Document getContentDocument();
-
-}
diff --git a/src/org/w3c/dom/html/HTMLOptGroupElement.java b/src/org/w3c/dom/html/HTMLOptGroupElement.java
deleted file mode 100644
index edddf36..0000000
--- a/src/org/w3c/dom/html/HTMLOptGroupElement.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-/**
- * Group options together in logical subdivisions. See the OPTGROUP element
- * definition in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLOptGroupElement extends HTMLElement {
- /**
- * The control is unavailable in this context. See the disabled
- * attribute definition in HTML 4.0.
- */
- public boolean getDisabled();
- public void setDisabled(boolean disabled);
-
- /**
- * Assigns a label to this option group. See the label attribute
- * definition in HTML 4.0.
- */
- public String getLabel();
- public void setLabel(String label);
-
-}
diff --git a/src/org/w3c/dom/html/HTMLOptionElement.java b/src/org/w3c/dom/html/HTMLOptionElement.java
deleted file mode 100644
index 2736588..0000000
--- a/src/org/w3c/dom/html/HTMLOptionElement.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-/**
- * A selectable choice. See the OPTION element definition in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLOptionElement extends HTMLElement {
- /**
- * Returns the <code>FORM</code> element containing this control. Returns
- * <code>null</code> if this control is not within the context of a form.
- */
- public HTMLFormElement getForm();
-
- /**
- * Represents the value of the HTML selected attribute. The value of this
- * attribute does not change if the state of the corresponding form
- * control, in an interactive user agent, changes. Changing
- * <code>defaultSelected</code> , however, resets the state of the form
- * control. See the selected attribute definition in HTML 4.0.
- */
- public boolean getDefaultSelected();
- public void setDefaultSelected(boolean defaultSelected);
-
- /**
- * The text contained within the option element.
- */
- public String getText();
-
- /**
- * The index of this <code>OPTION</code> in its parent <code>SELECT</code>
- * , starting from 0.
- */
- public int getIndex();
-
- /**
- * The control is unavailable in this context. See the disabled
- * attribute definition in HTML 4.0.
- */
- public boolean getDisabled();
- public void setDisabled(boolean disabled);
-
- /**
- * Option label for use in hierarchical menus. See the label attribute
- * definition in HTML 4.0.
- */
- public String getLabel();
- public void setLabel(String label);
-
- /**
- * Represents the current state of the corresponding form control, in an
- * interactive user agent. Changing this attribute changes the state of
- * the form control, but does not change the value of the HTML selected
- * attribute of the element.
- */
- public boolean getSelected();
- public void setSelected(boolean selected);
-
- /**
- * The current form control value. See the value attribute definition in
- * HTML 4.0.
- */
- public String getValue();
- public void setValue(String value);
-
-}
diff --git a/src/org/w3c/dom/html/HTMLParagraphElement.java b/src/org/w3c/dom/html/HTMLParagraphElement.java
deleted file mode 100644
index a7dc5d6..0000000
--- a/src/org/w3c/dom/html/HTMLParagraphElement.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-/**
- * Paragraphs. See the P element definition in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLParagraphElement extends HTMLElement {
- /**
- * Horizontal text alignment. See the align attribute definition in HTML
- * 4.0. This attribute is deprecated in HTML 4.0.
- */
- public String getAlign();
- public void setAlign(String align);
-
-}
diff --git a/src/org/w3c/dom/html/HTMLParamElement.java b/src/org/w3c/dom/html/HTMLParamElement.java
deleted file mode 100644
index 6b18476..0000000
--- a/src/org/w3c/dom/html/HTMLParamElement.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-/**
- * Parameters fed to the <code>OBJECT</code> element. See the PARAM element
- * definition in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLParamElement extends HTMLElement {
- /**
- * The name of a run-time parameter. See the name attribute definition
- * in HTML 4.0.
- */
- public String getName();
- public void setName(String name);
-
- /**
- * Content type for the <code>value</code> attribute when
- * <code>valuetype</code> has the value "ref". See the type attribute
- * definition in HTML 4.0.
- */
- public String getType();
- public void setType(String type);
-
- /**
- * The value of a run-time parameter. See the value attribute definition
- * in HTML 4.0.
- */
- public String getValue();
- public void setValue(String value);
-
- /**
- * Information about the meaning of the <code>value</code> attribute
- * value. See the valuetype attribute definition in HTML 4.0.
- */
- public String getValueType();
- public void setValueType(String valueType);
-
-}
diff --git a/src/org/w3c/dom/html/HTMLPreElement.java b/src/org/w3c/dom/html/HTMLPreElement.java
deleted file mode 100644
index 40b199f..0000000
--- a/src/org/w3c/dom/html/HTMLPreElement.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-/**
- * Preformatted text. See the PRE element definition in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLPreElement extends HTMLElement {
- /**
- * Fixed width for content. See the width attribute definition in HTML
- * 4.0. This attribute is deprecated in HTML 4.0.
- */
- public int getWidth();
- public void setWidth(int width);
-
-}
diff --git a/src/org/w3c/dom/html/HTMLQuoteElement.java b/src/org/w3c/dom/html/HTMLQuoteElement.java
deleted file mode 100644
index 61abf1f..0000000
--- a/src/org/w3c/dom/html/HTMLQuoteElement.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-/**
- * For the <code>Q</code> and <code>BLOCKQUOTE</code> elements. See the Q
- * element definition in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLQuoteElement extends HTMLElement {
- /**
- * A URI designating a source document or message. See the cite
- * attribute definition in HTML 4.0.
- */
- public String getCite();
- public void setCite(String cite);
-
-}
diff --git a/src/org/w3c/dom/html/HTMLScriptElement.java b/src/org/w3c/dom/html/HTMLScriptElement.java
deleted file mode 100644
index 5004a41..0000000
--- a/src/org/w3c/dom/html/HTMLScriptElement.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-/**
- * Script statements. See the SCRIPT element definition in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLScriptElement extends HTMLElement {
- /**
- * The script content of the element.
- */
- public String getText();
- public void setText(String text);
-
- /**
- * Reserved for future use.
- */
- public String getHtmlFor();
- public void setHtmlFor(String htmlFor);
-
- /**
- * Reserved for future use.
- */
- public String getEvent();
- public void setEvent(String event);
-
- /**
- * The character encoding of the linked resource. See the charset
- * attribute definition in HTML 4.0.
- */
- public String getCharset();
- public void setCharset(String charset);
-
- /**
- * Indicates that the user agent can defer processing of the script. See
- * the defer attribute definition in HTML 4.0.
- */
- public boolean getDefer();
- public void setDefer(boolean defer);
-
- /**
- * URI designating an external script. See the src attribute definition
- * in HTML 4.0.
- */
- public String getSrc();
- public void setSrc(String src);
-
- /**
- * The content type of the script language. See the type attribute
- * definition in HTML 4.0.
- */
- public String getType();
- public void setType(String type);
-
-}
diff --git a/src/org/w3c/dom/html/HTMLSelectElement.java b/src/org/w3c/dom/html/HTMLSelectElement.java
deleted file mode 100644
index 9611cca..0000000
--- a/src/org/w3c/dom/html/HTMLSelectElement.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-import org.w3c.dom.DOMException;
-
-/**
- * The select element allows the selection of an option. The contained
- * options can be directly accessed through the select element as a
- * collection. See the SELECT element definition in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLSelectElement extends HTMLElement {
- /**
- * The type of this form control. This is the string "select-multiple"
- * when the multiple attribute is <code>true</code> and the string
- * "select-one" when <code>false</code> .
- */
- public String getType();
-
- /**
- * The ordinal index of the selected option, starting from 0. The value
- * -1 is returned if no element is selected. If multiple options are
- * selected, the index of the first selected option is returned.
- */
- public int getSelectedIndex();
- public void setSelectedIndex(int selectedIndex);
-
- /**
- * The current form control value.
- */
- public String getValue();
- public void setValue(String value);
-
- /**
- * The number of options in this <code>SELECT</code> .
- */
- public int getLength();
-
- /**
- * Returns the <code>FORM</code> element containing this control. Returns
- * <code>null</code> if this control is not within the context of a form.
- */
- public HTMLFormElement getForm();
-
- /**
- * The collection of <code>OPTION</code> elements contained by this
- * element.
- */
- public HTMLCollection getOptions();
-
- /**
- * The control is unavailable in this context. See the disabled
- * attribute definition in HTML 4.0.
- */
- public boolean getDisabled();
- public void setDisabled(boolean disabled);
-
- /**
- * If true, multiple <code>OPTION</code> elements may be selected in
- * this <code>SELECT</code> . See the multiple attribute definition in
- * HTML 4.0.
- */
- public boolean getMultiple();
- public void setMultiple(boolean multiple);
-
- /**
- * Form control or object name when submitted with a form. See the name
- * attribute definition in HTML 4.0.
- */
- public String getName();
- public void setName(String name);
-
- /**
- * Number of visible rows. See the size attribute definition in HTML 4.0.
- */
- public int getSize();
- public void setSize(int size);
-
- /**
- * Index that represents the element's position in the tabbing order. See
- * the tabindex attribute definition in HTML 4.0.
- */
- public int getTabIndex();
- public void setTabIndex(int tabIndex);
-
- /**
- * Add a new element to the collection of <code>OPTION</code> elements
- * for this <code>SELECT</code> . This method is the equivalent of the
- * <code>appendChild</code> method of the <code>Node</code> interface if
- * the <code>before</code> parameter is <code>null</code> . It is
- * equivalent to the <code>insertBefore</code> method on the parent of
- * <code>before</code> in all other cases.
- * @param element The element to add.
- * @param before The element to insert before, or <code>null</code> for
- * the tail of the list.
- * @exception DOMException
- * NOT_FOUND_ERR: Raised if <code>before</code> is not a descendant of
- * the <code>SELECT</code> element.
- */
- public void add(HTMLElement element,
- HTMLElement before)
- throws DOMException;
-
- /**
- * Remove an element from the collection of <code>OPTION</code> elements
- * for this <code>SELECT</code> . Does nothing if no element has the given
- * index.
- * @param index The index of the item to remove, starting from 0.
- */
- public void remove(int index);
-
- /**
- * Removes keyboard focus from this element.
- */
- public void blur();
-
- /**
- * Gives keyboard focus to this element.
- */
- public void focus();
-
-}
diff --git a/src/org/w3c/dom/html/HTMLStyleElement.java b/src/org/w3c/dom/html/HTMLStyleElement.java
deleted file mode 100644
index d811e85..0000000
--- a/src/org/w3c/dom/html/HTMLStyleElement.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-/**
- * Style information. See the STYLE element definition in HTML 4.0, the
- * module and the <code>LinkStyle</code> interface in the module.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLStyleElement extends HTMLElement {
- /**
- * Enables/disables the style sheet.
- */
- public boolean getDisabled();
- public void setDisabled(boolean disabled);
-
- /**
- * Designed for use with one or more target media. See the media
- * attribute definition in HTML 4.0.
- */
- public String getMedia();
- public void setMedia(String media);
-
- /**
- * The content type pf the style sheet language. See the type attribute
- * definition in HTML 4.0.
- */
- public String getType();
- public void setType(String type);
-
-}
diff --git a/src/org/w3c/dom/html/HTMLTableCaptionElement.java b/src/org/w3c/dom/html/HTMLTableCaptionElement.java
deleted file mode 100644
index b800137..0000000
--- a/src/org/w3c/dom/html/HTMLTableCaptionElement.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-/**
- * Table caption See the CAPTION element definition in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLTableCaptionElement extends HTMLElement {
- /**
- * Caption alignment with respect to the table. See the align attribute
- * definition in HTML 4.0. This attribute is deprecated in HTML 4.0.
- */
- public String getAlign();
- public void setAlign(String align);
-
-}
diff --git a/src/org/w3c/dom/html/HTMLTableCellElement.java b/src/org/w3c/dom/html/HTMLTableCellElement.java
deleted file mode 100644
index b7debbf..0000000
--- a/src/org/w3c/dom/html/HTMLTableCellElement.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-/**
- * The object used to represent the <code>TH</code> and <code>TD</code>
- * elements. See the TD element definition in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLTableCellElement extends HTMLElement {
- /**
- * The index of this cell in the row, starting from 0. This index is in
- * document tree order and not display order.
- */
- public int getCellIndex();
-
- /**
- * Abbreviation for header cells. See the abbr attribute definition in
- * HTML 4.0.
- */
- public String getAbbr();
- public void setAbbr(String abbr);
-
- /**
- * Horizontal alignment of data in cell. See the align attribute
- * definition in HTML 4.0.
- */
- public String getAlign();
- public void setAlign(String align);
-
- /**
- * Names group of related headers. See the axis attribute definition in
- * HTML 4.0.
- */
- public String getAxis();
- public void setAxis(String axis);
-
- /**
- * Cell background color. See the bgcolor attribute definition in HTML
- * 4.0. This attribute is deprecated in HTML 4.0.
- */
- public String getBgColor();
- public void setBgColor(String bgColor);
-
- /**
- * Alignment character for cells in a column. See the char attribute
- * definition in HTML 4.0.
- */
- public String getCh();
- public void setCh(String ch);
-
- /**
- * Offset of alignment character. See the charoff attribute definition
- * in HTML 4.0.
- */
- public String getChOff();
- public void setChOff(String chOff);
-
- /**
- * Number of columns spanned by cell. See the colspan attribute
- * definition in HTML 4.0.
- */
- public int getColSpan();
- public void setColSpan(int colSpan);
-
- /**
- * List of <code>id</code> attribute values for header cells. See the
- * headers attribute definition in HTML 4.0.
- */
- public String getHeaders();
- public void setHeaders(String headers);
-
- /**
- * Cell height. See the height attribute definition in HTML 4.0. This
- * attribute is deprecated in HTML 4.0.
- */
- public String getHeight();
- public void setHeight(String height);
-
- /**
- * Suppress word wrapping. See the nowrap attribute definition in HTML
- * 4.0. This attribute is deprecated in HTML 4.0.
- */
- public boolean getNoWrap();
- public void setNoWrap(boolean noWrap);
-
- /**
- * Number of rows spanned by cell. See the rowspan attribute definition
- * in HTML 4.0.
- */
- public int getRowSpan();
- public void setRowSpan(int rowSpan);
-
- /**
- * Scope covered by header cells. See the scope attribute definition in
- * HTML 4.0.
- */
- public String getScope();
- public void setScope(String scope);
-
- /**
- * Vertical alignment of data in cell. See the valign attribute
- * definition in HTML 4.0.
- */
- public String getVAlign();
- public void setVAlign(String vAlign);
-
- /**
- * Cell width. See the width attribute definition in HTML 4.0. This
- * attribute is deprecated in HTML 4.0.
- */
- public String getWidth();
- public void setWidth(String width);
-
-}
diff --git a/src/org/w3c/dom/html/HTMLTableColElement.java b/src/org/w3c/dom/html/HTMLTableColElement.java
deleted file mode 100644
index d7ece0f..0000000
--- a/src/org/w3c/dom/html/HTMLTableColElement.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-/**
- * Regroups the <code>COL</code> and <code>COLGROUP</code> elements. See the
- * COL element definition in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLTableColElement extends HTMLElement {
- /**
- * Horizontal alignment of cell data in column. See the align attribute
- * definition in HTML 4.0.
- */
- public String getAlign();
- public void setAlign(String align);
-
- /**
- * Alignment character for cells in a column. See the char attribute
- * definition in HTML 4.0.
- */
- public String getCh();
- public void setCh(String ch);
-
- /**
- * Offset of alignment character. See the charoff attribute definition
- * in HTML 4.0.
- */
- public String getChOff();
- public void setChOff(String chOff);
-
- /**
- * Indicates the number of columns in a group or affected by a grouping.
- * See the span attribute definition in HTML 4.0.
- */
- public int getSpan();
- public void setSpan(int span);
-
- /**
- * Vertical alignment of cell data in column. See the valign attribute
- * definition in HTML 4.0.
- */
- public String getVAlign();
- public void setVAlign(String vAlign);
-
- /**
- * Default column width. See the width attribute definition in HTML 4.0.
- */
- public String getWidth();
- public void setWidth(String width);
-
-}
diff --git a/src/org/w3c/dom/html/HTMLTableElement.java b/src/org/w3c/dom/html/HTMLTableElement.java
deleted file mode 100644
index f57d51c..0000000
--- a/src/org/w3c/dom/html/HTMLTableElement.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-import org.w3c.dom.DOMException;
-
-/**
- * The create* and delete* methods on the table allow authors to construct
- * and modify tables. HTML 4.0 specifies that only one of each of the
- * <code>CAPTION</code> , <code>THEAD</code> , and <code>TFOOT</code>
- * elements may exist in a table. Therefore, if one exists, and the
- * createTHead() or createTFoot() method is called, the method returns the
- * existing THead or TFoot element. See the TABLE element definition in HTML
- * 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLTableElement extends HTMLElement {
- /**
- * Returns the table's <code>CAPTION</code> , or void if none exists.
- */
- public HTMLTableCaptionElement getCaption();
- public void setCaption(HTMLTableCaptionElement caption);
-
- /**
- * Returns the table's <code>THEAD</code> , or <code>null</code> if none
- * exists.
- */
- public HTMLTableSectionElement getTHead();
- public void setTHead(HTMLTableSectionElement tHead);
-
- /**
- * Returns the table's <code>TFOOT</code> , or <code>null</code> if none
- * exists.
- */
- public HTMLTableSectionElement getTFoot();
- public void setTFoot(HTMLTableSectionElement tFoot);
-
- /**
- * Returns a collection of all the rows in the table, including all in
- * <code>THEAD</code> , <code>TFOOT</code> , all <code>TBODY</code>
- * elements.
- */
- public HTMLCollection getRows();
-
- /**
- * Returns a collection of the defined table bodies.
- */
- public HTMLCollection getTBodies();
-
- /**
- * Specifies the table's position with respect to the rest of the
- * document. See the align attribute definition in HTML 4.0. This
- * attribute is deprecated in HTML 4.0.
- */
- public String getAlign();
- public void setAlign(String align);
-
- /**
- * Cell background color. See the bgcolor attribute definition in HTML
- * 4.0. This attribute is deprecated in HTML 4.0.
- */
- public String getBgColor();
- public void setBgColor(String bgColor);
-
- /**
- * The width of the border around the table. See the border attribute
- * definition in HTML 4.0.
- */
- public String getBorder();
- public void setBorder(String border);
-
- /**
- * Specifies the horizontal and vertical space between cell content and
- * cell borders. See the cellpadding attribute definition in HTML 4.0.
- */
- public String getCellPadding();
- public void setCellPadding(String cellPadding);
-
- /**
- * Specifies the horizontal and vertical separation between cells. See
- * the cellspacing attribute definition in HTML 4.0.
- */
- public String getCellSpacing();
- public void setCellSpacing(String cellSpacing);
-
- /**
- * Specifies which external table borders to render. See the frame
- * attribute definition in HTML 4.0.
- */
- public String getFrame();
- public void setFrame(String frame);
-
- /**
- * Specifies which internal table borders to render. See the rules
- * attribute definition in HTML 4.0.
- */
- public String getRules();
- public void setRules(String rules);
-
- /**
- * Description about the purpose or structure of a table. See the
- * summary attribute definition in HTML 4.0.
- */
- public String getSummary();
- public void setSummary(String summary);
-
- /**
- * Specifies the desired table width. See the width attribute definition
- * in HTML 4.0.
- */
- public String getWidth();
- public void setWidth(String width);
-
- /**
- * Create a table header row or return an existing one.
- * @return A new table header element (<code>THEAD</code> ).
- */
- public HTMLElement createTHead();
-
- /**
- * Delete the header from the table, if one exists.
- */
- public void deleteTHead();
-
- /**
- * Create a table footer row or return an existing one.
- * @return A footer element (<code>TFOOT</code> ).
- */
- public HTMLElement createTFoot();
-
- /**
- * Delete the footer from the table, if one exists.
- */
- public void deleteTFoot();
-
- /**
- * Create a new table caption object or return an existing one.
- * @return A <code>CAPTION</code> element.
- */
- public HTMLElement createCaption();
-
- /**
- * Delete the table caption, if one exists.
- */
- public void deleteCaption();
-
- /**
- * Insert a new empty row in the table. The new row is inserted
- * immediately before and in the same section as the current
- * <code>index</code> th row in the table. If <code>index</code> is equal
- * to the number of rows, the new row is appended. In addition, when the
- * table is empty the row is inserted into a <code>TBODY</code> which is
- * created and inserted into the table. Note. A table row cannot be empty
- * according to HTML 4.0 Recommendation.
- * @param index The row number where to insert a new row. This index
- * starts from 0 and is relative to all the rows contained inside the
- * table, regardless of section parentage.
- * @return The newly created row.
- * @exception DOMException
- * INDEX_SIZE_ERR: Raised if the specified index is greater than the
- * number of rows or if the index is negative.
- */
- public HTMLElement insertRow(int index)
- throws DOMException;
-
- /**
- * Delete a table row.
- * @param index The index of the row to be deleted. This index starts
- * from 0 and is relative to all the rows contained inside the table,
- * regardless of section parentage.
- * @exception DOMException
- * INDEX_SIZE_ERR: Raised if the specified index is greater than or
- * equal to the number of rows or if the index is negative.
- */
- public void deleteRow(int index)
- throws DOMException;
-
-}
diff --git a/src/org/w3c/dom/html/HTMLTableRowElement.java b/src/org/w3c/dom/html/HTMLTableRowElement.java
deleted file mode 100644
index a24ff42..0000000
--- a/src/org/w3c/dom/html/HTMLTableRowElement.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-import org.w3c.dom.DOMException;
-
-/**
- * A row in a table. See the TR element definition in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLTableRowElement extends HTMLElement {
- /**
- * The index of this row, relative to the entire table, starting from 0.
- * This is in document tree order and not display order. The
- * <code>rowIndex</code> does not take into account sections (
- * <code>THEAD</code> , <code>TFOOT</code> , or <code>TBODY</code> )
- * within the table.
- */
- public int getRowIndex();
-
- /**
- * The index of this row, relative to the current section (
- * <code>THEAD</code> , <code>TFOOT</code> , or <code>TBODY</code> ),
- * starting from 0.
- */
- public int getSectionRowIndex();
-
- /**
- * The collection of cells in this row.
- */
- public HTMLCollection getCells();
-
- /**
- * Horizontal alignment of data within cells of this row. See the align
- * attribute definition in HTML 4.0.
- */
- public String getAlign();
- public void setAlign(String align);
-
- /**
- * Background color for rows. See the bgcolor attribute definition in
- * HTML 4.0. This attribute is deprecated in HTML 4.0.
- */
- public String getBgColor();
- public void setBgColor(String bgColor);
-
- /**
- * Alignment character for cells in a column. See the char attribute
- * definition in HTML 4.0.
- */
- public String getCh();
- public void setCh(String ch);
-
- /**
- * Offset of alignment character. See the charoff attribute definition
- * in HTML 4.0.
- */
- public String getChOff();
- public void setChOff(String chOff);
-
- /**
- * Vertical alignment of data within cells of this row. See the valign
- * attribute definition in HTML 4.0.
- */
- public String getVAlign();
- public void setVAlign(String vAlign);
-
- /**
- * Insert an empty <code>TD</code> cell into this row. If
- * <code>index</code> is equal to the number of cells, the new cell is
- * appended
- * @param index The place to insert the cell, starting from 0.
- * @return The newly created cell.
- * @exception DOMException
- * INDEX_SIZE_ERR: Raised if the specified <code>index</code> is
- * greater than the number of cells or if the index is negative.
- */
- public HTMLElement insertCell(int index)
- throws DOMException;
-
- /**
- * Delete a cell from the current row.
- * @param index The index of the cell to delete, starting from 0.
- * @exception DOMException
- * INDEX_SIZE_ERR: Raised if the specified <code>index</code> is
- * greater than or equal to the number of cells or if the index is
- * negative.
- */
- public void deleteCell(int index)
- throws DOMException;
-
-}
diff --git a/src/org/w3c/dom/html/HTMLTableSectionElement.java b/src/org/w3c/dom/html/HTMLTableSectionElement.java
deleted file mode 100644
index f6c3cfa..0000000
--- a/src/org/w3c/dom/html/HTMLTableSectionElement.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-import org.w3c.dom.DOMException;
-
-/**
- * The <code>THEAD</code> , <code>TFOOT</code> , and <code>TBODY</code>
- * elements.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLTableSectionElement extends HTMLElement {
- /**
- * Horizontal alignment of data in cells. See the <code>align</code>
- * attribute for HTMLTheadElement for details.
- */
- public String getAlign();
- public void setAlign(String align);
-
- /**
- * Alignment character for cells in a column. See the char attribute
- * definition in HTML 4.0.
- */
- public String getCh();
- public void setCh(String ch);
-
- /**
- * Offset of alignment character. See the charoff attribute definition
- * in HTML 4.0.
- */
- public String getChOff();
- public void setChOff(String chOff);
-
- /**
- * Vertical alignment of data in cells. See the <code>valign</code>
- * attribute for HTMLTheadElement for details.
- */
- public String getVAlign();
- public void setVAlign(String vAlign);
-
- /**
- * The collection of rows in this table section.
- */
- public HTMLCollection getRows();
-
- /**
- * Insert a row into this section. The new row is inserted immediately
- * before the current <code>index</code> th row in this section. If
- * <code>index</code> is equal to the number of rows in this section, the
- * new row is appended.
- * @param index The row number where to insert a new row. This index
- * starts from 0 and is relative only to the rows contained inside this
- * section, not all the rows in the table.
- * @return The newly created row.
- * @exception DOMException
- * INDEX_SIZE_ERR: Raised if the specified index is greater than the
- * number of rows of if the index is neagative.
- */
- public HTMLElement insertRow(int index)
- throws DOMException;
-
- /**
- * Delete a row from this section.
- * @param index The index of the row to be deleted. This index starts
- * from 0 and is relative only to the rows contained inside this
- * section, not all the rows in the table.
- * @exception DOMException
- * INDEX_SIZE_ERR: Raised if the specified index is greater than or
- * equal to the number of rows or if the index is negative.
- */
- public void deleteRow(int index)
- throws DOMException;
-
-}
diff --git a/src/org/w3c/dom/html/HTMLTextAreaElement.java b/src/org/w3c/dom/html/HTMLTextAreaElement.java
deleted file mode 100644
index 1546a7d..0000000
--- a/src/org/w3c/dom/html/HTMLTextAreaElement.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-/**
- * Multi-line text field. See the TEXTAREA element definition in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLTextAreaElement extends HTMLElement {
- /**
- * Represents the contents of the element. The value of this attribute
- * does not change if the contents of the corresponding form control, in
- * an interactive user agent, changes. Changing this attribute, however,
- * resets the contents of the form control.
- */
- public String getDefaultValue();
- public void setDefaultValue(String defaultValue);
-
- /**
- * Returns the <code>FORM</code> element containing this control. Returns
- * <code>null</code> if this control is not within the context of a form.
- */
- public HTMLFormElement getForm();
-
- /**
- * A single character access key to give access to the form control. See
- * the accesskey attribute definition in HTML 4.0.
- */
- public String getAccessKey();
- public void setAccessKey(String accessKey);
-
- /**
- * Width of control (in characters). See the cols attribute definition
- * in HTML 4.0.
- */
- public int getCols();
- public void setCols(int cols);
-
- /**
- * The control is unavailable in this context. See the disabled
- * attribute definition in HTML 4.0.
- */
- public boolean getDisabled();
- public void setDisabled(boolean disabled);
-
- /**
- * Form control or object name when submitted with a form. See the name
- * attribute definition in HTML 4.0.
- */
- public String getName();
- public void setName(String name);
-
- /**
- * This control is read-only. See the readonly attribute definition in
- * HTML 4.0.
- */
- public boolean getReadOnly();
- public void setReadOnly(boolean readOnly);
-
- /**
- * Number of text rows. See the rows attribute definition in HTML 4.0.
- */
- public int getRows();
- public void setRows(int rows);
-
- /**
- * Index that represents the element's position in the tabbing order. See
- * the tabindex attribute definition in HTML 4.0.
- */
- public int getTabIndex();
- public void setTabIndex(int tabIndex);
-
- /**
- * The type of this form control. This the string "textarea".
- */
- public String getType();
-
- /**
- * Represents the current contents of the corresponding form control, in
- * an interactive user agent. Changing this attribute changes the
- * contents of the form control, but does not change the contents of the
- * element. If the entirety of the data can not fit into a single
- * <code>DOMString</code> , the implementation may truncate the data.
- */
- public String getValue();
- public void setValue(String value);
-
- /**
- * Removes keyboard focus from this element.
- */
- public void blur();
-
- /**
- * Gives keyboard focus to this element.
- */
- public void focus();
-
- /**
- * Select the contents of the <code>TEXTAREA</code> .
- */
- public void select();
-
-}
diff --git a/src/org/w3c/dom/html/HTMLTitleElement.java b/src/org/w3c/dom/html/HTMLTitleElement.java
deleted file mode 100644
index 9b3c1cb..0000000
--- a/src/org/w3c/dom/html/HTMLTitleElement.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-/**
- * The document title. See the TITLE element definition in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLTitleElement extends HTMLElement {
- /**
- * The specified title as a string.
- */
- public String getText();
- public void setText(String text);
-
-}
diff --git a/src/org/w3c/dom/html/HTMLUListElement.java b/src/org/w3c/dom/html/HTMLUListElement.java
deleted file mode 100644
index cd4386a..0000000
--- a/src/org/w3c/dom/html/HTMLUListElement.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-/**
- * Unordered list. See the UL element definition in HTML 4.0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- */
-public interface HTMLUListElement extends HTMLElement {
- /**
- * Reduce spacing between list items. See the compact attribute
- * definition in HTML 4.0. This attribute is deprecated in HTML 4.0.
- */
- public boolean getCompact();
- public void setCompact(boolean compact);
-
- /**
- * Bullet style. See the type attribute definition in HTML 4.0. This
- * attribute is deprecated in HTML 4.0.
- */
- public String getType();
- public void setType(String type);
-
-}
diff --git a/src/org/w3c/dom/ls/DOMImplementationLS.java b/src/org/w3c/dom/ls/DOMImplementationLS.java
deleted file mode 100644
index c876daf..0000000
--- a/src/org/w3c/dom/ls/DOMImplementationLS.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] in the hope that
- * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom.ls;
-
-import org.w3c.dom.DOMException;
-
-/**
- * <code>DOMImplementationLS</code> contains the factory methods for creating
- * Load and Save objects.
- * <p> The expectation is that an instance of the
- * <code>DOMImplementationLS</code> interface can be obtained by using
- * binding-specific casting methods on an instance of the
- * <code>DOMImplementation</code> interface or, if the <code>Document</code>
- * supports the feature <code>"Core"</code> version <code>"3.0"</code>
- * defined in [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>DOM Level 3 Core</a>]
- * , by using the method <code>DOMImplementation.getFeature</code> with
- * parameter values <code>"LS"</code> (or <code>"LS-Async"</code>) and
- * <code>"3.0"</code> (respectively).
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407'>Document Object Model (DOM) Level 3 Load
-and Save Specification</a>.
- */
-public interface DOMImplementationLS {
- // DOMImplementationLSMode
- /**
- * Create a synchronous <code>LSParser</code>.
- */
- public static final short MODE_SYNCHRONOUS = 1;
- /**
- * Create an asynchronous <code>LSParser</code>.
- */
- public static final short MODE_ASYNCHRONOUS = 2;
-
- /**
- * Create a new <code>LSParser</code>. The newly constructed parser may
- * then be configured by means of its <code>DOMConfiguration</code>
- * object, and used to parse documents by means of its <code>parse</code>
- * method.
- * @param mode The <code>mode</code> argument is either
- * <code>MODE_SYNCHRONOUS</code> or <code>MODE_ASYNCHRONOUS</code>, if
- * <code>mode</code> is <code>MODE_SYNCHRONOUS</code> then the
- * <code>LSParser</code> that is created will operate in synchronous
- * mode, if it's <code>MODE_ASYNCHRONOUS</code> then the
- * <code>LSParser</code> that is created will operate in asynchronous
- * mode.
- * @param schemaType An absolute URI representing the type of the schema
- * language used during the load of a <code>Document</code> using the
- * newly created <code>LSParser</code>. Note that no lexical checking
- * is done on the absolute URI. In order to create a
- * <code>LSParser</code> for any kind of schema types (i.e. the
- * LSParser will be free to use any schema found), use the value
- * <code>null</code>.
- * <p ><b>Note:</b> For W3C XML Schema [<a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/'>XML Schema Part 1</a>]
- * , applications must use the value
- * <code>"http://www.w3.org/2001/XMLSchema"</code>. For XML DTD [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>],
- * applications must use the value
- * <code>"http://www.w3.org/TR/REC-xml"</code>. Other Schema languages
- * are outside the scope of the W3C and therefore should recommend an
- * absolute URI in order to use this method.
- * @return The newly created <code>LSParser</code> object. This
- * <code>LSParser</code> is either synchronous or asynchronous
- * depending on the value of the <code>mode</code> argument.
- * <p ><b>Note:</b> By default, the newly created <code>LSParser</code>
- * does not contain a <code>DOMErrorHandler</code>, i.e. the value of
- * the "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-error-handler'>
- * error-handler</a>" configuration parameter is <code>null</code>. However, implementations
- * may provide a default error handler at creation time. In that case,
- * the initial value of the <code>"error-handler"</code> configuration
- * parameter on the new <code>LSParser</code> object contains a
- * reference to the default error handler.
- * @exception DOMException
- * NOT_SUPPORTED_ERR: Raised if the requested mode or schema type is
- * not supported.
- */
- public LSParser createLSParser(short mode,
- String schemaType)
- throws DOMException;
-
- /**
- * Create a new <code>LSSerializer</code> object.
- * @return The newly created <code>LSSerializer</code> object.
- * <p ><b>Note:</b> By default, the newly created
- * <code>LSSerializer</code> has no <code>DOMErrorHandler</code>, i.e.
- * the value of the <code>"error-handler"</code> configuration
- * parameter is <code>null</code>. However, implementations may
- * provide a default error handler at creation time. In that case, the
- * initial value of the <code>"error-handler"</code> configuration
- * parameter on the new <code>LSSerializer</code> object contains a
- * reference to the default error handler.
- */
- public LSSerializer createLSSerializer();
-
- /**
- * Create a new empty input source object where
- * <code>LSInput.characterStream</code>, <code>LSInput.byteStream</code>
- * , <code>LSInput.stringData</code> <code>LSInput.systemId</code>,
- * <code>LSInput.publicId</code>, <code>LSInput.baseURI</code>, and
- * <code>LSInput.encoding</code> are null, and
- * <code>LSInput.certifiedText</code> is false.
- * @return The newly created input object.
- */
- public LSInput createLSInput();
-
- /**
- * Create a new empty output destination object where
- * <code>LSOutput.characterStream</code>,
- * <code>LSOutput.byteStream</code>, <code>LSOutput.systemId</code>,
- * <code>LSOutput.encoding</code> are null.
- * @return The newly created output object.
- */
- public LSOutput createLSOutput();
-
-}
diff --git a/src/org/w3c/dom/ls/LSException.java b/src/org/w3c/dom/ls/LSException.java
deleted file mode 100644
index f23d38a..0000000
--- a/src/org/w3c/dom/ls/LSException.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] in the hope that
- * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom.ls;
-
-/**
- * Parser or write operations may throw an <code>LSException</code> if the
- * processing is stopped. The processing can be stopped due to a
- * <code>DOMError</code> with a severity of
- * <code>DOMError.SEVERITY_FATAL_ERROR</code> or a non recovered
- * <code>DOMError.SEVERITY_ERROR</code>, or if
- * <code>DOMErrorHandler.handleError()</code> returned <code>false</code>.
- * <p ><b>Note:</b> As suggested in the definition of the constants in the
- * <code>DOMError</code> interface, a DOM implementation may choose to
- * continue after a fatal error, but the resulting DOM tree is then
- * implementation dependent.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407'>Document Object Model (DOM) Level 3 Load
-and Save Specification</a>.
- */
-public class LSException extends RuntimeException {
- public LSException(short code, String message) {
- super(message);
- this.code = code;
- }
- public short code;
- // LSExceptionCode
- /**
- * If an attempt was made to load a document, or an XML Fragment, using
- * <code>LSParser</code> and the processing has been stopped.
- */
- public static final short PARSE_ERR = 81;
- /**
- * If an attempt was made to serialize a <code>Node</code> using
- * <code>LSSerializer</code> and the processing has been stopped.
- */
- public static final short SERIALIZE_ERR = 82;
-
-}
diff --git a/src/org/w3c/dom/ls/LSInput.java b/src/org/w3c/dom/ls/LSInput.java
deleted file mode 100644
index a9b08c1..0000000
--- a/src/org/w3c/dom/ls/LSInput.java
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] in the hope that
- * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom.ls;
-
-/**
- * This interface represents an input source for data.
- * <p> This interface allows an application to encapsulate information about
- * an input source in a single object, which may include a public
- * identifier, a system identifier, a byte stream (possibly with a specified
- * encoding), a base URI, and/or a character stream.
- * <p> The exact definitions of a byte stream and a character stream are
- * binding dependent.
- * <p> The application is expected to provide objects that implement this
- * interface whenever such objects are needed. The application can either
- * provide its own objects that implement this interface, or it can use the
- * generic factory method <code>DOMImplementationLS.createLSInput()</code>
- * to create objects that implement this interface.
- * <p> The <code>LSParser</code> will use the <code>LSInput</code> object to
- * determine how to read data. The <code>LSParser</code> will look at the
- * different inputs specified in the <code>LSInput</code> in the following
- * order to know which one to read from, the first one that is not null and
- * not an empty string will be used:
- * <ol>
- * <li> <code>LSInput.characterStream</code>
- * </li>
- * <li>
- * <code>LSInput.byteStream</code>
- * </li>
- * <li> <code>LSInput.stringData</code>
- * </li>
- * <li>
- * <code>LSInput.systemId</code>
- * </li>
- * <li> <code>LSInput.publicId</code>
- * </li>
- * </ol>
- * <p> If all inputs are null, the <code>LSParser</code> will report a
- * <code>DOMError</code> with its <code>DOMError.type</code> set to
- * <code>"no-input-specified"</code> and its <code>DOMError.severity</code>
- * set to <code>DOMError.SEVERITY_FATAL_ERROR</code>.
- * <p> <code>LSInput</code> objects belong to the application. The DOM
- * implementation will never modify them (though it may make copies and
- * modify the copies, if necessary).
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407'>Document Object Model (DOM) Level 3 Load
-and Save Specification</a>.
- */
-public interface LSInput {
- /**
- * An attribute of a language and binding dependent type that represents
- * a stream of 16-bit units. The application must encode the stream
- * using UTF-16 (defined in [Unicode] and in [ISO/IEC 10646]). It is not a requirement to have an XML declaration when
- * using character streams. If an XML declaration is present, the value
- * of the encoding attribute will be ignored.
- */
- public java.io.Reader getCharacterStream();
- /**
- * An attribute of a language and binding dependent type that represents
- * a stream of 16-bit units. The application must encode the stream
- * using UTF-16 (defined in [Unicode] and in [ISO/IEC 10646]). It is not a requirement to have an XML declaration when
- * using character streams. If an XML declaration is present, the value
- * of the encoding attribute will be ignored.
- */
- public void setCharacterStream(java.io.Reader characterStream);
-
- /**
- * An attribute of a language and binding dependent type that represents
- * a stream of bytes.
- * <br> If the application knows the character encoding of the byte
- * stream, it should set the encoding attribute. Setting the encoding in
- * this way will override any encoding specified in an XML declaration
- * in the data.
- */
- public java.io.InputStream getByteStream();
- /**
- * An attribute of a language and binding dependent type that represents
- * a stream of bytes.
- * <br> If the application knows the character encoding of the byte
- * stream, it should set the encoding attribute. Setting the encoding in
- * this way will override any encoding specified in an XML declaration
- * in the data.
- */
- public void setByteStream(java.io.InputStream byteStream);
-
- /**
- * String data to parse. If provided, this will always be treated as a
- * sequence of 16-bit units (UTF-16 encoded characters). It is not a
- * requirement to have an XML declaration when using
- * <code>stringData</code>. If an XML declaration is present, the value
- * of the encoding attribute will be ignored.
- */
- public String getStringData();
- /**
- * String data to parse. If provided, this will always be treated as a
- * sequence of 16-bit units (UTF-16 encoded characters). It is not a
- * requirement to have an XML declaration when using
- * <code>stringData</code>. If an XML declaration is present, the value
- * of the encoding attribute will be ignored.
- */
- public void setStringData(String stringData);
-
- /**
- * The system identifier, a URI reference [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>], for this
- * input source. The system identifier is optional if there is a byte
- * stream, a character stream, or string data. It is still useful to
- * provide one, since the application will use it to resolve any
- * relative URIs and can include it in error messages and warnings. (The
- * LSParser will only attempt to fetch the resource identified by the
- * URI reference if there is no other input available in the input
- * source.)
- * <br> If the application knows the character encoding of the object
- * pointed to by the system identifier, it can set the encoding using
- * the <code>encoding</code> attribute.
- * <br> If the specified system ID is a relative URI reference (see
- * section 5 in [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>]), the DOM
- * implementation will attempt to resolve the relative URI with the
- * <code>baseURI</code> as the base, if that fails, the behavior is
- * implementation dependent.
- */
- public String getSystemId();
- /**
- * The system identifier, a URI reference [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>], for this
- * input source. The system identifier is optional if there is a byte
- * stream, a character stream, or string data. It is still useful to
- * provide one, since the application will use it to resolve any
- * relative URIs and can include it in error messages and warnings. (The
- * LSParser will only attempt to fetch the resource identified by the
- * URI reference if there is no other input available in the input
- * source.)
- * <br> If the application knows the character encoding of the object
- * pointed to by the system identifier, it can set the encoding using
- * the <code>encoding</code> attribute.
- * <br> If the specified system ID is a relative URI reference (see
- * section 5 in [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>]), the DOM
- * implementation will attempt to resolve the relative URI with the
- * <code>baseURI</code> as the base, if that fails, the behavior is
- * implementation dependent.
- */
- public void setSystemId(String systemId);
-
- /**
- * The public identifier for this input source. This may be mapped to an
- * input source using an implementation dependent mechanism (such as
- * catalogues or other mappings). The public identifier, if specified,
- * may also be reported as part of the location information when errors
- * are reported.
- */
- public String getPublicId();
- /**
- * The public identifier for this input source. This may be mapped to an
- * input source using an implementation dependent mechanism (such as
- * catalogues or other mappings). The public identifier, if specified,
- * may also be reported as part of the location information when errors
- * are reported.
- */
- public void setPublicId(String publicId);
-
- /**
- * The base URI to be used (see section 5.1.4 in [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>]) for
- * resolving a relative <code>systemId</code> to an absolute URI.
- * <br> If, when used, the base URI is itself a relative URI, an empty
- * string, or null, the behavior is implementation dependent.
- */
- public String getBaseURI();
- /**
- * The base URI to be used (see section 5.1.4 in [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>]) for
- * resolving a relative <code>systemId</code> to an absolute URI.
- * <br> If, when used, the base URI is itself a relative URI, an empty
- * string, or null, the behavior is implementation dependent.
- */
- public void setBaseURI(String baseURI);
-
- /**
- * The character encoding, if known. The encoding must be a string
- * acceptable for an XML encoding declaration ([<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>] section
- * 4.3.3 "Character Encoding in Entities").
- * <br> This attribute has no effect when the application provides a
- * character stream or string data. For other sources of input, an
- * encoding specified by means of this attribute will override any
- * encoding specified in the XML declaration or the Text declaration, or
- * an encoding obtained from a higher level protocol, such as HTTP [<a href='http://www.ietf.org/rfc/rfc2616.txt'>IETF RFC 2616</a>].
- */
- public String getEncoding();
- /**
- * The character encoding, if known. The encoding must be a string
- * acceptable for an XML encoding declaration ([<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>] section
- * 4.3.3 "Character Encoding in Entities").
- * <br> This attribute has no effect when the application provides a
- * character stream or string data. For other sources of input, an
- * encoding specified by means of this attribute will override any
- * encoding specified in the XML declaration or the Text declaration, or
- * an encoding obtained from a higher level protocol, such as HTTP [<a href='http://www.ietf.org/rfc/rfc2616.txt'>IETF RFC 2616</a>].
- */
- public void setEncoding(String encoding);
-
- /**
- * If set to true, assume that the input is certified (see section 2.13
- * in [<a href='http://www.w3.org/TR/2004/REC-xml11-20040204/'>XML 1.1</a>]) when
- * parsing [<a href='http://www.w3.org/TR/2004/REC-xml11-20040204/'>XML 1.1</a>].
- */
- public boolean getCertifiedText();
- /**
- * If set to true, assume that the input is certified (see section 2.13
- * in [<a href='http://www.w3.org/TR/2004/REC-xml11-20040204/'>XML 1.1</a>]) when
- * parsing [<a href='http://www.w3.org/TR/2004/REC-xml11-20040204/'>XML 1.1</a>].
- */
- public void setCertifiedText(boolean certifiedText);
-
-}
diff --git a/src/org/w3c/dom/ls/LSLoadEvent.java b/src/org/w3c/dom/ls/LSLoadEvent.java
deleted file mode 100644
index 5c9b767..0000000
--- a/src/org/w3c/dom/ls/LSLoadEvent.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] in the hope that
- * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom.ls;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.events.Event;
-
-/**
- * This interface represents a load event object that signals the completion
- * of a document load.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407'>Document Object Model (DOM) Level 3 Load
-and Save Specification</a>.
- */
-public interface LSLoadEvent extends Event {
- /**
- * The document that finished loading.
- */
- public Document getNewDocument();
-
- /**
- * The input source that was parsed.
- */
- public LSInput getInput();
-
-}
diff --git a/src/org/w3c/dom/ls/LSOutput.java b/src/org/w3c/dom/ls/LSOutput.java
deleted file mode 100644
index c6ace48..0000000
--- a/src/org/w3c/dom/ls/LSOutput.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] in the hope that
- * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom.ls;
-
-/**
- * This interface represents an output destination for data.
- * <p> This interface allows an application to encapsulate information about
- * an output destination in a single object, which may include a URI, a byte
- * stream (possibly with a specified encoding), a base URI, and/or a
- * character stream.
- * <p> The exact definitions of a byte stream and a character stream are
- * binding dependent.
- * <p> The application is expected to provide objects that implement this
- * interface whenever such objects are needed. The application can either
- * provide its own objects that implement this interface, or it can use the
- * generic factory method <code>DOMImplementationLS.createLSOutput()</code>
- * to create objects that implement this interface.
- * <p> The <code>LSSerializer</code> will use the <code>LSOutput</code> object
- * to determine where to serialize the output to. The
- * <code>LSSerializer</code> will look at the different outputs specified in
- * the <code>LSOutput</code> in the following order to know which one to
- * output to, the first one that is not null and not an empty string will be
- * used:
- * <ol>
- * <li> <code>LSOutput.characterStream</code>
- * </li>
- * <li>
- * <code>LSOutput.byteStream</code>
- * </li>
- * <li> <code>LSOutput.systemId</code>
- * </li>
- * </ol>
- * <p> <code>LSOutput</code> objects belong to the application. The DOM
- * implementation will never modify them (though it may make copies and
- * modify the copies, if necessary).
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407'>Document Object Model (DOM) Level 3 Load
-and Save Specification</a>.
- */
-public interface LSOutput {
- /**
- * An attribute of a language and binding dependent type that represents
- * a writable stream to which 16-bit units can be output.
- */
- public java.io.Writer getCharacterStream();
- /**
- * An attribute of a language and binding dependent type that represents
- * a writable stream to which 16-bit units can be output.
- */
- public void setCharacterStream(java.io.Writer characterStream);
-
- /**
- * An attribute of a language and binding dependent type that represents
- * a writable stream of bytes.
- */
- public java.io.OutputStream getByteStream();
- /**
- * An attribute of a language and binding dependent type that represents
- * a writable stream of bytes.
- */
- public void setByteStream(java.io.OutputStream byteStream);
-
- /**
- * The system identifier, a URI reference [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>], for this
- * output destination.
- * <br> If the system ID is a relative URI reference (see section 5 in [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>]), the
- * behavior is implementation dependent.
- */
- public String getSystemId();
- /**
- * The system identifier, a URI reference [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>], for this
- * output destination.
- * <br> If the system ID is a relative URI reference (see section 5 in [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>]), the
- * behavior is implementation dependent.
- */
- public void setSystemId(String systemId);
-
- /**
- * The character encoding to use for the output. The encoding must be a
- * string acceptable for an XML encoding declaration ([<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>] section
- * 4.3.3 "Character Encoding in Entities"), it is recommended that
- * character encodings registered (as charsets) with the Internet
- * Assigned Numbers Authority [<a href='ftp://ftp.isi.edu/in-notes/iana/assignments/character-sets'>IANA-CHARSETS</a>]
- * should be referred to using their registered names.
- */
- public String getEncoding();
- /**
- * The character encoding to use for the output. The encoding must be a
- * string acceptable for an XML encoding declaration ([<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>] section
- * 4.3.3 "Character Encoding in Entities"), it is recommended that
- * character encodings registered (as charsets) with the Internet
- * Assigned Numbers Authority [<a href='ftp://ftp.isi.edu/in-notes/iana/assignments/character-sets'>IANA-CHARSETS</a>]
- * should be referred to using their registered names.
- */
- public void setEncoding(String encoding);
-
-}
diff --git a/src/org/w3c/dom/ls/LSParser.java b/src/org/w3c/dom/ls/LSParser.java
deleted file mode 100644
index 72d7db2..0000000
--- a/src/org/w3c/dom/ls/LSParser.java
+++ /dev/null
@@ -1,495 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] in the hope that
- * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom.ls;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.DOMConfiguration;
-import org.w3c.dom.Node;
-import org.w3c.dom.DOMException;
-
-/**
- * An interface to an object that is able to build, or augment, a DOM tree
- * from various input sources.
- * <p> <code>LSParser</code> provides an API for parsing XML and building the
- * corresponding DOM document structure. A <code>LSParser</code> instance
- * can be obtained by invoking the
- * <code>DOMImplementationLS.createLSParser()</code> method.
- * <p> As specified in [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>DOM Level 3 Core</a>]
- * , when a document is first made available via the LSParser:
- * <ul>
- * <li> there will
- * never be two adjacent nodes of type NODE_TEXT, and there will never be
- * empty text nodes.
- * </li>
- * <li> it is expected that the <code>value</code> and
- * <code>nodeValue</code> attributes of an <code>Attr</code> node initially
- * return the <a href='http://www.w3.org/TR/2004/REC-xml-20040204#AVNormalize'>XML 1.0
- * normalized value</a>. However, if the parameters "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-validate-if-schema'>
- * validate-if-schema</a>" and "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-datatype-normalization'>
- * datatype-normalization</a>" are set to <code>true</code>, depending on the attribute normalization
- * used, the attribute values may differ from the ones obtained by the XML
- * 1.0 attribute normalization. If the parameters "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-datatype-normalization'>
- * datatype-normalization</a>" is set to <code>false</code>, the XML 1.0 attribute normalization is
- * guaranteed to occur, and if the attributes list does not contain
- * namespace declarations, the <code>attributes</code> attribute on
- * <code>Element</code> node represents the property <b>[attributes]</b> defined in [<a href='http://www.w3.org/TR/2004/REC-xml-infoset-20040204/'>XML Information Set</a>]
- * .
- * </li>
- * </ul>
- * <p> Asynchronous <code>LSParser</code> objects are expected to also
- * implement the <code>events::EventTarget</code> interface so that event
- * listeners can be registered on asynchronous <code>LSParser</code>
- * objects.
- * <p> Events supported by asynchronous <code>LSParser</code> objects are:
- * <dl>
- * <dt>load</dt>
- * <dd>
- * The <code>LSParser</code> finishes to load the document. See also the
- * definition of the <code>LSLoadEvent</code> interface. </dd>
- * <dt>progress</dt>
- * <dd> The
- * <code>LSParser</code> signals progress as data is parsed. This
- * specification does not attempt to define exactly when progress events
- * should be dispatched. That is intentionally left as
- * implementation-dependent. Here is one example of how an application might
- * dispatch progress events: Once the parser starts receiving data, a
- * progress event is dispatched to indicate that the parsing starts. From
- * there on, a progress event is dispatched for every 4096 bytes of data
- * that is received and processed. This is only one example, though, and
- * implementations can choose to dispatch progress events at any time while
- * parsing, or not dispatch them at all. See also the definition of the
- * <code>LSProgressEvent</code> interface. </dd>
- * </dl>
- * <p ><b>Note:</b> All events defined in this specification use the
- * namespace URI <code>"http://www.w3.org/2002/DOMLS"</code>.
- * <p> While parsing an input source, errors are reported to the application
- * through the error handler (<code>LSParser.domConfig</code>'s "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-error-handler'>
- * error-handler</a>" parameter). This specification does in no way try to define all possible
- * errors that can occur while parsing XML, or any other markup, but some
- * common error cases are defined. The types (<code>DOMError.type</code>) of
- * errors and warnings defined by this specification are:
- * <dl>
- * <dt>
- * <code>"check-character-normalization-failure" [error]</code> </dt>
- * <dd> Raised if
- * the parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-check-character-normalization'>
- * check-character-normalization</a>" is set to true and a string is encountered that fails normalization
- * checking. </dd>
- * <dt><code>"doctype-not-allowed" [fatal]</code></dt>
- * <dd> Raised if the
- * configuration parameter "disallow-doctype" is set to <code>true</code>
- * and a doctype is encountered. </dd>
- * <dt><code>"no-input-specified" [fatal]</code></dt>
- * <dd>
- * Raised when loading a document and no input is specified in the
- * <code>LSInput</code> object. </dd>
- * <dt>
- * <code>"pi-base-uri-not-preserved" [warning]</code></dt>
- * <dd> Raised if a processing
- * instruction is encountered in a location where the base URI of the
- * processing instruction can not be preserved. One example of a case where
- * this warning will be raised is if the configuration parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-entities'>
- * entities</a>" is set to <code>false</code> and the following XML file is parsed:
- * <pre>
- * &lt;!DOCTYPE root [ &lt;!ENTITY e SYSTEM 'subdir/myentity.ent' ]&gt;
- * &lt;root&gt; &amp;e; &lt;/root&gt;</pre>
- * And <code>subdir/myentity.ent</code>
- * contains:
- * <pre>&lt;one&gt; &lt;two/&gt; &lt;/one&gt; &lt;?pi 3.14159?&gt;
- * &lt;more/&gt;</pre>
- * </dd>
- * <dt><code>"unbound-prefix-in-entity" [warning]</code></dt>
- * <dd> An
- * implementation dependent warning that may be raised if the configuration
- * parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-namespaces'>
- * namespaces</a>" is set to <code>true</code> and an unbound namespace prefix is
- * encountered in an entity's replacement text. Raising this warning is not
- * enforced since some existing parsers may not recognize unbound namespace
- * prefixes in the replacement text of entities. </dd>
- * <dt>
- * <code>"unknown-character-denormalization" [fatal]</code></dt>
- * <dd> Raised if the
- * configuration parameter "ignore-unknown-character-denormalizations" is
- * set to <code>false</code> and a character is encountered for which the
- * processor cannot determine the normalization properties. </dd>
- * <dt>
- * <code>"unsupported-encoding" [fatal]</code></dt>
- * <dd> Raised if an unsupported
- * encoding is encountered. </dd>
- * <dt><code>"unsupported-media-type" [fatal]</code></dt>
- * <dd>
- * Raised if the configuration parameter "supported-media-types-only" is set
- * to <code>true</code> and an unsupported media type is encountered. </dd>
- * </dl>
- * <p> In addition to raising the defined errors and warnings, implementations
- * are expected to raise implementation specific errors and warnings for any
- * other error and warning cases such as IO errors (file not found,
- * permission denied,...), XML well-formedness errors, and so on.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407'>Document Object Model (DOM) Level 3 Load
-and Save Specification</a>.
- */
-public interface LSParser {
- /**
- * The <code>DOMConfiguration</code> object used when parsing an input
- * source. This <code>DOMConfiguration</code> is specific to the parse
- * operation. No parameter values from this <code>DOMConfiguration</code>
- * object are passed automatically to the <code>DOMConfiguration</code>
- * object on the <code>Document</code> that is created, or used, by the
- * parse operation. The DOM application is responsible for passing any
- * needed parameter values from this <code>DOMConfiguration</code>
- * object to the <code>DOMConfiguration</code> object referenced by the
- * <code>Document</code> object.
- * <br> In addition to the parameters recognized in on the <a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMConfiguration'>
- * DOMConfiguration</a> interface defined in [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>DOM Level 3 Core</a>]
- * , the <code>DOMConfiguration</code> objects for <code>LSParser</code>
- * add or modify the following parameters:
- * <dl>
- * <dt>
- * <code>"charset-overrides-xml-encoding"</code></dt>
- * <dd>
- * <dl>
- * <dt><code>true</code></dt>
- * <dd>[<em>optional</em>] (<em>default</em>) If a higher level protocol such as HTTP [<a href='http://www.ietf.org/rfc/rfc2616.txt'>IETF RFC 2616</a>] provides an
- * indication of the character encoding of the input stream being
- * processed, that will override any encoding specified in the XML
- * declaration or the Text declaration (see also section 4.3.3,
- * "Character Encoding in Entities", in [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>]).
- * Explicitly setting an encoding in the <code>LSInput</code> overrides
- * any encoding from the protocol. </dd>
- * <dt><code>false</code></dt>
- * <dd>[<em>required</em>] The parser ignores any character set encoding information from
- * higher-level protocols. </dd>
- * </dl></dd>
- * <dt><code>"disallow-doctype"</code></dt>
- * <dd>
- * <dl>
- * <dt>
- * <code>true</code></dt>
- * <dd>[<em>optional</em>] Throw a fatal <b>"doctype-not-allowed"</b> error if a doctype node is found while parsing the document. This is
- * useful when dealing with things like SOAP envelopes where doctype
- * nodes are not allowed. </dd>
- * <dt><code>false</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>) Allow doctype nodes in the document. </dd>
- * </dl></dd>
- * <dt>
- * <code>"ignore-unknown-character-denormalizations"</code></dt>
- * <dd>
- * <dl>
- * <dt>
- * <code>true</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>) If, while verifying full normalization when [<a href='http://www.w3.org/TR/2004/REC-xml11-20040204/'>XML 1.1</a>] is
- * supported, a processor encounters characters for which it cannot
- * determine the normalization properties, then the processor will
- * ignore any possible denormalizations caused by these characters.
- * This parameter is ignored for [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>]. </dd>
- * <dt>
- * <code>false</code></dt>
- * <dd>[<em>optional</em>] Report an fatal <b>"unknown-character-denormalization"</b> error if a character is encountered for which the processor cannot
- * determine the normalization properties. </dd>
- * </dl></dd>
- * <dt><code>"infoset"</code></dt>
- * <dd> See
- * the definition of <code>DOMConfiguration</code> for a description of
- * this parameter. Unlike in [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>DOM Level 3 Core</a>]
- * , this parameter will default to <code>true</code> for
- * <code>LSParser</code>. </dd>
- * <dt><code>"namespaces"</code></dt>
- * <dd>
- * <dl>
- * <dt><code>true</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>) Perform the namespace processing as defined in [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>]
- * and [<a href='http://www.w3.org/TR/2004/REC-xml-names11-20040204/'>XML Namespaces 1.1</a>]
- * . </dd>
- * <dt><code>false</code></dt>
- * <dd>[<em>optional</em>] Do not perform the namespace processing. </dd>
- * </dl></dd>
- * <dt>
- * <code>"resource-resolver"</code></dt>
- * <dd>[<em>required</em>] A reference to a <code>LSResourceResolver</code> object, or null. If
- * the value of this parameter is not null when an external resource
- * (such as an external XML entity or an XML schema location) is
- * encountered, the implementation will request that the
- * <code>LSResourceResolver</code> referenced in this parameter resolves
- * the resource. </dd>
- * <dt><code>"supported-media-types-only"</code></dt>
- * <dd>
- * <dl>
- * <dt>
- * <code>true</code></dt>
- * <dd>[<em>optional</em>] Check that the media type of the parsed resource is a supported media
- * type. If an unsupported media type is encountered, a fatal error of
- * type <b>"unsupported-media-type"</b> will be raised. The media types defined in [<a href='http://www.ietf.org/rfc/rfc3023.txt'>IETF RFC 3023</a>] must always
- * be accepted. </dd>
- * <dt><code>false</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>) Accept any media type. </dd>
- * </dl></dd>
- * <dt><code>"validate"</code></dt>
- * <dd> See the definition of
- * <code>DOMConfiguration</code> for a description of this parameter.
- * Unlike in [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>DOM Level 3 Core</a>]
- * , the processing of the internal subset is always accomplished, even
- * if this parameter is set to <code>false</code>. </dd>
- * <dt>
- * <code>"validate-if-schema"</code></dt>
- * <dd> See the definition of
- * <code>DOMConfiguration</code> for a description of this parameter.
- * Unlike in [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>DOM Level 3 Core</a>]
- * , the processing of the internal subset is always accomplished, even
- * if this parameter is set to <code>false</code>. </dd>
- * <dt>
- * <code>"well-formed"</code></dt>
- * <dd> See the definition of
- * <code>DOMConfiguration</code> for a description of this parameter.
- * Unlike in [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>DOM Level 3 Core</a>]
- * , this parameter cannot be set to <code>false</code>. </dd>
- * </dl>
- */
- public DOMConfiguration getDomConfig();
-
- /**
- * When a filter is provided, the implementation will call out to the
- * filter as it is constructing the DOM tree structure. The filter can
- * choose to remove elements from the document being constructed, or to
- * terminate the parsing early.
- * <br> The filter is invoked after the operations requested by the
- * <code>DOMConfiguration</code> parameters have been applied. For
- * example, if "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-validate'>
- * validate</a>" is set to <code>true</code>, the validation is done before invoking the
- * filter.
- */
- public LSParserFilter getFilter();
- /**
- * When a filter is provided, the implementation will call out to the
- * filter as it is constructing the DOM tree structure. The filter can
- * choose to remove elements from the document being constructed, or to
- * terminate the parsing early.
- * <br> The filter is invoked after the operations requested by the
- * <code>DOMConfiguration</code> parameters have been applied. For
- * example, if "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-validate'>
- * validate</a>" is set to <code>true</code>, the validation is done before invoking the
- * filter.
- */
- public void setFilter(LSParserFilter filter);
-
- /**
- * <code>true</code> if the <code>LSParser</code> is asynchronous,
- * <code>false</code> if it is synchronous.
- */
- public boolean getAsync();
-
- /**
- * <code>true</code> if the <code>LSParser</code> is currently busy
- * loading a document, otherwise <code>false</code>.
- */
- public boolean getBusy();
-
- /**
- * Parse an XML document from a resource identified by a
- * <code>LSInput</code>.
- * @param input The <code>LSInput</code> from which the source of the
- * document is to be read.
- * @return If the <code>LSParser</code> is a synchronous
- * <code>LSParser</code>, the newly created and populated
- * <code>Document</code> is returned. If the <code>LSParser</code> is
- * asynchronous, <code>null</code> is returned since the document
- * object may not yet be constructed when this method returns.
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if the <code>LSParser</code>'s
- * <code>LSParser.busy</code> attribute is <code>true</code>.
- * @exception LSException
- * PARSE_ERR: Raised if the <code>LSParser</code> was unable to load
- * the XML document. DOM applications should attach a
- * <code>DOMErrorHandler</code> using the parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-error-handler'>
- * error-handler</a>" if they wish to get details on the error.
- */
- public Document parse(LSInput input)
- throws DOMException, LSException;
-
- /**
- * Parse an XML document from a location identified by a URI reference [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>]. If the URI
- * contains a fragment identifier (see section 4.1 in [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>]), the
- * behavior is not defined by this specification, future versions of
- * this specification may define the behavior.
- * @param uri The location of the XML document to be read.
- * @return If the <code>LSParser</code> is a synchronous
- * <code>LSParser</code>, the newly created and populated
- * <code>Document</code> is returned, or <code>null</code> if an error
- * occured. If the <code>LSParser</code> is asynchronous,
- * <code>null</code> is returned since the document object may not yet
- * be constructed when this method returns.
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if the <code>LSParser.busy</code>
- * attribute is <code>true</code>.
- * @exception LSException
- * PARSE_ERR: Raised if the <code>LSParser</code> was unable to load
- * the XML document. DOM applications should attach a
- * <code>DOMErrorHandler</code> using the parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-error-handler'>
- * error-handler</a>" if they wish to get details on the error.
- */
- public Document parseURI(String uri)
- throws DOMException, LSException;
-
- // ACTION_TYPES
- /**
- * Append the result of the parse operation as children of the context
- * node. For this action to work, the context node must be an
- * <code>Element</code> or a <code>DocumentFragment</code>.
- */
- public static final short ACTION_APPEND_AS_CHILDREN = 1;
- /**
- * Replace all the children of the context node with the result of the
- * parse operation. For this action to work, the context node must be an
- * <code>Element</code>, a <code>Document</code>, or a
- * <code>DocumentFragment</code>.
- */
- public static final short ACTION_REPLACE_CHILDREN = 2;
- /**
- * Insert the result of the parse operation as the immediately preceding
- * sibling of the context node. For this action to work the context
- * node's parent must be an <code>Element</code> or a
- * <code>DocumentFragment</code>.
- */
- public static final short ACTION_INSERT_BEFORE = 3;
- /**
- * Insert the result of the parse operation as the immediately following
- * sibling of the context node. For this action to work the context
- * node's parent must be an <code>Element</code> or a
- * <code>DocumentFragment</code>.
- */
- public static final short ACTION_INSERT_AFTER = 4;
- /**
- * Replace the context node with the result of the parse operation. For
- * this action to work, the context node must have a parent, and the
- * parent must be an <code>Element</code> or a
- * <code>DocumentFragment</code>.
- */
- public static final short ACTION_REPLACE = 5;
-
- /**
- * Parse an XML fragment from a resource identified by a
- * <code>LSInput</code> and insert the content into an existing document
- * at the position specified with the <code>context</code> and
- * <code>action</code> arguments. When parsing the input stream, the
- * context node (or its parent, depending on where the result will be
- * inserted) is used for resolving unbound namespace prefixes. The
- * context node's <code>ownerDocument</code> node (or the node itself if
- * the node of type <code>DOCUMENT_NODE</code>) is used to resolve
- * default attributes and entity references.
- * <br> As the new data is inserted into the document, at least one
- * mutation event is fired per new immediate child or sibling of the
- * context node.
- * <br> If the context node is a <code>Document</code> node and the action
- * is <code>ACTION_REPLACE_CHILDREN</code>, then the document that is
- * passed as the context node will be changed such that its
- * <code>xmlEncoding</code>, <code>documentURI</code>,
- * <code>xmlVersion</code>, <code>inputEncoding</code>,
- * <code>xmlStandalone</code>, and all other such attributes are set to
- * what they would be set to if the input source was parsed using
- * <code>LSParser.parse()</code>.
- * <br> This method is always synchronous, even if the
- * <code>LSParser</code> is asynchronous (<code>LSParser.async</code> is
- * <code>true</code>).
- * <br> If an error occurs while parsing, the caller is notified through
- * the <code>ErrorHandler</code> instance associated with the "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-error-handler'>
- * error-handler</a>" parameter of the <code>DOMConfiguration</code>.
- * <br> When calling <code>parseWithContext</code>, the values of the
- * following configuration parameters will be ignored and their default
- * values will always be used instead: "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-validate'>
- * validate</a>", "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-validate-if-schema'>
- * validate-if-schema</a>", and "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-element-content-whitespace'>
- * element-content-whitespace</a>". Other parameters will be treated normally, and the parser is expected
- * to call the <code>LSParserFilter</code> just as if a whole document
- * was parsed.
- * @param input The <code>LSInput</code> from which the source document
- * is to be read. The source document must be an XML fragment, i.e.
- * anything except a complete XML document (except in the case where
- * the context node of type <code>DOCUMENT_NODE</code>, and the action
- * is <code>ACTION_REPLACE_CHILDREN</code>), a DOCTYPE (internal
- * subset), entity declaration(s), notation declaration(s), or XML or
- * text declaration(s).
- * @param contextArg The node that is used as the context for the data
- * that is being parsed. This node must be a <code>Document</code>
- * node, a <code>DocumentFragment</code> node, or a node of a type
- * that is allowed as a child of an <code>Element</code> node, e.g. it
- * cannot be an <code>Attribute</code> node.
- * @param action This parameter describes which action should be taken
- * between the new set of nodes being inserted and the existing
- * children of the context node. The set of possible actions is
- * defined in <code>ACTION_TYPES</code> above.
- * @return Return the node that is the result of the parse operation. If
- * the result is more than one top-level node, the first one is
- * returned.
- * @exception DOMException
- * HIERARCHY_REQUEST_ERR: Raised if the content cannot replace, be
- * inserted before, after, or as a child of the context node (see also
- * <code>Node.insertBefore</code> or <code>Node.replaceChild</code> in [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>DOM Level 3 Core</a>]
- * ).
- * <br> NOT_SUPPORTED_ERR: Raised if the <code>LSParser</code> doesn't
- * support this method, or if the context node is of type
- * <code>Document</code> and the DOM implementation doesn't support
- * the replacement of the <code>DocumentType</code> child or
- * <code>Element</code> child.
- * <br> NO_MODIFICATION_ALLOWED_ERR: Raised if the context node is a
- * read only node and the content is being appended to its child list,
- * or if the parent node of the context node is read only node and the
- * content is being inserted in its child list.
- * <br> INVALID_STATE_ERR: Raised if the <code>LSParser.busy</code>
- * attribute is <code>true</code>.
- * @exception LSException
- * PARSE_ERR: Raised if the <code>LSParser</code> was unable to load
- * the XML fragment. DOM applications should attach a
- * <code>DOMErrorHandler</code> using the parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-error-handler'>
- * error-handler</a>" if they wish to get details on the error.
- */
- public Node parseWithContext(LSInput input,
- Node contextArg,
- short action)
- throws DOMException, LSException;
-
- /**
- * Abort the loading of the document that is currently being loaded by
- * the <code>LSParser</code>. If the <code>LSParser</code> is currently
- * not busy, a call to this method does nothing.
- */
- public void abort();
-
-}
diff --git a/src/org/w3c/dom/ls/LSParserFilter.java b/src/org/w3c/dom/ls/LSParserFilter.java
deleted file mode 100644
index 0638c38..0000000
--- a/src/org/w3c/dom/ls/LSParserFilter.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] in the hope that
- * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom.ls;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.Element;
-
-/**
- * <code>LSParserFilter</code>s provide applications the ability to examine
- * nodes as they are being constructed while parsing. As each node is
- * examined, it may be modified or removed, or the entire parse may be
- * terminated early.
- * <p> At the time any of the filter methods are called by the parser, the
- * owner Document and DOMImplementation objects exist and are accessible.
- * The document element is never passed to the <code>LSParserFilter</code>
- * methods, i.e. it is not possible to filter out the document element.
- * <code>Document</code>, <code>DocumentType</code>, <code>Notation</code>,
- * <code>Entity</code>, and <code>Attr</code> nodes are never passed to the
- * <code>acceptNode</code> method on the filter. The child nodes of an
- * <code>EntityReference</code> node are passed to the filter if the
- * parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-entities'>
- * entities</a>" is set to <code>false</code>. Note that, as described by the parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-entities'>
- * entities</a>", unexpanded entity reference nodes are never discarded and are always
- * passed to the filter.
- * <p> All validity checking while parsing a document occurs on the source
- * document as it appears on the input stream, not on the DOM document as it
- * is built in memory. With filters, the document in memory may be a subset
- * of the document on the stream, and its validity may have been affected by
- * the filtering.
- * <p> All default attributes must be present on elements when the elements
- * are passed to the filter methods. All other default content must be
- * passed to the filter methods.
- * <p> DOM applications must not raise exceptions in a filter. The effect of
- * throwing exceptions from a filter is DOM implementation dependent.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407'>Document Object Model (DOM) Level 3 Load
-and Save Specification</a>.
- */
-public interface LSParserFilter {
- // Constants returned by startElement and acceptNode
- /**
- * Accept the node.
- */
- public static final short FILTER_ACCEPT = 1;
- /**
- * Reject the node and its children.
- */
- public static final short FILTER_REJECT = 2;
- /**
- * Skip this single node. The children of this node will still be
- * considered.
- */
- public static final short FILTER_SKIP = 3;
- /**
- * Interrupt the normal processing of the document.
- */
- public static final short FILTER_INTERRUPT = 4;
-
- /**
- * The parser will call this method after each <code>Element</code> start
- * tag has been scanned, but before the remainder of the
- * <code>Element</code> is processed. The intent is to allow the
- * element, including any children, to be efficiently skipped. Note that
- * only element nodes are passed to the <code>startElement</code>
- * function.
- * <br>The element node passed to <code>startElement</code> for filtering
- * will include all of the Element's attributes, but none of the
- * children nodes. The Element may not yet be in place in the document
- * being constructed (it may not have a parent node.)
- * <br>A <code>startElement</code> filter function may access or change
- * the attributes for the Element. Changing Namespace declarations will
- * have no effect on namespace resolution by the parser.
- * <br>For efficiency, the Element node passed to the filter may not be
- * the same one as is actually placed in the tree if the node is
- * accepted. And the actual node (node object identity) may be reused
- * during the process of reading in and filtering a document.
- * @param elementArg The newly encountered element. At the time this
- * method is called, the element is incomplete - it will have its
- * attributes, but no children.
- * @return
- * <ul>
- * <li> <code>FILTER_ACCEPT</code> if the <code>Element</code> should
- * be included in the DOM document being built.
- * </li>
- * <li>
- * <code>FILTER_REJECT</code> if the <code>Element</code> and all of
- * its children should be rejected.
- * </li>
- * <li> <code>FILTER_SKIP</code> if the
- * <code>Element</code> should be skipped. All of its children are
- * inserted in place of the skipped <code>Element</code> node.
- * </li>
- * <li>
- * <code>FILTER_INTERRUPT</code> if the filter wants to stop the
- * processing of the document. Interrupting the processing of the
- * document does no longer guarantee that the resulting DOM tree is
- * XML well-formed. The <code>Element</code> is rejected.
- * </li>
- * </ul> Returning
- * any other values will result in unspecified behavior.
- */
- public short startElement(Element elementArg);
-
- /**
- * This method will be called by the parser at the completion of the
- * parsing of each node. The node and all of its descendants will exist
- * and be complete. The parent node will also exist, although it may be
- * incomplete, i.e. it may have additional children that have not yet
- * been parsed. Attribute nodes are never passed to this function.
- * <br>From within this method, the new node may be freely modified -
- * children may be added or removed, text nodes modified, etc. The state
- * of the rest of the document outside this node is not defined, and the
- * affect of any attempt to navigate to, or to modify any other part of
- * the document is undefined.
- * <br>For validating parsers, the checks are made on the original
- * document, before any modification by the filter. No validity checks
- * are made on any document modifications made by the filter.
- * <br>If this new node is rejected, the parser might reuse the new node
- * and any of its descendants.
- * @param nodeArg The newly constructed element. At the time this method
- * is called, the element is complete - it has all of its children
- * (and their children, recursively) and attributes, and is attached
- * as a child to its parent.
- * @return
- * <ul>
- * <li> <code>FILTER_ACCEPT</code> if this <code>Node</code> should
- * be included in the DOM document being built.
- * </li>
- * <li>
- * <code>FILTER_REJECT</code> if the <code>Node</code> and all of its
- * children should be rejected.
- * </li>
- * <li> <code>FILTER_SKIP</code> if the
- * <code>Node</code> should be skipped and the <code>Node</code>
- * should be replaced by all the children of the <code>Node</code>.
- * </li>
- * <li>
- * <code>FILTER_INTERRUPT</code> if the filter wants to stop the
- * processing of the document. Interrupting the processing of the
- * document does no longer guarantee that the resulting DOM tree is
- * XML well-formed. The <code>Node</code> is accepted and will be the
- * last completely parsed node.
- * </li>
- * </ul>
- */
- public short acceptNode(Node nodeArg);
-
- /**
- * Tells the <code>LSParser</code> what types of nodes to show to the
- * method <code>LSParserFilter.acceptNode</code>. If a node is not shown
- * to the filter using this attribute, it is automatically included in
- * the DOM document being built. See <code>NodeFilter</code> for
- * definition of the constants. The constants <code>SHOW_ATTRIBUTE</code>
- * , <code>SHOW_DOCUMENT</code>, <code>SHOW_DOCUMENT_TYPE</code>,
- * <code>SHOW_NOTATION</code>, <code>SHOW_ENTITY</code>, and
- * <code>SHOW_DOCUMENT_FRAGMENT</code> are meaningless here. Those nodes
- * will never be passed to <code>LSParserFilter.acceptNode</code>.
- * <br> The constants used here are defined in [<a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>DOM Level 2 Traversal and Range</a>]
- * .
- */
- public int getWhatToShow();
-
-}
diff --git a/src/org/w3c/dom/ls/LSProgressEvent.java b/src/org/w3c/dom/ls/LSProgressEvent.java
deleted file mode 100644
index 25a76a6..0000000
--- a/src/org/w3c/dom/ls/LSProgressEvent.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] in the hope that
- * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom.ls;
-
-import org.w3c.dom.events.Event;
-
-/**
- * This interface represents a progress event object that notifies the
- * application about progress as a document is parsed. It extends the
- * <code>Event</code> interface defined in [<a href='http://www.w3.org/TR/2003/NOTE-DOM-Level-3-Events-20031107'>DOM Level 3 Events</a>]
- * .
- * <p> The units used for the attributes <code>position</code> and
- * <code>totalSize</code> are not specified and can be implementation and
- * input dependent.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407'>Document Object Model (DOM) Level 3 Load
-and Save Specification</a>.
- */
-public interface LSProgressEvent extends Event {
- /**
- * The input source that is being parsed.
- */
- public LSInput getInput();
-
- /**
- * The current position in the input source, including all external
- * entities and other resources that have been read.
- */
- public int getPosition();
-
- /**
- * The total size of the document including all external resources, this
- * number might change as a document is being parsed if references to
- * more external resources are seen. A value of <code>0</code> is
- * returned if the total size cannot be determined or estimated.
- */
- public int getTotalSize();
-
-}
diff --git a/src/org/w3c/dom/ls/LSResourceResolver.java b/src/org/w3c/dom/ls/LSResourceResolver.java
deleted file mode 100644
index bcb57be..0000000
--- a/src/org/w3c/dom/ls/LSResourceResolver.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] in the hope that
- * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom.ls;
-
-/**
- * <code>LSResourceResolver</code> provides a way for applications to
- * redirect references to external resources.
- * <p> Applications needing to implement custom handling for external
- * resources can implement this interface and register their implementation
- * by setting the "resource-resolver" parameter of
- * <code>DOMConfiguration</code> objects attached to <code>LSParser</code>
- * and <code>LSSerializer</code>. It can also be register on
- * <code>DOMConfiguration</code> objects attached to <code>Document</code>
- * if the "LS" feature is supported.
- * <p> The <code>LSParser</code> will then allow the application to intercept
- * any external entities, including the external DTD subset and external
- * parameter entities, before including them. The top-level document entity
- * is never passed to the <code>resolveResource</code> method.
- * <p> Many DOM applications will not need to implement this interface, but it
- * will be especially useful for applications that build XML documents from
- * databases or other specialized input sources, or for applications that
- * use URNs.
- * <p ><b>Note:</b> <code>LSResourceResolver</code> is based on the SAX2 [<a href='http://www.saxproject.org/'>SAX</a>] <code>EntityResolver</code>
- * interface.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407'>Document Object Model (DOM) Level 3 Load
-and Save Specification</a>.
- */
-public interface LSResourceResolver {
- /**
- * Allow the application to resolve external resources.
- * <br> The <code>LSParser</code> will call this method before opening any
- * external resource, including the external DTD subset, external
- * entities referenced within the DTD, and external entities referenced
- * within the document element (however, the top-level document entity
- * is not passed to this method). The application may then request that
- * the <code>LSParser</code> resolve the external resource itself, that
- * it use an alternative URI, or that it use an entirely different input
- * source.
- * <br> Application writers can use this method to redirect external
- * system identifiers to secure and/or local URI, to look up public
- * identifiers in a catalogue, or to read an entity from a database or
- * other input source (including, for example, a dialog box).
- * @param type The type of the resource being resolved. For XML [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>] resources
- * (i.e. entities), applications must use the value
- * <code>"http://www.w3.org/TR/REC-xml"</code>. For XML Schema [<a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/'>XML Schema Part 1</a>]
- * , applications must use the value
- * <code>"http://www.w3.org/2001/XMLSchema"</code>. Other types of
- * resources are outside the scope of this specification and therefore
- * should recommend an absolute URI in order to use this method.
- * @param namespaceURI The namespace of the resource being resolved,
- * e.g. the target namespace of the XML Schema [<a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/'>XML Schema Part 1</a>]
- * when resolving XML Schema resources.
- * @param publicId The public identifier of the external entity being
- * referenced, or <code>null</code> if no public identifier was
- * supplied or if the resource is not an entity.
- * @param systemId The system identifier, a URI reference [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>], of the
- * external resource being referenced, or <code>null</code> if no
- * system identifier was supplied.
- * @param baseURI The absolute base URI of the resource being parsed, or
- * <code>null</code> if there is no base URI.
- * @return A <code>LSInput</code> object describing the new input
- * source, or <code>null</code> to request that the parser open a
- * regular URI connection to the resource.
- */
- public LSInput resolveResource(String type,
- String namespaceURI,
- String publicId,
- String systemId,
- String baseURI);
-
-}
diff --git a/src/org/w3c/dom/ls/LSSerializer.java b/src/org/w3c/dom/ls/LSSerializer.java
deleted file mode 100644
index 6553f21..0000000
--- a/src/org/w3c/dom/ls/LSSerializer.java
+++ /dev/null
@@ -1,465 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] in the hope that
- * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom.ls;
-
-import org.w3c.dom.DOMConfiguration;
-import org.w3c.dom.Node;
-import org.w3c.dom.DOMException;
-
-/**
- * A <code>LSSerializer</code> provides an API for serializing (writing) a
- * DOM document out into XML. The XML data is written to a string or an
- * output stream. Any changes or fixups made during the serialization affect
- * only the serialized data. The <code>Document</code> object and its
- * children are never altered by the serialization operation.
- * <p> During serialization of XML data, namespace fixup is done as defined in [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>DOM Level 3 Core</a>]
- * , Appendix B. [<a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113'>DOM Level 2 Core</a>]
- * allows empty strings as a real namespace URI. If the
- * <code>namespaceURI</code> of a <code>Node</code> is empty string, the
- * serialization will treat them as <code>null</code>, ignoring the prefix
- * if any.
- * <p> <code>LSSerializer</code> accepts any node type for serialization. For
- * nodes of type <code>Document</code> or <code>Entity</code>, well-formed
- * XML will be created when possible (well-formedness is guaranteed if the
- * document or entity comes from a parse operation and is unchanged since it
- * was created). The serialized output for these node types is either as a
- * XML document or an External XML Entity, respectively, and is acceptable
- * input for an XML parser. For all other types of nodes the serialized form
- * is implementation dependent.
- * <p>Within a <code>Document</code>, <code>DocumentFragment</code>, or
- * <code>Entity</code> being serialized, <code>Nodes</code> are processed as
- * follows
- * <ul>
- * <li> <code>Document</code> nodes are written, including the XML
- * declaration (unless the parameter "xml-declaration" is set to
- * <code>false</code>) and a DTD subset, if one exists in the DOM. Writing a
- * <code>Document</code> node serializes the entire document.
- * </li>
- * <li>
- * <code>Entity</code> nodes, when written directly by
- * <code>LSSerializer.write</code>, outputs the entity expansion but no
- * namespace fixup is done. The resulting output will be valid as an
- * external entity.
- * </li>
- * <li> If the parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-entities'>
- * entities</a>" is set to <code>true</code>, <code>EntityReference</code> nodes are
- * serialized as an entity reference of the form "
- * <code>&amp;entityName;</code>" in the output. Child nodes (the expansion)
- * of the entity reference are ignored. If the parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-entities'>
- * entities</a>" is set to <code>false</code>, only the children of the entity reference
- * are serialized. <code>EntityReference</code> nodes with no children (no
- * corresponding <code>Entity</code> node or the corresponding
- * <code>Entity</code> nodes have no children) are always serialized.
- * </li>
- * <li>
- * <code>CDATAsections</code> containing content characters that cannot be
- * represented in the specified output encoding are handled according to the
- * "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-split-cdata-sections'>
- * split-cdata-sections</a>" parameter. If the parameter is set to <code>true</code>,
- * <code>CDATAsections</code> are split, and the unrepresentable characters
- * are serialized as numeric character references in ordinary content. The
- * exact position and number of splits is not specified. If the parameter
- * is set to <code>false</code>, unrepresentable characters in a
- * <code>CDATAsection</code> are reported as
- * <code>"wf-invalid-character"</code> errors if the parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-well-formed'>
- * well-formed</a>" is set to <code>true</code>. The error is not recoverable - there is no
- * mechanism for supplying alternative characters and continuing with the
- * serialization.
- * </li>
- * <li> <code>DocumentFragment</code> nodes are serialized by
- * serializing the children of the document fragment in the order they
- * appear in the document fragment.
- * </li>
- * <li> All other node types (Element, Text,
- * etc.) are serialized to their corresponding XML source form.
- * </li>
- * </ul>
- * <p ><b>Note:</b> The serialization of a <code>Node</code> does not always
- * generate a well-formed XML document, i.e. a <code>LSParser</code> might
- * throw fatal errors when parsing the resulting serialization.
- * <p> Within the character data of a document (outside of markup), any
- * characters that cannot be represented directly are replaced with
- * character references. Occurrences of '&lt;' and '&amp;' are replaced by
- * the predefined entities &amp;lt; and &amp;amp;. The other predefined
- * entities (&amp;gt;, &amp;apos;, and &amp;quot;) might not be used, except
- * where needed (e.g. using &amp;gt; in cases such as ']]&gt;'). Any
- * characters that cannot be represented directly in the output character
- * encoding are serialized as numeric character references (and since
- * character encoding standards commonly use hexadecimal representations of
- * characters, using the hexadecimal representation when serializing
- * character references is encouraged).
- * <p> To allow attribute values to contain both single and double quotes, the
- * apostrophe or single-quote character (') may be represented as
- * "&amp;apos;", and the double-quote character (") as "&amp;quot;". New
- * line characters and other characters that cannot be represented directly
- * in attribute values in the output character encoding are serialized as a
- * numeric character reference.
- * <p> Within markup, but outside of attributes, any occurrence of a character
- * that cannot be represented in the output character encoding is reported
- * as a <code>DOMError</code> fatal error. An example would be serializing
- * the element &lt;LaCa\u00f1ada/&gt; with <code>encoding="us-ascii"</code>.
- * This will result with a generation of a <code>DOMError</code>
- * "wf-invalid-character-in-node-name" (as proposed in "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-well-formed'>
- * well-formed</a>").
- * <p> When requested by setting the parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-normalize-characters'>
- * normalize-characters</a>" on <code>LSSerializer</code> to true, character normalization is
- * performed according to the definition of <a href='http://www.w3.org/TR/2004/REC-xml11-20040204/#dt-fullnorm'>fully
- * normalized</a> characters included in appendix E of [<a href='http://www.w3.org/TR/2004/REC-xml11-20040204/'>XML 1.1</a>] on all
- * data to be serialized, both markup and character data. The character
- * normalization process affects only the data as it is being written; it
- * does not alter the DOM's view of the document after serialization has
- * completed.
- * <p> Implementations are required to support the encodings "UTF-8",
- * "UTF-16", "UTF-16BE", and "UTF-16LE" to guarantee that data is
- * serializable in all encodings that are required to be supported by all
- * XML parsers. When the encoding is UTF-8, whether or not a byte order mark
- * is serialized, or if the output is big-endian or little-endian, is
- * implementation dependent. When the encoding is UTF-16, whether or not the
- * output is big-endian or little-endian is implementation dependent, but a
- * Byte Order Mark must be generated for non-character outputs, such as
- * <code>LSOutput.byteStream</code> or <code>LSOutput.systemId</code>. If
- * the Byte Order Mark is not generated, a "byte-order-mark-needed" warning
- * is reported. When the encoding is UTF-16LE or UTF-16BE, the output is
- * big-endian (UTF-16BE) or little-endian (UTF-16LE) and the Byte Order Mark
- * is not be generated. In all cases, the encoding declaration, if
- * generated, will correspond to the encoding used during the serialization
- * (e.g. <code>encoding="UTF-16"</code> will appear if UTF-16 was
- * requested).
- * <p> Namespaces are fixed up during serialization, the serialization process
- * will verify that namespace declarations, namespace prefixes and the
- * namespace URI associated with elements and attributes are consistent. If
- * inconsistencies are found, the serialized form of the document will be
- * altered to remove them. The method used for doing the namespace fixup
- * while serializing a document is the algorithm defined in Appendix B.1,
- * "Namespace normalization", of [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>DOM Level 3 Core</a>]
- * .
- * <p> While serializing a document, the parameter "discard-default-content"
- * controls whether or not non-specified data is serialized.
- * <p> While serializing, errors and warnings are reported to the application
- * through the error handler (<code>LSSerializer.domConfig</code>'s "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-error-handler'>
- * error-handler</a>" parameter). This specification does in no way try to define all possible
- * errors and warnings that can occur while serializing a DOM node, but some
- * common error and warning cases are defined. The types (
- * <code>DOMError.type</code>) of errors and warnings defined by this
- * specification are:
- * <dl>
- * <dt><code>"no-output-specified" [fatal]</code></dt>
- * <dd> Raised when
- * writing to a <code>LSOutput</code> if no output is specified in the
- * <code>LSOutput</code>. </dd>
- * <dt>
- * <code>"unbound-prefix-in-entity-reference" [fatal]</code> </dt>
- * <dd> Raised if the
- * configuration parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-namespaces'>
- * namespaces</a>" is set to <code>true</code> and an entity whose replacement text
- * contains unbound namespace prefixes is referenced in a location where
- * there are no bindings for the namespace prefixes. </dd>
- * <dt>
- * <code>"unsupported-encoding" [fatal]</code></dt>
- * <dd> Raised if an unsupported
- * encoding is encountered. </dd>
- * </dl>
- * <p> In addition to raising the defined errors and warnings, implementations
- * are expected to raise implementation specific errors and warnings for any
- * other error and warning cases such as IO errors (file not found,
- * permission denied,...) and so on.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407'>Document Object Model (DOM) Level 3 Load
-and Save Specification</a>.
- */
-public interface LSSerializer {
- /**
- * The <code>DOMConfiguration</code> object used by the
- * <code>LSSerializer</code> when serializing a DOM node.
- * <br> In addition to the parameters recognized by the <a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMConfiguration'>
- * DOMConfiguration</a> interface defined in [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>DOM Level 3 Core</a>]
- * , the <code>DOMConfiguration</code> objects for
- * <code>LSSerializer</code> adds, or modifies, the following
- * parameters:
- * <dl>
- * <dt><code>"canonical-form"</code></dt>
- * <dd>
- * <dl>
- * <dt><code>true</code></dt>
- * <dd>[<em>optional</em>] Writes the document according to the rules specified in [<a href='http://www.w3.org/TR/2001/REC-xml-c14n-20010315'>Canonical XML</a>].
- * In addition to the behavior described in "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-canonical-form'>
- * canonical-form</a>" [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>DOM Level 3 Core</a>]
- * , setting this parameter to <code>true</code> will set the parameters
- * "format-pretty-print", "discard-default-content", and "xml-declaration
- * ", to <code>false</code>. Setting one of those parameters to
- * <code>true</code> will set this parameter to <code>false</code>.
- * Serializing an XML 1.1 document when "canonical-form" is
- * <code>true</code> will generate a fatal error. </dd>
- * <dt><code>false</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>) Do not canonicalize the output. </dd>
- * </dl></dd>
- * <dt><code>"discard-default-content"</code></dt>
- * <dd>
- * <dl>
- * <dt>
- * <code>true</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>) Use the <code>Attr.specified</code> attribute to decide what attributes
- * should be discarded. Note that some implementations might use
- * whatever information available to the implementation (i.e. XML
- * schema, DTD, the <code>Attr.specified</code> attribute, and so on) to
- * determine what attributes and content to discard if this parameter is
- * set to <code>true</code>. </dd>
- * <dt><code>false</code></dt>
- * <dd>[<em>required</em>]Keep all attributes and all content.</dd>
- * </dl></dd>
- * <dt><code>"format-pretty-print"</code></dt>
- * <dd>
- * <dl>
- * <dt>
- * <code>true</code></dt>
- * <dd>[<em>optional</em>] Formatting the output by adding whitespace to produce a pretty-printed,
- * indented, human-readable form. The exact form of the transformations
- * is not specified by this specification. Pretty-printing changes the
- * content of the document and may affect the validity of the document,
- * validating implementations should preserve validity. </dd>
- * <dt>
- * <code>false</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>) Don't pretty-print the result. </dd>
- * </dl></dd>
- * <dt>
- * <code>"ignore-unknown-character-denormalizations"</code> </dt>
- * <dd>
- * <dl>
- * <dt>
- * <code>true</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>) If, while verifying full normalization when [<a href='http://www.w3.org/TR/2004/REC-xml11-20040204/'>XML 1.1</a>] is
- * supported, a character is encountered for which the normalization
- * properties cannot be determined, then raise a
- * <code>"unknown-character-denormalization"</code> warning (instead of
- * raising an error, if this parameter is not set) and ignore any
- * possible denormalizations caused by these characters. </dd>
- * <dt>
- * <code>false</code></dt>
- * <dd>[<em>optional</em>] Report a fatal error if a character is encountered for which the
- * processor cannot determine the normalization properties. </dd>
- * </dl></dd>
- * <dt>
- * <code>"normalize-characters"</code></dt>
- * <dd> This parameter is equivalent to
- * the one defined by <code>DOMConfiguration</code> in [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>DOM Level 3 Core</a>]
- * . Unlike in the Core, the default value for this parameter is
- * <code>true</code>. While DOM implementations are not required to
- * support <a href='http://www.w3.org/TR/2004/REC-xml11-20040204/#dt-fullnorm'>fully
- * normalizing</a> the characters in the document according to appendix E of [<a href='http://www.w3.org/TR/2004/REC-xml11-20040204/'>XML 1.1</a>], this
- * parameter must be activated by default if supported. </dd>
- * <dt>
- * <code>"xml-declaration"</code></dt>
- * <dd>
- * <dl>
- * <dt><code>true</code></dt>
- * <dd>[<em>required</em>] (<em>default</em>) If a <code>Document</code>, <code>Element</code>, or <code>Entity</code>
- * node is serialized, the XML declaration, or text declaration, should
- * be included. The version (<code>Document.xmlVersion</code> if the
- * document is a Level 3 document and the version is non-null, otherwise
- * use the value "1.0"), and the output encoding (see
- * <code>LSSerializer.write</code> for details on how to find the output
- * encoding) are specified in the serialized XML declaration. </dd>
- * <dt>
- * <code>false</code></dt>
- * <dd>[<em>required</em>] Do not serialize the XML and text declarations. Report a
- * <code>"xml-declaration-needed"</code> warning if this will cause
- * problems (i.e. the serialized data is of an XML version other than [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>], or an
- * encoding would be needed to be able to re-parse the serialized data). </dd>
- * </dl></dd>
- * </dl>
- */
- public DOMConfiguration getDomConfig();
-
- /**
- * The end-of-line sequence of characters to be used in the XML being
- * written out. Any string is supported, but XML treats only a certain
- * set of characters sequence as end-of-line (See section 2.11,
- * "End-of-Line Handling" in [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>], if the
- * serialized content is XML 1.0 or section 2.11, "End-of-Line Handling"
- * in [<a href='http://www.w3.org/TR/2004/REC-xml11-20040204/'>XML 1.1</a>], if the
- * serialized content is XML 1.1). Using other character sequences than
- * the recommended ones can result in a document that is either not
- * serializable or not well-formed).
- * <br> On retrieval, the default value of this attribute is the
- * implementation specific default end-of-line sequence. DOM
- * implementations should choose the default to match the usual
- * convention for text files in the environment being used.
- * Implementations must choose a default sequence that matches one of
- * those allowed by XML 1.0 or XML 1.1, depending on the serialized
- * content. Setting this attribute to <code>null</code> will reset its
- * value to the default value.
- * <br>
- */
- public String getNewLine();
- /**
- * The end-of-line sequence of characters to be used in the XML being
- * written out. Any string is supported, but XML treats only a certain
- * set of characters sequence as end-of-line (See section 2.11,
- * "End-of-Line Handling" in [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>], if the
- * serialized content is XML 1.0 or section 2.11, "End-of-Line Handling"
- * in [<a href='http://www.w3.org/TR/2004/REC-xml11-20040204/'>XML 1.1</a>], if the
- * serialized content is XML 1.1). Using other character sequences than
- * the recommended ones can result in a document that is either not
- * serializable or not well-formed).
- * <br> On retrieval, the default value of this attribute is the
- * implementation specific default end-of-line sequence. DOM
- * implementations should choose the default to match the usual
- * convention for text files in the environment being used.
- * Implementations must choose a default sequence that matches one of
- * those allowed by XML 1.0 or XML 1.1, depending on the serialized
- * content. Setting this attribute to <code>null</code> will reset its
- * value to the default value.
- * <br>
- */
- public void setNewLine(String newLine);
-
- /**
- * When the application provides a filter, the serializer will call out
- * to the filter before serializing each Node. The filter implementation
- * can choose to remove the node from the stream or to terminate the
- * serialization early.
- * <br> The filter is invoked after the operations requested by the
- * <code>DOMConfiguration</code> parameters have been applied. For
- * example, CDATA sections won't be passed to the filter if "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-cdata-sections'>
- * cdata-sections</a>" is set to <code>false</code>.
- */
- public LSSerializerFilter getFilter();
- /**
- * When the application provides a filter, the serializer will call out
- * to the filter before serializing each Node. The filter implementation
- * can choose to remove the node from the stream or to terminate the
- * serialization early.
- * <br> The filter is invoked after the operations requested by the
- * <code>DOMConfiguration</code> parameters have been applied. For
- * example, CDATA sections won't be passed to the filter if "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-cdata-sections'>
- * cdata-sections</a>" is set to <code>false</code>.
- */
- public void setFilter(LSSerializerFilter filter);
-
- /**
- * Serialize the specified node as described above in the general
- * description of the <code>LSSerializer</code> interface. The output is
- * written to the supplied <code>LSOutput</code>.
- * <br> When writing to a <code>LSOutput</code>, the encoding is found by
- * looking at the encoding information that is reachable through the
- * <code>LSOutput</code> and the item to be written (or its owner
- * document) in this order:
- * <ol>
- * <li> <code>LSOutput.encoding</code>,
- * </li>
- * <li>
- * <code>Document.inputEncoding</code>,
- * </li>
- * <li>
- * <code>Document.xmlEncoding</code>.
- * </li>
- * </ol>
- * <br> If no encoding is reachable through the above properties, a
- * default encoding of "UTF-8" will be used. If the specified encoding
- * is not supported an "unsupported-encoding" fatal error is raised.
- * <br> If no output is specified in the <code>LSOutput</code>, a
- * "no-output-specified" fatal error is raised.
- * <br> The implementation is responsible of associating the appropriate
- * media type with the serialized data.
- * <br> When writing to a HTTP URI, a HTTP PUT is performed. When writing
- * to other types of URIs, the mechanism for writing the data to the URI
- * is implementation dependent.
- * @param nodeArg The node to serialize.
- * @param destination The destination for the serialized DOM.
- * @return Returns <code>true</code> if <code>node</code> was
- * successfully serialized. Return <code>false</code> in case the
- * normal processing stopped but the implementation kept serializing
- * the document; the result of the serialization being implementation
- * dependent then.
- * @exception LSException
- * SERIALIZE_ERR: Raised if the <code>LSSerializer</code> was unable to
- * serialize the node. DOM applications should attach a
- * <code>DOMErrorHandler</code> using the parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-error-handler'>
- * error-handler</a>" if they wish to get details on the error.
- */
- public boolean write(Node nodeArg,
- LSOutput destination)
- throws LSException;
-
- /**
- * A convenience method that acts as if <code>LSSerializer.write</code>
- * was called with a <code>LSOutput</code> with no encoding specified
- * and <code>LSOutput.systemId</code> set to the <code>uri</code>
- * argument.
- * @param nodeArg The node to serialize.
- * @param uri The URI to write to.
- * @return Returns <code>true</code> if <code>node</code> was
- * successfully serialized. Return <code>false</code> in case the
- * normal processing stopped but the implementation kept serializing
- * the document; the result of the serialization being implementation
- * dependent then.
- * @exception LSException
- * SERIALIZE_ERR: Raised if the <code>LSSerializer</code> was unable to
- * serialize the node. DOM applications should attach a
- * <code>DOMErrorHandler</code> using the parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-error-handler'>
- * error-handler</a>" if they wish to get details on the error.
- */
- public boolean writeToURI(Node nodeArg,
- String uri)
- throws LSException;
-
- /**
- * Serialize the specified node as described above in the general
- * description of the <code>LSSerializer</code> interface. The output is
- * written to a <code>DOMString</code> that is returned to the caller.
- * The encoding used is the encoding of the <code>DOMString</code> type,
- * i.e. UTF-16. Note that no Byte Order Mark is generated in a
- * <code>DOMString</code> object.
- * @param nodeArg The node to serialize.
- * @return Returns the serialized data.
- * @exception DOMException
- * DOMSTRING_SIZE_ERR: Raised if the resulting string is too long to
- * fit in a <code>DOMString</code>.
- * @exception LSException
- * SERIALIZE_ERR: Raised if the <code>LSSerializer</code> was unable to
- * serialize the node. DOM applications should attach a
- * <code>DOMErrorHandler</code> using the parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-error-handler'>
- * error-handler</a>" if they wish to get details on the error.
- */
- public String writeToString(Node nodeArg)
- throws DOMException, LSException;
-
-}
diff --git a/src/org/w3c/dom/ls/LSSerializerFilter.java b/src/org/w3c/dom/ls/LSSerializerFilter.java
deleted file mode 100644
index bc8e724..0000000
--- a/src/org/w3c/dom/ls/LSSerializerFilter.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2004 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] in the hope that
- * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom.ls;
-
-import org.w3c.dom.traversal.NodeFilter;
-
-/**
- * <code>LSSerializerFilter</code>s provide applications the ability to
- * examine nodes as they are being serialized and decide what nodes should
- * be serialized or not. The <code>LSSerializerFilter</code> interface is
- * based on the <code>NodeFilter</code> interface defined in [<a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>DOM Level 2 Traversal and Range</a>]
- * .
- * <p> <code>Document</code>, <code>DocumentType</code>,
- * <code>DocumentFragment</code>, <code>Notation</code>, <code>Entity</code>
- * , and children of <code>Attr</code> nodes are not passed to the filter.
- * The child nodes of an <code>EntityReference</code> node are only passed
- * to the filter if the <code>EntityReference</code> node is skipped by the
- * method <code>LSParserFilter.acceptNode()</code>.
- * <p> When serializing an <code>Element</code>, the element is passed to the
- * filter before any of its attributes are passed to the filter. Namespace
- * declaration attributes, and default attributes (except in the case when "
- * discard-default-content" is set to <code>false</code>), are never passed
- * to the filter.
- * <p> The result of any attempt to modify a node passed to a
- * <code>LSSerializerFilter</code> is implementation dependent.
- * <p> DOM applications must not raise exceptions in a filter. The effect of
- * throwing exceptions from a filter is DOM implementation dependent.
- * <p> For efficiency, a node passed to the filter may not be the same as the
- * one that is actually in the tree. And the actual node (node object
- * identity) may be reused during the process of filtering and serializing a
- * document.
- * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407'>Document Object Model (DOM) Level 3 Load
-and Save Specification</a>.
- */
-public interface LSSerializerFilter extends NodeFilter {
- /**
- * Tells the <code>LSSerializer</code> what types of nodes to show to the
- * filter. If a node is not shown to the filter using this attribute, it
- * is automatically serialized. See <code>NodeFilter</code> for
- * definition of the constants. The constants <code>SHOW_DOCUMENT</code>
- * , <code>SHOW_DOCUMENT_TYPE</code>, <code>SHOW_DOCUMENT_FRAGMENT</code>
- * , <code>SHOW_NOTATION</code>, and <code>SHOW_ENTITY</code> are
- * meaningless here, such nodes will never be passed to a
- * <code>LSSerializerFilter</code>.
- * <br> Unlike [<a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>DOM Level 2 Traversal and Range</a>]
- * , the <code>SHOW_ATTRIBUTE</code> constant indicates that the
- * <code>Attr</code> nodes are shown and passed to the filter.
- * <br> The constants used here are defined in [<a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>DOM Level 2 Traversal and Range</a>]
- * .
- */
- public int getWhatToShow();
-
-}
diff --git a/src/org/w3c/dom/package.html b/src/org/w3c/dom/package.html
deleted file mode 100644
index 362b1ff..0000000
--- a/src/org/w3c/dom/package.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<html>
-<head>
-<title>org.w3c.dom package</title>
-</head>
-<body bgcolor="white">
-Provides the interfaces for the Document Object Model (DOM). Supports the
-<a href="http://www.w3.org/TR/DOM-Level-2-Core/">Document Object Model Level 2 Core APIi</a>,
-<a href="http://www.w3.org/TR/DOM-Level-3-Core">Document Object Model (DOM) Level 3 Core</a>,
-and <a href="http://www.w3.org/TR/DOM-Level-3-LS">Document Object Model (DOM) Level 3 Load and Save</a>.
-
-@since JDK1.4
-</body>
-</html>
diff --git a/src/org/w3c/dom/ranges/DocumentRange.java b/src/org/w3c/dom/ranges/DocumentRange.java
deleted file mode 100644
index 342f9e3..0000000
--- a/src/org/w3c/dom/ranges/DocumentRange.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.ranges;
-
-/**
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>Document Object Model (DOM) Level 2 Traversal and Range Specification</a>.
- * @since DOM Level 2
- */
-public interface DocumentRange {
- /**
- * This interface can be obtained from the object implementing the
- * <code>Document</code> interface using binding-specific casting
- * methods.
- * @return The initial state of the Range returned from this method is
- * such that both of its boundary-points are positioned at the
- * beginning of the corresponding Document, before any content. The
- * Range returned can only be used to select content associated with
- * this Document, or with DocumentFragments and Attrs for which this
- * Document is the <code>ownerDocument</code>.
- */
- public Range createRange();
-
-}
diff --git a/src/org/w3c/dom/ranges/Range.java b/src/org/w3c/dom/ranges/Range.java
deleted file mode 100644
index d42fad0..0000000
--- a/src/org/w3c/dom/ranges/Range.java
+++ /dev/null
@@ -1,445 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.ranges;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.DocumentFragment;
-
-/**
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>Document Object Model (DOM) Level 2 Traversal and Range Specification</a>.
- * @since DOM Level 2
- */
-public interface Range {
- /**
- * Node within which the Range begins
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
- * invoked on this object.
- */
- public Node getStartContainer()
- throws DOMException;
-
- /**
- * Offset within the starting node of the Range.
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
- * invoked on this object.
- */
- public int getStartOffset()
- throws DOMException;
-
- /**
- * Node within which the Range ends
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
- * invoked on this object.
- */
- public Node getEndContainer()
- throws DOMException;
-
- /**
- * Offset within the ending node of the Range.
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
- * invoked on this object.
- */
- public int getEndOffset()
- throws DOMException;
-
- /**
- * TRUE if the Range is collapsed
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
- * invoked on this object.
- */
- public boolean getCollapsed()
- throws DOMException;
-
- /**
- * The deepest common ancestor container of the Range's two
- * boundary-points.
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
- * invoked on this object.
- */
- public Node getCommonAncestorContainer()
- throws DOMException;
-
- /**
- * Sets the attributes describing the start of the Range.
- * @param refNode The <code>refNode</code> value. This parameter must be
- * different from <code>null</code>.
- * @param offset The <code>startOffset</code> value.
- * @exception RangeException
- * INVALID_NODE_TYPE_ERR: Raised if <code>refNode</code> or an ancestor
- * of <code>refNode</code> is an Entity, Notation, or DocumentType
- * node.
- * @exception DOMException
- * INDEX_SIZE_ERR: Raised if <code>offset</code> is negative or greater
- * than the number of child units in <code>refNode</code>. Child units
- * are 16-bit units if <code>refNode</code> is a type of CharacterData
- * node (e.g., a Text or Comment node) or a ProcessingInstruction
- * node. Child units are Nodes in all other cases.
- * <br>INVALID_STATE_ERR: Raised if <code>detach()</code> has already
- * been invoked on this object.
- * <br>WRONG_DOCUMENT_ERR: Raised if <code>refNode</code> was created
- * from a different document than the one that created this range.
- */
- public void setStart(Node refNode,
- int offset)
- throws RangeException, DOMException;
-
- /**
- * Sets the attributes describing the end of a Range.
- * @param refNode The <code>refNode</code> value. This parameter must be
- * different from <code>null</code>.
- * @param offset The <code>endOffset</code> value.
- * @exception RangeException
- * INVALID_NODE_TYPE_ERR: Raised if <code>refNode</code> or an ancestor
- * of <code>refNode</code> is an Entity, Notation, or DocumentType
- * node.
- * @exception DOMException
- * INDEX_SIZE_ERR: Raised if <code>offset</code> is negative or greater
- * than the number of child units in <code>refNode</code>. Child units
- * are 16-bit units if <code>refNode</code> is a type of CharacterData
- * node (e.g., a Text or Comment node) or a ProcessingInstruction
- * node. Child units are Nodes in all other cases.
- * <br>INVALID_STATE_ERR: Raised if <code>detach()</code> has already
- * been invoked on this object.
- * <br>WRONG_DOCUMENT_ERR: Raised if <code>refNode</code> was created
- * from a different document than the one that created this range.
- */
- public void setEnd(Node refNode,
- int offset)
- throws RangeException, DOMException;
-
- /**
- * Sets the start position to be before a node
- * @param refNode Range starts before <code>refNode</code>
- * @exception RangeException
- * INVALID_NODE_TYPE_ERR: Raised if the root container of
- * <code>refNode</code> is not an Attr, Document, or DocumentFragment
- * node or if <code>refNode</code> is a Document, DocumentFragment,
- * Attr, Entity, or Notation node.
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
- * invoked on this object.
- * <br>WRONG_DOCUMENT_ERR: Raised if <code>refNode</code> was created
- * from a different document than the one that created this range.
- */
- public void setStartBefore(Node refNode)
- throws RangeException, DOMException;
-
- /**
- * Sets the start position to be after a node
- * @param refNode Range starts after <code>refNode</code>
- * @exception RangeException
- * INVALID_NODE_TYPE_ERR: Raised if the root container of
- * <code>refNode</code> is not an Attr, Document, or DocumentFragment
- * node or if <code>refNode</code> is a Document, DocumentFragment,
- * Attr, Entity, or Notation node.
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
- * invoked on this object.
- * <br>WRONG_DOCUMENT_ERR: Raised if <code>refNode</code> was created
- * from a different document than the one that created this range.
- */
- public void setStartAfter(Node refNode)
- throws RangeException, DOMException;
-
- /**
- * Sets the end position to be before a node.
- * @param refNode Range ends before <code>refNode</code>
- * @exception RangeException
- * INVALID_NODE_TYPE_ERR: Raised if the root container of
- * <code>refNode</code> is not an Attr, Document, or DocumentFragment
- * node or if <code>refNode</code> is a Document, DocumentFragment,
- * Attr, Entity, or Notation node.
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
- * invoked on this object.
- * <br>WRONG_DOCUMENT_ERR: Raised if <code>refNode</code> was created
- * from a different document than the one that created this range.
- */
- public void setEndBefore(Node refNode)
- throws RangeException, DOMException;
-
- /**
- * Sets the end of a Range to be after a node
- * @param refNode Range ends after <code>refNode</code>.
- * @exception RangeException
- * INVALID_NODE_TYPE_ERR: Raised if the root container of
- * <code>refNode</code> is not an Attr, Document or DocumentFragment
- * node or if <code>refNode</code> is a Document, DocumentFragment,
- * Attr, Entity, or Notation node.
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
- * invoked on this object.
- * <br>WRONG_DOCUMENT_ERR: Raised if <code>refNode</code> was created
- * from a different document than the one that created this range.
- */
- public void setEndAfter(Node refNode)
- throws RangeException, DOMException;
-
- /**
- * Collapse a Range onto one of its boundary-points
- * @param toStart If TRUE, collapses the Range onto its start; if FALSE,
- * collapses it onto its end.
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
- * invoked on this object.
- */
- public void collapse(boolean toStart)
- throws DOMException;
-
- /**
- * Select a node and its contents
- * @param refNode The node to select.
- * @exception RangeException
- * INVALID_NODE_TYPE_ERR: Raised if an ancestor of <code>refNode</code>
- * is an Entity, Notation or DocumentType node or if
- * <code>refNode</code> is a Document, DocumentFragment, Attr, Entity,
- * or Notation node.
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
- * invoked on this object.
- * <br>WRONG_DOCUMENT_ERR: Raised if <code>refNode</code> was created
- * from a different document than the one that created this range.
- */
- public void selectNode(Node refNode)
- throws RangeException, DOMException;
-
- /**
- * Select the contents within a node
- * @param refNode Node to select from
- * @exception RangeException
- * INVALID_NODE_TYPE_ERR: Raised if <code>refNode</code> or an ancestor
- * of <code>refNode</code> is an Entity, Notation or DocumentType node.
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
- * invoked on this object.
- * <br>WRONG_DOCUMENT_ERR: Raised if <code>refNode</code> was created
- * from a different document than the one that created this range.
- */
- public void selectNodeContents(Node refNode)
- throws RangeException, DOMException;
-
- // CompareHow
- /**
- * Compare start boundary-point of <code>sourceRange</code> to start
- * boundary-point of Range on which <code>compareBoundaryPoints</code>
- * is invoked.
- */
- public static final short START_TO_START = 0;
- /**
- * Compare start boundary-point of <code>sourceRange</code> to end
- * boundary-point of Range on which <code>compareBoundaryPoints</code>
- * is invoked.
- */
- public static final short START_TO_END = 1;
- /**
- * Compare end boundary-point of <code>sourceRange</code> to end
- * boundary-point of Range on which <code>compareBoundaryPoints</code>
- * is invoked.
- */
- public static final short END_TO_END = 2;
- /**
- * Compare end boundary-point of <code>sourceRange</code> to start
- * boundary-point of Range on which <code>compareBoundaryPoints</code>
- * is invoked.
- */
- public static final short END_TO_START = 3;
-
- /**
- * Compare the boundary-points of two Ranges in a document.
- * @param how A code representing the type of comparison, as defined
- * above.
- * @param sourceRange The <code>Range</code> on which this current
- * <code>Range</code> is compared to.
- * @return -1, 0 or 1 depending on whether the corresponding
- * boundary-point of the Range is respectively before, equal to, or
- * after the corresponding boundary-point of <code>sourceRange</code>.
- * @exception DOMException
- * WRONG_DOCUMENT_ERR: Raised if the two Ranges are not in the same
- * Document or DocumentFragment.
- * <br>INVALID_STATE_ERR: Raised if <code>detach()</code> has already
- * been invoked on this object.
- */
- public short compareBoundaryPoints(short how,
- Range sourceRange)
- throws DOMException;
-
- /**
- * Removes the contents of a Range from the containing document or
- * document fragment without returning a reference to the removed
- * content.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if any portion of the content of
- * the Range is read-only or any of the nodes that contain any of the
- * content of the Range are read-only.
- * <br>INVALID_STATE_ERR: Raised if <code>detach()</code> has already
- * been invoked on this object.
- */
- public void deleteContents()
- throws DOMException;
-
- /**
- * Moves the contents of a Range from the containing document or document
- * fragment to a new DocumentFragment.
- * @return A DocumentFragment containing the extracted contents.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if any portion of the content of
- * the Range is read-only or any of the nodes which contain any of the
- * content of the Range are read-only.
- * <br>HIERARCHY_REQUEST_ERR: Raised if a DocumentType node would be
- * extracted into the new DocumentFragment.
- * <br>INVALID_STATE_ERR: Raised if <code>detach()</code> has already
- * been invoked on this object.
- */
- public DocumentFragment extractContents()
- throws DOMException;
-
- /**
- * Duplicates the contents of a Range
- * @return A DocumentFragment that contains content equivalent to this
- * Range.
- * @exception DOMException
- * HIERARCHY_REQUEST_ERR: Raised if a DocumentType node would be
- * extracted into the new DocumentFragment.
- * <br>INVALID_STATE_ERR: Raised if <code>detach()</code> has already
- * been invoked on this object.
- */
- public DocumentFragment cloneContents()
- throws DOMException;
-
- /**
- * Inserts a node into the Document or DocumentFragment at the start of
- * the Range. If the container is a Text node, this will be split at the
- * start of the Range (as if the Text node's splitText method was
- * performed at the insertion point) and the insertion will occur
- * between the two resulting Text nodes. Adjacent Text nodes will not be
- * automatically merged. If the node to be inserted is a
- * DocumentFragment node, the children will be inserted rather than the
- * DocumentFragment node itself.
- * @param newNode The node to insert at the start of the Range
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if an ancestor container of the
- * start of the Range is read-only.
- * <br>WRONG_DOCUMENT_ERR: Raised if <code>newNode</code> and the
- * container of the start of the Range were not created from the same
- * document.
- * <br>HIERARCHY_REQUEST_ERR: Raised if the container of the start of
- * the Range is of a type that does not allow children of the type of
- * <code>newNode</code> or if <code>newNode</code> is an ancestor of
- * the container.
- * <br>INVALID_STATE_ERR: Raised if <code>detach()</code> has already
- * been invoked on this object.
- * @exception RangeException
- * INVALID_NODE_TYPE_ERR: Raised if <code>newNode</code> is an Attr,
- * Entity, Notation, or Document node.
- */
- public void insertNode(Node newNode)
- throws DOMException, RangeException;
-
- /**
- * Reparents the contents of the Range to the given node and inserts the
- * node at the position of the start of the Range.
- * @param newParent The node to surround the contents with.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if an ancestor container of
- * either boundary-point of the Range is read-only.
- * <br>WRONG_DOCUMENT_ERR: Raised if <code> newParent</code> and the
- * container of the start of the Range were not created from the same
- * document.
- * <br>HIERARCHY_REQUEST_ERR: Raised if the container of the start of
- * the Range is of a type that does not allow children of the type of
- * <code>newParent</code> or if <code>newParent</code> is an ancestor
- * of the container or if <code>node</code> would end up with a child
- * node of a type not allowed by the type of <code>node</code>.
- * <br>INVALID_STATE_ERR: Raised if <code>detach()</code> has already
- * been invoked on this object.
- * @exception RangeException
- * BAD_BOUNDARYPOINTS_ERR: Raised if the Range partially selects a
- * non-text node.
- * <br>INVALID_NODE_TYPE_ERR: Raised if <code> node</code> is an Attr,
- * Entity, DocumentType, Notation, Document, or DocumentFragment node.
- */
- public void surroundContents(Node newParent)
- throws DOMException, RangeException;
-
- /**
- * Produces a new Range whose boundary-points are equal to the
- * boundary-points of the Range.
- * @return The duplicated Range.
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
- * invoked on this object.
- */
- public Range cloneRange()
- throws DOMException;
-
- /**
- * Returns the contents of a Range as a string. This string contains only
- * the data characters, not any markup.
- * @return The contents of the Range.
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
- * invoked on this object.
- */
- public String toString()
- throws DOMException;
-
- /**
- * Called to indicate that the Range is no longer in use and that the
- * implementation may relinquish any resources associated with this
- * Range. Subsequent calls to any methods or attribute getters on this
- * Range will result in a <code>DOMException</code> being thrown with an
- * error code of <code>INVALID_STATE_ERR</code>.
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if <code>detach()</code> has already been
- * invoked on this object.
- */
- public void detach()
- throws DOMException;
-
-}
diff --git a/src/org/w3c/dom/ranges/RangeException.java b/src/org/w3c/dom/ranges/RangeException.java
deleted file mode 100644
index 198a135..0000000
--- a/src/org/w3c/dom/ranges/RangeException.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.ranges;
-
-/**
- * Range operations may throw a <code>RangeException</code> as specified in
- * their method descriptions.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>Document Object Model (DOM) Level 2 Traversal and Range Specification</a>.
- * @since DOM Level 2
- */
-public class RangeException extends RuntimeException {
- public RangeException(short code, String message) {
- super(message);
- this.code = code;
- }
- public short code;
- // RangeExceptionCode
- /**
- * If the boundary-points of a Range do not meet specific requirements.
- */
- public static final short BAD_BOUNDARYPOINTS_ERR = 1;
- /**
- * If the container of an boundary-point of a Range is being set to either
- * a node of an invalid type or a node with an ancestor of an invalid
- * type.
- */
- public static final short INVALID_NODE_TYPE_ERR = 2;
-
-}
diff --git a/src/org/w3c/dom/ranges/package.html b/src/org/w3c/dom/ranges/package.html
deleted file mode 100644
index 012315b..0000000
--- a/src/org/w3c/dom/ranges/package.html
+++ /dev/null
@@ -1,111 +0,0 @@
-<html>
-<head>
- <title>W3C IPR SOFTWARE NOTICE</title>
-</head>
-<body bgcolor="white">
- <p>
- Document Object Model Level 2 Traversal and Range is a
- platform and language-neutral interfaces that allow programs
- and scripts to dynamically traverse and identify a range of
- content in a document. The Document Object Model Level 2
- Traversal and Range build on the Document Object Model Level 2
- Core.
- </p>
- <p>
- The DOM Level 2 Traversal and Range specification is composed
- of two modules. The two modules contain specialized interfaces
- dedicated to traversing the document structure and identifying
- and manipulating a range in a document.
- </p>
- <h1>
- W3C IPR SOFTWARE NOTICE
- </h1>
- <h3>
- Copyright &copy; 2000 <loc href="http://www.w3.org/">World Wide Web
- Consortium</loc>, (<loc href="http://www.lcs.mit.edu/">Massachusetts
- Institute of Technology</loc>, <loc href="http://www.inria.fr/">Institut
- National de Recherche en Informatique et en Automatique</loc>, <loc
- href="http://www.keio.ac.jp/">Keio University</loc>). All Rights
- Reserved.
- </h3>
- <p>
- The DOM bindings are published under the W3C Software Copyright Notice
- and License. The software license requires "Notice of any changes or
- modifications to the W3C files, including the date changes were made."
- Consequently, modified versions of the DOM bindings must document that
- they do not conform to the W3C standard; in the case of the IDL binding,
- the pragma prefix can no longer be 'w3c.org'; in the case of the Java
- binding, the package names can no longer be in the 'org.w3c' package.
- </p>
- <p>
- <b>Note:</b> The original version of the W3C Software Copyright Notice
- and License could be found at <a
- href='http://www.w3.org/Consortium/Legal/copyright-software-19980720'>http://www.w3.org/Consortium/Legal/copyright-software-19980720</a>
- </p>
- <h3>
- Copyright &copy; 1994-2000 <a href="http://www.w3.org/">World Wide Web
- Consortium</a>, (<a href="http://www.lcs.mit.edu/">Massachusetts
- Institute of Technology</a>, <a href="http://www.inria.fr/">Institut
- National de Recherche en Informatique et en Automatique</a>, <a
- href="http://www.keio.ac.jp/">Keio University</a>). All Rights
- Reserved. http://www.w3.org/Consortium/Legal/
- </h3>
- <p>
- This W3C work (including software, documents, or other related items) is
- being provided by the copyright holders under the following license. By
- obtaining, using and/or copying this work, you (the licensee) agree that
- you have read, understood, and will comply with the following terms and
- conditions:
- </p>
- <p>
- Permission to use, copy, and modify this software and its documentation,
- with or without modification,&nbsp; for any purpose and without fee or
- royalty is hereby granted, provided that you include the following on ALL
- copies of the software and documentation or portions thereof, including
- modifications, that you make:
- </p>
- <ol>
- <li>
- The full text of this NOTICE in a location viewable to users of the
- redistributed or derivative work.
- </li>
- <li>
- Any pre-existing intellectual property disclaimers, notices, or terms
- and conditions. If none exist, a short notice of the following form
- (hypertext is preferred, text is permitted) should be used within the
- body of any redistributed or derivative code: "Copyright &copy;
- [$date-of-software] <a href="http://www.w3.org/">World Wide Web
- Consortium</a>, (<a href="http://www.lcs.mit.edu/">Massachusetts
- Institute of Technology</a>, <a href="http://www.inria.fr/">Institut
- National de Recherche en Informatique et en Automatique</a>, <a
- href="http://www.keio.ac.jp/">Keio University</a>). All Rights
- Reserved. http://www.w3.org/Consortium/Legal/"
- </li>
- <li>
- Notice of any changes or modifications to the W3C files, including the
- date changes were made. (We recommend you provide URIs to the location
- from which the code is derived.)
- </li>
- </ol>
- <p>
- THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT
- HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED,
- INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS
- FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR
- DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS,
- TRADEMARKS OR OTHER RIGHTS.
- </p>
- <p>
- COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR
- CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR
- DOCUMENTATION.
- </p>
- <p>
- The name and trademarks of copyright holders may NOT be used in
- advertising or publicity pertaining to the software without specific,
- written prior permission. Title to copyright in this software and any
- associated documentation will at all times remain with copyright
- holders.
- </p>
- </body>
-</html>
diff --git a/src/org/w3c/dom/stylesheets/DocumentStyle.java b/src/org/w3c/dom/stylesheets/DocumentStyle.java
deleted file mode 100644
index 2be39e7..0000000
--- a/src/org/w3c/dom/stylesheets/DocumentStyle.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.stylesheets;
-
-/**
- * The <code>DocumentStyle</code> interface provides a mechanism by which the
- * style sheets embedded in a document can be retrieved. The expectation is
- * that an instance of the <code>DocumentStyle</code> interface can be
- * obtained by using binding-specific casting methods on an instance of the
- * <code>Document</code> interface.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface DocumentStyle {
- /**
- * A list containing all the style sheets explicitly linked into or
- * embedded in a document. For HTML documents, this includes external
- * style sheets, included via the HTML LINK element, and inline STYLE
- * elements. In XML, this includes external style sheets, included via
- * style sheet processing instructions (see [XML StyleSheet]).
- */
- public StyleSheetList getStyleSheets();
-
-}
diff --git a/src/org/w3c/dom/stylesheets/LinkStyle.java b/src/org/w3c/dom/stylesheets/LinkStyle.java
deleted file mode 100644
index 9bd7b68..0000000
--- a/src/org/w3c/dom/stylesheets/LinkStyle.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.stylesheets;
-
-/**
- * The <code>LinkStyle</code> interface provides a mechanism by which a style
- * sheet can be retrieved from the node responsible for linking it into a
- * document. An instance of the <code>LinkStyle</code> interface can be
- * obtained using binding-specific casting methods on an instance of a
- * linking node (<code>HTMLLinkElement</code>, <code>HTMLStyleElement</code>
- * or <code>ProcessingInstruction</code> in DOM Level 2).
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface LinkStyle {
- /**
- * The style sheet.
- */
- public StyleSheet getSheet();
-
-}
diff --git a/src/org/w3c/dom/stylesheets/MediaList.java b/src/org/w3c/dom/stylesheets/MediaList.java
deleted file mode 100644
index 1a82767..0000000
--- a/src/org/w3c/dom/stylesheets/MediaList.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.stylesheets;
-
-import org.w3c.dom.DOMException;
-
-/**
- * The <code>MediaList</code> interface provides the abstraction of an
- * ordered collection of media, without defining or constraining how this
- * collection is implemented. An empty list is the same as a list that
- * contains the medium <code>"all"</code>.
- * <p> The items in the <code>MediaList</code> are accessible via an integral
- * index, starting from 0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface MediaList {
- /**
- * The parsable textual representation of the media list. This is a
- * comma-separated list of media.
- */
- public String getMediaText();
- /**
- * The parsable textual representation of the media list. This is a
- * comma-separated list of media.
- * @exception DOMException
- * SYNTAX_ERR: Raised if the specified string value has a syntax error
- * and is unparsable.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this media list is
- * readonly.
- */
- public void setMediaText(String mediaText)
- throws DOMException;
-
- /**
- * The number of media in the list. The range of valid media is
- * <code>0</code> to <code>length-1</code> inclusive.
- */
- public int getLength();
-
- /**
- * Returns the <code>index</code>th in the list. If <code>index</code> is
- * greater than or equal to the number of media in the list, this
- * returns <code>null</code>.
- * @param index Index into the collection.
- * @return The medium at the <code>index</code>th position in the
- * <code>MediaList</code>, or <code>null</code> if that is not a valid
- * index.
- */
- public String item(int index);
-
- /**
- * Deletes the medium indicated by <code>oldMedium</code> from the list.
- * @param oldMedium The medium to delete in the media list.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this list is readonly.
- * <br> NOT_FOUND_ERR: Raised if <code>oldMedium</code> is not in the
- * list.
- */
- public void deleteMedium(String oldMedium)
- throws DOMException;
-
- /**
- * Adds the medium <code>newMedium</code> to the end of the list. If the
- * <code>newMedium</code> is already used, it is first removed.
- * @param newMedium The new medium to add.
- * @exception DOMException
- * INVALID_CHARACTER_ERR: If the medium contains characters that are
- * invalid in the underlying style language.
- * <br> NO_MODIFICATION_ALLOWED_ERR: Raised if this list is readonly.
- */
- public void appendMedium(String newMedium)
- throws DOMException;
-
-}
diff --git a/src/org/w3c/dom/stylesheets/StyleSheet.java b/src/org/w3c/dom/stylesheets/StyleSheet.java
deleted file mode 100644
index 617c68e..0000000
--- a/src/org/w3c/dom/stylesheets/StyleSheet.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.stylesheets;
-
-import org.w3c.dom.Node;
-
-/**
- * The <code>StyleSheet</code> interface is the abstract base interface for
- * any type of style sheet. It represents a single style sheet associated
- * with a structured document. In HTML, the StyleSheet interface represents
- * either an external style sheet, included via the HTML LINK element, or
- * an inline STYLE element. In XML, this interface represents an external
- * style sheet, included via a style sheet processing instruction.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface StyleSheet {
- /**
- * This specifies the style sheet language for this style sheet. The
- * style sheet language is specified as a content type (e.g.
- * "text/css"). The content type is often specified in the
- * <code>ownerNode</code>. Also see the type attribute definition for
- * the <code>LINK</code> element in HTML 4.0, and the type
- * pseudo-attribute for the XML style sheet processing instruction.
- */
- public String getType();
-
- /**
- * <code>false</code> if the style sheet is applied to the document.
- * <code>true</code> if it is not. Modifying this attribute may cause a
- * new resolution of style for the document. A stylesheet only applies
- * if both an appropriate medium definition is present and the disabled
- * attribute is false. So, if the media doesn't apply to the current
- * user agent, the <code>disabled</code> attribute is ignored.
- */
- public boolean getDisabled();
- /**
- * <code>false</code> if the style sheet is applied to the document.
- * <code>true</code> if it is not. Modifying this attribute may cause a
- * new resolution of style for the document. A stylesheet only applies
- * if both an appropriate medium definition is present and the disabled
- * attribute is false. So, if the media doesn't apply to the current
- * user agent, the <code>disabled</code> attribute is ignored.
- */
- public void setDisabled(boolean disabled);
-
- /**
- * The node that associates this style sheet with the document. For HTML,
- * this may be the corresponding <code>LINK</code> or <code>STYLE</code>
- * element. For XML, it may be the linking processing instruction. For
- * style sheets that are included by other style sheets, the value of
- * this attribute is <code>null</code>.
- */
- public Node getOwnerNode();
-
- /**
- * For style sheet languages that support the concept of style sheet
- * inclusion, this attribute represents the including style sheet, if
- * one exists. If the style sheet is a top-level style sheet, or the
- * style sheet language does not support inclusion, the value of this
- * attribute is <code>null</code>.
- */
- public StyleSheet getParentStyleSheet();
-
- /**
- * If the style sheet is a linked style sheet, the value of its attribute
- * is its location. For inline style sheets, the value of this attribute
- * is <code>null</code>. See the href attribute definition for the
- * <code>LINK</code> element in HTML 4.0, and the href pseudo-attribute
- * for the XML style sheet processing instruction.
- */
- public String getHref();
-
- /**
- * The advisory title. The title is often specified in the
- * <code>ownerNode</code>. See the title attribute definition for the
- * <code>LINK</code> element in HTML 4.0, and the title pseudo-attribute
- * for the XML style sheet processing instruction.
- */
- public String getTitle();
-
- /**
- * The intended destination media for style information. The media is
- * often specified in the <code>ownerNode</code>. If no media has been
- * specified, the <code>MediaList</code> will be empty. See the media
- * attribute definition for the <code>LINK</code> element in HTML 4.0,
- * and the media pseudo-attribute for the XML style sheet processing
- * instruction . Modifying the media list may cause a change to the
- * attribute <code>disabled</code>.
- */
- public MediaList getMedia();
-
-}
diff --git a/src/org/w3c/dom/stylesheets/StyleSheetList.java b/src/org/w3c/dom/stylesheets/StyleSheetList.java
deleted file mode 100644
index 6cd5254..0000000
--- a/src/org/w3c/dom/stylesheets/StyleSheetList.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.stylesheets;
-
-/**
- * The <code>StyleSheetList</code> interface provides the abstraction of an
- * ordered collection of style sheets.
- * <p> The items in the <code>StyleSheetList</code> are accessible via an
- * integral index, starting from 0.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
- * @since DOM Level 2
- */
-public interface StyleSheetList {
- /**
- * The number of <code>StyleSheets</code> in the list. The range of valid
- * child stylesheet indices is <code>0</code> to <code>length-1</code>
- * inclusive.
- */
- public int getLength();
-
- /**
- * Used to retrieve a style sheet by ordinal index. If index is greater
- * than or equal to the number of style sheets in the list, this returns
- * <code>null</code>.
- * @param index Index into the collection
- * @return The style sheet at the <code>index</code> position in the
- * <code>StyleSheetList</code>, or <code>null</code> if that is not a
- * valid index.
- */
- public StyleSheet item(int index);
-
-}
diff --git a/src/org/w3c/dom/traversal/DocumentTraversal.java b/src/org/w3c/dom/traversal/DocumentTraversal.java
deleted file mode 100644
index 8093888..0000000
--- a/src/org/w3c/dom/traversal/DocumentTraversal.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.traversal;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.DOMException;
-
-/**
- * <code>DocumentTraversal</code> contains methods that create
- * <code>NodeIterators</code> and <code>TreeWalkers</code> to traverse a
- * node and its children in document order (depth first, pre-order
- * traversal, which is equivalent to the order in which the start tags occur
- * in the text representation of the document). In DOMs which support the
- * Traversal feature, <code>DocumentTraversal</code> will be implemented by
- * the same objects that implement the Document interface.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>Document Object Model (DOM) Level 2 Traversal and Range Specification</a>.
- * @since DOM Level 2
- */
-public interface DocumentTraversal {
- /**
- * Create a new <code>NodeIterator</code> over the subtree rooted at the
- * specified node.
- * @param root The node which will be iterated together with its
- * children. The <code>NodeIterator</code> is initially positioned
- * just before this node. The <code>whatToShow</code> flags and the
- * filter, if any, are not considered when setting this position. The
- * root must not be <code>null</code>.
- * @param whatToShow This flag specifies which node types may appear in
- * the logical view of the tree presented by the
- * <code>NodeIterator</code>. See the description of
- * <code>NodeFilter</code> for the set of possible <code>SHOW_</code>
- * values.These flags can be combined using <code>OR</code>.
- * @param filter The <code>NodeFilter</code> to be used with this
- * <code>NodeIterator</code>, or <code>null</code> to indicate no
- * filter.
- * @param entityReferenceExpansion The value of this flag determines
- * whether entity reference nodes are expanded.
- * @return The newly created <code>NodeIterator</code>.
- * @exception DOMException
- * NOT_SUPPORTED_ERR: Raised if the specified <code>root</code> is
- * <code>null</code>.
- */
- public NodeIterator createNodeIterator(Node root,
- int whatToShow,
- NodeFilter filter,
- boolean entityReferenceExpansion)
- throws DOMException;
-
- /**
- * Create a new <code>TreeWalker</code> over the subtree rooted at the
- * specified node.
- * @param root The node which will serve as the <code>root</code> for the
- * <code>TreeWalker</code>. The <code>whatToShow</code> flags and the
- * <code>NodeFilter</code> are not considered when setting this value;
- * any node type will be accepted as the <code>root</code>. The
- * <code>currentNode</code> of the <code>TreeWalker</code> is
- * initialized to this node, whether or not it is visible. The
- * <code>root</code> functions as a stopping point for traversal
- * methods that look upward in the document structure, such as
- * <code>parentNode</code> and nextNode. The <code>root</code> must
- * not be <code>null</code>.
- * @param whatToShow This flag specifies which node types may appear in
- * the logical view of the tree presented by the
- * <code>TreeWalker</code>. See the description of
- * <code>NodeFilter</code> for the set of possible <code>SHOW_</code>
- * values.These flags can be combined using <code>OR</code>.
- * @param filter The <code>NodeFilter</code> to be used with this
- * <code>TreeWalker</code>, or <code>null</code> to indicate no filter.
- * @param entityReferenceExpansion If this flag is false, the contents of
- * <code>EntityReference</code> nodes are not presented in the logical
- * view.
- * @return The newly created <code>TreeWalker</code>.
- * @exception DOMException
- * NOT_SUPPORTED_ERR: Raised if the specified <code>root</code> is
- * <code>null</code>.
- */
- public TreeWalker createTreeWalker(Node root,
- int whatToShow,
- NodeFilter filter,
- boolean entityReferenceExpansion)
- throws DOMException;
-
-}
diff --git a/src/org/w3c/dom/traversal/NodeFilter.java b/src/org/w3c/dom/traversal/NodeFilter.java
deleted file mode 100644
index e6f22b2..0000000
--- a/src/org/w3c/dom/traversal/NodeFilter.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.traversal;
-
-import org.w3c.dom.Node;
-
-/**
- * Filters are objects that know how to "filter out" nodes. If a
- * <code>NodeIterator</code> or <code>TreeWalker</code> is given a
- * <code>NodeFilter</code>, it applies the filter before it returns the next
- * node. If the filter says to accept the node, the traversal logic returns
- * it; otherwise, traversal looks for the next node and pretends that the
- * node that was rejected was not there.
- * <p>The DOM does not provide any filters. <code>NodeFilter</code> is just an
- * interface that users can implement to provide their own filters.
- * <p><code>NodeFilters</code> do not need to know how to traverse from node
- * to node, nor do they need to know anything about the data structure that
- * is being traversed. This makes it very easy to write filters, since the
- * only thing they have to know how to do is evaluate a single node. One
- * filter may be used with a number of different kinds of traversals,
- * encouraging code reuse.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>Document Object Model (DOM) Level 2 Traversal and Range Specification</a>.
- * @since DOM Level 2
- */
-public interface NodeFilter {
- // Constants returned by acceptNode
- /**
- * Accept the node. Navigation methods defined for
- * <code>NodeIterator</code> or <code>TreeWalker</code> will return this
- * node.
- */
- public static final short FILTER_ACCEPT = 1;
- /**
- * Reject the node. Navigation methods defined for
- * <code>NodeIterator</code> or <code>TreeWalker</code> will not return
- * this node. For <code>TreeWalker</code>, the children of this node
- * will also be rejected. <code>NodeIterators</code> treat this as a
- * synonym for <code>FILTER_SKIP</code>.
- */
- public static final short FILTER_REJECT = 2;
- /**
- * Skip this single node. Navigation methods defined for
- * <code>NodeIterator</code> or <code>TreeWalker</code> will not return
- * this node. For both <code>NodeIterator</code> and
- * <code>TreeWalker</code>, the children of this node will still be
- * considered.
- */
- public static final short FILTER_SKIP = 3;
-
- // Constants for whatToShow
- /**
- * Show all <code>Nodes</code>.
- */
- public static final int SHOW_ALL = 0xFFFFFFFF;
- /**
- * Show <code>Element</code> nodes.
- */
- public static final int SHOW_ELEMENT = 0x00000001;
- /**
- * Show <code>Attr</code> nodes. This is meaningful only when creating an
- * <code>NodeIterator</code> or <code>TreeWalker</code> with an
- * attribute node as its <code>root</code>; in this case, it means that
- * the attribute node will appear in the first position of the iteration
- * or traversal. Since attributes are never children of other nodes,
- * they do not appear when traversing over the document tree.
- */
- public static final int SHOW_ATTRIBUTE = 0x00000002;
- /**
- * Show <code>Text</code> nodes.
- */
- public static final int SHOW_TEXT = 0x00000004;
- /**
- * Show <code>CDATASection</code> nodes.
- */
- public static final int SHOW_CDATA_SECTION = 0x00000008;
- /**
- * Show <code>EntityReference</code> nodes.
- */
- public static final int SHOW_ENTITY_REFERENCE = 0x00000010;
- /**
- * Show <code>Entity</code> nodes. This is meaningful only when creating
- * an <code>NodeIterator</code> or <code>TreeWalker</code> with an
- * <code>Entity</code> node as its <code>root</code>; in this case, it
- * means that the <code>Entity</code> node will appear in the first
- * position of the traversal. Since entities are not part of the
- * document tree, they do not appear when traversing over the document
- * tree.
- */
- public static final int SHOW_ENTITY = 0x00000020;
- /**
- * Show <code>ProcessingInstruction</code> nodes.
- */
- public static final int SHOW_PROCESSING_INSTRUCTION = 0x00000040;
- /**
- * Show <code>Comment</code> nodes.
- */
- public static final int SHOW_COMMENT = 0x00000080;
- /**
- * Show <code>Document</code> nodes.
- */
- public static final int SHOW_DOCUMENT = 0x00000100;
- /**
- * Show <code>DocumentType</code> nodes.
- */
- public static final int SHOW_DOCUMENT_TYPE = 0x00000200;
- /**
- * Show <code>DocumentFragment</code> nodes.
- */
- public static final int SHOW_DOCUMENT_FRAGMENT = 0x00000400;
- /**
- * Show <code>Notation</code> nodes. This is meaningful only when creating
- * an <code>NodeIterator</code> or <code>TreeWalker</code> with a
- * <code>Notation</code> node as its <code>root</code>; in this case, it
- * means that the <code>Notation</code> node will appear in the first
- * position of the traversal. Since notations are not part of the
- * document tree, they do not appear when traversing over the document
- * tree.
- */
- public static final int SHOW_NOTATION = 0x00000800;
-
- /**
- * Test whether a specified node is visible in the logical view of a
- * <code>TreeWalker</code> or <code>NodeIterator</code>. This function
- * will be called by the implementation of <code>TreeWalker</code> and
- * <code>NodeIterator</code>; it is not normally called directly from
- * user code. (Though you could do so if you wanted to use the same
- * filter to guide your own application logic.)
- * @param n The node to check to see if it passes the filter or not.
- * @return A constant to determine whether the node is accepted,
- * rejected, or skipped, as defined above.
- */
- public short acceptNode(Node n);
-
-}
diff --git a/src/org/w3c/dom/traversal/NodeIterator.java b/src/org/w3c/dom/traversal/NodeIterator.java
deleted file mode 100644
index 0f6aebf..0000000
--- a/src/org/w3c/dom/traversal/NodeIterator.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.traversal;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.DOMException;
-
-/**
- * <code>NodeIterators</code> are used to step through a set of nodes, e.g.
- * the set of nodes in a <code>NodeList</code>, the document subtree
- * governed by a particular <code>Node</code>, the results of a query, or
- * any other set of nodes. The set of nodes to be iterated is determined by
- * the implementation of the <code>NodeIterator</code>. DOM Level 2
- * specifies a single <code>NodeIterator</code> implementation for
- * document-order traversal of a document subtree. Instances of these
- * <code>NodeIterators</code> are created by calling
- * <code>DocumentTraversal</code><code>.createNodeIterator()</code>.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>Document Object Model (DOM) Level 2 Traversal and Range Specification</a>.
- * @since DOM Level 2
- */
-public interface NodeIterator {
- /**
- * The root node of the <code>NodeIterator</code>, as specified when it
- * was created.
- */
- public Node getRoot();
-
- /**
- * This attribute determines which node types are presented via the
- * <code>NodeIterator</code>. The available set of constants is defined
- * in the <code>NodeFilter</code> interface. Nodes not accepted by
- * <code>whatToShow</code> will be skipped, but their children may still
- * be considered. Note that this skip takes precedence over the filter,
- * if any.
- */
- public int getWhatToShow();
-
- /**
- * The <code>NodeFilter</code> used to screen nodes.
- */
- public NodeFilter getFilter();
-
- /**
- * The value of this flag determines whether the children of entity
- * reference nodes are visible to the <code>NodeIterator</code>. If
- * false, these children and their descendants will be rejected. Note
- * that this rejection takes precedence over <code>whatToShow</code> and
- * the filter. Also note that this is currently the only situation where
- * <code>NodeIterators</code> may reject a complete subtree rather than
- * skipping individual nodes.
- * <br>
- * <br> To produce a view of the document that has entity references
- * expanded and does not expose the entity reference node itself, use
- * the <code>whatToShow</code> flags to hide the entity reference node
- * and set <code>expandEntityReferences</code> to true when creating the
- * <code>NodeIterator</code>. To produce a view of the document that has
- * entity reference nodes but no entity expansion, use the
- * <code>whatToShow</code> flags to show the entity reference node and
- * set <code>expandEntityReferences</code> to false.
- */
- public boolean getExpandEntityReferences();
-
- /**
- * Returns the next node in the set and advances the position of the
- * <code>NodeIterator</code> in the set. After a
- * <code>NodeIterator</code> is created, the first call to
- * <code>nextNode()</code> returns the first node in the set.
- * @return The next <code>Node</code> in the set being iterated over, or
- * <code>null</code> if there are no more members in that set.
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if this method is called after the
- * <code>detach</code> method was invoked.
- */
- public Node nextNode()
- throws DOMException;
-
- /**
- * Returns the previous node in the set and moves the position of the
- * <code>NodeIterator</code> backwards in the set.
- * @return The previous <code>Node</code> in the set being iterated over,
- * or <code>null</code> if there are no more members in that set.
- * @exception DOMException
- * INVALID_STATE_ERR: Raised if this method is called after the
- * <code>detach</code> method was invoked.
- */
- public Node previousNode()
- throws DOMException;
-
- /**
- * Detaches the <code>NodeIterator</code> from the set which it iterated
- * over, releasing any computational resources and placing the
- * <code>NodeIterator</code> in the INVALID state. After
- * <code>detach</code> has been invoked, calls to <code>nextNode</code>
- * or <code>previousNode</code> will raise the exception
- * INVALID_STATE_ERR.
- */
- public void detach();
-
-}
diff --git a/src/org/w3c/dom/traversal/TreeWalker.java b/src/org/w3c/dom/traversal/TreeWalker.java
deleted file mode 100644
index f0876e5..0000000
--- a/src/org/w3c/dom/traversal/TreeWalker.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.traversal;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.DOMException;
-
-/**
- * <code>TreeWalker</code> objects are used to navigate a document tree or
- * subtree using the view of the document defined by their
- * <code>whatToShow</code> flags and filter (if any). Any function which
- * performs navigation using a <code>TreeWalker</code> will automatically
- * support any view defined by a <code>TreeWalker</code>.
- * <p>Omitting nodes from the logical view of a subtree can result in a
- * structure that is substantially different from the same subtree in the
- * complete, unfiltered document. Nodes that are siblings in the
- * <code>TreeWalker</code> view may be children of different, widely
- * separated nodes in the original view. For instance, consider a
- * <code>NodeFilter</code> that skips all nodes except for Text nodes and
- * the root node of a document. In the logical view that results, all text
- * nodes will be siblings and appear as direct children of the root node, no
- * matter how deeply nested the structure of the original document.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>Document Object Model (DOM) Level 2 Traversal and Range Specification</a>.
- * @since DOM Level 2
- */
-public interface TreeWalker {
- /**
- * The <code>root</code> node of the <code>TreeWalker</code>, as specified
- * when it was created.
- */
- public Node getRoot();
-
- /**
- * This attribute determines which node types are presented via the
- * <code>TreeWalker</code>. The available set of constants is defined in
- * the <code>NodeFilter</code> interface. Nodes not accepted by
- * <code>whatToShow</code> will be skipped, but their children may still
- * be considered. Note that this skip takes precedence over the filter,
- * if any.
- */
- public int getWhatToShow();
-
- /**
- * The filter used to screen nodes.
- */
- public NodeFilter getFilter();
-
- /**
- * The value of this flag determines whether the children of entity
- * reference nodes are visible to the <code>TreeWalker</code>. If false,
- * these children and their descendants will be rejected. Note that
- * this rejection takes precedence over <code>whatToShow</code> and the
- * filter, if any.
- * <br> To produce a view of the document that has entity references
- * expanded and does not expose the entity reference node itself, use
- * the <code>whatToShow</code> flags to hide the entity reference node
- * and set <code>expandEntityReferences</code> to true when creating the
- * <code>TreeWalker</code>. To produce a view of the document that has
- * entity reference nodes but no entity expansion, use the
- * <code>whatToShow</code> flags to show the entity reference node and
- * set <code>expandEntityReferences</code> to false.
- */
- public boolean getExpandEntityReferences();
-
- /**
- * The node at which the <code>TreeWalker</code> is currently positioned.
- * <br>Alterations to the DOM tree may cause the current node to no longer
- * be accepted by the <code>TreeWalker</code>'s associated filter.
- * <code>currentNode</code> may also be explicitly set to any node,
- * whether or not it is within the subtree specified by the
- * <code>root</code> node or would be accepted by the filter and
- * <code>whatToShow</code> flags. Further traversal occurs relative to
- * <code>currentNode</code> even if it is not part of the current view,
- * by applying the filters in the requested direction; if no traversal
- * is possible, <code>currentNode</code> is not changed.
- */
- public Node getCurrentNode();
- /**
- * The node at which the <code>TreeWalker</code> is currently positioned.
- * <br>Alterations to the DOM tree may cause the current node to no longer
- * be accepted by the <code>TreeWalker</code>'s associated filter.
- * <code>currentNode</code> may also be explicitly set to any node,
- * whether or not it is within the subtree specified by the
- * <code>root</code> node or would be accepted by the filter and
- * <code>whatToShow</code> flags. Further traversal occurs relative to
- * <code>currentNode</code> even if it is not part of the current view,
- * by applying the filters in the requested direction; if no traversal
- * is possible, <code>currentNode</code> is not changed.
- * @exception DOMException
- * NOT_SUPPORTED_ERR: Raised if an attempt is made to set
- * <code>currentNode</code> to <code>null</code>.
- */
- public void setCurrentNode(Node currentNode)
- throws DOMException;
-
- /**
- * Moves to and returns the closest visible ancestor node of the current
- * node. If the search for <code>parentNode</code> attempts to step
- * upward from the <code>TreeWalker</code>'s <code>root</code> node, or
- * if it fails to find a visible ancestor node, this method retains the
- * current position and returns <code>null</code>.
- * @return The new parent node, or <code>null</code> if the current node
- * has no parent in the <code>TreeWalker</code>'s logical view.
- */
- public Node parentNode();
-
- /**
- * Moves the <code>TreeWalker</code> to the first visible child of the
- * current node, and returns the new node. If the current node has no
- * visible children, returns <code>null</code>, and retains the current
- * node.
- * @return The new node, or <code>null</code> if the current node has no
- * visible children in the <code>TreeWalker</code>'s logical view.
- */
- public Node firstChild();
-
- /**
- * Moves the <code>TreeWalker</code> to the last visible child of the
- * current node, and returns the new node. If the current node has no
- * visible children, returns <code>null</code>, and retains the current
- * node.
- * @return The new node, or <code>null</code> if the current node has no
- * children in the <code>TreeWalker</code>'s logical view.
- */
- public Node lastChild();
-
- /**
- * Moves the <code>TreeWalker</code> to the previous sibling of the
- * current node, and returns the new node. If the current node has no
- * visible previous sibling, returns <code>null</code>, and retains the
- * current node.
- * @return The new node, or <code>null</code> if the current node has no
- * previous sibling. in the <code>TreeWalker</code>'s logical view.
- */
- public Node previousSibling();
-
- /**
- * Moves the <code>TreeWalker</code> to the next sibling of the current
- * node, and returns the new node. If the current node has no visible
- * next sibling, returns <code>null</code>, and retains the current node.
- * @return The new node, or <code>null</code> if the current node has no
- * next sibling. in the <code>TreeWalker</code>'s logical view.
- */
- public Node nextSibling();
-
- /**
- * Moves the <code>TreeWalker</code> to the previous visible node in
- * document order relative to the current node, and returns the new
- * node. If the current node has no previous node, or if the search for
- * <code>previousNode</code> attempts to step upward from the
- * <code>TreeWalker</code>'s <code>root</code> node, returns
- * <code>null</code>, and retains the current node.
- * @return The new node, or <code>null</code> if the current node has no
- * previous node in the <code>TreeWalker</code>'s logical view.
- */
- public Node previousNode();
-
- /**
- * Moves the <code>TreeWalker</code> to the next visible node in document
- * order relative to the current node, and returns the new node. If the
- * current node has no next node, or if the search for nextNode attempts
- * to step upward from the <code>TreeWalker</code>'s <code>root</code>
- * node, returns <code>null</code>, and retains the current node.
- * @return The new node, or <code>null</code> if the current node has no
- * next node in the <code>TreeWalker</code>'s logical view.
- */
- public Node nextNode();
-
-}
diff --git a/src/org/w3c/dom/views/AbstractView.java b/src/org/w3c/dom/views/AbstractView.java
deleted file mode 100644
index 5219571..0000000
--- a/src/org/w3c/dom/views/AbstractView.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.views;
-
-/**
- * A base interface that all views shall derive from.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Views-20001113'>Document Object Model (DOM) Level 2 Views Specification</a>.
- * @since DOM Level 2
- */
-public interface AbstractView {
- /**
- * The source <code>DocumentView</code> of which this is an
- * <code>AbstractView</code>.
- */
- public DocumentView getDocument();
-
-}
diff --git a/src/org/w3c/dom/views/DocumentView.java b/src/org/w3c/dom/views/DocumentView.java
deleted file mode 100644
index 38793a4..0000000
--- a/src/org/w3c/dom/views/DocumentView.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.views;
-
-/**
- * The <code>DocumentView</code> interface is implemented by
- * <code>Document</code> objects in DOM implementations supporting DOM
- * Views. It provides an attribute to retrieve the default view of a
- * document.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Views-20001113'>Document Object Model (DOM) Level 2 Views Specification</a>.
- * @since DOM Level 2
- */
-public interface DocumentView {
- /**
- * The default <code>AbstractView</code> for this <code>Document</code>,
- * or <code>null</code> if none available.
- */
- public AbstractView getDefaultView();
-
-}
diff --git a/src/org/w3c/dom/xpath/COPYRIGHT.html b/src/org/w3c/dom/xpath/COPYRIGHT.html
deleted file mode 100644
index c7e0e49..0000000
--- a/src/org/w3c/dom/xpath/COPYRIGHT.html
+++ /dev/null
@@ -1,106 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
- <title>W3C IPR SOFTWARE NOTICE</title>
-<style type="text/css">
-<!--
-html, body { background: #fff; color: #000; } /* body for Windows IE3 */
--->
-</style>
- </head>
- <body>
- <h1>
- W3C IPR SOFTWARE NOTICE
- </h1>
- <h3>
- Copyright &copy; 2002 <a href="http://www.w3.org/">World Wide Web
- Consortium</a>, (<a href="http://www.lcs.mit.edu/">Massachusetts
- Institute of Technology</a>, <a href="http://www.inria.fr/">Institut
- National de Recherche en Informatique et en Automatique</a>, <a
- href="http://www.keio.ac.jp/">Keio University</a>). All Rights
- Reserved.
- </h3>
- <p>
- The DOM bindings are published under the W3C Software Copyright Notice
- and License. The software license requires "Notice of any changes or
- modifications to the W3C files, including the date changes were made."
- Consequently, modified versions of the DOM bindings must document that
- they do not conform to the W3C standard; in the case of the IDL
- definitions, the pragma prefix can no longer be 'w3c.org'; in the case of
- the Java language binding, the package names can no longer be in the
- 'org.w3c' package.
- </p>
- <p>
- <b>Note:</b> The original version of the W3C Software Copyright Notice
- and License could be found at <a
- href='http://www.w3.org/Consortium/Legal/copyright-software-19980720'>http://www.w3.org/Consortium/Legal/copyright-software-19980720</a>
- </p>
- <h3>
- Copyright &copy; 1994-2002 <a href="http://www.w3.org/">World Wide Web
- Consortium</a>, (<a href="http://www.lcs.mit.edu/">Massachusetts
- Institute of Technology</a>, <a href="http://www.inria.fr/">Institut
- National de Recherche en Informatique et en Automatique</a>, <a
- href="http://www.keio.ac.jp/">Keio University</a>). All Rights
- Reserved. http://www.w3.org/Consortium/Legal/
- </h3>
- <p>
- This W3C work (including software, documents, or other related items) is
- being provided by the copyright holders under the following license. By
- obtaining, using and/or copying this work, you (the licensee) agree that
- you have read, understood, and will comply with the following terms and
- conditions:
- </p>
- <p>
- Permission to use, copy, and modify this software and its documentation,
- with or without modification,&nbsp; for any purpose and without fee or
- royalty is hereby granted, provided that you include the following on ALL
- copies of the software and documentation or portions thereof, including
- modifications, that you make:
- </p>
- <ol>
- <li>
- The full text of this NOTICE in a location viewable to users of the
- redistributed or derivative work.
- </li>
- <li>
- Any pre-existing intellectual property disclaimers, notices, or terms
- and conditions. If none exist, a short notice of the following form
- (hypertext is preferred, text is permitted) should be used within the
- body of any redistributed or derivative code: "Copyright &copy;
- [$date-of-software] <a href="http://www.w3.org/">World Wide Web
- Consortium</a>, (<a href="http://www.lcs.mit.edu/">Massachusetts
- Institute of Technology</a>, <a href="http://www.inria.fr/">Institut
- National de Recherche en Informatique et en Automatique</a>, <a
- href="http://www.keio.ac.jp/">Keio University</a>). All Rights
- Reserved. http://www.w3.org/Consortium/Legal/"
- </li>
- <li>
- Notice of any changes or modifications to the W3C files, including the
- date changes were made. (We recommend you provide URIs to the location
- from which the code is derived.)
- </li>
- </ol>
- <p>
- THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT
- HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED,
- INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS
- FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR
- DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS,
- TRADEMARKS OR OTHER RIGHTS.
- </p>
- <p>
- COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR
- CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR
- DOCUMENTATION.
- </p>
- <p>
- The name and trademarks of copyright holders may NOT be used in
- advertising or publicity pertaining to the software without specific,
- written prior permission. Title to copyright in this software and any
- associated documentation will at all times remain with copyright
- holders.
- </p>
- </body>
-</html>
diff --git a/src/org/w3c/dom/xpath/XPathEvaluator.java b/src/org/w3c/dom/xpath/XPathEvaluator.java
deleted file mode 100644
index da6bec5..0000000
--- a/src/org/w3c/dom/xpath/XPathEvaluator.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2002 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.xpath;
-
-
-import org.w3c.dom.Node;
-import org.w3c.dom.DOMException;
-
-/**
- * The evaluation of XPath expressions is provided by
- * <code>XPathEvaluator</code>. In a DOM implementation which supports the
- * XPath 3.0 feature, as described above, the <code>XPathEvaluator</code>
- * interface will be implemented on the same object which implements the
- * <code>Document</code> interface permitting it to be obtained by the usual
- * binding-specific method such as casting or by using the DOM Level 3
- * getInterface method. In this case the implementation obtained from the
- * Document supports the XPath DOM module and is compatible with the XPath
- * 1.0 specification.
- * <p>Evaluation of expressions with specialized extension functions or
- * variables may not work in all implementations and is, therefore, not
- * portable. <code>XPathEvaluator</code> implementations may be available
- * from other sources that could provide specific support for specialized
- * extension functions or variables as would be defined by other
- * specifications.
- * <p>See also the <a href='http://www.w3.org/2002/08/WD-DOM-Level-3-XPath-20020820'>Document Object Model (DOM) Level 3 XPath Specification</a>.
- */
-public interface XPathEvaluator {
- /**
- * Creates a parsed XPath expression with resolved namespaces. This is
- * useful when an expression will be reused in an application since it
- * makes it possible to compile the expression string into a more
- * efficient internal form and preresolve all namespace prefixes which
- * occur within the expression.
- * @param expression The XPath expression string to be parsed.
- * @param resolver The <code>resolver</code> permits translation of
- * prefixes within the XPath expression into appropriate namespace URIs
- * . If this is specified as <code>null</code>, any namespace prefix
- * within the expression will result in <code>DOMException</code>
- * being thrown with the code <code>NAMESPACE_ERR</code>.
- * @return The compiled form of the XPath expression.
- * @exception XPathException
- * INVALID_EXPRESSION_ERR: Raised if the expression is not legal
- * according to the rules of the <code>XPathEvaluator</code>i
- * @exception DOMException
- * NAMESPACE_ERR: Raised if the expression contains namespace prefixes
- * which cannot be resolved by the specified
- * <code>XPathNSResolver</code>.
- */
- public XPathExpression createExpression(String expression,
- XPathNSResolver resolver)
- throws XPathException, DOMException;
-
- /**
- * Adapts any DOM node to resolve namespaces so that an XPath expression
- * can be easily evaluated relative to the context of the node where it
- * appeared within the document. This adapter works like the DOM Level 3
- * method <code>lookupNamespaceURI</code> on nodes in resolving the
- * namespaceURI from a given prefix using the current information
- * available in the node's hierarchy at the time lookupNamespaceURI is
- * called. also correctly resolving the implicit xml prefix.
- * @param nodeResolver The node to be used as a context for namespace
- * resolution.
- * @return <code>XPathNSResolver</code> which resolves namespaces with
- * respect to the definitions in scope for a specified node.
- */
- public XPathNSResolver createNSResolver(Node nodeResolver);
-
- /**
- * Evaluates an XPath expression string and returns a result of the
- * specified type if possible.
- * @param expression The XPath expression string to be parsed and
- * evaluated.
- * @param contextNode The <code>context</code> is context node for the
- * evaluation of this XPath expression. If the XPathEvaluator was
- * obtained by casting the <code>Document</code> then this must be
- * owned by the same document and must be a <code>Document</code>,
- * <code>Element</code>, <code>Attribute</code>, <code>Text</code>,
- * <code>CDATASection</code>, <code>Comment</code>,
- * <code>ProcessingInstruction</code>, or <code>XPathNamespace</code>
- * node. If the context node is a <code>Text</code> or a
- * <code>CDATASection</code>, then the context is interpreted as the
- * whole logical text node as seen by XPath, unless the node is empty
- * in which case it may not serve as the XPath context.
- * @param resolver The <code>resolver</code> permits translation of
- * prefixes within the XPath expression into appropriate namespace URIs
- * . If this is specified as <code>null</code>, any namespace prefix
- * within the expression will result in <code>DOMException</code>
- * being thrown with the code <code>NAMESPACE_ERR</code>.
- * @param type If a specific <code>type</code> is specified, then the
- * result will be returned as the corresponding type.For XPath 1.0
- * results, this must be one of the codes of the
- * <code>XPathResult</code> interface.
- * @param result The <code>result</code> specifies a specific result
- * object which may be reused and returned by this method. If this is
- * specified as <code>null</code>or the implementation does not reuse
- * the specified result, a new result object will be constructed and
- * returned.For XPath 1.0 results, this object will be of type
- * <code>XPathResult</code>.
- * @return The result of the evaluation of the XPath expression.For XPath
- * 1.0 results, this object will be of type <code>XPathResult</code>.
- * @exception XPathException
- * INVALID_EXPRESSION_ERR: Raised if the expression is not legal
- * according to the rules of the <code>XPathEvaluator</code>i
- * <br>TYPE_ERR: Raised if the result cannot be converted to return the
- * specified type.
- * @exception DOMException
- * NAMESPACE_ERR: Raised if the expression contains namespace prefixes
- * which cannot be resolved by the specified
- * <code>XPathNSResolver</code>.
- * <br>WRONG_DOCUMENT_ERR: The Node is from a document that is not
- * supported by this <code>XPathEvaluator</code>.
- * <br>NOT_SUPPORTED_ERR: The Node is not a type permitted as an XPath
- * context node or the request type is not permitted by this
- * <code>XPathEvaluator</code>.
- */
- public Object evaluate(String expression,
- Node contextNode,
- XPathNSResolver resolver,
- short type,
- Object result)
- throws XPathException, DOMException;
-
-}
diff --git a/src/org/w3c/dom/xpath/XPathException.java b/src/org/w3c/dom/xpath/XPathException.java
deleted file mode 100644
index 75121d4..0000000
--- a/src/org/w3c/dom/xpath/XPathException.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2002 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.xpath;
-
-/**
- * A new exception has been created for exceptions specific to these XPath
- * interfaces.
- * <p>See also the <a href='http://www.w3.org/2002/08/WD-DOM-Level-3-XPath-20020820'>Document Object Model (DOM) Level 3 XPath Specification</a>.
- */
-public class XPathException extends RuntimeException {
- public XPathException(short code, String message) {
- super(message);
- this.code = code;
- }
- public short code;
- // XPathExceptionCode
- /**
- * If the expression has a syntax error or otherwise is not a legal
- * expression according to the rules of the specific
- * <code>XPathEvaluator</code> or contains specialized extension
- * functions or variables not supported by this implementation.
- */
- public static final short INVALID_EXPRESSION_ERR = 1;
- /**
- * If the expression cannot be converted to return the specified type.
- */
- public static final short TYPE_ERR = 2;
-
-}
diff --git a/src/org/w3c/dom/xpath/XPathExpression.java b/src/org/w3c/dom/xpath/XPathExpression.java
deleted file mode 100644
index 17ec412..0000000
--- a/src/org/w3c/dom/xpath/XPathExpression.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2002 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.xpath;
-
-
-import org.w3c.dom.Node;
-import org.w3c.dom.DOMException;
-
-/**
- * The <code>XPathExpression</code> interface represents a parsed and resolved
- * XPath expression.
- * <p>See also the <a href='http://www.w3.org/2002/08/WD-DOM-Level-3-XPath-20020820'>Document Object Model (DOM) Level 3 XPath Specification</a>.
- */
-public interface XPathExpression {
- /**
- * Evaluates this XPath expression and returns a result.
- * @param contextNode The <code>context</code> is context node for the
- * evaluation of this XPath expression.If the XPathEvaluator was
- * obtained by casting the <code>Document</code> then this must be
- * owned by the same document and must be a <code>Document</code>,
- * <code>Element</code>, <code>Attribute</code>, <code>Text</code>,
- * <code>CDATASection</code>, <code>Comment</code>,
- * <code>ProcessingInstruction</code>, or <code>XPathNamespace</code>
- * node.If the context node is a <code>Text</code> or a
- * <code>CDATASection</code>, then the context is interpreted as the
- * whole logical text node as seen by XPath, unless the node is empty
- * in which case it may not serve as the XPath context.
- * @param type If a specific <code>type</code> is specified, then the
- * result will be coerced to return the specified type relying on
- * XPath conversions and fail if the desired coercion is not possible.
- * This must be one of the type codes of <code>XPathResult</code>.
- * @param result The <code>result</code> specifies a specific result
- * object which may be reused and returned by this method. If this is
- * specified as <code>null</code>or the implementation does not reuse
- * the specified result, a new result object will be constructed and
- * returned.For XPath 1.0 results, this object will be of type
- * <code>XPathResult</code>.
- * @return The result of the evaluation of the XPath expression.For XPath
- * 1.0 results, this object will be of type <code>XPathResult</code>.
- * @exception XPathException
- * TYPE_ERR: Raised if the result cannot be converted to return the
- * specified type.
- * @exception DOMException
- * WRONG_DOCUMENT_ERR: The Node is from a document that is not supported
- * by the XPathEvaluator that created this <code>XPathExpression</code>
- * .
- * <br>NOT_SUPPORTED_ERR: The Node is not a type permitted as an XPath
- * context node or the request type is not permitted by this
- * <code>XPathExpression</code>.
- */
- public Object evaluate(Node contextNode,
- short type,
- Object result)
- throws XPathException, DOMException;
-
-}
diff --git a/src/org/w3c/dom/xpath/XPathNSResolver.java b/src/org/w3c/dom/xpath/XPathNSResolver.java
deleted file mode 100644
index 68eb1f3..0000000
--- a/src/org/w3c/dom/xpath/XPathNSResolver.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2002 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.xpath;
-
-
-/**
- * The <code>XPathNSResolver</code> interface permit <code>prefix</code>
- * strings in the expression to be properly bound to
- * <code>namespaceURI</code> strings. <code>XPathEvaluator</code> can
- * construct an implementation of <code>XPathNSResolver</code> from a node,
- * or the interface may be implemented by any application.
- * <p>See also the <a href='http://www.w3.org/2002/08/WD-DOM-Level-3-XPath-20020820'>Document Object Model (DOM) Level 3 XPath Specification</a>.
- */
-public interface XPathNSResolver {
- /**
- * Look up the namespace URI associated to the given namespace prefix. The
- * XPath evaluator must never call this with a <code>null</code> or
- * empty argument, because the result of doing this is undefined.
- * @param prefix The prefix to look for.
- * @return Returns the associated namespace URI or <code>null</code> if
- * none is found.
- */
- public String lookupNamespaceURI(String prefix);
-
-}
diff --git a/src/org/w3c/dom/xpath/XPathNamespace.java b/src/org/w3c/dom/xpath/XPathNamespace.java
deleted file mode 100644
index cdfea88..0000000
--- a/src/org/w3c/dom/xpath/XPathNamespace.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2002 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.xpath;
-
-
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * The <code>XPathNamespace</code> interface is returned by
- * <code>XPathResult</code> interfaces to represent the XPath namespace node
- * type that DOM lacks. There is no public constructor for this node type.
- * Attempts to place it into a hierarchy or a NamedNodeMap result in a
- * <code>DOMException</code> with the code <code>HIERARCHY_REQUEST_ERR</code>
- * . This node is read only, so methods or setting of attributes that would
- * mutate the node result in a DOMException with the code
- * <code>NO_MODIFICATION_ALLOWED_ERR</code>.
- * <p>The core specification describes attributes of the <code>Node</code>
- * interface that are different for different node node types but does not
- * describe <code>XPATH_NAMESPACE_NODE</code>, so here is a description of
- * those attributes for this node type. All attributes of <code>Node</code>
- * not described in this section have a <code>null</code> or
- * <code>false</code> value.
- * <p><code>ownerDocument</code> matches the <code>ownerDocument</code> of the
- * <code>ownerElement</code> even if the element is later adopted.
- * <p><code>prefix</code> is the prefix of the namespace represented by the
- * node.
- * <p><code>nodeName</code> is the same as <code>prefix</code>.
- * <p><code>nodeType</code> is equal to <code>XPATH_NAMESPACE_NODE</code>.
- * <p><code>namespaceURI</code> is the namespace URI of the namespace
- * represented by the node.
- * <p><code>adoptNode</code>, <code>cloneNode</code>, and
- * <code>importNode</code> fail on this node type by raising a
- * <code>DOMException</code> with the code <code>NOT_SUPPORTED_ERR</code>.In
- * future versions of the XPath specification, the definition of a namespace
- * node may be changed incomatibly, in which case incompatible changes to
- * field values may be required to implement versions beyond XPath 1.0.
- * <p>See also the <a href='http://www.w3.org/2002/08/WD-DOM-Level-3-XPath-20020820'>Document Object Model (DOM) Level 3 XPath Specification</a>.
- */
-public interface XPathNamespace extends Node {
- // XPathNodeType
- /**
- * The node is a <code>Namespace</code>.
- */
- public static final short XPATH_NAMESPACE_NODE = 13;
-
- /**
- * The <code>Element</code> on which the namespace was in scope when it
- * was requested. This does not change on a returned namespace node even
- * if the document changes such that the namespace goes out of scope on
- * that element and this node is no longer found there by XPath.
- */
- public Element getOwnerElement();
-
-}
diff --git a/src/org/w3c/dom/xpath/XPathResult.java b/src/org/w3c/dom/xpath/XPathResult.java
deleted file mode 100644
index d042011..0000000
--- a/src/org/w3c/dom/xpath/XPathResult.java
+++ /dev/null
@@ -1,241 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file and, per its terms, should not be removed:
- *
- * Copyright (c) 2002 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
- */
-
-package org.w3c.dom.xpath;
-
-
-import org.w3c.dom.Node;
-import org.w3c.dom.DOMException;
-
-/**
- * The <code>XPathResult</code> interface represents the result of the
- * evaluation of an XPath 1.0 expression within the context of a particular
- * node. Since evaluation of an XPath expression can result in various
- * result types, this object makes it possible to discover and manipulate
- * the type and value of the result.
- * <p>See also the <a href='http://www.w3.org/2002/08/WD-DOM-Level-3-XPath-20020820'>Document Object Model (DOM) Level 3 XPath Specification</a>.
- */
-public interface XPathResult {
- // XPathResultType
- /**
- * This code does not represent a specific type. An evaluation of an XPath
- * expression will never produce this type. If this type is requested,
- * then the evaluation returns whatever type naturally results from
- * evaluation of the expression.
- * <br>If the natural result is a node set when <code>ANY_TYPE</code> was
- * requested, then <code>UNORDERED_NODE_ITERATOR_TYPE</code> is always
- * the resulting type. Any other representation of a node set must be
- * explicitly requested.
- */
- public static final short ANY_TYPE = 0;
- /**
- * The result is a number as defined by . Document modification does not
- * invalidate the number, but may mean that reevaluation would not yield
- * the same number.
- */
- public static final short NUMBER_TYPE = 1;
- /**
- * The result is a string as defined by . Document modification does not
- * invalidate the string, but may mean that the string no longer
- * corresponds to the current document.
- */
- public static final short STRING_TYPE = 2;
- /**
- * The result is a boolean as defined by . Document modification does not
- * invalidate the boolean, but may mean that reevaluation would not
- * yield the same boolean.
- */
- public static final short BOOLEAN_TYPE = 3;
- /**
- * The result is a node set as defined by that will be accessed
- * iteratively, which may not produce nodes in a particular order.
- * Document modification invalidates the iteration.
- * <br>This is the default type returned if the result is a node set and
- * <code>ANY_TYPE</code> is requested.
- */
- public static final short UNORDERED_NODE_ITERATOR_TYPE = 4;
- /**
- * The result is a node set as defined by that will be accessed
- * iteratively, which will produce document-ordered nodes. Document
- * modification invalidates the iteration.
- */
- public static final short ORDERED_NODE_ITERATOR_TYPE = 5;
- /**
- * The result is a node set as defined by that will be accessed as a
- * snapshot list of nodes that may not be in a particular order.
- * Document modification does not invalidate the snapshot but may mean
- * that reevaluation would not yield the same snapshot and nodes in the
- * snapshot may have been altered, moved, or removed from the document.
- */
- public static final short UNORDERED_NODE_SNAPSHOT_TYPE = 6;
- /**
- * The result is a node set as defined by that will be accessed as a
- * snapshot list of nodes that will be in original document order.
- * Document modification does not invalidate the snapshot but may mean
- * that reevaluation would not yield the same snapshot and nodes in the
- * snapshot may have been altered, moved, or removed from the document.
- */
- public static final short ORDERED_NODE_SNAPSHOT_TYPE = 7;
- /**
- * The result is a node set as defined by and will be accessed as a
- * single node, which may be <code>null</code>if the node set is empty.
- * Document modification does not invalidate the node, but may mean that
- * the result node no longer corresponds to the current document. This
- * is a convenience that permits optimization since the implementation
- * can stop once any node in the in the resulting set has been found.
- * <br>If there are more than one node in the actual result, the single
- * node returned might not be the first in document order.
- */
- public static final short ANY_UNORDERED_NODE_TYPE = 8;
- /**
- * The result is a node set as defined by and will be accessed as a
- * single node, which may be <code>null</code> if the node set is empty.
- * Document modification does not invalidate the node, but may mean that
- * the result node no longer corresponds to the current document. This
- * is a convenience that permits optimization since the implementation
- * can stop once the first node in document order of the resulting set
- * has been found.
- * <br>If there are more than one node in the actual result, the single
- * node returned will be the first in document order.
- */
- public static final short FIRST_ORDERED_NODE_TYPE = 9;
-
- /**
- * A code representing the type of this result, as defined by the type
- * constants.
- */
- public short getResultType();
-
- /**
- * The value of this number result. If the native double type of the DOM
- * binding does not directly support the exact IEEE 754 result of the
- * XPath expression, then it is up to the definition of the binding
- * binding to specify how the XPath number is converted to the native
- * binding number.
- * @exception XPathException
- * TYPE_ERR: raised if <code>resultType</code> is not
- * <code>NUMBER_TYPE</code>.
- */
- public double getNumberValue()
- throws XPathException;
-
- /**
- * The value of this string result.
- * @exception XPathException
- * TYPE_ERR: raised if <code>resultType</code> is not
- * <code>STRING_TYPE</code>.
- */
- public String getStringValue()
- throws XPathException;
-
- /**
- * The value of this boolean result.
- * @exception XPathException
- * TYPE_ERR: raised if <code>resultType</code> is not
- * <code>BOOLEAN_TYPE</code>.
- */
- public boolean getBooleanValue()
- throws XPathException;
-
- /**
- * The value of this single node result, which may be <code>null</code>.
- * @exception XPathException
- * TYPE_ERR: raised if <code>resultType</code> is not
- * <code>ANY_UNORDERED_NODE_TYPE</code> or
- * <code>FIRST_ORDERED_NODE_TYPE</code>.
- */
- public Node getSingleNodeValue()
- throws XPathException;
-
- /**
- * Signifies that the iterator has become invalid. True if
- * <code>resultType</code> is <code>UNORDERED_NODE_ITERATOR_TYPE</code>
- * or <code>ORDERED_NODE_ITERATOR_TYPE</code> and the document has been
- * modified since this result was returned.
- */
- public boolean getInvalidIteratorState();
-
- /**
- * The number of nodes in the result snapshot. Valid values for
- * snapshotItem indices are <code>0</code> to
- * <code>snapshotLength-1</code> inclusive.
- * @exception XPathException
- * TYPE_ERR: raised if <code>resultType</code> is not
- * <code>UNORDERED_NODE_SNAPSHOT_TYPE</code> or
- * <code>ORDERED_NODE_SNAPSHOT_TYPE</code>.
- */
- public int getSnapshotLength()
- throws XPathException;
-
- /**
- * Iterates and returns the next node from the node set or
- * <code>null</code>if there are no more nodes.
- * @return Returns the next node.
- * @exception XPathException
- * TYPE_ERR: raised if <code>resultType</code> is not
- * <code>UNORDERED_NODE_ITERATOR_TYPE</code> or
- * <code>ORDERED_NODE_ITERATOR_TYPE</code>.
- * @exception DOMException
- * INVALID_STATE_ERR: The document has been mutated since the result was
- * returned.
- */
- public Node iterateNext()
- throws XPathException, DOMException;
-
- /**
- * Returns the <code>index</code>th item in the snapshot collection. If
- * <code>index</code> is greater than or equal to the number of nodes in
- * the list, this method returns <code>null</code>. Unlike the iterator
- * result, the snapshot does not become invalid, but may not correspond
- * to the current document if it is mutated.
- * @param index Index into the snapshot collection.
- * @return The node at the <code>index</code>th position in the
- * <code>NodeList</code>, or <code>null</code> if that is not a valid
- * index.
- * @exception XPathException
- * TYPE_ERR: raised if <code>resultType</code> is not
- * <code>UNORDERED_NODE_SNAPSHOT_TYPE</code> or
- * <code>ORDERED_NODE_SNAPSHOT_TYPE</code>.
- */
- public Node snapshotItem(int index)
- throws XPathException;
-
-}
diff --git a/src/org/xml/sax/AttributeList.java b/src/org/xml/sax/AttributeList.java
deleted file mode 100644
index 07ee3dd..0000000
--- a/src/org/xml/sax/AttributeList.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-// SAX Attribute List Interface.
-// http://www.saxproject.org
-// No warranty; no copyright -- use this as you will.
-// $Id: AttributeList.java,v 1.3 2004/11/03 22:44:51 jsuttor Exp $
-
-package org.xml.sax;
-
-/**
- * Interface for an element's attribute specifications.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>This is the original SAX1 interface for reporting an element's
- * attributes. Unlike the new {@link org.xml.sax.Attributes Attributes}
- * interface, it does not support Namespace-related information.</p>
- *
- * <p>When an attribute list is supplied as part of a
- * {@link org.xml.sax.DocumentHandler#startElement startElement}
- * event, the list will return valid results only during the
- * scope of the event; once the event handler returns control
- * to the parser, the attribute list is invalid. To save a
- * persistent copy of the attribute list, use the SAX1
- * {@link org.xml.sax.helpers.AttributeListImpl AttributeListImpl}
- * helper class.</p>
- *
- * <p>An attribute list includes only attributes that have been
- * specified or defaulted: #IMPLIED attributes will not be included.</p>
- *
- * <p>There are two ways for the SAX application to obtain information
- * from the AttributeList. First, it can iterate through the entire
- * list:</p>
- *
- * <pre>
- * public void startElement (String name, AttributeList atts) {
- * for (int i = 0; i < atts.getLength(); i++) {
- * String name = atts.getName(i);
- * String type = atts.getType(i);
- * String value = atts.getValue(i);
- * [...]
- * }
- * }
- * </pre>
- *
- * <p>(Note that the result of getLength() will be zero if there
- * are no attributes.)
- *
- * <p>As an alternative, the application can request the value or
- * type of specific attributes:</p>
- *
- * <pre>
- * public void startElement (String name, AttributeList atts) {
- * String identifier = atts.getValue("id");
- * String label = atts.getValue("label");
- * [...]
- * }
- * </pre>
- *
- * @deprecated This interface has been replaced by the SAX2
- * {@link org.xml.sax.Attributes Attributes}
- * interface, which includes Namespace support.
- * @since SAX 1.0
- * @author David Megginson
- * @see org.xml.sax.DocumentHandler#startElement startElement
- * @see org.xml.sax.helpers.AttributeListImpl AttributeListImpl
- */
-public interface AttributeList {
-
-
- ////////////////////////////////////////////////////////////////////
- // Iteration methods.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Return the number of attributes in this list.
- *
- * <p>The SAX parser may provide attributes in any
- * arbitrary order, regardless of the order in which they were
- * declared or specified. The number of attributes may be
- * zero.</p>
- *
- * @return The number of attributes in the list.
- */
- public abstract int getLength ();
-
-
- /**
- * Return the name of an attribute in this list (by position).
- *
- * <p>The names must be unique: the SAX parser shall not include the
- * same attribute twice. Attributes without values (those declared
- * #IMPLIED without a value specified in the start tag) will be
- * omitted from the list.</p>
- *
- * <p>If the attribute name has a namespace prefix, the prefix
- * will still be attached.</p>
- *
- * @param i The index of the attribute in the list (starting at 0).
- * @return The name of the indexed attribute, or null
- * if the index is out of range.
- * @see #getLength
- */
- public abstract String getName (int i);
-
-
- /**
- * Return the type of an attribute in the list (by position).
- *
- * <p>The attribute type is one of the strings "CDATA", "ID",
- * "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY", "ENTITIES",
- * or "NOTATION" (always in upper case).</p>
- *
- * <p>If the parser has not read a declaration for the attribute,
- * or if the parser does not report attribute types, then it must
- * return the value "CDATA" as stated in the XML 1.0 Recommentation
- * (clause 3.3.3, "Attribute-Value Normalization").</p>
- *
- * <p>For an enumerated attribute that is not a notation, the
- * parser will report the type as "NMTOKEN".</p>
- *
- * @param i The index of the attribute in the list (starting at 0).
- * @return The attribute type as a string, or
- * null if the index is out of range.
- * @see #getLength
- * @see #getType(java.lang.String)
- */
- public abstract String getType (int i);
-
-
- /**
- * Return the value of an attribute in the list (by position).
- *
- * <p>If the attribute value is a list of tokens (IDREFS,
- * ENTITIES, or NMTOKENS), the tokens will be concatenated
- * into a single string separated by whitespace.</p>
- *
- * @param i The index of the attribute in the list (starting at 0).
- * @return The attribute value as a string, or
- * null if the index is out of range.
- * @see #getLength
- * @see #getValue(java.lang.String)
- */
- public abstract String getValue (int i);
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Lookup methods.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Return the type of an attribute in the list (by name).
- *
- * <p>The return value is the same as the return value for
- * getType(int).</p>
- *
- * <p>If the attribute name has a namespace prefix in the document,
- * the application must include the prefix here.</p>
- *
- * @param name The name of the attribute.
- * @return The attribute type as a string, or null if no
- * such attribute exists.
- * @see #getType(int)
- */
- public abstract String getType (String name);
-
-
- /**
- * Return the value of an attribute in the list (by name).
- *
- * <p>The return value is the same as the return value for
- * getValue(int).</p>
- *
- * <p>If the attribute name has a namespace prefix in the document,
- * the application must include the prefix here.</p>
- *
- * @param name the name of the attribute to return
- * @return The attribute value as a string, or null if
- * no such attribute exists.
- * @see #getValue(int)
- */
- public abstract String getValue (String name);
-
-}
-
-// end of AttributeList.java
diff --git a/src/org/xml/sax/Attributes.java b/src/org/xml/sax/Attributes.java
deleted file mode 100644
index 0202aa4..0000000
--- a/src/org/xml/sax/Attributes.java
+++ /dev/null
@@ -1,281 +0,0 @@
-/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-// Attributes.java - attribute list with Namespace support
-// http://www.saxproject.org
-// Written by David Megginson
-// NO WARRANTY! This class is in the public domain.
-// $Id: Attributes.java,v 1.2 2004/11/03 22:44:51 jsuttor Exp $
-
-package org.xml.sax;
-
-
-/**
- * Interface for a list of XML attributes.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>This interface allows access to a list of attributes in
- * three different ways:</p>
- *
- * <ol>
- * <li>by attribute index;</li>
- * <li>by Namespace-qualified name; or</li>
- * <li>by qualified (prefixed) name.</li>
- * </ol>
- *
- * <p>The list will not contain attributes that were declared
- * #IMPLIED but not specified in the start tag. It will also not
- * contain attributes used as Namespace declarations (xmlns*) unless
- * the <code>http://xml.org/sax/features/namespace-prefixes</code>
- * feature is set to <var>true</var> (it is <var>false</var> by
- * default).
- * Because SAX2 conforms to the original "Namespaces in XML"
- * recommendation, it normally does not
- * give namespace declaration attributes a namespace URI.
- * </p>
- *
- * <p>Some SAX2 parsers may support using an optional feature flag
- * (<code>http://xml.org/sax/features/xmlns-uris</code>) to request
- * that those attributes be given URIs, conforming to a later
- * backwards-incompatible revision of that recommendation. (The
- * attribute's "local name" will be the prefix, or "xmlns" when
- * defining a default element namespace.) For portability, handler
- * code should always resolve that conflict, rather than requiring
- * parsers that can change the setting of that feature flag. </p>
- *
- * <p>If the namespace-prefixes feature (see above) is
- * <var>false</var>, access by qualified name may not be available; if
- * the <code>http://xml.org/sax/features/namespaces</code> feature is
- * <var>false</var>, access by Namespace-qualified names may not be
- * available.</p>
- *
- * <p>This interface replaces the now-deprecated SAX1 {@link
- * org.xml.sax.AttributeList AttributeList} interface, which does not
- * contain Namespace support. In addition to Namespace support, it
- * adds the <var>getIndex</var> methods (below).</p>
- *
- * <p>The order of attributes in the list is unspecified, and will
- * vary from implementation to implementation.</p>
- *
- * @since SAX 2.0
- * @author David Megginson
- * @see org.xml.sax.helpers.AttributesImpl
- * @see org.xml.sax.ext.DeclHandler#attributeDecl
- */
-public interface Attributes
-{
-
-
- ////////////////////////////////////////////////////////////////////
- // Indexed access.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Return the number of attributes in the list.
- *
- * <p>Once you know the number of attributes, you can iterate
- * through the list.</p>
- *
- * @return The number of attributes in the list.
- * @see #getURI(int)
- * @see #getLocalName(int)
- * @see #getQName(int)
- * @see #getType(int)
- * @see #getValue(int)
- */
- public abstract int getLength ();
-
-
- /**
- * Look up an attribute's Namespace URI by index.
- *
- * @param index The attribute index (zero-based).
- * @return The Namespace URI, or the empty string if none
- * is available, or null if the index is out of
- * range.
- * @see #getLength
- */
- public abstract String getURI (int index);
-
-
- /**
- * Look up an attribute's local name by index.
- *
- * @param index The attribute index (zero-based).
- * @return The local name, or the empty string if Namespace
- * processing is not being performed, or null
- * if the index is out of range.
- * @see #getLength
- */
- public abstract String getLocalName (int index);
-
-
- /**
- * Look up an attribute's XML qualified (prefixed) name by index.
- *
- * @param index The attribute index (zero-based).
- * @return The XML qualified name, or the empty string
- * if none is available, or null if the index
- * is out of range.
- * @see #getLength
- */
- public abstract String getQName (int index);
-
-
- /**
- * Look up an attribute's type by index.
- *
- * <p>The attribute type is one of the strings "CDATA", "ID",
- * "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY", "ENTITIES",
- * or "NOTATION" (always in upper case).</p>
- *
- * <p>If the parser has not read a declaration for the attribute,
- * or if the parser does not report attribute types, then it must
- * return the value "CDATA" as stated in the XML 1.0 Recommendation
- * (clause 3.3.3, "Attribute-Value Normalization").</p>
- *
- * <p>For an enumerated attribute that is not a notation, the
- * parser will report the type as "NMTOKEN".</p>
- *
- * @param index The attribute index (zero-based).
- * @return The attribute's type as a string, or null if the
- * index is out of range.
- * @see #getLength
- */
- public abstract String getType (int index);
-
-
- /**
- * Look up an attribute's value by index.
- *
- * <p>If the attribute value is a list of tokens (IDREFS,
- * ENTITIES, or NMTOKENS), the tokens will be concatenated
- * into a single string with each token separated by a
- * single space.</p>
- *
- * @param index The attribute index (zero-based).
- * @return The attribute's value as a string, or null if the
- * index is out of range.
- * @see #getLength
- */
- public abstract String getValue (int index);
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Name-based query.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Look up the index of an attribute by Namespace name.
- *
- * @param uri The Namespace URI, or the empty string if
- * the name has no Namespace URI.
- * @param localName The attribute's local name.
- * @return The index of the attribute, or -1 if it does not
- * appear in the list.
- */
- public int getIndex (String uri, String localName);
-
-
- /**
- * Look up the index of an attribute by XML qualified (prefixed) name.
- *
- * @param qName The qualified (prefixed) name.
- * @return The index of the attribute, or -1 if it does not
- * appear in the list.
- */
- public int getIndex (String qName);
-
-
- /**
- * Look up an attribute's type by Namespace name.
- *
- * <p>See {@link #getType(int) getType(int)} for a description
- * of the possible types.</p>
- *
- * @param uri The Namespace URI, or the empty String if the
- * name has no Namespace URI.
- * @param localName The local name of the attribute.
- * @return The attribute type as a string, or null if the
- * attribute is not in the list or if Namespace
- * processing is not being performed.
- */
- public abstract String getType (String uri, String localName);
-
-
- /**
- * Look up an attribute's type by XML qualified (prefixed) name.
- *
- * <p>See {@link #getType(int) getType(int)} for a description
- * of the possible types.</p>
- *
- * @param qName The XML qualified name.
- * @return The attribute type as a string, or null if the
- * attribute is not in the list or if qualified names
- * are not available.
- */
- public abstract String getType (String qName);
-
-
- /**
- * Look up an attribute's value by Namespace name.
- *
- * <p>See {@link #getValue(int) getValue(int)} for a description
- * of the possible values.</p>
- *
- * @param uri The Namespace URI, or the empty String if the
- * name has no Namespace URI.
- * @param localName The local name of the attribute.
- * @return The attribute value as a string, or null if the
- * attribute is not in the list.
- */
- public abstract String getValue (String uri, String localName);
-
-
- /**
- * Look up an attribute's value by XML qualified (prefixed) name.
- *
- * <p>See {@link #getValue(int) getValue(int)} for a description
- * of the possible values.</p>
- *
- * @param qName The XML qualified name.
- * @return The attribute value as a string, or null if the
- * attribute is not in the list or if qualified names
- * are not available.
- */
- public abstract String getValue (String qName);
-
-}
-
-// end of Attributes.java
diff --git a/src/org/xml/sax/COPYING b/src/org/xml/sax/COPYING
deleted file mode 100644
index dd0b981..0000000
--- a/src/org/xml/sax/COPYING
+++ /dev/null
@@ -1,12 +0,0 @@
-SAX IS FREE
------------
-
-I hereby abandon any property rights to SAX 2.0 (the Simple API for
-XML), and release all of the SAX 2.0 source code, compiled code, and
-documentation contained in this distribution into the Public Domain.
-SAX comes with NO WARRANTY or guarantee of fitness for any purpose.
-
-
-David Megginson
-david@megginson.com
-2000-01-14
diff --git a/src/org/xml/sax/COPYING.txt b/src/org/xml/sax/COPYING.txt
deleted file mode 100644
index 27518b4..0000000
--- a/src/org/xml/sax/COPYING.txt
+++ /dev/null
@@ -1,39 +0,0 @@
- SAX COPYRIGHT STATUS
-
-Version 1.0 of the Simple API for XML (SAX), created collectively by
-the membership of the XML-DEV mailing list, is hereby released into
-the public domain.
-
-No one owns SAX: you may use it freely in both commercial and
-non-commercial applications, bundle it with your software
-distribution, include it on a CD-ROM, list the source code in a book,
-mirror the documentation at your own web site, or use it in any other
-way you see fit.
-
-
- NO WARRANTY
-
-Because SAX is released to the public domain, there is no warranty for
-the design or for the software implementation, to the extent permitted
-by applicable law. Except when otherwise stated in writing the
-copyright holders and/or other parties provide SAX "as is" without
-warranty of any kind, either expressed or implied, including, but not
-limited to, the implied warranties of merchantability and fitness for
-a particular purpose. The entire risk as to the quality and
-performance of SAX is with you. Should SAX prove defective, you
-assume the cost of all necessary servicing, repair or correction.
-
-In no event unless required by applicable law or agreed to in writing
-will any copyright holder, or any other party who may modify and/or
-redistribute SAX, be liable to you for damages, including any general,
-special, incidental or consequential damages arising out of the use or
-inability to use SAX (including but not limited to loss of data or
-data being rendered inaccurate or losses sustained by you or third
-parties or a failure of the SAX to operate with any other programs),
-even if such holder or other party has been advised of the possibility
-of such damages.
-
-
-David Megginson <sax@megginson.com>
-1998-05-11
-
diff --git a/src/org/xml/sax/ContentHandler.java b/src/org/xml/sax/ContentHandler.java
deleted file mode 100644
index 99d8f5a..0000000
--- a/src/org/xml/sax/ContentHandler.java
+++ /dev/null
@@ -1,443 +0,0 @@
-/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-// ContentHandler.java - handle main document content.
-// http://www.saxproject.org
-// Written by David Megginson
-// NO WARRANTY! This class is in the public domain.
-// $Id: ContentHandler.java,v 1.2 2004/11/03 22:44:51 jsuttor Exp $
-
-package org.xml.sax;
-
-
-/**
- * Receive notification of the logical content of a document.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>This is the main interface that most SAX applications
- * implement: if the application needs to be informed of basic parsing
- * events, it implements this interface and registers an instance with
- * the SAX parser using the {@link org.xml.sax.XMLReader#setContentHandler
- * setContentHandler} method. The parser uses the instance to report
- * basic document-related events like the start and end of elements
- * and character data.</p>
- *
- * <p>The order of events in this interface is very important, and
- * mirrors the order of information in the document itself. For
- * example, all of an element's content (character data, processing
- * instructions, and/or subelements) will appear, in order, between
- * the startElement event and the corresponding endElement event.</p>
- *
- * <p>This interface is similar to the now-deprecated SAX 1.0
- * DocumentHandler interface, but it adds support for Namespaces
- * and for reporting skipped entities (in non-validating XML
- * processors).</p>
- *
- * <p>Implementors should note that there is also a
- * <code>ContentHandler</code> class in the <code>java.net</code>
- * package; that means that it's probably a bad idea to do</p>
- *
- * <pre>import java.net.*;
- * import org.xml.sax.*;
- * </pre>
- *
- * <p>In fact, "import ...*" is usually a sign of sloppy programming
- * anyway, so the user should consider this a feature rather than a
- * bug.</p>
- *
- * @since SAX 2.0
- * @author David Megginson
- * @see org.xml.sax.XMLReader
- * @see org.xml.sax.DTDHandler
- * @see org.xml.sax.ErrorHandler
- */
-public interface ContentHandler
-{
-
- /**
- * Receive an object for locating the origin of SAX document events.
- *
- * <p>SAX parsers are strongly encouraged (though not absolutely
- * required) to supply a locator: if it does so, it must supply
- * the locator to the application by invoking this method before
- * invoking any of the other methods in the ContentHandler
- * interface.</p>
- *
- * <p>The locator allows the application to determine the end
- * position of any document-related event, even if the parser is
- * not reporting an error. Typically, the application will
- * use this information for reporting its own errors (such as
- * character content that does not match an application's
- * business rules). The information returned by the locator
- * is probably not sufficient for use with a search engine.</p>
- *
- * <p>Note that the locator will return correct information only
- * during the invocation SAX event callbacks after
- * {@link #startDocument startDocument} returns and before
- * {@link #endDocument endDocument} is called. The
- * application should not attempt to use it at any other time.</p>
- *
- * @param locator an object that can return the location of
- * any SAX document event
- * @see org.xml.sax.Locator
- */
- public void setDocumentLocator (Locator locator);
-
-
- /**
- * Receive notification of the beginning of a document.
- *
- * <p>The SAX parser will invoke this method only once, before any
- * other event callbacks (except for {@link #setDocumentLocator
- * setDocumentLocator}).</p>
- *
- * @throws org.xml.sax.SAXException any SAX exception, possibly
- * wrapping another exception
- * @see #endDocument
- */
- public void startDocument ()
- throws SAXException;
-
-
- /**
- * Receive notification of the end of a document.
- *
- * <p><strong>There is an apparent contradiction between the
- * documentation for this method and the documentation for {@link
- * org.xml.sax.ErrorHandler#fatalError}. Until this ambiguity is
- * resolved in a future major release, clients should make no
- * assumptions about whether endDocument() will or will not be
- * invoked when the parser has reported a fatalError() or thrown
- * an exception.</strong></p>
- *
- * <p>The SAX parser will invoke this method only once, and it will
- * be the last method invoked during the parse. The parser shall
- * not invoke this method until it has either abandoned parsing
- * (because of an unrecoverable error) or reached the end of
- * input.</p>
- *
- * @throws org.xml.sax.SAXException any SAX exception, possibly
- * wrapping another exception
- * @see #startDocument
- */
- public void endDocument()
- throws SAXException;
-
-
- /**
- * Begin the scope of a prefix-URI Namespace mapping.
- *
- * <p>The information from this event is not necessary for
- * normal Namespace processing: the SAX XML reader will
- * automatically replace prefixes for element and attribute
- * names when the <code>http://xml.org/sax/features/namespaces</code>
- * feature is <var>true</var> (the default).</p>
- *
- * <p>There are cases, however, when applications need to
- * use prefixes in character data or in attribute values,
- * where they cannot safely be expanded automatically; the
- * start/endPrefixMapping event supplies the information
- * to the application to expand prefixes in those contexts
- * itself, if necessary.</p>
- *
- * <p>Note that start/endPrefixMapping events are not
- * guaranteed to be properly nested relative to each other:
- * all startPrefixMapping events will occur immediately before the
- * corresponding {@link #startElement startElement} event,
- * and all {@link #endPrefixMapping endPrefixMapping}
- * events will occur immediately after the corresponding
- * {@link #endElement endElement} event,
- * but their order is not otherwise
- * guaranteed.</p>
- *
- * <p>There should never be start/endPrefixMapping events for the
- * "xml" prefix, since it is predeclared and immutable.</p>
- *
- * @param prefix the Namespace prefix being declared.
- * An empty string is used for the default element namespace,
- * which has no prefix.
- * @param uri the Namespace URI the prefix is mapped to
- * @throws org.xml.sax.SAXException the client may throw
- * an exception during processing
- * @see #endPrefixMapping
- * @see #startElement
- */
- public void startPrefixMapping (String prefix, String uri)
- throws SAXException;
-
-
- /**
- * End the scope of a prefix-URI mapping.
- *
- * <p>See {@link #startPrefixMapping startPrefixMapping} for
- * details. These events will always occur immediately after the
- * corresponding {@link #endElement endElement} event, but the order of
- * {@link #endPrefixMapping endPrefixMapping} events is not otherwise
- * guaranteed.</p>
- *
- * @param prefix the prefix that was being mapped.
- * This is the empty string when a default mapping scope ends.
- * @throws org.xml.sax.SAXException the client may throw
- * an exception during processing
- * @see #startPrefixMapping
- * @see #endElement
- */
- public void endPrefixMapping (String prefix)
- throws SAXException;
-
-
- /**
- * Receive notification of the beginning of an element.
- *
- * <p>The Parser will invoke this method at the beginning of every
- * element in the XML document; there will be a corresponding
- * {@link #endElement endElement} event for every startElement event
- * (even when the element is empty). All of the element's content will be
- * reported, in order, before the corresponding endElement
- * event.</p>
- *
- * <p>This event allows up to three name components for each
- * element:</p>
- *
- * <ol>
- * <li>the Namespace URI;</li>
- * <li>the local name; and</li>
- * <li>the qualified (prefixed) name.</li>
- * </ol>
- *
- * <p>Any or all of these may be provided, depending on the
- * values of the <var>http://xml.org/sax/features/namespaces</var>
- * and the <var>http://xml.org/sax/features/namespace-prefixes</var>
- * properties:</p>
- *
- * <ul>
- * <li>the Namespace URI and local name are required when
- * the namespaces property is <var>true</var> (the default), and are
- * optional when the namespaces property is <var>false</var> (if one is
- * specified, both must be);</li>
- * <li>the qualified name is required when the namespace-prefixes property
- * is <var>true</var>, and is optional when the namespace-prefixes property
- * is <var>false</var> (the default).</li>
- * </ul>
- *
- * <p>Note that the attribute list provided will contain only
- * attributes with explicit values (specified or defaulted):
- * #IMPLIED attributes will be omitted. The attribute list
- * will contain attributes used for Namespace declarations
- * (xmlns* attributes) only if the
- * <code>http://xml.org/sax/features/namespace-prefixes</code>
- * property is true (it is false by default, and support for a
- * true value is optional).</p>
- *
- * <p>Like {@link #characters characters()}, attribute values may have
- * characters that need more than one <code>char</code> value. </p>
- *
- * @param uri the Namespace URI, or the empty string if the
- * element has no Namespace URI or if Namespace
- * processing is not being performed
- * @param localName the local name (without prefix), or the
- * empty string if Namespace processing is not being
- * performed
- * @param qName the qualified name (with prefix), or the
- * empty string if qualified names are not available
- * @param atts the attributes attached to the element. If
- * there are no attributes, it shall be an empty
- * Attributes object. The value of this object after
- * startElement returns is undefined
- * @throws org.xml.sax.SAXException any SAX exception, possibly
- * wrapping another exception
- * @see #endElement
- * @see org.xml.sax.Attributes
- * @see org.xml.sax.helpers.AttributesImpl
- */
- public void startElement (String uri, String localName,
- String qName, Attributes atts)
- throws SAXException;
-
-
- /**
- * Receive notification of the end of an element.
- *
- * <p>The SAX parser will invoke this method at the end of every
- * element in the XML document; there will be a corresponding
- * {@link #startElement startElement} event for every endElement
- * event (even when the element is empty).</p>
- *
- * <p>For information on the names, see startElement.</p>
- *
- * @param uri the Namespace URI, or the empty string if the
- * element has no Namespace URI or if Namespace
- * processing is not being performed
- * @param localName the local name (without prefix), or the
- * empty string if Namespace processing is not being
- * performed
- * @param qName the qualified XML name (with prefix), or the
- * empty string if qualified names are not available
- * @throws org.xml.sax.SAXException any SAX exception, possibly
- * wrapping another exception
- */
- public void endElement (String uri, String localName,
- String qName)
- throws SAXException;
-
-
- /**
- * Receive notification of character data.
- *
- * <p>The Parser will call this method to report each chunk of
- * character data. SAX parsers may return all contiguous character
- * data in a single chunk, or they may split it into several
- * chunks; however, all of the characters in any single event
- * must come from the same external entity so that the Locator
- * provides useful information.</p>
- *
- * <p>The application must not attempt to read from the array
- * outside of the specified range.</p>
- *
- * <p>Individual characters may consist of more than one Java
- * <code>char</code> value. There are two important cases where this
- * happens, because characters can't be represented in just sixteen bits.
- * In one case, characters are represented in a <em>Surrogate Pair</em>,
- * using two special Unicode values. Such characters are in the so-called
- * "Astral Planes", with a code point above U+FFFF. A second case involves
- * composite characters, such as a base character combining with one or
- * more accent characters. </p>
- *
- * <p> Your code should not assume that algorithms using
- * <code>char</code>-at-a-time idioms will be working in character
- * units; in some cases they will split characters. This is relevant
- * wherever XML permits arbitrary characters, such as attribute values,
- * processing instruction data, and comments as well as in data reported
- * from this method. It's also generally relevant whenever Java code
- * manipulates internationalized text; the issue isn't unique to XML.</p>
- *
- * <p>Note that some parsers will report whitespace in element
- * content using the {@link #ignorableWhitespace ignorableWhitespace}
- * method rather than this one (validating parsers <em>must</em>
- * do so).</p>
- *
- * @param ch the characters from the XML document
- * @param start the start position in the array
- * @param length the number of characters to read from the array
- * @throws org.xml.sax.SAXException any SAX exception, possibly
- * wrapping another exception
- * @see #ignorableWhitespace
- * @see org.xml.sax.Locator
- */
- public void characters (char ch[], int start, int length)
- throws SAXException;
-
-
- /**
- * Receive notification of ignorable whitespace in element content.
- *
- * <p>Validating Parsers must use this method to report each chunk
- * of whitespace in element content (see the W3C XML 1.0
- * recommendation, section 2.10): non-validating parsers may also
- * use this method if they are capable of parsing and using
- * content models.</p>
- *
- * <p>SAX parsers may return all contiguous whitespace in a single
- * chunk, or they may split it into several chunks; however, all of
- * the characters in any single event must come from the same
- * external entity, so that the Locator provides useful
- * information.</p>
- *
- * <p>The application must not attempt to read from the array
- * outside of the specified range.</p>
- *
- * @param ch the characters from the XML document
- * @param start the start position in the array
- * @param length the number of characters to read from the array
- * @throws org.xml.sax.SAXException any SAX exception, possibly
- * wrapping another exception
- * @see #characters
- */
- public void ignorableWhitespace (char ch[], int start, int length)
- throws SAXException;
-
-
- /**
- * Receive notification of a processing instruction.
- *
- * <p>The Parser will invoke this method once for each processing
- * instruction found: note that processing instructions may occur
- * before or after the main document element.</p>
- *
- * <p>A SAX parser must never report an XML declaration (XML 1.0,
- * section 2.8) or a text declaration (XML 1.0, section 4.3.1)
- * using this method.</p>
- *
- * <p>Like {@link #characters characters()}, processing instruction
- * data may have characters that need more than one <code>char</code>
- * value. </p>
- *
- * @param target the processing instruction target
- * @param data the processing instruction data, or null if
- * none was supplied. The data does not include any
- * whitespace separating it from the target
- * @throws org.xml.sax.SAXException any SAX exception, possibly
- * wrapping another exception
- */
- public void processingInstruction (String target, String data)
- throws SAXException;
-
-
- /**
- * Receive notification of a skipped entity.
- * This is not called for entity references within markup constructs
- * such as element start tags or markup declarations. (The XML
- * recommendation requires reporting skipped external entities.
- * SAX also reports internal entity expansion/non-expansion, except
- * within markup constructs.)
- *
- * <p>The Parser will invoke this method each time the entity is
- * skipped. Non-validating processors may skip entities if they
- * have not seen the declarations (because, for example, the
- * entity was declared in an external DTD subset). All processors
- * may skip external entities, depending on the values of the
- * <code>http://xml.org/sax/features/external-general-entities</code>
- * and the
- * <code>http://xml.org/sax/features/external-parameter-entities</code>
- * properties.</p>
- *
- * @param name the name of the skipped entity. If it is a
- * parameter entity, the name will begin with '%', and if
- * it is the external DTD subset, it will be the string
- * "[dtd]"
- * @throws org.xml.sax.SAXException any SAX exception, possibly
- * wrapping another exception
- */
- public void skippedEntity (String name)
- throws SAXException;
-}
-
-// end of ContentHandler.java
diff --git a/src/org/xml/sax/DTDHandler.java b/src/org/xml/sax/DTDHandler.java
deleted file mode 100644
index 6d43ecd..0000000
--- a/src/org/xml/sax/DTDHandler.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-// SAX DTD handler.
-// http://www.saxproject.org
-// No warranty; no copyright -- use this as you will.
-// $Id: DTDHandler.java,v 1.2 2004/11/03 22:44:51 jsuttor Exp $
-
-package org.xml.sax;
-
-/**
- * Receive notification of basic DTD-related events.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>If a SAX application needs information about notations and
- * unparsed entities, then the application implements this
- * interface and registers an instance with the SAX parser using
- * the parser's setDTDHandler method. The parser uses the
- * instance to report notation and unparsed entity declarations to
- * the application.</p>
- *
- * <p>Note that this interface includes only those DTD events that
- * the XML recommendation <em>requires</em> processors to report:
- * notation and unparsed entity declarations.</p>
- *
- * <p>The SAX parser may report these events in any order, regardless
- * of the order in which the notations and unparsed entities were
- * declared; however, all DTD events must be reported after the
- * document handler's startDocument event, and before the first
- * startElement event.
- * (If the {@link org.xml.sax.ext.LexicalHandler LexicalHandler} is
- * used, these events must also be reported before the endDTD event.)
- * </p>
- *
- * <p>It is up to the application to store the information for
- * future use (perhaps in a hash table or object tree).
- * If the application encounters attributes of type "NOTATION",
- * "ENTITY", or "ENTITIES", it can use the information that it
- * obtained through this interface to find the entity and/or
- * notation corresponding with the attribute value.</p>
- *
- * @since SAX 1.0
- * @author David Megginson
- * @see org.xml.sax.XMLReader#setDTDHandler
- */
-public interface DTDHandler {
-
-
- /**
- * Receive notification of a notation declaration event.
- *
- * <p>It is up to the application to record the notation for later
- * reference, if necessary;
- * notations may appear as attribute values and in unparsed entity
- * declarations, and are sometime used with processing instruction
- * target names.</p>
- *
- * <p>At least one of publicId and systemId must be non-null.
- * If a system identifier is present, and it is a URL, the SAX
- * parser must resolve it fully before passing it to the
- * application through this event.</p>
- *
- * <p>There is no guarantee that the notation declaration will be
- * reported before any unparsed entities that use it.</p>
- *
- * @param name The notation name.
- * @param publicId The notation's public identifier, or null if
- * none was given.
- * @param systemId The notation's system identifier, or null if
- * none was given.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see #unparsedEntityDecl
- * @see org.xml.sax.Attributes
- */
- public abstract void notationDecl (String name,
- String publicId,
- String systemId)
- throws SAXException;
-
-
- /**
- * Receive notification of an unparsed entity declaration event.
- *
- * <p>Note that the notation name corresponds to a notation
- * reported by the {@link #notationDecl notationDecl} event.
- * It is up to the application to record the entity for later
- * reference, if necessary;
- * unparsed entities may appear as attribute values.
- * </p>
- *
- * <p>If the system identifier is a URL, the parser must resolve it
- * fully before passing it to the application.</p>
- *
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @param name The unparsed entity's name.
- * @param publicId The entity's public identifier, or null if none
- * was given.
- * @param systemId The entity's system identifier.
- * @param notationName The name of the associated notation.
- * @see #notationDecl
- * @see org.xml.sax.Attributes
- */
- public abstract void unparsedEntityDecl (String name,
- String publicId,
- String systemId,
- String notationName)
- throws SAXException;
-
-}
-
-// end of DTDHandler.java
diff --git a/src/org/xml/sax/DocumentHandler.java b/src/org/xml/sax/DocumentHandler.java
deleted file mode 100644
index ffe4d2a..0000000
--- a/src/org/xml/sax/DocumentHandler.java
+++ /dev/null
@@ -1,256 +0,0 @@
-/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-// SAX document handler.
-// http://www.saxproject.org
-// No warranty; no copyright -- use this as you will.
-// $Id: DocumentHandler.java,v 1.2 2004/11/03 22:44:51 jsuttor Exp $
-
-package org.xml.sax;
-
-/**
- * Receive notification of general document events.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>This was the main event-handling interface for SAX1; in
- * SAX2, it has been replaced by {@link org.xml.sax.ContentHandler
- * ContentHandler}, which provides Namespace support and reporting
- * of skipped entities. This interface is included in SAX2 only
- * to support legacy SAX1 applications.</p>
- *
- * <p>The order of events in this interface is very important, and
- * mirrors the order of information in the document itself. For
- * example, all of an element's content (character data, processing
- * instructions, and/or subelements) will appear, in order, between
- * the startElement event and the corresponding endElement event.</p>
- *
- * <p>Application writers who do not want to implement the entire
- * interface can derive a class from HandlerBase, which implements
- * the default functionality; parser writers can instantiate
- * HandlerBase to obtain a default handler. The application can find
- * the location of any document event using the Locator interface
- * supplied by the Parser through the setDocumentLocator method.</p>
- *
- * @deprecated This interface has been replaced by the SAX2
- * {@link org.xml.sax.ContentHandler ContentHandler}
- * interface, which includes Namespace support.
- * @since SAX 1.0
- * @author David Megginson
- * @see org.xml.sax.Parser#setDocumentHandler
- * @see org.xml.sax.Locator
- * @see org.xml.sax.HandlerBase
- */
-public interface DocumentHandler {
-
-
- /**
- * Receive an object for locating the origin of SAX document events.
- *
- * <p>SAX parsers are strongly encouraged (though not absolutely
- * required) to supply a locator: if it does so, it must supply
- * the locator to the application by invoking this method before
- * invoking any of the other methods in the DocumentHandler
- * interface.</p>
- *
- * <p>The locator allows the application to determine the end
- * position of any document-related event, even if the parser is
- * not reporting an error. Typically, the application will
- * use this information for reporting its own errors (such as
- * character content that does not match an application's
- * business rules). The information returned by the locator
- * is probably not sufficient for use with a search engine.</p>
- *
- * <p>Note that the locator will return correct information only
- * during the invocation of the events in this interface. The
- * application should not attempt to use it at any other time.</p>
- *
- * @param locator An object that can return the location of
- * any SAX document event.
- * @see org.xml.sax.Locator
- */
- public abstract void setDocumentLocator (Locator locator);
-
-
- /**
- * Receive notification of the beginning of a document.
- *
- * <p>The SAX parser will invoke this method only once, before any
- * other methods in this interface or in DTDHandler (except for
- * setDocumentLocator).</p>
- *
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- */
- public abstract void startDocument ()
- throws SAXException;
-
-
- /**
- * Receive notification of the end of a document.
- *
- * <p>The SAX parser will invoke this method only once, and it will
- * be the last method invoked during the parse. The parser shall
- * not invoke this method until it has either abandoned parsing
- * (because of an unrecoverable error) or reached the end of
- * input.</p>
- *
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- */
- public abstract void endDocument ()
- throws SAXException;
-
-
- /**
- * Receive notification of the beginning of an element.
- *
- * <p>The Parser will invoke this method at the beginning of every
- * element in the XML document; there will be a corresponding
- * endElement() event for every startElement() event (even when the
- * element is empty). All of the element's content will be
- * reported, in order, before the corresponding endElement()
- * event.</p>
- *
- * <p>If the element name has a namespace prefix, the prefix will
- * still be attached. Note that the attribute list provided will
- * contain only attributes with explicit values (specified or
- * defaulted): #IMPLIED attributes will be omitted.</p>
- *
- * @param name The element type name.
- * @param atts The attributes attached to the element, if any.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see #endElement
- * @see org.xml.sax.AttributeList
- */
- public abstract void startElement (String name, AttributeList atts)
- throws SAXException;
-
-
- /**
- * Receive notification of the end of an element.
- *
- * <p>The SAX parser will invoke this method at the end of every
- * element in the XML document; there will be a corresponding
- * startElement() event for every endElement() event (even when the
- * element is empty).</p>
- *
- * <p>If the element name has a namespace prefix, the prefix will
- * still be attached to the name.</p>
- *
- * @param name The element type name
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- */
- public abstract void endElement (String name)
- throws SAXException;
-
-
- /**
- * Receive notification of character data.
- *
- * <p>The Parser will call this method to report each chunk of
- * character data. SAX parsers may return all contiguous character
- * data in a single chunk, or they may split it into several
- * chunks; however, all of the characters in any single event
- * must come from the same external entity, so that the Locator
- * provides useful information.</p>
- *
- * <p>The application must not attempt to read from the array
- * outside of the specified range.</p>
- *
- * <p>Note that some parsers will report whitespace using the
- * ignorableWhitespace() method rather than this one (validating
- * parsers must do so).</p>
- *
- * @param ch The characters from the XML document.
- * @param start The start position in the array.
- * @param length The number of characters to read from the array.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see #ignorableWhitespace
- * @see org.xml.sax.Locator
- */
- public abstract void characters (char ch[], int start, int length)
- throws SAXException;
-
-
- /**
- * Receive notification of ignorable whitespace in element content.
- *
- * <p>Validating Parsers must use this method to report each chunk
- * of ignorable whitespace (see the W3C XML 1.0 recommendation,
- * section 2.10): non-validating parsers may also use this method
- * if they are capable of parsing and using content models.</p>
- *
- * <p>SAX parsers may return all contiguous whitespace in a single
- * chunk, or they may split it into several chunks; however, all of
- * the characters in any single event must come from the same
- * external entity, so that the Locator provides useful
- * information.</p>
- *
- * <p>The application must not attempt to read from the array
- * outside of the specified range.</p>
- *
- * @param ch The characters from the XML document.
- * @param start The start position in the array.
- * @param length The number of characters to read from the array.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see #characters
- */
- public abstract void ignorableWhitespace (char ch[], int start, int length)
- throws SAXException;
-
-
- /**
- * Receive notification of a processing instruction.
- *
- * <p>The Parser will invoke this method once for each processing
- * instruction found: note that processing instructions may occur
- * before or after the main document element.</p>
- *
- * <p>A SAX parser should never report an XML declaration (XML 1.0,
- * section 2.8) or a text declaration (XML 1.0, section 4.3.1)
- * using this method.</p>
- *
- * @param target The processing instruction target.
- * @param data The processing instruction data, or null if
- * none was supplied.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- */
- public abstract void processingInstruction (String target, String data)
- throws SAXException;
-
-}
-
-// end of DocumentHandler.java
diff --git a/src/org/xml/sax/EntityResolver.java b/src/org/xml/sax/EntityResolver.java
deleted file mode 100644
index 6f8c501..0000000
--- a/src/org/xml/sax/EntityResolver.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-// SAX entity resolver.
-// http://www.saxproject.org
-// No warranty; no copyright -- use this as you will.
-// $Id: EntityResolver.java,v 1.2 2004/11/03 22:44:52 jsuttor Exp $
-
-package org.xml.sax;
-
-import java.io.IOException;
-
-
-/**
- * Basic interface for resolving entities.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>If a SAX application needs to implement customized handling
- * for external entities, it must implement this interface and
- * register an instance with the SAX driver using the
- * {@link org.xml.sax.XMLReader#setEntityResolver setEntityResolver}
- * method.</p>
- *
- * <p>The XML reader will then allow the application to intercept any
- * external entities (including the external DTD subset and external
- * parameter entities, if any) before including them.</p>
- *
- * <p>Many SAX applications will not need to implement this interface,
- * but it will be especially useful for applications that build
- * XML documents from databases or other specialised input sources,
- * or for applications that use URI types other than URLs.</p>
- *
- * <p>The following resolver would provide the application
- * with a special character stream for the entity with the system
- * identifier "http://www.myhost.com/today":</p>
- *
- * <pre>
- * import org.xml.sax.EntityResolver;
- * import org.xml.sax.InputSource;
- *
- * public class MyResolver implements EntityResolver {
- * public InputSource resolveEntity (String publicId, String systemId)
- * {
- * if (systemId.equals("http://www.myhost.com/today")) {
- * // return a special input source
- * MyReader reader = new MyReader();
- * return new InputSource(reader);
- * } else {
- * // use the default behaviour
- * return null;
- * }
- * }
- * }
- * </pre>
- *
- * <p>The application can also use this interface to redirect system
- * identifiers to local URIs or to look up replacements in a catalog
- * (possibly by using the public identifier).</p>
- *
- * @since SAX 1.0
- * @author David Megginson
- * @see org.xml.sax.XMLReader#setEntityResolver
- * @see org.xml.sax.InputSource
- */
-public interface EntityResolver {
-
-
- /**
- * Allow the application to resolve external entities.
- *
- * <p>The parser will call this method before opening any external
- * entity except the top-level document entity. Such entities include
- * the external DTD subset and external parameter entities referenced
- * within the DTD (in either case, only if the parser reads external
- * parameter entities), and external general entities referenced
- * within the document element (if the parser reads external general
- * entities). The application may request that the parser locate
- * the entity itself, that it use an alternative URI, or that it
- * use data provided by the application (as a character or byte
- * input stream).</p>
- *
- * <p>Application writers can use this method to redirect external
- * system identifiers to secure and/or local URIs, to look up
- * public identifiers in a catalogue, or to read an entity from a
- * database or other input source (including, for example, a dialog
- * box). Neither XML nor SAX specifies a preferred policy for using
- * public or system IDs to resolve resources. However, SAX specifies
- * how to interpret any InputSource returned by this method, and that
- * if none is returned, then the system ID will be dereferenced as
- * a URL. </p>
- *
- * <p>If the system identifier is a URL, the SAX parser must
- * resolve it fully before reporting it to the application.</p>
- *
- * @param publicId The public identifier of the external entity
- * being referenced, or null if none was supplied.
- * @param systemId The system identifier of the external entity
- * being referenced.
- * @return An InputSource object describing the new input source,
- * or null to request that the parser open a regular
- * URI connection to the system identifier.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @exception java.io.IOException A Java-specific IO exception,
- * possibly the result of creating a new InputStream
- * or Reader for the InputSource.
- * @see org.xml.sax.InputSource
- */
- public abstract InputSource resolveEntity (String publicId,
- String systemId)
- throws SAXException, IOException;
-
-}
-
-// end of EntityResolver.java
diff --git a/src/org/xml/sax/ErrorHandler.java b/src/org/xml/sax/ErrorHandler.java
deleted file mode 100644
index 1183382..0000000
--- a/src/org/xml/sax/ErrorHandler.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-// SAX error handler.
-// http://www.saxproject.org
-// No warranty; no copyright -- use this as you will.
-// $Id: ErrorHandler.java,v 1.2 2004/11/03 22:44:52 jsuttor Exp $
-
-package org.xml.sax;
-
-
-/**
- * Basic interface for SAX error handlers.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>If a SAX application needs to implement customized error
- * handling, it must implement this interface and then register an
- * instance with the XML reader using the
- * {@link org.xml.sax.XMLReader#setErrorHandler setErrorHandler}
- * method. The parser will then report all errors and warnings
- * through this interface.</p>
- *
- * <p><strong>WARNING:</strong> If an application does <em>not</em>
- * register an ErrorHandler, XML parsing errors will go unreported,
- * except that <em>SAXParseException</em>s will be thrown for fatal errors.
- * In order to detect validity errors, an ErrorHandler that does something
- * with {@link #error error()} calls must be registered.</p>
- *
- * <p>For XML processing errors, a SAX driver must use this interface
- * in preference to throwing an exception: it is up to the application
- * to decide whether to throw an exception for different types of
- * errors and warnings. Note, however, that there is no requirement that
- * the parser continue to report additional errors after a call to
- * {@link #fatalError fatalError}. In other words, a SAX driver class
- * may throw an exception after reporting any fatalError.
- * Also parsers may throw appropriate exceptions for non-XML errors.
- * For example, {@link XMLReader#parse XMLReader.parse()} would throw
- * an IOException for errors accessing entities or the document.</p>
- *
- * @since SAX 1.0
- * @author David Megginson
- * @see org.xml.sax.XMLReader#setErrorHandler
- * @see org.xml.sax.SAXParseException
- */
-public interface ErrorHandler {
-
-
- /**
- * Receive notification of a warning.
- *
- * <p>SAX parsers will use this method to report conditions that
- * are not errors or fatal errors as defined by the XML
- * recommendation. The default behaviour is to take no
- * action.</p>
- *
- * <p>The SAX parser must continue to provide normal parsing events
- * after invoking this method: it should still be possible for the
- * application to process the document through to the end.</p>
- *
- * <p>Filters may use this method to report other, non-XML warnings
- * as well.</p>
- *
- * @param exception The warning information encapsulated in a
- * SAX parse exception.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.SAXParseException
- */
- public abstract void warning (SAXParseException exception)
- throws SAXException;
-
-
- /**
- * Receive notification of a recoverable error.
- *
- * <p>This corresponds to the definition of "error" in section 1.2
- * of the W3C XML 1.0 Recommendation. For example, a validating
- * parser would use this callback to report the violation of a
- * validity constraint. The default behaviour is to take no
- * action.</p>
- *
- * <p>The SAX parser must continue to provide normal parsing
- * events after invoking this method: it should still be possible
- * for the application to process the document through to the end.
- * If the application cannot do so, then the parser should report
- * a fatal error even if the XML recommendation does not require
- * it to do so.</p>
- *
- * <p>Filters may use this method to report other, non-XML errors
- * as well.</p>
- *
- * @param exception The error information encapsulated in a
- * SAX parse exception.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.SAXParseException
- */
- public abstract void error (SAXParseException exception)
- throws SAXException;
-
-
- /**
- * Receive notification of a non-recoverable error.
- *
- * <p><strong>There is an apparent contradiction between the
- * documentation for this method and the documentation for {@link
- * org.xml.sax.ContentHandler#endDocument}. Until this ambiguity
- * is resolved in a future major release, clients should make no
- * assumptions about whether endDocument() will or will not be
- * invoked when the parser has reported a fatalError() or thrown
- * an exception.</strong></p>
- *
- * <p>This corresponds to the definition of "fatal error" in
- * section 1.2 of the W3C XML 1.0 Recommendation. For example, a
- * parser would use this callback to report the violation of a
- * well-formedness constraint.</p>
- *
- * <p>The application must assume that the document is unusable
- * after the parser has invoked this method, and should continue
- * (if at all) only for the sake of collecting additional error
- * messages: in fact, SAX parsers are free to stop reporting any
- * other events once this method has been invoked.</p>
- *
- * @param exception The error information encapsulated in a
- * SAX parse exception.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.SAXParseException
- */
- public abstract void fatalError (SAXParseException exception)
- throws SAXException;
-
-}
-
-// end of ErrorHandler.java
diff --git a/src/org/xml/sax/HandlerBase.java b/src/org/xml/sax/HandlerBase.java
deleted file mode 100644
index db2e646..0000000
--- a/src/org/xml/sax/HandlerBase.java
+++ /dev/null
@@ -1,393 +0,0 @@
-/*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-// SAX default handler base class.
-// http://www.saxproject.org
-// No warranty; no copyright -- use this as you will.
-// $Id: HandlerBase.java,v 1.2 2005/06/10 03:50:47 jeffsuttor Exp $
-
-package org.xml.sax;
-
-/**
- * Default base class for handlers.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>This class implements the default behaviour for four SAX1
- * interfaces: EntityResolver, DTDHandler, DocumentHandler,
- * and ErrorHandler. It is now obsolete, but is included in SAX2 to
- * support legacy SAX1 applications. SAX2 applications should use
- * the {@link org.xml.sax.helpers.DefaultHandler DefaultHandler}
- * class instead.</p>
- *
- * <p>Application writers can extend this class when they need to
- * implement only part of an interface; parser writers can
- * instantiate this class to provide default handlers when the
- * application has not supplied its own.</p>
- *
- * <p>Note that the use of this class is optional.</p>
- *
- * @deprecated This class works with the deprecated
- * {@link org.xml.sax.DocumentHandler DocumentHandler}
- * interface. It has been replaced by the SAX2
- * {@link org.xml.sax.helpers.DefaultHandler DefaultHandler}
- * class.
- * @since SAX 1.0
- * @author David Megginson
- * @see org.xml.sax.EntityResolver
- * @see org.xml.sax.DTDHandler
- * @see org.xml.sax.DocumentHandler
- * @see org.xml.sax.ErrorHandler
- */
-public class HandlerBase
- implements EntityResolver, DTDHandler, DocumentHandler, ErrorHandler
-{
-
-
- ////////////////////////////////////////////////////////////////////
- // Default implementation of the EntityResolver interface.
- ////////////////////////////////////////////////////////////////////
-
- /**
- * Resolve an external entity.
- *
- * <p>Always return null, so that the parser will use the system
- * identifier provided in the XML document. This method implements
- * the SAX default behaviour: application writers can override it
- * in a subclass to do special translations such as catalog lookups
- * or URI redirection.</p>
- *
- * @param publicId The public identifer, or null if none is
- * available.
- * @param systemId The system identifier provided in the XML
- * document.
- * @return The new input source, or null to require the
- * default behaviour.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.EntityResolver#resolveEntity
- */
- public InputSource resolveEntity (String publicId, String systemId)
- throws SAXException
- {
- return null;
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Default implementation of DTDHandler interface.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Receive notification of a notation declaration.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass if they wish to keep track of the notations
- * declared in a document.</p>
- *
- * @param name The notation name.
- * @param publicId The notation public identifier, or null if not
- * available.
- * @param systemId The notation system identifier.
- * @see org.xml.sax.DTDHandler#notationDecl
- */
- public void notationDecl (String name, String publicId, String systemId)
- {
- // no op
- }
-
-
- /**
- * Receive notification of an unparsed entity declaration.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass to keep track of the unparsed entities
- * declared in a document.</p>
- *
- * @param name The entity name.
- * @param publicId The entity public identifier, or null if not
- * available.
- * @param systemId The entity system identifier.
- * @param notationName The name of the associated notation.
- * @see org.xml.sax.DTDHandler#unparsedEntityDecl
- */
- public void unparsedEntityDecl (String name, String publicId,
- String systemId, String notationName)
- {
- // no op
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Default implementation of DocumentHandler interface.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Receive a Locator object for document events.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass if they wish to store the locator for use
- * with other document events.</p>
- *
- * @param locator A locator for all SAX document events.
- * @see org.xml.sax.DocumentHandler#setDocumentLocator
- * @see org.xml.sax.Locator
- */
- public void setDocumentLocator (Locator locator)
- {
- // no op
- }
-
-
- /**
- * Receive notification of the beginning of the document.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass to take specific actions at the beginning
- * of a document (such as allocating the root node of a tree or
- * creating an output file).</p>
- *
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.DocumentHandler#startDocument
- */
- public void startDocument ()
- throws SAXException
- {
- // no op
- }
-
-
- /**
- * Receive notification of the end of the document.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass to take specific actions at the end
- * of a document (such as finalising a tree or closing an output
- * file).</p>
- *
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.DocumentHandler#endDocument
- */
- public void endDocument ()
- throws SAXException
- {
- // no op
- }
-
-
- /**
- * Receive notification of the start of an element.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass to take specific actions at the start of
- * each element (such as allocating a new tree node or writing
- * output to a file).</p>
- *
- * @param name The element type name.
- * @param attributes The specified or defaulted attributes.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.DocumentHandler#startElement
- */
- public void startElement (String name, AttributeList attributes)
- throws SAXException
- {
- // no op
- }
-
-
- /**
- * Receive notification of the end of an element.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass to take specific actions at the end of
- * each element (such as finalising a tree node or writing
- * output to a file).</p>
- *
- * @param name the element name
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.DocumentHandler#endElement
- */
- public void endElement (String name)
- throws SAXException
- {
- // no op
- }
-
-
- /**
- * Receive notification of character data inside an element.
- *
- * <p>By default, do nothing. Application writers may override this
- * method to take specific actions for each chunk of character data
- * (such as adding the data to a node or buffer, or printing it to
- * a file).</p>
- *
- * @param ch The characters.
- * @param start The start position in the character array.
- * @param length The number of characters to use from the
- * character array.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.DocumentHandler#characters
- */
- public void characters (char ch[], int start, int length)
- throws SAXException
- {
- // no op
- }
-
-
- /**
- * Receive notification of ignorable whitespace in element content.
- *
- * <p>By default, do nothing. Application writers may override this
- * method to take specific actions for each chunk of ignorable
- * whitespace (such as adding data to a node or buffer, or printing
- * it to a file).</p>
- *
- * @param ch The whitespace characters.
- * @param start The start position in the character array.
- * @param length The number of characters to use from the
- * character array.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.DocumentHandler#ignorableWhitespace
- */
- public void ignorableWhitespace (char ch[], int start, int length)
- throws SAXException
- {
- // no op
- }
-
-
- /**
- * Receive notification of a processing instruction.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass to take specific actions for each
- * processing instruction, such as setting status variables or
- * invoking other methods.</p>
- *
- * @param target The processing instruction target.
- * @param data The processing instruction data, or null if
- * none is supplied.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.DocumentHandler#processingInstruction
- */
- public void processingInstruction (String target, String data)
- throws SAXException
- {
- // no op
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Default implementation of the ErrorHandler interface.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Receive notification of a parser warning.
- *
- * <p>The default implementation does nothing. Application writers
- * may override this method in a subclass to take specific actions
- * for each warning, such as inserting the message in a log file or
- * printing it to the console.</p>
- *
- * @param e The warning information encoded as an exception.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ErrorHandler#warning
- * @see org.xml.sax.SAXParseException
- */
- public void warning (SAXParseException e)
- throws SAXException
- {
- // no op
- }
-
-
- /**
- * Receive notification of a recoverable parser error.
- *
- * <p>The default implementation does nothing. Application writers
- * may override this method in a subclass to take specific actions
- * for each error, such as inserting the message in a log file or
- * printing it to the console.</p>
- *
- * @param e The warning information encoded as an exception.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ErrorHandler#warning
- * @see org.xml.sax.SAXParseException
- */
- public void error (SAXParseException e)
- throws SAXException
- {
- // no op
- }
-
-
- /**
- * Report a fatal XML parsing error.
- *
- * <p>The default implementation throws a SAXParseException.
- * Application writers may override this method in a subclass if
- * they need to take specific actions for each fatal error (such as
- * collecting all of the errors into a single report): in any case,
- * the application must stop all regular processing when this
- * method is invoked, since the document is no longer reliable, and
- * the parser may no longer report parsing events.</p>
- *
- * @param e The error information encoded as an exception.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ErrorHandler#fatalError
- * @see org.xml.sax.SAXParseException
- */
- public void fatalError (SAXParseException e)
- throws SAXException
- {
- throw e;
- }
-
-}
-
-// end of HandlerBase.java
diff --git a/src/org/xml/sax/InputSource.java b/src/org/xml/sax/InputSource.java
deleted file mode 100644
index 4f47f9e..0000000
--- a/src/org/xml/sax/InputSource.java
+++ /dev/null
@@ -1,360 +0,0 @@
-/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-// SAX input source.
-// http://www.saxproject.org
-// No warranty; no copyright -- use this as you will.
-// $Id: InputSource.java,v 1.2 2004/11/03 22:55:32 jsuttor Exp $
-
-package org.xml.sax;
-
-import java.io.Reader;
-import java.io.InputStream;
-
-/**
- * A single input source for an XML entity.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>This class allows a SAX application to encapsulate information
- * about an input source in a single object, which may include
- * a public identifier, a system identifier, a byte stream (possibly
- * with a specified encoding), and/or a character stream.</p>
- *
- * <p>There are two places that the application can deliver an
- * input source to the parser: as the argument to the Parser.parse
- * method, or as the return value of the EntityResolver.resolveEntity
- * method.</p>
- *
- * <p>The SAX parser will use the InputSource object to determine how
- * to read XML input. If there is a character stream available, the
- * parser will read that stream directly, disregarding any text
- * encoding declaration found in that stream.
- * If there is no character stream, but there is
- * a byte stream, the parser will use that byte stream, using the
- * encoding specified in the InputSource or else (if no encoding is
- * specified) autodetecting the character encoding using an algorithm
- * such as the one in the XML specification. If neither a character
- * stream nor a
- * byte stream is available, the parser will attempt to open a URI
- * connection to the resource identified by the system
- * identifier.</p>
- *
- * <p>An InputSource object belongs to the application: the SAX parser
- * shall never modify it in any way (it may modify a copy if
- * necessary). However, standard processing of both byte and
- * character streams is to close them on as part of end-of-parse cleanup,
- * so applications should not attempt to re-use such streams after they
- * have been handed to a parser. </p>
- *
- * @since SAX 1.0
- * @author David Megginson
- * @see org.xml.sax.XMLReader#parse(org.xml.sax.InputSource)
- * @see org.xml.sax.EntityResolver#resolveEntity
- * @see java.io.InputStream
- * @see java.io.Reader
- */
-public class InputSource {
-
- /**
- * Zero-argument default constructor.
- *
- * @see #setPublicId
- * @see #setSystemId
- * @see #setByteStream
- * @see #setCharacterStream
- * @see #setEncoding
- */
- public InputSource ()
- {
- }
-
-
- /**
- * Create a new input source with a system identifier.
- *
- * <p>Applications may use setPublicId to include a
- * public identifier as well, or setEncoding to specify
- * the character encoding, if known.</p>
- *
- * <p>If the system identifier is a URL, it must be fully
- * resolved (it may not be a relative URL).</p>
- *
- * @param systemId The system identifier (URI).
- * @see #setPublicId
- * @see #setSystemId
- * @see #setByteStream
- * @see #setEncoding
- * @see #setCharacterStream
- */
- public InputSource (String systemId)
- {
- setSystemId(systemId);
- }
-
-
- /**
- * Create a new input source with a byte stream.
- *
- * <p>Application writers should use setSystemId() to provide a base
- * for resolving relative URIs, may use setPublicId to include a
- * public identifier, and may use setEncoding to specify the object's
- * character encoding.</p>
- *
- * @param byteStream The raw byte stream containing the document.
- * @see #setPublicId
- * @see #setSystemId
- * @see #setEncoding
- * @see #setByteStream
- * @see #setCharacterStream
- */
- public InputSource (InputStream byteStream)
- {
- setByteStream(byteStream);
- }
-
-
- /**
- * Create a new input source with a character stream.
- *
- * <p>Application writers should use setSystemId() to provide a base
- * for resolving relative URIs, and may use setPublicId to include a
- * public identifier.</p>
- *
- * <p>The character stream shall not include a byte order mark.</p>
- *
- * @see #setPublicId
- * @see #setSystemId
- * @see #setByteStream
- * @see #setCharacterStream
- */
- public InputSource (Reader characterStream)
- {
- setCharacterStream(characterStream);
- }
-
-
- /**
- * Set the public identifier for this input source.
- *
- * <p>The public identifier is always optional: if the application
- * writer includes one, it will be provided as part of the
- * location information.</p>
- *
- * @param publicId The public identifier as a string.
- * @see #getPublicId
- * @see org.xml.sax.Locator#getPublicId
- * @see org.xml.sax.SAXParseException#getPublicId
- */
- public void setPublicId (String publicId)
- {
- this.publicId = publicId;
- }
-
-
- /**
- * Get the public identifier for this input source.
- *
- * @return The public identifier, or null if none was supplied.
- * @see #setPublicId
- */
- public String getPublicId ()
- {
- return publicId;
- }
-
-
- /**
- * Set the system identifier for this input source.
- *
- * <p>The system identifier is optional if there is a byte stream
- * or a character stream, but it is still useful to provide one,
- * since the application can use it to resolve relative URIs
- * and can include it in error messages and warnings (the parser
- * will attempt to open a connection to the URI only if
- * there is no byte stream or character stream specified).</p>
- *
- * <p>If the application knows the character encoding of the
- * object pointed to by the system identifier, it can register
- * the encoding using the setEncoding method.</p>
- *
- * <p>If the system identifier is a URL, it must be fully
- * resolved (it may not be a relative URL).</p>
- *
- * @param systemId The system identifier as a string.
- * @see #setEncoding
- * @see #getSystemId
- * @see org.xml.sax.Locator#getSystemId
- * @see org.xml.sax.SAXParseException#getSystemId
- */
- public void setSystemId (String systemId)
- {
- this.systemId = systemId;
- }
-
-
- /**
- * Get the system identifier for this input source.
- *
- * <p>The getEncoding method will return the character encoding
- * of the object pointed to, or null if unknown.</p>
- *
- * <p>If the system ID is a URL, it will be fully resolved.</p>
- *
- * @return The system identifier, or null if none was supplied.
- * @see #setSystemId
- * @see #getEncoding
- */
- public String getSystemId ()
- {
- return systemId;
- }
-
-
- /**
- * Set the byte stream for this input source.
- *
- * <p>The SAX parser will ignore this if there is also a character
- * stream specified, but it will use a byte stream in preference
- * to opening a URI connection itself.</p>
- *
- * <p>If the application knows the character encoding of the
- * byte stream, it should set it with the setEncoding method.</p>
- *
- * @param byteStream A byte stream containing an XML document or
- * other entity.
- * @see #setEncoding
- * @see #getByteStream
- * @see #getEncoding
- * @see java.io.InputStream
- */
- public void setByteStream (InputStream byteStream)
- {
- this.byteStream = byteStream;
- }
-
-
- /**
- * Get the byte stream for this input source.
- *
- * <p>The getEncoding method will return the character
- * encoding for this byte stream, or null if unknown.</p>
- *
- * @return The byte stream, or null if none was supplied.
- * @see #getEncoding
- * @see #setByteStream
- */
- public InputStream getByteStream ()
- {
- return byteStream;
- }
-
-
- /**
- * Set the character encoding, if known.
- *
- * <p>The encoding must be a string acceptable for an
- * XML encoding declaration (see section 4.3.3 of the XML 1.0
- * recommendation).</p>
- *
- * <p>This method has no effect when the application provides a
- * character stream.</p>
- *
- * @param encoding A string describing the character encoding.
- * @see #setSystemId
- * @see #setByteStream
- * @see #getEncoding
- */
- public void setEncoding (String encoding)
- {
- this.encoding = encoding;
- }
-
-
- /**
- * Get the character encoding for a byte stream or URI.
- * This value will be ignored when the application provides a
- * character stream.
- *
- * @return The encoding, or null if none was supplied.
- * @see #setByteStream
- * @see #getSystemId
- * @see #getByteStream
- */
- public String getEncoding ()
- {
- return encoding;
- }
-
-
- /**
- * Set the character stream for this input source.
- *
- * <p>If there is a character stream specified, the SAX parser
- * will ignore any byte stream and will not attempt to open
- * a URI connection to the system identifier.</p>
- *
- * @param characterStream The character stream containing the
- * XML document or other entity.
- * @see #getCharacterStream
- * @see java.io.Reader
- */
- public void setCharacterStream (Reader characterStream)
- {
- this.characterStream = characterStream;
- }
-
-
- /**
- * Get the character stream for this input source.
- *
- * @return The character stream, or null if none was supplied.
- * @see #setCharacterStream
- */
- public Reader getCharacterStream ()
- {
- return characterStream;
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Internal state.
- ////////////////////////////////////////////////////////////////////
-
- private String publicId;
- private String systemId;
- private InputStream byteStream;
- private String encoding;
- private Reader characterStream;
-
-}
-
-// end of InputSource.java
diff --git a/src/org/xml/sax/Locator.java b/src/org/xml/sax/Locator.java
deleted file mode 100644
index 868168d..0000000
--- a/src/org/xml/sax/Locator.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-// SAX locator interface for document events.
-// http://www.saxproject.org
-// No warranty; no copyright -- use this as you will.
-// $Id: Locator.java,v 1.2 2004/11/03 22:55:32 jsuttor Exp $
-
-package org.xml.sax;
-
-
-/**
- * Interface for associating a SAX event with a document location.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>If a SAX parser provides location information to the SAX
- * application, it does so by implementing this interface and then
- * passing an instance to the application using the content
- * handler's {@link org.xml.sax.ContentHandler#setDocumentLocator
- * setDocumentLocator} method. The application can use the
- * object to obtain the location of any other SAX event
- * in the XML source document.</p>
- *
- * <p>Note that the results returned by the object will be valid only
- * during the scope of each callback method: the application
- * will receive unpredictable results if it attempts to use the
- * locator at any other time, or after parsing completes.</p>
- *
- * <p>SAX parsers are not required to supply a locator, but they are
- * very strongly encouraged to do so. If the parser supplies a
- * locator, it must do so before reporting any other document events.
- * If no locator has been set by the time the application receives
- * the {@link org.xml.sax.ContentHandler#startDocument startDocument}
- * event, the application should assume that a locator is not
- * available.</p>
- *
- * @since SAX 1.0
- * @author David Megginson
- * @see org.xml.sax.ContentHandler#setDocumentLocator
- */
-public interface Locator {
-
-
- /**
- * Return the public identifier for the current document event.
- *
- * <p>The return value is the public identifier of the document
- * entity or of the external parsed entity in which the markup
- * triggering the event appears.</p>
- *
- * @return A string containing the public identifier, or
- * null if none is available.
- * @see #getSystemId
- */
- public abstract String getPublicId ();
-
-
- /**
- * Return the system identifier for the current document event.
- *
- * <p>The return value is the system identifier of the document
- * entity or of the external parsed entity in which the markup
- * triggering the event appears.</p>
- *
- * <p>If the system identifier is a URL, the parser must resolve it
- * fully before passing it to the application. For example, a file
- * name must always be provided as a <em>file:...</em> URL, and other
- * kinds of relative URI are also resolved against their bases.</p>
- *
- * @return A string containing the system identifier, or null
- * if none is available.
- * @see #getPublicId
- */
- public abstract String getSystemId ();
-
-
- /**
- * Return the line number where the current document event ends.
- * Lines are delimited by line ends, which are defined in
- * the XML specification.
- *
- * <p><strong>Warning:</strong> The return value from the method
- * is intended only as an approximation for the sake of diagnostics;
- * it is not intended to provide sufficient information
- * to edit the character content of the original XML document.
- * In some cases, these "line" numbers match what would be displayed
- * as columns, and in others they may not match the source text
- * due to internal entity expansion. </p>
- *
- * <p>The return value is an approximation of the line number
- * in the document entity or external parsed entity where the
- * markup triggering the event appears.</p>
- *
- * <p>If possible, the SAX driver should provide the line position
- * of the first character after the text associated with the document
- * event. The first line is line 1.</p>
- *
- * @return The line number, or -1 if none is available.
- * @see #getColumnNumber
- */
- public abstract int getLineNumber ();
-
-
- /**
- * Return the column number where the current document event ends.
- * This is one-based number of Java <code>char</code> values since
- * the last line end.
- *
- * <p><strong>Warning:</strong> The return value from the method
- * is intended only as an approximation for the sake of diagnostics;
- * it is not intended to provide sufficient information
- * to edit the character content of the original XML document.
- * For example, when lines contain combining character sequences, wide
- * characters, surrogate pairs, or bi-directional text, the value may
- * not correspond to the column in a text editor's display. </p>
- *
- * <p>The return value is an approximation of the column number
- * in the document entity or external parsed entity where the
- * markup triggering the event appears.</p>
- *
- * <p>If possible, the SAX driver should provide the line position
- * of the first character after the text associated with the document
- * event. The first column in each line is column 1.</p>
- *
- * @return The column number, or -1 if none is available.
- * @see #getLineNumber
- */
- public abstract int getColumnNumber ();
-
-}
-
-// end of Locator.java
diff --git a/src/org/xml/sax/Parser.java b/src/org/xml/sax/Parser.java
deleted file mode 100644
index 61bfbc7..0000000
--- a/src/org/xml/sax/Parser.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-// SAX parser interface.
-// http://www.saxproject.org
-// No warranty; no copyright -- use this as you will.
-// $Id: Parser.java,v 1.2 2004/11/03 22:55:32 jsuttor Exp $
-
-package org.xml.sax;
-
-import java.io.IOException;
-import java.util.Locale;
-
-
-/**
- * Basic interface for SAX (Simple API for XML) parsers.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>This was the main event supplier interface for SAX1; it has
- * been replaced in SAX2 by {@link org.xml.sax.XMLReader XMLReader},
- * which includes Namespace support and sophisticated configurability
- * and extensibility.</p>
- *
- * <p>All SAX1 parsers must implement this basic interface: it allows
- * applications to register handlers for different types of events
- * and to initiate a parse from a URI, or a character stream.</p>
- *
- * <p>All SAX1 parsers must also implement a zero-argument constructor
- * (though other constructors are also allowed).</p>
- *
- * <p>SAX1 parsers are reusable but not re-entrant: the application
- * may reuse a parser object (possibly with a different input source)
- * once the first parse has completed successfully, but it may not
- * invoke the parse() methods recursively within a parse.</p>
- *
- * @deprecated This interface has been replaced by the SAX2
- * {@link org.xml.sax.XMLReader XMLReader}
- * interface, which includes Namespace support.
- * @since SAX 1.0
- * @author David Megginson
- * @see org.xml.sax.EntityResolver
- * @see org.xml.sax.DTDHandler
- * @see org.xml.sax.DocumentHandler
- * @see org.xml.sax.ErrorHandler
- * @see org.xml.sax.HandlerBase
- * @see org.xml.sax.InputSource
- */
-public interface Parser
-{
-
- /**
- * Allow an application to request a locale for errors and warnings.
- *
- * <p>SAX parsers are not required to provide localisation for errors
- * and warnings; if they cannot support the requested locale,
- * however, they must throw a SAX exception. Applications may
- * not request a locale change in the middle of a parse.</p>
- *
- * @param locale A Java Locale object.
- * @exception org.xml.sax.SAXException Throws an exception
- * (using the previous or default locale) if the
- * requested locale is not supported.
- * @see org.xml.sax.SAXException
- * @see org.xml.sax.SAXParseException
- */
- public abstract void setLocale (Locale locale)
- throws SAXException;
-
-
- /**
- * Allow an application to register a custom entity resolver.
- *
- * <p>If the application does not register an entity resolver, the
- * SAX parser will resolve system identifiers and open connections
- * to entities itself (this is the default behaviour implemented in
- * HandlerBase).</p>
- *
- * <p>Applications may register a new or different entity resolver
- * in the middle of a parse, and the SAX parser must begin using
- * the new resolver immediately.</p>
- *
- * @param resolver The object for resolving entities.
- * @see EntityResolver
- * @see HandlerBase
- */
- public abstract void setEntityResolver (EntityResolver resolver);
-
-
- /**
- * Allow an application to register a DTD event handler.
- *
- * <p>If the application does not register a DTD handler, all DTD
- * events reported by the SAX parser will be silently
- * ignored (this is the default behaviour implemented by
- * HandlerBase).</p>
- *
- * <p>Applications may register a new or different
- * handler in the middle of a parse, and the SAX parser must
- * begin using the new handler immediately.</p>
- *
- * @param handler The DTD handler.
- * @see DTDHandler
- * @see HandlerBase
- */
- public abstract void setDTDHandler (DTDHandler handler);
-
-
- /**
- * Allow an application to register a document event handler.
- *
- * <p>If the application does not register a document handler, all
- * document events reported by the SAX parser will be silently
- * ignored (this is the default behaviour implemented by
- * HandlerBase).</p>
- *
- * <p>Applications may register a new or different handler in the
- * middle of a parse, and the SAX parser must begin using the new
- * handler immediately.</p>
- *
- * @param handler The document handler.
- * @see DocumentHandler
- * @see HandlerBase
- */
- public abstract void setDocumentHandler (DocumentHandler handler);
-
-
- /**
- * Allow an application to register an error event handler.
- *
- * <p>If the application does not register an error event handler,
- * all error events reported by the SAX parser will be silently
- * ignored, except for fatalError, which will throw a SAXException
- * (this is the default behaviour implemented by HandlerBase).</p>
- *
- * <p>Applications may register a new or different handler in the
- * middle of a parse, and the SAX parser must begin using the new
- * handler immediately.</p>
- *
- * @param handler The error handler.
- * @see ErrorHandler
- * @see SAXException
- * @see HandlerBase
- */
- public abstract void setErrorHandler (ErrorHandler handler);
-
-
- /**
- * Parse an XML document.
- *
- * <p>The application can use this method to instruct the SAX parser
- * to begin parsing an XML document from any valid input
- * source (a character stream, a byte stream, or a URI).</p>
- *
- * <p>Applications may not invoke this method while a parse is in
- * progress (they should create a new Parser instead for each
- * additional XML document). Once a parse is complete, an
- * application may reuse the same Parser object, possibly with a
- * different input source.</p>
- *
- * @param source The input source for the top-level of the
- * XML document.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @exception java.io.IOException An IO exception from the parser,
- * possibly from a byte stream or character stream
- * supplied by the application.
- * @see org.xml.sax.InputSource
- * @see #parse(java.lang.String)
- * @see #setEntityResolver
- * @see #setDTDHandler
- * @see #setDocumentHandler
- * @see #setErrorHandler
- */
- public abstract void parse (InputSource source)
- throws SAXException, IOException;
-
-
- /**
- * Parse an XML document from a system identifier (URI).
- *
- * <p>This method is a shortcut for the common case of reading a
- * document from a system identifier. It is the exact
- * equivalent of the following:</p>
- *
- * <pre>
- * parse(new InputSource(systemId));
- * </pre>
- *
- * <p>If the system identifier is a URL, it must be fully resolved
- * by the application before it is passed to the parser.</p>
- *
- * @param systemId The system identifier (URI).
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @exception java.io.IOException An IO exception from the parser,
- * possibly from a byte stream or character stream
- * supplied by the application.
- * @see #parse(org.xml.sax.InputSource)
- */
- public abstract void parse (String systemId)
- throws SAXException, IOException;
-
-}
-
-// end of Parser.java
diff --git a/src/org/xml/sax/SAXException.java b/src/org/xml/sax/SAXException.java
deleted file mode 100644
index 65b25cc..0000000
--- a/src/org/xml/sax/SAXException.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-// SAX exception class.
-// http://www.saxproject.org
-// No warranty; no copyright -- use this as you will.
-// $Id: SAXException.java,v 1.3 2004/11/03 22:55:32 jsuttor Exp $
-
-package org.xml.sax;
-
-/**
- * Encapsulate a general SAX error or warning.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>This class can contain basic error or warning information from
- * either the XML parser or the application: a parser writer or
- * application writer can subclass it to provide additional
- * functionality. SAX handlers may throw this exception or
- * any exception subclassed from it.</p>
- *
- * <p>If the application needs to pass through other types of
- * exceptions, it must wrap those exceptions in a SAXException
- * or an exception derived from a SAXException.</p>
- *
- * <p>If the parser or application needs to include information about a
- * specific location in an XML document, it should use the
- * {@link org.xml.sax.SAXParseException SAXParseException} subclass.</p>
- *
- * @since SAX 1.0
- * @author David Megginson
- * @version 2.0.1 (sax2r2)
- * @see org.xml.sax.SAXParseException
- */
-public class SAXException extends Exception {
-
-
- /**
- * Create a new SAXException.
- */
- public SAXException ()
- {
- super();
- this.exception = null;
- }
-
-
- /**
- * Create a new SAXException.
- *
- * @param message The error or warning message.
- */
- public SAXException (String message) {
- super(message);
- this.exception = null;
- }
-
-
- /**
- * Create a new SAXException wrapping an existing exception.
- *
- * <p>The existing exception will be embedded in the new
- * one, and its message will become the default message for
- * the SAXException.</p>
- *
- * @param e The exception to be wrapped in a SAXException.
- */
- public SAXException (Exception e)
- {
- super();
- this.exception = e;
- }
-
-
- /**
- * Create a new SAXException from an existing exception.
- *
- * <p>The existing exception will be embedded in the new
- * one, but the new exception will have its own message.</p>
- *
- * @param message The detail message.
- * @param e The exception to be wrapped in a SAXException.
- */
- public SAXException (String message, Exception e)
- {
- super(message);
- this.exception = e;
- }
-
-
- /**
- * Return a detail message for this exception.
- *
- * <p>If there is an embedded exception, and if the SAXException
- * has no detail message of its own, this method will return
- * the detail message from the embedded exception.</p>
- *
- * @return The error or warning message.
- */
- public String getMessage ()
- {
- String message = super.getMessage();
-
- if (message == null && exception != null) {
- return exception.getMessage();
- } else {
- return message;
- }
- }
-
-
- /**
- * Return the embedded exception, if any.
- *
- * @return The embedded exception, or null if there is none.
- */
- public Exception getException ()
- {
- return exception;
- }
-
- /**
- * Return the cause of the exception
- *
- * @return Return the cause of the exception
- */
- public Throwable getCause() {
- return exception;
- }
-
- /**
- * Override toString to pick up any embedded exception.
- *
- * @return A string representation of this exception.
- */
- public String toString ()
- {
- if (exception != null) {
- return super.toString() + "\n" + exception.toString();
- } else {
- return super.toString();
- }
- }
-
-
-
- //////////////////////////////////////////////////////////////////////
- // Internal state.
- //////////////////////////////////////////////////////////////////////
-
-
- /**
- * @serial The embedded exception if tunnelling, or null.
- */
- private Exception exception;
-
- // Added serialVersionUID to preserve binary compatibility
- static final long serialVersionUID = 583241635256073760L;
-}
-
-// end of SAXException.java
diff --git a/src/org/xml/sax/SAXNotRecognizedException.java b/src/org/xml/sax/SAXNotRecognizedException.java
deleted file mode 100644
index f963e01..0000000
--- a/src/org/xml/sax/SAXNotRecognizedException.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-// SAXNotRecognizedException.java - unrecognized feature or value.
-// http://www.saxproject.org
-// Written by David Megginson
-// NO WARRANTY! This class is in the Public Domain.
-// $Id: SAXNotRecognizedException.java,v 1.3 2004/11/03 22:55:32 jsuttor Exp $
-
-package org.xml.sax;
-
-
-/**
- * Exception class for an unrecognized identifier.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>An XMLReader will throw this exception when it finds an
- * unrecognized feature or property identifier; SAX applications and
- * extensions may use this class for other, similar purposes.</p>
- *
- * @since SAX 2.0
- * @author David Megginson
- * @see org.xml.sax.SAXNotSupportedException
- */
-public class SAXNotRecognizedException extends SAXException
-{
-
- /**
- * Default constructor.
- */
- public SAXNotRecognizedException ()
- {
- super();
- }
-
-
- /**
- * Construct a new exception with the given message.
- *
- * @param message The text message of the exception.
- */
- public SAXNotRecognizedException (String message)
- {
- super(message);
- }
-
- // Added serialVersionUID to preserve binary compatibility
- static final long serialVersionUID = 5440506620509557213L;
-}
-
-// end of SAXNotRecognizedException.java
diff --git a/src/org/xml/sax/SAXNotSupportedException.java b/src/org/xml/sax/SAXNotSupportedException.java
deleted file mode 100644
index d31f49e..0000000
--- a/src/org/xml/sax/SAXNotSupportedException.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-// SAXNotSupportedException.java - unsupported feature or value.
-// http://www.saxproject.org
-// Written by David Megginson
-// NO WARRANTY! This class is in the Public Domain.
-// $Id: SAXNotSupportedException.java,v 1.4 2004/11/03 22:55:32 jsuttor Exp $
-
-package org.xml.sax;
-
-/**
- * Exception class for an unsupported operation.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>An XMLReader will throw this exception when it recognizes a
- * feature or property identifier, but cannot perform the requested
- * operation (setting a state or value). Other SAX2 applications and
- * extensions may use this class for similar purposes.</p>
- *
- * @since SAX 2.0
- * @author David Megginson
- * @see org.xml.sax.SAXNotRecognizedException
- */
-public class SAXNotSupportedException extends SAXException
-{
-
- /**
- * Construct a new exception with no message.
- */
- public SAXNotSupportedException ()
- {
- super();
- }
-
-
- /**
- * Construct a new exception with the given message.
- *
- * @param message The text message of the exception.
- */
- public SAXNotSupportedException (String message)
- {
- super(message);
- }
-
- // Added serialVersionUID to preserve binary compatibility
- static final long serialVersionUID = -1422818934641823846L;
-}
-
-// end of SAXNotSupportedException.java
diff --git a/src/org/xml/sax/SAXParseException.java b/src/org/xml/sax/SAXParseException.java
deleted file mode 100644
index 38f37ff..0000000
--- a/src/org/xml/sax/SAXParseException.java
+++ /dev/null
@@ -1,313 +0,0 @@
-/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-// SAX exception class.
-// http://www.saxproject.org
-// No warranty; no copyright -- use this as you will.
-// $Id: SAXParseException.java,v 1.2 2004/11/03 22:55:32 jsuttor Exp $
-
-package org.xml.sax;
-
-/**
- * Encapsulate an XML parse error or warning.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>This exception may include information for locating the error
- * in the original XML document, as if it came from a {@link Locator}
- * object. Note that although the application
- * will receive a SAXParseException as the argument to the handlers
- * in the {@link org.xml.sax.ErrorHandler ErrorHandler} interface,
- * the application is not actually required to throw the exception;
- * instead, it can simply read the information in it and take a
- * different action.</p>
- *
- * <p>Since this exception is a subclass of {@link org.xml.sax.SAXException
- * SAXException}, it inherits the ability to wrap another exception.</p>
- *
- * @since SAX 1.0
- * @author David Megginson
- * @version 2.0.1 (sax2r2)
- * @see org.xml.sax.SAXException
- * @see org.xml.sax.Locator
- * @see org.xml.sax.ErrorHandler
- */
-public class SAXParseException extends SAXException {
-
-
- //////////////////////////////////////////////////////////////////////
- // Constructors.
- //////////////////////////////////////////////////////////////////////
-
-
- /**
- * Create a new SAXParseException from a message and a Locator.
- *
- * <p>This constructor is especially useful when an application is
- * creating its own exception from within a {@link org.xml.sax.ContentHandler
- * ContentHandler} callback.</p>
- *
- * @param message The error or warning message.
- * @param locator The locator object for the error or warning (may be
- * null).
- * @see org.xml.sax.Locator
- */
- public SAXParseException (String message, Locator locator) {
- super(message);
- if (locator != null) {
- init(locator.getPublicId(), locator.getSystemId(),
- locator.getLineNumber(), locator.getColumnNumber());
- } else {
- init(null, null, -1, -1);
- }
- }
-
-
- /**
- * Wrap an existing exception in a SAXParseException.
- *
- * <p>This constructor is especially useful when an application is
- * creating its own exception from within a {@link org.xml.sax.ContentHandler
- * ContentHandler} callback, and needs to wrap an existing exception that is not a
- * subclass of {@link org.xml.sax.SAXException SAXException}.</p>
- *
- * @param message The error or warning message, or null to
- * use the message from the embedded exception.
- * @param locator The locator object for the error or warning (may be
- * null).
- * @param e Any exception.
- * @see org.xml.sax.Locator
- */
- public SAXParseException (String message, Locator locator,
- Exception e) {
- super(message, e);
- if (locator != null) {
- init(locator.getPublicId(), locator.getSystemId(),
- locator.getLineNumber(), locator.getColumnNumber());
- } else {
- init(null, null, -1, -1);
- }
- }
-
-
- /**
- * Create a new SAXParseException.
- *
- * <p>This constructor is most useful for parser writers.</p>
- *
- * <p>All parameters except the message are as if
- * they were provided by a {@link Locator}. For example, if the
- * system identifier is a URL (including relative filename), the
- * caller must resolve it fully before creating the exception.</p>
- *
- *
- * @param message The error or warning message.
- * @param publicId The public identifier of the entity that generated
- * the error or warning.
- * @param systemId The system identifier of the entity that generated
- * the error or warning.
- * @param lineNumber The line number of the end of the text that
- * caused the error or warning.
- * @param columnNumber The column number of the end of the text that
- * cause the error or warning.
- */
- public SAXParseException (String message, String publicId, String systemId,
- int lineNumber, int columnNumber)
- {
- super(message);
- init(publicId, systemId, lineNumber, columnNumber);
- }
-
-
- /**
- * Create a new SAXParseException with an embedded exception.
- *
- * <p>This constructor is most useful for parser writers who
- * need to wrap an exception that is not a subclass of
- * {@link org.xml.sax.SAXException SAXException}.</p>
- *
- * <p>All parameters except the message and exception are as if
- * they were provided by a {@link Locator}. For example, if the
- * system identifier is a URL (including relative filename), the
- * caller must resolve it fully before creating the exception.</p>
- *
- * @param message The error or warning message, or null to use
- * the message from the embedded exception.
- * @param publicId The public identifier of the entity that generated
- * the error or warning.
- * @param systemId The system identifier of the entity that generated
- * the error or warning.
- * @param lineNumber The line number of the end of the text that
- * caused the error or warning.
- * @param columnNumber The column number of the end of the text that
- * cause the error or warning.
- * @param e Another exception to embed in this one.
- */
- public SAXParseException (String message, String publicId, String systemId,
- int lineNumber, int columnNumber, Exception e)
- {
- super(message, e);
- init(publicId, systemId, lineNumber, columnNumber);
- }
-
-
- /**
- * Internal initialization method.
- *
- * @param publicId The public identifier of the entity which generated the exception,
- * or null.
- * @param systemId The system identifier of the entity which generated the exception,
- * or null.
- * @param lineNumber The line number of the error, or -1.
- * @param columnNumber The column number of the error, or -1.
- */
- private void init (String publicId, String systemId,
- int lineNumber, int columnNumber)
- {
- this.publicId = publicId;
- this.systemId = systemId;
- this.lineNumber = lineNumber;
- this.columnNumber = columnNumber;
- }
-
-
- /**
- * Get the public identifier of the entity where the exception occurred.
- *
- * @return A string containing the public identifier, or null
- * if none is available.
- * @see org.xml.sax.Locator#getPublicId
- */
- public String getPublicId ()
- {
- return this.publicId;
- }
-
-
- /**
- * Get the system identifier of the entity where the exception occurred.
- *
- * <p>If the system identifier is a URL, it will have been resolved
- * fully.</p>
- *
- * @return A string containing the system identifier, or null
- * if none is available.
- * @see org.xml.sax.Locator#getSystemId
- */
- public String getSystemId ()
- {
- return this.systemId;
- }
-
-
- /**
- * The line number of the end of the text where the exception occurred.
- *
- * <p>The first line is line 1.</p>
- *
- * @return An integer representing the line number, or -1
- * if none is available.
- * @see org.xml.sax.Locator#getLineNumber
- */
- public int getLineNumber ()
- {
- return this.lineNumber;
- }
-
-
- /**
- * The column number of the end of the text where the exception occurred.
- *
- * <p>The first column in a line is position 1.</p>
- *
- * @return An integer representing the column number, or -1
- * if none is available.
- * @see org.xml.sax.Locator#getColumnNumber
- */
- public int getColumnNumber ()
- {
- return this.columnNumber;
- }
-
- /**
- * Override toString to provide more detailed error message.
- *
- * @return A string representation of this exception.
- */
- public String toString() {
- StringBuilder buf = new StringBuilder(getClass().getName());
- String message = getLocalizedMessage();
- if (publicId!=null) buf.append("publicId: ").append(publicId);
- if (systemId!=null) buf.append("; systemId: ").append(systemId);
- if (lineNumber!=-1) buf.append("; lineNumber: ").append(lineNumber);
- if (columnNumber!=-1) buf.append("; columnNumber: ").append(columnNumber);
-
- //append the exception message at the end
- if (message!=null) buf.append("; ").append(message);
- return buf.toString();
- }
-
- //////////////////////////////////////////////////////////////////////
- // Internal state.
- //////////////////////////////////////////////////////////////////////
-
-
- /**
- * @serial The public identifier, or null.
- * @see #getPublicId
- */
- private String publicId;
-
-
- /**
- * @serial The system identifier, or null.
- * @see #getSystemId
- */
- private String systemId;
-
-
- /**
- * @serial The line number, or -1.
- * @see #getLineNumber
- */
- private int lineNumber;
-
-
- /**
- * @serial The column number, or -1.
- * @see #getColumnNumber
- */
- private int columnNumber;
-
- // Added serialVersionUID to preserve binary compatibility
- static final long serialVersionUID = -5651165872476709336L;
-}
-
-// end of SAXParseException.java
diff --git a/src/org/xml/sax/XMLFilter.java b/src/org/xml/sax/XMLFilter.java
deleted file mode 100644
index f88cff1..0000000
--- a/src/org/xml/sax/XMLFilter.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-// XMLFilter.java - filter SAX2 events.
-// http://www.saxproject.org
-// Written by David Megginson
-// NO WARRANTY! This class is in the Public Domain.
-// $Id: XMLFilter.java,v 1.2 2004/11/03 22:55:32 jsuttor Exp $
-
-package org.xml.sax;
-
-
-/**
- * Interface for an XML filter.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>An XML filter is like an XML reader, except that it obtains its
- * events from another XML reader rather than a primary source like
- * an XML document or database. Filters can modify a stream of
- * events as they pass on to the final application.</p>
- *
- * <p>The XMLFilterImpl helper class provides a convenient base
- * for creating SAX2 filters, by passing on all {@link org.xml.sax.EntityResolver
- * EntityResolver}, {@link org.xml.sax.DTDHandler DTDHandler},
- * {@link org.xml.sax.ContentHandler ContentHandler} and {@link org.xml.sax.ErrorHandler
- * ErrorHandler} events automatically.</p>
- *
- * @since SAX 2.0
- * @author David Megginson
- * @see org.xml.sax.helpers.XMLFilterImpl
- */
-public interface XMLFilter extends XMLReader
-{
-
- /**
- * Set the parent reader.
- *
- * <p>This method allows the application to link the filter to
- * a parent reader (which may be another filter). The argument
- * may not be null.</p>
- *
- * @param parent The parent reader.
- */
- public abstract void setParent (XMLReader parent);
-
-
- /**
- * Get the parent reader.
- *
- * <p>This method allows the application to query the parent
- * reader (which may be another filter). It is generally a
- * bad idea to perform any operations on the parent reader
- * directly: they should all pass through this filter.</p>
- *
- * @return The parent filter, or null if none has been set.
- */
- public abstract XMLReader getParent ();
-
-}
-
-// end of XMLFilter.java
diff --git a/src/org/xml/sax/XMLReader.java b/src/org/xml/sax/XMLReader.java
deleted file mode 100644
index 93b7342..0000000
--- a/src/org/xml/sax/XMLReader.java
+++ /dev/null
@@ -1,428 +0,0 @@
-/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-// XMLReader.java - read an XML document.
-// http://www.saxproject.org
-// Written by David Megginson
-// NO WARRANTY! This class is in the Public Domain.
-// $Id: XMLReader.java,v 1.3 2004/11/03 22:55:32 jsuttor Exp $
-
-package org.xml.sax;
-
-import java.io.IOException;
-
-
-/**
- * Interface for reading an XML document using callbacks.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p><strong>Note:</strong> despite its name, this interface does
- * <em>not</em> extend the standard Java {@link java.io.Reader Reader}
- * interface, because reading XML is a fundamentally different activity
- * than reading character data.</p>
- *
- * <p>XMLReader is the interface that an XML parser's SAX2 driver must
- * implement. This interface allows an application to set and
- * query features and properties in the parser, to register
- * event handlers for document processing, and to initiate
- * a document parse.</p>
- *
- * <p>All SAX interfaces are assumed to be synchronous: the
- * {@link #parse parse} methods must not return until parsing
- * is complete, and readers must wait for an event-handler callback
- * to return before reporting the next event.</p>
- *
- * <p>This interface replaces the (now deprecated) SAX 1.0 {@link
- * org.xml.sax.Parser Parser} interface. The XMLReader interface
- * contains two important enhancements over the old Parser
- * interface (as well as some minor ones):</p>
- *
- * <ol>
- * <li>it adds a standard way to query and set features and
- * properties; and</li>
- * <li>it adds Namespace support, which is required for many
- * higher-level XML standards.</li>
- * </ol>
- *
- * <p>There are adapters available to convert a SAX1 Parser to
- * a SAX2 XMLReader and vice-versa.</p>
- *
- * @since SAX 2.0
- * @author David Megginson
- * @see org.xml.sax.XMLFilter
- * @see org.xml.sax.helpers.ParserAdapter
- * @see org.xml.sax.helpers.XMLReaderAdapter
- */
-public interface XMLReader
-{
-
-
- ////////////////////////////////////////////////////////////////////
- // Configuration.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Look up the value of a feature flag.
- *
- * <p>The feature name is any fully-qualified URI. It is
- * possible for an XMLReader to recognize a feature name but
- * temporarily be unable to return its value.
- * Some feature values may be available only in specific
- * contexts, such as before, during, or after a parse.
- * Also, some feature values may not be programmatically accessible.
- * (In the case of an adapter for SAX1 {@link Parser}, there is no
- * implementation-independent way to expose whether the underlying
- * parser is performing validation, expanding external entities,
- * and so forth.) </p>
- *
- * <p>All XMLReaders are required to recognize the
- * http://xml.org/sax/features/namespaces and the
- * http://xml.org/sax/features/namespace-prefixes feature names.</p>
- *
- * <p>Typical usage is something like this:</p>
- *
- * <pre>
- * XMLReader r = new MySAXDriver();
- *
- * // try to activate validation
- * try {
- * r.setFeature("http://xml.org/sax/features/validation", true);
- * } catch (SAXException e) {
- * System.err.println("Cannot activate validation.");
- * }
- *
- * // register event handlers
- * r.setContentHandler(new MyContentHandler());
- * r.setErrorHandler(new MyErrorHandler());
- *
- * // parse the first document
- * try {
- * r.parse("http://www.foo.com/mydoc.xml");
- * } catch (IOException e) {
- * System.err.println("I/O exception reading XML document");
- * } catch (SAXException e) {
- * System.err.println("XML exception reading document.");
- * }
- * </pre>
- *
- * <p>Implementors are free (and encouraged) to invent their own features,
- * using names built on their own URIs.</p>
- *
- * @param name The feature name, which is a fully-qualified URI.
- * @return The current value of the feature (true or false).
- * @exception org.xml.sax.SAXNotRecognizedException If the feature
- * value can't be assigned or retrieved.
- * @exception org.xml.sax.SAXNotSupportedException When the
- * XMLReader recognizes the feature name but
- * cannot determine its value at this time.
- * @see #setFeature
- */
- public boolean getFeature (String name)
- throws SAXNotRecognizedException, SAXNotSupportedException;
-
-
- /**
- * Set the value of a feature flag.
- *
- * <p>The feature name is any fully-qualified URI. It is
- * possible for an XMLReader to expose a feature value but
- * to be unable to change the current value.
- * Some feature values may be immutable or mutable only
- * in specific contexts, such as before, during, or after
- * a parse.</p>
- *
- * <p>All XMLReaders are required to support setting
- * http://xml.org/sax/features/namespaces to true and
- * http://xml.org/sax/features/namespace-prefixes to false.</p>
- *
- * @param name The feature name, which is a fully-qualified URI.
- * @param value The requested value of the feature (true or false).
- * @exception org.xml.sax.SAXNotRecognizedException If the feature
- * value can't be assigned or retrieved.
- * @exception org.xml.sax.SAXNotSupportedException When the
- * XMLReader recognizes the feature name but
- * cannot set the requested value.
- * @see #getFeature
- */
- public void setFeature (String name, boolean value)
- throws SAXNotRecognizedException, SAXNotSupportedException;
-
-
- /**
- * Look up the value of a property.
- *
- * <p>The property name is any fully-qualified URI. It is
- * possible for an XMLReader to recognize a property name but
- * temporarily be unable to return its value.
- * Some property values may be available only in specific
- * contexts, such as before, during, or after a parse.</p>
- *
- * <p>XMLReaders are not required to recognize any specific
- * property names, though an initial core set is documented for
- * SAX2.</p>
- *
- * <p>Implementors are free (and encouraged) to invent their own properties,
- * using names built on their own URIs.</p>
- *
- * @param name The property name, which is a fully-qualified URI.
- * @return The current value of the property.
- * @exception org.xml.sax.SAXNotRecognizedException If the property
- * value can't be assigned or retrieved.
- * @exception org.xml.sax.SAXNotSupportedException When the
- * XMLReader recognizes the property name but
- * cannot determine its value at this time.
- * @see #setProperty
- */
- public Object getProperty (String name)
- throws SAXNotRecognizedException, SAXNotSupportedException;
-
-
- /**
- * Set the value of a property.
- *
- * <p>The property name is any fully-qualified URI. It is
- * possible for an XMLReader to recognize a property name but
- * to be unable to change the current value.
- * Some property values may be immutable or mutable only
- * in specific contexts, such as before, during, or after
- * a parse.</p>
- *
- * <p>XMLReaders are not required to recognize setting
- * any specific property names, though a core set is defined by
- * SAX2.</p>
- *
- * <p>This method is also the standard mechanism for setting
- * extended handlers.</p>
- *
- * @param name The property name, which is a fully-qualified URI.
- * @param value The requested value for the property.
- * @exception org.xml.sax.SAXNotRecognizedException If the property
- * value can't be assigned or retrieved.
- * @exception org.xml.sax.SAXNotSupportedException When the
- * XMLReader recognizes the property name but
- * cannot set the requested value.
- */
- public void setProperty (String name, Object value)
- throws SAXNotRecognizedException, SAXNotSupportedException;
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Event handlers.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Allow an application to register an entity resolver.
- *
- * <p>If the application does not register an entity resolver,
- * the XMLReader will perform its own default resolution.</p>
- *
- * <p>Applications may register a new or different resolver in the
- * middle of a parse, and the SAX parser must begin using the new
- * resolver immediately.</p>
- *
- * @param resolver The entity resolver.
- * @see #getEntityResolver
- */
- public void setEntityResolver (EntityResolver resolver);
-
-
- /**
- * Return the current entity resolver.
- *
- * @return The current entity resolver, or null if none
- * has been registered.
- * @see #setEntityResolver
- */
- public EntityResolver getEntityResolver ();
-
-
- /**
- * Allow an application to register a DTD event handler.
- *
- * <p>If the application does not register a DTD handler, all DTD
- * events reported by the SAX parser will be silently ignored.</p>
- *
- * <p>Applications may register a new or different handler in the
- * middle of a parse, and the SAX parser must begin using the new
- * handler immediately.</p>
- *
- * @param handler The DTD handler.
- * @see #getDTDHandler
- */
- public void setDTDHandler (DTDHandler handler);
-
-
- /**
- * Return the current DTD handler.
- *
- * @return The current DTD handler, or null if none
- * has been registered.
- * @see #setDTDHandler
- */
- public DTDHandler getDTDHandler ();
-
-
- /**
- * Allow an application to register a content event handler.
- *
- * <p>If the application does not register a content handler, all
- * content events reported by the SAX parser will be silently
- * ignored.</p>
- *
- * <p>Applications may register a new or different handler in the
- * middle of a parse, and the SAX parser must begin using the new
- * handler immediately.</p>
- *
- * @param handler The content handler.
- * @see #getContentHandler
- */
- public void setContentHandler (ContentHandler handler);
-
-
- /**
- * Return the current content handler.
- *
- * @return The current content handler, or null if none
- * has been registered.
- * @see #setContentHandler
- */
- public ContentHandler getContentHandler ();
-
-
- /**
- * Allow an application to register an error event handler.
- *
- * <p>If the application does not register an error handler, all
- * error events reported by the SAX parser will be silently
- * ignored; however, normal processing may not continue. It is
- * highly recommended that all SAX applications implement an
- * error handler to avoid unexpected bugs.</p>
- *
- * <p>Applications may register a new or different handler in the
- * middle of a parse, and the SAX parser must begin using the new
- * handler immediately.</p>
- *
- * @param handler The error handler.
- * @see #getErrorHandler
- */
- public void setErrorHandler (ErrorHandler handler);
-
-
- /**
- * Return the current error handler.
- *
- * @return The current error handler, or null if none
- * has been registered.
- * @see #setErrorHandler
- */
- public ErrorHandler getErrorHandler ();
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Parsing.
- ////////////////////////////////////////////////////////////////////
-
- /**
- * Parse an XML document.
- *
- * <p>The application can use this method to instruct the XML
- * reader to begin parsing an XML document from any valid input
- * source (a character stream, a byte stream, or a URI).</p>
- *
- * <p>Applications may not invoke this method while a parse is in
- * progress (they should create a new XMLReader instead for each
- * nested XML document). Once a parse is complete, an
- * application may reuse the same XMLReader object, possibly with a
- * different input source.
- * Configuration of the XMLReader object (such as handler bindings and
- * values established for feature flags and properties) is unchanged
- * by completion of a parse, unless the definition of that aspect of
- * the configuration explicitly specifies other behavior.
- * (For example, feature flags or properties exposing
- * characteristics of the document being parsed.)
- * </p>
- *
- * <p>During the parse, the XMLReader will provide information
- * about the XML document through the registered event
- * handlers.</p>
- *
- * <p>This method is synchronous: it will not return until parsing
- * has ended. If a client application wants to terminate
- * parsing early, it should throw an exception.</p>
- *
- * @param input The input source for the top-level of the
- * XML document.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @exception java.io.IOException An IO exception from the parser,
- * possibly from a byte stream or character stream
- * supplied by the application.
- * @see org.xml.sax.InputSource
- * @see #parse(java.lang.String)
- * @see #setEntityResolver
- * @see #setDTDHandler
- * @see #setContentHandler
- * @see #setErrorHandler
- */
- public void parse (InputSource input)
- throws IOException, SAXException;
-
-
- /**
- * Parse an XML document from a system identifier (URI).
- *
- * <p>This method is a shortcut for the common case of reading a
- * document from a system identifier. It is the exact
- * equivalent of the following:</p>
- *
- * <pre>
- * parse(new InputSource(systemId));
- * </pre>
- *
- * <p>If the system identifier is a URL, it must be fully resolved
- * by the application before it is passed to the parser.</p>
- *
- * @param systemId The system identifier (URI).
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @exception java.io.IOException An IO exception from the parser,
- * possibly from a byte stream or character stream
- * supplied by the application.
- * @see #parse(org.xml.sax.InputSource)
- */
- public void parse (String systemId)
- throws IOException, SAXException;
-
-}
diff --git a/src/org/xml/sax/ext/Attributes2.java b/src/org/xml/sax/ext/Attributes2.java
deleted file mode 100644
index 4c7023d..0000000
--- a/src/org/xml/sax/ext/Attributes2.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-// Attributes2.java - extended Attributes
-// http://www.saxproject.org
-// Public Domain: no warranty.
-// $Id: Attributes2.java,v 1.2 2004/11/03 22:49:07 jsuttor Exp $
-
-package org.xml.sax.ext;
-
-import org.xml.sax.Attributes;
-
-
-/**
- * SAX2 extension to augment the per-attribute information
- * provided though {@link Attributes}.
- * If an implementation supports this extension, the attributes
- * provided in {@link org.xml.sax.ContentHandler#startElement
- * ContentHandler.startElement() } will implement this interface,
- * and the <em>http://xml.org/sax/features/use-attributes2</em>
- * feature flag will have the value <em>true</em>.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * </blockquote>
- *
- * <p> XMLReader implementations are not required to support this
- * information, and it is not part of core-only SAX2 distributions.</p>
- *
- * <p>Note that if an attribute was defaulted (<em>!isSpecified()</em>)
- * it will of necessity also have been declared (<em>isDeclared()</em>)
- * in the DTD.
- * Similarly if an attribute's type is anything except CDATA, then it
- * must have been declared.
- * </p>
- *
- * @since SAX 2.0 (extensions 1.1 alpha)
- * @author David Brownell
- */
-public interface Attributes2 extends Attributes
-{
- /**
- * Returns false unless the attribute was declared in the DTD.
- * This helps distinguish two kinds of attributes that SAX reports
- * as CDATA: ones that were declared (and hence are usually valid),
- * and those that were not (and which are never valid).
- *
- * @param index The attribute index (zero-based).
- * @return true if the attribute was declared in the DTD,
- * false otherwise.
- * @exception java.lang.ArrayIndexOutOfBoundsException When the
- * supplied index does not identify an attribute.
- */
- public boolean isDeclared (int index);
-
- /**
- * Returns false unless the attribute was declared in the DTD.
- * This helps distinguish two kinds of attributes that SAX reports
- * as CDATA: ones that were declared (and hence are usually valid),
- * and those that were not (and which are never valid).
- *
- * @param qName The XML qualified (prefixed) name.
- * @return true if the attribute was declared in the DTD,
- * false otherwise.
- * @exception java.lang.IllegalArgumentException When the
- * supplied name does not identify an attribute.
- */
- public boolean isDeclared (String qName);
-
- /**
- * Returns false unless the attribute was declared in the DTD.
- * This helps distinguish two kinds of attributes that SAX reports
- * as CDATA: ones that were declared (and hence are usually valid),
- * and those that were not (and which are never valid).
- *
- * <p>Remember that since DTDs do not "understand" namespaces, the
- * namespace URI associated with an attribute may not have come from
- * the DTD. The declaration will have applied to the attribute's
- * <em>qName</em>.
- *
- * @param uri The Namespace URI, or the empty string if
- * the name has no Namespace URI.
- * @param localName The attribute's local name.
- * @return true if the attribute was declared in the DTD,
- * false otherwise.
- * @exception java.lang.IllegalArgumentException When the
- * supplied names do not identify an attribute.
- */
- public boolean isDeclared (String uri, String localName);
-
- /**
- * Returns true unless the attribute value was provided
- * by DTD defaulting.
- *
- * @param index The attribute index (zero-based).
- * @return true if the value was found in the XML text,
- * false if the value was provided by DTD defaulting.
- * @exception java.lang.ArrayIndexOutOfBoundsException When the
- * supplied index does not identify an attribute.
- */
- public boolean isSpecified (int index);
-
- /**
- * Returns true unless the attribute value was provided
- * by DTD defaulting.
- *
- * <p>Remember that since DTDs do not "understand" namespaces, the
- * namespace URI associated with an attribute may not have come from
- * the DTD. The declaration will have applied to the attribute's
- * <em>qName</em>.
- *
- * @param uri The Namespace URI, or the empty string if
- * the name has no Namespace URI.
- * @param localName The attribute's local name.
- * @return true if the value was found in the XML text,
- * false if the value was provided by DTD defaulting.
- * @exception java.lang.IllegalArgumentException When the
- * supplied names do not identify an attribute.
- */
- public boolean isSpecified (String uri, String localName);
-
- /**
- * Returns true unless the attribute value was provided
- * by DTD defaulting.
- *
- * @param qName The XML qualified (prefixed) name.
- * @return true if the value was found in the XML text,
- * false if the value was provided by DTD defaulting.
- * @exception java.lang.IllegalArgumentException When the
- * supplied name does not identify an attribute.
- */
- public boolean isSpecified (String qName);
-}
diff --git a/src/org/xml/sax/ext/Attributes2Impl.java b/src/org/xml/sax/ext/Attributes2Impl.java
deleted file mode 100644
index aabb0b9..0000000
--- a/src/org/xml/sax/ext/Attributes2Impl.java
+++ /dev/null
@@ -1,332 +0,0 @@
-/*
- * Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-// Attributes2Impl.java - extended AttributesImpl
-// http://www.saxproject.org
-// Public Domain: no warranty.
-// $Id: Attributes2Impl.java,v 1.3 2005/02/24 11:20:18 gg156739 Exp $
-
-package org.xml.sax.ext;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.helpers.AttributesImpl;
-
-
-/**
- * SAX2 extension helper for additional Attributes information,
- * implementing the {@link Attributes2} interface.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * </blockquote>
- *
- * <p>This is not part of core-only SAX2 distributions.</p>
- *
- * <p>The <em>specified</em> flag for each attribute will always
- * be true, unless it has been set to false in the copy constructor
- * or using {@link #setSpecified}.
- * Similarly, the <em>declared</em> flag for each attribute will
- * always be false, except for defaulted attributes (<em>specified</em>
- * is false), non-CDATA attributes, or when it is set to true using
- * {@link #setDeclared}.
- * If you change an attribute's type by hand, you may need to modify
- * its <em>declared</em> flag to match.
- * </p>
- *
- * @since SAX 2.0 (extensions 1.1 alpha)
- * @author David Brownell
- */
-public class Attributes2Impl extends AttributesImpl implements Attributes2
-{
- private boolean declared [];
- private boolean specified [];
-
-
- /**
- * Construct a new, empty Attributes2Impl object.
- */
- public Attributes2Impl () {
- specified = null;
- declared = null;
- }
-
-
- /**
- * Copy an existing Attributes or Attributes2 object.
- * If the object implements Attributes2, values of the
- * <em>specified</em> and <em>declared</em> flags for each
- * attribute are copied.
- * Otherwise the flag values are defaulted to assume no DTD was used,
- * unless there is evidence to the contrary (such as attributes with
- * type other than CDATA, which must have been <em>declared</em>).
- *
- * <p>This constructor is especially useful inside a
- * {@link org.xml.sax.ContentHandler#startElement startElement} event.</p>
- *
- * @param atts The existing Attributes object.
- */
- public Attributes2Impl (Attributes atts)
- {
- super (atts);
- }
-
-
- ////////////////////////////////////////////////////////////////////
- // Implementation of Attributes2
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Returns the current value of the attribute's "declared" flag.
- */
- // javadoc mostly from interface
- public boolean isDeclared (int index)
- {
- if (index < 0 || index >= getLength ())
- throw new ArrayIndexOutOfBoundsException (
- "No attribute at index: " + index);
- return declared [index];
- }
-
-
- /**
- * Returns the current value of the attribute's "declared" flag.
- */
- // javadoc mostly from interface
- public boolean isDeclared (String uri, String localName)
- {
- int index = getIndex (uri, localName);
-
- if (index < 0)
- throw new IllegalArgumentException (
- "No such attribute: local=" + localName
- + ", namespace=" + uri);
- return declared [index];
- }
-
-
- /**
- * Returns the current value of the attribute's "declared" flag.
- */
- // javadoc mostly from interface
- public boolean isDeclared (String qName)
- {
- int index = getIndex (qName);
-
- if (index < 0)
- throw new IllegalArgumentException (
- "No such attribute: " + qName);
- return declared [index];
- }
-
-
- /**
- * Returns the current value of an attribute's "specified" flag.
- *
- * @param index The attribute index (zero-based).
- * @return current flag value
- * @exception java.lang.ArrayIndexOutOfBoundsException When the
- * supplied index does not identify an attribute.
- */
- public boolean isSpecified (int index)
- {
- if (index < 0 || index >= getLength ())
- throw new ArrayIndexOutOfBoundsException (
- "No attribute at index: " + index);
- return specified [index];
- }
-
-
- /**
- * Returns the current value of an attribute's "specified" flag.
- *
- * @param uri The Namespace URI, or the empty string if
- * the name has no Namespace URI.
- * @param localName The attribute's local name.
- * @return current flag value
- * @exception java.lang.IllegalArgumentException When the
- * supplied names do not identify an attribute.
- */
- public boolean isSpecified (String uri, String localName)
- {
- int index = getIndex (uri, localName);
-
- if (index < 0)
- throw new IllegalArgumentException (
- "No such attribute: local=" + localName
- + ", namespace=" + uri);
- return specified [index];
- }
-
-
- /**
- * Returns the current value of an attribute's "specified" flag.
- *
- * @param qName The XML qualified (prefixed) name.
- * @return current flag value
- * @exception java.lang.IllegalArgumentException When the
- * supplied name does not identify an attribute.
- */
- public boolean isSpecified (String qName)
- {
- int index = getIndex (qName);
-
- if (index < 0)
- throw new IllegalArgumentException (
- "No such attribute: " + qName);
- return specified [index];
- }
-
-
- ////////////////////////////////////////////////////////////////////
- // Manipulators
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Copy an entire Attributes object. The "specified" flags are
- * assigned as true, and "declared" flags as false (except when
- * an attribute's type is not CDATA),
- * unless the object is an Attributes2 object.
- * In that case those flag values are all copied.
- *
- * @see AttributesImpl#setAttributes
- */
- public void setAttributes (Attributes atts)
- {
- int length = atts.getLength ();
-
- super.setAttributes (atts);
- declared = new boolean [length];
- specified = new boolean [length];
-
- if (atts instanceof Attributes2) {
- Attributes2 a2 = (Attributes2) atts;
- for (int i = 0; i < length; i++) {
- declared [i] = a2.isDeclared (i);
- specified [i] = a2.isSpecified (i);
- }
- } else {
- for (int i = 0; i < length; i++) {
- declared [i] = !"CDATA".equals (atts.getType (i));
- specified [i] = true;
- }
- }
- }
-
-
- /**
- * Add an attribute to the end of the list, setting its
- * "specified" flag to true. To set that flag's value
- * to false, use {@link #setSpecified}.
- *
- * <p>Unless the attribute <em>type</em> is CDATA, this attribute
- * is marked as being declared in the DTD. To set that flag's value
- * to true for CDATA attributes, use {@link #setDeclared}.
- *
- * @see AttributesImpl#addAttribute
- */
- public void addAttribute (String uri, String localName, String qName,
- String type, String value)
- {
- super.addAttribute (uri, localName, qName, type, value);
-
-
- int length = getLength ();
- if(specified==null)
- {
- specified = new boolean[length];
- declared = new boolean[length];
- } else if (length > specified.length) {
- boolean newFlags [];
-
- newFlags = new boolean [length];
- System.arraycopy (declared, 0, newFlags, 0, declared.length);
- declared = newFlags;
-
- newFlags = new boolean [length];
- System.arraycopy (specified, 0, newFlags, 0, specified.length);
- specified = newFlags;
- }
-
- specified [length - 1] = true;
- declared [length - 1] = !"CDATA".equals (type);
- }
-
-
- // javadoc entirely from superclass
- public void removeAttribute (int index)
- {
- int origMax = getLength () - 1;
-
- super.removeAttribute (index);
- if (index != origMax) {
- System.arraycopy (declared, index + 1, declared, index,
- origMax - index);
- System.arraycopy (specified, index + 1, specified, index,
- origMax - index);
- }
- }
-
-
- /**
- * Assign a value to the "declared" flag of a specific attribute.
- * This is normally needed only for attributes of type CDATA,
- * including attributes whose type is changed to or from CDATA.
- *
- * @param index The index of the attribute (zero-based).
- * @param value The desired flag value.
- * @exception java.lang.ArrayIndexOutOfBoundsException When the
- * supplied index does not identify an attribute.
- * @see #setType
- */
- public void setDeclared (int index, boolean value)
- {
- if (index < 0 || index >= getLength ())
- throw new ArrayIndexOutOfBoundsException (
- "No attribute at index: " + index);
- declared [index] = value;
- }
-
-
- /**
- * Assign a value to the "specified" flag of a specific attribute.
- * This is the only way this flag can be cleared, except clearing
- * by initialization with the copy constructor.
- *
- * @param index The index of the attribute (zero-based).
- * @param value The desired flag value.
- * @exception java.lang.ArrayIndexOutOfBoundsException When the
- * supplied index does not identify an attribute.
- */
- public void setSpecified (int index, boolean value)
- {
- if (index < 0 || index >= getLength ())
- throw new ArrayIndexOutOfBoundsException (
- "No attribute at index: " + index);
- specified [index] = value;
- }
-}
diff --git a/src/org/xml/sax/ext/DeclHandler.java b/src/org/xml/sax/ext/DeclHandler.java
deleted file mode 100644
index b2c72c5..0000000
--- a/src/org/xml/sax/ext/DeclHandler.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-// DeclHandler.java - Optional handler for DTD declaration events.
-// http://www.saxproject.org
-// Public Domain: no warranty.
-// $Id: DeclHandler.java,v 1.2 2004/11/03 22:49:08 jsuttor Exp $
-
-package org.xml.sax.ext;
-
-import org.xml.sax.SAXException;
-
-
-/**
- * SAX2 extension handler for DTD declaration events.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>This is an optional extension handler for SAX2 to provide more
- * complete information about DTD declarations in an XML document.
- * XML readers are not required to recognize this handler, and it
- * is not part of core-only SAX2 distributions.</p>
- *
- * <p>Note that data-related DTD declarations (unparsed entities and
- * notations) are already reported through the {@link
- * org.xml.sax.DTDHandler DTDHandler} interface.</p>
- *
- * <p>If you are using the declaration handler together with a lexical
- * handler, all of the events will occur between the
- * {@link org.xml.sax.ext.LexicalHandler#startDTD startDTD} and the
- * {@link org.xml.sax.ext.LexicalHandler#endDTD endDTD} events.</p>
- *
- * <p>To set the DeclHandler for an XML reader, use the
- * {@link org.xml.sax.XMLReader#setProperty setProperty} method
- * with the property name
- * <code>http://xml.org/sax/properties/declaration-handler</code>
- * and an object implementing this interface (or null) as the value.
- * If the reader does not report declaration events, it will throw a
- * {@link org.xml.sax.SAXNotRecognizedException SAXNotRecognizedException}
- * when you attempt to register the handler.</p>
- *
- * @since SAX 2.0 (extensions 1.0)
- * @author David Megginson
- */
-public interface DeclHandler
-{
-
- /**
- * Report an element type declaration.
- *
- * <p>The content model will consist of the string "EMPTY", the
- * string "ANY", or a parenthesised group, optionally followed
- * by an occurrence indicator. The model will be normalized so
- * that all parameter entities are fully resolved and all whitespace
- * is removed,and will include the enclosing parentheses. Other
- * normalization (such as removing redundant parentheses or
- * simplifying occurrence indicators) is at the discretion of the
- * parser.</p>
- *
- * @param name The element type name.
- * @param model The content model as a normalized string.
- * @exception SAXException The application may raise an exception.
- */
- public abstract void elementDecl (String name, String model)
- throws SAXException;
-
-
- /**
- * Report an attribute type declaration.
- *
- * <p>Only the effective (first) declaration for an attribute will
- * be reported. The type will be one of the strings "CDATA",
- * "ID", "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY",
- * "ENTITIES", a parenthesized token group with
- * the separator "|" and all whitespace removed, or the word
- * "NOTATION" followed by a space followed by a parenthesized
- * token group with all whitespace removed.</p>
- *
- * <p>The value will be the value as reported to applications,
- * appropriately normalized and with entity and character
- * references expanded. </p>
- *
- * @param eName The name of the associated element.
- * @param aName The name of the attribute.
- * @param type A string representing the attribute type.
- * @param mode A string representing the attribute defaulting mode
- * ("#IMPLIED", "#REQUIRED", or "#FIXED") or null if
- * none of these applies.
- * @param value A string representing the attribute's default value,
- * or null if there is none.
- * @exception SAXException The application may raise an exception.
- */
- public abstract void attributeDecl (String eName,
- String aName,
- String type,
- String mode,
- String value)
- throws SAXException;
-
-
- /**
- * Report an internal entity declaration.
- *
- * <p>Only the effective (first) declaration for each entity
- * will be reported. All parameter entities in the value
- * will be expanded, but general entities will not.</p>
- *
- * @param name The name of the entity. If it is a parameter
- * entity, the name will begin with '%'.
- * @param value The replacement text of the entity.
- * @exception SAXException The application may raise an exception.
- * @see #externalEntityDecl
- * @see org.xml.sax.DTDHandler#unparsedEntityDecl
- */
- public abstract void internalEntityDecl (String name, String value)
- throws SAXException;
-
-
- /**
- * Report a parsed external entity declaration.
- *
- * <p>Only the effective (first) declaration for each entity
- * will be reported.</p>
- *
- * <p>If the system identifier is a URL, the parser must resolve it
- * fully before passing it to the application.</p>
- *
- * @param name The name of the entity. If it is a parameter
- * entity, the name will begin with '%'.
- * @param publicId The entity's public identifier, or null if none
- * was given.
- * @param systemId The entity's system identifier.
- * @exception SAXException The application may raise an exception.
- * @see #internalEntityDecl
- * @see org.xml.sax.DTDHandler#unparsedEntityDecl
- */
- public abstract void externalEntityDecl (String name, String publicId,
- String systemId)
- throws SAXException;
-
-}
-
-// end of DeclHandler.java
diff --git a/src/org/xml/sax/ext/DefaultHandler2.java b/src/org/xml/sax/ext/DefaultHandler2.java
deleted file mode 100644
index cb7a91a..0000000
--- a/src/org/xml/sax/ext/DefaultHandler2.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-// DefaultHandler2.java - extended DefaultHandler
-// http://www.saxproject.org
-// Public Domain: no warranty.
-// $Id: DefaultHandler2.java,v 1.2 2004/11/03 22:49:08 jsuttor Exp $
-
-package org.xml.sax.ext;
-
-import java.io.IOException;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-
-
-/**
- * This class extends the SAX2 base handler class to support the
- * SAX2 {@link LexicalHandler}, {@link DeclHandler}, and
- * {@link EntityResolver2} extensions. Except for overriding the
- * original SAX1 {@link DefaultHandler#resolveEntity resolveEntity()}
- * method the added handler methods just return. Subclassers may
- * override everything on a method-by-method basis.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * </blockquote>
- *
- * <p> <em>Note:</em> this class might yet learn that the
- * <em>ContentHandler.setDocumentLocator()</em> call might be passed a
- * {@link Locator2} object, and that the
- * <em>ContentHandler.startElement()</em> call might be passed a
- * {@link Attributes2} object.
- *
- * @since SAX 2.0 (extensions 1.1 alpha)
- * @author David Brownell
- */
-public class DefaultHandler2 extends DefaultHandler
- implements LexicalHandler, DeclHandler, EntityResolver2
-{
- /** Constructs a handler which ignores all parsing events. */
- public DefaultHandler2 () { }
-
-
- // SAX2 ext-1.0 LexicalHandler
-
- public void startCDATA ()
- throws SAXException
- {}
-
- public void endCDATA ()
- throws SAXException
- {}
-
- public void startDTD (String name, String publicId, String systemId)
- throws SAXException
- {}
-
- public void endDTD ()
- throws SAXException
- {}
-
- public void startEntity (String name)
- throws SAXException
- {}
-
- public void endEntity (String name)
- throws SAXException
- {}
-
- public void comment (char ch [], int start, int length)
- throws SAXException
- { }
-
-
- // SAX2 ext-1.0 DeclHandler
-
- public void attributeDecl (String eName, String aName,
- String type, String mode, String value)
- throws SAXException
- {}
-
- public void elementDecl (String name, String model)
- throws SAXException
- {}
-
- public void externalEntityDecl (String name,
- String publicId, String systemId)
- throws SAXException
- {}
-
- public void internalEntityDecl (String name, String value)
- throws SAXException
- {}
-
- // SAX2 ext-1.1 EntityResolver2
-
- /**
- * Tells the parser that if no external subset has been declared
- * in the document text, none should be used.
- */
- public InputSource getExternalSubset (String name, String baseURI)
- throws SAXException, IOException
- { return null; }
-
- /**
- * Tells the parser to resolve the systemId against the baseURI
- * and read the entity text from that resulting absolute URI.
- * Note that because the older
- * {@link DefaultHandler#resolveEntity DefaultHandler.resolveEntity()},
- * method is overridden to call this one, this method may sometimes
- * be invoked with null <em>name</em> and <em>baseURI</em>, and
- * with the <em>systemId</em> already absolutized.
- */
- public InputSource resolveEntity (String name, String publicId,
- String baseURI, String systemId)
- throws SAXException, IOException
- { return null; }
-
- // SAX1 EntityResolver
-
- /**
- * Invokes
- * {@link EntityResolver2#resolveEntity EntityResolver2.resolveEntity()}
- * with null entity name and base URI.
- * You only need to override that method to use this class.
- */
- public InputSource resolveEntity (String publicId, String systemId)
- throws SAXException, IOException
- { return resolveEntity (null, publicId, null, systemId); }
-}
diff --git a/src/org/xml/sax/ext/EntityResolver2.java b/src/org/xml/sax/ext/EntityResolver2.java
deleted file mode 100644
index dbd1242..0000000
--- a/src/org/xml/sax/ext/EntityResolver2.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
- * Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-// EntityResolver2.java - Extended SAX entity resolver.
-// http://www.saxproject.org
-// No warranty; no copyright -- use this as you will.
-// $Id: EntityResolver2.java,v 1.2 2004/11/03 22:49:08 jsuttor Exp $
-
-package org.xml.sax.ext;
-
-import java.io.IOException;
-
-import org.xml.sax.EntityResolver;
-import org.xml.sax.InputSource;
-import org.xml.sax.XMLReader;
-import org.xml.sax.SAXException;
-
-
-/**
- * Extended interface for mapping external entity references to input
- * sources, or providing a missing external subset. The
- * {@link XMLReader#setEntityResolver XMLReader.setEntityResolver()} method
- * is used to provide implementations of this interface to parsers.
- * When a parser uses the methods in this interface, the
- * {@link EntityResolver2#resolveEntity EntityResolver2.resolveEntity()}
- * method (in this interface) is used <em>instead of</em> the older (SAX 1.0)
- * {@link EntityResolver#resolveEntity EntityResolver.resolveEntity()} method.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * </blockquote>
- *
- * <p>If a SAX application requires the customized handling which this
- * interface defines for external entities, it must ensure that it uses
- * an XMLReader with the
- * <em>http://xml.org/sax/features/use-entity-resolver2</em> feature flag
- * set to <em>true</em> (which is its default value when the feature is
- * recognized). If that flag is unrecognized, or its value is false,
- * or the resolver does not implement this interface, then only the
- * {@link EntityResolver} method will be used.
- * </p>
- *
- * <p>That supports three categories of application that modify entity
- * resolution. <em>Old Style</em> applications won't know about this interface;
- * they will provide an EntityResolver.
- * <em>Transitional Mode</em> provide an EntityResolver2 and automatically
- * get the benefit of its methods in any systems (parsers or other tools)
- * supporting it, due to polymorphism.
- * Both <em>Old Style</em> and <em>Transitional Mode</em> applications will
- * work with any SAX2 parser.
- * <em>New style</em> applications will fail to run except on SAX2 parsers
- * that support this particular feature.
- * They will insist that feature flag have a value of "true", and the
- * EntityResolver2 implementation they provide might throw an exception
- * if the original SAX 1.0 style entity resolution method is invoked.
- * </p>
- *
- * @see org.xml.sax.XMLReader#setEntityResolver
- *
- * @since SAX 2.0 (extensions 1.1 alpha)
- * @author David Brownell
- */
-public interface EntityResolver2 extends EntityResolver
-{
- /**
- * Allows applications to provide an external subset for documents
- * that don't explicitly define one. Documents with DOCTYPE declarations
- * that omit an external subset can thus augment the declarations
- * available for validation, entity processing, and attribute processing
- * (normalization, defaulting, and reporting types including ID).
- * This augmentation is reported
- * through the {@link LexicalHandler#startDTD startDTD()} method as if
- * the document text had originally included the external subset;
- * this callback is made before any internal subset data or errors
- * are reported.</p>
- *
- * <p>This method can also be used with documents that have no DOCTYPE
- * declaration. When the root element is encountered,
- * but no DOCTYPE declaration has been seen, this method is
- * invoked. If it returns a value for the external subset, that root
- * element is declared to be the root element, giving the effect of
- * splicing a DOCTYPE declaration at the end the prolog of a document
- * that could not otherwise be valid. The sequence of parser callbacks
- * in that case logically resembles this:</p>
- *
- * <pre>
- * ... comments and PIs from the prolog (as usual)
- * startDTD ("rootName", source.getPublicId (), source.getSystemId ());
- * startEntity ("[dtd]");
- * ... declarations, comments, and PIs from the external subset
- * endEntity ("[dtd]");
- * endDTD ();
- * ... then the rest of the document (as usual)
- * startElement (..., "rootName", ...);
- * </pre>
- *
- * <p>Note that the InputSource gets no further resolution.
- * Implementations of this method may wish to invoke
- * {@link #resolveEntity resolveEntity()} to gain benefits such as use
- * of local caches of DTD entities. Also, this method will never be
- * used by a (non-validating) processor that is not including external
- * parameter entities. </p>
- *
- * <p>Uses for this method include facilitating data validation when
- * interoperating with XML processors that would always require
- * undesirable network accesses for external entities, or which for
- * other reasons adopt a "no DTDs" policy.
- * Non-validation motives include forcing documents to include DTDs so
- * that attributes are handled consistently.
- * For example, an XPath processor needs to know which attibutes have
- * type "ID" before it can process a widely used type of reference.</p>
- *
- * <p><strong>Warning:</strong> Returning an external subset modifies
- * the input document. By providing definitions for general entities,
- * it can make a malformed document appear to be well formed.
- * </p>
- *
- * @param name Identifies the document root element. This name comes
- * from a DOCTYPE declaration (where available) or from the actual
- * root element.
- * @param baseURI The document's base URI, serving as an additional
- * hint for selecting the external subset. This is always an absolute
- * URI, unless it is null because the XMLReader was given an InputSource
- * without one.
- *
- * @return An InputSource object describing the new external subset
- * to be used by the parser, or null to indicate that no external
- * subset is provided.
- *
- * @exception SAXException Any SAX exception, possibly wrapping
- * another exception.
- * @exception IOException Probably indicating a failure to create
- * a new InputStream or Reader, or an illegal URL.
- */
- public InputSource getExternalSubset (String name, String baseURI)
- throws SAXException, IOException;
-
- /**
- * Allows applications to map references to external entities into input
- * sources, or tell the parser it should use conventional URI resolution.
- * This method is only called for external entities which have been
- * properly declared.
- * This method provides more flexibility than the {@link EntityResolver}
- * interface, supporting implementations of more complex catalogue
- * schemes such as the one defined by the <a href=
- "http://www.oasis-open.org/committees/entity/spec-2001-08-06.html"
- >OASIS XML Catalogs</a> specification.</p>
- *
- * <p>Parsers configured to use this resolver method will call it
- * to determine the input source to use for any external entity
- * being included because of a reference in the XML text.
- * That excludes the document entity, and any external entity returned
- * by {@link #getExternalSubset getExternalSubset()}.
- * When a (non-validating) processor is configured not to include
- * a class of entities (parameter or general) through use of feature
- * flags, this method is not invoked for such entities. </p>
- *
- * <p>Note that the entity naming scheme used here is the same one
- * used in the {@link LexicalHandler}, or in the {@link
- org.xml.sax.ContentHandler#skippedEntity
- ContentHandler.skippedEntity()}
- * method. </p>
- *
- * @param name Identifies the external entity being resolved.
- * Either "[dtd]" for the external subset, or a name starting
- * with "%" to indicate a parameter entity, or else the name of
- * a general entity. This is never null when invoked by a SAX2
- * parser.
- * @param publicId The public identifier of the external entity being
- * referenced (normalized as required by the XML specification), or
- * null if none was supplied.
- * @param baseURI The URI with respect to which relative systemIDs
- * are interpreted. This is always an absolute URI, unless it is
- * null (likely because the XMLReader was given an InputSource without
- * one). This URI is defined by the XML specification to be the one
- * associated with the "&lt;" starting the relevant declaration.
- * @param systemId The system identifier of the external entity
- * being referenced; either a relative or absolute URI.
- * This is never null when invoked by a SAX2 parser; only declared
- * entities, and any external subset, are resolved by such parsers.
- *
- * @return An InputSource object describing the new input source to
- * be used by the parser. Returning null directs the parser to
- * resolve the system ID against the base URI and open a connection
- * to resulting URI.
- *
- * @exception SAXException Any SAX exception, possibly wrapping
- * another exception.
- * @exception IOException Probably indicating a failure to create
- * a new InputStream or Reader, or an illegal URL.
- */
- public InputSource resolveEntity (
- String name,
- String publicId,
- String baseURI,
- String systemId
- ) throws SAXException, IOException;
-}
diff --git a/src/org/xml/sax/ext/LexicalHandler.java b/src/org/xml/sax/ext/LexicalHandler.java
deleted file mode 100644
index dccecee..0000000
--- a/src/org/xml/sax/ext/LexicalHandler.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-// LexicalHandler.java - optional handler for lexical parse events.
-// http://www.saxproject.org
-// Public Domain: no warranty.
-// $Id: LexicalHandler.java,v 1.2 2004/11/03 22:49:08 jsuttor Exp $
-
-package org.xml.sax.ext;
-
-import org.xml.sax.SAXException;
-
-/**
- * SAX2 extension handler for lexical events.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>This is an optional extension handler for SAX2 to provide
- * lexical information about an XML document, such as comments
- * and CDATA section boundaries.
- * XML readers are not required to recognize this handler, and it
- * is not part of core-only SAX2 distributions.</p>
- *
- * <p>The events in the lexical handler apply to the entire document,
- * not just to the document element, and all lexical handler events
- * must appear between the content handler's startDocument and
- * endDocument events.</p>
- *
- * <p>To set the LexicalHandler for an XML reader, use the
- * {@link org.xml.sax.XMLReader#setProperty setProperty} method
- * with the property name
- * <code>http://xml.org/sax/properties/lexical-handler</code>
- * and an object implementing this interface (or null) as the value.
- * If the reader does not report lexical events, it will throw a
- * {@link org.xml.sax.SAXNotRecognizedException SAXNotRecognizedException}
- * when you attempt to register the handler.</p>
- *
- * @since SAX 2.0 (extensions 1.0)
- * @author David Megginson
- */
-public interface LexicalHandler
-{
-
- /**
- * Report the start of DTD declarations, if any.
- *
- * <p>This method is intended to report the beginning of the
- * DOCTYPE declaration; if the document has no DOCTYPE declaration,
- * this method will not be invoked.</p>
- *
- * <p>All declarations reported through
- * {@link org.xml.sax.DTDHandler DTDHandler} or
- * {@link org.xml.sax.ext.DeclHandler DeclHandler} events must appear
- * between the startDTD and {@link #endDTD endDTD} events.
- * Declarations are assumed to belong to the internal DTD subset
- * unless they appear between {@link #startEntity startEntity}
- * and {@link #endEntity endEntity} events. Comments and
- * processing instructions from the DTD should also be reported
- * between the startDTD and endDTD events, in their original
- * order of (logical) occurrence; they are not required to
- * appear in their correct locations relative to DTDHandler
- * or DeclHandler events, however.</p>
- *
- * <p>Note that the start/endDTD events will appear within
- * the start/endDocument events from ContentHandler and
- * before the first
- * {@link org.xml.sax.ContentHandler#startElement startElement}
- * event.</p>
- *
- * @param name The document type name.
- * @param publicId The declared public identifier for the
- * external DTD subset, or null if none was declared.
- * @param systemId The declared system identifier for the
- * external DTD subset, or null if none was declared.
- * (Note that this is not resolved against the document
- * base URI.)
- * @exception SAXException The application may raise an
- * exception.
- * @see #endDTD
- * @see #startEntity
- */
- public abstract void startDTD (String name, String publicId,
- String systemId)
- throws SAXException;
-
-
- /**
- * Report the end of DTD declarations.
- *
- * <p>This method is intended to report the end of the
- * DOCTYPE declaration; if the document has no DOCTYPE declaration,
- * this method will not be invoked.</p>
- *
- * @exception SAXException The application may raise an exception.
- * @see #startDTD
- */
- public abstract void endDTD ()
- throws SAXException;
-
-
- /**
- * Report the beginning of some internal and external XML entities.
- *
- * <p>The reporting of parameter entities (including
- * the external DTD subset) is optional, and SAX2 drivers that
- * report LexicalHandler events may not implement it; you can use the
- * <code
- * >http://xml.org/sax/features/lexical-handler/parameter-entities</code>
- * feature to query or control the reporting of parameter entities.</p>
- *
- * <p>General entities are reported with their regular names,
- * parameter entities have '%' prepended to their names, and
- * the external DTD subset has the pseudo-entity name "[dtd]".</p>
- *
- * <p>When a SAX2 driver is providing these events, all other
- * events must be properly nested within start/end entity
- * events. There is no additional requirement that events from
- * {@link org.xml.sax.ext.DeclHandler DeclHandler} or
- * {@link org.xml.sax.DTDHandler DTDHandler} be properly ordered.</p>
- *
- * <p>Note that skipped entities will be reported through the
- * {@link org.xml.sax.ContentHandler#skippedEntity skippedEntity}
- * event, which is part of the ContentHandler interface.</p>
- *
- * <p>Because of the streaming event model that SAX uses, some
- * entity boundaries cannot be reported under any
- * circumstances:</p>
- *
- * <ul>
- * <li>general entities within attribute values</li>
- * <li>parameter entities within declarations</li>
- * </ul>
- *
- * <p>These will be silently expanded, with no indication of where
- * the original entity boundaries were.</p>
- *
- * <p>Note also that the boundaries of character references (which
- * are not really entities anyway) are not reported.</p>
- *
- * <p>All start/endEntity events must be properly nested.
- *
- * @param name The name of the entity. If it is a parameter
- * entity, the name will begin with '%', and if it is the
- * external DTD subset, it will be "[dtd]".
- * @exception SAXException The application may raise an exception.
- * @see #endEntity
- * @see org.xml.sax.ext.DeclHandler#internalEntityDecl
- * @see org.xml.sax.ext.DeclHandler#externalEntityDecl
- */
- public abstract void startEntity (String name)
- throws SAXException;
-
-
- /**
- * Report the end of an entity.
- *
- * @param name The name of the entity that is ending.
- * @exception SAXException The application may raise an exception.
- * @see #startEntity
- */
- public abstract void endEntity (String name)
- throws SAXException;
-
-
- /**
- * Report the start of a CDATA section.
- *
- * <p>The contents of the CDATA section will be reported through
- * the regular {@link org.xml.sax.ContentHandler#characters
- * characters} event; this event is intended only to report
- * the boundary.</p>
- *
- * @exception SAXException The application may raise an exception.
- * @see #endCDATA
- */
- public abstract void startCDATA ()
- throws SAXException;
-
-
- /**
- * Report the end of a CDATA section.
- *
- * @exception SAXException The application may raise an exception.
- * @see #startCDATA
- */
- public abstract void endCDATA ()
- throws SAXException;
-
-
- /**
- * Report an XML comment anywhere in the document.
- *
- * <p>This callback will be used for comments inside or outside the
- * document element, including comments in the external DTD
- * subset (if read). Comments in the DTD must be properly
- * nested inside start/endDTD and start/endEntity events (if
- * used).</p>
- *
- * @param ch An array holding the characters in the comment.
- * @param start The starting position in the array.
- * @param length The number of characters to use from the array.
- * @exception SAXException The application may raise an exception.
- */
- public abstract void comment (char ch[], int start, int length)
- throws SAXException;
-
-}
-
-// end of LexicalHandler.java
diff --git a/src/org/xml/sax/ext/Locator2.java b/src/org/xml/sax/ext/Locator2.java
deleted file mode 100644
index c651a6e..0000000
--- a/src/org/xml/sax/ext/Locator2.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-// Locator2.java - extended Locator
-// http://www.saxproject.org
-// Public Domain: no warranty.
-// $Id: Locator2.java,v 1.2 2004/11/03 22:49:08 jsuttor Exp $
-
-package org.xml.sax.ext;
-
-import org.xml.sax.Locator;
-
-
-/**
- * SAX2 extension to augment the entity information provided
- * though a {@link Locator}.
- * If an implementation supports this extension, the Locator
- * provided in {@link org.xml.sax.ContentHandler#setDocumentLocator
- * ContentHandler.setDocumentLocator() } will implement this
- * interface, and the
- * <em>http://xml.org/sax/features/use-locator2</em> feature
- * flag will have the value <em>true</em>.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * </blockquote>
- *
- * <p> XMLReader implementations are not required to support this
- * information, and it is not part of core-only SAX2 distributions.</p>
- *
- * @since SAX 2.0 (extensions 1.1 alpha)
- * @author David Brownell
- */
-public interface Locator2 extends Locator
-{
- /**
- * Returns the version of XML used for the entity. This will
- * normally be the identifier from the current entity's
- * <em>&lt;?xml&nbsp;version='...'&nbsp;...?&gt;</em> declaration,
- * or be defaulted by the parser.
- *
- * @return Identifier for the XML version being used to interpret
- * the entity's text, or null if that information is not yet
- * available in the current parsing state.
- */
- public String getXMLVersion ();
-
- /**
- * Returns the name of the character encoding for the entity.
- * If the encoding was declared externally (for example, in a MIME
- * Content-Type header), that will be the name returned. Else if there
- * was an <em>&lt;?xml&nbsp;...encoding='...'?&gt;</em> declaration at
- * the start of the document, that encoding name will be returned.
- * Otherwise the encoding will been inferred (normally to be UTF-8, or
- * some UTF-16 variant), and that inferred name will be returned.
- *
- * <p>When an {@link org.xml.sax.InputSource InputSource} is used
- * to provide an entity's character stream, this method returns the
- * encoding provided in that input stream.
- *
- * <p> Note that some recent W3C specifications require that text
- * in some encodings be normalized, using Unicode Normalization
- * Form C, before processing. Such normalization must be performed
- * by applications, and would normally be triggered based on the
- * value returned by this method.
- *
- * <p> Encoding names may be those used by the underlying JVM,
- * and comparisons should be case-insensitive.
- *
- * @return Name of the character encoding being used to interpret
- * * the entity's text, or null if this was not provided for a *
- * character stream passed through an InputSource or is otherwise
- * not yet available in the current parsing state.
- */
- public String getEncoding ();
-}
diff --git a/src/org/xml/sax/ext/Locator2Impl.java b/src/org/xml/sax/ext/Locator2Impl.java
deleted file mode 100644
index d47b27e..0000000
--- a/src/org/xml/sax/ext/Locator2Impl.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-// Locator2Impl.java - extended LocatorImpl
-// http://www.saxproject.org
-// Public Domain: no warranty.
-// $Id: Locator2Impl.java,v 1.2 2004/11/03 22:49:08 jsuttor Exp $
-
-package org.xml.sax.ext;
-
-import org.xml.sax.Locator;
-import org.xml.sax.helpers.LocatorImpl;
-
-
-/**
- * SAX2 extension helper for holding additional Entity information,
- * implementing the {@link Locator2} interface.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * </blockquote>
- *
- * <p> This is not part of core-only SAX2 distributions.</p>
- *
- * @since SAX 2.0.2
- * @author David Brownell
- */
-public class Locator2Impl extends LocatorImpl implements Locator2
-{
- private String encoding;
- private String version;
-
-
- /**
- * Construct a new, empty Locator2Impl object.
- * This will not normally be useful, since the main purpose
- * of this class is to make a snapshot of an existing Locator.
- */
- public Locator2Impl () { }
-
- /**
- * Copy an existing Locator or Locator2 object.
- * If the object implements Locator2, values of the
- * <em>encoding</em> and <em>version</em>strings are copied,
- * otherwise they set to <em>null</em>.
- *
- * @param locator The existing Locator object.
- */
- public Locator2Impl (Locator locator)
- {
- super (locator);
- if (locator instanceof Locator2) {
- Locator2 l2 = (Locator2) locator;
-
- version = l2.getXMLVersion ();
- encoding = l2.getEncoding ();
- }
- }
-
- ////////////////////////////////////////////////////////////////////
- // Locator2 method implementations
- ////////////////////////////////////////////////////////////////////
-
- /**
- * Returns the current value of the version property.
- *
- * @see #setXMLVersion
- */
- public String getXMLVersion ()
- { return version; }
-
- /**
- * Returns the current value of the encoding property.
- *
- * @see #setEncoding
- */
- public String getEncoding ()
- { return encoding; }
-
-
- ////////////////////////////////////////////////////////////////////
- // Setters
- ////////////////////////////////////////////////////////////////////
-
- /**
- * Assigns the current value of the version property.
- *
- * @param version the new "version" value
- * @see #getXMLVersion
- */
- public void setXMLVersion (String version)
- { this.version = version; }
-
- /**
- * Assigns the current value of the encoding property.
- *
- * @param encoding the new "encoding" value
- * @see #getEncoding
- */
- public void setEncoding (String encoding)
- { this.encoding = encoding; }
-}
diff --git a/src/org/xml/sax/ext/package.html b/src/org/xml/sax/ext/package.html
deleted file mode 100644
index 74d63a5..0000000
--- a/src/org/xml/sax/ext/package.html
+++ /dev/null
@@ -1,46 +0,0 @@
-<HTML><HEAD>
-<!-- $Id: package.html,v 1.3 2007/10/02 19:32:24 ndw Exp $ -->
-</HEAD><BODY>
-
-<p>
-This package contains interfaces to SAX2 facilities that
-conformant SAX drivers won't necessarily support.
-
-<p>See <a target='_top' href='http://www.saxproject.org'>http://www.saxproject.org</a>
-for more information about SAX.</p>
-
-<p> This package is independent of the SAX2 core, though the functionality
-exposed generally needs to be implemented within a parser core.
-That independence has several consequences:</p>
-
-<ul>
-
-<li>SAX2 drivers are <em>not</em> required to recognize these handlers.
-</li>
-
-<li>You cannot assume that the class files will be present in every SAX2
-installation.</li>
-
-<li>This package may be updated independently of SAX2 (i.e. new
-handlers and classes may be added without updating SAX2 itself).</li>
-
-<li>The new handlers are not implemented by the SAX2
-<code>org.xml.sax.helpers.DefaultHandler</code> or
-<code>org.xml.sax.helpers.XMLFilterImpl</code> classes.
-You can subclass these if you need such behavior, or
-use the helper classes found here.</li>
-
-<li>The handlers need to be registered differently than core SAX2
-handlers.</li>
-
-</ul>
-
-<p>This package, SAX2-ext, is a standardized extension to SAX2. It is
-designed both to allow SAX parsers to pass certain types of information
-to applications, and to serve as a simple model for other SAX2 parser
-extension packages. Not all such extension packages should need to
-be recognized directly by parsers, however.
-As an example, most validation systems can be cleanly layered on top
-of parsers supporting the standardized SAX2 interfaces. </p>
-
-</BODY></HTML>
diff --git a/src/org/xml/sax/helpers/AttributeListImpl.java b/src/org/xml/sax/helpers/AttributeListImpl.java
deleted file mode 100644
index 93c111e..0000000
--- a/src/org/xml/sax/helpers/AttributeListImpl.java
+++ /dev/null
@@ -1,336 +0,0 @@
-/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-// SAX default implementation for AttributeList.
-// http://www.saxproject.org
-// No warranty; no copyright -- use this as you will.
-// $Id: AttributeListImpl.java,v 1.2 2004/11/03 22:53:08 jsuttor Exp $
-
-package org.xml.sax.helpers;
-
-import org.xml.sax.AttributeList;
-
-import java.util.Vector;
-
-
-/**
- * Default implementation for AttributeList.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>AttributeList implements the deprecated SAX1 {@link
- * org.xml.sax.AttributeList AttributeList} interface, and has been
- * replaced by the new SAX2 {@link org.xml.sax.helpers.AttributesImpl
- * AttributesImpl} interface.</p>
- *
- * <p>This class provides a convenience implementation of the SAX
- * {@link org.xml.sax.AttributeList AttributeList} interface. This
- * implementation is useful both for SAX parser writers, who can use
- * it to provide attributes to the application, and for SAX application
- * writers, who can use it to create a persistent copy of an element's
- * attribute specifications:</p>
- *
- * <pre>
- * private AttributeList myatts;
- *
- * public void startElement (String name, AttributeList atts)
- * {
- * // create a persistent copy of the attribute list
- * // for use outside this method
- * myatts = new AttributeListImpl(atts);
- * [...]
- * }
- * </pre>
- *
- * <p>Please note that SAX parsers are not required to use this
- * class to provide an implementation of AttributeList; it is
- * supplied only as an optional convenience. In particular,
- * parser writers are encouraged to invent more efficient
- * implementations.</p>
- *
- * @deprecated This class implements a deprecated interface,
- * {@link org.xml.sax.AttributeList AttributeList};
- * that interface has been replaced by
- * {@link org.xml.sax.Attributes Attributes},
- * which is implemented in the
- * {@link org.xml.sax.helpers.AttributesImpl
- * AttributesImpl} helper class.
- * @since SAX 1.0
- * @author David Megginson
- * @see org.xml.sax.AttributeList
- * @see org.xml.sax.DocumentHandler#startElement
- */
-public class AttributeListImpl implements AttributeList
-{
-
- /**
- * Create an empty attribute list.
- *
- * <p>This constructor is most useful for parser writers, who
- * will use it to create a single, reusable attribute list that
- * can be reset with the clear method between elements.</p>
- *
- * @see #addAttribute
- * @see #clear
- */
- public AttributeListImpl ()
- {
- }
-
-
- /**
- * Construct a persistent copy of an existing attribute list.
- *
- * <p>This constructor is most useful for application writers,
- * who will use it to create a persistent copy of an existing
- * attribute list.</p>
- *
- * @param atts The attribute list to copy
- * @see org.xml.sax.DocumentHandler#startElement
- */
- public AttributeListImpl (AttributeList atts)
- {
- setAttributeList(atts);
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Methods specific to this class.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Set the attribute list, discarding previous contents.
- *
- * <p>This method allows an application writer to reuse an
- * attribute list easily.</p>
- *
- * @param atts The attribute list to copy.
- */
- public void setAttributeList (AttributeList atts)
- {
- int count = atts.getLength();
-
- clear();
-
- for (int i = 0; i < count; i++) {
- addAttribute(atts.getName(i), atts.getType(i), atts.getValue(i));
- }
- }
-
-
- /**
- * Add an attribute to an attribute list.
- *
- * <p>This method is provided for SAX parser writers, to allow them
- * to build up an attribute list incrementally before delivering
- * it to the application.</p>
- *
- * @param name The attribute name.
- * @param type The attribute type ("NMTOKEN" for an enumeration).
- * @param value The attribute value (must not be null).
- * @see #removeAttribute
- * @see org.xml.sax.DocumentHandler#startElement
- */
- public void addAttribute (String name, String type, String value)
- {
- names.addElement(name);
- types.addElement(type);
- values.addElement(value);
- }
-
-
- /**
- * Remove an attribute from the list.
- *
- * <p>SAX application writers can use this method to filter an
- * attribute out of an AttributeList. Note that invoking this
- * method will change the length of the attribute list and
- * some of the attribute's indices.</p>
- *
- * <p>If the requested attribute is not in the list, this is
- * a no-op.</p>
- *
- * @param name The attribute name.
- * @see #addAttribute
- */
- public void removeAttribute (String name)
- {
- int i = names.indexOf(name);
-
- if (i >= 0) {
- names.removeElementAt(i);
- types.removeElementAt(i);
- values.removeElementAt(i);
- }
- }
-
-
- /**
- * Clear the attribute list.
- *
- * <p>SAX parser writers can use this method to reset the attribute
- * list between DocumentHandler.startElement events. Normally,
- * it will make sense to reuse the same AttributeListImpl object
- * rather than allocating a new one each time.</p>
- *
- * @see org.xml.sax.DocumentHandler#startElement
- */
- public void clear ()
- {
- names.removeAllElements();
- types.removeAllElements();
- values.removeAllElements();
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Implementation of org.xml.sax.AttributeList
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Return the number of attributes in the list.
- *
- * @return The number of attributes in the list.
- * @see org.xml.sax.AttributeList#getLength
- */
- public int getLength ()
- {
- return names.size();
- }
-
-
- /**
- * Get the name of an attribute (by position).
- *
- * @param i The position of the attribute in the list.
- * @return The attribute name as a string, or null if there
- * is no attribute at that position.
- * @see org.xml.sax.AttributeList#getName(int)
- */
- public String getName (int i)
- {
- if (i < 0) {
- return null;
- }
- try {
- return (String)names.elementAt(i);
- } catch (ArrayIndexOutOfBoundsException e) {
- return null;
- }
- }
-
-
- /**
- * Get the type of an attribute (by position).
- *
- * @param i The position of the attribute in the list.
- * @return The attribute type as a string ("NMTOKEN" for an
- * enumeration, and "CDATA" if no declaration was
- * read), or null if there is no attribute at
- * that position.
- * @see org.xml.sax.AttributeList#getType(int)
- */
- public String getType (int i)
- {
- if (i < 0) {
- return null;
- }
- try {
- return (String)types.elementAt(i);
- } catch (ArrayIndexOutOfBoundsException e) {
- return null;
- }
- }
-
-
- /**
- * Get the value of an attribute (by position).
- *
- * @param i The position of the attribute in the list.
- * @return The attribute value as a string, or null if
- * there is no attribute at that position.
- * @see org.xml.sax.AttributeList#getValue(int)
- */
- public String getValue (int i)
- {
- if (i < 0) {
- return null;
- }
- try {
- return (String)values.elementAt(i);
- } catch (ArrayIndexOutOfBoundsException e) {
- return null;
- }
- }
-
-
- /**
- * Get the type of an attribute (by name).
- *
- * @param name The attribute name.
- * @return The attribute type as a string ("NMTOKEN" for an
- * enumeration, and "CDATA" if no declaration was
- * read).
- * @see org.xml.sax.AttributeList#getType(java.lang.String)
- */
- public String getType (String name)
- {
- return getType(names.indexOf(name));
- }
-
-
- /**
- * Get the value of an attribute (by name).
- *
- * @param name The attribute name.
- * @see org.xml.sax.AttributeList#getValue(java.lang.String)
- */
- public String getValue (String name)
- {
- return getValue(names.indexOf(name));
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Internal state.
- ////////////////////////////////////////////////////////////////////
-
- Vector names = new Vector();
- Vector types = new Vector();
- Vector values = new Vector();
-
-}
-
-// end of AttributeListImpl.java
diff --git a/src/org/xml/sax/helpers/AttributesImpl.java b/src/org/xml/sax/helpers/AttributesImpl.java
deleted file mode 100644
index fc5e953..0000000
--- a/src/org/xml/sax/helpers/AttributesImpl.java
+++ /dev/null
@@ -1,641 +0,0 @@
-/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-// AttributesImpl.java - default implementation of Attributes.
-// http://www.saxproject.org
-// Written by David Megginson
-// NO WARRANTY! This class is in the public domain.
-// $Id: AttributesImpl.java,v 1.2 2004/11/03 22:53:08 jsuttor Exp $
-
-package org.xml.sax.helpers;
-
-import org.xml.sax.Attributes;
-
-
-/**
- * Default implementation of the Attributes interface.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>This class provides a default implementation of the SAX2
- * {@link org.xml.sax.Attributes Attributes} interface, with the
- * addition of manipulators so that the list can be modified or
- * reused.</p>
- *
- * <p>There are two typical uses of this class:</p>
- *
- * <ol>
- * <li>to take a persistent snapshot of an Attributes object
- * in a {@link org.xml.sax.ContentHandler#startElement startElement} event; or</li>
- * <li>to construct or modify an Attributes object in a SAX2 driver or filter.</li>
- * </ol>
- *
- * <p>This class replaces the now-deprecated SAX1 {@link
- * org.xml.sax.helpers.AttributeListImpl AttributeListImpl}
- * class; in addition to supporting the updated Attributes
- * interface rather than the deprecated {@link org.xml.sax.AttributeList
- * AttributeList} interface, it also includes a much more efficient
- * implementation using a single array rather than a set of Vectors.</p>
- *
- * @since SAX 2.0
- * @author David Megginson
- */
-public class AttributesImpl implements Attributes
-{
-
-
- ////////////////////////////////////////////////////////////////////
- // Constructors.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Construct a new, empty AttributesImpl object.
- */
- public AttributesImpl ()
- {
- length = 0;
- data = null;
- }
-
-
- /**
- * Copy an existing Attributes object.
- *
- * <p>This constructor is especially useful inside a
- * {@link org.xml.sax.ContentHandler#startElement startElement} event.</p>
- *
- * @param atts The existing Attributes object.
- */
- public AttributesImpl (Attributes atts)
- {
- setAttributes(atts);
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Implementation of org.xml.sax.Attributes.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Return the number of attributes in the list.
- *
- * @return The number of attributes in the list.
- * @see org.xml.sax.Attributes#getLength
- */
- public int getLength ()
- {
- return length;
- }
-
-
- /**
- * Return an attribute's Namespace URI.
- *
- * @param index The attribute's index (zero-based).
- * @return The Namespace URI, the empty string if none is
- * available, or null if the index is out of range.
- * @see org.xml.sax.Attributes#getURI
- */
- public String getURI (int index)
- {
- if (index >= 0 && index < length) {
- return data[index*5];
- } else {
- return null;
- }
- }
-
-
- /**
- * Return an attribute's local name.
- *
- * @param index The attribute's index (zero-based).
- * @return The attribute's local name, the empty string if
- * none is available, or null if the index if out of range.
- * @see org.xml.sax.Attributes#getLocalName
- */
- public String getLocalName (int index)
- {
- if (index >= 0 && index < length) {
- return data[index*5+1];
- } else {
- return null;
- }
- }
-
-
- /**
- * Return an attribute's qualified (prefixed) name.
- *
- * @param index The attribute's index (zero-based).
- * @return The attribute's qualified name, the empty string if
- * none is available, or null if the index is out of bounds.
- * @see org.xml.sax.Attributes#getQName
- */
- public String getQName (int index)
- {
- if (index >= 0 && index < length) {
- return data[index*5+2];
- } else {
- return null;
- }
- }
-
-
- /**
- * Return an attribute's type by index.
- *
- * @param index The attribute's index (zero-based).
- * @return The attribute's type, "CDATA" if the type is unknown, or null
- * if the index is out of bounds.
- * @see org.xml.sax.Attributes#getType(int)
- */
- public String getType (int index)
- {
- if (index >= 0 && index < length) {
- return data[index*5+3];
- } else {
- return null;
- }
- }
-
-
- /**
- * Return an attribute's value by index.
- *
- * @param index The attribute's index (zero-based).
- * @return The attribute's value or null if the index is out of bounds.
- * @see org.xml.sax.Attributes#getValue(int)
- */
- public String getValue (int index)
- {
- if (index >= 0 && index < length) {
- return data[index*5+4];
- } else {
- return null;
- }
- }
-
-
- /**
- * Look up an attribute's index by Namespace name.
- *
- * <p>In many cases, it will be more efficient to look up the name once and
- * use the index query methods rather than using the name query methods
- * repeatedly.</p>
- *
- * @param uri The attribute's Namespace URI, or the empty
- * string if none is available.
- * @param localName The attribute's local name.
- * @return The attribute's index, or -1 if none matches.
- * @see org.xml.sax.Attributes#getIndex(java.lang.String,java.lang.String)
- */
- public int getIndex (String uri, String localName)
- {
- int max = length * 5;
- for (int i = 0; i < max; i += 5) {
- if (data[i].equals(uri) && data[i+1].equals(localName)) {
- return i / 5;
- }
- }
- return -1;
- }
-
-
- /**
- * Look up an attribute's index by qualified (prefixed) name.
- *
- * @param qName The qualified name.
- * @return The attribute's index, or -1 if none matches.
- * @see org.xml.sax.Attributes#getIndex(java.lang.String)
- */
- public int getIndex (String qName)
- {
- int max = length * 5;
- for (int i = 0; i < max; i += 5) {
- if (data[i+2].equals(qName)) {
- return i / 5;
- }
- }
- return -1;
- }
-
-
- /**
- * Look up an attribute's type by Namespace-qualified name.
- *
- * @param uri The Namespace URI, or the empty string for a name
- * with no explicit Namespace URI.
- * @param localName The local name.
- * @return The attribute's type, or null if there is no
- * matching attribute.
- * @see org.xml.sax.Attributes#getType(java.lang.String,java.lang.String)
- */
- public String getType (String uri, String localName)
- {
- int max = length * 5;
- for (int i = 0; i < max; i += 5) {
- if (data[i].equals(uri) && data[i+1].equals(localName)) {
- return data[i+3];
- }
- }
- return null;
- }
-
-
- /**
- * Look up an attribute's type by qualified (prefixed) name.
- *
- * @param qName The qualified name.
- * @return The attribute's type, or null if there is no
- * matching attribute.
- * @see org.xml.sax.Attributes#getType(java.lang.String)
- */
- public String getType (String qName)
- {
- int max = length * 5;
- for (int i = 0; i < max; i += 5) {
- if (data[i+2].equals(qName)) {
- return data[i+3];
- }
- }
- return null;
- }
-
-
- /**
- * Look up an attribute's value by Namespace-qualified name.
- *
- * @param uri The Namespace URI, or the empty string for a name
- * with no explicit Namespace URI.
- * @param localName The local name.
- * @return The attribute's value, or null if there is no
- * matching attribute.
- * @see org.xml.sax.Attributes#getValue(java.lang.String,java.lang.String)
- */
- public String getValue (String uri, String localName)
- {
- int max = length * 5;
- for (int i = 0; i < max; i += 5) {
- if (data[i].equals(uri) && data[i+1].equals(localName)) {
- return data[i+4];
- }
- }
- return null;
- }
-
-
- /**
- * Look up an attribute's value by qualified (prefixed) name.
- *
- * @param qName The qualified name.
- * @return The attribute's value, or null if there is no
- * matching attribute.
- * @see org.xml.sax.Attributes#getValue(java.lang.String)
- */
- public String getValue (String qName)
- {
- int max = length * 5;
- for (int i = 0; i < max; i += 5) {
- if (data[i+2].equals(qName)) {
- return data[i+4];
- }
- }
- return null;
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Manipulators.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Clear the attribute list for reuse.
- *
- * <p>Note that little memory is freed by this call:
- * the current array is kept so it can be
- * reused.</p>
- */
- public void clear ()
- {
- if (data != null) {
- for (int i = 0; i < (length * 5); i++)
- data [i] = null;
- }
- length = 0;
- }
-
-
- /**
- * Copy an entire Attributes object.
- *
- * <p>It may be more efficient to reuse an existing object
- * rather than constantly allocating new ones.</p>
- *
- * @param atts The attributes to copy.
- */
- public void setAttributes (Attributes atts)
- {
- clear();
- length = atts.getLength();
- if (length > 0) {
- data = new String[length*5];
- for (int i = 0; i < length; i++) {
- data[i*5] = atts.getURI(i);
- data[i*5+1] = atts.getLocalName(i);
- data[i*5+2] = atts.getQName(i);
- data[i*5+3] = atts.getType(i);
- data[i*5+4] = atts.getValue(i);
- }
- }
- }
-
-
- /**
- * Add an attribute to the end of the list.
- *
- * <p>For the sake of speed, this method does no checking
- * to see if the attribute is already in the list: that is
- * the responsibility of the application.</p>
- *
- * @param uri The Namespace URI, or the empty string if
- * none is available or Namespace processing is not
- * being performed.
- * @param localName The local name, or the empty string if
- * Namespace processing is not being performed.
- * @param qName The qualified (prefixed) name, or the empty string
- * if qualified names are not available.
- * @param type The attribute type as a string.
- * @param value The attribute value.
- */
- public void addAttribute (String uri, String localName, String qName,
- String type, String value)
- {
- ensureCapacity(length+1);
- data[length*5] = uri;
- data[length*5+1] = localName;
- data[length*5+2] = qName;
- data[length*5+3] = type;
- data[length*5+4] = value;
- length++;
- }
-
-
- /**
- * Set an attribute in the list.
- *
- * <p>For the sake of speed, this method does no checking
- * for name conflicts or well-formedness: such checks are the
- * responsibility of the application.</p>
- *
- * @param index The index of the attribute (zero-based).
- * @param uri The Namespace URI, or the empty string if
- * none is available or Namespace processing is not
- * being performed.
- * @param localName The local name, or the empty string if
- * Namespace processing is not being performed.
- * @param qName The qualified name, or the empty string
- * if qualified names are not available.
- * @param type The attribute type as a string.
- * @param value The attribute value.
- * @exception java.lang.ArrayIndexOutOfBoundsException When the
- * supplied index does not point to an attribute
- * in the list.
- */
- public void setAttribute (int index, String uri, String localName,
- String qName, String type, String value)
- {
- if (index >= 0 && index < length) {
- data[index*5] = uri;
- data[index*5+1] = localName;
- data[index*5+2] = qName;
- data[index*5+3] = type;
- data[index*5+4] = value;
- } else {
- badIndex(index);
- }
- }
-
-
- /**
- * Remove an attribute from the list.
- *
- * @param index The index of the attribute (zero-based).
- * @exception java.lang.ArrayIndexOutOfBoundsException When the
- * supplied index does not point to an attribute
- * in the list.
- */
- public void removeAttribute (int index)
- {
- if (index >= 0 && index < length) {
- if (index < length - 1) {
- System.arraycopy(data, (index+1)*5, data, index*5,
- (length-index-1)*5);
- }
- index = (length - 1) * 5;
- data [index++] = null;
- data [index++] = null;
- data [index++] = null;
- data [index++] = null;
- data [index] = null;
- length--;
- } else {
- badIndex(index);
- }
- }
-
-
- /**
- * Set the Namespace URI of a specific attribute.
- *
- * @param index The index of the attribute (zero-based).
- * @param uri The attribute's Namespace URI, or the empty
- * string for none.
- * @exception java.lang.ArrayIndexOutOfBoundsException When the
- * supplied index does not point to an attribute
- * in the list.
- */
- public void setURI (int index, String uri)
- {
- if (index >= 0 && index < length) {
- data[index*5] = uri;
- } else {
- badIndex(index);
- }
- }
-
-
- /**
- * Set the local name of a specific attribute.
- *
- * @param index The index of the attribute (zero-based).
- * @param localName The attribute's local name, or the empty
- * string for none.
- * @exception java.lang.ArrayIndexOutOfBoundsException When the
- * supplied index does not point to an attribute
- * in the list.
- */
- public void setLocalName (int index, String localName)
- {
- if (index >= 0 && index < length) {
- data[index*5+1] = localName;
- } else {
- badIndex(index);
- }
- }
-
-
- /**
- * Set the qualified name of a specific attribute.
- *
- * @param index The index of the attribute (zero-based).
- * @param qName The attribute's qualified name, or the empty
- * string for none.
- * @exception java.lang.ArrayIndexOutOfBoundsException When the
- * supplied index does not point to an attribute
- * in the list.
- */
- public void setQName (int index, String qName)
- {
- if (index >= 0 && index < length) {
- data[index*5+2] = qName;
- } else {
- badIndex(index);
- }
- }
-
-
- /**
- * Set the type of a specific attribute.
- *
- * @param index The index of the attribute (zero-based).
- * @param type The attribute's type.
- * @exception java.lang.ArrayIndexOutOfBoundsException When the
- * supplied index does not point to an attribute
- * in the list.
- */
- public void setType (int index, String type)
- {
- if (index >= 0 && index < length) {
- data[index*5+3] = type;
- } else {
- badIndex(index);
- }
- }
-
-
- /**
- * Set the value of a specific attribute.
- *
- * @param index The index of the attribute (zero-based).
- * @param value The attribute's value.
- * @exception java.lang.ArrayIndexOutOfBoundsException When the
- * supplied index does not point to an attribute
- * in the list.
- */
- public void setValue (int index, String value)
- {
- if (index >= 0 && index < length) {
- data[index*5+4] = value;
- } else {
- badIndex(index);
- }
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Internal methods.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Ensure the internal array's capacity.
- *
- * @param n The minimum number of attributes that the array must
- * be able to hold.
- */
- private void ensureCapacity (int n) {
- if (n <= 0) {
- return;
- }
- int max;
- if (data == null || data.length == 0) {
- max = 25;
- }
- else if (data.length >= n * 5) {
- return;
- }
- else {
- max = data.length;
- }
- while (max < n * 5) {
- max *= 2;
- }
-
- String newData[] = new String[max];
- if (length > 0) {
- System.arraycopy(data, 0, newData, 0, length*5);
- }
- data = newData;
- }
-
-
- /**
- * Report a bad array index in a manipulator.
- *
- * @param index The index to report.
- * @exception java.lang.ArrayIndexOutOfBoundsException Always.
- */
- private void badIndex (int index)
- throws ArrayIndexOutOfBoundsException
- {
- String msg =
- "Attempt to modify attribute at illegal index: " + index;
- throw new ArrayIndexOutOfBoundsException(msg);
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Internal state.
- ////////////////////////////////////////////////////////////////////
-
- int length;
- String data [];
-
-}
-
-// end of AttributesImpl.java
diff --git a/src/org/xml/sax/helpers/DefaultHandler.java b/src/org/xml/sax/helpers/DefaultHandler.java
deleted file mode 100644
index 4ae6b1d..0000000
--- a/src/org/xml/sax/helpers/DefaultHandler.java
+++ /dev/null
@@ -1,491 +0,0 @@
-/*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-// DefaultHandler.java - default implementation of the core handlers.
-// http://www.saxproject.org
-// Written by David Megginson
-// NO WARRANTY! This class is in the public domain.
-// $Id: DefaultHandler.java,v 1.3 2006/04/13 02:06:32 jeffsuttor Exp $
-
-package org.xml.sax.helpers;
-
-import java.io.IOException;
-
-import org.xml.sax.InputSource;
-import org.xml.sax.Locator;
-import org.xml.sax.Attributes;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.DTDHandler;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-
-/**
- * Default base class for SAX2 event handlers.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>This class is available as a convenience base class for SAX2
- * applications: it provides default implementations for all of the
- * callbacks in the four core SAX2 handler classes:</p>
- *
- * <ul>
- * <li>{@link org.xml.sax.EntityResolver EntityResolver}</li>
- * <li>{@link org.xml.sax.DTDHandler DTDHandler}</li>
- * <li>{@link org.xml.sax.ContentHandler ContentHandler}</li>
- * <li>{@link org.xml.sax.ErrorHandler ErrorHandler}</li>
- * </ul>
- *
- * <p>Application writers can extend this class when they need to
- * implement only part of an interface; parser writers can
- * instantiate this class to provide default handlers when the
- * application has not supplied its own.</p>
- *
- * <p>This class replaces the deprecated SAX1
- * {@link org.xml.sax.HandlerBase HandlerBase} class.</p>
- *
- * @since SAX 2.0
- * @author David Megginson,
- * @see org.xml.sax.EntityResolver
- * @see org.xml.sax.DTDHandler
- * @see org.xml.sax.ContentHandler
- * @see org.xml.sax.ErrorHandler
- */
-public class DefaultHandler
- implements EntityResolver, DTDHandler, ContentHandler, ErrorHandler
-{
-
-
- ////////////////////////////////////////////////////////////////////
- // Default implementation of the EntityResolver interface.
- ////////////////////////////////////////////////////////////////////
-
- /**
- * Resolve an external entity.
- *
- * <p>Always return null, so that the parser will use the system
- * identifier provided in the XML document. This method implements
- * the SAX default behaviour: application writers can override it
- * in a subclass to do special translations such as catalog lookups
- * or URI redirection.</p>
- *
- * @param publicId The public identifier, or null if none is
- * available.
- * @param systemId The system identifier provided in the XML
- * document.
- * @return The new input source, or null to require the
- * default behaviour.
- * @exception java.io.IOException If there is an error setting
- * up the new input source.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.EntityResolver#resolveEntity
- */
- public InputSource resolveEntity (String publicId, String systemId)
- throws IOException, SAXException
- {
- return null;
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Default implementation of DTDHandler interface.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Receive notification of a notation declaration.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass if they wish to keep track of the notations
- * declared in a document.</p>
- *
- * @param name The notation name.
- * @param publicId The notation public identifier, or null if not
- * available.
- * @param systemId The notation system identifier.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.DTDHandler#notationDecl
- */
- public void notationDecl (String name, String publicId, String systemId)
- throws SAXException
- {
- // no op
- }
-
-
- /**
- * Receive notification of an unparsed entity declaration.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass to keep track of the unparsed entities
- * declared in a document.</p>
- *
- * @param name The entity name.
- * @param publicId The entity public identifier, or null if not
- * available.
- * @param systemId The entity system identifier.
- * @param notationName The name of the associated notation.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.DTDHandler#unparsedEntityDecl
- */
- public void unparsedEntityDecl (String name, String publicId,
- String systemId, String notationName)
- throws SAXException
- {
- // no op
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Default implementation of ContentHandler interface.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Receive a Locator object for document events.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass if they wish to store the locator for use
- * with other document events.</p>
- *
- * @param locator A locator for all SAX document events.
- * @see org.xml.sax.ContentHandler#setDocumentLocator
- * @see org.xml.sax.Locator
- */
- public void setDocumentLocator (Locator locator)
- {
- // no op
- }
-
-
- /**
- * Receive notification of the beginning of the document.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass to take specific actions at the beginning
- * of a document (such as allocating the root node of a tree or
- * creating an output file).</p>
- *
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ContentHandler#startDocument
- */
- public void startDocument ()
- throws SAXException
- {
- // no op
- }
-
-
- /**
- * Receive notification of the end of the document.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass to take specific actions at the end
- * of a document (such as finalising a tree or closing an output
- * file).</p>
- *
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ContentHandler#endDocument
- */
- public void endDocument ()
- throws SAXException
- {
- // no op
- }
-
-
- /**
- * Receive notification of the start of a Namespace mapping.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass to take specific actions at the start of
- * each Namespace prefix scope (such as storing the prefix mapping).</p>
- *
- * @param prefix The Namespace prefix being declared.
- * @param uri The Namespace URI mapped to the prefix.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ContentHandler#startPrefixMapping
- */
- public void startPrefixMapping (String prefix, String uri)
- throws SAXException
- {
- // no op
- }
-
-
- /**
- * Receive notification of the end of a Namespace mapping.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass to take specific actions at the end of
- * each prefix mapping.</p>
- *
- * @param prefix The Namespace prefix being declared.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ContentHandler#endPrefixMapping
- */
- public void endPrefixMapping (String prefix)
- throws SAXException
- {
- // no op
- }
-
-
- /**
- * Receive notification of the start of an element.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass to take specific actions at the start of
- * each element (such as allocating a new tree node or writing
- * output to a file).</p>
- *
- * @param uri The Namespace URI, or the empty string if the
- * element has no Namespace URI or if Namespace
- * processing is not being performed.
- * @param localName The local name (without prefix), or the
- * empty string if Namespace processing is not being
- * performed.
- * @param qName The qualified name (with prefix), or the
- * empty string if qualified names are not available.
- * @param attributes The attributes attached to the element. If
- * there are no attributes, it shall be an empty
- * Attributes object.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ContentHandler#startElement
- */
- public void startElement (String uri, String localName,
- String qName, Attributes attributes)
- throws SAXException
- {
- // no op
- }
-
-
- /**
- * Receive notification of the end of an element.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass to take specific actions at the end of
- * each element (such as finalising a tree node or writing
- * output to a file).</p>
- *
- * @param uri The Namespace URI, or the empty string if the
- * element has no Namespace URI or if Namespace
- * processing is not being performed.
- * @param localName The local name (without prefix), or the
- * empty string if Namespace processing is not being
- * performed.
- * @param qName The qualified name (with prefix), or the
- * empty string if qualified names are not available.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ContentHandler#endElement
- */
- public void endElement (String uri, String localName, String qName)
- throws SAXException
- {
- // no op
- }
-
-
- /**
- * Receive notification of character data inside an element.
- *
- * <p>By default, do nothing. Application writers may override this
- * method to take specific actions for each chunk of character data
- * (such as adding the data to a node or buffer, or printing it to
- * a file).</p>
- *
- * @param ch The characters.
- * @param start The start position in the character array.
- * @param length The number of characters to use from the
- * character array.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ContentHandler#characters
- */
- public void characters (char ch[], int start, int length)
- throws SAXException
- {
- // no op
- }
-
-
- /**
- * Receive notification of ignorable whitespace in element content.
- *
- * <p>By default, do nothing. Application writers may override this
- * method to take specific actions for each chunk of ignorable
- * whitespace (such as adding data to a node or buffer, or printing
- * it to a file).</p>
- *
- * @param ch The whitespace characters.
- * @param start The start position in the character array.
- * @param length The number of characters to use from the
- * character array.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ContentHandler#ignorableWhitespace
- */
- public void ignorableWhitespace (char ch[], int start, int length)
- throws SAXException
- {
- // no op
- }
-
-
- /**
- * Receive notification of a processing instruction.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass to take specific actions for each
- * processing instruction, such as setting status variables or
- * invoking other methods.</p>
- *
- * @param target The processing instruction target.
- * @param data The processing instruction data, or null if
- * none is supplied.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ContentHandler#processingInstruction
- */
- public void processingInstruction (String target, String data)
- throws SAXException
- {
- // no op
- }
-
-
- /**
- * Receive notification of a skipped entity.
- *
- * <p>By default, do nothing. Application writers may override this
- * method in a subclass to take specific actions for each
- * processing instruction, such as setting status variables or
- * invoking other methods.</p>
- *
- * @param name The name of the skipped entity.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ContentHandler#processingInstruction
- */
- public void skippedEntity (String name)
- throws SAXException
- {
- // no op
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Default implementation of the ErrorHandler interface.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Receive notification of a parser warning.
- *
- * <p>The default implementation does nothing. Application writers
- * may override this method in a subclass to take specific actions
- * for each warning, such as inserting the message in a log file or
- * printing it to the console.</p>
- *
- * @param e The warning information encoded as an exception.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ErrorHandler#warning
- * @see org.xml.sax.SAXParseException
- */
- public void warning (SAXParseException e)
- throws SAXException
- {
- // no op
- }
-
-
- /**
- * Receive notification of a recoverable parser error.
- *
- * <p>The default implementation does nothing. Application writers
- * may override this method in a subclass to take specific actions
- * for each error, such as inserting the message in a log file or
- * printing it to the console.</p>
- *
- * @param e The error information encoded as an exception.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ErrorHandler#warning
- * @see org.xml.sax.SAXParseException
- */
- public void error (SAXParseException e)
- throws SAXException
- {
- // no op
- }
-
-
- /**
- * Report a fatal XML parsing error.
- *
- * <p>The default implementation throws a SAXParseException.
- * Application writers may override this method in a subclass if
- * they need to take specific actions for each fatal error (such as
- * collecting all of the errors into a single report): in any case,
- * the application must stop all regular processing when this
- * method is invoked, since the document is no longer reliable, and
- * the parser may no longer report parsing events.</p>
- *
- * @param e The error information encoded as an exception.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @see org.xml.sax.ErrorHandler#fatalError
- * @see org.xml.sax.SAXParseException
- */
- public void fatalError (SAXParseException e)
- throws SAXException
- {
- throw e;
- }
-
-}
-
-// end of DefaultHandler.java
diff --git a/src/org/xml/sax/helpers/LocatorImpl.java b/src/org/xml/sax/helpers/LocatorImpl.java
deleted file mode 100644
index f4c538b..0000000
--- a/src/org/xml/sax/helpers/LocatorImpl.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-// SAX default implementation for Locator.
-// http://www.saxproject.org
-// No warranty; no copyright -- use this as you will.
-// $Id: LocatorImpl.java,v 1.2 2004/11/03 22:53:09 jsuttor Exp $
-
-package org.xml.sax.helpers;
-
-import org.xml.sax.Locator;
-
-
-/**
- * Provide an optional convenience implementation of Locator.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>This class is available mainly for application writers, who
- * can use it to make a persistent snapshot of a locator at any
- * point during a document parse:</p>
- *
- * <pre>
- * Locator locator;
- * Locator startloc;
- *
- * public void setLocator (Locator locator)
- * {
- * // note the locator
- * this.locator = locator;
- * }
- *
- * public void startDocument ()
- * {
- * // save the location of the start of the document
- * // for future use.
- * Locator startloc = new LocatorImpl(locator);
- * }
- *</pre>
- *
- * <p>Normally, parser writers will not use this class, since it
- * is more efficient to provide location information only when
- * requested, rather than constantly updating a Locator object.</p>
- *
- * @since SAX 1.0
- * @author David Megginson
- * @see org.xml.sax.Locator Locator
- */
-public class LocatorImpl implements Locator
-{
-
-
- /**
- * Zero-argument constructor.
- *
- * <p>This will not normally be useful, since the main purpose
- * of this class is to make a snapshot of an existing Locator.</p>
- */
- public LocatorImpl ()
- {
- }
-
-
- /**
- * Copy constructor.
- *
- * <p>Create a persistent copy of the current state of a locator.
- * When the original locator changes, this copy will still keep
- * the original values (and it can be used outside the scope of
- * DocumentHandler methods).</p>
- *
- * @param locator The locator to copy.
- */
- public LocatorImpl (Locator locator)
- {
- setPublicId(locator.getPublicId());
- setSystemId(locator.getSystemId());
- setLineNumber(locator.getLineNumber());
- setColumnNumber(locator.getColumnNumber());
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Implementation of org.xml.sax.Locator
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Return the saved public identifier.
- *
- * @return The public identifier as a string, or null if none
- * is available.
- * @see org.xml.sax.Locator#getPublicId
- * @see #setPublicId
- */
- public String getPublicId ()
- {
- return publicId;
- }
-
-
- /**
- * Return the saved system identifier.
- *
- * @return The system identifier as a string, or null if none
- * is available.
- * @see org.xml.sax.Locator#getSystemId
- * @see #setSystemId
- */
- public String getSystemId ()
- {
- return systemId;
- }
-
-
- /**
- * Return the saved line number (1-based).
- *
- * @return The line number as an integer, or -1 if none is available.
- * @see org.xml.sax.Locator#getLineNumber
- * @see #setLineNumber
- */
- public int getLineNumber ()
- {
- return lineNumber;
- }
-
-
- /**
- * Return the saved column number (1-based).
- *
- * @return The column number as an integer, or -1 if none is available.
- * @see org.xml.sax.Locator#getColumnNumber
- * @see #setColumnNumber
- */
- public int getColumnNumber ()
- {
- return columnNumber;
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Setters for the properties (not in org.xml.sax.Locator)
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Set the public identifier for this locator.
- *
- * @param publicId The new public identifier, or null
- * if none is available.
- * @see #getPublicId
- */
- public void setPublicId (String publicId)
- {
- this.publicId = publicId;
- }
-
-
- /**
- * Set the system identifier for this locator.
- *
- * @param systemId The new system identifier, or null
- * if none is available.
- * @see #getSystemId
- */
- public void setSystemId (String systemId)
- {
- this.systemId = systemId;
- }
-
-
- /**
- * Set the line number for this locator (1-based).
- *
- * @param lineNumber The line number, or -1 if none is available.
- * @see #getLineNumber
- */
- public void setLineNumber (int lineNumber)
- {
- this.lineNumber = lineNumber;
- }
-
-
- /**
- * Set the column number for this locator (1-based).
- *
- * @param columnNumber The column number, or -1 if none is available.
- * @see #getColumnNumber
- */
- public void setColumnNumber (int columnNumber)
- {
- this.columnNumber = columnNumber;
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Internal state.
- ////////////////////////////////////////////////////////////////////
-
- private String publicId;
- private String systemId;
- private int lineNumber;
- private int columnNumber;
-
-}
-
-// end of LocatorImpl.java
diff --git a/src/org/xml/sax/helpers/NamespaceSupport.java b/src/org/xml/sax/helpers/NamespaceSupport.java
deleted file mode 100644
index f8ef6e3..0000000
--- a/src/org/xml/sax/helpers/NamespaceSupport.java
+++ /dev/null
@@ -1,850 +0,0 @@
-/*
- * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-// NamespaceSupport.java - generic Namespace support for SAX.
-// http://www.saxproject.org
-// Written by David Megginson
-// This class is in the Public Domain. NO WARRANTY!
-// $Id: NamespaceSupport.java,v 1.5 2004/11/03 22:53:09 jsuttor Exp $
-
-package org.xml.sax.helpers;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.EmptyStackException;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-
-/**
- * Encapsulate Namespace logic for use by applications using SAX,
- * or internally by SAX drivers.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>This class encapsulates the logic of Namespace processing: it
- * tracks the declarations currently in force for each context and
- * automatically processes qualified XML names into their Namespace
- * parts; it can also be used in reverse for generating XML qnames
- * from Namespaces.</p>
- *
- * <p>Namespace support objects are reusable, but the reset method
- * must be invoked between each session.</p>
- *
- * <p>Here is a simple session:</p>
- *
- * <pre>
- * String parts[] = new String[3];
- * NamespaceSupport support = new NamespaceSupport();
- *
- * support.pushContext();
- * support.declarePrefix("", "http://www.w3.org/1999/xhtml");
- * support.declarePrefix("dc", "http://www.purl.org/dc#");
- *
- * parts = support.processName("p", parts, false);
- * System.out.println("Namespace URI: " + parts[0]);
- * System.out.println("Local name: " + parts[1]);
- * System.out.println("Raw name: " + parts[2]);
- *
- * parts = support.processName("dc:title", parts, false);
- * System.out.println("Namespace URI: " + parts[0]);
- * System.out.println("Local name: " + parts[1]);
- * System.out.println("Raw name: " + parts[2]);
- *
- * support.popContext();
- * </pre>
- *
- * <p>Note that this class is optimized for the use case where most
- * elements do not contain Namespace declarations: if the same
- * prefix/URI mapping is repeated for each context (for example), this
- * class will be somewhat less efficient.</p>
- *
- * <p>Although SAX drivers (parsers) may choose to use this class to
- * implement namespace handling, they are not required to do so.
- * Applications must track namespace information themselves if they
- * want to use namespace information.
- *
- * @since SAX 2.0
- * @author David Megginson
- */
-public class NamespaceSupport
-{
-
-
- ////////////////////////////////////////////////////////////////////
- // Constants.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * The XML Namespace URI as a constant.
- * The value is <code>http://www.w3.org/XML/1998/namespace</code>
- * as defined in the "Namespaces in XML" * recommendation.
- *
- * <p>This is the Namespace URI that is automatically mapped
- * to the "xml" prefix.</p>
- */
- public final static String XMLNS =
- "http://www.w3.org/XML/1998/namespace";
-
-
- /**
- * The namespace declaration URI as a constant.
- * The value is <code>http://www.w3.org/xmlns/2000/</code>, as defined
- * in a backwards-incompatible erratum to the "Namespaces in XML"
- * recommendation. Because that erratum postdated SAX2, SAX2 defaults
- * to the original recommendation, and does not normally use this URI.
- *
- *
- * <p>This is the Namespace URI that is optionally applied to
- * <em>xmlns</em> and <em>xmlns:*</em> attributes, which are used to
- * declare namespaces. </p>
- *
- * @since SAX 2.1alpha
- * @see #setNamespaceDeclUris
- * @see #isNamespaceDeclUris
- */
- public final static String NSDECL =
- "http://www.w3.org/xmlns/2000/";
-
-
- /**
- * An empty enumeration.
- */
- private final static Enumeration EMPTY_ENUMERATION =
- Collections.enumeration(new ArrayList<String>());
-
-
- ////////////////////////////////////////////////////////////////////
- // Constructor.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Create a new Namespace support object.
- */
- public NamespaceSupport ()
- {
- reset();
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Context management.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Reset this Namespace support object for reuse.
- *
- * <p>It is necessary to invoke this method before reusing the
- * Namespace support object for a new session. If namespace
- * declaration URIs are to be supported, that flag must also
- * be set to a non-default value.
- * </p>
- *
- * @see #setNamespaceDeclUris
- */
- public void reset ()
- {
- contexts = new Context[32];
- namespaceDeclUris = false;
- contextPos = 0;
- contexts[contextPos] = currentContext = new Context();
- currentContext.declarePrefix("xml", XMLNS);
- }
-
-
- /**
- * Start a new Namespace context.
- * The new context will automatically inherit
- * the declarations of its parent context, but it will also keep
- * track of which declarations were made within this context.
- *
- * <p>Event callback code should start a new context once per element.
- * This means being ready to call this in either of two places.
- * For elements that don't include namespace declarations, the
- * <em>ContentHandler.startElement()</em> callback is the right place.
- * For elements with such a declaration, it'd done in the first
- * <em>ContentHandler.startPrefixMapping()</em> callback.
- * A boolean flag can be used to
- * track whether a context has been started yet. When either of
- * those methods is called, it checks the flag to see if a new context
- * needs to be started. If so, it starts the context and sets the
- * flag. After <em>ContentHandler.startElement()</em>
- * does that, it always clears the flag.
- *
- * <p>Normally, SAX drivers would push a new context at the beginning
- * of each XML element. Then they perform a first pass over the
- * attributes to process all namespace declarations, making
- * <em>ContentHandler.startPrefixMapping()</em> callbacks.
- * Then a second pass is made, to determine the namespace-qualified
- * names for all attributes and for the element name.
- * Finally all the information for the
- * <em>ContentHandler.startElement()</em> callback is available,
- * so it can then be made.
- *
- * <p>The Namespace support object always starts with a base context
- * already in force: in this context, only the "xml" prefix is
- * declared.</p>
- *
- * @see org.xml.sax.ContentHandler
- * @see #popContext
- */
- public void pushContext ()
- {
- int max = contexts.length;
-
- contextPos++;
-
- // Extend the array if necessary
- if (contextPos >= max) {
- Context newContexts[] = new Context[max*2];
- System.arraycopy(contexts, 0, newContexts, 0, max);
- max *= 2;
- contexts = newContexts;
- }
-
- // Allocate the context if necessary.
- currentContext = contexts[contextPos];
- if (currentContext == null) {
- contexts[contextPos] = currentContext = new Context();
- }
-
- // Set the parent, if any.
- if (contextPos > 0) {
- currentContext.setParent(contexts[contextPos - 1]);
- }
- }
-
-
- /**
- * Revert to the previous Namespace context.
- *
- * <p>Normally, you should pop the context at the end of each
- * XML element. After popping the context, all Namespace prefix
- * mappings that were previously in force are restored.</p>
- *
- * <p>You must not attempt to declare additional Namespace
- * prefixes after popping a context, unless you push another
- * context first.</p>
- *
- * @see #pushContext
- */
- public void popContext ()
- {
- contexts[contextPos].clear();
- contextPos--;
- if (contextPos < 0) {
- throw new EmptyStackException();
- }
- currentContext = contexts[contextPos];
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Operations within a context.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Declare a Namespace prefix. All prefixes must be declared
- * before they are referenced. For example, a SAX driver (parser)
- * would scan an element's attributes
- * in two passes: first for namespace declarations,
- * then a second pass using {@link #processName processName()} to
- * interpret prefixes against (potentially redefined) prefixes.
- *
- * <p>This method declares a prefix in the current Namespace
- * context; the prefix will remain in force until this context
- * is popped, unless it is shadowed in a descendant context.</p>
- *
- * <p>To declare the default element Namespace, use the empty string as
- * the prefix.</p>
- *
- * <p>Note that there is an asymmetry in this library: {@link
- * #getPrefix getPrefix} will not return the "" prefix,
- * even if you have declared a default element namespace.
- * To check for a default namespace,
- * you have to look it up explicitly using {@link #getURI getURI}.
- * This asymmetry exists to make it easier to look up prefixes
- * for attribute names, where the default prefix is not allowed.</p>
- *
- * @param prefix The prefix to declare, or the empty string to
- * indicate the default element namespace. This may never have
- * the value "xml" or "xmlns".
- * @param uri The Namespace URI to associate with the prefix.
- * @return true if the prefix was legal, false otherwise
- *
- * @see #processName
- * @see #getURI
- * @see #getPrefix
- */
- public boolean declarePrefix (String prefix, String uri)
- {
- if (prefix.equals("xml") || prefix.equals("xmlns")) {
- return false;
- } else {
- currentContext.declarePrefix(prefix, uri);
- return true;
- }
- }
-
-
- /**
- * Process a raw XML qualified name, after all declarations in the
- * current context have been handled by {@link #declarePrefix
- * declarePrefix()}.
- *
- * <p>This method processes a raw XML qualified name in the
- * current context by removing the prefix and looking it up among
- * the prefixes currently declared. The return value will be the
- * array supplied by the caller, filled in as follows:</p>
- *
- * <dl>
- * <dt>parts[0]</dt>
- * <dd>The Namespace URI, or an empty string if none is
- * in use.</dd>
- * <dt>parts[1]</dt>
- * <dd>The local name (without prefix).</dd>
- * <dt>parts[2]</dt>
- * <dd>The original raw name.</dd>
- * </dl>
- *
- * <p>All of the strings in the array will be internalized. If
- * the raw name has a prefix that has not been declared, then
- * the return value will be null.</p>
- *
- * <p>Note that attribute names are processed differently than
- * element names: an unprefixed element name will receive the
- * default Namespace (if any), while an unprefixed attribute name
- * will not.</p>
- *
- * @param qName The XML qualified name to be processed.
- * @param parts An array supplied by the caller, capable of
- * holding at least three members.
- * @param isAttribute A flag indicating whether this is an
- * attribute name (true) or an element name (false).
- * @return The supplied array holding three internalized strings
- * representing the Namespace URI (or empty string), the
- * local name, and the XML qualified name; or null if there
- * is an undeclared prefix.
- * @see #declarePrefix
- * @see java.lang.String#intern */
- public String [] processName (String qName, String parts[],
- boolean isAttribute)
- {
- String myParts[] = currentContext.processName(qName, isAttribute);
- if (myParts == null) {
- return null;
- } else {
- parts[0] = myParts[0];
- parts[1] = myParts[1];
- parts[2] = myParts[2];
- return parts;
- }
- }
-
-
- /**
- * Look up a prefix and get the currently-mapped Namespace URI.
- *
- * <p>This method looks up the prefix in the current context.
- * Use the empty string ("") for the default Namespace.</p>
- *
- * @param prefix The prefix to look up.
- * @return The associated Namespace URI, or null if the prefix
- * is undeclared in this context.
- * @see #getPrefix
- * @see #getPrefixes
- */
- public String getURI (String prefix)
- {
- return currentContext.getURI(prefix);
- }
-
-
- /**
- * Return an enumeration of all prefixes whose declarations are
- * active in the current context.
- * This includes declarations from parent contexts that have
- * not been overridden.
- *
- * <p><strong>Note:</strong> if there is a default prefix, it will not be
- * returned in this enumeration; check for the default prefix
- * using the {@link #getURI getURI} with an argument of "".</p>
- *
- * @return An enumeration of prefixes (never empty).
- * @see #getDeclaredPrefixes
- * @see #getURI
- */
- public Enumeration getPrefixes ()
- {
- return currentContext.getPrefixes();
- }
-
-
- /**
- * Return one of the prefixes mapped to a Namespace URI.
- *
- * <p>If more than one prefix is currently mapped to the same
- * URI, this method will make an arbitrary selection; if you
- * want all of the prefixes, use the {@link #getPrefixes}
- * method instead.</p>
- *
- * <p><strong>Note:</strong> this will never return the empty (default) prefix;
- * to check for a default prefix, use the {@link #getURI getURI}
- * method with an argument of "".</p>
- *
- * @param uri the namespace URI
- * @return one of the prefixes currently mapped to the URI supplied,
- * or null if none is mapped or if the URI is assigned to
- * the default namespace
- * @see #getPrefixes(java.lang.String)
- * @see #getURI
- */
- public String getPrefix (String uri)
- {
- return currentContext.getPrefix(uri);
- }
-
-
- /**
- * Return an enumeration of all prefixes for a given URI whose
- * declarations are active in the current context.
- * This includes declarations from parent contexts that have
- * not been overridden.
- *
- * <p>This method returns prefixes mapped to a specific Namespace
- * URI. The xml: prefix will be included. If you want only one
- * prefix that's mapped to the Namespace URI, and you don't care
- * which one you get, use the {@link #getPrefix getPrefix}
- * method instead.</p>
- *
- * <p><strong>Note:</strong> the empty (default) prefix is <em>never</em> included
- * in this enumeration; to check for the presence of a default
- * Namespace, use the {@link #getURI getURI} method with an
- * argument of "".</p>
- *
- * @param uri The Namespace URI.
- * @return An enumeration of prefixes (never empty).
- * @see #getPrefix
- * @see #getDeclaredPrefixes
- * @see #getURI
- */
- public Enumeration getPrefixes (String uri)
- {
- List<String> prefixes = new ArrayList<>();
- Enumeration allPrefixes = getPrefixes();
- while (allPrefixes.hasMoreElements()) {
- String prefix = (String)allPrefixes.nextElement();
- if (uri.equals(getURI(prefix))) {
- prefixes.add(prefix);
- }
- }
- return Collections.enumeration(prefixes);
- }
-
-
- /**
- * Return an enumeration of all prefixes declared in this context.
- *
- * <p>The empty (default) prefix will be included in this
- * enumeration; note that this behaviour differs from that of
- * {@link #getPrefix} and {@link #getPrefixes}.</p>
- *
- * @return An enumeration of all prefixes declared in this
- * context.
- * @see #getPrefixes
- * @see #getURI
- */
- public Enumeration getDeclaredPrefixes ()
- {
- return currentContext.getDeclaredPrefixes();
- }
-
- /**
- * Controls whether namespace declaration attributes are placed
- * into the {@link #NSDECL NSDECL} namespace
- * by {@link #processName processName()}. This may only be
- * changed before any contexts have been pushed.
- *
- * @since SAX 2.1alpha
- *
- * @exception IllegalStateException when attempting to set this
- * after any context has been pushed.
- */
- public void setNamespaceDeclUris (boolean value)
- {
- if (contextPos != 0)
- throw new IllegalStateException ();
- if (value == namespaceDeclUris)
- return;
- namespaceDeclUris = value;
- if (value)
- currentContext.declarePrefix ("xmlns", NSDECL);
- else {
- contexts[contextPos] = currentContext = new Context();
- currentContext.declarePrefix("xml", XMLNS);
- }
- }
-
- /**
- * Returns true if namespace declaration attributes are placed into
- * a namespace. This behavior is not the default.
- *
- * @since SAX 2.1alpha
- */
- public boolean isNamespaceDeclUris ()
- { return namespaceDeclUris; }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Internal state.
- ////////////////////////////////////////////////////////////////////
-
- private Context contexts[];
- private Context currentContext;
- private int contextPos;
- private boolean namespaceDeclUris;
-
-
- ////////////////////////////////////////////////////////////////////
- // Internal classes.
- ////////////////////////////////////////////////////////////////////
-
- /**
- * Internal class for a single Namespace context.
- *
- * <p>This module caches and reuses Namespace contexts,
- * so the number allocated
- * will be equal to the element depth of the document, not to the total
- * number of elements (i.e. 5-10 rather than tens of thousands).
- * Also, data structures used to represent contexts are shared when
- * possible (child contexts without declarations) to further reduce
- * the amount of memory that's consumed.
- * </p>
- */
- final class Context {
-
- /**
- * Create the root-level Namespace context.
- */
- Context ()
- {
- copyTables();
- }
-
-
- /**
- * (Re)set the parent of this Namespace context.
- * The context must either have been freshly constructed,
- * or must have been cleared.
- *
- * @param context The parent Namespace context object.
- */
- void setParent (Context parent)
- {
- this.parent = parent;
- declarations = null;
- prefixTable = parent.prefixTable;
- uriTable = parent.uriTable;
- elementNameTable = parent.elementNameTable;
- attributeNameTable = parent.attributeNameTable;
- defaultNS = parent.defaultNS;
- declSeen = false;
- }
-
- /**
- * Makes associated state become collectible,
- * invalidating this context.
- * {@link #setParent} must be called before
- * this context may be used again.
- */
- void clear ()
- {
- parent = null;
- prefixTable = null;
- uriTable = null;
- elementNameTable = null;
- attributeNameTable = null;
- defaultNS = null;
- }
-
-
- /**
- * Declare a Namespace prefix for this context.
- *
- * @param prefix The prefix to declare.
- * @param uri The associated Namespace URI.
- * @see org.xml.sax.helpers.NamespaceSupport#declarePrefix
- */
- void declarePrefix (String prefix, String uri)
- {
- // Lazy processing...
-// if (!declsOK)
-// throw new IllegalStateException (
-// "can't declare any more prefixes in this context");
- if (!declSeen) {
- copyTables();
- }
- if (declarations == null) {
- declarations = new ArrayList<>();
- }
-
- prefix = prefix.intern();
- uri = uri.intern();
- if ("".equals(prefix)) {
- if ("".equals(uri)) {
- defaultNS = null;
- } else {
- defaultNS = uri;
- }
- } else {
- prefixTable.put(prefix, uri);
- uriTable.put(uri, prefix); // may wipe out another prefix
- }
- declarations.add(prefix);
- }
-
-
- /**
- * Process an XML qualified name in this context.
- *
- * @param qName The XML qualified name.
- * @param isAttribute true if this is an attribute name.
- * @return An array of three strings containing the
- * URI part (or empty string), the local part,
- * and the raw name, all internalized, or null
- * if there is an undeclared prefix.
- * @see org.xml.sax.helpers.NamespaceSupport#processName
- */
- String [] processName (String qName, boolean isAttribute)
- {
- String name[];
- Map<String, String[]> table;
-
- // Select the appropriate table.
- if (isAttribute) {
- table = attributeNameTable;
- } else {
- table = elementNameTable;
- }
-
- // Start by looking in the cache, and
- // return immediately if the name
- // is already known in this content
- name = (String[])table.get(qName);
- if (name != null) {
- return name;
- }
-
- // We haven't seen this name in this
- // context before. Maybe in the parent
- // context, but we can't assume prefix
- // bindings are the same.
- name = new String[3];
- name[2] = qName.intern();
- int index = qName.indexOf(':');
-
-
- // No prefix.
- if (index == -1) {
- if (isAttribute) {
- if (qName == "xmlns" && namespaceDeclUris)
- name[0] = NSDECL;
- else
- name[0] = "";
- } else if (defaultNS == null) {
- name[0] = "";
- } else {
- name[0] = defaultNS;
- }
- name[1] = name[2];
- }
-
- // Prefix
- else {
- String prefix = qName.substring(0, index);
- String local = qName.substring(index+1);
- String uri;
- if ("".equals(prefix)) {
- uri = defaultNS;
- } else {
- uri = (String)prefixTable.get(prefix);
- }
- if (uri == null
- || (!isAttribute && "xmlns".equals (prefix))) {
- return null;
- }
- name[0] = uri;
- name[1] = local.intern();
- }
-
- // Save in the cache for future use.
- // (Could be shared with parent context...)
- table.put(name[2], name);
- return name;
- }
-
-
- /**
- * Look up the URI associated with a prefix in this context.
- *
- * @param prefix The prefix to look up.
- * @return The associated Namespace URI, or null if none is
- * declared.
- * @see org.xml.sax.helpers.NamespaceSupport#getURI
- */
- String getURI (String prefix)
- {
- if ("".equals(prefix)) {
- return defaultNS;
- } else if (prefixTable == null) {
- return null;
- } else {
- return (String)prefixTable.get(prefix);
- }
- }
-
-
- /**
- * Look up one of the prefixes associated with a URI in this context.
- *
- * <p>Since many prefixes may be mapped to the same URI,
- * the return value may be unreliable.</p>
- *
- * @param uri The URI to look up.
- * @return The associated prefix, or null if none is declared.
- * @see org.xml.sax.helpers.NamespaceSupport#getPrefix
- */
- String getPrefix (String uri)
- {
- if (uriTable == null) {
- return null;
- } else {
- return (String)uriTable.get(uri);
- }
- }
-
-
- /**
- * Return an enumeration of prefixes declared in this context.
- *
- * @return An enumeration of prefixes (possibly empty).
- * @see org.xml.sax.helpers.NamespaceSupport#getDeclaredPrefixes
- */
- Enumeration getDeclaredPrefixes ()
- {
- if (declarations == null) {
- return EMPTY_ENUMERATION;
- } else {
- return Collections.enumeration(declarations);
- }
- }
-
- /**
- * Return an enumeration of all prefixes currently in force.
- *
- * <p>The default prefix, if in force, is <em>not</em>
- * returned, and will have to be checked for separately.</p>
- *
- * @return An enumeration of prefixes (never empty).
- * @see org.xml.sax.helpers.NamespaceSupport#getPrefixes
- */
- Enumeration getPrefixes ()
- {
- if (prefixTable == null) {
- return EMPTY_ENUMERATION;
- } else {
- return Collections.enumeration(prefixTable.keySet());
- }
- }
-
-
-
- ////////////////////////////////////////////////////////////////
- // Internal methods.
- ////////////////////////////////////////////////////////////////
-
-
- /**
- * Copy on write for the internal tables in this context.
- *
- * <p>This class is optimized for the normal case where most
- * elements do not contain Namespace declarations.</p>
- */
- private void copyTables ()
- {
- if (prefixTable != null) {
- prefixTable = new HashMap<>(prefixTable);
- } else {
- prefixTable = new HashMap<>();
- }
- if (uriTable != null) {
- uriTable = new HashMap<>(uriTable);
- } else {
- uriTable = new HashMap<>();
- }
- elementNameTable = new HashMap<>();
- attributeNameTable = new HashMap<>();
- declSeen = true;
- }
-
-
-
- ////////////////////////////////////////////////////////////////
- // Protected state.
- ////////////////////////////////////////////////////////////////
-
- Map<String, String> prefixTable;
- Map<String, String> uriTable;
- Map<String, String[]> elementNameTable;
- Map<String, String[]> attributeNameTable;
- String defaultNS = null;
-
-
-
- ////////////////////////////////////////////////////////////////
- // Internal state.
- ////////////////////////////////////////////////////////////////
-
- private List<String> declarations = null;
- private boolean declSeen = false;
- private Context parent = null;
- }
-}
-
-// end of NamespaceSupport.java
diff --git a/src/org/xml/sax/helpers/NewInstance.java b/src/org/xml/sax/helpers/NewInstance.java
deleted file mode 100644
index c3516b1..0000000
--- a/src/org/xml/sax/helpers/NewInstance.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-// NewInstance.java - create a new instance of a class by name.
-// http://www.saxproject.org
-// Written by Edwin Goei, edwingo@apache.org
-// and by David Brownell, dbrownell@users.sourceforge.net
-// NO WARRANTY! This class is in the Public Domain.
-// $Id: NewInstance.java,v 1.2 2005/06/10 03:50:50 jeffsuttor Exp $
-
-package org.xml.sax.helpers;
-
-import java.lang.reflect.Method;
-import java.lang.reflect.InvocationTargetException;
-
-/**
- * Create a new instance of a class by name.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>This class contains a static method for creating an instance of a
- * class from an explicit class name. It tries to use the thread's context
- * ClassLoader if possible and falls back to using
- * Class.forName(String).</p>
- *
- * <p>This code is designed to compile and run on JDK version 1.1 and later
- * including versions of Java 2.</p>
- *
- * @author Edwin Goei, David Brownell
- * @version 2.0.1 (sax2r2)
- */
-class NewInstance {
- private static final String DEFAULT_PACKAGE = "com.sun.org.apache.xerces.internal";
- /**
- * Creates a new instance of the specified class name
- *
- * Package private so this code is not exposed at the API level.
- */
- static Object newInstance (ClassLoader classLoader, String className)
- throws ClassNotFoundException, IllegalAccessException,
- InstantiationException
- {
- // make sure we have access to restricted packages
- boolean internal = false;
- if (System.getSecurityManager() != null) {
- if (className != null && className.startsWith(DEFAULT_PACKAGE)) {
- internal = true;
- }
- }
-
- Class driverClass;
- if (classLoader == null || internal) {
- driverClass = Class.forName(className);
- } else {
- driverClass = classLoader.loadClass(className);
- }
- return driverClass.newInstance();
- }
-
-}
diff --git a/src/org/xml/sax/helpers/ParserAdapter.java b/src/org/xml/sax/helpers/ParserAdapter.java
deleted file mode 100644
index 62e76c7..0000000
--- a/src/org/xml/sax/helpers/ParserAdapter.java
+++ /dev/null
@@ -1,1071 +0,0 @@
-/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-// ParserAdapter.java - adapt a SAX1 Parser to a SAX2 XMLReader.
-// http://www.saxproject.org
-// Written by David Megginson
-// NO WARRANTY! This class is in the public domain.
-// $Id: ParserAdapter.java,v 1.3 2004/11/03 22:53:09 jsuttor Exp $
-
-package org.xml.sax.helpers;
-
-import java.io.IOException;
-import java.util.Enumeration;
-import java.util.Vector;
-
-import org.xml.sax.Parser; // deprecated
-import org.xml.sax.InputSource;
-import org.xml.sax.Locator;
-import org.xml.sax.AttributeList; // deprecated
-import org.xml.sax.EntityResolver;
-import org.xml.sax.DTDHandler;
-import org.xml.sax.DocumentHandler; // deprecated
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-import org.xml.sax.XMLReader;
-import org.xml.sax.Attributes;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
-
-
-/**
- * Adapt a SAX1 Parser as a SAX2 XMLReader.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>This class wraps a SAX1 {@link org.xml.sax.Parser Parser}
- * and makes it act as a SAX2 {@link org.xml.sax.XMLReader XMLReader},
- * with feature, property, and Namespace support. Note
- * that it is not possible to report {@link org.xml.sax.ContentHandler#skippedEntity
- * skippedEntity} events, since SAX1 does not make that information available.</p>
- *
- * <p>This adapter does not test for duplicate Namespace-qualified
- * attribute names.</p>
- *
- * @since SAX 2.0
- * @author David Megginson
- * @version 2.0.1 (sax2r2)
- * @see org.xml.sax.helpers.XMLReaderAdapter
- * @see org.xml.sax.XMLReader
- * @see org.xml.sax.Parser
- */
-public class ParserAdapter implements XMLReader, DocumentHandler
-{
- private static SecuritySupport ss = new SecuritySupport();
-
- ////////////////////////////////////////////////////////////////////
- // Constructors.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Construct a new parser adapter.
- *
- * <p>Use the "org.xml.sax.parser" property to locate the
- * embedded SAX1 driver.</p>
- *
- * @exception SAXException If the embedded driver
- * cannot be instantiated or if the
- * org.xml.sax.parser property is not specified.
- */
- public ParserAdapter ()
- throws SAXException
- {
- super();
-
- String driver = ss.getSystemProperty("org.xml.sax.parser");
-
- try {
- setup(ParserFactory.makeParser());
- } catch (ClassNotFoundException e1) {
- throw new
- SAXException("Cannot find SAX1 driver class " +
- driver, e1);
- } catch (IllegalAccessException e2) {
- throw new
- SAXException("SAX1 driver class " +
- driver +
- " found but cannot be loaded", e2);
- } catch (InstantiationException e3) {
- throw new
- SAXException("SAX1 driver class " +
- driver +
- " loaded but cannot be instantiated", e3);
- } catch (ClassCastException e4) {
- throw new
- SAXException("SAX1 driver class " +
- driver +
- " does not implement org.xml.sax.Parser");
- } catch (NullPointerException e5) {
- throw new
- SAXException("System property org.xml.sax.parser not specified");
- }
- }
-
-
- /**
- * Construct a new parser adapter.
- *
- * <p>Note that the embedded parser cannot be changed once the
- * adapter is created; to embed a different parser, allocate
- * a new ParserAdapter.</p>
- *
- * @param parser The SAX1 parser to embed.
- * @exception java.lang.NullPointerException If the parser parameter
- * is null.
- */
- public ParserAdapter (Parser parser)
- {
- super();
- setup(parser);
- }
-
-
- /**
- * Internal setup method.
- *
- * @param parser The embedded parser.
- * @exception java.lang.NullPointerException If the parser parameter
- * is null.
- */
- private void setup (Parser parser)
- {
- if (parser == null) {
- throw new
- NullPointerException("Parser argument must not be null");
- }
- this.parser = parser;
- atts = new AttributesImpl();
- nsSupport = new NamespaceSupport();
- attAdapter = new AttributeListAdapter();
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Implementation of org.xml.sax.XMLReader.
- ////////////////////////////////////////////////////////////////////
-
-
- //
- // Internal constants for the sake of convenience.
- //
- private final static String FEATURES = "http://xml.org/sax/features/";
- private final static String NAMESPACES = FEATURES + "namespaces";
- private final static String NAMESPACE_PREFIXES = FEATURES + "namespace-prefixes";
- private final static String XMLNS_URIs = FEATURES + "xmlns-uris";
-
-
- /**
- * Set a feature flag for the parser.
- *
- * <p>The only features recognized are namespaces and
- * namespace-prefixes.</p>
- *
- * @param name The feature name, as a complete URI.
- * @param value The requested feature value.
- * @exception SAXNotRecognizedException If the feature
- * can't be assigned or retrieved.
- * @exception SAXNotSupportedException If the feature
- * can't be assigned that value.
- * @see org.xml.sax.XMLReader#setFeature
- */
- public void setFeature (String name, boolean value)
- throws SAXNotRecognizedException, SAXNotSupportedException
- {
- if (name.equals(NAMESPACES)) {
- checkNotParsing("feature", name);
- namespaces = value;
- if (!namespaces && !prefixes) {
- prefixes = true;
- }
- } else if (name.equals(NAMESPACE_PREFIXES)) {
- checkNotParsing("feature", name);
- prefixes = value;
- if (!prefixes && !namespaces) {
- namespaces = true;
- }
- } else if (name.equals(XMLNS_URIs)) {
- checkNotParsing("feature", name);
- uris = value;
- } else {
- throw new SAXNotRecognizedException("Feature: " + name);
- }
- }
-
-
- /**
- * Check a parser feature flag.
- *
- * <p>The only features recognized are namespaces and
- * namespace-prefixes.</p>
- *
- * @param name The feature name, as a complete URI.
- * @return The current feature value.
- * @exception SAXNotRecognizedException If the feature
- * value can't be assigned or retrieved.
- * @exception SAXNotSupportedException If the
- * feature is not currently readable.
- * @see org.xml.sax.XMLReader#setFeature
- */
- public boolean getFeature (String name)
- throws SAXNotRecognizedException, SAXNotSupportedException
- {
- if (name.equals(NAMESPACES)) {
- return namespaces;
- } else if (name.equals(NAMESPACE_PREFIXES)) {
- return prefixes;
- } else if (name.equals(XMLNS_URIs)) {
- return uris;
- } else {
- throw new SAXNotRecognizedException("Feature: " + name);
- }
- }
-
-
- /**
- * Set a parser property.
- *
- * <p>No properties are currently recognized.</p>
- *
- * @param name The property name.
- * @param value The property value.
- * @exception SAXNotRecognizedException If the property
- * value can't be assigned or retrieved.
- * @exception SAXNotSupportedException If the property
- * can't be assigned that value.
- * @see org.xml.sax.XMLReader#setProperty
- */
- public void setProperty (String name, Object value)
- throws SAXNotRecognizedException, SAXNotSupportedException
- {
- throw new SAXNotRecognizedException("Property: " + name);
- }
-
-
- /**
- * Get a parser property.
- *
- * <p>No properties are currently recognized.</p>
- *
- * @param name The property name.
- * @return The property value.
- * @exception SAXNotRecognizedException If the property
- * value can't be assigned or retrieved.
- * @exception SAXNotSupportedException If the property
- * value is not currently readable.
- * @see org.xml.sax.XMLReader#getProperty
- */
- public Object getProperty (String name)
- throws SAXNotRecognizedException, SAXNotSupportedException
- {
- throw new SAXNotRecognizedException("Property: " + name);
- }
-
-
- /**
- * Set the entity resolver.
- *
- * @param resolver The new entity resolver.
- * @see org.xml.sax.XMLReader#setEntityResolver
- */
- public void setEntityResolver (EntityResolver resolver)
- {
- entityResolver = resolver;
- }
-
-
- /**
- * Return the current entity resolver.
- *
- * @return The current entity resolver, or null if none was supplied.
- * @see org.xml.sax.XMLReader#getEntityResolver
- */
- public EntityResolver getEntityResolver ()
- {
- return entityResolver;
- }
-
-
- /**
- * Set the DTD handler.
- *
- * @param handler the new DTD handler
- * @see org.xml.sax.XMLReader#setEntityResolver
- */
- public void setDTDHandler (DTDHandler handler)
- {
- dtdHandler = handler;
- }
-
-
- /**
- * Return the current DTD handler.
- *
- * @return the current DTD handler, or null if none was supplied
- * @see org.xml.sax.XMLReader#getEntityResolver
- */
- public DTDHandler getDTDHandler ()
- {
- return dtdHandler;
- }
-
-
- /**
- * Set the content handler.
- *
- * @param handler the new content handler
- * @see org.xml.sax.XMLReader#setEntityResolver
- */
- public void setContentHandler (ContentHandler handler)
- {
- contentHandler = handler;
- }
-
-
- /**
- * Return the current content handler.
- *
- * @return The current content handler, or null if none was supplied.
- * @see org.xml.sax.XMLReader#getEntityResolver
- */
- public ContentHandler getContentHandler ()
- {
- return contentHandler;
- }
-
-
- /**
- * Set the error handler.
- *
- * @param handler The new error handler.
- * @see org.xml.sax.XMLReader#setEntityResolver
- */
- public void setErrorHandler (ErrorHandler handler)
- {
- errorHandler = handler;
- }
-
-
- /**
- * Return the current error handler.
- *
- * @return The current error handler, or null if none was supplied.
- * @see org.xml.sax.XMLReader#getEntityResolver
- */
- public ErrorHandler getErrorHandler ()
- {
- return errorHandler;
- }
-
-
- /**
- * Parse an XML document.
- *
- * @param systemId The absolute URL of the document.
- * @exception java.io.IOException If there is a problem reading
- * the raw content of the document.
- * @exception SAXException If there is a problem
- * processing the document.
- * @see #parse(org.xml.sax.InputSource)
- * @see org.xml.sax.Parser#parse(java.lang.String)
- */
- public void parse (String systemId)
- throws IOException, SAXException
- {
- parse(new InputSource(systemId));
- }
-
-
- /**
- * Parse an XML document.
- *
- * @param input An input source for the document.
- * @exception java.io.IOException If there is a problem reading
- * the raw content of the document.
- * @exception SAXException If there is a problem
- * processing the document.
- * @see #parse(java.lang.String)
- * @see org.xml.sax.Parser#parse(org.xml.sax.InputSource)
- */
- public void parse (InputSource input)
- throws IOException, SAXException
- {
- if (parsing) {
- throw new SAXException("Parser is already in use");
- }
- setupParser();
- parsing = true;
- try {
- parser.parse(input);
- } finally {
- parsing = false;
- }
- parsing = false;
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Implementation of org.xml.sax.DocumentHandler.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Adapter implementation method; do not call.
- * Adapt a SAX1 document locator event.
- *
- * @param locator A document locator.
- * @see org.xml.sax.ContentHandler#setDocumentLocator
- */
- public void setDocumentLocator (Locator locator)
- {
- this.locator = locator;
- if (contentHandler != null) {
- contentHandler.setDocumentLocator(locator);
- }
- }
-
-
- /**
- * Adapter implementation method; do not call.
- * Adapt a SAX1 start document event.
- *
- * @exception SAXException The client may raise a
- * processing exception.
- * @see org.xml.sax.DocumentHandler#startDocument
- */
- public void startDocument ()
- throws SAXException
- {
- if (contentHandler != null) {
- contentHandler.startDocument();
- }
- }
-
-
- /**
- * Adapter implementation method; do not call.
- * Adapt a SAX1 end document event.
- *
- * @exception SAXException The client may raise a
- * processing exception.
- * @see org.xml.sax.DocumentHandler#endDocument
- */
- public void endDocument ()
- throws SAXException
- {
- if (contentHandler != null) {
- contentHandler.endDocument();
- }
- }
-
-
- /**
- * Adapter implementation method; do not call.
- * Adapt a SAX1 startElement event.
- *
- * <p>If necessary, perform Namespace processing.</p>
- *
- * @param qName The qualified (prefixed) name.
- * @param qAtts The XML attribute list (with qnames).
- * @exception SAXException The client may raise a
- * processing exception.
- */
- public void startElement (String qName, AttributeList qAtts)
- throws SAXException
- {
- // These are exceptions from the
- // first pass; they should be
- // ignored if there's a second pass,
- // but reported otherwise.
- Vector exceptions = null;
-
- // If we're not doing Namespace
- // processing, dispatch this quickly.
- if (!namespaces) {
- if (contentHandler != null) {
- attAdapter.setAttributeList(qAtts);
- contentHandler.startElement("", "", qName.intern(),
- attAdapter);
- }
- return;
- }
-
-
- // OK, we're doing Namespace processing.
- nsSupport.pushContext();
- int length = qAtts.getLength();
-
- // First pass: handle NS decls
- for (int i = 0; i < length; i++) {
- String attQName = qAtts.getName(i);
-
- if (!attQName.startsWith("xmlns"))
- continue;
- // Could be a declaration...
- String prefix;
- int n = attQName.indexOf(':');
-
- // xmlns=...
- if (n == -1 && attQName.length () == 5) {
- prefix = "";
- } else if (n != 5) {
- // XML namespaces spec doesn't discuss "xmlnsf:oo"
- // (and similarly named) attributes ... at most, warn
- continue;
- } else // xmlns:foo=...
- prefix = attQName.substring(n+1);
-
- String value = qAtts.getValue(i);
- if (!nsSupport.declarePrefix(prefix, value)) {
- reportError("Illegal Namespace prefix: " + prefix);
- continue;
- }
- if (contentHandler != null)
- contentHandler.startPrefixMapping(prefix, value);
- }
-
- // Second pass: copy all relevant
- // attributes into the SAX2 AttributeList
- // using updated prefix bindings
- atts.clear();
- for (int i = 0; i < length; i++) {
- String attQName = qAtts.getName(i);
- String type = qAtts.getType(i);
- String value = qAtts.getValue(i);
-
- // Declaration?
- if (attQName.startsWith("xmlns")) {
- String prefix;
- int n = attQName.indexOf(':');
-
- if (n == -1 && attQName.length () == 5) {
- prefix = "";
- } else if (n != 5) {
- // XML namespaces spec doesn't discuss "xmlnsf:oo"
- // (and similarly named) attributes ... ignore
- prefix = null;
- } else {
- prefix = attQName.substring(6);
- }
- // Yes, decl: report or prune
- if (prefix != null) {
- if (prefixes) {
- if (uris)
- // note funky case: localname can be null
- // when declaring the default prefix, and
- // yet the uri isn't null.
- atts.addAttribute (nsSupport.XMLNS, prefix,
- attQName.intern(), type, value);
- else
- atts.addAttribute ("", "",
- attQName.intern(), type, value);
- }
- continue;
- }
- }
-
- // Not a declaration -- report
- try {
- String attName[] = processName(attQName, true, true);
- atts.addAttribute(attName[0], attName[1], attName[2],
- type, value);
- } catch (SAXException e) {
- if (exceptions == null)
- exceptions = new Vector();
- exceptions.addElement(e);
- atts.addAttribute("", attQName, attQName, type, value);
- }
- }
-
- // now handle the deferred exception reports
- if (exceptions != null && errorHandler != null) {
- for (int i = 0; i < exceptions.size(); i++)
- errorHandler.error((SAXParseException)
- (exceptions.elementAt(i)));
- }
-
- // OK, finally report the event.
- if (contentHandler != null) {
- String name[] = processName(qName, false, false);
- contentHandler.startElement(name[0], name[1], name[2], atts);
- }
- }
-
-
- /**
- * Adapter implementation method; do not call.
- * Adapt a SAX1 end element event.
- *
- * @param qName The qualified (prefixed) name.
- * @exception SAXException The client may raise a
- * processing exception.
- * @see org.xml.sax.DocumentHandler#endElement
- */
- public void endElement (String qName)
- throws SAXException
- {
- // If we're not doing Namespace
- // processing, dispatch this quickly.
- if (!namespaces) {
- if (contentHandler != null) {
- contentHandler.endElement("", "", qName.intern());
- }
- return;
- }
-
- // Split the name.
- String names[] = processName(qName, false, false);
- if (contentHandler != null) {
- contentHandler.endElement(names[0], names[1], names[2]);
- Enumeration prefixes = nsSupport.getDeclaredPrefixes();
- while (prefixes.hasMoreElements()) {
- String prefix = (String)prefixes.nextElement();
- contentHandler.endPrefixMapping(prefix);
- }
- }
- nsSupport.popContext();
- }
-
-
- /**
- * Adapter implementation method; do not call.
- * Adapt a SAX1 characters event.
- *
- * @param ch An array of characters.
- * @param start The starting position in the array.
- * @param length The number of characters to use.
- * @exception SAXException The client may raise a
- * processing exception.
- * @see org.xml.sax.DocumentHandler#characters
- */
- public void characters (char ch[], int start, int length)
- throws SAXException
- {
- if (contentHandler != null) {
- contentHandler.characters(ch, start, length);
- }
- }
-
-
- /**
- * Adapter implementation method; do not call.
- * Adapt a SAX1 ignorable whitespace event.
- *
- * @param ch An array of characters.
- * @param start The starting position in the array.
- * @param length The number of characters to use.
- * @exception SAXException The client may raise a
- * processing exception.
- * @see org.xml.sax.DocumentHandler#ignorableWhitespace
- */
- public void ignorableWhitespace (char ch[], int start, int length)
- throws SAXException
- {
- if (contentHandler != null) {
- contentHandler.ignorableWhitespace(ch, start, length);
- }
- }
-
-
- /**
- * Adapter implementation method; do not call.
- * Adapt a SAX1 processing instruction event.
- *
- * @param target The processing instruction target.
- * @param data The remainder of the processing instruction
- * @exception SAXException The client may raise a
- * processing exception.
- * @see org.xml.sax.DocumentHandler#processingInstruction
- */
- public void processingInstruction (String target, String data)
- throws SAXException
- {
- if (contentHandler != null) {
- contentHandler.processingInstruction(target, data);
- }
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Internal utility methods.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Initialize the parser before each run.
- */
- private void setupParser ()
- {
- // catch an illegal "nonsense" state.
- if (!prefixes && !namespaces)
- throw new IllegalStateException ();
-
- nsSupport.reset();
- if (uris)
- nsSupport.setNamespaceDeclUris (true);
-
- if (entityResolver != null) {
- parser.setEntityResolver(entityResolver);
- }
- if (dtdHandler != null) {
- parser.setDTDHandler(dtdHandler);
- }
- if (errorHandler != null) {
- parser.setErrorHandler(errorHandler);
- }
- parser.setDocumentHandler(this);
- locator = null;
- }
-
-
- /**
- * Process a qualified (prefixed) name.
- *
- * <p>If the name has an undeclared prefix, use only the qname
- * and make an ErrorHandler.error callback in case the app is
- * interested.</p>
- *
- * @param qName The qualified (prefixed) name.
- * @param isAttribute true if this is an attribute name.
- * @return The name split into three parts.
- * @exception SAXException The client may throw
- * an exception if there is an error callback.
- */
- private String [] processName (String qName, boolean isAttribute,
- boolean useException)
- throws SAXException
- {
- String parts[] = nsSupport.processName(qName, nameParts,
- isAttribute);
- if (parts == null) {
- if (useException)
- throw makeException("Undeclared prefix: " + qName);
- reportError("Undeclared prefix: " + qName);
- parts = new String[3];
- parts[0] = parts[1] = "";
- parts[2] = qName.intern();
- }
- return parts;
- }
-
-
- /**
- * Report a non-fatal error.
- *
- * @param message The error message.
- * @exception SAXException The client may throw
- * an exception.
- */
- void reportError (String message)
- throws SAXException
- {
- if (errorHandler != null)
- errorHandler.error(makeException(message));
- }
-
-
- /**
- * Construct an exception for the current context.
- *
- * @param message The error message.
- */
- private SAXParseException makeException (String message)
- {
- if (locator != null) {
- return new SAXParseException(message, locator);
- } else {
- return new SAXParseException(message, null, null, -1, -1);
- }
- }
-
-
- /**
- * Throw an exception if we are parsing.
- *
- * <p>Use this method to detect illegal feature or
- * property changes.</p>
- *
- * @param type The type of thing (feature or property).
- * @param name The feature or property name.
- * @exception SAXNotSupportedException If a
- * document is currently being parsed.
- */
- private void checkNotParsing (String type, String name)
- throws SAXNotSupportedException
- {
- if (parsing) {
- throw new SAXNotSupportedException("Cannot change " +
- type + ' ' +
- name + " while parsing");
-
- }
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Internal state.
- ////////////////////////////////////////////////////////////////////
-
- private NamespaceSupport nsSupport;
- private AttributeListAdapter attAdapter;
-
- private boolean parsing = false;
- private String nameParts[] = new String[3];
-
- private Parser parser = null;
-
- private AttributesImpl atts = null;
-
- // Features
- private boolean namespaces = true;
- private boolean prefixes = false;
- private boolean uris = false;
-
- // Properties
-
- // Handlers
- Locator locator;
-
- EntityResolver entityResolver = null;
- DTDHandler dtdHandler = null;
- ContentHandler contentHandler = null;
- ErrorHandler errorHandler = null;
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Inner class to wrap an AttributeList when not doing NS proc.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Adapt a SAX1 AttributeList as a SAX2 Attributes object.
- *
- * <p>This class is in the Public Domain, and comes with NO
- * WARRANTY of any kind.</p>
- *
- * <p>This wrapper class is used only when Namespace support
- * is disabled -- it provides pretty much a direct mapping
- * from SAX1 to SAX2, except that names and types are
- * interned whenever requested.</p>
- */
- final class AttributeListAdapter implements Attributes
- {
-
- /**
- * Construct a new adapter.
- */
- AttributeListAdapter ()
- {
- }
-
-
- /**
- * Set the embedded AttributeList.
- *
- * <p>This method must be invoked before any of the others
- * can be used.</p>
- *
- * @param The SAX1 attribute list (with qnames).
- */
- void setAttributeList (AttributeList qAtts)
- {
- this.qAtts = qAtts;
- }
-
-
- /**
- * Return the length of the attribute list.
- *
- * @return The number of attributes in the list.
- * @see org.xml.sax.Attributes#getLength
- */
- public int getLength ()
- {
- return qAtts.getLength();
- }
-
-
- /**
- * Return the Namespace URI of the specified attribute.
- *
- * @param The attribute's index.
- * @return Always the empty string.
- * @see org.xml.sax.Attributes#getURI
- */
- public String getURI (int i)
- {
- return "";
- }
-
-
- /**
- * Return the local name of the specified attribute.
- *
- * @param The attribute's index.
- * @return Always the empty string.
- * @see org.xml.sax.Attributes#getLocalName
- */
- public String getLocalName (int i)
- {
- return "";
- }
-
-
- /**
- * Return the qualified (prefixed) name of the specified attribute.
- *
- * @param The attribute's index.
- * @return The attribute's qualified name, internalized.
- */
- public String getQName (int i)
- {
- return qAtts.getName(i).intern();
- }
-
-
- /**
- * Return the type of the specified attribute.
- *
- * @param The attribute's index.
- * @return The attribute's type as an internalized string.
- */
- public String getType (int i)
- {
- return qAtts.getType(i).intern();
- }
-
-
- /**
- * Return the value of the specified attribute.
- *
- * @param The attribute's index.
- * @return The attribute's value.
- */
- public String getValue (int i)
- {
- return qAtts.getValue(i);
- }
-
-
- /**
- * Look up an attribute index by Namespace name.
- *
- * @param uri The Namespace URI or the empty string.
- * @param localName The local name.
- * @return The attributes index, or -1 if none was found.
- * @see org.xml.sax.Attributes#getIndex(java.lang.String,java.lang.String)
- */
- public int getIndex (String uri, String localName)
- {
- return -1;
- }
-
-
- /**
- * Look up an attribute index by qualified (prefixed) name.
- *
- * @param qName The qualified name.
- * @return The attributes index, or -1 if none was found.
- * @see org.xml.sax.Attributes#getIndex(java.lang.String)
- */
- public int getIndex (String qName)
- {
- int max = atts.getLength();
- for (int i = 0; i < max; i++) {
- if (qAtts.getName(i).equals(qName)) {
- return i;
- }
- }
- return -1;
- }
-
-
- /**
- * Look up the type of an attribute by Namespace name.
- *
- * @param uri The Namespace URI
- * @param localName The local name.
- * @return The attribute's type as an internalized string.
- */
- public String getType (String uri, String localName)
- {
- return null;
- }
-
-
- /**
- * Look up the type of an attribute by qualified (prefixed) name.
- *
- * @param qName The qualified name.
- * @return The attribute's type as an internalized string.
- */
- public String getType (String qName)
- {
- return qAtts.getType(qName).intern();
- }
-
-
- /**
- * Look up the value of an attribute by Namespace name.
- *
- * @param uri The Namespace URI
- * @param localName The local name.
- * @return The attribute's value.
- */
- public String getValue (String uri, String localName)
- {
- return null;
- }
-
-
- /**
- * Look up the value of an attribute by qualified (prefixed) name.
- *
- * @param qName The qualified name.
- * @return The attribute's value.
- */
- public String getValue (String qName)
- {
- return qAtts.getValue(qName);
- }
-
- private AttributeList qAtts;
- }
-}
-
-// end of ParserAdapter.java
diff --git a/src/org/xml/sax/helpers/ParserFactory.java b/src/org/xml/sax/helpers/ParserFactory.java
deleted file mode 100644
index 0398312..0000000
--- a/src/org/xml/sax/helpers/ParserFactory.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-// SAX parser factory.
-// http://www.saxproject.org
-// No warranty; no copyright -- use this as you will.
-// $Id: ParserFactory.java,v 1.2 2004/11/03 22:53:09 jsuttor Exp $
-
-package org.xml.sax.helpers;
-
-import org.xml.sax.Parser;
-
-
-/**
- * Java-specific class for dynamically loading SAX parsers.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p><strong>Note:</strong> This class is designed to work with the now-deprecated
- * SAX1 {@link org.xml.sax.Parser Parser} class. SAX2 applications should use
- * {@link org.xml.sax.helpers.XMLReaderFactory XMLReaderFactory} instead.</p>
- *
- * <p>ParserFactory is not part of the platform-independent definition
- * of SAX; it is an additional convenience class designed
- * specifically for Java XML application writers. SAX applications
- * can use the static methods in this class to allocate a SAX parser
- * dynamically at run-time based either on the value of the
- * `org.xml.sax.parser' system property or on a string containing the class
- * name.</p>
- *
- * <p>Note that the application still requires an XML parser that
- * implements SAX1.</p>
- *
- * @deprecated This class works with the deprecated
- * {@link org.xml.sax.Parser Parser}
- * interface.
- * @since SAX 1.0
- * @author David Megginson
- * @version 2.0.1 (sax2r2)
- */
-public class ParserFactory {
- private static SecuritySupport ss = new SecuritySupport();
-
- /**
- * Private null constructor.
- */
- private ParserFactory ()
- {
- }
-
-
- /**
- * Create a new SAX parser using the `org.xml.sax.parser' system property.
- *
- * <p>The named class must exist and must implement the
- * {@link org.xml.sax.Parser Parser} interface.</p>
- *
- * @exception java.lang.NullPointerException There is no value
- * for the `org.xml.sax.parser' system property.
- * @exception java.lang.ClassNotFoundException The SAX parser
- * class was not found (check your CLASSPATH).
- * @exception IllegalAccessException The SAX parser class was
- * found, but you do not have permission to load
- * it.
- * @exception InstantiationException The SAX parser class was
- * found but could not be instantiated.
- * @exception java.lang.ClassCastException The SAX parser class
- * was found and instantiated, but does not implement
- * org.xml.sax.Parser.
- * @see #makeParser(java.lang.String)
- * @see org.xml.sax.Parser
- */
- public static Parser makeParser ()
- throws ClassNotFoundException,
- IllegalAccessException,
- InstantiationException,
- NullPointerException,
- ClassCastException
- {
- String className = ss.getSystemProperty("org.xml.sax.parser");
- if (className == null) {
- throw new NullPointerException("No value for sax.parser property");
- } else {
- return makeParser(className);
- }
- }
-
-
- /**
- * Create a new SAX parser object using the class name provided.
- *
- * <p>The named class must exist and must implement the
- * {@link org.xml.sax.Parser Parser} interface.</p>
- *
- * @param className A string containing the name of the
- * SAX parser class.
- * @exception java.lang.ClassNotFoundException The SAX parser
- * class was not found (check your CLASSPATH).
- * @exception IllegalAccessException The SAX parser class was
- * found, but you do not have permission to load
- * it.
- * @exception InstantiationException The SAX parser class was
- * found but could not be instantiated.
- * @exception java.lang.ClassCastException The SAX parser class
- * was found and instantiated, but does not implement
- * org.xml.sax.Parser.
- * @see #makeParser()
- * @see org.xml.sax.Parser
- */
- public static Parser makeParser (String className)
- throws ClassNotFoundException,
- IllegalAccessException,
- InstantiationException,
- ClassCastException
- {
- return (Parser) NewInstance.newInstance (
- ss.getContextClassLoader(), className);
- }
-
-}
diff --git a/src/org/xml/sax/helpers/SecuritySupport.java b/src/org/xml/sax/helpers/SecuritySupport.java
deleted file mode 100644
index f7c73bf..0000000
--- a/src/org/xml/sax/helpers/SecuritySupport.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package org.xml.sax.helpers;
-
-import java.io.*;
-import java.security.*;
-
-/**
- * This class is duplicated for each JAXP subpackage so keep it in sync.
- * It is package private and therefore is not exposed as part of the JAXP
- * API.
- *
- * Security related methods that only work on J2SE 1.2 and newer.
- */
-class SecuritySupport {
-
-
- ClassLoader getContextClassLoader() throws SecurityException{
- return (ClassLoader)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- ClassLoader cl = null;
- //try {
- cl = Thread.currentThread().getContextClassLoader();
- //} catch (SecurityException ex) { }
-
- if (cl == null)
- cl = ClassLoader.getSystemClassLoader();
-
- return cl;
- }
- });
- }
-
- String getSystemProperty(final String propName) {
- return (String)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return System.getProperty(propName);
- }
- });
- }
-
- FileInputStream getFileInputStream(final File file)
- throws FileNotFoundException
- {
- try {
- return (FileInputStream)
- AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws FileNotFoundException {
- return new FileInputStream(file);
- }
- });
- } catch (PrivilegedActionException e) {
- throw (FileNotFoundException)e.getException();
- }
- }
-
- InputStream getResourceAsStream(final ClassLoader cl,
- final String name)
- {
- return (InputStream)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- InputStream ris;
- if (cl == null) {
- ris = Object.class.getResourceAsStream(name);
- } else {
- ris = cl.getResourceAsStream(name);
- }
- return ris;
- }
- });
- }
-
- boolean doesFileExist(final File f) {
- return ((Boolean)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return new Boolean(f.exists());
- }
- })).booleanValue();
- }
-
-}
diff --git a/src/org/xml/sax/helpers/XMLFilterImpl.java b/src/org/xml/sax/helpers/XMLFilterImpl.java
deleted file mode 100644
index 1e55672..0000000
--- a/src/org/xml/sax/helpers/XMLFilterImpl.java
+++ /dev/null
@@ -1,737 +0,0 @@
-/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-// XMLFilterImpl.java - base SAX2 filter implementation.
-// http://www.saxproject.org
-// Written by David Megginson
-// NO WARRANTY! This class is in the Public Domain.
-// $Id: XMLFilterImpl.java,v 1.3 2004/11/03 22:53:09 jsuttor Exp $
-
-package org.xml.sax.helpers;
-
-import java.io.IOException;
-
-import org.xml.sax.XMLReader;
-import org.xml.sax.XMLFilter;
-import org.xml.sax.InputSource;
-import org.xml.sax.Locator;
-import org.xml.sax.Attributes;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.DTDHandler;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.SAXNotSupportedException;
-import org.xml.sax.SAXNotRecognizedException;
-
-
-/**
- * Base class for deriving an XML filter.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>This class is designed to sit between an {@link org.xml.sax.XMLReader
- * XMLReader} and the client application's event handlers. By default, it
- * does nothing but pass requests up to the reader and events
- * on to the handlers unmodified, but subclasses can override
- * specific methods to modify the event stream or the configuration
- * requests as they pass through.</p>
- *
- * @since SAX 2.0
- * @author David Megginson
- * @see org.xml.sax.XMLFilter
- * @see org.xml.sax.XMLReader
- * @see org.xml.sax.EntityResolver
- * @see org.xml.sax.DTDHandler
- * @see org.xml.sax.ContentHandler
- * @see org.xml.sax.ErrorHandler
- */
-public class XMLFilterImpl
- implements XMLFilter, EntityResolver, DTDHandler, ContentHandler, ErrorHandler
-{
-
-
- ////////////////////////////////////////////////////////////////////
- // Constructors.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Construct an empty XML filter, with no parent.
- *
- * <p>This filter will have no parent: you must assign a parent
- * before you start a parse or do any configuration with
- * setFeature or setProperty, unless you use this as a pure event
- * consumer rather than as an {@link XMLReader}.</p>
- *
- * @see org.xml.sax.XMLReader#setFeature
- * @see org.xml.sax.XMLReader#setProperty
- * @see #setParent
- */
- public XMLFilterImpl ()
- {
- super();
- }
-
-
- /**
- * Construct an XML filter with the specified parent.
- *
- * @see #setParent
- * @see #getParent
- */
- public XMLFilterImpl (XMLReader parent)
- {
- super();
- setParent(parent);
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Implementation of org.xml.sax.XMLFilter.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Set the parent reader.
- *
- * <p>This is the {@link org.xml.sax.XMLReader XMLReader} from which
- * this filter will obtain its events and to which it will pass its
- * configuration requests. The parent may itself be another filter.</p>
- *
- * <p>If there is no parent reader set, any attempt to parse
- * or to set or get a feature or property will fail.</p>
- *
- * @param parent The parent XML reader.
- * @see #getParent
- */
- public void setParent (XMLReader parent)
- {
- this.parent = parent;
- }
-
-
- /**
- * Get the parent reader.
- *
- * @return The parent XML reader, or null if none is set.
- * @see #setParent
- */
- public XMLReader getParent ()
- {
- return parent;
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Implementation of org.xml.sax.XMLReader.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Set the value of a feature.
- *
- * <p>This will always fail if the parent is null.</p>
- *
- * @param name The feature name.
- * @param value The requested feature value.
- * @exception org.xml.sax.SAXNotRecognizedException If the feature
- * value can't be assigned or retrieved from the parent.
- * @exception org.xml.sax.SAXNotSupportedException When the
- * parent recognizes the feature name but
- * cannot set the requested value.
- */
- public void setFeature (String name, boolean value)
- throws SAXNotRecognizedException, SAXNotSupportedException
- {
- if (parent != null) {
- parent.setFeature(name, value);
- } else {
- throw new SAXNotRecognizedException("Feature: " + name);
- }
- }
-
-
- /**
- * Look up the value of a feature.
- *
- * <p>This will always fail if the parent is null.</p>
- *
- * @param name The feature name.
- * @return The current value of the feature.
- * @exception org.xml.sax.SAXNotRecognizedException If the feature
- * value can't be assigned or retrieved from the parent.
- * @exception org.xml.sax.SAXNotSupportedException When the
- * parent recognizes the feature name but
- * cannot determine its value at this time.
- */
- public boolean getFeature (String name)
- throws SAXNotRecognizedException, SAXNotSupportedException
- {
- if (parent != null) {
- return parent.getFeature(name);
- } else {
- throw new SAXNotRecognizedException("Feature: " + name);
- }
- }
-
-
- /**
- * Set the value of a property.
- *
- * <p>This will always fail if the parent is null.</p>
- *
- * @param name The property name.
- * @param value The requested property value.
- * @exception org.xml.sax.SAXNotRecognizedException If the property
- * value can't be assigned or retrieved from the parent.
- * @exception org.xml.sax.SAXNotSupportedException When the
- * parent recognizes the property name but
- * cannot set the requested value.
- */
- public void setProperty (String name, Object value)
- throws SAXNotRecognizedException, SAXNotSupportedException
- {
- if (parent != null) {
- parent.setProperty(name, value);
- } else {
- throw new SAXNotRecognizedException("Property: " + name);
- }
- }
-
-
- /**
- * Look up the value of a property.
- *
- * @param name The property name.
- * @return The current value of the property.
- * @exception org.xml.sax.SAXNotRecognizedException If the property
- * value can't be assigned or retrieved from the parent.
- * @exception org.xml.sax.SAXNotSupportedException When the
- * parent recognizes the property name but
- * cannot determine its value at this time.
- */
- public Object getProperty (String name)
- throws SAXNotRecognizedException, SAXNotSupportedException
- {
- if (parent != null) {
- return parent.getProperty(name);
- } else {
- throw new SAXNotRecognizedException("Property: " + name);
- }
- }
-
-
- /**
- * Set the entity resolver.
- *
- * @param resolver The new entity resolver.
- */
- public void setEntityResolver (EntityResolver resolver)
- {
- entityResolver = resolver;
- }
-
-
- /**
- * Get the current entity resolver.
- *
- * @return The current entity resolver, or null if none was set.
- */
- public EntityResolver getEntityResolver ()
- {
- return entityResolver;
- }
-
-
- /**
- * Set the DTD event handler.
- *
- * @param handler the new DTD handler
- */
- public void setDTDHandler (DTDHandler handler)
- {
- dtdHandler = handler;
- }
-
-
- /**
- * Get the current DTD event handler.
- *
- * @return The current DTD handler, or null if none was set.
- */
- public DTDHandler getDTDHandler ()
- {
- return dtdHandler;
- }
-
-
- /**
- * Set the content event handler.
- *
- * @param handler the new content handler
- */
- public void setContentHandler (ContentHandler handler)
- {
- contentHandler = handler;
- }
-
-
- /**
- * Get the content event handler.
- *
- * @return The current content handler, or null if none was set.
- */
- public ContentHandler getContentHandler ()
- {
- return contentHandler;
- }
-
-
- /**
- * Set the error event handler.
- *
- * @param handler the new error handler
- */
- public void setErrorHandler (ErrorHandler handler)
- {
- errorHandler = handler;
- }
-
-
- /**
- * Get the current error event handler.
- *
- * @return The current error handler, or null if none was set.
- */
- public ErrorHandler getErrorHandler ()
- {
- return errorHandler;
- }
-
-
- /**
- * Parse a document.
- *
- * @param input The input source for the document entity.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @exception java.io.IOException An IO exception from the parser,
- * possibly from a byte stream or character stream
- * supplied by the application.
- */
- public void parse (InputSource input)
- throws SAXException, IOException
- {
- setupParse();
- parent.parse(input);
- }
-
-
- /**
- * Parse a document.
- *
- * @param systemId The system identifier as a fully-qualified URI.
- * @exception org.xml.sax.SAXException Any SAX exception, possibly
- * wrapping another exception.
- * @exception java.io.IOException An IO exception from the parser,
- * possibly from a byte stream or character stream
- * supplied by the application.
- */
- public void parse (String systemId)
- throws SAXException, IOException
- {
- parse(new InputSource(systemId));
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Implementation of org.xml.sax.EntityResolver.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Filter an external entity resolution.
- *
- * @param publicId The entity's public identifier, or null.
- * @param systemId The entity's system identifier.
- * @return A new InputSource or null for the default.
- * @exception org.xml.sax.SAXException The client may throw
- * an exception during processing.
- * @exception java.io.IOException The client may throw an
- * I/O-related exception while obtaining the
- * new InputSource.
- */
- public InputSource resolveEntity (String publicId, String systemId)
- throws SAXException, IOException
- {
- if (entityResolver != null) {
- return entityResolver.resolveEntity(publicId, systemId);
- } else {
- return null;
- }
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Implementation of org.xml.sax.DTDHandler.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Filter a notation declaration event.
- *
- * @param name The notation name.
- * @param publicId The notation's public identifier, or null.
- * @param systemId The notation's system identifier, or null.
- * @exception org.xml.sax.SAXException The client may throw
- * an exception during processing.
- */
- public void notationDecl (String name, String publicId, String systemId)
- throws SAXException
- {
- if (dtdHandler != null) {
- dtdHandler.notationDecl(name, publicId, systemId);
- }
- }
-
-
- /**
- * Filter an unparsed entity declaration event.
- *
- * @param name The entity name.
- * @param publicId The entity's public identifier, or null.
- * @param systemId The entity's system identifier, or null.
- * @param notationName The name of the associated notation.
- * @exception org.xml.sax.SAXException The client may throw
- * an exception during processing.
- */
- public void unparsedEntityDecl (String name, String publicId,
- String systemId, String notationName)
- throws SAXException
- {
- if (dtdHandler != null) {
- dtdHandler.unparsedEntityDecl(name, publicId, systemId,
- notationName);
- }
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Implementation of org.xml.sax.ContentHandler.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Filter a new document locator event.
- *
- * @param locator The document locator.
- */
- public void setDocumentLocator (Locator locator)
- {
- this.locator = locator;
- if (contentHandler != null) {
- contentHandler.setDocumentLocator(locator);
- }
- }
-
-
- /**
- * Filter a start document event.
- *
- * @exception org.xml.sax.SAXException The client may throw
- * an exception during processing.
- */
- public void startDocument ()
- throws SAXException
- {
- if (contentHandler != null) {
- contentHandler.startDocument();
- }
- }
-
-
- /**
- * Filter an end document event.
- *
- * @exception org.xml.sax.SAXException The client may throw
- * an exception during processing.
- */
- public void endDocument ()
- throws SAXException
- {
- if (contentHandler != null) {
- contentHandler.endDocument();
- }
- }
-
-
- /**
- * Filter a start Namespace prefix mapping event.
- *
- * @param prefix The Namespace prefix.
- * @param uri The Namespace URI.
- * @exception org.xml.sax.SAXException The client may throw
- * an exception during processing.
- */
- public void startPrefixMapping (String prefix, String uri)
- throws SAXException
- {
- if (contentHandler != null) {
- contentHandler.startPrefixMapping(prefix, uri);
- }
- }
-
-
- /**
- * Filter an end Namespace prefix mapping event.
- *
- * @param prefix The Namespace prefix.
- * @exception org.xml.sax.SAXException The client may throw
- * an exception during processing.
- */
- public void endPrefixMapping (String prefix)
- throws SAXException
- {
- if (contentHandler != null) {
- contentHandler.endPrefixMapping(prefix);
- }
- }
-
-
- /**
- * Filter a start element event.
- *
- * @param uri The element's Namespace URI, or the empty string.
- * @param localName The element's local name, or the empty string.
- * @param qName The element's qualified (prefixed) name, or the empty
- * string.
- * @param atts The element's attributes.
- * @exception org.xml.sax.SAXException The client may throw
- * an exception during processing.
- */
- public void startElement (String uri, String localName, String qName,
- Attributes atts)
- throws SAXException
- {
- if (contentHandler != null) {
- contentHandler.startElement(uri, localName, qName, atts);
- }
- }
-
-
- /**
- * Filter an end element event.
- *
- * @param uri The element's Namespace URI, or the empty string.
- * @param localName The element's local name, or the empty string.
- * @param qName The element's qualified (prefixed) name, or the empty
- * string.
- * @exception org.xml.sax.SAXException The client may throw
- * an exception during processing.
- */
- public void endElement (String uri, String localName, String qName)
- throws SAXException
- {
- if (contentHandler != null) {
- contentHandler.endElement(uri, localName, qName);
- }
- }
-
-
- /**
- * Filter a character data event.
- *
- * @param ch An array of characters.
- * @param start The starting position in the array.
- * @param length The number of characters to use from the array.
- * @exception org.xml.sax.SAXException The client may throw
- * an exception during processing.
- */
- public void characters (char ch[], int start, int length)
- throws SAXException
- {
- if (contentHandler != null) {
- contentHandler.characters(ch, start, length);
- }
- }
-
-
- /**
- * Filter an ignorable whitespace event.
- *
- * @param ch An array of characters.
- * @param start The starting position in the array.
- * @param length The number of characters to use from the array.
- * @exception org.xml.sax.SAXException The client may throw
- * an exception during processing.
- */
- public void ignorableWhitespace (char ch[], int start, int length)
- throws SAXException
- {
- if (contentHandler != null) {
- contentHandler.ignorableWhitespace(ch, start, length);
- }
- }
-
-
- /**
- * Filter a processing instruction event.
- *
- * @param target The processing instruction target.
- * @param data The text following the target.
- * @exception org.xml.sax.SAXException The client may throw
- * an exception during processing.
- */
- public void processingInstruction (String target, String data)
- throws SAXException
- {
- if (contentHandler != null) {
- contentHandler.processingInstruction(target, data);
- }
- }
-
-
- /**
- * Filter a skipped entity event.
- *
- * @param name The name of the skipped entity.
- * @exception org.xml.sax.SAXException The client may throw
- * an exception during processing.
- */
- public void skippedEntity (String name)
- throws SAXException
- {
- if (contentHandler != null) {
- contentHandler.skippedEntity(name);
- }
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Implementation of org.xml.sax.ErrorHandler.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Filter a warning event.
- *
- * @param e The warning as an exception.
- * @exception org.xml.sax.SAXException The client may throw
- * an exception during processing.
- */
- public void warning (SAXParseException e)
- throws SAXException
- {
- if (errorHandler != null) {
- errorHandler.warning(e);
- }
- }
-
-
- /**
- * Filter an error event.
- *
- * @param e The error as an exception.
- * @exception org.xml.sax.SAXException The client may throw
- * an exception during processing.
- */
- public void error (SAXParseException e)
- throws SAXException
- {
- if (errorHandler != null) {
- errorHandler.error(e);
- }
- }
-
-
- /**
- * Filter a fatal error event.
- *
- * @param e The error as an exception.
- * @exception org.xml.sax.SAXException The client may throw
- * an exception during processing.
- */
- public void fatalError (SAXParseException e)
- throws SAXException
- {
- if (errorHandler != null) {
- errorHandler.fatalError(e);
- }
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Internal methods.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Set up before a parse.
- *
- * <p>Before every parse, check whether the parent is
- * non-null, and re-register the filter for all of the
- * events.</p>
- */
- private void setupParse ()
- {
- if (parent == null) {
- throw new NullPointerException("No parent for filter");
- }
- parent.setEntityResolver(this);
- parent.setDTDHandler(this);
- parent.setContentHandler(this);
- parent.setErrorHandler(this);
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Internal state.
- ////////////////////////////////////////////////////////////////////
-
- private XMLReader parent = null;
- private Locator locator = null;
- private EntityResolver entityResolver = null;
- private DTDHandler dtdHandler = null;
- private ContentHandler contentHandler = null;
- private ErrorHandler errorHandler = null;
-
-}
-
-// end of XMLFilterImpl.java
diff --git a/src/org/xml/sax/helpers/XMLReaderAdapter.java b/src/org/xml/sax/helpers/XMLReaderAdapter.java
deleted file mode 100644
index 394633f..0000000
--- a/src/org/xml/sax/helpers/XMLReaderAdapter.java
+++ /dev/null
@@ -1,562 +0,0 @@
-/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-// XMLReaderAdapter.java - adapt an SAX2 XMLReader to a SAX1 Parser
-// http://www.saxproject.org
-// Written by David Megginson
-// NO WARRANTY! This class is in the public domain.
-// $Id: XMLReaderAdapter.java,v 1.3 2004/11/03 22:53:09 jsuttor Exp $
-
-package org.xml.sax.helpers;
-
-import java.io.IOException;
-import java.util.Locale;
-
-import org.xml.sax.Parser; // deprecated
-import org.xml.sax.Locator;
-import org.xml.sax.InputSource;
-import org.xml.sax.AttributeList; // deprecated
-import org.xml.sax.EntityResolver;
-import org.xml.sax.DTDHandler;
-import org.xml.sax.DocumentHandler; // deprecated
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.SAXException;
-
-import org.xml.sax.XMLReader;
-import org.xml.sax.Attributes;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.SAXNotSupportedException;
-
-
-/**
- * Adapt a SAX2 XMLReader as a SAX1 Parser.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>This class wraps a SAX2 {@link org.xml.sax.XMLReader XMLReader}
- * and makes it act as a SAX1 {@link org.xml.sax.Parser Parser}. The XMLReader
- * must support a true value for the
- * http://xml.org/sax/features/namespace-prefixes property or parsing will fail
- * with a {@link org.xml.sax.SAXException SAXException}; if the XMLReader
- * supports a false value for the http://xml.org/sax/features/namespaces
- * property, that will also be used to improve efficiency.</p>
- *
- * @since SAX 2.0
- * @author David Megginson
- * @see org.xml.sax.Parser
- * @see org.xml.sax.XMLReader
- */
-public class XMLReaderAdapter implements Parser, ContentHandler
-{
-
-
- ////////////////////////////////////////////////////////////////////
- // Constructor.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Create a new adapter.
- *
- * <p>Use the "org.xml.sax.driver" property to locate the SAX2
- * driver to embed.</p>
- *
- * @exception org.xml.sax.SAXException If the embedded driver
- * cannot be instantiated or if the
- * org.xml.sax.driver property is not specified.
- */
- public XMLReaderAdapter ()
- throws SAXException
- {
- setup(XMLReaderFactory.createXMLReader());
- }
-
-
- /**
- * Create a new adapter.
- *
- * <p>Create a new adapter, wrapped around a SAX2 XMLReader.
- * The adapter will make the XMLReader act like a SAX1
- * Parser.</p>
- *
- * @param xmlReader The SAX2 XMLReader to wrap.
- * @exception java.lang.NullPointerException If the argument is null.
- */
- public XMLReaderAdapter (XMLReader xmlReader)
- {
- setup(xmlReader);
- }
-
-
-
- /**
- * Internal setup.
- *
- * @param xmlReader The embedded XMLReader.
- */
- private void setup (XMLReader xmlReader)
- {
- if (xmlReader == null) {
- throw new NullPointerException("XMLReader must not be null");
- }
- this.xmlReader = xmlReader;
- qAtts = new AttributesAdapter();
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Implementation of org.xml.sax.Parser.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Set the locale for error reporting.
- *
- * <p>This is not supported in SAX2, and will always throw
- * an exception.</p>
- *
- * @param locale the locale for error reporting.
- * @see org.xml.sax.Parser#setLocale
- * @exception org.xml.sax.SAXException Thrown unless overridden.
- */
- public void setLocale (Locale locale)
- throws SAXException
- {
- throw new SAXNotSupportedException("setLocale not supported");
- }
-
-
- /**
- * Register the entity resolver.
- *
- * @param resolver The new resolver.
- * @see org.xml.sax.Parser#setEntityResolver
- */
- public void setEntityResolver (EntityResolver resolver)
- {
- xmlReader.setEntityResolver(resolver);
- }
-
-
- /**
- * Register the DTD event handler.
- *
- * @param handler The new DTD event handler.
- * @see org.xml.sax.Parser#setDTDHandler
- */
- public void setDTDHandler (DTDHandler handler)
- {
- xmlReader.setDTDHandler(handler);
- }
-
-
- /**
- * Register the SAX1 document event handler.
- *
- * <p>Note that the SAX1 document handler has no Namespace
- * support.</p>
- *
- * @param handler The new SAX1 document event handler.
- * @see org.xml.sax.Parser#setDocumentHandler
- */
- public void setDocumentHandler (DocumentHandler handler)
- {
- documentHandler = handler;
- }
-
-
- /**
- * Register the error event handler.
- *
- * @param handler The new error event handler.
- * @see org.xml.sax.Parser#setErrorHandler
- */
- public void setErrorHandler (ErrorHandler handler)
- {
- xmlReader.setErrorHandler(handler);
- }
-
-
- /**
- * Parse the document.
- *
- * <p>This method will throw an exception if the embedded
- * XMLReader does not support the
- * http://xml.org/sax/features/namespace-prefixes property.</p>
- *
- * @param systemId The absolute URL of the document.
- * @exception java.io.IOException If there is a problem reading
- * the raw content of the document.
- * @exception org.xml.sax.SAXException If there is a problem
- * processing the document.
- * @see #parse(org.xml.sax.InputSource)
- * @see org.xml.sax.Parser#parse(java.lang.String)
- */
- public void parse (String systemId)
- throws IOException, SAXException
- {
- parse(new InputSource(systemId));
- }
-
-
- /**
- * Parse the document.
- *
- * <p>This method will throw an exception if the embedded
- * XMLReader does not support the
- * http://xml.org/sax/features/namespace-prefixes property.</p>
- *
- * @param input An input source for the document.
- * @exception java.io.IOException If there is a problem reading
- * the raw content of the document.
- * @exception org.xml.sax.SAXException If there is a problem
- * processing the document.
- * @see #parse(java.lang.String)
- * @see org.xml.sax.Parser#parse(org.xml.sax.InputSource)
- */
- public void parse (InputSource input)
- throws IOException, SAXException
- {
- setupXMLReader();
- xmlReader.parse(input);
- }
-
-
- /**
- * Set up the XML reader.
- */
- private void setupXMLReader ()
- throws SAXException
- {
- xmlReader.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
- try {
- xmlReader.setFeature("http://xml.org/sax/features/namespaces",
- false);
- } catch (SAXException e) {
- // NO OP: it's just extra information, and we can ignore it
- }
- xmlReader.setContentHandler(this);
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Implementation of org.xml.sax.ContentHandler.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Set a document locator.
- *
- * @param locator The document locator.
- * @see org.xml.sax.ContentHandler#setDocumentLocator
- */
- public void setDocumentLocator (Locator locator)
- {
- if (documentHandler != null)
- documentHandler.setDocumentLocator(locator);
- }
-
-
- /**
- * Start document event.
- *
- * @exception org.xml.sax.SAXException The client may raise a
- * processing exception.
- * @see org.xml.sax.ContentHandler#startDocument
- */
- public void startDocument ()
- throws SAXException
- {
- if (documentHandler != null)
- documentHandler.startDocument();
- }
-
-
- /**
- * End document event.
- *
- * @exception org.xml.sax.SAXException The client may raise a
- * processing exception.
- * @see org.xml.sax.ContentHandler#endDocument
- */
- public void endDocument ()
- throws SAXException
- {
- if (documentHandler != null)
- documentHandler.endDocument();
- }
-
-
- /**
- * Adapt a SAX2 start prefix mapping event.
- *
- * @param prefix The prefix being mapped.
- * @param uri The Namespace URI being mapped to.
- * @see org.xml.sax.ContentHandler#startPrefixMapping
- */
- public void startPrefixMapping (String prefix, String uri)
- {
- }
-
-
- /**
- * Adapt a SAX2 end prefix mapping event.
- *
- * @param prefix The prefix being mapped.
- * @see org.xml.sax.ContentHandler#endPrefixMapping
- */
- public void endPrefixMapping (String prefix)
- {
- }
-
-
- /**
- * Adapt a SAX2 start element event.
- *
- * @param uri The Namespace URI.
- * @param localName The Namespace local name.
- * @param qName The qualified (prefixed) name.
- * @param atts The SAX2 attributes.
- * @exception org.xml.sax.SAXException The client may raise a
- * processing exception.
- * @see org.xml.sax.ContentHandler#endDocument
- */
- public void startElement (String uri, String localName,
- String qName, Attributes atts)
- throws SAXException
- {
- if (documentHandler != null) {
- qAtts.setAttributes(atts);
- documentHandler.startElement(qName, qAtts);
- }
- }
-
-
- /**
- * Adapt a SAX2 end element event.
- *
- * @param uri The Namespace URI.
- * @param localName The Namespace local name.
- * @param qName The qualified (prefixed) name.
- * @exception org.xml.sax.SAXException The client may raise a
- * processing exception.
- * @see org.xml.sax.ContentHandler#endElement
- */
- public void endElement (String uri, String localName,
- String qName)
- throws SAXException
- {
- if (documentHandler != null)
- documentHandler.endElement(qName);
- }
-
-
- /**
- * Adapt a SAX2 characters event.
- *
- * @param ch An array of characters.
- * @param start The starting position in the array.
- * @param length The number of characters to use.
- * @exception org.xml.sax.SAXException The client may raise a
- * processing exception.
- * @see org.xml.sax.ContentHandler#characters
- */
- public void characters (char ch[], int start, int length)
- throws SAXException
- {
- if (documentHandler != null)
- documentHandler.characters(ch, start, length);
- }
-
-
- /**
- * Adapt a SAX2 ignorable whitespace event.
- *
- * @param ch An array of characters.
- * @param start The starting position in the array.
- * @param length The number of characters to use.
- * @exception org.xml.sax.SAXException The client may raise a
- * processing exception.
- * @see org.xml.sax.ContentHandler#ignorableWhitespace
- */
- public void ignorableWhitespace (char ch[], int start, int length)
- throws SAXException
- {
- if (documentHandler != null)
- documentHandler.ignorableWhitespace(ch, start, length);
- }
-
-
- /**
- * Adapt a SAX2 processing instruction event.
- *
- * @param target The processing instruction target.
- * @param data The remainder of the processing instruction
- * @exception org.xml.sax.SAXException The client may raise a
- * processing exception.
- * @see org.xml.sax.ContentHandler#processingInstruction
- */
- public void processingInstruction (String target, String data)
- throws SAXException
- {
- if (documentHandler != null)
- documentHandler.processingInstruction(target, data);
- }
-
-
- /**
- * Adapt a SAX2 skipped entity event.
- *
- * @param name The name of the skipped entity.
- * @see org.xml.sax.ContentHandler#skippedEntity
- * @exception org.xml.sax.SAXException Throwable by subclasses.
- */
- public void skippedEntity (String name)
- throws SAXException
- {
- }
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Internal state.
- ////////////////////////////////////////////////////////////////////
-
- XMLReader xmlReader;
- DocumentHandler documentHandler;
- AttributesAdapter qAtts;
-
-
-
- ////////////////////////////////////////////////////////////////////
- // Internal class.
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * Internal class to wrap a SAX2 Attributes object for SAX1.
- */
- final class AttributesAdapter implements AttributeList
- {
- AttributesAdapter ()
- {
- }
-
-
- /**
- * Set the embedded Attributes object.
- *
- * @param The embedded SAX2 Attributes.
- */
- void setAttributes (Attributes attributes)
- {
- this.attributes = attributes;
- }
-
-
- /**
- * Return the number of attributes.
- *
- * @return The length of the attribute list.
- * @see org.xml.sax.AttributeList#getLength
- */
- public int getLength ()
- {
- return attributes.getLength();
- }
-
-
- /**
- * Return the qualified (prefixed) name of an attribute by position.
- *
- * @return The qualified name.
- * @see org.xml.sax.AttributeList#getName
- */
- public String getName (int i)
- {
- return attributes.getQName(i);
- }
-
-
- /**
- * Return the type of an attribute by position.
- *
- * @return The type.
- * @see org.xml.sax.AttributeList#getType(int)
- */
- public String getType (int i)
- {
- return attributes.getType(i);
- }
-
-
- /**
- * Return the value of an attribute by position.
- *
- * @return The value.
- * @see org.xml.sax.AttributeList#getValue(int)
- */
- public String getValue (int i)
- {
- return attributes.getValue(i);
- }
-
-
- /**
- * Return the type of an attribute by qualified (prefixed) name.
- *
- * @return The type.
- * @see org.xml.sax.AttributeList#getType(java.lang.String)
- */
- public String getType (String qName)
- {
- return attributes.getType(qName);
- }
-
-
- /**
- * Return the value of an attribute by qualified (prefixed) name.
- *
- * @return The value.
- * @see org.xml.sax.AttributeList#getValue(java.lang.String)
- */
- public String getValue (String qName)
- {
- return attributes.getValue(qName);
- }
-
- private Attributes attributes;
- }
-
-}
-
-// end of XMLReaderAdapter.java
diff --git a/src/org/xml/sax/helpers/XMLReaderFactory.java b/src/org/xml/sax/helpers/XMLReaderFactory.java
deleted file mode 100644
index 27ce1c1..0000000
--- a/src/org/xml/sax/helpers/XMLReaderFactory.java
+++ /dev/null
@@ -1,244 +0,0 @@
-/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-// XMLReaderFactory.java - factory for creating a new reader.
-// http://www.saxproject.org
-// Written by David Megginson
-// and by David Brownell
-// NO WARRANTY! This class is in the Public Domain.
-// $Id: XMLReaderFactory.java,v 1.2.2.1 2005/07/31 22:48:08 jeffsuttor Exp $
-
-package org.xml.sax.helpers;
-import java.io.BufferedReader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import org.xml.sax.XMLReader;
-import org.xml.sax.SAXException;
-
-
-/**
- * Factory for creating an XML reader.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>This class contains static methods for creating an XML reader
- * from an explicit class name, or based on runtime defaults:</p>
- *
- * <pre>
- * try {
- * XMLReader myReader = XMLReaderFactory.createXMLReader();
- * } catch (SAXException e) {
- * System.err.println(e.getMessage());
- * }
- * </pre>
- *
- * <p><strong>Note to Distributions bundled with parsers:</strong>
- * You should modify the implementation of the no-arguments
- * <em>createXMLReader</em> to handle cases where the external
- * configuration mechanisms aren't set up. That method should do its
- * best to return a parser when one is in the class path, even when
- * nothing bound its class name to <code>org.xml.sax.driver</code> so
- * those configuration mechanisms would see it.</p>
- *
- * @since SAX 2.0
- * @author David Megginson, David Brownell
- * @version 2.0.1 (sax2r2)
- */
-final public class XMLReaderFactory
-{
- /**
- * Private constructor.
- *
- * <p>This constructor prevents the class from being instantiated.</p>
- */
- private XMLReaderFactory ()
- {
- }
-
- private static final String property = "org.xml.sax.driver";
- private static SecuritySupport ss = new SecuritySupport();
-
- private static String _clsFromJar = null;
- private static boolean _jarread = false;
- /**
- * Attempt to create an XMLReader from system defaults.
- * In environments which can support it, the name of the XMLReader
- * class is determined by trying each these options in order, and
- * using the first one which succeeds:</p> <ul>
- *
- * <li>If the system property <code>org.xml.sax.driver</code>
- * has a value, that is used as an XMLReader class name. </li>
- *
- * <li>The JAR "Services API" is used to look for a class name
- * in the <em>META-INF/services/org.xml.sax.driver</em> file in
- * jarfiles available to the runtime.</li>
- *
- * <li> SAX parser distributions are strongly encouraged to provide
- * a default XMLReader class name that will take effect only when
- * previous options (on this list) are not successful.</li>
- *
- * <li>Finally, if {@link ParserFactory#makeParser()} can
- * return a system default SAX1 parser, that parser is wrapped in
- * a {@link ParserAdapter}. (This is a migration aid for SAX1
- * environments, where the <code>org.xml.sax.parser</code> system
- * property will often be usable.) </li>
- *
- * </ul>
- *
- * <p> In environments such as small embedded systems, which can not
- * support that flexibility, other mechanisms to determine the default
- * may be used. </p>
- *
- * <p>Note that many Java environments allow system properties to be
- * initialized on a command line. This means that <em>in most cases</em>
- * setting a good value for that property ensures that calls to this
- * method will succeed, except when security policies intervene.
- * This will also maximize application portability to older SAX
- * environments, with less robust implementations of this method.
- * </p>
- *
- * @return A new XMLReader.
- * @exception org.xml.sax.SAXException If no default XMLReader class
- * can be identified and instantiated.
- * @see #createXMLReader(java.lang.String)
- */
- public static XMLReader createXMLReader ()
- throws SAXException
- {
- String className = null;
- ClassLoader cl = ss.getContextClassLoader();
-
- // 1. try the JVM-instance-wide system property
- try {
- className = ss.getSystemProperty(property);
- }
- catch (RuntimeException e) { /* continue searching */ }
-
- // 2. if that fails, try META-INF/services/
- if (className == null) {
- if (!_jarread) {
- _jarread = true;
- String service = "META-INF/services/" + property;
- InputStream in;
- BufferedReader reader;
-
- try {
- if (cl != null) {
- in = ss.getResourceAsStream(cl, service);
-
- // If no provider found then try the current ClassLoader
- if (in == null) {
- cl = null;
- in = ss.getResourceAsStream(cl, service);
- }
- } else {
- // No Context ClassLoader, try the current ClassLoader
- in = ss.getResourceAsStream(cl, service);
- }
-
- if (in != null) {
- reader = new BufferedReader (new InputStreamReader (in, "UTF8"));
- _clsFromJar = reader.readLine ();
- in.close ();
- }
- } catch (Exception e) {
- }
- }
- className = _clsFromJar;
- }
-
- // 3. Distro-specific fallback
- if (className == null) {
-// BEGIN DISTRIBUTION-SPECIFIC
-
- // EXAMPLE:
- // className = "com.example.sax.XmlReader";
- // or a $JAVA_HOME/jre/lib/*properties setting...
- className = "com.sun.org.apache.xerces.internal.parsers.SAXParser";
-
-// END DISTRIBUTION-SPECIFIC
- }
-
- // do we know the XMLReader implementation class yet?
- if (className != null)
- return loadClass (cl, className);
-
- // 4. panic -- adapt any SAX1 parser
- try {
- return new ParserAdapter (ParserFactory.makeParser ());
- } catch (Exception e) {
- throw new SAXException ("Can't create default XMLReader; "
- + "is system property org.xml.sax.driver set?");
- }
- }
-
-
- /**
- * Attempt to create an XML reader from a class name.
- *
- * <p>Given a class name, this method attempts to load
- * and instantiate the class as an XML reader.</p>
- *
- * <p>Note that this method will not be usable in environments where
- * the caller (perhaps an applet) is not permitted to load classes
- * dynamically.</p>
- *
- * @return A new XML reader.
- * @exception org.xml.sax.SAXException If the class cannot be
- * loaded, instantiated, and cast to XMLReader.
- * @see #createXMLReader()
- */
- public static XMLReader createXMLReader (String className)
- throws SAXException
- {
- return loadClass (ss.getContextClassLoader(), className);
- }
-
- private static XMLReader loadClass (ClassLoader loader, String className)
- throws SAXException
- {
- try {
- return (XMLReader) NewInstance.newInstance (loader, className);
- } catch (ClassNotFoundException e1) {
- throw new SAXException("SAX2 driver class " + className +
- " not found", e1);
- } catch (IllegalAccessException e2) {
- throw new SAXException("SAX2 driver class " + className +
- " found but cannot be loaded", e2);
- } catch (InstantiationException e3) {
- throw new SAXException("SAX2 driver class " + className +
- " loaded but cannot be instantiated (no empty public constructor?)",
- e3);
- } catch (ClassCastException e4) {
- throw new SAXException("SAX2 driver class " + className +
- " does not implement XMLReader", e4);
- }
- }
-}
diff --git a/src/org/xml/sax/helpers/package.html b/src/org/xml/sax/helpers/package.html
deleted file mode 100644
index 001f0e2..0000000
--- a/src/org/xml/sax/helpers/package.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<HTML><HEAD>
-<!-- $Id: package.html,v 1.3 2007/10/02 19:32:24 ndw Exp $ -->
-</HEAD><BODY>
-
-<p>This package contains "helper" classes, including
-support for bootstrapping SAX-based applications.
-
-<p>See <a target='_top' href='http://www.saxproject.org'>http://www.saxproject.org</a>
-for more information about SAX.</p>
-
-</BODY></HTML>
diff --git a/src/org/xml/sax/package.html b/src/org/xml/sax/package.html
deleted file mode 100644
index 2af5e4c..0000000
--- a/src/org/xml/sax/package.html
+++ /dev/null
@@ -1,297 +0,0 @@
-<html><head>
-<!-- $Id: package.html,v 1.3 2007/10/02 19:32:24 ndw Exp $ -->
-</head><body>
-
-<p> This package provides the core SAX APIs.
-Some SAX1 APIs are deprecated to encourage integration of
-namespace-awareness into designs of new applications
-and into maintenance of existing infrastructure. </p>
-
-<p>See <a target='_top' href='http://www.saxproject.org'>http://www.saxproject.org</a>
-for more information about SAX.</p>
-
-
-<h2> SAX2 Standard Feature Flags </h2>
-
-<p> One of the essential characteristics of SAX2 is that it added
-feature flags which can be used to examine and perhaps modify
-parser modes, in particular modes such as validation.
-Since features are identified by (absolute) URIs, anyone
-can define such features.
-Currently defined standard feature URIs have the prefix
-<code>http://xml.org/sax/features/</code> before an identifier such as
-<code>validation</code>. Turn features on or off using
-<em>setFeature</em>. Those standard identifiers are: </p>
-
-
-<table border="1" cellpadding="3" cellspacing="0" width="100%">
- <tr align="center" bgcolor="#ccccff">
- <th>Feature ID</th>
- <th>Access</th>
- <th>Default</th>
- <th>Description</th>
- </tr>
-
- <tr>
- <td>external-general-entities</td>
- <td><em>read/write</em></td>
- <td><em>unspecified</em></td>
- <td> Reports whether this parser processes external
- general entities; always true if validating.
- </td>
- </tr>
-
- <tr>
- <td>external-parameter-entities</td>
- <td><em>read/write</em></td>
- <td><em>unspecified</em></td>
- <td> Reports whether this parser processes external
- parameter entities; always true if validating.
- </td>
- </tr>
-
- <tr>
- <td>is-standalone</td>
- <td>(parsing) <em>read-only</em>, (not parsing) <em>none</em></td>
- <td>not applicable</td>
- <td> May be examined only during a parse, after the
- <em>startDocument()</em> callback has been completed; read-only.
- The value is true if the document specified standalone="yes" in
- its XML declaration, and otherwise is false.
- </td>
- </tr>
-
- <tr>
- <td>lexical-handler/parameter-entities</td>
- <td><em>read/write</em></td>
- <td><em>unspecified</em></td>
- <td> A value of "true" indicates that the LexicalHandler will report
- the beginning and end of parameter entities.
- </td>
- </tr>
-
- <tr>
- <td>namespaces</td>
- <td><em>read/write</em></td>
- <td>true</td>
- <td> A value of "true" indicates namespace URIs and unprefixed local names
- for element and attribute names will be available.
- </td>
- </tr>
-
- <tr>
- <td>namespace-prefixes</td>
- <td><em>read/write</em></td>
- <td>false</td>
- <td> A value of "true" indicates that XML qualified names (with prefixes) and
- attributes (including <em>xmlns*</em> attributes) will be available.
- </td>
- </tr>
-
- <tr>
- <td>resolve-dtd-uris</td>
- <td><em>read/write</em></td>
- <td><em>true</em></td>
- <td> A value of "true" indicates that system IDs in declarations will
- be absolutized (relative to their base URIs) before reporting.
- (That is the default behavior for all SAX2 XML parsers.)
- A value of "false" indicates those IDs will not be absolutized;
- parsers will provide the base URI from
- <em>Locator.getSystemId()</em>.
- This applies to system IDs passed in <ul>
- <li><em>DTDHandler.notationDecl()</em>,
- <li><em>DTDHandler.unparsedEntityDecl()</em>, and
- <li><em>DeclHandler.externalEntityDecl()</em>.
- </ul>
- It does not apply to <em>EntityResolver.resolveEntity()</em>,
- which is not used to report declarations, or to
- <em>LexicalHandler.startDTD()</em>, which already provides
- the non-absolutized URI.
- </td>
- </tr>
-
- <tr>
- <td>string-interning</td>
- <td><em>read/write</em></td>
- <td><em>unspecified</em></td>
- <td> Has a value of "true" if all XML names (for elements, prefixes,
- attributes, entities, notations, and local names),
- as well as Namespace URIs, will have been interned
- using <em>java.lang.String.intern</em>. This supports fast
- testing of equality/inequality against string constants,
- rather than forcing slower calls to <em>String.equals()</em>.
- </td>
- </tr>
-
- <tr>
- <td>unicode-normalization-checking</td>
- <td><em>read/write</em></td>
- <td><em>false</em></td>
- <td> Controls whether the parser reports Unicode normalization
- errors as described in section 2.13 and Appendix B of the
- XML 1.1 Recommendation. If true, Unicode normalization
- errors are reported using the ErrorHandler.error() callback.
- Such errors are not fatal in themselves (though, obviously,
- other Unicode-related encoding errors may be).
- </td>
- </tr>
-
- <tr>
- <td>use-attributes2</td>
- <td><em>read-only</em></td>
- <td>not applicable</td>
- <td> Returns "true" if the <em>Attributes</em> objects passed by
- this parser in <em>ContentHandler.startElement()</em>
- implement the <a href="ext/Attributes2.html"
- ><em>org.xml.sax.ext.Attributes2</em></a> interface.
- That interface exposes additional DTD-related information,
- such as whether the attribute was specified in the
- source text rather than defaulted.
- </td>
- </tr>
-
- <tr>
- <td>use-locator2</td>
- <td><em>read-only</em></td>
- <td>not applicable</td>
- <td> Returns "true" if the <em>Locator</em> objects passed by
- this parser in <em>ContentHandler.setDocumentLocator()</em>
- implement the <a href="ext/Locator2.html"
- ><em>org.xml.sax.ext.Locator2</em></a> interface.
- That interface exposes additional entity information,
- such as the character encoding and XML version used.
- </td>
- </tr>
-
- <tr>
- <td>use-entity-resolver2</td>
- <td><em>read/write</em></td>
- <td><em>true</em></td>
- <td> Returns "true" if, when <em>setEntityResolver</em> is given
- an object implementing the <a href="ext/EntityResolver2.html"
- ><em>org.xml.sax.ext.EntityResolver2</em></a> interface,
- those new methods will be used.
- Returns "false" to indicate that those methods will not be used.
- </td>
- </tr>
-
- <tr>
- <td>validation</td>
- <td><em>read/write</em></td>
- <td><em>unspecified</em></td>
- <td> Controls whether the parser is reporting all validity
- errors; if true, all external entities will be read.
- </td>
- </tr>
-
- <tr>
- <td>xmlns-uris</td>
- <td><em>read/write</em></td>
- <td><em>false</em></td>
- <td> Controls whether, when the <em>namespace-prefixes</em> feature
- is set, the parser treats namespace declaration attributes as
- being in the <em>http://www.w3.org/2000/xmlns/</em> namespace.
- By default, SAX2 conforms to the original "Namespaces in XML"
- Recommendation, which explicitly states that such attributes are
- not in any namespace.
- Setting this optional flag to "true" makes the SAX2 events conform to
- a later backwards-incompatible revision of that recommendation,
- placing those attributes in a namespace.
- </td>
- </tr>
-
- <tr>
- <td>xml-1.1</td>
- <td><em>read-only</em></td>
- <td>not applicable</td>
- <td> Returns "true" if the parser supports both XML 1.1 and XML 1.0.
- Returns "false" if the parser supports only XML 1.0.
- </td>
- </tr>
-
-</table>
-
-<p> Support for the default values of the
-<em>namespaces</em> and <em>namespace-prefixes</em>
-properties is required.
-Support for any other feature flags is entirely optional.
-</p>
-
-<p> For default values not specified by SAX2,
-each XMLReader implementation specifies its default,
-or may choose not to expose the feature flag.
-Unless otherwise specified here,
-implementations may support changing current values
-of these standard feature flags, but not while parsing.
-</p>
-
-<h2> SAX2 Standard Handler and Property IDs </h2>
-
-<p> For parser interface characteristics that are described
-as objects, a separate namespace is defined. The
-objects in this namespace are again identified by URI, and
-the standard property URIs have the prefix
-<code>http://xml.org/sax/properties/</code> before an identifier such as
-<code>lexical-handler</code> or
-<code>dom-node</code>. Manage those properties using
-<em>setProperty()</em>. Those identifiers are: </p>
-
-<table border="1" cellpadding="3" cellspacing="0" width="100%">
- <tr align="center" bgcolor="#ccccff">
- <th>Property ID</th>
- <th>Description</th>
- </tr>
-
- <tr>
- <td>declaration-handler</td>
- <td> Used to see most DTD declarations except those treated
- as lexical ("document element name is ...") or which are
- mandatory for all SAX parsers (<em>DTDHandler</em>).
- The Object must implement <a href="ext/DeclHandler.html"
- ><em>org.xml.sax.ext.DeclHandler</em></a>.
- </td>
- </tr>
-
- <tr>
- <td>document-xml-version</td>
- <td> May be examined only during a parse, after the startDocument()
- callback has been completed; read-only. This property is a
- literal string describing the actual XML version of the document,
- such as "1.0" or "1.1".
- </td>
- </tr>
-
- <tr>
- <td>dom-node</td>
- <td> For "DOM Walker" style parsers, which ignore their
- <em>parser.parse()</em> parameters, this is used to
- specify the DOM (sub)tree being walked by the parser.
- The Object must implement the
- <em>org.w3c.dom.Node</em> interface.
- </td>
- </tr>
-
- <tr>
- <td>lexical-handler</td>
- <td> Used to see some syntax events that are essential in some
- applications: comments, CDATA delimiters, selected general
- entity inclusions, and the start and end of the DTD
- (and declaration of document element name).
- The Object must implement <a href="ext/LexicalHandler.html"
- ><em>org.xml.sax.ext.LexicalHandler</em></a>.
- </td>
- </tr>
-
- <tr>
- <td>xml-string</td>
- <td> Readable only during a parser callback, this exposes a <b>TBS</b>
- chunk of characters responsible for the current event. </td>
- </tr>
-
-</table>
-
-<p> All of these standard properties are optional;
-XMLReader implementations need not support them.
-</p>
-
-</body></html>